[
  {
    "path": ".gitignore",
    "content": "proj.win32/Debug.win32/\nproj.win32/FlappyBird.opensdf\nproj.win32/FlappyBird.sdf\nproj.android/assets/\nproj.android/bin/\nproj.android/obj/\nproj.android/gen/\nproj.android/libs/\nproj.android/.settings/\nproj.android/google-play-services_lib/bin/\nproj.android/google-play-services_lib/gen/\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 2.6)\n\nset(APP_NAME FlappyBird)\nproject (${APP_NAME})\n\ninclude(cocos2d/build/BuildHelpers.CMakeLists.txt)\n\noption(USE_CHIPMUNK \"Use chipmunk for physics library\" ON)\noption(USE_BOX2D \"Use box2d for physics library\" OFF)\noption(DEBUG_MODE \"Debug or release?\" ON)\n\nif(DEBUG_MODE)\n  set(CMAKE_BUILD_TYPE DEBUG)\nelse(DEBUG_MODE)\n  set(CMAKE_BUILD_TYPE RELEASE)\nendif(DEBUG_MODE)\n\nset(CMAKE_C_FLAGS_DEBUG \"-g -Wall -DCOCOS2D_DEBUG=1\")\nset(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})\n\nset(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} \"-std=c99\")\nset(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} \"-std=c++11\")\n\nif(USE_CHIPMUNK)\n  message(\"Using chipmunk ...\")\n  add_definitions(-DLINUX -DCC_ENABLE_CHIPMUNK_INTEGRATION=1)\nelseif(USE_BOX2D)\n  message(\"Using box2d ...\")\n  add_definitions(-DLINUX -DCC_ENABLE_BOX2D_INTEGRATION=1)\nelse(USE_CHIPMUNK)\n  message(FATAL_ERROR \"Must choose a physics library.\")\nendif(USE_CHIPMUNK)\n\n# architecture\nif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )\nset(ARCH_DIR \"64-bit\")\nelse()\nset(ARCH_DIR \"32-bit\")\nendif()\n\n\nset(GAME_SRC\n  proj.linux/main.cpp\n  Classes/AppDelegate.cpp\n)\n\nset(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d)\n\ninclude_directories(\n  /usr/local/include/GLFW\n  Classes\n  ${COCOS2D_ROOT}/cocos/scripting/lua/bindings\n  ${COCOS2D_ROOT}/external/lua/lua\n  ${COCOS2D_ROOT}/external/lua/tolua\n  ${COCOS2D_ROOT}\n  ${COCOS2D_ROOT}/cocos\n  ${COCOS2D_ROOT}/cocos/audio/include\n  ${COCOS2D_ROOT}/cocos/2d\n  ${COCOS2D_ROOT}/cocos/2d/renderer\n  ${COCOS2D_ROOT}/cocos/2d/platform\n  ${COCOS2D_ROOT}/cocos/2d/platform/desktop\n  ${COCOS2D_ROOT}/cocos/2d/platform/linux\n  ${COCOS2D_ROOT}/cocos/base\n  ${COCOS2D_ROOT}/cocos/physics\n  ${COCOS2D_ROOT}/cocos/editor-support\n  ${COCOS2D_ROOT}/cocos/math/kazmath/include\n  ${COCOS2D_ROOT}/extensions\n  ${COCOS2D_ROOT}/external\n  ${COCOS2D_ROOT}/external/edtaa3func\n  ${COCOS2D_ROOT}/external/jpeg/include/linux\n  ${COCOS2D_ROOT}/external/tiff/include/linux\n  ${COCOS2D_ROOT}/external/webp/include/linux\n  ${COCOS2D_ROOT}/external/tinyxml2\n  ${COCOS2D_ROOT}/external/unzip\n  ${COCOS2D_ROOT}/external/chipmunk/include/chipmunk\n  ${COCOS2D_ROOT}/external/freetype2/include/linux\n  ${COCOS2D_ROOT}/external/linux-specific/fmod/include/${ARCH_DIR}\n)\n\nlink_directories(\n  /usr/local/lib\n  ${COCOS2D_ROOT}/external/jpeg/prebuilt/linux/${ARCH_DIR}\n  ${COCOS2D_ROOT}/external/tiff/prebuilt/linux/${ARCH_DIR}\n  ${COCOS2D_ROOT}/external/webp/prebuilt/linux/${ARCH_DIR}\n  ${COCOS2D_ROOT}/external/freetype2/prebuilt/linux/${ARCH_DIR}\n  ${COCOS2D_ROOT}/external/linux-specific/fmod/prebuilt/${ARCH_DIR}\n)\n\n# kazmath\nadd_subdirectory(${COCOS2D_ROOT}/cocos/math/kazmath)\n\n# chipmunk library\nadd_subdirectory(${COCOS2D_ROOT}/external/chipmunk/src)\n\n# box2d library\nadd_subdirectory(${COCOS2D_ROOT}/external/Box2D)\n\n# unzip library\nadd_subdirectory(${COCOS2D_ROOT}/external/unzip)\n\n# tinyxml2 library\nadd_subdirectory(${COCOS2D_ROOT}/external/tinyxml2)\n\n# audio\nadd_subdirectory(${COCOS2D_ROOT}/cocos/audio)\n\n# cocos base library\nadd_subdirectory(${COCOS2D_ROOT}/cocos/base)\n\n# cocos 2d library\nadd_subdirectory(${COCOS2D_ROOT}/cocos/2d)\n\n# gui\nadd_subdirectory(${COCOS2D_ROOT}/cocos/gui)\n\n# network\nadd_subdirectory(${COCOS2D_ROOT}/cocos/network)\n\n# extensions\nadd_subdirectory(${COCOS2D_ROOT}/extensions)\n\n## Editor Support\n\n# spine\nadd_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/spine)\n\n# cocosbuilder\nadd_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocosbuilder)\n\n# cocostudio\nadd_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocostudio)\n\n## Scripting\n# lua\nadd_subdirectory(${COCOS2D_ROOT}/external/lua/lua)\n\n# tolua\nadd_subdirectory(${COCOS2D_ROOT}/external/lua/tolua)\n\n# luabinding\nadd_subdirectory(${COCOS2D_ROOT}/cocos/scripting)\n\n# add the executable\nadd_executable(${APP_NAME}\n  ${GAME_SRC}\n)\n\nif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )\nset(FMOD_LIB \"fmodex64\")\nelse()\nset(FMOD_LIB \"fmodex\")\nendif()\n\ntarget_link_libraries(${APP_NAME}\n  luabinding\n  gui\n  network\n  spine\n  cocostudio\n  cocosbuilder\n  extensions\n  audio\n  cocos2d\n  )\n\nset(APP_BIN_DIR \"${CMAKE_BINARY_DIR}/bin\")\n\nset_target_properties(${APP_NAME} PROPERTIES\n     RUNTIME_OUTPUT_DIRECTORY  \"${APP_BIN_DIR}\")\n\npre_build(${APP_NAME}\n  COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources\n  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources\n  COMMAND ${CMAKE_COMMAND} -E copy_directory ${COCOS2D_ROOT}/cocos/scripting/lua/script ${APP_BIN_DIR}/Resources\n  )\n\n"
  },
  {
    "path": "Classes/AdmobHelper.cpp",
    "content": "#include <cocos2d.h>\n\n#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID\n#include \"AdmobHelper.h\"\n#include \"platform/android/jni/JniHelper.h\"\n#include <jni.h>\n#include <android/log.h>\n\nconst char* NativeActivityClassName = \"org/cocos2dx/lua/Cocos2dxActivity\";\n\nvoid AdmobHelper::showAds(){\n\tcocos2d::JniMethodInfo t;\n\tif (cocos2d::JniHelper::getStaticMethodInfo(t\n                                                , NativeActivityClassName\n                                                , \"showAdPopup\"\n                                                , \"()V\"))\n\t{\n\t\tt.env->CallStaticVoidMethod(t.classID, t.methodID);\n\t\tt.env->DeleteLocalRef(t.classID);\n\t}\n}\n\n#endif"
  },
  {
    "path": "Classes/AdmobHelper.h",
    "content": "#ifndef  __Admob_Helper_H_\n#define  __Admob_Helper_H_\n\nclass AdmobHelper\n{\npublic:\n    static void showAds();\n};\n#endif  //__INTERFACE_FACEBOOK_H_\n"
  },
  {
    "path": "Classes/AppDelegate.cpp",
    "content": "#include \"AppDelegate.h\"\n#include \"CCLuaEngine.h\"\n#include \"SimpleAudioEngine.h\"\n#include \"LuaInterface/lua_tinker.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n#include \"AdmobHelper.h\"\n\nvoid showAds()\n{\n\tAdmobHelper::showAds();\n}\n#endif\n\nusing namespace CocosDenshion;\n\nUSING_NS_CC;\n\nAppDelegate::AppDelegate()\n{\n}\n\nAppDelegate::~AppDelegate()\n{\n    SimpleAudioEngine::end();\n}\n\nbool AppDelegate::applicationDidFinishLaunching()\n{\n    // initialize director\n    auto director = Director::getInstance();\n    director->setOpenGLView(EGLView::getInstance());\n\n    EGLView::getInstance()->setDesignResolutionSize(288, 512, ResolutionPolicy::EXACT_FIT);\n\n    // turn on display FPS\n    director->setDisplayStats(false);\n\n    // set FPS. the default value is 1.0/60 if you don't call this\n    director->setAnimationInterval(1.0 / 60);\n\n    // register lua engine\n    auto engine = LuaEngine::getInstance();\n    ScriptEngineManager::getInstance()->setScriptEngine(engine);\n    \n    //The call was commented because it will lead to ZeroBrane Studio can't find correct context when debugging\n    //engine->executeScriptFile(\"hello.lua\");\n    engine->executeString(\"require 'main.lua'\");\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n\t//AdmobHelper::showAds();\n\t//bind func to lua\n\tlua_State * L = LuaEngine::getInstance()->getLuaStack()->getLuaState();\n\tlua_tinker::def(L, \"showAds\", showAds);\n#endif\n    \n    return true;\n}\n\n// This function will be called when the app is inactive. When comes a phone call,it's be invoked too\nvoid AppDelegate::applicationDidEnterBackground()\n{\n    Director::getInstance()->stopAnimation();\n\n    SimpleAudioEngine::getInstance()->pauseBackgroundMusic();\n}\n\n// this function will be called when the app is active again\nvoid AppDelegate::applicationWillEnterForeground()\n{\n    Director::getInstance()->startAnimation();\n\n    SimpleAudioEngine::getInstance()->resumeBackgroundMusic();\n}\n"
  },
  {
    "path": "Classes/AppDelegate.h",
    "content": "#ifndef __APP_DELEGATE_H__\n#define __APP_DELEGATE_H__\n\n#include \"cocos2d.h\"\n\n/**\n@brief    The cocos2d Application.\n\nThe reason for implement as private inheritance is to hide some interface call by Director.\n*/\nclass  AppDelegate : private cocos2d::Application\n{\npublic:\n    AppDelegate();\n    virtual ~AppDelegate();\n\n    /**\n    @brief    Implement Director and Scene init code here.\n    @return true    Initialize success, app continue.\n    @return false   Initialize failed, app terminate.\n    */\n    virtual bool applicationDidFinishLaunching();\n\n    /**\n    @brief  The function be called when the application enter background\n    @param  the pointer of the application\n    */\n    virtual void applicationDidEnterBackground();\n\n    /**\n    @brief  The function be called when the application enter foreground\n    @param  the pointer of the application\n    */\n    virtual void applicationWillEnterForeground();\n};\n\n#endif  // __APP_DELEGATE_H__\n\n"
  },
  {
    "path": "Classes/LuaInterface/lua_tinker.cpp",
    "content": "// lua_tinker.cpp\n//\n// LuaTinker - Simple and light C++ wrapper for Lua.\n//\n// Copyright (c) 2005-2007 Kwon-il Lee (zupet@hitel.net)\n// \n// please check Licence.txt file for licence and legal issues. \n\n#include <iostream>\n\nextern \"C\" \n{\n\t#include \"lua.h\"\n\t#include \"lualib.h\"\n\t#include \"lauxlib.h\"\n};\n\n#include \"lua_tinker.h\"\n\n\n/*---------------------------------------------------------------------------*/ \n/* init                                                                      */ \n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::init(lua_State *L)\n{\n\tinit_s64(L);\n\tinit_u64(L);\n}\n\n/*---------------------------------------------------------------------------*/ \n/* __s64                                                                     */ \n/*---------------------------------------------------------------------------*/ \nstatic int tostring_s64(lua_State *L)\n{\n\tchar temp[64];\n\tsprintf(temp, \"%I64d\", *(long long*)lua_topointer(L, 1));\n\tlua_pushstring(L, temp);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nstatic int eq_s64(lua_State *L)\n{\n\tlua_pushboolean(L, memcmp(lua_topointer(L, 1), lua_topointer(L, 2), sizeof(long long)) == 0);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nstatic int lt_s64(lua_State *L)\n{\n\tlua_pushboolean(L, memcmp(lua_topointer(L, 1), lua_topointer(L, 2), sizeof(long long)) < 0);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nstatic int le_s64(lua_State *L)\n{\n\tlua_pushboolean(L, memcmp(lua_topointer(L, 1), lua_topointer(L, 2), sizeof(long long)) <= 0);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::init_s64(lua_State *L)\n{\n\tconst char* name = \"__s64\";\n\tlua_pushstring(L, name);\n\tlua_newtable(L);\n\n\tlua_pushstring(L, \"__name\");\n\tlua_pushstring(L, name);\n\tlua_rawset(L, -3);\n\n\tlua_pushstring(L, \"__tostring\");\n\tlua_pushcclosure(L, tostring_s64, 0);\n\tlua_rawset(L, -3);\n\n\tlua_pushstring(L, \"__eq\");\n\tlua_pushcclosure(L, eq_s64, 0);\n\tlua_rawset(L, -3);\t\n\n\tlua_pushstring(L, \"__lt\");\n\tlua_pushcclosure(L, lt_s64, 0);\n\tlua_rawset(L, -3);\t\n\n\tlua_pushstring(L, \"__le\");\n\tlua_pushcclosure(L, le_s64, 0);\n\tlua_rawset(L, -3);\t\n\n\tlua_settable(L, LUA_GLOBALSINDEX);\n}\n\n/*---------------------------------------------------------------------------*/ \n/* __u64                                                                     */ \n/*---------------------------------------------------------------------------*/ \nstatic int tostring_u64(lua_State *L)\n{\n\tchar temp[64];\n\tsprintf(temp, \"%I64u\", *(unsigned long long*)lua_topointer(L, 1));\n\tlua_pushstring(L, temp);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nstatic int eq_u64(lua_State *L)\n{\n\tlua_pushboolean(L, memcmp(lua_topointer(L, 1), lua_topointer(L, 2), sizeof(unsigned long long)) == 0);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nstatic int lt_u64(lua_State *L)\n{\n\tlua_pushboolean(L, memcmp(lua_topointer(L, 1), lua_topointer(L, 2), sizeof(unsigned long long)) < 0);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nstatic int le_u64(lua_State *L)\n{\n\tlua_pushboolean(L, memcmp(lua_topointer(L, 1), lua_topointer(L, 2), sizeof(unsigned long long)) <= 0);\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::init_u64(lua_State *L)\n{\n\tconst char* name = \"__u64\";\n\tlua_pushstring(L, name);\n\tlua_newtable(L);\n\n\tlua_pushstring(L, \"__name\");\n\tlua_pushstring(L, name);\n\tlua_rawset(L, -3);\n\n\tlua_pushstring(L, \"__tostring\");\n\tlua_pushcclosure(L, tostring_u64, 0);\n\tlua_rawset(L, -3);\n\n\tlua_pushstring(L, \"__eq\");\n\tlua_pushcclosure(L, eq_u64, 0);\n\tlua_rawset(L, -3);\t\n\n\tlua_pushstring(L, \"__lt\");\n\tlua_pushcclosure(L, lt_u64, 0);\n\tlua_rawset(L, -3);\t\n\n\tlua_pushstring(L, \"__le\");\n\tlua_pushcclosure(L, le_u64, 0);\n\tlua_rawset(L, -3);\t\n\n\tlua_settable(L, LUA_GLOBALSINDEX);\n}\n\n/*---------------------------------------------------------------------------*/ \n/* excution                                                                  */ \n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::dofile(lua_State *L, const char *filename)\n{\n\tlua_pushcclosure(L, on_error, 0);\n\tint errfunc = lua_gettop(L);\n\n    if(luaL_loadfile(L, filename) == 0)\n\t{\n\t\tlua_pcall(L, 0, 1, errfunc);\n\t}\n\telse\n\t{\n\t\tprint_error(L, \"%s\", lua_tostring(L, -1));\n\t}\n\n\tlua_remove(L, errfunc);\n\tlua_pop(L, 1);\n}\n\n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::dostring(lua_State *L, const char* buff)\n{\n\tlua_tinker::dobuffer(L, buff, strlen(buff));\n}\n\n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::dobuffer(lua_State *L, const char* buff, size_t len)\n{\n\tlua_pushcclosure(L, on_error, 0);\n\tint errfunc = lua_gettop(L);\n\n    if(luaL_loadbuffer(L, buff, len, \"lua_tinker::dobuffer()\") == 0)\n\t{\n\t\tlua_pcall(L, 0, 1, errfunc);\n\t}\n\telse\n\t{\n\t\tprint_error(L, \"%s\", lua_tostring(L, -1));\n\t}\n\n\tlua_remove(L, errfunc);\n\tlua_pop(L, 1);\n}\n\n/*---------------------------------------------------------------------------*/ \n/* debug helpers                                                             */ \n/*---------------------------------------------------------------------------*/ \nstatic void call_stack(lua_State* L, int n)\n{\n    lua_Debug ar;\n    if(lua_getstack(L, n, &ar) == 1)\n\t{\n\t\tlua_getinfo(L, \"nSlu\", &ar);\n\n\t\tconst char* indent;\n\t\tif(n == 0)\n\t\t{\n\t\t\tindent = \"->\\t\";\n\t\t\tlua_tinker::print_error(L, \"\\t<call stack>\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tindent = \"\\t\";\n\t\t}\n\n\t\tif(ar.name)\n\t\t\tlua_tinker::print_error(L, \"%s%s() : line %d [%s : line %d]\", indent, ar.name, ar.currentline, ar.source, ar.linedefined);\n\t\telse\n\t\t\tlua_tinker::print_error(L, \"%sunknown : line %d [%s : line %d]\", indent, ar.currentline, ar.source, ar.linedefined);\n\n\t\tcall_stack(L, n+1);\n\t}\n}\n\n/*---------------------------------------------------------------------------*/ \nint lua_tinker::on_error(lua_State *L)\n{\n\tprint_error(L, \"%s\", lua_tostring(L, -1));\n\n\tcall_stack(L, 0);\n\n\treturn 0;\n}\n\n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::print_error(lua_State *L, const char* fmt, ...)\n{\n\tchar text[4096];\n\n\tva_list args;\n\tva_start(args, fmt);\n\tvsprintf(text, fmt, args);\n\tva_end(args);\n\n\tlua_pushstring(L, \"_ALERT\");\n\tlua_gettable(L, LUA_GLOBALSINDEX);\n\tif(lua_isfunction(L, -1))\n\t{\n\t\tlua_pushstring(L, text);\n\t\tlua_call(L, 1, 0);\n\t}\n\telse\n\t{\n\t\tprintf(\"%s\\n\", text);\n\t\tlua_pop(L, 1);\n\t}\n}\n\n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::enum_stack(lua_State *L)\n{\n\tint top = lua_gettop(L);\n\tprint_error(L, \"Type:%d\", top);\n\tfor(int i=1; i<=lua_gettop(L); ++i)\n\t{\n\t\tswitch(lua_type(L, i))\n\t\t{\n\t\tcase LUA_TNIL:\n\t\t\tprint_error(L, \"\\t%s\", lua_typename(L, lua_type(L, i)));\n\t\t\tbreak;\n\t\tcase LUA_TBOOLEAN:\n\t\t\tprint_error(L, \"\\t%s\t%s\", lua_typename(L, lua_type(L, i)), lua_toboolean(L, i)?\"true\":\"false\");\n\t\t\tbreak;\n\t\tcase LUA_TLIGHTUSERDATA:\n\t\t\tprint_error(L, \"\\t%s\t0x%08p\", lua_typename(L, lua_type(L, i)), lua_topointer(L, i));\n\t\t\tbreak;\n\t\tcase LUA_TNUMBER:\n\t\t\tprint_error(L, \"\\t%s\t%f\", lua_typename(L, lua_type(L, i)), lua_tonumber(L, i));\n\t\t\tbreak;\n\t\tcase LUA_TSTRING:\n\t\t\tprint_error(L, \"\\t%s\t%s\", lua_typename(L, lua_type(L, i)), lua_tostring(L, i));\n\t\t\tbreak;\n\t\tcase LUA_TTABLE:\n\t\t\tprint_error(L, \"\\t%s\t0x%08p\", lua_typename(L, lua_type(L, i)), lua_topointer(L, i));\n\t\t\tbreak;\n\t\tcase LUA_TFUNCTION:\n\t\t\tprint_error(L, \"\\t%s()\t0x%08p\", lua_typename(L, lua_type(L, i)), lua_topointer(L, i));\n\t\t\tbreak;\n\t\tcase LUA_TUSERDATA:\n\t\t\tprint_error(L, \"\\t%s\t0x%08p\", lua_typename(L, lua_type(L, i)), lua_topointer(L, i));\n\t\t\tbreak;\n\t\tcase LUA_TTHREAD:\n\t\t\tprint_error(L, \"\\t%s\", lua_typename(L, lua_type(L, i)));\n\t\t\tbreak;\n\t\t}\n\t}\n}\n \n/*---------------------------------------------------------------------------*/ \n/* read                                                                      */ \n/*---------------------------------------------------------------------------*/ \ntemplate<>\nchar* lua_tinker::read(lua_State *L, int index)\n{\n\treturn (char*)lua_tostring(L, index);\t\t\t\t\n}\n\ntemplate<>\nconst char* lua_tinker::read(lua_State *L, int index)\n{\n\treturn (const char*)lua_tostring(L, index);\t\t\n}\n\ntemplate<>\nchar lua_tinker::read(lua_State *L, int index)\n{\n\treturn (char)lua_tonumber(L, index);\t\t\t\t\n}\n\ntemplate<>\nunsigned char lua_tinker::read(lua_State *L, int index)\n{\n\treturn (unsigned char)lua_tonumber(L, index);\t\t\n}\n\ntemplate<>\nshort lua_tinker::read(lua_State *L, int index)\n{\n\treturn (short)lua_tonumber(L, index);\t\t\t\t\n}\n\ntemplate<>\nunsigned short lua_tinker::read(lua_State *L, int index)\n{\n\treturn (unsigned short)lua_tonumber(L, index);\t\n}\n\ntemplate<>\nlong lua_tinker::read(lua_State *L, int index)\n{\n\treturn (long)lua_tonumber(L, index);\t\t\t\t\n}\n\ntemplate<>\nunsigned long lua_tinker::read(lua_State *L, int index)\n{\n\treturn (unsigned long)lua_tonumber(L, index);\t\t\n}\n\ntemplate<>\nint lua_tinker::read(lua_State *L, int index)\n{\n\treturn (int)lua_tonumber(L, index);\t\t\t\t\n}\n\ntemplate<>\nunsigned int lua_tinker::read(lua_State *L, int index)\n{\n\treturn (unsigned int)lua_tonumber(L, index);\t\t\n}\n\ntemplate<>\nfloat lua_tinker::read(lua_State *L, int index)\n{\n\treturn (float)lua_tonumber(L, index);\t\t\t\t\n}\n\ntemplate<>\ndouble lua_tinker::read(lua_State *L, int index)\n{\n\treturn (double)lua_tonumber(L, index);\t\t\t\n}\n\ntemplate<>\nbool lua_tinker::read(lua_State *L, int index)\n{\n\tif(lua_isboolean(L, index))\n\t\treturn lua_toboolean(L, index) != 0;\t\t\t\t\n\telse\n\t\treturn lua_tonumber(L, index) != 0;\n}\n\ntemplate<>\nvoid lua_tinker::read(lua_State *L, int index)\n{\n\treturn;\t\t\t\t\t\t\t\t\t\t\t\n}\n\ntemplate<>\nlong long lua_tinker::read(lua_State *L, int index)\n{\n\tif(lua_isnumber(L,index))\n\t\treturn (long long)lua_tonumber(L, index);\n\telse\n\t\treturn *(long long*)lua_touserdata(L, index);\n}\ntemplate<>\nunsigned long long lua_tinker::read(lua_State *L, int index)\n{\n\tif(lua_isnumber(L,index))\n\t\treturn (unsigned long long)lua_tonumber(L, index);\n\telse\n\t\treturn *(unsigned long long*)lua_touserdata(L, index);\n}\n\ntemplate<>\nlua_tinker::table lua_tinker::read(lua_State *L, int index)\n{\n\treturn table(L, index);\n}\n\n/*---------------------------------------------------------------------------*/ \n/* push                                                                      */ \n/*---------------------------------------------------------------------------*/ \ntemplate<>\nvoid lua_tinker::push(lua_State *L, char ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, unsigned char ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, short ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, unsigned short ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, long ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, unsigned long ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, int ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, unsigned int ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, float ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, double ret)\n{\n\tlua_pushnumber(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, char* ret)\n{\n\tlua_pushstring(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, const char* ret)\n{\n\tlua_pushstring(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, bool ret)\n{\n\tlua_pushboolean(L, ret);\t\t\t\t\t\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, lua_value* ret)\n{\n\tif(ret) ret->to_lua(L); else lua_pushnil(L);\t\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, long long ret)\t\t\t\n{ \n\t*(long long*)lua_newuserdata(L, sizeof(long long)) = ret;\n\tlua_pushstring(L, \"__s64\");\n\tlua_gettable(L, LUA_GLOBALSINDEX);\n\tlua_setmetatable(L, -2);\n}\ntemplate<>\nvoid lua_tinker::push(lua_State *L, unsigned long long ret)\n{\n\t*(unsigned long long*)lua_newuserdata(L, sizeof(unsigned long long)) = ret;\n\tlua_pushstring(L, \"__u64\");\n\tlua_gettable(L, LUA_GLOBALSINDEX);\n\tlua_setmetatable(L, -2);\n}\n\ntemplate<>\nvoid lua_tinker::push(lua_State *L, lua_tinker::table ret)\n{\n\tlua_pushvalue(L, ret.m_obj->m_index);\n}\n\n/*---------------------------------------------------------------------------*/ \n/* pop                                                                       */ \n/*---------------------------------------------------------------------------*/ \ntemplate<>\nvoid lua_tinker::pop(lua_State *L)\n{\n\tlua_pop(L, 1);\n}\n\ntemplate<>\t\nlua_tinker::table lua_tinker::pop(lua_State *L)\n{\n\treturn table(L, lua_gettop(L));\n}\n\n/*---------------------------------------------------------------------------*/ \n/* Tinker Class Helper                                                       */ \n/*---------------------------------------------------------------------------*/ \nstatic void invoke_parent(lua_State *L)\n{\n\tlua_pushstring(L, \"__parent\");\n\tlua_rawget(L, -2);\n\tif(lua_istable(L,-1))\n\t{\n\t\tlua_pushvalue(L,2);\n\t\tlua_rawget(L, -2);\n\t\tif(!lua_isnil(L,-1))\n\t\t{\n\t\t\tlua_remove(L,-2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlua_remove(L, -1);\n\t\t\tinvoke_parent(L);\n\t\t\tlua_remove(L,-2);\n\t\t}\n\t}\n}\n\n/*---------------------------------------------------------------------------*/ \nint lua_tinker::meta_get(lua_State *L)\n{\n\tlua_getmetatable(L,1);\n\tlua_pushvalue(L,2);\n\tlua_rawget(L,-2);\n\n\tif(lua_isuserdata(L,-1))\n\t{\n\t\tuser2type<var_base*>::invoke(L,-1)->get(L);\n\t\tlua_remove(L, -2);\n\t}\n\telse if(lua_isnil(L,-1))\n\t{\n\t\tlua_remove(L,-1);\n\t\tinvoke_parent(L);\n\t\tif(lua_isnil(L,-1))\n\t\t{\n\t\t\tlua_pushfstring(L, \"can't find '%s' class variable. (forgot registering class variable ?)\", lua_tostring(L, 2));\n\t\t\tlua_error(L);\n\t\t}\n\t} \n\n\tlua_remove(L,-2);\n\n\treturn 1;\n}\n\n/*---------------------------------------------------------------------------*/ \nint lua_tinker::meta_set(lua_State *L)\n{\n\tlua_getmetatable(L,1);\n\tlua_pushvalue(L,2);\n\tlua_rawget(L,-2);\n\n\tif(lua_isuserdata(L,-1))\n\t{\n\t\tuser2type<var_base*>::invoke(L,-1)->set(L);\n\t}\n\telse if(lua_isnil(L, -1))\n\t{\n\t\tlua_pushvalue(L,2);\n\t\tlua_pushvalue(L,3);\n\t\tlua_rawset(L, -4);\n\t}\n\tlua_settop(L, 3);\n\treturn 0;\n}\n\n/*---------------------------------------------------------------------------*/ \nvoid lua_tinker::push_meta(lua_State *L, const char* name)\n{\n\tlua_pushstring(L, name);\n\tlua_gettable(L, LUA_GLOBALSINDEX);\n}\n\n/*---------------------------------------------------------------------------*/ \n/* table object on stack                                                     */ \n/*---------------------------------------------------------------------------*/ \nlua_tinker::table_obj::table_obj(lua_State* L, int index)\n\t:m_L(L)\n\t,m_index(index)\n\t,m_ref(0)\n{\n\tif(lua_isnil(m_L, m_index))\n\t{\n\t\tm_pointer = NULL;\n\t\tlua_remove(m_L, m_index);\n\t}\n\telse\n\t{\n\t\tm_pointer = lua_topointer(m_L, m_index);\n\t}\n}\n\nlua_tinker::table_obj::~table_obj()\n{\n\tif(validate())\n\t{\n\t\tlua_remove(m_L, m_index);\n\t}\n}\n\nvoid lua_tinker::table_obj::inc_ref()\n{\n\t++m_ref;\n}\n\nvoid lua_tinker::table_obj::dec_ref()\n{\n\tif(--m_ref == 0)\n\t\tdelete this;\n}\n\nbool lua_tinker::table_obj::validate()\n{\n\tif(m_pointer != NULL)\n\t{\n\t\tif(m_pointer == lua_topointer(m_L, m_index))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint top = lua_gettop(m_L);\n\n\t\t\tfor(int i=1; i<=top; ++i)\n\t\t\t{\n\t\t\t\tif(m_pointer == lua_topointer(m_L, i))\n\t\t\t\t{\n\t\t\t\t\tm_index = i;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tm_pointer = NULL;\n\t\t\treturn false;\n\t\t}\n\t}\n\telse\n\t{\n        return false;\n\t}\n}\n\n/*---------------------------------------------------------------------------*/ \n/* Table Object Holder                                                       */ \n/*---------------------------------------------------------------------------*/ \nlua_tinker::table::table(lua_State* L)\n{\n\tlua_newtable(L);\n\n\tm_obj = new table_obj(L, lua_gettop(L));\n\n\tm_obj->inc_ref();\n}\n\nlua_tinker::table::table(lua_State* L, const char* name)\n{\n\tlua_pushstring(L, name);\n\tlua_gettable(L, LUA_GLOBALSINDEX);\n\n\tif(lua_istable(L, -1) == 0)\n\t{\n\t\tlua_pop(L, 1);\n\n\t\tlua_newtable(L);\n\t\tlua_pushstring(L, name);\n\t\tlua_pushvalue(L, -2);\n\t\tlua_settable(L, LUA_GLOBALSINDEX);\n\t}\n\n\tm_obj = new table_obj(L, lua_gettop(L));\n}\n\nlua_tinker::table::table(lua_State* L, int index)\n{\n\tif(index < 0)\n\t{\n\t\tindex = lua_gettop(L) + index + 1;\n\t}\n\n\tm_obj = new table_obj(L, index);\n\n\tm_obj->inc_ref();\n}\n\nlua_tinker::table::table(const table& input)\n{\n\tm_obj = input.m_obj;\n\n\tm_obj->inc_ref();\n}\n\nlua_tinker::table::~table()\n{\n\tm_obj->dec_ref();\n}\n\n/*---------------------------------------------------------------------------*/ \n"
  },
  {
    "path": "Classes/LuaInterface/lua_tinker.h",
    "content": "// lua_tinker.h\n//\n// LuaTinker - Simple and light C++ wrapper for Lua.\n//\n// Copyright (c) 2005-2007 Kwon-il Lee (zupet@hitel.net)\n// \n// please check Licence.txt file for licence and legal issues. \n\n#if !defined(_LUA_TINKER_H_)\n#define _LUA_TINKER_H_\n\n#include <new>\n#include <string.h>\n\nnamespace lua_tinker\n{\n\t// init LuaTinker\n\tvoid\tinit(lua_State *L);\n\n\tvoid\tinit_s64(lua_State *L);\n\tvoid\tinit_u64(lua_State *L);\n\n\t// string-buffer excution\n\tvoid\tdofile(lua_State *L, const char *filename);\n\tvoid\tdostring(lua_State *L, const char* buff);\n\tvoid\tdobuffer(lua_State *L, const char* buff, size_t sz);\n\t\n\t// debug helpers\n\tvoid\tenum_stack(lua_State *L);\n\tint\t\ton_error(lua_State *L);\n\tvoid\tprint_error(lua_State *L, const char* fmt, ...);\n\n\t// dynamic type extention\n\tstruct lua_value\n\t{\n\t\tvirtual void to_lua(lua_State *L) = 0;\n\t};\n\n\t// type trait\n\ttemplate<typename T> struct class_name;\n\tstruct table;\n\n\ttemplate<bool C, typename A, typename B> struct if_ {};\n\ttemplate<typename A, typename B>\t\tstruct if_<true, A, B> { typedef A type; };\n\ttemplate<typename A, typename B>\t\tstruct if_<false, A, B> { typedef B type; };\n\n\ttemplate<typename A>\n\tstruct is_ptr { static const bool value = false; };\n\ttemplate<typename A>\n\tstruct is_ptr<A*> { static const bool value = true; };\n\n\ttemplate<typename A>\n\tstruct is_ref { static const bool value = false; };\n\ttemplate<typename A>\n\tstruct is_ref<A&> { static const bool value = true; };\n\n\ttemplate<typename A>\n\tstruct remove_const { typedef A type; };\n\ttemplate<typename A>\n\tstruct remove_const<const A> { typedef A type; };\n\n\ttemplate<typename A>\n\tstruct base_type { typedef A type; };\n\ttemplate<typename A>\n\tstruct base_type<A*> { typedef A type; };\n\ttemplate<typename A>\n\tstruct base_type<A&> { typedef A type; };\n\n\ttemplate<typename A>\n\tstruct class_type { typedef typename remove_const<typename base_type<A>::type>::type type; };\n\t\n\ttemplate<typename A>\n\tstruct is_obj { static const bool value = true; };\n\ttemplate<> struct is_obj<char>\t\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<unsigned char>\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<short>\t\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<unsigned short>\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<long>\t\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<unsigned long>\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<int>\t\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<unsigned int>\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<float>\t\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<double>\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<char*>\t\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<const char*>\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<bool>\t\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<lua_value*>\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<long long>\t\t\t\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<unsigned long long>\t{ static const bool value = false; };\n\ttemplate<> struct is_obj<table>\t\t\t\t\t{ static const bool value = false; };\n\n\t/////////////////////////////////\n\tenum { no = 1, yes = 2 }; \n\ttypedef char (& no_type )[no]; \n\ttypedef char (& yes_type)[yes]; \n\n\tstruct int_conv_type { int_conv_type(int); }; \n\n\tno_type int_conv_tester (...); \n\tyes_type int_conv_tester (int_conv_type); \n\n\tno_type vfnd_ptr_tester (const volatile char *); \n\tno_type vfnd_ptr_tester (const volatile short *); \n\tno_type vfnd_ptr_tester (const volatile int *); \n\tno_type vfnd_ptr_tester (const volatile long *); \n\tno_type vfnd_ptr_tester (const volatile double *); \n\tno_type vfnd_ptr_tester (const volatile float *); \n\tno_type vfnd_ptr_tester (const volatile bool *); \n\tyes_type vfnd_ptr_tester (const volatile void *); \n\n\ttemplate <typename T> T* add_ptr(T&); \n\n\ttemplate <bool C> struct bool_to_yesno { typedef no_type type; }; \n\ttemplate <> struct bool_to_yesno<true> { typedef yes_type type; }; \n\n\ttemplate <typename T> \n\tstruct is_enum \n\t{ \n\t\tstatic T arg; \n\t\tstatic const bool value = ( (sizeof(int_conv_tester(arg)) == sizeof(yes_type)) && (sizeof(vfnd_ptr_tester(add_ptr(arg))) == sizeof(yes_type)) ); \n\t}; \n\t/////////////////////////////////\n\n\t// from lua\n\ttemplate<typename T>\n\tstruct void2val { static T invoke(void* input){ return *(T*)input; } };\n\ttemplate<typename T>\n\tstruct void2ptr { static T* invoke(void* input){ return (T*)input; } };\n\ttemplate<typename T>\n\tstruct void2ref { static T& invoke(void* input){ return *(T*)input; } };\n\n\ttemplate<typename T>  \n\tstruct void2type\n\t{\n\t\tstatic T invoke(void* ptr)\n\t\t{\n\t\t\treturn\tif_<is_ptr<T>::value\n\t\t\t\t\t\t,void2ptr<typename base_type<T>::type>\n\t\t\t\t\t\t,typename if_<is_ref<T>::value\n\t\t\t\t\t\t\t,void2ref<typename base_type<T>::type>\n\t\t\t\t\t\t\t,void2val<typename base_type<T>::type>\n\t\t\t\t\t\t>::type\n\t\t\t\t\t>::type::invoke(ptr);\n\t\t}\n\t};\n\n\tstruct user\n\t{\n\t\tuser(void* p) : m_p(p) {}\n\t\tvirtual ~user() {}\n\t\tvoid* m_p;\n\t};\n\n\ttemplate<typename T>  \n\tstruct user2type { static T invoke(lua_State *L, int index) { return void2type<T>::invoke(lua_touserdata(L, index)); } };\n\n\ttemplate<typename T>\n\tstruct lua2enum { static T invoke(lua_State *L, int index) { return (T)(int)lua_tonumber(L, index); } };\n\n\ttemplate<typename T>\n\tstruct lua2object\n\t{ \n\t\tstatic T invoke(lua_State *L, int index) \n\t\t{ \n\t\t\tif(!lua_isuserdata(L,index))\n\t\t\t{\n\t\t\t\tlua_pushstring(L, \"no class at first argument. (forgot ':' expression ?)\");\n\t\t\t\tlua_error(L);\n\t\t\t}\n\t\t\treturn void2type<T>::invoke(user2type<user*>::invoke(L,index)->m_p); \n\t\t} \n\t};\n\n\ttemplate<typename T>\n\tT lua2type(lua_State *L, int index)\n\t{\n\t\treturn\tif_<is_enum<T>::value\n\t\t\t\t\t,lua2enum<T>\n\t\t\t\t\t,lua2object<T> \n\t\t\t\t>::type::invoke(L, index);\n\t}\n\n\ttemplate<typename T>\n\tstruct val2user : user\n\t{\n\t\tval2user() : user(new T) {}\n\n\t\ttemplate<typename T1>\n\t\tval2user(T1 t1) : user(new T(t1)) {}\n\n\t\ttemplate<typename T1, typename T2>\n\t\tval2user(T1 t1, T2 t2) : user(new T(t1, t2)) {}\n\n\t\ttemplate<typename T1, typename T2, typename T3>\n\t\tval2user(T1 t1, T2 t2, T3 t3) : user(new T(t1, t2, t3)) {}\n\n\t\ttemplate<typename T1, typename T2, typename T3, typename T4>\n\t\tval2user(T1 t1, T2 t2, T3 t3, T4 t4) : user(new T(t1, t2, t3,t4)) {}\n\n\t\ttemplate<typename T1, typename T2, typename T3, typename T4, typename T5>\n\t\tval2user(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) : user(new T(t1, t2, t3,t4,t5)) {}\n\n\t\t~val2user() { delete ((T*)m_p); }\n\t};\n\n\ttemplate<typename T>\n\tstruct ptr2user : user\n\t{\n\t\tptr2user(T* t) : user((void*)t) {}\n\t};\n\n\ttemplate<typename T>\n\tstruct ref2user : user\n\t{\n\t\tref2user(T& t) : user(&t) {}\n\t};\n\n\t// to lua\n\ttemplate<typename T>\n\tstruct val2lua { static void invoke(lua_State *L, T& input){ new(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(input); } };\n\ttemplate<typename T>\n\tstruct ptr2lua { static void invoke(lua_State *L, T* input){ if(input) new(lua_newuserdata(L, sizeof(ptr2user<T>))) ptr2user<T>(input); else lua_pushnil(L); } };\n\ttemplate<typename T>\n\tstruct ref2lua { static void invoke(lua_State *L, T& input){ new(lua_newuserdata(L, sizeof(ref2user<T>))) ref2user<T>(input); } };\n\n\ttemplate<typename T>\n\tstruct enum2lua { static void invoke(lua_State *L, T val) { lua_pushnumber(L, (int)val); } };\n\n\ttemplate<typename T>\n\tstruct object2lua \n\t{ \n\t\tstatic void invoke(lua_State *L, T val) \n\t\t{ \n\t\t\tif_<is_ptr<T>::value\n\t\t\t\t,ptr2lua<typename base_type<T>::type>\n\t\t\t\t,typename if_<is_ref<T>::value\n\t\t\t\t\t,ref2lua<typename base_type<T>::type>\n\t\t\t\t\t,val2lua<typename base_type<T>::type>\n\t\t\t\t>::type\n\t\t\t>::type::invoke(L, val);\n\n\t\t\tpush_meta(L, class_name<typename class_type<T>::type>::name());\n\t\t\tlua_setmetatable(L, -2);\n\t\t} \n\t};\n\n\ttemplate<typename T>\n\tvoid type2lua(lua_State *L, T val)\n\t{\n\t\tif_<is_enum<T>::value\n\t\t\t,enum2lua<T>\n\t\t\t,object2lua<T>\n\t\t>::type::invoke(L, val);\n\t}\n\n\t// get value from cclosure\n\ttemplate<typename T>  \n\tT upvalue_(lua_State *L)\n\t{\n\t\treturn user2type<T>::invoke(L, lua_upvalueindex(1));\n\t}\n\n\t// read a value from lua stack \n\ttemplate<typename T>  \n\tT read(lua_State *L, int index)\t\t\t\t{ return lua2type<T>(L, index); }\n\n\ttemplate<>\tchar*\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tconst char*\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tchar\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tunsigned char\t\tread(lua_State *L, int index);\n\ttemplate<>\tshort\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tunsigned short\t\tread(lua_State *L, int index);\n\ttemplate<>\tlong\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tunsigned long\t\tread(lua_State *L, int index);\n\ttemplate<>\tint\t\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tunsigned int\t\tread(lua_State *L, int index);\n\ttemplate<>\tfloat\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tdouble\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tbool\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tvoid\t\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tlong long\t\t\tread(lua_State *L, int index);\n\ttemplate<>\tunsigned long long\tread(lua_State *L, int index);\n\ttemplate<>\ttable\t\t\t\tread(lua_State *L, int index);\n\n\t// push a value to lua stack \n\ttemplate<typename T>  \n\tvoid push(lua_State *L, T ret)\t\t\t\t\t{ type2lua<T>(L, ret); }\n\t\n\ttemplate<>\tvoid push(lua_State *L, char ret);\n\ttemplate<>\tvoid push(lua_State *L, unsigned char ret);\n\ttemplate<>\tvoid push(lua_State *L, short ret);\n\ttemplate<>\tvoid push(lua_State *L, unsigned short ret);\n\ttemplate<>\tvoid push(lua_State *L, long ret);\n\ttemplate<>\tvoid push(lua_State *L, unsigned long ret);\n\ttemplate<>\tvoid push(lua_State *L, int ret);\n\ttemplate<>\tvoid push(lua_State *L, unsigned int ret);\n\ttemplate<>\tvoid push(lua_State *L, float ret);\n\ttemplate<>\tvoid push(lua_State *L, double ret);\n\ttemplate<>\tvoid push(lua_State *L, char* ret);\n\ttemplate<>\tvoid push(lua_State *L, const char* ret);\n\ttemplate<>\tvoid push(lua_State *L, bool ret);\n\ttemplate<>\tvoid push(lua_State *L, lua_value* ret);\n\ttemplate<>\tvoid push(lua_State *L, long long ret);\n\ttemplate<>\tvoid push(lua_State *L, unsigned long long ret);\n\ttemplate<>\tvoid push(lua_State *L, table ret);\n\n\t// pop a value from lua stack\n\ttemplate<typename T>  \n\tT pop(lua_State *L) { T t = read<T>(L, -1); lua_pop(L, 1); return t; }\n\t\n\ttemplate<>\tvoid\tpop(lua_State *L);\n\ttemplate<>\ttable\tpop(lua_State *L);\n\n\t// functor (with return value)\n\ttemplate<typename RVal, typename T1=void, typename T2=void, typename T3=void, typename T4=void, typename T5=void>\n\tstruct functor\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T1, typename T2, typename T3, typename T4>\n\tstruct functor<RVal,T1,T2,T3,T4> \n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3,T4)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T1, typename T2, typename T3>\n\tstruct functor<RVal,T1,T2,T3> \n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2,T3)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T1, typename T2>\n\tstruct functor<RVal,T1,T2> \n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1,T2)>(L)(read<T1>(L,1),read<T2>(L,2))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T1>\n\tstruct functor<RVal,T1> \n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,upvalue_<RVal(*)(T1)>(L)(read<T1>(L,1))); return 1; }\n\t};\n\n\ttemplate<typename RVal>\n\tstruct functor<RVal>\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,upvalue_<RVal(*)()>(L)()); return 1; }\n\t};\n\n\t// functor (without return value)\n\ttemplate<typename T1, typename T2, typename T3, typename T4, typename T5>\n\tstruct functor<void, T1, T2, T3, T4, T5>\n\t{\n\t\tstatic int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4,T5)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4),read<T5>(L,5)); return 0; }\n\t};\n\n\ttemplate<typename T1, typename T2, typename T3, typename T4>\n\tstruct functor<void, T1, T2, T3, T4>\n\t{\n\t\tstatic int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3,T4)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3),read<T4>(L,4)); return 0; }\n\t};\n\n\ttemplate<typename T1, typename T2, typename T3>\n\tstruct functor<void, T1, T2, T3>\n\t{\n\t\tstatic int invoke(lua_State *L) { upvalue_<void(*)(T1,T2,T3)>(L)(read<T1>(L,1),read<T2>(L,2),read<T3>(L,3)); return 0; }\n\t};\n\n\ttemplate<typename T1, typename T2>\n\tstruct functor<void, T1, T2>\n\t{\n\t\tstatic int invoke(lua_State *L) { upvalue_<void(*)(T1,T2)>(L)(read<T1>(L,1),read<T2>(L,2)); return 0; }\n\t};\n\n\ttemplate<typename T1>\n\tstruct functor<void, T1>\n\t{\n\t\tstatic int invoke(lua_State *L) { upvalue_<void(*)(T1)>(L)(read<T1>(L,1)); return 0; }\n\t};\n\n\ttemplate<>\n\tstruct functor<void>\n\t{\n\t\tstatic int invoke(lua_State *L) { upvalue_<void(*)()>(L)(); return 0; }\n\t};\n\n\t// functor (non-managed)\n\ttemplate<typename T1>\n\tstruct functor<int, lua_State*, T1>\n\t{\n\t\tstatic int invoke(lua_State *L) { return upvalue_<int(*)(lua_State*,T1)>(L)(L,read<T1>(L,1)); }\n\t};\n\n\ttemplate<>\n\tstruct functor<int,lua_State*>\n\t{\n\t\tstatic int invoke(lua_State *L) { return upvalue_<int(*)(lua_State*)>(L)(L); }\n\t};\n\n\t// push_functor\n\ttemplate<typename RVal> \n\tvoid push_functor(lua_State *L, RVal (*func)())\n\t{\n\t\tlua_pushcclosure(L, functor<RVal>::invoke, 1);\n\t}\n\n\ttemplate<typename RVal, typename T1> \n\tvoid push_functor(lua_State *L, RVal (*func)(T1))\n\t{ \n\t\tlua_pushcclosure(L, functor<RVal,T1>::invoke, 1);\n\t}\n\n\ttemplate<typename RVal, typename T1, typename T2> \n\tvoid push_functor(lua_State *L, RVal (*func)(T1,T2))\n\t{ \n\t\tlua_pushcclosure(L, functor<RVal,T1,T2>::invoke, 1);\n\t}\n\n\ttemplate<typename RVal, typename T1, typename T2, typename T3> \n\tvoid push_functor(lua_State *L, RVal (*func)(T1,T2,T3))\n\t{ \n\t\tlua_pushcclosure(L, functor<RVal,T1,T2,T3>::invoke, 1);\n\t}\n\n\ttemplate<typename RVal, typename T1, typename T2, typename T3, typename T4> \n\tvoid push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4))\n\t{ \n\t\tlua_pushcclosure(L, functor<RVal,T1,T2,T3,T4>::invoke, 1);\n\t}\n\n\ttemplate<typename RVal, typename T1, typename T2, typename T3, typename T4, typename T5> \n\tvoid push_functor(lua_State *L, RVal (*func)(T1,T2,T3,T4,T5))\n\t{ \n\t\tlua_pushcclosure(L, functor<RVal,T1,T2,T3,T4,T5>::invoke, 1);\n\t}\n\n\t// member variable\n\tstruct var_base\n\t{\n\t\tvirtual void get(lua_State *L) = 0;\n\t\tvirtual void set(lua_State *L) = 0;\n\t};\n\n\ttemplate<typename T, typename V>\n\tstruct mem_var : var_base\n\t{\n\t\tV T::*_var;\n\t\tmem_var(V T::*val) : _var(val) {}\n\t\tvoid get(lua_State *L)\t{ push<if_<is_obj<V>::value,V&,V>::type>(L, read<T*>(L,1)->*(_var));\t}\n\t\tvoid set(lua_State *L)\t{ read<T*>(L,1)->*(_var) = read<V>(L, 3);\t}\n\t};\n\n\t// class member functor (with return value)\n\ttemplate<typename RVal, typename T, typename T1=void, typename T2=void, typename T3=void, typename T4=void, typename T5=void>\n\tstruct mem_functor\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4,T5)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6)));; return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4> \n\tstruct mem_functor<RVal,T,T1,T2,T3,T4>\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3,T4)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3> \n\tstruct mem_functor<RVal,T,T1,T2,T3>\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2,T3)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2> \n\tstruct mem_functor<RVal,T,T1, T2>\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1,T2)>(L))(read<T1>(L,2),read<T2>(L,3))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T, typename T1> \n\tstruct mem_functor<RVal,T,T1>\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)(T1)>(L))(read<T1>(L,2))); return 1; }\n\t};\n\n\ttemplate<typename RVal, typename T> \n\tstruct mem_functor<RVal,T>\n\t{\n\t\tstatic int invoke(lua_State *L) { push(L,(read<T*>(L,1)->*upvalue_<RVal(T::*)()>(L))()); return 1; }\n\t};\n\n\t// class member functor (without return value)\n\ttemplate<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\n\tstruct mem_functor<void,T,T1,T2,T3,T4,T5>\n\t{\n\t\tstatic int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4,T5)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6)); return 0; }\n\t};\n\n\ttemplate<typename T, typename T1, typename T2, typename T3, typename T4>\n\tstruct mem_functor<void,T,T1,T2,T3,T4>\n\t{\n\t\tstatic int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3,T4)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5)); return 0; }\n\t};\n\n\ttemplate<typename T, typename T1, typename T2, typename T3>\n\tstruct mem_functor<void,T,T1,T2,T3>\n\t{\n\t\tstatic int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2,T3)>(L))(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4)); return 0; }\n\t};\n\n\ttemplate<typename T, typename T1, typename T2>\n\tstruct mem_functor<void,T,T1,T2>\n\t{\n\t\tstatic int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1,T2)>(L))(read<T1>(L,2),read<T2>(L,3)); return 0; }\n\t};\n\n\ttemplate<typename T, typename T1>\n\tstruct mem_functor<void,T,T1>\n\t{\n\t\tstatic int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)(T1)>(L))(read<T1>(L,2)); return 0; }\n\t};\n\n\ttemplate<typename T>\n\tstruct mem_functor<void,T>\n\t{\n\t\tstatic int invoke(lua_State *L)  { (read<T*>(L,1)->*upvalue_<void(T::*)()>(L))(); return 0; }\n\t};\n\n\t// class member functor (non-managed)\n\ttemplate<typename T, typename T1> \n\tstruct mem_functor<int,T,lua_State*,T1>\n\t{\n\t\tstatic int invoke(lua_State *L) { return (read<T*>(L,1)->*upvalue_<int(T::*)(lua_State*,T1)>(L))(L, read<T1>(L,2)); }\n\t};\n\n\ttemplate<typename T> \n\tstruct mem_functor<int,T,lua_State*>\n\t{\n\t\tstatic int invoke(lua_State *L) { return (read<T*>(L,1)->*upvalue_<int(T::*)(lua_State*)>(L))(L); }\n\t};\n\n\t// push_functor\n\ttemplate<typename RVal, typename T>\n\tvoid push_functor(lua_State *L, RVal (T::*func)()) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T>\n\tvoid push_functor(lua_State *L, RVal (T::*func)() const) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1)) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1) const) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2)) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2) const) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3)) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3) const) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4)) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4) const) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5)) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5>::invoke, 1); \n\t}\n\n\ttemplate<typename RVal, typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\n\tvoid push_functor(lua_State *L, RVal (T::*func)(T1,T2,T3,T4,T5) const) \n\t{ \n\t\tlua_pushcclosure(L, mem_functor<RVal,T,T1,T2,T3,T4,T5>::invoke, 1); \n\t}\n\n\t// constructor\n\ttemplate<typename T, typename T1, typename T2, typename T3, typename T4, typename T5>\n\tint constructor(lua_State *L) \n\t{ \n\t\tnew(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5),read<T5>(L,6));\n\t\tpush_meta(L, class_name<typename class_type<T>::type>::name());\n\t\tlua_setmetatable(L, -2);\n\n\t\treturn 1; \n\t}\n\n\ttemplate<typename T, typename T1, typename T2, typename T3, typename T4>\n\tint constructor(lua_State *L) \n\t{ \n\t\tnew(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4),read<T4>(L,5));\n\t\tpush_meta(L, class_name<typename class_type<T>::type>::name());\n\t\tlua_setmetatable(L, -2);\n\n\t\treturn 1; \n\t}\n\n\ttemplate<typename T, typename T1, typename T2, typename T3>\n\tint constructor(lua_State *L) \n\t{ \n\t\tnew(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3),read<T3>(L,4));\n\t\tpush_meta(L, class_name<typename class_type<T>::type>::name());\n\t\tlua_setmetatable(L, -2);\n\n\t\treturn 1; \n\t}\n\n\ttemplate<typename T, typename T1, typename T2>\n\tint constructor(lua_State *L) \n\t{ \n\t\tnew(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2),read<T2>(L,3));\n\t\tpush_meta(L, class_name<typename class_type<T>::type>::name());\n\t\tlua_setmetatable(L, -2);\n\n\t\treturn 1; \n\t}\n\n\ttemplate<typename T, typename T1>\n\tint constructor(lua_State *L) \n\t{ \n\t\tnew(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>(read<T1>(L,2));\n\t\tpush_meta(L, class_name<typename class_type<T>::type>::name());\n\t\tlua_setmetatable(L, -2);\n\n\t\treturn 1; \n\t}\n\n\ttemplate<typename T>\n\tint constructor(lua_State *L) \n\t{ \n\t\tnew(lua_newuserdata(L, sizeof(val2user<T>))) val2user<T>();\n\t\tpush_meta(L, class_name<typename class_type<T>::type>::name());\n\t\tlua_setmetatable(L, -2);\n\n\t\treturn 1; \n\t}\n\n\t// destroyer\n\ttemplate<typename T>\n\tint destroyer(lua_State *L) \n\t{ \n\t\t((user*)lua_touserdata(L, 1))->~user();\n\t\treturn 0;\n\t}\n\n\t// global function\n\ttemplate<typename F> \n\tvoid def(lua_State* L, const char* name, F func)\n\t{ \n\t\tlua_pushstring(L, name);\n\t\tlua_pushlightuserdata(L, (void*)func);\n\t\tpush_functor(L, func);\n\t\tlua_settable(L, LUA_GLOBALSINDEX);\n\t}\n\n\t// global variable\n\ttemplate<typename T>\n\tvoid set(lua_State* L, const char* name, T object)\n\t{\n\t\tlua_pushstring(L, name);\n\t\tpush(L, object);\n\t\tlua_settable(L, LUA_GLOBALSINDEX);\n\t}\n\n\ttemplate<typename T>\n\tT get(lua_State* L, const char* name)\n\t{\n\t\tlua_pushstring(L, name);\n\t\tlua_gettable(L, LUA_GLOBALSINDEX);\n\t\treturn pop<T>(L);\n\t}\n\n\ttemplate<typename T>\n\tvoid decl(lua_State* L, const char* name, T object)\n\t{\n\t\tset(L, name, object);\n\t}\n\n\t// call\n\ttemplate<typename RVal>\n\tRVal call(lua_State* L, const char* name)\n\t{\n\t\tlua_pushcclosure(L, on_error, 0);\n\t\tint errfunc = lua_gettop(L);\n\n\t\tlua_pushstring(L, name);\n\t\tlua_gettable(L, LUA_GLOBALSINDEX);\n\n\t\tif(lua_isfunction(L,-1))\n\t\t{\n\t\t\tlua_pcall(L, 0, 1, errfunc);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint_error(L, \"lua_tinker::call() attempt to call global `%s' (not a function)\", name);\n\t\t}\n\n\t\tlua_remove(L, errfunc);\n\t\treturn pop<RVal>(L);\n\t}\n\n\ttemplate<typename RVal, typename T1>\n\tRVal call(lua_State* L, const char* name, T1 arg)\n\t{\n\t\tlua_pushcclosure(L, on_error, 0);\n\t\tint errfunc = lua_gettop(L);\n\n\t\tlua_pushstring(L, name);\n\t\tlua_gettable(L, LUA_GLOBALSINDEX);\n\t\tif(lua_isfunction(L,-1))\n\t\t{\n\t\t\tpush(L, arg);\n\t\t\tlua_pcall(L, 1, 1, errfunc);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint_error(L, \"lua_tinker::call() attempt to call global `%s' (not a function)\", name);\n\t\t}\n\n\t\tlua_remove(L, errfunc);\n\t\treturn pop<RVal>(L);\n\t}\n\n\ttemplate<typename RVal, typename T1, typename T2>\n\tRVal call(lua_State* L, const char* name, T1 arg1, T2 arg2)\n\t{\n\t\tlua_pushcclosure(L, on_error, 0);\n\t\tint errfunc = lua_gettop(L);\n\n\t\tlua_pushstring(L, name);\n\t\tlua_gettable(L, LUA_GLOBALSINDEX);\n\t\tif(lua_isfunction(L,-1))\n\t\t{\n\t\t\tpush(L, arg1);\n\t\t\tpush(L, arg2);\n\t\t\tlua_pcall(L, 2, 1, errfunc);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint_error(L, \"lua_tinker::call() attempt to call global `%s' (not a function)\", name);\n\t\t}\n\n\t\tlua_remove(L, errfunc);\n\t\treturn pop<RVal>(L);\n\t}\n\n\ttemplate<typename RVal, typename T1, typename T2, typename T3>\n\tRVal call(lua_State* L, const char* name, T1 arg1, T2 arg2, T3 arg3)\n\t{\n\t\tlua_pushcclosure(L, on_error, 0);\n\t\tint errfunc = lua_gettop(L);\n\n\t\tlua_pushstring(L, name);\n\t\tlua_gettable(L, LUA_GLOBALSINDEX);\n\t\tif(lua_isfunction(L,-1))\n\t\t{\n\t\t\tpush(L, arg1);\n\t\t\tpush(L, arg2);\n\t\t\tpush(L, arg3);\n\t\t\tlua_pcall(L, 3, 1, errfunc);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint_error(L, \"lua_tinker::call() attempt to call global `%s' (not a function)\", name);\n\t\t}\n\n\t\tlua_remove(L, errfunc);\n\t\treturn pop<RVal>(L);\n\t}\n\n\t// class helper\n\tint meta_get(lua_State *L);\n\tint meta_set(lua_State *L);\n\tvoid push_meta(lua_State *L, const char* name);\n\n\t// class init\n\ttemplate<typename T>\n\tvoid class_add(lua_State* L, const char* name) \n\t{ \n\t\tclass_name<T>::name(name);\n\n\t\tlua_pushstring(L, name);\n\t\tlua_newtable(L);\n\n\t\tlua_pushstring(L, \"__name\");\n\t\tlua_pushstring(L, name);\n\t\tlua_rawset(L, -3);\n\n\t\tlua_pushstring(L, \"__index\");\n\t\tlua_pushcclosure(L, meta_get, 0);\n\t\tlua_rawset(L, -3);\n\n\t\tlua_pushstring(L, \"__newindex\");\n\t\tlua_pushcclosure(L, meta_set, 0);\n\t\tlua_rawset(L, -3);\n\n\t\tlua_pushstring(L, \"__gc\");\n\t\tlua_pushcclosure(L, destroyer<T>, 0);\n\t\tlua_rawset(L, -3);\n\n\t\tlua_settable(L, LUA_GLOBALSINDEX);\n\t}\n\n\t// Tinker Class Inheritence\n\ttemplate<typename T, typename P>\n\tvoid class_inh(lua_State* L)\n\t{\n\t\tpush_meta(L, class_name<T>::name());\n\t\tif(lua_istable(L, -1))\n\t\t{\n\t\t\tlua_pushstring(L, \"__parent\");\n\t\t\tpush_meta(L, class_name<P>::name());\n\t\t\tlua_rawset(L, -3);\n\t\t}\n\t\tlua_pop(L, 1);\n\t}\n\n\t// Tinker Class Constructor\n\ttemplate<typename T, typename F>\n\tvoid class_con(lua_State* L,F func)\n\t{\n\t\tpush_meta(L, class_name<T>::name());\n\t\tif(lua_istable(L, -1))\n\t\t{\n\t\t\tlua_newtable(L);\n\t\t\tlua_pushstring(L, \"__call\");\n\t\t\tlua_pushcclosure(L, func, 0);\n\t\t\tlua_rawset(L, -3);\n\t\t\tlua_setmetatable(L, -2);\n\t\t}\n\t\tlua_pop(L, 1);\n\t}\n\n\t// Tinker Class Functions\n\ttemplate<typename T, typename F>\n\tvoid class_def(lua_State* L, const char* name, F func) \n\t{ \n\t\tpush_meta(L, class_name<T>::name());\n\t\tif(lua_istable(L, -1))\n\t\t{\n\t\t\tlua_pushstring(L, name);\n\t\t\tnew(lua_newuserdata(L,sizeof(F))) F(func);\n\t\t\tpush_functor(L, func);\n\t\t\tlua_rawset(L, -3);\n\t\t}\n\t\tlua_pop(L, 1);\n\t}\n\n\t// Tinker Class Variables\n\ttemplate<typename T, typename BASE, typename VAR>\n\tvoid class_mem(lua_State* L, const char* name, VAR BASE::*val) \n\t{ \n\t\tpush_meta(L, class_name<T>::name());\n\t\tif(lua_istable(L, -1))\n\t\t{\n\t\t\tlua_pushstring(L, name);\n\t\t\tnew(lua_newuserdata(L,sizeof(mem_var<BASE,VAR>))) mem_var<BASE,VAR>(val);\n\t\t\tlua_rawset(L, -3);\n\t\t}\n\t\tlua_pop(L, 1);\n\t}\n\n\ttemplate<typename T>\n\tstruct class_name\n\t{\n\t\t// global name\n\t\tstatic const char* name(const char* name = NULL)\n\t\t{\n\t\t\tstatic char temp[256] = \"\";\n\t\t\tif(name) strcpy(temp, name);\n\t\t\treturn temp;\n\t\t}\n\t};\n\n\t// Table Object on Stack\n\tstruct table_obj\n\t{\n\t\ttable_obj(lua_State* L, int index);\n\t\t~table_obj();\n\n\t\tvoid inc_ref();\n\t\tvoid dec_ref();\n\n\t\tbool validate();\n\n\t\ttemplate<typename T>\n\t\tvoid set(const char* name, T object)\n\t\t{\n\t\t\tif(validate())\n\t\t\t{\n\t\t\t\tlua_pushstring(m_L, name);\n\t\t\t\tpush(m_L, object);\n\t\t\t\tlua_settable(m_L, m_index);\n\t\t\t}\n\t\t}\n\n\t\ttemplate<typename T>\n\t\tvoid set(int index, T object)\n\t\t{\n\t\t\tif(validate())\n\t\t\t{\n\t\t\t\tlua_pushnumber(m_L, index);\n\t\t\t\tpush(m_L, object);\n\t\t\t\tlua_settable(m_L, m_index);\n\t\t\t}\n\t\t}\n\n\t\ttemplate<typename T>\n\t\tT get(const char* name)\n\t\t{\n\t\t\tif(validate())\n\t\t\t{\n\t\t\t\tlua_pushstring(m_L, name);\n\t\t\t\tlua_gettable(m_L, m_index);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlua_pushnil(m_L);\n\t\t\t}\n\n\t\t\treturn pop<T>(m_L);\n\t\t}\n\n\t\ttemplate<typename T>\n\t\tT get(int index)\n\t\t{\n\t\t\tif(validate())\n\t\t\t{\n\t\t\t\tlua_pushnumber(m_L, index);\n\t\t\t\tlua_gettable(m_L, m_index);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlua_pushnil(m_L);\n\t\t\t}\n\n\t\t\treturn pop<T>(m_L);\n\t\t}\n\n\t\tlua_State*\t\tm_L;\n\t\tint\t\t\t\tm_index;\n\t\tconst void*\t\tm_pointer;\n\t\tint\t\t\t\tm_ref;\n\t};\n\n\t// Table Object Holder\n\tstruct table\n\t{\n\t\ttable(lua_State* L);\n\t\ttable(lua_State* L, int index);\n\t\ttable(lua_State* L, const char* name);\n\t\ttable(const table& input);\n\t\t~table();\n\n\t\ttemplate<typename T>\n\t\tvoid set(const char* name, T object)\n\t\t{\n\t\t\tm_obj->set(name, object);\n\t\t}\n\n\t\ttemplate<typename T>\n\t\tvoid set(int index, T object)\n\t\t{\n\t\t\tm_obj->set(index, object);\n\t\t}\n\n\t\ttemplate<typename T>\n\t\tT get(const char* name)\n\t\t{\n\t\t\treturn m_obj->get<T>(name);\n\t\t}\n\n\t\ttemplate<typename T>\n\t\tT get(int index)\n\t\t{\n\t\t\treturn m_obj->get<T>(index);\n\t\t}\n\n\t\ttable_obj*\t\tm_obj;\n\t};\n\n} // namespace lua_tinker\n\n#endif //_LUA_TINKER_H_\n"
  },
  {
    "path": "Classes/LuaInterface/luaconf.h",
    "content": "/*\n** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $\n** Configuration file for Lua\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lconfig_h\n#define lconfig_h\n\n#include <limits.h>\n#include <stddef.h>\n\n\n/*\n** ==================================================================\n** Search for \"@@\" to find all configurable definitions.\n** ===================================================================\n*/\n\n\n/*\n@@ LUA_ANSI controls the use of non-ansi features.\n** CHANGE it (define it) if you want Lua to avoid the use of any\n** non-ansi feature or library.\n*/\n#if defined(__STRICT_ANSI__)\n#define LUA_ANSI\n#endif\n\n\n#if !defined(LUA_ANSI) && defined(_WIN32)\n#define LUA_WIN\n#endif\n\n#if defined(LUA_USE_LINUX)\n#define LUA_USE_POSIX\n#define LUA_USE_DLOPEN\t\t/* needs an extra library: -ldl */\n#define LUA_USE_READLINE\t/* needs some extra libraries */\n#endif\n\n#if defined(LUA_USE_MACOSX)\n#define LUA_USE_POSIX\n#define LUA_DL_DYLD\t\t/* does not need extra library */\n#endif\n\n\n\n/*\n@@ LUA_USE_POSIX includes all functionallity listed as X/Open System\n@* Interfaces Extension (XSI).\n** CHANGE it (define it) if your system is XSI compatible.\n*/\n#if defined(LUA_USE_POSIX)\n#define LUA_USE_MKSTEMP\n#define LUA_USE_ISATTY\n#define LUA_USE_POPEN\n#define LUA_USE_ULONGJMP\n#endif\n\n\n/*\n@@ LUA_PATH and LUA_CPATH are the names of the environment variables that\n@* Lua check to set its paths.\n@@ LUA_INIT is the name of the environment variable that Lua\n@* checks for initialization code.\n** CHANGE them if you want different names.\n*/\n#define LUA_PATH        \"LUA_PATH\"\n#define LUA_CPATH       \"LUA_CPATH\"\n#define LUA_INIT\t\"LUA_INIT\"\n\n\n/*\n@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for\n@* Lua libraries.\n@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for\n@* C libraries.\n** CHANGE them if your machine has a non-conventional directory\n** hierarchy or if you want to install your libraries in\n** non-conventional directories.\n*/\n#if defined(_WIN32)\n/*\n** In Windows, any exclamation mark ('!') in the path is replaced by the\n** path of the directory of the executable file of the current process.\n*/\n#define LUA_LDIR\t\"!\\\\lua\\\\\"\n#define LUA_CDIR\t\"!\\\\\"\n#define LUA_PATH_DEFAULT  \\\n\t\t\".\\\\?.lua;\"  LUA_LDIR\"?.lua;\"  LUA_LDIR\"?\\\\init.lua;\" \\\n\t\t             LUA_CDIR\"?.lua;\"  LUA_CDIR\"?\\\\init.lua\"\n#define LUA_CPATH_DEFAULT \\\n\t\".\\\\?.dll;\"  LUA_CDIR\"?.dll;\" LUA_CDIR\"loadall.dll\"\n\n#else\n#define LUA_ROOT\t\"/usr/local/\"\n#define LUA_LDIR\tLUA_ROOT \"share/lua/5.1/\"\n#define LUA_CDIR\tLUA_ROOT \"lib/lua/5.1/\"\n#define LUA_PATH_DEFAULT  \\\n\t\t\"./?.lua;\"  LUA_LDIR\"?.lua;\"  LUA_LDIR\"?/init.lua;\" \\\n\t\t            LUA_CDIR\"?.lua;\"  LUA_CDIR\"?/init.lua\"\n#define LUA_CPATH_DEFAULT \\\n\t\"./?.so;\"  LUA_CDIR\"?.so;\" LUA_CDIR\"loadall.so\"\n#endif\n\n\n/*\n@@ LUA_DIRSEP is the directory separator (for submodules).\n** CHANGE it if your machine does not use \"/\" as the directory separator\n** and is not Windows. (On Windows Lua automatically uses \"\\\".)\n*/\n#if defined(_WIN32)\n#define LUA_DIRSEP\t\"\\\\\"\n#else\n#define LUA_DIRSEP\t\"/\"\n#endif\n\n\n/*\n@@ LUA_PATHSEP is the character that separates templates in a path.\n@@ LUA_PATH_MARK is the string that marks the substitution points in a\n@* template.\n@@ LUA_EXECDIR in a Windows path is replaced by the executable's\n@* directory.\n@@ LUA_IGMARK is a mark to ignore all before it when bulding the\n@* luaopen_ function name.\n** CHANGE them if for some reason your system cannot use those\n** characters. (E.g., if one of those characters is a common character\n** in file/directory names.) Probably you do not need to change them.\n*/\n#define LUA_PATHSEP\t\";\"\n#define LUA_PATH_MARK\t\"?\"\n#define LUA_EXECDIR\t\"!\"\n#define LUA_IGMARK\t\"-\"\n\n\n/*\n@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.\n** CHANGE that if ptrdiff_t is not adequate on your machine. (On most\n** machines, ptrdiff_t gives a good choice between int or long.)\n*/\n#define LUA_INTEGER\tptrdiff_t\n\n\n/*\n@@ LUA_API is a mark for all core API functions.\n@@ LUALIB_API is a mark for all standard library functions.\n** CHANGE them if you need to define those functions in some special way.\n** For instance, if you want to create one Windows DLL with the core and\n** the libraries, you may want to use the following definition (define\n** LUA_BUILD_AS_DLL to get it).\n*/\n#if defined(LUA_BUILD_AS_DLL)\n\n#if defined(LUA_CORE) || defined(LUA_LIB)\n#define LUA_API __declspec(dllexport)\n#else\n#define LUA_API __declspec(dllimport)\n#endif\n\n#else\n\n#define LUA_API\t\textern\n\n#endif\n\n/* more often than not the libs go together with the core */\n#define LUALIB_API\tLUA_API\n\n\n/*\n@@ LUAI_FUNC is a mark for all extern functions that are not to be\n@* exported to outside modules.\n@@ LUAI_DATA is a mark for all extern (const) variables that are not to\n@* be exported to outside modules.\n** CHANGE them if you need to mark them in some special way. Elf/gcc\n** (versions 3.2 and later) mark them as \"hidden\" to optimize access\n** when Lua is compiled as a shared library.\n*/\n#if defined(luaall_c)\n#define LUAI_FUNC\tstatic\n#define LUAI_DATA\t/* empty */\n\n#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \\\n      defined(__ELF__)\n#define LUAI_FUNC\t__attribute__((visibility(\"hidden\"))) extern\n#define LUAI_DATA\tLUAI_FUNC\n\n#else\n#define LUAI_FUNC\textern\n#define LUAI_DATA\textern\n#endif\n\n\n\n/*\n@@ LUA_QL describes how error messages quote program elements.\n** CHANGE it if you want a different appearance.\n*/\n#define LUA_QL(x)\t\"'\" x \"'\"\n#define LUA_QS\t\tLUA_QL(\"%s\")\n\n\n/*\n@@ LUA_IDSIZE gives the maximum size for the description of the source\n@* of a function in debug information.\n** CHANGE it if you want a different size.\n*/\n#define LUA_IDSIZE\t60\n\n\n/*\n** {==================================================================\n** Stand-alone configuration\n** ===================================================================\n*/\n\n#if defined(lua_c) || defined(luaall_c)\n\n/*\n@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that\n@* is, whether we're running lua interactively).\n** CHANGE it if you have a better definition for non-POSIX/non-Windows\n** systems.\n*/\n#if defined(LUA_USE_ISATTY)\n#include <unistd.h>\n#define lua_stdin_is_tty()\tisatty(0)\n#elif defined(LUA_WIN)\n#include <io.h>\n#include <stdio.h>\n#define lua_stdin_is_tty()\t_isatty(_fileno(stdin))\n#else\n#define lua_stdin_is_tty()\t1  /* assume stdin is a tty */\n#endif\n\n\n/*\n@@ LUA_PROMPT is the default prompt used by stand-alone Lua.\n@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.\n** CHANGE them if you want different prompts. (You can also change the\n** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)\n*/\n#define LUA_PROMPT\t\t\"> \"\n#define LUA_PROMPT2\t\t\">> \"\n\n\n/*\n@@ LUA_PROGNAME is the default name for the stand-alone Lua program.\n** CHANGE it if your stand-alone interpreter has a different name and\n** your system is not able to detect that name automatically.\n*/\n#define LUA_PROGNAME\t\t\"lua\"\n\n\n/*\n@@ LUA_MAXINPUT is the maximum length for an input line in the\n@* stand-alone interpreter.\n** CHANGE it if you need longer lines.\n*/\n#define LUA_MAXINPUT\t512\n\n\n/*\n@@ lua_readline defines how to show a prompt and then read a line from\n@* the standard input.\n@@ lua_saveline defines how to \"save\" a read line in a \"history\".\n@@ lua_freeline defines how to free a line read by lua_readline.\n** CHANGE them if you want to improve this functionality (e.g., by using\n** GNU readline and history facilities).\n*/\n#if defined(LUA_USE_READLINE)\n#include <stdio.h>\n#include <readline/readline.h>\n#include <readline/history.h>\n#define lua_readline(L,b,p)\t((void)L, ((b)=readline(p)) != NULL)\n#define lua_saveline(L,idx) \\\n\tif (lua_strlen(L,idx) > 0)  /* non-empty line? */ \\\n\t  add_history(lua_tostring(L, idx));  /* add it to history */\n#define lua_freeline(L,b)\t((void)L, free(b))\n#else\n#define lua_readline(L,b,p)\t\\\n\t((void)L, fputs(p, stdout), fflush(stdout),  /* show prompt */ \\\n\tfgets(b, LUA_MAXINPUT, stdin) != NULL)  /* get line */\n#define lua_saveline(L,idx)\t{ (void)L; (void)idx; }\n#define lua_freeline(L,b)\t{ (void)L; (void)b; }\n#endif\n\n#endif\n\n/* }================================================================== */\n\n\n/*\n@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles\n@* as a percentage.\n** CHANGE it if you want the GC to run faster or slower (higher values\n** mean larger pauses which mean slower collection.) You can also change\n** this value dynamically.\n*/\n#define LUAI_GCPAUSE\t200  /* 200% (wait memory to double before next GC) */\n\n\n/*\n@@ LUAI_GCMUL defines the default speed of garbage collection relative to\n@* memory allocation as a percentage.\n** CHANGE it if you want to change the granularity of the garbage\n** collection. (Higher values mean coarser collections. 0 represents\n** infinity, where each step performs a full collection.) You can also\n** change this value dynamically.\n*/\n#define LUAI_GCMUL\t200 /* GC runs 'twice the speed' of memory allocation */\n\n\n\n/*\n@@ LUA_COMPAT_GETN controls compatibility with old getn behavior.\n** CHANGE it (define it) if you want exact compatibility with the\n** behavior of setn/getn in Lua 5.0.\n*/\n#undef LUA_COMPAT_GETN\n\n/*\n@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib.\n** CHANGE it to undefined as soon as you do not need a global 'loadlib'\n** function (the function is still available as 'package.loadlib').\n*/\n#undef LUA_COMPAT_LOADLIB\n\n/*\n@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.\n** CHANGE it to undefined as soon as your programs use only '...' to\n** access vararg parameters (instead of the old 'arg' table).\n*/\n#define LUA_COMPAT_VARARG\n\n/*\n@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.\n** CHANGE it to undefined as soon as your programs use 'math.fmod' or\n** the new '%' operator instead of 'math.mod'.\n*/\n#define LUA_COMPAT_MOD\n\n/*\n@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting\n@* facility.\n** CHANGE it to 2 if you want the old behaviour, or undefine it to turn\n** off the advisory error when nesting [[...]].\n*/\n#define LUA_COMPAT_LSTR\t\t1\n\n/*\n@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.\n** CHANGE it to undefined as soon as you rename 'string.gfind' to\n** 'string.gmatch'.\n*/\n#define LUA_COMPAT_GFIND\n\n/*\n@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'\n@* behavior.\n** CHANGE it to undefined as soon as you replace to 'luaL_register'\n** your uses of 'luaL_openlib'\n*/\n#define LUA_COMPAT_OPENLIB\n\n\n\n/*\n@@ luai_apicheck is the assert macro used by the Lua-C API.\n** CHANGE luai_apicheck if you want Lua to perform some checks in the\n** parameters it gets from API calls. This may slow down the interpreter\n** a bit, but may be quite useful when debugging C code that interfaces\n** with Lua. A useful redefinition is to use assert.h.\n*/\n#if defined(LUA_USE_APICHECK)\n#include <assert.h>\n#define luai_apicheck(L,o)\t{ (void)L; assert(o); }\n#else\n#define luai_apicheck(L,o)\t{ (void)L; }\n#endif\n\n\n/*\n@@ LUAI_BITSINT defines the number of bits in an int.\n** CHANGE here if Lua cannot automatically detect the number of bits of\n** your machine. Probably you do not need to change this.\n*/\n/* avoid overflows in comparison */\n#if INT_MAX-20 < 32760\n#define LUAI_BITSINT\t16\n#elif INT_MAX > 2147483640L\n/* int has at least 32 bits */\n#define LUAI_BITSINT\t32\n#else\n#error \"you must define LUA_BITSINT with number of bits in an integer\"\n#endif\n\n\n/*\n@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.\n@@ LUAI_INT32 is an signed integer with at least 32 bits.\n@@ LUAI_UMEM is an unsigned integer big enough to count the total\n@* memory used by Lua.\n@@ LUAI_MEM is a signed integer big enough to count the total memory\n@* used by Lua.\n** CHANGE here if for some weird reason the default definitions are not\n** good enough for your machine. (The definitions in the 'else'\n** part always works, but may waste space on machines with 64-bit\n** longs.) Probably you do not need to change this.\n*/\n#if LUAI_BITSINT >= 32\n#define LUAI_UINT32\tunsigned int\n#define LUAI_INT32\tint\n#define LUAI_MAXINT32\tINT_MAX\n#define LUAI_UMEM\tsize_t\n#define LUAI_MEM\tptrdiff_t\n#else\n/* 16-bit ints */\n#define LUAI_UINT32\tunsigned long\n#define LUAI_INT32\tlong\n#define LUAI_MAXINT32\tLONG_MAX\n#define LUAI_UMEM\tunsigned long\n#define LUAI_MEM\tlong\n#endif\n\n\n/*\n@@ LUAI_MAXCALLS limits the number of nested calls.\n** CHANGE it if you need really deep recursive calls. This limit is\n** arbitrary; its only purpose is to stop infinite recursion before\n** exhausting memory.\n*/\n#define LUAI_MAXCALLS\t20000\n\n\n/*\n@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function\n@* can use.\n** CHANGE it if you need lots of (Lua) stack space for your C\n** functions. This limit is arbitrary; its only purpose is to stop C\n** functions to consume unlimited stack space. (must be smaller than\n** -LUA_REGISTRYINDEX)\n*/\n#define LUAI_MAXCSTACK\t8000\n\n\n\n/*\n** {==================================================================\n** CHANGE (to smaller values) the following definitions if your system\n** has a small C stack. (Or you may want to change them to larger\n** values if your system has a large C stack and these limits are\n** too rigid for you.) Some of these constants control the size of\n** stack-allocated arrays used by the compiler or the interpreter, while\n** others limit the maximum number of recursive calls that the compiler\n** or the interpreter can perform. Values too large may cause a C stack\n** overflow for some forms of deep constructs.\n** ===================================================================\n*/\n\n\n/*\n@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and\n@* syntactical nested non-terminals in a program.\n*/\n#define LUAI_MAXCCALLS\t\t200\n\n\n/*\n@@ LUAI_MAXVARS is the maximum number of local variables per function\n@* (must be smaller than 250).\n*/\n#define LUAI_MAXVARS\t\t200\n\n\n/*\n@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function\n@* (must be smaller than 250).\n*/\n#define LUAI_MAXUPVALUES\t60\n\n\n/*\n@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.\n*/\n#define LUAL_BUFFERSIZE\t\tBUFSIZ\n\n/* }================================================================== */\n\n\n\n\n/*\n** {==================================================================\n@@ LUA_NUMBER is the type of numbers in Lua.\n** CHANGE the following definitions only if you want to build Lua\n** with a number type different from double. You may also need to\n** change lua_number2int & lua_number2integer.\n** ===================================================================\n*/\n\n#define LUA_NUMBER_DOUBLE\n#define LUA_NUMBER\tdouble\n\n/*\n@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'\n@* over a number.\n*/\n#define LUAI_UACNUMBER\tdouble\n\n\n/*\n@@ LUA_NUMBER_SCAN is the format for reading numbers.\n@@ LUA_NUMBER_FMT is the format for writing numbers.\n@@ lua_number2str converts a number to a string.\n@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.\n@@ lua_str2number converts a string to a number.\n*/\n#define LUA_NUMBER_SCAN\t\t\"%lf\"\n#define LUA_NUMBER_FMT\t\t\"%.14g\"\n#define lua_number2str(s,n)\tsprintf((s), LUA_NUMBER_FMT, (n))\n#define LUAI_MAXNUMBER2STR\t32 /* 16 digits, sign, point, and \\0 */\n#define lua_str2number(s,p)\tstrtod((s), (p))\n\n\n/*\n@@ The luai_num* macros define the primitive operations over numbers.\n*/\n#if defined(LUA_CORE)\n#include <math.h>\n#define luai_numadd(a,b)\t((a)+(b))\n#define luai_numsub(a,b)\t((a)-(b))\n#define luai_nummul(a,b)\t((a)*(b))\n#define luai_numdiv(a,b)\t((a)/(b))\n#define luai_nummod(a,b)\t((a) - floor((a)/(b))*(b))\n#define luai_numpow(a,b)\t(pow(a,b))\n#define luai_numunm(a)\t\t(-(a))\n#define luai_numeq(a,b)\t\t((a)==(b))\n#define luai_numlt(a,b)\t\t((a)<(b))\n#define luai_numle(a,b)\t\t((a)<=(b))\n#define luai_numisnan(a)\t(!luai_numeq((a), (a)))\n#endif\n\n\n/*\n@@ lua_number2int is a macro to convert lua_Number to int.\n@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.\n** CHANGE them if you know a faster way to convert a lua_Number to\n** int (with any rounding method and without throwing errors) in your\n** system. In Pentium machines, a naive typecast from double to int\n** in C is extremely slow, so any alternative is worth trying.\n*/\n\n/* On a Pentium, resort to a trick */\n#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \\\n    (defined(__i386) || defined (_M_IX86) || defined(__i386__))\n\n/* On a Microsoft compiler, use assembler */\n#if defined(_MSC_VER)\n\n#define lua_number2int(i,d)   __asm fld d   __asm fistp i\n#define lua_number2integer(i,n)\t\tlua_number2int(i, n)\n\n/* the next trick should work on any Pentium, but sometimes clashes\n   with a DirectX idiosyncrasy */\n#else\n\nunion luai_Cast { double l_d; long l_l; };\n#define lua_number2int(i,d) \\\n  { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }\n#define lua_number2integer(i,n)\t\tlua_number2int(i, n)\n\n#endif\n\n\n/* this option always works, but may be slow */\n#else\n#define lua_number2int(i,d)\t((i)=(int)(d))\n#define lua_number2integer(i,d)\t((i)=(lua_Integer)(d))\n\n#endif\n\n/* }================================================================== */\n\n\n/*\n@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.\n** CHANGE it if your system requires alignments larger than double. (For\n** instance, if your system supports long doubles and they must be\n** aligned in 16-byte boundaries, then you should add long double in the\n** union.) Probably you do not need to change this.\n*/\n#define LUAI_USER_ALIGNMENT_T\tunion { double u; void *s; long l; }\n\n\n/*\n@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.\n** CHANGE them if you prefer to use longjmp/setjmp even with C++\n** or if want/don't to use _longjmp/_setjmp instead of regular\n** longjmp/setjmp. By default, Lua handles errors with exceptions when\n** compiling as C++ code, with _longjmp/_setjmp when asked to use them,\n** and with longjmp/setjmp otherwise.\n*/\n#if defined(__cplusplus)\n/* C++ exceptions */\n#define LUAI_THROW(L,c)\tthrow(c)\n#define LUAI_TRY(L,c,a)\ttry { a } catch(...) \\\n\t{ if ((c)->status == 0) (c)->status = -1; }\n#define luai_jmpbuf\tint  /* dummy variable */\n\n#elif defined(LUA_USE_ULONGJMP)\n/* in Unix, try _longjmp/_setjmp (more efficient) */\n#define LUAI_THROW(L,c)\t_longjmp((c)->b, 1)\n#define LUAI_TRY(L,c,a)\tif (_setjmp((c)->b) == 0) { a }\n#define luai_jmpbuf\tjmp_buf\n\n#else\n/* default handling with long jumps */\n#define LUAI_THROW(L,c)\tlongjmp((c)->b, 1)\n#define LUAI_TRY(L,c,a)\tif (setjmp((c)->b) == 0) { a }\n#define luai_jmpbuf\tjmp_buf\n\n#endif\n\n\n/*\n@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern\n@* can do during pattern-matching.\n** CHANGE it if you need more captures. This limit is arbitrary.\n*/\n#define LUA_MAXCAPTURES\t\t32\n\n\n/*\n@@ lua_tmpnam is the function that the OS library uses to create a\n@* temporary name.\n@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.\n** CHANGE them if you have an alternative to tmpnam (which is considered\n** insecure) or if you want the original tmpnam anyway.  By default, Lua\n** uses tmpnam except when POSIX is available, where it uses mkstemp.\n*/\n#if defined(loslib_c) || defined(luaall_c)\n\n#if defined(LUA_USE_MKSTEMP)\n#include <unistd.h>\n#define LUA_TMPNAMBUFSIZE\t32\n#define lua_tmpnam(b,e)\t{ \\\n\tstrcpy(b, \"/tmp/lua_XXXXXX\"); \\\n\te = mkstemp(b); \\\n\tif (e != -1) close(e); \\\n\te = (e == -1); }\n\n#else\n#define LUA_TMPNAMBUFSIZE\tL_tmpnam\n#define lua_tmpnam(b,e)\t\t{ e = (tmpnam(b) == NULL); }\n#endif\n\n#endif\n\n\n/*\n@@ lua_popen spawns a new process connected to the current one through\n@* the file streams.\n** CHANGE it if you have a way to implement it in your system.\n*/\n#if defined(LUA_USE_POPEN)\n\n#define lua_popen(L,c,m)\t((void)L, fflush(NULL), popen(c,m))\n#define lua_pclose(L,file)\t((void)L, (pclose(file) != -1))\n\n#elif defined(LUA_WIN)\n\n#define lua_popen(L,c,m)\t((void)L, _popen(c,m))\n#define lua_pclose(L,file)\t((void)L, (_pclose(file) != -1))\n\n#else\n\n#define lua_popen(L,c,m)\t((void)((void)c, m),  \\\n\t\tluaL_error(L, LUA_QL(\"popen\") \" not supported\"), (FILE*)0)\n#define lua_pclose(L,file)\t\t((void)((void)L, file), 0)\n\n#endif\n\n/*\n@@ LUA_DL_* define which dynamic-library system Lua should use.\n** CHANGE here if Lua has problems choosing the appropriate\n** dynamic-library system for your platform (either Windows' DLL, Mac's\n** dyld, or Unix's dlopen). If your system is some kind of Unix, there\n** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for\n** it.  To use dlopen you also need to adapt the src/Makefile (probably\n** adding -ldl to the linker options), so Lua does not select it\n** automatically.  (When you change the makefile to add -ldl, you must\n** also add -DLUA_USE_DLOPEN.)\n** If you do not want any kind of dynamic library, undefine all these\n** options.\n** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.\n*/\n#if defined(LUA_USE_DLOPEN)\n#define LUA_DL_DLOPEN\n#endif\n\n#if defined(LUA_WIN)\n#define LUA_DL_DLL\n#endif\n\n\n/*\n@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State\n@* (the data goes just *before* the lua_State pointer).\n** CHANGE (define) this if you really need that. This value must be\n** a multiple of the maximum alignment required for your machine.\n*/\n#define LUAI_EXTRASPACE\t\t0\n\n\n/*\n@@ luai_userstate* allow user-specific actions on threads.\n** CHANGE them if you defined LUAI_EXTRASPACE and need to do something\n** extra when a thread is created/deleted/resumed/yielded.\n*/\n#define luai_userstateopen(L)\t\t((void)L)\n#define luai_userstateclose(L)\t\t((void)L)\n#define luai_userstatethread(L,L1)\t((void)L)\n#define luai_userstatefree(L)\t\t((void)L)\n#define luai_userstateresume(L,n)\t((void)L)\n#define luai_userstateyield(L,n)\t((void)L)\n\n\n/*\n@@ LUA_INTFRMLEN is the length modifier for integer conversions\n@* in 'string.format'.\n@@ LUA_INTFRM_T is the integer type correspoding to the previous length\n@* modifier.\n** CHANGE them if your system supports long long or does not support long.\n*/\n\n#if defined(LUA_USELONGLONG)\n\n#define LUA_INTFRMLEN\t\t\"ll\"\n#define LUA_INTFRM_T\t\tlong long\n\n#else\n\n#define LUA_INTFRMLEN\t\t\"l\"\n#define LUA_INTFRM_T\t\tlong\n\n#endif\n\n\n\n/* =================================================================== */\n\n/*\n** Local configuration. You can use this space to add your redefinitions\n** without modifying the main part of the file.\n*/\n\n\n\n#endif\n\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2014 Ge Ziyang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "OpenBird\n========\n<a href=\"https://996.icu\"><img src=\"https://img.shields.io/badge/link-996.icu-red.svg\"></a>\n\nFlappy Bird made with cocos2dx\n\nLatest Gif\n\n<img src=\"https://f.cloud.github.com/assets/1802419/2227290/dc423e48-9abc-11e3-9433-5ba2ab3e078c.gif\">\n\n"
  },
  {
    "path": "Resources/AudioEngine.lua",
    "content": "--Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects. \nlocal M = {}\nlocal audioEngineInstance = cc.SimpleAudioEngine:getInstance()\n\nfunction M.stopAllEffects()\n    audioEngineInstance:stopAllEffects()\nend\n\nfunction M.getMusicVolume()\n    return audioEngineInstance:getMusicVolume()\nend\n\nfunction M.isMusicPlaying()\n    return audioEngineInstance:isMusicPlaying()\nend\n\nfunction M.getEffectsVolume()\n    return audioEngineInstance:getEffectsVolume()\nend\n\nfunction M.setMusicVolume(volume)\n    audioEngineInstance:setMusicVolume(volume)\nend\n\nfunction M.stopEffect(handle)\n    audioEngineInstance:stopEffect(handle)\nend\n\nfunction M.stopMusic(isReleaseData)\n    local releaseDataValue = false\n    if nil ~= isReleaseData then\n        releaseDataValue = isReleaseData\n    end\n    audioEngineInstance:stopMusic(releaseDataValue)\nend\n\nfunction M.playMusic(filename, isLoop)\n    local loopValue = false\n    if nil ~= isLoop then\n        loopValue = isLoop\n    end\n    audioEngineInstance:playMusic(filename, loopValue)\nend\n\nfunction M.pauseAllEffects()\n    audioEngineInstance:pauseAllEffects()\nend\n\nfunction M.preloadMusic(filename)\n    audioEngineInstance:preloadMusic(filename)\nend\n\nfunction M.resumeMusic()\n    audioEngineInstance:resumeMusic()\nend\n\nfunction M.playEffect(filename, isLoop)\n    local loopValue = false\n    if nil ~= isLoop then\n        loopValue = isLoop\n    end\n    return audioEngineInstance:playEffect(filename, loopValue)\nend\n\nfunction M.rewindMusic()\n    audioEngineInstance:rewindMusic()\nend\n\nfunction M.willPlayMusic()\n    return audioEngineInstance:willPlayMusic()\nend\n\nfunction M.unloadEffect(filename)\n    audioEngineInstance:unloadEffect(filename)\nend\n\nfunction M.preloadEffect(filename)\n    audioEngineInstance:preloadEffect(filename)\nend\n\nfunction M.setEffectsVolume(volume)\n    audioEngineInstance:setEffectsVolume(volume)\nend\n\nfunction M.pauseEffect(handle)\n    audioEngineInstance:pauseEffect(handle)\nend\n\nfunction M.resumeAllEffects(handle)\n    audioEngineInstance:resumeAllEffects()\nend\n\nfunction M.pauseMusic()\n    audioEngineInstance:pauseMusic()\nend\n\nfunction M.resumeEffect(handle)\n    audioEngineInstance:resumeEffect(handle)\nend\n\nlocal modename = \"AudioEngine\"\nlocal proxy = {}\nlocal mt    = {\n    __index = M,\n    __newindex =  function (t ,k ,v)\n        print(\"attemp to update a read-only table\")\n    end\n} \nsetmetatable(proxy,mt)\n_G[modename] = proxy\npackage.loaded[modename] = proxy\n\n\n"
  },
  {
    "path": "Resources/CCBReaderLoad.lua",
    "content": "ccb = ccb or {}\n\nfunction CCBReaderLoad(strFilePath,proxy,owner)\n    if nil == proxy then\n        return nil\n    end\n\n    local ccbReader = proxy:createCCBReader()\n    local node      = ccbReader:load(strFilePath)\n    local rootName  = \"\" \n    --owner set in readCCBFromFile is proxy\n    if nil ~= owner then\n        --Callbacks\n        local ownerCallbackNames = ccbReader:getOwnerCallbackNames() \n        local ownerCallbackNodes = ccbReader:getOwnerCallbackNodes()\n        local ownerCallbackControlEvents = ccbReader:getOwnerCallbackControlEvents()\n        local i = 1\n        for i = 1,table.getn(ownerCallbackNames) do\n            local callbackName =  ownerCallbackNames[i]\n            local callbackNode =  tolua.cast(ownerCallbackNodes[i],\"cc.Node\")\n\n            if \"function\" == type(owner[callbackName]) then\n                proxy:setCallback(callbackNode, owner[callbackName], ownerCallbackControlEvents[i])\n            else\n                print(\"Warning: Cannot find owner's lua function:\" .. \":\" .. callbackName .. \" for ownerVar selector\")\n            end\n\n        end\n\n        --Variables\n        local ownerOutletNames = ccbReader:getOwnerOutletNames() \n        local ownerOutletNodes = ccbReader:getOwnerOutletNodes()\n\n        for i = 1, table.getn(ownerOutletNames) do\n            local outletName = ownerOutletNames[i]\n            local outletNode = tolua.cast(ownerOutletNodes[i],\"cc.Node\")\n            owner[outletName] = outletNode\n        end\n    end\n\n    local nodesWithAnimationManagers = ccbReader:getNodesWithAnimationManagers()\n    local animationManagersForNodes  = ccbReader:getAnimationManagersForNodes()\n\n    for i = 1 , table.getn(nodesWithAnimationManagers) do\n        local innerNode = tolua.cast(nodesWithAnimationManagers[i], \"cc.Node\")\n        local animationManager = tolua.cast(animationManagersForNodes[i], \"cc.CCBAnimationManager\")\n        local documentControllerName = animationManager:getDocumentControllerName()\n        if \"\" == documentControllerName then\n            \n        end\n        if nil ~=  ccb[documentControllerName] then\n            ccb[documentControllerName][\"mAnimationManager\"] = animationManager\n        end\n        \n        --Callbacks\n        local documentCallbackNames = animationManager:getDocumentCallbackNames()\n        local documentCallbackNodes = animationManager:getDocumentCallbackNodes()\n        local documentCallbackControlEvents = animationManager:getDocumentCallbackControlEvents()\n\n        for i = 1,table.getn(documentCallbackNames) do\n            local callbackName = documentCallbackNames[i]\n            local callbackNode = tolua.cast(documentCallbackNodes[i],\"cc.Node\")\n            if \"\" ~= documentControllerName and nil ~= ccb[documentControllerName] then\n                if \"function\" == type(ccb[documentControllerName][callbackName]) then\n                    proxy:setCallback(callbackNode, ccb[documentControllerName][callbackName], documentCallbackControlEvents[i])\n                else\n                    print(\"Warning: Cannot found lua function [\" .. documentControllerName .. \":\" .. callbackName .. \"] for docRoot selector\")\n                end\n            end\n        end\n\n        --Variables\n        local documentOutletNames = animationManager:getDocumentOutletNames()\n        local documentOutletNodes = animationManager:getDocumentOutletNodes()\n\n        for i = 1, table.getn(documentOutletNames) do\n            local outletName = documentOutletNames[i]\n            local outletNode = tolua.cast(documentOutletNodes[i],\"cc.Node\")\n            \n            if nil ~= ccb[documentControllerName] then\n                ccb[documentControllerName][outletName] = tolua.cast(outletNode, proxy:getNodeTypeName(outletNode))\n            end \n        end\n        --[[\n        if (typeof(controller.onDidLoadFromCCB) == \"function\")\n            controller.onDidLoadFromCCB();\n        ]]--\n        --Setup timeline callbacks\n        local keyframeCallbacks = animationManager:getKeyframeCallbacks()\n\n        for i = 1 , table.getn(keyframeCallbacks) do\n            local callbackCombine = keyframeCallbacks[i]\n            local beignIndex,endIndex = string.find(callbackCombine,\":\")\n            local callbackType    = tonumber(string.sub(callbackCombine,1,beignIndex - 1))\n            local callbackName    = string.sub(callbackCombine,endIndex + 1, -1)\n            --Document callback\n\n            if 1 == callbackType and nil ~= ccb[documentControllerName] then\n                local callfunc = cc.CallFunc:create(ccb[documentControllerName][callbackName])\n                animationManager:setCallFuncForLuaCallbackNamed(callfunc, callbackCombine);\n            elseif 2 == callbackType and nil ~= owner then --Owner callback\n                local callfunc = cc.CallFunc:create(owner[callbackName])--need check\n                animationManager:setCallFuncForLuaCallbackNamed(callfunc, callbackCombine)\n            end\n        end\n        --start animation\n        local autoPlaySeqId = animationManager:getAutoPlaySequenceId()\n        if -1 ~= autoPlaySeqId then\n            animationManager:runAnimationsForSequenceIdTweenDuration(autoPlaySeqId, 0)\n        end\n    end\n\n    return node\nend\n\n\nlocal function CCBuilderReaderLoad(strFilePath,proxy,owner)\n    print(\"\\n********** \\n\"..\"CCBuilderReaderLoad(strFilePath,proxy,owner)\"..\" was deprecated please use \".. \"CCBReaderLoad(strFilePath,proxy,owner)\" .. \" instead.\\n**********\")\n    return CCBReaderLoad(strFilePath,proxy,owner)\nend\nrawset(_G,\"CCBuilderReaderLoad\",CCBuilderReaderLoad)"
  },
  {
    "path": "Resources/CocoStudio.lua",
    "content": "require \"json\"\nrequire \"extern\"\n\nccs = ccs or {}\n\nfunction ccs.sendTriggerEvent(event)\n    local triggerObjArr = ccs.TriggerMng.getInstance():get(event)\n    \n    if nil == triggerObjArr then\n        return\n    end\n\n    for i = 1, table.getn(triggerObjArr) do\n        local triObj = triggerObjArr[i]\n        if nil ~= triObj and triObj.detect then\n            triObj:done()\n        end\n    end\nend\n\nfunction ccs.registerTriggerClass(className, createFunc)\n    ccs.TInfo.new(className,createFunc)\nend\n\nccs.TInfo = class(\"TInfo\")\nccs.TInfo._className = \"\"\nccs.TInfo._fun = nil\n\nfunction ccs.TInfo:ctor(c,f)\n     -- @param {String|ccs.TInfo}c\n     -- @param {Function}f\n    if nil ~= f then\n        self._className = c\n        self._fun       = f\n    else\n        self._className = c._className\n        self._fun       = c._fun\n    end\n\n    ccs.ObjectFactory.getInstance():registerType(self)\nend\n\nccs.ObjectFactory = class(\"ObjectFactory\")\nccs.ObjectFactory._typeMap = nil\nccs.ObjectFactory._instance = nil\n\nfunction ccs.ObjectFactory:ctor()\n    self._typeMap = {}\nend\n\nfunction ccs.ObjectFactory.getInstance()\n    if nil == ccs.ObjectFactory._instance then\n        ccs.ObjectFactory._instance = ccs.ObjectFactory.new()\n    end\n\n    return ccs.ObjectFactory._instance\nend\n\nfunction ccs.ObjectFactory.destroyInstance()\n    ccs.ObjectFactory._instance = nil\nend\n\nfunction ccs.ObjectFactory:createObject(classname)\n    local obj = nil\n    local t   = self._typeMap[classname]\n    if nil ~= t then\n        obj = t._fun()\n    end\n\n    return obj\nend\n\nfunction ccs.ObjectFactory:registerType(t)\n    self._typeMap[t._className] = t\nend\n\nccs.TriggerObj = class(\"TriggerObj\")\nccs.TriggerObj._cons = {}\nccs.TriggerObj._acts = {}\nccs.TriggerObj._enable = false\nccs.TriggerObj._id   = 0\nccs.TriggerObj._vInt = {}\n\nfunction ccs.TriggerObj.extend(target)\n    local t = tolua.getpeer(target)\n    if not t then\n        t = {}\n        tolua.setpeer(target, t)\n    end\n    setmetatable(t, TriggerObj)\n    return target\nend\n\nfunction ccs.TriggerObj:ctor()\n    self:init()\nend\n\nfunction ccs.TriggerObj:init()\n    self._id = 0\n    self._enable = true\n    self._cons = {}\n    self._acts = {}\n    self._vInt = {}\nend\n\nfunction ccs.TriggerObj:detect()\n    if (not self._enable) or (table.getn(self._cons) == 0) then\n        return true\n    end \n\n    local ret = true\n    local obj = nil\n    for i = 1 , table.getn(self._cons) do\n        obj = self._cons[i]\n        if nil ~= obj and obj.detect then\n            ret = ret and obj:detect()\n        end\n    end\n    return ret\nend\n\nfunction ccs.TriggerObj:done()\n    if (not self._enable) or (table.getn(self._acts) == 0) then\n        return\n    end\n\n    local obj = nil\n    for i = 1, table.getn(self._acts) do\n        obj = self._acts[i]\n        if nil ~= obj and obj.done then\n            obj:done()\n        end\n    end\nend\n\nfunction ccs.TriggerObj:removeAll()\n    local obj = nil\n    for i=1, table.getn(self._cons) do\n        obj = self._cons[i]\n        if nil ~= obj then\n            obj:removeAll()\n        end\n    end\n    self._cons = {}\n\n    for i=1, table.getn(self._acts) do\n        obj = self._acts[i]\n        if nil ~= obj then\n            obj:removeAll()\n        end\n    end\n    self._acts = {}\nend\n\nfunction ccs.TriggerObj:serialize(jsonValue)\n    self._id = jsonValue[\"id\"]\n    local count = 0\n\n    --condition\n    local cons = jsonValue[\"conditions\"]\n    if nil ~= cons then\n        count = table.getn(cons)\n        for i = 1, count do\n            local subDict = cons[i]\n            local className = subDict[\"classname\"]\n            if nil ~= className then\n                local obj = ObjectFactory.getInstance():createObject(className)\n                assert(nil ~= obj, string.format(\"class named %s can not implement!\",className))\n                obj:serialize(subDict)\n                obj:init()\n                table.insert(self._cons, obj)\n            end\n        end\n    end\n\n    local actions =  jsonValue[\"actions\"]\n    if nil ~= actions then\n        count = table.getn(actions)\n        for i = 1,count do\n            local  subAction = actions[i]\n            local  className = subAction[\"classname\"]\n            if nil ~= className then\n                local act = ccs.ObjectFactory.getInstance():createObject(className)\n                assert(nil ~= act ,string.format(\"class named %s can not implement!\",className))\n                act:serialize(subAction)\n                act:init()\n                table.insert(self._acts,act)\n            end\n        end\n    end\n\n    local events = jsonValue[\"events\"]\n    if nil ~= events then\n        count = table.getn(events)\n        for i = 1, count do\n            local subEveent = events[i]\n            local eventID   = subEveent[\"id\"]\n            if eventID >= 0 then\n                table.insert(self._vInt,eventID)\n            end\n        end\n    end\nend\n\nfunction ccs.TriggerObj:getId()\n    return self._id\nend\n\nfunction ccs.TriggerObj:setEnable(enable)\n    self._enable = enable\nend\n\nfunction ccs.TriggerObj:getEvents()\n    return self._vInt\nend\n\nccs.TriggerMng = class(\"TriggerMng\")\nccs.TriggerMng._eventTriggers = nil\nccs.TriggerMng._triggerObjs = nil\nccs.TriggerMng._movementDispatches =  nil\nccs.TriggerMng._instance  = nil\n\nfunction ccs.TriggerMng:ctor()\n    self._triggerObjs = {}\n    self._movementDispatches = {}\n    self._eventTriggers = {}\nend\n\nfunction ccs.TriggerMng.getInstance()\n    if ccs.TriggerMng._instance == nil then\n        ccs.TriggerMng._instance = ccs.TriggerMng.new()\n    end\n\n    return ccs.TriggerMng._instance\nend\n\nfunction ccs.TriggerMng.destroyInstance()\n    if ccs.TriggerMng._instance ~= nil then\n        ccs.TriggerMng._instance:removeAll()\n        ccs.TriggerMng._instance = nil\n    end\nend\n\nfunction ccs.TriggerMng:triggerMngVersion()\n    return \"1.0.0.0\"\nend\n\nfunction ccs.TriggerMng:parse(jsonStr)\n    local parseTable = json.decode(jsonStr,1)\n    if nil == parseTable then\n        return\n    end\n\n    local count = table.getn(parseTable)\n    for i = 1, count do\n        local subDict = parseTable[i]\n        local triggerObj = ccs.TriggerObj.new()\n        triggerObj:serialize(subDict)\n        local events = triggerObj:getEvents()\n        for j = 1, table.getn(events) do\n            local event = events[j]\n            self:add(event, triggerObj)\n        end\n\n        self._triggerObjs[triggerObj:getId()] =  triggerObj\n    end\nend\n\nfunction ccs.TriggerMng:get(event)\n    return self._eventTriggers[event]\nend\n\nfunction ccs.TriggerMng:getTriggerObj(id)\n    return self._triggerObjs[id]\nend\n\nfunction ccs.TriggerMng:add(event,triggerObj)\n    local eventTriggers = self._eventTriggers[event]\n    if nil == eventTriggers then\n        eventTriggers = {}\n    end\n\n    local exist = false\n    for i = 1, table.getn(eventTriggers) do\n        if eventTriggers[i] == triggers then\n            exist = true\n            break\n        end\n    end\n\n    if not exist then\n        table.insert(eventTriggers,triggerObj)\n        self._eventTriggers[event] = eventTriggers\n    end\nend\n\nfunction ccs.TriggerMng:removeAll( )\n    for k in pairs(self._eventTriggers) do\n        local triObjArr = self._eventTriggers[k]\n        for j = 1, table.getn(triObjArr) do\n            local  obj = triObjArr[j]\n            obj:removeAll()\n        end\n    end\n    self._eventTriggers = {}\nend\n\nfunction ccs.TriggerMng:remove(event, obj)\n\n    if nil ~= obj then\n        return self:removeObjByEvent(event, obj)\n    end\n\n    assert(event >= 0,\"event must be larger than 0\")\n    if nil == self._eventTriggers then\n        return false\n    end\n\n    local triObjects =  self._eventTriggers[event]\n    if nil == triObjects then\n        return false\n    end\n\n    for i = 1, table.getn(triObjects) do\n        local triObject = triggers[i]\n        if nil ~= triObject then\n            triObject:remvoeAll()\n        end\n    end\n\n    self._eventTriggers[event] = nil\n    return true\nend\n\nfunction ccs.TriggerMng:removeObjByEvent(event, obj)\n    assert(event >= 0,\"event must be larger than 0\")\n    if nil == self._eventTriggers then\n        return false\n    end\n\n    local triObjects = self._eventTriggers[event]\n    if nil == triObjects then\n        return false\n    end\n\n    for i = 1,table.getn(triObjects) do\n        local triObject = triObjects[i]\n        if  nil ~= triObject and triObject == obj then\n            triObject:remvoeAll()\n            table.remove(triObjects, i)\n            return true\n        end\n    end\nend\n\nfunction ccs.TriggerMng:removeTriggerObj(id)\n    local obj = self.getTriggerObj(id)\n    \n    if nil == obj then\n        return false\n    end\n\n    local events = obj:getEvents()\n    for i = 1, table.getn(events) do\n        self:remove(events[i],obj)\n    end\n\n    return true\nend\n\nfunction ccs.TriggerMng:isEmpty()\n    return (not (nil == self._eventTriggers)) or table.getn(self._eventTriggers) <= 0\nend\n"
  },
  {
    "path": "Resources/Cocos2d.lua",
    "content": "require \"CocoStudio\"\n\ncc = cc or {}\n\ncc.DIRECTOR_PROJECTION_2D = 0\ncc.DIRECTOR_PROJECTION_3D = 1\n\nfunction cc.clampf(value, min_inclusive, max_inclusive)\n    -- body\n    local temp = 0\n    if min_inclusive > max_inclusive then\n        temp = min_inclusive \n        min_inclusive =  max_inclusive\n        max_inclusive = temp\n    end\n\n    if value < min_inclusive then\n        return min_inclusive\n    elseif value < max_inclusive then\n        return value\n    else\n        return max_inclusive\n    end\nend\n\n--Point\nfunction cc.p(_x,_y)\n    if nil == _y then\n         return { x = _x.x, y = _x.y }\n    else\n         return { x = _x, y = _y }\n    end\nend\n\nfunction cc.pAdd(pt1,pt2)\n    return {x = pt1.x + pt2.x , y = pt1.y + pt2.y }\nend\n\nfunction cc.pSub(pt1,pt2)\n    return {x = pt1.x - pt2.x , y = pt1.y - pt2.y }\nend\n\nfunction cc.pMul(pt1,factor)\n    return { x = pt1.x * factor , y = pt1.y * factor }\nend\n\nfunction cc.pMidpoint(pt1,pt2)\n    return { x = (pt1.x + pt2.x) / 2.0 , y = ( pt1.y + pt2.y) / 2.0 }\nend\n\nfunction cc.pForAngle(a)\n    return { x = math.cos(a), y = math.sin(a) }\nend\n\nfunction cc.pGetLength(pt)\n    return math.sqrt( pt.x * pt.x + pt.y * pt.y )\nend\n\nfunction cc.pNormalize(pt)\n    local length = cc.pGetLength(pt)\n    if 0 == length then\n        return { x = 1.0,y = 0.0 }\n    end\n\n    return { x = pt.x / length, y = pt.y / length }\nend\n\nfunction cc.pCross(self,other)\n    return self.x * other.y - self.y * other.x\nend\n\nfunction cc.pDot(self,other)\n    return self.x * other.x + self.y * other.y\nend\n\nfunction cc.pToAngleSelf(self)\n    return math.atan2(self.y, self.x)\nend\n\nfunction cc.pGetAngle(self,other)\n    local a2 = cc.pNormalize(self)\n    local b2 = cc.pNormalize(other)\n    local angle = math.atan2(cc.pCross(a2, b2), cc.pDot(a2, b2) )\n    if angle < 1.192092896e-7 then\n        return 0.0\n    end\n\n    return angle\nend\n\nfunction cc.pGetDistance(startP,endP)\n    return cc.pGetLength(cc.pSub(startP,endP))\nend\n\nfunction cc.pIsLineIntersect(A, B, C, D, s, t)\n    if ((A.x == B.x) and (A.y == B.y)) or ((C.x == D.x) and (C.y == D.y))then\n        return false, s, t\n    end\n\n    local BAx = B.x - A.x\n    local BAy = B.y - A.y\n    local DCx = D.x - C.x\n    local DCy = D.y - C.y\n    local ACx = A.x - C.x\n    local ACy = A.y - C.y\n\n    local denom = DCy * BAx - DCx * BAy\n    s = DCx * ACy - DCy * ACx\n    t = BAx * ACy - BAy * ACx\n\n    if (denom == 0) then\n        if (s == 0 or t == 0) then\n            return true, s , t\n        end\n\n        return false, s, t\n    end\n    \n    s = s / denom\n    t = t / denom\n\n    return true,s,t\nend\n\nfunction cc.pPerp(pt)\n    return { x = -pt.y, y = pt.x }\nend\n\nfunction cc.RPerp(pt)\n    return { x = pt.y,  y = -pt.x }\nend\n\nfunction cc.pProject(pt1, pt2)\n    return { x = pt2.x * (cc.pDot(pt1,pt2) / cc.pDot(pt2,pt2)) , y = pt2.y * (cc.pDot(pt1,pt2) / cc.pDot(pt2,pt2)) }\nend\n\nfunction cc.pRotate(pt1, pt2)\n    return { x = pt1.x * pt2.x - pt1.y * pt2.y, y = pt1.x * pt2.y + pt1.y * pt2.x }\nend\n\nfunction cc.pUnrotate(pt1, pt2)\n    return { x = pt1.x * pt2.x + pt1.y * pt2.y, pt1.y * pt2.x - pt1.x * pt2.y }\nend\n--Calculates the square length of pt\nfunction cc.pLengthSQ(pt)\n    return cc.pDot(pt,pt)\nend\n--Calculates the square distance between pt1 and pt2\nfunction cc.pDistanceSQ(pt1,pt2)\n    return cc.pLengthSQ(cc.pSub(pt1,pt2))\nend\n\nfunction cc.pGetClampPoint(pt1,pt2,pt3)\n    return { x = cc.clampf(pt1.x, pt2.x, pt3.x), y = cc.clampf(pt1.y, pt2.y, pt3.y) }\nend\n\nfunction cc.pFromSize(sz)\n    return { x = sz.width, y = sz.height }\nend\n\nfunction cc.pLerp(pt1,pt2,alpha) \n    return cc.pAdd(cc.pMul(pt1, 1.0 - alpha), cc.pMul(pt2,alpha) )\nend\n\nfunction cc.pFuzzyEqual(pt1,pt2,variance)\n    if (pt1.x - variance <= pt2.x) and (pt2.x <= pt1.x + variance) and (pt1.y - variance <= pt2.y) and (pt2.y <= pt1.y + variance) then\n        return true\n    else\n        return false\n    end\nend\n\nfunction cc.pRotateByAngle(pt1, pt2, angle)\n    return cc.pAdd(pt2, cc.pRotate( cc.pSub(pt1, pt2),cc.pForAngle(angle)))    \nend\n\nfunction cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4)\n    local s,t,ret = 0,0,false\n    ret,s,t =cc.pIsLineIntersect(pt1, pt2, pt3, pt4,s,t)\n    \n    if ret and  s >= 0.0 and s <= 1.0 and t >= 0.0 and t <= 0.0 then\n        return true;\n    end\n\n    return false\nend\n\nfunction cc.pGetIntersectPoint(pt1,pt2,pt3,pt4)\n    local s,t, ret = 0,0,false\n    ret,s,t = cc.pIsLineIntersect(pt1,pt2,pt3,pt4,s,t) \n    if ret then\n        return cc.p(pt1.x + s * (pt2.x - pt1.x), pt1.y + s * (pt2.y - pt1.y))\n    else\n        return cc.p(0,0)\n    end\nend\n--Size\nfunction cc.size( _width,_height )\n    return { width = _width, height = _height }\nend\n\n--Rect\nfunction cc.rect(_x,_y,_width,_height)\n    return { x = _x, y = _y, width = _width, height = _height }\nend\n\nfunction cc.rectEqualToRect(rect1,rect2)\n    if ((rect1.x >= rect2.x) or (rect1.y >= rect2.y) or\n        ( rect1.x + rect1.width <= rect2.x + rect2.width) or\n        ( rect1.y + rect1.height <= rect2.y + rect2.height)) then\n        return false\n    end\n\n    return true\nend\n\nfunction cc.rectGetMaxX(rect)\n    return rect.x + rect.width\nend\n\nfunction cc.rectGetMidX(rect)\n    return rect.x + rect.width / 2.0\nend\n\nfunction cc.rectGetMinX(rect)\n    return rect.x\nend\n\nfunction cc.rectGetMaxY(rect)\n    return rect.y + rect.height\nend\n\nfunction cc.rectGetMidY(rect)\n    return rect.y + rect.height / 2.0\nend\n\nfunction cc.rectGetMinY(rect)\n    return rect.y\nend\n\nfunction cc.rectContainsPoint( rect, point )\n    local ret = false\n    \n    if (point.x >= rect.x) and (point.x <= rect.x + rect.width) and\n       (point.y >= rect.y) and (point.y <= rect.y + rect.height) then\n        ret = true\n    end\n\n    return ret\nend\n\nfunction cc.rectIntersectsRect( rect1, rect2 )\n    local intersect = not ( rect1.x > rect2.x + rect2.width or\n                    rect1.x + rect1.width < rect2.x         or\n                    rect1.y > rect2.y + rect2.height        or\n                    rect1.y + rect1.height < rect2.y )\n\n    return intersect\nend\n\nfunction cc.rectUnion( rect1, rect2 )\n    local rect = cc.rect(0, 0, 0, 0)\n    rect.x = math.min(rect1.x, rect2.x)\n    rect.y = math.min(rect1.y, rect2.y)\n    rect.width = math.max(rect1.x + rect1.width, rect2.x + rect2.width) - rect.x\n    rect.height = math.max(rect1.y + rect1.height, rect2.y + rect2.height) - rect.y\n    return rect\nend\n\nfunction cc.rectIntersection( rect1, rect2 )\n    local intersection = cc.rect(\n        math.max(rect1.x, rect2.x),\n        math.max(rect1.y, rect2.y),\n        0, 0)\n\n    intersection.width = math.min(rect1.x + rect1.width, rect2.x + rect2.width) - intersection.x\n    intersection.height = math.min(rect1.y + rect1.height, rect2.y + rect2.height) - intersection.y\n    return intersection\nend\n\n--Color3B\nfunction cc.c3b( _r,_g,_b )\n    return { r = _r, g = _g, b = _b }\nend\n\n--Color4B\nfunction cc.c4b( _r,_g,_b,_a )\n    return { r = _r, g = _g, b = _b, a = _a }\nend\n\n--Color4F\nfunction cc.c4f( _r,_g,_b,_a )\n    return { r = _r, g = _g, b = _b, a = _a }\nend\n\n--Vertex2F\nfunction cc.vertex2F(_x,_y)\n    return { x = _x, y = _y }\nend\n\n--Vertex3F\nfunction cc.Vertex3F(_x,_y,_z)\n    return { x = _x, y = _y, z = _z }\nend\n\n--Tex2F\nfunction cc.tex2F(_u,_v)\n    return { u = _u, v = _v }\nend\n\n--PointSprite\nfunction cc.PointSprite(_pos,_color,_size)\n    return { pos = _pos, color = _color, size = _size }\nend\n\n--Quad2\nfunction cc.Quad2(_tl,_tr,_bl,_br)\n    return { tl = _tl, tr = _tr, bl = _bl, br = _br }\nend\n\n--Quad3\nfunction cc.Quad3(_tl, _tr, _bl, _br)\n    return { tl = _tl, tr = _tr, bl = _bl, br = _br }\nend\n\n--V2F_C4B_T2F\nfunction cc.V2F_C4B_T2F(_vertices, _colors, _texCoords)\n    return { vertices = _vertices, colors = _colors, texCoords = _texCoords }\nend\n\n--V2F_C4F_T2F\nfunction cc.V2F_C4F_T2F(_vertices, _colors, _texCoords)\n    return { vertices = _vertices, colors = _colors, texCoords = _texCoords }\nend\n\n--V3F_C4B_T2F\nfunction cc.V3F_C4B_T2F(_vertices, _colors, _texCoords)\n    return { vertices = _vertices, colors = _colors, texCoords = _texCoords }\nend\n\n--V2F_C4B_T2F_Quad\nfunction cc.V2F_C4B_T2F_Quad(_bl, _br, _tl, _tr)\n    return { bl = _bl, br = _br, tl = _tl, tr = _tr }\nend\n\n--V3F_C4B_T2F_Quad\nfunction cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br)\n    return { tl = _tl, bl = _bl, tr = _tr, br = _br }\nend\n\n--V2F_C4F_T2F_Quad\nfunction cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr)\n    return { bl = _bl, br = _br, tl = _tl, tr = _tr }\nend\n\n--T2F_Quad\nfunction cc.T2F_Quad(_bl, _br, _tl, _tr)\n    return { bl = _bl, br = _br, tl = _tl, tr = _tr }\nend\n\n--AnimationFrameData\nfunction cc.AnimationFrameData( _texCoords, _delay, _size)\n    return { texCoords = _texCoords, delay = _delay, size = _size }\nend\n\n--PhysicsMaterial\nfunction cc.PhysicsMaterial(_density, _restitution, _friction)\n\treturn { density = _density, restitution = _restitution, friction = _friction }\nend\n\nlocal ConfigType = \n{\n    NONE = 0,\n    COCOSTUDIO = 1,\n}\n\nfunction __onParseConfig(configType,jasonStr)\n    if configType == ConfigType.COCOSTUDIO then\n        ccs.TriggerMng.getInstance():parse(jasonStr)\n    end\nend\n"
  },
  {
    "path": "Resources/Cocos2dConstants.lua",
    "content": "cc = cc or {}\n\ncc.SPRITE_INDEX_NOT_INITIALIZED = 0xffffffff\ncc.TMX_ORIENTATION_HEX  = 0x1\ncc.TMX_ORIENTATION_ISO  = 0x2\ncc.TMX_ORIENTATION_ORTHO    = 0x0\ncc.Z_COMPRESSION_BZIP2  = 0x1\ncc.Z_COMPRESSION_GZIP   = 0x2\ncc.Z_COMPRESSION_NONE   = 0x3\ncc.Z_COMPRESSION_ZLIB   = 0x0\ncc.BLEND_DST    = 0x303\ncc.BLEND_SRC    = 0x1\ncc.DIRECTOR_IOS_USE_BACKGROUND_THREAD   = 0x0\ncc.DIRECTOR_MAC_THREAD  = 0x0\ncc.DIRECTOR_STATS_INTERVAL  = 0.1\ncc.ENABLE_BOX2_D_INTEGRATION    = 0x0\ncc.ENABLE_DEPRECATED    = 0x1\ncc.ENABLE_GL_STATE_CACHE    = 0x1\ncc.ENABLE_PROFILERS = 0x0\ncc.ENABLE_STACKABLE_ACTIONS = 0x1\ncc.FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0x0\ncc.GL_ALL   = 0x0\ncc.LABELATLAS_DEBUG_DRAW    = 0x0\ncc.LABELBMFONT_DEBUG_DRAW   = 0x0\ncc.MAC_USE_DISPLAY_LINK_THREAD  = 0x0\ncc.MAC_USE_MAIN_THREAD  = 0x2\ncc.MAC_USE_OWN_THREAD   = 0x1\ncc.NODE_RENDER_SUBPIXEL = 0x1\ncc.PVRMIPMAP_MAX    = 0x10\ncc.SPRITEBATCHNODE_RENDER_SUBPIXEL  = 0x1\ncc.SPRITE_DEBUG_DRAW    = 0x0\ncc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP = 0x0\ncc.TEXTURE_ATLAS_USE_VAO    = 0x1\ncc.USE_L_A88_LABELS = 0x1\ncc.ACTION_TAG_INVALID   = -1\ncc.DEVICE_MAC   = 0x6\ncc.DEVICE_MAC_RETINA_DISPLAY    = 0x7\ncc.DEVICEI_PAD  = 0x4\ncc.DEVICEI_PAD_RETINA_DISPLAY   = 0x5\ncc.DEVICEI_PHONE    = 0x0\ncc.DEVICEI_PHONE5   = 0x2\ncc.DEVICEI_PHONE5_RETINA_DISPLAY    = 0x3\ncc.DEVICEI_PHONE_RETINA_DISPLAY = 0x1\ncc.DIRECTOR_PROJECTION2_D   = 0x0\ncc.DIRECTOR_PROJECTION3_D   = 0x1\ncc.DIRECTOR_PROJECTION_CUSTOM   = 0x2\ncc.DIRECTOR_PROJECTION_DEFAULT  = 0x1\ncc.FILE_UTILS_SEARCH_DIRECTORY_MODE = 0x1\ncc.FILE_UTILS_SEARCH_SUFFIX_MODE    = 0x0\ncc.FLIPED_ALL   = 0xe0000000\ncc.FLIPPED_MASK = 0x1fffffff\ncc.IMAGE_FORMAT_JPEG    = 0x0\ncc.IMAGE_FORMAT_PNG = 0x1\ncc.ITEM_SIZE    = 0x20\ncc.LABEL_AUTOMATIC_WIDTH    = -1\ncc.LINE_BREAK_MODE_CHARACTER_WRAP   = 0x1\ncc.LINE_BREAK_MODE_CLIP = 0x2\ncc.LINE_BREAK_MODE_HEAD_TRUNCATION  = 0x3\ncc.LINE_BREAK_MODE_MIDDLE_TRUNCATION    = 0x5\ncc.LINE_BREAK_MODE_TAIL_TRUNCATION  = 0x4\ncc.LINE_BREAK_MODE_WORD_WRAP    = 0x0\ncc.MAC_VERSION_10_6 = 0xa060000\ncc.MAC_VERSION_10_7 = 0xa070000\ncc.MAC_VERSION_10_8 = 0xa080000\ncc.MENU_HANDLER_PRIORITY    = -128\ncc.MENU_STATE_TRACKING_TOUCH    = 0x1\ncc.MENU_STATE_WAITING   = 0x0\ncc.NODE_TAG_INVALID = -1\ncc.PARTICLE_DURATION_INFINITY   = -1\ncc.PARTICLE_MODE_GRAVITY    = 0x0\ncc.PARTICLE_MODE_RADIUS = 0x1\ncc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS    = -1\ncc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE    = -1\ncc.POSITION_TYPE_FREE   = 0x0\ncc.POSITION_TYPE_GROUPED    = 0x2\ncc.POSITION_TYPE_RELATIVE   = 0x1\ncc.PRIORITY_NON_SYSTEM_MIN  = -2147483647\ncc.PRIORITY_SYSTEM  = -2147483648\ncc.PROGRESS_TIMER_TYPE_BAR  = 0x1\ncc.PROGRESS_TIMER_TYPE_RADIAL   = 0x0\ncc.REPEAT_FOREVER   = 0xfffffffe\ncc.RESOLUTION_MAC   = 0x1\ncc.RESOLUTION_MAC_RETINA_DISPLAY    = 0x2\ncc.RESOLUTION_UNKNOWN   = 0x0\ncc.TMX_TILE_DIAGONAL_FLAG   = 0x20000000\ncc.TMX_TILE_HORIZONTAL_FLAG = 0x80000000\ncc.TMX_TILE_VERTICAL_FLAG   = 0x40000000\ncc.TEXT_ALIGNMENT_CENTER    = 0x1\ncc.TEXT_ALIGNMENT_LEFT  = 0x0\ncc.TEXT_ALIGNMENT_RIGHT = 0x2\n\ncc.TEXTURE2_D_PIXEL_FORMAT_AUTO = 0x0\ncc.TEXTURE2_D_PIXEL_FORMAT_BGR_A8888 = 0x1\ncc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888 = 0x2\ncc.TEXTURE2_D_PIXEL_FORMAT_RG_B888    = 0x3\ncc.TEXTURE2_D_PIXEL_FORMAT_RG_B565   = 0x4\ncc.TEXTURE2_D_PIXEL_FORMAT_A8        = 0x5\ncc.TEXTURE2_D_PIXEL_FORMAT_I8        = 0x6\ncc.TEXTURE2_D_PIXEL_FORMAT_A_I88     = 0x7\ncc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444     = 0x8\ncc.TEXTURE2_D_PIXEL_FORMAT_RGB5_A1       = 0x9\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4        = 0xa\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4A       = 0xb\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2        = 0xc\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2A       = 0xd\ncc.TEXTURE2_D_PIXEL_FORMAT_ETC           = 0xe\ncc.TEXTURE2_D_PIXEL_FORMAT_S3TC_DXT1     = 0xf\ncc.TEXTURE2_D_PIXEL_FORMAT_S3TC_DXT3     = 0x10\ncc.TEXTURE2_D_PIXEL_FORMAT_S3TC_DXT5     = 0x11\ncc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT       = 0x0\ncc.TOUCHES_ALL_AT_ONCE  = 0x0\ncc.TOUCHES_ONE_BY_ONE   = 0x1\ncc.TRANSITION_ORIENTATION_DOWN_OVER = 0x1\ncc.TRANSITION_ORIENTATION_LEFT_OVER = 0x0\ncc.TRANSITION_ORIENTATION_RIGHT_OVER    = 0x1\ncc.TRANSITION_ORIENTATION_UP_OVER   = 0x0\ncc.UNIFORM_COS_TIME = 0x5\ncc.UNIFORM_MV_MATRIX    = 0x1\ncc.UNIFORM_MVP_MATRIX   = 0x2\ncc.UNIFORM_P_MATRIX = 0x0\ncc.UNIFORM_RANDOM01 = 0x6\ncc.UNIFORM_SAMPLER  = 0x7\ncc.UNIFORM_SIN_TIME = 0x4\ncc.UNIFORM_TIME = 0x3\ncc.UNIFORM_MAX  = 0x8\ncc.VERTEX_ATTRIB_FLAG_COLOR = 0x2\ncc.VERTEX_ATTRIB_FLAG_NONE  = 0x0\ncc.VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = 0x7\ncc.VERTEX_ATTRIB_FLAG_POSITION  = 0x1\ncc.VERTEX_ATTRIB_FLAG_TEX_COORDS    = 0x4\ncc.VERTEX_ATTRIB_COLOR  = 0x1\ncc.VERTEX_ATTRIB_MAX    = 0x3\ncc.VERTEX_ATTRIB_POSITION   = 0x0\ncc.VERTEX_ATTRIB_TEX_COORDS = 0x2\ncc.VERTICAL_TEXT_ALIGNMENT_BOTTOM   = 0x2\ncc.VERTICAL_TEXT_ALIGNMENT_CENTER   = 0x1\ncc.VERTICAL_TEXT_ALIGNMENT_TOP  = 0x0\ncc.OS_VERSION_4_0   = 0x4000000\ncc.OS_VERSION_4_0_1 = 0x4000100\ncc.OS_VERSION_4_1   = 0x4010000\ncc.OS_VERSION_4_2   = 0x4020000\ncc.OS_VERSION_4_2_1 = 0x4020100\ncc.OS_VERSION_4_3   = 0x4030000\ncc.OS_VERSION_4_3_1 = 0x4030100\ncc.OS_VERSION_4_3_2 = 0x4030200\ncc.OS_VERSION_4_3_3 = 0x4030300\ncc.OS_VERSION_4_3_4 = 0x4030400\ncc.OS_VERSION_4_3_5 = 0x4030500\ncc.OS_VERSION_5_0   = 0x5000000\ncc.OS_VERSION_5_0_1 = 0x5000100\ncc.OS_VERSION_5_1_0 = 0x5010000\ncc.OS_VERSION_6_0_0 = 0x6000000\ncc.ANIMATION_FRAME_DISPLAYED_NOTIFICATION   = 'CCAnimationFrameDisplayedNotification'\ncc.CHIPMUNK_IMPORT  = 'chipmunk.h'\ncc.ATTRIBUTE_NAME_COLOR = 'a_color'\ncc.ATTRIBUTE_NAME_POSITION  = 'a_position'\ncc.ATTRIBUTE_NAME_TEX_COORD = 'a_texCoord'\ncc.SHADER_POSITION_COLOR    = 'ShaderPositionColor'\ncc.SHADER_POSITION_LENGTH_TEXURE_COLOR  = 'ShaderPositionLengthTextureColor'\ncc.SHADER_POSITION_TEXTURE  = 'ShaderPositionTexture'\ncc.SHADER_POSITION_TEXTURE_A8_COLOR = 'ShaderPositionTextureA8Color'\ncc.SHADER_POSITION_TEXTURE_COLOR    = 'ShaderPositionTextureColor'\ncc.SHADER_POSITION_TEXTURE_COLOR_ALPHA_TEST = 'ShaderPositionTextureColorAlphaTest'\ncc.SHADER_POSITION_TEXTURE_U_COLOR  = 'ShaderPositionTexture_uColor'\ncc.SHADER_POSITION_U_COLOR  = 'ShaderPosition_uColor'\ncc.UNIFORM_ALPHA_TEST_VALUE_S   = 'CC_AlphaValue'\ncc.UNIFORM_COS_TIME_S   = 'CC_CosTime'\ncc.UNIFORM_MV_MATRIX_S  = 'CC_MVMatrix'\ncc.UNIFORM_MVP_MATRIX_S = 'CC_MVPMatrix'\ncc.UNIFORM_P_MATRIX_S   = 'CC_PMatrix'\ncc.UNIFORM_RANDOM01_S   = 'CC_Random01'\ncc.UNIFORM_SAMPLER_S    = 'CC_Texture0'\ncc.UNIFORM_SIN_TIME_S   = 'CC_SinTime'\ncc.UNIFORM_TIME_S   = 'CC_Time'\n\ncc.PLATFORM_OS_WINDOWS = 0\ncc.PLATFORM_OS_LINUX   = 1\ncc.PLATFORM_OS_MAC     = 2\ncc.PLATFORM_OS_ANDROID = 3\ncc.PLATFORM_OS_IPHONE  = 4\ncc.PLATFORM_OS_IPAD    = 5\ncc.PLATFORM_OS_BLACKBERRY = 6\ncc.PLATFORM_OS_NACL    = 7\ncc.PLATFORM_OS_EMSCRIPTEN = 8\ncc.PLATFORM_OS_TIZEN   = 9\n\ncc.SCROLLVIEW_SCRIPT_SCROLL = 0\ncc.SCROLLVIEW_SCRIPT_ZOOM   = 1\ncc.TABLECELL_TOUCHED        = 2\ncc.TABLECELL_HIGH_LIGHT     = 3\ncc.TABLECELL_UNHIGH_LIGHT   = 4\ncc.TABLECELL_WILL_RECYCLE   = 5\ncc.TABLECELL_SIZE_FOR_INDEX = 6\ncc.TABLECELL_SIZE_AT_INDEX  = 7\ncc.NUMBER_OF_CELLS_IN_TABLEVIEW = 8\n\ncc.SCROLLVIEW_DIRECTION_NONE = -1\ncc.SCROLLVIEW_DIRECTION_HORIZONTAL = 0\ncc.SCROLLVIEW_DIRECTION_VERTICAL = 1\ncc.SCROLLVIEW_DIRECTION_BOTH  = 2\n\ncc.CONTROL_EVENTTYPE_TOUCH_DOWN = 1\ncc.CONTROL_EVENTTYPE_DRAG_INSIDE = 2\ncc.CONTROL_EVENTTYPE_DRAG_OUTSIDE = 4\ncc.CONTROL_EVENTTYPE_DRAG_ENTER = 8\ncc.CONTROL_EVENTTYPE_DRAG_EXIT = 16\ncc.CONTROL_EVENTTYPE_TOUCH_UP_INSIDE = 32\ncc.CONTROL_EVENTTYPE_TOUCH_UP_OUTSIDE = 64\ncc.CONTROL_EVENTTYPE_TOUCH_CANCEL    = 128\ncc.CONTROL_EVENTTYPE_VALUE_CHANGED   = 256\n\ncc.CONTROL_STATE_NORMAL  = 1\ncc.CONTROL_STATE_HIGH_LIGHTED = 2\ncc.CONTROL_STATE_DISABLED = 4\ncc.CONTROL_STATE_SELECTED = 8\n\n\ncc.KEYBOARD_RETURNTYPE_DEFAULT = 0\ncc.KEYBOARD_RETURNTYPE_DONE = 1\ncc.KEYBOARD_RETURNTYPE_SEND = 2\ncc.KEYBOARD_RETURNTYPE_SEARCH = 3\ncc.KEYBOARD_RETURNTYPE_GO = 4\n\n\ncc.EDITBOX_INPUT_MODE_ANY = 0\ncc.EDITBOX_INPUT_MODE_EMAILADDR = 1\ncc.EDITBOX_INPUT_MODE_NUMERIC = 2\ncc.EDITBOX_INPUT_MODE_PHONENUMBER = 3\ncc.EDITBOX_INPUT_MODE_URL = 4\ncc.EDITBOX_INPUT_MODE_DECIMAL = 5\ncc.EDITBOX_INPUT_MODE_SINGLELINE = 6\n\n\ncc.EDITBOX_INPUT_FLAG_PASSWORD = 0\ncc.EDITBOX_INPUT_FLAG_SENSITIVE = 1\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_WORD = 2\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_SENTENCE = 3\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_ALL_CHARACTERS = 4\n\ncc.LANGUAGE_ENGLISH    = 0\ncc.LANGUAGE_CHINESE    = 1\ncc.LANGUAGE_FRENCH     = 2\ncc.LANGUAGE_ITALIAN    = 3\ncc.LANGUAGE_GERMAN     = 4\ncc.LANGUAGE_SPANISH    = 5\ncc.LANGUAGE_RUSSIAN    = 6\ncc.LANGUAGE_KOREAN     = 7\ncc.LANGUAGE_JAPANESE   = 8\ncc.LANGUAGE_HUNGARIAN  = 9\ncc.LANGUAGE_PORTUGUESE = 10\ncc.LANGUAGE_ARABIC     = 11\n\ncc.NODE_ON_ENTER       = 0\ncc.NODE_ON_EXIT        = 1\ncc.NODE_ON_ENTER_TRANSITION_DID_FINISH = 2\ncc.NODE_ON_EXIT_TRANSITION_DID_START   = 3 \ncc.NODE_ON_CLEAN_UP    = 4\n\ncc.CONTROL_STEPPER_PART_MINUS = 0\ncc.CONTROL_STEPPER_PART_PLUS  = 1\ncc.CONTROL_STEPPER_PART_NONE  = 2\n\ncc.TABLEVIEW_FILL_TOPDOWN = 0\ncc.TABLEVIEW_FILL_BOTTOMUP = 1\n\ncc.WEBSOCKET_OPEN     = 0\ncc.WEBSOCKET_MESSAGE  = 1\ncc.WEBSOCKET_CLOSE    = 2\ncc.WEBSOCKET_ERROR    = 3\n\ncc.WEBSOCKET_STATE_CONNECTING = 0\ncc.WEBSOCKET_STATE_OPEN       = 1\ncc.WEBSOCKET_STATE_CLOSING    = 2\ncc.WEBSOCKET_STATE_CLOSED     = 3\n\n\ncc.XMLHTTPREQUEST_RESPONSE_STRING = 0\ncc.XMLHTTPREQUEST_RESPONSE_ARRAY_BUFFER = 1\ncc.XMLHTTPREQUEST_RESPONSE_BLOB   = 2\ncc.XMLHTTPREQUEST_RESPONSE_DOCUMENT = 3\ncc.XMLHTTPREQUEST_RESPONSE_JSON = 4\n\ncc.ASSETSMANAGER_CREATE_FILE  = 0\ncc.ASSETSMANAGER_NETWORK = 1\ncc.ASSETSMANAGER_NO_NEW_VERSION = 2\ncc.ASSETSMANAGER_UNCOMPRESS     = 3\n\ncc.ASSETSMANAGER_PROTOCOL_PROGRESS =  0\ncc.ASSETSMANAGER_PROTOCOL_SUCCESS  =  1\ncc.ASSETSMANAGER_PROTOCOL_ERROR    =  2\n\ncc.Handler = cc.Handler or {}\ncc.Handler.NODE            = 0\ncc.Handler.MENU_CLICKED    = 1\ncc.Handler.CALLFUNC        = 2\ncc.Handler.SCHEDULE        = 3\ncc.Handler.TOUCHES         = 4\ncc.Handler.KEYPAD          = 5\ncc.Handler.ACCELEROMETER   = 6\ncc.Handler.CONTROL_TOUCH_DOWN = 7\ncc.Handler.CONTROL_TOUCH_DRAG_INSIDE = 8\ncc.Handler.CONTROL_TOUCH_DRAG_OUTSIDE = 9\ncc.Handler.CONTROL_TOUCH_DRAG_ENTER = 10\ncc.Handler.CONTROL_TOUCH_DRAG_EXIT  = 11\ncc.Handler.CONTROL_TOUCH_UP_INSIDE  = 12\ncc.Handler.CONTROL_TOUCH_UP_OUTSIDE = 13\ncc.Handler.CONTROL_TOUCH_UP_CANCEL  = 14\ncc.Handler.CONTROL_VALUE_CHANGED    = 15\ncc.Handler.WEBSOCKET_OPEN           = 16\ncc.Handler.WEBSOCKET_MESSAGE        = 17\ncc.Handler.WEBSOCKET_CLOSE          = 18\ncc.Handler.WEBSOCKET_ERROR          = 19\ncc.Handler.GL_NODE_DRAW             = 20\ncc.Handler.SCROLLVIEW_SCROLL        = 21\ncc.Handler.SCROLLVIEW_ZOOM          = 22\ncc.Handler.TABLECELL_TOUCHED        = 23\ncc.Handler.TABLECELL_HIGHLIGHT      = 24\ncc.Handler.TABLECELL_UNHIGHLIGHT    = 25\ncc.Handler.TABLECELL_WILL_RECYCLE   = 26\ncc.Handler.TABLECELL_SIZE_FOR_INDEX = 27\ncc.Handler.TABLECELL_AT_INDEX       = 28\ncc.Handler.TABLEVIEW_NUMS_OF_CELLS  = 29\ncc.Handler.HTTPREQUEST_STATE_CHANGE = 30\ncc.Handler.ASSETSMANAGER_PROGRESS = 31\ncc.Handler.ASSETSMANAGER_SUCCESS  = 32\ncc.Handler.ASSETSMANAGER_ERROR    = 33\ncc.Handler.STUDIO_EVENT_LISTENER  = 34\ncc.Handler.ARMATURE_EVENT         = 35\ncc.Handler.EVENT_ACC              = 36\ncc.Handler.EVENT_CUSTIOM          = 37\ncc.Handler.EVENT_KEYBOARD_PRESSED = 38\ncc.Handler.EVENT_KEYBOARD_RELEASED = 39\ncc.Handler.EVENT_TOUCH_BEGAN      = 40\ncc.Handler.EVENT_TOUCH_MOVED      = 41\ncc.Handler.EVENT_TOUCH_ENDED      = 42\ncc.Handler.EVENT_TOUCH_CANCELLED  = 43\ncc.Handler.EVENT_TOUCHES_BEGAN    = 44\ncc.Handler.EVENT_TOUCHES_MOVED    = 45\ncc.Handler.EVENT_TOUCHES_ENDED    = 46\ncc.Handler.EVENT_TOUCHES_CANCELLED = 47\ncc.Handler.EVENT_MOUSE_DOWN       = 48\ncc.Handler.EVENT_MOUSE_UP         = 49\ncc.Handler.EVENT_MOUSE_MOVE       = 50\ncc.Handler.EVENT_MOUSE_SCROLL     = 51\ncc.Handler.EVENT_SPINE            = 52\ncc.Handler.EVENT_PHYSICS_CONTACT_BEGIN = 53\ncc.Handler.EVENT_PHYSICS_CONTACT_PRESOLVE = 54\ncc.Handler.EVENT_PHYSICS_CONTACT_POSTSOLVE = 55\ncc.Handler.EVENT_PHYSICS_CONTACT_SEPERATE = 56\n\ncc.EVENT_UNKNOWN = 0\ncc.EVENT_TOUCH_ONE_BY_ONE      = 1\ncc.EVENT_TOUCH_ALL_AT_ONCE     = 2\ncc.EVENT_KEYBOARD              = 3\ncc.EVENT_MOUSE                 = 4\ncc.EVENT_ACCELERATION          = 5\ncc.EVENT_CUSTOM                = 6\n\ncc.PHYSICSSHAPE_MATERIAL_DEFAULT = {density = 0.0, restitution = 0.5, friction = 0.5}\ncc.PHYSICSBODY_MATERIAL_DEFAULT = {density = 0.1, restitution = 0.5, friction = 0.5}\ncc.GLYPHCOLLECTION_DYNAMIC = 0\ncc.GLYPHCOLLECTION_NEHE    = 1\ncc.GLYPHCOLLECTION_ASCII   = 2\ncc.GLYPHCOLLECTION_CUSTOM  = 3\n\ncc.LabelEffect = \n{\n    NORMAL  = 0,\n    OUTLINE = 1,\n    SHADOW  = 2,\n    GLOW    = 3,\n}\n\ncc.KeyCode =\n{\n    KEY_NONE              = 0,\n    KEY_PAUSE             = 0x0013,\n    KEY_SCROLL_LOCK       = 0x1014,\n    KEY_PRINT             = 0x1061,\n    KEY_SYSREQ            = 0x106A,\n    KEY_BREAK             = 0x106B,\n    KEY_ESCAPE            = 0x001B,\n    KEY_BACKSPACE         = 0x0008,\n    KEY_TAB               = 0x0009,\n    KEY_BACK_TAB          = 0x0089,\n    KEY_RETURN            = 0x000D,\n    KEY_CAPS_LOCK         = 0x00E5,\n    KEY_SHIFT             = 0x00E1,\n    KEY_CTRL              = 0x00E3,\n    KEY_ALT               = 0x00E9,\n    KEY_MENU              = 0x1067,\n    KEY_HYPER             = 0x10ED,\n    KEY_INSERT            = 0x1063,\n    KEY_HOME              = 0x1050,\n    KEY_PG_UP             = 0x1055,\n    KEY_DELETE            = 0x10FF,\n    KEY_END               = 0x1057,\n    KEY_PG_DOWN           = 0x1056,\n    KEY_LEFT_ARROW        = 0x1051,\n    KEY_RIGHT_ARROW       = 0x1053,\n    KEY_UP_ARROW          = 0x1052,\n    KEY_DOWN_ARROW        = 0x1054,\n    KEY_NUM_LOCK          = 0x107F,\n    KEY_KP_PLUS           = 0x10AB,\n    KEY_KP_MINUS          = 0x10AD,\n    KEY_KP_MULTIPLY       = 0x10AA,\n    KEY_KP_DIVIDE         = 0x10AF,\n    KEY_KP_ENTER          = 0x108D,\n    KEY_KP_HOME           = 0x10B7,\n    KEY_KP_UP             = 0x10B8,\n    KEY_KP_PG_UP          = 0x10B9,\n    KEY_KP_LEFT           = 0x10B4,\n    KEY_KP_FIVE           = 0x10B5,\n    KEY_KP_RIGHT          = 0x10B6,\n    KEY_KP_END            = 0x10B1,\n    KEY_KP_DOWN           = 0x10B2,\n    KEY_KP_PG_DOWN        = 0x10B3,\n    KEY_KP_INSERT         = 0x10B0,\n    KEY_KP_DELETE         = 0x10AE,\n    KEY_F1                = 0x00BE,\n    KEY_F2                = 0x00BF,\n    KEY_F3                = 0x00C0,\n    KEY_F4                = 0x00C1,\n    KEY_F5                = 0x00C2,\n    KEY_F6                = 0x00C3,\n    KEY_F7                = 0x00C4,\n    KEY_F8                = 0x00C5,\n    KEY_F9                = 0x00C6,\n    KEY_F10               = 0x00C7,\n    KEY_F11               = 0x00C8,\n    KEY_F12               = 0x00C9,\n    KEY_SPACE             = ' ',\n    KEY_EXCLAM            = '!',\n    KEY_QUOTE             = '\"',\n    KEY_NUMBER            = '#',\n    KEY_DOLLAR            = '$',\n    KEY_PERCENT           = '%',\n    KEY_CIRCUMFLEX        = '^',\n    KEY_AMPERSAND         = '&',\n    KEY_APOSTROPHE        = '\\'',\n    KEY_LEFT_PARENTHESIS  = '(',\n    KEY_RIGHT_PARENTHESIS = ')',\n    KEY_ASTERISK          = '*',\n    KEY_PLUS              = '+',\n    KEY_COMMA             = ',',\n    KEY_MINUS             = '-',\n    KEY_PERIOD            = '.',\n    KEY_SLASH             = '/',\n    KEY_0                 = '0',\n    KEY_1                 = '1',\n    KEY_2                 = '2',\n    KEY_3                 = '3',\n    KEY_4                 = '4',\n    KEY_5                 = '5',\n    KEY_6                 = '6',\n    KEY_7                 = '7',\n    KEY_8                 = '8',\n    KEY_9                 = '9',\n    KEY_COLON             = ':',\n    KEY_SEMICOLON         = ';',\n    KEY_LESS_THAN         = '<',\n    KEY_EQUAL             = '=',\n    KEY_GREATER_THAN      = '>',\n    KEY_QUESTION          = '?',\n    KEY_AT                = '@',\n    KEY_CAPITAL_A         = 'A',\n    KEY_CAPITAL_B         = 'B',\n    KEY_CAPITAL_C         = 'C',\n    KEY_CAPITAL_D         = 'D',\n    KEY_CAPITAL_E         = 'E',\n    KEY_CAPITAL_F         = 'F',\n    KEY_CAPITAL_G         = 'G',\n    KEY_CAPITAL_H         = 'H',\n    KEY_CAPITAL_I         = 'I',\n    KEY_CAPITAL_J         = 'J',\n    KEY_CAPITAL_K         = 'K',\n    KEY_CAPITAL_L         = 'L',\n    KEY_CAPITAL_M         = 'M',\n    KEY_CAPITAL_N         = 'N',\n    KEY_CAPITAL_O         = 'O',\n    KEY_CAPITAL_P         = 'P',\n    KEY_CAPITAL_Q         = 'Q',\n    KEY_CAPITAL_R         = 'R',\n    KEY_CAPITAL_S         = 'S',\n    KEY_CAPITAL_T         = 'T',\n    KEY_CAPITAL_U         = 'U',\n    KEY_CAPITAL_V         = 'V',\n    KEY_CAPITAL_W         = 'W',\n    KEY_CAPITAL_X         = 'X',\n    KEY_CAPITAL_Y         = 'Y',\n    KEY_CAPITAL_Z         = 'Z',\n    KEY_LEFT_BRACKET      = '[',\n    KEY_BACK_SLASH        = '\\\\',\n    KEY_RIGHT_BRACKET     = ']',\n    KEY_UNDERSCORE        = '_',\n    KEY_GRAVE             = '`',\n    KEY_A                 = 'a',\n    KEY_B                 = 'b',\n    KEY_C                 = 'c',\n    KEY_D                 = 'd',\n    KEY_E                 = 'e',\n    KEY_F                 = 'f',\n    KEY_G                 = 'g',\n    KEY_H                 = 'h',\n    KEY_I                 = 'i',\n    KEY_J                 = 'j',\n    KEY_K                 = 'k',\n    KEY_L                 = 'l',\n    KEY_M                 = 'm',\n    KEY_N                 = 'n',\n    KEY_O                 = 'o',\n    KEY_P                 = 'p',\n    KEY_Q                 = 'q',\n    KEY_R                 = 'r',\n    KEY_S                 = 's',\n    KEY_T                 = 't',\n    KEY_U                 = 'u',\n    KEY_V                 = 'v',\n    KEY_W                 = 'w',\n    KEY_X                 = 'x',\n    KEY_Y                 = 'y',\n    KEY_Z                 = 'z',\n    KEY_LEFT_BRACE        = '{',\n    KEY_BAR               = '|',\n    KEY_RIGHT_BRACE       = '}',\n    KEY_TILDE             = '~',\n    KEY_EURO              = 0x20AC,\n    KEY_POUND             = 0x00A3,\n    KEY_YEN               = 0x00A5,\n    KEY_MIDDLE_DOT        = 0x0095,\n    KEY_SEARCH            = 0xFFAA,\n};\n\n\n\n"
  },
  {
    "path": "Resources/Deprecated.lua",
    "content": "require \"Cocos2d.lua\"\n--tip\nlocal function deprecatedTip(old_name,new_name)\n    print(\"\\n********** \\n\"..old_name..\" was deprecated please use \".. new_name .. \" instead.\\n**********\")\nend\n\n\n--functions of CCDirector will be deprecated,begin\nlocal CCDirectorDeprecated = { }\nfunction CCDirectorDeprecated.sharedDirector()\n    deprecatedTip(\"CCDirector:sharedDirector\",\"cc.Director:getInstance\")\n    return cc.Director:getInstance()\nend\nrawset(CCDirector,\"sharedDirector\",CCDirectorDeprecated.sharedDirector)\n--functions of CCDirector will be deprecated,end\n\n\n--functions of CCTextureCache will be deprecated begin\nlocal TextureCacheDeprecated = {}\nfunction TextureCacheDeprecated.getInstance(self)\n    deprecatedTip(\"cc.TextureCache:getInstance\",\"cc.Director:getInstance():getTextureCache\")\n    return cc.Director:getInstance():getTextureCache()\nend\nrawset(cc.TextureCache,\"getInstance\",TextureCacheDeprecated.getInstance)\n\nfunction TextureCacheDeprecated.destroyInstance(self)\n    deprecatedTip(\"cc.TextureCache:destroyInstance\",\"cc.Director:getInstance():destroyTextureCache\")\n    return cc.Director:getInstance():destroyTextureCache()\nend\nrawset(cc.TextureCache,\"destroyInstance\",TextureCacheDeprecated.destroyInstance)\n\nfunction TextureCacheDeprecated.dumpCachedTextureInfo(self)\n    deprecatedTip(\"self:dumpCachedTextureInfo\",\"self:getCachedTextureInfo\")\n    return print(self:getCachedTextureInfo())\nend\nrawset(cc.TextureCache,\"dumpCachedTextureInfo\",TextureCacheDeprecated.dumpCachedTextureInfo)\n\nlocal CCTextureCacheDeprecated = { }\nfunction CCTextureCacheDeprecated.sharedTextureCache()\n    deprecatedTip(\"CCTextureCache:sharedTextureCache\",\"CCTextureCache:getInstance\")\n    return cc.TextureCache:getInstance()\nend\nrawset(CCTextureCache,\"sharedTextureCache\",CCTextureCacheDeprecated.sharedTextureCache)\n\nfunction CCTextureCacheDeprecated.purgeSharedTextureCache()\n    deprecatedTip(\"CCTextureCache:purgeSharedTextureCache\",\"CCTextureCache:destroyInstance\")\n    return cc.TextureCache:destroyInstance()\nend\nrawset(CCTextureCache,\"purgeSharedTextureCache\",CCTextureCacheDeprecated.purgeSharedTextureCache)\n\nfunction CCTextureCacheDeprecated.addUIImage(self, image, key)\n    deprecatedTip(\"CCTextureCache:addUIImage\",\"CCTextureCache:addImage\")\n    return self:addImage(image,key)\nend\nrawset(CCTextureCache,\"addUIImage\",CCTextureCacheDeprecated.addUIImage)\n--functions of CCTextureCache will be deprecated end\n\n--functions of CCAnimation will be deprecated begin\nlocal CCAnimationDeprecated = {}\nfunction CCAnimationDeprecated.addSpriteFrameWithFileName(self,...)\n    deprecatedTip(\"CCAnimationDeprecated:addSpriteFrameWithFileName\",\"cc.Animation:addSpriteFrameWithFile\")\n    return self:addSpriteFrameWithFile(...)\nend\nrawset(CCAnimation,\"addSpriteFrameWithFileName\",CCAnimationDeprecated.addSpriteFrameWithFileName)\n--functions of CCAnimation will be deprecated end\n\n\n--functions of CCAnimationCache will be deprecated begin\nlocal CCAnimationCacheDeprecated = { }\nfunction CCAnimationCacheDeprecated.sharedAnimationCache()\n    deprecatedTip(\"CCAnimationCache:sharedAnimationCache\",\"CCAnimationCache:getInstance\")\n    return CCAnimationCache:getInstance()\nend\nrawset(CCAnimationCache,\"sharedAnimationCache\",CCAnimationCacheDeprecated.sharedAnimationCache)\n\nfunction CCAnimationCacheDeprecated.purgeSharedAnimationCache()\n    deprecatedTip(\"CCAnimationCache:purgeSharedAnimationCache\",\"CCAnimationCache:destroyInstance\")\n    return CCAnimationCache:destroyInstance()\nend\nrawset(CCAnimationCache,\"purgeSharedAnimationCache\",CCAnimationCacheDeprecated.purgeSharedAnimationCache)\n\nfunction CCAnimationCacheDeprecated.addAnimationsWithFile(self,...)\n    deprecatedTip(\"CCAnimationCache:addAnimationsWithFile\",\"cc.AnimationCache:addAnimations\")\n    return self:addAnimations(...)\nend\nrawset(CCAnimationCache,\"addAnimationsWithFile\",CCAnimationCacheDeprecated.addAnimationsWithFile)\n\nfunction CCAnimationCacheDeprecated.animationByName(self,...)\n    deprecatedTip(\"CCAnimationCache:animationByName\",\"cc.AnimationCache:getAnimation\")\n    return self:getAnimation(...)\nend\nrawset(CCAnimationCache,\"animationByName\",CCAnimationCacheDeprecated.animationByName)\n\nfunction CCAnimationCacheDeprecated.removeAnimationByName(self)\n    deprecatedTip(\"CCAnimationCache:removeAnimationByName\",\"cc.AnimationCache:removeAnimation\")\n    return self:removeAnimation()\nend\nrawset(CCAnimationCache,\"removeAnimationByName\",CCAnimationCacheDeprecated.removeAnimationByName)\n--functions of CCAnimationCache will be deprecated end\n\n--functions of CCFileUtils will be deprecated end\nlocal CCFileUtilsDeprecated = { }\nfunction CCFileUtilsDeprecated.sharedFileUtils()\n    deprecatedTip(\"CCFileUtils:sharedFileUtils\",\"CCFileUtils:getInstance\")\n    return cc.FileUtils:getInstance()\nend\nrawset(CCFileUtils,\"sharedFileUtils\",CCFileUtilsDeprecated.sharedFileUtils)\n\nfunction CCFileUtilsDeprecated.purgeFileUtils()\n    deprecatedTip(\"CCFileUtils:purgeFileUtils\",\"CCFileUtils:destroyInstance\")\n    return cc.FileUtils:destroyInstance()\nend\nrawset(CCFileUtils,\"purgeFileUtils\",CCFileUtilsDeprecated.purgeFileUtils)\n--functions of CCFileUtils will be deprecated end\n\n\n--functions of SimpleAudioEngine will be deprecated begin\nlocal SimpleAudioEngineDeprecated = { }\nfunction SimpleAudioEngineDeprecated.sharedEngine()\n    deprecatedTip(\"SimpleAudioEngine:sharedEngine\",\"SimpleAudioEngine:getInstance\")\n    return cc.SimpleAudioEngine:getInstance()\nend\nrawset(SimpleAudioEngine,\"sharedEngine\",SimpleAudioEngineDeprecated.sharedEngine)\n\nfunction SimpleAudioEngineDeprecated.playBackgroundMusic(self,...)\n    deprecatedTip(\"SimpleAudioEngine:playBackgroundMusic\",\"SimpleAudioEngine:playMusic\")\n    return self:playMusic(...)\nend\nrawset(SimpleAudioEngine,\"playBackgroundMusic\",SimpleAudioEngineDeprecated.playBackgroundMusic)\n--functions of SimpleAudioEngine will be deprecated end\n\n--functions of CCMenu will be deprecated begin\nlocal CCMenuDeprecated = { }\nfunction CCMenuDeprecated.createWithItem(self,...)\n    deprecatedTip(\"CCMenuDeprecated:createWithItem\",\"cc.Menu:createWithItem\")\n    return self:create(...)\nend\nrawset(CCMenu,\"createWithItem\",CCMenuDeprecated.createWithItem)\n\nfunction CCMenuDeprecated.setHandlerPriority(self)\n    print(\"\\n********** \\n\"..\"setHandlerPriority was deprecated in 3.0. \\n**********\")\nend\nrawset(CCMenu,\"setHandlerPriority\",CCMenuDeprecated.setHandlerPriority)\n--functions of CCMenu will be deprecated end\n\n--functions of CCNode will be deprecated begin\nlocal CCNodeDeprecated = { }\n\nfunction CCNodeDeprecated.boundingBox(self)\n    deprecatedTip(\"CCNode:boundingBox\",\"cc.Node:getBoundingBox\")\n    return self:getBoundingBox()\nend\nrawset(CCNode,\"boundingBox\",CCNodeDeprecated.boundingBox)\n\n\nfunction CCNodeDeprecated.numberOfRunningActions(self)\n    deprecatedTip(\"CCNode:numberOfRunningActions\",\"cc.Node:getNumberOfRunningActions\")\n    return self:getNumberOfRunningActions()\nend\nrawset(CCNode,\"numberOfRunningActions\",CCNodeDeprecated.numberOfRunningActions)\n\n\nfunction CCNodeDeprecated.removeFromParentAndCleanup(self,...)\n    deprecatedTip(\"CCNode:removeFromParentAndCleanup\",\"cc.Node:removeFromParent\")\n    return self:removeFromParent(...)\nend\nrawset(CCNode,\"removeFromParentAndCleanup\",CCNodeDeprecated.removeFromParentAndCleanup)\n--functions of CCNode will be deprecated end\n\n--CCDrawPrimitives will be deprecated begin\nlocal function CCDrawPrimitivesClassDeprecated()\n    deprecatedTip(\"CCDrawPrimitives\",\"cc.DrawPrimitives\")\n    return cc.DrawPrimitives\nend\n_G[\"CCDrawPrimitives\"] = CCDrawPrimitivesClassDeprecated()\n--functions of CCDrawPrimitives will be deprecated begin\nlocal CCDrawPrimitivesDeprecated = { }\nfunction CCDrawPrimitivesDeprecated.ccDrawPoint(pt)\n    deprecatedTip(\"ccDrawPoint\",\"cc.DrawPrimitives.drawPoint\")\n    return cc.DrawPrimitives.drawPoint(pt)\nend\nrawset(_G, \"ccDrawPoint\", CCDrawPrimitivesDeprecated.ccDrawPoint)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawLine(origin,destination)\n    deprecatedTip(\"ccDrawLine\",\"cc.DrawPrimitives.drawLine\")\n    return cc.DrawPrimitives.drawLine(origin,destination)\nend\nrawset(_G, \"ccDrawLine\", CCDrawPrimitivesDeprecated.ccDrawLine)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawRect(origin,destination)\n    deprecatedTip(\"ccDrawRect\",\"cc.DrawPrimitives.drawRect\")\n    return cc.DrawPrimitives.drawRect(origin,destination)\nend\nrawset(_G, \"ccDrawRect\", CCDrawPrimitivesDeprecated.ccDrawRect)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawSolidRect(origin,destination,color)\n    deprecatedTip(\"ccDrawSolidRect\",\"cc.DrawPrimitives.drawSolidRect\")\n    return cc.DrawPrimitives.drawSolidRect(origin,destination,color)\nend\nrawset(_G, \"ccDrawSolidRect\", CCDrawPrimitivesDeprecated.ccDrawSolidRect)\n\n-- params:... may represent two param(xScale,yScale) or nil\nfunction CCDrawPrimitivesDeprecated.ccDrawCircle(center,radius,angle,segments,drawLineToCenter,...)\n    deprecatedTip(\"ccDrawCircle\",\"cc.DrawPrimitives.drawCircle\")\n    return cc.DrawPrimitives.drawCircle(center,radius,angle,segments,drawLineToCenter,...)\nend\nrawset(_G, \"ccDrawCircle\", CCDrawPrimitivesDeprecated.ccDrawCircle)\n\n-- params:... may represent two param(xScale,yScale) or nil\nfunction CCDrawPrimitivesDeprecated.ccDrawSolidCircle(center,radius,angle,segments,...)\n    deprecatedTip(\"ccDrawSolidCircle\",\"cc.DrawPrimitives.drawSolidCircle\")\n    return cc.DrawPrimitives.drawSolidCircle(center,radius,angle,segments,...)\nend\nrawset(_G, \"ccDrawSolidCircle\", CCDrawPrimitivesDeprecated.ccDrawSolidCircle)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawQuadBezier(origin,control,destination,segments)\n    deprecatedTip(\"ccDrawQuadBezier\",\"cc.DrawPrimitives.drawQuadBezier\")\n    return cc.DrawPrimitives.drawQuadBezier(origin,control,destination,segments)\nend\nrawset(_G, \"ccDrawQuadBezier\", CCDrawPrimitivesDeprecated.ccDrawQuadBezier)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawCubicBezier(origin,control1,control2,destination,segments)\n    deprecatedTip(\"ccDrawCubicBezier\",\"cc.DrawPrimitives.drawCubicBezier\")\n    return cc.DrawPrimitives.drawCubicBezier(origin,control1,control2,destination,segments)\nend\nrawset(_G, \"ccDrawCubicBezier\", CCDrawPrimitivesDeprecated.ccDrawCubicBezier)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawCatmullRom(arrayOfControlPoints,segments)\n    deprecatedTip(\"ccDrawCatmullRom\",\"cc.DrawPrimitives.drawCatmullRom\")\n    return cc.DrawPrimitives.drawCatmullRom(arrayOfControlPoints,segments)\nend\nrawset(_G, \"ccDrawCatmullRom\", CCDrawPrimitivesDeprecated.ccDrawCatmullRom)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawCardinalSpline(config,tension,segments)\n    deprecatedTip(\"ccDrawCardinalSpline\",\"cc.DrawPrimitives.drawCardinalSpline\")\n    return cc.DrawPrimitives.drawCardinalSpline(config,tension,segments)\nend\nrawset(_G, \"ccDrawCardinalSpline\", CCDrawPrimitivesDeprecated.ccDrawCardinalSpline)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawColor4B(r,g,b,a)\n    deprecatedTip(\"ccDrawColor4B\",\"cc.DrawPrimitives.drawColor4B\")\n    return cc.DrawPrimitives.drawColor4B(r,g,b,a)\nend\nrawset(_G, \"ccDrawColor4B\", CCDrawPrimitivesDeprecated.ccDrawColor4B)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawColor4F(r,g,b,a)\n    deprecatedTip(\"ccDrawColor4F\",\"cc.DrawPrimitives.drawColor4F\")\n    return cc.DrawPrimitives.drawColor4F(r,g,b,a)\nend\nrawset(_G, \"ccDrawColor4F\", CCDrawPrimitivesDeprecated.ccDrawColor4F)\n\nfunction CCDrawPrimitivesDeprecated.ccPointSize(pointSize)\n    deprecatedTip(\"ccPointSize\",\"cc.DrawPrimitives.setPointSize\")\n    return cc.DrawPrimitives.setPointSize(pointSize)\nend\nrawset(_G, \"ccPointSize\", CCDrawPrimitivesDeprecated.ccPointSize)\n--functions of CCDrawPrimitives will be deprecated end\n--CCDrawPrimitives will be deprecated end\n\nlocal CCProgressTimerDeprecated = {}\nfunction CCProgressTimerDeprecated.setReverseProgress(self,...)\n    deprecatedTip(\"CCProgressTimer\",\"CCProgressTimer:setReverseDirection\")\n    return self:setReverseDirection(...)\nend\nrawset(CCProgressTimer,\"setReverseProgress\",CCProgressTimerDeprecated.setReverseProgress)\n\n--functions of CCSpriteFrameCache will be deprecated begin\nlocal CCSpriteFrameCacheDeprecated = { }\nfunction CCSpriteFrameCacheDeprecated.spriteFrameByName(self,szName)\n    deprecatedTip(\"CCSpriteFrameCache:spriteFrameByName\",\"CCSpriteFrameCache:getSpriteFrameByName\")\n    return self:getSpriteFrameByName(szName)\nend\nrawset(CCSpriteFrameCache,\"spriteFrameByName\",CCSpriteFrameCacheDeprecated.spriteFrameByName)\n\nfunction CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache()\n    deprecatedTip(\"CCSpriteFrameCache:sharedSpriteFrameCache\",\"CCSpriteFrameCache:getInstance\")\n    return CCSpriteFrameCache:getInstance()\nend\nrawset(CCSpriteFrameCache,\"sharedSpriteFrameCache\",CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache)\n\nfunction CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache()\n    deprecatedTip(\"CCSpriteFrameCache:purgeSharedSpriteFrameCache\",\"CCSpriteFrameCache:destroyInstance\")\n    return CCSpriteFrameCache:destroyInstance()\nend\nrawset(CCSpriteFrameCache,\"purgeSharedSpriteFrameCache\",CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache)\n\nfunction CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile(self,...)\n    deprecatedTip(\"CCSpriteFrameCache:addSpriteFramesWithFile\",\"CCSpriteFrameCache:addSpriteFrames\")\n    return self:addSpriteFrames(...)\nend\nrawset(CCSpriteFrameCache,\"addSpriteFramesWithFile\",CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile)\n\nfunction CCSpriteFrameCacheDeprecated.getSpriteFrameByName(self,...)\n    deprecatedTip(\"CCSpriteFrameCache:getSpriteFrameByName\",\"CCSpriteFrameCache:getSpriteFrame\")\n    return self:getSpriteFrame(...)\nend\nrawset(CCSpriteFrameCache,\"getSpriteFrameByName\",CCSpriteFrameCacheDeprecated.getSpriteFrameByName)\n--functions of CCSpriteFrameCache will be deprecated end\n\n--functions of CCLabelAtlas will be deprecated begin\nlocal CCLabelAtlasDeprecated = {}\nfunction CCLabelAtlasDeprecated.create(self,...)\n    deprecatedTip(\"CCLabelAtlas:create\",\"CCLabelAtlas:_create\")\n    return self:_create(...)\nend\nrawset(CCLabelAtlas,\"create\",CCLabelAtlasDeprecated.create)\n--functions of CCLabelAtlas will be deprecated end\n\n\n---------------------------\n--global functions wil be deprecated, begin\nlocal function CCRectMake(x,y,width,height)\n    deprecatedTip(\"CCRectMake(x,y,width,height)\",\"cc.rect(x,y,width,height) in lua\")\n    return cc.rect(x,y,width,height)\nend\nrawset(_G,\"CCRectMake\",CCRectMake)\n\nlocal function ccc3(r,g,b)\n    deprecatedTip(\"ccc3(r,g,b)\",\"cc.c3b(r,g,b)\")\n    return cc.c3b(r,g,b)\nend\nrawset(_G,\"ccc3\",ccc3)\n\nlocal function ccp(x,y)\n    deprecatedTip(\"ccp(x,y)\",\"cc.p(x,y)\")\n    return cc.p(x,y)\nend \nrawset(_G,\"ccp\",ccp)\n\nlocal function CCSizeMake(width,height)\n    deprecatedTip(\"CCSizeMake(width,height)\",\"cc.size(width,height)\")\n    return cc.size(width,height)\nend\nrawset(_G,\"CCSizeMake\",CCSizeMake)\n\nlocal function ccc4(r,g,b,a)\n    deprecatedTip(\"ccc4(r,g,b,a)\",\"cc.c4b(r,g,b,a)\")\n    return cc.c4b(r,g,b,a)\nend\nrawset(_G,\"ccc4\",ccc4)\n\nlocal function ccc4FFromccc3B(color3B)\n    deprecatedTip(\"ccc4FFromccc3B(color3B)\",\"cc.c4f(color3B.r / 255.0,color3B.g / 255.0,color3B.b / 255.0,1.0)\")\n    return cc.c4f(color3B.r/255.0, color3B.g/255.0, color3B.b/255.0, 1.0)\nend\nrawset(_G,\"ccc4FFromccc3B\",ccc4FFromccc3B)\n\nlocal function ccc4f(r,g,b,a)\n    deprecatedTip(\"ccc4f(r,g,b,a)\",\"cc.c4f(r,g,b,a)\")\n    return cc.c4f(r,g,b,a)\nend\nrawset(_G,\"ccc4f\",ccc4f)\n\nlocal function ccc4FFromccc4B(color4B)\n    deprecatedTip(\"ccc4FFromccc4B(color4B)\",\"cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)\")\n    return cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)   \nend\nrawset(_G,\"ccc4FFromccc4B\",ccc4FFromccc4B)\n\nlocal function ccc4FEqual(a,b)\n    deprecatedTip(\"ccc4FEqual(a,b)\",\"a:equals(b)\")\n    return a:equals(b)\nend\nrawset(_G,\"ccc4FEqual\",ccc4FEqual)\n--global functions wil be deprecated, end\n\n\n--functions of _G will be deprecated begin\nlocal function ccpLineIntersect(a,b,c,d,s,t)\n    deprecatedTip(\"ccpLineIntersect\",\"cc.pIsLineIntersect\")\n    return cc.pIsLineIntersect(a,b,c,d,s,t)\nend\nrawset(_G,\"ccpLineIntersect\",ccpLineIntersect)\n\n\nlocal function CCPointMake(x,y)\n    deprecatedTip(\"CCPointMake(x,y)\",\"cc.p(x,y)\")\n    return cc.p(x,y)\nend \nrawset(_G,\"CCPointMake\",CCPointMake)\n\n\n\nlocal function ccpNeg(pt)\n    deprecatedTip(\"ccpNeg\",\"cc.pSub\")\n    return cc.pSub({x = 0,y = 0}, pt)\nend\nrawset(_G,\"ccpNeg\",ccpNeg)\n\nlocal function ccpAdd(pt1,pt2)\n    deprecatedTip(\"ccpAdd\",\"cc.pAdd\")\n    return cc.pAdd(pt1,pt2)\nend\nrawset(_G,\"ccpAdd\",ccpAdd)\n\nlocal function ccpSub(pt1,pt2)\n    deprecatedTip(\"ccpSub\",\"cc.pSub\")\n    return cc.pSub(pt1,pt2)\nend\nrawset(_G,\"ccpSub\",ccpSub)\n\nlocal function ccpMult(pt,factor)\n    deprecatedTip(\"ccpMult\",\"cc.pMul\")\n    return cc.pMul(pt,factor)\nend\nrawset(_G,\"ccpMult\",ccpMult)\n\nlocal function ccpMidpoint(pt1,pt2)\n    deprecatedTip(\"ccpMidpoint\",\"cc.pMidpoint\")\n    return cc.pMidpoint(pt1,pt2)\nend\nrawset(_G,\"ccpMidpoint\",ccpMidpoint)\n\nlocal function ccpDot(pt1,pt2)\n    deprecatedTip(\"ccpDot\",\"cc.pDot\")\n    return cc.pDot(pt1,pt2)\nend\nrawset(_G,\"ccpDot\",ccpDot)\n\nlocal function ccpCross(pt1,pt2)\n    deprecatedTip(\"ccpCross\",\"cc.pCross\")\n    return cc.pCross(pt1, pt2)\nend\nrawset(_G,\"ccpCross\",ccpCross)\n\nlocal function ccpPerp(pt)\n    deprecatedTip(\"ccpPerp\",\"cc.pPerp\")\n    return cc.pPerp(pt)\nend\nrawset(_G,\"ccpPerp\",ccpPerp)\n\nlocal function ccpRPerp(pt)\n    deprecatedTip(\"ccpRPerp\",\"cc.RPerp\")\n    return cc.RPerp(pt)\nend\nrawset(_G,\"ccpRPerp\",ccpRPerp)\n\nlocal function ccpProject(pt1,pt2)\n    deprecatedTip(\"ccpProject\",\"cc.pProject\")\n    return cc.pProject(pt1,pt2)\nend\nrawset(_G,\"ccpProject\",ccpProject)\n\nlocal function ccpRotate(pt1,pt2)\n    deprecatedTip(\"ccpRotate\",\"cc.pRotate\")\n    return cc.pRotate(pt1,pt2)\nend\nrawset(_G,\"ccpRotate\",ccpRotate)\n\nlocal function ccpUnrotate(pt1,pt2)\n    deprecatedTip(\"ccpUnrotate\",\"cc.pUnrotate\")\n    return cc.pUnrotate(pt1,pt2)\nend\nrawset(_G,\"ccpUnrotate\",ccpUnrotate)\n\nlocal function ccpLengthSQ(pt)\n    deprecatedTip(\"ccpLengthSQ\",\"cc.pLengthSQ\")\n    return cc.pLengthSQ(pt)\nend\nrawset(_G,\"ccpLengthSQ\",ccpLengthSQ)\n\nlocal function ccpDistanceSQ(pt1,pt2)\n    deprecatedTip(\"ccpDistanceSQ\",\"cc.pDistanceSQ\")\n    return cc.pDistanceSQ(pt1,pt2)\nend\nrawset(_G,\"ccpDistanceSQ\",ccpDistanceSQ)\n\nlocal function ccpLength(pt)\n    deprecatedTip(\"ccpLength\",\"cc.pGetLength\")\n    return cc.pGetLength(pt)\nend\nrawset(_G,\"ccpLength\",ccpLength)\n\nlocal function ccpDistance(pt1,pt2)\n    deprecatedTip(\"ccpDistance\",\"cc.pGetDistance\")\n    return cc.pGetDistance(pt1, pt2)\nend\nrawset(_G,\"ccpDistance\",ccpDistance)\n\nlocal function ccpNormalize(pt)\n    deprecatedTip(\"ccpNormalize\",\"cc.pNormalize\")\n    return cc.pNormalize(pt)\nend\nrawset(_G,\"ccpNormalize\",ccpNormalize)\n\nlocal function ccpForAngle(angle)\n    deprecatedTip(\"ccpForAngle\",\"cc.pForAngle\")\n    return cc.pForAngle(angle)\nend\nrawset(_G,\"ccpForAngle\",ccpForAngle)\n\nlocal function ccpToAngle(pt)\n    deprecatedTip(\"ccpToAngle\",\"cc.pToAngleSelf\")\n    return cc.pToAngleSelf(pt)\nend\nrawset(_G,\"ccpToAngle\",ccpToAngle)\n\nlocal function ccpClamp(pt1,pt2,pt3)\n    deprecatedTip(\"ccpClamp\",\"cc.pGetClampPoint\")\n    return cc.pGetClampPoint(pt1,pt2,pt3)\nend\nrawset(_G,\"ccpClamp\",ccpClamp)\n\n\nlocal function ccpFromSize(sz)\n    deprecatedTip(\"ccpFromSize(sz)\",\"cc.pFromSize\")\n    return cc.pFromSize(sz)\nend\nrawset(_G,\"ccpFromSize\",ccpFromSize)\n\nlocal function ccpLerp(pt1,pt2,alpha)\n    deprecatedTip(\"ccpLerp\",\"cc.pLerp\")\n    return cc.pLerp(pt1,pt2,alpha) \nend\nrawset(_G,\"ccpLerp\",ccpLerp)\n\nlocal function ccpFuzzyEqual(pt1,pt2,variance)\n    deprecatedTip(\"ccpFuzzyEqual\",\"cc.pFuzzyEqual\")\n    return cc.pFuzzyEqual(pt1,pt2,variance)\nend\nrawset(_G,\"ccpFuzzyEqual\",ccpFuzzyEqual)\n\nlocal function ccpCompMult(pt1,pt2)\n    deprecatedTip(\"ccpCompMult\",\"cc.p\")\n    return cc.p(pt1.x * pt2.x , pt1.y * pt2.y)\nend\nrawset(_G,\"ccpCompMult\",ccpCompMult)\n\nlocal function ccpAngleSigned(pt1,pt2)\n    deprecatedTip(\"ccpAngleSigned\",\"cc.pGetAngle\")\n    return cc.pGetAngle(pt1, pt2)\nend\nrawset(_G,\"ccpAngleSigned\",ccpAngleSigned)\n\nlocal function ccpAngle(pt1,pt2)\n    deprecatedTip(\"ccpAngle\",\"cc.pGetAngle\")\n    return cc.pGetAngle(pt1,ptw)\nend\nrawset(_G,\"ccpAngle\",ccpAngle)\n\nlocal function ccpRotateByAngle(pt1,pt2,angle)\n    deprecatedTip(\"ccpRotateByAngle\",\"cc.pRotateByAngle\")\n    return cc.pRotateByAngle(pt1, pt2, angle)\nend\nrawset(_G,\"ccpRotateByAngle\",ccpRotateByAngle)\n\nlocal function ccpSegmentIntersect(pt1,pt2,pt3,pt4)\n    deprecatedTip(\"ccpSegmentIntersect\",\"cc.pIsSegmentIntersect\")\n    return cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4)\nend\nrawset(_G,\"ccpSegmentIntersect\",ccpSegmentIntersect)\n\nlocal function ccpIntersectPoint(pt1,pt2,pt3,pt4)\n    deprecatedTip(\"ccpIntersectPoint\",\"cc.pGetIntersectPoint\")\n    return cc.pGetIntersectPoint(pt1,pt2,pt3,pt4)\nend\nrawset(_G,\"ccpIntersectPoint\",ccpIntersectPoint)\n\n\nlocal function vertex2(x,y)\n    deprecatedTip(\"vertex2(x,y)\",\"cc.vertex2F(x,y)\")\n    return cc.vertex2F(x,y)\nend\nrawset(_G,\"vertex2\",vertex2)\n\nlocal function vertex3(x,y,z)\n    deprecatedTip(\"vertex3(x,y,z)\",\"cc.Vertex3F(x,y,z)\")\n    return cc.Vertex3F(x,y,z)\nend\nrawset(_G,\"vertex3\",vertex3)\n\nlocal function tex2(u,v)\n    deprecatedTip(\"tex2(u,v)\",\"cc.tex2f(u,v)\")\n    return cc.tex2f(u,v)\nend\nrawset(_G,\"tex2\",tex2) \n\nlocal function ccc4BFromccc4F(color4F)\n    deprecatedTip(\"ccc4BFromccc4F(color4F)\",\"Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)\")\n    return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0) \nend\nrawset(_G,\"ccc4BFromccc4F\",ccc4BFromccc4F)\n\nlocal function ccColor3BDeprecated()\n    deprecatedTip(\"ccColor3B\",\"cc.c3b(0,0,0)\")\n    return cc.c3b(0,0,0)\nend\n_G[\"ccColor3B\"] = ccColor3BDeprecated\n\nlocal function ccColor4BDeprecated()\n    deprecatedTip(\"ccColor4B\",\"cc.c4b(0,0,0,0)\")\n    return cc.c4b(0,0,0,0)\nend\n_G[\"ccColor4B\"] = ccColor4BDeprecated\n\nlocal function ccColor4FDeprecated()\n    deprecatedTip(\"ccColor4F\",\"cc.c4f(0.0,0.0,0.0,0.0)\")\n    return cc.c4f(0.0,0.0,0.0,0.0)\nend\n_G[\"ccColor4F\"] = ccColor4FDeprecated\n\nlocal function ccVertex2FDeprecated()\n    deprecatedTip(\"ccVertex2F\",\"cc.vertex2F(0.0,0.0)\")\n    return cc.vertex2F(0.0,0.0)\nend\n_G[\"ccVertex2F\"] = ccVertex2FDeprecated\n\nlocal function ccVertex3FDeprecated()\n    deprecatedTip(\"ccVertex3F\",\"cc.Vertex3F(0.0, 0.0, 0.0)\")\n    return cc.Vertex3F(0.0, 0.0, 0.0)\nend\n_G[\"ccVertex3F\"] = ccVertex3FDeprecated\n\nlocal function ccTex2FDeprecated()\n    deprecatedTip(\"ccTex2F\",\"cc.tex2F(0.0, 0.0)\")\n    return cc.tex2F(0.0, 0.0)\nend\n_G[\"ccTex2F\"] = ccTex2FDeprecated\n\nlocal function ccPointSpriteDeprecated()\n    deprecatedTip(\"ccPointSprite\",\"cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)\")\n    return cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)\nend\n_G[\"ccPointSprite\"] = ccPointSpriteDeprecated\n\nlocal function ccQuad2Deprecated()\n    deprecatedTip(\"ccQuad2\",\"cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0))\")\n    return cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0))\nend\n_G[\"ccQuad2\"] = ccQuad2Deprecated\n\nlocal function ccQuad3Deprecated()\n    deprecatedTip(\"ccQuad3\",\"cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0))\")\n    return cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0))\nend\n_G[\"ccQuad3\"] = ccQuad3Deprecated\n\nlocal function ccV2FC4BT2FDeprecated()\n    deprecatedTip(\"ccV2F_C4B_T2F\",\"cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))\")\n    return cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))\nend\n_G[\"ccV2F_C4B_T2F\"] = ccV2FC4BT2FDeprecated\n\n\nlocal function ccV2FC4FT2FDeprecated()\n    deprecatedTip(\"ccV2F_C4F_T2F\",\"cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0 ), cc.tex2F(0.0, 0.0))\")\n    return cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0), cc.tex2F(0.0, 0.0))\nend\n_G[\"ccV2F_C4F_T2F\"] = ccV2FC4FT2FDeprecated\n\nlocal function ccV3FC4BT2FDeprecated()\n    deprecatedTip(\"ccV3F_C4B_T2F\",\"cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0))\")\n    return cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0))\nend\n_G[\"ccV3F_C4B_T2F\"] = ccV3FC4BT2FDeprecated\n\nlocal function ccV2FC4BT2FQuadDeprecated()\n    deprecatedTip(\"ccV2F_C4B_T2F_Quad\",\"cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))\")\n    return cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))\nend\n_G[\"ccV2F_C4B_T2F_Quad\"] = ccV2FC4BT2FQuadDeprecated\n\nlocal function ccV3FC4BT2FQuadDeprecated()\n    deprecatedTip(\"ccV3F_C4B_T2F_Quad\",\"cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br)\")\n    return cc.V3F_C4B_T2F_Quad(cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))\nend\n_G[\"ccV3F_C4B_T2F_Quad\"] = ccV3FC4BT2FQuadDeprecated\n\nlocal function ccV2FC4FT2FQuadDeprecated()\n    deprecatedTip(\"ccV2F_C4F_T2F_Quad\",\"cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr)\")\n    return cc.V2F_C4F_T2F_Quad(cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)))\nend\n_G[\"ccV2F_C4F_T2F_Quad\"] = ccV2FC4FT2FQuadDeprecated\n\nlocal function ccT2FQuadDeprecated()\n    deprecatedTip(\"ccT2F_Quad\",\"cc.T2F_Quad(_bl, _br, _tl, _tr)\")\n    return cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0))\nend\n_G[\"ccT2F_Quad\"] = ccT2FQuadDeprecated\n\nlocal function ccAnimationFrameDataDeprecated()\n    deprecatedTip(\"ccAnimationFrameData\",\"cc.AnimationFrameData( _texCoords, _delay, _size)\")\n    return cc.AnimationFrameData(cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0)), 0, cc.size(0,0))\nend\n_G[\"ccAnimationFrameData\"] = ccAnimationFrameDataDeprecated\n\n\n\nlocal function tex2(u,v)\n    deprecatedTip(\"tex2(u,v)\",\"cc.tex2f(u,v)\")\n    return cc.tex2f(u,v)\nend\nrawset(_G,\"tex2\",tex2) \n\n--functions of CCControl will be deprecated end\nlocal CCControlDeprecated = { }\nfunction CCControlDeprecated.addHandleOfControlEvent(self,func,controlEvent)\n    deprecatedTip(\"addHandleOfControlEvent\",\"registerControlEventHandler\")\n    print(\"come in addHandleOfControlEvent\")\n    self:registerControlEventHandler(func,controlEvent)\nend\nrawset(CCControl,\"addHandleOfControlEvent\",CCControlDeprecated.addHandleOfControlEvent)\n--functions of CCControl will be deprecated end\n\n\n--functions of CCEGLView will be deprecated end\nlocal CCEGLViewDeprecated = { }\nfunction CCEGLViewDeprecated.sharedOpenGLView()\n    deprecatedTip(\"CCEGLView:sharedOpenGLView\",\"CCEGLView:getInstance\")\n    return CCEGLView:getInstance()\nend\nrawset(CCEGLView,\"sharedOpenGLView\",CCEGLViewDeprecated.sharedOpenGLView)\n--functions of CCFileUtils will be deprecated end\n\n--Enums of CCTableView will be deprecated begin\nrawset(CCTableView, \"kTableViewScroll\",cc.SCROLLVIEW_SCRIPT_SCROLL)\nrawset(CCTableView,\"kTableViewZoom\",cc.SCROLLVIEW_SCRIPT_ZOOM)\nrawset(CCTableView,\"kTableCellTouched\",cc.TABLECELL_TOUCHED)\nrawset(CCTableView,\"kTableCellSizeForIndex\",cc.TABLECELL_SIZE_FOR_INDEX)\nrawset(CCTableView,\"kTableCellSizeAtIndex\",cc.TABLECELL_SIZE_AT_INDEX)\nrawset(CCTableView,\"kNumberOfCellsInTableView\",cc.NUMBER_OF_CELLS_IN_TABLEVIEW)\n--Enums of CCTableView will be deprecated end\n\n--Enums of CCScrollView will be deprecated begin\nrawset(CCScrollView, \"kScrollViewScroll\",cc.SCROLLVIEW_SCRIPT_SCROLL)\nrawset(CCScrollView,\"kScrollViewZoom\",cc.SCROLLVIEW_SCRIPT_ZOOM)\n--Enums of CCScrollView will be deprecated end\n\n\n\n--functions of CCApplication will be deprecated end\nlocal CCApplicationDeprecated = { }\nfunction CCApplicationDeprecated.sharedApplication()\n    deprecatedTip(\"CCApplication:sharedApplication\",\"CCApplication:getInstance\")\n    return CCApplication:getInstance()\nend\nrawset(CCApplication,\"sharedApplication\",CCApplicationDeprecated.sharedApplication)\n--functions of CCApplication will be deprecated end\n\n\n--functions of CCDirector will be deprecated end\nlocal CCDirectorDeprecated = { }\nfunction CCDirectorDeprecated.sharedDirector()\n    deprecatedTip(\"CCDirector:sharedDirector\",\"CCDirector:getInstance\")\n    return CCDirector:getInstance()\nend\nrawset(CCDirector,\"sharedDirector\",CCDirectorDeprecated.sharedDirector)\n--functions of CCDirector will be deprecated end\n\n\n--functions of CCUserDefault will be deprecated end\nlocal CCUserDefaultDeprecated = { }\nfunction CCUserDefaultDeprecated.sharedUserDefault()\n    deprecatedTip(\"CCUserDefault:sharedUserDefault\",\"CCUserDefault:getInstance\")\n    return CCUserDefault:getInstance()\nend\nrawset(CCUserDefault,\"sharedUserDefault\",CCUserDefaultDeprecated.sharedUserDefault)\n\nfunction CCUserDefaultDeprecated.purgeSharedUserDefault()\n    deprecatedTip(\"CCUserDefault:purgeSharedUserDefault\",\"CCUserDefault:destroyInstance\")\n    return CCUserDefault:destroyInstance()\nend\nrawset(CCUserDefault,\"purgeSharedUserDefault\",CCUserDefaultDeprecated.purgeSharedUserDefault)\n--functions of CCUserDefault will be deprecated end\n\n--functions of CCGrid3DAction will be deprecated begin\nlocal CCGrid3DActionDeprecated = { }\nfunction CCGrid3DActionDeprecated.vertex(self,pt)\n    deprecatedTip(\"vertex\",\"CCGrid3DAction:getVertex\")\n    return self:getVertex(pt)\nend\nrawset(CCGrid3DAction,\"vertex\",CCGrid3DActionDeprecated.vertex)\n\nfunction CCGrid3DActionDeprecated.originalVertex(self,pt)\n    deprecatedTip(\"originalVertex\",\"CCGrid3DAction:getOriginalVertex\")\n    return self:getOriginalVertex(pt)\nend\nrawset(CCGrid3DAction,\"originalVertex\",CCGrid3DActionDeprecated.originalVertex)\n--functions of CCGrid3DAction will be deprecated end\n\n\n--functions of CCTiledGrid3DAction will be deprecated begin\nlocal CCTiledGrid3DActionDeprecated = { }\nfunction CCTiledGrid3DActionDeprecated.tile(self,pt)\n    deprecatedTip(\"tile\",\"CCTiledGrid3DAction:getTile\")\n    return self:getTile(pt)\nend\nrawset(CCTiledGrid3DAction,\"tile\",CCTiledGrid3DActionDeprecated.tile)\n\nfunction CCTiledGrid3DActionDeprecated.originalTile(self,pt)\n    deprecatedTip(\"originalTile\",\"CCTiledGrid3DAction:getOriginalTile\")\n    return self:getOriginalTile(pt)\nend\nrawset(CCTiledGrid3DAction,\"originalTile\",CCTiledGrid3DActionDeprecated.originalTile)\n--functions of CCTiledGrid3DAction will be deprecated end\n\n\n--functions of CCTexture2D will be deprecated begin\nlocal CCTexture2DDeprecated = { }\nfunction CCTexture2DDeprecated.stringForFormat(self)\n    deprecatedTip(\"Texture2D:stringForFormat\",\"Texture2D:getStringForFormat\")\n    return self:getStringForFormat()\nend\nrawset(CCTexture2D,\"stringForFormat\",CCTexture2DDeprecated.stringForFormat)\n\nfunction CCTexture2DDeprecated.bitsPerPixelForFormat(self)\n    deprecatedTip(\"Texture2D:bitsPerPixelForFormat\",\"Texture2D:getBitsPerPixelForFormat\")\n    return self:getBitsPerPixelForFormat()\nend\nrawset(CCTexture2D,\"bitsPerPixelForFormat\",CCTexture2DDeprecated.bitsPerPixelForFormat)\n\nfunction CCTexture2DDeprecated.bitsPerPixelForFormat(self,pixelFormat)\n    deprecatedTip(\"Texture2D:bitsPerPixelForFormat\",\"Texture2D:getBitsPerPixelForFormat\")\n    return self:getBitsPerPixelForFormat(pixelFormat)\nend\nrawset(CCTexture2D,\"bitsPerPixelForFormat\",CCTexture2DDeprecated.bitsPerPixelForFormat)\n\nfunction CCTexture2DDeprecated.defaultAlphaPixelFormat(self)\n    deprecatedTip(\"Texture2D:defaultAlphaPixelFormat\",\"Texture2D:getDefaultAlphaPixelFormat\")\n    return self:getDefaultAlphaPixelFormat()\nend\nrawset(CCTexture2D,\"defaultAlphaPixelFormat\",CCTexture2DDeprecated.defaultAlphaPixelFormat)\n--functions of CCTexture2D will be deprecated end\n\n\n--functions of CCTimer will be deprecated begin\nlocal CCTimerDeprecated = { }\nfunction CCTimerDeprecated.timerWithScriptHandler(handler,seconds)\n    deprecatedTip(\"CCTimer:timerWithScriptHandler\",\"CCTimer:createWithScriptHandler\")\n    return CCTimer:createWithScriptHandler(handler,seconds)\nend\nrawset(CCTimer,\"timerWithScriptHandler\",CCTimerDeprecated.timerWithScriptHandler)\n\nfunction CCTimerDeprecated.numberOfRunningActionsInTarget(self,target)\n    deprecatedTip(\"CCActionManager:numberOfRunningActionsInTarget\",\"CCActionManager:getNumberOfRunningActionsInTarget\")\n    return self:getNumberOfRunningActionsInTarget(target)\nend\nrawset(CCTimer,\"numberOfRunningActionsInTarget\",CCTimerDeprecated.numberOfRunningActionsInTarget)\n--functions of CCTimer will be deprecated end\n\n\n--functions of CCMenuItemFont will be deprecated begin\nlocal CCMenuItemFontDeprecated = { }\nfunction CCMenuItemFontDeprecated.fontSize()\n    deprecatedTip(\"CCMenuItemFont:fontSize\",\"CCMenuItemFont:getFontSize\")\n    return CCMenuItemFont:getFontSize()\nend\nrawset(CCMenuItemFont,\"fontSize\",CCMenuItemFontDeprecated.fontSize)\n\nfunction CCMenuItemFontDeprecated.fontName()\n    deprecatedTip(\"CCMenuItemFont:fontName\",\"CCMenuItemFont:getFontName\")\n    return CCMenuItemFont:getFontName()\nend\nrawset(CCMenuItemFont,\"fontName\",CCMenuItemFontDeprecated.fontName)\n\nfunction CCMenuItemFontDeprecated.fontSizeObj(self)\n    deprecatedTip(\"CCMenuItemFont:fontSizeObj\",\"CCMenuItemFont:getFontSizeObj\")\n    return self:getFontSizeObj()\nend\nrawset(CCMenuItemFont,\"fontSizeObj\",CCMenuItemFontDeprecated.fontSizeObj)\n\nfunction CCMenuItemFontDeprecated.fontNameObj(self)\n    deprecatedTip(\"CCMenuItemFont:fontNameObj\",\"CCMenuItemFont:getFontNameObj\")\n    return self:getFontNameObj()\nend\nrawset(CCMenuItemFont,\"fontNameObj\",CCMenuItemFontDeprecated.fontNameObj)\n--functions of CCMenuItemFont will be deprecated end\n\n\n--functions of CCMenuItemToggle will be deprecated begin\nlocal CCMenuItemToggleDeprecated = { }\nfunction CCMenuItemToggleDeprecated.selectedItem(self)\n    deprecatedTip(\"CCMenuItemToggle:selectedItem\",\"CCMenuItemToggle:getSelectedItem\")\n    return self:getSelectedItem()\nend\nrawset(CCMenuItemToggle,\"selectedItem\",CCMenuItemToggleDeprecated.selectedItem)\n--functions of CCMenuItemToggle will be deprecated end\n\n\n--functions of CCTileMapAtlas will be deprecated begin\nlocal CCTileMapAtlasDeprecated = { }\nfunction CCTileMapAtlasDeprecated.tileAt(self,pos)\n    deprecatedTip(\"CCTileMapAtlas:tileAt\",\"CCTileMapAtlas:getTileAt\")\n    return self:getTileAt(pos)\nend\nrawset(CCTileMapAtlas,\"tileAt\",CCTileMapAtlasDeprecated.tileAt)\n--functions of CCTileMapAtlas will be deprecated end\n\n\n--functions of CCTMXLayer will be deprecated begin\nlocal CCTMXLayerDeprecated = { }\nfunction CCTMXLayerDeprecated.tileAt(self,tileCoordinate)\n    deprecatedTip(\"CCTMXLayer:tileAt\",\"CCTMXLayer:getTileAt\")\n    return self:getTileAt(tileCoordinate)\nend\nrawset(CCTMXLayer,\"tileAt\",CCTMXLayerDeprecated.tileAt)\n\nfunction CCTMXLayerDeprecated.tileGIDAt(self,tileCoordinate)\n    deprecatedTip(\"CCTMXLayer:tileGIDAt\",\"CCTMXLayer:getTileGIDAt\")\n    return self:getTileGIDAt(tileCoordinate)\nend\nrawset(CCTMXLayer,\"tileGIDAt\",CCTMXLayerDeprecated.tileGIDAt)\n\nfunction CCTMXLayerDeprecated.positionAt(self,tileCoordinate)\n    deprecatedTip(\"CCTMXLayer:positionAt\",\"CCTMXLayer:getPositionAt\")\n    return self:getPositionAt(tileCoordinate)\nend\nrawset(CCTMXLayer,\"positionAt\",CCTMXLayerDeprecated.positionAt)\n\nfunction CCTMXLayerDeprecated.propertyNamed(self,propertyName)\n    deprecatedTip(\"CCTMXLayer:propertyNamed\",\"CCTMXLayer:getProperty\")\n    return self:getProperty(propertyName)\nend\nrawset(CCTMXLayer,\"propertyNamed\",CCTMXLayerDeprecated.propertyNamed)\n--functions of CCTMXLayer will be deprecated end\n\n--functions of CCTMXTiledMap will be deprecated begin\nlocal CCTMXTiledMapDeprecated = { }\nfunction CCTMXTiledMapDeprecated.layerNamed(self,layerName)\n    deprecatedTip(\"CCTMXTiledMap:layerNamed\",\"CCTMXTiledMap:getLayer\")\n    return self:getLayer(layerName)\nend\nrawset(CCTMXTiledMap,\"layerNamed\", CCTMXTiledMapDeprecated.layerNamed)\n\nfunction CCTMXTiledMapDeprecated.propertyNamed(self,propertyName)\n    deprecatedTip(\"CCTMXTiledMap:propertyNamed\",\"CCTMXTiledMap:getProperty\")\n    return self:getProperty(propertyName)\nend\nrawset(CCTMXTiledMap,\"propertyNamed\", CCTMXTiledMapDeprecated.propertyNamed )\n\nfunction CCTMXTiledMapDeprecated.propertiesForGID(self,GID)\n    deprecatedTip(\"CCTMXTiledMap:propertiesForGID\",\"CCTMXTiledMap:getPropertiesForGID\")\n    return self:getPropertiesForGID(GID)\nend\nrawset(CCTMXTiledMap,\"propertiesForGID\", CCTMXTiledMapDeprecated.propertiesForGID)\n\nfunction CCTMXTiledMapDeprecated.objectGroupNamed(self,groupName)\n    deprecatedTip(\"CCTMXTiledMap:objectGroupNamed\",\"CCTMXTiledMap:getObjectGroup\")\n    return self:getObjectGroup(groupName)\nend\nrawset(CCTMXTiledMap,\"objectGroupNamed\", CCTMXTiledMapDeprecated.objectGroupNamed)\n--functions of CCTMXTiledMap will be deprecated end\n\n\n--functions of CCTMXMapInfo will be deprecated begin\nlocal CCTMXMapInfoDeprecated = { }\nfunction CCTMXMapInfoDeprecated.getStoringCharacters(self)\n    deprecatedTip(\"CCTMXMapInfo:getStoringCharacters\",\"CCTMXMapInfo:isStoringCharacters\")\n    return self:isStoringCharacters()\nend\nrawset(CCTMXMapInfo,\"getStoringCharacters\", CCTMXMapInfoDeprecated.getStoringCharacters)\n\nfunction CCTMXMapInfoDeprecated.formatWithTMXFile(infoTable,tmxFile)\n    deprecatedTip(\"CCTMXMapInfo:formatWithTMXFile\",\"CCTMXMapInfo:create\")\n    return CCTMXMapInfo:create(tmxFile)\nend\nrawset(CCTMXMapInfo,\"formatWithTMXFile\", CCTMXMapInfoDeprecated.formatWithTMXFile)\n\nfunction CCTMXMapInfoDeprecated.formatWithXML(infoTable,tmxString,resourcePath)\n    deprecatedTip(\"CCTMXMapInfo:formatWithXML\",\"TMXMapInfo:createWithXML\")\n    return CCTMXMapInfo:createWithXML(tmxString,resourcePath)\nend\nrawset(CCTMXMapInfo,\"formatWithXML\", CCTMXMapInfoDeprecated.formatWithXML)\n--functions of CCTMXMapInfo will be deprecated end\n\n\n--functions of CCTMXObject will be deprecated begin\nlocal CCTMXObjectGroupDeprecated = { }\nfunction CCTMXObjectGroupDeprecated.propertyNamed(self,propertyName)\n    deprecatedTip(\"CCTMXObjectGroup:propertyNamed\",\"CCTMXObjectGroup:getProperty\")\n    return self:getProperty(propertyName)\nend\nrawset(CCTMXObjectGroup,\"propertyNamed\", CCTMXObjectGroupDeprecated.propertyNamed)\n\nfunction CCTMXObjectGroupDeprecated.objectNamed(self, objectName)\n    deprecatedTip(\"CCTMXObjectGroup:objectNamed\",\"CCTMXObjectGroup:getObject\")\n    return self:getObject(objectName)\nend\nrawset(CCTMXObjectGroup,\"objectNamed\", CCTMXObjectGroupDeprecated.objectNamed)\n--functions of CCTMXObject will be deprecated end\n\n\n--functions of WebSocket will be deprecated begin\nlocal targetPlatform = CCApplication:getInstance():getTargetPlatform()\nif (kTargetIphone == targetPlatform) or (kTargetIpad == targetPlatform) or (kTargetAndroid == targetPlatform) or (kTargetWindows == targetPlatform) then\n    local WebSocketDeprecated = { }\n    function WebSocketDeprecated.sendTextMsg(self, string)\n        deprecatedTip(\"WebSocket:sendTextMsg\",\"WebSocket:sendString\")\n        return self:sendString(string)\n    end\n    rawset(WebSocket,\"sendTextMsg\", WebSocketDeprecated.sendTextMsg)\n\n    function WebSocketDeprecated.sendBinaryMsg(self, table,tablesize)\n        deprecatedTip(\"WebSocket:sendBinaryMsg\",\"WebSocket:sendString\")\n        string.char(unpack(table))\n        return self:sendString(string.char(unpack(table)))\n    end\n    rawset(WebSocket,\"sendBinaryMsg\", WebSocketDeprecated.sendBinaryMsg)\nend\n--functions of WebSocket will be deprecated end\n\n--functions of CCRenderTexture will be deprecated begin\nlocal CCRenderTextureDeprecated = { }\nfunction CCRenderTextureDeprecated.newCCImage(self)\n    deprecatedTip(\"CCRenderTexture:newCCImage\",\"CCRenderTexture:newImage\")\n    return self:newImage()\nend\nrawset(CCRenderTexture, \"newCCImage\", CCRenderTextureDeprecated.newCCImage)\n--functions of CCRenderTexture will be deprecated end\n\n--functions of Sprite will be deprecated begin\nlocal CCSpriteDeprecated = { }\nfunction CCSpriteDeprecated.setFlipX(self,flag)\n    deprecatedTip(\"CCSpriteDeprecated:setFlipX\",\"CCSpriteDeprecated:setFlippedX\")\n    return self:setFlippedX(flag)\nend\nrawset(cc.Sprite, \"setFlipX\", CCSpriteDeprecated.setFlipX)\n\nfunction CCSpriteDeprecated.setFlipY(self,flag)\n    deprecatedTip(\"CCSpriteDeprecated:setFlipY\",\"CCSpriteDeprecated:setFlippedY\")\n    return self:setFlippedY(flag)\nend\nrawset(cc.Sprite, \"setFlipY\", CCSpriteDeprecated.setFlipY)\n--functions of Sprite will be deprecated end\n\n\n--functions of Layer will be deprecated begin\nlocal CCLayerDeprecated = {}\nfunction CCLayerDeprecated.setKeypadEnabled( self, enabled)\n    return self:setKeyboardEnabled(enabled)\nend\nrawset(cc.Layer, \"setKeypadEnabled\", CCLayerDeprecated.setKeypadEnabled )\n\nfunction CCLayerDeprecated.isKeypadEnabled(self)\n    return self:isKeyboardEnabled()\nend\nrawset(cc.Layer, \"isKeypadEnabled\", CCLayerDeprecated.isKeypadEnabled )\n--functions of Layer will be deprecated end\n\n--functions of ccs.GUIReader will be deprecated begin\nlocal CCSGUIReaderDeprecated = { }\nfunction CCSGUIReaderDeprecated.purgeGUIReader()\n    deprecatedTip(\"ccs.GUIReader:purgeGUIReader\",\"ccs.GUIReader:destroyInstance\")\n    return ccs.GUIReader:destroyInstance()\nend\nrawset(ccs.GUIReader,\"purgeGUIReader\",CCSGUIReaderDeprecated.purgeGUIReader)\n--functions of ccs.GUIReader will be deprecated end\n\n--functions of ccs.ActionManagerEx will be deprecated begin\nlocal CCSActionManagerExDeprecated = { }\nfunction CCSActionManagerExDeprecated.destroyActionManager()\n    deprecatedTip(\"ccs.ActionManagerEx:destroyActionManager\",\"ccs.ActionManagerEx:destroyInstance\")\n    return ccs.ActionManagerEx:destroyInstance()\nend\nrawset(ccs.ActionManagerEx,\"destroyActionManager\",CCSActionManagerExDeprecated.destroyActionManager)\n--functions of ccs.ActionManagerEx will be deprecated end\n\n--functions of ccs.SceneReader will be deprecated begin\nlocal CCSSceneReaderDeprecated = { }\nfunction CCSSceneReaderDeprecated.destroySceneReader(self)\n    deprecatedTip(\"ccs.SceneReader:destroySceneReader\",\"ccs.SceneReader:destroyInstance\")\n    return self:destroyInstance()\nend\nrawset(ccs.SceneReader,\"destroySceneReader\",CCSSceneReaderDeprecated.destroySceneReader)\n--functions of ccs.SceneReader will be deprecated end\n\n--functions of CCArmatureDataManager will be deprecated begin\nlocal CCArmatureDataManagerDeprecated = { }\nfunction CCArmatureDataManagerDeprecated.sharedArmatureDataManager()\n    deprecatedTip(\"CCArmatureDataManager:sharedArmatureDataManager\",\"ccs.ArmatureDataManager:getInstance\")\n    return ccs.ArmatureDataManager:getInstance()\nend\nrawset(CCArmatureDataManager,\"sharedArmatureDataManager\",CCArmatureDataManagerDeprecated.sharedArmatureDataManager)\n\nfunction CCArmatureDataManagerDeprecated.purge()\n    deprecatedTip(\"CCArmatureDataManager:purge\",\"ccs.ArmatureDataManager:destoryInstance\")\n    return ccs.ArmatureDataManager:destoryInstance() \nend\nrawset(CCArmatureDataManager,\"purge\",CCArmatureDataManagerDeprecated.purge)\n--functions of CCArmatureDataManager will be deprecated end\n\n--functions of GUIReader will be deprecated begin\nlocal GUIReaderDeprecated = { }\nfunction GUIReaderDeprecated.shareReader()\n    deprecatedTip(\"GUIReader:shareReader\",\"ccs.GUIReader:getInstance\")\n    return ccs.GUIReader:getInstance()\nend\nrawset(GUIReader,\"shareReader\",GUIReaderDeprecated.shareReader)\n\nfunction GUIReaderDeprecated.purgeGUIReader()\n    deprecatedTip(\"GUIReader:purgeGUIReader\",\"ccs.GUIReader:destroyInstance\")\n    return ccs.GUIReader:destroyInstance()\nend\nrawset(GUIReader,\"purgeGUIReader\",GUIReaderDeprecated.purgeGUIReader)\n--functions of GUIReader will be deprecated end\n\n--functions of SceneReader will be deprecated begin\nlocal SceneReaderDeprecated = { }\nfunction SceneReaderDeprecated.sharedSceneReader()\n    deprecatedTip(\"SceneReader:sharedSceneReader\",\"ccs.SceneReader:getInstance\")\n    return ccs.SceneReader:getInstance()\nend\nrawset(SceneReader,\"sharedSceneReader\",SceneReaderDeprecated.sharedSceneReader)\n\nfunction SceneReaderDeprecated.purgeSceneReader(self)\n    deprecatedTip(\"SceneReader:purgeSceneReader\",\"ccs.SceneReader:destroyInstance\")\n    return self:destroyInstance()\nend\nrawset(SceneReader,\"purgeSceneReader\",SceneReaderDeprecated.purgeSceneReader)\n--functions of SceneReader will be deprecated end\n\n--functions of CCEGLView will be deprecated begin\nlocal CCEGLViewDeprecated = { }\nfunction CCEGLViewDeprecated.sharedOpenGLView()\n    deprecatedTip(\"CCEGLView:sharedOpenGLView\",\"cc.EGLView:getInstance\")\n    return cc.EGLView:getInstance()\nend\nrawset(CCEGLView,\"sharedOpenGLView\",CCEGLViewDeprecated.sharedOpenGLView)\n--functions of CCEGLView will be deprecated end\n\n--functions of cc.Node will be deprecated begin\nlocal NodeDeprecated = { }\nfunction NodeDeprecated.setZOrder(self,zOrder)\n    deprecatedTip(\"cc.Node:setZOrder\",\"cc.Node:setLocalZOrder\")\n    return self:setLocalZOrder(zOrder)\nend\nrawset(cc.Node,\"setZOrder\",NodeDeprecated.setZOrder)\n\nfunction NodeDeprecated.getZOrder(self)\n    deprecatedTip(\"cc.Node:getZOrder\",\"cc.Node:getLocalZOrder\")\n    return self:getLocalZOrder()\nend\nrawset(cc.Node,\"getZOrder\",NodeDeprecated.getZOrder)\n--functions of cc.Node will be deprecated end\n\n\n"
  },
  {
    "path": "Resources/DeprecatedClass.lua",
    "content": "-- This is the DeprecatedClass\n\nDeprecatedClass = {} or DeprecatedClass\n\n--tip\nlocal function deprecatedTip(old_name,new_name)\n    print(\"\\n********** \\n\"..old_name..\" was deprecated please use \".. new_name .. \" instead.\\n**********\")\nend\n\n--CCProgressTo class will be Deprecated,begin\nfunction DeprecatedClass.CCProgressTo()\n    deprecatedTip(\"CCProgressTo\",\"cc.ProgressTo\")\n    return cc.ProgressTo\nend\n_G[\"CCProgressTo\"] = DeprecatedClass.CCProgressTo()\n--CCProgressTo class will be Deprecated,end\n\n--CCHide class will be Deprecated,begin\nfunction DeprecatedClass.CCHide()\n    deprecatedTip(\"CCHide\",\"cc.Hide\")\n    return cc.Hide\nend\n_G[\"CCHide\"] = DeprecatedClass.CCHide()\n--CCHide class will be Deprecated,end\n\n--CCTransitionMoveInB class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInB()\n    deprecatedTip(\"CCTransitionMoveInB\",\"cc.TransitionMoveInB\")\n    return cc.TransitionMoveInB\nend\n_G[\"CCTransitionMoveInB\"] = DeprecatedClass.CCTransitionMoveInB()\n--CCTransitionMoveInB class will be Deprecated,end\n\n--CCEaseSineIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseSineIn()\n    deprecatedTip(\"CCEaseSineIn\",\"cc.EaseSineIn\")\n    return cc.EaseSineIn\nend\n_G[\"CCEaseSineIn\"] = DeprecatedClass.CCEaseSineIn()\n--CCEaseSineIn class will be Deprecated,end\n\n--CCTransitionMoveInL class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInL()\n    deprecatedTip(\"CCTransitionMoveInL\",\"cc.TransitionMoveInL\")\n    return cc.TransitionMoveInL\nend\n_G[\"CCTransitionMoveInL\"] = DeprecatedClass.CCTransitionMoveInL()\n--CCTransitionMoveInL class will be Deprecated,end\n\n--CCEaseInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseInOut()\n    deprecatedTip(\"CCEaseInOut\",\"cc.EaseInOut\")\n    return cc.EaseInOut\nend\n_G[\"CCEaseInOut\"] = DeprecatedClass.CCEaseInOut()\n--CCEaseInOut class will be Deprecated,end\n\n--SimpleAudioEngine class will be Deprecated,begin\nfunction DeprecatedClass.SimpleAudioEngine()\n    deprecatedTip(\"SimpleAudioEngine\",\"cc.SimpleAudioEngine\")\n    return cc.SimpleAudioEngine\nend\n_G[\"SimpleAudioEngine\"] = DeprecatedClass.SimpleAudioEngine()\n--SimpleAudioEngine class will be Deprecated,end\n\n--CCTransitionMoveInT class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInT()\n    deprecatedTip(\"CCTransitionMoveInT\",\"cc.TransitionMoveInT\")\n    return cc.TransitionMoveInT\nend\n_G[\"CCTransitionMoveInT\"] = DeprecatedClass.CCTransitionMoveInT()\n--CCTransitionMoveInT class will be Deprecated,end\n\n--CCTransitionMoveInR class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInR()\n    deprecatedTip(\"CCTransitionMoveInR\",\"cc.TransitionMoveInR\")\n    return cc.TransitionMoveInR\nend\n_G[\"CCTransitionMoveInR\"] = DeprecatedClass.CCTransitionMoveInR()\n--CCTransitionMoveInR class will be Deprecated,end\n\n--CCControlHuePicker class will be Deprecated,begin\nfunction DeprecatedClass.CCControlHuePicker()\n    deprecatedTip(\"CCControlHuePicker\",\"cc.ControlHuePicker\")\n    return cc.ControlHuePicker\nend\n_G[\"CCControlHuePicker\"] = DeprecatedClass.CCControlHuePicker()\n--CCControlHuePicker class will be Deprecated,end\n\n--CCParticleSnow class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSnow()\n    deprecatedTip(\"CCParticleSnow\",\"cc.ParticleSnow\")\n    return cc.ParticleSnow\nend\n_G[\"CCParticleSnow\"] = DeprecatedClass.CCParticleSnow()\n--CCParticleSnow class will be Deprecated,end\n\n--CCActionCamera class will be Deprecated,begin\nfunction DeprecatedClass.CCActionCamera()\n    deprecatedTip(\"CCActionCamera\",\"cc.ActionCamera\")\n    return cc.ActionCamera\nend\n_G[\"CCActionCamera\"] = DeprecatedClass.CCActionCamera()\n--CCActionCamera class will be Deprecated,end\n\n--CCProgressFromTo class will be Deprecated,begin\nfunction DeprecatedClass.CCProgressFromTo()\n    deprecatedTip(\"CCProgressFromTo\",\"cc.ProgressFromTo\")\n    return cc.ProgressFromTo\nend\n_G[\"CCProgressFromTo\"] = DeprecatedClass.CCProgressFromTo()\n--CCProgressFromTo class will be Deprecated,end\n\n--CCMoveTo class will be Deprecated,begin\nfunction DeprecatedClass.CCMoveTo()\n    deprecatedTip(\"CCMoveTo\",\"cc.MoveTo\")\n    return cc.MoveTo\nend\n_G[\"CCMoveTo\"] = DeprecatedClass.CCMoveTo()\n--CCMoveTo class will be Deprecated,end\n\n--CCJumpBy class will be Deprecated,begin\nfunction DeprecatedClass.CCJumpBy()\n    deprecatedTip(\"CCJumpBy\",\"cc.JumpBy\")\n    return cc.JumpBy\nend\n_G[\"CCJumpBy\"] = DeprecatedClass.CCJumpBy()\n--CCJumpBy class will be Deprecated,end\n\n--CCObject class will be Deprecated,begin\nfunction DeprecatedClass.CCObject()\n    deprecatedTip(\"CCObject\",\"cc.Object\")\n    return cc.Object\nend\n_G[\"CCObject\"] = DeprecatedClass.CCObject()\n--CCObject class will be Deprecated,end\n\n--CCTransitionRotoZoom class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionRotoZoom()\n    deprecatedTip(\"CCTransitionRotoZoom\",\"cc.TransitionRotoZoom\")\n    return cc.TransitionRotoZoom\nend\n_G[\"CCTransitionRotoZoom\"] = DeprecatedClass.CCTransitionRotoZoom()\n--CCTransitionRotoZoom class will be Deprecated,end\n\n--CCControlColourPicker class will be Deprecated,begin\nfunction DeprecatedClass.CCControlColourPicker()\n    deprecatedTip(\"CCControlColourPicker\",\"cc.ControlColourPicker\")\n    return cc.ControlColourPicker\nend\n_G[\"CCControlColourPicker\"] = DeprecatedClass.CCControlColourPicker()\n--CCControlColourPicker class will be Deprecated,end\n\n--CCDirector class will be Deprecated,begin\nfunction DeprecatedClass.CCDirector()\n    deprecatedTip(\"CCDirector\",\"cc.Director\")\n    return cc.Director\nend\n_G[\"CCDirector\"] = DeprecatedClass.CCDirector()\n--CCDirector class will be Deprecated,end\n\n--CCScheduler class will be Deprecated,begin\nfunction DeprecatedClass.CCScheduler()\n    deprecatedTip(\"CCScheduler\",\"cc.Scheduler\")\n    return cc.Scheduler\nend\n_G[\"CCScheduler\"] = DeprecatedClass.CCScheduler()\n--CCScheduler class will be Deprecated,end\n\n--CCEaseElasticOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElasticOut()\n    deprecatedTip(\"CCEaseElasticOut\",\"cc.EaseElasticOut\")\n    return cc.EaseElasticOut\nend\n_G[\"CCEaseElasticOut\"] = DeprecatedClass.CCEaseElasticOut()\n--CCEaseElasticOut class will be Deprecated,end\n\n--CCTableViewCell class will be Deprecated,begin\nfunction DeprecatedClass.CCTableViewCell()\n    deprecatedTip(\"CCTableViewCell\",\"cc.TableViewCell\")\n    return cc.TableViewCell\nend\n_G[\"CCTableViewCell\"] = DeprecatedClass.CCTableViewCell()\n--CCTableViewCell class will be Deprecated,end\n\n\n--CCEaseBackOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBackOut()\n    deprecatedTip(\"CCEaseBackOut\",\"cc.EaseBackOut\")\n    return cc.EaseBackOut\nend\n_G[\"CCEaseBackOut\"] = DeprecatedClass.CCEaseBackOut()\n--CCEaseBackOut class will be Deprecated,end\n\n--CCParticleSystemQuad class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSystemQuad()\n    deprecatedTip(\"CCParticleSystemQuad\",\"cc.ParticleSystemQuad\")\n    return cc.ParticleSystemQuad\nend\n_G[\"CCParticleSystemQuad\"] = DeprecatedClass.CCParticleSystemQuad()\n--CCParticleSystemQuad class will be Deprecated,end\n\n--CCMenuItemToggle class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemToggle()\n    deprecatedTip(\"CCMenuItemToggle\",\"cc.MenuItemToggle\")\n    return cc.MenuItemToggle\nend\n_G[\"CCMenuItemToggle\"] = DeprecatedClass.CCMenuItemToggle()\n--CCMenuItemToggle class will be Deprecated,end\n\n--CCStopGrid class will be Deprecated,begin\nfunction DeprecatedClass.CCStopGrid()\n    deprecatedTip(\"CCStopGrid\",\"cc.StopGrid\")\n    return cc.StopGrid\nend\n_G[\"CCStopGrid\"] = DeprecatedClass.CCStopGrid()\n--CCStopGrid class will be Deprecated,end\n\n--CCTransitionScene class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionScene()\n    deprecatedTip(\"CCTransitionScene\",\"cc.TransitionScene\")\n    return cc.TransitionScene\nend\n_G[\"CCTransitionScene\"] = DeprecatedClass.CCTransitionScene()\n--CCTransitionScene class will be Deprecated,end\n\n--CCSkewBy class will be Deprecated,begin\nfunction DeprecatedClass.CCSkewBy()\n    deprecatedTip(\"CCSkewBy\",\"cc.SkewBy\")\n    return cc.SkewBy\nend\n_G[\"CCSkewBy\"] = DeprecatedClass.CCSkewBy()\n--CCSkewBy class will be Deprecated,end\n\n--CCLayer class will be Deprecated,begin\nfunction DeprecatedClass.CCLayer()\n    deprecatedTip(\"CCLayer\",\"cc.Layer\")\n    return cc.Layer\nend\n_G[\"CCLayer\"] = DeprecatedClass.CCLayer()\n--CCLayer class will be Deprecated,end\n\n--CCEaseElastic class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElastic()\n    deprecatedTip(\"CCEaseElastic\",\"cc.EaseElastic\")\n    return cc.EaseElastic\nend\n_G[\"CCEaseElastic\"] = DeprecatedClass.CCEaseElastic()\n--CCEaseElastic class will be Deprecated,end\n\n--CCTMXTiledMap class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXTiledMap()\n    deprecatedTip(\"CCTMXTiledMap\",\"cc.TMXTiledMap\")\n    return cc.TMXTiledMap\nend\n_G[\"CCTMXTiledMap\"] = DeprecatedClass.CCTMXTiledMap()\n--CCTMXTiledMap class will be Deprecated,end\n\n--CCGrid3DAction class will be Deprecated,begin\nfunction DeprecatedClass.CCGrid3DAction()\n    deprecatedTip(\"CCGrid3DAction\",\"cc.Grid3DAction\")\n    return cc.Grid3DAction\nend\n_G[\"CCGrid3DAction\"] = DeprecatedClass.CCGrid3DAction()\n--CCGrid3DAction class will be Deprecated,end\n\n--CCFadeIn class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeIn()\n    deprecatedTip(\"CCFadeIn\",\"cc.FadeIn\")\n    return cc.FadeIn\nend\n_G[\"CCFadeIn\"] = DeprecatedClass.CCFadeIn()\n--CCFadeIn class will be Deprecated,end\n\n--CCNodeRGBA class will be Deprecated,begin\nfunction DeprecatedClass.CCNodeRGBA()\n    deprecatedTip(\"CCNodeRGBA\",\"cc.Node\")\n    return cc.Node\nend\n_G[\"CCNodeRGBA\"] = DeprecatedClass.CCNodeRGBA()\n--CCNodeRGBA class will be Deprecated,end\n\n--NodeRGBA class will be Deprecated,begin\nfunction DeprecatedClass.NodeRGBA()\n    deprecatedTip(\"cc.NodeRGBA\",\"cc.Node\")\n    return cc.Node\nend\n_G[\"cc\"][\"NodeRGBA\"] = DeprecatedClass.NodeRGBA()\n--NodeRGBA class will be Deprecated,end\n\n--CCAnimationCache class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimationCache()\n    deprecatedTip(\"CCAnimationCache\",\"cc.AnimationCache\")\n    return cc.AnimationCache\nend\n_G[\"CCAnimationCache\"] = DeprecatedClass.CCAnimationCache()\n--CCAnimationCache class will be Deprecated,end\n\n--CCFlipY3D class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipY3D()\n    deprecatedTip(\"CCFlipY3D\",\"cc.FlipY3D\")\n    return cc.FlipY3D\nend\n_G[\"CCFlipY3D\"] = DeprecatedClass.CCFlipY3D()\n--CCFlipY3D class will be Deprecated,end\n\n--CCEaseSineInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseSineInOut()\n    deprecatedTip(\"CCEaseSineInOut\",\"cc.EaseSineInOut\")\n    return cc.EaseSineInOut\nend\n_G[\"CCEaseSineInOut\"] = DeprecatedClass.CCEaseSineInOut()\n--CCEaseSineInOut class will be Deprecated,end\n\n--CCTransitionFlipAngular class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFlipAngular()\n    deprecatedTip(\"CCTransitionFlipAngular\",\"cc.TransitionFlipAngular\")\n    return cc.TransitionFlipAngular\nend\n_G[\"CCTransitionFlipAngular\"] = DeprecatedClass.CCTransitionFlipAngular()\n--CCTransitionFlipAngular class will be Deprecated,end\n\n--CCControl class will be Deprecated,begin\nfunction DeprecatedClass.CCControl()\n    deprecatedTip(\"CCControl\",\"cc.Control\")\n    return cc.Control\nend\n_G[\"CCControl\"] = DeprecatedClass.CCControl()\n--CCControl class will be Deprecated,end\n\n--CCEaseElasticInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElasticInOut()\n    deprecatedTip(\"CCEaseElasticInOut\",\"cc.EaseElasticInOut\")\n    return cc.EaseElasticInOut\nend\n_G[\"CCEaseElasticInOut\"] = DeprecatedClass.CCEaseElasticInOut()\n--CCEaseElasticInOut class will be Deprecated,end\n\n--CCEaseBounce class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounce()\n    deprecatedTip(\"CCEaseBounce\",\"cc.EaseBounce\")\n    return cc.EaseBounce\nend\n_G[\"CCEaseBounce\"] = DeprecatedClass.CCEaseBounce()\n--CCEaseBounce class will be Deprecated,end\n\n--CCShow class will be Deprecated,begin\nfunction DeprecatedClass.CCShow()\n    deprecatedTip(\"CCShow\",\"cc.Show\")\n    return cc.Show\nend\n_G[\"CCShow\"] = DeprecatedClass.CCShow()\n--CCShow class will be Deprecated,end\n\n--CCEditBox class will be Deprecated,begin\nfunction DeprecatedClass.CCEditBox()\n    deprecatedTip(\"CCEditBox\",\"cc.EditBox\")\n    return cc.EditBox\nend\n_G[\"CCEditBox\"] = DeprecatedClass.CCEditBox()\n--CCEditBox class will be Deprecated,end\n\n--CCFadeOut class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOut()\n    deprecatedTip(\"CCFadeOut\",\"cc.FadeOut\")\n    return cc.FadeOut\nend\n_G[\"CCFadeOut\"] = DeprecatedClass.CCFadeOut()\n--CCFadeOut class will be Deprecated,end\n\n--CCCallFunc class will be Deprecated,begin\nfunction DeprecatedClass.CCCallFunc()\n    deprecatedTip(\"CCCallFunc\",\"cc.CallFunc\")\n    return cc.CallFunc\nend\n_G[\"CCCallFunc\"] = DeprecatedClass.CCCallFunc()\n--CCCallFunc class will be Deprecated,end\n\n--CCWaves3D class will be Deprecated,begin\nfunction DeprecatedClass.CCWaves3D()\n    deprecatedTip(\"CCWaves3D\",\"cc.Waves3D\")\n    return cc.Waves3D\nend\n_G[\"CCWaves3D\"] = DeprecatedClass.CCWaves3D()\n--CCWaves3D class will be Deprecated,end\n\n--CCFlipX3D class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipX3D()\n    deprecatedTip(\"CCFlipX3D\",\"cc.FlipX3D\")\n    return cc.FlipX3D\nend\n_G[\"CCFlipX3D\"] = DeprecatedClass.CCFlipX3D()\n--CCFlipX3D class will be Deprecated,end\n\n--CCParticleFireworks class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleFireworks()\n    deprecatedTip(\"CCParticleFireworks\",\"cc.ParticleFireworks\")\n    return cc.ParticleFireworks\nend\n_G[\"CCParticleFireworks\"] = DeprecatedClass.CCParticleFireworks()\n--CCParticleFireworks class will be Deprecated,end\n\n--CCMenuItemImage class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemImage()\n    deprecatedTip(\"CCMenuItemImage\",\"cc.MenuItemImage\")\n    return cc.MenuItemImage\nend\n_G[\"CCMenuItemImage\"] = DeprecatedClass.CCMenuItemImage()\n--CCMenuItemImage class will be Deprecated,end\n\n--CCParticleFire class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleFire()\n    deprecatedTip(\"CCParticleFire\",\"cc.ParticleFire\")\n    return cc.ParticleFire\nend\n_G[\"CCParticleFire\"] = DeprecatedClass.CCParticleFire()\n--CCParticleFire class will be Deprecated,end\n\n--CCMenuItem class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItem()\n    deprecatedTip(\"CCMenuItem\",\"cc.MenuItem\")\n    return cc.MenuItem\nend\n_G[\"CCMenuItem\"] = DeprecatedClass.CCMenuItem()\n--CCMenuItem class will be Deprecated,end\n\n--CCActionEase class will be Deprecated,begin\nfunction DeprecatedClass.CCActionEase()\n    deprecatedTip(\"CCActionEase\",\"cc.ActionEase\")\n    return cc.ActionEase\nend\n_G[\"CCActionEase\"] = DeprecatedClass.CCActionEase()\n--CCActionEase class will be Deprecated,end\n\n--CCTransitionSceneOriented class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSceneOriented()\n    deprecatedTip(\"CCTransitionSceneOriented\",\"cc.TransitionSceneOriented\")\n    return cc.TransitionSceneOriented\nend\n_G[\"CCTransitionSceneOriented\"] = DeprecatedClass.CCTransitionSceneOriented()\n--CCTransitionSceneOriented class will be Deprecated,end\n\n--CCTransitionZoomFlipAngular class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionZoomFlipAngular()\n    deprecatedTip(\"CCTransitionZoomFlipAngular\",\"cc.TransitionZoomFlipAngular\")\n    return cc.TransitionZoomFlipAngular\nend\n_G[\"CCTransitionZoomFlipAngular\"] = DeprecatedClass.CCTransitionZoomFlipAngular()\n--CCTransitionZoomFlipAngular class will be Deprecated,end\n\n--CCEaseIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseIn()\n    deprecatedTip(\"CCEaseIn\",\"cc.EaseIn\")\n    return cc.EaseIn\nend\n_G[\"CCEaseIn\"] = DeprecatedClass.CCEaseIn()\n--CCEaseIn class will be Deprecated,end\n\n--CCEaseExponentialInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseExponentialInOut()\n    deprecatedTip(\"CCEaseExponentialInOut\",\"cc.EaseExponentialInOut\")\n    return cc.EaseExponentialInOut\nend\n_G[\"CCEaseExponentialInOut\"] = DeprecatedClass.CCEaseExponentialInOut()\n--CCEaseExponentialInOut class will be Deprecated,end\n\n--CCTransitionFlipX class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFlipX()\n    deprecatedTip(\"CCTransitionFlipX\",\"cc.TransitionFlipX\")\n    return cc.TransitionFlipX\nend\n_G[\"CCTransitionFlipX\"] = DeprecatedClass.CCTransitionFlipX()\n--CCTransitionFlipX class will be Deprecated,end\n\n--CCEaseExponentialOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseExponentialOut()\n    deprecatedTip(\"CCEaseExponentialOut\",\"cc.EaseExponentialOut\")\n    return cc.EaseExponentialOut\nend\n_G[\"CCEaseExponentialOut\"] = DeprecatedClass.CCEaseExponentialOut()\n--CCEaseExponentialOut class will be Deprecated,end\n\n--CCLabel class will be Deprecated,begin\nfunction DeprecatedClass.CCLabel()\n    deprecatedTip(\"CCLabel\",\"cc.Label\")\n    return cc.Label\nend\n_G[\"CCLabel\"] = DeprecatedClass.CCLabel()\n--CCLabel class will be Deprecated,end\n\n--CCApplication class will be Deprecated,begin\nfunction DeprecatedClass.CCApplication()\n    deprecatedTip(\"CCApplication\",\"cc.Application\")\n    return cc.Application\nend\n_G[\"CCApplication\"] = DeprecatedClass.CCApplication()\n--CCApplication class will be Deprecated,end\n\n--CCControlSlider class will be Deprecated,begin\nfunction DeprecatedClass.CCControlSlider()\n    deprecatedTip(\"CCControlSlider\",\"cc.ControlSlider\")\n    return cc.ControlSlider\nend\n_G[\"CCControlSlider\"] = DeprecatedClass.CCControlSlider()\n--CCControlSlider class will be Deprecated,end\n\n--CCDelayTime class will be Deprecated,begin\nfunction DeprecatedClass.CCDelayTime()\n    deprecatedTip(\"CCDelayTime\",\"cc.DelayTime\")\n    return cc.DelayTime\nend\n_G[\"CCDelayTime\"] = DeprecatedClass.CCDelayTime()\n--CCDelayTime class will be Deprecated,end\n\n--CCLabelAtlas class will be Deprecated,begin\nfunction DeprecatedClass.CCLabelAtlas()\n    deprecatedTip(\"CCLabelAtlas\",\"cc.LabelAtlas\")\n    return cc.LabelAtlas\nend\n_G[\"CCLabelAtlas\"] = DeprecatedClass.CCLabelAtlas()\n--CCLabelAtlas class will be Deprecated,end\n\n--CCLabelBMFont class will be Deprecated,begin\nfunction DeprecatedClass.CCLabelBMFont()\n    deprecatedTip(\"CCLabelBMFont\",\"cc.LabelBMFont\")\n    return cc.LabelBMFont\nend\n_G[\"CCLabelBMFont\"] = DeprecatedClass.CCLabelBMFont()\n--CCLabelBMFont class will be Deprecated,end\n\n--CCScale9Sprite class will be Deprecated,begin\nfunction DeprecatedClass.CCScale9Sprite()\n    deprecatedTip(\"CCScale9Sprite\",\"cc.Scale9Sprite\")\n    return cc.Scale9Sprite\nend\n_G[\"CCScale9Sprite\"] = DeprecatedClass.CCScale9Sprite()\n--CCScale9Sprite class will be Deprecated,end\n\n--CCFadeOutTRTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutTRTiles()\n    deprecatedTip(\"CCFadeOutTRTiles\",\"cc.FadeOutTRTiles\")\n    return cc.FadeOutTRTiles\nend\n_G[\"CCFadeOutTRTiles\"] = DeprecatedClass.CCFadeOutTRTiles()\n--CCFadeOutTRTiles class will be Deprecated,end\n\n--CCEaseElasticIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElasticIn()\n    deprecatedTip(\"CCEaseElasticIn\",\"cc.EaseElasticIn\")\n    return cc.EaseElasticIn\nend\n_G[\"CCEaseElasticIn\"] = DeprecatedClass.CCEaseElasticIn()\n--CCEaseElasticIn class will be Deprecated,end\n\n--CCParticleSpiral class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSpiral()\n    deprecatedTip(\"CCParticleSpiral\",\"cc.ParticleSpiral\")\n    return cc.ParticleSpiral\nend\n_G[\"CCParticleSpiral\"] = DeprecatedClass.CCParticleSpiral()\n--CCParticleSpiral class will be Deprecated,end\n\n--CCBReader class will be Deprecated,begin\nfunction DeprecatedClass.CCBReader()\n    deprecatedTip(\"CCBReader\",\"cc.BReader\")\n    return cc.BReader\nend\n_G[\"CCBReader\"] = DeprecatedClass.CCBReader()\n--CCBReader class will be Deprecated,end\n\n--CCFiniteTimeAction class will be Deprecated,begin\nfunction DeprecatedClass.CCFiniteTimeAction()\n    deprecatedTip(\"CCFiniteTimeAction\",\"cc.FiniteTimeAction\")\n    return cc.FiniteTimeAction\nend\n_G[\"CCFiniteTimeAction\"] = DeprecatedClass.CCFiniteTimeAction()\n--CCFiniteTimeAction class will be Deprecated,end\n\n--CCFadeOutDownTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutDownTiles()\n    deprecatedTip(\"CCFadeOutDownTiles\",\"cc.FadeOutDownTiles\")\n    return cc.FadeOutDownTiles\nend\n_G[\"CCFadeOutDownTiles\"] = DeprecatedClass.CCFadeOutDownTiles()\n--CCFadeOutDownTiles class will be Deprecated,end\n\n--CCJumpTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCJumpTiles3D()\n    deprecatedTip(\"CCJumpTiles3D\",\"cc.JumpTiles3D\")\n    return cc.JumpTiles3D\nend\n_G[\"CCJumpTiles3D\"] = DeprecatedClass.CCJumpTiles3D()\n--CCJumpTiles3D class will be Deprecated,end\n\n--CCEaseBackIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBackIn()\n    deprecatedTip(\"CCEaseBackIn\",\"cc.EaseBackIn\")\n    return cc.EaseBackIn\nend\n_G[\"CCEaseBackIn\"] = DeprecatedClass.CCEaseBackIn()\n--CCEaseBackIn class will be Deprecated,end\n\n--CCSpriteBatchNode class will be Deprecated,begin\nfunction DeprecatedClass.CCSpriteBatchNode()\n    deprecatedTip(\"CCSpriteBatchNode\",\"cc.SpriteBatchNode\")\n    return cc.SpriteBatchNode\nend\n_G[\"CCSpriteBatchNode\"] = DeprecatedClass.CCSpriteBatchNode()\n--CCSpriteBatchNode class will be Deprecated,end\n\n--CCParticleSystem class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSystem()\n    deprecatedTip(\"CCParticleSystem\",\"cc.ParticleSystem\")\n    return cc.ParticleSystem\nend\n_G[\"CCParticleSystem\"] = DeprecatedClass.CCParticleSystem()\n--CCParticleSystem class will be Deprecated,end\n\n--CCActionTween class will be Deprecated,begin\nfunction DeprecatedClass.CCActionTween()\n    deprecatedTip(\"CCActionTween\",\"cc.ActionTween\")\n    return cc.ActionTween\nend\n_G[\"CCActionTween\"] = DeprecatedClass.CCActionTween()\n--CCActionTween class will be Deprecated,end\n\n--CCTransitionFadeDown class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeDown()\n    deprecatedTip(\"CCTransitionFadeDown\",\"cc.TransitionFadeDown\")\n    return cc.TransitionFadeDown\nend\n_G[\"CCTransitionFadeDown\"] = DeprecatedClass.CCTransitionFadeDown()\n--CCTransitionFadeDown class will be Deprecated,end\n\n--CCParticleSun class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSun()\n    deprecatedTip(\"CCParticleSun\",\"cc.ParticleSun\")\n    return cc.ParticleSun\nend\n_G[\"CCParticleSun\"] = DeprecatedClass.CCParticleSun()\n--CCParticleSun class will be Deprecated,end\n\n--CCTransitionProgressHorizontal class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressHorizontal()\n    deprecatedTip(\"CCTransitionProgressHorizontal\",\"cc.TransitionProgressHorizontal\")\n    return cc.TransitionProgressHorizontal\nend\n_G[\"CCTransitionProgressHorizontal\"] = DeprecatedClass.CCTransitionProgressHorizontal()\n--CCTransitionProgressHorizontal class will be Deprecated,end\n\n--CCRipple3D class will be Deprecated,begin\nfunction DeprecatedClass.CCRipple3D()\n    deprecatedTip(\"CCRipple3D\",\"cc.Ripple3D\")\n    return cc.Ripple3D\nend\n_G[\"CCRipple3D\"] = DeprecatedClass.CCRipple3D()\n--CCRipple3D class will be Deprecated,end\n\n--CCTMXLayer class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXLayer()\n    deprecatedTip(\"CCTMXLayer\",\"cc.TMXLayer\")\n    return cc.TMXLayer\nend\n_G[\"CCTMXLayer\"] = DeprecatedClass.CCTMXLayer()\n--CCTMXLayer class will be Deprecated,end\n\n--CCFlipX class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipX()\n    deprecatedTip(\"CCFlipX\",\"cc.FlipX\")\n    return cc.FlipX\nend\n_G[\"CCFlipX\"] = DeprecatedClass.CCFlipX()\n--CCFlipX class will be Deprecated,end\n\n--CCFlipY class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipY()\n    deprecatedTip(\"CCFlipY\",\"cc.FlipY\")\n    return cc.FlipY\nend\n_G[\"CCFlipY\"] = DeprecatedClass.CCFlipY()\n--CCFlipY class will be Deprecated,end\n\n--CCTransitionSplitCols class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSplitCols()\n    deprecatedTip(\"CCTransitionSplitCols\",\"cc.TransitionSplitCols\")\n    return cc.TransitionSplitCols\nend\n_G[\"CCTransitionSplitCols\"] = DeprecatedClass.CCTransitionSplitCols()\n--CCTransitionSplitCols class will be Deprecated,end\n\n--CCTimer class will be Deprecated,begin\nfunction DeprecatedClass.CCTimer()\n    deprecatedTip(\"CCTimer\",\"cc.Timer\")\n    return cc.Timer\nend\n_G[\"CCTimer\"] = DeprecatedClass.CCTimer()\n--CCTimer class will be Deprecated,end\n\n--CCFadeTo class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeTo()\n    deprecatedTip(\"CCFadeTo\",\"cc.FadeTo\")\n    return cc.FadeTo\nend\n_G[\"CCFadeTo\"] = DeprecatedClass.CCFadeTo()\n--CCFadeTo class will be Deprecated,end\n\n--CCBAnimationManager class will be Deprecated,begin\nfunction DeprecatedClass.CCBAnimationManager()\n    deprecatedTip(\"CCBAnimationManager\",\"cc.BAnimationManager\")\n    return cc.BAnimationManager\nend\n_G[\"CCBAnimationManager\"] = DeprecatedClass.CCBAnimationManager()\n--CCBAnimationManager class will be Deprecated,end\n\n--CCRepeatForever class will be Deprecated,begin\nfunction DeprecatedClass.CCRepeatForever()\n    deprecatedTip(\"CCRepeatForever\",\"cc.RepeatForever\")\n    return cc.RepeatForever\nend\n_G[\"CCRepeatForever\"] = DeprecatedClass.CCRepeatForever()\n--CCRepeatForever class will be Deprecated,end\n\n--CCPlace class will be Deprecated,begin\nfunction DeprecatedClass.CCPlace()\n    deprecatedTip(\"CCPlace\",\"cc.Place\")\n    return cc.Place\nend\n_G[\"CCPlace\"] = DeprecatedClass.CCPlace()\n--CCPlace class will be Deprecated,end\n\n--CCScrollView class will be Deprecated,begin\nfunction DeprecatedClass.CCScrollView()\n    deprecatedTip(\"CCScrollView\",\"cc.ScrollView\")\n    return cc.ScrollView\nend\n_G[\"CCScrollView\"] = DeprecatedClass.CCScrollView()\n--CCScrollView class will be Deprecated,end\n\n\n--CCGLProgram class will be Deprecated,begin\nfunction DeprecatedClass.CCGLProgram()\n    deprecatedTip(\"CCGLProgram\",\"cc.GLProgram\")\n    return cc.GLProgram\nend\n_G[\"CCGLProgram\"] = DeprecatedClass.CCGLProgram()\n--CCGLProgram class will be Deprecated,end\n\n--CCEaseBounceOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounceOut()\n    deprecatedTip(\"CCEaseBounceOut\",\"cc.EaseBounceOut\")\n    return cc.EaseBounceOut\nend\n_G[\"CCEaseBounceOut\"] = DeprecatedClass.CCEaseBounceOut()\n--CCEaseBounceOut class will be Deprecated,end\n\n--CCCardinalSplineBy class will be Deprecated,begin\nfunction DeprecatedClass.CCCardinalSplineBy()\n    deprecatedTip(\"CCCardinalSplineBy\",\"cc.CardinalSplineBy\")\n    return cc.CardinalSplineBy\nend\n_G[\"CCCardinalSplineBy\"] = DeprecatedClass.CCCardinalSplineBy()\n--CCCardinalSplineBy class will be Deprecated,end\n\n--CCSpriteFrameCache class will be Deprecated,begin\nfunction DeprecatedClass.CCSpriteFrameCache()\n    deprecatedTip(\"CCSpriteFrameCache\",\"cc.SpriteFrameCache\")\n    return cc.SpriteFrameCache\nend\n_G[\"CCSpriteFrameCache\"] = DeprecatedClass.CCSpriteFrameCache()\n--CCSpriteFrameCache class will be Deprecated,end\n\n--CCTransitionShrinkGrow class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionShrinkGrow()\n    deprecatedTip(\"CCTransitionShrinkGrow\",\"cc.TransitionShrinkGrow\")\n    return cc.TransitionShrinkGrow\nend\n_G[\"CCTransitionShrinkGrow\"] = DeprecatedClass.CCTransitionShrinkGrow()\n--CCTransitionShrinkGrow class will be Deprecated,end\n\n--CCSplitCols class will be Deprecated,begin\nfunction DeprecatedClass.CCSplitCols()\n    deprecatedTip(\"CCSplitCols\",\"cc.SplitCols\")\n    return cc.SplitCols\nend\n_G[\"CCSplitCols\"] = DeprecatedClass.CCSplitCols()\n--CCSplitCols class will be Deprecated,end\n\n--CCClippingNode class will be Deprecated,begin\nfunction DeprecatedClass.CCClippingNode()\n    deprecatedTip(\"CCClippingNode\",\"cc.ClippingNode\")\n    return cc.ClippingNode\nend\n_G[\"CCClippingNode\"] = DeprecatedClass.CCClippingNode()\n--CCClippingNode class will be Deprecated,end\n\n--CCEaseBounceInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounceInOut()\n    deprecatedTip(\"CCEaseBounceInOut\",\"cc.EaseBounceInOut\")\n    return cc.EaseBounceInOut\nend\n_G[\"CCEaseBounceInOut\"] = DeprecatedClass.CCEaseBounceInOut()\n--CCEaseBounceInOut class will be Deprecated,end\n\n--CCLiquid class will be Deprecated,begin\nfunction DeprecatedClass.CCLiquid()\n    deprecatedTip(\"CCLiquid\",\"cc.Liquid\")\n    return cc.Liquid\nend\n_G[\"CCLiquid\"] = DeprecatedClass.CCLiquid()\n--CCLiquid class will be Deprecated,end\n\n--CCParticleFlower class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleFlower()\n    deprecatedTip(\"CCParticleFlower\",\"cc.ParticleFlower\")\n    return cc.ParticleFlower\nend\n_G[\"CCParticleFlower\"] = DeprecatedClass.CCParticleFlower()\n--CCParticleFlower class will be Deprecated,end\n\n--CCTableView class will be Deprecated,begin\nfunction DeprecatedClass.CCTableView()\n    deprecatedTip(\"CCTableView\",\"cc.TableView\")\n    return cc.TableView\nend\n_G[\"CCTableView\"] = DeprecatedClass.CCTableView()\n--CCTableView class will be Deprecated,end\n\n\n--CCParticleSmoke class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSmoke()\n    deprecatedTip(\"CCParticleSmoke\",\"cc.ParticleSmoke\")\n    return cc.ParticleSmoke\nend\n_G[\"CCParticleSmoke\"] = DeprecatedClass.CCParticleSmoke()\n--CCParticleSmoke class will be Deprecated,end\n\n--CCImage class will be Deprecated,begin\nfunction DeprecatedClass.CCImage()\n    deprecatedTip(\"CCImage\",\"cc.Image\")\n    return cc.Image\nend\n_G[\"CCImage\"] = DeprecatedClass.CCImage()\n--CCImage class will be Deprecated,end\n\n--CCTurnOffTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCTurnOffTiles()\n    deprecatedTip(\"CCTurnOffTiles\",\"cc.TurnOffTiles\")\n    return cc.TurnOffTiles\nend\n_G[\"CCTurnOffTiles\"] = DeprecatedClass.CCTurnOffTiles()\n--CCTurnOffTiles class will be Deprecated,end\n\n--CCBlink class will be Deprecated,begin\nfunction DeprecatedClass.CCBlink()\n    deprecatedTip(\"CCBlink\",\"cc.Blink\")\n    return cc.Blink\nend\n_G[\"CCBlink\"] = DeprecatedClass.CCBlink()\n--CCBlink class will be Deprecated,end\n\n--CCShaderCache class will be Deprecated,begin\nfunction DeprecatedClass.CCShaderCache()\n    deprecatedTip(\"CCShaderCache\",\"cc.ShaderCache\")\n    return cc.ShaderCache\nend\n_G[\"CCShaderCache\"] = DeprecatedClass.CCShaderCache()\n--CCShaderCache class will be Deprecated,end\n\n--CCJumpTo class will be Deprecated,begin\nfunction DeprecatedClass.CCJumpTo()\n    deprecatedTip(\"CCJumpTo\",\"cc.JumpTo\")\n    return cc.JumpTo\nend\n_G[\"CCJumpTo\"] = DeprecatedClass.CCJumpTo()\n--CCJumpTo class will be Deprecated,end\n\n--CCAtlasNode class will be Deprecated,begin\nfunction DeprecatedClass.CCAtlasNode()\n    deprecatedTip(\"CCAtlasNode\",\"cc.AtlasNode\")\n    return cc.AtlasNode\nend\n_G[\"CCAtlasNode\"] = DeprecatedClass.CCAtlasNode()\n--CCAtlasNode class will be Deprecated,end\n\n--CCTransitionJumpZoom class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionJumpZoom()\n    deprecatedTip(\"CCTransitionJumpZoom\",\"cc.TransitionJumpZoom\")\n    return cc.TransitionJumpZoom\nend\n_G[\"CCTransitionJumpZoom\"] = DeprecatedClass.CCTransitionJumpZoom()\n--CCTransitionJumpZoom class will be Deprecated,end\n\n--CCTransitionProgressVertical class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressVertical()\n    deprecatedTip(\"CCTransitionProgressVertical\",\"cc.TransitionProgressVertical\")\n    return cc.TransitionProgressVertical\nend\n_G[\"CCTransitionProgressVertical\"] = DeprecatedClass.CCTransitionProgressVertical()\n--CCTransitionProgressVertical class will be Deprecated,end\n\n--CCAnimationFrame class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimationFrame()\n    deprecatedTip(\"CCAnimationFrame\",\"cc.AnimationFrame\")\n    return cc.AnimationFrame\nend\n_G[\"CCAnimationFrame\"] = DeprecatedClass.CCAnimationFrame()\n--CCAnimationFrame class will be Deprecated,end\n\n--CCTintTo class will be Deprecated,begin\nfunction DeprecatedClass.CCTintTo()\n    deprecatedTip(\"CCTintTo\",\"cc.TintTo\")\n    return cc.TintTo\nend\n_G[\"CCTintTo\"] = DeprecatedClass.CCTintTo()\n--CCTintTo class will be Deprecated,end\n\n--CCTiledGrid3DAction class will be Deprecated,begin\nfunction DeprecatedClass.CCTiledGrid3DAction()\n    deprecatedTip(\"CCTiledGrid3DAction\",\"cc.TiledGrid3DAction\")\n    return cc.TiledGrid3DAction\nend\n_G[\"CCTiledGrid3DAction\"] = DeprecatedClass.CCTiledGrid3DAction()\n--CCTiledGrid3DAction class will be Deprecated,end\n\n--CCTMXTilesetInfo class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXTilesetInfo()\n    deprecatedTip(\"CCTMXTilesetInfo\",\"cc.TMXTilesetInfo\")\n    return cc.TMXTilesetInfo\nend\n_G[\"CCTMXTilesetInfo\"] = DeprecatedClass.CCTMXTilesetInfo()\n--CCTMXTilesetInfo class will be Deprecated,end\n\n--CCTMXObjectGroup class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXObjectGroup()\n    deprecatedTip(\"CCTMXObjectGroup\",\"cc.TMXObjectGroup\")\n    return cc.TMXObjectGroup\nend\n_G[\"CCTMXObjectGroup\"] = DeprecatedClass.CCTMXObjectGroup()\n--CCTMXObjectGroup class will be Deprecated,end\n\n--CCParticleGalaxy class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleGalaxy()\n    deprecatedTip(\"CCParticleGalaxy\",\"cc.ParticleGalaxy\")\n    return cc.ParticleGalaxy\nend\n_G[\"CCParticleGalaxy\"] = DeprecatedClass.CCParticleGalaxy()\n--CCParticleGalaxy class will be Deprecated,end\n\n--CCTwirl class will be Deprecated,begin\nfunction DeprecatedClass.CCTwirl()\n    deprecatedTip(\"CCTwirl\",\"cc.Twirl\")\n    return cc.Twirl\nend\n_G[\"CCTwirl\"] = DeprecatedClass.CCTwirl()\n--CCTwirl class will be Deprecated,end\n\n--CCMenuItemLabel class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemLabel()\n    deprecatedTip(\"CCMenuItemLabel\",\"cc.MenuItemLabel\")\n    return cc.MenuItemLabel\nend\n_G[\"CCMenuItemLabel\"] = DeprecatedClass.CCMenuItemLabel()\n--CCMenuItemLabel class will be Deprecated,end\n\n--CCLayerColor class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerColor()\n    deprecatedTip(\"CCLayerColor\",\"cc.LayerColor\")\n    return cc.LayerColor\nend\n_G[\"CCLayerColor\"] = DeprecatedClass.CCLayerColor()\n--CCLayerColor class will be Deprecated,end\n\n--CCFadeOutBLTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutBLTiles()\n    deprecatedTip(\"CCFadeOutBLTiles\",\"cc.FadeOutBLTiles\")\n    return cc.FadeOutBLTiles\nend\n_G[\"CCFadeOutBLTiles\"] = DeprecatedClass.CCFadeOutBLTiles()\n--CCFadeOutBLTiles class will be Deprecated,end\n\n--CCTransitionProgress class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgress()\n    deprecatedTip(\"CCTransitionProgress\",\"cc.TransitionProgress\")\n    return cc.TransitionProgress\nend\n_G[\"CCTransitionProgress\"] = DeprecatedClass.CCTransitionProgress()\n--CCTransitionProgress class will be Deprecated,end\n\n--CCEaseRateAction class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseRateAction()\n    deprecatedTip(\"CCEaseRateAction\",\"cc.EaseRateAction\")\n    return cc.EaseRateAction\nend\n_G[\"CCEaseRateAction\"] = DeprecatedClass.CCEaseRateAction()\n--CCEaseRateAction class will be Deprecated,end\n\n--CCLayerGradient class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerGradient()\n    deprecatedTip(\"CCLayerGradient\",\"cc.LayerGradient\")\n    return cc.LayerGradient\nend\n_G[\"CCLayerGradient\"] = DeprecatedClass.CCLayerGradient()\n--CCLayerGradient class will be Deprecated,end\n\n--CCMenuItemSprite class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemSprite()\n    deprecatedTip(\"CCMenuItemSprite\",\"cc.MenuItemSprite\")\n    return cc.MenuItemSprite\nend\n_G[\"CCMenuItemSprite\"] = DeprecatedClass.CCMenuItemSprite()\n--CCMenuItemSprite class will be Deprecated,end\n\n--CCNode class will be Deprecated,begin\nfunction DeprecatedClass.CCNode()\n    deprecatedTip(\"CCNode\",\"cc.Node\")\n    return cc.Node\nend\n_G[\"CCNode\"] = DeprecatedClass.CCNode()\n--CCNode class will be Deprecated,end\n\n--CCToggleVisibility class will be Deprecated,begin\nfunction DeprecatedClass.CCToggleVisibility()\n    deprecatedTip(\"CCToggleVisibility\",\"cc.ToggleVisibility\")\n    return cc.ToggleVisibility\nend\n_G[\"CCToggleVisibility\"] = DeprecatedClass.CCToggleVisibility()\n--CCToggleVisibility class will be Deprecated,end\n\n--CCRepeat class will be Deprecated,begin\nfunction DeprecatedClass.CCRepeat()\n    deprecatedTip(\"CCRepeat\",\"cc.Repeat\")\n    return cc.Repeat\nend\n_G[\"CCRepeat\"] = DeprecatedClass.CCRepeat()\n--CCRepeat class will be Deprecated,end\n\n--CCRenderTexture class will be Deprecated,begin\nfunction DeprecatedClass.CCRenderTexture()\n    deprecatedTip(\"CCRenderTexture\",\"cc.RenderTexture\")\n    return cc.RenderTexture\nend\n_G[\"CCRenderTexture\"] = DeprecatedClass.CCRenderTexture()\n--CCRenderTexture class will be Deprecated,end\n\n--CCTransitionFlipY class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFlipY()\n    deprecatedTip(\"CCTransitionFlipY\",\"cc.TransitionFlipY\")\n    return cc.TransitionFlipY\nend\n_G[\"CCTransitionFlipY\"] = DeprecatedClass.CCTransitionFlipY()\n--CCTransitionFlipY class will be Deprecated,end\n\n--CCLayerMultiplex class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerMultiplex()\n    deprecatedTip(\"CCLayerMultiplex\",\"cc.LayerMultiplex\")\n    return cc.LayerMultiplex\nend\n_G[\"CCLayerMultiplex\"] = DeprecatedClass.CCLayerMultiplex()\n--CCLayerMultiplex class will be Deprecated,end\n\n--CCTMXLayerInfo class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXLayerInfo()\n    deprecatedTip(\"CCTMXLayerInfo\",\"cc.TMXLayerInfo\")\n    return cc.TMXLayerInfo\nend\n_G[\"CCTMXLayerInfo\"] = DeprecatedClass.CCTMXLayerInfo()\n--CCTMXLayerInfo class will be Deprecated,end\n\n--CCEaseBackInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBackInOut()\n    deprecatedTip(\"CCEaseBackInOut\",\"cc.EaseBackInOut\")\n    return cc.EaseBackInOut\nend\n_G[\"CCEaseBackInOut\"] = DeprecatedClass.CCEaseBackInOut()\n--CCEaseBackInOut class will be Deprecated,end\n\n--CCActionInstant class will be Deprecated,begin\nfunction DeprecatedClass.CCActionInstant()\n    deprecatedTip(\"CCActionInstant\",\"cc.ActionInstant\")\n    return cc.ActionInstant\nend\n_G[\"CCActionInstant\"] = DeprecatedClass.CCActionInstant()\n--CCActionInstant class will be Deprecated,end\n\n--CCTargetedAction class will be Deprecated,begin\nfunction DeprecatedClass.CCTargetedAction()\n    deprecatedTip(\"CCTargetedAction\",\"cc.TargetedAction\")\n    return cc.TargetedAction\nend\n_G[\"CCTargetedAction\"] = DeprecatedClass.CCTargetedAction()\n--CCTargetedAction class will be Deprecated,end\n\n--CCDrawNode class will be Deprecated,begin\nfunction DeprecatedClass.CCDrawNode()\n    deprecatedTip(\"CCDrawNode\",\"cc.DrawNode\")\n    return cc.DrawNode\nend\n_G[\"CCDrawNode\"] = DeprecatedClass.CCDrawNode()\n--CCDrawNode class will be Deprecated,end\n\n--CCTransitionTurnOffTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionTurnOffTiles()\n    deprecatedTip(\"CCTransitionTurnOffTiles\",\"cc.TransitionTurnOffTiles\")\n    return cc.TransitionTurnOffTiles\nend\n_G[\"CCTransitionTurnOffTiles\"] = DeprecatedClass.CCTransitionTurnOffTiles()\n--CCTransitionTurnOffTiles class will be Deprecated,end\n\n--CCRotateTo class will be Deprecated,begin\nfunction DeprecatedClass.CCRotateTo()\n    deprecatedTip(\"CCRotateTo\",\"cc.RotateTo\")\n    return cc.RotateTo\nend\n_G[\"CCRotateTo\"] = DeprecatedClass.CCRotateTo()\n--CCRotateTo class will be Deprecated,end\n\n--CCTransitionSplitRows class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSplitRows()\n    deprecatedTip(\"CCTransitionSplitRows\",\"cc.TransitionSplitRows\")\n    return cc.TransitionSplitRows\nend\n_G[\"CCTransitionSplitRows\"] = DeprecatedClass.CCTransitionSplitRows()\n--CCTransitionSplitRows class will be Deprecated,end\n\n--CCTransitionProgressRadialCCW class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressRadialCCW()\n    deprecatedTip(\"CCTransitionProgressRadialCCW\",\"cc.TransitionProgressRadialCCW\")\n    return cc.TransitionProgressRadialCCW\nend\n_G[\"CCTransitionProgressRadialCCW\"] = DeprecatedClass.CCTransitionProgressRadialCCW()\n--CCTransitionProgressRadialCCW class will be Deprecated,end\n\n--CCScaleTo class will be Deprecated,begin\nfunction DeprecatedClass.CCScaleTo()\n    deprecatedTip(\"CCScaleTo\",\"cc.ScaleTo\")\n    return cc.ScaleTo\nend\n_G[\"CCScaleTo\"] = DeprecatedClass.CCScaleTo()\n--CCScaleTo class will be Deprecated,end\n\n--CCTransitionPageTurn class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionPageTurn()\n    deprecatedTip(\"CCTransitionPageTurn\",\"cc.TransitionPageTurn\")\n    return cc.TransitionPageTurn\nend\n_G[\"CCTransitionPageTurn\"] = DeprecatedClass.CCTransitionPageTurn()\n--CCTransitionPageTurn class will be Deprecated,end\n\n--CCParticleExplosion class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleExplosion()\n    deprecatedTip(\"CCParticleExplosion\",\"cc.ParticleExplosion\")\n    return cc.ParticleExplosion\nend\n_G[\"CCParticleExplosion\"] = DeprecatedClass.CCParticleExplosion()\n--CCParticleExplosion class will be Deprecated,end\n\n--CCMenu class will be Deprecated,begin\nfunction DeprecatedClass.CCMenu()\n    deprecatedTip(\"CCMenu\",\"cc.Menu\")\n    return cc.Menu\nend\n_G[\"CCMenu\"] = DeprecatedClass.CCMenu()\n--CCMenu class will be Deprecated,end\n\n--CCTexture2D class will be Deprecated,begin\nfunction DeprecatedClass.CCTexture2D()\n    deprecatedTip(\"CCTexture2D\",\"cc.Texture2D\")\n    return cc.Texture2D\nend\n_G[\"CCTexture2D\"] = DeprecatedClass.CCTexture2D()\n--CCTexture2D class will be Deprecated,end\n\n--CCActionManager class will be Deprecated,begin\nfunction DeprecatedClass.CCActionManager()\n    deprecatedTip(\"CCActionManager\",\"cc.ActionManager\")\n    return cc.ActionManager\nend\n_G[\"CCActionManager\"] = DeprecatedClass.CCActionManager()\n--CCActionManager class will be Deprecated,end\n\n--CCParticleBatchNode class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleBatchNode()\n    deprecatedTip(\"CCParticleBatchNode\",\"cc.ParticleBatchNode\")\n    return cc.ParticleBatchNode\nend\n_G[\"CCParticleBatchNode\"] = DeprecatedClass.CCParticleBatchNode()\n--CCParticleBatchNode class will be Deprecated,end\n\n--CCTransitionZoomFlipX class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionZoomFlipX()\n    deprecatedTip(\"CCTransitionZoomFlipX\",\"cc.TransitionZoomFlipX\")\n    return cc.TransitionZoomFlipX\nend\n_G[\"CCTransitionZoomFlipX\"] = DeprecatedClass.CCTransitionZoomFlipX()\n--CCTransitionZoomFlipX class will be Deprecated,end\n\n--CCControlPotentiometer class will be Deprecated,begin\nfunction DeprecatedClass.CCControlPotentiometer()\n    deprecatedTip(\"CCControlPotentiometer\",\"cc.ControlPotentiometer\")\n    return cc.ControlPotentiometer\nend\n_G[\"CCControlPotentiometer\"] = DeprecatedClass.CCControlPotentiometer()\n--CCControlPotentiometer class will be Deprecated,end\n\n--CCScaleBy class will be Deprecated,begin\nfunction DeprecatedClass.CCScaleBy()\n    deprecatedTip(\"CCScaleBy\",\"cc.ScaleBy\")\n    return cc.ScaleBy\nend\n_G[\"CCScaleBy\"] = DeprecatedClass.CCScaleBy()\n--CCScaleBy class will be Deprecated,end\n\n--CCTileMapAtlas class will be Deprecated,begin\nfunction DeprecatedClass.CCTileMapAtlas()\n    deprecatedTip(\"CCTileMapAtlas\",\"cc.TileMapAtlas\")\n    return cc.TileMapAtlas\nend\n_G[\"CCTileMapAtlas\"] = DeprecatedClass.CCTileMapAtlas()\n--CCTileMapAtlas class will be Deprecated,end\n\n--CCAction class will be Deprecated,begin\nfunction DeprecatedClass.CCAction()\n    deprecatedTip(\"CCAction\",\"cc.Action\")\n    return cc.Action\nend\n_G[\"CCAction\"] = DeprecatedClass.CCAction()\n--CCAction class will be Deprecated,end\n\n--CCLens3D class will be Deprecated,begin\nfunction DeprecatedClass.CCLens3D()\n    deprecatedTip(\"CCLens3D\",\"cc.Lens3D\")\n    return cc.Lens3D\nend\n_G[\"CCLens3D\"] = DeprecatedClass.CCLens3D()\n--CCLens3D class will be Deprecated,end\n\n--CCAnimation class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimation()\n    deprecatedTip(\"CCAnimation\",\"cc.Animation\")\n    return cc.Animation\nend\n_G[\"CCAnimation\"] = DeprecatedClass.CCAnimation()\n--CCAnimation class will be Deprecated,end\n\n--CCTransitionSlideInT class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInT()\n    deprecatedTip(\"CCTransitionSlideInT\",\"cc.TransitionSlideInT\")\n    return cc.TransitionSlideInT\nend\n_G[\"CCTransitionSlideInT\"] = DeprecatedClass.CCTransitionSlideInT()\n--CCTransitionSlideInT class will be Deprecated,end\n\n--CCSpawn class will be Deprecated,begin\nfunction DeprecatedClass.CCSpawn()\n    deprecatedTip(\"CCSpawn\",\"cc.Spawn\")\n    return cc.Spawn\nend\n_G[\"CCSpawn\"] = DeprecatedClass.CCSpawn()\n--CCSpawn class will be Deprecated,end\n\n--CCSet class will be Deprecated,begin\nfunction DeprecatedClass.CCSet()\n    deprecatedTip(\"CCSet\",\"cc.Set\")\n    return cc.Set\nend\n_G[\"CCSet\"] = DeprecatedClass.CCSet()\n--CCSet class will be Deprecated,end\n\n--CCShakyTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCShakyTiles3D()\n    deprecatedTip(\"CCShakyTiles3D\",\"cc.ShakyTiles3D\")\n    return cc.ShakyTiles3D\nend\n_G[\"CCShakyTiles3D\"] = DeprecatedClass.CCShakyTiles3D()\n--CCShakyTiles3D class will be Deprecated,end\n\n--CCPageTurn3D class will be Deprecated,begin\nfunction DeprecatedClass.CCPageTurn3D()\n    deprecatedTip(\"CCPageTurn3D\",\"cc.PageTurn3D\")\n    return cc.PageTurn3D\nend\n_G[\"CCPageTurn3D\"] = DeprecatedClass.CCPageTurn3D()\n--CCPageTurn3D class will be Deprecated,end\n\n--CCGrid3D class will be Deprecated,begin\nfunction DeprecatedClass.CCGrid3D()\n    deprecatedTip(\"CCGrid3D\",\"cc.Grid3D\")\n    return cc.Grid3D\nend\n_G[\"CCGrid3D\"] = DeprecatedClass.CCGrid3D()\n--CCGrid3D class will be Deprecated,end\n\n--CCTransitionProgressInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressInOut()\n    deprecatedTip(\"CCTransitionProgressInOut\",\"cc.TransitionProgressInOut\")\n    return cc.TransitionProgressInOut\nend\n_G[\"CCTransitionProgressInOut\"] = DeprecatedClass.CCTransitionProgressInOut()\n--CCTransitionProgressInOut class will be Deprecated,end\n\n--CCTransitionFadeBL class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeBL()\n    deprecatedTip(\"CCTransitionFadeBL\",\"cc.TransitionFadeBL\")\n    return cc.TransitionFadeBL\nend\n_G[\"CCTransitionFadeBL\"] = DeprecatedClass.CCTransitionFadeBL()\n--CCTransitionFadeBL class will be Deprecated,end\n\n--CCCamera class will be Deprecated,begin\nfunction DeprecatedClass.CCCamera()\n    deprecatedTip(\"CCCamera\",\"cc.Camera\")\n    return cc.Camera\nend\n_G[\"CCCamera\"] = DeprecatedClass.CCCamera()\n--CCCamera class will be Deprecated,end\n\n--CCLayerRGBA class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerRGBA()\n    deprecatedTip(\"CCLayerRGBA\",\"cc.Layer\")\n    return cc.Layer\nend\n_G[\"CCLayerRGBA\"] = DeprecatedClass.CCLayerRGBA()\n--CCLayerRGBA class will be Deprecated,end\n\n--LayerRGBA class will be Deprecated,begin\nfunction DeprecatedClass.LayerRGBA()\n    deprecatedTip(\"cc.LayerRGBA\",\"cc.Layer\")\n    return cc.Layer\nend\n_G[\"cc\"][\"LayerRGBA\"] = DeprecatedClass.LayerRGBA()\n--LayerRGBA class will be Deprecated,end\n\n--CCBezierTo class will be Deprecated,begin\nfunction DeprecatedClass.CCBezierTo()\n    deprecatedTip(\"CCBezierTo\",\"cc.BezierTo\")\n    return cc.BezierTo\nend\n_G[\"CCBezierTo\"] = DeprecatedClass.CCBezierTo()\n--CCBezierTo class will be Deprecated,end\n\n--CCControlButton class will be Deprecated,begin\nfunction DeprecatedClass.CCControlButton()\n    deprecatedTip(\"CCControlButton\",\"cc.ControlButton\")\n    return cc.ControlButton\nend\n_G[\"CCControlButton\"] = DeprecatedClass.CCControlButton()\n--CCControlButton class will be Deprecated,end\n\n--CCFollow class will be Deprecated,begin\nfunction DeprecatedClass.CCFollow()\n    deprecatedTip(\"CCFollow\",\"cc.Follow\")\n    return cc.Follow\nend\n_G[\"CCFollow\"] = DeprecatedClass.CCFollow()\n--CCFollow class will be Deprecated,end\n\n--CCTintBy class will be Deprecated,begin\nfunction DeprecatedClass.CCTintBy()\n    deprecatedTip(\"CCTintBy\",\"cc.TintBy\")\n    return cc.TintBy\nend\n_G[\"CCTintBy\"] = DeprecatedClass.CCTintBy()\n--CCTintBy class will be Deprecated,end\n\n--CCActionInterval class will be Deprecated,begin\nfunction DeprecatedClass.CCActionInterval()\n    deprecatedTip(\"CCActionInterval\",\"cc.ActionInterval\")\n    return cc.ActionInterval\nend\n_G[\"CCActionInterval\"] = DeprecatedClass.CCActionInterval()\n--CCActionInterval class will be Deprecated,end\n\n--CCAnimate class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimate()\n    deprecatedTip(\"CCAnimate\",\"cc.Animate\")\n    return cc.Animate\nend\n_G[\"CCAnimate\"] = DeprecatedClass.CCAnimate()\n--CCAnimate class will be Deprecated,end\n\n--CCProgressTimer class will be Deprecated,begin\nfunction DeprecatedClass.CCProgressTimer()\n    deprecatedTip(\"CCProgressTimer\",\"cc.ProgressTimer\")\n    return cc.ProgressTimer\nend\n_G[\"CCProgressTimer\"] = DeprecatedClass.CCProgressTimer()\n--CCProgressTimer class will be Deprecated,end\n\n--CCParticleMeteor class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleMeteor()\n    deprecatedTip(\"CCParticleMeteor\",\"cc.ParticleMeteor\")\n    return cc.ParticleMeteor\nend\n_G[\"CCParticleMeteor\"] = DeprecatedClass.CCParticleMeteor()\n--CCParticleMeteor class will be Deprecated,end\n\n--CCTransitionFadeTR class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeTR()\n    deprecatedTip(\"CCTransitionFadeTR\",\"cc.TransitionFadeTR\")\n    return cc.TransitionFadeTR\nend\n_G[\"CCTransitionFadeTR\"] = DeprecatedClass.CCTransitionFadeTR()\n--CCTransitionFadeTR class will be Deprecated,end\n\n--CCCatmullRomTo class will be Deprecated,begin\nfunction DeprecatedClass.CCCatmullRomTo()\n    deprecatedTip(\"CCCatmullRomTo\",\"cc.CatmullRomTo\")\n    return cc.CatmullRomTo\nend\n_G[\"CCCatmullRomTo\"] = DeprecatedClass.CCCatmullRomTo()\n--CCCatmullRomTo class will be Deprecated,end\n\n--CCTransitionZoomFlipY class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionZoomFlipY()\n    deprecatedTip(\"CCTransitionZoomFlipY\",\"cc.TransitionZoomFlipY\")\n    return cc.TransitionZoomFlipY\nend\n_G[\"CCTransitionZoomFlipY\"] = DeprecatedClass.CCTransitionZoomFlipY()\n--CCTransitionZoomFlipY class will be Deprecated,end\n\n--CCTransitionCrossFade class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionCrossFade()\n    deprecatedTip(\"CCTransitionCrossFade\",\"cc.TransitionCrossFade\")\n    return cc.TransitionCrossFade\nend\n_G[\"CCTransitionCrossFade\"] = DeprecatedClass.CCTransitionCrossFade()\n--CCTransitionCrossFade class will be Deprecated,end\n\n--CCGridBase class will be Deprecated,begin\nfunction DeprecatedClass.CCGridBase()\n    deprecatedTip(\"CCGridBase\",\"cc.GridBase\")\n    return cc.GridBase\nend\n_G[\"CCGridBase\"] = DeprecatedClass.CCGridBase()\n--CCGridBase class will be Deprecated,end\n\n--CCSkewTo class will be Deprecated,begin\nfunction DeprecatedClass.CCSkewTo()\n    deprecatedTip(\"CCSkewTo\",\"cc.SkewTo\")\n    return cc.SkewTo\nend\n_G[\"CCSkewTo\"] = DeprecatedClass.CCSkewTo()\n--CCSkewTo class will be Deprecated,end\n\n--CCCardinalSplineTo class will be Deprecated,begin\nfunction DeprecatedClass.CCCardinalSplineTo()\n    deprecatedTip(\"CCCardinalSplineTo\",\"cc.CardinalSplineTo\")\n    return cc.CardinalSplineTo\nend\n_G[\"CCCardinalSplineTo\"] = DeprecatedClass.CCCardinalSplineTo()\n--CCCardinalSplineTo class will be Deprecated,end\n\n--CCTMXMapInfo class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXMapInfo()\n    deprecatedTip(\"CCTMXMapInfo\",\"cc.TMXMapInfo\")\n    return cc.TMXMapInfo\nend\n_G[\"CCTMXMapInfo\"] = DeprecatedClass.CCTMXMapInfo()\n--CCTMXMapInfo class will be Deprecated,end\n\n--CCEaseExponentialIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseExponentialIn()\n    deprecatedTip(\"CCEaseExponentialIn\",\"cc.EaseExponentialIn\")\n    return cc.EaseExponentialIn\nend\n_G[\"CCEaseExponentialIn\"] = DeprecatedClass.CCEaseExponentialIn()\n--CCEaseExponentialIn class will be Deprecated,end\n\n--CCReuseGrid class will be Deprecated,begin\nfunction DeprecatedClass.CCReuseGrid()\n    deprecatedTip(\"CCReuseGrid\",\"cc.ReuseGrid\")\n    return cc.ReuseGrid\nend\n_G[\"CCReuseGrid\"] = DeprecatedClass.CCReuseGrid()\n--CCReuseGrid class will be Deprecated,end\n\n--CCMenuItemAtlasFont class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemAtlasFont()\n    deprecatedTip(\"CCMenuItemAtlasFont\",\"cc.MenuItemAtlasFont\")\n    return cc.MenuItemAtlasFont\nend\n_G[\"CCMenuItemAtlasFont\"] = DeprecatedClass.CCMenuItemAtlasFont()\n--CCMenuItemAtlasFont class will be Deprecated,end\n\n--CCSpriteFrame class will be Deprecated,begin\nfunction DeprecatedClass.CCSpriteFrame()\n    deprecatedTip(\"CCSpriteFrame\",\"cc.SpriteFrame\")\n    return cc.SpriteFrame\nend\n_G[\"CCSpriteFrame\"] = DeprecatedClass.CCSpriteFrame()\n--CCSpriteFrame class will be Deprecated,end\n\n--CCSplitRows class will be Deprecated,begin\nfunction DeprecatedClass.CCSplitRows()\n    deprecatedTip(\"CCSplitRows\",\"cc.SplitRows\")\n    return cc.SplitRows\nend\n_G[\"CCSplitRows\"] = DeprecatedClass.CCSplitRows()\n--CCSplitRows class will be Deprecated,end\n\n--CCControlStepper class will be Deprecated,begin\nfunction DeprecatedClass.CCControlStepper()\n    deprecatedTip(\"CCControlStepper\",\"cc.ControlStepper\")\n    return cc.ControlStepper\nend\n_G[\"CCControlStepper\"] = DeprecatedClass.CCControlStepper()\n--CCControlStepper class will be Deprecated,end\n\n--CCSprite class will be Deprecated,begin\nfunction DeprecatedClass.CCSprite()\n    deprecatedTip(\"CCSprite\",\"cc.Sprite\")\n    return cc.Sprite\nend\n_G[\"CCSprite\"] = DeprecatedClass.CCSprite()\n--CCSprite class will be Deprecated,end\n\n--CCOrbitCamera class will be Deprecated,begin\nfunction DeprecatedClass.CCOrbitCamera()\n    deprecatedTip(\"CCOrbitCamera\",\"cc.OrbitCamera\")\n    return cc.OrbitCamera\nend\n_G[\"CCOrbitCamera\"] = DeprecatedClass.CCOrbitCamera()\n--CCOrbitCamera class will be Deprecated,end\n\n--CCUserDefault class will be Deprecated,begin\nfunction DeprecatedClass.CCUserDefault()\n    deprecatedTip(\"CCUserDefault\",\"cc.UserDefault\")\n    return cc.UserDefault\nend\n_G[\"CCUserDefault\"] = DeprecatedClass.CCUserDefault()\n--CCUserDefault class will be Deprecated,end\n\n--CCFadeOutUpTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutUpTiles()\n    deprecatedTip(\"CCFadeOutUpTiles\",\"cc.FadeOutUpTiles\")\n    return cc.FadeOutUpTiles\nend\n_G[\"CCFadeOutUpTiles\"] = DeprecatedClass.CCFadeOutUpTiles()\n--CCFadeOutUpTiles class will be Deprecated,end\n\n--CCParticleRain class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleRain()\n    deprecatedTip(\"CCParticleRain\",\"cc.ParticleRain\")\n    return cc.ParticleRain\nend\n_G[\"CCParticleRain\"] = DeprecatedClass.CCParticleRain()\n--CCParticleRain class will be Deprecated,end\n\n--CCWaves class will be Deprecated,begin\nfunction DeprecatedClass.CCWaves()\n    deprecatedTip(\"CCWaves\",\"cc.Waves\")\n    return cc.Waves\nend\n_G[\"CCWaves\"] = DeprecatedClass.CCWaves()\n--CCWaves class will be Deprecated,end\n\n--CCEaseOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseOut()\n    deprecatedTip(\"CCEaseOut\",\"cc.EaseOut\")\n    return cc.EaseOut\nend\n_G[\"CCEaseOut\"] = DeprecatedClass.CCEaseOut()\n--CCEaseOut class will be Deprecated,end\n\n--CCEaseBounceIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounceIn()\n    deprecatedTip(\"CCEaseBounceIn\",\"cc.EaseBounceIn\")\n    return cc.EaseBounceIn\nend\n_G[\"CCEaseBounceIn\"] = DeprecatedClass.CCEaseBounceIn()\n--CCEaseBounceIn class will be Deprecated,end\n\n--CCMenuItemFont class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemFont()\n    deprecatedTip(\"CCMenuItemFont\",\"cc.MenuItemFont\")\n    return cc.MenuItemFont\nend\n_G[\"CCMenuItemFont\"] = DeprecatedClass.CCMenuItemFont()\n--CCMenuItemFont class will be Deprecated,end\n\n--CCEaseSineOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseSineOut()\n    deprecatedTip(\"CCEaseSineOut\",\"cc.EaseSineOut\")\n    return cc.EaseSineOut\nend\n_G[\"CCEaseSineOut\"] = DeprecatedClass.CCEaseSineOut()\n--CCEaseSineOut class will be Deprecated,end\n\n--CCTextureCache class will be Deprecated,begin\nfunction DeprecatedClass.CCTextureCache()\n    deprecatedTip(\"CCTextureCache\",\"cc.TextureCache\")\n    return cc.TextureCache\nend\n_G[\"CCTextureCache\"] = DeprecatedClass.CCTextureCache()\n--CCTextureCache class will be Deprecated,end\n\n--CCTiledGrid3D class will be Deprecated,begin\nfunction DeprecatedClass.CCTiledGrid3D()\n    deprecatedTip(\"CCTiledGrid3D\",\"cc.TiledGrid3D\")\n    return cc.TiledGrid3D\nend\n_G[\"CCTiledGrid3D\"] = DeprecatedClass.CCTiledGrid3D()\n--CCTiledGrid3D class will be Deprecated,end\n\n--CCRemoveSelf class will be Deprecated,begin\nfunction DeprecatedClass.CCRemoveSelf()\n    deprecatedTip(\"CCRemoveSelf\",\"cc.RemoveSelf\")\n    return cc.RemoveSelf\nend\n_G[\"CCRemoveSelf\"] = DeprecatedClass.CCRemoveSelf()\n--CCRemoveSelf class will be Deprecated,end\n\n--CCControlSaturationBrightnessPicker class will be Deprecated,begin\nfunction DeprecatedClass.CCControlSaturationBrightnessPicker()\n    deprecatedTip(\"CCControlSaturationBrightnessPicker\",\"cc.ControlSaturationBrightnessPicker\")\n    return cc.ControlSaturationBrightnessPicker\nend\n_G[\"CCControlSaturationBrightnessPicker\"] = DeprecatedClass.CCControlSaturationBrightnessPicker()\n--CCControlSaturationBrightnessPicker class will be Deprecated,end\n\n--CCLabelTTF class will be Deprecated,begin\nfunction DeprecatedClass.CCLabelTTF()\n    deprecatedTip(\"CCLabelTTF\",\"cc.LabelTTF\")\n    return cc.LabelTTF\nend\n_G[\"CCLabelTTF\"] = DeprecatedClass.CCLabelTTF()\n--CCLabelTTF class will be Deprecated,end\n\n--CCTouch class will be Deprecated,begin\nfunction DeprecatedClass.CCTouch()\n    deprecatedTip(\"CCTouch\",\"cc.Touch\")\n    return cc.Touch\nend\n_G[\"CCTouch\"] = DeprecatedClass.CCTouch()\n--CCTouch class will be Deprecated,end\n\n--CCMoveBy class will be Deprecated,begin\nfunction DeprecatedClass.CCMoveBy()\n    deprecatedTip(\"CCMoveBy\",\"cc.MoveBy\")\n    return cc.MoveBy\nend\n_G[\"CCMoveBy\"] = DeprecatedClass.CCMoveBy()\n--CCMoveBy class will be Deprecated,end\n\n--CCMotionStreak class will be Deprecated,begin\nfunction DeprecatedClass.CCMotionStreak()\n    deprecatedTip(\"CCMotionStreak\",\"cc.MotionStreak\")\n    return cc.MotionStreak\nend\n_G[\"CCMotionStreak\"] = DeprecatedClass.CCMotionStreak()\n--CCMotionStreak class will be Deprecated,end\n\n--CCRotateBy class will be Deprecated,begin\nfunction DeprecatedClass.CCRotateBy()\n    deprecatedTip(\"CCRotateBy\",\"cc.RotateBy\")\n    return cc.RotateBy\nend\n_G[\"CCRotateBy\"] = DeprecatedClass.CCRotateBy()\n--CCRotateBy class will be Deprecated,end\n\n--CCFileUtils class will be Deprecated,begin\nfunction DeprecatedClass.CCFileUtils()\n    deprecatedTip(\"CCFileUtils\",\"cc.FileUtils\")\n    return cc.FileUtils\nend\n_G[\"CCFileUtils\"] = DeprecatedClass.CCFileUtils()\n--CCFileUtils class will be Deprecated,end\n\n--CCBezierBy class will be Deprecated,begin\nfunction DeprecatedClass.CCBezierBy()\n    deprecatedTip(\"CCBezierBy\",\"cc.BezierBy\")\n    return cc.BezierBy\nend\n_G[\"CCBezierBy\"] = DeprecatedClass.CCBezierBy()\n--CCBezierBy class will be Deprecated,end\n\n--CCTransitionFade class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFade()\n    deprecatedTip(\"CCTransitionFade\",\"cc.TransitionFade\")\n    return cc.TransitionFade\nend\n_G[\"CCTransitionFade\"] = DeprecatedClass.CCTransitionFade()\n--CCTransitionFade class will be Deprecated,end\n\n--CCTransitionProgressOutIn class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressOutIn()\n    deprecatedTip(\"CCTransitionProgressOutIn\",\"cc.TransitionProgressOutIn\")\n    return cc.TransitionProgressOutIn\nend\n_G[\"CCTransitionProgressOutIn\"] = DeprecatedClass.CCTransitionProgressOutIn()\n--CCTransitionProgressOutIn class will be Deprecated,end\n\n--CCCatmullRomBy class will be Deprecated,begin\nfunction DeprecatedClass.CCCatmullRomBy()\n    deprecatedTip(\"CCCatmullRomBy\",\"cc.CatmullRomBy\")\n    return cc.CatmullRomBy\nend\n_G[\"CCCatmullRomBy\"] = DeprecatedClass.CCCatmullRomBy()\n--CCCatmullRomBy class will be Deprecated,end\n\n--CCGridAction class will be Deprecated,begin\nfunction DeprecatedClass.CCGridAction()\n    deprecatedTip(\"CCGridAction\",\"cc.GridAction\")\n    return cc.GridAction\nend\n_G[\"CCGridAction\"] = DeprecatedClass.CCGridAction()\n--CCGridAction class will be Deprecated,end\n\n--CCShaky3D class will be Deprecated,begin\nfunction DeprecatedClass.CCShaky3D()\n    deprecatedTip(\"CCShaky3D\",\"cc.Shaky3D\")\n    return cc.Shaky3D\nend\n_G[\"CCShaky3D\"] = DeprecatedClass.CCShaky3D()\n--CCShaky3D class will be Deprecated,end\n\n--CCTransitionEaseScene class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionEaseScene()\n    deprecatedTip(\"CCTransitionEaseScene\",\"cc.TransitionEaseScene\")\n    return cc.TransitionEaseScene\nend\n_G[\"CCTransitionEaseScene\"] = DeprecatedClass.CCTransitionEaseScene()\n--CCTransitionEaseScene class will be Deprecated,end\n\n--CCSequence class will be Deprecated,begin\nfunction DeprecatedClass.CCSequence()\n    deprecatedTip(\"CCSequence\",\"cc.Sequence\")\n    return cc.Sequence\nend\n_G[\"CCSequence\"] = DeprecatedClass.CCSequence()\n--CCSequence class will be Deprecated,end\n\n--CCTransitionFadeUp class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeUp()\n    deprecatedTip(\"CCTransitionFadeUp\",\"cc.TransitionFadeUp\")\n    return cc.TransitionFadeUp\nend\n_G[\"CCTransitionFadeUp\"] = DeprecatedClass.CCTransitionFadeUp()\n--CCTransitionFadeUp class will be Deprecated,end\n\n--CCTransitionProgressRadialCW class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressRadialCW()\n    deprecatedTip(\"CCTransitionProgressRadialCW\",\"cc.TransitionProgressRadialCW\")\n    return cc.TransitionProgressRadialCW\nend\n_G[\"CCTransitionProgressRadialCW\"] = DeprecatedClass.CCTransitionProgressRadialCW()\n--CCTransitionProgressRadialCW class will be Deprecated,end\n\n--CCShuffleTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCShuffleTiles()\n    deprecatedTip(\"CCShuffleTiles\",\"cc.ShuffleTiles\")\n    return cc.ShuffleTiles\nend\n_G[\"CCShuffleTiles\"] = DeprecatedClass.CCShuffleTiles()\n--CCShuffleTiles class will be Deprecated,end\n\n--CCTransitionSlideInR class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInR()\n    deprecatedTip(\"CCTransitionSlideInR\",\"cc.TransitionSlideInR\")\n    return cc.TransitionSlideInR\nend\n_G[\"CCTransitionSlideInR\"] = DeprecatedClass.CCTransitionSlideInR()\n--CCTransitionSlideInR class will be Deprecated,end\n\n--CCScene class will be Deprecated,begin\nfunction DeprecatedClass.CCScene()\n    deprecatedTip(\"CCScene\",\"cc.Scene\")\n    return cc.Scene\nend\n_G[\"CCScene\"] = DeprecatedClass.CCScene()\n--CCScene class will be Deprecated,end\n\n--CCParallaxNode class will be Deprecated,begin\nfunction DeprecatedClass.CCParallaxNode()\n    deprecatedTip(\"CCParallaxNode\",\"cc.ParallaxNode\")\n    return cc.ParallaxNode\nend\n_G[\"CCParallaxNode\"] = DeprecatedClass.CCParallaxNode()\n--CCParallaxNode class will be Deprecated,end\n\n--CCTransitionSlideInL class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInL()\n    deprecatedTip(\"CCTransitionSlideInL\",\"cc.TransitionSlideInL\")\n    return cc.TransitionSlideInL\nend\n_G[\"CCTransitionSlideInL\"] = DeprecatedClass.CCTransitionSlideInL()\n--CCTransitionSlideInL class will be Deprecated,end\n\n--CCControlSwitch class will be Deprecated,begin\nfunction DeprecatedClass.CCControlSwitch()\n    deprecatedTip(\"CCControlSwitch\",\"cc.ControlSwitch\")\n    return cc.ControlSwitch\nend\n_G[\"CCControlSwitch\"] = DeprecatedClass.CCControlSwitch()\n--CCControlSwitch class will be Deprecated,end\n\n--CCWavesTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCWavesTiles3D()\n    deprecatedTip(\"CCWavesTiles3D\",\"cc.WavesTiles3D\")\n    return cc.WavesTiles3D\nend\n_G[\"CCWavesTiles3D\"] = DeprecatedClass.CCWavesTiles3D()\n--CCWavesTiles3D class will be Deprecated,end\n\n--CCTransitionSlideInB class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInB()\n    deprecatedTip(\"CCTransitionSlideInB\",\"cc.TransitionSlideInB\")\n    return cc.TransitionSlideInB\nend\n_G[\"CCTransitionSlideInB\"] = DeprecatedClass.CCTransitionSlideInB()\n--CCTransitionSlideInB class will be Deprecated,end\n\n--CCSpeed class will be Deprecated,begin\nfunction DeprecatedClass.CCSpeed()\n    deprecatedTip(\"CCSpeed\",\"cc.Speed\")\n    return cc.Speed\nend\n_G[\"CCSpeed\"] = DeprecatedClass.CCSpeed()\n--CCSpeed class will be Deprecated,end\n\n--CCShatteredTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCShatteredTiles3D()\n    deprecatedTip(\"CCShatteredTiles3D\",\"cc.ShatteredTiles3D\")\n    return cc.ShatteredTiles3D\nend\n_G[\"CCShatteredTiles3D\"] = DeprecatedClass.CCShatteredTiles3D()\n--CCShatteredTiles3D class will be Deprecated,end\n\n--CCCallFuncN class will be Deprecated,begin\nfunction DeprecatedClass.CCCallFuncN()\n    deprecatedTip(\"CCCallFuncN\",\"cc.CallFunc\")\n    return cc.CallFunc\nend\n_G[\"CCCallFuncN\"] = DeprecatedClass.CCCallFuncN()\n--CCCallFuncN class will be Deprecated,end\n\n--CCArmature class will be Deprecated,begin\nfunction DeprecatedClass.CCArmature()\n    deprecatedTip(\"CCArmature\",\"ccs.Armature\")\n    return ccs.Armature\nend\n_G[\"CCArmature\"] = DeprecatedClass.CCArmature()\n--CCArmature class will be Deprecated,end\n\n--CCArmatureAnimation class will be Deprecated,begin\nfunction DeprecatedClass.CCArmatureAnimation()\n    deprecatedTip(\"CCArmatureAnimation\",\"ccs.ArmatureAnimation\")\n    return ccs.ArmatureAnimation\nend\n_G[\"CCArmatureAnimation\"] = DeprecatedClass.CCArmatureAnimation()\n--CCArmatureAnimation class will be Deprecated,end\n\n--CCSkin class will be Deprecated,begin\nfunction DeprecatedClass.CCSkin()\n    deprecatedTip(\"CCSkin\",\"ccs.Skin\")\n    return ccs.Skin\nend\n_G[\"CCSkin\"] = DeprecatedClass.CCSkin()\n--CCSkin class will be Deprecated,end\n\n--CCBone class will be Deprecated,begin\nfunction DeprecatedClass.CCBone()\n    deprecatedTip(\"CCBone\",\"ccs.Bone\")\n    return ccs.Bone\nend\n_G[\"CCBone\"] = DeprecatedClass.CCBone()\n--CCBone class will be Deprecated,end\n\n--CCArmatureDataManager class will be Deprecated,begin\nfunction DeprecatedClass.CCArmatureDataManager()\n    deprecatedTip(\"CCArmatureDataManager\",\"ccs.ArmatureDataManager\")\n    return ccs.ArmatureDataManager\nend\n_G[\"CCArmatureDataManager\"] = DeprecatedClass.CCArmatureDataManager()\n--CCArmatureDataManager class will be Deprecated,end\n\n--CCBatchNode class will be Deprecated,begin\nfunction DeprecatedClass.CCBatchNode()\n    deprecatedTip(\"CCBatchNode\",\"ccs.BatchNode\")\n    return ccs.BatchNode\nend\n_G[\"CCBatchNode\"] = DeprecatedClass.CCBatchNode()\n--CCBatchNode class will be Deprecated,end\n\n--CCTween class will be Deprecated,begin\nfunction DeprecatedClass.CCTween()\n    deprecatedTip(\"CCTween\",\"ccs.Tween\")\n    return ccs.Tween\nend\n_G[\"CCTween\"] = DeprecatedClass.CCTween()\n--CCTween class will be Deprecated,end\n\n--CCBaseData class will be Deprecated,begin\nfunction DeprecatedClass.CCBaseData()\n    deprecatedTip(\"CCBaseData\",\"ccs.BaseData\")\n    return ccs.BaseData\nend\n_G[\"CCBaseData\"] = DeprecatedClass.CCBaseData()\n--CCBaseData class will be Deprecated,end\n\n--CCDisplayManager class will be Deprecated,begin\nfunction DeprecatedClass.CCDisplayManager()\n    deprecatedTip(\"CCDisplayManager\",\"ccs.DisplayManager\")\n    return ccs.DisplayManager\nend\n_G[\"CCDisplayManager\"] = DeprecatedClass.CCDisplayManager()\n--CCDisplayManager class will be Deprecated,end\n\n--UIHelper class will be Deprecated,begin\nfunction DeprecatedClass.UIHelper()\n    deprecatedTip(\"UIHelper\",\"ccs.UIHelper\")\n    return ccs.UIHelper\nend\n_G[\"UIHelper\"] = DeprecatedClass.UIHelper()\n--UIHelper class will be Deprecated,end\n\n--UILayout class will be Deprecated,begin\nfunction DeprecatedClass.UILayout()\n    deprecatedTip(\"UILayout\",\"ccs.UILayout\")\n    return ccs.UILayout\nend\n_G[\"UILayout\"] = DeprecatedClass.UILayout()\n--UILayout class will be Deprecated,end\n\n--UIWidget class will be Deprecated,begin\nfunction DeprecatedClass.UIWidget()\n    deprecatedTip(\"UIWidget\",\"ccs.UIWidget\")\n    return ccs.UIWidget\nend\n_G[\"UIWidget\"] = DeprecatedClass.UIWidget()\n--UIWidget class will be Deprecated,end\n\n--UILayer class will be Deprecated,begin\nfunction DeprecatedClass.UILayer()\n    deprecatedTip(\"UILayer\",\"ccs.UILayer\")\n    return ccs.UILayer\nend\n_G[\"UILayer\"] = DeprecatedClass.UILayer()\n--UILayer class will be Deprecated,end\n\n--UIButton class will be Deprecated,begin\nfunction DeprecatedClass.UIButton()\n    deprecatedTip(\"UIButton\",\"ccs.UIButton\")\n    return ccs.UIButton\nend\n_G[\"UIButton\"] = DeprecatedClass.UIButton()\n--UIButton class will be Deprecated,end\n\n--UICheckBox class will be Deprecated,begin\nfunction DeprecatedClass.UICheckBox()\n    deprecatedTip(\"UICheckBox\",\"ccs.UICheckBox\")\n    return ccs.UICheckBox\nend\n_G[\"UICheckBox\"] = DeprecatedClass.UICheckBox()\n--UICheckBox class will be Deprecated,end\n\n--UIImageView class will be Deprecated,begin\nfunction DeprecatedClass.UIImageView()\n    deprecatedTip(\"UIImageView\",\"ccs.UIImageView\")\n    return ccs.UIImageView\nend\n_G[\"UIImageView\"] = DeprecatedClass.UIImageView()\n--UIImageView class will be Deprecated,end\n\n--UILabel class will be Deprecated,begin\nfunction DeprecatedClass.UILabel()\n    deprecatedTip(\"UILabel\",\"ccs.UILabel\")\n    return ccs.UILabel\nend\n_G[\"UILabel\"] = DeprecatedClass.UILabel()\n--UILabel class will be Deprecated,end\n\n--UILabelAtlas class will be Deprecated,begin\nfunction DeprecatedClass.UILabelAtlas()\n    deprecatedTip(\"UILabelAtlas\",\"ccs.UILabelAtlas\")\n    return ccs.UILabelAtlas\nend\n_G[\"UILabelAtlas\"] = DeprecatedClass.UILabelAtlas()\n--UILabelAtlas class will be Deprecated,end\n\n--UILabelBMFont class will be Deprecated,begin\nfunction DeprecatedClass.UILabelBMFont()\n    deprecatedTip(\"UILabelBMFont\",\"ccs.UILabelBMFont\")\n    return ccs.UILabelBMFont\nend\n_G[\"UILabelBMFont\"] = DeprecatedClass.UILabelBMFont()\n--UILabelBMFont class will be Deprecated,end\n\n--UILoadingBar class will be Deprecated,begin\nfunction DeprecatedClass.UILoadingBar()\n    deprecatedTip(\"UILoadingBar\",\"ccs.UILoadingBar\")\n    return ccs.UILoadingBar\nend\n_G[\"UILoadingBar\"] = DeprecatedClass.UILoadingBar()\n--UILoadingBar class will be Deprecated,end\n\n--UISlider class will be Deprecated,begin\nfunction DeprecatedClass.UISlider()\n    deprecatedTip(\"UISlider\",\"ccs.UISlider\")\n    return ccs.UISlider\nend\n_G[\"UISlider\"] = DeprecatedClass.UISlider()\n--UISlider class will be Deprecated,end\n\n--UITextField class will be Deprecated,begin\nfunction DeprecatedClass.UITextField()\n    deprecatedTip(\"UITextField\",\"ccs.UITextField\")\n    return ccs.UITextField\nend\n_G[\"UITextField\"] = DeprecatedClass.UITextField()\n--UITextField class will be Deprecated,end\n\n--UIScrollView class will be Deprecated,begin\nfunction DeprecatedClass.UIScrollView()\n    deprecatedTip(\"UIScrollView\",\"ccs.UIScrollView\")\n    return ccs.UIScrollView\nend\n_G[\"UIScrollView\"] = DeprecatedClass.UIScrollView()\n--UIScrollView class will be Deprecated,end\n\n--UIPageView class will be Deprecated,begin\nfunction DeprecatedClass.UIPageView()\n    deprecatedTip(\"UIPageView\",\"ccs.UIPageView\")\n    return ccs.UIPageView\nend\n_G[\"UIPageView\"] = DeprecatedClass.UIPageView()\n--UIPageView class will be Deprecated,end\n\n--UIListView class will be Deprecated,begin\nfunction DeprecatedClass.UIListView()\n    deprecatedTip(\"UIListView\",\"ccs.UIListView\")\n    return ccs.UIListView\nend\n_G[\"UIListView\"] = DeprecatedClass.UIListView()\n--UIListView class will be Deprecated,end\n\n--UILayoutParameter class will be Deprecated,begin\nfunction DeprecatedClass.UILayoutParameter()\n    deprecatedTip(\"UILayoutParameter\",\"ccs.UILayoutParameter\")\n    return ccs.UILayoutParameter\nend\n_G[\"UILayoutParameter\"] = DeprecatedClass.UILayoutParameter()\n--UILayoutParameter class will be Deprecated,end\n\n--UILinearLayoutParameter class will be Deprecated,begin\nfunction DeprecatedClass.UILinearLayoutParameter()\n    deprecatedTip(\"UILinearLayoutParameter\",\"ccs.UILinearLayoutParameter\")\n    return ccs.UILinearLayoutParameter\nend\n_G[\"UILinearLayoutParameter\"] = DeprecatedClass.UILinearLayoutParameter()\n--UILinearLayoutParameter class will be Deprecated,end\n\n--UIRelativeLayoutParameter class will be Deprecated,begin\nfunction DeprecatedClass.UIRelativeLayoutParameter()\n    deprecatedTip(\"UIRelativeLayoutParameter\",\"ccs.UIRelativeLayoutParameter\")\n    return ccs.UIRelativeLayoutParameter\nend\n_G[\"UIRelativeLayoutParameter\"] = DeprecatedClass.UIRelativeLayoutParameter()\n--UIRelativeLayoutParameter class will be Deprecated,end\n\n--CCComController class will be Deprecated,begin\nfunction DeprecatedClass.CCComController()\n    deprecatedTip(\"CCComController\",\"ccs.ComController\")\n    return ccs.CCComController\nend\n_G[\"CCComController\"] = DeprecatedClass.CCComController()\n--CCComController class will be Deprecated,end\n\n--CCComAudio class will be Deprecated,begin\nfunction DeprecatedClass.CCComAudio()\n    deprecatedTip(\"CCComAudio\",\"ccs.ComAudio\")\n    return ccs.ComAudio\nend\n_G[\"CCComAudio\"] = DeprecatedClass.CCComAudio()\n--CCComAudio class will be Deprecated,end\n\n--CCComAttribute class will be Deprecated,begin\nfunction DeprecatedClass.CCComAttribute()\n    deprecatedTip(\"CCComAttribute\",\"ccs.ComAttribute\")\n    return ccs.ComAttribute\nend\n_G[\"CCComAttribute\"] = DeprecatedClass.CCComAttribute()\n--CCComAttribute class will be Deprecated,end\n\n--CCComRender class will be Deprecated,begin\nfunction DeprecatedClass.CCComRender()\n    deprecatedTip(\"CCComRender\",\"ccs.ComRender\")\n    return ccs.ComRender\nend\n_G[\"CCComRender\"] = DeprecatedClass.CCComRender()\n--CCComRender class will be Deprecated,end\n\n--ActionManager class will be Deprecated,begin\nfunction DeprecatedClass.ActionManager()\n    deprecatedTip(\"ActionManager\",\"ccs.ActionManagerEx\")\n    return ccs.ActionManagerEx\nend\n_G[\"ActionManager\"] = DeprecatedClass.ActionManager()\n--CCComRender class will be Deprecated,end\n\n--SceneReader class will be Deprecated,begin\nfunction DeprecatedClass.SceneReader()\n    deprecatedTip(\"SceneReader\",\"ccs.SceneReader\")\n    return ccs.SceneReader\nend\n_G[\"SceneReader\"] = DeprecatedClass.SceneReader()\n--SceneReader class will be Deprecated,end\n\n--GUIReader class will be Deprecated,begin\nfunction DeprecatedClass.GUIReader()\n    deprecatedTip(\"GUIReader\",\"ccs.GUIReader\")\n    return ccs.GUIReader\nend\n_G[\"GUIReader\"] = DeprecatedClass.GUIReader()\n--GUIReader class will be Deprecated,end\n\n--UIRootWidget class will be Deprecated,begin\nfunction DeprecatedClass.UIRootWidget()\n    deprecatedTip(\"UIRootWidget\",\"ccs.UIRootWidget\")\n    return ccs.UIRootWidget\nend\n_G[\"UIRootWidget\"] = DeprecatedClass.UIRootWidget()\n--UIRootWidget class will be Deprecated,end\n\n--ActionObject class will be Deprecated,begin\nfunction DeprecatedClass.ActionObject()\n    deprecatedTip(\"ActionObject\",\"ccs.ActionObject\")\n    return ccs.ActionObject\nend\n_G[\"ActionObject\"] = DeprecatedClass.ActionObject()\n--ActionObject class will be Deprecated,end\n\n--CCEGLViewProtocol class will be Deprecated,begin\nfunction DeprecatedClass.CCEGLViewProtocol()\n    deprecatedTip(\"CCEGLViewProtocol\",\"cc.EGLViewProtocol\")\n    return cc.EGLViewProtocol\nend\n_G[\"CCEGLViewProtocol\"] = DeprecatedClass.CCEGLViewProtocol()\n--CCEGLViewProtocol class will be Deprecated,end\n\n--CCEGLView class will be Deprecated,begin\nfunction DeprecatedClass.CCEGLView()\n    deprecatedTip(\"CCEGLView\",\"cc.EGLView\")\n    return cc.EGLView\nend\n_G[\"CCEGLView\"] = DeprecatedClass.CCEGLView()\n--CCEGLView class will be Deprecated,end\n\n--CCBProxy class will be Deprecated,begin\nfunction DeprecatedClass.CCBProxy()\n    deprecatedTip(\"CCBProxy\",\"cc.CCBProxy\")\n    return cc.CCBProxy\nend\n_G[\"CCBProxy\"] = DeprecatedClass.CCBProxy()\n--CCBProxy class will be Deprecated,end\n\n--WebSocket class will be Deprecated,begin\nfunction DeprecatedClass.WebSocket()\n    deprecatedTip(\"WebSocket\",\"cc.WebSocket\")\n    return cc.WebSocket\nend\n_G[\"WebSocket\"] = DeprecatedClass.WebSocket()\n--WebSocket class will be Deprecated,end\n\n--XMLHttpRequest class will be Deprecated,begin\nfunction DeprecatedClass.XMLHttpRequest()\n    deprecatedTip(\"XMLHttpRequest\",\"cc.XMLHttpRequest\")\n    return cc.XMLHttpRequest\nend\n_G[\"XMLHttpRequest\"] = DeprecatedClass.XMLHttpRequest()\n--XMLHttpRequest class will be Deprecated,end\n\n\n"
  },
  {
    "path": "Resources/DeprecatedEnum.lua",
    "content": "require \"Cocos2dConstants.lua\"\nrequire \"OpenglConstants.lua\"\nrequire \"StudioConstants.lua\"\n--Enums will be deprecated,begin\n_G.kCCTextAlignmentLeft              = cc.TEXT_ALIGNMENT_LEFT\n_G.kCCTextAlignmentRight             = cc.TEXT_ALIGNMENT_RIGHT\n_G.kCCTextAlignmentCenter            = cc.TEXT_ALIGNMENT_CENTER\n_G.kCCVerticalTextAlignmentTop       = cc.VERTICAL_TEXT_ALIGNMENT_TOP\n_G.kCCVerticalTextAlignmentCenter    = cc.VERTICAL_TEXT_ALIGNMENT_CENTER    \n_G.kCCVerticalTextAlignmentBottom    = cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM\n_G.kCCDirectorProjection3D           = cc.DIRECTOR_PROJECTION3_D \n_G.kCCDirectorProjection2D           = cc.DIRECTOR_PROJECTION2_D\n_G.kCCDirectorProjectionCustom       = cc.DIRECTOR_PROJECTION_CUSTOM\n_G.kCCDirectorProjectionDefault      = cc.DIRECTOR_PROJECTION_DEFAULT\n_G.kCCNodeTagInvalid                 = cc.NODE_TAG_INVALID\n_G.kCCNodeOnEnter                    = cc.NODE_ON_ENTER\n_G.kCCNodeOnExit                     = cc.NODE_ON_EXIT\n_G.kCCTexture2DPixelFormat_RGBA8888  = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888\n_G.kCCTexture2DPixelFormat_RGB888    = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B888\n_G.kCCTexture2DPixelFormat_RGB565    = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B565\n_G.kCCTexture2DPixelFormat_A8        = cc.TEXTURE2_D_PIXEL_FORMAT_A8\n_G.kCCTexture2DPixelFormat_I8        = cc.TEXTURE2_D_PIXEL_FORMAT_I8 \n_G.kCCTexture2DPixelFormat_AI88      = cc.TEXTURE2_D_PIXEL_FORMAT_A_I88\n_G.kCCTexture2DPixelFormat_RGBA4444  = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444 \n_G.kCCTexture2DPixelFormat_RGB5A1    = cc.TEXTURE2_D_PIXEL_FORMAT_RGB5_A1 \n_G.kCCTexture2DPixelFormat_PVRTC4    = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4\n_G.kCCTexture2DPixelFormat_PVRTC2    = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2\n_G.kCCTexture2DPixelFormat_Default   = cc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT\n_G.kCCImageFormatPNG                 = cc.IMAGE_FORMAT_PNG \n_G.kCCImageFormatJPEG                = cc.IMAGE_FORMAT_JPEG\n_G.kCCTouchesOneByOne                = cc.TOUCHES_ONE_BY_ONE\n_G.kCCTouchesAllAtOnce               = cc.TOUCHES_ALL_AT_ONCE\n_G.kCCTransitionOrientationLeftOver  = cc.TRANSITION_ORIENTATION_LEFT_OVER\n_G.kCCTransitionOrientationRightOver = cc.TRANSITION_ORIENTATION_RIGHT_OVER\n_G.kCCTransitionOrientationUpOver    = cc.TRANSITION_ORIENTATION_UP_OVER\n_G.kCCTransitionOrientationDownOver  = cc.TRANSITION_ORIENTATION_DOWN_OVER\n_G.kCCActionTagInvalid               = cc.ACTION_TAG_INVALID\n_G.kCCLabelAutomaticWidth            = cc.LABEL_AUTOMATIC_WIDTH\n_G.kCCMenuStateWaiting               = cc.MENU_STATE_WAITING \n_G.kCCMenuStateTrackingTouch         = cc.MENU_STATE_TRACKING_TOUCH\n_G.kCCMenuHandlerPriority            = cc.MENU_HANDLER_PRIORITY\n_G.kCCParticleDurationInfinity       = cc.PARTICLE_DURATION_INFINITY \n_G.kCCParticleStartSizeEqualToEndSize = cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE \n_G.kCCParticleStartRadiusEqualToEndRadius = cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS\n_G.kCCParticleModeGravity            = cc.PARTICLE_MODE_GRAVITY\n_G.kCCParticleModeRadius             = cc.PARTICLE_MODE_RADIUS\n_G.kCCPositionTypeFree               = cc.POSITION_TYPE_FREE \n_G.kCCPositionTypeRelative           = cc.POSITION_TYPE_RELATIVE\n_G.kCCPositionTypeGrouped            = cc.POSITION_TYPE_GROUPED\n_G.kCCProgressTimerTypeRadial        = cc.PROGRESS_TIMER_TYPE_RADIAL \n_G.kCCProgressTimerTypeBar           = cc.PROGRESS_TIMER_TYPE_BAR\n_G.kCCTMXTileHorizontalFlag          = cc.TMX_TILE_HORIZONTAL_FLAG\n_G.kCCTMXTileVerticalFlag            = cc.TMX_TILE_VERTICAL_FLAG\n_G.kCCTMXTileDiagonalFlag            = cc.TMX_TILE_DIAGONAL_FLAG\n_G.kCCFlipedAll                      = cc.FLIPED_ALL\n_G.kCCFlippedMask                    = cc.FLIPPED_MASK\n_G.kCCControlStepperPartMinus        = cc.CONTROL_STEPPER_PART_MINUS\n_G.kCCControlStepperPartPlus         = cc.CONTROL_STEPPER_PART_PLUS\n_G.kCCControlStepperPartNone         = cc.CONTROL_STEPPER_PART_NONE\n\n_G.kLanguageEnglish  = cc.LANGUAGE_ENGLISH \n_G.kLanguageChinese  = cc.LANGUAGE_CHINESE \n_G.kLanguageFrench   = cc.LANGUAGE_FRENCH \n_G.kLanguageItalian  = cc.LANGUAGE_ITALIAN\n_G.kLanguageGerman   = cc.LANGUAGE_GERMAN\n_G.kLanguageSpanish  = cc.LANGUAGE_SPANISH\n_G.kLanguageRussian  = cc.LANGUAGE_RUSSIAN\n_G.kLanguageKorean   = cc.LANGUAGE_KOREAN\n_G.kLanguageJapanese = cc.LANGUAGE_JAPANESE\n_G.kLanguageHungarian = cc.LANGUAGE_HUNGARIAN\n_G.kLanguagePortuguese = cc.LANGUAGE_PORTUGUESE\n_G.kLanguageArabic     = cc.LANGUAGE_ARABIC\n_G.kTargetWindows      = cc.PLATFORM_OS_WINDOWS\n_G.kTargetLinux        = cc.PLATFORM_OS_LINUX \n_G.kTargetMacOS        = cc.PLATFORM_OS_MAC\n_G.kTargetAndroid      = cc.PLATFORM_OS_ANDROID\n_G.kTargetIphone       = cc.PLATFORM_OS_IPHONE\n_G.kTargetIpad         = cc.PLATFORM_OS_IPAD \n_G.kTargetBlackBerry   = cc.PLATFORM_OS_BLACKBERRY\n\n_G.GL_ZERO                           = gl.ZERO\n_G.GL_ONE                            = gl.ONE\n_G.GL_SRC_COLOR                      = gl.SRC_COLOR\n_G.GL_ONE_MINUS_SRC_COLOR            = gl.ONE_MINUS_SRC_COLOR \n_G.GL_SRC_ALPHA                      = gl.SRC_ALPHA \n_G.GL_ONE_MINUS_SRC_ALPHA            = gl.ONE_MINUS_SRC_ALPHA\n_G.GL_DST_ALPHA                      = gl.DST_ALPHA\n_G.GL_ONE_MINUS_DST_ALPHA            = gl.ONE_MINUS_DST_ALPHA \n_G.GL_DST_COLOR                      = gl.DST_COLOR\n_G.GL_ONE_MINUS_DST_COLOR            = gl.ONE_MINUS_DST_COLOR\n_G.GL_RENDERBUFFER_INTERNAL_FORMAT = gl.RENDERBUFFER_INTERNAL_FORMAT\n_G.GL_LINE_WIDTH = gl.LINE_WIDTH\n_G.GL_CONSTANT_ALPHA = gl.CONSTANT_ALPHA\n_G.GL_BLEND_SRC_ALPHA = gl.BLEND_SRC_ALPHA\n_G.GL_GREEN_BITS = gl.GREEN_BITS\n_G.GL_STENCIL_REF = gl.STENCIL_REF\n_G.GL_ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\n_G.GL_CCW = gl.CCW\n_G.GL_MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS\n_G.GL_BACK = gl.BACK\n_G.GL_ACTIVE_ATTRIBUTES = gl.ACTIVE_ATTRIBUTES\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_X = gl.TEXTURE_CUBE_MAP_POSITIVE_X\n_G.GL_STENCIL_BACK_VALUE_MASK = gl.STENCIL_BACK_VALUE_MASK\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Z = gl.TEXTURE_CUBE_MAP_POSITIVE_Z\n_G.GL_ONE = gl.ONE\n_G.GL_TRUE = gl.TRUE\n_G.GL_TEXTURE12 = gl.TEXTURE12\n_G.GL_LINK_STATUS = gl.LINK_STATUS\n_G.GL_BLEND = gl.BLEND\n_G.GL_LESS = gl.LESS\n_G.GL_TEXTURE16 = gl.TEXTURE16\n_G.GL_BOOL_VEC2 = gl.BOOL_VEC2\n_G.GL_KEEP = gl.KEEP\n_G.GL_DST_COLOR = gl.DST_COLOR\n_G.GL_VERTEX_ATTRIB_ARRAY_ENABLED = gl.VERTEX_ATTRIB_ARRAY_ENABLED\n_G.GL_EXTENSIONS = gl.EXTENSIONS\n_G.GL_FRONT = gl.FRONT\n_G.GL_DST_ALPHA = gl.DST_ALPHA\n_G.GL_ATTACHED_SHADERS = gl.ATTACHED_SHADERS\n_G.GL_STENCIL_BACK_FUNC = gl.STENCIL_BACK_FUNC\n_G.GL_ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR\n_G.GL_BLEND_EQUATION = gl.BLEND_EQUATION\n_G.GL_RENDERBUFFER_DEPTH_SIZE = gl.RENDERBUFFER_DEPTH_SIZE\n_G.GL_PACK_ALIGNMENT = gl.PACK_ALIGNMENT\n_G.GL_VENDOR = gl.VENDOR\n_G.GL_NEAREST_MIPMAP_LINEAR = gl.NEAREST_MIPMAP_LINEAR\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Y = gl.TEXTURE_CUBE_MAP_POSITIVE_Y\n_G.GL_NEAREST = gl.NEAREST\n_G.GL_RENDERBUFFER_WIDTH = gl.RENDERBUFFER_WIDTH\n_G.GL_ARRAY_BUFFER_BINDING = gl.ARRAY_BUFFER_BINDING\n_G.GL_ARRAY_BUFFER = gl.ARRAY_BUFFER\n_G.GL_LEQUAL = gl.LEQUAL\n_G.GL_VERSION = gl.VERSION\n_G.GL_COLOR_CLEAR_VALUE = gl.COLOR_CLEAR_VALUE\n_G.GL_RENDERER = gl.RENDERER\n_G.GL_STENCIL_BACK_PASS_DEPTH_PASS = gl.STENCIL_BACK_PASS_DEPTH_PASS\n_G.GL_STENCIL_BACK_PASS_DEPTH_FAIL = gl.STENCIL_BACK_PASS_DEPTH_FAIL\n_G.GL_STENCIL_BACK_WRITEMASK = gl.STENCIL_BACK_WRITEMASK\n_G.GL_BOOL = gl.BOOL\n_G.GL_VIEWPORT = gl.VIEWPORT\n_G.GL_FRAGMENT_SHADER = gl.FRAGMENT_SHADER\n_G.GL_LUMINANCE = gl.LUMINANCE\n_G.GL_DECR_WRAP = gl.DECR_WRAP\n_G.GL_FUNC_ADD = gl.FUNC_ADD\n_G.GL_ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA\n_G.GL_OUT_OF_MEMORY = gl.OUT_OF_MEMORY\n_G.GL_BOOL_VEC4 = gl.BOOL_VEC4\n_G.GL_POLYGON_OFFSET_FACTOR = gl.POLYGON_OFFSET_FACTOR\n_G.GL_STATIC_DRAW = gl.STATIC_DRAW\n_G.GL_DITHER = gl.DITHER\n_G.GL_TEXTURE31 = gl.TEXTURE31\n_G.GL_TEXTURE30 = gl.TEXTURE30\n_G.GL_UNSIGNED_BYTE = gl.UNSIGNED_BYTE\n_G.GL_DEPTH_COMPONENT16 = gl.DEPTH_COMPONENT16\n_G.GL_TEXTURE23 = gl.TEXTURE23\n_G.GL_DEPTH_TEST = gl.DEPTH_TEST\n_G.GL_STENCIL_PASS_DEPTH_FAIL = gl.STENCIL_PASS_DEPTH_FAIL\n_G.GL_BOOL_VEC3 = gl.BOOL_VEC3\n_G.GL_POLYGON_OFFSET_UNITS = gl.POLYGON_OFFSET_UNITS\n_G.GL_TEXTURE_BINDING_2D = gl.TEXTURE_BINDING_2D\n_G.GL_TEXTURE21 = gl.TEXTURE21\n_G.GL_UNPACK_ALIGNMENT = gl.UNPACK_ALIGNMENT\n_G.GL_DONT_CARE = gl.DONT_CARE\n_G.GL_BUFFER_SIZE = gl.BUFFER_SIZE\n_G.GL_FLOAT_MAT3 = gl.FLOAT_MAT3\n_G.GL_UNSIGNED_SHORT_5_6_5 = gl.UNSIGNED_SHORT_5_6_5\n_G.GL_INT_VEC2 = gl.INT_VEC2\n_G.GL_UNSIGNED_SHORT_4_4_4_4 = gl.UNSIGNED_SHORT_4_4_4_4\n_G.GL_NONE = gl.NONE\n_G.GL_BLEND_DST_ALPHA = gl.BLEND_DST_ALPHA\n_G.GL_VERTEX_ATTRIB_ARRAY_SIZE = gl.VERTEX_ATTRIB_ARRAY_SIZE\n_G.GL_SRC_COLOR = gl.SRC_COLOR\n_G.GL_COMPRESSED_TEXTURE_FORMATS = gl.COMPRESSED_TEXTURE_FORMATS\n_G.GL_STENCIL_ATTACHMENT = gl.STENCIL_ATTACHMENT\n_G.GL_MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS\n_G.GL_NUM_COMPRESSED_TEXTURE_FORMATS = gl.NUM_COMPRESSED_TEXTURE_FORMATS\n_G.GL_BLEND_EQUATION_RGB = gl.BLEND_EQUATION_RGB\n_G.GL_TEXTURE = gl.TEXTURE\n_G.GL_LINEAR_MIPMAP_LINEAR = gl.LINEAR_MIPMAP_LINEAR\n_G.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\n_G.GL_CURRENT_PROGRAM = gl.CURRENT_PROGRAM\n_G.GL_COLOR_BUFFER_BIT = gl.COLOR_BUFFER_BIT\n_G.GL_TEXTURE20 = gl.TEXTURE20\n_G.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = gl.ACTIVE_ATTRIBUTE_MAX_LENGTH\n_G.GL_TEXTURE28 = gl.TEXTURE28\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\n_G.GL_TEXTURE22 = gl.TEXTURE22\n_G.GL_ELEMENT_ARRAY_BUFFER_BINDING = gl.ELEMENT_ARRAY_BUFFER_BINDING\n_G.GL_STREAM_DRAW = gl.STREAM_DRAW\n_G.GL_SCISSOR_BOX = gl.SCISSOR_BOX\n_G.GL_TEXTURE26 = gl.TEXTURE26\n_G.GL_TEXTURE27 = gl.TEXTURE27\n_G.GL_TEXTURE24 = gl.TEXTURE24\n_G.GL_TEXTURE25 = gl.TEXTURE25\n_G.GL_NO_ERROR = gl.NO_ERROR\n_G.GL_TEXTURE29 = gl.TEXTURE29\n_G.GL_FLOAT_MAT4 = gl.FLOAT_MAT4\n_G.GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = gl.VERTEX_ATTRIB_ARRAY_NORMALIZED\n_G.GL_SAMPLE_COVERAGE_INVERT = gl.SAMPLE_COVERAGE_INVERT\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\n_G.GL_FLOAT_VEC3 = gl.FLOAT_VEC3\n_G.GL_STENCIL_CLEAR_VALUE = gl.STENCIL_CLEAR_VALUE\n_G.GL_UNSIGNED_SHORT_5_5_5_1 = gl.UNSIGNED_SHORT_5_5_5_1\n_G.GL_ACTIVE_UNIFORMS = gl.ACTIVE_UNIFORMS\n_G.GL_INVALID_OPERATION = gl.INVALID_OPERATION\n_G.GL_DEPTH_ATTACHMENT = gl.DEPTH_ATTACHMENT\n_G.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS\n_G.GL_FRAMEBUFFER_COMPLETE = gl.FRAMEBUFFER_COMPLETE\n_G.GL_ONE_MINUS_CONSTANT_COLOR = gl.ONE_MINUS_CONSTANT_COLOR\n_G.GL_TEXTURE2 = gl.TEXTURE2\n_G.GL_TEXTURE1 = gl.TEXTURE1\n_G.GL_GEQUAL = gl.GEQUAL\n_G.GL_TEXTURE7 = gl.TEXTURE7\n_G.GL_TEXTURE6 = gl.TEXTURE6\n_G.GL_TEXTURE5 = gl.TEXTURE5\n_G.GL_TEXTURE4 = gl.TEXTURE4\n_G.GL_GENERATE_MIPMAP_HINT = gl.GENERATE_MIPMAP_HINT\n_G.GL_ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR\n_G.GL_TEXTURE9 = gl.TEXTURE9\n_G.GL_STENCIL_TEST = gl.STENCIL_TEST\n_G.GL_COLOR_WRITEMASK = gl.COLOR_WRITEMASK\n_G.GL_DEPTH_COMPONENT = gl.DEPTH_COMPONENT\n_G.GL_STENCIL_INDEX8 = gl.STENCIL_INDEX8\n_G.GL_VERTEX_ATTRIB_ARRAY_TYPE = gl.VERTEX_ATTRIB_ARRAY_TYPE\n_G.GL_FLOAT_VEC2 = gl.FLOAT_VEC2\n_G.GL_BLUE_BITS = gl.BLUE_BITS\n_G.GL_VERTEX_SHADER = gl.VERTEX_SHADER\n_G.GL_SUBPIXEL_BITS = gl.SUBPIXEL_BITS\n_G.GL_STENCIL_WRITEMASK = gl.STENCIL_WRITEMASK\n_G.GL_FLOAT_VEC4 = gl.FLOAT_VEC4\n_G.GL_TEXTURE17 = gl.TEXTURE17\n_G.GL_ONE_MINUS_CONSTANT_ALPHA = gl.ONE_MINUS_CONSTANT_ALPHA\n_G.GL_TEXTURE15 = gl.TEXTURE15\n_G.GL_TEXTURE14 = gl.TEXTURE14\n_G.GL_TEXTURE13 = gl.TEXTURE13\n_G.GL_SAMPLES = gl.SAMPLES\n_G.GL_TEXTURE11 = gl.TEXTURE11\n_G.GL_TEXTURE10 = gl.TEXTURE10\n_G.GL_FUNC_SUBTRACT = gl.FUNC_SUBTRACT\n_G.GL_STENCIL_BUFFER_BIT = gl.STENCIL_BUFFER_BIT\n_G.GL_TEXTURE19 = gl.TEXTURE19\n_G.GL_TEXTURE18 = gl.TEXTURE18\n_G.GL_NEAREST_MIPMAP_NEAREST = gl.NEAREST_MIPMAP_NEAREST\n_G.GL_SHORT = gl.SHORT\n_G.GL_RENDERBUFFER_BINDING = gl.RENDERBUFFER_BINDING\n_G.GL_REPEAT = gl.REPEAT\n_G.GL_TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER\n_G.GL_RED_BITS = gl.RED_BITS\n_G.GL_FRONT_FACE = gl.FRONT_FACE\n_G.GL_BLEND_COLOR = gl.BLEND_COLOR\n_G.GL_MIRRORED_REPEAT = gl.MIRRORED_REPEAT\n_G.GL_INT_VEC4 = gl.INT_VEC4\n_G.GL_MAX_CUBE_MAP_TEXTURE_SIZE = gl.MAX_CUBE_MAP_TEXTURE_SIZE\n_G.GL_RENDERBUFFER_BLUE_SIZE = gl.RENDERBUFFER_BLUE_SIZE\n_G.GL_SAMPLE_COVERAGE = gl.SAMPLE_COVERAGE\n_G.GL_SRC_ALPHA = gl.SRC_ALPHA\n_G.GL_FUNC_REVERSE_SUBTRACT = gl.FUNC_REVERSE_SUBTRACT\n_G.GL_DEPTH_WRITEMASK = gl.DEPTH_WRITEMASK\n_G.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT\n_G.GL_POLYGON_OFFSET_FILL = gl.POLYGON_OFFSET_FILL\n_G.GL_STENCIL_FUNC = gl.STENCIL_FUNC\n_G.GL_REPLACE = gl.REPLACE\n_G.GL_LUMINANCE_ALPHA = gl.LUMINANCE_ALPHA\n_G.GL_DEPTH_RANGE = gl.DEPTH_RANGE\n_G.GL_FASTEST = gl.FASTEST\n_G.GL_STENCIL_FAIL = gl.STENCIL_FAIL\n_G.GL_UNSIGNED_SHORT = gl.UNSIGNED_SHORT\n_G.GL_RENDERBUFFER_HEIGHT = gl.RENDERBUFFER_HEIGHT\n_G.GL_STENCIL_BACK_FAIL = gl.STENCIL_BACK_FAIL\n_G.GL_BLEND_SRC_RGB = gl.BLEND_SRC_RGB\n_G.GL_TEXTURE3 = gl.TEXTURE3\n_G.GL_RENDERBUFFER = gl.RENDERBUFFER\n_G.GL_RGB5_A1 = gl.RGB5_A1\n_G.GL_RENDERBUFFER_ALPHA_SIZE = gl.RENDERBUFFER_ALPHA_SIZE\n_G.GL_RENDERBUFFER_STENCIL_SIZE = gl.RENDERBUFFER_STENCIL_SIZE\n_G.GL_NOTEQUAL = gl.NOTEQUAL\n_G.GL_BLEND_DST_RGB = gl.BLEND_DST_RGB\n_G.GL_FRONT_AND_BACK = gl.FRONT_AND_BACK\n_G.GL_TEXTURE_BINDING_CUBE_MAP = gl.TEXTURE_BINDING_CUBE_MAP\n_G.GL_MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE\n_G.GL_ZERO = gl.ZERO\n_G.GL_TEXTURE0 = gl.TEXTURE0\n_G.GL_SAMPLE_ALPHA_TO_COVERAGE = gl.SAMPLE_ALPHA_TO_COVERAGE\n_G.GL_BUFFER_USAGE = gl.BUFFER_USAGE\n_G.GL_ACTIVE_TEXTURE = gl.ACTIVE_TEXTURE\n_G.GL_BYTE = gl.BYTE\n_G.GL_CW = gl.CW\n_G.GL_DYNAMIC_DRAW = gl.DYNAMIC_DRAW\n_G.GL_RENDERBUFFER_RED_SIZE = gl.RENDERBUFFER_RED_SIZE\n_G.GL_FALSE = gl.FALSE\n_G.GL_GREATER = gl.GREATER\n_G.GL_RGBA4 = gl.RGBA4\n_G.GL_VALIDATE_STATUS = gl.VALIDATE_STATUS\n_G.GL_STENCIL_BITS = gl.STENCIL_BITS\n_G.GL_RGB = gl.RGB\n_G.GL_INT = gl.INT\n_G.GL_DEPTH_FUNC = gl.DEPTH_FUNC\n_G.GL_SAMPLER_2D = gl.SAMPLER_2D\n_G.GL_NICEST = gl.NICEST\n_G.GL_MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS\n_G.GL_CULL_FACE = gl.CULL_FACE\n_G.GL_INT_VEC3 = gl.INT_VEC3\n_G.GL_ALIASED_POINT_SIZE_RANGE = gl.ALIASED_POINT_SIZE_RANGE\n_G.GL_INVALID_ENUM = gl.INVALID_ENUM\n_G.GL_INVERT = gl.INVERT\n_G.GL_CULL_FACE_MODE = gl.CULL_FACE_MODE\n_G.GL_TEXTURE8 = gl.TEXTURE8\n_G.GL_VERTEX_ATTRIB_ARRAY_POINTER = gl.VERTEX_ATTRIB_ARRAY_POINTER\n_G.GL_TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S\n_G.GL_VERTEX_ATTRIB_ARRAY_STRIDE = gl.VERTEX_ATTRIB_ARRAY_STRIDE\n_G.GL_LINES = gl.LINES\n_G.GL_EQUAL = gl.EQUAL\n_G.GL_LINE_LOOP = gl.LINE_LOOP\n_G.GL_TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T\n_G.GL_DEPTH_BUFFER_BIT = gl.DEPTH_BUFFER_BIT\n_G.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS\n_G.GL_SHADER_TYPE = gl.SHADER_TYPE\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_X = gl.TEXTURE_CUBE_MAP_NEGATIVE_X\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = gl.TEXTURE_CUBE_MAP_NEGATIVE_Y\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = gl.TEXTURE_CUBE_MAP_NEGATIVE_Z\n_G.GL_DECR = gl.DECR\n_G.GL_DELETE_STATUS = gl.DELETE_STATUS\n_G.GL_DEPTH_BITS = gl.DEPTH_BITS\n_G.GL_INCR = gl.INCR\n_G.GL_SAMPLE_COVERAGE_VALUE = gl.SAMPLE_COVERAGE_VALUE\n_G.GL_ALPHA_BITS = gl.ALPHA_BITS\n_G.GL_FLOAT_MAT2 = gl.FLOAT_MAT2\n_G.GL_LINE_STRIP = gl.LINE_STRIP\n_G.GL_SHADER_SOURCE_LENGTH = gl.SHADER_SOURCE_LENGTH\n_G.GL_INVALID_VALUE = gl.INVALID_VALUE\n_G.GL_NEVER = gl.NEVER\n_G.GL_INCR_WRAP = gl.INCR_WRAP\n_G.GL_BLEND_EQUATION_ALPHA = gl.BLEND_EQUATION_ALPHA\n_G.GL_TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER\n_G.GL_POINTS = gl.POINTS\n_G.GL_COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0\n_G.GL_RGBA = gl.RGBA\n_G.GL_SRC_ALPHA_SATURATE = gl.SRC_ALPHA_SATURATE\n_G.GL_SAMPLER_CUBE = gl.SAMPLER_CUBE\n_G.GL_FRAMEBUFFER = gl.FRAMEBUFFER\n_G.GL_TEXTURE_CUBE_MAP = gl.TEXTURE_CUBE_MAP\n_G.GL_SAMPLE_BUFFERS = gl.SAMPLE_BUFFERS\n_G.GL_LINEAR = gl.LINEAR\n_G.GL_LINEAR_MIPMAP_NEAREST = gl.LINEAR_MIPMAP_NEAREST\n_G.GL_ACTIVE_UNIFORM_MAX_LENGTH = gl.ACTIVE_UNIFORM_MAX_LENGTH\n_G.GL_STENCIL_BACK_REF = gl.STENCIL_BACK_REF\n_G.GL_ELEMENT_ARRAY_BUFFER = gl.ELEMENT_ARRAY_BUFFER\n_G.GL_CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE\n_G.GL_TRIANGLE_STRIP = gl.TRIANGLE_STRIP\n_G.GL_CONSTANT_COLOR = gl.CONSTANT_COLOR\n_G.GL_COMPILE_STATUS = gl.COMPILE_STATUS\n_G.GL_RENDERBUFFER_GREEN_SIZE = gl.RENDERBUFFER_GREEN_SIZE\n_G.GL_UNSIGNED_INT = gl.UNSIGNED_INT\n_G.GL_DEPTH_CLEAR_VALUE = gl.DEPTH_CLEAR_VALUE\n_G.GL_ALIASED_LINE_WIDTH_RANGE = gl.ALIASED_LINE_WIDTH_RANGE\n_G.GL_SHADING_LANGUAGE_VERSION = gl.SHADING_LANGUAGE_VERSION\n_G.GL_FRAMEBUFFER_UNSUPPORTED = gl.FRAMEBUFFER_UNSUPPORTED\n_G.GL_INFO_LOG_LENGTH = gl.INFO_LOG_LENGTH\n_G.GL_STENCIL_PASS_DEPTH_PASS = gl.STENCIL_PASS_DEPTH_PASS\n_G.GL_STENCIL_VALUE_MASK = gl.STENCIL_VALUE_MASK\n_G.GL_ALWAYS = gl.ALWAYS\n_G.GL_MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE\n_G.GL_FLOAT = gl.FLOAT\n_G.GL_FRAMEBUFFER_BINDING = gl.FRAMEBUFFER_BINDING\n_G.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\n_G.GL_TRIANGLE_FAN = gl.TRIANGLE_FAN\n_G.GL_INVALID_FRAMEBUFFER_OPERATION = gl.INVALID_FRAMEBUFFER_OPERATION\n_G.GL_TEXTURE_2D = gl.TEXTURE_2D\n_G.GL_ALPHA = gl.ALPHA\n_G.GL_CURRENT_VERTEX_ATTRIB = gl.CURRENT_VERTEX_ATTRIB\n_G.GL_SCISSOR_TEST = gl.SCISSOR_TEST\n_G.GL_TRIANGLES = gl.TRIANGLES\n\n_G.CCControlEventTouchDown = cc.CONTROL_EVENTTYPE_TOUCH_DOWN\n_G.CCControlEventTouchDragInside = cc.CONTROL_EVENTTYPE_DRAG_INSIDE \n_G.CCControlEventTouchDragOutside = cc.CONTROL_EVENTTYPE_DRAG_OUTSIDE\n_G.CCControlEventTouchDragEnter = cc.CONTROL_EVENTTYPE_DRAG_ENTER\n_G.CCControlEventTouchDragExit  = cc.CONTROL_EVENTTYPE_DRAG_EXIT\n_G.CCControlEventTouchUpInside  = cc.CONTROL_EVENTTYPE_TOUCH_UP_INSIDE\n_G.CCControlEventTouchUpOutside = cc.CONTROL_EVENTTYPE_TOUCH_UP_OUTSIDE\n_G.CCControlEventTouchCancel    = cc.CONTROL_EVENTTYPE_TOUCH_CANCEL\n_G.CCControlEventValueChanged   = cc.CONTROL_EVENTTYPE_VALUE_CHANGED \n_G.CCControlStateNormal         = cc.CONTROL_STATE_NORMAL\n_G.CCControlStateHighlighted    = cc.CONTROL_STATE_HIGH_LIGHTED\n_G.CCControlStateDisabled       = cc.CONTROL_STATE_DISABLED\n_G.CCControlStateSelected       = cc.CONTROL_STATE_SELECTED\n\n_G.kWebSocketScriptHandlerOpen  = cc.WEBSOCKET_OPEN\n_G.kWebSocketScriptHandlerMessage = cc.WEBSOCKET_MESSAGE\n_G.kWebSocketScriptHandlerClose   = cc.WEBSOCKET_CLOSE\n_G.kWebSocketScriptHandlerError   = cc.WEBSOCKET_ERROR\n\n_G.kStateConnecting               = cc.WEBSOCKET_STATE_CONNECTING \n_G.kStateOpen                     = cc.WEBSOCKET_STATE_OPEN \n_G.kStateClosing                  = cc.WEBSOCKET_STATE_CLOSING\n_G.kStateClosed                   = cc.WEBSOCKET_STATE_CLOSED\n\n_G.LAYOUT_COLOR_NONE              = ccs.LayoutBackGroundColorType.none\n_G.LAYOUT_COLOR_SOLID             = ccs.LayoutBackGroundColorType.solid\n_G.LAYOUT_COLOR_GRADIENT          = ccs.LayoutBackGroundColorType.gradient\n\n_G.LAYOUT_ABSOLUTE                = ccs.LayoutType.absolute\n_G.LAYOUT_LINEAR_VERTICAL         = ccs.LayoutType.linearVertical\n_G.LAYOUT_LINEAR_HORIZONTAL       = ccs.LayoutType.linearHorizontal\n_G.LAYOUT_RELATIVE                = ccs.LayoutType.relative\n\n_G.BRIGHT_NONE               = ccs.BrightStyle.none\n_G.BRIGHT_NORMAL             = ccs.BrightStyle.normal\n_G.BRIGHT_HIGHLIGHT          = ccs.BrightStyle.highlight\n\n_G.WidgetTypeWidget                = ccs.WidgetType.widget\n_G.WidgetTypeContainer             = ccs.WidgetType.container\n\n_G.UI_TEX_TYPE_LOCAL               = ccs.TextureResType.UI_TEX_TYPE_LOCAL\n_G.UI_TEX_TYPE_PLIST               = ccs.TextureResType.UI_TEX_TYPE_PLIST\n\n_G.TOUCH_EVENT_BEGAN                = ccs.TouchEventType.began\n_G.TOUCH_EVENT_MOVED                = ccs.TouchEventType.moved\n_G.TOUCH_EVENT_ENDED                = ccs.TouchEventType.ended\n_G.TOUCH_EVENT_CANCELED             = ccs.TouchEventType.canceled\n \n_G.SIZE_ABSOLUTE                = ccs.SizeType.absolute\n_G.SIZE_PERCENT                 = ccs.SizeType.percent\n\n_G.POSITION_ABSOLUTE                = ccs.PositionType.absolute\n_G.POSITION_PERCENT                 = ccs.PositionType.percent\n\n_G.CHECKBOX_STATE_EVENT_SELECTED     = ccs.CheckBoxEventType.selected\n_G.CHECKBOX_STATE_EVENT_UNSELECTED   = ccs.CheckBoxEventType.unselected\n\n_G.CHECKBOX_STATE_EVENT_SELECTED     = ccs.CheckBoxEventType.selected\n_G.CHECKBOX_STATE_EVENT_UNSELECTED   = ccs.CheckBoxEventType.unselected\n\n_G.LoadingBarTypeLeft     = ccs.LoadingBarType.left\n_G.LoadingBarTypeRight   = ccs.LoadingBarType.right\n\n_G.LoadingBarTypeRight   = ccs.SliderEventType.percent_changed\n\n_G.TEXTFIELD_EVENT_ATTACH_WITH_IME                = ccs.TextFiledEventType.attach_with_ime\n_G.TEXTFIELD_EVENT_DETACH_WITH_IME                = ccs.TextFiledEventType.detach_with_ime\n_G.TEXTFIELD_EVENT_INSERT_TEXT                 = ccs.TextFiledEventType.insert_text\n_G.TEXTFIELD_EVENT_DELETE_BACKWARD             = ccs.TextFiledEventType.delete_backward\n\n_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP                = ccs.SCROLLVIEW_DIR.none\n_G.SCROLLVIEW_DIR_VERTICAL                = ccs.SCROLLVIEW_DIR.vertical\n_G.SCROLLVIEW_DIR_HORIZONTAL                 = ccs.SCROLLVIEW_DIR.horizontal\n_G.SCROLLVIEW_DIR_BOTH             = ccs.SCROLLVIEW_DIR.both\n\n_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP                = ccs.ScrollviewEventType.SCROLL_TO_TOP\n_G.SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM             = ccs.ScrollviewEventType.SCROLL_TO_BOTTOM\n_G.SCROLLVIEW_EVENT_SCROLL_TO_LEFT               = ccs.ScrollviewEventType.SCROLL_TO_LEFT\n_G.SCROLLVIEW_EVENT_SCROLL_TO_RIGHT              = ccs.ScrollviewEventType.SCROLL_TO_RIGHT\n_G.SCROLLVIEW_EVENT_SCROLLING                    = ccs.ScrollviewEventType.SCROLLING\n_G.SCROLLVIEW_EVENT_BOUNCE_TOP                   = ccs.ScrollviewEventType.BOUNCE_TOP\n_G.SCROLLVIEW_EVENT_BOUNCE_BOTTOM                = ccs.ScrollviewEventType.BOUNCE_BOTTOM\n_G.SCROLLVIEW_EVENT_BOUNCE_LEFT                  = ccs.ScrollviewEventType.BOUNCE_LEFT\n_G.SCROLLVIEW_EVENT_BOUNCE_RIGHT                 = ccs.ScrollviewEventType.BOUNCE_RIGHT\n\n_G.PAGEVIEW_EVENT_TURNING                 = ccs.PageViewEventType.turning\n\n_G.PAGEVIEW_TOUCHLEFT                  = ccs.PVTouchDir.touch_left\n_G.PAGEVIEW_TOUCHRIGHT                 = ccs.PVTouchDir.touch_right\n\n_G.LISTVIEW_DIR_NONE                      = ccs.ListViewDirection.none\n_G.LISTVIEW_DIR_VERTICAL                  = ccs.ListViewDirection.vertical\n_G.LISTVIEW_DIR_HORIZONTAL                = ccs.ListViewDirection.horizontal\n\n_G.LISTVIEW_MOVE_DIR_NONE                = ccs.ListViewMoveDirection.none\n_G.LISTVIEW_MOVE_DIR_UP                  = ccs.ListViewMoveDirection.up\n_G.LISTVIEW_MOVE_DIR_DOWN                = ccs.ListViewMoveDirection.down\n_G.LISTVIEW_MOVE_DIR_LEFT                = ccs.ListViewMoveDirection.left\n_G.LISTVIEW_MOVE_DIR_RIGHT               = ccs.ListViewMoveDirection.right\n\n_G.LISTVIEW_EVENT_INIT_CHILD                 = ccs.ListViewEventType.init_child\n_G.LISTVIEW_EVENT_UPDATE_CHILD               = ccs.ListViewEventType.update_child\n\n_G.LAYOUT_PARAMETER_NONE                   = ccs.UILayoutParameterType.none\n_G.LAYOUT_PARAMETER_LINEAR                 = ccs.UILayoutParameterType.linear\n_G.LAYOUT_PARAMETER_RELATIVE               = ccs.UILayoutParameterType.relative\n\n_G.kCCScrollViewDirectionHorizontal        = cc.SCROLLVIEW_DIRECTION_HORIZONTAL\n_G.kCCScrollViewDirectionVertical          = cc.SCROLLVIEW_DIRECTION_VERTICAL\n_G.kCCTableViewFillTopDown                 = cc.TABLEVIEW_FILL_TOPDOWN\n_G.kCCTableViewFillBottomUp                = cc.TABLEVIEW_FILL_BOTTOMUP\n"
  },
  {
    "path": "Resources/DeprecatedOpenglEnum.lua",
    "content": "-- This is the DeprecatedEnum\n\nDeprecatedClass = {} or DeprecatedClass\n\n_G.GL_RENDERBUFFER_INTERNAL_FORMAT = gl.RENDERBUFFER_INTERNAL_FORMAT\n_G.GL_LINE_WIDTH = gl.LINE_WIDTH\n_G.GL_CONSTANT_ALPHA = gl.CONSTANT_ALPHA\n_G.GL_BLEND_SRC_ALPHA = gl.BLEND_SRC_ALPHA\n_G.GL_GREEN_BITS = gl.GREEN_BITS\n_G.GL_STENCIL_REF = gl.STENCIL_REF\n_G.GL_ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\n_G.GL_CCW = gl.CCW\n_G.GL_MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS\n_G.GL_BACK = gl.BACK\n_G.GL_ACTIVE_ATTRIBUTES = gl.ACTIVE_ATTRIBUTES\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_X = gl.TEXTURE_CUBE_MAP_POSITIVE_X\n_G.GL_STENCIL_BACK_VALUE_MASK = gl.STENCIL_BACK_VALUE_MASK\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Z = gl.TEXTURE_CUBE_MAP_POSITIVE_Z\n_G.GL_ONE = gl.ONE\n_G.GL_TRUE = gl.TRUE\n_G.GL_TEXTURE12 = gl.TEXTURE12\n_G.GL_LINK_STATUS = gl.LINK_STATUS\n_G.GL_BLEND = gl.BLEND\n_G.GL_LESS = gl.LESS\n_G.GL_TEXTURE16 = gl.TEXTURE16\n_G.GL_BOOL_VEC2 = gl.BOOL_VEC2\n_G.GL_KEEP = gl.KEEP\n_G.GL_DST_COLOR = gl.DST_COLOR\n_G.GL_VERTEX_ATTRIB_ARRAY_ENABLED = gl.VERTEX_ATTRIB_ARRAY_ENABLED\n_G.GL_EXTENSIONS = gl.EXTENSIONS\n_G.GL_FRONT = gl.FRONT\n_G.GL_DST_ALPHA = gl.DST_ALPHA\n_G.GL_ATTACHED_SHADERS = gl.ATTACHED_SHADERS\n_G.GL_STENCIL_BACK_FUNC = gl.STENCIL_BACK_FUNC\n_G.GL_ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR\n_G.GL_BLEND_EQUATION = gl.BLEND_EQUATION\n_G.GL_RENDERBUFFER_DEPTH_SIZE = gl.RENDERBUFFER_DEPTH_SIZE\n_G.GL_PACK_ALIGNMENT = gl.PACK_ALIGNMENT\n_G.GL_VENDOR = gl.VENDOR\n_G.GL_NEAREST_MIPMAP_LINEAR = gl.NEAREST_MIPMAP_LINEAR\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Y = gl.TEXTURE_CUBE_MAP_POSITIVE_Y\n_G.GL_NEAREST = gl.NEAREST\n_G.GL_RENDERBUFFER_WIDTH = gl.RENDERBUFFER_WIDTH\n_G.GL_ARRAY_BUFFER_BINDING = gl.ARRAY_BUFFER_BINDING\n_G.GL_ARRAY_BUFFER = gl.ARRAY_BUFFER\n_G.GL_LEQUAL = gl.LEQUAL\n_G.GL_VERSION = gl.VERSION\n_G.GL_COLOR_CLEAR_VALUE = gl.COLOR_CLEAR_VALUE\n_G.GL_RENDERER = gl.RENDERER\n_G.GL_STENCIL_BACK_PASS_DEPTH_PASS = gl.STENCIL_BACK_PASS_DEPTH_PASS\n_G.GL_STENCIL_BACK_PASS_DEPTH_FAIL = gl.STENCIL_BACK_PASS_DEPTH_FAIL\n_G.GL_STENCIL_BACK_WRITEMASK = gl.STENCIL_BACK_WRITEMASK\n_G.GL_BOOL = gl.BOOL\n_G.GL_VIEWPORT = gl.VIEWPORT\n_G.GL_FRAGMENT_SHADER = gl.FRAGMENT_SHADER\n_G.GL_LUMINANCE = gl.LUMINANCE\n_G.GL_DECR_WRAP = gl.DECR_WRAP\n_G.GL_FUNC_ADD = gl.FUNC_ADD\n_G.GL_ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA\n_G.GL_OUT_OF_MEMORY = gl.OUT_OF_MEMORY\n_G.GL_BOOL_VEC4 = gl.BOOL_VEC4\n_G.GL_POLYGON_OFFSET_FACTOR = gl.POLYGON_OFFSET_FACTOR\n_G.GL_STATIC_DRAW = gl.STATIC_DRAW\n_G.GL_DITHER = gl.DITHER\n_G.GL_TEXTURE31 = gl.TEXTURE31\n_G.GL_TEXTURE30 = gl.TEXTURE30\n_G.GL_UNSIGNED_BYTE = gl.UNSIGNED_BYTE\n_G.GL_DEPTH_COMPONENT16 = gl.DEPTH_COMPONENT16\n_G.GL_TEXTURE23 = gl.TEXTURE23\n_G.GL_DEPTH_TEST = gl.DEPTH_TEST\n_G.GL_STENCIL_PASS_DEPTH_FAIL = gl.STENCIL_PASS_DEPTH_FAIL\n_G.GL_BOOL_VEC3 = gl.BOOL_VEC3\n_G.GL_POLYGON_OFFSET_UNITS = gl.POLYGON_OFFSET_UNITS\n_G.GL_TEXTURE_BINDING_2D = gl.TEXTURE_BINDING_2D\n_G.GL_TEXTURE21 = gl.TEXTURE21\n_G.GL_UNPACK_ALIGNMENT = gl.UNPACK_ALIGNMENT\n_G.GL_DONT_CARE = gl.DONT_CARE\n_G.GL_BUFFER_SIZE = gl.BUFFER_SIZE\n_G.GL_FLOAT_MAT3 = gl.FLOAT_MAT3\n_G.GL_UNSIGNED_SHORT_5_6_5 = gl.UNSIGNED_SHORT_5_6_5\n_G.GL_INT_VEC2 = gl.INT_VEC2\n_G.GL_UNSIGNED_SHORT_4_4_4_4 = gl.UNSIGNED_SHORT_4_4_4_4\n_G.GL_NONE = gl.NONE\n_G.GL_BLEND_DST_ALPHA = gl.BLEND_DST_ALPHA\n_G.GL_VERTEX_ATTRIB_ARRAY_SIZE = gl.VERTEX_ATTRIB_ARRAY_SIZE\n_G.GL_SRC_COLOR = gl.SRC_COLOR\n_G.GL_COMPRESSED_TEXTURE_FORMATS = gl.COMPRESSED_TEXTURE_FORMATS\n_G.GL_STENCIL_ATTACHMENT = gl.STENCIL_ATTACHMENT\n_G.GL_MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS\n_G.GL_NUM_COMPRESSED_TEXTURE_FORMATS = gl.NUM_COMPRESSED_TEXTURE_FORMATS\n_G.GL_BLEND_EQUATION_RGB = gl.BLEND_EQUATION_RGB\n_G.GL_TEXTURE = gl.TEXTURE\n_G.GL_LINEAR_MIPMAP_LINEAR = gl.LINEAR_MIPMAP_LINEAR\n_G.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\n_G.GL_CURRENT_PROGRAM = gl.CURRENT_PROGRAM\n_G.GL_COLOR_BUFFER_BIT = gl.COLOR_BUFFER_BIT\n_G.GL_TEXTURE20 = gl.TEXTURE20\n_G.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = gl.ACTIVE_ATTRIBUTE_MAX_LENGTH\n_G.GL_TEXTURE28 = gl.TEXTURE28\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\n_G.GL_TEXTURE22 = gl.TEXTURE22\n_G.GL_ELEMENT_ARRAY_BUFFER_BINDING = gl.ELEMENT_ARRAY_BUFFER_BINDING\n_G.GL_STREAM_DRAW = gl.STREAM_DRAW\n_G.GL_SCISSOR_BOX = gl.SCISSOR_BOX\n_G.GL_TEXTURE26 = gl.TEXTURE26\n_G.GL_TEXTURE27 = gl.TEXTURE27\n_G.GL_TEXTURE24 = gl.TEXTURE24\n_G.GL_TEXTURE25 = gl.TEXTURE25\n_G.GL_NO_ERROR = gl.NO_ERROR\n_G.GL_TEXTURE29 = gl.TEXTURE29\n_G.GL_FLOAT_MAT4 = gl.FLOAT_MAT4\n_G.GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = gl.VERTEX_ATTRIB_ARRAY_NORMALIZED\n_G.GL_SAMPLE_COVERAGE_INVERT = gl.SAMPLE_COVERAGE_INVERT\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\n_G.GL_FLOAT_VEC3 = gl.FLOAT_VEC3\n_G.GL_STENCIL_CLEAR_VALUE = gl.STENCIL_CLEAR_VALUE\n_G.GL_UNSIGNED_SHORT_5_5_5_1 = gl.UNSIGNED_SHORT_5_5_5_1\n_G.GL_ACTIVE_UNIFORMS = gl.ACTIVE_UNIFORMS\n_G.GL_INVALID_OPERATION = gl.INVALID_OPERATION\n_G.GL_DEPTH_ATTACHMENT = gl.DEPTH_ATTACHMENT\n_G.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS\n_G.GL_FRAMEBUFFER_COMPLETE = gl.FRAMEBUFFER_COMPLETE\n_G.GL_ONE_MINUS_CONSTANT_COLOR = gl.ONE_MINUS_CONSTANT_COLOR\n_G.GL_TEXTURE2 = gl.TEXTURE2\n_G.GL_TEXTURE1 = gl.TEXTURE1\n_G.GL_GEQUAL = gl.GEQUAL\n_G.GL_TEXTURE7 = gl.TEXTURE7\n_G.GL_TEXTURE6 = gl.TEXTURE6\n_G.GL_TEXTURE5 = gl.TEXTURE5\n_G.GL_TEXTURE4 = gl.TEXTURE4\n_G.GL_GENERATE_MIPMAP_HINT = gl.GENERATE_MIPMAP_HINT\n_G.GL_ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR\n_G.GL_TEXTURE9 = gl.TEXTURE9\n_G.GL_STENCIL_TEST = gl.STENCIL_TEST\n_G.GL_COLOR_WRITEMASK = gl.COLOR_WRITEMASK\n_G.GL_DEPTH_COMPONENT = gl.DEPTH_COMPONENT\n_G.GL_STENCIL_INDEX8 = gl.STENCIL_INDEX8\n_G.GL_VERTEX_ATTRIB_ARRAY_TYPE = gl.VERTEX_ATTRIB_ARRAY_TYPE\n_G.GL_FLOAT_VEC2 = gl.FLOAT_VEC2\n_G.GL_BLUE_BITS = gl.BLUE_BITS\n_G.GL_VERTEX_SHADER = gl.VERTEX_SHADER\n_G.GL_SUBPIXEL_BITS = gl.SUBPIXEL_BITS\n_G.GL_STENCIL_WRITEMASK = gl.STENCIL_WRITEMASK\n_G.GL_FLOAT_VEC4 = gl.FLOAT_VEC4\n_G.GL_TEXTURE17 = gl.TEXTURE17\n_G.GL_ONE_MINUS_CONSTANT_ALPHA = gl.ONE_MINUS_CONSTANT_ALPHA\n_G.GL_TEXTURE15 = gl.TEXTURE15\n_G.GL_TEXTURE14 = gl.TEXTURE14\n_G.GL_TEXTURE13 = gl.TEXTURE13\n_G.GL_SAMPLES = gl.SAMPLES\n_G.GL_TEXTURE11 = gl.TEXTURE11\n_G.GL_TEXTURE10 = gl.TEXTURE10\n_G.GL_FUNC_SUBTRACT = gl.FUNC_SUBTRACT\n_G.GL_STENCIL_BUFFER_BIT = gl.STENCIL_BUFFER_BIT\n_G.GL_TEXTURE19 = gl.TEXTURE19\n_G.GL_TEXTURE18 = gl.TEXTURE18\n_G.GL_NEAREST_MIPMAP_NEAREST = gl.NEAREST_MIPMAP_NEAREST\n_G.GL_SHORT = gl.SHORT\n_G.GL_RENDERBUFFER_BINDING = gl.RENDERBUFFER_BINDING\n_G.GL_REPEAT = gl.REPEAT\n_G.GL_TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER\n_G.GL_RED_BITS = gl.RED_BITS\n_G.GL_FRONT_FACE = gl.FRONT_FACE\n_G.GL_BLEND_COLOR = gl.BLEND_COLOR\n_G.GL_MIRRORED_REPEAT = gl.MIRRORED_REPEAT\n_G.GL_INT_VEC4 = gl.INT_VEC4\n_G.GL_MAX_CUBE_MAP_TEXTURE_SIZE = gl.MAX_CUBE_MAP_TEXTURE_SIZE\n_G.GL_RENDERBUFFER_BLUE_SIZE = gl.RENDERBUFFER_BLUE_SIZE\n_G.GL_SAMPLE_COVERAGE = gl.SAMPLE_COVERAGE\n_G.GL_SRC_ALPHA = gl.SRC_ALPHA\n_G.GL_FUNC_REVERSE_SUBTRACT = gl.FUNC_REVERSE_SUBTRACT\n_G.GL_DEPTH_WRITEMASK = gl.DEPTH_WRITEMASK\n_G.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT\n_G.GL_POLYGON_OFFSET_FILL = gl.POLYGON_OFFSET_FILL\n_G.GL_STENCIL_FUNC = gl.STENCIL_FUNC\n_G.GL_REPLACE = gl.REPLACE\n_G.GL_LUMINANCE_ALPHA = gl.LUMINANCE_ALPHA\n_G.GL_DEPTH_RANGE = gl.DEPTH_RANGE\n_G.GL_FASTEST = gl.FASTEST\n_G.GL_STENCIL_FAIL = gl.STENCIL_FAIL\n_G.GL_UNSIGNED_SHORT = gl.UNSIGNED_SHORT\n_G.GL_RENDERBUFFER_HEIGHT = gl.RENDERBUFFER_HEIGHT\n_G.GL_STENCIL_BACK_FAIL = gl.STENCIL_BACK_FAIL\n_G.GL_BLEND_SRC_RGB = gl.BLEND_SRC_RGB\n_G.GL_TEXTURE3 = gl.TEXTURE3\n_G.GL_RENDERBUFFER = gl.RENDERBUFFER\n_G.GL_RGB5_A1 = gl.RGB5_A1\n_G.GL_RENDERBUFFER_ALPHA_SIZE = gl.RENDERBUFFER_ALPHA_SIZE\n_G.GL_RENDERBUFFER_STENCIL_SIZE = gl.RENDERBUFFER_STENCIL_SIZE\n_G.GL_NOTEQUAL = gl.NOTEQUAL\n_G.GL_BLEND_DST_RGB = gl.BLEND_DST_RGB\n_G.GL_FRONT_AND_BACK = gl.FRONT_AND_BACK\n_G.GL_TEXTURE_BINDING_CUBE_MAP = gl.TEXTURE_BINDING_CUBE_MAP\n_G.GL_MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE\n_G.GL_ZERO = gl.ZERO\n_G.GL_TEXTURE0 = gl.TEXTURE0\n_G.GL_SAMPLE_ALPHA_TO_COVERAGE = gl.SAMPLE_ALPHA_TO_COVERAGE\n_G.GL_BUFFER_USAGE = gl.BUFFER_USAGE\n_G.GL_ACTIVE_TEXTURE = gl.ACTIVE_TEXTURE\n_G.GL_BYTE = gl.BYTE\n_G.GL_CW = gl.CW\n_G.GL_DYNAMIC_DRAW = gl.DYNAMIC_DRAW\n_G.GL_RENDERBUFFER_RED_SIZE = gl.RENDERBUFFER_RED_SIZE\n_G.GL_FALSE = gl.FALSE\n_G.GL_GREATER = gl.GREATER\n_G.GL_RGBA4 = gl.RGBA4\n_G.GL_VALIDATE_STATUS = gl.VALIDATE_STATUS\n_G.GL_STENCIL_BITS = gl.STENCIL_BITS\n_G.GL_RGB = gl.RGB\n_G.GL_INT = gl.INT\n_G.GL_DEPTH_FUNC = gl.DEPTH_FUNC\n_G.GL_SAMPLER_2D = gl.SAMPLER_2D\n_G.GL_NICEST = gl.NICEST\n_G.GL_MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS\n_G.GL_CULL_FACE = gl.CULL_FACE\n_G.GL_INT_VEC3 = gl.INT_VEC3\n_G.GL_ALIASED_POINT_SIZE_RANGE = gl.ALIASED_POINT_SIZE_RANGE\n_G.GL_INVALID_ENUM = gl.INVALID_ENUM\n_G.GL_INVERT = gl.INVERT\n_G.GL_CULL_FACE_MODE = gl.CULL_FACE_MODE\n_G.GL_TEXTURE8 = gl.TEXTURE8\n_G.GL_VERTEX_ATTRIB_ARRAY_POINTER = gl.VERTEX_ATTRIB_ARRAY_POINTER\n_G.GL_TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S\n_G.GL_VERTEX_ATTRIB_ARRAY_STRIDE = gl.VERTEX_ATTRIB_ARRAY_STRIDE\n_G.GL_LINES = gl.LINES\n_G.GL_EQUAL = gl.EQUAL\n_G.GL_LINE_LOOP = gl.LINE_LOOP\n_G.GL_TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T\n_G.GL_DEPTH_BUFFER_BIT = gl.DEPTH_BUFFER_BIT\n_G.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS\n_G.GL_SHADER_TYPE = gl.SHADER_TYPE\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_X = gl.TEXTURE_CUBE_MAP_NEGATIVE_X\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = gl.TEXTURE_CUBE_MAP_NEGATIVE_Y\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = gl.TEXTURE_CUBE_MAP_NEGATIVE_Z\n_G.GL_DECR = gl.DECR\n_G.GL_DELETE_STATUS = gl.DELETE_STATUS\n_G.GL_DEPTH_BITS = gl.DEPTH_BITS\n_G.GL_INCR = gl.INCR\n_G.GL_SAMPLE_COVERAGE_VALUE = gl.SAMPLE_COVERAGE_VALUE\n_G.GL_ALPHA_BITS = gl.ALPHA_BITS\n_G.GL_FLOAT_MAT2 = gl.FLOAT_MAT2\n_G.GL_LINE_STRIP = gl.LINE_STRIP\n_G.GL_SHADER_SOURCE_LENGTH = gl.SHADER_SOURCE_LENGTH\n_G.GL_INVALID_VALUE = gl.INVALID_VALUE\n_G.GL_NEVER = gl.NEVER\n_G.GL_INCR_WRAP = gl.INCR_WRAP\n_G.GL_BLEND_EQUATION_ALPHA = gl.BLEND_EQUATION_ALPHA\n_G.GL_TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER\n_G.GL_POINTS = gl.POINTS\n_G.GL_COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0\n_G.GL_RGBA = gl.RGBA\n_G.GL_SRC_ALPHA_SATURATE = gl.SRC_ALPHA_SATURATE\n_G.GL_SAMPLER_CUBE = gl.SAMPLER_CUBE\n_G.GL_FRAMEBUFFER = gl.FRAMEBUFFER\n_G.GL_TEXTURE_CUBE_MAP = gl.TEXTURE_CUBE_MAP\n_G.GL_SAMPLE_BUFFERS = gl.SAMPLE_BUFFERS\n_G.GL_LINEAR = gl.LINEAR\n_G.GL_LINEAR_MIPMAP_NEAREST = gl.LINEAR_MIPMAP_NEAREST\n_G.GL_ACTIVE_UNIFORM_MAX_LENGTH = gl.ACTIVE_UNIFORM_MAX_LENGTH\n_G.GL_STENCIL_BACK_REF = gl.STENCIL_BACK_REF\n_G.GL_ELEMENT_ARRAY_BUFFER = gl.ELEMENT_ARRAY_BUFFER\n_G.GL_CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE\n_G.GL_TRIANGLE_STRIP = gl.TRIANGLE_STRIP\n_G.GL_CONSTANT_COLOR = gl.CONSTANT_COLOR\n_G.GL_COMPILE_STATUS = gl.COMPILE_STATUS\n_G.GL_RENDERBUFFER_GREEN_SIZE = gl.RENDERBUFFER_GREEN_SIZE\n_G.GL_UNSIGNED_INT = gl.UNSIGNED_INT\n_G.GL_DEPTH_CLEAR_VALUE = gl.DEPTH_CLEAR_VALUE\n_G.GL_ALIASED_LINE_WIDTH_RANGE = gl.ALIASED_LINE_WIDTH_RANGE\n_G.GL_SHADING_LANGUAGE_VERSION = gl.SHADING_LANGUAGE_VERSION\n_G.GL_FRAMEBUFFER_UNSUPPORTED = gl.FRAMEBUFFER_UNSUPPORTED\n_G.GL_INFO_LOG_LENGTH = gl.INFO_LOG_LENGTH\n_G.GL_STENCIL_PASS_DEPTH_PASS = gl.STENCIL_PASS_DEPTH_PASS\n_G.GL_STENCIL_VALUE_MASK = gl.STENCIL_VALUE_MASK\n_G.GL_ALWAYS = gl.ALWAYS\n_G.GL_MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE\n_G.GL_FLOAT = gl.FLOAT\n_G.GL_FRAMEBUFFER_BINDING = gl.FRAMEBUFFER_BINDING\n_G.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\n_G.GL_TRIANGLE_FAN = gl.TRIANGLE_FAN\n_G.GL_INVALID_FRAMEBUFFER_OPERATION = gl.INVALID_FRAMEBUFFER_OPERATION\n_G.GL_TEXTURE_2D = gl.TEXTURE_2D\n_G.GL_ALPHA = gl.ALPHA\n_G.GL_CURRENT_VERTEX_ATTRIB = gl.CURRENT_VERTEX_ATTRIB\n_G.GL_SCISSOR_TEST = gl.SCISSOR_TEST\n_G.GL_TRIANGLES = gl.TRIANGLES\n"
  },
  {
    "path": "Resources/DrawPrimitives.lua",
    "content": "local dp_initialized = false\nlocal dp_shader      = nil\nlocal dp_colorLocation = -1\nlocal dp_color = { 1.0, 1.0, 1.0, 1.0 }\nlocal dp_pointSizeLocation = -1\nlocal dp_pointSize = 1.0\n\nlocal SHADER_NAME_POSITION_U_COLOR = \"ShaderPosition_uColor\"\n\nlocal targetPlatform = CCApplication:getInstance():getTargetPlatform()\n\nlocal function lazy_init()\n    if not dp_initialized then\n        dp_shader = CCShaderCache:getInstance():getProgram(SHADER_NAME_POSITION_U_COLOR)\n        --dp_shader:retain()\n        if nil ~= dp_shader then\n            dp_colorLocation = gl.getUniformLocation( dp_shader:getProgram(), \"u_color\")\n            dp_pointSizeLocation = gl.getUniformLocation( dp_shader:getProgram(), \"u_pointSize\")\n            dp_Initialized = true\n        end\n    end\n\n    if nil == dp_shader then\n        print(\"Error:dp_shader is nil!\")\n        return false\n    end\n\n    return true\nend\n\nlocal function setDrawProperty()\n    gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION )\n    dp_shader:use()\n    dp_shader:setUniformsForBuiltins()    \n    dp_shader:setUniformLocationWith4fv(dp_colorLocation, dp_color, 1)\nend\n\nfunction ccDrawInit()\n    lazy_init()\nend\n\nfunction ccDrawFree()\n    dp_initialized = false\nend\n\nfunction ccDrawColor4f(r,g,b,a)\n    dp_color[1] = r\n    dp_color[2] = g\n    dp_color[3] = b\n    dp_color[4] = a\nend\n\nfunction ccPointSize(pointSize)\n    dp_pointSize = pointSize * CCDirector:getInstance():getContentScaleFactor()\nend\n\nfunction ccDrawColor4B(r,g,b,a)\n    dp_color[1] = r / 255.0\n    dp_color[2] = g / 255.0\n    dp_color[3] = b / 255.0\n    dp_color[4] = a / 255.0\nend\n\nfunction ccDrawPoint(point)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n        local vertices = { point.x,point.y}\n        gl.bufferData(gl.ARRAY_BUFFER,2,vertices,gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    dp_shader:setUniformLocationWith1f(dp_pointSizeLocation, dp_pointSize)\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.POINTS,0,1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawPoints(points,numOfPoint)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n    local i = 1\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = {}\n        for i = 1, numOfPoint do\n            vertices[2 * i - 1] = points[i].x\n            vertices[2 * i]     = points[i].y\n        end\n        gl.bufferData(gl.ARRAY_BUFFER, numOfPoint * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    dp_shader:setUniformLocationWith1f(dp_pointSizeLocation, dp_pointSize)\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.POINTS,0,numOfPoint)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawLine(origin,destination)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = { origin.x, origin.y, destination.x, destination.y}\n        gl.bufferData(gl.ARRAY_BUFFER,4,vertices,gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINES ,0,2)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawPoly(points,numOfPoints,closePolygon)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n    local i = 1\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = {}\n        for i = 1, numOfPoints do\n            vertices[2 * i - 1] = points[i].x\n            vertices[2 * i]     = points[i].y\n        end\n        gl.bufferData(gl.ARRAY_BUFFER, numOfPoints * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    if closePolygon then\n        gl.drawArrays(gl.LINE_LOOP , 0, numOfPoints)\n    else\n        gl.drawArrays(gl.LINE_STRIP, 0, numOfPoints)\n    end\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawSolidPoly(points,numOfPoints,color)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n    local i = 1\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = {}\n        for i = 1, numOfPoints do\n            vertices[2 * i - 1] = points[i].x\n            vertices[2 * i]     = points[i].y\n\n        end\n        gl.bufferData(gl.ARRAY_BUFFER, numOfPoints * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION )\n    dp_shader:use()\n    dp_shader:setUniformsForBuiltins()    \n    dp_shader:setUniformLocationWith4fv(dp_colorLocation, color, 1)\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.TRIANGLE_FAN , 0, numOfPoints)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawRect(origin,destination)\n    ccDrawLine(CCPoint:__call(origin.x, origin.y), CCPoint:__call(destination.x, origin.y))\n    ccDrawLine(CCPoint:__call(destination.x, origin.y), CCPoint:__call(destination.x, destination.y))\n    ccDrawLine(CCPoint:__call(destination.x, destination.y), CCPoint:__call(origin.x, destination.y))\n    ccDrawLine(CCPoint:__call(origin.x, destination.y), CCPoint:__call(origin.x, origin.y))\nend\n\nfunction ccDrawSolidRect( origin,destination,color )\n    local vertices = { origin, CCPoint:__call(destination.x, origin.y) , destination, CCPoint:__call(origin.x, destination.y) }\n    ccDrawSolidPoly(vertices,4,color)\nend\n\nfunction ccDrawCircleScale( center, radius, angle, segments,drawLineToCenter,scaleX,scaleY)\n    if not lazy_init() then\n        return\n    end\n\n    local additionalSegment = 1\n    if drawLineToCenter then\n        additionalSegment = additionalSegment + 1\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local coef = 2.0 * math.pi / segments\n        local i = 1\n        local vertices = {}\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        for i = 1, segments + 1 do\n            local rads = (i - 1) * coef\n            local j    = radius * math.cos(rads + angle) * scaleX + center.x\n            local k    = radius * math.sin(rads + angle) * scaleY + center.y\n            vertices[i * 2 - 1] = j\n            vertices[i * 2]     = k\n         end\n        vertices[(segments + 2) * 2 - 1] = center.x\n        vertices[(segments + 2) * 2]     = center.y\n\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 2) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINE_STRIP , 0, segments + additionalSegment)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawCircle(center, radius, angle, segments, drawLineToCenter)\n    ccDrawCircleScale(center, radius, angle, segments, drawLineToCenter, 1.0, 1.0)\nend\n\nfunction ccDrawSolidCircle(center, radius, angle, segments,scaleX,scaleY)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local coef = 2.0 * math.pi / segments\n        local i = 1\n        local vertices = {}\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        for i = 1, segments + 1 do\n            local rads = (i - 1) * coef\n            local j    = radius * math.cos(rads + angle) * scaleX + center.x\n            local k    = radius * math.sin(rads + angle) * scaleY + center.y\n            vertices[i * 2 - 1] = j\n            vertices[i * 2]     = k\n         end\n        vertices[(segments + 2) * 2 - 1] = center.x\n        vertices[(segments + 2) * 2]     = center.y\n\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 2) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.TRIANGLE_FAN , 0, segments + 1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawQuadBezier(origin, control, destination, segments)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local vertices = { } \n        local i = 1\n        local t = 0.0\n\n        for i = 1, segments do\n            vertices[2 * i - 1] = math.pow(1 - t,2) * origin.x + 2.0 * (1 - t) * t * control.x + t * t * destination.x\n            vertices[2 * i]     = math.pow(1 - t,2) * origin.y + 2.0 * (1 - t) * t * control.y + t * t * destination.y\n            t = t + 1.0 / segments\n        end\n        \n        vertices[2 * (segments + 1) - 1] = destination.x\n        vertices[2 * (segments + 1)]     = destination.y\n\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 1) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINE_STRIP , 0, segments + 1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawCubicBezier(origin, control1, control2, destination, segments)\n    if not lazy_init then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local vertices = { } \n        local t = 0\n        local i = 1\n\n        for i = 1, segments do\n            vertices[2 * i - 1] = math.pow(1 - t,3) * origin.x + 3.0 * math.pow(1 - t, 2) * t * control1.x + 3.0 * (1 - t) * t * t * control2.x + t * t * t * destination.x\n            vertices[2 * i]     = math.pow(1 - t,3) * origin.y + 3.0 * math.pow(1 - t, 2) * t * control1.y + 3.0 * (1 - t) * t * t * control2.y + t * t * t * destination.y\n            t = t + 1.0 / segments\n        end\n\n        vertices[2 * (segments + 1) - 1] = destination.x\n        vertices[2 * (segments + 1)]     = destination.y\n\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 1) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINE_STRIP , 0, segments + 1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n"
  },
  {
    "path": "Resources/GuiConstants.lua",
    "content": "ccui = ccui or {}\n\nccui.BrightStyle = \n{\n    none = -1,\n    normal = 0,\n    highlight = 1,\n}\n\nccui.WidgetType = \n{\n    widget = 0, --control\n    container = 1, --container\n}\n\nccui.TextureResType = \n{\n    localType = 0,\n    plistType = 1,\n}\n\nccui.TouchEventType = \n{\n    began = 0,\n    moved = 1,\n    ended = 2,\n    canceled = 3,\n}\n\nccui.SizeType = \n{\n    absolute = 0,\n    percent = 1,\n}\n\nccui.PositionType = {\n    absolute = 0,\n    percent = 1,\n}\n\nccui.CheckBoxEventType = \n{\n    selected = 0,\n    unselected = 1,\n}\n\nccui.TextFiledEventType = \n{\n    attach_with_ime = 0,\n    detach_with_ime = 1,\n    insert_text = 2,\n    delete_backward = 3,\n}\n\nccui.LayoutBackGroundColorType = \n{\n    none = 0,\n    solid = 1,\n    gradient = 2,\n}\n\nccui.LayoutType = \n{\n    absolute = 0,\n    linearVertical = 1,\n    linearHorizontal = 2,\n    relative = 3,\n}\n\nccui.LayoutParameterType = \n{\n    none = 0,\n    linear = 1,\n    relative = 2,\n}\n\nccui.LinearGravity = \n{\n    none = 0,\n    left = 1,\n    top = 2,\n    right = 3,\n    bottom = 4,\n    centerVertical = 5,\n    centerHorizontal = 6,\n}\n\nccui.RelativeAlign = \n{\n    alignNone = 0,\n    alignParentTopLeft = 1,\n    alignParentTopCenterHorizontal = 2,\n    alignParentTopRight = 3,\n    alignParentLeftCenterVertical = 4,\n    centerInParent = 5,\n    alignParentRightCenterVertical = 6,\n    alignParentLeftBottom = 7,\n    alignParentBottomCenterHorizontal = 8,\n    alignParentRightBottom = 9,\n    locationAboveLeftAlign = 10,\n    locationAboveCenter = 11,\n    locationAboveRightAlign = 12,\n    locationLeftOfTopAlign = 13,\n    locationLeftOfCenter = 14,\n    locationLeftOfBottomAlign = 15,\n    locationRightOfTopAlign = 16,\n    locationRightOfCenter = 17,\n    locationRightOfBottomAlign = 18,\n    locationBelowLeftAlign = 19,\n    locationBelowCenter = 20,\n    locationBelowRightAlign = 21,\n}\n\nccui.SliderEventType = {percentChanged = 0}\n\nccui.LoadingBarType = { left = 0, right = 1}\n\nccui.ScrollViewDir = {\n    none = 0,\n    vertical = 1,\n    horizontal = 2,\n    both = 3,\n}\n\nccui.ScrollViewMoveDir = {\n    none = 0,\n    up = 1,\n    down = 2,\n    left = 3,\n    right = 4,\n}\n\nccui.ScrollviewEventType = {\n    scrollToTop =  0,\n    scrollToBottom =  1,\n    scrollToLeft = 2,\n    scrollToRight = 3,\n    scrolling = 4,\n    bounceTop = 5,\n    bounceBottom = 6,\n    bounceLeft = 7,\n    bounceRight = 8,\n}\n\nccui.ListViewDirection = {\n    none = 0,\n    vertical = 1,\n    horizontal = 2,\n}\n\nccui.ListViewMoveDirection = {\n    none = 0,\n    up = 1,\n    down = 2,\n    left = 3,\n    right = 4,\n}\n\nccui.ListViewEventType = {\n    onsSelectedItem = 0,\n}\n\nccui.PageViewEventType = {\n   turning = 0,  \n}\n\nccui.PVTouchDir = {\n    touchLeft = 0,\n    touchRight = 1,\n}\n\nccui.ListViewGravity = {\n    left = 0,\n    right = 1,\n    centerHorizontal = 2,\n    top = 3,\n    bottom = 4 ,\n    centerVertical = 5,\n}\n"
  },
  {
    "path": "Resources/Opengl.lua",
    "content": "require \"OpenglConstants\"\n\ngl = gl or {}\n\n--Create functions\nfunction  gl.createTexture()\n    local retTable = {}\n    retTable.texture_id = gl._createTexture()\n    return retTable\nend\n\nfunction gl.createBuffer()\n    local retTable = {}\n    retTable.buffer_id = gl._createBuffer()\n    return retTable\nend\n\nfunction gl.createRenderbuffer()\n    local retTable = {}\n    retTable.renderbuffer_id = gl._createRenderuffer()\n    return retTable\nend\n\nfunction gl.createFramebuffer( )\n    local retTable = {}\n    retTable.framebuffer_id = gl._createFramebuffer()\n    return retTable\nend\n\nfunction gl.createProgram()\n    local retTable = {}\n    retTable.program_id = gl._createProgram()\n    return retTable\nend\n\nfunction gl.createShader(shaderType)\n    local retTable = {}\n    retTable.shader_id = gl._createShader(shaderType)\n    return retTable\nend\n\n--Delete Fun\nfunction gl.deleteTexture(texture)\n    local texture_id = 0\n    if \"number\" == type(texture) then\n        texture_id = texture\n    elseif \"table\" == type(texture) then\n        texture_id = texture.texture_id\n    end\n    gl._deleteTexture(texture_id)\nend\n\nfunction gl.deleteBuffer(buffer)\n    local buffer_id = 0\n    if \"number\" == type(buffer) then\n        buffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n    gl._deleteBuffer(buffer_id)\nend\n\nfunction gl.deleteRenderbuffer(buffer)\n    local renderbuffer_id = 0\n    if \"number\" == type(buffer) then\n        renderbuffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        renderbuffer_id = buffer.renderbuffer_id\n    end\n    gl._deleteRenderbuffer(renderbuffer_id)\nend\n\nfunction gl.deleteFramebuffer(buffer)\n    local framebuffer_id = 0\n    if \"number\" == type(buffer) then\n        framebuffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        framebuffer_id = buffer.framebuffer_id\n    end\n    gl._deleteFramebuffer(framebuffer_id)\nend\n\nfunction gl.deleteProgram( program )\n    local program_id = 0\n    if \"number\" == type(buffer) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._deleteProgram(program_id)\nend\n\nfunction gl.deleteShader(shader)\n    local shader_id = 0\n    if \"number\" == type(shader) then\n        shader_id = shader\n    elseif \"table\" == type(shader) then\n        shader_id = shader.shader_id\n    end\n\n    gl._deleteShader(shader_id)\nend\n\n--Bind Related\nfunction gl.bindTexture(target, texture)\n    local texture_id = 0\n    if \"number\" == type(texture) then\n        texture_id = texture\n    elseif \"table\" == type(texture) then\n        texture_id = texture.texture_id\n    end\n\n    gl._bindTexture(target,texture_id)\nend \n\nfunction gl.bindBuffer( target,buffer )\n    local buffer_id = 0\n    if \"number\" == type(buffer) then\n        buffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n\n    gl._bindBuffer(target, buffer_id)\nend\n\nfunction gl.bindRenderBuffer(target, buffer)\n    local buffer_id = 0\n\n    if \"number\" == type(buffer) then\n        buffer_id = buffer;\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n\n    gl._bindRenderbuffer(target, buffer_id)\nend\n\nfunction gl.bindFramebuffer(target, buffer)\n    local buffer_id = 0\n\n    if \"number\" == type(buffer) then\n        buffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n\n    gl._bindFramebuffer(target, buffer_id)\nend\n\n--Uniform related\nfunction gl.getUniform(program, location)\n    local program_id = 0\n    local location_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    else\n        program_id = program.program_id\n    end\n\n    if \"number\" == type(location) then\n        location_id = location\n    else\n        location_id = location.location_id\n    end\n\n    return gl._getUniform(program_id, location_id)\nend\n\n--shader related\nfunction gl.compileShader(shader)\n    gl._compileShader( shader.shader_id)\nend\n\nfunction gl.shaderSource(shader, source)\n    gl._shaderSource(shader.shader_id, source)\nend\n\nfunction gl.getShaderParameter(shader, e)\n    return gl._getShaderParameter(shader.shader_id,e)\nend\n\nfunction gl.getShaderInfoLog( shader )\n    return gl._getShaderInfoLog(shader.shader_id)\nend\n\n--program related\nfunction gl.attachShader( program, shader )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._attachShader(program_id, shader.shader_id)\nend\n\nfunction gl.linkProgram( program )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._linkProgram(program_id)\nend\n\nfunction gl.getProgramParameter(program, e) \n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getProgramParameter(program_id, e)\nend\n\nfunction gl.useProgram(program)\n    local program_id = 0\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._useProgram (program_id)\nend\n\nfunction gl.getAttribLocation(program, name )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getAttribLocation(program_id, name)\nend\n\nfunction gl.getUniformLocation( program, name )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getUniformLocation(program_id,name)\nend\n\nfunction gl.getActiveAttrib( program, index )\n    local program_id = 0\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getActiveAttrib(program_id, index);\nend\n\nfunction gl.getActiveUniform( program, index )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getActiveUniform(program_id, index)\nend\n\nfunction gl.getAttachedShaders(program)\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getAttachedShaders(program_id)\nend\n\nfunction gl.glNodeCreate()\n    return cc.GLNode:create()\nend\n\n"
  },
  {
    "path": "Resources/OpenglConstants.lua",
    "content": "--Encapsulate opengl constants. \ngl = gl or {} \n\ngl.GCCSO_SHADER_BINARY_FJ   = 0x9260\ngl._3DC_XY_AMD  = 0x87fa\ngl._3DC_X_AMD   = 0x87f9\ngl.ACTIVE_ATTRIBUTES    = 0x8b89\ngl.ACTIVE_ATTRIBUTE_MAX_LENGTH  = 0x8b8a\ngl.ACTIVE_PROGRAM_EXT   = 0x8259\ngl.ACTIVE_TEXTURE   = 0x84e0\ngl.ACTIVE_UNIFORMS  = 0x8b86\ngl.ACTIVE_UNIFORM_MAX_LENGTH    = 0x8b87\ngl.ALIASED_LINE_WIDTH_RANGE = 0x846e\ngl.ALIASED_POINT_SIZE_RANGE = 0x846d\ngl.ALL_COMPLETED_NV = 0x84f2\ngl.ALL_SHADER_BITS_EXT  = 0xffffffff\ngl.ALPHA    = 0x1906\ngl.ALPHA16F_EXT = 0x881c\ngl.ALPHA32F_EXT = 0x8816\ngl.ALPHA8_EXT   = 0x803c\ngl.ALPHA8_OES   = 0x803c\ngl.ALPHA_BITS   = 0xd55\ngl.ALPHA_TEST_FUNC_QCOM = 0xbc1\ngl.ALPHA_TEST_QCOM  = 0xbc0\ngl.ALPHA_TEST_REF_QCOM  = 0xbc2\ngl.ALREADY_SIGNALED_APPLE   = 0x911a\ngl.ALWAYS   = 0x207\ngl.AMD_compressed_3DC_texture   = 0x1\ngl.AMD_compressed_ATC_texture   = 0x1\ngl.AMD_performance_monitor  = 0x1\ngl.AMD_program_binary_Z400  = 0x1\ngl.ANGLE_depth_texture  = 0x1\ngl.ANGLE_framebuffer_blit   = 0x1\ngl.ANGLE_framebuffer_multisample    = 0x1\ngl.ANGLE_instanced_arrays   = 0x1\ngl.ANGLE_pack_reverse_row_order = 0x1\ngl.ANGLE_program_binary = 0x1\ngl.ANGLE_texture_compression_dxt3   = 0x1\ngl.ANGLE_texture_compression_dxt5   = 0x1\ngl.ANGLE_texture_usage  = 0x1\ngl.ANGLE_translated_shader_source   = 0x1\ngl.ANY_SAMPLES_PASSED_CONSERVATIVE_EXT  = 0x8d6a\ngl.ANY_SAMPLES_PASSED_EXT   = 0x8c2f\ngl.APPLE_copy_texture_levels    = 0x1\ngl.APPLE_framebuffer_multisample    = 0x1\ngl.APPLE_rgb_422    = 0x1\ngl.APPLE_sync   = 0x1\ngl.APPLE_texture_format_BGRA8888    = 0x1\ngl.APPLE_texture_max_level  = 0x1\ngl.ARM_mali_program_binary  = 0x1\ngl.ARM_mali_shader_binary   = 0x1\ngl.ARM_rgba8    = 0x1\ngl.ARRAY_BUFFER = 0x8892\ngl.ARRAY_BUFFER_BINDING = 0x8894\ngl.ATC_RGBA_EXPLICIT_ALPHA_AMD  = 0x8c93\ngl.ATC_RGBA_INTERPOLATED_ALPHA_AMD  = 0x87ee\ngl.ATC_RGB_AMD  = 0x8c92\ngl.ATTACHED_SHADERS = 0x8b85\ngl.BACK = 0x405\ngl.BGRA8_EXT    = 0x93a1\ngl.BGRA_EXT = 0x80e1\ngl.BGRA_IMG = 0x80e1\ngl.BINNING_CONTROL_HINT_QCOM    = 0x8fb0\ngl.BLEND    = 0xbe2\ngl.BLEND_COLOR  = 0x8005\ngl.BLEND_DST_ALPHA  = 0x80ca\ngl.BLEND_DST_RGB    = 0x80c8\ngl.BLEND_EQUATION   = 0x8009\ngl.BLEND_EQUATION_ALPHA = 0x883d\ngl.BLEND_EQUATION_RGB   = 0x8009\ngl.BLEND_SRC_ALPHA  = 0x80cb\ngl.BLEND_SRC_RGB    = 0x80c9\ngl.BLUE_BITS    = 0xd54\ngl.BOOL = 0x8b56\ngl.BOOL_VEC2    = 0x8b57\ngl.BOOL_VEC3    = 0x8b58\ngl.BOOL_VEC4    = 0x8b59\ngl.BUFFER   = 0x82e0\ngl.BUFFER_ACCESS_OES    = 0x88bb\ngl.BUFFER_MAPPED_OES    = 0x88bc\ngl.BUFFER_MAP_POINTER_OES   = 0x88bd\ngl.BUFFER_OBJECT_EXT    = 0x9151\ngl.BUFFER_SIZE  = 0x8764\ngl.BUFFER_USAGE = 0x8765\ngl.BYTE = 0x1400\ngl.CCW  = 0x901\ngl.CLAMP_TO_BORDER_NV   = 0x812d\ngl.CLAMP_TO_EDGE    = 0x812f\ngl.COLOR_ATTACHMENT0    = 0x8ce0\ngl.COLOR_ATTACHMENT0_NV = 0x8ce0\ngl.COLOR_ATTACHMENT10_NV    = 0x8cea\ngl.COLOR_ATTACHMENT11_NV    = 0x8ceb\ngl.COLOR_ATTACHMENT12_NV    = 0x8cec\ngl.COLOR_ATTACHMENT13_NV    = 0x8ced\ngl.COLOR_ATTACHMENT14_NV    = 0x8cee\ngl.COLOR_ATTACHMENT15_NV    = 0x8cef\ngl.COLOR_ATTACHMENT1_NV = 0x8ce1\ngl.COLOR_ATTACHMENT2_NV = 0x8ce2\ngl.COLOR_ATTACHMENT3_NV = 0x8ce3\ngl.COLOR_ATTACHMENT4_NV = 0x8ce4\ngl.COLOR_ATTACHMENT5_NV = 0x8ce5\ngl.COLOR_ATTACHMENT6_NV = 0x8ce6\ngl.COLOR_ATTACHMENT7_NV = 0x8ce7\ngl.COLOR_ATTACHMENT8_NV = 0x8ce8\ngl.COLOR_ATTACHMENT9_NV = 0x8ce9\ngl.COLOR_ATTACHMENT_EXT = 0x90f0\ngl.COLOR_BUFFER_BIT = 0x4000\ngl.COLOR_BUFFER_BIT0_QCOM   = 0x1\ngl.COLOR_BUFFER_BIT1_QCOM   = 0x2\ngl.COLOR_BUFFER_BIT2_QCOM   = 0x4\ngl.COLOR_BUFFER_BIT3_QCOM   = 0x8\ngl.COLOR_BUFFER_BIT4_QCOM   = 0x10\ngl.COLOR_BUFFER_BIT5_QCOM   = 0x20\ngl.COLOR_BUFFER_BIT6_QCOM   = 0x40\ngl.COLOR_BUFFER_BIT7_QCOM   = 0x80\ngl.COLOR_CLEAR_VALUE    = 0xc22\ngl.COLOR_EXT    = 0x1800\ngl.COLOR_WRITEMASK  = 0xc23\ngl.COMPARE_REF_TO_TEXTURE_EXT   = 0x884e\ngl.COMPILE_STATUS   = 0x8b81\ngl.COMPRESSED_RGBA_ASTC_10x10_KHR   = 0x93bb\ngl.COMPRESSED_RGBA_ASTC_10x5_KHR    = 0x93b8\ngl.COMPRESSED_RGBA_ASTC_10x6_KHR    = 0x93b9\ngl.COMPRESSED_RGBA_ASTC_10x8_KHR    = 0x93ba\ngl.COMPRESSED_RGBA_ASTC_12x10_KHR   = 0x93bc\ngl.COMPRESSED_RGBA_ASTC_12x12_KHR   = 0x93bd\ngl.COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93b0\ngl.COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93b1\ngl.COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93b2\ngl.COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93b3\ngl.COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93b4\ngl.COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93b5\ngl.COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93b6\ngl.COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93b7\ngl.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8c03\ngl.COMPRESSED_RGBA_PVRTC_2BPPV2_IMG = 0x9137\ngl.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8c02\ngl.COMPRESSED_RGBA_PVRTC_4BPPV2_IMG = 0x9138\ngl.COMPRESSED_RGBA_S3TC_DXT1_EXT    = 0x83f1\ngl.COMPRESSED_RGBA_S3TC_DXT3_ANGLE  = 0x83f2\ngl.COMPRESSED_RGBA_S3TC_DXT5_ANGLE  = 0x83f3\ngl.COMPRESSED_RGB_PVRTC_2BPPV1_IMG  = 0x8c01\ngl.COMPRESSED_RGB_PVRTC_4BPPV1_IMG  = 0x8c00\ngl.COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83f0\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR   = 0x93db\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR    = 0x93d8\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR    = 0x93d9\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR    = 0x93da\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR   = 0x93dc\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR   = 0x93dd\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93d0\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93d1\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93d2\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93d3\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93d4\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93d5\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93d6\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93d7\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV   = 0x8c4d\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV   = 0x8c4e\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV   = 0x8c4f\ngl.COMPRESSED_SRGB_S3TC_DXT1_NV = 0x8c4c\ngl.COMPRESSED_TEXTURE_FORMATS   = 0x86a3\ngl.CONDITION_SATISFIED_APPLE    = 0x911c\ngl.CONSTANT_ALPHA   = 0x8003\ngl.CONSTANT_COLOR   = 0x8001\ngl.CONTEXT_FLAG_DEBUG_BIT   = 0x2\ngl.CONTEXT_ROBUST_ACCESS_EXT    = 0x90f3\ngl.COUNTER_RANGE_AMD    = 0x8bc1\ngl.COUNTER_TYPE_AMD = 0x8bc0\ngl.COVERAGE_ALL_FRAGMENTS_NV    = 0x8ed5\ngl.COVERAGE_ATTACHMENT_NV   = 0x8ed2\ngl.COVERAGE_AUTOMATIC_NV    = 0x8ed7\ngl.COVERAGE_BUFFERS_NV  = 0x8ed3\ngl.COVERAGE_BUFFER_BIT_NV   = 0x8000\ngl.COVERAGE_COMPONENT4_NV   = 0x8ed1\ngl.COVERAGE_COMPONENT_NV    = 0x8ed0\ngl.COVERAGE_EDGE_FRAGMENTS_NV   = 0x8ed6\ngl.COVERAGE_SAMPLES_NV  = 0x8ed4\ngl.CPU_OPTIMIZED_QCOM   = 0x8fb1\ngl.CULL_FACE    = 0xb44\ngl.CULL_FACE_MODE   = 0xb45\ngl.CURRENT_PROGRAM  = 0x8b8d\ngl.CURRENT_QUERY_EXT    = 0x8865\ngl.CURRENT_VERTEX_ATTRIB    = 0x8626\ngl.CW   = 0x900\ngl.DEBUG_CALLBACK_FUNCTION  = 0x8244\ngl.DEBUG_CALLBACK_USER_PARAM    = 0x8245\ngl.DEBUG_GROUP_STACK_DEPTH  = 0x826d\ngl.DEBUG_LOGGED_MESSAGES    = 0x9145\ngl.DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243\ngl.DEBUG_OUTPUT = 0x92e0\ngl.DEBUG_OUTPUT_SYNCHRONOUS = 0x8242\ngl.DEBUG_SEVERITY_HIGH  = 0x9146\ngl.DEBUG_SEVERITY_LOW   = 0x9148\ngl.DEBUG_SEVERITY_MEDIUM    = 0x9147\ngl.DEBUG_SEVERITY_NOTIFICATION  = 0x826b\ngl.DEBUG_SOURCE_API = 0x8246\ngl.DEBUG_SOURCE_APPLICATION = 0x824a\ngl.DEBUG_SOURCE_OTHER   = 0x824b\ngl.DEBUG_SOURCE_SHADER_COMPILER = 0x8248\ngl.DEBUG_SOURCE_THIRD_PARTY = 0x8249\ngl.DEBUG_SOURCE_WINDOW_SYSTEM   = 0x8247\ngl.DEBUG_TYPE_DEPRECATED_BEHAVIOR   = 0x824d\ngl.DEBUG_TYPE_ERROR = 0x824c\ngl.DEBUG_TYPE_MARKER    = 0x8268\ngl.DEBUG_TYPE_OTHER = 0x8251\ngl.DEBUG_TYPE_PERFORMANCE   = 0x8250\ngl.DEBUG_TYPE_POP_GROUP = 0x826a\ngl.DEBUG_TYPE_PORTABILITY   = 0x824f\ngl.DEBUG_TYPE_PUSH_GROUP    = 0x8269\ngl.DEBUG_TYPE_UNDEFINED_BEHAVIOR    = 0x824e\ngl.DECR = 0x1e03\ngl.DECR_WRAP    = 0x8508\ngl.DELETE_STATUS    = 0x8b80\ngl.DEPTH24_STENCIL8_OES = 0x88f0\ngl.DEPTH_ATTACHMENT = 0x8d00\ngl.DEPTH_BITS   = 0xd56\ngl.DEPTH_BUFFER_BIT = 0x100\ngl.DEPTH_BUFFER_BIT0_QCOM   = 0x100\ngl.DEPTH_BUFFER_BIT1_QCOM   = 0x200\ngl.DEPTH_BUFFER_BIT2_QCOM   = 0x400\ngl.DEPTH_BUFFER_BIT3_QCOM   = 0x800\ngl.DEPTH_BUFFER_BIT4_QCOM   = 0x1000\ngl.DEPTH_BUFFER_BIT5_QCOM   = 0x2000\ngl.DEPTH_BUFFER_BIT6_QCOM   = 0x4000\ngl.DEPTH_BUFFER_BIT7_QCOM   = 0x8000\ngl.DEPTH_CLEAR_VALUE    = 0xb73\ngl.DEPTH_COMPONENT  = 0x1902\ngl.DEPTH_COMPONENT16    = 0x81a5\ngl.DEPTH_COMPONENT16_NONLINEAR_NV   = 0x8e2c\ngl.DEPTH_COMPONENT16_OES    = 0x81a5\ngl.DEPTH_COMPONENT24_OES    = 0x81a6\ngl.DEPTH_COMPONENT32_OES    = 0x81a7\ngl.DEPTH_EXT    = 0x1801\ngl.DEPTH_FUNC   = 0xb74\ngl.DEPTH_RANGE  = 0xb70\ngl.DEPTH_STENCIL_OES    = 0x84f9\ngl.DEPTH_TEST   = 0xb71\ngl.DEPTH_WRITEMASK  = 0xb72\ngl.DITHER   = 0xbd0\ngl.DMP_shader_binary    = 0x1\ngl.DONT_CARE    = 0x1100\ngl.DRAW_BUFFER0_NV  = 0x8825\ngl.DRAW_BUFFER10_NV = 0x882f\ngl.DRAW_BUFFER11_NV = 0x8830\ngl.DRAW_BUFFER12_NV = 0x8831\ngl.DRAW_BUFFER13_NV = 0x8832\ngl.DRAW_BUFFER14_NV = 0x8833\ngl.DRAW_BUFFER15_NV = 0x8834\ngl.DRAW_BUFFER1_NV  = 0x8826\ngl.DRAW_BUFFER2_NV  = 0x8827\ngl.DRAW_BUFFER3_NV  = 0x8828\ngl.DRAW_BUFFER4_NV  = 0x8829\ngl.DRAW_BUFFER5_NV  = 0x882a\ngl.DRAW_BUFFER6_NV  = 0x882b\ngl.DRAW_BUFFER7_NV  = 0x882c\ngl.DRAW_BUFFER8_NV  = 0x882d\ngl.DRAW_BUFFER9_NV  = 0x882e\ngl.DRAW_BUFFER_EXT  = 0xc01\ngl.DRAW_FRAMEBUFFER_ANGLE   = 0x8ca9\ngl.DRAW_FRAMEBUFFER_APPLE   = 0x8ca9\ngl.DRAW_FRAMEBUFFER_BINDING_ANGLE   = 0x8ca6\ngl.DRAW_FRAMEBUFFER_BINDING_APPLE   = 0x8ca6\ngl.DRAW_FRAMEBUFFER_BINDING_NV  = 0x8ca6\ngl.DRAW_FRAMEBUFFER_NV  = 0x8ca9\ngl.DST_ALPHA    = 0x304\ngl.DST_COLOR    = 0x306\ngl.DYNAMIC_DRAW = 0x88e8\ngl.ELEMENT_ARRAY_BUFFER = 0x8893\ngl.ELEMENT_ARRAY_BUFFER_BINDING = 0x8895\ngl.EQUAL    = 0x202\ngl.ES_VERSION_2_0   = 0x1\ngl.ETC1_RGB8_OES    = 0x8d64\ngl.ETC1_SRGB8_NV    = 0x88ee\ngl.EXTENSIONS   = 0x1f03\ngl.EXT_blend_minmax = 0x1\ngl.EXT_color_buffer_half_float  = 0x1\ngl.EXT_debug_label  = 0x1\ngl.EXT_debug_marker = 0x1\ngl.EXT_discard_framebuffer  = 0x1\ngl.EXT_map_buffer_range = 0x1\ngl.EXT_multi_draw_arrays    = 0x1\ngl.EXT_multisampled_render_to_texture   = 0x1\ngl.EXT_multiview_draw_buffers   = 0x1\ngl.EXT_occlusion_query_boolean  = 0x1\ngl.EXT_read_format_bgra = 0x1\ngl.EXT_robustness   = 0x1\ngl.EXT_sRGB = 0x1\ngl.EXT_separate_shader_objects  = 0x1\ngl.EXT_shader_framebuffer_fetch = 0x1\ngl.EXT_shader_texture_lod   = 0x1\ngl.EXT_shadow_samplers  = 0x1\ngl.EXT_texture_compression_dxt1 = 0x1\ngl.EXT_texture_filter_anisotropic   = 0x1\ngl.EXT_texture_format_BGRA8888  = 0x1\ngl.EXT_texture_rg   = 0x1\ngl.EXT_texture_storage  = 0x1\ngl.EXT_texture_type_2_10_10_10_REV  = 0x1\ngl.EXT_unpack_subimage  = 0x1\ngl.FALSE    = 0x0\ngl.FASTEST  = 0x1101\ngl.FENCE_CONDITION_NV   = 0x84f4\ngl.FENCE_STATUS_NV  = 0x84f3\ngl.FIXED    = 0x140c\ngl.FJ_shader_binary_GCCSO   = 0x1\ngl.FLOAT    = 0x1406\ngl.FLOAT_MAT2   = 0x8b5a\ngl.FLOAT_MAT3   = 0x8b5b\ngl.FLOAT_MAT4   = 0x8b5c\ngl.FLOAT_VEC2   = 0x8b50\ngl.FLOAT_VEC3   = 0x8b51\ngl.FLOAT_VEC4   = 0x8b52\ngl.FRAGMENT_SHADER  = 0x8b30\ngl.FRAGMENT_SHADER_BIT_EXT  = 0x2\ngl.FRAGMENT_SHADER_DERIVATIVE_HINT_OES  = 0x8b8b\ngl.FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8a52\ngl.FRAMEBUFFER  = 0x8d40\ngl.FRAMEBUFFER_ATTACHMENT_ANGLE = 0x93a3\ngl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT    = 0x8210\ngl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT    = 0x8211\ngl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME   = 0x8cd1\ngl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE   = 0x8cd0\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES    = 0x8cd4\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8cd3\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8cd2\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT   = 0x8d6c\ngl.FRAMEBUFFER_BINDING  = 0x8ca6\ngl.FRAMEBUFFER_COMPLETE = 0x8cd5\ngl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT    = 0x8cd6\ngl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS    = 0x8cd9\ngl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT    = 0x8cd7\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE = 0x8d56\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE = 0x8d56\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT   = 0x8d56\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG   = 0x9134\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV    = 0x8d56\ngl.FRAMEBUFFER_UNDEFINED_OES    = 0x8219\ngl.FRAMEBUFFER_UNSUPPORTED  = 0x8cdd\ngl.FRONT    = 0x404\ngl.FRONT_AND_BACK   = 0x408\ngl.FRONT_FACE   = 0xb46\ngl.FUNC_ADD = 0x8006\ngl.FUNC_REVERSE_SUBTRACT    = 0x800b\ngl.FUNC_SUBTRACT    = 0x800a\ngl.GENERATE_MIPMAP_HINT = 0x8192\ngl.GEQUAL   = 0x206\ngl.GPU_OPTIMIZED_QCOM   = 0x8fb2\ngl.GREATER  = 0x204\ngl.GREEN_BITS   = 0xd53\ngl.GUILTY_CONTEXT_RESET_EXT = 0x8253\ngl.HALF_FLOAT_OES   = 0x8d61\ngl.HIGH_FLOAT   = 0x8df2\ngl.HIGH_INT = 0x8df5\ngl.IMG_multisampled_render_to_texture   = 0x1\ngl.IMG_program_binary   = 0x1\ngl.IMG_read_format  = 0x1\ngl.IMG_shader_binary    = 0x1\ngl.IMG_texture_compression_pvrtc    = 0x1\ngl.IMG_texture_compression_pvrtc2   = 0x1\ngl.IMPLEMENTATION_COLOR_READ_FORMAT = 0x8b9b\ngl.IMPLEMENTATION_COLOR_READ_TYPE   = 0x8b9a\ngl.INCR = 0x1e02\ngl.INCR_WRAP    = 0x8507\ngl.INFO_LOG_LENGTH  = 0x8b84\ngl.INNOCENT_CONTEXT_RESET_EXT   = 0x8254\ngl.INT  = 0x1404\ngl.INT_10_10_10_2_OES   = 0x8df7\ngl.INT_VEC2 = 0x8b53\ngl.INT_VEC3 = 0x8b54\ngl.INT_VEC4 = 0x8b55\ngl.INVALID_ENUM = 0x500\ngl.INVALID_FRAMEBUFFER_OPERATION    = 0x506\ngl.INVALID_OPERATION    = 0x502\ngl.INVALID_VALUE    = 0x501\ngl.INVERT   = 0x150a\ngl.KEEP = 0x1e00\ngl.KHR_debug    = 0x1\ngl.KHR_texture_compression_astc_ldr = 0x1\ngl.LEQUAL   = 0x203\ngl.LESS = 0x201\ngl.LINEAR   = 0x2601\ngl.LINEAR_MIPMAP_LINEAR = 0x2703\ngl.LINEAR_MIPMAP_NEAREST    = 0x2701\ngl.LINES    = 0x1\ngl.LINE_LOOP    = 0x2\ngl.LINE_STRIP   = 0x3\ngl.LINE_WIDTH   = 0xb21\ngl.LINK_STATUS  = 0x8b82\ngl.LOSE_CONTEXT_ON_RESET_EXT    = 0x8252\ngl.LOW_FLOAT    = 0x8df0\ngl.LOW_INT  = 0x8df3\ngl.LUMINANCE    = 0x1909\ngl.LUMINANCE16F_EXT = 0x881e\ngl.LUMINANCE32F_EXT = 0x8818\ngl.LUMINANCE4_ALPHA4_OES    = 0x8043\ngl.LUMINANCE8_ALPHA8_EXT    = 0x8045\ngl.LUMINANCE8_ALPHA8_OES    = 0x8045\ngl.LUMINANCE8_EXT   = 0x8040\ngl.LUMINANCE8_OES   = 0x8040\ngl.LUMINANCE_ALPHA  = 0x190a\ngl.LUMINANCE_ALPHA16F_EXT   = 0x881f\ngl.LUMINANCE_ALPHA32F_EXT   = 0x8819\ngl.MALI_PROGRAM_BINARY_ARM  = 0x8f61\ngl.MALI_SHADER_BINARY_ARM   = 0x8f60\ngl.MAP_FLUSH_EXPLICIT_BIT_EXT   = 0x10\ngl.MAP_INVALIDATE_BUFFER_BIT_EXT    = 0x8\ngl.MAP_INVALIDATE_RANGE_BIT_EXT = 0x4\ngl.MAP_READ_BIT_EXT = 0x1\ngl.MAP_UNSYNCHRONIZED_BIT_EXT   = 0x20\ngl.MAP_WRITE_BIT_EXT    = 0x2\ngl.MAX_3D_TEXTURE_SIZE_OES  = 0x8073\ngl.MAX_COLOR_ATTACHMENTS_NV = 0x8cdf\ngl.MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8b4d\ngl.MAX_CUBE_MAP_TEXTURE_SIZE    = 0x851c\ngl.MAX_DEBUG_GROUP_STACK_DEPTH  = 0x826c\ngl.MAX_DEBUG_LOGGED_MESSAGES    = 0x9144\ngl.MAX_DEBUG_MESSAGE_LENGTH = 0x9143\ngl.MAX_DRAW_BUFFERS_NV  = 0x8824\ngl.MAX_EXT  = 0x8008\ngl.MAX_FRAGMENT_UNIFORM_VECTORS = 0x8dfd\ngl.MAX_LABEL_LENGTH = 0x82e8\ngl.MAX_MULTIVIEW_BUFFERS_EXT    = 0x90f2\ngl.MAX_RENDERBUFFER_SIZE    = 0x84e8\ngl.MAX_SAMPLES_ANGLE    = 0x8d57\ngl.MAX_SAMPLES_APPLE    = 0x8d57\ngl.MAX_SAMPLES_EXT  = 0x8d57\ngl.MAX_SAMPLES_IMG  = 0x9135\ngl.MAX_SAMPLES_NV   = 0x8d57\ngl.MAX_SERVER_WAIT_TIMEOUT_APPLE    = 0x9111\ngl.MAX_TEXTURE_IMAGE_UNITS  = 0x8872\ngl.MAX_TEXTURE_MAX_ANISOTROPY_EXT   = 0x84ff\ngl.MAX_TEXTURE_SIZE = 0xd33\ngl.MAX_VARYING_VECTORS  = 0x8dfc\ngl.MAX_VERTEX_ATTRIBS   = 0x8869\ngl.MAX_VERTEX_TEXTURE_IMAGE_UNITS   = 0x8b4c\ngl.MAX_VERTEX_UNIFORM_VECTORS   = 0x8dfb\ngl.MAX_VIEWPORT_DIMS    = 0xd3a\ngl.MEDIUM_FLOAT = 0x8df1\ngl.MEDIUM_INT   = 0x8df4\ngl.MIN_EXT  = 0x8007\ngl.MIRRORED_REPEAT  = 0x8370\ngl.MULTISAMPLE_BUFFER_BIT0_QCOM = 0x1000000\ngl.MULTISAMPLE_BUFFER_BIT1_QCOM = 0x2000000\ngl.MULTISAMPLE_BUFFER_BIT2_QCOM = 0x4000000\ngl.MULTISAMPLE_BUFFER_BIT3_QCOM = 0x8000000\ngl.MULTISAMPLE_BUFFER_BIT4_QCOM = 0x10000000\ngl.MULTISAMPLE_BUFFER_BIT5_QCOM = 0x20000000\ngl.MULTISAMPLE_BUFFER_BIT6_QCOM = 0x40000000\ngl.MULTISAMPLE_BUFFER_BIT7_QCOM = 0x80000000\ngl.MULTIVIEW_EXT    = 0x90f1\ngl.NEAREST  = 0x2600\ngl.NEAREST_MIPMAP_LINEAR    = 0x2702\ngl.NEAREST_MIPMAP_NEAREST   = 0x2700\ngl.NEVER    = 0x200\ngl.NICEST   = 0x1102\ngl.NONE = 0x0\ngl.NOTEQUAL = 0x205\ngl.NO_ERROR = 0x0\ngl.NO_RESET_NOTIFICATION_EXT    = 0x8261\ngl.NUM_COMPRESSED_TEXTURE_FORMATS   = 0x86a2\ngl.NUM_PROGRAM_BINARY_FORMATS_OES   = 0x87fe\ngl.NUM_SHADER_BINARY_FORMATS    = 0x8df9\ngl.NV_coverage_sample   = 0x1\ngl.NV_depth_nonlinear   = 0x1\ngl.NV_draw_buffers  = 0x1\ngl.NV_draw_instanced    = 0x1\ngl.NV_fbo_color_attachments = 0x1\ngl.NV_fence = 0x1\ngl.NV_framebuffer_blit  = 0x1\ngl.NV_framebuffer_multisample   = 0x1\ngl.NV_generate_mipmap_sRGB  = 0x1\ngl.NV_instanced_arrays  = 0x1\ngl.NV_read_buffer   = 0x1\ngl.NV_read_buffer_front = 0x1\ngl.NV_read_depth    = 0x1\ngl.NV_read_depth_stencil    = 0x1\ngl.NV_read_stencil  = 0x1\ngl.NV_sRGB_formats  = 0x1\ngl.NV_shadow_samplers_array = 0x1\ngl.NV_shadow_samplers_cube  = 0x1\ngl.NV_texture_border_clamp  = 0x1\ngl.NV_texture_compression_s3tc_update   = 0x1\ngl.NV_texture_npot_2D_mipmap    = 0x1\ngl.OBJECT_TYPE_APPLE    = 0x9112\ngl.OES_EGL_image    = 0x1\ngl.OES_EGL_image_external   = 0x1\ngl.OES_compressed_ETC1_RGB8_texture = 0x1\ngl.OES_compressed_paletted_texture  = 0x1\ngl.OES_depth24  = 0x1\ngl.OES_depth32  = 0x1\ngl.OES_depth_texture    = 0x1\ngl.OES_element_index_uint   = 0x1\ngl.OES_fbo_render_mipmap    = 0x1\ngl.OES_fragment_precision_high  = 0x1\ngl.OES_get_program_binary   = 0x1\ngl.OES_mapbuffer    = 0x1\ngl.OES_packed_depth_stencil = 0x1\ngl.OES_required_internalformat  = 0x1\ngl.OES_rgb8_rgba8   = 0x1\ngl.OES_standard_derivatives = 0x1\ngl.OES_stencil1 = 0x1\ngl.OES_stencil4 = 0x1\ngl.OES_surfaceless_context  = 0x1\ngl.OES_texture_3D   = 0x1\ngl.OES_texture_float    = 0x1\ngl.OES_texture_float_linear = 0x1\ngl.OES_texture_half_float   = 0x1\ngl.OES_texture_half_float_linear    = 0x1\ngl.OES_texture_npot = 0x1\ngl.OES_vertex_array_object  = 0x1\ngl.OES_vertex_half_float    = 0x1\ngl.OES_vertex_type_10_10_10_2   = 0x1\ngl.ONE  = 0x1\ngl.ONE_MINUS_CONSTANT_ALPHA = 0x8004\ngl.ONE_MINUS_CONSTANT_COLOR = 0x8002\ngl.ONE_MINUS_DST_ALPHA  = 0x305\ngl.ONE_MINUS_DST_COLOR  = 0x307\ngl.ONE_MINUS_SRC_ALPHA  = 0x303\ngl.ONE_MINUS_SRC_COLOR  = 0x301\ngl.OUT_OF_MEMORY    = 0x505\ngl.PACK_ALIGNMENT   = 0xd05\ngl.PACK_REVERSE_ROW_ORDER_ANGLE = 0x93a4\ngl.PALETTE4_R5_G6_B5_OES    = 0x8b92\ngl.PALETTE4_RGB5_A1_OES = 0x8b94\ngl.PALETTE4_RGB8_OES    = 0x8b90\ngl.PALETTE4_RGBA4_OES   = 0x8b93\ngl.PALETTE4_RGBA8_OES   = 0x8b91\ngl.PALETTE8_R5_G6_B5_OES    = 0x8b97\ngl.PALETTE8_RGB5_A1_OES = 0x8b99\ngl.PALETTE8_RGB8_OES    = 0x8b95\ngl.PALETTE8_RGBA4_OES   = 0x8b98\ngl.PALETTE8_RGBA8_OES   = 0x8b96\ngl.PERCENTAGE_AMD   = 0x8bc3\ngl.PERFMON_GLOBAL_MODE_QCOM = 0x8fa0\ngl.PERFMON_RESULT_AMD   = 0x8bc6\ngl.PERFMON_RESULT_AVAILABLE_AMD = 0x8bc4\ngl.PERFMON_RESULT_SIZE_AMD  = 0x8bc5\ngl.POINTS   = 0x0\ngl.POLYGON_OFFSET_FACTOR    = 0x8038\ngl.POLYGON_OFFSET_FILL  = 0x8037\ngl.POLYGON_OFFSET_UNITS = 0x2a00\ngl.PROGRAM  = 0x82e2\ngl.PROGRAM_BINARY_ANGLE = 0x93a6\ngl.PROGRAM_BINARY_FORMATS_OES   = 0x87ff\ngl.PROGRAM_BINARY_LENGTH_OES    = 0x8741\ngl.PROGRAM_OBJECT_EXT   = 0x8b40\ngl.PROGRAM_PIPELINE_BINDING_EXT = 0x825a\ngl.PROGRAM_PIPELINE_OBJECT_EXT  = 0x8a4f\ngl.PROGRAM_SEPARABLE_EXT    = 0x8258\ngl.QCOM_alpha_test  = 0x1\ngl.QCOM_binning_control = 0x1\ngl.QCOM_driver_control  = 0x1\ngl.QCOM_extended_get    = 0x1\ngl.QCOM_extended_get2   = 0x1\ngl.QCOM_perfmon_global_mode = 0x1\ngl.QCOM_tiled_rendering = 0x1\ngl.QCOM_writeonly_rendering = 0x1\ngl.QUERY    = 0x82e3\ngl.QUERY_OBJECT_EXT = 0x9153\ngl.QUERY_RESULT_AVAILABLE_EXT   = 0x8867\ngl.QUERY_RESULT_EXT = 0x8866\ngl.R16F_EXT = 0x822d\ngl.R32F_EXT = 0x822e\ngl.R8_EXT   = 0x8229\ngl.READ_BUFFER_EXT  = 0xc02\ngl.READ_BUFFER_NV   = 0xc02\ngl.READ_FRAMEBUFFER_ANGLE   = 0x8ca8\ngl.READ_FRAMEBUFFER_APPLE   = 0x8ca8\ngl.READ_FRAMEBUFFER_BINDING_ANGLE   = 0x8caa\ngl.READ_FRAMEBUFFER_BINDING_APPLE   = 0x8caa\ngl.READ_FRAMEBUFFER_BINDING_NV  = 0x8caa\ngl.READ_FRAMEBUFFER_NV  = 0x8ca8\ngl.RED_BITS = 0xd52\ngl.RED_EXT  = 0x1903\ngl.RENDERBUFFER = 0x8d41\ngl.RENDERBUFFER_ALPHA_SIZE  = 0x8d53\ngl.RENDERBUFFER_BINDING = 0x8ca7\ngl.RENDERBUFFER_BLUE_SIZE   = 0x8d52\ngl.RENDERBUFFER_DEPTH_SIZE  = 0x8d54\ngl.RENDERBUFFER_GREEN_SIZE  = 0x8d51\ngl.RENDERBUFFER_HEIGHT  = 0x8d43\ngl.RENDERBUFFER_INTERNAL_FORMAT = 0x8d44\ngl.RENDERBUFFER_RED_SIZE    = 0x8d50\ngl.RENDERBUFFER_SAMPLES_ANGLE   = 0x8cab\ngl.RENDERBUFFER_SAMPLES_APPLE   = 0x8cab\ngl.RENDERBUFFER_SAMPLES_EXT = 0x8cab\ngl.RENDERBUFFER_SAMPLES_IMG = 0x9133\ngl.RENDERBUFFER_SAMPLES_NV  = 0x8cab\ngl.RENDERBUFFER_STENCIL_SIZE    = 0x8d55\ngl.RENDERBUFFER_WIDTH   = 0x8d42\ngl.RENDERER = 0x1f01\ngl.RENDER_DIRECT_TO_FRAMEBUFFER_QCOM    = 0x8fb3\ngl.REPEAT   = 0x2901\ngl.REPLACE  = 0x1e01\ngl.REQUIRED_TEXTURE_IMAGE_UNITS_OES = 0x8d68\ngl.RESET_NOTIFICATION_STRATEGY_EXT  = 0x8256\ngl.RG16F_EXT    = 0x822f\ngl.RG32F_EXT    = 0x8230\ngl.RG8_EXT  = 0x822b\ngl.RGB  = 0x1907\ngl.RGB10_A2_EXT = 0x8059\ngl.RGB10_EXT    = 0x8052\ngl.RGB16F_EXT   = 0x881b\ngl.RGB32F_EXT   = 0x8815\ngl.RGB565   = 0x8d62\ngl.RGB565_OES   = 0x8d62\ngl.RGB5_A1  = 0x8057\ngl.RGB5_A1_OES  = 0x8057\ngl.RGB8_OES = 0x8051\ngl.RGBA = 0x1908\ngl.RGBA16F_EXT  = 0x881a\ngl.RGBA32F_EXT  = 0x8814\ngl.RGBA4    = 0x8056\ngl.RGBA4_OES    = 0x8056\ngl.RGBA8_OES    = 0x8058\ngl.RGB_422_APPLE    = 0x8a1f\ngl.RG_EXT   = 0x8227\ngl.SAMPLER  = 0x82e6\ngl.SAMPLER_2D   = 0x8b5e\ngl.SAMPLER_2D_ARRAY_SHADOW_NV   = 0x8dc4\ngl.SAMPLER_2D_SHADOW_EXT    = 0x8b62\ngl.SAMPLER_3D_OES   = 0x8b5f\ngl.SAMPLER_CUBE = 0x8b60\ngl.SAMPLER_CUBE_SHADOW_NV   = 0x8dc5\ngl.SAMPLER_EXTERNAL_OES = 0x8d66\ngl.SAMPLES  = 0x80a9\ngl.SAMPLE_ALPHA_TO_COVERAGE = 0x809e\ngl.SAMPLE_BUFFERS   = 0x80a8\ngl.SAMPLE_COVERAGE  = 0x80a0\ngl.SAMPLE_COVERAGE_INVERT   = 0x80ab\ngl.SAMPLE_COVERAGE_VALUE    = 0x80aa\ngl.SCISSOR_BOX  = 0xc10\ngl.SCISSOR_TEST = 0xc11\ngl.SGX_BINARY_IMG   = 0x8c0a\ngl.SGX_PROGRAM_BINARY_IMG   = 0x9130\ngl.SHADER   = 0x82e1\ngl.SHADER_BINARY_DMP    = 0x9250\ngl.SHADER_BINARY_FORMATS    = 0x8df8\ngl.SHADER_BINARY_VIV    = 0x8fc4\ngl.SHADER_COMPILER  = 0x8dfa\ngl.SHADER_OBJECT_EXT    = 0x8b48\ngl.SHADER_SOURCE_LENGTH = 0x8b88\ngl.SHADER_TYPE  = 0x8b4f\ngl.SHADING_LANGUAGE_VERSION = 0x8b8c\ngl.SHORT    = 0x1402\ngl.SIGNALED_APPLE   = 0x9119\ngl.SLUMINANCE8_ALPHA8_NV    = 0x8c45\ngl.SLUMINANCE8_NV   = 0x8c47\ngl.SLUMINANCE_ALPHA_NV  = 0x8c44\ngl.SLUMINANCE_NV    = 0x8c46\ngl.SRC_ALPHA    = 0x302\ngl.SRC_ALPHA_SATURATE   = 0x308\ngl.SRC_COLOR    = 0x300\ngl.SRGB8_ALPHA8_EXT = 0x8c43\ngl.SRGB8_NV = 0x8c41\ngl.SRGB_ALPHA_EXT   = 0x8c42\ngl.SRGB_EXT = 0x8c40\ngl.STACK_OVERFLOW   = 0x503\ngl.STACK_UNDERFLOW  = 0x504\ngl.STATE_RESTORE    = 0x8bdc\ngl.STATIC_DRAW  = 0x88e4\ngl.STENCIL_ATTACHMENT   = 0x8d20\ngl.STENCIL_BACK_FAIL    = 0x8801\ngl.STENCIL_BACK_FUNC    = 0x8800\ngl.STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802\ngl.STENCIL_BACK_PASS_DEPTH_PASS = 0x8803\ngl.STENCIL_BACK_REF = 0x8ca3\ngl.STENCIL_BACK_VALUE_MASK  = 0x8ca4\ngl.STENCIL_BACK_WRITEMASK   = 0x8ca5\ngl.STENCIL_BITS = 0xd57\ngl.STENCIL_BUFFER_BIT   = 0x400\ngl.STENCIL_BUFFER_BIT0_QCOM = 0x10000\ngl.STENCIL_BUFFER_BIT1_QCOM = 0x20000\ngl.STENCIL_BUFFER_BIT2_QCOM = 0x40000\ngl.STENCIL_BUFFER_BIT3_QCOM = 0x80000\ngl.STENCIL_BUFFER_BIT4_QCOM = 0x100000\ngl.STENCIL_BUFFER_BIT5_QCOM = 0x200000\ngl.STENCIL_BUFFER_BIT6_QCOM = 0x400000\ngl.STENCIL_BUFFER_BIT7_QCOM = 0x800000\ngl.STENCIL_CLEAR_VALUE  = 0xb91\ngl.STENCIL_EXT  = 0x1802\ngl.STENCIL_FAIL = 0xb94\ngl.STENCIL_FUNC = 0xb92\ngl.STENCIL_INDEX1_OES   = 0x8d46\ngl.STENCIL_INDEX4_OES   = 0x8d47\ngl.STENCIL_INDEX8   = 0x8d48\ngl.STENCIL_PASS_DEPTH_FAIL  = 0xb95\ngl.STENCIL_PASS_DEPTH_PASS  = 0xb96\ngl.STENCIL_REF  = 0xb97\ngl.STENCIL_TEST = 0xb90\ngl.STENCIL_VALUE_MASK   = 0xb93\ngl.STENCIL_WRITEMASK    = 0xb98\ngl.STREAM_DRAW  = 0x88e0\ngl.SUBPIXEL_BITS    = 0xd50\ngl.SYNC_CONDITION_APPLE = 0x9113\ngl.SYNC_FENCE_APPLE = 0x9116\ngl.SYNC_FLAGS_APPLE = 0x9115\ngl.SYNC_FLUSH_COMMANDS_BIT_APPLE    = 0x1\ngl.SYNC_GPU_COMMANDS_COMPLETE_APPLE = 0x9117\ngl.SYNC_OBJECT_APPLE    = 0x8a53\ngl.SYNC_STATUS_APPLE    = 0x9114\ngl.TEXTURE  = 0x1702\ngl.TEXTURE0 = 0x84c0\ngl.TEXTURE1 = 0x84c1\ngl.TEXTURE10    = 0x84ca\ngl.TEXTURE11    = 0x84cb\ngl.TEXTURE12    = 0x84cc\ngl.TEXTURE13    = 0x84cd\ngl.TEXTURE14    = 0x84ce\ngl.TEXTURE15    = 0x84cf\ngl.TEXTURE16    = 0x84d0\ngl.TEXTURE17    = 0x84d1\ngl.TEXTURE18    = 0x84d2\ngl.TEXTURE19    = 0x84d3\ngl.TEXTURE2 = 0x84c2\ngl.TEXTURE20    = 0x84d4\ngl.TEXTURE21    = 0x84d5\ngl.TEXTURE22    = 0x84d6\ngl.TEXTURE23    = 0x84d7\ngl.TEXTURE24    = 0x84d8\ngl.TEXTURE25    = 0x84d9\ngl.TEXTURE26    = 0x84da\ngl.TEXTURE27    = 0x84db\ngl.TEXTURE28    = 0x84dc\ngl.TEXTURE29    = 0x84dd\ngl.TEXTURE3 = 0x84c3\ngl.TEXTURE30    = 0x84de\ngl.TEXTURE31    = 0x84df\ngl.TEXTURE4 = 0x84c4\ngl.TEXTURE5 = 0x84c5\ngl.TEXTURE6 = 0x84c6\ngl.TEXTURE7 = 0x84c7\ngl.TEXTURE8 = 0x84c8\ngl.TEXTURE9 = 0x84c9\ngl.TEXTURE_2D   = 0xde1\ngl.TEXTURE_3D_OES   = 0x806f\ngl.TEXTURE_BINDING_2D   = 0x8069\ngl.TEXTURE_BINDING_3D_OES   = 0x806a\ngl.TEXTURE_BINDING_CUBE_MAP = 0x8514\ngl.TEXTURE_BINDING_EXTERNAL_OES = 0x8d67\ngl.TEXTURE_BORDER_COLOR_NV  = 0x1004\ngl.TEXTURE_COMPARE_FUNC_EXT = 0x884d\ngl.TEXTURE_COMPARE_MODE_EXT = 0x884c\ngl.TEXTURE_CUBE_MAP = 0x8513\ngl.TEXTURE_CUBE_MAP_NEGATIVE_X  = 0x8516\ngl.TEXTURE_CUBE_MAP_NEGATIVE_Y  = 0x8518\ngl.TEXTURE_CUBE_MAP_NEGATIVE_Z  = 0x851a\ngl.TEXTURE_CUBE_MAP_POSITIVE_X  = 0x8515\ngl.TEXTURE_CUBE_MAP_POSITIVE_Y  = 0x8517\ngl.TEXTURE_CUBE_MAP_POSITIVE_Z  = 0x8519\ngl.TEXTURE_DEPTH_QCOM   = 0x8bd4\ngl.TEXTURE_EXTERNAL_OES = 0x8d65\ngl.TEXTURE_FORMAT_QCOM  = 0x8bd6\ngl.TEXTURE_HEIGHT_QCOM  = 0x8bd3\ngl.TEXTURE_IMAGE_VALID_QCOM = 0x8bd8\ngl.TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912f\ngl.TEXTURE_INTERNAL_FORMAT_QCOM = 0x8bd5\ngl.TEXTURE_MAG_FILTER   = 0x2800\ngl.TEXTURE_MAX_ANISOTROPY_EXT   = 0x84fe\ngl.TEXTURE_MAX_LEVEL_APPLE  = 0x813d\ngl.TEXTURE_MIN_FILTER   = 0x2801\ngl.TEXTURE_NUM_LEVELS_QCOM  = 0x8bd9\ngl.TEXTURE_OBJECT_VALID_QCOM    = 0x8bdb\ngl.TEXTURE_SAMPLES_IMG  = 0x9136\ngl.TEXTURE_TARGET_QCOM  = 0x8bda\ngl.TEXTURE_TYPE_QCOM    = 0x8bd7\ngl.TEXTURE_USAGE_ANGLE  = 0x93a2\ngl.TEXTURE_WIDTH_QCOM   = 0x8bd2\ngl.TEXTURE_WRAP_R_OES   = 0x8072\ngl.TEXTURE_WRAP_S   = 0x2802\ngl.TEXTURE_WRAP_T   = 0x2803\ngl.TIMEOUT_EXPIRED_APPLE    = 0x911b\ngl.TIMEOUT_IGNORED_APPLE    = 0xffffffffffffffff\ngl.TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE    = 0x93a0\ngl.TRIANGLES    = 0x4\ngl.TRIANGLE_FAN = 0x6\ngl.TRIANGLE_STRIP   = 0x5\ngl.TRUE = 0x1\ngl.UNKNOWN_CONTEXT_RESET_EXT    = 0x8255\ngl.UNPACK_ALIGNMENT = 0xcf5\ngl.UNPACK_ROW_LENGTH    = 0xcf2\ngl.UNPACK_SKIP_PIXELS   = 0xcf4\ngl.UNPACK_SKIP_ROWS = 0xcf3\ngl.UNSIGNALED_APPLE = 0x9118\ngl.UNSIGNED_BYTE    = 0x1401\ngl.UNSIGNED_INT = 0x1405\ngl.UNSIGNED_INT64_AMD   = 0x8bc2\ngl.UNSIGNED_INT_10_10_10_2_OES  = 0x8df6\ngl.UNSIGNED_INT_24_8_OES    = 0x84fa\ngl.UNSIGNED_INT_2_10_10_10_REV_EXT  = 0x8368\ngl.UNSIGNED_NORMALIZED_EXT  = 0x8c17\ngl.UNSIGNED_SHORT   = 0x1403\ngl.UNSIGNED_SHORT_1_5_5_5_REV_EXT   = 0x8366\ngl.UNSIGNED_SHORT_4_4_4_4   = 0x8033\ngl.UNSIGNED_SHORT_4_4_4_4_REV_EXT   = 0x8365\ngl.UNSIGNED_SHORT_4_4_4_4_REV_IMG   = 0x8365\ngl.UNSIGNED_SHORT_5_5_5_1   = 0x8034\ngl.UNSIGNED_SHORT_5_6_5 = 0x8363\ngl.UNSIGNED_SHORT_8_8_APPLE = 0x85ba\ngl.UNSIGNED_SHORT_8_8_REV_APPLE = 0x85bb\ngl.VALIDATE_STATUS  = 0x8b83\ngl.VENDOR   = 0x1f00\ngl.VERSION  = 0x1f02\ngl.VERTEX_ARRAY_BINDING_OES = 0x85b5\ngl.VERTEX_ARRAY_OBJECT_EXT  = 0x9154\ngl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING   = 0x889f\ngl.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE    = 0x88fe\ngl.VERTEX_ATTRIB_ARRAY_DIVISOR_NV   = 0x88fe\ngl.VERTEX_ATTRIB_ARRAY_ENABLED  = 0x8622\ngl.VERTEX_ATTRIB_ARRAY_NORMALIZED   = 0x886a\ngl.VERTEX_ATTRIB_ARRAY_POINTER  = 0x8645\ngl.VERTEX_ATTRIB_ARRAY_SIZE = 0x8623\ngl.VERTEX_ATTRIB_ARRAY_STRIDE   = 0x8624\ngl.VERTEX_ATTRIB_ARRAY_TYPE = 0x8625\ngl.VERTEX_SHADER    = 0x8b31\ngl.VERTEX_SHADER_BIT_EXT    = 0x1\ngl.VIEWPORT = 0xba2\ngl.VIV_shader_binary    = 0x1\ngl.WAIT_FAILED_APPLE    = 0x911d\ngl.WRITEONLY_RENDERING_QCOM = 0x8823\ngl.WRITE_ONLY_OES   = 0x88b9\ngl.Z400_BINARY_AMD  = 0x8740\ngl.ZERO = 0x0\n"
  },
  {
    "path": "Resources/StudioConstants.lua",
    "content": "ccs = ccs or {}\n\n\nccs.MovementEventType = {\n    start = 0,\n    complete = 1,\n    loopComplete = 2, \n}\n"
  },
  {
    "path": "Resources/extern.lua",
    "content": "function clone(object)\n    local lookup_table = {}\n    local function _copy(object)\n        if type(object) ~= \"table\" then\n            return object\n        elseif lookup_table[object] then\n            return lookup_table[object]\n        end\n        local new_table = {}\n        lookup_table[object] = new_table\n        for key, value in pairs(object) do\n            new_table[_copy(key)] = _copy(value)\n        end\n        return setmetatable(new_table, getmetatable(object))\n    end\n    return _copy(object)\nend\n\n--Create an class.\nfunction class(classname, super)\n    local superType = type(super)\n    local cls\n\n    if superType ~= \"function\" and superType ~= \"table\" then\n        superType = nil\n        super = nil\n    end\n\n    if superType == \"function\" or (super and super.__ctype == 1) then\n        -- inherited from native C++ Object\n        cls = {}\n\n        if superType == \"table\" then\n            -- copy fields from super\n            for k,v in pairs(super) do cls[k] = v end\n            cls.__create = super.__create\n            cls.super    = super\n        else\n            cls.__create = super\n        end\n\n        cls.ctor    = function() end\n        cls.__cname = classname\n        cls.__ctype = 1\n\n        function cls.new(...)\n            local instance = cls.__create(...)\n            -- copy fields from class to native object\n            for k,v in pairs(cls) do instance[k] = v end\n            instance.class = cls\n            instance:ctor(...)\n            return instance\n        end\n\n    else\n        -- inherited from Lua Object\n        if super then\n            cls = clone(super)\n            cls.super = super\n        else\n            cls = {ctor = function() end}\n        end\n\n        cls.__cname = classname\n        cls.__ctype = 2 -- lua\n        cls.__index = cls\n\n        function cls.new(...)\n            local instance = setmetatable({}, cls)\n            instance.class = cls\n            instance:ctor(...)\n            return instance\n        end\n    end\n\n    return cls\nend\n\nfunction schedule(node, callback, delay)\n    local delay = cc.DelayTime:create(delay)\n    local sequence = cc.Sequence:create(delay, cc.CallFunc:create(callback))\n    local action = cc.RepeatForever:create(sequence)\n    node:runAction(action)\n    return action\nend\n\nfunction performWithDelay(node, callback, delay)\n    local delay = cc.DelayTime:create(delay)\n    local sequence = cc.Sequence:create(delay, cc.CallFunc:create(callback))\n    node:runAction(sequence)\n    return sequence\nend\n\n"
  },
  {
    "path": "Resources/json.lua",
    "content": "-----------------------------------------------------------------------------\n-- JSON4Lua: JSON encoding / decoding support for the Lua language.\n-- json Module.\n-- Author: Craig Mason-Jones\n-- Homepage: http://json.luaforge.net/\n-- Version: 0.9.40\n-- This module is released under the MIT License (MIT).\n-- Please see LICENCE.txt for details.\n--\n-- USAGE:\n-- This module exposes two functions:\n--   encode(o)\n--     Returns the table / string / boolean / number / nil / json.null value as a JSON-encoded string.\n--   decode(json_string)\n--     Returns a Lua object populated with the data encoded in the JSON string json_string.\n--\n-- REQUIREMENTS:\n--   compat-5.1 if using Lua 5.0\n--\n-- CHANGELOG\n--   0.9.20 Introduction of local Lua functions for private functions (removed _ function prefix). \n--          Fixed Lua 5.1 compatibility issues.\n--   \t\tIntroduced json.null to have null values in associative arrays.\n--          encode() performance improvement (more than 50%) through table.concat rather than ..\n--          Introduced decode ability to ignore /**/ comments in the JSON string.\n--   0.9.10 Fix to array encoding / decoding to correctly manage nil/null values in arrays.\n-----------------------------------------------------------------------------\n\n-----------------------------------------------------------------------------\n-- Imports and dependencies\n-----------------------------------------------------------------------------\nlocal math = require('math')\nlocal string = require(\"string\")\nlocal table = require(\"table\")\n\nlocal base = _G\n\n-----------------------------------------------------------------------------\n-- Module declaration\n-----------------------------------------------------------------------------\nmodule(\"json\")\n\n-- Public functions\n\n-- Private functions\nlocal decode_scanArray\nlocal decode_scanComment\nlocal decode_scanConstant\nlocal decode_scanNumber\nlocal decode_scanObject\nlocal decode_scanString\nlocal decode_scanWhitespace\nlocal encodeString\nlocal isArray\nlocal isEncodable\n\n-----------------------------------------------------------------------------\n-- PUBLIC FUNCTIONS\n-----------------------------------------------------------------------------\n--- Encodes an arbitrary Lua object / variable.\n-- @param v The Lua object / variable to be JSON encoded.\n-- @return String containing the JSON encoding in internal Lua string format (i.e. not unicode)\nfunction encode (v)\n  -- Handle nil values\n  if v==nil then\n    return \"null\"\n  end\n  \n  local vtype = base.type(v)  \n\n  -- Handle strings\n  if vtype=='string' then    \n    return '\"' .. encodeString(v) .. '\"'\t    -- Need to handle encoding in string\n  end\n  \n  -- Handle booleans\n  if vtype=='number' or vtype=='boolean' then\n    return base.tostring(v)\n  end\n  \n  -- Handle tables\n  if vtype=='table' then\n    local rval = {}\n    -- Consider arrays separately\n    local bArray, maxCount = isArray(v)\n    if bArray then\n      for i = 1,maxCount do\n        table.insert(rval, encode(v[i]))\n      end\n    else\t-- An object, not an array\n      for i,j in base.pairs(v) do\n        if isEncodable(i) and isEncodable(j) then\n          table.insert(rval, '\"' .. encodeString(i) .. '\":' .. encode(j))\n        end\n      end\n    end\n    if bArray then\n      return '[' .. table.concat(rval,',') ..']'\n    else\n      return '{' .. table.concat(rval,',') .. '}'\n    end\n  end\n  \n  -- Handle null values\n  if vtype=='function' and v==null then\n    return 'null'\n  end\n  \n  base.assert(false,'encode attempt to encode unsupported type ' .. vtype .. ':' .. base.tostring(v))\nend\n\n\n--- Decodes a JSON string and returns the decoded value as a Lua data structure / value.\n-- @param s The string to scan.\n-- @param [startPos] Optional starting position where the JSON string is located. Defaults to 1.\n-- @param Lua object, number The object that was scanned, as a Lua table / string / number / boolean or nil,\n-- and the position of the first character after\n-- the scanned JSON object.\nfunction decode(s, startPos)\n  startPos = startPos and startPos or 1\n  startPos = decode_scanWhitespace(s,startPos)\n  base.assert(startPos<=string.len(s), 'Unterminated JSON encoded object found at position in [' .. s .. ']')\n  local curChar = string.sub(s,startPos,startPos)\n  -- Object\n  if curChar=='{' then\n    return decode_scanObject(s,startPos)\n  end\n  -- Array\n  if curChar=='[' then\n    return decode_scanArray(s,startPos)\n  end\n  -- Number\n  if string.find(\"+-0123456789.e\", curChar, 1, true) then\n    return decode_scanNumber(s,startPos)\n  end\n  -- String\n  if curChar==[[\"]] or curChar==[[']] then\n    return decode_scanString(s,startPos)\n  end\n  if string.sub(s,startPos,startPos+1)=='/*' then\n    return decode(s, decode_scanComment(s,startPos))\n  end\n  -- Otherwise, it must be a constant\n  return decode_scanConstant(s,startPos)\nend\n\n--- The null function allows one to specify a null value in an associative array (which is otherwise\n-- discarded if you set the value with 'nil' in Lua. Simply set t = { first=json.null }\nfunction null()\n  return null -- so json.null() will also return null ;-)\nend\n-----------------------------------------------------------------------------\n-- Internal, PRIVATE functions.\n-- Following a Python-like convention, I have prefixed all these 'PRIVATE'\n-- functions with an underscore.\n-----------------------------------------------------------------------------\n\n--- Scans an array from JSON into a Lua object\n-- startPos begins at the start of the array.\n-- Returns the array and the next starting position\n-- @param s The string being scanned.\n-- @param startPos The starting position for the scan.\n-- @return table, int The scanned array as a table, and the position of the next character to scan.\nfunction decode_scanArray(s,startPos)\n  local array = {}\t-- The return value\n  local stringLen = string.len(s)\n  base.assert(string.sub(s,startPos,startPos)=='[','decode_scanArray called but array does not start at position ' .. startPos .. ' in string:\\n'..s )\n  startPos = startPos + 1\n  -- Infinite loop for array elements\n  repeat\n    startPos = decode_scanWhitespace(s,startPos)\n    base.assert(startPos<=stringLen,'JSON String ended unexpectedly scanning array.')\n    local curChar = string.sub(s,startPos,startPos)\n    if (curChar==']') then\n      return array, startPos+1\n    end\n    if (curChar==',') then\n      startPos = decode_scanWhitespace(s,startPos+1)\n    end\n    base.assert(startPos<=stringLen, 'JSON String ended unexpectedly scanning array.')\n    object, startPos = decode(s,startPos)\n    table.insert(array,object)\n  until false\nend\n\n--- Scans a comment and discards the comment.\n-- Returns the position of the next character following the comment.\n-- @param string s The JSON string to scan.\n-- @param int startPos The starting position of the comment\nfunction decode_scanComment(s, startPos)\n  base.assert( string.sub(s,startPos,startPos+1)=='/*', \"decode_scanComment called but comment does not start at position \" .. startPos)\n  local endPos = string.find(s,'*/',startPos+2)\n  base.assert(endPos~=nil, \"Unterminated comment in string at \" .. startPos)\n  return endPos+2  \nend\n\n--- Scans for given constants: true, false or null\n-- Returns the appropriate Lua type, and the position of the next character to read.\n-- @param s The string being scanned.\n-- @param startPos The position in the string at which to start scanning.\n-- @return object, int The object (true, false or nil) and the position at which the next character should be \n-- scanned.\nfunction decode_scanConstant(s, startPos)\n  local consts = { [\"true\"] = true, [\"false\"] = false, [\"null\"] = nil }\n  local constNames = {\"true\",\"false\",\"null\"}\n\n  for i,k in base.pairs(constNames) do\n    --print (\"[\" .. string.sub(s,startPos, startPos + string.len(k) -1) ..\"]\", k)\n    if string.sub(s,startPos, startPos + string.len(k) -1 )==k then\n      return consts[k], startPos + string.len(k)\n    end\n  end\n  base.assert(nil, 'Failed to scan constant from string ' .. s .. ' at starting position ' .. startPos)\nend\n\n--- Scans a number from the JSON encoded string.\n-- (in fact, also is able to scan numeric +- eqns, which is not\n-- in the JSON spec.)\n-- Returns the number, and the position of the next character\n-- after the number.\n-- @param s The string being scanned.\n-- @param startPos The position at which to start scanning.\n-- @return number, int The extracted number and the position of the next character to scan.\nfunction decode_scanNumber(s,startPos)\n  local endPos = startPos+1\n  local stringLen = string.len(s)\n  local acceptableChars = \"+-0123456789.e\"\n  while (string.find(acceptableChars, string.sub(s,endPos,endPos), 1, true)\n\tand endPos<=stringLen\n\t) do\n    endPos = endPos + 1\n  end\n  local stringValue = 'return ' .. string.sub(s,startPos, endPos-1)\n  local stringEval = base.loadstring(stringValue)\n  base.assert(stringEval, 'Failed to scan number [ ' .. stringValue .. '] in JSON string at position ' .. startPos .. ' : ' .. endPos)\n  return stringEval(), endPos\nend\n\n--- Scans a JSON object into a Lua object.\n-- startPos begins at the start of the object.\n-- Returns the object and the next starting position.\n-- @param s The string being scanned.\n-- @param startPos The starting position of the scan.\n-- @return table, int The scanned object as a table and the position of the next character to scan.\nfunction decode_scanObject(s,startPos)\n  local object = {}\n  local stringLen = string.len(s)\n  local key, value\n  base.assert(string.sub(s,startPos,startPos)=='{','decode_scanObject called but object does not start at position ' .. startPos .. ' in string:\\n' .. s)\n  startPos = startPos + 1\n  repeat\n    startPos = decode_scanWhitespace(s,startPos)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly while scanning object.')\n    local curChar = string.sub(s,startPos,startPos)\n    if (curChar=='}') then\n      return object,startPos+1\n    end\n    if (curChar==',') then\n      startPos = decode_scanWhitespace(s,startPos+1)\n    end\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly scanning object.')\n    -- Scan the key\n    key, startPos = decode(s,startPos)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly searching for value of key ' .. key)\n    startPos = decode_scanWhitespace(s,startPos)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly searching for value of key ' .. key)\n    base.assert(string.sub(s,startPos,startPos)==':','JSON object key-value assignment mal-formed at ' .. startPos)\n    startPos = decode_scanWhitespace(s,startPos+1)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly searching for value of key ' .. key)\n    value, startPos = decode(s,startPos)\n    object[key]=value\n  until false\t-- infinite loop while key-value pairs are found\nend\n\n--- Scans a JSON string from the opening inverted comma or single quote to the\n-- end of the string.\n-- Returns the string extracted as a Lua string,\n-- and the position of the next non-string character\n-- (after the closing inverted comma or single quote).\n-- @param s The string being scanned.\n-- @param startPos The starting position of the scan.\n-- @return string, int The extracted string as a Lua string, and the next character to parse.\nfunction decode_scanString(s,startPos)\n  base.assert(startPos, 'decode_scanString(..) called without start position')\n  local startChar = string.sub(s,startPos,startPos)\n  base.assert(startChar==[[']] or startChar==[[\"]],'decode_scanString called for a non-string')\n  local escaped = false\n  local endPos = startPos + 1\n  local bEnded = false\n  local stringLen = string.len(s)\n  repeat\n    local curChar = string.sub(s,endPos,endPos)\n    if not escaped then\t\n      if curChar==[[\\]] then\n        escaped = true\n      else\n        bEnded = curChar==startChar\n      end\n    else\n      -- If we're escaped, we accept the current character come what may\n      escaped = false\n    end\n    endPos = endPos + 1\n    base.assert(endPos <= stringLen+1, \"String decoding failed: unterminated string at position \" .. endPos)\n  until bEnded\n  local stringValue = 'return ' .. string.sub(s, startPos, endPos-1)\n  local stringEval = base.loadstring(stringValue)\n  base.assert(stringEval, 'Failed to load string [ ' .. stringValue .. '] in JSON4Lua.decode_scanString at position ' .. startPos .. ' : ' .. endPos)\n  return stringEval(), endPos  \nend\n\n--- Scans a JSON string skipping all whitespace from the current start position.\n-- Returns the position of the first non-whitespace character, or nil if the whole end of string is reached.\n-- @param s The string being scanned\n-- @param startPos The starting position where we should begin removing whitespace.\n-- @return int The first position where non-whitespace was encountered, or string.len(s)+1 if the end of string\n-- was reached.\nfunction decode_scanWhitespace(s,startPos)\n  local whitespace=\" \\n\\r\\t\"\n  local stringLen = string.len(s)\n  while ( string.find(whitespace, string.sub(s,startPos,startPos), 1, true)  and startPos <= stringLen) do\n    startPos = startPos + 1\n  end\n  return startPos\nend\n\n--- Encodes a string to be JSON-compatible.\n-- This just involves back-quoting inverted commas, back-quotes and newlines, I think ;-)\n-- @param s The string to return as a JSON encoded (i.e. backquoted string)\n-- @return The string appropriately escaped.\nfunction encodeString(s)\n  s = string.gsub(s,'\\\\','\\\\\\\\')\n  s = string.gsub(s,'\"','\\\\\"')\n  s = string.gsub(s,\"'\",\"\\\\'\")\n  s = string.gsub(s,'\\n','\\\\n')\n  s = string.gsub(s,'\\t','\\\\t')\n  return s \nend\n\n-- Determines whether the given Lua type is an array or a table / dictionary.\n-- We consider any table an array if it has indexes 1..n for its n items, and no\n-- other data in the table.\n-- I think this method is currently a little 'flaky', but can't think of a good way around it yet...\n-- @param t The table to evaluate as an array\n-- @return boolean, number True if the table can be represented as an array, false otherwise. If true,\n-- the second returned value is the maximum\n-- number of indexed elements in the array. \nfunction isArray(t)\n  -- Next we count all the elements, ensuring that any non-indexed elements are not-encodable \n  -- (with the possible exception of 'n')\n  local maxIndex = 0\n  for k,v in base.pairs(t) do\n    if (base.type(k)=='number' and math.floor(k)==k and 1<=k) then\t-- k,v is an indexed pair\n      if (not isEncodable(v)) then return false end\t-- All array elements must be encodable\n      maxIndex = math.max(maxIndex,k)\n    else\n      if (k=='n') then\n        if v ~= table.getn(t) then return false end  -- False if n does not hold the number of elements\n      else -- Else of (k=='n')\n        if isEncodable(v) then return false end\n      end  -- End of (k~='n')\n    end -- End of k,v not an indexed pair\n  end  -- End of loop across all pairs\n  return true, maxIndex\nend\n\n--- Determines whether the given Lua object / table / variable can be JSON encoded. The only\n-- types that are JSON encodable are: string, boolean, number, nil, table and json.null.\n-- In this implementation, all other types are ignored.\n-- @param o The object to examine.\n-- @return boolean True if the object should be JSON encoded, false if it should be ignored.\nfunction isEncodable(o)\n  local t = base.type(o)\n  return (t=='string' or t=='boolean' or t=='number' or t=='nil' or t=='table') or (t=='function' and o==null) \nend\n\n"
  },
  {
    "path": "Resources/luaj.lua",
    "content": "\nlocal luaj = {}\n\nlocal callJavaStaticMethod = LuaJavaBridge.callStaticMethod\n\nlocal function checkArguments(args, sig)\n    if type(args) ~= \"table\" then args = {} end\n    if sig then return args, sig end\n\n    sig = {\"(\"}\n    for i, v in ipairs(args) do\n        local t = type(v)\n        if t == \"number\" then\n            sig[#sig + 1] = \"F\"\n        elseif t == \"boolean\" then\n            sig[#sig + 1] = \"Z\"\n        elseif t == \"function\" then\n            sig[#sig + 1] = \"I\"\n        else\n            sig[#sig + 1] = \"Ljava/lang/String;\"\n        end\n    end\n    sig[#sig + 1] = \")V\"\n\n    return args, table.concat(sig)\nend\n\nfunction luaj.callStaticMethod(className, methodName, args, sig)\n    local args, sig = checkArguments(args, sig)\n    --echoInfo(\"luaj.callStaticMethod(\\\"%s\\\",\\n\\t\\\"%s\\\",\\n\\targs,\\n\\t\\\"%s\\\"\", className, methodName, sig)\n    return callJavaStaticMethod(className, methodName, args, sig)\nend\n\nreturn luaj\n"
  },
  {
    "path": "Resources/luaoc.lua",
    "content": "\nlocal luaoc = {}\n\nlocal callStaticMethod = LuaObjcBridge.callStaticMethod\n\nfunction luaoc.callStaticMethod(className, methodName, args)\n    local ok, ret = callStaticMethod(className, methodName, args)\n    if not ok then\n        local msg = string.format(\"luaoc.callStaticMethod(\\\"%s\\\", \\\"%s\\\", \\\"%s\\\") - error: [%s] \",\n                className, methodName, tostring(args), tostring(ret))\n        if ret == -1 then\n            print(msg .. \"INVALID PARAMETERS\")\n        elseif ret == -2 then\n            print(msg .. \"CLASS NOT FOUND\")\n        elseif ret == -3 then\n            print(msg .. \"METHOD NOT FOUND\")\n        elseif ret == -4 then\n            print(msg .. \"EXCEPTION OCCURRED\")\n        elseif ret == -5 then\n            print(msg .. \"INVALID METHOD SIGNATURE\")\n        else\n            print(msg .. \"UNKNOWN\")\n        end\n    end\n    return ok, ret\nend\n\nreturn luaoc\n"
  },
  {
    "path": "Resources/main.lua",
    "content": "require \"Cocos2d\"\nrequire \"scripts.out\"\nrequire \"scripts.tools\"\n\n-- cclog\ncclog = function(...)\n    print(string.format(...))\nend\n\n-- for CCLuaEngine traceback\nfunction __G__TRACKBACK__(msg)\n    cclog(\"----------------------------------------\")\n    cclog(\"LUA ERROR: \" .. tostring(msg) .. \"\\n\")\n    cclog(debug.traceback())\n    cclog(\"----------------------------------------\")\nend\n\nlocal function main()\n    -- avoid memory leak\n    collectgarbage(\"setpause\", 100)\n    collectgarbage(\"setstepmul\", 5000)\n\n    local startScene = require(\"scripts.StartScene\")\n    cc.Director:getInstance():runWithScene(startScene)\nend\n\nxpcall(main, __G__TRACKBACK__)\n"
  },
  {
    "path": "Resources/mobdebug.lua",
    "content": "--\n-- MobDebug 0.542\n-- Copyright 2011-13 Paul Kulchenko\n-- Based on RemDebug 1.0 Copyright Kepler Project 2005\n--\n\nlocal mobdebug = {\n  _NAME = \"mobdebug\",\n  _VERSION = 0.542,\n  _COPYRIGHT = \"Paul Kulchenko\",\n  _DESCRIPTION = \"Mobile Remote Debugger for the Lua programming language\",\n  port = os and os.getenv and os.getenv(\"MOBDEBUG_PORT\") or 8172,\n  checkcount = 200,\n  yieldtimeout = 0.02,\n}\n\nlocal coroutine = coroutine\nlocal error = error\nlocal getfenv = getfenv\nlocal setfenv = setfenv\nlocal loadstring = loadstring or load -- \"load\" replaced \"loadstring\" in Lua 5.2\nlocal io = io\nlocal os = os\nlocal pairs = pairs\nlocal require = require\nlocal setmetatable = setmetatable\nlocal string = string\nlocal tonumber = tonumber\nlocal unpack = table.unpack or unpack\nlocal rawget = rawget\n\n-- if strict.lua is used, then need to avoid referencing some global\n-- variables, as they can be undefined;\n-- use rawget to to avoid complaints from strict.lua at run-time.\n-- it's safe to do the initialization here as all these variables\n-- should get defined values (of any) before the debugging starts.\n-- there is also global 'wx' variable, which is checked as part of\n-- the debug loop as 'wx' can be loaded at any time during debugging.\nlocal genv = _G or _ENV\nlocal jit = rawget(genv, \"jit\")\nlocal MOAICoroutine = rawget(genv, \"MOAICoroutine\")\n\nif not setfenv then -- Lua 5.2\n  -- based on http://lua-users.org/lists/lua-l/2010-06/msg00314.html\n  -- this assumes f is a function\n  local function findenv(f)\n    local level = 1\n    repeat\n      local name, value = debug.getupvalue(f, level)\n      if name == '_ENV' then return level, value end\n      level = level + 1\n    until name == nil\n    return nil end\n  getfenv = function (f) return(select(2, findenv(f)) or _G) end\n  setfenv = function (f, t)\n    local level = findenv(f)\n    if level then debug.setupvalue(f, level, t) end\n    return f end\nend\n\n-- check for OS and convert file names to lower case on windows\n-- (its file system is case insensitive, but case preserving), as setting a\n-- breakpoint on x:\\Foo.lua will not work if the file was loaded as X:\\foo.lua.\n-- OSX and Windows behave the same way (case insensitive, but case preserving)\nlocal iscasepreserving = os and os.getenv and (os.getenv('WINDIR')\n  or (os.getenv('OS') or ''):match('[Ww]indows')\n  or os.getenv('DYLD_LIBRARY_PATH'))\n  or not io.open(\"/proc\")\n\n-- turn jit off based on Mike Pall's comment in this discussion:\n-- http://www.freelists.org/post/luajit/Debug-hooks-and-JIT,2\n-- \"You need to turn it off at the start if you plan to receive\n-- reliable hook calls at any later point in time.\"\nif jit and jit.off then jit.off() end\n\nlocal socket = require \"socket\"\nlocal debug = require \"debug\"\nlocal coro_debugger\nlocal coro_debugee\nlocal coroutines = {}; setmetatable(coroutines, {__mode = \"k\"}) -- \"weak\" keys\nlocal events = { BREAK = 1, WATCH = 2, RESTART = 3, STACK = 4 }\nlocal breakpoints = {}\nlocal watches = {}\nlocal lastsource\nlocal lastfile\nlocal watchescnt = 0\nlocal abort -- default value is nil; this is used in start/loop distinction\nlocal seen_hook = false\nlocal checkcount = 0\nlocal step_into = false\nlocal step_over = false\nlocal step_level = 0\nlocal stack_level = 0\nlocal server\nlocal buf\nlocal outputs = {}\nlocal iobase = {print = print}\nlocal basedir = \"\"\nlocal deferror = \"execution aborted at default debugee\"\nlocal debugee = function () \n  local a = 1\n  for _ = 1, 10 do a = a + 1 end\n  error(deferror)\nend\nlocal function q(s) return s:gsub('([%(%)%.%%%+%-%*%?%[%^%$%]])','%%%1') end\n\nlocal serpent = (function() ---- include Serpent module for serialization\nlocal n, v = \"serpent\", 0.25 -- (C) 2012-13 Paul Kulchenko; MIT License\nlocal c, d = \"Paul Kulchenko\", \"Lua serializer and pretty printer\"\nlocal snum = {[tostring(1/0)]='1/0 --[[math.huge]]',[tostring(-1/0)]='-1/0 --[[-math.huge]]',[tostring(0/0)]='0/0'}\nlocal badtype = {thread = true, userdata = true, cdata = true}\nlocal keyword, globals, G = {}, {}, (_G or _ENV)\nfor _,k in ipairs({'and', 'break', 'do', 'else', 'elseif', 'end', 'false',\n  'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat',\n  'return', 'then', 'true', 'until', 'while'}) do keyword[k] = true end\nfor k,v in pairs(G) do globals[v] = k end -- build func to name mapping\nfor _,g in ipairs({'coroutine', 'debug', 'io', 'math', 'string', 'table', 'os'}) do\n  for k,v in pairs(G[g]) do globals[v] = g..'.'..k end end\n\nlocal function s(t, opts)\n  local name, indent, fatal, maxnum = opts.name, opts.indent, opts.fatal, opts.maxnum\n  local sparse, custom, huge = opts.sparse, opts.custom, not opts.nohuge\n  local space, maxl = (opts.compact and '' or ' '), (opts.maxlevel or math.huge)\n  local iname, comm = '_'..(name or ''), opts.comment and (tonumber(opts.comment) or math.huge)\n  local seen, sref, syms, symn = {}, {'local '..iname..'={}'}, {}, 0\n  local function gensym(val) return '_'..(tostring(tostring(val)):gsub(\"[^%w]\",\"\"):gsub(\"(%d%w+)\",\n    -- tostring(val) is needed because __tostring may return a non-string value\n    function(s) if not syms[s] then symn = symn+1; syms[s] = symn end return syms[s] end)) end\n  local function safestr(s) return type(s) == \"number\" and (huge and snum[tostring(s)] or s)\n    or type(s) ~= \"string\" and tostring(s) -- escape NEWLINE/010 and EOF/026\n    or (\"%q\"):format(s):gsub(\"\\010\",\"n\"):gsub(\"\\026\",\"\\\\026\") end\n  local function comment(s,l) return comm and (l or 0) < comm and ' --[['..tostring(s)..']]' or '' end\n  local function globerr(s,l) return globals[s] and globals[s]..comment(s,l) or not fatal\n    and safestr(select(2, pcall(tostring, s))) or error(\"Can't serialize \"..tostring(s)) end\n  local function safename(path, name) -- generates foo.bar, foo[3], or foo['b a r']\n    local n = name == nil and '' or name\n    local plain = type(n) == \"string\" and n:match(\"^[%l%u_][%w_]*$\") and not keyword[n]\n    local safe = plain and n or '['..safestr(n)..']'\n    return (path or '')..(plain and path and '.' or '')..safe, safe end\n  local alphanumsort = type(opts.sortkeys) == 'function' and opts.sortkeys or function(k, o, n)  -- k=keys, o=originaltable, n=padding\n    local maxn, to = tonumber(n) or 12, {number = 'a', string = 'b'}\n    local function padnum(d) return (\"%0\"..maxn..\"d\"):format(d) end\n    table.sort(k, function(a,b)\n      -- sort numeric keys first: k[key] is non-nil for numeric keys\n      return (k[a] and 0 or to[type(a)] or 'z')..(tostring(a):gsub(\"%d+\",padnum))\n           < (k[b] and 0 or to[type(b)] or 'z')..(tostring(b):gsub(\"%d+\",padnum)) end) end\n  local function val2str(t, name, indent, insref, path, plainindex, level)\n    local ttype, level, mt = type(t), (level or 0), getmetatable(t)\n    local spath, sname = safename(path, name)\n    local tag = plainindex and\n      ((type(name) == \"number\") and '' or name..space..'='..space) or\n      (name ~= nil and sname..space..'='..space or '')\n    if seen[t] then -- already seen this element\n      sref[#sref+1] = spath..space..'='..space..seen[t]\n      return tag..'nil'..comment('ref', level) end\n    if type(mt) == 'table' and (mt.__serialize or mt.__tostring) then -- knows how to serialize itself\n      seen[t] = insref or spath\n      if mt.__serialize then t = mt.__serialize(t) else t = tostring(t) end\n      ttype = type(t) end -- new value falls through to be serialized\n    if ttype == \"table\" then\n      if level >= maxl then return tag..'{}'..comment('max', level) end\n      seen[t] = insref or spath\n      if next(t) == nil then return tag..'{}'..comment(t, level) end -- table empty\n      local maxn, o, out = math.min(#t, maxnum or #t), {}, {}\n      for key = 1, maxn do o[key] = key end\n      if not maxnum or #o < maxnum then\n        local n = #o -- n = n + 1; o[n] is much faster than o[#o+1] on large tables\n        for key in pairs(t) do if o[key] ~= key then n = n + 1; o[n] = key end end end\n      if maxnum and #o > maxnum then o[maxnum+1] = nil end\n      if opts.sortkeys and #o > maxn then alphanumsort(o, t, opts.sortkeys) end\n      local sparse = sparse and #o > maxn -- disable sparsness if only numeric keys (shorter output)\n      for n, key in ipairs(o) do\n        local value, ktype, plainindex = t[key], type(key), n <= maxn and not sparse\n        if opts.valignore and opts.valignore[value] -- skip ignored values; do nothing\n        or opts.keyallow and not opts.keyallow[key]\n        or opts.valtypeignore and opts.valtypeignore[type(value)] -- skipping ignored value types\n        or sparse and value == nil then -- skipping nils; do nothing\n        elseif ktype == 'table' or ktype == 'function' or badtype[ktype] then\n          if not seen[key] and not globals[key] then\n            sref[#sref+1] = 'placeholder'\n            local sname = safename(iname, gensym(key)) -- iname is table for local variables\n            sref[#sref] = val2str(key,sname,indent,sname,iname,true) end\n          sref[#sref+1] = 'placeholder'\n          local path = seen[t]..'['..(seen[key] or globals[key] or gensym(key))..']'\n          sref[#sref] = path..space..'='..space..(seen[value] or val2str(value,nil,indent,path))\n        else\n          out[#out+1] = val2str(value,key,indent,insref,seen[t],plainindex,level+1)\n        end\n      end\n      local prefix = string.rep(indent or '', level)\n      local head = indent and '{\\n'..prefix..indent or '{'\n      local body = table.concat(out, ','..(indent and '\\n'..prefix..indent or space))\n      local tail = indent and \"\\n\"..prefix..'}' or '}'\n      return (custom and custom(tag,head,body,tail) or tag..head..body..tail)..comment(t, level)\n    elseif badtype[ttype] then\n      seen[t] = insref or spath\n      return tag..globerr(t, level)\n    elseif ttype == 'function' then\n      seen[t] = insref or spath\n      local ok, res = pcall(string.dump, t)\n      local func = ok and ((opts.nocode and \"function() --[[..skipped..]] end\" or\n        \"loadstring(\"..safestr(res)..\",'@serialized')\")..comment(t, level))\n      return tag..(func or globerr(t, level))\n    else return tag..safestr(t) end -- handle all other types\n  end\n  local sepr = indent and \"\\n\" or \";\"..space\n  local body = val2str(t, name, indent) -- this call also populates sref\n  local tail = #sref>1 and table.concat(sref, sepr)..sepr or ''\n  local warn = opts.comment and #sref>1 and space..\"--[[incomplete output with shared/self-references skipped]]\" or ''\n  return not name and body..warn or \"do local \"..body..sepr..tail..\"return \"..name..sepr..\"end\"\nend\n\nlocal function merge(a, b) if b then for k,v in pairs(b) do a[k] = v end end; return a; end\nreturn { _NAME = n, _COPYRIGHT = c, _DESCRIPTION = d, _VERSION = v, serialize = s,\n  dump = function(a, opts) return s(a, merge({name = '_', compact = true, sparse = true}, opts)) end,\n  line = function(a, opts) return s(a, merge({sortkeys = true, comment = true}, opts)) end,\n  block = function(a, opts) return s(a, merge({indent = '  ', sortkeys = true, comment = true}, opts)) end }\nend)() ---- end of Serpent module\n\nlocal function removebasedir(path, basedir)\n  if iscasepreserving then\n    -- check if the lowercased path matches the basedir\n    -- if so, return substring of the original path (to not lowercase it)\n    return path:lower():find('^'..q(basedir:lower()))\n      and path:sub(#basedir+1) or path\n  else\n    return string.gsub(path, '^'..q(basedir), '')\n  end\nend\n\nlocal function stack(start)\n  local function vars(f)\n    local func = debug.getinfo(f, \"f\").func\n    local i = 1\n    local locals = {}\n    while true do\n      local name, value = debug.getlocal(f, i)\n      if not name then break end\n      if string.sub(name, 1, 1) ~= '(' then locals[name] = {value, tostring(value)} end\n      i = i + 1\n    end\n    i = 1\n    local ups = {}\n    while func and true do -- check for func as it may be nil for tail calls\n      local name, value = debug.getupvalue(func, i)\n      if not name then break end\n      ups[name] = {value, tostring(value)}\n      i = i + 1\n    end\n    return locals, ups\n  end\n\n  local stack = {}\n  for i = (start or 0), 100 do\n    local source = debug.getinfo(i, \"Snl\")\n    if not source then break end\n\n    local src = source.source\n    if src:find(\"@\") == 1 then\n      src = src:sub(2):gsub(\"\\\\\", \"/\")\n      if src:find(\"%./\") == 1 then src = src:sub(3) end\n    end\n\n    table.insert(stack, { -- remove basedir from source\n      {source.name, removebasedir(src, basedir), source.linedefined,\n       source.currentline, source.what, source.namewhat, source.short_src},\n      vars(i+1)})\n    if source.what == 'main' then break end\n  end\n  return stack\nend\n\nlocal function set_breakpoint(file, line)\n  if file == '-' and lastfile then file = lastfile\n  elseif iscasepreserving then file = string.lower(file) end\n  if not breakpoints[line] then breakpoints[line] = {} end\n  breakpoints[line][file] = true\nend\n\nlocal function remove_breakpoint(file, line)\n  if file == '-' and lastfile then file = lastfile\n  elseif iscasepreserving then file = string.lower(file) end\n  if breakpoints[line] then breakpoints[line][file] = nil end\nend\n\nlocal function has_breakpoint(file, line)\n  return breakpoints[line]\n     and breakpoints[line][iscasepreserving and string.lower(file) or file]\nend\n\nlocal function restore_vars(vars)\n  if type(vars) ~= 'table' then return end\n\n  -- locals need to be processed in the reverse order, starting from\n  -- the inner block out, to make sure that the localized variables\n  -- are correctly updated with only the closest variable with\n  -- the same name being changed\n  -- first loop find how many local variables there is, while\n  -- the second loop processes them from i to 1\n  local i = 1\n  while true do\n    local name = debug.getlocal(3, i)\n    if not name then break end\n    i = i + 1\n  end\n  i = i - 1\n  local written_vars = {}\n  while i > 0 do\n    local name = debug.getlocal(3, i)\n    if not written_vars[name] then\n      if string.sub(name, 1, 1) ~= '(' then\n        debug.setlocal(3, i, rawget(vars, name))\n      end\n      written_vars[name] = true\n    end\n    i = i - 1\n  end\n\n  i = 1\n  local func = debug.getinfo(3, \"f\").func\n  while true do\n    local name = debug.getupvalue(func, i)\n    if not name then break end\n    if not written_vars[name] then\n      if string.sub(name, 1, 1) ~= '(' then\n        debug.setupvalue(func, i, rawget(vars, name))\n      end\n      written_vars[name] = true\n    end\n    i = i + 1\n  end\nend\n\nlocal function capture_vars(level)\n  local vars = {}\n  local func = debug.getinfo(level or 3, \"f\").func\n  local i = 1\n  while true do\n    local name, value = debug.getupvalue(func, i)\n    if not name then break end\n    if string.sub(name, 1, 1) ~= '(' then vars[name] = value end\n    i = i + 1\n  end\n  i = 1\n  while true do\n    local name, value = debug.getlocal(level or 3, i)\n    if not name then break end\n    if string.sub(name, 1, 1) ~= '(' then vars[name] = value end\n    i = i + 1\n  end\n  -- returned 'vars' table plays a dual role: (1) it captures local values\n  -- and upvalues to be restored later (in case they are modified in \"eval\"),\n  -- and (2) it provides an environment for evaluated chunks.\n  -- getfenv(func) is needed to provide proper environment for functions,\n  -- including access to globals, but this causes vars[name] to fail in\n  -- restore_vars on local variables or upvalues with `nil` values when\n  -- 'strict' is in effect. To avoid this `rawget` is used in restore_vars.\n  setmetatable(vars, { __index = getfenv(func), __newindex = getfenv(func) })\n  return vars\nend\n\nlocal function stack_depth(start_depth)\n  for i = start_depth, 0, -1 do\n    if debug.getinfo(i, \"l\") then return i+1 end\n  end\n  return start_depth\nend\n\nlocal function is_safe(stack_level)\n  -- the stack grows up: 0 is getinfo, 1 is is_safe, 2 is debug_hook, 3 is user function\n  if stack_level == 3 then return true end\n  for i = 3, stack_level do\n    -- return if it is not safe to abort\n    local info = debug.getinfo(i, \"S\")\n    if not info then return true end\n    if info.what == \"C\" then return false end\n  end\n  return true\nend\n\nlocal function in_debugger()\n  local this = debug.getinfo(1, \"S\").source\n  -- only need to check few frames as mobdebug frames should be close\n  for i = 3, 7 do\n    local info = debug.getinfo(i, \"S\")\n    if not info then return false end\n    if info.source == this then return true end\n  end\n  return false\nend\n\nlocal function is_pending(peer)\n  -- if there is something already in the buffer, skip check\n  if not buf and checkcount >= mobdebug.checkcount then\n    peer:settimeout(0) -- non-blocking\n    buf = peer:receive(1)\n    peer:settimeout() -- back to blocking\n    checkcount = 0\n  end\n  return buf\nend\n\nlocal function debug_hook(event, line)\n  -- (1) LuaJIT needs special treatment. Because debug_hook is set for\n  -- *all* coroutines, and not just the one being debugged as in regular Lua\n  -- (http://lua-users.org/lists/lua-l/2011-06/msg00513.html),\n  -- need to avoid debugging mobdebug's own code as LuaJIT doesn't\n  -- always correctly generate call/return hook events (there are more\n  -- calls than returns, which breaks stack depth calculation and\n  -- 'step' and 'step over' commands stop working; possibly because\n  -- 'tail return' events are not generated by LuaJIT).\n  -- the next line checks if the debugger is run under LuaJIT and if\n  -- one of debugger methods is present in the stack, it simply returns.\n  if jit then\n    -- when luajit is compiled with LUAJIT_ENABLE_LUA52COMPAT,\n    -- coroutine.running() returns non-nil for the main thread.\n    local coro, main = coroutine.running()\n    if not coro or main then coro = 'main' end\n    local disabled = coroutines[coro] == false\n      or coroutines[coro] == nil and coro ~= (coro_debugee or 'main')\n    if coro_debugee and disabled or not coro_debugee and (disabled or in_debugger())\n    then return end\n  end\n\n  -- (2) check if abort has been requested and it's safe to abort\n  if abort and is_safe(stack_level) then error(abort) end\n\n  -- (3) also check if this debug hook has not been visited for any reason.\n  -- this check is needed to avoid stepping in too early\n  -- (for example, when coroutine.resume() is executed inside start()).\n  if not seen_hook and in_debugger() then return end\n\n  if event == \"call\" then\n    stack_level = stack_level + 1\n  elseif event == \"return\" or event == \"tail return\" then\n    stack_level = stack_level - 1\n  elseif event == \"line\" then\n    -- may need to fall through because of the following:\n    -- (1) step_into\n    -- (2) step_over and stack_level <= step_level (need stack_level)\n    -- (3) breakpoint; check for line first as it's known; then for file\n    -- (4) socket call (only do every Xth check)\n    -- (5) at least one watch is registered\n    if not (\n      step_into or step_over or breakpoints[line] or watchescnt > 0\n      or is_pending(server)\n    ) then checkcount = checkcount + 1; return end\n\n    checkcount = mobdebug.checkcount -- force check on the next command\n\n    -- this is needed to check if the stack got shorter or longer.\n    -- unfortunately counting call/return calls is not reliable.\n    -- the discrepancy may happen when \"pcall(load, '')\" call is made\n    -- or when \"error()\" is called in a function.\n    -- in either case there are more \"call\" than \"return\" events reported.\n    -- this validation is done for every \"line\" event, but should be \"cheap\"\n    -- as it checks for the stack to get shorter (or longer by one call).\n    -- start from one level higher just in case we need to grow the stack.\n    -- this may happen after coroutine.resume call to a function that doesn't\n    -- have any other instructions to execute. it triggers three returns:\n    -- \"return, tail return, return\", which needs to be accounted for.\n    stack_level = stack_depth(stack_level+1)\n\n    local caller = debug.getinfo(2, \"S\")\n\n    -- grab the filename and fix it if needed\n    local file = lastfile\n    if (lastsource ~= caller.source) then\n      file, lastsource = caller.source, caller.source\n      -- technically, users can supply names that may not use '@',\n      -- for example when they call loadstring('...', 'filename.lua').\n      -- Unfortunately, there is no reliable/quick way to figure out\n      -- what is the filename and what is the source code.\n      -- The following will work if the supplied filename uses Unix path.\n      if file:find(\"^@\") then\n        file = file:gsub(\"^@\", \"\"):gsub(\"\\\\\", \"/\")\n        -- need this conversion to be applied to relative and absolute\n        -- file names as you may write \"require 'Foo'\" to\n        -- load \"foo.lua\" (on a case insensitive file system) and breakpoints\n        -- set on foo.lua will not work if not converted to the same case.\n        if iscasepreserving then file = string.lower(file) end\n        if file:find(\"%./\") == 1 then file = file:sub(3)\n        else file = file:gsub('^'..q(basedir), '') end\n        -- some file systems allow newlines in file names; remove these.\n        file = file:gsub(\"\\n\", ' ')\n      else\n        -- this is either a file name coming from loadstring(\"chunk\", \"file\"),\n        -- or the actual source code that needs to be serialized (as it may\n        -- include newlines); assume it's a file name if it's all on one line.\n        file = file:find(\"[\\r\\n]\") and serpent.line(file) or file\n      end\n\n      -- set to true if we got here; this only needs to be done once per\n      -- session, so do it here to at least avoid setting it for every line.\n      seen_hook = true\n      lastfile = file\n    end\n\n    local vars, status, res\n    if (watchescnt > 0) then\n      vars = capture_vars()\n      for index, value in pairs(watches) do\n        setfenv(value, vars)\n        local ok, fired = pcall(value)\n        if ok and fired then\n          status, res = coroutine.resume(coro_debugger, events.WATCH, vars, file, line, index)\n          break -- any one watch is enough; don't check multiple times\n        end\n      end\n    end\n\n    -- need to get into the \"regular\" debug handler, but only if there was\n    -- no watch that was fired. If there was a watch, handle its result.\n    local getin = (status == nil) and\n      (step_into\n      or (step_over and stack_level <= step_level)\n      or has_breakpoint(file, line)\n      or is_pending(server))\n\n    if getin then\n      vars = vars or capture_vars()\n      step_into = false\n      step_over = false\n      status, res = coroutine.resume(coro_debugger, events.BREAK, vars, file, line)\n    end\n\n    -- handle 'stack' command that provides stack() information to the debugger\n    if status and res == 'stack' then\n      while status and res == 'stack' do\n        -- resume with the stack trace and variables\n        if vars then restore_vars(vars) end -- restore vars so they are reflected in stack values\n        -- this may fail if __tostring method fails at run-time\n        local ok, snapshot = pcall(stack, 4)\n        status, res = coroutine.resume(coro_debugger, ok and events.STACK or events.BREAK, snapshot, file, line)\n      end\n    end\n\n    -- need to recheck once more as resume after 'stack' command may\n    -- return something else (for example, 'exit'), which needs to be handled\n    if status and res and res ~= 'stack' then\n      if abort == nil and res == \"exit\" then os.exit(1); return end\n      abort = res\n      -- only abort if safe; if not, there is another (earlier) check inside\n      -- debug_hook, which will abort execution at the first safe opportunity\n      if is_safe(stack_level) then error(abort) end\n    elseif not status and res then\n      error(res, 2) -- report any other (internal) errors back to the application\n    end\n\n    if vars then restore_vars(vars) end\n  end\nend\n\nlocal function stringify_results(status, ...)\n  if not status then return status, ... end -- on error report as it\n\n  local t = {...}\n  for i,v in pairs(t) do -- stringify each of the returned values\n    local ok, res = pcall(serpent.line, v, {nocode = true, comment = 1})\n    t[i] = ok and res or (\"%q\"):format(res):gsub(\"\\010\",\"n\"):gsub(\"\\026\",\"\\\\026\")\n  end\n  -- stringify table with all returned values\n  -- this is done to allow each returned value to be used (serialized or not)\n  -- intependently and to preserve \"original\" comments\n  return pcall(serpent.dump, t, {sparse = false})\nend\n\nlocal function debugger_loop(sev, svars, sfile, sline)\n  local command\n  local app, osname\n  local eval_env = svars or {}\n  local function emptyWatch () return false end\n  local loaded = {}\n  for k in pairs(package.loaded) do loaded[k] = true end\n\n  while true do\n    local line, err\n    local wx = rawget(genv, \"wx\") -- use rawread to make strict.lua happy\n    if (wx or mobdebug.yield) and server.settimeout then server:settimeout(mobdebug.yieldtimeout) end\n    while true do\n      line, err = server:receive()\n      if not line and err == \"timeout\" then\n        -- yield for wx GUI applications if possible to avoid \"busyness\"\n        app = app or (wx and wx.wxGetApp and wx.wxGetApp())\n        if app then\n          local win = app:GetTopWindow()\n          local inloop = app:IsMainLoopRunning()\n          osname = osname or wx.wxPlatformInfo.Get():GetOperatingSystemFamilyName()\n          if win and not inloop then\n            -- process messages in a regular way\n            -- and exit as soon as the event loop is idle\n            if osname == 'Unix' then wx.wxTimer(app):Start(10, true) end\n            local exitLoop = function()\n              win:Disconnect(wx.wxID_ANY, wx.wxID_ANY, wx.wxEVT_IDLE)\n              win:Disconnect(wx.wxID_ANY, wx.wxID_ANY, wx.wxEVT_TIMER)\n              app:ExitMainLoop()\n            end\n            win:Connect(wx.wxEVT_IDLE, exitLoop)\n            win:Connect(wx.wxEVT_TIMER, exitLoop)\n            app:MainLoop()\n          end\n        elseif mobdebug.yield then mobdebug.yield()\n        end\n      elseif not line and err == \"closed\" then\n        error(\"Debugger connection unexpectedly closed\", 0)\n      else\n        -- if there is something in the pending buffer, prepend it to the line\n        if buf then line = buf .. line; buf = nil end\n        break\n      end\n    end\n    if server.settimeout then server:settimeout() end -- back to blocking\n    command = string.sub(line, string.find(line, \"^[A-Z]+\"))\n    if command == \"SETB\" then\n      local _, _, _, file, line = string.find(line, \"^([A-Z]+)%s+(.-)%s+(%d+)%s*$\")\n      if file and line then\n        set_breakpoint(file, tonumber(line))\n        server:send(\"200 OK\\n\")\n      else\n        server:send(\"400 Bad Request\\n\")\n      end\n    elseif command == \"DELB\" then\n      local _, _, _, file, line = string.find(line, \"^([A-Z]+)%s+(.-)%s+(%d+)%s*$\")\n      if file and line then\n        remove_breakpoint(file, tonumber(line))\n        server:send(\"200 OK\\n\")\n      else\n        server:send(\"400 Bad Request\\n\")\n      end\n    elseif command == \"EXEC\" then\n      local _, _, chunk = string.find(line, \"^[A-Z]+%s+(.+)$\")\n      if chunk then \n        local func, res = loadstring(chunk)\n        local status\n        if func then\n          setfenv(func, eval_env)\n          status, res = stringify_results(pcall(func))\n        end\n        if status then\n          server:send(\"200 OK \" .. #res .. \"\\n\")\n          server:send(res)\n        else\n          server:send(\"401 Error in Expression \" .. #res .. \"\\n\")\n          server:send(res)\n        end\n      else\n        server:send(\"400 Bad Request\\n\")\n      end\n    elseif command == \"LOAD\" then\n      local _, _, size, name = string.find(line, \"^[A-Z]+%s+(%d+)%s+(%S.-)%s*$\")\n      size = tonumber(size)\n\n      if abort == nil then -- no LOAD/RELOAD allowed inside start()\n        if size > 0 then server:receive(size) end\n        if sfile and sline then\n          server:send(\"201 Started \" .. sfile .. \" \" .. sline .. \"\\n\")\n        else\n          server:send(\"200 OK 0\\n\")\n        end\n      else\n        -- reset environment to allow required modules to load again\n        -- remove those packages that weren't loaded when debugger started\n        for k in pairs(package.loaded) do\n          if not loaded[k] then package.loaded[k] = nil end\n        end\n\n        if size == 0 and name == '-' then -- RELOAD the current script being debugged\n          server:send(\"200 OK 0\\n\")\n          coroutine.yield(\"load\")\n        else\n          -- receiving 0 bytes blocks (at least in luasocket 2.0.2), so skip reading\n          local chunk = size == 0 and \"\" or server:receive(size)\n          if chunk then -- LOAD a new script for debugging\n            local func, res = loadstring(chunk, \"@\"..name)\n            if func then\n              server:send(\"200 OK 0\\n\")\n              debugee = func\n              coroutine.yield(\"load\")\n            else\n              server:send(\"401 Error in Expression \" .. #res .. \"\\n\")\n              server:send(res)\n            end\n          else\n            server:send(\"400 Bad Request\\n\")\n          end\n        end\n      end\n    elseif command == \"SETW\" then\n      local _, _, exp = string.find(line, \"^[A-Z]+%s+(.+)%s*$\")\n      if exp then \n        local func, res = loadstring(\"return(\" .. exp .. \")\")\n        if func then\n          watchescnt = watchescnt + 1\n          local newidx = #watches + 1\n          watches[newidx] = func\n          server:send(\"200 OK \" .. newidx .. \"\\n\") \n        else\n          server:send(\"401 Error in Expression \" .. #res .. \"\\n\")\n          server:send(res)\n        end\n      else\n        server:send(\"400 Bad Request\\n\")\n      end\n    elseif command == \"DELW\" then\n      local _, _, index = string.find(line, \"^[A-Z]+%s+(%d+)%s*$\")\n      index = tonumber(index)\n      if index > 0 and index <= #watches then\n        watchescnt = watchescnt - (watches[index] ~= emptyWatch and 1 or 0)\n        watches[index] = emptyWatch\n        server:send(\"200 OK\\n\")\n      else\n        server:send(\"400 Bad Request\\n\")\n      end\n    elseif command == \"RUN\" then\n      server:send(\"200 OK\\n\")\n\n      local ev, vars, file, line, idx_watch = coroutine.yield()\n      eval_env = vars\n      if ev == events.BREAK then\n        server:send(\"202 Paused \" .. file .. \" \" .. line .. \"\\n\")\n      elseif ev == events.WATCH then\n        server:send(\"203 Paused \" .. file .. \" \" .. line .. \" \" .. idx_watch .. \"\\n\")\n      elseif ev == events.RESTART then\n        -- nothing to do\n      else\n        server:send(\"401 Error in Execution \" .. #file .. \"\\n\")\n        server:send(file)\n      end\n    elseif command == \"STEP\" then\n      server:send(\"200 OK\\n\")\n      step_into = true\n\n      local ev, vars, file, line, idx_watch = coroutine.yield()\n      eval_env = vars\n      if ev == events.BREAK then\n        server:send(\"202 Paused \" .. file .. \" \" .. line .. \"\\n\")\n      elseif ev == events.WATCH then\n        server:send(\"203 Paused \" .. file .. \" \" .. line .. \" \" .. idx_watch .. \"\\n\")\n      elseif ev == events.RESTART then\n        -- nothing to do\n      else\n        server:send(\"401 Error in Execution \" .. #file .. \"\\n\")\n        server:send(file)\n      end\n    elseif command == \"OVER\" or command == \"OUT\" then\n      server:send(\"200 OK\\n\")\n      step_over = true\n      \n      -- OVER and OUT are very similar except for \n      -- the stack level value at which to stop\n      if command == \"OUT\" then step_level = stack_level - 1\n      else step_level = stack_level end\n\n      local ev, vars, file, line, idx_watch = coroutine.yield()\n      eval_env = vars\n      if ev == events.BREAK then\n        server:send(\"202 Paused \" .. file .. \" \" .. line .. \"\\n\")\n      elseif ev == events.WATCH then\n        server:send(\"203 Paused \" .. file .. \" \" .. line .. \" \" .. idx_watch .. \"\\n\")\n      elseif ev == events.RESTART then\n        -- nothing to do\n      else\n        server:send(\"401 Error in Execution \" .. #file .. \"\\n\")\n        server:send(file)\n      end\n    elseif command == \"BASEDIR\" then\n      local _, _, dir = string.find(line, \"^[A-Z]+%s+(.+)%s*$\")\n      if dir then\n        basedir = iscasepreserving and string.lower(dir) or dir\n        -- reset cached source as it may change with basedir\n        lastsource = nil\n        server:send(\"200 OK\\n\")\n      else\n        server:send(\"400 Bad Request\\n\")\n      end\n    elseif command == \"SUSPEND\" then\n      -- do nothing; it already fulfilled its role\n    elseif command == \"STACK\" then\n      -- first check if we can execute the stack command\n      -- as it requires yielding back to debug_hook it cannot be executed\n      -- if we have not seen the hook yet as happens after start().\n      -- in this case we simply return an empty result\n      local vars, ev = {}\n      if seen_hook then\n        ev, vars = coroutine.yield(\"stack\")\n      end\n      if ev and ev ~= events.STACK then\n        server:send(\"401 Error in Execution \" .. #vars .. \"\\n\")\n        server:send(vars)\n      else\n        local ok, res = pcall(serpent.dump, vars, {nocode = true, sparse = false})\n        if ok then\n          server:send(\"200 OK \" .. res .. \"\\n\")\n        else\n          server:send(\"401 Error in Execution \" .. #res .. \"\\n\")\n          server:send(res)\n        end\n      end\n    elseif command == \"OUTPUT\" then\n      local _, _, stream, mode = string.find(line, \"^[A-Z]+%s+(%w+)%s+([dcr])%s*$\")\n      if stream and mode and stream == \"stdout\" then\n        -- assign \"print\" in the global environment\n        genv.print = mode == 'd' and iobase.print or coroutine.wrap(function(...)\n          -- wrapping into coroutine.wrap protects this function from\n          -- being stepped through in the debugger\n          local tbl = {...}\n          while true do\n            if mode == 'c' then iobase.print(unpack(tbl)) end\n            for n = 1, #tbl do\n              tbl[n] = select(2, pcall(serpent.line, tbl[n], {nocode = true, comment = false})) end\n            local file = table.concat(tbl, \"\\t\")..\"\\n\"\n            server:send(\"204 Output \" .. stream .. \" \" .. #file .. \"\\n\" .. file)\n            tbl = {coroutine.yield()}\n          end\n        end)\n        server:send(\"200 OK\\n\")\n      else\n        server:send(\"400 Bad Request\\n\")\n      end\n    elseif command == \"EXIT\" then\n      server:send(\"200 OK\\n\")\n      coroutine.yield(\"exit\")\n    else\n      server:send(\"400 Bad Request\\n\")\n    end\n  end\nend\n\nlocal function connect(controller_host, controller_port)\n  return (socket.connect4 or socket.connect)(controller_host, controller_port)\nend\n\nlocal function isrunning()\n  return coro_debugger and coroutine.status(coro_debugger) == 'suspended'\nend\n\nlocal lasthost, lastport\n\n-- Starts a debug session by connecting to a controller\nlocal function start(controller_host, controller_port)\n  -- only one debugging session can be run (as there is only one debug hook)\n  if isrunning() then return end\n\n  lasthost = controller_host or lasthost\n  lastport = controller_port or lastport\n\n  controller_host = lasthost or \"localhost\"\n  controller_port = lastport or mobdebug.port\n\n  local err\n  server, err = (socket.connect4 or socket.connect)(controller_host, controller_port)\n  if server then\n    -- correct stack depth which already has some calls on it\n    -- so it doesn't go into negative when those calls return\n    -- as this breaks subsequence checks in stack_depth().\n    -- start from 16th frame, which is sufficiently large for this check.\n    stack_level = stack_depth(16)\n\n    -- provide our own traceback function to report the error remotely\n    do\n      local dtraceback = debug.traceback\n      debug.traceback = function (...)\n        if select('#', ...) >= 1 then\n          local err, lvl = ...\n          if err and type(err) ~= 'thread' then\n            local trace = dtraceback(err, (lvl or 2)+1)\n            if genv.print == iobase.print then -- no remote redirect\n              return trace\n            else\n              genv.print(trace) -- report the error remotely\n              return -- don't report locally to avoid double reporting\n            end\n          end\n        end\n        -- direct call to debug.traceback: return the original.\n        -- debug.traceback(nil, level) doesn't work in Lua 5.1\n        -- (http://lua-users.org/lists/lua-l/2011-06/msg00574.html), so\n        -- simply remove first frame from the stack trace\n        return (dtraceback(...):gsub(\"(stack traceback:\\n)[^\\n]*\\n\", \"%1\"))\n      end\n    end\n    coro_debugger = coroutine.create(debugger_loop)\n    debug.sethook(debug_hook, \"lcr\")\n    seen_hook = nil -- reset in case the last start() call was refused\n    step_into = true -- start with step command\n    return true\n  else\n    print((\"Could not connect to %s:%s: %s\")\n      :format(controller_host, controller_port, err or \"unknown error\"))\n  end\nend\n\nlocal function controller(controller_host, controller_port, scratchpad)\n  -- only one debugging session can be run (as there is only one debug hook)\n  if isrunning() then return end\n\n  lasthost = controller_host or lasthost\n  lastport = controller_port or lastport\n\n  controller_host = lasthost or \"localhost\"\n  controller_port = lastport or mobdebug.port\n\n  local exitonerror = not scratchpad\n  local err\n  server, err = (socket.connect4 or socket.connect)(controller_host, controller_port)\n  if server then\n    local function report(trace, err)\n      local msg = err .. \"\\n\" .. trace\n      server:send(\"401 Error in Execution \" .. #msg .. \"\\n\")\n      server:send(msg)\n      return err\n    end\n\n    seen_hook = true -- allow to accept all commands\n    coro_debugger = coroutine.create(debugger_loop)\n\n    while true do\n      step_into = true -- start with step command\n      abort = false -- reset abort flag from the previous loop\n      if scratchpad then checkcount = mobdebug.checkcount end -- force suspend right away\n\n      coro_debugee = coroutine.create(debugee)\n      debug.sethook(coro_debugee, debug_hook, \"lcr\")\n      local status, err = coroutine.resume(coro_debugee)\n\n      -- was there an error or is the script done?\n      -- 'abort' state is allowed here; ignore it\n      if abort then\n        if tostring(abort) == 'exit' then break end\n      else\n        if status then -- normal execution is done\n          break\n        elseif err and not tostring(err):find(deferror) then\n          -- report the error back\n          -- err is not necessarily a string, so convert to string to report\n          report(debug.traceback(coro_debugee), tostring(err))\n          if exitonerror then break end\n          -- resume once more to clear the response the debugger wants to send\n          -- need to use capture_vars(2) as three would be the level of\n          -- the caller for controller(), but because of the tail call,\n          -- the caller may not exist;\n          -- This is not entirely safe as the user may see the local\n          -- variable from console, but they will be reset anyway.\n          -- This functionality is used when scratchpad is paused to\n          -- gain access to remote console to modify global variables.\n          local status, err = coroutine.resume(coro_debugger, events.RESTART, capture_vars(2))\n          if not status or status and err == \"exit\" then break end\n        end\n      end\n    end\n  else\n    print((\"Could not connect to %s:%s: %s\")\n      :format(controller_host, controller_port, err or \"unknown error\"))\n    return false\n  end\n  return true\nend\n\nlocal function scratchpad(controller_host, controller_port)\n  return controller(controller_host, controller_port, true)\nend\n\nlocal function loop(controller_host, controller_port)\n  return controller(controller_host, controller_port, false)\nend\n\nlocal function on()\n  if not (isrunning() and server) then return end\n\n  -- main is set to true under Lua5.2 for the \"main\" chunk.\n  -- Lua5.1 returns co as `nil` in that case.\n  local co, main = coroutine.running()\n  if main then co = nil end\n  if co then\n    coroutines[co] = true\n    debug.sethook(co, debug_hook, \"lcr\")\n  else\n    if jit then coroutines.main = true end\n    debug.sethook(debug_hook, \"lcr\")\n  end\nend\n\nlocal function off()\n  if not (isrunning() and server) then return end\n\n  -- main is set to true under Lua5.2 for the \"main\" chunk.\n  -- Lua5.1 returns co as `nil` in that case.\n  local co, main = coroutine.running()\n  if main then co = nil end\n\n  -- don't remove coroutine hook under LuaJIT as there is only one (global) hook\n  if co then\n    coroutines[co] = false\n    if not jit then debug.sethook(co) end\n  else\n    if jit then coroutines.main = false end\n    if not jit then debug.sethook() end\n  end\n\n  -- check if there is any thread that is still being debugged under LuaJIT;\n  -- if not, turn the debugging off\n  if jit then\n    local remove = true\n    for co, debugged in pairs(coroutines) do\n      if debugged then remove = false; break end\n    end\n    if remove then debug.sethook() end\n  end\nend\n\n-- Handles server debugging commands \nlocal function handle(params, client, options)\n  local _, _, command = string.find(params, \"^([a-z]+)\")\n  local file, line, watch_idx\n  if command == \"run\" or command == \"step\" or command == \"out\"\n  or command == \"over\" or command == \"exit\" then\n    client:send(string.upper(command) .. \"\\n\")\n    client:receive() -- this should consume the first '200 OK' response\n    while true do\n      local done = true\n      local breakpoint = client:receive()\n      if not breakpoint then\n        print(\"Program finished\")\n        os.exit()\n        return -- use return here for those cases where os.exit() is not wanted\n      end\n      local _, _, status = string.find(breakpoint, \"^(%d+)\")\n      if status == \"200\" then\n        -- don't need to do anything\n      elseif status == \"202\" then\n        _, _, file, line = string.find(breakpoint, \"^202 Paused%s+(.-)%s+(%d+)%s*$\")\n        if file and line then\n          print(\"Paused at file \" .. file .. \" line \" .. line)\n        end\n      elseif status == \"203\" then\n        _, _, file, line, watch_idx = string.find(breakpoint, \"^203 Paused%s+(.-)%s+(%d+)%s+(%d+)%s*$\")\n        if file and line and watch_idx then\n          print(\"Paused at file \" .. file .. \" line \" .. line .. \" (watch expression \" .. watch_idx .. \": [\" .. watches[watch_idx] .. \"])\")\n        end\n      elseif status == \"204\" then\n        local _, _, stream, size = string.find(breakpoint, \"^204 Output (%w+) (%d+)$\")\n        if stream and size then\n          local msg = client:receive(tonumber(size))\n          print(msg)\n          if outputs[stream] then outputs[stream](msg) end\n          -- this was just the output, so go back reading the response\n          done = false\n        end\n      elseif status == \"401\" then\n        local _, _, size = string.find(breakpoint, \"^401 Error in Execution (%d+)$\")\n        if size then\n          local msg = client:receive(tonumber(size))\n          print(\"Error in remote application: \" .. msg)\n          os.exit(1)\n          return nil, nil, msg -- use return here for those cases where os.exit() is not wanted\n        end\n      else\n        print(\"Unknown error\")\n        os.exit(1)\n        -- use return here for those cases where os.exit() is not wanted\n        return nil, nil, \"Debugger error: unexpected response '\" .. breakpoint .. \"'\"\n      end\n      if done then break end\n    end\n  elseif command == \"setb\" then\n    _, _, _, file, line = string.find(params, \"^([a-z]+)%s+(.-)%s+(%d+)%s*$\")\n    if file and line then\n      -- if this is a file name, and not a file source\n      if not file:find('^\".*\"$') then\n        file = string.gsub(file, \"\\\\\", \"/\") -- convert slash\n        file = removebasedir(file, basedir)\n      end\n      client:send(\"SETB \" .. file .. \" \" .. line .. \"\\n\")\n      if client:receive() == \"200 OK\" then\n        set_breakpoint(file, line)\n      else\n        print(\"Error: breakpoint not inserted\")\n      end\n    else\n      print(\"Invalid command\")\n    end\n  elseif command == \"setw\" then\n    local _, _, exp = string.find(params, \"^[a-z]+%s+(.+)$\")\n    if exp then\n      client:send(\"SETW \" .. exp .. \"\\n\")\n      local answer = client:receive()\n      local _, _, watch_idx = string.find(answer, \"^200 OK (%d+)%s*$\")\n      if watch_idx then\n        watches[watch_idx] = exp\n        print(\"Inserted watch exp no. \" .. watch_idx)\n      else\n        local _, _, size = string.find(answer, \"^401 Error in Expression (%d+)$\")\n        if size then\n          local err = client:receive(tonumber(size)):gsub(\".-:%d+:%s*\",\"\")\n          print(\"Error: watch expression not set: \" .. err)\n        else\n          print(\"Error: watch expression not set\")\n        end\n      end\n    else\n      print(\"Invalid command\")\n    end\n  elseif command == \"delb\" then\n    _, _, _, file, line = string.find(params, \"^([a-z]+)%s+(.-)%s+(%d+)%s*$\")\n    if file and line then\n      -- if this is a file name, and not a file source\n      if not file:find('^\".*\"$') then\n        file = string.gsub(file, \"\\\\\", \"/\") -- convert slash\n        file = removebasedir(file, basedir)\n      end\n      client:send(\"DELB \" .. file .. \" \" .. line .. \"\\n\")\n      if client:receive() == \"200 OK\" then \n        remove_breakpoint(file, line)\n      else\n        print(\"Error: breakpoint not removed\")\n      end\n    else\n      print(\"Invalid command\")\n    end\n  elseif command == \"delallb\" then\n    for line, breaks in pairs(breakpoints) do\n      for file, _ in pairs(breaks) do\n        client:send(\"DELB \" .. file .. \" \" .. line .. \"\\n\")\n        if client:receive() == \"200 OK\" then\n          remove_breakpoint(file, line)\n        else\n          print(\"Error: breakpoint at file \" .. file .. \" line \" .. line .. \" not removed\")\n        end\n      end\n    end\n  elseif command == \"delw\" then\n    local _, _, index = string.find(params, \"^[a-z]+%s+(%d+)%s*$\")\n    if index then\n      client:send(\"DELW \" .. index .. \"\\n\")\n      if client:receive() == \"200 OK\" then \n        watches[index] = nil\n      else\n        print(\"Error: watch expression not removed\")\n      end\n    else\n      print(\"Invalid command\")\n    end\n  elseif command == \"delallw\" then\n    for index, exp in pairs(watches) do\n      client:send(\"DELW \" .. index .. \"\\n\")\n      if client:receive() == \"200 OK\" then \n        watches[index] = nil\n      else\n        print(\"Error: watch expression at index \" .. index .. \" [\" .. exp .. \"] not removed\")\n      end\n    end    \n  elseif command == \"eval\" or command == \"exec\" \n      or command == \"load\" or command == \"loadstring\"\n      or command == \"reload\" then\n    local _, _, exp = string.find(params, \"^[a-z]+%s+(.+)$\")\n    if exp or (command == \"reload\") then \n      if command == \"eval\" or command == \"exec\" then\n        exp = (exp:gsub(\"%-%-%[(=*)%[.-%]%1%]\", \"\") -- remove comments\n                  :gsub(\"%-%-.-\\n\", \" \") -- remove line comments\n                  :gsub(\"\\n\", \" \")) -- convert new lines\n        if command == \"eval\" then exp = \"return \" .. exp end\n        client:send(\"EXEC \" .. exp .. \"\\n\")\n      elseif command == \"reload\" then\n        client:send(\"LOAD 0 -\\n\")\n      elseif command == \"loadstring\" then\n        local _, _, _, file, lines = string.find(exp, \"^([\\\"'])(.-)%1%s+(.+)\")\n        if not file then\n           _, _, file, lines = string.find(exp, \"^(%S+)%s+(.+)\")\n        end\n        client:send(\"LOAD \" .. #lines .. \" \" .. file .. \"\\n\")\n        client:send(lines)\n      else\n        local file = io.open(exp, \"r\")\n        if not file and pcall(require, \"winapi\") then\n          -- if file is not open and winapi is there, try with a short path;\n          -- this may be needed for unicode paths on windows\n          winapi.set_encoding(winapi.CP_UTF8)\n          file = io.open(winapi.short_path(exp), \"r\")\n        end\n        if not file then error(\"Cannot open file \" .. exp) end\n        -- read the file and remove the shebang line as it causes a compilation error\n        local lines = file:read(\"*all\"):gsub(\"^#!.-\\n\", \"\\n\")\n        file:close()\n\n        local file = string.gsub(exp, \"\\\\\", \"/\") -- convert slash\n        file = removebasedir(file, basedir)\n        client:send(\"LOAD \" .. #lines .. \" \" .. file .. \"\\n\")\n        if #lines > 0 then client:send(lines) end\n      end\n      while true do\n        local params, err = client:receive()\n        if not params then\n          return nil, nil, \"Debugger connection \" .. (err or \"error\")\n        end\n        local done = true\n        local _, _, status, len = string.find(params, \"^(%d+).-%s+(%d+)%s*$\")\n        if status == \"200\" then\n          len = tonumber(len)\n          if len > 0 then\n            local status, res\n            local str = client:receive(len)\n            -- handle serialized table with results\n            local func, err = loadstring(str)\n            if func then\n              status, res = pcall(func)\n              if not status then err = res\n              elseif type(res) ~= \"table\" then\n                err = \"received \"..type(res)..\" instead of expected 'table'\"\n              end\n            end\n            if err then\n              print(\"Error in processing results: \" .. err)\n              return nil, nil, \"Error in processing results: \" .. err\n            end\n            print(unpack(res))\n            return res[1], res\n          end\n        elseif status == \"201\" then\n          _, _, file, line = string.find(params, \"^201 Started%s+(.-)%s+(%d+)%s*$\")\n        elseif status == \"202\" or params == \"200 OK\" then\n          -- do nothing; this only happens when RE/LOAD command gets the response\n          -- that was for the original command that was aborted\n        elseif status == \"204\" then\n          local _, _, stream, size = string.find(params, \"^204 Output (%w+) (%d+)$\")\n          if stream and size then\n            local msg = client:receive(tonumber(size))\n            print(msg)\n            if outputs[stream] then outputs[stream](msg) end\n            -- this was just the output, so go back reading the response\n            done = false\n          end\n        elseif status == \"401\" then\n          len = tonumber(len)\n          local res = client:receive(len)\n          print(\"Error in expression: \" .. res)\n          return nil, nil, res\n        else\n          print(\"Unknown error\")\n          return nil, nil, \"Debugger error: unexpected response after EXEC/LOAD '\" .. params .. \"'\"\n        end\n        if done then break end\n      end\n    else\n      print(\"Invalid command\")\n    end\n  elseif command == \"listb\" then\n    for l, v in pairs(breakpoints) do\n      for f in pairs(v) do\n        print(f .. \": \" .. l)\n      end\n    end\n  elseif command == \"listw\" then\n    for i, v in pairs(watches) do\n      print(\"Watch exp. \" .. i .. \": \" .. v)\n    end    \n  elseif command == \"suspend\" then\n    client:send(\"SUSPEND\\n\")\n  elseif command == \"stack\" then\n    client:send(\"STACK\\n\")\n    local resp = client:receive()\n    local _, _, status, res = string.find(resp, \"^(%d+)%s+%w+%s+(.+)%s*$\")\n    if status == \"200\" then\n      local func, err = loadstring(res)\n      if func == nil then\n        print(\"Error in stack information: \" .. err)\n        return nil, nil, err\n      end\n      local ok, stack = pcall(func)\n      if not ok then\n        print(\"Error in stack information: \" .. stack)\n        return nil, nil, stack\n      end\n      for _,frame in ipairs(stack) do\n        print(serpent.line(frame[1], {comment = false}))\n      end\n      return stack\n    elseif status == \"401\" then\n      local _, _, len = string.find(resp, \"%s+(%d+)%s*$\")\n      len = tonumber(len)\n      local res = len > 0 and client:receive(len) or \"Invalid stack information.\"\n      print(\"Error in expression: \" .. res)\n      return nil, nil, res\n    else\n      print(\"Unknown error\")\n      return nil, nil, \"Debugger error: unexpected response after STACK\"\n    end\n  elseif command == \"output\" then\n    local _, _, stream, mode = string.find(params, \"^[a-z]+%s+(%w+)%s+([dcr])%s*$\")\n    if stream and mode then\n      client:send(\"OUTPUT \"..stream..\" \"..mode..\"\\n\")\n      local resp = client:receive()\n      local _, _, status = string.find(resp, \"^(%d+)%s+%w+%s*$\")\n      if status == \"200\" then\n        print(\"Stream \"..stream..\" redirected\")\n        outputs[stream] = type(options) == 'table' and options.handler or nil\n      else\n        print(\"Unknown error\")\n        return nil, nil, \"Debugger error: can't redirect \"..stream\n      end\n    else\n      print(\"Invalid command\")\n    end\n  elseif command == \"basedir\" then\n    local _, _, dir = string.find(params, \"^[a-z]+%s+(.+)$\")\n    if dir then\n      dir = string.gsub(dir, \"\\\\\", \"/\") -- convert slash\n      if not string.find(dir, \"/$\") then dir = dir .. \"/\" end\n\n      local remdir = dir:match(\"\\t(.+)\")\n      if remdir then dir = dir:gsub(\"/?\\t.+\", \"/\") end\n      basedir = dir\n\n      client:send(\"BASEDIR \"..(remdir or dir)..\"\\n\")\n      local resp = client:receive()\n      local _, _, status = string.find(resp, \"^(%d+)%s+%w+%s*$\")\n      if status == \"200\" then\n        print(\"New base directory is \" .. basedir)\n      else\n        print(\"Unknown error\")\n        return nil, nil, \"Debugger error: unexpected response after BASEDIR\"\n      end\n    else\n      print(basedir)\n    end\n  elseif command == \"help\" then\n    print(\"setb <file> <line>    -- sets a breakpoint\")\n    print(\"delb <file> <line>    -- removes a breakpoint\")\n    print(\"delallb               -- removes all breakpoints\")\n    print(\"setw <exp>            -- adds a new watch expression\")\n    print(\"delw <index>          -- removes the watch expression at index\")\n    print(\"delallw               -- removes all watch expressions\")\n    print(\"run                   -- runs until next breakpoint\")\n    print(\"step                  -- runs until next line, stepping into function calls\")\n    print(\"over                  -- runs until next line, stepping over function calls\")\n    print(\"out                   -- runs until line after returning from current function\")\n    print(\"listb                 -- lists breakpoints\")\n    print(\"listw                 -- lists watch expressions\")\n    print(\"eval <exp>            -- evaluates expression on the current context and returns its value\")\n    print(\"exec <stmt>           -- executes statement on the current context\")\n    print(\"load <file>           -- loads a local file for debugging\")\n    print(\"reload                -- restarts the current debugging session\")\n    print(\"stack                 -- reports stack trace\")\n    print(\"output stdout <d|c|r> -- capture and redirect io stream (default|copy|redirect)\")\n    print(\"basedir [<path>]      -- sets the base path of the remote application, or shows the current one\")\n    print(\"exit                  -- exits debugger\")\n  else\n    local _, _, spaces = string.find(params, \"^(%s*)$\")\n    if not spaces then\n      print(\"Invalid command\")\n      return nil, nil, \"Invalid command\"\n    end\n  end\n  return file, line\nend\n\n-- Starts debugging server\nlocal function listen(host, port)\n  host = host or \"*\"\n  port = port or mobdebug.port\n\n  local socket = require \"socket\"\n\n  print(\"Lua Remote Debugger\")\n  print(\"Run the program you wish to debug\")\n\n  local server = socket.bind(host, port)\n  local client = server:accept()\n\n  client:send(\"STEP\\n\")\n  client:receive()\n\n  local breakpoint = client:receive()\n  local _, _, file, line = string.find(breakpoint, \"^202 Paused%s+(.-)%s+(%d+)%s*$\")\n  if file and line then\n    print(\"Paused at file \" .. file )\n    print(\"Type 'help' for commands\")\n  else\n    local _, _, size = string.find(breakpoint, \"^401 Error in Execution (%d+)%s*$\")\n    if size then\n      print(\"Error in remote application: \")\n      print(client:receive(size))\n    end\n  end\n\n  while true do\n    io.write(\"> \")\n    local line = io.read(\"*line\")\n    handle(line, client)\n  end\nend\n\nlocal cocreate\nlocal function coro()\n  if cocreate then return end -- only set once\n  cocreate = cocreate or coroutine.create\n  coroutine.create = function(f, ...)\n    return cocreate(function(...)\n      require(\"mobdebug\").on()\n      return f(...)\n    end, ...)\n  end\nend\n\nlocal moconew\nlocal function moai()\n  if moconew then return end -- only set once\n  moconew = moconew or (MOAICoroutine and MOAICoroutine.new)\n  if not moconew then return end\n  MOAICoroutine.new = function(...)\n    local thread = moconew(...)\n    -- need to support both thread.run and getmetatable(thread).run, which\n    -- was used in earlier MOAI versions\n    local mt = thread.run and thread or getmetatable(thread)\n    local patched = mt.run\n    mt.run = function(self, f, ...)\n      return patched(self,  function(...)\n        require(\"mobdebug\").on()\n        return f(...)\n      end, ...)\n    end\n    return thread\n  end\nend\n\n-- this is a function that removes all hooks and closes the socket to\n-- report back to the controller that the debugging is done.\n-- the script that called `done` can still continue.\nlocal function done()\n  if not (isrunning() and server) then return end\n\n  if not jit then\n    for co, debugged in pairs(coroutines) do\n      if debugged then debug.sethook(co) end\n    end\n  end\n\n  debug.sethook()\n  server:close()\n\n  coro_debugger = nil -- to make sure isrunning() returns `false`\n  seen_hook = nil -- to make sure that the next start() call works\n  abort = nil -- to make sure that callback calls use proper \"abort\" value\nend\n\n-- make public functions available\nmobdebug.listen = listen\nmobdebug.loop = loop\nmobdebug.scratchpad = scratchpad\nmobdebug.handle = handle\nmobdebug.connect = connect\nmobdebug.start = start\nmobdebug.on = on\nmobdebug.off = off\nmobdebug.moai = moai\nmobdebug.coro = coro\nmobdebug.done = done\nmobdebug.line = serpent.line\nmobdebug.dump = serpent.dump\nmobdebug.yield = nil -- callback\n\n-- this is needed to make \"require 'modebug'\" to work when mobdebug\n-- module is loaded manually\npackage.loaded.mobdebug = mobdebug\n\nreturn mobdebug\n"
  },
  {
    "path": "Resources/res/atlas.txt",
    "content": "bg_day 288 512 0.0 0.0 0.28125 0.5\nbg_night 288 512 0.28515625 0.0 0.28125 0.5\nbird0_0 48 48 0.0 0.9472656 0.046875 0.046875\nbird0_1 48 48 0.0546875 0.9472656 0.046875 0.046875\nbird0_2 48 48 0.109375 0.9472656 0.046875 0.046875\nbird1_0 48 48 0.1640625 0.9472656 0.046875 0.046875\nbird1_1 48 48 0.21875 0.6308594 0.046875 0.046875\nbird1_2 48 48 0.21875 0.6816406 0.046875 0.046875\nbird2_0 48 48 0.21875 0.7324219 0.046875 0.046875\nbird2_1 48 48 0.21875 0.7832031 0.046875 0.046875\nbird2_2 48 48 0.21875 0.8339844 0.046875 0.046875\nblack 32 32 0.5703125 0.40234375 0.03125 0.03125\nblink_00 10 10 0.26953125 0.6660156 0.009765625 0.009765625\nblink_01 10 10 0.26953125 0.7167969 0.009765625 0.009765625\nblink_02 10 10 0.26953125 0.7675781 0.009765625 0.009765625\nbrand_copyright 126 14 0.86328125 0.17773438 0.123046875 0.013671875\nbutton_menu 80 28 0.90234375 0.05078125 0.078125 0.02734375\nbutton_ok 80 28 0.90234375 0.08203125 0.078125 0.02734375\nbutton_pause 26 28 0.23632812 0.59765625 0.025390625 0.02734375\nbutton_play 116 70 0.6855469 0.22851562 0.11328125 0.068359375\nbutton_rate 74 48 0.90234375 0.0 0.072265625 0.046875\nbutton_resume 26 28 0.65234375 0.27734375 0.025390625 0.02734375\nbutton_score 116 70 0.8027344 0.22851562 0.11328125 0.068359375\nbutton_share 80 28 0.5703125 0.27734375 0.078125 0.02734375\nfont_048 24 44 0.96875 0.11328125 0.0234375 0.04296875\nfont_049 16 44 0.265625 0.8847656 0.015625 0.04296875\nfont_050 24 44 0.5703125 0.30859375 0.0234375 0.04296875\nfont_051 24 44 0.59765625 0.30859375 0.0234375 0.04296875\nfont_052 24 44 0.625 0.30859375 0.0234375 0.04296875\nfont_053 24 44 0.65234375 0.30859375 0.0234375 0.04296875\nfont_054 24 44 0.5703125 0.35546875 0.0234375 0.04296875\nfont_055 24 44 0.59765625 0.35546875 0.0234375 0.04296875\nfont_056 24 44 0.625 0.35546875 0.0234375 0.04296875\nfont_057 24 44 0.65234375 0.35546875 0.0234375 0.04296875\nland 336 112 0.5703125 0.0 0.328125 0.109375\nmedals_0 44 44 0.23632812 0.50390625 0.04296875 0.04296875\nmedals_1 44 44 0.23632812 0.55078125 0.04296875 0.04296875\nmedals_2 44 44 0.21875 0.8847656 0.04296875 0.04296875\nmedals_3 44 44 0.21875 0.9316406 0.04296875 0.04296875\nnew 32 14 0.21875 0.9785156 0.03125 0.013671875\nnumber_context_00 12 14 0.26953125 0.6308594 0.01171875 0.013671875\nnumber_context_01 12 14 0.26953125 0.6484375 0.01171875 0.013671875\nnumber_context_02 12 14 0.26953125 0.6816406 0.01171875 0.013671875\nnumber_context_03 12 14 0.26953125 0.69921875 0.01171875 0.013671875\nnumber_context_04 12 14 0.26953125 0.7324219 0.01171875 0.013671875\nnumber_context_05 12 14 0.26953125 0.75 0.01171875 0.013671875\nnumber_context_06 12 14 0.26953125 0.7832031 0.01171875 0.013671875\nnumber_context_07 12 14 0.26953125 0.80078125 0.01171875 0.013671875\nnumber_context_08 12 14 0.26953125 0.8339844 0.01171875 0.013671875\nnumber_context_09 12 14 0.26953125 0.8515625 0.01171875 0.013671875\nnumber_context_10 12 14 0.96875 0.16015625 0.01171875 0.013671875\nnumber_score_00 16 20 0.265625 0.59765625 0.015625 0.01953125\nnumber_score_01 16 20 0.265625 0.9316406 0.015625 0.01953125\nnumber_score_02 16 20 0.265625 0.9550781 0.015625 0.01953125\nnumber_score_03 16 20 0.25390625 0.9785156 0.015625 0.01953125\nnumber_score_04 16 20 0.9785156 0.0 0.015625 0.01953125\nnumber_score_05 16 20 0.9785156 0.0234375 0.015625 0.01953125\nnumber_score_06 16 20 0.984375 0.05078125 0.015625 0.01953125\nnumber_score_07 16 20 0.984375 0.08203125 0.015625 0.01953125\nnumber_score_08 16 20 0.5703125 0.47265625 0.015625 0.01953125\nnumber_score_09 16 20 0.60546875 0.40234375 0.015625 0.01953125\npipe2_down 52 320 0.0 0.6308594 0.05078125 0.3125\npipe2_up 52 320 0.0546875 0.6308594 0.05078125 0.3125\npipe_down 52 320 0.109375 0.6308594 0.05078125 0.3125\npipe_up 52 320 0.1640625 0.6308594 0.05078125 0.3125\nscore_panel 238 126 0.0 0.50390625 0.23242188 0.123046875\ntext_game_over 204 54 0.765625 0.11328125 0.19921875 0.052734375\ntext_ready 196 62 0.5703125 0.11328125 0.19140625 0.060546875\ntitle 178 48 0.6855469 0.17773438 0.17382812 0.046875\ntutorial 114 98 0.5703125 0.17773438 0.111328125 0.095703125\nwhite 32 32 0.5703125 0.4375 0.03125 0.03125\n"
  },
  {
    "path": "Resources/scripts/GameScene.lua",
    "content": "--\n-- Author: GeZiyang\n-- Date: 2014-02-10\n--\n\nlocal midX = visibleSize.width / 2\nlocal midY = visibleSize.height / 2\n--config\nlocal birdX = 90\nlocal birdSize = 15\n\nlocal pipeCount = 5\nlocal pipeHeight = 320\nlocal pipeDistance = 100\n\nlocal landHeight = 112\n\nlocal tapV = 260\nlocal systemGravity = -900\n--config end\n\n-- vars\nlocal PIPE_NEW = 0\nlocal PIPE_PASS = 1\n\ng_initFlag = false\n\nlocal gameOver = false\nlocal sceneGame = nil\nlocal scoreNode = nil\nlocal pipes = {}\n\n-- for score calcs 0 for\nlocal pipeState = {}\n\n\nlocal totalScore = 0\n\nlocal checkFunc = 0\nlocal createPipeFunc = 0\nlocal birdRotateFunc = 0\n\nlocal gameLayerListener = nil\nlocal overLayerListener = nil\n\n-- functions\nlocal function showGameOverLayer()\n    \n\n    local overLayer = cc.Layer:create()\n    local actionNode = cc.Node:create()\n    overLayer:addChild(actionNode)\n\n    local gameOverLogo = createAtlasSprite(\"text_game_over\")\n    local scorePanel = createAtlasSprite(\"score_panel\")\n\n    local nowScoreNode = cc.Node:create()\n    local bestScoreNode = cc.Node:create()\n    local newInfoSprite = createAtlasSprite(\"new\")\n\n    local playButton = createAtlasSprite(\"button_play\")\n    local rankButton = createAtlasSprite(\"button_score\")\n\n    local function initOverItems()\n        -- game over\n        gameOverLogo:setPosition(cc.p(midX, midY + 100))\n        gameOverLogo:setVisible(false)\n\n        overLayer:addChild(gameOverLogo)\n\n        -- score panel\n        scorePanel:setPosition(cc.p(midX, midY))\n        scorePanel:setVisible(false)\n\n        -- score node\n        nowScoreNode:setPosition(cc.p(200, 80))\n        scorePanel:addChild(nowScoreNode)\n\n        bestScoreNode:setPosition(cc.p(200, 40))\n        scorePanel:addChild(bestScoreNode)\n\n        -- new info\n        newInfoSprite:setPosition(cc.p(155, 60))\n        newInfoSprite:setVisible(false)\n        scorePanel:addChild(newInfoSprite)\n\n\n        overLayer:addChild(scorePanel)\n        \n        --bottom buttons\n\n        -- play button      \n        playButton:setPosition(cc.p(midX / 2, midY - 120))\n        playButton:setVisible(false)\n\n        overLayer:addChild(playButton, 1000)\n\n\n        g_playButton = playButton\n\n        -- rank button\n        rankButton:setPosition(cc.p(visibleSize.width * 3 / 4, midY - 120))\n        rankButton:setVisible(false)\n\n        overLayer:addChild(rankButton, 1000)\n\n        g_rankButton = rankButton\n    end\n\n    local function showOverItems()\n        local function showGameOverLogo()\n            cc.SimpleAudioEngine:getInstance():playEffect(uiPath)\n            scoreNode:setVisible(false)\n\n            gameOverLogo:setVisible(true)\n\n            local place = cc.Place:create(cc.p(midX, midY + 120))\n            local move1 = cc.MoveTo:create(0.2, cc.p(midX, midY + 96))\n            local move2 = cc.MoveTo:create(0.2, cc.p(midX, midY + 100))\n\n            gameOverLogo:runAction(cc.Sequence:create(place, move1, move2))\n        end\n\n        local function showScorePanel()\n            cc.SimpleAudioEngine:getInstance():playEffect(uiPath)\n            scorePanel:setVisible(true)\n\n            local place = cc.Place:create(cc.p(midX, -100))\n            local move1 = cc.MoveTo:create(0.1, cc.p(midX, midY))\n\n            scorePanel:runAction(cc.Sequence:create(place, move1))\n        end\n\n        local function showNewRecordInfo()\n            newInfoSprite:setVisible(true)\n        end\n\n        local function showMedal()\n            if totalScore < 10 then\n                return\n            end\n\n            local medalStr = \"medals_\"..(math.max(4 - math.floor(totalScore / 10), 0))\n            local medalSprite = createAtlasSprite(medalStr)\n\n            medalSprite:setPosition(cc.p(55, 60))\n            scorePanel:addChild(medalSprite)\n\n        end\n\n        local function showScoreNumber()\n            --CreateSpriteScore(nowScoreNode, totalScore, 2, 2)\n            local savedBestScore = cc.UserDefault:getInstance():getIntegerForKey(\"bestScore\", 0)\n            if totalScore > savedBestScore then\n                savedBestScore = totalScore\n                -- show new\n                showNewRecordInfo()\n                -- save score\n                cc.UserDefault:getInstance():setIntegerForKey(\"bestScore\", totalScore)\n            end\n\n            CreateSpriteScore(bestScoreNode, savedBestScore, 2, 2)\n            CreateSpriteScore(nowScoreNode, 0, 2, 2)\n\n            local tmpScore = 0\n            local showSingleNumberFunc = 0\n            local function showSingleNumber()\n                CreateSpriteScore(nowScoreNode, tmpScore, 2, 2)\n                tmpScore = tmpScore + 1\n\n                if tmpScore > totalScore then\n                    cc.Director:getInstance():getScheduler():unscheduleScriptEntry(showSingleNumberFunc)\n                end\n            end\n\n            showSingleNumberFunc = cc.Director:getInstance():getScheduler():scheduleScriptFunc(showSingleNumber, 0.5 / totalScore, false)\n        end\n\n        local function showBottomButton()\n            playButton:setVisible(true)\n            rankButton:setVisible(true)\n        end\n\n        local delay1 = cc.DelayTime:create(1)\n        local showOverLogoFunc = cc.CallFunc:create(showGameOverLogo)\n        local showScorePanelFunc = cc.CallFunc:create(showScorePanel)\n        local showMedalFunc = cc.CallFunc:create(showMedal)\n        local showScoreNumberFunc = cc.CallFunc:create(showScoreNumber)\n        local showBottomButtonFunc = cc.CallFunc:create(showBottomButton)\n\n        local action = cc.Sequence:create(delay1, showOverLogoFunc, delay1, showScorePanelFunc, showMedalFunc, \n            showScoreNumberFunc, delay1, showBottomButtonFunc)\n        actionNode:runAction(action)\n    end\n\n    initOverItems()\n    showOverItems()\n    -- listener\n\n    g_rateButton = nil\n    overLayerListener = cc.EventListenerTouchOneByOne:create()\n    overLayerListener:registerScriptHandler(onCommonMenuLayerTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN )\n    overLayerListener:registerScriptHandler(onCommonMenuLayerTouchEnded,cc.Handler.EVENT_TOUCH_ENDED )\n    overLayer:getEventDispatcher():addEventListenerWithSceneGraphPriority(overLayerListener, overLayer)\n\n\n    sceneGame:addChild(overLayer)\nend\n\nlocal function createPipes(layer)\n    local function initPipe()\n    \tfor i = 1, pipeCount do\n    \t\tlocal downPipe = createAtlasSprite(\"pipe_down\")\n\t\t\tlocal upPipe = createAtlasSprite(\"pipe_up\")\n\n\t\t\tdownPipe:setPosition(cc.p(0, pipeHeight + pipeDistance))\n\n\t\t\tlocal singlePipe = cc.Node:create()\n\t\t\tsinglePipe:addChild(downPipe)\n\t\t\tsinglePipe:addChild(upPipe)\n\n\t\t\tsinglePipe:setPosition(cc.p(- visibleSize.width * 2, 0))\n\n\t\t\tlayer:addChild(singlePipe, 10)\n\n\t\t\tpipes[i] = singlePipe\n            pipeState[i] = PIPE_PASS\t\t\t\n    \tend\n    \t\n    end\n\n    local function createPipe()\n    \tfor i = 1, pipeCount do\n            print(i)\n    \t\tif pipes[i]:getPositionX() < -100 then\n    \t\t\tlocal pipeNode = pipes[i]\n                pipeState[i] = PIPE_NEW\n\n    \t\t\tpipeNode:stopAllActions()\n\n    \t\t\tlocal randomHeight = math.random(0,3)\n\n    \t\t\tpipeNode:setPosition(cc.p(visibleSize.width * 2, 50 * randomHeight))\n    \t\t\tpipeNode:setTag(randomHeight)\n\n    \t\t\tlocal move = cc.MoveTo:create(8, cc.p(- visibleSize.width * 2, 50 * randomHeight))\n\t\t\t\tpipeNode:runAction(move)\n\t\t\t\tbreak\n    \t\tend\n    \tend\n\tend\n\n\tinitPipe()\n\tcreatePipeFunc = cc.Director:getInstance():getScheduler():scheduleScriptFunc(createPipe, 1.3, false)\nend\n\n\n\nlocal function createLayerBg()\n    local layerBg, land_1, land_2 = createCommonBackLayer()\n\n    local groudNode = cc.Node:create()\n    groudNode:setPhysicsBody(cc.PhysicsBody:createEdgeSegment(cc.p(0, landHeight), cc.p(288, landHeight)))\n    layerBg:addChild(groudNode)\n\n    -- add bird\n    local spriteBird = createBird()\n    spriteBird:setPosition(birdX, visibleSize.height / 2 + 10)\n    spriteBird:setPhysicsBody(cc.PhysicsBody:createCircle(birdSize))\n    spriteBird:getPhysicsBody():setEnable(false)\n\n    spriteBird:runAction(createFlyAction(cc.p(spriteBird:getPosition())))\n\n    layerBg:addChild(spriteBird, 1000)\n\n    -- add blink white\n    local whiteBlinkSprite = createAtlasSprite(\"white\")\n    whiteBlinkSprite:setScale(100)\n    whiteBlinkSprite:setOpacity(0)\n    layerBg:addChild(whiteBlinkSprite, 2000)  \n\n    -- init ready info   \n    local rNode = nil \n    local rTextSprite = nil\n    local rImage = nil\n    local function initReady()\n    \tlocal readyTextSprite = createAtlasSprite(\"text_ready\")\n    \treadyTextSprite:setPosition(cc.p(0, 100))\n\n    \tlocal readyImage = createAtlasSprite(\"tutorial\")\n\n    \tlocal readyNode = cc.Node:create()\n    \treadyNode:addChild(readyTextSprite)\n    \treadyNode:addChild(readyImage)\n\n    \treadyNode:setPosition(cc.p(visibleSize.width / 2, visibleSize.height / 2))\n\n    \trNode = readyNode\n    \trTextSprite = readyTextSprite\n    \trImage = readyImage\n\n    \tlayerBg:addChild(readyNode)\n    end  \n\n    local function hideReady()\n        spriteBird:stopActionByTag(g_flyTag)\n    \trTextSprite:runAction(cc.FadeOut:create(0.2))\n    \trImage:runAction(cc.FadeOut:create(0.2))\n\n    end\n\n    initReady()\n\n    -- score\n    scoreNode = cc.Node:create()\n    local function initScore()\n        \n        scoreNode:setPosition(cc.p(visibleSize.width / 2, visibleSize.height * 4 / 5 + 10))\n        layerBg:addChild(scoreNode, 10000)\n    end\n\n    local function refreshScore()\n        CreateSpriteScore(scoreNode, totalScore, 1, 1)\n    end\n\n    initScore()\n    refreshScore()\n    \n\n\tlocal function blinkWhite()\n\t\tlocal fadeIn = cc.FadeIn:create(0.1)\n\t\tlocal fadeOut = cc.FadeOut:create(0.1)\n\n\t\twhiteBlinkSprite:runAction(cc.Sequence:create(fadeIn, fadeOut))\n\tend\n\n\tlocal function GameOver()\n        gameOver = true\n\n\t\tcc.SimpleAudioEngine:getInstance():playEffect(hitPath)\n\n\t\tfor i = 1, pipeCount do\n\t\t\tpipes[i]:stopAllActions()\n\t\tend\n\n\t\tland_1:stopAllActions()\n\t\tland_2:stopAllActions()\n\n        spriteBird:getPhysicsBody():setVelocity(cc.p(0, 0))      \n\n\t\tcc.Director:getInstance():getScheduler():unscheduleScriptEntry(createPipeFunc)\n\t\tcc.Director:getInstance():getScheduler():unscheduleScriptEntry(checkFunc)\n\n\t\tblinkWhite()\n        layerBg:getEventDispatcher():removeEventListener(gameLayerListener)\n\n        showGameOverLayer()\n\tend\t\n\n\t-- check hit and calc score\n    local function rotateBird()\n        local v = spriteBird:getPhysicsBody():getVelocity()\n        spriteBird:setRotation(math.min(math.max(-90, v.y * 0.2 + 60), 30))\n    end\n\n\t\n\tlocal function checkHit()\n\n\n        -- check hit\n\t\tif spriteBird:getPositionY() < landHeight + birdSize then\n\t\t\tGameOver()\n\t\t\treturn\n\t\tend\n        -- calc score\n        for i=1, pipeCount do\n\n            -- check hit\n            if math.abs(pipes[i]:getPositionX() - birdX) < (birdSize + 26) then\n                -- check down\n                if spriteBird:getPositionY() < pipes[i]:getPositionY() + pipeHeight / 2 + birdSize then\n                    cc.SimpleAudioEngine:getInstance():playEffect(fallPath)\n                    GameOver()\n                    return \n                end\n                -- check up\n                if spriteBird:getPositionY() > pipes[i]:getPositionY() + pipeHeight / 2 + pipeDistance - birdSize then\n                    cc.SimpleAudioEngine:getInstance():playEffect(fallPath)\n                    GameOver()\n                    return\n                end\n            end\n\n            if pipeState[i] == PIPE_NEW and pipes[i]:getPositionX() < birdX then\n                pipeState[i] = PIPE_PASS\n                totalScore = totalScore + 1\n                cc.SimpleAudioEngine:getInstance():playEffect(scorePath)\n                refreshScore()\n                return\n            end\n        end\n\tend\n\t\n\n\t-- listener\n    local touchBeginPoint = nil\n    local ready = false\n\n    local function onTouchBegan(touch, event)\n        local location = touch:getLocation()\n        -- cclog(\"onTouchBegan: %0.2f, %0.2f\", location.x, location.y)\n        touchBeginPoint = {x = location.x, y = location.y}\n\n        if not ready then\n        \tready = true\n        \thideReady()\n        \tcreatePipes(layerBg)\n        \tspriteBird:getPhysicsBody():setEnable(true)\n            spriteBird:getPhysicsBody():setVelocity(cc.p(0, tapV))\n\n        \tcheckFunc = cc.Director:getInstance():getScheduler():scheduleScriptFunc(checkHit, 0, false)\n            birdRotateFunc = cc.Director:getInstance():getScheduler():scheduleScriptFunc(rotateBird, 0, false)\n        else\n            -- spriteBird:setPosition(cc.p(birdX, spriteBird:getPositionY() + 10))\n            spriteBird:getPhysicsBody():setVelocity(cc.p(0, tapV))\n            -- spriteBird:getPhysicsBody():applyImpulse(cc.p(0, 20000))\n            print(spriteBird:getPhysicsBody():getVelocity().y)\n        end\n\n\n        cc.SimpleAudioEngine:getInstance():playEffect(wingPath)\n\n         -- CCTOUCHBEGAN event must return true\n        return true\n    end\n\n    gameLayerListener = cc.EventListenerTouchOneByOne:create()\n    gameLayerListener:registerScriptHandler(onTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN )\n    layerBg:getEventDispatcher():addEventListenerWithSceneGraphPriority(gameLayerListener, layerBg)\n\n    local function onContactBegin(event, contact)\n        cclog(\"onContactBegin\")\n        if not gameOver then\n            gameOver = true\n            GameOver()\n        end\n        spriteBird:getPhysicsBody():setEnable(false)\n        spriteBird:stopAllActions()\n        spriteBird:setRotation(-90) \n        \n        cc.Director:getInstance():getScheduler():unscheduleScriptEntry(birdRotateFunc)\n        birdRotateFunc = 0\n    end\n\n    local contactListener = cc.EventListenerPhysicsContactWithBodies:create(groudNode:getPhysicsBody(), spriteBird:getPhysicsBody())\n    contactListener:registerScriptHandler(onContactBegin, cc.Handler.EVENT_PHYSICS_CONTACT_BEGIN)\n    layerBg:getEventDispatcher():addEventListenerWithSceneGraphPriority(contactListener, layerBg)\n\t\n    return layerBg\nend\n\nlocal function resetGameSceneValue()\n    totalScore = 0\n    gameOver = false\n\n    if birdRotateFunc ~= 0 then\n        cc.Director:getInstance():getScheduler():unscheduleScriptEntry(birdRotateFunc)\n        birdRotateFunc = 0\n    end\nend\n-- run\nfunction createGameScene()\n\n    resetGameSceneValue()\n\n    local scene = cc.Scene:createWithPhysics()\n    -- scene:getPhysicsWorld():setDebugDrawMask(cc.PhysicsWorld.DEBUGDRAW_ALL)\n    scene:getPhysicsWorld():setGravity(cc.p(0, systemGravity))\n\n    local gravity = scene:getPhysicsWorld():getGravity()\n    print(\"gravity : \"..gravity.x..\" \"..gravity.y)\n\n    local layerBg = createLayerBg()\n    scene:addChild(layerBg)\n    sceneGame = scene\n\n    return scene\nend\n\nreturn createGameScene()"
  },
  {
    "path": "Resources/scripts/StartScene.lua",
    "content": "--\n-- Author: GeZiyang\n-- Date: 2014-02-10\n--\n\n-- config\nlocal sceneStart = nil\n\nlocal function createStartBackLayer()\n\tlocal backLayer = createCommonBackLayer()\n\n\t-- logo\n\tlocal spriteLogo = createAtlasSprite(\"title\")\n\tspriteLogo:setPosition(cc.p(visibleSize.width / 2, visibleSize.height * 2 / 3))\n\tbackLayer:addChild(spriteLogo)\n\n\t-- flappy bird\n\tlocal spriteBird = createBird()\n\tspriteBird:setPosition(cc.p(visibleSize.width / 2, visibleSize.height / 2 + 25))\n\n\tspriteBird:runAction(createFlyAction(cc.p(spriteBird:getPosition())))\n\n\tbackLayer:addChild(spriteBird)\n\n\t-- rate button\n\tlocal rateButton = createAtlasSprite(\"button_rate\")\n\trateButton:setPosition(cc.p(visibleSize.width / 2, visibleSize.height / 2 - 35))\n\tbackLayer:addChild(rateButton)\n\n\t-- play button\n\tlocal playButton = createAtlasSprite(\"button_play\")\n\tplayButton:setPosition(cc.p(visibleSize.width / 4, visibleSize.height / 2 - 120))\n\tbackLayer:addChild(playButton, 1000)\n\n\t-- rank button\n\tlocal rankButton = createAtlasSprite(\"button_score\")\n\trankButton:setPosition(cc.p(visibleSize.width * 3 / 4, visibleSize.height / 2 - 120))\n\tbackLayer:addChild(rankButton, 1000)\n\n\t-- copy right\n\tlocal spriteCopyright = createAtlasSprite(\"brand_copyright\")\n\tspriteCopyright:setPosition(cc.p(visibleSize.width / 2, visibleSize.height / 2 - 170))\n\tbackLayer:addChild(spriteCopyright, 1000)\t\n\n\t-- for common listener\n\tg_rateButton = rateButton\n\tg_playButton = playButton\n\tg_rankButton = rankButton\n\n    local listener = cc.EventListenerTouchOneByOne:create()\n    listener:registerScriptHandler(onCommonMenuLayerTouchBegan,cc.Handler.EVENT_TOUCH_BEGAN )\n    listener:registerScriptHandler(onCommonMenuLayerTouchEnded,cc.Handler.EVENT_TOUCH_ENDED )\n    local eventDispatcher = backLayer:getEventDispatcher()\n    eventDispatcher:addEventListenerWithSceneGraphPriority(listener, backLayer)\n\n\treturn backLayer\nend\n\n-- run\nif sceneStart == nil then\n\tsceneStart = cc.Scene:create()\n\n\tlocal backLayer = createStartBackLayer()\n\tsceneStart:addChild(backLayer)\nend\n\nreturn sceneStart"
  },
  {
    "path": "Resources/scripts/out.lua",
    "content": "a = {}\na[\"bg_day\"]={width=288, height=512, x=0, y=0}\na[\"bg_night\"]={width=288, height=512, x=292, y=0}\na[\"bird0_0\"]={width=48, height=48, x=0, y=970}\na[\"bird0_1\"]={width=48, height=48, x=56, y=970}\na[\"bird0_2\"]={width=48, height=48, x=112, y=970}\na[\"bird1_0\"]={width=48, height=48, x=168, y=970}\na[\"bird1_1\"]={width=48, height=48, x=224, y=646}\na[\"bird1_2\"]={width=48, height=48, x=224, y=698}\na[\"bird2_0\"]={width=48, height=48, x=224, y=750}\na[\"bird2_1\"]={width=48, height=48, x=224, y=802}\na[\"bird2_2\"]={width=48, height=48, x=224, y=854}\na[\"black\"]={width=32, height=32, x=584, y=412}\na[\"blink_00\"]={width=10, height=10, x=276, y=682}\na[\"blink_01\"]={width=10, height=10, x=276, y=734}\na[\"blink_02\"]={width=10, height=10, x=276, y=786}\na[\"brand_copyright\"]={width=126, height=14, x=884, y=182}\na[\"button_menu\"]={width=80, height=28, x=924, y=52}\na[\"button_ok\"]={width=80, height=28, x=924, y=84}\na[\"button_pause\"]={width=26, height=28, x=242, y=612}\na[\"button_play\"]={width=116, height=70, x=702, y=234}\na[\"button_rate\"]={width=74, height=48, x=924, y=0}\na[\"button_resume\"]={width=26, height=28, x=668, y=284}\na[\"button_score\"]={width=116, height=70, x=822, y=234}\na[\"button_share\"]={width=80, height=28, x=584, y=284}\na[\"font_048\"]={width=24, height=44, x=992, y=116}\na[\"font_049\"]={width=16, height=44, x=272, y=906}\na[\"font_050\"]={width=24, height=44, x=584, y=316}\na[\"font_051\"]={width=24, height=44, x=612, y=316}\na[\"font_052\"]={width=24, height=44, x=640, y=316}\na[\"font_053\"]={width=24, height=44, x=668, y=316}\na[\"font_054\"]={width=24, height=44, x=584, y=364}\na[\"font_055\"]={width=24, height=44, x=612, y=364}\na[\"font_056\"]={width=24, height=44, x=640, y=364}\na[\"font_057\"]={width=24, height=44, x=668, y=364}\na[\"land\"]={width=336, height=112, x=584, y=0}\na[\"medals_0\"]={width=44, height=44, x=242, y=516}\na[\"medals_1\"]={width=44, height=44, x=242, y=564}\na[\"medals_2\"]={width=44, height=44, x=224, y=906}\na[\"medals_3\"]={width=44, height=44, x=224, y=954}\na[\"new\"]={width=32, height=14, x=224, y=1002}\na[\"number_context_00\"]={width=12, height=14, x=276, y=646}\na[\"number_context_01\"]={width=12, height=14, x=276, y=664}\na[\"number_context_02\"]={width=12, height=14, x=276, y=698}\na[\"number_context_03\"]={width=12, height=14, x=276, y=716}\na[\"number_context_04\"]={width=12, height=14, x=276, y=750}\na[\"number_context_05\"]={width=12, height=14, x=276, y=768}\na[\"number_context_06\"]={width=12, height=14, x=276, y=802}\na[\"number_context_07\"]={width=12, height=14, x=276, y=820}\na[\"number_context_08\"]={width=12, height=14, x=276, y=854}\na[\"number_context_09\"]={width=12, height=14, x=276, y=872}\na[\"number_context_10\"]={width=12, height=14, x=992, y=164}\na[\"number_score_00\"]={width=16, height=20, x=272, y=612}\na[\"number_score_01\"]={width=16, height=20, x=272, y=954}\na[\"number_score_02\"]={width=16, height=20, x=272, y=978}\na[\"number_score_03\"]={width=16, height=20, x=260, y=1002}\na[\"number_score_04\"]={width=16, height=20, x=1002, y=0}\na[\"number_score_05\"]={width=16, height=20, x=1002, y=24}\na[\"number_score_06\"]={width=16, height=20, x=1008, y=52}\na[\"number_score_07\"]={width=16, height=20, x=1008, y=84}\na[\"number_score_08\"]={width=16, height=20, x=584, y=484}\na[\"number_score_09\"]={width=16, height=20, x=620, y=412}\na[\"pipe2_down\"]={width=52, height=320, x=0, y=646}\na[\"pipe2_up\"]={width=52, height=320, x=56, y=646}\na[\"pipe_down\"]={width=52, height=320, x=112, y=646}\na[\"pipe_up\"]={width=52, height=320, x=168, y=646}\na[\"score_panel\"]={width=238, height=126, x=0, y=516}\na[\"text_game_over\"]={width=204, height=54, x=784, y=116}\na[\"text_ready\"]={width=196, height=62, x=584, y=116}\na[\"title\"]={width=178, height=48, x=702, y=182}\na[\"tutorial\"]={width=114, height=98, x=584, y=182}\na[\"white\"]={width=32, height=32, x=584, y=448}\n"
  },
  {
    "path": "Resources/scripts/tools.lua",
    "content": "--\n-- Author: GeZiyang\n-- Date: 2014-02-10\n--\n\n-- config\nlocal flySpeed  = 2.5\nlocal flyOffset = 5\n\n-- vars\ng_flyTag = 1000\n\ng_rateButton = nil\ng_playButton = nil\ng_rankButton = nil\n\ncc.FileUtils:getInstance():addSearchPath(\"res/\")\nlocal textureAtlas = cc.Director:getInstance():getTextureCache():addImage(\"atlas.png\")\n\nwingPath = cc.FileUtils:getInstance():fullPathForFilename(\"sfx_wing.wav\")\nhitPath = cc.FileUtils:getInstance():fullPathForFilename(\"sfx_hit.wav\")\nscorePath = cc.FileUtils:getInstance():fullPathForFilename(\"sfx_point.wav\")\nfallPath = cc.FileUtils:getInstance():fullPathForFilename(\"sfx_die.wav\")\nuiPath = cc.FileUtils:getInstance():fullPathForFilename(\"sfx_swooshing.wav\")\n\ncc.SimpleAudioEngine:getInstance():preloadEffect(wingPath)\ncc.SimpleAudioEngine:getInstance():preloadEffect(hitPath)\ncc.SimpleAudioEngine:getInstance():preloadEffect(scorePath)\ncc.SimpleAudioEngine:getInstance():preloadEffect(fallPath)\ncc.SimpleAudioEngine:getInstance():preloadEffect(uiPath)\n\nvisibleSize = cc.Director:getInstance():getVisibleSize()\nprint(\"visibleSize :\"..visibleSize.width..\" \"..visibleSize.height)\n\nlocal function generateSpriteLuaFile()\n    -- body\n    local atlasFile = io.open(\"atlas.txt\", \"r\")\n    local outFile = io.open(\"out.lua\",\"w\")\n    outFile:write(\"a = {}\\n\")\n\n    local line, tmpSprite\n\n    for line in atlasFile:lines() do\n        tmpSprite = {}\n        for i in string.gmatch(line, \"%S+\") do\n            tmpSprite[#tmpSprite + 1] = i\n            cclog(i)\n        end\n        local name = tmpSprite[1]\n        local width = tmpSprite[2]\n        local height = tmpSprite[3]\n        local x = math.floor(1024 * (tonumber(tmpSprite[4])) + 0.1)\n        local y = math.floor(1024 * (tonumber(tmpSprite[5])) + 0.1)\n        outFile:write(string.format(\"a[\\\"%s\\\"]={width=%s, height=%s, x=%s, y=%s}\\n\", name, width, height, x, y))\n    end   \n    outFile.close()\nend\n\nfunction createAtlasSprite(name)\n    local tmpTable = a[name]\n\n    local rectX = tmpTable.x\n    local rectY = tmpTable.y\n    local rectWidth = tmpTable.width\n    local rectHeight = tmpTable.height\n\n    -- fix 1px edge bug\n    if name == \"land\" then\n        rectX = rectX + 1            \n    end\n\n    local rect = cc.rect(rectX, rectY, rectWidth, rectHeight)\n    local frame = cc.SpriteFrame:createWithTexture(textureAtlas, rect)\n    local atlasSprite = cc.Sprite:createWithSpriteFrame(frame)\n\n    return atlasSprite\nend\n\nfunction getSpriteSize(name)\n    return cc.size(a[name].width, a[name].height)\nend\n\nfunction createBird()\n    local randomIndex = math.random(0, 2)\n\n    local birdFrames = {}\n    for i=1,3 do\n        local tmpTable = a[\"bird\"..randomIndex..\"_\"..(i-1)]\n        local rect = cc.rect(tmpTable.x, tmpTable.y, tmpTable.width, tmpTable.height)\n        local frame = cc.SpriteFrame:createWithTexture(textureAtlas, rect)\n        birdFrames[#birdFrames + 1] = frame\n    end\n\n    local spriteBird = cc.Sprite:createWithSpriteFrame(birdFrames[1])       \n\n    local animation = cc.Animation:createWithSpriteFrames(birdFrames, 0.1)\n    local animate = cc.Animate:create(animation);\n    spriteBird:runAction(cc.RepeatForever:create(animate))\n\n    return spriteBird\nend\n\nfunction createCommonBackLayer()\n    local layerBg = cc.Layer:create()\n\n    local randomBgIndex = math.random(1, 2)\n    local bgName = \"bg_day\"\n    if randomBgIndex == 2 then\n        bgName = \"bg_night\"\n    end\n\n    local bg = createAtlasSprite(bgName)\n    bg:setPosition(cc.p(visibleSize.width / 2, visibleSize.height / 2))\n    layerBg:addChild(bg)\n\n    local landHeight = getSpriteSize(\"land\").height\n\n    -- first moving land\n    local land_1 = createAtlasSprite(\"land\")\n    land_1:setPosition(visibleSize.width / 2, landHeight / 2)\n    layerBg:addChild(land_1, 100)\n\n    local move1 = cc.MoveTo:create(2, cc.p(- visibleSize.width / 2, landHeight / 2))\n    local reset1 = cc.Place:create(cc.p(visibleSize.width / 2, landHeight / 2))\n    land_1:runAction(cc.RepeatForever:create(cc.Sequence:create(move1, reset1)))\n\n    -- second moving land\n    local land_2 = createAtlasSprite(\"land\")\n    land_2:setPosition(visibleSize.width * 3 / 2, landHeight / 2)\n    layerBg:addChild(land_2, 100)\n\n    local move2 = cc.MoveTo:create(2, cc.p(visibleSize.width / 2, landHeight / 2))\n    local reset2 = cc.Place:create(cc.p(visibleSize.width * 3 / 2, landHeight / 2))\n    land_2:runAction(cc.RepeatForever:create(cc.Sequence:create(move2, reset2)))\n\n    return layerBg, land_1, land_2\nend\n\nfunction createFlyAction(position)\n    local moveUp   = cc.MoveTo:create(1.0 / flySpeed, cc.p(position.x, position.y + flyOffset))\n    local moveDown = cc.MoveTo:create(1.0 / flySpeed, cc.p(position.x, position.y - flyOffset))\n\n    local flyAction = cc.RepeatForever:create(cc.Sequence:create(moveUp, moveDown))\n    flyAction:setTag(g_flyTag)\n    return flyAction\nend\n\nlocal clickedButton = nil\nlocal function checkMenuButton(button, name, point)\n    cclog(\"checkMenuButton : \"..name)\n    local buttonSize = getSpriteSize(name)\n    local buttonX = button:getPositionX()\n    local buttonY = button:getPositionY()\n\n    if math.abs(point.x - buttonX) < buttonSize.width / 2 and \n        math.abs(point.y - buttonY) < buttonSize.height / 2 then\n        clickedButton = button\n        return true\n    end\n    return false\nend\n\n-- listener\nlocal touchBeginPoint = nil\nfunction onCommonMenuLayerTouchBegan(touch, event)\n    local location = touch:getLocation()\n    cclog(\"onCommonMenuLayerTouchBegan: %0.2f, %0.2f\", location.x, location.y)\n    touchBeginPoint = {x = location.x, y = location.y}\n    \n    if g_rateButton ~= nil then\n        checkMenuButton(g_rateButton, \"button_rate\", touchBeginPoint)\n    end\n\n    if g_playButton ~= nil then\n        checkMenuButton(g_playButton, \"button_play\", touchBeginPoint)\n    end\n\n    if g_rankButton ~= nil then\n        checkMenuButton(g_rankButton, \"button_score\", touchBeginPoint) \n    end     \n    \n    if clickedButton ~= nil then\n        clickedButton:setPosition(cc.p(clickedButton:getPositionX(), clickedButton:getPositionY() - 3))\n    end\n\n     -- CCTOUCHBEGAN event must return true\n    return true\nend\n\nfunction onCommonMenuLayerTouchEnded(touch, event)\n    local location = touch:getLocation()\n    cclog(\"onCommonMenuLayerTouchEnded: %0.2f, %0.2f\", location.x, location.y)\n    touchBeginPoint = nil\n\n    if clickedButton ~= nil then\n        clickedButton:setPosition(cc.p(clickedButton:getPositionX(), clickedButton:getPositionY() + 3))\n        if clickedButton == g_rateButton then\n\n        elseif clickedButton == g_playButton then\n            local gameScene = nil \n            if g_initFlag == nil then\n                gameScene = require(\"scripts.GameScene\")\n            else\n                gameScene = createGameScene()\n            end\n            local trans = cc.TransitionFade:create(0.5, gameScene, cc.c3b(0,0,0))\n            cc.Director:getInstance():replaceScene(trans)\n            cc.SimpleAudioEngine:getInstance():playEffect(uiPath)\n        elseif clickedButton == g_rankButton then\n            showAds()\n        end\n\n        clickedButton = nil\n    end\n\nend\n\n--size : 1.big 2.small\n--alignType : 1. mid 2. right\nfunction CreateSpriteScore(rootNode, score, size, alignType)\n    local function createScoreDigit(digit)\n        if size == 1 then\n            return createAtlasSprite(\"font_0\"..(48 + digit))\n        end\n        return createAtlasSprite(\"number_score_0\"..digit)\n    end\n\n    rootNode:removeAllChildren()\n\n    local distance = 20\n    if size == 2 then\n        distance = 15\n    end\n\n    local digits = {}\n    local tmpScore = score\n    local dig = math.fmod(tmpScore, 10)\n    digits[#digits + 1] = dig\n    while math.floor(tmpScore / 10) ~= 0 do            \n        tmpScore = math.floor(tmpScore / 10)\n        dig = math.fmod(tmpScore, 10)\n        digits[#digits + 1] = dig\n    end\n\n    local nowOffset = (#digits - 1) * distance / 2\n    if alignType == 2 then\n        nowOffset = 0\n    end\n\n    for i=1, #digits do\n        local digitSprite = createScoreDigit(digits[i])\n        digitSprite:setPosition(cc.p(nowOffset, 0))\n        rootNode:addChild(digitSprite)\n        nowOffset = nowOffset - distance\n    end\n\nend"
  },
  {
    "path": "cocos2d/.gitattributes",
    "content": "# Auto detect text files and perform LF normalization\n* text=auto\n\n# Custom for Visual Studio\n*.cs     diff=csharp\n*.sln    merge=union\n*.csproj merge=union\n*.vbproj merge=union\n*.fsproj merge=union\n*.dbproj merge=union\n\n# Standard to msysgit\n*.doc\t diff=astextplain\n*.DOC\t diff=astextplain\n*.docx diff=astextplain\n*.DOCX diff=astextplain\n*.dot  diff=astextplain\n*.DOT  diff=astextplain\n*.pdf  diff=astextplain\n*.PDF\t diff=astextplain\n*.rtf\t diff=astextplain\n*.RTF\t diff=astextplain\n"
  },
  {
    "path": "cocos2d/.gitignore",
    "content": "# Ignore thumbnails created by windows\nThumbs.db\n\n# Ignore files build by Visual Studio\n*.obj\n*.exe\n*.pdb\n*.aps\n*.vcproj.*.user\n*.vspscc\n*_i.c\n*.i\n*.icf\n*_p.c\n*.ncb\n*.suo\n*.tlb\n*.tlh\n*.bak\n*.cache\n*.ilk\n*.log\n[Bb]in\n[Dd]ebug/\n[Dd]ebug.win32/\n*.sbr\n*.sdf\nobj/\n[Rr]elease/\n[Rr]elease.win32/\n_ReSharper*/\n[Tt]est[Rr]esult*\nipch/\n*.opensdf\n\n# Ignore files build by ndk and eclipse\nlibs/\nbin/\nobj/\ngen/\nassets/\nlocal.properties\n\n# Ignore files built by NaCl\nsamples/Cpp/HelloCpp/proj.nacl/Resources/\nsamples/Cpp/TestCpp/proj.nacl/Resources/\nsamples/Cpp/TestCpp/proj.nacl/out/\nsamples/Cpp/SimpleGame/proj.nacl/Resources/\nsamples/Lua/HelloLua/proj.nacl/Resources/\nsamples/Lua/TestLua/proj.nacl/Resources/\n\n# Ignore python compiled files\n*.pyc\n\n# Ignore files build by airplay and marmalade\nbuild_*_xcode/\nbuild_*_vc10/\n\n# Ignore files build by xcode\n*.mode*v*\n*.pbxuser\n*.xcbkptlist\n*.xcscheme\n*.xcworkspacedata\n*.xcuserstate\n*.xccheckout\nxcschememanagement.plist\n.DS_Store\n._.*\nxcuserdata/\nDerivedData/\n\n# Ignore files built by AppCode\n.idea/\n\n# Ignore files built by bada\n.Simulator-Debug/\n.Target-Debug/\n.Target-Release/\n\n# Ignore files built by blackberry\nSimulator/\nDevice-Debug/\nDevice-Release/\n\n# Ignore vim swaps\n*.swp\n*.swo\n\n# Ignore files created by create_project.py\nprojects/\n\n# Ignore config files in javascript bindings generator\ntools/tojs/user.cfg\n# ... userconf.ini generated if running from tools/tojs\ntools/tojs/userconf.ini\ntools/tolua/userconf.ini\n# ... userconf.ini generated if running from tools/jenkins_scripts/mac/android/\ntools/jenkins_scripts/mac/android/userconf.ini\n\n# CTags\ntags\n\n# ignore files, created with make-all-linux-project script\n/lib\n/build/linux-build\n\n"
  },
  {
    "path": "cocos2d/.gitmodules",
    "content": "[submodule \"tools/bindings-generator\"]\n\tpath = tools/bindings-generator\n\turl = git://github.com/cocos2d/bindings-generator.git\n[submodule \"cocos/scripting/auto-generated\"]\n\tpath = cocos/scripting/auto-generated\n\turl = git://github.com/cocos2d-x/bindings-auto-generated.git\n[submodule \"samples/Javascript/Shared\"]\n\tpath = samples/Javascript/Shared\n\turl = git://github.com/cocos2d/cocos2d-js-tests.git\n[submodule \"tools/cocos2d-console\"]\n\tpath = tools/cocos2d-console\n\turl = git://github.com/cocos2d/cocos2d-console.git\n[submodule \"plugin\"]\n\tpath = plugin\n\turl = https://github.com/cocos2d-x/plugin-x.git\n"
  },
  {
    "path": "cocos2d/.travis.yml",
    "content": "language: cpp\nenv:\n  matrix:\n  - GEN_JSB=YES\n  - PLATFORM=linux DEBUG=1 CC_COMPILER=gcc CXX_COMPILER=g++\n  - PLATFORM=linux DEBUG=1 CC_COMPILER=clang CXX_COMPILER=clang++\n  # Since switching to C++11 only the ARM version of the nactive client\n  # port currently builds.  TODO(sbc): Re-enable all architectures.\n  # Disabled travis-ci build for native client port since it doesn't support std::thread, std::mutex.\n  # - PLATFORM=nacl DEBUG=1 NACL_ARCH=arm\n  - PLATFORM=android\n  # - PLATFORM=emscripten DEBUG=1\n  global:\n  - secure: |-\n      cHXOjAda+t2tmBVuVAiQfvhDN+unToO6hX1rc3dJeGDOk4rlQnylJacjA7o/\n      enkWeHagbW2Ja4h7BxQz4h7dada8zEbIbEMK4VEHx6AWwQM+GIEqkJPv5g8k\n      4P20MLpX4XyUwm/16btpnqgXlyd8Q3Zjh3Vui/5/VzwPnxUQEho=\n  - secure: |-\n      U/JsyiSR9q+8wX1arfciy3BdbMQaKmgt48/9tiU7P2RQJ/FR2AHGq85sNGI/\n      ZUxN4JPLGALEvkFMo4NYyJDUcsdRHZX3vbp5xbSSRaBigqJIj3HDxtlPVf2m\n      /W2GzcfNNX1ACO18hSWH0d2yFlF263ZmvudzQIfqTESfjGQBzwA=\n  - secure: |-\n      Wsngwo3jlZtvuPfr3RNhqrz/liNIhKYnlw4KYJO90gMQ9ZQKRTlMv2BMiPw/\n      9lV+vgJQDRcFe7dKwtC86vk10EU7Ym2bhVmhMxi/AlmJXgavjmPVdizRT7rh\n      X2Ry/Nb6hGRkH3WS0T3D/KG1+e7lP/TMB9bvo6/locLJ2A6Z1YI=\nscript:\n- export CC=$CC_COMPILER\n- export CXX=$CXX_COMPILER\n- tools/travis-scripts/run-script.sh\nbefore_install:\n- tools/travis-scripts/before-install.sh\n\n# whitelist\nbranches:\n  only:\n    - master\n    - develop\n"
  },
  {
    "path": "cocos2d/AUTHORS",
    "content": "cocos2d-x authors & contributors\n\n(ordered by the join in time)\n\nCore Developers:\n    Ricardo Quesada\n    XiaoMing Zhang (Minggo)\n    JianHua Chen (James)\n    Zhe Wang (Walzer)\n    Qingkui Hu (samuele3hu)\n    Huabing Xu (dabingnn)\n    Bo Yu (boyu0)\n    Wenhai Lin(Dhilan007)\n\n\nDevelopers:\n    Rolando Abarca\n        Javascript Binding and testjs\n        \n    Squallium\n        Added ccFPSImages entity as linked resource on linux eclipse project setting.\n        Added CocosDenshion dependency to libextension project for eclipse project of linux.\n        \n    longlene\n        Improve android project creation script\n        \n    simpliplant\n        Hardware keyboard support\n    \n    liuyq\n        CCTextureAtlas::updateQuad modify for the memcpy hot spot.\n        \n    frranck \n        adding norwegian language\n    \n    varlucian\n        fix the bug that OnEnterTransitionDidFinish was called twice when a node is added in onEnter.\n        \n    carlomorgantinizynga\n        CCLabelTTF supports for shadow and stroke\n        Adding CCLabelTTF::createWithFontDefinition.\n        New label support.\n        \n    James Gregory (j4m3z0r, Zynga)\n        Maintainer of Emscripten port.\n        Initial Emscripten port.\n        Use browser font rendering instead of FreeType.\n        Add destructor to CCGLBufferedNode.\n        Asynchronous Image loading for Emscripten\n        \n    DarraghCoy\n        Fix a potential crash SimpleAudioEngineOpenSL::playEffect\n        Fix some bugs with Set class\n        Add ccDrawSolidCircle\n        Add Rect::unionWithRect\n        Fix a memory leak in Set::removeAllObjects.\n\n    silverscania\n        Pass correct parameter to glPixelStorei when creating a texture\n\n    FlagellumDei\n        Center the window correctly on windows\n\n    ggggamer\n        fixed memory leak of preloadEffect on windows\n\n    CodeSnooker\n        Added Method to create a CCMenuItemToggle from a CCArray with a target selector\n\n    wagaf-d\n        Move ccpX functions to CCPoint methods and operators\n\n    sergey-shambir\n        Added CC_DISABLE_COPY macro\n        Added __attribute__(__format__()) for CCLog and CCString\n        Refactoring network extension and fixing unlikely memory leaks.\n        Adding PUT/DELETE methods for CCHttpRequest.\n        Adding project part for QtCreator.\n        Implemented pitch, pan and gain.\n        Using SDL backend instead of glfw for Linux.\n\n    savdalion \n        Added example for russian language in TestCpp\n        Added const modifier for classes CCArray, CCObject\n        Deprecated method fixes\n\n    rodrigogolive\n        Fix broke linux build\n\n    kdejongh\n        Fix for spaces at the beginning of wrapped lines on Android\n\n    martell\n        use tinyxml2 to replace libxml2\n        Added Mingw-crt Support without breaking VS SDK\n        CMake support for windows.\n        Added support for x64 target of windows.\n\n    mchinen\n        fix emulator issue for OpenGL ES 2.0 on Android\n        Fix missing protocol method warning for iOS 6.0 addition\n\n    DenizPiri\n        use CCLOG to implement print() function in LUA\n\n    nickveri\n    nickkwalee\n        added some missing function for setting integer shader uniforms in CCGLProgram\n\n    biteforest\n        fix cc scale9 sprite bug\n\n    Jimmy Sambuo\n        fix the bug that SimpleAudioEngine::playEffect() and playBackgroundMusic() play twice on linux\n\n    DarraghCoy\n        fix for loading custom fonts on iOS when referenced from a CCB file\n        Fix CCUserDefault.cpp compiling on Android.\n        Fixing CCFileUtils 'createXXXXWithContentsOfFile' path lookup issue.\n        Add CCDirector::popToSceneStackLevel(int level).\n        Fixing a bug that custom font can't be loaded correctly if using full path of filename on android.\n\n    Waiter\n        fix an error that OpenSLEngine can't load resources from SD card\n        add CCRemoveSelf action\n        Fixing a bug that CCLabelTTF setString crash on android.\n\n    billy1380\n        make CCLens3d support concave effect.\n        Adding 64bit target for Mac project.\n\n    benjamesward\n        add Portuguese and Arabic language support\n        Fixed linebreaks on Mac OSX\n\n    Victor K(fnz)\n        fix memory leak of CCTextureCache::addImageAsync() on iOS\n\n    tks2shimizu\n        add CCFloat, CCDouble and CCBool\n        Add append function for String class\n        Adding String::componentsSeparatedByString function for splitting string.\n\n    chenium\n        fix a bug that CCRenderTexture can not work when coming to foreground on Android\n\n    9re(Taro Kobayashi)\n        add Japanese language support\n\n    mingulov\n        improve the speed of accessing to files from apk\n\n    sburavtsov\n        fix for correct unscheduling and instance destruction of extensions/network/HttpClient.cpp\n\n    wenbin wang\n        add error handler when read image data using libjpeg\n        add korean language support\n        fix getDeviceModel bug in android CocosDenshion\n\n    Horcruxes\n        fix the bug that CCArray::createWithContentsOfFile() may not read file data on iOS\n\n    Hu Kaiou\n        contribute the new version of libcurl to support both armv7 & armv7s on iOS\n        fix some memory leak\n\n    ByungChoi\n         modify linux makefiles to fix compiling errors\n\n    edbartley\n         update MSVS and MAC projects to use project-relative path\n         CCControl* should not respond to touches if the control is not visible\n         Some improvements for CCScrollView and CCTableView.\n         Touch priority can't be set to the value specified by a call to CCMenu::setTouchPriority(int).\n         CCTableView crashes if a CCTableViewDelegate is not provided.\n         Fixing a bug that _realOpacity isn't assigned in CCLayerColor::initWithColor.\n         CCScrollView TouchPriority Fix\n         Add encrypted PVR.CCZ support to ZipUtils + Tests\n         Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c).\n\n    Weeds (Andre Rudlaff)\n        Used fontconfig to enhance font rendering on linux.\n        Fixed a bug about missing horizontal alignment for Custom TTF fonts on linux.\n        Fixed a bug that the truetype fonts from resource directory can't be found on linux.\n        Fixed the size calculations for true type fonts (especially for italic fonts).\n        Added a very simple greedy line break algorithmfor true type labels.\n        Fixed font rendering crash for certain fonts on linux.\n        Fixed potential crash in CCScheduler::removeHashElement.\n        Fixed potential crash in CCSaxParser.\n        Added kResolutionFixedHeight and kResolutionFixedWidth resolution policy.\n        Use pthread mutex and condition variable instead of pthred semaphore to load image asynchronizely.\n        Fixed crash in HttpClient request on 64Bit.\n\n    Nat Weiss (iphonegamekit.com)\n        author of Mac port\n        add TMX polygon parsing\n        Properly resets the tile's Y flipping\n\n    XiaoLong Zhang (Chukong Inc)\n    Mike McGary (Zynga)\n    Di Wu (Zynga China)\n        CCBReader and cpp reflection mechanic\n\n    Angus Comrie\n        contributes cocos2d-x port of CCControlExtension.\n\n    Yannick Loriot\n        author of CCControlExtension in cocos2d-iphone.\n\n    Surith Thekkiam (folecr, Zynga)\n        contribute for Android module building\n        Simpler, correct handling of spritesheet sources for CCScale9Sprite.\n        Clean up linked libraries for android.\n        JavaScript debugger improved and bugfixed.\n        Fix flags for debugger server socket.\n        Fix flags for debugger server socket.\n        When user has built with JS Debugger support ScriptingCore will handle necessary runtime changes.\n\n    Nicolas Gramlich (nicolasgramlich, Zynga)\n        fixed CCDirector to use CCLabelBMFont instead of CCLabelTTF\n        added CCBReader (CCBI format)\n        Added cleanup and reset methods to ScriptingCore.\n        Fixed a bug in ScriptingCore::evalString not setting the outval.\n        Updated .classpath of Android project to latest ADT 22 build tool compatibility.\n\n    Rohan Kuruvilla (rohankuruvilla, Zynga)\n        Improvements to JS Bindings.\n        Synchronizing CCBReader to version 5.\n        Adding OpenGL Bindings to Javascript.\n        Fixing a bug that nested ccb-files are not positioned correctly.\n        Fixing a bug that crash when loading valid project.\n\n    Jianfeng Zou (NetDragon Inc)\n        contributes CCListView and CCTextureWatcher.\n\n    dducharme\n        author of blackberry port\n\n    ImperialPenguin\n        Added TTF support for blackberry port.\n\n    HuaXu Cai (Kongzhong Corporation)\n        author of linux port\n\n    ciaranj\n        add a build file that correctly generates LuaCocos2d.cpp\n        add a lua template\n        add particle systems to lua bindings\n        use ant to generate LuaCocos2d.cpp and lua projects\n\n    Marat Yakupov (moadib)\n        Adds ability of simulating android enter/resume background on win32\n        Adds ability of simulating android back/menu key on win32\n        Adds support for multiple background music sources to CocosDenshion for Blackberry\n\n    Eli Yukelzon (reflog)\n        add a helper method to draw filled polygons\n        improvements to CCUserDefaults\n\n    ZhuoShi Shun\n        contribute the lua binding of CocosDenshion\n\n    Jirka Fajfr\n    Chris Calm\n        authors of CCTexturePVR\n\n    RuiXiang Zhou (NetDragon)\n    XiDi Peng (NetDragon)\n    AiYu Ye (NetDragon)\n        authors of lua binding\n\n    Max Aksenov\n        author and maintainer of Airplay port\n\n    Giovanni Zito\n    Francis Styck\n        authors of Marmalade port\n\n    Mat Hopwood( Marmalade official engineer )\n        Marmalade support for gles20 branch\n\n    Carlos Sessa\n        implement the accelerometer module for Android port\n\n    James Chen(dumganhar)\n        author of Bada port\n\n    Erawppa\n        implement CCNotificationCenter\n\n    YuLei Liao(dualface)\n        contribute the factor of lua binding\n\n    jreitman\n        fix the bug of asynchronous loading resources for iOS\n\n    Nat Weiss\n        minor enhancements to the Cocos2D-X codebase and Android build scripts\n\n    Qingyun Huang (greathqy)\n        implement CCHttpRequest\n\n    donaldalanmorrison\n        fix some warnings and memory leaks\n\n    Yinghui Peng(mustime)\n        use OpenSL ES to play effects\n        add TestLua sample\n\n    Dongyang Cai(John-cdy)\n        add automatically test tools\n\n    Sergey Vikhirev(BorMor)\n        Remove retina specific methods and logic.\n\n    johnangel\n        OpenGL framebuffer access violation fix.\n        Enable Windows XP support in Visual Studio 2012 Update 1.\n\n    Peter Farkas (fape)\n        contributes Marmalade port for gles20 branch\n        add Hungarian language support\n        fixed compilation errors after adding support of webp image format.\n\n    Tomoaki Shimizu (tks2shimizu)\n        Adding randomObject to CCDictionary.\n\n    Igor Zavorotkin (ivzave)\n        Adding lua support for linux platform.\n\n    Jozef Prídavok (jpridavok)\n        Adding CCEditBox implementation for Mac OSX.\n\n    tiantian20007\n        Fixing a crash for call runAnimation() in CCBAnimationManagerDelegate::completedAnimationSequenceNamed.\n        Fixing a bug that CCControl's touch priority is not set correctly; m_nDefaultTouchPriority is never used.\n        Fixing a syntax error for RENDER_IN_SUBPIXEL macro.\n        Implement CCDictionary::writeToFile().\n        Fixing a bug that unused spriteframes also need to be removed when purgeCachedData.\n        Adding a method to get duration of timeline for CCBAnimationManager class, it's easy for getting duration of animation in JSB.\n\n    xyhl515\n        Fixed a bug that CCControlSwitch::setOn(isOn,false) doesn't work.\n        Adds VS2012 Express template installing support.\n        Fixing a logical error in CCDrawNode::drawPolygon.\n        Fixing a bug that Jsb function getCPBody return type is not right.\n\n    DarraghCoy\n        Fix for unaligned memory access crash in CCBReader::readFloat().\n\n    Sergej Tatarincev (SevInf)\n        Making ScriptingCore.cpp compiled fine with C++11 on iOS.\n        Using shared NodeLoaderLibrary in CCBReader bindings.\n        CCEditBox iOS enchantments/bugfixes.\n        Support variable cell sizes in CCTableView.\n\n    ThePickleMan\n        Adding 'rotationIsDir' property to ParticleSystem.\n        DrawNode supports to draw triangle, quad bezier, cubic bezier.\n\n    Jianghua (jxhgzs)\n        Adding an additional transform for CCNode.\n\n    giginet\n        Fix CCRepeat#create is recieved bad argument on Lua binding.\n\n    neokim\n        Adds 'setFont' and 'setAnchorPoint' to CCEditBox.\n        Workaround for some problems due to UITextField of CCEditBoxImplIOS is attached as a view above OpenGL view.\n\n    Sam Clegg (sbc100)\n        Author of Native Client port.\n        Refactor linux build system and fix many warnings.\n        Fixing a bug where missing packages would cause the script to exit on linux.\n        Adding 'make run' target for linux projects.\n        Stripping newlines from log message and fixing linux library location.\n        Fixing a bug that CCPhysicsSprite was overriding only some of the getPosition methods.\n        Adding a macro USE_BOX2D to check whether to enable Box2D for linux and nacl port.\n        Adding Travis build support for linux and NaCl.\n        Logging assert messages to the console.\n        Renaming CCScriptSupport::executeAssert to CCScriptSupport::handleAssert.\n        Adding Native Client support for develop branch (cocos2d-x 3.0) and some warnings fixes.\n        Cleanup travis build scripts.\n        Refactoring emscripten building script.\n\n    Peter Young (young40)\n        Implements setVisible() for CCEditBox.\n        Fixing a bug that event will not be sent to server when paramMap parameter of logEvent function is nil in plugin-x.\n\n    csy1988525\n        Fixing a bug about display result is wrong when invoking CCControlButton:: setHighlighted.\n        fixed a bug when button's parent is hided, the button still can responce to clicked event.\n\n    Asad ur Rehman (AsadR)\n        Adding CCNotificationCenter::removeAllObservers(CCObject *target).\n\n    jedy\n        Fix of CCNode.h's document with doxygen 1.8.3 can't be generated.\n\n    whitegfx\n        Implementation of kEditBoxInputFlagSensitive setting for CCEditBoxImplIOS.\n\n    Zecken (gelldur)\n        Fixing a profiling compilation error in CCParticleBatchNode.\n        Fixing linking errors for TestCPP with libcurl on linux.\n        Fixing a bug that crash was triggered if there is not `textureFileName`section in particle plist file.\n\n    flamingo (flaming0)\n        Null pointer check in order to prevent crashes.\n        Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386.\n\n    rtissera (Romain TISSERAND)\n        Adding missing JNIEXPORT / JNICALL declarations.\n        Fix iOS 4.3 JPEG loading issue.\n\n    Yodesoft\n        Improving font rendering performance for linux platform.\n        Reducing function call in nativeInitBitmapDC to improve performance.\n        Refactoring writable path to \"<user's home>/.config/<app name>\" for linux platform.\n\n    sjchao\n        Fixing a display bug when a scrollView nested in another scrollView.\n\n    Éloi Rivard (azmeuk)\n        Linux OpenAL support.\n        Added some guards to prevent Eclipse to compile twice the same class.\n        Linux Eclipse projects updates\n        Refactored emscripten-build.sh, it's no longer need to be edited to make emscripten work.\n        Creation of CCDeprecated-ext.h\n        Use of a single emscripten HTML template file.\n        Added some guards in fileutils. Fixed a bug in emscripten file utils.\n        Added emscripten keyboard support\n        Clang support for Linux\n        Multiple emscripten template support. Emscripten multiple resolutions support.\n        Toplevel Makefile refactoring\n\n    elmiro\n        Correction of passed buffer size to readlink and verification of result return by readlink.\n\n    harikrishnar (Hari Krishna)\n        Wrong logic in CCArray::initWithObjects.\n        Fixing a bug that button should not get respond if its parent is invisable.\n\n    rogerzanoni\n        Fixing a linking error that libpthread and libGL libraries need to be linked on linux.\n        Fixing a compiling error of [-Werror=array-bounds] when compiling Box2dTestBed.\n\n    zhanghaojie\n        Fixing a bug that anchorPoint property of CCScale9Sprite doesn't work in CCBReader.\n\n    MarkEHenderson (Mark Henderson)\n        Fixing of variable initialization in SpriteBatchNode.\n\n    akira-cn\n        Adding response for back and menu keypad event for Android.\n\n    lgb (Oleg)\n        Fixing a compilation error for BlackBerry PlayBook.\n        Comparing float number by using epsilon and absolute difference.\n\n    jotel (Jaroslaw Lewandowski)\n        Fixing a bug that wrong type of argument signature is used in setAccelerometerIntervalJNI function.\n        Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c).\n        Explicitly initialising CCAcceleration structure.\n        Add support to save/retrieve CCData into/from CCUserDefault.\n        Text Shadows fix\n        Solving 'black screen' on android.\n\n    MarcelBloemendaal\n        Adding secureTextEntry property to CCTextFieldTTF.\n\n    brawsome\n        Adding new macro CCB_MEMBERVARIABLEASSIGNER_GLUE_WEAK to CCBMemberVariableAssigner.h.\n        Adding CCLOG before original path is returned in CCFileUtils::fullPathForFileName to aid in debugging.\n        Optmization to ccArrayGetIndexOfObject.\n\n    sunzhuoshi\n        Adding support for javascript bytecode.\n        Fixing bad js constant names.\n\n    ptekchand (Pranav Tekchand)\n        Supporting negative node scales for CCScrollView.\n\n    coolengineer (Hojin Choi)\n        Refactoring callback selector for HttpResponse.\n\n    djh-\n        Fixing a bug that displayed color of CCDrawNode is incorrect when VAO is disabled.\n\n    acai (beingstudio)\n        Fix of null pointer access in CCBAnimationManager::getRunningSequenceName.\n\n    metalgit92\n        Adding const qualification to some CCNode's getters\n\n    Clarinexus\n        Fixing a bug that setColor and setOpacity of CCControlButton and CCScale9Sprite are broken.\n\n    Xander84\n        Fixing a bug in CCBValue::getByteValue.\n        \n    smshuja\n        Fixing a bug that pointQueryFirst returns invalid Shape when a shape is not found in JSB.\n        Fixing a bug that New PivotJoint can't access 4 parameters like in html5 version.\n        Fixing a bug that Pivotjoint constructor and pointQueryFirst in Space class will return false instead of invalid shape object.\n        \n    Carsten Sandtner (casarock)\n        Adding XMLHttpRequest support for JSB.\n        \n    Lee, Jae-Hong (pyrasis)\n        Maintainer of tizen port.\n        localStorageGetItem crashes when column text is NULL.\n        fix image bug on Android\n\n    lumendes\n        Updating spine-runtime to EsotericSoftware/spine-runtimes@5f90386.\n        \n    sunxiaoyu\n        Refactoring CCEditBox to add UITextField only when keyboard was opened, remove it when keyboard was closed.\n        \n    edwardzhou (Edward Zhou)\n        Correcting the type detecting order for Lua CCBProxy::getNodeTypeName.\n        Casting variables to their own type, and print warning info if no corresponding lua callback function instead of crash.\n        fix of WebSocket url parse error for 'ws://domain.com/websocket' pattern.\n        Fixed a bug that Websocket doesn't support send/receive data which larger than 4096 bytes.\n\n    musikov\n        Fixing a bug that missing precision when getting strokeColor and fontFillColor\n        \n    hawkwood (Justin Hawkwood)\n        Fixing a bug that EditBox doesn't show any text if it's initialized with text.\n        \n    wtyqm (zhang peng)\n        Fixing a bug that ccbRootPath wasn't passed to sub ccb nodes.\n        \n    smilingpoplar (YangLe)\n        Fixing a bug that CCScale9Sprite doesn't support rotated spriteframe in atlas.\n        \n    xxuejie\n        Add namespace prefix to selector macros\n        \n    hannon235 (Chris)\n        Fixing a bug that the submenu of ExtensionTest in TestCpp can't scroll.\n        Implements a socket.io client extension and adds a test case.\n        \n    pktangyue\n        Fixing a bug that CCScale9Sprite::setInsetLeft/XXX can't work for rotated sprite frame.\n        Fixing a bug that Color and Opacity of Scale9Sprite will not be changed when it's added to NodeRGBA and run with FadeIn/Out actions.\n        Adding *.xccheckout to gitignore.\n        \n    jllust\n        Fixing a bug that CCLabelBMFont crashes in glDrawElements of CCTextureAtlas::drawNumberOfQuads sometimes.\n        \n    Sam Gross (colesbury)\n        Ignoring formatting specifiers in JavaScript log messages.\n        Make bindings-generator supports to bind std::function argument.\n        \n    James Munro (jdmunro)\n        Added JSB support for ccpDistanceSQ.\n        \n    Rafael (rafaelx)\n        A warning fix of AL_INVALID_NAME and AL_INVALID_OPERATION in SimpleAudioEngineOpenAL.cpp.\n        \n    metalbass\n        Fixing an issue that sigslot::_connection_base# (from 0 to 8) don't have virtual destructors.\n        \n     thp\n         Port Cocos2D-X to Qt 5\n         \n    Nako Sung (nakosung)\n        Fixing a bug that wrong logic when pass an empty std::vector to WebSocket::init.\n        Exposing cc.RemoveSelf to JS.\n        exposed AssetsManager to javascript and added multiple-assetsManager support\n        \n    dotsquid\n        Fixed the crash caused by improper deletion of VBOs and VAO in ParticleSystemQuad.\n        \n    maciekczwa\n        Fixing a bug that stroke color with channel color values other than 255 doesn't take effect on android.\n        \n    zcgit\n        a potential bug fix in Layer::init.\n        \n    gkosciolek\n        Fixing a bug that observers with the same target and name but different sender are the same observer in NotificationCenter.\n\n    xbruce\n        Fixing a bug that crash appears when extending cc.ScrollView in JS.\n        Fixing a bug that cc.registerTargettedDelegate doesn't support pure js object as its target.\n        \n    elwinarens (Elwin Arens)\n        Minor spelling changes in description of CCScene.h\n        \n    signmotion (Andrey Syrokomsky)\n        Fixed some compiling-warnings (MSVC2012).\n        \n    michaelcontento\n        [Android] use onWindowFocusChanged(bool) instead of onResume()/onPause()\n        Prevent nullptr access in AssetsManager\n        [Android] re-introduce Cocos2dxHelper.runOnGLThread(Runnable)\n        [Android] added EGL_RENDERABLE_TYPE to OpenGL attributes\n        Android: add xlargeScreens=\"true\" to supports-screens\n        Trigger onKeyReleased only after the key has been released.\n        Makes Colors are now comparable and explicit convertible\n        \n    bmanGH\n        Use gl caching functions in TexturePVR::createGLTexture()\n        Configuration of VAO in runtime\n        Add setUniformLocationWithMatrix2fv, setUniformLocationWithMatrix3fv mothed into GLProgram class\n        \n    metadao\n        make create_project.py more pythonic and fix some typoes\n        \n    timothyqiu\n        Project creator: use absolute path for json config files\n        Documentation fixes\n        A better way to locate project creator\n        \n    rablwupei\n        Fixed a memory leak in ScriptingCore::runScript()\n        Fixed a memory leak in Spine.\n        Added support of passing array to cc.Sequence.create and cc.Spawn.create.\n        Fixed a bug that sys.localStorage.getItem() does not support non-ascii string.\n        Fixed a memory leak in XMLHttpRequest.\n        Fixed a bug that wrong convention to jsval in cccolor4f_to_jsval and cccolor3b_to_jsval.\n    \n    Keita Obo (ktaobo)\n        Avoid unnecessary object duplication for Scale9Sprite.\n        \n    jimmystar\n        Fixed a bug that cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device.\n        \n    XiaoLongHan (kpkhxlgy0)\n        Fixed a bug that outside of keyboard can't be responded to close keyboard when using EditBox.\n        \n    lettas\n        A fix for multi-platform template.\n        \n    HoGarfield (garfield_ho)\n        Fixed a bug that CCBReader can't play sequence automatically in JSB.\n        Could not set next animation in CCBAnimationCompleted callback.\n        Fixed missing to add JSAutoCompartment when invoking JS functions from C++.\n        CCBReader: To set anchor point to 0,0 when created by loader\n        \n    lite3\n        Fixed a bug that Node's anchor point was changed after being added to ScrollView.\n        \n    superrad\n        Clear NoSuchMethodError Exception when JniHelper fails to find methodID\n        \n    Nite Luo (darkdukey)\n        Added Mouse Support For Desktop Platforms.\n        \n    ledyba\n        Fixed a bug that EventListeners can't be removed sometimes.\n        Fixed a bug that the data size has to be specified when parsing XML using TinyXML.\n        Closed X display after getting DPI on Linux.\n        \n    Luis Parravicini (luisparravicini)\n        Fixed typos in create_project.py.\n        \n    xhcnb\n        Device::setAccelerometerEnabled needs to be invoked before adding ACC listener.\n        Fixed a bug that it will get wrong custom properties when use different count custom properties in CocosBuilder.\n        \n    bopohaa\n        Fixed a bug that Webp test crashes.\n        \n    lajos\n        FontTest isn't rendered correctly with custom TTF font on Mac platform.\n        \n    hulefei\n        Added gui namespace before SEL_TouchEvent.\n        \n    zhiqiangxu\n        Fixed a logic error in ControlUtils::RectUnion.\n        Fixed an issue that there is an useless conversion in ScrollView::onTouchBegan.\n        \n    yinkaile (2youyouo2)\n        Maintainer of Armature Bone Animation.\n        \n    dmurtagh\n        Fixed a bug that UserDefault::getDoubleForKey() doesn't pass default value to Java.\n        \n    seobyeongky\n        Updates spine runtime.\n        Fixed a potential bug in Data's copy constructor. \n        \n    luocker\n        Fix a bug that string itself is also modified in `String::componentsSeparatedByString`.\n        \n    omersaeed\n        Fix a bug that game will crash if connection breaks during download using AssetManager.\n        \n    SBKarr\n        AngelCode binary file format support for LabelBMFont.\n        \n    zarelaky\n        OpenAL context isn't destroyed correctly on mac and ios.\n        \n    kicktheken (Kenneth Chan)\n        Fixed a bug that the setBlendFunc method of some classes wasn't exposed to LUA.\n        \n    andyque\n        Fixed a bug that missing to check self assignment of Vector<T>, Map<K,V>, Value and String.\n        Fixed a bug that move assignment operator doesn't clear previous content bug.\n        Fixed the compile error of Map's getRandomObject.\n        \n    daltomi\n        Fixed a typo in Director class.\n        Removed an unnecessary boolean flag in CCFontAtlasCache.cpp.\n        \n    v1ctor\n        ControlSlider supports to set selected thumb sprite.\n        ControlButton supports to set scale ratio of touchdown state\n        \n    akof1314\n        TestCpp works by using CMake and mingw on Windows.\n        \n    Pisces000221\n        Corrected a few mistakes in the README file of project-creator.\n        Corrected a mistake in README.\n        \n    hbbalfred\n        Fixed a bug that crash if file doesn't exist when using FileUtils::getStringFromFile.\n        \n    liang8305\n        Use multiple processes according the number of cores to build android project\n        \n    pandamicro\n        Exposed SAXParser to JS, it is used for parsing XML in JS.\n        \n    hanjukim\n        Fixed a bug that color and opacity settings were not applied when invoking Label::alignText.\n    \nRetired Core Developers:\n    WenSheng Yang\n        Author of windows port, CCTextField,\n        Designer of CCApplication/CCEGLView/platform structure.\n        He's working together with 2dx core team but leading FishingJoy game\n\n    Bin Zhang\n        core-team member but put himself in FishingJoy game since 2012.\n\n    RongHong Huang (flyingpaper)\n        Author of cocos2d-xna and spent all his time on wp7.\n        \n\n\nCocos2d-x can not grow so fast without the active community.\nThanks to all developers who report & trace bugs, discuss the engine usage in forum & QQ groups!\nSpecial thanks to Ricardo Quesada for giving us lots of guidances & suggestions.\n"
  },
  {
    "path": "cocos2d/CHANGELOG",
    "content": "cocos2d-x-3.0beta2 Jan.24 2014\n[All]\n     [NEW]          Full screen support for desktop platforms.\n     [NEW]          Adds performance test for EventDispatcher.\n     [NEW]          Adds performance test for Containers(Vector<>, Array, Map<K,V>, Dictionary).\n     [NEW]          DrawNode supports to draw triangle, quad bezier, cubic bezier.\n     [NEW]          Console: added the 'textures', 'fileutils dump' and 'config' commands\n     [NEW]          GLCache: glActiveTexture() is cached with GL::activeTexture(). All code MUST call the cached version in order to work correctly\n     [NEW]          Label: Uses a struct of TTF configuration for Label::createWithTTF to reduce parameters and make this interface more easily to use.\n     [NEW]          Label: Integrates LabelAtlas into new Label.\n     [NEW]          Node: Added `setGlobalZOrder()`. Useful to change the Node's render order. Node::setZOrder() -> Node::setLocalZOrder()\n     [NEW]          Renderer: Added BatchCommand. This command is not \"batchable\" with other commands, but improves performance in about 10%\n     \n     [FIX]          event->stopPropagation can't work for EventListenerTouchAllAtOnce.\n     [FIX]          Uses unified `desktop/CCEGLView.h/cpp` for desktop platforms (windows, mac, linux).\n     [FIX]          Bindings-generator supports Windows again and remove dependency of LLVM since we only need binary(libclang.so/dll).\n     [FIX]          Removes unused files for MAC platform after using glfw3 to create opengl context.\n     [FIX]          Wrong arithmetic of child's position in ParallaxNode::addChild()\n     [FIX]          CocoStudio: TestColliderDetector in ArmatureTest can't work.\n     [FIX]          CocoStudio: The order of transform calculation in Skin::getNodeToWorldTransform() is incorrect.\n     [FIX]          Crash if file doesn't exist when using FileUtils::getStringFromFile.\n     [FIX]          If setting a shorter string than before while using LabelAtlas, the effect will be wrong.\n     [FIX]          Label: Memory leak in FontFreeType::createFontAtlas().\n     [FIX]          Label: Crash when using unknown characters.\n     [FIX]          Label: Missing line breaks and wrong alignment.\n     [FIX]          Label: Corrupt looking characters and incorrect spacing between characters\n     [FIX]          Label: Label:color and opacity settings are invalid afeter these these properties changed: 1)text content changed 2)align style changed 3)max line width limited\n     [FIX]          Label: Crash when using unknown characters\n     [FIX]          Console: log(format, va_args) is private to prevent possible resolution errors\n     [FIX]          Configuration: dumpInfo() -> getInfo()\n     [FIX]          ControlSlider doesn't support to set selected thumb sprite.\n     [FIX]          ControlButton doesn't support to set scale ratio of touchdown state.\n     [FIX]          Particles: Crash was triggered if there is not `textureFileName`section in particle plist file.\n     [FIX]          Renderer: Uses a float as key with only the depth. Viewport, opaque are not needed now\n     [FIX]          Renderer Performance Fix: QuadCommand::init() does not copy the Quads, it only store a reference making the code faster\n     [FIX]          Renderer Performance Fix: Sprite and SpriteBatchNode (and subclasses) has much better performance\n     [FIX]          Renderer Performance Fix: When note using VAO, call glBufferData() instead of glBufferSubData().\n     [FIX]          Renderer Performance Fix: Doesn't sort z=0 elements. It also uses sort() instead of stable_sort() for z!=0.\n     [FIX]          Sprite: removed _hasChildren optimization. It uses !_children.empty() now which is super fast as well\n     [FIX]          Tests: Sprites Performance Test has 4 new tests\n     [FIX]          TextureCache: getTextureForKey and removeTextureForKey work as expected\n     [FIX]          TextureCache: dumpCachedTextureInfo() -> getCachedTextureInfo()\n     [FIX]          Websocket doesn't support send/receive data which larger than 4096 bytes.\n     [FIX]          Object: Remove _retainCount\n     [FIX]          ParallaxNode: Coordinate of Sprite may be wrong after being added into ParallaxNode\n     [FIX]          Crash if there is not `textureFileName`section in particle plist file\n     [FIX]          Websocket cannot send/receive more than 4096 bytes data\n     [FIX]          TextureCache::addImageAsync can't load first image\n     [FIX]          ControlSlider: Can not set \"selected thumb sprite\"\n     [FIX]          ControlSlider: Can not set \"scale ratio\"\n     [FIX]          Crash when loading tga format image\n     [FIX]          Keyboard pressed events are being repeatedly fired before keyboard is released\n[Android]\n     [FIX]          Background music can't be resumed when back from foreground\n     [FIX]          ANR (Application Not Responding) appears on android 2.3 when pressing hardware button.\n[lua binding]\n     [NEW]          Can bind classes that have the same class names but different namesapces\n     [FIX]          Use EventDispatcher to update some test cases\n     [FIX]          sp.SkeletonAnimation:registerScriptHandler should not override cc.Node:registerScriptHandler\n[javascript binding]\n     [NEW]          Bind SAXParser\n     [FIX]          Pure JS class that wants to inherite from cc.Class will trigger an irrelevant log\n     [FIX]          Mac and iOS Simulator should also use SpiderMonkey which was built in RELEASE mode\n     [FIX]          Crash when running JSB projects on iOS device in DEBUG mode\n     [FIX]          Crash when Firefox connects to JSB application on Mac platform.\n[Desktop]\n     [NEW]          Support fullscreen\n[Linux]\n     [FIX]          \"Testing empty labels\" in LabelTest crashes.\n[Mac]\n     [FIX]          Removes unused files after using glfw3 to create opengl context\n[Win32]\n     [FIX]          Compiling error when using x64 target\n     [FIX]          Tests: TestCpp works with CMake\n     [FIX]          Bindings-generator supports Windows again and remove dependency of LLVM since it only needs binary of libclang\n\ncocos2d-x-3.0beta Jan.7 2014\n[All]\n     [NEW]          New label: shadow, outline, glow support\n     [NEW]          AngelCode binary file format support for LabelBMFont\n     [NEW]          New spine runtime support\n     [NEW]          Add templated containers, such as `cocos2d::Map<>` and `cocos2d::Vector<>`\n     [NEW]          TextureCache::addImageAsync() uses std::function<> as call back\n     [NEW]          Namespace changed: network -> cocos2d::network, gui -> cocos2d::gui\n     [NEW]          Added more CocoStudioSceneTest samples.\n     [NEW]          Added UnitTest for Vector<T>, Map<K, V>, Value.\n     [NEW]          AngelCode binary file format support for LabelBMFont.\n     [NEW]          New renderer: Scene graph and Renderer are decoupled now.\n     [NEW]          Upgrated Box2D to 2.3.0\n     [NEW]          SChedule::performFunctionInCocosThread()\n     [NEW]          Added tga format support again.\n     [NEW]          Adds UnitTest for Template container and Value class\n     [FIX]          A Logic error in ControlUtils::RectUnion.\n     [FIX]          Bug fixes for Armature, use Vector<T>, Map<K, V> instead of Array, Dictionary.\n     [FIX]          Used c++11 range loop(highest performance) instead of other types of loop.\n     [FIX]          Removed most hungarian notations.\n     [FIX]          Merged NodeRGBA to Node.\n     [FIX]          Potential hash collision fix.\n     [FIX]          Updates spine runtime to the latest version.\n     [FIX]          Uses `const std::string&` instead of `const char*`.\n     [FIX]          LabelBMFont string can't be shown integrally.\n     [FIX]          Deprecates FileUtils::getFileData, adds FileUtils::getStringFromFile/getDataFromFile.\n     [FIX]          GUI refactoring: Removes UI prefix, Widget is inherited from Node, uses new containers(Vector<T>, Map<K,V>).\n     [FIX]          String itself is also modified in `String::componentsSeparatedByString`.\n     [FIX]          Sprites with PhysicsBody move to a wrong position when game resume from background.\n     [FIX]          Crash if connection breaks during download using AssetManager.   \n     [FIX]          OpenAL context isn't destroyed correctly on mac and ios.\n     [FIX]          Useless conversion in ScrollView::onTouchBegan.\n     [FIX]          Two memory leak fixes in EventDispatcher::removeEventListener(s).  \n     [FIX]          CCTMXMap doesn't support TMX files reference external TSX files\n     [FIX]          Logical error in `CallFuncN::clone()`   \n     [FIX]          Child's opacity will not be changed when its parent's cascadeOpacityEnabled was set to true and opacity was changed\n     [FIX]          Disallow copy and assign for Scene Graph + Actions objects\n     [FIX]          XMLHttpRequest receives wrong binary array\n     [FIX]          XMLHttpRequest.status needs to be assigned even when connection fails\n     [FIX]          TextureCache::addImageAsync may load a image even it is loaded in GL thread\n     [FIX]          EventCustom shouldn't use std::hash to generate unique ID, because the result is not unique \n     [FIX]          CC_USE_PHYSICS is actually impossible to turn it off\n     [FIX]          Crash if connection breaks during download using AssetManager\n     [FIX]          Project_creator supports creating project at any folder and supports UI\n[Android]\n     [NEW]          build/android-build.sh: add supporting to generate .apk file\n     [NEW]          Bindings-generator supports to bind 'unsigned long'.\n     [FIX]          XMLHttpRequest receives wrong binary array.\n     [FIX]          'Test Frame Event' of TestJavascript/CocoStudioArmatureTest Crashes.\n     [FIX]          UserDefault::getDoubleForKey() doesn't pass default value to Java.\n[iOS]\n     [FIX]          Infinite loop in UserDefault's destructor\n[Windows]\n     [NEW]          CMake support for windows.\n[Bindings]\n     [NEW]          Support CocoStudio v1.2\n     [NEW]          Adds spine JS binding support.\n     [FIX]          Don't bind override functions for JSB and LuaBining since they aren't needed at all.\n     [FIX]          The order of onEnter and onExit is wrong.\n     [FIX]          The setBlendFunc method of some classes wasn't exposed to LUA.\n     [FIX]          Bindings-generator doesn't support 'unsigned long'\n     [FIX]          Potential hash collision by using typeid(T).hash_code() in JSB and LuaBinding\n[Lua binding]\n     [NEW]          New label support\n     [NEW]          Physcis integrated support\n     [NEW]          EventDispatcher support\n     [FIX]          CallFuncND + auto remove lua test case have no effect\n     [FIX]          Lua gc will cause correcsponding c++ object been released\n     [FIX]          Some lua manual binding functions don't remove unneeded element in the lua stack\n     [FIX]          The setBlendFunc method of some classes wasn't exposed to LUA\n[Javascript binding]\n     [FIX]          `onEnter` event is triggered after children's `onEnter` event\n     \ncocos2d-x-3.0alpha1 Nov.19 2013\n[all platforms]\n     [DOC]          Added RELEASE_NOTES and CODING_STYLE.md files\n     [FIX]          Texture: use CCLOG to log when a texture is being decoded in software\n     [FIX]          Spine: fix memory leaks\n     [FIX]          fixed a memory leak in XMLHTTPRequest.cpp\n     [FIX]          removeSpriteFramesFromFile() crashes if file doesn't exist.\n     [FIX]          Avoid unnecessary object duplication for Scale9Sprite.\n     [FIX]          create_project.py does not rename/replace template projects completely.\n     [FIX]          Could not set next animation in CCBAnimationCompleted callback.\n     [FIX]          The Node's anchor point was changed after being added to ScrollView.\n     [FIX]          Refactored and improved EventDispatcher.\n     [FIX]          EventListeners can't be removed sometimes.\n     [FIX]          When parsing XML using TinyXML, the data size has to be specified.\n     [FIX]          Parameter type: const char* -> const string&\n     [FIX]          Armature: many bug fixed, add more samples, add function to skip some frames when playing animation\n     [FIX]          Configuration of VAO in runtime\n     [FIX]          Webp Test Crashes.\n     [FIX]          TransitionScenePageTurn: z fighting\n     [FIX]          AssetsManager: Adding test whether the file directory exists when uncompressing file entry,if does not exist then create directory\n     [FIX]          CCBReader: To set anchor point to 0,0 when loading Scale9Sprite\n     [FIX]          OpenGL Error 502 in Hole Demo\n     [FIX]          AssetsManager: downloading progress is not synchronized with actual download\n     [FIX]          SpriteFrameCache: memory leak when loading a plist file\n     [FIX]          removeSpriteFramesFromFile() crashes if file doesn't exist\n     [FIX]          EditBox: can't click the area that outside of keyboard to close keyboard\n     [FIX]          CCBReader: can not set next animation in AnimationCompleted callback\n     [FIX]          Node's anchor point was changed after being added to ScrollView\n     [FIX]          EventDispather: refactor method and fix some bugs\n     [FIX]          EventListner: cann't be removed sometimes\n     [FIX]          UserDefault: didn't set data size when parsing XML using TinyXML\n     [FIX]          Webp test crashed\n     [FIX]          CCHttpClient: The subthread of CCHttpClient interrupts main thread if timeout signal comes.\n     [NEW]          Arm64 support.\n     [NEW]          Added Mouse Support For Desktop Platforms.\n     [NEW]          Point: Adds ANCHOR_XXX constants like ANCHOR_MIDDLE, ANCHOR_TOP_RIGHT, etc.\n     [NEW]          Sprite: Override setScale(float scaleX, float scaleY)\n     [NEW]          External: added | operator for Control::EventType\n     [NEW]          Android & iOS screen size change support\n     [NEW]          GLProgram: setUniformLocationWithMatrix2fv, setUniformLocationWithMatrix3fv\n     [NEW]          Color[3|4][B|F]: comparable and explicit convertible\n     [NEW]          Contorl::EventType add | operation\n     [NEW]          Performance Test: Sprite drawing\n     [NEW]          Adjusted folder structure\n     [NEW]          Added tools to simplify upgrading game codes from v2.x to v3.x\n     [FIX]          Added virtual destructors on Interfaces\n[Android]\n     [FIX]          Added EGL_RENDERABLE_TYPE to OpenGL attributes\n     [FIX]          Fixed application will crash when pause and resume.\n     [FIX]          Clear NoSuchMethodError Exception when JniHelper fails to find method id\n     [FIX]          Fixed crash when backging from background\n     [FIX]          LabelTTF: crashed when setting dimension input height value less than the height of the font and the input width value is 0\n     [FIX]          Changed data type of 'char' to signed as default\n     [NEW]          Added xlargeScreens=\"true\" to supports-screens\n     [NEW]          Added build/android-build.py to build all Android samples, and remove all build_native.sh/cmd\n     [NEW]          Added build_native.py to build template projects, and remove build_native.sh/cmd\n     [NEW]          Added Cocos2dxHelper.runOnGLThread(Runnable) again\n     [NEW]          Added support for orientation changed\n     [NEW]          Disabled CDT Builder on Eclipse\n[Mac]\n     [FIX]          Removed unused CCLOG() from GL initialization\n     [FIX]          HttpClientTest: crash\n[iOS]\n     [FIX]          Can't click the area that outside of keyboard to close keyboard when using EditBox.\n     [NEW]          Added support for orientation changed\n[Linux]\n     [NEW]          Used CMake to build linux projects.\n     [FIX]          Closed X display after getting DPI on Linux.\n[Win32]\n     [FIX]          Last test case of OpenglTest crashed\n[Desktop]\n     [FIX]          Trigger onKeyReleased only after the key has been released.\n     [NEW]          Added mouse support\n[Javascript binding]\n     [FIX]          Fixed a memory leak in ScriptingCore::runScript()\n     [FIX]          sys.localStorage.getItem() does not support non-ascii string.\n     [FIX]          cc.Scheduler.schedule(target, func) without repeat argument couldn't repeat schedule forever on device.\n     [FIX]          CCBReader can't play sequence automatically in JSB.\n     [FIX]          Wrong convention to jsval in cccolor4f_to_jsval and cccolor3b_to_jsval\n     [FIX]          sys.localStorage: doesn't support non-ascii string\n     [FIX]          BuilderReader: can't play sequence  automatically\n     [FIX]          Wrong conversion to javal in cccolor4f_to_jsval and cccolor3b_to_jsval\n     [NEW]          main.js -> cocos2d-jsb.js\n     [NEW]          Remote debugging using Firefox, \"step into\" can not work\n     [NEW]          Added binding for Node::setScale(float, float)\n     [NEW]          Impvoved armature binding\n     [NEW]          Added CocoStudio releated binding codes: gui, scene parser, and add corresponding samples\n[Lua Binding]\n     [NEW]          Added Armature lua binding and added test samples.\n     [NEW]          Added LuaObjectBridge & LuaJavaBridge to simplify invoking objective-c codes and java codes from lua\n     [NEW]          Added CocoStudio releated binding codes: gui, scene parser, and add corresponding samples\n     [NEW]          Added AssetsManager binding and corresponding sample\n     [NEW]          Added XMLHttpRequest lua binding and corresponding sample\n\ncocos2d-x-3.0alpha0 @Sep.19 2013\n[all platforms]\n     [FIX]          TargetAction::reverse() works as expected\n     [FIX]          Fixed crash in OpenGLTest\n     [FIX]          Fixed logic when passing an empty std::vector to WebSocket::init()\n     [FIX]          Fixed crash in ParticleSystemQuad due to improper deletion of VBO and VAO\n     [FIX]          Point::isSegmentIntersect() returns correct value\n     [FIX]          Improved UTF8 response code in XmlHttpRequest\n     [FIX]          Observers with the same target and name but different sender are the same observer in NotificationCenter\n     [NEW]          Added ATITC format support\n     [NEW]          Better integration with physics engine\n     [NEW]          New Event Dispatcher: supports Keybaord, Touches, Accelerometer, Custom events. Added Tests as well\n     [NEW]          New Label code: Faster and more efficient than previous code\n     [NEW]          Added S3TC support\n     [NEW]          Added a method to get duration of timeline for CCBAnimationManager class\n     [NEW]          Array is compatible with STL containers.\n     [3RD]          Upgraded SpiderMonkey to Firefox v23\n[Android]\n     [FIX]          Fixed When lock screen or entering background and resume the application textures from pvr.ccz file become black\n     [FIX]          Fixed Stroke font color\n     [NEW]          Uses Native Activity\n[iOS]\n     [FIX]          Status bar can be hidden on iOS 7\n     [FIX]          Added iOS7 icons to templates and tests\n[Mac OS X]\n     [NEW]          iOS and Mac tempaltes were merged into one single Xcode project file.\n     [NEW]          Added Lua template\n[JavaScript bindings]\n     [FIX]          CCBReader is able to set properties to owner if 'owner var' is setted\n     [FIX]          Fixed crash when extending cc.ScrollView in JS\n     [FIX]          cc.registerTargettedDelegate supports pure js object as its target\n     [FIX]          Fixed memory leak in the binding glue code of cc.FileUtils.getStringFromFile(getByteArrayFromFile)\n     [NEW]          Added bindigns for Sprite::getDisplayFrame(), ControlButton callback and RemoveSelf\n[Lua bindings]\n     [NEW]          Bind Sprite::getDisplayFrame()\n\n\ncocos2d-x-3.0alpha0-pre @Jul.30 2013\n[all platforms]\n     [FIX]      #2124: Image::initWithImageFileThreadSafe is not thread safe\n     [FIX]      #2230: Node::onEnterTransitionDidFinish was called twice when a node is added in Node::onEnter\n     [FIX]      #2237: calculation offset in font rendering\n     [FIX]      #2303: missing precision when getting strokeColor and fontFillColor\n     [FIX]      #2312: WebSocket can not parse url like \"ws://domain.com/websocket\"\n     [FIX]      #2327: implement Node::isScheduled\n     [FIX]      #2338: ccbRootPath is not passed to sub ccb nodes\n     [FIX]      #2346: OpenGL error 0x0502 in  TextureAtlas::drawNumberOfQuads\n     [FIX]      #2359: Sprite will become white block when using ControlSwitch\n     [FIX]      #2361: some bug fixed of the Set class\n     [FIX]      #2366: text shadow\n     [FIX]      #2367: ClippingNode works differently on different platforms\n     [FIX]      #2370: Pivotjoint constructor and pointQueryFirst in Space class will return false instead of invalid shape object\n     [FIX]      #2381: ControlSwitch wasn't displayed correctly when adding more than one switch\n     [FIX]      #2384: The submenu of ExtensionTest in TestCpp can't scroll\n     [FIX]      #2386: ClippingNode works wrongly when being set as a child\n     [FIX]      #2396: Scale9Sprite::setInsetLeft/XXX can't work for rotated sprite frame\n     [FIX]      #2401: LabelBMFont crashes in glDrawElements of CCTextureAtlas::drawNumberOfQuads randombly\n     [FIX]      #2410: Black screen appears on android randomly\n     [FIX]      #2411: Opacity option for shadow in CCLabelTTF is not working\n     [FIX]      #2406: Color and Opacity of Scale9Sprite will not be changed when it's added to NodeRGBA and run with FadeIn/Out actions\n     [FIX]      #2415: Warning of AL_INVALID_NAME and AL_INVALID_OPERATION in SimpleAudioEngineOpenAL.cpp\n     [FIX]      #2418: Unused spriteframes also need to be removed when purgeCachedData\n     [FIX]      #2431: Potential crash when loading js files\n     [FIX]      #2229: Explicitly initialising CCAcceleration structure\n     [FIX]      #2234: Add destructor to CCGLBufferedNode\n     [Feature]  #2232: adding Norwegian language support\n     [Feature]  #2235: Ability to save/retrieve CCData into/from CCUserDefault\n     [Feature]  #2250: add support for std::function<> in CCMemuItem and CCCallFunc\n     [Feature]  #2273: Hardware keyboard support\n     [Feature]  #2278: Adds CALLBACK_0, CALLBACK_1 and CALLBACK_2 macros for MenuItems\n     [Feature]  #2279: Updates chipmunk2d to v6.1.5\n     [Feature]  #2283: Adds Polish language support\n     [Feature]  #2289: Uses clone() pattern for actions\n     [Feature]  #2332: Adding project for QtCreator\n     [Feature]  #2364: Adds DrawPrimitives::DrawSolidCircle\n     [Feature]  #2365: Adds Rect::unionWithRect\n     [Feature]  #2385: Implemented pitch, pan and gain for SimpleAudioEngine\n     [Feature]  #2389: Adding cookie support for HttpClient\n     [Feature]  #2392: Adds append() function for String class\n     [Feature]  #2395: Adds Scale9SpriteTest for TestCpp\n     [Feature]  #2399: Adds SocketIO support\n     [Feature]  #2408: Adds String::componentsSeparatedByString function for splitting string\n     [Feature]  #2414: Bindings-generator could bind std::function<> argument\n     [Refactor] #2129: Removes Hungarian notation from ivars. Removes CC and cc prefixes from name classes and free functions.\n     [Refactor] #2242: Enables c++11\n     [Refactor] #2300: Using clone() pattern instead of 'copyWithZone' pattern\n     [Refactor] #2305: Use std::thread instead of pthread\n     [Refactor] #2328: ETC support for all platforms\n     [Refactor] #2373: Change some member functions to const\n     [Refactor] #2378: Remove the usage of CC_PROPERTY_XXX in engine code\n     [Refactor] #2388: Creating a default texture for CCSprite if setTexture(nullptr) is invoked\n     [Refactor] #2397: Singleton refactor, sharedXXX --> getInstance, purgeXXX --> destroyInstance\n     [Refactor] #2404: Move all deprecated global functions and variables into CCDeprecated.h\n     [Refactor] #2430: Uses strongly typed enums (enum class) instead of simple enums\n[iOS]\n     [FIX]      #2274: compile and run for iOS7 and Xcode5\n     [Refactor] #2371: use one single Xcode project for iOS and Mac projects\n[Android]\n     [FIX]      #2306: CCLabelTTF::setString crash\n     [Refactor] #2329: use Android \"asset manager\" to improve file system read performance\n     [Refactor] #2400: use onWindowFocusChanged(bool) instead of onResume()/onPause()\n[OS X]\n     [FIX]      #2275: LabelTTF vertical alignment\n     [FIX]      #2398: Add support for initializing Image with raw data\n[windows]\n     [FIX]      #2322: link error becasue of using multiply inheritance\n[JavaScript bindings]\n     [FIX]      #2307: PhysicsSprite::getCPBody return wrong type\n     [FIX]      #2313: bind cc.ClippingNode\n     [FIX]      #2315: iterating through cc.Node children crash\n     [Feature]  #2285: bind MontionStreak\n     [Feature]  #2340: Updates SpiderMonekey to Firefox v22 (JS Bindings)\n     [Feature]  #2427: bind FileUtils.getInstance().createDictionaryWithContentsOfFile\n[Lua bindings]\n     [Feature]  #2276: Add CCScrollView Lua binding and corresponding test sample\n     [Feature]  #2277: Add OpenGL Lua binding and corresponding test sample\n     [Feature]  #2324: Add OpenGL Lua module\n     [Feature]  #2343: Redesign the mechanism of invoking Lua func from c++\n     [Feature]  #2344: make some execute functions into one function in ScriptEngineProtocol\n     [Feature]  #2426: Add DrawPrimitives test sample\n     [Feature]  #2429: LuaWebSocket supports sending binary string\n[plugin-x]\n     [FIX]      #2348: event will not be sent to server when paramMap argument of logEvent function is nil\n[Emscript]\n     [Feature]  #2289: Asynchronous Image loading\n\n\n2.1rc0-x-2.1.4 @Jnue.12 2013\n[all platforms]\n     Bug      #2098: fix TouchPriority issue of CCScrollView\n     Bug      #2107: fix crash in HttpClient request on 64Bit\n     Bug      #2115: fix linking errors for TestCPP with libcurl\n     Bug      #2128: remove setting ignoreAnchorPoint for child CCB files and fix crash while trying to load sprite frame when the file is missing\n     Bug      #2140: fix a bug that the displayed color of CCDrawNode is incorrect when VAO is disabled\n     Bug      #2142: adding CCDataVisitor and implementing CCPrettyPrinter\n     Bug      #2143: fix a crash caused by ScrollView.setDelegate(tmp function)\n     Bug      #2146: unpack texture data correctly\n     Bug      #2147: fix null pointer access in CCBAnimationManager::getRunningSequenceName()\n     Bug      #2150: fix a bug that setColor and setOpacity of CCControlButton and CCScale9Sprite are broken\n     Bug      #2251: fix a logical error in CCDrawNode::drawPolygon()\n     Bug      #2271: fix memory leak as possible\n     Feature  #1859: make AssetsManager download resources in a new thread\n     Feature  #2086: make CCLabelTTF supports shadows and stroke\n     Feature  #2100: add CCDirector::popToSceneStackLevel(int level)\n     Feature  #2105: add Travis build support\n     Feature  #2108: add example for russian language in TestCpp\n     Feature  #2111: add CC_DISABLE_COPY macro\n     Feature  #2114: add __attribute__(__format__()) for CCLog and CCString\n     Feature  #2116: support negative node scales for CCScrollView\n     Feature  #2117: implement CCDictionary::writeToFile()\n     Feature  #2122: add method to create a CCMenuItemToggle from a CCArray with a target selector\n     Feature  #2132: add encrypted PVR.CCZ support to ZipUtils + Tests\n     Feature  #2157: add Mingw-crt Support without breaking VS SDK\n     Feature  #2265: add CCLabelTTF::createWithFontDefinition()\n     Feature  #2270: add Armature(CocoStudio runtime) support\n     Refactor #2109: add const modifier for classes CCArray, CCObject\n     Refactor #2118: move ccpX functions to CCPoint methods and operators\n     Refactor #2119: use httpresponse_selector instead of callfuncND_selector for the callback function of CCHttpRequest\n     Refactor #2123: refactor network extension, fixing unlikely memory leaks, adding PUT/DELETE methods\n     Refactor #2127: add CCLOG before original path is returned in CCFileUtils::fullPathForFileName to aid in debugging\n     Refactor #2149: add const qualification to some CCNode's getters\n     Refactor #2189: CCLabelTTF::enableShadow() const update\n     Refactor #2215: refactor CCConfiguration\n     Refactor #2217: use CCLabelAtlas instead of CCLabelTTF to show FPS\n     Refactor #2231: implement a format of CCConfiguration\n     Refactor #2233: add support for \"CCString\" types for boolean and integers in CCConfiguration\n     Refactor #2236: fix memory hot spot of CCTextureAtlas::updateQuad()\n[android]\n     Bug      #1284: fix a bug that SimpleAudioEngine may cause crash on i9100\n     Bug      #2151: fix custom font loading on Android for resource mapped font files\n     Bug      #2190: updat .classpath of Android project to latest ADT 22 build tool compatibility\n     Bug      #2266: fix a bug that CCFileUtils::getFileData() may not get file data correctly on Android\n     Feature  #2161: add ETC1 image format\n[iOS]\n     Bug      #2102: fix missing protocol method warning for iOS 6.0 addition\n     Bug      #2104: fix a bug that JPEG picture not displayed correctly on iOS 4.3\n     Bug      #2260: fix a bug that CCDirectory::createWithContentsOfFile() returns a valid pointer though the file is missing on iOS\n     Refactor #2101: update cocos2dx Xcode project to detect more warnings\n     Refactor #2253: add UITextField only when keyboard was opened, removing it when keyboard was closed\n[mac]\n     Bug      #2249: fix linebreaks on Mac OSX\n[win32]\n     Bug      #2131: fix memory leak of SimpleAudioEngine::preloadEffect()\n     Bug      #2145: center the window correctly on windows\n[emscripten]\n     Feature  #2120: compile c++ to js\n     Bug      #2159: use browser font rendering instead of FreeType\n     Refactor #2133: compile for Emscripten in asm.js mode\n     Document #2121: write a document to describe the usage of emscriptenate port\n[tizen]\n     Feature  #2185: add support for Tizen\n[JavaScript bindings]\n     Bug      #2099: fix a bug in ScriptingCore::evalString() not setting the outval\n     Bug      #2179: fix a bug that pointQueryFirst returns invalid Shape when a shape is not found\n     Bug      #2186: fix a bug that new PivotJoint can't access 4 parameters like in html5 version\n     Bug      #2187: JavaScript debugger improved and bug fixed\n     Bug      #2243: fix a bug that XMLHttpRequest dones't support non-ascii characters\n     Bug      #2244: fix a bug that cc.Camera.getEyeXYZ, cc.Camera.getCenterXYZ, cc.Camera.getUpXYZ return bad values\n     Feature  #1647: Bind websocket to JavaScript\n     Feature  #2092: add XMLHttpRequest and bind it to JSB\n     Feature  #2106: add support for JavaScript byte code\n     Feature  #2162: add command line tool for generating JavaScript bytecode\n     Feature  #2214: upgrade Spidermonkey to Firefox v21\n     Refactor #2152: log assert messages to the console and renaming CCScriptSupport::executeAssert to CCScriptSupport::handleAssert\n     Refactor #2247: use functions instead of macros to speeding up building for JSB project\n[Lua bindings]\n     Feature  #2103: implement most test cases\n\ncocos2d-2.1rc0-x-2.1.3 @May.01 2013\n[all platforms]\n     Bug      #1853: use SHELLOPTS instead of \"-o igncr\" for Android Eclipse project\n     Bug      #1860: fix a bug that onNodeLoaded will be called twice if ccb was added as a CCBFile\n     Bug      #1862: fix a bug that CCScrollView::setContainer may cause dangling pointer when NULL is passed into\n     Bug      #1876: fix a bug that CCScale9Sprite::setColor() & setOpacity() are broken\n     Bug      #1935: fix a bug that use \"==\" for float comparison of CCPoint and CCSize\n     Bug      #1937: fix a bug that CCControl's touch priority is not set correctly, m_nDefaultTouchPriority is never used\n     Bug      #1943: added some missing function for setting integer shader uniforms in CCGLProgram\n     Bug      #1999: allowing to set fontName and fontSize separately for CCEditBox\n     Bug      #2003: fix a potential crash in CCScheduler::removeHashElement()\n     Bug      #2030: fix a bug that scissor rectangle in nested CCScrollView is wrong\n     Bug      #2031: make CCFileUtils::createXXXXWithContentsOfFile() support relative path\n     Bug      #2035: fix a potential crash in CCSaxParser\n     Bug      #2037: fix a wrong logic in CCArray::initWithObjects()\n     Bug      #2040: get scale property from sub-ccb node may trigger an assert\n     Bug      #2054: fix a bug that anchorPoint property of CCScale9Sprite doesn't work in CCBReader\n     Bug      #2055: enable easy switching between Box2D and chipmunk\n     Bug      #2058: properly resets the tile's Y flipping\n     Bug      #2061: fix a bug that wrong type of argument signature is used in setAccelerometerIntervalJNI function\n     Bug      #2073: fix a memory leak in CCUserDefault\n     Bug      #2080: fix a bug that _realOpacity isn't assigned in CCLayerColor::initWithColor\n     Feature  #2001: add CCRemoveSelf Action\n     Feature  #2048: support variable cell sizes in CCTableView\n     Feature  #2065: adding kResolutionFixedHeight and kResolutionFixedWidth resolution policy\n     Feature  #2068: adding a secureTextEntry property to CCTextFieldTTF\n     Feature  #2069: adding new macro CCB_MEMBERVARIABLEASSIGNER_GLUE_WEAK to CCBMemberVariableAssigner.h\n     Feature  #2075: support spine editor\n     Feature  #2076: adding a method CCBReader::setResolutionScale for setting resolution scale manually\n     Refactor #1592: updating UTHASH to v1.9.8\n     Refactor #2042: remove libxml2\n     Refactor #2097: use pthread mutex and condition variable instead of pthread semaphore to load image asynchronizely \n[android]  \n     Bug      #1996: adding missing JNIEXPORT / JNICALL declarations\n     Bug      #2028: fix a bug taht application can not run correctly on Android simulator\n     Bug      #2045: some small fixes to CocosPlayer\n     Bug      #2062: fix for spaces at the beginning of wrapped lines\n     Bug      #2083: fix a bug that Bytecode of LuaJIT can't work on android\n     Refactor #1613: not reload resources when coming from background on Android\n     Refactor #1861: CocosPlayer Android update\n     Refactor #1904: strip libcurl.a on x86 architecture\n     Refactor #2027: reduce function call in nativeInitBitmapDC to improve performance\n     Refactor #2047: clean up linked libraries for android\n[iOS]\n     Bug      #1863: fix a bug that CCUserDefault on iOS may not save immediately\n     Feature  #2096: adding Cocosplayer for iOS and bug fixes\n[linux]\n     Bug      #1932: fix a bug that font rendering crashed for certain fonts\n     Bug      #2036: correct passed buffer size to readlink\n     Bug      #2044: link libpthread and libGL\n     Bug      #2046: strip newlines from log message and fixing linux library location\n     Bug      #2052: fix a bug that [-Werror=array-bounds] error appears when compiling Box2dTestBed\n     Feature  #2032: Linux OpenAL support\n     Refactor #2000: improve font rendering performance for linux platform\n     Refactor #2053: set writable path to \"<user's home>/.config/<app name>\"\n[mac]\n     Bug      #2051: fix a bug that TestCpp/ExtensionsTest/CocosbuilderTest crashes under x86_64 target\n     Feature  #1856: adding 64bit target for Mac project\n[JavaScript bindings]\n     Bug      #1855: fix a bug that std_string_to_jsval generates messy js string when passed a non-ascii UTF8 std::string\n     Bug      #2057: adding response for back and menu keypad event for Android\n     Bug      #2059: fix a bug that cc.FileUtils.getInstance().getStringFromFile(filename) doesn't return a whole string\n     Bug      #2071: fix a bug that cc.TMXLayer.getTiles() can't work\n     Feature  #1841: find a way to obfuscate JavaScript code on the top of JSB\n     Feature  #1936: adding OpenGL Bindings to Javascript\n     Feature  #2043: upgrading SpiderMonkey to Firefox20.0\n     Feature  #2060: support for cc.FileUtils.getInstance().getByteArrayFromFile(filename)\n     Feature  #2064: exposing cc.Node.nodeTo***Transform to JS\n     Refactor #1944: subclass of cc.Sprite,cc.Layer... doesn't need cc.associateWithNative anymore\n[Lua bindings]\n     Feature  #1814: add menutest \n     Feature  #1941: add TileMapTest\n     Feature  #1942: add LayerTest\n     Feature  #1945: use CCLOG to implement print() function\n     Feature  #1993: add ParallaxTest\n     Feature  #1994: add ActionManagerTest\n     Feature  #1997: add IntervalTest\n     Feature  #1998: add SceneTest\n     Feature  #2002: add Texture2dTest, RenderTexture, ZwoptexTest, FontTest, CocosDenshionTest and EffectsAdvancedTest\n     Feature  #2004: add UserDefaultTest\n     Feature  #2005: add CurrentLanguageTest\n     Refactor #1847: use luajit\n     Refactor #2084: unify the method of loading Lua files on all platforms\n\ncocos2d-2.1rc0-x-2.1.2 @Mar.20 2013\n[all platforms]\n     Bug      #1529: use NSUserDefaults on iOS and SharedPreferences on Android implement CCUserDefault\n     Bug      #1672: fix a bug that CCTableView is too sensitive on some devices with high density display\n     Bug      #1689: support horizontal alignment for Custom TTF fonts\n     Bug      #1691: fix a bug that CCControlSwitch::setOn(isOn,false) doesn't work\n     Bug      #1692: add TMX polygon parsing\n     Bug      #1697: fix a logical error in CCRenderTexture::initWithWidthAndHeight()\n     Bug      #1710: add simpler,correct handling of spritesheet sources for CCScale9Sprite\n     Bug      #1711: fix a bug that clipping rectangle of CCScrollView is wrong when the scale of its ancestors isn't equal to 1\n     Bug      #1731: change declaration of CCSize, CCPoint and CCRect in pkg file\n     Bug      #1751: fix a bug that clicking outside of CCTableViewCell will also get response when container size is smaller than view size\n     Bug      #1754: fix a bug that offset of the container is wrong in CCTableView\n     Bug      #1821: fix a bug that the display result is wrong when invoking CCControlButton::setHighlighted()\n     Feature  #1686: synchronize to cocos2d-iphone v2.1rc0\n     Feature  #1708: adding Portuguese and Arabic language support\n     Feature  #1712: add an interface to get DPI\n     Feature  #1741: CCLens3d can be concave\n     Feature  #1742: add 'rotationIsDir' property to ParticleSystem\n     Feature  #1761: implement setVisible() for CCEditBox\n     Feature  #1807: add getStartLocationInView() and getStartLocation() methods in CCTouch\n     Feature  #1822: add CCNotificationCenter::removeAllObservers(CCObject *target)\n     Feature  #1838: synchronize CCBReader to the lastest version\n     Feature  #1489: add AssetsManager\n     Refactor #1687: refactor CCFileUtils and CCImage\n     Refactor #1700: add webp image format support\n     Refactor #1702: change return value of CCFileUtils::getWritablePath()\n     Refactor #1703: replace libxml2 with tinyxml2\n     Refactor #1749: add 'setFont' and 'setAnchorPoint' to CCEditBox\n[android]\n     Bug      #1752: fix a bug that libcurl.a causes link error after being stripped\n     Bug      #1760: fix a bug that cpufeatures module is redefined\n     Bug      #1775: fix a bug that OpenSLEngine can not load resources from SD card\n     Bug      #1812: fix a warning of getStringWithEllipsisJni() function when compiling it with clang\n     Feature  #1827: support building android project, including native codes, in Eclipse\n[iOS]\n     Bug      #1750: fix a bug that CCEditBox's position is incorrect when it's added to a non-fullscreen CCNode\n     Bug      #1804: fix for loading custom fonts on iOS when referenced from a CCB file\n     Feature  #1842: support kEditBoxInputFlagSensitive setting for CCEditBox on iOS\n     Refactor #1755: add CocosDenshion xcode project\n     Refactor #1825: use CCLabelTTF to show text for CCEditBox\n[JavaScript bindings]\n     Bug      #1707: fix a crash caused by unaligned memory access in CCBReader::readFloat()\n     Bug      #1726: fix crash of JSB application on android device with armv6 architecture\n     Bug      #1729: fix compiling error of ScriptingCore.cpp with C++11 on iOS\n     Bug      #1747: fix a crash when passing null to cc.AnimationFrame.initWithSpriteFrame()\n     Bug      #1823: use shared NodeLoaderLibrary in CCBReader bindings\n     Feature  #1724: add HelloJS sample\n     Feature  #1730: bind CCScrollView and CCTableView to js\n     Feature  #1748: separate chipmunk and sqlite from js_binding_core.cpp\n     Feature  #1753: upgrade SpiderMonkey to Firefox19.\n     Feature  #1808: make cxx_generator support parsing functions that have default parameters\n     Feature  #1811: add a method to get file data for JSB\n     Feature  #1824: bind CCEditBox to JS\n     Refactor #1682: add ScriptingCore::getGlobalObject() function\n     Refactor #1740: add cleanup and reset methods to ScriptingCore\n     Refactor #1830: use JS::CompileOptions::setUTF8(true) to compile script\n     Refactor #1836: make js target of \"cc.Scheduler().scheduleCallbackForTarget()\" accept a object that not depend on CCNode or its subclass\n     Refactor #1837: refactor schedule binding codes\n[Lua bindings]\n     Bug      #1745: fix a bug that CCRepeat:create() receives error argument\n     Feature  #1425: fix errors in Lua test cases and add more test cases\n     Feature  #1698: add CCLuaObjcBridge\n     Feature  #1802: add TouchesTest for Lua binding\n     Refactor #1818: cleanup the tolua++ bindings build system\n[win32]\n     Feature  #1634: CCEditBox support\n     Feature  #1746: add VS2012 Express template installing support\n[linux]\n     Bug      #1688: fix a bug that truetype fonts from resource directory can't be found\n     Bug      #1810: fix a bug that SimpleAudioEngine::playEffect() and playBackgroundMusic() play twice on linux\n     Bug      #1819: fix a bug that building script exits when missing packages\n     Bug      #1834: fix the size calculations for true type fonts (especially for italic fonts)\n     Refactor #1806: refactor linux build system\n     Refactor #1820: add 'make run' target for linux projects\n[mac os]\n     Bug      #1637: fix a bug that CCLabelTTF & CCMenuItemLabel cannot display on Mac Retina\n[black berry]\n     Refactor #1709: add support for multiple background music sources\n[chrome native client]\n     Feature  #1762: add Native Client support\n\n\ncocos2d-2.1beta3-x-2.1.1 @Jan.29 2013\n[ all platforms]\n     Bug      #1547: fix a bug that when CCMenuItem is removed before touch ended, application will crash if keeping moving\n     Bug      #1553: fix a memory leak in CCControllButton\n     Bug      #1604: fix a bug that the enum values in ccPVR3TexturePixelFormat are truncated to 32bit\n     Bug      #1605: fix a crash that when adding just one action to CCSequence\n     Bug      #1639: fix a bug that CCBReader miss parsing some properties  \n     Bug      #1659: fix a bug that invoking runAnimation() in CCBAnimationManagerDelegate::completedAnimationSequenceNamed will cause crash\n     Bug      #1662: fix a bug that returns wrong full path if texture name in the plist doesn't contain relative path \n     Bug      #1664: fix a logical error in CCAtlasNode::setOpacityModifyRGB\n     Bug      #1670: fix a memory leak in CCBReader\n     Bug      #1674: fix a logical error in CCScale9Sprite constructor\n     Bug      #1680: fix a bug that can't set touch priority by invoking CCMenu::setTouchPriority()\n     Bug      #1681: fix a bug that CCTableView crashes if CCTableViewDelegate is not provided\n     Feature  #1598: add japanese language support\n     Feature  #1625: add stackable action support and exchange the order of parameters for 3d relative actions\n     Feature  #1667: add file name lookup support\n     Refactor #1593: remove all deprecated methods\n     Refactor #1599: do some improvements of CCScrollView and CCTableView\n     Refactor #1602: add randomObject to CCDictionary\n     Refactor #1603: adjust samples directory structure\n     Refactor #1606: return CCSequence pointer for CCSequence::create\n     Refactor #1648: make CCPoint, CCRect and CCSize not inherit from CCObject\n     Refactor #1649: change return type to const reference for member variable accessing\n     Refactor #1654: report function and line number for CCAssert\n     Refactor #1683: refactor CCFileUtils to make it be compatible with the resource searching strategy of cocos2d-iphone\n     Document #1650: add detailed comments for CCDictionary\n     Document #1678: add detailed doxygen comments for CCNode\n[android]\n     Bug      #1544: fix a bug that CCRenderTexture works wrong after coming back to foreground\n     Bug      #1580: fix a bug that application may lost focus after popping up keyboard\n     Bug      #1607: fix a bug that the path CCUserDefault saves in may cause issue\n     Bug      #1610: fix a bug that CCLabelTTF will lost a character at the end of a line\n     Bug      #1623: fix a bug that SimpleAudioEngine::playBackgroundMusic() may not take effect\n     Bug      #1679: upload unstripped prebuilt libraries for armeabi-v7a architectures\n     Refactor #1673: add <uses-feature android:glEsVersion=\"0x00020000\"/> to AndroidManifest.xml\n[iOS]\n     Bug      #1600: fix a bug that application created by xCode template will crash after coming to foreground\n     Bug      #1612: fix some compilation errors when using c++11 compiler\n     Bug      #1657: fix a memory leak in CCTextureCache::addImageAsync()\n     Refactor #1636: refactor CCEditBox\n[win32]\n     Refactor #1627: add VS version check in project file\n[marmalade]\n     Bug      #1631: make SimpleGame force landscape\n     Refactor #1629: add marmalade third party cleanup\n     Refactor #1630: add TestLua post-build script\n     Refactor #1632: remove grskia dependency and add in freetype support to the builds.\n[linux]\n     Feature  #1611: add Lua support\n     Refactor #1621: add linux 64bit target for eclipse project\n     Refactor #1676: refactor makefile and eclipse project configuration\n[JavaScript bindings]\n     Bug      #1550: fix some memory leaks in JSBinding\n     Bug      #1614: fix a crash caused by DrawNodeTest\n     Bug      #1622: fix a crash when cc.Node.getChildren is invoked if it has no children\n     Bug      #1641: fix a bug that the coins in WatermelonWithMe don't animate\n     Bug      #1644: fix a crash caused by passing NULL parameter to ccdictionary_to_jsval\n     Bug      #1645: fix a bug that JS Project created by xXode template doesn't work correctly\n     Bug      #1653: handle correctly when parsing int value in JSB\n     Feature  #1620: add sys.localStorage support for JSB\n     Feature  #1642: add tools for generating js-binding codes on windows\n     Feature  #1646: update SpiderMonkey to v18.0\n     Feature  #1660: add js-debugger for js-binding\n     Feature  #1661: add jsb sample game CrystalCraze\n     Refactor #1530: do some improvements to JS Bindings\n     Refactor #1633: implement sys.capabilities for JSB\n[Lua bindings]\n     Refactor #1608: add CCNode::scheduleUpdateWithPriorityLua() for LuaBinding\n     Refactor #1626: add CCDirector::setDisplayStats() for luabinding\n\ncocos2d-2.1beta3-x-2.1.0 @Dec.5 2012\n [all platforms]\n     Bug      #1556: set a default texture for CCParticleFire, CCParticleFireworks, etc\n     Feature  #1555: update to cocos2d-iphone v2.1 beta3\n     Feature  #1564: update tests to cocos2d-iphone v2.1beta3\n     Feature  #1572: add sample game WatermelonWithMe\n     Feature  #1573: add sample game CocosDragonJS\n     Refactor #1545: remove the usage of NODE_FUNC and CREATE_FUNC\n     Refactor #1565: remove VS2008 support\n     Refactor #1576: update CCBReader to latest version of CocosBuilder\n     Refactor #1589: add CCBReader::setCCBRootPath()\n [iOS]\n     Bug      #1548: update libcurl header files to 7.26.0 on iOS \n [android]\n     Bug      #1551: add error handler when reading image data using libjpeg\n     Refactor #1558: improve the speed of accessing to files from apk\n [marmalade]\n     Bug      #1559: fix a bug that if a file in resource directory doesn't exist, it will not search from root directory\n     Bug      #1571: add box2d rope to marmalade project\n     Bug      #1590: JPEG and File fixes for marmalade\n     Feature  #1557: Marmalade support\n     Refactor #1574: update marmalade languages\n     Refactor #1575: update samples/TestCpp to compatible with marmalade\n     Refactor #1578: create cocos2dx-ext marmalade project\n     Refactor #1591: add TestLua marmalade project \n [JavaScript bindings]\n     Bug      #1577: fix a bug that touch events lost on Win32 when using JSBinding\n     Bug      #1586: fix a crash in WatermelonWithMe\n     Bug      #1588: rescheduleCallback support for JSBinding\n     Refactor #1570: improve the debugger for JSBinding\n [Lua bindings]\n     Bug      #1587: remove Lua script handler in CCCallFunc's destructor\n\ncocos2d-2.0-x-2.0.4 @Nov.2 2012\n [all platforms]\n    Bug       #1473: fix a bug that CCScale9Sprite does not support rotated spriteframe in atlas \n    Bug       #1494: fix a bug that missing removing auto-release object from AutoReleasePool if it invokes 'autorelease' method more than one time\n    Bug       #1495: fix a bug that CCScrollView display area and touch area are wrong if its parent's postion isn't at CCPointZero in world\n    Bug       #1508: fix a bug that potential observer array modification while it's traversed in CCNotificationCenter\n    Bug       #1510: fix a bug that application will freeze when 'numberOfCellsInTableView' returns zero\n    Bug       #1516: fix a bug that the font size of labels for displaying FPS,SPF,DrawCount is incorrect in different design resolutions\n    Bug       #1536: CCControl* should not respond to touches if the control is not visible\n    Bug       #1538: fix a logic error in CCControlHuePicker::checkSliderPosition()\n    Bug       #1543: fix a bug that CCLayerGradient background of CocosBuilderTest can't be shown\n    Feature   #1515: add a zoom function for debugging large resolution (e.g.new ipad) app on desktop\n    Refactor  #1312: upgrade libcurl to 7.26.0  \n    Refactor  #1486: apply multi-resolution mechanic on iOS, especially for iphone5\n    Refactor  #1520: add comments to describe the usage of multiresolution in HelloCpp\n    Refactor  #1521: use relative coordinates in TestCpp\n    Document  #1532: write a document describes how to debug games for ipad3 on low-resolution PC \n    Document  #1493: add doxygen comments in CCNotificationCenter.h\n [android]\n    Bug       #1466: reload shader for test case \"ShaderTest\" after it comes from background\n    Bug       #1500: fix a bug that CCRenderTexture cannot render properly on some Qualcomm Adreno GPUs\n    Bug       #1507: fix a bug that can not play effect for the first time without pre-load effect\n [iOS]\n    Bug       #1527: fix a bug that MoonWarriors can not run on iOS simulator sometimes\n    Refactor  #1491: remove dependency of FontLabel lib\n [JavaScript bindings]\n    Bug       #1526: fix a bug that JavaScript binding related samples will crash on iOS devices\n    Feature   #1469: add MoonWarriors as a sample game\n    Refactor  #1487: use shared JavaScript test cases with cocos2d-html5 and cocos2d-iphone\n    Refactor  #1517: upgrade SpiderMonkey to FF 17.0 beta3\n [Lua bindings]\n    Bug       #1506: fix a compilation error of TestLua if the path of cocos2d-x contains spaces  \n [win32]\n    Bug       #1496: fix an error of comparing font's face name in CCImage of win32 port\n    Bug       #1511: fix openGL framebuffer access violation\n    Bug       #1540: fix win32 CCLuaLog memory leaks and invalid console UTF8 output\n    Feature   #1513: add Multi-Touch support for win7/8 tablet or ultrabook\n    Refactor  #1512: change writable directory to \"C:\\Documents and Settings\\username\\Local Settings\\Application Data\\your app name\" if the app be built in release mode\n\ncocos2d-2.0-x-2.0.3 @Sep.26 2012\n [all platforms]\n    Bug       #1452: change CCRGBAProtocol to public in order for actions like CCTintTo to have an affect on the CCScale9Sprite\n    Bug       #1454: make JavaScript binding work together with Lua binding and c++ codes\n    Bug       #1464: fix a crash caused by CCLabelBMFont\n    Bug       #1478: fix a bug that TMX parser causes tileset images not to be loaded\n    Bug       #1479: fix a bug that CCNotificationCenter does not check whether the object is valid before post notification\n    Bug       #1485: fix potential memory leak in CCNotificationObserver\n    Feature   #1458: add CCTableView\n    Feature   #1460: min/max allowed value for CCControlSlider\n    Feature   #1470: update CCBReader to cocosbuilder v2.1 beta\n    Feature   #1483: synchronize CCControlExtension to newest version\n    Refactor  #1477: abstracts Lua and JS binding protocol, some bugs fixes in lua-binding, adding custom menu on win32 and mac for switching resolutions\n [iOS]\n    Bug       #1482: fix a bug that orientation is wrong on iOS 6 SDK\n    Bug       #1453: fix a bug that CCGL.h includes wrong path of a header file\n    Bug       #1484: fix a minor memory-logic error in EditBoxImplIOS.mm\n    Feature   #1455: add Xcode template for cocos2dx-js\n [android]\n    Refactor  #1481: refactor android Java+JNI\n [mac os]\n    Bug       #1456: remove code signing from MAC TestCpp project\n [linux]\n [win32]\n    Feature   #1457: Add vs2012 sln\n    Feature   #1474: popup a warning dialog instead of crash directly when OpenGL version is too old to run 2dx\n [js-bindings]\n    Feature   #1451: merge new js-binding codes\n    Refactor  #1476: update location of spidermonkey-android makefile\n [lua]\n    Refactor  #1480: Update lua-binding for overloaded functions\n [tools]\n    Feature   #1404: add scripts for jenkins-ci\n\ncocos2d-2.0-x-2.0.2 @Aug.30 2012\n [all platforms]\n    Bug       #1298: fix a logical error of CCSequence\n    Bug       #1371: fix a particle crashes if setAutoRemoveOnFinish(true)\n    Bug       #1379: fix a typo error of comment in CCNode.cpp\n    Bug       #1381: fix a bug that CCLayerColor::setContentSize() declared differently with CCNode::setContentSize()\n    Bug       #1382: fix a crash of CCBReader caused by null pointer\n    Bug       #1384: fix an error when loading CCControlButton from ccbi\n    Bug       #1385: fix a logic error in BitmapFontMultiLineAlignment\n    Bug       #1386: fix a crash of PauseResumeActionsTest\n    Bug       #1395: fix a bug that CCTextureCache::addImage ignores error in CCTexture2D::initWithImage()\n    Bug       #1400: re-assign texture rect of CCControlSlider to consider SpriteFrame orientation\n    Bug       #1403: fix a bug that do not support png8 format\n    Bug       #1408: fix a bug that CCMenuItemImage is not loaded when the target and selector are empty in CCBReader\n    Bug       #1409: fix a bug that loading CCControlButton from ccbi failed\n    Bug       #1427: fix a bug that CCArray::randomObject() may use index that out of range\n    Bug       #1430: fix a bug that can not compute correct label's width or height when its value is 0\n    Bug       #1440: fix a bug that CCSprite::displayFrame() uses wrong offset to create a sprite frame\n    Feature   #1416: add object-oriented API of CCGeometry\n    Feature   #1405: implement multi-resolution adaption solution\n    Feature   #1424: add a simple wrapper of http access\n    Feature   #1429: add CCEditBox which wraps system edit control\n    Feature   #1439: synchronize to cocos2d-iphone 2.0 stable version\n    Refactor  #1399: adjust directory structure\n    Refactor  #1402: improve static creator function names to avoid confusion\n    Refactor  #1413: improve CCTouch::getLocation(), getDelta() which returns OpenGL coordinates directly\n    Refactor  #1437: change the return type of CCApplication::sharedApplication() and CCEGLView::sharedOpenGLView() to a pointer\n    Refactor  #1441: put hd and iPad resources of TestCpp into separate directories\n    Refactor  #1442: use CREATE_FUNC to replace LAYER_CREATE_FUNC and SCENE_CREATE_FUNC\n [iOS]\n    Bug       #1389: fix a Xcode 4.5-specific compiling errors that can not convert -1 to unsigned int\n    Bug       #1432: fix a bug that \"MutiTouchTest\" crashes on IOS if putting more than 5 fingers on the screen\n    Refactor  #1383: change the file path that CCUserDefault saves xml file in\n    Refactor  #1433: remove fpsxxx.png in template\n    Refactor  #1443: Fix some warnings\n [android]\n    Bug       #1284: use OpenSL ES to play effects when the device is i9100\n    Bug       #1372: fix a typo error in platform/android/CCEGLView.h\n    Bug       #1377: fix TMX Tile cracks in the Test App\n    Refactor  #1407: cleaner build script\n    Refactor  #1438: make android template use its own source files\n [mac os]\n    Bug       #1417: fix a compiling error when building TestCpp for mac port using command line\n    Feature   #1401: add mac port\n [win32]\n    Bug       #1390: fix a win32 error says \"The application failed to initialize properly\"\n [linux]\n    Bug       #1445: fix compiling errors on linux\n    Feature   #1419: add linux port\n [blackberry]\n    Feature   #1420: add blackberry port\n\ncocos2d-2.0-rc2-x-2.0.1 @Jun.28 2012\n [all platforms]\n    Bug       #1257: synchronize CCGrabber.cpp \n    Bug       #1280: fix a bug that BitmapFontMultiLineAlignment test doesn't work correctly\n    Bug       #1286: fix the declaration of tgaLoadRLEImageData()\n    Bug       #1293: fix a bug that CCDirector::getFrames() returns wrong value\n    Bug       #1296: fix a logical error in CCTMXTiledMap::tilesetForLayer()\n    Bug       #1300: fix a typo of CC_ENABLE_CACHE_TEXTTURE_DATA\n    Bug       #1301: apply scissor with points in CCEGLView::sharedOpenGLView().setScissorInPoints()\n    Bug       #1302: change the parameter type of CCMenu::setHandlerPriority to signed int\n    Bug       #1308: fix a logical bug in CCTouchDispatcher\n    Bug       #1326: fix a bug that the compilation of HelloLua and testjs project was broken after synchronizing to rc2\n    Bug       #1330: fix bugs of CCBIReader\n    Bug       #1335: fix memory leaks in cocos2dx and CCBReader\n    Bug       #1368: implement a test case(Effect4) in EffectsAdvancedTest\n    Feature   #1202: remove CCFileData\n    Feature   #1310: synchronize to rc2\n    Feature   #1323: support  CCBIReader\n    Feature   #1324: add create() for static member functions that new an autorelease object\n    Feature   #1332: add macro COCOS2D_VERSION in cocos2d.h\n    Feature   #1333: support CCScrollView\n    Feature   #1334: add ScrollViewTest to CocosBuilderTest\n    Refactor  #1181: refactor CCRenderTexture\n    Refactor  #1283: use relative path in cocos2d.h\n    Refactor  #1288: enhances CCTransitionScene to work even if there is no running scene\n    Refactor  #1289: update CCControlButton: add zoomOnTouchDown property and setPreferredSize\n    Refactor  #1292: modify some function names to make them more readable\n    Refactor  #1336: use CC_DEPRECATED_ATTRIBUTE macro to mark deprecated interfaces\n    Refactor  #1367: change some function names that start with \"createWith\" to \"create\"\n [iOS]\n    Bug       #1290: fix a bug that a project generated by template can not find Shaders folder\n    Bug       #1297: fix a bug that the effect is wrong when using projection 2d and enabling retina\n    Bug       #1299: fix a bug that SimpleAudioEngine::resumeEffect and SimpleAudioEngine::resumeAllEffects will play effects that are played previously\n    Bug       #1315: fix wrong effect of TileMapTest when enabling retina\n    Bug       #1338: fix a crash of CocosdenshionTest when playing effect then clicking HOME menu\n    Bug       #1343: fix a bug of Xcode template\n    Bug       #1364: fix a bug that can not resume background music after pausing it\n    Refactor  #1269: generate project for cocos2dx, then HelloWorld, tests, HelloLua and testjs can refer it\n [android]\n    Bug       #1239: fix a bug that can not stop effect if play effect with loop mode twice\n    Bug       #1278: fix a  bug that CocosDenshion::unloadEffect() can not stop playing effect\n    Bug       #1322: make CCLabelTTF support vertical alignment\n    Refactor  #1287: make android template's build_native.sh automatically copy new icons\n    Refactor  #1329: move all java files part of engine into a certain directory, then all projects refer them\n [win32]\n    Bug       #1282: fix a crash that if the display card is ATI\n    Bug       #1344: fix a bug of win32 template\n    Bug       #1365: fix a bug that some files of Resources folder which is copied by build_native.sh will lost authority in cygwin\n    Bug       #1366: fix a crash of tests\n [lua]\n    Bug       #1369: fix a crash when invoking CCLabelTTF:setPosition(x,y)\n    Feature   #1327: export 'create' method for Lua bindings\n\ncocos2d-2.0-rc0a-x-2.0 @May.31 2012\n [all platforms]\n    Bug       #1094: fix a bug that nothing will be shown when using CCParticleBatchNode\n    Bug       #1115: fix a bug that CCFileUtils::fullPathFromRelativePath() with resolution parameter return error value with empty string\n    Bug       #1137: fix a memory leak in CCLabelBMFont and sync the implementation of CCLabelBMFont to gles20 branch\n    Bug       #1138: fix a memory leak in CCTextureCache::addPVRImage.\n    Bug       #1155: revert CCDirector singleton to original implementation\n    Bug       #1157: fix a bug that nothing is shown in TMX Orthogonal Test\n    Bug       #1158: fix a bug in CCParticleSystemQuad\n    Bug       #1159: update \"CallFuncND + auto remove\" test demo\n    Bug       #1160: rename 'CGFloat' to 'CCFloat'\n    Bug       #1164: add the render mode which uses VBO without VAO in CCParticleSystemQuad\n    Bug       #1165: merge pull request #842\n    Bug       #1187: fix a bug that spanish(Buen día) cannot be shown completely in CCLabelBMFont unicode test\n    Bug       #1189: CCLabelBMFont updateLabel() optimizations and fixes\n    Bug       #1212: fix a bug that TMXBug787Test crash.\n    Bug       #1217: fix a bug that EaseActions reverse broken\n    Bug       #1232: fix a bug that CCLayerGradient::updateColor() assign wrong value to m_pSquareColors\n    Bug       #1244: fix memory leak in CCParticleSystem::initWithDictionary()\n    Bug       #1273: fix a bug that app will crash after clicking closed button in TextureCacheTest\n    Bug       #1275: fix memory leaks in tests project\n    Bug       #1277: implement CCToggleVisibility::copyWithZone()\n    Feature   #1114: integrate CCControlExtension and implement corresponding tests\n    Feature   #1180: synchronize CCConfiguration\n    Feature   #1194: merge texturewatcher contributed by NetGragon\n    Feature   #1205: add ccbreader and test case for CocosBuilder\n    Feature   #1240: support TIFF format picture\n    Feature   #1258: merge Rolando's testjs into gles20 branch\n    Refactor  #1156: synchronize CCDirector\n    Refactor  #1166: improve CCString and CCArray, optimize CCDictionary\n    Refactor  #1176: change linebreak symbol to UNIX format ('\\n'), replace 'tab' with four spaces\n    Refactor  #1177: refactor platform\n    Refactor  #1178: use macro NS_CC_BEGIN instead of \"namespace cocos2d {\", NS_CC_END instead of \"}\"\n    Refactor  #1188: refactor directory structure\n    Refactor  #1191: update templates for all platforms\n    Refactor  #1198: optimize CCTextureCache::removeUnusedTextures()\n    Refactor  #1203: remove CCFileUtils::setResource(const char* pszZipFileName) and SimpleAudioEngine::setResource\n    Refactor  #1204: refactor AppDelegate::initInstance()\n    Refactor  #1206: remove some unused files, only supports iOS, win32 and android\n    Refactor  #1211: translate Chinese comments to English for CCTextureWatcher and CCListView\n    Refactor  #1246: fix CCDirector using CCLabelBMFont instead of CCLabelTTF\n    Refactor  #1252: add CCEGLViewProtocol::getFrameSize() method for getting the real screen size of device\n    Refactor  #1253: add static method \"purgeConfiguration\" for CCConfiguration to avoid memory leak\n [iOS]   \n    Bug       #1109: add parentheses to remove Xcode warnings \n    Bug       #1230: fix a bug that Calculation of string width may be wrong on iOS\n    Bug       #1266: fix a bug that CCTextureCahce::addImageAsync() don't work correctly on iOS\n    Feature   #1095: IOS screen resolution support\n [android]\n    Bug       #1139: fix a bug that screen becomes black when backing from background\n    Bug       #1140: fix a bug that ParticleTest crashed\n    Bug       #1141: fix a bug that NodeTest crashed in StressTest1 and StressTest2\n    Bug       #1142: fix a bug that TouchesTest crashed\n    Bug       #1143: fix a bug that MenuTest crashed\n    Bug       #1144: fix a bug that ParallaxTest crashed\n    Bug       #1145: fix a bug that TileMap crashed\n    Bug       #1146: fix a bug that IntervalTest crashed\n    Bug       #1147: fix a bug that ChipmunkAccelTouchTest crashed\n    Bug       #1148: fix a bug that LabelTest crashed\n    Bug       #1149: fix a bug that SpriteTest crashed when go to second test case\n    Bug       #1150: fix a bug that RenderTextureTest crashed at second test case\n    Bug       #1151: fix a bug that Box2DTest crashed\n    Bug       #1152: fix a bug that PerformanceTest crashed at 1, 2, 5 test cases\n    Bug       #1185: fix a bug that when backing to foreground, will lost texture if it uses sprite batch node\n    Bug       #1216: fix JNI memory leaks\n    Bug       #1229: fix a bug that android port can not be compiled on ndk android-8 level\n    Bug       #1236: fix a bug that JniHelper::jstring2string may crash when parameter is null\n    Bug       #1237: fix a bug that line number message printed by CCAssert is wrong\n    Bug       #1279: fix a bug that NodeNonOpaqueTest can't be shown correctly\n    Feature   #1247: add profiler support for android\n    Feature   #1265: build dynamic library of SpiderMonkey for Android, and implement testjs for android\n    Refactor  #1179: popup a message box when invoking CCAssert() on Android\n    Refactor  #1201: simplify the usage of writing Android.mk\n [windows]\n    Bug       #1215: fix a bug that Win32 retina cannot work\n    Bug       #1251: add CocosBuilderTest to the test project for VS2008\n    Bug       #1264: fix wrong string alignment when using utf-8 encoded text with CCLabelTTF\n    Bug       #1268: fix a bug that Testjs will crash after clicking the close button on win32\n    Bug       #1270: fix some warning on win32\n    Feature   #1186: add console window for Win32 application, all debug message output to this console window\n    Feature   #1263: build dynamic library of SpiderMonkey for win32, and add testjs project to solution\n    Refactor  #1170: remove win32 template of wophone\n [lua]\n    Refactor  #1190: update Lua binding to 2.0\n    Refactor  #1220: using CCString::stringWithContentsOfFile to get string from Lua script files\n    \n\ncocos2d-1.0.1-x-0.12.0 @ Mar.5 2012\n [all platforms]\n     Bug      #925: rename HelloWorld/Resource to HelloWorld/Resources\n     Bug      #948: fix a bug that CCMutableArray::getIndexOfObject returns 0 on both \"index 0\" and \"not existing\"\n     Bug      #951: remove definition of NSMutableSet\n     Bug      #961: fix mad behaviour in second stage of CCEaseBackInOut\n     Bug      #965: remove some dynamic_cast calling since selector_protocol.h was removed\n     Bug      #967: fix a bug that PVR Textures cannot be reloaded after GL context lost\n     Bug      #986: add init() funciton in CCMenu class\n     Feature  #952: make CCLabelBMFont supports other languages, include Chinese, Korean, Janpanese and so on.\n     Feature  #972: add Support for CCNotificationCenter\n     Refactor #933: refactor CCUserDefault\n     Refactor #958: move the implement of SelectorProtocol to CCObject\n     Document #975: add comment for CCTMXTiledMap::getMapSize and more methods\n [iOS]\n     Bug      #946: fix a bug that can not load HD image for both Retina and Normal correctly\n     Bug      #762: fix a bug that CCLabelTTF is in different position (higher) than in previous version on iphone\n     Refactor #985: remove template for xcode3\n [android]\n     Bug      #947:  fix a bug that long chinese string causes closed loop on android\n     Bug      #950:  fix a crash when touching the screen because of RTTI\n     Bug      #954:  fix a bug that accelerometer axes inverted on android tablet when setting orientation to portrait\n     Bug      #957:  fix a bug that when running textInputTest, application enters background after input character and click back key on android devices\n     Bug      #959:  fix a bug that get wrong multitouch id\n     Bug      #964:  fix a bug that can not show whole charactor\n     Bug      #971:  fix dynamic_cast error on android\n     Feature  #982:  make android template supports box2d, chipmunk and lua\n     Refactor #970:  use modules in the Android NDK build\n     Bug      #1008: fix a bug that missing \"return\" in SimpleAudioEngine::getEffectsVolume() method on android platform\n [bada]\n     Bug      #984: use static library for cocos2dx project on bada and qnx platform\n [blackberry]\n     Bug      #960: detect when the application goes and return from background in QNX (Black Berry Playbook)\n     Bug      #962: fix some bugs on qnx port\n     Bug      #963: fix a bug that applicationWillEnterForeground will be invoked twice when application is launched\n     Bug      #968: fix a bug about \"Out of bound\" in CCFileUtils::getWriteablePath() for BlackBerry\n     Feature  #994: add support for bbndk2.0\n [marmalade]\n     Bug      #995: modify project configure for marmalade port after adding extension support and refactor resource folder\n [win32]\n     Feature  #969: implement Accelerometer Simulation for Win32.\n [lua]\n     Bug      #942: fix a crash when invoking CCScheduler:sharedScheduler():scheduleScriptFunc in lua\n     Bug      #953: add tolua++ for Mac\n     Refactor #973: refactor Lua support\n\ncocos2d-1.0.1-x-0.11.0 @ Jan.13 2012\n [blackberry] \n     Feature  #907: support blackberry playbook\n [all platforms]\n     Bug      #752: fix a bug that enable and disable touch more times in touch handler callback function may cause memory leak\n     Bug      #911: fix a bug that TextureCache::addUIImage() cannot create texture when key is null\n     Bug      #920: export export functions in CCAffineTransform with CC_DLL\n     Bug      #922: make CCTexture2D::setPVRImagesHavePremultipliedAlpha() to be a static function\n     Bug      #926: fix a crash caused by RTTI when running TouchesTest\n     Bug      #936: fix a bug that touch menu item may crash when selector is null\n     Feature  #892: use RTTI to simplify the codes\n     Feature  #903: add touch index for CCTouch\n     Refactor #934: add 'isEqual' function for CCString, make CCObject::isEqual to a virtual function\n     Refactor #940: use new icons and new background pictures with new logo of cocos2d-x\n [android]\n     Bug      #923: fix a bug that CCTextureCache::addImageAsync() crashes when a game enters foreground from background\n     Bug      #906: remove unneeded codes in CCImage_android.cpp\n     Bug      #910: fix a bug that create-android-project.bat may erase exist folder with appointed name\n     Bug      #884: fix a crash error caused by CocosDenshion on android simulator\n     Bug      #921: fix a bug that accelerometer axes inverted in Motorola Xoom tablet\n     Bug      #928: fix a bug that 16-bit texture is changed to 32-bit after application enter foreground\n     Bug      #935: fix a bug that terminateProcessJNI() invoke wrong jni function\n     Bug      #937: fix a compiling error on android x86\n     Bug      #941: fix a bug that volume of background music may not in [0, 1.0]\n     Feature  #887: define GL_GLEXT_PROTOTYPES = 1 automatically when compile on ndk r7\n     Feature  #919: improve build_native.sh and create-android-project.sh\n     Refactor #924: make loading music resources thread safe\n     Document #837: Write a document describes how to use jni\n     Document #914: update document to fit android r5~r7\n [iOS]\n     Bug      #917: implement CCFileUtils::getFileDataFromZip()\n     Feature  #893: remove cached data when receiving memory warning on iOS\n [bada]\n     Bug      #918: fix a compiling error after renaming airplay to marmalade\n     Bug      #927: fix a crash caused by invoking unloadEffect after invoking stopEffect\n     Bug      #938: fix a bug that glGenFramebuffersOES isn't supported on wave m device\n     Bug      #943: fix a bug that box2d can't be compiled successfully on bada sdk 1.2.1\n     Refactor #904: Recreate bada 2.0 projects\n [win32]\n     Bug      #915: fix a bug that msvc template uses old version of .cpp files\n [linux]\n     Bug      #888: fix compiling error with eclipse\n     Bug      #930: fix a crash caused by load jpg format files\n [marmalade]\n     Refactor #908: merge marmalade to latest cocos2d-x source\n\ncocos2d-1.0.1-x-0.10.0 @ Dec.2 2011\n [bada]\n    Feature  #223  integrate cocos2d-bada branch to master\n    Bug      #852  fix a bug that CCSpriteBatchNode cannot be drawn correctly\n [all platforms]\n    Feature  #854  integrate pthread and write a test case on all platforms\n    Feature  #465  implement CCTextureCache::addImageAsync()\n    Feature  #850  upgrade box2d from 2.1.2 to last 2.2.1\n    Feature  #781  add functions for effects\n    Feature  #760  add methods to get/set CCDirector::m_pNotificationNode\n    Bug      #883  fix the crash of SpriteTest\n    Refactor #879  use CCAssert() instead of assert() \n    Document #882  Write a document describes some cautions about using pthread\n [android]\n    Feature  #838  support android x86 platform\n    Bug      #758  fix a bug that custom TTF fonts causing low memory\n    Bug      #848  fix a bug that accelerometer values are wrong if the content is scaled\n    Bug      #885  fix a bug that SimpleAudioEngine::setEffectVolume() don't take effect immediately\n    Document #864  write a describe how to build on sdk 4.0 & ndk-r7\n    Document #878  write a document describe how to build project for x86 android\n    Document #881  write a document describes building android ndk project with ndk-r7\n [linux]\n    Bug      #780  fix build error on ubuntu 11.0\n    Bug      #776  fix a bug in the audio player\n\ncocos2d-1.0.1-x-0.9.2 @ Oct.20,2011\n [linux]\n    Feature  #728  Linux port is born! http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_HelloWorld_and_tests_on_linux\n [all platforms]\n    Feature  #672  Implements copyWithZone() for CCShow & CCHide\n    Feature  #676  add more languages into CCApplication::getCurrentLanguage()\n    Feature  #678  add private constructor for CCArray\n    Feature  #684  add test case for CCApplication::getCurrentLanguage()\n    Feature  #685  add test case in LabelTest to display Chinese charactors\n    Bug      #675  Fix memory leak in CCLayer when using accelerometer\n    Bug      #686  CCTMXLayer::appendTileForGID() not setting Z index tag causes the first screen of tiles to be re-created\n    Bug      #689  CCRect should assert the width and height is positive\n    Bug      #698  CCSprite::init() is excited twice in all CCSprite's static methods\n    Bug      #700  CC_SWAP32 marco has a typo with leads to error swap result\n    Bug      #701  CCZHeader.version should be unsigned short\n    Bug      #715  CCFadeOut causes a crash when applied to CCMenuItem and m_pSelectedImage is NULL\n    Bug      #718  fix a typo in method CCMenu::alignItemsInRows\n    Bug      #749  CCSpriteTest crashes at the test case SpriteNilTexture\n    Bug      #750  CCTextureCache::textureForKey() can't find textures added by function addUIImage()\n    Refactor #677  Pass arguments by reference instead of pointer if possible\n    Refactor #703  Refactor Accelerometer. Because it only sends data to one delegate, so it needs only one setDelegate()\n    Document #692  Describe the usage of view orientation http://www.cocos2d-x.org/projects/cocos2d-x/wiki/About_device_orientation\n [android]\n    Feature #670  Pause & resume effect playing when activity is paused & resumed\n    Feature #687  Implement preloadBackgroundMusic to android\n    Feature #688  Support reading resources not only from apk\n    Feature #726  use external storage on android\n    Feature #746  add a helper method to draw filled polygons\n    Bug     #683  getPackagenameJNI() and getCurrentLanguageJNI() mustn't return invalid pointer\n    Bug     #696  Some android devices may crash at CCRenderTexture::end(bool)\n    Bug     #719  CocosDenshionTest crashes when start the test case on android\n    Bug     #714  CCLabelTTF has different visual result between Android & Windows\n    Bug     #727  Memory leak of NewStringUTF\n    Bug     #736  Remove android:installLocation in AndroidManifest.xml\n    Bug     #743  nativeInit is called with wrong screen size when running on device with software android buttons\n    Bug     #744  CCUserDefault crashes in v0.9.1\n    Bug     #755  Multi-touch causes crash on sum sung devices\n [ios]\n    Bug     #660  CCLabelBMFont image error in retina display\n    Bug     #693  CCLabelTTF can not break line by '\\n' on iOS\n    Bug     #716  subbing & adding volume of sound effects don't change volume little by little on iOS\n    Bug     #738  Passing CCSize(width,0) to CCLabelTTF causes the label invisible\n    Bug     #753  visual orientation is wrong on ios5 simulator\n    Bug     #754  Missing png file for CCLabelAtlas cause crashes on iOS 4.3.3 & 5.0\n [win32]\n    Feature #731  add ability of simulating android back/menu key on win32  \n    Feature #735  add ability of simulating android enter/resume background on win32. Shift+F1=android Back, Shift+F2 =android Menu\n    Feature #745  export CCTime to all\n    Bug     #747  Win32 templates should put all resources into \"Resources\" folder\n    Bug     #748  build error in win32 release version\n [wophone]\n    Bug     #702  tests crash at the start on wophone devices\n [lua]\n    Feature #704  Print error descriptions ad pop error code in CCLuaScriptModule::executeString & CCLuaScriptModule::executeScriptFile\n    Feature #707  Support 'require' for Lua on android\n    Feature #732  Add particle systems to Lua bindings\n    Feature #733  Use ant to generate a Lua project, refer to http://www.cocos2d-x.org/boards/11/topics/3957\n    Feature #734  Use ant to generate LuaCocos2d.cpp\n    \n\ncocos2d-1.0.1-x-0.9.1 @ Aug.17,2011\n [all platforms]\n    Feature  #347  Support custom TTF fonts\n    Feature  #536  Support PVR Texture\n    Feature  #645  update to cocos2d-iphone v1.0.1\n    Feature  #633  allow SimpleAudioEngine::playEffect repeatly\n    Feature  #630  implement CCRenderTexture::saveBuffer method\n    Feature  #613  Call executeCallFuncN instead of executeCallFunc in CCMenuItem::active()\n    Feature  #620  add Texture2d test case\n    Feature  #638  Add support for per ccz format\n    Feature  #641  users can CCRenderTexture::saveBuffer to any path\n    Feature  #643  swap Accelerometer input x/y according to the orientation\n    Feature  #665  add test case for CCRenderTexture::saveBuffer\n    Bug      #513  CCProgressTimer doesn't work with CCspriteFrameCache\n    Bug      #609  Retain & Release CCObject in CCSet\n    Bug      #628  CCMutableArray::arrayWithObjects should autorelease array object\n    Bug      #629  pass eImgFmt to initWithImageData in initWithImageFile\n    Bug      #636  CCTextureCache::textureForKey() can't find the right texture\n    Bug      #639  m_PositionInPixels isn't correctly initialized\n    Bug      #640  the image read from render texture is upseted\n    Bug      #644  CCSpriteBatchNode::removeAllChildrenWithCleanup() not work as expected\n    Bug      #680  CCtouchDispatcher::rearrangeHandlers() crash\n    Refactor #623  refactor Cocos2dJni.cpp\n    Refactor #652  refactor char* JniHelper::jstringtochar()\n    Document #622  comment CCUserDefault in doxygen format\n    Document #651  add CCFileUtils to oxygen api document\n [lua]\n    Feature  #679  bind Lua to CocosDenshion\n    Feature  #647  add a method to set search path of Lua script\n    Feature  #611  Add some methods in CCMenuItemLabel & CCMenuItemToggle for lua\n    Feature  #612  Export CCNode::getContentSizeInPixels & setContentSizeInPixels to lua\n    Feature  #653  add CCScheduler::unscheduleScriptFunc\n    Bug      #615  CCLOG may crash in LuaEngineImpl\n [android]\n    Feature  #610  Remove the support of ndk-r4 crystax.net version \n    Bug      #608  CCRenderTexture cannot show textures after sleep and wake-up\n    Bug      #618  HelloWorld & Tests crash when X is clicked\n    Bug      #619  CCFadeTo may crash on android\n    Bug      #624  CCLabelTTF::setString(\"\\n\\n\\n\") crashes on android\n    Bug      #625  test_image_rgba4444.pvr.gz can not packed into app\n    Bug      #631  TextInputTest crash when input nothing\n    Bug      #637  Create resources folder instead of resource in create-android-project.sh\n    Bug      #648  CCRenderTexture::saveBuffer may crash on some devices like Moto Defy\n    Bug      #655  CCLabelTTF doesn't draw all characters, it may lost the last char\n    Refactor #656  refactor CCFileUtils, make it support reading data from directory other than assets \n [ios]\n    Feature  #642  CCImage_ios.mm should be modified for saving image\n    Feature  #658  xcode3 template should create AppDelegate.cpp/.h instead of ${PROJECT_NAME}AppDelegate.cpp/.h\n    Feature  #661  fix TMXTiledMap for iPhone Retina mode\n    Bug      #667  AppDelegate::applicationDidEnterBackground isn't invoked on iOS\n    Bug      #668  CCLabelBMFont display 4 characters in a square per character block in retina mode\n [win32]\n    Feature  #620  change Lua library to static lib \n    Feature  #632  Update visual studio template for Lua support\n\n   \ncocos2d-1.0.0-x-0.9.0 @ Jul.14,2011\n [all platforms]\n    Feature  #584  sync with cocos2d-iphone v1.0.0\n    Feature  #601  use Chipmunk v5.3.5\n    Feature  #581  change return types of xxxAction::reverse() to its own type\n    Bug      #522  CCSpriteFrameCache::addSpriteFramesWithFile(const char* pszPlist) crashed if the param have no '/'\n    Bug      #522  CCTextureCache::removeTextureForKey(const char*) cache the image path incorrectly\n    Bug      #573  CCLayerColor does not init its m_tColor, which will result to a random color\n    Bug      #576  some CCMutableDictionary methods must return _KeyT instead of std::string\n    Bug      #577  CCReverseTime may crash\n    Bug      #578  Debian & LavaFlow of ParticleTest have not picture, the effect of ParticleFire is wrong\n    Bug      #580  ShuffleTilesTest of EffectText may crash\n [ios]\n    Bug      #546  CCLabelTTF::labelWithString() works incorrectly when height = 0\n    Bug      #604  test.xcodeproject miss Summary & Info in xcode4 since v0.8.5\n [android]\n    Feature  #547  deal with line wrap of CCLabelTTF::initWithString(...) \n [win32]\n    Bug      #659  ChipmunkTest Sensors crashes in a few seconds\n    Bug      #583  SimpleAudioEngine::playBackgroundMusic(const char*, true) have no sound on win32\n    Bug      #605  export C methods in CCNS.h to dll interfaces\n    Bug      #548  export CCConfiguration to dll interfaces\n [marmalade/airplay]\n    Bug      #600  incorrect memory allocation in marmalade port\n    Refactor #582  use libpng instead of CIwImage in CCImage_airplay.cpp\n [wophone]\n    Bug      #545  fix the wrong effect of ChipmunkTest\n    Bug      #606  PageTransitionForward in TransitionsTest has wrong visual effect\n\n\n\ncocos2d-0.99.5-x-0.8.5 @ Jun.28,2011\n [all platforms]\n    Feature  #577  Lua Support! We export all the cocos2d-x classes & methods to lua! \n                   Please compile and run HelloLua, and read HelloLua/Resource/hello.Lua for more details. \n                   And the Lua new project template/wizard is ready on xcode3, xcode4 and VisualStudio2008 & 2010 \n    Feature  #398  Xcode4 templates! Run install-template-xcode.sh to do the magic\n    Feature  #323  Internationalization support! Add CCApplication::getCurrentLanguage() method on all platforms\n    Feature  #529  add static node() method to CCLayerColor & CCLayerGradient\n    Bug      #534  don't raise compile error if ios project includes CCImage.cpp & CCFileUtils.cpp\n    Bug      #429  Effect is wrong when the value of defaultAlphaPixelFormet=kCCTexture2DPixelFormat_A8 in CCTexture2D\n    Bug      #491  Unsafe cycle in CCScheduler::unscheduleAllSelectors\n    Bug      #502  Refactor the singleton mode of CCConfiguration\n    Bug      #512,#525  fix warnings in /Wall flag\n    Bug      #516  Undefined behavious in ccCArray.h (signed / unsigned conversion)\n    Bug      #518  CCScheduler::unscheduleAllSelectors() uses tHashSelectorEntry in wrong way\n    Bug      #521  the effect of PageTurn3D is curious\n    Bug      #523  CCParticleSystemQuad::particleWithFile() can't work correctly\n    Bug      #524  CCFileUtils::dictionaryWithContentsOfFile() can't parse special plist format\n    Bug      #526  glScissior can't work correctly when use autoscale function\n    Bug      #543  EffectTest renders x4 scale when use auto-scale on android/win32/wophone\n    Bug      #544  some test cases of TransitionTest renders x4 scale when use auto-scale on android/win32/wophone \n [android]\n    Bug      #490  TextInputTest show words on soft keyboard detach instead of each key pressed\n    Bug      #507  RenderTextureTest failed on some android devices\n    Bug      #532  GLSurface has no response when tap screen frequently for a long time\n    Bug      #542  SimpleAudioEngine::setBackgroundMusicVolume() not work when background music changed\n    Refactor #535  remove skia dependence when drawing strings, which cause bug #507\n [ios]\n    Feature  #540  Add RootViewController into xcode3/xcode4 templates. Games can use ios rotation mechanism\n [win32]\n    Feature  #537  Update PVRFrame lib to version 2.8 for ATI graphic card new driver\n [wophone]\n    Bug      #539  games on wophone wva devices probably failed on reading resource from zip package\n\n\n\ncocos2d-0.99.5-x-0.8.4 @ May.26,2011\n [android]\n    Feature  #496  SUPPORT ANDROID 3.0! We test it on both Motorola XOOM & Samsung Galaxy Tab 10.1 (Highlight!!!!!)\n    Bug      #494  typo fixed, Cocos2dxActivity::setPackgeName() to setPackageName()\n    Bug      #495  Memory leak of CCFileUtils::getWriteablePath()\n    Bug      #497  soft keyboard stays shown on some devices while the project includes CCTextFieldTTF\n    Bug      #501  projects creaed by android template have the same package name\n    Bug      #510  Tests progress is killed at the power down phase\n [all platforms]\n    Feature  #503  upgrade chipmunk from 5.1 to 5.3.4, keep sync with cocos2d-iphone (Highlight!)\n    Feature  #509  For integrting IME, we had to rotate UI to landscape by default\n    Bug      #499  CCRGBAProtocol isn't inherited and implemented in CCMenuItemSprite\n [ios]\n    Bug      #493  the return value of CCFileUtils::getWriteablePath() is not end with '/'\n    Bug      #508  Problem in running Tests in Retina resolution since 0.8.2\n [win32]\n    Bug      #492  CCFileUtils::fullPathFromRelativeFile forget to consider the path separated by '\\'\n    Feature  #489  Use GetCurrentDirectory instead of GetModuleFileName in CCFileUtils_win32.cpp\n\n\n\ncocos2d-0.99.5-x-0.8.3 @ May.12,2011\n [all platforms]\n    Feature  #317  wrap input box for game dev, CCTextFieldTTF. (Highlight!)\n    Feature  #455  implement CCUserDefault for data persistence (Highlight!)\n    Feature  #456  integrate libcurl for network access (Highlight!)\n    Feature  #468  implement CCProfiler & CCProfilingTimer\n    Feature  #450  can set default pixel format other than RGBA888\n    Feature  #449  Remove the sources for mac platform. We plan to focus on mobile platforms & reduce the complexity\n    Refactor #451  Remove the event dispatcher and refactor CCLayer & CCMenu & CCParticleSystemPoint.\n    Refactor #452  Refactor CCDirector CCGrid CCNode, reduce the complexity\n    Refactor #472  Refactor duplicated modules under cocos2dx/platform, reduce the complexity\n    Bug      #341  CCTMXFiledMap crashed when a child is not the obj of CCTMXLayer\n    Bug      #371  A layer can't registered as a StandardTouchDelegate when touch event is handling\n    Bug      #428  Function addChild low efficiency\n    Bug      #448  CCCallFuncO crashes\n    Bug      #467  CCLayer:m_eTouchDelegateType = ccTouchDeletateAllBit all the time\n    Bug      #471  invoke CCFileUtils::setResourcePath may cause loading texture for ParticleSystem failed\n    Bug      #484  CCTextureAtlas::initWithTexture() may cause memory leak\n    Bug      #486  transition test FlipX, FlipY, FlipAngular, ZoomFlipXxx flickers on ios simulator & device\n [ios]\n    Bug      #447  really exit application when \"x\" button is clicked\n    Bug      #460  cocos2dx + box2d template cannot find libxml2.dylib\n [android]\n    Feature  #393  use full version of libxml2, with xmlXPath.. serial methods\n    Feature  #477  Set compilation default ndk version to r5\n    Bug      #374  replace the method for EGL rendering context lost\n    Bug      #453  Android Cocosdenshion can't replace background music\n    Bug      #462  no applicationDidEnterBackground / applicationWillEnterBackground on Android\n    Bug      #470  use GAME_ROOT or other words instead of HELLOWORLD_ROOT in anroid new projects\n    Bug      #475  CCImage::initWithString return true even if the bitmap hasn't been initialized\n [win32]\n    Feature  #454  Modify the including path of Box2D genereated by win32 template\n    Bug      #459  the project create by template for vs use the RuntimeLibrary MTd, different with other project\n [wophone] \n    Feature  #482  Modify the resource data path for the new WoPhone SDK\n    Feature  #487  Implement the function CCFiltUtils::getWriteablePath() on wophone\n    Refactor #466  Refactor CCFileUtils for the new packing approach on wophone\n    Bug      #481  After power down & up, backlight will turn off automaticlly if there's no operation\n    Bug      #485  reduce the CPU occupation, modify the approach of FPS control on wophone\n [airplay]\n    Feature  #480  add template for airplay\n\n\n\ncocos2d-0.99.5-x-0.8.2 @ Apr.7,2011\n [all platforms]\n    390    Feature    Implement performance test\n    411    Feature    support .plist format outputed by the last version of Zwoptex \n    415    Feature    Make all xxxFromFile methods can accept relative path\n    439    Feature    all file reading must pass though CCFileUtils::getFileData\n    441    Feature    Initialize pointers in construction & detect them in destruction\n    427    Refactor   refactor CCTMXXMLParser with multi-platform CCSAXParser design\n    434    Refactor   refactor class CCFileUtils\n    396    Refactor   remove ccxScopedPtr & ccxScopedArray, use STL instead\n    350    Bug        TransitionFade flickers\n    391    Bug        CCSpriteFrameCache doesn't support .plist files which format isn't equal to 0\n    420    Bug        CCSprite::spriteWithFile() returns a valid object when the image file isn't present\n    440    Bug        Can't show MessageBox when imageFromFile can't find the image\n [ios]\n    349    Bug        deal with plist files in binary format\n    435    Bug        CocosDenshion crashes at foreground/background switching\n    438    Bug        MotionStreak Test crashes on device\n [android]\n    421    Feature    Add a template & new project script for android\n    443    Feature    implement CCKeypadDelegate on android\n    367    Bug        Android.mk of HelloWorld and Tests depends on alphabet order\n    422    Bug        the 2nd point in multi-touch isn't located to the correct coordinate\n    430    Bug        replace glColor4ub with glColor4f to avoid \"called unimplement OpenGL ES API\" on some android devices\n    431    Bug        ParticleFlower on G3 can't show the particles correctly\n [win32]\n    417    Bug        No touchEnd when the mouse move out from the window\n    424    Bug        open vs2010.sln says cannot open CCamera.cpp\n [airplay]\n    379    Feature    integrate airplay sdk port\n    442    feature    implement CocosDenshion on airplay port\n\t\n\t\n\t\ncocos2d-0.99.5-x-0.8.1 @ Mar.21,2011\n [all platforms]\n    400    Bug        typo, rename CCamera.cpp to CCCamera\n    403    Feature    rename cocos2d::UIEvent to cocos2d::CCEvent, to avoid class name conflict on ios\n    405\t   Bug        CCConfiguration::checkForGLExtension(const string&) sometimes may crashes\n    407    Bug        replace \"CCGL.h\" with \"CCGL.h\" in CCCamera.cpp, for case-sensitive systems\n    408    Bug        memory leak in CCImage::_initWithPngData\n    409    Feature    rename cocos2d::NSArray to cocos2d::CCArray, to avoid the conflict on ios\n    418    Feature    add copyright of cocos2d-iphone original authors to each file\n    423    Bug        fix compilation warnings when COCOS2D_DEBUG == 2\n [ios]\n    404    Bug        HiResTest isnot prerfect on HVGA/Retina yet\n    410    Bug        xcode3 template, cannot find libxml from header searh paths in release build\n    419    Bug        test case TMXIsoVertexZ in TileMapTst has wrong effect on ios\n [android]\n    399    Bug        HelloWorld crashes when the screen is touched\n    405    Bug        CocosDenshion test, BGM isn't paused after HOME key tapped\n [win32]\n    395    Bug        make AppDelegate.cpp created by VS wizard portable without any modification\n    401    Bug        VisualStudio template for 2010 OutputDir errors\n\n\n\ncocos2d-0.99.5-x-0.8.0 @ Mar.15,2011\n [all platforms]\n    316    Feature    Resolution auto adjustment, auto scale HVGA resource to WVGA or any other resolutions\n    336    Refactor   refactor platform porting layer\n    253    Bug        xml parser sometimes crashes\n    375    Feature    Rename NS,CG,UI prefix classes/definitions to CC prefix, avoid the crash at ios dev\n    332    Feature    upgrade tests from 0.99.4 to 0.99.5\n [ios]\n    363    Bug        CCLabelTTF can't treat line breaks and wrapping correctly.\n    351    Feature    CCLabelTTF cannot automatic line break on iphone\n    352    Bug        ccRemoveHDSuffixFromFile & CCFileUtils::getDoubleResolutionImage isnot work\n    392    Bug        border of sprite debug draw isn't scaled if enableRetinaDisplay(true)\n    385    Feature    implement ccos2d::CCLog\n    388    Feature    update the template for iOS\n [android]\n    247    Feature    support multitouch\n    242    Feature    support accelerometer on android\n    353    Feature    support jpg on android\n    344    Feature    add APP_ABI := armeabi armeabi-v7a to improve the performance on some devices\n    356    Bug        CCLabelTTF::initWithString crashed\n [wophone]\n    386    Bug        resolve the compile conflict on wophone sdk\n    383    Bug        The approach which handle left soft-key clicked is not work\n    377    Feature    Replace the word \"uphone\" with \"wophone\"\n    357    Bug        CCLabelTTF doesn't support words contain line breaks.\n    348    Bug        CCLabelTTF blur if color = white and fontSize < 24\n [win32]\n    373    Feature    Disable PVRFrame window when cocos2d running\n    355    Bug        CCLabelTTF doesn't support line breaks and wrapping words\n    300    Feature    wizard for Visual C++ 2008 Express & VS2010 Express/Professional\n\t\n\n\ncocos2d-0.99.5-x-0.7.2 @ Jan.26,2011\n [all platforms]\n    - upgrade engine logic internal & interfaces to 0.99.5\n    - the list of menu items in tests is showing how to scroll now\n    - lots of bugs fixed\n [iphone]\n    - add new project templates for Xcode\n    - add the c++ wrapper for CocosDenshion::SimpleAudioEngine\n    - support UTF8 charactors in text renderring, such as CCLabelTTF, CCMenuItemFont\n [android]\n    - add CocosDenshion::SimpleAudioEngine implement on android\n    - the engine can adjust the apk filename automatically\n    - the engine will not crash at surface recreate, especially at background-to-foreground switching\n [wophone]\n    - switch the game to background, then press power key will not cause the background music play again\n    - remove the methods of using resouce map in cocos2d-wophone & SimpleAudioEngine. \n      Only zip resource is recommended and suppported.\n    - can auto find the installed path of your game, and load zip resource file from the current folder. \n      No absolute path in code any more. Do this to support installing games to micro-SD card\n      \n      \n\ncocos2d-0.99.4-x-0.7.1 @ Dec.20,2010\n [all platforms]\n    - add CCKeypadDelegate class, which enable CCLayer to respond \"back\" key in wophone & android\n    - Add namespace for CocosDenshion\n    - fix compile errors when enable CC_XXX_DEBUG_DRAW switchs in ccConfig.h\n    - fix memory leaks on each platform\n    - more details: http://www.cocos2d-x.org/versions/show/5\n [android] \n    - Run through all the test cases of cocos2d, support ndk r4,r5, sdk higher than 2.0. Tested on HTC G2,G3,G6,G7\n    - HelloWorld integrate all platforms in one directory now\n    - WANRNING: this version isn't ready for android games porting yet. The CocosDenshion isn't ported to android,\n      and this version will crashes when screen orientation changes or the game gack to foreground \n      look more on this bug http://www.cocos2d-x.org/boards/10/topics/202\n [iphone]  \n    - Add support of loading textureImageData from the ParticleDesign plist file\n    - Fix more then 3000 complie warnings\n    - You can try to use this version to develop your iOS game now. It's much more stable than the previous version\n [wophone]  \n    - Games can easily read resources from zip file now. This will drastically reduce the memory usage\n    - Add power management: pause the message loop when cocos2d-x game is switched to background or backlight down\n    - Multi-touch support\n [win32]\n    - SimpleAudioEngine can play background musci with repeating now\n  \n\n\ncocos2d-0.99.4-x-0.7.0 @ Nov.29,2010\n* cocos2d-iphone-cpp port ready! include accelerometer & multi-touch\n* refactor the directory structure of HelloWorld & tests\n* cocos2d-wophone supports accelerometer\n* add cocos2d-x wizard for cocos2d-win32 & cocos2d-wophone for VisualStudio2008\n* jump out a message box when load texture failed (win32 & wophone)\n* more details: \thttp://www.cocos2d-x.org/versions/show/4\n\ncocos2d-0.99.4-wophone-win32-stable-rc1\n\thttp://www.cocos2d-x.org/versions/show/1\n\thttp://www.cocos2d-x.org/versions/show/2\n\thttp://www.cocos2d-x.org/versions/show/3\n\n\n"
  },
  {
    "path": "cocos2d/CMakeLists.txt",
    "content": "#/****************************************************************************\n# Copyright (c) 2013 cocos2d-x.org\n# Copyright (c) 2012-2013 martell malone\n# \n# http://www.cocos2d-x.org\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n# ****************************************************************************/\n\ncmake_minimum_required(VERSION 2.8)\nproject (Cocos2dx)\n\n# The version number\nset(Cocos2dxSamples_VERSION_MAJOR 3)\nset(Cocos2dxSamples_VERSION_MINOR 0)\n\ninclude(build/BuildHelpers.CMakeLists.txt)\n\nif(WIN32 OR APPLE)\n\noption(USE_CHIPMUNK \"Use chipmunk for physics library\" ON)\noption(USE_BOX2D \"Use box2d for physics library\" OFF)\noption(DEBUG_MODE \"Debug or release?\" ON)\noption(BUILD_LIBS_LUA \"Build lua libraries\" OFF)\noption(BUILD_GUI \"Build GUI library\" ON)\noption(BUILD_NETWORK \"Build network library\" ON)\noption(BUILD_EXTENSIONS \"Build extension library\" ON)\noption(BUILD_EDITOR_SPINE \"Build editor support for spine\" ON)\noption(BUILD_EDITOR_COCOSTUDIO \"Build editor support for cocostudio\" ON)\noption(BUILD_EDITOR_COCOSBUILDER \"Build editor support for cocosbuilder\" ON)\n\noption(BUILD_HelloCpp \"Only build HelloCpp sample\" ON)\noption(BUILD_TestCpp \"Only build TestCpp sample\" ON)\noption(BUILD_HelloLua \"Only build HelloLua sample\" OFF)\noption(BUILD_TestLua \"Only build TestLua sample\" OFF)\n\nelse()#temp\n\noption(USE_CHIPMUNK \"Use chipmunk for physics library\" ON)\noption(USE_BOX2D \"Use box2d for physics library\" OFF)\noption(DEBUG_MODE \"Debug or release?\" ON)\noption(BUILD_LIBS_LUA \"Build lua libraries\" ON)\noption(BUILD_GUI \"Build GUI library\" ON)\noption(BUILD_NETWORK \"Build network library\" ON)\noption(BUILD_EXTENSIONS \"Build extension library\" ON)\noption(BUILD_EDITOR_SPINE \"Build editor support for spine\" ON)\noption(BUILD_EDITOR_COCOSTUDIO \"Build editor support for cocostudio\" ON)\noption(BUILD_EDITOR_COCOSBUILDER \"Build editor support for cocosbuilder\" ON)\n\n\noption(BUILD_HelloCpp \"Only build HelloCpp sample\" ON)\noption(BUILD_TestCpp \"Only build TestCpp sample\" ON)\noption(BUILD_HelloLua \"Only build HelloLua sample\" ON)\noption(BUILD_TestLua \"Only build TestLua sample\" ON)\n\nendif()#temp\n\n\nif(DEBUG_MODE)\n  set(CMAKE_BUILD_TYPE DEBUG)\nelse(DEBUG_MODE)\n  set(CMAKE_BUILD_TYPE RELEASE)\nendif(DEBUG_MODE)\n\nset(CMAKE_C_FLAGS_DEBUG \"-DCOCOS2D_DEBUG=1\")\nset(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})\n\nif(WIN32)\n  ADD_DEFINITIONS (-D_USRDLL -DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32)\n\n  if(MSVC)\n    ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS \n\t\t\t\t\t-D_SCL_SECURE_NO_WARNINGS \n\t\t\t\t\t-wd4251 -wd4244 -wd4334 \n\t\t\t\t\t-wd4005 -wd4820 -wd4710\n\t\t\t\t\t-wd4514 -wd4056 -wd4996 -wd4099)\n  else(MSVC)#MINGW\n  \n  endif(MSVC)\nelseif(APPLE)\n\n\nelse()#Linux\nADD_DEFINITIONS(-DLINUX)\nendif()\n\n\nif(NOT MSVC)# all gcc\nset(CMAKE_C_FLAGS_DEBUG \"-g -Wall -DCOCOS2D_DEBUG=1\")\nset(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})\nset(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} \"-std=c99\")\nset(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} \"-std=c++11\")\nendif()\n\nif(MINGW)\n  add_definitions(-DGLEW_STATIC)\nendif()\n\n\nif(USE_CHIPMUNK)\n  message(\"Using chipmunk ...\")\n  add_definitions(-DCC_ENABLE_CHIPMUNK_INTEGRATION=1)\nelseif(USE_BOX2D)\n  message(\"Using box2d ...\")\n  add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=1)\nelse(USE_CHIPMUNK)\n  message(FATAL_ERROR \"Must choose a physics library.\")\nendif(USE_CHIPMUNK)\n\n# architecture\nif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )\nset(ARCH_DIR \"64-bit\")\nelse()\nset(ARCH_DIR \"32-bit\")\nendif()\n\nif(WIN32) # Win32\n  set(PLATFORM_FOLDER win32)\nelseif(APPLE)# osx or ios\n  set(PLATFORM_FOLDER mac)\nelse() # Assume Linux\n  set(PLATFORM_FOLDER linux)\nendif()\n\ninclude_directories(\n  ${CMAKE_CURRENT_SOURCE_DIR}\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/audio/include\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/2d\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/2d/renderer\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/2d/platform\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/base\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/physics\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/editor-support\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/math/kazmath/include\n  ${CMAKE_CURRENT_SOURCE_DIR}/extensions\n  ${CMAKE_CURRENT_SOURCE_DIR}/external\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/tinyxml2\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/unzip\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/edtaa3func\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/chipmunk/include/chipmunk\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/2d/platform/desktop\n  ${CMAKE_CURRENT_SOURCE_DIR}/cocos/2d/platform/${PLATFORM_FOLDER}\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/jpeg/include/${PLATFORM_FOLDER}\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/png/include/${PLATFORM_FOLDER}\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/tiff/include/${PLATFORM_FOLDER}\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/webp/include/${PLATFORM_FOLDER}\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/glfw3/include/${PLATFORM_FOLDER}\n  ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype2/include/${PLATFORM_FOLDER}\n)\n\nif(WIN32)\n  include_directories(\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/gles/include/OGLES\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/icon/include\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/zlib/include\n    external/curl/include/${PLATFORM_FOLDER}\n  )\nelseif(APPLE)\n  include_directories(\n  \t${CMAKE_CURRENT_SOURCE_DIR}/external/curl/include/${PLATFORM_FOLDER}\n  )\nelse()\n  include_directories(\n    /usr/include\n    /usr/local/include/GLFW\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/fmod/include/${ARCH_DIR}\n  )\nendif()\n\n\nif(WIN32)\n\n  if(NOT MINGW)\n  link_directories(\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/jpeg/prebuilt/${PLATFORM_FOLDER}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/tiff/prebuilt/${PLATFORM_FOLDER}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/png/prebuilt/${PLATFORM_FOLDER}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype2/prebuilt/${PLATFORM_FOLDER}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/curl/prebuilt/${PLATFORM_FOLDER}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/icon/prebuilt\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/zlib/prebuilt\n  )\n  endif()\n\nelseif(APPLE)\n\nelse()\n\n  link_directories(\n    /usr/local/lib\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/jpeg/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/tiff/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/webp/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/png/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype2/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR}\n    ${CMAKE_CURRENT_SOURCE_DIR}/external/${PLATFORM_FOLDER}-specific/fmod/prebuilt/${ARCH_DIR}\n  )\n\nendif()\n\n\n# kazmath\nadd_subdirectory(cocos/math/kazmath)\n\n# chipmunk library\nadd_subdirectory(external/chipmunk/src)\n\n# box2d library\nadd_subdirectory(external/Box2D)\n\n# unzip library\nadd_subdirectory(external/unzip)\n\n# tinyxml2 library\nadd_subdirectory(external/tinyxml2)\n\n# audio\nadd_subdirectory(cocos/audio)\n\n# cocos base library\nadd_subdirectory(cocos/base)\n\n# cocos 2d library\nadd_subdirectory(cocos/2d)\n\nif(BUILD_GUI)\n# gui\nadd_subdirectory(cocos/gui)\nendif(BUILD_GUI)\n\nif(BUILD_NETWORK)\n# network\nadd_subdirectory(cocos/network)\nendif(BUILD_NETWORK)\n\nif(BUILD_EXTENSIONS)\n# extensions\nadd_subdirectory(extensions)\nendif(BUILD_EXTENSIONS)\n\n## Editor Support\n\nif(BUILD_EDITOR_SPINE)\n# spine\nadd_subdirectory(cocos/editor-support/spine)\nendif(BUILD_EDITOR_SPINE)\n\nif(BUILD_EDITOR_COCOSBUILDER)\n# cocosbuilder\nadd_subdirectory(cocos/editor-support/cocosbuilder)\nendif(BUILD_EDITOR_COCOSBUILDER)\n\nif(BUILD_EDITOR_COCOSTUDIO)\n# cocostudio\nadd_subdirectory(cocos/editor-support/cocostudio)\nendif(BUILD_EDITOR_COCOSTUDIO)\n\nif(BUILD_LIBS_LUA)\n## Scripting\n# lua\nadd_subdirectory(external/lua/lua)\n\n# tolua\nadd_subdirectory(external/lua/tolua)\n\n# luabinding\nadd_subdirectory(cocos/scripting)\nendif(BUILD_LIBS_LUA)\n\n# build samples\nif(BUILD_HelloCpp)\nadd_subdirectory(samples/Cpp/HelloCpp)\nendif(BUILD_HelloCpp)\n\nif(BUILD_TestCpp)\nadd_subdirectory(samples/Cpp/TestCpp)\nendif(BUILD_TestCpp)\n\nif(BUILD_HelloLua)\nadd_subdirectory(samples/Lua/HelloLua)\nendif(BUILD_HelloLua)\n\nif(BUILD_TestLua)\nadd_subdirectory(samples/Lua/TestLua)\nendif(BUILD_TestLua)\n\n"
  },
  {
    "path": "cocos2d/README.md",
    "content": "<img src=\"http://www.cocos2d-x.org/attachments/801/cocos2dx_portrait.png\" width=200>\n\n\ncocos2d-x\n=========\n\n[![Build Status](https://travis-ci.org/cocos2d/cocos2d-x.png?branch=master)](https://travis-ci.org/cocos2d/cocos2d-x)\n\n[cocos2d-x][1] is a multi-platform framework for building 2d games, interactive books, demos and other graphical applications.\nIt is based on [cocos2d-iphone][2], but instead of using Objective-C, it uses C++.\nIt works on iOS, Android, OS X, Windows, Linux, Emscripten, Google Native Client, BlackBerry and Tizen.\n\ncocos2d-x is:\n\n  * Fast\n  * Free\n  * Easy to use\n  * Community Supported\n\n\n\nHow to start a new game\n-----------------------\n\n1. Download the code from [cocos2d download site][4]\n2. Enter `tools/project-creator`\n3. Run the `create_project.py` script\n\nExample:\n\n    $ cd cocos2d-x/tools/project-creator\n    $ ./create_project.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame\n    $ cd /home/mygame\n\n### Build new project for android ###\n\n    $ cd proj.android\n    $ ./build_native.py\n\n### Build new project for ios & osx ###\n\n* Enter *proj.ios_mac* folder, open *mygame.xcodeproj*\n* Select ios or osx targets in scheme toolbar\n\n### Build new project for linux ###\n\nif you never run cocos2d-x on linux, you need to install all dependences by the\nscript in **cocos2d/build/install-deps-linux.sh**\n\n    $ cd cocos2d/build\n    $ ./install-deps-linux.sh\n    $ ../..\n\nThen\n\n    $ mkdir build\n    $ cd build\n    $ cmake ..\n    $ make -j4\n    \nRun\n\n    $ bin/mygame\n\n### Build new project for win32 ###\n\n* Enter *proj.win32*, open *mygame.sln* by vs2012\n\n\nMain features\n-------------\n   * Scene management (workflow)\n   * Transitions between scenes\n   * Sprites and Sprite Sheets\n   * Effects: Lens, Ripple, Waves, Liquid, etc.\n   * Actions (behaviours):\n     * Trasformation Actions: Move, Rotate, Scale, Fade, Tint, etc.\n     * Composable actions: Sequence, Spawn, Repeat, Reverse\n     * Ease Actions: Exp, Sin, Cubic, Elastic, etc.\n     * Misc actions: CallFunc, OrbitCamera, Follow, Tween\n   * Basic menus and buttons\n   * Integrated with physics engines: [Box2d][5] and [Chipmunk][6]\n   * Particle system\n   * Skeleton Animations: [Spine][7] and Armature support\n   * Fonts:\n     * Fast font rendering using Fixed and Variable width fonts\n     * Support for .ttf fonts\n   * Tile Map support: Orthogonal, Isometric and Hexagonal\n   * Parallax scrolling\n   * Motion Streak\n   * Render To Texture\n   * Touch/Accelerometer on mobile devices\n   * Touch/Mouse/Keyboard on desktop\n   * Sound Engine support (CocosDenshion library) based on OpenAL\n   * Integrated Slow motion/Fast forward\n   * Fast and compressed textures: PVR compressed and uncompressed textures, ETC1 compressed textures, and more\n   * Resolution Independence\n   * Language: C++, with Lua and JavaScript bindings\n   * Open Source Commercial Friendly: Compatible with open and closed source projects\n   * OpenGL ES 2.0 (mobile) / OpenGL 2.1 (desktop) based\n\nBuild Requirements\n------------------\n\n* Mac OS X 10.7+, Xcode 4.6+\n* or Ubuntu 12.10+, CMake 2.6+\n* or Windows 7+, VS 2012+\n\n\nRuntime Requirements\n--------------------\n  * iOS 5.0+ for iPhone / iPad games\n  * Android 2.3+ for Android games\n  * OS X v10.6+ for Mac games\n  * Windows 7+ for Win games\n\n\nRunning Tests\n--------------------\n\nSelect the test you want from Xcode Scheme chooser.\n\n* For OS X / iOS\n\n```\n$ cd cocos2d-x/build\n$ open samples.xcodeproj\n```\n\n* For Linux\n\n```\n$ cd cocos2d-x/build\n$ ./install-deps-linux.sh\n$ cmake ..\n$ make\n```\n\nRun Samples\n\n```\n$ bin/hellocpp/hellocpp\nor\n$ bin/testlua/testlua\n```\n\n      You may meet building errors when building libGLFW.so. It is because libGL.so directs to an error target,\n      you should make it to direct to a correct one. `install-deps-linux.sh` only has to be run once.\n\n* For Windows\n\nOpen the `cocos2d-x/build/cocos2d-win32.vc2012.sln`\n\n* For Android\n\n```\n$ cd cocos2d-x/build\n$ python ./android-build.py hellocpp\n```\n\nImport HelloCpp Android project using Eclipse(released with Android SDK). The path to be imported is `cocos2d-x/samples/Cpp/HelloCpp/proj.android`.\n\n\nContributing to the Project\n--------------------------------\n\nDid you find a bug? Do you have feature request? Do you want to merge a feature?\n\n  * [contributing to cocos2d-x][8]\n\n\nContact us\n----------\n\n   * Forum: [http://forum.cocos2d-x.org][9]\n   * Twitter: [http://www.twitter.com/cocos2dx][10]\n   * Weibo: [http://t.sina.com.cn/cocos2dx][11]\n   * IRC: [https://webchat.freenode.net/][12] (#cocos2d and #cocos2d-x channels)\n\n[1]: http://www.cocos2d-x.org \"cocos2d-x\"\n[2]: http://www.cocos2d-iphone.org \"cocos2d for iPhone\"\n[3]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Download\n[4]: http://www.cocos2d-x.org/download/version#Cocos2d-x\n[5]: http://www.box2d.org \"Box2D\"\n[6]: http://www.chipmunk-physics.net \"Chipmunk2D\"\n[7]: http://esotericsoftware.com/ \"http://esotericsoftware.com/\"\n[8]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Contribution\n[9]: http://forum.cocos2d-x.org \"http://forum.cocos2d-x.org\"\n[10]: http://www.twitter.com/cocos2dx \"http://www.twitter.com/cocos2dx\"\n[11]: http://t.sina.com.cn/cocos2dx \"http://t.sina.com.cn/cocos2dx\"\n[12]: https://webchat.freenode.net/ \"https://webchat.freenode.net/\"\n"
  },
  {
    "path": "cocos2d/build/BuildHelpers.CMakeLists.txt",
    "content": "macro(pre_build TARGET_NAME)\n  add_custom_target( ${TARGET_NAME}_PRE_BUILD ALL )\n\n  add_custom_command(\n    TARGET ${TARGET_NAME}_PRE_BUILD\n    ${ARGN}\n    PRE_BUILD\n    COMMENT \"${TARGET_NAME}_PRE_BUILD ...\"\n    )\n\n  add_custom_target( ${TARGET_NAME}_CORE_PRE_BUILD )\n  add_dependencies( ${TARGET_NAME}_PRE_BUILD ${TARGET_NAME}_CORE_PRE_BUILD )\nendmacro()\n"
  },
  {
    "path": "cocos2d/build/android-build.py",
    "content": "#!/usr/bin/python\n# android-build.py\n# Build android samples\n\nimport sys\nimport os, os.path\nimport shutil\nfrom optparse import OptionParser\n\nCPP_SAMPLES = ['hellocpp', 'testcpp', 'simplegame', 'assetsmanager']\nLUA_SAMPLES = ['hellolua', 'testlua']\nJSB_SAMPLES = ['cocosdragon', 'crystalcraze', 'moonwarriors', 'testjavascript', 'watermelonwithme']\nALL_SAMPLES = CPP_SAMPLES + LUA_SAMPLES + JSB_SAMPLES\n\ndef get_num_of_cpu():\n\t''' The build process can be accelerated by running multiple concurrent job processes using the -j-option.\n\t'''\n\ttry:\n\t\tplatform = sys.platform\n\t\tif platform == 'win32':\n\t\t\tif 'NUMBER_OF_PROCESSORS' in os.environ:\n\t\t\t\treturn int(os.environ['NUMBER_OF_PROCESSORS'])\n\t\t\telse:\n\t\t\t\treturn 1\n\t\telse:\n\t\t\tfrom numpy.distutils import cpuinfo\n\t\t\treturn cpuinfo.cpu._getNCPUs()\n\texcept Exception:\n\t\tprint \"Can't know cpuinfo, use default 1 cpu\"\n\t\treturn 1\n\ndef check_environment_variables():\n    ''' Checking the environment NDK_ROOT, which will be used for building\n    '''\n\n    try:\n        NDK_ROOT = os.environ['NDK_ROOT']\n    except Exception:\n        print \"NDK_ROOT not defined. Please define NDK_ROOT in your environment\"\n        sys.exit(1)\n\n    return NDK_ROOT\n    \ndef check_environment_variables_sdk():\n    ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building\n    '''\n\n    try:\n        SDK_ROOT = os.environ['ANDROID_SDK_ROOT']\n    except Exception:\n        print \"ANDROID_SDK_ROOT not defined. Please define ANDROID_SDK_ROOT in your environment\"\n        sys.exit(1)\n\n    return SDK_ROOT\n\ndef select_toolchain_version():\n    '''Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select gcc4.7 when\n    using ndk-r8e. But gcc4.7 is removed in ndk-r9, so we should determine whether gcc4.7 exist.\n    Conclution:\n    ndk-r8e  -> use gcc4.7\n    ndk-r9   -> use gcc4.8\n    '''\n\n    ndk_root = check_environment_variables()\n    if os.path.isdir(os.path.join(ndk_root,\"toolchains/arm-linux-androideabi-4.8\")):\n        os.environ['NDK_TOOLCHAIN_VERSION'] = '4.8'\n        print \"The Selected NDK toolchain version was 4.8 !\"\n    elif os.path.isdir(os.path.join(ndk_root,\"toolchains/arm-linux-androideabi-4.7\")):\n        os.environ['NDK_TOOLCHAIN_VERSION'] = '4.7'\n        print \"The Selected NDK toolchain version was 4.7 !\"\n    else:\n        print \"Couldn't find the gcc toolchain.\"\n        exit(1)\n\ndef caculate_built_samples(args):\n    ''' Compute the sampels to be built\n    'cpp' for short of all cpp samples\n    'lua' for short of all lua smpleas\n    'jsb' for short of all javascript samples\n    '''\n\n    if 'all' in args:\n        return ALL_SAMPLES\n\n    targets = []\n    if 'cpp' in args:\n        targets += CPP_SAMPLES\n        args.remove('cpp')\n    if 'lua' in args:\n        targets += LUA_SAMPLES\n        args.remove('lua')\n    if 'jsb' in args:\n        targets += JSB_SAMPLES\n        args.remove('jsb')\n\n    targets += args\n\n    # remove duplicate elements, for example\n    # python android-build.py cpp hellocpp\n    targets = set(targets)\n    return list(targets)\n\ndef do_build(cocos_root, ndk_root, app_android_root, ndk_build_param,sdk_root,android_platform,build_mode):\n\n    ndk_path = os.path.join(ndk_root, \"ndk-build\")\n\n    # windows should use \";\" to seperate module paths\n    platform = sys.platform\n    if platform == 'win32':\n        ndk_module_path = 'NDK_MODULE_PATH=%s;%s/external;%s/cocos' % (cocos_root, cocos_root, cocos_root)\n    else:\n        ndk_module_path = 'NDK_MODULE_PATH=%s:%s/external:%s/cocos' % (cocos_root, cocos_root, cocos_root)\n\n    num_of_cpu = get_num_of_cpu()\n    if ndk_build_param == None:\n        command = '%s -j%d -C %s %s' % (ndk_path, num_of_cpu, app_android_root, ndk_module_path)\n    else:\n        command = '%s -j%d -C %s %s %s' % (ndk_path, num_of_cpu, app_android_root, ndk_build_param, ndk_module_path)\n    print command\n    if os.system(command) != 0:\n        raise Exception(\"Build dynamic library for project [ \" + app_android_root + \" ] fails!\")\n    elif android_platform is not None:\n    \t  sdk_tool_path = os.path.join(sdk_root, \"tools/android\")\n    \t  cocoslib_path = os.path.join(cocos_root, \"cocos/2d/platform/android/java\")\n    \t  command = '%s update lib-project -t %s -p %s' % (sdk_tool_path,android_platform,cocoslib_path) \n    \t  if os.system(command) != 0:\n    \t  \t  raise Exception(\"update cocos lib-project [ \" + cocoslib_path + \" ] fails!\")  \t  \n    \t  command = '%s update project -t %s -p %s -s' % (sdk_tool_path,android_platform,app_android_root)\n    \t  if os.system(command) != 0:\n    \t  \t  raise Exception(\"update project [ \" + app_android_root + \" ] fails!\")    \t  \t  \n    \t  buildfile_path = os.path.join(app_android_root, \"build.xml\")\n    \t  command = 'ant clean %s -f %s -Dsdk.dir=%s' % (build_mode,buildfile_path,sdk_root)\n    \t  os.system(command)\n\ndef copy_files(src, dst):\n\n    for item in os.listdir(src):\n        path = os.path.join(src, item)\n        # Android can not package the file that ends with \".gz\"\n        if not item.startswith('.') and not item.endswith('.gz') and os.path.isfile(path):\n            shutil.copy(path, dst)\n        if os.path.isdir(path):\n            new_dst = os.path.join(dst, item)\n            os.mkdir(new_dst)\n            copy_files(path, new_dst)\n\ndef copy_resources(target, app_android_root):\n\n    # remove app_android_root/assets if it exists\n    assets_dir = os.path.join(app_android_root, \"assets\")\n    if os.path.isdir(assets_dir):\n        shutil.rmtree(assets_dir)\n\n    # copy resources(cpp samples and lua samples)\n    os.mkdir(assets_dir)\n    resources_dir = os.path.join(app_android_root, \"../Resources\")\n    if os.path.isdir(resources_dir):\n        copy_files(resources_dir, assets_dir)\n\n    # jsb samples should copy javascript files and resources(shared with cocos2d-html5)\n    if target in JSB_SAMPLES:\n        resources_dir = os.path.join(app_android_root, \"../../../../cocos/scripting/javascript/script\")\n        copy_files(resources_dir, assets_dir)\n\n        if target == \"cocosdragon\":\n            resources_dir = os.path.join(app_android_root, \"../../Shared/games/CocosDragonJS/Published files Android\")\n        if target == \"crystalcraze\":\n            resources_dir = os.path.join(app_android_root, \"../../Shared/games/CrystalCraze/Published-Android\")\n        if target == \"testjavascript\":\n            resources_dir = os.path.join(app_android_root, \"../../Shared/tests/\")\n        if target == \"watermelonwithme\":\n            resources_dir = os.path.join(app_android_root, \"../../Shared/games/WatermelonWithMe\")\n        if target != \"moonwarriors\":\n            copy_files(resources_dir, assets_dir)\n        else:\n        \t  resources_dir = os.path.join(app_android_root, \"../../Shared/games/MoonWarriors/res\")\n        \t  dst_dir = os.path.join(assets_dir, \"res\")\n        \t  os.mkdir(dst_dir)\n        \t  copy_files(resources_dir, dst_dir)\n        \t  resources_dir = os.path.join(app_android_root, \"../../Shared/games/MoonWarriors/src\")\n        \t  dst_dir = os.path.join(assets_dir, \"src\")\n        \t  os.mkdir(dst_dir)\n        \t  copy_files(resources_dir, dst_dir)\n        \t  resources_dir = os.path.join(app_android_root, \"../../Shared/games/MoonWarriors\")\n        \t  for item in os.listdir(resources_dir):\n        \t  \t  path = os.path.join(resources_dir, item)\n        \t  \t  if item.endswith('.js') and os.path.isfile(path):\n        \t  \t  \t  shutil.copy(path, assets_dir)\n\n    # AssetsManager test should also copy javascript files\n    if target == \"assetsmanager\":\n        resources_dir = os.path.join(app_android_root, \"../../../../cocos/scripting/javascript/script\")\n        copy_files(resources_dir, assets_dir)\n\n    # lua samples should copy lua script\n    if target in LUA_SAMPLES:\n        resources_dir = os.path.join(app_android_root, \"../../../../cocos/scripting/lua/script\")\n        copy_files(resources_dir, assets_dir)\n\n        # TestLua shared resources with TestCpp\n        if target == \"testlua\":\n            resources_dir = os.path.join(app_android_root, \"../../../Cpp/TestCpp/Resources\")\n            copy_files(resources_dir, assets_dir)\n\ndef build_samples(target,ndk_build_param,android_platform,build_mode):\n\n    ndk_root = check_environment_variables()\n    sdk_root = None\n    select_toolchain_version()\n    build_targets = caculate_built_samples(target)\n\n    current_dir = os.path.dirname(os.path.realpath(__file__))\n    cocos_root = os.path.join(current_dir, \"..\")\n    \n    if android_platform is not None:\n\t\t\t\tsdk_root = check_environment_variables_sdk()\n\t\t\t\tif android_platform.isdigit():\n\t\t\t\t\t\tandroid_platform = 'android-'+android_platform\n\t\t\t\telse:\n\t\t\t\t\t\tprint 'please use vaild android platform'\n\t\t\t\t\t\texit(1)\n    \t  \n    if build_mode is None:\n    \t  build_mode = 'debug'\n    elif build_mode != 'release':\n        build_mode = 'debug'\n       \n    app_android_root = ''\n    for target in build_targets:\n        if target == 'hellocpp':\n            app_android_root = os.path.join(cocos_root, 'samples/Cpp/HelloCpp/proj.android')\n        elif target == 'testcpp':\n            app_android_root = os.path.join(cocos_root, 'samples/Cpp/TestCpp/proj.android')\n        elif target == 'simplegame':\n            app_android_root = os.path.join(cocos_root, 'samples/Cpp/SimpleGame/proj.android')\n        elif target == 'assetsmanager':\n            app_android_root = os.path.join(cocos_root, 'samples/Cpp/AssetsManagerTest/proj.android')\n        elif target == 'hellolua':\n            app_android_root = os.path.join(cocos_root, 'samples/Lua/HelloLua/proj.android')\n        elif target == 'testlua':\n            app_android_root = os.path.join(cocos_root, 'samples/Lua/TestLua/proj.android')\n        elif target == 'cocosdragon':\n            app_android_root = os.path.join(cocos_root, 'samples/Javascript/CocosDragonJS/proj.android')\n        elif target == 'crystalcraze':\n            app_android_root = os.path.join(cocos_root, 'samples/Javascript/CrystalCraze/proj.android')\n        elif target == 'moonwarriors':\n            app_android_root = os.path.join(cocos_root, 'samples/Javascript/MoonWarriors/proj.android')\n        elif target == 'testjavascript':\n            app_android_root = os.path.join(cocos_root, 'samples/Javascript/TestJavascript/proj.android')\n        elif target == 'watermelonwithme':\n            app_android_root = os.path.join(cocos_root, 'samples/Javascript/WatermelonWithMe/proj.android')\n        else:\n            print 'unknown target: %s' % target\n            continue\n\n        copy_resources(target, app_android_root)\n        do_build(cocos_root, ndk_root, app_android_root, ndk_build_param,sdk_root,android_platform,build_mode)\n\n# -------------- main --------------\nif __name__ == '__main__':\n\n    #parse the params\n    usage = \"\"\"\n    This script is mainy used for building samples built-in with cocos2d-x.\n    \n    Usage: %prog [options] target\n\n    Valid targets are: [hellocpp|testcpp|simplegame|assetsmanager|hellolua|testlua|cocosdragon|crystalcraze|moonwarriors|testjavascript|watermelonwithme]. You can combine them arbitrarily with a whitespace among two valid targets.\n\n    You can use [all|cpp|lua|jsb], to build all the samples, or all the c++ samples, or all the lua samples, or all the jsb samples respectevely.\n\n    cpp  = ['hellocpp', 'testcpp', 'simplegame', 'assetsmanager']\n    lua = ['hellolua', 'testlua']\n    jsb = ['cocosdragon', 'crystalcraze', 'moonwarriors', 'testjavascript', 'watermelonwithme']\n    all  = cpp + lua + jsb  // be careful with the all target, it may took a very long time to compile all the projects, do it under your own risk.\n\n    If you are new to cocos2d-x, I recommend you start with hellocpp,hellolua or testjavascript.\n\n    You can combine these targets like this:\n\n    //1. to build simplegame and assetsmanager \n    python android-build.py -p 10 simplegame assetsmanager\n\n    //2. to build hellolua and all the jsb samples\n    python android-build.py -p 19 hellolua jsb\n\n    Note: You should install ant to generate apk while building the andriod samples. But it is optional. You can generate apk with eclipse.\n    \"\"\"\n\n    parser = OptionParser(usage=usage)\n    parser.add_option(\"-n\", \"--ndk\", dest=\"ndk_build_param\", \n    help='Parameter for ndk-build')\n    parser.add_option(\"-p\", \"--platform\", dest=\"android_platform\", \n    help='Parameter for android-update. Without the parameter,the script just build dynamic library for the projects. Valid android-platform are:[10|11|12|13|14|15|16|17|18|19]')\n    parser.add_option(\"-b\", \"--build\", dest=\"build_mode\", \n    help='The build mode for java project,debug[default] or release. Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html')\n    (opts, args) = parser.parse_args()\n\n    if len(args) == 0:\n        parser.print_help()\n    else:\n        try:\n            build_samples(args, opts.ndk_build_param,opts.android_platform,opts.build_mode)\n        except Exception as e:\n            print e\n            sys.exit(1)\n"
  },
  {
    "path": "cocos2d/build/build-mingw32-gcc-make.sh",
    "content": "#!/bin/bash\n\n# msys2 Pacman Manager for cocos2d-x\n\n#/****************************************************************************\n# Copyright (c) 2012-2013 Martell Malone\n# \n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n# ****************************************************************************/\n\nset -e\n\nTHISDIR=\"$(dirname $0)\"\ntest \"$THISDIR\" = \".\" && THISDIR=${PWD}\nOSTYPE=${OSTYPE//[0-9.]/}\nHOST_ARCH=$(uname -m)\n\nif [ \"${HOST_ARCH}\" = \"i686\" ]; then\n  BITS=32\nelif [ \"${HOST_ARCH}\" = \"x86_64\" ]; then\n  BITS=64\nfi\n\nif [ \"${OSTYPE}\" = \"msys\" ]; then\n\n  CC=${HOST_ARCH}-w64-mingw32-gcc\n  CXX=${HOST_ARCH}-w64-mingw32-g++\n  PP=mingw-w64-${HOST_ARCH}\n  \n  MINGW_PACKAGES=(glfw glew libwebp libjpeg-turbo libpng freetype libiconv zlib curl\n                  make gcc binutils headers cmake libxml2)\n\n  MINGW_PACKAGES=(${MINGW_PACKAGES[@]/#/${PP}-})\n\n  pacman -S --force --noconfirm --needed ${MINGW_PACKAGES[@]}\n\n  mkdir -p mingw${BITS} && cd mingw${BITS}\n\n  export PATH=/mingw${BITS}/bin:${PATH}\n\n  cmake -G\"MinGW Makefiles\" -DCMAKE_MAKE_PROGRAM=\"mingw32-make\" \\\n  -DCMAKE_C_COMPILER=\"${CC}\" -DCMAKE_CXX_COMPILER=\"${CXX}\" ../..\n\n  mingw32-make\nfi\n"
  },
  {
    "path": "cocos2d/build/cocos2d-win32.vc2012.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libAudio\", \"..\\cocos\\audio\\proj.win32\\CocosDenshion.vcxproj\", \"{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libcocos2d\", \"..\\cocos\\2d\\cocos2d.vcxproj\", \"{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"HelloCpp\", \"..\\samples\\Cpp\\HelloCpp\\proj.win32\\HelloCpp.vcxproj\", \"{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libBox2D\", \"..\\external\\Box2D\\proj.win32\\Box2D.vcxproj\", \"{929480E7-23C0-4DF6-8456-096D71547116}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libchipmunk\", \"..\\external\\chipmunk\\proj.win32\\chipmunk.vcxproj\", \"{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libExtensions\", \"..\\extensions\\proj.win32\\libExtensions.vcxproj\", \"{21B2C324-891F-48EA-AD1A-5AE13DE12E28}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"TestCpp\", \"..\\samples\\Cpp\\TestCpp\\proj.win32\\TestCpp.vcxproj\", \"{76A39BB2-9B84-4C65-98A5-654D86B86F2A}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libCocosBuilder\", \"..\\cocos\\editor-support\\cocosbuilder\\proj.win32\\libCocosBuilder.vcxproj\", \"{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libCocosStudio\", \"..\\cocos\\editor-support\\cocostudio\\proj.win32\\libCocosStudio.vcxproj\", \"{B57CF53F-2E49-4031-9822-047CC0E6BDE2}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libGUI\", \"..\\cocos\\gui\\proj.win32\\libGUI.vcxproj\", \"{7E06E92C-537A-442B-9E4A-4761C84F8A1A}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libNetwork\", \"..\\cocos\\network\\proj.win32\\libNetwork.vcxproj\", \"{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libSpine\", \"..\\cocos\\editor-support\\spine\\proj.win32\\libSpine.vcxproj\", \"{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"AssetsManagerTest\", \"..\\samples\\Cpp\\AssetsManagerTest\\proj.win32\\AssetsManagerTest.vcxproj\", \"{6D37505F-A890-441D-BD3F-A61E2C0469CE}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBinding\", \"..\\cocos\\scripting\\javascript\\bindings\\proj.win32\\libJSBinding.vcxproj\", \"{39379840-825A-45A0-B363-C09FFEF864BD}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"TestJavascript\", \"..\\samples\\Javascript\\TestJavascript\\proj.win32\\TestJavascript.vcxproj\", \"{D0F06A44-A245-4D13-A498-0120C203B539}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libLocalStorage\", \"..\\cocos\\storage\\local-storage\\proj.win32\\libLocalStorage.vcxproj\", \"{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"CocosDragonJS\", \"..\\samples\\Javascript\\CocosDragonJS\\proj.win32\\CocosDragonJS.vcxproj\", \"{68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"CrystalCraze\", \"..\\samples\\Javascript\\CrystalCraze\\proj.win32\\CrystalCraze.vcxproj\", \"{9A17D9A4-4B11-4E32-94F6-895FF4909EC5}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"MoonWarriors\", \"..\\samples\\Javascript\\MoonWarriors\\proj.win32\\MoonWarriors.vcxproj\", \"{1DB7C0FC-46FF-4A1B-82E0-C6244EEEC4C2}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"WatermelonWithMe\", \"..\\samples\\Javascript\\WatermelonWithMe\\proj.win32\\WatermelonWithMe.vcxproj\", \"{BE092D9E-95AE-4F86-84CE-F4519E4F3F15}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"liblua\", \"..\\cocos\\scripting\\lua\\bindings\\liblua.vcxproj\", \"{DDC3E27F-004D-4DD4-9DD3-931A013D2159}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"HelloLua\", \"..\\samples\\Lua\\HelloLua\\proj.win32\\HelloLua.vcxproj\", \"{13E55395-94A2-4CD9-BFC2-1A051F80C17D}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"TestLua\", \"..\\samples\\Lua\\TestLua\\proj.win32\\TestLua.win32.vcxproj\", \"{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"SimpleGame\", \"..\\samples\\Cpp\\SimpleGame\\proj.win32\\SimpleGame.vcxproj\", \"{E0E282F4-8487-452C-BFAB-CB960EB4D22F}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForBuilder\", \"..\\cocos\\scripting\\javascript\\bindings\\cocosbuilder\\libJSBindingForBuilder.vcxproj\", \"{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForStudio\", \"..\\cocos\\scripting\\javascript\\bindings\\cocostudio\\libJSBindingForStudio.vcxproj\", \"{79D34511-E54E-410A-8BBA-EF175AD6C695}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForNetwork\", \"..\\cocos\\scripting\\javascript\\bindings\\network\\libJSBindingForNetwork.vcxproj\", \"{3BEC13F5-E227-4D80-BC77-1C857F83BCFC}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForExtension\", \"..\\cocos\\scripting\\javascript\\bindings\\extension\\libJSBindingForExtension.vcxproj\", \"{625F7391-9A91-48A1-8CFC-79508C822637}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"libJSBinding\", \"libJSBinding\", \"{10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForChipmunk\", \"..\\cocos\\scripting\\javascript\\bindings\\chipmunk\\libJSBindingForChipmunk.vcxproj\", \"{21070E58-EEC6-4E16-8B4F-6D083DF55790}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForLocalStorage\", \"..\\cocos\\scripting\\javascript\\bindings\\localstorage\\libJSBindingForLocalStorage.vcxproj\", \"{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForGui\", \"..\\cocos\\scripting\\javascript\\bindings\\gui\\libJSBindingForGui.vcxproj\", \"{9A844C88-97E8-4E2D-B09A-E138C67D338B}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libJSBindingForSpine\", \"..\\cocos\\scripting\\javascript\\bindings\\spine\\libJSBindingForSpine.vcxproj\", \"{E78CDC6B-F37D-48D2-AD91-1DB549497E32}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32\n\t\t{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}.Release|Win32.Build.0 = Release|Win32\n\t\t{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32\n\t\t{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.Build.0 = Release|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.Build.0 = Release|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32\n\t\t{6D37505F-A890-441D-BD3F-A61E2C0469CE}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{6D37505F-A890-441D-BD3F-A61E2C0469CE}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{6D37505F-A890-441D-BD3F-A61E2C0469CE}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{6D37505F-A890-441D-BD3F-A61E2C0469CE}.Release|Win32.Build.0 = Release|Win32\n\t\t{39379840-825A-45A0-B363-C09FFEF864BD}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{39379840-825A-45A0-B363-C09FFEF864BD}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{39379840-825A-45A0-B363-C09FFEF864BD}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{39379840-825A-45A0-B363-C09FFEF864BD}.Release|Win32.Build.0 = Release|Win32\n\t\t{D0F06A44-A245-4D13-A498-0120C203B539}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{D0F06A44-A245-4D13-A498-0120C203B539}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{D0F06A44-A245-4D13-A498-0120C203B539}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{D0F06A44-A245-4D13-A498-0120C203B539}.Release|Win32.Build.0 = Release|Win32\n\t\t{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}.Release|Win32.Build.0 = Release|Win32\n\t\t{68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{68ED0B4E-2BCA-45D2-9648-CEABEBD3B9D7}.Release|Win32.Build.0 = Release|Win32\n\t\t{9A17D9A4-4B11-4E32-94F6-895FF4909EC5}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{9A17D9A4-4B11-4E32-94F6-895FF4909EC5}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{9A17D9A4-4B11-4E32-94F6-895FF4909EC5}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{9A17D9A4-4B11-4E32-94F6-895FF4909EC5}.Release|Win32.Build.0 = Release|Win32\n\t\t{1DB7C0FC-46FF-4A1B-82E0-C6244EEEC4C2}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{1DB7C0FC-46FF-4A1B-82E0-C6244EEEC4C2}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{1DB7C0FC-46FF-4A1B-82E0-C6244EEEC4C2}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{1DB7C0FC-46FF-4A1B-82E0-C6244EEEC4C2}.Release|Win32.Build.0 = Release|Win32\n\t\t{BE092D9E-95AE-4F86-84CE-F4519E4F3F15}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{BE092D9E-95AE-4F86-84CE-F4519E4F3F15}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{BE092D9E-95AE-4F86-84CE-F4519E4F3F15}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{BE092D9E-95AE-4F86-84CE-F4519E4F3F15}.Release|Win32.Build.0 = Release|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.Build.0 = Release|Win32\n\t\t{13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{13E55395-94A2-4CD9-BFC2-1A051F80C17D}.Release|Win32.Build.0 = Release|Win32\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32\n\t\t{E0E282F4-8487-452C-BFAB-CB960EB4D22F}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{E0E282F4-8487-452C-BFAB-CB960EB4D22F}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{E0E282F4-8487-452C-BFAB-CB960EB4D22F}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{E0E282F4-8487-452C-BFAB-CB960EB4D22F}.Release|Win32.Build.0 = Release|Win32\n\t\t{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}.Release|Win32.Build.0 = Release|Win32\n\t\t{79D34511-E54E-410A-8BBA-EF175AD6C695}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{79D34511-E54E-410A-8BBA-EF175AD6C695}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{79D34511-E54E-410A-8BBA-EF175AD6C695}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{79D34511-E54E-410A-8BBA-EF175AD6C695}.Release|Win32.Build.0 = Release|Win32\n\t\t{3BEC13F5-E227-4D80-BC77-1C857F83BCFC}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{3BEC13F5-E227-4D80-BC77-1C857F83BCFC}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{3BEC13F5-E227-4D80-BC77-1C857F83BCFC}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{3BEC13F5-E227-4D80-BC77-1C857F83BCFC}.Release|Win32.Build.0 = Release|Win32\n\t\t{625F7391-9A91-48A1-8CFC-79508C822637}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{625F7391-9A91-48A1-8CFC-79508C822637}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{625F7391-9A91-48A1-8CFC-79508C822637}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{625F7391-9A91-48A1-8CFC-79508C822637}.Release|Win32.Build.0 = Release|Win32\n\t\t{21070E58-EEC6-4E16-8B4F-6D083DF55790}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{21070E58-EEC6-4E16-8B4F-6D083DF55790}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{21070E58-EEC6-4E16-8B4F-6D083DF55790}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{21070E58-EEC6-4E16-8B4F-6D083DF55790}.Release|Win32.Build.0 = Release|Win32\n\t\t{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}.Release|Win32.Build.0 = Release|Win32\n\t\t{9A844C88-97E8-4E2D-B09A-E138C67D338B}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{9A844C88-97E8-4E2D-B09A-E138C67D338B}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{9A844C88-97E8-4E2D-B09A-E138C67D338B}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{9A844C88-97E8-4E2D-B09A-E138C67D338B}.Release|Win32.Build.0 = Release|Win32\n\t\t{E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{E78CDC6B-F37D-48D2-AD91-1DB549497E32}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{79D34511-E54E-410A-8BBA-EF175AD6C695} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{3BEC13F5-E227-4D80-BC77-1C857F83BCFC} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{625F7391-9A91-48A1-8CFC-79508C822637} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{39379840-825A-45A0-B363-C09FFEF864BD} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{21070E58-EEC6-4E16-8B4F-6D083DF55790} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{9A844C88-97E8-4E2D-B09A-E138C67D338B} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\t\t{E78CDC6B-F37D-48D2-AD91-1DB549497E32} = {10F98A57-B9A1-47DA-9FBA-12D328E72ED1}\n\tEndGlobalSection\n\tGlobalSection(DPCodeReviewSolutionGUID) = preSolution\n\t\tDPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}\n\tEndGlobalSection\n\tGlobalSection(DPCodeReviewSolutionGUID) = preSolution\n\t\tDPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "cocos2d/build/cocos2d_libs.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXAggregateTarget section */\n\t\tA03F2E8E178141C1006731B9 /* build-all-libs Mac */ = {\n\t\t\tisa = PBXAggregateTarget;\n\t\t\tbuildConfigurationList = A03F2E8F178141C1006731B9 /* Build configuration list for PBXAggregateTarget \"build-all-libs Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A6FB7E71785683A00CDF010 /* PBXTargetDependency */,\n\t\t\t\tA03F31FF178147CB006731B9 /* PBXTargetDependency */,\n\t\t\t\tA03F3201178147CB006731B9 /* PBXTargetDependency */,\n\t\t\t\tA03F2FC01781458C006731B9 /* PBXTargetDependency */,\n\t\t\t\tA03F2E93178141D1006731B9 /* PBXTargetDependency */,\n\t\t\t\tA03F2E95178141D1006731B9 /* PBXTargetDependency */,\n\t\t\t\tA03F2E97178141D1006731B9 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"build-all-libs Mac\";\n\t\t\tproductName = \"build-all\";\n\t\t};\n\t\tA07A4E0B178386390073F6A7 /* build-all-libs iOS */ = {\n\t\t\tisa = PBXAggregateTarget;\n\t\t\tbuildConfigurationList = A07A4E0C178386390073F6A7 /* Build configuration list for PBXAggregateTarget \"build-all-libs iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\tA07A4E10178386520073F6A7 /* PBXTargetDependency */,\n\t\t\t\tA07A5047178389710073F6A7 /* PBXTargetDependency */,\n\t\t\t\tA07A5049178389710073F6A7 /* PBXTargetDependency */,\n\t\t\t\tA07A504B178389710073F6A7 /* PBXTargetDependency */,\n\t\t\t\tA07A504D178389710073F6A7 /* PBXTargetDependency */,\n\t\t\t\tA07A504F178389710073F6A7 /* PBXTargetDependency */,\n\t\t\t\t1A6FB4FF17854AD600CDF010 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"build-all-libs iOS\";\n\t\t\tproductName = \"build-all-libs iOS\";\n\t\t};\n/* End PBXAggregateTarget section */\n\n/* Begin PBXBuildFile section */\n\t\t06C0F2EF186AD822003594D5 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAABA186AD63B0012A414 /* ObjectFactory.cpp */; };\n\t\t06C0F2F0186AD824003594D5 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAABA186AD63B0012A414 /* ObjectFactory.cpp */; };\n\t\t06CAAAC2186AD7D70012A414 /* CCActionEaseEx.h in Headers */ = {isa = PBXBuildFile; fileRef = 37936A401869B7B200E974DD /* CCActionEaseEx.h */; };\n\t\t06CAAAC3186AD7D80012A414 /* CCActionEaseEx.h in Headers */ = {isa = PBXBuildFile; fileRef = 37936A401869B7B200E974DD /* CCActionEaseEx.h */; };\n\t\t06CAAAC4186AD7DF0012A414 /* CCActionEaseEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3774879E1869BA8C00EDF837 /* CCActionEaseEx.cpp */; };\n\t\t06CAAAC5186AD7E50012A414 /* TriggerObj.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAAC1186AD63B0012A414 /* TriggerObj.h */; };\n\t\t06CAAAC6186AD7E60012A414 /* TriggerObj.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAAC1186AD63B0012A414 /* TriggerObj.h */; };\n\t\t06CAAAC7186AD7E90012A414 /* TriggerObj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAAC0186AD63B0012A414 /* TriggerObj.cpp */; };\n\t\t06CAAAC8186AD7EB0012A414 /* TriggerObj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAAC0186AD63B0012A414 /* TriggerObj.cpp */; };\n\t\t06CAAAC9186AD7EE0012A414 /* TriggerMng.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAABF186AD63B0012A414 /* TriggerMng.h */; };\n\t\t06CAAACA186AD7EF0012A414 /* TriggerMng.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAABF186AD63B0012A414 /* TriggerMng.h */; };\n\t\t06CAAACB186AD7F20012A414 /* TriggerMng.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAABE186AD63B0012A414 /* TriggerMng.cpp */; };\n\t\t06CAAACC186AD7F50012A414 /* TriggerMng.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAABE186AD63B0012A414 /* TriggerMng.cpp */; };\n\t\t06CAAACD186AD7F90012A414 /* TriggerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAABD186AD63B0012A414 /* TriggerBase.h */; };\n\t\t06CAAACE186AD7FA0012A414 /* TriggerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAABD186AD63B0012A414 /* TriggerBase.h */; };\n\t\t06CAAACF186AD7FC0012A414 /* TriggerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAABC186AD63B0012A414 /* TriggerBase.cpp */; };\n\t\t06CAAAD0186AD7FE0012A414 /* TriggerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 06CAAABC186AD63B0012A414 /* TriggerBase.cpp */; };\n\t\t06CAAAD1186AD8010012A414 /* ObjectFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAABB186AD63B0012A414 /* ObjectFactory.h */; };\n\t\t06CAAAD2186AD8030012A414 /* ObjectFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 06CAAABB186AD63B0012A414 /* ObjectFactory.h */; };\n\t\t1585AB5B1828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1585AB591828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp */; };\n\t\t1585AB5C1828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1585AB591828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp */; };\n\t\t1585AB5D1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1585AB5A1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp */; };\n\t\t1585AB5E1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1585AB5A1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp */; };\n\t\t158E06DE181F6796008E01F6 /* lua_xml_http_request.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 158E06DC181F6796008E01F6 /* lua_xml_http_request.cpp */; };\n\t\t158E06DF181F6796008E01F6 /* lua_xml_http_request.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 158E06DC181F6796008E01F6 /* lua_xml_http_request.cpp */; };\n\t\t158E06E0181F6796008E01F6 /* lua_xml_http_request.h in Headers */ = {isa = PBXBuildFile; fileRef = 158E06DD181F6796008E01F6 /* lua_xml_http_request.h */; };\n\t\t158E06E1181F6796008E01F6 /* lua_xml_http_request.h in Headers */ = {isa = PBXBuildFile; fileRef = 158E06DD181F6796008E01F6 /* lua_xml_http_request.h */; };\n\t\t1599607B1811329600C7D42C /* libluajit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1599607A1811329600C7D42C /* libluajit.a */; };\n\t\t15996080181132DE00C7D42C /* libluajit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1599607F181132DE00C7D42C /* libluajit.a */; };\n\t\t15A71D5E18921E6900F30AC0 /* auxiliar.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D3C18921E6900F30AC0 /* auxiliar.c */; };\n\t\t15A71D5F18921E6900F30AC0 /* auxiliar.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D3C18921E6900F30AC0 /* auxiliar.c */; };\n\t\t15A71D6018921E6900F30AC0 /* auxiliar.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D3D18921E6900F30AC0 /* auxiliar.h */; };\n\t\t15A71D6118921E6900F30AC0 /* auxiliar.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D3D18921E6900F30AC0 /* auxiliar.h */; };\n\t\t15A71D6218921E6900F30AC0 /* except.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D3E18921E6900F30AC0 /* except.c */; };\n\t\t15A71D6318921E6900F30AC0 /* except.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D3E18921E6900F30AC0 /* except.c */; };\n\t\t15A71D6418921E6900F30AC0 /* except.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D3F18921E6900F30AC0 /* except.h */; };\n\t\t15A71D6518921E6900F30AC0 /* except.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D3F18921E6900F30AC0 /* except.h */; };\n\t\t15A71D6618921E6900F30AC0 /* inet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4018921E6900F30AC0 /* inet.c */; };\n\t\t15A71D6718921E6900F30AC0 /* inet.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4018921E6900F30AC0 /* inet.c */; };\n\t\t15A71D6818921E6900F30AC0 /* inet.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4118921E6900F30AC0 /* inet.h */; };\n\t\t15A71D6918921E6900F30AC0 /* inet.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4118921E6900F30AC0 /* inet.h */; };\n\t\t15A71D6A18921E6900F30AC0 /* luasocket.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4218921E6900F30AC0 /* luasocket.c */; };\n\t\t15A71D6B18921E6900F30AC0 /* luasocket.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4218921E6900F30AC0 /* luasocket.c */; };\n\t\t15A71D6C18921E6900F30AC0 /* luasocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4318921E6900F30AC0 /* luasocket.h */; };\n\t\t15A71D6D18921E6900F30AC0 /* luasocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4318921E6900F30AC0 /* luasocket.h */; };\n\t\t15A71D6E18921E6900F30AC0 /* luasocket_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4418921E6900F30AC0 /* luasocket_buffer.c */; };\n\t\t15A71D6F18921E6900F30AC0 /* luasocket_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4418921E6900F30AC0 /* luasocket_buffer.c */; };\n\t\t15A71D7018921E6900F30AC0 /* luasocket_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4518921E6900F30AC0 /* luasocket_buffer.h */; };\n\t\t15A71D7118921E6900F30AC0 /* luasocket_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4518921E6900F30AC0 /* luasocket_buffer.h */; };\n\t\t15A71D7218921E6900F30AC0 /* luasocket_io.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4618921E6900F30AC0 /* luasocket_io.c */; };\n\t\t15A71D7318921E6900F30AC0 /* luasocket_io.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4618921E6900F30AC0 /* luasocket_io.c */; };\n\t\t15A71D7418921E6900F30AC0 /* luasocket_io.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4718921E6900F30AC0 /* luasocket_io.h */; };\n\t\t15A71D7518921E6900F30AC0 /* luasocket_io.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4718921E6900F30AC0 /* luasocket_io.h */; };\n\t\t15A71D7618921E6900F30AC0 /* mime.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4818921E6900F30AC0 /* mime.c */; };\n\t\t15A71D7718921E6900F30AC0 /* mime.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4818921E6900F30AC0 /* mime.c */; };\n\t\t15A71D7818921E6900F30AC0 /* mime.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4918921E6900F30AC0 /* mime.h */; };\n\t\t15A71D7918921E6900F30AC0 /* mime.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4918921E6900F30AC0 /* mime.h */; };\n\t\t15A71D7A18921E6900F30AC0 /* options.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4A18921E6900F30AC0 /* options.c */; };\n\t\t15A71D7B18921E6900F30AC0 /* options.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4A18921E6900F30AC0 /* options.c */; };\n\t\t15A71D7C18921E6900F30AC0 /* options.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4B18921E6900F30AC0 /* options.h */; };\n\t\t15A71D7D18921E6900F30AC0 /* options.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4B18921E6900F30AC0 /* options.h */; };\n\t\t15A71D7E18921E6900F30AC0 /* select.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4C18921E6900F30AC0 /* select.c */; };\n\t\t15A71D7F18921E6900F30AC0 /* select.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4C18921E6900F30AC0 /* select.c */; };\n\t\t15A71D8018921E6900F30AC0 /* select.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4D18921E6900F30AC0 /* select.h */; };\n\t\t15A71D8118921E6900F30AC0 /* select.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4D18921E6900F30AC0 /* select.h */; };\n\t\t15A71D8218921E6900F30AC0 /* serial.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4E18921E6900F30AC0 /* serial.c */; };\n\t\t15A71D8318921E6900F30AC0 /* serial.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D4E18921E6900F30AC0 /* serial.c */; };\n\t\t15A71D8418921E6900F30AC0 /* socket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4F18921E6900F30AC0 /* socket.h */; };\n\t\t15A71D8518921E6900F30AC0 /* socket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D4F18921E6900F30AC0 /* socket.h */; };\n\t\t15A71D8618921E6900F30AC0 /* socket_scripts.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5018921E6900F30AC0 /* socket_scripts.c */; };\n\t\t15A71D8718921E6900F30AC0 /* socket_scripts.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5018921E6900F30AC0 /* socket_scripts.c */; };\n\t\t15A71D8818921E6900F30AC0 /* socket_scripts.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5118921E6900F30AC0 /* socket_scripts.h */; };\n\t\t15A71D8918921E6900F30AC0 /* socket_scripts.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5118921E6900F30AC0 /* socket_scripts.h */; };\n\t\t15A71D8A18921E6900F30AC0 /* tcp.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5218921E6900F30AC0 /* tcp.c */; };\n\t\t15A71D8B18921E6900F30AC0 /* tcp.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5218921E6900F30AC0 /* tcp.c */; };\n\t\t15A71D8C18921E6900F30AC0 /* tcp.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5318921E6900F30AC0 /* tcp.h */; };\n\t\t15A71D8D18921E6900F30AC0 /* tcp.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5318921E6900F30AC0 /* tcp.h */; };\n\t\t15A71D8E18921E6900F30AC0 /* timeout.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5418921E6900F30AC0 /* timeout.c */; };\n\t\t15A71D8F18921E6900F30AC0 /* timeout.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5418921E6900F30AC0 /* timeout.c */; };\n\t\t15A71D9018921E6900F30AC0 /* timeout.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5518921E6900F30AC0 /* timeout.h */; };\n\t\t15A71D9118921E6900F30AC0 /* timeout.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5518921E6900F30AC0 /* timeout.h */; };\n\t\t15A71D9218921E6900F30AC0 /* udp.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5618921E6900F30AC0 /* udp.c */; };\n\t\t15A71D9318921E6900F30AC0 /* udp.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5618921E6900F30AC0 /* udp.c */; };\n\t\t15A71D9418921E6900F30AC0 /* udp.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5718921E6900F30AC0 /* udp.h */; };\n\t\t15A71D9518921E6900F30AC0 /* udp.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5718921E6900F30AC0 /* udp.h */; };\n\t\t15A71D9618921E6900F30AC0 /* unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5818921E6900F30AC0 /* unix.c */; };\n\t\t15A71D9718921E6900F30AC0 /* unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5818921E6900F30AC0 /* unix.c */; };\n\t\t15A71D9818921E6900F30AC0 /* unix.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5918921E6900F30AC0 /* unix.h */; };\n\t\t15A71D9918921E6900F30AC0 /* unix.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5918921E6900F30AC0 /* unix.h */; };\n\t\t15A71D9A18921E6900F30AC0 /* usocket.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5A18921E6900F30AC0 /* usocket.c */; };\n\t\t15A71D9B18921E6900F30AC0 /* usocket.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71D5A18921E6900F30AC0 /* usocket.c */; };\n\t\t15A71D9C18921E6900F30AC0 /* usocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5B18921E6900F30AC0 /* usocket.h */; };\n\t\t15A71D9D18921E6900F30AC0 /* usocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5B18921E6900F30AC0 /* usocket.h */; };\n\t\t15A71DA018921E6900F30AC0 /* wsocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5D18921E6900F30AC0 /* wsocket.h */; };\n\t\t15A71DA118921E6900F30AC0 /* wsocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71D5D18921E6900F30AC0 /* wsocket.h */; };\n\t\t15A71DA41892291500F30AC0 /* lua_extensions.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71DA21892291500F30AC0 /* lua_extensions.c */; };\n\t\t15A71DA51892291500F30AC0 /* lua_extensions.c in Sources */ = {isa = PBXBuildFile; fileRef = 15A71DA21892291500F30AC0 /* lua_extensions.c */; };\n\t\t15A71DA61892291500F30AC0 /* lua_extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71DA31892291500F30AC0 /* lua_extensions.h */; };\n\t\t15A71DA71892291500F30AC0 /* lua_extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A71DA31892291500F30AC0 /* lua_extensions.h */; };\n\t\t15CA8D0D18697A56000032AB /* lua_cocos2dx_spine_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CA8D0B18697A56000032AB /* lua_cocos2dx_spine_manual.cpp */; };\n\t\t15CA8D0E18697A56000032AB /* lua_cocos2dx_spine_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CA8D0B18697A56000032AB /* lua_cocos2dx_spine_manual.cpp */; };\n\t\t15CA8D0F18697A56000032AB /* lua_cocos2dx_spine_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15CA8D0C18697A56000032AB /* lua_cocos2dx_spine_manual.hpp */; };\n\t\t15CA8D1018697A56000032AB /* lua_cocos2dx_spine_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15CA8D0C18697A56000032AB /* lua_cocos2dx_spine_manual.hpp */; };\n\t\t15CA8D1318697AE1000032AB /* lua_cocos2dx_spine_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CA8D1118697AE1000032AB /* lua_cocos2dx_spine_auto.cpp */; };\n\t\t15CA8D1418697AE1000032AB /* lua_cocos2dx_spine_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CA8D1118697AE1000032AB /* lua_cocos2dx_spine_auto.cpp */; };\n\t\t15CA8D1518697AE1000032AB /* lua_cocos2dx_spine_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15CA8D1218697AE1000032AB /* lua_cocos2dx_spine_auto.hpp */; };\n\t\t15CA8D1618697AE1000032AB /* lua_cocos2dx_spine_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15CA8D1218697AE1000032AB /* lua_cocos2dx_spine_auto.hpp */; };\n\t\t15CA8D1918697BE5000032AB /* LuaSkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CA8D1718697BE5000032AB /* LuaSkeletonAnimation.cpp */; };\n\t\t15CA8D1A18697BE5000032AB /* LuaSkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15CA8D1718697BE5000032AB /* LuaSkeletonAnimation.cpp */; };\n\t\t15CA8D1B18697BE5000032AB /* LuaSkeletonAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CA8D1818697BE5000032AB /* LuaSkeletonAnimation.h */; };\n\t\t15CA8D1C18697BE5000032AB /* LuaSkeletonAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 15CA8D1818697BE5000032AB /* LuaSkeletonAnimation.h */; };\n\t\t15D6E845182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15D6E843182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp */; };\n\t\t15D6E846182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15D6E843182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp */; };\n\t\t15D6E847182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15D6E844182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp */; };\n\t\t15D6E848182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15D6E844182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp */; };\n\t\t15F4C8821875637D0082884F /* lua_cocos2dx_gui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15F4C8801875637D0082884F /* lua_cocos2dx_gui_auto.cpp */; };\n\t\t15F4C8831875637D0082884F /* lua_cocos2dx_gui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15F4C8801875637D0082884F /* lua_cocos2dx_gui_auto.cpp */; };\n\t\t15F4C8841875637D0082884F /* lua_cocos2dx_gui_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15F4C8811875637D0082884F /* lua_cocos2dx_gui_auto.hpp */; };\n\t\t15F4C8851875637D0082884F /* lua_cocos2dx_gui_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15F4C8811875637D0082884F /* lua_cocos2dx_gui_auto.hpp */; };\n\t\t15F4CA1F1875885A0082884F /* lua_cocos2dx_gui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15F4CA1D1875885A0082884F /* lua_cocos2dx_gui_manual.cpp */; };\n\t\t15F4CA201875885A0082884F /* lua_cocos2dx_gui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 15F4CA1D1875885A0082884F /* lua_cocos2dx_gui_manual.cpp */; };\n\t\t15F4CA211875885A0082884F /* lua_cocos2dx_gui_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15F4CA1E1875885A0082884F /* lua_cocos2dx_gui_manual.hpp */; };\n\t\t15F4CA221875885A0082884F /* lua_cocos2dx_gui_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 15F4CA1E1875885A0082884F /* lua_cocos2dx_gui_manual.hpp */; };\n\t\t1A087AE81860400400196EF5 /* edtaa3func.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A087AE61860400400196EF5 /* edtaa3func.cpp */; };\n\t\t1A087AE91860400400196EF5 /* edtaa3func.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A087AE61860400400196EF5 /* edtaa3func.cpp */; };\n\t\t1A087AEA1860400400196EF5 /* edtaa3func.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A087AE71860400400196EF5 /* edtaa3func.h */; };\n\t\t1A087AEB1860400400196EF5 /* edtaa3func.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A087AE71860400400196EF5 /* edtaa3func.h */; };\n\t\t1A0DB7321823827C0025743D /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0DB7301823827C0025743D /* CCGL.h */; };\n\t\t1A0DB7331823827C0025743D /* EAGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0DB7311823827C0025743D /* EAGLView.h */; };\n\t\t1A0DB7381823828F0025743D /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0DB7351823828F0025743D /* CCGL.h */; };\n\t\t1A2C7872181A11EC004E5527 /* jsb_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C785E181A11EC004E5527 /* jsb_cocos2dx_auto.cpp */; };\n\t\t1A2C7874181A11EC004E5527 /* jsb_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C785E181A11EC004E5527 /* jsb_cocos2dx_auto.cpp */; };\n\t\t1A2C7876181A11EC004E5527 /* jsb_cocos2dx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C785F181A11EC004E5527 /* jsb_cocos2dx_auto.hpp */; };\n\t\t1A2C7878181A11EC004E5527 /* jsb_cocos2dx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C785F181A11EC004E5527 /* jsb_cocos2dx_auto.hpp */; };\n\t\t1A2C787E181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7861181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp */; };\n\t\t1A2C7880181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7861181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp */; };\n\t\t1A2C7882181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7862181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp */; };\n\t\t1A2C7884181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7862181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp */; };\n\t\t1A2C788A181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7864181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp */; };\n\t\t1A2C788C181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7864181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp */; };\n\t\t1A2C788E181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7865181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp */; };\n\t\t1A2C7890181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7865181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp */; };\n\t\t1A2C7896181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7867181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp */; };\n\t\t1A2C7898181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7867181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp */; };\n\t\t1A2C789A181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7868181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp */; };\n\t\t1A2C789C181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7868181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp */; };\n\t\t1A2C78A3181A11EC004E5527 /* lua_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C786B181A11EC004E5527 /* lua_cocos2dx_auto.cpp */; };\n\t\t1A2C78A5181A11EC004E5527 /* lua_cocos2dx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C786B181A11EC004E5527 /* lua_cocos2dx_auto.cpp */; };\n\t\t1A2C78A7181A11EC004E5527 /* lua_cocos2dx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C786C181A11EC004E5527 /* lua_cocos2dx_auto.hpp */; };\n\t\t1A2C78A9181A11EC004E5527 /* lua_cocos2dx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C786C181A11EC004E5527 /* lua_cocos2dx_auto.hpp */; };\n\t\t1A2C78AF181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C786E181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp */; };\n\t\t1A2C78B1181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C786E181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp */; };\n\t\t1A2C78B3181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C786F181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp */; };\n\t\t1A2C78B5181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C786F181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp */; };\n\t\t1A2C790D181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78BE181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp */; };\n\t\t1A2C790E181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78BE181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp */; };\n\t\t1A2C790F181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78BF181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h */; };\n\t\t1A2C7910181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78BF181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h */; };\n\t\t1A2C7911181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C0181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h */; };\n\t\t1A2C7912181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C0181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h */; };\n\t\t1A2C7913181A1257004E5527 /* js_bindings_chipmunk_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78C1181A1257004E5527 /* js_bindings_chipmunk_functions.cpp */; };\n\t\t1A2C7914181A1257004E5527 /* js_bindings_chipmunk_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78C1181A1257004E5527 /* js_bindings_chipmunk_functions.cpp */; };\n\t\t1A2C7915181A1257004E5527 /* js_bindings_chipmunk_functions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C2181A1257004E5527 /* js_bindings_chipmunk_functions.h */; };\n\t\t1A2C7916181A1257004E5527 /* js_bindings_chipmunk_functions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C2181A1257004E5527 /* js_bindings_chipmunk_functions.h */; };\n\t\t1A2C7917181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C3181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h */; };\n\t\t1A2C7918181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C3181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h */; };\n\t\t1A2C7919181A1257004E5527 /* js_bindings_chipmunk_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78C4181A1257004E5527 /* js_bindings_chipmunk_manual.cpp */; };\n\t\t1A2C791A181A1257004E5527 /* js_bindings_chipmunk_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78C4181A1257004E5527 /* js_bindings_chipmunk_manual.cpp */; };\n\t\t1A2C791B181A1257004E5527 /* js_bindings_chipmunk_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C5181A1257004E5527 /* js_bindings_chipmunk_manual.h */; };\n\t\t1A2C791C181A1257004E5527 /* js_bindings_chipmunk_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C5181A1257004E5527 /* js_bindings_chipmunk_manual.h */; };\n\t\t1A2C791D181A1257004E5527 /* js_bindings_chipmunk_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78C6181A1257004E5527 /* js_bindings_chipmunk_registration.cpp */; };\n\t\t1A2C791E181A1257004E5527 /* js_bindings_chipmunk_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78C6181A1257004E5527 /* js_bindings_chipmunk_registration.cpp */; };\n\t\t1A2C791F181A1257004E5527 /* js_bindings_chipmunk_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C7181A1257004E5527 /* js_bindings_chipmunk_registration.h */; };\n\t\t1A2C7920181A1257004E5527 /* js_bindings_chipmunk_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78C7181A1257004E5527 /* js_bindings_chipmunk_registration.h */; };\n\t\t1A2C7921181A1257004E5527 /* cocos2d_specifics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78CB181A1257004E5527 /* cocos2d_specifics.cpp */; };\n\t\t1A2C7922181A1257004E5527 /* cocos2d_specifics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78CB181A1257004E5527 /* cocos2d_specifics.cpp */; };\n\t\t1A2C7923181A1257004E5527 /* cocos2d_specifics.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78CC181A1257004E5527 /* cocos2d_specifics.hpp */; };\n\t\t1A2C7924181A1257004E5527 /* cocos2d_specifics.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78CC181A1257004E5527 /* cocos2d_specifics.hpp */; };\n\t\t1A2C7925181A1257004E5527 /* cocosbuilder_specifics.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78CF181A1257004E5527 /* cocosbuilder_specifics.hpp */; };\n\t\t1A2C7926181A1257004E5527 /* cocosbuilder_specifics.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78CF181A1257004E5527 /* cocosbuilder_specifics.hpp */; };\n\t\t1A2C7927181A1257004E5527 /* js_bindings_ccbreader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78D0181A1257004E5527 /* js_bindings_ccbreader.cpp */; };\n\t\t1A2C7928181A1257004E5527 /* js_bindings_ccbreader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78D0181A1257004E5527 /* js_bindings_ccbreader.cpp */; };\n\t\t1A2C7929181A1257004E5527 /* js_bindings_ccbreader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78D1181A1257004E5527 /* js_bindings_ccbreader.h */; };\n\t\t1A2C792A181A1257004E5527 /* js_bindings_ccbreader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78D1181A1257004E5527 /* js_bindings_ccbreader.h */; };\n\t\t1A2C792F181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78D9181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp */; };\n\t\t1A2C7930181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78D9181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp */; };\n\t\t1A2C7931181A1257004E5527 /* jsb_cocos2dx_studio_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78DA181A1257004E5527 /* jsb_cocos2dx_studio_manual.h */; };\n\t\t1A2C7932181A1257004E5527 /* jsb_cocos2dx_studio_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78DA181A1257004E5527 /* jsb_cocos2dx_studio_manual.h */; };\n\t\t1A2C7933181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78E0181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp */; };\n\t\t1A2C7934181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78E0181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp */; };\n\t\t1A2C7935181A1257004E5527 /* jsb_cocos2dx_extension_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E1181A1257004E5527 /* jsb_cocos2dx_extension_manual.h */; };\n\t\t1A2C7936181A1257004E5527 /* jsb_cocos2dx_extension_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E1181A1257004E5527 /* jsb_cocos2dx_extension_manual.h */; };\n\t\t1A2C7937181A1257004E5527 /* js_bindings_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E5181A1257004E5527 /* js_bindings_config.h */; };\n\t\t1A2C7938181A1257004E5527 /* js_bindings_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E5181A1257004E5527 /* js_bindings_config.h */; };\n\t\t1A2C7939181A1257004E5527 /* js_bindings_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78E6181A1257004E5527 /* js_bindings_core.cpp */; };\n\t\t1A2C793A181A1257004E5527 /* js_bindings_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78E6181A1257004E5527 /* js_bindings_core.cpp */; };\n\t\t1A2C793B181A1257004E5527 /* js_bindings_core.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E7181A1257004E5527 /* js_bindings_core.h */; };\n\t\t1A2C793C181A1257004E5527 /* js_bindings_core.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E7181A1257004E5527 /* js_bindings_core.h */; };\n\t\t1A2C793D181A1257004E5527 /* js_bindings_opengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78E8181A1257004E5527 /* js_bindings_opengl.cpp */; };\n\t\t1A2C793E181A1257004E5527 /* js_bindings_opengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78E8181A1257004E5527 /* js_bindings_opengl.cpp */; };\n\t\t1A2C793F181A1257004E5527 /* js_bindings_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E9181A1257004E5527 /* js_bindings_opengl.h */; };\n\t\t1A2C7940181A1257004E5527 /* js_bindings_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78E9181A1257004E5527 /* js_bindings_opengl.h */; };\n\t\t1A2C7941181A1257004E5527 /* js_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78EA181A1257004E5527 /* js_manual_conversions.cpp */; };\n\t\t1A2C7942181A1257004E5527 /* js_manual_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78EA181A1257004E5527 /* js_manual_conversions.cpp */; };\n\t\t1A2C7943181A1257004E5527 /* js_manual_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78EB181A1257004E5527 /* js_manual_conversions.h */; };\n\t\t1A2C7944181A1257004E5527 /* js_manual_conversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78EB181A1257004E5527 /* js_manual_conversions.h */; };\n\t\t1A2C7945181A1257004E5527 /* jsb_helper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78EC181A1257004E5527 /* jsb_helper.h */; };\n\t\t1A2C7946181A1257004E5527 /* jsb_helper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78EC181A1257004E5527 /* jsb_helper.h */; };\n\t\t1A2C7947181A1257004E5527 /* jsb_opengl_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78ED181A1257004E5527 /* jsb_opengl_functions.cpp */; };\n\t\t1A2C7948181A1257004E5527 /* jsb_opengl_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78ED181A1257004E5527 /* jsb_opengl_functions.cpp */; };\n\t\t1A2C7949181A1257004E5527 /* jsb_opengl_functions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78EE181A1257004E5527 /* jsb_opengl_functions.h */; };\n\t\t1A2C794A181A1257004E5527 /* jsb_opengl_functions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78EE181A1257004E5527 /* jsb_opengl_functions.h */; };\n\t\t1A2C794B181A1257004E5527 /* jsb_opengl_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78EF181A1257004E5527 /* jsb_opengl_manual.cpp */; };\n\t\t1A2C794C181A1257004E5527 /* jsb_opengl_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78EF181A1257004E5527 /* jsb_opengl_manual.cpp */; };\n\t\t1A2C794D181A1257004E5527 /* jsb_opengl_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F0181A1257004E5527 /* jsb_opengl_manual.h */; };\n\t\t1A2C794E181A1257004E5527 /* jsb_opengl_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F0181A1257004E5527 /* jsb_opengl_manual.h */; };\n\t\t1A2C794F181A1257004E5527 /* jsb_opengl_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78F1181A1257004E5527 /* jsb_opengl_registration.cpp */; };\n\t\t1A2C7950181A1257004E5527 /* jsb_opengl_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78F1181A1257004E5527 /* jsb_opengl_registration.cpp */; };\n\t\t1A2C7951181A1257004E5527 /* jsb_opengl_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F2181A1257004E5527 /* jsb_opengl_registration.h */; };\n\t\t1A2C7952181A1257004E5527 /* jsb_opengl_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F2181A1257004E5527 /* jsb_opengl_registration.h */; };\n\t\t1A2C7953181A1257004E5527 /* js_bindings_system_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78F5181A1257004E5527 /* js_bindings_system_functions.cpp */; };\n\t\t1A2C7954181A1257004E5527 /* js_bindings_system_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78F5181A1257004E5527 /* js_bindings_system_functions.cpp */; };\n\t\t1A2C7955181A1257004E5527 /* js_bindings_system_functions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F6181A1257004E5527 /* js_bindings_system_functions.h */; };\n\t\t1A2C7956181A1257004E5527 /* js_bindings_system_functions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F6181A1257004E5527 /* js_bindings_system_functions.h */; };\n\t\t1A2C7957181A1257004E5527 /* js_bindings_system_functions_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F7181A1257004E5527 /* js_bindings_system_functions_registration.h */; };\n\t\t1A2C7958181A1257004E5527 /* js_bindings_system_functions_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F7181A1257004E5527 /* js_bindings_system_functions_registration.h */; };\n\t\t1A2C7959181A1257004E5527 /* js_bindings_system_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78F8181A1257004E5527 /* js_bindings_system_registration.cpp */; };\n\t\t1A2C795A181A1257004E5527 /* js_bindings_system_registration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78F8181A1257004E5527 /* js_bindings_system_registration.cpp */; };\n\t\t1A2C795B181A1257004E5527 /* js_bindings_system_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F9181A1257004E5527 /* js_bindings_system_registration.h */; };\n\t\t1A2C795C181A1257004E5527 /* js_bindings_system_registration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C78F9181A1257004E5527 /* js_bindings_system_registration.h */; };\n\t\t1A2C795D181A1257004E5527 /* jsb_websocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78FF181A1257004E5527 /* jsb_websocket.cpp */; };\n\t\t1A2C795E181A1257004E5527 /* jsb_websocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C78FF181A1257004E5527 /* jsb_websocket.cpp */; };\n\t\t1A2C795F181A1257004E5527 /* jsb_websocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7900181A1257004E5527 /* jsb_websocket.h */; };\n\t\t1A2C7960181A1257004E5527 /* jsb_websocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7900181A1257004E5527 /* jsb_websocket.h */; };\n\t\t1A2C7961181A1257004E5527 /* XMLHTTPRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7904181A1257004E5527 /* XMLHTTPRequest.cpp */; };\n\t\t1A2C7962181A1257004E5527 /* XMLHTTPRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C7904181A1257004E5527 /* XMLHTTPRequest.cpp */; };\n\t\t1A2C7963181A1257004E5527 /* XMLHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7905181A1257004E5527 /* XMLHTTPRequest.h */; };\n\t\t1A2C7964181A1257004E5527 /* XMLHTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C7905181A1257004E5527 /* XMLHTTPRequest.h */; };\n\t\t1A2C7965181A1257004E5527 /* ScriptingCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C790A181A1257004E5527 /* ScriptingCore.cpp */; };\n\t\t1A2C7966181A1257004E5527 /* ScriptingCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2C790A181A1257004E5527 /* ScriptingCore.cpp */; };\n\t\t1A2C7967181A1257004E5527 /* ScriptingCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C790B181A1257004E5527 /* ScriptingCore.h */; };\n\t\t1A2C7968181A1257004E5527 /* ScriptingCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C790B181A1257004E5527 /* ScriptingCore.h */; };\n\t\t1A2C7969181A1257004E5527 /* spidermonkey_specifics.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C790C181A1257004E5527 /* spidermonkey_specifics.h */; };\n\t\t1A2C796A181A1257004E5527 /* spidermonkey_specifics.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C790C181A1257004E5527 /* spidermonkey_specifics.h */; };\n\t\t1A3B1F78180E88C300497A22 /* CCBProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F4E180E88C200497A22 /* CCBProxy.cpp */; };\n\t\t1A3B1F79180E88C300497A22 /* CCBProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F4E180E88C200497A22 /* CCBProxy.cpp */; };\n\t\t1A3B1F7A180E88C300497A22 /* CCBProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F4F180E88C200497A22 /* CCBProxy.h */; };\n\t\t1A3B1F7B180E88C300497A22 /* CCBProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F4F180E88C200497A22 /* CCBProxy.h */; };\n\t\t1A3B1F7C180E88C300497A22 /* CCLuaBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F50180E88C200497A22 /* CCLuaBridge.cpp */; };\n\t\t1A3B1F7D180E88C300497A22 /* CCLuaBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F50180E88C200497A22 /* CCLuaBridge.cpp */; };\n\t\t1A3B1F7E180E88C300497A22 /* CCLuaBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F51180E88C200497A22 /* CCLuaBridge.h */; };\n\t\t1A3B1F7F180E88C300497A22 /* CCLuaBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F51180E88C200497A22 /* CCLuaBridge.h */; };\n\t\t1A3B1F80180E88C300497A22 /* CCLuaEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F52180E88C200497A22 /* CCLuaEngine.cpp */; };\n\t\t1A3B1F81180E88C300497A22 /* CCLuaEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F52180E88C200497A22 /* CCLuaEngine.cpp */; };\n\t\t1A3B1F82180E88C300497A22 /* CCLuaEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F53180E88C200497A22 /* CCLuaEngine.h */; };\n\t\t1A3B1F83180E88C300497A22 /* CCLuaEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F53180E88C200497A22 /* CCLuaEngine.h */; };\n\t\t1A3B1F84180E88C300497A22 /* CCLuaStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F54180E88C200497A22 /* CCLuaStack.cpp */; };\n\t\t1A3B1F85180E88C300497A22 /* CCLuaStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F54180E88C200497A22 /* CCLuaStack.cpp */; };\n\t\t1A3B1F86180E88C300497A22 /* CCLuaStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F55180E88C200497A22 /* CCLuaStack.h */; };\n\t\t1A3B1F87180E88C300497A22 /* CCLuaStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F55180E88C200497A22 /* CCLuaStack.h */; };\n\t\t1A3B1F88180E88C300497A22 /* CCLuaValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F56180E88C300497A22 /* CCLuaValue.cpp */; };\n\t\t1A3B1F89180E88C300497A22 /* CCLuaValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F56180E88C300497A22 /* CCLuaValue.cpp */; };\n\t\t1A3B1F8A180E88C300497A22 /* CCLuaValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F57180E88C300497A22 /* CCLuaValue.h */; };\n\t\t1A3B1F8B180E88C300497A22 /* CCLuaValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F57180E88C300497A22 /* CCLuaValue.h */; };\n\t\t1A3B1F8C180E88C300497A22 /* Cocos2dxLuaLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F58180E88C300497A22 /* Cocos2dxLuaLoader.cpp */; };\n\t\t1A3B1F8D180E88C300497A22 /* Cocos2dxLuaLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F58180E88C300497A22 /* Cocos2dxLuaLoader.cpp */; };\n\t\t1A3B1F8E180E88C300497A22 /* Cocos2dxLuaLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F59180E88C300497A22 /* Cocos2dxLuaLoader.h */; };\n\t\t1A3B1F8F180E88C300497A22 /* Cocos2dxLuaLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F59180E88C300497A22 /* Cocos2dxLuaLoader.h */; };\n\t\t1A3B1F90180E88C300497A22 /* lua_cocos2dx_deprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F5D180E88C300497A22 /* lua_cocos2dx_deprecated.cpp */; };\n\t\t1A3B1F91180E88C300497A22 /* lua_cocos2dx_deprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F5D180E88C300497A22 /* lua_cocos2dx_deprecated.cpp */; };\n\t\t1A3B1F92180E88C300497A22 /* lua_cocos2dx_deprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F5E180E88C300497A22 /* lua_cocos2dx_deprecated.h */; };\n\t\t1A3B1F93180E88C300497A22 /* lua_cocos2dx_deprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F5E180E88C300497A22 /* lua_cocos2dx_deprecated.h */; };\n\t\t1A3B1F94180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F5F180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp */; };\n\t\t1A3B1F95180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F5F180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp */; };\n\t\t1A3B1F96180E88C300497A22 /* lua_cocos2dx_extension_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F60180E88C300497A22 /* lua_cocos2dx_extension_manual.h */; };\n\t\t1A3B1F97180E88C300497A22 /* lua_cocos2dx_extension_manual.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F60180E88C300497A22 /* lua_cocos2dx_extension_manual.h */; };\n\t\t1A3B1F98180E88C300497A22 /* lua_cocos2dx_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F61180E88C300497A22 /* lua_cocos2dx_manual.cpp */; };\n\t\t1A3B1F99180E88C300497A22 /* lua_cocos2dx_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F61180E88C300497A22 /* lua_cocos2dx_manual.cpp */; };\n\t\t1A3B1F9A180E88C300497A22 /* lua_cocos2dx_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F62180E88C300497A22 /* lua_cocos2dx_manual.hpp */; };\n\t\t1A3B1F9B180E88C300497A22 /* lua_cocos2dx_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F62180E88C300497A22 /* lua_cocos2dx_manual.hpp */; };\n\t\t1A3B1F9C180E88C300497A22 /* Lua_web_socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F63180E88C300497A22 /* Lua_web_socket.cpp */; };\n\t\t1A3B1F9D180E88C300497A22 /* Lua_web_socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F63180E88C300497A22 /* Lua_web_socket.cpp */; };\n\t\t1A3B1F9E180E88C300497A22 /* Lua_web_socket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F64180E88C300497A22 /* Lua_web_socket.h */; };\n\t\t1A3B1F9F180E88C300497A22 /* Lua_web_socket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F64180E88C300497A22 /* Lua_web_socket.h */; };\n\t\t1A3B1FA0180E88C300497A22 /* LuaBasicConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F65180E88C300497A22 /* LuaBasicConversions.cpp */; };\n\t\t1A3B1FA1180E88C300497A22 /* LuaBasicConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F65180E88C300497A22 /* LuaBasicConversions.cpp */; };\n\t\t1A3B1FA2180E88C300497A22 /* LuaBasicConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F66180E88C300497A22 /* LuaBasicConversions.h */; };\n\t\t1A3B1FA3180E88C300497A22 /* LuaBasicConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F66180E88C300497A22 /* LuaBasicConversions.h */; };\n\t\t1A3B1FA4180E88C300497A22 /* LuaOpengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F67180E88C300497A22 /* LuaOpengl.cpp */; };\n\t\t1A3B1FA5180E88C300497A22 /* LuaOpengl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F67180E88C300497A22 /* LuaOpengl.cpp */; };\n\t\t1A3B1FA6180E88C300497A22 /* LuaOpengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F68180E88C300497A22 /* LuaOpengl.h */; };\n\t\t1A3B1FA7180E88C300497A22 /* LuaOpengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F68180E88C300497A22 /* LuaOpengl.h */; };\n\t\t1A3B1FA8180E88C300497A22 /* LuaScriptHandlerMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F69180E88C300497A22 /* LuaScriptHandlerMgr.cpp */; };\n\t\t1A3B1FA9180E88C300497A22 /* LuaScriptHandlerMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F69180E88C300497A22 /* LuaScriptHandlerMgr.cpp */; };\n\t\t1A3B1FAA180E88C300497A22 /* LuaScriptHandlerMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F6A180E88C300497A22 /* LuaScriptHandlerMgr.h */; };\n\t\t1A3B1FAB180E88C300497A22 /* LuaScriptHandlerMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F6A180E88C300497A22 /* LuaScriptHandlerMgr.h */; };\n\t\t1A3B1FB6180E88C300497A22 /* CCLuaObjcBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F74180E88C300497A22 /* CCLuaObjcBridge.h */; };\n\t\t1A3B1FB7180E88C300497A22 /* CCLuaObjcBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F74180E88C300497A22 /* CCLuaObjcBridge.h */; };\n\t\t1A3B1FB8180E88C300497A22 /* CCLuaObjcBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F75180E88C300497A22 /* CCLuaObjcBridge.mm */; };\n\t\t1A3B1FB9180E88C300497A22 /* CCLuaObjcBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F75180E88C300497A22 /* CCLuaObjcBridge.mm */; };\n\t\t1A3B1FBA180E88C300497A22 /* tolua_fix.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F76180E88C300497A22 /* tolua_fix.c */; };\n\t\t1A3B1FBB180E88C300497A22 /* tolua_fix.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F76180E88C300497A22 /* tolua_fix.c */; };\n\t\t1A3B1FBC180E88C300497A22 /* tolua_fix.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F77180E88C300497A22 /* tolua_fix.h */; };\n\t\t1A3B1FBD180E88C300497A22 /* tolua_fix.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3B1F77180E88C300497A22 /* tolua_fix.h */; };\n\t\t1A570061180BC5A10088DEC7 /* CCAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570047180BC5A10088DEC7 /* CCAction.cpp */; };\n\t\t1A570062180BC5A10088DEC7 /* CCAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570047180BC5A10088DEC7 /* CCAction.cpp */; };\n\t\t1A570063180BC5A10088DEC7 /* CCAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570048180BC5A10088DEC7 /* CCAction.h */; };\n\t\t1A570064180BC5A10088DEC7 /* CCAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570048180BC5A10088DEC7 /* CCAction.h */; };\n\t\t1A570065180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570049180BC5A10088DEC7 /* CCActionCamera.cpp */; };\n\t\t1A570066180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570049180BC5A10088DEC7 /* CCActionCamera.cpp */; };\n\t\t1A570067180BC5A10088DEC7 /* CCActionCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57004A180BC5A10088DEC7 /* CCActionCamera.h */; };\n\t\t1A570068180BC5A10088DEC7 /* CCActionCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57004A180BC5A10088DEC7 /* CCActionCamera.h */; };\n\t\t1A570069180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57004B180BC5A10088DEC7 /* CCActionCatmullRom.cpp */; };\n\t\t1A57006A180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57004B180BC5A10088DEC7 /* CCActionCatmullRom.cpp */; };\n\t\t1A57006B180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57004C180BC5A10088DEC7 /* CCActionCatmullRom.h */; };\n\t\t1A57006C180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57004C180BC5A10088DEC7 /* CCActionCatmullRom.h */; };\n\t\t1A57006D180BC5A10088DEC7 /* CCActionEase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57004D180BC5A10088DEC7 /* CCActionEase.cpp */; };\n\t\t1A57006E180BC5A10088DEC7 /* CCActionEase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57004D180BC5A10088DEC7 /* CCActionEase.cpp */; };\n\t\t1A57006F180BC5A10088DEC7 /* CCActionEase.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57004E180BC5A10088DEC7 /* CCActionEase.h */; };\n\t\t1A570070180BC5A10088DEC7 /* CCActionEase.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57004E180BC5A10088DEC7 /* CCActionEase.h */; };\n\t\t1A570071180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57004F180BC5A10088DEC7 /* CCActionGrid.cpp */; };\n\t\t1A570072180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57004F180BC5A10088DEC7 /* CCActionGrid.cpp */; };\n\t\t1A570073180BC5A10088DEC7 /* CCActionGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570050180BC5A10088DEC7 /* CCActionGrid.h */; };\n\t\t1A570074180BC5A10088DEC7 /* CCActionGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570050180BC5A10088DEC7 /* CCActionGrid.h */; };\n\t\t1A570075180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570051180BC5A10088DEC7 /* CCActionGrid3D.cpp */; };\n\t\t1A570076180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570051180BC5A10088DEC7 /* CCActionGrid3D.cpp */; };\n\t\t1A570077180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570052180BC5A10088DEC7 /* CCActionGrid3D.h */; };\n\t\t1A570078180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570052180BC5A10088DEC7 /* CCActionGrid3D.h */; };\n\t\t1A570079180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570053180BC5A10088DEC7 /* CCActionInstant.cpp */; };\n\t\t1A57007A180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570053180BC5A10088DEC7 /* CCActionInstant.cpp */; };\n\t\t1A57007B180BC5A10088DEC7 /* CCActionInstant.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570054180BC5A10088DEC7 /* CCActionInstant.h */; };\n\t\t1A57007C180BC5A10088DEC7 /* CCActionInstant.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570054180BC5A10088DEC7 /* CCActionInstant.h */; };\n\t\t1A57007D180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570055180BC5A10088DEC7 /* CCActionInterval.cpp */; };\n\t\t1A57007E180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570055180BC5A10088DEC7 /* CCActionInterval.cpp */; };\n\t\t1A57007F180BC5A10088DEC7 /* CCActionInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570056180BC5A10088DEC7 /* CCActionInterval.h */; };\n\t\t1A570080180BC5A10088DEC7 /* CCActionInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570056180BC5A10088DEC7 /* CCActionInterval.h */; };\n\t\t1A570081180BC5A10088DEC7 /* CCActionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570057180BC5A10088DEC7 /* CCActionManager.cpp */; };\n\t\t1A570082180BC5A10088DEC7 /* CCActionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570057180BC5A10088DEC7 /* CCActionManager.cpp */; };\n\t\t1A570083180BC5A10088DEC7 /* CCActionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570058180BC5A10088DEC7 /* CCActionManager.h */; };\n\t\t1A570084180BC5A10088DEC7 /* CCActionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570058180BC5A10088DEC7 /* CCActionManager.h */; };\n\t\t1A570085180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570059180BC5A10088DEC7 /* CCActionPageTurn3D.cpp */; };\n\t\t1A570086180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570059180BC5A10088DEC7 /* CCActionPageTurn3D.cpp */; };\n\t\t1A570087180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57005A180BC5A10088DEC7 /* CCActionPageTurn3D.h */; };\n\t\t1A570088180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57005A180BC5A10088DEC7 /* CCActionPageTurn3D.h */; };\n\t\t1A570089180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57005B180BC5A10088DEC7 /* CCActionProgressTimer.cpp */; };\n\t\t1A57008A180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57005B180BC5A10088DEC7 /* CCActionProgressTimer.cpp */; };\n\t\t1A57008B180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57005C180BC5A10088DEC7 /* CCActionProgressTimer.h */; };\n\t\t1A57008C180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57005C180BC5A10088DEC7 /* CCActionProgressTimer.h */; };\n\t\t1A57008D180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57005D180BC5A10088DEC7 /* CCActionTiledGrid.cpp */; };\n\t\t1A57008E180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57005D180BC5A10088DEC7 /* CCActionTiledGrid.cpp */; };\n\t\t1A57008F180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57005E180BC5A10088DEC7 /* CCActionTiledGrid.h */; };\n\t\t1A570090180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57005E180BC5A10088DEC7 /* CCActionTiledGrid.h */; };\n\t\t1A570091180BC5A10088DEC7 /* CCActionTween.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57005F180BC5A10088DEC7 /* CCActionTween.cpp */; };\n\t\t1A570092180BC5A10088DEC7 /* CCActionTween.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57005F180BC5A10088DEC7 /* CCActionTween.cpp */; };\n\t\t1A570093180BC5A10088DEC7 /* CCActionTween.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570060180BC5A10088DEC7 /* CCActionTween.h */; };\n\t\t1A570094180BC5A10088DEC7 /* CCActionTween.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570060180BC5A10088DEC7 /* CCActionTween.h */; };\n\t\t1A570098180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570096180BC5C10088DEC7 /* CCAtlasNode.cpp */; };\n\t\t1A570099180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570096180BC5C10088DEC7 /* CCAtlasNode.cpp */; };\n\t\t1A57009A180BC5C10088DEC7 /* CCAtlasNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570097180BC5C10088DEC7 /* CCAtlasNode.h */; };\n\t\t1A57009B180BC5C10088DEC7 /* CCAtlasNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570097180BC5C10088DEC7 /* CCAtlasNode.h */; };\n\t\t1A57009E180BC5D20088DEC7 /* CCNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57009C180BC5D20088DEC7 /* CCNode.cpp */; };\n\t\t1A57009F180BC5D20088DEC7 /* CCNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57009C180BC5D20088DEC7 /* CCNode.cpp */; };\n\t\t1A5700A0180BC5D20088DEC7 /* CCNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57009D180BC5D20088DEC7 /* CCNode.h */; };\n\t\t1A5700A1180BC5D20088DEC7 /* CCNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57009D180BC5D20088DEC7 /* CCNode.h */; };\n\t\t1A5700C5180BC6060088DEC7 /* atitc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A3180BC6060088DEC7 /* atitc.cpp */; };\n\t\t1A5700C6180BC6060088DEC7 /* atitc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A3180BC6060088DEC7 /* atitc.cpp */; };\n\t\t1A5700C7180BC6060088DEC7 /* atitc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700A4180BC6060088DEC7 /* atitc.h */; };\n\t\t1A5700C8180BC6060088DEC7 /* atitc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700A4180BC6060088DEC7 /* atitc.h */; };\n\t\t1A5700C9180BC6060088DEC7 /* CCAffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A5180BC6060088DEC7 /* CCAffineTransform.cpp */; };\n\t\t1A5700CA180BC6060088DEC7 /* CCAffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A5180BC6060088DEC7 /* CCAffineTransform.cpp */; };\n\t\t1A5700CB180BC6060088DEC7 /* CCAffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700A6180BC6060088DEC7 /* CCAffineTransform.h */; };\n\t\t1A5700CC180BC6060088DEC7 /* CCAffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700A6180BC6060088DEC7 /* CCAffineTransform.h */; };\n\t\t1A5700CD180BC6060088DEC7 /* CCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A7180BC6060088DEC7 /* CCArray.cpp */; };\n\t\t1A5700CE180BC6060088DEC7 /* CCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A7180BC6060088DEC7 /* CCArray.cpp */; };\n\t\t1A5700CF180BC6060088DEC7 /* CCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700A8180BC6060088DEC7 /* CCArray.h */; };\n\t\t1A5700D0180BC6060088DEC7 /* CCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700A8180BC6060088DEC7 /* CCArray.h */; };\n\t\t1A5700D1180BC6060088DEC7 /* CCAutoreleasePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A9180BC6060088DEC7 /* CCAutoreleasePool.cpp */; };\n\t\t1A5700D2180BC6060088DEC7 /* CCAutoreleasePool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700A9180BC6060088DEC7 /* CCAutoreleasePool.cpp */; };\n\t\t1A5700D3180BC6060088DEC7 /* CCAutoreleasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AA180BC6060088DEC7 /* CCAutoreleasePool.h */; };\n\t\t1A5700D4180BC6060088DEC7 /* CCAutoreleasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AA180BC6060088DEC7 /* CCAutoreleasePool.h */; };\n\t\t1A5700D5180BC6060088DEC7 /* CCBool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AB180BC6060088DEC7 /* CCBool.h */; };\n\t\t1A5700D6180BC6060088DEC7 /* CCBool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AB180BC6060088DEC7 /* CCBool.h */; };\n\t\t1A5700D7180BC6060088DEC7 /* CCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700AC180BC6060088DEC7 /* CCData.cpp */; };\n\t\t1A5700D8180BC6060088DEC7 /* CCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700AC180BC6060088DEC7 /* CCData.cpp */; };\n\t\t1A5700D9180BC6060088DEC7 /* CCData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AD180BC6060088DEC7 /* CCData.h */; };\n\t\t1A5700DA180BC6060088DEC7 /* CCData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AD180BC6060088DEC7 /* CCData.h */; };\n\t\t1A5700DB180BC6060088DEC7 /* CCDataVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700AE180BC6060088DEC7 /* CCDataVisitor.cpp */; };\n\t\t1A5700DC180BC6060088DEC7 /* CCDataVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700AE180BC6060088DEC7 /* CCDataVisitor.cpp */; };\n\t\t1A5700DD180BC6060088DEC7 /* CCDataVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AF180BC6060088DEC7 /* CCDataVisitor.h */; };\n\t\t1A5700DE180BC6060088DEC7 /* CCDataVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700AF180BC6060088DEC7 /* CCDataVisitor.h */; };\n\t\t1A5700DF180BC6060088DEC7 /* CCDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B0180BC6060088DEC7 /* CCDictionary.cpp */; };\n\t\t1A5700E0180BC6060088DEC7 /* CCDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B0180BC6060088DEC7 /* CCDictionary.cpp */; };\n\t\t1A5700E1180BC6060088DEC7 /* CCDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B1180BC6060088DEC7 /* CCDictionary.h */; };\n\t\t1A5700E2180BC6060088DEC7 /* CCDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B1180BC6060088DEC7 /* CCDictionary.h */; };\n\t\t1A5700E3180BC6060088DEC7 /* CCDouble.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B2180BC6060088DEC7 /* CCDouble.h */; };\n\t\t1A5700E4180BC6060088DEC7 /* CCDouble.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B2180BC6060088DEC7 /* CCDouble.h */; };\n\t\t1A5700E5180BC6060088DEC7 /* CCFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B3180BC6060088DEC7 /* CCFloat.h */; };\n\t\t1A5700E6180BC6060088DEC7 /* CCFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B3180BC6060088DEC7 /* CCFloat.h */; };\n\t\t1A5700E7180BC6060088DEC7 /* CCGeometry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B4180BC6060088DEC7 /* CCGeometry.cpp */; };\n\t\t1A5700E8180BC6060088DEC7 /* CCGeometry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B4180BC6060088DEC7 /* CCGeometry.cpp */; };\n\t\t1A5700E9180BC6060088DEC7 /* CCGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B5180BC6060088DEC7 /* CCGeometry.h */; };\n\t\t1A5700EA180BC6060088DEC7 /* CCGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B5180BC6060088DEC7 /* CCGeometry.h */; };\n\t\t1A5700EB180BC6060088DEC7 /* CCInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B6180BC6060088DEC7 /* CCInteger.h */; };\n\t\t1A5700EC180BC6060088DEC7 /* CCInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B6180BC6060088DEC7 /* CCInteger.h */; };\n\t\t1A5700ED180BC6060088DEC7 /* CCNS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B7180BC6060088DEC7 /* CCNS.cpp */; };\n\t\t1A5700EE180BC6060088DEC7 /* CCNS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B7180BC6060088DEC7 /* CCNS.cpp */; };\n\t\t1A5700EF180BC6060088DEC7 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B8180BC6060088DEC7 /* CCNS.h */; };\n\t\t1A5700F0180BC6060088DEC7 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700B8180BC6060088DEC7 /* CCNS.h */; };\n\t\t1A5700F1180BC6060088DEC7 /* CCObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B9180BC6060088DEC7 /* CCObject.cpp */; };\n\t\t1A5700F2180BC6060088DEC7 /* CCObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700B9180BC6060088DEC7 /* CCObject.cpp */; };\n\t\t1A5700F3180BC6060088DEC7 /* CCObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BA180BC6060088DEC7 /* CCObject.h */; };\n\t\t1A5700F4180BC6060088DEC7 /* CCObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BA180BC6060088DEC7 /* CCObject.h */; };\n\t\t1A5700F5180BC6060088DEC7 /* CCPlatformConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BB180BC6060088DEC7 /* CCPlatformConfig.h */; };\n\t\t1A5700F6180BC6060088DEC7 /* CCPlatformConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BB180BC6060088DEC7 /* CCPlatformConfig.h */; };\n\t\t1A5700F7180BC6060088DEC7 /* CCPlatformMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BC180BC6060088DEC7 /* CCPlatformMacros.h */; };\n\t\t1A5700F8180BC6060088DEC7 /* CCPlatformMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BC180BC6060088DEC7 /* CCPlatformMacros.h */; };\n\t\t1A5700F9180BC6060088DEC7 /* CCSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700BD180BC6060088DEC7 /* CCSet.cpp */; };\n\t\t1A5700FA180BC6060088DEC7 /* CCSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700BD180BC6060088DEC7 /* CCSet.cpp */; };\n\t\t1A5700FB180BC6060088DEC7 /* CCSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BE180BC6060088DEC7 /* CCSet.h */; };\n\t\t1A5700FC180BC6060088DEC7 /* CCSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700BE180BC6060088DEC7 /* CCSet.h */; };\n\t\t1A5700FD180BC6060088DEC7 /* CCString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700BF180BC6060088DEC7 /* CCString.cpp */; };\n\t\t1A5700FE180BC6060088DEC7 /* CCString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700BF180BC6060088DEC7 /* CCString.cpp */; };\n\t\t1A5700FF180BC6060088DEC7 /* CCString.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700C0180BC6060088DEC7 /* CCString.h */; };\n\t\t1A570100180BC6060088DEC7 /* CCString.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700C0180BC6060088DEC7 /* CCString.h */; };\n\t\t1A570101180BC6060088DEC7 /* etc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700C1180BC6060088DEC7 /* etc1.cpp */; };\n\t\t1A570102180BC6060088DEC7 /* etc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700C1180BC6060088DEC7 /* etc1.cpp */; };\n\t\t1A570103180BC6060088DEC7 /* etc1.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700C2180BC6060088DEC7 /* etc1.h */; };\n\t\t1A570104180BC6060088DEC7 /* etc1.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700C2180BC6060088DEC7 /* etc1.h */; };\n\t\t1A570105180BC6060088DEC7 /* s3tc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700C3180BC6060088DEC7 /* s3tc.cpp */; };\n\t\t1A570106180BC6060088DEC7 /* s3tc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5700C3180BC6060088DEC7 /* s3tc.cpp */; };\n\t\t1A570107180BC6060088DEC7 /* s3tc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700C4180BC6060088DEC7 /* s3tc.h */; };\n\t\t1A570108180BC6060088DEC7 /* s3tc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5700C4180BC6060088DEC7 /* s3tc.h */; };\n\t\t1A57010E180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57010A180BC8ED0088DEC7 /* CCDrawingPrimitives.cpp */; };\n\t\t1A57010F180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57010A180BC8ED0088DEC7 /* CCDrawingPrimitives.cpp */; };\n\t\t1A570110180BC8EE0088DEC7 /* CCDrawingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57010B180BC8EE0088DEC7 /* CCDrawingPrimitives.h */; };\n\t\t1A570111180BC8EE0088DEC7 /* CCDrawingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57010B180BC8EE0088DEC7 /* CCDrawingPrimitives.h */; };\n\t\t1A570112180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57010C180BC8EE0088DEC7 /* CCDrawNode.cpp */; };\n\t\t1A570113180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57010C180BC8EE0088DEC7 /* CCDrawNode.cpp */; };\n\t\t1A570114180BC8EE0088DEC7 /* CCDrawNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57010D180BC8EE0088DEC7 /* CCDrawNode.h */; };\n\t\t1A570115180BC8EE0088DEC7 /* CCDrawNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57010D180BC8EE0088DEC7 /* CCDrawNode.h */; };\n\t\t1A57011B180BC90D0088DEC7 /* CCGrabber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570117180BC90D0088DEC7 /* CCGrabber.cpp */; };\n\t\t1A57011C180BC90D0088DEC7 /* CCGrabber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570117180BC90D0088DEC7 /* CCGrabber.cpp */; };\n\t\t1A57011D180BC90D0088DEC7 /* CCGrabber.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570118180BC90D0088DEC7 /* CCGrabber.h */; };\n\t\t1A57011E180BC90D0088DEC7 /* CCGrabber.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570118180BC90D0088DEC7 /* CCGrabber.h */; };\n\t\t1A57011F180BC90D0088DEC7 /* CCGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570119180BC90D0088DEC7 /* CCGrid.cpp */; };\n\t\t1A570120180BC90D0088DEC7 /* CCGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570119180BC90D0088DEC7 /* CCGrid.cpp */; };\n\t\t1A570121180BC90D0088DEC7 /* CCGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57011A180BC90D0088DEC7 /* CCGrid.h */; };\n\t\t1A570122180BC90D0088DEC7 /* CCGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57011A180BC90D0088DEC7 /* CCGrid.h */; };\n\t\t1A57013A180BC9460088DEC7 /* CCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570124180BC9460088DEC7 /* CCEvent.cpp */; };\n\t\t1A57013B180BC9460088DEC7 /* CCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570124180BC9460088DEC7 /* CCEvent.cpp */; };\n\t\t1A57013C180BC9460088DEC7 /* CCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570125180BC9460088DEC7 /* CCEvent.h */; };\n\t\t1A57013D180BC9460088DEC7 /* CCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570125180BC9460088DEC7 /* CCEvent.h */; };\n\t\t1A57013E180BC9460088DEC7 /* CCEventAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570126180BC9460088DEC7 /* CCEventAcceleration.cpp */; };\n\t\t1A57013F180BC9460088DEC7 /* CCEventAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570126180BC9460088DEC7 /* CCEventAcceleration.cpp */; };\n\t\t1A570140180BC9460088DEC7 /* CCEventAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570127180BC9460088DEC7 /* CCEventAcceleration.h */; };\n\t\t1A570141180BC9460088DEC7 /* CCEventAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570127180BC9460088DEC7 /* CCEventAcceleration.h */; };\n\t\t1A570142180BC9460088DEC7 /* CCEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570128180BC9460088DEC7 /* CCEventCustom.cpp */; };\n\t\t1A570143180BC9460088DEC7 /* CCEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570128180BC9460088DEC7 /* CCEventCustom.cpp */; };\n\t\t1A570144180BC9460088DEC7 /* CCEventCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570129180BC9460088DEC7 /* CCEventCustom.h */; };\n\t\t1A570145180BC9460088DEC7 /* CCEventCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570129180BC9460088DEC7 /* CCEventCustom.h */; };\n\t\t1A570146180BC9460088DEC7 /* CCEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57012A180BC9460088DEC7 /* CCEventDispatcher.cpp */; };\n\t\t1A570147180BC9460088DEC7 /* CCEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57012A180BC9460088DEC7 /* CCEventDispatcher.cpp */; };\n\t\t1A570148180BC9460088DEC7 /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57012B180BC9460088DEC7 /* CCEventDispatcher.h */; };\n\t\t1A570149180BC9460088DEC7 /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57012B180BC9460088DEC7 /* CCEventDispatcher.h */; };\n\t\t1A57014A180BC9460088DEC7 /* CCEventKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57012C180BC9460088DEC7 /* CCEventKeyboard.cpp */; };\n\t\t1A57014B180BC9460088DEC7 /* CCEventKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57012C180BC9460088DEC7 /* CCEventKeyboard.cpp */; };\n\t\t1A57014C180BC9460088DEC7 /* CCEventKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57012D180BC9460088DEC7 /* CCEventKeyboard.h */; };\n\t\t1A57014D180BC9460088DEC7 /* CCEventKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57012D180BC9460088DEC7 /* CCEventKeyboard.h */; };\n\t\t1A57014E180BC9460088DEC7 /* CCEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57012E180BC9460088DEC7 /* CCEventListener.cpp */; };\n\t\t1A57014F180BC9460088DEC7 /* CCEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57012E180BC9460088DEC7 /* CCEventListener.cpp */; };\n\t\t1A570150180BC9460088DEC7 /* CCEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57012F180BC9460088DEC7 /* CCEventListener.h */; };\n\t\t1A570151180BC9460088DEC7 /* CCEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57012F180BC9460088DEC7 /* CCEventListener.h */; };\n\t\t1A570152180BC9460088DEC7 /* CCEventListenerAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570130180BC9460088DEC7 /* CCEventListenerAcceleration.cpp */; };\n\t\t1A570153180BC9460088DEC7 /* CCEventListenerAcceleration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570130180BC9460088DEC7 /* CCEventListenerAcceleration.cpp */; };\n\t\t1A570154180BC9460088DEC7 /* CCEventListenerAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570131180BC9460088DEC7 /* CCEventListenerAcceleration.h */; };\n\t\t1A570155180BC9460088DEC7 /* CCEventListenerAcceleration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570131180BC9460088DEC7 /* CCEventListenerAcceleration.h */; };\n\t\t1A570156180BC9460088DEC7 /* CCEventListenerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570132180BC9460088DEC7 /* CCEventListenerCustom.cpp */; };\n\t\t1A570157180BC9460088DEC7 /* CCEventListenerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570132180BC9460088DEC7 /* CCEventListenerCustom.cpp */; };\n\t\t1A570158180BC9460088DEC7 /* CCEventListenerCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570133180BC9460088DEC7 /* CCEventListenerCustom.h */; };\n\t\t1A570159180BC9460088DEC7 /* CCEventListenerCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570133180BC9460088DEC7 /* CCEventListenerCustom.h */; };\n\t\t1A57015A180BC9460088DEC7 /* CCEventListenerKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570134180BC9460088DEC7 /* CCEventListenerKeyboard.cpp */; };\n\t\t1A57015B180BC9460088DEC7 /* CCEventListenerKeyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570134180BC9460088DEC7 /* CCEventListenerKeyboard.cpp */; };\n\t\t1A57015C180BC9460088DEC7 /* CCEventListenerKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570135180BC9460088DEC7 /* CCEventListenerKeyboard.h */; };\n\t\t1A57015D180BC9460088DEC7 /* CCEventListenerKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570135180BC9460088DEC7 /* CCEventListenerKeyboard.h */; };\n\t\t1A57015E180BC9460088DEC7 /* CCEventListenerTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570136180BC9460088DEC7 /* CCEventListenerTouch.cpp */; };\n\t\t1A57015F180BC9460088DEC7 /* CCEventListenerTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570136180BC9460088DEC7 /* CCEventListenerTouch.cpp */; };\n\t\t1A570160180BC9460088DEC7 /* CCEventListenerTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570137180BC9460088DEC7 /* CCEventListenerTouch.h */; };\n\t\t1A570161180BC9460088DEC7 /* CCEventListenerTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570137180BC9460088DEC7 /* CCEventListenerTouch.h */; };\n\t\t1A570162180BC9460088DEC7 /* CCEventTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570138180BC9460088DEC7 /* CCEventTouch.cpp */; };\n\t\t1A570163180BC9460088DEC7 /* CCEventTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570138180BC9460088DEC7 /* CCEventTouch.cpp */; };\n\t\t1A570164180BC9460088DEC7 /* CCEventTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570139180BC9460088DEC7 /* CCEventTouch.h */; };\n\t\t1A570165180BC9460088DEC7 /* CCEventTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570139180BC9460088DEC7 /* CCEventTouch.h */; };\n\t\t1A57019D180BCB590088DEC7 /* CCFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570182180BCB590088DEC7 /* CCFont.cpp */; };\n\t\t1A57019E180BCB590088DEC7 /* CCFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570182180BCB590088DEC7 /* CCFont.cpp */; };\n\t\t1A57019F180BCB590088DEC7 /* CCFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570183180BCB590088DEC7 /* CCFont.h */; };\n\t\t1A5701A0180BCB590088DEC7 /* CCFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570183180BCB590088DEC7 /* CCFont.h */; };\n\t\t1A5701A1180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570184180BCB590088DEC7 /* CCFontAtlas.cpp */; };\n\t\t1A5701A2180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570184180BCB590088DEC7 /* CCFontAtlas.cpp */; };\n\t\t1A5701A3180BCB590088DEC7 /* CCFontAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570185180BCB590088DEC7 /* CCFontAtlas.h */; };\n\t\t1A5701A4180BCB590088DEC7 /* CCFontAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570185180BCB590088DEC7 /* CCFontAtlas.h */; };\n\t\t1A5701A5180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570186180BCB590088DEC7 /* CCFontAtlasCache.cpp */; };\n\t\t1A5701A6180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570186180BCB590088DEC7 /* CCFontAtlasCache.cpp */; };\n\t\t1A5701A7180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570187180BCB590088DEC7 /* CCFontAtlasCache.h */; };\n\t\t1A5701A8180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570187180BCB590088DEC7 /* CCFontAtlasCache.h */; };\n\t\t1A5701B1180BCB590088DEC7 /* CCFontFNT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57018C180BCB590088DEC7 /* CCFontFNT.cpp */; };\n\t\t1A5701B2180BCB590088DEC7 /* CCFontFNT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57018C180BCB590088DEC7 /* CCFontFNT.cpp */; };\n\t\t1A5701B3180BCB590088DEC7 /* CCFontFNT.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57018D180BCB590088DEC7 /* CCFontFNT.h */; };\n\t\t1A5701B4180BCB590088DEC7 /* CCFontFNT.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57018D180BCB590088DEC7 /* CCFontFNT.h */; };\n\t\t1A5701B5180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57018E180BCB590088DEC7 /* CCFontFreeType.cpp */; };\n\t\t1A5701B6180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57018E180BCB590088DEC7 /* CCFontFreeType.cpp */; };\n\t\t1A5701B7180BCB5A0088DEC7 /* CCFontFreeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57018F180BCB590088DEC7 /* CCFontFreeType.h */; };\n\t\t1A5701B8180BCB5A0088DEC7 /* CCFontFreeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57018F180BCB590088DEC7 /* CCFontFreeType.h */; };\n\t\t1A5701B9180BCB5A0088DEC7 /* CCLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570190180BCB590088DEC7 /* CCLabel.cpp */; };\n\t\t1A5701BA180BCB5A0088DEC7 /* CCLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570190180BCB590088DEC7 /* CCLabel.cpp */; };\n\t\t1A5701BB180BCB5A0088DEC7 /* CCLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570191180BCB590088DEC7 /* CCLabel.h */; };\n\t\t1A5701BC180BCB5A0088DEC7 /* CCLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570191180BCB590088DEC7 /* CCLabel.h */; };\n\t\t1A5701BD180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570192180BCB590088DEC7 /* CCLabelAtlas.cpp */; };\n\t\t1A5701BE180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570192180BCB590088DEC7 /* CCLabelAtlas.cpp */; };\n\t\t1A5701BF180BCB5A0088DEC7 /* CCLabelAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570193180BCB590088DEC7 /* CCLabelAtlas.h */; };\n\t\t1A5701C0180BCB5A0088DEC7 /* CCLabelAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570193180BCB590088DEC7 /* CCLabelAtlas.h */; };\n\t\t1A5701C1180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570194180BCB590088DEC7 /* CCLabelBMFont.cpp */; };\n\t\t1A5701C2180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570194180BCB590088DEC7 /* CCLabelBMFont.cpp */; };\n\t\t1A5701C3180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570195180BCB590088DEC7 /* CCLabelBMFont.h */; };\n\t\t1A5701C4180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570195180BCB590088DEC7 /* CCLabelBMFont.h */; };\n\t\t1A5701C7180BCB5A0088DEC7 /* CCLabelTextFormatter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570197180BCB590088DEC7 /* CCLabelTextFormatter.cpp */; };\n\t\t1A5701C8180BCB5A0088DEC7 /* CCLabelTextFormatter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570197180BCB590088DEC7 /* CCLabelTextFormatter.cpp */; };\n\t\t1A5701C9180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570198180BCB590088DEC7 /* CCLabelTextFormatter.h */; };\n\t\t1A5701CA180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570198180BCB590088DEC7 /* CCLabelTextFormatter.h */; };\n\t\t1A5701CB180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570199180BCB590088DEC7 /* CCLabelTTF.cpp */; };\n\t\t1A5701CC180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570199180BCB590088DEC7 /* CCLabelTTF.cpp */; };\n\t\t1A5701CD180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57019A180BCB590088DEC7 /* CCLabelTTF.h */; };\n\t\t1A5701CE180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57019A180BCB590088DEC7 /* CCLabelTTF.h */; };\n\t\t1A5701DE180BCB8C0088DEC7 /* CCLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701D4180BCB8C0088DEC7 /* CCLayer.cpp */; };\n\t\t1A5701DF180BCB8C0088DEC7 /* CCLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701D4180BCB8C0088DEC7 /* CCLayer.cpp */; };\n\t\t1A5701E0180BCB8C0088DEC7 /* CCLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701D5180BCB8C0088DEC7 /* CCLayer.h */; };\n\t\t1A5701E1180BCB8C0088DEC7 /* CCLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701D5180BCB8C0088DEC7 /* CCLayer.h */; };\n\t\t1A5701E2180BCB8C0088DEC7 /* CCScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701D6180BCB8C0088DEC7 /* CCScene.cpp */; };\n\t\t1A5701E3180BCB8C0088DEC7 /* CCScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701D6180BCB8C0088DEC7 /* CCScene.cpp */; };\n\t\t1A5701E4180BCB8C0088DEC7 /* CCScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701D7180BCB8C0088DEC7 /* CCScene.h */; };\n\t\t1A5701E5180BCB8C0088DEC7 /* CCScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701D7180BCB8C0088DEC7 /* CCScene.h */; };\n\t\t1A5701E6180BCB8C0088DEC7 /* CCTransition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701D8180BCB8C0088DEC7 /* CCTransition.cpp */; };\n\t\t1A5701E7180BCB8C0088DEC7 /* CCTransition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701D8180BCB8C0088DEC7 /* CCTransition.cpp */; };\n\t\t1A5701E8180BCB8C0088DEC7 /* CCTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701D9180BCB8C0088DEC7 /* CCTransition.h */; };\n\t\t1A5701E9180BCB8C0088DEC7 /* CCTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701D9180BCB8C0088DEC7 /* CCTransition.h */; };\n\t\t1A5701EA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701DA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp */; };\n\t\t1A5701EB180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701DA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp */; };\n\t\t1A5701EC180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701DB180BCB8C0088DEC7 /* CCTransitionPageTurn.h */; };\n\t\t1A5701ED180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701DB180BCB8C0088DEC7 /* CCTransitionPageTurn.h */; };\n\t\t1A5701EE180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701DC180BCB8C0088DEC7 /* CCTransitionProgress.cpp */; };\n\t\t1A5701EF180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701DC180BCB8C0088DEC7 /* CCTransitionProgress.cpp */; };\n\t\t1A5701F0180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701DD180BCB8C0088DEC7 /* CCTransitionProgress.h */; };\n\t\t1A5701F1180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701DD180BCB8C0088DEC7 /* CCTransitionProgress.h */; };\n\t\t1A5701F7180BCBAD0088DEC7 /* CCMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701F3180BCBAD0088DEC7 /* CCMenu.cpp */; };\n\t\t1A5701F8180BCBAD0088DEC7 /* CCMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701F3180BCBAD0088DEC7 /* CCMenu.cpp */; };\n\t\t1A5701F9180BCBAD0088DEC7 /* CCMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701F4180BCBAD0088DEC7 /* CCMenu.h */; };\n\t\t1A5701FA180BCBAD0088DEC7 /* CCMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701F4180BCBAD0088DEC7 /* CCMenu.h */; };\n\t\t1A5701FB180BCBAD0088DEC7 /* CCMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701F5180BCBAD0088DEC7 /* CCMenuItem.cpp */; };\n\t\t1A5701FC180BCBAD0088DEC7 /* CCMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5701F5180BCBAD0088DEC7 /* CCMenuItem.cpp */; };\n\t\t1A5701FD180BCBAD0088DEC7 /* CCMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701F6180BCBAD0088DEC7 /* CCMenuItem.h */; };\n\t\t1A5701FE180BCBAD0088DEC7 /* CCMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5701F6180BCBAD0088DEC7 /* CCMenuItem.h */; };\n\t\t1A570202180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570200180BCBD40088DEC7 /* CCClippingNode.cpp */; };\n\t\t1A570203180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570200180BCBD40088DEC7 /* CCClippingNode.cpp */; };\n\t\t1A570204180BCBD40088DEC7 /* CCClippingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570201180BCBD40088DEC7 /* CCClippingNode.h */; };\n\t\t1A570205180BCBD40088DEC7 /* CCClippingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570201180BCBD40088DEC7 /* CCClippingNode.h */; };\n\t\t1A570208180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570206180BCBDF0088DEC7 /* CCMotionStreak.cpp */; };\n\t\t1A570209180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570206180BCBDF0088DEC7 /* CCMotionStreak.cpp */; };\n\t\t1A57020A180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570207180BCBDF0088DEC7 /* CCMotionStreak.h */; };\n\t\t1A57020B180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570207180BCBDF0088DEC7 /* CCMotionStreak.h */; };\n\t\t1A570210180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57020C180BCBF40088DEC7 /* CCProgressTimer.cpp */; };\n\t\t1A570211180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57020C180BCBF40088DEC7 /* CCProgressTimer.cpp */; };\n\t\t1A570212180BCBF40088DEC7 /* CCProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57020D180BCBF40088DEC7 /* CCProgressTimer.h */; };\n\t\t1A570213180BCBF40088DEC7 /* CCProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57020D180BCBF40088DEC7 /* CCProgressTimer.h */; };\n\t\t1A570214180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57020E180BCBF40088DEC7 /* CCRenderTexture.cpp */; };\n\t\t1A570215180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57020E180BCBF40088DEC7 /* CCRenderTexture.cpp */; };\n\t\t1A570216180BCBF40088DEC7 /* CCRenderTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57020F180BCBF40088DEC7 /* CCRenderTexture.h */; };\n\t\t1A570217180BCBF40088DEC7 /* CCRenderTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57020F180BCBF40088DEC7 /* CCRenderTexture.h */; };\n\t\t1A570221180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570219180BCC1A0088DEC7 /* CCParticleBatchNode.cpp */; };\n\t\t1A570222180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570219180BCC1A0088DEC7 /* CCParticleBatchNode.cpp */; };\n\t\t1A570223180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57021A180BCC1A0088DEC7 /* CCParticleBatchNode.h */; };\n\t\t1A570224180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57021A180BCC1A0088DEC7 /* CCParticleBatchNode.h */; };\n\t\t1A570225180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57021B180BCC1A0088DEC7 /* CCParticleExamples.cpp */; };\n\t\t1A570226180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57021B180BCC1A0088DEC7 /* CCParticleExamples.cpp */; };\n\t\t1A570227180BCC1A0088DEC7 /* CCParticleExamples.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57021C180BCC1A0088DEC7 /* CCParticleExamples.h */; };\n\t\t1A570228180BCC1A0088DEC7 /* CCParticleExamples.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57021C180BCC1A0088DEC7 /* CCParticleExamples.h */; };\n\t\t1A570229180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57021D180BCC1A0088DEC7 /* CCParticleSystem.cpp */; };\n\t\t1A57022A180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57021D180BCC1A0088DEC7 /* CCParticleSystem.cpp */; };\n\t\t1A57022B180BCC1A0088DEC7 /* CCParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57021E180BCC1A0088DEC7 /* CCParticleSystem.h */; };\n\t\t1A57022C180BCC1A0088DEC7 /* CCParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57021E180BCC1A0088DEC7 /* CCParticleSystem.h */; };\n\t\t1A57022D180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57021F180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp */; };\n\t\t1A57022E180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57021F180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp */; };\n\t\t1A57022F180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570220180BCC1A0088DEC7 /* CCParticleSystemQuad.h */; };\n\t\t1A570230180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570220180BCC1A0088DEC7 /* CCParticleSystemQuad.h */; };\n\t\t1A570234180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */; };\n\t\t1A570235180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */; };\n\t\t1A570236180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */; };\n\t\t1A570237180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */; };\n\t\t1A57024D180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570239180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h */; };\n\t\t1A57024E180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570239180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h */; };\n\t\t1A57024F180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023A180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h */; };\n\t\t1A570250180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023A180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h */; };\n\t\t1A570251180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023B180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h */; };\n\t\t1A570252180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023B180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h */; };\n\t\t1A570253180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023C180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h */; };\n\t\t1A570254180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023C180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h */; };\n\t\t1A570255180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023D180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h */; };\n\t\t1A570256180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023D180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h */; };\n\t\t1A570257180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023E180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h */; };\n\t\t1A570258180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023E180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h */; };\n\t\t1A570259180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023F180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h */; };\n\t\t1A57025A180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57023F180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h */; };\n\t\t1A57025B180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570240180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h */; };\n\t\t1A57025C180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570240180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h */; };\n\t\t1A57025D180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570241180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h */; };\n\t\t1A57025E180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570241180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h */; };\n\t\t1A57025F180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570242180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h */; };\n\t\t1A570260180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570242180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h */; };\n\t\t1A570261180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570243180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h */; };\n\t\t1A570262180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570243180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h */; };\n\t\t1A570263180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570244180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h */; };\n\t\t1A570264180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570244180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h */; };\n\t\t1A570265180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570245180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h */; };\n\t\t1A570266180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570245180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h */; };\n\t\t1A570267180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570246180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h */; };\n\t\t1A570268180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570246180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h */; };\n\t\t1A570269180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570247180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h */; };\n\t\t1A57026A180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570247180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h */; };\n\t\t1A57026B180BCC6F0088DEC7 /* CCShaderCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570248180BCC6F0088DEC7 /* CCShaderCache.cpp */; };\n\t\t1A57026C180BCC6F0088DEC7 /* CCShaderCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570248180BCC6F0088DEC7 /* CCShaderCache.cpp */; };\n\t\t1A57026D180BCC6F0088DEC7 /* CCShaderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570249180BCC6F0088DEC7 /* CCShaderCache.h */; };\n\t\t1A57026E180BCC6F0088DEC7 /* CCShaderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570249180BCC6F0088DEC7 /* CCShaderCache.h */; };\n\t\t1A57026F180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57024A180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h */; };\n\t\t1A570270180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57024A180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h */; };\n\t\t1A570271180BCC6F0088DEC7 /* ccShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57024B180BCC6F0088DEC7 /* ccShaders.cpp */; };\n\t\t1A570272180BCC6F0088DEC7 /* ccShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57024B180BCC6F0088DEC7 /* ccShaders.cpp */; };\n\t\t1A570273180BCC6F0088DEC7 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57024C180BCC6F0088DEC7 /* ccShaders.h */; };\n\t\t1A570274180BCC6F0088DEC7 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57024C180BCC6F0088DEC7 /* ccShaders.h */; };\n\t\t1A57027E180BCC900088DEC7 /* CCSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570276180BCC900088DEC7 /* CCSprite.cpp */; };\n\t\t1A57027F180BCC900088DEC7 /* CCSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570276180BCC900088DEC7 /* CCSprite.cpp */; };\n\t\t1A570280180BCC900088DEC7 /* CCSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570277180BCC900088DEC7 /* CCSprite.h */; };\n\t\t1A570281180BCC900088DEC7 /* CCSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570277180BCC900088DEC7 /* CCSprite.h */; };\n\t\t1A570282180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570278180BCC900088DEC7 /* CCSpriteBatchNode.cpp */; };\n\t\t1A570283180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570278180BCC900088DEC7 /* CCSpriteBatchNode.cpp */; };\n\t\t1A570284180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570279180BCC900088DEC7 /* CCSpriteBatchNode.h */; };\n\t\t1A570285180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570279180BCC900088DEC7 /* CCSpriteBatchNode.h */; };\n\t\t1A570286180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57027A180BCC900088DEC7 /* CCSpriteFrame.cpp */; };\n\t\t1A570287180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57027A180BCC900088DEC7 /* CCSpriteFrame.cpp */; };\n\t\t1A570288180BCC900088DEC7 /* CCSpriteFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57027B180BCC900088DEC7 /* CCSpriteFrame.h */; };\n\t\t1A570289180BCC900088DEC7 /* CCSpriteFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57027B180BCC900088DEC7 /* CCSpriteFrame.h */; };\n\t\t1A57028A180BCC900088DEC7 /* CCSpriteFrameCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57027C180BCC900088DEC7 /* CCSpriteFrameCache.cpp */; };\n\t\t1A57028B180BCC900088DEC7 /* CCSpriteFrameCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57027C180BCC900088DEC7 /* CCSpriteFrameCache.cpp */; };\n\t\t1A57028C180BCC900088DEC7 /* CCSpriteFrameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57027D180BCC900088DEC7 /* CCSpriteFrameCache.h */; };\n\t\t1A57028D180BCC900088DEC7 /* CCSpriteFrameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57027D180BCC900088DEC7 /* CCSpriteFrameCache.h */; };\n\t\t1A570292180BCCAB0088DEC7 /* CCAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57028E180BCCAB0088DEC7 /* CCAnimation.cpp */; };\n\t\t1A570293180BCCAB0088DEC7 /* CCAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57028E180BCCAB0088DEC7 /* CCAnimation.cpp */; };\n\t\t1A570294180BCCAB0088DEC7 /* CCAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57028F180BCCAB0088DEC7 /* CCAnimation.h */; };\n\t\t1A570295180BCCAB0088DEC7 /* CCAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57028F180BCCAB0088DEC7 /* CCAnimation.h */; };\n\t\t1A570296180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570290180BCCAB0088DEC7 /* CCAnimationCache.cpp */; };\n\t\t1A570297180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570290180BCCAB0088DEC7 /* CCAnimationCache.cpp */; };\n\t\t1A570298180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570291180BCCAB0088DEC7 /* CCAnimationCache.h */; };\n\t\t1A570299180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570291180BCCAB0088DEC7 /* CCAnimationCache.h */; };\n\t\t1A57029D180BCD890088DEC7 /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57029B180BCD890088DEC7 /* base64.cpp */; };\n\t\t1A57029E180BCD890088DEC7 /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57029B180BCD890088DEC7 /* base64.cpp */; };\n\t\t1A57029F180BCD890088DEC7 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57029C180BCD890088DEC7 /* base64.h */; };\n\t\t1A5702A0180BCD890088DEC7 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57029C180BCD890088DEC7 /* base64.h */; };\n\t\t1A5702A3180BCD980088DEC7 /* CCNotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702A1180BCD980088DEC7 /* CCNotificationCenter.cpp */; };\n\t\t1A5702A4180BCD980088DEC7 /* CCNotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702A1180BCD980088DEC7 /* CCNotificationCenter.cpp */; };\n\t\t1A5702A5180BCD980088DEC7 /* CCNotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702A2180BCD980088DEC7 /* CCNotificationCenter.h */; };\n\t\t1A5702A6180BCD980088DEC7 /* CCNotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702A2180BCD980088DEC7 /* CCNotificationCenter.h */; };\n\t\t1A5702A9180BCDAA0088DEC7 /* CCProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702A7180BCDAA0088DEC7 /* CCProfiling.cpp */; };\n\t\t1A5702AA180BCDAA0088DEC7 /* CCProfiling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702A7180BCDAA0088DEC7 /* CCProfiling.cpp */; };\n\t\t1A5702AB180BCDAA0088DEC7 /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702A8180BCDAA0088DEC7 /* CCProfiling.h */; };\n\t\t1A5702AC180BCDAA0088DEC7 /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702A8180BCDAA0088DEC7 /* CCProfiling.h */; };\n\t\t1A5702AF180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */; };\n\t\t1A5702B0180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */; };\n\t\t1A5702B1180BCDBC0088DEC7 /* ccUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */; };\n\t\t1A5702B2180BCDBC0088DEC7 /* ccUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */; };\n\t\t1A5702B5180BCDF40088DEC7 /* CCVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */; };\n\t\t1A5702B6180BCDF40088DEC7 /* CCVertex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */; };\n\t\t1A5702B7180BCDF40088DEC7 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B4180BCDF40088DEC7 /* CCVertex.h */; };\n\t\t1A5702B8180BCDF40088DEC7 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B4180BCDF40088DEC7 /* CCVertex.h */; };\n\t\t1A5702BA180BCDFC0088DEC7 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B9180BCDFC0088DEC7 /* ccUtils.h */; };\n\t\t1A5702BB180BCDFC0088DEC7 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702B9180BCDFC0088DEC7 /* ccUtils.h */; };\n\t\t1A5702C0180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */; };\n\t\t1A5702C1180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */; };\n\t\t1A5702C2180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */; };\n\t\t1A5702C3180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */; };\n\t\t1A5702C4180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */; };\n\t\t1A5702C5180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */; };\n\t\t1A5702C8180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */; };\n\t\t1A5702C9180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */; };\n\t\t1A5702CA180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */; };\n\t\t1A5702CB180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */; };\n\t\t1A5702D3180BCE570088DEC7 /* CCTexture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */; };\n\t\t1A5702D4180BCE570088DEC7 /* CCTexture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */; };\n\t\t1A5702D5180BCE570088DEC7 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702CE180BCE570088DEC7 /* CCTexture2D.h */; };\n\t\t1A5702D6180BCE570088DEC7 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702CE180BCE570088DEC7 /* CCTexture2D.h */; };\n\t\t1A5702D7180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */; };\n\t\t1A5702D8180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */; };\n\t\t1A5702D9180BCE570088DEC7 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */; };\n\t\t1A5702DA180BCE570088DEC7 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */; };\n\t\t1A5702DB180BCE570088DEC7 /* CCTextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */; };\n\t\t1A5702DC180BCE570088DEC7 /* CCTextureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */; };\n\t\t1A5702DD180BCE570088DEC7 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D2180BCE570088DEC7 /* CCTextureCache.h */; };\n\t\t1A5702DE180BCE570088DEC7 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702D2180BCE570088DEC7 /* CCTextureCache.h */; };\n\t\t1A5702EA180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E0180BCE750088DEC7 /* CCTileMapAtlas.cpp */; };\n\t\t1A5702EB180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E0180BCE750088DEC7 /* CCTileMapAtlas.cpp */; };\n\t\t1A5702EC180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E1180BCE750088DEC7 /* CCTileMapAtlas.h */; };\n\t\t1A5702ED180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E1180BCE750088DEC7 /* CCTileMapAtlas.h */; };\n\t\t1A5702EE180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E2180BCE750088DEC7 /* CCTMXLayer.cpp */; };\n\t\t1A5702EF180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E2180BCE750088DEC7 /* CCTMXLayer.cpp */; };\n\t\t1A5702F0180BCE750088DEC7 /* CCTMXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E3180BCE750088DEC7 /* CCTMXLayer.h */; };\n\t\t1A5702F1180BCE750088DEC7 /* CCTMXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E3180BCE750088DEC7 /* CCTMXLayer.h */; };\n\t\t1A5702F2180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E4180BCE750088DEC7 /* CCTMXObjectGroup.cpp */; };\n\t\t1A5702F3180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E4180BCE750088DEC7 /* CCTMXObjectGroup.cpp */; };\n\t\t1A5702F4180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E5180BCE750088DEC7 /* CCTMXObjectGroup.h */; };\n\t\t1A5702F5180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E5180BCE750088DEC7 /* CCTMXObjectGroup.h */; };\n\t\t1A5702F6180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E6180BCE750088DEC7 /* CCTMXTiledMap.cpp */; };\n\t\t1A5702F7180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E6180BCE750088DEC7 /* CCTMXTiledMap.cpp */; };\n\t\t1A5702F8180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E7180BCE750088DEC7 /* CCTMXTiledMap.h */; };\n\t\t1A5702F9180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E7180BCE750088DEC7 /* CCTMXTiledMap.h */; };\n\t\t1A5702FA180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E8180BCE750088DEC7 /* CCTMXXMLParser.cpp */; };\n\t\t1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702E8180BCE750088DEC7 /* CCTMXXMLParser.cpp */; };\n\t\t1A5702FC180BCE750088DEC7 /* CCTMXXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E9180BCE750088DEC7 /* CCTMXXMLParser.h */; };\n\t\t1A5702FD180BCE750088DEC7 /* CCTMXXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702E9180BCE750088DEC7 /* CCTMXXMLParser.h */; };\n\t\t1A570300180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702FE180BCE890088DEC7 /* CCParallaxNode.cpp */; };\n\t\t1A570301180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5702FE180BCE890088DEC7 /* CCParallaxNode.cpp */; };\n\t\t1A570302180BCE890088DEC7 /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702FF180BCE890088DEC7 /* CCParallaxNode.h */; };\n\t\t1A570303180BCE890088DEC7 /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A5702FF180BCE890088DEC7 /* CCParallaxNode.h */; };\n\t\t1A570305180BCED90088DEC7 /* ccUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570304180BCED90088DEC7 /* ccUtils.cpp */; };\n\t\t1A570306180BCED90088DEC7 /* ccUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570304180BCED90088DEC7 /* ccUtils.cpp */; };\n\t\t1A57030C180BCF190088DEC7 /* CCComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570308180BCF190088DEC7 /* CCComponent.cpp */; };\n\t\t1A57030D180BCF190088DEC7 /* CCComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570308180BCF190088DEC7 /* CCComponent.cpp */; };\n\t\t1A57030E180BCF190088DEC7 /* CCComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570309180BCF190088DEC7 /* CCComponent.h */; };\n\t\t1A57030F180BCF190088DEC7 /* CCComponent.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570309180BCF190088DEC7 /* CCComponent.h */; };\n\t\t1A570310180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */; };\n\t\t1A570311180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */; };\n\t\t1A570312180BCF190088DEC7 /* CCComponentContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57030B180BCF190088DEC7 /* CCComponentContainer.h */; };\n\t\t1A570313180BCF190088DEC7 /* CCComponentContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57030B180BCF190088DEC7 /* CCComponentContainer.h */; };\n\t\t1A570319180BCF430088DEC7 /* ccCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570315180BCF430088DEC7 /* ccCArray.cpp */; };\n\t\t1A57031A180BCF430088DEC7 /* ccCArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570315180BCF430088DEC7 /* ccCArray.cpp */; };\n\t\t1A57031B180BCF430088DEC7 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570316180BCF430088DEC7 /* ccCArray.h */; };\n\t\t1A57031C180BCF430088DEC7 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570316180BCF430088DEC7 /* ccCArray.h */; };\n\t\t1A57031D180BCF430088DEC7 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570317180BCF430088DEC7 /* uthash.h */; };\n\t\t1A57031E180BCF430088DEC7 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570317180BCF430088DEC7 /* uthash.h */; };\n\t\t1A57031F180BCF430088DEC7 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570318180BCF430088DEC7 /* utlist.h */; };\n\t\t1A570320180BCF430088DEC7 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570318180BCF430088DEC7 /* utlist.h */; };\n\t\t1A570324180BCF660088DEC7 /* TGAlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570322180BCF660088DEC7 /* TGAlib.cpp */; };\n\t\t1A570325180BCF660088DEC7 /* TGAlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570322180BCF660088DEC7 /* TGAlib.cpp */; };\n\t\t1A570326180BCF660088DEC7 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570323180BCF660088DEC7 /* TGAlib.h */; };\n\t\t1A570327180BCF660088DEC7 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570323180BCF660088DEC7 /* TGAlib.h */; };\n\t\t1A57032F180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */; };\n\t\t1A570330180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */; };\n\t\t1A570331180BCFD50088DEC7 /* CCUserDefault.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57032C180BCFD50088DEC7 /* CCUserDefault.h */; };\n\t\t1A570332180BCFD50088DEC7 /* CCUserDefault.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57032C180BCFD50088DEC7 /* CCUserDefault.h */; };\n\t\t1A570333180BCFD50088DEC7 /* CCUserDefault.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */; };\n\t\t1A570334180BCFD50088DEC7 /* CCUserDefault.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */; };\n\t\t1A570335180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */; };\n\t\t1A570336180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */; };\n\t\t1A57033A180BCFFA0088DEC7 /* ZipUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570338180BCFFA0088DEC7 /* ZipUtils.cpp */; };\n\t\t1A57033B180BCFFA0088DEC7 /* ZipUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570338180BCFFA0088DEC7 /* ZipUtils.cpp */; };\n\t\t1A57033C180BCFFA0088DEC7 /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570339180BCFFA0088DEC7 /* ZipUtils.h */; };\n\t\t1A57033D180BCFFA0088DEC7 /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570339180BCFFA0088DEC7 /* ZipUtils.h */; };\n\t\t1A570347180BD0850088DEC7 /* libglfw3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A570346180BD0850088DEC7 /* libglfw3.a */; };\n\t\t1A57034B180BD09B0088DEC7 /* tinyxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570349180BD09B0088DEC7 /* tinyxml2.cpp */; };\n\t\t1A57034C180BD09B0088DEC7 /* tinyxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570349180BD09B0088DEC7 /* tinyxml2.cpp */; };\n\t\t1A57034D180BD09B0088DEC7 /* tinyxml2.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57034A180BD09B0088DEC7 /* tinyxml2.h */; };\n\t\t1A57034E180BD09B0088DEC7 /* tinyxml2.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A57034A180BD09B0088DEC7 /* tinyxml2.h */; };\n\t\t1A570354180BD0B00088DEC7 /* ioapi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570350180BD0B00088DEC7 /* ioapi.cpp */; };\n\t\t1A570355180BD0B00088DEC7 /* ioapi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570350180BD0B00088DEC7 /* ioapi.cpp */; };\n\t\t1A570356180BD0B00088DEC7 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570351180BD0B00088DEC7 /* ioapi.h */; };\n\t\t1A570357180BD0B00088DEC7 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570351180BD0B00088DEC7 /* ioapi.h */; };\n\t\t1A570358180BD0B00088DEC7 /* unzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570352180BD0B00088DEC7 /* unzip.cpp */; };\n\t\t1A570359180BD0B00088DEC7 /* unzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570352180BD0B00088DEC7 /* unzip.cpp */; };\n\t\t1A57035A180BD0B00088DEC7 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570353180BD0B00088DEC7 /* unzip.h */; };\n\t\t1A57035B180BD0B00088DEC7 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570353180BD0B00088DEC7 /* unzip.h */; };\n\t\t1A570361180BD1080088DEC7 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A570360180BD1080088DEC7 /* libpng.a */; };\n\t\t1A570364180BD1120088DEC7 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A570363180BD1120088DEC7 /* libpng.a */; };\n\t\t1A570378180BD1B40088DEC7 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A570377180BD1B40088DEC7 /* libjpeg.a */; };\n\t\t1A57037B180BD1C90088DEC7 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A57037A180BD1C90088DEC7 /* libjpeg.a */; };\n\t\t1A5703A1180BD22C0088DEC7 /* libtiff.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A5703A0180BD22C0088DEC7 /* libtiff.a */; };\n\t\t1A5703A4180BD2350088DEC7 /* libtiff.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A5703A3180BD2350088DEC7 /* libtiff.a */; };\n\t\t1A5703B8180BD2780088DEC7 /* libwebp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A5703B7180BD2780088DEC7 /* libwebp.a */; };\n\t\t1A5703BB180BD2800088DEC7 /* libwebp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A5703BA180BD2800088DEC7 /* libwebp.a */; };\n\t\t1A57052B180BD31F0088DEC7 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A57052A180BD31F0088DEC7 /* libfreetype.a */; };\n\t\t1A57052E180BD3280088DEC7 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A57052D180BD3280088DEC7 /* libfreetype.a */; };\n\t\t1A570533180BD9500088DEC7 /* CCGLProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57052F180BD9500088DEC7 /* CCGLProgram.cpp */; };\n\t\t1A570534180BD9500088DEC7 /* CCGLProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A57052F180BD9500088DEC7 /* CCGLProgram.cpp */; };\n\t\t1A570535180BD9500088DEC7 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570530180BD9500088DEC7 /* CCGLProgram.h */; };\n\t\t1A570536180BD9500088DEC7 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570530180BD9500088DEC7 /* CCGLProgram.h */; };\n\t\t1A570537180BD9500088DEC7 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570531180BD9500088DEC7 /* ccGLStateCache.cpp */; };\n\t\t1A570538180BD9500088DEC7 /* ccGLStateCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570531180BD9500088DEC7 /* ccGLStateCache.cpp */; };\n\t\t1A570539180BD9500088DEC7 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570532180BD9500088DEC7 /* ccGLStateCache.h */; };\n\t\t1A57053A180BD9500088DEC7 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570532180BD9500088DEC7 /* ccGLStateCache.h */; };\n\t\t1A570546180BD9C40088DEC7 /* CCTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570544180BD9C40088DEC7 /* CCTouch.cpp */; };\n\t\t1A570547180BD9C40088DEC7 /* CCTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A570544180BD9C40088DEC7 /* CCTouch.cpp */; };\n\t\t1A570548180BD9C40088DEC7 /* CCTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570545180BD9C40088DEC7 /* CCTouch.h */; };\n\t\t1A570549180BD9C40088DEC7 /* CCTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A570545180BD9C40088DEC7 /* CCTouch.h */; };\n\t\t1A85BA0D1845F31700260FC0 /* CCVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A85BA0C1845F31700260FC0 /* CCVector.h */; };\n\t\t1A85BA0E1845F31700260FC0 /* CCVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A85BA0C1845F31700260FC0 /* CCVector.h */; };\n\t\t1A8C5646180E8D0D00EF57C3 /* tolua++.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C563F180E8D0D00EF57C3 /* tolua++.h */; };\n\t\t1A8C5647180E8D0D00EF57C3 /* tolua++.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C563F180E8D0D00EF57C3 /* tolua++.h */; };\n\t\t1A8C5648180E8D0D00EF57C3 /* tolua_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5640180E8D0D00EF57C3 /* tolua_event.c */; };\n\t\t1A8C5649180E8D0D00EF57C3 /* tolua_event.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5640180E8D0D00EF57C3 /* tolua_event.c */; };\n\t\t1A8C564A180E8D0D00EF57C3 /* tolua_event.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5641180E8D0D00EF57C3 /* tolua_event.h */; };\n\t\t1A8C564B180E8D0D00EF57C3 /* tolua_event.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5641180E8D0D00EF57C3 /* tolua_event.h */; };\n\t\t1A8C564C180E8D0D00EF57C3 /* tolua_is.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5642180E8D0D00EF57C3 /* tolua_is.c */; };\n\t\t1A8C564D180E8D0D00EF57C3 /* tolua_is.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5642180E8D0D00EF57C3 /* tolua_is.c */; };\n\t\t1A8C564E180E8D0D00EF57C3 /* tolua_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5643180E8D0D00EF57C3 /* tolua_map.c */; };\n\t\t1A8C564F180E8D0D00EF57C3 /* tolua_map.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5643180E8D0D00EF57C3 /* tolua_map.c */; };\n\t\t1A8C5650180E8D0D00EF57C3 /* tolua_push.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5644180E8D0D00EF57C3 /* tolua_push.c */; };\n\t\t1A8C5651180E8D0D00EF57C3 /* tolua_push.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5644180E8D0D00EF57C3 /* tolua_push.c */; };\n\t\t1A8C5652180E8D0D00EF57C3 /* tolua_to.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5645180E8D0D00EF57C3 /* tolua_to.c */; };\n\t\t1A8C5653180E8D0D00EF57C3 /* tolua_to.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5645180E8D0D00EF57C3 /* tolua_to.c */; };\n\t\t1A8C58EC180E92CC00EF57C3 /* CocosGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58BF180E92CC00EF57C3 /* CocosGUI.cpp */; };\n\t\t1A8C58ED180E92CC00EF57C3 /* CocosGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58BF180E92CC00EF57C3 /* CocosGUI.cpp */; };\n\t\t1A8C58EE180E92CC00EF57C3 /* CocosGUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C0180E92CC00EF57C3 /* CocosGUI.h */; };\n\t\t1A8C58EF180E92CC00EF57C3 /* CocosGUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C0180E92CC00EF57C3 /* CocosGUI.h */; };\n\t\t1A8C58F0180E92CC00EF57C3 /* UILayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C1180E92CC00EF57C3 /* UILayout.cpp */; };\n\t\t1A8C58F1180E92CC00EF57C3 /* UILayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C1180E92CC00EF57C3 /* UILayout.cpp */; };\n\t\t1A8C58F2180E92CC00EF57C3 /* UILayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C2180E92CC00EF57C3 /* UILayout.h */; };\n\t\t1A8C58F3180E92CC00EF57C3 /* UILayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C2180E92CC00EF57C3 /* UILayout.h */; };\n\t\t1A8C58F4180E92CC00EF57C3 /* UILayoutParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C3180E92CC00EF57C3 /* UILayoutParameter.cpp */; };\n\t\t1A8C58F5180E92CC00EF57C3 /* UILayoutParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C3180E92CC00EF57C3 /* UILayoutParameter.cpp */; };\n\t\t1A8C58F6180E92CC00EF57C3 /* UILayoutParameter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C4180E92CC00EF57C3 /* UILayoutParameter.h */; };\n\t\t1A8C58F7180E92CC00EF57C3 /* UILayoutParameter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C4180E92CC00EF57C3 /* UILayoutParameter.h */; };\n\t\t1A8C58F8180E92CC00EF57C3 /* UIButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C5180E92CC00EF57C3 /* UIButton.cpp */; };\n\t\t1A8C58F9180E92CC00EF57C3 /* UIButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C5180E92CC00EF57C3 /* UIButton.cpp */; };\n\t\t1A8C58FA180E92CC00EF57C3 /* UIButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C6180E92CC00EF57C3 /* UIButton.h */; };\n\t\t1A8C58FB180E92CC00EF57C3 /* UIButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C6180E92CC00EF57C3 /* UIButton.h */; };\n\t\t1A8C58FC180E92CC00EF57C3 /* UICheckBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C7180E92CC00EF57C3 /* UICheckBox.cpp */; };\n\t\t1A8C58FD180E92CC00EF57C3 /* UICheckBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58C7180E92CC00EF57C3 /* UICheckBox.cpp */; };\n\t\t1A8C58FE180E92CC00EF57C3 /* UICheckBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C8180E92CC00EF57C3 /* UICheckBox.h */; };\n\t\t1A8C58FF180E92CC00EF57C3 /* UICheckBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58C8180E92CC00EF57C3 /* UICheckBox.h */; };\n\t\t1A8C5904180E92CC00EF57C3 /* UIHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58CB180E92CC00EF57C3 /* UIHelper.cpp */; };\n\t\t1A8C5905180E92CC00EF57C3 /* UIHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58CB180E92CC00EF57C3 /* UIHelper.cpp */; };\n\t\t1A8C5906180E92CC00EF57C3 /* UIHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58CC180E92CC00EF57C3 /* UIHelper.h */; };\n\t\t1A8C5907180E92CC00EF57C3 /* UIHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58CC180E92CC00EF57C3 /* UIHelper.h */; };\n\t\t1A8C5908180E92CC00EF57C3 /* UIImageView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58CD180E92CC00EF57C3 /* UIImageView.cpp */; };\n\t\t1A8C5909180E92CC00EF57C3 /* UIImageView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58CD180E92CC00EF57C3 /* UIImageView.cpp */; };\n\t\t1A8C590A180E92CC00EF57C3 /* UIImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58CE180E92CC00EF57C3 /* UIImageView.h */; };\n\t\t1A8C590B180E92CC00EF57C3 /* UIImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58CE180E92CC00EF57C3 /* UIImageView.h */; };\n\t\t1A8C5910180E92CC00EF57C3 /* UIText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D1180E92CC00EF57C3 /* UIText.cpp */; };\n\t\t1A8C5911180E92CC00EF57C3 /* UIText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D1180E92CC00EF57C3 /* UIText.cpp */; };\n\t\t1A8C5912180E92CC00EF57C3 /* UIText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58D2180E92CC00EF57C3 /* UIText.h */; };\n\t\t1A8C5913180E92CC00EF57C3 /* UIText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58D2180E92CC00EF57C3 /* UIText.h */; };\n\t\t1A8C5914180E92CC00EF57C3 /* UITextAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D3180E92CC00EF57C3 /* UITextAtlas.cpp */; };\n\t\t1A8C5915180E92CC00EF57C3 /* UITextAtlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D3180E92CC00EF57C3 /* UITextAtlas.cpp */; };\n\t\t1A8C5916180E92CC00EF57C3 /* UITextAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58D4180E92CC00EF57C3 /* UITextAtlas.h */; };\n\t\t1A8C5917180E92CC00EF57C3 /* UITextAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58D4180E92CC00EF57C3 /* UITextAtlas.h */; };\n\t\t1A8C5918180E92CC00EF57C3 /* UITextBMFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D5180E92CC00EF57C3 /* UITextBMFont.cpp */; };\n\t\t1A8C5919180E92CC00EF57C3 /* UITextBMFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D5180E92CC00EF57C3 /* UITextBMFont.cpp */; };\n\t\t1A8C591A180E92CC00EF57C3 /* UITextBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58D6180E92CC00EF57C3 /* UITextBMFont.h */; };\n\t\t1A8C591B180E92CC00EF57C3 /* UITextBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58D6180E92CC00EF57C3 /* UITextBMFont.h */; };\n\t\t1A8C5920180E92CC00EF57C3 /* UILayoutDefine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D9180E92CC00EF57C3 /* UILayoutDefine.cpp */; };\n\t\t1A8C5921180E92CC00EF57C3 /* UILayoutDefine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58D9180E92CC00EF57C3 /* UILayoutDefine.cpp */; };\n\t\t1A8C5922180E92CC00EF57C3 /* UILayoutDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58DA180E92CC00EF57C3 /* UILayoutDefine.h */; };\n\t\t1A8C5923180E92CC00EF57C3 /* UILayoutDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58DA180E92CC00EF57C3 /* UILayoutDefine.h */; };\n\t\t1A8C5928180E92CC00EF57C3 /* UILoadingBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58DD180E92CC00EF57C3 /* UILoadingBar.cpp */; };\n\t\t1A8C5929180E92CC00EF57C3 /* UILoadingBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58DD180E92CC00EF57C3 /* UILoadingBar.cpp */; };\n\t\t1A8C592A180E92CC00EF57C3 /* UILoadingBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58DE180E92CC00EF57C3 /* UILoadingBar.h */; };\n\t\t1A8C592B180E92CC00EF57C3 /* UILoadingBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58DE180E92CC00EF57C3 /* UILoadingBar.h */; };\n\t\t1A8C592C180E92CC00EF57C3 /* UIPageView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58DF180E92CC00EF57C3 /* UIPageView.cpp */; };\n\t\t1A8C592D180E92CC00EF57C3 /* UIPageView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58DF180E92CC00EF57C3 /* UIPageView.cpp */; };\n\t\t1A8C592E180E92CC00EF57C3 /* UIPageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E0180E92CC00EF57C3 /* UIPageView.h */; };\n\t\t1A8C592F180E92CC00EF57C3 /* UIPageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E0180E92CC00EF57C3 /* UIPageView.h */; };\n\t\t1A8C5934180E92CC00EF57C3 /* UIScrollInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E3180E92CC00EF57C3 /* UIScrollInterface.h */; };\n\t\t1A8C5935180E92CC00EF57C3 /* UIScrollInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E3180E92CC00EF57C3 /* UIScrollInterface.h */; };\n\t\t1A8C5936180E92CC00EF57C3 /* UIScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58E4180E92CC00EF57C3 /* UIScrollView.cpp */; };\n\t\t1A8C5937180E92CC00EF57C3 /* UIScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58E4180E92CC00EF57C3 /* UIScrollView.cpp */; };\n\t\t1A8C5938180E92CC00EF57C3 /* UIScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E5180E92CC00EF57C3 /* UIScrollView.h */; };\n\t\t1A8C5939180E92CC00EF57C3 /* UIScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E5180E92CC00EF57C3 /* UIScrollView.h */; };\n\t\t1A8C593A180E92CC00EF57C3 /* UISlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58E6180E92CC00EF57C3 /* UISlider.cpp */; };\n\t\t1A8C593B180E92CC00EF57C3 /* UISlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58E6180E92CC00EF57C3 /* UISlider.cpp */; };\n\t\t1A8C593C180E92CC00EF57C3 /* UISlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E7180E92CC00EF57C3 /* UISlider.h */; };\n\t\t1A8C593D180E92CC00EF57C3 /* UISlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E7180E92CC00EF57C3 /* UISlider.h */; };\n\t\t1A8C593E180E92CC00EF57C3 /* UITextField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58E8180E92CC00EF57C3 /* UITextField.cpp */; };\n\t\t1A8C593F180E92CC00EF57C3 /* UITextField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58E8180E92CC00EF57C3 /* UITextField.cpp */; };\n\t\t1A8C5940180E92CC00EF57C3 /* UITextField.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E9180E92CC00EF57C3 /* UITextField.h */; };\n\t\t1A8C5941180E92CC00EF57C3 /* UITextField.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58E9180E92CC00EF57C3 /* UITextField.h */; };\n\t\t1A8C5942180E92CC00EF57C3 /* UIWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58EA180E92CC00EF57C3 /* UIWidget.cpp */; };\n\t\t1A8C5943180E92CC00EF57C3 /* UIWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C58EA180E92CC00EF57C3 /* UIWidget.cpp */; };\n\t\t1A8C5944180E92CC00EF57C3 /* UIWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58EB180E92CC00EF57C3 /* UIWidget.h */; };\n\t\t1A8C5945180E92CC00EF57C3 /* UIWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C58EB180E92CC00EF57C3 /* UIWidget.h */; };\n\t\t1A8C598B180E930E00EF57C3 /* CCActionFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5948180E930E00EF57C3 /* CCActionFrame.cpp */; };\n\t\t1A8C598C180E930E00EF57C3 /* CCActionFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5948180E930E00EF57C3 /* CCActionFrame.cpp */; };\n\t\t1A8C598D180E930E00EF57C3 /* CCActionFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5949180E930E00EF57C3 /* CCActionFrame.h */; };\n\t\t1A8C598E180E930E00EF57C3 /* CCActionFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5949180E930E00EF57C3 /* CCActionFrame.h */; };\n\t\t1A8C598F180E930E00EF57C3 /* CCActionFrameEasing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C594A180E930E00EF57C3 /* CCActionFrameEasing.cpp */; };\n\t\t1A8C5990180E930E00EF57C3 /* CCActionFrameEasing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C594A180E930E00EF57C3 /* CCActionFrameEasing.cpp */; };\n\t\t1A8C5991180E930E00EF57C3 /* CCActionFrameEasing.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C594B180E930E00EF57C3 /* CCActionFrameEasing.h */; };\n\t\t1A8C5992180E930E00EF57C3 /* CCActionFrameEasing.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C594B180E930E00EF57C3 /* CCActionFrameEasing.h */; };\n\t\t1A8C5993180E930E00EF57C3 /* CCActionManagerEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C594C180E930E00EF57C3 /* CCActionManagerEx.cpp */; };\n\t\t1A8C5994180E930E00EF57C3 /* CCActionManagerEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C594C180E930E00EF57C3 /* CCActionManagerEx.cpp */; };\n\t\t1A8C5995180E930E00EF57C3 /* CCActionManagerEx.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C594D180E930E00EF57C3 /* CCActionManagerEx.h */; };\n\t\t1A8C5996180E930E00EF57C3 /* CCActionManagerEx.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C594D180E930E00EF57C3 /* CCActionManagerEx.h */; };\n\t\t1A8C5997180E930E00EF57C3 /* CCActionNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C594E180E930E00EF57C3 /* CCActionNode.cpp */; };\n\t\t1A8C5998180E930E00EF57C3 /* CCActionNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C594E180E930E00EF57C3 /* CCActionNode.cpp */; };\n\t\t1A8C5999180E930E00EF57C3 /* CCActionNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C594F180E930E00EF57C3 /* CCActionNode.h */; };\n\t\t1A8C599A180E930E00EF57C3 /* CCActionNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C594F180E930E00EF57C3 /* CCActionNode.h */; };\n\t\t1A8C599B180E930E00EF57C3 /* CCActionObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5950180E930E00EF57C3 /* CCActionObject.cpp */; };\n\t\t1A8C599C180E930E00EF57C3 /* CCActionObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5950180E930E00EF57C3 /* CCActionObject.cpp */; };\n\t\t1A8C599D180E930E00EF57C3 /* CCActionObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5951180E930E00EF57C3 /* CCActionObject.h */; };\n\t\t1A8C599E180E930E00EF57C3 /* CCActionObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5951180E930E00EF57C3 /* CCActionObject.h */; };\n\t\t1A8C599F180E930E00EF57C3 /* CCArmature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5952180E930E00EF57C3 /* CCArmature.cpp */; };\n\t\t1A8C59A0180E930E00EF57C3 /* CCArmature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5952180E930E00EF57C3 /* CCArmature.cpp */; };\n\t\t1A8C59A1180E930E00EF57C3 /* CCArmature.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5953180E930E00EF57C3 /* CCArmature.h */; };\n\t\t1A8C59A2180E930E00EF57C3 /* CCArmature.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5953180E930E00EF57C3 /* CCArmature.h */; };\n\t\t1A8C59A3180E930E00EF57C3 /* CCArmatureAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5954180E930E00EF57C3 /* CCArmatureAnimation.cpp */; };\n\t\t1A8C59A4180E930E00EF57C3 /* CCArmatureAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5954180E930E00EF57C3 /* CCArmatureAnimation.cpp */; };\n\t\t1A8C59A5180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5955180E930E00EF57C3 /* CCArmatureAnimation.h */; };\n\t\t1A8C59A6180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5955180E930E00EF57C3 /* CCArmatureAnimation.h */; };\n\t\t1A8C59A7180E930E00EF57C3 /* CCArmatureDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5956180E930E00EF57C3 /* CCArmatureDataManager.cpp */; };\n\t\t1A8C59A8180E930E00EF57C3 /* CCArmatureDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5956180E930E00EF57C3 /* CCArmatureDataManager.cpp */; };\n\t\t1A8C59A9180E930E00EF57C3 /* CCArmatureDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5957180E930E00EF57C3 /* CCArmatureDataManager.h */; };\n\t\t1A8C59AA180E930E00EF57C3 /* CCArmatureDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5957180E930E00EF57C3 /* CCArmatureDataManager.h */; };\n\t\t1A8C59AB180E930E00EF57C3 /* CCArmatureDefine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5958180E930E00EF57C3 /* CCArmatureDefine.cpp */; };\n\t\t1A8C59AC180E930E00EF57C3 /* CCArmatureDefine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5958180E930E00EF57C3 /* CCArmatureDefine.cpp */; };\n\t\t1A8C59AD180E930E00EF57C3 /* CCArmatureDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5959180E930E00EF57C3 /* CCArmatureDefine.h */; };\n\t\t1A8C59AE180E930E00EF57C3 /* CCArmatureDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5959180E930E00EF57C3 /* CCArmatureDefine.h */; };\n\t\t1A8C59AF180E930E00EF57C3 /* CCBatchNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C595A180E930E00EF57C3 /* CCBatchNode.cpp */; };\n\t\t1A8C59B0180E930E00EF57C3 /* CCBatchNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C595A180E930E00EF57C3 /* CCBatchNode.cpp */; };\n\t\t1A8C59B1180E930E00EF57C3 /* CCBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C595B180E930E00EF57C3 /* CCBatchNode.h */; };\n\t\t1A8C59B2180E930E00EF57C3 /* CCBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C595B180E930E00EF57C3 /* CCBatchNode.h */; };\n\t\t1A8C59B3180E930E00EF57C3 /* CCBone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C595C180E930E00EF57C3 /* CCBone.cpp */; };\n\t\t1A8C59B4180E930E00EF57C3 /* CCBone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C595C180E930E00EF57C3 /* CCBone.cpp */; };\n\t\t1A8C59B5180E930E00EF57C3 /* CCBone.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C595D180E930E00EF57C3 /* CCBone.h */; };\n\t\t1A8C59B6180E930E00EF57C3 /* CCBone.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C595D180E930E00EF57C3 /* CCBone.h */; };\n\t\t1A8C59B7180E930E00EF57C3 /* CCColliderDetector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C595E180E930E00EF57C3 /* CCColliderDetector.cpp */; };\n\t\t1A8C59B8180E930E00EF57C3 /* CCColliderDetector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C595E180E930E00EF57C3 /* CCColliderDetector.cpp */; };\n\t\t1A8C59B9180E930E00EF57C3 /* CCColliderDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C595F180E930E00EF57C3 /* CCColliderDetector.h */; };\n\t\t1A8C59BA180E930E00EF57C3 /* CCColliderDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C595F180E930E00EF57C3 /* CCColliderDetector.h */; };\n\t\t1A8C59BB180E930E00EF57C3 /* CCComAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5960180E930E00EF57C3 /* CCComAttribute.cpp */; };\n\t\t1A8C59BC180E930E00EF57C3 /* CCComAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5960180E930E00EF57C3 /* CCComAttribute.cpp */; };\n\t\t1A8C59BD180E930E00EF57C3 /* CCComAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5961180E930E00EF57C3 /* CCComAttribute.h */; };\n\t\t1A8C59BE180E930E00EF57C3 /* CCComAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5961180E930E00EF57C3 /* CCComAttribute.h */; };\n\t\t1A8C59BF180E930E00EF57C3 /* CCComAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5962180E930E00EF57C3 /* CCComAudio.cpp */; };\n\t\t1A8C59C0180E930E00EF57C3 /* CCComAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5962180E930E00EF57C3 /* CCComAudio.cpp */; };\n\t\t1A8C59C1180E930E00EF57C3 /* CCComAudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5963180E930E00EF57C3 /* CCComAudio.h */; };\n\t\t1A8C59C2180E930E00EF57C3 /* CCComAudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5963180E930E00EF57C3 /* CCComAudio.h */; };\n\t\t1A8C59C3180E930E00EF57C3 /* CCComController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5964180E930E00EF57C3 /* CCComController.cpp */; };\n\t\t1A8C59C4180E930E00EF57C3 /* CCComController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5964180E930E00EF57C3 /* CCComController.cpp */; };\n\t\t1A8C59C5180E930E00EF57C3 /* CCComController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5965180E930E00EF57C3 /* CCComController.h */; };\n\t\t1A8C59C6180E930E00EF57C3 /* CCComController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5965180E930E00EF57C3 /* CCComController.h */; };\n\t\t1A8C59C7180E930E00EF57C3 /* CCComRender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5966180E930E00EF57C3 /* CCComRender.cpp */; };\n\t\t1A8C59C8180E930E00EF57C3 /* CCComRender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5966180E930E00EF57C3 /* CCComRender.cpp */; };\n\t\t1A8C59C9180E930E00EF57C3 /* CCComRender.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5967180E930E00EF57C3 /* CCComRender.h */; };\n\t\t1A8C59CA180E930E00EF57C3 /* CCComRender.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5967180E930E00EF57C3 /* CCComRender.h */; };\n\t\t1A8C59CB180E930E00EF57C3 /* CCDataReaderHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5968180E930E00EF57C3 /* CCDataReaderHelper.cpp */; };\n\t\t1A8C59CC180E930E00EF57C3 /* CCDataReaderHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5968180E930E00EF57C3 /* CCDataReaderHelper.cpp */; };\n\t\t1A8C59CD180E930E00EF57C3 /* CCDataReaderHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5969180E930E00EF57C3 /* CCDataReaderHelper.h */; };\n\t\t1A8C59CE180E930E00EF57C3 /* CCDataReaderHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5969180E930E00EF57C3 /* CCDataReaderHelper.h */; };\n\t\t1A8C59CF180E930E00EF57C3 /* CCDatas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C596A180E930E00EF57C3 /* CCDatas.cpp */; };\n\t\t1A8C59D0180E930E00EF57C3 /* CCDatas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C596A180E930E00EF57C3 /* CCDatas.cpp */; };\n\t\t1A8C59D1180E930E00EF57C3 /* CCDatas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C596B180E930E00EF57C3 /* CCDatas.h */; };\n\t\t1A8C59D2180E930E00EF57C3 /* CCDatas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C596B180E930E00EF57C3 /* CCDatas.h */; };\n\t\t1A8C59D3180E930E00EF57C3 /* CCDecorativeDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C596C180E930E00EF57C3 /* CCDecorativeDisplay.cpp */; };\n\t\t1A8C59D4180E930E00EF57C3 /* CCDecorativeDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C596C180E930E00EF57C3 /* CCDecorativeDisplay.cpp */; };\n\t\t1A8C59D5180E930E00EF57C3 /* CCDecorativeDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C596D180E930E00EF57C3 /* CCDecorativeDisplay.h */; };\n\t\t1A8C59D6180E930E00EF57C3 /* CCDecorativeDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C596D180E930E00EF57C3 /* CCDecorativeDisplay.h */; };\n\t\t1A8C59D7180E930E00EF57C3 /* CCDisplayFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C596E180E930E00EF57C3 /* CCDisplayFactory.cpp */; };\n\t\t1A8C59D8180E930E00EF57C3 /* CCDisplayFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C596E180E930E00EF57C3 /* CCDisplayFactory.cpp */; };\n\t\t1A8C59D9180E930E00EF57C3 /* CCDisplayFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C596F180E930E00EF57C3 /* CCDisplayFactory.h */; };\n\t\t1A8C59DA180E930E00EF57C3 /* CCDisplayFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C596F180E930E00EF57C3 /* CCDisplayFactory.h */; };\n\t\t1A8C59DB180E930E00EF57C3 /* CCDisplayManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5970180E930E00EF57C3 /* CCDisplayManager.cpp */; };\n\t\t1A8C59DC180E930E00EF57C3 /* CCDisplayManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5970180E930E00EF57C3 /* CCDisplayManager.cpp */; };\n\t\t1A8C59DD180E930E00EF57C3 /* CCDisplayManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5971180E930E00EF57C3 /* CCDisplayManager.h */; };\n\t\t1A8C59DE180E930E00EF57C3 /* CCDisplayManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5971180E930E00EF57C3 /* CCDisplayManager.h */; };\n\t\t1A8C59DF180E930E00EF57C3 /* CCInputDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5972180E930E00EF57C3 /* CCInputDelegate.cpp */; };\n\t\t1A8C59E0180E930E00EF57C3 /* CCInputDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5972180E930E00EF57C3 /* CCInputDelegate.cpp */; };\n\t\t1A8C59E1180E930E00EF57C3 /* CCInputDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5973180E930E00EF57C3 /* CCInputDelegate.h */; };\n\t\t1A8C59E2180E930E00EF57C3 /* CCInputDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5973180E930E00EF57C3 /* CCInputDelegate.h */; };\n\t\t1A8C59E3180E930E00EF57C3 /* CCProcessBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5974180E930E00EF57C3 /* CCProcessBase.cpp */; };\n\t\t1A8C59E4180E930E00EF57C3 /* CCProcessBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5974180E930E00EF57C3 /* CCProcessBase.cpp */; };\n\t\t1A8C59E5180E930E00EF57C3 /* CCProcessBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5975180E930E00EF57C3 /* CCProcessBase.h */; };\n\t\t1A8C59E6180E930E00EF57C3 /* CCProcessBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5975180E930E00EF57C3 /* CCProcessBase.h */; };\n\t\t1A8C59E7180E930E00EF57C3 /* CCSGUIReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5976180E930E00EF57C3 /* CCSGUIReader.cpp */; };\n\t\t1A8C59E8180E930E00EF57C3 /* CCSGUIReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5976180E930E00EF57C3 /* CCSGUIReader.cpp */; };\n\t\t1A8C59E9180E930E00EF57C3 /* CCSGUIReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5977180E930E00EF57C3 /* CCSGUIReader.h */; };\n\t\t1A8C59EA180E930E00EF57C3 /* CCSGUIReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5977180E930E00EF57C3 /* CCSGUIReader.h */; };\n\t\t1A8C59EB180E930E00EF57C3 /* CCSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5978180E930E00EF57C3 /* CCSkin.cpp */; };\n\t\t1A8C59EC180E930E00EF57C3 /* CCSkin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5978180E930E00EF57C3 /* CCSkin.cpp */; };\n\t\t1A8C59ED180E930E00EF57C3 /* CCSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5979180E930E00EF57C3 /* CCSkin.h */; };\n\t\t1A8C59EE180E930E00EF57C3 /* CCSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5979180E930E00EF57C3 /* CCSkin.h */; };\n\t\t1A8C59EF180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C597A180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp */; };\n\t\t1A8C59F0180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C597A180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp */; };\n\t\t1A8C59F1180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C597B180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h */; };\n\t\t1A8C59F2180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C597B180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h */; };\n\t\t1A8C59F3180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C597C180E930E00EF57C3 /* CCSSceneReader.cpp */; };\n\t\t1A8C59F4180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C597C180E930E00EF57C3 /* CCSSceneReader.cpp */; };\n\t\t1A8C59F5180E930E00EF57C3 /* CCSSceneReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C597D180E930E00EF57C3 /* CCSSceneReader.h */; };\n\t\t1A8C59F6180E930E00EF57C3 /* CCSSceneReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C597D180E930E00EF57C3 /* CCSSceneReader.h */; };\n\t\t1A8C59F7180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C597E180E930E00EF57C3 /* CCTransformHelp.cpp */; };\n\t\t1A8C59F8180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C597E180E930E00EF57C3 /* CCTransformHelp.cpp */; };\n\t\t1A8C59F9180E930E00EF57C3 /* CCTransformHelp.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C597F180E930E00EF57C3 /* CCTransformHelp.h */; };\n\t\t1A8C59FA180E930E00EF57C3 /* CCTransformHelp.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C597F180E930E00EF57C3 /* CCTransformHelp.h */; };\n\t\t1A8C59FB180E930E00EF57C3 /* CCTween.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5980180E930E00EF57C3 /* CCTween.cpp */; };\n\t\t1A8C59FC180E930E00EF57C3 /* CCTween.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5980180E930E00EF57C3 /* CCTween.cpp */; };\n\t\t1A8C59FD180E930E00EF57C3 /* CCTween.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5981180E930E00EF57C3 /* CCTween.h */; };\n\t\t1A8C59FE180E930E00EF57C3 /* CCTween.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5981180E930E00EF57C3 /* CCTween.h */; };\n\t\t1A8C59FF180E930E00EF57C3 /* CCTweenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5982180E930E00EF57C3 /* CCTweenFunction.cpp */; };\n\t\t1A8C5A00180E930E00EF57C3 /* CCTweenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5982180E930E00EF57C3 /* CCTweenFunction.cpp */; };\n\t\t1A8C5A01180E930E00EF57C3 /* CCTweenFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5983180E930E00EF57C3 /* CCTweenFunction.h */; };\n\t\t1A8C5A02180E930E00EF57C3 /* CCTweenFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5983180E930E00EF57C3 /* CCTweenFunction.h */; };\n\t\t1A8C5A03180E930E00EF57C3 /* CCUtilMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5984180E930E00EF57C3 /* CCUtilMath.cpp */; };\n\t\t1A8C5A04180E930E00EF57C3 /* CCUtilMath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5984180E930E00EF57C3 /* CCUtilMath.cpp */; };\n\t\t1A8C5A05180E930E00EF57C3 /* CCUtilMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5985180E930E00EF57C3 /* CCUtilMath.h */; };\n\t\t1A8C5A06180E930E00EF57C3 /* CCUtilMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5985180E930E00EF57C3 /* CCUtilMath.h */; };\n\t\t1A8C5A07180E930E00EF57C3 /* CocoStudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5986180E930E00EF57C3 /* CocoStudio.h */; };\n\t\t1A8C5A08180E930E00EF57C3 /* CocoStudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C5986180E930E00EF57C3 /* CocoStudio.h */; };\n\t\t1A8C5A0D180E930E00EF57C3 /* DictionaryHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5989180E930E00EF57C3 /* DictionaryHelper.cpp */; };\n\t\t1A8C5A0E180E930E00EF57C3 /* DictionaryHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5989180E930E00EF57C3 /* DictionaryHelper.cpp */; };\n\t\t1A8C5A0F180E930E00EF57C3 /* DictionaryHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */; };\n\t\t1A8C5A10180E930E00EF57C3 /* DictionaryHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */; };\n\t\t1A94D35116C2072800D79D09 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1551A342158F2AB200E66CFE /* Foundation.framework */; };\n\t\t1A9DCA13180E6955007A3AD4 /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9F8180E6955007A3AD4 /* ccConfig.h */; };\n\t\t1A9DCA14180E6955007A3AD4 /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9F8180E6955007A3AD4 /* ccConfig.h */; };\n\t\t1A9DCA15180E6955007A3AD4 /* CCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC9F9180E6955007A3AD4 /* CCConfiguration.cpp */; };\n\t\t1A9DCA16180E6955007A3AD4 /* CCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC9F9180E6955007A3AD4 /* CCConfiguration.cpp */; };\n\t\t1A9DCA17180E6955007A3AD4 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9FA180E6955007A3AD4 /* CCConfiguration.h */; };\n\t\t1A9DCA18180E6955007A3AD4 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9FA180E6955007A3AD4 /* CCConfiguration.h */; };\n\t\t1A9DCA1D180E6955007A3AD4 /* CCDirector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC9FD180E6955007A3AD4 /* CCDirector.cpp */; };\n\t\t1A9DCA1E180E6955007A3AD4 /* CCDirector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC9FD180E6955007A3AD4 /* CCDirector.cpp */; };\n\t\t1A9DCA1F180E6955007A3AD4 /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9FE180E6955007A3AD4 /* CCDirector.h */; };\n\t\t1A9DCA20180E6955007A3AD4 /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9FE180E6955007A3AD4 /* CCDirector.h */; };\n\t\t1A9DCA21180E6955007A3AD4 /* CCEventType.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9FF180E6955007A3AD4 /* CCEventType.h */; };\n\t\t1A9DCA22180E6955007A3AD4 /* CCEventType.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DC9FF180E6955007A3AD4 /* CCEventType.h */; };\n\t\t1A9DCA23180E6955007A3AD4 /* ccFPSImages.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */; };\n\t\t1A9DCA24180E6955007A3AD4 /* ccFPSImages.c in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */; };\n\t\t1A9DCA25180E6955007A3AD4 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */; };\n\t\t1A9DCA26180E6955007A3AD4 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */; };\n\t\t1A9DCA27180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */; };\n\t\t1A9DCA28180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */; };\n\t\t1A9DCA29180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */; };\n\t\t1A9DCA2A180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */; };\n\t\t1A9DCA2B180E6955007A3AD4 /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA04180E6955007A3AD4 /* ccMacros.h */; };\n\t\t1A9DCA2C180E6955007A3AD4 /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA04180E6955007A3AD4 /* ccMacros.h */; };\n\t\t1A9DCA2D180E6955007A3AD4 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA05180E6955007A3AD4 /* CCProtocols.h */; };\n\t\t1A9DCA2E180E6955007A3AD4 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA05180E6955007A3AD4 /* CCProtocols.h */; };\n\t\t1A9DCA2F180E6955007A3AD4 /* CCScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA06180E6955007A3AD4 /* CCScheduler.cpp */; };\n\t\t1A9DCA30180E6955007A3AD4 /* CCScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA06180E6955007A3AD4 /* CCScheduler.cpp */; };\n\t\t1A9DCA31180E6955007A3AD4 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA07180E6955007A3AD4 /* CCScheduler.h */; };\n\t\t1A9DCA32180E6955007A3AD4 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA07180E6955007A3AD4 /* CCScheduler.h */; };\n\t\t1A9DCA37180E6955007A3AD4 /* cocos2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA0A180E6955007A3AD4 /* cocos2d.cpp */; };\n\t\t1A9DCA38180E6955007A3AD4 /* cocos2d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA0A180E6955007A3AD4 /* cocos2d.cpp */; };\n\t\t1A9DCA39180E6955007A3AD4 /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0B180E6955007A3AD4 /* cocos2d.h */; };\n\t\t1A9DCA3A180E6955007A3AD4 /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0B180E6955007A3AD4 /* cocos2d.h */; };\n\t\t1A9DCA3B180E6955007A3AD4 /* firePngData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0C180E6955007A3AD4 /* firePngData.h */; };\n\t\t1A9DCA3C180E6955007A3AD4 /* firePngData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0C180E6955007A3AD4 /* firePngData.h */; };\n\t\t1A9DCA3D180E6955007A3AD4 /* TransformUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA0D180E6955007A3AD4 /* TransformUtils.cpp */; };\n\t\t1A9DCA3E180E6955007A3AD4 /* TransformUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA0D180E6955007A3AD4 /* TransformUtils.cpp */; };\n\t\t1A9DCA3F180E6955007A3AD4 /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0E180E6955007A3AD4 /* TransformUtils.h */; };\n\t\t1A9DCA40180E6955007A3AD4 /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA0E180E6955007A3AD4 /* TransformUtils.h */; };\n\t\t1A9DCA43180E6D90007A3AD4 /* CCDeprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA41180E6D90007A3AD4 /* CCDeprecated.cpp */; };\n\t\t1A9DCA44180E6D90007A3AD4 /* CCDeprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA41180E6D90007A3AD4 /* CCDeprecated.cpp */; };\n\t\t1A9DCA45180E6D90007A3AD4 /* CCDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA42180E6D90007A3AD4 /* CCDeprecated.h */; };\n\t\t1A9DCA46180E6D90007A3AD4 /* CCDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA42180E6D90007A3AD4 /* CCDeprecated.h */; };\n\t\t1A9DCA49180E6DE3007A3AD4 /* ccTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA47180E6DE3007A3AD4 /* ccTypes.cpp */; };\n\t\t1A9DCA4A180E6DE3007A3AD4 /* ccTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DCA47180E6DE3007A3AD4 /* ccTypes.cpp */; };\n\t\t1A9DCA4B180E6DE3007A3AD4 /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA48180E6DE3007A3AD4 /* ccTypes.h */; };\n\t\t1A9DCA4C180E6DE3007A3AD4 /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9DCA48180E6DE3007A3AD4 /* ccTypes.h */; };\n\t\t1A9DCA4D180E6E3C007A3AD4 /* libjs_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AAF5421180E4047000584C8 /* libjs_static.a */; };\n\t\t1A9DCA4E180E6E42007A3AD4 /* libjs_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AAF5424180E405B000584C8 /* libjs_static.a */; };\n\t\t1AA2063F1848437900053418 /* CCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA2063E1848437900053418 /* CCMap.h */; };\n\t\t1AA206401848437A00053418 /* CCMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA2063E1848437900053418 /* CCMap.h */; };\n\t\t1AAF528B180E2ECC000584C8 /* b2BroadPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B61807AF9C005B8026 /* b2BroadPhase.cpp */; };\n\t\t1AAF528C180E2ECC000584C8 /* b2BroadPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168B71807AF9C005B8026 /* b2BroadPhase.h */; };\n\t\t1AAF528D180E2ECC000584C8 /* b2CollideCircle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B81807AF9C005B8026 /* b2CollideCircle.cpp */; };\n\t\t1AAF528E180E2ECC000584C8 /* b2CollideEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B91807AF9C005B8026 /* b2CollideEdge.cpp */; };\n\t\t1AAF528F180E2ECC000584C8 /* b2CollidePolygon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BA1807AF9C005B8026 /* b2CollidePolygon.cpp */; };\n\t\t1AAF5290180E2ECC000584C8 /* b2Collision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BB1807AF9C005B8026 /* b2Collision.cpp */; };\n\t\t1AAF5291180E2ECC000584C8 /* b2Collision.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168BC1807AF9C005B8026 /* b2Collision.h */; };\n\t\t1AAF5292180E2ECC000584C8 /* b2Distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BD1807AF9C005B8026 /* b2Distance.cpp */; };\n\t\t1AAF5293180E2ECC000584C8 /* b2Distance.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168BE1807AF9C005B8026 /* b2Distance.h */; };\n\t\t1AAF5294180E2ECC000584C8 /* b2DynamicTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BF1807AF9C005B8026 /* b2DynamicTree.cpp */; };\n\t\t1AAF5295180E2ECC000584C8 /* b2DynamicTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C01807AF9C005B8026 /* b2DynamicTree.h */; };\n\t\t1AAF5296180E2ECC000584C8 /* b2TimeOfImpact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C11807AF9C005B8026 /* b2TimeOfImpact.cpp */; };\n\t\t1AAF5297180E2ECC000584C8 /* b2TimeOfImpact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C21807AF9C005B8026 /* b2TimeOfImpact.h */; };\n\t\t1AAF5298180E2ED2000584C8 /* Box2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168B41807AF9C005B8026 /* Box2D.h */; };\n\t\t1AAF5299180E2EE1000584C8 /* Box2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168B41807AF9C005B8026 /* Box2D.h */; };\n\t\t1AAF529A180E2EE4000584C8 /* b2BroadPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B61807AF9C005B8026 /* b2BroadPhase.cpp */; };\n\t\t1AAF529B180E2EE4000584C8 /* b2BroadPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168B71807AF9C005B8026 /* b2BroadPhase.h */; };\n\t\t1AAF529C180E2EE4000584C8 /* b2CollideCircle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B81807AF9C005B8026 /* b2CollideCircle.cpp */; };\n\t\t1AAF529D180E2EE4000584C8 /* b2CollideEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168B91807AF9C005B8026 /* b2CollideEdge.cpp */; };\n\t\t1AAF529E180E2EE4000584C8 /* b2CollidePolygon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BA1807AF9C005B8026 /* b2CollidePolygon.cpp */; };\n\t\t1AAF529F180E2EE4000584C8 /* b2Collision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BB1807AF9C005B8026 /* b2Collision.cpp */; };\n\t\t1AAF52A0180E2EE4000584C8 /* b2Collision.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168BC1807AF9C005B8026 /* b2Collision.h */; };\n\t\t1AAF52A1180E2EE4000584C8 /* b2Distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BD1807AF9C005B8026 /* b2Distance.cpp */; };\n\t\t1AAF52A2180E2EE4000584C8 /* b2Distance.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168BE1807AF9C005B8026 /* b2Distance.h */; };\n\t\t1AAF52A3180E2EE4000584C8 /* b2DynamicTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168BF1807AF9C005B8026 /* b2DynamicTree.cpp */; };\n\t\t1AAF52A4180E2EE4000584C8 /* b2DynamicTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C01807AF9C005B8026 /* b2DynamicTree.h */; };\n\t\t1AAF52A5180E2EE4000584C8 /* b2TimeOfImpact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C11807AF9C005B8026 /* b2TimeOfImpact.cpp */; };\n\t\t1AAF52A6180E2EE4000584C8 /* b2TimeOfImpact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C21807AF9C005B8026 /* b2TimeOfImpact.h */; };\n\t\t1AAF52A7180E2EE8000584C8 /* b2ChainShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C41807AF9C005B8026 /* b2ChainShape.cpp */; };\n\t\t1AAF52A8180E2EE8000584C8 /* b2ChainShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C51807AF9C005B8026 /* b2ChainShape.h */; };\n\t\t1AAF52A9180E2EE8000584C8 /* b2CircleShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C61807AF9C005B8026 /* b2CircleShape.cpp */; };\n\t\t1AAF52AA180E2EE8000584C8 /* b2CircleShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C71807AF9C005B8026 /* b2CircleShape.h */; };\n\t\t1AAF52AB180E2EE8000584C8 /* b2EdgeShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C81807AF9C005B8026 /* b2EdgeShape.cpp */; };\n\t\t1AAF52AC180E2EE8000584C8 /* b2EdgeShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C91807AF9C005B8026 /* b2EdgeShape.h */; };\n\t\t1AAF52AD180E2EE8000584C8 /* b2PolygonShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168CA1807AF9C005B8026 /* b2PolygonShape.cpp */; };\n\t\t1AAF52AE180E2EE8000584C8 /* b2PolygonShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168CB1807AF9C005B8026 /* b2PolygonShape.h */; };\n\t\t1AAF52AF180E2EE8000584C8 /* b2Shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168CC1807AF9C005B8026 /* b2Shape.h */; };\n\t\t1AAF52B0180E2EE9000584C8 /* b2ChainShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C41807AF9C005B8026 /* b2ChainShape.cpp */; };\n\t\t1AAF52B1180E2EE9000584C8 /* b2ChainShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C51807AF9C005B8026 /* b2ChainShape.h */; };\n\t\t1AAF52B2180E2EE9000584C8 /* b2CircleShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C61807AF9C005B8026 /* b2CircleShape.cpp */; };\n\t\t1AAF52B3180E2EE9000584C8 /* b2CircleShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C71807AF9C005B8026 /* b2CircleShape.h */; };\n\t\t1AAF52B4180E2EE9000584C8 /* b2EdgeShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168C81807AF9C005B8026 /* b2EdgeShape.cpp */; };\n\t\t1AAF52B5180E2EE9000584C8 /* b2EdgeShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168C91807AF9C005B8026 /* b2EdgeShape.h */; };\n\t\t1AAF52B6180E2EE9000584C8 /* b2PolygonShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168CA1807AF9C005B8026 /* b2PolygonShape.cpp */; };\n\t\t1AAF52B7180E2EE9000584C8 /* b2PolygonShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168CB1807AF9C005B8026 /* b2PolygonShape.h */; };\n\t\t1AAF52B8180E2EE9000584C8 /* b2Shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168CC1807AF9C005B8026 /* b2Shape.h */; };\n\t\t1AAF52B9180E2EEE000584C8 /* b2BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168CE1807AF9C005B8026 /* b2BlockAllocator.cpp */; };\n\t\t1AAF52BA180E2EEE000584C8 /* b2BlockAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168CF1807AF9C005B8026 /* b2BlockAllocator.h */; };\n\t\t1AAF52BB180E2EEE000584C8 /* b2Draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D01807AF9C005B8026 /* b2Draw.cpp */; };\n\t\t1AAF52BC180E2EEE000584C8 /* b2Draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D11807AF9C005B8026 /* b2Draw.h */; };\n\t\t1AAF52BD180E2EEE000584C8 /* b2GrowableStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D21807AF9C005B8026 /* b2GrowableStack.h */; };\n\t\t1AAF52BE180E2EEE000584C8 /* b2Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D31807AF9C005B8026 /* b2Math.cpp */; };\n\t\t1AAF52BF180E2EEE000584C8 /* b2Math.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D41807AF9C005B8026 /* b2Math.h */; };\n\t\t1AAF52C0180E2EEE000584C8 /* b2Settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D51807AF9C005B8026 /* b2Settings.cpp */; };\n\t\t1AAF52C1180E2EEE000584C8 /* b2Settings.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D61807AF9C005B8026 /* b2Settings.h */; };\n\t\t1AAF52C2180E2EEE000584C8 /* b2StackAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D71807AF9C005B8026 /* b2StackAllocator.cpp */; };\n\t\t1AAF52C3180E2EEE000584C8 /* b2StackAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D81807AF9C005B8026 /* b2StackAllocator.h */; };\n\t\t1AAF52C4180E2EEE000584C8 /* b2Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D91807AF9C005B8026 /* b2Timer.cpp */; };\n\t\t1AAF52C5180E2EEE000584C8 /* b2Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168DA1807AF9C005B8026 /* b2Timer.h */; };\n\t\t1AAF52C6180E2EEF000584C8 /* b2BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168CE1807AF9C005B8026 /* b2BlockAllocator.cpp */; };\n\t\t1AAF52C7180E2EEF000584C8 /* b2BlockAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168CF1807AF9C005B8026 /* b2BlockAllocator.h */; };\n\t\t1AAF52C8180E2EEF000584C8 /* b2Draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D01807AF9C005B8026 /* b2Draw.cpp */; };\n\t\t1AAF52C9180E2EEF000584C8 /* b2Draw.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D11807AF9C005B8026 /* b2Draw.h */; };\n\t\t1AAF52CA180E2EEF000584C8 /* b2GrowableStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D21807AF9C005B8026 /* b2GrowableStack.h */; };\n\t\t1AAF52CB180E2EEF000584C8 /* b2Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D31807AF9C005B8026 /* b2Math.cpp */; };\n\t\t1AAF52CC180E2EEF000584C8 /* b2Math.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D41807AF9C005B8026 /* b2Math.h */; };\n\t\t1AAF52CD180E2EEF000584C8 /* b2Settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D51807AF9C005B8026 /* b2Settings.cpp */; };\n\t\t1AAF52CE180E2EEF000584C8 /* b2Settings.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D61807AF9C005B8026 /* b2Settings.h */; };\n\t\t1AAF52CF180E2EEF000584C8 /* b2StackAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D71807AF9C005B8026 /* b2StackAllocator.cpp */; };\n\t\t1AAF52D0180E2EEF000584C8 /* b2StackAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168D81807AF9C005B8026 /* b2StackAllocator.h */; };\n\t\t1AAF52D1180E2EEF000584C8 /* b2Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168D91807AF9C005B8026 /* b2Timer.cpp */; };\n\t\t1AAF52D2180E2EEF000584C8 /* b2Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168DA1807AF9C005B8026 /* b2Timer.h */; };\n\t\t1AAF52D3180E2EF5000584C8 /* b2Body.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168DC1807AF9C005B8026 /* b2Body.cpp */; };\n\t\t1AAF52D4180E2EF5000584C8 /* b2Body.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168DD1807AF9C005B8026 /* b2Body.h */; };\n\t\t1AAF52D5180E2EF5000584C8 /* b2ContactManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168DE1807AF9C005B8026 /* b2ContactManager.cpp */; };\n\t\t1AAF52D6180E2EF5000584C8 /* b2ContactManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168DF1807AF9C005B8026 /* b2ContactManager.h */; };\n\t\t1AAF52D7180E2EF5000584C8 /* b2Fixture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E01807AF9C005B8026 /* b2Fixture.cpp */; };\n\t\t1AAF52D8180E2EF5000584C8 /* b2Fixture.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E11807AF9C005B8026 /* b2Fixture.h */; };\n\t\t1AAF52D9180E2EF5000584C8 /* b2Island.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E21807AF9C005B8026 /* b2Island.cpp */; };\n\t\t1AAF52DA180E2EF5000584C8 /* b2Island.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E31807AF9C005B8026 /* b2Island.h */; };\n\t\t1AAF52DB180E2EF5000584C8 /* b2TimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E41807AF9C005B8026 /* b2TimeStep.h */; };\n\t\t1AAF52DC180E2EF5000584C8 /* b2World.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E51807AF9C005B8026 /* b2World.cpp */; };\n\t\t1AAF52DD180E2EF5000584C8 /* b2World.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E61807AF9C005B8026 /* b2World.h */; };\n\t\t1AAF52DE180E2EF5000584C8 /* b2WorldCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E71807AF9C005B8026 /* b2WorldCallbacks.cpp */; };\n\t\t1AAF52DF180E2EF5000584C8 /* b2WorldCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E81807AF9C005B8026 /* b2WorldCallbacks.h */; };\n\t\t1AAF52E0180E2EF6000584C8 /* b2Body.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168DC1807AF9C005B8026 /* b2Body.cpp */; };\n\t\t1AAF52E1180E2EF6000584C8 /* b2Body.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168DD1807AF9C005B8026 /* b2Body.h */; };\n\t\t1AAF52E2180E2EF6000584C8 /* b2ContactManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168DE1807AF9C005B8026 /* b2ContactManager.cpp */; };\n\t\t1AAF52E3180E2EF6000584C8 /* b2ContactManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168DF1807AF9C005B8026 /* b2ContactManager.h */; };\n\t\t1AAF52E4180E2EF6000584C8 /* b2Fixture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E01807AF9C005B8026 /* b2Fixture.cpp */; };\n\t\t1AAF52E5180E2EF6000584C8 /* b2Fixture.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E11807AF9C005B8026 /* b2Fixture.h */; };\n\t\t1AAF52E6180E2EF6000584C8 /* b2Island.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E21807AF9C005B8026 /* b2Island.cpp */; };\n\t\t1AAF52E7180E2EF6000584C8 /* b2Island.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E31807AF9C005B8026 /* b2Island.h */; };\n\t\t1AAF52E8180E2EF6000584C8 /* b2TimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E41807AF9C005B8026 /* b2TimeStep.h */; };\n\t\t1AAF52E9180E2EF6000584C8 /* b2World.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E51807AF9C005B8026 /* b2World.cpp */; };\n\t\t1AAF52EA180E2EF6000584C8 /* b2World.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E61807AF9C005B8026 /* b2World.h */; };\n\t\t1AAF52EB180E2EF6000584C8 /* b2WorldCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168E71807AF9C005B8026 /* b2WorldCallbacks.cpp */; };\n\t\t1AAF52EC180E2EF6000584C8 /* b2WorldCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168E81807AF9C005B8026 /* b2WorldCallbacks.h */; };\n\t\t1AAF52ED180E2EFC000584C8 /* b2ChainAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168EA1807AF9C005B8026 /* b2ChainAndCircleContact.cpp */; };\n\t\t1AAF52EE180E2EFC000584C8 /* b2ChainAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168EB1807AF9C005B8026 /* b2ChainAndCircleContact.h */; };\n\t\t1AAF52EF180E2EFC000584C8 /* b2ChainAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168EC1807AF9C005B8026 /* b2ChainAndPolygonContact.cpp */; };\n\t\t1AAF52F0180E2EFC000584C8 /* b2ChainAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168ED1807AF9C005B8026 /* b2ChainAndPolygonContact.h */; };\n\t\t1AAF52F1180E2EFC000584C8 /* b2CircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168EE1807AF9C005B8026 /* b2CircleContact.cpp */; };\n\t\t1AAF52F2180E2EFC000584C8 /* b2CircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168EF1807AF9C005B8026 /* b2CircleContact.h */; };\n\t\t1AAF52F3180E2EFC000584C8 /* b2Contact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F01807AF9C005B8026 /* b2Contact.cpp */; };\n\t\t1AAF52F4180E2EFC000584C8 /* b2Contact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F11807AF9C005B8026 /* b2Contact.h */; };\n\t\t1AAF52F5180E2EFC000584C8 /* b2ContactSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F21807AF9C005B8026 /* b2ContactSolver.cpp */; };\n\t\t1AAF52F6180E2EFC000584C8 /* b2ContactSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F31807AF9C005B8026 /* b2ContactSolver.h */; };\n\t\t1AAF52F7180E2EFC000584C8 /* b2EdgeAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F41807AF9C005B8026 /* b2EdgeAndCircleContact.cpp */; };\n\t\t1AAF52F8180E2EFC000584C8 /* b2EdgeAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F51807AF9C005B8026 /* b2EdgeAndCircleContact.h */; };\n\t\t1AAF52F9180E2EFC000584C8 /* b2EdgeAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F61807AF9C005B8026 /* b2EdgeAndPolygonContact.cpp */; };\n\t\t1AAF52FA180E2EFC000584C8 /* b2EdgeAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F71807AF9C005B8026 /* b2EdgeAndPolygonContact.h */; };\n\t\t1AAF52FB180E2EFC000584C8 /* b2PolygonAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F81807AF9C005B8026 /* b2PolygonAndCircleContact.cpp */; };\n\t\t1AAF52FC180E2EFC000584C8 /* b2PolygonAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F91807AF9C005B8026 /* b2PolygonAndCircleContact.h */; };\n\t\t1AAF52FD180E2EFC000584C8 /* b2PolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168FA1807AF9C005B8026 /* b2PolygonContact.cpp */; };\n\t\t1AAF52FE180E2EFC000584C8 /* b2PolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168FB1807AF9C005B8026 /* b2PolygonContact.h */; };\n\t\t1AAF52FF180E2EFE000584C8 /* b2ChainAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168EA1807AF9C005B8026 /* b2ChainAndCircleContact.cpp */; };\n\t\t1AAF5300180E2EFE000584C8 /* b2ChainAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168EB1807AF9C005B8026 /* b2ChainAndCircleContact.h */; };\n\t\t1AAF5301180E2EFE000584C8 /* b2ChainAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168EC1807AF9C005B8026 /* b2ChainAndPolygonContact.cpp */; };\n\t\t1AAF5302180E2EFE000584C8 /* b2ChainAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168ED1807AF9C005B8026 /* b2ChainAndPolygonContact.h */; };\n\t\t1AAF5303180E2EFE000584C8 /* b2CircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168EE1807AF9C005B8026 /* b2CircleContact.cpp */; };\n\t\t1AAF5304180E2EFE000584C8 /* b2CircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168EF1807AF9C005B8026 /* b2CircleContact.h */; };\n\t\t1AAF5305180E2EFE000584C8 /* b2Contact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F01807AF9C005B8026 /* b2Contact.cpp */; };\n\t\t1AAF5306180E2EFE000584C8 /* b2Contact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F11807AF9C005B8026 /* b2Contact.h */; };\n\t\t1AAF5307180E2EFE000584C8 /* b2ContactSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F21807AF9C005B8026 /* b2ContactSolver.cpp */; };\n\t\t1AAF5308180E2EFE000584C8 /* b2ContactSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F31807AF9C005B8026 /* b2ContactSolver.h */; };\n\t\t1AAF5309180E2EFE000584C8 /* b2EdgeAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F41807AF9C005B8026 /* b2EdgeAndCircleContact.cpp */; };\n\t\t1AAF530A180E2EFE000584C8 /* b2EdgeAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F51807AF9C005B8026 /* b2EdgeAndCircleContact.h */; };\n\t\t1AAF530B180E2EFE000584C8 /* b2EdgeAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F61807AF9C005B8026 /* b2EdgeAndPolygonContact.cpp */; };\n\t\t1AAF530C180E2EFE000584C8 /* b2EdgeAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F71807AF9C005B8026 /* b2EdgeAndPolygonContact.h */; };\n\t\t1AAF530D180E2EFE000584C8 /* b2PolygonAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168F81807AF9C005B8026 /* b2PolygonAndCircleContact.cpp */; };\n\t\t1AAF530E180E2EFE000584C8 /* b2PolygonAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168F91807AF9C005B8026 /* b2PolygonAndCircleContact.h */; };\n\t\t1AAF530F180E2EFE000584C8 /* b2PolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168FA1807AF9C005B8026 /* b2PolygonContact.cpp */; };\n\t\t1AAF5310180E2EFE000584C8 /* b2PolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168FB1807AF9C005B8026 /* b2PolygonContact.h */; };\n\t\t1AAF5311180E2F04000584C8 /* b2DistanceJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168FD1807AF9C005B8026 /* b2DistanceJoint.cpp */; };\n\t\t1AAF5312180E2F04000584C8 /* b2DistanceJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168FE1807AF9C005B8026 /* b2DistanceJoint.h */; };\n\t\t1AAF5313180E2F04000584C8 /* b2FrictionJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168FF1807AF9C005B8026 /* b2FrictionJoint.cpp */; };\n\t\t1AAF5314180E2F04000584C8 /* b2FrictionJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169001807AF9C005B8026 /* b2FrictionJoint.h */; };\n\t\t1AAF5315180E2F04000584C8 /* b2GearJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169011807AF9C005B8026 /* b2GearJoint.cpp */; };\n\t\t1AAF5316180E2F04000584C8 /* b2GearJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169021807AF9C005B8026 /* b2GearJoint.h */; };\n\t\t1AAF5317180E2F04000584C8 /* b2Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169031807AF9C005B8026 /* b2Joint.cpp */; };\n\t\t1AAF5318180E2F04000584C8 /* b2Joint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169041807AF9C005B8026 /* b2Joint.h */; };\n\t\t1AAF5319180E2F04000584C8 /* b2MouseJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169051807AF9C005B8026 /* b2MouseJoint.cpp */; };\n\t\t1AAF531A180E2F04000584C8 /* b2MouseJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169061807AF9C005B8026 /* b2MouseJoint.h */; };\n\t\t1AAF531B180E2F04000584C8 /* b2PrismaticJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169071807AF9C005B8026 /* b2PrismaticJoint.cpp */; };\n\t\t1AAF531C180E2F04000584C8 /* b2PrismaticJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169081807AF9C005B8026 /* b2PrismaticJoint.h */; };\n\t\t1AAF531D180E2F04000584C8 /* b2PulleyJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169091807AF9C005B8026 /* b2PulleyJoint.cpp */; };\n\t\t1AAF531E180E2F04000584C8 /* b2PulleyJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1690A1807AF9C005B8026 /* b2PulleyJoint.h */; };\n\t\t1AAF531F180E2F04000584C8 /* b2RevoluteJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1690B1807AF9C005B8026 /* b2RevoluteJoint.cpp */; };\n\t\t1AAF5320180E2F04000584C8 /* b2RevoluteJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1690C1807AF9C005B8026 /* b2RevoluteJoint.h */; };\n\t\t1AAF5321180E2F04000584C8 /* b2RopeJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1690D1807AF9C005B8026 /* b2RopeJoint.cpp */; };\n\t\t1AAF5322180E2F04000584C8 /* b2RopeJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1690E1807AF9C005B8026 /* b2RopeJoint.h */; };\n\t\t1AAF5323180E2F04000584C8 /* b2WeldJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1690F1807AF9C005B8026 /* b2WeldJoint.cpp */; };\n\t\t1AAF5324180E2F04000584C8 /* b2WeldJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169101807AF9C005B8026 /* b2WeldJoint.h */; };\n\t\t1AAF5325180E2F04000584C8 /* b2WheelJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169111807AF9C005B8026 /* b2WheelJoint.cpp */; };\n\t\t1AAF5326180E2F04000584C8 /* b2WheelJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169121807AF9C005B8026 /* b2WheelJoint.h */; };\n\t\t1AAF5327180E2F04000584C8 /* b2DistanceJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168FD1807AF9C005B8026 /* b2DistanceJoint.cpp */; };\n\t\t1AAF5328180E2F04000584C8 /* b2DistanceJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168FE1807AF9C005B8026 /* b2DistanceJoint.h */; };\n\t\t1AAF5329180E2F04000584C8 /* b2FrictionJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168FF1807AF9C005B8026 /* b2FrictionJoint.cpp */; };\n\t\t1AAF532A180E2F04000584C8 /* b2FrictionJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169001807AF9C005B8026 /* b2FrictionJoint.h */; };\n\t\t1AAF532B180E2F04000584C8 /* b2GearJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169011807AF9C005B8026 /* b2GearJoint.cpp */; };\n\t\t1AAF532C180E2F04000584C8 /* b2GearJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169021807AF9C005B8026 /* b2GearJoint.h */; };\n\t\t1AAF532D180E2F04000584C8 /* b2Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169031807AF9C005B8026 /* b2Joint.cpp */; };\n\t\t1AAF532E180E2F04000584C8 /* b2Joint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169041807AF9C005B8026 /* b2Joint.h */; };\n\t\t1AAF532F180E2F04000584C8 /* b2MouseJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169051807AF9C005B8026 /* b2MouseJoint.cpp */; };\n\t\t1AAF5330180E2F04000584C8 /* b2MouseJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169061807AF9C005B8026 /* b2MouseJoint.h */; };\n\t\t1AAF5331180E2F04000584C8 /* b2PrismaticJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169071807AF9C005B8026 /* b2PrismaticJoint.cpp */; };\n\t\t1AAF5332180E2F04000584C8 /* b2PrismaticJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169081807AF9C005B8026 /* b2PrismaticJoint.h */; };\n\t\t1AAF5333180E2F04000584C8 /* b2PulleyJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169091807AF9C005B8026 /* b2PulleyJoint.cpp */; };\n\t\t1AAF5334180E2F04000584C8 /* b2PulleyJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1690A1807AF9C005B8026 /* b2PulleyJoint.h */; };\n\t\t1AAF5335180E2F04000584C8 /* b2RevoluteJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1690B1807AF9C005B8026 /* b2RevoluteJoint.cpp */; };\n\t\t1AAF5336180E2F04000584C8 /* b2RevoluteJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1690C1807AF9C005B8026 /* b2RevoluteJoint.h */; };\n\t\t1AAF5337180E2F04000584C8 /* b2RopeJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1690D1807AF9C005B8026 /* b2RopeJoint.cpp */; };\n\t\t1AAF5338180E2F04000584C8 /* b2RopeJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1690E1807AF9C005B8026 /* b2RopeJoint.h */; };\n\t\t1AAF5339180E2F04000584C8 /* b2WeldJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1690F1807AF9C005B8026 /* b2WeldJoint.cpp */; };\n\t\t1AAF533A180E2F04000584C8 /* b2WeldJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169101807AF9C005B8026 /* b2WeldJoint.h */; };\n\t\t1AAF533B180E2F04000584C8 /* b2WheelJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169111807AF9C005B8026 /* b2WheelJoint.cpp */; };\n\t\t1AAF533C180E2F04000584C8 /* b2WheelJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169121807AF9C005B8026 /* b2WheelJoint.h */; };\n\t\t1AAF533D180E2F10000584C8 /* b2Rope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169321807AF9C005B8026 /* b2Rope.cpp */; };\n\t\t1AAF533E180E2F10000584C8 /* b2Rope.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169331807AF9C005B8026 /* b2Rope.h */; };\n\t\t1AAF533F180E2F11000584C8 /* b2Rope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A169321807AF9C005B8026 /* b2Rope.cpp */; };\n\t\t1AAF5340180E2F11000584C8 /* b2Rope.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169331807AF9C005B8026 /* b2Rope.h */; };\n\t\t1AAF5353180E3060000584C8 /* AssetsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5351180E3060000584C8 /* AssetsManager.cpp */; };\n\t\t1AAF5354180E3060000584C8 /* AssetsManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5351180E3060000584C8 /* AssetsManager.cpp */; };\n\t\t1AAF5355180E3060000584C8 /* AssetsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5352180E3060000584C8 /* AssetsManager.h */; };\n\t\t1AAF5356180E3060000584C8 /* AssetsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5352180E3060000584C8 /* AssetsManager.h */; };\n\t\t1AAF536A180E3374000584C8 /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5362180E3374000584C8 /* HttpClient.cpp */; };\n\t\t1AAF536B180E3374000584C8 /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5362180E3374000584C8 /* HttpClient.cpp */; };\n\t\t1AAF536C180E3374000584C8 /* HttpClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5363180E3374000584C8 /* HttpClient.h */; };\n\t\t1AAF536D180E3374000584C8 /* HttpClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5363180E3374000584C8 /* HttpClient.h */; };\n\t\t1AAF536E180E3374000584C8 /* HttpRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5364180E3374000584C8 /* HttpRequest.h */; };\n\t\t1AAF536F180E3374000584C8 /* HttpRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5364180E3374000584C8 /* HttpRequest.h */; };\n\t\t1AAF5370180E3374000584C8 /* HttpResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5365180E3374000584C8 /* HttpResponse.h */; };\n\t\t1AAF5371180E3374000584C8 /* HttpResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5365180E3374000584C8 /* HttpResponse.h */; };\n\t\t1AAF5372180E3374000584C8 /* SocketIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5366180E3374000584C8 /* SocketIO.cpp */; };\n\t\t1AAF5373180E3374000584C8 /* SocketIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5366180E3374000584C8 /* SocketIO.cpp */; };\n\t\t1AAF5374180E3374000584C8 /* SocketIO.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5367180E3374000584C8 /* SocketIO.h */; };\n\t\t1AAF5375180E3374000584C8 /* SocketIO.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5367180E3374000584C8 /* SocketIO.h */; };\n\t\t1AAF5376180E3374000584C8 /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5368180E3374000584C8 /* WebSocket.cpp */; };\n\t\t1AAF5377180E3374000584C8 /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5368180E3374000584C8 /* WebSocket.cpp */; };\n\t\t1AAF5378180E3374000584C8 /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5369180E3374000584C8 /* WebSocket.h */; };\n\t\t1AAF5379180E3374000584C8 /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5369180E3374000584C8 /* WebSocket.h */; };\n\t\t1AAF5385180E35A3000584C8 /* libwebsockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AAF5384180E35A3000584C8 /* libwebsockets.a */; };\n\t\t1AAF5388180E35AC000584C8 /* libwebsockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AAF5387180E35AC000584C8 /* libwebsockets.a */; };\n\t\t1AAF541D180E3B6A000584C8 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AAF541C180E3B6A000584C8 /* libcurl.a */; };\n\t\t1AAF584F180E40B9000584C8 /* LocalStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF584C180E40B9000584C8 /* LocalStorage.cpp */; };\n\t\t1AAF5850180E40B9000584C8 /* LocalStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF584C180E40B9000584C8 /* LocalStorage.cpp */; };\n\t\t1AAF5851180E40B9000584C8 /* LocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF584D180E40B9000584C8 /* LocalStorage.h */; };\n\t\t1AAF5852180E40B9000584C8 /* LocalStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF584D180E40B9000584C8 /* LocalStorage.h */; };\n\t\t1AAF5853180E40B9000584C8 /* LocalStorageAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF584E180E40B9000584C8 /* LocalStorageAndroid.cpp */; };\n\t\t1AAF5854180E40B9000584C8 /* LocalStorageAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF584E180E40B9000584C8 /* LocalStorageAndroid.cpp */; };\n\t\t1ABA68AE1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABA68AC1888D700007D1BB4 /* CCFontCharMap.cpp */; };\n\t\t1ABA68AF1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABA68AC1888D700007D1BB4 /* CCFontCharMap.cpp */; };\n\t\t1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABA68AD1888D700007D1BB4 /* CCFontCharMap.h */; };\n\t\t1ABA68B11888D700007D1BB4 /* CCFontCharMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABA68AD1888D700007D1BB4 /* CCFontCharMap.h */; };\n\t\t1AD71DA9180E26E600808F54 /* CCBAnimationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71CFA180E26E600808F54 /* CCBAnimationManager.cpp */; };\n\t\t1AD71DAA180E26E600808F54 /* CCBAnimationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71CFA180E26E600808F54 /* CCBAnimationManager.cpp */; };\n\t\t1AD71DAB180E26E600808F54 /* CCBAnimationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFB180E26E600808F54 /* CCBAnimationManager.h */; };\n\t\t1AD71DAC180E26E600808F54 /* CCBAnimationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFB180E26E600808F54 /* CCBAnimationManager.h */; };\n\t\t1AD71DAD180E26E600808F54 /* CCBFileLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71CFC180E26E600808F54 /* CCBFileLoader.cpp */; };\n\t\t1AD71DAE180E26E600808F54 /* CCBFileLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71CFC180E26E600808F54 /* CCBFileLoader.cpp */; };\n\t\t1AD71DAF180E26E600808F54 /* CCBFileLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFD180E26E600808F54 /* CCBFileLoader.h */; };\n\t\t1AD71DB0180E26E600808F54 /* CCBFileLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFD180E26E600808F54 /* CCBFileLoader.h */; };\n\t\t1AD71DB1180E26E600808F54 /* CCBKeyframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71CFE180E26E600808F54 /* CCBKeyframe.cpp */; };\n\t\t1AD71DB2180E26E600808F54 /* CCBKeyframe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71CFE180E26E600808F54 /* CCBKeyframe.cpp */; };\n\t\t1AD71DB3180E26E600808F54 /* CCBKeyframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFF180E26E600808F54 /* CCBKeyframe.h */; };\n\t\t1AD71DB4180E26E600808F54 /* CCBKeyframe.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71CFF180E26E600808F54 /* CCBKeyframe.h */; };\n\t\t1AD71DB5180E26E600808F54 /* CCBMemberVariableAssigner.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D00180E26E600808F54 /* CCBMemberVariableAssigner.h */; };\n\t\t1AD71DB6180E26E600808F54 /* CCBMemberVariableAssigner.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D00180E26E600808F54 /* CCBMemberVariableAssigner.h */; };\n\t\t1AD71DB7180E26E600808F54 /* CCBReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D01180E26E600808F54 /* CCBReader.cpp */; };\n\t\t1AD71DB8180E26E600808F54 /* CCBReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D01180E26E600808F54 /* CCBReader.cpp */; };\n\t\t1AD71DB9180E26E600808F54 /* CCBReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D02180E26E600808F54 /* CCBReader.h */; };\n\t\t1AD71DBA180E26E600808F54 /* CCBReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D02180E26E600808F54 /* CCBReader.h */; };\n\t\t1AD71DBB180E26E600808F54 /* CCBSelectorResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D03180E26E600808F54 /* CCBSelectorResolver.h */; };\n\t\t1AD71DBC180E26E600808F54 /* CCBSelectorResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D03180E26E600808F54 /* CCBSelectorResolver.h */; };\n\t\t1AD71DBD180E26E600808F54 /* CCBSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D04180E26E600808F54 /* CCBSequence.cpp */; };\n\t\t1AD71DBE180E26E600808F54 /* CCBSequence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D04180E26E600808F54 /* CCBSequence.cpp */; };\n\t\t1AD71DBF180E26E600808F54 /* CCBSequence.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D05180E26E600808F54 /* CCBSequence.h */; };\n\t\t1AD71DC0180E26E600808F54 /* CCBSequence.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D05180E26E600808F54 /* CCBSequence.h */; };\n\t\t1AD71DC1180E26E600808F54 /* CCBSequenceProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D06180E26E600808F54 /* CCBSequenceProperty.cpp */; };\n\t\t1AD71DC2180E26E600808F54 /* CCBSequenceProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D06180E26E600808F54 /* CCBSequenceProperty.cpp */; };\n\t\t1AD71DC3180E26E600808F54 /* CCBSequenceProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D07180E26E600808F54 /* CCBSequenceProperty.h */; };\n\t\t1AD71DC4180E26E600808F54 /* CCBSequenceProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D07180E26E600808F54 /* CCBSequenceProperty.h */; };\n\t\t1AD71DC9180E26E600808F54 /* CCControlButtonLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D0A180E26E600808F54 /* CCControlButtonLoader.cpp */; };\n\t\t1AD71DCA180E26E600808F54 /* CCControlButtonLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D0A180E26E600808F54 /* CCControlButtonLoader.cpp */; };\n\t\t1AD71DCB180E26E600808F54 /* CCControlButtonLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D0B180E26E600808F54 /* CCControlButtonLoader.h */; };\n\t\t1AD71DCC180E26E600808F54 /* CCControlButtonLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D0B180E26E600808F54 /* CCControlButtonLoader.h */; };\n\t\t1AD71DCD180E26E600808F54 /* CCControlLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D0C180E26E600808F54 /* CCControlLoader.cpp */; };\n\t\t1AD71DCE180E26E600808F54 /* CCControlLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D0C180E26E600808F54 /* CCControlLoader.cpp */; };\n\t\t1AD71DCF180E26E600808F54 /* CCControlLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D0D180E26E600808F54 /* CCControlLoader.h */; };\n\t\t1AD71DD0180E26E600808F54 /* CCControlLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D0D180E26E600808F54 /* CCControlLoader.h */; };\n\t\t1AD71DD1180E26E600808F54 /* CCLabelBMFontLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D0E180E26E600808F54 /* CCLabelBMFontLoader.cpp */; };\n\t\t1AD71DD2180E26E600808F54 /* CCLabelBMFontLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D0E180E26E600808F54 /* CCLabelBMFontLoader.cpp */; };\n\t\t1AD71DD3180E26E600808F54 /* CCLabelBMFontLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D0F180E26E600808F54 /* CCLabelBMFontLoader.h */; };\n\t\t1AD71DD4180E26E600808F54 /* CCLabelBMFontLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D0F180E26E600808F54 /* CCLabelBMFontLoader.h */; };\n\t\t1AD71DD5180E26E600808F54 /* CCLabelTTFLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D10180E26E600808F54 /* CCLabelTTFLoader.cpp */; };\n\t\t1AD71DD6180E26E600808F54 /* CCLabelTTFLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D10180E26E600808F54 /* CCLabelTTFLoader.cpp */; };\n\t\t1AD71DD7180E26E600808F54 /* CCLabelTTFLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D11180E26E600808F54 /* CCLabelTTFLoader.h */; };\n\t\t1AD71DD8180E26E600808F54 /* CCLabelTTFLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D11180E26E600808F54 /* CCLabelTTFLoader.h */; };\n\t\t1AD71DD9180E26E600808F54 /* CCLayerColorLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D12180E26E600808F54 /* CCLayerColorLoader.cpp */; };\n\t\t1AD71DDA180E26E600808F54 /* CCLayerColorLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D12180E26E600808F54 /* CCLayerColorLoader.cpp */; };\n\t\t1AD71DDB180E26E600808F54 /* CCLayerColorLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D13180E26E600808F54 /* CCLayerColorLoader.h */; };\n\t\t1AD71DDC180E26E600808F54 /* CCLayerColorLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D13180E26E600808F54 /* CCLayerColorLoader.h */; };\n\t\t1AD71DDD180E26E600808F54 /* CCLayerGradientLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D14180E26E600808F54 /* CCLayerGradientLoader.cpp */; };\n\t\t1AD71DDE180E26E600808F54 /* CCLayerGradientLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D14180E26E600808F54 /* CCLayerGradientLoader.cpp */; };\n\t\t1AD71DDF180E26E600808F54 /* CCLayerGradientLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D15180E26E600808F54 /* CCLayerGradientLoader.h */; };\n\t\t1AD71DE0180E26E600808F54 /* CCLayerGradientLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D15180E26E600808F54 /* CCLayerGradientLoader.h */; };\n\t\t1AD71DE1180E26E600808F54 /* CCLayerLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D16180E26E600808F54 /* CCLayerLoader.cpp */; };\n\t\t1AD71DE2180E26E600808F54 /* CCLayerLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D16180E26E600808F54 /* CCLayerLoader.cpp */; };\n\t\t1AD71DE3180E26E600808F54 /* CCLayerLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D17180E26E600808F54 /* CCLayerLoader.h */; };\n\t\t1AD71DE4180E26E600808F54 /* CCLayerLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D17180E26E600808F54 /* CCLayerLoader.h */; };\n\t\t1AD71DE5180E26E600808F54 /* CCMenuItemImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D18180E26E600808F54 /* CCMenuItemImageLoader.cpp */; };\n\t\t1AD71DE6180E26E600808F54 /* CCMenuItemImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D18180E26E600808F54 /* CCMenuItemImageLoader.cpp */; };\n\t\t1AD71DE7180E26E600808F54 /* CCMenuItemImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D19180E26E600808F54 /* CCMenuItemImageLoader.h */; };\n\t\t1AD71DE8180E26E600808F54 /* CCMenuItemImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D19180E26E600808F54 /* CCMenuItemImageLoader.h */; };\n\t\t1AD71DE9180E26E600808F54 /* CCMenuItemLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D1A180E26E600808F54 /* CCMenuItemLoader.cpp */; };\n\t\t1AD71DEA180E26E600808F54 /* CCMenuItemLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D1A180E26E600808F54 /* CCMenuItemLoader.cpp */; };\n\t\t1AD71DEB180E26E600808F54 /* CCMenuItemLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D1B180E26E600808F54 /* CCMenuItemLoader.h */; };\n\t\t1AD71DEC180E26E600808F54 /* CCMenuItemLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D1B180E26E600808F54 /* CCMenuItemLoader.h */; };\n\t\t1AD71DED180E26E600808F54 /* CCMenuLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D1C180E26E600808F54 /* CCMenuLoader.h */; };\n\t\t1AD71DEE180E26E600808F54 /* CCMenuLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D1C180E26E600808F54 /* CCMenuLoader.h */; };\n\t\t1AD71DEF180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D1D180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp */; };\n\t\t1AD71DF0180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D1D180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp */; };\n\t\t1AD71DF1180E26E600808F54 /* CCNode+CCBRelativePositioning.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D1E180E26E600808F54 /* CCNode+CCBRelativePositioning.h */; };\n\t\t1AD71DF2180E26E600808F54 /* CCNode+CCBRelativePositioning.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D1E180E26E600808F54 /* CCNode+CCBRelativePositioning.h */; };\n\t\t1AD71DF3180E26E600808F54 /* CCNodeLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D1F180E26E600808F54 /* CCNodeLoader.cpp */; };\n\t\t1AD71DF4180E26E600808F54 /* CCNodeLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D1F180E26E600808F54 /* CCNodeLoader.cpp */; };\n\t\t1AD71DF5180E26E600808F54 /* CCNodeLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D20180E26E600808F54 /* CCNodeLoader.h */; };\n\t\t1AD71DF6180E26E600808F54 /* CCNodeLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D20180E26E600808F54 /* CCNodeLoader.h */; };\n\t\t1AD71DF7180E26E600808F54 /* CCNodeLoaderLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D21180E26E600808F54 /* CCNodeLoaderLibrary.cpp */; };\n\t\t1AD71DF8180E26E600808F54 /* CCNodeLoaderLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D21180E26E600808F54 /* CCNodeLoaderLibrary.cpp */; };\n\t\t1AD71DF9180E26E600808F54 /* CCNodeLoaderLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D22180E26E600808F54 /* CCNodeLoaderLibrary.h */; };\n\t\t1AD71DFA180E26E600808F54 /* CCNodeLoaderLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D22180E26E600808F54 /* CCNodeLoaderLibrary.h */; };\n\t\t1AD71DFB180E26E600808F54 /* CCNodeLoaderListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D23180E26E600808F54 /* CCNodeLoaderListener.h */; };\n\t\t1AD71DFC180E26E600808F54 /* CCNodeLoaderListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D23180E26E600808F54 /* CCNodeLoaderListener.h */; };\n\t\t1AD71DFD180E26E600808F54 /* CCParticleSystemQuadLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D24180E26E600808F54 /* CCParticleSystemQuadLoader.cpp */; };\n\t\t1AD71DFE180E26E600808F54 /* CCParticleSystemQuadLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D24180E26E600808F54 /* CCParticleSystemQuadLoader.cpp */; };\n\t\t1AD71DFF180E26E600808F54 /* CCParticleSystemQuadLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D25180E26E600808F54 /* CCParticleSystemQuadLoader.h */; };\n\t\t1AD71E00180E26E600808F54 /* CCParticleSystemQuadLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D25180E26E600808F54 /* CCParticleSystemQuadLoader.h */; };\n\t\t1AD71E01180E26E600808F54 /* CCScale9SpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D26180E26E600808F54 /* CCScale9SpriteLoader.cpp */; };\n\t\t1AD71E02180E26E600808F54 /* CCScale9SpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D26180E26E600808F54 /* CCScale9SpriteLoader.cpp */; };\n\t\t1AD71E03180E26E600808F54 /* CCScale9SpriteLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D27180E26E600808F54 /* CCScale9SpriteLoader.h */; };\n\t\t1AD71E04180E26E600808F54 /* CCScale9SpriteLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D27180E26E600808F54 /* CCScale9SpriteLoader.h */; };\n\t\t1AD71E05180E26E600808F54 /* CCScrollViewLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D28180E26E600808F54 /* CCScrollViewLoader.cpp */; };\n\t\t1AD71E06180E26E600808F54 /* CCScrollViewLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D28180E26E600808F54 /* CCScrollViewLoader.cpp */; };\n\t\t1AD71E07180E26E600808F54 /* CCScrollViewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D29180E26E600808F54 /* CCScrollViewLoader.h */; };\n\t\t1AD71E08180E26E600808F54 /* CCScrollViewLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D29180E26E600808F54 /* CCScrollViewLoader.h */; };\n\t\t1AD71E09180E26E600808F54 /* CCSpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D2A180E26E600808F54 /* CCSpriteLoader.cpp */; };\n\t\t1AD71E0A180E26E600808F54 /* CCSpriteLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D2A180E26E600808F54 /* CCSpriteLoader.cpp */; };\n\t\t1AD71E0B180E26E600808F54 /* CCSpriteLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D2B180E26E600808F54 /* CCSpriteLoader.h */; };\n\t\t1AD71E0C180E26E600808F54 /* CCSpriteLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D2B180E26E600808F54 /* CCSpriteLoader.h */; };\n\t\t1AD71E0D180E26E600808F54 /* CocosBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D2C180E26E600808F54 /* CocosBuilder.h */; };\n\t\t1AD71E0E180E26E600808F54 /* CocosBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D2C180E26E600808F54 /* CocosBuilder.h */; };\n\t\t1AD71E95180E26E600808F54 /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D7E180E26E600808F54 /* Animation.cpp */; };\n\t\t1AD71E96180E26E600808F54 /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D7E180E26E600808F54 /* Animation.cpp */; };\n\t\t1AD71E97180E26E600808F54 /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D7F180E26E600808F54 /* Animation.h */; };\n\t\t1AD71E98180E26E600808F54 /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D7F180E26E600808F54 /* Animation.h */; };\n\t\t1AD71E99180E26E600808F54 /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D80180E26E600808F54 /* AnimationState.cpp */; };\n\t\t1AD71E9A180E26E600808F54 /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D80180E26E600808F54 /* AnimationState.cpp */; };\n\t\t1AD71E9B180E26E600808F54 /* AnimationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D81180E26E600808F54 /* AnimationState.h */; };\n\t\t1AD71E9C180E26E600808F54 /* AnimationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D81180E26E600808F54 /* AnimationState.h */; };\n\t\t1AD71E9D180E26E600808F54 /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D82180E26E600808F54 /* AnimationStateData.cpp */; };\n\t\t1AD71E9E180E26E600808F54 /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D82180E26E600808F54 /* AnimationStateData.cpp */; };\n\t\t1AD71E9F180E26E600808F54 /* AnimationStateData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D83180E26E600808F54 /* AnimationStateData.h */; };\n\t\t1AD71EA0180E26E600808F54 /* AnimationStateData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D83180E26E600808F54 /* AnimationStateData.h */; };\n\t\t1AD71EA1180E26E600808F54 /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D84180E26E600808F54 /* Atlas.cpp */; };\n\t\t1AD71EA2180E26E600808F54 /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D84180E26E600808F54 /* Atlas.cpp */; };\n\t\t1AD71EA3180E26E600808F54 /* Atlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D85180E26E600808F54 /* Atlas.h */; };\n\t\t1AD71EA4180E26E600808F54 /* Atlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D85180E26E600808F54 /* Atlas.h */; };\n\t\t1AD71EA5180E26E600808F54 /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D86180E26E600808F54 /* AtlasAttachmentLoader.cpp */; };\n\t\t1AD71EA6180E26E600808F54 /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D86180E26E600808F54 /* AtlasAttachmentLoader.cpp */; };\n\t\t1AD71EA7180E26E600808F54 /* AtlasAttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D87180E26E600808F54 /* AtlasAttachmentLoader.h */; };\n\t\t1AD71EA8180E26E600808F54 /* AtlasAttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D87180E26E600808F54 /* AtlasAttachmentLoader.h */; };\n\t\t1AD71EA9180E26E600808F54 /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D88180E26E600808F54 /* Attachment.cpp */; };\n\t\t1AD71EAA180E26E600808F54 /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D88180E26E600808F54 /* Attachment.cpp */; };\n\t\t1AD71EAB180E26E600808F54 /* Attachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D89180E26E600808F54 /* Attachment.h */; };\n\t\t1AD71EAC180E26E600808F54 /* Attachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D89180E26E600808F54 /* Attachment.h */; };\n\t\t1AD71EAD180E26E600808F54 /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D8A180E26E600808F54 /* AttachmentLoader.cpp */; };\n\t\t1AD71EAE180E26E600808F54 /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D8A180E26E600808F54 /* AttachmentLoader.cpp */; };\n\t\t1AD71EAF180E26E600808F54 /* AttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D8B180E26E600808F54 /* AttachmentLoader.h */; };\n\t\t1AD71EB0180E26E600808F54 /* AttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D8B180E26E600808F54 /* AttachmentLoader.h */; };\n\t\t1AD71EB1180E26E600808F54 /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D8C180E26E600808F54 /* Bone.cpp */; };\n\t\t1AD71EB2180E26E600808F54 /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D8C180E26E600808F54 /* Bone.cpp */; };\n\t\t1AD71EB3180E26E600808F54 /* Bone.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D8D180E26E600808F54 /* Bone.h */; };\n\t\t1AD71EB4180E26E600808F54 /* Bone.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D8D180E26E600808F54 /* Bone.h */; };\n\t\t1AD71EB5180E26E600808F54 /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D8E180E26E600808F54 /* BoneData.cpp */; };\n\t\t1AD71EB6180E26E600808F54 /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D8E180E26E600808F54 /* BoneData.cpp */; };\n\t\t1AD71EB7180E26E600808F54 /* BoneData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D8F180E26E600808F54 /* BoneData.h */; };\n\t\t1AD71EB8180E26E600808F54 /* BoneData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D8F180E26E600808F54 /* BoneData.h */; };\n\t\t1AD71EB9180E26E600808F54 /* CCSkeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D90180E26E600808F54 /* CCSkeleton.cpp */; };\n\t\t1AD71EBA180E26E600808F54 /* CCSkeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D90180E26E600808F54 /* CCSkeleton.cpp */; };\n\t\t1AD71EBB180E26E600808F54 /* CCSkeleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D91180E26E600808F54 /* CCSkeleton.h */; };\n\t\t1AD71EBC180E26E600808F54 /* CCSkeleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D91180E26E600808F54 /* CCSkeleton.h */; };\n\t\t1AD71EBD180E26E600808F54 /* CCSkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D92180E26E600808F54 /* CCSkeletonAnimation.cpp */; };\n\t\t1AD71EBE180E26E600808F54 /* CCSkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D92180E26E600808F54 /* CCSkeletonAnimation.cpp */; };\n\t\t1AD71EBF180E26E600808F54 /* CCSkeletonAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D93180E26E600808F54 /* CCSkeletonAnimation.h */; };\n\t\t1AD71EC0180E26E600808F54 /* CCSkeletonAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D93180E26E600808F54 /* CCSkeletonAnimation.h */; };\n\t\t1AD71EC1180E26E600808F54 /* extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D94180E26E600808F54 /* extension.cpp */; };\n\t\t1AD71EC2180E26E600808F54 /* extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D94180E26E600808F54 /* extension.cpp */; };\n\t\t1AD71EC3180E26E600808F54 /* extension.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D95180E26E600808F54 /* extension.h */; };\n\t\t1AD71EC4180E26E600808F54 /* extension.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D95180E26E600808F54 /* extension.h */; };\n\t\t1AD71EC5180E26E600808F54 /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D96180E26E600808F54 /* Json.cpp */; };\n\t\t1AD71EC6180E26E600808F54 /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D96180E26E600808F54 /* Json.cpp */; };\n\t\t1AD71EC7180E26E600808F54 /* Json.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D97180E26E600808F54 /* Json.h */; };\n\t\t1AD71EC8180E26E600808F54 /* Json.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D97180E26E600808F54 /* Json.h */; };\n\t\t1AD71EC9180E26E600808F54 /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D98180E26E600808F54 /* RegionAttachment.cpp */; };\n\t\t1AD71ECA180E26E600808F54 /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D98180E26E600808F54 /* RegionAttachment.cpp */; };\n\t\t1AD71ECB180E26E600808F54 /* RegionAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D99180E26E600808F54 /* RegionAttachment.h */; };\n\t\t1AD71ECC180E26E600808F54 /* RegionAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D99180E26E600808F54 /* RegionAttachment.h */; };\n\t\t1AD71ECD180E26E600808F54 /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D9A180E26E600808F54 /* Skeleton.cpp */; };\n\t\t1AD71ECE180E26E600808F54 /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D9A180E26E600808F54 /* Skeleton.cpp */; };\n\t\t1AD71ECF180E26E600808F54 /* Skeleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D9B180E26E600808F54 /* Skeleton.h */; };\n\t\t1AD71ED0180E26E600808F54 /* Skeleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D9B180E26E600808F54 /* Skeleton.h */; };\n\t\t1AD71ED1180E26E600808F54 /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D9C180E26E600808F54 /* SkeletonData.cpp */; };\n\t\t1AD71ED2180E26E600808F54 /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D9C180E26E600808F54 /* SkeletonData.cpp */; };\n\t\t1AD71ED3180E26E600808F54 /* SkeletonData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D9D180E26E600808F54 /* SkeletonData.h */; };\n\t\t1AD71ED4180E26E600808F54 /* SkeletonData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D9D180E26E600808F54 /* SkeletonData.h */; };\n\t\t1AD71ED5180E26E600808F54 /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D9E180E26E600808F54 /* SkeletonJson.cpp */; };\n\t\t1AD71ED6180E26E600808F54 /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71D9E180E26E600808F54 /* SkeletonJson.cpp */; };\n\t\t1AD71ED7180E26E600808F54 /* SkeletonJson.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D9F180E26E600808F54 /* SkeletonJson.h */; };\n\t\t1AD71ED8180E26E600808F54 /* SkeletonJson.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71D9F180E26E600808F54 /* SkeletonJson.h */; };\n\t\t1AD71ED9180E26E600808F54 /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA0180E26E600808F54 /* Skin.cpp */; };\n\t\t1AD71EDA180E26E600808F54 /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA0180E26E600808F54 /* Skin.cpp */; };\n\t\t1AD71EDB180E26E600808F54 /* Skin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA1180E26E600808F54 /* Skin.h */; };\n\t\t1AD71EDC180E26E600808F54 /* Skin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA1180E26E600808F54 /* Skin.h */; };\n\t\t1AD71EDD180E26E600808F54 /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA2180E26E600808F54 /* Slot.cpp */; };\n\t\t1AD71EDE180E26E600808F54 /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA2180E26E600808F54 /* Slot.cpp */; };\n\t\t1AD71EDF180E26E600808F54 /* Slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA3180E26E600808F54 /* Slot.h */; };\n\t\t1AD71EE0180E26E600808F54 /* Slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA3180E26E600808F54 /* Slot.h */; };\n\t\t1AD71EE1180E26E600808F54 /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA4180E26E600808F54 /* SlotData.cpp */; };\n\t\t1AD71EE2180E26E600808F54 /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA4180E26E600808F54 /* SlotData.cpp */; };\n\t\t1AD71EE3180E26E600808F54 /* SlotData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA5180E26E600808F54 /* SlotData.h */; };\n\t\t1AD71EE4180E26E600808F54 /* SlotData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA5180E26E600808F54 /* SlotData.h */; };\n\t\t1AD71EE5180E26E600808F54 /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA6180E26E600808F54 /* spine-cocos2dx.cpp */; };\n\t\t1AD71EE6180E26E600808F54 /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71DA6180E26E600808F54 /* spine-cocos2dx.cpp */; };\n\t\t1AD71EE7180E26E600808F54 /* spine-cocos2dx.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA7180E26E600808F54 /* spine-cocos2dx.h */; };\n\t\t1AD71EE8180E26E600808F54 /* spine-cocos2dx.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA7180E26E600808F54 /* spine-cocos2dx.h */; };\n\t\t1AD71EE9180E26E600808F54 /* spine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA8180E26E600808F54 /* spine.h */; };\n\t\t1AD71EEA180E26E600808F54 /* spine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71DA8180E26E600808F54 /* spine.h */; };\n\t\t1AD71EF0180E27CF00808F54 /* CCPhysicsDebugNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEC180E27CF00808F54 /* CCPhysicsDebugNode.cpp */; };\n\t\t1AD71EF1180E27CF00808F54 /* CCPhysicsDebugNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEC180E27CF00808F54 /* CCPhysicsDebugNode.cpp */; };\n\t\t1AD71EF2180E27CF00808F54 /* CCPhysicsDebugNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EED180E27CF00808F54 /* CCPhysicsDebugNode.h */; };\n\t\t1AD71EF3180E27CF00808F54 /* CCPhysicsDebugNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EED180E27CF00808F54 /* CCPhysicsDebugNode.h */; };\n\t\t1AD71EF4180E27CF00808F54 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */; };\n\t\t1AD71EF5180E27CF00808F54 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */; };\n\t\t1AD71EF6180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; };\n\t\t1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; };\n\t\t1AE3C844184F14F700CF29B5 /* CCValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE3C842184F14F700CF29B5 /* CCValue.cpp */; };\n\t\t1AE3C845184F14F700CF29B5 /* CCValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE3C842184F14F700CF29B5 /* CCValue.cpp */; };\n\t\t1AE3C846184F14F700CF29B5 /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE3C843184F14F700CF29B5 /* CCValue.h */; };\n\t\t1AE3C847184F14F700CF29B5 /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE3C843184F14F700CF29B5 /* CCValue.h */; };\n\t\t2AC795DB1862870F005EC8E1 /* SkeletonBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D918628689005EC8E1 /* SkeletonBounds.cpp */; };\n\t\t2AC795DC1862870F005EC8E1 /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D51862867D005EC8E1 /* Event.cpp */; };\n\t\t2AC795DD1862870F005EC8E1 /* EventData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D71862867D005EC8E1 /* EventData.cpp */; };\n\t\t2AC795DE1862870F005EC8E1 /* BoundingBoxAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D318628672005EC8E1 /* BoundingBoxAttachment.cpp */; };\n\t\t2AC795DF18628723005EC8E1 /* SkeletonBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795DA18628689005EC8E1 /* SkeletonBounds.h */; };\n\t\t2AC795E018628723005EC8E1 /* Event.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D61862867D005EC8E1 /* Event.h */; };\n\t\t2AC795E118628723005EC8E1 /* EventData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D81862867D005EC8E1 /* EventData.h */; };\n\t\t2AC795E218628723005EC8E1 /* BoundingBoxAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D418628672005EC8E1 /* BoundingBoxAttachment.h */; };\n\t\t2AC795E318628746005EC8E1 /* SkeletonBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D918628689005EC8E1 /* SkeletonBounds.cpp */; };\n\t\t2AC795E418628746005EC8E1 /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D51862867D005EC8E1 /* Event.cpp */; };\n\t\t2AC795E518628746005EC8E1 /* EventData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D71862867D005EC8E1 /* EventData.cpp */; };\n\t\t2AC795E618628746005EC8E1 /* BoundingBoxAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC795D318628672005EC8E1 /* BoundingBoxAttachment.cpp */; };\n\t\t2AC795E71862875D005EC8E1 /* SkeletonBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795DA18628689005EC8E1 /* SkeletonBounds.h */; };\n\t\t2AC795E81862875D005EC8E1 /* Event.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D61862867D005EC8E1 /* Event.h */; };\n\t\t2AC795E91862875D005EC8E1 /* EventData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D81862867D005EC8E1 /* EventData.h */; };\n\t\t2AC795EA1862875D005EC8E1 /* BoundingBoxAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC795D418628672005EC8E1 /* BoundingBoxAttachment.h */; };\n\t\t2AFCB8211863D67F00EB4B5C /* jsb_cocos2dx_spine_auto.cpp in Headers */ = {isa = PBXBuildFile; fileRef = 2AFCB81F1863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.cpp */; };\n\t\t2AFCB8221863D68B00EB4B5C /* jsb_cocos2dx_spine_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2AFCB8201863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.hpp */; };\n\t\t2AFCB8231863D6B200EB4B5C /* jsb_cocos2dx_spine_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCB81F1863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.cpp */; };\n\t\t2AFCB8241863D6F600EB4B5C /* jsb_cocos2dx_spine_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AFCB81F1863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.cpp */; };\n\t\t2AFCB8251863D70300EB4B5C /* jsb_cocos2dx_spine_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 2AFCB8201863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.hpp */; };\n\t\t373B9129187891F400198F86 /* CCComBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 373B910718787C0B00198F86 /* CCComBase.h */; };\n\t\t373B912A187891FB00198F86 /* CCComBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 373B910718787C0B00198F86 /* CCComBase.h */; };\n\t\t3774879F1869BA8C00EDF837 /* CCActionEaseEx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3774879E1869BA8C00EDF837 /* CCActionEaseEx.cpp */; };\n\t\t3EEF8BD31839FFAF005E8A6C /* jsb_cocos2dx_gui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EEF8BCB1839F390005E8A6C /* jsb_cocos2dx_gui_auto.cpp */; };\n\t\t3EEF8BD41839FFAF005E8A6C /* jsb_cocos2dx_gui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EEF8BD11839F5C5005E8A6C /* jsb_cocos2dx_gui_manual.cpp */; };\n\t\t3EEF8BD5183A001B005E8A6C /* jsb_cocos2dx_gui_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EEF8BCB1839F390005E8A6C /* jsb_cocos2dx_gui_auto.cpp */; };\n\t\t3EEF8BD6183A001B005E8A6C /* jsb_cocos2dx_gui_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3EEF8BD11839F5C5005E8A6C /* jsb_cocos2dx_gui_manual.cpp */; };\n\t\t460E44EF1807DED6000CDD6D /* mat4stack.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1709D1807CE87005B8026 /* mat4stack.c */; };\n\t\t460E44F01807DED6000CDD6D /* matrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1709E1807CE87005B8026 /* matrix.c */; };\n\t\t460E44F11807DED7000CDD6D /* mat4stack.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1709D1807CE87005B8026 /* mat4stack.c */; };\n\t\t460E44F21807DED8000CDD6D /* matrix.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1709E1807CE87005B8026 /* matrix.c */; };\n\t\t460E468118080832000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; };\n\t\t460E468218080836000CDD6D /* cocos-ext.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A167D21807AF4D005B8026 /* cocos-ext.h */; };\n\t\t460E477B180808F5000CDD6D /* ExtensionMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168321807AF4E005B8026 /* ExtensionMacros.h */; };\n\t\t460E477C180808F7000CDD6D /* ExtensionMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168321807AF4E005B8026 /* ExtensionMacros.h */; };\n\t\t460E477D18080902000CDD6D /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168351807AF4E005B8026 /* CCControl.cpp */; };\n\t\t460E477E18080902000CDD6D /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168361807AF4E005B8026 /* CCControl.h */; };\n\t\t460E477F18080902000CDD6D /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; };\n\t\t460E478018080902000CDD6D /* CCControlButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168381807AF4E005B8026 /* CCControlButton.h */; };\n\t\t460E478118080902000CDD6D /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */; };\n\t\t460E478218080902000CDD6D /* CCControlColourPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */; };\n\t\t460E478318080902000CDD6D /* CCControlExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683B1807AF4E005B8026 /* CCControlExtensions.h */; };\n\t\t460E478418080902000CDD6D /* CCControlHuePicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */; };\n\t\t460E478518080902000CDD6D /* CCControlHuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */; };\n\t\t460E478618080902000CDD6D /* CCControlPotentiometer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */; };\n\t\t460E478718080902000CDD6D /* CCControlPotentiometer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */; };\n\t\t460E478818080902000CDD6D /* CCControlSaturationBrightnessPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */; };\n\t\t460E478918080902000CDD6D /* CCControlSaturationBrightnessPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */; };\n\t\t460E478A18080902000CDD6D /* CCControlSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168421807AF4E005B8026 /* CCControlSlider.cpp */; };\n\t\t460E478B18080902000CDD6D /* CCControlSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168431807AF4E005B8026 /* CCControlSlider.h */; };\n\t\t460E478C18080902000CDD6D /* CCControlStepper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168441807AF4E005B8026 /* CCControlStepper.cpp */; };\n\t\t460E478D18080902000CDD6D /* CCControlStepper.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168451807AF4E005B8026 /* CCControlStepper.h */; };\n\t\t460E478E18080902000CDD6D /* CCControlSwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168461807AF4E005B8026 /* CCControlSwitch.cpp */; };\n\t\t460E478F18080902000CDD6D /* CCControlSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168471807AF4E005B8026 /* CCControlSwitch.h */; };\n\t\t460E479018080902000CDD6D /* CCControlUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168481807AF4E005B8026 /* CCControlUtils.cpp */; };\n\t\t460E479118080902000CDD6D /* CCControlUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168491807AF4E005B8026 /* CCControlUtils.h */; };\n\t\t460E479218080902000CDD6D /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */; };\n\t\t460E479318080902000CDD6D /* CCInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684B1807AF4E005B8026 /* CCInvocation.h */; };\n\t\t460E479418080902000CDD6D /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */; };\n\t\t460E479518080902000CDD6D /* CCScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */; };\n\t\t460E479618080904000CDD6D /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168351807AF4E005B8026 /* CCControl.cpp */; };\n\t\t460E479718080904000CDD6D /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168361807AF4E005B8026 /* CCControl.h */; };\n\t\t460E479818080904000CDD6D /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; };\n\t\t460E479918080904000CDD6D /* CCControlButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168381807AF4E005B8026 /* CCControlButton.h */; };\n\t\t460E479A18080904000CDD6D /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */; };\n\t\t460E479B18080904000CDD6D /* CCControlColourPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */; };\n\t\t460E479C18080904000CDD6D /* CCControlExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683B1807AF4E005B8026 /* CCControlExtensions.h */; };\n\t\t460E479D18080904000CDD6D /* CCControlHuePicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */; };\n\t\t460E479E18080904000CDD6D /* CCControlHuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */; };\n\t\t460E479F18080904000CDD6D /* CCControlPotentiometer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */; };\n\t\t460E47A018080904000CDD6D /* CCControlPotentiometer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */; };\n\t\t460E47A118080904000CDD6D /* CCControlSaturationBrightnessPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */; };\n\t\t460E47A218080904000CDD6D /* CCControlSaturationBrightnessPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */; };\n\t\t460E47A318080904000CDD6D /* CCControlSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168421807AF4E005B8026 /* CCControlSlider.cpp */; };\n\t\t460E47A418080904000CDD6D /* CCControlSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168431807AF4E005B8026 /* CCControlSlider.h */; };\n\t\t460E47A518080904000CDD6D /* CCControlStepper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168441807AF4E005B8026 /* CCControlStepper.cpp */; };\n\t\t460E47A618080904000CDD6D /* CCControlStepper.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168451807AF4E005B8026 /* CCControlStepper.h */; };\n\t\t460E47A718080904000CDD6D /* CCControlSwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168461807AF4E005B8026 /* CCControlSwitch.cpp */; };\n\t\t460E47A818080904000CDD6D /* CCControlSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168471807AF4E005B8026 /* CCControlSwitch.h */; };\n\t\t460E47A918080904000CDD6D /* CCControlUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168481807AF4E005B8026 /* CCControlUtils.cpp */; };\n\t\t460E47AA18080904000CDD6D /* CCControlUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168491807AF4E005B8026 /* CCControlUtils.h */; };\n\t\t460E47AB18080904000CDD6D /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */; };\n\t\t460E47AC18080904000CDD6D /* CCInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684B1807AF4E005B8026 /* CCInvocation.h */; };\n\t\t460E47AD18080904000CDD6D /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */; };\n\t\t460E47AE18080904000CDD6D /* CCScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */; };\n\t\t460E47AF1808090B000CDD6D /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */; };\n\t\t460E47B01808090B000CDD6D /* CCEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168501807AF4E005B8026 /* CCEditBox.h */; };\n\t\t460E47B11808090B000CDD6D /* CCEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */; };\n\t\t460E47B21808090B000CDD6D /* CCEditBoxImplAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */; };\n\t\t460E47B31808090B000CDD6D /* CCEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */; };\n\t\t460E47B41808090B000CDD6D /* CCEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */; };\n\t\t460E47B51808090B000CDD6D /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */; };\n\t\t460E47B61808090B000CDD6D /* CCEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */; };\n\t\t460E47B71808090B000CDD6D /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */; };\n\t\t460E47B81808090B000CDD6D /* CCEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */; };\n\t\t460E47B91808090B000CDD6D /* CCEditBoxImplTizen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168591807AF4E005B8026 /* CCEditBoxImplTizen.cpp */; };\n\t\t460E47BA1808090B000CDD6D /* CCEditBoxImplTizen.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685A1807AF4E005B8026 /* CCEditBoxImplTizen.h */; };\n\t\t460E47BB1808090B000CDD6D /* CCEditBoxImplWin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */; };\n\t\t460E47BC1808090B000CDD6D /* CCEditBoxImplWin.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */; };\n\t\t460E47BD1808090D000CDD6D /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */; };\n\t\t460E47BE1808090D000CDD6D /* CCEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168501807AF4E005B8026 /* CCEditBox.h */; };\n\t\t460E47BF1808090D000CDD6D /* CCEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */; };\n\t\t460E47C01808090D000CDD6D /* CCEditBoxImplAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */; };\n\t\t460E47C11808090D000CDD6D /* CCEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */; };\n\t\t460E47C21808090D000CDD6D /* CCEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */; };\n\t\t460E47C31808090D000CDD6D /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */; };\n\t\t460E47C41808090D000CDD6D /* CCEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */; };\n\t\t460E47C51808090D000CDD6D /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */; };\n\t\t460E47C61808090D000CDD6D /* CCEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */; };\n\t\t460E47C71808090D000CDD6D /* CCEditBoxImplTizen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168591807AF4E005B8026 /* CCEditBoxImplTizen.cpp */; };\n\t\t460E47C81808090D000CDD6D /* CCEditBoxImplTizen.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685A1807AF4E005B8026 /* CCEditBoxImplTizen.h */; };\n\t\t460E47C91808090D000CDD6D /* CCEditBoxImplWin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */; };\n\t\t460E47CA1808090D000CDD6D /* CCEditBoxImplWin.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */; };\n\t\t460E47CB18080913000CDD6D /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */; };\n\t\t460E47CC18080913000CDD6D /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685F1807AF4E005B8026 /* CCScrollView.h */; };\n\t\t460E47CF18080913000CDD6D /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168621807AF4E005B8026 /* CCTableView.cpp */; };\n\t\t460E47D018080913000CDD6D /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168631807AF4E005B8026 /* CCTableView.h */; };\n\t\t460E47D118080913000CDD6D /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */; };\n\t\t460E47D218080913000CDD6D /* CCTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168651807AF4E005B8026 /* CCTableViewCell.h */; };\n\t\t460E47D318080914000CDD6D /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */; };\n\t\t460E47D418080914000CDD6D /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685F1807AF4E005B8026 /* CCScrollView.h */; };\n\t\t460E47D718080914000CDD6D /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168621807AF4E005B8026 /* CCTableView.cpp */; };\n\t\t460E47D818080914000CDD6D /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168631807AF4E005B8026 /* CCTableView.h */; };\n\t\t460E47D918080914000CDD6D /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */; };\n\t\t460E47DA18080914000CDD6D /* CCTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168651807AF4E005B8026 /* CCTableViewCell.h */; };\n\t\t46A160421807A5D4005B8026 /* Export.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE11807A56F005B8026 /* Export.h */; };\n\t\t46A160431807A5D4005B8026 /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE21807A56F005B8026 /* SimpleAudioEngine.h */; };\n\t\t46A160441807A5D4005B8026 /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FF41807A56F005B8026 /* CDAudioManager.h */; };\n\t\t46A160451807A5D4005B8026 /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FF51807A56F005B8026 /* CDAudioManager.m */; };\n\t\t46A160461807A5D4005B8026 /* CDConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FF61807A56F005B8026 /* CDConfig.h */; };\n\t\t46A160471807A5D4005B8026 /* CDOpenALSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FF71807A56F005B8026 /* CDOpenALSupport.h */; };\n\t\t46A160481807A5D4005B8026 /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FF81807A56F005B8026 /* CDOpenALSupport.m */; };\n\t\t46A160491807A5D4005B8026 /* CDXMacOSXSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FF91807A56F005B8026 /* CDXMacOSXSupport.h */; };\n\t\t46A1604A1807A5D4005B8026 /* CDXMacOSXSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FFA1807A56F005B8026 /* CDXMacOSXSupport.mm */; };\n\t\t46A1604B1807A5D4005B8026 /* CocosDenshion.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FFB1807A56F005B8026 /* CocosDenshion.h */; };\n\t\t46A1604C1807A5D4005B8026 /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FFC1807A56F005B8026 /* CocosDenshion.m */; };\n\t\t46A1604D1807A5D4005B8026 /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FFD1807A56F005B8026 /* SimpleAudioEngine.mm */; };\n\t\t46A1604E1807A5D4005B8026 /* SimpleAudioEngine_objc.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FFE1807A56F005B8026 /* SimpleAudioEngine_objc.h */; };\n\t\t46A1604F1807A5D4005B8026 /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FFF1807A56F005B8026 /* SimpleAudioEngine_objc.m */; };\n\t\t46A160501807A5EB005B8026 /* Export.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE11807A56F005B8026 /* Export.h */; };\n\t\t46A160511807A5EB005B8026 /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE21807A56F005B8026 /* SimpleAudioEngine.h */; };\n\t\t46A160521807A5EB005B8026 /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE41807A56F005B8026 /* CDAudioManager.h */; };\n\t\t46A160531807A5EB005B8026 /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FE51807A56F005B8026 /* CDAudioManager.m */; };\n\t\t46A160541807A5EB005B8026 /* CDConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE61807A56F005B8026 /* CDConfig.h */; };\n\t\t46A160551807A5EB005B8026 /* CDOpenALSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE71807A56F005B8026 /* CDOpenALSupport.h */; };\n\t\t46A160561807A5EB005B8026 /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FE81807A56F005B8026 /* CDOpenALSupport.m */; };\n\t\t46A160571807A5EB005B8026 /* CocosDenshion.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FE91807A56F005B8026 /* CocosDenshion.h */; };\n\t\t46A160581807A5EB005B8026 /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FEA1807A56F005B8026 /* CocosDenshion.m */; };\n\t\t46A160591807A5EB005B8026 /* SimpleAudioEngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FEB1807A56F005B8026 /* SimpleAudioEngine.mm */; };\n\t\t46A1605A1807A5EB005B8026 /* SimpleAudioEngine_objc.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A15FEC1807A56F005B8026 /* SimpleAudioEngine_objc.h */; };\n\t\t46A1605B1807A5EB005B8026 /* SimpleAudioEngine_objc.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A15FED1807A56F005B8026 /* SimpleAudioEngine_objc.m */; };\n\t\t46A170131807CBFC005B8026 /* CCFileUtilsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */; };\n\t\t46A170141807CBFC005B8026 /* CCFileUtilsApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A901807B038005B8026 /* CCFileUtilsApple.mm */; };\n\t\t46A170151807CBFC005B8026 /* CCLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A911807B038005B8026 /* CCLock.cpp */; };\n\t\t46A170161807CBFC005B8026 /* CCLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A921807B038005B8026 /* CCLock.h */; };\n\t\t46A170171807CBFC005B8026 /* CCThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A931807B038005B8026 /* CCThread.mm */; };\n\t\t46A170181807CBFC005B8026 /* CCApplicationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A941807B038005B8026 /* CCApplicationProtocol.h */; };\n\t\t46A170191807CBFC005B8026 /* CCCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A951807B038005B8026 /* CCCommon.h */; };\n\t\t46A1701A1807CBFC005B8026 /* CCDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A961807B038005B8026 /* CCDevice.h */; };\n\t\t46A1701B1807CBFC005B8026 /* CCEGLViewProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A971807B038005B8026 /* CCEGLViewProtocol.cpp */; };\n\t\t46A1701C1807CBFC005B8026 /* CCEGLViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A981807B038005B8026 /* CCEGLViewProtocol.h */; };\n\t\t46A1701D1807CBFC005B8026 /* CCFileUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A991807B038005B8026 /* CCFileUtils.cpp */; };\n\t\t46A1701E1807CBFC005B8026 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9A1807B038005B8026 /* CCFileUtils.h */; };\n\t\t46A1701F1807CBFC005B8026 /* CCImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9B1807B038005B8026 /* CCImage.h */; };\n\t\t46A170231807CBFC005B8026 /* CCSAXParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A9F1807B038005B8026 /* CCSAXParser.cpp */; };\n\t\t46A170241807CBFC005B8026 /* CCSAXParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA01807B038005B8026 /* CCSAXParser.h */; };\n\t\t46A170251807CBFC005B8026 /* CCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA11807B038005B8026 /* CCThread.cpp */; };\n\t\t46A170261807CBFC005B8026 /* CCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA21807B038005B8026 /* CCThread.h */; };\n\t\t46A170271807CBFE005B8026 /* CCFileUtilsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */; };\n\t\t46A170281807CBFE005B8026 /* CCFileUtilsApple.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A901807B038005B8026 /* CCFileUtilsApple.mm */; };\n\t\t46A170291807CBFE005B8026 /* CCLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A911807B038005B8026 /* CCLock.cpp */; };\n\t\t46A1702A1807CBFE005B8026 /* CCLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A921807B038005B8026 /* CCLock.h */; };\n\t\t46A1702B1807CBFE005B8026 /* CCThread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A931807B038005B8026 /* CCThread.mm */; };\n\t\t46A1702C1807CBFE005B8026 /* CCApplicationProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A941807B038005B8026 /* CCApplicationProtocol.h */; };\n\t\t46A1702D1807CBFE005B8026 /* CCCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A951807B038005B8026 /* CCCommon.h */; };\n\t\t46A1702E1807CBFE005B8026 /* CCDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A961807B038005B8026 /* CCDevice.h */; };\n\t\t46A1702F1807CBFE005B8026 /* CCEGLViewProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A971807B038005B8026 /* CCEGLViewProtocol.cpp */; };\n\t\t46A170301807CBFE005B8026 /* CCEGLViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A981807B038005B8026 /* CCEGLViewProtocol.h */; };\n\t\t46A170311807CBFE005B8026 /* CCFileUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A991807B038005B8026 /* CCFileUtils.cpp */; };\n\t\t46A170321807CBFE005B8026 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9A1807B038005B8026 /* CCFileUtils.h */; };\n\t\t46A170331807CBFE005B8026 /* CCImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16A9B1807B038005B8026 /* CCImage.h */; };\n\t\t46A170371807CBFE005B8026 /* CCSAXParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16A9F1807B038005B8026 /* CCSAXParser.cpp */; };\n\t\t46A170381807CBFE005B8026 /* CCSAXParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA01807B038005B8026 /* CCSAXParser.h */; };\n\t\t46A170391807CBFE005B8026 /* CCThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA11807B038005B8026 /* CCThread.cpp */; };\n\t\t46A1703A1807CBFE005B8026 /* CCThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA21807B038005B8026 /* CCThread.h */; };\n\t\t46A1703B1807CC07005B8026 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA41807B038005B8026 /* CCApplication.h */; };\n\t\t46A1703C1807CC07005B8026 /* CCApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA51807B038005B8026 /* CCApplication.mm */; };\n\t\t46A1703D1807CC07005B8026 /* CCCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA61807B038005B8026 /* CCCommon.mm */; };\n\t\t46A1703E1807CC07005B8026 /* CCDevice.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA71807B038005B8026 /* CCDevice.mm */; };\n\t\t46A1703F1807CC07005B8026 /* CCDirectorCaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AA81807B038005B8026 /* CCDirectorCaller.h */; };\n\t\t46A170401807CC07005B8026 /* CCDirectorCaller.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AA91807B038005B8026 /* CCDirectorCaller.mm */; };\n\t\t46A170411807CC07005B8026 /* CCEGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AAA1807B038005B8026 /* CCEGLView.h */; };\n\t\t46A170421807CC07005B8026 /* CCEGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AAB1807B038005B8026 /* CCEGLView.mm */; };\n\t\t46A170431807CC07005B8026 /* CCES2Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AAC1807B038005B8026 /* CCES2Renderer.h */; };\n\t\t46A170441807CC07005B8026 /* CCES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AAD1807B038005B8026 /* CCES2Renderer.m */; };\n\t\t46A170451807CC07005B8026 /* CCESRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AAE1807B038005B8026 /* CCESRenderer.h */; };\n\t\t46A170471807CC07005B8026 /* CCImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AB01807B038005B8026 /* CCImage.mm */; };\n\t\t46A170481807CC07005B8026 /* CCPlatformDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AB11807B038005B8026 /* CCPlatformDefine.h */; };\n\t\t46A170491807CC07005B8026 /* CCStdC.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AB21807B038005B8026 /* CCStdC.h */; };\n\t\t46A1704B1807CC07005B8026 /* EAGLView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AB41807B038005B8026 /* EAGLView.mm */; };\n\t\t46A1704C1807CC07005B8026 /* OpenGL_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AB51807B038005B8026 /* OpenGL_Internal.h */; };\n\t\t46A1704D1807CC11005B8026 /* AccelerometerSimulation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AB71807B038005B8026 /* AccelerometerSimulation.h */; };\n\t\t46A1704E1807CC11005B8026 /* AccelerometerSimulation.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AB81807B038005B8026 /* AccelerometerSimulation.m */; };\n\t\t46A1704F1807CC1C005B8026 /* CCApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AC81807B038005B8026 /* CCApplication.h */; };\n\t\t46A170501807CC1C005B8026 /* CCApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AC91807B038005B8026 /* CCApplication.mm */; };\n\t\t46A170511807CC1C005B8026 /* CCCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16ACA1807B038005B8026 /* CCCommon.mm */; };\n\t\t46A170521807CC1C005B8026 /* CCDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A16ACB1807B038005B8026 /* CCDevice.cpp */; };\n\t\t46A170531807CC1C005B8026 /* CCDirectorCaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16ACC1807B038005B8026 /* CCDirectorCaller.h */; };\n\t\t46A170541807CC1C005B8026 /* CCDirectorCaller.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16ACD1807B038005B8026 /* CCDirectorCaller.mm */; };\n\t\t46A1705A1807CC1C005B8026 /* CCImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A16AD31807B038005B8026 /* CCImage.mm */; };\n\t\t46A1705B1807CC1C005B8026 /* CCPlatformDefine.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AD41807B038005B8026 /* CCPlatformDefine.h */; };\n\t\t46A1705C1807CC1C005B8026 /* CCStdC.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A16AD51807B038005B8026 /* CCStdC.h */; };\n\t\t46A170A91807CE9D005B8026 /* aabb.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170891807CE87005B8026 /* aabb.h */; };\n\t\t46A170AA1807CE9E005B8026 /* aabb.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170891807CE87005B8026 /* aabb.h */; };\n\t\t46A170AB1807CEA3005B8026 /* mat4stack.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708B1807CE87005B8026 /* mat4stack.h */; };\n\t\t46A170AC1807CEA3005B8026 /* matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708C1807CE87005B8026 /* matrix.h */; };\n\t\t46A170AD1807CEA3005B8026 /* kazmath.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708D1807CE87005B8026 /* kazmath.h */; };\n\t\t46A170AE1807CEA3005B8026 /* mat3.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708E1807CE87005B8026 /* mat3.h */; };\n\t\t46A170AF1807CEA3005B8026 /* mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708F1807CE87005B8026 /* mat4.h */; };\n\t\t46A170B01807CEA3005B8026 /* neon_matrix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170901807CE87005B8026 /* neon_matrix_impl.h */; };\n\t\t46A170B11807CEA3005B8026 /* plane.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170911807CE87005B8026 /* plane.h */; };\n\t\t46A170B21807CEA3005B8026 /* quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170921807CE87005B8026 /* quaternion.h */; };\n\t\t46A170B31807CEA3005B8026 /* ray2.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170931807CE87005B8026 /* ray2.h */; };\n\t\t46A170B41807CEA3005B8026 /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170941807CE87005B8026 /* utility.h */; };\n\t\t46A170B51807CEA3005B8026 /* vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170951807CE87005B8026 /* vec2.h */; };\n\t\t46A170B61807CEA3005B8026 /* vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170961807CE87005B8026 /* vec3.h */; };\n\t\t46A170B71807CEA3005B8026 /* vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170971807CE87005B8026 /* vec4.h */; };\n\t\t46A170B81807CEA4005B8026 /* mat4stack.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708B1807CE87005B8026 /* mat4stack.h */; };\n\t\t46A170B91807CEA4005B8026 /* matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708C1807CE87005B8026 /* matrix.h */; };\n\t\t46A170BA1807CEA4005B8026 /* kazmath.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708D1807CE87005B8026 /* kazmath.h */; };\n\t\t46A170BB1807CEA4005B8026 /* mat3.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708E1807CE87005B8026 /* mat3.h */; };\n\t\t46A170BC1807CEA4005B8026 /* mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1708F1807CE87005B8026 /* mat4.h */; };\n\t\t46A170BD1807CEA4005B8026 /* neon_matrix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170901807CE87005B8026 /* neon_matrix_impl.h */; };\n\t\t46A170BE1807CEA4005B8026 /* plane.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170911807CE87005B8026 /* plane.h */; };\n\t\t46A170BF1807CEA4005B8026 /* quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170921807CE87005B8026 /* quaternion.h */; };\n\t\t46A170C01807CEA4005B8026 /* ray2.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170931807CE87005B8026 /* ray2.h */; };\n\t\t46A170C11807CEA4005B8026 /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170941807CE87005B8026 /* utility.h */; };\n\t\t46A170C21807CEA4005B8026 /* vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170951807CE87005B8026 /* vec2.h */; };\n\t\t46A170C31807CEA4005B8026 /* vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170961807CE87005B8026 /* vec3.h */; };\n\t\t46A170C41807CEA4005B8026 /* vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170971807CE87005B8026 /* vec4.h */; };\n\t\t46A170C51807CEB0005B8026 /* aabb.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170991807CE87005B8026 /* aabb.c */; };\n\t\t46A170C61807CEB2005B8026 /* aabb.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170991807CE87005B8026 /* aabb.c */; };\n\t\t46A170C71807CEBB005B8026 /* mat3.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1709F1807CE87005B8026 /* mat3.c */; };\n\t\t46A170C81807CEBB005B8026 /* mat4.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A01807CE87005B8026 /* mat4.c */; };\n\t\t46A170C91807CEBB005B8026 /* neon_matrix_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A11807CE87005B8026 /* neon_matrix_impl.c */; };\n\t\t46A170CA1807CEBB005B8026 /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A21807CE87005B8026 /* plane.c */; };\n\t\t46A170CB1807CEBB005B8026 /* quaternion.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A31807CE87005B8026 /* quaternion.c */; };\n\t\t46A170CC1807CEBB005B8026 /* ray2.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A41807CE87005B8026 /* ray2.c */; };\n\t\t46A170CD1807CEBB005B8026 /* utility.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A51807CE87005B8026 /* utility.c */; };\n\t\t46A170CE1807CEBB005B8026 /* vec2.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A61807CE87005B8026 /* vec2.c */; };\n\t\t46A170CF1807CEBB005B8026 /* vec3.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A71807CE87005B8026 /* vec3.c */; };\n\t\t46A170D01807CEBB005B8026 /* vec4.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A81807CE87005B8026 /* vec4.c */; };\n\t\t46A170D11807CEBC005B8026 /* mat3.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1709F1807CE87005B8026 /* mat3.c */; };\n\t\t46A170D21807CEBC005B8026 /* mat4.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A01807CE87005B8026 /* mat4.c */; };\n\t\t46A170D31807CEBC005B8026 /* neon_matrix_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A11807CE87005B8026 /* neon_matrix_impl.c */; };\n\t\t46A170D41807CEBC005B8026 /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A21807CE87005B8026 /* plane.c */; };\n\t\t46A170D51807CEBC005B8026 /* quaternion.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A31807CE87005B8026 /* quaternion.c */; };\n\t\t46A170D61807CEBC005B8026 /* ray2.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A41807CE87005B8026 /* ray2.c */; };\n\t\t46A170D71807CEBC005B8026 /* utility.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A51807CE87005B8026 /* utility.c */; };\n\t\t46A170D81807CEBC005B8026 /* vec2.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A61807CE87005B8026 /* vec2.c */; };\n\t\t46A170D91807CEBC005B8026 /* vec3.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A71807CE87005B8026 /* vec3.c */; };\n\t\t46A170DA1807CEBC005B8026 /* vec4.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A170A81807CE87005B8026 /* vec4.c */; };\n\t\t46A170E61807CECA005B8026 /* CCPhysicsBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1706E1807CE7A005B8026 /* CCPhysicsBody.cpp */; };\n\t\t46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1706F1807CE7A005B8026 /* CCPhysicsBody.h */; };\n\t\t46A170E81807CECA005B8026 /* CCPhysicsContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170701807CE7A005B8026 /* CCPhysicsContact.cpp */; };\n\t\t46A170E91807CECA005B8026 /* CCPhysicsContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170711807CE7A005B8026 /* CCPhysicsContact.h */; };\n\t\t46A170EA1807CECA005B8026 /* CCPhysicsJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170721807CE7A005B8026 /* CCPhysicsJoint.cpp */; };\n\t\t46A170EB1807CECA005B8026 /* CCPhysicsJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170731807CE7A005B8026 /* CCPhysicsJoint.h */; };\n\t\t46A170ED1807CECA005B8026 /* CCPhysicsShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170751807CE7A005B8026 /* CCPhysicsShape.cpp */; };\n\t\t46A170EE1807CECA005B8026 /* CCPhysicsShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170761807CE7A005B8026 /* CCPhysicsShape.h */; };\n\t\t46A170EF1807CECA005B8026 /* CCPhysicsWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170771807CE7A005B8026 /* CCPhysicsWorld.cpp */; };\n\t\t46A170F01807CECA005B8026 /* CCPhysicsWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170781807CE7A005B8026 /* CCPhysicsWorld.h */; };\n\t\t46A170FC1807CECB005B8026 /* CCPhysicsBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1706E1807CE7A005B8026 /* CCPhysicsBody.cpp */; };\n\t\t46A170FD1807CECB005B8026 /* CCPhysicsBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1706F1807CE7A005B8026 /* CCPhysicsBody.h */; };\n\t\t46A170FE1807CECB005B8026 /* CCPhysicsContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170701807CE7A005B8026 /* CCPhysicsContact.cpp */; };\n\t\t46A170FF1807CECB005B8026 /* CCPhysicsContact.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170711807CE7A005B8026 /* CCPhysicsContact.h */; };\n\t\t46A171001807CECB005B8026 /* CCPhysicsJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170721807CE7A005B8026 /* CCPhysicsJoint.cpp */; };\n\t\t46A171011807CECB005B8026 /* CCPhysicsJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170731807CE7A005B8026 /* CCPhysicsJoint.h */; };\n\t\t46A171031807CECB005B8026 /* CCPhysicsShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170751807CE7A005B8026 /* CCPhysicsShape.cpp */; };\n\t\t46A171041807CECB005B8026 /* CCPhysicsShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170761807CE7A005B8026 /* CCPhysicsShape.h */; };\n\t\t46A171051807CECB005B8026 /* CCPhysicsWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A170771807CE7A005B8026 /* CCPhysicsWorld.cpp */; };\n\t\t46A171061807CECB005B8026 /* CCPhysicsWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A170781807CE7A005B8026 /* CCPhysicsWorld.h */; };\n\t\t46A173D41807D358005B8026 /* chipmunk.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1697B1807AFD6005B8026 /* chipmunk.c */; };\n\t\t46A173D51807D35A005B8026 /* chipmunk.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1697B1807AFD6005B8026 /* chipmunk.c */; };\n\t\t46A173D61807D363005B8026 /* cpConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1697E1807AFD6005B8026 /* cpConstraint.c */; };\n\t\t46A173D71807D363005B8026 /* cpDampedRotarySpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1697F1807AFD6005B8026 /* cpDampedRotarySpring.c */; };\n\t\t46A173D81807D363005B8026 /* cpDampedSpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169801807AFD6005B8026 /* cpDampedSpring.c */; };\n\t\t46A173D91807D363005B8026 /* cpGearJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169811807AFD6005B8026 /* cpGearJoint.c */; };\n\t\t46A173DA1807D363005B8026 /* cpGrooveJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169821807AFD6005B8026 /* cpGrooveJoint.c */; };\n\t\t46A173DB1807D363005B8026 /* cpPinJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169831807AFD6005B8026 /* cpPinJoint.c */; };\n\t\t46A173DC1807D363005B8026 /* cpPivotJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169841807AFD6005B8026 /* cpPivotJoint.c */; };\n\t\t46A173DD1807D363005B8026 /* cpRatchetJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169851807AFD6005B8026 /* cpRatchetJoint.c */; };\n\t\t46A173DE1807D363005B8026 /* cpRotaryLimitJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169861807AFD6005B8026 /* cpRotaryLimitJoint.c */; };\n\t\t46A173DF1807D363005B8026 /* cpSimpleMotor.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169871807AFD6005B8026 /* cpSimpleMotor.c */; };\n\t\t46A173E01807D363005B8026 /* cpSlideJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169881807AFD6005B8026 /* cpSlideJoint.c */; };\n\t\t46A173E11807D363005B8026 /* cpArbiter.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169891807AFD6005B8026 /* cpArbiter.c */; };\n\t\t46A173E21807D363005B8026 /* cpArray.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698A1807AFD6005B8026 /* cpArray.c */; };\n\t\t46A173E31807D363005B8026 /* cpBB.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698B1807AFD6005B8026 /* cpBB.c */; };\n\t\t46A173E41807D363005B8026 /* cpBBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698C1807AFD6005B8026 /* cpBBTree.c */; };\n\t\t46A173E51807D363005B8026 /* cpBody.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698D1807AFD6005B8026 /* cpBody.c */; };\n\t\t46A173E61807D363005B8026 /* cpCollision.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698E1807AFD6005B8026 /* cpCollision.c */; };\n\t\t46A173E71807D363005B8026 /* cpHashSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698F1807AFD6005B8026 /* cpHashSet.c */; };\n\t\t46A173E81807D363005B8026 /* cpPolyShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169901807AFD6005B8026 /* cpPolyShape.c */; };\n\t\t46A173E91807D363005B8026 /* cpShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169911807AFD6005B8026 /* cpShape.c */; };\n\t\t46A173EA1807D363005B8026 /* cpSpace.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169921807AFD6005B8026 /* cpSpace.c */; };\n\t\t46A173EB1807D363005B8026 /* cpSpaceComponent.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169931807AFD6005B8026 /* cpSpaceComponent.c */; };\n\t\t46A173EC1807D363005B8026 /* cpSpaceHash.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169941807AFD6005B8026 /* cpSpaceHash.c */; };\n\t\t46A173ED1807D363005B8026 /* cpSpaceQuery.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169951807AFD6005B8026 /* cpSpaceQuery.c */; };\n\t\t46A173EE1807D363005B8026 /* cpSpaceStep.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169961807AFD6005B8026 /* cpSpaceStep.c */; };\n\t\t46A173EF1807D363005B8026 /* cpSpatialIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169971807AFD6005B8026 /* cpSpatialIndex.c */; };\n\t\t46A173F01807D363005B8026 /* cpSweep1D.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169981807AFD6005B8026 /* cpSweep1D.c */; };\n\t\t46A173F11807D363005B8026 /* cpVect.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169991807AFD6005B8026 /* cpVect.c */; };\n\t\t46A173F21807D363005B8026 /* prime.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1699A1807AFD6005B8026 /* prime.h */; };\n\t\t46A173F31807D365005B8026 /* cpConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1697E1807AFD6005B8026 /* cpConstraint.c */; };\n\t\t46A173F41807D365005B8026 /* cpDampedRotarySpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1697F1807AFD6005B8026 /* cpDampedRotarySpring.c */; };\n\t\t46A173F51807D365005B8026 /* cpDampedSpring.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169801807AFD6005B8026 /* cpDampedSpring.c */; };\n\t\t46A173F61807D365005B8026 /* cpGearJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169811807AFD6005B8026 /* cpGearJoint.c */; };\n\t\t46A173F71807D365005B8026 /* cpGrooveJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169821807AFD6005B8026 /* cpGrooveJoint.c */; };\n\t\t46A173F81807D365005B8026 /* cpPinJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169831807AFD6005B8026 /* cpPinJoint.c */; };\n\t\t46A173F91807D365005B8026 /* cpPivotJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169841807AFD6005B8026 /* cpPivotJoint.c */; };\n\t\t46A173FA1807D365005B8026 /* cpRatchetJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169851807AFD6005B8026 /* cpRatchetJoint.c */; };\n\t\t46A173FB1807D365005B8026 /* cpRotaryLimitJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169861807AFD6005B8026 /* cpRotaryLimitJoint.c */; };\n\t\t46A173FC1807D365005B8026 /* cpSimpleMotor.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169871807AFD6005B8026 /* cpSimpleMotor.c */; };\n\t\t46A173FD1807D365005B8026 /* cpSlideJoint.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169881807AFD6005B8026 /* cpSlideJoint.c */; };\n\t\t46A173FE1807D365005B8026 /* cpArbiter.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169891807AFD6005B8026 /* cpArbiter.c */; };\n\t\t46A173FF1807D365005B8026 /* cpArray.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698A1807AFD6005B8026 /* cpArray.c */; };\n\t\t46A174001807D365005B8026 /* cpBB.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698B1807AFD6005B8026 /* cpBB.c */; };\n\t\t46A174011807D365005B8026 /* cpBBTree.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698C1807AFD6005B8026 /* cpBBTree.c */; };\n\t\t46A174021807D365005B8026 /* cpBody.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698D1807AFD6005B8026 /* cpBody.c */; };\n\t\t46A174031807D365005B8026 /* cpCollision.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698E1807AFD6005B8026 /* cpCollision.c */; };\n\t\t46A174041807D365005B8026 /* cpHashSet.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A1698F1807AFD6005B8026 /* cpHashSet.c */; };\n\t\t46A174051807D365005B8026 /* cpPolyShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169901807AFD6005B8026 /* cpPolyShape.c */; };\n\t\t46A174061807D365005B8026 /* cpShape.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169911807AFD6005B8026 /* cpShape.c */; };\n\t\t46A174071807D365005B8026 /* cpSpace.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169921807AFD6005B8026 /* cpSpace.c */; };\n\t\t46A174081807D365005B8026 /* cpSpaceComponent.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169931807AFD6005B8026 /* cpSpaceComponent.c */; };\n\t\t46A174091807D365005B8026 /* cpSpaceHash.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169941807AFD6005B8026 /* cpSpaceHash.c */; };\n\t\t46A1740A1807D365005B8026 /* cpSpaceQuery.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169951807AFD6005B8026 /* cpSpaceQuery.c */; };\n\t\t46A1740B1807D365005B8026 /* cpSpaceStep.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169961807AFD6005B8026 /* cpSpaceStep.c */; };\n\t\t46A1740C1807D365005B8026 /* cpSpatialIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169971807AFD6005B8026 /* cpSpatialIndex.c */; };\n\t\t46A1740D1807D365005B8026 /* cpSweep1D.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169981807AFD6005B8026 /* cpSweep1D.c */; };\n\t\t46A1740E1807D365005B8026 /* cpVect.c in Sources */ = {isa = PBXBuildFile; fileRef = 46A169991807AFD6005B8026 /* cpVect.c */; };\n\t\t46A1740F1807D365005B8026 /* prime.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1699A1807AFD6005B8026 /* prime.h */; };\n\t\t46A174101807D372005B8026 /* chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169401807AFD6005B8026 /* chipmunk.h */; };\n\t\t46A174111807D372005B8026 /* chipmunk_ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169411807AFD6005B8026 /* chipmunk_ffi.h */; };\n\t\t46A174121807D372005B8026 /* chipmunk_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169421807AFD6005B8026 /* chipmunk_private.h */; };\n\t\t46A174131807D372005B8026 /* chipmunk_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169431807AFD6005B8026 /* chipmunk_types.h */; };\n\t\t46A174141807D372005B8026 /* chipmunk_unsafe.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169441807AFD6005B8026 /* chipmunk_unsafe.h */; };\n\t\t46A174151807D374005B8026 /* chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169401807AFD6005B8026 /* chipmunk.h */; };\n\t\t46A174161807D374005B8026 /* chipmunk_ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169411807AFD6005B8026 /* chipmunk_ffi.h */; };\n\t\t46A174171807D374005B8026 /* chipmunk_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169421807AFD6005B8026 /* chipmunk_private.h */; };\n\t\t46A174181807D374005B8026 /* chipmunk_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169431807AFD6005B8026 /* chipmunk_types.h */; };\n\t\t46A174191807D374005B8026 /* chipmunk_unsafe.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169441807AFD6005B8026 /* chipmunk_unsafe.h */; };\n\t\t46A1741A1807D379005B8026 /* cpConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169461807AFD6005B8026 /* cpConstraint.h */; };\n\t\t46A1741B1807D379005B8026 /* cpDampedRotarySpring.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169471807AFD6005B8026 /* cpDampedRotarySpring.h */; };\n\t\t46A1741C1807D379005B8026 /* cpDampedSpring.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169481807AFD6005B8026 /* cpDampedSpring.h */; };\n\t\t46A1741D1807D379005B8026 /* cpGearJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169491807AFD6005B8026 /* cpGearJoint.h */; };\n\t\t46A1741E1807D379005B8026 /* cpGrooveJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694A1807AFD6005B8026 /* cpGrooveJoint.h */; };\n\t\t46A1741F1807D379005B8026 /* cpPinJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694B1807AFD6005B8026 /* cpPinJoint.h */; };\n\t\t46A174201807D379005B8026 /* cpPivotJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694C1807AFD6005B8026 /* cpPivotJoint.h */; };\n\t\t46A174211807D379005B8026 /* cpRatchetJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694D1807AFD6005B8026 /* cpRatchetJoint.h */; };\n\t\t46A174221807D379005B8026 /* cpRotaryLimitJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694E1807AFD6005B8026 /* cpRotaryLimitJoint.h */; };\n\t\t46A174231807D379005B8026 /* cpSimpleMotor.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694F1807AFD6005B8026 /* cpSimpleMotor.h */; };\n\t\t46A174241807D379005B8026 /* cpSlideJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169501807AFD6005B8026 /* cpSlideJoint.h */; };\n\t\t46A174251807D379005B8026 /* util.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169511807AFD6005B8026 /* util.h */; };\n\t\t46A174261807D379005B8026 /* cpArbiter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169521807AFD6005B8026 /* cpArbiter.h */; };\n\t\t46A174271807D379005B8026 /* cpBB.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169531807AFD6005B8026 /* cpBB.h */; };\n\t\t46A174281807D379005B8026 /* cpBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169541807AFD6005B8026 /* cpBody.h */; };\n\t\t46A174291807D379005B8026 /* cpPolyShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169551807AFD6005B8026 /* cpPolyShape.h */; };\n\t\t46A1742A1807D379005B8026 /* cpShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169561807AFD6005B8026 /* cpShape.h */; };\n\t\t46A1742B1807D379005B8026 /* cpSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169571807AFD6005B8026 /* cpSpace.h */; };\n\t\t46A1742C1807D379005B8026 /* cpSpatialIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169581807AFD6005B8026 /* cpSpatialIndex.h */; };\n\t\t46A1742D1807D379005B8026 /* cpVect.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169591807AFD6005B8026 /* cpVect.h */; };\n\t\t46A1742E1807D37B005B8026 /* cpConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169461807AFD6005B8026 /* cpConstraint.h */; };\n\t\t46A1742F1807D37B005B8026 /* cpDampedRotarySpring.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169471807AFD6005B8026 /* cpDampedRotarySpring.h */; };\n\t\t46A174301807D37B005B8026 /* cpDampedSpring.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169481807AFD6005B8026 /* cpDampedSpring.h */; };\n\t\t46A174311807D37B005B8026 /* cpGearJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169491807AFD6005B8026 /* cpGearJoint.h */; };\n\t\t46A174321807D37B005B8026 /* cpGrooveJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694A1807AFD6005B8026 /* cpGrooveJoint.h */; };\n\t\t46A174331807D37B005B8026 /* cpPinJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694B1807AFD6005B8026 /* cpPinJoint.h */; };\n\t\t46A174341807D37B005B8026 /* cpPivotJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694C1807AFD6005B8026 /* cpPivotJoint.h */; };\n\t\t46A174351807D37B005B8026 /* cpRatchetJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694D1807AFD6005B8026 /* cpRatchetJoint.h */; };\n\t\t46A174361807D37B005B8026 /* cpRotaryLimitJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694E1807AFD6005B8026 /* cpRotaryLimitJoint.h */; };\n\t\t46A174371807D37B005B8026 /* cpSimpleMotor.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1694F1807AFD6005B8026 /* cpSimpleMotor.h */; };\n\t\t46A174381807D37B005B8026 /* cpSlideJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169501807AFD6005B8026 /* cpSlideJoint.h */; };\n\t\t46A174391807D37B005B8026 /* util.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169511807AFD6005B8026 /* util.h */; };\n\t\t46A1743A1807D37B005B8026 /* cpArbiter.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169521807AFD6005B8026 /* cpArbiter.h */; };\n\t\t46A1743B1807D37B005B8026 /* cpBB.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169531807AFD6005B8026 /* cpBB.h */; };\n\t\t46A1743C1807D37B005B8026 /* cpBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169541807AFD6005B8026 /* cpBody.h */; };\n\t\t46A1743D1807D37B005B8026 /* cpPolyShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169551807AFD6005B8026 /* cpPolyShape.h */; };\n\t\t46A1743E1807D37B005B8026 /* cpShape.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169561807AFD6005B8026 /* cpShape.h */; };\n\t\t46A1743F1807D37B005B8026 /* cpSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169571807AFD6005B8026 /* cpSpace.h */; };\n\t\t46A174401807D37B005B8026 /* cpSpatialIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169581807AFD6005B8026 /* cpSpatialIndex.h */; };\n\t\t46A174411807D37B005B8026 /* cpVect.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A169591807AFD6005B8026 /* cpVect.h */; };\n\t\t5069133E185016C1009BBDD7 /* CCConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5069133C185016C1009BBDD7 /* CCConsole.cpp */; };\n\t\t5069133F185016C1009BBDD7 /* CCConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5069133C185016C1009BBDD7 /* CCConsole.cpp */; };\n\t\t50691340185016C1009BBDD7 /* CCConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 5069133D185016C1009BBDD7 /* CCConsole.h */; };\n\t\t50691341185016C1009BBDD7 /* CCConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 5069133D185016C1009BBDD7 /* CCConsole.h */; };\n\t\t50A1FF1818290ED4001840C4 /* UIListView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50A1FF1618290ED4001840C4 /* UIListView.cpp */; };\n\t\t50A1FF1918290ED4001840C4 /* UIListView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50A1FF1618290ED4001840C4 /* UIListView.cpp */; };\n\t\t50A1FF1A18290ED4001840C4 /* UIListView.h in Headers */ = {isa = PBXBuildFile; fileRef = 50A1FF1718290ED4001840C4 /* UIListView.h */; };\n\t\t50A1FF1B18290ED4001840C4 /* UIListView.h in Headers */ = {isa = PBXBuildFile; fileRef = 50A1FF1718290ED4001840C4 /* UIListView.h */; };\n\t\t50AE5EA3188749250007CFE3 /* CCBatchCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50AE5EA1188749250007CFE3 /* CCBatchCommand.cpp */; };\n\t\t50AE5EA4188749250007CFE3 /* CCBatchCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50AE5EA1188749250007CFE3 /* CCBatchCommand.cpp */; };\n\t\t50AE5EA5188749250007CFE3 /* CCBatchCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50AE5EA2188749250007CFE3 /* CCBatchCommand.h */; };\n\t\t50AE5EA6188749250007CFE3 /* CCBatchCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 50AE5EA2188749250007CFE3 /* CCBatchCommand.h */; };\n\t\t593BDCF2184D0A6E00C21E48 /* CCCustomCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 593BDCD8184D0A6E00C21E48 /* CCCustomCommand.cpp */; };\n\t\t593BDCF3184D0A6E00C21E48 /* CCCustomCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 593BDCD8184D0A6E00C21E48 /* CCCustomCommand.cpp */; };\n\t\t593BDCF4184D0A6E00C21E48 /* CCCustomCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 593BDCD9184D0A6E00C21E48 /* CCCustomCommand.h */; };\n\t\t593BDCF5184D0A6E00C21E48 /* CCCustomCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 593BDCD9184D0A6E00C21E48 /* CCCustomCommand.h */; };\n\t\t593BDCF6184D0A6E00C21E48 /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 593BDCDA184D0A6E00C21E48 /* CCGroupCommand.cpp */; };\n\t\t593BDCF7184D0A6E00C21E48 /* CCGroupCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 593BDCDA184D0A6E00C21E48 /* CCGroupCommand.cpp */; };\n\t\t593BDCF8184D0A6E00C21E48 /* CCGroupCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 593BDCDB184D0A6E00C21E48 /* CCGroupCommand.h */; };\n\t\t593BDCF9184D0A6E00C21E48 /* CCGroupCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 593BDCDB184D0A6E00C21E48 /* CCGroupCommand.h */; };\n\t\t59A79D511821E26E00F19697 /* CCEventListenerMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A79D4D1821E26E00F19697 /* CCEventListenerMouse.cpp */; };\n\t\t59A79D521821E26E00F19697 /* CCEventListenerMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A79D4D1821E26E00F19697 /* CCEventListenerMouse.cpp */; };\n\t\t59A79D531821E26E00F19697 /* CCEventListenerMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A79D4E1821E26E00F19697 /* CCEventListenerMouse.h */; };\n\t\t59A79D541821E26E00F19697 /* CCEventListenerMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A79D4E1821E26E00F19697 /* CCEventListenerMouse.h */; };\n\t\t59A79D551821E26E00F19697 /* CCEventMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A79D4F1821E26E00F19697 /* CCEventMouse.cpp */; };\n\t\t59A79D561821E26E00F19697 /* CCEventMouse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A79D4F1821E26E00F19697 /* CCEventMouse.cpp */; };\n\t\t59A79D571821E26E00F19697 /* CCEventMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A79D501821E26E00F19697 /* CCEventMouse.h */; };\n\t\t59A79D581821E26E00F19697 /* CCEventMouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A79D501821E26E00F19697 /* CCEventMouse.h */; };\n\t\t74AC80E553789C6DE3EC737A /* CCRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC8EB8FE47EED9B30B7106 /* CCRenderer.cpp */; };\n\t\t74AC819B780D9EB49CC421AB /* CCRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8DF0EA49A124E1B11681 /* CCRenderer.h */; };\n\t\t74AC81CAB5F3883FCC2A4A5B /* CCQuadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8C4AE1EB0FCB287E7396 /* CCQuadCommand.h */; };\n\t\t74AC826A592CAE6AACD35DC5 /* CCMaterialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC853F6B597094730AFB36 /* CCMaterialManager.cpp */; };\n\t\t74AC82C9892F007745926C93 /* CCFrustum.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC840F2F17ED6D0163669F /* CCFrustum.h */; };\n\t\t74AC83D0193BC28994D683E8 /* CCMaterialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC853F6B597094730AFB36 /* CCMaterialManager.cpp */; };\n\t\t74AC846799FE6F299B410289 /* CCQuadCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC8D28EF93BFF332D3C456 /* CCQuadCommand.cpp */; };\n\t\t74AC84A100AF9E826288CE2C /* CCRenderCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC80F6E92FC29EA536D7F8 /* CCRenderCommand.cpp */; };\n\t\t74AC84A2F1052B49CA60C2D1 /* CCRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8DF0EA49A124E1B11681 /* CCRenderer.h */; };\n\t\t74AC8573F4F84201C08E5523 /* CCRenderCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8F4F7D9E52FCB522B647 /* CCRenderCommand.h */; };\n\t\t74AC858052DDF289AF7D6309 /* CCFrustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC80EEB031D67E86B45096 /* CCFrustum.cpp */; };\n\t\t74AC8589A38C358F1E472BBD /* CCRenderMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8CC6504014E3A59C55B2 /* CCRenderMaterial.h */; };\n\t\t74AC85BC90D7CF01D652E8C3 /* CCRenderMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC82DE19B10586E1C39974 /* CCRenderMaterial.cpp */; };\n\t\t74AC8796ABB6761790CF8CC2 /* CCRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC8EB8FE47EED9B30B7106 /* CCRenderer.cpp */; };\n\t\t74AC87A5A3B3AD5055CCA3B9 /* CCRenderMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8CC6504014E3A59C55B2 /* CCRenderMaterial.h */; };\n\t\t74AC8813CEE4FC652A0951FB /* CCRenderMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC82DE19B10586E1C39974 /* CCRenderMaterial.cpp */; };\n\t\t74AC897DFAB8043D3873A8F3 /* CCRenderCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC80F6E92FC29EA536D7F8 /* CCRenderCommand.cpp */; };\n\t\t74AC8A10DE9DE8E14D8B3735 /* CCMaterialManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC800F4905C8827A44EED3 /* CCMaterialManager.h */; };\n\t\t74AC8AE45B093F2F76A5B1C2 /* CCQuadCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8C4AE1EB0FCB287E7396 /* CCQuadCommand.h */; };\n\t\t74AC8C8DDFD05322513C8C72 /* CCFrustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC80EEB031D67E86B45096 /* CCFrustum.cpp */; };\n\t\t74AC8CF1E05EA89BC441EEBC /* CCQuadCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 74AC8D28EF93BFF332D3C456 /* CCQuadCommand.cpp */; };\n\t\t74AC8E2CDB69E1FDBFCFBD78 /* CCRenderCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC8F4F7D9E52FCB522B647 /* CCRenderCommand.h */; };\n\t\t74AC8E3E7D85FB595242AAEC /* CCMaterialManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC800F4905C8827A44EED3 /* CCMaterialManager.h */; };\n\t\t74AC8EE0C2AAB82783F47089 /* CCFrustum.h in Headers */ = {isa = PBXBuildFile; fileRef = 74AC840F2F17ED6D0163669F /* CCFrustum.h */; };\n\t\tA023FA34185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = A023FA32185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h */; };\n\t\tA023FA35185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = A023FA32185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h */; };\n\t\tA023FA36185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = A023FA33185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h */; };\n\t\tA023FA37185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = A023FA33185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h */; };\n\t\tA04583F2189053B500E32FE8 /* CCEGLView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A04583F0189053B500E32FE8 /* CCEGLView.cpp */; };\n\t\tA04583F3189053B500E32FE8 /* CCEGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = A04583F1189053B500E32FE8 /* CCEGLView.h */; };\n\t\tA07A4CAF1783777C0073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1551A342158F2AB200E66CFE /* Foundation.framework */; };\n\t\tA0E6B28018613EA5009C5D17 /* CCRenderCommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = A0E6B27F18613EA5009C5D17 /* CCRenderCommandPool.h */; };\n\t\tA0E6B28118613EA5009C5D17 /* CCRenderCommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = A0E6B27F18613EA5009C5D17 /* CCRenderCommandPool.h */; };\n\t\tB362C3AE1872BAB700F0BDF4 /* lua_cocos2dx_physics_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B362C3A21872B37200F0BDF4 /* lua_cocos2dx_physics_auto.cpp */; };\n\t\tB362C3AF1872BAB700F0BDF4 /* lua_cocos2dx_physics_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = B362C3A31872B37200F0BDF4 /* lua_cocos2dx_physics_auto.hpp */; };\n\t\tB362C3B01872BABC00F0BDF4 /* lua_cocos2dx_physics_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B362C3A21872B37200F0BDF4 /* lua_cocos2dx_physics_auto.cpp */; };\n\t\tB362C3B11872BABC00F0BDF4 /* lua_cocos2dx_physics_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = B362C3A31872B37200F0BDF4 /* lua_cocos2dx_physics_auto.hpp */; };\n\t\tB362C3B21872BADC00F0BDF4 /* lua_cocos2dx_physics_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B362C3A41872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.cpp */; };\n\t\tB362C3B31872BADC00F0BDF4 /* lua_cocos2dx_physics_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = B362C3A51872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.hpp */; };\n\t\tB362C3B41872BADF00F0BDF4 /* lua_cocos2dx_physics_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B362C3A41872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.cpp */; };\n\t\tB362C3B51872BADF00F0BDF4 /* lua_cocos2dx_physics_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = B362C3A51872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.hpp */; };\n\t\tB37510711823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */; };\n\t\tB37510721823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */; };\n\t\tB37510731823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */; };\n\t\tB37510741823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510481823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.h */; };\n\t\tB37510751823AC9F00B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510491823AC7B00B3BA6A /* CCPhysicsHelper_chipmunk.h */; };\n\t\tB37510761823AC9F00B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B375104A1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp */; };\n\t\tB37510771823AC9F00B3BA6A /* CCPhysicsJointInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B375104B1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.h */; };\n\t\tB37510781823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B375104C1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp */; };\n\t\tB37510791823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B375104D1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.h */; };\n\t\tB375107A1823AC9F00B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B375104E1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp */; };\n\t\tB375107B1823AC9F00B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B375104F1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.h */; };\n\t\tB375107C1823ACA100B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */; };\n\t\tB375107D1823ACA100B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */; };\n\t\tB375107E1823ACA100B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */; };\n\t\tB375107F1823ACA100B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510481823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.h */; };\n\t\tB37510801823ACA100B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B37510491823AC7B00B3BA6A /* CCPhysicsHelper_chipmunk.h */; };\n\t\tB37510811823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B375104A1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp */; };\n\t\tB37510821823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B375104B1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.h */; };\n\t\tB37510831823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B375104C1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp */; };\n\t\tB37510841823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B375104D1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.h */; };\n\t\tB37510851823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B375104E1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp */; };\n\t\tB37510861823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = B375104F1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.h */; };\n\t\tB3AF01A01842FBA400A98B85 /* b2MotorJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3AF019E1842FBA400A98B85 /* b2MotorJoint.cpp */; };\n\t\tB3AF01A11842FBA400A98B85 /* b2MotorJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3AF019E1842FBA400A98B85 /* b2MotorJoint.cpp */; };\n\t\tB3AF01A21842FBA400A98B85 /* b2MotorJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B3AF019F1842FBA400A98B85 /* b2MotorJoint.h */; };\n\t\tB3AF01A31842FBA400A98B85 /* b2MotorJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B3AF019F1842FBA400A98B85 /* b2MotorJoint.h */; };\n\t\tB3B12A5A17E7F44000026B4A /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A03F2CB81780BD04006731B9 /* libchipmunk Mac.a */; };\n\t\tB3B12A5B17E7F45C00026B4A /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A4F3B178387670073F6A7 /* libchipmunk iOS.a */; };\n\t\tED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */; };\n\t\tED9C6A9518599AD8000A5232 /* CCNodeGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */; };\n\t\tED9C6A9618599AD8000A5232 /* CCNodeGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = ED9C6A9318599AD8000A5232 /* CCNodeGrid.h */; };\n\t\tED9C6A9718599AD8000A5232 /* CCNodeGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = ED9C6A9318599AD8000A5232 /* CCNodeGrid.h */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t1A6FB4FE17854AD600CDF010 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A119716178526AA00D62A44;\n\t\t\tremoteInfo = \"luabindings iOS\";\n\t\t};\n\t\t1A6FB7E61785683A00CDF010 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A6FB50417854BC200CDF010;\n\t\t\tremoteInfo = \"luabindings Mac\";\n\t\t};\n\t\t460E44F31807E241000CDD6D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t46A173D21807D330005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\tA03F2E92178141D1006731B9 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = cocos2dx;\n\t\t};\n\t\tA03F2E94178141D1006731B9 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = chipmunk;\n\t\t};\n\t\tA03F2E96178141D1006731B9 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2D5D1780BDF7006731B9;\n\t\t\tremoteInfo = box2d;\n\t\t};\n\t\tA03F2FBF1781458C006731B9 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = CocosDenshion;\n\t\t};\n\t\tA03F31FE178147CB006731B9 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions\";\n\t\t};\n\t\tA03F3200178147CB006731B9 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F31E81781479B006731B9;\n\t\t\tremoteInfo = jsbindings;\n\t\t};\n\t\tA07A4E0F178386520073F6A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\tA07A5046178389710073F6A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\tA07A5048178389710073F6A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\tA07A504A178389710073F6A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F3C1783876B0073F6A7;\n\t\t\tremoteInfo = \"box2d iOS\";\n\t\t};\n\t\tA07A504C178389710073F6A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\tA07A504E178389710073F6A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1551A336158F2AB200E66CFE /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4FB5178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t06CAAABA186AD63B0012A414 /* ObjectFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFactory.cpp; sourceTree = \"<group>\"; };\n\t\t06CAAABB186AD63B0012A414 /* ObjectFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectFactory.h; sourceTree = \"<group>\"; };\n\t\t06CAAABC186AD63B0012A414 /* TriggerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerBase.cpp; sourceTree = \"<group>\"; };\n\t\t06CAAABD186AD63B0012A414 /* TriggerBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerBase.h; sourceTree = \"<group>\"; };\n\t\t06CAAABE186AD63B0012A414 /* TriggerMng.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerMng.cpp; sourceTree = \"<group>\"; };\n\t\t06CAAABF186AD63B0012A414 /* TriggerMng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerMng.h; sourceTree = \"<group>\"; };\n\t\t06CAAAC0186AD63B0012A414 /* TriggerObj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerObj.cpp; sourceTree = \"<group>\"; };\n\t\t06CAAAC1186AD63B0012A414 /* TriggerObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerObj.h; sourceTree = \"<group>\"; };\n\t\t1551A33F158F2AB200E66CFE /* libcocos2dx Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libcocos2dx Mac.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1551A342158F2AB200E66CFE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\t1585AB591828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_studio_auto.cpp; sourceTree = \"<group>\"; };\n\t\t1585AB5A1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_studio_auto.hpp; sourceTree = \"<group>\"; };\n\t\t158E06DC181F6796008E01F6 /* lua_xml_http_request.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_xml_http_request.cpp; sourceTree = \"<group>\"; };\n\t\t158E06DD181F6796008E01F6 /* lua_xml_http_request.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_xml_http_request.h; sourceTree = \"<group>\"; };\n\t\t1599607A1811329600C7D42C /* libluajit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libluajit.a; path = ../external/lua/luajit/prebuilt/mac/libluajit.a; sourceTree = \"<group>\"; };\n\t\t1599607F181132DE00C7D42C /* libluajit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libluajit.a; path = ../external/lua/luajit/prebuilt/ios/libluajit.a; sourceTree = \"<group>\"; };\n\t\t15A71D3C18921E6900F30AC0 /* auxiliar.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = auxiliar.c; sourceTree = \"<group>\"; };\n\t\t15A71D3D18921E6900F30AC0 /* auxiliar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = auxiliar.h; sourceTree = \"<group>\"; };\n\t\t15A71D3E18921E6900F30AC0 /* except.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = except.c; sourceTree = \"<group>\"; };\n\t\t15A71D3F18921E6900F30AC0 /* except.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = except.h; sourceTree = \"<group>\"; };\n\t\t15A71D4018921E6900F30AC0 /* inet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inet.c; sourceTree = \"<group>\"; };\n\t\t15A71D4118921E6900F30AC0 /* inet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inet.h; sourceTree = \"<group>\"; };\n\t\t15A71D4218921E6900F30AC0 /* luasocket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = luasocket.c; sourceTree = \"<group>\"; };\n\t\t15A71D4318921E6900F30AC0 /* luasocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = luasocket.h; sourceTree = \"<group>\"; };\n\t\t15A71D4418921E6900F30AC0 /* luasocket_buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = luasocket_buffer.c; sourceTree = \"<group>\"; };\n\t\t15A71D4518921E6900F30AC0 /* luasocket_buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = luasocket_buffer.h; sourceTree = \"<group>\"; };\n\t\t15A71D4618921E6900F30AC0 /* luasocket_io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = luasocket_io.c; sourceTree = \"<group>\"; };\n\t\t15A71D4718921E6900F30AC0 /* luasocket_io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = luasocket_io.h; sourceTree = \"<group>\"; };\n\t\t15A71D4818921E6900F30AC0 /* mime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mime.c; sourceTree = \"<group>\"; };\n\t\t15A71D4918921E6900F30AC0 /* mime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mime.h; sourceTree = \"<group>\"; };\n\t\t15A71D4A18921E6900F30AC0 /* options.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = options.c; sourceTree = \"<group>\"; };\n\t\t15A71D4B18921E6900F30AC0 /* options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = options.h; sourceTree = \"<group>\"; };\n\t\t15A71D4C18921E6900F30AC0 /* select.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = select.c; sourceTree = \"<group>\"; };\n\t\t15A71D4D18921E6900F30AC0 /* select.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = select.h; sourceTree = \"<group>\"; };\n\t\t15A71D4E18921E6900F30AC0 /* serial.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = serial.c; sourceTree = \"<group>\"; };\n\t\t15A71D4F18921E6900F30AC0 /* socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socket.h; sourceTree = \"<group>\"; };\n\t\t15A71D5018921E6900F30AC0 /* socket_scripts.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = socket_scripts.c; sourceTree = \"<group>\"; };\n\t\t15A71D5118921E6900F30AC0 /* socket_scripts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socket_scripts.h; sourceTree = \"<group>\"; };\n\t\t15A71D5218921E6900F30AC0 /* tcp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tcp.c; sourceTree = \"<group>\"; };\n\t\t15A71D5318921E6900F30AC0 /* tcp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp.h; sourceTree = \"<group>\"; };\n\t\t15A71D5418921E6900F30AC0 /* timeout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = timeout.c; sourceTree = \"<group>\"; };\n\t\t15A71D5518921E6900F30AC0 /* timeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = timeout.h; sourceTree = \"<group>\"; };\n\t\t15A71D5618921E6900F30AC0 /* udp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = udp.c; sourceTree = \"<group>\"; };\n\t\t15A71D5718921E6900F30AC0 /* udp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udp.h; sourceTree = \"<group>\"; };\n\t\t15A71D5818921E6900F30AC0 /* unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unix.c; sourceTree = \"<group>\"; };\n\t\t15A71D5918921E6900F30AC0 /* unix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unix.h; sourceTree = \"<group>\"; };\n\t\t15A71D5A18921E6900F30AC0 /* usocket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = usocket.c; sourceTree = \"<group>\"; };\n\t\t15A71D5B18921E6900F30AC0 /* usocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = usocket.h; sourceTree = \"<group>\"; };\n\t\t15A71D5D18921E6900F30AC0 /* wsocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wsocket.h; sourceTree = \"<group>\"; };\n\t\t15A71DA21892291500F30AC0 /* lua_extensions.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lua_extensions.c; sourceTree = \"<group>\"; };\n\t\t15A71DA31892291500F30AC0 /* lua_extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_extensions.h; sourceTree = \"<group>\"; };\n\t\t15CA8D0B18697A56000032AB /* lua_cocos2dx_spine_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_spine_manual.cpp; sourceTree = \"<group>\"; };\n\t\t15CA8D0C18697A56000032AB /* lua_cocos2dx_spine_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_spine_manual.hpp; sourceTree = \"<group>\"; };\n\t\t15CA8D1118697AE1000032AB /* lua_cocos2dx_spine_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_spine_auto.cpp; sourceTree = \"<group>\"; };\n\t\t15CA8D1218697AE1000032AB /* lua_cocos2dx_spine_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_spine_auto.hpp; sourceTree = \"<group>\"; };\n\t\t15CA8D1718697BE5000032AB /* LuaSkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaSkeletonAnimation.cpp; sourceTree = \"<group>\"; };\n\t\t15CA8D1818697BE5000032AB /* LuaSkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaSkeletonAnimation.h; sourceTree = \"<group>\"; };\n\t\t15D6E843182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_coco_studio_manual.cpp; sourceTree = \"<group>\"; };\n\t\t15D6E844182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_coco_studio_manual.hpp; sourceTree = \"<group>\"; };\n\t\t15F4C8801875637D0082884F /* lua_cocos2dx_gui_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_gui_auto.cpp; sourceTree = \"<group>\"; };\n\t\t15F4C8811875637D0082884F /* lua_cocos2dx_gui_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_gui_auto.hpp; sourceTree = \"<group>\"; };\n\t\t15F4CA1D1875885A0082884F /* lua_cocos2dx_gui_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_gui_manual.cpp; sourceTree = \"<group>\"; };\n\t\t15F4CA1E1875885A0082884F /* lua_cocos2dx_gui_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_gui_manual.hpp; sourceTree = \"<group>\"; };\n\t\t1A087AE61860400400196EF5 /* edtaa3func.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = edtaa3func.cpp; sourceTree = \"<group>\"; };\n\t\t1A087AE71860400400196EF5 /* edtaa3func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = edtaa3func.h; sourceTree = \"<group>\"; };\n\t\t1A0DB7301823827C0025743D /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = \"<group>\"; };\n\t\t1A0DB7311823827C0025743D /* EAGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EAGLView.h; sourceTree = \"<group>\"; };\n\t\t1A0DB7351823828F0025743D /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = \"<group>\"; };\n\t\t1A119791178526AA00D62A44 /* libluabindings iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libluabindings iOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1A2C785E181A11EC004E5527 /* jsb_cocos2dx_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_auto.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C785F181A11EC004E5527 /* jsb_cocos2dx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_auto.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C7861181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_builder_auto.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C7862181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_builder_auto.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C7864181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_extension_auto.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C7865181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_extension_auto.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C7867181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_studio_auto.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C7868181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_studio_auto.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C786B181A11EC004E5527 /* lua_cocos2dx_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_auto.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C786C181A11EC004E5527 /* lua_cocos2dx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_auto.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C786E181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_extension_auto.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C786F181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_extension_auto.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C7871181A11EC004E5527 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = \"<group>\"; };\n\t\t1A2C78BE181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_chipmunk_auto_classes.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78BF181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_chipmunk_auto_classes.h; sourceTree = \"<group>\"; };\n\t\t1A2C78C0181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_chipmunk_auto_classes_registration.h; sourceTree = \"<group>\"; };\n\t\t1A2C78C1181A1257004E5527 /* js_bindings_chipmunk_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_chipmunk_functions.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78C2181A1257004E5527 /* js_bindings_chipmunk_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_chipmunk_functions.h; sourceTree = \"<group>\"; };\n\t\t1A2C78C3181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_chipmunk_functions_registration.h; sourceTree = \"<group>\"; };\n\t\t1A2C78C4181A1257004E5527 /* js_bindings_chipmunk_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_chipmunk_manual.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78C5181A1257004E5527 /* js_bindings_chipmunk_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_chipmunk_manual.h; sourceTree = \"<group>\"; };\n\t\t1A2C78C6181A1257004E5527 /* js_bindings_chipmunk_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_chipmunk_registration.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78C7181A1257004E5527 /* js_bindings_chipmunk_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_chipmunk_registration.h; sourceTree = \"<group>\"; };\n\t\t1A2C78CB181A1257004E5527 /* cocos2d_specifics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cocos2d_specifics.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78CC181A1257004E5527 /* cocos2d_specifics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cocos2d_specifics.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C78CF181A1257004E5527 /* cocosbuilder_specifics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cocosbuilder_specifics.hpp; sourceTree = \"<group>\"; };\n\t\t1A2C78D0181A1257004E5527 /* js_bindings_ccbreader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_ccbreader.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78D1181A1257004E5527 /* js_bindings_ccbreader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_ccbreader.h; sourceTree = \"<group>\"; };\n\t\t1A2C78D9181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_studio_manual.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78DA181A1257004E5527 /* jsb_cocos2dx_studio_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_cocos2dx_studio_manual.h; sourceTree = \"<group>\"; };\n\t\t1A2C78E0181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_extension_manual.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78E1181A1257004E5527 /* jsb_cocos2dx_extension_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_cocos2dx_extension_manual.h; sourceTree = \"<group>\"; };\n\t\t1A2C78E5181A1257004E5527 /* js_bindings_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_config.h; sourceTree = \"<group>\"; };\n\t\t1A2C78E6181A1257004E5527 /* js_bindings_core.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_core.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78E7181A1257004E5527 /* js_bindings_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_core.h; sourceTree = \"<group>\"; };\n\t\t1A2C78E8181A1257004E5527 /* js_bindings_opengl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_opengl.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78E9181A1257004E5527 /* js_bindings_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_opengl.h; sourceTree = \"<group>\"; };\n\t\t1A2C78EA181A1257004E5527 /* js_manual_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_manual_conversions.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78EB181A1257004E5527 /* js_manual_conversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_manual_conversions.h; sourceTree = \"<group>\"; };\n\t\t1A2C78EC181A1257004E5527 /* jsb_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_helper.h; sourceTree = \"<group>\"; };\n\t\t1A2C78ED181A1257004E5527 /* jsb_opengl_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_opengl_functions.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78EE181A1257004E5527 /* jsb_opengl_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_opengl_functions.h; sourceTree = \"<group>\"; };\n\t\t1A2C78EF181A1257004E5527 /* jsb_opengl_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_opengl_manual.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78F0181A1257004E5527 /* jsb_opengl_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_opengl_manual.h; sourceTree = \"<group>\"; };\n\t\t1A2C78F1181A1257004E5527 /* jsb_opengl_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_opengl_registration.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78F2181A1257004E5527 /* jsb_opengl_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_opengl_registration.h; sourceTree = \"<group>\"; };\n\t\t1A2C78F5181A1257004E5527 /* js_bindings_system_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_system_functions.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78F6181A1257004E5527 /* js_bindings_system_functions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_system_functions.h; sourceTree = \"<group>\"; };\n\t\t1A2C78F7181A1257004E5527 /* js_bindings_system_functions_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_system_functions_registration.h; sourceTree = \"<group>\"; };\n\t\t1A2C78F8181A1257004E5527 /* js_bindings_system_registration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = js_bindings_system_registration.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C78F9181A1257004E5527 /* js_bindings_system_registration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = js_bindings_system_registration.h; sourceTree = \"<group>\"; };\n\t\t1A2C78FF181A1257004E5527 /* jsb_websocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_websocket.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C7900181A1257004E5527 /* jsb_websocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_websocket.h; sourceTree = \"<group>\"; };\n\t\t1A2C7904181A1257004E5527 /* XMLHTTPRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHTTPRequest.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C7905181A1257004E5527 /* XMLHTTPRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHTTPRequest.h; sourceTree = \"<group>\"; };\n\t\t1A2C790A181A1257004E5527 /* ScriptingCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptingCore.cpp; sourceTree = \"<group>\"; };\n\t\t1A2C790B181A1257004E5527 /* ScriptingCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptingCore.h; sourceTree = \"<group>\"; };\n\t\t1A2C790C181A1257004E5527 /* spidermonkey_specifics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spidermonkey_specifics.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F4E180E88C200497A22 /* CCBProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBProxy.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F4F180E88C200497A22 /* CCBProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBProxy.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F50180E88C200497A22 /* CCLuaBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaBridge.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F51180E88C200497A22 /* CCLuaBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaBridge.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F52180E88C200497A22 /* CCLuaEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaEngine.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F53180E88C200497A22 /* CCLuaEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaEngine.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F54180E88C200497A22 /* CCLuaStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaStack.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F55180E88C200497A22 /* CCLuaStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaStack.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F56180E88C300497A22 /* CCLuaValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLuaValue.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F57180E88C300497A22 /* CCLuaValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaValue.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F58180E88C300497A22 /* Cocos2dxLuaLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cocos2dxLuaLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F59180E88C300497A22 /* Cocos2dxLuaLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cocos2dxLuaLoader.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F5D180E88C300497A22 /* lua_cocos2dx_deprecated.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_deprecated.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F5E180E88C300497A22 /* lua_cocos2dx_deprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_cocos2dx_deprecated.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F5F180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_extension_manual.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F60180E88C300497A22 /* lua_cocos2dx_extension_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_cocos2dx_extension_manual.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F61180E88C300497A22 /* lua_cocos2dx_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_manual.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F62180E88C300497A22 /* lua_cocos2dx_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_manual.hpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F63180E88C300497A22 /* Lua_web_socket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lua_web_socket.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F64180E88C300497A22 /* Lua_web_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lua_web_socket.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F65180E88C300497A22 /* LuaBasicConversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaBasicConversions.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F66180E88C300497A22 /* LuaBasicConversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaBasicConversions.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F67180E88C300497A22 /* LuaOpengl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaOpengl.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F68180E88C300497A22 /* LuaOpengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaOpengl.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F69180E88C300497A22 /* LuaScriptHandlerMgr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LuaScriptHandlerMgr.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1F6A180E88C300497A22 /* LuaScriptHandlerMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaScriptHandlerMgr.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F74180E88C300497A22 /* CCLuaObjcBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLuaObjcBridge.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F75180E88C300497A22 /* CCLuaObjcBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCLuaObjcBridge.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1F76180E88C300497A22 /* tolua_fix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_fix.c; sourceTree = \"<group>\"; };\n\t\t1A3B1F77180E88C300497A22 /* tolua_fix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tolua_fix.h; sourceTree = \"<group>\"; };\n\t\t1A570047180BC5A10088DEC7 /* CCAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAction.cpp; sourceTree = \"<group>\"; };\n\t\t1A570048180BC5A10088DEC7 /* CCAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAction.h; sourceTree = \"<group>\"; };\n\t\t1A570049180BC5A10088DEC7 /* CCActionCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionCamera.cpp; sourceTree = \"<group>\"; };\n\t\t1A57004A180BC5A10088DEC7 /* CCActionCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionCamera.h; sourceTree = \"<group>\"; };\n\t\t1A57004B180BC5A10088DEC7 /* CCActionCatmullRom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionCatmullRom.cpp; sourceTree = \"<group>\"; };\n\t\t1A57004C180BC5A10088DEC7 /* CCActionCatmullRom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionCatmullRom.h; sourceTree = \"<group>\"; };\n\t\t1A57004D180BC5A10088DEC7 /* CCActionEase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionEase.cpp; sourceTree = \"<group>\"; };\n\t\t1A57004E180BC5A10088DEC7 /* CCActionEase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionEase.h; sourceTree = \"<group>\"; };\n\t\t1A57004F180BC5A10088DEC7 /* CCActionGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionGrid.cpp; sourceTree = \"<group>\"; };\n\t\t1A570050180BC5A10088DEC7 /* CCActionGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionGrid.h; sourceTree = \"<group>\"; };\n\t\t1A570051180BC5A10088DEC7 /* CCActionGrid3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionGrid3D.cpp; sourceTree = \"<group>\"; };\n\t\t1A570052180BC5A10088DEC7 /* CCActionGrid3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionGrid3D.h; sourceTree = \"<group>\"; };\n\t\t1A570053180BC5A10088DEC7 /* CCActionInstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionInstant.cpp; sourceTree = \"<group>\"; };\n\t\t1A570054180BC5A10088DEC7 /* CCActionInstant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionInstant.h; sourceTree = \"<group>\"; };\n\t\t1A570055180BC5A10088DEC7 /* CCActionInterval.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionInterval.cpp; sourceTree = \"<group>\"; };\n\t\t1A570056180BC5A10088DEC7 /* CCActionInterval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionInterval.h; sourceTree = \"<group>\"; };\n\t\t1A570057180BC5A10088DEC7 /* CCActionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionManager.cpp; sourceTree = \"<group>\"; };\n\t\t1A570058180BC5A10088DEC7 /* CCActionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionManager.h; sourceTree = \"<group>\"; };\n\t\t1A570059180BC5A10088DEC7 /* CCActionPageTurn3D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionPageTurn3D.cpp; sourceTree = \"<group>\"; };\n\t\t1A57005A180BC5A10088DEC7 /* CCActionPageTurn3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionPageTurn3D.h; sourceTree = \"<group>\"; };\n\t\t1A57005B180BC5A10088DEC7 /* CCActionProgressTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionProgressTimer.cpp; sourceTree = \"<group>\"; };\n\t\t1A57005C180BC5A10088DEC7 /* CCActionProgressTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionProgressTimer.h; sourceTree = \"<group>\"; };\n\t\t1A57005D180BC5A10088DEC7 /* CCActionTiledGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionTiledGrid.cpp; sourceTree = \"<group>\"; };\n\t\t1A57005E180BC5A10088DEC7 /* CCActionTiledGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTiledGrid.h; sourceTree = \"<group>\"; };\n\t\t1A57005F180BC5A10088DEC7 /* CCActionTween.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionTween.cpp; sourceTree = \"<group>\"; };\n\t\t1A570060180BC5A10088DEC7 /* CCActionTween.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTween.h; sourceTree = \"<group>\"; };\n\t\t1A570096180BC5C10088DEC7 /* CCAtlasNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAtlasNode.cpp; sourceTree = \"<group>\"; };\n\t\t1A570097180BC5C10088DEC7 /* CCAtlasNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAtlasNode.h; sourceTree = \"<group>\"; };\n\t\t1A57009C180BC5D20088DEC7 /* CCNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNode.cpp; sourceTree = \"<group>\"; };\n\t\t1A57009D180BC5D20088DEC7 /* CCNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNode.h; sourceTree = \"<group>\"; };\n\t\t1A5700A3180BC6060088DEC7 /* atitc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = atitc.cpp; path = ../base/atitc.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700A4180BC6060088DEC7 /* atitc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = atitc.h; path = ../base/atitc.h; sourceTree = \"<group>\"; };\n\t\t1A5700A5180BC6060088DEC7 /* CCAffineTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCAffineTransform.cpp; path = ../base/CCAffineTransform.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700A6180BC6060088DEC7 /* CCAffineTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCAffineTransform.h; path = ../base/CCAffineTransform.h; sourceTree = \"<group>\"; };\n\t\t1A5700A7180BC6060088DEC7 /* CCArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCArray.cpp; path = ../base/CCArray.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700A8180BC6060088DEC7 /* CCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCArray.h; path = ../base/CCArray.h; sourceTree = \"<group>\"; };\n\t\t1A5700A9180BC6060088DEC7 /* CCAutoreleasePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCAutoreleasePool.cpp; path = ../base/CCAutoreleasePool.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700AA180BC6060088DEC7 /* CCAutoreleasePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCAutoreleasePool.h; path = ../base/CCAutoreleasePool.h; sourceTree = \"<group>\"; };\n\t\t1A5700AB180BC6060088DEC7 /* CCBool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCBool.h; path = ../base/CCBool.h; sourceTree = \"<group>\"; };\n\t\t1A5700AC180BC6060088DEC7 /* CCData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCData.cpp; path = ../base/CCData.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700AD180BC6060088DEC7 /* CCData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCData.h; path = ../base/CCData.h; sourceTree = \"<group>\"; };\n\t\t1A5700AE180BC6060088DEC7 /* CCDataVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCDataVisitor.cpp; path = ../base/CCDataVisitor.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700AF180BC6060088DEC7 /* CCDataVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDataVisitor.h; path = ../base/CCDataVisitor.h; sourceTree = \"<group>\"; };\n\t\t1A5700B0180BC6060088DEC7 /* CCDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCDictionary.cpp; path = ../base/CCDictionary.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700B1180BC6060088DEC7 /* CCDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDictionary.h; path = ../base/CCDictionary.h; sourceTree = \"<group>\"; };\n\t\t1A5700B2180BC6060088DEC7 /* CCDouble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDouble.h; path = ../base/CCDouble.h; sourceTree = \"<group>\"; };\n\t\t1A5700B3180BC6060088DEC7 /* CCFloat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCFloat.h; path = ../base/CCFloat.h; sourceTree = \"<group>\"; };\n\t\t1A5700B4180BC6060088DEC7 /* CCGeometry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCGeometry.cpp; path = ../base/CCGeometry.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700B5180BC6060088DEC7 /* CCGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCGeometry.h; path = ../base/CCGeometry.h; sourceTree = \"<group>\"; };\n\t\t1A5700B6180BC6060088DEC7 /* CCInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCInteger.h; path = ../base/CCInteger.h; sourceTree = \"<group>\"; };\n\t\t1A5700B7180BC6060088DEC7 /* CCNS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCNS.cpp; path = ../base/CCNS.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700B8180BC6060088DEC7 /* CCNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCNS.h; path = ../base/CCNS.h; sourceTree = \"<group>\"; };\n\t\t1A5700B9180BC6060088DEC7 /* CCObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCObject.cpp; path = ../base/CCObject.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700BA180BC6060088DEC7 /* CCObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCObject.h; path = ../base/CCObject.h; sourceTree = \"<group>\"; };\n\t\t1A5700BB180BC6060088DEC7 /* CCPlatformConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPlatformConfig.h; path = ../base/CCPlatformConfig.h; sourceTree = \"<group>\"; };\n\t\t1A5700BC180BC6060088DEC7 /* CCPlatformMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCPlatformMacros.h; path = ../base/CCPlatformMacros.h; sourceTree = \"<group>\"; };\n\t\t1A5700BD180BC6060088DEC7 /* CCSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCSet.cpp; path = ../base/CCSet.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700BE180BC6060088DEC7 /* CCSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCSet.h; path = ../base/CCSet.h; sourceTree = \"<group>\"; };\n\t\t1A5700BF180BC6060088DEC7 /* CCString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCString.cpp; path = ../base/CCString.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700C0180BC6060088DEC7 /* CCString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCString.h; path = ../base/CCString.h; sourceTree = \"<group>\"; };\n\t\t1A5700C1180BC6060088DEC7 /* etc1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = etc1.cpp; path = ../base/etc1.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700C2180BC6060088DEC7 /* etc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = etc1.h; path = ../base/etc1.h; sourceTree = \"<group>\"; };\n\t\t1A5700C3180BC6060088DEC7 /* s3tc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = s3tc.cpp; path = ../base/s3tc.cpp; sourceTree = \"<group>\"; };\n\t\t1A5700C4180BC6060088DEC7 /* s3tc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = s3tc.h; path = ../base/s3tc.h; sourceTree = \"<group>\"; };\n\t\t1A57010A180BC8ED0088DEC7 /* CCDrawingPrimitives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDrawingPrimitives.cpp; sourceTree = \"<group>\"; };\n\t\t1A57010B180BC8EE0088DEC7 /* CCDrawingPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDrawingPrimitives.h; sourceTree = \"<group>\"; };\n\t\t1A57010C180BC8EE0088DEC7 /* CCDrawNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCDrawNode.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A57010D180BC8EE0088DEC7 /* CCDrawNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDrawNode.h; sourceTree = \"<group>\"; };\n\t\t1A570117180BC90D0088DEC7 /* CCGrabber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGrabber.cpp; sourceTree = \"<group>\"; };\n\t\t1A570118180BC90D0088DEC7 /* CCGrabber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGrabber.h; sourceTree = \"<group>\"; };\n\t\t1A570119180BC90D0088DEC7 /* CCGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGrid.cpp; sourceTree = \"<group>\"; };\n\t\t1A57011A180BC90D0088DEC7 /* CCGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGrid.h; sourceTree = \"<group>\"; };\n\t\t1A570124180BC9460088DEC7 /* CCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEvent.cpp; sourceTree = \"<group>\"; };\n\t\t1A570125180BC9460088DEC7 /* CCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEvent.h; sourceTree = \"<group>\"; };\n\t\t1A570126180BC9460088DEC7 /* CCEventAcceleration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventAcceleration.cpp; sourceTree = \"<group>\"; };\n\t\t1A570127180BC9460088DEC7 /* CCEventAcceleration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventAcceleration.h; sourceTree = \"<group>\"; };\n\t\t1A570128180BC9460088DEC7 /* CCEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventCustom.cpp; sourceTree = \"<group>\"; };\n\t\t1A570129180BC9460088DEC7 /* CCEventCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventCustom.h; sourceTree = \"<group>\"; };\n\t\t1A57012A180BC9460088DEC7 /* CCEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventDispatcher.cpp; sourceTree = \"<group>\"; };\n\t\t1A57012B180BC9460088DEC7 /* CCEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventDispatcher.h; sourceTree = \"<group>\"; };\n\t\t1A57012C180BC9460088DEC7 /* CCEventKeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventKeyboard.cpp; sourceTree = \"<group>\"; };\n\t\t1A57012D180BC9460088DEC7 /* CCEventKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventKeyboard.h; sourceTree = \"<group>\"; };\n\t\t1A57012E180BC9460088DEC7 /* CCEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventListener.cpp; sourceTree = \"<group>\"; };\n\t\t1A57012F180BC9460088DEC7 /* CCEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventListener.h; sourceTree = \"<group>\"; };\n\t\t1A570130180BC9460088DEC7 /* CCEventListenerAcceleration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventListenerAcceleration.cpp; sourceTree = \"<group>\"; };\n\t\t1A570131180BC9460088DEC7 /* CCEventListenerAcceleration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventListenerAcceleration.h; sourceTree = \"<group>\"; };\n\t\t1A570132180BC9460088DEC7 /* CCEventListenerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventListenerCustom.cpp; sourceTree = \"<group>\"; };\n\t\t1A570133180BC9460088DEC7 /* CCEventListenerCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventListenerCustom.h; sourceTree = \"<group>\"; };\n\t\t1A570134180BC9460088DEC7 /* CCEventListenerKeyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventListenerKeyboard.cpp; sourceTree = \"<group>\"; };\n\t\t1A570135180BC9460088DEC7 /* CCEventListenerKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventListenerKeyboard.h; sourceTree = \"<group>\"; };\n\t\t1A570136180BC9460088DEC7 /* CCEventListenerTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventListenerTouch.cpp; sourceTree = \"<group>\"; };\n\t\t1A570137180BC9460088DEC7 /* CCEventListenerTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventListenerTouch.h; sourceTree = \"<group>\"; };\n\t\t1A570138180BC9460088DEC7 /* CCEventTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventTouch.cpp; sourceTree = \"<group>\"; };\n\t\t1A570139180BC9460088DEC7 /* CCEventTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventTouch.h; sourceTree = \"<group>\"; };\n\t\t1A570182180BCB590088DEC7 /* CCFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFont.cpp; sourceTree = \"<group>\"; };\n\t\t1A570183180BCB590088DEC7 /* CCFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFont.h; sourceTree = \"<group>\"; };\n\t\t1A570184180BCB590088DEC7 /* CCFontAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFontAtlas.cpp; sourceTree = \"<group>\"; };\n\t\t1A570185180BCB590088DEC7 /* CCFontAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFontAtlas.h; sourceTree = \"<group>\"; };\n\t\t1A570186180BCB590088DEC7 /* CCFontAtlasCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFontAtlasCache.cpp; sourceTree = \"<group>\"; };\n\t\t1A570187180BCB590088DEC7 /* CCFontAtlasCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFontAtlasCache.h; sourceTree = \"<group>\"; };\n\t\t1A57018C180BCB590088DEC7 /* CCFontFNT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFontFNT.cpp; sourceTree = \"<group>\"; };\n\t\t1A57018D180BCB590088DEC7 /* CCFontFNT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFontFNT.h; sourceTree = \"<group>\"; };\n\t\t1A57018E180BCB590088DEC7 /* CCFontFreeType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFontFreeType.cpp; sourceTree = \"<group>\"; };\n\t\t1A57018F180BCB590088DEC7 /* CCFontFreeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFontFreeType.h; sourceTree = \"<group>\"; };\n\t\t1A570190180BCB590088DEC7 /* CCLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCLabel.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A570191180BCB590088DEC7 /* CCLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabel.h; sourceTree = \"<group>\"; };\n\t\t1A570192180BCB590088DEC7 /* CCLabelAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelAtlas.cpp; sourceTree = \"<group>\"; };\n\t\t1A570193180BCB590088DEC7 /* CCLabelAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelAtlas.h; sourceTree = \"<group>\"; };\n\t\t1A570194180BCB590088DEC7 /* CCLabelBMFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelBMFont.cpp; sourceTree = \"<group>\"; };\n\t\t1A570195180BCB590088DEC7 /* CCLabelBMFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelBMFont.h; sourceTree = \"<group>\"; };\n\t\t1A570197180BCB590088DEC7 /* CCLabelTextFormatter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelTextFormatter.cpp; sourceTree = \"<group>\"; };\n\t\t1A570198180BCB590088DEC7 /* CCLabelTextFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTextFormatter.h; sourceTree = \"<group>\"; };\n\t\t1A570199180BCB590088DEC7 /* CCLabelTTF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelTTF.cpp; sourceTree = \"<group>\"; };\n\t\t1A57019A180BCB590088DEC7 /* CCLabelTTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTF.h; sourceTree = \"<group>\"; };\n\t\t1A5701D4180BCB8C0088DEC7 /* CCLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCLayer.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A5701D5180BCB8C0088DEC7 /* CCLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayer.h; sourceTree = \"<group>\"; };\n\t\t1A5701D6180BCB8C0088DEC7 /* CCScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScene.cpp; sourceTree = \"<group>\"; };\n\t\t1A5701D7180BCB8C0088DEC7 /* CCScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScene.h; sourceTree = \"<group>\"; };\n\t\t1A5701D8180BCB8C0088DEC7 /* CCTransition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTransition.cpp; sourceTree = \"<group>\"; };\n\t\t1A5701D9180BCB8C0088DEC7 /* CCTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransition.h; sourceTree = \"<group>\"; };\n\t\t1A5701DA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCTransitionPageTurn.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A5701DB180BCB8C0088DEC7 /* CCTransitionPageTurn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransitionPageTurn.h; sourceTree = \"<group>\"; };\n\t\t1A5701DC180BCB8C0088DEC7 /* CCTransitionProgress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTransitionProgress.cpp; sourceTree = \"<group>\"; };\n\t\t1A5701DD180BCB8C0088DEC7 /* CCTransitionProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransitionProgress.h; sourceTree = \"<group>\"; };\n\t\t1A5701F3180BCBAD0088DEC7 /* CCMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenu.cpp; sourceTree = \"<group>\"; };\n\t\t1A5701F4180BCBAD0088DEC7 /* CCMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenu.h; sourceTree = \"<group>\"; };\n\t\t1A5701F5180BCBAD0088DEC7 /* CCMenuItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItem.cpp; sourceTree = \"<group>\"; };\n\t\t1A5701F6180BCBAD0088DEC7 /* CCMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItem.h; sourceTree = \"<group>\"; };\n\t\t1A570200180BCBD40088DEC7 /* CCClippingNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCClippingNode.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A570201180BCBD40088DEC7 /* CCClippingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCClippingNode.h; sourceTree = \"<group>\"; };\n\t\t1A570206180BCBDF0088DEC7 /* CCMotionStreak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCMotionStreak.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A570207180BCBDF0088DEC7 /* CCMotionStreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMotionStreak.h; sourceTree = \"<group>\"; };\n\t\t1A57020C180BCBF40088DEC7 /* CCProgressTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCProgressTimer.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A57020D180BCBF40088DEC7 /* CCProgressTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProgressTimer.h; sourceTree = \"<group>\"; };\n\t\t1A57020E180BCBF40088DEC7 /* CCRenderTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCRenderTexture.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A57020F180BCBF40088DEC7 /* CCRenderTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderTexture.h; sourceTree = \"<group>\"; };\n\t\t1A570219180BCC1A0088DEC7 /* CCParticleBatchNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParticleBatchNode.cpp; sourceTree = \"<group>\"; };\n\t\t1A57021A180BCC1A0088DEC7 /* CCParticleBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleBatchNode.h; sourceTree = \"<group>\"; };\n\t\t1A57021B180BCC1A0088DEC7 /* CCParticleExamples.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParticleExamples.cpp; sourceTree = \"<group>\"; };\n\t\t1A57021C180BCC1A0088DEC7 /* CCParticleExamples.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleExamples.h; sourceTree = \"<group>\"; };\n\t\t1A57021D180BCC1A0088DEC7 /* CCParticleSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParticleSystem.cpp; sourceTree = \"<group>\"; };\n\t\t1A57021E180BCC1A0088DEC7 /* CCParticleSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystem.h; sourceTree = \"<group>\"; };\n\t\t1A57021F180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCParticleSystemQuad.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A570220180BCC1A0088DEC7 /* CCParticleSystemQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuad.h; sourceTree = \"<group>\"; };\n\t\t1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScriptSupport.cpp; sourceTree = \"<group>\"; };\n\t\t1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScriptSupport.h; sourceTree = \"<group>\"; };\n\t\t1A570239180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_Position_uColor_frag.h; sourceTree = \"<group>\"; };\n\t\t1A57023A180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_Position_uColor_vert.h; sourceTree = \"<group>\"; };\n\t\t1A57023B180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColor_frag.h; sourceTree = \"<group>\"; };\n\t\t1A57023C180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColor_vert.h; sourceTree = \"<group>\"; };\n\t\t1A57023D180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColorLengthTexture_frag.h; sourceTree = \"<group>\"; };\n\t\t1A57023E180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColorLengthTexture_vert.h; sourceTree = \"<group>\"; };\n\t\t1A57023F180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_frag.h; sourceTree = \"<group>\"; };\n\t\t1A570240180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_uColor_frag.h; sourceTree = \"<group>\"; };\n\t\t1A570241180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_uColor_vert.h; sourceTree = \"<group>\"; };\n\t\t1A570242180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_vert.h; sourceTree = \"<group>\"; };\n\t\t1A570243180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureA8Color_frag.h; sourceTree = \"<group>\"; };\n\t\t1A570244180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureA8Color_vert.h; sourceTree = \"<group>\"; };\n\t\t1A570245180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_frag.h; sourceTree = \"<group>\"; };\n\t\t1A570246180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_vert.h; sourceTree = \"<group>\"; };\n\t\t1A570247180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColorAlphaTest_frag.h; sourceTree = \"<group>\"; };\n\t\t1A570248180BCC6F0088DEC7 /* CCShaderCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCShaderCache.cpp; sourceTree = \"<group>\"; };\n\t\t1A570249180BCC6F0088DEC7 /* CCShaderCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCShaderCache.h; sourceTree = \"<group>\"; };\n\t\t1A57024A180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShaderEx_SwitchMask_frag.h; sourceTree = \"<group>\"; };\n\t\t1A57024B180BCC6F0088DEC7 /* ccShaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccShaders.cpp; sourceTree = \"<group>\"; };\n\t\t1A57024C180BCC6F0088DEC7 /* ccShaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShaders.h; sourceTree = \"<group>\"; };\n\t\t1A570276180BCC900088DEC7 /* CCSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCSprite.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A570277180BCC900088DEC7 /* CCSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite.h; sourceTree = \"<group>\"; };\n\t\t1A570278180BCC900088DEC7 /* CCSpriteBatchNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteBatchNode.cpp; sourceTree = \"<group>\"; };\n\t\t1A570279180BCC900088DEC7 /* CCSpriteBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteBatchNode.h; sourceTree = \"<group>\"; };\n\t\t1A57027A180BCC900088DEC7 /* CCSpriteFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteFrame.cpp; sourceTree = \"<group>\"; };\n\t\t1A57027B180BCC900088DEC7 /* CCSpriteFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrame.h; sourceTree = \"<group>\"; };\n\t\t1A57027C180BCC900088DEC7 /* CCSpriteFrameCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteFrameCache.cpp; sourceTree = \"<group>\"; };\n\t\t1A57027D180BCC900088DEC7 /* CCSpriteFrameCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrameCache.h; sourceTree = \"<group>\"; };\n\t\t1A57028E180BCCAB0088DEC7 /* CCAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAnimation.cpp; sourceTree = \"<group>\"; };\n\t\t1A57028F180BCCAB0088DEC7 /* CCAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimation.h; sourceTree = \"<group>\"; };\n\t\t1A570290180BCCAB0088DEC7 /* CCAnimationCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCAnimationCache.cpp; sourceTree = \"<group>\"; };\n\t\t1A570291180BCCAB0088DEC7 /* CCAnimationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimationCache.h; sourceTree = \"<group>\"; };\n\t\t1A57029B180BCD890088DEC7 /* base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = base64.cpp; sourceTree = \"<group>\"; };\n\t\t1A57029C180BCD890088DEC7 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = \"<group>\"; };\n\t\t1A5702A1180BCD980088DEC7 /* CCNotificationCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNotificationCenter.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702A2180BCD980088DEC7 /* CCNotificationCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNotificationCenter.h; sourceTree = \"<group>\"; };\n\t\t1A5702A7180BCDAA0088DEC7 /* CCProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProfiling.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702A8180BCDAA0088DEC7 /* CCProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProfiling.h; sourceTree = \"<group>\"; };\n\t\t1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccUTF8.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccUTF8.h; sourceTree = \"<group>\"; };\n\t\t1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCVertex.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702B4180BCDF40088DEC7 /* CCVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCVertex.h; sourceTree = \"<group>\"; };\n\t\t1A5702B9180BCDFC0088DEC7 /* ccUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccUtils.h; sourceTree = \"<group>\"; };\n\t\t1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCIMEDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCIMEDispatcher.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCIMEDispatcher.h; sourceTree = \"<group>\"; };\n\t\t1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextFieldTTF.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextFieldTTF.h; sourceTree = \"<group>\"; };\n\t\t1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTexture2D.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702CE180BCE570088DEC7 /* CCTexture2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexture2D.h; sourceTree = \"<group>\"; };\n\t\t1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureAtlas.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureAtlas.h; sourceTree = \"<group>\"; };\n\t\t1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTextureCache.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702D2180BCE570088DEC7 /* CCTextureCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureCache.h; sourceTree = \"<group>\"; };\n\t\t1A5702E0180BCE750088DEC7 /* CCTileMapAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTileMapAtlas.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702E1180BCE750088DEC7 /* CCTileMapAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTileMapAtlas.h; sourceTree = \"<group>\"; };\n\t\t1A5702E2180BCE750088DEC7 /* CCTMXLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTMXLayer.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702E3180BCE750088DEC7 /* CCTMXLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXLayer.h; sourceTree = \"<group>\"; };\n\t\t1A5702E4180BCE750088DEC7 /* CCTMXObjectGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTMXObjectGroup.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702E5180BCE750088DEC7 /* CCTMXObjectGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXObjectGroup.h; sourceTree = \"<group>\"; };\n\t\t1A5702E6180BCE750088DEC7 /* CCTMXTiledMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTMXTiledMap.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702E7180BCE750088DEC7 /* CCTMXTiledMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXTiledMap.h; sourceTree = \"<group>\"; };\n\t\t1A5702E8180BCE750088DEC7 /* CCTMXXMLParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTMXXMLParser.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702E9180BCE750088DEC7 /* CCTMXXMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXXMLParser.h; sourceTree = \"<group>\"; };\n\t\t1A5702FE180BCE890088DEC7 /* CCParallaxNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParallaxNode.cpp; sourceTree = \"<group>\"; };\n\t\t1A5702FF180BCE890088DEC7 /* CCParallaxNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParallaxNode.h; sourceTree = \"<group>\"; };\n\t\t1A570304180BCED90088DEC7 /* ccUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccUtils.cpp; sourceTree = \"<group>\"; };\n\t\t1A570308180BCF190088DEC7 /* CCComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComponent.cpp; sourceTree = \"<group>\"; };\n\t\t1A570309180BCF190088DEC7 /* CCComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComponent.h; sourceTree = \"<group>\"; };\n\t\t1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComponentContainer.cpp; sourceTree = \"<group>\"; };\n\t\t1A57030B180BCF190088DEC7 /* CCComponentContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComponentContainer.h; sourceTree = \"<group>\"; };\n\t\t1A570315180BCF430088DEC7 /* ccCArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccCArray.cpp; sourceTree = \"<group>\"; };\n\t\t1A570316180BCF430088DEC7 /* ccCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccCArray.h; sourceTree = \"<group>\"; };\n\t\t1A570317180BCF430088DEC7 /* uthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uthash.h; sourceTree = \"<group>\"; };\n\t\t1A570318180BCF430088DEC7 /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utlist.h; sourceTree = \"<group>\"; };\n\t\t1A570322180BCF660088DEC7 /* TGAlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TGAlib.cpp; sourceTree = \"<group>\"; };\n\t\t1A570323180BCF660088DEC7 /* TGAlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TGAlib.h; sourceTree = \"<group>\"; };\n\t\t1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCUserDefault.cpp; sourceTree = \"<group>\"; };\n\t\t1A57032C180BCFD50088DEC7 /* CCUserDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCUserDefault.h; sourceTree = \"<group>\"; };\n\t\t1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCUserDefault.mm; sourceTree = \"<group>\"; };\n\t\t1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCUserDefaultAndroid.cpp; sourceTree = \"<group>\"; };\n\t\t1A570338180BCFFA0088DEC7 /* ZipUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZipUtils.cpp; sourceTree = \"<group>\"; };\n\t\t1A570339180BCFFA0088DEC7 /* ZipUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipUtils.h; sourceTree = \"<group>\"; };\n\t\t1A570346180BD0850088DEC7 /* libglfw3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libglfw3.a; path = ../external/glfw3/prebuilt/mac/libglfw3.a; sourceTree = \"<group>\"; };\n\t\t1A570349180BD09B0088DEC7 /* tinyxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml2.cpp; sourceTree = \"<group>\"; };\n\t\t1A57034A180BD09B0088DEC7 /* tinyxml2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml2.h; sourceTree = \"<group>\"; };\n\t\t1A570350180BD0B00088DEC7 /* ioapi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ioapi.cpp; sourceTree = \"<group>\"; };\n\t\t1A570351180BD0B00088DEC7 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = \"<group>\"; };\n\t\t1A570352180BD0B00088DEC7 /* unzip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unzip.cpp; sourceTree = \"<group>\"; };\n\t\t1A570353180BD0B00088DEC7 /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unzip.h; sourceTree = \"<group>\"; };\n\t\t1A570360180BD1080088DEC7 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpng.a; sourceTree = \"<group>\"; };\n\t\t1A570363180BD1120088DEC7 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libpng.a; sourceTree = \"<group>\"; };\n\t\t1A570377180BD1B40088DEC7 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjpeg.a; sourceTree = \"<group>\"; };\n\t\t1A57037A180BD1C90088DEC7 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjpeg.a; sourceTree = \"<group>\"; };\n\t\t1A5703A0180BD22C0088DEC7 /* libtiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libtiff.a; sourceTree = \"<group>\"; };\n\t\t1A5703A3180BD2350088DEC7 /* libtiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libtiff.a; sourceTree = \"<group>\"; };\n\t\t1A5703B7180BD2780088DEC7 /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebp.a; sourceTree = \"<group>\"; };\n\t\t1A5703BA180BD2800088DEC7 /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebp.a; sourceTree = \"<group>\"; };\n\t\t1A57052A180BD31F0088DEC7 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfreetype.a; sourceTree = \"<group>\"; };\n\t\t1A57052D180BD3280088DEC7 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libfreetype.a; sourceTree = \"<group>\"; };\n\t\t1A57052F180BD9500088DEC7 /* CCGLProgram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLProgram.cpp; sourceTree = \"<group>\"; };\n\t\t1A570530180BD9500088DEC7 /* CCGLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgram.h; sourceTree = \"<group>\"; };\n\t\t1A570531180BD9500088DEC7 /* ccGLStateCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccGLStateCache.cpp; sourceTree = \"<group>\"; };\n\t\t1A570532180BD9500088DEC7 /* ccGLStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccGLStateCache.h; sourceTree = \"<group>\"; };\n\t\t1A570544180BD9C40088DEC7 /* CCTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTouch.cpp; sourceTree = \"<group>\"; };\n\t\t1A570545180BD9C40088DEC7 /* CCTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTouch.h; sourceTree = \"<group>\"; };\n\t\t1A57FFF7180BC5160088DEC7 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CHANGELOG; path = ../CHANGELOG; sourceTree = \"<group>\"; };\n\t\t1A6FB53017854BC300CDF010 /* libluabindings Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libluabindings Mac.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1A85BA0C1845F31700260FC0 /* CCVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCVector.h; path = ../base/CCVector.h; sourceTree = \"<group>\"; };\n\t\t1A8C563F180E8D0D00EF57C3 /* tolua++.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"tolua++.h\"; sourceTree = \"<group>\"; };\n\t\t1A8C5640180E8D0D00EF57C3 /* tolua_event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_event.c; sourceTree = \"<group>\"; };\n\t\t1A8C5641180E8D0D00EF57C3 /* tolua_event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tolua_event.h; sourceTree = \"<group>\"; };\n\t\t1A8C5642180E8D0D00EF57C3 /* tolua_is.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_is.c; sourceTree = \"<group>\"; };\n\t\t1A8C5643180E8D0D00EF57C3 /* tolua_map.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_map.c; sourceTree = \"<group>\"; };\n\t\t1A8C5644180E8D0D00EF57C3 /* tolua_push.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_push.c; sourceTree = \"<group>\"; };\n\t\t1A8C5645180E8D0D00EF57C3 /* tolua_to.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tolua_to.c; sourceTree = \"<group>\"; };\n\t\t1A8C58BF180E92CC00EF57C3 /* CocosGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUI.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58C0180E92CC00EF57C3 /* CocosGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUI.h; sourceTree = \"<group>\"; };\n\t\t1A8C58C1180E92CC00EF57C3 /* UILayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = UILayout.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A8C58C2180E92CC00EF57C3 /* UILayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayout.h; sourceTree = \"<group>\"; };\n\t\t1A8C58C3180E92CC00EF57C3 /* UILayoutParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutParameter.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58C4180E92CC00EF57C3 /* UILayoutParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutParameter.h; sourceTree = \"<group>\"; };\n\t\t1A8C58C5180E92CC00EF57C3 /* UIButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIButton.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58C6180E92CC00EF57C3 /* UIButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIButton.h; sourceTree = \"<group>\"; };\n\t\t1A8C58C7180E92CC00EF57C3 /* UICheckBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UICheckBox.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58C8180E92CC00EF57C3 /* UICheckBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICheckBox.h; sourceTree = \"<group>\"; };\n\t\t1A8C58CB180E92CC00EF57C3 /* UIHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIHelper.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58CC180E92CC00EF57C3 /* UIHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIHelper.h; sourceTree = \"<group>\"; };\n\t\t1A8C58CD180E92CC00EF57C3 /* UIImageView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIImageView.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58CE180E92CC00EF57C3 /* UIImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIImageView.h; sourceTree = \"<group>\"; };\n\t\t1A8C58D1180E92CC00EF57C3 /* UIText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIText.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58D2180E92CC00EF57C3 /* UIText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIText.h; sourceTree = \"<group>\"; };\n\t\t1A8C58D3180E92CC00EF57C3 /* UITextAtlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextAtlas.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58D4180E92CC00EF57C3 /* UITextAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextAtlas.h; sourceTree = \"<group>\"; };\n\t\t1A8C58D5180E92CC00EF57C3 /* UITextBMFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextBMFont.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58D6180E92CC00EF57C3 /* UITextBMFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextBMFont.h; sourceTree = \"<group>\"; };\n\t\t1A8C58D9180E92CC00EF57C3 /* UILayoutDefine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutDefine.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58DA180E92CC00EF57C3 /* UILayoutDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutDefine.h; sourceTree = \"<group>\"; };\n\t\t1A8C58DD180E92CC00EF57C3 /* UILoadingBar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILoadingBar.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58DE180E92CC00EF57C3 /* UILoadingBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILoadingBar.h; sourceTree = \"<group>\"; };\n\t\t1A8C58DF180E92CC00EF57C3 /* UIPageView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIPageView.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58E0180E92CC00EF57C3 /* UIPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPageView.h; sourceTree = \"<group>\"; };\n\t\t1A8C58E3180E92CC00EF57C3 /* UIScrollInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScrollInterface.h; sourceTree = \"<group>\"; };\n\t\t1A8C58E4180E92CC00EF57C3 /* UIScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScrollView.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58E5180E92CC00EF57C3 /* UIScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScrollView.h; sourceTree = \"<group>\"; };\n\t\t1A8C58E6180E92CC00EF57C3 /* UISlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UISlider.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58E7180E92CC00EF57C3 /* UISlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISlider.h; sourceTree = \"<group>\"; };\n\t\t1A8C58E8180E92CC00EF57C3 /* UITextField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextField.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58E9180E92CC00EF57C3 /* UITextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextField.h; sourceTree = \"<group>\"; };\n\t\t1A8C58EA180E92CC00EF57C3 /* UIWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidget.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C58EB180E92CC00EF57C3 /* UIWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidget.h; sourceTree = \"<group>\"; };\n\t\t1A8C5948180E930E00EF57C3 /* CCActionFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionFrame.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5949180E930E00EF57C3 /* CCActionFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionFrame.h; sourceTree = \"<group>\"; };\n\t\t1A8C594A180E930E00EF57C3 /* CCActionFrameEasing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionFrameEasing.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C594B180E930E00EF57C3 /* CCActionFrameEasing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionFrameEasing.h; sourceTree = \"<group>\"; };\n\t\t1A8C594C180E930E00EF57C3 /* CCActionManagerEx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionManagerEx.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C594D180E930E00EF57C3 /* CCActionManagerEx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionManagerEx.h; sourceTree = \"<group>\"; };\n\t\t1A8C594E180E930E00EF57C3 /* CCActionNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionNode.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C594F180E930E00EF57C3 /* CCActionNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionNode.h; sourceTree = \"<group>\"; };\n\t\t1A8C5950180E930E00EF57C3 /* CCActionObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionObject.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5951180E930E00EF57C3 /* CCActionObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionObject.h; sourceTree = \"<group>\"; };\n\t\t1A8C5952180E930E00EF57C3 /* CCArmature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmature.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5953180E930E00EF57C3 /* CCArmature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmature.h; sourceTree = \"<group>\"; };\n\t\t1A8C5954180E930E00EF57C3 /* CCArmatureAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmatureAnimation.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5955180E930E00EF57C3 /* CCArmatureAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmatureAnimation.h; sourceTree = \"<group>\"; };\n\t\t1A8C5956180E930E00EF57C3 /* CCArmatureDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmatureDataManager.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5957180E930E00EF57C3 /* CCArmatureDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmatureDataManager.h; sourceTree = \"<group>\"; };\n\t\t1A8C5958180E930E00EF57C3 /* CCArmatureDefine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCArmatureDefine.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5959180E930E00EF57C3 /* CCArmatureDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArmatureDefine.h; sourceTree = \"<group>\"; };\n\t\t1A8C595A180E930E00EF57C3 /* CCBatchNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCBatchNode.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A8C595B180E930E00EF57C3 /* CCBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBatchNode.h; sourceTree = \"<group>\"; };\n\t\t1A8C595C180E930E00EF57C3 /* CCBone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBone.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C595D180E930E00EF57C3 /* CCBone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBone.h; sourceTree = \"<group>\"; };\n\t\t1A8C595E180E930E00EF57C3 /* CCColliderDetector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCColliderDetector.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C595F180E930E00EF57C3 /* CCColliderDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCColliderDetector.h; sourceTree = \"<group>\"; };\n\t\t1A8C5960180E930E00EF57C3 /* CCComAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComAttribute.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5961180E930E00EF57C3 /* CCComAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComAttribute.h; sourceTree = \"<group>\"; };\n\t\t1A8C5962180E930E00EF57C3 /* CCComAudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComAudio.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5963180E930E00EF57C3 /* CCComAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComAudio.h; sourceTree = \"<group>\"; };\n\t\t1A8C5964180E930E00EF57C3 /* CCComController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComController.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5965180E930E00EF57C3 /* CCComController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComController.h; sourceTree = \"<group>\"; };\n\t\t1A8C5966180E930E00EF57C3 /* CCComRender.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCComRender.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5967180E930E00EF57C3 /* CCComRender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComRender.h; sourceTree = \"<group>\"; };\n\t\t1A8C5968180E930E00EF57C3 /* CCDataReaderHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDataReaderHelper.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5969180E930E00EF57C3 /* CCDataReaderHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDataReaderHelper.h; sourceTree = \"<group>\"; };\n\t\t1A8C596A180E930E00EF57C3 /* CCDatas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDatas.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C596B180E930E00EF57C3 /* CCDatas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDatas.h; sourceTree = \"<group>\"; };\n\t\t1A8C596C180E930E00EF57C3 /* CCDecorativeDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDecorativeDisplay.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C596D180E930E00EF57C3 /* CCDecorativeDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDecorativeDisplay.h; sourceTree = \"<group>\"; };\n\t\t1A8C596E180E930E00EF57C3 /* CCDisplayFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDisplayFactory.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C596F180E930E00EF57C3 /* CCDisplayFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDisplayFactory.h; sourceTree = \"<group>\"; };\n\t\t1A8C5970180E930E00EF57C3 /* CCDisplayManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDisplayManager.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5971180E930E00EF57C3 /* CCDisplayManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDisplayManager.h; sourceTree = \"<group>\"; };\n\t\t1A8C5972180E930E00EF57C3 /* CCInputDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCInputDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5973180E930E00EF57C3 /* CCInputDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCInputDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A8C5974180E930E00EF57C3 /* CCProcessBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCProcessBase.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5975180E930E00EF57C3 /* CCProcessBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProcessBase.h; sourceTree = \"<group>\"; };\n\t\t1A8C5976180E930E00EF57C3 /* CCSGUIReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSGUIReader.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5977180E930E00EF57C3 /* CCSGUIReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSGUIReader.h; sourceTree = \"<group>\"; };\n\t\t1A8C5978180E930E00EF57C3 /* CCSkin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCSkin.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1A8C5979180E930E00EF57C3 /* CCSkin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkin.h; sourceTree = \"<group>\"; };\n\t\t1A8C597A180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteFrameCacheHelper.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C597B180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrameCacheHelper.h; sourceTree = \"<group>\"; };\n\t\t1A8C597C180E930E00EF57C3 /* CCSSceneReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSSceneReader.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C597D180E930E00EF57C3 /* CCSSceneReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSSceneReader.h; sourceTree = \"<group>\"; };\n\t\t1A8C597E180E930E00EF57C3 /* CCTransformHelp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTransformHelp.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C597F180E930E00EF57C3 /* CCTransformHelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransformHelp.h; sourceTree = \"<group>\"; };\n\t\t1A8C5980180E930E00EF57C3 /* CCTween.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTween.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5981180E930E00EF57C3 /* CCTween.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTween.h; sourceTree = \"<group>\"; };\n\t\t1A8C5982180E930E00EF57C3 /* CCTweenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTweenFunction.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5983180E930E00EF57C3 /* CCTweenFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTweenFunction.h; sourceTree = \"<group>\"; };\n\t\t1A8C5984180E930E00EF57C3 /* CCUtilMath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCUtilMath.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5985180E930E00EF57C3 /* CCUtilMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCUtilMath.h; sourceTree = \"<group>\"; };\n\t\t1A8C5986180E930E00EF57C3 /* CocoStudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocoStudio.h; sourceTree = \"<group>\"; };\n\t\t1A8C5989180E930E00EF57C3 /* DictionaryHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictionaryHelper.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryHelper.h; sourceTree = \"<group>\"; };\n\t\t1A9DC9F8180E6955007A3AD4 /* ccConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccConfig.h; sourceTree = \"<group>\"; };\n\t\t1A9DC9F9180E6955007A3AD4 /* CCConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCConfiguration.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DC9FA180E6955007A3AD4 /* CCConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCConfiguration.h; sourceTree = \"<group>\"; };\n\t\t1A9DC9FD180E6955007A3AD4 /* CCDirector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDirector.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DC9FE180E6955007A3AD4 /* CCDirector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirector.h; sourceTree = \"<group>\"; };\n\t\t1A9DC9FF180E6955007A3AD4 /* CCEventType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventType.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccFPSImages.c; sourceTree = \"<group>\"; };\n\t\t1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccFPSImages.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGLBufferedNode.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLBufferedNode.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA04180E6955007A3AD4 /* ccMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccMacros.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA05180E6955007A3AD4 /* CCProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProtocols.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA06180E6955007A3AD4 /* CCScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScheduler.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DCA07180E6955007A3AD4 /* CCScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScheduler.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA0A180E6955007A3AD4 /* cocos2d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cocos2d.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DCA0B180E6955007A3AD4 /* cocos2d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocos2d.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA0C180E6955007A3AD4 /* firePngData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = firePngData.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA0D180E6955007A3AD4 /* TransformUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformUtils.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DCA0E180E6955007A3AD4 /* TransformUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformUtils.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA41180E6D90007A3AD4 /* CCDeprecated.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCDeprecated.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DCA42180E6D90007A3AD4 /* CCDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDeprecated.h; sourceTree = \"<group>\"; };\n\t\t1A9DCA47180E6DE3007A3AD4 /* ccTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ccTypes.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DCA48180E6DE3007A3AD4 /* ccTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccTypes.h; sourceTree = \"<group>\"; };\n\t\t1AA2063E1848437900053418 /* CCMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCMap.h; path = ../base/CCMap.h; sourceTree = \"<group>\"; };\n\t\t1AAF5351180E3060000584C8 /* AssetsManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssetsManager.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5352180E3060000584C8 /* AssetsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssetsManager.h; sourceTree = \"<group>\"; };\n\t\t1AAF5362180E3374000584C8 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5363180E3374000584C8 /* HttpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpClient.h; sourceTree = \"<group>\"; };\n\t\t1AAF5364180E3374000584C8 /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5365180E3374000584C8 /* HttpResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpResponse.h; sourceTree = \"<group>\"; };\n\t\t1AAF5366180E3374000584C8 /* SocketIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketIO.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5367180E3374000584C8 /* SocketIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketIO.h; sourceTree = \"<group>\"; };\n\t\t1AAF5368180E3374000584C8 /* WebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocket.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5369180E3374000584C8 /* WebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocket.h; sourceTree = \"<group>\"; };\n\t\t1AAF5384180E35A3000584C8 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebsockets.a; sourceTree = \"<group>\"; };\n\t\t1AAF5387180E35AC000584C8 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libwebsockets.a; sourceTree = \"<group>\"; };\n\t\t1AAF541C180E3B6A000584C8 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcurl.a; sourceTree = \"<group>\"; };\n\t\t1AAF5421180E4047000584C8 /* libjs_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjs_static.a; sourceTree = \"<group>\"; };\n\t\t1AAF5424180E405B000584C8 /* libjs_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjs_static.a; sourceTree = \"<group>\"; };\n\t\t1AAF584B180E40B9000584C8 /* Android.mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Android.mk; sourceTree = \"<group>\"; };\n\t\t1AAF584C180E40B9000584C8 /* LocalStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorage.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF584D180E40B9000584C8 /* LocalStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalStorage.h; sourceTree = \"<group>\"; };\n\t\t1AAF584E180E40B9000584C8 /* LocalStorageAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalStorageAndroid.cpp; sourceTree = \"<group>\"; };\n\t\t1ABA68AC1888D700007D1BB4 /* CCFontCharMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFontCharMap.cpp; sourceTree = \"<group>\"; };\n\t\t1ABA68AD1888D700007D1BB4 /* CCFontCharMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFontCharMap.h; sourceTree = \"<group>\"; };\n\t\t1AD71CFA180E26E600808F54 /* CCBAnimationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBAnimationManager.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71CFB180E26E600808F54 /* CCBAnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBAnimationManager.h; sourceTree = \"<group>\"; };\n\t\t1AD71CFC180E26E600808F54 /* CCBFileLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBFileLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71CFD180E26E600808F54 /* CCBFileLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBFileLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71CFE180E26E600808F54 /* CCBKeyframe.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBKeyframe.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71CFF180E26E600808F54 /* CCBKeyframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBKeyframe.h; sourceTree = \"<group>\"; };\n\t\t1AD71D00180E26E600808F54 /* CCBMemberVariableAssigner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBMemberVariableAssigner.h; sourceTree = \"<group>\"; };\n\t\t1AD71D01180E26E600808F54 /* CCBReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBReader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D02180E26E600808F54 /* CCBReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBReader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D03180E26E600808F54 /* CCBSelectorResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSelectorResolver.h; sourceTree = \"<group>\"; };\n\t\t1AD71D04180E26E600808F54 /* CCBSequence.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequence.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D05180E26E600808F54 /* CCBSequence.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequence.h; sourceTree = \"<group>\"; };\n\t\t1AD71D06180E26E600808F54 /* CCBSequenceProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBSequenceProperty.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D07180E26E600808F54 /* CCBSequenceProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBSequenceProperty.h; sourceTree = \"<group>\"; };\n\t\t1AD71D0A180E26E600808F54 /* CCControlButtonLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButtonLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D0B180E26E600808F54 /* CCControlButtonLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButtonLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D0C180E26E600808F54 /* CCControlLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D0D180E26E600808F54 /* CCControlLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D0E180E26E600808F54 /* CCLabelBMFontLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelBMFontLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D0F180E26E600808F54 /* CCLabelBMFontLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelBMFontLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D10180E26E600808F54 /* CCLabelTTFLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLabelTTFLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D11180E26E600808F54 /* CCLabelTTFLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTFLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D12180E26E600808F54 /* CCLayerColorLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerColorLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D13180E26E600808F54 /* CCLayerColorLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerColorLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D14180E26E600808F54 /* CCLayerGradientLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerGradientLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D15180E26E600808F54 /* CCLayerGradientLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerGradientLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D16180E26E600808F54 /* CCLayerLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCLayerLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D17180E26E600808F54 /* CCLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D18180E26E600808F54 /* CCMenuItemImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemImageLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D19180E26E600808F54 /* CCMenuItemImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemImageLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D1A180E26E600808F54 /* CCMenuItemLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMenuItemLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D1B180E26E600808F54 /* CCMenuItemLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItemLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D1C180E26E600808F54 /* CCMenuLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D1D180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"CCNode+CCBRelativePositioning.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AD71D1E180E26E600808F54 /* CCNode+CCBRelativePositioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"CCNode+CCBRelativePositioning.h\"; sourceTree = \"<group>\"; };\n\t\t1AD71D1F180E26E600808F54 /* CCNodeLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D20180E26E600808F54 /* CCNodeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D21180E26E600808F54 /* CCNodeLoaderLibrary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCNodeLoaderLibrary.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D22180E26E600808F54 /* CCNodeLoaderLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderLibrary.h; sourceTree = \"<group>\"; };\n\t\t1AD71D23180E26E600808F54 /* CCNodeLoaderListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeLoaderListener.h; sourceTree = \"<group>\"; };\n\t\t1AD71D24180E26E600808F54 /* CCParticleSystemQuadLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCParticleSystemQuadLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D25180E26E600808F54 /* CCParticleSystemQuadLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuadLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D26180E26E600808F54 /* CCScale9SpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9SpriteLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D27180E26E600808F54 /* CCScale9SpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScale9SpriteLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D28180E26E600808F54 /* CCScrollViewLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCScrollViewLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D29180E26E600808F54 /* CCScrollViewLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollViewLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D2A180E26E600808F54 /* CCSpriteLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSpriteLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D2B180E26E600808F54 /* CCSpriteLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D2C180E26E600808F54 /* CocosBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosBuilder.h; sourceTree = \"<group>\"; };\n\t\t1AD71D7E180E26E600808F54 /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Animation.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D7F180E26E600808F54 /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Animation.h; sourceTree = \"<group>\"; };\n\t\t1AD71D80180E26E600808F54 /* AnimationState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationState.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D81180E26E600808F54 /* AnimationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationState.h; sourceTree = \"<group>\"; };\n\t\t1AD71D82180E26E600808F54 /* AnimationStateData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationStateData.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D83180E26E600808F54 /* AnimationStateData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationStateData.h; sourceTree = \"<group>\"; };\n\t\t1AD71D84180E26E600808F54 /* Atlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Atlas.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D85180E26E600808F54 /* Atlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Atlas.h; sourceTree = \"<group>\"; };\n\t\t1AD71D86180E26E600808F54 /* AtlasAttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtlasAttachmentLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D87180E26E600808F54 /* AtlasAttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AtlasAttachmentLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D88180E26E600808F54 /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Attachment.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D89180E26E600808F54 /* Attachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attachment.h; sourceTree = \"<group>\"; };\n\t\t1AD71D8A180E26E600808F54 /* AttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AttachmentLoader.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D8B180E26E600808F54 /* AttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AttachmentLoader.h; sourceTree = \"<group>\"; };\n\t\t1AD71D8C180E26E600808F54 /* Bone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bone.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D8D180E26E600808F54 /* Bone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bone.h; sourceTree = \"<group>\"; };\n\t\t1AD71D8E180E26E600808F54 /* BoneData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BoneData.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D8F180E26E600808F54 /* BoneData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BoneData.h; sourceTree = \"<group>\"; };\n\t\t1AD71D90180E26E600808F54 /* CCSkeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCSkeleton.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AD71D91180E26E600808F54 /* CCSkeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkeleton.h; sourceTree = \"<group>\"; };\n\t\t1AD71D92180E26E600808F54 /* CCSkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCSkeletonAnimation.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D93180E26E600808F54 /* CCSkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSkeletonAnimation.h; sourceTree = \"<group>\"; };\n\t\t1AD71D94180E26E600808F54 /* extension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extension.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D95180E26E600808F54 /* extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extension.h; sourceTree = \"<group>\"; };\n\t\t1AD71D96180E26E600808F54 /* Json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Json.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D97180E26E600808F54 /* Json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Json.h; sourceTree = \"<group>\"; };\n\t\t1AD71D98180E26E600808F54 /* RegionAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegionAttachment.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D99180E26E600808F54 /* RegionAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegionAttachment.h; sourceTree = \"<group>\"; };\n\t\t1AD71D9A180E26E600808F54 /* Skeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Skeleton.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D9B180E26E600808F54 /* Skeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Skeleton.h; sourceTree = \"<group>\"; };\n\t\t1AD71D9C180E26E600808F54 /* SkeletonData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonData.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D9D180E26E600808F54 /* SkeletonData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonData.h; sourceTree = \"<group>\"; };\n\t\t1AD71D9E180E26E600808F54 /* SkeletonJson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonJson.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71D9F180E26E600808F54 /* SkeletonJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonJson.h; sourceTree = \"<group>\"; };\n\t\t1AD71DA0180E26E600808F54 /* Skin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Skin.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71DA1180E26E600808F54 /* Skin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Skin.h; sourceTree = \"<group>\"; };\n\t\t1AD71DA2180E26E600808F54 /* Slot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Slot.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71DA3180E26E600808F54 /* Slot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slot.h; sourceTree = \"<group>\"; };\n\t\t1AD71DA4180E26E600808F54 /* SlotData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SlotData.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71DA5180E26E600808F54 /* SlotData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlotData.h; sourceTree = \"<group>\"; };\n\t\t1AD71DA6180E26E600808F54 /* spine-cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"spine-cocos2dx.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AD71DA7180E26E600808F54 /* spine-cocos2dx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"spine-cocos2dx.h\"; sourceTree = \"<group>\"; };\n\t\t1AD71DA8180E26E600808F54 /* spine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spine.h; sourceTree = \"<group>\"; };\n\t\t1AD71EEC180E27CF00808F54 /* CCPhysicsDebugNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsDebugNode.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71EED180E27CF00808F54 /* CCPhysicsDebugNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsDebugNode.h; sourceTree = \"<group>\"; };\n\t\t1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsSprite.cpp; sourceTree = \"<group>\"; };\n\t\t1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsSprite.h; sourceTree = \"<group>\"; };\n\t\t1AE3C842184F14F700CF29B5 /* CCValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCValue.cpp; path = ../base/CCValue.cpp; sourceTree = \"<group>\"; };\n\t\t1AE3C843184F14F700CF29B5 /* CCValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCValue.h; path = ../base/CCValue.h; sourceTree = \"<group>\"; };\n\t\t2AC795D318628672005EC8E1 /* BoundingBoxAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BoundingBoxAttachment.cpp; sourceTree = \"<group>\"; };\n\t\t2AC795D418628672005EC8E1 /* BoundingBoxAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BoundingBoxAttachment.h; sourceTree = \"<group>\"; };\n\t\t2AC795D51862867D005EC8E1 /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Event.cpp; sourceTree = \"<group>\"; };\n\t\t2AC795D61862867D005EC8E1 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Event.h; sourceTree = \"<group>\"; };\n\t\t2AC795D71862867D005EC8E1 /* EventData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventData.cpp; sourceTree = \"<group>\"; };\n\t\t2AC795D81862867D005EC8E1 /* EventData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventData.h; sourceTree = \"<group>\"; };\n\t\t2AC795D918628689005EC8E1 /* SkeletonBounds.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonBounds.cpp; sourceTree = \"<group>\"; };\n\t\t2AC795DA18628689005EC8E1 /* SkeletonBounds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonBounds.h; sourceTree = \"<group>\"; };\n\t\t2AFCB81F1863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_spine_auto.cpp; sourceTree = \"<group>\"; };\n\t\t2AFCB8201863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_spine_auto.hpp; sourceTree = \"<group>\"; };\n\t\t373B910718787C0B00198F86 /* CCComBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCComBase.h; sourceTree = \"<group>\"; };\n\t\t3774879E1869BA8C00EDF837 /* CCActionEaseEx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCActionEaseEx.cpp; sourceTree = \"<group>\"; };\n\t\t37936A341869B76800E974DD /* document.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = document.h; sourceTree = \"<group>\"; };\n\t\t37936A351869B76800E974DD /* filestream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = filestream.h; sourceTree = \"<group>\"; };\n\t\t37936A371869B76800E974DD /* pow10.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pow10.h; sourceTree = \"<group>\"; };\n\t\t37936A381869B76800E974DD /* stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stack.h; sourceTree = \"<group>\"; };\n\t\t37936A391869B76800E974DD /* strfunc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strfunc.h; sourceTree = \"<group>\"; };\n\t\t37936A3A1869B76800E974DD /* prettywriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prettywriter.h; sourceTree = \"<group>\"; };\n\t\t37936A3B1869B76800E974DD /* rapidjson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rapidjson.h; sourceTree = \"<group>\"; };\n\t\t37936A3C1869B76800E974DD /* reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reader.h; sourceTree = \"<group>\"; };\n\t\t37936A3D1869B76800E974DD /* stringbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringbuffer.h; sourceTree = \"<group>\"; };\n\t\t37936A3E1869B76800E974DD /* writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = writer.h; sourceTree = \"<group>\"; };\n\t\t37936A401869B7B200E974DD /* CCActionEaseEx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionEaseEx.h; sourceTree = \"<group>\"; };\n\t\t3EEF8BCB1839F390005E8A6C /* jsb_cocos2dx_gui_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_gui_auto.cpp; sourceTree = \"<group>\"; };\n\t\t3EEF8BCC1839F390005E8A6C /* jsb_cocos2dx_gui_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_gui_auto.hpp; sourceTree = \"<group>\"; };\n\t\t3EEF8BD11839F5C5005E8A6C /* jsb_cocos2dx_gui_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jsb_cocos2dx_gui_manual.cpp; path = gui/jsb_cocos2dx_gui_manual.cpp; sourceTree = \"<group>\"; };\n\t\t3EEF8BD21839F5C5005E8A6C /* jsb_cocos2dx_gui_manual.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jsb_cocos2dx_gui_manual.h; path = gui/jsb_cocos2dx_gui_manual.h; sourceTree = \"<group>\"; };\n\t\t46A15FCC1807A544005B8026 /* AUTHORS */ = {isa = PBXFileReference; lastKnownFileType = text; name = AUTHORS; path = ../AUTHORS; sourceTree = \"<group>\"; };\n\t\t46A15FCE1807A544005B8026 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = README.md; path = ../README.md; sourceTree = \"<group>\"; };\n\t\t46A15FE11807A56F005B8026 /* Export.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = \"<group>\"; };\n\t\t46A15FE21807A56F005B8026 /* SimpleAudioEngine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine.h; sourceTree = \"<group>\"; };\n\t\t46A15FE41807A56F005B8026 /* CDAudioManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = \"<group>\"; };\n\t\t46A15FE51807A56F005B8026 /* CDAudioManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = \"<group>\"; };\n\t\t46A15FE61807A56F005B8026 /* CDConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = \"<group>\"; };\n\t\t46A15FE71807A56F005B8026 /* CDOpenALSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = \"<group>\"; };\n\t\t46A15FE81807A56F005B8026 /* CDOpenALSupport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = \"<group>\"; };\n\t\t46A15FE91807A56F005B8026 /* CocosDenshion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = \"<group>\"; };\n\t\t46A15FEA1807A56F005B8026 /* CocosDenshion.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = \"<group>\"; };\n\t\t46A15FEB1807A56F005B8026 /* SimpleAudioEngine.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleAudioEngine.mm; sourceTree = \"<group>\"; };\n\t\t46A15FEC1807A56F005B8026 /* SimpleAudioEngine_objc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine_objc.h; sourceTree = \"<group>\"; };\n\t\t46A15FED1807A56F005B8026 /* SimpleAudioEngine_objc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine_objc.m; sourceTree = \"<group>\"; };\n\t\t46A15FF41807A56F005B8026 /* CDAudioManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = \"<group>\"; };\n\t\t46A15FF51807A56F005B8026 /* CDAudioManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = \"<group>\"; };\n\t\t46A15FF61807A56F005B8026 /* CDConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = \"<group>\"; };\n\t\t46A15FF71807A56F005B8026 /* CDOpenALSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = \"<group>\"; };\n\t\t46A15FF81807A56F005B8026 /* CDOpenALSupport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = \"<group>\"; };\n\t\t46A15FF91807A56F005B8026 /* CDXMacOSXSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDXMacOSXSupport.h; sourceTree = \"<group>\"; };\n\t\t46A15FFA1807A56F005B8026 /* CDXMacOSXSupport.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CDXMacOSXSupport.mm; sourceTree = \"<group>\"; };\n\t\t46A15FFB1807A56F005B8026 /* CocosDenshion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = \"<group>\"; };\n\t\t46A15FFC1807A56F005B8026 /* CocosDenshion.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = \"<group>\"; };\n\t\t46A15FFD1807A56F005B8026 /* SimpleAudioEngine.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleAudioEngine.mm; sourceTree = \"<group>\"; };\n\t\t46A15FFE1807A56F005B8026 /* SimpleAudioEngine_objc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine_objc.h; sourceTree = \"<group>\"; };\n\t\t46A15FFF1807A56F005B8026 /* SimpleAudioEngine_objc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine_objc.m; sourceTree = \"<group>\"; };\n\t\t46A167D21807AF4D005B8026 /* cocos-ext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"cocos-ext.h\"; sourceTree = \"<group>\"; };\n\t\t46A168321807AF4E005B8026 /* ExtensionMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExtensionMacros.h; sourceTree = \"<group>\"; };\n\t\t46A168351807AF4E005B8026 /* CCControl.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControl.cpp; sourceTree = \"<group>\"; };\n\t\t46A168361807AF4E005B8026 /* CCControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControl.h; sourceTree = \"<group>\"; };\n\t\t46A168371807AF4E005B8026 /* CCControlButton.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButton.cpp; sourceTree = \"<group>\"; };\n\t\t46A168381807AF4E005B8026 /* CCControlButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlButton.h; sourceTree = \"<group>\"; };\n\t\t46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlColourPicker.cpp; sourceTree = \"<group>\"; };\n\t\t46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlColourPicker.h; sourceTree = \"<group>\"; };\n\t\t46A1683B1807AF4E005B8026 /* CCControlExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlExtensions.h; sourceTree = \"<group>\"; };\n\t\t46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlHuePicker.cpp; sourceTree = \"<group>\"; };\n\t\t46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlHuePicker.h; sourceTree = \"<group>\"; };\n\t\t46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlPotentiometer.cpp; sourceTree = \"<group>\"; };\n\t\t46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlPotentiometer.h; sourceTree = \"<group>\"; };\n\t\t46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSaturationBrightnessPicker.cpp; sourceTree = \"<group>\"; };\n\t\t46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlSaturationBrightnessPicker.h; sourceTree = \"<group>\"; };\n\t\t46A168421807AF4E005B8026 /* CCControlSlider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSlider.cpp; sourceTree = \"<group>\"; };\n\t\t46A168431807AF4E005B8026 /* CCControlSlider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlSlider.h; sourceTree = \"<group>\"; };\n\t\t46A168441807AF4E005B8026 /* CCControlStepper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlStepper.cpp; sourceTree = \"<group>\"; };\n\t\t46A168451807AF4E005B8026 /* CCControlStepper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlStepper.h; sourceTree = \"<group>\"; };\n\t\t46A168461807AF4E005B8026 /* CCControlSwitch.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSwitch.cpp; sourceTree = \"<group>\"; };\n\t\t46A168471807AF4E005B8026 /* CCControlSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlSwitch.h; sourceTree = \"<group>\"; };\n\t\t46A168481807AF4E005B8026 /* CCControlUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlUtils.cpp; sourceTree = \"<group>\"; };\n\t\t46A168491807AF4E005B8026 /* CCControlUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlUtils.h; sourceTree = \"<group>\"; };\n\t\t46A1684A1807AF4E005B8026 /* CCInvocation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCInvocation.cpp; sourceTree = \"<group>\"; };\n\t\t46A1684B1807AF4E005B8026 /* CCInvocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = \"<group>\"; };\n\t\t46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9Sprite.cpp; sourceTree = \"<group>\"; };\n\t\t46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScale9Sprite.h; sourceTree = \"<group>\"; };\n\t\t46A1684F1807AF4E005B8026 /* CCEditBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBox.cpp; sourceTree = \"<group>\"; };\n\t\t46A168501807AF4E005B8026 /* CCEditBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBox.h; sourceTree = \"<group>\"; };\n\t\t46A168511807AF4E005B8026 /* CCEditBoxImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImpl.h; sourceTree = \"<group>\"; };\n\t\t46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplAndroid.cpp; sourceTree = \"<group>\"; };\n\t\t46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplAndroid.h; sourceTree = \"<group>\"; };\n\t\t46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = \"<group>\"; };\n\t\t46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = \"<group>\"; };\n\t\t46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplMac.h; sourceTree = \"<group>\"; };\n\t\t46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplMac.mm; sourceTree = \"<group>\"; };\n\t\t46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplNone.cpp; sourceTree = \"<group>\"; };\n\t\t46A168591807AF4E005B8026 /* CCEditBoxImplTizen.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplTizen.cpp; sourceTree = \"<group>\"; };\n\t\t46A1685A1807AF4E005B8026 /* CCEditBoxImplTizen.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplTizen.h; sourceTree = \"<group>\"; };\n\t\t46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplWin.cpp; sourceTree = \"<group>\"; };\n\t\t46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplWin.h; sourceTree = \"<group>\"; };\n\t\t46A1685E1807AF4E005B8026 /* CCScrollView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCScrollView.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t46A1685F1807AF4E005B8026 /* CCScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = \"<group>\"; };\n\t\t46A168621807AF4E005B8026 /* CCTableView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = \"<group>\"; };\n\t\t46A168631807AF4E005B8026 /* CCTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTableView.h; sourceTree = \"<group>\"; };\n\t\t46A168641807AF4E005B8026 /* CCTableViewCell.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableViewCell.cpp; sourceTree = \"<group>\"; };\n\t\t46A168651807AF4E005B8026 /* CCTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCTableViewCell.h; sourceTree = \"<group>\"; };\n\t\t46A168B31807AF9C005B8026 /* Android.mk */ = {isa = PBXFileReference; lastKnownFileType = text; path = Android.mk; sourceTree = \"<group>\"; };\n\t\t46A168B41807AF9C005B8026 /* Box2D.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Box2D.h; sourceTree = \"<group>\"; };\n\t\t46A168B61807AF9C005B8026 /* b2BroadPhase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2BroadPhase.cpp; sourceTree = \"<group>\"; };\n\t\t46A168B71807AF9C005B8026 /* b2BroadPhase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2BroadPhase.h; sourceTree = \"<group>\"; };\n\t\t46A168B81807AF9C005B8026 /* b2CollideCircle.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideCircle.cpp; sourceTree = \"<group>\"; };\n\t\t46A168B91807AF9C005B8026 /* b2CollideEdge.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideEdge.cpp; sourceTree = \"<group>\"; };\n\t\t46A168BA1807AF9C005B8026 /* b2CollidePolygon.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollidePolygon.cpp; sourceTree = \"<group>\"; };\n\t\t46A168BB1807AF9C005B8026 /* b2Collision.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Collision.cpp; sourceTree = \"<group>\"; };\n\t\t46A168BC1807AF9C005B8026 /* b2Collision.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Collision.h; sourceTree = \"<group>\"; };\n\t\t46A168BD1807AF9C005B8026 /* b2Distance.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Distance.cpp; sourceTree = \"<group>\"; };\n\t\t46A168BE1807AF9C005B8026 /* b2Distance.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Distance.h; sourceTree = \"<group>\"; };\n\t\t46A168BF1807AF9C005B8026 /* b2DynamicTree.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2DynamicTree.cpp; sourceTree = \"<group>\"; };\n\t\t46A168C01807AF9C005B8026 /* b2DynamicTree.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2DynamicTree.h; sourceTree = \"<group>\"; };\n\t\t46A168C11807AF9C005B8026 /* b2TimeOfImpact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2TimeOfImpact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168C21807AF9C005B8026 /* b2TimeOfImpact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2TimeOfImpact.h; sourceTree = \"<group>\"; };\n\t\t46A168C41807AF9C005B8026 /* b2ChainShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainShape.cpp; sourceTree = \"<group>\"; };\n\t\t46A168C51807AF9C005B8026 /* b2ChainShape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2ChainShape.h; sourceTree = \"<group>\"; };\n\t\t46A168C61807AF9C005B8026 /* b2CircleShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleShape.cpp; sourceTree = \"<group>\"; };\n\t\t46A168C71807AF9C005B8026 /* b2CircleShape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2CircleShape.h; sourceTree = \"<group>\"; };\n\t\t46A168C81807AF9C005B8026 /* b2EdgeShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeShape.cpp; sourceTree = \"<group>\"; };\n\t\t46A168C91807AF9C005B8026 /* b2EdgeShape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2EdgeShape.h; sourceTree = \"<group>\"; };\n\t\t46A168CA1807AF9C005B8026 /* b2PolygonShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonShape.cpp; sourceTree = \"<group>\"; };\n\t\t46A168CB1807AF9C005B8026 /* b2PolygonShape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2PolygonShape.h; sourceTree = \"<group>\"; };\n\t\t46A168CC1807AF9C005B8026 /* b2Shape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Shape.h; sourceTree = \"<group>\"; };\n\t\t46A168CE1807AF9C005B8026 /* b2BlockAllocator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2BlockAllocator.cpp; sourceTree = \"<group>\"; };\n\t\t46A168CF1807AF9C005B8026 /* b2BlockAllocator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2BlockAllocator.h; sourceTree = \"<group>\"; };\n\t\t46A168D01807AF9C005B8026 /* b2Draw.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Draw.cpp; sourceTree = \"<group>\"; };\n\t\t46A168D11807AF9C005B8026 /* b2Draw.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Draw.h; sourceTree = \"<group>\"; };\n\t\t46A168D21807AF9C005B8026 /* b2GrowableStack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2GrowableStack.h; sourceTree = \"<group>\"; };\n\t\t46A168D31807AF9C005B8026 /* b2Math.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Math.cpp; sourceTree = \"<group>\"; };\n\t\t46A168D41807AF9C005B8026 /* b2Math.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Math.h; sourceTree = \"<group>\"; };\n\t\t46A168D51807AF9C005B8026 /* b2Settings.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Settings.cpp; sourceTree = \"<group>\"; };\n\t\t46A168D61807AF9C005B8026 /* b2Settings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Settings.h; sourceTree = \"<group>\"; };\n\t\t46A168D71807AF9C005B8026 /* b2StackAllocator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2StackAllocator.cpp; sourceTree = \"<group>\"; };\n\t\t46A168D81807AF9C005B8026 /* b2StackAllocator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2StackAllocator.h; sourceTree = \"<group>\"; };\n\t\t46A168D91807AF9C005B8026 /* b2Timer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Timer.cpp; sourceTree = \"<group>\"; };\n\t\t46A168DA1807AF9C005B8026 /* b2Timer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Timer.h; sourceTree = \"<group>\"; };\n\t\t46A168DC1807AF9C005B8026 /* b2Body.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Body.cpp; sourceTree = \"<group>\"; };\n\t\t46A168DD1807AF9C005B8026 /* b2Body.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Body.h; sourceTree = \"<group>\"; };\n\t\t46A168DE1807AF9C005B8026 /* b2ContactManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactManager.cpp; sourceTree = \"<group>\"; };\n\t\t46A168DF1807AF9C005B8026 /* b2ContactManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2ContactManager.h; sourceTree = \"<group>\"; };\n\t\t46A168E01807AF9C005B8026 /* b2Fixture.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Fixture.cpp; sourceTree = \"<group>\"; };\n\t\t46A168E11807AF9C005B8026 /* b2Fixture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Fixture.h; sourceTree = \"<group>\"; };\n\t\t46A168E21807AF9C005B8026 /* b2Island.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Island.cpp; sourceTree = \"<group>\"; };\n\t\t46A168E31807AF9C005B8026 /* b2Island.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Island.h; sourceTree = \"<group>\"; };\n\t\t46A168E41807AF9C005B8026 /* b2TimeStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2TimeStep.h; sourceTree = \"<group>\"; };\n\t\t46A168E51807AF9C005B8026 /* b2World.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2World.cpp; sourceTree = \"<group>\"; };\n\t\t46A168E61807AF9C005B8026 /* b2World.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2World.h; sourceTree = \"<group>\"; };\n\t\t46A168E71807AF9C005B8026 /* b2WorldCallbacks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2WorldCallbacks.cpp; sourceTree = \"<group>\"; };\n\t\t46A168E81807AF9C005B8026 /* b2WorldCallbacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2WorldCallbacks.h; sourceTree = \"<group>\"; };\n\t\t46A168EA1807AF9C005B8026 /* b2ChainAndCircleContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndCircleContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168EB1807AF9C005B8026 /* b2ChainAndCircleContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2ChainAndCircleContact.h; sourceTree = \"<group>\"; };\n\t\t46A168EC1807AF9C005B8026 /* b2ChainAndPolygonContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndPolygonContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168ED1807AF9C005B8026 /* b2ChainAndPolygonContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2ChainAndPolygonContact.h; sourceTree = \"<group>\"; };\n\t\t46A168EE1807AF9C005B8026 /* b2CircleContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168EF1807AF9C005B8026 /* b2CircleContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2CircleContact.h; sourceTree = \"<group>\"; };\n\t\t46A168F01807AF9C005B8026 /* b2Contact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Contact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168F11807AF9C005B8026 /* b2Contact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Contact.h; sourceTree = \"<group>\"; };\n\t\t46A168F21807AF9C005B8026 /* b2ContactSolver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactSolver.cpp; sourceTree = \"<group>\"; };\n\t\t46A168F31807AF9C005B8026 /* b2ContactSolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2ContactSolver.h; sourceTree = \"<group>\"; };\n\t\t46A168F41807AF9C005B8026 /* b2EdgeAndCircleContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndCircleContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168F51807AF9C005B8026 /* b2EdgeAndCircleContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndCircleContact.h; sourceTree = \"<group>\"; };\n\t\t46A168F61807AF9C005B8026 /* b2EdgeAndPolygonContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndPolygonContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168F71807AF9C005B8026 /* b2EdgeAndPolygonContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndPolygonContact.h; sourceTree = \"<group>\"; };\n\t\t46A168F81807AF9C005B8026 /* b2PolygonAndCircleContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonAndCircleContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168F91807AF9C005B8026 /* b2PolygonAndCircleContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2PolygonAndCircleContact.h; sourceTree = \"<group>\"; };\n\t\t46A168FA1807AF9C005B8026 /* b2PolygonContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A168FB1807AF9C005B8026 /* b2PolygonContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2PolygonContact.h; sourceTree = \"<group>\"; };\n\t\t46A168FD1807AF9C005B8026 /* b2DistanceJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2DistanceJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A168FE1807AF9C005B8026 /* b2DistanceJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2DistanceJoint.h; sourceTree = \"<group>\"; };\n\t\t46A168FF1807AF9C005B8026 /* b2FrictionJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2FrictionJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A169001807AF9C005B8026 /* b2FrictionJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2FrictionJoint.h; sourceTree = \"<group>\"; };\n\t\t46A169011807AF9C005B8026 /* b2GearJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2GearJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A169021807AF9C005B8026 /* b2GearJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2GearJoint.h; sourceTree = \"<group>\"; };\n\t\t46A169031807AF9C005B8026 /* b2Joint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Joint.cpp; sourceTree = \"<group>\"; };\n\t\t46A169041807AF9C005B8026 /* b2Joint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Joint.h; sourceTree = \"<group>\"; };\n\t\t46A169051807AF9C005B8026 /* b2MouseJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2MouseJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A169061807AF9C005B8026 /* b2MouseJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2MouseJoint.h; sourceTree = \"<group>\"; };\n\t\t46A169071807AF9C005B8026 /* b2PrismaticJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2PrismaticJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A169081807AF9C005B8026 /* b2PrismaticJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2PrismaticJoint.h; sourceTree = \"<group>\"; };\n\t\t46A169091807AF9C005B8026 /* b2PulleyJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2PulleyJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A1690A1807AF9C005B8026 /* b2PulleyJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2PulleyJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1690B1807AF9C005B8026 /* b2RevoluteJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2RevoluteJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A1690C1807AF9C005B8026 /* b2RevoluteJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2RevoluteJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1690D1807AF9C005B8026 /* b2RopeJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2RopeJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A1690E1807AF9C005B8026 /* b2RopeJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2RopeJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1690F1807AF9C005B8026 /* b2WeldJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2WeldJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A169101807AF9C005B8026 /* b2WeldJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2WeldJoint.h; sourceTree = \"<group>\"; };\n\t\t46A169111807AF9C005B8026 /* b2WheelJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2WheelJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A169121807AF9C005B8026 /* b2WheelJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2WheelJoint.h; sourceTree = \"<group>\"; };\n\t\t46A169321807AF9C005B8026 /* b2Rope.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2Rope.cpp; sourceTree = \"<group>\"; };\n\t\t46A169331807AF9C005B8026 /* b2Rope.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = b2Rope.h; sourceTree = \"<group>\"; };\n\t\t46A169401807AFD6005B8026 /* chipmunk.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = chipmunk.h; sourceTree = \"<group>\"; };\n\t\t46A169411807AFD6005B8026 /* chipmunk_ffi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = chipmunk_ffi.h; sourceTree = \"<group>\"; };\n\t\t46A169421807AFD6005B8026 /* chipmunk_private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = chipmunk_private.h; sourceTree = \"<group>\"; };\n\t\t46A169431807AFD6005B8026 /* chipmunk_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = chipmunk_types.h; sourceTree = \"<group>\"; };\n\t\t46A169441807AFD6005B8026 /* chipmunk_unsafe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = chipmunk_unsafe.h; sourceTree = \"<group>\"; };\n\t\t46A169461807AFD6005B8026 /* cpConstraint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpConstraint.h; sourceTree = \"<group>\"; };\n\t\t46A169471807AFD6005B8026 /* cpDampedRotarySpring.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpDampedRotarySpring.h; sourceTree = \"<group>\"; };\n\t\t46A169481807AFD6005B8026 /* cpDampedSpring.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpDampedSpring.h; sourceTree = \"<group>\"; };\n\t\t46A169491807AFD6005B8026 /* cpGearJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpGearJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1694A1807AFD6005B8026 /* cpGrooveJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpGrooveJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1694B1807AFD6005B8026 /* cpPinJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpPinJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1694C1807AFD6005B8026 /* cpPivotJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpPivotJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1694D1807AFD6005B8026 /* cpRatchetJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpRatchetJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1694E1807AFD6005B8026 /* cpRotaryLimitJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpRotaryLimitJoint.h; sourceTree = \"<group>\"; };\n\t\t46A1694F1807AFD6005B8026 /* cpSimpleMotor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpSimpleMotor.h; sourceTree = \"<group>\"; };\n\t\t46A169501807AFD6005B8026 /* cpSlideJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpSlideJoint.h; sourceTree = \"<group>\"; };\n\t\t46A169511807AFD6005B8026 /* util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = \"<group>\"; };\n\t\t46A169521807AFD6005B8026 /* cpArbiter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpArbiter.h; sourceTree = \"<group>\"; };\n\t\t46A169531807AFD6005B8026 /* cpBB.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpBB.h; sourceTree = \"<group>\"; };\n\t\t46A169541807AFD6005B8026 /* cpBody.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpBody.h; sourceTree = \"<group>\"; };\n\t\t46A169551807AFD6005B8026 /* cpPolyShape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpPolyShape.h; sourceTree = \"<group>\"; };\n\t\t46A169561807AFD6005B8026 /* cpShape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpShape.h; sourceTree = \"<group>\"; };\n\t\t46A169571807AFD6005B8026 /* cpSpace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpSpace.h; sourceTree = \"<group>\"; };\n\t\t46A169581807AFD6005B8026 /* cpSpatialIndex.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpSpatialIndex.h; sourceTree = \"<group>\"; };\n\t\t46A169591807AFD6005B8026 /* cpVect.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cpVect.h; sourceTree = \"<group>\"; };\n\t\t46A1697B1807AFD6005B8026 /* chipmunk.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = chipmunk.c; sourceTree = \"<group>\"; };\n\t\t46A1697C1807AFD6005B8026 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = \"<group>\"; };\n\t\t46A1697E1807AFD6005B8026 /* cpConstraint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpConstraint.c; sourceTree = \"<group>\"; };\n\t\t46A1697F1807AFD6005B8026 /* cpDampedRotarySpring.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpDampedRotarySpring.c; sourceTree = \"<group>\"; };\n\t\t46A169801807AFD6005B8026 /* cpDampedSpring.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpDampedSpring.c; sourceTree = \"<group>\"; };\n\t\t46A169811807AFD6005B8026 /* cpGearJoint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpGearJoint.c; sourceTree = \"<group>\"; };\n\t\t46A169821807AFD6005B8026 /* cpGrooveJoint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpGrooveJoint.c; sourceTree = \"<group>\"; };\n\t\t46A169831807AFD6005B8026 /* cpPinJoint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpPinJoint.c; sourceTree = \"<group>\"; };\n\t\t46A169841807AFD6005B8026 /* cpPivotJoint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpPivotJoint.c; sourceTree = \"<group>\"; };\n\t\t46A169851807AFD6005B8026 /* cpRatchetJoint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpRatchetJoint.c; sourceTree = \"<group>\"; };\n\t\t46A169861807AFD6005B8026 /* cpRotaryLimitJoint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpRotaryLimitJoint.c; sourceTree = \"<group>\"; };\n\t\t46A169871807AFD6005B8026 /* cpSimpleMotor.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSimpleMotor.c; sourceTree = \"<group>\"; };\n\t\t46A169881807AFD6005B8026 /* cpSlideJoint.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSlideJoint.c; sourceTree = \"<group>\"; };\n\t\t46A169891807AFD6005B8026 /* cpArbiter.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpArbiter.c; sourceTree = \"<group>\"; };\n\t\t46A1698A1807AFD6005B8026 /* cpArray.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpArray.c; sourceTree = \"<group>\"; };\n\t\t46A1698B1807AFD6005B8026 /* cpBB.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpBB.c; sourceTree = \"<group>\"; };\n\t\t46A1698C1807AFD6005B8026 /* cpBBTree.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpBBTree.c; sourceTree = \"<group>\"; };\n\t\t46A1698D1807AFD6005B8026 /* cpBody.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpBody.c; sourceTree = \"<group>\"; };\n\t\t46A1698E1807AFD6005B8026 /* cpCollision.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpCollision.c; sourceTree = \"<group>\"; };\n\t\t46A1698F1807AFD6005B8026 /* cpHashSet.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpHashSet.c; sourceTree = \"<group>\"; };\n\t\t46A169901807AFD6005B8026 /* cpPolyShape.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpPolyShape.c; sourceTree = \"<group>\"; };\n\t\t46A169911807AFD6005B8026 /* cpShape.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpShape.c; sourceTree = \"<group>\"; };\n\t\t46A169921807AFD6005B8026 /* cpSpace.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSpace.c; sourceTree = \"<group>\"; };\n\t\t46A169931807AFD6005B8026 /* cpSpaceComponent.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSpaceComponent.c; sourceTree = \"<group>\"; };\n\t\t46A169941807AFD6005B8026 /* cpSpaceHash.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSpaceHash.c; sourceTree = \"<group>\"; };\n\t\t46A169951807AFD6005B8026 /* cpSpaceQuery.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSpaceQuery.c; sourceTree = \"<group>\"; };\n\t\t46A169961807AFD6005B8026 /* cpSpaceStep.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSpaceStep.c; sourceTree = \"<group>\"; };\n\t\t46A169971807AFD6005B8026 /* cpSpatialIndex.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSpatialIndex.c; sourceTree = \"<group>\"; };\n\t\t46A169981807AFD6005B8026 /* cpSweep1D.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpSweep1D.c; sourceTree = \"<group>\"; };\n\t\t46A169991807AFD6005B8026 /* cpVect.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cpVect.c; sourceTree = \"<group>\"; };\n\t\t46A1699A1807AFD6005B8026 /* prime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = prime.h; sourceTree = \"<group>\"; };\n\t\t46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCFileUtilsApple.h; sourceTree = \"<group>\"; };\n\t\t46A16A901807B038005B8026 /* CCFileUtilsApple.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCFileUtilsApple.mm; sourceTree = \"<group>\"; };\n\t\t46A16A911807B038005B8026 /* CCLock.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCLock.cpp; sourceTree = \"<group>\"; };\n\t\t46A16A921807B038005B8026 /* CCLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCLock.h; sourceTree = \"<group>\"; };\n\t\t46A16A931807B038005B8026 /* CCThread.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCThread.mm; sourceTree = \"<group>\"; };\n\t\t46A16A941807B038005B8026 /* CCApplicationProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplicationProtocol.h; sourceTree = \"<group>\"; };\n\t\t46A16A951807B038005B8026 /* CCCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCCommon.h; sourceTree = \"<group>\"; };\n\t\t46A16A961807B038005B8026 /* CCDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDevice.h; sourceTree = \"<group>\"; };\n\t\t46A16A971807B038005B8026 /* CCEGLViewProtocol.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEGLViewProtocol.cpp; sourceTree = \"<group>\"; };\n\t\t46A16A981807B038005B8026 /* CCEGLViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEGLViewProtocol.h; sourceTree = \"<group>\"; };\n\t\t46A16A991807B038005B8026 /* CCFileUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCFileUtils.cpp; sourceTree = \"<group>\"; };\n\t\t46A16A9A1807B038005B8026 /* CCFileUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCFileUtils.h; sourceTree = \"<group>\"; };\n\t\t46A16A9B1807B038005B8026 /* CCImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCImage.h; sourceTree = \"<group>\"; };\n\t\t46A16A9F1807B038005B8026 /* CCSAXParser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCSAXParser.cpp; sourceTree = \"<group>\"; };\n\t\t46A16AA01807B038005B8026 /* CCSAXParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCSAXParser.h; sourceTree = \"<group>\"; };\n\t\t46A16AA11807B038005B8026 /* CCThread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCThread.cpp; sourceTree = \"<group>\"; };\n\t\t46A16AA21807B038005B8026 /* CCThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCThread.h; sourceTree = \"<group>\"; };\n\t\t46A16AA41807B038005B8026 /* CCApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = \"<group>\"; };\n\t\t46A16AA51807B038005B8026 /* CCApplication.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCApplication.mm; sourceTree = \"<group>\"; };\n\t\t46A16AA61807B038005B8026 /* CCCommon.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCCommon.mm; sourceTree = \"<group>\"; };\n\t\t46A16AA71807B038005B8026 /* CCDevice.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDevice.mm; sourceTree = \"<group>\"; };\n\t\t46A16AA81807B038005B8026 /* CCDirectorCaller.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDirectorCaller.h; sourceTree = \"<group>\"; };\n\t\t46A16AA91807B038005B8026 /* CCDirectorCaller.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDirectorCaller.mm; sourceTree = \"<group>\"; };\n\t\t46A16AAA1807B038005B8026 /* CCEGLView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEGLView.h; sourceTree = \"<group>\"; };\n\t\t46A16AAB1807B038005B8026 /* CCEGLView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEGLView.mm; sourceTree = \"<group>\"; };\n\t\t46A16AAC1807B038005B8026 /* CCES2Renderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCES2Renderer.h; sourceTree = \"<group>\"; };\n\t\t46A16AAD1807B038005B8026 /* CCES2Renderer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CCES2Renderer.m; sourceTree = \"<group>\"; };\n\t\t46A16AAE1807B038005B8026 /* CCESRenderer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCESRenderer.h; sourceTree = \"<group>\"; };\n\t\t46A16AB01807B038005B8026 /* CCImage.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCImage.mm; sourceTree = \"<group>\"; };\n\t\t46A16AB11807B038005B8026 /* CCPlatformDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = \"<group>\"; };\n\t\t46A16AB21807B038005B8026 /* CCStdC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = \"<group>\"; };\n\t\t46A16AB41807B038005B8026 /* EAGLView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = EAGLView.mm; sourceTree = \"<group>\"; };\n\t\t46A16AB51807B038005B8026 /* OpenGL_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OpenGL_Internal.h; sourceTree = \"<group>\"; };\n\t\t46A16AB71807B038005B8026 /* AccelerometerSimulation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccelerometerSimulation.h; sourceTree = \"<group>\"; };\n\t\t46A16AB81807B038005B8026 /* AccelerometerSimulation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AccelerometerSimulation.m; sourceTree = \"<group>\"; };\n\t\t46A16AC81807B038005B8026 /* CCApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCApplication.h; sourceTree = \"<group>\"; };\n\t\t46A16AC91807B038005B8026 /* CCApplication.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCApplication.mm; sourceTree = \"<group>\"; };\n\t\t46A16ACA1807B038005B8026 /* CCCommon.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCCommon.mm; sourceTree = \"<group>\"; };\n\t\t46A16ACB1807B038005B8026 /* CCDevice.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCDevice.cpp; sourceTree = \"<group>\"; };\n\t\t46A16ACC1807B038005B8026 /* CCDirectorCaller.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCDirectorCaller.h; sourceTree = \"<group>\"; };\n\t\t46A16ACD1807B038005B8026 /* CCDirectorCaller.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCDirectorCaller.mm; sourceTree = \"<group>\"; };\n\t\t46A16AD31807B038005B8026 /* CCImage.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCImage.mm; sourceTree = \"<group>\"; };\n\t\t46A16AD41807B038005B8026 /* CCPlatformDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPlatformDefine.h; sourceTree = \"<group>\"; };\n\t\t46A16AD51807B038005B8026 /* CCStdC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCStdC.h; sourceTree = \"<group>\"; };\n\t\t46A16E1B1807C948005B8026 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../cocos/2d/platform/third_party/ios/libraries/libcurl.a; sourceTree = \"<group>\"; };\n\t\t46A16E1C1807C948005B8026 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../cocos/2d/platform/third_party/ios/libraries/libfreetype.a; sourceTree = \"<group>\"; };\n\t\t46A16E1D1807C948005B8026 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjpeg.a; path = ../cocos/2d/platform/third_party/ios/libraries/libjpeg.a; sourceTree = \"<group>\"; };\n\t\t46A16E1E1807C948005B8026 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = ../cocos/2d/platform/third_party/ios/libraries/libpng.a; sourceTree = \"<group>\"; };\n\t\t46A16E1F1807C948005B8026 /* libtiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtiff.a; path = ../cocos/2d/platform/third_party/ios/libraries/libtiff.a; sourceTree = \"<group>\"; };\n\t\t46A16E201807C948005B8026 /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebp.a; path = ../cocos/2d/platform/third_party/ios/libraries/libwebp.a; sourceTree = \"<group>\"; };\n\t\t46A16E211807C95C005B8026 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../cocos/2d/platform/third_party/mac/libraries/libfreetype.a; sourceTree = \"<group>\"; };\n\t\t46A16E221807C95C005B8026 /* libglfw3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libglfw3.a; path = ../cocos/2d/platform/third_party/mac/libraries/libglfw3.a; sourceTree = \"<group>\"; };\n\t\t46A16E231807C95C005B8026 /* libjpeg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libjpeg.a; path = ../cocos/2d/platform/third_party/mac/libraries/libjpeg.a; sourceTree = \"<group>\"; };\n\t\t46A16E241807C95C005B8026 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = ../cocos/2d/platform/third_party/mac/libraries/libpng.a; sourceTree = \"<group>\"; };\n\t\t46A16E251807C95C005B8026 /* libtiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtiff.a; path = ../cocos/2d/platform/third_party/mac/libraries/libtiff.a; sourceTree = \"<group>\"; };\n\t\t46A16E261807C95C005B8026 /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebp.a; path = ../cocos/2d/platform/third_party/mac/libraries/libwebp.a; sourceTree = \"<group>\"; };\n\t\t46A16E271807C992005B8026 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebsockets.a; path = ../external/libwebsockets/ios/lib/libwebsockets.a; sourceTree = \"<group>\"; };\n\t\t46A16E281807C99F005B8026 /* libwebsockets.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebsockets.a; path = ../external/libwebsockets/mac/lib/libwebsockets.a; sourceTree = \"<group>\"; };\n\t\t46A1706E1807CE7A005B8026 /* CCPhysicsBody.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsBody.cpp; sourceTree = \"<group>\"; };\n\t\t46A1706F1807CE7A005B8026 /* CCPhysicsBody.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsBody.h; sourceTree = \"<group>\"; };\n\t\t46A170701807CE7A005B8026 /* CCPhysicsContact.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsContact.cpp; sourceTree = \"<group>\"; };\n\t\t46A170711807CE7A005B8026 /* CCPhysicsContact.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsContact.h; sourceTree = \"<group>\"; };\n\t\t46A170721807CE7A005B8026 /* CCPhysicsJoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsJoint.cpp; sourceTree = \"<group>\"; };\n\t\t46A170731807CE7A005B8026 /* CCPhysicsJoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsJoint.h; sourceTree = \"<group>\"; };\n\t\t46A170751807CE7A005B8026 /* CCPhysicsShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsShape.cpp; sourceTree = \"<group>\"; };\n\t\t46A170761807CE7A005B8026 /* CCPhysicsShape.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsShape.h; sourceTree = \"<group>\"; };\n\t\t46A170771807CE7A005B8026 /* CCPhysicsWorld.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsWorld.cpp; sourceTree = \"<group>\"; };\n\t\t46A170781807CE7A005B8026 /* CCPhysicsWorld.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCPhysicsWorld.h; sourceTree = \"<group>\"; };\n\t\t46A170891807CE87005B8026 /* aabb.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = aabb.h; sourceTree = \"<group>\"; };\n\t\t46A1708B1807CE87005B8026 /* mat4stack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mat4stack.h; sourceTree = \"<group>\"; };\n\t\t46A1708C1807CE87005B8026 /* matrix.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = matrix.h; sourceTree = \"<group>\"; };\n\t\t46A1708D1807CE87005B8026 /* kazmath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = kazmath.h; sourceTree = \"<group>\"; };\n\t\t46A1708E1807CE87005B8026 /* mat3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mat3.h; sourceTree = \"<group>\"; };\n\t\t46A1708F1807CE87005B8026 /* mat4.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mat4.h; sourceTree = \"<group>\"; };\n\t\t46A170901807CE87005B8026 /* neon_matrix_impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = neon_matrix_impl.h; sourceTree = \"<group>\"; };\n\t\t46A170911807CE87005B8026 /* plane.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = plane.h; sourceTree = \"<group>\"; };\n\t\t46A170921807CE87005B8026 /* quaternion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = quaternion.h; sourceTree = \"<group>\"; };\n\t\t46A170931807CE87005B8026 /* ray2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ray2.h; sourceTree = \"<group>\"; };\n\t\t46A170941807CE87005B8026 /* utility.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utility.h; sourceTree = \"<group>\"; };\n\t\t46A170951807CE87005B8026 /* vec2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = vec2.h; sourceTree = \"<group>\"; };\n\t\t46A170961807CE87005B8026 /* vec3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = vec3.h; sourceTree = \"<group>\"; };\n\t\t46A170971807CE87005B8026 /* vec4.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = vec4.h; sourceTree = \"<group>\"; };\n\t\t46A170991807CE87005B8026 /* aabb.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = aabb.c; sourceTree = \"<group>\"; };\n\t\t46A1709A1807CE87005B8026 /* ChangeLog */ = {isa = PBXFileReference; lastKnownFileType = text; path = ChangeLog; sourceTree = \"<group>\"; };\n\t\t46A1709B1807CE87005B8026 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = \"<group>\"; };\n\t\t46A1709D1807CE87005B8026 /* mat4stack.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mat4stack.c; sourceTree = \"<group>\"; };\n\t\t46A1709E1807CE87005B8026 /* matrix.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = matrix.c; sourceTree = \"<group>\"; };\n\t\t46A1709F1807CE87005B8026 /* mat3.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mat3.c; sourceTree = \"<group>\"; };\n\t\t46A170A01807CE87005B8026 /* mat4.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = mat4.c; sourceTree = \"<group>\"; };\n\t\t46A170A11807CE87005B8026 /* neon_matrix_impl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = neon_matrix_impl.c; sourceTree = \"<group>\"; };\n\t\t46A170A21807CE87005B8026 /* plane.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = plane.c; sourceTree = \"<group>\"; };\n\t\t46A170A31807CE87005B8026 /* quaternion.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = quaternion.c; sourceTree = \"<group>\"; };\n\t\t46A170A41807CE87005B8026 /* ray2.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ray2.c; sourceTree = \"<group>\"; };\n\t\t46A170A51807CE87005B8026 /* utility.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = utility.c; sourceTree = \"<group>\"; };\n\t\t46A170A61807CE87005B8026 /* vec2.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vec2.c; sourceTree = \"<group>\"; };\n\t\t46A170A71807CE87005B8026 /* vec3.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vec3.c; sourceTree = \"<group>\"; };\n\t\t46A170A81807CE87005B8026 /* vec4.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vec4.c; sourceTree = \"<group>\"; };\n\t\t5069133C185016C1009BBDD7 /* CCConsole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCConsole.cpp; path = ../base/CCConsole.cpp; sourceTree = \"<group>\"; };\n\t\t5069133D185016C1009BBDD7 /* CCConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCConsole.h; path = ../base/CCConsole.h; sourceTree = \"<group>\"; };\n\t\t50A1FF1618290ED4001840C4 /* UIListView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIListView.cpp; sourceTree = \"<group>\"; };\n\t\t50A1FF1718290ED4001840C4 /* UIListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIListView.h; sourceTree = \"<group>\"; };\n\t\t50AE5EA1188749250007CFE3 /* CCBatchCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCBatchCommand.cpp; sourceTree = \"<group>\"; };\n\t\t50AE5EA2188749250007CFE3 /* CCBatchCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBatchCommand.h; sourceTree = \"<group>\"; };\n\t\t50DC5180187B817900A9C23F /* RELEASE_NOTES.md */ = {isa = PBXFileReference; lastKnownFileType = text; name = RELEASE_NOTES.md; path = ../docs/RELEASE_NOTES.md; sourceTree = \"<group>\"; };\n\t\t593BDCD8184D0A6E00C21E48 /* CCCustomCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCCustomCommand.cpp; sourceTree = \"<group>\"; };\n\t\t593BDCD9184D0A6E00C21E48 /* CCCustomCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCustomCommand.h; sourceTree = \"<group>\"; };\n\t\t593BDCDA184D0A6E00C21E48 /* CCGroupCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCGroupCommand.cpp; sourceTree = \"<group>\"; };\n\t\t593BDCDB184D0A6E00C21E48 /* CCGroupCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGroupCommand.h; sourceTree = \"<group>\"; };\n\t\t59A79D4D1821E26E00F19697 /* CCEventListenerMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventListenerMouse.cpp; sourceTree = \"<group>\"; };\n\t\t59A79D4E1821E26E00F19697 /* CCEventListenerMouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventListenerMouse.h; sourceTree = \"<group>\"; };\n\t\t59A79D4F1821E26E00F19697 /* CCEventMouse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEventMouse.cpp; sourceTree = \"<group>\"; };\n\t\t59A79D501821E26E00F19697 /* CCEventMouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventMouse.h; sourceTree = \"<group>\"; };\n\t\t74AC800F4905C8827A44EED3 /* CCMaterialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMaterialManager.h; sourceTree = \"<group>\"; };\n\t\t74AC80EEB031D67E86B45096 /* CCFrustum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFrustum.cpp; sourceTree = \"<group>\"; };\n\t\t74AC80F6E92FC29EA536D7F8 /* CCRenderCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRenderCommand.cpp; sourceTree = \"<group>\"; };\n\t\t74AC82DE19B10586E1C39974 /* CCRenderMaterial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRenderMaterial.cpp; sourceTree = \"<group>\"; };\n\t\t74AC840F2F17ED6D0163669F /* CCFrustum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFrustum.h; sourceTree = \"<group>\"; };\n\t\t74AC853F6B597094730AFB36 /* CCMaterialManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMaterialManager.cpp; sourceTree = \"<group>\"; };\n\t\t74AC8C4AE1EB0FCB287E7396 /* CCQuadCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCQuadCommand.h; sourceTree = \"<group>\"; };\n\t\t74AC8CC6504014E3A59C55B2 /* CCRenderMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderMaterial.h; sourceTree = \"<group>\"; };\n\t\t74AC8D28EF93BFF332D3C456 /* CCQuadCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCQuadCommand.cpp; sourceTree = \"<group>\"; };\n\t\t74AC8DF0EA49A124E1B11681 /* CCRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderer.h; sourceTree = \"<group>\"; };\n\t\t74AC8EB8FE47EED9B30B7106 /* CCRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCRenderer.cpp; sourceTree = \"<group>\"; };\n\t\t74AC8F4F7D9E52FCB522B647 /* CCRenderCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderCommand.h; sourceTree = \"<group>\"; };\n\t\tA023FA32185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_noMVP_frag.h; sourceTree = \"<group>\"; };\n\t\tA023FA33185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_noMVP_vert.h; sourceTree = \"<group>\"; };\n\t\tA03F2CB81780BD04006731B9 /* libchipmunk Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libchipmunk Mac.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA03F2D9B1780BDF7006731B9 /* libbox2d Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libbox2d Mac.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA03F2ED617814268006731B9 /* libCocosDenshion Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libCocosDenshion Mac.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA03F2FD617814595006731B9 /* libcocos2dx-extensions Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libcocos2dx-extensions Mac.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA03F31FD1781479B006731B9 /* libjsbindings Mac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libjsbindings Mac.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA04583F0189053B500E32FE8 /* CCEGLView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCEGLView.cpp; sourceTree = \"<group>\"; };\n\t\tA04583F1189053B500E32FE8 /* CCEGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEGLView.h; sourceTree = \"<group>\"; };\n\t\tA07A4D641783777C0073F6A7 /* libcocos2dx iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libcocos2dx iOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA07A4EFC1783867C0073F6A7 /* libcocos2dx-extensions iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libcocos2dx-extensions iOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA07A4F3B178387670073F6A7 /* libchipmunk iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libchipmunk iOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA07A4F9E1783876B0073F6A7 /* libbox2d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libbox2d iOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA07A4FB4178387730073F6A7 /* libCocosDenshion iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libCocosDenshion iOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA07A5030178387750073F6A7 /* libjsbindings iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libjsbindings iOS.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA0E6B27F18613EA5009C5D17 /* CCRenderCommandPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderCommandPool.h; sourceTree = \"<group>\"; };\n\t\tB362C3A21872B37200F0BDF4 /* lua_cocos2dx_physics_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_physics_auto.cpp; sourceTree = \"<group>\"; };\n\t\tB362C3A31872B37200F0BDF4 /* lua_cocos2dx_physics_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_physics_auto.hpp; sourceTree = \"<group>\"; };\n\t\tB362C3A41872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_physics_manual.cpp; sourceTree = \"<group>\"; };\n\t\tB362C3A51872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_physics_manual.hpp; sourceTree = \"<group>\"; };\n\t\tB37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsBodyInfo_chipmunk.cpp; sourceTree = \"<group>\"; };\n\t\tB37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsBodyInfo_chipmunk.h; sourceTree = \"<group>\"; };\n\t\tB37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsContactInfo_chipmunk.cpp; sourceTree = \"<group>\"; };\n\t\tB37510481823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsContactInfo_chipmunk.h; sourceTree = \"<group>\"; };\n\t\tB37510491823AC7B00B3BA6A /* CCPhysicsHelper_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsHelper_chipmunk.h; sourceTree = \"<group>\"; };\n\t\tB375104A1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsJointInfo_chipmunk.cpp; sourceTree = \"<group>\"; };\n\t\tB375104B1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsJointInfo_chipmunk.h; sourceTree = \"<group>\"; };\n\t\tB375104C1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsShapeInfo_chipmunk.cpp; sourceTree = \"<group>\"; };\n\t\tB375104D1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsShapeInfo_chipmunk.h; sourceTree = \"<group>\"; };\n\t\tB375104E1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPhysicsWorldInfo_chipmunk.cpp; sourceTree = \"<group>\"; };\n\t\tB375104F1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsWorldInfo_chipmunk.h; sourceTree = \"<group>\"; };\n\t\tB3AF019E1842FBA400A98B85 /* b2MotorJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2MotorJoint.cpp; sourceTree = \"<group>\"; };\n\t\tB3AF019F1842FBA400A98B85 /* b2MotorJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2MotorJoint.h; sourceTree = \"<group>\"; };\n\t\tED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCNodeGrid.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\tED9C6A9318599AD8000A5232 /* CCNodeGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNodeGrid.h; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t1551A33C158F2AB200E66CFE /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tB3B12A5A17E7F44000026B4A /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A94D35116C2072800D79D09 /* Foundation.framework in Frameworks */,\n\t\t\t\t1A570347180BD0850088DEC7 /* libglfw3.a in Frameworks */,\n\t\t\t\t1A570361180BD1080088DEC7 /* libpng.a in Frameworks */,\n\t\t\t\t1A57037B180BD1C90088DEC7 /* libjpeg.a in Frameworks */,\n\t\t\t\t1A5703A1180BD22C0088DEC7 /* libtiff.a in Frameworks */,\n\t\t\t\t1A5703B8180BD2780088DEC7 /* libwebp.a in Frameworks */,\n\t\t\t\t1A57052B180BD31F0088DEC7 /* libfreetype.a in Frameworks */,\n\t\t\t\t1AAF5385180E35A3000584C8 /* libwebsockets.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A11972D178526AA00D62A44 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t15996080181132DE00C7D42C /* libluajit.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB51817854BC200CDF010 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1599607B1811329600C7D42C /* libluajit.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2C011780BD04006731B9 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2D7C1780BDF7006731B9 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2EB717814268006731B9 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2FC917814595006731B9 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F31F01781479B006731B9 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A9DCA4D180E6E3C007A3AD4 /* libjs_static.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4CAD1783777C0073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tB3B12A5B17E7F45C00026B4A /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\tA07A4CAF1783777C0073F6A7 /* Foundation.framework in Frameworks */,\n\t\t\t\t1A570364180BD1120088DEC7 /* libpng.a in Frameworks */,\n\t\t\t\t1A570378180BD1B40088DEC7 /* libjpeg.a in Frameworks */,\n\t\t\t\t1A5703A4180BD2350088DEC7 /* libtiff.a in Frameworks */,\n\t\t\t\t1A5703BB180BD2800088DEC7 /* libwebp.a in Frameworks */,\n\t\t\t\t1A57052E180BD3280088DEC7 /* libfreetype.a in Frameworks */,\n\t\t\t\t1AAF5388180E35AC000584C8 /* libwebsockets.a in Frameworks */,\n\t\t\t\t1AAF541D180E3B6A000584C8 /* libcurl.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4E7B1783867C0073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4F1C178387670073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4F6B1783876B0073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4FA7178387730073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4FCC178387750073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A9DCA4E180E6E42007A3AD4 /* libjs_static.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t1551A334158F2AB200E66CFE = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A15FCC1807A544005B8026 /* AUTHORS */,\n\t\t\t\t1A57FFF7180BC5160088DEC7 /* CHANGELOG */,\n\t\t\t\t46A15FCE1807A544005B8026 /* README.md */,\n\t\t\t\t50DC5180187B817900A9C23F /* RELEASE_NOTES.md */,\n\t\t\t\t46A169A11807B037005B8026 /* 2d */,\n\t\t\t\t46A15FD01807A56F005B8026 /* audio */,\n\t\t\t\t1A5700A2180BC5E60088DEC7 /* base */,\n\t\t\t\t1AD71CF7180E26E600808F54 /* editor-support */,\n\t\t\t\t46A167981807AF4D005B8026 /* extensions */,\n\t\t\t\t1A57033E180BD0490088DEC7 /* external */,\n\t\t\t\t1551A341158F2AB200E66CFE /* Frameworks */,\n\t\t\t\t1A8C58BD180E92CC00EF57C3 /* gui */,\n\t\t\t\t46A170851807CE87005B8026 /* math */,\n\t\t\t\t1AAF5360180E3374000584C8 /* network */,\n\t\t\t\t46A170611807CE7A005B8026 /* physics */,\n\t\t\t\t1551A340158F2AB200E66CFE /* Products */,\n\t\t\t\t1AAF5426180E409E000584C8 /* scripting */,\n\t\t\t\t1AAF5849180E40B8000584C8 /* storage */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1551A340158F2AB200E66CFE /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1551A33F158F2AB200E66CFE /* libcocos2dx Mac.a */,\n\t\t\t\tA03F2CB81780BD04006731B9 /* libchipmunk Mac.a */,\n\t\t\t\tA03F2D9B1780BDF7006731B9 /* libbox2d Mac.a */,\n\t\t\t\tA03F2ED617814268006731B9 /* libCocosDenshion Mac.a */,\n\t\t\t\tA03F2FD617814595006731B9 /* libcocos2dx-extensions Mac.a */,\n\t\t\t\tA03F31FD1781479B006731B9 /* libjsbindings Mac.a */,\n\t\t\t\tA07A4D641783777C0073F6A7 /* libcocos2dx iOS.a */,\n\t\t\t\tA07A4EFC1783867C0073F6A7 /* libcocos2dx-extensions iOS.a */,\n\t\t\t\tA07A4F3B178387670073F6A7 /* libchipmunk iOS.a */,\n\t\t\t\tA07A4F9E1783876B0073F6A7 /* libbox2d iOS.a */,\n\t\t\t\tA07A4FB4178387730073F6A7 /* libCocosDenshion iOS.a */,\n\t\t\t\tA07A5030178387750073F6A7 /* libjsbindings iOS.a */,\n\t\t\t\t1A119791178526AA00D62A44 /* libluabindings iOS.a */,\n\t\t\t\t1A6FB53017854BC300CDF010 /* libluabindings Mac.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1551A341158F2AB200E66CFE /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tB3D8D44B179921D50039C204 /* ios */,\n\t\t\t\tB3D8D4471799219B0039C204 /* mac */,\n\t\t\t\t1551A342158F2AB200E66CFE /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t15A71D3B18921E6900F30AC0 /* socket */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t15A71D3C18921E6900F30AC0 /* auxiliar.c */,\n\t\t\t\t15A71D3D18921E6900F30AC0 /* auxiliar.h */,\n\t\t\t\t15A71D3E18921E6900F30AC0 /* except.c */,\n\t\t\t\t15A71D3F18921E6900F30AC0 /* except.h */,\n\t\t\t\t15A71D4018921E6900F30AC0 /* inet.c */,\n\t\t\t\t15A71D4118921E6900F30AC0 /* inet.h */,\n\t\t\t\t15A71D4218921E6900F30AC0 /* luasocket.c */,\n\t\t\t\t15A71D4318921E6900F30AC0 /* luasocket.h */,\n\t\t\t\t15A71D4418921E6900F30AC0 /* luasocket_buffer.c */,\n\t\t\t\t15A71D4518921E6900F30AC0 /* luasocket_buffer.h */,\n\t\t\t\t15A71D4618921E6900F30AC0 /* luasocket_io.c */,\n\t\t\t\t15A71D4718921E6900F30AC0 /* luasocket_io.h */,\n\t\t\t\t15A71D4818921E6900F30AC0 /* mime.c */,\n\t\t\t\t15A71D4918921E6900F30AC0 /* mime.h */,\n\t\t\t\t15A71D4A18921E6900F30AC0 /* options.c */,\n\t\t\t\t15A71D4B18921E6900F30AC0 /* options.h */,\n\t\t\t\t15A71D4C18921E6900F30AC0 /* select.c */,\n\t\t\t\t15A71D4D18921E6900F30AC0 /* select.h */,\n\t\t\t\t15A71D4E18921E6900F30AC0 /* serial.c */,\n\t\t\t\t15A71D4F18921E6900F30AC0 /* socket.h */,\n\t\t\t\t15A71D5018921E6900F30AC0 /* socket_scripts.c */,\n\t\t\t\t15A71D5118921E6900F30AC0 /* socket_scripts.h */,\n\t\t\t\t15A71D5218921E6900F30AC0 /* tcp.c */,\n\t\t\t\t15A71D5318921E6900F30AC0 /* tcp.h */,\n\t\t\t\t15A71D5418921E6900F30AC0 /* timeout.c */,\n\t\t\t\t15A71D5518921E6900F30AC0 /* timeout.h */,\n\t\t\t\t15A71D5618921E6900F30AC0 /* udp.c */,\n\t\t\t\t15A71D5718921E6900F30AC0 /* udp.h */,\n\t\t\t\t15A71D5818921E6900F30AC0 /* unix.c */,\n\t\t\t\t15A71D5918921E6900F30AC0 /* unix.h */,\n\t\t\t\t15A71D5A18921E6900F30AC0 /* usocket.c */,\n\t\t\t\t15A71D5B18921E6900F30AC0 /* usocket.h */,\n\t\t\t\t15A71D5D18921E6900F30AC0 /* wsocket.h */,\n\t\t\t);\n\t\t\tpath = socket;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A087AE51860400400196EF5 /* edtaa3func */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A087AE61860400400196EF5 /* edtaa3func.cpp */,\n\t\t\t\t1A087AE71860400400196EF5 /* edtaa3func.h */,\n\t\t\t);\n\t\t\tname = edtaa3func;\n\t\t\tpath = ../external/edtaa3func;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C785C181A11EC004E5527 /* auto-generated */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C785D181A11EC004E5527 /* js-bindings */,\n\t\t\t\t1A2C786A181A11EC004E5527 /* lua-bindings */,\n\t\t\t\t1A2C7871181A11EC004E5527 /* README.md */,\n\t\t\t);\n\t\t\tpath = \"auto-generated\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C785D181A11EC004E5527 /* js-bindings */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3EEF8BCB1839F390005E8A6C /* jsb_cocos2dx_gui_auto.cpp */,\n\t\t\t\t3EEF8BCC1839F390005E8A6C /* jsb_cocos2dx_gui_auto.hpp */,\n\t\t\t\t1A2C785E181A11EC004E5527 /* jsb_cocos2dx_auto.cpp */,\n\t\t\t\t1A2C785F181A11EC004E5527 /* jsb_cocos2dx_auto.hpp */,\n\t\t\t\t1A2C7861181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp */,\n\t\t\t\t1A2C7862181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp */,\n\t\t\t\t1A2C7864181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp */,\n\t\t\t\t1A2C7865181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp */,\n\t\t\t\t1A2C7867181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp */,\n\t\t\t\t1A2C7868181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp */,\n\t\t\t\t2AFCB81F1863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.cpp */,\n\t\t\t\t2AFCB8201863D65D00EB4B5C /* jsb_cocos2dx_spine_auto.hpp */,\n\t\t\t);\n\t\t\tpath = \"js-bindings\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C786A181A11EC004E5527 /* lua-bindings */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tB362C3A21872B37200F0BDF4 /* lua_cocos2dx_physics_auto.cpp */,\n\t\t\t\tB362C3A31872B37200F0BDF4 /* lua_cocos2dx_physics_auto.hpp */,\n\t\t\t\t15F4C8801875637D0082884F /* lua_cocos2dx_gui_auto.cpp */,\n\t\t\t\t15F4C8811875637D0082884F /* lua_cocos2dx_gui_auto.hpp */,\n\t\t\t\t15CA8D1118697AE1000032AB /* lua_cocos2dx_spine_auto.cpp */,\n\t\t\t\t15CA8D1218697AE1000032AB /* lua_cocos2dx_spine_auto.hpp */,\n\t\t\t\t1585AB591828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp */,\n\t\t\t\t1585AB5A1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp */,\n\t\t\t\t1A2C786B181A11EC004E5527 /* lua_cocos2dx_auto.cpp */,\n\t\t\t\t1A2C786C181A11EC004E5527 /* lua_cocos2dx_auto.hpp */,\n\t\t\t\t1A2C786E181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp */,\n\t\t\t\t1A2C786F181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp */,\n\t\t\t);\n\t\t\tpath = \"lua-bindings\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C78BA181A1257004E5527 /* bindings */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3EEF8BD01839F5A7005E8A6C /* gui */,\n\t\t\t\t1A2C78BC181A1257004E5527 /* chipmunk */,\n\t\t\t\t1A2C78CB181A1257004E5527 /* cocos2d_specifics.cpp */,\n\t\t\t\t1A2C78CC181A1257004E5527 /* cocos2d_specifics.hpp */,\n\t\t\t\t1A2C78CD181A1257004E5527 /* cocosbuilder */,\n\t\t\t\t1A2C78D7181A1257004E5527 /* cocostudio */,\n\t\t\t\t1A2C78DE181A1257004E5527 /* extension */,\n\t\t\t\t1A2C78E5181A1257004E5527 /* js_bindings_config.h */,\n\t\t\t\t1A2C78E6181A1257004E5527 /* js_bindings_core.cpp */,\n\t\t\t\t1A2C78E7181A1257004E5527 /* js_bindings_core.h */,\n\t\t\t\t1A2C78E8181A1257004E5527 /* js_bindings_opengl.cpp */,\n\t\t\t\t1A2C78E9181A1257004E5527 /* js_bindings_opengl.h */,\n\t\t\t\t1A2C78EA181A1257004E5527 /* js_manual_conversions.cpp */,\n\t\t\t\t1A2C78EB181A1257004E5527 /* js_manual_conversions.h */,\n\t\t\t\t1A2C78EC181A1257004E5527 /* jsb_helper.h */,\n\t\t\t\t1A2C78ED181A1257004E5527 /* jsb_opengl_functions.cpp */,\n\t\t\t\t1A2C78EE181A1257004E5527 /* jsb_opengl_functions.h */,\n\t\t\t\t1A2C78EF181A1257004E5527 /* jsb_opengl_manual.cpp */,\n\t\t\t\t1A2C78F0181A1257004E5527 /* jsb_opengl_manual.h */,\n\t\t\t\t1A2C78F1181A1257004E5527 /* jsb_opengl_registration.cpp */,\n\t\t\t\t1A2C78F2181A1257004E5527 /* jsb_opengl_registration.h */,\n\t\t\t\t1A2C78F3181A1257004E5527 /* localstorage */,\n\t\t\t\t1A2C78FD181A1257004E5527 /* network */,\n\t\t\t\t1A2C790A181A1257004E5527 /* ScriptingCore.cpp */,\n\t\t\t\t1A2C790B181A1257004E5527 /* ScriptingCore.h */,\n\t\t\t\t1A2C790C181A1257004E5527 /* spidermonkey_specifics.h */,\n\t\t\t);\n\t\t\tpath = bindings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C78BC181A1257004E5527 /* chipmunk */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C78BE181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp */,\n\t\t\t\t1A2C78BF181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h */,\n\t\t\t\t1A2C78C0181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h */,\n\t\t\t\t1A2C78C1181A1257004E5527 /* js_bindings_chipmunk_functions.cpp */,\n\t\t\t\t1A2C78C2181A1257004E5527 /* js_bindings_chipmunk_functions.h */,\n\t\t\t\t1A2C78C3181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h */,\n\t\t\t\t1A2C78C4181A1257004E5527 /* js_bindings_chipmunk_manual.cpp */,\n\t\t\t\t1A2C78C5181A1257004E5527 /* js_bindings_chipmunk_manual.h */,\n\t\t\t\t1A2C78C6181A1257004E5527 /* js_bindings_chipmunk_registration.cpp */,\n\t\t\t\t1A2C78C7181A1257004E5527 /* js_bindings_chipmunk_registration.h */,\n\t\t\t);\n\t\t\tpath = chipmunk;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C78CD181A1257004E5527 /* cocosbuilder */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C78CF181A1257004E5527 /* cocosbuilder_specifics.hpp */,\n\t\t\t\t1A2C78D0181A1257004E5527 /* js_bindings_ccbreader.cpp */,\n\t\t\t\t1A2C78D1181A1257004E5527 /* js_bindings_ccbreader.h */,\n\t\t\t);\n\t\t\tpath = cocosbuilder;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C78D7181A1257004E5527 /* cocostudio */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C78D9181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp */,\n\t\t\t\t1A2C78DA181A1257004E5527 /* jsb_cocos2dx_studio_manual.h */,\n\t\t\t);\n\t\t\tpath = cocostudio;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C78DE181A1257004E5527 /* extension */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C78E0181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp */,\n\t\t\t\t1A2C78E1181A1257004E5527 /* jsb_cocos2dx_extension_manual.h */,\n\t\t\t);\n\t\t\tpath = extension;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C78F3181A1257004E5527 /* localstorage */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C78F5181A1257004E5527 /* js_bindings_system_functions.cpp */,\n\t\t\t\t1A2C78F6181A1257004E5527 /* js_bindings_system_functions.h */,\n\t\t\t\t1A2C78F7181A1257004E5527 /* js_bindings_system_functions_registration.h */,\n\t\t\t\t1A2C78F8181A1257004E5527 /* js_bindings_system_registration.cpp */,\n\t\t\t\t1A2C78F9181A1257004E5527 /* js_bindings_system_registration.h */,\n\t\t\t);\n\t\t\tpath = localstorage;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A2C78FD181A1257004E5527 /* network */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C78FF181A1257004E5527 /* jsb_websocket.cpp */,\n\t\t\t\t1A2C7900181A1257004E5527 /* jsb_websocket.h */,\n\t\t\t\t1A2C7904181A1257004E5527 /* XMLHTTPRequest.cpp */,\n\t\t\t\t1A2C7905181A1257004E5527 /* XMLHTTPRequest.h */,\n\t\t\t);\n\t\t\tpath = network;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F49180E887E00497A22 /* lua */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1F4A180E88C200497A22 /* bindings */,\n\t\t\t);\n\t\t\tname = lua;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F4A180E88C200497A22 /* bindings */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t15A71DA21892291500F30AC0 /* lua_extensions.c */,\n\t\t\t\t15A71DA31892291500F30AC0 /* lua_extensions.h */,\n\t\t\t\t15A71D3B18921E6900F30AC0 /* socket */,\n\t\t\t\tB362C3A41872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.cpp */,\n\t\t\t\tB362C3A51872B4E900F0BDF4 /* lua_cocos2dx_physics_manual.hpp */,\n\t\t\t\t15F4CA1D1875885A0082884F /* lua_cocos2dx_gui_manual.cpp */,\n\t\t\t\t15F4CA1E1875885A0082884F /* lua_cocos2dx_gui_manual.hpp */,\n\t\t\t\t15CA8D1718697BE5000032AB /* LuaSkeletonAnimation.cpp */,\n\t\t\t\t15CA8D1818697BE5000032AB /* LuaSkeletonAnimation.h */,\n\t\t\t\t15CA8D0B18697A56000032AB /* lua_cocos2dx_spine_manual.cpp */,\n\t\t\t\t15CA8D0C18697A56000032AB /* lua_cocos2dx_spine_manual.hpp */,\n\t\t\t\t15D6E843182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp */,\n\t\t\t\t15D6E844182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp */,\n\t\t\t\t158E06DC181F6796008E01F6 /* lua_xml_http_request.cpp */,\n\t\t\t\t158E06DD181F6796008E01F6 /* lua_xml_http_request.h */,\n\t\t\t\t1A3B1F4E180E88C200497A22 /* CCBProxy.cpp */,\n\t\t\t\t1A3B1F4F180E88C200497A22 /* CCBProxy.h */,\n\t\t\t\t1A3B1F50180E88C200497A22 /* CCLuaBridge.cpp */,\n\t\t\t\t1A3B1F51180E88C200497A22 /* CCLuaBridge.h */,\n\t\t\t\t1A3B1F52180E88C200497A22 /* CCLuaEngine.cpp */,\n\t\t\t\t1A3B1F53180E88C200497A22 /* CCLuaEngine.h */,\n\t\t\t\t1A3B1F54180E88C200497A22 /* CCLuaStack.cpp */,\n\t\t\t\t1A3B1F55180E88C200497A22 /* CCLuaStack.h */,\n\t\t\t\t1A3B1F56180E88C300497A22 /* CCLuaValue.cpp */,\n\t\t\t\t1A3B1F57180E88C300497A22 /* CCLuaValue.h */,\n\t\t\t\t1A3B1F58180E88C300497A22 /* Cocos2dxLuaLoader.cpp */,\n\t\t\t\t1A3B1F59180E88C300497A22 /* Cocos2dxLuaLoader.h */,\n\t\t\t\t1A3B1F5D180E88C300497A22 /* lua_cocos2dx_deprecated.cpp */,\n\t\t\t\t1A3B1F5E180E88C300497A22 /* lua_cocos2dx_deprecated.h */,\n\t\t\t\t1A3B1F5F180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp */,\n\t\t\t\t1A3B1F60180E88C300497A22 /* lua_cocos2dx_extension_manual.h */,\n\t\t\t\t1A3B1F61180E88C300497A22 /* lua_cocos2dx_manual.cpp */,\n\t\t\t\t1A3B1F62180E88C300497A22 /* lua_cocos2dx_manual.hpp */,\n\t\t\t\t1A3B1F63180E88C300497A22 /* Lua_web_socket.cpp */,\n\t\t\t\t1A3B1F64180E88C300497A22 /* Lua_web_socket.h */,\n\t\t\t\t1A3B1F65180E88C300497A22 /* LuaBasicConversions.cpp */,\n\t\t\t\t1A3B1F66180E88C300497A22 /* LuaBasicConversions.h */,\n\t\t\t\t1A3B1F67180E88C300497A22 /* LuaOpengl.cpp */,\n\t\t\t\t1A3B1F68180E88C300497A22 /* LuaOpengl.h */,\n\t\t\t\t1A3B1F69180E88C300497A22 /* LuaScriptHandlerMgr.cpp */,\n\t\t\t\t1A3B1F6A180E88C300497A22 /* LuaScriptHandlerMgr.h */,\n\t\t\t\t1A3B1F6C180E88C300497A22 /* platform */,\n\t\t\t\t1A3B1F76180E88C300497A22 /* tolua_fix.c */,\n\t\t\t\t1A3B1F77180E88C300497A22 /* tolua_fix.h */,\n\t\t\t);\n\t\t\tname = bindings;\n\t\t\tpath = lua/bindings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F6C180E88C300497A22 /* platform */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1F73180E88C300497A22 /* ios */,\n\t\t\t);\n\t\t\tpath = platform;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F73180E88C300497A22 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1F74180E88C300497A22 /* CCLuaObjcBridge.h */,\n\t\t\t\t1A3B1F75180E88C300497A22 /* CCLuaObjcBridge.mm */,\n\t\t\t);\n\t\t\tpath = ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570046180BC59A0088DEC7 /* actions */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570047180BC5A10088DEC7 /* CCAction.cpp */,\n\t\t\t\t1A570048180BC5A10088DEC7 /* CCAction.h */,\n\t\t\t\t1A570049180BC5A10088DEC7 /* CCActionCamera.cpp */,\n\t\t\t\t1A57004A180BC5A10088DEC7 /* CCActionCamera.h */,\n\t\t\t\t1A57004B180BC5A10088DEC7 /* CCActionCatmullRom.cpp */,\n\t\t\t\t1A57004C180BC5A10088DEC7 /* CCActionCatmullRom.h */,\n\t\t\t\t1A57004D180BC5A10088DEC7 /* CCActionEase.cpp */,\n\t\t\t\t1A57004E180BC5A10088DEC7 /* CCActionEase.h */,\n\t\t\t\t1A57004F180BC5A10088DEC7 /* CCActionGrid.cpp */,\n\t\t\t\t1A570050180BC5A10088DEC7 /* CCActionGrid.h */,\n\t\t\t\t1A570051180BC5A10088DEC7 /* CCActionGrid3D.cpp */,\n\t\t\t\t1A570052180BC5A10088DEC7 /* CCActionGrid3D.h */,\n\t\t\t\t1A570053180BC5A10088DEC7 /* CCActionInstant.cpp */,\n\t\t\t\t1A570054180BC5A10088DEC7 /* CCActionInstant.h */,\n\t\t\t\t1A570055180BC5A10088DEC7 /* CCActionInterval.cpp */,\n\t\t\t\t1A570056180BC5A10088DEC7 /* CCActionInterval.h */,\n\t\t\t\t1A570057180BC5A10088DEC7 /* CCActionManager.cpp */,\n\t\t\t\t1A570058180BC5A10088DEC7 /* CCActionManager.h */,\n\t\t\t\t1A570059180BC5A10088DEC7 /* CCActionPageTurn3D.cpp */,\n\t\t\t\t1A57005A180BC5A10088DEC7 /* CCActionPageTurn3D.h */,\n\t\t\t\t1A57005B180BC5A10088DEC7 /* CCActionProgressTimer.cpp */,\n\t\t\t\t1A57005C180BC5A10088DEC7 /* CCActionProgressTimer.h */,\n\t\t\t\t1A57005D180BC5A10088DEC7 /* CCActionTiledGrid.cpp */,\n\t\t\t\t1A57005E180BC5A10088DEC7 /* CCActionTiledGrid.h */,\n\t\t\t\t1A57005F180BC5A10088DEC7 /* CCActionTween.cpp */,\n\t\t\t\t1A570060180BC5A10088DEC7 /* CCActionTween.h */,\n\t\t\t);\n\t\t\tname = actions;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570095180BC5B00088DEC7 /* base-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57009C180BC5D20088DEC7 /* CCNode.cpp */,\n\t\t\t\t1A57009D180BC5D20088DEC7 /* CCNode.h */,\n\t\t\t\t1A570096180BC5C10088DEC7 /* CCAtlasNode.cpp */,\n\t\t\t\t1A570097180BC5C10088DEC7 /* CCAtlasNode.h */,\n\t\t\t);\n\t\t\tname = \"base-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5700A2180BC5E60088DEC7 /* base */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5700A3180BC6060088DEC7 /* atitc.cpp */,\n\t\t\t\t1A5700A4180BC6060088DEC7 /* atitc.h */,\n\t\t\t\t1A5700A5180BC6060088DEC7 /* CCAffineTransform.cpp */,\n\t\t\t\t1A5700A6180BC6060088DEC7 /* CCAffineTransform.h */,\n\t\t\t\t1A5700A7180BC6060088DEC7 /* CCArray.cpp */,\n\t\t\t\t1A5700A8180BC6060088DEC7 /* CCArray.h */,\n\t\t\t\t1A5700A9180BC6060088DEC7 /* CCAutoreleasePool.cpp */,\n\t\t\t\t1A5700AA180BC6060088DEC7 /* CCAutoreleasePool.h */,\n\t\t\t\t1A5700AB180BC6060088DEC7 /* CCBool.h */,\n\t\t\t\t5069133C185016C1009BBDD7 /* CCConsole.cpp */,\n\t\t\t\t5069133D185016C1009BBDD7 /* CCConsole.h */,\n\t\t\t\t1A5700AC180BC6060088DEC7 /* CCData.cpp */,\n\t\t\t\t1A5700AD180BC6060088DEC7 /* CCData.h */,\n\t\t\t\t1A5700AE180BC6060088DEC7 /* CCDataVisitor.cpp */,\n\t\t\t\t1A5700AF180BC6060088DEC7 /* CCDataVisitor.h */,\n\t\t\t\t1A5700B0180BC6060088DEC7 /* CCDictionary.cpp */,\n\t\t\t\t1A5700B1180BC6060088DEC7 /* CCDictionary.h */,\n\t\t\t\t1A5700B2180BC6060088DEC7 /* CCDouble.h */,\n\t\t\t\t1A5700B3180BC6060088DEC7 /* CCFloat.h */,\n\t\t\t\t1A5700B4180BC6060088DEC7 /* CCGeometry.cpp */,\n\t\t\t\t1A5700B5180BC6060088DEC7 /* CCGeometry.h */,\n\t\t\t\t1A5700B6180BC6060088DEC7 /* CCInteger.h */,\n\t\t\t\t1AA2063E1848437900053418 /* CCMap.h */,\n\t\t\t\t1A5700B7180BC6060088DEC7 /* CCNS.cpp */,\n\t\t\t\t1A5700B8180BC6060088DEC7 /* CCNS.h */,\n\t\t\t\t1A5700B9180BC6060088DEC7 /* CCObject.cpp */,\n\t\t\t\t1A5700BA180BC6060088DEC7 /* CCObject.h */,\n\t\t\t\t1A5700BB180BC6060088DEC7 /* CCPlatformConfig.h */,\n\t\t\t\t1A5700BC180BC6060088DEC7 /* CCPlatformMacros.h */,\n\t\t\t\t1A5700BD180BC6060088DEC7 /* CCSet.cpp */,\n\t\t\t\t1A5700BE180BC6060088DEC7 /* CCSet.h */,\n\t\t\t\t1A5700BF180BC6060088DEC7 /* CCString.cpp */,\n\t\t\t\t1A5700C0180BC6060088DEC7 /* CCString.h */,\n\t\t\t\t1AE3C842184F14F700CF29B5 /* CCValue.cpp */,\n\t\t\t\t1AE3C843184F14F700CF29B5 /* CCValue.h */,\n\t\t\t\t1A85BA0C1845F31700260FC0 /* CCVector.h */,\n\t\t\t\t1A5700C1180BC6060088DEC7 /* etc1.cpp */,\n\t\t\t\t1A5700C2180BC6060088DEC7 /* etc1.h */,\n\t\t\t\t1A5700C3180BC6060088DEC7 /* s3tc.cpp */,\n\t\t\t\t1A5700C4180BC6060088DEC7 /* s3tc.h */,\n\t\t\t);\n\t\t\tname = base;\n\t\t\tpath = ../cocos/2d;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570109180BC8DC0088DEC7 /* draw-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57010A180BC8ED0088DEC7 /* CCDrawingPrimitives.cpp */,\n\t\t\t\t1A57010B180BC8EE0088DEC7 /* CCDrawingPrimitives.h */,\n\t\t\t\t1A57010C180BC8EE0088DEC7 /* CCDrawNode.cpp */,\n\t\t\t\t1A57010D180BC8EE0088DEC7 /* CCDrawNode.h */,\n\t\t\t);\n\t\t\tname = \"draw-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570116180BC8FE0088DEC7 /* effects */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570117180BC90D0088DEC7 /* CCGrabber.cpp */,\n\t\t\t\t1A570118180BC90D0088DEC7 /* CCGrabber.h */,\n\t\t\t\t1A570119180BC90D0088DEC7 /* CCGrid.cpp */,\n\t\t\t\t1A57011A180BC90D0088DEC7 /* CCGrid.h */,\n\t\t\t);\n\t\t\tname = effects;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570123180BC9270088DEC7 /* event-dispatcher */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t59A79D4D1821E26E00F19697 /* CCEventListenerMouse.cpp */,\n\t\t\t\t59A79D4E1821E26E00F19697 /* CCEventListenerMouse.h */,\n\t\t\t\t59A79D4F1821E26E00F19697 /* CCEventMouse.cpp */,\n\t\t\t\t59A79D501821E26E00F19697 /* CCEventMouse.h */,\n\t\t\t\t1A570124180BC9460088DEC7 /* CCEvent.cpp */,\n\t\t\t\t1A570125180BC9460088DEC7 /* CCEvent.h */,\n\t\t\t\t1A570126180BC9460088DEC7 /* CCEventAcceleration.cpp */,\n\t\t\t\t1A570127180BC9460088DEC7 /* CCEventAcceleration.h */,\n\t\t\t\t1A570128180BC9460088DEC7 /* CCEventCustom.cpp */,\n\t\t\t\t1A570129180BC9460088DEC7 /* CCEventCustom.h */,\n\t\t\t\t1A57012A180BC9460088DEC7 /* CCEventDispatcher.cpp */,\n\t\t\t\t1A57012B180BC9460088DEC7 /* CCEventDispatcher.h */,\n\t\t\t\t1A57012C180BC9460088DEC7 /* CCEventKeyboard.cpp */,\n\t\t\t\t1A57012D180BC9460088DEC7 /* CCEventKeyboard.h */,\n\t\t\t\t1A57012E180BC9460088DEC7 /* CCEventListener.cpp */,\n\t\t\t\t1A57012F180BC9460088DEC7 /* CCEventListener.h */,\n\t\t\t\t1A570130180BC9460088DEC7 /* CCEventListenerAcceleration.cpp */,\n\t\t\t\t1A570131180BC9460088DEC7 /* CCEventListenerAcceleration.h */,\n\t\t\t\t1A570132180BC9460088DEC7 /* CCEventListenerCustom.cpp */,\n\t\t\t\t1A570133180BC9460088DEC7 /* CCEventListenerCustom.h */,\n\t\t\t\t1A570134180BC9460088DEC7 /* CCEventListenerKeyboard.cpp */,\n\t\t\t\t1A570135180BC9460088DEC7 /* CCEventListenerKeyboard.h */,\n\t\t\t\t1A570136180BC9460088DEC7 /* CCEventListenerTouch.cpp */,\n\t\t\t\t1A570137180BC9460088DEC7 /* CCEventListenerTouch.h */,\n\t\t\t\t1A570138180BC9460088DEC7 /* CCEventTouch.cpp */,\n\t\t\t\t1A570139180BC9460088DEC7 /* CCEventTouch.h */,\n\t\t\t\t1A570544180BD9C40088DEC7 /* CCTouch.cpp */,\n\t\t\t\t1A570545180BD9C40088DEC7 /* CCTouch.h */,\n\t\t\t);\n\t\t\tname = \"event-dispatcher\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570181180BCB170088DEC7 /* label-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570182180BCB590088DEC7 /* CCFont.cpp */,\n\t\t\t\t1A570183180BCB590088DEC7 /* CCFont.h */,\n\t\t\t\t1A570184180BCB590088DEC7 /* CCFontAtlas.cpp */,\n\t\t\t\t1A570185180BCB590088DEC7 /* CCFontAtlas.h */,\n\t\t\t\t1A570186180BCB590088DEC7 /* CCFontAtlasCache.cpp */,\n\t\t\t\t1A570187180BCB590088DEC7 /* CCFontAtlasCache.h */,\n\t\t\t\t1ABA68AC1888D700007D1BB4 /* CCFontCharMap.cpp */,\n\t\t\t\t1ABA68AD1888D700007D1BB4 /* CCFontCharMap.h */,\n\t\t\t\t1A57018C180BCB590088DEC7 /* CCFontFNT.cpp */,\n\t\t\t\t1A57018D180BCB590088DEC7 /* CCFontFNT.h */,\n\t\t\t\t1A57018E180BCB590088DEC7 /* CCFontFreeType.cpp */,\n\t\t\t\t1A57018F180BCB590088DEC7 /* CCFontFreeType.h */,\n\t\t\t\t1A570190180BCB590088DEC7 /* CCLabel.cpp */,\n\t\t\t\t1A570191180BCB590088DEC7 /* CCLabel.h */,\n\t\t\t\t1A570192180BCB590088DEC7 /* CCLabelAtlas.cpp */,\n\t\t\t\t1A570193180BCB590088DEC7 /* CCLabelAtlas.h */,\n\t\t\t\t1A570194180BCB590088DEC7 /* CCLabelBMFont.cpp */,\n\t\t\t\t1A570195180BCB590088DEC7 /* CCLabelBMFont.h */,\n\t\t\t\t1A570197180BCB590088DEC7 /* CCLabelTextFormatter.cpp */,\n\t\t\t\t1A570198180BCB590088DEC7 /* CCLabelTextFormatter.h */,\n\t\t\t\t1A570199180BCB590088DEC7 /* CCLabelTTF.cpp */,\n\t\t\t\t1A57019A180BCB590088DEC7 /* CCLabelTTF.h */,\n\t\t\t);\n\t\t\tname = \"label-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5701D3180BCB670088DEC7 /* layers-scenes-transitions-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5701D4180BCB8C0088DEC7 /* CCLayer.cpp */,\n\t\t\t\t1A5701D5180BCB8C0088DEC7 /* CCLayer.h */,\n\t\t\t\t1A5701D6180BCB8C0088DEC7 /* CCScene.cpp */,\n\t\t\t\t1A5701D7180BCB8C0088DEC7 /* CCScene.h */,\n\t\t\t\t1A5701D8180BCB8C0088DEC7 /* CCTransition.cpp */,\n\t\t\t\t1A5701D9180BCB8C0088DEC7 /* CCTransition.h */,\n\t\t\t\t1A5701DA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp */,\n\t\t\t\t1A5701DB180BCB8C0088DEC7 /* CCTransitionPageTurn.h */,\n\t\t\t\t1A5701DC180BCB8C0088DEC7 /* CCTransitionProgress.cpp */,\n\t\t\t\t1A5701DD180BCB8C0088DEC7 /* CCTransitionProgress.h */,\n\t\t\t);\n\t\t\tname = \"layers-scenes-transitions-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5701F2180BCB970088DEC7 /* menu-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5701F3180BCBAD0088DEC7 /* CCMenu.cpp */,\n\t\t\t\t1A5701F4180BCBAD0088DEC7 /* CCMenu.h */,\n\t\t\t\t1A5701F5180BCBAD0088DEC7 /* CCMenuItem.cpp */,\n\t\t\t\t1A5701F6180BCBAD0088DEC7 /* CCMenuItem.h */,\n\t\t\t);\n\t\t\tname = \"menu-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5701FF180BCBBD0088DEC7 /* misc-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tED9C6A9218599AD8000A5232 /* CCNodeGrid.cpp */,\n\t\t\t\tED9C6A9318599AD8000A5232 /* CCNodeGrid.h */,\n\t\t\t\t1A57020C180BCBF40088DEC7 /* CCProgressTimer.cpp */,\n\t\t\t\t1A57020D180BCBF40088DEC7 /* CCProgressTimer.h */,\n\t\t\t\t1A57020E180BCBF40088DEC7 /* CCRenderTexture.cpp */,\n\t\t\t\t1A57020F180BCBF40088DEC7 /* CCRenderTexture.h */,\n\t\t\t\t1A570206180BCBDF0088DEC7 /* CCMotionStreak.cpp */,\n\t\t\t\t1A570207180BCBDF0088DEC7 /* CCMotionStreak.h */,\n\t\t\t\t1A570200180BCBD40088DEC7 /* CCClippingNode.cpp */,\n\t\t\t\t1A570201180BCBD40088DEC7 /* CCClippingNode.h */,\n\t\t\t);\n\t\t\tname = \"misc-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570218180BCC000088DEC7 /* particle-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570219180BCC1A0088DEC7 /* CCParticleBatchNode.cpp */,\n\t\t\t\t1A57021A180BCC1A0088DEC7 /* CCParticleBatchNode.h */,\n\t\t\t\t1A57021B180BCC1A0088DEC7 /* CCParticleExamples.cpp */,\n\t\t\t\t1A57021C180BCC1A0088DEC7 /* CCParticleExamples.h */,\n\t\t\t\t1A57021D180BCC1A0088DEC7 /* CCParticleSystem.cpp */,\n\t\t\t\t1A57021E180BCC1A0088DEC7 /* CCParticleSystem.h */,\n\t\t\t\t1A57021F180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp */,\n\t\t\t\t1A570220180BCC1A0088DEC7 /* CCParticleSystemQuad.h */,\n\t\t\t);\n\t\t\tname = \"particle-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570231180BCC380088DEC7 /* script-support */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570232180BCC4D0088DEC7 /* CCScriptSupport.cpp */,\n\t\t\t\t1A570233180BCC4D0088DEC7 /* CCScriptSupport.h */,\n\t\t\t);\n\t\t\tname = \"script-support\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570238180BCC580088DEC7 /* shaders */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57052F180BD9500088DEC7 /* CCGLProgram.cpp */,\n\t\t\t\t1A570530180BD9500088DEC7 /* CCGLProgram.h */,\n\t\t\t\t1A570531180BD9500088DEC7 /* ccGLStateCache.cpp */,\n\t\t\t\t1A570532180BD9500088DEC7 /* ccGLStateCache.h */,\n\t\t\t\t1A570239180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h */,\n\t\t\t\t1A57023A180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h */,\n\t\t\t\t1A57023B180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h */,\n\t\t\t\t1A57023C180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h */,\n\t\t\t\t1A57023D180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h */,\n\t\t\t\t1A57023E180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h */,\n\t\t\t\t1A57023F180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h */,\n\t\t\t\t1A570240180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h */,\n\t\t\t\t1A570241180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h */,\n\t\t\t\t1A570242180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h */,\n\t\t\t\t1A570243180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h */,\n\t\t\t\t1A570244180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h */,\n\t\t\t\t1A570245180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h */,\n\t\t\t\t1A570246180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h */,\n\t\t\t\tA023FA32185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h */,\n\t\t\t\tA023FA33185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h */,\n\t\t\t\t1A570247180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h */,\n\t\t\t\t1A570248180BCC6F0088DEC7 /* CCShaderCache.cpp */,\n\t\t\t\t1A570249180BCC6F0088DEC7 /* CCShaderCache.h */,\n\t\t\t\t1A57024A180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h */,\n\t\t\t\t1A57024B180BCC6F0088DEC7 /* ccShaders.cpp */,\n\t\t\t\t1A57024C180BCC6F0088DEC7 /* ccShaders.h */,\n\t\t\t);\n\t\t\tname = shaders;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570275180BCC840088DEC7 /* sprite-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57028E180BCCAB0088DEC7 /* CCAnimation.cpp */,\n\t\t\t\t1A57028F180BCCAB0088DEC7 /* CCAnimation.h */,\n\t\t\t\t1A570290180BCCAB0088DEC7 /* CCAnimationCache.cpp */,\n\t\t\t\t1A570291180BCCAB0088DEC7 /* CCAnimationCache.h */,\n\t\t\t\t1A570276180BCC900088DEC7 /* CCSprite.cpp */,\n\t\t\t\t1A570277180BCC900088DEC7 /* CCSprite.h */,\n\t\t\t\t1A570278180BCC900088DEC7 /* CCSpriteBatchNode.cpp */,\n\t\t\t\t1A570279180BCC900088DEC7 /* CCSpriteBatchNode.h */,\n\t\t\t\t1A57027A180BCC900088DEC7 /* CCSpriteFrame.cpp */,\n\t\t\t\t1A57027B180BCC900088DEC7 /* CCSpriteFrame.h */,\n\t\t\t\t1A57027C180BCC900088DEC7 /* CCSpriteFrameCache.cpp */,\n\t\t\t\t1A57027D180BCC900088DEC7 /* CCSpriteFrameCache.h */,\n\t\t\t);\n\t\t\tname = \"sprite-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57029A180BCD4F0088DEC7 /* support */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570337180BCFED0088DEC7 /* zip-support */,\n\t\t\t\t1A57032A180BCFBC0088DEC7 /* user-default */,\n\t\t\t\t1A570321180BCF580088DEC7 /* image-support */,\n\t\t\t\t1A570314180BCF1C0088DEC7 /* data-support */,\n\t\t\t\t1A570307180BCEFB0088DEC7 /* component */,\n\t\t\t\t1A57029B180BCD890088DEC7 /* base64.cpp */,\n\t\t\t\t1A57029C180BCD890088DEC7 /* base64.h */,\n\t\t\t\t1A5702A1180BCD980088DEC7 /* CCNotificationCenter.cpp */,\n\t\t\t\t1A5702A2180BCD980088DEC7 /* CCNotificationCenter.h */,\n\t\t\t\t1A5702A7180BCDAA0088DEC7 /* CCProfiling.cpp */,\n\t\t\t\t1A5702A8180BCDAA0088DEC7 /* CCProfiling.h */,\n\t\t\t\t1A5702AD180BCDBC0088DEC7 /* ccUTF8.cpp */,\n\t\t\t\t1A5702AE180BCDBC0088DEC7 /* ccUTF8.h */,\n\t\t\t\t1A570304180BCED90088DEC7 /* ccUtils.cpp */,\n\t\t\t\t1A5702B9180BCDFC0088DEC7 /* ccUtils.h */,\n\t\t\t\t1A5702B3180BCDF40088DEC7 /* CCVertex.cpp */,\n\t\t\t\t1A5702B4180BCDF40088DEC7 /* CCVertex.h */,\n\t\t\t);\n\t\t\tname = support;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5702BC180BCE0A0088DEC7 /* text-input-node */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5702C6180BCE370088DEC7 /* CCTextFieldTTF.cpp */,\n\t\t\t\t1A5702C7180BCE370088DEC7 /* CCTextFieldTTF.h */,\n\t\t\t\t1A5702BD180BCE2A0088DEC7 /* CCIMEDelegate.h */,\n\t\t\t\t1A5702BE180BCE2A0088DEC7 /* CCIMEDispatcher.cpp */,\n\t\t\t\t1A5702BF180BCE2A0088DEC7 /* CCIMEDispatcher.h */,\n\t\t\t);\n\t\t\tname = \"text-input-node\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5702CC180BCE410088DEC7 /* textures */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5702CD180BCE560088DEC7 /* CCTexture2D.cpp */,\n\t\t\t\t1A5702CE180BCE570088DEC7 /* CCTexture2D.h */,\n\t\t\t\t1A5702CF180BCE570088DEC7 /* CCTextureAtlas.cpp */,\n\t\t\t\t1A5702D0180BCE570088DEC7 /* CCTextureAtlas.h */,\n\t\t\t\t1A5702D1180BCE570088DEC7 /* CCTextureCache.cpp */,\n\t\t\t\t1A5702D2180BCE570088DEC7 /* CCTextureCache.h */,\n\t\t\t);\n\t\t\tname = textures;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5702DF180BCE610088DEC7 /* tilemap-parallax-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5702FE180BCE890088DEC7 /* CCParallaxNode.cpp */,\n\t\t\t\t1A5702FF180BCE890088DEC7 /* CCParallaxNode.h */,\n\t\t\t\t1A5702E0180BCE750088DEC7 /* CCTileMapAtlas.cpp */,\n\t\t\t\t1A5702E1180BCE750088DEC7 /* CCTileMapAtlas.h */,\n\t\t\t\t1A5702E2180BCE750088DEC7 /* CCTMXLayer.cpp */,\n\t\t\t\t1A5702E3180BCE750088DEC7 /* CCTMXLayer.h */,\n\t\t\t\t1A5702E4180BCE750088DEC7 /* CCTMXObjectGroup.cpp */,\n\t\t\t\t1A5702E5180BCE750088DEC7 /* CCTMXObjectGroup.h */,\n\t\t\t\t1A5702E6180BCE750088DEC7 /* CCTMXTiledMap.cpp */,\n\t\t\t\t1A5702E7180BCE750088DEC7 /* CCTMXTiledMap.h */,\n\t\t\t\t1A5702E8180BCE750088DEC7 /* CCTMXXMLParser.cpp */,\n\t\t\t\t1A5702E9180BCE750088DEC7 /* CCTMXXMLParser.h */,\n\t\t\t);\n\t\t\tname = \"tilemap-parallax-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570307180BCEFB0088DEC7 /* component */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570308180BCF190088DEC7 /* CCComponent.cpp */,\n\t\t\t\t1A570309180BCF190088DEC7 /* CCComponent.h */,\n\t\t\t\t1A57030A180BCF190088DEC7 /* CCComponentContainer.cpp */,\n\t\t\t\t1A57030B180BCF190088DEC7 /* CCComponentContainer.h */,\n\t\t\t);\n\t\t\tname = component;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570314180BCF1C0088DEC7 /* data-support */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570315180BCF430088DEC7 /* ccCArray.cpp */,\n\t\t\t\t1A570316180BCF430088DEC7 /* ccCArray.h */,\n\t\t\t\t1A570317180BCF430088DEC7 /* uthash.h */,\n\t\t\t\t1A570318180BCF430088DEC7 /* utlist.h */,\n\t\t\t);\n\t\t\tname = \"data-support\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570321180BCF580088DEC7 /* image-support */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570322180BCF660088DEC7 /* TGAlib.cpp */,\n\t\t\t\t1A570323180BCF660088DEC7 /* TGAlib.h */,\n\t\t\t);\n\t\t\tname = \"image-support\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57032A180BCFBC0088DEC7 /* user-default */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57032B180BCFD50088DEC7 /* CCUserDefault.cpp */,\n\t\t\t\t1A57032C180BCFD50088DEC7 /* CCUserDefault.h */,\n\t\t\t\t1A57032D180BCFD50088DEC7 /* CCUserDefault.mm */,\n\t\t\t\t1A57032E180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp */,\n\t\t\t);\n\t\t\tname = \"user-default\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570337180BCFED0088DEC7 /* zip-support */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570338180BCFFA0088DEC7 /* ZipUtils.cpp */,\n\t\t\t\t1A570339180BCFFA0088DEC7 /* ZipUtils.h */,\n\t\t\t);\n\t\t\tname = \"zip-support\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57033E180BD0490088DEC7 /* external */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168B21807AF9C005B8026 /* Box2D */,\n\t\t\t\t46A1693A1807AFD6005B8026 /* chipmunk */,\n\t\t\t\t1AAF5403180E3B2D000584C8 /* curl */,\n\t\t\t\t1A087AE51860400400196EF5 /* edtaa3func */,\n\t\t\t\t1A5703BC180BD2940088DEC7 /* freetype2 */,\n\t\t\t\t1A57033F180BD0540088DEC7 /* glfw3 */,\n\t\t\t\t1A570373180BD1790088DEC7 /* jpeg */,\n\t\t\t\t1AD71EF8180E28C400808F54 /* json */,\n\t\t\t\t1A8C55C9180E8C5700EF57C3 /* lua */,\n\t\t\t\t1A57035C180BD0D90088DEC7 /* png */,\n\t\t\t\t1AAF541E180E4013000584C8 /* spidermonkey */,\n\t\t\t\t1A57038A180BD1EF0088DEC7 /* tiff */,\n\t\t\t\t1A570348180BD09B0088DEC7 /* tinyxml2 */,\n\t\t\t\t1A57034F180BD0B00088DEC7 /* unzip */,\n\t\t\t\t1A5703A5180BD2410088DEC7 /* webp */,\n\t\t\t\t1AAF537A180E354D000584C8 /* websockets */,\n\t\t\t);\n\t\t\tname = external;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57033F180BD0540088DEC7 /* glfw3 */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570345180BD07B0088DEC7 /* lib */,\n\t\t\t);\n\t\t\tname = glfw3;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570345180BD07B0088DEC7 /* lib */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570346180BD0850088DEC7 /* libglfw3.a */,\n\t\t\t);\n\t\t\tname = lib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570348180BD09B0088DEC7 /* tinyxml2 */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570349180BD09B0088DEC7 /* tinyxml2.cpp */,\n\t\t\t\t1A57034A180BD09B0088DEC7 /* tinyxml2.h */,\n\t\t\t);\n\t\t\tname = tinyxml2;\n\t\t\tpath = ../external/tinyxml2;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57034F180BD0B00088DEC7 /* unzip */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570350180BD0B00088DEC7 /* ioapi.cpp */,\n\t\t\t\t1A570351180BD0B00088DEC7 /* ioapi.h */,\n\t\t\t\t1A570352180BD0B00088DEC7 /* unzip.cpp */,\n\t\t\t\t1A570353180BD0B00088DEC7 /* unzip.h */,\n\t\t\t);\n\t\t\tname = unzip;\n\t\t\tpath = ../external/unzip;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57035C180BD0D90088DEC7 /* png */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57035E180BD0EF0088DEC7 /* prebuilt */,\n\t\t\t);\n\t\t\tname = png;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57035E180BD0EF0088DEC7 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570362180BD1120088DEC7 /* ios */,\n\t\t\t\t1A57035F180BD1080088DEC7 /* mac */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57035F180BD1080088DEC7 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570360180BD1080088DEC7 /* libpng.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tpath = ../external/png/prebuilt/mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570362180BD1120088DEC7 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570363180BD1120088DEC7 /* libpng.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/png/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570373180BD1790088DEC7 /* jpeg */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570375180BD1840088DEC7 /* prebuilt */,\n\t\t\t);\n\t\t\tname = jpeg;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570375180BD1840088DEC7 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570376180BD1B40088DEC7 /* ios */,\n\t\t\t\t1A570379180BD1C90088DEC7 /* mac */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570376180BD1B40088DEC7 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A570377180BD1B40088DEC7 /* libjpeg.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/jpeg/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570379180BD1C90088DEC7 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57037A180BD1C90088DEC7 /* libjpeg.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tpath = ../external/jpeg/prebuilt/mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57038A180BD1EF0088DEC7 /* tiff */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57038C180BD2040088DEC7 /* prebuilt */,\n\t\t\t);\n\t\t\tname = tiff;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57038C180BD2040088DEC7 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703A2180BD2350088DEC7 /* ios */,\n\t\t\t\t1A57039F180BD22C0088DEC7 /* mac */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57039F180BD22C0088DEC7 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703A0180BD22C0088DEC7 /* libtiff.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tpath = ../external/tiff/prebuilt/mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5703A2180BD2350088DEC7 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703A3180BD2350088DEC7 /* libtiff.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/tiff/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5703A5180BD2410088DEC7 /* webp */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703A6180BD2530088DEC7 /* prebuilt */,\n\t\t\t);\n\t\t\tname = webp;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5703A6180BD2530088DEC7 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703B9180BD2800088DEC7 /* ios */,\n\t\t\t\t1A5703B6180BD2780088DEC7 /* mac */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5703B6180BD2780088DEC7 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703B7180BD2780088DEC7 /* libwebp.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tpath = ../external/webp/prebuilt/mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5703B9180BD2800088DEC7 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703BA180BD2800088DEC7 /* libwebp.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/webp/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5703BC180BD2940088DEC7 /* freetype2 */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A5703BE180BD29C0088DEC7 /* prebuilt */,\n\t\t\t);\n\t\t\tname = freetype2;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A5703BE180BD29C0088DEC7 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57052C180BD3280088DEC7 /* ios */,\n\t\t\t\t1A570529180BD31F0088DEC7 /* mac */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A570529180BD31F0088DEC7 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57052A180BD31F0088DEC7 /* libfreetype.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tpath = ../external/freetype2/prebuilt/mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A57052C180BD3280088DEC7 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A57052D180BD3280088DEC7 /* libfreetype.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/freetype2/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C55C9180E8C5700EF57C3 /* lua */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C5637180E8C7800EF57C3 /* luajit */,\n\t\t\t\t1A8C563E180E8D0D00EF57C3 /* tolua */,\n\t\t\t);\n\t\t\tname = lua;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5637180E8C7800EF57C3 /* luajit */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C563B180E8CA700EF57C3 /* mac */,\n\t\t\t\t1A8C5638180E8C8700EF57C3 /* ios */,\n\t\t\t);\n\t\t\tname = luajit;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5638180E8C8700EF57C3 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1599607F181132DE00C7D42C /* libluajit.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C563B180E8CA700EF57C3 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1599607A1811329600C7D42C /* libluajit.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C563E180E8D0D00EF57C3 /* tolua */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C563F180E8D0D00EF57C3 /* tolua++.h */,\n\t\t\t\t1A8C5640180E8D0D00EF57C3 /* tolua_event.c */,\n\t\t\t\t1A8C5641180E8D0D00EF57C3 /* tolua_event.h */,\n\t\t\t\t1A8C5642180E8D0D00EF57C3 /* tolua_is.c */,\n\t\t\t\t1A8C5643180E8D0D00EF57C3 /* tolua_map.c */,\n\t\t\t\t1A8C5644180E8D0D00EF57C3 /* tolua_push.c */,\n\t\t\t\t1A8C5645180E8D0D00EF57C3 /* tolua_to.c */,\n\t\t\t);\n\t\t\tname = tolua;\n\t\t\tpath = ../external/lua/tolua;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C58BD180E92CC00EF57C3 /* gui */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C58BF180E92CC00EF57C3 /* CocosGUI.cpp */,\n\t\t\t\t1A8C58C0180E92CC00EF57C3 /* CocosGUI.h */,\n\t\t\t\t1A8C58C1180E92CC00EF57C3 /* UILayout.cpp */,\n\t\t\t\t1A8C58C2180E92CC00EF57C3 /* UILayout.h */,\n\t\t\t\t1A8C58C3180E92CC00EF57C3 /* UILayoutParameter.cpp */,\n\t\t\t\t1A8C58C4180E92CC00EF57C3 /* UILayoutParameter.h */,\n\t\t\t\t1A8C58C5180E92CC00EF57C3 /* UIButton.cpp */,\n\t\t\t\t1A8C58C6180E92CC00EF57C3 /* UIButton.h */,\n\t\t\t\t1A8C58C7180E92CC00EF57C3 /* UICheckBox.cpp */,\n\t\t\t\t1A8C58C8180E92CC00EF57C3 /* UICheckBox.h */,\n\t\t\t\t1A8C58CB180E92CC00EF57C3 /* UIHelper.cpp */,\n\t\t\t\t1A8C58CC180E92CC00EF57C3 /* UIHelper.h */,\n\t\t\t\t1A8C58CD180E92CC00EF57C3 /* UIImageView.cpp */,\n\t\t\t\t1A8C58CE180E92CC00EF57C3 /* UIImageView.h */,\n\t\t\t\t1A8C58D1180E92CC00EF57C3 /* UIText.cpp */,\n\t\t\t\t1A8C58D2180E92CC00EF57C3 /* UIText.h */,\n\t\t\t\t1A8C58D3180E92CC00EF57C3 /* UITextAtlas.cpp */,\n\t\t\t\t1A8C58D4180E92CC00EF57C3 /* UITextAtlas.h */,\n\t\t\t\t1A8C58D5180E92CC00EF57C3 /* UITextBMFont.cpp */,\n\t\t\t\t1A8C58D6180E92CC00EF57C3 /* UITextBMFont.h */,\n\t\t\t\t1A8C58D9180E92CC00EF57C3 /* UILayoutDefine.cpp */,\n\t\t\t\t1A8C58DA180E92CC00EF57C3 /* UILayoutDefine.h */,\n\t\t\t\t1A8C58DD180E92CC00EF57C3 /* UILoadingBar.cpp */,\n\t\t\t\t1A8C58DE180E92CC00EF57C3 /* UILoadingBar.h */,\n\t\t\t\t1A8C58DF180E92CC00EF57C3 /* UIPageView.cpp */,\n\t\t\t\t1A8C58E0180E92CC00EF57C3 /* UIPageView.h */,\n\t\t\t\t1A8C58E3180E92CC00EF57C3 /* UIScrollInterface.h */,\n\t\t\t\t1A8C58E4180E92CC00EF57C3 /* UIScrollView.cpp */,\n\t\t\t\t1A8C58E5180E92CC00EF57C3 /* UIScrollView.h */,\n\t\t\t\t50A1FF1618290ED4001840C4 /* UIListView.cpp */,\n\t\t\t\t50A1FF1718290ED4001840C4 /* UIListView.h */,\n\t\t\t\t1A8C58E6180E92CC00EF57C3 /* UISlider.cpp */,\n\t\t\t\t1A8C58E7180E92CC00EF57C3 /* UISlider.h */,\n\t\t\t\t1A8C58E8180E92CC00EF57C3 /* UITextField.cpp */,\n\t\t\t\t1A8C58E9180E92CC00EF57C3 /* UITextField.h */,\n\t\t\t\t1A8C58EA180E92CC00EF57C3 /* UIWidget.cpp */,\n\t\t\t\t1A8C58EB180E92CC00EF57C3 /* UIWidget.h */,\n\t\t\t);\n\t\t\tname = gui;\n\t\t\tpath = ../cocos/gui;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5946180E930E00EF57C3 /* cocostudio */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t06CAAAC1186AD63B0012A414 /* TriggerObj.h */,\n\t\t\t\t06CAAABA186AD63B0012A414 /* ObjectFactory.cpp */,\n\t\t\t\t06CAAABB186AD63B0012A414 /* ObjectFactory.h */,\n\t\t\t\t06CAAABC186AD63B0012A414 /* TriggerBase.cpp */,\n\t\t\t\t06CAAABD186AD63B0012A414 /* TriggerBase.h */,\n\t\t\t\t06CAAABE186AD63B0012A414 /* TriggerMng.cpp */,\n\t\t\t\t06CAAABF186AD63B0012A414 /* TriggerMng.h */,\n\t\t\t\t06CAAAC0186AD63B0012A414 /* TriggerObj.cpp */,\n\t\t\t\t3774879E1869BA8C00EDF837 /* CCActionEaseEx.cpp */,\n\t\t\t\t37936A401869B7B200E974DD /* CCActionEaseEx.h */,\n\t\t\t\t1A8C5948180E930E00EF57C3 /* CCActionFrame.cpp */,\n\t\t\t\t1A8C5949180E930E00EF57C3 /* CCActionFrame.h */,\n\t\t\t\t1A8C594A180E930E00EF57C3 /* CCActionFrameEasing.cpp */,\n\t\t\t\t1A8C594B180E930E00EF57C3 /* CCActionFrameEasing.h */,\n\t\t\t\t1A8C594C180E930E00EF57C3 /* CCActionManagerEx.cpp */,\n\t\t\t\t1A8C594D180E930E00EF57C3 /* CCActionManagerEx.h */,\n\t\t\t\t1A8C594E180E930E00EF57C3 /* CCActionNode.cpp */,\n\t\t\t\t1A8C594F180E930E00EF57C3 /* CCActionNode.h */,\n\t\t\t\t1A8C5950180E930E00EF57C3 /* CCActionObject.cpp */,\n\t\t\t\t1A8C5951180E930E00EF57C3 /* CCActionObject.h */,\n\t\t\t\t1A8C5952180E930E00EF57C3 /* CCArmature.cpp */,\n\t\t\t\t1A8C5953180E930E00EF57C3 /* CCArmature.h */,\n\t\t\t\t1A8C5954180E930E00EF57C3 /* CCArmatureAnimation.cpp */,\n\t\t\t\t1A8C5955180E930E00EF57C3 /* CCArmatureAnimation.h */,\n\t\t\t\t1A8C5956180E930E00EF57C3 /* CCArmatureDataManager.cpp */,\n\t\t\t\t1A8C5957180E930E00EF57C3 /* CCArmatureDataManager.h */,\n\t\t\t\t1A8C5958180E930E00EF57C3 /* CCArmatureDefine.cpp */,\n\t\t\t\t1A8C5959180E930E00EF57C3 /* CCArmatureDefine.h */,\n\t\t\t\t1A8C595A180E930E00EF57C3 /* CCBatchNode.cpp */,\n\t\t\t\t1A8C595B180E930E00EF57C3 /* CCBatchNode.h */,\n\t\t\t\t1A8C595C180E930E00EF57C3 /* CCBone.cpp */,\n\t\t\t\t1A8C595D180E930E00EF57C3 /* CCBone.h */,\n\t\t\t\t1A8C595E180E930E00EF57C3 /* CCColliderDetector.cpp */,\n\t\t\t\t1A8C595F180E930E00EF57C3 /* CCColliderDetector.h */,\n\t\t\t\t373B910718787C0B00198F86 /* CCComBase.h */,\n\t\t\t\t1A8C5960180E930E00EF57C3 /* CCComAttribute.cpp */,\n\t\t\t\t1A8C5961180E930E00EF57C3 /* CCComAttribute.h */,\n\t\t\t\t1A8C5962180E930E00EF57C3 /* CCComAudio.cpp */,\n\t\t\t\t1A8C5963180E930E00EF57C3 /* CCComAudio.h */,\n\t\t\t\t1A8C5964180E930E00EF57C3 /* CCComController.cpp */,\n\t\t\t\t1A8C5965180E930E00EF57C3 /* CCComController.h */,\n\t\t\t\t1A8C5966180E930E00EF57C3 /* CCComRender.cpp */,\n\t\t\t\t1A8C5967180E930E00EF57C3 /* CCComRender.h */,\n\t\t\t\t1A8C5968180E930E00EF57C3 /* CCDataReaderHelper.cpp */,\n\t\t\t\t1A8C5969180E930E00EF57C3 /* CCDataReaderHelper.h */,\n\t\t\t\t1A8C596A180E930E00EF57C3 /* CCDatas.cpp */,\n\t\t\t\t1A8C596B180E930E00EF57C3 /* CCDatas.h */,\n\t\t\t\t1A8C596C180E930E00EF57C3 /* CCDecorativeDisplay.cpp */,\n\t\t\t\t1A8C596D180E930E00EF57C3 /* CCDecorativeDisplay.h */,\n\t\t\t\t1A8C596E180E930E00EF57C3 /* CCDisplayFactory.cpp */,\n\t\t\t\t1A8C596F180E930E00EF57C3 /* CCDisplayFactory.h */,\n\t\t\t\t1A8C5970180E930E00EF57C3 /* CCDisplayManager.cpp */,\n\t\t\t\t1A8C5971180E930E00EF57C3 /* CCDisplayManager.h */,\n\t\t\t\t1A8C5972180E930E00EF57C3 /* CCInputDelegate.cpp */,\n\t\t\t\t1A8C5973180E930E00EF57C3 /* CCInputDelegate.h */,\n\t\t\t\t1A8C5974180E930E00EF57C3 /* CCProcessBase.cpp */,\n\t\t\t\t1A8C5975180E930E00EF57C3 /* CCProcessBase.h */,\n\t\t\t\t1A8C5976180E930E00EF57C3 /* CCSGUIReader.cpp */,\n\t\t\t\t1A8C5977180E930E00EF57C3 /* CCSGUIReader.h */,\n\t\t\t\t1A8C5978180E930E00EF57C3 /* CCSkin.cpp */,\n\t\t\t\t1A8C5979180E930E00EF57C3 /* CCSkin.h */,\n\t\t\t\t1A8C597A180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp */,\n\t\t\t\t1A8C597B180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h */,\n\t\t\t\t1A8C597C180E930E00EF57C3 /* CCSSceneReader.cpp */,\n\t\t\t\t1A8C597D180E930E00EF57C3 /* CCSSceneReader.h */,\n\t\t\t\t1A8C597E180E930E00EF57C3 /* CCTransformHelp.cpp */,\n\t\t\t\t1A8C597F180E930E00EF57C3 /* CCTransformHelp.h */,\n\t\t\t\t1A8C5980180E930E00EF57C3 /* CCTween.cpp */,\n\t\t\t\t1A8C5981180E930E00EF57C3 /* CCTween.h */,\n\t\t\t\t1A8C5982180E930E00EF57C3 /* CCTweenFunction.cpp */,\n\t\t\t\t1A8C5983180E930E00EF57C3 /* CCTweenFunction.h */,\n\t\t\t\t1A8C5984180E930E00EF57C3 /* CCUtilMath.cpp */,\n\t\t\t\t1A8C5985180E930E00EF57C3 /* CCUtilMath.h */,\n\t\t\t\t1A8C5986180E930E00EF57C3 /* CocoStudio.h */,\n\t\t\t\t1A8C5989180E930E00EF57C3 /* DictionaryHelper.cpp */,\n\t\t\t\t1A8C598A180E930E00EF57C3 /* DictionaryHelper.h */,\n\t\t\t);\n\t\t\tpath = cocostudio;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5350180E305F000584C8 /* assets-manager */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5351180E3060000584C8 /* AssetsManager.cpp */,\n\t\t\t\t1AAF5352180E3060000584C8 /* AssetsManager.h */,\n\t\t\t);\n\t\t\tpath = \"assets-manager\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5360180E3374000584C8 /* network */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5362180E3374000584C8 /* HttpClient.cpp */,\n\t\t\t\t1AAF5363180E3374000584C8 /* HttpClient.h */,\n\t\t\t\t1AAF5364180E3374000584C8 /* HttpRequest.h */,\n\t\t\t\t1AAF5365180E3374000584C8 /* HttpResponse.h */,\n\t\t\t\t1AAF5366180E3374000584C8 /* SocketIO.cpp */,\n\t\t\t\t1AAF5367180E3374000584C8 /* SocketIO.h */,\n\t\t\t\t1AAF5368180E3374000584C8 /* WebSocket.cpp */,\n\t\t\t\t1AAF5369180E3374000584C8 /* WebSocket.h */,\n\t\t\t);\n\t\t\tname = network;\n\t\t\tpath = ../cocos/network;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF537A180E354D000584C8 /* websockets */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF537B180E3560000584C8 /* prebuilt */,\n\t\t\t);\n\t\t\tname = websockets;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF537B180E3560000584C8 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5386180E35AC000584C8 /* ios */,\n\t\t\t\t1AAF5383180E35A3000584C8 /* mac */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5383180E35A3000584C8 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5384180E35A3000584C8 /* libwebsockets.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tpath = ../external/websockets/prebuilt/mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5386180E35AC000584C8 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5387180E35AC000584C8 /* libwebsockets.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/websockets/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5403180E3B2D000584C8 /* curl */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5405180E3B38000584C8 /* prebuilt */,\n\t\t\t);\n\t\t\tname = curl;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5405180E3B38000584C8 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF541B180E3B6A000584C8 /* ios */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF541B180E3B6A000584C8 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF541C180E3B6A000584C8 /* libcurl.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/curl/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF541E180E4013000584C8 /* spidermonkey */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF541F180E4023000584C8 /* prebuilt */,\n\t\t\t);\n\t\t\tname = spidermonkey;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF541F180E4023000584C8 /* prebuilt */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5423180E405B000584C8 /* ios */,\n\t\t\t\t1AAF5420180E4047000584C8 /* mac */,\n\t\t\t);\n\t\t\tname = prebuilt;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5420180E4047000584C8 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5421180E4047000584C8 /* libjs_static.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tpath = ../external/spidermonkey/prebuilt/mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5423180E405B000584C8 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5424180E405B000584C8 /* libjs_static.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../external/spidermonkey/prebuilt/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5426180E409E000584C8 /* scripting */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C785C181A11EC004E5527 /* auto-generated */,\n\t\t\t\t1AAF5428180E409E000584C8 /* javascript */,\n\t\t\t\t1A3B1F49180E887E00497A22 /* lua */,\n\t\t\t);\n\t\t\tname = scripting;\n\t\t\tpath = ../cocos/scripting;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5428180E409E000584C8 /* javascript */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2C78BA181A1257004E5527 /* bindings */,\n\t\t\t);\n\t\t\tpath = javascript;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5849180E40B8000584C8 /* storage */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF584A180E40B9000584C8 /* local-storage */,\n\t\t\t);\n\t\t\tname = storage;\n\t\t\tpath = ../cocos/storage;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF584A180E40B9000584C8 /* local-storage */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF584B180E40B9000584C8 /* Android.mk */,\n\t\t\t\t1AAF584C180E40B9000584C8 /* LocalStorage.cpp */,\n\t\t\t\t1AAF584D180E40B9000584C8 /* LocalStorage.h */,\n\t\t\t\t1AAF584E180E40B9000584C8 /* LocalStorageAndroid.cpp */,\n\t\t\t);\n\t\t\tpath = \"local-storage\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AD71CF7180E26E600808F54 /* editor-support */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AD71CF8180E26E600808F54 /* cocosbuilder */,\n\t\t\t\t1A8C5946180E930E00EF57C3 /* cocostudio */,\n\t\t\t\t1AD71D7C180E26E600808F54 /* spine */,\n\t\t\t);\n\t\t\tname = \"editor-support\";\n\t\t\tpath = \"../cocos/editor-support\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AD71CF8180E26E600808F54 /* cocosbuilder */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AD71CFA180E26E600808F54 /* CCBAnimationManager.cpp */,\n\t\t\t\t1AD71CFB180E26E600808F54 /* CCBAnimationManager.h */,\n\t\t\t\t1AD71CFC180E26E600808F54 /* CCBFileLoader.cpp */,\n\t\t\t\t1AD71CFD180E26E600808F54 /* CCBFileLoader.h */,\n\t\t\t\t1AD71CFE180E26E600808F54 /* CCBKeyframe.cpp */,\n\t\t\t\t1AD71CFF180E26E600808F54 /* CCBKeyframe.h */,\n\t\t\t\t1AD71D00180E26E600808F54 /* CCBMemberVariableAssigner.h */,\n\t\t\t\t1AD71D01180E26E600808F54 /* CCBReader.cpp */,\n\t\t\t\t1AD71D02180E26E600808F54 /* CCBReader.h */,\n\t\t\t\t1AD71D03180E26E600808F54 /* CCBSelectorResolver.h */,\n\t\t\t\t1AD71D04180E26E600808F54 /* CCBSequence.cpp */,\n\t\t\t\t1AD71D05180E26E600808F54 /* CCBSequence.h */,\n\t\t\t\t1AD71D06180E26E600808F54 /* CCBSequenceProperty.cpp */,\n\t\t\t\t1AD71D07180E26E600808F54 /* CCBSequenceProperty.h */,\n\t\t\t\t1AD71D0A180E26E600808F54 /* CCControlButtonLoader.cpp */,\n\t\t\t\t1AD71D0B180E26E600808F54 /* CCControlButtonLoader.h */,\n\t\t\t\t1AD71D0C180E26E600808F54 /* CCControlLoader.cpp */,\n\t\t\t\t1AD71D0D180E26E600808F54 /* CCControlLoader.h */,\n\t\t\t\t1AD71D0E180E26E600808F54 /* CCLabelBMFontLoader.cpp */,\n\t\t\t\t1AD71D0F180E26E600808F54 /* CCLabelBMFontLoader.h */,\n\t\t\t\t1AD71D10180E26E600808F54 /* CCLabelTTFLoader.cpp */,\n\t\t\t\t1AD71D11180E26E600808F54 /* CCLabelTTFLoader.h */,\n\t\t\t\t1AD71D12180E26E600808F54 /* CCLayerColorLoader.cpp */,\n\t\t\t\t1AD71D13180E26E600808F54 /* CCLayerColorLoader.h */,\n\t\t\t\t1AD71D14180E26E600808F54 /* CCLayerGradientLoader.cpp */,\n\t\t\t\t1AD71D15180E26E600808F54 /* CCLayerGradientLoader.h */,\n\t\t\t\t1AD71D16180E26E600808F54 /* CCLayerLoader.cpp */,\n\t\t\t\t1AD71D17180E26E600808F54 /* CCLayerLoader.h */,\n\t\t\t\t1AD71D18180E26E600808F54 /* CCMenuItemImageLoader.cpp */,\n\t\t\t\t1AD71D19180E26E600808F54 /* CCMenuItemImageLoader.h */,\n\t\t\t\t1AD71D1A180E26E600808F54 /* CCMenuItemLoader.cpp */,\n\t\t\t\t1AD71D1B180E26E600808F54 /* CCMenuItemLoader.h */,\n\t\t\t\t1AD71D1C180E26E600808F54 /* CCMenuLoader.h */,\n\t\t\t\t1AD71D1D180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp */,\n\t\t\t\t1AD71D1E180E26E600808F54 /* CCNode+CCBRelativePositioning.h */,\n\t\t\t\t1AD71D1F180E26E600808F54 /* CCNodeLoader.cpp */,\n\t\t\t\t1AD71D20180E26E600808F54 /* CCNodeLoader.h */,\n\t\t\t\t1AD71D21180E26E600808F54 /* CCNodeLoaderLibrary.cpp */,\n\t\t\t\t1AD71D22180E26E600808F54 /* CCNodeLoaderLibrary.h */,\n\t\t\t\t1AD71D23180E26E600808F54 /* CCNodeLoaderListener.h */,\n\t\t\t\t1AD71D24180E26E600808F54 /* CCParticleSystemQuadLoader.cpp */,\n\t\t\t\t1AD71D25180E26E600808F54 /* CCParticleSystemQuadLoader.h */,\n\t\t\t\t1AD71D26180E26E600808F54 /* CCScale9SpriteLoader.cpp */,\n\t\t\t\t1AD71D27180E26E600808F54 /* CCScale9SpriteLoader.h */,\n\t\t\t\t1AD71D28180E26E600808F54 /* CCScrollViewLoader.cpp */,\n\t\t\t\t1AD71D29180E26E600808F54 /* CCScrollViewLoader.h */,\n\t\t\t\t1AD71D2A180E26E600808F54 /* CCSpriteLoader.cpp */,\n\t\t\t\t1AD71D2B180E26E600808F54 /* CCSpriteLoader.h */,\n\t\t\t\t1AD71D2C180E26E600808F54 /* CocosBuilder.h */,\n\t\t\t);\n\t\t\tpath = cocosbuilder;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AD71D7C180E26E600808F54 /* spine */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t2AC795D918628689005EC8E1 /* SkeletonBounds.cpp */,\n\t\t\t\t2AC795DA18628689005EC8E1 /* SkeletonBounds.h */,\n\t\t\t\t2AC795D51862867D005EC8E1 /* Event.cpp */,\n\t\t\t\t2AC795D61862867D005EC8E1 /* Event.h */,\n\t\t\t\t2AC795D71862867D005EC8E1 /* EventData.cpp */,\n\t\t\t\t2AC795D81862867D005EC8E1 /* EventData.h */,\n\t\t\t\t2AC795D318628672005EC8E1 /* BoundingBoxAttachment.cpp */,\n\t\t\t\t2AC795D418628672005EC8E1 /* BoundingBoxAttachment.h */,\n\t\t\t\t1AD71D7E180E26E600808F54 /* Animation.cpp */,\n\t\t\t\t1AD71D7F180E26E600808F54 /* Animation.h */,\n\t\t\t\t1AD71D80180E26E600808F54 /* AnimationState.cpp */,\n\t\t\t\t1AD71D81180E26E600808F54 /* AnimationState.h */,\n\t\t\t\t1AD71D82180E26E600808F54 /* AnimationStateData.cpp */,\n\t\t\t\t1AD71D83180E26E600808F54 /* AnimationStateData.h */,\n\t\t\t\t1AD71D84180E26E600808F54 /* Atlas.cpp */,\n\t\t\t\t1AD71D85180E26E600808F54 /* Atlas.h */,\n\t\t\t\t1AD71D86180E26E600808F54 /* AtlasAttachmentLoader.cpp */,\n\t\t\t\t1AD71D87180E26E600808F54 /* AtlasAttachmentLoader.h */,\n\t\t\t\t1AD71D88180E26E600808F54 /* Attachment.cpp */,\n\t\t\t\t1AD71D89180E26E600808F54 /* Attachment.h */,\n\t\t\t\t1AD71D8A180E26E600808F54 /* AttachmentLoader.cpp */,\n\t\t\t\t1AD71D8B180E26E600808F54 /* AttachmentLoader.h */,\n\t\t\t\t1AD71D8C180E26E600808F54 /* Bone.cpp */,\n\t\t\t\t1AD71D8D180E26E600808F54 /* Bone.h */,\n\t\t\t\t1AD71D8E180E26E600808F54 /* BoneData.cpp */,\n\t\t\t\t1AD71D8F180E26E600808F54 /* BoneData.h */,\n\t\t\t\t1AD71D90180E26E600808F54 /* CCSkeleton.cpp */,\n\t\t\t\t1AD71D91180E26E600808F54 /* CCSkeleton.h */,\n\t\t\t\t1AD71D92180E26E600808F54 /* CCSkeletonAnimation.cpp */,\n\t\t\t\t1AD71D93180E26E600808F54 /* CCSkeletonAnimation.h */,\n\t\t\t\t1AD71D94180E26E600808F54 /* extension.cpp */,\n\t\t\t\t1AD71D95180E26E600808F54 /* extension.h */,\n\t\t\t\t1AD71D96180E26E600808F54 /* Json.cpp */,\n\t\t\t\t1AD71D97180E26E600808F54 /* Json.h */,\n\t\t\t\t1AD71D98180E26E600808F54 /* RegionAttachment.cpp */,\n\t\t\t\t1AD71D99180E26E600808F54 /* RegionAttachment.h */,\n\t\t\t\t1AD71D9A180E26E600808F54 /* Skeleton.cpp */,\n\t\t\t\t1AD71D9B180E26E600808F54 /* Skeleton.h */,\n\t\t\t\t1AD71D9C180E26E600808F54 /* SkeletonData.cpp */,\n\t\t\t\t1AD71D9D180E26E600808F54 /* SkeletonData.h */,\n\t\t\t\t1AD71D9E180E26E600808F54 /* SkeletonJson.cpp */,\n\t\t\t\t1AD71D9F180E26E600808F54 /* SkeletonJson.h */,\n\t\t\t\t1AD71DA0180E26E600808F54 /* Skin.cpp */,\n\t\t\t\t1AD71DA1180E26E600808F54 /* Skin.h */,\n\t\t\t\t1AD71DA2180E26E600808F54 /* Slot.cpp */,\n\t\t\t\t1AD71DA3180E26E600808F54 /* Slot.h */,\n\t\t\t\t1AD71DA4180E26E600808F54 /* SlotData.cpp */,\n\t\t\t\t1AD71DA5180E26E600808F54 /* SlotData.h */,\n\t\t\t\t1AD71DA6180E26E600808F54 /* spine-cocos2dx.cpp */,\n\t\t\t\t1AD71DA7180E26E600808F54 /* spine-cocos2dx.h */,\n\t\t\t\t1AD71DA8180E26E600808F54 /* spine.h */,\n\t\t\t);\n\t\t\tpath = spine;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AD71EEB180E27CF00808F54 /* physics-nodes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AD71EEC180E27CF00808F54 /* CCPhysicsDebugNode.cpp */,\n\t\t\t\t1AD71EED180E27CF00808F54 /* CCPhysicsDebugNode.h */,\n\t\t\t\t1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */,\n\t\t\t\t1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */,\n\t\t\t);\n\t\t\tpath = \"physics-nodes\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AD71EF8180E28C400808F54 /* json */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t37936A341869B76800E974DD /* document.h */,\n\t\t\t\t37936A351869B76800E974DD /* filestream.h */,\n\t\t\t\t37936A361869B76800E974DD /* internal */,\n\t\t\t\t37936A3A1869B76800E974DD /* prettywriter.h */,\n\t\t\t\t37936A3B1869B76800E974DD /* rapidjson.h */,\n\t\t\t\t37936A3C1869B76800E974DD /* reader.h */,\n\t\t\t\t37936A3D1869B76800E974DD /* stringbuffer.h */,\n\t\t\t\t37936A3E1869B76800E974DD /* writer.h */,\n\t\t\t);\n\t\t\tname = json;\n\t\t\tpath = ../external/json;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t37936A361869B76800E974DD /* internal */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t37936A371869B76800E974DD /* pow10.h */,\n\t\t\t\t37936A381869B76800E974DD /* stack.h */,\n\t\t\t\t37936A391869B76800E974DD /* strfunc.h */,\n\t\t\t);\n\t\t\tpath = internal;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t3EEF8BD01839F5A7005E8A6C /* gui */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3EEF8BD11839F5C5005E8A6C /* jsb_cocos2dx_gui_manual.cpp */,\n\t\t\t\t3EEF8BD21839F5C5005E8A6C /* jsb_cocos2dx_gui_manual.h */,\n\t\t\t);\n\t\t\tname = gui;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A15FD01807A56F005B8026 /* audio */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A15FE01807A56F005B8026 /* include */,\n\t\t\t\t46A15FE31807A56F005B8026 /* ios */,\n\t\t\t\t46A15FF31807A56F005B8026 /* mac */,\n\t\t\t);\n\t\t\tname = audio;\n\t\t\tpath = ../cocos/audio;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A15FE01807A56F005B8026 /* include */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A15FE11807A56F005B8026 /* Export.h */,\n\t\t\t\t46A15FE21807A56F005B8026 /* SimpleAudioEngine.h */,\n\t\t\t);\n\t\t\tpath = include;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A15FE31807A56F005B8026 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A15FE41807A56F005B8026 /* CDAudioManager.h */,\n\t\t\t\t46A15FE51807A56F005B8026 /* CDAudioManager.m */,\n\t\t\t\t46A15FE61807A56F005B8026 /* CDConfig.h */,\n\t\t\t\t46A15FE71807A56F005B8026 /* CDOpenALSupport.h */,\n\t\t\t\t46A15FE81807A56F005B8026 /* CDOpenALSupport.m */,\n\t\t\t\t46A15FE91807A56F005B8026 /* CocosDenshion.h */,\n\t\t\t\t46A15FEA1807A56F005B8026 /* CocosDenshion.m */,\n\t\t\t\t46A15FEB1807A56F005B8026 /* SimpleAudioEngine.mm */,\n\t\t\t\t46A15FEC1807A56F005B8026 /* SimpleAudioEngine_objc.h */,\n\t\t\t\t46A15FED1807A56F005B8026 /* SimpleAudioEngine_objc.m */,\n\t\t\t);\n\t\t\tpath = ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A15FF31807A56F005B8026 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A15FF41807A56F005B8026 /* CDAudioManager.h */,\n\t\t\t\t46A15FF51807A56F005B8026 /* CDAudioManager.m */,\n\t\t\t\t46A15FF61807A56F005B8026 /* CDConfig.h */,\n\t\t\t\t46A15FF71807A56F005B8026 /* CDOpenALSupport.h */,\n\t\t\t\t46A15FF81807A56F005B8026 /* CDOpenALSupport.m */,\n\t\t\t\t46A15FF91807A56F005B8026 /* CDXMacOSXSupport.h */,\n\t\t\t\t46A15FFA1807A56F005B8026 /* CDXMacOSXSupport.mm */,\n\t\t\t\t46A15FFB1807A56F005B8026 /* CocosDenshion.h */,\n\t\t\t\t46A15FFC1807A56F005B8026 /* CocosDenshion.m */,\n\t\t\t\t46A15FFD1807A56F005B8026 /* SimpleAudioEngine.mm */,\n\t\t\t\t46A15FFE1807A56F005B8026 /* SimpleAudioEngine_objc.h */,\n\t\t\t\t46A15FFF1807A56F005B8026 /* SimpleAudioEngine_objc.m */,\n\t\t\t);\n\t\t\tpath = mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A167981807AF4D005B8026 /* extensions */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A167D21807AF4D005B8026 /* cocos-ext.h */,\n\t\t\t\t46A168321807AF4E005B8026 /* ExtensionMacros.h */,\n\t\t\t\t1AAF5350180E305F000584C8 /* assets-manager */,\n\t\t\t\t46A168331807AF4E005B8026 /* GUI */,\n\t\t\t\t1AD71EEB180E27CF00808F54 /* physics-nodes */,\n\t\t\t);\n\t\t\tname = extensions;\n\t\t\tpath = ../extensions;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168331807AF4E005B8026 /* GUI */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168341807AF4E005B8026 /* CCControlExtension */,\n\t\t\t\t46A1684E1807AF4E005B8026 /* CCEditBox */,\n\t\t\t\t46A1685D1807AF4E005B8026 /* CCScrollView */,\n\t\t\t);\n\t\t\tpath = GUI;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168341807AF4E005B8026 /* CCControlExtension */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168351807AF4E005B8026 /* CCControl.cpp */,\n\t\t\t\t46A168361807AF4E005B8026 /* CCControl.h */,\n\t\t\t\t46A168371807AF4E005B8026 /* CCControlButton.cpp */,\n\t\t\t\t46A168381807AF4E005B8026 /* CCControlButton.h */,\n\t\t\t\t46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */,\n\t\t\t\t46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */,\n\t\t\t\t46A1683B1807AF4E005B8026 /* CCControlExtensions.h */,\n\t\t\t\t46A1683C1807AF4E005B8026 /* CCControlHuePicker.cpp */,\n\t\t\t\t46A1683D1807AF4E005B8026 /* CCControlHuePicker.h */,\n\t\t\t\t46A1683E1807AF4E005B8026 /* CCControlPotentiometer.cpp */,\n\t\t\t\t46A1683F1807AF4E005B8026 /* CCControlPotentiometer.h */,\n\t\t\t\t46A168401807AF4E005B8026 /* CCControlSaturationBrightnessPicker.cpp */,\n\t\t\t\t46A168411807AF4E005B8026 /* CCControlSaturationBrightnessPicker.h */,\n\t\t\t\t46A168421807AF4E005B8026 /* CCControlSlider.cpp */,\n\t\t\t\t46A168431807AF4E005B8026 /* CCControlSlider.h */,\n\t\t\t\t46A168441807AF4E005B8026 /* CCControlStepper.cpp */,\n\t\t\t\t46A168451807AF4E005B8026 /* CCControlStepper.h */,\n\t\t\t\t46A168461807AF4E005B8026 /* CCControlSwitch.cpp */,\n\t\t\t\t46A168471807AF4E005B8026 /* CCControlSwitch.h */,\n\t\t\t\t46A168481807AF4E005B8026 /* CCControlUtils.cpp */,\n\t\t\t\t46A168491807AF4E005B8026 /* CCControlUtils.h */,\n\t\t\t\t46A1684A1807AF4E005B8026 /* CCInvocation.cpp */,\n\t\t\t\t46A1684B1807AF4E005B8026 /* CCInvocation.h */,\n\t\t\t\t46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */,\n\t\t\t\t46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */,\n\t\t\t);\n\t\t\tpath = CCControlExtension;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1684E1807AF4E005B8026 /* CCEditBox */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1684F1807AF4E005B8026 /* CCEditBox.cpp */,\n\t\t\t\t46A168501807AF4E005B8026 /* CCEditBox.h */,\n\t\t\t\t46A168511807AF4E005B8026 /* CCEditBoxImpl.h */,\n\t\t\t\t46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */,\n\t\t\t\t46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */,\n\t\t\t\t46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */,\n\t\t\t\t46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */,\n\t\t\t\t46A168561807AF4E005B8026 /* CCEditBoxImplMac.h */,\n\t\t\t\t46A168571807AF4E005B8026 /* CCEditBoxImplMac.mm */,\n\t\t\t\t46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */,\n\t\t\t\t46A168591807AF4E005B8026 /* CCEditBoxImplTizen.cpp */,\n\t\t\t\t46A1685A1807AF4E005B8026 /* CCEditBoxImplTizen.h */,\n\t\t\t\t46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */,\n\t\t\t\t46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */,\n\t\t\t);\n\t\t\tpath = CCEditBox;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1685D1807AF4E005B8026 /* CCScrollView */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1685E1807AF4E005B8026 /* CCScrollView.cpp */,\n\t\t\t\t46A1685F1807AF4E005B8026 /* CCScrollView.h */,\n\t\t\t\t46A168621807AF4E005B8026 /* CCTableView.cpp */,\n\t\t\t\t46A168631807AF4E005B8026 /* CCTableView.h */,\n\t\t\t\t46A168641807AF4E005B8026 /* CCTableViewCell.cpp */,\n\t\t\t\t46A168651807AF4E005B8026 /* CCTableViewCell.h */,\n\t\t\t);\n\t\t\tpath = CCScrollView;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168B21807AF9C005B8026 /* Box2D */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168B31807AF9C005B8026 /* Android.mk */,\n\t\t\t\t46A168B41807AF9C005B8026 /* Box2D.h */,\n\t\t\t\t46A168B51807AF9C005B8026 /* Collision */,\n\t\t\t\t46A168CD1807AF9C005B8026 /* Common */,\n\t\t\t\t46A168DB1807AF9C005B8026 /* Dynamics */,\n\t\t\t\t46A169311807AF9C005B8026 /* Rope */,\n\t\t\t);\n\t\t\tname = Box2D;\n\t\t\tpath = ../external/Box2D;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168B51807AF9C005B8026 /* Collision */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168B61807AF9C005B8026 /* b2BroadPhase.cpp */,\n\t\t\t\t46A168B71807AF9C005B8026 /* b2BroadPhase.h */,\n\t\t\t\t46A168B81807AF9C005B8026 /* b2CollideCircle.cpp */,\n\t\t\t\t46A168B91807AF9C005B8026 /* b2CollideEdge.cpp */,\n\t\t\t\t46A168BA1807AF9C005B8026 /* b2CollidePolygon.cpp */,\n\t\t\t\t46A168BB1807AF9C005B8026 /* b2Collision.cpp */,\n\t\t\t\t46A168BC1807AF9C005B8026 /* b2Collision.h */,\n\t\t\t\t46A168BD1807AF9C005B8026 /* b2Distance.cpp */,\n\t\t\t\t46A168BE1807AF9C005B8026 /* b2Distance.h */,\n\t\t\t\t46A168BF1807AF9C005B8026 /* b2DynamicTree.cpp */,\n\t\t\t\t46A168C01807AF9C005B8026 /* b2DynamicTree.h */,\n\t\t\t\t46A168C11807AF9C005B8026 /* b2TimeOfImpact.cpp */,\n\t\t\t\t46A168C21807AF9C005B8026 /* b2TimeOfImpact.h */,\n\t\t\t\t46A168C31807AF9C005B8026 /* Shapes */,\n\t\t\t);\n\t\t\tpath = Collision;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168C31807AF9C005B8026 /* Shapes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168C41807AF9C005B8026 /* b2ChainShape.cpp */,\n\t\t\t\t46A168C51807AF9C005B8026 /* b2ChainShape.h */,\n\t\t\t\t46A168C61807AF9C005B8026 /* b2CircleShape.cpp */,\n\t\t\t\t46A168C71807AF9C005B8026 /* b2CircleShape.h */,\n\t\t\t\t46A168C81807AF9C005B8026 /* b2EdgeShape.cpp */,\n\t\t\t\t46A168C91807AF9C005B8026 /* b2EdgeShape.h */,\n\t\t\t\t46A168CA1807AF9C005B8026 /* b2PolygonShape.cpp */,\n\t\t\t\t46A168CB1807AF9C005B8026 /* b2PolygonShape.h */,\n\t\t\t\t46A168CC1807AF9C005B8026 /* b2Shape.h */,\n\t\t\t);\n\t\t\tpath = Shapes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168CD1807AF9C005B8026 /* Common */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168CE1807AF9C005B8026 /* b2BlockAllocator.cpp */,\n\t\t\t\t46A168CF1807AF9C005B8026 /* b2BlockAllocator.h */,\n\t\t\t\t46A168D01807AF9C005B8026 /* b2Draw.cpp */,\n\t\t\t\t46A168D11807AF9C005B8026 /* b2Draw.h */,\n\t\t\t\t46A168D21807AF9C005B8026 /* b2GrowableStack.h */,\n\t\t\t\t46A168D31807AF9C005B8026 /* b2Math.cpp */,\n\t\t\t\t46A168D41807AF9C005B8026 /* b2Math.h */,\n\t\t\t\t46A168D51807AF9C005B8026 /* b2Settings.cpp */,\n\t\t\t\t46A168D61807AF9C005B8026 /* b2Settings.h */,\n\t\t\t\t46A168D71807AF9C005B8026 /* b2StackAllocator.cpp */,\n\t\t\t\t46A168D81807AF9C005B8026 /* b2StackAllocator.h */,\n\t\t\t\t46A168D91807AF9C005B8026 /* b2Timer.cpp */,\n\t\t\t\t46A168DA1807AF9C005B8026 /* b2Timer.h */,\n\t\t\t);\n\t\t\tpath = Common;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168DB1807AF9C005B8026 /* Dynamics */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168DC1807AF9C005B8026 /* b2Body.cpp */,\n\t\t\t\t46A168DD1807AF9C005B8026 /* b2Body.h */,\n\t\t\t\t46A168DE1807AF9C005B8026 /* b2ContactManager.cpp */,\n\t\t\t\t46A168DF1807AF9C005B8026 /* b2ContactManager.h */,\n\t\t\t\t46A168E01807AF9C005B8026 /* b2Fixture.cpp */,\n\t\t\t\t46A168E11807AF9C005B8026 /* b2Fixture.h */,\n\t\t\t\t46A168E21807AF9C005B8026 /* b2Island.cpp */,\n\t\t\t\t46A168E31807AF9C005B8026 /* b2Island.h */,\n\t\t\t\t46A168E41807AF9C005B8026 /* b2TimeStep.h */,\n\t\t\t\t46A168E51807AF9C005B8026 /* b2World.cpp */,\n\t\t\t\t46A168E61807AF9C005B8026 /* b2World.h */,\n\t\t\t\t46A168E71807AF9C005B8026 /* b2WorldCallbacks.cpp */,\n\t\t\t\t46A168E81807AF9C005B8026 /* b2WorldCallbacks.h */,\n\t\t\t\t46A168E91807AF9C005B8026 /* Contacts */,\n\t\t\t\t46A168FC1807AF9C005B8026 /* Joints */,\n\t\t\t);\n\t\t\tpath = Dynamics;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168E91807AF9C005B8026 /* Contacts */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A168EA1807AF9C005B8026 /* b2ChainAndCircleContact.cpp */,\n\t\t\t\t46A168EB1807AF9C005B8026 /* b2ChainAndCircleContact.h */,\n\t\t\t\t46A168EC1807AF9C005B8026 /* b2ChainAndPolygonContact.cpp */,\n\t\t\t\t46A168ED1807AF9C005B8026 /* b2ChainAndPolygonContact.h */,\n\t\t\t\t46A168EE1807AF9C005B8026 /* b2CircleContact.cpp */,\n\t\t\t\t46A168EF1807AF9C005B8026 /* b2CircleContact.h */,\n\t\t\t\t46A168F01807AF9C005B8026 /* b2Contact.cpp */,\n\t\t\t\t46A168F11807AF9C005B8026 /* b2Contact.h */,\n\t\t\t\t46A168F21807AF9C005B8026 /* b2ContactSolver.cpp */,\n\t\t\t\t46A168F31807AF9C005B8026 /* b2ContactSolver.h */,\n\t\t\t\t46A168F41807AF9C005B8026 /* b2EdgeAndCircleContact.cpp */,\n\t\t\t\t46A168F51807AF9C005B8026 /* b2EdgeAndCircleContact.h */,\n\t\t\t\t46A168F61807AF9C005B8026 /* b2EdgeAndPolygonContact.cpp */,\n\t\t\t\t46A168F71807AF9C005B8026 /* b2EdgeAndPolygonContact.h */,\n\t\t\t\t46A168F81807AF9C005B8026 /* b2PolygonAndCircleContact.cpp */,\n\t\t\t\t46A168F91807AF9C005B8026 /* b2PolygonAndCircleContact.h */,\n\t\t\t\t46A168FA1807AF9C005B8026 /* b2PolygonContact.cpp */,\n\t\t\t\t46A168FB1807AF9C005B8026 /* b2PolygonContact.h */,\n\t\t\t);\n\t\t\tpath = Contacts;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A168FC1807AF9C005B8026 /* Joints */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tB3AF019E1842FBA400A98B85 /* b2MotorJoint.cpp */,\n\t\t\t\tB3AF019F1842FBA400A98B85 /* b2MotorJoint.h */,\n\t\t\t\t46A168FD1807AF9C005B8026 /* b2DistanceJoint.cpp */,\n\t\t\t\t46A168FE1807AF9C005B8026 /* b2DistanceJoint.h */,\n\t\t\t\t46A168FF1807AF9C005B8026 /* b2FrictionJoint.cpp */,\n\t\t\t\t46A169001807AF9C005B8026 /* b2FrictionJoint.h */,\n\t\t\t\t46A169011807AF9C005B8026 /* b2GearJoint.cpp */,\n\t\t\t\t46A169021807AF9C005B8026 /* b2GearJoint.h */,\n\t\t\t\t46A169031807AF9C005B8026 /* b2Joint.cpp */,\n\t\t\t\t46A169041807AF9C005B8026 /* b2Joint.h */,\n\t\t\t\t46A169051807AF9C005B8026 /* b2MouseJoint.cpp */,\n\t\t\t\t46A169061807AF9C005B8026 /* b2MouseJoint.h */,\n\t\t\t\t46A169071807AF9C005B8026 /* b2PrismaticJoint.cpp */,\n\t\t\t\t46A169081807AF9C005B8026 /* b2PrismaticJoint.h */,\n\t\t\t\t46A169091807AF9C005B8026 /* b2PulleyJoint.cpp */,\n\t\t\t\t46A1690A1807AF9C005B8026 /* b2PulleyJoint.h */,\n\t\t\t\t46A1690B1807AF9C005B8026 /* b2RevoluteJoint.cpp */,\n\t\t\t\t46A1690C1807AF9C005B8026 /* b2RevoluteJoint.h */,\n\t\t\t\t46A1690D1807AF9C005B8026 /* b2RopeJoint.cpp */,\n\t\t\t\t46A1690E1807AF9C005B8026 /* b2RopeJoint.h */,\n\t\t\t\t46A1690F1807AF9C005B8026 /* b2WeldJoint.cpp */,\n\t\t\t\t46A169101807AF9C005B8026 /* b2WeldJoint.h */,\n\t\t\t\t46A169111807AF9C005B8026 /* b2WheelJoint.cpp */,\n\t\t\t\t46A169121807AF9C005B8026 /* b2WheelJoint.h */,\n\t\t\t);\n\t\t\tpath = Joints;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A169311807AF9C005B8026 /* Rope */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A169321807AF9C005B8026 /* b2Rope.cpp */,\n\t\t\t\t46A169331807AF9C005B8026 /* b2Rope.h */,\n\t\t\t);\n\t\t\tpath = Rope;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1693A1807AFD6005B8026 /* chipmunk */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1693E1807AFD6005B8026 /* include */,\n\t\t\t\t46A1697A1807AFD6005B8026 /* src */,\n\t\t\t);\n\t\t\tname = chipmunk;\n\t\t\tpath = ../external/chipmunk;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1693E1807AFD6005B8026 /* include */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1693F1807AFD6005B8026 /* chipmunk */,\n\t\t\t);\n\t\t\tpath = include;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1693F1807AFD6005B8026 /* chipmunk */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A169401807AFD6005B8026 /* chipmunk.h */,\n\t\t\t\t46A169411807AFD6005B8026 /* chipmunk_ffi.h */,\n\t\t\t\t46A169421807AFD6005B8026 /* chipmunk_private.h */,\n\t\t\t\t46A169431807AFD6005B8026 /* chipmunk_types.h */,\n\t\t\t\t46A169441807AFD6005B8026 /* chipmunk_unsafe.h */,\n\t\t\t\t46A169451807AFD6005B8026 /* constraints */,\n\t\t\t\t46A169521807AFD6005B8026 /* cpArbiter.h */,\n\t\t\t\t46A169531807AFD6005B8026 /* cpBB.h */,\n\t\t\t\t46A169541807AFD6005B8026 /* cpBody.h */,\n\t\t\t\t46A169551807AFD6005B8026 /* cpPolyShape.h */,\n\t\t\t\t46A169561807AFD6005B8026 /* cpShape.h */,\n\t\t\t\t46A169571807AFD6005B8026 /* cpSpace.h */,\n\t\t\t\t46A169581807AFD6005B8026 /* cpSpatialIndex.h */,\n\t\t\t\t46A169591807AFD6005B8026 /* cpVect.h */,\n\t\t\t);\n\t\t\tpath = chipmunk;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A169451807AFD6005B8026 /* constraints */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A169461807AFD6005B8026 /* cpConstraint.h */,\n\t\t\t\t46A169471807AFD6005B8026 /* cpDampedRotarySpring.h */,\n\t\t\t\t46A169481807AFD6005B8026 /* cpDampedSpring.h */,\n\t\t\t\t46A169491807AFD6005B8026 /* cpGearJoint.h */,\n\t\t\t\t46A1694A1807AFD6005B8026 /* cpGrooveJoint.h */,\n\t\t\t\t46A1694B1807AFD6005B8026 /* cpPinJoint.h */,\n\t\t\t\t46A1694C1807AFD6005B8026 /* cpPivotJoint.h */,\n\t\t\t\t46A1694D1807AFD6005B8026 /* cpRatchetJoint.h */,\n\t\t\t\t46A1694E1807AFD6005B8026 /* cpRotaryLimitJoint.h */,\n\t\t\t\t46A1694F1807AFD6005B8026 /* cpSimpleMotor.h */,\n\t\t\t\t46A169501807AFD6005B8026 /* cpSlideJoint.h */,\n\t\t\t\t46A169511807AFD6005B8026 /* util.h */,\n\t\t\t);\n\t\t\tpath = constraints;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1697A1807AFD6005B8026 /* src */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1697B1807AFD6005B8026 /* chipmunk.c */,\n\t\t\t\t46A1697C1807AFD6005B8026 /* CMakeLists.txt */,\n\t\t\t\t46A1697D1807AFD6005B8026 /* constraints */,\n\t\t\t\t46A169891807AFD6005B8026 /* cpArbiter.c */,\n\t\t\t\t46A1698A1807AFD6005B8026 /* cpArray.c */,\n\t\t\t\t46A1698B1807AFD6005B8026 /* cpBB.c */,\n\t\t\t\t46A1698C1807AFD6005B8026 /* cpBBTree.c */,\n\t\t\t\t46A1698D1807AFD6005B8026 /* cpBody.c */,\n\t\t\t\t46A1698E1807AFD6005B8026 /* cpCollision.c */,\n\t\t\t\t46A1698F1807AFD6005B8026 /* cpHashSet.c */,\n\t\t\t\t46A169901807AFD6005B8026 /* cpPolyShape.c */,\n\t\t\t\t46A169911807AFD6005B8026 /* cpShape.c */,\n\t\t\t\t46A169921807AFD6005B8026 /* cpSpace.c */,\n\t\t\t\t46A169931807AFD6005B8026 /* cpSpaceComponent.c */,\n\t\t\t\t46A169941807AFD6005B8026 /* cpSpaceHash.c */,\n\t\t\t\t46A169951807AFD6005B8026 /* cpSpaceQuery.c */,\n\t\t\t\t46A169961807AFD6005B8026 /* cpSpaceStep.c */,\n\t\t\t\t46A169971807AFD6005B8026 /* cpSpatialIndex.c */,\n\t\t\t\t46A169981807AFD6005B8026 /* cpSweep1D.c */,\n\t\t\t\t46A169991807AFD6005B8026 /* cpVect.c */,\n\t\t\t\t46A1699A1807AFD6005B8026 /* prime.h */,\n\t\t\t);\n\t\t\tpath = src;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1697D1807AFD6005B8026 /* constraints */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1697E1807AFD6005B8026 /* cpConstraint.c */,\n\t\t\t\t46A1697F1807AFD6005B8026 /* cpDampedRotarySpring.c */,\n\t\t\t\t46A169801807AFD6005B8026 /* cpDampedSpring.c */,\n\t\t\t\t46A169811807AFD6005B8026 /* cpGearJoint.c */,\n\t\t\t\t46A169821807AFD6005B8026 /* cpGrooveJoint.c */,\n\t\t\t\t46A169831807AFD6005B8026 /* cpPinJoint.c */,\n\t\t\t\t46A169841807AFD6005B8026 /* cpPivotJoint.c */,\n\t\t\t\t46A169851807AFD6005B8026 /* cpRatchetJoint.c */,\n\t\t\t\t46A169861807AFD6005B8026 /* cpRotaryLimitJoint.c */,\n\t\t\t\t46A169871807AFD6005B8026 /* cpSimpleMotor.c */,\n\t\t\t\t46A169881807AFD6005B8026 /* cpSlideJoint.c */,\n\t\t\t);\n\t\t\tpath = constraints;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A169A11807B037005B8026 /* 2d */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DCA47180E6DE3007A3AD4 /* ccTypes.cpp */,\n\t\t\t\t1A9DCA48180E6DE3007A3AD4 /* ccTypes.h */,\n\t\t\t\t1A9DCA41180E6D90007A3AD4 /* CCDeprecated.cpp */,\n\t\t\t\t1A9DCA42180E6D90007A3AD4 /* CCDeprecated.h */,\n\t\t\t\t1A9DC9F8180E6955007A3AD4 /* ccConfig.h */,\n\t\t\t\t1A9DC9F9180E6955007A3AD4 /* CCConfiguration.cpp */,\n\t\t\t\t1A9DC9FA180E6955007A3AD4 /* CCConfiguration.h */,\n\t\t\t\t1A9DC9FD180E6955007A3AD4 /* CCDirector.cpp */,\n\t\t\t\t1A9DC9FE180E6955007A3AD4 /* CCDirector.h */,\n\t\t\t\t1A9DC9FF180E6955007A3AD4 /* CCEventType.h */,\n\t\t\t\t1A9DCA00180E6955007A3AD4 /* ccFPSImages.c */,\n\t\t\t\t1A9DCA01180E6955007A3AD4 /* ccFPSImages.h */,\n\t\t\t\t1A9DCA02180E6955007A3AD4 /* CCGLBufferedNode.cpp */,\n\t\t\t\t1A9DCA03180E6955007A3AD4 /* CCGLBufferedNode.h */,\n\t\t\t\t1A9DCA04180E6955007A3AD4 /* ccMacros.h */,\n\t\t\t\t1A9DCA05180E6955007A3AD4 /* CCProtocols.h */,\n\t\t\t\t1A9DCA06180E6955007A3AD4 /* CCScheduler.cpp */,\n\t\t\t\t1A9DCA07180E6955007A3AD4 /* CCScheduler.h */,\n\t\t\t\t1A9DCA0A180E6955007A3AD4 /* cocos2d.cpp */,\n\t\t\t\t1A9DCA0B180E6955007A3AD4 /* cocos2d.h */,\n\t\t\t\t1A9DCA0C180E6955007A3AD4 /* firePngData.h */,\n\t\t\t\t1A9DCA0D180E6955007A3AD4 /* TransformUtils.cpp */,\n\t\t\t\t1A9DCA0E180E6955007A3AD4 /* TransformUtils.h */,\n\t\t\t\t1A570046180BC59A0088DEC7 /* actions */,\n\t\t\t\t1A570095180BC5B00088DEC7 /* base-nodes */,\n\t\t\t\t1A570109180BC8DC0088DEC7 /* draw-nodes */,\n\t\t\t\t1A570116180BC8FE0088DEC7 /* effects */,\n\t\t\t\t1A570123180BC9270088DEC7 /* event-dispatcher */,\n\t\t\t\t1A570181180BCB170088DEC7 /* label-nodes */,\n\t\t\t\t1A5701D3180BCB670088DEC7 /* layers-scenes-transitions-nodes */,\n\t\t\t\t1A5701F2180BCB970088DEC7 /* menu-nodes */,\n\t\t\t\t1A5701FF180BCBBD0088DEC7 /* misc-nodes */,\n\t\t\t\t1A570218180BCC000088DEC7 /* particle-nodes */,\n\t\t\t\t46A16A5A1807B038005B8026 /* platform */,\n\t\t\t\t1A570231180BCC380088DEC7 /* script-support */,\n\t\t\t\t1A570238180BCC580088DEC7 /* shaders */,\n\t\t\t\t1A570275180BCC840088DEC7 /* sprite-nodes */,\n\t\t\t\t1A57029A180BCD4F0088DEC7 /* support */,\n\t\t\t\t1A5702BC180BCE0A0088DEC7 /* text-input-node */,\n\t\t\t\t1A5702CC180BCE410088DEC7 /* textures */,\n\t\t\t\t1A5702DF180BCE610088DEC7 /* tilemap-parallax-nodes */,\n\t\t\t\t74AC83D91006ABC123943F35 /* renderer */,\n\t\t\t);\n\t\t\tname = 2d;\n\t\t\tpath = ../cocos/2d;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A16A5A1807B038005B8026 /* platform */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A16AA31807B038005B8026 /* ios */,\n\t\t\t\t46A16AC71807B038005B8026 /* mac */,\n\t\t\t\tA04583EF189053B500E32FE8 /* desktop */,\n\t\t\t\t46A16A8E1807B038005B8026 /* apple */,\n\t\t\t\t46A16A941807B038005B8026 /* CCApplicationProtocol.h */,\n\t\t\t\t46A16A951807B038005B8026 /* CCCommon.h */,\n\t\t\t\t46A16A961807B038005B8026 /* CCDevice.h */,\n\t\t\t\t46A16A971807B038005B8026 /* CCEGLViewProtocol.cpp */,\n\t\t\t\t46A16A981807B038005B8026 /* CCEGLViewProtocol.h */,\n\t\t\t\t46A16A991807B038005B8026 /* CCFileUtils.cpp */,\n\t\t\t\t46A16A9A1807B038005B8026 /* CCFileUtils.h */,\n\t\t\t\t46A16A9B1807B038005B8026 /* CCImage.h */,\n\t\t\t\t46A16A9F1807B038005B8026 /* CCSAXParser.cpp */,\n\t\t\t\t46A16AA01807B038005B8026 /* CCSAXParser.h */,\n\t\t\t\t46A16AA11807B038005B8026 /* CCThread.cpp */,\n\t\t\t\t46A16AA21807B038005B8026 /* CCThread.h */,\n\t\t\t);\n\t\t\tpath = platform;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A16A8E1807B038005B8026 /* apple */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A16A8F1807B038005B8026 /* CCFileUtilsApple.h */,\n\t\t\t\t46A16A901807B038005B8026 /* CCFileUtilsApple.mm */,\n\t\t\t\t46A16A911807B038005B8026 /* CCLock.cpp */,\n\t\t\t\t46A16A921807B038005B8026 /* CCLock.h */,\n\t\t\t\t46A16A931807B038005B8026 /* CCThread.mm */,\n\t\t\t);\n\t\t\tpath = apple;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A16AA31807B038005B8026 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A16AA41807B038005B8026 /* CCApplication.h */,\n\t\t\t\t46A16AA51807B038005B8026 /* CCApplication.mm */,\n\t\t\t\t46A16AA61807B038005B8026 /* CCCommon.mm */,\n\t\t\t\t46A16AA71807B038005B8026 /* CCDevice.mm */,\n\t\t\t\t46A16AA81807B038005B8026 /* CCDirectorCaller.h */,\n\t\t\t\t46A16AA91807B038005B8026 /* CCDirectorCaller.mm */,\n\t\t\t\t46A16AAA1807B038005B8026 /* CCEGLView.h */,\n\t\t\t\t46A16AAB1807B038005B8026 /* CCEGLView.mm */,\n\t\t\t\t46A16AAC1807B038005B8026 /* CCES2Renderer.h */,\n\t\t\t\t46A16AAD1807B038005B8026 /* CCES2Renderer.m */,\n\t\t\t\t46A16AAE1807B038005B8026 /* CCESRenderer.h */,\n\t\t\t\t1A0DB7301823827C0025743D /* CCGL.h */,\n\t\t\t\t46A16AB01807B038005B8026 /* CCImage.mm */,\n\t\t\t\t46A16AB11807B038005B8026 /* CCPlatformDefine.h */,\n\t\t\t\t46A16AB21807B038005B8026 /* CCStdC.h */,\n\t\t\t\t1A0DB7311823827C0025743D /* EAGLView.h */,\n\t\t\t\t46A16AB41807B038005B8026 /* EAGLView.mm */,\n\t\t\t\t46A16AB51807B038005B8026 /* OpenGL_Internal.h */,\n\t\t\t\t46A16AB61807B038005B8026 /* Simulation */,\n\t\t\t);\n\t\t\tpath = ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A16AB61807B038005B8026 /* Simulation */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A16AB71807B038005B8026 /* AccelerometerSimulation.h */,\n\t\t\t\t46A16AB81807B038005B8026 /* AccelerometerSimulation.m */,\n\t\t\t);\n\t\t\tpath = Simulation;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A16AC71807B038005B8026 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A16AC81807B038005B8026 /* CCApplication.h */,\n\t\t\t\t46A16AC91807B038005B8026 /* CCApplication.mm */,\n\t\t\t\t46A16ACA1807B038005B8026 /* CCCommon.mm */,\n\t\t\t\t46A16ACB1807B038005B8026 /* CCDevice.cpp */,\n\t\t\t\t46A16ACC1807B038005B8026 /* CCDirectorCaller.h */,\n\t\t\t\t46A16ACD1807B038005B8026 /* CCDirectorCaller.mm */,\n\t\t\t\t1A0DB7351823828F0025743D /* CCGL.h */,\n\t\t\t\t46A16AD31807B038005B8026 /* CCImage.mm */,\n\t\t\t\t46A16AD41807B038005B8026 /* CCPlatformDefine.h */,\n\t\t\t\t46A16AD51807B038005B8026 /* CCStdC.h */,\n\t\t\t);\n\t\t\tpath = mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A170611807CE7A005B8026 /* physics */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A170791807CE7A005B8026 /* chipmunk */,\n\t\t\t\t46A1706E1807CE7A005B8026 /* CCPhysicsBody.cpp */,\n\t\t\t\t46A1706F1807CE7A005B8026 /* CCPhysicsBody.h */,\n\t\t\t\t46A170701807CE7A005B8026 /* CCPhysicsContact.cpp */,\n\t\t\t\t46A170711807CE7A005B8026 /* CCPhysicsContact.h */,\n\t\t\t\t46A170721807CE7A005B8026 /* CCPhysicsJoint.cpp */,\n\t\t\t\t46A170731807CE7A005B8026 /* CCPhysicsJoint.h */,\n\t\t\t\t46A170751807CE7A005B8026 /* CCPhysicsShape.cpp */,\n\t\t\t\t46A170761807CE7A005B8026 /* CCPhysicsShape.h */,\n\t\t\t\t46A170771807CE7A005B8026 /* CCPhysicsWorld.cpp */,\n\t\t\t\t46A170781807CE7A005B8026 /* CCPhysicsWorld.h */,\n\t\t\t);\n\t\t\tname = physics;\n\t\t\tpath = ../cocos/physics;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A170791807CE7A005B8026 /* chipmunk */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tB37510451823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp */,\n\t\t\t\tB37510461823AC7B00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h */,\n\t\t\t\tB37510471823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp */,\n\t\t\t\tB37510481823AC7B00B3BA6A /* CCPhysicsContactInfo_chipmunk.h */,\n\t\t\t\tB37510491823AC7B00B3BA6A /* CCPhysicsHelper_chipmunk.h */,\n\t\t\t\tB375104A1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp */,\n\t\t\t\tB375104B1823AC7B00B3BA6A /* CCPhysicsJointInfo_chipmunk.h */,\n\t\t\t\tB375104C1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp */,\n\t\t\t\tB375104D1823AC7B00B3BA6A /* CCPhysicsShapeInfo_chipmunk.h */,\n\t\t\t\tB375104E1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp */,\n\t\t\t\tB375104F1823AC7B00B3BA6A /* CCPhysicsWorldInfo_chipmunk.h */,\n\t\t\t);\n\t\t\tpath = chipmunk;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A170851807CE87005B8026 /* math */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A170861807CE87005B8026 /* kazmath */,\n\t\t\t);\n\t\t\tname = math;\n\t\t\tpath = ../cocos/math;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A170861807CE87005B8026 /* kazmath */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A170871807CE87005B8026 /* include */,\n\t\t\t\t46A170981807CE87005B8026 /* src */,\n\t\t\t);\n\t\t\tpath = kazmath;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A170871807CE87005B8026 /* include */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A170881807CE87005B8026 /* kazmath */,\n\t\t\t);\n\t\t\tpath = include;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A170881807CE87005B8026 /* kazmath */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A170891807CE87005B8026 /* aabb.h */,\n\t\t\t\t46A1708A1807CE87005B8026 /* GL */,\n\t\t\t\t46A1708D1807CE87005B8026 /* kazmath.h */,\n\t\t\t\t46A1708E1807CE87005B8026 /* mat3.h */,\n\t\t\t\t46A1708F1807CE87005B8026 /* mat4.h */,\n\t\t\t\t46A170901807CE87005B8026 /* neon_matrix_impl.h */,\n\t\t\t\t46A170911807CE87005B8026 /* plane.h */,\n\t\t\t\t46A170921807CE87005B8026 /* quaternion.h */,\n\t\t\t\t46A170931807CE87005B8026 /* ray2.h */,\n\t\t\t\t46A170941807CE87005B8026 /* utility.h */,\n\t\t\t\t46A170951807CE87005B8026 /* vec2.h */,\n\t\t\t\t46A170961807CE87005B8026 /* vec3.h */,\n\t\t\t\t46A170971807CE87005B8026 /* vec4.h */,\n\t\t\t);\n\t\t\tpath = kazmath;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1708A1807CE87005B8026 /* GL */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1708B1807CE87005B8026 /* mat4stack.h */,\n\t\t\t\t46A1708C1807CE87005B8026 /* matrix.h */,\n\t\t\t);\n\t\t\tpath = GL;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A170981807CE87005B8026 /* src */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A170991807CE87005B8026 /* aabb.c */,\n\t\t\t\t46A1709A1807CE87005B8026 /* ChangeLog */,\n\t\t\t\t46A1709B1807CE87005B8026 /* CMakeLists.txt */,\n\t\t\t\t46A1709C1807CE87005B8026 /* GL */,\n\t\t\t\t46A1709F1807CE87005B8026 /* mat3.c */,\n\t\t\t\t46A170A01807CE87005B8026 /* mat4.c */,\n\t\t\t\t46A170A11807CE87005B8026 /* neon_matrix_impl.c */,\n\t\t\t\t46A170A21807CE87005B8026 /* plane.c */,\n\t\t\t\t46A170A31807CE87005B8026 /* quaternion.c */,\n\t\t\t\t46A170A41807CE87005B8026 /* ray2.c */,\n\t\t\t\t46A170A51807CE87005B8026 /* utility.c */,\n\t\t\t\t46A170A61807CE87005B8026 /* vec2.c */,\n\t\t\t\t46A170A71807CE87005B8026 /* vec3.c */,\n\t\t\t\t46A170A81807CE87005B8026 /* vec4.c */,\n\t\t\t);\n\t\t\tpath = src;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A1709C1807CE87005B8026 /* GL */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A1709D1807CE87005B8026 /* mat4stack.c */,\n\t\t\t\t46A1709E1807CE87005B8026 /* matrix.c */,\n\t\t\t);\n\t\t\tpath = GL;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t74AC83D91006ABC123943F35 /* renderer */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50AE5EA1188749250007CFE3 /* CCBatchCommand.cpp */,\n\t\t\t\t50AE5EA2188749250007CFE3 /* CCBatchCommand.h */,\n\t\t\t\tA0E6B27F18613EA5009C5D17 /* CCRenderCommandPool.h */,\n\t\t\t\t593BDCD8184D0A6E00C21E48 /* CCCustomCommand.cpp */,\n\t\t\t\t593BDCD9184D0A6E00C21E48 /* CCCustomCommand.h */,\n\t\t\t\t74AC80EEB031D67E86B45096 /* CCFrustum.cpp */,\n\t\t\t\t74AC840F2F17ED6D0163669F /* CCFrustum.h */,\n\t\t\t\t593BDCDA184D0A6E00C21E48 /* CCGroupCommand.cpp */,\n\t\t\t\t593BDCDB184D0A6E00C21E48 /* CCGroupCommand.h */,\n\t\t\t\t74AC853F6B597094730AFB36 /* CCMaterialManager.cpp */,\n\t\t\t\t74AC800F4905C8827A44EED3 /* CCMaterialManager.h */,\n\t\t\t\t74AC8D28EF93BFF332D3C456 /* CCQuadCommand.cpp */,\n\t\t\t\t74AC8C4AE1EB0FCB287E7396 /* CCQuadCommand.h */,\n\t\t\t\t74AC80F6E92FC29EA536D7F8 /* CCRenderCommand.cpp */,\n\t\t\t\t74AC8F4F7D9E52FCB522B647 /* CCRenderCommand.h */,\n\t\t\t\t74AC8EB8FE47EED9B30B7106 /* CCRenderer.cpp */,\n\t\t\t\t74AC8DF0EA49A124E1B11681 /* CCRenderer.h */,\n\t\t\t\t74AC82DE19B10586E1C39974 /* CCRenderMaterial.cpp */,\n\t\t\t\t74AC8CC6504014E3A59C55B2 /* CCRenderMaterial.h */,\n\t\t\t);\n\t\t\tpath = renderer;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tA04583EF189053B500E32FE8 /* desktop */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tA04583F0189053B500E32FE8 /* CCEGLView.cpp */,\n\t\t\t\tA04583F1189053B500E32FE8 /* CCEGLView.h */,\n\t\t\t);\n\t\t\tpath = desktop;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tB3D8D4471799219B0039C204 /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A16E281807C99F005B8026 /* libwebsockets.a */,\n\t\t\t\t46A16E211807C95C005B8026 /* libfreetype.a */,\n\t\t\t\t46A16E221807C95C005B8026 /* libglfw3.a */,\n\t\t\t\t46A16E231807C95C005B8026 /* libjpeg.a */,\n\t\t\t\t46A16E241807C95C005B8026 /* libpng.a */,\n\t\t\t\t46A16E251807C95C005B8026 /* libtiff.a */,\n\t\t\t\t46A16E261807C95C005B8026 /* libwebp.a */,\n\t\t\t);\n\t\t\tname = mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tB3D8D44B179921D50039C204 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A16E271807C992005B8026 /* libwebsockets.a */,\n\t\t\t\t46A16E1B1807C948005B8026 /* libcurl.a */,\n\t\t\t\t46A16E1C1807C948005B8026 /* libfreetype.a */,\n\t\t\t\t46A16E1D1807C948005B8026 /* libjpeg.a */,\n\t\t\t\t46A16E1E1807C948005B8026 /* libpng.a */,\n\t\t\t\t46A16E1F1807C948005B8026 /* libtiff.a */,\n\t\t\t\t46A16E201807C948005B8026 /* libwebp.a */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t1551A33D158F2AB200E66CFE /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2AC795DF18628723005EC8E1 /* SkeletonBounds.h in Headers */,\n\t\t\t\t2AC795E018628723005EC8E1 /* Event.h in Headers */,\n\t\t\t\t2AC795E118628723005EC8E1 /* EventData.h in Headers */,\n\t\t\t\t2AC795E218628723005EC8E1 /* BoundingBoxAttachment.h in Headers */,\n\t\t\t\t06CAAAC9186AD7EE0012A414 /* TriggerMng.h in Headers */,\n\t\t\t\t46A170B01807CEA3005B8026 /* neon_matrix_impl.h in Headers */,\n\t\t\t\t1ABA68B01888D700007D1BB4 /* CCFontCharMap.h in Headers */,\n\t\t\t\t1AA2063F1848437900053418 /* CCMap.h in Headers */,\n\t\t\t\t46A170191807CBFC005B8026 /* CCCommon.h in Headers */,\n\t\t\t\t46A170E71807CECA005B8026 /* CCPhysicsBody.h in Headers */,\n\t\t\t\t46A170EB1807CECA005B8026 /* CCPhysicsJoint.h in Headers */,\n\t\t\t\t46A170531807CC1C005B8026 /* CCDirectorCaller.h in Headers */,\n\t\t\t\t46A170B71807CEA3005B8026 /* vec4.h in Headers */,\n\t\t\t\t46A170B61807CEA3005B8026 /* vec3.h in Headers */,\n\t\t\t\t50AE5EA5188749250007CFE3 /* CCBatchCommand.h in Headers */,\n\t\t\t\t46A170241807CBFC005B8026 /* CCSAXParser.h in Headers */,\n\t\t\t\t46A1701A1807CBFC005B8026 /* CCDevice.h in Headers */,\n\t\t\t\t46A170161807CBFC005B8026 /* CCLock.h in Headers */,\n\t\t\t\t46A170B31807CEA3005B8026 /* ray2.h in Headers */,\n\t\t\t\t46A170B51807CEA3005B8026 /* vec2.h in Headers */,\n\t\t\t\t46A170B21807CEA3005B8026 /* quaternion.h in Headers */,\n\t\t\t\t46A1701C1807CBFC005B8026 /* CCEGLViewProtocol.h in Headers */,\n\t\t\t\t46A1701E1807CBFC005B8026 /* CCFileUtils.h in Headers */,\n\t\t\t\t46A170B11807CEA3005B8026 /* plane.h in Headers */,\n\t\t\t\tB37510771823AC9F00B3BA6A /* CCPhysicsJointInfo_chipmunk.h in Headers */,\n\t\t\t\t46A1705B1807CC1C005B8026 /* CCPlatformDefine.h in Headers */,\n\t\t\t\t46A170EE1807CECA005B8026 /* CCPhysicsShape.h in Headers */,\n\t\t\t\t46A170AD1807CEA3005B8026 /* kazmath.h in Headers */,\n\t\t\t\t46A170261807CBFC005B8026 /* CCThread.h in Headers */,\n\t\t\t\t46A170AE1807CEA3005B8026 /* mat3.h in Headers */,\n\t\t\t\t46A170AF1807CEA3005B8026 /* mat4.h in Headers */,\n\t\t\t\t46A170AB1807CEA3005B8026 /* mat4stack.h in Headers */,\n\t\t\t\t46A170E91807CECA005B8026 /* CCPhysicsContact.h in Headers */,\n\t\t\t\t46A170B41807CEA3005B8026 /* utility.h in Headers */,\n\t\t\t\tB375107B1823AC9F00B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */,\n\t\t\t\t46A170F01807CECA005B8026 /* CCPhysicsWorld.h in Headers */,\n\t\t\t\t46A170A91807CE9D005B8026 /* aabb.h in Headers */,\n\t\t\t\t46A1705C1807CC1C005B8026 /* CCStdC.h in Headers */,\n\t\t\t\t46A1704F1807CC1C005B8026 /* CCApplication.h in Headers */,\n\t\t\t\t46A170131807CBFC005B8026 /* CCFileUtilsApple.h in Headers */,\n\t\t\t\t46A1701F1807CBFC005B8026 /* CCImage.h in Headers */,\n\t\t\t\t46A170AC1807CEA3005B8026 /* matrix.h in Headers */,\n\t\t\t\t46A170181807CBFC005B8026 /* CCApplicationProtocol.h in Headers */,\n\t\t\t\t1A570063180BC5A10088DEC7 /* CCAction.h in Headers */,\n\t\t\t\t1A570067180BC5A10088DEC7 /* CCActionCamera.h in Headers */,\n\t\t\t\t1A57006B180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */,\n\t\t\t\t1A57006F180BC5A10088DEC7 /* CCActionEase.h in Headers */,\n\t\t\t\t1A570073180BC5A10088DEC7 /* CCActionGrid.h in Headers */,\n\t\t\t\t06CAAAD1186AD8010012A414 /* ObjectFactory.h in Headers */,\n\t\t\t\tA023FA34185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h in Headers */,\n\t\t\t\t1A570077180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */,\n\t\t\t\t1A57007B180BC5A10088DEC7 /* CCActionInstant.h in Headers */,\n\t\t\t\t1A57007F180BC5A10088DEC7 /* CCActionInterval.h in Headers */,\n\t\t\t\tA023FA36185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h in Headers */,\n\t\t\t\t593BDCF8184D0A6E00C21E48 /* CCGroupCommand.h in Headers */,\n\t\t\t\t1A570083180BC5A10088DEC7 /* CCActionManager.h in Headers */,\n\t\t\t\t1A570087180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */,\n\t\t\t\tED9C6A9618599AD8000A5232 /* CCNodeGrid.h in Headers */,\n\t\t\t\t1A57008B180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */,\n\t\t\t\t1A0DB7381823828F0025743D /* CCGL.h in Headers */,\n\t\t\t\t1A57008F180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */,\n\t\t\t\t1A570093180BC5A10088DEC7 /* CCActionTween.h in Headers */,\n\t\t\t\t1A57009A180BC5C10088DEC7 /* CCAtlasNode.h in Headers */,\n\t\t\t\t1A5700A0180BC5D20088DEC7 /* CCNode.h in Headers */,\n\t\t\t\t59A79D531821E26E00F19697 /* CCEventListenerMouse.h in Headers */,\n\t\t\t\t1A5700C7180BC6060088DEC7 /* atitc.h in Headers */,\n\t\t\t\t1A5700CB180BC6060088DEC7 /* CCAffineTransform.h in Headers */,\n\t\t\t\t1A5700CF180BC6060088DEC7 /* CCArray.h in Headers */,\n\t\t\t\t06CAAAC6186AD7E60012A414 /* TriggerObj.h in Headers */,\n\t\t\t\t1A5700D3180BC6060088DEC7 /* CCAutoreleasePool.h in Headers */,\n\t\t\t\t1A5700D5180BC6060088DEC7 /* CCBool.h in Headers */,\n\t\t\t\t1A5700D9180BC6060088DEC7 /* CCData.h in Headers */,\n\t\t\t\t1A5700DD180BC6060088DEC7 /* CCDataVisitor.h in Headers */,\n\t\t\t\t1A5700E1180BC6060088DEC7 /* CCDictionary.h in Headers */,\n\t\t\t\t1A5700E3180BC6060088DEC7 /* CCDouble.h in Headers */,\n\t\t\t\t1A5700E5180BC6060088DEC7 /* CCFloat.h in Headers */,\n\t\t\t\t1A5700E9180BC6060088DEC7 /* CCGeometry.h in Headers */,\n\t\t\t\t1A5700EB180BC6060088DEC7 /* CCInteger.h in Headers */,\n\t\t\t\t1A5700EF180BC6060088DEC7 /* CCNS.h in Headers */,\n\t\t\t\t1A5700F3180BC6060088DEC7 /* CCObject.h in Headers */,\n\t\t\t\t1A5700F5180BC6060088DEC7 /* CCPlatformConfig.h in Headers */,\n\t\t\t\t1A5700F7180BC6060088DEC7 /* CCPlatformMacros.h in Headers */,\n\t\t\t\t1A5700FB180BC6060088DEC7 /* CCSet.h in Headers */,\n\t\t\t\tA04583F3189053B500E32FE8 /* CCEGLView.h in Headers */,\n\t\t\t\t1A5700FF180BC6060088DEC7 /* CCString.h in Headers */,\n\t\t\t\t1A570103180BC6060088DEC7 /* etc1.h in Headers */,\n\t\t\t\t1A570107180BC6060088DEC7 /* s3tc.h in Headers */,\n\t\t\t\t1A570110180BC8EE0088DEC7 /* CCDrawingPrimitives.h in Headers */,\n\t\t\t\tB37510791823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.h in Headers */,\n\t\t\t\t1A570114180BC8EE0088DEC7 /* CCDrawNode.h in Headers */,\n\t\t\t\t1A57011D180BC90D0088DEC7 /* CCGrabber.h in Headers */,\n\t\t\t\t1A570121180BC90D0088DEC7 /* CCGrid.h in Headers */,\n\t\t\t\t1A57013C180BC9460088DEC7 /* CCEvent.h in Headers */,\n\t\t\t\t1A570140180BC9460088DEC7 /* CCEventAcceleration.h in Headers */,\n\t\t\t\t1A570144180BC9460088DEC7 /* CCEventCustom.h in Headers */,\n\t\t\t\t1A570148180BC9460088DEC7 /* CCEventDispatcher.h in Headers */,\n\t\t\t\t1A57014C180BC9460088DEC7 /* CCEventKeyboard.h in Headers */,\n\t\t\t\t1A570150180BC9460088DEC7 /* CCEventListener.h in Headers */,\n\t\t\t\t1A570154180BC9460088DEC7 /* CCEventListenerAcceleration.h in Headers */,\n\t\t\t\t1A570158180BC9460088DEC7 /* CCEventListenerCustom.h in Headers */,\n\t\t\t\t1AE3C846184F14F700CF29B5 /* CCValue.h in Headers */,\n\t\t\t\t1A57015C180BC9460088DEC7 /* CCEventListenerKeyboard.h in Headers */,\n\t\t\t\t1A570160180BC9460088DEC7 /* CCEventListenerTouch.h in Headers */,\n\t\t\t\t1A570164180BC9460088DEC7 /* CCEventTouch.h in Headers */,\n\t\t\t\t1A57019F180BCB590088DEC7 /* CCFont.h in Headers */,\n\t\t\t\t1A5701A3180BCB590088DEC7 /* CCFontAtlas.h in Headers */,\n\t\t\t\t1A5701A7180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */,\n\t\t\t\t1A5701B3180BCB590088DEC7 /* CCFontFNT.h in Headers */,\n\t\t\t\t1A5701B7180BCB5A0088DEC7 /* CCFontFreeType.h in Headers */,\n\t\t\t\t1A5701BB180BCB5A0088DEC7 /* CCLabel.h in Headers */,\n\t\t\t\t1A5701BF180BCB5A0088DEC7 /* CCLabelAtlas.h in Headers */,\n\t\t\t\t1A5701C3180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */,\n\t\t\t\t1A5701C9180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */,\n\t\t\t\t1A5701CD180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */,\n\t\t\t\t1A5701E0180BCB8C0088DEC7 /* CCLayer.h in Headers */,\n\t\t\t\t1A5701E4180BCB8C0088DEC7 /* CCScene.h in Headers */,\n\t\t\t\t1A087AEA1860400400196EF5 /* edtaa3func.h in Headers */,\n\t\t\t\t1A5701E8180BCB8C0088DEC7 /* CCTransition.h in Headers */,\n\t\t\t\t1A5701EC180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */,\n\t\t\t\t1A5701F0180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */,\n\t\t\t\t1A5701F9180BCBAD0088DEC7 /* CCMenu.h in Headers */,\n\t\t\t\t1A5701FD180BCBAD0088DEC7 /* CCMenuItem.h in Headers */,\n\t\t\t\t1A570204180BCBD40088DEC7 /* CCClippingNode.h in Headers */,\n\t\t\t\t1A57020A180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */,\n\t\t\t\t1A570212180BCBF40088DEC7 /* CCProgressTimer.h in Headers */,\n\t\t\t\t1A570216180BCBF40088DEC7 /* CCRenderTexture.h in Headers */,\n\t\t\t\t1A570223180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */,\n\t\t\t\t1A570227180BCC1A0088DEC7 /* CCParticleExamples.h in Headers */,\n\t\t\t\t1A57022B180BCC1A0088DEC7 /* CCParticleSystem.h in Headers */,\n\t\t\t\t1A57022F180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */,\n\t\t\t\t50A1FF1A18290ED4001840C4 /* UIListView.h in Headers */,\n\t\t\t\t1A570236180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */,\n\t\t\t\t1A57024D180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h in Headers */,\n\t\t\t\t1A57024F180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h in Headers */,\n\t\t\t\t1A570251180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h in Headers */,\n\t\t\t\t1A570253180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h in Headers */,\n\t\t\t\t1A570255180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h in Headers */,\n\t\t\t\t1A570257180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h in Headers */,\n\t\t\t\t50691340185016C1009BBDD7 /* CCConsole.h in Headers */,\n\t\t\t\t1A570259180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h in Headers */,\n\t\t\t\t1A57025B180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h in Headers */,\n\t\t\t\t1A57025D180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h in Headers */,\n\t\t\t\t1A57025F180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h in Headers */,\n\t\t\t\t593BDCF4184D0A6E00C21E48 /* CCCustomCommand.h in Headers */,\n\t\t\t\t1A570261180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h in Headers */,\n\t\t\t\t1A570263180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h in Headers */,\n\t\t\t\t1A570265180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h in Headers */,\n\t\t\t\t1A570267180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h in Headers */,\n\t\t\t\t1A570269180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */,\n\t\t\t\t1A57026D180BCC6F0088DEC7 /* CCShaderCache.h in Headers */,\n\t\t\t\t1A57026F180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h in Headers */,\n\t\t\t\t1A570273180BCC6F0088DEC7 /* ccShaders.h in Headers */,\n\t\t\t\t1A570280180BCC900088DEC7 /* CCSprite.h in Headers */,\n\t\t\t\t1A570284180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */,\n\t\t\t\t1A570288180BCC900088DEC7 /* CCSpriteFrame.h in Headers */,\n\t\t\t\t1A57028C180BCC900088DEC7 /* CCSpriteFrameCache.h in Headers */,\n\t\t\t\t1A570294180BCCAB0088DEC7 /* CCAnimation.h in Headers */,\n\t\t\t\t1A570298180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */,\n\t\t\t\t1A57029F180BCD890088DEC7 /* base64.h in Headers */,\n\t\t\t\t1A5702A5180BCD980088DEC7 /* CCNotificationCenter.h in Headers */,\n\t\t\t\t1A5702AB180BCDAA0088DEC7 /* CCProfiling.h in Headers */,\n\t\t\t\t1A5702B1180BCDBC0088DEC7 /* ccUTF8.h in Headers */,\n\t\t\t\t1A5702B7180BCDF40088DEC7 /* CCVertex.h in Headers */,\n\t\t\t\t1A5702BA180BCDFC0088DEC7 /* ccUtils.h in Headers */,\n\t\t\t\t1A5702C0180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */,\n\t\t\t\t1A5702C4180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */,\n\t\t\t\t1A5702CA180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */,\n\t\t\t\t1A5702D5180BCE570088DEC7 /* CCTexture2D.h in Headers */,\n\t\t\t\t1A5702D9180BCE570088DEC7 /* CCTextureAtlas.h in Headers */,\n\t\t\t\t1A5702DD180BCE570088DEC7 /* CCTextureCache.h in Headers */,\n\t\t\t\t1A5702EC180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */,\n\t\t\t\t1A5702F0180BCE750088DEC7 /* CCTMXLayer.h in Headers */,\n\t\t\t\t1A5702F4180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */,\n\t\t\t\t1A5702F8180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */,\n\t\t\t\t1A5702FC180BCE750088DEC7 /* CCTMXXMLParser.h in Headers */,\n\t\t\t\t1A570302180BCE890088DEC7 /* CCParallaxNode.h in Headers */,\n\t\t\t\t1A57030E180BCF190088DEC7 /* CCComponent.h in Headers */,\n\t\t\t\t1A570312180BCF190088DEC7 /* CCComponentContainer.h in Headers */,\n\t\t\t\tB37510751823AC9F00B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */,\n\t\t\t\t1A57031B180BCF430088DEC7 /* ccCArray.h in Headers */,\n\t\t\t\t1A57031D180BCF430088DEC7 /* uthash.h in Headers */,\n\t\t\t\t1A57031F180BCF430088DEC7 /* utlist.h in Headers */,\n\t\t\t\t1A570326180BCF660088DEC7 /* TGAlib.h in Headers */,\n\t\t\t\t1A570331180BCFD50088DEC7 /* CCUserDefault.h in Headers */,\n\t\t\t\t1A57033C180BCFFA0088DEC7 /* ZipUtils.h in Headers */,\n\t\t\t\t1A57034D180BD09B0088DEC7 /* tinyxml2.h in Headers */,\n\t\t\t\t1A570356180BD0B00088DEC7 /* ioapi.h in Headers */,\n\t\t\t\t1A57035A180BD0B00088DEC7 /* unzip.h in Headers */,\n\t\t\t\t1A570535180BD9500088DEC7 /* CCGLProgram.h in Headers */,\n\t\t\t\t1A570539180BD9500088DEC7 /* ccGLStateCache.h in Headers */,\n\t\t\t\t1A570548180BD9C40088DEC7 /* CCTouch.h in Headers */,\n\t\t\t\t1AD71DAB180E26E600808F54 /* CCBAnimationManager.h in Headers */,\n\t\t\t\t1AD71DAF180E26E600808F54 /* CCBFileLoader.h in Headers */,\n\t\t\t\tB37510741823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */,\n\t\t\t\t1AD71DB3180E26E600808F54 /* CCBKeyframe.h in Headers */,\n\t\t\t\t06CAAAC3186AD7D80012A414 /* CCActionEaseEx.h in Headers */,\n\t\t\t\t1AD71DB5180E26E600808F54 /* CCBMemberVariableAssigner.h in Headers */,\n\t\t\t\t1AD71DB9180E26E600808F54 /* CCBReader.h in Headers */,\n\t\t\t\t1AD71DBB180E26E600808F54 /* CCBSelectorResolver.h in Headers */,\n\t\t\t\t1AD71DBF180E26E600808F54 /* CCBSequence.h in Headers */,\n\t\t\t\t1AD71DC3180E26E600808F54 /* CCBSequenceProperty.h in Headers */,\n\t\t\t\t1AD71DCB180E26E600808F54 /* CCControlButtonLoader.h in Headers */,\n\t\t\t\t1AD71DCF180E26E600808F54 /* CCControlLoader.h in Headers */,\n\t\t\t\t1AD71DD3180E26E600808F54 /* CCLabelBMFontLoader.h in Headers */,\n\t\t\t\t1AD71DD7180E26E600808F54 /* CCLabelTTFLoader.h in Headers */,\n\t\t\t\t1AD71DDB180E26E600808F54 /* CCLayerColorLoader.h in Headers */,\n\t\t\t\t1AD71DDF180E26E600808F54 /* CCLayerGradientLoader.h in Headers */,\n\t\t\t\t1AD71DE3180E26E600808F54 /* CCLayerLoader.h in Headers */,\n\t\t\t\t1AD71DE7180E26E600808F54 /* CCMenuItemImageLoader.h in Headers */,\n\t\t\t\t1AD71DEB180E26E600808F54 /* CCMenuItemLoader.h in Headers */,\n\t\t\t\t1AD71DED180E26E600808F54 /* CCMenuLoader.h in Headers */,\n\t\t\t\t1AD71DF1180E26E600808F54 /* CCNode+CCBRelativePositioning.h in Headers */,\n\t\t\t\t1AD71DF5180E26E600808F54 /* CCNodeLoader.h in Headers */,\n\t\t\t\t1AD71DF9180E26E600808F54 /* CCNodeLoaderLibrary.h in Headers */,\n\t\t\t\t1AD71DFB180E26E600808F54 /* CCNodeLoaderListener.h in Headers */,\n\t\t\t\t1AD71DFF180E26E600808F54 /* CCParticleSystemQuadLoader.h in Headers */,\n\t\t\t\t1AD71E03180E26E600808F54 /* CCScale9SpriteLoader.h in Headers */,\n\t\t\t\t1AD71E07180E26E600808F54 /* CCScrollViewLoader.h in Headers */,\n\t\t\t\t1AD71E0B180E26E600808F54 /* CCSpriteLoader.h in Headers */,\n\t\t\t\t1AD71E0D180E26E600808F54 /* CocosBuilder.h in Headers */,\n\t\t\t\t1AD71E97180E26E600808F54 /* Animation.h in Headers */,\n\t\t\t\t1AD71E9B180E26E600808F54 /* AnimationState.h in Headers */,\n\t\t\t\t1AD71E9F180E26E600808F54 /* AnimationStateData.h in Headers */,\n\t\t\t\t1AD71EA3180E26E600808F54 /* Atlas.h in Headers */,\n\t\t\t\t1AD71EA7180E26E600808F54 /* AtlasAttachmentLoader.h in Headers */,\n\t\t\t\t1AD71EAB180E26E600808F54 /* Attachment.h in Headers */,\n\t\t\t\t1AD71EAF180E26E600808F54 /* AttachmentLoader.h in Headers */,\n\t\t\t\t1AD71EB3180E26E600808F54 /* Bone.h in Headers */,\n\t\t\t\t1AD71EB7180E26E600808F54 /* BoneData.h in Headers */,\n\t\t\t\t1AD71EBB180E26E600808F54 /* CCSkeleton.h in Headers */,\n\t\t\t\t1AD71EBF180E26E600808F54 /* CCSkeletonAnimation.h in Headers */,\n\t\t\t\t1AD71EC3180E26E600808F54 /* extension.h in Headers */,\n\t\t\t\t1AD71EC7180E26E600808F54 /* Json.h in Headers */,\n\t\t\t\t06CAAACD186AD7F90012A414 /* TriggerBase.h in Headers */,\n\t\t\t\t1AD71ECB180E26E600808F54 /* RegionAttachment.h in Headers */,\n\t\t\t\t1AD71ECF180E26E600808F54 /* Skeleton.h in Headers */,\n\t\t\t\t1AD71ED3180E26E600808F54 /* SkeletonData.h in Headers */,\n\t\t\t\t1AD71ED7180E26E600808F54 /* SkeletonJson.h in Headers */,\n\t\t\t\t1AD71EDB180E26E600808F54 /* Skin.h in Headers */,\n\t\t\t\t1AD71EDF180E26E600808F54 /* Slot.h in Headers */,\n\t\t\t\t1AD71EE3180E26E600808F54 /* SlotData.h in Headers */,\n\t\t\t\t1AD71EE7180E26E600808F54 /* spine-cocos2dx.h in Headers */,\n\t\t\t\t1AD71EE9180E26E600808F54 /* spine.h in Headers */,\n\t\t\t\t1A85BA0D1845F31700260FC0 /* CCVector.h in Headers */,\n\t\t\t\t1AAF536C180E3374000584C8 /* HttpClient.h in Headers */,\n\t\t\t\t1AAF536E180E3374000584C8 /* HttpRequest.h in Headers */,\n\t\t\t\t1AAF5370180E3374000584C8 /* HttpResponse.h in Headers */,\n\t\t\t\t1AAF5374180E3374000584C8 /* SocketIO.h in Headers */,\n\t\t\t\t373B9129187891F400198F86 /* CCComBase.h in Headers */,\n\t\t\t\t1AAF5378180E3374000584C8 /* WebSocket.h in Headers */,\n\t\t\t\t1AAF5851180E40B9000584C8 /* LocalStorage.h in Headers */,\n\t\t\t\t1A9DCA13180E6955007A3AD4 /* ccConfig.h in Headers */,\n\t\t\t\t1A9DCA17180E6955007A3AD4 /* CCConfiguration.h in Headers */,\n\t\t\t\t1A9DCA1F180E6955007A3AD4 /* CCDirector.h in Headers */,\n\t\t\t\t1A9DCA21180E6955007A3AD4 /* CCEventType.h in Headers */,\n\t\t\t\t1A9DCA25180E6955007A3AD4 /* ccFPSImages.h in Headers */,\n\t\t\t\t1A9DCA29180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */,\n\t\t\t\t1A9DCA2B180E6955007A3AD4 /* ccMacros.h in Headers */,\n\t\t\t\t1A9DCA2D180E6955007A3AD4 /* CCProtocols.h in Headers */,\n\t\t\t\t1A9DCA31180E6955007A3AD4 /* CCScheduler.h in Headers */,\n\t\t\t\t1A9DCA39180E6955007A3AD4 /* cocos2d.h in Headers */,\n\t\t\t\t1A9DCA3B180E6955007A3AD4 /* firePngData.h in Headers */,\n\t\t\t\t1A9DCA3F180E6955007A3AD4 /* TransformUtils.h in Headers */,\n\t\t\t\tB37510721823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */,\n\t\t\t\t1A9DCA45180E6D90007A3AD4 /* CCDeprecated.h in Headers */,\n\t\t\t\t1A9DCA4B180E6DE3007A3AD4 /* ccTypes.h in Headers */,\n\t\t\t\t1A8C58EE180E92CC00EF57C3 /* CocosGUI.h in Headers */,\n\t\t\t\t1A8C58F2180E92CC00EF57C3 /* UILayout.h in Headers */,\n\t\t\t\t1A8C58F6180E92CC00EF57C3 /* UILayoutParameter.h in Headers */,\n\t\t\t\t1A8C58FA180E92CC00EF57C3 /* UIButton.h in Headers */,\n\t\t\t\t1A8C58FE180E92CC00EF57C3 /* UICheckBox.h in Headers */,\n\t\t\t\t1A8C5906180E92CC00EF57C3 /* UIHelper.h in Headers */,\n\t\t\t\t1A8C590A180E92CC00EF57C3 /* UIImageView.h in Headers */,\n\t\t\t\t1A8C5912180E92CC00EF57C3 /* UIText.h in Headers */,\n\t\t\t\t1A8C5916180E92CC00EF57C3 /* UITextAtlas.h in Headers */,\n\t\t\t\t1A8C591A180E92CC00EF57C3 /* UITextBMFont.h in Headers */,\n\t\t\t\t1A8C5922180E92CC00EF57C3 /* UILayoutDefine.h in Headers */,\n\t\t\t\t1A8C592A180E92CC00EF57C3 /* UILoadingBar.h in Headers */,\n\t\t\t\t1A8C592E180E92CC00EF57C3 /* UIPageView.h in Headers */,\n\t\t\t\t1A8C5934180E92CC00EF57C3 /* UIScrollInterface.h in Headers */,\n\t\t\t\t1A8C5938180E92CC00EF57C3 /* UIScrollView.h in Headers */,\n\t\t\t\t1A8C593C180E92CC00EF57C3 /* UISlider.h in Headers */,\n\t\t\t\t1A8C5940180E92CC00EF57C3 /* UITextField.h in Headers */,\n\t\t\t\t1A8C5944180E92CC00EF57C3 /* UIWidget.h in Headers */,\n\t\t\t\t1A8C598D180E930E00EF57C3 /* CCActionFrame.h in Headers */,\n\t\t\t\t1A8C5991180E930E00EF57C3 /* CCActionFrameEasing.h in Headers */,\n\t\t\t\t1A8C5995180E930E00EF57C3 /* CCActionManagerEx.h in Headers */,\n\t\t\t\t1A8C5999180E930E00EF57C3 /* CCActionNode.h in Headers */,\n\t\t\t\t1A8C599D180E930E00EF57C3 /* CCActionObject.h in Headers */,\n\t\t\t\t1A8C59A1180E930E00EF57C3 /* CCArmature.h in Headers */,\n\t\t\t\t1A8C59A5180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */,\n\t\t\t\t1A8C59A9180E930E00EF57C3 /* CCArmatureDataManager.h in Headers */,\n\t\t\t\t1A8C59AD180E930E00EF57C3 /* CCArmatureDefine.h in Headers */,\n\t\t\t\t1A8C59B1180E930E00EF57C3 /* CCBatchNode.h in Headers */,\n\t\t\t\t1A8C59B5180E930E00EF57C3 /* CCBone.h in Headers */,\n\t\t\t\t1A8C59B9180E930E00EF57C3 /* CCColliderDetector.h in Headers */,\n\t\t\t\t1A8C59BD180E930E00EF57C3 /* CCComAttribute.h in Headers */,\n\t\t\t\t1A8C59C1180E930E00EF57C3 /* CCComAudio.h in Headers */,\n\t\t\t\t1A8C59C5180E930E00EF57C3 /* CCComController.h in Headers */,\n\t\t\t\t1A8C59C9180E930E00EF57C3 /* CCComRender.h in Headers */,\n\t\t\t\t1A8C59CD180E930E00EF57C3 /* CCDataReaderHelper.h in Headers */,\n\t\t\t\t1A8C59D1180E930E00EF57C3 /* CCDatas.h in Headers */,\n\t\t\t\t1A8C59D5180E930E00EF57C3 /* CCDecorativeDisplay.h in Headers */,\n\t\t\t\t1A8C59D9180E930E00EF57C3 /* CCDisplayFactory.h in Headers */,\n\t\t\t\t1A8C59DD180E930E00EF57C3 /* CCDisplayManager.h in Headers */,\n\t\t\t\t1A8C59E1180E930E00EF57C3 /* CCInputDelegate.h in Headers */,\n\t\t\t\t1A8C59E5180E930E00EF57C3 /* CCProcessBase.h in Headers */,\n\t\t\t\t1A8C59E9180E930E00EF57C3 /* CCSGUIReader.h in Headers */,\n\t\t\t\t1A8C59ED180E930E00EF57C3 /* CCSkin.h in Headers */,\n\t\t\t\t1A8C59F1180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h in Headers */,\n\t\t\t\t1A8C59F5180E930E00EF57C3 /* CCSSceneReader.h in Headers */,\n\t\t\t\t1A8C59F9180E930E00EF57C3 /* CCTransformHelp.h in Headers */,\n\t\t\t\t1A8C59FD180E930E00EF57C3 /* CCTween.h in Headers */,\n\t\t\t\t1A8C5A01180E930E00EF57C3 /* CCTweenFunction.h in Headers */,\n\t\t\t\t1A8C5A05180E930E00EF57C3 /* CCUtilMath.h in Headers */,\n\t\t\t\t1A8C5A07180E930E00EF57C3 /* CocoStudio.h in Headers */,\n\t\t\t\t59A79D571821E26E00F19697 /* CCEventMouse.h in Headers */,\n\t\t\t\t1A8C5A0F180E930E00EF57C3 /* DictionaryHelper.h in Headers */,\n\t\t\t\t74AC82C9892F007745926C93 /* CCFrustum.h in Headers */,\n\t\t\t\t74AC819B780D9EB49CC421AB /* CCRenderer.h in Headers */,\n\t\t\t\t74AC81CAB5F3883FCC2A4A5B /* CCQuadCommand.h in Headers */,\n\t\t\t\t74AC8E2CDB69E1FDBFCFBD78 /* CCRenderCommand.h in Headers */,\n\t\t\t\t74AC8589A38C358F1E472BBD /* CCRenderMaterial.h in Headers */,\n\t\t\t\t74AC8E3E7D85FB595242AAEC /* CCMaterialManager.h in Headers */,\n\t\t\t\tA0E6B28018613EA5009C5D17 /* CCRenderCommandPool.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A11972F178526AA00D62A44 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1F7B180E88C300497A22 /* CCBProxy.h in Headers */,\n\t\t\t\t15A71D6118921E6900F30AC0 /* auxiliar.h in Headers */,\n\t\t\t\t15A71DA71892291500F30AC0 /* lua_extensions.h in Headers */,\n\t\t\t\t1A3B1F7F180E88C300497A22 /* CCLuaBridge.h in Headers */,\n\t\t\t\t15A71D9518921E6900F30AC0 /* udp.h in Headers */,\n\t\t\t\t15A71D8518921E6900F30AC0 /* socket.h in Headers */,\n\t\t\t\t1A3B1F83180E88C300497A22 /* CCLuaEngine.h in Headers */,\n\t\t\t\t15A71D9D18921E6900F30AC0 /* usocket.h in Headers */,\n\t\t\t\t15CA8D1018697A56000032AB /* lua_cocos2dx_spine_manual.hpp in Headers */,\n\t\t\t\t1A3B1F87180E88C300497A22 /* CCLuaStack.h in Headers */,\n\t\t\t\t15A71D7D18921E6900F30AC0 /* options.h in Headers */,\n\t\t\t\t15A71D9118921E6900F30AC0 /* timeout.h in Headers */,\n\t\t\t\t1A3B1F8B180E88C300497A22 /* CCLuaValue.h in Headers */,\n\t\t\t\t1A3B1F8F180E88C300497A22 /* Cocos2dxLuaLoader.h in Headers */,\n\t\t\t\t15A71D7918921E6900F30AC0 /* mime.h in Headers */,\n\t\t\t\t15A71D8D18921E6900F30AC0 /* tcp.h in Headers */,\n\t\t\t\t1A3B1F93180E88C300497A22 /* lua_cocos2dx_deprecated.h in Headers */,\n\t\t\t\t1A3B1F97180E88C300497A22 /* lua_cocos2dx_extension_manual.h in Headers */,\n\t\t\t\t15A71D9918921E6900F30AC0 /* unix.h in Headers */,\n\t\t\t\t1A3B1F9B180E88C300497A22 /* lua_cocos2dx_manual.hpp in Headers */,\n\t\t\t\t1A3B1F9F180E88C300497A22 /* Lua_web_socket.h in Headers */,\n\t\t\t\t15A71D6918921E6900F30AC0 /* inet.h in Headers */,\n\t\t\t\t1A3B1FA3180E88C300497A22 /* LuaBasicConversions.h in Headers */,\n\t\t\t\t15A71D7518921E6900F30AC0 /* luasocket_io.h in Headers */,\n\t\t\t\t1A3B1FA7180E88C300497A22 /* LuaOpengl.h in Headers */,\n\t\t\t\t1A2C78A9181A11EC004E5527 /* lua_cocos2dx_auto.hpp in Headers */,\n\t\t\t\t1A3B1FAB180E88C300497A22 /* LuaScriptHandlerMgr.h in Headers */,\n\t\t\t\t1A3B1FB7180E88C300497A22 /* CCLuaObjcBridge.h in Headers */,\n\t\t\t\t15A71DA118921E6900F30AC0 /* wsocket.h in Headers */,\n\t\t\t\t15A71D8918921E6900F30AC0 /* socket_scripts.h in Headers */,\n\t\t\t\t15CA8D1C18697BE5000032AB /* LuaSkeletonAnimation.h in Headers */,\n\t\t\t\t1A3B1FBD180E88C300497A22 /* tolua_fix.h in Headers */,\n\t\t\t\t15A71D6518921E6900F30AC0 /* except.h in Headers */,\n\t\t\t\t1A8C5647180E8D0D00EF57C3 /* tolua++.h in Headers */,\n\t\t\t\t158E06E1181F6796008E01F6 /* lua_xml_http_request.h in Headers */,\n\t\t\t\t1A2C78B5181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp in Headers */,\n\t\t\t\t15A71D7118921E6900F30AC0 /* luasocket_buffer.h in Headers */,\n\t\t\t\tB362C3B51872BADF00F0BDF4 /* lua_cocos2dx_physics_manual.hpp in Headers */,\n\t\t\t\t15A71D6D18921E6900F30AC0 /* luasocket.h in Headers */,\n\t\t\t\t15A71D8118921E6900F30AC0 /* select.h in Headers */,\n\t\t\t\t1A8C564B180E8D0D00EF57C3 /* tolua_event.h in Headers */,\n\t\t\t\t15CA8D1618697AE1000032AB /* lua_cocos2dx_spine_auto.hpp in Headers */,\n\t\t\t\tB362C3AF1872BAB700F0BDF4 /* lua_cocos2dx_physics_auto.hpp in Headers */,\n\t\t\t\t1585AB5E1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp in Headers */,\n\t\t\t\t15D6E848182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp in Headers */,\n\t\t\t\t15F4C8851875637D0082884F /* lua_cocos2dx_gui_auto.hpp in Headers */,\n\t\t\t\t15F4CA221875885A0082884F /* lua_cocos2dx_gui_manual.hpp in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB51B17854BC200CDF010 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1F7A180E88C300497A22 /* CCBProxy.h in Headers */,\n\t\t\t\t15A71D6018921E6900F30AC0 /* auxiliar.h in Headers */,\n\t\t\t\t15A71DA61892291500F30AC0 /* lua_extensions.h in Headers */,\n\t\t\t\t1A3B1F7E180E88C300497A22 /* CCLuaBridge.h in Headers */,\n\t\t\t\t15A71D9418921E6900F30AC0 /* udp.h in Headers */,\n\t\t\t\t15A71D8418921E6900F30AC0 /* socket.h in Headers */,\n\t\t\t\t1A3B1F82180E88C300497A22 /* CCLuaEngine.h in Headers */,\n\t\t\t\t15A71D9C18921E6900F30AC0 /* usocket.h in Headers */,\n\t\t\t\t15CA8D0F18697A56000032AB /* lua_cocos2dx_spine_manual.hpp in Headers */,\n\t\t\t\t1A3B1F86180E88C300497A22 /* CCLuaStack.h in Headers */,\n\t\t\t\t15A71D7C18921E6900F30AC0 /* options.h in Headers */,\n\t\t\t\t15A71D9018921E6900F30AC0 /* timeout.h in Headers */,\n\t\t\t\t1A3B1F8A180E88C300497A22 /* CCLuaValue.h in Headers */,\n\t\t\t\t1A3B1F8E180E88C300497A22 /* Cocos2dxLuaLoader.h in Headers */,\n\t\t\t\t15A71D7818921E6900F30AC0 /* mime.h in Headers */,\n\t\t\t\t15A71D8C18921E6900F30AC0 /* tcp.h in Headers */,\n\t\t\t\t1A3B1F92180E88C300497A22 /* lua_cocos2dx_deprecated.h in Headers */,\n\t\t\t\t1A3B1F96180E88C300497A22 /* lua_cocos2dx_extension_manual.h in Headers */,\n\t\t\t\t15A71D9818921E6900F30AC0 /* unix.h in Headers */,\n\t\t\t\t1A3B1F9A180E88C300497A22 /* lua_cocos2dx_manual.hpp in Headers */,\n\t\t\t\t1A3B1F9E180E88C300497A22 /* Lua_web_socket.h in Headers */,\n\t\t\t\t15A71D6818921E6900F30AC0 /* inet.h in Headers */,\n\t\t\t\t1A3B1FA2180E88C300497A22 /* LuaBasicConversions.h in Headers */,\n\t\t\t\t15A71D7418921E6900F30AC0 /* luasocket_io.h in Headers */,\n\t\t\t\t1A3B1FA6180E88C300497A22 /* LuaOpengl.h in Headers */,\n\t\t\t\t1A2C78A7181A11EC004E5527 /* lua_cocos2dx_auto.hpp in Headers */,\n\t\t\t\t1A3B1FAA180E88C300497A22 /* LuaScriptHandlerMgr.h in Headers */,\n\t\t\t\t1A3B1FB6180E88C300497A22 /* CCLuaObjcBridge.h in Headers */,\n\t\t\t\t15A71DA018921E6900F30AC0 /* wsocket.h in Headers */,\n\t\t\t\t15A71D8818921E6900F30AC0 /* socket_scripts.h in Headers */,\n\t\t\t\t15CA8D1B18697BE5000032AB /* LuaSkeletonAnimation.h in Headers */,\n\t\t\t\t1A3B1FBC180E88C300497A22 /* tolua_fix.h in Headers */,\n\t\t\t\t15A71D6418921E6900F30AC0 /* except.h in Headers */,\n\t\t\t\t1A8C5646180E8D0D00EF57C3 /* tolua++.h in Headers */,\n\t\t\t\t158E06E0181F6796008E01F6 /* lua_xml_http_request.h in Headers */,\n\t\t\t\t1A2C78B3181A11EC004E5527 /* lua_cocos2dx_extension_auto.hpp in Headers */,\n\t\t\t\t15A71D7018921E6900F30AC0 /* luasocket_buffer.h in Headers */,\n\t\t\t\tB362C3B31872BADC00F0BDF4 /* lua_cocos2dx_physics_manual.hpp in Headers */,\n\t\t\t\t15A71D6C18921E6900F30AC0 /* luasocket.h in Headers */,\n\t\t\t\t15A71D8018921E6900F30AC0 /* select.h in Headers */,\n\t\t\t\t1A8C564A180E8D0D00EF57C3 /* tolua_event.h in Headers */,\n\t\t\t\t15CA8D1518697AE1000032AB /* lua_cocos2dx_spine_auto.hpp in Headers */,\n\t\t\t\tB362C3B11872BABC00F0BDF4 /* lua_cocos2dx_physics_auto.hpp in Headers */,\n\t\t\t\t1585AB5D1828D74F00000FB5 /* lua_cocos2dx_studio_auto.hpp in Headers */,\n\t\t\t\t15D6E847182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.hpp in Headers */,\n\t\t\t\t15F4C8841875637D0082884F /* lua_cocos2dx_gui_auto.hpp in Headers */,\n\t\t\t\t15F4CA211875885A0082884F /* lua_cocos2dx_gui_manual.hpp in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2C051780BD04006731B9 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A174251807D379005B8026 /* util.h in Headers */,\n\t\t\t\t46A1742D1807D379005B8026 /* cpVect.h in Headers */,\n\t\t\t\t46A1740F1807D365005B8026 /* prime.h in Headers */,\n\t\t\t\t46A174141807D372005B8026 /* chipmunk_unsafe.h in Headers */,\n\t\t\t\t46A174121807D372005B8026 /* chipmunk_private.h in Headers */,\n\t\t\t\t46A174231807D379005B8026 /* cpSimpleMotor.h in Headers */,\n\t\t\t\t46A1741D1807D379005B8026 /* cpGearJoint.h in Headers */,\n\t\t\t\t46A1742B1807D379005B8026 /* cpSpace.h in Headers */,\n\t\t\t\t46A174261807D379005B8026 /* cpArbiter.h in Headers */,\n\t\t\t\t46A174211807D379005B8026 /* cpRatchetJoint.h in Headers */,\n\t\t\t\t46A174111807D372005B8026 /* chipmunk_ffi.h in Headers */,\n\t\t\t\t46A174241807D379005B8026 /* cpSlideJoint.h in Headers */,\n\t\t\t\t46A174221807D379005B8026 /* cpRotaryLimitJoint.h in Headers */,\n\t\t\t\t46A174101807D372005B8026 /* chipmunk.h in Headers */,\n\t\t\t\t46A174131807D372005B8026 /* chipmunk_types.h in Headers */,\n\t\t\t\t46A1741C1807D379005B8026 /* cpDampedSpring.h in Headers */,\n\t\t\t\t46A1741F1807D379005B8026 /* cpPinJoint.h in Headers */,\n\t\t\t\t46A1742A1807D379005B8026 /* cpShape.h in Headers */,\n\t\t\t\t46A174271807D379005B8026 /* cpBB.h in Headers */,\n\t\t\t\t46A1741B1807D379005B8026 /* cpDampedRotarySpring.h in Headers */,\n\t\t\t\t46A1742C1807D379005B8026 /* cpSpatialIndex.h in Headers */,\n\t\t\t\t46A174201807D379005B8026 /* cpPivotJoint.h in Headers */,\n\t\t\t\t46A174281807D379005B8026 /* cpBody.h in Headers */,\n\t\t\t\t46A174291807D379005B8026 /* cpPolyShape.h in Headers */,\n\t\t\t\t46A1741E1807D379005B8026 /* cpGrooveJoint.h in Headers */,\n\t\t\t\t46A1741A1807D379005B8026 /* cpConstraint.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2D7D1780BDF7006731B9 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF528C180E2ECC000584C8 /* b2BroadPhase.h in Headers */,\n\t\t\t\t1AAF5291180E2ECC000584C8 /* b2Collision.h in Headers */,\n\t\t\t\t1AAF5293180E2ECC000584C8 /* b2Distance.h in Headers */,\n\t\t\t\t1AAF5295180E2ECC000584C8 /* b2DynamicTree.h in Headers */,\n\t\t\t\t1AAF5297180E2ECC000584C8 /* b2TimeOfImpact.h in Headers */,\n\t\t\t\t1AAF5298180E2ED2000584C8 /* Box2D.h in Headers */,\n\t\t\t\t1AAF52B1180E2EE9000584C8 /* b2ChainShape.h in Headers */,\n\t\t\t\t1AAF52B3180E2EE9000584C8 /* b2CircleShape.h in Headers */,\n\t\t\t\t1AAF52B5180E2EE9000584C8 /* b2EdgeShape.h in Headers */,\n\t\t\t\t1AAF52B7180E2EE9000584C8 /* b2PolygonShape.h in Headers */,\n\t\t\t\t1AAF52B8180E2EE9000584C8 /* b2Shape.h in Headers */,\n\t\t\t\t1AAF52C7180E2EEF000584C8 /* b2BlockAllocator.h in Headers */,\n\t\t\t\t1AAF52C9180E2EEF000584C8 /* b2Draw.h in Headers */,\n\t\t\t\t1AAF52CA180E2EEF000584C8 /* b2GrowableStack.h in Headers */,\n\t\t\t\t1AAF52CC180E2EEF000584C8 /* b2Math.h in Headers */,\n\t\t\t\t1AAF52CE180E2EEF000584C8 /* b2Settings.h in Headers */,\n\t\t\t\tB3AF01A21842FBA400A98B85 /* b2MotorJoint.h in Headers */,\n\t\t\t\t1AAF52D0180E2EEF000584C8 /* b2StackAllocator.h in Headers */,\n\t\t\t\t1AAF52D2180E2EEF000584C8 /* b2Timer.h in Headers */,\n\t\t\t\t1AAF52D4180E2EF5000584C8 /* b2Body.h in Headers */,\n\t\t\t\t1AAF52D6180E2EF5000584C8 /* b2ContactManager.h in Headers */,\n\t\t\t\t1AAF52D8180E2EF5000584C8 /* b2Fixture.h in Headers */,\n\t\t\t\t1AAF52DA180E2EF5000584C8 /* b2Island.h in Headers */,\n\t\t\t\t1AAF52DB180E2EF5000584C8 /* b2TimeStep.h in Headers */,\n\t\t\t\t1AAF52DD180E2EF5000584C8 /* b2World.h in Headers */,\n\t\t\t\t1AAF52DF180E2EF5000584C8 /* b2WorldCallbacks.h in Headers */,\n\t\t\t\t1AAF5300180E2EFE000584C8 /* b2ChainAndCircleContact.h in Headers */,\n\t\t\t\t1AAF5302180E2EFE000584C8 /* b2ChainAndPolygonContact.h in Headers */,\n\t\t\t\t1AAF5304180E2EFE000584C8 /* b2CircleContact.h in Headers */,\n\t\t\t\t1AAF5306180E2EFE000584C8 /* b2Contact.h in Headers */,\n\t\t\t\t1AAF5308180E2EFE000584C8 /* b2ContactSolver.h in Headers */,\n\t\t\t\t1AAF530A180E2EFE000584C8 /* b2EdgeAndCircleContact.h in Headers */,\n\t\t\t\t1AAF530C180E2EFE000584C8 /* b2EdgeAndPolygonContact.h in Headers */,\n\t\t\t\t1AAF530E180E2EFE000584C8 /* b2PolygonAndCircleContact.h in Headers */,\n\t\t\t\t1AAF5310180E2EFE000584C8 /* b2PolygonContact.h in Headers */,\n\t\t\t\t1AAF5312180E2F04000584C8 /* b2DistanceJoint.h in Headers */,\n\t\t\t\t1AAF5314180E2F04000584C8 /* b2FrictionJoint.h in Headers */,\n\t\t\t\t1AAF5316180E2F04000584C8 /* b2GearJoint.h in Headers */,\n\t\t\t\t1AAF5318180E2F04000584C8 /* b2Joint.h in Headers */,\n\t\t\t\t1AAF531A180E2F04000584C8 /* b2MouseJoint.h in Headers */,\n\t\t\t\t1AAF531C180E2F04000584C8 /* b2PrismaticJoint.h in Headers */,\n\t\t\t\t1AAF531E180E2F04000584C8 /* b2PulleyJoint.h in Headers */,\n\t\t\t\t1AAF5320180E2F04000584C8 /* b2RevoluteJoint.h in Headers */,\n\t\t\t\t1AAF5322180E2F04000584C8 /* b2RopeJoint.h in Headers */,\n\t\t\t\t1AAF5324180E2F04000584C8 /* b2WeldJoint.h in Headers */,\n\t\t\t\t1AAF5326180E2F04000584C8 /* b2WheelJoint.h in Headers */,\n\t\t\t\t1AAF533E180E2F10000584C8 /* b2Rope.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2EB817814268006731B9 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A160421807A5D4005B8026 /* Export.h in Headers */,\n\t\t\t\t46A160471807A5D4005B8026 /* CDOpenALSupport.h in Headers */,\n\t\t\t\t46A160461807A5D4005B8026 /* CDConfig.h in Headers */,\n\t\t\t\t46A160491807A5D4005B8026 /* CDXMacOSXSupport.h in Headers */,\n\t\t\t\t46A160441807A5D4005B8026 /* CDAudioManager.h in Headers */,\n\t\t\t\t46A1604E1807A5D4005B8026 /* SimpleAudioEngine_objc.h in Headers */,\n\t\t\t\t46A160431807A5D4005B8026 /* SimpleAudioEngine.h in Headers */,\n\t\t\t\t46A1604B1807A5D4005B8026 /* CocosDenshion.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2FCA17814595006731B9 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E478318080902000CDD6D /* CCControlExtensions.h in Headers */,\n\t\t\t\t460E477E18080902000CDD6D /* CCControl.h in Headers */,\n\t\t\t\t460E47B11808090B000CDD6D /* CCEditBoxImpl.h in Headers */,\n\t\t\t\t460E47BA1808090B000CDD6D /* CCEditBoxImplTizen.h in Headers */,\n\t\t\t\t460E47B31808090B000CDD6D /* CCEditBoxImplAndroid.h in Headers */,\n\t\t\t\t460E47B61808090B000CDD6D /* CCEditBoxImplMac.h in Headers */,\n\t\t\t\t460E477B180808F5000CDD6D /* ExtensionMacros.h in Headers */,\n\t\t\t\t460E479118080902000CDD6D /* CCControlUtils.h in Headers */,\n\t\t\t\t460E468118080832000CDD6D /* cocos-ext.h in Headers */,\n\t\t\t\t460E47B41808090B000CDD6D /* CCEditBoxImplIOS.h in Headers */,\n\t\t\t\t460E47CC18080913000CDD6D /* CCScrollView.h in Headers */,\n\t\t\t\t460E47B01808090B000CDD6D /* CCEditBox.h in Headers */,\n\t\t\t\t460E478918080902000CDD6D /* CCControlSaturationBrightnessPicker.h in Headers */,\n\t\t\t\t460E47D018080913000CDD6D /* CCTableView.h in Headers */,\n\t\t\t\t460E478F18080902000CDD6D /* CCControlSwitch.h in Headers */,\n\t\t\t\t460E479518080902000CDD6D /* CCScale9Sprite.h in Headers */,\n\t\t\t\t460E478718080902000CDD6D /* CCControlPotentiometer.h in Headers */,\n\t\t\t\t460E47BC1808090B000CDD6D /* CCEditBoxImplWin.h in Headers */,\n\t\t\t\t460E478B18080902000CDD6D /* CCControlSlider.h in Headers */,\n\t\t\t\t460E478218080902000CDD6D /* CCControlColourPicker.h in Headers */,\n\t\t\t\t460E478518080902000CDD6D /* CCControlHuePicker.h in Headers */,\n\t\t\t\t460E479318080902000CDD6D /* CCInvocation.h in Headers */,\n\t\t\t\t460E478018080902000CDD6D /* CCControlButton.h in Headers */,\n\t\t\t\t460E478D18080902000CDD6D /* CCControlStepper.h in Headers */,\n\t\t\t\t460E47D218080913000CDD6D /* CCTableViewCell.h in Headers */,\n\t\t\t\t1AD71EF2180E27CF00808F54 /* CCPhysicsDebugNode.h in Headers */,\n\t\t\t\t1AD71EF6180E27CF00808F54 /* CCPhysicsSprite.h in Headers */,\n\t\t\t\t1AAF5355180E3060000584C8 /* AssetsManager.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F31F11781479B006731B9 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2AFCB8211863D67F00EB4B5C /* jsb_cocos2dx_spine_auto.cpp in Headers */,\n\t\t\t\t1A2C7937181A1257004E5527 /* js_bindings_config.h in Headers */,\n\t\t\t\t1A2C790F181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h in Headers */,\n\t\t\t\t1A2C7935181A1257004E5527 /* jsb_cocos2dx_extension_manual.h in Headers */,\n\t\t\t\t1A2C791F181A1257004E5527 /* js_bindings_chipmunk_registration.h in Headers */,\n\t\t\t\t1A2C7955181A1257004E5527 /* js_bindings_system_functions.h in Headers */,\n\t\t\t\t1A2C7911181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h in Headers */,\n\t\t\t\t1A2C7963181A1257004E5527 /* XMLHTTPRequest.h in Headers */,\n\t\t\t\t1A2C795F181A1257004E5527 /* jsb_websocket.h in Headers */,\n\t\t\t\t1A2C7969181A1257004E5527 /* spidermonkey_specifics.h in Headers */,\n\t\t\t\t1A2C788E181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp in Headers */,\n\t\t\t\t1A2C7923181A1257004E5527 /* cocos2d_specifics.hpp in Headers */,\n\t\t\t\t1A2C7931181A1257004E5527 /* jsb_cocos2dx_studio_manual.h in Headers */,\n\t\t\t\t1A2C789A181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp in Headers */,\n\t\t\t\t1A2C794D181A1257004E5527 /* jsb_opengl_manual.h in Headers */,\n\t\t\t\t1A2C7967181A1257004E5527 /* ScriptingCore.h in Headers */,\n\t\t\t\t1A2C795B181A1257004E5527 /* js_bindings_system_registration.h in Headers */,\n\t\t\t\t1A2C7949181A1257004E5527 /* jsb_opengl_functions.h in Headers */,\n\t\t\t\t1A2C7925181A1257004E5527 /* cocosbuilder_specifics.hpp in Headers */,\n\t\t\t\t1A2C7915181A1257004E5527 /* js_bindings_chipmunk_functions.h in Headers */,\n\t\t\t\t1A2C7917181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h in Headers */,\n\t\t\t\t1A2C793B181A1257004E5527 /* js_bindings_core.h in Headers */,\n\t\t\t\t1A2C793F181A1257004E5527 /* js_bindings_opengl.h in Headers */,\n\t\t\t\t1A2C7945181A1257004E5527 /* jsb_helper.h in Headers */,\n\t\t\t\t1A2C7957181A1257004E5527 /* js_bindings_system_functions_registration.h in Headers */,\n\t\t\t\t1A2C7943181A1257004E5527 /* js_manual_conversions.h in Headers */,\n\t\t\t\t1A2C7929181A1257004E5527 /* js_bindings_ccbreader.h in Headers */,\n\t\t\t\t1A2C7951181A1257004E5527 /* jsb_opengl_registration.h in Headers */,\n\t\t\t\t1A2C7876181A11EC004E5527 /* jsb_cocos2dx_auto.hpp in Headers */,\n\t\t\t\t1A2C7882181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp in Headers */,\n\t\t\t\t1A2C791B181A1257004E5527 /* js_bindings_chipmunk_manual.h in Headers */,\n\t\t\t\t2AFCB8221863D68B00EB4B5C /* jsb_cocos2dx_spine_auto.hpp in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4CB11783777C0073F6A7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2AC795E71862875D005EC8E1 /* SkeletonBounds.h in Headers */,\n\t\t\t\t2AC795E81862875D005EC8E1 /* Event.h in Headers */,\n\t\t\t\t2AC795E91862875D005EC8E1 /* EventData.h in Headers */,\n\t\t\t\t2AC795EA1862875D005EC8E1 /* BoundingBoxAttachment.h in Headers */,\n\t\t\t\t46A1702D1807CBFE005B8026 /* CCCommon.h in Headers */,\n\t\t\t\t46A170FF1807CECB005B8026 /* CCPhysicsContact.h in Headers */,\n\t\t\t\t593BDCF9184D0A6E00C21E48 /* CCGroupCommand.h in Headers */,\n\t\t\t\t46A171041807CECB005B8026 /* CCPhysicsShape.h in Headers */,\n\t\t\t\t46A1703F1807CC07005B8026 /* CCDirectorCaller.h in Headers */,\n\t\t\t\t46A170B81807CEA4005B8026 /* mat4stack.h in Headers */,\n\t\t\t\t46A170BF1807CEA4005B8026 /* quaternion.h in Headers */,\n\t\t\t\t46A170381807CBFE005B8026 /* CCSAXParser.h in Headers */,\n\t\t\t\t46A170BA1807CEA4005B8026 /* kazmath.h in Headers */,\n\t\t\t\t46A170BD1807CEA4005B8026 /* neon_matrix_impl.h in Headers */,\n\t\t\t\t46A1702E1807CBFE005B8026 /* CCDevice.h in Headers */,\n\t\t\t\t46A1702A1807CBFE005B8026 /* CCLock.h in Headers */,\n\t\t\t\t46A170451807CC07005B8026 /* CCESRenderer.h in Headers */,\n\t\t\t\t46A170C41807CEA4005B8026 /* vec4.h in Headers */,\n\t\t\t\t46A171011807CECB005B8026 /* CCPhysicsJoint.h in Headers */,\n\t\t\t\t50AE5EA6188749250007CFE3 /* CCBatchCommand.h in Headers */,\n\t\t\t\t46A170C01807CEA4005B8026 /* ray2.h in Headers */,\n\t\t\t\t46A170BC1807CEA4005B8026 /* mat4.h in Headers */,\n\t\t\t\t50A1FF1B18290ED4001840C4 /* UIListView.h in Headers */,\n\t\t\t\t46A170411807CC07005B8026 /* CCEGLView.h in Headers */,\n\t\t\t\tA023FA37185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_vert.h in Headers */,\n\t\t\t\t46A170C21807CEA4005B8026 /* vec2.h in Headers */,\n\t\t\t\t46A170301807CBFE005B8026 /* CCEGLViewProtocol.h in Headers */,\n\t\t\t\t46A170321807CBFE005B8026 /* CCFileUtils.h in Headers */,\n\t\t\t\t46A170BB1807CEA4005B8026 /* mat3.h in Headers */,\n\t\t\t\t46A1703A1807CBFE005B8026 /* CCThread.h in Headers */,\n\t\t\t\t46A170C11807CEA4005B8026 /* utility.h in Headers */,\n\t\t\t\t46A170AA1807CE9E005B8026 /* aabb.h in Headers */,\n\t\t\t\t46A170FD1807CECB005B8026 /* CCPhysicsBody.h in Headers */,\n\t\t\t\t46A171061807CECB005B8026 /* CCPhysicsWorld.h in Headers */,\n\t\t\t\t46A170491807CC07005B8026 /* CCStdC.h in Headers */,\n\t\t\t\t46A1703B1807CC07005B8026 /* CCApplication.h in Headers */,\n\t\t\t\t46A170271807CBFE005B8026 /* CCFileUtilsApple.h in Headers */,\n\t\t\t\t46A170431807CC07005B8026 /* CCES2Renderer.h in Headers */,\n\t\t\t\t46A170331807CBFE005B8026 /* CCImage.h in Headers */,\n\t\t\t\t46A170BE1807CEA4005B8026 /* plane.h in Headers */,\n\t\t\t\t46A170B91807CEA4005B8026 /* matrix.h in Headers */,\n\t\t\t\t46A170481807CC07005B8026 /* CCPlatformDefine.h in Headers */,\n\t\t\t\t46A1704D1807CC11005B8026 /* AccelerometerSimulation.h in Headers */,\n\t\t\t\t46A170C31807CEA4005B8026 /* vec3.h in Headers */,\n\t\t\t\t46A1704C1807CC07005B8026 /* OpenGL_Internal.h in Headers */,\n\t\t\t\t46A1702C1807CBFE005B8026 /* CCApplicationProtocol.h in Headers */,\n\t\t\t\t1A570064180BC5A10088DEC7 /* CCAction.h in Headers */,\n\t\t\t\t06CAAACE186AD7FA0012A414 /* TriggerBase.h in Headers */,\n\t\t\t\t1A570068180BC5A10088DEC7 /* CCActionCamera.h in Headers */,\n\t\t\t\t1A57006C180BC5A10088DEC7 /* CCActionCatmullRom.h in Headers */,\n\t\t\t\t1A570070180BC5A10088DEC7 /* CCActionEase.h in Headers */,\n\t\t\t\t1A570074180BC5A10088DEC7 /* CCActionGrid.h in Headers */,\n\t\t\t\tB37510841823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.h in Headers */,\n\t\t\t\t1A570078180BC5A10088DEC7 /* CCActionGrid3D.h in Headers */,\n\t\t\t\t1A57007C180BC5A10088DEC7 /* CCActionInstant.h in Headers */,\n\t\t\t\tB37510861823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.h in Headers */,\n\t\t\t\t1A570080180BC5A10088DEC7 /* CCActionInterval.h in Headers */,\n\t\t\t\t1A570084180BC5A10088DEC7 /* CCActionManager.h in Headers */,\n\t\t\t\t1A570088180BC5A10088DEC7 /* CCActionPageTurn3D.h in Headers */,\n\t\t\t\t1A57008C180BC5A10088DEC7 /* CCActionProgressTimer.h in Headers */,\n\t\t\t\t1A570090180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */,\n\t\t\t\t1A570094180BC5A10088DEC7 /* CCActionTween.h in Headers */,\n\t\t\t\t1A0DB7331823827C0025743D /* EAGLView.h in Headers */,\n\t\t\t\t1A57009B180BC5C10088DEC7 /* CCAtlasNode.h in Headers */,\n\t\t\t\t1A5700A1180BC5D20088DEC7 /* CCNode.h in Headers */,\n\t\t\t\t1A5700C8180BC6060088DEC7 /* atitc.h in Headers */,\n\t\t\t\t1A5700CC180BC6060088DEC7 /* CCAffineTransform.h in Headers */,\n\t\t\t\t1A5700D0180BC6060088DEC7 /* CCArray.h in Headers */,\n\t\t\t\t1A5700D4180BC6060088DEC7 /* CCAutoreleasePool.h in Headers */,\n\t\t\t\t1A5700D6180BC6060088DEC7 /* CCBool.h in Headers */,\n\t\t\t\t1A5700DA180BC6060088DEC7 /* CCData.h in Headers */,\n\t\t\t\t1A5700DE180BC6060088DEC7 /* CCDataVisitor.h in Headers */,\n\t\t\t\t1A5700E2180BC6060088DEC7 /* CCDictionary.h in Headers */,\n\t\t\t\t1A5700E4180BC6060088DEC7 /* CCDouble.h in Headers */,\n\t\t\t\t1A5700E6180BC6060088DEC7 /* CCFloat.h in Headers */,\n\t\t\t\t1A5700EA180BC6060088DEC7 /* CCGeometry.h in Headers */,\n\t\t\t\t1A5700EC180BC6060088DEC7 /* CCInteger.h in Headers */,\n\t\t\t\t1A5700F0180BC6060088DEC7 /* CCNS.h in Headers */,\n\t\t\t\t1A5700F4180BC6060088DEC7 /* CCObject.h in Headers */,\n\t\t\t\t1A5700F6180BC6060088DEC7 /* CCPlatformConfig.h in Headers */,\n\t\t\t\t1A5700F8180BC6060088DEC7 /* CCPlatformMacros.h in Headers */,\n\t\t\t\t1AA206401848437A00053418 /* CCMap.h in Headers */,\n\t\t\t\t1A5700FC180BC6060088DEC7 /* CCSet.h in Headers */,\n\t\t\t\t1A570100180BC6060088DEC7 /* CCString.h in Headers */,\n\t\t\t\t1A570104180BC6060088DEC7 /* etc1.h in Headers */,\n\t\t\t\t1A570108180BC6060088DEC7 /* s3tc.h in Headers */,\n\t\t\t\t1A570111180BC8EE0088DEC7 /* CCDrawingPrimitives.h in Headers */,\n\t\t\t\t1A570115180BC8EE0088DEC7 /* CCDrawNode.h in Headers */,\n\t\t\t\t06CAAAC5186AD7E50012A414 /* TriggerObj.h in Headers */,\n\t\t\t\t1A57011E180BC90D0088DEC7 /* CCGrabber.h in Headers */,\n\t\t\t\t1A570122180BC90D0088DEC7 /* CCGrid.h in Headers */,\n\t\t\t\t1A57013D180BC9460088DEC7 /* CCEvent.h in Headers */,\n\t\t\t\t1A570141180BC9460088DEC7 /* CCEventAcceleration.h in Headers */,\n\t\t\t\t1A570145180BC9460088DEC7 /* CCEventCustom.h in Headers */,\n\t\t\t\t1A570149180BC9460088DEC7 /* CCEventDispatcher.h in Headers */,\n\t\t\t\t1A57014D180BC9460088DEC7 /* CCEventKeyboard.h in Headers */,\n\t\t\t\t1A570151180BC9460088DEC7 /* CCEventListener.h in Headers */,\n\t\t\t\t1A570155180BC9460088DEC7 /* CCEventListenerAcceleration.h in Headers */,\n\t\t\t\t1A570159180BC9460088DEC7 /* CCEventListenerCustom.h in Headers */,\n\t\t\t\t1A57015D180BC9460088DEC7 /* CCEventListenerKeyboard.h in Headers */,\n\t\t\t\t1A570161180BC9460088DEC7 /* CCEventListenerTouch.h in Headers */,\n\t\t\t\t1A570165180BC9460088DEC7 /* CCEventTouch.h in Headers */,\n\t\t\t\t1A5701A0180BCB590088DEC7 /* CCFont.h in Headers */,\n\t\t\t\t1A5701A4180BCB590088DEC7 /* CCFontAtlas.h in Headers */,\n\t\t\t\t1A5701A8180BCB590088DEC7 /* CCFontAtlasCache.h in Headers */,\n\t\t\t\t1A5701B4180BCB590088DEC7 /* CCFontFNT.h in Headers */,\n\t\t\t\t593BDCF5184D0A6E00C21E48 /* CCCustomCommand.h in Headers */,\n\t\t\t\t1A5701B8180BCB5A0088DEC7 /* CCFontFreeType.h in Headers */,\n\t\t\t\t1A5701BC180BCB5A0088DEC7 /* CCLabel.h in Headers */,\n\t\t\t\t1A5701C0180BCB5A0088DEC7 /* CCLabelAtlas.h in Headers */,\n\t\t\t\t1A5701C4180BCB5A0088DEC7 /* CCLabelBMFont.h in Headers */,\n\t\t\t\t1A5701CA180BCB5A0088DEC7 /* CCLabelTextFormatter.h in Headers */,\n\t\t\t\t1A5701CE180BCB5A0088DEC7 /* CCLabelTTF.h in Headers */,\n\t\t\t\t1A5701E1180BCB8C0088DEC7 /* CCLayer.h in Headers */,\n\t\t\t\t1A5701E5180BCB8C0088DEC7 /* CCScene.h in Headers */,\n\t\t\t\t1A5701E9180BCB8C0088DEC7 /* CCTransition.h in Headers */,\n\t\t\t\t1A5701ED180BCB8C0088DEC7 /* CCTransitionPageTurn.h in Headers */,\n\t\t\t\t1A5701F1180BCB8C0088DEC7 /* CCTransitionProgress.h in Headers */,\n\t\t\t\t1A5701FA180BCBAD0088DEC7 /* CCMenu.h in Headers */,\n\t\t\t\t1A5701FE180BCBAD0088DEC7 /* CCMenuItem.h in Headers */,\n\t\t\t\t1A570205180BCBD40088DEC7 /* CCClippingNode.h in Headers */,\n\t\t\t\t1A57020B180BCBDF0088DEC7 /* CCMotionStreak.h in Headers */,\n\t\t\t\t1A570213180BCBF40088DEC7 /* CCProgressTimer.h in Headers */,\n\t\t\t\tB37510821823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.h in Headers */,\n\t\t\t\t1A570217180BCBF40088DEC7 /* CCRenderTexture.h in Headers */,\n\t\t\t\t1A570224180BCC1A0088DEC7 /* CCParticleBatchNode.h in Headers */,\n\t\t\t\t373B912A187891FB00198F86 /* CCComBase.h in Headers */,\n\t\t\t\t1A570228180BCC1A0088DEC7 /* CCParticleExamples.h in Headers */,\n\t\t\t\t1A57022C180BCC1A0088DEC7 /* CCParticleSystem.h in Headers */,\n\t\t\t\t1A570230180BCC1A0088DEC7 /* CCParticleSystemQuad.h in Headers */,\n\t\t\t\t1A570237180BCC4D0088DEC7 /* CCScriptSupport.h in Headers */,\n\t\t\t\t1A57024E180BCC6F0088DEC7 /* ccShader_Position_uColor_frag.h in Headers */,\n\t\t\t\t1A570250180BCC6F0088DEC7 /* ccShader_Position_uColor_vert.h in Headers */,\n\t\t\t\t1A570252180BCC6F0088DEC7 /* ccShader_PositionColor_frag.h in Headers */,\n\t\t\t\t1A570254180BCC6F0088DEC7 /* ccShader_PositionColor_vert.h in Headers */,\n\t\t\t\t1A570256180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_frag.h in Headers */,\n\t\t\t\t1A570258180BCC6F0088DEC7 /* ccShader_PositionColorLengthTexture_vert.h in Headers */,\n\t\t\t\t1A57025A180BCC6F0088DEC7 /* ccShader_PositionTexture_frag.h in Headers */,\n\t\t\t\t1A57025C180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_frag.h in Headers */,\n\t\t\t\t1A57025E180BCC6F0088DEC7 /* ccShader_PositionTexture_uColor_vert.h in Headers */,\n\t\t\t\t1A570260180BCC6F0088DEC7 /* ccShader_PositionTexture_vert.h in Headers */,\n\t\t\t\t1A570262180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_frag.h in Headers */,\n\t\t\t\t1A570264180BCC6F0088DEC7 /* ccShader_PositionTextureA8Color_vert.h in Headers */,\n\t\t\t\t1A570266180BCC6F0088DEC7 /* ccShader_PositionTextureColor_frag.h in Headers */,\n\t\t\t\t1A570268180BCC6F0088DEC7 /* ccShader_PositionTextureColor_vert.h in Headers */,\n\t\t\t\t1A57026A180BCC6F0088DEC7 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */,\n\t\t\t\t1A57026E180BCC6F0088DEC7 /* CCShaderCache.h in Headers */,\n\t\t\t\t1A570270180BCC6F0088DEC7 /* ccShaderEx_SwitchMask_frag.h in Headers */,\n\t\t\t\t1A570274180BCC6F0088DEC7 /* ccShaders.h in Headers */,\n\t\t\t\t1A570281180BCC900088DEC7 /* CCSprite.h in Headers */,\n\t\t\t\t1A570285180BCC900088DEC7 /* CCSpriteBatchNode.h in Headers */,\n\t\t\t\t1A570289180BCC900088DEC7 /* CCSpriteFrame.h in Headers */,\n\t\t\t\t1A57028D180BCC900088DEC7 /* CCSpriteFrameCache.h in Headers */,\n\t\t\t\t1A570295180BCCAB0088DEC7 /* CCAnimation.h in Headers */,\n\t\t\t\t1A570299180BCCAB0088DEC7 /* CCAnimationCache.h in Headers */,\n\t\t\t\t1A5702A0180BCD890088DEC7 /* base64.h in Headers */,\n\t\t\t\t1A5702A6180BCD980088DEC7 /* CCNotificationCenter.h in Headers */,\n\t\t\t\t1A5702AC180BCDAA0088DEC7 /* CCProfiling.h in Headers */,\n\t\t\t\t1A5702B2180BCDBC0088DEC7 /* ccUTF8.h in Headers */,\n\t\t\t\t1A5702B8180BCDF40088DEC7 /* CCVertex.h in Headers */,\n\t\t\t\t06CAAAD2186AD8030012A414 /* ObjectFactory.h in Headers */,\n\t\t\t\t1A5702BB180BCDFC0088DEC7 /* ccUtils.h in Headers */,\n\t\t\t\t1A5702C1180BCE2A0088DEC7 /* CCIMEDelegate.h in Headers */,\n\t\t\t\t1A5702C5180BCE2A0088DEC7 /* CCIMEDispatcher.h in Headers */,\n\t\t\t\t1A5702CB180BCE370088DEC7 /* CCTextFieldTTF.h in Headers */,\n\t\t\t\t1A5702D6180BCE570088DEC7 /* CCTexture2D.h in Headers */,\n\t\t\t\t50691341185016C1009BBDD7 /* CCConsole.h in Headers */,\n\t\t\t\t1A5702DA180BCE570088DEC7 /* CCTextureAtlas.h in Headers */,\n\t\t\t\t1A5702DE180BCE570088DEC7 /* CCTextureCache.h in Headers */,\n\t\t\t\t1A5702ED180BCE750088DEC7 /* CCTileMapAtlas.h in Headers */,\n\t\t\t\t1A5702F1180BCE750088DEC7 /* CCTMXLayer.h in Headers */,\n\t\t\t\t1A5702F5180BCE750088DEC7 /* CCTMXObjectGroup.h in Headers */,\n\t\t\t\t1A5702F9180BCE750088DEC7 /* CCTMXTiledMap.h in Headers */,\n\t\t\t\t1A5702FD180BCE750088DEC7 /* CCTMXXMLParser.h in Headers */,\n\t\t\t\t1A570303180BCE890088DEC7 /* CCParallaxNode.h in Headers */,\n\t\t\t\t1A57030F180BCF190088DEC7 /* CCComponent.h in Headers */,\n\t\t\t\t1A570313180BCF190088DEC7 /* CCComponentContainer.h in Headers */,\n\t\t\t\t1A087AEB1860400400196EF5 /* edtaa3func.h in Headers */,\n\t\t\t\t1A57031C180BCF430088DEC7 /* ccCArray.h in Headers */,\n\t\t\t\t1A57031E180BCF430088DEC7 /* uthash.h in Headers */,\n\t\t\t\t1A570320180BCF430088DEC7 /* utlist.h in Headers */,\n\t\t\t\tB375107F1823ACA100B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */,\n\t\t\t\t1A570327180BCF660088DEC7 /* TGAlib.h in Headers */,\n\t\t\t\t1A570332180BCFD50088DEC7 /* CCUserDefault.h in Headers */,\n\t\t\t\t1A57033D180BCFFA0088DEC7 /* ZipUtils.h in Headers */,\n\t\t\t\t1A57034E180BD09B0088DEC7 /* tinyxml2.h in Headers */,\n\t\t\t\t1A570357180BD0B00088DEC7 /* ioapi.h in Headers */,\n\t\t\t\t1A57035B180BD0B00088DEC7 /* unzip.h in Headers */,\n\t\t\t\t1A570536180BD9500088DEC7 /* CCGLProgram.h in Headers */,\n\t\t\t\t1A57053A180BD9500088DEC7 /* ccGLStateCache.h in Headers */,\n\t\t\t\t1A570549180BD9C40088DEC7 /* CCTouch.h in Headers */,\n\t\t\t\t1AD71DAC180E26E600808F54 /* CCBAnimationManager.h in Headers */,\n\t\t\t\t1AD71DB0180E26E600808F54 /* CCBFileLoader.h in Headers */,\n\t\t\t\t1AD71DB4180E26E600808F54 /* CCBKeyframe.h in Headers */,\n\t\t\t\t1AD71DB6180E26E600808F54 /* CCBMemberVariableAssigner.h in Headers */,\n\t\t\t\t1AD71DBA180E26E600808F54 /* CCBReader.h in Headers */,\n\t\t\t\t1AD71DBC180E26E600808F54 /* CCBSelectorResolver.h in Headers */,\n\t\t\t\t1AD71DC0180E26E600808F54 /* CCBSequence.h in Headers */,\n\t\t\t\t1AD71DC4180E26E600808F54 /* CCBSequenceProperty.h in Headers */,\n\t\t\t\t1AD71DCC180E26E600808F54 /* CCControlButtonLoader.h in Headers */,\n\t\t\t\t1AD71DD0180E26E600808F54 /* CCControlLoader.h in Headers */,\n\t\t\t\t1AD71DD4180E26E600808F54 /* CCLabelBMFontLoader.h in Headers */,\n\t\t\t\t1AD71DD8180E26E600808F54 /* CCLabelTTFLoader.h in Headers */,\n\t\t\t\t1AD71DDC180E26E600808F54 /* CCLayerColorLoader.h in Headers */,\n\t\t\t\t1AD71DE0180E26E600808F54 /* CCLayerGradientLoader.h in Headers */,\n\t\t\t\t1AD71DE4180E26E600808F54 /* CCLayerLoader.h in Headers */,\n\t\t\t\t1AD71DE8180E26E600808F54 /* CCMenuItemImageLoader.h in Headers */,\n\t\t\t\t1AD71DEC180E26E600808F54 /* CCMenuItemLoader.h in Headers */,\n\t\t\t\t1AD71DEE180E26E600808F54 /* CCMenuLoader.h in Headers */,\n\t\t\t\t1AD71DF2180E26E600808F54 /* CCNode+CCBRelativePositioning.h in Headers */,\n\t\t\t\t1AD71DF6180E26E600808F54 /* CCNodeLoader.h in Headers */,\n\t\t\t\t1AD71DFA180E26E600808F54 /* CCNodeLoaderLibrary.h in Headers */,\n\t\t\t\t1AD71DFC180E26E600808F54 /* CCNodeLoaderListener.h in Headers */,\n\t\t\t\t1AD71E00180E26E600808F54 /* CCParticleSystemQuadLoader.h in Headers */,\n\t\t\t\t1AD71E04180E26E600808F54 /* CCScale9SpriteLoader.h in Headers */,\n\t\t\t\t1AD71E08180E26E600808F54 /* CCScrollViewLoader.h in Headers */,\n\t\t\t\t1AD71E0C180E26E600808F54 /* CCSpriteLoader.h in Headers */,\n\t\t\t\t1AD71E0E180E26E600808F54 /* CocosBuilder.h in Headers */,\n\t\t\t\t1AD71E98180E26E600808F54 /* Animation.h in Headers */,\n\t\t\t\t59A79D541821E26E00F19697 /* CCEventListenerMouse.h in Headers */,\n\t\t\t\t1AD71E9C180E26E600808F54 /* AnimationState.h in Headers */,\n\t\t\t\t1AD71EA0180E26E600808F54 /* AnimationStateData.h in Headers */,\n\t\t\t\t1AD71EA4180E26E600808F54 /* Atlas.h in Headers */,\n\t\t\t\t1AD71EA8180E26E600808F54 /* AtlasAttachmentLoader.h in Headers */,\n\t\t\t\t1ABA68B11888D700007D1BB4 /* CCFontCharMap.h in Headers */,\n\t\t\t\t1AD71EAC180E26E600808F54 /* Attachment.h in Headers */,\n\t\t\t\t1AD71EB0180E26E600808F54 /* AttachmentLoader.h in Headers */,\n\t\t\t\t1AD71EB4180E26E600808F54 /* Bone.h in Headers */,\n\t\t\t\t1AD71EB8180E26E600808F54 /* BoneData.h in Headers */,\n\t\t\t\t06CAAACA186AD7EF0012A414 /* TriggerMng.h in Headers */,\n\t\t\t\t1AD71EBC180E26E600808F54 /* CCSkeleton.h in Headers */,\n\t\t\t\t1AD71EC0180E26E600808F54 /* CCSkeletonAnimation.h in Headers */,\n\t\t\t\t1AD71EC4180E26E600808F54 /* extension.h in Headers */,\n\t\t\t\t1AD71EC8180E26E600808F54 /* Json.h in Headers */,\n\t\t\t\t1AD71ECC180E26E600808F54 /* RegionAttachment.h in Headers */,\n\t\t\t\t1AD71ED0180E26E600808F54 /* Skeleton.h in Headers */,\n\t\t\t\t1AD71ED4180E26E600808F54 /* SkeletonData.h in Headers */,\n\t\t\t\t1AD71ED8180E26E600808F54 /* SkeletonJson.h in Headers */,\n\t\t\t\t1AD71EDC180E26E600808F54 /* Skin.h in Headers */,\n\t\t\t\t1A85BA0E1845F31700260FC0 /* CCVector.h in Headers */,\n\t\t\t\t1AD71EE0180E26E600808F54 /* Slot.h in Headers */,\n\t\t\t\t1AD71EE4180E26E600808F54 /* SlotData.h in Headers */,\n\t\t\t\t06CAAAC2186AD7D70012A414 /* CCActionEaseEx.h in Headers */,\n\t\t\t\t1AD71EE8180E26E600808F54 /* spine-cocos2dx.h in Headers */,\n\t\t\t\t1AD71EEA180E26E600808F54 /* spine.h in Headers */,\n\t\t\t\t1AAF536D180E3374000584C8 /* HttpClient.h in Headers */,\n\t\t\t\tA0E6B28118613EA5009C5D17 /* CCRenderCommandPool.h in Headers */,\n\t\t\t\t1AAF536F180E3374000584C8 /* HttpRequest.h in Headers */,\n\t\t\t\t59A79D581821E26E00F19697 /* CCEventMouse.h in Headers */,\n\t\t\t\t1AAF5371180E3374000584C8 /* HttpResponse.h in Headers */,\n\t\t\t\t1AAF5375180E3374000584C8 /* SocketIO.h in Headers */,\n\t\t\t\t1AAF5379180E3374000584C8 /* WebSocket.h in Headers */,\n\t\t\t\t1AAF5852180E40B9000584C8 /* LocalStorage.h in Headers */,\n\t\t\t\t1A9DCA14180E6955007A3AD4 /* ccConfig.h in Headers */,\n\t\t\t\t1A9DCA18180E6955007A3AD4 /* CCConfiguration.h in Headers */,\n\t\t\t\t1A9DCA20180E6955007A3AD4 /* CCDirector.h in Headers */,\n\t\t\t\t1A9DCA22180E6955007A3AD4 /* CCEventType.h in Headers */,\n\t\t\t\t1A9DCA26180E6955007A3AD4 /* ccFPSImages.h in Headers */,\n\t\t\t\t1A9DCA2A180E6955007A3AD4 /* CCGLBufferedNode.h in Headers */,\n\t\t\t\t1A9DCA2C180E6955007A3AD4 /* ccMacros.h in Headers */,\n\t\t\t\t1A0DB7321823827C0025743D /* CCGL.h in Headers */,\n\t\t\t\t1A9DCA2E180E6955007A3AD4 /* CCProtocols.h in Headers */,\n\t\t\t\t1A9DCA32180E6955007A3AD4 /* CCScheduler.h in Headers */,\n\t\t\t\t1A9DCA3A180E6955007A3AD4 /* cocos2d.h in Headers */,\n\t\t\t\t1A9DCA3C180E6955007A3AD4 /* firePngData.h in Headers */,\n\t\t\t\t1A9DCA40180E6955007A3AD4 /* TransformUtils.h in Headers */,\n\t\t\t\t1A9DCA46180E6D90007A3AD4 /* CCDeprecated.h in Headers */,\n\t\t\t\t1A9DCA4C180E6DE3007A3AD4 /* ccTypes.h in Headers */,\n\t\t\t\t1A8C58EF180E92CC00EF57C3 /* CocosGUI.h in Headers */,\n\t\t\t\t1A8C58F3180E92CC00EF57C3 /* UILayout.h in Headers */,\n\t\t\t\t1A8C58F7180E92CC00EF57C3 /* UILayoutParameter.h in Headers */,\n\t\t\t\t1A8C58FB180E92CC00EF57C3 /* UIButton.h in Headers */,\n\t\t\t\t1A8C58FF180E92CC00EF57C3 /* UICheckBox.h in Headers */,\n\t\t\t\t1A8C5907180E92CC00EF57C3 /* UIHelper.h in Headers */,\n\t\t\t\t1A8C590B180E92CC00EF57C3 /* UIImageView.h in Headers */,\n\t\t\t\t1A8C5913180E92CC00EF57C3 /* UIText.h in Headers */,\n\t\t\t\t1A8C5917180E92CC00EF57C3 /* UITextAtlas.h in Headers */,\n\t\t\t\t1A8C591B180E92CC00EF57C3 /* UITextBMFont.h in Headers */,\n\t\t\t\t1A8C5923180E92CC00EF57C3 /* UILayoutDefine.h in Headers */,\n\t\t\t\t1A8C592B180E92CC00EF57C3 /* UILoadingBar.h in Headers */,\n\t\t\t\t1A8C592F180E92CC00EF57C3 /* UIPageView.h in Headers */,\n\t\t\t\t1A8C5935180E92CC00EF57C3 /* UIScrollInterface.h in Headers */,\n\t\t\t\t1A8C5939180E92CC00EF57C3 /* UIScrollView.h in Headers */,\n\t\t\t\t1A8C593D180E92CC00EF57C3 /* UISlider.h in Headers */,\n\t\t\t\t1A8C5941180E92CC00EF57C3 /* UITextField.h in Headers */,\n\t\t\t\t1A8C5945180E92CC00EF57C3 /* UIWidget.h in Headers */,\n\t\t\t\t1A8C598E180E930E00EF57C3 /* CCActionFrame.h in Headers */,\n\t\t\t\t1A8C5992180E930E00EF57C3 /* CCActionFrameEasing.h in Headers */,\n\t\t\t\t1A8C5996180E930E00EF57C3 /* CCActionManagerEx.h in Headers */,\n\t\t\t\t1A8C599A180E930E00EF57C3 /* CCActionNode.h in Headers */,\n\t\t\t\t1A8C599E180E930E00EF57C3 /* CCActionObject.h in Headers */,\n\t\t\t\t1A8C59A2180E930E00EF57C3 /* CCArmature.h in Headers */,\n\t\t\t\t1A8C59A6180E930E00EF57C3 /* CCArmatureAnimation.h in Headers */,\n\t\t\t\t1A8C59AA180E930E00EF57C3 /* CCArmatureDataManager.h in Headers */,\n\t\t\t\t1A8C59AE180E930E00EF57C3 /* CCArmatureDefine.h in Headers */,\n\t\t\t\t1A8C59B2180E930E00EF57C3 /* CCBatchNode.h in Headers */,\n\t\t\t\t1A8C59B6180E930E00EF57C3 /* CCBone.h in Headers */,\n\t\t\t\t1A8C59BA180E930E00EF57C3 /* CCColliderDetector.h in Headers */,\n\t\t\t\t1A8C59BE180E930E00EF57C3 /* CCComAttribute.h in Headers */,\n\t\t\t\t1A8C59C2180E930E00EF57C3 /* CCComAudio.h in Headers */,\n\t\t\t\t1A8C59C6180E930E00EF57C3 /* CCComController.h in Headers */,\n\t\t\t\t1A8C59CA180E930E00EF57C3 /* CCComRender.h in Headers */,\n\t\t\t\t1A8C59CE180E930E00EF57C3 /* CCDataReaderHelper.h in Headers */,\n\t\t\t\t1A8C59D2180E930E00EF57C3 /* CCDatas.h in Headers */,\n\t\t\t\tED9C6A9718599AD8000A5232 /* CCNodeGrid.h in Headers */,\n\t\t\t\t1A8C59D6180E930E00EF57C3 /* CCDecorativeDisplay.h in Headers */,\n\t\t\t\t1A8C59DA180E930E00EF57C3 /* CCDisplayFactory.h in Headers */,\n\t\t\t\t1A8C59DE180E930E00EF57C3 /* CCDisplayManager.h in Headers */,\n\t\t\t\t1A8C59E2180E930E00EF57C3 /* CCInputDelegate.h in Headers */,\n\t\t\t\t1A8C59E6180E930E00EF57C3 /* CCProcessBase.h in Headers */,\n\t\t\t\tB375107D1823ACA100B3BA6A /* CCPhysicsBodyInfo_chipmunk.h in Headers */,\n\t\t\t\t1A8C59EA180E930E00EF57C3 /* CCSGUIReader.h in Headers */,\n\t\t\t\t1A8C59EE180E930E00EF57C3 /* CCSkin.h in Headers */,\n\t\t\t\tB37510801823ACA100B3BA6A /* CCPhysicsHelper_chipmunk.h in Headers */,\n\t\t\t\tA023FA35185198C800E10CD1 /* ccShader_PositionTextureColor_noMVP_frag.h in Headers */,\n\t\t\t\t1A8C59F2180E930E00EF57C3 /* CCSpriteFrameCacheHelper.h in Headers */,\n\t\t\t\t1A8C59F6180E930E00EF57C3 /* CCSSceneReader.h in Headers */,\n\t\t\t\t1A8C59FA180E930E00EF57C3 /* CCTransformHelp.h in Headers */,\n\t\t\t\t1A8C59FE180E930E00EF57C3 /* CCTween.h in Headers */,\n\t\t\t\t1A8C5A02180E930E00EF57C3 /* CCTweenFunction.h in Headers */,\n\t\t\t\t1AE3C847184F14F700CF29B5 /* CCValue.h in Headers */,\n\t\t\t\t1A8C5A06180E930E00EF57C3 /* CCUtilMath.h in Headers */,\n\t\t\t\t1A8C5A08180E930E00EF57C3 /* CocoStudio.h in Headers */,\n\t\t\t\t1A8C5A10180E930E00EF57C3 /* DictionaryHelper.h in Headers */,\n\t\t\t\t74AC8EE0C2AAB82783F47089 /* CCFrustum.h in Headers */,\n\t\t\t\t74AC84A2F1052B49CA60C2D1 /* CCRenderer.h in Headers */,\n\t\t\t\t74AC8AE45B093F2F76A5B1C2 /* CCQuadCommand.h in Headers */,\n\t\t\t\t74AC8573F4F84201C08E5523 /* CCRenderCommand.h in Headers */,\n\t\t\t\t74AC87A5A3B3AD5055CCA3B9 /* CCRenderMaterial.h in Headers */,\n\t\t\t\t74AC8A10DE9DE8E14D8B3735 /* CCMaterialManager.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4E7D1783867C0073F6A7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E47A618080904000CDD6D /* CCControlStepper.h in Headers */,\n\t\t\t\t460E47D418080914000CDD6D /* CCScrollView.h in Headers */,\n\t\t\t\t460E479918080904000CDD6D /* CCControlButton.h in Headers */,\n\t\t\t\t460E47A418080904000CDD6D /* CCControlSlider.h in Headers */,\n\t\t\t\t460E479E18080904000CDD6D /* CCControlHuePicker.h in Headers */,\n\t\t\t\t460E468218080836000CDD6D /* cocos-ext.h in Headers */,\n\t\t\t\t460E47C41808090D000CDD6D /* CCEditBoxImplMac.h in Headers */,\n\t\t\t\t460E47BF1808090D000CDD6D /* CCEditBoxImpl.h in Headers */,\n\t\t\t\t460E47AE18080904000CDD6D /* CCScale9Sprite.h in Headers */,\n\t\t\t\t460E477C180808F7000CDD6D /* ExtensionMacros.h in Headers */,\n\t\t\t\t460E47A218080904000CDD6D /* CCControlSaturationBrightnessPicker.h in Headers */,\n\t\t\t\t460E479B18080904000CDD6D /* CCControlColourPicker.h in Headers */,\n\t\t\t\t460E47C11808090D000CDD6D /* CCEditBoxImplAndroid.h in Headers */,\n\t\t\t\t460E47CA1808090D000CDD6D /* CCEditBoxImplWin.h in Headers */,\n\t\t\t\t460E47AA18080904000CDD6D /* CCControlUtils.h in Headers */,\n\t\t\t\t460E47C81808090D000CDD6D /* CCEditBoxImplTizen.h in Headers */,\n\t\t\t\t460E47A818080904000CDD6D /* CCControlSwitch.h in Headers */,\n\t\t\t\t460E47D818080914000CDD6D /* CCTableView.h in Headers */,\n\t\t\t\t460E479718080904000CDD6D /* CCControl.h in Headers */,\n\t\t\t\t460E479C18080904000CDD6D /* CCControlExtensions.h in Headers */,\n\t\t\t\t460E47DA18080914000CDD6D /* CCTableViewCell.h in Headers */,\n\t\t\t\t460E47AC18080904000CDD6D /* CCInvocation.h in Headers */,\n\t\t\t\t460E47A018080904000CDD6D /* CCControlPotentiometer.h in Headers */,\n\t\t\t\t460E47BE1808090D000CDD6D /* CCEditBox.h in Headers */,\n\t\t\t\t460E47C21808090D000CDD6D /* CCEditBoxImplIOS.h in Headers */,\n\t\t\t\t1AD71EF3180E27CF00808F54 /* CCPhysicsDebugNode.h in Headers */,\n\t\t\t\t1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */,\n\t\t\t\t1AAF5356180E3060000584C8 /* AssetsManager.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4F1D178387670073F6A7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A174391807D37B005B8026 /* util.h in Headers */,\n\t\t\t\t46A174411807D37B005B8026 /* cpVect.h in Headers */,\n\t\t\t\t46A173F21807D363005B8026 /* prime.h in Headers */,\n\t\t\t\t46A174191807D374005B8026 /* chipmunk_unsafe.h in Headers */,\n\t\t\t\t46A174171807D374005B8026 /* chipmunk_private.h in Headers */,\n\t\t\t\t46A174371807D37B005B8026 /* cpSimpleMotor.h in Headers */,\n\t\t\t\t46A174311807D37B005B8026 /* cpGearJoint.h in Headers */,\n\t\t\t\t46A1743F1807D37B005B8026 /* cpSpace.h in Headers */,\n\t\t\t\t46A1743A1807D37B005B8026 /* cpArbiter.h in Headers */,\n\t\t\t\t46A174351807D37B005B8026 /* cpRatchetJoint.h in Headers */,\n\t\t\t\t46A174161807D374005B8026 /* chipmunk_ffi.h in Headers */,\n\t\t\t\t46A174381807D37B005B8026 /* cpSlideJoint.h in Headers */,\n\t\t\t\t46A174361807D37B005B8026 /* cpRotaryLimitJoint.h in Headers */,\n\t\t\t\t46A174151807D374005B8026 /* chipmunk.h in Headers */,\n\t\t\t\t46A174181807D374005B8026 /* chipmunk_types.h in Headers */,\n\t\t\t\t46A174301807D37B005B8026 /* cpDampedSpring.h in Headers */,\n\t\t\t\t46A174331807D37B005B8026 /* cpPinJoint.h in Headers */,\n\t\t\t\t46A1743E1807D37B005B8026 /* cpShape.h in Headers */,\n\t\t\t\t46A1743B1807D37B005B8026 /* cpBB.h in Headers */,\n\t\t\t\t46A1742F1807D37B005B8026 /* cpDampedRotarySpring.h in Headers */,\n\t\t\t\t46A174401807D37B005B8026 /* cpSpatialIndex.h in Headers */,\n\t\t\t\t46A174341807D37B005B8026 /* cpPivotJoint.h in Headers */,\n\t\t\t\t46A1743C1807D37B005B8026 /* cpBody.h in Headers */,\n\t\t\t\t46A1743D1807D37B005B8026 /* cpPolyShape.h in Headers */,\n\t\t\t\t46A174321807D37B005B8026 /* cpGrooveJoint.h in Headers */,\n\t\t\t\t46A1742E1807D37B005B8026 /* cpConstraint.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4F6C1783876B0073F6A7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF5299180E2EE1000584C8 /* Box2D.h in Headers */,\n\t\t\t\t1AAF529B180E2EE4000584C8 /* b2BroadPhase.h in Headers */,\n\t\t\t\t1AAF52A0180E2EE4000584C8 /* b2Collision.h in Headers */,\n\t\t\t\t1AAF52A2180E2EE4000584C8 /* b2Distance.h in Headers */,\n\t\t\t\t1AAF52A4180E2EE4000584C8 /* b2DynamicTree.h in Headers */,\n\t\t\t\t1AAF52A6180E2EE4000584C8 /* b2TimeOfImpact.h in Headers */,\n\t\t\t\t1AAF52A8180E2EE8000584C8 /* b2ChainShape.h in Headers */,\n\t\t\t\t1AAF52AA180E2EE8000584C8 /* b2CircleShape.h in Headers */,\n\t\t\t\t1AAF52AC180E2EE8000584C8 /* b2EdgeShape.h in Headers */,\n\t\t\t\t1AAF52AE180E2EE8000584C8 /* b2PolygonShape.h in Headers */,\n\t\t\t\t1AAF52AF180E2EE8000584C8 /* b2Shape.h in Headers */,\n\t\t\t\t1AAF52BA180E2EEE000584C8 /* b2BlockAllocator.h in Headers */,\n\t\t\t\t1AAF52BC180E2EEE000584C8 /* b2Draw.h in Headers */,\n\t\t\t\t1AAF52BD180E2EEE000584C8 /* b2GrowableStack.h in Headers */,\n\t\t\t\t1AAF52BF180E2EEE000584C8 /* b2Math.h in Headers */,\n\t\t\t\t1AAF52C1180E2EEE000584C8 /* b2Settings.h in Headers */,\n\t\t\t\tB3AF01A31842FBA400A98B85 /* b2MotorJoint.h in Headers */,\n\t\t\t\t1AAF52C3180E2EEE000584C8 /* b2StackAllocator.h in Headers */,\n\t\t\t\t1AAF52C5180E2EEE000584C8 /* b2Timer.h in Headers */,\n\t\t\t\t1AAF52E1180E2EF6000584C8 /* b2Body.h in Headers */,\n\t\t\t\t1AAF52E3180E2EF6000584C8 /* b2ContactManager.h in Headers */,\n\t\t\t\t1AAF52E5180E2EF6000584C8 /* b2Fixture.h in Headers */,\n\t\t\t\t1AAF52E7180E2EF6000584C8 /* b2Island.h in Headers */,\n\t\t\t\t1AAF52E8180E2EF6000584C8 /* b2TimeStep.h in Headers */,\n\t\t\t\t1AAF52EA180E2EF6000584C8 /* b2World.h in Headers */,\n\t\t\t\t1AAF52EC180E2EF6000584C8 /* b2WorldCallbacks.h in Headers */,\n\t\t\t\t1AAF52EE180E2EFC000584C8 /* b2ChainAndCircleContact.h in Headers */,\n\t\t\t\t1AAF52F0180E2EFC000584C8 /* b2ChainAndPolygonContact.h in Headers */,\n\t\t\t\t1AAF52F2180E2EFC000584C8 /* b2CircleContact.h in Headers */,\n\t\t\t\t1AAF52F4180E2EFC000584C8 /* b2Contact.h in Headers */,\n\t\t\t\t1AAF52F6180E2EFC000584C8 /* b2ContactSolver.h in Headers */,\n\t\t\t\t1AAF52F8180E2EFC000584C8 /* b2EdgeAndCircleContact.h in Headers */,\n\t\t\t\t1AAF52FA180E2EFC000584C8 /* b2EdgeAndPolygonContact.h in Headers */,\n\t\t\t\t1AAF52FC180E2EFC000584C8 /* b2PolygonAndCircleContact.h in Headers */,\n\t\t\t\t1AAF52FE180E2EFC000584C8 /* b2PolygonContact.h in Headers */,\n\t\t\t\t1AAF5328180E2F04000584C8 /* b2DistanceJoint.h in Headers */,\n\t\t\t\t1AAF532A180E2F04000584C8 /* b2FrictionJoint.h in Headers */,\n\t\t\t\t1AAF532C180E2F04000584C8 /* b2GearJoint.h in Headers */,\n\t\t\t\t1AAF532E180E2F04000584C8 /* b2Joint.h in Headers */,\n\t\t\t\t1AAF5330180E2F04000584C8 /* b2MouseJoint.h in Headers */,\n\t\t\t\t1AAF5332180E2F04000584C8 /* b2PrismaticJoint.h in Headers */,\n\t\t\t\t1AAF5334180E2F04000584C8 /* b2PulleyJoint.h in Headers */,\n\t\t\t\t1AAF5336180E2F04000584C8 /* b2RevoluteJoint.h in Headers */,\n\t\t\t\t1AAF5338180E2F04000584C8 /* b2RopeJoint.h in Headers */,\n\t\t\t\t1AAF533A180E2F04000584C8 /* b2WeldJoint.h in Headers */,\n\t\t\t\t1AAF533C180E2F04000584C8 /* b2WheelJoint.h in Headers */,\n\t\t\t\t1AAF5340180E2F11000584C8 /* b2Rope.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4FA8178387730073F6A7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A160501807A5EB005B8026 /* Export.h in Headers */,\n\t\t\t\t46A1605A1807A5EB005B8026 /* SimpleAudioEngine_objc.h in Headers */,\n\t\t\t\t46A160551807A5EB005B8026 /* CDOpenALSupport.h in Headers */,\n\t\t\t\t46A160541807A5EB005B8026 /* CDConfig.h in Headers */,\n\t\t\t\t46A160521807A5EB005B8026 /* CDAudioManager.h in Headers */,\n\t\t\t\t46A160571807A5EB005B8026 /* CocosDenshion.h in Headers */,\n\t\t\t\t46A160511807A5EB005B8026 /* SimpleAudioEngine.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4FCE178387750073F6A7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A2C7938181A1257004E5527 /* js_bindings_config.h in Headers */,\n\t\t\t\t1A2C7910181A1257004E5527 /* js_bindings_chipmunk_auto_classes.h in Headers */,\n\t\t\t\t1A2C7936181A1257004E5527 /* jsb_cocos2dx_extension_manual.h in Headers */,\n\t\t\t\t1A2C7920181A1257004E5527 /* js_bindings_chipmunk_registration.h in Headers */,\n\t\t\t\t1A2C7956181A1257004E5527 /* js_bindings_system_functions.h in Headers */,\n\t\t\t\t1A2C7912181A1257004E5527 /* js_bindings_chipmunk_auto_classes_registration.h in Headers */,\n\t\t\t\t1A2C7964181A1257004E5527 /* XMLHTTPRequest.h in Headers */,\n\t\t\t\t1A2C7960181A1257004E5527 /* jsb_websocket.h in Headers */,\n\t\t\t\t1A2C796A181A1257004E5527 /* spidermonkey_specifics.h in Headers */,\n\t\t\t\t1A2C7890181A11EC004E5527 /* jsb_cocos2dx_extension_auto.hpp in Headers */,\n\t\t\t\t1A2C7924181A1257004E5527 /* cocos2d_specifics.hpp in Headers */,\n\t\t\t\t1A2C7932181A1257004E5527 /* jsb_cocos2dx_studio_manual.h in Headers */,\n\t\t\t\t1A2C789C181A11EC004E5527 /* jsb_cocos2dx_studio_auto.hpp in Headers */,\n\t\t\t\t1A2C794E181A1257004E5527 /* jsb_opengl_manual.h in Headers */,\n\t\t\t\t1A2C7968181A1257004E5527 /* ScriptingCore.h in Headers */,\n\t\t\t\t1A2C795C181A1257004E5527 /* js_bindings_system_registration.h in Headers */,\n\t\t\t\t1A2C794A181A1257004E5527 /* jsb_opengl_functions.h in Headers */,\n\t\t\t\t1A2C7926181A1257004E5527 /* cocosbuilder_specifics.hpp in Headers */,\n\t\t\t\t1A2C7916181A1257004E5527 /* js_bindings_chipmunk_functions.h in Headers */,\n\t\t\t\t1A2C7918181A1257004E5527 /* js_bindings_chipmunk_functions_registration.h in Headers */,\n\t\t\t\t1A2C793C181A1257004E5527 /* js_bindings_core.h in Headers */,\n\t\t\t\t1A2C7940181A1257004E5527 /* js_bindings_opengl.h in Headers */,\n\t\t\t\t1A2C7946181A1257004E5527 /* jsb_helper.h in Headers */,\n\t\t\t\t1A2C7958181A1257004E5527 /* js_bindings_system_functions_registration.h in Headers */,\n\t\t\t\t1A2C7944181A1257004E5527 /* js_manual_conversions.h in Headers */,\n\t\t\t\t1A2C792A181A1257004E5527 /* js_bindings_ccbreader.h in Headers */,\n\t\t\t\t1A2C7952181A1257004E5527 /* jsb_opengl_registration.h in Headers */,\n\t\t\t\t1A2C7878181A11EC004E5527 /* jsb_cocos2dx_auto.hpp in Headers */,\n\t\t\t\t1A2C7884181A11EC004E5527 /* jsb_cocos2dx_builder_auto.hpp in Headers */,\n\t\t\t\t1A2C791C181A1257004E5527 /* js_bindings_chipmunk_manual.h in Headers */,\n\t\t\t\t2AFCB8251863D70300EB4B5C /* jsb_cocos2dx_spine_auto.hpp in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t1551A33E158F2AB200E66CFE /* cocos2dx Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1551A34C158F2AB200E66CFE /* Build configuration list for PBXNativeTarget \"cocos2dx Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1551A33B158F2AB200E66CFE /* Sources */,\n\t\t\t\t1551A33C158F2AB200E66CFE /* Frameworks */,\n\t\t\t\t1551A33D158F2AB200E66CFE /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t460E44F41807E241000CDD6D /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = 1551A33F158F2AB200E66CFE /* libcocos2dx Mac.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t1A119716178526AA00D62A44 /* luabindings iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1A11978E178526AA00D62A44 /* Build configuration list for PBXNativeTarget \"luabindings iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1A119717178526AA00D62A44 /* Sources */,\n\t\t\t\t1A11972D178526AA00D62A44 /* Frameworks */,\n\t\t\t\t1A11972F178526AA00D62A44 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"luabindings iOS\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = 1A119791178526AA00D62A44 /* libluabindings iOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t1A6FB50417854BC200CDF010 /* luabindings Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1A6FB52D17854BC200CDF010 /* Build configuration list for PBXNativeTarget \"luabindings Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1A6FB50517854BC200CDF010 /* Sources */,\n\t\t\t\t1A6FB51817854BC200CDF010 /* Frameworks */,\n\t\t\t\t1A6FB51B17854BC200CDF010 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"luabindings Mac\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = 1A6FB53017854BC300CDF010 /* libluabindings Mac.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA03F2B781780BD04006731B9 /* chipmunk Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A03F2CB51780BD04006731B9 /* Build configuration list for PBXNativeTarget \"chipmunk Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA03F2B791780BD04006731B9 /* Sources */,\n\t\t\t\tA03F2C011780BD04006731B9 /* Frameworks */,\n\t\t\t\tA03F2C051780BD04006731B9 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"chipmunk Mac\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A03F2CB81780BD04006731B9 /* libchipmunk Mac.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA03F2D5D1780BDF7006731B9 /* box2d Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A03F2D981780BDF7006731B9 /* Build configuration list for PBXNativeTarget \"box2d Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA03F2D5E1780BDF7006731B9 /* Sources */,\n\t\t\t\tA03F2D7C1780BDF7006731B9 /* Frameworks */,\n\t\t\t\tA03F2D7D1780BDF7006731B9 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"box2d Mac\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A03F2D9B1780BDF7006731B9 /* libbox2d Mac.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA03F2E9817814268006731B9 /* CocosDenshion Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A03F2ED317814268006731B9 /* Build configuration list for PBXNativeTarget \"CocosDenshion Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA03F2E9917814268006731B9 /* Sources */,\n\t\t\t\tA03F2EB717814268006731B9 /* Frameworks */,\n\t\t\t\tA03F2EB817814268006731B9 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A03F2ED617814268006731B9 /* libCocosDenshion Mac.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA03F2FC117814595006731B9 /* cocos2dx-extensions Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A03F2FD317814595006731B9 /* Build configuration list for PBXNativeTarget \"cocos2dx-extensions Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA03F2FC217814595006731B9 /* Sources */,\n\t\t\t\tA03F2FC917814595006731B9 /* Frameworks */,\n\t\t\t\tA03F2FCA17814595006731B9 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A03F2FD617814595006731B9 /* libcocos2dx-extensions Mac.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA03F31E81781479B006731B9 /* jsbindings Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A03F31FA1781479B006731B9 /* Build configuration list for PBXNativeTarget \"jsbindings Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA03F31E91781479B006731B9 /* Sources */,\n\t\t\t\tA03F31F01781479B006731B9 /* Frameworks */,\n\t\t\t\tA03F31F11781479B006731B9 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"jsbindings Mac\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A03F31FD1781479B006731B9 /* libjsbindings Mac.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA07A4C241783777C0073F6A7 /* cocos2dx iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A4D611783777C0073F6A7 /* Build configuration list for PBXNativeTarget \"cocos2dx iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A4C251783777C0073F6A7 /* Sources */,\n\t\t\t\tA07A4CAD1783777C0073F6A7 /* Frameworks */,\n\t\t\t\tA07A4CB11783777C0073F6A7 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t46A173D31807D330005B8026 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A07A4D641783777C0073F6A7 /* libcocos2dx iOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA07A4E111783867C0073F6A7 /* cocos2dx-extensions iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A4EF91783867C0073F6A7 /* Build configuration list for PBXNativeTarget \"cocos2dx-extensions iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A4E121783867C0073F6A7 /* Sources */,\n\t\t\t\tA07A4E7B1783867C0073F6A7 /* Frameworks */,\n\t\t\t\tA07A4E7D1783867C0073F6A7 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A07A4EFC1783867C0073F6A7 /* libcocos2dx-extensions iOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA07A4EFD178387670073F6A7 /* chipmunk iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A4F38178387670073F6A7 /* Build configuration list for PBXNativeTarget \"chipmunk iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A4EFE178387670073F6A7 /* Sources */,\n\t\t\t\tA07A4F1C178387670073F6A7 /* Frameworks */,\n\t\t\t\tA07A4F1D178387670073F6A7 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"chipmunk iOS\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A07A4F3B178387670073F6A7 /* libchipmunk iOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA07A4F3C1783876B0073F6A7 /* box2d iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A4F9B1783876B0073F6A7 /* Build configuration list for PBXNativeTarget \"box2d iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A4F3D1783876B0073F6A7 /* Sources */,\n\t\t\t\tA07A4F6B1783876B0073F6A7 /* Frameworks */,\n\t\t\t\tA07A4F6C1783876B0073F6A7 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"box2d iOS\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A07A4F9E1783876B0073F6A7 /* libbox2d iOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA07A4F9F178387730073F6A7 /* CocosDenshion iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A4FB1178387730073F6A7 /* Build configuration list for PBXNativeTarget \"CocosDenshion iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A4FA0178387730073F6A7 /* Sources */,\n\t\t\t\tA07A4FA7178387730073F6A7 /* Frameworks */,\n\t\t\t\tA07A4FA8178387730073F6A7 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A07A4FB4178387730073F6A7 /* libCocosDenshion iOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\tA07A4FB5178387750073F6A7 /* jsbindings iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A502D178387750073F6A7 /* Build configuration list for PBXNativeTarget \"jsbindings iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A4FB6178387750073F6A7 /* Sources */,\n\t\t\t\tA07A4FCC178387750073F6A7 /* Frameworks */,\n\t\t\t\tA07A4FCE178387750073F6A7 /* Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"jsbindings iOS\";\n\t\t\tproductName = cocos2dx;\n\t\t\tproductReference = A07A5030178387750073F6A7 /* libjsbindings iOS.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t1551A336158F2AB200E66CFE /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0500;\n\t\t\t\tORGANIZATIONNAME = \"\";\n\t\t\t};\n\t\t\tbuildConfigurationList = 1551A339158F2AB200E66CFE /* Build configuration list for PBXProject \"cocos2d_libs\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 1551A334158F2AB200E66CFE;\n\t\t\tproductRefGroup = 1551A340158F2AB200E66CFE /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tA03F2E8E178141C1006731B9 /* build-all-libs Mac */,\n\t\t\t\t1551A33E158F2AB200E66CFE /* cocos2dx Mac */,\n\t\t\t\tA03F2FC117814595006731B9 /* cocos2dx-extensions Mac */,\n\t\t\t\tA03F2B781780BD04006731B9 /* chipmunk Mac */,\n\t\t\t\tA03F2D5D1780BDF7006731B9 /* box2d Mac */,\n\t\t\t\tA03F2E9817814268006731B9 /* CocosDenshion Mac */,\n\t\t\t\tA03F31E81781479B006731B9 /* jsbindings Mac */,\n\t\t\t\t1A6FB50417854BC200CDF010 /* luabindings Mac */,\n\t\t\t\tA07A4E0B178386390073F6A7 /* build-all-libs iOS */,\n\t\t\t\tA07A4C241783777C0073F6A7 /* cocos2dx iOS */,\n\t\t\t\tA07A4E111783867C0073F6A7 /* cocos2dx-extensions iOS */,\n\t\t\t\tA07A4EFD178387670073F6A7 /* chipmunk iOS */,\n\t\t\t\tA07A4F3C1783876B0073F6A7 /* box2d iOS */,\n\t\t\t\tA07A4F9F178387730073F6A7 /* CocosDenshion iOS */,\n\t\t\t\tA07A4FB5178387750073F6A7 /* jsbindings iOS */,\n\t\t\t\t1A119716178526AA00D62A44 /* luabindings iOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t1551A33B158F2AB200E66CFE /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2AC795DB1862870F005EC8E1 /* SkeletonBounds.cpp in Sources */,\n\t\t\t\t2AC795DC1862870F005EC8E1 /* Event.cpp in Sources */,\n\t\t\t\t2AC795DD1862870F005EC8E1 /* EventData.cpp in Sources */,\n\t\t\t\t2AC795DE1862870F005EC8E1 /* BoundingBoxAttachment.cpp in Sources */,\n\t\t\t\t46A170501807CC1C005B8026 /* CCApplication.mm in Sources */,\n\t\t\t\t46A1705A1807CC1C005B8026 /* CCImage.mm in Sources */,\n\t\t\t\t46A170CC1807CEBB005B8026 /* ray2.c in Sources */,\n\t\t\t\t460E44EF1807DED6000CDD6D /* mat4stack.c in Sources */,\n\t\t\t\t46A170CA1807CEBB005B8026 /* plane.c in Sources */,\n\t\t\t\t46A170EA1807CECA005B8026 /* CCPhysicsJoint.cpp in Sources */,\n\t\t\t\t46A170141807CBFC005B8026 /* CCFileUtilsApple.mm in Sources */,\n\t\t\t\t46A1701D1807CBFC005B8026 /* CCFileUtils.cpp in Sources */,\n\t\t\t\t46A170EF1807CECA005B8026 /* CCPhysicsWorld.cpp in Sources */,\n\t\t\t\t46A170C71807CEBB005B8026 /* mat3.c in Sources */,\n\t\t\t\t46A170521807CC1C005B8026 /* CCDevice.cpp in Sources */,\n\t\t\t\t46A170231807CBFC005B8026 /* CCSAXParser.cpp in Sources */,\n\t\t\t\t46A170ED1807CECA005B8026 /* CCPhysicsShape.cpp in Sources */,\n\t\t\t\t46A170C51807CEB0005B8026 /* aabb.c in Sources */,\n\t\t\t\t46A170171807CBFC005B8026 /* CCThread.mm in Sources */,\n\t\t\t\t46A170C81807CEBB005B8026 /* mat4.c in Sources */,\n\t\t\t\t46A170CB1807CEBB005B8026 /* quaternion.c in Sources */,\n\t\t\t\t46A170D01807CEBB005B8026 /* vec4.c in Sources */,\n\t\t\t\tED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */,\n\t\t\t\t46A170CE1807CEBB005B8026 /* vec2.c in Sources */,\n\t\t\t\t46A170541807CC1C005B8026 /* CCDirectorCaller.mm in Sources */,\n\t\t\t\t460E44F01807DED6000CDD6D /* matrix.c in Sources */,\n\t\t\t\t06CAAACB186AD7F20012A414 /* TriggerMng.cpp in Sources */,\n\t\t\t\t46A170511807CC1C005B8026 /* CCCommon.mm in Sources */,\n\t\t\t\t46A1701B1807CBFC005B8026 /* CCEGLViewProtocol.cpp in Sources */,\n\t\t\t\t46A170E61807CECA005B8026 /* CCPhysicsBody.cpp in Sources */,\n\t\t\t\t46A170151807CBFC005B8026 /* CCLock.cpp in Sources */,\n\t\t\t\tA04583F2189053B500E32FE8 /* CCEGLView.cpp in Sources */,\n\t\t\t\t46A170C91807CEBB005B8026 /* neon_matrix_impl.c in Sources */,\n\t\t\t\t46A170CF1807CEBB005B8026 /* vec3.c in Sources */,\n\t\t\t\t46A170E81807CECA005B8026 /* CCPhysicsContact.cpp in Sources */,\n\t\t\t\t46A170CD1807CEBB005B8026 /* utility.c in Sources */,\n\t\t\t\t46A170251807CBFC005B8026 /* CCThread.cpp in Sources */,\n\t\t\t\t1A570061180BC5A10088DEC7 /* CCAction.cpp in Sources */,\n\t\t\t\t1A570065180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */,\n\t\t\t\t1A570069180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */,\n\t\t\t\t1A57006D180BC5A10088DEC7 /* CCActionEase.cpp in Sources */,\n\t\t\t\t1A570071180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */,\n\t\t\t\t593BDCF6184D0A6E00C21E48 /* CCGroupCommand.cpp in Sources */,\n\t\t\t\tB37510761823AC9F00B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A570075180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */,\n\t\t\t\tB375107A1823AC9F00B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A570079180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */,\n\t\t\t\t1A57007D180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */,\n\t\t\t\t1A570081180BC5A10088DEC7 /* CCActionManager.cpp in Sources */,\n\t\t\t\t1A570085180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */,\n\t\t\t\t1A570089180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */,\n\t\t\t\t1A57008D180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */,\n\t\t\t\t1A570091180BC5A10088DEC7 /* CCActionTween.cpp in Sources */,\n\t\t\t\t1A570098180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */,\n\t\t\t\t1A57009E180BC5D20088DEC7 /* CCNode.cpp in Sources */,\n\t\t\t\t1A5700C5180BC6060088DEC7 /* atitc.cpp in Sources */,\n\t\t\t\tB37510781823AC9F00B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A5700C9180BC6060088DEC7 /* CCAffineTransform.cpp in Sources */,\n\t\t\t\t1A5700CD180BC6060088DEC7 /* CCArray.cpp in Sources */,\n\t\t\t\t1A5700D1180BC6060088DEC7 /* CCAutoreleasePool.cpp in Sources */,\n\t\t\t\t1A5700D7180BC6060088DEC7 /* CCData.cpp in Sources */,\n\t\t\t\t1A5700DB180BC6060088DEC7 /* CCDataVisitor.cpp in Sources */,\n\t\t\t\t1A5700DF180BC6060088DEC7 /* CCDictionary.cpp in Sources */,\n\t\t\t\t1A5700E7180BC6060088DEC7 /* CCGeometry.cpp in Sources */,\n\t\t\t\t1A5700ED180BC6060088DEC7 /* CCNS.cpp in Sources */,\n\t\t\t\t1A5700F1180BC6060088DEC7 /* CCObject.cpp in Sources */,\n\t\t\t\t1A5700F9180BC6060088DEC7 /* CCSet.cpp in Sources */,\n\t\t\t\t1A5700FD180BC6060088DEC7 /* CCString.cpp in Sources */,\n\t\t\t\t1A570101180BC6060088DEC7 /* etc1.cpp in Sources */,\n\t\t\t\t1A570105180BC6060088DEC7 /* s3tc.cpp in Sources */,\n\t\t\t\t1A57010E180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */,\n\t\t\t\t1A570112180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */,\n\t\t\t\t1A57011B180BC90D0088DEC7 /* CCGrabber.cpp in Sources */,\n\t\t\t\t1A57011F180BC90D0088DEC7 /* CCGrid.cpp in Sources */,\n\t\t\t\t1A57013A180BC9460088DEC7 /* CCEvent.cpp in Sources */,\n\t\t\t\t1A57013E180BC9460088DEC7 /* CCEventAcceleration.cpp in Sources */,\n\t\t\t\t1A570142180BC9460088DEC7 /* CCEventCustom.cpp in Sources */,\n\t\t\t\t1A570146180BC9460088DEC7 /* CCEventDispatcher.cpp in Sources */,\n\t\t\t\t1A57014A180BC9460088DEC7 /* CCEventKeyboard.cpp in Sources */,\n\t\t\t\t1A57014E180BC9460088DEC7 /* CCEventListener.cpp in Sources */,\n\t\t\t\t1A570152180BC9460088DEC7 /* CCEventListenerAcceleration.cpp in Sources */,\n\t\t\t\t1A570156180BC9460088DEC7 /* CCEventListenerCustom.cpp in Sources */,\n\t\t\t\t06C0F2EF186AD822003594D5 /* ObjectFactory.cpp in Sources */,\n\t\t\t\t1A57015A180BC9460088DEC7 /* CCEventListenerKeyboard.cpp in Sources */,\n\t\t\t\t1A57015E180BC9460088DEC7 /* CCEventListenerTouch.cpp in Sources */,\n\t\t\t\t1A570162180BC9460088DEC7 /* CCEventTouch.cpp in Sources */,\n\t\t\t\t1A57019D180BCB590088DEC7 /* CCFont.cpp in Sources */,\n\t\t\t\t1A5701A1180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */,\n\t\t\t\t1A5701A5180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */,\n\t\t\t\t1A5701B1180BCB590088DEC7 /* CCFontFNT.cpp in Sources */,\n\t\t\t\t1A5701B5180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */,\n\t\t\t\t1A5701B9180BCB5A0088DEC7 /* CCLabel.cpp in Sources */,\n\t\t\t\t1A5701BD180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */,\n\t\t\t\t1A5701C1180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */,\n\t\t\t\t1A087AE81860400400196EF5 /* edtaa3func.cpp in Sources */,\n\t\t\t\tB37510731823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A5701C7180BCB5A0088DEC7 /* CCLabelTextFormatter.cpp in Sources */,\n\t\t\t\t1A5701CB180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */,\n\t\t\t\t1A5701DE180BCB8C0088DEC7 /* CCLayer.cpp in Sources */,\n\t\t\t\t1A5701E2180BCB8C0088DEC7 /* CCScene.cpp in Sources */,\n\t\t\t\t1A5701E6180BCB8C0088DEC7 /* CCTransition.cpp in Sources */,\n\t\t\t\t1A5701EA180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */,\n\t\t\t\t1A5701EE180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */,\n\t\t\t\t1A5701F7180BCBAD0088DEC7 /* CCMenu.cpp in Sources */,\n\t\t\t\t1A5701FB180BCBAD0088DEC7 /* CCMenuItem.cpp in Sources */,\n\t\t\t\t1A570202180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */,\n\t\t\t\t06CAAACF186AD7FC0012A414 /* TriggerBase.cpp in Sources */,\n\t\t\t\t1A570208180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */,\n\t\t\t\t1A570210180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */,\n\t\t\t\t1A570214180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */,\n\t\t\t\t1A570221180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */,\n\t\t\t\t1A570225180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */,\n\t\t\t\t1A570229180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */,\n\t\t\t\t1A57022D180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */,\n\t\t\t\t1A570234180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */,\n\t\t\t\t1A57026B180BCC6F0088DEC7 /* CCShaderCache.cpp in Sources */,\n\t\t\t\t1A570271180BCC6F0088DEC7 /* ccShaders.cpp in Sources */,\n\t\t\t\t1A57027E180BCC900088DEC7 /* CCSprite.cpp in Sources */,\n\t\t\t\t1A570282180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */,\n\t\t\t\t1A570286180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */,\n\t\t\t\t1A57028A180BCC900088DEC7 /* CCSpriteFrameCache.cpp in Sources */,\n\t\t\t\t1A570292180BCCAB0088DEC7 /* CCAnimation.cpp in Sources */,\n\t\t\t\t1A570296180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */,\n\t\t\t\t1A57029D180BCD890088DEC7 /* base64.cpp in Sources */,\n\t\t\t\t1A5702A3180BCD980088DEC7 /* CCNotificationCenter.cpp in Sources */,\n\t\t\t\t1A5702A9180BCDAA0088DEC7 /* CCProfiling.cpp in Sources */,\n\t\t\t\t3774879F1869BA8C00EDF837 /* CCActionEaseEx.cpp in Sources */,\n\t\t\t\t59A79D551821E26E00F19697 /* CCEventMouse.cpp in Sources */,\n\t\t\t\t1A5702AF180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */,\n\t\t\t\t1A5702B5180BCDF40088DEC7 /* CCVertex.cpp in Sources */,\n\t\t\t\t1A5702C2180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */,\n\t\t\t\t1A5702C8180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */,\n\t\t\t\t1A5702D3180BCE570088DEC7 /* CCTexture2D.cpp in Sources */,\n\t\t\t\t1A5702D7180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */,\n\t\t\t\t50AE5EA3188749250007CFE3 /* CCBatchCommand.cpp in Sources */,\n\t\t\t\t1A5702DB180BCE570088DEC7 /* CCTextureCache.cpp in Sources */,\n\t\t\t\t1A5702EA180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */,\n\t\t\t\t1A5702EE180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */,\n\t\t\t\t1A5702F2180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */,\n\t\t\t\t1A5702F6180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */,\n\t\t\t\t1A5702FA180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */,\n\t\t\t\t1A570300180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */,\n\t\t\t\t1A570305180BCED90088DEC7 /* ccUtils.cpp in Sources */,\n\t\t\t\t1A57030C180BCF190088DEC7 /* CCComponent.cpp in Sources */,\n\t\t\t\t1A570310180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */,\n\t\t\t\t1A570319180BCF430088DEC7 /* ccCArray.cpp in Sources */,\n\t\t\t\tB37510711823AC9F00B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A570324180BCF660088DEC7 /* TGAlib.cpp in Sources */,\n\t\t\t\t1A57032F180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */,\n\t\t\t\t1A570333180BCFD50088DEC7 /* CCUserDefault.mm in Sources */,\n\t\t\t\t1A570335180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */,\n\t\t\t\t1A57033A180BCFFA0088DEC7 /* ZipUtils.cpp in Sources */,\n\t\t\t\t1A57034B180BD09B0088DEC7 /* tinyxml2.cpp in Sources */,\n\t\t\t\t1A570354180BD0B00088DEC7 /* ioapi.cpp in Sources */,\n\t\t\t\t1A570358180BD0B00088DEC7 /* unzip.cpp in Sources */,\n\t\t\t\t1A570533180BD9500088DEC7 /* CCGLProgram.cpp in Sources */,\n\t\t\t\t1A570537180BD9500088DEC7 /* ccGLStateCache.cpp in Sources */,\n\t\t\t\t1A570546180BD9C40088DEC7 /* CCTouch.cpp in Sources */,\n\t\t\t\t1AD71DA9180E26E600808F54 /* CCBAnimationManager.cpp in Sources */,\n\t\t\t\t1AD71DAD180E26E600808F54 /* CCBFileLoader.cpp in Sources */,\n\t\t\t\t1AD71DB1180E26E600808F54 /* CCBKeyframe.cpp in Sources */,\n\t\t\t\t1AD71DB7180E26E600808F54 /* CCBReader.cpp in Sources */,\n\t\t\t\t1AD71DBD180E26E600808F54 /* CCBSequence.cpp in Sources */,\n\t\t\t\t1AD71DC1180E26E600808F54 /* CCBSequenceProperty.cpp in Sources */,\n\t\t\t\t1AD71DC9180E26E600808F54 /* CCControlButtonLoader.cpp in Sources */,\n\t\t\t\t1AD71DCD180E26E600808F54 /* CCControlLoader.cpp in Sources */,\n\t\t\t\t1AE3C844184F14F700CF29B5 /* CCValue.cpp in Sources */,\n\t\t\t\t1AD71DD1180E26E600808F54 /* CCLabelBMFontLoader.cpp in Sources */,\n\t\t\t\t1AD71DD5180E26E600808F54 /* CCLabelTTFLoader.cpp in Sources */,\n\t\t\t\t1AD71DD9180E26E600808F54 /* CCLayerColorLoader.cpp in Sources */,\n\t\t\t\t1AD71DDD180E26E600808F54 /* CCLayerGradientLoader.cpp in Sources */,\n\t\t\t\t1AD71DE1180E26E600808F54 /* CCLayerLoader.cpp in Sources */,\n\t\t\t\t1AD71DE5180E26E600808F54 /* CCMenuItemImageLoader.cpp in Sources */,\n\t\t\t\t1AD71DE9180E26E600808F54 /* CCMenuItemLoader.cpp in Sources */,\n\t\t\t\t593BDCF2184D0A6E00C21E48 /* CCCustomCommand.cpp in Sources */,\n\t\t\t\t06CAAAC7186AD7E90012A414 /* TriggerObj.cpp in Sources */,\n\t\t\t\t1AD71DEF180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */,\n\t\t\t\t1AD71DF3180E26E600808F54 /* CCNodeLoader.cpp in Sources */,\n\t\t\t\t1AD71DF7180E26E600808F54 /* CCNodeLoaderLibrary.cpp in Sources */,\n\t\t\t\t1AD71DFD180E26E600808F54 /* CCParticleSystemQuadLoader.cpp in Sources */,\n\t\t\t\t1AD71E01180E26E600808F54 /* CCScale9SpriteLoader.cpp in Sources */,\n\t\t\t\t1AD71E05180E26E600808F54 /* CCScrollViewLoader.cpp in Sources */,\n\t\t\t\t1AD71E09180E26E600808F54 /* CCSpriteLoader.cpp in Sources */,\n\t\t\t\t1AD71E95180E26E600808F54 /* Animation.cpp in Sources */,\n\t\t\t\t1AD71E99180E26E600808F54 /* AnimationState.cpp in Sources */,\n\t\t\t\t1AD71E9D180E26E600808F54 /* AnimationStateData.cpp in Sources */,\n\t\t\t\t1AD71EA1180E26E600808F54 /* Atlas.cpp in Sources */,\n\t\t\t\t1AD71EA5180E26E600808F54 /* AtlasAttachmentLoader.cpp in Sources */,\n\t\t\t\t1AD71EA9180E26E600808F54 /* Attachment.cpp in Sources */,\n\t\t\t\t1AD71EAD180E26E600808F54 /* AttachmentLoader.cpp in Sources */,\n\t\t\t\t1AD71EB1180E26E600808F54 /* Bone.cpp in Sources */,\n\t\t\t\t1AD71EB5180E26E600808F54 /* BoneData.cpp in Sources */,\n\t\t\t\t1AD71EB9180E26E600808F54 /* CCSkeleton.cpp in Sources */,\n\t\t\t\t1AD71EBD180E26E600808F54 /* CCSkeletonAnimation.cpp in Sources */,\n\t\t\t\t1AD71EC1180E26E600808F54 /* extension.cpp in Sources */,\n\t\t\t\t1AD71EC5180E26E600808F54 /* Json.cpp in Sources */,\n\t\t\t\t1AD71EC9180E26E600808F54 /* RegionAttachment.cpp in Sources */,\n\t\t\t\t1AD71ECD180E26E600808F54 /* Skeleton.cpp in Sources */,\n\t\t\t\t1AD71ED1180E26E600808F54 /* SkeletonData.cpp in Sources */,\n\t\t\t\t1AD71ED5180E26E600808F54 /* SkeletonJson.cpp in Sources */,\n\t\t\t\t1AD71ED9180E26E600808F54 /* Skin.cpp in Sources */,\n\t\t\t\t1AD71EDD180E26E600808F54 /* Slot.cpp in Sources */,\n\t\t\t\t1AD71EE1180E26E600808F54 /* SlotData.cpp in Sources */,\n\t\t\t\t1AD71EE5180E26E600808F54 /* spine-cocos2dx.cpp in Sources */,\n\t\t\t\t1AAF536A180E3374000584C8 /* HttpClient.cpp in Sources */,\n\t\t\t\t1AAF5372180E3374000584C8 /* SocketIO.cpp in Sources */,\n\t\t\t\t1AAF5376180E3374000584C8 /* WebSocket.cpp in Sources */,\n\t\t\t\t1AAF584F180E40B9000584C8 /* LocalStorage.cpp in Sources */,\n\t\t\t\t1AAF5853180E40B9000584C8 /* LocalStorageAndroid.cpp in Sources */,\n\t\t\t\t5069133E185016C1009BBDD7 /* CCConsole.cpp in Sources */,\n\t\t\t\t1A9DCA15180E6955007A3AD4 /* CCConfiguration.cpp in Sources */,\n\t\t\t\t1A9DCA1D180E6955007A3AD4 /* CCDirector.cpp in Sources */,\n\t\t\t\t1A9DCA23180E6955007A3AD4 /* ccFPSImages.c in Sources */,\n\t\t\t\t1A9DCA27180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */,\n\t\t\t\t1A9DCA2F180E6955007A3AD4 /* CCScheduler.cpp in Sources */,\n\t\t\t\t1A9DCA37180E6955007A3AD4 /* cocos2d.cpp in Sources */,\n\t\t\t\t1A9DCA3D180E6955007A3AD4 /* TransformUtils.cpp in Sources */,\n\t\t\t\t1A9DCA43180E6D90007A3AD4 /* CCDeprecated.cpp in Sources */,\n\t\t\t\t1A9DCA49180E6DE3007A3AD4 /* ccTypes.cpp in Sources */,\n\t\t\t\t1A8C58EC180E92CC00EF57C3 /* CocosGUI.cpp in Sources */,\n\t\t\t\t1A8C58F0180E92CC00EF57C3 /* UILayout.cpp in Sources */,\n\t\t\t\t1A8C58F4180E92CC00EF57C3 /* UILayoutParameter.cpp in Sources */,\n\t\t\t\t1A8C58F8180E92CC00EF57C3 /* UIButton.cpp in Sources */,\n\t\t\t\t1A8C58FC180E92CC00EF57C3 /* UICheckBox.cpp in Sources */,\n\t\t\t\t1A8C5904180E92CC00EF57C3 /* UIHelper.cpp in Sources */,\n\t\t\t\t1A8C5908180E92CC00EF57C3 /* UIImageView.cpp in Sources */,\n\t\t\t\t1A8C5910180E92CC00EF57C3 /* UIText.cpp in Sources */,\n\t\t\t\t1A8C5914180E92CC00EF57C3 /* UITextAtlas.cpp in Sources */,\n\t\t\t\t1A8C5918180E92CC00EF57C3 /* UITextBMFont.cpp in Sources */,\n\t\t\t\t59A79D511821E26E00F19697 /* CCEventListenerMouse.cpp in Sources */,\n\t\t\t\t1A8C5920180E92CC00EF57C3 /* UILayoutDefine.cpp in Sources */,\n\t\t\t\t1A8C5928180E92CC00EF57C3 /* UILoadingBar.cpp in Sources */,\n\t\t\t\t1A8C592C180E92CC00EF57C3 /* UIPageView.cpp in Sources */,\n\t\t\t\t1A8C5936180E92CC00EF57C3 /* UIScrollView.cpp in Sources */,\n\t\t\t\t1A8C593A180E92CC00EF57C3 /* UISlider.cpp in Sources */,\n\t\t\t\t1A8C593E180E92CC00EF57C3 /* UITextField.cpp in Sources */,\n\t\t\t\t1A8C5942180E92CC00EF57C3 /* UIWidget.cpp in Sources */,\n\t\t\t\t1A8C598B180E930E00EF57C3 /* CCActionFrame.cpp in Sources */,\n\t\t\t\t1A8C598F180E930E00EF57C3 /* CCActionFrameEasing.cpp in Sources */,\n\t\t\t\t1A8C5993180E930E00EF57C3 /* CCActionManagerEx.cpp in Sources */,\n\t\t\t\t1A8C5997180E930E00EF57C3 /* CCActionNode.cpp in Sources */,\n\t\t\t\t1A8C599B180E930E00EF57C3 /* CCActionObject.cpp in Sources */,\n\t\t\t\t1A8C599F180E930E00EF57C3 /* CCArmature.cpp in Sources */,\n\t\t\t\t1A8C59A3180E930E00EF57C3 /* CCArmatureAnimation.cpp in Sources */,\n\t\t\t\t1A8C59A7180E930E00EF57C3 /* CCArmatureDataManager.cpp in Sources */,\n\t\t\t\t1A8C59AB180E930E00EF57C3 /* CCArmatureDefine.cpp in Sources */,\n\t\t\t\t1A8C59AF180E930E00EF57C3 /* CCBatchNode.cpp in Sources */,\n\t\t\t\t1A8C59B3180E930E00EF57C3 /* CCBone.cpp in Sources */,\n\t\t\t\t50A1FF1818290ED4001840C4 /* UIListView.cpp in Sources */,\n\t\t\t\t1A8C59B7180E930E00EF57C3 /* CCColliderDetector.cpp in Sources */,\n\t\t\t\t1A8C59BB180E930E00EF57C3 /* CCComAttribute.cpp in Sources */,\n\t\t\t\t1A8C59BF180E930E00EF57C3 /* CCComAudio.cpp in Sources */,\n\t\t\t\t1A8C59C3180E930E00EF57C3 /* CCComController.cpp in Sources */,\n\t\t\t\t1A8C59C7180E930E00EF57C3 /* CCComRender.cpp in Sources */,\n\t\t\t\t1A8C59CB180E930E00EF57C3 /* CCDataReaderHelper.cpp in Sources */,\n\t\t\t\t1A8C59CF180E930E00EF57C3 /* CCDatas.cpp in Sources */,\n\t\t\t\t1A8C59D3180E930E00EF57C3 /* CCDecorativeDisplay.cpp in Sources */,\n\t\t\t\t1A8C59D7180E930E00EF57C3 /* CCDisplayFactory.cpp in Sources */,\n\t\t\t\t1A8C59DB180E930E00EF57C3 /* CCDisplayManager.cpp in Sources */,\n\t\t\t\t1A8C59DF180E930E00EF57C3 /* CCInputDelegate.cpp in Sources */,\n\t\t\t\t1A8C59E3180E930E00EF57C3 /* CCProcessBase.cpp in Sources */,\n\t\t\t\t1A8C59E7180E930E00EF57C3 /* CCSGUIReader.cpp in Sources */,\n\t\t\t\t1A8C59EB180E930E00EF57C3 /* CCSkin.cpp in Sources */,\n\t\t\t\t1A8C59EF180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */,\n\t\t\t\t1A8C59F3180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */,\n\t\t\t\t1A8C59F7180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */,\n\t\t\t\t1A8C59FB180E930E00EF57C3 /* CCTween.cpp in Sources */,\n\t\t\t\t1A8C59FF180E930E00EF57C3 /* CCTweenFunction.cpp in Sources */,\n\t\t\t\t1A8C5A03180E930E00EF57C3 /* CCUtilMath.cpp in Sources */,\n\t\t\t\t1A8C5A0D180E930E00EF57C3 /* DictionaryHelper.cpp in Sources */,\n\t\t\t\t74AC8C8DDFD05322513C8C72 /* CCFrustum.cpp in Sources */,\n\t\t\t\t74AC8796ABB6761790CF8CC2 /* CCRenderer.cpp in Sources */,\n\t\t\t\t1ABA68AE1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */,\n\t\t\t\t74AC8CF1E05EA89BC441EEBC /* CCQuadCommand.cpp in Sources */,\n\t\t\t\t74AC897DFAB8043D3873A8F3 /* CCRenderCommand.cpp in Sources */,\n\t\t\t\t74AC85BC90D7CF01D652E8C3 /* CCRenderMaterial.cpp in Sources */,\n\t\t\t\t74AC83D0193BC28994D683E8 /* CCMaterialManager.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A119717178526AA00D62A44 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1F79180E88C300497A22 /* CCBProxy.cpp in Sources */,\n\t\t\t\t1A3B1F7D180E88C300497A22 /* CCLuaBridge.cpp in Sources */,\n\t\t\t\t1A3B1F81180E88C300497A22 /* CCLuaEngine.cpp in Sources */,\n\t\t\t\t15A71D9318921E6900F30AC0 /* udp.c in Sources */,\n\t\t\t\t15A71DA51892291500F30AC0 /* lua_extensions.c in Sources */,\n\t\t\t\t15A71D8318921E6900F30AC0 /* serial.c in Sources */,\n\t\t\t\tB362C3B41872BADF00F0BDF4 /* lua_cocos2dx_physics_manual.cpp in Sources */,\n\t\t\t\t1A3B1F85180E88C300497A22 /* CCLuaStack.cpp in Sources */,\n\t\t\t\t158E06DF181F6796008E01F6 /* lua_xml_http_request.cpp in Sources */,\n\t\t\t\t15A71D7F18921E6900F30AC0 /* select.c in Sources */,\n\t\t\t\t15A71D7B18921E6900F30AC0 /* options.c in Sources */,\n\t\t\t\t1A3B1F89180E88C300497A22 /* CCLuaValue.cpp in Sources */,\n\t\t\t\t1A3B1F8D180E88C300497A22 /* Cocos2dxLuaLoader.cpp in Sources */,\n\t\t\t\t15A71D8718921E6900F30AC0 /* socket_scripts.c in Sources */,\n\t\t\t\t1A3B1F91180E88C300497A22 /* lua_cocos2dx_deprecated.cpp in Sources */,\n\t\t\t\t15CA8D1A18697BE5000032AB /* LuaSkeletonAnimation.cpp in Sources */,\n\t\t\t\t1A3B1F95180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp in Sources */,\n\t\t\t\t1A3B1F99180E88C300497A22 /* lua_cocos2dx_manual.cpp in Sources */,\n\t\t\t\t15A71D6318921E6900F30AC0 /* except.c in Sources */,\n\t\t\t\t15A71D7718921E6900F30AC0 /* mime.c in Sources */,\n\t\t\t\t1585AB5C1828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp in Sources */,\n\t\t\t\t1A3B1F9D180E88C300497A22 /* Lua_web_socket.cpp in Sources */,\n\t\t\t\tB362C3AE1872BAB700F0BDF4 /* lua_cocos2dx_physics_auto.cpp in Sources */,\n\t\t\t\t1A3B1FA1180E88C300497A22 /* LuaBasicConversions.cpp in Sources */,\n\t\t\t\t1A3B1FA5180E88C300497A22 /* LuaOpengl.cpp in Sources */,\n\t\t\t\t15A71D9B18921E6900F30AC0 /* usocket.c in Sources */,\n\t\t\t\t1A3B1FA9180E88C300497A22 /* LuaScriptHandlerMgr.cpp in Sources */,\n\t\t\t\t15A71D6B18921E6900F30AC0 /* luasocket.c in Sources */,\n\t\t\t\t15CA8D0E18697A56000032AB /* lua_cocos2dx_spine_manual.cpp in Sources */,\n\t\t\t\t15A71D6718921E6900F30AC0 /* inet.c in Sources */,\n\t\t\t\t1A2C78A5181A11EC004E5527 /* lua_cocos2dx_auto.cpp in Sources */,\n\t\t\t\t1A3B1FB9180E88C300497A22 /* CCLuaObjcBridge.mm in Sources */,\n\t\t\t\t1A2C78B1181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp in Sources */,\n\t\t\t\t15A71D7318921E6900F30AC0 /* luasocket_io.c in Sources */,\n\t\t\t\t1A3B1FBB180E88C300497A22 /* tolua_fix.c in Sources */,\n\t\t\t\t1A8C5649180E8D0D00EF57C3 /* tolua_event.c in Sources */,\n\t\t\t\t15A71D8B18921E6900F30AC0 /* tcp.c in Sources */,\n\t\t\t\t15CA8D1418697AE1000032AB /* lua_cocos2dx_spine_auto.cpp in Sources */,\n\t\t\t\t15A71D8F18921E6900F30AC0 /* timeout.c in Sources */,\n\t\t\t\t1A8C564D180E8D0D00EF57C3 /* tolua_is.c in Sources */,\n\t\t\t\t1A8C564F180E8D0D00EF57C3 /* tolua_map.c in Sources */,\n\t\t\t\t1A8C5651180E8D0D00EF57C3 /* tolua_push.c in Sources */,\n\t\t\t\t1A8C5653180E8D0D00EF57C3 /* tolua_to.c in Sources */,\n\t\t\t\t15D6E846182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp in Sources */,\n\t\t\t\t15A71D5F18921E6900F30AC0 /* auxiliar.c in Sources */,\n\t\t\t\t15A71D6F18921E6900F30AC0 /* luasocket_buffer.c in Sources */,\n\t\t\t\t15F4C8831875637D0082884F /* lua_cocos2dx_gui_auto.cpp in Sources */,\n\t\t\t\t15A71D9718921E6900F30AC0 /* unix.c in Sources */,\n\t\t\t\t15F4CA201875885A0082884F /* lua_cocos2dx_gui_manual.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB50517854BC200CDF010 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1F78180E88C300497A22 /* CCBProxy.cpp in Sources */,\n\t\t\t\t1A3B1F7C180E88C300497A22 /* CCLuaBridge.cpp in Sources */,\n\t\t\t\t1A3B1F80180E88C300497A22 /* CCLuaEngine.cpp in Sources */,\n\t\t\t\t15A71D9218921E6900F30AC0 /* udp.c in Sources */,\n\t\t\t\t15A71DA41892291500F30AC0 /* lua_extensions.c in Sources */,\n\t\t\t\t15A71D8218921E6900F30AC0 /* serial.c in Sources */,\n\t\t\t\tB362C3B21872BADC00F0BDF4 /* lua_cocos2dx_physics_manual.cpp in Sources */,\n\t\t\t\t1A3B1F84180E88C300497A22 /* CCLuaStack.cpp in Sources */,\n\t\t\t\t158E06DE181F6796008E01F6 /* lua_xml_http_request.cpp in Sources */,\n\t\t\t\t15A71D7E18921E6900F30AC0 /* select.c in Sources */,\n\t\t\t\t15A71D7A18921E6900F30AC0 /* options.c in Sources */,\n\t\t\t\t1A3B1F88180E88C300497A22 /* CCLuaValue.cpp in Sources */,\n\t\t\t\t1A3B1F8C180E88C300497A22 /* Cocos2dxLuaLoader.cpp in Sources */,\n\t\t\t\t15A71D8618921E6900F30AC0 /* socket_scripts.c in Sources */,\n\t\t\t\t1A3B1F90180E88C300497A22 /* lua_cocos2dx_deprecated.cpp in Sources */,\n\t\t\t\t15CA8D1918697BE5000032AB /* LuaSkeletonAnimation.cpp in Sources */,\n\t\t\t\t1A3B1F94180E88C300497A22 /* lua_cocos2dx_extension_manual.cpp in Sources */,\n\t\t\t\t1A3B1F98180E88C300497A22 /* lua_cocos2dx_manual.cpp in Sources */,\n\t\t\t\t15A71D6218921E6900F30AC0 /* except.c in Sources */,\n\t\t\t\t15A71D7618921E6900F30AC0 /* mime.c in Sources */,\n\t\t\t\t1585AB5B1828D74F00000FB5 /* lua_cocos2dx_studio_auto.cpp in Sources */,\n\t\t\t\t1A3B1F9C180E88C300497A22 /* Lua_web_socket.cpp in Sources */,\n\t\t\t\tB362C3B01872BABC00F0BDF4 /* lua_cocos2dx_physics_auto.cpp in Sources */,\n\t\t\t\t1A3B1FA0180E88C300497A22 /* LuaBasicConversions.cpp in Sources */,\n\t\t\t\t1A3B1FA4180E88C300497A22 /* LuaOpengl.cpp in Sources */,\n\t\t\t\t15A71D9A18921E6900F30AC0 /* usocket.c in Sources */,\n\t\t\t\t1A3B1FA8180E88C300497A22 /* LuaScriptHandlerMgr.cpp in Sources */,\n\t\t\t\t15A71D6A18921E6900F30AC0 /* luasocket.c in Sources */,\n\t\t\t\t15CA8D0D18697A56000032AB /* lua_cocos2dx_spine_manual.cpp in Sources */,\n\t\t\t\t15A71D6618921E6900F30AC0 /* inet.c in Sources */,\n\t\t\t\t1A2C78A3181A11EC004E5527 /* lua_cocos2dx_auto.cpp in Sources */,\n\t\t\t\t1A3B1FB8180E88C300497A22 /* CCLuaObjcBridge.mm in Sources */,\n\t\t\t\t1A2C78AF181A11EC004E5527 /* lua_cocos2dx_extension_auto.cpp in Sources */,\n\t\t\t\t15A71D7218921E6900F30AC0 /* luasocket_io.c in Sources */,\n\t\t\t\t1A3B1FBA180E88C300497A22 /* tolua_fix.c in Sources */,\n\t\t\t\t1A8C5648180E8D0D00EF57C3 /* tolua_event.c in Sources */,\n\t\t\t\t15A71D8A18921E6900F30AC0 /* tcp.c in Sources */,\n\t\t\t\t15CA8D1318697AE1000032AB /* lua_cocos2dx_spine_auto.cpp in Sources */,\n\t\t\t\t15A71D8E18921E6900F30AC0 /* timeout.c in Sources */,\n\t\t\t\t1A8C564C180E8D0D00EF57C3 /* tolua_is.c in Sources */,\n\t\t\t\t1A8C564E180E8D0D00EF57C3 /* tolua_map.c in Sources */,\n\t\t\t\t1A8C5650180E8D0D00EF57C3 /* tolua_push.c in Sources */,\n\t\t\t\t1A8C5652180E8D0D00EF57C3 /* tolua_to.c in Sources */,\n\t\t\t\t15D6E845182B81710003C5B1 /* lua_cocos2dx_coco_studio_manual.cpp in Sources */,\n\t\t\t\t15A71D5E18921E6900F30AC0 /* auxiliar.c in Sources */,\n\t\t\t\t15A71D6E18921E6900F30AC0 /* luasocket_buffer.c in Sources */,\n\t\t\t\t15F4C8821875637D0082884F /* lua_cocos2dx_gui_auto.cpp in Sources */,\n\t\t\t\t15A71D9618921E6900F30AC0 /* unix.c in Sources */,\n\t\t\t\t15F4CA1F1875885A0082884F /* lua_cocos2dx_gui_manual.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2B791780BD04006731B9 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A1740A1807D365005B8026 /* cpSpaceQuery.c in Sources */,\n\t\t\t\t46A174061807D365005B8026 /* cpShape.c in Sources */,\n\t\t\t\t46A174001807D365005B8026 /* cpBB.c in Sources */,\n\t\t\t\t46A173F91807D365005B8026 /* cpPivotJoint.c in Sources */,\n\t\t\t\t46A174011807D365005B8026 /* cpBBTree.c in Sources */,\n\t\t\t\t46A173D51807D35A005B8026 /* chipmunk.c in Sources */,\n\t\t\t\t46A174021807D365005B8026 /* cpBody.c in Sources */,\n\t\t\t\t46A173FC1807D365005B8026 /* cpSimpleMotor.c in Sources */,\n\t\t\t\t46A173F31807D365005B8026 /* cpConstraint.c in Sources */,\n\t\t\t\t46A174081807D365005B8026 /* cpSpaceComponent.c in Sources */,\n\t\t\t\t46A174091807D365005B8026 /* cpSpaceHash.c in Sources */,\n\t\t\t\t46A173F81807D365005B8026 /* cpPinJoint.c in Sources */,\n\t\t\t\t46A1740D1807D365005B8026 /* cpSweep1D.c in Sources */,\n\t\t\t\t46A173F51807D365005B8026 /* cpDampedSpring.c in Sources */,\n\t\t\t\t46A1740B1807D365005B8026 /* cpSpaceStep.c in Sources */,\n\t\t\t\t46A173F71807D365005B8026 /* cpGrooveJoint.c in Sources */,\n\t\t\t\t46A174051807D365005B8026 /* cpPolyShape.c in Sources */,\n\t\t\t\t46A1740E1807D365005B8026 /* cpVect.c in Sources */,\n\t\t\t\t46A173FD1807D365005B8026 /* cpSlideJoint.c in Sources */,\n\t\t\t\t46A173FB1807D365005B8026 /* cpRotaryLimitJoint.c in Sources */,\n\t\t\t\t46A174041807D365005B8026 /* cpHashSet.c in Sources */,\n\t\t\t\t46A173FE1807D365005B8026 /* cpArbiter.c in Sources */,\n\t\t\t\t46A173FF1807D365005B8026 /* cpArray.c in Sources */,\n\t\t\t\t46A173F61807D365005B8026 /* cpGearJoint.c in Sources */,\n\t\t\t\t46A174031807D365005B8026 /* cpCollision.c in Sources */,\n\t\t\t\t46A174071807D365005B8026 /* cpSpace.c in Sources */,\n\t\t\t\t46A173FA1807D365005B8026 /* cpRatchetJoint.c in Sources */,\n\t\t\t\t46A173F41807D365005B8026 /* cpDampedRotarySpring.c in Sources */,\n\t\t\t\t46A1740C1807D365005B8026 /* cpSpatialIndex.c in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2D5E1780BDF7006731B9 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF528B180E2ECC000584C8 /* b2BroadPhase.cpp in Sources */,\n\t\t\t\t1AAF528D180E2ECC000584C8 /* b2CollideCircle.cpp in Sources */,\n\t\t\t\t1AAF528E180E2ECC000584C8 /* b2CollideEdge.cpp in Sources */,\n\t\t\t\t1AAF528F180E2ECC000584C8 /* b2CollidePolygon.cpp in Sources */,\n\t\t\t\t1AAF5290180E2ECC000584C8 /* b2Collision.cpp in Sources */,\n\t\t\t\t1AAF5292180E2ECC000584C8 /* b2Distance.cpp in Sources */,\n\t\t\t\t1AAF5294180E2ECC000584C8 /* b2DynamicTree.cpp in Sources */,\n\t\t\t\t1AAF5296180E2ECC000584C8 /* b2TimeOfImpact.cpp in Sources */,\n\t\t\t\t1AAF52B0180E2EE9000584C8 /* b2ChainShape.cpp in Sources */,\n\t\t\t\t1AAF52B2180E2EE9000584C8 /* b2CircleShape.cpp in Sources */,\n\t\t\t\t1AAF52B4180E2EE9000584C8 /* b2EdgeShape.cpp in Sources */,\n\t\t\t\t1AAF52B6180E2EE9000584C8 /* b2PolygonShape.cpp in Sources */,\n\t\t\t\t1AAF52C6180E2EEF000584C8 /* b2BlockAllocator.cpp in Sources */,\n\t\t\t\t1AAF52C8180E2EEF000584C8 /* b2Draw.cpp in Sources */,\n\t\t\t\t1AAF52CB180E2EEF000584C8 /* b2Math.cpp in Sources */,\n\t\t\t\t1AAF52CD180E2EEF000584C8 /* b2Settings.cpp in Sources */,\n\t\t\t\t1AAF52CF180E2EEF000584C8 /* b2StackAllocator.cpp in Sources */,\n\t\t\t\t1AAF52D1180E2EEF000584C8 /* b2Timer.cpp in Sources */,\n\t\t\t\t1AAF52D3180E2EF5000584C8 /* b2Body.cpp in Sources */,\n\t\t\t\t1AAF52D5180E2EF5000584C8 /* b2ContactManager.cpp in Sources */,\n\t\t\t\t1AAF52D7180E2EF5000584C8 /* b2Fixture.cpp in Sources */,\n\t\t\t\t1AAF52D9180E2EF5000584C8 /* b2Island.cpp in Sources */,\n\t\t\t\t1AAF52DC180E2EF5000584C8 /* b2World.cpp in Sources */,\n\t\t\t\t1AAF52DE180E2EF5000584C8 /* b2WorldCallbacks.cpp in Sources */,\n\t\t\t\t1AAF52FF180E2EFE000584C8 /* b2ChainAndCircleContact.cpp in Sources */,\n\t\t\t\t1AAF5301180E2EFE000584C8 /* b2ChainAndPolygonContact.cpp in Sources */,\n\t\t\t\t1AAF5303180E2EFE000584C8 /* b2CircleContact.cpp in Sources */,\n\t\t\t\t1AAF5305180E2EFE000584C8 /* b2Contact.cpp in Sources */,\n\t\t\t\t1AAF5307180E2EFE000584C8 /* b2ContactSolver.cpp in Sources */,\n\t\t\t\t1AAF5309180E2EFE000584C8 /* b2EdgeAndCircleContact.cpp in Sources */,\n\t\t\t\tB3AF01A01842FBA400A98B85 /* b2MotorJoint.cpp in Sources */,\n\t\t\t\t1AAF530B180E2EFE000584C8 /* b2EdgeAndPolygonContact.cpp in Sources */,\n\t\t\t\t1AAF530D180E2EFE000584C8 /* b2PolygonAndCircleContact.cpp in Sources */,\n\t\t\t\t1AAF530F180E2EFE000584C8 /* b2PolygonContact.cpp in Sources */,\n\t\t\t\t1AAF5311180E2F04000584C8 /* b2DistanceJoint.cpp in Sources */,\n\t\t\t\t1AAF5313180E2F04000584C8 /* b2FrictionJoint.cpp in Sources */,\n\t\t\t\t1AAF5315180E2F04000584C8 /* b2GearJoint.cpp in Sources */,\n\t\t\t\t1AAF5317180E2F04000584C8 /* b2Joint.cpp in Sources */,\n\t\t\t\t1AAF5319180E2F04000584C8 /* b2MouseJoint.cpp in Sources */,\n\t\t\t\t1AAF531B180E2F04000584C8 /* b2PrismaticJoint.cpp in Sources */,\n\t\t\t\t1AAF531D180E2F04000584C8 /* b2PulleyJoint.cpp in Sources */,\n\t\t\t\t1AAF531F180E2F04000584C8 /* b2RevoluteJoint.cpp in Sources */,\n\t\t\t\t1AAF5321180E2F04000584C8 /* b2RopeJoint.cpp in Sources */,\n\t\t\t\t1AAF5323180E2F04000584C8 /* b2WeldJoint.cpp in Sources */,\n\t\t\t\t1AAF5325180E2F04000584C8 /* b2WheelJoint.cpp in Sources */,\n\t\t\t\t1AAF533D180E2F10000584C8 /* b2Rope.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2E9917814268006731B9 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A1604F1807A5D4005B8026 /* SimpleAudioEngine_objc.m in Sources */,\n\t\t\t\t46A1604A1807A5D4005B8026 /* CDXMacOSXSupport.mm in Sources */,\n\t\t\t\t46A1604D1807A5D4005B8026 /* SimpleAudioEngine.mm in Sources */,\n\t\t\t\t46A1604C1807A5D4005B8026 /* CocosDenshion.m in Sources */,\n\t\t\t\t46A160451807A5D4005B8026 /* CDAudioManager.m in Sources */,\n\t\t\t\t46A160481807A5D4005B8026 /* CDOpenALSupport.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F2FC217814595006731B9 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E477D18080902000CDD6D /* CCControl.cpp in Sources */,\n\t\t\t\t460E47CB18080913000CDD6D /* CCScrollView.cpp in Sources */,\n\t\t\t\t460E47D118080913000CDD6D /* CCTableViewCell.cpp in Sources */,\n\t\t\t\t460E47CF18080913000CDD6D /* CCTableView.cpp in Sources */,\n\t\t\t\t460E478618080902000CDD6D /* CCControlPotentiometer.cpp in Sources */,\n\t\t\t\t460E478C18080902000CDD6D /* CCControlStepper.cpp in Sources */,\n\t\t\t\t460E47BB1808090B000CDD6D /* CCEditBoxImplWin.cpp in Sources */,\n\t\t\t\t460E47B21808090B000CDD6D /* CCEditBoxImplAndroid.cpp in Sources */,\n\t\t\t\t460E47B81808090B000CDD6D /* CCEditBoxImplNone.cpp in Sources */,\n\t\t\t\t460E478418080902000CDD6D /* CCControlHuePicker.cpp in Sources */,\n\t\t\t\t460E478A18080902000CDD6D /* CCControlSlider.cpp in Sources */,\n\t\t\t\t460E478818080902000CDD6D /* CCControlSaturationBrightnessPicker.cpp in Sources */,\n\t\t\t\t460E47B91808090B000CDD6D /* CCEditBoxImplTizen.cpp in Sources */,\n\t\t\t\t460E47B51808090B000CDD6D /* CCEditBoxImplIOS.mm in Sources */,\n\t\t\t\t460E478E18080902000CDD6D /* CCControlSwitch.cpp in Sources */,\n\t\t\t\t460E479218080902000CDD6D /* CCInvocation.cpp in Sources */,\n\t\t\t\t460E477F18080902000CDD6D /* CCControlButton.cpp in Sources */,\n\t\t\t\t460E47B71808090B000CDD6D /* CCEditBoxImplMac.mm in Sources */,\n\t\t\t\t460E47AF1808090B000CDD6D /* CCEditBox.cpp in Sources */,\n\t\t\t\t460E479418080902000CDD6D /* CCScale9Sprite.cpp in Sources */,\n\t\t\t\t460E478118080902000CDD6D /* CCControlColourPicker.cpp in Sources */,\n\t\t\t\t460E479018080902000CDD6D /* CCControlUtils.cpp in Sources */,\n\t\t\t\t1AD71EF0180E27CF00808F54 /* CCPhysicsDebugNode.cpp in Sources */,\n\t\t\t\t1AD71EF4180E27CF00808F54 /* CCPhysicsSprite.cpp in Sources */,\n\t\t\t\t1AAF5353180E3060000584C8 /* AssetsManager.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA03F31E91781479B006731B9 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3EEF8BD5183A001B005E8A6C /* jsb_cocos2dx_gui_auto.cpp in Sources */,\n\t\t\t\t3EEF8BD6183A001B005E8A6C /* jsb_cocos2dx_gui_manual.cpp in Sources */,\n\t\t\t\t1A2C791D181A1257004E5527 /* js_bindings_chipmunk_registration.cpp in Sources */,\n\t\t\t\t1A2C793D181A1257004E5527 /* js_bindings_opengl.cpp in Sources */,\n\t\t\t\t1A2C794F181A1257004E5527 /* jsb_opengl_registration.cpp in Sources */,\n\t\t\t\t1A2C7959181A1257004E5527 /* js_bindings_system_registration.cpp in Sources */,\n\t\t\t\t1A2C7919181A1257004E5527 /* js_bindings_chipmunk_manual.cpp in Sources */,\n\t\t\t\t1A2C792F181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp in Sources */,\n\t\t\t\t1A2C7965181A1257004E5527 /* ScriptingCore.cpp in Sources */,\n\t\t\t\t1A2C790D181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp in Sources */,\n\t\t\t\t1A2C7913181A1257004E5527 /* js_bindings_chipmunk_functions.cpp in Sources */,\n\t\t\t\t1A2C7933181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp in Sources */,\n\t\t\t\t1A2C7947181A1257004E5527 /* jsb_opengl_functions.cpp in Sources */,\n\t\t\t\t1A2C7927181A1257004E5527 /* js_bindings_ccbreader.cpp in Sources */,\n\t\t\t\t1A2C7872181A11EC004E5527 /* jsb_cocos2dx_auto.cpp in Sources */,\n\t\t\t\t1A2C7939181A1257004E5527 /* js_bindings_core.cpp in Sources */,\n\t\t\t\t1A2C794B181A1257004E5527 /* jsb_opengl_manual.cpp in Sources */,\n\t\t\t\t1A2C787E181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp in Sources */,\n\t\t\t\t1A2C7941181A1257004E5527 /* js_manual_conversions.cpp in Sources */,\n\t\t\t\t1A2C7921181A1257004E5527 /* cocos2d_specifics.cpp in Sources */,\n\t\t\t\t1A2C788A181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp in Sources */,\n\t\t\t\t1A2C7953181A1257004E5527 /* js_bindings_system_functions.cpp in Sources */,\n\t\t\t\t1A2C7896181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp in Sources */,\n\t\t\t\t1A2C795D181A1257004E5527 /* jsb_websocket.cpp in Sources */,\n\t\t\t\t1A2C7961181A1257004E5527 /* XMLHTTPRequest.cpp in Sources */,\n\t\t\t\t2AFCB8231863D6B200EB4B5C /* jsb_cocos2dx_spine_auto.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4C251783777C0073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2AC795E318628746005EC8E1 /* SkeletonBounds.cpp in Sources */,\n\t\t\t\t2AC795E418628746005EC8E1 /* Event.cpp in Sources */,\n\t\t\t\t2AC795E518628746005EC8E1 /* EventData.cpp in Sources */,\n\t\t\t\t2AC795E618628746005EC8E1 /* BoundingBoxAttachment.cpp in Sources */,\n\t\t\t\t46A1703C1807CC07005B8026 /* CCApplication.mm in Sources */,\n\t\t\t\t46A170471807CC07005B8026 /* CCImage.mm in Sources */,\n\t\t\t\t46A170D61807CEBC005B8026 /* ray2.c in Sources */,\n\t\t\t\t460E44F11807DED7000CDD6D /* mat4stack.c in Sources */,\n\t\t\t\t46A170D41807CEBC005B8026 /* plane.c in Sources */,\n\t\t\t\t46A1704B1807CC07005B8026 /* EAGLView.mm in Sources */,\n\t\t\t\t46A171001807CECB005B8026 /* CCPhysicsJoint.cpp in Sources */,\n\t\t\t\t46A170441807CC07005B8026 /* CCES2Renderer.m in Sources */,\n\t\t\t\t46A170281807CBFE005B8026 /* CCFileUtilsApple.mm in Sources */,\n\t\t\t\t46A170311807CBFE005B8026 /* CCFileUtils.cpp in Sources */,\n\t\t\t\t46A171051807CECB005B8026 /* CCPhysicsWorld.cpp in Sources */,\n\t\t\t\t46A170D11807CEBC005B8026 /* mat3.c in Sources */,\n\t\t\t\t46A1704E1807CC11005B8026 /* AccelerometerSimulation.m in Sources */,\n\t\t\t\t46A1703E1807CC07005B8026 /* CCDevice.mm in Sources */,\n\t\t\t\t46A171031807CECB005B8026 /* CCPhysicsShape.cpp in Sources */,\n\t\t\t\t46A170371807CBFE005B8026 /* CCSAXParser.cpp in Sources */,\n\t\t\t\t46A170C61807CEB2005B8026 /* aabb.c in Sources */,\n\t\t\t\t46A1702B1807CBFE005B8026 /* CCThread.mm in Sources */,\n\t\t\t\t46A170D21807CEBC005B8026 /* mat4.c in Sources */,\n\t\t\t\t46A170D51807CEBC005B8026 /* quaternion.c in Sources */,\n\t\t\t\tED9C6A9518599AD8000A5232 /* CCNodeGrid.cpp in Sources */,\n\t\t\t\t46A170DA1807CEBC005B8026 /* vec4.c in Sources */,\n\t\t\t\t46A170D81807CEBC005B8026 /* vec2.c in Sources */,\n\t\t\t\t46A170401807CC07005B8026 /* CCDirectorCaller.mm in Sources */,\n\t\t\t\t460E44F21807DED8000CDD6D /* matrix.c in Sources */,\n\t\t\t\t06CAAACC186AD7F50012A414 /* TriggerMng.cpp in Sources */,\n\t\t\t\t46A1703D1807CC07005B8026 /* CCCommon.mm in Sources */,\n\t\t\t\t46A1702F1807CBFE005B8026 /* CCEGLViewProtocol.cpp in Sources */,\n\t\t\t\t46A170FC1807CECB005B8026 /* CCPhysicsBody.cpp in Sources */,\n\t\t\t\t46A170291807CBFE005B8026 /* CCLock.cpp in Sources */,\n\t\t\t\t46A170D31807CEBC005B8026 /* neon_matrix_impl.c in Sources */,\n\t\t\t\t46A170D91807CEBC005B8026 /* vec3.c in Sources */,\n\t\t\t\t46A170FE1807CECB005B8026 /* CCPhysicsContact.cpp in Sources */,\n\t\t\t\t46A170D71807CEBC005B8026 /* utility.c in Sources */,\n\t\t\t\t46A170391807CBFE005B8026 /* CCThread.cpp in Sources */,\n\t\t\t\t46A170421807CC07005B8026 /* CCEGLView.mm in Sources */,\n\t\t\t\t1A570062180BC5A10088DEC7 /* CCAction.cpp in Sources */,\n\t\t\t\t1A570066180BC5A10088DEC7 /* CCActionCamera.cpp in Sources */,\n\t\t\t\t1A57006A180BC5A10088DEC7 /* CCActionCatmullRom.cpp in Sources */,\n\t\t\t\t1A57006E180BC5A10088DEC7 /* CCActionEase.cpp in Sources */,\n\t\t\t\t1A570072180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */,\n\t\t\t\t593BDCF7184D0A6E00C21E48 /* CCGroupCommand.cpp in Sources */,\n\t\t\t\tB37510811823ACA100B3BA6A /* CCPhysicsJointInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A570076180BC5A10088DEC7 /* CCActionGrid3D.cpp in Sources */,\n\t\t\t\tB37510851823ACA100B3BA6A /* CCPhysicsWorldInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A57007A180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */,\n\t\t\t\t1A57007E180BC5A10088DEC7 /* CCActionInterval.cpp in Sources */,\n\t\t\t\t1A570082180BC5A10088DEC7 /* CCActionManager.cpp in Sources */,\n\t\t\t\t1A570086180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */,\n\t\t\t\t1A57008A180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */,\n\t\t\t\t1A57008E180BC5A10088DEC7 /* CCActionTiledGrid.cpp in Sources */,\n\t\t\t\t1A570092180BC5A10088DEC7 /* CCActionTween.cpp in Sources */,\n\t\t\t\t1A570099180BC5C10088DEC7 /* CCAtlasNode.cpp in Sources */,\n\t\t\t\t1A57009F180BC5D20088DEC7 /* CCNode.cpp in Sources */,\n\t\t\t\t1A5700C6180BC6060088DEC7 /* atitc.cpp in Sources */,\n\t\t\t\tB37510831823ACA100B3BA6A /* CCPhysicsShapeInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A5700CA180BC6060088DEC7 /* CCAffineTransform.cpp in Sources */,\n\t\t\t\t1A5700CE180BC6060088DEC7 /* CCArray.cpp in Sources */,\n\t\t\t\t1A5700D2180BC6060088DEC7 /* CCAutoreleasePool.cpp in Sources */,\n\t\t\t\t1A5700D8180BC6060088DEC7 /* CCData.cpp in Sources */,\n\t\t\t\t1A5700DC180BC6060088DEC7 /* CCDataVisitor.cpp in Sources */,\n\t\t\t\t1A5700E0180BC6060088DEC7 /* CCDictionary.cpp in Sources */,\n\t\t\t\t1A5700E8180BC6060088DEC7 /* CCGeometry.cpp in Sources */,\n\t\t\t\t1A5700EE180BC6060088DEC7 /* CCNS.cpp in Sources */,\n\t\t\t\t1A5700F2180BC6060088DEC7 /* CCObject.cpp in Sources */,\n\t\t\t\t1A5700FA180BC6060088DEC7 /* CCSet.cpp in Sources */,\n\t\t\t\t1A5700FE180BC6060088DEC7 /* CCString.cpp in Sources */,\n\t\t\t\t1A570102180BC6060088DEC7 /* etc1.cpp in Sources */,\n\t\t\t\t1A570106180BC6060088DEC7 /* s3tc.cpp in Sources */,\n\t\t\t\t1A57010F180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */,\n\t\t\t\t1A570113180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */,\n\t\t\t\t1A57011C180BC90D0088DEC7 /* CCGrabber.cpp in Sources */,\n\t\t\t\t1A570120180BC90D0088DEC7 /* CCGrid.cpp in Sources */,\n\t\t\t\t1A57013B180BC9460088DEC7 /* CCEvent.cpp in Sources */,\n\t\t\t\t1A57013F180BC9460088DEC7 /* CCEventAcceleration.cpp in Sources */,\n\t\t\t\t1A570143180BC9460088DEC7 /* CCEventCustom.cpp in Sources */,\n\t\t\t\t1A570147180BC9460088DEC7 /* CCEventDispatcher.cpp in Sources */,\n\t\t\t\t1A57014B180BC9460088DEC7 /* CCEventKeyboard.cpp in Sources */,\n\t\t\t\t1A57014F180BC9460088DEC7 /* CCEventListener.cpp in Sources */,\n\t\t\t\t1A570153180BC9460088DEC7 /* CCEventListenerAcceleration.cpp in Sources */,\n\t\t\t\t1A570157180BC9460088DEC7 /* CCEventListenerCustom.cpp in Sources */,\n\t\t\t\t06C0F2F0186AD824003594D5 /* ObjectFactory.cpp in Sources */,\n\t\t\t\t1A57015B180BC9460088DEC7 /* CCEventListenerKeyboard.cpp in Sources */,\n\t\t\t\t1A57015F180BC9460088DEC7 /* CCEventListenerTouch.cpp in Sources */,\n\t\t\t\t1A570163180BC9460088DEC7 /* CCEventTouch.cpp in Sources */,\n\t\t\t\t1A57019E180BCB590088DEC7 /* CCFont.cpp in Sources */,\n\t\t\t\t1A5701A2180BCB590088DEC7 /* CCFontAtlas.cpp in Sources */,\n\t\t\t\t1A5701A6180BCB590088DEC7 /* CCFontAtlasCache.cpp in Sources */,\n\t\t\t\t1A5701B2180BCB590088DEC7 /* CCFontFNT.cpp in Sources */,\n\t\t\t\t1A5701B6180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */,\n\t\t\t\t1A5701BA180BCB5A0088DEC7 /* CCLabel.cpp in Sources */,\n\t\t\t\t1A5701BE180BCB5A0088DEC7 /* CCLabelAtlas.cpp in Sources */,\n\t\t\t\t1A5701C2180BCB5A0088DEC7 /* CCLabelBMFont.cpp in Sources */,\n\t\t\t\t1A087AE91860400400196EF5 /* edtaa3func.cpp in Sources */,\n\t\t\t\t06CAAAC4186AD7DF0012A414 /* CCActionEaseEx.cpp in Sources */,\n\t\t\t\tB375107E1823ACA100B3BA6A /* CCPhysicsContactInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A5701C8180BCB5A0088DEC7 /* CCLabelTextFormatter.cpp in Sources */,\n\t\t\t\t1A5701CC180BCB5A0088DEC7 /* CCLabelTTF.cpp in Sources */,\n\t\t\t\t1A5701DF180BCB8C0088DEC7 /* CCLayer.cpp in Sources */,\n\t\t\t\t1A5701E3180BCB8C0088DEC7 /* CCScene.cpp in Sources */,\n\t\t\t\t1A5701E7180BCB8C0088DEC7 /* CCTransition.cpp in Sources */,\n\t\t\t\t1A5701EB180BCB8C0088DEC7 /* CCTransitionPageTurn.cpp in Sources */,\n\t\t\t\t1A5701EF180BCB8C0088DEC7 /* CCTransitionProgress.cpp in Sources */,\n\t\t\t\t1A5701F8180BCBAD0088DEC7 /* CCMenu.cpp in Sources */,\n\t\t\t\t1A5701FC180BCBAD0088DEC7 /* CCMenuItem.cpp in Sources */,\n\t\t\t\t06CAAAD0186AD7FE0012A414 /* TriggerBase.cpp in Sources */,\n\t\t\t\t1A570203180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */,\n\t\t\t\t1A570209180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */,\n\t\t\t\t1A570211180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */,\n\t\t\t\t1A570215180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */,\n\t\t\t\t1A570222180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */,\n\t\t\t\t1A570226180BCC1A0088DEC7 /* CCParticleExamples.cpp in Sources */,\n\t\t\t\t1A57022A180BCC1A0088DEC7 /* CCParticleSystem.cpp in Sources */,\n\t\t\t\t1A57022E180BCC1A0088DEC7 /* CCParticleSystemQuad.cpp in Sources */,\n\t\t\t\t1A570235180BCC4D0088DEC7 /* CCScriptSupport.cpp in Sources */,\n\t\t\t\t1A57026C180BCC6F0088DEC7 /* CCShaderCache.cpp in Sources */,\n\t\t\t\t1A570272180BCC6F0088DEC7 /* ccShaders.cpp in Sources */,\n\t\t\t\t1A57027F180BCC900088DEC7 /* CCSprite.cpp in Sources */,\n\t\t\t\t1A570283180BCC900088DEC7 /* CCSpriteBatchNode.cpp in Sources */,\n\t\t\t\t1A570287180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */,\n\t\t\t\t1A57028B180BCC900088DEC7 /* CCSpriteFrameCache.cpp in Sources */,\n\t\t\t\t1A570293180BCCAB0088DEC7 /* CCAnimation.cpp in Sources */,\n\t\t\t\t1A570297180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */,\n\t\t\t\t1A57029E180BCD890088DEC7 /* base64.cpp in Sources */,\n\t\t\t\t1A5702A4180BCD980088DEC7 /* CCNotificationCenter.cpp in Sources */,\n\t\t\t\t1A5702AA180BCDAA0088DEC7 /* CCProfiling.cpp in Sources */,\n\t\t\t\t59A79D561821E26E00F19697 /* CCEventMouse.cpp in Sources */,\n\t\t\t\t1A5702B0180BCDBC0088DEC7 /* ccUTF8.cpp in Sources */,\n\t\t\t\t1A5702B6180BCDF40088DEC7 /* CCVertex.cpp in Sources */,\n\t\t\t\t1A5702C3180BCE2A0088DEC7 /* CCIMEDispatcher.cpp in Sources */,\n\t\t\t\t1A5702C9180BCE370088DEC7 /* CCTextFieldTTF.cpp in Sources */,\n\t\t\t\t1A5702D4180BCE570088DEC7 /* CCTexture2D.cpp in Sources */,\n\t\t\t\t1A5702D8180BCE570088DEC7 /* CCTextureAtlas.cpp in Sources */,\n\t\t\t\t50AE5EA4188749250007CFE3 /* CCBatchCommand.cpp in Sources */,\n\t\t\t\t1A5702DC180BCE570088DEC7 /* CCTextureCache.cpp in Sources */,\n\t\t\t\t1A5702EB180BCE750088DEC7 /* CCTileMapAtlas.cpp in Sources */,\n\t\t\t\t1A5702EF180BCE750088DEC7 /* CCTMXLayer.cpp in Sources */,\n\t\t\t\t1A5702F3180BCE750088DEC7 /* CCTMXObjectGroup.cpp in Sources */,\n\t\t\t\t1A5702F7180BCE750088DEC7 /* CCTMXTiledMap.cpp in Sources */,\n\t\t\t\t1A5702FB180BCE750088DEC7 /* CCTMXXMLParser.cpp in Sources */,\n\t\t\t\t1A570301180BCE890088DEC7 /* CCParallaxNode.cpp in Sources */,\n\t\t\t\t1A570306180BCED90088DEC7 /* ccUtils.cpp in Sources */,\n\t\t\t\t1A57030D180BCF190088DEC7 /* CCComponent.cpp in Sources */,\n\t\t\t\t1A570311180BCF190088DEC7 /* CCComponentContainer.cpp in Sources */,\n\t\t\t\t1A57031A180BCF430088DEC7 /* ccCArray.cpp in Sources */,\n\t\t\t\tB375107C1823ACA100B3BA6A /* CCPhysicsBodyInfo_chipmunk.cpp in Sources */,\n\t\t\t\t1A570325180BCF660088DEC7 /* TGAlib.cpp in Sources */,\n\t\t\t\t1A570330180BCFD50088DEC7 /* CCUserDefault.cpp in Sources */,\n\t\t\t\t1A570334180BCFD50088DEC7 /* CCUserDefault.mm in Sources */,\n\t\t\t\t1A570336180BCFD50088DEC7 /* CCUserDefaultAndroid.cpp in Sources */,\n\t\t\t\t1A57033B180BCFFA0088DEC7 /* ZipUtils.cpp in Sources */,\n\t\t\t\t1A57034C180BD09B0088DEC7 /* tinyxml2.cpp in Sources */,\n\t\t\t\t1A570355180BD0B00088DEC7 /* ioapi.cpp in Sources */,\n\t\t\t\t1A570359180BD0B00088DEC7 /* unzip.cpp in Sources */,\n\t\t\t\t1A570534180BD9500088DEC7 /* CCGLProgram.cpp in Sources */,\n\t\t\t\t1A570538180BD9500088DEC7 /* ccGLStateCache.cpp in Sources */,\n\t\t\t\t1A570547180BD9C40088DEC7 /* CCTouch.cpp in Sources */,\n\t\t\t\t1AD71DAA180E26E600808F54 /* CCBAnimationManager.cpp in Sources */,\n\t\t\t\t1AD71DAE180E26E600808F54 /* CCBFileLoader.cpp in Sources */,\n\t\t\t\t1AD71DB2180E26E600808F54 /* CCBKeyframe.cpp in Sources */,\n\t\t\t\t1AD71DB8180E26E600808F54 /* CCBReader.cpp in Sources */,\n\t\t\t\t1AD71DBE180E26E600808F54 /* CCBSequence.cpp in Sources */,\n\t\t\t\t1AD71DC2180E26E600808F54 /* CCBSequenceProperty.cpp in Sources */,\n\t\t\t\t1AD71DCA180E26E600808F54 /* CCControlButtonLoader.cpp in Sources */,\n\t\t\t\t1AD71DCE180E26E600808F54 /* CCControlLoader.cpp in Sources */,\n\t\t\t\t1AE3C845184F14F700CF29B5 /* CCValue.cpp in Sources */,\n\t\t\t\t1AD71DD2180E26E600808F54 /* CCLabelBMFontLoader.cpp in Sources */,\n\t\t\t\t1AD71DD6180E26E600808F54 /* CCLabelTTFLoader.cpp in Sources */,\n\t\t\t\t1AD71DDA180E26E600808F54 /* CCLayerColorLoader.cpp in Sources */,\n\t\t\t\t1AD71DDE180E26E600808F54 /* CCLayerGradientLoader.cpp in Sources */,\n\t\t\t\t1AD71DE2180E26E600808F54 /* CCLayerLoader.cpp in Sources */,\n\t\t\t\t1AD71DE6180E26E600808F54 /* CCMenuItemImageLoader.cpp in Sources */,\n\t\t\t\t1AD71DEA180E26E600808F54 /* CCMenuItemLoader.cpp in Sources */,\n\t\t\t\t593BDCF3184D0A6E00C21E48 /* CCCustomCommand.cpp in Sources */,\n\t\t\t\t06CAAAC8186AD7EB0012A414 /* TriggerObj.cpp in Sources */,\n\t\t\t\t1AD71DF0180E26E600808F54 /* CCNode+CCBRelativePositioning.cpp in Sources */,\n\t\t\t\t1AD71DF4180E26E600808F54 /* CCNodeLoader.cpp in Sources */,\n\t\t\t\t1AD71DF8180E26E600808F54 /* CCNodeLoaderLibrary.cpp in Sources */,\n\t\t\t\t1AD71DFE180E26E600808F54 /* CCParticleSystemQuadLoader.cpp in Sources */,\n\t\t\t\t1AD71E02180E26E600808F54 /* CCScale9SpriteLoader.cpp in Sources */,\n\t\t\t\t1AD71E06180E26E600808F54 /* CCScrollViewLoader.cpp in Sources */,\n\t\t\t\t1AD71E0A180E26E600808F54 /* CCSpriteLoader.cpp in Sources */,\n\t\t\t\t1AD71E96180E26E600808F54 /* Animation.cpp in Sources */,\n\t\t\t\t1AD71E9A180E26E600808F54 /* AnimationState.cpp in Sources */,\n\t\t\t\t1AD71E9E180E26E600808F54 /* AnimationStateData.cpp in Sources */,\n\t\t\t\t1AD71EA2180E26E600808F54 /* Atlas.cpp in Sources */,\n\t\t\t\t1AD71EA6180E26E600808F54 /* AtlasAttachmentLoader.cpp in Sources */,\n\t\t\t\t1AD71EAA180E26E600808F54 /* Attachment.cpp in Sources */,\n\t\t\t\t1AD71EAE180E26E600808F54 /* AttachmentLoader.cpp in Sources */,\n\t\t\t\t1AD71EB2180E26E600808F54 /* Bone.cpp in Sources */,\n\t\t\t\t1AD71EB6180E26E600808F54 /* BoneData.cpp in Sources */,\n\t\t\t\t1AD71EBA180E26E600808F54 /* CCSkeleton.cpp in Sources */,\n\t\t\t\t1AD71EBE180E26E600808F54 /* CCSkeletonAnimation.cpp in Sources */,\n\t\t\t\t1AD71EC2180E26E600808F54 /* extension.cpp in Sources */,\n\t\t\t\t1AD71EC6180E26E600808F54 /* Json.cpp in Sources */,\n\t\t\t\t1AD71ECA180E26E600808F54 /* RegionAttachment.cpp in Sources */,\n\t\t\t\t1AD71ECE180E26E600808F54 /* Skeleton.cpp in Sources */,\n\t\t\t\t1AD71ED2180E26E600808F54 /* SkeletonData.cpp in Sources */,\n\t\t\t\t1AD71ED6180E26E600808F54 /* SkeletonJson.cpp in Sources */,\n\t\t\t\t1AD71EDA180E26E600808F54 /* Skin.cpp in Sources */,\n\t\t\t\t1AD71EDE180E26E600808F54 /* Slot.cpp in Sources */,\n\t\t\t\t1AD71EE2180E26E600808F54 /* SlotData.cpp in Sources */,\n\t\t\t\t1AD71EE6180E26E600808F54 /* spine-cocos2dx.cpp in Sources */,\n\t\t\t\t1AAF536B180E3374000584C8 /* HttpClient.cpp in Sources */,\n\t\t\t\t1AAF5373180E3374000584C8 /* SocketIO.cpp in Sources */,\n\t\t\t\t1AAF5377180E3374000584C8 /* WebSocket.cpp in Sources */,\n\t\t\t\t1AAF5850180E40B9000584C8 /* LocalStorage.cpp in Sources */,\n\t\t\t\t1AAF5854180E40B9000584C8 /* LocalStorageAndroid.cpp in Sources */,\n\t\t\t\t5069133F185016C1009BBDD7 /* CCConsole.cpp in Sources */,\n\t\t\t\t1A9DCA16180E6955007A3AD4 /* CCConfiguration.cpp in Sources */,\n\t\t\t\t1A9DCA1E180E6955007A3AD4 /* CCDirector.cpp in Sources */,\n\t\t\t\t1A9DCA24180E6955007A3AD4 /* ccFPSImages.c in Sources */,\n\t\t\t\t1A9DCA28180E6955007A3AD4 /* CCGLBufferedNode.cpp in Sources */,\n\t\t\t\t1A9DCA30180E6955007A3AD4 /* CCScheduler.cpp in Sources */,\n\t\t\t\t1A9DCA38180E6955007A3AD4 /* cocos2d.cpp in Sources */,\n\t\t\t\t1A9DCA3E180E6955007A3AD4 /* TransformUtils.cpp in Sources */,\n\t\t\t\t1A9DCA44180E6D90007A3AD4 /* CCDeprecated.cpp in Sources */,\n\t\t\t\t1A9DCA4A180E6DE3007A3AD4 /* ccTypes.cpp in Sources */,\n\t\t\t\t1A8C58ED180E92CC00EF57C3 /* CocosGUI.cpp in Sources */,\n\t\t\t\t1A8C58F1180E92CC00EF57C3 /* UILayout.cpp in Sources */,\n\t\t\t\t1A8C58F5180E92CC00EF57C3 /* UILayoutParameter.cpp in Sources */,\n\t\t\t\t1A8C58F9180E92CC00EF57C3 /* UIButton.cpp in Sources */,\n\t\t\t\t1A8C58FD180E92CC00EF57C3 /* UICheckBox.cpp in Sources */,\n\t\t\t\t1A8C5905180E92CC00EF57C3 /* UIHelper.cpp in Sources */,\n\t\t\t\t1A8C5909180E92CC00EF57C3 /* UIImageView.cpp in Sources */,\n\t\t\t\t1A8C5911180E92CC00EF57C3 /* UIText.cpp in Sources */,\n\t\t\t\t1A8C5915180E92CC00EF57C3 /* UITextAtlas.cpp in Sources */,\n\t\t\t\t1A8C5919180E92CC00EF57C3 /* UITextBMFont.cpp in Sources */,\n\t\t\t\t59A79D521821E26E00F19697 /* CCEventListenerMouse.cpp in Sources */,\n\t\t\t\t1A8C5921180E92CC00EF57C3 /* UILayoutDefine.cpp in Sources */,\n\t\t\t\t1A8C5929180E92CC00EF57C3 /* UILoadingBar.cpp in Sources */,\n\t\t\t\t1A8C592D180E92CC00EF57C3 /* UIPageView.cpp in Sources */,\n\t\t\t\t1A8C5937180E92CC00EF57C3 /* UIScrollView.cpp in Sources */,\n\t\t\t\t1A8C593B180E92CC00EF57C3 /* UISlider.cpp in Sources */,\n\t\t\t\t1A8C593F180E92CC00EF57C3 /* UITextField.cpp in Sources */,\n\t\t\t\t1A8C5943180E92CC00EF57C3 /* UIWidget.cpp in Sources */,\n\t\t\t\t1A8C598C180E930E00EF57C3 /* CCActionFrame.cpp in Sources */,\n\t\t\t\t1A8C5990180E930E00EF57C3 /* CCActionFrameEasing.cpp in Sources */,\n\t\t\t\t1A8C5994180E930E00EF57C3 /* CCActionManagerEx.cpp in Sources */,\n\t\t\t\t1A8C5998180E930E00EF57C3 /* CCActionNode.cpp in Sources */,\n\t\t\t\t1A8C599C180E930E00EF57C3 /* CCActionObject.cpp in Sources */,\n\t\t\t\t1A8C59A0180E930E00EF57C3 /* CCArmature.cpp in Sources */,\n\t\t\t\t1A8C59A4180E930E00EF57C3 /* CCArmatureAnimation.cpp in Sources */,\n\t\t\t\t1A8C59A8180E930E00EF57C3 /* CCArmatureDataManager.cpp in Sources */,\n\t\t\t\t1A8C59AC180E930E00EF57C3 /* CCArmatureDefine.cpp in Sources */,\n\t\t\t\t1A8C59B0180E930E00EF57C3 /* CCBatchNode.cpp in Sources */,\n\t\t\t\t1A8C59B4180E930E00EF57C3 /* CCBone.cpp in Sources */,\n\t\t\t\t50A1FF1918290ED4001840C4 /* UIListView.cpp in Sources */,\n\t\t\t\t1A8C59B8180E930E00EF57C3 /* CCColliderDetector.cpp in Sources */,\n\t\t\t\t1A8C59BC180E930E00EF57C3 /* CCComAttribute.cpp in Sources */,\n\t\t\t\t1A8C59C0180E930E00EF57C3 /* CCComAudio.cpp in Sources */,\n\t\t\t\t1A8C59C4180E930E00EF57C3 /* CCComController.cpp in Sources */,\n\t\t\t\t1A8C59C8180E930E00EF57C3 /* CCComRender.cpp in Sources */,\n\t\t\t\t1A8C59CC180E930E00EF57C3 /* CCDataReaderHelper.cpp in Sources */,\n\t\t\t\t1A8C59D0180E930E00EF57C3 /* CCDatas.cpp in Sources */,\n\t\t\t\t1A8C59D4180E930E00EF57C3 /* CCDecorativeDisplay.cpp in Sources */,\n\t\t\t\t1A8C59D8180E930E00EF57C3 /* CCDisplayFactory.cpp in Sources */,\n\t\t\t\t1A8C59DC180E930E00EF57C3 /* CCDisplayManager.cpp in Sources */,\n\t\t\t\t1A8C59E0180E930E00EF57C3 /* CCInputDelegate.cpp in Sources */,\n\t\t\t\t1A8C59E4180E930E00EF57C3 /* CCProcessBase.cpp in Sources */,\n\t\t\t\t1A8C59E8180E930E00EF57C3 /* CCSGUIReader.cpp in Sources */,\n\t\t\t\t1A8C59EC180E930E00EF57C3 /* CCSkin.cpp in Sources */,\n\t\t\t\t1A8C59F0180E930E00EF57C3 /* CCSpriteFrameCacheHelper.cpp in Sources */,\n\t\t\t\t1A8C59F4180E930E00EF57C3 /* CCSSceneReader.cpp in Sources */,\n\t\t\t\t1A8C59F8180E930E00EF57C3 /* CCTransformHelp.cpp in Sources */,\n\t\t\t\t1A8C59FC180E930E00EF57C3 /* CCTween.cpp in Sources */,\n\t\t\t\t1A8C5A00180E930E00EF57C3 /* CCTweenFunction.cpp in Sources */,\n\t\t\t\t1A8C5A04180E930E00EF57C3 /* CCUtilMath.cpp in Sources */,\n\t\t\t\t1A8C5A0E180E930E00EF57C3 /* DictionaryHelper.cpp in Sources */,\n\t\t\t\t74AC858052DDF289AF7D6309 /* CCFrustum.cpp in Sources */,\n\t\t\t\t74AC80E553789C6DE3EC737A /* CCRenderer.cpp in Sources */,\n\t\t\t\t1ABA68AF1888D700007D1BB4 /* CCFontCharMap.cpp in Sources */,\n\t\t\t\t74AC846799FE6F299B410289 /* CCQuadCommand.cpp in Sources */,\n\t\t\t\t74AC84A100AF9E826288CE2C /* CCRenderCommand.cpp in Sources */,\n\t\t\t\t74AC8813CEE4FC652A0951FB /* CCRenderMaterial.cpp in Sources */,\n\t\t\t\t74AC826A592CAE6AACD35DC5 /* CCMaterialManager.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4E121783867C0073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E47D918080914000CDD6D /* CCTableViewCell.cpp in Sources */,\n\t\t\t\t460E47C01808090D000CDD6D /* CCEditBoxImplAndroid.cpp in Sources */,\n\t\t\t\t460E47A118080904000CDD6D /* CCControlSaturationBrightnessPicker.cpp in Sources */,\n\t\t\t\t460E47BD1808090D000CDD6D /* CCEditBox.cpp in Sources */,\n\t\t\t\t460E47C71808090D000CDD6D /* CCEditBoxImplTizen.cpp in Sources */,\n\t\t\t\t460E47C61808090D000CDD6D /* CCEditBoxImplNone.cpp in Sources */,\n\t\t\t\t460E47D318080914000CDD6D /* CCScrollView.cpp in Sources */,\n\t\t\t\t460E47C91808090D000CDD6D /* CCEditBoxImplWin.cpp in Sources */,\n\t\t\t\t460E47A918080904000CDD6D /* CCControlUtils.cpp in Sources */,\n\t\t\t\t460E47D718080914000CDD6D /* CCTableView.cpp in Sources */,\n\t\t\t\t460E479F18080904000CDD6D /* CCControlPotentiometer.cpp in Sources */,\n\t\t\t\t460E479818080904000CDD6D /* CCControlButton.cpp in Sources */,\n\t\t\t\t460E47C51808090D000CDD6D /* CCEditBoxImplMac.mm in Sources */,\n\t\t\t\t460E479D18080904000CDD6D /* CCControlHuePicker.cpp in Sources */,\n\t\t\t\t460E47A318080904000CDD6D /* CCControlSlider.cpp in Sources */,\n\t\t\t\t460E47AB18080904000CDD6D /* CCInvocation.cpp in Sources */,\n\t\t\t\t460E47AD18080904000CDD6D /* CCScale9Sprite.cpp in Sources */,\n\t\t\t\t460E47C31808090D000CDD6D /* CCEditBoxImplIOS.mm in Sources */,\n\t\t\t\t460E47A718080904000CDD6D /* CCControlSwitch.cpp in Sources */,\n\t\t\t\t460E479618080904000CDD6D /* CCControl.cpp in Sources */,\n\t\t\t\t460E47A518080904000CDD6D /* CCControlStepper.cpp in Sources */,\n\t\t\t\t460E479A18080904000CDD6D /* CCControlColourPicker.cpp in Sources */,\n\t\t\t\t1AD71EF1180E27CF00808F54 /* CCPhysicsDebugNode.cpp in Sources */,\n\t\t\t\t1AD71EF5180E27CF00808F54 /* CCPhysicsSprite.cpp in Sources */,\n\t\t\t\t1AAF5354180E3060000584C8 /* AssetsManager.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4EFE178387670073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A173ED1807D363005B8026 /* cpSpaceQuery.c in Sources */,\n\t\t\t\t46A173E91807D363005B8026 /* cpShape.c in Sources */,\n\t\t\t\t46A173E31807D363005B8026 /* cpBB.c in Sources */,\n\t\t\t\t46A173DC1807D363005B8026 /* cpPivotJoint.c in Sources */,\n\t\t\t\t46A173E41807D363005B8026 /* cpBBTree.c in Sources */,\n\t\t\t\t46A173D41807D358005B8026 /* chipmunk.c in Sources */,\n\t\t\t\t46A173E51807D363005B8026 /* cpBody.c in Sources */,\n\t\t\t\t46A173DF1807D363005B8026 /* cpSimpleMotor.c in Sources */,\n\t\t\t\t46A173D61807D363005B8026 /* cpConstraint.c in Sources */,\n\t\t\t\t46A173EB1807D363005B8026 /* cpSpaceComponent.c in Sources */,\n\t\t\t\t46A173EC1807D363005B8026 /* cpSpaceHash.c in Sources */,\n\t\t\t\t46A173DB1807D363005B8026 /* cpPinJoint.c in Sources */,\n\t\t\t\t46A173F01807D363005B8026 /* cpSweep1D.c in Sources */,\n\t\t\t\t46A173D81807D363005B8026 /* cpDampedSpring.c in Sources */,\n\t\t\t\t46A173EE1807D363005B8026 /* cpSpaceStep.c in Sources */,\n\t\t\t\t46A173DA1807D363005B8026 /* cpGrooveJoint.c in Sources */,\n\t\t\t\t46A173E81807D363005B8026 /* cpPolyShape.c in Sources */,\n\t\t\t\t46A173F11807D363005B8026 /* cpVect.c in Sources */,\n\t\t\t\t46A173E01807D363005B8026 /* cpSlideJoint.c in Sources */,\n\t\t\t\t46A173DE1807D363005B8026 /* cpRotaryLimitJoint.c in Sources */,\n\t\t\t\t46A173E71807D363005B8026 /* cpHashSet.c in Sources */,\n\t\t\t\t46A173E11807D363005B8026 /* cpArbiter.c in Sources */,\n\t\t\t\t46A173E21807D363005B8026 /* cpArray.c in Sources */,\n\t\t\t\t46A173D91807D363005B8026 /* cpGearJoint.c in Sources */,\n\t\t\t\t46A173E61807D363005B8026 /* cpCollision.c in Sources */,\n\t\t\t\t46A173EA1807D363005B8026 /* cpSpace.c in Sources */,\n\t\t\t\t46A173DD1807D363005B8026 /* cpRatchetJoint.c in Sources */,\n\t\t\t\t46A173D71807D363005B8026 /* cpDampedRotarySpring.c in Sources */,\n\t\t\t\t46A173EF1807D363005B8026 /* cpSpatialIndex.c in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4F3D1783876B0073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF529A180E2EE4000584C8 /* b2BroadPhase.cpp in Sources */,\n\t\t\t\t1AAF529C180E2EE4000584C8 /* b2CollideCircle.cpp in Sources */,\n\t\t\t\t1AAF529D180E2EE4000584C8 /* b2CollideEdge.cpp in Sources */,\n\t\t\t\t1AAF529E180E2EE4000584C8 /* b2CollidePolygon.cpp in Sources */,\n\t\t\t\t1AAF529F180E2EE4000584C8 /* b2Collision.cpp in Sources */,\n\t\t\t\t1AAF52A1180E2EE4000584C8 /* b2Distance.cpp in Sources */,\n\t\t\t\t1AAF52A3180E2EE4000584C8 /* b2DynamicTree.cpp in Sources */,\n\t\t\t\t1AAF52A5180E2EE4000584C8 /* b2TimeOfImpact.cpp in Sources */,\n\t\t\t\t1AAF52A7180E2EE8000584C8 /* b2ChainShape.cpp in Sources */,\n\t\t\t\t1AAF52A9180E2EE8000584C8 /* b2CircleShape.cpp in Sources */,\n\t\t\t\t1AAF52AB180E2EE8000584C8 /* b2EdgeShape.cpp in Sources */,\n\t\t\t\t1AAF52AD180E2EE8000584C8 /* b2PolygonShape.cpp in Sources */,\n\t\t\t\t1AAF52B9180E2EEE000584C8 /* b2BlockAllocator.cpp in Sources */,\n\t\t\t\t1AAF52BB180E2EEE000584C8 /* b2Draw.cpp in Sources */,\n\t\t\t\t1AAF52BE180E2EEE000584C8 /* b2Math.cpp in Sources */,\n\t\t\t\t1AAF52C0180E2EEE000584C8 /* b2Settings.cpp in Sources */,\n\t\t\t\t1AAF52C2180E2EEE000584C8 /* b2StackAllocator.cpp in Sources */,\n\t\t\t\t1AAF52C4180E2EEE000584C8 /* b2Timer.cpp in Sources */,\n\t\t\t\t1AAF52E0180E2EF6000584C8 /* b2Body.cpp in Sources */,\n\t\t\t\t1AAF52E2180E2EF6000584C8 /* b2ContactManager.cpp in Sources */,\n\t\t\t\t1AAF52E4180E2EF6000584C8 /* b2Fixture.cpp in Sources */,\n\t\t\t\t1AAF52E6180E2EF6000584C8 /* b2Island.cpp in Sources */,\n\t\t\t\t1AAF52E9180E2EF6000584C8 /* b2World.cpp in Sources */,\n\t\t\t\t1AAF52EB180E2EF6000584C8 /* b2WorldCallbacks.cpp in Sources */,\n\t\t\t\t1AAF52ED180E2EFC000584C8 /* b2ChainAndCircleContact.cpp in Sources */,\n\t\t\t\t1AAF52EF180E2EFC000584C8 /* b2ChainAndPolygonContact.cpp in Sources */,\n\t\t\t\t1AAF52F1180E2EFC000584C8 /* b2CircleContact.cpp in Sources */,\n\t\t\t\t1AAF52F3180E2EFC000584C8 /* b2Contact.cpp in Sources */,\n\t\t\t\t1AAF52F5180E2EFC000584C8 /* b2ContactSolver.cpp in Sources */,\n\t\t\t\t1AAF52F7180E2EFC000584C8 /* b2EdgeAndCircleContact.cpp in Sources */,\n\t\t\t\tB3AF01A11842FBA400A98B85 /* b2MotorJoint.cpp in Sources */,\n\t\t\t\t1AAF52F9180E2EFC000584C8 /* b2EdgeAndPolygonContact.cpp in Sources */,\n\t\t\t\t1AAF52FB180E2EFC000584C8 /* b2PolygonAndCircleContact.cpp in Sources */,\n\t\t\t\t1AAF52FD180E2EFC000584C8 /* b2PolygonContact.cpp in Sources */,\n\t\t\t\t1AAF5327180E2F04000584C8 /* b2DistanceJoint.cpp in Sources */,\n\t\t\t\t1AAF5329180E2F04000584C8 /* b2FrictionJoint.cpp in Sources */,\n\t\t\t\t1AAF532B180E2F04000584C8 /* b2GearJoint.cpp in Sources */,\n\t\t\t\t1AAF532D180E2F04000584C8 /* b2Joint.cpp in Sources */,\n\t\t\t\t1AAF532F180E2F04000584C8 /* b2MouseJoint.cpp in Sources */,\n\t\t\t\t1AAF5331180E2F04000584C8 /* b2PrismaticJoint.cpp in Sources */,\n\t\t\t\t1AAF5333180E2F04000584C8 /* b2PulleyJoint.cpp in Sources */,\n\t\t\t\t1AAF5335180E2F04000584C8 /* b2RevoluteJoint.cpp in Sources */,\n\t\t\t\t1AAF5337180E2F04000584C8 /* b2RopeJoint.cpp in Sources */,\n\t\t\t\t1AAF5339180E2F04000584C8 /* b2WeldJoint.cpp in Sources */,\n\t\t\t\t1AAF533B180E2F04000584C8 /* b2WheelJoint.cpp in Sources */,\n\t\t\t\t1AAF533F180E2F11000584C8 /* b2Rope.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4FA0178387730073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A160531807A5EB005B8026 /* CDAudioManager.m in Sources */,\n\t\t\t\t46A160581807A5EB005B8026 /* CocosDenshion.m in Sources */,\n\t\t\t\t46A160591807A5EB005B8026 /* SimpleAudioEngine.mm in Sources */,\n\t\t\t\t46A1605B1807A5EB005B8026 /* SimpleAudioEngine_objc.m in Sources */,\n\t\t\t\t46A160561807A5EB005B8026 /* CDOpenALSupport.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A4FB6178387750073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t3EEF8BD31839FFAF005E8A6C /* jsb_cocos2dx_gui_auto.cpp in Sources */,\n\t\t\t\t3EEF8BD41839FFAF005E8A6C /* jsb_cocos2dx_gui_manual.cpp in Sources */,\n\t\t\t\t1A2C791E181A1257004E5527 /* js_bindings_chipmunk_registration.cpp in Sources */,\n\t\t\t\t1A2C793E181A1257004E5527 /* js_bindings_opengl.cpp in Sources */,\n\t\t\t\t1A2C7950181A1257004E5527 /* jsb_opengl_registration.cpp in Sources */,\n\t\t\t\t1A2C795A181A1257004E5527 /* js_bindings_system_registration.cpp in Sources */,\n\t\t\t\t1A2C791A181A1257004E5527 /* js_bindings_chipmunk_manual.cpp in Sources */,\n\t\t\t\t1A2C7930181A1257004E5527 /* jsb_cocos2dx_studio_manual.cpp in Sources */,\n\t\t\t\t1A2C7966181A1257004E5527 /* ScriptingCore.cpp in Sources */,\n\t\t\t\t1A2C790E181A1257004E5527 /* js_bindings_chipmunk_auto_classes.cpp in Sources */,\n\t\t\t\t1A2C7914181A1257004E5527 /* js_bindings_chipmunk_functions.cpp in Sources */,\n\t\t\t\t1A2C7934181A1257004E5527 /* jsb_cocos2dx_extension_manual.cpp in Sources */,\n\t\t\t\t1A2C7948181A1257004E5527 /* jsb_opengl_functions.cpp in Sources */,\n\t\t\t\t1A2C7928181A1257004E5527 /* js_bindings_ccbreader.cpp in Sources */,\n\t\t\t\t1A2C7874181A11EC004E5527 /* jsb_cocos2dx_auto.cpp in Sources */,\n\t\t\t\t1A2C793A181A1257004E5527 /* js_bindings_core.cpp in Sources */,\n\t\t\t\t1A2C794C181A1257004E5527 /* jsb_opengl_manual.cpp in Sources */,\n\t\t\t\t1A2C7880181A11EC004E5527 /* jsb_cocos2dx_builder_auto.cpp in Sources */,\n\t\t\t\t1A2C7942181A1257004E5527 /* js_manual_conversions.cpp in Sources */,\n\t\t\t\t1A2C7922181A1257004E5527 /* cocos2d_specifics.cpp in Sources */,\n\t\t\t\t1A2C788C181A11EC004E5527 /* jsb_cocos2dx_extension_auto.cpp in Sources */,\n\t\t\t\t1A2C7954181A1257004E5527 /* js_bindings_system_functions.cpp in Sources */,\n\t\t\t\t1A2C7898181A11EC004E5527 /* jsb_cocos2dx_studio_auto.cpp in Sources */,\n\t\t\t\t1A2C795E181A1257004E5527 /* jsb_websocket.cpp in Sources */,\n\t\t\t\t1A2C7962181A1257004E5527 /* XMLHTTPRequest.cpp in Sources */,\n\t\t\t\t2AFCB8241863D6F600EB4B5C /* jsb_cocos2dx_spine_auto.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t1A6FB4FF17854AD600CDF010 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1A119716178526AA00D62A44 /* luabindings iOS */;\n\t\t\ttargetProxy = 1A6FB4FE17854AD600CDF010 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A6FB7E71785683A00CDF010 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1A6FB50417854BC200CDF010 /* luabindings Mac */;\n\t\t\ttargetProxy = 1A6FB7E61785683A00CDF010 /* PBXContainerItemProxy */;\n\t\t};\n\t\t460E44F41807E241000CDD6D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A03F2B781780BD04006731B9 /* chipmunk Mac */;\n\t\t\ttargetProxy = 460E44F31807E241000CDD6D /* PBXContainerItemProxy */;\n\t\t};\n\t\t46A173D31807D330005B8026 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A4EFD178387670073F6A7 /* chipmunk iOS */;\n\t\t\ttargetProxy = 46A173D21807D330005B8026 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA03F2E93178141D1006731B9 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1551A33E158F2AB200E66CFE /* cocos2dx Mac */;\n\t\t\ttargetProxy = A03F2E92178141D1006731B9 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA03F2E95178141D1006731B9 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A03F2B781780BD04006731B9 /* chipmunk Mac */;\n\t\t\ttargetProxy = A03F2E94178141D1006731B9 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA03F2E97178141D1006731B9 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A03F2D5D1780BDF7006731B9 /* box2d Mac */;\n\t\t\ttargetProxy = A03F2E96178141D1006731B9 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA03F2FC01781458C006731B9 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A03F2E9817814268006731B9 /* CocosDenshion Mac */;\n\t\t\ttargetProxy = A03F2FBF1781458C006731B9 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA03F31FF178147CB006731B9 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A03F2FC117814595006731B9 /* cocos2dx-extensions Mac */;\n\t\t\ttargetProxy = A03F31FE178147CB006731B9 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA03F3201178147CB006731B9 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A03F31E81781479B006731B9 /* jsbindings Mac */;\n\t\t\ttargetProxy = A03F3200178147CB006731B9 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA07A4E10178386520073F6A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A4C241783777C0073F6A7 /* cocos2dx iOS */;\n\t\t\ttargetProxy = A07A4E0F178386520073F6A7 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA07A5047178389710073F6A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A4E111783867C0073F6A7 /* cocos2dx-extensions iOS */;\n\t\t\ttargetProxy = A07A5046178389710073F6A7 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA07A5049178389710073F6A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A4EFD178387670073F6A7 /* chipmunk iOS */;\n\t\t\ttargetProxy = A07A5048178389710073F6A7 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA07A504B178389710073F6A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A4F3C1783876B0073F6A7 /* box2d iOS */;\n\t\t\ttargetProxy = A07A504A178389710073F6A7 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA07A504D178389710073F6A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A4F9F178387730073F6A7 /* CocosDenshion iOS */;\n\t\t\ttargetProxy = A07A504C178389710073F6A7 /* PBXContainerItemProxy */;\n\t\t};\n\t\tA07A504F178389710073F6A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A4FB5178387750073F6A7 /* jsbindings iOS */;\n\t\t\ttargetProxy = A07A504E178389710073F6A7 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t1551A34A158F2AB200E66CFE /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"COCOS2D_DEBUG=1\",\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\t\"CC_ENABLE_CHIPMUNK_INTEGRATION=1\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;\n\t\t\t\tGCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;\n\t\t\t\tGCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.7;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/include $(SRCROOT)/../cocos/2d/platform $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../cocos/gui $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external $(SRCROOT)/../cocos/storage\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1551A34B158F2AB200E66CFE /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"CC_ENABLE_CHIPMUNK_INTEGRATION=1\",\n\t\t\t\t\tNDEBUG,\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t);\n\t\t\t\tGCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;\n\t\t\t\tGCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;\n\t\t\t\tGCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;\n\t\t\t\tGCC_WARN_SHADOW = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.7;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/include $(SRCROOT)/../cocos/2d/platform $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../cocos/gui $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external $(SRCROOT)/../cocos/storage\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1551A34D158F2AB200E66CFE /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/glfw3/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/png/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/jpeg/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/tiff/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/webp/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/freetype2/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/websockets/prebuilt/mac\\\"\",\n\t\t\t\t);\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/2d/platform/desktop\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1551A34E158F2AB200E66CFE /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/glfw3/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/png/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/jpeg/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/tiff/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/webp/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/freetype2/prebuilt/mac\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/websockets/prebuilt/mac\\\"\",\n\t\t\t\t);\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../external/png/include/mac $(SRCROOT)/../external/tiff/include/mac $(SRCROOT)/../external/webp/include/mac $(SRCROOT)/../external/jpeg/include/mac $(SRCROOT)/../external/freetype2/include/mac $(SRCROOT)/../external/websockets/include/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/2d/platform/desktop\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1A11978F178526AA00D62A44 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/../external/lua/luajit/prebuilt/ios\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1A119790178526AA00D62A44 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/../external/lua/luajit/prebuilt/ios\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1A6FB52E17854BC200CDF010 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/../external/lua/luajit/prebuilt/mac\",\n\t\t\t\t);\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1A6FB52F17854BC200CDF010 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/../external/lua/luajit/prebuilt/mac\",\n\t\t\t\t);\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA03F2CB61780BD04006731B9 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/chipmunk/include/chipmunk/\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA03F2CB71780BD04006731B9 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/chipmunk/include/chipmunk/\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA03F2D991780BDF7006731B9 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tGCC_WARN_UNUSED_VALUE = NO;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA03F2D9A1780BDF7006731B9 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tGCC_WARN_UNUSED_VALUE = NO;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA03F2E90178141C1006731B9 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"COCOS2D_DEBUG=1\",\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\t\"CC_ENABLE_BOX2D_INTEGRATION=1\",\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"/Applications/Xcode\\\\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include\",\n\t\t\t\t);\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/include $(SRCROOT)/../cocos/2d/platform $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../cocos/gui $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external/Box2D $(SRCROOT)/../external $(SRCROOT)/../cocos/storage\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA03F2E91178141C1006731B9 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"/Applications/Xcode\\\\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include\",\n\t\t\t\t);\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/include $(SRCROOT)/../cocos/2d/platform $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../cocos/gui $(SRCROOT)/../external/chipmunk/include/chipmunk $(SRCROOT)/../external/Box2D $(SRCROOT)/../external $(SRCROOT)/../cocos/storage\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA03F2ED417814268006731B9 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA03F2ED517814268006731B9 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = CC_TARGET_OS_MAC;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA03F2FD417814595006731B9 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA03F2FD517814595006731B9 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA03F31FB1781479B006731B9 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/spidermonkey/prebuilt/mac\\\"\",\n\t\t\t\t);\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA03F31FC1781479B006731B9 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/spidermonkey/prebuilt/mac\\\"\",\n\t\t\t\t);\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A4D621783777C0073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/png/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/jpeg/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/tiff/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/webp/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/freetype2/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/websockets/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/curl/prebuilt/ios\\\"\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A4D631783777C0073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"../cocos/2d/cocos2dx-Prefix.pch\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/png/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/jpeg/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/tiff/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/webp/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/freetype2/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/websockets/prebuilt/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/curl/prebuilt/ios\\\"\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/websockets/include/ios $(SRCROOT)/../external/freetype2/include/ios $(SRCROOT)/../external/curl/include/ios $(SRCROOT)/../external/webp/include/ios $(SRCROOT)/../external/tiff/include/ios $(SRCROOT)/../external/jpeg/include/ios $(SRCROOT)/../external/png/include/ios\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A4E0D178386390073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_INCLUDING_64_BIT)\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A4E0E178386390073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_INCLUDING_64_BIT)\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A4EFA1783867C0073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/curl/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A4EFB1783867C0073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../external/curl/include/ios\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A4F39178387670073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/chipmunk/include/chipmunk/\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A4F3A178387670073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/chipmunk/include/chipmunk/\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A4F9C1783876B0073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_WARN_UNUSED_VALUE = NO;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A4F9D1783876B0073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_WARN_UNUSED_VALUE = NO;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../external/\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A4FB2178387730073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A4FB3178387730073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A502E178387750073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/spidermonkey/prebuilt/ios\\\"\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A502F178387750073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../external/spidermonkey/prebuilt/ios\\\"\",\n\t\t\t\t);\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../external/spidermonkey/include/ios $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t1551A339158F2AB200E66CFE /* Build configuration list for PBXProject \"cocos2d_libs\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1551A34A158F2AB200E66CFE /* Debug */,\n\t\t\t\t1551A34B158F2AB200E66CFE /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t1551A34C158F2AB200E66CFE /* Build configuration list for PBXNativeTarget \"cocos2dx Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1551A34D158F2AB200E66CFE /* Debug */,\n\t\t\t\t1551A34E158F2AB200E66CFE /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t1A11978E178526AA00D62A44 /* Build configuration list for PBXNativeTarget \"luabindings iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1A11978F178526AA00D62A44 /* Debug */,\n\t\t\t\t1A119790178526AA00D62A44 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t1A6FB52D17854BC200CDF010 /* Build configuration list for PBXNativeTarget \"luabindings Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1A6FB52E17854BC200CDF010 /* Debug */,\n\t\t\t\t1A6FB52F17854BC200CDF010 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA03F2CB51780BD04006731B9 /* Build configuration list for PBXNativeTarget \"chipmunk Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA03F2CB61780BD04006731B9 /* Debug */,\n\t\t\t\tA03F2CB71780BD04006731B9 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA03F2D981780BDF7006731B9 /* Build configuration list for PBXNativeTarget \"box2d Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA03F2D991780BDF7006731B9 /* Debug */,\n\t\t\t\tA03F2D9A1780BDF7006731B9 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA03F2E8F178141C1006731B9 /* Build configuration list for PBXAggregateTarget \"build-all-libs Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA03F2E90178141C1006731B9 /* Debug */,\n\t\t\t\tA03F2E91178141C1006731B9 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA03F2ED317814268006731B9 /* Build configuration list for PBXNativeTarget \"CocosDenshion Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA03F2ED417814268006731B9 /* Debug */,\n\t\t\t\tA03F2ED517814268006731B9 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA03F2FD317814595006731B9 /* Build configuration list for PBXNativeTarget \"cocos2dx-extensions Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA03F2FD417814595006731B9 /* Debug */,\n\t\t\t\tA03F2FD517814595006731B9 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA03F31FA1781479B006731B9 /* Build configuration list for PBXNativeTarget \"jsbindings Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA03F31FB1781479B006731B9 /* Debug */,\n\t\t\t\tA03F31FC1781479B006731B9 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA07A4D611783777C0073F6A7 /* Build configuration list for PBXNativeTarget \"cocos2dx iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A4D621783777C0073F6A7 /* Debug */,\n\t\t\t\tA07A4D631783777C0073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA07A4E0C178386390073F6A7 /* Build configuration list for PBXAggregateTarget \"build-all-libs iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A4E0D178386390073F6A7 /* Debug */,\n\t\t\t\tA07A4E0E178386390073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA07A4EF91783867C0073F6A7 /* Build configuration list for PBXNativeTarget \"cocos2dx-extensions iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A4EFA1783867C0073F6A7 /* Debug */,\n\t\t\t\tA07A4EFB1783867C0073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA07A4F38178387670073F6A7 /* Build configuration list for PBXNativeTarget \"chipmunk iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A4F39178387670073F6A7 /* Debug */,\n\t\t\t\tA07A4F3A178387670073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA07A4F9B1783876B0073F6A7 /* Build configuration list for PBXNativeTarget \"box2d iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A4F9C1783876B0073F6A7 /* Debug */,\n\t\t\t\tA07A4F9D1783876B0073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA07A4FB1178387730073F6A7 /* Build configuration list for PBXNativeTarget \"CocosDenshion iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A4FB2178387730073F6A7 /* Debug */,\n\t\t\t\tA07A4FB3178387730073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tA07A502D178387750073F6A7 /* Build configuration list for PBXNativeTarget \"jsbindings iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A502E178387750073F6A7 /* Debug */,\n\t\t\t\tA07A502F178387750073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 1551A336158F2AB200E66CFE /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/build/cocos2d_samples.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXAggregateTarget section */\n\t\tA035ACBB1782469700987F6C /* build-all-samples Mac */ = {\n\t\t\tisa = PBXAggregateTarget;\n\t\t\tbuildConfigurationList = A035ACBC1782469800987F6C /* Build configuration list for PBXAggregateTarget \"build-all-samples Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A6FB7E31785682700CDF010 /* PBXTargetDependency */,\n\t\t\t\t1A6FB7E51785682700CDF010 /* PBXTargetDependency */,\n\t\t\t\tA035AF731782569500987F6C /* PBXTargetDependency */,\n\t\t\t\tA035AF751782569500987F6C /* PBXTargetDependency */,\n\t\t\t\tA035ACC0178246BD00987F6C /* PBXTargetDependency */,\n\t\t\t\tA035ACC2178246BD00987F6C /* PBXTargetDependency */,\n\t\t\t\tA035ACC4178246BD00987F6C /* PBXTargetDependency */,\n\t\t\t\tA035ACC6178246BD00987F6C /* PBXTargetDependency */,\n\t\t\t\tA035ACC8178246BD00987F6C /* PBXTargetDependency */,\n\t\t\t\tA035ACCA178246BD00987F6C /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"build-all-samples Mac\";\n\t\t\tproductName = \"build-all-samples\";\n\t\t};\n\t\tA07A517B1783A1CC0073F6A7 /* build-all-samples iOS */ = {\n\t\t\tisa = PBXAggregateTarget;\n\t\t\tbuildConfigurationList = A07A517C1783A1CC0073F6A7 /* Build configuration list for PBXAggregateTarget \"build-all-samples iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A6FB50117854AEA00CDF010 /* PBXTargetDependency */,\n\t\t\t\t1A6FB50317854AEA00CDF010 /* PBXTargetDependency */,\n\t\t\t\tA01E19971784C8DD00B0CA4A /* PBXTargetDependency */,\n\t\t\t\tA01E19991784C8DD00B0CA4A /* PBXTargetDependency */,\n\t\t\t\tA01E199B1784C8DD00B0CA4A /* PBXTargetDependency */,\n\t\t\t\tA01E199D1784C8DD00B0CA4A /* PBXTargetDependency */,\n\t\t\t\tA01E17E21784C3EB00B0CA4A /* PBXTargetDependency */,\n\t\t\t\tA01E17E41784C3EB00B0CA4A /* PBXTargetDependency */,\n\t\t\t\tA01E17E61784C3EB00B0CA4A /* PBXTargetDependency */,\n\t\t\t\tA07A526D1783AB980073F6A7 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"build-all-samples iOS\";\n\t\t\tproductName = \"build-all-samples iOS\";\n\t\t};\n/* End PBXAggregateTarget section */\n\n/* Begin PBXBuildFile section */\n\t\t15394DF3182E8F5D000A418D /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15394DF2182E8F5D000A418D /* StudioConstants.lua */; };\n\t\t15394DF5182E8F5D000A418D /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15394DF2182E8F5D000A418D /* StudioConstants.lua */; };\n\t\t1585AAC81821F8D900000FB5 /* LuaObjectCBridgeTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1585AAC71821F8D900000FB5 /* LuaObjectCBridgeTest.mm */; };\n\t\t1585AB111821FA1A00000FB5 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB101821FA1A00000FB5 /* luaoc.lua */; };\n\t\t1585AB131821FA1A00000FB5 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB101821FA1A00000FB5 /* luaoc.lua */; };\n\t\t1585AB181821FF4C00000FB5 /* LuaObjectCBridgeTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1585AB171821FF4C00000FB5 /* LuaObjectCBridgeTest.mm */; };\n\t\t1585AB35182299FA00000FB5 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB34182299FA00000FB5 /* json.lua */; };\n\t\t1585AB37182299FA00000FB5 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB34182299FA00000FB5 /* json.lua */; };\n\t\t1585AB4B1823A55400000FB5 /* lua_assetsmanager_test_sample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1585AB491823A55400000FB5 /* lua_assetsmanager_test_sample.cpp */; };\n\t\t1585AB4C1823A55400000FB5 /* lua_assetsmanager_test_sample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1585AB491823A55400000FB5 /* lua_assetsmanager_test_sample.cpp */; };\n\t\t15982CE2187656CD00625972 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15982CE1187656CD00625972 /* GuiConstants.lua */; };\n\t\t15982CE4187656CD00625972 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15982CE1187656CD00625972 /* GuiConstants.lua */; };\n\t\t15A71DB71894AE6200F30AC0 /* mobdebug.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A71DB61894AE6200F30AC0 /* mobdebug.lua */; };\n\t\t15A71DB81894AE6200F30AC0 /* mobdebug.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A71DB61894AE6200F30AC0 /* mobdebug.lua */; };\n\t\t15C64825165F3934007D4F18 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\t15C64827165F394E007D4F18 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\t15C64829165F396B007D4F18 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\t15C6482B165F3979007D4F18 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\t15C6482D165F3988007D4F18 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\t15C6482F165F399D007D4F18 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\t15C64833165F3AFD007D4F18 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\t15F4C82918751B590082884F /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C82818751B590082884F /* extern.lua */; };\n\t\t15F4C82B18751B590082884F /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C82818751B590082884F /* extern.lua */; };\n\t\t15F4C847187551340082884F /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C846187551340082884F /* CocoStudio.lua */; };\n\t\t15F4C849187551340082884F /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C846187551340082884F /* CocoStudio.lua */; };\n\t\t1A0800BE18780B2A00E62F93 /* cocosbuilderRes in Resources */ = {isa = PBXBuildFile; fileRef = 1A0800BC18780B2A00E62F93 /* cocosbuilderRes */; };\n\t\t1A0800BF18780B2A00E62F93 /* cocosbuilderRes in Resources */ = {isa = PBXBuildFile; fileRef = 1A0800BC18780B2A00E62F93 /* cocosbuilderRes */; };\n\t\t1A0800C018780B2A00E62F93 /* luaScript in Resources */ = {isa = PBXBuildFile; fileRef = 1A0800BD18780B2A00E62F93 /* luaScript */; };\n\t\t1A0800C118780B2A00E62F93 /* luaScript in Resources */ = {isa = PBXBuildFile; fileRef = 1A0800BD18780B2A00E62F93 /* luaScript */; };\n\t\t1A0800C418780B5E00E62F93 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15982CE1187656CD00625972 /* GuiConstants.lua */; };\n\t\t1A0800C518780B5E00E62F93 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C846187551340082884F /* CocoStudio.lua */; };\n\t\t1A0800C618780B5E00E62F93 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C82818751B590082884F /* extern.lua */; };\n\t\t1A0800C718780B5E00E62F93 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15394DF2182E8F5D000A418D /* StudioConstants.lua */; };\n\t\t1A0800C818780B5E00E62F93 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB34182299FA00000FB5 /* json.lua */; };\n\t\t1A0800C918780B5E00E62F93 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB101821FA1A00000FB5 /* luaoc.lua */; };\n\t\t1A0800CA18780B5E00E62F93 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5596180E8B8400EF57C3 /* AudioEngine.lua */; };\n\t\t1A0800CB18780B5E00E62F93 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5597180E8B8400EF57C3 /* CCBReaderLoad.lua */; };\n\t\t1A0800CC18780B5E00E62F93 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5598180E8B8400EF57C3 /* Cocos2d.lua */; };\n\t\t1A0800CD18780B5E00E62F93 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5599180E8B8400EF57C3 /* Cocos2dConstants.lua */; };\n\t\t1A0800CE18780B5E00E62F93 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559A180E8B8400EF57C3 /* Deprecated.lua */; };\n\t\t1A0800CF18780B5E00E62F93 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559B180E8B8400EF57C3 /* DeprecatedClass.lua */; };\n\t\t1A0800D018780B5E00E62F93 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559C180E8B8400EF57C3 /* DeprecatedEnum.lua */; };\n\t\t1A0800D118780B5E00E62F93 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559D180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua */; };\n\t\t1A0800D218780B5E00E62F93 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559E180E8B8400EF57C3 /* DrawPrimitives.lua */; };\n\t\t1A0800D318780B5E00E62F93 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559F180E8B8400EF57C3 /* luaj.lua */; };\n\t\t1A0800D418780B5E00E62F93 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A0180E8B8400EF57C3 /* Opengl.lua */; };\n\t\t1A0800D518780B5E00E62F93 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A1180E8B8400EF57C3 /* OpenglConstants.lua */; };\n\t\t1A0800D618780B6100E62F93 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15982CE1187656CD00625972 /* GuiConstants.lua */; };\n\t\t1A0800D718780B6100E62F93 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C846187551340082884F /* CocoStudio.lua */; };\n\t\t1A0800D818780B6100E62F93 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15F4C82818751B590082884F /* extern.lua */; };\n\t\t1A0800D918780B6100E62F93 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15394DF2182E8F5D000A418D /* StudioConstants.lua */; };\n\t\t1A0800DA18780B6100E62F93 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB34182299FA00000FB5 /* json.lua */; };\n\t\t1A0800DB18780B6100E62F93 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1585AB101821FA1A00000FB5 /* luaoc.lua */; };\n\t\t1A0800DC18780B6100E62F93 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5596180E8B8400EF57C3 /* AudioEngine.lua */; };\n\t\t1A0800DD18780B6100E62F93 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5597180E8B8400EF57C3 /* CCBReaderLoad.lua */; };\n\t\t1A0800DE18780B6100E62F93 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5598180E8B8400EF57C3 /* Cocos2d.lua */; };\n\t\t1A0800DF18780B6100E62F93 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5599180E8B8400EF57C3 /* Cocos2dConstants.lua */; };\n\t\t1A0800E018780B6100E62F93 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559A180E8B8400EF57C3 /* Deprecated.lua */; };\n\t\t1A0800E118780B6100E62F93 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559B180E8B8400EF57C3 /* DeprecatedClass.lua */; };\n\t\t1A0800E218780B6100E62F93 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559C180E8B8400EF57C3 /* DeprecatedEnum.lua */; };\n\t\t1A0800E318780B6100E62F93 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559D180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua */; };\n\t\t1A0800E418780B6100E62F93 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559E180E8B8400EF57C3 /* DrawPrimitives.lua */; };\n\t\t1A0800E518780B6100E62F93 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559F180E8B8400EF57C3 /* luaj.lua */; };\n\t\t1A0800E618780B6100E62F93 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A0180E8B8400EF57C3 /* Opengl.lua */; };\n\t\t1A0800E718780B6100E62F93 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A1180E8B8400EF57C3 /* OpenglConstants.lua */; };\n\t\t1A0800E818780BD400E62F93 /* animations in Resources */ = {isa = PBXBuildFile; fileRef = 37C819601875DF2A00930C57 /* animations */; };\n\t\t1A0800E918780BD400E62F93 /* armature in Resources */ = {isa = PBXBuildFile; fileRef = 37C819611875DF2A00930C57 /* armature */; };\n\t\t1A0800EA18780BD400E62F93 /* ccb in Resources */ = {isa = PBXBuildFile; fileRef = 37C819651875DF2A00930C57 /* ccb */; };\n\t\t1A0800EB18780BD400E62F93 /* cocosgui in Resources */ = {isa = PBXBuildFile; fileRef = 37C819681875DF2A00930C57 /* cocosgui */; };\n\t\t1A0800EC18780BD400E62F93 /* components in Resources */ = {isa = PBXBuildFile; fileRef = 37C819691875DF2A00930C57 /* components */; };\n\t\t1A0800ED18780BD400E62F93 /* configs in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196A1875DF2A00930C57 /* configs */; };\n\t\t1A0800EE18780BD400E62F93 /* extensions in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196E1875DF2A00930C57 /* extensions */; };\n\t\t1A0800EF18780BD400E62F93 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 37C819701875DF2A00930C57 /* fonts */; };\n\t\t1A0800F018780BD400E62F93 /* hd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819721875DF2A00930C57 /* hd */; };\n\t\t1A0800F118780BD400E62F93 /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 37C819741875DF2B00930C57 /* Images */; };\n\t\t1A0800F218780BD400E62F93 /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 37C819751875DF2B00930C57 /* ipad */; };\n\t\t1A0800F318780BD400E62F93 /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819761875DF2B00930C57 /* ipadhd */; };\n\t\t1A0800F418780BD400E62F93 /* Misc in Resources */ = {isa = PBXBuildFile; fileRef = 37C819771875DF2B00930C57 /* Misc */; };\n\t\t1A0800F518780BD400E62F93 /* Particles in Resources */ = {isa = PBXBuildFile; fileRef = 37C819791875DF2B00930C57 /* Particles */; };\n\t\t1A0800F618780BD400E62F93 /* scenetest in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197B1875DF2B00930C57 /* scenetest */; };\n\t\t1A0800F718780BD400E62F93 /* Shaders in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197C1875DF2B00930C57 /* Shaders */; };\n\t\t1A0800F818780BD400E62F93 /* spine in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197D1875DF2B00930C57 /* spine */; };\n\t\t1A0800F918780BD400E62F93 /* TileMaps in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197E1875DF2B00930C57 /* TileMaps */; };\n\t\t1A0800FA18780BD400E62F93 /* zwoptex in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197F1875DF2B00930C57 /* zwoptex */; };\n\t\t1A08010E18780BD600E62F93 /* animations in Resources */ = {isa = PBXBuildFile; fileRef = 37C819601875DF2A00930C57 /* animations */; };\n\t\t1A08010F18780BD600E62F93 /* armature in Resources */ = {isa = PBXBuildFile; fileRef = 37C819611875DF2A00930C57 /* armature */; };\n\t\t1A08011018780BD600E62F93 /* ccb in Resources */ = {isa = PBXBuildFile; fileRef = 37C819651875DF2A00930C57 /* ccb */; };\n\t\t1A08011118780BD600E62F93 /* cocosgui in Resources */ = {isa = PBXBuildFile; fileRef = 37C819681875DF2A00930C57 /* cocosgui */; };\n\t\t1A08011218780BD600E62F93 /* components in Resources */ = {isa = PBXBuildFile; fileRef = 37C819691875DF2A00930C57 /* components */; };\n\t\t1A08011318780BD600E62F93 /* configs in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196A1875DF2A00930C57 /* configs */; };\n\t\t1A08011418780BD600E62F93 /* extensions in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196E1875DF2A00930C57 /* extensions */; };\n\t\t1A08011518780BD600E62F93 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 37C819701875DF2A00930C57 /* fonts */; };\n\t\t1A08011618780BD600E62F93 /* hd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819721875DF2A00930C57 /* hd */; };\n\t\t1A08011718780BD600E62F93 /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 37C819741875DF2B00930C57 /* Images */; };\n\t\t1A08011818780BD600E62F93 /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 37C819751875DF2B00930C57 /* ipad */; };\n\t\t1A08011918780BD600E62F93 /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819761875DF2B00930C57 /* ipadhd */; };\n\t\t1A08011A18780BD600E62F93 /* Misc in Resources */ = {isa = PBXBuildFile; fileRef = 37C819771875DF2B00930C57 /* Misc */; };\n\t\t1A08011B18780BD600E62F93 /* Particles in Resources */ = {isa = PBXBuildFile; fileRef = 37C819791875DF2B00930C57 /* Particles */; };\n\t\t1A08011C18780BD600E62F93 /* scenetest in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197B1875DF2B00930C57 /* scenetest */; };\n\t\t1A08011D18780BD600E62F93 /* Shaders in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197C1875DF2B00930C57 /* Shaders */; };\n\t\t1A08011E18780BD600E62F93 /* spine in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197D1875DF2B00930C57 /* spine */; };\n\t\t1A08011F18780BD600E62F93 /* TileMaps in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197E1875DF2B00930C57 /* TileMaps */; };\n\t\t1A08012018780BD600E62F93 /* zwoptex in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197F1875DF2B00930C57 /* zwoptex */; };\n\t\t1A08013418780C0700E62F93 /* background-music-aac.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C819621875DF2A00930C57 /* background-music-aac.wav */; };\n\t\t1A08013518780C0700E62F93 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 37C819631875DF2A00930C57 /* background.mp3 */; };\n\t\t1A08013618780C0700E62F93 /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C819641875DF2A00930C57 /* background.ogg */; };\n\t\t1A08013718780C0B00E62F93 /* background-music-aac.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C819621875DF2A00930C57 /* background-music-aac.wav */; };\n\t\t1A08013818780C0B00E62F93 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 37C819631875DF2A00930C57 /* background.mp3 */; };\n\t\t1A08013918780C0B00E62F93 /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C819641875DF2A00930C57 /* background.ogg */; };\n\t\t1A08013A18780C1B00E62F93 /* effect1.raw in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196B1875DF2A00930C57 /* effect1.raw */; };\n\t\t1A08013B18780C1B00E62F93 /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196C1875DF2A00930C57 /* effect1.wav */; };\n\t\t1A08013C18780C1B00E62F93 /* effect2.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196D1875DF2A00930C57 /* effect2.ogg */; };\n\t\t1A08013D18780C1B00E62F93 /* fileLookup.plist in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196F1875DF2A00930C57 /* fileLookup.plist */; };\n\t\t1A08013E18780C1B00E62F93 /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819711875DF2A00930C57 /* fps_images.png */; };\n\t\t1A08013F18780C1B00E62F93 /* Hello.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819731875DF2A00930C57 /* Hello.png */; };\n\t\t1A08014018780C1B00E62F93 /* music.mid in Resources */ = {isa = PBXBuildFile; fileRef = 37C819781875DF2B00930C57 /* music.mid */; };\n\t\t1A08014118780C1B00E62F93 /* pew-pew-lei.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197A1875DF2B00930C57 /* pew-pew-lei.wav */; };\n\t\t1A08014218780C1D00E62F93 /* effect1.raw in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196B1875DF2A00930C57 /* effect1.raw */; };\n\t\t1A08014318780C1D00E62F93 /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196C1875DF2A00930C57 /* effect1.wav */; };\n\t\t1A08014418780C1D00E62F93 /* effect2.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196D1875DF2A00930C57 /* effect2.ogg */; };\n\t\t1A08014518780C1D00E62F93 /* fileLookup.plist in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196F1875DF2A00930C57 /* fileLookup.plist */; };\n\t\t1A08014618780C1D00E62F93 /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819711875DF2A00930C57 /* fps_images.png */; };\n\t\t1A08014718780C1D00E62F93 /* Hello.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819731875DF2A00930C57 /* Hello.png */; };\n\t\t1A08014818780C1D00E62F93 /* music.mid in Resources */ = {isa = PBXBuildFile; fileRef = 37C819781875DF2B00930C57 /* music.mid */; };\n\t\t1A08014918780C1D00E62F93 /* pew-pew-lei.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197A1875DF2B00930C57 /* pew-pew-lei.wav */; };\n\t\t1A087AEE1860418300196EF5 /* PerformanceLabelTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A087AEC1860418300196EF5 /* PerformanceLabelTest.cpp */; };\n\t\t1A087AEF1860418300196EF5 /* PerformanceLabelTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A087AEC1860418300196EF5 /* PerformanceLabelTest.cpp */; };\n\t\t1A1197CB1785363400D62A44 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\t1A1197CC1785363400D62A44 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\t1A1197CD1785363400D62A44 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\t1A1197CE1785363400D62A44 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\t1A1197CF1785363400D62A44 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\t1A1197D01785363400D62A44 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\t1A1197D11785363400D62A44 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\t1A1197D21785363400D62A44 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\t1A1197D31785363400D62A44 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\t1A119864178538E400D62A44 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\t1A119865178538E400D62A44 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\t1A119866178538E400D62A44 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\t1A119867178538E400D62A44 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\t1A119868178538E400D62A44 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\t1A119869178538E400D62A44 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\t1A11986A178538E400D62A44 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\t1A11986B178538E400D62A44 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\t1A11986C178538E400D62A44 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\t1A2F51B01877DA5900B48BFE /* tests in Resources */ = {isa = PBXBuildFile; fileRef = 1A2F51AF1877DA5900B48BFE /* tests */; };\n\t\t1A2F51B11877DA5900B48BFE /* tests in Resources */ = {isa = PBXBuildFile; fileRef = 1A2F51AF1877DA5900B48BFE /* tests */; };\n\t\t1A3B1DB3180E7C4700497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1DB1180E7C4700497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1DB4180E7C4700497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1DB1180E7C4700497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1DCA180E7C5100497A22 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1DB7180E7C5100497A22 /* AppController.mm */; };\n\t\t1A3B1DCB180E7C5100497A22 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DB8180E7C5100497A22 /* Default-568h@2x.png */; };\n\t\t1A3B1DCC180E7C5100497A22 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DB9180E7C5100497A22 /* Default.png */; };\n\t\t1A3B1DCD180E7C5100497A22 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DBA180E7C5100497A22 /* Default@2x.png */; };\n\t\t1A3B1DCE180E7C5100497A22 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DBB180E7C5100497A22 /* Icon-120.png */; };\n\t\t1A3B1DCF180E7C5100497A22 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DBC180E7C5100497A22 /* Icon-144.png */; };\n\t\t1A3B1DD0180E7C5100497A22 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DBD180E7C5100497A22 /* Icon-152.png */; };\n\t\t1A3B1DD1180E7C5100497A22 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DBE180E7C5100497A22 /* Icon-72.png */; };\n\t\t1A3B1DD2180E7C5100497A22 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DBF180E7C5100497A22 /* Icon-76.png */; };\n\t\t1A3B1DD3180E7C5100497A22 /* Icon-Small-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DC0180E7C5100497A22 /* Icon-Small-50.png */; };\n\t\t1A3B1DD4180E7C5100497A22 /* Icon-Small.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DC1180E7C5100497A22 /* Icon-Small.png */; };\n\t\t1A3B1DD5180E7C5100497A22 /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DC2180E7C5100497A22 /* Icon-Small@2x.png */; };\n\t\t1A3B1DD6180E7C5100497A22 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DC3180E7C5100497A22 /* Icon.png */; };\n\t\t1A3B1DD7180E7C5100497A22 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DC4180E7C5100497A22 /* Icon@2x.png */; };\n\t\t1A3B1DD9180E7C5100497A22 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1DC6180E7C5100497A22 /* main.m */; };\n\t\t1A3B1DDA180E7C5100497A22 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1DC9180E7C5100497A22 /* RootViewController.mm */; };\n\t\t1A3B1DE3180E7C5C00497A22 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DDC180E7C5C00497A22 /* InfoPlist.strings */; };\n\t\t1A3B1DE4180E7C5C00497A22 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DDE180E7C5C00497A22 /* MainMenu.xib */; };\n\t\t1A3B1DE5180E7C5C00497A22 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DE0180E7C5C00497A22 /* Icon.icns */; };\n\t\t1A3B1DE6180E7C5C00497A22 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DE1180E7C5C00497A22 /* Info.plist */; };\n\t\t1A3B1DE7180E7C5C00497A22 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1DE2180E7C5C00497A22 /* main.cpp */; };\n\t\t1A3B1DF2180E7CAF00497A22 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1A3B1DF3180E7CAF00497A22 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1A3B1DF4180E7CAF00497A22 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1A3B1DF5180E7CAF00497A22 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1A3B1DF6180E7CAF00497A22 /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBA1807A4F9005B8026 /* libjsbindings Mac.a */; };\n\t\t1A3B1DFD180E7D2200497A22 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DF9180E7D2200497A22 /* res */; };\n\t\t1A3B1DFE180E7D2200497A22 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DF9180E7D2200497A22 /* res */; };\n\t\t1A3B1DFF180E7D2200497A22 /* src in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DFA180E7D2200497A22 /* src */; };\n\t\t1A3B1E00180E7D2200497A22 /* src in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DFA180E7D2200497A22 /* src */; };\n\t\t1A3B1E01180E7D3900497A22 /* MoonWarriors-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DF8180E7D2200497A22 /* MoonWarriors-jsb.js */; };\n\t\t1A3B1E02180E7D4B00497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E03180E7D4B00497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E04180E7D4C00497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E05180E7D4C00497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E06180E7D5000497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E07180E7D5100497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E08180E7D5100497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E09180E7D5200497A22 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A3B1E14180E7E2700497A22 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1A3B1E15180E7E2700497A22 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1A3B1E16180E7E2700497A22 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1A3B1E17180E7E2700497A22 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1A3B1E18180E7E2700497A22 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC81807A4F9005B8026 /* libjsbindings iOS.a */; };\n\t\t1A3B1E19180E7E4E00497A22 /* MoonWarriors-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1DF8180E7D2200497A22 /* MoonWarriors-jsb.js */; };\n\t\t1A3B1E26180E7EFA00497A22 /* boot-html5.js in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1C180E7EFA00497A22 /* boot-html5.js */; };\n\t\t1A3B1E28180E7EFA00497A22 /* boot-jsb.js in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1D180E7EFA00497A22 /* boot-jsb.js */; };\n\t\t1A3B1E2A180E7EFA00497A22 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1E180E7EFA00497A22 /* index.html */; };\n\t\t1A3B1E2B180E7EFA00497A22 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1E180E7EFA00497A22 /* index.html */; };\n\t\t1A3B1E2C180E7EFA00497A22 /* levels.js in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1F180E7EFA00497A22 /* levels.js */; };\n\t\t1A3B1E2E180E7EFA00497A22 /* main.js in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E20180E7EFA00497A22 /* main.js */; };\n\t\t1A3B1E30180E7EFA00497A22 /* Platform in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E21180E7EFA00497A22 /* Platform */; };\n\t\t1A3B1E31180E7EFA00497A22 /* Platform in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E21180E7EFA00497A22 /* Platform */; };\n\t\t1A3B1E32180E7EFA00497A22 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E22180E7EFA00497A22 /* res */; };\n\t\t1A3B1E33180E7EFA00497A22 /* res in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E22180E7EFA00497A22 /* res */; };\n\t\t1A3B1E34180E7EFA00497A22 /* resources-html5.js in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E23180E7EFA00497A22 /* resources-html5.js */; };\n\t\t1A3B1E36180E7EFA00497A22 /* resources-jsb.js in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E24180E7EFA00497A22 /* resources-jsb.js */; };\n\t\t1A3B1E38180E7EFA00497A22 /* watermelon_with_me.js in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E25180E7EFA00497A22 /* watermelon_with_me.js */; };\n\t\t1A3B1E40180E7F1500497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E3E180E7F1500497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1E41180E7F1500497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E3E180E7F1500497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1E54180E7F1E00497A22 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E44180E7F1E00497A22 /* AppController.mm */; };\n\t\t1A3B1E55180E7F1E00497A22 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E45180E7F1E00497A22 /* Default-568h@2x.png */; };\n\t\t1A3B1E56180E7F1E00497A22 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E46180E7F1E00497A22 /* Default.png */; };\n\t\t1A3B1E57180E7F1E00497A22 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E47180E7F1E00497A22 /* Default@2x.png */; };\n\t\t1A3B1E58180E7F1E00497A22 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E48180E7F1E00497A22 /* Icon-114.png */; };\n\t\t1A3B1E59180E7F1E00497A22 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E49180E7F1E00497A22 /* Icon-120.png */; };\n\t\t1A3B1E5A180E7F1E00497A22 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E4A180E7F1E00497A22 /* Icon-144.png */; };\n\t\t1A3B1E5B180E7F1E00497A22 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E4B180E7F1E00497A22 /* Icon-152.png */; };\n\t\t1A3B1E5C180E7F1E00497A22 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E4C180E7F1E00497A22 /* Icon-57.png */; };\n\t\t1A3B1E5D180E7F1E00497A22 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E4D180E7F1E00497A22 /* Icon-72.png */; };\n\t\t1A3B1E5E180E7F1E00497A22 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E4E180E7F1E00497A22 /* Icon-76.png */; };\n\t\t1A3B1E60180E7F1E00497A22 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E50180E7F1E00497A22 /* main.m */; };\n\t\t1A3B1E61180E7F1E00497A22 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E53180E7F1E00497A22 /* RootViewController.mm */; };\n\t\t1A3B1E6A180E7F2400497A22 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E63180E7F2400497A22 /* InfoPlist.strings */; };\n\t\t1A3B1E6B180E7F2400497A22 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E65180E7F2400497A22 /* MainMenu.xib */; };\n\t\t1A3B1E6C180E7F2400497A22 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E67180E7F2400497A22 /* Icon.icns */; };\n\t\t1A3B1E6E180E7F2400497A22 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E69180E7F2400497A22 /* main.cpp */; };\n\t\t1A3B1E79180E7F6B00497A22 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1A3B1E7A180E7F6B00497A22 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1A3B1E7B180E7F6B00497A22 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1A3B1E7C180E7F6B00497A22 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1A3B1E7D180E7F6B00497A22 /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBA1807A4F9005B8026 /* libjsbindings Mac.a */; };\n\t\t1A3B1E7E180E7FBB00497A22 /* boot-html5.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1C180E7EFA00497A22 /* boot-html5.js */; };\n\t\t1A3B1E7F180E7FBB00497A22 /* boot-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1D180E7EFA00497A22 /* boot-jsb.js */; };\n\t\t1A3B1E80180E7FBB00497A22 /* levels.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1F180E7EFA00497A22 /* levels.js */; };\n\t\t1A3B1E81180E7FBB00497A22 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E20180E7EFA00497A22 /* main.js */; };\n\t\t1A3B1E82180E7FBB00497A22 /* resources-html5.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E23180E7EFA00497A22 /* resources-html5.js */; };\n\t\t1A3B1E83180E7FBB00497A22 /* resources-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E24180E7EFA00497A22 /* resources-jsb.js */; };\n\t\t1A3B1E84180E7FBB00497A22 /* watermelon_with_me.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E25180E7EFA00497A22 /* watermelon_with_me.js */; };\n\t\t1A3B1E8F180E804F00497A22 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1A3B1E90180E804F00497A22 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1A3B1E91180E804F00497A22 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1A3B1E92180E804F00497A22 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1A3B1E93180E804F00497A22 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC81807A4F9005B8026 /* libjsbindings iOS.a */; };\n\t\t1A3B1E94180E807600497A22 /* boot-html5.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1C180E7EFA00497A22 /* boot-html5.js */; };\n\t\t1A3B1E95180E807600497A22 /* boot-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1D180E7EFA00497A22 /* boot-jsb.js */; };\n\t\t1A3B1E96180E807600497A22 /* levels.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E1F180E7EFA00497A22 /* levels.js */; };\n\t\t1A3B1E97180E807600497A22 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E20180E7EFA00497A22 /* main.js */; };\n\t\t1A3B1E98180E807600497A22 /* resources-html5.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E23180E7EFA00497A22 /* resources-html5.js */; };\n\t\t1A3B1E99180E807600497A22 /* resources-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E24180E7EFA00497A22 /* resources-jsb.js */; };\n\t\t1A3B1E9A180E807600497A22 /* watermelon_with_me.js in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1E25180E7EFA00497A22 /* watermelon_with_me.js */; };\n\t\t1A3B1E9F180E80B600497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E9D180E80B600497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1EA0180E80B600497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1E9D180E80B600497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1EB3180E80BD00497A22 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1EA3180E80BD00497A22 /* AppController.mm */; };\n\t\t1A3B1EB4180E80BD00497A22 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EA4180E80BD00497A22 /* Default-568h@2x.png */; };\n\t\t1A3B1EB5180E80BD00497A22 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EA5180E80BD00497A22 /* Default.png */; };\n\t\t1A3B1EB6180E80BD00497A22 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EA6180E80BD00497A22 /* Default@2x.png */; };\n\t\t1A3B1EB7180E80BD00497A22 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EA7180E80BD00497A22 /* Icon-114.png */; };\n\t\t1A3B1EB8180E80BD00497A22 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EA8180E80BD00497A22 /* Icon-120.png */; };\n\t\t1A3B1EB9180E80BD00497A22 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EA9180E80BD00497A22 /* Icon-144.png */; };\n\t\t1A3B1EBA180E80BD00497A22 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EAA180E80BD00497A22 /* Icon-152.png */; };\n\t\t1A3B1EBB180E80BD00497A22 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EAB180E80BD00497A22 /* Icon-57.png */; };\n\t\t1A3B1EBC180E80BD00497A22 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EAC180E80BD00497A22 /* Icon-72.png */; };\n\t\t1A3B1EBD180E80BD00497A22 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EAD180E80BD00497A22 /* Icon-76.png */; };\n\t\t1A3B1EBF180E80BD00497A22 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1EAF180E80BD00497A22 /* main.m */; };\n\t\t1A3B1EC0180E80BD00497A22 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1EB2180E80BD00497A22 /* RootViewController.mm */; };\n\t\t1A3B1EC9180E80C700497A22 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EC2180E80C700497A22 /* InfoPlist.strings */; };\n\t\t1A3B1ECA180E80C700497A22 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EC4180E80C700497A22 /* MainMenu.xib */; };\n\t\t1A3B1ECB180E80C700497A22 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EC6180E80C700497A22 /* Icon.icns */; };\n\t\t1A3B1ECD180E80C700497A22 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1EC8180E80C700497A22 /* main.cpp */; };\n\t\t1A3B1ED0180E80E200497A22 /* Published files iOS in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1ECF180E80E200497A22 /* Published files iOS */; };\n\t\t1A3B1ED1180E80E200497A22 /* Published files iOS in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1ECF180E80E200497A22 /* Published files iOS */; };\n\t\t1A3B1EDC180E811D00497A22 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1A3B1EDD180E811D00497A22 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1A3B1EDE180E811D00497A22 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1A3B1EDF180E811D00497A22 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1A3B1EE0180E811D00497A22 /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBA1807A4F9005B8026 /* libjsbindings Mac.a */; };\n\t\t1A3B1EEB180E81B500497A22 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1A3B1EEC180E81B500497A22 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1A3B1EED180E81B500497A22 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1A3B1EEE180E81B500497A22 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1A3B1EEF180E81B500497A22 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC81807A4F9005B8026 /* libjsbindings iOS.a */; };\n\t\t1A3B1EF3180E826E00497A22 /* Published-iOS in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EF2180E826E00497A22 /* Published-iOS */; };\n\t\t1A3B1EF4180E826E00497A22 /* Published-iOS in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1EF2180E826E00497A22 /* Published-iOS */; };\n\t\t1A3B1EFB180E828300497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1EF9180E828300497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1EFC180E828300497A22 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1EF9180E828300497A22 /* AppDelegate.cpp */; };\n\t\t1A3B1F0F180E828E00497A22 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1EFF180E828E00497A22 /* AppController.mm */; };\n\t\t1A3B1F10180E828E00497A22 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F00180E828E00497A22 /* Default-568h@2x.png */; };\n\t\t1A3B1F11180E828E00497A22 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F01180E828E00497A22 /* Default.png */; };\n\t\t1A3B1F12180E828E00497A22 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F02180E828E00497A22 /* Default@2x.png */; };\n\t\t1A3B1F13180E828E00497A22 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F03180E828E00497A22 /* Icon-114.png */; };\n\t\t1A3B1F14180E828E00497A22 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F04180E828E00497A22 /* Icon-120.png */; };\n\t\t1A3B1F15180E828E00497A22 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F05180E828E00497A22 /* Icon-144.png */; };\n\t\t1A3B1F16180E828E00497A22 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F06180E828E00497A22 /* Icon-152.png */; };\n\t\t1A3B1F17180E828E00497A22 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F07180E828E00497A22 /* Icon-57.png */; };\n\t\t1A3B1F18180E828E00497A22 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F08180E828E00497A22 /* Icon-72.png */; };\n\t\t1A3B1F19180E828E00497A22 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F09180E828E00497A22 /* Icon-76.png */; };\n\t\t1A3B1F1B180E828E00497A22 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F0B180E828E00497A22 /* main.m */; };\n\t\t1A3B1F1C180E828E00497A22 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F0E180E828E00497A22 /* RootViewController.mm */; };\n\t\t1A3B1F25180E829600497A22 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F1E180E829600497A22 /* InfoPlist.strings */; };\n\t\t1A3B1F26180E829600497A22 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F20180E829600497A22 /* MainMenu.xib */; };\n\t\t1A3B1F27180E829600497A22 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1A3B1F22180E829600497A22 /* Icon.icns */; };\n\t\t1A3B1F29180E829600497A22 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3B1F24180E829600497A22 /* main.cpp */; };\n\t\t1A3B1F34180E82C800497A22 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1A3B1F35180E82C800497A22 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1A3B1F36180E82C800497A22 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1A3B1F37180E82C800497A22 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1A3B1F38180E82C800497A22 /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBA1807A4F9005B8026 /* libjsbindings Mac.a */; };\n\t\t1A3B1F43180E82DC00497A22 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1A3B1F44180E82DC00497A22 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1A3B1F45180E82DC00497A22 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1A3B1F46180E82DC00497A22 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1A3B1F47180E82DC00497A22 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC81807A4F9005B8026 /* libjsbindings iOS.a */; };\n\t\t1A514AFE180FB6470053B876 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 46A174CC1807D934005B8026 /* Icon.icns */; };\n\t\t1A514B01180FB66F0053B876 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174AE1807D934005B8026 /* Default.png */; };\n\t\t1A514B02180FB6730053B876 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174AF1807D934005B8026 /* Default@2x.png */; };\n\t\t1A514B03180FB6780053B876 /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B21807D934005B8026 /* Icon-100.png */; };\n\t\t1A514B04180FB67C0053B876 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B31807D934005B8026 /* Icon-114.png */; };\n\t\t1A514B05180FB67C0053B876 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B41807D934005B8026 /* Icon-120.png */; };\n\t\t1A514B06180FB67C0053B876 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B51807D934005B8026 /* Icon-144.png */; };\n\t\t1A514B07180FB67C0053B876 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B61807D934005B8026 /* Icon-152.png */; };\n\t\t1A514B08180FB67C0053B876 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B71807D934005B8026 /* Icon-40.png */; };\n\t\t1A514B09180FB67C0053B876 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B81807D934005B8026 /* Icon-57.png */; };\n\t\t1A514B0A180FB67C0053B876 /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174B91807D934005B8026 /* Icon-58.png */; };\n\t\t1A514B0B180FB67C0053B876 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174BA1807D934005B8026 /* Icon-72.png */; };\n\t\t1A514B0C180FB67C0053B876 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174BB1807D934005B8026 /* Icon-76.png */; };\n\t\t1A514B0D180FB67C0053B876 /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174BC1807D934005B8026 /* Icon-80.png */; };\n\t\t1A514B0E180FB6A30053B876 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45301807E712000CDD6D /* Default.png */; };\n\t\t1A514B0F180FB6A30053B876 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45311807E712000CDD6D /* Default@2x.png */; };\n\t\t1A514B10180FB6A30053B876 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45321807E712000CDD6D /* Icon-114.png */; };\n\t\t1A514B11180FB6A30053B876 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45331807E712000CDD6D /* Icon-120.png */; };\n\t\t1A514B12180FB6A30053B876 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45341807E712000CDD6D /* Icon-144.png */; };\n\t\t1A514B13180FB6A30053B876 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45351807E712000CDD6D /* Icon-152.png */; };\n\t\t1A514B14180FB6A30053B876 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45361807E712000CDD6D /* Icon-57.png */; };\n\t\t1A514B15180FB6A30053B876 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45371807E712000CDD6D /* Icon-72.png */; };\n\t\t1A514B16180FB6A30053B876 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E45381807E712000CDD6D /* Icon-76.png */; };\n\t\t1A6A41E5180BE41100565AC2 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6A41DF180BE41100565AC2 /* AppDelegate.cpp */; };\n\t\t1A6A41E6180BE41100565AC2 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6A41DF180BE41100565AC2 /* AppDelegate.cpp */; };\n\t\t1A6A41E7180BE41100565AC2 /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6A41E1180BE41100565AC2 /* GameOverScene.cpp */; };\n\t\t1A6A41E8180BE41100565AC2 /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6A41E1180BE41100565AC2 /* GameOverScene.cpp */; };\n\t\t1A6A41E9180BE41100565AC2 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6A41E3180BE41100565AC2 /* HelloWorldScene.cpp */; };\n\t\t1A6A41EA180BE41100565AC2 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6A41E3180BE41100565AC2 /* HelloWorldScene.cpp */; };\n\t\t1A6FB5951785523D00CDF010 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\t1A6FB5961785524600CDF010 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\t1A6FB5971785524D00CDF010 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\t1A6FB5981785525300CDF010 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\t1A6FB5991785526500CDF010 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\t1A6FB59A1785526C00CDF010 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\t1A6FB59B1785527300CDF010 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\t1A6FB59C1785528700CDF010 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\t1A6FB59D1785528E00CDF010 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\t1A6FB7A71785614200CDF010 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\t1A6FB7A81785614200CDF010 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\t1A6FB7A91785614200CDF010 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\t1A6FB7AA1785614200CDF010 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\t1A6FB7AB1785614200CDF010 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\t1A6FB7AC1785614200CDF010 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\t1A6FB7AD1785614200CDF010 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\t1A6FB7AE1785614200CDF010 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\t1A6FB7AF1785614200CDF010 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\t1A80519718768FD300C117B5 /* UnitTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A80519518768FD300C117B5 /* UnitTest.cpp */; };\n\t\t1A80519818768FD300C117B5 /* UnitTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A80519518768FD300C117B5 /* UnitTest.cpp */; };\n\t\t1A8C5532180E8B1C00EF57C3 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5530180E8B1C00EF57C3 /* AppDelegate.cpp */; };\n\t\t1A8C5533180E8B1C00EF57C3 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5530180E8B1C00EF57C3 /* AppDelegate.cpp */; };\n\t\t1A8C554A180E8B3D00EF57C3 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C553A180E8B3D00EF57C3 /* AppController.mm */; };\n\t\t1A8C554B180E8B3D00EF57C3 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C553B180E8B3D00EF57C3 /* Default-568h@2x.png */; };\n\t\t1A8C554C180E8B3D00EF57C3 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C553C180E8B3D00EF57C3 /* Default.png */; };\n\t\t1A8C554D180E8B3D00EF57C3 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C553D180E8B3D00EF57C3 /* Default@2x.png */; };\n\t\t1A8C554E180E8B3D00EF57C3 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C553F180E8B3D00EF57C3 /* Icon-114.png */; };\n\t\t1A8C554F180E8B3D00EF57C3 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5540180E8B3D00EF57C3 /* Icon-120.png */; };\n\t\t1A8C5550180E8B3D00EF57C3 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5541180E8B3D00EF57C3 /* Icon-144.png */; };\n\t\t1A8C5551180E8B3D00EF57C3 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5542180E8B3D00EF57C3 /* Icon-152.png */; };\n\t\t1A8C5552180E8B3D00EF57C3 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5543180E8B3D00EF57C3 /* Icon-57.png */; };\n\t\t1A8C5553180E8B3D00EF57C3 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5544180E8B3D00EF57C3 /* Icon-72.png */; };\n\t\t1A8C5554180E8B3D00EF57C3 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5545180E8B3D00EF57C3 /* Icon-76.png */; };\n\t\t1A8C5556180E8B3D00EF57C3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5547180E8B3D00EF57C3 /* main.m */; };\n\t\t1A8C5557180E8B3D00EF57C3 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5549180E8B3D00EF57C3 /* RootViewController.mm */; };\n\t\t1A8C5561180E8B4500EF57C3 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5559180E8B4500EF57C3 /* InfoPlist.strings */; };\n\t\t1A8C5562180E8B4500EF57C3 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C555B180E8B4500EF57C3 /* MainMenu.xib */; };\n\t\t1A8C5563180E8B4500EF57C3 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C555E180E8B4500EF57C3 /* Icon.icns */; };\n\t\t1A8C5565180E8B4500EF57C3 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5560180E8B4500EF57C3 /* main.cpp */; };\n\t\t1A8C557B180E8B5100EF57C3 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5569180E8B5100EF57C3 /* background.mp3 */; };\n\t\t1A8C557C180E8B5100EF57C3 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5569180E8B5100EF57C3 /* background.mp3 */; };\n\t\t1A8C557D180E8B5100EF57C3 /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556A180E8B5100EF57C3 /* background.ogg */; };\n\t\t1A8C557E180E8B5100EF57C3 /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556A180E8B5100EF57C3 /* background.ogg */; };\n\t\t1A8C557F180E8B5100EF57C3 /* crop.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556B180E8B5100EF57C3 /* crop.png */; };\n\t\t1A8C5580180E8B5100EF57C3 /* crop.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556B180E8B5100EF57C3 /* crop.png */; };\n\t\t1A8C5583180E8B5100EF57C3 /* dog.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556D180E8B5100EF57C3 /* dog.png */; };\n\t\t1A8C5584180E8B5100EF57C3 /* dog.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556D180E8B5100EF57C3 /* dog.png */; };\n\t\t1A8C5585180E8B5100EF57C3 /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556E180E8B5100EF57C3 /* effect1.wav */; };\n\t\t1A8C5586180E8B5100EF57C3 /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556E180E8B5100EF57C3 /* effect1.wav */; };\n\t\t1A8C5587180E8B5100EF57C3 /* farm.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556F180E8B5100EF57C3 /* farm.jpg */; };\n\t\t1A8C5588180E8B5100EF57C3 /* farm.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C556F180E8B5100EF57C3 /* farm.jpg */; };\n\t\t1A8C5589180E8B5100EF57C3 /* Marker Felt.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5571180E8B5100EF57C3 /* Marker Felt.ttf */; };\n\t\t1A8C558A180E8B5100EF57C3 /* Marker Felt.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5571180E8B5100EF57C3 /* Marker Felt.ttf */; };\n\t\t1A8C558B180E8B5100EF57C3 /* hello.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5572180E8B5100EF57C3 /* hello.lua */; };\n\t\t1A8C558C180E8B5100EF57C3 /* hello.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5572180E8B5100EF57C3 /* hello.lua */; };\n\t\t1A8C558D180E8B5100EF57C3 /* hello2.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5573180E8B5100EF57C3 /* hello2.lua */; };\n\t\t1A8C558E180E8B5100EF57C3 /* hello2.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5573180E8B5100EF57C3 /* hello2.lua */; };\n\t\t1A8C558F180E8B5100EF57C3 /* land.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5574180E8B5100EF57C3 /* land.png */; };\n\t\t1A8C5590180E8B5100EF57C3 /* land.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5574180E8B5100EF57C3 /* land.png */; };\n\t\t1A8C5591180E8B5100EF57C3 /* menu1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5575180E8B5100EF57C3 /* menu1.png */; };\n\t\t1A8C5592180E8B5100EF57C3 /* menu1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5575180E8B5100EF57C3 /* menu1.png */; };\n\t\t1A8C5593180E8B5100EF57C3 /* menu2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5576180E8B5100EF57C3 /* menu2.png */; };\n\t\t1A8C5594180E8B5100EF57C3 /* menu2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5576180E8B5100EF57C3 /* menu2.png */; };\n\t\t1A8C55A2180E8B8400EF57C3 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5596180E8B8400EF57C3 /* AudioEngine.lua */; };\n\t\t1A8C55A3180E8B8400EF57C3 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5596180E8B8400EF57C3 /* AudioEngine.lua */; };\n\t\t1A8C55A4180E8B8400EF57C3 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5597180E8B8400EF57C3 /* CCBReaderLoad.lua */; };\n\t\t1A8C55A5180E8B8400EF57C3 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5597180E8B8400EF57C3 /* CCBReaderLoad.lua */; };\n\t\t1A8C55A6180E8B8400EF57C3 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5598180E8B8400EF57C3 /* Cocos2d.lua */; };\n\t\t1A8C55A7180E8B8400EF57C3 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5598180E8B8400EF57C3 /* Cocos2d.lua */; };\n\t\t1A8C55A8180E8B8400EF57C3 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5599180E8B8400EF57C3 /* Cocos2dConstants.lua */; };\n\t\t1A8C55A9180E8B8400EF57C3 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C5599180E8B8400EF57C3 /* Cocos2dConstants.lua */; };\n\t\t1A8C55AA180E8B8400EF57C3 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559A180E8B8400EF57C3 /* Deprecated.lua */; };\n\t\t1A8C55AB180E8B8400EF57C3 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559A180E8B8400EF57C3 /* Deprecated.lua */; };\n\t\t1A8C55AC180E8B8400EF57C3 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559B180E8B8400EF57C3 /* DeprecatedClass.lua */; };\n\t\t1A8C55AD180E8B8400EF57C3 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559B180E8B8400EF57C3 /* DeprecatedClass.lua */; };\n\t\t1A8C55AE180E8B8400EF57C3 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559C180E8B8400EF57C3 /* DeprecatedEnum.lua */; };\n\t\t1A8C55AF180E8B8400EF57C3 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559C180E8B8400EF57C3 /* DeprecatedEnum.lua */; };\n\t\t1A8C55B0180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559D180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua */; };\n\t\t1A8C55B1180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559D180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua */; };\n\t\t1A8C55B2180E8B8400EF57C3 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559E180E8B8400EF57C3 /* DrawPrimitives.lua */; };\n\t\t1A8C55B3180E8B8400EF57C3 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559E180E8B8400EF57C3 /* DrawPrimitives.lua */; };\n\t\t1A8C55B4180E8B8400EF57C3 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559F180E8B8400EF57C3 /* luaj.lua */; };\n\t\t1A8C55B5180E8B8400EF57C3 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C559F180E8B8400EF57C3 /* luaj.lua */; };\n\t\t1A8C55B6180E8B8400EF57C3 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A0180E8B8400EF57C3 /* Opengl.lua */; };\n\t\t1A8C55B7180E8B8400EF57C3 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A0180E8B8400EF57C3 /* Opengl.lua */; };\n\t\t1A8C55B8180E8B8400EF57C3 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A1180E8B8400EF57C3 /* OpenglConstants.lua */; };\n\t\t1A8C55B9180E8B8400EF57C3 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1A8C55A1180E8B8400EF57C3 /* OpenglConstants.lua */; };\n\t\t1A8C55C4180E8BBB00EF57C3 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1A8C55C5180E8BBB00EF57C3 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1A8C55C6180E8BBB00EF57C3 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1A8C55C7180E8BBB00EF57C3 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1A8C55C8180E8BBB00EF57C3 /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBC1807A4F9005B8026 /* libluabindings Mac.a */; };\n\t\t1A8C5666180E8E0700EF57C3 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1A8C5667180E8E0700EF57C3 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1A8C5668180E8E0700EF57C3 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1A8C5669180E8E0700EF57C3 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1A8C566A180E8E0700EF57C3 /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FCA1807A4F9005B8026 /* libluabindings iOS.a */; };\n\t\t1A8C566F180E8E9600EF57C3 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C566D180E8E9600EF57C3 /* AppDelegate.cpp */; };\n\t\t1A8C5670180E8E9600EF57C3 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C566D180E8E9600EF57C3 /* AppDelegate.cpp */; };\n\t\t1A8C5864180E8F0100EF57C3 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5854180E8F0100EF57C3 /* AppController.mm */; };\n\t\t1A8C5870180E8F0100EF57C3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5860180E8F0100EF57C3 /* main.m */; };\n\t\t1A8C5871180E8F0100EF57C3 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5862180E8F0100EF57C3 /* RootViewController.mm */; };\n\t\t1A8C587F180E8F0C00EF57C3 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8C5879180E8F0C00EF57C3 /* main.cpp */; };\n\t\t1A8C588A180E8F7600EF57C3 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1A8C588B180E8F7600EF57C3 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1A8C588C180E8F7600EF57C3 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1A8C588D180E8F7600EF57C3 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1A8C588E180E8F7600EF57C3 /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBC1807A4F9005B8026 /* libluabindings Mac.a */; };\n\t\t1A8C5899180E8F8F00EF57C3 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1A8C589A180E8F8F00EF57C3 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1A8C589B180E8F8F00EF57C3 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1A8C589C180E8F8F00EF57C3 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1A8C589D180E8F8F00EF57C3 /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FCA1807A4F9005B8026 /* libluabindings iOS.a */; };\n\t\t1A9141A1180BEB6A00CFC31F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A91419A180BEB6A00CFC31F /* InfoPlist.strings */; };\n\t\t1A9141A2180BEB6A00CFC31F /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1A91419C180BEB6A00CFC31F /* MainMenu.xib */; };\n\t\t1A9141A3180BEB6A00CFC31F /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1A91419E180BEB6A00CFC31F /* Icon.icns */; };\n\t\t1A9141A4180BEB6A00CFC31F /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A91419F180BEB6A00CFC31F /* main.cpp */; };\n\t\t1A9DC2A3180E65D4007A3AD4 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC2A1180E65D4007A3AD4 /* AppDelegate.cpp */; };\n\t\t1A9DC2A4180E65D4007A3AD4 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC2A1180E65D4007A3AD4 /* AppDelegate.cpp */; };\n\t\t1A9DC2B3180E6681007A3AD4 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC2AC180E6681007A3AD4 /* main.cpp */; };\n\t\t1A9DC2C8180E668B007A3AD4 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC2B7180E668B007A3AD4 /* AppController.mm */; };\n\t\t1A9DC2D5180E668B007A3AD4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC2C4180E668B007A3AD4 /* main.m */; };\n\t\t1A9DC2D6180E668B007A3AD4 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9DC2C7180E668B007A3AD4 /* RootViewController.mm */; };\n\t\t1A9DC9E5180E6742007A3AD4 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A9DC9E6180E6742007A3AD4 /* script in Resources */ = {isa = PBXBuildFile; fileRef = 1A9DC9E4180E6742007A3AD4 /* script */; };\n\t\t1A9DC9F1180E68D8007A3AD4 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1A9DC9F2180E68D8007A3AD4 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1A9DC9F3180E68D8007A3AD4 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1A9DC9F4180E68D8007A3AD4 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1A9DC9F5180E68D8007A3AD4 /* libjsbindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBA1807A4F9005B8026 /* libjsbindings Mac.a */; };\n\t\t1A9DCA60180E7453007A3AD4 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1A9DCA61180E7453007A3AD4 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1A9DCA62180E7453007A3AD4 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1A9DCA63180E7453007A3AD4 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1A9DCA64180E7453007A3AD4 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC81807A4F9005B8026 /* libjsbindings iOS.a */; };\n\t\t1A9F808D177E98A600D9A1CB /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\t1AAF514A180E2C1A000584C8 /* AccelerometerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FA7180E2C17000584C8 /* AccelerometerTest.cpp */; };\n\t\t1AAF514B180E2C1A000584C8 /* AccelerometerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FA7180E2C17000584C8 /* AccelerometerTest.cpp */; };\n\t\t1AAF514C180E2C1A000584C8 /* ActionManagerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FAA180E2C17000584C8 /* ActionManagerTest.cpp */; };\n\t\t1AAF514D180E2C1A000584C8 /* ActionManagerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FAA180E2C17000584C8 /* ActionManagerTest.cpp */; };\n\t\t1AAF514E180E2C1A000584C8 /* ActionsEaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FAD180E2C17000584C8 /* ActionsEaseTest.cpp */; };\n\t\t1AAF514F180E2C1A000584C8 /* ActionsEaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FAD180E2C17000584C8 /* ActionsEaseTest.cpp */; };\n\t\t1AAF5150180E2C1A000584C8 /* ActionsProgressTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB0180E2C17000584C8 /* ActionsProgressTest.cpp */; };\n\t\t1AAF5151180E2C1A000584C8 /* ActionsProgressTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB0180E2C17000584C8 /* ActionsProgressTest.cpp */; };\n\t\t1AAF5152180E2C1A000584C8 /* ActionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB3180E2C17000584C8 /* ActionsTest.cpp */; };\n\t\t1AAF5153180E2C1A000584C8 /* ActionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB3180E2C17000584C8 /* ActionsTest.cpp */; };\n\t\t1AAF5154180E2C1A000584C8 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB5180E2C17000584C8 /* AppDelegate.cpp */; };\n\t\t1AAF5155180E2C1A000584C8 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB5180E2C17000584C8 /* AppDelegate.cpp */; };\n\t\t1AAF5156180E2C1A000584C8 /* BaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB7180E2C17000584C8 /* BaseTest.cpp */; };\n\t\t1AAF5157180E2C1A000584C8 /* BaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FB7180E2C17000584C8 /* BaseTest.cpp */; };\n\t\t1AAF5158180E2C1A000584C8 /* Box2dTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FBA180E2C17000584C8 /* Box2dTest.cpp */; };\n\t\t1AAF5159180E2C1A000584C8 /* Box2dTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FBA180E2C17000584C8 /* Box2dTest.cpp */; };\n\t\t1AAF515A180E2C1A000584C8 /* Box2dView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FBD180E2C17000584C8 /* Box2dView.cpp */; };\n\t\t1AAF515B180E2C1A000584C8 /* Box2dView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FBD180E2C17000584C8 /* Box2dView.cpp */; };\n\t\t1AAF515C180E2C1A000584C8 /* GLES-Render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FBF180E2C17000584C8 /* GLES-Render.cpp */; };\n\t\t1AAF515D180E2C1A000584C8 /* GLES-Render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FBF180E2C17000584C8 /* GLES-Render.cpp */; };\n\t\t1AAF515E180E2C1A000584C8 /* Test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FC1180E2C17000584C8 /* Test.cpp */; };\n\t\t1AAF515F180E2C1A000584C8 /* Test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FC1180E2C17000584C8 /* Test.cpp */; };\n\t\t1AAF5160180E2C1A000584C8 /* TestEntries.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FC3180E2C17000584C8 /* TestEntries.cpp */; };\n\t\t1AAF5161180E2C1A000584C8 /* TestEntries.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FC3180E2C17000584C8 /* TestEntries.cpp */; };\n\t\t1AAF5162180E2C1A000584C8 /* Bug-1159.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF3180E2C17000584C8 /* Bug-1159.cpp */; };\n\t\t1AAF5163180E2C1A000584C8 /* Bug-1159.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF3180E2C17000584C8 /* Bug-1159.cpp */; };\n\t\t1AAF5164180E2C1A000584C8 /* Bug-1174.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF5180E2C17000584C8 /* Bug-1174.cpp */; };\n\t\t1AAF5165180E2C1A000584C8 /* Bug-1174.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF5180E2C17000584C8 /* Bug-1174.cpp */; };\n\t\t1AAF5166180E2C1A000584C8 /* Bug-350.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF7180E2C17000584C8 /* Bug-350.cpp */; };\n\t\t1AAF5167180E2C1A000584C8 /* Bug-350.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF7180E2C17000584C8 /* Bug-350.cpp */; };\n\t\t1AAF5168180E2C1A000584C8 /* Bug-422.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF9180E2C17000584C8 /* Bug-422.cpp */; };\n\t\t1AAF5169180E2C1A000584C8 /* Bug-422.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FF9180E2C17000584C8 /* Bug-422.cpp */; };\n\t\t1AAF516A180E2C1A000584C8 /* Bug-458.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FFC180E2C17000584C8 /* Bug-458.cpp */; };\n\t\t1AAF516B180E2C1A000584C8 /* Bug-458.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FFC180E2C17000584C8 /* Bug-458.cpp */; };\n\t\t1AAF516C180E2C1A000584C8 /* QuestionContainerSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FFE180E2C17000584C8 /* QuestionContainerSprite.cpp */; };\n\t\t1AAF516D180E2C1A000584C8 /* QuestionContainerSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF4FFE180E2C17000584C8 /* QuestionContainerSprite.cpp */; };\n\t\t1AAF516E180E2C1A000584C8 /* Bug-624.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5000180E2C17000584C8 /* Bug-624.cpp */; };\n\t\t1AAF516F180E2C1A000584C8 /* Bug-624.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5000180E2C17000584C8 /* Bug-624.cpp */; };\n\t\t1AAF5170180E2C1A000584C8 /* Bug-886.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5002180E2C17000584C8 /* Bug-886.cpp */; };\n\t\t1AAF5171180E2C1A000584C8 /* Bug-886.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5002180E2C17000584C8 /* Bug-886.cpp */; };\n\t\t1AAF5172180E2C1A000584C8 /* Bug-899.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5004180E2C17000584C8 /* Bug-899.cpp */; };\n\t\t1AAF5173180E2C1A000584C8 /* Bug-899.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5004180E2C17000584C8 /* Bug-899.cpp */; };\n\t\t1AAF5174180E2C1A000584C8 /* Bug-914.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5006180E2C17000584C8 /* Bug-914.cpp */; };\n\t\t1AAF5175180E2C1A000584C8 /* Bug-914.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5006180E2C17000584C8 /* Bug-914.cpp */; };\n\t\t1AAF5176180E2C1A000584C8 /* BugsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5008180E2C17000584C8 /* BugsTest.cpp */; };\n\t\t1AAF5177180E2C1A000584C8 /* BugsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5008180E2C17000584C8 /* BugsTest.cpp */; };\n\t\t1AAF5178180E2C1A000584C8 /* ChipmunkTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF500B180E2C18000584C8 /* ChipmunkTest.cpp */; };\n\t\t1AAF5179180E2C1A000584C8 /* ChipmunkTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF500B180E2C18000584C8 /* ChipmunkTest.cpp */; };\n\t\t1AAF517A180E2C1A000584C8 /* ClickAndMoveTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF500E180E2C18000584C8 /* ClickAndMoveTest.cpp */; };\n\t\t1AAF517B180E2C1A000584C8 /* ClickAndMoveTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF500E180E2C18000584C8 /* ClickAndMoveTest.cpp */; };\n\t\t1AAF517C180E2C1A000584C8 /* ClippingNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5011180E2C18000584C8 /* ClippingNodeTest.cpp */; };\n\t\t1AAF517D180E2C1A000584C8 /* ClippingNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5011180E2C18000584C8 /* ClippingNodeTest.cpp */; };\n\t\t1AAF517E180E2C1A000584C8 /* CocosDenshionTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5014180E2C18000584C8 /* CocosDenshionTest.cpp */; };\n\t\t1AAF517F180E2C1A000584C8 /* CocosDenshionTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5014180E2C18000584C8 /* CocosDenshionTest.cpp */; };\n\t\t1AAF5180180E2C1A000584C8 /* ConfigurationTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5017180E2C18000584C8 /* ConfigurationTest.cpp */; };\n\t\t1AAF5181180E2C1A000584C8 /* ConfigurationTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5017180E2C18000584C8 /* ConfigurationTest.cpp */; };\n\t\t1AAF5182180E2C1A000584C8 /* controller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5019180E2C18000584C8 /* controller.cpp */; };\n\t\t1AAF5183180E2C1A000584C8 /* controller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5019180E2C18000584C8 /* controller.cpp */; };\n\t\t1AAF5184180E2C1A000584C8 /* CurlTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF501C180E2C18000584C8 /* CurlTest.cpp */; };\n\t\t1AAF5185180E2C1A000584C8 /* CurlTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF501C180E2C18000584C8 /* CurlTest.cpp */; };\n\t\t1AAF5186180E2C1A000584C8 /* CurrentLanguageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF501F180E2C18000584C8 /* CurrentLanguageTest.cpp */; };\n\t\t1AAF5187180E2C1A000584C8 /* CurrentLanguageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF501F180E2C18000584C8 /* CurrentLanguageTest.cpp */; };\n\t\t1AAF5188180E2C1A000584C8 /* DataVisitorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5022180E2C18000584C8 /* DataVisitorTest.cpp */; };\n\t\t1AAF5189180E2C1A000584C8 /* DataVisitorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5022180E2C18000584C8 /* DataVisitorTest.cpp */; };\n\t\t1AAF518A180E2C1A000584C8 /* DrawPrimitivesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5025180E2C18000584C8 /* DrawPrimitivesTest.cpp */; };\n\t\t1AAF518B180E2C1A000584C8 /* DrawPrimitivesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5025180E2C18000584C8 /* DrawPrimitivesTest.cpp */; };\n\t\t1AAF518C180E2C1A000584C8 /* EffectsAdvancedTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5028180E2C18000584C8 /* EffectsAdvancedTest.cpp */; };\n\t\t1AAF518D180E2C1A000584C8 /* EffectsAdvancedTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5028180E2C18000584C8 /* EffectsAdvancedTest.cpp */; };\n\t\t1AAF518E180E2C1A000584C8 /* EffectsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF502B180E2C18000584C8 /* EffectsTest.cpp */; };\n\t\t1AAF518F180E2C1A000584C8 /* EffectsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF502B180E2C18000584C8 /* EffectsTest.cpp */; };\n\t\t1AAF5190180E2C1A000584C8 /* AnimationsTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5031180E2C18000584C8 /* AnimationsTestLayer.cpp */; };\n\t\t1AAF5191180E2C1A000584C8 /* AnimationsTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5031180E2C18000584C8 /* AnimationsTestLayer.cpp */; };\n\t\t1AAF5192180E2C1A000584C8 /* ButtonTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5034180E2C18000584C8 /* ButtonTestLayer.cpp */; };\n\t\t1AAF5193180E2C1A000584C8 /* ButtonTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5034180E2C18000584C8 /* ButtonTestLayer.cpp */; };\n\t\t1AAF5194180E2C1A000584C8 /* CocosBuilderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5037180E2C18000584C8 /* CocosBuilderTest.cpp */; };\n\t\t1AAF5195180E2C1A000584C8 /* CocosBuilderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5037180E2C18000584C8 /* CocosBuilderTest.cpp */; };\n\t\t1AAF5196180E2C1A000584C8 /* HelloCocosBuilderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF503A180E2C18000584C8 /* HelloCocosBuilderLayer.cpp */; };\n\t\t1AAF5197180E2C1A000584C8 /* HelloCocosBuilderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF503A180E2C18000584C8 /* HelloCocosBuilderLayer.cpp */; };\n\t\t1AAF5198180E2C1A000584C8 /* MenuTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5041180E2C18000584C8 /* MenuTestLayer.cpp */; };\n\t\t1AAF5199180E2C1A000584C8 /* MenuTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5041180E2C18000584C8 /* MenuTestLayer.cpp */; };\n\t\t1AAF519A180E2C1A000584C8 /* TestHeaderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF504E180E2C18000584C8 /* TestHeaderLayer.cpp */; };\n\t\t1AAF519B180E2C1A000584C8 /* TestHeaderLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF504E180E2C18000584C8 /* TestHeaderLayer.cpp */; };\n\t\t1AAF519C180E2C1A000584C8 /* TimelineCallbackTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5053180E2C18000584C8 /* TimelineCallbackTestLayer.cpp */; };\n\t\t1AAF519D180E2C1A000584C8 /* TimelineCallbackTestLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5053180E2C18000584C8 /* TimelineCallbackTestLayer.cpp */; };\n\t\t1AAF519E180E2C1A000584C8 /* ArmatureScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5056180E2C18000584C8 /* ArmatureScene.cpp */; };\n\t\t1AAF519F180E2C1A000584C8 /* ArmatureScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5056180E2C18000584C8 /* ArmatureScene.cpp */; };\n\t\t1AAF51A0180E2C1A000584C8 /* ComponentsTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5059180E2C18000584C8 /* ComponentsTestScene.cpp */; };\n\t\t1AAF51A1180E2C1A000584C8 /* ComponentsTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5059180E2C18000584C8 /* ComponentsTestScene.cpp */; };\n\t\t1AAF51A2180E2C1A000584C8 /* EnemyController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF505B180E2C18000584C8 /* EnemyController.cpp */; };\n\t\t1AAF51A3180E2C1A000584C8 /* EnemyController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF505B180E2C18000584C8 /* EnemyController.cpp */; };\n\t\t1AAF51A4180E2C1A000584C8 /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF505D180E2C18000584C8 /* GameOverScene.cpp */; };\n\t\t1AAF51A5180E2C1A000584C8 /* GameOverScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF505D180E2C18000584C8 /* GameOverScene.cpp */; };\n\t\t1AAF51A6180E2C1A000584C8 /* PlayerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF505F180E2C18000584C8 /* PlayerController.cpp */; };\n\t\t1AAF51A7180E2C1A000584C8 /* PlayerController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF505F180E2C18000584C8 /* PlayerController.cpp */; };\n\t\t1AAF51A8180E2C1A000584C8 /* ProjectileController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5061180E2C18000584C8 /* ProjectileController.cpp */; };\n\t\t1AAF51A9180E2C1A000584C8 /* ProjectileController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5061180E2C18000584C8 /* ProjectileController.cpp */; };\n\t\t1AAF51AA180E2C1A000584C8 /* SceneController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5063180E2C18000584C8 /* SceneController.cpp */; };\n\t\t1AAF51AB180E2C1A000584C8 /* SceneController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5063180E2C18000584C8 /* SceneController.cpp */; };\n\t\t1AAF51D4180E2C1A000584C8 /* SceneEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50A0180E2C19000584C8 /* SceneEditorTest.cpp */; };\n\t\t1AAF51D5180E2C1A000584C8 /* SceneEditorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50A0180E2C19000584C8 /* SceneEditorTest.cpp */; };\n\t\t1AAF51D6180E2C1A000584C8 /* CCControlButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50A4180E2C19000584C8 /* CCControlButtonTest.cpp */; };\n\t\t1AAF51D7180E2C1A000584C8 /* CCControlButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50A4180E2C19000584C8 /* CCControlButtonTest.cpp */; };\n\t\t1AAF51D8180E2C1A000584C8 /* CCControlColourPickerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50A7180E2C19000584C8 /* CCControlColourPickerTest.cpp */; };\n\t\t1AAF51D9180E2C1A000584C8 /* CCControlColourPickerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50A7180E2C19000584C8 /* CCControlColourPickerTest.cpp */; };\n\t\t1AAF51DA180E2C1A000584C8 /* CCControlPotentiometerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50AA180E2C19000584C8 /* CCControlPotentiometerTest.cpp */; };\n\t\t1AAF51DB180E2C1A000584C8 /* CCControlPotentiometerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50AA180E2C19000584C8 /* CCControlPotentiometerTest.cpp */; };\n\t\t1AAF51DC180E2C1A000584C8 /* CCControlScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50AC180E2C19000584C8 /* CCControlScene.cpp */; };\n\t\t1AAF51DD180E2C1A000584C8 /* CCControlScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50AC180E2C19000584C8 /* CCControlScene.cpp */; };\n\t\t1AAF51DE180E2C1A000584C8 /* CCControlSceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50AE180E2C19000584C8 /* CCControlSceneManager.cpp */; };\n\t\t1AAF51DF180E2C1A000584C8 /* CCControlSceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50AE180E2C19000584C8 /* CCControlSceneManager.cpp */; };\n\t\t1AAF51E0180E2C1A000584C8 /* CCControlSliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50B1180E2C19000584C8 /* CCControlSliderTest.cpp */; };\n\t\t1AAF51E1180E2C1A000584C8 /* CCControlSliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50B1180E2C19000584C8 /* CCControlSliderTest.cpp */; };\n\t\t1AAF51E2180E2C1A000584C8 /* CCControlStepperTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50B4180E2C19000584C8 /* CCControlStepperTest.cpp */; };\n\t\t1AAF51E3180E2C1A000584C8 /* CCControlStepperTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50B4180E2C19000584C8 /* CCControlStepperTest.cpp */; };\n\t\t1AAF51E4180E2C1A000584C8 /* CCControlSwitchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50B7180E2C19000584C8 /* CCControlSwitchTest.cpp */; };\n\t\t1AAF51E5180E2C1A000584C8 /* CCControlSwitchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50B7180E2C19000584C8 /* CCControlSwitchTest.cpp */; };\n\t\t1AAF51E6180E2C1A000584C8 /* EditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50BA180E2C19000584C8 /* EditBoxTest.cpp */; };\n\t\t1AAF51E7180E2C1A000584C8 /* EditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50BA180E2C19000584C8 /* EditBoxTest.cpp */; };\n\t\t1AAF51E8180E2C1A000584C8 /* ExtensionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50BC180E2C19000584C8 /* ExtensionsTest.cpp */; };\n\t\t1AAF51E9180E2C1A000584C8 /* ExtensionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50BC180E2C19000584C8 /* ExtensionsTest.cpp */; };\n\t\t1AAF51EA180E2C1A000584C8 /* HttpClientTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50BF180E2C19000584C8 /* HttpClientTest.cpp */; };\n\t\t1AAF51EB180E2C1A000584C8 /* HttpClientTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50BF180E2C19000584C8 /* HttpClientTest.cpp */; };\n\t\t1AAF51EC180E2C1A000584C8 /* SocketIOTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C1180E2C19000584C8 /* SocketIOTest.cpp */; };\n\t\t1AAF51ED180E2C1A000584C8 /* SocketIOTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C1180E2C19000584C8 /* SocketIOTest.cpp */; };\n\t\t1AAF51EE180E2C1A000584C8 /* WebSocketTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C3180E2C19000584C8 /* WebSocketTest.cpp */; };\n\t\t1AAF51EF180E2C1A000584C8 /* WebSocketTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C3180E2C19000584C8 /* WebSocketTest.cpp */; };\n\t\t1AAF51F0180E2C1A000584C8 /* NotificationCenterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C6180E2C19000584C8 /* NotificationCenterTest.cpp */; };\n\t\t1AAF51F1180E2C1A000584C8 /* NotificationCenterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C6180E2C19000584C8 /* NotificationCenterTest.cpp */; };\n\t\t1AAF51F2180E2C1A000584C8 /* Scale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C9180E2C19000584C8 /* Scale9SpriteTest.cpp */; };\n\t\t1AAF51F3180E2C1A000584C8 /* Scale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50C9180E2C19000584C8 /* Scale9SpriteTest.cpp */; };\n\t\t1AAF51F4180E2C1A000584C8 /* CustomTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50CC180E2C19000584C8 /* CustomTableViewCell.cpp */; };\n\t\t1AAF51F5180E2C1A000584C8 /* CustomTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50CC180E2C19000584C8 /* CustomTableViewCell.cpp */; };\n\t\t1AAF51F6180E2C1A000584C8 /* TableViewTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50CE180E2C19000584C8 /* TableViewTestScene.cpp */; };\n\t\t1AAF51F7180E2C1A000584C8 /* TableViewTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50CE180E2C19000584C8 /* TableViewTestScene.cpp */; };\n\t\t1AAF51F8180E2C1A000584C8 /* FileUtilsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50D1180E2C19000584C8 /* FileUtilsTest.cpp */; };\n\t\t1AAF51F9180E2C1A000584C8 /* FileUtilsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50D1180E2C19000584C8 /* FileUtilsTest.cpp */; };\n\t\t1AAF51FA180E2C1A000584C8 /* FontTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50D4180E2C19000584C8 /* FontTest.cpp */; };\n\t\t1AAF51FB180E2C1A000584C8 /* FontTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50D4180E2C19000584C8 /* FontTest.cpp */; };\n\t\t1AAF51FC180E2C1A000584C8 /* IntervalTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50D7180E2C19000584C8 /* IntervalTest.cpp */; };\n\t\t1AAF51FD180E2C1A000584C8 /* IntervalTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50D7180E2C19000584C8 /* IntervalTest.cpp */; };\n\t\t1AAF51FE180E2C1A000584C8 /* KeyboardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50DA180E2C19000584C8 /* KeyboardTest.cpp */; };\n\t\t1AAF51FF180E2C1A000584C8 /* KeyboardTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50DA180E2C19000584C8 /* KeyboardTest.cpp */; };\n\t\t1AAF5200180E2C1A000584C8 /* KeypadTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50DD180E2C19000584C8 /* KeypadTest.cpp */; };\n\t\t1AAF5201180E2C1A000584C8 /* KeypadTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50DD180E2C19000584C8 /* KeypadTest.cpp */; };\n\t\t1AAF5202180E2C1A000584C8 /* LabelTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E0180E2C19000584C8 /* LabelTest.cpp */; };\n\t\t1AAF5203180E2C1A000584C8 /* LabelTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E0180E2C19000584C8 /* LabelTest.cpp */; };\n\t\t1AAF5204180E2C1A000584C8 /* LabelTestNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E2180E2C19000584C8 /* LabelTestNew.cpp */; };\n\t\t1AAF5205180E2C1A000584C8 /* LabelTestNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E2180E2C19000584C8 /* LabelTestNew.cpp */; };\n\t\t1AAF5206180E2C1A000584C8 /* LayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E5180E2C19000584C8 /* LayerTest.cpp */; };\n\t\t1AAF5207180E2C1A000584C8 /* LayerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E5180E2C19000584C8 /* LayerTest.cpp */; };\n\t\t1AAF5208180E2C1A000584C8 /* MenuTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E8180E2C19000584C8 /* MenuTest.cpp */; };\n\t\t1AAF5209180E2C1A000584C8 /* MenuTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50E8180E2C19000584C8 /* MenuTest.cpp */; };\n\t\t1AAF520A180E2C1A000584C8 /* MotionStreakTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50EB180E2C19000584C8 /* MotionStreakTest.cpp */; };\n\t\t1AAF520B180E2C1A000584C8 /* MotionStreakTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50EB180E2C19000584C8 /* MotionStreakTest.cpp */; };\n\t\t1AAF520C180E2C1A000584C8 /* MutiTouchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50EE180E2C19000584C8 /* MutiTouchTest.cpp */; };\n\t\t1AAF520D180E2C1A000584C8 /* MutiTouchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50EE180E2C19000584C8 /* MutiTouchTest.cpp */; };\n\t\t1AAF520E180E2C1A000584C8 /* NewEventDispatcherTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50F1180E2C19000584C8 /* NewEventDispatcherTest.cpp */; };\n\t\t1AAF520F180E2C1A000584C8 /* NewEventDispatcherTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50F1180E2C19000584C8 /* NewEventDispatcherTest.cpp */; };\n\t\t1AAF5210180E2C1A000584C8 /* NodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50F4180E2C19000584C8 /* NodeTest.cpp */; };\n\t\t1AAF5211180E2C1A000584C8 /* NodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50F4180E2C19000584C8 /* NodeTest.cpp */; };\n\t\t1AAF5212180E2C1A000584C8 /* ParallaxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50F7180E2C1A000584C8 /* ParallaxTest.cpp */; };\n\t\t1AAF5213180E2C1A000584C8 /* ParallaxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50F7180E2C1A000584C8 /* ParallaxTest.cpp */; };\n\t\t1AAF5214180E2C1A000584C8 /* ParticleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50FA180E2C1A000584C8 /* ParticleTest.cpp */; };\n\t\t1AAF5215180E2C1A000584C8 /* ParticleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50FA180E2C1A000584C8 /* ParticleTest.cpp */; };\n\t\t1AAF5216180E2C1A000584C8 /* PerformanceAllocTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50FD180E2C1A000584C8 /* PerformanceAllocTest.cpp */; };\n\t\t1AAF5217180E2C1A000584C8 /* PerformanceAllocTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50FD180E2C1A000584C8 /* PerformanceAllocTest.cpp */; };\n\t\t1AAF5218180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50FF180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp */; };\n\t\t1AAF5219180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF50FF180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp */; };\n\t\t1AAF521A180E2C1A000584C8 /* PerformanceParticleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5101180E2C1A000584C8 /* PerformanceParticleTest.cpp */; };\n\t\t1AAF521B180E2C1A000584C8 /* PerformanceParticleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5101180E2C1A000584C8 /* PerformanceParticleTest.cpp */; };\n\t\t1AAF521C180E2C1A000584C8 /* PerformanceSpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5103180E2C1A000584C8 /* PerformanceSpriteTest.cpp */; };\n\t\t1AAF521D180E2C1A000584C8 /* PerformanceSpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5103180E2C1A000584C8 /* PerformanceSpriteTest.cpp */; };\n\t\t1AAF521E180E2C1A000584C8 /* PerformanceTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5105180E2C1A000584C8 /* PerformanceTest.cpp */; };\n\t\t1AAF521F180E2C1A000584C8 /* PerformanceTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5105180E2C1A000584C8 /* PerformanceTest.cpp */; };\n\t\t1AAF5220180E2C1A000584C8 /* PerformanceTextureTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5107180E2C1A000584C8 /* PerformanceTextureTest.cpp */; };\n\t\t1AAF5221180E2C1A000584C8 /* PerformanceTextureTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5107180E2C1A000584C8 /* PerformanceTextureTest.cpp */; };\n\t\t1AAF5222180E2C1A000584C8 /* PerformanceTouchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5109180E2C1A000584C8 /* PerformanceTouchesTest.cpp */; };\n\t\t1AAF5223180E2C1A000584C8 /* PerformanceTouchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5109180E2C1A000584C8 /* PerformanceTouchesTest.cpp */; };\n\t\t1AAF5224180E2C1A000584C8 /* PhysicsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF510C180E2C1A000584C8 /* PhysicsTest.cpp */; };\n\t\t1AAF5225180E2C1A000584C8 /* PhysicsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF510C180E2C1A000584C8 /* PhysicsTest.cpp */; };\n\t\t1AAF5226180E2C1A000584C8 /* RenderTextureTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF510F180E2C1A000584C8 /* RenderTextureTest.cpp */; };\n\t\t1AAF5227180E2C1A000584C8 /* RenderTextureTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF510F180E2C1A000584C8 /* RenderTextureTest.cpp */; };\n\t\t1AAF5228180E2C1A000584C8 /* RotateWorldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5112180E2C1A000584C8 /* RotateWorldTest.cpp */; };\n\t\t1AAF5229180E2C1A000584C8 /* RotateWorldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5112180E2C1A000584C8 /* RotateWorldTest.cpp */; };\n\t\t1AAF522A180E2C1A000584C8 /* SceneTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5115180E2C1A000584C8 /* SceneTest.cpp */; };\n\t\t1AAF522B180E2C1A000584C8 /* SceneTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5115180E2C1A000584C8 /* SceneTest.cpp */; };\n\t\t1AAF522C180E2C1A000584C8 /* SchedulerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5118180E2C1A000584C8 /* SchedulerTest.cpp */; };\n\t\t1AAF522D180E2C1A000584C8 /* SchedulerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5118180E2C1A000584C8 /* SchedulerTest.cpp */; };\n\t\t1AAF522E180E2C1A000584C8 /* ShaderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF511B180E2C1A000584C8 /* ShaderTest.cpp */; };\n\t\t1AAF522F180E2C1A000584C8 /* ShaderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF511B180E2C1A000584C8 /* ShaderTest.cpp */; };\n\t\t1AAF5230180E2C1A000584C8 /* ShaderTest2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF511D180E2C1A000584C8 /* ShaderTest2.cpp */; };\n\t\t1AAF5231180E2C1A000584C8 /* ShaderTest2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF511D180E2C1A000584C8 /* ShaderTest2.cpp */; };\n\t\t1AAF5232180E2C1A000584C8 /* SpineTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5120180E2C1A000584C8 /* SpineTest.cpp */; };\n\t\t1AAF5233180E2C1A000584C8 /* SpineTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5120180E2C1A000584C8 /* SpineTest.cpp */; };\n\t\t1AAF5234180E2C1A000584C8 /* SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5123180E2C1A000584C8 /* SpriteTest.cpp */; };\n\t\t1AAF5235180E2C1A000584C8 /* SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5123180E2C1A000584C8 /* SpriteTest.cpp */; };\n\t\t1AAF5236180E2C1A000584C8 /* testBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5125180E2C1A000584C8 /* testBasic.cpp */; };\n\t\t1AAF5237180E2C1A000584C8 /* testBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5125180E2C1A000584C8 /* testBasic.cpp */; };\n\t\t1AAF5238180E2C1A000584C8 /* TextInputTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF512A180E2C1A000584C8 /* TextInputTest.cpp */; };\n\t\t1AAF5239180E2C1A000584C8 /* TextInputTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF512A180E2C1A000584C8 /* TextInputTest.cpp */; };\n\t\t1AAF523A180E2C1A000584C8 /* Texture2dTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF512D180E2C1A000584C8 /* Texture2dTest.cpp */; };\n\t\t1AAF523B180E2C1A000584C8 /* Texture2dTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF512D180E2C1A000584C8 /* Texture2dTest.cpp */; };\n\t\t1AAF523C180E2C1A000584C8 /* TextureCacheTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5130180E2C1A000584C8 /* TextureCacheTest.cpp */; };\n\t\t1AAF523D180E2C1A000584C8 /* TextureCacheTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5130180E2C1A000584C8 /* TextureCacheTest.cpp */; };\n\t\t1AAF523E180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5133180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp */; };\n\t\t1AAF523F180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5133180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp */; };\n\t\t1AAF5240180E2C1A000584C8 /* TileMapTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5136180E2C1A000584C8 /* TileMapTest.cpp */; };\n\t\t1AAF5241180E2C1A000584C8 /* TileMapTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5136180E2C1A000584C8 /* TileMapTest.cpp */; };\n\t\t1AAF5242180E2C1A000584C8 /* Ball.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5139180E2C1A000584C8 /* Ball.cpp */; };\n\t\t1AAF5243180E2C1A000584C8 /* Ball.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5139180E2C1A000584C8 /* Ball.cpp */; };\n\t\t1AAF5244180E2C1A000584C8 /* Paddle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF513B180E2C1A000584C8 /* Paddle.cpp */; };\n\t\t1AAF5245180E2C1A000584C8 /* Paddle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF513B180E2C1A000584C8 /* Paddle.cpp */; };\n\t\t1AAF5246180E2C1A000584C8 /* TouchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF513D180E2C1A000584C8 /* TouchesTest.cpp */; };\n\t\t1AAF5247180E2C1A000584C8 /* TouchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF513D180E2C1A000584C8 /* TouchesTest.cpp */; };\n\t\t1AAF5248180E2C1A000584C8 /* TransitionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5140180E2C1A000584C8 /* TransitionsTest.cpp */; };\n\t\t1AAF5249180E2C1A000584C8 /* TransitionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5140180E2C1A000584C8 /* TransitionsTest.cpp */; };\n\t\t1AAF524A180E2C1A000584C8 /* UserDefaultTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5143180E2C1A000584C8 /* UserDefaultTest.cpp */; };\n\t\t1AAF524B180E2C1A000584C8 /* UserDefaultTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5143180E2C1A000584C8 /* UserDefaultTest.cpp */; };\n\t\t1AAF524C180E2C1A000584C8 /* VisibleRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5145180E2C1A000584C8 /* VisibleRect.cpp */; };\n\t\t1AAF524D180E2C1A000584C8 /* VisibleRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5145180E2C1A000584C8 /* VisibleRect.cpp */; };\n\t\t1AAF524E180E2C1A000584C8 /* ZwoptexTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5148180E2C1A000584C8 /* ZwoptexTest.cpp */; };\n\t\t1AAF524F180E2C1A000584C8 /* ZwoptexTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5148180E2C1A000584C8 /* ZwoptexTest.cpp */; };\n\t\t1AAF5269180E2C26000584C8 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5253180E2C26000584C8 /* RootViewController.mm */; };\n\t\t1AAF526A180E2C26000584C8 /* testsAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5255180E2C26000584C8 /* testsAppDelegate.mm */; };\n\t\t1AAF526B180E2C26000584C8 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5256180E2C26000584C8 /* Default-568h@2x.png */; };\n\t\t1AAF526C180E2C26000584C8 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5257180E2C26000584C8 /* Default.png */; };\n\t\t1AAF526D180E2C26000584C8 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5258180E2C26000584C8 /* Default@2x.png */; };\n\t\t1AAF526E180E2C26000584C8 /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5259180E2C26000584C8 /* Icon-100.png */; };\n\t\t1AAF526F180E2C26000584C8 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF525A180E2C26000584C8 /* Icon-114.png */; };\n\t\t1AAF5270180E2C26000584C8 /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF525B180E2C26000584C8 /* Icon-120.png */; };\n\t\t1AAF5271180E2C26000584C8 /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF525C180E2C26000584C8 /* Icon-144.png */; };\n\t\t1AAF5272180E2C26000584C8 /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF525D180E2C26000584C8 /* Icon-152.png */; };\n\t\t1AAF5273180E2C26000584C8 /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF525E180E2C26000584C8 /* Icon-29.png */; };\n\t\t1AAF5274180E2C26000584C8 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF525F180E2C26000584C8 /* Icon-40.png */; };\n\t\t1AAF5275180E2C26000584C8 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5260180E2C26000584C8 /* Icon-50.png */; };\n\t\t1AAF5276180E2C26000584C8 /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5261180E2C26000584C8 /* Icon-57.png */; };\n\t\t1AAF5277180E2C26000584C8 /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5262180E2C26000584C8 /* Icon-58.png */; };\n\t\t1AAF5278180E2C26000584C8 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5263180E2C26000584C8 /* Icon-72.png */; };\n\t\t1AAF5279180E2C26000584C8 /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5264180E2C26000584C8 /* Icon-76.png */; };\n\t\t1AAF527A180E2C26000584C8 /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5265180E2C26000584C8 /* Icon-80.png */; };\n\t\t1AAF527B180E2C26000584C8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5267180E2C26000584C8 /* main.m */; };\n\t\t1AAF527C180E2C26000584C8 /* Test-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5268180E2C26000584C8 /* Test-Info.plist */; };\n\t\t1AAF5286180E2C31000584C8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF527E180E2C31000584C8 /* InfoPlist.strings */; };\n\t\t1AAF5287180E2C31000584C8 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5280180E2C31000584C8 /* MainMenu.xib */; };\n\t\t1AAF5288180E2C31000584C8 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1AAF5282180E2C31000584C8 /* Icon.icns */; };\n\t\t1AAF5289180E2C31000584C8 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF5283180E2C31000584C8 /* main.cpp */; };\n\t\t1AAF534B180E2F4E000584C8 /* libbox2d Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB61807A4F9005B8026 /* libbox2d Mac.a */; };\n\t\t1AAF534C180E2F4E000584C8 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */; };\n\t\t1AAF534D180E2F4E000584C8 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t1AAF534E180E2F4E000584C8 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */; };\n\t\t1AAF534F180E2F4E000584C8 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t1AAF53FE180E39D4000584C8 /* libbox2d iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC41807A4F9005B8026 /* libbox2d iOS.a */; };\n\t\t1AAF53FF180E39D4000584C8 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */; };\n\t\t1AAF5400180E39D4000584C8 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t1AAF5401180E39D4000584C8 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */; };\n\t\t1AAF5402180E39D4000584C8 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t1ADCE790186BCAB9001B78A4 /* CocosGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360CA186819DB00828878 /* CocosGUIScene.cpp */; };\n\t\t1ADCE793186BCAFB001B78A4 /* UIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360EA186819DB00828878 /* UIScene.cpp */; };\n\t\t1ADCE794186BCAFB001B78A4 /* UISceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360EC186819DB00828878 /* UISceneManager.cpp */; };\n\t\t1ADCE795186BCB20001B78A4 /* UIButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360CD186819DB00828878 /* UIButtonTest.cpp */; };\n\t\t1ADCE796186BCB20001B78A4 /* UICheckBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D0186819DB00828878 /* UICheckBoxTest.cpp */; };\n\t\t1ADCE797186BCB21001B78A4 /* UIImageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D3186819DB00828878 /* UIImageViewTest.cpp */; };\n\t\t1ADCE798186BCB21001B78A4 /* UILabelAtlasTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D6186819DB00828878 /* UILabelAtlasTest.cpp */; };\n\t\t1ADCE799186BCB21001B78A4 /* UILabelBMFontTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D9186819DB00828878 /* UILabelBMFontTest.cpp */; };\n\t\t1ADCE79A186BCB21001B78A4 /* UILabelTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360DC186819DB00828878 /* UILabelTest.cpp */; };\n\t\t1ADCE79B186BCB21001B78A4 /* UILayoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360DF186819DB00828878 /* UILayoutTest.cpp */; };\n\t\t1ADCE79C186BCB21001B78A4 /* UIListViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360E2186819DB00828878 /* UIListViewTest.cpp */; };\n\t\t1ADCE79D186BCB21001B78A4 /* UILoadingBarTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360E5186819DB00828878 /* UILoadingBarTest.cpp */; };\n\t\t1ADCE79E186BCB21001B78A4 /* UIPageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360E8186819DB00828878 /* UIPageViewTest.cpp */; };\n\t\t1ADCE79F186BCF19001B78A4 /* UIScrollViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360EF186819DB00828878 /* UIScrollViewTest.cpp */; };\n\t\t1ADCE7A0186BCF19001B78A4 /* UISliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360F2186819DB00828878 /* UISliderTest.cpp */; };\n\t\t1ADCE7A1186BCF19001B78A4 /* UITextFieldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360F5186819DB00828878 /* UITextFieldTest.cpp */; };\n\t\t1ADCE7A2186BCF19001B78A4 /* UIWidgetAddNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360F8186819DB00828878 /* UIWidgetAddNodeTest.cpp */; };\n\t\t1ADD146D188D25270034D5EF /* PerformanceEventDispatcherTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADD146B188D25270034D5EF /* PerformanceEventDispatcherTest.cpp */; };\n\t\t1ADD146E188D25270034D5EF /* PerformanceEventDispatcherTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADD146B188D25270034D5EF /* PerformanceEventDispatcherTest.cpp */; };\n\t\t1AFB0DE31885357A003B2FF3 /* PerformanceContainerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFB0DE11885357A003B2FF3 /* PerformanceContainerTest.cpp */; };\n\t\t1AFB0DE41885357A003B2FF3 /* PerformanceContainerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFB0DE11885357A003B2FF3 /* PerformanceContainerTest.cpp */; };\n\t\t37A61460186B21F6007A4638 /* acts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37A6145B186B21F6007A4638 /* acts.cpp */; };\n\t\t37A61461186B21F6007A4638 /* acts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37A6145B186B21F6007A4638 /* acts.cpp */; };\n\t\t37A61462186B21F6007A4638 /* cons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37A6145D186B21F6007A4638 /* cons.cpp */; };\n\t\t37A61463186B21F6007A4638 /* cons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37A6145D186B21F6007A4638 /* cons.cpp */; };\n\t\t37C819801875DF2B00930C57 /* animations in Resources */ = {isa = PBXBuildFile; fileRef = 37C819601875DF2A00930C57 /* animations */; };\n\t\t37C819831875DF2B00930C57 /* animations in Resources */ = {isa = PBXBuildFile; fileRef = 37C819601875DF2A00930C57 /* animations */; };\n\t\t37C819861875DF2B00930C57 /* armature in Resources */ = {isa = PBXBuildFile; fileRef = 37C819611875DF2A00930C57 /* armature */; };\n\t\t37C819891875DF2B00930C57 /* armature in Resources */ = {isa = PBXBuildFile; fileRef = 37C819611875DF2A00930C57 /* armature */; };\n\t\t37C8198C1875DF2B00930C57 /* background-music-aac.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C819621875DF2A00930C57 /* background-music-aac.wav */; };\n\t\t37C8198F1875DF2B00930C57 /* background-music-aac.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C819621875DF2A00930C57 /* background-music-aac.wav */; };\n\t\t37C819921875DF2B00930C57 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 37C819631875DF2A00930C57 /* background.mp3 */; };\n\t\t37C819951875DF2B00930C57 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 37C819631875DF2A00930C57 /* background.mp3 */; };\n\t\t37C819981875DF2B00930C57 /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C819641875DF2A00930C57 /* background.ogg */; };\n\t\t37C8199B1875DF2B00930C57 /* background.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C819641875DF2A00930C57 /* background.ogg */; };\n\t\t37C8199E1875DF2B00930C57 /* ccb in Resources */ = {isa = PBXBuildFile; fileRef = 37C819651875DF2A00930C57 /* ccb */; };\n\t\t37C819A11875DF2B00930C57 /* ccb in Resources */ = {isa = PBXBuildFile; fileRef = 37C819651875DF2A00930C57 /* ccb */; };\n\t\t37C819A41875DF2B00930C57 /* CocosBuilderExample.ccbproj in Resources */ = {isa = PBXBuildFile; fileRef = 37C819661875DF2A00930C57 /* CocosBuilderExample.ccbproj */; };\n\t\t37C819A71875DF2B00930C57 /* CocosBuilderExample.ccbproj in Resources */ = {isa = PBXBuildFile; fileRef = 37C819661875DF2A00930C57 /* CocosBuilderExample.ccbproj */; };\n\t\t37C819AA1875DF2B00930C57 /* CocosBuilderExample.ccbresourcelog in Resources */ = {isa = PBXBuildFile; fileRef = 37C819671875DF2A00930C57 /* CocosBuilderExample.ccbresourcelog */; };\n\t\t37C819AD1875DF2B00930C57 /* CocosBuilderExample.ccbresourcelog in Resources */ = {isa = PBXBuildFile; fileRef = 37C819671875DF2A00930C57 /* CocosBuilderExample.ccbresourcelog */; };\n\t\t37C819B01875DF2B00930C57 /* cocosgui in Resources */ = {isa = PBXBuildFile; fileRef = 37C819681875DF2A00930C57 /* cocosgui */; };\n\t\t37C819B31875DF2B00930C57 /* cocosgui in Resources */ = {isa = PBXBuildFile; fileRef = 37C819681875DF2A00930C57 /* cocosgui */; };\n\t\t37C819B61875DF2B00930C57 /* components in Resources */ = {isa = PBXBuildFile; fileRef = 37C819691875DF2A00930C57 /* components */; };\n\t\t37C819B91875DF2B00930C57 /* components in Resources */ = {isa = PBXBuildFile; fileRef = 37C819691875DF2A00930C57 /* components */; };\n\t\t37C819BC1875DF2B00930C57 /* configs in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196A1875DF2A00930C57 /* configs */; };\n\t\t37C819BF1875DF2B00930C57 /* configs in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196A1875DF2A00930C57 /* configs */; };\n\t\t37C819C21875DF2B00930C57 /* effect1.raw in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196B1875DF2A00930C57 /* effect1.raw */; };\n\t\t37C819C51875DF2B00930C57 /* effect1.raw in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196B1875DF2A00930C57 /* effect1.raw */; };\n\t\t37C819C81875DF2B00930C57 /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196C1875DF2A00930C57 /* effect1.wav */; };\n\t\t37C819CB1875DF2B00930C57 /* effect1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196C1875DF2A00930C57 /* effect1.wav */; };\n\t\t37C819CE1875DF2B00930C57 /* effect2.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196D1875DF2A00930C57 /* effect2.ogg */; };\n\t\t37C819D11875DF2B00930C57 /* effect2.ogg in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196D1875DF2A00930C57 /* effect2.ogg */; };\n\t\t37C819D41875DF2B00930C57 /* extensions in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196E1875DF2A00930C57 /* extensions */; };\n\t\t37C819D71875DF2B00930C57 /* extensions in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196E1875DF2A00930C57 /* extensions */; };\n\t\t37C819DA1875DF2B00930C57 /* fileLookup.plist in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196F1875DF2A00930C57 /* fileLookup.plist */; };\n\t\t37C819DD1875DF2B00930C57 /* fileLookup.plist in Resources */ = {isa = PBXBuildFile; fileRef = 37C8196F1875DF2A00930C57 /* fileLookup.plist */; };\n\t\t37C819E01875DF2B00930C57 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 37C819701875DF2A00930C57 /* fonts */; };\n\t\t37C819E31875DF2B00930C57 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 37C819701875DF2A00930C57 /* fonts */; };\n\t\t37C819E61875DF2B00930C57 /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819711875DF2A00930C57 /* fps_images.png */; };\n\t\t37C819E91875DF2B00930C57 /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819711875DF2A00930C57 /* fps_images.png */; };\n\t\t37C819EC1875DF2B00930C57 /* hd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819721875DF2A00930C57 /* hd */; };\n\t\t37C819EF1875DF2B00930C57 /* hd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819721875DF2A00930C57 /* hd */; };\n\t\t37C819F21875DF2B00930C57 /* Hello.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819731875DF2A00930C57 /* Hello.png */; };\n\t\t37C819F51875DF2B00930C57 /* Hello.png in Resources */ = {isa = PBXBuildFile; fileRef = 37C819731875DF2A00930C57 /* Hello.png */; };\n\t\t37C819F81875DF2B00930C57 /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 37C819741875DF2B00930C57 /* Images */; };\n\t\t37C819FB1875DF2B00930C57 /* Images in Resources */ = {isa = PBXBuildFile; fileRef = 37C819741875DF2B00930C57 /* Images */; };\n\t\t37C819FE1875DF2B00930C57 /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 37C819751875DF2B00930C57 /* ipad */; };\n\t\t37C81A011875DF2B00930C57 /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 37C819751875DF2B00930C57 /* ipad */; };\n\t\t37C81A041875DF2B00930C57 /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819761875DF2B00930C57 /* ipadhd */; };\n\t\t37C81A071875DF2B00930C57 /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 37C819761875DF2B00930C57 /* ipadhd */; };\n\t\t37C81A0A1875DF2B00930C57 /* Misc in Resources */ = {isa = PBXBuildFile; fileRef = 37C819771875DF2B00930C57 /* Misc */; };\n\t\t37C81A0D1875DF2B00930C57 /* Misc in Resources */ = {isa = PBXBuildFile; fileRef = 37C819771875DF2B00930C57 /* Misc */; };\n\t\t37C81A101875DF2B00930C57 /* music.mid in Resources */ = {isa = PBXBuildFile; fileRef = 37C819781875DF2B00930C57 /* music.mid */; };\n\t\t37C81A131875DF2B00930C57 /* music.mid in Resources */ = {isa = PBXBuildFile; fileRef = 37C819781875DF2B00930C57 /* music.mid */; };\n\t\t37C81A161875DF2B00930C57 /* Particles in Resources */ = {isa = PBXBuildFile; fileRef = 37C819791875DF2B00930C57 /* Particles */; };\n\t\t37C81A191875DF2B00930C57 /* Particles in Resources */ = {isa = PBXBuildFile; fileRef = 37C819791875DF2B00930C57 /* Particles */; };\n\t\t37C81A1C1875DF2B00930C57 /* pew-pew-lei.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197A1875DF2B00930C57 /* pew-pew-lei.wav */; };\n\t\t37C81A1F1875DF2B00930C57 /* pew-pew-lei.wav in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197A1875DF2B00930C57 /* pew-pew-lei.wav */; };\n\t\t37C81A221875DF2B00930C57 /* scenetest in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197B1875DF2B00930C57 /* scenetest */; };\n\t\t37C81A251875DF2B00930C57 /* scenetest in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197B1875DF2B00930C57 /* scenetest */; };\n\t\t37C81A281875DF2B00930C57 /* Shaders in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197C1875DF2B00930C57 /* Shaders */; };\n\t\t37C81A2B1875DF2B00930C57 /* Shaders in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197C1875DF2B00930C57 /* Shaders */; };\n\t\t37C81A2E1875DF2B00930C57 /* spine in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197D1875DF2B00930C57 /* spine */; };\n\t\t37C81A311875DF2B00930C57 /* spine in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197D1875DF2B00930C57 /* spine */; };\n\t\t37C81A341875DF2B00930C57 /* TileMaps in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197E1875DF2B00930C57 /* TileMaps */; };\n\t\t37C81A371875DF2B00930C57 /* TileMaps in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197E1875DF2B00930C57 /* TileMaps */; };\n\t\t37C81A3A1875DF2B00930C57 /* zwoptex in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197F1875DF2B00930C57 /* zwoptex */; };\n\t\t37C81A3D1875DF2B00930C57 /* zwoptex in Resources */ = {isa = PBXBuildFile; fileRef = 37C8197F1875DF2B00930C57 /* zwoptex */; };\n\t\t460E44BB1807DDC2000CDD6D /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t460E44FD1807E413000CDD6D /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t460E45691807E767000CDD6D /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 460E452E1807E712000CDD6D /* AppController.mm */; };\n\t\t460E456A1807E767000CDD6D /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 460E453B1807E712000CDD6D /* RootViewController.mm */; };\n\t\t460E45861807FDC3000CDD6D /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */; };\n\t\t460E45871807FDC3000CDD6D /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */; };\n\t\t460E45B9180801A4000CDD6D /* background-music-aac.wav in Resources */ = {isa = PBXBuildFile; fileRef = 460E45A1180801A4000CDD6D /* background-music-aac.wav */; };\n\t\t460E45BA180801A4000CDD6D /* background-music-aac.wav in Resources */ = {isa = PBXBuildFile; fileRef = 460E45A1180801A4000CDD6D /* background-music-aac.wav */; };\n\t\t460E45BD180801A4000CDD6D /* Marker Felt.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 460E45A4180801A4000CDD6D /* Marker Felt.ttf */; };\n\t\t460E45BE180801A4000CDD6D /* Marker Felt.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 460E45A4180801A4000CDD6D /* Marker Felt.ttf */; };\n\t\t460E45C9180801A4000CDD6D /* pew-pew-lei.wav in Resources */ = {isa = PBXBuildFile; fileRef = 460E45AB180801A4000CDD6D /* pew-pew-lei.wav */; };\n\t\t460E45CA180801A4000CDD6D /* pew-pew-lei.wav in Resources */ = {isa = PBXBuildFile; fileRef = 460E45AB180801A4000CDD6D /* pew-pew-lei.wav */; };\n\t\t460E45D8180801C1000CDD6D /* hd in Resources */ = {isa = PBXBuildFile; fileRef = 460E45D7180801C1000CDD6D /* hd */; };\n\t\t460E45D9180801C1000CDD6D /* hd in Resources */ = {isa = PBXBuildFile; fileRef = 460E45D7180801C1000CDD6D /* hd */; };\n\t\t460E45DB180801C9000CDD6D /* sd in Resources */ = {isa = PBXBuildFile; fileRef = 460E45DA180801C9000CDD6D /* sd */; };\n\t\t460E45DC180801C9000CDD6D /* sd in Resources */ = {isa = PBXBuildFile; fileRef = 460E45DA180801C9000CDD6D /* sd */; };\n\t\t460E45DF18080238000CDD6D /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */; };\n\t\t460E45E018080238000CDD6D /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */; };\n\t\t4662EB5F188E426300B02E8F /* ReleasePoolTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4662EB5D188E426300B02E8F /* ReleasePoolTest.cpp */; };\n\t\t4662EB60188E426300B02E8F /* ReleasePoolTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4662EB5D188E426300B02E8F /* ReleasePoolTest.cpp */; };\n\t\t468588DA180805F100AC387D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 460E45391807E712000CDD6D /* main.m */; };\n\t\t46A174E71807D95B005B8026 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A174851807D934005B8026 /* AppDelegate.cpp */; };\n\t\t46A174E81807D96A005B8026 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A174881807D934005B8026 /* HelloWorldScene.cpp */; };\n\t\t46A174E91807D976005B8026 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A174851807D934005B8026 /* AppDelegate.cpp */; };\n\t\t46A174EA1807D976005B8026 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A174881807D934005B8026 /* HelloWorldScene.cpp */; };\n\t\t46A174F41807D9C4005B8026 /* bang.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174EC1807D9C4005B8026 /* bang.png */; };\n\t\t46A174F51807D9C4005B8026 /* bang.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174EC1807D9C4005B8026 /* bang.png */; };\n\t\t46A174F81807D9C4005B8026 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 46A174EE1807D9C4005B8026 /* fonts */; };\n\t\t46A174F91807D9C4005B8026 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 46A174EE1807D9C4005B8026 /* fonts */; };\n\t\t46A174FA1807D9C4005B8026 /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 46A174EF1807D9C4005B8026 /* ipad */; };\n\t\t46A174FB1807D9C4005B8026 /* ipad in Resources */ = {isa = PBXBuildFile; fileRef = 46A174EF1807D9C4005B8026 /* ipad */; };\n\t\t46A174FC1807D9C4005B8026 /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 46A174F01807D9C4005B8026 /* ipadhd */; };\n\t\t46A174FD1807D9C4005B8026 /* ipadhd in Resources */ = {isa = PBXBuildFile; fileRef = 46A174F01807D9C4005B8026 /* ipadhd */; };\n\t\t46A174FE1807D9C4005B8026 /* iphone in Resources */ = {isa = PBXBuildFile; fileRef = 46A174F11807D9C4005B8026 /* iphone */; };\n\t\t46A174FF1807D9C4005B8026 /* iphone in Resources */ = {isa = PBXBuildFile; fileRef = 46A174F11807D9C4005B8026 /* iphone */; };\n\t\t46A175001807D9CB005B8026 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A174CD1807D934005B8026 /* main.cpp */; };\n\t\t46A175011807D9E2005B8026 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A174AC1807D934005B8026 /* AppController.mm */; };\n\t\t46A175021807D9E2005B8026 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A174BD1807D934005B8026 /* main.m */; };\n\t\t46A175031807D9E2005B8026 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A174BF1807D934005B8026 /* RootViewController.mm */; };\n\t\t5010FC91180F0F8300B8E2AE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 46A174AD1807D934005B8026 /* Default-568h@2x.png */; };\n\t\t5010FC92180F105C00B8E2AE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 460E452F1807E712000CDD6D /* Default-568h@2x.png */; };\n\t\t50691336184EB453009BBDD7 /* ConsoleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50691334184EB453009BBDD7 /* ConsoleTest.cpp */; };\n\t\t50691337184EB453009BBDD7 /* ConsoleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50691334184EB453009BBDD7 /* ConsoleTest.cpp */; };\n\t\t50D360FA186819DB00828878 /* CocosGUIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360CA186819DB00828878 /* CocosGUIScene.cpp */; };\n\t\t50D360FB186819DB00828878 /* UIButtonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360CD186819DB00828878 /* UIButtonTest.cpp */; };\n\t\t50D360FC186819DB00828878 /* UICheckBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D0186819DB00828878 /* UICheckBoxTest.cpp */; };\n\t\t50D360FD186819DB00828878 /* UIImageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D3186819DB00828878 /* UIImageViewTest.cpp */; };\n\t\t50D360FE186819DB00828878 /* UILabelAtlasTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D6186819DB00828878 /* UILabelAtlasTest.cpp */; };\n\t\t50D360FF186819DB00828878 /* UILabelBMFontTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360D9186819DB00828878 /* UILabelBMFontTest.cpp */; };\n\t\t50D36100186819DB00828878 /* UILabelTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360DC186819DB00828878 /* UILabelTest.cpp */; };\n\t\t50D36101186819DB00828878 /* UILayoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360DF186819DB00828878 /* UILayoutTest.cpp */; };\n\t\t50D36102186819DB00828878 /* UIListViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360E2186819DB00828878 /* UIListViewTest.cpp */; };\n\t\t50D36103186819DB00828878 /* UILoadingBarTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360E5186819DB00828878 /* UILoadingBarTest.cpp */; };\n\t\t50D36104186819DB00828878 /* UIPageViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360E8186819DB00828878 /* UIPageViewTest.cpp */; };\n\t\t50D36105186819DB00828878 /* UIScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360EA186819DB00828878 /* UIScene.cpp */; };\n\t\t50D36106186819DB00828878 /* UISceneManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360EC186819DB00828878 /* UISceneManager.cpp */; };\n\t\t50D36107186819DB00828878 /* UIScrollViewTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360EF186819DB00828878 /* UIScrollViewTest.cpp */; };\n\t\t50D36108186819DB00828878 /* UISliderTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360F2186819DB00828878 /* UISliderTest.cpp */; };\n\t\t50D36109186819DB00828878 /* UITextFieldTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360F5186819DB00828878 /* UITextFieldTest.cpp */; };\n\t\t50D3610A186819DB00828878 /* UIWidgetAddNodeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 50D360F8186819DB00828878 /* UIWidgetAddNodeTest.cpp */; };\n\t\t599121E6182C74AC00CE785B /* NewRendererTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 599121E4182C74AC00CE785B /* NewRendererTest.cpp */; };\n\t\t599121E7182C74AC00CE785B /* NewRendererTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 599121E4182C74AC00CE785B /* NewRendererTest.cpp */; };\n\t\t59A79D5D1821E95C00F19697 /* MouseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A79D5B1821E95C00F19697 /* MouseTest.cpp */; };\n\t\t59A79D5E1821E95C00F19697 /* MouseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59A79D5B1821E95C00F19697 /* MouseTest.cpp */; };\n\t\tA01E16881784BDA100B0CA4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA01E16891784BDA100B0CA4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA01E168A1784BDA100B0CA4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA01E168D1784BDA100B0CA4A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA01E169B1784BE2400B0CA4A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tA01E169C1784BE2800B0CA4A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA01E169D1784BE2C00B0CA4A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA01E169E1784BE3200B0CA4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA01E169F1784BE3A00B0CA4A /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA01E17661784C06E00B0CA4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA01E17671784C06E00B0CA4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA01E17681784C06E00B0CA4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA01E17691784C06E00B0CA4A /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA01E176A1784C06E00B0CA4A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA01E176B1784C06E00B0CA4A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA01E176C1784C06E00B0CA4A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA01E176D1784C06E00B0CA4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA01E176E1784C06E00B0CA4A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tA01E184B1784C45400B0CA4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA01E184C1784C45400B0CA4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA01E184D1784C45400B0CA4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA01E184E1784C45400B0CA4A /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA01E184F1784C45400B0CA4A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA01E18501784C45400B0CA4A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA01E18511784C45400B0CA4A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA01E18521784C45400B0CA4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA01E18531784C45400B0CA4A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tA01E18801784C4D600B0CA4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA01E18811784C4D600B0CA4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA01E18821784C4D600B0CA4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA01E18831784C4D600B0CA4A /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA01E18841784C4D600B0CA4A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA01E18851784C4D600B0CA4A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA01E18861784C4D600B0CA4A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA01E18871784C4D600B0CA4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA01E18881784C4D600B0CA4A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tA01E18B51784C4DC00B0CA4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA01E18B61784C4DC00B0CA4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA01E18B71784C4DC00B0CA4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA01E18B81784C4DC00B0CA4A /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA01E18B91784C4DC00B0CA4A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA01E18BA1784C4DC00B0CA4A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA01E18BB1784C4DC00B0CA4A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA01E18BC1784C4DC00B0CA4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA01E18BD1784C4DC00B0CA4A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tA01E18EA1784C4E000B0CA4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA01E18EB1784C4E000B0CA4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA01E18EC1784C4E000B0CA4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA01E18ED1784C4E000B0CA4A /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA01E18EE1784C4E000B0CA4A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA01E18EF1784C4E000B0CA4A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA01E18F01784C4E000B0CA4A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA01E18F11784C4E000B0CA4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA01E18F21784C4E000B0CA4A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tA01E18F81784C59400B0CA4A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA01E18F91784C59400B0CA4A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA01E18FA1784C59400B0CA4A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA01E18FB1784C59500B0CA4A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA01E18FC1784C59500B0CA4A /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA035A5E01782290400987F6C /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\tA035A5E11782290400987F6C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA035A5E21782290400987F6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA035A5E31782290400987F6C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA035A5E41782290400987F6C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\tA035A5E51782290400987F6C /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA035A5E61782290400987F6C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA035A5E71782290400987F6C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\tA035A5E81782290400987F6C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA035A71217822E9E00987F6C /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA035A7701782301C00987F6C /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA035A7711782301C00987F6C /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\tA035A7721782301C00987F6C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA035A7731782301C00987F6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA035A7741782301C00987F6C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA035A7751782301C00987F6C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\tA035A7761782301C00987F6C /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA035A7771782301C00987F6C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA035A7781782301C00987F6C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\tA035A7791782301C00987F6C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA035A9EA17823FE100987F6C /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA035A9EB17823FE100987F6C /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\tA035A9EC17823FE100987F6C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA035A9ED17823FE100987F6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA035A9EE17823FE100987F6C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA035A9EF17823FE100987F6C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\tA035A9F017823FE100987F6C /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA035A9F117823FE100987F6C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA035A9F217823FE100987F6C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\tA035A9F317823FE100987F6C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA035AAB81782422400987F6C /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA035AAB91782422400987F6C /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\tA035AABA1782422400987F6C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA035AABB1782422400987F6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA035AABC1782422400987F6C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA035AABD1782422400987F6C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\tA035AABE1782422400987F6C /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA035AABF1782422400987F6C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA035AAC01782422400987F6C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\tA035AAC11782422400987F6C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA035AC2A1782453000987F6C /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A035A71117822E9E00987F6C /* libsqlite3.dylib */; };\n\t\tA035AC2B1782453000987F6C /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\tA035AC2C1782453000987F6C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA035AC2D1782453000987F6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA035AC2E1782453000987F6C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA035AC2F1782453000987F6C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\tA035AC301782453000987F6C /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA035AC311782453000987F6C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA035AC321782453000987F6C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\tA035AC331782453000987F6C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA035AD6A178254A300987F6C /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\tA035AD6B178254A300987F6C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA035AD6C178254A300987F6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA035AD6D178254A300987F6C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA035AD6E178254A300987F6C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\tA035AD6F178254A300987F6C /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA035AD70178254A300987F6C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA035AD71178254A300987F6C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\tA035AD72178254A300987F6C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA035AE7C178255DC00987F6C /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A9F808C177E98A600D9A1CB /* libcurl.dylib */; };\n\t\tA035AE7D178255DC00987F6C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA035AE7E178255DC00987F6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA035AE7F178255DC00987F6C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA035AE80178255DC00987F6C /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482A165F3979007D4F18 /* ApplicationServices.framework */; };\n\t\tA035AE81178255DC00987F6C /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA035AE82178255DC00987F6C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA035AE83178255DC00987F6C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64824165F3934007D4F18 /* OpenGL.framework */; };\n\t\tA035AE84178255DC00987F6C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA05FCACA177C124500BE600E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64822165F391E007D4F18 /* Cocoa.framework */; };\n\t\tA07A521E1783A1D20073F6A7 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA07A521F1783A1D20073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA07A52201783A1D20073F6A7 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA07A52221783A1D20073F6A7 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA07A52231783A1D20073F6A7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA07A52BE1783AF1E0073F6A7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA07A52BF1783AF210073F6A7 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA07A52C01783AF250073F6A7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA07A52C31783B02C0073F6A7 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tA07A53751784AC9B0073F6A7 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482E165F399D007D4F18 /* libz.dylib */; };\n\t\tA07A53761784AC9B0073F6A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64832165F3AFD007D4F18 /* Foundation.framework */; };\n\t\tA07A53771784AC9B0073F6A7 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C6482C165F3988007D4F18 /* AudioToolbox.framework */; };\n\t\tA07A53781784AC9B0073F6A7 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64828165F396B007D4F18 /* OpenAL.framework */; };\n\t\tA07A53791784AC9B0073F6A7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15C64826165F394E007D4F18 /* QuartzCore.framework */; };\n\t\tA07A537A1784AC9B0073F6A7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */; };\n\t\tA07A537B1784AC9B0073F6A7 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B91783AE900073F6A7 /* OpenGLES.framework */; };\n\t\tA07A537C1784AC9B0073F6A7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52B71783AE6D0073F6A7 /* UIKit.framework */; };\n\t\tA07A537D1784AC9B0073F6A7 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A07A52C11783B01F0073F6A7 /* AVFoundation.framework */; };\n\t\tD60AE43417F7FFE100757E4B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD60AE43717F9142200757E4B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD60AE43817F9143D00757E4B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD6408CA8180650F200FB5B4C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD6408CAB1806510600FB5B4C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD6408CAC1806511F00FB5B4C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD6408CAD1806512D00FB5B4C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD6408CAE1806513A00FB5B4C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD6408CAF1806514400FB5B4C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tD6408CB01806515200FB5B4C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };\n\t\tED3674B9187FA7020038ECFC /* PerformanceRendererTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED3674B8187FA7020038ECFC /* PerformanceRendererTest.cpp */; };\n\t\tED3674BA187FA7020038ECFC /* PerformanceRendererTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED3674B8187FA7020038ECFC /* PerformanceRendererTest.cpp */; };\n\t\tED743D1517D098AF0004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1617D098B60004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1717D099F10004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1917D09A390004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1A17D09A730004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1B17D09AAE0004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1C17D09C990004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1D17D09CD40004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tED743D1E17D09D070004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n\t\tEDCC747F17C455FD007B692C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t1A3B1DE8180E7C9C00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1A3B1DEA180E7C9C00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1A3B1DEC180E7C9C00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1A3B1DEE180E7C9C00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1A3B1DF0180E7C9C00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F31E81781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\t1A3B1E0A180E7E1D00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1A3B1E0C180E7E1D00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1A3B1E0E180E7E1D00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1A3B1E10180E7E1D00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t1A3B1E12180E7E1D00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4FB5178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\t1A3B1E6F180E7F3E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1A3B1E71180E7F3E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1A3B1E73180E7F3E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1A3B1E75180E7F3E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1A3B1E77180E7F3E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F31E81781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\t1A3B1E85180E804400497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1A3B1E87180E804400497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1A3B1E89180E804400497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1A3B1E8B180E804400497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t1A3B1E8D180E804400497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4FB5178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\t1A3B1ED2180E810E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1A3B1ED4180E810E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1A3B1ED6180E810E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1A3B1ED8180E810E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1A3B1EDA180E810E00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F31E81781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\t1A3B1EE1180E81AA00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1A3B1EE3180E81AA00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1A3B1EE5180E81AA00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1A3B1EE7180E81AA00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t1A3B1EE9180E81AA00497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4FB5178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\t1A3B1F2A180E82B800497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1A3B1F2C180E82B800497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1A3B1F2E180E82B800497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1A3B1F30180E82B800497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1A3B1F32180E82B800497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F31E81781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\t1A3B1F39180E82D200497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1A3B1F3B180E82D200497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1A3B1F3D180E82D200497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1A3B1F3F180E82D200497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t1A3B1F41180E82D200497A22 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4FB5178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\t1A6FB50017854AEA00CDF010 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A1197B31785363400D62A44;\n\t\t\tremoteInfo = \"Hello lua iOS\";\n\t\t};\n\t\t1A6FB50217854AEA00CDF010 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A11982D178538E400D62A44;\n\t\t\tremoteInfo = \"Test lua iOS\";\n\t\t};\n\t\t1A6FB7E21785682700CDF010 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A6FB53517854FE400CDF010;\n\t\t\tremoteInfo = \"Hello lua Mac\";\n\t\t};\n\t\t1A6FB7E41785682700CDF010 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A6FB7821785614200CDF010;\n\t\t\tremoteInfo = \"Test lua Mac\";\n\t\t};\n\t\t1A8C55BA180E8BA400EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1A8C55BC180E8BA400EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1A8C55BE180E8BA400EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1A8C55C0180E8BA400EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1A8C55C2180E8BA400EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A6FB50417854BC200CDF010;\n\t\t\tremoteInfo = \"luabindings Mac\";\n\t\t};\n\t\t1A8C565C180E8DFB00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1A8C565E180E8DFB00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1A8C5660180E8DFB00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1A8C5662180E8DFB00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t1A8C5664180E8DFB00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A119716178526AA00D62A44;\n\t\t\tremoteInfo = \"luabindings iOS\";\n\t\t};\n\t\t1A8C5880180E8F5F00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1A8C5882180E8F5F00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1A8C5884180E8F5F00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1A8C5886180E8F5F00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1A8C5888180E8F5F00EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A6FB50417854BC200CDF010;\n\t\t\tremoteInfo = \"luabindings Mac\";\n\t\t};\n\t\t1A8C588F180E8F8000EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1A8C5891180E8F8000EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1A8C5893180E8F8000EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1A8C5895180E8F8000EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t1A8C5897180E8F8000EF57C3 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1A119716178526AA00D62A44;\n\t\t\tremoteInfo = \"luabindings iOS\";\n\t\t};\n\t\t1A9DC9E7180E68CE007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1A9DC9E9180E68CE007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1A9DC9EB180E68CE007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1A9DC9ED180E68CE007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1A9DC9EF180E68CE007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F31E81781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\t1A9DCA56180E743F007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1A9DCA58180E743F007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1A9DCA5A180E743F007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1A9DCA5C180E743F007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t1A9DCA5E180E743F007A3AD4 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4FB5178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\t1AAF5341180E2F41000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t1AAF5343180E2F41000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2FC117814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t1AAF5345180E2F41000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2B781780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t1AAF5347180E2F41000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2D5D1780BDF7006731B9;\n\t\t\tremoteInfo = \"box2d Mac\";\n\t\t};\n\t\t1AAF5349180E2F41000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t1AAF53F4180E39C6000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t1AAF53F6180E39C6000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4E111783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t1AAF53F8180E39C6000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4EFD178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t1AAF53FA180E39C6000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F3C1783876B0073F6A7;\n\t\t\tremoteInfo = \"box2d iOS\";\n\t\t};\n\t\t1AAF53FC180E39C6000584C8 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t460E44B91807DCCC000CDD6D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t460E44FB1807E408000CDD6D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t460E44FE1807E656000CDD6D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4C241783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t460E45821807FDB0000CDD6D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1551A33E158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t460E45841807FDB0000CDD6D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A03F2E9817814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t460E45DD18080218000CDD6D /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A4F9F178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t46A15FAF1807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1551A33F158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t46A15FB11807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2FD617814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t46A15FB31807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2CB81780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t46A15FB51807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2D9B1780BDF7006731B9;\n\t\t\tremoteInfo = \"box2d Mac\";\n\t\t};\n\t\t46A15FB71807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2ED617814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t46A15FB91807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F31FD1781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\t46A15FBB1807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1A6FB53017854BC300CDF010;\n\t\t\tremoteInfo = \"luabindings Mac\";\n\t\t};\n\t\t46A15FBD1807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4D641783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t46A15FBF1807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4EFC1783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t46A15FC11807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4F3B178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t46A15FC31807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4F9E1783876B0073F6A7;\n\t\t\tremoteInfo = \"box2d iOS\";\n\t\t};\n\t\t46A15FC51807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4FB4178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t46A15FC71807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A5030178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\t46A15FC91807A4F9005B8026 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1A119791178526AA00D62A44;\n\t\t\tremoteInfo = \"luabindings iOS\";\n\t\t};\n\t\tA01E17E11784C3EB00B0CA4A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A52CF1784AC9B0073F6A7;\n\t\t\tremoteInfo = \"Hello cpp iOS\";\n\t\t};\n\t\tA01E17E31784C3EB00B0CA4A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A01E16631784BDA100B0CA4A;\n\t\t\tremoteInfo = \"Simple Game iOS\";\n\t\t};\n\t\tA01E17E51784C3EB00B0CA4A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A01E16C01784C06E00B0CA4A;\n\t\t\tremoteInfo = \"Test JavaScript iOS\";\n\t\t};\n\t\tA01E19961784C8DD00B0CA4A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A01E17E71784C45400B0CA4A;\n\t\t\tremoteInfo = \"JS Watermelon With Me iOS\";\n\t\t};\n\t\tA01E19981784C8DD00B0CA4A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A01E18591784C4D600B0CA4A;\n\t\t\tremoteInfo = \"JS Moon Warriors iOS\";\n\t\t};\n\t\tA01E199A1784C8DD00B0CA4A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A01E188E1784C4DC00B0CA4A;\n\t\t\tremoteInfo = \"JS Crystal Craze iOS\";\n\t\t};\n\t\tA01E199C1784C8DD00B0CA4A /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A01E18C31784C4E000B0CA4A;\n\t\t\tremoteInfo = \"JS CocosDragon iOS\";\n\t\t};\n\t\tA035ACBF178246BD00987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1D6058900D05DD3D006BFB54;\n\t\t\tremoteInfo = \"Test cpp\";\n\t\t};\n\t\tA035ACC1178246BD00987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A035A5441782290400987F6C;\n\t\t\tremoteInfo = \"Test JavaScript\";\n\t\t};\n\t\tA035ACC3178246BD00987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A035A7131782301C00987F6C;\n\t\t\tremoteInfo = \"JS Watermelon With Me\";\n\t\t};\n\t\tA035ACC5178246BD00987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A035A9BA17823FE100987F6C;\n\t\t\tremoteInfo = \"JS Moon Warriors\";\n\t\t};\n\t\tA035ACC7178246BD00987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A035AA8D1782422400987F6C;\n\t\t\tremoteInfo = \"JS Crystal Craze\";\n\t\t};\n\t\tA035ACC9178246BD00987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A035AC021782453000987F6C;\n\t\t\tremoteInfo = \"JS CocosDragon\";\n\t\t};\n\t\tA035AF721782569500987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A035AE58178255DC00987F6C;\n\t\t\tremoteInfo = \"Hello cpp\";\n\t\t};\n\t\tA035AF741782569500987F6C /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A035ACCE178254A300987F6C;\n\t\t\tremoteInfo = \"Simple Game\";\n\t\t};\n\t\tA07A526C1783AB980073F6A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = A07A517F1783A1D20073F6A7;\n\t\t\tremoteInfo = \"Test cpp iOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t15394DF2182E8F5D000A418D /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = ../cocos/scripting/lua/script/StudioConstants.lua; sourceTree = \"<group>\"; };\n\t\t1585AAC61821F8D900000FB5 /* LuaObjectCBridgeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaObjectCBridgeTest.h; sourceTree = \"<group>\"; };\n\t\t1585AAC71821F8D900000FB5 /* LuaObjectCBridgeTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LuaObjectCBridgeTest.mm; sourceTree = \"<group>\"; };\n\t\t1585AB101821FA1A00000FB5 /* luaoc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaoc.lua; path = ../cocos/scripting/lua/script/luaoc.lua; sourceTree = \"<group>\"; };\n\t\t1585AB161821FF4C00000FB5 /* LuaObjectCBridgeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaObjectCBridgeTest.h; sourceTree = \"<group>\"; };\n\t\t1585AB171821FF4C00000FB5 /* LuaObjectCBridgeTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LuaObjectCBridgeTest.mm; sourceTree = \"<group>\"; };\n\t\t1585AB34182299FA00000FB5 /* json.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = json.lua; path = ../cocos/scripting/lua/script/json.lua; sourceTree = \"<group>\"; };\n\t\t1585AB491823A55400000FB5 /* lua_assetsmanager_test_sample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_assetsmanager_test_sample.cpp; sourceTree = \"<group>\"; };\n\t\t1585AB4A1823A55400000FB5 /* lua_assetsmanager_test_sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_assetsmanager_test_sample.h; sourceTree = \"<group>\"; };\n\t\t15982CE1187656CD00625972 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = ../cocos/scripting/lua/script/GuiConstants.lua; sourceTree = \"<group>\"; };\n\t\t15A71DB61894AE6200F30AC0 /* mobdebug.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mobdebug.lua; sourceTree = \"<group>\"; };\n\t\t15C64822165F391E007D4F18 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; };\n\t\t15C64824165F3934007D4F18 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; };\n\t\t15C64826165F394E007D4F18 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };\n\t\t15C64828165F396B007D4F18 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenAL.framework; sourceTree = DEVELOPER_DIR; };\n\t\t15C6482A165F3979007D4F18 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework; sourceTree = DEVELOPER_DIR; };\n\t\t15C6482C165F3988007D4F18 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; };\n\t\t15C6482E165F399D007D4F18 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libz.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; };\n\t\t15C64832165F3AFD007D4F18 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };\n\t\t15F4C82818751B590082884F /* extern.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = extern.lua; path = ../cocos/scripting/lua/script/extern.lua; sourceTree = \"<group>\"; };\n\t\t15F4C846187551340082884F /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = ../cocos/scripting/lua/script/CocoStudio.lua; sourceTree = \"<group>\"; };\n\t\t1A0800BC18780B2A00E62F93 /* cocosbuilderRes */ = {isa = PBXFileReference; lastKnownFileType = folder; path = cocosbuilderRes; sourceTree = \"<group>\"; };\n\t\t1A0800BD18780B2A00E62F93 /* luaScript */ = {isa = PBXFileReference; lastKnownFileType = folder; path = luaScript; sourceTree = \"<group>\"; };\n\t\t1A087AEC1860418300196EF5 /* PerformanceLabelTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceLabelTest.cpp; sourceTree = \"<group>\"; };\n\t\t1A087AED1860418300196EF5 /* PerformanceLabelTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceLabelTest.h; sourceTree = \"<group>\"; };\n\t\t1A1197D71785363400D62A44 /* Hello lua iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Hello lua iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1A119870178538E400D62A44 /* Test lua iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Test lua iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1A2F51AF1877DA5900B48BFE /* tests */ = {isa = PBXFileReference; lastKnownFileType = folder; name = tests; path = ../samples/Javascript/Shared/tests; sourceTree = \"<group>\"; };\n\t\t1A3B1DB1180E7C4700497A22 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1DB2180E7C4700497A22 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A3B1DB6180E7C5100497A22 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1DB7180E7C5100497A22 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1DB8180E7C5100497A22 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DB9180E7C5100497A22 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1A3B1DBA180E7C5100497A22 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DBB180E7C5100497A22 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DBC180E7C5100497A22 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DBD180E7C5100497A22 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DBE180E7C5100497A22 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DBF180E7C5100497A22 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DC0180E7C5100497A22 /* Icon-Small-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-Small-50.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DC1180E7C5100497A22 /* Icon-Small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-Small.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DC2180E7C5100497A22 /* Icon-Small@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-Small@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DC3180E7C5100497A22 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = \"<group>\"; };\n\t\t1A3B1DC4180E7C5100497A22 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DC5180E7C5100497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1DC6180E7C5100497A22 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1A3B1DC7180E7C5100497A22 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A3B1DC8180E7C5100497A22 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1DC9180E7C5100497A22 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1DDD180E7C5C00497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A3B1DDF180E7C5C00497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A3B1DE0180E7C5C00497A22 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A3B1DE1180E7C5C00497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1DE2180E7C5C00497A22 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1DF8180E7D2200497A22 /* MoonWarriors-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = \"MoonWarriors-jsb.js\"; path = \"../samples/Javascript/Shared/games/MoonWarriors/MoonWarriors-jsb.js\"; sourceTree = \"<group>\"; };\n\t\t1A3B1DF9180E7D2200497A22 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../samples/Javascript/Shared/games/MoonWarriors/res; sourceTree = \"<group>\"; };\n\t\t1A3B1DFA180E7D2200497A22 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../samples/Javascript/Shared/games/MoonWarriors/src; sourceTree = \"<group>\"; };\n\t\t1A3B1E1C180E7EFA00497A22 /* boot-html5.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = \"boot-html5.js\"; path = \"../samples/Javascript/Shared/games/WatermelonWithMe/boot-html5.js\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E1D180E7EFA00497A22 /* boot-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = \"boot-jsb.js\"; path = \"../samples/Javascript/Shared/games/WatermelonWithMe/boot-jsb.js\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E1E180E7EFA00497A22 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = index.html; path = ../samples/Javascript/Shared/games/WatermelonWithMe/index.html; sourceTree = \"<group>\"; };\n\t\t1A3B1E1F180E7EFA00497A22 /* levels.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = levels.js; path = ../samples/Javascript/Shared/games/WatermelonWithMe/levels.js; sourceTree = \"<group>\"; };\n\t\t1A3B1E20180E7EFA00497A22 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../samples/Javascript/Shared/games/WatermelonWithMe/main.js; sourceTree = \"<group>\"; };\n\t\t1A3B1E21180E7EFA00497A22 /* Platform */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Platform; path = ../samples/Javascript/Shared/games/WatermelonWithMe/Platform; sourceTree = \"<group>\"; };\n\t\t1A3B1E22180E7EFA00497A22 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; name = res; path = ../samples/Javascript/Shared/games/WatermelonWithMe/res; sourceTree = \"<group>\"; };\n\t\t1A3B1E23180E7EFA00497A22 /* resources-html5.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = \"resources-html5.js\"; path = \"../samples/Javascript/Shared/games/WatermelonWithMe/resources-html5.js\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E24180E7EFA00497A22 /* resources-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = \"resources-jsb.js\"; path = \"../samples/Javascript/Shared/games/WatermelonWithMe/resources-jsb.js\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E25180E7EFA00497A22 /* watermelon_with_me.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = watermelon_with_me.js; path = ../samples/Javascript/Shared/games/WatermelonWithMe/watermelon_with_me.js; sourceTree = \"<group>\"; };\n\t\t1A3B1E3E180E7F1500497A22 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1E3F180E7F1500497A22 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A3B1E43180E7F1E00497A22 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1E44180E7F1E00497A22 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1E45180E7F1E00497A22 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E46180E7F1E00497A22 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1A3B1E47180E7F1E00497A22 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E48180E7F1E00497A22 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E49180E7F1E00497A22 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E4A180E7F1E00497A22 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E4B180E7F1E00497A22 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E4C180E7F1E00497A22 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E4D180E7F1E00497A22 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E4E180E7F1E00497A22 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1E4F180E7F1E00497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1E50180E7F1E00497A22 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1A3B1E51180E7F1E00497A22 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A3B1E52180E7F1E00497A22 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1E53180E7F1E00497A22 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1E64180E7F2400497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A3B1E66180E7F2400497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A3B1E67180E7F2400497A22 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A3B1E68180E7F2400497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1E69180E7F2400497A22 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1E9D180E80B600497A22 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1E9E180E80B600497A22 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A3B1EA2180E80BD00497A22 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1EA3180E80BD00497A22 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1EA4180E80BD00497A22 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EA5180E80BD00497A22 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1A3B1EA6180E80BD00497A22 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EA7180E80BD00497A22 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EA8180E80BD00497A22 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EA9180E80BD00497A22 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EAA180E80BD00497A22 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EAB180E80BD00497A22 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EAC180E80BD00497A22 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EAD180E80BD00497A22 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EAE180E80BD00497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1EAF180E80BD00497A22 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1A3B1EB0180E80BD00497A22 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A3B1EB1180E80BD00497A22 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1EB2180E80BD00497A22 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1EC3180E80C700497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A3B1EC5180E80C700497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A3B1EC6180E80C700497A22 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A3B1EC7180E80C700497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1EC8180E80C700497A22 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1ECF180E80E200497A22 /* Published files iOS */ = {isa = PBXFileReference; lastKnownFileType = folder; name = \"Published files iOS\"; path = \"../samples/Javascript/Shared/games/CocosDragonJS/Published files iOS\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EF2180E826E00497A22 /* Published-iOS */ = {isa = PBXFileReference; lastKnownFileType = folder; name = \"Published-iOS\"; path = \"../samples/Javascript/Shared/games/CrystalCraze/Published-iOS\"; sourceTree = \"<group>\"; };\n\t\t1A3B1EF9180E828300497A22 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A3B1EFA180E828300497A22 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A3B1EFE180E828E00497A22 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1EFF180E828E00497A22 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1F00180E828E00497A22 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F01180E828E00497A22 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1A3B1F02180E828E00497A22 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F03180E828E00497A22 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F04180E828E00497A22 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F05180E828E00497A22 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F06180E828E00497A22 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F07180E828E00497A22 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F08180E828E00497A22 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F09180E828E00497A22 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1A3B1F0A180E828E00497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1F0B180E828E00497A22 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1A3B1F0C180E828E00497A22 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A3B1F0D180E828E00497A22 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1A3B1F0E180E828E00497A22 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1A3B1F1F180E829600497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A3B1F21180E829600497A22 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A3B1F22180E829600497A22 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A3B1F23180E829600497A22 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A3B1F24180E829600497A22 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1A6A41DF180BE41100565AC2 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A6A41E0180BE41100565AC2 /* AppDelegate.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A6A41E1180BE41100565AC2 /* GameOverScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameOverScene.cpp; sourceTree = \"<group>\"; };\n\t\t1A6A41E2180BE41100565AC2 /* GameOverScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameOverScene.h; sourceTree = \"<group>\"; };\n\t\t1A6A41E3180BE41100565AC2 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HelloWorldScene.cpp; sourceTree = \"<group>\"; };\n\t\t1A6A41E4180BE41100565AC2 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloWorldScene.h; sourceTree = \"<group>\"; };\n\t\t1A6FB56B17854FE400CDF010 /* Hello lua Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Hello lua Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1A6FB7B31785614200CDF010 /* Test lua Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Test lua Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1A80519518768FD300C117B5 /* UnitTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnitTest.cpp; path = UnitTest/UnitTest.cpp; sourceTree = \"<group>\"; };\n\t\t1A80519618768FD300C117B5 /* UnitTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnitTest.h; path = UnitTest/UnitTest.h; sourceTree = \"<group>\"; };\n\t\t1A8C5530180E8B1C00EF57C3 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5531180E8B1C00EF57C3 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A8C5539180E8B3D00EF57C3 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t1A8C553A180E8B3D00EF57C3 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t1A8C553B180E8B3D00EF57C3 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C553C180E8B3D00EF57C3 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1A8C553D180E8B3D00EF57C3 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C553E180E8B3D00EF57C3 /* HelloLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloLua_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A8C553F180E8B3D00EF57C3 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5540180E8B3D00EF57C3 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5541180E8B3D00EF57C3 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5542180E8B3D00EF57C3 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5543180E8B3D00EF57C3 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5544180E8B3D00EF57C3 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5545180E8B3D00EF57C3 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5546180E8B3D00EF57C3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A8C5547180E8B3D00EF57C3 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1A8C5548180E8B3D00EF57C3 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1A8C5549180E8B3D00EF57C3 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1A8C555A180E8B4500EF57C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A8C555C180E8B4500EF57C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A8C555D180E8B4500EF57C3 /* HelloLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloLua_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A8C555E180E8B4500EF57C3 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A8C555F180E8B4500EF57C3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A8C5560180E8B4500EF57C3 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C5567180E8B5100EF57C3 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = \"<group>\"; };\n\t\t1A8C5569180E8B5100EF57C3 /* background.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = background.mp3; sourceTree = \"<group>\"; };\n\t\t1A8C556A180E8B5100EF57C3 /* background.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; path = background.ogg; sourceTree = \"<group>\"; };\n\t\t1A8C556B180E8B5100EF57C3 /* crop.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = crop.png; sourceTree = \"<group>\"; };\n\t\t1A8C556D180E8B5100EF57C3 /* dog.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dog.png; sourceTree = \"<group>\"; };\n\t\t1A8C556E180E8B5100EF57C3 /* effect1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = effect1.wav; sourceTree = \"<group>\"; };\n\t\t1A8C556F180E8B5100EF57C3 /* farm.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = farm.jpg; sourceTree = \"<group>\"; };\n\t\t1A8C5571180E8B5100EF57C3 /* Marker Felt.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"Marker Felt.ttf\"; sourceTree = \"<group>\"; };\n\t\t1A8C5572180E8B5100EF57C3 /* hello.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hello.lua; sourceTree = \"<group>\"; };\n\t\t1A8C5573180E8B5100EF57C3 /* hello2.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hello2.lua; sourceTree = \"<group>\"; };\n\t\t1A8C5574180E8B5100EF57C3 /* land.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = land.png; sourceTree = \"<group>\"; };\n\t\t1A8C5575180E8B5100EF57C3 /* menu1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu1.png; sourceTree = \"<group>\"; };\n\t\t1A8C5576180E8B5100EF57C3 /* menu2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu2.png; sourceTree = \"<group>\"; };\n\t\t1A8C5596180E8B8400EF57C3 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../cocos/scripting/lua/script/AudioEngine.lua; sourceTree = \"<group>\"; };\n\t\t1A8C5597180E8B8400EF57C3 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../cocos/scripting/lua/script/CCBReaderLoad.lua; sourceTree = \"<group>\"; };\n\t\t1A8C5598180E8B8400EF57C3 /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = ../cocos/scripting/lua/script/Cocos2d.lua; sourceTree = \"<group>\"; };\n\t\t1A8C5599180E8B8400EF57C3 /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2dConstants.lua; path = ../cocos/scripting/lua/script/Cocos2dConstants.lua; sourceTree = \"<group>\"; };\n\t\t1A8C559A180E8B8400EF57C3 /* Deprecated.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Deprecated.lua; path = ../cocos/scripting/lua/script/Deprecated.lua; sourceTree = \"<group>\"; };\n\t\t1A8C559B180E8B8400EF57C3 /* DeprecatedClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedClass.lua; path = ../cocos/scripting/lua/script/DeprecatedClass.lua; sourceTree = \"<group>\"; };\n\t\t1A8C559C180E8B8400EF57C3 /* DeprecatedEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedEnum.lua; path = ../cocos/scripting/lua/script/DeprecatedEnum.lua; sourceTree = \"<group>\"; };\n\t\t1A8C559D180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedOpenglEnum.lua; path = ../cocos/scripting/lua/script/DeprecatedOpenglEnum.lua; sourceTree = \"<group>\"; };\n\t\t1A8C559E180E8B8400EF57C3 /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DrawPrimitives.lua; path = ../cocos/scripting/lua/script/DrawPrimitives.lua; sourceTree = \"<group>\"; };\n\t\t1A8C559F180E8B8400EF57C3 /* luaj.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaj.lua; path = ../cocos/scripting/lua/script/luaj.lua; sourceTree = \"<group>\"; };\n\t\t1A8C55A0180E8B8400EF57C3 /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Opengl.lua; path = ../cocos/scripting/lua/script/Opengl.lua; sourceTree = \"<group>\"; };\n\t\t1A8C55A1180E8B8400EF57C3 /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OpenglConstants.lua; path = ../cocos/scripting/lua/script/OpenglConstants.lua; sourceTree = \"<group>\"; };\n\t\t1A8C566D180E8E9600EF57C3 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C566E180E8E9600EF57C3 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A8C5853180E8F0100EF57C3 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t1A8C5854180E8F0100EF57C3 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t1A8C5855180E8F0100EF57C3 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5856180E8F0100EF57C3 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1A8C5857180E8F0100EF57C3 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5858180E8F0100EF57C3 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C5859180E8F0100EF57C3 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C585A180E8F0100EF57C3 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C585B180E8F0100EF57C3 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C585C180E8F0100EF57C3 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C585D180E8F0100EF57C3 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C585E180E8F0100EF57C3 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1A8C585F180E8F0100EF57C3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A8C5860180E8F0100EF57C3 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1A8C5861180E8F0100EF57C3 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1A8C5862180E8F0100EF57C3 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1A8C5863180E8F0100EF57C3 /* TestLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestLua_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A8C5874180E8F0C00EF57C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A8C5876180E8F0C00EF57C3 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A8C5877180E8F0C00EF57C3 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A8C5878180E8F0C00EF57C3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A8C5879180E8F0C00EF57C3 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1A8C587A180E8F0C00EF57C3 /* TestLua_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestLua_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A91419B180BEB6A00CFC31F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A91419D180BEB6A00CFC31F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A91419E180BEB6A00CFC31F /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Icon.icns; path = proj.mac/Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A91419F180BEB6A00CFC31F /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = proj.mac/main.cpp; sourceTree = \"<group>\"; };\n\t\t1A9141A0180BEB6A00CFC31F /* SampleGame_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SampleGame_Prefix.pch; path = proj.mac/SampleGame_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A9DC2A1180E65D4007A3AD4 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DC2A2180E65D4007A3AD4 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1A9DC2A7180E6681007A3AD4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1A9DC2A9180E6681007A3AD4 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1A9DC2AA180E6681007A3AD4 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1A9DC2AB180E6681007A3AD4 /* Info-obfuscated.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = \"Info-obfuscated.plist\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2AC180E6681007A3AD4 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1A9DC2AD180E6681007A3AD4 /* Test_Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Test_Info.plist; sourceTree = \"<group>\"; };\n\t\t1A9DC2AE180E6681007A3AD4 /* Test_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A9DC2B6180E668B007A3AD4 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t1A9DC2B7180E668B007A3AD4 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t1A9DC2B8180E668B007A3AD4 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2B9180E668B007A3AD4 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1A9DC2BA180E668B007A3AD4 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2BB180E668B007A3AD4 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2BC180E668B007A3AD4 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2BD180E668B007A3AD4 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2BE180E668B007A3AD4 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2BF180E668B007A3AD4 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2C0180E668B007A3AD4 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2C1180E668B007A3AD4 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2C2180E668B007A3AD4 /* Info-obfuscated.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = \"Info-obfuscated.plist\"; sourceTree = \"<group>\"; };\n\t\t1A9DC2C3180E668B007A3AD4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t1A9DC2C4180E668B007A3AD4 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1A9DC2C5180E668B007A3AD4 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1A9DC2C6180E668B007A3AD4 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1A9DC2C7180E668B007A3AD4 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1A9DC9E4180E6742007A3AD4 /* script */ = {isa = PBXFileReference; lastKnownFileType = folder; name = script; path = ../cocos/scripting/javascript/script; sourceTree = \"<group>\"; };\n\t\t1A9F808C177E98A600D9A1CB /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; };\n\t\t1AAF4FA7180E2C17000584C8 /* AccelerometerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccelerometerTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FA8180E2C17000584C8 /* AccelerometerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccelerometerTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FAA180E2C17000584C8 /* ActionManagerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionManagerTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FAB180E2C17000584C8 /* ActionManagerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionManagerTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FAD180E2C17000584C8 /* ActionsEaseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionsEaseTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FAE180E2C17000584C8 /* ActionsEaseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionsEaseTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FB0180E2C17000584C8 /* ActionsProgressTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActionsProgressTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FB1180E2C17000584C8 /* ActionsProgressTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionsProgressTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FB3180E2C17000584C8 /* ActionsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ActionsTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF4FB4180E2C17000584C8 /* ActionsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActionsTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FB5180E2C17000584C8 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FB6180E2C17000584C8 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FB7180E2C17000584C8 /* BaseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FB8180E2C17000584C8 /* BaseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FBA180E2C17000584C8 /* Box2dTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Box2dTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FBB180E2C17000584C8 /* Box2dTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Box2dTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FBD180E2C17000584C8 /* Box2dView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = Box2dView.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF4FBE180E2C17000584C8 /* Box2dView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Box2dView.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FBF180E2C17000584C8 /* GLES-Render.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"GLES-Render.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FC0180E2C17000584C8 /* GLES-Render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"GLES-Render.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FC1180E2C17000584C8 /* Test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Test.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FC2180E2C17000584C8 /* Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FC3180E2C17000584C8 /* TestEntries.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestEntries.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FC5180E2C17000584C8 /* AddPair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddPair.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FC6180E2C17000584C8 /* ApplyForce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplyForce.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FC7180E2C17000584C8 /* BodyTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BodyTypes.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FC8180E2C17000584C8 /* Breakable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakable.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FC9180E2C17000584C8 /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bridge.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FCA180E2C17000584C8 /* BulletTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BulletTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FCB180E2C17000584C8 /* Cantilever.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cantilever.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FCC180E2C17000584C8 /* Car.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Car.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FCD180E2C17000584C8 /* Chain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chain.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FCE180E2C17000584C8 /* CharacterCollision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterCollision.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FCF180E2C17000584C8 /* CollisionFiltering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollisionFiltering.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD0180E2C17000584C8 /* CollisionProcessing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollisionProcessing.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD1180E2C17000584C8 /* CompoundShapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompoundShapes.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD2180E2C17000584C8 /* Confined.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Confined.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD3180E2C17000584C8 /* ContinuousTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContinuousTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD4180E2C17000584C8 /* DistanceTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DistanceTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD5180E2C17000584C8 /* Dominos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dominos.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD6180E2C17000584C8 /* DumpShell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpShell.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD7180E2C17000584C8 /* DynamicTreeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicTreeTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD8180E2C17000584C8 /* EdgeShapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EdgeShapes.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FD9180E2C17000584C8 /* EdgeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EdgeTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FDA180E2C17000584C8 /* Gears.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Gears.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FDB180E2C17000584C8 /* OneSidedPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OneSidedPlatform.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FDC180E2C17000584C8 /* Pinball.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pinball.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FDD180E2C17000584C8 /* PolyCollision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyCollision.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FDE180E2C17000584C8 /* PolyShapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolyShapes.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FDF180E2C17000584C8 /* Prismatic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prismatic.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE0180E2C17000584C8 /* Pulleys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pulleys.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE1180E2C17000584C8 /* Pyramid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pyramid.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE2180E2C17000584C8 /* RayCast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RayCast.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE3180E2C17000584C8 /* Revolute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Revolute.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE4180E2C17000584C8 /* Rope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Rope.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE5180E2C17000584C8 /* RopeJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RopeJoint.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE6180E2C17000584C8 /* SensorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SensorTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE7180E2C17000584C8 /* ShapeEditing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeEditing.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE8180E2C17000584C8 /* SliderCrank.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SliderCrank.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FE9180E2C17000584C8 /* SphereStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SphereStack.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FEA180E2C17000584C8 /* TheoJansen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TheoJansen.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FEB180E2C17000584C8 /* Tiles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tiles.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FEC180E2C17000584C8 /* TimeOfImpact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeOfImpact.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FED180E2C17000584C8 /* Tumbler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tumbler.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FEE180E2C17000584C8 /* VaryingFriction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VaryingFriction.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FEF180E2C17000584C8 /* VaryingRestitution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VaryingRestitution.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FF0180E2C17000584C8 /* VerticalStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VerticalStack.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FF1180E2C17000584C8 /* Web.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Web.h; sourceTree = \"<group>\"; };\n\t\t1AAF4FF3180E2C17000584C8 /* Bug-1159.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-1159.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FF4180E2C17000584C8 /* Bug-1159.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-1159.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FF5180E2C17000584C8 /* Bug-1174.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-1174.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FF6180E2C17000584C8 /* Bug-1174.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-1174.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FF7180E2C17000584C8 /* Bug-350.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-350.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FF8180E2C17000584C8 /* Bug-350.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-350.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FF9180E2C17000584C8 /* Bug-422.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-422.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FFA180E2C17000584C8 /* Bug-422.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-422.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FFC180E2C17000584C8 /* Bug-458.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-458.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FFD180E2C17000584C8 /* Bug-458.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-458.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF4FFE180E2C17000584C8 /* QuestionContainerSprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QuestionContainerSprite.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF4FFF180E2C17000584C8 /* QuestionContainerSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuestionContainerSprite.h; sourceTree = \"<group>\"; };\n\t\t1AAF5000180E2C17000584C8 /* Bug-624.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-624.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF5001180E2C17000584C8 /* Bug-624.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-624.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF5002180E2C17000584C8 /* Bug-886.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-886.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF5003180E2C17000584C8 /* Bug-886.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-886.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF5004180E2C17000584C8 /* Bug-899.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-899.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF5005180E2C17000584C8 /* Bug-899.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-899.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF5006180E2C17000584C8 /* Bug-914.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = \"Bug-914.cpp\"; sourceTree = \"<group>\"; };\n\t\t1AAF5007180E2C17000584C8 /* Bug-914.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"Bug-914.h\"; sourceTree = \"<group>\"; };\n\t\t1AAF5008180E2C17000584C8 /* BugsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BugsTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5009180E2C17000584C8 /* BugsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BugsTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF500B180E2C18000584C8 /* ChipmunkTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChipmunkTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF500C180E2C18000584C8 /* ChipmunkTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChipmunkTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF500E180E2C18000584C8 /* ClickAndMoveTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClickAndMoveTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF500F180E2C18000584C8 /* ClickAndMoveTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClickAndMoveTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5011180E2C18000584C8 /* ClippingNodeTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ClippingNodeTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF5012180E2C18000584C8 /* ClippingNodeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClippingNodeTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5014180E2C18000584C8 /* CocosDenshionTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosDenshionTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5015180E2C18000584C8 /* CocosDenshionTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosDenshionTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5017180E2C18000584C8 /* ConfigurationTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConfigurationTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5018180E2C18000584C8 /* ConfigurationTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigurationTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5019180E2C18000584C8 /* controller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controller.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF501A180E2C18000584C8 /* controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller.h; sourceTree = \"<group>\"; };\n\t\t1AAF501C180E2C18000584C8 /* CurlTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CurlTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF501D180E2C18000584C8 /* CurlTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CurlTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF501F180E2C18000584C8 /* CurrentLanguageTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CurrentLanguageTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5020180E2C18000584C8 /* CurrentLanguageTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CurrentLanguageTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5022180E2C18000584C8 /* DataVisitorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DataVisitorTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5023180E2C18000584C8 /* DataVisitorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataVisitorTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5025180E2C18000584C8 /* DrawPrimitivesTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = DrawPrimitivesTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF5026180E2C18000584C8 /* DrawPrimitivesTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawPrimitivesTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5028180E2C18000584C8 /* EffectsAdvancedTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EffectsAdvancedTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5029180E2C18000584C8 /* EffectsAdvancedTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EffectsAdvancedTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF502B180E2C18000584C8 /* EffectsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EffectsTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF502C180E2C18000584C8 /* EffectsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EffectsTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5030180E2C18000584C8 /* AnimationsLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationsLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF5031180E2C18000584C8 /* AnimationsTestLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationsTestLayer.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5032180E2C18000584C8 /* AnimationsTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationsTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF5034180E2C18000584C8 /* ButtonTestLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ButtonTestLayer.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5035180E2C18000584C8 /* ButtonTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF5036180E2C18000584C8 /* ButtonTestLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonTestLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF5037180E2C18000584C8 /* CocosBuilderTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosBuilderTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5038180E2C18000584C8 /* CocosBuilderTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosBuilderTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF503A180E2C18000584C8 /* HelloCocosBuilderLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HelloCocosBuilderLayer.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF503B180E2C18000584C8 /* HelloCocosBuilderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloCocosBuilderLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF503C180E2C18000584C8 /* HelloCocosBuilderLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloCocosBuilderLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF503E180E2C18000584C8 /* LabelTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF503F180E2C18000584C8 /* LabelTestLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelTestLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF5041180E2C18000584C8 /* MenuTestLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MenuTestLayer.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5042180E2C18000584C8 /* MenuTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF5043180E2C18000584C8 /* MenuTestLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTestLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF5045180E2C18000584C8 /* ParticleSystemTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParticleSystemTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF5046180E2C18000584C8 /* ParticleSystemTestLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParticleSystemTestLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF5048180E2C18000584C8 /* ScrollViewTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollViewTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF5049180E2C18000584C8 /* ScrollViewTestLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollViewTestLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF504B180E2C18000584C8 /* SpriteTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF504C180E2C18000584C8 /* SpriteTestLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteTestLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF504E180E2C18000584C8 /* TestHeaderLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestHeaderLayer.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF504F180E2C18000584C8 /* TestHeaderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestHeaderLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF5050180E2C18000584C8 /* TestHeaderLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestHeaderLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF5052180E2C18000584C8 /* TimelineCallbackLayerLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineCallbackLayerLoader.h; sourceTree = \"<group>\"; };\n\t\t1AAF5053180E2C18000584C8 /* TimelineCallbackTestLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineCallbackTestLayer.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5054180E2C18000584C8 /* TimelineCallbackTestLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineCallbackTestLayer.h; sourceTree = \"<group>\"; };\n\t\t1AAF5056180E2C18000584C8 /* ArmatureScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ArmatureScene.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF5057180E2C18000584C8 /* ArmatureScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArmatureScene.h; sourceTree = \"<group>\"; };\n\t\t1AAF5059180E2C18000584C8 /* ComponentsTestScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComponentsTestScene.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF505A180E2C18000584C8 /* ComponentsTestScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComponentsTestScene.h; sourceTree = \"<group>\"; };\n\t\t1AAF505B180E2C18000584C8 /* EnemyController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnemyController.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF505C180E2C18000584C8 /* EnemyController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnemyController.h; sourceTree = \"<group>\"; };\n\t\t1AAF505D180E2C18000584C8 /* GameOverScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameOverScene.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF505E180E2C18000584C8 /* GameOverScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameOverScene.h; sourceTree = \"<group>\"; };\n\t\t1AAF505F180E2C18000584C8 /* PlayerController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlayerController.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5060180E2C18000584C8 /* PlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayerController.h; sourceTree = \"<group>\"; };\n\t\t1AAF5061180E2C18000584C8 /* ProjectileController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProjectileController.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5062180E2C18000584C8 /* ProjectileController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectileController.h; sourceTree = \"<group>\"; };\n\t\t1AAF5063180E2C18000584C8 /* SceneController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneController.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5064180E2C18000584C8 /* SceneController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneController.h; sourceTree = \"<group>\"; };\n\t\t1AAF50A0180E2C19000584C8 /* SceneEditorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneEditorTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50A1180E2C19000584C8 /* SceneEditorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneEditorTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50A4180E2C19000584C8 /* CCControlButtonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlButtonTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50A5180E2C19000584C8 /* CCControlButtonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlButtonTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50A7180E2C19000584C8 /* CCControlColourPickerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlColourPickerTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50A8180E2C19000584C8 /* CCControlColourPickerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlColourPickerTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50AA180E2C19000584C8 /* CCControlPotentiometerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlPotentiometerTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50AB180E2C19000584C8 /* CCControlPotentiometerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlPotentiometerTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50AC180E2C19000584C8 /* CCControlScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlScene.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50AD180E2C19000584C8 /* CCControlScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlScene.h; sourceTree = \"<group>\"; };\n\t\t1AAF50AE180E2C19000584C8 /* CCControlSceneManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSceneManager.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50AF180E2C19000584C8 /* CCControlSceneManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSceneManager.h; sourceTree = \"<group>\"; };\n\t\t1AAF50B1180E2C19000584C8 /* CCControlSliderTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSliderTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50B2180E2C19000584C8 /* CCControlSliderTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSliderTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50B4180E2C19000584C8 /* CCControlStepperTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlStepperTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50B5180E2C19000584C8 /* CCControlStepperTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlStepperTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50B7180E2C19000584C8 /* CCControlSwitchTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSwitchTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50B8180E2C19000584C8 /* CCControlSwitchTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSwitchTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50BA180E2C19000584C8 /* EditBoxTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditBoxTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50BB180E2C19000584C8 /* EditBoxTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditBoxTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50BC180E2C19000584C8 /* ExtensionsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionsTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50BD180E2C19000584C8 /* ExtensionsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionsTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50BF180E2C19000584C8 /* HttpClientTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClientTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50C0180E2C19000584C8 /* HttpClientTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpClientTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50C1180E2C19000584C8 /* SocketIOTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketIOTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50C2180E2C19000584C8 /* SocketIOTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketIOTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50C3180E2C19000584C8 /* WebSocketTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50C4180E2C19000584C8 /* WebSocketTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50C6180E2C19000584C8 /* NotificationCenterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationCenterTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50C7180E2C19000584C8 /* NotificationCenterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationCenterTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50C9180E2C19000584C8 /* Scale9SpriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scale9SpriteTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50CA180E2C19000584C8 /* Scale9SpriteTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scale9SpriteTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50CC180E2C19000584C8 /* CustomTableViewCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomTableViewCell.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50CD180E2C19000584C8 /* CustomTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomTableViewCell.h; sourceTree = \"<group>\"; };\n\t\t1AAF50CE180E2C19000584C8 /* TableViewTestScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TableViewTestScene.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50CF180E2C19000584C8 /* TableViewTestScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewTestScene.h; sourceTree = \"<group>\"; };\n\t\t1AAF50D1180E2C19000584C8 /* FileUtilsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileUtilsTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50D2180E2C19000584C8 /* FileUtilsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileUtilsTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50D4180E2C19000584C8 /* FontTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50D5180E2C19000584C8 /* FontTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50D7180E2C19000584C8 /* IntervalTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntervalTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50D8180E2C19000584C8 /* IntervalTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntervalTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50DA180E2C19000584C8 /* KeyboardTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50DB180E2C19000584C8 /* KeyboardTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyboardTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50DD180E2C19000584C8 /* KeypadTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeypadTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50DE180E2C19000584C8 /* KeypadTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeypadTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50E0180E2C19000584C8 /* LabelTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = LabelTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF50E1180E2C19000584C8 /* LabelTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50E2180E2C19000584C8 /* LabelTestNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = LabelTestNew.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF50E3180E2C19000584C8 /* LabelTestNew.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelTestNew.h; sourceTree = \"<group>\"; };\n\t\t1AAF50E5180E2C19000584C8 /* LayerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50E6180E2C19000584C8 /* LayerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50E8180E2C19000584C8 /* MenuTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MenuTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50E9180E2C19000584C8 /* MenuTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50EB180E2C19000584C8 /* MotionStreakTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MotionStreakTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50EC180E2C19000584C8 /* MotionStreakTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MotionStreakTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50EE180E2C19000584C8 /* MutiTouchTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MutiTouchTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50EF180E2C19000584C8 /* MutiTouchTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutiTouchTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50F1180E2C19000584C8 /* NewEventDispatcherTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewEventDispatcherTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50F2180E2C19000584C8 /* NewEventDispatcherTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewEventDispatcherTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50F4180E2C19000584C8 /* NodeTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = NodeTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF50F5180E2C1A000584C8 /* NodeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50F7180E2C1A000584C8 /* ParallaxTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParallaxTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50F8180E2C1A000584C8 /* ParallaxTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallaxTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50FA180E2C1A000584C8 /* ParticleTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParticleTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50FB180E2C1A000584C8 /* ParticleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParticleTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50FD180E2C1A000584C8 /* PerformanceAllocTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceAllocTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF50FE180E2C1A000584C8 /* PerformanceAllocTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceAllocTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF50FF180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceNodeChildrenTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5100180E2C1A000584C8 /* PerformanceNodeChildrenTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceNodeChildrenTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5101180E2C1A000584C8 /* PerformanceParticleTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceParticleTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5102180E2C1A000584C8 /* PerformanceParticleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceParticleTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5103180E2C1A000584C8 /* PerformanceSpriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceSpriteTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5104180E2C1A000584C8 /* PerformanceSpriteTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceSpriteTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5105180E2C1A000584C8 /* PerformanceTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5106180E2C1A000584C8 /* PerformanceTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5107180E2C1A000584C8 /* PerformanceTextureTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceTextureTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5108180E2C1A000584C8 /* PerformanceTextureTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceTextureTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5109180E2C1A000584C8 /* PerformanceTouchesTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceTouchesTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF510A180E2C1A000584C8 /* PerformanceTouchesTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceTouchesTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF510C180E2C1A000584C8 /* PhysicsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PhysicsTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF510D180E2C1A000584C8 /* PhysicsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhysicsTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF510F180E2C1A000584C8 /* RenderTextureTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = RenderTextureTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF5110180E2C1A000584C8 /* RenderTextureTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTextureTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5112180E2C1A000584C8 /* RotateWorldTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RotateWorldTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5113180E2C1A000584C8 /* RotateWorldTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RotateWorldTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5115180E2C1A000584C8 /* SceneTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5116180E2C1A000584C8 /* SceneTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5118180E2C1A000584C8 /* SchedulerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SchedulerTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5119180E2C1A000584C8 /* SchedulerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchedulerTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF511B180E2C1A000584C8 /* ShaderTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ShaderTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF511C180E2C1A000584C8 /* ShaderTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShaderTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF511D180E2C1A000584C8 /* ShaderTest2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ShaderTest2.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF511E180E2C1A000584C8 /* ShaderTest2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShaderTest2.h; sourceTree = \"<group>\"; };\n\t\t1AAF5120180E2C1A000584C8 /* SpineTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpineTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5121180E2C1A000584C8 /* SpineTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpineTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5123180E2C1A000584C8 /* SpriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpriteTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5124180E2C1A000584C8 /* SpriteTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5125180E2C1A000584C8 /* testBasic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testBasic.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5126180E2C1A000584C8 /* testBasic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testBasic.h; sourceTree = \"<group>\"; };\n\t\t1AAF5127180E2C1A000584C8 /* testResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testResource.h; sourceTree = \"<group>\"; };\n\t\t1AAF5128180E2C1A000584C8 /* tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tests.h; sourceTree = \"<group>\"; };\n\t\t1AAF512A180E2C1A000584C8 /* TextInputTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextInputTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF512B180E2C1A000584C8 /* TextInputTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF512D180E2C1A000584C8 /* Texture2dTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = Texture2dTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF512E180E2C1A000584C8 /* Texture2dTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture2dTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5130180E2C1A000584C8 /* TextureCacheTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextureCacheTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5131180E2C1A000584C8 /* TextureCacheTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextureCacheTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5133180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextureAtlasEncryptionTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5134180E2C1A000584C8 /* TextureAtlasEncryptionTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextureAtlasEncryptionTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5136180E2C1A000584C8 /* TileMapTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = TileMapTest.cpp; sourceTree = \"<group>\"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };\n\t\t1AAF5137180E2C1A000584C8 /* TileMapTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TileMapTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5139180E2C1A000584C8 /* Ball.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Ball.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF513A180E2C1A000584C8 /* Ball.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ball.h; sourceTree = \"<group>\"; };\n\t\t1AAF513B180E2C1A000584C8 /* Paddle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Paddle.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF513C180E2C1A000584C8 /* Paddle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Paddle.h; sourceTree = \"<group>\"; };\n\t\t1AAF513D180E2C1A000584C8 /* TouchesTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchesTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF513E180E2C1A000584C8 /* TouchesTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchesTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5140180E2C1A000584C8 /* TransitionsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransitionsTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5141180E2C1A000584C8 /* TransitionsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransitionsTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5143180E2C1A000584C8 /* UserDefaultTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserDefaultTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5144180E2C1A000584C8 /* UserDefaultTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserDefaultTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5145180E2C1A000584C8 /* VisibleRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleRect.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5146180E2C1A000584C8 /* VisibleRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleRect.h; sourceTree = \"<group>\"; };\n\t\t1AAF5148180E2C1A000584C8 /* ZwoptexTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ZwoptexTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5149180E2C1A000584C8 /* ZwoptexTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZwoptexTest.h; sourceTree = \"<group>\"; };\n\t\t1AAF5252180E2C26000584C8 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t1AAF5253180E2C26000584C8 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t1AAF5254180E2C26000584C8 /* testsAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testsAppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1AAF5255180E2C26000584C8 /* testsAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = testsAppDelegate.mm; sourceTree = \"<group>\"; };\n\t\t1AAF5256180E2C26000584C8 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5257180E2C26000584C8 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t1AAF5258180E2C26000584C8 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5259180E2C26000584C8 /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-100.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF525A180E2C26000584C8 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF525B180E2C26000584C8 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF525C180E2C26000584C8 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF525D180E2C26000584C8 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF525E180E2C26000584C8 /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-29.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF525F180E2C26000584C8 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-40.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5260180E2C26000584C8 /* Icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-50.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5261180E2C26000584C8 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5262180E2C26000584C8 /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-58.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5263180E2C26000584C8 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5264180E2C26000584C8 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5265180E2C26000584C8 /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-80.png\"; sourceTree = \"<group>\"; };\n\t\t1AAF5266180E2C26000584C8 /* iphone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iphone_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1AAF5267180E2C26000584C8 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t1AAF5268180E2C26000584C8 /* Test-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = \"Test-Info.plist\"; sourceTree = \"<group>\"; };\n\t\t1AAF527F180E2C31000584C8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t1AAF5281180E2C31000584C8 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t1AAF5282180E2C31000584C8 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t1AAF5283180E2C31000584C8 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t1AAF5284180E2C31000584C8 /* Test_Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Test_Info.plist; sourceTree = \"<group>\"; };\n\t\t1AAF5285180E2C31000584C8 /* Test_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t1ADD146B188D25270034D5EF /* PerformanceEventDispatcherTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEventDispatcherTest.cpp; sourceTree = \"<group>\"; };\n\t\t1ADD146C188D25270034D5EF /* PerformanceEventDispatcherTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEventDispatcherTest.h; sourceTree = \"<group>\"; };\n\t\t1AFB0DE11885357A003B2FF3 /* PerformanceContainerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceContainerTest.cpp; sourceTree = \"<group>\"; };\n\t\t1AFB0DE21885357A003B2FF3 /* PerformanceContainerTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceContainerTest.h; sourceTree = \"<group>\"; };\n\t\t1D6058910D05DD3D006BFB54 /* Test cpp Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Test cpp Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t37A6145B186B21F6007A4638 /* acts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = acts.cpp; sourceTree = \"<group>\"; };\n\t\t37A6145C186B21F6007A4638 /* acts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acts.h; sourceTree = \"<group>\"; };\n\t\t37A6145D186B21F6007A4638 /* cons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cons.cpp; sourceTree = \"<group>\"; };\n\t\t37A6145E186B21F6007A4638 /* cons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cons.h; sourceTree = \"<group>\"; };\n\t\t37A6145F186B21F6007A4638 /* EventDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventDef.h; sourceTree = \"<group>\"; };\n\t\t37C819601875DF2A00930C57 /* animations */ = {isa = PBXFileReference; lastKnownFileType = folder; name = animations; path = ../samples/Cpp/TestCpp/Resources/animations; sourceTree = \"<group>\"; };\n\t\t37C819611875DF2A00930C57 /* armature */ = {isa = PBXFileReference; lastKnownFileType = folder; name = armature; path = ../samples/Cpp/TestCpp/Resources/armature; sourceTree = \"<group>\"; };\n\t\t37C819621875DF2A00930C57 /* background-music-aac.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = \"background-music-aac.wav\"; path = \"../samples/Cpp/TestCpp/Resources/background-music-aac.wav\"; sourceTree = \"<group>\"; };\n\t\t37C819631875DF2A00930C57 /* background.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = background.mp3; path = ../samples/Cpp/TestCpp/Resources/background.mp3; sourceTree = \"<group>\"; };\n\t\t37C819641875DF2A00930C57 /* background.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; name = background.ogg; path = ../samples/Cpp/TestCpp/Resources/background.ogg; sourceTree = \"<group>\"; };\n\t\t37C819651875DF2A00930C57 /* ccb */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ccb; path = ../samples/Cpp/TestCpp/Resources/ccb; sourceTree = \"<group>\"; };\n\t\t37C819661875DF2A00930C57 /* CocosBuilderExample.ccbproj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = CocosBuilderExample.ccbproj; path = ../samples/Cpp/TestCpp/Resources/CocosBuilderExample.ccbproj; sourceTree = \"<group>\"; };\n\t\t37C819671875DF2A00930C57 /* CocosBuilderExample.ccbresourcelog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocosBuilderExample.ccbresourcelog; path = ../samples/Cpp/TestCpp/Resources/CocosBuilderExample.ccbresourcelog; sourceTree = \"<group>\"; };\n\t\t37C819681875DF2A00930C57 /* cocosgui */ = {isa = PBXFileReference; lastKnownFileType = folder; name = cocosgui; path = ../samples/Cpp/TestCpp/Resources/cocosgui; sourceTree = \"<group>\"; };\n\t\t37C819691875DF2A00930C57 /* components */ = {isa = PBXFileReference; lastKnownFileType = folder; name = components; path = ../samples/Cpp/TestCpp/Resources/components; sourceTree = \"<group>\"; };\n\t\t37C8196A1875DF2A00930C57 /* configs */ = {isa = PBXFileReference; lastKnownFileType = folder; name = configs; path = ../samples/Cpp/TestCpp/Resources/configs; sourceTree = \"<group>\"; };\n\t\t37C8196B1875DF2A00930C57 /* effect1.raw */ = {isa = PBXFileReference; lastKnownFileType = file; name = effect1.raw; path = ../samples/Cpp/TestCpp/Resources/effect1.raw; sourceTree = \"<group>\"; };\n\t\t37C8196C1875DF2A00930C57 /* effect1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = effect1.wav; path = ../samples/Cpp/TestCpp/Resources/effect1.wav; sourceTree = \"<group>\"; };\n\t\t37C8196D1875DF2A00930C57 /* effect2.ogg */ = {isa = PBXFileReference; lastKnownFileType = file; name = effect2.ogg; path = ../samples/Cpp/TestCpp/Resources/effect2.ogg; sourceTree = \"<group>\"; };\n\t\t37C8196E1875DF2A00930C57 /* extensions */ = {isa = PBXFileReference; lastKnownFileType = folder; name = extensions; path = ../samples/Cpp/TestCpp/Resources/extensions; sourceTree = \"<group>\"; };\n\t\t37C8196F1875DF2A00930C57 /* fileLookup.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = fileLookup.plist; path = ../samples/Cpp/TestCpp/Resources/fileLookup.plist; sourceTree = \"<group>\"; };\n\t\t37C819701875DF2A00930C57 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fonts; path = ../samples/Cpp/TestCpp/Resources/fonts; sourceTree = \"<group>\"; };\n\t\t37C819711875DF2A00930C57 /* fps_images.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = fps_images.png; path = ../samples/Cpp/TestCpp/Resources/fps_images.png; sourceTree = \"<group>\"; };\n\t\t37C819721875DF2A00930C57 /* hd */ = {isa = PBXFileReference; lastKnownFileType = folder; name = hd; path = ../samples/Cpp/TestCpp/Resources/hd; sourceTree = \"<group>\"; };\n\t\t37C819731875DF2A00930C57 /* Hello.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Hello.png; path = ../samples/Cpp/TestCpp/Resources/Hello.png; sourceTree = \"<group>\"; };\n\t\t37C819741875DF2B00930C57 /* Images */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Images; path = ../samples/Cpp/TestCpp/Resources/Images; sourceTree = \"<group>\"; };\n\t\t37C819751875DF2B00930C57 /* ipad */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ipad; path = ../samples/Cpp/TestCpp/Resources/ipad; sourceTree = \"<group>\"; };\n\t\t37C819761875DF2B00930C57 /* ipadhd */ = {isa = PBXFileReference; lastKnownFileType = folder; name = ipadhd; path = ../samples/Cpp/TestCpp/Resources/ipadhd; sourceTree = \"<group>\"; };\n\t\t37C819771875DF2B00930C57 /* Misc */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Misc; path = ../samples/Cpp/TestCpp/Resources/Misc; sourceTree = \"<group>\"; };\n\t\t37C819781875DF2B00930C57 /* music.mid */ = {isa = PBXFileReference; lastKnownFileType = audio.midi; name = music.mid; path = ../samples/Cpp/TestCpp/Resources/music.mid; sourceTree = \"<group>\"; };\n\t\t37C819791875DF2B00930C57 /* Particles */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Particles; path = ../samples/Cpp/TestCpp/Resources/Particles; sourceTree = \"<group>\"; };\n\t\t37C8197A1875DF2B00930C57 /* pew-pew-lei.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = \"pew-pew-lei.wav\"; path = \"../samples/Cpp/TestCpp/Resources/pew-pew-lei.wav\"; sourceTree = \"<group>\"; };\n\t\t37C8197B1875DF2B00930C57 /* scenetest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = scenetest; path = ../samples/Cpp/TestCpp/Resources/scenetest; sourceTree = \"<group>\"; };\n\t\t37C8197C1875DF2B00930C57 /* Shaders */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Shaders; path = ../samples/Cpp/TestCpp/Resources/Shaders; sourceTree = \"<group>\"; };\n\t\t37C8197D1875DF2B00930C57 /* spine */ = {isa = PBXFileReference; lastKnownFileType = folder; name = spine; path = ../samples/Cpp/TestCpp/Resources/spine; sourceTree = \"<group>\"; };\n\t\t37C8197E1875DF2B00930C57 /* TileMaps */ = {isa = PBXFileReference; lastKnownFileType = folder; name = TileMaps; path = ../samples/Cpp/TestCpp/Resources/TileMaps; sourceTree = \"<group>\"; };\n\t\t37C8197F1875DF2B00930C57 /* zwoptex */ = {isa = PBXFileReference; lastKnownFileType = folder; name = zwoptex; path = ../samples/Cpp/TestCpp/Resources/zwoptex; sourceTree = \"<group>\"; };\n\t\t460E452D1807E712000CDD6D /* AppController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t460E452E1807E712000CDD6D /* AppController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t460E452F1807E712000CDD6D /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t460E45301807E712000CDD6D /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t460E45311807E712000CDD6D /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t460E45321807E712000CDD6D /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t460E45331807E712000CDD6D /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t460E45341807E712000CDD6D /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t460E45351807E712000CDD6D /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t460E45361807E712000CDD6D /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t460E45371807E712000CDD6D /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t460E45381807E712000CDD6D /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t460E45391807E712000CDD6D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t460E453A1807E712000CDD6D /* RootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t460E453B1807E712000CDD6D /* RootViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t460E453C1807E712000CDD6D /* SimpleGame-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = \"SimpleGame-Info.plist\"; sourceTree = \"<group>\"; };\n\t\t460E453D1807E712000CDD6D /* SimpleGame_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleGame_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t460E459E180801A4000CDD6D /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = \"<group>\"; };\n\t\t460E459F180801A4000CDD6D /* app.config.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = app.config.txt; sourceTree = \"<group>\"; };\n\t\t460E45A0180801A4000CDD6D /* app.icf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = app.icf; sourceTree = \"<group>\"; };\n\t\t460E45A1180801A4000CDD6D /* background-music-aac.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = \"background-music-aac.wav\"; sourceTree = \"<group>\"; };\n\t\t460E45A2180801A4000CDD6D /* development.icf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = development.icf; sourceTree = \"<group>\"; };\n\t\t460E45A4180801A4000CDD6D /* Marker Felt.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = \"Marker Felt.ttf\"; sourceTree = \"<group>\"; };\n\t\t460E45AB180801A4000CDD6D /* pew-pew-lei.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = \"pew-pew-lei.wav\"; sourceTree = \"<group>\"; };\n\t\t460E45D7180801C1000CDD6D /* hd */ = {isa = PBXFileReference; lastKnownFileType = folder; path = hd; sourceTree = \"<group>\"; };\n\t\t460E45DA180801C9000CDD6D /* sd */ = {isa = PBXFileReference; lastKnownFileType = folder; path = sd; sourceTree = \"<group>\"; };\n\t\t4662EB5D188E426300B02E8F /* ReleasePoolTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReleasePoolTest.cpp; sourceTree = \"<group>\"; };\n\t\t4662EB63188E472A00B02E8F /* ReleasePoolTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReleasePoolTest.h; sourceTree = \"<group>\"; };\n\t\t46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; path = cocos2d_libs.xcodeproj; sourceTree = \"<group>\"; };\n\t\t46A174851807D934005B8026 /* AppDelegate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t46A174861807D934005B8026 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t46A174871807D934005B8026 /* AppMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppMacros.h; sourceTree = \"<group>\"; };\n\t\t46A174881807D934005B8026 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = HelloWorldScene.cpp; sourceTree = \"<group>\"; };\n\t\t46A174891807D934005B8026 /* HelloWorldScene.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HelloWorldScene.h; sourceTree = \"<group>\"; };\n\t\t46A174AB1807D934005B8026 /* AppController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t46A174AC1807D934005B8026 /* AppController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t46A174AD1807D934005B8026 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t46A174AE1807D934005B8026 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t46A174AF1807D934005B8026 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B01807D934005B8026 /* HelloCpp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = \"HelloCpp-Info.plist\"; sourceTree = \"<group>\"; };\n\t\t46A174B11807D934005B8026 /* HelloCpp_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HelloCpp_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t46A174B21807D934005B8026 /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-100.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B31807D934005B8026 /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B41807D934005B8026 /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B51807D934005B8026 /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B61807D934005B8026 /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B71807D934005B8026 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-40.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B81807D934005B8026 /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t46A174B91807D934005B8026 /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-58.png\"; sourceTree = \"<group>\"; };\n\t\t46A174BA1807D934005B8026 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t46A174BB1807D934005B8026 /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t46A174BC1807D934005B8026 /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-80.png\"; sourceTree = \"<group>\"; };\n\t\t46A174BD1807D934005B8026 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t46A174BE1807D934005B8026 /* RootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t46A174BF1807D934005B8026 /* RootViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t46A174C71807D934005B8026 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t46A174C91807D934005B8026 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = \"<group>\"; };\n\t\t46A174CA1807D934005B8026 /* HelloCpp_Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = HelloCpp_Info.plist; sourceTree = \"<group>\"; };\n\t\t46A174CB1807D934005B8026 /* HelloCpp_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HelloCpp_Prefix.pch; sourceTree = \"<group>\"; };\n\t\t46A174CC1807D934005B8026 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t46A174CD1807D934005B8026 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t46A174EC1807D9C4005B8026 /* bang.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bang.png; sourceTree = \"<group>\"; };\n\t\t46A174EE1807D9C4005B8026 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = fonts; sourceTree = \"<group>\"; };\n\t\t46A174EF1807D9C4005B8026 /* ipad */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ipad; sourceTree = \"<group>\"; };\n\t\t46A174F01807D9C4005B8026 /* ipadhd */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ipadhd; sourceTree = \"<group>\"; };\n\t\t46A174F11807D9C4005B8026 /* iphone */ = {isa = PBXFileReference; lastKnownFileType = folder; path = iphone; sourceTree = \"<group>\"; };\n\t\t50691334184EB453009BBDD7 /* ConsoleTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConsoleTest.cpp; sourceTree = \"<group>\"; };\n\t\t50691335184EB453009BBDD7 /* ConsoleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConsoleTest.h; sourceTree = \"<group>\"; };\n\t\t50D360CA186819DB00828878 /* CocosGUIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocosGUIScene.cpp; sourceTree = \"<group>\"; };\n\t\t50D360CB186819DB00828878 /* CocosGUIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosGUIScene.h; sourceTree = \"<group>\"; };\n\t\t50D360CD186819DB00828878 /* UIButtonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIButtonTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360CE186819DB00828878 /* UIButtonTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIButtonTest.h; sourceTree = \"<group>\"; };\n\t\t50D360D0186819DB00828878 /* UICheckBoxTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UICheckBoxTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360D1186819DB00828878 /* UICheckBoxTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICheckBoxTest.h; sourceTree = \"<group>\"; };\n\t\t50D360D3186819DB00828878 /* UIImageViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIImageViewTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360D4186819DB00828878 /* UIImageViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIImageViewTest.h; sourceTree = \"<group>\"; };\n\t\t50D360D6186819DB00828878 /* UILabelAtlasTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILabelAtlasTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360D7186819DB00828878 /* UILabelAtlasTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILabelAtlasTest.h; sourceTree = \"<group>\"; };\n\t\t50D360D9186819DB00828878 /* UILabelBMFontTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILabelBMFontTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360DA186819DB00828878 /* UILabelBMFontTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILabelBMFontTest.h; sourceTree = \"<group>\"; };\n\t\t50D360DC186819DB00828878 /* UILabelTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILabelTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360DD186819DB00828878 /* UILabelTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILabelTest.h; sourceTree = \"<group>\"; };\n\t\t50D360DF186819DB00828878 /* UILayoutTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360E0186819DB00828878 /* UILayoutTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutTest.h; sourceTree = \"<group>\"; };\n\t\t50D360E2186819DB00828878 /* UIListViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIListViewTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360E3186819DB00828878 /* UIListViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIListViewTest.h; sourceTree = \"<group>\"; };\n\t\t50D360E5186819DB00828878 /* UILoadingBarTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILoadingBarTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360E6186819DB00828878 /* UILoadingBarTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILoadingBarTest.h; sourceTree = \"<group>\"; };\n\t\t50D360E8186819DB00828878 /* UIPageViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIPageViewTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360E9186819DB00828878 /* UIPageViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPageViewTest.h; sourceTree = \"<group>\"; };\n\t\t50D360EA186819DB00828878 /* UIScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScene.cpp; sourceTree = \"<group>\"; };\n\t\t50D360EB186819DB00828878 /* UIScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScene.h; sourceTree = \"<group>\"; };\n\t\t50D360EC186819DB00828878 /* UISceneManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UISceneManager.cpp; sourceTree = \"<group>\"; };\n\t\t50D360ED186819DB00828878 /* UISceneManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISceneManager.h; sourceTree = \"<group>\"; };\n\t\t50D360EF186819DB00828878 /* UIScrollViewTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScrollViewTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360F0186819DB00828878 /* UIScrollViewTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScrollViewTest.h; sourceTree = \"<group>\"; };\n\t\t50D360F2186819DB00828878 /* UISliderTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UISliderTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360F3186819DB00828878 /* UISliderTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISliderTest.h; sourceTree = \"<group>\"; };\n\t\t50D360F5186819DB00828878 /* UITextFieldTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UITextFieldTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360F6186819DB00828878 /* UITextFieldTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UITextFieldTest.h; sourceTree = \"<group>\"; };\n\t\t50D360F8186819DB00828878 /* UIWidgetAddNodeTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidgetAddNodeTest.cpp; sourceTree = \"<group>\"; };\n\t\t50D360F9186819DB00828878 /* UIWidgetAddNodeTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest.h; sourceTree = \"<group>\"; };\n\t\t599121E4182C74AC00CE785B /* NewRendererTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewRendererTest.cpp; sourceTree = \"<group>\"; };\n\t\t599121E5182C74AC00CE785B /* NewRendererTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewRendererTest.h; sourceTree = \"<group>\"; };\n\t\t59A79D5B1821E95C00F19697 /* MouseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseTest.cpp; sourceTree = \"<group>\"; };\n\t\t59A79D5C1821E95C00F19697 /* MouseTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MouseTest.h; sourceTree = \"<group>\"; };\n\t\tA01E16931784BDA100B0CA4A /* Simple Game iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Simple Game iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA01E17721784C06E00B0CA4A /* Test JavaScript iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Test JavaScript iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA01E18571784C45500B0CA4A /* JS Watermelon With Me iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS Watermelon With Me iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA01E188C1784C4D600B0CA4A /* JS Moon Warriors iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS Moon Warriors iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA01E18C11784C4DC00B0CA4A /* JS Crystal Craze iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS Crystal Craze iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA01E18F61784C4E000B0CA4A /* JS CocosDragon iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS CocosDragon iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA035A5EC1782290400987F6C /* Test JavaScript Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Test JavaScript Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA035A71117822E9E00987F6C /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };\n\t\tA035A77D1782301C00987F6C /* JS Watermelon With Me Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS Watermelon With Me Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA035A9F717823FE100987F6C /* JS Moon Warriors Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS Moon Warriors Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA035AAC51782422400987F6C /* JS Crystal Craze Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS Crystal Craze Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA035AC371782453000987F6C /* JS CocosDragon Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"JS CocosDragon Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA035AD76178254A300987F6C /* Simple Game Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Simple Game Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA035AE88178255DC00987F6C /* Hello cpp Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Hello cpp Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA07A52291783A1D20073F6A7 /* Test cpp iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Test cpp iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tA07A52B71783AE6D0073F6A7 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };\n\t\tA07A52B91783AE900073F6A7 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };\n\t\tA07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; };\n\t\tA07A52C11783B01F0073F6A7 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };\n\t\tA07A53811784AC9B0073F6A7 /* Hello cpp iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"Hello cpp iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tB3AF01A8184313DE00A98B85 /* ConvexHull.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConvexHull.h; sourceTree = \"<group>\"; };\n\t\tB3AF01A9184313DE00A98B85 /* ConveyorBelt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConveyorBelt.h; sourceTree = \"<group>\"; };\n\t\tB3AF01AA184313DE00A98B85 /* Mobile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mobile.h; sourceTree = \"<group>\"; };\n\t\tB3AF01AB184313DE00A98B85 /* MobileBalanced.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileBalanced.h; sourceTree = \"<group>\"; };\n\t\tB3AF01AC184313DE00A98B85 /* MotorJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MotorJoint.h; sourceTree = \"<group>\"; };\n\t\tD60AE43317F7FFE100757E4B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };\n\t\tED3674B3187FA6BF0038ECFC /* PerformanceRendererTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceRendererTest.h; sourceTree = \"<group>\"; };\n\t\tED3674B8187FA7020038ECFC /* PerformanceRendererTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceRendererTest.cpp; sourceTree = \"<group>\"; };\n\t\tEDCC747E17C455FD007B692C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t1A1197C91785363400D62A44 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C5666180E8E0700EF57C3 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1A8C5667180E8E0700EF57C3 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1A8C5668180E8E0700EF57C3 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1A8C5669180E8E0700EF57C3 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t1A8C566A180E8E0700EF57C3 /* libluabindings iOS.a in Frameworks */,\n\t\t\t\tD6408CB01806515200FB5B4C /* CoreMotion.framework in Frameworks */,\n\t\t\t\t1A1197CB1785363400D62A44 /* libz.dylib in Frameworks */,\n\t\t\t\t1A1197CC1785363400D62A44 /* OpenGLES.framework in Frameworks */,\n\t\t\t\t1A1197CD1785363400D62A44 /* Foundation.framework in Frameworks */,\n\t\t\t\t1A1197CE1785363400D62A44 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\t1A1197CF1785363400D62A44 /* OpenAL.framework in Frameworks */,\n\t\t\t\t1A1197D01785363400D62A44 /* QuartzCore.framework in Frameworks */,\n\t\t\t\t1A1197D11785363400D62A44 /* CoreGraphics.framework in Frameworks */,\n\t\t\t\t1A1197D21785363400D62A44 /* UIKit.framework in Frameworks */,\n\t\t\t\t1A1197D31785363400D62A44 /* AVFoundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A11985F178538E400D62A44 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C5899180E8F8F00EF57C3 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1A8C589A180E8F8F00EF57C3 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1A8C589B180E8F8F00EF57C3 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1A8C589C180E8F8F00EF57C3 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t1A8C589D180E8F8F00EF57C3 /* libluabindings iOS.a in Frameworks */,\n\t\t\t\tD60AE43717F9142200757E4B /* CoreMotion.framework in Frameworks */,\n\t\t\t\t1A119864178538E400D62A44 /* libz.dylib in Frameworks */,\n\t\t\t\t1A119865178538E400D62A44 /* OpenGLES.framework in Frameworks */,\n\t\t\t\t1A119866178538E400D62A44 /* Foundation.framework in Frameworks */,\n\t\t\t\t1A119867178538E400D62A44 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\t1A119868178538E400D62A44 /* OpenAL.framework in Frameworks */,\n\t\t\t\t1A119869178538E400D62A44 /* QuartzCore.framework in Frameworks */,\n\t\t\t\t1A11986A178538E400D62A44 /* CoreGraphics.framework in Frameworks */,\n\t\t\t\t1A11986B178538E400D62A44 /* UIKit.framework in Frameworks */,\n\t\t\t\t1A11986C178538E400D62A44 /* AVFoundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB55A17854FE400CDF010 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C55C4180E8BBB00EF57C3 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A8C55C5180E8BBB00EF57C3 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1A8C55C6180E8BBB00EF57C3 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1A8C55C7180E8BBB00EF57C3 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t1A8C55C8180E8BBB00EF57C3 /* libluabindings Mac.a in Frameworks */,\n\t\t\t\t1A6FB59D1785528E00CDF010 /* libz.dylib in Frameworks */,\n\t\t\t\t1A6FB59C1785528700CDF010 /* libcurl.dylib in Frameworks */,\n\t\t\t\t1A6FB59B1785527300CDF010 /* ApplicationServices.framework in Frameworks */,\n\t\t\t\t1A6FB59A1785526C00CDF010 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\t1A6FB5991785526500CDF010 /* Foundation.framework in Frameworks */,\n\t\t\t\t1A6FB5981785525300CDF010 /* Cocoa.framework in Frameworks */,\n\t\t\t\t1A6FB5971785524D00CDF010 /* OpenGL.framework in Frameworks */,\n\t\t\t\t1A6FB5961785524600CDF010 /* QuartzCore.framework in Frameworks */,\n\t\t\t\t1A6FB5951785523D00CDF010 /* OpenAL.framework in Frameworks */,\n\t\t\t\tED743D1D17D09CD40004076B /* IOKit.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB7A21785614200CDF010 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C588A180E8F7600EF57C3 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A8C588B180E8F7600EF57C3 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1A8C588C180E8F7600EF57C3 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1A8C588D180E8F7600EF57C3 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t1A8C588E180E8F7600EF57C3 /* libluabindings Mac.a in Frameworks */,\n\t\t\t\t1A6FB7A71785614200CDF010 /* libz.dylib in Frameworks */,\n\t\t\t\t1A6FB7A81785614200CDF010 /* libcurl.dylib in Frameworks */,\n\t\t\t\t1A6FB7A91785614200CDF010 /* ApplicationServices.framework in Frameworks */,\n\t\t\t\t1A6FB7AA1785614200CDF010 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\t1A6FB7AB1785614200CDF010 /* Foundation.framework in Frameworks */,\n\t\t\t\t1A6FB7AC1785614200CDF010 /* Cocoa.framework in Frameworks */,\n\t\t\t\t1A6FB7AD1785614200CDF010 /* OpenGL.framework in Frameworks */,\n\t\t\t\t1A6FB7AE1785614200CDF010 /* QuartzCore.framework in Frameworks */,\n\t\t\t\t1A6FB7AF1785614200CDF010 /* OpenAL.framework in Frameworks */,\n\t\t\t\tED743D1E17D09D070004076B /* IOKit.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1D60588F0D05DD3D006BFB54 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF534B180E2F4E000584C8 /* libbox2d Mac.a in Frameworks */,\n\t\t\t\t1AAF534C180E2F4E000584C8 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1AAF534D180E2F4E000584C8 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1AAF534E180E2F4E000584C8 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1AAF534F180E2F4E000584C8 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\tEDCC747F17C455FD007B692C /* IOKit.framework in Frameworks */,\n\t\t\t\t1A9F808D177E98A600D9A1CB /* libcurl.dylib in Frameworks */,\n\t\t\t\t15C6482F165F399D007D4F18 /* libz.dylib in Frameworks */,\n\t\t\t\t15C64833165F3AFD007D4F18 /* Foundation.framework in Frameworks */,\n\t\t\t\t15C6482D165F3988007D4F18 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\t15C6482B165F3979007D4F18 /* ApplicationServices.framework in Frameworks */,\n\t\t\t\t15C64829165F396B007D4F18 /* OpenAL.framework in Frameworks */,\n\t\t\t\t15C64827165F394E007D4F18 /* QuartzCore.framework in Frameworks */,\n\t\t\t\t15C64825165F3934007D4F18 /* OpenGL.framework in Frameworks */,\n\t\t\t\tA05FCACA177C124500BE600E /* Cocoa.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E16841784BDA100B0CA4A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E45DF18080238000CDD6D /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t460E45E018080238000CDD6D /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\tD6408CAB1806510600FB5B4C /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA01E16881784BDA100B0CA4A /* libz.dylib in Frameworks */,\n\t\t\t\tA01E16891784BDA100B0CA4A /* Foundation.framework in Frameworks */,\n\t\t\t\tA01E168A1784BDA100B0CA4A /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA01E168D1784BDA100B0CA4A /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA01E169B1784BE2400B0CA4A /* AVFoundation.framework in Frameworks */,\n\t\t\t\tA01E169C1784BE2800B0CA4A /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA01E169D1784BE2C00B0CA4A /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA01E169E1784BE3200B0CA4A /* UIKit.framework in Frameworks */,\n\t\t\t\tA01E169F1784BE3A00B0CA4A /* OpenAL.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E17601784C06E00B0CA4A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A9DCA60180E7453007A3AD4 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1A9DCA61180E7453007A3AD4 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1A9DCA62180E7453007A3AD4 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1A9DCA63180E7453007A3AD4 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t1A9DCA64180E7453007A3AD4 /* libjsbindings iOS.a in Frameworks */,\n\t\t\t\tD60AE43817F9143D00757E4B /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA01E17661784C06E00B0CA4A /* libz.dylib in Frameworks */,\n\t\t\t\tA01E17671784C06E00B0CA4A /* Foundation.framework in Frameworks */,\n\t\t\t\tA01E17681784C06E00B0CA4A /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA01E17691784C06E00B0CA4A /* OpenAL.framework in Frameworks */,\n\t\t\t\tA01E176A1784C06E00B0CA4A /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA01E176B1784C06E00B0CA4A /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA01E176C1784C06E00B0CA4A /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA01E176D1784C06E00B0CA4A /* UIKit.framework in Frameworks */,\n\t\t\t\tA01E176E1784C06E00B0CA4A /* AVFoundation.framework in Frameworks */,\n\t\t\t\tA01E18F81784C59400B0CA4A /* libsqlite3.dylib in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18431784C45400B0CA4A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E8F180E804F00497A22 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1A3B1E90180E804F00497A22 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1A3B1E91180E804F00497A22 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1A3B1E92180E804F00497A22 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t1A3B1E93180E804F00497A22 /* libjsbindings iOS.a in Frameworks */,\n\t\t\t\tD6408CAC1806511F00FB5B4C /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA01E184B1784C45400B0CA4A /* libz.dylib in Frameworks */,\n\t\t\t\tA01E18F91784C59400B0CA4A /* libsqlite3.dylib in Frameworks */,\n\t\t\t\tA01E184C1784C45400B0CA4A /* Foundation.framework in Frameworks */,\n\t\t\t\tA01E184D1784C45400B0CA4A /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA01E184E1784C45400B0CA4A /* OpenAL.framework in Frameworks */,\n\t\t\t\tA01E184F1784C45400B0CA4A /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA01E18501784C45400B0CA4A /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA01E18511784C45400B0CA4A /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA01E18521784C45400B0CA4A /* UIKit.framework in Frameworks */,\n\t\t\t\tA01E18531784C45400B0CA4A /* AVFoundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18781784C4D600B0CA4A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E14180E7E2700497A22 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1A3B1E15180E7E2700497A22 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1A3B1E16180E7E2700497A22 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1A3B1E17180E7E2700497A22 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t1A3B1E18180E7E2700497A22 /* libjsbindings iOS.a in Frameworks */,\n\t\t\t\tD6408CAD1806512D00FB5B4C /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA01E18801784C4D600B0CA4A /* libz.dylib in Frameworks */,\n\t\t\t\tA01E18811784C4D600B0CA4A /* Foundation.framework in Frameworks */,\n\t\t\t\tA01E18821784C4D600B0CA4A /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA01E18831784C4D600B0CA4A /* OpenAL.framework in Frameworks */,\n\t\t\t\tA01E18841784C4D600B0CA4A /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA01E18851784C4D600B0CA4A /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA01E18861784C4D600B0CA4A /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA01E18871784C4D600B0CA4A /* UIKit.framework in Frameworks */,\n\t\t\t\tA01E18881784C4D600B0CA4A /* AVFoundation.framework in Frameworks */,\n\t\t\t\tA01E18FA1784C59400B0CA4A /* libsqlite3.dylib in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18AD1784C4DC00B0CA4A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1F43180E82DC00497A22 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1A3B1F44180E82DC00497A22 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1A3B1F45180E82DC00497A22 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1A3B1F46180E82DC00497A22 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t1A3B1F47180E82DC00497A22 /* libjsbindings iOS.a in Frameworks */,\n\t\t\t\tD6408CAE1806513A00FB5B4C /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA01E18B51784C4DC00B0CA4A /* libz.dylib in Frameworks */,\n\t\t\t\tA01E18B61784C4DC00B0CA4A /* Foundation.framework in Frameworks */,\n\t\t\t\tA01E18B71784C4DC00B0CA4A /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA01E18B81784C4DC00B0CA4A /* OpenAL.framework in Frameworks */,\n\t\t\t\tA01E18B91784C4DC00B0CA4A /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA01E18BA1784C4DC00B0CA4A /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA01E18BB1784C4DC00B0CA4A /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA01E18BC1784C4DC00B0CA4A /* UIKit.framework in Frameworks */,\n\t\t\t\tA01E18BD1784C4DC00B0CA4A /* AVFoundation.framework in Frameworks */,\n\t\t\t\tA01E18FB1784C59500B0CA4A /* libsqlite3.dylib in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18E21784C4E000B0CA4A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1EEB180E81B500497A22 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1A3B1EEC180E81B500497A22 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1A3B1EED180E81B500497A22 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1A3B1EEE180E81B500497A22 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t1A3B1EEF180E81B500497A22 /* libjsbindings iOS.a in Frameworks */,\n\t\t\t\tD6408CAF1806514400FB5B4C /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA01E18EA1784C4E000B0CA4A /* libz.dylib in Frameworks */,\n\t\t\t\tA01E18EB1784C4E000B0CA4A /* Foundation.framework in Frameworks */,\n\t\t\t\tA01E18EC1784C4E000B0CA4A /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA01E18ED1784C4E000B0CA4A /* OpenAL.framework in Frameworks */,\n\t\t\t\tA01E18EE1784C4E000B0CA4A /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA01E18EF1784C4E000B0CA4A /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA01E18F01784C4E000B0CA4A /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA01E18F11784C4E000B0CA4A /* UIKit.framework in Frameworks */,\n\t\t\t\tA01E18F21784C4E000B0CA4A /* AVFoundation.framework in Frameworks */,\n\t\t\t\tA01E18FC1784C59500B0CA4A /* libsqlite3.dylib in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A5DA1782290400987F6C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A9DC9F1180E68D8007A3AD4 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A9DC9F2180E68D8007A3AD4 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1A9DC9F3180E68D8007A3AD4 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1A9DC9F4180E68D8007A3AD4 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t1A9DC9F5180E68D8007A3AD4 /* libjsbindings Mac.a in Frameworks */,\n\t\t\t\tA035A71217822E9E00987F6C /* libsqlite3.dylib in Frameworks */,\n\t\t\t\tA035A5E01782290400987F6C /* libcurl.dylib in Frameworks */,\n\t\t\t\tA035A5E11782290400987F6C /* libz.dylib in Frameworks */,\n\t\t\t\tA035A5E21782290400987F6C /* Foundation.framework in Frameworks */,\n\t\t\t\tA035A5E31782290400987F6C /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA035A5E41782290400987F6C /* ApplicationServices.framework in Frameworks */,\n\t\t\t\tA035A5E51782290400987F6C /* OpenAL.framework in Frameworks */,\n\t\t\t\tA035A5E61782290400987F6C /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA035A5E71782290400987F6C /* OpenGL.framework in Frameworks */,\n\t\t\t\tED743D1717D099F10004076B /* IOKit.framework in Frameworks */,\n\t\t\t\tA035A5E81782290400987F6C /* Cocoa.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A76A1782301C00987F6C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E79180E7F6B00497A22 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A3B1E7A180E7F6B00497A22 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1A3B1E7B180E7F6B00497A22 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1A3B1E7C180E7F6B00497A22 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t1A3B1E7D180E7F6B00497A22 /* libjsbindings Mac.a in Frameworks */,\n\t\t\t\tED743D1917D09A390004076B /* IOKit.framework in Frameworks */,\n\t\t\t\tA035A7701782301C00987F6C /* libsqlite3.dylib in Frameworks */,\n\t\t\t\tA035A7711782301C00987F6C /* libcurl.dylib in Frameworks */,\n\t\t\t\tA035A7721782301C00987F6C /* libz.dylib in Frameworks */,\n\t\t\t\tA035A7731782301C00987F6C /* Foundation.framework in Frameworks */,\n\t\t\t\tA035A7741782301C00987F6C /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA035A7751782301C00987F6C /* ApplicationServices.framework in Frameworks */,\n\t\t\t\tA035A7761782301C00987F6C /* OpenAL.framework in Frameworks */,\n\t\t\t\tA035A7771782301C00987F6C /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA035A7781782301C00987F6C /* OpenGL.framework in Frameworks */,\n\t\t\t\tA035A7791782301C00987F6C /* Cocoa.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A9E417823FE100987F6C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1DF2180E7CAF00497A22 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A3B1DF3180E7CAF00497A22 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1A3B1DF4180E7CAF00497A22 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1A3B1DF5180E7CAF00497A22 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t1A3B1DF6180E7CAF00497A22 /* libjsbindings Mac.a in Frameworks */,\n\t\t\t\tA035A9EA17823FE100987F6C /* libsqlite3.dylib in Frameworks */,\n\t\t\t\tA035A9EB17823FE100987F6C /* libcurl.dylib in Frameworks */,\n\t\t\t\tA035A9EC17823FE100987F6C /* libz.dylib in Frameworks */,\n\t\t\t\tA035A9ED17823FE100987F6C /* Foundation.framework in Frameworks */,\n\t\t\t\tA035A9EE17823FE100987F6C /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA035A9EF17823FE100987F6C /* ApplicationServices.framework in Frameworks */,\n\t\t\t\tA035A9F017823FE100987F6C /* OpenAL.framework in Frameworks */,\n\t\t\t\tA035A9F117823FE100987F6C /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA035A9F217823FE100987F6C /* OpenGL.framework in Frameworks */,\n\t\t\t\tA035A9F317823FE100987F6C /* Cocoa.framework in Frameworks */,\n\t\t\t\tED743D1A17D09A730004076B /* IOKit.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AAB21782422400987F6C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1F34180E82C800497A22 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A3B1F35180E82C800497A22 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1A3B1F36180E82C800497A22 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1A3B1F37180E82C800497A22 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t1A3B1F38180E82C800497A22 /* libjsbindings Mac.a in Frameworks */,\n\t\t\t\tA035AAB81782422400987F6C /* libsqlite3.dylib in Frameworks */,\n\t\t\t\tA035AAB91782422400987F6C /* libcurl.dylib in Frameworks */,\n\t\t\t\tA035AABA1782422400987F6C /* libz.dylib in Frameworks */,\n\t\t\t\tA035AABB1782422400987F6C /* Foundation.framework in Frameworks */,\n\t\t\t\tA035AABC1782422400987F6C /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA035AABD1782422400987F6C /* ApplicationServices.framework in Frameworks */,\n\t\t\t\tA035AABE1782422400987F6C /* OpenAL.framework in Frameworks */,\n\t\t\t\tA035AABF1782422400987F6C /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA035AAC01782422400987F6C /* OpenGL.framework in Frameworks */,\n\t\t\t\tA035AAC11782422400987F6C /* Cocoa.framework in Frameworks */,\n\t\t\t\tED743D1B17D09AAE0004076B /* IOKit.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AC241782453000987F6C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1EDC180E811D00497A22 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t1A3B1EDD180E811D00497A22 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t1A3B1EDE180E811D00497A22 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t1A3B1EDF180E811D00497A22 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t1A3B1EE0180E811D00497A22 /* libjsbindings Mac.a in Frameworks */,\n\t\t\t\tA035AC2A1782453000987F6C /* libsqlite3.dylib in Frameworks */,\n\t\t\t\tA035AC2B1782453000987F6C /* libcurl.dylib in Frameworks */,\n\t\t\t\tA035AC2C1782453000987F6C /* libz.dylib in Frameworks */,\n\t\t\t\tED743D1C17D09C990004076B /* IOKit.framework in Frameworks */,\n\t\t\t\tA035AC2D1782453000987F6C /* Foundation.framework in Frameworks */,\n\t\t\t\tA035AC2E1782453000987F6C /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA035AC2F1782453000987F6C /* ApplicationServices.framework in Frameworks */,\n\t\t\t\tA035AC301782453000987F6C /* OpenAL.framework in Frameworks */,\n\t\t\t\tA035AC311782453000987F6C /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA035AC321782453000987F6C /* OpenGL.framework in Frameworks */,\n\t\t\t\tA035AC331782453000987F6C /* Cocoa.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AD64178254A300987F6C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E45861807FDC3000CDD6D /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t460E45871807FDC3000CDD6D /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\tA035AD6A178254A300987F6C /* libcurl.dylib in Frameworks */,\n\t\t\t\tA035AD6B178254A300987F6C /* libz.dylib in Frameworks */,\n\t\t\t\tA035AD6C178254A300987F6C /* Foundation.framework in Frameworks */,\n\t\t\t\tA035AD6D178254A300987F6C /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA035AD6E178254A300987F6C /* ApplicationServices.framework in Frameworks */,\n\t\t\t\tA035AD6F178254A300987F6C /* OpenAL.framework in Frameworks */,\n\t\t\t\tA035AD70178254A300987F6C /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA035AD71178254A300987F6C /* OpenGL.framework in Frameworks */,\n\t\t\t\tA035AD72178254A300987F6C /* Cocoa.framework in Frameworks */,\n\t\t\t\tED743D1617D098B60004076B /* IOKit.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AE79178255DC00987F6C /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E44FD1807E413000CDD6D /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\tA035AE7C178255DC00987F6C /* libcurl.dylib in Frameworks */,\n\t\t\t\tA035AE7D178255DC00987F6C /* libz.dylib in Frameworks */,\n\t\t\t\tA035AE7E178255DC00987F6C /* Foundation.framework in Frameworks */,\n\t\t\t\tA035AE7F178255DC00987F6C /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA035AE80178255DC00987F6C /* ApplicationServices.framework in Frameworks */,\n\t\t\t\tA035AE81178255DC00987F6C /* OpenAL.framework in Frameworks */,\n\t\t\t\tA035AE82178255DC00987F6C /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA035AE83178255DC00987F6C /* OpenGL.framework in Frameworks */,\n\t\t\t\tA035AE84178255DC00987F6C /* Cocoa.framework in Frameworks */,\n\t\t\t\tED743D1517D098AF0004076B /* IOKit.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A52171783A1D20073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF53FE180E39D4000584C8 /* libbox2d iOS.a in Frameworks */,\n\t\t\t\t1AAF53FF180E39D4000584C8 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t1AAF5400180E39D4000584C8 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t1AAF5401180E39D4000584C8 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t1AAF5402180E39D4000584C8 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\tD60AE43417F7FFE100757E4B /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA07A521E1783A1D20073F6A7 /* libz.dylib in Frameworks */,\n\t\t\t\tA07A521F1783A1D20073F6A7 /* Foundation.framework in Frameworks */,\n\t\t\t\tA07A52201783A1D20073F6A7 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA07A52221783A1D20073F6A7 /* OpenAL.framework in Frameworks */,\n\t\t\t\tA07A52231783A1D20073F6A7 /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA07A52BE1783AF1E0073F6A7 /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA07A52BF1783AF210073F6A7 /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA07A52C01783AF250073F6A7 /* UIKit.framework in Frameworks */,\n\t\t\t\tA07A52C31783B02C0073F6A7 /* AVFoundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A536F1784AC9B0073F6A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E44BB1807DDC2000CDD6D /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\tD6408CA8180650F200FB5B4C /* CoreMotion.framework in Frameworks */,\n\t\t\t\tA07A53751784AC9B0073F6A7 /* libz.dylib in Frameworks */,\n\t\t\t\tA07A537B1784AC9B0073F6A7 /* OpenGLES.framework in Frameworks */,\n\t\t\t\tA07A53761784AC9B0073F6A7 /* Foundation.framework in Frameworks */,\n\t\t\t\tA07A53771784AC9B0073F6A7 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tA07A53781784AC9B0073F6A7 /* OpenAL.framework in Frameworks */,\n\t\t\t\tA07A53791784AC9B0073F6A7 /* QuartzCore.framework in Frameworks */,\n\t\t\t\tA07A537A1784AC9B0073F6A7 /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tA07A537C1784AC9B0073F6A7 /* UIKit.framework in Frameworks */,\n\t\t\t\tA07A537D1784AC9B0073F6A7 /* AVFoundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t19C28FACFE9D520D11CA2CBB /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1D6058910D05DD3D006BFB54 /* Test cpp Mac.app */,\n\t\t\t\tA035A5EC1782290400987F6C /* Test JavaScript Mac.app */,\n\t\t\t\tA035A77D1782301C00987F6C /* JS Watermelon With Me Mac.app */,\n\t\t\t\tA035A9F717823FE100987F6C /* JS Moon Warriors Mac.app */,\n\t\t\t\tA035AAC51782422400987F6C /* JS Crystal Craze Mac.app */,\n\t\t\t\tA035AC371782453000987F6C /* JS CocosDragon Mac.app */,\n\t\t\t\tA035AD76178254A300987F6C /* Simple Game Mac.app */,\n\t\t\t\tA035AE88178255DC00987F6C /* Hello cpp Mac.app */,\n\t\t\t\tA07A52291783A1D20073F6A7 /* Test cpp iOS.app */,\n\t\t\t\tA07A53811784AC9B0073F6A7 /* Hello cpp iOS.app */,\n\t\t\t\tA01E16931784BDA100B0CA4A /* Simple Game iOS.app */,\n\t\t\t\tA01E17721784C06E00B0CA4A /* Test JavaScript iOS.app */,\n\t\t\t\tA01E18571784C45500B0CA4A /* JS Watermelon With Me iOS.app */,\n\t\t\t\tA01E188C1784C4D600B0CA4A /* JS Moon Warriors iOS.app */,\n\t\t\t\tA01E18C11784C4DC00B0CA4A /* JS Crystal Craze iOS.app */,\n\t\t\t\tA01E18F61784C4E000B0CA4A /* JS CocosDragon iOS.app */,\n\t\t\t\t1A1197D71785363400D62A44 /* Hello lua iOS.app */,\n\t\t\t\t1A119870178538E400D62A44 /* Test lua iOS.app */,\n\t\t\t\t1A6FB56B17854FE400CDF010 /* Hello lua Mac.app */,\n\t\t\t\t1A6FB7B31785614200CDF010 /* Test lua Mac.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1DAF180E7C3400497A22 /* MoonWarriors */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1DB0180E7C4700497A22 /* Classes */,\n\t\t\t\t1A3B1DB5180E7C5100497A22 /* proj.ios */,\n\t\t\t\t1A3B1DDB180E7C5C00497A22 /* proj.mac */,\n\t\t\t\t1A3B1DF7180E7CF700497A22 /* Resources */,\n\t\t\t);\n\t\t\tname = MoonWarriors;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1DB0180E7C4700497A22 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1DB1180E7C4700497A22 /* AppDelegate.cpp */,\n\t\t\t\t1A3B1DB2180E7C4700497A22 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Javascript/MoonWarriors/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1DB5180E7C5100497A22 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1DB6180E7C5100497A22 /* AppController.h */,\n\t\t\t\t1A3B1DB7180E7C5100497A22 /* AppController.mm */,\n\t\t\t\t1A3B1DB8180E7C5100497A22 /* Default-568h@2x.png */,\n\t\t\t\t1A3B1DB9180E7C5100497A22 /* Default.png */,\n\t\t\t\t1A3B1DBA180E7C5100497A22 /* Default@2x.png */,\n\t\t\t\t1A3B1DBB180E7C5100497A22 /* Icon-120.png */,\n\t\t\t\t1A3B1DBC180E7C5100497A22 /* Icon-144.png */,\n\t\t\t\t1A3B1DBD180E7C5100497A22 /* Icon-152.png */,\n\t\t\t\t1A3B1DBE180E7C5100497A22 /* Icon-72.png */,\n\t\t\t\t1A3B1DBF180E7C5100497A22 /* Icon-76.png */,\n\t\t\t\t1A3B1DC0180E7C5100497A22 /* Icon-Small-50.png */,\n\t\t\t\t1A3B1DC1180E7C5100497A22 /* Icon-Small.png */,\n\t\t\t\t1A3B1DC2180E7C5100497A22 /* Icon-Small@2x.png */,\n\t\t\t\t1A3B1DC3180E7C5100497A22 /* Icon.png */,\n\t\t\t\t1A3B1DC4180E7C5100497A22 /* Icon@2x.png */,\n\t\t\t\t1A3B1DC5180E7C5100497A22 /* Info.plist */,\n\t\t\t\t1A3B1DC6180E7C5100497A22 /* main.m */,\n\t\t\t\t1A3B1DC7180E7C5100497A22 /* Prefix.pch */,\n\t\t\t\t1A3B1DC8180E7C5100497A22 /* RootViewController.h */,\n\t\t\t\t1A3B1DC9180E7C5100497A22 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Javascript/MoonWarriors/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1DDB180E7C5C00497A22 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1DDC180E7C5C00497A22 /* InfoPlist.strings */,\n\t\t\t\t1A3B1DDE180E7C5C00497A22 /* MainMenu.xib */,\n\t\t\t\t1A3B1DE0180E7C5C00497A22 /* Icon.icns */,\n\t\t\t\t1A3B1DE1180E7C5C00497A22 /* Info.plist */,\n\t\t\t\t1A3B1DE2180E7C5C00497A22 /* main.cpp */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Javascript/MoonWarriors/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1DF7180E7CF700497A22 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1DF8180E7D2200497A22 /* MoonWarriors-jsb.js */,\n\t\t\t\t1A3B1DF9180E7D2200497A22 /* res */,\n\t\t\t\t1A3B1DFA180E7D2200497A22 /* src */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E1A180E7ED800497A22 /* WatermelonWithMe */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E3D180E7F1500497A22 /* Classes */,\n\t\t\t\t1A3B1E42180E7F1E00497A22 /* proj.ios */,\n\t\t\t\t1A3B1E62180E7F2400497A22 /* proj.mac */,\n\t\t\t\t1A3B1E1B180E7EE400497A22 /* Resources */,\n\t\t\t);\n\t\t\tname = WatermelonWithMe;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E1B180E7EE400497A22 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E1C180E7EFA00497A22 /* boot-html5.js */,\n\t\t\t\t1A3B1E1D180E7EFA00497A22 /* boot-jsb.js */,\n\t\t\t\t1A3B1E1E180E7EFA00497A22 /* index.html */,\n\t\t\t\t1A3B1E1F180E7EFA00497A22 /* levels.js */,\n\t\t\t\t1A3B1E20180E7EFA00497A22 /* main.js */,\n\t\t\t\t1A3B1E21180E7EFA00497A22 /* Platform */,\n\t\t\t\t1A3B1E22180E7EFA00497A22 /* res */,\n\t\t\t\t1A3B1E23180E7EFA00497A22 /* resources-html5.js */,\n\t\t\t\t1A3B1E24180E7EFA00497A22 /* resources-jsb.js */,\n\t\t\t\t1A3B1E25180E7EFA00497A22 /* watermelon_with_me.js */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E3D180E7F1500497A22 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E3E180E7F1500497A22 /* AppDelegate.cpp */,\n\t\t\t\t1A3B1E3F180E7F1500497A22 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Javascript/WatermelonWithMe/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E42180E7F1E00497A22 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E43180E7F1E00497A22 /* AppController.h */,\n\t\t\t\t1A3B1E44180E7F1E00497A22 /* AppController.mm */,\n\t\t\t\t1A3B1E45180E7F1E00497A22 /* Default-568h@2x.png */,\n\t\t\t\t1A3B1E46180E7F1E00497A22 /* Default.png */,\n\t\t\t\t1A3B1E47180E7F1E00497A22 /* Default@2x.png */,\n\t\t\t\t1A3B1E48180E7F1E00497A22 /* Icon-114.png */,\n\t\t\t\t1A3B1E49180E7F1E00497A22 /* Icon-120.png */,\n\t\t\t\t1A3B1E4A180E7F1E00497A22 /* Icon-144.png */,\n\t\t\t\t1A3B1E4B180E7F1E00497A22 /* Icon-152.png */,\n\t\t\t\t1A3B1E4C180E7F1E00497A22 /* Icon-57.png */,\n\t\t\t\t1A3B1E4D180E7F1E00497A22 /* Icon-72.png */,\n\t\t\t\t1A3B1E4E180E7F1E00497A22 /* Icon-76.png */,\n\t\t\t\t1A3B1E4F180E7F1E00497A22 /* Info.plist */,\n\t\t\t\t1A3B1E50180E7F1E00497A22 /* main.m */,\n\t\t\t\t1A3B1E51180E7F1E00497A22 /* Prefix.pch */,\n\t\t\t\t1A3B1E52180E7F1E00497A22 /* RootViewController.h */,\n\t\t\t\t1A3B1E53180E7F1E00497A22 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Javascript/WatermelonWithMe/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E62180E7F2400497A22 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E63180E7F2400497A22 /* InfoPlist.strings */,\n\t\t\t\t1A3B1E65180E7F2400497A22 /* MainMenu.xib */,\n\t\t\t\t1A3B1E67180E7F2400497A22 /* Icon.icns */,\n\t\t\t\t1A3B1E68180E7F2400497A22 /* Info.plist */,\n\t\t\t\t1A3B1E69180E7F2400497A22 /* main.cpp */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Javascript/WatermelonWithMe/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E9B180E809F00497A22 /* CocosDragonJS */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E9C180E80B600497A22 /* Classes */,\n\t\t\t\t1A3B1EA1180E80BD00497A22 /* proj.ios */,\n\t\t\t\t1A3B1EC1180E80C700497A22 /* proj.mac */,\n\t\t\t\t1A3B1ECE180E80CE00497A22 /* Resources */,\n\t\t\t);\n\t\t\tname = CocosDragonJS;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E9C180E80B600497A22 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E9D180E80B600497A22 /* AppDelegate.cpp */,\n\t\t\t\t1A3B1E9E180E80B600497A22 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Javascript/CocosDragonJS/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EA1180E80BD00497A22 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EA2180E80BD00497A22 /* AppController.h */,\n\t\t\t\t1A3B1EA3180E80BD00497A22 /* AppController.mm */,\n\t\t\t\t1A3B1EA4180E80BD00497A22 /* Default-568h@2x.png */,\n\t\t\t\t1A3B1EA5180E80BD00497A22 /* Default.png */,\n\t\t\t\t1A3B1EA6180E80BD00497A22 /* Default@2x.png */,\n\t\t\t\t1A3B1EA7180E80BD00497A22 /* Icon-114.png */,\n\t\t\t\t1A3B1EA8180E80BD00497A22 /* Icon-120.png */,\n\t\t\t\t1A3B1EA9180E80BD00497A22 /* Icon-144.png */,\n\t\t\t\t1A3B1EAA180E80BD00497A22 /* Icon-152.png */,\n\t\t\t\t1A3B1EAB180E80BD00497A22 /* Icon-57.png */,\n\t\t\t\t1A3B1EAC180E80BD00497A22 /* Icon-72.png */,\n\t\t\t\t1A3B1EAD180E80BD00497A22 /* Icon-76.png */,\n\t\t\t\t1A3B1EAE180E80BD00497A22 /* Info.plist */,\n\t\t\t\t1A3B1EAF180E80BD00497A22 /* main.m */,\n\t\t\t\t1A3B1EB0180E80BD00497A22 /* Prefix.pch */,\n\t\t\t\t1A3B1EB1180E80BD00497A22 /* RootViewController.h */,\n\t\t\t\t1A3B1EB2180E80BD00497A22 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Javascript/CocosDragonJS/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EC1180E80C700497A22 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EC2180E80C700497A22 /* InfoPlist.strings */,\n\t\t\t\t1A3B1EC4180E80C700497A22 /* MainMenu.xib */,\n\t\t\t\t1A3B1EC6180E80C700497A22 /* Icon.icns */,\n\t\t\t\t1A3B1EC7180E80C700497A22 /* Info.plist */,\n\t\t\t\t1A3B1EC8180E80C700497A22 /* main.cpp */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Javascript/CocosDragonJS/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1ECE180E80CE00497A22 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1ECF180E80E200497A22 /* Published files iOS */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EF0180E822B00497A22 /* CrystalCraze */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EF8180E828300497A22 /* Classes */,\n\t\t\t\t1A3B1EFD180E828E00497A22 /* proj.ios */,\n\t\t\t\t1A3B1F1D180E829600497A22 /* proj.mac */,\n\t\t\t\t1A3B1EF1180E823500497A22 /* Resources */,\n\t\t\t);\n\t\t\tname = CrystalCraze;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EF1180E823500497A22 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EF2180E826E00497A22 /* Published-iOS */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EF8180E828300497A22 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EF9180E828300497A22 /* AppDelegate.cpp */,\n\t\t\t\t1A3B1EFA180E828300497A22 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Javascript/CrystalCraze/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EFD180E828E00497A22 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EFE180E828E00497A22 /* AppController.h */,\n\t\t\t\t1A3B1EFF180E828E00497A22 /* AppController.mm */,\n\t\t\t\t1A3B1F00180E828E00497A22 /* Default-568h@2x.png */,\n\t\t\t\t1A3B1F01180E828E00497A22 /* Default.png */,\n\t\t\t\t1A3B1F02180E828E00497A22 /* Default@2x.png */,\n\t\t\t\t1A3B1F03180E828E00497A22 /* Icon-114.png */,\n\t\t\t\t1A3B1F04180E828E00497A22 /* Icon-120.png */,\n\t\t\t\t1A3B1F05180E828E00497A22 /* Icon-144.png */,\n\t\t\t\t1A3B1F06180E828E00497A22 /* Icon-152.png */,\n\t\t\t\t1A3B1F07180E828E00497A22 /* Icon-57.png */,\n\t\t\t\t1A3B1F08180E828E00497A22 /* Icon-72.png */,\n\t\t\t\t1A3B1F09180E828E00497A22 /* Icon-76.png */,\n\t\t\t\t1A3B1F0A180E828E00497A22 /* Info.plist */,\n\t\t\t\t1A3B1F0B180E828E00497A22 /* main.m */,\n\t\t\t\t1A3B1F0C180E828E00497A22 /* Prefix.pch */,\n\t\t\t\t1A3B1F0D180E828E00497A22 /* RootViewController.h */,\n\t\t\t\t1A3B1F0E180E828E00497A22 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Javascript/CrystalCraze/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F1D180E829600497A22 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1F1E180E829600497A22 /* InfoPlist.strings */,\n\t\t\t\t1A3B1F20180E829600497A22 /* MainMenu.xib */,\n\t\t\t\t1A3B1F22180E829600497A22 /* Icon.icns */,\n\t\t\t\t1A3B1F23180E829600497A22 /* Info.plist */,\n\t\t\t\t1A3B1F24180E829600497A22 /* main.cpp */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Javascript/CrystalCraze/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F48180E85E100497A22 /* HelloLua */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C552F180E8B1C00EF57C3 /* Classes */,\n\t\t\t\t1A8C5538180E8B3D00EF57C3 /* proj.ios */,\n\t\t\t\t1A8C5558180E8B4500EF57C3 /* proj.mac */,\n\t\t\t\t1A8C5566180E8B5100EF57C3 /* Resources */,\n\t\t\t);\n\t\t\tname = HelloLua;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A6A41DE180BE41100565AC2 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A6A41E0180BE41100565AC2 /* AppDelegate.h */,\n\t\t\t\t1A6A41DF180BE41100565AC2 /* AppDelegate.cpp */,\n\t\t\t\t1A6A41E1180BE41100565AC2 /* GameOverScene.cpp */,\n\t\t\t\t1A6A41E2180BE41100565AC2 /* GameOverScene.h */,\n\t\t\t\t1A6A41E3180BE41100565AC2 /* HelloWorldScene.cpp */,\n\t\t\t\t1A6A41E4180BE41100565AC2 /* HelloWorldScene.h */,\n\t\t\t);\n\t\t\tpath = Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A804EB61876890200C117B5 /* UnitTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A80519518768FD300C117B5 /* UnitTest.cpp */,\n\t\t\t\t1A80519618768FD300C117B5 /* UnitTest.h */,\n\t\t\t);\n\t\t\tname = UnitTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C552F180E8B1C00EF57C3 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C5530180E8B1C00EF57C3 /* AppDelegate.cpp */,\n\t\t\t\t1A8C5531180E8B1C00EF57C3 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Lua/HelloLua/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5538180E8B3D00EF57C3 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C5539180E8B3D00EF57C3 /* AppController.h */,\n\t\t\t\t1A8C553A180E8B3D00EF57C3 /* AppController.mm */,\n\t\t\t\t1A8C553B180E8B3D00EF57C3 /* Default-568h@2x.png */,\n\t\t\t\t1A8C553C180E8B3D00EF57C3 /* Default.png */,\n\t\t\t\t1A8C553D180E8B3D00EF57C3 /* Default@2x.png */,\n\t\t\t\t1A8C553E180E8B3D00EF57C3 /* HelloLua_Prefix.pch */,\n\t\t\t\t1A8C553F180E8B3D00EF57C3 /* Icon-114.png */,\n\t\t\t\t1A8C5540180E8B3D00EF57C3 /* Icon-120.png */,\n\t\t\t\t1A8C5541180E8B3D00EF57C3 /* Icon-144.png */,\n\t\t\t\t1A8C5542180E8B3D00EF57C3 /* Icon-152.png */,\n\t\t\t\t1A8C5543180E8B3D00EF57C3 /* Icon-57.png */,\n\t\t\t\t1A8C5544180E8B3D00EF57C3 /* Icon-72.png */,\n\t\t\t\t1A8C5545180E8B3D00EF57C3 /* Icon-76.png */,\n\t\t\t\t1A8C5546180E8B3D00EF57C3 /* Info.plist */,\n\t\t\t\t1A8C5547180E8B3D00EF57C3 /* main.m */,\n\t\t\t\t1A8C5548180E8B3D00EF57C3 /* RootViewController.h */,\n\t\t\t\t1A8C5549180E8B3D00EF57C3 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Lua/HelloLua/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5558180E8B4500EF57C3 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C5559180E8B4500EF57C3 /* InfoPlist.strings */,\n\t\t\t\t1A8C555B180E8B4500EF57C3 /* MainMenu.xib */,\n\t\t\t\t1A8C555D180E8B4500EF57C3 /* HelloLua_Prefix.pch */,\n\t\t\t\t1A8C555E180E8B4500EF57C3 /* Icon.icns */,\n\t\t\t\t1A8C555F180E8B4500EF57C3 /* Info.plist */,\n\t\t\t\t1A8C5560180E8B4500EF57C3 /* main.cpp */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Lua/HelloLua/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5566180E8B5100EF57C3 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t15A71DB61894AE6200F30AC0 /* mobdebug.lua */,\n\t\t\t\t1A8C5567180E8B5100EF57C3 /* .gitignore */,\n\t\t\t\t1A8C5569180E8B5100EF57C3 /* background.mp3 */,\n\t\t\t\t1A8C556A180E8B5100EF57C3 /* background.ogg */,\n\t\t\t\t1A8C556B180E8B5100EF57C3 /* crop.png */,\n\t\t\t\t1A8C556D180E8B5100EF57C3 /* dog.png */,\n\t\t\t\t1A8C556E180E8B5100EF57C3 /* effect1.wav */,\n\t\t\t\t1A8C556F180E8B5100EF57C3 /* farm.jpg */,\n\t\t\t\t1A8C5570180E8B5100EF57C3 /* fonts */,\n\t\t\t\t1A8C5572180E8B5100EF57C3 /* hello.lua */,\n\t\t\t\t1A8C5573180E8B5100EF57C3 /* hello2.lua */,\n\t\t\t\t1A8C5574180E8B5100EF57C3 /* land.png */,\n\t\t\t\t1A8C5575180E8B5100EF57C3 /* menu1.png */,\n\t\t\t\t1A8C5576180E8B5100EF57C3 /* menu2.png */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tpath = ../samples/Lua/HelloLua/Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5570180E8B5100EF57C3 /* fonts */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C5571180E8B5100EF57C3 /* Marker Felt.ttf */,\n\t\t\t);\n\t\t\tpath = fonts;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5595180E8B6500EF57C3 /* Lua Common */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t15982CE1187656CD00625972 /* GuiConstants.lua */,\n\t\t\t\t15F4C846187551340082884F /* CocoStudio.lua */,\n\t\t\t\t15F4C82818751B590082884F /* extern.lua */,\n\t\t\t\t15394DF2182E8F5D000A418D /* StudioConstants.lua */,\n\t\t\t\t1585AB34182299FA00000FB5 /* json.lua */,\n\t\t\t\t1585AB101821FA1A00000FB5 /* luaoc.lua */,\n\t\t\t\t1A8C5596180E8B8400EF57C3 /* AudioEngine.lua */,\n\t\t\t\t1A8C5597180E8B8400EF57C3 /* CCBReaderLoad.lua */,\n\t\t\t\t1A8C5598180E8B8400EF57C3 /* Cocos2d.lua */,\n\t\t\t\t1A8C5599180E8B8400EF57C3 /* Cocos2dConstants.lua */,\n\t\t\t\t1A8C559A180E8B8400EF57C3 /* Deprecated.lua */,\n\t\t\t\t1A8C559B180E8B8400EF57C3 /* DeprecatedClass.lua */,\n\t\t\t\t1A8C559C180E8B8400EF57C3 /* DeprecatedEnum.lua */,\n\t\t\t\t1A8C559D180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua */,\n\t\t\t\t1A8C559E180E8B8400EF57C3 /* DrawPrimitives.lua */,\n\t\t\t\t1A8C559F180E8B8400EF57C3 /* luaj.lua */,\n\t\t\t\t1A8C55A0180E8B8400EF57C3 /* Opengl.lua */,\n\t\t\t\t1A8C55A1180E8B8400EF57C3 /* OpenglConstants.lua */,\n\t\t\t);\n\t\t\tname = \"Lua Common\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C566B180E8E7F00EF57C3 /* TestLua */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C566C180E8E9600EF57C3 /* Classes */,\n\t\t\t\t1A8C5852180E8F0100EF57C3 /* proj.ios */,\n\t\t\t\t1A8C5872180E8F0C00EF57C3 /* proj.mac */,\n\t\t\t\t1A8C5671180E8EA400EF57C3 /* Resources */,\n\t\t\t);\n\t\t\tname = TestLua;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C566C180E8E9600EF57C3 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1585AB491823A55400000FB5 /* lua_assetsmanager_test_sample.cpp */,\n\t\t\t\t1585AB4A1823A55400000FB5 /* lua_assetsmanager_test_sample.h */,\n\t\t\t\t1A8C566D180E8E9600EF57C3 /* AppDelegate.cpp */,\n\t\t\t\t1A8C566E180E8E9600EF57C3 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Lua/TestLua/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5671180E8EA400EF57C3 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A0800BC18780B2A00E62F93 /* cocosbuilderRes */,\n\t\t\t\t1A0800BD18780B2A00E62F93 /* luaScript */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tpath = ../samples/Lua/TestLua/Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5852180E8F0100EF57C3 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1585AAC61821F8D900000FB5 /* LuaObjectCBridgeTest.h */,\n\t\t\t\t1585AAC71821F8D900000FB5 /* LuaObjectCBridgeTest.mm */,\n\t\t\t\t1A8C5853180E8F0100EF57C3 /* AppController.h */,\n\t\t\t\t1A8C5854180E8F0100EF57C3 /* AppController.mm */,\n\t\t\t\t1A8C5855180E8F0100EF57C3 /* Default-568h@2x.png */,\n\t\t\t\t1A8C5856180E8F0100EF57C3 /* Default.png */,\n\t\t\t\t1A8C5857180E8F0100EF57C3 /* Default@2x.png */,\n\t\t\t\t1A8C5858180E8F0100EF57C3 /* Icon-114.png */,\n\t\t\t\t1A8C5859180E8F0100EF57C3 /* Icon-120.png */,\n\t\t\t\t1A8C585A180E8F0100EF57C3 /* Icon-144.png */,\n\t\t\t\t1A8C585B180E8F0100EF57C3 /* Icon-152.png */,\n\t\t\t\t1A8C585C180E8F0100EF57C3 /* Icon-57.png */,\n\t\t\t\t1A8C585D180E8F0100EF57C3 /* Icon-72.png */,\n\t\t\t\t1A8C585E180E8F0100EF57C3 /* Icon-76.png */,\n\t\t\t\t1A8C585F180E8F0100EF57C3 /* Info.plist */,\n\t\t\t\t1A8C5860180E8F0100EF57C3 /* main.m */,\n\t\t\t\t1A8C5861180E8F0100EF57C3 /* RootViewController.h */,\n\t\t\t\t1A8C5862180E8F0100EF57C3 /* RootViewController.mm */,\n\t\t\t\t1A8C5863180E8F0100EF57C3 /* TestLua_Prefix.pch */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Lua/TestLua/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5872180E8F0C00EF57C3 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1585AB161821FF4C00000FB5 /* LuaObjectCBridgeTest.h */,\n\t\t\t\t1585AB171821FF4C00000FB5 /* LuaObjectCBridgeTest.mm */,\n\t\t\t\t1A8C5873180E8F0C00EF57C3 /* InfoPlist.strings */,\n\t\t\t\t1A8C5875180E8F0C00EF57C3 /* MainMenu.xib */,\n\t\t\t\t1A8C5877180E8F0C00EF57C3 /* Icon.icns */,\n\t\t\t\t1A8C5878180E8F0C00EF57C3 /* Info.plist */,\n\t\t\t\t1A8C5879180E8F0C00EF57C3 /* main.cpp */,\n\t\t\t\t1A8C587A180E8F0C00EF57C3 /* TestLua_Prefix.pch */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Lua/TestLua/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A914198180BEB4B00CFC31F /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A914199180BEB6A00CFC31F /* en.lproj */,\n\t\t\t\t1A91419E180BEB6A00CFC31F /* Icon.icns */,\n\t\t\t\t1A91419F180BEB6A00CFC31F /* main.cpp */,\n\t\t\t\t1A9141A0180BEB6A00CFC31F /* SampleGame_Prefix.pch */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A914199180BEB6A00CFC31F /* en.lproj */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A91419A180BEB6A00CFC31F /* InfoPlist.strings */,\n\t\t\t\t1A91419C180BEB6A00CFC31F /* MainMenu.xib */,\n\t\t\t);\n\t\t\tname = en.lproj;\n\t\t\tpath = proj.mac/en.lproj;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC29F180E65A1007A3AD4 /* TestJavascript */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DC2A0180E65D4007A3AD4 /* Classes */,\n\t\t\t\t1A9DC2D7180E66BB007A3AD4 /* JS Tests */,\n\t\t\t\t1A9DC2B5180E668B007A3AD4 /* proj.ios */,\n\t\t\t\t1A9DC2A5180E6681007A3AD4 /* proj.mac */,\n\t\t\t);\n\t\t\tname = TestJavascript;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC2A0180E65D4007A3AD4 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DC2A1180E65D4007A3AD4 /* AppDelegate.cpp */,\n\t\t\t\t1A9DC2A2180E65D4007A3AD4 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Javascript/TestJavascript/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC2A5180E6681007A3AD4 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DC2A6180E6681007A3AD4 /* InfoPlist.strings */,\n\t\t\t\t1A9DC2A8180E6681007A3AD4 /* MainMenu.xib */,\n\t\t\t\t1A9DC2AA180E6681007A3AD4 /* Icon.icns */,\n\t\t\t\t1A9DC2AB180E6681007A3AD4 /* Info-obfuscated.plist */,\n\t\t\t\t1A9DC2AC180E6681007A3AD4 /* main.cpp */,\n\t\t\t\t1A9DC2AD180E6681007A3AD4 /* Test_Info.plist */,\n\t\t\t\t1A9DC2AE180E6681007A3AD4 /* Test_Prefix.pch */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Javascript/TestJavascript/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC2B5180E668B007A3AD4 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DC2B6180E668B007A3AD4 /* AppController.h */,\n\t\t\t\t1A9DC2B7180E668B007A3AD4 /* AppController.mm */,\n\t\t\t\t1A9DC2B8180E668B007A3AD4 /* Default-568h@2x.png */,\n\t\t\t\t1A9DC2B9180E668B007A3AD4 /* Default.png */,\n\t\t\t\t1A9DC2BA180E668B007A3AD4 /* Default@2x.png */,\n\t\t\t\t1A9DC2BB180E668B007A3AD4 /* Icon-114.png */,\n\t\t\t\t1A9DC2BC180E668B007A3AD4 /* Icon-120.png */,\n\t\t\t\t1A9DC2BD180E668B007A3AD4 /* Icon-144.png */,\n\t\t\t\t1A9DC2BE180E668B007A3AD4 /* Icon-152.png */,\n\t\t\t\t1A9DC2BF180E668B007A3AD4 /* Icon-57.png */,\n\t\t\t\t1A9DC2C0180E668B007A3AD4 /* Icon-72.png */,\n\t\t\t\t1A9DC2C1180E668B007A3AD4 /* Icon-76.png */,\n\t\t\t\t1A9DC2C2180E668B007A3AD4 /* Info-obfuscated.plist */,\n\t\t\t\t1A9DC2C3180E668B007A3AD4 /* Info.plist */,\n\t\t\t\t1A9DC2C4180E668B007A3AD4 /* main.m */,\n\t\t\t\t1A9DC2C5180E668B007A3AD4 /* Prefix.pch */,\n\t\t\t\t1A9DC2C6180E668B007A3AD4 /* RootViewController.h */,\n\t\t\t\t1A9DC2C7180E668B007A3AD4 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Javascript/TestJavascript/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC2D7180E66BB007A3AD4 /* JS Tests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A2F51AF1877DA5900B48BFE /* tests */,\n\t\t\t);\n\t\t\tname = \"JS Tests\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC9E3180E6736007A3AD4 /* JS Common */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DC9E4180E6742007A3AD4 /* script */,\n\t\t\t);\n\t\t\tname = \"JS Common\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4F98180E2C00000584C8 /* TestCpp */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FA5180E2C17000584C8 /* Classes */,\n\t\t\t\t1AAF5250180E2C26000584C8 /* proj.ios */,\n\t\t\t\t1AAF527D180E2C31000584C8 /* proj.mac */,\n\t\t\t\t1AAF538C180E3628000584C8 /* Resources */,\n\t\t\t);\n\t\t\tname = TestCpp;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FA5180E2C17000584C8 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FA6180E2C17000584C8 /* AccelerometerTest */,\n\t\t\t\t1AAF4FA9180E2C17000584C8 /* ActionManagerTest */,\n\t\t\t\t1AAF4FAC180E2C17000584C8 /* ActionsEaseTest */,\n\t\t\t\t1AAF4FAF180E2C17000584C8 /* ActionsProgressTest */,\n\t\t\t\t1AAF4FB2180E2C17000584C8 /* ActionsTest */,\n\t\t\t\t1AAF4FB5180E2C17000584C8 /* AppDelegate.cpp */,\n\t\t\t\t1AAF4FB6180E2C17000584C8 /* AppDelegate.h */,\n\t\t\t\t1AAF4FB7180E2C17000584C8 /* BaseTest.cpp */,\n\t\t\t\t1AAF4FB8180E2C17000584C8 /* BaseTest.h */,\n\t\t\t\t1AAF4FB9180E2C17000584C8 /* Box2DTest */,\n\t\t\t\t1AAF4FBC180E2C17000584C8 /* Box2DTestBed */,\n\t\t\t\t1AAF4FF2180E2C17000584C8 /* BugsTest */,\n\t\t\t\t1AAF500A180E2C18000584C8 /* ChipmunkTest */,\n\t\t\t\t1AAF500D180E2C18000584C8 /* ClickAndMoveTest */,\n\t\t\t\t1AAF5010180E2C18000584C8 /* ClippingNodeTest */,\n\t\t\t\t1AAF5013180E2C18000584C8 /* CocosDenshionTest */,\n\t\t\t\t1AAF5016180E2C18000584C8 /* ConfigurationTest */,\n\t\t\t\t50691333184EB453009BBDD7 /* ConsoleTest */,\n\t\t\t\t1AAF5019180E2C18000584C8 /* controller.cpp */,\n\t\t\t\t1AAF501A180E2C18000584C8 /* controller.h */,\n\t\t\t\t1AAF501B180E2C18000584C8 /* CurlTest */,\n\t\t\t\t1AAF501E180E2C18000584C8 /* CurrentLanguageTest */,\n\t\t\t\t1AAF5021180E2C18000584C8 /* DataVisitorTest */,\n\t\t\t\t1AAF5024180E2C18000584C8 /* DrawPrimitivesTest */,\n\t\t\t\t1AAF5027180E2C18000584C8 /* EffectsAdvancedTest */,\n\t\t\t\t1AAF502A180E2C18000584C8 /* EffectsTest */,\n\t\t\t\t1AAF502D180E2C18000584C8 /* ExtensionsTest */,\n\t\t\t\t1AAF50D0180E2C19000584C8 /* FileUtilsTest */,\n\t\t\t\t1AAF50D3180E2C19000584C8 /* FontTest */,\n\t\t\t\t59A79D5A1821E95C00F19697 /* InputTest */,\n\t\t\t\t1AAF50D6180E2C19000584C8 /* IntervalTest */,\n\t\t\t\t1AAF50D9180E2C19000584C8 /* KeyboardTest */,\n\t\t\t\t1AAF50DC180E2C19000584C8 /* KeypadTest */,\n\t\t\t\t1AAF50DF180E2C19000584C8 /* LabelTest */,\n\t\t\t\t1AAF50E4180E2C19000584C8 /* LayerTest */,\n\t\t\t\t1AAF50E7180E2C19000584C8 /* MenuTest */,\n\t\t\t\t1AAF50EA180E2C19000584C8 /* MotionStreakTest */,\n\t\t\t\t1AAF50ED180E2C19000584C8 /* MutiTouchTest */,\n\t\t\t\t1AAF50F0180E2C19000584C8 /* NewEventDispatcherTest */,\n\t\t\t\t599121E3182C74AC00CE785B /* NewRendererTest */,\n\t\t\t\t1AAF50F3180E2C19000584C8 /* NodeTest */,\n\t\t\t\t1AAF50F6180E2C1A000584C8 /* ParallaxTest */,\n\t\t\t\t1AAF50F9180E2C1A000584C8 /* ParticleTest */,\n\t\t\t\t1AAF50FC180E2C1A000584C8 /* PerformanceTest */,\n\t\t\t\t1AAF510B180E2C1A000584C8 /* PhysicsTest */,\n\t\t\t\t4662EB5C188E426300B02E8F /* ReleasePoolTest */,\n\t\t\t\t1AAF510E180E2C1A000584C8 /* RenderTextureTest */,\n\t\t\t\t1AAF5111180E2C1A000584C8 /* RotateWorldTest */,\n\t\t\t\t1AAF5114180E2C1A000584C8 /* SceneTest */,\n\t\t\t\t1AAF5117180E2C1A000584C8 /* SchedulerTest */,\n\t\t\t\t1AAF511A180E2C1A000584C8 /* ShaderTest */,\n\t\t\t\t1AAF511F180E2C1A000584C8 /* SpineTest */,\n\t\t\t\t1AAF5122180E2C1A000584C8 /* SpriteTest */,\n\t\t\t\t1AAF5125180E2C1A000584C8 /* testBasic.cpp */,\n\t\t\t\t1AAF5126180E2C1A000584C8 /* testBasic.h */,\n\t\t\t\t1AAF5127180E2C1A000584C8 /* testResource.h */,\n\t\t\t\t1AAF5128180E2C1A000584C8 /* tests.h */,\n\t\t\t\t1AAF5129180E2C1A000584C8 /* TextInputTest */,\n\t\t\t\t1AAF512C180E2C1A000584C8 /* Texture2dTest */,\n\t\t\t\t1AAF512F180E2C1A000584C8 /* TextureCacheTest */,\n\t\t\t\t1AAF5132180E2C1A000584C8 /* TexturePackerEncryptionTest */,\n\t\t\t\t1AAF5135180E2C1A000584C8 /* TileMapTest */,\n\t\t\t\t1AAF5138180E2C1A000584C8 /* TouchesTest */,\n\t\t\t\t1AAF513F180E2C1A000584C8 /* TransitionsTest */,\n\t\t\t\t1A804EB61876890200C117B5 /* UnitTest */,\n\t\t\t\t1AAF5142180E2C1A000584C8 /* UserDefaultTest */,\n\t\t\t\t1AAF5145180E2C1A000584C8 /* VisibleRect.cpp */,\n\t\t\t\t1AAF5146180E2C1A000584C8 /* VisibleRect.h */,\n\t\t\t\t1AAF5147180E2C1A000584C8 /* ZwoptexTest */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../samples/Cpp/TestCpp/Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FA6180E2C17000584C8 /* AccelerometerTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FA7180E2C17000584C8 /* AccelerometerTest.cpp */,\n\t\t\t\t1AAF4FA8180E2C17000584C8 /* AccelerometerTest.h */,\n\t\t\t);\n\t\t\tpath = AccelerometerTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FA9180E2C17000584C8 /* ActionManagerTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FAA180E2C17000584C8 /* ActionManagerTest.cpp */,\n\t\t\t\t1AAF4FAB180E2C17000584C8 /* ActionManagerTest.h */,\n\t\t\t);\n\t\t\tpath = ActionManagerTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FAC180E2C17000584C8 /* ActionsEaseTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FAD180E2C17000584C8 /* ActionsEaseTest.cpp */,\n\t\t\t\t1AAF4FAE180E2C17000584C8 /* ActionsEaseTest.h */,\n\t\t\t);\n\t\t\tpath = ActionsEaseTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FAF180E2C17000584C8 /* ActionsProgressTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FB0180E2C17000584C8 /* ActionsProgressTest.cpp */,\n\t\t\t\t1AAF4FB1180E2C17000584C8 /* ActionsProgressTest.h */,\n\t\t\t);\n\t\t\tpath = ActionsProgressTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FB2180E2C17000584C8 /* ActionsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FB3180E2C17000584C8 /* ActionsTest.cpp */,\n\t\t\t\t1AAF4FB4180E2C17000584C8 /* ActionsTest.h */,\n\t\t\t);\n\t\t\tpath = ActionsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FB9180E2C17000584C8 /* Box2DTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FBA180E2C17000584C8 /* Box2dTest.cpp */,\n\t\t\t\t1AAF4FBB180E2C17000584C8 /* Box2dTest.h */,\n\t\t\t);\n\t\t\tpath = Box2DTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FBC180E2C17000584C8 /* Box2DTestBed */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FBD180E2C17000584C8 /* Box2dView.cpp */,\n\t\t\t\t1AAF4FBE180E2C17000584C8 /* Box2dView.h */,\n\t\t\t\t1AAF4FBF180E2C17000584C8 /* GLES-Render.cpp */,\n\t\t\t\t1AAF4FC0180E2C17000584C8 /* GLES-Render.h */,\n\t\t\t\t1AAF4FC1180E2C17000584C8 /* Test.cpp */,\n\t\t\t\t1AAF4FC2180E2C17000584C8 /* Test.h */,\n\t\t\t\t1AAF4FC3180E2C17000584C8 /* TestEntries.cpp */,\n\t\t\t\t1AAF4FC4180E2C17000584C8 /* Tests */,\n\t\t\t);\n\t\t\tpath = Box2DTestBed;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FC4180E2C17000584C8 /* Tests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tB3AF01A8184313DE00A98B85 /* ConvexHull.h */,\n\t\t\t\tB3AF01A9184313DE00A98B85 /* ConveyorBelt.h */,\n\t\t\t\tB3AF01AA184313DE00A98B85 /* Mobile.h */,\n\t\t\t\tB3AF01AB184313DE00A98B85 /* MobileBalanced.h */,\n\t\t\t\tB3AF01AC184313DE00A98B85 /* MotorJoint.h */,\n\t\t\t\t1AAF4FC5180E2C17000584C8 /* AddPair.h */,\n\t\t\t\t1AAF4FC6180E2C17000584C8 /* ApplyForce.h */,\n\t\t\t\t1AAF4FC7180E2C17000584C8 /* BodyTypes.h */,\n\t\t\t\t1AAF4FC8180E2C17000584C8 /* Breakable.h */,\n\t\t\t\t1AAF4FC9180E2C17000584C8 /* Bridge.h */,\n\t\t\t\t1AAF4FCA180E2C17000584C8 /* BulletTest.h */,\n\t\t\t\t1AAF4FCB180E2C17000584C8 /* Cantilever.h */,\n\t\t\t\t1AAF4FCC180E2C17000584C8 /* Car.h */,\n\t\t\t\t1AAF4FCD180E2C17000584C8 /* Chain.h */,\n\t\t\t\t1AAF4FCE180E2C17000584C8 /* CharacterCollision.h */,\n\t\t\t\t1AAF4FCF180E2C17000584C8 /* CollisionFiltering.h */,\n\t\t\t\t1AAF4FD0180E2C17000584C8 /* CollisionProcessing.h */,\n\t\t\t\t1AAF4FD1180E2C17000584C8 /* CompoundShapes.h */,\n\t\t\t\t1AAF4FD2180E2C17000584C8 /* Confined.h */,\n\t\t\t\t1AAF4FD3180E2C17000584C8 /* ContinuousTest.h */,\n\t\t\t\t1AAF4FD4180E2C17000584C8 /* DistanceTest.h */,\n\t\t\t\t1AAF4FD5180E2C17000584C8 /* Dominos.h */,\n\t\t\t\t1AAF4FD6180E2C17000584C8 /* DumpShell.h */,\n\t\t\t\t1AAF4FD7180E2C17000584C8 /* DynamicTreeTest.h */,\n\t\t\t\t1AAF4FD8180E2C17000584C8 /* EdgeShapes.h */,\n\t\t\t\t1AAF4FD9180E2C17000584C8 /* EdgeTest.h */,\n\t\t\t\t1AAF4FDA180E2C17000584C8 /* Gears.h */,\n\t\t\t\t1AAF4FDB180E2C17000584C8 /* OneSidedPlatform.h */,\n\t\t\t\t1AAF4FDC180E2C17000584C8 /* Pinball.h */,\n\t\t\t\t1AAF4FDD180E2C17000584C8 /* PolyCollision.h */,\n\t\t\t\t1AAF4FDE180E2C17000584C8 /* PolyShapes.h */,\n\t\t\t\t1AAF4FDF180E2C17000584C8 /* Prismatic.h */,\n\t\t\t\t1AAF4FE0180E2C17000584C8 /* Pulleys.h */,\n\t\t\t\t1AAF4FE1180E2C17000584C8 /* Pyramid.h */,\n\t\t\t\t1AAF4FE2180E2C17000584C8 /* RayCast.h */,\n\t\t\t\t1AAF4FE3180E2C17000584C8 /* Revolute.h */,\n\t\t\t\t1AAF4FE4180E2C17000584C8 /* Rope.h */,\n\t\t\t\t1AAF4FE5180E2C17000584C8 /* RopeJoint.h */,\n\t\t\t\t1AAF4FE6180E2C17000584C8 /* SensorTest.h */,\n\t\t\t\t1AAF4FE7180E2C17000584C8 /* ShapeEditing.h */,\n\t\t\t\t1AAF4FE8180E2C17000584C8 /* SliderCrank.h */,\n\t\t\t\t1AAF4FE9180E2C17000584C8 /* SphereStack.h */,\n\t\t\t\t1AAF4FEA180E2C17000584C8 /* TheoJansen.h */,\n\t\t\t\t1AAF4FEB180E2C17000584C8 /* Tiles.h */,\n\t\t\t\t1AAF4FEC180E2C17000584C8 /* TimeOfImpact.h */,\n\t\t\t\t1AAF4FED180E2C17000584C8 /* Tumbler.h */,\n\t\t\t\t1AAF4FEE180E2C17000584C8 /* VaryingFriction.h */,\n\t\t\t\t1AAF4FEF180E2C17000584C8 /* VaryingRestitution.h */,\n\t\t\t\t1AAF4FF0180E2C17000584C8 /* VerticalStack.h */,\n\t\t\t\t1AAF4FF1180E2C17000584C8 /* Web.h */,\n\t\t\t);\n\t\t\tpath = Tests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FF2180E2C17000584C8 /* BugsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FF3180E2C17000584C8 /* Bug-1159.cpp */,\n\t\t\t\t1AAF4FF4180E2C17000584C8 /* Bug-1159.h */,\n\t\t\t\t1AAF4FF5180E2C17000584C8 /* Bug-1174.cpp */,\n\t\t\t\t1AAF4FF6180E2C17000584C8 /* Bug-1174.h */,\n\t\t\t\t1AAF4FF7180E2C17000584C8 /* Bug-350.cpp */,\n\t\t\t\t1AAF4FF8180E2C17000584C8 /* Bug-350.h */,\n\t\t\t\t1AAF4FF9180E2C17000584C8 /* Bug-422.cpp */,\n\t\t\t\t1AAF4FFA180E2C17000584C8 /* Bug-422.h */,\n\t\t\t\t1AAF4FFB180E2C17000584C8 /* Bug-458 */,\n\t\t\t\t1AAF5000180E2C17000584C8 /* Bug-624.cpp */,\n\t\t\t\t1AAF5001180E2C17000584C8 /* Bug-624.h */,\n\t\t\t\t1AAF5002180E2C17000584C8 /* Bug-886.cpp */,\n\t\t\t\t1AAF5003180E2C17000584C8 /* Bug-886.h */,\n\t\t\t\t1AAF5004180E2C17000584C8 /* Bug-899.cpp */,\n\t\t\t\t1AAF5005180E2C17000584C8 /* Bug-899.h */,\n\t\t\t\t1AAF5006180E2C17000584C8 /* Bug-914.cpp */,\n\t\t\t\t1AAF5007180E2C17000584C8 /* Bug-914.h */,\n\t\t\t\t1AAF5008180E2C17000584C8 /* BugsTest.cpp */,\n\t\t\t\t1AAF5009180E2C17000584C8 /* BugsTest.h */,\n\t\t\t);\n\t\t\tpath = BugsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF4FFB180E2C17000584C8 /* Bug-458 */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF4FFC180E2C17000584C8 /* Bug-458.cpp */,\n\t\t\t\t1AAF4FFD180E2C17000584C8 /* Bug-458.h */,\n\t\t\t\t1AAF4FFE180E2C17000584C8 /* QuestionContainerSprite.cpp */,\n\t\t\t\t1AAF4FFF180E2C17000584C8 /* QuestionContainerSprite.h */,\n\t\t\t);\n\t\t\tpath = \"Bug-458\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF500A180E2C18000584C8 /* ChipmunkTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF500B180E2C18000584C8 /* ChipmunkTest.cpp */,\n\t\t\t\t1AAF500C180E2C18000584C8 /* ChipmunkTest.h */,\n\t\t\t);\n\t\t\tpath = ChipmunkTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF500D180E2C18000584C8 /* ClickAndMoveTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF500E180E2C18000584C8 /* ClickAndMoveTest.cpp */,\n\t\t\t\t1AAF500F180E2C18000584C8 /* ClickAndMoveTest.h */,\n\t\t\t);\n\t\t\tpath = ClickAndMoveTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5010180E2C18000584C8 /* ClippingNodeTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5011180E2C18000584C8 /* ClippingNodeTest.cpp */,\n\t\t\t\t1AAF5012180E2C18000584C8 /* ClippingNodeTest.h */,\n\t\t\t);\n\t\t\tpath = ClippingNodeTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5013180E2C18000584C8 /* CocosDenshionTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5014180E2C18000584C8 /* CocosDenshionTest.cpp */,\n\t\t\t\t1AAF5015180E2C18000584C8 /* CocosDenshionTest.h */,\n\t\t\t);\n\t\t\tpath = CocosDenshionTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5016180E2C18000584C8 /* ConfigurationTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5017180E2C18000584C8 /* ConfigurationTest.cpp */,\n\t\t\t\t1AAF5018180E2C18000584C8 /* ConfigurationTest.h */,\n\t\t\t);\n\t\t\tpath = ConfigurationTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF501B180E2C18000584C8 /* CurlTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF501C180E2C18000584C8 /* CurlTest.cpp */,\n\t\t\t\t1AAF501D180E2C18000584C8 /* CurlTest.h */,\n\t\t\t);\n\t\t\tpath = CurlTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF501E180E2C18000584C8 /* CurrentLanguageTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF501F180E2C18000584C8 /* CurrentLanguageTest.cpp */,\n\t\t\t\t1AAF5020180E2C18000584C8 /* CurrentLanguageTest.h */,\n\t\t\t);\n\t\t\tpath = CurrentLanguageTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5021180E2C18000584C8 /* DataVisitorTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5022180E2C18000584C8 /* DataVisitorTest.cpp */,\n\t\t\t\t1AAF5023180E2C18000584C8 /* DataVisitorTest.h */,\n\t\t\t);\n\t\t\tpath = DataVisitorTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5024180E2C18000584C8 /* DrawPrimitivesTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5025180E2C18000584C8 /* DrawPrimitivesTest.cpp */,\n\t\t\t\t1AAF5026180E2C18000584C8 /* DrawPrimitivesTest.h */,\n\t\t\t);\n\t\t\tpath = DrawPrimitivesTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5027180E2C18000584C8 /* EffectsAdvancedTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5028180E2C18000584C8 /* EffectsAdvancedTest.cpp */,\n\t\t\t\t1AAF5029180E2C18000584C8 /* EffectsAdvancedTest.h */,\n\t\t\t);\n\t\t\tpath = EffectsAdvancedTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF502A180E2C18000584C8 /* EffectsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF502B180E2C18000584C8 /* EffectsTest.cpp */,\n\t\t\t\t1AAF502C180E2C18000584C8 /* EffectsTest.h */,\n\t\t\t);\n\t\t\tpath = EffectsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF502D180E2C18000584C8 /* ExtensionsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF502E180E2C18000584C8 /* CocosBuilderTest */,\n\t\t\t\t1AAF5055180E2C18000584C8 /* CocoStudioArmatureTest */,\n\t\t\t\t1AAF5058180E2C18000584C8 /* CocoStudioComponentsTest */,\n\t\t\t\t1AAF5065180E2C18000584C8 /* CocoStudioGUITest */,\n\t\t\t\t1AAF509F180E2C19000584C8 /* CocoStudioSceneTest */,\n\t\t\t\t1AAF50A2180E2C19000584C8 /* ControlExtensionTest */,\n\t\t\t\t1AAF50B9180E2C19000584C8 /* EditBoxTest */,\n\t\t\t\t1AAF50BC180E2C19000584C8 /* ExtensionsTest.cpp */,\n\t\t\t\t1AAF50BD180E2C19000584C8 /* ExtensionsTest.h */,\n\t\t\t\t1AAF50BE180E2C19000584C8 /* NetworkTest */,\n\t\t\t\t1AAF50C5180E2C19000584C8 /* NotificationCenterTest */,\n\t\t\t\t1AAF50C8180E2C19000584C8 /* Scale9SpriteTest */,\n\t\t\t\t1AAF50CB180E2C19000584C8 /* TableViewTest */,\n\t\t\t);\n\t\t\tpath = ExtensionsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF502E180E2C18000584C8 /* CocosBuilderTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF502F180E2C18000584C8 /* AnimationsTest */,\n\t\t\t\t1AAF5033180E2C18000584C8 /* ButtonTest */,\n\t\t\t\t1AAF5037180E2C18000584C8 /* CocosBuilderTest.cpp */,\n\t\t\t\t1AAF5038180E2C18000584C8 /* CocosBuilderTest.h */,\n\t\t\t\t1AAF5039180E2C18000584C8 /* HelloCocosBuilder */,\n\t\t\t\t1AAF503D180E2C18000584C8 /* LabelTest */,\n\t\t\t\t1AAF5040180E2C18000584C8 /* MenuTest */,\n\t\t\t\t1AAF5044180E2C18000584C8 /* ParticleSystemTest */,\n\t\t\t\t1AAF5047180E2C18000584C8 /* ScrollViewTest */,\n\t\t\t\t1AAF504A180E2C18000584C8 /* SpriteTest */,\n\t\t\t\t1AAF504D180E2C18000584C8 /* TestHeader */,\n\t\t\t\t1AAF5051180E2C18000584C8 /* TimelineCallbackTest */,\n\t\t\t);\n\t\t\tpath = CocosBuilderTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF502F180E2C18000584C8 /* AnimationsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5030180E2C18000584C8 /* AnimationsLayerLoader.h */,\n\t\t\t\t1AAF5031180E2C18000584C8 /* AnimationsTestLayer.cpp */,\n\t\t\t\t1AAF5032180E2C18000584C8 /* AnimationsTestLayer.h */,\n\t\t\t);\n\t\t\tpath = AnimationsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5033180E2C18000584C8 /* ButtonTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5034180E2C18000584C8 /* ButtonTestLayer.cpp */,\n\t\t\t\t1AAF5035180E2C18000584C8 /* ButtonTestLayer.h */,\n\t\t\t\t1AAF5036180E2C18000584C8 /* ButtonTestLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = ButtonTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5039180E2C18000584C8 /* HelloCocosBuilder */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF503A180E2C18000584C8 /* HelloCocosBuilderLayer.cpp */,\n\t\t\t\t1AAF503B180E2C18000584C8 /* HelloCocosBuilderLayer.h */,\n\t\t\t\t1AAF503C180E2C18000584C8 /* HelloCocosBuilderLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = HelloCocosBuilder;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF503D180E2C18000584C8 /* LabelTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF503E180E2C18000584C8 /* LabelTestLayer.h */,\n\t\t\t\t1AAF503F180E2C18000584C8 /* LabelTestLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = LabelTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5040180E2C18000584C8 /* MenuTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5041180E2C18000584C8 /* MenuTestLayer.cpp */,\n\t\t\t\t1AAF5042180E2C18000584C8 /* MenuTestLayer.h */,\n\t\t\t\t1AAF5043180E2C18000584C8 /* MenuTestLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = MenuTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5044180E2C18000584C8 /* ParticleSystemTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5045180E2C18000584C8 /* ParticleSystemTestLayer.h */,\n\t\t\t\t1AAF5046180E2C18000584C8 /* ParticleSystemTestLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = ParticleSystemTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5047180E2C18000584C8 /* ScrollViewTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5048180E2C18000584C8 /* ScrollViewTestLayer.h */,\n\t\t\t\t1AAF5049180E2C18000584C8 /* ScrollViewTestLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = ScrollViewTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF504A180E2C18000584C8 /* SpriteTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF504B180E2C18000584C8 /* SpriteTestLayer.h */,\n\t\t\t\t1AAF504C180E2C18000584C8 /* SpriteTestLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = SpriteTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF504D180E2C18000584C8 /* TestHeader */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF504E180E2C18000584C8 /* TestHeaderLayer.cpp */,\n\t\t\t\t1AAF504F180E2C18000584C8 /* TestHeaderLayer.h */,\n\t\t\t\t1AAF5050180E2C18000584C8 /* TestHeaderLayerLoader.h */,\n\t\t\t);\n\t\t\tpath = TestHeader;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5051180E2C18000584C8 /* TimelineCallbackTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5052180E2C18000584C8 /* TimelineCallbackLayerLoader.h */,\n\t\t\t\t1AAF5053180E2C18000584C8 /* TimelineCallbackTestLayer.cpp */,\n\t\t\t\t1AAF5054180E2C18000584C8 /* TimelineCallbackTestLayer.h */,\n\t\t\t);\n\t\t\tpath = TimelineCallbackTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5055180E2C18000584C8 /* CocoStudioArmatureTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5056180E2C18000584C8 /* ArmatureScene.cpp */,\n\t\t\t\t1AAF5057180E2C18000584C8 /* ArmatureScene.h */,\n\t\t\t);\n\t\t\tpath = CocoStudioArmatureTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5058180E2C18000584C8 /* CocoStudioComponentsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5059180E2C18000584C8 /* ComponentsTestScene.cpp */,\n\t\t\t\t1AAF505A180E2C18000584C8 /* ComponentsTestScene.h */,\n\t\t\t\t1AAF505B180E2C18000584C8 /* EnemyController.cpp */,\n\t\t\t\t1AAF505C180E2C18000584C8 /* EnemyController.h */,\n\t\t\t\t1AAF505D180E2C18000584C8 /* GameOverScene.cpp */,\n\t\t\t\t1AAF505E180E2C18000584C8 /* GameOverScene.h */,\n\t\t\t\t1AAF505F180E2C18000584C8 /* PlayerController.cpp */,\n\t\t\t\t1AAF5060180E2C18000584C8 /* PlayerController.h */,\n\t\t\t\t1AAF5061180E2C18000584C8 /* ProjectileController.cpp */,\n\t\t\t\t1AAF5062180E2C18000584C8 /* ProjectileController.h */,\n\t\t\t\t1AAF5063180E2C18000584C8 /* SceneController.cpp */,\n\t\t\t\t1AAF5064180E2C18000584C8 /* SceneController.h */,\n\t\t\t);\n\t\t\tpath = CocoStudioComponentsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5065180E2C18000584C8 /* CocoStudioGUITest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360CA186819DB00828878 /* CocosGUIScene.cpp */,\n\t\t\t\t50D360CB186819DB00828878 /* CocosGUIScene.h */,\n\t\t\t\t50D360CC186819DB00828878 /* UIButtonTest */,\n\t\t\t\t50D360CF186819DB00828878 /* UICheckBoxTest */,\n\t\t\t\t50D360D2186819DB00828878 /* UIImageViewTest */,\n\t\t\t\t50D360D5186819DB00828878 /* UILabelAtlasTest */,\n\t\t\t\t50D360D8186819DB00828878 /* UILabelBMFontTest */,\n\t\t\t\t50D360DB186819DB00828878 /* UILabelTest */,\n\t\t\t\t50D360DE186819DB00828878 /* UILayoutTest */,\n\t\t\t\t50D360E1186819DB00828878 /* UIListViewTest */,\n\t\t\t\t50D360E4186819DB00828878 /* UILoadingBarTest */,\n\t\t\t\t50D360E7186819DB00828878 /* UIPageViewTest */,\n\t\t\t\t50D360EA186819DB00828878 /* UIScene.cpp */,\n\t\t\t\t50D360EB186819DB00828878 /* UIScene.h */,\n\t\t\t\t50D360EC186819DB00828878 /* UISceneManager.cpp */,\n\t\t\t\t50D360ED186819DB00828878 /* UISceneManager.h */,\n\t\t\t\t50D360EE186819DB00828878 /* UIScrollViewTest */,\n\t\t\t\t50D360F1186819DB00828878 /* UISliderTest */,\n\t\t\t\t50D360F4186819DB00828878 /* UITextFieldTest */,\n\t\t\t\t50D360F7186819DB00828878 /* UIWidgetAddNodeTest */,\n\t\t\t);\n\t\t\tpath = CocoStudioGUITest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF509F180E2C19000584C8 /* CocoStudioSceneTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t37A6145A186B21F6007A4638 /* TriggerCode */,\n\t\t\t\t1AAF50A0180E2C19000584C8 /* SceneEditorTest.cpp */,\n\t\t\t\t1AAF50A1180E2C19000584C8 /* SceneEditorTest.h */,\n\t\t\t);\n\t\t\tpath = CocoStudioSceneTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50A2180E2C19000584C8 /* ControlExtensionTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50A3180E2C19000584C8 /* CCControlButtonTest */,\n\t\t\t\t1AAF50A6180E2C19000584C8 /* CCControlColourPicker */,\n\t\t\t\t1AAF50A9180E2C19000584C8 /* CCControlPotentiometerTest */,\n\t\t\t\t1AAF50AC180E2C19000584C8 /* CCControlScene.cpp */,\n\t\t\t\t1AAF50AD180E2C19000584C8 /* CCControlScene.h */,\n\t\t\t\t1AAF50AE180E2C19000584C8 /* CCControlSceneManager.cpp */,\n\t\t\t\t1AAF50AF180E2C19000584C8 /* CCControlSceneManager.h */,\n\t\t\t\t1AAF50B0180E2C19000584C8 /* CCControlSliderTest */,\n\t\t\t\t1AAF50B3180E2C19000584C8 /* CCControlStepperTest */,\n\t\t\t\t1AAF50B6180E2C19000584C8 /* CCControlSwitchTest */,\n\t\t\t);\n\t\t\tpath = ControlExtensionTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50A3180E2C19000584C8 /* CCControlButtonTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50A4180E2C19000584C8 /* CCControlButtonTest.cpp */,\n\t\t\t\t1AAF50A5180E2C19000584C8 /* CCControlButtonTest.h */,\n\t\t\t);\n\t\t\tpath = CCControlButtonTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50A6180E2C19000584C8 /* CCControlColourPicker */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50A7180E2C19000584C8 /* CCControlColourPickerTest.cpp */,\n\t\t\t\t1AAF50A8180E2C19000584C8 /* CCControlColourPickerTest.h */,\n\t\t\t);\n\t\t\tpath = CCControlColourPicker;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50A9180E2C19000584C8 /* CCControlPotentiometerTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50AA180E2C19000584C8 /* CCControlPotentiometerTest.cpp */,\n\t\t\t\t1AAF50AB180E2C19000584C8 /* CCControlPotentiometerTest.h */,\n\t\t\t);\n\t\t\tpath = CCControlPotentiometerTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50B0180E2C19000584C8 /* CCControlSliderTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50B1180E2C19000584C8 /* CCControlSliderTest.cpp */,\n\t\t\t\t1AAF50B2180E2C19000584C8 /* CCControlSliderTest.h */,\n\t\t\t);\n\t\t\tpath = CCControlSliderTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50B3180E2C19000584C8 /* CCControlStepperTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50B4180E2C19000584C8 /* CCControlStepperTest.cpp */,\n\t\t\t\t1AAF50B5180E2C19000584C8 /* CCControlStepperTest.h */,\n\t\t\t);\n\t\t\tpath = CCControlStepperTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50B6180E2C19000584C8 /* CCControlSwitchTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50B7180E2C19000584C8 /* CCControlSwitchTest.cpp */,\n\t\t\t\t1AAF50B8180E2C19000584C8 /* CCControlSwitchTest.h */,\n\t\t\t);\n\t\t\tpath = CCControlSwitchTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50B9180E2C19000584C8 /* EditBoxTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50BA180E2C19000584C8 /* EditBoxTest.cpp */,\n\t\t\t\t1AAF50BB180E2C19000584C8 /* EditBoxTest.h */,\n\t\t\t);\n\t\t\tpath = EditBoxTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50BE180E2C19000584C8 /* NetworkTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50BF180E2C19000584C8 /* HttpClientTest.cpp */,\n\t\t\t\t1AAF50C0180E2C19000584C8 /* HttpClientTest.h */,\n\t\t\t\t1AAF50C1180E2C19000584C8 /* SocketIOTest.cpp */,\n\t\t\t\t1AAF50C2180E2C19000584C8 /* SocketIOTest.h */,\n\t\t\t\t1AAF50C3180E2C19000584C8 /* WebSocketTest.cpp */,\n\t\t\t\t1AAF50C4180E2C19000584C8 /* WebSocketTest.h */,\n\t\t\t);\n\t\t\tpath = NetworkTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50C5180E2C19000584C8 /* NotificationCenterTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50C6180E2C19000584C8 /* NotificationCenterTest.cpp */,\n\t\t\t\t1AAF50C7180E2C19000584C8 /* NotificationCenterTest.h */,\n\t\t\t);\n\t\t\tpath = NotificationCenterTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50C8180E2C19000584C8 /* Scale9SpriteTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50C9180E2C19000584C8 /* Scale9SpriteTest.cpp */,\n\t\t\t\t1AAF50CA180E2C19000584C8 /* Scale9SpriteTest.h */,\n\t\t\t);\n\t\t\tpath = Scale9SpriteTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50CB180E2C19000584C8 /* TableViewTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50CC180E2C19000584C8 /* CustomTableViewCell.cpp */,\n\t\t\t\t1AAF50CD180E2C19000584C8 /* CustomTableViewCell.h */,\n\t\t\t\t1AAF50CE180E2C19000584C8 /* TableViewTestScene.cpp */,\n\t\t\t\t1AAF50CF180E2C19000584C8 /* TableViewTestScene.h */,\n\t\t\t);\n\t\t\tpath = TableViewTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50D0180E2C19000584C8 /* FileUtilsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50D1180E2C19000584C8 /* FileUtilsTest.cpp */,\n\t\t\t\t1AAF50D2180E2C19000584C8 /* FileUtilsTest.h */,\n\t\t\t);\n\t\t\tpath = FileUtilsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50D3180E2C19000584C8 /* FontTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50D4180E2C19000584C8 /* FontTest.cpp */,\n\t\t\t\t1AAF50D5180E2C19000584C8 /* FontTest.h */,\n\t\t\t);\n\t\t\tpath = FontTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50D6180E2C19000584C8 /* IntervalTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50D7180E2C19000584C8 /* IntervalTest.cpp */,\n\t\t\t\t1AAF50D8180E2C19000584C8 /* IntervalTest.h */,\n\t\t\t);\n\t\t\tpath = IntervalTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50D9180E2C19000584C8 /* KeyboardTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50DA180E2C19000584C8 /* KeyboardTest.cpp */,\n\t\t\t\t1AAF50DB180E2C19000584C8 /* KeyboardTest.h */,\n\t\t\t);\n\t\t\tpath = KeyboardTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50DC180E2C19000584C8 /* KeypadTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50DD180E2C19000584C8 /* KeypadTest.cpp */,\n\t\t\t\t1AAF50DE180E2C19000584C8 /* KeypadTest.h */,\n\t\t\t);\n\t\t\tpath = KeypadTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50DF180E2C19000584C8 /* LabelTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50E0180E2C19000584C8 /* LabelTest.cpp */,\n\t\t\t\t1AAF50E1180E2C19000584C8 /* LabelTest.h */,\n\t\t\t\t1AAF50E2180E2C19000584C8 /* LabelTestNew.cpp */,\n\t\t\t\t1AAF50E3180E2C19000584C8 /* LabelTestNew.h */,\n\t\t\t);\n\t\t\tpath = LabelTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50E4180E2C19000584C8 /* LayerTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50E5180E2C19000584C8 /* LayerTest.cpp */,\n\t\t\t\t1AAF50E6180E2C19000584C8 /* LayerTest.h */,\n\t\t\t);\n\t\t\tpath = LayerTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50E7180E2C19000584C8 /* MenuTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50E8180E2C19000584C8 /* MenuTest.cpp */,\n\t\t\t\t1AAF50E9180E2C19000584C8 /* MenuTest.h */,\n\t\t\t);\n\t\t\tpath = MenuTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50EA180E2C19000584C8 /* MotionStreakTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50EB180E2C19000584C8 /* MotionStreakTest.cpp */,\n\t\t\t\t1AAF50EC180E2C19000584C8 /* MotionStreakTest.h */,\n\t\t\t);\n\t\t\tpath = MotionStreakTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50ED180E2C19000584C8 /* MutiTouchTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50EE180E2C19000584C8 /* MutiTouchTest.cpp */,\n\t\t\t\t1AAF50EF180E2C19000584C8 /* MutiTouchTest.h */,\n\t\t\t);\n\t\t\tpath = MutiTouchTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50F0180E2C19000584C8 /* NewEventDispatcherTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50F1180E2C19000584C8 /* NewEventDispatcherTest.cpp */,\n\t\t\t\t1AAF50F2180E2C19000584C8 /* NewEventDispatcherTest.h */,\n\t\t\t);\n\t\t\tpath = NewEventDispatcherTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50F3180E2C19000584C8 /* NodeTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50F4180E2C19000584C8 /* NodeTest.cpp */,\n\t\t\t\t1AAF50F5180E2C1A000584C8 /* NodeTest.h */,\n\t\t\t);\n\t\t\tpath = NodeTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50F6180E2C1A000584C8 /* ParallaxTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50F7180E2C1A000584C8 /* ParallaxTest.cpp */,\n\t\t\t\t1AAF50F8180E2C1A000584C8 /* ParallaxTest.h */,\n\t\t\t);\n\t\t\tpath = ParallaxTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50F9180E2C1A000584C8 /* ParticleTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50FA180E2C1A000584C8 /* ParticleTest.cpp */,\n\t\t\t\t1AAF50FB180E2C1A000584C8 /* ParticleTest.h */,\n\t\t\t);\n\t\t\tpath = ParticleTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF50FC180E2C1A000584C8 /* PerformanceTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF50FD180E2C1A000584C8 /* PerformanceAllocTest.cpp */,\n\t\t\t\t1AAF50FE180E2C1A000584C8 /* PerformanceAllocTest.h */,\n\t\t\t\t1AFB0DE11885357A003B2FF3 /* PerformanceContainerTest.cpp */,\n\t\t\t\t1AFB0DE21885357A003B2FF3 /* PerformanceContainerTest.h */,\n\t\t\t\t1ADD146B188D25270034D5EF /* PerformanceEventDispatcherTest.cpp */,\n\t\t\t\t1ADD146C188D25270034D5EF /* PerformanceEventDispatcherTest.h */,\n\t\t\t\t1A087AEC1860418300196EF5 /* PerformanceLabelTest.cpp */,\n\t\t\t\t1A087AED1860418300196EF5 /* PerformanceLabelTest.h */,\n\t\t\t\t1AAF50FF180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp */,\n\t\t\t\t1AAF5100180E2C1A000584C8 /* PerformanceNodeChildrenTest.h */,\n\t\t\t\t1AAF5101180E2C1A000584C8 /* PerformanceParticleTest.cpp */,\n\t\t\t\t1AAF5102180E2C1A000584C8 /* PerformanceParticleTest.h */,\n\t\t\t\tED3674B8187FA7020038ECFC /* PerformanceRendererTest.cpp */,\n\t\t\t\tED3674B3187FA6BF0038ECFC /* PerformanceRendererTest.h */,\n\t\t\t\t1AAF5103180E2C1A000584C8 /* PerformanceSpriteTest.cpp */,\n\t\t\t\t1AAF5104180E2C1A000584C8 /* PerformanceSpriteTest.h */,\n\t\t\t\t1AAF5105180E2C1A000584C8 /* PerformanceTest.cpp */,\n\t\t\t\t1AAF5106180E2C1A000584C8 /* PerformanceTest.h */,\n\t\t\t\t1AAF5107180E2C1A000584C8 /* PerformanceTextureTest.cpp */,\n\t\t\t\t1AAF5108180E2C1A000584C8 /* PerformanceTextureTest.h */,\n\t\t\t\t1AAF5109180E2C1A000584C8 /* PerformanceTouchesTest.cpp */,\n\t\t\t\t1AAF510A180E2C1A000584C8 /* PerformanceTouchesTest.h */,\n\t\t\t);\n\t\t\tpath = PerformanceTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF510B180E2C1A000584C8 /* PhysicsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF510C180E2C1A000584C8 /* PhysicsTest.cpp */,\n\t\t\t\t1AAF510D180E2C1A000584C8 /* PhysicsTest.h */,\n\t\t\t);\n\t\t\tpath = PhysicsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF510E180E2C1A000584C8 /* RenderTextureTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF510F180E2C1A000584C8 /* RenderTextureTest.cpp */,\n\t\t\t\t1AAF5110180E2C1A000584C8 /* RenderTextureTest.h */,\n\t\t\t);\n\t\t\tpath = RenderTextureTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5111180E2C1A000584C8 /* RotateWorldTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5112180E2C1A000584C8 /* RotateWorldTest.cpp */,\n\t\t\t\t1AAF5113180E2C1A000584C8 /* RotateWorldTest.h */,\n\t\t\t);\n\t\t\tpath = RotateWorldTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5114180E2C1A000584C8 /* SceneTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5115180E2C1A000584C8 /* SceneTest.cpp */,\n\t\t\t\t1AAF5116180E2C1A000584C8 /* SceneTest.h */,\n\t\t\t);\n\t\t\tpath = SceneTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5117180E2C1A000584C8 /* SchedulerTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5118180E2C1A000584C8 /* SchedulerTest.cpp */,\n\t\t\t\t1AAF5119180E2C1A000584C8 /* SchedulerTest.h */,\n\t\t\t);\n\t\t\tpath = SchedulerTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF511A180E2C1A000584C8 /* ShaderTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF511B180E2C1A000584C8 /* ShaderTest.cpp */,\n\t\t\t\t1AAF511C180E2C1A000584C8 /* ShaderTest.h */,\n\t\t\t\t1AAF511D180E2C1A000584C8 /* ShaderTest2.cpp */,\n\t\t\t\t1AAF511E180E2C1A000584C8 /* ShaderTest2.h */,\n\t\t\t);\n\t\t\tpath = ShaderTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF511F180E2C1A000584C8 /* SpineTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5120180E2C1A000584C8 /* SpineTest.cpp */,\n\t\t\t\t1AAF5121180E2C1A000584C8 /* SpineTest.h */,\n\t\t\t);\n\t\t\tpath = SpineTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5122180E2C1A000584C8 /* SpriteTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5123180E2C1A000584C8 /* SpriteTest.cpp */,\n\t\t\t\t1AAF5124180E2C1A000584C8 /* SpriteTest.h */,\n\t\t\t);\n\t\t\tpath = SpriteTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5129180E2C1A000584C8 /* TextInputTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF512A180E2C1A000584C8 /* TextInputTest.cpp */,\n\t\t\t\t1AAF512B180E2C1A000584C8 /* TextInputTest.h */,\n\t\t\t);\n\t\t\tpath = TextInputTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF512C180E2C1A000584C8 /* Texture2dTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF512D180E2C1A000584C8 /* Texture2dTest.cpp */,\n\t\t\t\t1AAF512E180E2C1A000584C8 /* Texture2dTest.h */,\n\t\t\t);\n\t\t\tpath = Texture2dTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF512F180E2C1A000584C8 /* TextureCacheTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5130180E2C1A000584C8 /* TextureCacheTest.cpp */,\n\t\t\t\t1AAF5131180E2C1A000584C8 /* TextureCacheTest.h */,\n\t\t\t);\n\t\t\tpath = TextureCacheTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5132180E2C1A000584C8 /* TexturePackerEncryptionTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5133180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp */,\n\t\t\t\t1AAF5134180E2C1A000584C8 /* TextureAtlasEncryptionTest.h */,\n\t\t\t);\n\t\t\tpath = TexturePackerEncryptionTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5135180E2C1A000584C8 /* TileMapTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5136180E2C1A000584C8 /* TileMapTest.cpp */,\n\t\t\t\t1AAF5137180E2C1A000584C8 /* TileMapTest.h */,\n\t\t\t);\n\t\t\tpath = TileMapTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5138180E2C1A000584C8 /* TouchesTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5139180E2C1A000584C8 /* Ball.cpp */,\n\t\t\t\t1AAF513A180E2C1A000584C8 /* Ball.h */,\n\t\t\t\t1AAF513B180E2C1A000584C8 /* Paddle.cpp */,\n\t\t\t\t1AAF513C180E2C1A000584C8 /* Paddle.h */,\n\t\t\t\t1AAF513D180E2C1A000584C8 /* TouchesTest.cpp */,\n\t\t\t\t1AAF513E180E2C1A000584C8 /* TouchesTest.h */,\n\t\t\t);\n\t\t\tpath = TouchesTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF513F180E2C1A000584C8 /* TransitionsTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5140180E2C1A000584C8 /* TransitionsTest.cpp */,\n\t\t\t\t1AAF5141180E2C1A000584C8 /* TransitionsTest.h */,\n\t\t\t);\n\t\t\tpath = TransitionsTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5142180E2C1A000584C8 /* UserDefaultTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5143180E2C1A000584C8 /* UserDefaultTest.cpp */,\n\t\t\t\t1AAF5144180E2C1A000584C8 /* UserDefaultTest.h */,\n\t\t\t);\n\t\t\tpath = UserDefaultTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5147180E2C1A000584C8 /* ZwoptexTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5148180E2C1A000584C8 /* ZwoptexTest.cpp */,\n\t\t\t\t1AAF5149180E2C1A000584C8 /* ZwoptexTest.h */,\n\t\t\t);\n\t\t\tpath = ZwoptexTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5250180E2C26000584C8 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5251180E2C26000584C8 /* Classes */,\n\t\t\t\t1AAF5256180E2C26000584C8 /* Default-568h@2x.png */,\n\t\t\t\t1AAF5257180E2C26000584C8 /* Default.png */,\n\t\t\t\t1AAF5258180E2C26000584C8 /* Default@2x.png */,\n\t\t\t\t1AAF5259180E2C26000584C8 /* Icon-100.png */,\n\t\t\t\t1AAF525A180E2C26000584C8 /* Icon-114.png */,\n\t\t\t\t1AAF525B180E2C26000584C8 /* Icon-120.png */,\n\t\t\t\t1AAF525C180E2C26000584C8 /* Icon-144.png */,\n\t\t\t\t1AAF525D180E2C26000584C8 /* Icon-152.png */,\n\t\t\t\t1AAF525E180E2C26000584C8 /* Icon-29.png */,\n\t\t\t\t1AAF525F180E2C26000584C8 /* Icon-40.png */,\n\t\t\t\t1AAF5260180E2C26000584C8 /* Icon-50.png */,\n\t\t\t\t1AAF5261180E2C26000584C8 /* Icon-57.png */,\n\t\t\t\t1AAF5262180E2C26000584C8 /* Icon-58.png */,\n\t\t\t\t1AAF5263180E2C26000584C8 /* Icon-72.png */,\n\t\t\t\t1AAF5264180E2C26000584C8 /* Icon-76.png */,\n\t\t\t\t1AAF5265180E2C26000584C8 /* Icon-80.png */,\n\t\t\t\t1AAF5266180E2C26000584C8 /* iphone_Prefix.pch */,\n\t\t\t\t1AAF5267180E2C26000584C8 /* main.m */,\n\t\t\t\t1AAF5268180E2C26000584C8 /* Test-Info.plist */,\n\t\t\t);\n\t\t\tname = proj.ios;\n\t\t\tpath = ../samples/Cpp/TestCpp/proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5251180E2C26000584C8 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5252180E2C26000584C8 /* RootViewController.h */,\n\t\t\t\t1AAF5253180E2C26000584C8 /* RootViewController.mm */,\n\t\t\t\t1AAF5254180E2C26000584C8 /* testsAppDelegate.h */,\n\t\t\t\t1AAF5255180E2C26000584C8 /* testsAppDelegate.mm */,\n\t\t\t);\n\t\t\tpath = Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF527D180E2C31000584C8 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF527E180E2C31000584C8 /* InfoPlist.strings */,\n\t\t\t\t1AAF5280180E2C31000584C8 /* MainMenu.xib */,\n\t\t\t\t1AAF5282180E2C31000584C8 /* Icon.icns */,\n\t\t\t\t1AAF5283180E2C31000584C8 /* main.cpp */,\n\t\t\t\t1AAF5284180E2C31000584C8 /* Test_Info.plist */,\n\t\t\t\t1AAF5285180E2C31000584C8 /* Test_Prefix.pch */,\n\t\t\t);\n\t\t\tname = proj.mac;\n\t\t\tpath = ../samples/Cpp/TestCpp/proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF538C180E3628000584C8 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t37C819601875DF2A00930C57 /* animations */,\n\t\t\t\t37C819611875DF2A00930C57 /* armature */,\n\t\t\t\t37C819621875DF2A00930C57 /* background-music-aac.wav */,\n\t\t\t\t37C819631875DF2A00930C57 /* background.mp3 */,\n\t\t\t\t37C819641875DF2A00930C57 /* background.ogg */,\n\t\t\t\t37C819651875DF2A00930C57 /* ccb */,\n\t\t\t\t37C819661875DF2A00930C57 /* CocosBuilderExample.ccbproj */,\n\t\t\t\t37C819671875DF2A00930C57 /* CocosBuilderExample.ccbresourcelog */,\n\t\t\t\t37C819681875DF2A00930C57 /* cocosgui */,\n\t\t\t\t37C819691875DF2A00930C57 /* components */,\n\t\t\t\t37C8196A1875DF2A00930C57 /* configs */,\n\t\t\t\t37C8196B1875DF2A00930C57 /* effect1.raw */,\n\t\t\t\t37C8196C1875DF2A00930C57 /* effect1.wav */,\n\t\t\t\t37C8196D1875DF2A00930C57 /* effect2.ogg */,\n\t\t\t\t37C8196E1875DF2A00930C57 /* extensions */,\n\t\t\t\t37C8196F1875DF2A00930C57 /* fileLookup.plist */,\n\t\t\t\t37C819701875DF2A00930C57 /* fonts */,\n\t\t\t\t37C819711875DF2A00930C57 /* fps_images.png */,\n\t\t\t\t37C819721875DF2A00930C57 /* hd */,\n\t\t\t\t37C819731875DF2A00930C57 /* Hello.png */,\n\t\t\t\t37C819741875DF2B00930C57 /* Images */,\n\t\t\t\t37C819751875DF2B00930C57 /* ipad */,\n\t\t\t\t37C819761875DF2B00930C57 /* ipadhd */,\n\t\t\t\t37C819771875DF2B00930C57 /* Misc */,\n\t\t\t\t37C819781875DF2B00930C57 /* music.mid */,\n\t\t\t\t37C819791875DF2B00930C57 /* Particles */,\n\t\t\t\t37C8197A1875DF2B00930C57 /* pew-pew-lei.wav */,\n\t\t\t\t37C8197B1875DF2B00930C57 /* scenetest */,\n\t\t\t\t37C8197C1875DF2B00930C57 /* Shaders */,\n\t\t\t\t37C8197D1875DF2B00930C57 /* spine */,\n\t\t\t\t37C8197E1875DF2B00930C57 /* TileMaps */,\n\t\t\t\t37C8197F1875DF2B00930C57 /* zwoptex */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */,\n\t\t\t\t1A3B1E9B180E809F00497A22 /* CocosDragonJS */,\n\t\t\t\t1A3B1EF0180E822B00497A22 /* CrystalCraze */,\n\t\t\t\t29B97323FDCFA39411CA2CEA /* Frameworks */,\n\t\t\t\t46A174831807D934005B8026 /* HelloCpp */,\n\t\t\t\t1A3B1F48180E85E100497A22 /* HelloLua */,\n\t\t\t\t1A9DC9E3180E6736007A3AD4 /* JS Common */,\n\t\t\t\t1A8C5595180E8B6500EF57C3 /* Lua Common */,\n\t\t\t\t1A3B1DAF180E7C3400497A22 /* MoonWarriors */,\n\t\t\t\t19C28FACFE9D520D11CA2CBB /* Products */,\n\t\t\t\t460E45011807E711000CDD6D /* SimpleGame */,\n\t\t\t\t1AAF4F98180E2C00000584C8 /* TestCpp */,\n\t\t\t\t1A9DC29F180E65A1007A3AD4 /* TestJavascript */,\n\t\t\t\t1A8C566B180E8E7F00EF57C3 /* TestLua */,\n\t\t\t\t1A3B1E1A180E7ED800497A22 /* WatermelonWithMe */,\n\t\t\t);\n\t\t\tname = CustomTemplate;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97323FDCFA39411CA2CEA /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tD60AE43317F7FFE100757E4B /* CoreMotion.framework */,\n\t\t\t\tA035A71117822E9E00987F6C /* libsqlite3.dylib */,\n\t\t\t\t1A9F808C177E98A600D9A1CB /* libcurl.dylib */,\n\t\t\t\t15C6482E165F399D007D4F18 /* libz.dylib */,\n\t\t\t\tEDCC747E17C455FD007B692C /* IOKit.framework */,\n\t\t\t\tA07A52C11783B01F0073F6A7 /* AVFoundation.framework */,\n\t\t\t\tA07A52BB1783AEB80073F6A7 /* CoreGraphics.framework */,\n\t\t\t\tA07A52B91783AE900073F6A7 /* OpenGLES.framework */,\n\t\t\t\tA07A52B71783AE6D0073F6A7 /* UIKit.framework */,\n\t\t\t\t15C6482C165F3988007D4F18 /* AudioToolbox.framework */,\n\t\t\t\t15C6482A165F3979007D4F18 /* ApplicationServices.framework */,\n\t\t\t\t15C64828165F396B007D4F18 /* OpenAL.framework */,\n\t\t\t\t15C64826165F394E007D4F18 /* QuartzCore.framework */,\n\t\t\t\t15C64824165F3934007D4F18 /* OpenGL.framework */,\n\t\t\t\t15C64822165F391E007D4F18 /* Cocoa.framework */,\n\t\t\t\t15C64832165F3AFD007D4F18 /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t37A6145A186B21F6007A4638 /* TriggerCode */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t37A6145B186B21F6007A4638 /* acts.cpp */,\n\t\t\t\t37A6145C186B21F6007A4638 /* acts.h */,\n\t\t\t\t37A6145D186B21F6007A4638 /* cons.cpp */,\n\t\t\t\t37A6145E186B21F6007A4638 /* cons.h */,\n\t\t\t\t37A6145F186B21F6007A4638 /* EventDef.h */,\n\t\t\t);\n\t\t\tpath = TriggerCode;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t460E45011807E711000CDD6D /* SimpleGame */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1A6A41DE180BE41100565AC2 /* Classes */,\n\t\t\t\t460E452C1807E712000CDD6D /* proj.ios */,\n\t\t\t\t1A914198180BEB4B00CFC31F /* proj.mac */,\n\t\t\t\t460E459D180801A4000CDD6D /* Resources */,\n\t\t\t);\n\t\t\tname = SimpleGame;\n\t\t\tpath = ../samples/Cpp/SimpleGame;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t460E452C1807E712000CDD6D /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t460E452D1807E712000CDD6D /* AppController.h */,\n\t\t\t\t460E452E1807E712000CDD6D /* AppController.mm */,\n\t\t\t\t460E452F1807E712000CDD6D /* Default-568h@2x.png */,\n\t\t\t\t460E45301807E712000CDD6D /* Default.png */,\n\t\t\t\t460E45311807E712000CDD6D /* Default@2x.png */,\n\t\t\t\t460E45321807E712000CDD6D /* Icon-114.png */,\n\t\t\t\t460E45331807E712000CDD6D /* Icon-120.png */,\n\t\t\t\t460E45341807E712000CDD6D /* Icon-144.png */,\n\t\t\t\t460E45351807E712000CDD6D /* Icon-152.png */,\n\t\t\t\t460E45361807E712000CDD6D /* Icon-57.png */,\n\t\t\t\t460E45371807E712000CDD6D /* Icon-72.png */,\n\t\t\t\t460E45381807E712000CDD6D /* Icon-76.png */,\n\t\t\t\t460E45391807E712000CDD6D /* main.m */,\n\t\t\t\t460E453A1807E712000CDD6D /* RootViewController.h */,\n\t\t\t\t460E453B1807E712000CDD6D /* RootViewController.mm */,\n\t\t\t\t460E453C1807E712000CDD6D /* SimpleGame-Info.plist */,\n\t\t\t\t460E453D1807E712000CDD6D /* SimpleGame_Prefix.pch */,\n\t\t\t);\n\t\t\tpath = proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t460E459D180801A4000CDD6D /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t460E45DA180801C9000CDD6D /* sd */,\n\t\t\t\t460E45D7180801C1000CDD6D /* hd */,\n\t\t\t\t460E459E180801A4000CDD6D /* .gitignore */,\n\t\t\t\t460E459F180801A4000CDD6D /* app.config.txt */,\n\t\t\t\t460E45A0180801A4000CDD6D /* app.icf */,\n\t\t\t\t460E45A1180801A4000CDD6D /* background-music-aac.wav */,\n\t\t\t\t460E45A2180801A4000CDD6D /* development.icf */,\n\t\t\t\t460E45A3180801A4000CDD6D /* fonts */,\n\t\t\t\t460E45AB180801A4000CDD6D /* pew-pew-lei.wav */,\n\t\t\t);\n\t\t\tpath = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t460E45A3180801A4000CDD6D /* fonts */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t460E45A4180801A4000CDD6D /* Marker Felt.ttf */,\n\t\t\t);\n\t\t\tpath = fonts;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t4662EB5C188E426300B02E8F /* ReleasePoolTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t4662EB63188E472A00B02E8F /* ReleasePoolTest.h */,\n\t\t\t\t4662EB5D188E426300B02E8F /* ReleasePoolTest.cpp */,\n\t\t\t);\n\t\t\tpath = ReleasePoolTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A15F9D1807A4F8005B8026 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */,\n\t\t\t\t46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */,\n\t\t\t\t46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */,\n\t\t\t\t46A15FB61807A4F9005B8026 /* libbox2d Mac.a */,\n\t\t\t\t46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */,\n\t\t\t\t46A15FBA1807A4F9005B8026 /* libjsbindings Mac.a */,\n\t\t\t\t46A15FBC1807A4F9005B8026 /* libluabindings Mac.a */,\n\t\t\t\t46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */,\n\t\t\t\t46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */,\n\t\t\t\t46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */,\n\t\t\t\t46A15FC41807A4F9005B8026 /* libbox2d iOS.a */,\n\t\t\t\t46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */,\n\t\t\t\t46A15FC81807A4F9005B8026 /* libjsbindings iOS.a */,\n\t\t\t\t46A15FCA1807A4F9005B8026 /* libluabindings iOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A174831807D934005B8026 /* HelloCpp */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A174841807D934005B8026 /* Classes */,\n\t\t\t\t46A174AA1807D934005B8026 /* proj.ios */,\n\t\t\t\t46A174C51807D934005B8026 /* proj.mac */,\n\t\t\t\t46A174D41807D934005B8026 /* Resources */,\n\t\t\t);\n\t\t\tname = HelloCpp;\n\t\t\tpath = ../samples/Cpp/HelloCpp;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A174841807D934005B8026 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A174851807D934005B8026 /* AppDelegate.cpp */,\n\t\t\t\t46A174861807D934005B8026 /* AppDelegate.h */,\n\t\t\t\t46A174871807D934005B8026 /* AppMacros.h */,\n\t\t\t\t46A174881807D934005B8026 /* HelloWorldScene.cpp */,\n\t\t\t\t46A174891807D934005B8026 /* HelloWorldScene.h */,\n\t\t\t);\n\t\t\tpath = Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A174AA1807D934005B8026 /* proj.ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A174AB1807D934005B8026 /* AppController.h */,\n\t\t\t\t46A174AC1807D934005B8026 /* AppController.mm */,\n\t\t\t\t46A174AD1807D934005B8026 /* Default-568h@2x.png */,\n\t\t\t\t46A174AE1807D934005B8026 /* Default.png */,\n\t\t\t\t46A174AF1807D934005B8026 /* Default@2x.png */,\n\t\t\t\t46A174B01807D934005B8026 /* HelloCpp-Info.plist */,\n\t\t\t\t46A174B11807D934005B8026 /* HelloCpp_Prefix.pch */,\n\t\t\t\t46A174B21807D934005B8026 /* Icon-100.png */,\n\t\t\t\t46A174B31807D934005B8026 /* Icon-114.png */,\n\t\t\t\t46A174B41807D934005B8026 /* Icon-120.png */,\n\t\t\t\t46A174B51807D934005B8026 /* Icon-144.png */,\n\t\t\t\t46A174B61807D934005B8026 /* Icon-152.png */,\n\t\t\t\t46A174B71807D934005B8026 /* Icon-40.png */,\n\t\t\t\t46A174B81807D934005B8026 /* Icon-57.png */,\n\t\t\t\t46A174B91807D934005B8026 /* Icon-58.png */,\n\t\t\t\t46A174BA1807D934005B8026 /* Icon-72.png */,\n\t\t\t\t46A174BB1807D934005B8026 /* Icon-76.png */,\n\t\t\t\t46A174BC1807D934005B8026 /* Icon-80.png */,\n\t\t\t\t46A174BD1807D934005B8026 /* main.m */,\n\t\t\t\t46A174BE1807D934005B8026 /* RootViewController.h */,\n\t\t\t\t46A174BF1807D934005B8026 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tpath = proj.ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A174C51807D934005B8026 /* proj.mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A174C61807D934005B8026 /* InfoPlist.strings */,\n\t\t\t\t46A174C81807D934005B8026 /* MainMenu.xib */,\n\t\t\t\t46A174CA1807D934005B8026 /* HelloCpp_Info.plist */,\n\t\t\t\t46A174CB1807D934005B8026 /* HelloCpp_Prefix.pch */,\n\t\t\t\t46A174CC1807D934005B8026 /* Icon.icns */,\n\t\t\t\t46A174CD1807D934005B8026 /* main.cpp */,\n\t\t\t);\n\t\t\tpath = proj.mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A174D41807D934005B8026 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t46A174EC1807D9C4005B8026 /* bang.png */,\n\t\t\t\t46A174EE1807D9C4005B8026 /* fonts */,\n\t\t\t\t46A174EF1807D9C4005B8026 /* ipad */,\n\t\t\t\t46A174F01807D9C4005B8026 /* ipadhd */,\n\t\t\t\t46A174F11807D9C4005B8026 /* iphone */,\n\t\t\t);\n\t\t\tpath = Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50691333184EB453009BBDD7 /* ConsoleTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50691334184EB453009BBDD7 /* ConsoleTest.cpp */,\n\t\t\t\t50691335184EB453009BBDD7 /* ConsoleTest.h */,\n\t\t\t);\n\t\t\tpath = ConsoleTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360CC186819DB00828878 /* UIButtonTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360CD186819DB00828878 /* UIButtonTest.cpp */,\n\t\t\t\t50D360CE186819DB00828878 /* UIButtonTest.h */,\n\t\t\t);\n\t\t\tpath = UIButtonTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360CF186819DB00828878 /* UICheckBoxTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360D0186819DB00828878 /* UICheckBoxTest.cpp */,\n\t\t\t\t50D360D1186819DB00828878 /* UICheckBoxTest.h */,\n\t\t\t);\n\t\t\tpath = UICheckBoxTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360D2186819DB00828878 /* UIImageViewTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360D3186819DB00828878 /* UIImageViewTest.cpp */,\n\t\t\t\t50D360D4186819DB00828878 /* UIImageViewTest.h */,\n\t\t\t);\n\t\t\tpath = UIImageViewTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360D5186819DB00828878 /* UILabelAtlasTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360D6186819DB00828878 /* UILabelAtlasTest.cpp */,\n\t\t\t\t50D360D7186819DB00828878 /* UILabelAtlasTest.h */,\n\t\t\t);\n\t\t\tpath = UILabelAtlasTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360D8186819DB00828878 /* UILabelBMFontTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360D9186819DB00828878 /* UILabelBMFontTest.cpp */,\n\t\t\t\t50D360DA186819DB00828878 /* UILabelBMFontTest.h */,\n\t\t\t);\n\t\t\tpath = UILabelBMFontTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360DB186819DB00828878 /* UILabelTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360DC186819DB00828878 /* UILabelTest.cpp */,\n\t\t\t\t50D360DD186819DB00828878 /* UILabelTest.h */,\n\t\t\t);\n\t\t\tpath = UILabelTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360DE186819DB00828878 /* UILayoutTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360DF186819DB00828878 /* UILayoutTest.cpp */,\n\t\t\t\t50D360E0186819DB00828878 /* UILayoutTest.h */,\n\t\t\t);\n\t\t\tpath = UILayoutTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360E1186819DB00828878 /* UIListViewTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360E2186819DB00828878 /* UIListViewTest.cpp */,\n\t\t\t\t50D360E3186819DB00828878 /* UIListViewTest.h */,\n\t\t\t);\n\t\t\tpath = UIListViewTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360E4186819DB00828878 /* UILoadingBarTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360E5186819DB00828878 /* UILoadingBarTest.cpp */,\n\t\t\t\t50D360E6186819DB00828878 /* UILoadingBarTest.h */,\n\t\t\t);\n\t\t\tpath = UILoadingBarTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360E7186819DB00828878 /* UIPageViewTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360E8186819DB00828878 /* UIPageViewTest.cpp */,\n\t\t\t\t50D360E9186819DB00828878 /* UIPageViewTest.h */,\n\t\t\t);\n\t\t\tpath = UIPageViewTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360EE186819DB00828878 /* UIScrollViewTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360EF186819DB00828878 /* UIScrollViewTest.cpp */,\n\t\t\t\t50D360F0186819DB00828878 /* UIScrollViewTest.h */,\n\t\t\t);\n\t\t\tpath = UIScrollViewTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360F1186819DB00828878 /* UISliderTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360F2186819DB00828878 /* UISliderTest.cpp */,\n\t\t\t\t50D360F3186819DB00828878 /* UISliderTest.h */,\n\t\t\t);\n\t\t\tpath = UISliderTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360F4186819DB00828878 /* UITextFieldTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360F5186819DB00828878 /* UITextFieldTest.cpp */,\n\t\t\t\t50D360F6186819DB00828878 /* UITextFieldTest.h */,\n\t\t\t);\n\t\t\tpath = UITextFieldTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t50D360F7186819DB00828878 /* UIWidgetAddNodeTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t50D360F8186819DB00828878 /* UIWidgetAddNodeTest.cpp */,\n\t\t\t\t50D360F9186819DB00828878 /* UIWidgetAddNodeTest.h */,\n\t\t\t);\n\t\t\tpath = UIWidgetAddNodeTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t599121E3182C74AC00CE785B /* NewRendererTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t599121E4182C74AC00CE785B /* NewRendererTest.cpp */,\n\t\t\t\t599121E5182C74AC00CE785B /* NewRendererTest.h */,\n\t\t\t);\n\t\t\tpath = NewRendererTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t59A79D5A1821E95C00F19697 /* InputTest */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t59A79D5B1821E95C00F19697 /* MouseTest.cpp */,\n\t\t\t\t59A79D5C1821E95C00F19697 /* MouseTest.h */,\n\t\t\t);\n\t\t\tpath = InputTest;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t1A1197B31785363400D62A44 /* Hello lua iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1A1197D41785363400D62A44 /* Build configuration list for PBXNativeTarget \"Hello lua iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1A1197B61785363400D62A44 /* Resources */,\n\t\t\t\t1A1197C31785363400D62A44 /* Sources */,\n\t\t\t\t1A1197C91785363400D62A44 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A8C565D180E8DFB00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C565F180E8DFB00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5661180E8DFB00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5663180E8DFB00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5665180E8DFB00EF57C3 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Hello lua iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = 1A1197D71785363400D62A44 /* Hello lua iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t1A11982D178538E400D62A44 /* Test lua iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1A11986D178538E400D62A44 /* Build configuration list for PBXNativeTarget \"Test lua iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1A119836178538E400D62A44 /* Resources */,\n\t\t\t\t1A11985A178538E400D62A44 /* Sources */,\n\t\t\t\t1A11985F178538E400D62A44 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A8C5890180E8F8000EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5892180E8F8000EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5894180E8F8000EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5896180E8F8000EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5898180E8F8000EF57C3 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Test lua iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = 1A119870178538E400D62A44 /* Test lua iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t1A6FB53517854FE400CDF010 /* Hello lua Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1A6FB56817854FE400CDF010 /* Build configuration list for PBXNativeTarget \"Hello lua Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1A6FB53E17854FE400CDF010 /* Resources */,\n\t\t\t\t1A6FB55517854FE400CDF010 /* Sources */,\n\t\t\t\t1A6FB55A17854FE400CDF010 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A8C55BB180E8BA400EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C55BD180E8BA400EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C55BF180E8BA400EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C55C1180E8BA400EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C55C3180E8BA400EF57C3 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Hello lua Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = 1A6FB56B17854FE400CDF010 /* Hello lua Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t1A6FB7821785614200CDF010 /* Test lua Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1A6FB7B01785614200CDF010 /* Build configuration list for PBXNativeTarget \"Test lua Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1A6FB78B1785614200CDF010 /* Resources */,\n\t\t\t\t1A6FB79E1785614200CDF010 /* Sources */,\n\t\t\t\t1A6FB7A21785614200CDF010 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A8C5881180E8F5F00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5883180E8F5F00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5885180E8F5F00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5887180E8F5F00EF57C3 /* PBXTargetDependency */,\n\t\t\t\t1A8C5889180E8F5F00EF57C3 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Test lua Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = 1A6FB7B31785614200CDF010 /* Test lua Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t1D6058900D05DD3D006BFB54 /* Test cpp Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget \"Test cpp Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1D60588D0D05DD3D006BFB54 /* Resources */,\n\t\t\t\t1D60588E0D05DD3D006BFB54 /* Sources */,\n\t\t\t\t1D60588F0D05DD3D006BFB54 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1AAF5342180E2F41000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF5344180E2F41000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF5346180E2F41000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF5348180E2F41000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF534A180E2F41000584C8 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Test cpp Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = 1D6058910D05DD3D006BFB54 /* Test cpp Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA01E16631784BDA100B0CA4A /* Simple Game iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A01E16901784BDA100B0CA4A /* Build configuration list for PBXNativeTarget \"Simple Game iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA01E16681784BDA100B0CA4A /* Resources */,\n\t\t\t\tA01E167E1784BDA100B0CA4A /* Sources */,\n\t\t\t\tA01E16841784BDA100B0CA4A /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t460E45DE18080218000CDD6D /* PBXTargetDependency */,\n\t\t\t\t460E44FF1807E656000CDD6D /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Simple Game iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A01E16931784BDA100B0CA4A /* Simple Game iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA01E16C01784C06E00B0CA4A /* Test JavaScript iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A01E176F1784C06E00B0CA4A /* Build configuration list for PBXNativeTarget \"Test JavaScript iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA01E16CB1784C06E00B0CA4A /* Resources */,\n\t\t\t\tA01E16F51784C06E00B0CA4A /* Sources */,\n\t\t\t\tA01E17601784C06E00B0CA4A /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A9DCA57180E743F007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DCA59180E743F007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DCA5B180E743F007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DCA5D180E743F007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DCA5F180E743F007A3AD4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Test JavaScript iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A01E17721784C06E00B0CA4A /* Test JavaScript iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA01E17E71784C45400B0CA4A /* JS Watermelon With Me iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A01E18541784C45400B0CA4A /* Build configuration list for PBXNativeTarget \"JS Watermelon With Me iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA01E17F41784C45400B0CA4A /* Resources */,\n\t\t\t\tA01E183E1784C45400B0CA4A /* Sources */,\n\t\t\t\tA01E18431784C45400B0CA4A /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1E86180E804400497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E88180E804400497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E8A180E804400497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E8C180E804400497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E8E180E804400497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS Watermelon With Me iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A01E18571784C45500B0CA4A /* JS Watermelon With Me iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA01E18591784C4D600B0CA4A /* JS Moon Warriors iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A01E18891784C4D600B0CA4A /* Build configuration list for PBXNativeTarget \"JS Moon Warriors iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA01E18661784C4D600B0CA4A /* Resources */,\n\t\t\t\tA01E18731784C4D600B0CA4A /* Sources */,\n\t\t\t\tA01E18781784C4D600B0CA4A /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1E0B180E7E1D00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E0D180E7E1D00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E0F180E7E1D00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E11180E7E1D00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E13180E7E1D00497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS Moon Warriors iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A01E188C1784C4D600B0CA4A /* JS Moon Warriors iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA01E188E1784C4DC00B0CA4A /* JS Crystal Craze iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A01E18BE1784C4DC00B0CA4A /* Build configuration list for PBXNativeTarget \"JS Crystal Craze iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA01E189B1784C4DC00B0CA4A /* Resources */,\n\t\t\t\tA01E18A81784C4DC00B0CA4A /* Sources */,\n\t\t\t\tA01E18AD1784C4DC00B0CA4A /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1F3A180E82D200497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F3C180E82D200497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F3E180E82D200497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F40180E82D200497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F42180E82D200497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS Crystal Craze iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A01E18C11784C4DC00B0CA4A /* JS Crystal Craze iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA01E18C31784C4E000B0CA4A /* JS CocosDragon iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A01E18F31784C4E000B0CA4A /* Build configuration list for PBXNativeTarget \"JS CocosDragon iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA01E18D01784C4E000B0CA4A /* Resources */,\n\t\t\t\tA01E18DD1784C4E000B0CA4A /* Sources */,\n\t\t\t\tA01E18E21784C4E000B0CA4A /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1EE2180E81AA00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1EE4180E81AA00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1EE6180E81AA00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1EE8180E81AA00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1EEA180E81AA00497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS CocosDragon iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A01E18F61784C4E000B0CA4A /* JS CocosDragon iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA035A5441782290400987F6C /* Test JavaScript Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A035A5E91782290400987F6C /* Build configuration list for PBXNativeTarget \"Test JavaScript Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA035A54F1782290400987F6C /* Resources */,\n\t\t\t\tA035A5701782290400987F6C /* Sources */,\n\t\t\t\tA035A5DA1782290400987F6C /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A9DC9E8180E68CE007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DC9EA180E68CE007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DC9EC180E68CE007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DC9EE180E68CE007A3AD4 /* PBXTargetDependency */,\n\t\t\t\t1A9DC9F0180E68CE007A3AD4 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Test JavaScript Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A035A5EC1782290400987F6C /* Test JavaScript Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA035A7131782301C00987F6C /* JS Watermelon With Me Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A035A77A1782301C00987F6C /* Build configuration list for PBXNativeTarget \"JS Watermelon With Me Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA035A7201782301C00987F6C /* Resources */,\n\t\t\t\tA035A7661782301C00987F6C /* Sources */,\n\t\t\t\tA035A76A1782301C00987F6C /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1E70180E7F3E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E72180E7F3E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E74180E7F3E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E76180E7F3E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1E78180E7F3E00497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS Watermelon With Me Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A035A77D1782301C00987F6C /* JS Watermelon With Me Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA035A9BA17823FE100987F6C /* JS Moon Warriors Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A035A9F417823FE100987F6C /* Build configuration list for PBXNativeTarget \"JS Moon Warriors Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA035A9C717823FE100987F6C /* Resources */,\n\t\t\t\tA035A9E017823FE100987F6C /* Sources */,\n\t\t\t\tA035A9E417823FE100987F6C /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1DE9180E7C9C00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1DEB180E7C9C00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1DED180E7C9C00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1DEF180E7C9C00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1DF1180E7C9C00497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS Moon Warriors Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A035A9F717823FE100987F6C /* JS Moon Warriors Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA035AA8D1782422400987F6C /* JS Crystal Craze Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A035AAC21782422400987F6C /* Build configuration list for PBXNativeTarget \"JS Crystal Craze Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA035AA9A1782422400987F6C /* Resources */,\n\t\t\t\tA035AAAE1782422400987F6C /* Sources */,\n\t\t\t\tA035AAB21782422400987F6C /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1F2B180E82B800497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F2D180E82B800497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F2F180E82B800497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F31180E82B800497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1F33180E82B800497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS Crystal Craze Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A035AAC51782422400987F6C /* JS Crystal Craze Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA035AC021782453000987F6C /* JS CocosDragon Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A035AC341782453000987F6C /* Build configuration list for PBXNativeTarget \"JS CocosDragon Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA035AC0F1782453000987F6C /* Resources */,\n\t\t\t\tA035AC201782453000987F6C /* Sources */,\n\t\t\t\tA035AC241782453000987F6C /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1A3B1ED3180E810E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1ED5180E810E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1ED7180E810E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1ED9180E810E00497A22 /* PBXTargetDependency */,\n\t\t\t\t1A3B1EDB180E810E00497A22 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"JS CocosDragon Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A035AC371782453000987F6C /* JS CocosDragon Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA035ACCE178254A300987F6C /* Simple Game Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A035AD73178254A300987F6C /* Build configuration list for PBXNativeTarget \"Simple Game Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA035ACD9178254A300987F6C /* Resources */,\n\t\t\t\tA035ACFA178254A300987F6C /* Sources */,\n\t\t\t\tA035AD64178254A300987F6C /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t460E45831807FDB0000CDD6D /* PBXTargetDependency */,\n\t\t\t\t460E45851807FDB0000CDD6D /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Simple Game Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A035AD76178254A300987F6C /* Simple Game Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA035AE58178255DC00987F6C /* Hello cpp Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A035AE85178255DC00987F6C /* Build configuration list for PBXNativeTarget \"Hello cpp Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA035AE5D178255DC00987F6C /* Resources */,\n\t\t\t\tA035AE73178255DC00987F6C /* Sources */,\n\t\t\t\tA035AE79178255DC00987F6C /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t460E44FC1807E408000CDD6D /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Hello cpp Mac\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A035AE88178255DC00987F6C /* Hello cpp Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA07A517F1783A1D20073F6A7 /* Test cpp iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A52261783A1D20073F6A7 /* Build configuration list for PBXNativeTarget \"Test cpp iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A518A1783A1D20073F6A7 /* Resources */,\n\t\t\t\tA07A51AD1783A1D20073F6A7 /* Sources */,\n\t\t\t\tA07A52171783A1D20073F6A7 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1AAF53F5180E39C6000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF53F7180E39C6000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF53F9180E39C6000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF53FB180E39C6000584C8 /* PBXTargetDependency */,\n\t\t\t\t1AAF53FD180E39C6000584C8 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Test cpp iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A07A52291783A1D20073F6A7 /* Test cpp iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tA07A52CF1784AC9B0073F6A7 /* Hello cpp iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = A07A537E1784AC9B0073F6A7 /* Build configuration list for PBXNativeTarget \"Hello cpp iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tA07A52DA1784AC9B0073F6A7 /* Resources */,\n\t\t\t\tA07A53041784AC9B0073F6A7 /* Sources */,\n\t\t\t\tA07A536F1784AC9B0073F6A7 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t460E44BA1807DCCC000CDD6D /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Hello cpp iOS\";\n\t\t\tproductName = iphone;\n\t\t\tproductReference = A07A53811784AC9B0073F6A7 /* Hello cpp iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t29B97313FDCFA39411CA2CEA /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0500;\n\t\t\t};\n\t\t\tbuildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject \"cocos2d_samples\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 1;\n\t\t\tknownRegions = (\n\t\t\t\tEnglish,\n\t\t\t\tJapanese,\n\t\t\t\tFrench,\n\t\t\t\tGerman,\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 46A15F9D1807A4F8005B8026 /* Products */;\n\t\t\t\t\tProjectRef = 46A15F9C1807A4F8005B8026 /* cocos2d_libs.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tA035ACBB1782469700987F6C /* build-all-samples Mac */,\n\t\t\t\tA035AE58178255DC00987F6C /* Hello cpp Mac */,\n\t\t\t\tA035ACCE178254A300987F6C /* Simple Game Mac */,\n\t\t\t\t1D6058900D05DD3D006BFB54 /* Test cpp Mac */,\n\t\t\t\tA035A5441782290400987F6C /* Test JavaScript Mac */,\n\t\t\t\tA035A7131782301C00987F6C /* JS Watermelon With Me Mac */,\n\t\t\t\tA035A9BA17823FE100987F6C /* JS Moon Warriors Mac */,\n\t\t\t\tA035AA8D1782422400987F6C /* JS Crystal Craze Mac */,\n\t\t\t\tA035AC021782453000987F6C /* JS CocosDragon Mac */,\n\t\t\t\t1A6FB53517854FE400CDF010 /* Hello lua Mac */,\n\t\t\t\t1A6FB7821785614200CDF010 /* Test lua Mac */,\n\t\t\t\tA07A517B1783A1CC0073F6A7 /* build-all-samples iOS */,\n\t\t\t\tA07A52CF1784AC9B0073F6A7 /* Hello cpp iOS */,\n\t\t\t\tA07A517F1783A1D20073F6A7 /* Test cpp iOS */,\n\t\t\t\tA01E16631784BDA100B0CA4A /* Simple Game iOS */,\n\t\t\t\tA01E16C01784C06E00B0CA4A /* Test JavaScript iOS */,\n\t\t\t\tA01E17E71784C45400B0CA4A /* JS Watermelon With Me iOS */,\n\t\t\t\tA01E18591784C4D600B0CA4A /* JS Moon Warriors iOS */,\n\t\t\t\tA01E188E1784C4DC00B0CA4A /* JS Crystal Craze iOS */,\n\t\t\t\tA01E18C31784C4E000B0CA4A /* JS CocosDragon iOS */,\n\t\t\t\t1A1197B31785363400D62A44 /* Hello lua iOS */,\n\t\t\t\t1A11982D178538E400D62A44 /* Test lua iOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t46A15FB01807A4F9005B8026 /* libcocos2dx Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx Mac.a\";\n\t\t\tremoteRef = 46A15FAF1807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FB21807A4F9005B8026 /* libcocos2dx-extensions Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx-extensions Mac.a\";\n\t\t\tremoteRef = 46A15FB11807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FB41807A4F9005B8026 /* libchipmunk Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libchipmunk Mac.a\";\n\t\t\tremoteRef = 46A15FB31807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FB61807A4F9005B8026 /* libbox2d Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libbox2d Mac.a\";\n\t\t\tremoteRef = 46A15FB51807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FB81807A4F9005B8026 /* libCocosDenshion Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libCocosDenshion Mac.a\";\n\t\t\tremoteRef = 46A15FB71807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FBA1807A4F9005B8026 /* libjsbindings Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsbindings Mac.a\";\n\t\t\tremoteRef = 46A15FB91807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FBC1807A4F9005B8026 /* libluabindings Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libluabindings Mac.a\";\n\t\t\tremoteRef = 46A15FBB1807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FBE1807A4F9005B8026 /* libcocos2dx iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx iOS.a\";\n\t\t\tremoteRef = 46A15FBD1807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FC01807A4F9005B8026 /* libcocos2dx-extensions iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx-extensions iOS.a\";\n\t\t\tremoteRef = 46A15FBF1807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FC21807A4F9005B8026 /* libchipmunk iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libchipmunk iOS.a\";\n\t\t\tremoteRef = 46A15FC11807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FC41807A4F9005B8026 /* libbox2d iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libbox2d iOS.a\";\n\t\t\tremoteRef = 46A15FC31807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FC61807A4F9005B8026 /* libCocosDenshion iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libCocosDenshion iOS.a\";\n\t\t\tremoteRef = 46A15FC51807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FC81807A4F9005B8026 /* libjsbindings iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsbindings iOS.a\";\n\t\t\tremoteRef = 46A15FC71807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t46A15FCA1807A4F9005B8026 /* libluabindings iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libluabindings iOS.a\";\n\t\t\tremoteRef = 46A15FC91807A4F9005B8026 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t1A1197B61785363400D62A44 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C554B180E8B3D00EF57C3 /* Default-568h@2x.png in Resources */,\n\t\t\t\t15A71DB81894AE6200F30AC0 /* mobdebug.lua in Resources */,\n\t\t\t\t1A8C554C180E8B3D00EF57C3 /* Default.png in Resources */,\n\t\t\t\t1A8C554D180E8B3D00EF57C3 /* Default@2x.png in Resources */,\n\t\t\t\t1A8C554E180E8B3D00EF57C3 /* Icon-114.png in Resources */,\n\t\t\t\t1A8C554F180E8B3D00EF57C3 /* Icon-120.png in Resources */,\n\t\t\t\t1A8C5550180E8B3D00EF57C3 /* Icon-144.png in Resources */,\n\t\t\t\t1A8C5551180E8B3D00EF57C3 /* Icon-152.png in Resources */,\n\t\t\t\t1A8C5552180E8B3D00EF57C3 /* Icon-57.png in Resources */,\n\t\t\t\t1A8C5553180E8B3D00EF57C3 /* Icon-72.png in Resources */,\n\t\t\t\t1585AB131821FA1A00000FB5 /* luaoc.lua in Resources */,\n\t\t\t\t1A8C5554180E8B3D00EF57C3 /* Icon-76.png in Resources */,\n\t\t\t\t15394DF5182E8F5D000A418D /* StudioConstants.lua in Resources */,\n\t\t\t\t1A8C557C180E8B5100EF57C3 /* background.mp3 in Resources */,\n\t\t\t\t1A8C557E180E8B5100EF57C3 /* background.ogg in Resources */,\n\t\t\t\t1A8C5580180E8B5100EF57C3 /* crop.png in Resources */,\n\t\t\t\t1A8C5584180E8B5100EF57C3 /* dog.png in Resources */,\n\t\t\t\t1A8C5586180E8B5100EF57C3 /* effect1.wav in Resources */,\n\t\t\t\t1A8C5588180E8B5100EF57C3 /* farm.jpg in Resources */,\n\t\t\t\t1A8C558A180E8B5100EF57C3 /* Marker Felt.ttf in Resources */,\n\t\t\t\t1A8C558C180E8B5100EF57C3 /* hello.lua in Resources */,\n\t\t\t\t1A8C558E180E8B5100EF57C3 /* hello2.lua in Resources */,\n\t\t\t\t1A8C5590180E8B5100EF57C3 /* land.png in Resources */,\n\t\t\t\t1A8C5592180E8B5100EF57C3 /* menu1.png in Resources */,\n\t\t\t\t1A8C5594180E8B5100EF57C3 /* menu2.png in Resources */,\n\t\t\t\t1A8C55A3180E8B8400EF57C3 /* AudioEngine.lua in Resources */,\n\t\t\t\t1A8C55A5180E8B8400EF57C3 /* CCBReaderLoad.lua in Resources */,\n\t\t\t\t1A8C55A7180E8B8400EF57C3 /* Cocos2d.lua in Resources */,\n\t\t\t\t1A8C55A9180E8B8400EF57C3 /* Cocos2dConstants.lua in Resources */,\n\t\t\t\t1A8C55AB180E8B8400EF57C3 /* Deprecated.lua in Resources */,\n\t\t\t\t1A8C55AD180E8B8400EF57C3 /* DeprecatedClass.lua in Resources */,\n\t\t\t\t1A8C55AF180E8B8400EF57C3 /* DeprecatedEnum.lua in Resources */,\n\t\t\t\t1A8C55B1180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua in Resources */,\n\t\t\t\t1A8C55B3180E8B8400EF57C3 /* DrawPrimitives.lua in Resources */,\n\t\t\t\t1A8C55B5180E8B8400EF57C3 /* luaj.lua in Resources */,\n\t\t\t\t1A8C55B7180E8B8400EF57C3 /* Opengl.lua in Resources */,\n\t\t\t\t1585AB37182299FA00000FB5 /* json.lua in Resources */,\n\t\t\t\t1A8C55B9180E8B8400EF57C3 /* OpenglConstants.lua in Resources */,\n\t\t\t\t15F4C82B18751B590082884F /* extern.lua in Resources */,\n\t\t\t\t15F4C849187551340082884F /* CocoStudio.lua in Resources */,\n\t\t\t\t15982CE4187656CD00625972 /* GuiConstants.lua in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A119836178538E400D62A44 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A08014718780C1D00E62F93 /* Hello.png in Resources */,\n\t\t\t\t1A08010E18780BD600E62F93 /* animations in Resources */,\n\t\t\t\t1A08011618780BD600E62F93 /* hd in Resources */,\n\t\t\t\t1A0800E218780B6100E62F93 /* DeprecatedEnum.lua in Resources */,\n\t\t\t\t1A0800D918780B6100E62F93 /* StudioConstants.lua in Resources */,\n\t\t\t\t1A08011518780BD600E62F93 /* fonts in Resources */,\n\t\t\t\t1A08011E18780BD600E62F93 /* spine in Resources */,\n\t\t\t\t1A0800C118780B2A00E62F93 /* luaScript in Resources */,\n\t\t\t\t1A08011118780BD600E62F93 /* cocosgui in Resources */,\n\t\t\t\t1A08014518780C1D00E62F93 /* fileLookup.plist in Resources */,\n\t\t\t\t1A08014218780C1D00E62F93 /* effect1.raw in Resources */,\n\t\t\t\t1A0800E318780B6100E62F93 /* DeprecatedOpenglEnum.lua in Resources */,\n\t\t\t\t1A0800DF18780B6100E62F93 /* Cocos2dConstants.lua in Resources */,\n\t\t\t\t1A08011D18780BD600E62F93 /* Shaders in Resources */,\n\t\t\t\t1A08014618780C1D00E62F93 /* fps_images.png in Resources */,\n\t\t\t\t1A08011018780BD600E62F93 /* ccb in Resources */,\n\t\t\t\t1A08013718780C0B00E62F93 /* background-music-aac.wav in Resources */,\n\t\t\t\t1A08011718780BD600E62F93 /* Images in Resources */,\n\t\t\t\t1A08011F18780BD600E62F93 /* TileMaps in Resources */,\n\t\t\t\t1A0800D818780B6100E62F93 /* extern.lua in Resources */,\n\t\t\t\t1A08011B18780BD600E62F93 /* Particles in Resources */,\n\t\t\t\t1A08011A18780BD600E62F93 /* Misc in Resources */,\n\t\t\t\t1A08011218780BD600E62F93 /* components in Resources */,\n\t\t\t\t1A08014418780C1D00E62F93 /* effect2.ogg in Resources */,\n\t\t\t\t1A0800DA18780B6100E62F93 /* json.lua in Resources */,\n\t\t\t\t1A08011418780BD600E62F93 /* extensions in Resources */,\n\t\t\t\t1A0800BF18780B2A00E62F93 /* cocosbuilderRes in Resources */,\n\t\t\t\t1A08014918780C1D00E62F93 /* pew-pew-lei.wav in Resources */,\n\t\t\t\t1A08011918780BD600E62F93 /* ipadhd in Resources */,\n\t\t\t\t1A0800E618780B6100E62F93 /* Opengl.lua in Resources */,\n\t\t\t\t1A0800E118780B6100E62F93 /* DeprecatedClass.lua in Resources */,\n\t\t\t\t1A0800DC18780B6100E62F93 /* AudioEngine.lua in Resources */,\n\t\t\t\t1A0800DB18780B6100E62F93 /* luaoc.lua in Resources */,\n\t\t\t\t1A0800DE18780B6100E62F93 /* Cocos2d.lua in Resources */,\n\t\t\t\t1A0800E018780B6100E62F93 /* Deprecated.lua in Resources */,\n\t\t\t\t1A08010F18780BD600E62F93 /* armature in Resources */,\n\t\t\t\t1A0800E418780B6100E62F93 /* DrawPrimitives.lua in Resources */,\n\t\t\t\t1A08013918780C0B00E62F93 /* background.ogg in Resources */,\n\t\t\t\t1A0800D718780B6100E62F93 /* CocoStudio.lua in Resources */,\n\t\t\t\t1A0800DD18780B6100E62F93 /* CCBReaderLoad.lua in Resources */,\n\t\t\t\t1A08013818780C0B00E62F93 /* background.mp3 in Resources */,\n\t\t\t\t1A08014818780C1D00E62F93 /* music.mid in Resources */,\n\t\t\t\t1A08011C18780BD600E62F93 /* scenetest in Resources */,\n\t\t\t\t1A08014318780C1D00E62F93 /* effect1.wav in Resources */,\n\t\t\t\t1A08012018780BD600E62F93 /* zwoptex in Resources */,\n\t\t\t\t1A08011318780BD600E62F93 /* configs in Resources */,\n\t\t\t\t1A0800E718780B6100E62F93 /* OpenglConstants.lua in Resources */,\n\t\t\t\t1A0800E518780B6100E62F93 /* luaj.lua in Resources */,\n\t\t\t\t1A08011818780BD600E62F93 /* ipad in Resources */,\n\t\t\t\t1A0800D618780B6100E62F93 /* GuiConstants.lua in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB53E17854FE400CDF010 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C5561180E8B4500EF57C3 /* InfoPlist.strings in Resources */,\n\t\t\t\t1A8C5562180E8B4500EF57C3 /* MainMenu.xib in Resources */,\n\t\t\t\t1A8C5563180E8B4500EF57C3 /* Icon.icns in Resources */,\n\t\t\t\t1A8C557B180E8B5100EF57C3 /* background.mp3 in Resources */,\n\t\t\t\t1A8C557D180E8B5100EF57C3 /* background.ogg in Resources */,\n\t\t\t\t1A8C557F180E8B5100EF57C3 /* crop.png in Resources */,\n\t\t\t\t1A8C5583180E8B5100EF57C3 /* dog.png in Resources */,\n\t\t\t\t1A8C5585180E8B5100EF57C3 /* effect1.wav in Resources */,\n\t\t\t\t1A8C5587180E8B5100EF57C3 /* farm.jpg in Resources */,\n\t\t\t\t1585AB35182299FA00000FB5 /* json.lua in Resources */,\n\t\t\t\t1A8C5589180E8B5100EF57C3 /* Marker Felt.ttf in Resources */,\n\t\t\t\t1A8C558B180E8B5100EF57C3 /* hello.lua in Resources */,\n\t\t\t\t1A8C558D180E8B5100EF57C3 /* hello2.lua in Resources */,\n\t\t\t\t1A8C558F180E8B5100EF57C3 /* land.png in Resources */,\n\t\t\t\t1585AB111821FA1A00000FB5 /* luaoc.lua in Resources */,\n\t\t\t\t15394DF3182E8F5D000A418D /* StudioConstants.lua in Resources */,\n\t\t\t\t1A8C5591180E8B5100EF57C3 /* menu1.png in Resources */,\n\t\t\t\t1A8C5593180E8B5100EF57C3 /* menu2.png in Resources */,\n\t\t\t\t1A8C55A2180E8B8400EF57C3 /* AudioEngine.lua in Resources */,\n\t\t\t\t1A8C55A4180E8B8400EF57C3 /* CCBReaderLoad.lua in Resources */,\n\t\t\t\t1A8C55A6180E8B8400EF57C3 /* Cocos2d.lua in Resources */,\n\t\t\t\t1A8C55A8180E8B8400EF57C3 /* Cocos2dConstants.lua in Resources */,\n\t\t\t\t1A8C55AA180E8B8400EF57C3 /* Deprecated.lua in Resources */,\n\t\t\t\t1A8C55AC180E8B8400EF57C3 /* DeprecatedClass.lua in Resources */,\n\t\t\t\t1A8C55AE180E8B8400EF57C3 /* DeprecatedEnum.lua in Resources */,\n\t\t\t\t1A8C55B0180E8B8400EF57C3 /* DeprecatedOpenglEnum.lua in Resources */,\n\t\t\t\t1A8C55B2180E8B8400EF57C3 /* DrawPrimitives.lua in Resources */,\n\t\t\t\t1A8C55B4180E8B8400EF57C3 /* luaj.lua in Resources */,\n\t\t\t\t1A8C55B6180E8B8400EF57C3 /* Opengl.lua in Resources */,\n\t\t\t\t15A71DB71894AE6200F30AC0 /* mobdebug.lua in Resources */,\n\t\t\t\t1A8C55B8180E8B8400EF57C3 /* OpenglConstants.lua in Resources */,\n\t\t\t\t15F4C82918751B590082884F /* extern.lua in Resources */,\n\t\t\t\t15F4C847187551340082884F /* CocoStudio.lua in Resources */,\n\t\t\t\t15982CE2187656CD00625972 /* GuiConstants.lua in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB78B1785614200CDF010 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A08013F18780C1B00E62F93 /* Hello.png in Resources */,\n\t\t\t\t1A0800E818780BD400E62F93 /* animations in Resources */,\n\t\t\t\t1A0800F018780BD400E62F93 /* hd in Resources */,\n\t\t\t\t1A0800D018780B5E00E62F93 /* DeprecatedEnum.lua in Resources */,\n\t\t\t\t1A0800C718780B5E00E62F93 /* StudioConstants.lua in Resources */,\n\t\t\t\t1A0800EF18780BD400E62F93 /* fonts in Resources */,\n\t\t\t\t1A0800F818780BD400E62F93 /* spine in Resources */,\n\t\t\t\t1A0800C018780B2A00E62F93 /* luaScript in Resources */,\n\t\t\t\t1A0800EB18780BD400E62F93 /* cocosgui in Resources */,\n\t\t\t\t1A08013D18780C1B00E62F93 /* fileLookup.plist in Resources */,\n\t\t\t\t1A08013A18780C1B00E62F93 /* effect1.raw in Resources */,\n\t\t\t\t1A0800D118780B5E00E62F93 /* DeprecatedOpenglEnum.lua in Resources */,\n\t\t\t\t1A0800CD18780B5E00E62F93 /* Cocos2dConstants.lua in Resources */,\n\t\t\t\t1A0800F718780BD400E62F93 /* Shaders in Resources */,\n\t\t\t\t1A08013E18780C1B00E62F93 /* fps_images.png in Resources */,\n\t\t\t\t1A0800EA18780BD400E62F93 /* ccb in Resources */,\n\t\t\t\t1A08013418780C0700E62F93 /* background-music-aac.wav in Resources */,\n\t\t\t\t1A0800F118780BD400E62F93 /* Images in Resources */,\n\t\t\t\t1A0800F918780BD400E62F93 /* TileMaps in Resources */,\n\t\t\t\t1A0800C618780B5E00E62F93 /* extern.lua in Resources */,\n\t\t\t\t1A0800F518780BD400E62F93 /* Particles in Resources */,\n\t\t\t\t1A0800F418780BD400E62F93 /* Misc in Resources */,\n\t\t\t\t1A0800EC18780BD400E62F93 /* components in Resources */,\n\t\t\t\t1A08013C18780C1B00E62F93 /* effect2.ogg in Resources */,\n\t\t\t\t1A0800C818780B5E00E62F93 /* json.lua in Resources */,\n\t\t\t\t1A0800EE18780BD400E62F93 /* extensions in Resources */,\n\t\t\t\t1A0800BE18780B2A00E62F93 /* cocosbuilderRes in Resources */,\n\t\t\t\t1A08014118780C1B00E62F93 /* pew-pew-lei.wav in Resources */,\n\t\t\t\t1A0800F318780BD400E62F93 /* ipadhd in Resources */,\n\t\t\t\t1A0800D418780B5E00E62F93 /* Opengl.lua in Resources */,\n\t\t\t\t1A0800CF18780B5E00E62F93 /* DeprecatedClass.lua in Resources */,\n\t\t\t\t1A0800CA18780B5E00E62F93 /* AudioEngine.lua in Resources */,\n\t\t\t\t1A0800C918780B5E00E62F93 /* luaoc.lua in Resources */,\n\t\t\t\t1A0800CC18780B5E00E62F93 /* Cocos2d.lua in Resources */,\n\t\t\t\t1A0800CE18780B5E00E62F93 /* Deprecated.lua in Resources */,\n\t\t\t\t1A0800E918780BD400E62F93 /* armature in Resources */,\n\t\t\t\t1A0800D218780B5E00E62F93 /* DrawPrimitives.lua in Resources */,\n\t\t\t\t1A08013618780C0700E62F93 /* background.ogg in Resources */,\n\t\t\t\t1A0800C518780B5E00E62F93 /* CocoStudio.lua in Resources */,\n\t\t\t\t1A0800CB18780B5E00E62F93 /* CCBReaderLoad.lua in Resources */,\n\t\t\t\t1A08013518780C0700E62F93 /* background.mp3 in Resources */,\n\t\t\t\t1A08014018780C1B00E62F93 /* music.mid in Resources */,\n\t\t\t\t1A0800F618780BD400E62F93 /* scenetest in Resources */,\n\t\t\t\t1A08013B18780C1B00E62F93 /* effect1.wav in Resources */,\n\t\t\t\t1A0800FA18780BD400E62F93 /* zwoptex in Resources */,\n\t\t\t\t1A0800ED18780BD400E62F93 /* configs in Resources */,\n\t\t\t\t1A0800D518780B5E00E62F93 /* OpenglConstants.lua in Resources */,\n\t\t\t\t1A0800D318780B5E00E62F93 /* luaj.lua in Resources */,\n\t\t\t\t1A0800F218780BD400E62F93 /* ipad in Resources */,\n\t\t\t\t1A0800C418780B5E00E62F93 /* GuiConstants.lua in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1D60588D0D05DD3D006BFB54 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t37C81A2E1875DF2B00930C57 /* spine in Resources */,\n\t\t\t\t37C81A3A1875DF2B00930C57 /* zwoptex in Resources */,\n\t\t\t\t37C81A0A1875DF2B00930C57 /* Misc in Resources */,\n\t\t\t\t37C81A041875DF2B00930C57 /* ipadhd in Resources */,\n\t\t\t\t37C81A341875DF2B00930C57 /* TileMaps in Resources */,\n\t\t\t\t37C819A41875DF2B00930C57 /* CocosBuilderExample.ccbproj in Resources */,\n\t\t\t\t37C8199E1875DF2B00930C57 /* ccb in Resources */,\n\t\t\t\t37C819D41875DF2B00930C57 /* extensions in Resources */,\n\t\t\t\t1AAF5286180E2C31000584C8 /* InfoPlist.strings in Resources */,\n\t\t\t\t37C81A161875DF2B00930C57 /* Particles in Resources */,\n\t\t\t\t37C819F81875DF2B00930C57 /* Images in Resources */,\n\t\t\t\t37C819981875DF2B00930C57 /* background.ogg in Resources */,\n\t\t\t\t37C819E61875DF2B00930C57 /* fps_images.png in Resources */,\n\t\t\t\t37C819B01875DF2B00930C57 /* cocosgui in Resources */,\n\t\t\t\t37C819C81875DF2B00930C57 /* effect1.wav in Resources */,\n\t\t\t\t37C819FE1875DF2B00930C57 /* ipad in Resources */,\n\t\t\t\t37C819C21875DF2B00930C57 /* effect1.raw in Resources */,\n\t\t\t\t37C819CE1875DF2B00930C57 /* effect2.ogg in Resources */,\n\t\t\t\t37C819801875DF2B00930C57 /* animations in Resources */,\n\t\t\t\t37C819AA1875DF2B00930C57 /* CocosBuilderExample.ccbresourcelog in Resources */,\n\t\t\t\t37C81A281875DF2B00930C57 /* Shaders in Resources */,\n\t\t\t\t37C81A1C1875DF2B00930C57 /* pew-pew-lei.wav in Resources */,\n\t\t\t\t37C81A221875DF2B00930C57 /* scenetest in Resources */,\n\t\t\t\t37C819EC1875DF2B00930C57 /* hd in Resources */,\n\t\t\t\t37C819E01875DF2B00930C57 /* fonts in Resources */,\n\t\t\t\t37C819B61875DF2B00930C57 /* components in Resources */,\n\t\t\t\t37C8198C1875DF2B00930C57 /* background-music-aac.wav in Resources */,\n\t\t\t\t37C819F21875DF2B00930C57 /* Hello.png in Resources */,\n\t\t\t\t37C819DA1875DF2B00930C57 /* fileLookup.plist in Resources */,\n\t\t\t\t1AAF5287180E2C31000584C8 /* MainMenu.xib in Resources */,\n\t\t\t\t37C819861875DF2B00930C57 /* armature in Resources */,\n\t\t\t\t37C819921875DF2B00930C57 /* background.mp3 in Resources */,\n\t\t\t\t37C819BC1875DF2B00930C57 /* configs in Resources */,\n\t\t\t\t37C81A101875DF2B00930C57 /* music.mid in Resources */,\n\t\t\t\t1AAF5288180E2C31000584C8 /* Icon.icns in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E16681784BDA100B0CA4A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E45BA180801A4000CDD6D /* background-music-aac.wav in Resources */,\n\t\t\t\t460E45BE180801A4000CDD6D /* Marker Felt.ttf in Resources */,\n\t\t\t\t460E45D9180801C1000CDD6D /* hd in Resources */,\n\t\t\t\t460E45DC180801C9000CDD6D /* sd in Resources */,\n\t\t\t\t460E45CA180801A4000CDD6D /* pew-pew-lei.wav in Resources */,\n\t\t\t\t5010FC92180F105C00B8E2AE /* Default-568h@2x.png in Resources */,\n\t\t\t\t1A514B0E180FB6A30053B876 /* Default.png in Resources */,\n\t\t\t\t1A514B0F180FB6A30053B876 /* Default@2x.png in Resources */,\n\t\t\t\t1A514B10180FB6A30053B876 /* Icon-114.png in Resources */,\n\t\t\t\t1A514B11180FB6A30053B876 /* Icon-120.png in Resources */,\n\t\t\t\t1A514B12180FB6A30053B876 /* Icon-144.png in Resources */,\n\t\t\t\t1A514B13180FB6A30053B876 /* Icon-152.png in Resources */,\n\t\t\t\t1A514B14180FB6A30053B876 /* Icon-57.png in Resources */,\n\t\t\t\t1A514B15180FB6A30053B876 /* Icon-72.png in Resources */,\n\t\t\t\t1A514B16180FB6A30053B876 /* Icon-76.png in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E16CB1784C06E00B0CA4A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A2F51B11877DA5900B48BFE /* tests in Resources */,\n\t\t\t\t1A9DC9E6180E6742007A3AD4 /* script in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E17F41784C45400B0CA4A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E94180E807600497A22 /* boot-html5.js in Resources */,\n\t\t\t\t1A3B1E95180E807600497A22 /* boot-jsb.js in Resources */,\n\t\t\t\t1A3B1E96180E807600497A22 /* levels.js in Resources */,\n\t\t\t\t1A3B1E97180E807600497A22 /* main.js in Resources */,\n\t\t\t\t1A3B1E98180E807600497A22 /* resources-html5.js in Resources */,\n\t\t\t\t1A3B1E99180E807600497A22 /* resources-jsb.js in Resources */,\n\t\t\t\t1A3B1E9A180E807600497A22 /* watermelon_with_me.js in Resources */,\n\t\t\t\t1A3B1E06180E7D5000497A22 /* script in Resources */,\n\t\t\t\t1A3B1E2B180E7EFA00497A22 /* index.html in Resources */,\n\t\t\t\t1A3B1E31180E7EFA00497A22 /* Platform in Resources */,\n\t\t\t\t1A3B1E33180E7EFA00497A22 /* res in Resources */,\n\t\t\t\t1A3B1E55180E7F1E00497A22 /* Default-568h@2x.png in Resources */,\n\t\t\t\t1A3B1E56180E7F1E00497A22 /* Default.png in Resources */,\n\t\t\t\t1A3B1E57180E7F1E00497A22 /* Default@2x.png in Resources */,\n\t\t\t\t1A3B1E58180E7F1E00497A22 /* Icon-114.png in Resources */,\n\t\t\t\t1A3B1E59180E7F1E00497A22 /* Icon-120.png in Resources */,\n\t\t\t\t1A3B1E5A180E7F1E00497A22 /* Icon-144.png in Resources */,\n\t\t\t\t1A3B1E5B180E7F1E00497A22 /* Icon-152.png in Resources */,\n\t\t\t\t1A3B1E5C180E7F1E00497A22 /* Icon-57.png in Resources */,\n\t\t\t\t1A3B1E5D180E7F1E00497A22 /* Icon-72.png in Resources */,\n\t\t\t\t1A3B1E5E180E7F1E00497A22 /* Icon-76.png in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18661784C4D600B0CA4A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E19180E7E4E00497A22 /* MoonWarriors-jsb.js in Resources */,\n\t\t\t\t1A3B1DCB180E7C5100497A22 /* Default-568h@2x.png in Resources */,\n\t\t\t\t1A3B1DCC180E7C5100497A22 /* Default.png in Resources */,\n\t\t\t\t1A3B1DCD180E7C5100497A22 /* Default@2x.png in Resources */,\n\t\t\t\t1A3B1DCE180E7C5100497A22 /* Icon-120.png in Resources */,\n\t\t\t\t1A3B1DCF180E7C5100497A22 /* Icon-144.png in Resources */,\n\t\t\t\t1A3B1DD0180E7C5100497A22 /* Icon-152.png in Resources */,\n\t\t\t\t1A3B1DD1180E7C5100497A22 /* Icon-72.png in Resources */,\n\t\t\t\t1A3B1DD2180E7C5100497A22 /* Icon-76.png in Resources */,\n\t\t\t\t1A3B1DD3180E7C5100497A22 /* Icon-Small-50.png in Resources */,\n\t\t\t\t1A3B1DD4180E7C5100497A22 /* Icon-Small.png in Resources */,\n\t\t\t\t1A3B1DD5180E7C5100497A22 /* Icon-Small@2x.png in Resources */,\n\t\t\t\t1A3B1DD6180E7C5100497A22 /* Icon.png in Resources */,\n\t\t\t\t1A3B1DD7180E7C5100497A22 /* Icon@2x.png in Resources */,\n\t\t\t\t1A3B1DFE180E7D2200497A22 /* res in Resources */,\n\t\t\t\t1A3B1E00180E7D2200497A22 /* src in Resources */,\n\t\t\t\t1A3B1E07180E7D5100497A22 /* script in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E189B1784C4DC00B0CA4A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E08180E7D5100497A22 /* script in Resources */,\n\t\t\t\t1A3B1EF4180E826E00497A22 /* Published-iOS in Resources */,\n\t\t\t\t1A3B1F10180E828E00497A22 /* Default-568h@2x.png in Resources */,\n\t\t\t\t1A3B1F11180E828E00497A22 /* Default.png in Resources */,\n\t\t\t\t1A3B1F12180E828E00497A22 /* Default@2x.png in Resources */,\n\t\t\t\t1A3B1F13180E828E00497A22 /* Icon-114.png in Resources */,\n\t\t\t\t1A3B1F14180E828E00497A22 /* Icon-120.png in Resources */,\n\t\t\t\t1A3B1F15180E828E00497A22 /* Icon-144.png in Resources */,\n\t\t\t\t1A3B1F16180E828E00497A22 /* Icon-152.png in Resources */,\n\t\t\t\t1A3B1F17180E828E00497A22 /* Icon-57.png in Resources */,\n\t\t\t\t1A3B1F18180E828E00497A22 /* Icon-72.png in Resources */,\n\t\t\t\t1A3B1F19180E828E00497A22 /* Icon-76.png in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18D01784C4E000B0CA4A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E09180E7D5200497A22 /* script in Resources */,\n\t\t\t\t1A3B1EB4180E80BD00497A22 /* Default-568h@2x.png in Resources */,\n\t\t\t\t1A3B1EB5180E80BD00497A22 /* Default.png in Resources */,\n\t\t\t\t1A3B1EB6180E80BD00497A22 /* Default@2x.png in Resources */,\n\t\t\t\t1A3B1EB7180E80BD00497A22 /* Icon-114.png in Resources */,\n\t\t\t\t1A3B1EB8180E80BD00497A22 /* Icon-120.png in Resources */,\n\t\t\t\t1A3B1EB9180E80BD00497A22 /* Icon-144.png in Resources */,\n\t\t\t\t1A3B1EBA180E80BD00497A22 /* Icon-152.png in Resources */,\n\t\t\t\t1A3B1EBB180E80BD00497A22 /* Icon-57.png in Resources */,\n\t\t\t\t1A3B1EBC180E80BD00497A22 /* Icon-72.png in Resources */,\n\t\t\t\t1A3B1EBD180E80BD00497A22 /* Icon-76.png in Resources */,\n\t\t\t\t1A3B1ED1180E80E200497A22 /* Published files iOS in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A54F1782290400987F6C /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A2F51B01877DA5900B48BFE /* tests in Resources */,\n\t\t\t\t1A9DC9E5180E6742007A3AD4 /* script in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A7201782301C00987F6C /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E7E180E7FBB00497A22 /* boot-html5.js in Resources */,\n\t\t\t\t1A3B1E7F180E7FBB00497A22 /* boot-jsb.js in Resources */,\n\t\t\t\t1A3B1E80180E7FBB00497A22 /* levels.js in Resources */,\n\t\t\t\t1A3B1E81180E7FBB00497A22 /* main.js in Resources */,\n\t\t\t\t1A3B1E82180E7FBB00497A22 /* resources-html5.js in Resources */,\n\t\t\t\t1A3B1E83180E7FBB00497A22 /* resources-jsb.js in Resources */,\n\t\t\t\t1A3B1E84180E7FBB00497A22 /* watermelon_with_me.js in Resources */,\n\t\t\t\t1A3B1E02180E7D4B00497A22 /* script in Resources */,\n\t\t\t\t1A3B1E2A180E7EFA00497A22 /* index.html in Resources */,\n\t\t\t\t1A3B1E30180E7EFA00497A22 /* Platform in Resources */,\n\t\t\t\t1A3B1E32180E7EFA00497A22 /* res in Resources */,\n\t\t\t\t1A3B1E6A180E7F2400497A22 /* InfoPlist.strings in Resources */,\n\t\t\t\t1A3B1E6B180E7F2400497A22 /* MainMenu.xib in Resources */,\n\t\t\t\t1A3B1E6C180E7F2400497A22 /* Icon.icns in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A9C717823FE100987F6C /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E01180E7D3900497A22 /* MoonWarriors-jsb.js in Resources */,\n\t\t\t\t1A3B1DE3180E7C5C00497A22 /* InfoPlist.strings in Resources */,\n\t\t\t\t1A3B1DE4180E7C5C00497A22 /* MainMenu.xib in Resources */,\n\t\t\t\t1A3B1DE5180E7C5C00497A22 /* Icon.icns in Resources */,\n\t\t\t\t1A3B1DE6180E7C5C00497A22 /* Info.plist in Resources */,\n\t\t\t\t1A3B1DFD180E7D2200497A22 /* res in Resources */,\n\t\t\t\t1A3B1DFF180E7D2200497A22 /* src in Resources */,\n\t\t\t\t1A3B1E03180E7D4B00497A22 /* script in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AA9A1782422400987F6C /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E04180E7D4C00497A22 /* script in Resources */,\n\t\t\t\t1A3B1EF3180E826E00497A22 /* Published-iOS in Resources */,\n\t\t\t\t1A3B1F25180E829600497A22 /* InfoPlist.strings in Resources */,\n\t\t\t\t1A3B1F26180E829600497A22 /* MainMenu.xib in Resources */,\n\t\t\t\t1A3B1F27180E829600497A22 /* Icon.icns in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AC0F1782453000987F6C /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E05180E7D4C00497A22 /* script in Resources */,\n\t\t\t\t1A3B1EC9180E80C700497A22 /* InfoPlist.strings in Resources */,\n\t\t\t\t1A3B1ECA180E80C700497A22 /* MainMenu.xib in Resources */,\n\t\t\t\t1A3B1ECB180E80C700497A22 /* Icon.icns in Resources */,\n\t\t\t\t1A3B1ED0180E80E200497A22 /* Published files iOS in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035ACD9178254A300987F6C /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E45D8180801C1000CDD6D /* hd in Resources */,\n\t\t\t\t460E45C9180801A4000CDD6D /* pew-pew-lei.wav in Resources */,\n\t\t\t\t460E45BD180801A4000CDD6D /* Marker Felt.ttf in Resources */,\n\t\t\t\t460E45DB180801C9000CDD6D /* sd in Resources */,\n\t\t\t\t460E45B9180801A4000CDD6D /* background-music-aac.wav in Resources */,\n\t\t\t\t1A9141A1180BEB6A00CFC31F /* InfoPlist.strings in Resources */,\n\t\t\t\t1A9141A2180BEB6A00CFC31F /* MainMenu.xib in Resources */,\n\t\t\t\t1A9141A3180BEB6A00CFC31F /* Icon.icns in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AE5D178255DC00987F6C /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A174FC1807D9C4005B8026 /* ipadhd in Resources */,\n\t\t\t\t46A174F41807D9C4005B8026 /* bang.png in Resources */,\n\t\t\t\t46A174FE1807D9C4005B8026 /* iphone in Resources */,\n\t\t\t\t46A174F81807D9C4005B8026 /* fonts in Resources */,\n\t\t\t\t46A174FA1807D9C4005B8026 /* ipad in Resources */,\n\t\t\t\t1A514AFE180FB6470053B876 /* Icon.icns in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A518A1783A1D20073F6A7 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t37C81A071875DF2B00930C57 /* ipadhd in Resources */,\n\t\t\t\t1AAF526B180E2C26000584C8 /* Default-568h@2x.png in Resources */,\n\t\t\t\t1AAF526C180E2C26000584C8 /* Default.png in Resources */,\n\t\t\t\t37C819EF1875DF2B00930C57 /* hd in Resources */,\n\t\t\t\t1AAF526D180E2C26000584C8 /* Default@2x.png in Resources */,\n\t\t\t\t37C819FB1875DF2B00930C57 /* Images in Resources */,\n\t\t\t\t37C819D11875DF2B00930C57 /* effect2.ogg in Resources */,\n\t\t\t\t1AAF526E180E2C26000584C8 /* Icon-100.png in Resources */,\n\t\t\t\t1AAF526F180E2C26000584C8 /* Icon-114.png in Resources */,\n\t\t\t\t1AAF5270180E2C26000584C8 /* Icon-120.png in Resources */,\n\t\t\t\t37C819A11875DF2B00930C57 /* ccb in Resources */,\n\t\t\t\t1AAF5271180E2C26000584C8 /* Icon-144.png in Resources */,\n\t\t\t\t37C819C51875DF2B00930C57 /* effect1.raw in Resources */,\n\t\t\t\t1AAF5272180E2C26000584C8 /* Icon-152.png in Resources */,\n\t\t\t\t37C819E31875DF2B00930C57 /* fonts in Resources */,\n\t\t\t\t37C81A1F1875DF2B00930C57 /* pew-pew-lei.wav in Resources */,\n\t\t\t\t37C81A0D1875DF2B00930C57 /* Misc in Resources */,\n\t\t\t\t1AAF5273180E2C26000584C8 /* Icon-29.png in Resources */,\n\t\t\t\t37C819CB1875DF2B00930C57 /* effect1.wav in Resources */,\n\t\t\t\t37C81A251875DF2B00930C57 /* scenetest in Resources */,\n\t\t\t\t37C8199B1875DF2B00930C57 /* background.ogg in Resources */,\n\t\t\t\t37C819831875DF2B00930C57 /* animations in Resources */,\n\t\t\t\t37C81A3D1875DF2B00930C57 /* zwoptex in Resources */,\n\t\t\t\t37C819DD1875DF2B00930C57 /* fileLookup.plist in Resources */,\n\t\t\t\t37C819BF1875DF2B00930C57 /* configs in Resources */,\n\t\t\t\t1AAF5274180E2C26000584C8 /* Icon-40.png in Resources */,\n\t\t\t\t37C819E91875DF2B00930C57 /* fps_images.png in Resources */,\n\t\t\t\t1AAF5275180E2C26000584C8 /* Icon-50.png in Resources */,\n\t\t\t\t37C819B31875DF2B00930C57 /* cocosgui in Resources */,\n\t\t\t\t37C81A131875DF2B00930C57 /* music.mid in Resources */,\n\t\t\t\t37C8198F1875DF2B00930C57 /* background-music-aac.wav in Resources */,\n\t\t\t\t1AAF5276180E2C26000584C8 /* Icon-57.png in Resources */,\n\t\t\t\t1AAF5277180E2C26000584C8 /* Icon-58.png in Resources */,\n\t\t\t\t37C81A191875DF2B00930C57 /* Particles in Resources */,\n\t\t\t\t37C81A2B1875DF2B00930C57 /* Shaders in Resources */,\n\t\t\t\t1AAF5278180E2C26000584C8 /* Icon-72.png in Resources */,\n\t\t\t\t1AAF5279180E2C26000584C8 /* Icon-76.png in Resources */,\n\t\t\t\t1AAF527A180E2C26000584C8 /* Icon-80.png in Resources */,\n\t\t\t\t37C81A311875DF2B00930C57 /* spine in Resources */,\n\t\t\t\t37C819891875DF2B00930C57 /* armature in Resources */,\n\t\t\t\t37C81A371875DF2B00930C57 /* TileMaps in Resources */,\n\t\t\t\t37C819D71875DF2B00930C57 /* extensions in Resources */,\n\t\t\t\t37C819B91875DF2B00930C57 /* components in Resources */,\n\t\t\t\t37C819951875DF2B00930C57 /* background.mp3 in Resources */,\n\t\t\t\t37C819AD1875DF2B00930C57 /* CocosBuilderExample.ccbresourcelog in Resources */,\n\t\t\t\t37C81A011875DF2B00930C57 /* ipad in Resources */,\n\t\t\t\t37C819F51875DF2B00930C57 /* Hello.png in Resources */,\n\t\t\t\t37C819A71875DF2B00930C57 /* CocosBuilderExample.ccbproj in Resources */,\n\t\t\t\t1AAF527C180E2C26000584C8 /* Test-Info.plist in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A52DA1784AC9B0073F6A7 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A174FD1807D9C4005B8026 /* ipadhd in Resources */,\n\t\t\t\t46A174F51807D9C4005B8026 /* bang.png in Resources */,\n\t\t\t\t46A174FF1807D9C4005B8026 /* iphone in Resources */,\n\t\t\t\t5010FC91180F0F8300B8E2AE /* Default-568h@2x.png in Resources */,\n\t\t\t\t46A174F91807D9C4005B8026 /* fonts in Resources */,\n\t\t\t\t46A174FB1807D9C4005B8026 /* ipad in Resources */,\n\t\t\t\t1A514B01180FB66F0053B876 /* Default.png in Resources */,\n\t\t\t\t1A514B02180FB6730053B876 /* Default@2x.png in Resources */,\n\t\t\t\t1A514B03180FB6780053B876 /* Icon-100.png in Resources */,\n\t\t\t\t1A514B04180FB67C0053B876 /* Icon-114.png in Resources */,\n\t\t\t\t1A514B05180FB67C0053B876 /* Icon-120.png in Resources */,\n\t\t\t\t1A514B06180FB67C0053B876 /* Icon-144.png in Resources */,\n\t\t\t\t1A514B07180FB67C0053B876 /* Icon-152.png in Resources */,\n\t\t\t\t1A514B08180FB67C0053B876 /* Icon-40.png in Resources */,\n\t\t\t\t1A514B09180FB67C0053B876 /* Icon-57.png in Resources */,\n\t\t\t\t1A514B0A180FB67C0053B876 /* Icon-58.png in Resources */,\n\t\t\t\t1A514B0B180FB67C0053B876 /* Icon-72.png in Resources */,\n\t\t\t\t1A514B0C180FB67C0053B876 /* Icon-76.png in Resources */,\n\t\t\t\t1A514B0D180FB67C0053B876 /* Icon-80.png in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t1A1197C31785363400D62A44 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C5533180E8B1C00EF57C3 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A8C554A180E8B3D00EF57C3 /* AppController.mm in Sources */,\n\t\t\t\t1A8C5556180E8B3D00EF57C3 /* main.m in Sources */,\n\t\t\t\t1A8C5557180E8B3D00EF57C3 /* RootViewController.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A11985A178538E400D62A44 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C5670180E8E9600EF57C3 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A8C5864180E8F0100EF57C3 /* AppController.mm in Sources */,\n\t\t\t\t1A8C5870180E8F0100EF57C3 /* main.m in Sources */,\n\t\t\t\t1A8C5871180E8F0100EF57C3 /* RootViewController.mm in Sources */,\n\t\t\t\t1585AAC81821F8D900000FB5 /* LuaObjectCBridgeTest.mm in Sources */,\n\t\t\t\t1585AB4C1823A55400000FB5 /* lua_assetsmanager_test_sample.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB55517854FE400CDF010 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C5532180E8B1C00EF57C3 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A8C5565180E8B4500EF57C3 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1A6FB79E1785614200CDF010 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A8C566F180E8E9600EF57C3 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1585AB181821FF4C00000FB5 /* LuaObjectCBridgeTest.mm in Sources */,\n\t\t\t\t1A8C587F180E8F0C00EF57C3 /* main.cpp in Sources */,\n\t\t\t\t1585AB4B1823A55400000FB5 /* lua_assetsmanager_test_sample.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1D60588E0D05DD3D006BFB54 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF514A180E2C1A000584C8 /* AccelerometerTest.cpp in Sources */,\n\t\t\t\t1AAF514C180E2C1A000584C8 /* ActionManagerTest.cpp in Sources */,\n\t\t\t\t1AAF514E180E2C1A000584C8 /* ActionsEaseTest.cpp in Sources */,\n\t\t\t\t1AAF5150180E2C1A000584C8 /* ActionsProgressTest.cpp in Sources */,\n\t\t\t\t1AAF5152180E2C1A000584C8 /* ActionsTest.cpp in Sources */,\n\t\t\t\t1AAF5154180E2C1A000584C8 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1AAF5156180E2C1A000584C8 /* BaseTest.cpp in Sources */,\n\t\t\t\t1AAF5158180E2C1A000584C8 /* Box2dTest.cpp in Sources */,\n\t\t\t\t1AAF515A180E2C1A000584C8 /* Box2dView.cpp in Sources */,\n\t\t\t\t1AAF515C180E2C1A000584C8 /* GLES-Render.cpp in Sources */,\n\t\t\t\t1AAF515E180E2C1A000584C8 /* Test.cpp in Sources */,\n\t\t\t\t1AAF5160180E2C1A000584C8 /* TestEntries.cpp in Sources */,\n\t\t\t\t1AAF5162180E2C1A000584C8 /* Bug-1159.cpp in Sources */,\n\t\t\t\t1AAF5164180E2C1A000584C8 /* Bug-1174.cpp in Sources */,\n\t\t\t\t1AAF5166180E2C1A000584C8 /* Bug-350.cpp in Sources */,\n\t\t\t\t1ADCE79B186BCB21001B78A4 /* UILayoutTest.cpp in Sources */,\n\t\t\t\t1AAF5168180E2C1A000584C8 /* Bug-422.cpp in Sources */,\n\t\t\t\t1AAF516A180E2C1A000584C8 /* Bug-458.cpp in Sources */,\n\t\t\t\t50691336184EB453009BBDD7 /* ConsoleTest.cpp in Sources */,\n\t\t\t\t1ADCE79F186BCF19001B78A4 /* UIScrollViewTest.cpp in Sources */,\n\t\t\t\t1ADD146D188D25270034D5EF /* PerformanceEventDispatcherTest.cpp in Sources */,\n\t\t\t\t1ADCE79C186BCB21001B78A4 /* UIListViewTest.cpp in Sources */,\n\t\t\t\t1AAF516C180E2C1A000584C8 /* QuestionContainerSprite.cpp in Sources */,\n\t\t\t\t1AAF516E180E2C1A000584C8 /* Bug-624.cpp in Sources */,\n\t\t\t\t1ADCE79D186BCB21001B78A4 /* UILoadingBarTest.cpp in Sources */,\n\t\t\t\t1AAF5170180E2C1A000584C8 /* Bug-886.cpp in Sources */,\n\t\t\t\t1AAF5172180E2C1A000584C8 /* Bug-899.cpp in Sources */,\n\t\t\t\t1AAF5174180E2C1A000584C8 /* Bug-914.cpp in Sources */,\n\t\t\t\t1AAF5176180E2C1A000584C8 /* BugsTest.cpp in Sources */,\n\t\t\t\t1AAF5178180E2C1A000584C8 /* ChipmunkTest.cpp in Sources */,\n\t\t\t\t1AAF517A180E2C1A000584C8 /* ClickAndMoveTest.cpp in Sources */,\n\t\t\t\t1AAF517C180E2C1A000584C8 /* ClippingNodeTest.cpp in Sources */,\n\t\t\t\t1AAF517E180E2C1A000584C8 /* CocosDenshionTest.cpp in Sources */,\n\t\t\t\t1AAF5180180E2C1A000584C8 /* ConfigurationTest.cpp in Sources */,\n\t\t\t\t1ADCE79E186BCB21001B78A4 /* UIPageViewTest.cpp in Sources */,\n\t\t\t\t1AAF5182180E2C1A000584C8 /* controller.cpp in Sources */,\n\t\t\t\t1AAF5184180E2C1A000584C8 /* CurlTest.cpp in Sources */,\n\t\t\t\t1AAF5186180E2C1A000584C8 /* CurrentLanguageTest.cpp in Sources */,\n\t\t\t\t1AAF5188180E2C1A000584C8 /* DataVisitorTest.cpp in Sources */,\n\t\t\t\t1AAF518A180E2C1A000584C8 /* DrawPrimitivesTest.cpp in Sources */,\n\t\t\t\t1AAF518C180E2C1A000584C8 /* EffectsAdvancedTest.cpp in Sources */,\n\t\t\t\t1AAF518E180E2C1A000584C8 /* EffectsTest.cpp in Sources */,\n\t\t\t\t1AAF5190180E2C1A000584C8 /* AnimationsTestLayer.cpp in Sources */,\n\t\t\t\t37A61460186B21F6007A4638 /* acts.cpp in Sources */,\n\t\t\t\t1AAF5192180E2C1A000584C8 /* ButtonTestLayer.cpp in Sources */,\n\t\t\t\t1AAF5194180E2C1A000584C8 /* CocosBuilderTest.cpp in Sources */,\n\t\t\t\t1AAF5196180E2C1A000584C8 /* HelloCocosBuilderLayer.cpp in Sources */,\n\t\t\t\t4662EB5F188E426300B02E8F /* ReleasePoolTest.cpp in Sources */,\n\t\t\t\t1AAF5198180E2C1A000584C8 /* MenuTestLayer.cpp in Sources */,\n\t\t\t\t1AAF519A180E2C1A000584C8 /* TestHeaderLayer.cpp in Sources */,\n\t\t\t\t1AAF519C180E2C1A000584C8 /* TimelineCallbackTestLayer.cpp in Sources */,\n\t\t\t\t1AAF519E180E2C1A000584C8 /* ArmatureScene.cpp in Sources */,\n\t\t\t\t1AAF51A0180E2C1A000584C8 /* ComponentsTestScene.cpp in Sources */,\n\t\t\t\t1AAF51A2180E2C1A000584C8 /* EnemyController.cpp in Sources */,\n\t\t\t\t1ADCE799186BCB21001B78A4 /* UILabelBMFontTest.cpp in Sources */,\n\t\t\t\t1AAF51A4180E2C1A000584C8 /* GameOverScene.cpp in Sources */,\n\t\t\t\t1AFB0DE31885357A003B2FF3 /* PerformanceContainerTest.cpp in Sources */,\n\t\t\t\t59A79D5D1821E95C00F19697 /* MouseTest.cpp in Sources */,\n\t\t\t\t1AAF51A6180E2C1A000584C8 /* PlayerController.cpp in Sources */,\n\t\t\t\t1ADCE796186BCB20001B78A4 /* UICheckBoxTest.cpp in Sources */,\n\t\t\t\t1AAF51A8180E2C1A000584C8 /* ProjectileController.cpp in Sources */,\n\t\t\t\t1AAF51AA180E2C1A000584C8 /* SceneController.cpp in Sources */,\n\t\t\t\t1ADCE795186BCB20001B78A4 /* UIButtonTest.cpp in Sources */,\n\t\t\t\t1AAF51D4180E2C1A000584C8 /* SceneEditorTest.cpp in Sources */,\n\t\t\t\t1AAF51D6180E2C1A000584C8 /* CCControlButtonTest.cpp in Sources */,\n\t\t\t\t1AAF51D8180E2C1A000584C8 /* CCControlColourPickerTest.cpp in Sources */,\n\t\t\t\t1AAF51DA180E2C1A000584C8 /* CCControlPotentiometerTest.cpp in Sources */,\n\t\t\t\t1AAF51DC180E2C1A000584C8 /* CCControlScene.cpp in Sources */,\n\t\t\t\t1AAF51DE180E2C1A000584C8 /* CCControlSceneManager.cpp in Sources */,\n\t\t\t\t1AAF51E0180E2C1A000584C8 /* CCControlSliderTest.cpp in Sources */,\n\t\t\t\t1AAF51E2180E2C1A000584C8 /* CCControlStepperTest.cpp in Sources */,\n\t\t\t\t1AAF51E4180E2C1A000584C8 /* CCControlSwitchTest.cpp in Sources */,\n\t\t\t\t1ADCE790186BCAB9001B78A4 /* CocosGUIScene.cpp in Sources */,\n\t\t\t\t1AAF51E6180E2C1A000584C8 /* EditBoxTest.cpp in Sources */,\n\t\t\t\t1AAF51E8180E2C1A000584C8 /* ExtensionsTest.cpp in Sources */,\n\t\t\t\t1AAF51EA180E2C1A000584C8 /* HttpClientTest.cpp in Sources */,\n\t\t\t\t1AAF51EC180E2C1A000584C8 /* SocketIOTest.cpp in Sources */,\n\t\t\t\t1AAF51EE180E2C1A000584C8 /* WebSocketTest.cpp in Sources */,\n\t\t\t\t1AAF51F0180E2C1A000584C8 /* NotificationCenterTest.cpp in Sources */,\n\t\t\t\tED3674B9187FA7020038ECFC /* PerformanceRendererTest.cpp in Sources */,\n\t\t\t\t1AAF51F2180E2C1A000584C8 /* Scale9SpriteTest.cpp in Sources */,\n\t\t\t\t1ADCE793186BCAFB001B78A4 /* UIScene.cpp in Sources */,\n\t\t\t\t1AAF51F4180E2C1A000584C8 /* CustomTableViewCell.cpp in Sources */,\n\t\t\t\t1ADCE797186BCB21001B78A4 /* UIImageViewTest.cpp in Sources */,\n\t\t\t\t1AAF51F6180E2C1A000584C8 /* TableViewTestScene.cpp in Sources */,\n\t\t\t\t1AAF51F8180E2C1A000584C8 /* FileUtilsTest.cpp in Sources */,\n\t\t\t\t1AAF51FA180E2C1A000584C8 /* FontTest.cpp in Sources */,\n\t\t\t\t1A087AEE1860418300196EF5 /* PerformanceLabelTest.cpp in Sources */,\n\t\t\t\t1AAF51FC180E2C1A000584C8 /* IntervalTest.cpp in Sources */,\n\t\t\t\t1AAF51FE180E2C1A000584C8 /* KeyboardTest.cpp in Sources */,\n\t\t\t\t1AAF5200180E2C1A000584C8 /* KeypadTest.cpp in Sources */,\n\t\t\t\t1AAF5202180E2C1A000584C8 /* LabelTest.cpp in Sources */,\n\t\t\t\t1AAF5204180E2C1A000584C8 /* LabelTestNew.cpp in Sources */,\n\t\t\t\t1AAF5206180E2C1A000584C8 /* LayerTest.cpp in Sources */,\n\t\t\t\t1AAF5208180E2C1A000584C8 /* MenuTest.cpp in Sources */,\n\t\t\t\t1AAF520A180E2C1A000584C8 /* MotionStreakTest.cpp in Sources */,\n\t\t\t\t1AAF520C180E2C1A000584C8 /* MutiTouchTest.cpp in Sources */,\n\t\t\t\t1A80519718768FD300C117B5 /* UnitTest.cpp in Sources */,\n\t\t\t\t1AAF520E180E2C1A000584C8 /* NewEventDispatcherTest.cpp in Sources */,\n\t\t\t\t1ADCE794186BCAFB001B78A4 /* UISceneManager.cpp in Sources */,\n\t\t\t\t1AAF5210180E2C1A000584C8 /* NodeTest.cpp in Sources */,\n\t\t\t\t1AAF5212180E2C1A000584C8 /* ParallaxTest.cpp in Sources */,\n\t\t\t\t1AAF5214180E2C1A000584C8 /* ParticleTest.cpp in Sources */,\n\t\t\t\t1AAF5216180E2C1A000584C8 /* PerformanceAllocTest.cpp in Sources */,\n\t\t\t\t1AAF5218180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp in Sources */,\n\t\t\t\t1AAF521A180E2C1A000584C8 /* PerformanceParticleTest.cpp in Sources */,\n\t\t\t\t1AAF521C180E2C1A000584C8 /* PerformanceSpriteTest.cpp in Sources */,\n\t\t\t\t1AAF521E180E2C1A000584C8 /* PerformanceTest.cpp in Sources */,\n\t\t\t\t1AAF5220180E2C1A000584C8 /* PerformanceTextureTest.cpp in Sources */,\n\t\t\t\t1AAF5222180E2C1A000584C8 /* PerformanceTouchesTest.cpp in Sources */,\n\t\t\t\t1AAF5224180E2C1A000584C8 /* PhysicsTest.cpp in Sources */,\n\t\t\t\t599121E6182C74AC00CE785B /* NewRendererTest.cpp in Sources */,\n\t\t\t\t1AAF5226180E2C1A000584C8 /* RenderTextureTest.cpp in Sources */,\n\t\t\t\t1AAF5228180E2C1A000584C8 /* RotateWorldTest.cpp in Sources */,\n\t\t\t\t1AAF522A180E2C1A000584C8 /* SceneTest.cpp in Sources */,\n\t\t\t\t1AAF522C180E2C1A000584C8 /* SchedulerTest.cpp in Sources */,\n\t\t\t\t1ADCE7A0186BCF19001B78A4 /* UISliderTest.cpp in Sources */,\n\t\t\t\t1AAF522E180E2C1A000584C8 /* ShaderTest.cpp in Sources */,\n\t\t\t\t1AAF5230180E2C1A000584C8 /* ShaderTest2.cpp in Sources */,\n\t\t\t\t1ADCE79A186BCB21001B78A4 /* UILabelTest.cpp in Sources */,\n\t\t\t\t1AAF5232180E2C1A000584C8 /* SpineTest.cpp in Sources */,\n\t\t\t\t37A61462186B21F6007A4638 /* cons.cpp in Sources */,\n\t\t\t\t1ADCE7A1186BCF19001B78A4 /* UITextFieldTest.cpp in Sources */,\n\t\t\t\t1AAF5234180E2C1A000584C8 /* SpriteTest.cpp in Sources */,\n\t\t\t\t1AAF5236180E2C1A000584C8 /* testBasic.cpp in Sources */,\n\t\t\t\t1AAF5238180E2C1A000584C8 /* TextInputTest.cpp in Sources */,\n\t\t\t\t1AAF523A180E2C1A000584C8 /* Texture2dTest.cpp in Sources */,\n\t\t\t\t1AAF523C180E2C1A000584C8 /* TextureCacheTest.cpp in Sources */,\n\t\t\t\t1AAF523E180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp in Sources */,\n\t\t\t\t1AAF5240180E2C1A000584C8 /* TileMapTest.cpp in Sources */,\n\t\t\t\t1AAF5242180E2C1A000584C8 /* Ball.cpp in Sources */,\n\t\t\t\t1AAF5244180E2C1A000584C8 /* Paddle.cpp in Sources */,\n\t\t\t\t1ADCE798186BCB21001B78A4 /* UILabelAtlasTest.cpp in Sources */,\n\t\t\t\t1AAF5246180E2C1A000584C8 /* TouchesTest.cpp in Sources */,\n\t\t\t\t1AAF5248180E2C1A000584C8 /* TransitionsTest.cpp in Sources */,\n\t\t\t\t1AAF524A180E2C1A000584C8 /* UserDefaultTest.cpp in Sources */,\n\t\t\t\t1ADCE7A2186BCF19001B78A4 /* UIWidgetAddNodeTest.cpp in Sources */,\n\t\t\t\t1AAF524C180E2C1A000584C8 /* VisibleRect.cpp in Sources */,\n\t\t\t\t1AAF524E180E2C1A000584C8 /* ZwoptexTest.cpp in Sources */,\n\t\t\t\t1AAF5289180E2C31000584C8 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E167E1784BDA100B0CA4A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t460E456A1807E767000CDD6D /* RootViewController.mm in Sources */,\n\t\t\t\t460E45691807E767000CDD6D /* AppController.mm in Sources */,\n\t\t\t\t468588DA180805F100AC387D /* main.m in Sources */,\n\t\t\t\t1A6A41E6180BE41100565AC2 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A6A41E8180BE41100565AC2 /* GameOverScene.cpp in Sources */,\n\t\t\t\t1A6A41EA180BE41100565AC2 /* HelloWorldScene.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E16F51784C06E00B0CA4A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A9DC2A4180E65D4007A3AD4 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A9DC2C8180E668B007A3AD4 /* AppController.mm in Sources */,\n\t\t\t\t1A9DC2D5180E668B007A3AD4 /* main.m in Sources */,\n\t\t\t\t1A9DC2D6180E668B007A3AD4 /* RootViewController.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E183E1784C45400B0CA4A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E41180E7F1500497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1E54180E7F1E00497A22 /* AppController.mm in Sources */,\n\t\t\t\t1A3B1E60180E7F1E00497A22 /* main.m in Sources */,\n\t\t\t\t1A3B1E61180E7F1E00497A22 /* RootViewController.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18731784C4D600B0CA4A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1DB4180E7C4700497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1DCA180E7C5100497A22 /* AppController.mm in Sources */,\n\t\t\t\t1A3B1DD9180E7C5100497A22 /* main.m in Sources */,\n\t\t\t\t1A3B1DDA180E7C5100497A22 /* RootViewController.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18A81784C4DC00B0CA4A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1EFC180E828300497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1F0F180E828E00497A22 /* AppController.mm in Sources */,\n\t\t\t\t1A3B1F1B180E828E00497A22 /* main.m in Sources */,\n\t\t\t\t1A3B1F1C180E828E00497A22 /* RootViewController.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA01E18DD1784C4E000B0CA4A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1EA0180E80B600497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1EB3180E80BD00497A22 /* AppController.mm in Sources */,\n\t\t\t\t1A3B1EBF180E80BD00497A22 /* main.m in Sources */,\n\t\t\t\t1A3B1EC0180E80BD00497A22 /* RootViewController.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A5701782290400987F6C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A9DC2A3180E65D4007A3AD4 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A9DC2B3180E6681007A3AD4 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A7661782301C00987F6C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E26180E7EFA00497A22 /* boot-html5.js in Sources */,\n\t\t\t\t1A3B1E28180E7EFA00497A22 /* boot-jsb.js in Sources */,\n\t\t\t\t1A3B1E2C180E7EFA00497A22 /* levels.js in Sources */,\n\t\t\t\t1A3B1E2E180E7EFA00497A22 /* main.js in Sources */,\n\t\t\t\t1A3B1E34180E7EFA00497A22 /* resources-html5.js in Sources */,\n\t\t\t\t1A3B1E36180E7EFA00497A22 /* resources-jsb.js in Sources */,\n\t\t\t\t1A3B1E38180E7EFA00497A22 /* watermelon_with_me.js in Sources */,\n\t\t\t\t1A3B1E40180E7F1500497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1E6E180E7F2400497A22 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035A9E017823FE100987F6C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1DB3180E7C4700497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1DE7180E7C5C00497A22 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AAAE1782422400987F6C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1EFB180E828300497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1F29180E829600497A22 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AC201782453000987F6C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A3B1E9F180E80B600497A22 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A3B1ECD180E80C700497A22 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035ACFA178254A300987F6C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1A6A41E7180BE41100565AC2 /* GameOverScene.cpp in Sources */,\n\t\t\t\t1A6A41E9180BE41100565AC2 /* HelloWorldScene.cpp in Sources */,\n\t\t\t\t1A6A41E5180BE41100565AC2 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1A9141A4180BEB6A00CFC31F /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA035AE73178255DC00987F6C /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A174E81807D96A005B8026 /* HelloWorldScene.cpp in Sources */,\n\t\t\t\t46A174E71807D95B005B8026 /* AppDelegate.cpp in Sources */,\n\t\t\t\t46A175001807D9CB005B8026 /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A51AD1783A1D20073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AAF514B180E2C1A000584C8 /* AccelerometerTest.cpp in Sources */,\n\t\t\t\t1AAF514D180E2C1A000584C8 /* ActionManagerTest.cpp in Sources */,\n\t\t\t\t4662EB60188E426300B02E8F /* ReleasePoolTest.cpp in Sources */,\n\t\t\t\t1AAF514F180E2C1A000584C8 /* ActionsEaseTest.cpp in Sources */,\n\t\t\t\t1AAF5151180E2C1A000584C8 /* ActionsProgressTest.cpp in Sources */,\n\t\t\t\t1AAF5153180E2C1A000584C8 /* ActionsTest.cpp in Sources */,\n\t\t\t\t1AAF5155180E2C1A000584C8 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1AAF5157180E2C1A000584C8 /* BaseTest.cpp in Sources */,\n\t\t\t\t1AAF5159180E2C1A000584C8 /* Box2dTest.cpp in Sources */,\n\t\t\t\t1AAF515B180E2C1A000584C8 /* Box2dView.cpp in Sources */,\n\t\t\t\t1AAF515D180E2C1A000584C8 /* GLES-Render.cpp in Sources */,\n\t\t\t\t1A087AEF1860418300196EF5 /* PerformanceLabelTest.cpp in Sources */,\n\t\t\t\t1AAF515F180E2C1A000584C8 /* Test.cpp in Sources */,\n\t\t\t\t50D36105186819DB00828878 /* UIScene.cpp in Sources */,\n\t\t\t\t1AAF5161180E2C1A000584C8 /* TestEntries.cpp in Sources */,\n\t\t\t\t1AAF5163180E2C1A000584C8 /* Bug-1159.cpp in Sources */,\n\t\t\t\t1AAF5165180E2C1A000584C8 /* Bug-1174.cpp in Sources */,\n\t\t\t\t50D36101186819DB00828878 /* UILayoutTest.cpp in Sources */,\n\t\t\t\t1AAF5167180E2C1A000584C8 /* Bug-350.cpp in Sources */,\n\t\t\t\t1AAF5169180E2C1A000584C8 /* Bug-422.cpp in Sources */,\n\t\t\t\t1AAF516B180E2C1A000584C8 /* Bug-458.cpp in Sources */,\n\t\t\t\tED3674BA187FA7020038ECFC /* PerformanceRendererTest.cpp in Sources */,\n\t\t\t\t50D36102186819DB00828878 /* UIListViewTest.cpp in Sources */,\n\t\t\t\t1AAF516D180E2C1A000584C8 /* QuestionContainerSprite.cpp in Sources */,\n\t\t\t\t1AAF516F180E2C1A000584C8 /* Bug-624.cpp in Sources */,\n\t\t\t\t1ADD146E188D25270034D5EF /* PerformanceEventDispatcherTest.cpp in Sources */,\n\t\t\t\t50D36103186819DB00828878 /* UILoadingBarTest.cpp in Sources */,\n\t\t\t\t1AAF5171180E2C1A000584C8 /* Bug-886.cpp in Sources */,\n\t\t\t\t1AAF5173180E2C1A000584C8 /* Bug-899.cpp in Sources */,\n\t\t\t\t1AAF5175180E2C1A000584C8 /* Bug-914.cpp in Sources */,\n\t\t\t\t1AAF5177180E2C1A000584C8 /* BugsTest.cpp in Sources */,\n\t\t\t\t1AAF5179180E2C1A000584C8 /* ChipmunkTest.cpp in Sources */,\n\t\t\t\t1AAF517B180E2C1A000584C8 /* ClickAndMoveTest.cpp in Sources */,\n\t\t\t\t1AAF517D180E2C1A000584C8 /* ClippingNodeTest.cpp in Sources */,\n\t\t\t\t1AAF517F180E2C1A000584C8 /* CocosDenshionTest.cpp in Sources */,\n\t\t\t\t1AAF5181180E2C1A000584C8 /* ConfigurationTest.cpp in Sources */,\n\t\t\t\t50D36104186819DB00828878 /* UIPageViewTest.cpp in Sources */,\n\t\t\t\t1AAF5183180E2C1A000584C8 /* controller.cpp in Sources */,\n\t\t\t\t1AAF5185180E2C1A000584C8 /* CurlTest.cpp in Sources */,\n\t\t\t\t1AAF5187180E2C1A000584C8 /* CurrentLanguageTest.cpp in Sources */,\n\t\t\t\t50D36109186819DB00828878 /* UITextFieldTest.cpp in Sources */,\n\t\t\t\t1AAF5189180E2C1A000584C8 /* DataVisitorTest.cpp in Sources */,\n\t\t\t\t1AAF518B180E2C1A000584C8 /* DrawPrimitivesTest.cpp in Sources */,\n\t\t\t\t1AAF518D180E2C1A000584C8 /* EffectsAdvancedTest.cpp in Sources */,\n\t\t\t\t1AAF518F180E2C1A000584C8 /* EffectsTest.cpp in Sources */,\n\t\t\t\t1AAF5191180E2C1A000584C8 /* AnimationsTestLayer.cpp in Sources */,\n\t\t\t\t37A61461186B21F6007A4638 /* acts.cpp in Sources */,\n\t\t\t\t1AAF5193180E2C1A000584C8 /* ButtonTestLayer.cpp in Sources */,\n\t\t\t\t1AAF5195180E2C1A000584C8 /* CocosBuilderTest.cpp in Sources */,\n\t\t\t\t1AAF5197180E2C1A000584C8 /* HelloCocosBuilderLayer.cpp in Sources */,\n\t\t\t\t1AAF5199180E2C1A000584C8 /* MenuTestLayer.cpp in Sources */,\n\t\t\t\t1AAF519B180E2C1A000584C8 /* TestHeaderLayer.cpp in Sources */,\n\t\t\t\t1AAF519D180E2C1A000584C8 /* TimelineCallbackTestLayer.cpp in Sources */,\n\t\t\t\t50D36108186819DB00828878 /* UISliderTest.cpp in Sources */,\n\t\t\t\t1AAF519F180E2C1A000584C8 /* ArmatureScene.cpp in Sources */,\n\t\t\t\t1AAF51A1180E2C1A000584C8 /* ComponentsTestScene.cpp in Sources */,\n\t\t\t\t1AAF51A3180E2C1A000584C8 /* EnemyController.cpp in Sources */,\n\t\t\t\t50D360FF186819DB00828878 /* UILabelBMFontTest.cpp in Sources */,\n\t\t\t\t1AAF51A5180E2C1A000584C8 /* GameOverScene.cpp in Sources */,\n\t\t\t\t1AAF51A7180E2C1A000584C8 /* PlayerController.cpp in Sources */,\n\t\t\t\t1AAF51A9180E2C1A000584C8 /* ProjectileController.cpp in Sources */,\n\t\t\t\t50D360FC186819DB00828878 /* UICheckBoxTest.cpp in Sources */,\n\t\t\t\t1AAF51AB180E2C1A000584C8 /* SceneController.cpp in Sources */,\n\t\t\t\t50D36107186819DB00828878 /* UIScrollViewTest.cpp in Sources */,\n\t\t\t\t50D360FA186819DB00828878 /* CocosGUIScene.cpp in Sources */,\n\t\t\t\t50D3610A186819DB00828878 /* UIWidgetAddNodeTest.cpp in Sources */,\n\t\t\t\t50D360FB186819DB00828878 /* UIButtonTest.cpp in Sources */,\n\t\t\t\t1AAF51D5180E2C1A000584C8 /* SceneEditorTest.cpp in Sources */,\n\t\t\t\t1AAF51D7180E2C1A000584C8 /* CCControlButtonTest.cpp in Sources */,\n\t\t\t\t1AAF51D9180E2C1A000584C8 /* CCControlColourPickerTest.cpp in Sources */,\n\t\t\t\t1AAF51DB180E2C1A000584C8 /* CCControlPotentiometerTest.cpp in Sources */,\n\t\t\t\t1AAF51DD180E2C1A000584C8 /* CCControlScene.cpp in Sources */,\n\t\t\t\t1AAF51DF180E2C1A000584C8 /* CCControlSceneManager.cpp in Sources */,\n\t\t\t\t1AAF51E1180E2C1A000584C8 /* CCControlSliderTest.cpp in Sources */,\n\t\t\t\t1AAF51E3180E2C1A000584C8 /* CCControlStepperTest.cpp in Sources */,\n\t\t\t\t1AAF51E5180E2C1A000584C8 /* CCControlSwitchTest.cpp in Sources */,\n\t\t\t\t1AAF51E7180E2C1A000584C8 /* EditBoxTest.cpp in Sources */,\n\t\t\t\t1AAF51E9180E2C1A000584C8 /* ExtensionsTest.cpp in Sources */,\n\t\t\t\t1AAF51EB180E2C1A000584C8 /* HttpClientTest.cpp in Sources */,\n\t\t\t\t1AAF51ED180E2C1A000584C8 /* SocketIOTest.cpp in Sources */,\n\t\t\t\t1AAF51EF180E2C1A000584C8 /* WebSocketTest.cpp in Sources */,\n\t\t\t\t1AAF51F1180E2C1A000584C8 /* NotificationCenterTest.cpp in Sources */,\n\t\t\t\t1AAF51F3180E2C1A000584C8 /* Scale9SpriteTest.cpp in Sources */,\n\t\t\t\t50D36106186819DB00828878 /* UISceneManager.cpp in Sources */,\n\t\t\t\t599121E7182C74AC00CE785B /* NewRendererTest.cpp in Sources */,\n\t\t\t\t1AAF51F5180E2C1A000584C8 /* CustomTableViewCell.cpp in Sources */,\n\t\t\t\t1AAF51F7180E2C1A000584C8 /* TableViewTestScene.cpp in Sources */,\n\t\t\t\t50D360FD186819DB00828878 /* UIImageViewTest.cpp in Sources */,\n\t\t\t\t1A80519818768FD300C117B5 /* UnitTest.cpp in Sources */,\n\t\t\t\t1AAF51F9180E2C1A000584C8 /* FileUtilsTest.cpp in Sources */,\n\t\t\t\t1AFB0DE41885357A003B2FF3 /* PerformanceContainerTest.cpp in Sources */,\n\t\t\t\t1AAF51FB180E2C1A000584C8 /* FontTest.cpp in Sources */,\n\t\t\t\t1AAF51FD180E2C1A000584C8 /* IntervalTest.cpp in Sources */,\n\t\t\t\t1AAF51FF180E2C1A000584C8 /* KeyboardTest.cpp in Sources */,\n\t\t\t\t1AAF5201180E2C1A000584C8 /* KeypadTest.cpp in Sources */,\n\t\t\t\t1AAF5203180E2C1A000584C8 /* LabelTest.cpp in Sources */,\n\t\t\t\t1AAF5205180E2C1A000584C8 /* LabelTestNew.cpp in Sources */,\n\t\t\t\t1AAF5207180E2C1A000584C8 /* LayerTest.cpp in Sources */,\n\t\t\t\t1AAF5209180E2C1A000584C8 /* MenuTest.cpp in Sources */,\n\t\t\t\t1AAF520B180E2C1A000584C8 /* MotionStreakTest.cpp in Sources */,\n\t\t\t\t1AAF520D180E2C1A000584C8 /* MutiTouchTest.cpp in Sources */,\n\t\t\t\t1AAF520F180E2C1A000584C8 /* NewEventDispatcherTest.cpp in Sources */,\n\t\t\t\t1AAF5211180E2C1A000584C8 /* NodeTest.cpp in Sources */,\n\t\t\t\t1AAF5213180E2C1A000584C8 /* ParallaxTest.cpp in Sources */,\n\t\t\t\t1AAF5215180E2C1A000584C8 /* ParticleTest.cpp in Sources */,\n\t\t\t\t1AAF5217180E2C1A000584C8 /* PerformanceAllocTest.cpp in Sources */,\n\t\t\t\t1AAF5219180E2C1A000584C8 /* PerformanceNodeChildrenTest.cpp in Sources */,\n\t\t\t\t1AAF521B180E2C1A000584C8 /* PerformanceParticleTest.cpp in Sources */,\n\t\t\t\t37A61463186B21F6007A4638 /* cons.cpp in Sources */,\n\t\t\t\t1AAF521D180E2C1A000584C8 /* PerformanceSpriteTest.cpp in Sources */,\n\t\t\t\t59A79D5E1821E95C00F19697 /* MouseTest.cpp in Sources */,\n\t\t\t\t50691337184EB453009BBDD7 /* ConsoleTest.cpp in Sources */,\n\t\t\t\t1AAF521F180E2C1A000584C8 /* PerformanceTest.cpp in Sources */,\n\t\t\t\t1AAF5221180E2C1A000584C8 /* PerformanceTextureTest.cpp in Sources */,\n\t\t\t\t1AAF5223180E2C1A000584C8 /* PerformanceTouchesTest.cpp in Sources */,\n\t\t\t\t1AAF5225180E2C1A000584C8 /* PhysicsTest.cpp in Sources */,\n\t\t\t\t1AAF5227180E2C1A000584C8 /* RenderTextureTest.cpp in Sources */,\n\t\t\t\t1AAF5229180E2C1A000584C8 /* RotateWorldTest.cpp in Sources */,\n\t\t\t\t1AAF522B180E2C1A000584C8 /* SceneTest.cpp in Sources */,\n\t\t\t\t1AAF522D180E2C1A000584C8 /* SchedulerTest.cpp in Sources */,\n\t\t\t\t1AAF522F180E2C1A000584C8 /* ShaderTest.cpp in Sources */,\n\t\t\t\t1AAF5231180E2C1A000584C8 /* ShaderTest2.cpp in Sources */,\n\t\t\t\t1AAF5233180E2C1A000584C8 /* SpineTest.cpp in Sources */,\n\t\t\t\t1AAF5235180E2C1A000584C8 /* SpriteTest.cpp in Sources */,\n\t\t\t\t50D36100186819DB00828878 /* UILabelTest.cpp in Sources */,\n\t\t\t\t1AAF5237180E2C1A000584C8 /* testBasic.cpp in Sources */,\n\t\t\t\t1AAF5239180E2C1A000584C8 /* TextInputTest.cpp in Sources */,\n\t\t\t\t1AAF523B180E2C1A000584C8 /* Texture2dTest.cpp in Sources */,\n\t\t\t\t1AAF523D180E2C1A000584C8 /* TextureCacheTest.cpp in Sources */,\n\t\t\t\t1AAF523F180E2C1A000584C8 /* TextureAtlasEncryptionTest.cpp in Sources */,\n\t\t\t\t1AAF5241180E2C1A000584C8 /* TileMapTest.cpp in Sources */,\n\t\t\t\t1AAF5243180E2C1A000584C8 /* Ball.cpp in Sources */,\n\t\t\t\t1AAF5245180E2C1A000584C8 /* Paddle.cpp in Sources */,\n\t\t\t\t1AAF5247180E2C1A000584C8 /* TouchesTest.cpp in Sources */,\n\t\t\t\t1AAF5249180E2C1A000584C8 /* TransitionsTest.cpp in Sources */,\n\t\t\t\t50D360FE186819DB00828878 /* UILabelAtlasTest.cpp in Sources */,\n\t\t\t\t1AAF524B180E2C1A000584C8 /* UserDefaultTest.cpp in Sources */,\n\t\t\t\t1AAF524D180E2C1A000584C8 /* VisibleRect.cpp in Sources */,\n\t\t\t\t1AAF524F180E2C1A000584C8 /* ZwoptexTest.cpp in Sources */,\n\t\t\t\t1AAF5269180E2C26000584C8 /* RootViewController.mm in Sources */,\n\t\t\t\t1AAF526A180E2C26000584C8 /* testsAppDelegate.mm in Sources */,\n\t\t\t\t1AAF527B180E2C26000584C8 /* main.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tA07A53041784AC9B0073F6A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t46A175011807D9E2005B8026 /* AppController.mm in Sources */,\n\t\t\t\t46A175031807D9E2005B8026 /* RootViewController.mm in Sources */,\n\t\t\t\t46A174EA1807D976005B8026 /* HelloWorldScene.cpp in Sources */,\n\t\t\t\t46A175021807D9E2005B8026 /* main.m in Sources */,\n\t\t\t\t46A174E91807D976005B8026 /* AppDelegate.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t1A3B1DE9180E7C9C00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1A3B1DE8180E7C9C00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1DEB180E7C9C00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1A3B1DEA180E7C9C00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1DED180E7C9C00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1A3B1DEC180E7C9C00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1DEF180E7C9C00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1A3B1DEE180E7C9C00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1DF1180E7C9C00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings Mac\";\n\t\t\ttargetProxy = 1A3B1DF0180E7C9C00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E0B180E7E1D00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1A3B1E0A180E7E1D00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E0D180E7E1D00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1A3B1E0C180E7E1D00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E0F180E7E1D00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1A3B1E0E180E7E1D00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E11180E7E1D00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1A3B1E10180E7E1D00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E13180E7E1D00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings iOS\";\n\t\t\ttargetProxy = 1A3B1E12180E7E1D00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E70180E7F3E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1A3B1E6F180E7F3E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E72180E7F3E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1A3B1E71180E7F3E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E74180E7F3E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1A3B1E73180E7F3E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E76180E7F3E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1A3B1E75180E7F3E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E78180E7F3E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings Mac\";\n\t\t\ttargetProxy = 1A3B1E77180E7F3E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E86180E804400497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1A3B1E85180E804400497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E88180E804400497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1A3B1E87180E804400497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E8A180E804400497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1A3B1E89180E804400497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E8C180E804400497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1A3B1E8B180E804400497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1E8E180E804400497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings iOS\";\n\t\t\ttargetProxy = 1A3B1E8D180E804400497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1ED3180E810E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1A3B1ED2180E810E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1ED5180E810E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1A3B1ED4180E810E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1ED7180E810E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1A3B1ED6180E810E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1ED9180E810E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1A3B1ED8180E810E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1EDB180E810E00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings Mac\";\n\t\t\ttargetProxy = 1A3B1EDA180E810E00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1EE2180E81AA00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1A3B1EE1180E81AA00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1EE4180E81AA00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1A3B1EE3180E81AA00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1EE6180E81AA00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1A3B1EE5180E81AA00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1EE8180E81AA00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1A3B1EE7180E81AA00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1EEA180E81AA00497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings iOS\";\n\t\t\ttargetProxy = 1A3B1EE9180E81AA00497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F2B180E82B800497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1A3B1F2A180E82B800497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F2D180E82B800497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1A3B1F2C180E82B800497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F2F180E82B800497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1A3B1F2E180E82B800497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F31180E82B800497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1A3B1F30180E82B800497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F33180E82B800497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings Mac\";\n\t\t\ttargetProxy = 1A3B1F32180E82B800497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F3A180E82D200497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1A3B1F39180E82D200497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F3C180E82D200497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1A3B1F3B180E82D200497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F3E180E82D200497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1A3B1F3D180E82D200497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F40180E82D200497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1A3B1F3F180E82D200497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A3B1F42180E82D200497A22 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings iOS\";\n\t\t\ttargetProxy = 1A3B1F41180E82D200497A22 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A6FB50117854AEA00CDF010 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1A1197B31785363400D62A44 /* Hello lua iOS */;\n\t\t\ttargetProxy = 1A6FB50017854AEA00CDF010 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A6FB50317854AEA00CDF010 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1A11982D178538E400D62A44 /* Test lua iOS */;\n\t\t\ttargetProxy = 1A6FB50217854AEA00CDF010 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A6FB7E31785682700CDF010 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1A6FB53517854FE400CDF010 /* Hello lua Mac */;\n\t\t\ttargetProxy = 1A6FB7E21785682700CDF010 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A6FB7E51785682700CDF010 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1A6FB7821785614200CDF010 /* Test lua Mac */;\n\t\t\ttargetProxy = 1A6FB7E41785682700CDF010 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C55BB180E8BA400EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1A8C55BA180E8BA400EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C55BD180E8BA400EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1A8C55BC180E8BA400EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C55BF180E8BA400EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1A8C55BE180E8BA400EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C55C1180E8BA400EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1A8C55C0180E8BA400EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C55C3180E8BA400EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"luabindings Mac\";\n\t\t\ttargetProxy = 1A8C55C2180E8BA400EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C565D180E8DFB00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1A8C565C180E8DFB00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C565F180E8DFB00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1A8C565E180E8DFB00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5661180E8DFB00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1A8C5660180E8DFB00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5663180E8DFB00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1A8C5662180E8DFB00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5665180E8DFB00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"luabindings iOS\";\n\t\t\ttargetProxy = 1A8C5664180E8DFB00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5881180E8F5F00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1A8C5880180E8F5F00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5883180E8F5F00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1A8C5882180E8F5F00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5885180E8F5F00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1A8C5884180E8F5F00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5887180E8F5F00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1A8C5886180E8F5F00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5889180E8F5F00EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"luabindings Mac\";\n\t\t\ttargetProxy = 1A8C5888180E8F5F00EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5890180E8F8000EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1A8C588F180E8F8000EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5892180E8F8000EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1A8C5891180E8F8000EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5894180E8F8000EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1A8C5893180E8F8000EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5896180E8F8000EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1A8C5895180E8F8000EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A8C5898180E8F8000EF57C3 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"luabindings iOS\";\n\t\t\ttargetProxy = 1A8C5897180E8F8000EF57C3 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DC9E8180E68CE007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1A9DC9E7180E68CE007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DC9EA180E68CE007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1A9DC9E9180E68CE007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DC9EC180E68CE007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1A9DC9EB180E68CE007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DC9EE180E68CE007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1A9DC9ED180E68CE007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DC9F0180E68CE007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings Mac\";\n\t\t\ttargetProxy = 1A9DC9EF180E68CE007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DCA57180E743F007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1A9DCA56180E743F007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DCA59180E743F007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1A9DCA58180E743F007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DCA5B180E743F007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1A9DCA5A180E743F007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DCA5D180E743F007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1A9DCA5C180E743F007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1A9DCA5F180E743F007A3AD4 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"jsbindings iOS\";\n\t\t\ttargetProxy = 1A9DCA5E180E743F007A3AD4 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF5342180E2F41000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 1AAF5341180E2F41000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF5344180E2F41000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions Mac\";\n\t\t\ttargetProxy = 1AAF5343180E2F41000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF5346180E2F41000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk Mac\";\n\t\t\ttargetProxy = 1AAF5345180E2F41000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF5348180E2F41000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"box2d Mac\";\n\t\t\ttargetProxy = 1AAF5347180E2F41000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF534A180E2F41000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 1AAF5349180E2F41000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF53F5180E39C6000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 1AAF53F4180E39C6000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF53F7180E39C6000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx-extensions iOS\";\n\t\t\ttargetProxy = 1AAF53F6180E39C6000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF53F9180E39C6000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"chipmunk iOS\";\n\t\t\ttargetProxy = 1AAF53F8180E39C6000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF53FB180E39C6000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"box2d iOS\";\n\t\t\ttargetProxy = 1AAF53FA180E39C6000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1AAF53FD180E39C6000584C8 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 1AAF53FC180E39C6000584C8 /* PBXContainerItemProxy */;\n\t\t};\n\t\t460E44BA1807DCCC000CDD6D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 460E44B91807DCCC000CDD6D /* PBXContainerItemProxy */;\n\t\t};\n\t\t460E44FC1807E408000CDD6D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 460E44FB1807E408000CDD6D /* PBXContainerItemProxy */;\n\t\t};\n\t\t460E44FF1807E656000CDD6D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx iOS\";\n\t\t\ttargetProxy = 460E44FE1807E656000CDD6D /* PBXContainerItemProxy */;\n\t\t};\n\t\t460E45831807FDB0000CDD6D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"cocos2dx Mac\";\n\t\t\ttargetProxy = 460E45821807FDB0000CDD6D /* PBXContainerItemProxy */;\n\t\t};\n\t\t460E45851807FDB0000CDD6D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion Mac\";\n\t\t\ttargetProxy = 460E45841807FDB0000CDD6D /* PBXContainerItemProxy */;\n\t\t};\n\t\t460E45DE18080218000CDD6D /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\tname = \"CocosDenshion iOS\";\n\t\t\ttargetProxy = 460E45DD18080218000CDD6D /* PBXContainerItemProxy */;\n\t\t};\n\t\tA01E17E21784C3EB00B0CA4A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A52CF1784AC9B0073F6A7 /* Hello cpp iOS */;\n\t\t\ttargetProxy = A01E17E11784C3EB00B0CA4A /* PBXContainerItemProxy */;\n\t\t};\n\t\tA01E17E41784C3EB00B0CA4A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A01E16631784BDA100B0CA4A /* Simple Game iOS */;\n\t\t\ttargetProxy = A01E17E31784C3EB00B0CA4A /* PBXContainerItemProxy */;\n\t\t};\n\t\tA01E17E61784C3EB00B0CA4A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A01E16C01784C06E00B0CA4A /* Test JavaScript iOS */;\n\t\t\ttargetProxy = A01E17E51784C3EB00B0CA4A /* PBXContainerItemProxy */;\n\t\t};\n\t\tA01E19971784C8DD00B0CA4A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A01E17E71784C45400B0CA4A /* JS Watermelon With Me iOS */;\n\t\t\ttargetProxy = A01E19961784C8DD00B0CA4A /* PBXContainerItemProxy */;\n\t\t};\n\t\tA01E19991784C8DD00B0CA4A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A01E18591784C4D600B0CA4A /* JS Moon Warriors iOS */;\n\t\t\ttargetProxy = A01E19981784C8DD00B0CA4A /* PBXContainerItemProxy */;\n\t\t};\n\t\tA01E199B1784C8DD00B0CA4A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A01E188E1784C4DC00B0CA4A /* JS Crystal Craze iOS */;\n\t\t\ttargetProxy = A01E199A1784C8DD00B0CA4A /* PBXContainerItemProxy */;\n\t\t};\n\t\tA01E199D1784C8DD00B0CA4A /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A01E18C31784C4E000B0CA4A /* JS CocosDragon iOS */;\n\t\t\ttargetProxy = A01E199C1784C8DD00B0CA4A /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035ACC0178246BD00987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1D6058900D05DD3D006BFB54 /* Test cpp Mac */;\n\t\t\ttargetProxy = A035ACBF178246BD00987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035ACC2178246BD00987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A035A5441782290400987F6C /* Test JavaScript Mac */;\n\t\t\ttargetProxy = A035ACC1178246BD00987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035ACC4178246BD00987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A035A7131782301C00987F6C /* JS Watermelon With Me Mac */;\n\t\t\ttargetProxy = A035ACC3178246BD00987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035ACC6178246BD00987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A035A9BA17823FE100987F6C /* JS Moon Warriors Mac */;\n\t\t\ttargetProxy = A035ACC5178246BD00987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035ACC8178246BD00987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A035AA8D1782422400987F6C /* JS Crystal Craze Mac */;\n\t\t\ttargetProxy = A035ACC7178246BD00987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035ACCA178246BD00987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A035AC021782453000987F6C /* JS CocosDragon Mac */;\n\t\t\ttargetProxy = A035ACC9178246BD00987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035AF731782569500987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A035AE58178255DC00987F6C /* Hello cpp Mac */;\n\t\t\ttargetProxy = A035AF721782569500987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA035AF751782569500987F6C /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A035ACCE178254A300987F6C /* Simple Game Mac */;\n\t\t\ttargetProxy = A035AF741782569500987F6C /* PBXContainerItemProxy */;\n\t\t};\n\t\tA07A526D1783AB980073F6A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = A07A517F1783A1D20073F6A7 /* Test cpp iOS */;\n\t\t\ttargetProxy = A07A526C1783AB980073F6A7 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t1A3B1DDC180E7C5C00497A22 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1DDD180E7C5C00497A22 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1DDE180E7C5C00497A22 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1DDF180E7C5C00497A22 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E63180E7F2400497A22 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E64180E7F2400497A22 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1E65180E7F2400497A22 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1E66180E7F2400497A22 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EC2180E80C700497A22 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EC3180E80C700497A22 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1EC4180E80C700497A22 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1EC5180E80C700497A22 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F1E180E829600497A22 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1F1F180E829600497A22 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A3B1F20180E829600497A22 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A3B1F21180E829600497A22 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5559180E8B4500EF57C3 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C555A180E8B4500EF57C3 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C555B180E8B4500EF57C3 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C555C180E8B4500EF57C3 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5873180E8F0C00EF57C3 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C5874180E8F0C00EF57C3 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A8C5875180E8F0C00EF57C3 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A8C5876180E8F0C00EF57C3 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A91419A180BEB6A00CFC31F /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A91419B180BEB6A00CFC31F /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A91419C180BEB6A00CFC31F /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A91419D180BEB6A00CFC31F /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC2A6180E6681007A3AD4 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DC2A7180E6681007A3AD4 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A9DC2A8180E6681007A3AD4 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1A9DC2A9180E6681007A3AD4 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF527E180E2C31000584C8 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF527F180E2C31000584C8 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1AAF5280180E2C31000584C8 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1AAF5281180E2C31000584C8 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A174C61807D934005B8026 /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t46A174C71807D934005B8026 /* en */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t46A174C81807D934005B8026 /* MainMenu.xib */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t46A174C91807D934005B8026 /* en */,\n\t\t\t);\n\t\t\tname = MainMenu.xib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t1A1197D51785363400D62A44 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/HelloLua/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1A1197D61785363400D62A44 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/HelloLua/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1A11986E178538E400D62A44 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/TestLua/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1A11986F178538E400D62A44 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/TestLua/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1A6FB56917854FE400CDF010 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/HelloLua/proj.mac/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"\";\n\t\t\t\t\"OTHER_LDFLAGS[arch=x86_64]\" = (\n\t\t\t\t\t\"-pagezero_size\",\n\t\t\t\t\t10000,\n\t\t\t\t\t\"-image_base\",\n\t\t\t\t\t100000000,\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1A6FB56A17854FE400CDF010 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/HelloLua/proj.mac/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"\";\n\t\t\t\t\"OTHER_LDFLAGS[arch=x86_64]\" = (\n\t\t\t\t\t\"-pagezero_size\",\n\t\t\t\t\t10000,\n\t\t\t\t\t\"-image_base\",\n\t\t\t\t\t100000000,\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1A6FB7B11785614200CDF010 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/TestLua/proj.mac/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"\";\n\t\t\t\t\"OTHER_LDFLAGS[arch=x86_64]\" = (\n\t\t\t\t\t\"-pagezero_size\",\n\t\t\t\t\t10000,\n\t\t\t\t\t\"-image_base\",\n\t\t\t\t\t100000000,\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1A6FB7B21785614200CDF010 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Lua/TestLua/proj.mac/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tOTHER_LDFLAGS = \"\";\n\t\t\t\t\"OTHER_LDFLAGS[arch=x86_64]\" = (\n\t\t\t\t\t\"-pagezero_size\",\n\t\t\t\t\t10000,\n\t\t\t\t\t\"-image_base\",\n\t\t\t\t\t100000000,\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/lua/bindings $(SRCROOT)/../external/glfw3/include/mac $(SRCROOT)/../external/lua/luajit/include $(SRCROOT)/../external/lua/tolua\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t1D6058940D05DD3E006BFB54 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Cpp/TestCpp/proj.mac/Test_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1D6058950D05DD3E006BFB54 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Cpp/TestCpp/proj.mac/Test_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA01E16911784BDA100B0CA4A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = \"../samples/Cpp/SimpleGame/proj.ios/SimpleGame-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA01E16921784BDA100B0CA4A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = \"../samples/Cpp/SimpleGame/proj.ios/SimpleGame-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA01E17701784C06E00B0CA4A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/TestJavascript/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA01E17711784C06E00B0CA4A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/TestJavascript/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA01E18551784C45400B0CA4A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/WatermelonWithMe/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA01E18561784C45400B0CA4A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/WatermelonWithMe/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA01E188A1784C4D600B0CA4A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/MoonWarriors/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA01E188B1784C4D600B0CA4A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/MoonWarriors/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA01E18BF1784C4DC00B0CA4A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CrystalCraze/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA01E18C01784C4DC00B0CA4A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CrystalCraze/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA01E18F41784C4E000B0CA4A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CocosDragonJS/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA01E18F51784C4E000B0CA4A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CocosDragonJS/proj.ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035A5EA1782290400987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/TestJavascript/proj.mac/Test_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035A5EB1782290400987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/TestJavascript/proj.mac/Test_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035A77B1782301C00987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/WatermelonWithMe/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035A77C1782301C00987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/WatermelonWithMe/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035A9F517823FE100987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/MoonWarriors/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035A9F617823FE100987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/MoonWarriors/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035AAC31782422400987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CrystalCraze/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035AAC41782422400987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CrystalCraze/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035AC351782453000987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CocosDragonJS/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035AC361782453000987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCOCOS2D_JAVASCRIPT,\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Javascript/CocosDragonJS/proj.mac/Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../cocos/scripting/javascript/bindings $(SRCROOT)/../cocos/scripting/auto-generated/js-bindings $(SRCROOT)/../external/spidermonkey/include/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035ACBD1782469800987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035ACBE1782469800987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035AD74178254A300987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Cpp/SimpleGame/proj.mac/SampleGame_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035AD75178254A300987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Cpp/SimpleGame/proj.mac/SampleGame_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA035AE86178255DC00987F6C /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Cpp/HelloCpp/proj.mac/HelloCpp_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA035AE87178255DC00987F6C /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\tCC_KEYBOARD_SUPPORT,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ../samples/Cpp/HelloCpp/proj.mac/HelloCpp_Info.plist;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/mac $(SRCROOT)/../external/glfw3/include/mac\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A517D1783A1CC0073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A517E1783A1CC0073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A52271783A1D20073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = \"../samples/Cpp/TestCpp/proj.ios/Test-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/2d/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A52281783A1D20073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = \"../samples/Cpp/TestCpp/proj.ios/Test-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"$(inherited)\";\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios $(SRCROOT)/../cocos/2d/platform/ios/Simulation $(SRCROOT)/../external/curl/include/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tA07A537F1784AC9B0073F6A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = \"../samples/Cpp/HelloCpp/proj.ios/HelloCpp-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tA07A53801784AC9B0073F6A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD)\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = \"../samples/Cpp/HelloCpp/proj.ios/HelloCpp-Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1.1;\n\t\t\t\tPROVISIONING_PROFILE = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos/2d/platform/ios\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tC01FCF4F08A954540054247B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"COCOS2D_DEBUG=1\",\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\t\"CC_ENABLE_CHIPMUNK_INTEGRATION=1\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/include $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/gui $(SRCROOT)/../cocos/network $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../external/chipmunk/include/chipmunk\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tC01FCF5008A954540054247B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tNDEBUG,\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\t\"CC_ENABLE_CHIPMUNK_INTEGRATION=1\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(SRCROOT)/.. $(SRCROOT)/../cocos $(SRCROOT)/../cocos/base $(SRCROOT)/../cocos/physics $(SRCROOT)/../cocos/math/kazmath/include $(SRCROOT)/../cocos/2d $(SRCROOT)/../cocos/gui $(SRCROOT)/../cocos/network $(SRCROOT)/../cocos/audio/include $(SRCROOT)/../cocos/editor-support $(SRCROOT)/../extensions $(SRCROOT)/../external $(SRCROOT)/../external/chipmunk/include/chipmunk\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t1A1197D41785363400D62A44 /* Build configuration list for PBXNativeTarget \"Hello lua iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1A1197D51785363400D62A44 /* Debug */,\n\t\t\t\t1A1197D61785363400D62A44 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\t1A11986D178538E400D62A44 /* Build configuration list for PBXNativeTarget \"Test lua iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1A11986E178538E400D62A44 /* Debug */,\n\t\t\t\t1A11986F178538E400D62A44 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\t1A6FB56817854FE400CDF010 /* Build configuration list for PBXNativeTarget \"Hello lua Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1A6FB56917854FE400CDF010 /* Debug */,\n\t\t\t\t1A6FB56A17854FE400CDF010 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\t1A6FB7B01785614200CDF010 /* Build configuration list for PBXNativeTarget \"Test lua Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1A6FB7B11785614200CDF010 /* Debug */,\n\t\t\t\t1A6FB7B21785614200CDF010 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\t1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget \"Test cpp Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1D6058940D05DD3E006BFB54 /* Debug */,\n\t\t\t\t1D6058950D05DD3E006BFB54 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA01E16901784BDA100B0CA4A /* Build configuration list for PBXNativeTarget \"Simple Game iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA01E16911784BDA100B0CA4A /* Debug */,\n\t\t\t\tA01E16921784BDA100B0CA4A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA01E176F1784C06E00B0CA4A /* Build configuration list for PBXNativeTarget \"Test JavaScript iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA01E17701784C06E00B0CA4A /* Debug */,\n\t\t\t\tA01E17711784C06E00B0CA4A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA01E18541784C45400B0CA4A /* Build configuration list for PBXNativeTarget \"JS Watermelon With Me iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA01E18551784C45400B0CA4A /* Debug */,\n\t\t\t\tA01E18561784C45400B0CA4A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA01E18891784C4D600B0CA4A /* Build configuration list for PBXNativeTarget \"JS Moon Warriors iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA01E188A1784C4D600B0CA4A /* Debug */,\n\t\t\t\tA01E188B1784C4D600B0CA4A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA01E18BE1784C4DC00B0CA4A /* Build configuration list for PBXNativeTarget \"JS Crystal Craze iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA01E18BF1784C4DC00B0CA4A /* Debug */,\n\t\t\t\tA01E18C01784C4DC00B0CA4A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA01E18F31784C4E000B0CA4A /* Build configuration list for PBXNativeTarget \"JS CocosDragon iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA01E18F41784C4E000B0CA4A /* Debug */,\n\t\t\t\tA01E18F51784C4E000B0CA4A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035A5E91782290400987F6C /* Build configuration list for PBXNativeTarget \"Test JavaScript Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035A5EA1782290400987F6C /* Debug */,\n\t\t\t\tA035A5EB1782290400987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035A77A1782301C00987F6C /* Build configuration list for PBXNativeTarget \"JS Watermelon With Me Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035A77B1782301C00987F6C /* Debug */,\n\t\t\t\tA035A77C1782301C00987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035A9F417823FE100987F6C /* Build configuration list for PBXNativeTarget \"JS Moon Warriors Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035A9F517823FE100987F6C /* Debug */,\n\t\t\t\tA035A9F617823FE100987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035AAC21782422400987F6C /* Build configuration list for PBXNativeTarget \"JS Crystal Craze Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035AAC31782422400987F6C /* Debug */,\n\t\t\t\tA035AAC41782422400987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035AC341782453000987F6C /* Build configuration list for PBXNativeTarget \"JS CocosDragon Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035AC351782453000987F6C /* Debug */,\n\t\t\t\tA035AC361782453000987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035ACBC1782469800987F6C /* Build configuration list for PBXAggregateTarget \"build-all-samples Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035ACBD1782469800987F6C /* Debug */,\n\t\t\t\tA035ACBE1782469800987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035AD73178254A300987F6C /* Build configuration list for PBXNativeTarget \"Simple Game Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035AD74178254A300987F6C /* Debug */,\n\t\t\t\tA035AD75178254A300987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA035AE85178255DC00987F6C /* Build configuration list for PBXNativeTarget \"Hello cpp Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA035AE86178255DC00987F6C /* Debug */,\n\t\t\t\tA035AE87178255DC00987F6C /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA07A517C1783A1CC0073F6A7 /* Build configuration list for PBXAggregateTarget \"build-all-samples iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A517D1783A1CC0073F6A7 /* Debug */,\n\t\t\t\tA07A517E1783A1CC0073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA07A52261783A1D20073F6A7 /* Build configuration list for PBXNativeTarget \"Test cpp iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A52271783A1D20073F6A7 /* Debug */,\n\t\t\t\tA07A52281783A1D20073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tA07A537E1784AC9B0073F6A7 /* Build configuration list for PBXNativeTarget \"Hello cpp iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tA07A537F1784AC9B0073F6A7 /* Debug */,\n\t\t\t\tA07A53801784AC9B0073F6A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tC01FCF4E08A954540054247B /* Build configuration list for PBXProject \"cocos2d_samples\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tC01FCF4F08A954540054247B /* Debug */,\n\t\t\t\tC01FCF5008A954540054247B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 29B97313FDCFA39411CA2CEA /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/build/install-deps-linux.sh",
    "content": "#!/bin/bash\n\n# Change directory to the location of this script\ncd $(dirname ${BASH_SOURCE[0]})\n\nDEPENDS='libx11-dev'\nDEPENDS+=' libxmu-dev'\nDEPENDS+=' libglu1-mesa-dev'\nDEPENDS+=' libgl2ps-dev'\nDEPENDS+=' libxi-dev'\nDEPENDS+=' g++'\nDEPENDS+=' libzip-dev'\nDEPENDS+=' libpng12-dev'\nDEPENDS+=' libcurl4-gnutls-dev'\nDEPENDS+=' libfontconfig1-dev'\nDEPENDS+=' libsqlite3-dev'\nDEPENDS+=' libglew*-dev'\n\nMISSING=\necho \"Checking for missing packages ...\"\nfor i in $DEPENDS; do\n    if ! dpkg-query -W --showformat='${Status}\\n' $i | grep \"install ok installed\" > /dev/null; then\n        MISSING+=\"$i \"\n    fi\ndone\n\nif [ -n \"$MISSING\" ]; then\n    TXTCOLOR_DEFAULT=\"\\033[0;m\"\n    TXTCOLOR_GREEN=\"\\033[0;32m\"\n    echo -e $TXTCOLOR_GREEN\"Missing packages: $MISSING.\\nYou may be asked for your password for package installation.\"$TXTCOLOR_DEFAULT\n    sudo apt-get --force-yes --yes install $MISSING\nfi\n\n# install glfw\n../tools/travis-scripts/install_glfw.sh\n\n"
  },
  {
    "path": "cocos2d/build/win32-msvc-2012-x86.cmd",
    "content": "@echo off\nSETLOCAL\n\n:start\nmkdir win32-msvc-vs2012-x86\ncd win32-msvc-vs2012-x86\ncmake -G \"Visual Studio 11\" ../..\npause\n"
  },
  {
    "path": "cocos2d/build/win32-msvc-2013-x86.cmd",
    "content": "@echo off\nSETLOCAL\n\n:start\nmkdir win32-msvc-vs2013-x86\ncd win32-msvc-vs2013-x86\ncmake -G \"Visual Studio 12\" ../..\npause\n"
  },
  {
    "path": "cocos2d/cocos/2d/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos2dx_static\n\nLOCAL_MODULE_FILENAME := libcocos2d\n\nLOCAL_SRC_FILES := \\\nbase64.cpp \\\nCCAction.cpp \\\nCCActionCamera.cpp \\\nCCActionCatmullRom.cpp \\\nCCActionEase.cpp \\\nCCActionGrid.cpp \\\nCCActionGrid3D.cpp \\\nCCActionInstant.cpp \\\nCCActionInterval.cpp \\\nCCActionManager.cpp \\\nCCActionPageTurn3D.cpp \\\nCCActionProgressTimer.cpp \\\nCCActionTiledGrid.cpp \\\nCCActionTween.cpp \\\nCCAnimation.cpp \\\nCCAnimationCache.cpp \\\nCCAtlasNode.cpp \\\nccCArray.cpp \\\nCCClippingNode.cpp \\\nCCComponent.cpp \\\nCCComponentContainer.cpp \\\nCCConfiguration.cpp \\\nCCDeprecated.cpp \\\nCCDirector.cpp \\\nCCDrawingPrimitives.cpp \\\nCCDrawNode.cpp \\\nCCEvent.cpp \\\nCCEventAcceleration.cpp \\\nCCEventCustom.cpp \\\nCCEventDispatcher.cpp \\\nCCEventKeyboard.cpp \\\nCCEventListener.cpp \\\nCCEventListenerAcceleration.cpp \\\nCCEventListenerCustom.cpp \\\nCCEventListenerKeyboard.cpp \\\nCCEventListenerMouse.cpp \\\nCCEventListenerTouch.cpp \\\nCCEventMouse.cpp \\\nCCEventTouch.cpp \\\nCCFont.cpp \\\nCCFontCharMap.cpp \\\nCCFontAtlas.cpp \\\nCCFontAtlasCache.cpp \\\nCCFontFNT.cpp \\\nCCFontFreeType.cpp \\\nccFPSImages.c \\\nCCGLBufferedNode.cpp \\\nCCGLProgram.cpp \\\nccGLStateCache.cpp \\\nCCGrabber.cpp \\\nCCGrid.cpp \\\nCCNodeGrid.cpp \\\nCCIMEDispatcher.cpp \\\nCCLabel.cpp \\\nCCLabelAtlas.cpp \\\nCCLabelBMFont.cpp \\\nCCLabelTextFormatter.cpp \\\nCCLabelTTF.cpp \\\nCCLayer.cpp \\\nCCMenu.cpp \\\nCCMenuItem.cpp \\\nCCMotionStreak.cpp \\\nCCNode.cpp \\\nCCNotificationCenter.cpp \\\nCCParallaxNode.cpp \\\nCCParticleBatchNode.cpp \\\nCCParticleExamples.cpp \\\nCCParticleSystem.cpp \\\nCCParticleSystemQuad.cpp \\\nCCProfiling.cpp \\\nCCProgressTimer.cpp \\\nCCRenderTexture.cpp \\\nCCScene.cpp \\\nCCScheduler.cpp \\\nCCScriptSupport.cpp \\\nCCShaderCache.cpp \\\nccShaders.cpp \\\nCCSprite.cpp \\\nCCSpriteBatchNode.cpp \\\nCCSpriteFrame.cpp \\\nCCSpriteFrameCache.cpp \\\nCCTextFieldTTF.cpp \\\nCCTexture2D.cpp \\\nCCTextureAtlas.cpp \\\nCCTextureCache.cpp \\\nCCTileMapAtlas.cpp \\\nCCTMXLayer.cpp \\\nCCTMXObjectGroup.cpp \\\nCCTMXTiledMap.cpp \\\nCCTMXXMLParser.cpp \\\nCCTouch.cpp \\\nCCTransition.cpp \\\nCCTransitionPageTurn.cpp \\\nCCTransitionProgress.cpp \\\nccTypes.cpp \\\nCCUserDefault.cpp \\\nCCUserDefaultAndroid.cpp \\\nccUTF8.cpp \\\nccUtils.cpp \\\nCCVertex.cpp \\\ncocos2d.cpp \\\nTGAlib.cpp \\\nTransformUtils.cpp \\\nZipUtils.cpp \\\nplatform/CCEGLViewProtocol.cpp \\\nplatform/CCFileUtils.cpp \\\nplatform/CCSAXParser.cpp \\\nplatform/CCThread.cpp \\\nrenderer/CCCustomCommand.cpp \\\nrenderer/CCFrustum.cpp \\\nrenderer/CCGroupCommand.cpp \\\nrenderer/CCMaterialManager.cpp \\\nrenderer/CCQuadCommand.cpp \\\nrenderer/CCBatchCommand.cpp \\\nrenderer/CCRenderCommand.cpp \\\nrenderer/CCRenderer.cpp \\\nrenderer/CCRenderMaterial.cpp \\\n../base/atitc.cpp \\\n../base/CCAffineTransform.cpp \\\n../base/CCArray.cpp \\\n../base/CCAutoreleasePool.cpp \\\n../base/CCConsole.cpp \\\n../base/CCData.cpp \\\n../base/CCDataVisitor.cpp \\\n../base/CCDictionary.cpp \\\n../base/CCGeometry.cpp \\\n../base/CCNS.cpp \\\n../base/CCObject.cpp \\\n../base/CCSet.cpp \\\n../base/CCString.cpp \\\n../base/CCValue.cpp \\\n../base/etc1.cpp \\\n../base/s3tc.cpp \\\n../math/kazmath/src/aabb.c \\\n../math/kazmath/src/mat3.c \\\n../math/kazmath/src/mat4.c \\\n../math/kazmath/src/neon_matrix_impl.c \\\n../math/kazmath/src/plane.c \\\n../math/kazmath/src/quaternion.c \\\n../math/kazmath/src/ray2.c \\\n../math/kazmath/src/utility.c \\\n../math/kazmath/src/vec2.c \\\n../math/kazmath/src/vec3.c \\\n../math/kazmath/src/vec4.c \\\n../math/kazmath/src/GL/mat4stack.c \\\n../math/kazmath/src/GL/matrix.c \\\n../physics/CCPhysicsBody.cpp \\\n../physics/CCPhysicsContact.cpp \\\n../physics/CCPhysicsJoint.cpp \\\n../physics/CCPhysicsShape.cpp \\\n../physics/CCPhysicsWorld.cpp \\\n../physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp \\\n../physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp \\\n../physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp \\\n../physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp \\\n../physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp \\\n../../external/tinyxml2/tinyxml2.cpp \\\n../../external/unzip/ioapi.cpp \\\n../../external/unzip/unzip.cpp \\\n../../external/edtaa3func/edtaa3func.cpp\n\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/renderer \\\n                    $(LOCAL_PATH)/../math/kazmath/include \\\n                    platform/android \\\n                    $(LOCAL_PATH)/../physics \\\n                    $(LOCAL_PATH)/../base \\\n                    $(LOCAL_PATH)/../../external/tinyxml2 \\\n                    $(LOCAL_PATH)/../../external/unzip \\\n                    $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/renderer \\\n                    $(LOCAL_PATH)/../math/kazmath/include \\\n                    $(LOCAL_PATH)/platform/android \\\n                    $(LOCAL_PATH)/../physics \\\n                    $(LOCAL_PATH)/../base \\\n                    $(LOCAL_PATH)/../../external/tinyxml2 \\\n                    $(LOCAL_PATH)/../../external/unzip \\\n                    $(LOCAL_PATH)/../../external/chipmunk/include/chipmunk \\\n                    $(LOCAL_PATH)/../../external/edtaa3func\n\n\nLOCAL_LDLIBS := -lGLESv2 \\\n                -llog \\\n                -lz \\\n                -landroid\n\nLOCAL_EXPORT_LDLIBS := -lGLESv2 \\\n                       -llog \\\n                       -lz \\\n                       -landroid\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos_freetype2_static\nLOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos2dxandroid_static\n\n# define the macro to compile through support/zip_support/ioapi.c\nLOCAL_CFLAGS   := -Wno-psabi  -DUSE_FILE32API\nLOCAL_CPPFLAGS := -Wno-literal-suffix -Wno-deprecated-declarations\nLOCAL_EXPORT_CFLAGS   := -Wno-psabi -DUSE_FILE32API\nLOCAL_EXPORT_CPPFLAGS := -Wno-literal-suffix -Wno-deprecated-declarations\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,freetype2/prebuilt/android)\n$(call import-module,chipmunk)\n$(call import-module,2d/platform/android)\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCAction.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCAction.h\"\n#include \"CCActionInterval.h\"\n#include \"CCNode.h\"\n#include \"CCDirector.h\"\n#include \"CCString.h\"\n\nNS_CC_BEGIN\n//\n// Action Base Class\n//\n\nAction::Action()\n:_originalTarget(nullptr)\n,_target(nullptr)\n,_tag(Action::INVALID_TAG)\n{\n}\n\nAction::~Action()\n{\n    CCLOGINFO(\"deallocing Action: %p - tag: %i\", this, _tag);\n}\n\nstd::string Action::description() const\n{\n    return StringUtils::format(\"<Action | Tag = %d\", _tag);\n}\n\nvoid Action::startWithTarget(Node *aTarget)\n{\n    _originalTarget = _target = aTarget;\n}\n\nvoid Action::stop()\n{\n    _target = nullptr;\n}\n\nbool Action::isDone() const\n{\n    return true;\n}\n\nvoid Action::step(float dt)\n{\n    CC_UNUSED_PARAM(dt);\n    CCLOG(\"[Action step]. override me\");\n}\n\nvoid Action::update(float time)\n{\n    CC_UNUSED_PARAM(time);\n    CCLOG(\"[Action update]. override me\");\n}\n\n//\n// Speed\n//\nSpeed::Speed()\n: _speed(0.0)\n, _innerAction(nullptr)\n{\n}\n\nSpeed::~Speed()\n{\n    CC_SAFE_RELEASE(_innerAction);\n}\n\nSpeed* Speed::create(ActionInterval* action, float speed)\n{\n    Speed *ret = new Speed();\n    if (ret && ret->initWithAction(action, speed))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool Speed::initWithAction(ActionInterval *action, float speed)\n{\n    CCASSERT(action != nullptr, \"\");\n    action->retain();\n    _innerAction = action;\n    _speed = speed;\n    return true;\n}\n\nSpeed *Speed::clone() const\n{\n\t// no copy constructor\n\tauto a = new Speed();\n\ta->initWithAction(_innerAction->clone(), _speed);\n\ta->autorelease();\n\treturn  a;\n}\n\nvoid Speed::startWithTarget(Node* target)\n{\n    Action::startWithTarget(target);\n    _innerAction->startWithTarget(target);\n}\n\nvoid Speed::stop()\n{\n    _innerAction->stop();\n    Action::stop();\n}\n\nvoid Speed::step(float dt)\n{\n    _innerAction->step(dt * _speed);\n}\n\nbool Speed::isDone() const\n{\n    return _innerAction->isDone();\n}\n\nSpeed *Speed::reverse() const\n{\n\n\treturn Speed::create(_innerAction->reverse(), _speed);\n}\n\nvoid Speed::setInnerAction(ActionInterval *action)\n{\n    if (_innerAction != action)\n    {\n        CC_SAFE_RELEASE(_innerAction);\n        _innerAction = action;\n        CC_SAFE_RETAIN(_innerAction);\n    }\n}\n\n//\n// Follow\n//\nFollow::~Follow()\n{\n    CC_SAFE_RELEASE(_followedNode);\n}\n\nFollow* Follow::create(Node *followedNode, const Rect& rect/* = Rect::ZERO*/)\n{\n    Follow *follow = new Follow();\n    if (follow && follow->initWithTarget(followedNode, rect))\n    {\n        follow->autorelease();\n        return follow;\n    }\n    CC_SAFE_DELETE(follow);\n    return nullptr;\n}\n\nFollow* Follow::clone() const\n{\n\t// no copy constructor\n\tauto a = new Follow();\n\ta->initWithTarget(_followedNode, _worldRect);\n\ta->autorelease();\n\treturn a;\n}\n\nFollow* Follow::reverse() const\n{\n    return clone();\n}\n\nbool Follow::initWithTarget(Node *followedNode, const Rect& rect/* = Rect::ZERO*/)\n{\n    CCASSERT(followedNode != nullptr, \"\");\n \n    followedNode->retain();\n    _followedNode = followedNode;\n\t_worldRect = rect;\n    if (rect.equals(Rect::ZERO))\n    {\n        _boundarySet = false;\n    }\n    else\n    {\n        _boundarySet = true;\n    }\n    \n    _boundaryFullyCovered = false;\n\n    Size winSize = Director::getInstance()->getWinSize();\n    _fullScreenSize = Point(winSize.width, winSize.height);\n    _halfScreenSize = _fullScreenSize * 0.5f;\n\n    if (_boundarySet)\n    {\n        _leftBoundary = -((rect.origin.x+rect.size.width) - _fullScreenSize.x);\n        _rightBoundary = -rect.origin.x ;\n        _topBoundary = -rect.origin.y;\n        _bottomBoundary = -((rect.origin.y+rect.size.height) - _fullScreenSize.y);\n\n        if(_rightBoundary < _leftBoundary)\n        {\n            // screen width is larger than world's boundary width\n            //set both in the middle of the world\n            _rightBoundary = _leftBoundary = (_leftBoundary + _rightBoundary) / 2;\n        }\n        if(_topBoundary < _bottomBoundary)\n        {\n            // screen width is larger than world's boundary width\n            //set both in the middle of the world\n            _topBoundary = _bottomBoundary = (_topBoundary + _bottomBoundary) / 2;\n        }\n\n        if( (_topBoundary == _bottomBoundary) && (_leftBoundary == _rightBoundary) )\n        {\n            _boundaryFullyCovered = true;\n        }\n    }\n    \n    return true;\n}\n\nvoid Follow::step(float dt)\n{\n    CC_UNUSED_PARAM(dt);\n\n    if(_boundarySet)\n    {\n        // whole map fits inside a single screen, no need to modify the position - unless map boundaries are increased\n        if(_boundaryFullyCovered)\n            return;\n\n        Point tempPos = _halfScreenSize - _followedNode->getPosition();\n\n        _target->setPosition(Point(clampf(tempPos.x, _leftBoundary, _rightBoundary),\n                                   clampf(tempPos.y, _bottomBoundary, _topBoundary)));\n    }\n    else\n    {\n        _target->setPosition(_halfScreenSize - _followedNode->getPosition());\n    }\n}\n\nbool Follow::isDone() const\n{\n    return ( !_followedNode->isRunning() );\n}\n\nvoid Follow::stop()\n{\n    _target = nullptr;\n    Action::stop();\n}\n\nNS_CC_END\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCAction.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ACTIONS_CCACTION_H__\n#define __ACTIONS_CCACTION_H__\n\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** \n@brief Base class for Action objects.\n */\nclass CC_DLL Action : public Object, public Clonable\n{\npublic:\n    /// Default tag used for all the actions\n    static const int INVALID_TAG = -1;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual std::string description() const;\n\n\t/** returns a clone of action */\n\tvirtual Action* clone() const = 0;\n\n    /** returns a new action that performs the exactly the reverse action */\n\tvirtual Action* reverse() const = 0;\n\n    //! return true if the action has finished\n    virtual bool isDone() const;\n\n    //! called before the action start. It will also set the target.\n    virtual void startWithTarget(Node *target);\n\n    /** \n    called after the action has finished. It will set the 'target' to nil.\n    IMPORTANT: You should never call \"[action stop]\" manually. Instead, use: \"target->stopAction(action);\"\n    */\n    virtual void stop();\n\n    //! called every frame with it's delta time. DON'T override unless you know what you are doing.\n    virtual void step(float dt);\n\n    /** \n    called once per frame. time a value between 0 and 1\n\n    For example: \n    - 0 means that the action just started\n    - 0.5 means that the action is in the middle\n    - 1 means that the action is over\n    */\n    virtual void update(float time);\n    \n    inline Node* getTarget() const { return _target; }\n    /** The action will modify the target properties. */\n    inline void setTarget(Node *target) { _target = target; }\n    \n    inline Node* getOriginalTarget() const { return _originalTarget; }\n    /** Set the original target, since target can be nil.\n    Is the target that were used to run the action. Unless you are doing something complex, like ActionManager, you should NOT call this method.\n    The target is 'assigned', it is not 'retained'.\n    @since v0.8.2\n    */\n    inline void setOriginalTarget(Node *originalTarget) { _originalTarget = originalTarget; }\n\n    inline int getTag() const { return _tag; }\n    inline void setTag(int tag) { _tag = tag; }\n\nprotected:\n    Action();\n    virtual ~Action();\n\n    Node    *_originalTarget;\n    /** The \"target\".\n    The target will be set with the 'startWithTarget' method.\n    When the 'stop' method is called, target will be set to nil.\n    The target is 'assigned', it is not 'retained'.\n    */\n    Node    *_target;\n    /** The action tag. An identifier of the action */\n    int     _tag;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Action);\n};\n\n/** \n@brief \n Base class actions that do have a finite time duration.\n Possible actions:\n   - An action with a duration of 0 seconds\n   - An action with a duration of 35.5 seconds\n\n Infinite time actions are valid\n */\nclass CC_DLL FiniteTimeAction : public Action\n{\npublic:\n    //! get duration in seconds of the action\n    inline float getDuration() const { return _duration; }\n    //! set duration in seconds of the action\n    inline void setDuration(float duration) { _duration = duration; }\n\n    //\n    // Overrides\n    //\n    virtual FiniteTimeAction* reverse() const override = 0;\n\tvirtual FiniteTimeAction* clone() const override = 0;\n\nprotected:\n    FiniteTimeAction()\n\t: _duration(0)\n    {}\n    virtual ~FiniteTimeAction(){}\n\n    //! duration in seconds\n    float _duration;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FiniteTimeAction);\n};\n\nclass ActionInterval;\nclass RepeatForever;\n\n/** \n @brief Changes the speed of an action, making it take longer (speed>1)\n or less (speed<1) time.\n Useful to simulate 'slow motion' or 'fast forward' effect.\n @warning This action can't be Sequenceable because it is not an IntervalAction\n */\nclass CC_DLL Speed : public Action\n{\npublic:\n    /** create the action */\n    static Speed* create(ActionInterval* action, float speed);\n\n    inline float getSpeed(void) const { return _speed; }\n    /** alter the speed of the inner function in runtime */\n    inline void setSpeed(float speed) { _speed = speed; }\n\n\n    void setInnerAction(ActionInterval *action);\n\n    inline ActionInterval* getInnerAction() const { return _innerAction; }\n\n    //\n    // Override\n    //\n\tvirtual Speed* clone() const override;\n    virtual Speed* reverse() const override;\n    virtual void startWithTarget(Node* target) override;\n    virtual void stop() override;\n    virtual void step(float dt) override;\n    virtual bool isDone() const  override;\n\nprotected:\n    Speed();\n    virtual ~Speed(void);\n    /** initializes the action */\n    bool initWithAction(ActionInterval *action, float speed);\n\n    float _speed;\n    ActionInterval *_innerAction;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Speed);\n};\n\n/** \n@brief Follow is an action that \"follows\" a node.\n\nEg:\n@code\nlayer->runAction(Follow::actionWithTarget(hero));\n@endcode\n\nInstead of using Camera as a \"follower\", use this action instead.\n@since v0.99.2\n*/\nclass CC_DLL Follow : public Action\n{\npublic:\n    /**\n     * Creates the action with a set boundary or with no boundary.\n     *\n     * @param followedNode  The node to be followed.\n     * @param rect  The boundary. If \\p rect is equal to Rect::ZERO, it'll work\n     *              with no boundary.\n     */\n    static Follow* create(Node *followedNode, const Rect& rect = Rect::ZERO);\n\n    inline bool isBoundarySet() const { return _boundarySet; }\n    /** alter behavior - turn on/off boundary */\n    inline void setBoudarySet(bool value) { _boundarySet = value; }\n\n    //\n    // Override\n    //\n\tvirtual Follow* clone() const override;\n\tvirtual Follow* reverse() const override;\n    virtual void step(float dt) override;\n    virtual bool isDone() const override;\n    virtual void stop() override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    Follow()\n    : _followedNode(nullptr)\n    , _boundarySet(false)\n    , _boundaryFullyCovered(false)\n    , _leftBoundary(0.0)\n    , _rightBoundary(0.0)\n    , _topBoundary(0.0)\n    , _bottomBoundary(0.0)\n    , _worldRect(Rect::ZERO)\n    {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Follow();\n    /**\n     * Initializes the action with a set boundary or with no boundary.\n     *\n     * @param followedNode  The node to be followed.\n     * @param rect  The boundary. If \\p rect is equal to Rect::ZERO, it'll work\n     *              with no boundary.\n     */\n    bool initWithTarget(Node *followedNode, const Rect& rect = Rect::ZERO);\n\n    // node to follow\n    Node *_followedNode;\n\n    // whether camera should be limited to certain area\n    bool _boundarySet;\n\n    // if screen size is bigger than the boundary - update not needed\n    bool _boundaryFullyCovered;\n\n    // fast access to the screen dimensions\n    Point _halfScreenSize;\n    Point _fullScreenSize;\n\n    // world boundaries\n    float _leftBoundary;\n    float _rightBoundary;\n    float _topBoundary;\n    float _bottomBoundary;\n\tRect _worldRect;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Follow);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTIONS_CCACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionCamera.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCActionCamera.h\"\n#include \"CCNode.h\"\n#include \"CCStdC.h\"\n\nNS_CC_BEGIN\n//\n// CameraAction\n//\nActionCamera::ActionCamera()\n{\n    kmVec3Fill(&_center, 0, 0, 0);\n    kmVec3Fill(&_eye, 0, 0, FLT_EPSILON);\n    kmVec3Fill(&_up, 0, 1, 0);\n}\nvoid ActionCamera::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n}\n\nActionCamera* ActionCamera::clone() const\n{\n\t// no copy constructor\n\tauto a = new ActionCamera();\n\ta->autorelease();\n\treturn a;\n}\n\nActionCamera * ActionCamera::reverse() const\n{\n    // FIXME: This conversion isn't safe.\n    return (ActionCamera*)ReverseTime::create(const_cast<ActionCamera*>(this));\n}\n\nvoid ActionCamera::restore()\n{\n    kmVec3Fill(&_center, 0, 0, 0);\n    kmVec3Fill(&_eye, 0, 0, FLT_EPSILON);\n    kmVec3Fill(&_up, 0, 1, 0);\n}\n\nvoid ActionCamera::setEye(const kmVec3& eye)\n{\n    _eye = eye;\n    updateTransform();\n}\n\nvoid ActionCamera::setEye(float x, float y, float z)\n{\n    kmVec3Fill(&_eye, x, y, z);\n    updateTransform();\n}\n\nvoid ActionCamera::setCenter(const kmVec3& center)\n{\n    _center = center;\n    updateTransform();\n}\n\nvoid ActionCamera::setUp(const kmVec3& up)\n{\n    _up = up;\n    updateTransform();\n}\n\nvoid ActionCamera::updateTransform()\n{\n    kmMat4 lookupMatrix;\n    kmMat4LookAt(&lookupMatrix, &_eye, &_center, &_up);\n\n    Point anchorPoint = _target->getAnchorPointInPoints();\n\n    bool needsTranslation = !anchorPoint.equals(Point::ZERO);\n\n    kmMat4 mv;\n    kmMat4Identity(&mv);\n\n    if(needsTranslation) {\n        kmMat4 t;\n        kmMat4Translation(&t, anchorPoint.x, anchorPoint.y, 0);\n        kmMat4Multiply(&mv, &mv, &t);\n    }\n\n    kmMat4Multiply(&mv, &mv, &lookupMatrix);\n\n    if(needsTranslation) {\n        kmMat4 t;\n        kmMat4Translation(&t, -anchorPoint.x, -anchorPoint.y, 0);\n        kmMat4Multiply(&mv, &mv, &t);\n    }\n\n    // XXX FIXME TODO\n    // Using the AdditionalTransform is a complete hack.\n    // This should be done by multipliying the lookup-Matrix with the Node's MV matrix\n    // And then setting the result as the new MV matrix\n    // But that operation needs to be done after all the 'updates'.\n    // So the Director should emit an 'director_after_update' event.\n    // And this object should listen to it\n    _target->setAdditionalTransform(mv);\n}\n\n//\n// OrbitCamera\n//\n\nOrbitCamera * OrbitCamera::create(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX)\n{\n    OrbitCamera * obitCamera = new OrbitCamera();\n    if(obitCamera->initWithDuration(t, radius, deltaRadius, angleZ, deltaAngleZ, angleX, deltaAngleX))\n    {\n        obitCamera->autorelease();\n        return obitCamera;\n    }\n    CC_SAFE_DELETE(obitCamera);\n    return nullptr;\n}\n\nOrbitCamera* OrbitCamera::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new OrbitCamera();\n\ta->initWithDuration(_duration, _radius, _deltaRadius, _angleZ, _deltaAngleZ, _angleX, _deltaAngleX);\n\ta->autorelease();\n\treturn a;\n}\n\nbool OrbitCamera::initWithDuration(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX)\n{\n    if ( ActionInterval::initWithDuration(t) )\n    {\n        _radius = radius;\n        _deltaRadius = deltaRadius;\n        _angleZ = angleZ;\n        _deltaAngleZ = deltaAngleZ;\n        _angleX = angleX;\n        _deltaAngleX = deltaAngleX;\n\n        _radDeltaZ = (float)CC_DEGREES_TO_RADIANS(deltaAngleZ);\n        _radDeltaX = (float)CC_DEGREES_TO_RADIANS(deltaAngleX);\n        return true;\n    }\n    return false;\n}\n\nvoid OrbitCamera::startWithTarget(Node *target)\n{\n    ActionCamera::startWithTarget(target);\n\n    float r, zenith, azimuth;\n    this->sphericalRadius(&r, &zenith, &azimuth);\n    if( isnan(_radius) )\n        _radius = r;\n    if( isnan(_angleZ) )\n        _angleZ = (float)CC_RADIANS_TO_DEGREES(zenith);\n    if( isnan(_angleX) )\n        _angleX = (float)CC_RADIANS_TO_DEGREES(azimuth);\n\n    _radZ = (float)CC_DEGREES_TO_RADIANS(_angleZ);\n    _radX = (float)CC_DEGREES_TO_RADIANS(_angleX);\n}\n\nvoid OrbitCamera::update(float dt)\n{\n    float r = (_radius + _deltaRadius * dt) * FLT_EPSILON;\n    float za = _radZ + _radDeltaZ * dt;\n    float xa = _radX + _radDeltaX * dt;\n\n    float i = sinf(za) * cosf(xa) * r + _center.x;\n    float j = sinf(za) * sinf(xa) * r + _center.y;\n    float k = cosf(za) * r + _center.z;\n\n    setEye(i,j,k);\n}\n\nvoid OrbitCamera::sphericalRadius(float *newRadius, float *zenith, float *azimuth)\n{\n    float r; // radius\n    float s;\n\n    float x = _eye.x - _center.x;\n    float y = _eye.y - _center.y;\n    float z = _eye.z - _center.z;\n\n    r = sqrtf( powf(x,2) + powf(y,2) + powf(z,2));\n    s = sqrtf( powf(x,2) + powf(y,2));\n    if( s == 0.0f )\n        s = FLT_EPSILON;\n    if(r==0.0f)\n        r = FLT_EPSILON;\n\n    *zenith = acosf( z/r);\n    if( x < 0 )\n        *azimuth= (float)M_PI - asinf(y/s);\n    else\n        *azimuth = asinf(y/s);\n\n    *newRadius = r / FLT_EPSILON;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionCamera.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCCAMERA_ACTION_H__\n#define __CCCAMERA_ACTION_H__\n\n#include \"CCActionInterval.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\nclass Camera;\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** \n@brief Base class for Camera actions\n@ingroup Actions\n*/\nclass CC_DLL ActionCamera : public ActionInterval //<NSCopying> \n{\npublic:\n    /**\n     * @js ctor\n     */\n    ActionCamera();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ActionCamera(){}\n\n    // Overrides\n    virtual void startWithTarget(Node *target) override;\n    virtual ActionCamera * reverse() const override;\n\tvirtual ActionCamera *clone() const override;\n\n    /* sets the Eye value of the Camera */\n    void setEye(const kmVec3 &eye);\n    void setEye(float x, float y, float z);\n    /* returns the Eye value of the Camera */\n    const kmVec3& getEye() const { return _eye; }\n    /* sets the Center value of the Camera */\n    void setCenter(const kmVec3 &center);\n    /* returns the Center value of the Camera */\n    const kmVec3& getCenter() const { return _center; }\n    /* sets the Up value of the Camera */\n    void setUp(const kmVec3 &up);\n    /* Returns the Up value of the Camera */\n    const kmVec3& getUp() const { return _up; }\n\nprotected:\n\n    void restore();\n    void updateTransform();\n\n    kmVec3 _center;\n    kmVec3 _eye;\n    kmVec3 _up;\n};\n\n/** \n@brief OrbitCamera action\nOrbits the camera around the center of the screen using spherical coordinates\n@ingroup Actions\n*/\nclass CC_DLL OrbitCamera : public ActionCamera //<NSCopying> \n{\npublic:\n    /** creates a OrbitCamera action with radius, delta-radius,  z, deltaZ, x, deltaX */\n    static OrbitCamera* create(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX);\n    /**\n     * @js ctor\n     */\n    OrbitCamera()\n\t\t: _radius(0.0)\n        , _deltaRadius(0.0)\n        , _angleZ(0.0)\n        , _deltaAngleZ(0.0)\n        , _angleX(0.0)            \n        , _deltaAngleX(0.0)\n        , _radZ(0.0)\n        , _radDeltaZ(0.0)\n        , _radX(0.0)                        \n        , _radDeltaX(0.0)        \n    {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~OrbitCamera(){}\n    \n    /** initializes a OrbitCamera action with radius, delta-radius,  z, deltaZ, x, deltaX */\n    bool initWithDuration(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX);\n    /** positions the camera according to spherical coordinates */\n    void sphericalRadius(float *r, float *zenith, float *azimuth);\n\n    // Overrides\n\tOrbitCamera *clone() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    float _radius;\n    float _deltaRadius;\n    float _angleZ;\n    float _deltaAngleZ;\n    float _angleX;\n    float _deltaAngleX;\n\n    float _radZ;\n    float _radDeltaZ;\n    float _radX;\n    float _radDeltaX;\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif //__CCCAMERA_ACTION_H__"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionCatmullRom.cpp",
    "content": "/*\n * Copyright (c) 2008 Radu Gruian\n * Copyright (c) 2011 Vit Valentin\n * Copyright (c) 2012 cocos2d-x.org\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n *\n * Original code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So\n *\n * Adapted to cocos2d-x by Vit Valentin\n *\n * Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada\n */\n#include \"ccMacros.h\"\n#include \"CCActionCatmullRom.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN;\n\n/*\n *  Implementation of PointArray\n */\n\nPointArray* PointArray::create(ssize_t capacity)\n{\n    PointArray* pointArray = new PointArray();\n    if (pointArray)\n    {\n        if (pointArray->initWithCapacity(capacity))\n        {\n            pointArray->autorelease();\n        }\n        else \n        {\n            delete pointArray;\n            pointArray = nullptr;\n        }\n    }\n\n    return pointArray;\n}\n\n\nbool PointArray::initWithCapacity(ssize_t capacity)\n{\n    _controlPoints = new vector<Point*>();\n    \n    return true;\n}\n\nPointArray* PointArray::clone() const\n{\n    vector<Point*> *newArray = new vector<Point*>();\n    vector<Point*>::iterator iter;\n    for (iter = _controlPoints->begin(); iter != _controlPoints->end(); ++iter)\n    {\n        newArray->push_back(new Point((*iter)->x, (*iter)->y));\n    }\n    \n    PointArray *points = new PointArray();\n    points->initWithCapacity(10);\n    points->setControlPoints(newArray);\n\n    points->autorelease();\n    return points;\n}\n\nPointArray::~PointArray()\n{\n    CCLOGINFO(\"deallocing PointArray: %p\", this);\n\n    vector<Point*>::iterator iter;\n    for (iter = _controlPoints->begin(); iter != _controlPoints->end(); ++iter)\n    {\n        delete *iter;\n    }\n    delete _controlPoints;\n}\n\nPointArray::PointArray() :_controlPoints(nullptr){}\n\nconst std::vector<Point*>* PointArray::getControlPoints() const\n{\n    return _controlPoints;\n}\n\nvoid PointArray::setControlPoints(vector<Point*> *controlPoints)\n{\n    CCASSERT(controlPoints != nullptr, \"control points should not be nullptr\");\n    \n    // delete old points\n    vector<Point*>::iterator iter;\n    for (iter = _controlPoints->begin(); iter != _controlPoints->end(); ++iter)\n    {\n        delete *iter;\n    }\n    delete _controlPoints;\n    \n    _controlPoints = controlPoints;\n}\n\nvoid PointArray::addControlPoint(Point controlPoint)\n{    \n    _controlPoints->push_back(new Point(controlPoint.x, controlPoint.y));\n}\n\nvoid PointArray::insertControlPoint(Point &controlPoint, ssize_t index)\n{\n    Point *temp = new Point(controlPoint.x, controlPoint.y);\n    _controlPoints->insert(_controlPoints->begin() + index, temp);\n}\n\nPoint PointArray::getControlPointAtIndex(ssize_t index)\n{\n    index = MIN(_controlPoints->size()-1, MAX(index, 0));\n    return *(_controlPoints->at(index));\n}\n\nvoid PointArray::replaceControlPoint(cocos2d::Point &controlPoint, ssize_t index)\n{\n\n    Point *temp = _controlPoints->at(index);\n    temp->x = controlPoint.x;\n    temp->y = controlPoint.y;\n}\n\nvoid PointArray::removeControlPointAtIndex(ssize_t index)\n{\n    vector<Point*>::iterator iter = _controlPoints->begin() + index;\n    Point* removedPoint = *iter;\n    _controlPoints->erase(iter);\n    delete removedPoint;\n}\n\nssize_t PointArray::count() const\n{\n    return _controlPoints->size();\n}\n\nPointArray* PointArray::reverse() const\n{\n    vector<Point*> *newArray = new vector<Point*>();\n    vector<Point*>::reverse_iterator iter;\n    Point *point = nullptr;\n    for (iter = _controlPoints->rbegin(); iter != _controlPoints->rend(); ++iter)\n    {\n        point = *iter;\n        newArray->push_back(new Point(point->x, point->y));\n    }\n    PointArray *config = PointArray::create(0);\n    config->setControlPoints(newArray);\n    \n    return config;\n}\n\nvoid PointArray::reverseInline()\n{\n    size_t l = _controlPoints->size();\n    Point *p1 = nullptr;\n    Point *p2 = nullptr;\n    float x, y;\n    for (size_t i = 0; i < l/2; ++i)\n    {\n        p1 = _controlPoints->at(i);\n        p2 = _controlPoints->at(l-i-1);\n        \n        x = p1->x;\n        y = p1->y;\n        \n        p1->x = p2->x;\n        p1->y = p2->y;\n        \n        p2->x = x;\n        p2->y = y;\n    }\n}\n\n// CatmullRom Spline formula:\nPoint ccCardinalSplineAt(Point &p0, Point &p1, Point &p2, Point &p3, float tension, float t)\n{\n    float t2 = t * t;\n    float t3 = t2 * t;\n    \n\t/*\n\t * Formula: s(-ttt + 2tt - t)P1 + s(-ttt + tt)P2 + (2ttt - 3tt + 1)P2 + s(ttt - 2tt + t)P3 + (-2ttt + 3tt)P3 + s(ttt - tt)P4\n\t */\n    float s = (1 - tension) / 2;\n\t\n    float b1 = s * ((-t3 + (2 * t2)) - t);                      // s(-t3 + 2 t2 - t)P1\n    float b2 = s * (-t3 + t2) + (2 * t3 - 3 * t2 + 1);          // s(-t3 + t2)P2 + (2 t3 - 3 t2 + 1)P2\n    float b3 = s * (t3 - 2 * t2 + t) + (-2 * t3 + 3 * t2);      // s(t3 - 2 t2 + t)P3 + (-2 t3 + 3 t2)P3\n    float b4 = s * (t3 - t2);                                   // s(t3 - t2)P4\n    \n    float x = (p0.x*b1 + p1.x*b2 + p2.x*b3 + p3.x*b4);\n    float y = (p0.y*b1 + p1.y*b2 + p2.y*b3 + p3.y*b4);\n\t\n\treturn Point(x,y);\n}\n\n/* Implementation of CardinalSplineTo\n */\n\nCardinalSplineTo* CardinalSplineTo::create(float duration, cocos2d::PointArray *points, float tension)\n{\n    CardinalSplineTo *ret = new CardinalSplineTo();\n    if (ret)\n    {\n        if (ret->initWithDuration(duration, points, tension))\n        {\n            ret->autorelease();\n        }\n        else \n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nbool CardinalSplineTo::initWithDuration(float duration, cocos2d::PointArray *points, float tension)\n{\n    CCASSERT(points->count() > 0, \"Invalid configuration. It must at least have one control point\");\n\n    if (ActionInterval::initWithDuration(duration))\n    {\n        this->setPoints(points);\n        this->_tension = tension;\n        \n        return true;\n    }\n    \n    return false;\n}\n\nCardinalSplineTo::~CardinalSplineTo()\n{\n    CC_SAFE_RELEASE_NULL(_points);\n}\n\nCardinalSplineTo::CardinalSplineTo()\n: _points(nullptr)\n, _deltaT(0.f)\n, _tension(0.f)\n{\n}\n\nvoid CardinalSplineTo::startWithTarget(cocos2d::Node *target)\n{\n    ActionInterval::startWithTarget(target);\n\t\n//    _deltaT = (float) 1 / _points->count();\n    \n    // Issue #1441\n    _deltaT = (float) 1 / (_points->count() - 1);\n\n    _previousPosition = target->getPosition();\n    _accumulatedDiff = Point::ZERO;\n}\n\nCardinalSplineTo* CardinalSplineTo::clone() const\n{\n\t// no copy constructor\n\tauto a = new CardinalSplineTo();\n\ta->initWithDuration(this->_duration, this->_points->clone(), this->_tension);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid CardinalSplineTo::update(float time)\n{\n    ssize_t p;\n    float lt;\n\t\n\t// eg.\n\t// p..p..p..p..p..p..p\n\t// 1..2..3..4..5..6..7\n\t// want p to be 1, 2, 3, 4, 5, 6\n    if (time == 1)\n    {\n        p = _points->count() - 1;\n        lt = 1;\n    }\n    else \n    {\n        p = time / _deltaT;\n        lt = (time - _deltaT * (float)p) / _deltaT;\n    }\n    \n\t// Interpolate    \n    Point pp0 = _points->getControlPointAtIndex(p-1);\n    Point pp1 = _points->getControlPointAtIndex(p+0);\n    Point pp2 = _points->getControlPointAtIndex(p+1);\n    Point pp3 = _points->getControlPointAtIndex(p+2);\n\t\n    Point newPos = ccCardinalSplineAt(pp0, pp1, pp2, pp3, _tension, lt);\n\t\n#if CC_ENABLE_STACKABLE_ACTIONS\n    // Support for stacked actions\n    Node *node = _target;\n    Point diff = node->getPosition() - _previousPosition;\n    if( diff.x !=0 || diff.y != 0 ) {\n        _accumulatedDiff = _accumulatedDiff + diff;\n        newPos = newPos + _accumulatedDiff;\n    }\n#endif\n    \n    this->updatePosition(newPos);\n}\n\nvoid CardinalSplineTo::updatePosition(cocos2d::Point &newPos)\n{\n    _target->setPosition(newPos);\n    _previousPosition = newPos;\n}\n\nCardinalSplineTo* CardinalSplineTo::reverse() const\n{\n    PointArray *pReverse = _points->reverse();\n    \n    return CardinalSplineTo::create(_duration, pReverse, _tension);\n}\n\n/* CardinalSplineBy\n */\n\nCardinalSplineBy* CardinalSplineBy::create(float duration, cocos2d::PointArray *points, float tension)\n{\n    CardinalSplineBy *ret = new CardinalSplineBy();\n    if (ret)\n    {\n        if (ret->initWithDuration(duration, points, tension))\n        {\n            ret->autorelease();\n        }\n        else \n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nCardinalSplineBy::CardinalSplineBy() : _startPosition(0,0)\n{\n}\n\nvoid CardinalSplineBy::updatePosition(cocos2d::Point &newPos)\n{\n    Point p = newPos + _startPosition;\n    _target->setPosition(p);\n    _previousPosition = p;\n}\n\nCardinalSplineBy* CardinalSplineBy::reverse() const\n{\n    PointArray *copyConfig = _points->clone();\n\t\n\t//\n\t// convert \"absolutes\" to \"diffs\"\n\t//\n    Point p = copyConfig->getControlPointAtIndex(0);\n    for (ssize_t i = 1; i < copyConfig->count(); ++i)\n    {\n        Point current = copyConfig->getControlPointAtIndex(i);\n        Point diff = current - p;\n        copyConfig->replaceControlPoint(diff, i);\n        \n        p = current;\n    }\n\t\n\t\n\t// convert to \"diffs\" to \"reverse absolute\"\n\t\n    PointArray *pReverse = copyConfig->reverse();\n\t\n\t// 1st element (which should be 0,0) should be here too\n    \n    p = pReverse->getControlPointAtIndex(pReverse->count()-1);\n    pReverse->removeControlPointAtIndex(pReverse->count()-1);\n    \n    p = -p;\n    pReverse->insertControlPoint(p, 0);\n    \n    for (ssize_t i = 1; i < pReverse->count(); ++i)\n    {\n        Point current = pReverse->getControlPointAtIndex(i);\n        current = -current;\n        Point abs = current + p;\n        pReverse->replaceControlPoint(abs, i);\n        \n        p = abs;\n    }\n\t\n    return CardinalSplineBy::create(_duration, pReverse, _tension);\n}\n\nvoid CardinalSplineBy::startWithTarget(cocos2d::Node *target)\n{    \n    CardinalSplineTo::startWithTarget(target);\n    _startPosition = target->getPosition();\n}\n\nCardinalSplineBy* CardinalSplineBy::clone() const\n{\n\t// no copy constructor\n\tauto a = new CardinalSplineBy();\n\ta->initWithDuration(this->_duration, this->_points->clone(), this->_tension);\n\ta->autorelease();\n\treturn a;\n}\n\n/* CatmullRomTo\n */\n\nCatmullRomTo* CatmullRomTo::create(float dt, cocos2d::PointArray *points)\n{\n    CatmullRomTo *ret = new CatmullRomTo();\n    if (ret)\n    {\n        if (ret->initWithDuration(dt, points))\n        {\n            ret->autorelease();\n        }\n        else \n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nbool CatmullRomTo::initWithDuration(float dt, cocos2d::PointArray *points)\n{\n    if (CardinalSplineTo::initWithDuration(dt, points, 0.5f))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nCatmullRomTo* CatmullRomTo::clone() const\n{\n\t// no copy constructor\n\tauto a = new CatmullRomTo();\n\ta->initWithDuration(this->_duration, this->_points->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nCatmullRomTo* CatmullRomTo::reverse() const\n{\n    PointArray *reverse = _points->reverse();\n    return CatmullRomTo::create(_duration, reverse);\n}\n\n\n/* CatmullRomBy\n */\n\nCatmullRomBy* CatmullRomBy::create(float dt, cocos2d::PointArray *points)\n{\n    CatmullRomBy *ret = new CatmullRomBy();\n    if (ret)\n    {\n        if (ret->initWithDuration(dt, points))\n        {\n            ret->autorelease();\n        }\n        else \n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nbool CatmullRomBy::initWithDuration(float dt, cocos2d::PointArray *points)\n{\n    if (CardinalSplineTo::initWithDuration(dt, points, 0.5f))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nCatmullRomBy* CatmullRomBy::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new CatmullRomBy();\n\ta->initWithDuration(this->_duration, this->_points->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nCatmullRomBy* CatmullRomBy::reverse() const\n{\n    PointArray *copyConfig = _points->clone();\n\n\t//\n\t// convert \"absolutes\" to \"diffs\"\n\t//\n    Point p = copyConfig->getControlPointAtIndex(0);\n    for (ssize_t i = 1; i < copyConfig->count(); ++i)\n    {\n        Point current = copyConfig->getControlPointAtIndex(i);\n        Point diff = current - p;\n        copyConfig->replaceControlPoint(diff, i);\n\n        p = current;\n    }\n\n\n\t// convert to \"diffs\" to \"reverse absolute\"\n\n    PointArray *reverse = copyConfig->reverse();\n\n\t// 1st element (which should be 0,0) should be here too\n\n    p = reverse->getControlPointAtIndex(reverse->count()-1);\n    reverse->removeControlPointAtIndex(reverse->count()-1);\n\n    p = -p;\n    reverse->insertControlPoint(p, 0);\n\n    for (ssize_t i = 1; i < reverse->count(); ++i)\n    {\n        Point current = reverse->getControlPointAtIndex(i);\n        current = -current;\n        Point abs = current + p;\n        reverse->replaceControlPoint(abs, i);\n\n        p = abs;\n    }\n\n    return CatmullRomBy::create(_duration, reverse);\n}\n\nNS_CC_END;\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionCatmullRom.h",
    "content": "/*\n * Copyright (c) 2008 Radu Gruian\n * Copyright (c) 2011 Vit Valentin\n * Copyright (c) 2012 cocos2d-x.org\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n *\n * Original code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So\n *\n * Adapted to cocos2d-x by Vit Valentin\n *\n * Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada\n */\n\n\n#ifndef __CCACTION_CATMULLROM_H__\n#define __CCACTION_CATMULLROM_H__\n\n#include <vector>\n\n#include \"CCActionInterval.h\"\n#include \"CCNode.h\"\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN;\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** An Array that contain control points.\n Used by CardinalSplineTo and (By) and CatmullRomTo (and By) actions.\n@ingroup Actions\n */\nclass CC_DLL PointArray : public Object, public Clonable\n{\npublic:\n    \n    /** creates and initializes a Points array with capacity \n     * @js NA\n     */\n    static PointArray* create(ssize_t capacity);\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~PointArray();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    PointArray();\n    \n    /** initializes a Catmull Rom config with a capacity hint \n     * @js NA\n     */\n    bool initWithCapacity(ssize_t capacity);\n    \n    /** appends a control point \n     * @js NA\n     */\n    void addControlPoint(Point controlPoint);\n    \n    /** inserts a controlPoint at index \n     * @js NA\n     */\n    void insertControlPoint(Point &controlPoint, ssize_t index);\n    \n    /** replaces an existing controlPoint at index \n     * @js NA\n     */\n    void replaceControlPoint(Point &controlPoint, ssize_t index);\n    \n    /** get the value of a controlPoint at a given index \n     * @js NA\n     */\n    Point getControlPointAtIndex(ssize_t index);\n    \n    /** deletes a control point at a given index \n     * @js NA\n     */\n    void removeControlPointAtIndex(ssize_t index);\n    \n    /** returns the number of objects of the control point array \n     * @js NA\n     */\n    ssize_t count() const;\n    \n    /** returns a new copy of the array reversed. User is responsible for releasing this copy \n     * @js NA\n     */\n    PointArray* reverse() const;\n    \n    /** reverse the current control point array inline, without generating a new one \n     * @js NA\n     */\n    void reverseInline();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual PointArray* clone() const;\n    /**\n     * @js NA\n     */\n    const std::vector<Point*>* getControlPoints() const;\n    /**\n     * @js NA\n     */\n    void setControlPoints(std::vector<Point*> *controlPoints);\nprivate:\n    /** Array that contains the control points */\n    std::vector<Point*> *_controlPoints;\n};\n\n/** Cardinal Spline path.\n http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline\n@ingroup Actions\n */\nclass CC_DLL CardinalSplineTo : public ActionInterval\n{\npublic:\n\n    /** creates an action with a Cardinal Spline array of points and tension \n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js: var create(var t,var table)\n     * in lua: lcaol create(local t, local table)\n     * @endcode\n     */\n    static CardinalSplineTo* create(float duration, PointArray* points, float tension);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~CardinalSplineTo();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CardinalSplineTo();\n    \n    /** initializes the action with a duration and an array of points */\n    bool initWithDuration(float duration, PointArray* points, float tension);\n\n    virtual void updatePosition(Point &newPos);\n\n    inline PointArray* getPoints() { return _points; }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    inline void setPoints(PointArray* points)\n    {\n        CC_SAFE_RETAIN(points);\n        CC_SAFE_RELEASE(_points);\n        _points = points;\n    }\n\n    // Overrides\n\tvirtual CardinalSplineTo *clone() const override;\n    virtual CardinalSplineTo* reverse() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    /** Array of control points */\n    PointArray *_points;\n    float _deltaT;\n    float _tension;\n    Point\t_previousPosition;\n    Point\t_accumulatedDiff;\n};\n\n/** Cardinal Spline path.\n http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline\n @ingroup Actions\n */\nclass CC_DLL CardinalSplineBy : public CardinalSplineTo \n{\npublic:\n    \n    /** creates an action with a Cardinal Spline array of points and tension \n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js: var create(var t,var table)\n     * in lua: lcaol create(local t, local table)\n     * @endcode\n     */\n    static CardinalSplineBy* create(float duration, PointArray* points, float tension);\n\n    CardinalSplineBy();\n    \n    // Overrides\n    virtual void startWithTarget(Node *target) override;\n    virtual void updatePosition(Point &newPos) override;\n\tvirtual CardinalSplineBy *clone() const override;\n    virtual CardinalSplineBy* reverse() const override;\n\nprotected:\n    Point _startPosition;\n};\n\n/** An action that moves the target with a CatmullRom curve to a destination point.\n A Catmull Rom is a Cardinal Spline with a tension of 0.5.\n http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline\n @ingroup Actions\n */\nclass CC_DLL CatmullRomTo : public CardinalSplineTo\n{\npublic:\n    \n    /** creates an action with a Cardinal Spline array of points and tension \n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js: var create(var dt,var table)\n     * in lua: lcaol create(local dt, local table)\n     * @endcode\n     */\n    static CatmullRomTo* create(float dt, PointArray* points);\n\n    /** initializes the action with a duration and an array of points */\n    bool initWithDuration(float dt, PointArray* points);\n\n    // Override\n\tvirtual CatmullRomTo *clone() const override;\n\tvirtual CatmullRomTo *reverse() const override;\n};\n\n/** An action that moves the target with a CatmullRom curve by a certain distance.\n A Catmull Rom is a Cardinal Spline with a tension of 0.5.\n http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline\n @ingroup Actions\n */\nclass CC_DLL CatmullRomBy : public CardinalSplineBy\n{\npublic:\n    /** creates an action with a Cardinal Spline array of points and tension \n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js: var create(var dt,var table)\n     * in lua: lcaol create(local dt, local table)\n     * @endcode\n     */\n    static CatmullRomBy* create(float dt, PointArray* points);\n\n    /** initializes the action with a duration and an array of points */\n    bool initWithDuration(float dt, PointArray* points);\n\n    // Override\n\tvirtual CatmullRomBy *clone() const override;\n\tvirtual CatmullRomBy *reverse() const override;\n\n};\n\n/** Returns the Cardinal Spline position for a given set of control points, tension and time */\nextern CC_DLL Point ccCardinalSplineAt(Point &p0, Point &p1, Point &p2, Point &p3, float tension, float t);\n\n// end of actions group\n/// @}\n\nNS_CC_END;\n\n#endif // __CCACTION_CATMULLROM_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionEase.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2009 Jason Booth\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n/*\n * Elastic, Back and Bounce actions based on code from:\n * http://github.com/NikhilK/silverlightfx/\n *\n * by http://github.com/NikhilK\n */\n\n#include \"CCActionEase.h\"\n\nNS_CC_BEGIN\n\n#ifndef M_PI_X_2\n#define M_PI_X_2 (float)M_PI * 2.0f\n#endif\n\n//\n// EaseAction\n//\n\nbool ActionEase::initWithAction(ActionInterval *action)\n{\n    CCASSERT(action != nullptr, \"\");\n\n    if (ActionInterval::initWithDuration(action->getDuration()))\n    {\n        _inner = action;\n        action->retain();\n\n        return true;\n    }\n\n    return false;\n}\n\nActionEase::~ActionEase(void)\n{\n    CC_SAFE_RELEASE(_inner);\n}\n\nvoid ActionEase::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _inner->startWithTarget(_target);\n}\n\nvoid ActionEase::stop(void)\n{\n    _inner->stop();\n    ActionInterval::stop();\n}\n\nvoid ActionEase::update(float time)\n{\n    _inner->update(time);\n}\n\nActionInterval* ActionEase::getInnerAction()\n{\n    return _inner;\n}\n\n//\n// EaseRateAction\n//\n\nbool EaseRateAction::initWithAction(ActionInterval *action, float rate)\n{\n    if (ActionEase::initWithAction(action))\n    {\n        _rate = rate;\n        return true;\n    }\n\n    return false;\n}\n\nEaseRateAction::~EaseRateAction()\n{\n}\n\n//\n// EeseIn\n//\n\nEaseIn* EaseIn::create(ActionInterval *action, float rate)\n{\n    EaseIn *easeIn = new EaseIn();\n    if (easeIn)\n    {\n        if (easeIn->initWithAction(action, rate))\n        {\n            easeIn->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(easeIn);\n        }\n    }\n\n    return easeIn;\n}\n\nEaseIn* EaseIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseIn();\n\ta->initWithAction(_inner->clone(), _rate);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseIn::update(float time)\n{\n    _inner->update(powf(time, _rate));\n}\n\nEaseIn* EaseIn::reverse() const\n{\n    return EaseIn::create(_inner->reverse(), 1 / _rate);\n}\n\n//\n// EaseOut\n//\nEaseOut* EaseOut::create(ActionInterval *action, float rate)\n{\n    EaseOut *easeOut = new EaseOut();\n    if (easeOut)\n    {\n        if (easeOut->initWithAction(action, rate))\n        {\n            easeOut->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(easeOut);\n        }\n    }\n\n    return easeOut;\n}\n\nEaseOut* EaseOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseOut();\n\ta->initWithAction(_inner->clone(), _rate);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseOut::update(float time)\n{\n    _inner->update(powf(time, 1 / _rate));\n}\n\nEaseOut* EaseOut::reverse() const\n{\n    return EaseOut::create(_inner->reverse(), 1 / _rate);\n}\n\n//\n// EaseInOut\n//\nEaseInOut* EaseInOut::create(ActionInterval *action, float rate)\n{\n    EaseInOut *easeInOut = new EaseInOut();\n    if (easeInOut)\n    {\n        if (easeInOut->initWithAction(action, rate))\n        {\n            easeInOut->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(easeInOut);\n        }\n    }\n\n    return easeInOut;\n}\n\nEaseInOut* EaseInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseInOut();\n\ta->initWithAction(_inner->clone(), _rate);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseInOut::update(float time)\n{\n    time *= 2;\n    if (time < 1)\n    {\n        _inner->update(0.5f * powf(time, _rate));\n    }\n    else\n    {\n        _inner->update(1.0f - 0.5f * powf(2-time, _rate));\n    }\n}\n\n// InOut and OutIn are symmetrical\nEaseInOut* EaseInOut::reverse() const\n{\n    return EaseInOut::create(_inner->reverse(), _rate);\n}\n\n//\n// EaseExponentialIn\n//\nEaseExponentialIn* EaseExponentialIn::create(ActionInterval* action)\n{\n    EaseExponentialIn *ret = new EaseExponentialIn();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseExponentialIn* EaseExponentialIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseExponentialIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseExponentialIn::update(float time)\n{\n    _inner->update(time == 0 ? 0 : powf(2, 10 * (time/1 - 1)) - 1 * 0.001f);\n}\n\nActionEase * EaseExponentialIn::reverse() const\n{\n    return EaseExponentialOut::create(_inner->reverse());\n}\n\n//\n// EaseExponentialOut\n//\nEaseExponentialOut* EaseExponentialOut::create(ActionInterval* action)\n{\n    EaseExponentialOut *ret = new EaseExponentialOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseExponentialOut* EaseExponentialOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseExponentialOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseExponentialOut::update(float time)\n{\n    _inner->update(time == 1 ? 1 : (-powf(2, -10 * time / 1) + 1));\n}\n\nActionEase* EaseExponentialOut::reverse() const\n{\n    return EaseExponentialIn::create(_inner->reverse());\n}\n\n//\n// EaseExponentialInOut\n//\n\nEaseExponentialInOut* EaseExponentialInOut::create(ActionInterval *action)\n{\n    EaseExponentialInOut *ret = new EaseExponentialInOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseExponentialInOut* EaseExponentialInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseExponentialInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseExponentialInOut::update(float time)\n{\n    time /= 0.5f;\n    if (time < 1)\n    {\n        time = 0.5f * powf(2, 10 * (time - 1));\n    }\n    else\n    {\n        time = 0.5f * (-powf(2, -10 * (time - 1)) + 2);\n    }\n\n    _inner->update(time);\n}\n\nEaseExponentialInOut* EaseExponentialInOut::reverse() const\n{\n    return EaseExponentialInOut::create(_inner->reverse());\n}\n\n//\n// EaseSineIn\n//\n\nEaseSineIn* EaseSineIn::create(ActionInterval* action)\n{\n    EaseSineIn *ret = new EaseSineIn();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseSineIn* EaseSineIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseSineIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseSineIn::update(float time)\n{\n    _inner->update(-1 * cosf(time * (float)M_PI_2) + 1);\n}\n\nActionEase* EaseSineIn::reverse() const\n{\n    return EaseSineOut::create(_inner->reverse());\n}\n\n//\n// EaseSineOut\n//\n\nEaseSineOut* EaseSineOut::create(ActionInterval* action)\n{\n    EaseSineOut *ret = new EaseSineOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseSineOut* EaseSineOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseSineOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseSineOut::update(float time)\n{\n    _inner->update(sinf(time * (float)M_PI_2));\n}\n\nActionEase* EaseSineOut::reverse(void) const\n{\n    return EaseSineIn::create(_inner->reverse());\n}\n\n//\n// EaseSineInOut\n//\n\nEaseSineInOut* EaseSineInOut::create(ActionInterval* action)\n{\n    EaseSineInOut *ret = new EaseSineInOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseSineInOut* EaseSineInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseSineInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseSineInOut::update(float time)\n{\n    _inner->update(-0.5f * (cosf((float)M_PI * time) - 1));\n}\n\nEaseSineInOut* EaseSineInOut::reverse() const\n{\n    return EaseSineInOut::create(_inner->reverse());\n}\n\n//\n// EaseElastic\n//\n\nbool EaseElastic::initWithAction(ActionInterval *action, float period/* = 0.3f*/)\n{\n    if (ActionEase::initWithAction(action))\n    {\n        _period = period;\n        return true;\n    }\n\n    return false;\n}\n\n//\n// EaseElasticIn\n//\n\nEaseElasticIn* EaseElasticIn::create(ActionInterval *action)\n{\n    return EaseElasticIn::create(action, 0.3f);\n}\n\nEaseElasticIn* EaseElasticIn::create(ActionInterval *action, float period/* = 0.3f*/)\n{\n    EaseElasticIn *ret = new EaseElasticIn();\n    if (ret)\n    {\n        if (ret->initWithAction(action, period))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseElasticIn* EaseElasticIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseElasticIn();\n\ta->initWithAction(_inner->clone(), _period);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseElasticIn::update(float time)\n{\n    float newT = 0;\n    if (time == 0 || time == 1)\n    {\n        newT = time;\n    }\n    else\n    {\n        float s = _period / 4;\n        time = time - 1;\n        newT = -powf(2, 10 * time) * sinf((time - s) * M_PI_X_2 / _period);\n    }\n\n    _inner->update(newT);\n}\n\nEaseElastic* EaseElasticIn::reverse() const\n{\n    return EaseElasticOut::create(_inner->reverse(), _period);\n}\n\n//\n// EaseElasticOut\n//\n\nEaseElasticOut* EaseElasticOut::create(ActionInterval *action)\n{\n    return EaseElasticOut::create(action, 0.3f);\n}\n\nEaseElasticOut* EaseElasticOut::create(ActionInterval *action, float period/* = 0.3f*/)\n{\n    EaseElasticOut *ret = new EaseElasticOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action, period))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseElasticOut* EaseElasticOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseElasticOut();\n\ta->initWithAction(_inner->clone(), _period);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseElasticOut::update(float time)\n{\n    float newT = 0;\n    if (time == 0 || time == 1)\n    {\n        newT = time;\n    }\n    else\n    {\n        float s = _period / 4;\n        newT = powf(2, -10 * time) * sinf((time - s) * M_PI_X_2 / _period) + 1;\n    }\n\n    _inner->update(newT);\n}\n\nEaseElastic* EaseElasticOut::reverse() const\n{\n    return EaseElasticIn::create(_inner->reverse(), _period);\n}\n\n//\n// EaseElasticInOut\n//\n\nEaseElasticInOut* EaseElasticInOut::create(ActionInterval *action)\n{\n    return EaseElasticInOut::create(action, 0.3f);\n}\n\nEaseElasticInOut* EaseElasticInOut::create(ActionInterval *action, float period/* = 0.3f*/)\n{\n    EaseElasticInOut *ret = new EaseElasticInOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action, period))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseElasticInOut* EaseElasticInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseElasticInOut();\n\ta->initWithAction(_inner->clone(), _period);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseElasticInOut::update(float time)\n{\n    float newT = 0;\n    if (time == 0 || time == 1)\n    {\n        newT = time;\n    }\n    else\n    {\n        time = time * 2;\n        if ( _period == 0)\n        {\n            _period = 0.3f * 1.5f;\n        }\n\n        float s = _period / 4;\n\n        time = time - 1;\n        if (time < 0)\n        {\n            newT = -0.5f * powf(2, 10 * time) * sinf((time -s) * M_PI_X_2 / _period);\n        }\n        else\n        {\n            newT = powf(2, -10 * time) * sinf((time - s) * M_PI_X_2 / _period) * 0.5f + 1;\n        }\n    }\n\n    _inner->update(newT);\n}\n\nEaseElasticInOut* EaseElasticInOut::reverse() const\n{\n    return EaseElasticInOut::create(_inner->reverse(), _period);\n}\n\n//\n// EaseBounce\n//\n\nfloat EaseBounce::bounceTime(float time)\n{\n    if (time < 1 / 2.75)\n    {\n        return 7.5625f * time * time;\n    } else \n    if (time < 2 / 2.75)\n    {\n        time -= 1.5f / 2.75f;\n        return 7.5625f * time * time + 0.75f;\n    } else\n    if(time < 2.5 / 2.75)\n    {\n        time -= 2.25f / 2.75f;\n        return 7.5625f * time * time + 0.9375f;\n    }\n\n    time -= 2.625f / 2.75f;\n    return 7.5625f * time * time + 0.984375f;\n}\n\n//\n// EaseBounceIn\n//\n\nEaseBounceIn* EaseBounceIn::create(ActionInterval* action)\n{\n    EaseBounceIn *ret = new EaseBounceIn();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseBounceIn* EaseBounceIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseBounceIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseBounceIn::update(float time)\n{\n    float newT = 1 - bounceTime(1 - time);\n    _inner->update(newT);\n}\n\nEaseBounce* EaseBounceIn::reverse() const\n{\n    return EaseBounceOut::create(_inner->reverse());\n}\n\n//\n// EaseBounceOut\n//\n\nEaseBounceOut* EaseBounceOut::create(ActionInterval* action)\n{\n    EaseBounceOut *ret = new EaseBounceOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseBounceOut* EaseBounceOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseBounceOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseBounceOut::update(float time)\n{\n    float newT = bounceTime(time);\n    _inner->update(newT);\n}\n\nEaseBounce* EaseBounceOut::reverse() const\n{\n    return EaseBounceIn::create(_inner->reverse());\n}\n\n//\n// EaseBounceInOut\n//\n\nEaseBounceInOut* EaseBounceInOut::create(ActionInterval* action)\n{\n    EaseBounceInOut *ret = new EaseBounceInOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseBounceInOut* EaseBounceInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseBounceInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseBounceInOut::update(float time)\n{\n    float newT = 0;\n    if (time < 0.5f)\n    {\n        time = time * 2;\n        newT = (1 - bounceTime(1 - time)) * 0.5f;\n    }\n    else\n    {\n        newT = bounceTime(time * 2 - 1) * 0.5f + 0.5f;\n    }\n\n    _inner->update(newT);\n}\n\nEaseBounceInOut* EaseBounceInOut::reverse() const\n{\n    return EaseBounceInOut::create(_inner->reverse());\n}\n\n//\n// EaseBackIn\n//\n\nEaseBackIn* EaseBackIn::create(ActionInterval *action)\n{\n    EaseBackIn *ret = new EaseBackIn();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseBackIn* EaseBackIn::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new EaseBackIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseBackIn::update(float time)\n{\n    float overshoot = 1.70158f;\n    _inner->update(time * time * ((overshoot + 1) * time - overshoot));\n}\n\nActionEase* EaseBackIn::reverse() const\n{\n    return EaseBackOut::create(_inner->reverse());\n}\n\n//\n// EaseBackOut\n//\n\nEaseBackOut* EaseBackOut::create(ActionInterval* action)\n{\n    EaseBackOut *ret = new EaseBackOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseBackOut* EaseBackOut::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new EaseBackOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseBackOut::update(float time)\n{\n    float overshoot = 1.70158f;\n\n    time = time - 1;\n    _inner->update(time * time * ((overshoot + 1) * time + overshoot) + 1);\n}\n\nActionEase* EaseBackOut::reverse() const\n{\n    return EaseBackIn::create(_inner->reverse());\n}\n\n//\n// EaseBackInOut\n//\n\nEaseBackInOut* EaseBackInOut::create(ActionInterval* action)\n{\n    EaseBackInOut *ret = new EaseBackInOut();\n    if (ret)\n    {\n        if (ret->initWithAction(action))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n\n    return ret;\n}\n\nEaseBackInOut* EaseBackInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseBackInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseBackInOut::update(float time)\n{\n    float overshoot = 1.70158f * 1.525f;\n\n    time = time * 2;\n    if (time < 1)\n    {\n        _inner->update((time * time * ((overshoot + 1) * time - overshoot)) / 2);\n    }\n    else\n    {\n        time = time - 2;\n        _inner->update((time * time * ((overshoot + 1) * time + overshoot)) / 2 + 1);\n    }\n}\n\nEaseBackInOut* EaseBackInOut::reverse() const\n{\n    return EaseBackInOut::create(_inner->reverse());\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionEase.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2009 Jason Booth\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ACTION_CCEASE_ACTION_H__\n#define __ACTION_CCEASE_ACTION_H__\n\n#include \"CCActionInterval.h\"\n\nNS_CC_BEGIN\n\nclass Object;\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** \n @brief Base class for Easing actions\n @ingroup Actions\n */\nclass CC_DLL ActionEase : public ActionInterval\n{\npublic:\n\n    virtual ActionInterval* getInnerAction();\n\n    //\n    // Overrides\n    //\n\tvirtual ActionEase* clone() const override = 0;\n    virtual ActionEase* reverse() const override = 0;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop() override;\n    virtual void update(float time) override;\n\nprotected:\n    ActionEase() {}\n    virtual ~ActionEase();\n    /** initializes the action */\n    bool initWithAction(ActionInterval *action);\n\n    /** The inner action */\n    ActionInterval *_inner;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ActionEase);\n};\n\n/** \n @brief Base class for Easing actions with rate parameters\n @ingroup Actions\n */\nclass CC_DLL EaseRateAction : public ActionEase\n{\npublic:\n    /** set rate value for the actions */\n    inline void setRate(float rate) { _rate = rate; }\n    /** get rate value for the actions */\n    inline float getRate() const { return _rate; }\n\n    //\n    // Overrides\n    //\n\tvirtual EaseRateAction* clone() const override = 0;\n    virtual EaseRateAction* reverse() const override = 0;\n\nprotected:\n    EaseRateAction() {}\n    virtual ~EaseRateAction();\n    /** Initializes the action with the inner action and the rate parameter */\n    bool initWithAction(ActionInterval *pAction, float fRate);\n\n    float _rate;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseRateAction);\n};\n\n/** \n @brief EaseIn action with a rate\n @ingroup Actions\n */\nclass CC_DLL EaseIn : public EaseRateAction\n{\npublic:\n    /** Creates the action with the inner action and the rate parameter */\n    static EaseIn* create(ActionInterval* action, float rate);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseIn* clone() const override;\n\tvirtual EaseIn* reverse() const override;\n\nprotected:\n    EaseIn() {}\n    virtual ~EaseIn() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseIn);\n};\n\n/** \n @brief EaseOut action with a rate\n @ingroup Actions\n */\nclass CC_DLL EaseOut : public EaseRateAction\n{\npublic:\n    /** Creates the action with the inner action and the rate parameter */\n    static EaseOut* create(ActionInterval* action, float rate);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseOut* clone() const  override;\n\tvirtual EaseOut* reverse() const  override;\n\nprotected:\n    EaseOut() {}\n    virtual ~EaseOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseOut);\n};\n\n/** \n @brief EaseInOut action with a rate\n @ingroup Actions\n */\nclass CC_DLL EaseInOut : public EaseRateAction\n{\npublic:\n    /** Creates the action with the inner action and the rate parameter */\n    static EaseInOut* create(ActionInterval* action, float rate);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseInOut* clone() const  override;\n\tvirtual EaseInOut* reverse() const  override;\n\nprotected:\n    EaseInOut() {}\n    virtual ~EaseInOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseInOut);\n};\n\n/** \n @brief Ease Exponential In\n @ingroup Actions\n */\nclass CC_DLL EaseExponentialIn : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseExponentialIn* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseExponentialIn* clone() const override;\n\tvirtual ActionEase* reverse() const override;\n\nprotected:\n    EaseExponentialIn() {}\n    virtual ~EaseExponentialIn() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseExponentialIn);\n};\n\n/** \n @brief Ease Exponential Out\n @ingroup Actions\n */\nclass CC_DLL EaseExponentialOut : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseExponentialOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseExponentialOut* clone() const override;\n\tvirtual ActionEase* reverse() const override;\n\nprotected:\n    EaseExponentialOut() {}\n    virtual ~EaseExponentialOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseExponentialOut);\n};\n\n/** \n @brief Ease Exponential InOut\n @ingroup Actions\n */\nclass CC_DLL EaseExponentialInOut : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseExponentialInOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseExponentialInOut* clone() const override;\n\tvirtual EaseExponentialInOut* reverse() const override;\n\nprotected:\n    EaseExponentialInOut() {}\n    virtual ~EaseExponentialInOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseExponentialInOut);\n};\n\n/** \n @brief Ease Sine In\n @ingroup Actions\n */\nclass CC_DLL EaseSineIn : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseSineIn* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseSineIn* clone() const override;\n\tvirtual ActionEase* reverse() const override;\n\nprotected:\n    EaseSineIn() {}\n    virtual ~EaseSineIn() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseSineIn);\n};\n\n/** \n @brief Ease Sine Out\n @ingroup Actions\n */\nclass CC_DLL EaseSineOut : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseSineOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseSineOut* clone() const override;\n\tvirtual ActionEase* reverse() const override;\n\nprotected:\n    EaseSineOut() {}\n    virtual ~EaseSineOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseSineOut);\n};\n\n/** \n @brief Ease Sine InOut\n @ingroup Actions\n */\nclass CC_DLL EaseSineInOut : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseSineInOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseSineInOut* clone() const override;\n\tvirtual EaseSineInOut* reverse() const override;\n\nprotected:\n    EaseSineInOut() {}\n    virtual ~EaseSineInOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseSineInOut);\n};\n\n/** \n @brief Ease Elastic abstract class\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseElastic : public ActionEase\n{\npublic:\n\n    /** get period of the wave in radians. default is 0.3 */\n    inline float getPeriod() const { return _period; }\n    /** set period of the wave in radians. */\n    inline void setPeriod(float fPeriod) { _period = fPeriod; }\n\n    //\n    // Overrides\n    //\n\tvirtual EaseElastic* clone() const override = 0;\n\tvirtual EaseElastic* reverse() const override = 0;\n\nprotected:\n    EaseElastic() {}\n    virtual ~EaseElastic() {}\n    /** Initializes the action with the inner action and the period in radians (default is 0.3) */\n    bool initWithAction(ActionInterval *action, float period = 0.3f);\n\n    float _period;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseElastic);\n\n};\n\n/** \n @brief Ease Elastic In action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseElasticIn : public EaseElastic\n{\npublic:\n    /** Creates the action with the inner action and the period in radians (default is 0.3) */\n    static EaseElasticIn* create(ActionInterval *action, float period);\n    static EaseElasticIn* create(ActionInterval *action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseElasticIn* clone() const override;\n\tvirtual EaseElastic* reverse() const override;\n\nprotected:\n    EaseElasticIn() {}\n    virtual ~EaseElasticIn() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseElasticIn);\n};\n\n/** \n @brief Ease Elastic Out action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseElasticOut : public EaseElastic\n{\npublic:\n    /** Creates the action with the inner action and the period in radians (default is 0.3) */\n    static EaseElasticOut* create(ActionInterval *action, float period);\n    static EaseElasticOut* create(ActionInterval *action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseElasticOut* clone() const override;\n\tvirtual EaseElastic* reverse() const override;\n\nprotected:\n    EaseElasticOut() {}\n    virtual ~EaseElasticOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseElasticOut);\n};\n\n/** \n @brief Ease Elastic InOut action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseElasticInOut : public EaseElastic\n{\npublic:\n    /** Creates the action with the inner action and the period in radians (default is 0.3) */\n    static EaseElasticInOut* create(ActionInterval *action, float period);\n    static EaseElasticInOut* create(ActionInterval *action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseElasticInOut* clone() const override;\n\tvirtual EaseElasticInOut* reverse() const override;\n\nprotected:\n    EaseElasticInOut() {}\n    virtual ~EaseElasticInOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseElasticInOut);\n};\n\n/** \n @brief EaseBounce abstract class.\n @since v0.8.2\n @ingroup Actions\n*/\nclass CC_DLL EaseBounce : public ActionEase\n{\npublic:\n    float bounceTime(float time);\n\n    // Overrides\n\tvirtual EaseBounce* clone() const override = 0;\n\tvirtual EaseBounce* reverse() const override = 0;\n\nprotected:\n    EaseBounce() {}\n    virtual ~EaseBounce() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseBounce);\n};\n\n/** \n @brief EaseBounceIn action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n*/\nclass CC_DLL EaseBounceIn : public EaseBounce\n{\npublic:\n    /** creates the action */\n    static EaseBounceIn* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseBounceIn* clone() const override;\n\tvirtual EaseBounce* reverse() const override;\n\nprotected:\n    EaseBounceIn() {}\n    virtual ~EaseBounceIn() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseBounceIn);\n};\n\n/** \n @brief EaseBounceOut action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseBounceOut : public EaseBounce\n{\npublic:\n    /** creates the action */\n    static EaseBounceOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseBounceOut* clone() const override;\n\tvirtual EaseBounce* reverse() const override;\n\nprotected:\n    EaseBounceOut() {}\n    virtual ~EaseBounceOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseBounceOut);\n};\n\n/** \n @brief EaseBounceInOut action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseBounceInOut : public EaseBounce\n{\npublic:\n    /** creates the action */\n    static EaseBounceInOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseBounceInOut* clone() const override;\n\tvirtual EaseBounceInOut* reverse() const override;\n\nprotected:\n    EaseBounceInOut() {}\n    virtual ~EaseBounceInOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseBounceInOut);\n};\n\n/** \n @brief EaseBackIn action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseBackIn : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseBackIn* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseBackIn* clone() const override;\n\tvirtual ActionEase* reverse() const override;\n\nprotected:\n    EaseBackIn() {}\n    virtual ~EaseBackIn() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseBackIn);\n};\n\n/** \n @brief EaseBackOut action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseBackOut : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseBackOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseBackOut* clone() const override;\n\tvirtual ActionEase* reverse() const override;\n\nprotected:\n    EaseBackOut() {}\n    virtual ~EaseBackOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseBackOut);\n};\n\n/** \n @brief EaseBackInOut action.\n @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action.\n @since v0.8.2\n @ingroup Actions\n */\nclass CC_DLL EaseBackInOut : public ActionEase\n{\npublic:\n    /** creates the action */\n    static EaseBackInOut* create(ActionInterval* action);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual EaseBackInOut* clone() const override;\n\tvirtual EaseBackInOut* reverse() const override;\n\nprotected:\n    EaseBackInOut() {}\n    virtual ~EaseBackInOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(EaseBackInOut);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTION_CCEASE_ACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionGrid.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCActionGrid.h\"\n#include \"CCDirector.h\"\n#include \"CCGrid.h\"\n#include \"CCNodeGrid.h\"\n\nNS_CC_BEGIN\n// implementation of GridAction\n\nbool GridAction::initWithDuration(float duration, const Size& gridSize)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _gridSize = gridSize;\n\n        return true;\n    }\n\n    return false;\n}\n\nvoid GridAction::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    cacheTargetAsGridNode();\n\n    GridBase *newgrid = this->getGrid();\n\n    GridBase *targetGrid = _gridNodeTarget->getGrid();\n\n    if (targetGrid && targetGrid->getReuseGrid() > 0)\n    {\n        if (targetGrid->isActive() && targetGrid->getGridSize().width == _gridSize.width\n            && targetGrid->getGridSize().height == _gridSize.height /*&& dynamic_cast<GridBase*>(targetGrid) != nullptr*/)\n        {\n            targetGrid->reuse();\n        }\n        else\n        {\n            CCASSERT(0, \"\");\n        }\n    }\n    else\n    {\n        if (targetGrid && targetGrid->isActive())\n        {\n            targetGrid->setActive(false);\n        }\n\n        _gridNodeTarget->setGrid(newgrid);\n        _gridNodeTarget->getGrid()->setActive(true);\n    }\n}\n\nvoid GridAction::cacheTargetAsGridNode()\n{\n    _gridNodeTarget = dynamic_cast<NodeGrid*> (_target);\n    CCASSERT(_gridNodeTarget, \"GridActions can only used on NodeGrid\");\n}\n\nGridAction* GridAction::reverse() const\n{\n    // FIXME: This conversion isn't safe.\n\treturn (GridAction*)ReverseTime::create( this->clone() );\n}\n\nGridBase* GridAction::getGrid()\n{\n    // Abstract class needs implementation\n    CCASSERT(0, \"\");\n\n    return nullptr;\n}\n\n// implementation of Grid3DAction\n\nGridBase* Grid3DAction::getGrid()\n{\n    return Grid3D::create(_gridSize);\n}\n\nVertex3F Grid3DAction::getVertex(const Point& position) const\n{\n    Grid3D *g = (Grid3D*)_gridNodeTarget->getGrid();\n    return g->getVertex(position);\n}\n\nVertex3F Grid3DAction::getOriginalVertex(const Point& position) const\n{\n    Grid3D *g = (Grid3D*)_gridNodeTarget->getGrid();\n    return g->getOriginalVertex(position);\n}\n\nvoid Grid3DAction::setVertex(const Point& position, const Vertex3F& vertex)\n{\n    Grid3D *g = (Grid3D*)_gridNodeTarget->getGrid();\n    g->setVertex(position, vertex);\n}\n\n// implementation of TiledGrid3DAction\n\nGridBase* TiledGrid3DAction::getGrid(void)\n{\n    return TiledGrid3D::create(_gridSize);\n}\n\nQuad3 TiledGrid3DAction::getTile(const Point& pos) const\n{\n    TiledGrid3D *g = (TiledGrid3D*)_gridNodeTarget->getGrid();\n    return g->getTile(pos);\n}\n\nQuad3 TiledGrid3DAction::getOriginalTile(const Point& pos) const\n{\n    TiledGrid3D *g = (TiledGrid3D*)_gridNodeTarget->getGrid();\n    return g->getOriginalTile(pos);\n}\n\nvoid TiledGrid3DAction::setTile(const Point& pos, const Quad3& coords)\n{\n    TiledGrid3D *g = (TiledGrid3D*)_gridNodeTarget->getGrid();\n    return g->setTile(pos, coords);\n}\n\n// implementation AccelDeccelAmplitude\n\nAccelDeccelAmplitude* AccelDeccelAmplitude::create(Action *action, float duration)\n{\n    AccelDeccelAmplitude *ret = new AccelDeccelAmplitude();\n    if (ret)\n    {\n        if (ret->initWithAction(action, duration))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(ret);\n        }\n    }\n\n    return ret;\n}\n\nbool AccelDeccelAmplitude::initWithAction(Action *action, float duration)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _rate = 1.0f;\n        _other = (ActionInterval*)(action);\n        action->retain();\n\n        return true;\n    }\n\n    return false;\n}\n\nAccelDeccelAmplitude* AccelDeccelAmplitude::clone() const\n{\n\t// no copy constructor\n\tauto a = new AccelDeccelAmplitude();\n\ta->initWithAction(_other->clone(), _rate);\n\ta->autorelease();\n\treturn a;\n}\n\nAccelDeccelAmplitude::~AccelDeccelAmplitude()\n{\n    CC_SAFE_RELEASE(_other);\n}\n\nvoid AccelDeccelAmplitude::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _other->startWithTarget(target);\n}\n\nvoid AccelDeccelAmplitude::update(float time)\n{\n    float f = time * 2;\n\n    if (f > 1)\n    {\n        f -= 1;\n        f = 1 - f;\n    }\n\n    ((AccelDeccelAmplitude*)(_other))->setAmplitudeRate(powf(f, _rate));\n}\n\nAccelDeccelAmplitude* AccelDeccelAmplitude::reverse() const\n{\n    return AccelDeccelAmplitude::create(_other->reverse(), _duration);\n}\n\n// implementation of AccelAmplitude\n\nAccelAmplitude* AccelAmplitude::create(Action *action, float duration)\n{\n    AccelAmplitude *ret = new AccelAmplitude();\n    if (ret)\n    {\n        if (ret->initWithAction(action, duration))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(ret);\n        }\n    }\n\n    return ret;\n}\n\nbool AccelAmplitude::initWithAction(Action *action, float duration)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _rate = 1.0f;\n        _other = (ActionInterval*)(action);\n        action->retain();\n\n        return true;\n    }\n\n    return false;\n}\n\nAccelAmplitude* AccelAmplitude::clone() const\n{\n\t// no copy constructor\n\tauto a = new AccelAmplitude();\n\ta->initWithAction(_other->clone(), _duration);\n\ta->autorelease();\n\treturn a;\n}\n\nAccelAmplitude::~AccelAmplitude(void)\n{\n    CC_SAFE_DELETE(_other);\n}\n\nvoid AccelAmplitude::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _other->startWithTarget(target);\n}\n\nvoid AccelAmplitude::update(float time)\n{\n    ((AccelAmplitude*)(_other))->setAmplitudeRate(powf(time, _rate));\n    _other->update(time);\n}\n\nAccelAmplitude* AccelAmplitude::reverse() const\n{\n    return AccelAmplitude::create(_other->reverse(), _duration);\n}\n\n// DeccelAmplitude\n\nDeccelAmplitude* DeccelAmplitude::create(Action *action, float duration)\n{\n    DeccelAmplitude *ret = new DeccelAmplitude();\n    if (ret)\n    {\n        if (ret->initWithAction(action, duration))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(ret);\n        }\n    }\n\n    return ret;\n}\n\nbool DeccelAmplitude::initWithAction(Action *action, float duration)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _rate = 1.0f;\n        _other = (ActionInterval*)(action);\n        action->retain();\n\n        return true;\n    }\n\n    return false;\n}\n\nDeccelAmplitude::~DeccelAmplitude()\n{\n    CC_SAFE_RELEASE(_other);\n}\n\nvoid DeccelAmplitude::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _other->startWithTarget(target);\n}\n\nvoid DeccelAmplitude::update(float time)\n{\n    ((DeccelAmplitude*)(_other))->setAmplitudeRate(powf((1 - time), _rate));\n    _other->update(time);\n}\n\nDeccelAmplitude* DeccelAmplitude::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new DeccelAmplitude();\n\ta->initWithAction(_other->clone(), _duration);\n\ta->autorelease();\n\treturn a;\n}\n\nDeccelAmplitude* DeccelAmplitude::reverse() const\n{\n    return DeccelAmplitude::create(_other->reverse(), _duration);\n}\n\n// implementation of StopGrid\n\nvoid StopGrid::startWithTarget(Node *target)\n{\n    ActionInstant::startWithTarget(target);\n    cacheTargetAsGridNode();\n    GridBase *grid = _gridNodeTarget->getGrid();\n    if (grid && grid->isActive())\n    {\n        grid->setActive(false);\n    }\n}\n\nvoid StopGrid::cacheTargetAsGridNode()\n{\n    _gridNodeTarget = dynamic_cast<NodeGrid*> (_target);\n    CCASSERT(_gridNodeTarget, \"GridActions can only used on NodeGrid\");\n}\n\nStopGrid* StopGrid::create()\n{\n    StopGrid* pAction = new StopGrid();\n    pAction->autorelease();\n\n    return pAction;\n}\n\nStopGrid* StopGrid::clone() const\n{\n\treturn StopGrid::create();\n}\n\nStopGrid* StopGrid::reverse() const\n{\n\t// no reverse, just clone it\n\treturn this->clone();\n}\n\n// implementation of ReuseGrid\n\nReuseGrid* ReuseGrid::create(int times)\n{\n    ReuseGrid *action = new ReuseGrid();\n    if (action)\n    {\n        if (action->initWithTimes(times))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(action);\n        }\n    }\n\n    return action;\n}\n\nbool ReuseGrid::initWithTimes(int times)\n{\n    _times = times;\n\n    return true;\n}\n\nvoid ReuseGrid::startWithTarget(Node *target)\n{\n    ActionInstant::startWithTarget(target);\n    cacheTargetAsGridNode();\n\n    if (_gridNodeTarget->getGrid() && _gridNodeTarget->getGrid()->isActive())\n    {\n        _gridNodeTarget->getGrid()->setReuseGrid(_gridNodeTarget->getGrid()->getReuseGrid() + _times);\n    }\n}\n\nvoid ReuseGrid::cacheTargetAsGridNode()\n{\n    _gridNodeTarget = dynamic_cast<NodeGrid*> (_target);\n    CCASSERT(_gridNodeTarget, \"GridActions can only used on NodeGrid\");\n}\n\nReuseGrid* ReuseGrid::clone() const\n{\n\treturn ReuseGrid::create(_times);\n}\n\nReuseGrid* ReuseGrid::reverse() const\n{\n\t// no reverse, just clone it\n\treturn this->clone();\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionGrid.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __ACTION_CCGRID_ACTION_H__\n#define __ACTION_CCGRID_ACTION_H__\n\n#include \"CCActionInterval.h\"\n#include \"CCActionInstant.h\"\n\nNS_CC_BEGIN\n\nclass GridBase;\nclass NodeGrid;\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** @brief Base class for Grid actions */\nclass CC_DLL GridAction : public ActionInterval\n{\npublic:\n\n    /** returns the grid */\n    virtual GridBase* getGrid();\n\n    // overrides\n\tvirtual GridAction * clone() const override = 0;\n    virtual GridAction* reverse() const override;\n    virtual void startWithTarget(Node *target) override;\n\nprotected:\n    GridAction() {}\n    virtual ~GridAction() {}\n    /** initializes the action with size and duration */\n    bool initWithDuration(float duration, const Size& gridSize);\n\n    Size _gridSize;\n    \n    NodeGrid* _gridNodeTarget;\n    \n    void cacheTargetAsGridNode();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(GridAction);\n};\n\n/** \n @brief Base class for Grid3D actions.\n Grid3D actions can modify a non-tiled grid.\n */\nclass CC_DLL Grid3DAction : public GridAction\n{\npublic:\n\n    /** returns the grid */\n    virtual GridBase* getGrid();\n    /** returns the vertex than belongs to certain position in the grid \n     * @js NA\n     * @lua NA\n     */\n    Vertex3F getVertex(const Point& position) const;\n\n    /** @deprecated Use getVertex() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE inline Vertex3F vertex(const Point& position) { return getVertex(position); }\n\n    /** returns the non-transformed vertex than belongs to certain position in the grid \n     * @js NA\n     * @lua NA\n     */\n    Vertex3F getOriginalVertex(const Point& position) const;\n\n    /** @deprecated Use getOriginalVertex() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE inline Vertex3F originalVertex(const Point& position) { return getOriginalVertex(position); }\n\n    /** sets a new vertex to a certain position of the grid \n     * @js NA\n     * @lua NA\n     */\n    void setVertex(const Point& position, const Vertex3F& vertex);\n\n    // Overrides\n\tvirtual Grid3DAction * clone() const override = 0;\n};\n\n/** @brief Base class for TiledGrid3D actions */\nclass CC_DLL TiledGrid3DAction : public GridAction\n{\npublic:\n    /** creates the action with size and duration \n     * @js NA\n     * @lua NA\n     */\n    static TiledGrid3DAction* create(float duration, const Size& gridSize);\n\n    /** returns the tile that belongs to a certain position of the grid \n     * @js NA\n     * @lua NA\n     */\n    Quad3 getTile(const Point& position) const;\n\n    /** @deprecated Use getTile() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Point& position) { return getTile(position); }\n\n    /** returns the non-transformed tile that belongs to a certain position of the grid \n     * @js NA\n     * @lua NA\n     */\n    Quad3 getOriginalTile(const Point& position) const;\n\n    /** @deprecated Use getOriginalTile() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Point& position) { return getOriginalTile(position); }\n\n    /** sets a new tile to a certain position of the grid \n     * @js NA\n     * @lua NA\n     */\n    void setTile(const Point& position, const Quad3& coords);\n\n    /** returns the grid */\n    virtual GridBase* getGrid();\n\n    // Override\n    virtual TiledGrid3DAction * clone() const override = 0;\n};\n\n/** @brief AccelDeccelAmplitude action */\nclass CC_DLL AccelDeccelAmplitude : public ActionInterval\n{\npublic:\n    /** creates the action with an inner action that has the amplitude property, and a duration time */\n    static AccelDeccelAmplitude* create(Action *action, float duration);\n\n    /** get amplitude rate */\n    inline float getRate(void) const { return _rate; }\n    /** set amplitude rate */\n    inline void setRate(float fRate) { _rate = fRate; }\n\n    // Overrides\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\tvirtual AccelDeccelAmplitude* clone() const override;\n\tvirtual AccelDeccelAmplitude* reverse() const override;\n\nprotected:\n    AccelDeccelAmplitude() {}\n    virtual ~AccelDeccelAmplitude();\n    /** initializes the action with an inner action that has the amplitude property, and a duration time */\n    bool initWithAction(Action *pAction, float duration);\n\n    float _rate;\n    ActionInterval *_other;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude);\n};\n\n/** @brief AccelAmplitude action */\nclass CC_DLL AccelAmplitude : public ActionInterval\n{\npublic:\n    /** creates the action with an inner action that has the amplitude property, and a duration time */\n    static AccelAmplitude* create(Action *action, float duration);\n\n    /** get amplitude rate */\n    inline float getRate() const { return _rate; }\n    /** set amplitude rate */\n    inline void setRate(float rate) { _rate = rate; }\n\n    // Overrides\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\tvirtual AccelAmplitude* clone() const override;\n\tvirtual AccelAmplitude* reverse() const override;\n\nprotected:\n    AccelAmplitude() {}\n    virtual ~AccelAmplitude();\n    bool initWithAction(Action *action, float duration);\n\n    float _rate;\n    ActionInterval *_other;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude);\n};\n\n/** @brief DeccelAmplitude action */\nclass CC_DLL DeccelAmplitude : public ActionInterval\n{\npublic:\n    /** creates the action with an inner action that has the amplitude property, and a duration time */\n    static DeccelAmplitude* create(Action *action, float duration);\n\n    /** get amplitude rate */\n    inline float getRate(void) const { return _rate; }\n    /** set amplitude rate */\n    inline void setRate(float rate) { _rate = rate; }\n\n    // overrides\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\tvirtual DeccelAmplitude* clone() const override;\n\tvirtual DeccelAmplitude* reverse() const override;\n\nprotected:\n    DeccelAmplitude() {}\n    virtual ~DeccelAmplitude();\n    /** initializes the action with an inner action that has the amplitude property, and a duration time */\n    bool initWithAction(Action *action, float duration);\n\n    float _rate;\n    ActionInterval *_other;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude);\n};\n\n/** @brief StopGrid action.\n @warning Don't call this action if another grid action is active.\n Call if you want to remove the the grid effect. Example:\n Sequence::actions(Lens::action(...), StopGrid::action(...), nullptr);\n */\nclass CC_DLL StopGrid : public ActionInstant\n{\npublic:\n    /** Allocates and initializes the action */\n    static StopGrid* create();\n\n    // Overrides\n    virtual void startWithTarget(Node *target) override;\n\tvirtual StopGrid* clone() const override;\n\tvirtual StopGrid* reverse() const override;\n\nprotected:\n    StopGrid() {}\n    virtual ~StopGrid() {}\n    \n    NodeGrid* _gridNodeTarget;\n    \n    void cacheTargetAsGridNode();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(StopGrid);\n};\n\n/** @brief ReuseGrid action */\nclass CC_DLL ReuseGrid : public ActionInstant\n{\npublic:\n    /** creates an action with the number of times that the current grid will be reused */\n    static ReuseGrid* create(int times);\n\n    // Override\n    virtual void startWithTarget(Node *target) override;\n\tvirtual ReuseGrid* clone() const override;\n\tvirtual ReuseGrid* reverse() const override;\n\nprotected:\n    ReuseGrid() {}\n    virtual ~ReuseGrid() {}\n    /** initializes an action with the number of times that the current grid will be reused */\n    bool initWithTimes(int times);\n    \n    NodeGrid* _gridNodeTarget;\n    \n    void cacheTargetAsGridNode();\n    \n    int _times;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ReuseGrid);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTION_CCGRID_ACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionGrid3D.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCActionGrid3D.h\"\n#include \"CCDirector.h\"\n#include <stdlib.h>\n\nNS_CC_BEGIN\n// implementation of Waves3D\n\nWaves3D* Waves3D::create(float duration, const Size& gridSize, unsigned int waves, float amplitude)\n{\n    Waves3D *pAction = new Waves3D();\n\n    if (pAction)\n    {\n        if (pAction->initWithDuration(duration, gridSize, waves, amplitude))\n        {\n            pAction->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(pAction);\n        }\n    }\n\n    return pAction;    \n}\n\nbool Waves3D::initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude)\n{\n    if (Grid3DAction::initWithDuration(duration, gridSize))\n    {\n        _waves = waves;\n        _amplitude = amplitude;\n        _amplitudeRate = 1.0f;\n\n        return true;\n    }\n\n    return false;\n}\n\nWaves3D* Waves3D::clone() const\n{\n\t// no copy constructor\n\tauto a = new Waves3D();\n    a->initWithDuration(_duration, _gridSize, _waves, _amplitude);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Waves3D::update(float time)\n{\n    int i, j;\n    for (i = 0; i < _gridSize.width + 1; ++i)\n    {\n        for (j = 0; j < _gridSize.height + 1; ++j)\n        {\n            Vertex3F v = getOriginalVertex(Point(i ,j));\n            v.z += (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * 0.01f) * _amplitude * _amplitudeRate);\n            //CCLOG(\"v.z offset is %f\\n\", (sinf((float)M_PI * time * _waves * 2 + (v.y+v.x) * .01f) * _amplitude * _amplitudeRate));\n            setVertex(Point(i, j), v);\n        }\n    }\n}\n\n// implementation of FlipX3D\n\nFlipX3D* FlipX3D::create(float duration)\n{\n    FlipX3D *action = new FlipX3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool FlipX3D::initWithDuration(float duration)\n{\n    return Grid3DAction::initWithDuration(duration, Size(1, 1));\n}\n\nbool FlipX3D::initWithSize(const Size& gridSize, float duration)\n{\n    if (gridSize.width != 1 || gridSize.height != 1)\n    {\n        // Grid size must be (1,1)\n        CCASSERT(0, \"Grid size must be (1,1)\");\n\n        return false;\n    }\n\n    return Grid3DAction::initWithDuration(duration, gridSize);\n}\n\nFlipX3D* FlipX3D::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new FlipX3D();\n    a->initWithSize(_gridSize, _duration);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid FlipX3D::update(float time)\n{\n    float angle = (float)M_PI * time; // 180 degrees\n    float mz = sinf(angle);\n    angle = angle / 2.0f; // x calculates degrees from 0 to 90\n    float mx = cosf(angle);\n\n    Vertex3F v0, v1, v, diff;\n\n    v0 = getOriginalVertex(Point(1, 1));\n    v1 = getOriginalVertex(Point(0, 0));\n\n    float    x0 = v0.x;\n    float    x1 = v1.x;\n    float    x;\n    Point    a, b, c, d;\n\n    if ( x0 > x1 )\n    {\n        // Normal Grid\n        a = Point(0,0);\n        b = Point(0,1);\n        c = Point(1,0);\n        d = Point(1,1);\n        x = x0;\n    }\n    else\n    {\n        // Reversed Grid\n        c = Point(0,0);\n        d = Point(0,1);\n        a = Point(1,0);\n        b = Point(1,1);\n        x = x1;\n    }\n    \n    diff.x = ( x - x * mx );\n    diff.z = fabsf( floorf( (x * mz) / 4.0f ) );\n\n    // bottom-left\n    v = getOriginalVertex(a);\n    v.x = diff.x;\n    v.z += diff.z;\n    setVertex(a, v);\n    \n    // upper-left\n    v = getOriginalVertex(b);\n    v.x = diff.x;\n    v.z += diff.z;\n    setVertex(b, v);\n    \n    // bottom-right\n    v = getOriginalVertex(c);\n    v.x -= diff.x;\n    v.z -= diff.z;\n    setVertex(c, v);\n    \n    // upper-right\n    v = getOriginalVertex(d);\n    v.x -= diff.x;\n    v.z -= diff.z;\n    setVertex(d, v);\n}\n\n// implementation of FlipY3D\n\nFlipY3D* FlipY3D::clone() const\n{\n    // no copy constructor\n\tauto a = new FlipY3D();\n    a->initWithSize(_gridSize, _duration);\n\ta->autorelease();\n\treturn a;\n}\n\nFlipY3D* FlipY3D::create(float duration)\n{\n    FlipY3D *action = new FlipY3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nvoid FlipY3D::update(float time)\n{\n    float angle = (float)M_PI * time; // 180 degrees\n    float mz = sinf( angle );\n    angle = angle / 2.0f;     // x calculates degrees from 0 to 90\n    float my = cosf(angle);\n    \n    Vertex3F    v0, v1, v, diff;\n    \n    v0 = getOriginalVertex(Point(1, 1));\n    v1 = getOriginalVertex(Point(0, 0));\n    \n    float    y0 = v0.y;\n    float    y1 = v1.y;\n    float y;\n    Point    a, b, c, d;\n    \n    if (y0 > y1)\n    {\n        // Normal Grid\n        a = Point(0,0);\n        b = Point(0,1);\n        c = Point(1,0);\n        d = Point(1,1);\n        y = y0;\n    }\n    else\n    {\n        // Reversed Grid\n        b = Point(0,0);\n        a = Point(0,1);\n        d = Point(1,0);\n        c = Point(1,1);\n        y = y1;\n    }\n    \n    diff.y = y - y * my;\n    diff.z = fabsf(floorf((y * mz) / 4.0f));\n    \n    // bottom-left\n    v = getOriginalVertex(a);\n    v.y = diff.y;\n    v.z += diff.z;\n    setVertex(a, v);\n    \n    // upper-left\n    v = getOriginalVertex(b);\n    v.y -= diff.y;\n    v.z -= diff.z;\n    setVertex(b, v);\n    \n    // bottom-right\n    v = getOriginalVertex(c);\n    v.y = diff.y;\n    v.z += diff.z;\n    setVertex(c, v);\n    \n    // upper-right\n    v = getOriginalVertex(d);\n    v.y -= diff.y;\n    v.z -= diff.z;\n    setVertex(d, v);\n}\n\n\n// implementation of Lens3D\n\nLens3D* Lens3D::create(float duration, const Size& gridSize, const Point& position, float radius)\n{\n    Lens3D *action = new Lens3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, position, radius))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool Lens3D::initWithDuration(float duration, const Size& gridSize, const Point& position, float radius)\n{\n    if (Grid3DAction::initWithDuration(duration, gridSize))\n    {\n        _position = Point(-1, -1);\n        setPosition(position);\n        _radius = radius;\n        _lensEffect = 0.7f;\n        _concave = false;\n        _dirty = true;\n\n        return true;\n    }\n\n    return false;\n}\n\nLens3D* Lens3D::clone() const\n{\n\t// no copy constructor\n\tauto a = new Lens3D();\n\ta->initWithDuration(_duration, _gridSize, _position, _radius);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Lens3D::setPosition(const Point& pos)\n{\n    if( !pos.equals(_position))\n    {\n        _position = pos;\n        _dirty = true;\n    }\n}\n\nvoid Lens3D::update(float time)\n{\n    CC_UNUSED_PARAM(time);\n    if (_dirty)\n    {\n        int i, j;\n        \n        for (i = 0; i < _gridSize.width + 1; ++i)\n        {\n            for (j = 0; j < _gridSize.height + 1; ++j)\n            {\n                Vertex3F v = getOriginalVertex(Point(i, j));\n                Point vect = _position - Point(v.x, v.y);\n                float r = vect.getLength();\n                \n                if (r < _radius)\n                {\n                    r = _radius - r;\n                    float pre_log = r / _radius;\n                    if ( pre_log == 0 ) \n                    {\n                        pre_log = 0.001f;\n                    }\n\n                    float l = logf(pre_log) * _lensEffect;\n                    float new_r = expf( l ) * _radius;\n                    \n                    if (vect.getLength() > 0)\n                    {\n                        vect = vect.normalize();\n                        Point new_vect = vect * new_r;\n                        v.z += (_concave ? -1.0f : 1.0f) * new_vect.getLength() * _lensEffect;\n                    }\n                }\n                \n                setVertex(Point(i, j), v);\n            }\n        }\n        \n        _dirty = false;\n    }\n}\n\n// implementation of Ripple3D\n\nRipple3D* Ripple3D::create(float duration, const Size& gridSize, const Point& position, float radius, unsigned int waves, float amplitude)\n{\n    Ripple3D *action = new Ripple3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, position, radius, waves, amplitude))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool Ripple3D::initWithDuration(float duration, const Size& gridSize, const Point& position, float radius, unsigned int waves, float amplitude)\n{\n    if (Grid3DAction::initWithDuration(duration, gridSize))\n    {\n        setPosition(position);\n        _radius = radius;\n        _waves = waves;\n        _amplitude = amplitude;\n        _amplitudeRate = 1.0f;\n\n        return true;\n    }\n\n    return false;\n}\n\nvoid Ripple3D::setPosition(const Point& position)\n{\n    _position = position;\n}\n\n\nRipple3D* Ripple3D::clone() const\n{\n\t// no copy constructor\n\tauto a = new Ripple3D();\n\ta->initWithDuration(_duration, _gridSize, _position, _radius, _waves, _amplitude);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Ripple3D::update(float time)\n{\n    int i, j;\n\n    for (i = 0; i < (_gridSize.width+1); ++i)\n    {\n        for (j = 0; j < (_gridSize.height+1); ++j)\n        {\n            Vertex3F v = getOriginalVertex(Point(i, j));\n            Point vect = _position - Point(v.x,v.y);\n            float r = vect.getLength();\n            \n            if (r < _radius)\n            {\n                r = _radius - r;\n                float rate = powf(r / _radius, 2);\n                v.z += (sinf( time*(float)M_PI * _waves * 2 + r * 0.1f) * _amplitude * _amplitudeRate * rate);\n            }\n            \n            setVertex(Point(i, j), v);\n        }\n    }\n}\n\n// implementation of Shaky3D\n\nShaky3D* Shaky3D::create(float duration, const Size& gridSize, int range, bool shakeZ)\n{\n    Shaky3D *action = new Shaky3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, range, shakeZ))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool Shaky3D::initWithDuration(float duration, const Size& gridSize, int range, bool shakeZ)\n{\n    if (Grid3DAction::initWithDuration(duration, gridSize))\n    {\n        _randrange = range;\n        _shakeZ = shakeZ;\n\n        return true;\n    }\n\n    return false;\n}\n\nShaky3D* Shaky3D::clone() const\n{\n\t// no copy constructor\n\tauto a = new Shaky3D();\n    a->initWithDuration(_duration, _gridSize, _randrange, _shakeZ);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Shaky3D::update(float time)\n{\n    CC_UNUSED_PARAM(time);\n    int i, j;\n\n    for (i = 0; i < (_gridSize.width+1); ++i)\n    {\n        for (j = 0; j < (_gridSize.height+1); ++j)\n        {\n            Vertex3F v = getOriginalVertex(Point(i ,j));\n            v.x += (rand() % (_randrange*2)) - _randrange;\n            v.y += (rand() % (_randrange*2)) - _randrange;\n            if (_shakeZ)\n            {\n                v.z += (rand() % (_randrange*2)) - _randrange;\n            }\n            \n            setVertex(Point(i, j), v);\n        }\n    }\n}\n\n// implementation of Liquid\n\nLiquid* Liquid::create(float duration, const Size& gridSize, unsigned int waves, float amplitude)\n{\n    Liquid *action = new Liquid();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, waves, amplitude))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool Liquid::initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude)\n{\n    if (Grid3DAction::initWithDuration(duration, gridSize))\n    {\n        _waves = waves;\n        _amplitude = amplitude;\n        _amplitudeRate = 1.0f;\n\n        return true;\n    }\n\n    return false;\n}\n\nLiquid* Liquid::clone() const\n{\n\t// no copy constructor\n\tauto a = new Liquid();\n\ta->initWithDuration(_duration, _gridSize, _waves, _amplitude);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Liquid::update(float time)\n{\n    int i, j;\n\n    for (i = 1; i < _gridSize.width; ++i)\n    {\n        for (j = 1; j < _gridSize.height; ++j)\n        {\n            Vertex3F v = getOriginalVertex(Point(i, j));\n            v.x = (v.x + (sinf(time * (float)M_PI * _waves * 2 + v.x * .01f) * _amplitude * _amplitudeRate));\n            v.y = (v.y + (sinf(time * (float)M_PI * _waves * 2 + v.y * .01f) * _amplitude * _amplitudeRate));\n            setVertex(Point(i, j), v);\n        }\n    }\n}\n\n// implementation of Waves\n\nWaves* Waves::create(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical)\n{\n    Waves *action = new Waves();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, waves, amplitude, horizontal, vertical))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool Waves::initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical)\n{\n    if (Grid3DAction::initWithDuration(duration, gridSize))\n    {\n        _waves = waves;\n        _amplitude = amplitude;\n        _amplitudeRate = 1.0f;\n        _horizontal = horizontal;\n        _vertical = vertical;\n\n        return true;\n    }\n\n    return false;\n}\n\nWaves* Waves::clone() const\n{\n\t// no copy constructor\n\tauto a = new Waves();\n\ta->initWithDuration(_duration, _gridSize, _waves, _amplitude, _horizontal, _vertical);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Waves::update(float time)\n{\n    int i, j;\n\n    for (i = 0; i < _gridSize.width + 1; ++i)\n    {\n        for (j = 0; j < _gridSize.height + 1; ++j)\n        {\n            Vertex3F v = getOriginalVertex(Point(i, j));\n\n            if (_vertical)\n            {\n                v.x = (v.x + (sinf(time * (float)M_PI * _waves * 2 + v.y * .01f) * _amplitude * _amplitudeRate));\n            }\n\n            if (_horizontal)\n            {\n                v.y = (v.y + (sinf(time * (float)M_PI * _waves * 2 + v.x * .01f) * _amplitude * _amplitudeRate));\n            }\n\n            setVertex(Point(i, j), v);\n        }\n    }\n}\n\n// implementation of Twirl\n\nTwirl* Twirl::create(float duration, const Size& gridSize, Point position, unsigned int twirls, float amplitude)\n{\n    Twirl *action = new Twirl();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, position, twirls, amplitude))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool Twirl::initWithDuration(float duration, const Size& gridSize, Point position, unsigned int twirls, float amplitude)\n{\n    if (Grid3DAction::initWithDuration(duration, gridSize))\n    {\n        setPosition(position);\n        _twirls = twirls;\n        _amplitude = amplitude;\n        _amplitudeRate = 1.0f;\n\n        return true;\n    }\n\n    return false;\n}\n\nvoid Twirl::setPosition(const Point& position)\n{\n    _position = position;\n}\n\nTwirl *Twirl::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new Twirl();\n\ta->initWithDuration(_duration, _gridSize, _position, _twirls, _amplitude);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Twirl::update(float time)\n{\n    int i, j;\n    Point    c = _position;\n    \n    for (i = 0; i < (_gridSize.width+1); ++i)\n    {\n        for (j = 0; j < (_gridSize.height+1); ++j)\n        {\n            Vertex3F v = getOriginalVertex(Point(i ,j));\n            \n            Point    avg = Point(i-(_gridSize.width/2.0f), j-(_gridSize.height/2.0f));\n            float r = avg.getLength();\n            \n            float amp = 0.1f * _amplitude * _amplitudeRate;\n            float a = r * cosf( (float)M_PI/2.0f + time * (float)M_PI * _twirls * 2 ) * amp;\n            \n            Point d = Point(\n                sinf(a) * (v.y-c.y) + cosf(a) * (v.x-c.x),\n                cosf(a) * (v.y-c.y) - sinf(a) * (v.x-c.x));\n            \n            v.x = c.x + d.x;\n            v.y = c.y + d.y;\n\n            setVertex(Point(i ,j), v);\n        }\n    }\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionGrid3D.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __ACTION_CCGRID3D_ACTION_H__\n#define __ACTION_CCGRID3D_ACTION_H__\n\n#include \"CCActionGrid.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** \n@brief Waves3D action \n*/\nclass CC_DLL Waves3D : public Grid3DAction\n{\npublic:\n    /** creates an action with duration, grid size, waves and amplitude */\n    static Waves3D* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);\n\n    /** returns the amplitude of the effect */\n    inline float getAmplitude() const { return _amplitude; }\n    /** sets the amplitude to the effect */\n    inline void setAmplitude(float amplitude) { _amplitude = amplitude; }\n\n    /** returns the amplitude rate */\n    inline float getAmplitudeRate() const { return _amplitudeRate; }\n    /** sets the ampliture rate */\n    inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }\n\n\t// Overrides\n\tvirtual Waves3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    Waves3D() {}\n    virtual ~Waves3D() {}\n    /** initializes an action with duration, grid size, waves and amplitude */\n    bool initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude);\n\n    unsigned int _waves;\n    float _amplitude;\n    float _amplitudeRate;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Waves3D);\n};\n\n/** @brief FlipX3D action */\nclass CC_DLL FlipX3D : public Grid3DAction\n{\npublic:\n    /** creates the action with duration */\n    static FlipX3D* create(float duration);\n\n    // Override\n\tvirtual FlipX3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    FlipX3D() {}\n    virtual ~FlipX3D() {}\n    /** initializes the action with duration */\n    bool initWithDuration(float duration);\n    virtual bool initWithSize(const Size& gridSize, float duration);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FlipX3D);\n};\n\n/** @brief FlipY3D action */\nclass CC_DLL FlipY3D : public FlipX3D\n{\npublic:\n    FlipY3D() {}\n    virtual ~FlipY3D() {}\n    /** creates the action with duration */\n    static FlipY3D* create(float duration);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual FlipY3D* clone() const override;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FlipY3D);\n};\n\n/** @brief Lens3D action */\nclass CC_DLL Lens3D : public Grid3DAction\n{\npublic:\n    /** creates the action with center position, radius, a grid size and duration */\n    static Lens3D* create(float duration, const Size& gridSize, const Point& position, float radius);\n\n    /** Get lens center position */\n    inline float getLensEffect() const { return _lensEffect; }\n    /** Set lens center position */\n    inline void setLensEffect(float lensEffect) { _lensEffect = lensEffect; }\n    /** Set whether lens is concave */\n    inline void setConcave(bool concave) { _concave = concave; }\n  \n    inline const Point& getPosition() const { return _position; }\n    void setPosition(const Point& position);\n\n    // Overrides\n\tvirtual Lens3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    Lens3D() {}\n    virtual ~Lens3D() {}\n    /** initializes the action with center position, radius, a grid size and duration */\n    bool initWithDuration(float duration, const Size& gridSize, const Point& position, float radius);\n\n    /* lens center position */\n    Point _position;\n    float _radius;\n    /** lens effect. Defaults to 0.7 - 0 means no effect, 1 is very strong effect */\n    float _lensEffect;\n    /** lens is concave. (true = concave, false = convex) default is convex i.e. false */\n    bool _concave;\n\n    bool    _dirty;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Lens3D);\n};\n\n/** @brief Ripple3D action */\nclass CC_DLL Ripple3D : public Grid3DAction\n{\npublic:\n    /** creates the action with radius, number of waves, amplitude, a grid size and duration */\n    static Ripple3D* create(float duration, const Size& gridSize, const Point& position, float radius, unsigned int waves, float amplitude);\n\n    /** get center position */\n    inline const Point& getPosition() const { return _position; }\n    /** set center position */\n    void setPosition(const Point& position);\n\n    inline float getAmplitude() const { return _amplitude; }\n    inline void setAmplitude(float fAmplitude) { _amplitude = fAmplitude; }\n\n    inline float getAmplitudeRate() const { return _amplitudeRate; }\n    inline void setAmplitudeRate(float fAmplitudeRate) { _amplitudeRate = fAmplitudeRate; }\n\n    // Override\n\tvirtual Ripple3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    Ripple3D() {}\n    virtual ~Ripple3D() {}\n    /** initializes the action with radius, number of waves, amplitude, a grid size and duration */\n    bool initWithDuration(float duration, const Size& gridSize, const Point& position, float radius, unsigned int waves, float amplitude);\n\n    /* center position */\n    Point _position;\n    float _radius;\n    unsigned int _waves;\n    float _amplitude;\n    float _amplitudeRate;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Ripple3D);\n};\n\n/** @brief Shaky3D action */\nclass CC_DLL Shaky3D : public Grid3DAction\n{\npublic:\n    Shaky3D() {}\n    virtual ~Shaky3D() {}\n    /** creates the action with a range, shake Z vertices, a grid and duration */\n    static Shaky3D* create(float duration, const Size& gridSize, int range, bool shakeZ);\n\n    // Overrides\n\tvirtual Shaky3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    /** initializes the action with a range, shake Z vertices, a grid and duration */\n    bool initWithDuration(float duration, const Size& gridSize, int range, bool shakeZ);\n\n    int _randrange;\n    bool _shakeZ;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Shaky3D);\n};\n\n/** @brief Liquid action */\nclass CC_DLL Liquid : public Grid3DAction\n{\npublic:\n    Liquid() {}\n    virtual ~Liquid() {}\n    /** creates the action with amplitude, a grid and duration */\n    static Liquid* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);\n\n    inline float getAmplitude() const { return _amplitude; }\n    inline void setAmplitude(float amplitude) { _amplitude = amplitude; }\n\n    inline float getAmplitudeRate() const { return _amplitudeRate; }\n    inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }\n\n    // Overrides\n\tvirtual Liquid* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    /** initializes the action with amplitude, a grid and duration */\n    bool initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude);\n\n    unsigned int _waves;\n    float _amplitude;\n    float _amplitudeRate;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Liquid);\n};\n\n/** @brief Waves action */\nclass CC_DLL Waves : public Grid3DAction\n{\npublic:\n    Waves() {}\n    virtual ~Waves() {}\n    /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */\n    static Waves* create(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical);\n\n    inline float getAmplitude() const { return _amplitude; }\n    inline void setAmplitude(float amplitude) { _amplitude = amplitude; }\n\n    inline float getAmplitudeRate() const { return _amplitudeRate; }\n    inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }\n\n    // Overrides\n\tvirtual Waves* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */\n    bool initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical);\n\n    unsigned int _waves;\n    float _amplitude;\n    float _amplitudeRate;\n    bool _vertical;\n    bool _horizontal;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Waves);\n};\n\n/** @brief Twirl action */\nclass CC_DLL Twirl : public Grid3DAction\n{\npublic:\n    Twirl() {}\n    virtual ~Twirl() {}\n    /** creates the action with center position, number of twirls, amplitude, a grid size and duration */\n    static Twirl* create(float duration, const Size& gridSize, Point position, unsigned int twirls, float amplitude);\n\n    /** get twirl center */\n    inline const Point& getPosition() const { return _position; }\n    /** set twirl center */\n    void setPosition(const Point& position);\n\n    inline float getAmplitude() const { return _amplitude; }\n    inline void setAmplitude(float amplitude) { _amplitude = amplitude; }\n\n    inline float getAmplitudeRate() const { return _amplitudeRate; }\n    inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }\n\n\n    // Overrides\n\tvirtual Twirl* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    /** initializes the action with center position, number of twirls, amplitude, a grid size and duration */\n    bool initWithDuration(float duration, const Size& gridSize, Point position, unsigned int twirls, float amplitude);\n\n    /* twirl center */\n    Point _position;\n    unsigned int _twirls;\n    float _amplitude;\n    float _amplitudeRate;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Twirl);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTION_CCGRID3D_ACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionInstant.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCActionInstant.h\"\n#include \"CCNode.h\"\n#include \"CCSprite.h\"\n#include \"CCScriptSupport.h\"\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (push)\n#pragma warning (disable: 4996)\n#endif\n\nNS_CC_BEGIN\n//\n// InstantAction\n//\nbool ActionInstant::isDone() const\n{\n    return true;\n}\n\nvoid ActionInstant::step(float dt) {\n    CC_UNUSED_PARAM(dt);\n    update(1);\n}\n\nvoid ActionInstant::update(float time) {\n    CC_UNUSED_PARAM(time);\n    // nothing\n}\n\n//\n// Show\n//\n\nShow* Show::create() \n{\n    Show* ret = new Show();\n\n    if (ret) {\n        ret->autorelease();\n    }\n\n    return ret;\n}\n\nvoid Show::update(float time) {\n    CC_UNUSED_PARAM(time);\n    _target->setVisible(true);\n}\n\nActionInstant* Show::reverse() const\n{\n    return Hide::create();\n}\n\nShow * Show::clone() const\n{\n\t// no copy constructor\n\tauto a = new Show();\n\ta->autorelease();\n\treturn a;\n}\n\n//\n// Hide\n//\nHide * Hide::create() \n{\n    Hide *ret = new Hide();\n\n    if (ret) {\n        ret->autorelease();\n    }\n\n    return ret;\n}\n\nvoid Hide::update(float time) {\n    CC_UNUSED_PARAM(time);\n    _target->setVisible(false);\n}\n\nActionInstant *Hide::reverse() const\n{\n    return Show::create();\n}\n\nHide * Hide::clone() const\n{\n\t// no copy constructor\n\tauto a = new Hide();\n\ta->autorelease();\n\treturn a;\n}\n\n//\n// ToggleVisibility\n//\nToggleVisibility * ToggleVisibility::create()\n{\n    ToggleVisibility *ret = new ToggleVisibility();\n\n    if (ret)\n    {\n        ret->autorelease();\n    }\n\n    return ret;\n}\n\nvoid ToggleVisibility::update(float time) \n{\n    CC_UNUSED_PARAM(time);\n    _target->setVisible(!_target->isVisible());\n}\n\nToggleVisibility * ToggleVisibility::reverse() const\n{\n\treturn ToggleVisibility::create();\n}\n\nToggleVisibility * ToggleVisibility::clone() const\n{\n\t// no copy constructor\n\tauto a = new ToggleVisibility();\n\ta->autorelease();\n\treturn a;\n}\n\n//\n// Remove Self\n//\nRemoveSelf * RemoveSelf::create(bool isNeedCleanUp /*= true*/) \n{\n\tRemoveSelf *ret = new RemoveSelf();\n\n\tif (ret && ret->init(isNeedCleanUp)) {\n\t\tret->autorelease();\n\t}\n\n\treturn ret;\n}\n\nbool RemoveSelf::init(bool isNeedCleanUp) {\n\t_isNeedCleanUp = isNeedCleanUp;\n\treturn true;\n}\n\nvoid RemoveSelf::update(float time) {\n\tCC_UNUSED_PARAM(time);\n\t_target->removeFromParentAndCleanup(_isNeedCleanUp);\n}\n\nRemoveSelf *RemoveSelf::reverse() const\n{\n\treturn RemoveSelf::create(_isNeedCleanUp);\n}\n\nRemoveSelf * RemoveSelf::clone() const\n{\n\t// no copy constructor\n\tauto a = new RemoveSelf();\n\ta->init(_isNeedCleanUp);\n\ta->autorelease();\n\treturn a;\n}\n\n//\n// FlipX\n//\n\nFlipX *FlipX::create(bool x)\n{\n    FlipX *ret = new FlipX();\n\n    if (ret && ret->initWithFlipX(x)) {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool FlipX::initWithFlipX(bool x) {\n    _flipX = x;\n    return true;\n}\n\nvoid FlipX::update(float time) {\n    CC_UNUSED_PARAM(time);\n    static_cast<Sprite*>(_target)->setFlippedX(_flipX);\n}\n\nFlipX* FlipX::reverse() const\n{\n    return FlipX::create(!_flipX);\n}\n\nFlipX * FlipX::clone() const\n{\n\t// no copy constructor\n\tauto a = new FlipX();\n\ta->initWithFlipX(_flipX);\n\ta->autorelease();\n\treturn a;\n}\n//\n// FlipY\n//\n\nFlipY * FlipY::create(bool y)\n{\n    FlipY *ret = new FlipY();\n\n    if (ret && ret->initWithFlipY(y)) {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool FlipY::initWithFlipY(bool y) {\n    _flipY = y;\n    return true;\n}\n\nvoid FlipY::update(float time) {\n    CC_UNUSED_PARAM(time);\n    static_cast<Sprite*>(_target)->setFlippedY(_flipY);\n}\n\nFlipY* FlipY::reverse() const\n{\n    return FlipY::create(!_flipY);\n}\n\nFlipY * FlipY::clone() const\n{\n\t// no copy constructor\n\tauto a = new FlipY();\n\ta->initWithFlipY(_flipY);\n\ta->autorelease();\n\treturn a;\n}\n\n//\n// Place\n//\n\nPlace* Place::create(const Point& pos)\n{\n    Place *ret = new Place();\n\n    if (ret && ret->initWithPosition(pos)) {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool Place::initWithPosition(const Point& pos) {\n    _position = pos;\n    return true;\n}\n\nPlace * Place::clone() const\n{\n\t// no copy constructor\n\tauto a = new Place();\n\ta->initWithPosition(_position);\n\ta->autorelease();\n\treturn a;\n}\n\nPlace * Place::reverse() const\n{\n\t// no reverse, just clone\n\treturn this->clone();\n}\n\nvoid Place::update(float time) {\n    CC_UNUSED_PARAM(time);\n    _target->setPosition(_position);\n}\n\n//\n// CallFunc\n//\n\nCallFunc * CallFunc::create(const std::function<void()> &func)\n{\n    CallFunc *ret = new CallFunc();\n\n    if (ret && ret->initWithFunction(func) ) {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nCallFunc * CallFunc::create(Object* selectorTarget, SEL_CallFunc selector) \n{\n    CallFunc *ret = new CallFunc();\n\n    if (ret && ret->initWithTarget(selectorTarget)) {\n        ret->_callFunc = selector;\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool CallFunc::initWithFunction(const std::function<void()> &func)\n{\n\t_function = func;\n    return true;\n}\n\nbool CallFunc::initWithTarget(Object* target) {\n    if (target)\n    {\n        target->retain();\n    }\n\n    if (_selectorTarget)\n    {\n        _selectorTarget->release();\n    }\n\n    _selectorTarget = target;\n    return true;\n}\n\nCallFunc::~CallFunc()\n{\n    CC_SAFE_RELEASE(_selectorTarget);\n}\n\nCallFunc * CallFunc::clone() const\n    {\n    // no copy constructor\n    auto a = new CallFunc();\n    if( _selectorTarget) {\n        a->initWithTarget(_selectorTarget);\n        a->_callFunc = _callFunc;\n    }\n    else if( _function ){\n        a->initWithFunction(_function);\n    }\n\n    a->autorelease();\n    return a;\n}\n\nCallFunc * CallFunc::reverse() const\n{\n\t// no reverse here, just return a clone\n\treturn this->clone();\n}\n\nvoid CallFunc::update(float time) {\n    CC_UNUSED_PARAM(time);\n    this->execute();\n}\n\nvoid CallFunc::execute() {\n    if (_callFunc) {\n        (_selectorTarget->*_callFunc)();\n    } else if( _function ){\n        _function();\n    }\n}\n\n//\n// CallFuncN\n//\n\nCallFuncN * CallFuncN::create(const std::function<void(Node*)> &func)\n{\n    auto ret = new CallFuncN();\n\n    if (ret && ret->initWithFunction(func) ) {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\n// XXX deprecated\nCallFuncN * CallFuncN::create(Object* selectorTarget, SEL_CallFuncN selector)\n{\n    CallFuncN *ret = new CallFuncN();\n\n    if (ret && ret->initWithTarget(selectorTarget, selector))\n    {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nvoid CallFuncN::execute() {\n    if (_callFuncN) {\n        (_selectorTarget->*_callFuncN)(_target);\n    }\n    else if (_functionN) {\n        _functionN(_target);\n    }\n}\n\nbool CallFuncN::initWithFunction(const std::function<void (Node *)> &func)\n{\n    _functionN = func;\n    return true;\n}\n\nbool CallFuncN::initWithTarget(Object* selectorTarget, SEL_CallFuncN selector)\n{\n    if (CallFunc::initWithTarget(selectorTarget)) {\n        _callFuncN = selector;\n        return true;\n    }\n\n    return false;\n}\n\nCallFuncN * CallFuncN::clone() const\n{\n\t// no copy constructor\n\tauto a = new CallFuncN();\n\n    if( _selectorTarget) {\n        a->initWithTarget(_selectorTarget, _callFuncN);\n    }\n    else if( _functionN ){\n        a->initWithFunction(_functionN);\n    }\n\n\ta->autorelease();\n\treturn a;\n}\n\n//\n// CallFuncND\n//\n\n__CCCallFuncND * __CCCallFuncND::create(Object* selectorTarget, SEL_CallFuncND selector, void* d)\n{\n    __CCCallFuncND* ret = new __CCCallFuncND();\n    \n    if (ret && ret->initWithTarget(selectorTarget, selector, d)) {\n        ret->autorelease();\n        return ret;\n    }\n    \n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool __CCCallFuncND::initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d)\n{\n    if (CallFunc::initWithTarget(selectorTarget))\n    {\n        _data = d;\n        _callFuncND = selector;\n        return true;\n    }\n    \n    return false;\n}\n\nvoid __CCCallFuncND::execute()\n{\n    if (_callFuncND)\n    {\n        (_selectorTarget->*_callFuncND)(_target, _data);\n    }\n}\n\n__CCCallFuncND * __CCCallFuncND::clone() const\n{\n\t// no copy constructor\n\tauto a = new __CCCallFuncND();\n    \n    if( _selectorTarget)\n    {\n        a->initWithTarget(_selectorTarget, _callFuncND, _data);\n    }\n    \n\ta->autorelease();\n\treturn a;\n}\n\n//\n// CallFuncO\n//\n__CCCallFuncO::__CCCallFuncO() :\n_object(nullptr)\n{\n}\n\n__CCCallFuncO::~__CCCallFuncO()\n{\n    CC_SAFE_RELEASE(_object);\n}\n\nvoid __CCCallFuncO::execute()\n{\n    if (_callFuncO) {\n        (_selectorTarget->*_callFuncO)(_object);\n    }\n}\n\n__CCCallFuncO * __CCCallFuncO::create(Object* selectorTarget, SEL_CallFuncO selector, Object* object)\n{\n    __CCCallFuncO *ret = new __CCCallFuncO();\n    \n    if (ret && ret->initWithTarget(selectorTarget, selector, object)) {\n        ret->autorelease();\n        return ret;\n    }\n    \n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool __CCCallFuncO::initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object)\n{\n    if (CallFunc::initWithTarget(selectorTarget))\n    {\n        _object = object;\n        CC_SAFE_RETAIN(_object);\n        \n        _callFuncO = selector;\n        return true;\n    }\n    \n    return false;\n}\n\n__CCCallFuncO * __CCCallFuncO::clone() const\n{\n\t// no copy constructor\n\tauto a = new __CCCallFuncO();\n    \n    if( _selectorTarget)\n    {\n        a->initWithTarget(_selectorTarget, _callFuncO, _object);\n    }\n    \n\ta->autorelease();\n\treturn a;\n}\n\nObject* __CCCallFuncO::getObject() const\n{\n    return _object;\n}\n    \nvoid __CCCallFuncO::setObject(Object* obj)\n{\n    if (obj != _object)\n    {\n        CC_SAFE_RELEASE(_object);\n        _object = obj;\n        CC_SAFE_RETAIN(_object);\n    }\n}\n\nNS_CC_END\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic warning \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (pop)\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionInstant.h",
    "content": "/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCINSTANT_ACTION_H__\n#define __CCINSTANT_ACTION_H__\n\n#include <string>\n#include <functional>\n\n#include \"CCStdC.h\"\n#include \"CCAction.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** \n@brief Instant actions are immediate actions. They don't have a duration like\nthe IntervalAction actions.\n*/ \nclass CC_DLL ActionInstant : public FiniteTimeAction //<NSCopying>\n{\npublic:\n    //\n    // Overrides\n    //\n\tvirtual ActionInstant* clone() const override = 0;\n    virtual ActionInstant * reverse() const override = 0;\n    virtual bool isDone() const override;\n    virtual void step(float dt) override;\n    virtual void update(float time) override;\n};\n\n/** @brief Show the node\n*/\nclass CC_DLL Show : public ActionInstant\n{\npublic:\n    /** Allocates and initializes the action */\n    static Show * create();\n\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n    virtual ActionInstant* reverse() const override;\n\tvirtual Show* clone() const override;\n\nprotected:\n    Show(){}\n    virtual ~Show(){}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Show);\n};\n\n/** \n@brief Hide the node\n*/\nclass CC_DLL Hide : public ActionInstant\n{\npublic:\n    /** Allocates and initializes the action */\n    static Hide * create();\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n\tvirtual ActionInstant* reverse() const override;\n\tvirtual Hide* clone() const override;\n\nprotected:\n    Hide(){}\n    virtual ~Hide(){}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Hide);\n};\n\n/** @brief Toggles the visibility of a node\n*/\nclass CC_DLL ToggleVisibility : public ActionInstant\n{\npublic:\n    /** Allocates and initializes the action */\n    static ToggleVisibility * create();\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n\tvirtual ToggleVisibility* reverse() const override;\n\tvirtual ToggleVisibility* clone() const override;\n\nprotected:\n    ToggleVisibility(){}\n    virtual ~ToggleVisibility(){}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ToggleVisibility);\n};\n\n/** \n@brief Remove the node\n*/\nclass CC_DLL RemoveSelf : public ActionInstant\n{\npublic:\n\t/** create the action */\n\tstatic RemoveSelf * create(bool isNeedCleanUp = true);\n\n\t//\n    // Override\n    //\n\tvirtual void update(float time) override;\n\tvirtual RemoveSelf* clone() const override;\n\tvirtual RemoveSelf* reverse() const override;\n\nprotected:\n    RemoveSelf() : _isNeedCleanUp(true){}\n    virtual ~RemoveSelf(){}\n\t/** init the action */\n\tbool init(bool isNeedCleanUp);\n\n\tbool _isNeedCleanUp;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(RemoveSelf);\n};\n\n/** \n@brief Flips the sprite horizontally\n@since v0.99.0\n*/\nclass CC_DLL FlipX : public ActionInstant\n{\npublic:\n    /** create the action */\n    static FlipX * create(bool x);\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n\tvirtual FlipX* reverse() const override;\n\tvirtual FlipX* clone() const override;\n\nprotected:\n    FlipX() :_flipX(false) {}\n    virtual ~FlipX() {}\n    /** init the action */\n    bool initWithFlipX(bool x);\n\n    bool    _flipX;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FlipX);\n};\n\n/** \n@brief Flips the sprite vertically\n@since v0.99.0\n*/\nclass CC_DLL FlipY : public ActionInstant\n{\npublic:\n    /** create the action */\n    static FlipY * create(bool y);\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n\tvirtual FlipY* reverse() const override;\n\tvirtual FlipY* clone() const override;\n\nprotected:\n    FlipY() :_flipY(false) {}\n    virtual ~FlipY() {}\n    /** init the action */\n    bool initWithFlipY(bool y);\n\n    bool    _flipY;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FlipY);\n};\n\n/** @brief Places the node in a certain position\n*/\nclass CC_DLL Place : public ActionInstant //<NSCopying>\n{\npublic:\n\n    /** creates a Place action with a position */\n    static Place * create(const Point& pos);\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n\tvirtual Place* reverse() const override;\n\tvirtual Place* clone() const override;\n\nprotected:\n    Place(){}\n    virtual ~Place(){}\n    /** Initializes a Place action with a position */\n    bool initWithPosition(const Point& pos);\n\n    Point _position;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Place);\n};\n\n\n/** @brief Calls a 'callback'\n*/\nclass CC_DLL CallFunc : public ActionInstant //<NSCopying>\n{\npublic:\n\t/** creates the action with the callback of type std::function<void()>.\n\t This is the preferred way to create the callback.\n     * When this funtion bound in js or lua ,the input param will be changed\n     * In js: var create(var func, var this, var [data]) or var create(var func)\n     * In lua:local create(local funcID)\n\t */\n    static CallFunc * create(const std::function<void()>& func);\n\n    /** creates the action with the callback\n\n     typedef void (Object::*SEL_CallFunc)();\n\t @deprecated Use the std::function API instead.\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static CallFunc * create(Object* target, SEL_CallFunc selector);\n\npublic:\n    /** executes the callback */\n    virtual void execute();\n\n    inline Object* getTargetCallback()\n    {\n        return _selectorTarget;\n    }\n\n    inline void setTargetCallback(Object* sel)\n    {\n        if (sel != _selectorTarget)\n        {\n            CC_SAFE_RETAIN(sel);\n            CC_SAFE_RELEASE(_selectorTarget);\n            _selectorTarget = sel;\n        }\n    }\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n\tvirtual CallFunc* reverse() const override;\n\tvirtual CallFunc* clone() const override;\n\nprotected:\n    CallFunc()\n    : _selectorTarget(nullptr)\n    , _callFunc(nullptr)\n    , _function(nullptr)\n    {\n    }\n    virtual ~CallFunc();\n\n\t/** initializes the action with the callback\n     typedef void (Object::*SEL_CallFunc)();\n     @deprecated Use the std::function API instead.\n     */\n    CC_DEPRECATED_ATTRIBUTE bool initWithTarget(Object* target);\n\n\t/** initializes the action with the std::function<void()>\n     * @js NA\n     * @lua NA\n\t */\n    bool initWithFunction(const std::function<void()>& func);\n\n    /** Target that will be called */\n    Object*   _selectorTarget;\n\n    union\n    {\n        SEL_CallFunc    _callFunc;\n        SEL_CallFuncN    _callFuncN;\n    };\n    \n    /** function that will be called */\n\tstd::function<void()> _function;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(CallFunc);\n};\n\n/** \n@brief Calls a 'callback' with the node as the first argument\nN means Node\n*/\nclass CC_DLL CallFuncN : public CallFunc\n{\npublic:\n    /** creates the action with the callback of type std::function<void()>.\n\t This is the preferred way to create the callback.\n\t */\n    static CallFuncN * create(const std::function<void(Node*)>& func);\n\n    /** creates the action with the callback \n\n    typedef void (Object::*SEL_CallFuncN)(Node*);\n     @deprecated Use the std::function API instead.\n    */\n    CC_DEPRECATED_ATTRIBUTE static CallFuncN * create(Object* target, SEL_CallFuncN selector);\n\n    //\n    // Overrides\n    //\n\tvirtual CallFuncN* clone() const override;\n    virtual void execute() override;\n\nprotected:\n    CallFuncN():_functionN(nullptr){}\n    virtual ~CallFuncN(){}\n    /** initializes the action with the std::function<void(Node*)> */\n    bool initWithFunction(const std::function<void(Node*)>& func);\n\n    /** initializes the action with the callback\n\n     typedef void (Object::*SEL_CallFuncN)(Node*);\n     @deprecated Use the std::function API instead.\n     */\n    CC_DEPRECATED_ATTRIBUTE bool initWithTarget(Object* target, SEL_CallFuncN selector);\n\n\n    /** function that will be called with the \"sender\" as the 1st argument */\n    std::function<void(Node*)> _functionN;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(CallFuncN);\n};\n\n/**\n @deprecated Please use CallFuncN instead.\n @brief Calls a 'callback' with the node as the first argument and the 2nd argument is data\n * ND means: Node and Data. Data is void *, so it could be anything.\n */\n\nclass CC_DLL  __CCCallFuncND : public CallFunc\n{\npublic:\n    /** creates the action with the callback and the data to pass as an argument */\n    CC_DEPRECATED_ATTRIBUTE static __CCCallFuncND * create(Object* target, SEL_CallFuncND selector, void* d);\n    \n    //\n    // Overrides\n    //\n\tvirtual __CCCallFuncND* clone() const override;\n    virtual void execute() override;\n    \nprotected:\n    __CCCallFuncND() {}\n    virtual ~__CCCallFuncND() {}\n    \n    /** initializes the action with the callback and the data to pass as an argument */\n    bool initWithTarget(Object* target, SEL_CallFuncND selector, void* d);\n\n    SEL_CallFuncND _callFuncND;\n    void* _data;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(__CCCallFuncND);\n};\n\n\n/**\n @deprecated Please use CallFuncN instead.\n @brief Calls a 'callback' with an object as the first argument.\n O means Object.\n @since v0.99.5\n */\n\nclass CC_DLL __CCCallFuncO : public CallFunc\n{\npublic:\n    /** creates the action with the callback\n     \n     typedef void (Object::*SEL_CallFuncO)(Object*);\n     */\n    CC_DEPRECATED_ATTRIBUTE static __CCCallFuncO * create(Object* target, SEL_CallFuncO selector, Object* object);\n    //\n    // Overrides\n    //\n\tvirtual __CCCallFuncO* clone() const override;\n    virtual void execute() override;\n    \n    Object* getObject() const;\n    void setObject(Object* obj);\n    \nprotected:\n    __CCCallFuncO();\n    virtual ~__CCCallFuncO();\n    /** initializes the action with the callback\n\n     typedef void (Object::*SEL_CallFuncO)(Object*);\n     */\n    bool initWithTarget(Object* target, SEL_CallFuncO selector, Object* object);\n    \n\n    /** object to be passed as argument */\n    Object* _object;\n    SEL_CallFuncO _callFuncO;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(__CCCallFuncO);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif //__CCINSTANT_ACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionInterval.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCActionInterval.h\"\n#include \"CCSprite.h\"\n#include \"CCNode.h\"\n#include \"CCStdC.h\"\n#include \"CCActionInstant.h\"\n#include <stdarg.h>\n\nNS_CC_BEGIN\n\n// Extra action for making a Sequence or Spawn when only adding one action to it.\nclass ExtraAction : public FiniteTimeAction\n{\npublic:\n    static ExtraAction* create();\n    virtual ExtraAction* clone() const;\n    virtual ExtraAction* reverse(void) const;\n    virtual void update(float time);\n    virtual void step(float dt);\n};\n\nExtraAction* ExtraAction::create()\n{\n    ExtraAction* ret = new ExtraAction();\n    if (ret)\n    {\n        ret->autorelease();\n    }\n    return ret;\n}\nExtraAction* ExtraAction::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new ExtraAction();\n\ta->autorelease();\n\treturn a;\n}\n\nExtraAction* ExtraAction::reverse(void) const\n{\n    return ExtraAction::create();\n}\n\nvoid ExtraAction::update(float time)\n{\n    CC_UNUSED_PARAM(time);\n}\n\nvoid ExtraAction::step(float dt)\n{\n    CC_UNUSED_PARAM(dt);\n}\n\n//\n// IntervalAction\n//\n\nbool ActionInterval::initWithDuration(float d)\n{\n    _duration = d;\n\n    // prevent division by 0\n    // This comparison could be in step:, but it might decrease the performance\n    // by 3% in heavy based action games.\n    if (_duration == 0)\n    {\n        _duration = FLT_EPSILON;\n    }\n\n    _elapsed = 0;\n    _firstTick = true;\n\n    return true;\n}\n\nbool ActionInterval::isDone(void) const\n{\n    return _elapsed >= _duration;\n}\n\nvoid ActionInterval::step(float dt)\n{\n    if (_firstTick)\n    {\n        _firstTick = false;\n        _elapsed = 0;\n    }\n    else\n    {\n        _elapsed += dt;\n    }\n    \n    this->update(MAX (0,                                  // needed for rewind. elapsed could be negative\n                      MIN(1, _elapsed /\n                          MAX(_duration, FLT_EPSILON)   // division by 0\n                          )\n                      )\n                 );\n}\n\nvoid ActionInterval::setAmplitudeRate(float amp)\n{\n    CC_UNUSED_PARAM(amp);\n    // Abstract class needs implementation\n    CCASSERT(0, \"\");\n}\n\nfloat ActionInterval::getAmplitudeRate(void)\n{\n    // Abstract class needs implementation\n    CCASSERT(0, \"\");\n\n    return 0;\n}\n\nvoid ActionInterval::startWithTarget(Node *target)\n{\n    FiniteTimeAction::startWithTarget(target);\n    _elapsed = 0.0f;\n    _firstTick = true;\n}\n\n//\n// Sequence\n//\n\nSequence* Sequence::createWithTwoActions(FiniteTimeAction *actionOne, FiniteTimeAction *actionTwo)\n{\n    Sequence *sequence = new Sequence();\n    sequence->initWithTwoActions(actionOne, actionTwo);\n    sequence->autorelease();\n\n    return sequence;\n}\n\nSequence* Sequence::create(FiniteTimeAction *action1, ...)\n{\n    va_list params;\n    va_start(params, action1);\n\n    Sequence *ret = Sequence::createWithVariableList(action1, params);\n\n    va_end(params);\n    \n    return ret;\n}\n\nSequence* Sequence::createWithVariableList(FiniteTimeAction *action1, va_list args)\n{\n    FiniteTimeAction *now;\n    FiniteTimeAction *prev = action1;\n    bool bOneAction = true;\n\n    while (action1)\n    {\n        now = va_arg(args, FiniteTimeAction*);\n        if (now)\n        {\n            prev = createWithTwoActions(prev, now);\n            bOneAction = false;\n        }\n        else\n        {\n            // If only one action is added to Sequence, make up a Sequence by adding a simplest finite time action.\n            if (bOneAction)\n            {\n                prev = createWithTwoActions(prev, ExtraAction::create());\n            }\n            break;\n        }\n    }\n    \n    return ((Sequence*)prev);\n}\n\nSequence* Sequence::create(const Vector<FiniteTimeAction*>& arrayOfActions)\n{\n    Sequence* ret = nullptr;\n    do \n    {\n        auto count = arrayOfActions.size();\n        CC_BREAK_IF(count == 0);\n\n        auto prev = arrayOfActions.at(0);\n\n        if (count > 1)\n        {\n            for (int i = 1; i < count; ++i)\n            {\n                prev = createWithTwoActions(prev, arrayOfActions.at(i));\n            }\n        }\n        else\n        {\n            // If only one action is added to Sequence, make up a Sequence by adding a simplest finite time action.\n            prev = createWithTwoActions(prev, ExtraAction::create());\n        }\n        ret = static_cast<Sequence*>(prev);\n    }while (0);\n    return ret;\n}\n\nbool Sequence::initWithTwoActions(FiniteTimeAction *actionOne, FiniteTimeAction *actionTwo)\n{\n    CCASSERT(actionOne != nullptr, \"\");\n    CCASSERT(actionTwo != nullptr, \"\");\n\n    float d = actionOne->getDuration() + actionTwo->getDuration();\n    ActionInterval::initWithDuration(d);\n\n    _actions[0] = actionOne;\n    actionOne->retain();\n\n    _actions[1] = actionTwo;\n    actionTwo->retain();\n\n    return true;\n}\n\nSequence* Sequence::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new Sequence();\n    a->initWithTwoActions(_actions[0]->clone(), _actions[1]->clone() );\n\ta->autorelease();\n\treturn a;\n}\n\nSequence::~Sequence(void)\n{\n    CC_SAFE_RELEASE(_actions[0]);\n    CC_SAFE_RELEASE(_actions[1]);\n}\n\nvoid Sequence::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _split = _actions[0]->getDuration() / _duration;\n    _last = -1;\n}\n\nvoid Sequence::stop(void)\n{\n    // Issue #1305\n    if( _last != - 1)\n    {\n        _actions[_last]->stop();\n    }\n\n    ActionInterval::stop();\n}\n\nvoid Sequence::update(float t)\n{\n    int found = 0;\n    float new_t = 0.0f;\n\n    if( t < _split ) {\n        // action[0]\n        found = 0;\n        if( _split != 0 )\n            new_t = t / _split;\n        else\n            new_t = 1;\n\n    } else {\n        // action[1]\n        found = 1;\n        if ( _split == 1 )\n            new_t = 1;\n        else\n            new_t = (t-_split) / (1 - _split );\n    }\n\n    if ( found==1 ) {\n\n        if( _last == -1 ) {\n            // action[0] was skipped, execute it.\n            _actions[0]->startWithTarget(_target);\n            _actions[0]->update(1.0f);\n            _actions[0]->stop();\n        }\n        else if( _last == 0 )\n        {\n            // switching to action 1. stop action 0.\n            _actions[0]->update(1.0f);\n            _actions[0]->stop();\n        }\n    }\n\telse if(found==0 && _last==1 )\n\t{\n\t\t// Reverse mode ?\n\t\t// XXX: Bug. this case doesn't contemplate when _last==-1, found=0 and in \"reverse mode\"\n\t\t// since it will require a hack to know if an action is on reverse mode or not.\n\t\t// \"step\" should be overriden, and the \"reverseMode\" value propagated to inner Sequences.\n\t\t_actions[1]->update(0);\n\t\t_actions[1]->stop();\n\t}\n    // Last action found and it is done.\n    if( found == _last && _actions[found]->isDone() )\n    {\n        return;\n    }\n\n    // Last action found and it is done\n    if( found != _last )\n    {\n        _actions[found]->startWithTarget(_target);\n    }\n\n    _actions[found]->update(new_t);\n    _last = found;\n}\n\nSequence* Sequence::reverse() const\n{\n    return Sequence::createWithTwoActions(_actions[1]->reverse(), _actions[0]->reverse());\n}\n\n//\n// Repeat\n//\n\nRepeat* Repeat::create(FiniteTimeAction *action, unsigned int times)\n{\n    Repeat* repeat = new Repeat();\n    repeat->initWithAction(action, times);\n    repeat->autorelease();\n\n    return repeat;\n}\n\nbool Repeat::initWithAction(FiniteTimeAction *action, unsigned int times)\n{\n    float d = action->getDuration() * times;\n\n    if (ActionInterval::initWithDuration(d))\n    {\n        _times = times;\n        _innerAction = action;\n        action->retain();\n\n        _actionInstant = dynamic_cast<ActionInstant*>(action) ? true : false;\n        //an instant action needs to be executed one time less in the update method since it uses startWithTarget to execute the action\n        if (_actionInstant) \n        {\n            _times -=1;\n        }\n        _total = 0;\n\n        return true;\n    }\n\n    return false;\n}\n\nRepeat* Repeat::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new Repeat();\n\ta->initWithAction( _innerAction->clone(), _times );\n\ta->autorelease();\n\treturn a;\n}\n\nRepeat::~Repeat(void)\n{\n    CC_SAFE_RELEASE(_innerAction);\n}\n\nvoid Repeat::startWithTarget(Node *target)\n{\n    _total = 0;\n    _nextDt = _innerAction->getDuration()/_duration;\n    ActionInterval::startWithTarget(target);\n    _innerAction->startWithTarget(target);\n}\n\nvoid Repeat::stop(void)\n{\n    _innerAction->stop();\n    ActionInterval::stop();\n}\n\n// issue #80. Instead of hooking step:, hook update: since it can be called by any \n// container action like Repeat, Sequence, Ease, etc..\nvoid Repeat::update(float dt)\n{\n    if (dt >= _nextDt)\n    {\n        while (dt > _nextDt && _total < _times)\n        {\n\n            _innerAction->update(1.0f);\n            _total++;\n\n            _innerAction->stop();\n            _innerAction->startWithTarget(_target);\n            _nextDt += _innerAction->getDuration()/_duration;\n        }\n\n        // fix for issue #1288, incorrect end value of repeat\n        if(dt >= 1.0f && _total < _times) \n        {\n            _total++;\n        }\n\n        // don't set an instant action back or update it, it has no use because it has no duration\n        if (!_actionInstant)\n        {\n            if (_total == _times)\n            {\n                _innerAction->update(1);\n                _innerAction->stop();\n            }\n            else\n            {\n                // issue #390 prevent jerk, use right update\n                _innerAction->update(dt - (_nextDt - _innerAction->getDuration()/_duration));\n            }\n        }\n    }\n    else\n    {\n        _innerAction->update(fmodf(dt * _times,1.0f));\n    }\n}\n\nbool Repeat::isDone(void) const\n{\n    return _total == _times;\n}\n\nRepeat* Repeat::reverse() const\n{\n    return Repeat::create(_innerAction->reverse(), _times);\n}\n\n//\n// RepeatForever\n//\nRepeatForever::~RepeatForever()\n{\n    CC_SAFE_RELEASE(_innerAction);\n}\n\nRepeatForever *RepeatForever::create(ActionInterval *action)\n{\n    RepeatForever *ret = new RepeatForever();\n    if (ret && ret->initWithAction(action))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool RepeatForever::initWithAction(ActionInterval *action)\n{\n    CCASSERT(action != nullptr, \"\");\n    action->retain();\n    _innerAction = action;\n    return true;\n}\n\nRepeatForever *RepeatForever::clone(void) const\n{\n\t// no copy constructor\t\n\tauto a = new RepeatForever();\n\ta->initWithAction(_innerAction->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid RepeatForever::startWithTarget(Node* target)\n{\n    ActionInterval::startWithTarget(target);\n    _innerAction->startWithTarget(target);\n}\n\nvoid RepeatForever::step(float dt)\n{\n    _innerAction->step(dt);\n    if (_innerAction->isDone())\n    {\n        float diff = _innerAction->getElapsed() - _innerAction->getDuration();\n        _innerAction->startWithTarget(_target);\n        // to prevent jerk. issue #390, 1247\n        _innerAction->step(0.0f);\n        _innerAction->step(diff);\n    }\n}\n\nbool RepeatForever::isDone() const\n{\n    return false;\n}\n\nRepeatForever *RepeatForever::reverse() const\n{\n    return RepeatForever::create(_innerAction->reverse());\n}\n\n//\n// Spawn\n//\n\nSpawn* Spawn::create(FiniteTimeAction *action1, ...)\n{\n    va_list params;\n    va_start(params, action1);\n\n    Spawn *ret = Spawn::createWithVariableList(action1, params);\n\n    va_end(params);\n    \n    return ret;\n}\n\nSpawn* Spawn::createWithVariableList(FiniteTimeAction *action1, va_list args)\n{\n    FiniteTimeAction *now;\n    FiniteTimeAction *prev = action1;\n    bool oneAction = true;\n\n    while (action1)\n    {\n        now = va_arg(args, FiniteTimeAction*);\n        if (now)\n        {\n            prev = createWithTwoActions(prev, now);\n            oneAction = false;\n        }\n        else\n        {\n            // If only one action is added to Spawn, make up a Spawn by adding a simplest finite time action.\n            if (oneAction)\n            {\n                prev = createWithTwoActions(prev, ExtraAction::create());\n            }\n            break;\n        }\n    }\n\n    return ((Spawn*)prev);\n}\n\nSpawn* Spawn::create(const Vector<FiniteTimeAction*>& arrayOfActions)\n{\n    Spawn* ret = nullptr;\n    do \n    {\n        auto count = arrayOfActions.size();\n        CC_BREAK_IF(count == 0);\n        auto prev = arrayOfActions.at(0);\n        if (count > 1)\n        {\n            for (int i = 1; i < arrayOfActions.size(); ++i)\n            {\n                prev = createWithTwoActions(prev, arrayOfActions.at(i));\n            }\n        }\n        else\n        {\n            // If only one action is added to Spawn, make up a Spawn by adding a simplest finite time action.\n            prev = createWithTwoActions(prev, ExtraAction::create());\n        }\n        ret = static_cast<Spawn*>(prev);\n    }while (0);\n\n    return ret;\n}\n\nSpawn* Spawn::createWithTwoActions(FiniteTimeAction *action1, FiniteTimeAction *action2)\n{\n    Spawn *spawn = new Spawn();\n    spawn->initWithTwoActions(action1, action2);\n    spawn->autorelease();\n\n    return spawn;\n}\n\nbool Spawn::initWithTwoActions(FiniteTimeAction *action1, FiniteTimeAction *action2)\n{\n    CCASSERT(action1 != nullptr, \"\");\n    CCASSERT(action2 != nullptr, \"\");\n\n    bool ret = false;\n\n    float d1 = action1->getDuration();\n    float d2 = action2->getDuration();\n\n    if (ActionInterval::initWithDuration(MAX(d1, d2)))\n    {\n        _one = action1;\n        _two = action2;\n\n        if (d1 > d2)\n        {\n            _two = Sequence::createWithTwoActions(action2, DelayTime::create(d1 - d2));\n        } \n        else if (d1 < d2)\n        {\n            _one = Sequence::createWithTwoActions(action1, DelayTime::create(d2 - d1));\n        }\n\n        _one->retain();\n        _two->retain();\n\n        ret = true;\n    }\n\n    return ret;\n}\n\nSpawn* Spawn::clone(void) const\n{\n\t// no copy constructor\t\n\tauto a = new Spawn();\n    a->initWithTwoActions(_one->clone(), _two->clone());\n\n\ta->autorelease();\n\treturn a;\n}\n\nSpawn::~Spawn(void)\n{\n    CC_SAFE_RELEASE(_one);\n    CC_SAFE_RELEASE(_two);\n}\n\nvoid Spawn::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _one->startWithTarget(target);\n    _two->startWithTarget(target);\n}\n\nvoid Spawn::stop(void)\n{\n    _one->stop();\n    _two->stop();\n    ActionInterval::stop();\n}\n\nvoid Spawn::update(float time)\n{\n    if (_one)\n    {\n        _one->update(time);\n    }\n    if (_two)\n    {\n        _two->update(time);\n    }\n}\n\nSpawn* Spawn::reverse() const\n{\n    return Spawn::createWithTwoActions(_one->reverse(), _two->reverse());\n}\n\n//\n// RotateTo\n//\n\nRotateTo* RotateTo::create(float duration, float deltaAngle)\n{\n    RotateTo* rotateTo = new RotateTo();\n    rotateTo->initWithDuration(duration, deltaAngle);\n    rotateTo->autorelease();\n\n    return rotateTo;\n}\n\nbool RotateTo::initWithDuration(float duration, float deltaAngle)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _dstAngleX = _dstAngleY = deltaAngle;\n        return true;\n    }\n\n    return false;\n}\n\nRotateTo* RotateTo::create(float duration, float deltaAngleX, float deltaAngleY)\n{\n    RotateTo* rotateTo = new RotateTo();\n    rotateTo->initWithDuration(duration, deltaAngleX, deltaAngleY);\n    rotateTo->autorelease();\n    \n    return rotateTo;\n}\n\nbool RotateTo::initWithDuration(float duration, float deltaAngleX, float deltaAngleY)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _dstAngleX = deltaAngleX;\n        _dstAngleY = deltaAngleY;\n        \n        return true;\n    }\n    \n    return false;\n}\n\nRotateTo* RotateTo::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new RotateTo();\n\ta->initWithDuration(_duration, _dstAngleX, _dstAngleY);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid RotateTo::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    \n    // Calculate X\n    _startAngleX = target->getRotationX();\n    if (_startAngleX > 0)\n    {\n        _startAngleX = fmodf(_startAngleX, 360.0f);\n    }\n    else\n    {\n        _startAngleX = fmodf(_startAngleX, -360.0f);\n    }\n\n    _diffAngleX = _dstAngleX - _startAngleX;\n    if (_diffAngleX > 180)\n    {\n        _diffAngleX -= 360;\n    }\n    if (_diffAngleX < -180)\n    {\n        _diffAngleX += 360;\n    }\n    \n    //Calculate Y: It's duplicated from calculating X since the rotation wrap should be the same\n    _startAngleY = _target->getRotationY();\n\n    if (_startAngleY > 0)\n    {\n        _startAngleY = fmodf(_startAngleY, 360.0f);\n    }\n    else\n    {\n        _startAngleY = fmodf(_startAngleY, -360.0f);\n    }\n\n    _diffAngleY = _dstAngleY - _startAngleY;\n    if (_diffAngleY > 180)\n    {\n        _diffAngleY -= 360;\n    }\n\n    if (_diffAngleY < -180)\n    {\n        _diffAngleY += 360;\n    }\n}\n\nvoid RotateTo::update(float time)\n{\n    if (_target)\n    {\n        _target->setRotationX(_startAngleX + _diffAngleX * time);\n        _target->setRotationY(_startAngleY + _diffAngleY * time);\n    }\n}\n\nRotateTo *RotateTo::reverse() const\n{\n\tCCASSERT(false, \"RotateTo doesn't support the 'reverse' method\");\n\treturn nullptr;\n}\n\n//\n// RotateBy\n//\n\nRotateBy* RotateBy::create(float duration, float deltaAngle)\n{\n    RotateBy *rotateBy = new RotateBy();\n    rotateBy->initWithDuration(duration, deltaAngle);\n    rotateBy->autorelease();\n\n    return rotateBy;\n}\n\nbool RotateBy::initWithDuration(float duration, float deltaAngle)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _angleX = _angleY = deltaAngle;\n        return true;\n    }\n\n    return false;\n}\n\nRotateBy* RotateBy::create(float duration, float deltaAngleX, float deltaAngleY)\n{\n    RotateBy *rotateBy = new RotateBy();\n    rotateBy->initWithDuration(duration, deltaAngleX, deltaAngleY);\n    rotateBy->autorelease();\n    \n    return rotateBy;\n}\n\nbool RotateBy::initWithDuration(float duration, float deltaAngleX, float deltaAngleY)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _angleX = deltaAngleX;\n        _angleY = deltaAngleY;\n        return true;\n    }\n    \n    return false;\n}\n\nRotateBy* RotateBy::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new RotateBy();\n    a->initWithDuration(_duration, _angleX, _angleY);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid RotateBy::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _startAngleX = target->getRotationX();\n    _startAngleY = target->getRotationY();\n}\n\nvoid RotateBy::update(float time)\n{\n    // XXX: shall I add % 360\n    if (_target)\n    {\n        _target->setRotationX(_startAngleX + _angleX * time);\n        _target->setRotationY(_startAngleY + _angleY * time);\n    }\n}\n\nRotateBy* RotateBy::reverse() const\n{\n    return RotateBy::create(_duration, -_angleX, -_angleY);\n}\n\n//\n// MoveBy\n//\n\nMoveBy* MoveBy::create(float duration, const Point& deltaPosition)\n{\n    MoveBy *ret = new MoveBy();\n    ret->initWithDuration(duration, deltaPosition);\n    ret->autorelease();\n\n    return ret;\n}\n\nbool MoveBy::initWithDuration(float duration, const Point& deltaPosition)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _positionDelta = deltaPosition;\n        return true;\n    }\n\n    return false;\n}\n\nMoveBy* MoveBy::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new MoveBy();\n    a->initWithDuration(_duration, _positionDelta);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid MoveBy::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _previousPosition = _startPosition = target->getPosition();\n}\n\nMoveBy* MoveBy::reverse() const\n{\n    return MoveBy::create(_duration, Point( -_positionDelta.x, -_positionDelta.y));\n}\n\n\nvoid MoveBy::update(float t)\n{\n    if (_target)\n    {\n#if CC_ENABLE_STACKABLE_ACTIONS\n        Point currentPos = _target->getPosition();\n        Point diff = currentPos - _previousPosition;\n        _startPosition = _startPosition + diff;\n        Point newPos =  _startPosition + (_positionDelta * t);\n        _target->setPosition(newPos);\n        _previousPosition = newPos;\n#else\n        _target->setPosition(ccpAdd( _startPosition, ccpMult(_positionDelta, t)));\n#endif // CC_ENABLE_STACKABLE_ACTIONS\n    }\n}\n\n//\n// MoveTo\n//\n\nMoveTo* MoveTo::create(float duration, const Point& position)\n{\n    MoveTo *ret = new MoveTo();\n    ret->initWithDuration(duration, position);\n    ret->autorelease();\n\n    return ret;\n}\n\nbool MoveTo::initWithDuration(float duration, const Point& position)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _endPosition = position;\n        return true;\n    }\n\n    return false;\n}\n\nMoveTo* MoveTo::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new MoveTo();\n    a->initWithDuration(_duration, _endPosition);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid MoveTo::startWithTarget(Node *target)\n{\n    MoveBy::startWithTarget(target);\n    _positionDelta = _endPosition - target->getPosition();\n}\n\n\n//\n// SkewTo\n//\nSkewTo* SkewTo::create(float t, float sx, float sy)\n{\n    SkewTo *skewTo = new SkewTo();\n    if (skewTo)\n    {\n        if (skewTo->initWithDuration(t, sx, sy))\n        {\n            skewTo->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(skewTo);\n        }\n    }\n\n    return skewTo;\n}\n\nbool SkewTo::initWithDuration(float t, float sx, float sy)\n{\n    bool bRet = false;\n\n    if (ActionInterval::initWithDuration(t))\n    {\n        _endSkewX = sx;\n        _endSkewY = sy;\n\n        bRet = true;\n    }\n\n    return bRet;\n}\n\nSkewTo* SkewTo::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new SkewTo();\n\ta->initWithDuration(_duration, _endSkewX, _endSkewY);\n\ta->autorelease();\n\treturn a;\n}\n\nSkewTo* SkewTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() not supported in SkewTo\");\n\treturn nullptr;\n}\n\nvoid SkewTo::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n\n    _startSkewX = target->getSkewX();\n\n    if (_startSkewX > 0)\n    {\n        _startSkewX = fmodf(_startSkewX, 180.f);\n    }\n    else\n    {\n        _startSkewX = fmodf(_startSkewX, -180.f);\n    }\n\n    _deltaX = _endSkewX - _startSkewX;\n\n    if (_deltaX > 180)\n    {\n        _deltaX -= 360;\n    }\n    if (_deltaX < -180)\n    {\n        _deltaX += 360;\n    }\n\n    _startSkewY = target->getSkewY();\n\n    if (_startSkewY > 0)\n    {\n        _startSkewY = fmodf(_startSkewY, 360.f);\n    }\n    else\n    {\n        _startSkewY = fmodf(_startSkewY, -360.f);\n    }\n\n    _deltaY = _endSkewY - _startSkewY;\n\n    if (_deltaY > 180)\n    {\n        _deltaY -= 360;\n    }\n    if (_deltaY < -180)\n    {\n        _deltaY += 360;\n    }\n}\n\nvoid SkewTo::update(float t)\n{\n    _target->setSkewX(_startSkewX + _deltaX * t);\n    _target->setSkewY(_startSkewY + _deltaY * t);\n}\n\nSkewTo::SkewTo()\n: _skewX(0.0)\n, _skewY(0.0)\n, _startSkewX(0.0)\n, _startSkewY(0.0)\n, _endSkewX(0.0)\n, _endSkewY(0.0)\n, _deltaX(0.0)\n, _deltaY(0.0)\n{\n}\n\n//\n// SkewBy\n//\nSkewBy* SkewBy::create(float t, float sx, float sy)\n{\n    SkewBy *skewBy = new SkewBy();\n    if (skewBy)\n    {\n        if (skewBy->initWithDuration(t, sx, sy))\n        {\n            skewBy->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(skewBy);\n        }\n    }\n\n    return skewBy;\n}\n\nSkewBy * SkewBy::clone() const\n{\n\t// no copy constructor\n\tauto a = new SkewBy();\n\ta->initWithDuration(_duration, _skewX, _skewY);\n\ta->autorelease();\n\treturn a;\n}\n\nbool SkewBy::initWithDuration(float t, float deltaSkewX, float deltaSkewY)\n{\n    bool ret = false;\n\n    if (SkewTo::initWithDuration(t, deltaSkewX, deltaSkewY))\n    {\n        _skewX = deltaSkewX;\n        _skewY = deltaSkewY;\n\n        ret = true;\n    }\n\n    return ret;\n}\n\nvoid SkewBy::startWithTarget(Node *target)\n{\n    SkewTo::startWithTarget(target);\n    _deltaX = _skewX;\n    _deltaY = _skewY;\n    _endSkewX = _startSkewX + _deltaX;\n    _endSkewY = _startSkewY + _deltaY;\n}\n\nSkewBy* SkewBy::reverse() const\n{\n    return SkewBy::create(_duration, -_skewX, -_skewY);\n}\n\n//\n// JumpBy\n//\n\nJumpBy* JumpBy::create(float duration, const Point& position, float height, int jumps)\n{\n    JumpBy *jumpBy = new JumpBy();\n    jumpBy->initWithDuration(duration, position, height, jumps);\n    jumpBy->autorelease();\n\n    return jumpBy;\n}\n\nbool JumpBy::initWithDuration(float duration, const Point& position, float height, int jumps)\n{\n    CCASSERT(jumps>=0, \"Number of jumps must be >= 0\");\n    \n    if (ActionInterval::initWithDuration(duration) && jumps>=0)\n    {\n        _delta = position;\n        _height = height;\n        _jumps = jumps;\n\n        return true;\n    }\n\n    return false;\n}\n\nJumpBy* JumpBy::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new JumpBy();\n\ta->initWithDuration(_duration, _delta, _height, _jumps);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid JumpBy::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _previousPos = _startPosition = target->getPosition();\n}\n\nvoid JumpBy::update(float t)\n{\n    // parabolic jump (since v0.8.2)\n    if (_target)\n    {\n        float frac = fmodf( t * _jumps, 1.0f );\n        float y = _height * 4 * frac * (1 - frac);\n        y += _delta.y * t;\n\n        float x = _delta.x * t;\n#if CC_ENABLE_STACKABLE_ACTIONS\n        Point currentPos = _target->getPosition();\n\n        Point diff = currentPos - _previousPos;\n        _startPosition = diff + _startPosition;\n\n        Point newPos = _startPosition + Point(x,y);\n        _target->setPosition(newPos);\n\n        _previousPos = newPos;\n#else\n        _target->setPosition(ccpAdd( _startPosition, Point(x,y)));\n#endif // !CC_ENABLE_STACKABLE_ACTIONS\n    }\n}\n\nJumpBy* JumpBy::reverse() const\n{\n    return JumpBy::create(_duration, Point(-_delta.x, -_delta.y),\n        _height, _jumps);\n}\n\n//\n// JumpTo\n//\n\nJumpTo* JumpTo::create(float duration, const Point& position, float height, int jumps)\n{\n    JumpTo *jumpTo = new JumpTo();\n    jumpTo->initWithDuration(duration, position, height, jumps);\n    jumpTo->autorelease();\n\n    return jumpTo;\n}\n\nJumpTo* JumpTo::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new JumpTo();\n    a->initWithDuration(_duration, _delta, _height, _jumps);\n\ta->autorelease();\n\treturn a;\n}\n\nJumpTo* JumpTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() not supported in JumpTo\");\n\treturn nullptr;\n}\n\nvoid JumpTo::startWithTarget(Node *target)\n{\n    JumpBy::startWithTarget(target);\n    _delta = Point(_delta.x - _startPosition.x, _delta.y - _startPosition.y);\n}\n\n// Bezier cubic formula:\n//    ((1 - t) + t)3 = 1 \n// Expands to ...\n//   (1 - t)3 + 3t(1-t)2 + 3t2(1 - t) + t3 = 1 \nstatic inline float bezierat( float a, float b, float c, float d, float t )\n{\n    return (powf(1-t,3) * a + \n            3*t*(powf(1-t,2))*b + \n            3*powf(t,2)*(1-t)*c +\n            powf(t,3)*d );\n}\n\n//\n// BezierBy\n//\n\nBezierBy* BezierBy::create(float t, const ccBezierConfig& c)\n{\n    BezierBy *bezierBy = new BezierBy();\n    bezierBy->initWithDuration(t, c);\n    bezierBy->autorelease();\n\n    return bezierBy;\n}\n\nbool BezierBy::initWithDuration(float t, const ccBezierConfig& c)\n{\n    if (ActionInterval::initWithDuration(t))\n    {\n        _config = c;\n        return true;\n    }\n\n    return false;\n}\n\nvoid BezierBy::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _previousPosition = _startPosition = target->getPosition();\n}\n\nBezierBy* BezierBy::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new BezierBy();\n\ta->initWithDuration(_duration, _config);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid BezierBy::update(float time)\n{\n    if (_target)\n    {\n        float xa = 0;\n        float xb = _config.controlPoint_1.x;\n        float xc = _config.controlPoint_2.x;\n        float xd = _config.endPosition.x;\n\n        float ya = 0;\n        float yb = _config.controlPoint_1.y;\n        float yc = _config.controlPoint_2.y;\n        float yd = _config.endPosition.y;\n\n        float x = bezierat(xa, xb, xc, xd, time);\n        float y = bezierat(ya, yb, yc, yd, time);\n\n#if CC_ENABLE_STACKABLE_ACTIONS\n        Point currentPos = _target->getPosition();\n        Point diff = currentPos - _previousPosition;\n        _startPosition = _startPosition + diff;\n\n        Point newPos = _startPosition + Point(x,y);\n        _target->setPosition(newPos);\n\n        _previousPosition = newPos;\n#else\n        _target->setPosition(ccpAdd( _startPosition, Point(x,y)));\n#endif // !CC_ENABLE_STACKABLE_ACTIONS\n    }\n}\n\nBezierBy* BezierBy::reverse(void) const\n{\n    ccBezierConfig r;\n\n    r.endPosition = -_config.endPosition;\n    r.controlPoint_1 = _config.controlPoint_2 + (-_config.endPosition);\n    r.controlPoint_2 = _config.controlPoint_1 + (-_config.endPosition);\n\n    BezierBy *action = BezierBy::create(_duration, r);\n    return action;\n}\n\n//\n// BezierTo\n//\n\nBezierTo* BezierTo::create(float t, const ccBezierConfig& c)\n{\n    BezierTo *bezierTo = new BezierTo();\n    bezierTo->initWithDuration(t, c);\n    bezierTo->autorelease();\n\n    return bezierTo;\n}\n\nbool BezierTo::initWithDuration(float t, const ccBezierConfig &c)\n{\n    if (ActionInterval::initWithDuration(t))\n    {\n        _toConfig = c;\n        return true;\n    }\n    \n    return false;\n}\n\nBezierTo* BezierTo::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new BezierTo();\n\ta->initWithDuration(_duration, _toConfig);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid BezierTo::startWithTarget(Node *target)\n{\n    BezierBy::startWithTarget(target);\n    _config.controlPoint_1 = _toConfig.controlPoint_1 - _startPosition;\n    _config.controlPoint_2 = _toConfig.controlPoint_2 - _startPosition;\n    _config.endPosition = _toConfig.endPosition - _startPosition;\n}\n\nBezierTo* BezierTo::reverse() const\n{\n\tCCASSERT(false, \"CCBezierTo doesn't support the 'reverse' method\");\n\treturn nullptr;\n}\n\n\n//\n// ScaleTo\n//\nScaleTo* ScaleTo::create(float duration, float s)\n{\n    ScaleTo *scaleTo = new ScaleTo();\n    scaleTo->initWithDuration(duration, s);\n    scaleTo->autorelease();\n\n    return scaleTo;\n}\n\nScaleTo* ScaleTo::create(float duration, float sx, float sy)\n{\n    ScaleTo *scaleTo = new ScaleTo();\n    scaleTo->initWithDuration(duration, sx, sy);\n    scaleTo->autorelease();\n\n    return scaleTo;\n}\n\nbool ScaleTo::initWithDuration(float duration, float s)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _endScaleX = s;\n        _endScaleY = s;\n\n        return true;\n    }\n\n    return false;\n}\n\nbool ScaleTo::initWithDuration(float duration, float sx, float sy)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _endScaleX = sx;\n        _endScaleY = sy;\n\n        return true;\n    }\n\n    return false;\n}\n\nScaleTo* ScaleTo::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new ScaleTo();\n\ta->initWithDuration(_duration, _endScaleX, _endScaleY);\n\ta->autorelease();\n\treturn a;\n}\n\nScaleTo* ScaleTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() not supported in ScaleTo\");\n\treturn nullptr;\n}\n\n\nvoid ScaleTo::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _startScaleX = target->getScaleX();\n    _startScaleY = target->getScaleY();\n    _deltaX = _endScaleX - _startScaleX;\n    _deltaY = _endScaleY - _startScaleY;\n}\n\nvoid ScaleTo::update(float time)\n{\n    if (_target)\n    {\n        _target->setScaleX(_startScaleX + _deltaX * time);\n        _target->setScaleY(_startScaleY + _deltaY * time);\n    }\n}\n\n//\n// ScaleBy\n//\n\nScaleBy* ScaleBy::create(float duration, float s)\n{\n    ScaleBy *scaleBy = new ScaleBy();\n    scaleBy->initWithDuration(duration, s);\n    scaleBy->autorelease();\n\n    return scaleBy;\n}\n\nScaleBy* ScaleBy::create(float duration, float sx, float sy)\n{\n    ScaleBy *scaleBy = new ScaleBy();\n    scaleBy->initWithDuration(duration, sx, sy);\n    scaleBy->autorelease();\n\n    return scaleBy;\n}\n\nScaleBy* ScaleBy::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new ScaleBy();\n    a->initWithDuration(_duration, _endScaleX, _endScaleY);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid ScaleBy::startWithTarget(Node *target)\n{\n    ScaleTo::startWithTarget(target);\n    _deltaX = _startScaleX * _endScaleX - _startScaleX;\n    _deltaY = _startScaleY * _endScaleY - _startScaleY;\n}\n\nScaleBy* ScaleBy::reverse() const\n{\n    return ScaleBy::create(_duration, 1 / _endScaleX, 1 / _endScaleY);\n}\n\n//\n// Blink\n//\n\nBlink* Blink::create(float duration, int blinks)\n{\n    Blink *blink = new Blink();\n    blink->initWithDuration(duration, blinks);\n    blink->autorelease();\n\n    return blink;\n}\n\nbool Blink::initWithDuration(float duration, int blinks)\n{\n    CCASSERT(blinks>=0, \"blinks should be >= 0\");\n    \n    if (ActionInterval::initWithDuration(duration) && blinks>=0)\n    {\n        _times = blinks;\n        return true;\n    }\n\n    return false;\n}\n\nvoid Blink::stop()\n{\n    _target->setVisible(_originalState);\n    ActionInterval::stop();\n}\n\nvoid Blink::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _originalState = target->isVisible();\n}\n\nBlink* Blink::clone(void) const\n{\n\t// no copy constructor\n\tauto a = new Blink();\n\ta->initWithDuration(_duration, _times);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Blink::update(float time)\n{\n    if (_target && ! isDone())\n    {\n        float slice = 1.0f / _times;\n        float m = fmodf(time, slice);\n        _target->setVisible(m > slice / 2 ? true : false);\n    }\n}\n\nBlink* Blink::reverse() const\n{\n    return Blink::create(_duration, _times);\n}\n\n//\n// FadeIn\n//\n\nFadeIn* FadeIn::create(float d)\n{\n    FadeIn* action = new FadeIn();\n\n    action->initWithDuration(d);\n    action->autorelease();\n\n    return action;\n}\n\nFadeIn* FadeIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new FadeIn();\n    a->initWithDuration(_duration);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid FadeIn::update(float time)\n{\n    if (_target)\n    {\n        _target->setOpacity((GLubyte)(255 * time));\n    }\n    /*_target->setOpacity((GLubyte)(255 * time));*/\n}\n\nActionInterval* FadeIn::reverse() const\n{\n    return FadeOut::create(_duration);\n}\n\n//\n// FadeOut\n//\n\nFadeOut* FadeOut::create(float d)\n{\n    FadeOut* action = new FadeOut();\n\n    action->initWithDuration(d);\n    action->autorelease();\n\n    return action;\n}\n\nFadeOut* FadeOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new FadeOut();\n    a->initWithDuration(_duration);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid FadeOut::update(float time)\n{\n    if (_target)\n    {\n        _target->setOpacity(GLubyte(255 * (1 - time)));\n    }\n    /*_target->setOpacity(GLubyte(255 * (1 - time)));*/    \n}\n\nActionInterval* FadeOut::reverse() const\n{\n    return FadeIn::create(_duration);\n}\n\n//\n// FadeTo\n//\n\nFadeTo* FadeTo::create(float duration, GLubyte opacity)\n{\n    FadeTo *fadeTo = new FadeTo();\n    fadeTo->initWithDuration(duration, opacity);\n    fadeTo->autorelease();\n\n    return fadeTo;\n}\n\nbool FadeTo::initWithDuration(float duration, GLubyte opacity)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _toOpacity = opacity;\n        return true;\n    }\n\n    return false;\n}\n\nFadeTo* FadeTo::clone() const\n{\n\t// no copy constructor\n\tauto a = new FadeTo();\n\ta->initWithDuration(_duration, _toOpacity);\n\ta->autorelease();\n\treturn a;\n}\n\nFadeTo* FadeTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() not supported in FadeTo\");\n\treturn nullptr;\n}\n\nvoid FadeTo::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n\n    if (target)\n    {\n        _fromOpacity = target->getOpacity();\n    }\n    /*_fromOpacity = target->getOpacity();*/\n}\n\nvoid FadeTo::update(float time)\n{\n    if (_target)\n    {\n        _target->setOpacity((GLubyte)(_fromOpacity + (_toOpacity - _fromOpacity) * time));\n    }\n    /*_target->setOpacity((GLubyte)(_fromOpacity + (_toOpacity - _fromOpacity) * time));*/\n}\n\n//\n// TintTo\n//\nTintTo* TintTo::create(float duration, GLubyte red, GLubyte green, GLubyte blue)\n{\n    TintTo *tintTo = new TintTo();\n    tintTo->initWithDuration(duration, red, green, blue);\n    tintTo->autorelease();\n\n    return tintTo;\n}\n\nbool TintTo::initWithDuration(float duration, GLubyte red, GLubyte green, GLubyte blue)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _to = Color3B(red, green, blue);\n        return true;\n    }\n\n    return false;\n}\n\nTintTo* TintTo::clone() const\n{\n\t// no copy constructor\n\tauto a = new TintTo();\n\ta->initWithDuration(_duration, _to.r, _to.g, _to.b);\n\ta->autorelease();\n\treturn a;\n}\n\nTintTo* TintTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() not supported in TintTo\");\n\treturn nullptr;\n}\n\nvoid TintTo::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    if (_target)\n    {\n        _from = _target->getColor();\n    }\n    /*_from = target->getColor();*/\n}\n\nvoid TintTo::update(float time)\n{\n    if (_target)\n    {\n        _target->setColor(Color3B(GLubyte(_from.r + (_to.r - _from.r) * time),\n            (GLubyte)(_from.g + (_to.g - _from.g) * time),\n            (GLubyte)(_from.b + (_to.b - _from.b) * time)));\n    }    \n}\n\n//\n// TintBy\n//\n\nTintBy* TintBy::create(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue)\n{\n    TintBy *tintBy = new TintBy();\n    tintBy->initWithDuration(duration, deltaRed, deltaGreen, deltaBlue);\n    tintBy->autorelease();\n\n    return tintBy;\n}\n\nbool TintBy::initWithDuration(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _deltaR = deltaRed;\n        _deltaG = deltaGreen;\n        _deltaB = deltaBlue;\n\n        return true;\n    }\n\n    return false;\n}\n\nTintBy* TintBy::clone() const\n{\n\t// no copy constructor\n\tauto a = new TintBy();\n\ta->initWithDuration(_duration, (GLubyte)_deltaR, (GLubyte)_deltaG, (GLubyte)_deltaB);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid TintBy::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n\n    if (target)\n    {\n        Color3B color = target->getColor();\n        _fromR = color.r;\n        _fromG = color.g;\n        _fromB = color.b;\n    }    \n}\n\nvoid TintBy::update(float time)\n{\n    if (_target)\n    {\n        _target->setColor(Color3B((GLubyte)(_fromR + _deltaR * time),\n            (GLubyte)(_fromG + _deltaG * time),\n            (GLubyte)(_fromB + _deltaB * time)));\n    }    \n}\n\nTintBy* TintBy::reverse() const\n{\n    return TintBy::create(_duration, -_deltaR, -_deltaG, -_deltaB);\n}\n\n//\n// DelayTime\n//\nDelayTime* DelayTime::create(float d)\n{\n    DelayTime* action = new DelayTime();\n\n    action->initWithDuration(d);\n    action->autorelease();\n\n    return action;\n}\n\nDelayTime* DelayTime::clone() const\n{\n\t// no copy constructor\n\tauto a = new DelayTime();\n    a->initWithDuration(_duration);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid DelayTime::update(float time)\n{\n    CC_UNUSED_PARAM(time);\n    return;\n}\n\nDelayTime* DelayTime::reverse() const\n{\n    return DelayTime::create(_duration);\n}\n\n//\n// ReverseTime\n//\n\nReverseTime* ReverseTime::create(FiniteTimeAction *action)\n{\n    // casting to prevent warnings\n    ReverseTime *reverseTime = new ReverseTime();\n    reverseTime->initWithAction( action->clone() );\n    reverseTime->autorelease();\n\n    return reverseTime;\n}\n\nbool ReverseTime::initWithAction(FiniteTimeAction *action)\n{\n    CCASSERT(action != nullptr, \"\");\n    CCASSERT(action != _other, \"\");\n\n    if (ActionInterval::initWithDuration(action->getDuration()))\n    {\n        // Don't leak if action is reused\n        CC_SAFE_RELEASE(_other);\n\n        _other = action;\n        action->retain();\n\n        return true;\n    }\n\n    return false;\n}\n\nReverseTime* ReverseTime::clone() const\n{\n\t// no copy constructor\n\tauto a = new ReverseTime();\n\ta->initWithAction( _other->clone() );\n\ta->autorelease();\n\treturn a;\n}\n\nReverseTime::ReverseTime() : _other(nullptr)\n{\n\n}\n\nReverseTime::~ReverseTime(void)\n{\n    CC_SAFE_RELEASE(_other);\n}\n\nvoid ReverseTime::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _other->startWithTarget(target);\n}\n\nvoid ReverseTime::stop(void)\n{\n    _other->stop();\n    ActionInterval::stop();\n}\n\nvoid ReverseTime::update(float time)\n{\n    if (_other)\n    {\n        _other->update(1 - time);\n    }\n}\n\nReverseTime* ReverseTime::reverse() const\n{\n    // XXX: This looks like a bug\n    return (ReverseTime*)_other->clone();\n}\n\n//\n// Animate\n//\nAnimate* Animate::create(Animation *animation)\n{\n    Animate *animate = new Animate();\n    animate->initWithAnimation(animation);\n    animate->autorelease();\n\n    return animate;\n}\n\nAnimate::Animate()\n: _splitTimes(new std::vector<float>)\n, _nextFrame(0)\n, _origFrame(nullptr)\n, _executedLoops(0)\n, _animation(nullptr)\n{\n\n}\n\nAnimate::~Animate()\n{\n    CC_SAFE_RELEASE(_animation);\n    CC_SAFE_RELEASE(_origFrame);\n    CC_SAFE_DELETE(_splitTimes);\n}\n\nbool Animate::initWithAnimation(Animation* animation)\n{\n    CCASSERT( animation!=nullptr, \"Animate: argument Animation must be non-nullptr\");\n\n    float singleDuration = animation->getDuration();\n\n    if ( ActionInterval::initWithDuration(singleDuration * animation->getLoops() ) )\n    {\n        _nextFrame = 0;\n        setAnimation(animation);\n        _origFrame = nullptr;\n        _executedLoops = 0;\n\n        _splitTimes->reserve(animation->getFrames().size());\n\n        float accumUnitsOfTime = 0;\n        float newUnitOfTimeValue = singleDuration / animation->getTotalDelayUnits();\n\n        auto frames = animation->getFrames();\n\n        for (auto& frame : frames)\n        {\n            float value = (accumUnitsOfTime * newUnitOfTimeValue) / singleDuration;\n            accumUnitsOfTime += frame->getDelayUnits();\n            _splitTimes->push_back(value);\n        }    \n        return true;\n    }\n    return false;\n}\n\nvoid Animate::setAnimation(cocos2d::Animation *animation)\n{\n    if (_animation != animation)\n    {\n        CC_SAFE_RETAIN(animation);\n        CC_SAFE_RELEASE(_animation);\n        _animation = animation;\n    }\n}\n\nAnimate* Animate::clone() const\n{\n\t// no copy constructor\n\tauto a = new Animate();\n\ta->initWithAnimation(_animation->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid Animate::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    Sprite *sprite = static_cast<Sprite*>(target);\n\n    CC_SAFE_RELEASE(_origFrame);\n\n    if (_animation->getRestoreOriginalFrame())\n    {\n        _origFrame = sprite->getSpriteFrame();\n        _origFrame->retain();\n    }\n    _nextFrame = 0;\n    _executedLoops = 0;\n}\n\nvoid Animate::stop(void)\n{\n    if (_animation->getRestoreOriginalFrame() && _target)\n    {\n        static_cast<Sprite*>(_target)->setSpriteFrame(_origFrame);\n    }\n\n    ActionInterval::stop();\n}\n\nvoid Animate::update(float t)\n{\n    // if t==1, ignore. Animation should finish with t==1\n    if( t < 1.0f ) {\n        t *= _animation->getLoops();\n\n        // new loop?  If so, reset frame counter\n        unsigned int loopNumber = (unsigned int)t;\n        if( loopNumber > _executedLoops ) {\n            _nextFrame = 0;\n            _executedLoops++;\n        }\n\n        // new t for animations\n        t = fmodf(t, 1.0f);\n    }\n\n    auto frames = _animation->getFrames();\n    auto numberOfFrames = frames.size();\n    SpriteFrame *frameToDisplay = nullptr;\n\n    for( int i=_nextFrame; i < numberOfFrames; i++ ) {\n        float splitTime = _splitTimes->at(i);\n\n        if( splitTime <= t ) {\n            AnimationFrame* frame = frames.at(i);\n            frameToDisplay = frame->getSpriteFrame();\n            static_cast<Sprite*>(_target)->setSpriteFrame(frameToDisplay);\n\n            const ValueMap& dict = frame->getUserInfo();\n            if ( !dict.empty() )\n            {\n                //TODO: [[NSNotificationCenter defaultCenter] postNotificationName:AnimationFrameDisplayedNotification object:target_ userInfo:dict];\n            }\n            _nextFrame = i+1;\n        }\n        // Issue 1438. Could be more than one frame per tick, due to low frame rate or frame delta < 1/FPS\n        else {\n            break;\n        }\n    }\n}\n\nAnimate* Animate::reverse() const\n{\n    auto oldArray = _animation->getFrames();\n    Vector<AnimationFrame*> newArray(oldArray.size());\n   \n    if (oldArray.size() > 0)\n    {\n        for (auto iter = oldArray.crbegin(); iter != oldArray.crend(); ++iter)\n        {\n            AnimationFrame* animFrame = *iter;\n            if (!animFrame)\n            {\n                break;\n            }\n\n            newArray.pushBack(animFrame->clone());\n        }\n    }\n\n    Animation *newAnim = Animation::create(newArray, _animation->getDelayPerUnit(), _animation->getLoops());\n    newAnim->setRestoreOriginalFrame(_animation->getRestoreOriginalFrame());\n    return Animate::create(newAnim);\n}\n\n// TargetedAction\n\nTargetedAction::TargetedAction()\n: _action(nullptr)\n, _forcedTarget(nullptr)\n{\n\n}\n\nTargetedAction::~TargetedAction()\n{\n    CC_SAFE_RELEASE(_forcedTarget);\n    CC_SAFE_RELEASE(_action);\n}\n\nTargetedAction* TargetedAction::create(Node* target, FiniteTimeAction* action)\n{\n    TargetedAction* p = new TargetedAction();\n    p->initWithTarget(target, action);\n    p->autorelease();\n    return p;\n}\n\n\nbool TargetedAction::initWithTarget(Node* target, FiniteTimeAction* action)\n{\n    if(ActionInterval::initWithDuration(action->getDuration()))\n    {\n        CC_SAFE_RETAIN(target);\n        _forcedTarget = target;\n        CC_SAFE_RETAIN(action);\n        _action = action;\n        return true;\n    }\n    return false;\n}\n\nTargetedAction* TargetedAction::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new TargetedAction();\n    // win32 : use the _other's copy object.\n\ta->initWithTarget(_forcedTarget, _action->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nTargetedAction* TargetedAction::reverse(void) const\n{\n\t// just reverse the internal action\n\tauto a = new TargetedAction();\n\ta->initWithTarget(_forcedTarget, _action->reverse());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid TargetedAction::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _action->startWithTarget(_forcedTarget);\n}\n\nvoid TargetedAction::stop(void)\n{\n    _action->stop();\n}\n\nvoid TargetedAction::update(float time)\n{\n    _action->update(time);\n}\n\nvoid TargetedAction::setForcedTarget(Node* forcedTarget)\n{\n    if( _forcedTarget != forcedTarget ) {\n        CC_SAFE_RETAIN(forcedTarget);\n        CC_SAFE_RELEASE(_forcedTarget);\n        _forcedTarget = forcedTarget;\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionInterval.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ACTION_CCINTERVAL_ACTION_H__\n#define __ACTION_CCINTERVAL_ACTION_H__\n\n#include \"CCNode.h\"\n#include \"CCAction.h\"\n#include \"CCProtocols.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCAnimation.h\"\n#include \"CCVector.h\"\n#include <vector>\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** \n@brief An interval action is an action that takes place within a certain period of time.\nIt has an start time, and a finish time. The finish time is the parameter\nduration plus the start time.\n\nThese ActionInterval actions have some interesting properties, like:\n- They can run normally (default)\n- They can run reversed with the reverse method\n- They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.\n\nFor example, you can simulate a Ping Pong effect running the action normally and\nthen running it again in Reverse mode.\n\nExample:\n\nAction *pingPongAction = Sequence::actions(action, action->reverse(), nullptr);\n*/\nclass CC_DLL ActionInterval : public FiniteTimeAction\n{\npublic:\n    /** how many seconds had elapsed since the actions started to run. */\n    inline float getElapsed(void) { return _elapsed; }\n\n    //extension in GridAction\n    void setAmplitudeRate(float amp);\n    float getAmplitudeRate(void);\n\n    //\n    // Overrides\n    //\n    virtual bool isDone(void) const override;\n    virtual void step(float dt) override;\n    virtual void startWithTarget(Node *target) override;\n    virtual ActionInterval* reverse() const override = 0;\n\tvirtual ActionInterval *clone() const override = 0;\n\nprotected:\n    /** initializes the action */\n    bool initWithDuration(float d);\n\n    float _elapsed;\n    bool   _firstTick;\n};\n\n/** @brief Runs actions sequentially, one after another\n */\nclass CC_DLL Sequence : public ActionInterval\n{\npublic:\n    /** helper constructor to create an array of sequenceable actions */\n    static Sequence* create(FiniteTimeAction *action1, ...) CC_REQUIRES_NULL_TERMINATION;\n    /** helper constructor to create an array of sequenceable actions given an array\n     * @code\n     * When this funtion bound to the js or lua,the input params changed\n     * in js  :var   create(var   object1,var   object2, ...)\n     * in lua :local create(local object1,local object2, ...)\n     * @endcode\n     */\n    static Sequence* create(const Vector<FiniteTimeAction*>& arrayOfActions);\n    /** helper constructor to create an array of sequence-able actions */\n    static Sequence* createWithVariableList(FiniteTimeAction *action1, va_list args);\n    /** creates the action */\n    static Sequence* createWithTwoActions(FiniteTimeAction *actionOne, FiniteTimeAction *actionTwo);\n\n    //\n    // Overrides\n    //\n    virtual Sequence* clone() const override;\n\tvirtual Sequence* reverse() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop(void) override;\n    virtual void update(float t) override;\n\nprotected:\n    Sequence() {}\n    virtual ~Sequence(void);\n    /** initializes the action */\n    bool initWithTwoActions(FiniteTimeAction *pActionOne, FiniteTimeAction *pActionTwo);\n\n    FiniteTimeAction *_actions[2];\n    float _split;\n    int _last;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Sequence);\n};\n\n/** @brief Repeats an action a number of times.\n * To repeat an action forever use the RepeatForever action.\n */\nclass CC_DLL Repeat : public ActionInterval\n{\npublic:\n    /** creates a Repeat action. Times is an unsigned integer between 1 and pow(2,30) */\n    static Repeat* create(FiniteTimeAction *action, unsigned int times);\n\n    inline void setInnerAction(FiniteTimeAction *action)\n    {\n        if (_innerAction != action)\n        {\n            CC_SAFE_RETAIN(action);\n            CC_SAFE_RELEASE(_innerAction);\n            _innerAction = action;\n        }\n    }\n\n    inline FiniteTimeAction* getInnerAction()\n    {\n        return _innerAction;\n    }\n\n    //\n    // Overrides\n    //\n    virtual Repeat* clone() const override;\n\tvirtual Repeat* reverse() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop(void) override;\n    virtual void update(float dt) override;\n    virtual bool isDone(void) const override;\n\nprotected:\n    Repeat() {}\n    virtual ~Repeat();\n    /** initializes a Repeat action. Times is an unsigned integer between 1 and pow(2,30) */\n    bool initWithAction(FiniteTimeAction *pAction, unsigned int times);\n\n    unsigned int _times;\n    unsigned int _total;\n    float _nextDt;\n    bool _actionInstant;\n    /** Inner action */\n    FiniteTimeAction *_innerAction;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Repeat);\n};\n\n/** @brief Repeats an action for ever.\nTo repeat the an action for a limited number of times use the Repeat action.\n@warning This action can't be Sequenceable because it is not an IntervalAction\n*/\nclass CC_DLL RepeatForever : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static RepeatForever* create(ActionInterval *action);\n\n    inline void setInnerAction(ActionInterval *action)\n    {\n        if (_innerAction != action)\n        {\n            CC_SAFE_RELEASE(_innerAction);\n            _innerAction = action;\n            CC_SAFE_RETAIN(_innerAction);\n        }\n    }\n\n    inline ActionInterval* getInnerAction()\n    {\n        return _innerAction;\n    }\n\n    //\n    // Overrides\n    //\n    virtual RepeatForever* clone() const override;\n\tvirtual RepeatForever* reverse(void) const override;\n    virtual void startWithTarget(Node* target) override;\n    virtual void step(float dt) override;\n    virtual bool isDone(void) const override;\n\nprotected:\n    RepeatForever()\n    : _innerAction(nullptr)\n    {}\n    virtual ~RepeatForever();\n    /** initializes the action */\n    bool initWithAction(ActionInterval *action);\n\n    /** Inner action */\n    ActionInterval *_innerAction;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(RepeatForever);\n};\n\n/** @brief Spawn a new action immediately\n */\nclass CC_DLL Spawn : public ActionInterval\n{\npublic:\n    /** helper constructor to create an array of spawned actions \n     * @code\n     * When this funtion bound to the js or lua,the input params changed\n     * in js  :var   create(var   object1,var   object2, ...)\n     * in lua :local create(local object1,local object2, ...)\n     * @endcode\n     */\n    static Spawn* create(FiniteTimeAction *action1, ...) CC_REQUIRES_NULL_TERMINATION;\n\n    /** helper constructor to create an array of spawned actions */\n    static Spawn* createWithVariableList(FiniteTimeAction *action1, va_list args);\n\n    /** helper constructor to create an array of spawned actions given an array */\n    static Spawn* create(const Vector<FiniteTimeAction*>& arrayOfActions);\n\n    /** creates the Spawn action */\n    static Spawn* createWithTwoActions(FiniteTimeAction *action1, FiniteTimeAction *action2);\n\n    //\n    // Overrides\n    //\n    virtual Spawn* clone() const override;\n\tvirtual Spawn* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop(void) override;\n    virtual void update(float time) override;\n\nprotected:\n    Spawn() {}\n    virtual ~Spawn();\n    /** initializes the Spawn action with the 2 actions to spawn */\n    bool initWithTwoActions(FiniteTimeAction *action1, FiniteTimeAction *action2);\n\n    FiniteTimeAction *_one;\n    FiniteTimeAction *_two;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Spawn);\n};\n\n/** @brief Rotates a Node object to a certain angle by modifying it's\n rotation attribute.\n The direction will be decided by the shortest angle.\n*/ \nclass CC_DLL RotateTo : public ActionInterval\n{\npublic:\n    /** creates the action with separate rotation angles */\n    static RotateTo* create(float duration, float deltaAngleX, float deltaAngleY);\n\n    /** creates the action */\n    static RotateTo* create(float duration, float deltaAngle);\n\n    //\n    // Overrides\n    //\n    virtual RotateTo* clone() const override;\n    virtual RotateTo* reverse() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n    \nprotected:\n    RotateTo() {}\n    virtual ~RotateTo() {}\n    /** initializes the action */\n    bool initWithDuration(float duration, float deltaAngle);\n    bool initWithDuration(float duration, float deltaAngleX, float deltaAngleY);\n\n    float _dstAngleX;\n    float _startAngleX;\n    float _diffAngleX;\n    \n    float _dstAngleY;\n    float _startAngleY;\n    float _diffAngleY;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(RotateTo);\n};\n\n/** @brief Rotates a Node object clockwise a number of degrees by modifying it's rotation attribute.\n*/\nclass CC_DLL RotateBy : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static RotateBy* create(float duration, float deltaAngle);\n    static RotateBy* create(float duration, float deltaAngleX, float deltaAngleY);\n\n    //\n    // Override\n    //\n    virtual RotateBy* clone() const override;\n\tvirtual RotateBy* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n    \nprotected:\n    RotateBy() {}\n    virtual ~RotateBy() {}\n    /** initializes the action */\n    bool initWithDuration(float duration, float deltaAngle);\n    bool initWithDuration(float duration, float deltaAngleX, float deltaAngleY);\n\n    float _angleX;\n    float _startAngleX;\n    float _angleY;\n    float _startAngleY;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(RotateBy);\n};\n\n/**  Moves a Node object x,y pixels by modifying it's position attribute.\n x and y are relative to the position of the object.\n Several MoveBy actions can be concurrently called, and the resulting\n movement will be the sum of individual movements.\n @since v2.1beta2-custom\n */\nclass CC_DLL MoveBy : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static MoveBy* create(float duration, const Point& deltaPosition);\n\n    //\n    // Overrides\n    //\n    virtual MoveBy* clone() const override;\n\tvirtual MoveBy* reverse(void) const  override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    MoveBy() {}\n    virtual ~MoveBy() {}\n    /** initializes the action */\n    bool initWithDuration(float duration, const Point& deltaPosition);\n\n    Point _positionDelta;\n    Point _startPosition;\n    Point _previousPosition;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MoveBy);\n};\n\n/** Moves a Node object to the position x,y. x and y are absolute coordinates by modifying it's position attribute.\n Several MoveTo actions can be concurrently called, and the resulting\n movement will be the sum of individual movements.\n @since v2.1beta2-custom\n */\nclass CC_DLL MoveTo : public MoveBy\n{\npublic:\n    /** creates the action */\n    static MoveTo* create(float duration, const Point& position);\n\n    //\n    // Overrides\n    //\n    virtual MoveTo* clone() const override;\n    virtual void startWithTarget(Node *target) override;\n\nprotected:\n    MoveTo() {}\n    virtual ~MoveTo() {}\n    /** initializes the action */\n    bool initWithDuration(float duration, const Point& position);\n\n    Point _endPosition;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MoveTo);\n};\n\n/** Skews a Node object to given angles by modifying it's skewX and skewY attributes\n@since v1.0\n*/\nclass CC_DLL SkewTo : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static SkewTo* create(float t, float sx, float sy);\n\n    //\n    // Overrides\n    //\n    virtual SkewTo* clone() const override;\n\tvirtual SkewTo* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    SkewTo();\n    virtual ~SkewTo() {}\n    bool initWithDuration(float t, float sx, float sy);\n\n    float _skewX;\n    float _skewY;\n    float _startSkewX;\n    float _startSkewY;\n    float _endSkewX;\n    float _endSkewY;\n    float _deltaX;\n    float _deltaY;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(SkewTo);\n};\n\n/** Skews a Node object by skewX and skewY degrees\n@since v1.0\n*/\nclass CC_DLL SkewBy : public SkewTo\n{\npublic:\n    /** creates the action */\n    static SkewBy* create(float t, float deltaSkewX, float deltaSkewY);\n\n    //\n    // Overrides\n    //\n    virtual void startWithTarget(Node *target) override;\n    virtual SkewBy* clone() const  override;\n\tvirtual SkewBy* reverse(void) const override;\n\nprotected:\n    SkewBy() {}\n    virtual ~SkewBy() {}\n    bool initWithDuration(float t, float sx, float sy);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(SkewBy);\n};\n\n/** @brief Moves a Node object simulating a parabolic jump movement by modifying it's position attribute.\n*/\nclass CC_DLL JumpBy : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static JumpBy* create(float duration, const Point& position, float height, int jumps);\n\n    //\n    // Overrides\n    //\n    virtual JumpBy* clone() const override;\n\tvirtual JumpBy* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    JumpBy() {}\n    virtual ~JumpBy() {}\n    /** initializes the action */\n    bool initWithDuration(float duration, const Point& position, float height, int jumps);\n\n    Point           _startPosition;\n    Point           _delta;\n    float           _height;\n    int             _jumps;\n    Point           _previousPos;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(JumpBy);\n};\n\n/** @brief Moves a Node object to a parabolic position simulating a jump movement by modifying it's position attribute.\n*/ \nclass CC_DLL JumpTo : public JumpBy\n{\npublic:\n    /** creates the action */\n    static JumpTo* create(float duration, const Point& position, float height, int jumps);\n\n    //\n    // Override\n    //\n    virtual void startWithTarget(Node *target) override;\n    virtual JumpTo* clone() const override;\n\tvirtual JumpTo* reverse(void) const override;\n\nprivate:\n    JumpTo() {}\n    virtual ~JumpTo() {}\n    CC_DISALLOW_COPY_AND_ASSIGN(JumpTo);\n};\n\n/** Bezier configuration structure\n */\ntypedef struct _ccBezierConfig {\n    //! end position of the bezier\n    Point endPosition;\n    //! Bezier control point 1\n    Point controlPoint_1;\n    //! Bezier control point 2\n    Point controlPoint_2;\n} ccBezierConfig;\n\n/** @brief An action that moves the target with a cubic Bezier curve by a certain distance.\n */\nclass CC_DLL BezierBy : public ActionInterval\n{\npublic:\n    /** creates the action with a duration and a bezier configuration \n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js: var create(var t,var table)\n     * in lua: lcaol create(local t, local table)\n     * @endcode\n     */\n    static BezierBy* create(float t, const ccBezierConfig& c);\n\n    //\n    // Overrides\n    //\n    virtual BezierBy* clone() const override;\n\tvirtual BezierBy* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    BezierBy() {}\n    virtual ~BezierBy() {}\n    /** initializes the action with a duration and a bezier configuration */\n    bool initWithDuration(float t, const ccBezierConfig& c);\n\n    ccBezierConfig _config;\n    Point _startPosition;\n    Point _previousPosition;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(BezierBy);\n};\n\n/** @brief An action that moves the target with a cubic Bezier curve to a destination point.\n @since v0.8.2\n */\nclass CC_DLL BezierTo : public BezierBy\n{\npublic:\n    /** creates the action with a duration and a bezier configuration \n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js: var create(var t,var table)\n     * in lua: lcaol create(local t, local table)\n     * @endcode\n     */\n    static BezierTo* create(float t, const ccBezierConfig& c);\n\n    //\n    // Overrides\n    //\n    virtual void startWithTarget(Node *target) override;\n    virtual BezierTo* clone() const override;\n\tvirtual BezierTo* reverse(void) const override;\n\nprotected:\n    BezierTo() {}\n    virtual ~BezierTo() {}\n    bool initWithDuration(float t, const ccBezierConfig &c);\n\n    ccBezierConfig _toConfig;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(BezierTo);\n};\n\n/** @brief Scales a Node object to a zoom factor by modifying it's scale attribute.\n @warning This action doesn't support \"reverse\"\n */\nclass CC_DLL ScaleTo : public ActionInterval\n{\npublic:\n    /** creates the action with the same scale factor for X and Y */\n    static ScaleTo* create(float duration, float s);\n\n    /** creates the action with and X factor and a Y factor */\n    static ScaleTo* create(float duration, float sx, float sy);\n\n    //\n    // Overrides\n    //\n    virtual ScaleTo* clone() const override;\n\tvirtual ScaleTo* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    ScaleTo() {}\n    virtual ~ScaleTo() {}\n    /** initializes the action with the same scale factor for X and Y */\n    bool initWithDuration(float duration, float s);\n    /** initializes the action with and X factor and a Y factor */\n    bool initWithDuration(float duration, float sx, float sy);\n\n    float _scaleX;\n    float _scaleY;\n    float _startScaleX;\n    float _startScaleY;\n    float _endScaleX;\n    float _endScaleY;\n    float _deltaX;\n    float _deltaY;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ScaleTo);\n};\n\n/** @brief Scales a Node object a zoom factor by modifying it's scale attribute.\n*/\nclass CC_DLL ScaleBy : public ScaleTo\n{\npublic:\n    /** creates the action with the same scale factor for X and Y */\n    static ScaleBy* create(float duration, float s);\n\n    /** creates the action with and X factor and a Y factor */\n    static ScaleBy* create(float duration, float sx, float sy);\n\n    //\n    // Overrides\n    //\n    virtual void startWithTarget(Node *target) override;\n    virtual ScaleBy* clone() const override;\n\tvirtual ScaleBy* reverse(void) const override;\n\nprotected:\n    ScaleBy() {}\n    virtual ~ScaleBy() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ScaleBy);\n};\n\n/** @brief Blinks a Node object by modifying it's visible attribute\n*/\nclass CC_DLL Blink : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static Blink* create(float duration, int blinks);\n\n    //\n    // Overrides\n    //\n    virtual Blink* clone() const override;\n\tvirtual Blink* reverse(void) const override;\n    virtual void update(float time) override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop() override;\n    \nprotected:\n    Blink() {}\n    virtual ~Blink() {}\n    /** initializes the action */\n    bool initWithDuration(float duration, int blinks);\n\n    int _times;\n    bool _originalState;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Blink);\n};\n\n/** @brief Fades In an object that implements the RGBAProtocol protocol. It modifies the opacity from 0 to 255.\n The \"reverse\" of this action is FadeOut\n */\nclass CC_DLL FadeIn : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static FadeIn* create(float d);\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n    virtual FadeIn* clone() const override;\n\tvirtual ActionInterval* reverse(void) const override;\n\nprotected:\n    FadeIn() {}\n    virtual ~FadeIn() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FadeIn);\n};\n\n/** @brief Fades Out an object that implements the RGBAProtocol protocol. It modifies the opacity from 255 to 0.\n The \"reverse\" of this action is FadeIn\n*/\nclass CC_DLL FadeOut : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static FadeOut* create(float d);\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n    virtual FadeOut* clone() const  override;\n\tvirtual ActionInterval* reverse(void) const override;\n\nprotected:\n    FadeOut() {}\n    virtual ~FadeOut() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FadeOut);\n};\n\n/** @brief Fades an object that implements the RGBAProtocol protocol. It modifies the opacity from the current value to a custom one.\n @warning This action doesn't support \"reverse\"\n */\nclass CC_DLL FadeTo : public ActionInterval\n{\npublic:\n    /** creates an action with duration and opacity */\n    static FadeTo* create(float duration, GLubyte opacity);\n\n    //\n    // Overrides\n    //\n    virtual FadeTo* clone() const override;\n\tvirtual FadeTo* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    FadeTo() {}\n    virtual ~FadeTo() {}\n    /** initializes the action with duration and opacity */\n    bool initWithDuration(float duration, GLubyte opacity);\n\n    GLubyte _toOpacity;\n    GLubyte _fromOpacity;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FadeTo);\n};\n\n/** @brief Tints a Node that implements the NodeRGB protocol from current tint to a custom one.\n @warning This action doesn't support \"reverse\"\n @since v0.7.2\n*/\nclass CC_DLL TintTo : public ActionInterval\n{\npublic:\n    /** creates an action with duration and color */\n    static TintTo* create(float duration, GLubyte red, GLubyte green, GLubyte blue);\n\n    //\n    // Overrides\n    //\n    virtual TintTo* clone() const override;\n\tvirtual TintTo* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    TintTo() {}\n    virtual ~TintTo() {}\n    /** initializes the action with duration and color */\n    bool initWithDuration(float duration, GLubyte red, GLubyte green, GLubyte blue);\n\n    Color3B _to;\n    Color3B _from;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TintTo);\n};\n\n/** @brief Tints a Node that implements the NodeRGB protocol from current tint to a custom one.\n @since v0.7.2\n */\nclass CC_DLL TintBy : public ActionInterval\n{\npublic:\n    /** creates an action with duration and color */\n    static TintBy* create(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue);\n\n    //\n    // Overrides\n    //\n    virtual TintBy* clone() const override;\n\tvirtual TintBy* reverse() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    TintBy() {}\n    virtual ~TintBy() {}\n    /** initializes the action with duration and color */\n    bool initWithDuration(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue);\n\n    GLshort _deltaR;\n    GLshort _deltaG;\n    GLshort _deltaB;\n\n    GLshort _fromR;\n    GLshort _fromG;\n    GLshort _fromB;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TintBy);\n};\n\n/** @brief Delays the action a certain amount of seconds\n*/\nclass CC_DLL DelayTime : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static DelayTime* create(float d);\n\n    //\n    // Overrides\n    //\n    virtual void update(float time) override;\n    virtual DelayTime* reverse() const override;\n    virtual DelayTime* clone() const override;\n\nprotected:\n    DelayTime() {}\n    virtual ~DelayTime() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(DelayTime);\n};\n\n/** @brief Executes an action in reverse order, from time=duration to time=0\n \n @warning Use this action carefully. This action is not\n sequenceable. Use it as the default \"reversed\" method\n of your own actions, but using it outside the \"reversed\"\n scope is not recommended.\n*/\nclass CC_DLL ReverseTime : public ActionInterval\n{\npublic:\n    /** creates the action */\n    static ReverseTime* create(FiniteTimeAction *action);\n\n    //\n    // Overrides\n    //\n\tvirtual ReverseTime* reverse() const override;\n    virtual ReverseTime* clone() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop(void) override;\n    virtual void update(float time) override;\n\nprotected:\n    ReverseTime();\n    virtual ~ReverseTime(void);\n    /** initializes the action */\n    bool initWithAction(FiniteTimeAction *action);\n\n    FiniteTimeAction *_other;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ReverseTime);\n};\n\nclass Texture2D;\n/** @brief Animates a sprite given the name of an Animation */\nclass CC_DLL Animate : public ActionInterval\n{\npublic:\n    /** creates the action with an Animation and will restore the original frame when the animation is over */\n    static Animate* create(Animation *animation);\n\n    /** sets the Animation object to be animated */\n    void setAnimation( Animation* animation );\n    /** returns the Animation object that is being animated */\n    Animation* getAnimation() { return _animation; }\n    const Animation* getAnimation() const { return _animation; }\n\n    //\n    // Overrides\n    //\n    virtual Animate* clone() const override;\n    virtual Animate* reverse() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop(void) override;\n    virtual void update(float t) override;\n\nprotected:\n    Animate();\n    virtual ~Animate();\n    /** initializes the action with an Animation and will restore the original frame when the animation is over */\n    bool initWithAnimation(Animation *animation);\n\n    std::vector<float>* _splitTimes;\n    int             _nextFrame;\n    SpriteFrame*    _origFrame;\n    unsigned int    _executedLoops;\n    Animation*      _animation;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Animate);\n};\n\n/** Overrides the target of an action so that it always runs on the target\n * specified at action creation rather than the one specified by runAction.\n */\nclass CC_DLL TargetedAction : public ActionInterval\n{\npublic:\n    /** Create an action with the specified action and forced target */\n    static TargetedAction* create(Node* target, FiniteTimeAction* action);\n\n    /** Sets the target that the action will be forced to run with */\n    void setForcedTarget(Node* forcedTarget);\n    /** returns the target that the action is forced to run with */\n    Node* getForcedTarget() { return _forcedTarget; }\n    const Node* getForcedTarget() const { return _forcedTarget; }\n\n    //\n    // Overrides\n    //\n    virtual TargetedAction* clone() const override;\n    virtual TargetedAction* reverse() const  override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void stop(void) override;\n    virtual void update(float time) override;\n\nprotected:\n    TargetedAction();\n    virtual ~TargetedAction();\n    /** Init an action with the specified action and forced target */\n    bool initWithTarget(Node* target, FiniteTimeAction* action);\n\n    FiniteTimeAction* _action;\n    Node* _forcedTarget;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TargetedAction);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif //__ACTION_CCINTERVAL_ACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionManager.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2009      Valentin Milea\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCActionManager.h\"\n#include \"CCNode.h\"\n#include \"CCScheduler.h\"\n#include \"ccMacros.h\"\n#include \"ccCArray.h\"\n#include \"uthash.h\"\n#include \"CCSet.h\"\n\nNS_CC_BEGIN\n//\n// singleton stuff\n//\ntypedef struct _hashElement\n{\n    struct _ccArray             *actions;\n    Node                    *target;\n    int                actionIndex;\n    Action                    *currentAction;\n    bool                        currentActionSalvaged;\n    bool                        paused;\n    UT_hash_handle                hh;\n} tHashElement;\n\nActionManager::ActionManager(void)\n: _targets(nullptr),\n  _currentTarget(nullptr),\n  _currentTargetSalvaged(false)\n{\n\n}\n\nActionManager::~ActionManager(void)\n{\n    CCLOGINFO(\"deallocing ActionManager: %p\", this);\n\n    removeAllActions();\n}\n\n// private\n\nvoid ActionManager::deleteHashElement(tHashElement *element)\n{\n    ccArrayFree(element->actions);\n    HASH_DEL(_targets, element);\n    element->target->release();\n    free(element);\n}\n\nvoid ActionManager::actionAllocWithHashElement(tHashElement *element)\n{\n    // 4 actions per Node by default\n    if (element->actions == nullptr)\n    {\n        element->actions = ccArrayNew(4);\n    }else \n    if (element->actions->num == element->actions->max)\n    {\n        ccArrayDoubleCapacity(element->actions);\n    }\n\n}\n\nvoid ActionManager::removeActionAtIndex(ssize_t index, tHashElement *element)\n{\n    Action *action = (Action*)element->actions->arr[index];\n\n    if (action == element->currentAction && (! element->currentActionSalvaged))\n    {\n        element->currentAction->retain();\n        element->currentActionSalvaged = true;\n    }\n\n    ccArrayRemoveObjectAtIndex(element->actions, index, true);\n\n    // update actionIndex in case we are in tick. looping over the actions\n    if (element->actionIndex >= index)\n    {\n        element->actionIndex--;\n    }\n\n    if (element->actions->num == 0)\n    {\n        if (_currentTarget == element)\n        {\n            _currentTargetSalvaged = true;\n        }\n        else\n        {\n            deleteHashElement(element);\n        }\n    }\n}\n\n// pause / resume\n\nvoid ActionManager::pauseTarget(Node *target)\n{\n    tHashElement *element = nullptr;\n    HASH_FIND_PTR(_targets, &target, element);\n    if (element)\n    {\n        element->paused = true;\n    }\n}\n\nvoid ActionManager::resumeTarget(Node *target)\n{\n    tHashElement *element = nullptr;\n    HASH_FIND_PTR(_targets, &target, element);\n    if (element)\n    {\n        element->paused = false;\n    }\n}\n\nVector<Node*> ActionManager::pauseAllRunningActions()\n{\n    Vector<Node*> idsWithActions;\n    \n    for (tHashElement *element=_targets; element != nullptr; element = (tHashElement *)element->hh.next) \n    {\n        if (! element->paused) \n        {\n            element->paused = true;\n            idsWithActions.pushBack(element->target);\n        }\n    }    \n    \n    return idsWithActions;\n}\n\nvoid ActionManager::resumeTargets(const Vector<Node*>& targetsToResume)\n{\n    for(const auto &node : targetsToResume) {\n        this->resumeTarget(node);\n    }\n}\n\n// run\n\nvoid ActionManager::addAction(Action *action, Node *target, bool paused)\n{\n    CCASSERT(action != nullptr, \"\");\n    CCASSERT(target != nullptr, \"\");\n\n    tHashElement *element = nullptr;\n    // we should convert it to Object*, because we save it as Object*\n    Object *tmp = target;\n    HASH_FIND_PTR(_targets, &tmp, element);\n    if (! element)\n    {\n        element = (tHashElement*)calloc(sizeof(*element), 1);\n        element->paused = paused;\n        target->retain();\n        element->target = target;\n        HASH_ADD_PTR(_targets, target, element);\n    }\n\n     actionAllocWithHashElement(element);\n \n     CCASSERT(! ccArrayContainsObject(element->actions, action), \"\");\n     ccArrayAppendObject(element->actions, action);\n \n     action->startWithTarget(target);\n}\n\n// remove\n\nvoid ActionManager::removeAllActions()\n{\n    for (tHashElement *element = _targets; element != nullptr; )\n    {\n        auto target = element->target;\n        element = (tHashElement*)element->hh.next;\n        removeAllActionsFromTarget(target);\n    }\n}\n\nvoid ActionManager::removeAllActionsFromTarget(Node *target)\n{\n    // explicit null handling\n    if (target == nullptr)\n    {\n        return;\n    }\n\n    tHashElement *element = nullptr;\n    HASH_FIND_PTR(_targets, &target, element);\n    if (element)\n    {\n        if (ccArrayContainsObject(element->actions, element->currentAction) && (! element->currentActionSalvaged))\n        {\n            element->currentAction->retain();\n            element->currentActionSalvaged = true;\n        }\n\n        ccArrayRemoveAllObjects(element->actions);\n        if (_currentTarget == element)\n        {\n            _currentTargetSalvaged = true;\n        }\n        else\n        {\n            deleteHashElement(element);\n        }\n    }\n    else\n    {\n//        CCLOG(\"cocos2d: removeAllActionsFromTarget: Target not found\");\n    }\n}\n\nvoid ActionManager::removeAction(Action *action)\n{\n    // explicit null handling\n    if (action == nullptr)\n    {\n        return;\n    }\n\n    tHashElement *element = nullptr;\n    Object *target = action->getOriginalTarget();\n    HASH_FIND_PTR(_targets, &target, element);\n    if (element)\n    {\n        auto i = ccArrayGetIndexOfObject(element->actions, action);\n        if (i != CC_INVALID_INDEX)\n        {\n            removeActionAtIndex(i, element);\n        }\n    }\n    else\n    {\n        CCLOG(\"cocos2d: removeAction: Target not found\");\n    }\n}\n\nvoid ActionManager::removeActionByTag(int tag, Node *target)\n{\n    CCASSERT(tag != Action::INVALID_TAG, \"\");\n    CCASSERT(target != nullptr, \"\");\n\n    tHashElement *element = nullptr;\n    HASH_FIND_PTR(_targets, &target, element);\n\n    if (element)\n    {\n        auto limit = element->actions->num;\n        for (int i = 0; i < limit; ++i)\n        {\n            Action *action = (Action*)element->actions->arr[i];\n\n            if (action->getTag() == (int)tag && action->getOriginalTarget() == target)\n            {\n                removeActionAtIndex(i, element);\n                break;\n            }\n        }\n    }\n}\n\n// get\n\n// XXX: Passing \"const O *\" instead of \"const O&\" because HASH_FIND_IT requries the address of a pointer\n// and, it is not possible to get the address of a reference\nAction* ActionManager::getActionByTag(int tag, const Node *target) const\n{\n    CCASSERT(tag != Action::INVALID_TAG, \"\");\n\n    tHashElement *element = nullptr;\n    HASH_FIND_PTR(_targets, &target, element);\n\n    if (element)\n    {\n        if (element->actions != nullptr)\n        {\n            auto limit = element->actions->num;\n            for (int i = 0; i < limit; ++i)\n            {\n                Action *action = (Action*)element->actions->arr[i];\n\n                if (action->getTag() == (int)tag)\n                {\n                    return action;\n                }\n            }\n        }\n        CCLOG(\"cocos2d : getActionByTag(tag = %d): Action not found\", tag);\n    }\n    else\n    {\n        // CCLOG(\"cocos2d : getActionByTag: Target not found\");\n    }\n\n    return nullptr;\n}\n\n// XXX: Passing \"const O *\" instead of \"const O&\" because HASH_FIND_IT requries the address of a pointer\n// and, it is not possible to get the address of a reference\nssize_t ActionManager::getNumberOfRunningActionsInTarget(const Node *target) const\n{\n    tHashElement *element = nullptr;\n    HASH_FIND_PTR(_targets, &target, element);\n    if (element)\n    {\n        return element->actions ? element->actions->num : 0;\n    }\n\n    return 0;\n}\n\n// main loop\nvoid ActionManager::update(float dt)\n{\n    for (tHashElement *elt = _targets; elt != nullptr; )\n    {\n        _currentTarget = elt;\n        _currentTargetSalvaged = false;\n\n        if (! _currentTarget->paused)\n        {\n            // The 'actions' MutableArray may change while inside this loop.\n            for (_currentTarget->actionIndex = 0; _currentTarget->actionIndex < _currentTarget->actions->num;\n                _currentTarget->actionIndex++)\n            {\n                _currentTarget->currentAction = (Action*)_currentTarget->actions->arr[_currentTarget->actionIndex];\n                if (_currentTarget->currentAction == nullptr)\n                {\n                    continue;\n                }\n\n                _currentTarget->currentActionSalvaged = false;\n\n                _currentTarget->currentAction->step(dt);\n\n                if (_currentTarget->currentActionSalvaged)\n                {\n                    // The currentAction told the node to remove it. To prevent the action from\n                    // accidentally deallocating itself before finishing its step, we retained\n                    // it. Now that step is done, it's safe to release it.\n                    _currentTarget->currentAction->release();\n                } else\n                if (_currentTarget->currentAction->isDone())\n                {\n                    _currentTarget->currentAction->stop();\n\n                    Action *action = _currentTarget->currentAction;\n                    // Make currentAction nil to prevent removeAction from salvaging it.\n                    _currentTarget->currentAction = nullptr;\n                    removeAction(action);\n                }\n\n                _currentTarget->currentAction = nullptr;\n            }\n        }\n\n        // elt, at this moment, is still valid\n        // so it is safe to ask this here (issue #490)\n        elt = (tHashElement*)(elt->hh.next);\n\n        // only delete currentTarget if no actions were scheduled during the cycle (issue #481)\n        if (_currentTargetSalvaged && _currentTarget->actions->num == 0)\n        {\n            deleteHashElement(_currentTarget);\n        }\n    }\n\n    // issue #635\n    _currentTarget = nullptr;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2009      Valentin Milea\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ACTION_CCACTION_MANAGER_H__\n#define __ACTION_CCACTION_MANAGER_H__\n\n#include \"CCAction.h\"\n#include \"CCVector.h\"\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\nstruct _hashElement;\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** \n @brief ActionManager is a singleton that manages all the actions.\n Normally you won't need to use this singleton directly. 99% of the cases you will use the Node interface,\n which uses this singleton.\n But there are some cases where you might need to use this singleton.\n Examples:\n    - When you want to run an action where the target is different from a Node. \n    - When you want to pause / resume the actions\n \n @since v0.8\n */\nclass CC_DLL ActionManager : public Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    ActionManager(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ActionManager(void);\n\n    // actions\n    \n    /** Adds an action with a target. \n     If the target is already present, then the action will be added to the existing target.\n     If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target.\n     When the target is paused, the queued actions won't be 'ticked'.\n     */\n    void addAction(Action *action, Node *target, bool paused);\n\n    /** Removes all actions from all the targets.\n    */\n    void removeAllActions();\n\n    /** Removes all actions from a certain target.\n     All the actions that belongs to the target will be removed.\n     */\n    void removeAllActionsFromTarget(Node *target);\n\n    /** Removes an action given an action reference.\n    */\n    void removeAction(Action *action);\n\n    /** Removes an action given its tag and the target */\n    void removeActionByTag(int tag, Node *target);\n\n    /** Gets an action given its tag an a target\n     @return the Action the with the given tag\n     */\n    Action* getActionByTag(int tag, const Node *target) const;\n\n    /** Returns the numbers of actions that are running in a certain target. \n     * Composable actions are counted as 1 action. Example:\n     * - If you are running 1 Sequence of 7 actions, it will return 1.\n     * - If you are running 7 Sequences of 2 actions, it will return 7.\n     */\n    ssize_t getNumberOfRunningActionsInTarget(const Node *target) const;\n\n    /** @deprecated use getNumberOfRunningActionsInTarget() instead */\n    CC_DEPRECATED_ATTRIBUTE inline ssize_t numberOfRunningActionsInTarget(Node *target) const { return getNumberOfRunningActionsInTarget(target); }\n\n    /** Pauses the target: all running actions and newly added actions will be paused.\n    */\n    void pauseTarget(Node *target);\n\n    /** Resumes the target. All queued actions will be resumed.\n    */\n    void resumeTarget(Node *target);\n    \n    /** Pauses all running actions, returning a list of targets whose actions were paused.\n     */\n    Vector<Node*> pauseAllRunningActions();\n    \n    /** Resume a set of targets (convenience function to reverse a pauseAllRunningActions call)\n     */\n    void resumeTargets(const Vector<Node*>& targetsToResume);\n\nprotected:\n    // declared in ActionManager.m\n\n    void removeActionAtIndex(ssize_t index, struct _hashElement *element);\n    void deleteHashElement(struct _hashElement *element);\n    void actionAllocWithHashElement(struct _hashElement *element);\n    void update(float dt);\n\nprotected:\n    struct _hashElement    *_targets;\n    struct _hashElement    *_currentTarget;\n    bool            _currentTargetSalvaged;\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTION_CCACTION_MANAGER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionPageTurn3D.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      Sindesso Pty Ltd http://www.sindesso.com/\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCActionPageTurn3D.h\"\n\nNS_CC_BEGIN\n\nPageTurn3D* PageTurn3D::create(float duration, const Size& gridSize)\n{\n    PageTurn3D *action = new PageTurn3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nPageTurn3D *PageTurn3D::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new PageTurn3D();\n\ta->initWithDuration(_duration, _gridSize);\n\ta->autorelease();\n\treturn a;\n}\n\n/*\n * Update each tick\n * Time is the percentage of the way through the duration\n */\nvoid PageTurn3D::update(float time)\n{\n    float tt = MAX(0, time - 0.25f);\n    float deltaAy = (tt * tt * 500);\n    float ay = -100 - deltaAy;\n    \n    float deltaTheta = - (float) M_PI_2 * sqrtf( time) ;\n    float theta = /*0.01f */ + (float) M_PI_2 +deltaTheta;\n    \n    float sinTheta = sinf(theta);\n    float cosTheta = cosf(theta);\n    \n    for (int i = 0; i <= _gridSize.width; ++i)\n    {\n        for (int j = 0; j <= _gridSize.height; ++j)\n        {\n            // Get original vertex\n            Vertex3F p = getOriginalVertex(Point(i ,j));\n            \n            float R = sqrtf((p.x * p.x) + ((p.y - ay) * (p.y - ay)));\n            float r = R * sinTheta;\n            float alpha = asinf( p.x / R );\n            float beta = alpha / sinTheta;\n            float cosBeta = cosf( beta );\n            \n            // If beta > PI then we've wrapped around the cone\n            // Reduce the radius to stop these points interfering with others\n            if (beta <= M_PI)\n            {\n                p.x = ( r * sinf(beta));\n            }\n            else\n            {\n                // Force X = 0 to stop wrapped\n                // points\n                p.x = 0;\n            }\n\n            p.y = ( R + ay - ( r * (1 - cosBeta) * sinTheta));\n\n            // We scale z here to avoid the animation being\n            // too much bigger than the screen due to perspective transform\n            p.z = (r * ( 1 - cosBeta ) * cosTheta) / 7;// \"100\" didn't work for\n\n            //    Stop z coord from dropping beneath underlying page in a transition\n            // issue #751\n            if( p.z < 0.5f )\n            {\n                p.z = 0.5f;\n            }\n            \n            // Set new coords\n            setVertex(Point(i, j), p);\n            \n        }\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionPageTurn3D.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      Sindesso Pty Ltd http://www.sindesso.com/\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __ACTION_CCPAGETURN3D_ACTION_H__\n#define __ACTION_CCPAGETURN3D_ACTION_H__\n\n#include \"CCActionGrid3D.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/**\n @brief This action simulates a page turn from the bottom right hand corner of the screen.\n It's not much use by itself but is used by the PageTurnTransition.\n \n Based on an original paper by L Hong et al.\n http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html\n  \n @since v0.8.2\n */\nclass CC_DLL PageTurn3D : public Grid3DAction\n{\npublic:\n    /** create the action */\n    static PageTurn3D* create(float duration, const Size& gridSize);\n\n    // Overrides\n\tvirtual PageTurn3D* clone() const override;\n    virtual void update(float time) override;\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTION_CCPAGETURN3D_ACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionProgressTimer.cpp",
    "content": "/****************************************************************************\nCopyright (C) 2010      Lam Pham\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCActionProgressTimer.h\"\n#include \"CCProgressTimer.h\"\n\nNS_CC_BEGIN\n\n#define kProgressTimerCast ProgressTimer*\n\n// implementation of ProgressTo\n\nProgressTo* ProgressTo::create(float duration, float percent)\n{\n    ProgressTo *progressTo = new ProgressTo();\n    progressTo->initWithDuration(duration, percent);\n    progressTo->autorelease();\n\n    return progressTo;\n}\n\nbool ProgressTo::initWithDuration(float duration, float percent)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _to = percent;\n\n        return true;\n    }\n\n    return false;\n}\n\nProgressTo* ProgressTo::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new ProgressTo();\n    a->initWithDuration(_duration, _to);\n\ta->autorelease();\n\treturn a;\n}\n\nProgressTo* ProgressTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() not supported in ProgressTo\");\n\treturn nullptr;\n}\n\nvoid ProgressTo::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n    _from = ((kProgressTimerCast)(target))->getPercentage();\n\n    // XXX: Is this correct ?\n    // Adding it to support Repeat\n    if (_from == 100)\n    {\n        _from = 0;\n    }\n}\n\nvoid ProgressTo::update(float time)\n{\n    ((kProgressTimerCast)(_target))->setPercentage(_from + (_to - _from) * time);\n}\n\n// implementation of ProgressFromTo\n\nProgressFromTo* ProgressFromTo::create(float duration, float fromPercentage, float toPercentage)\n{\n    ProgressFromTo *progressFromTo = new ProgressFromTo();\n    progressFromTo->initWithDuration(duration, fromPercentage, toPercentage);\n    progressFromTo->autorelease();\n\n    return progressFromTo;\n}\n\nbool ProgressFromTo::initWithDuration(float duration, float fromPercentage, float toPercentage)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _to = toPercentage;\n        _from = fromPercentage;\n\n        return true;\n    }\n\n    return false;\n}\n\nProgressFromTo* ProgressFromTo::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new ProgressFromTo();\n\ta->initWithDuration(_duration, _from, _to);\n\ta->autorelease();\n\treturn a;\n}\n\n\nProgressFromTo* ProgressFromTo::reverse(void) const\n{\n    return ProgressFromTo::create(_duration, _to, _from);\n}\n\nvoid ProgressFromTo::startWithTarget(Node *target)\n{\n    ActionInterval::startWithTarget(target);\n}\n\nvoid ProgressFromTo::update(float time)\n{\n    ((kProgressTimerCast)(_target))->setPercentage(_from + (_to - _from) * time);\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionProgressTimer.h",
    "content": "/****************************************************************************\nCopyright (C) 2010      Lam Pham\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __ACTION_CCPROGRESS_TIMER_H__\n#define __ACTION_CCPROGRESS_TIMER_H__\n\n#include \"CCActionInterval.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/**\n@brief Progress to percentage\n@since v0.99.1\n*/\nclass CC_DLL ProgressTo : public ActionInterval\n{\npublic:\n    /** Creates and initializes with a duration and a percent */\n    static ProgressTo* create(float duration, float percent);\n\n    //\n    // Overrides\n    //\n\tvirtual ProgressTo* clone() const override;\n\tvirtual ProgressTo* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    ProgressTo() {}\n    virtual ~ProgressTo() {}\n    /** Initializes with a duration and a percent */\n    bool initWithDuration(float duration, float percent);\n\n    float _to;\n    float _from;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ProgressTo);\n};\n\n/**\n@brief Progress from a percentage to another percentage\n@since v0.99.1\n*/\nclass CC_DLL ProgressFromTo : public ActionInterval\n{\npublic:\n    /** Creates and initializes the action with a duration, a \"from\" percentage and a \"to\" percentage */\n    static ProgressFromTo* create(float duration, float fromPercentage, float toPercentage);\n\n    //\n    // Overrides\n    //\n\tvirtual ProgressFromTo* clone() const override;\n\tvirtual ProgressFromTo* reverse(void) const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    ProgressFromTo() {}\n    virtual ~ProgressFromTo() {}\n    /** Initializes the action with a duration, a \"from\" percentage and a \"to\" percentage */\n    bool initWithDuration(float duration, float fromPercentage, float toPercentage);\n\n    float _to;\n    float _from;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ProgressFromTo);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTION_CCPROGRESS_TIMER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionTiledGrid.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCActionTiledGrid.h\"\n#include \"CCDirector.h\"\n#include \"ccMacros.h\"\n#include \"CCGrid.h\"\n#include \"CCNodeGrid.h\"\n#include <stdlib.h>\n\nNS_CC_BEGIN\n\nstruct Tile\n{\n    Point    position;\n    Point    startPosition;\n    Size    delta;\n};\n\n// implementation of ShakyTiles3D\n\nShakyTiles3D* ShakyTiles3D::create(float duration, const Size& gridSize, int range, bool shakeZ)\n{\n    ShakyTiles3D *action = new ShakyTiles3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, range, shakeZ))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool ShakyTiles3D::initWithDuration(float duration, const Size& gridSize, int range, bool shakeZ)\n{\n    if (TiledGrid3DAction::initWithDuration(duration, gridSize))\n    {\n        _randrange = range;\n        _shakeZ = shakeZ;\n\n        return true;\n    }\n\n    return false;\n}\n\nShakyTiles3D* ShakyTiles3D::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new ShakyTiles3D();\n    a->initWithDuration(_duration, _gridSize, _randrange, _shakeZ);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid ShakyTiles3D::update(float time)\n{\n    CC_UNUSED_PARAM(time);\n    int i, j;\n\n    for (i = 0; i < _gridSize.width; ++i)\n    {\n        for (j = 0; j < _gridSize.height; ++j)\n        {\n            Quad3 coords = getOriginalTile(Point(i, j));\n\n            // X\n            coords.bl.x += ( rand() % (_randrange*2) ) - _randrange;\n            coords.br.x += ( rand() % (_randrange*2) ) - _randrange;\n            coords.tl.x += ( rand() % (_randrange*2) ) - _randrange;\n            coords.tr.x += ( rand() % (_randrange*2) ) - _randrange;\n\n            // Y\n            coords.bl.y += ( rand() % (_randrange*2) ) - _randrange;\n            coords.br.y += ( rand() % (_randrange*2) ) - _randrange;\n            coords.tl.y += ( rand() % (_randrange*2) ) - _randrange;\n            coords.tr.y += ( rand() % (_randrange*2) ) - _randrange;\n\n            if (_shakeZ)\n            {\n                coords.bl.z += ( rand() % (_randrange*2) ) - _randrange;\n                coords.br.z += ( rand() % (_randrange*2) ) - _randrange;\n                coords.tl.z += ( rand() % (_randrange*2) ) - _randrange;\n                coords.tr.z += ( rand() % (_randrange*2) ) - _randrange;\n            }\n                        \n            setTile(Point(i, j), coords);\n        }\n    }\n}\n\n// implementation of ShatteredTiles3D\n\nShatteredTiles3D* ShatteredTiles3D::create(float duration, const Size& gridSize, int range, bool shatterZ)\n{\n    ShatteredTiles3D *action = new ShatteredTiles3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, range, shatterZ))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool ShatteredTiles3D::initWithDuration(float duration, const Size& gridSize, int range, bool shatterZ)\n{\n    if (TiledGrid3DAction::initWithDuration(duration, gridSize))\n    {\n        _once = false;\n        _randrange = range;\n        _shatterZ = shatterZ;\n\n        return true;\n    }\n\n    return false;\n}\n\nShatteredTiles3D* ShatteredTiles3D::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new ShatteredTiles3D();\n\ta->initWithDuration(_duration, _gridSize, _randrange, _shatterZ);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid ShatteredTiles3D::update(float time)\n{\n    CC_UNUSED_PARAM(time);\n    int i, j;\n\n    if (_once == false)\n    {\n        for (i = 0; i < _gridSize.width; ++i)\n        {\n            for (j = 0; j < _gridSize.height; ++j)\n            {\n                Quad3 coords = getOriginalTile(Point(i ,j));\n                \n                // X\n                coords.bl.x += ( rand() % (_randrange*2) ) - _randrange;\n                coords.br.x += ( rand() % (_randrange*2) ) - _randrange;\n                coords.tl.x += ( rand() % (_randrange*2) ) - _randrange;\n                coords.tr.x += ( rand() % (_randrange*2) ) - _randrange;\n                \n                // Y\n                coords.bl.y += ( rand() % (_randrange*2) ) - _randrange;\n                coords.br.y += ( rand() % (_randrange*2) ) - _randrange;\n                coords.tl.y += ( rand() % (_randrange*2) ) - _randrange;\n                coords.tr.y += ( rand() % (_randrange*2) ) - _randrange;\n\n                if (_shatterZ) \n                {\n                    coords.bl.z += ( rand() % (_randrange*2) ) - _randrange;\n                    coords.br.z += ( rand() % (_randrange*2) ) - _randrange;                \n                    coords.tl.z += ( rand() % (_randrange*2) ) - _randrange;\n                    coords.tr.z += ( rand() % (_randrange*2) ) - _randrange;\n                }\n                \n                setTile(Point(i, j), coords);\n            }\n        }\n        \n        _once = true;\n    }\n}\n\n// implementation of ShuffleTiles\n\nShuffleTiles* ShuffleTiles::create(float duration, const Size& gridSize, unsigned int seed)\n{\n    ShuffleTiles *action = new ShuffleTiles();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, seed))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool ShuffleTiles::initWithDuration(float duration, const Size& gridSize, unsigned int seed)\n{\n    if (TiledGrid3DAction::initWithDuration(duration, gridSize))\n    {\n        _seed = seed;\n        _tilesOrder = nullptr;\n        _tiles = nullptr;\n\n        return true;\n    }\n\n    return false;\n}\n\nShuffleTiles* ShuffleTiles::clone() const\n{\n\t// no copy constructor\n\tauto a = new ShuffleTiles();\n\ta->initWithDuration(_duration, _gridSize, _seed);\n\ta->autorelease();\n\treturn a;\n}\n\nShuffleTiles::~ShuffleTiles(void)\n{\n    CC_SAFE_DELETE_ARRAY(_tilesOrder);\n    CC_SAFE_DELETE_ARRAY(_tiles);\n}\n\nvoid ShuffleTiles::shuffle(unsigned int *array, unsigned int len)\n{\n    int i;\n    for( i = len - 1; i >= 0; i-- )\n    {\n        unsigned int j = rand() % (i+1);\n        unsigned int v = array[i];\n        array[i] = array[j];\n        array[j] = v;\n    }\n}\n\nSize ShuffleTiles::getDelta(const Size& pos) const\n{\n    Point    pos2;\n\n    unsigned int idx = pos.width * _gridSize.height + pos.height;\n\n    pos2.x = (float)(_tilesOrder[idx] / (int)_gridSize.height);\n    pos2.y = (float)(_tilesOrder[idx] % (int)_gridSize.height);\n\n    return Size((int)(pos2.x - pos.width), (int)(pos2.y - pos.height));\n}\n\nvoid ShuffleTiles::placeTile(const Point& pos, Tile *t)\n{\n    Quad3 coords = getOriginalTile(pos);\n\n    Point step = _gridNodeTarget->getGrid()->getStep();\n    coords.bl.x += (int)(t->position.x * step.x);\n    coords.bl.y += (int)(t->position.y * step.y);\n\n    coords.br.x += (int)(t->position.x * step.x);\n    coords.br.y += (int)(t->position.y * step.y);\n\n    coords.tl.x += (int)(t->position.x * step.x);\n    coords.tl.y += (int)(t->position.y * step.y);\n\n    coords.tr.x += (int)(t->position.x * step.x);\n    coords.tr.y += (int)(t->position.y * step.y);\n\n    setTile(pos, coords);\n}\n\nvoid ShuffleTiles::startWithTarget(Node *target)\n{\n    TiledGrid3DAction::startWithTarget(target);\n\n    if (_seed != (unsigned int)-1)\n    {\n        srand(_seed);\n    }\n\n    _tilesCount = _gridSize.width * _gridSize.height;\n    _tilesOrder = new unsigned int[_tilesCount];\n    int i, j;\n    unsigned int k;\n\n    /**\n     * Use k to loop. Because _tilesCount is unsigned int,\n     * and i is used later for int.\n     */\n    for (k = 0; k < _tilesCount; ++k)\n    {\n        _tilesOrder[k] = k;\n    }\n\n    shuffle(_tilesOrder, _tilesCount);\n\n    _tiles = (struct Tile *)new Tile[_tilesCount];\n    Tile *tileArray = (Tile*) _tiles;\n\n    for (i = 0; i < _gridSize.width; ++i)\n    {\n        for (j = 0; j < _gridSize.height; ++j)\n        {\n            tileArray->position = Point((float)i, (float)j);\n            tileArray->startPosition = Point((float)i, (float)j);\n            tileArray->delta = getDelta(Size(i, j));\n            ++tileArray;\n        }\n    }\n}\n\nvoid ShuffleTiles::update(float time)\n{\n    int i, j;\n\n    Tile *tileArray = (Tile*)_tiles;\n\n    for (i = 0; i < _gridSize.width; ++i)\n    {\n        for (j = 0; j < _gridSize.height; ++j)\n        {\n            tileArray->position = Point((float)tileArray->delta.width, (float)tileArray->delta.height) * time;\n            placeTile(Point(i, j), tileArray);\n            ++tileArray;\n        }\n    }\n}\n\n// implementation of FadeOutTRTiles\n\nFadeOutTRTiles* FadeOutTRTiles::create(float duration, const Size& gridSize)\n{\n    FadeOutTRTiles *action = new FadeOutTRTiles();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nFadeOutTRTiles* FadeOutTRTiles::clone() const\n{\n\t// no copy constructor\n\tauto a = new FadeOutTRTiles();\n\ta->initWithDuration(_duration, _gridSize);\n\ta->autorelease();\n\treturn a;\n}\n\nfloat FadeOutTRTiles::testFunc(const Size& pos, float time)\n{\n    Point n = Point((float)_gridSize.width, (float)_gridSize.height) * time;\n    if ((n.x + n.y) == 0.0f)\n    {\n        return 1.0f;\n    }\n\n    return powf((pos.width + pos.height) / (n.x + n.y), 6);\n}\n\nvoid FadeOutTRTiles::turnOnTile(const Point& pos)\n{\n    setTile(pos, getOriginalTile(pos));\n}\n\nvoid FadeOutTRTiles::turnOffTile(const Point& pos)\n{\n    Quad3 coords;\n    memset(&coords, 0, sizeof(Quad3));\n    setTile(pos, coords);\n}\n\nvoid FadeOutTRTiles::transformTile(const Point& pos, float distance)\n{\n    Quad3 coords = getOriginalTile(pos);\n    Point step = _gridNodeTarget->getGrid()->getStep();\n\n    coords.bl.x += (step.x / 2) * (1.0f - distance);\n    coords.bl.y += (step.y / 2) * (1.0f - distance);\n\n    coords.br.x -= (step.x / 2) * (1.0f - distance);\n    coords.br.y += (step.y / 2) * (1.0f - distance);\n\n    coords.tl.x += (step.x / 2) * (1.0f - distance);\n    coords.tl.y -= (step.y / 2) * (1.0f - distance);\n\n    coords.tr.x -= (step.x / 2) * (1.0f - distance);\n    coords.tr.y -= (step.y / 2) * (1.0f - distance);\n\n    setTile(pos, coords);\n}\n\nvoid FadeOutTRTiles::update(float time)\n{\n    int i, j;\n\n    for (i = 0; i < _gridSize.width; ++i)\n    {\n        for (j = 0; j < _gridSize.height; ++j)\n        {\n            float distance = testFunc(Size(i, j), time);\n            if ( distance == 0 )\n            {\n                turnOffTile(Point(i, j));\n            } else \n            if (distance < 1)\n            {\n                transformTile(Point(i, j), distance);\n            }\n            else\n            {\n                turnOnTile(Point(i, j));\n            }\n        }\n    }\n}\n\n// implementation of FadeOutBLTiles\n\nFadeOutBLTiles* FadeOutBLTiles::create(float duration, const Size& gridSize)\n{\n    FadeOutBLTiles *action = new FadeOutBLTiles();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nFadeOutBLTiles* FadeOutBLTiles::clone() const\n{\n\t// no copy constructor\n\tauto a = new FadeOutBLTiles();\n\ta->initWithDuration(_duration, _gridSize);\n\ta->autorelease();\n\treturn a;\n}\n\nfloat FadeOutBLTiles::testFunc(const Size& pos, float time)\n{\n    Point n = Point((float)_gridSize.width, (float)_gridSize.height) * (1.0f - time);\n    if ((pos.width + pos.height) == 0)\n    {\n        return 1.0f;\n    }\n\n    return powf((n.x + n.y) / (pos.width + pos.height), 6);\n}\n\n// implementation of FadeOutUpTiles\n\nFadeOutUpTiles* FadeOutUpTiles::create(float duration, const Size& gridSize)\n{\n    FadeOutUpTiles *action = new FadeOutUpTiles();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nFadeOutUpTiles* FadeOutUpTiles::clone() const\n{\n\t// no copy constructor\n\tauto a = new FadeOutUpTiles();\n\ta->initWithDuration(_duration, _gridSize);\n\ta->autorelease();\n\treturn a;\n}\n\nfloat FadeOutUpTiles::testFunc(const Size& pos, float time)\n{\n    Point n = Point((float)_gridSize.width, (float)_gridSize.height) * time;\n    if (n.y == 0.0f)\n    {\n        return 1.0f;\n    }\n\n    return powf(pos.height / n.y, 6);\n}\n\nvoid FadeOutUpTiles::transformTile(const Point& pos, float distance)\n{\n    Quad3 coords = getOriginalTile(pos);\n    Point step = _gridNodeTarget->getGrid()->getStep();\n\n    coords.bl.y += (step.y / 2) * (1.0f - distance);\n    coords.br.y += (step.y / 2) * (1.0f - distance);\n    coords.tl.y -= (step.y / 2) * (1.0f - distance);\n    coords.tr.y -= (step.y / 2) * (1.0f - distance);\n\n    setTile(pos, coords);\n}\n\n// implementation of FadeOutDownTiles\n\nFadeOutDownTiles* FadeOutDownTiles::create(float duration, const Size& gridSize)\n{\n    FadeOutDownTiles *action = new FadeOutDownTiles();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nFadeOutDownTiles* FadeOutDownTiles::clone() const\n{\n\t// no copy constructor\n\tauto a = new FadeOutDownTiles();\n\ta->initWithDuration(_duration, _gridSize);\n\ta->autorelease();\n\treturn a;\n}\n\nfloat FadeOutDownTiles::testFunc(const Size& pos, float time)\n{\n    Point n = Point((float)_gridSize.width, (float)_gridSize.height) * (1.0f - time);\n    if (pos.height == 0)\n    {\n        return 1.0f;\n    }\n\n    return powf(n.y / pos.height, 6);\n}\n\n// implementation of TurnOffTiles\n\nTurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize)\n{\n    TurnOffTiles* pAction = new TurnOffTiles();\n    if (pAction->initWithDuration(duration, gridSize, 0))\n    {\n        pAction->autorelease();\n    }\n    else\n    {\n        CC_SAFE_RELEASE_NULL(pAction);\n    }\n    return pAction;\n}\n\nTurnOffTiles* TurnOffTiles::create(float duration, const Size& gridSize, unsigned int seed)\n{\n    TurnOffTiles *action = new TurnOffTiles();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, seed))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool TurnOffTiles::initWithDuration(float duration, const Size& gridSize, unsigned int seed)\n{\n    if (TiledGrid3DAction::initWithDuration(duration, gridSize))\n    {\n        _seed = seed;\n        _tilesOrder = nullptr;\n\n        return true;\n    }\n\n    return false;\n}\n\nTurnOffTiles* TurnOffTiles::clone() const\n{\n\t// no copy constructor\n\tauto a = new TurnOffTiles();\n    a->initWithDuration(_duration, _gridSize, _seed );\n\ta->autorelease();\n\treturn a;\n}\n\nTurnOffTiles::~TurnOffTiles(void)\n{\n    CC_SAFE_DELETE_ARRAY(_tilesOrder);\n}\n\nvoid TurnOffTiles::shuffle(unsigned int *array, unsigned int len)\n{\n    int i;\n    for (i = len - 1; i >= 0; i--)\n    {\n        unsigned int j = rand() % (i+1);\n        unsigned int v = array[i];\n        array[i] = array[j];\n        array[j] = v;\n    }\n}\n\nvoid TurnOffTiles::turnOnTile(const Point& pos)\n{\n    setTile(pos, getOriginalTile(pos));\n}\n\nvoid TurnOffTiles::turnOffTile(const Point& pos)\n{\n    Quad3 coords;\n\n    memset(&coords, 0, sizeof(Quad3));\n    setTile(pos, coords);\n}\n\nvoid TurnOffTiles::startWithTarget(Node *target)\n{\n    unsigned int i;\n\n    TiledGrid3DAction::startWithTarget(target);\n\n    if (_seed != (unsigned int)-1)\n    {\n        srand(_seed);\n    }\n\n    _tilesCount = _gridSize.width * _gridSize.height;\n    _tilesOrder = new unsigned int[_tilesCount];\n\n    for (i = 0; i < _tilesCount; ++i)\n    {\n        _tilesOrder[i] = i;\n    }\n\n    shuffle(_tilesOrder, _tilesCount);\n}\n\nvoid TurnOffTiles::update(float time)\n{\n    unsigned int i, l, t;\n\n    l = (unsigned int)(time * (float)_tilesCount);\n\n    for( i = 0; i < _tilesCount; i++ )\n    {\n        t = _tilesOrder[i];\n        Point tilePos = Point( (unsigned int)(t / _gridSize.height), t % (unsigned int)_gridSize.height );\n\n        if ( i < l )\n        {\n            turnOffTile(tilePos);\n        }\n        else\n        {\n            turnOnTile(tilePos);\n        }\n    }\n}\n\n// implementation of WavesTiles3D\n\nWavesTiles3D* WavesTiles3D::create(float duration, const Size& gridSize, unsigned int waves, float amplitude)\n{\n    WavesTiles3D *action = new WavesTiles3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, waves, amplitude))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool WavesTiles3D::initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude)\n{\n    if (TiledGrid3DAction::initWithDuration(duration, gridSize))\n    {\n        _waves = waves;\n        _amplitude = amplitude;\n        _amplitudeRate = 1.0f;\n\n        return true;\n    }\n\n    return false;\n}\n\nWavesTiles3D* WavesTiles3D::clone() const\n{\n\t// no copy constructor\n\tauto a = new WavesTiles3D();\n    a->initWithDuration(_duration, _gridSize, _waves, _amplitude);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid WavesTiles3D::update(float time)\n{\n    int i, j;\n\n    for( i = 0; i < _gridSize.width; i++ )\n    {\n        for( j = 0; j < _gridSize.height; j++ )\n        {\n            Quad3 coords = getOriginalTile(Point(i, j));\n\n            coords.bl.z = (sinf(time * (float)M_PI  *_waves * 2 + \n                (coords.bl.y+coords.bl.x) * .01f) * _amplitude * _amplitudeRate );\n            coords.br.z    = coords.bl.z;\n            coords.tl.z = coords.bl.z;\n            coords.tr.z = coords.bl.z;\n\n            setTile(Point(i, j), coords);\n        }\n    }\n}\n\n// implementation of JumpTiles3D\n\nJumpTiles3D* JumpTiles3D::create(float duration, const Size& gridSize, unsigned int numberOfJumps, float amplitude)\n{\n    JumpTiles3D *action = new JumpTiles3D();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, gridSize, numberOfJumps, amplitude))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool JumpTiles3D::initWithDuration(float duration, const Size& gridSize, unsigned int numberOfJumps, float amplitude)\n{\n    if (TiledGrid3DAction::initWithDuration(duration, gridSize))\n    {\n        _jumps = numberOfJumps;\n        _amplitude = amplitude;\n        _amplitudeRate = 1.0f;\n\n        return true;\n    }\n\n    return false;\n}\n\nJumpTiles3D* JumpTiles3D::clone() const\n{\n\t// no copy constructor\n\tauto a = new JumpTiles3D();\n    a->initWithDuration(_duration, _gridSize, _jumps, _amplitude);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid JumpTiles3D::update(float time)\n{\n    int i, j;\n\n    float sinz =  (sinf((float)M_PI * time * _jumps * 2) * _amplitude * _amplitudeRate );\n    float sinz2 = (sinf((float)M_PI * (time * _jumps * 2 + 1)) * _amplitude * _amplitudeRate );\n\n    for( i = 0; i < _gridSize.width; i++ )\n    {\n        for( j = 0; j < _gridSize.height; j++ )\n        {\n            Quad3 coords = getOriginalTile(Point(i, j));\n\n            if ( ((i+j) % 2) == 0 )\n            {\n                coords.bl.z += sinz;\n                coords.br.z += sinz;\n                coords.tl.z += sinz;\n                coords.tr.z += sinz;\n            }\n            else\n            {\n                coords.bl.z += sinz2;\n                coords.br.z += sinz2;\n                coords.tl.z += sinz2;\n                coords.tr.z += sinz2;\n            }\n\n            setTile(Point(i, j), coords);\n        }\n    }\n}\n\n// implementation of SplitRows\n\nSplitRows* SplitRows::create(float duration, unsigned int nRows)\n{\n    SplitRows *action = new SplitRows();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, nRows))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool SplitRows::initWithDuration(float duration, unsigned int rows)\n{\n    _rows = rows;\n\n    return TiledGrid3DAction::initWithDuration(duration, Size(1, rows));\n}\n\nSplitRows* SplitRows::clone() const\n{\n\t// no copy constructor\n\tauto a = new SplitRows();\n    a->initWithDuration(_duration, _rows);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid SplitRows::startWithTarget(Node *target)\n{\n    TiledGrid3DAction::startWithTarget(target);\n    _winSize = Director::getInstance()->getWinSizeInPixels();\n}\n\nvoid SplitRows::update(float time)\n{\n    unsigned int j;\n\n    for (j = 0; j < _gridSize.height; ++j)\n    {\n        Quad3 coords = getOriginalTile(Point(0, j));\n        float    direction = 1;\n\n        if ( (j % 2 ) == 0 )\n        {\n            direction = -1;\n        }\n\n        coords.bl.x += direction * _winSize.width * time;\n        coords.br.x += direction * _winSize.width * time;\n        coords.tl.x += direction * _winSize.width * time;\n        coords.tr.x += direction * _winSize.width * time;\n\n        setTile(Point(0, j), coords);\n    }\n}\n\n// implementation of SplitCols\n\nSplitCols* SplitCols::create(float duration, unsigned int cols)\n{\n    SplitCols *action = new SplitCols();\n\n    if (action)\n    {\n        if (action->initWithDuration(duration, cols))\n        {\n            action->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(action);\n        }\n    }\n\n    return action;\n}\n\nbool SplitCols::initWithDuration(float duration, unsigned int cols)\n{\n    _cols = cols;\n    return TiledGrid3DAction::initWithDuration(duration, Size(cols, 1));\n}\n\nSplitCols* SplitCols::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new SplitCols();\n    a->initWithDuration(_duration, _cols);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid SplitCols::startWithTarget(Node *target)\n{\n    TiledGrid3DAction::startWithTarget(target);\n    _winSize = Director::getInstance()->getWinSizeInPixels();\n}\n\nvoid SplitCols::update(float time)\n{\n    unsigned int i;\n\n    for (i = 0; i < _gridSize.width; ++i)\n    {\n        Quad3 coords = getOriginalTile(Point(i, 0));\n        float    direction = 1;\n\n        if ( (i % 2 ) == 0 )\n        {\n            direction = -1;\n        }\n\n        coords.bl.y += direction * _winSize.height * time;\n        coords.br.y += direction * _winSize.height * time;\n        coords.tl.y += direction * _winSize.height * time;\n        coords.tr.y += direction * _winSize.height * time;\n\n        setTile(Point(i, 0), coords);\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionTiledGrid.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __ACTION_CCTILEDGRID_ACTION_H__\n#define __ACTION_CCTILEDGRID_ACTION_H__\n\n#include \"CCActionGrid.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\n/** @brief ShakyTiles3D action */\nclass CC_DLL ShakyTiles3D : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration */\n    static ShakyTiles3D* create(float duration, const Size& gridSize, int range, bool shakeZ);\n\n    // Override\n\tvirtual ShakyTiles3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    ShakyTiles3D() {}\n    virtual ~ShakyTiles3D() {}\n    /** initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration */\n    bool initWithDuration(float duration, const Size& gridSize, int range, bool shakeZ);\n\n    int _randrange;\n    bool _shakeZ;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ShakyTiles3D);\n};\n\n/** @brief ShatteredTiles3D action */\nclass CC_DLL ShatteredTiles3D : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */\n    static ShatteredTiles3D* create(float duration, const Size& gridSize, int range, bool shatterZ);\n\n    // Override\n\tvirtual ShatteredTiles3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    ShatteredTiles3D() {}\n    virtual ~ShatteredTiles3D() {}\n    /** initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration */\n    bool initWithDuration(float duration, const Size& gridSize, int range, bool shatterZ);\n\n    int _randrange;\n    bool _once;\n    bool _shatterZ;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ShatteredTiles3D);\n};\n\nstruct Tile;\n/** @brief ShuffleTiles action\n Shuffle the tiles in random order\n */\nclass CC_DLL ShuffleTiles : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with a random seed, the grid size and the duration */\n    static ShuffleTiles* create(float duration, const Size& gridSize, unsigned int seed);\n\n    void shuffle(unsigned int *array, unsigned int len);\n    Size getDelta(const Size& pos) const;\n    void placeTile(const Point& pos, Tile *t);\n\n    // Overrides\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\tvirtual ShuffleTiles* clone() const override;\n\nprotected:\n    ShuffleTiles() {}\n    virtual ~ShuffleTiles();\n    /** initializes the action with a random seed, the grid size and the duration */\n    bool initWithDuration(float duration, const Size& gridSize, unsigned int seed);\n\n    unsigned int _seed;\n    unsigned int _tilesCount;\n    unsigned int* _tilesOrder;\n    Tile* _tiles;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ShuffleTiles);\n};\n\n/** @brief FadeOutTRTiles action\n Fades out the tiles in a Top-Right direction\n */\nclass CC_DLL FadeOutTRTiles : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with the grid size and the duration */\n    static FadeOutTRTiles* create(float duration, const Size& gridSize);\n\n    virtual float testFunc(const Size& pos, float time);\n    void turnOnTile(const Point& pos);\n    void turnOffTile(const Point& pos);\n    virtual void transformTile(const Point& pos, float distance);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual FadeOutTRTiles* clone() const override;\n\nprotected:\n    FadeOutTRTiles() {}\n    virtual ~FadeOutTRTiles() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FadeOutTRTiles);\n};\n\n/** @brief FadeOutBLTiles action.\n Fades out the tiles in a Bottom-Left direction\n */\nclass CC_DLL FadeOutBLTiles : public FadeOutTRTiles\n{\npublic:\n    /** creates the action with the grid size and the duration */\n    static FadeOutBLTiles* create(float duration, const Size& gridSize);\n\n    // Overrides\n    virtual float testFunc(const Size& pos, float time) override;\n\tvirtual FadeOutBLTiles* clone() const override;\n\nprotected:\n    FadeOutBLTiles() {}\n    virtual ~FadeOutBLTiles() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FadeOutBLTiles);\n};\n\n/** @brief FadeOutUpTiles action.\n Fades out the tiles in upwards direction\n */\nclass CC_DLL FadeOutUpTiles : public FadeOutTRTiles\n{\npublic:\n    /** creates the action with the grid size and the duration */\n    static FadeOutUpTiles* create(float duration, const Size& gridSize);\n\n    virtual void transformTile(const Point& pos, float distance);\n\n    // Overrides\n\tvirtual FadeOutUpTiles* clone() const override;\n    virtual float testFunc(const Size& pos, float time) override;\n\nprotected:\n    FadeOutUpTiles() {}\n    virtual ~FadeOutUpTiles() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FadeOutUpTiles);\n};\n\n/** @brief FadeOutDownTiles action.\n Fades out the tiles in downwards direction\n */\nclass CC_DLL FadeOutDownTiles : public FadeOutUpTiles\n{\npublic:\n    /** creates the action with the grid size and the duration */\n    static FadeOutDownTiles* create(float duration, const Size& gridSize);\n\n    // Overrides\n\tvirtual FadeOutDownTiles* clone() const override;\n    virtual float testFunc(const Size& pos, float time) override;\n\nprotected:\n    FadeOutDownTiles() {}\n    virtual ~FadeOutDownTiles() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(FadeOutDownTiles);\n};\n\n/** @brief TurnOffTiles action.\n Turn off the files in random order\n */\nclass CC_DLL TurnOffTiles : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with the grid size and the duration */\n    static TurnOffTiles* create(float duration, const Size& gridSize);\n    /** creates the action with a random seed, the grid size and the duration */\n    static TurnOffTiles* create(float duration, const Size& gridSize, unsigned int seed);\n\n    void shuffle(unsigned int *array, unsigned int len);\n    void turnOnTile(const Point& pos);\n    void turnOffTile(const Point& pos);\n\n    // Overrides\n\tvirtual TurnOffTiles* clone() const override;\n    virtual void startWithTarget(Node *target) override;\n    virtual void update(float time) override;\n\nprotected:\n    TurnOffTiles() {}\n    virtual ~TurnOffTiles();\n    /** initializes the action with a random seed, the grid size and the duration */\n    bool initWithDuration(float duration, const Size& gridSize, unsigned int seed);\n\n    unsigned int    _seed;\n    unsigned int    _tilesCount;\n    unsigned int*   _tilesOrder;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TurnOffTiles);\n};\n\n/** @brief WavesTiles3D action. */\nclass CC_DLL WavesTiles3D : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with a number of waves, the waves amplitude, the grid size and the duration */\n    static WavesTiles3D* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);\n\n    /** waves amplitude */\n    inline float getAmplitude(void) const { return _amplitude; }\n    inline void setAmplitude(float amplitude) { _amplitude = amplitude; }\n\n    /** waves amplitude rate */\n    inline float getAmplitudeRate(void) const { return _amplitudeRate; }\n    inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }\n\n    // Override\n\tvirtual WavesTiles3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    WavesTiles3D() {}\n    virtual ~WavesTiles3D() {}\n    /** initializes the action with a number of waves, the waves amplitude, the grid size and the duration */\n    bool initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude);\n\n    unsigned int _waves;\n    float _amplitude;\n    float _amplitudeRate;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(WavesTiles3D);\n};\n\n/** @brief JumpTiles3D action.\n A sin function is executed to move the tiles across the Z axis\n */\nclass CC_DLL JumpTiles3D : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with the number of jumps, the sin amplitude, the grid size and the duration */\n    static JumpTiles3D* create(float duration, const Size& gridSize, unsigned int numberOfJumps, float amplitude);\n\n    /** amplitude of the sin*/\n    inline float getAmplitude(void) const { return _amplitude; }\n    inline void setAmplitude(float amplitude) { _amplitude = amplitude; }\n\n    /** amplitude rate */\n    inline float getAmplitudeRate(void) const { return _amplitudeRate; }\n    inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }\n\n    // Override\n\tvirtual JumpTiles3D* clone() const override;\n    virtual void update(float time) override;\n\nprotected:\n    JumpTiles3D() {}\n    virtual ~JumpTiles3D() {}\n    /** initializes the action with the number of jumps, the sin amplitude, the grid size and the duration */\n    bool initWithDuration(float duration, const Size& gridSize, unsigned int numberOfJumps, float amplitude);\n\n    unsigned int _jumps;\n    float _amplitude;\n    float _amplitudeRate;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(JumpTiles3D);\n};\n\n/** @brief SplitRows action */\nclass CC_DLL SplitRows : public TiledGrid3DAction\n{\npublic :\n    /** creates the action with the number of rows to split and the duration */\n    static SplitRows* create(float duration, unsigned int rows);\n\n    // Overrides\n\tvirtual SplitRows* clone() const override;\n    virtual void update(float time) override;\n    virtual void startWithTarget(Node *target) override;\n\nprotected:\n    SplitRows() {}\n    virtual ~SplitRows() {}\n    /** initializes the action with the number of rows to split and the duration */\n    bool initWithDuration(float duration, unsigned int rows);\n\n    unsigned int _rows;\n    Size _winSize;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(SplitRows);\n};\n\n/** @brief SplitCols action */\nclass CC_DLL SplitCols : public TiledGrid3DAction\n{\npublic:\n    /** creates the action with the number of columns to split and the duration */\n    static SplitCols* create(float duration, unsigned int cols);\n\n    // Overrides\n\tvirtual SplitCols* clone() const override;\n    virtual void update(float time) override;\n    virtual void startWithTarget(Node *target) override;\n\nprotected:\n    SplitCols() {}\n    virtual ~SplitCols() {}\n    /** initializes the action with the number of columns to split and the duration */\n    bool initWithDuration(float duration, unsigned int cols);\n\n    unsigned int _cols;\n    Size _winSize;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(SplitCols);\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif // __ACTION_CCTILEDGRID_ACTION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionTween.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      lhunath (Maarten Billemont)\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCActionTween.h\"\n\nNS_CC_BEGIN\n\nActionTween* ActionTween::create(float aDuration, const std::string& key, float from, float to)\n{\n    ActionTween* ret = new ActionTween();\n    if (ret && ret->initWithDuration(aDuration, key, from, to))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ActionTween::initWithDuration(float duration, const std::string& key, float from, float to)\n{\n    if (ActionInterval::initWithDuration(duration))\n    {\n        _key    = key;\n        _to       = to;\n        _from     = from;\n        return true;\n    }\n\n    return false;\n}\n\nActionTween *ActionTween::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new ActionTween();\n\ta->initWithDuration(_duration, _key.c_str(), _from, _to);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid ActionTween::startWithTarget(Node *target)\n{\n    CCASSERT(dynamic_cast<ActionTweenDelegate*>(target), \"target must implement ActionTweenDelegate\");\n    ActionInterval::startWithTarget(target);\n    _delta = _to - _from;\n}\n\nvoid ActionTween::update(float dt)\n{\n    dynamic_cast<ActionTweenDelegate*>(_target)->updateTweenAction(_to  - _delta * (1 - dt), _key.c_str());\n}\n\nActionTween* ActionTween::reverse() const\n{\n    return ActionTween::create(_duration, _key.c_str(), _to, _from);\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCActionTween.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      lhunath (Maarten Billemont)\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCACTIONTWEEN_H__\n#define __CCACTIONTWEEN_H__\n\n#include \"CCActionInterval.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup actions\n * @{\n */\n\nclass CC_DLL ActionTweenDelegate\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ActionTweenDelegate() {}\n    virtual void updateTweenAction(float value, const std::string& key) = 0;\n};\n\n/** ActionTween\n\n ActionTween is an action that lets you update any property of an object.\n For example, if you want to modify the \"width\" property of a target from 200 to 300 in 2 seconds, then:\n\n @code\n     auto modifyWidth = ActionTween::create(2, \"width\", 200, 300);\n     target->runAction(modifyWidth);\n @endcode\n\n Another example: ScaleTo action could be rewritten using PropertyAction:\n\n @code\n     // scaleA and scaleB are equivalents\n     auto scaleA = ScaleTo::create(2, 3);                 // (duration, to)\n     auto scaleB = ActionTween::create(2, \"scale\", 1, 3); // (duration, key, from, to)\n @endcode\n\n @since v0.99.2\n */\nclass CC_DLL ActionTween : public ActionInterval\n{\npublic:\n    /** creates an initializes the action with the property name (key), and the from and to parameters. */\n    static ActionTween* create(float duration, const std::string& key, float from, float to);\n    /** initializes the action with the property name (key), and the from and to parameters. */\n    bool initWithDuration(float duration, const std::string& key, float from, float to);\n\n    // Overrides\n    void startWithTarget(Node *target) override;\n    void update(float dt) override;\n    ActionTween* reverse() const override;\n\tActionTween *clone() const override;\n\nprotected:\n    std::string        _key;\n    float            _from, _to;\n    float            _delta;\n};\n\n// end of actions group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCACTIONTWEEN_H__ */\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCAnimation.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCAnimation.h\"\n#include \"CCTextureCache.h\"\n#include \"CCTexture2D.h\"\n#include \"ccMacros.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCDirector.h\"\n\nNS_CC_BEGIN\n\nAnimationFrame* AnimationFrame::create(SpriteFrame* spriteFrame, float delayUnits, const ValueMap& userInfo)\n{\n    auto ret = new AnimationFrame();\n    if (ret && ret->initWithSpriteFrame(spriteFrame, delayUnits, userInfo))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nAnimationFrame::AnimationFrame()\n: _spriteFrame(nullptr)\n, _delayUnits(0.0f)\n{\n\n}\n\nbool AnimationFrame::initWithSpriteFrame(SpriteFrame* spriteFrame, float delayUnits, const ValueMap& userInfo)\n{\n    setSpriteFrame(spriteFrame);\n    setDelayUnits(delayUnits);\n    setUserInfo(userInfo);\n\n    return true;\n}\n\nAnimationFrame::~AnimationFrame()\n{    \n    CCLOGINFO( \"deallocing AnimationFrame: %p\", this);\n\n    CC_SAFE_RELEASE(_spriteFrame);\n}\n\nAnimationFrame* AnimationFrame::clone() const\n{\n\t// no copy constructor\n\tauto frame = new AnimationFrame();\n    frame->initWithSpriteFrame(_spriteFrame->clone(),\n\t\t\t\t\t\t\t   _delayUnits,\n\t\t\t\t\t\t\t   _userInfo);\n\n\tframe->autorelease();\n\treturn frame;\n}\n\n// implementation of Animation\n\nAnimation* Animation::create(void)\n{\n    Animation *animation = new Animation();\n    animation->init();\n    animation->autorelease();\n\n    return animation;\n} \n\nAnimation* Animation::createWithSpriteFrames(const Vector<SpriteFrame*>& frames, float delay/* = 0.0f*/)\n{\n    Animation *animation = new Animation();\n    animation->initWithSpriteFrames(frames, delay);\n    animation->autorelease();\n\n    return animation;\n}\n\nAnimation* Animation::create(const Vector<AnimationFrame*>& arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops /* = 1 */)\n{\n    Animation *animation = new Animation();\n    animation->initWithAnimationFrames(arrayOfAnimationFrameNames, delayPerUnit, loops);\n    animation->autorelease();\n    return animation;\n}\n\nbool Animation::init()\n{\n    _loops = 1;\n    _delayPerUnit = 0.0f;\n    \n    return true;\n}\n\nbool Animation::initWithSpriteFrames(const Vector<SpriteFrame*>& frames, float delay/* = 0.0f*/)\n{\n    _loops = 1;\n    _delayPerUnit = delay;\n\n    for (auto& spriteFrame : frames)\n    {\n        auto animFrame = AnimationFrame::create(spriteFrame, 1, ValueMap());\n        _frames.pushBack(animFrame);\n        _totalDelayUnits++;\n    }\n\n    return true;\n}\n\nbool Animation::initWithAnimationFrames(const Vector<AnimationFrame*>& arrayOfAnimationFrames, float delayPerUnit, unsigned int loops)\n{\n    _delayPerUnit = delayPerUnit;\n    _loops = loops;\n\n    setFrames(arrayOfAnimationFrames);\n\n    for (auto& animFrame : _frames)\n    {\n        _totalDelayUnits += animFrame->getDelayUnits();\n    }\n    return true;\n}\n\nAnimation::Animation()\n: _totalDelayUnits(0.0f)\n, _delayPerUnit(0.0f)\n, _duration(0.0f)\n, _restoreOriginalFrame(false)\n, _loops(0)\n{\n\n}\n\nAnimation::~Animation(void)\n{\n    CCLOGINFO(\"deallocing Animation: %p\", this);\n}\n\nvoid Animation::addSpriteFrame(SpriteFrame* spriteFrame)\n{\n    AnimationFrame *animFrame = AnimationFrame::create(spriteFrame, 1.0f, ValueMap());\n    _frames.pushBack(animFrame);\n\n    // update duration\n    _totalDelayUnits++;\n}\n\nvoid Animation::addSpriteFrameWithFile(const std::string& filename)\n{\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename);\n    Rect rect = Rect::ZERO;\n    rect.size = texture->getContentSize();\n    SpriteFrame *frame = SpriteFrame::createWithTexture(texture, rect);\n    addSpriteFrame(frame);\n}\n\nvoid Animation::addSpriteFrameWithTexture(Texture2D *pobTexture, const Rect& rect)\n{\n    SpriteFrame *frame = SpriteFrame::createWithTexture(pobTexture, rect);\n    addSpriteFrame(frame);\n}\n\nfloat Animation::getDuration(void) const\n{\n    return _totalDelayUnits * _delayPerUnit;\n}\n\nAnimation* Animation::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new Animation();\n    a->initWithAnimationFrames(_frames, _delayPerUnit, _loops);\n    a->setRestoreOriginalFrame(_restoreOriginalFrame);\n\ta->autorelease();\n\treturn a;\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCAnimation.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_ANIMATION_H__\n#define __CC_ANIMATION_H__\n\n#include \"CCPlatformConfig.h\"\n#include \"CCObject.h\"\n#include \"CCArray.h\"\n#include \"CCValue.h\"\n#include \"CCGeometry.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCVector.h\"\n\n#include <string>\n\nNS_CC_BEGIN\n\nclass Texture2D;\nclass SpriteFrame;\n\n/**\n * @addtogroup sprite_nodes\n * @{\n */\n\n/** AnimationFrame\n A frame of the animation. It contains information like:\n    - sprite frame name\n    - # of delay units.\n    - offset\n \n @since v2.0\n */\nclass CC_DLL AnimationFrame : public Object, public Clonable\n{\npublic:\n    /**\n     * Creates the animation frame with a spriteframe, number of delay units and a notification user info\n     * @since 3.0\n     */\n    static AnimationFrame* create(SpriteFrame* spriteFrame, float delayUnits, const ValueMap& userInfo);\n\n    SpriteFrame* getSpriteFrame() const { return _spriteFrame; };\n    \n    void setSpriteFrame(SpriteFrame* frame)\n    {\n        CC_SAFE_RETAIN(frame);\n        CC_SAFE_RELEASE(_spriteFrame);\n        _spriteFrame = frame;\n    }\n\n    /** Gets the units of time the frame takes */\n    float getDelayUnits() const { return _delayUnits; };\n    \n    /** Sets the units of time the frame takes */ \n    void setDelayUnits(float delayUnits) { _delayUnits = delayUnits; };\n    \n    /** @brief Gets user infomation\n        A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo. If UserInfo is nil, then no notification will be broadcast.\n     */\n    const ValueMap& getUserInfo() const { return _userInfo; };\n    ValueMap& getUserInfo() { return _userInfo; };\n    \n    /** Sets user infomation */\n    void setUserInfo(const ValueMap& userInfo)\n    {\n        _userInfo = userInfo;\n    }\n    \n    // Overrides\n\tvirtual AnimationFrame *clone() const override;\n\nprotected:\n    \n    /**\n     * @js ctor\n     */\n    AnimationFrame();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~AnimationFrame();\n    \n    /** initializes the animation frame with a spriteframe, number of delay units and a notification user info */\n    bool initWithSpriteFrame(SpriteFrame* spriteFrame, float delayUnits, const ValueMap& userInfo);\n    \n    /** SpriteFrameName to be used */\n    SpriteFrame* _spriteFrame;\n\n    /**  how many units of time the frame takes */\n    float _delayUnits;\n\n    /**  A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo. If UserInfo is nil, then no notification will be broadcast. */\n    ValueMap _userInfo;\n    \nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(AnimationFrame);\n};\n\n\n\n\n/** A Animation object is used to perform animations on the Sprite objects.\n\nThe Animation object contains AnimationFrame objects, and a possible delay between the frames.\nYou can animate a Animation object by using the Animate action. Example:\n\n@code\n    sprite->runAction(Animate::create(animation));\n@endcode\n\n*/\nclass CC_DLL Animation : public Object, public Clonable\n{\npublic:\n    /** Creates an animation\n     @since v0.99.5\n     */\n    static Animation* create(void);\n\n    /* Creates an animation with an array of SpriteFrame and a delay between frames in seconds.\n     The frames will be added with one \"delay unit\".\n     @since v0.99.5\n     */\n    static Animation* createWithSpriteFrames(const Vector<SpriteFrame*>& arrayOfSpriteFrameNames, float delay = 0.0f);\n\n    /* Creates an animation with an array of AnimationFrame, the delay per units in seconds and and how many times it should be executed.\n     @since v2.0\n     * @js NA\n     */\n    static Animation* create(const Vector<AnimationFrame*>& arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops = 1);\n\n    /** Adds a SpriteFrame to a Animation.\n     The frame will be added with one \"delay unit\".\n     */\n    void addSpriteFrame(SpriteFrame *frame);\n\n    /** Adds a frame with an image filename. Internally it will create a SpriteFrame and it will add it.\n     The frame will be added with one \"delay unit\".\n     Added to facilitate the migration from v0.8 to v0.9.\n     */\n    void addSpriteFrameWithFile(const std::string& filename);\n    /**\n     @deprecated. Use addSpriteFrameWithFile() instead\n     */\n    CC_DEPRECATED_ATTRIBUTE void addSpriteFrameWithFileName(const std::string& filename){ addSpriteFrameWithFile(filename);}\n\n    /** Adds a frame with a texture and a rect. Internally it will create a SpriteFrame and it will add it.\n     The frame will be added with one \"delay unit\".\n     Added to facilitate the migration from v0.8 to v0.9.\n     */\n    void addSpriteFrameWithTexture(Texture2D* pobTexture, const Rect& rect);\n\n    /** Gets the total Delay units of the Animation. */\n    float getTotalDelayUnits() const { return _totalDelayUnits; };\n    \n    /** Sets the delay in seconds of the \"delay unit\" */\n    void setDelayPerUnit(float delayPerUnit) { _delayPerUnit = delayPerUnit; };\n    \n    /** Gets the delay in seconds of the \"delay unit\" */\n    float getDelayPerUnit() const { return _delayPerUnit; };\n\n    \n    /** Gets the duration in seconds of the whole animation. It is the result of totalDelayUnits * delayPerUnit */\n    float getDuration() const;\n    \n    /** Gets the array of AnimationFrames */\n    const Vector<AnimationFrame*>& getFrames() const { return _frames; };\n    \n    /** Sets the array of AnimationFrames */\n    void setFrames(const Vector<AnimationFrame*>& frames)\n    {\n        _frames = frames;\n    }\n    \n    /** Checks whether to restore the original frame when animation finishes. */\n    bool getRestoreOriginalFrame() const { return _restoreOriginalFrame; };\n    \n    /** Sets whether to restore the original frame when animation finishes */\n    void setRestoreOriginalFrame(bool restoreOriginalFrame) { _restoreOriginalFrame = restoreOriginalFrame; };\n    \n    /** Gets the times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... */\n    unsigned int getLoops() const { return _loops; };\n    \n    /** Sets the times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... */\n    void setLoops(unsigned int loops) { _loops = loops; };\n    \n    // overrides\n\tvirtual Animation *clone() const override;\n\nprotected:\n    Animation();\n    virtual ~Animation(void);\n    \n    /** Initializes a Animation */\n    bool init();\n    \n    /** Initializes a Animation with frames and a delay between frames\n     @since v0.99.5\n     */\n    bool initWithSpriteFrames(const Vector<SpriteFrame*>& arrayOfSpriteFrameNames, float delay = 0.0f);\n    \n    /** Initializes a Animation with AnimationFrame\n     @since v2.0\n     */\n    bool initWithAnimationFrames(const Vector<AnimationFrame*>& arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops);\n    \n    /** total Delay units of the Animation. */\n    float _totalDelayUnits;\n\n    /** Delay in seconds of the \"delay unit\" */\n    float _delayPerUnit;\n\n    /** duration in seconds of the whole animation. It is the result of totalDelayUnits * delayPerUnit */\n    float _duration;\n\n    /** array of AnimationFrames */\n    Vector<AnimationFrame*> _frames;\n\n    /** whether or not it shall restore the original frame when the animation finishes */\n    bool _restoreOriginalFrame;\n\n    /** how many times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... */\n    unsigned int _loops;\n    \nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Animation);\n};\n\n// end of sprite_nodes group\n/// @}\n\nNS_CC_END\n\n#endif // __CC_ANIMATION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCAnimationCache.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCAnimationCache.h\"\n#include \"ccMacros.h\"\n#include \"CCAnimation.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCSpriteFrameCache.h\"\n#include \"CCString.h\"\n#include \"platform/CCFileUtils.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nAnimationCache* AnimationCache::s_sharedAnimationCache = nullptr;\n\nAnimationCache* AnimationCache::getInstance()\n{\n    if (! s_sharedAnimationCache)\n    {\n        s_sharedAnimationCache = new AnimationCache();\n        s_sharedAnimationCache->init();\n    }\n\n    return s_sharedAnimationCache;\n}\n\nvoid AnimationCache::destroyInstance()\n{\n    CC_SAFE_RELEASE_NULL(s_sharedAnimationCache);\n}\n\nbool AnimationCache::init()\n{\n    return true;\n}\n\nAnimationCache::AnimationCache()\n{\n}\n\nAnimationCache::~AnimationCache()\n{\n    CCLOGINFO(\"deallocing AnimationCache: %p\", this);\n}\n\nvoid AnimationCache::addAnimation(Animation *animation, const std::string& name)\n{\n    _animations.insert(name, animation);\n}\n\nvoid AnimationCache::removeAnimation(const std::string& name)\n{\n    if (name.size()==0)\n        return;\n\n    _animations.erase(name);\n}\n\nAnimation* AnimationCache::getAnimation(const std::string& name)\n{\n    return _animations.at(name);\n}\n\nvoid AnimationCache::parseVersion1(const ValueMap& animations)\n{\n    SpriteFrameCache *frameCache = SpriteFrameCache::getInstance();\n\n    for (auto iter = animations.cbegin(); iter != animations.cend(); ++iter)\n    {\n        const ValueMap& animationDict = iter->second.asValueMap();\n        const ValueVector& frameNames = animationDict.at(\"frames\").asValueVector();\n        float delay = animationDict.at(\"delay\").asFloat();\n        Animation* animation = nullptr;\n\n        if ( frameNames.empty() )\n        {\n            CCLOG(\"cocos2d: AnimationCache: Animation '%s' found in dictionary without any frames - cannot add to animation cache.\", iter->first.c_str());\n            continue;\n        }\n\n        ssize_t frameNameSize = frameNames.size();\n        Vector<AnimationFrame*> frames(frameNameSize);\n\n        for (auto& frameName : frameNames)\n        {\n            SpriteFrame* spriteFrame = frameCache->getSpriteFrameByName(frameName.asString());\n\n            if ( ! spriteFrame ) {\n                CCLOG(\"cocos2d: AnimationCache: Animation '%s' refers to frame '%s' which is not currently in the SpriteFrameCache. This frame will not be added to the animation.\", iter->first.c_str(), frameName.asString().c_str());\n\n                continue;\n            }\n\n            AnimationFrame* animFrame = AnimationFrame::create(spriteFrame, 1, ValueMap());\n            frames.pushBack(animFrame);\n        }\n\n        if ( frames.empty() )\n        {\n            CCLOG(\"cocos2d: AnimationCache: None of the frames for animation '%s' were found in the SpriteFrameCache. Animation is not being added to the Animation Cache.\", iter->first.c_str());\n            continue;\n        }\n        else if ( frames.size() != frameNameSize )\n        {\n            CCLOG(\"cocos2d: AnimationCache: An animation in your dictionary refers to a frame which is not in the SpriteFrameCache. Some or all of the frames for the animation '%s' may be missing.\", iter->first.c_str());\n        }\n\n        animation = Animation::create(frames, delay, 1);\n\n        AnimationCache::getInstance()->addAnimation(animation, iter->first.c_str());\n    }\n}\n\nvoid AnimationCache::parseVersion2(const ValueMap& animations)\n{\n    SpriteFrameCache *frameCache = SpriteFrameCache::getInstance();\n\n    for (auto iter = animations.cbegin(); iter != animations.cend(); ++iter)\n    {\n        std::string name = iter->first;\n        ValueMap& animationDict = const_cast<ValueMap&>(iter->second.asValueMap());\n\n        const Value& loops = animationDict[\"loops\"];\n        bool restoreOriginalFrame = animationDict[\"restoreOriginalFrame\"].asBool();\n\n        ValueVector& frameArray = animationDict[\"frames\"].asValueVector();\n\n        if ( frameArray.empty() )\n        {\n            CCLOG(\"cocos2d: AnimationCache: Animation '%s' found in dictionary without any frames - cannot add to animation cache.\", name.c_str());\n            continue;\n        }\n\n        // Array of AnimationFrames\n        Vector<AnimationFrame*> array(static_cast<int>(frameArray.size()));\n\n        for (auto& obj : frameArray)\n        {\n            ValueMap& entry = obj.asValueMap();\n            std::string spriteFrameName = entry[\"spriteframe\"].asString();\n            SpriteFrame *spriteFrame = frameCache->getSpriteFrameByName(spriteFrameName);\n\n            if( ! spriteFrame ) {\n                CCLOG(\"cocos2d: AnimationCache: Animation '%s' refers to frame '%s' which is not currently in the SpriteFrameCache. This frame will not be added to the animation.\", name.c_str(), spriteFrameName.c_str());\n\n                continue;\n            }\n\n            float delayUnits = entry[\"delayUnits\"].asFloat();\n            Value& userInfo = entry[\"notification\"];\n\n            AnimationFrame *animFrame = AnimationFrame::create(spriteFrame, delayUnits, userInfo.asValueMap());\n\n            array.pushBack(animFrame);\n        }\n\n        float delayPerUnit = animationDict[\"delayPerUnit\"].asFloat();\n        Animation *animation = Animation::create(array, delayPerUnit, loops.getType() != Value::Type::NONE ? loops.asInt() : 1);\n\n        animation->setRestoreOriginalFrame(restoreOriginalFrame);\n\n        AnimationCache::getInstance()->addAnimation(animation, name);\n    }\n}\n\nvoid AnimationCache::addAnimationsWithDictionary(const ValueMap& dictionary,const std::string& plist)\n{\n    if ( dictionary.find(\"animations\") == dictionary.end() )\n    {\n        CCLOG(\"cocos2d: AnimationCache: No animations were found in provided dictionary.\");\n        return;\n    }\n    \n    const Value& animations = dictionary.at(\"animations\");\n    unsigned int version = 1;\n\n    if( dictionary.find(\"properties\") != dictionary.end() )\n    {\n        const ValueMap& properties = dictionary.at(\"properties\").asValueMap();\n        version = properties.at(\"format\").asInt();\n        const ValueVector& spritesheets = properties.at(\"spritesheets\").asValueVector();\n\n        for(const auto &value : spritesheets) {\n            std::string path = FileUtils::getInstance()->fullPathFromRelativeFile(value.asString(),plist);\n            SpriteFrameCache::getInstance()->addSpriteFramesWithFile(path);\n        }\n    }\n\n    switch (version) {\n        case 1:\n            parseVersion1(animations.asValueMap());\n            break;\n        case 2:\n            parseVersion2(animations.asValueMap());\n            break;\n        default:\n            CCASSERT(false, \"Invalid animation format\");\n    }\n}\n\n/** Read an NSDictionary from a plist file and parse it automatically for animations */\nvoid AnimationCache::addAnimationsWithFile(const std::string& plist)\n{\n    CCASSERT( plist.size()>0, \"Invalid texture file name\");\n\n    std::string path = FileUtils::getInstance()->fullPathForFilename(plist);\n    ValueMap dict =  FileUtils::getInstance()->getValueMapFromFile(path);\n\n    CCASSERT( !dict.empty(), \"CCAnimationCache: File could not be found\");\n\n    addAnimationsWithDictionary(dict,plist);\n}\n\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCAnimationCache.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_ANIMATION_CACHE_H__\n#define __CC_ANIMATION_CACHE_H__\n\n#include \"CCObject.h\"\n#include \"CCMap.h\"\n#include \"CCValue.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass Animation;\n\n/**\n * @addtogroup sprite_nodes\n * @{\n */\n\n/** Singleton that manages the Animations.\nIt saves in a cache the animations. You should use this class if you want to save your animations in a cache.\n\nBefore v0.99.5, the recommend way was to save them on the Sprite. Since v0.99.5, you should use this class instead.\n\n@since v0.99.5\n*/\nclass CC_DLL AnimationCache : public Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    AnimationCache();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~AnimationCache();\n    /** Returns the shared instance of the Animation cache */\n    static AnimationCache* getInstance();\n\n    /** Purges the cache. It releases all the Animation objects and the shared instance.\n     */\n    static void destroyInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static AnimationCache* sharedAnimationCache() { return AnimationCache::getInstance(); }\n\n    /** @deprecated Use destroyInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static void purgeSharedAnimationCache() { return AnimationCache::destroyInstance(); }\n\n    bool init(void);\n\n    /** Adds a Animation with a name.\n    */\n    void addAnimation(Animation *animation, const std::string& name);\n\n    /** Deletes a Animation from the cache.\n     \n     */\n    void removeAnimation(const std::string& name);\n    /** @deprecated. Use removeAnimation() instead\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE void removeAnimationByName(const std::string& name){ removeAnimation(name);}\n\n    /** Returns a Animation that was previously added.\n    If the name is not found it will return nil.\n    You should retain the returned copy if you are going to use it.\n    */\n    Animation* getAnimation(const std::string& name);\n    /**\n     @deprecated. Use getAnimation() instead\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Animation* animationByName(const std::string& name){ return getAnimation(name); }\n\n    /** Adds an animation from an NSDictionary\n     Make sure that the frames were previously loaded in the SpriteFrameCache.\n     @param plist The path of the relative file,it use to find the plist path for load SpriteFrames.\n     @since v1.1\n     */\n    void addAnimationsWithDictionary(const ValueMap& dictionary,const std::string& plist);\n\n    /** Adds an animation from a plist file.\n     Make sure that the frames were previously loaded in the SpriteFrameCache.\n     @since v1.1\n     * @js addAnimations\n     * @lua addAnimations\n     */\n    void addAnimationsWithFile(const std::string& plist);\n\nprivate:\n    void parseVersion1(const ValueMap& animations);\n    void parseVersion2(const ValueMap& animations);\n\nprivate:\n    Map<std::string, Animation*> _animations;\n    static AnimationCache* s_sharedAnimationCache;\n};\n\n// end of sprite_nodes group\n/// @}\n\nNS_CC_END\n\n#endif // __CC_ANIMATION_CACHE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCAtlasNode.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCAtlasNode.h\"\n#include \"CCTextureAtlas.h\"\n#include \"CCTextureCache.h\"\n#include \"CCDirector.h\"\n#include \"CCGLProgram.h\"\n#include \"CCShaderCache.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCDirector.h\"\n#include \"TransformUtils.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCQuadCommand.h\"\n\n// external\n#include \"kazmath/GL/matrix.h\"\n\nNS_CC_BEGIN\n\n// implementation AtlasNode\n\n// AtlasNode - Creation & Init\n\nAtlasNode::AtlasNode()\n: _itemsPerRow(0)\n, _itemsPerColumn(0)\n, _itemWidth(0)\n, _itemHeight(0)\n, _textureAtlas(nullptr)\n, _isOpacityModifyRGB(false)\n, _quadsToDraw(0)\n, _uniformColor(0)\n, _ignoreContentScaleFactor(false)\n{\n}\n\nAtlasNode::~AtlasNode()\n{\n    CC_SAFE_RELEASE(_textureAtlas);\n}\n\nAtlasNode * AtlasNode::create(const std::string& tile, int tileWidth, int tileHeight, int itemsToRender)\n{\n\tAtlasNode * ret = new AtlasNode();\n\tif (ret->initWithTileFile(tile, tileWidth, tileHeight, itemsToRender))\n\t{\n\t\tret->autorelease();\n\t\treturn ret;\n\t}\n\tCC_SAFE_DELETE(ret);\n\treturn nullptr;\n}\n\nbool AtlasNode::initWithTileFile(const std::string& tile, int tileWidth, int tileHeight, int itemsToRender)\n{\n    CCASSERT(tile.size() > 0, \"file size should not be empty\");\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(tile);\n\treturn initWithTexture(texture, tileWidth, tileHeight, itemsToRender);\n}\n\nbool AtlasNode::initWithTexture(Texture2D* texture, int tileWidth, int tileHeight, int itemsToRender)\n{\n    _itemWidth  = tileWidth;\n    _itemHeight = tileHeight;\n\n    _colorUnmodified = Color3B::WHITE;\n    _isOpacityModifyRGB = true;\n\n    _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n\n    _textureAtlas = new TextureAtlas();\n    _textureAtlas->initWithTexture(texture, itemsToRender);\n\n    if (! _textureAtlas)\n    {\n        CCLOG(\"cocos2d: Could not initialize AtlasNode. Invalid Texture.\");\n        return false;\n    }\n\n    this->updateBlendFunc();\n    this->updateOpacityModifyRGB();\n\n    this->calculateMaxItems();\n\n    _quadsToDraw = itemsToRender;\n\n    // shader stuff\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_U_COLOR));\n    _uniformColor = glGetUniformLocation( getShaderProgram()->getProgram(), \"u_color\");\n\n    return true;\n}\n\n\n// AtlasNode - Atlas generation\n\nvoid AtlasNode::calculateMaxItems()\n{\n    Size s = _textureAtlas->getTexture()->getContentSize();\n    \n    if (_ignoreContentScaleFactor)\n    {\n        s = _textureAtlas->getTexture()->getContentSizeInPixels();\n    }\n    \n    _itemsPerColumn = (int)(s.height / _itemHeight);\n    _itemsPerRow = (int)(s.width / _itemWidth);\n}\n\nvoid AtlasNode::updateAtlasValues()\n{\n    CCASSERT(false, \"CCAtlasNode:Abstract updateAtlasValue not overridden\");\n}\n\n// AtlasNode - draw\nvoid AtlasNode::draw(void)\n{\n//    CC_NODE_DRAW_SETUP();\n//\n//    GL::blendFunc( _blendFunc.src, _blendFunc.dst );\n//\n//    GLfloat colors[4] = {_displayedColor.r / 255.0f, _displayedColor.g / 255.0f, _displayedColor.b / 255.0f, _displayedOpacity / 255.0f};\n//    getShaderProgram()->setUniformLocationWith4fv(_uniformColor, colors, 1);\n//\n//    _textureAtlas->drawNumberOfQuads(_quadsToDraw, 0);\n\n\n    auto shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);\n\n    _quadCommand.init(\n              _globalZOrder,\n              _textureAtlas->getTexture()->getName(),\n              shader,\n              _blendFunc,\n              _textureAtlas->getQuads(),\n              _quadsToDraw,\n              _modelViewTransform);\n\n    Director::getInstance()->getRenderer()->addCommand(&_quadCommand);\n\n}\n\n// AtlasNode - RGBA protocol\n\nconst Color3B& AtlasNode::getColor() const\n{\n    if(_isOpacityModifyRGB)\n    {\n        return _colorUnmodified;\n    }\n    return Node::getColor();\n}\n\nvoid AtlasNode::setColor(const Color3B& color3)\n{\n    Color3B tmp = color3;\n    _colorUnmodified = color3;\n\n    if( _isOpacityModifyRGB )\n    {\n        tmp.r = tmp.r * _displayedOpacity/255;\n        tmp.g = tmp.g * _displayedOpacity/255;\n        tmp.b = tmp.b * _displayedOpacity/255;\n    }\n    Node::setColor(tmp);\n}\n\nvoid AtlasNode::setOpacity(GLubyte opacity)\n{\n    Node::setOpacity(opacity);\n\n    // special opacity for premultiplied textures\n    if( _isOpacityModifyRGB )\n        this->setColor(_colorUnmodified);\n}\n\nvoid AtlasNode::setOpacityModifyRGB(bool value)\n{\n    Color3B oldColor = this->getColor();\n    _isOpacityModifyRGB = value;\n    this->setColor(oldColor);\n}\n\nbool AtlasNode::isOpacityModifyRGB() const\n{\n    return _isOpacityModifyRGB;\n}\n\nvoid AtlasNode::updateOpacityModifyRGB()\n{\n    _isOpacityModifyRGB = _textureAtlas->getTexture()->hasPremultipliedAlpha();\n}\n\nvoid AtlasNode::setIgnoreContentScaleFactor(bool ignoreContentScaleFactor)\n{\n    _ignoreContentScaleFactor = ignoreContentScaleFactor;\n}\n\n// AtlasNode - CocosNodeTexture protocol\n\nconst BlendFunc& AtlasNode::getBlendFunc() const\n{\n    return _blendFunc;\n}\n\nvoid AtlasNode::setBlendFunc(const BlendFunc &blendFunc)\n{\n    _blendFunc = blendFunc;\n}\n\nvoid AtlasNode::updateBlendFunc()\n{\n    if( ! _textureAtlas->getTexture()->hasPremultipliedAlpha() )\n        _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n}\n\nvoid AtlasNode::setTexture(Texture2D *texture)\n{\n    _textureAtlas->setTexture(texture);\n    this->updateBlendFunc();\n    this->updateOpacityModifyRGB();\n}\n\nTexture2D * AtlasNode::getTexture() const\n{\n    return _textureAtlas->getTexture();\n}\n\nvoid AtlasNode::setTextureAtlas(TextureAtlas* textureAtlas)\n{\n    CC_SAFE_RETAIN(textureAtlas);\n    CC_SAFE_RELEASE(_textureAtlas);\n    _textureAtlas = textureAtlas;\n}\n\nTextureAtlas * AtlasNode::getTextureAtlas() const\n{\n    return _textureAtlas;\n}\n\nssize_t AtlasNode::getQuadsToDraw() const\n{\n    return _quadsToDraw;\n}\n\nvoid AtlasNode::setQuadsToDraw(ssize_t quadsToDraw)\n{\n    _quadsToDraw = quadsToDraw;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCAtlasNode.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCATLAS_NODE_H__\n#define __CCATLAS_NODE_H__\n\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"ccTypes.h\"\n#include \"renderer/CCQuadCommand.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup base_nodes\n * @{\n */\n\nclass TextureAtlas;\n\n/** @brief AtlasNode is a subclass of Node that implements the RGBAProtocol and TextureProtocol protocol\n\nIt knows how to render a TextureAtlas object.\nIf you are going to render a TextureAtlas consider subclassing AtlasNode (or a subclass of AtlasNode)\n\nAll features from Node are valid, plus the following features:\n- opacity and RGB colors\n*/\nclass CC_DLL AtlasNode : public Node, public TextureProtocol\n{    \npublic:\n\t/** creates a AtlasNode  with an Atlas file the width and height of each item and the quantity of items to render*/\n\tstatic AtlasNode * create(const std::string& filename, int tileWidth, int tileHeight, int itemsToRender);\n\n    /** updates the Atlas (indexed vertex array).\n    * Shall be overridden in subclasses\n    */\n    virtual void updateAtlasValues();\n\n    void setTextureAtlas(TextureAtlas* textureAtlas);\n    TextureAtlas* getTextureAtlas() const;\n    \n    void setQuadsToDraw(ssize_t quadsToDraw);\n    ssize_t getQuadsToDraw() const;\n\n    \n    // Overrides\n    virtual void draw() override;\n    virtual Texture2D* getTexture() const override;\n    virtual void setTexture(Texture2D *texture) override;\n    virtual bool isOpacityModifyRGB() const override;\n    virtual void setOpacityModifyRGB(bool isOpacityModifyRGB) override;\n    virtual const Color3B& getColor(void) const override;\n    virtual void setColor(const Color3B& color) override;\n    virtual void setOpacity(GLubyte opacity) override;\n    /**\n    * @code\n    * When this function bound into js or lua,the parameter will be changed\n    * In js: var setBlendFunc(var src, var dst)\n    * @endcode\n    * @lua NA\n    */\n    virtual void setBlendFunc(const BlendFunc& blendFunc) override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const BlendFunc& getBlendFunc() const override;\n\n\nprotected:\n    AtlasNode();\n    virtual ~AtlasNode();\n\n    /** initializes an AtlasNode  with an Atlas file the width and height of each item and the quantity of items to render*/\n    bool initWithTileFile(const std::string& tile, int tileWidth, int tileHeight, int itemsToRender);\n\n    /** initializes an AtlasNode  with a texture the width and height of each item measured in points and the quantity of items to render*/\n    bool initWithTexture(Texture2D* texture, int tileWidth, int tileHeight, int itemsToRender);\n\n    void calculateMaxItems();\n    void updateBlendFunc();\n    void updateOpacityModifyRGB();\n\n    friend class Director;\n    void setIgnoreContentScaleFactor(bool bIgnoreContentScaleFactor);\n\n    //! chars per row\n    int    _itemsPerRow;\n    //! chars per column\n    int    _itemsPerColumn;\n\n    //! width of each char\n    int    _itemWidth;\n    //! height of each char\n    int    _itemHeight;\n    \n    Color3B    _colorUnmodified;\n    \n    TextureAtlas* _textureAtlas;\n    // protocol variables\n    bool _isOpacityModifyRGB;\n    BlendFunc _blendFunc;\n\n    // quads to draw\n    ssize_t _quadsToDraw;\n    // color uniform\n    GLint    _uniformColor;\n    // This varible is only used for LabelAtlas FPS display. So plz don't modify its value.\n    bool _ignoreContentScaleFactor;\n    // quad command\n    QuadCommand _quadCommand;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(AtlasNode);\n\n};\n\n// end of base_node group\n/// @}\n\nNS_CC_END\n\n#endif // __CCATLAS_NODE_H__\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCClippingNode.cpp",
    "content": "/*\n * Copyright (c) 2012      Pierre-David Bélanger\n * Copyright (c) 2012      cocos2d-x.org\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * cocos2d-x: http://www.cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#include \"CCClippingNode.h\"\n#include \"kazmath/GL/matrix.h\"\n#include \"CCGLProgram.h\"\n#include \"CCShaderCache.h\"\n#include \"CCDirector.h\"\n#include \"CCDrawingPrimitives.h\"\n\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\nstatic GLint g_sStencilBits = -1;\n// store the current stencil layer (position in the stencil buffer),\n// this will allow nesting up to n ClippingNode,\n// where n is the number of bits of the stencil buffer.\nstatic GLint s_layer = -1;\n\nstatic void setProgram(Node *n, GLProgram *p)\n{\n    n->setShaderProgram(p);\n    \n    auto& children = n->getChildren();\n    for(const auto &child : children) {\n        setProgram(child, p);\n    }\n}\n\nClippingNode::ClippingNode()\n: _stencil(nullptr)\n, _alphaThreshold(0.0f)\n, _inverted(false)\n, _currentStencilEnabled(GL_FALSE)\n, _currentStencilWriteMask(~0)\n, _currentStencilFunc(GL_ALWAYS)\n, _currentStencilRef(0)\n, _currentStencilValueMask(~0)\n, _currentStencilFail(GL_KEEP)\n, _currentStencilPassDepthFail(GL_KEEP)\n, _currentStencilPassDepthPass(GL_KEEP)\n, _currentDepthWriteMask(GL_TRUE)\n,  _currentAlphaTestEnabled(GL_FALSE)\n, _currentAlphaTestFunc(GL_ALWAYS)\n, _currentAlphaTestRef(1)\n{\n\n}\n\nClippingNode::~ClippingNode()\n{\n    CC_SAFE_RELEASE(_stencil);\n}\n\nClippingNode* ClippingNode::create()\n{\n    ClippingNode *ret = new ClippingNode();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    \n    return ret;\n}\n\nClippingNode* ClippingNode::create(Node *pStencil)\n{\n    ClippingNode *ret = new ClippingNode();\n    if (ret && ret->init(pStencil))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    \n    return ret;\n}\n\nbool ClippingNode::init()\n{\n    return init(nullptr);\n}\n\nbool ClippingNode::init(Node *stencil)\n{\n    CC_SAFE_RELEASE(_stencil);\n    _stencil = stencil;\n    CC_SAFE_RETAIN(_stencil);\n    \n    _alphaThreshold = 1;\n    _inverted = false;\n    // get (only once) the number of bits of the stencil buffer\n    static bool once = true;\n    if (once)\n    {\n        glGetIntegerv(GL_STENCIL_BITS, &g_sStencilBits);\n        if (g_sStencilBits <= 0)\n        {\n            CCLOG(\"Stencil buffer is not enabled.\");\n        }\n        once = false;\n    }\n    \n    return true;\n}\n\nvoid ClippingNode::onEnter()\n{\n    Node::onEnter();\n    \n    if (_stencil != nullptr)\n    {\n        _stencil->onEnter();\n    }\n    else\n    {\n        CCLOG(\"ClippingNode warning: _stencil is nil.\");\n    }\n}\n\nvoid ClippingNode::onEnterTransitionDidFinish()\n{\n    Node::onEnterTransitionDidFinish();\n    \n    if (_stencil != nullptr)\n    {\n        _stencil->onEnterTransitionDidFinish();\n    }\n}\n\nvoid ClippingNode::onExitTransitionDidStart()\n{\n    if (_stencil != nullptr)\n    {\n        _stencil->onExitTransitionDidStart();\n    }\n   \n    Node::onExitTransitionDidStart();\n}\n\nvoid ClippingNode::onExit()\n{\n    if (_stencil != nullptr)\n    {\n        _stencil->onExit();\n    }\n    \n    Node::onExit();\n}\n\nvoid ClippingNode::drawFullScreenQuadClearStencil()\n{\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPushMatrix();\n    kmGLLoadIdentity();\n    \n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLPushMatrix();\n    kmGLLoadIdentity();\n    \n    DrawPrimitives::drawSolidRect(Point(-1,-1), Point(1,1), Color4F(1, 1, 1, 1));\n    \n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLPopMatrix();\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPopMatrix();\n}\n\nvoid ClippingNode::visit()\n{\n    if(!_visible)\n        return;\n    \n    kmGLPushMatrix();\n    transform();\n    //Add group command\n    \n    Renderer* renderer = Director::getInstance()->getRenderer();\n    \n    _groupCommand.init(_globalZOrder);\n    renderer->addCommand(&_groupCommand);\n\n    renderer->pushGroup(_groupCommand.getRenderQueueID());\n\n    _beforeVisitCmd.init(_globalZOrder);\n    _beforeVisitCmd.func = CC_CALLBACK_0(ClippingNode::onBeforeVisit, this);\n    renderer->addCommand(&_beforeVisitCmd);\n    if (_alphaThreshold < 1)\n    {\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WINDOWS || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)\n#else\n        // since glAlphaTest do not exists in OES, use a shader that writes\n        // pixel only if greater than an alpha threshold\n        GLProgram *program = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);\n        GLint alphaValueLocation = glGetUniformLocation(program->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE);\n        // set our alphaThreshold\n        program->use();\n        program->setUniformLocationWith1f(alphaValueLocation, _alphaThreshold);\n        // we need to recursively apply this shader to all the nodes in the stencil node\n        // XXX: we should have a way to apply shader to all nodes without having to do this\n        setProgram(_stencil, program);\n        \n#endif\n\n    }\n    _stencil->visit();\n\n    _afterDrawStencilCmd.init(_globalZOrder);\n    _afterDrawStencilCmd.func = CC_CALLBACK_0(ClippingNode::onAfterDrawStencil, this);\n    renderer->addCommand(&_afterDrawStencilCmd);\n\n    int i = 0;\n    \n    if(!_children.empty())\n    {\n        sortAllChildren();\n        // draw children zOrder < 0\n        for( ; i < _children.size(); i++ )\n        {\n            auto node = _children.at(i);\n            \n            if ( node && node->getLocalZOrder() < 0 )\n                node->visit();\n            else\n                break;\n        }\n        // self draw\n        this->draw();\n        \n        for(auto it=_children.cbegin()+i; it != _children.cend(); ++it)\n            (*it)->visit();\n    }\n    else\n    {\n        this->draw();\n    }\n\n    _afterVisitCmd.init(_globalZOrder);\n    _afterVisitCmd.func = CC_CALLBACK_0(ClippingNode::onAfterVisit, this);\n    renderer->addCommand(&_afterVisitCmd);\n\n    renderer->popGroup();\n    \n    kmGLPopMatrix();\n}\n\nNode* ClippingNode::getStencil() const\n{\n    return _stencil;\n}\n\nvoid ClippingNode::setStencil(Node *stencil)\n{\n    CC_SAFE_RELEASE(_stencil);\n    _stencil = stencil;\n    CC_SAFE_RETAIN(_stencil);\n}\n\nGLfloat ClippingNode::getAlphaThreshold() const\n{\n    return _alphaThreshold;\n}\n\nvoid ClippingNode::setAlphaThreshold(GLfloat alphaThreshold)\n{\n    _alphaThreshold = alphaThreshold;\n}\n\nbool ClippingNode::isInverted() const\n{\n    return _inverted;\n}\n\nvoid ClippingNode::setInverted(bool inverted)\n{\n    _inverted = inverted;\n}\n\nvoid ClippingNode::onBeforeVisit()\n{\n    ///////////////////////////////////\n    // INIT\n\n    // increment the current layer\n    s_layer++;\n\n    // mask of the current layer (ie: for layer 3: 00000100)\n    GLint mask_layer = 0x1 << s_layer;\n    // mask of all layers less than the current (ie: for layer 3: 00000011)\n    GLint mask_layer_l = mask_layer - 1;\n    // mask of all layers less than or equal to the current (ie: for layer 3: 00000111)\n    _mask_layer_le = mask_layer | mask_layer_l;\n\n    // manually save the stencil state\n\n    _currentStencilEnabled = glIsEnabled(GL_STENCIL_TEST);\n    glGetIntegerv(GL_STENCIL_WRITEMASK, (GLint *)&_currentStencilWriteMask);\n    glGetIntegerv(GL_STENCIL_FUNC, (GLint *)&_currentStencilFunc);\n    glGetIntegerv(GL_STENCIL_REF, &_currentStencilRef);\n    glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)&_currentStencilValueMask);\n    glGetIntegerv(GL_STENCIL_FAIL, (GLint *)&_currentStencilFail);\n    glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, (GLint *)&_currentStencilPassDepthFail);\n    glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, (GLint *)&_currentStencilPassDepthPass);\n\n    // enable stencil use\n    glEnable(GL_STENCIL_TEST);\n    // check for OpenGL error while enabling stencil test\n    CHECK_GL_ERROR_DEBUG();\n\n    // all bits on the stencil buffer are readonly, except the current layer bit,\n    // this means that operation like glClear or glStencilOp will be masked with this value\n    glStencilMask(mask_layer);\n\n    // manually save the depth test state\n\n    glGetBooleanv(GL_DEPTH_WRITEMASK, &_currentDepthWriteMask);\n\n    // disable depth test while drawing the stencil\n    //glDisable(GL_DEPTH_TEST);\n    // disable update to the depth buffer while drawing the stencil,\n    // as the stencil is not meant to be rendered in the real scene,\n    // it should never prevent something else to be drawn,\n    // only disabling depth buffer update should do\n    glDepthMask(GL_FALSE);\n\n    ///////////////////////////////////\n    // CLEAR STENCIL BUFFER\n\n    // manually clear the stencil buffer by drawing a fullscreen rectangle on it\n    // setup the stencil test func like this:\n    // for each pixel in the fullscreen rectangle\n    //     never draw it into the frame buffer\n    //     if not in inverted mode: set the current layer value to 0 in the stencil buffer\n    //     if in inverted mode: set the current layer value to 1 in the stencil buffer\n    glStencilFunc(GL_NEVER, mask_layer, mask_layer);\n    glStencilOp(!_inverted ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP);\n\n    // draw a fullscreen solid rectangle to clear the stencil buffer\n    //ccDrawSolidRect(Point::ZERO, ccpFromSize([[Director sharedDirector] winSize]), Color4F(1, 1, 1, 1));\n    drawFullScreenQuadClearStencil();\n\n    ///////////////////////////////////\n    // DRAW CLIPPING STENCIL\n\n    // setup the stencil test func like this:\n    // for each pixel in the stencil node\n    //     never draw it into the frame buffer\n    //     if not in inverted mode: set the current layer value to 1 in the stencil buffer\n    //     if in inverted mode: set the current layer value to 0 in the stencil buffer\n    glStencilFunc(GL_NEVER, mask_layer, mask_layer);\n    glStencilOp(!_inverted ? GL_REPLACE : GL_ZERO, GL_KEEP, GL_KEEP);\n\n    // enable alpha test only if the alpha threshold < 1,\n    // indeed if alpha threshold == 1, every pixel will be drawn anyways\n    if (_alphaThreshold < 1) {\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WINDOWS || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)\n        // manually save the alpha test state\n        _currentAlphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);\n        glGetIntegerv(GL_ALPHA_TEST_FUNC, (GLint *)&_currentAlphaTestFunc);\n        glGetFloatv(GL_ALPHA_TEST_REF, &_currentAlphaTestRef);\n        // enable alpha testing\n        glEnable(GL_ALPHA_TEST);\n        // check for OpenGL error while enabling alpha test\n        CHECK_GL_ERROR_DEBUG();\n        // pixel will be drawn only if greater than an alpha threshold\n        glAlphaFunc(GL_GREATER, _alphaThreshold);\n#else\n        \n#endif\n    }\n\n    //Draw _stencil\n}\n\nvoid ClippingNode::onAfterDrawStencil()\n{\n    // restore alpha test state\n    if (_alphaThreshold < 1)\n    {\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WINDOWS || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)\n        // manually restore the alpha test state\n        glAlphaFunc(_currentAlphaTestFunc, _currentAlphaTestRef);\n        if (!_currentAlphaTestEnabled)\n        {\n            glDisable(GL_ALPHA_TEST);\n        }\n#else\n// XXX: we need to find a way to restore the shaders of the stencil node and its childs\n#endif\n    }\n\n    // restore the depth test state\n    glDepthMask(_currentDepthWriteMask);\n    //if (currentDepthTestEnabled) {\n    //    glEnable(GL_DEPTH_TEST);\n    //}\n\n    ///////////////////////////////////\n    // DRAW CONTENT\n\n    // setup the stencil test func like this:\n    // for each pixel of this node and its childs\n    //     if all layers less than or equals to the current are set to 1 in the stencil buffer\n    //         draw the pixel and keep the current layer in the stencil buffer\n    //     else\n    //         do not draw the pixel but keep the current layer in the stencil buffer\n    glStencilFunc(GL_EQUAL, _mask_layer_le, _mask_layer_le);\n    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);\n\n    // draw (according to the stencil test func) this node and its childs\n}\n\n\nvoid ClippingNode::onAfterVisit()\n{\n    ///////////////////////////////////\n    // CLEANUP\n\n    // manually restore the stencil state\n    glStencilFunc(_currentStencilFunc, _currentStencilRef, _currentStencilValueMask);\n    glStencilOp(_currentStencilFail, _currentStencilPassDepthFail, _currentStencilPassDepthPass);\n    glStencilMask(_currentStencilWriteMask);\n    if (!_currentStencilEnabled)\n    {\n        glDisable(GL_STENCIL_TEST);\n    }\n\n    // we are done using this layer, decrement\n    s_layer--;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCClippingNode.h",
    "content": "/*\n * Copyright (c) 2012      Pierre-David Bélanger\n * Copyright (c) 2012      cocos2d-x.org\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * http://www.cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#ifndef __MISCNODE_CCCLIPPING_NODE_H__\n#define __MISCNODE_CCCLIPPING_NODE_H__\n\n#include \"CCNode.h\"\n#include \"CCGL.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\n/** ClippingNode is a subclass of Node.\n It draws its content (childs) clipped using a stencil.\n The stencil is an other Node that will not be drawn.\n The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).\n */\nclass CC_DLL ClippingNode : public Node\n{\npublic:\n    /** Creates and initializes a clipping node without a stencil.\n     */\n    static ClippingNode* create();\n    \n    /** Creates and initializes a clipping node with an other node as its stencil.\n     The stencil node will be retained.\n     */\n    static ClippingNode* create(Node *stencil);\n\n    /** The Node to use as a stencil to do the clipping.\n     The stencil node will be retained.\n     This default to nil.\n     */\n    Node* getStencil() const;\n    void setStencil(Node *stencil);\n    \n    /** The alpha threshold.\n     The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold.\n     Should be a float between 0 and 1.\n     This default to 1 (so alpha test is disabled).\n     */\n    GLfloat getAlphaThreshold() const;\n    void setAlphaThreshold(GLfloat alphaThreshold);\n    \n    /** Inverted. If this is set to true,\n     the stencil is inverted, so the content is drawn where the stencil is NOT drawn.\n     This default to false.\n     */\n    bool isInverted() const;\n    void setInverted(bool inverted);\n\n    // Overrides\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnterTransitionDidFinish() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExitTransitionDidStart() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit() override;\n    virtual void visit() override;\n\nprotected:\n    ClippingNode();\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ClippingNode();\n\n    /** Initializes a clipping node without a stencil.\n     */\n    virtual bool init();\n\n    /** Initializes a clipping node with an other node as its stencil.\n     The stencil node will be retained, and its parent will be set to this clipping node.\n     */\n    virtual bool init(Node *stencil);\n\n    /**draw fullscreen quad to clear stencil bits\n    */\n    void drawFullScreenQuadClearStencil();\n\n    Node* _stencil;\n    GLfloat _alphaThreshold;\n    bool    _inverted;\nprotected:\n    //renderData and callback\n    void onBeforeVisit();\n    void onAfterDrawStencil();\n    void onAfterVisit();\n\n    GLboolean _currentStencilEnabled;\n    GLuint _currentStencilWriteMask;\n    GLenum _currentStencilFunc;\n    GLint _currentStencilRef;\n    GLuint _currentStencilValueMask;\n    GLenum _currentStencilFail;\n    GLenum _currentStencilPassDepthFail;\n    GLenum _currentStencilPassDepthPass;\n    GLboolean _currentDepthWriteMask;\n\n    GLboolean _currentAlphaTestEnabled;\n    GLenum _currentAlphaTestFunc;\n    GLclampf _currentAlphaTestRef;\n\n    GLint _mask_layer_le;\n    \n    GroupCommand _groupCommand;\n    CustomCommand _beforeVisitCmd;\n    CustomCommand _afterDrawStencilCmd;\n    CustomCommand _afterVisitCmd;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ClippingNode);\n};\n\nNS_CC_END\n\n#endif // __MISCNODE_CCCLIPPING_NODE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCComponent.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCComponent.h\"\n\n\nNS_CC_BEGIN\n\nComponent::Component(void)\n: _owner(nullptr)\n, _enabled(true)\n{\n}\n\nComponent::~Component(void)\n{\n}\n\nbool Component::init()\n{\n    return true;\n}\n\nvoid Component::onEnter()\n{\n}\n\nvoid Component::onExit()\n{\n}\n\nvoid Component::update(float delta)\n{\n}\n\nbool Component::serialize(void *ar)\n{\n    return true;\n}\n\nComponent* Component::create(void)\n{\n    Component * ret = new Component();\n    if (ret != nullptr && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n\treturn ret;\n}\n\nconst std::string& Component::getName() const\n{\n    return _name;\n}\n\nvoid Component::setName(const std::string& name)\n{\n    _name = name;\n}\n\nNode* Component::getOwner() const\n{\n    return _owner;\n}\n\nvoid Component::setOwner(Node *owner)\n{\n    _owner = owner;\n}\n\nbool Component::isEnabled() const\n{\n    return _enabled;\n}\n\nvoid Component::setEnabled(bool b)\n{\n    _enabled = b;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCComponent.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_FRAMEWORK_COMPONENT_H__\n#define __CC_FRAMEWORK_COMPONENT_H__\n\n#include \"CCObject.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass CC_DLL Component : public Object\n{\nprotected:\n    /**\n     * @js ctor\n     */\n    Component(void);\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Component(void);\n    virtual bool init();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit();\n    virtual void update(float delta);\n    virtual bool serialize(void* r);\n    virtual bool isEnabled() const;\n    virtual void setEnabled(bool b);\n    static Component* create(void);\n    \n    const std::string& getName() const;\n    void setName(const std::string& name);\n    \n    void setOwner(Node *pOwner);\n    Node* getOwner() const;\n    \nprotected:\n    Node *_owner;\n    std::string _name;\n    bool _enabled;\n};\n\nNS_CC_END\n\n#endif  // __FUNDATION__CCCOMPONENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCComponentContainer.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#include \"CCComponentContainer.h\"\n#include \"CCComponent.h\"\n#include \"CCDirector.h\"\n\nNS_CC_BEGIN\n\nComponentContainer::ComponentContainer(Node *node)\n: _components(nullptr)\n, _owner(node)\n{\n}\n\nComponentContainer::~ComponentContainer(void)\n{\n    CC_SAFE_DELETE(_components);\n}\n\nComponent* ComponentContainer::get(const std::string& name) const\n{\n    Component* ret = nullptr;\n    do {\n        CC_BREAK_IF(nullptr == _components);\n        ret = _components->at(name);\n        \n    } while (0);\n    return ret;\n}\n\nbool ComponentContainer::add(Component *com)\n{\n    bool ret = false;\n    CCASSERT(com != nullptr, \"Argument must be non-nil\");\n    CCASSERT(com->getOwner() == nullptr, \"Component already added. It can't be added again\");\n    do\n    {\n        if (_components == nullptr)\n        {\n            _components = new Map<std::string, Component*>();\n            _owner->scheduleUpdate();\n        }\n        Component *component = _components->at(com->getName());\n        \n        CCASSERT(component == nullptr, \"Component already added. It can't be added again\");\n        CC_BREAK_IF(component);\n        com->setOwner(_owner);\n        _components->insert(com->getName(), com);\n        com->onEnter();\n        ret = true;\n    } while(0);\n    return ret;\n}\n\nbool ComponentContainer::remove(const std::string& name)\n{\n    bool ret = false;\n    do \n    {        \n        CC_BREAK_IF(!_components);\n        \n        auto iter = _components->find(name);\n        CC_BREAK_IF(iter == _components->end());\n        \n        auto com = iter->second;\n        com->onExit();\n        com->setOwner(nullptr);\n        \n        _components->erase(iter);\n        \n        ret = true;\n    } while(0);\n    return ret;\n }\n\nvoid ComponentContainer::removeAll()\n{\n    if (_components != nullptr)\n    {\n        for (auto iter = _components->begin(); iter != _components->end(); ++iter)\n        {\n            iter->second->onExit();\n            iter->second->setOwner(nullptr);\n        }\n        \n        _components->clear();\n        CC_SAFE_DELETE(_components);\n        \n        _owner->unscheduleUpdate();\n    }\n}\n\nvoid ComponentContainer::alloc(void)\n{\n    _components = new Map<std::string, Component*>();\n}\n\nvoid ComponentContainer::visit(float delta)\n{\n    if (_components != nullptr)\n    {\n        for (auto iter = _components->begin(); iter != _components->end(); ++iter)\n        {\n            iter->second->update(delta);\n        }\n    }\n}\n\nbool ComponentContainer::isEmpty() const\n{\n    return (_components == nullptr || _components->empty());\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCComponentContainer.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_FRAMEWORK_COMCONTAINER_H__\n#define __CC_FRAMEWORK_COMCONTAINER_H__\n\n#include \"CCMap.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass Component;\nclass Node;\n\nclass CC_DLL ComponentContainer\n{\nprotected:\n    /**\n     * @js ctor\n     */\n    ComponentContainer(Node *pNode);\n    \npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ComponentContainer(void);\n    virtual Component* get(const std::string& name) const;\n    virtual bool add(Component *com);\n    virtual bool remove(const std::string& name);\n    virtual void removeAll();\n    virtual void visit(float delta);\npublic:\n    bool isEmpty() const;\n    \nprivate:\n    void alloc(void);\n    \nprivate:\n    Map<std::string, Component*>* _components;\n    Node *_owner;\n    \n    friend class Node;\n};\n\nNS_CC_END\n\n#endif  // __FUNDATION__CCCOMPONENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCConfiguration.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010      Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCConfiguration.h\"\n#include <string.h>\n#include \"ccMacros.h\"\n#include \"ccConfig.h\"\n#include \"CCDictionary.h\"\n#include \"CCInteger.h\"\n#include \"CCBool.h\"\n#include \"platform/CCFileUtils.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nextern const char* cocos2dVersion();\n\nConfiguration* Configuration::s_sharedConfiguration = nullptr;\n\nConfiguration::Configuration()\n: _maxTextureSize(0) \n, _maxModelviewStackDepth(0)\n, _supportsPVRTC(false)\n, _supportsETC1(false)\n, _supportsS3TC(false)\n, _supportsATITC(false)\n, _supportsNPOT(false)\n, _supportsBGRA8888(false)\n, _supportsDiscardFramebuffer(false)\n, _supportsShareableVAO(false)\n, _maxSamplesAllowed(0)\n, _maxTextureUnits(0)\n, _glExtensions(nullptr)\n{\n}\n\nbool Configuration::init()\n{\n\t_valueDict[\"cocos2d.x.version\"] = Value(cocos2dVersion());\n\n\n#if CC_ENABLE_PROFILERS\n\t_valueDict[\"cocos2d.x.compiled_with_profiler\"] = Value(true);\n#else\n\t_valueDict[\"cocos2d.x.compiled_with_profiler\"] = Value(false);\n#endif\n\n#if CC_ENABLE_GL_STATE_CACHE == 0\n\t_valueDict[\"cocos2d.x.compiled_with_gl_state_cache\"] = Value(false);\n#else\n    _valueDict[\"cocos2d.x.compiled_with_gl_state_cache\"] = Value(true);\n#endif\n\n#if COCOS2D_DEBUG\n\t_valueDict[\"cocos2d.x.build_type\"] = Value(\"DEBUG\");\n#else\n    _valueDict[\"cocos2d.x.build_type\"] = Value(\"RELEASE\");\n#endif\n\n\treturn true;\n}\n\nConfiguration::~Configuration()\n{\n}\n\nstd::string Configuration::getInfo() const\n{\n\t// And Dump some warnings as well\n#if CC_ENABLE_PROFILERS\n    CCLOG(\"cocos2d: **** WARNING **** CC_ENABLE_PROFILERS is defined. Disable it when you finish profiling (from ccConfig.h)\\n\");\n#endif\n\n#if CC_ENABLE_GL_STATE_CACHE == 0\n    CCLOG(\"cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it (from ccConfig.h)\\n\");\n#endif\n\n    // Dump\n    Value forDump = Value(_valueDict);\n    return forDump.getDescription();\n}\n\nvoid Configuration::gatherGPUInfo()\n{\n\t_valueDict[\"gl.vendor\"] = Value((const char*)glGetString(GL_VENDOR));\n\t_valueDict[\"gl.renderer\"] = Value((const char*)glGetString(GL_RENDERER));\n\t_valueDict[\"gl.version\"] = Value((const char*)glGetString(GL_VERSION));\n\n    _glExtensions = (char *)glGetString(GL_EXTENSIONS);\n\n    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &_maxTextureSize);\n\t_valueDict[\"gl.max_texture_size\"] = Value((int)_maxTextureSize);\n\n    glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &_maxTextureUnits);\n\t_valueDict[\"gl.max_texture_units\"] = Value((int)_maxTextureUnits);\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    glGetIntegerv(GL_MAX_SAMPLES_APPLE, &_maxSamplesAllowed);\n\t_valueDict[\"gl.max_samples_allowed\"] = Value((int)_maxSamplesAllowed);\n#endif\n    \n    _supportsETC1 = checkForGLExtension(\"GL_OES_compressed_ETC1_RGB8_texture\");\n    _valueDict[\"gl.supports_ETC1\"] = Value(_supportsETC1);\n    \n    _supportsS3TC = checkForGLExtension(\"GL_EXT_texture_compression_s3tc\");\n    _valueDict[\"gl.supports_S3TC\"] = Value(_supportsS3TC);\n    \n    _supportsATITC = checkForGLExtension(\"GL_AMD_compressed_ATC_texture\");\n    _valueDict[\"gl.supports_ATITC\"] = Value(_supportsATITC);\n    \n    _supportsPVRTC = checkForGLExtension(\"GL_IMG_texture_compression_pvrtc\");\n\t_valueDict[\"gl.supports_PVRTC\"] = Value(_supportsPVRTC);\n\n    _supportsNPOT = true;\n\t_valueDict[\"gl.supports_NPOT\"] = Value(_supportsNPOT);\n\t\n    _supportsBGRA8888 = checkForGLExtension(\"GL_IMG_texture_format_BGRA888\");\n\t_valueDict[\"gl.supports_BGRA8888\"] = Value(_supportsBGRA8888);\n\n    _supportsDiscardFramebuffer = checkForGLExtension(\"GL_EXT_discard_framebuffer\");\n\t_valueDict[\"gl.supports_discard_framebuffer\"] = Value(_supportsDiscardFramebuffer);\n\n    _supportsShareableVAO = checkForGLExtension(\"vertex_array_object\");\n\t_valueDict[\"gl.supports_vertex_array_object\"] = Value(_supportsShareableVAO);\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\nConfiguration* Configuration::getInstance()\n{\n    if (! s_sharedConfiguration)\n    {\n        s_sharedConfiguration = new Configuration();\n        s_sharedConfiguration->init();\n    }\n    \n    return s_sharedConfiguration;\n}\n\nvoid Configuration::destroyInstance()\n{\n    CC_SAFE_RELEASE_NULL(s_sharedConfiguration);\n}\n\n// XXX: deprecated\nConfiguration* Configuration::sharedConfiguration()\n{\n    return Configuration::getInstance();\n}\n\n// XXX: deprecated\nvoid Configuration::purgeConfiguration()\n{\n    Configuration::destroyInstance();\n}\n\n\nbool Configuration::checkForGLExtension(const string &searchName) const\n{\n    bool ret = false;\n    const char *kSearchName = searchName.c_str();\n    \n    if (_glExtensions && \n        strstr(_glExtensions, kSearchName))\n    {\n        ret = true;\n    }\n    \n    return ret;\n}\n\n//\n// getters for specific variables.\n// Mantained for backward compatiblity reasons only.\n//\nint Configuration::getMaxTextureSize() const\n{\n\treturn _maxTextureSize;\n}\n\nint Configuration::getMaxModelviewStackDepth() const\n{\n\treturn _maxModelviewStackDepth;\n}\n\nint Configuration::getMaxTextureUnits() const\n{\n\treturn _maxTextureUnits;\n}\n\nbool Configuration::supportsNPOT() const\n{\n\treturn _supportsNPOT;\n}\n\nbool Configuration::supportsPVRTC() const\n{\n\treturn _supportsPVRTC;\n}\n\nbool Configuration::supportsETC() const\n{\n    //GL_ETC1_RGB8_OES is not defined in old opengl version\n#ifdef GL_ETC1_RGB8_OES\n    return _supportsETC1;\n#else\n    return false;\n#endif\n}\n\nbool Configuration::supportsS3TC() const\n{\n    return _supportsS3TC;\n}\n\nbool Configuration::supportsATITC() const\n{\n    return _supportsATITC;\n}\n\nbool Configuration::supportsBGRA8888() const\n{\n\treturn _supportsBGRA8888;\n}\n\nbool Configuration::supportsDiscardFramebuffer() const\n{\n\treturn _supportsDiscardFramebuffer;\n}\n\nbool Configuration::supportsShareableVAO() const\n{\n#if CC_TEXTURE_ATLAS_USE_VAO\n    return _supportsShareableVAO;\n#else\n    return false;\n#endif\n}\n\n//\n// generic getters for properties\n//\nconst Value& Configuration::getValue(const std::string& key, const Value& defaultValue) const\n{\n    auto iter = _valueDict.find(key);\n    if (iter != _valueDict.end())\n        return _valueDict.at(key);\n\treturn defaultValue;\n}\n\nvoid Configuration::setValue(const std::string& key, const Value& value)\n{\n\t_valueDict[key] = value;\n}\n\n\n//\n// load file\n//\nvoid Configuration::loadConfigFile(const std::string& filename)\n{\n\tValueMap dict = FileUtils::getInstance()->getValueMapFromFile(filename);\n\tCCASSERT(!dict.empty(), \"cannot create dictionary\");\n\n\t// search for metadata\n\tbool validMetadata = false;\n\tauto metadataIter = dict.find(\"metadata\");\n\tif (metadataIter != dict.end() && metadataIter->second.getType() == Value::Type::MAP)\n    {\n        \n\t\tconst auto& metadata = metadataIter->second.asValueMap();\n        auto formatIter = metadata.find(\"format\");\n        \n\t\tif (formatIter != metadata.end())\n        {\n\t\t\tint format = formatIter->second.asInt();\n\n\t\t\t// Support format: 1\n\t\t\tif (format == 1)\n            {\n\t\t\t\tvalidMetadata = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (! validMetadata)\n    {\n\t\tCCLOG(\"Invalid config format for file: %s\", filename.c_str());\n\t\treturn;\n\t}\n\n\tauto dataIter = dict.find(\"data\");\n\tif (dataIter == dict.end() || dataIter->second.getType() != Value::Type::MAP)\n    {\n\t\tCCLOG(\"Expected 'data' dict, but not found. Config file: %s\", filename.c_str());\n\t\treturn;\n\t}\n\n\t// Add all keys in the existing dictionary\n    \n\tconst auto& dataMap = dataIter->second.asValueMap();\n    for (auto dataMapIter = dataMap.begin(); dataMapIter != dataMap.end(); ++dataMapIter)\n    {\n        if (_valueDict.find(dataMapIter->first) == _valueDict.end())\n            _valueDict[dataMapIter->first] = dataMapIter->second;\n        else\n            CCLOG(\"Key already present. Ignoring '%s'\",dataMapIter->first.c_str());\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCConfiguration.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCCONFIGURATION_H__\n#define __CCCONFIGURATION_H__\n\n#include \"CCObject.h\"\n#include \"CCGL.h\"\n#include \"CCString.h\"\n#include \"CCValue.h\"\n#include <string>\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup global\n * @{\n */\n/**\n @brief Configuration contains some openGL variables\n @since v0.99.0\n */\nclass CC_DLL Configuration : public Object\n{\npublic:\n    \n    /** returns a shared instance of Configuration */\n    static Configuration *getInstance();\n\n    /** purge the shared instance of Configuration */\n    static void destroyInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static Configuration *sharedConfiguration();\n\n    /** @deprecated Use destroyInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static void purgeConfiguration();\n\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n\tvirtual ~Configuration();\n\n    /** OpenGL Max texture size. */\n\tint getMaxTextureSize() const;\n\n    /** OpenGL Max Modelview Stack Depth. */\n\tint getMaxModelviewStackDepth() const;\n\n    /** returns the maximum texture units\n     @since v2.0.0\n     */\n\tint getMaxTextureUnits() const;\n\n    /** Whether or not the GPU supports NPOT (Non Power Of Two) textures.\n     OpenGL ES 2.0 already supports NPOT (iOS).\n     \n     @since v0.99.2\n     */\n\tbool supportsNPOT() const;\n\n    /** Whether or not PVR Texture Compressed is supported */\n\tbool supportsPVRTC() const;\n    \n     /** Whether or not ETC Texture Compressed is supported */\n    bool supportsETC() const;\n    \n    /** Whether or  not S3TC Texture Compressed is supported */\n    bool supportsS3TC() const;\n    \n    /** Whether or  not ATITC Texture Compressed is supported */\n    bool supportsATITC() const;\n    \n    /** Whether or not BGRA8888 textures are supported.\n     @since v0.99.2\n     */\n\tbool supportsBGRA8888() const;\n\n    /** Whether or not glDiscardFramebufferEXT is supported\n     @since v0.99.2\n     */\n\tbool supportsDiscardFramebuffer() const;\n\n    /** Whether or not shareable VAOs are supported.\n     @since v2.0.0\n     */\n\tbool supportsShareableVAO() const;\n\n    /** returns whether or not an OpenGL is supported */\n    bool checkForGLExtension(const std::string &searchName) const;\n\n    bool init();\n\n\t/** returns the value of a given key as a double */\n\tconst Value& getValue(const std::string& key, const Value& defaultValue = Value::Null) const;\n\n\t/** sets a new key/value pair  in the configuration dictionary */\n\tvoid setValue(const std::string& key, const Value& value);\n\n    /** returns the Configuration info */\n    std::string getInfo() const;\n\n\t/** gathers OpenGL / GPU information */\n\tvoid gatherGPUInfo();\n\n\t/** Loads a config file. If the keys are already present, then they are going to be replaced. Otherwise the new keys are added. */\n\tvoid loadConfigFile(const std::string& filename);\n\nprivate:\n    Configuration(void);\n    static Configuration    *s_sharedConfiguration;\n\tstatic std::string\t\ts_configfile;\n    \nprotected:\n    GLint           _maxTextureSize;\n    GLint           _maxModelviewStackDepth;\n    bool            _supportsPVRTC;\n    bool            _supportsETC1;\n    bool            _supportsS3TC;\n    bool            _supportsATITC;\n    bool            _supportsNPOT;\n    bool            _supportsBGRA8888;\n    bool            _supportsDiscardFramebuffer;\n    bool            _supportsShareableVAO;\n    GLint           _maxSamplesAllowed;\n    GLint           _maxTextureUnits;\n    char *          _glExtensions;\n\t\n\tValueMap        _valueDict;\n};\n\n// end of global group\n/// @}\n\nNS_CC_END\n\n#endif // __CCCONFIGURATION_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDeprecated.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"cocos2d.h\"\n\nNS_CC_BEGIN\n\nconst Point CCPointZero = Point::ZERO;\n\n/* The \"zero\" size -- equivalent to Size(0, 0). */\nconst Size CCSizeZero = Size::ZERO;\n\n/* The \"zero\" rectangle -- equivalent to Rect(0, 0, 0, 0). */\nconst Rect CCRectZero = Rect::ZERO;\n\n\nconst Color3B ccWHITE = Color3B::WHITE;\nconst Color3B ccYELLOW = Color3B::YELLOW;\nconst Color3B ccGREEN = Color3B::GREEN;\nconst Color3B ccBLUE = Color3B::BLUE;\nconst Color3B ccRED = Color3B::RED;\nconst Color3B ccMAGENTA = Color3B::MAGENTA;\nconst Color3B ccBLACK = Color3B::BLACK;\nconst Color3B ccORANGE = Color3B::ORANGE;\nconst Color3B ccGRAY = Color3B::GRAY;\n\nconst BlendFunc kCCBlendFuncDisable = BlendFunc::DISABLE;\n\nconst char* kCCShader_PositionTextureColor = GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR;\nconst char* kCCShader_PositionTextureColorAlphaTest = GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST;\nconst char* kCCShader_PositionColor = GLProgram::SHADER_NAME_POSITION_COLOR;\nconst char* kCCShader_PositionTexture = GLProgram::SHADER_NAME_POSITION_TEXTURE;\nconst char* kCCShader_PositionTexture_uColor = GLProgram::SHADER_NAME_POSITION_TEXTURE_U_COLOR;\nconst char* kCCShader_PositionTextureA8Color = GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR;\nconst char* kCCShader_Position_uColor = GLProgram::SHADER_NAME_POSITION_U_COLOR;\nconst char* kCCShader_PositionLengthTexureColor = GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR;\n\n// uniform names\nconst char* kCCUniformPMatrix_s = GLProgram::UNIFORM_NAME_P_MATRIX;\nconst char* kCCUniformMVMatrix_s = GLProgram::UNIFORM_NAME_MV_MATRIX;\nconst char* kCCUniformMVPMatrix_s = GLProgram::UNIFORM_NAME_MVP_MATRIX;\nconst char* kCCUniformTime_s = GLProgram::UNIFORM_NAME_TIME;\nconst char* kCCUniformSinTime_s = GLProgram::UNIFORM_NAME_SIN_TIME;\nconst char* kCCUniformCosTime_s\t= GLProgram::UNIFORM_NAME_COS_TIME;\nconst char* kCCUniformRandom01_s = GLProgram::UNIFORM_NAME_RANDOM01;\nconst char* kCCUniformSampler_s\t= GLProgram::UNIFORM_NAME_SAMPLER;\nconst char* kCCUniformAlphaTestValue = GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE;\n\n// Attribute names\nconst char* kCCAttributeNameColor = GLProgram::ATTRIBUTE_NAME_COLOR;\nconst char* kCCAttributeNamePosition = GLProgram::ATTRIBUTE_NAME_POSITION;\nconst char* kCCAttributeNameTexCoord = GLProgram::ATTRIBUTE_NAME_TEX_COORD;\n\nvoid ccDrawInit()\n{\n    DrawPrimitives::init();\n}\n\nvoid ccDrawFree()\n{\n    DrawPrimitives::free();\n}\n\nvoid ccDrawPoint( const Point& point )\n{\n    DrawPrimitives::drawPoint(point);\n}\n\nvoid ccDrawPoints( const Point *points, unsigned int numberOfPoints )\n{\n    DrawPrimitives::drawPoints(points, numberOfPoints);\n}\n\nvoid ccDrawLine( const Point& origin, const Point& destination )\n{\n    DrawPrimitives::drawLine(origin, destination);\n}\n\nvoid ccDrawRect( Point origin, Point destination )\n{\n    DrawPrimitives::drawRect(origin, destination);\n}\n\nvoid ccDrawSolidRect( Point origin, Point destination, Color4F color )\n{\n    DrawPrimitives::drawSolidRect(origin, destination, color);\n}\n\nvoid ccDrawPoly( const Point *vertices, unsigned int numOfVertices, bool closePolygon )\n{\n    DrawPrimitives::drawPoly(vertices, numOfVertices, closePolygon);\n}\n\nvoid ccDrawSolidPoly( const Point *poli, unsigned int numberOfPoints, Color4F color )\n{\n    DrawPrimitives::drawSolidPoly(poli, numberOfPoints, color);\n}\n\nvoid ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY)\n{\n    DrawPrimitives::drawCircle(center, radius, angle, segments, drawLineToCenter, scaleX, scaleY);\n}\n\nvoid ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter)\n{\n    DrawPrimitives::drawCircle(center, radius, angle, segments, drawLineToCenter);\n}\n\nvoid ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY)\n{\n    DrawPrimitives::drawSolidCircle(center, radius, angle, segments, scaleX, scaleY);\n}\n\nvoid ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments)\n{\n    DrawPrimitives::drawSolidCircle(center, radius, angle, segments);\n}\n\nvoid ccDrawQuadBezier(const Point& origin, const Point& control, const Point& destination, unsigned int segments)\n{\n    DrawPrimitives::drawQuadBezier(origin, control, destination, segments);\n}\n\nvoid ccDrawCubicBezier(const Point& origin, const Point& control1, const Point& control2, const Point& destination, unsigned int segments)\n{\n    DrawPrimitives::drawCubicBezier(origin, control1, control2, destination, segments);\n}\n\nvoid ccDrawCatmullRom( PointArray *arrayOfControlPoints, unsigned int segments )\n{\n    DrawPrimitives::drawCatmullRom(arrayOfControlPoints, segments);\n}\n\nvoid ccDrawCardinalSpline( PointArray *config, float tension,  unsigned int segments )\n{\n    DrawPrimitives::drawCardinalSpline(config, tension, segments);\n}\n\nvoid ccDrawColor4B( GLubyte r, GLubyte g, GLubyte b, GLubyte a )\n{\n    DrawPrimitives::setDrawColor4B(r, g, b, a);\n}\n\nvoid ccDrawColor4F( GLfloat r, GLfloat g, GLfloat b, GLfloat a )\n{\n    DrawPrimitives::setDrawColor4F(r, g, b, a);\n}\n\nvoid ccPointSize( GLfloat pointSize )\n{\n    DrawPrimitives::setPointSize(pointSize);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDeprecated.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n/** Add deprecated global functions and variables here\n */\n\n#ifndef __COCOS2D_CCDEPRECATED_H__\n#define __COCOS2D_CCDEPRECATED_H__\n\n#include <math.h>\n#include \"CCGeometry.h\"\n#include \"ccTypes.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\n/** Helper macro that creates a Point\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE inline Point ccp(float x, float y)\n{\n    return Point(x, y);\n}\n\n/** Returns opposite of point.\n @return Point\n @since v0.7.2\n @deprecated please use Point::-, for example: -v1\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpNeg(const Point& v)\n{\n    return -v;\n}\n\n/** Calculates sum of two points.\n @return Point\n @since v0.7.2\n @deprecated please use Point::+, for example: v1 + v2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpAdd(const Point& v1, const Point& v2)\n{\n    return v1 + v2;\n}\n\n/** Calculates difference of two points.\n @return Point\n @since v0.7.2\n @deprecated please use Point::-, for example: v1 - v2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpSub(const Point& v1, const Point& v2)\n{\n    return v1 - v2;\n}\n\n/** Returns point multiplied by given factor.\n @return Point\n @since v0.7.2\n @deprecated please use Point::*, for example: v1 * v2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpMult(const Point& v, const float s)\n{\n    return v * s;\n}\n\n/** Calculates midpoint between two points.\n @return Point\n @since v0.7.2\n @deprecated please use it like (v1 + v2) / 2.0f\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpMidpoint(const Point& v1, const Point& v2)\n{\n    return v1.getMidpoint(v2);\n}\n\n/** Calculates dot product of two points.\n @return float\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline float\nccpDot(const Point& v1, const Point& v2)\n{\n    return v1.dot(v2);\n}\n\n/** Calculates cross product of two points.\n @return float\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline float\nccpCross(const Point& v1, const Point& v2)\n{\n    return v1.cross(v2);\n}\n\n/** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpPerp(const Point& v)\n{\n    return v.getPerp();\n}\n\n/** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpRPerp(const Point& v)\n{\n    return v.getRPerp();\n}\n\n/** Calculates the projection of v1 over v2.\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpProject(const Point& v1, const Point& v2)\n{\n    return v1.project(v2);\n}\n\n/** Rotates two points.\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpRotate(const Point& v1, const Point& v2)\n{\n    return v1.rotate(v2);\n}\n\n/** Unrotates two points.\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point\nccpUnrotate(const Point& v1, const Point& v2)\n{\n    return v1.unrotate(v2);\n}\n\n/** Calculates the square length of a Point (not calling sqrt() )\n @return float\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline float\nccpLengthSQ(const Point& v)\n{\n    return v.getLengthSq();\n}\n\n\n/** Calculates the square distance between two points (not calling sqrt() )\n @return float\n @since v1.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline float\nccpDistanceSQ(const Point p1, const Point p2)\n{\n    return (p1 - p2).getLengthSq();\n}\n\n\n/** Calculates distance between point an origin\n @return float\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline float ccpLength(const Point& v)\n{\n    return v.getLength();\n}\n\n/** Calculates the distance between two points\n @return float\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline float ccpDistance(const Point& v1, const Point& v2)\n{\n    return v1.getDistance(v2);\n}\n\n/** Returns point multiplied to a length of 1.\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpNormalize(const Point& v)\n{\n    return v.normalize();\n}\n\n/** Converts radians to a normalized vector.\n @return Point\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpForAngle(const float a)\n{\n    return Point::forAngle(a);\n}\n\n/** Converts a vector to radians.\n @return float\n @since v0.7.2\n */\nCC_DEPRECATED_ATTRIBUTE static inline float ccpToAngle(const Point& v)\n{\n    return v.getAngle();\n}\n\n\n/** Clamp a point between from and to.\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpClamp(const Point& p, const Point& from, const Point& to)\n{\n    return p.getClampPoint(from, to);\n}\n\n/** Quickly convert Size to a Point\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpFromSize(const Size& s)\n{\n    return Point(s);\n}\n\n/** Run a math operation function on each point component\n * absf, fllorf, ceilf, roundf\n * any function that has the signature: float func(float);\n * For example: let's try to take the floor of x,y\n * ccpCompOp(p,floorf);\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpCompOp(const Point& p, float (*opFunc)(float))\n{\n    return p.compOp(opFunc);\n}\n\n/** Linear Interpolation between two points a and b\n @returns\n alpha == 0 ? a\n alpha == 1 ? b\n otherwise a value between a..b\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpLerp(const Point& a, const Point& b, float alpha)\n{\n    return a.lerp(b, alpha);\n}\n\n\n/** @returns if points have fuzzy equality which means equal with some degree of variance.\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline bool ccpFuzzyEqual(const Point& a, const Point& b, float variance)\n{\n    return a.fuzzyEquals(b, variance);\n}\n\n\n/** Multiplies a and b components, a.x*b.x, a.y*b.y\n @returns a component-wise multiplication\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpCompMult(const Point& a, const Point& b)\n{\n    return Point(a.x * b.x, a.y * b.y);\n}\n\n/** @returns the signed angle in radians between two vector directions\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline float ccpAngleSigned(const Point& a, const Point& b)\n{\n    return a.getAngle(b);\n}\n\n/** @returns the angle in radians between two vector directions\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline float ccpAngle(const Point& a, const Point& b)\n{\n    return a.getAngle(b);\n}\n\n/** Rotates a point counter clockwise by the angle around a pivot\n @param v is the point to rotate\n @param pivot is the pivot, naturally\n @param angle is the angle of rotation cw in radians\n @returns the rotated point\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpRotateByAngle(const Point& v, const Point& pivot, float angle)\n{\n    return v.rotateByAngle(pivot, angle);\n}\n\n/** A general line-line intersection test\n @param p1\n is the startpoint for the first line P1 = (p1 - p2)\n @param p2\n is the endpoint for the first line P1 = (p1 - p2)\n @param p3\n is the startpoint for the second line P2 = (p3 - p4)\n @param p4\n is the endpoint for the second line P2 = (p3 - p4)\n @param s\n is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1))\n @param t\n is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3))\n @return bool\n indicating successful intersection of a line\n note that to truly test intersection for segments we have to make\n sure that s & t lie within [0..1] and for rays, make sure s & t > 0\n the hit point is        p3 + t * (p4 - p3);\n the hit point also is    p1 + s * (p2 - p1);\n @since v0.99.1\n */\nCC_DEPRECATED_ATTRIBUTE static inline bool ccpLineIntersect(const Point& p1, const Point& p2,\n                                                     const Point& p3, const Point& p4,\n                                                     float *s, float *t)\n{\n    return Point::isLineIntersect(p1, p2, p3, p4, s, t);\n}\n\n/*\n ccpSegmentIntersect returns true if Segment A-B intersects with segment C-D\n @since v1.0.0\n */\nCC_DEPRECATED_ATTRIBUTE static inline bool ccpSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D)\n{\n    return Point::isSegmentIntersect(A, B, C, D);\n}\n\n/*\n ccpIntersectPoint returns the intersection point of line A-B, C-D\n @since v1.0.0\n */\nCC_DEPRECATED_ATTRIBUTE static inline Point ccpIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D)\n{\n    return Point::getIntersectPoint(A, B, C, D);\n}\n\nCC_DEPRECATED_ATTRIBUTE inline Point CCPointMake(float x, float y)\n{\n    return Point(x, y);\n}\n\nCC_DEPRECATED_ATTRIBUTE inline Size CCSizeMake(float width, float height)\n{\n    return Size(width, height);\n}\n\nCC_DEPRECATED_ATTRIBUTE inline Rect CCRectMake(float x, float y, float width, float height)\n{\n    return Rect(x, y, width, height);\n}\n\n\nCC_DEPRECATED_ATTRIBUTE extern const Point CCPointZero;\n\n/* The \"zero\" size -- equivalent to Size(0, 0). */\nCC_DEPRECATED_ATTRIBUTE extern const Size CCSizeZero;\n\n/* The \"zero\" rectangle -- equivalent to Rect(0, 0, 0, 0). */\nCC_DEPRECATED_ATTRIBUTE extern const Rect CCRectZero;\n\n\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccWHITE;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccYELLOW;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccGREEN;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccBLUE;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccRED;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccMAGENTA;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccBLACK;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccORANGE;\nCC_DEPRECATED_ATTRIBUTE extern const Color3B ccGRAY;\n\nCC_DEPRECATED_ATTRIBUTE extern const BlendFunc kCCBlendFuncDisable;\n\nCC_DEPRECATED_ATTRIBUTE static inline Color3B ccc3(GLubyte r, GLubyte g, GLubyte b)\n{\n    return Color3B(r, g, b);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline bool ccc3BEqual(const Color3B &col1, const Color3B &col2)\n{\n    return col1.r == col2.r && col1.g == col2.g && col1.b == col2.b;\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Color4B\nccc4(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte o)\n{\n    return Color4B(r, g, b, o);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Color4F ccc4FFromccc3B(Color3B c)\n{\n    return Color4F(c.r/255.f, c.g/255.f, c.b/255.f, 1.f);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Color4F\nccc4f(const GLfloat r, const GLfloat g, const GLfloat b, const GLfloat a)\n{\n    return Color4F(r, g, b, a);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Color4F ccc4FFromccc4B(Color4B c)\n{\n    return Color4F(c.r/255.f, c.g/255.f, c.b/255.f, c.a/255.f);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Color4B ccc4BFromccc4F(Color4F c)\n{\n\treturn Color4B((GLubyte)(c.r*255), (GLubyte)(c.g*255), (GLubyte)(c.b*255), (GLubyte)(c.a*255));\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline bool ccc4FEqual(Color4F a, Color4F b)\n{\n    return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Vertex2F vertex2(const float x, const float y)\n{\n    Vertex2F c(x, y);\n    return c;\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Vertex3F vertex3(const float x, const float y, const float z)\n{\n    Vertex3F c(x, y, z);\n    return c;\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Tex2F tex2(const float u, const float v)\n{\n    Tex2F t(u , v);\n    return t;\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty)\n{\n    return AffineTransformMake(a, b, c, d, tx, ty);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Point CCPointApplyAffineTransform(const Point& point, const AffineTransform& t)\n{\n    return PointApplyAffineTransform(point, t);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Size CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t)\n{\n    return SizeApplyAffineTransform(size, t);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformMakeIdentity()\n{\n    return AffineTransformMakeIdentity();\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline Rect CCRectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform)\n{\n    return RectApplyAffineTransform(rect, anAffineTransform);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformTranslate(const AffineTransform& t, float tx, float ty)\n{\n    return AffineTransformTranslate(t, tx, ty);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformRotate(const AffineTransform& aTransform, float anAngle)\n{\n    return AffineTransformRotate(aTransform, anAngle);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformScale(const AffineTransform& t, float sx, float sy)\n{\n    return AffineTransformScale(t, sx, sy);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2)\n{\n    return AffineTransformConcat(t1, t2);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline bool CCAffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2)\n{\n    return AffineTransformEqualToTransform(t1, t2);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformInvert(const AffineTransform& t)\n{\n    return AffineTransformInvert(t);\n}\n\nCC_DEPRECATED_ATTRIBUTE static inline AffineTransform CCAffineTransformIdentity()\n{\n    return AffineTransformMakeIdentity();\n}\n\n// CC prefix compatibility\nCC_DEPRECATED_ATTRIBUTE typedef Object CCObject;\nCC_DEPRECATED_ATTRIBUTE typedef Event CCEvent;\nCC_DEPRECATED_ATTRIBUTE typedef DataVisitor CCDataVisitor;\nCC_DEPRECATED_ATTRIBUTE typedef PrettyPrinter CCPrettyPrinter;\nCC_DEPRECATED_ATTRIBUTE typedef Acceleration CCAcceleration;\nCC_DEPRECATED_ATTRIBUTE typedef TextureAtlas CCTextureAtlas;\nCC_DEPRECATED_ATTRIBUTE typedef Configuration CCConfiguration;\nCC_DEPRECATED_ATTRIBUTE typedef PointArray CCPointArray;\nCC_DEPRECATED_ATTRIBUTE typedef RemoveSelf CCRemoveSelf;\nCC_DEPRECATED_ATTRIBUTE typedef IMEDelegate CCIMEDelegate;\nCC_DEPRECATED_ATTRIBUTE typedef IMEKeyboardNotificationInfo CCIMEKeyboardNotificationInfo;\nCC_DEPRECATED_ATTRIBUTE typedef TextFieldDelegate CCTextFieldDelegate;\nCC_DEPRECATED_ATTRIBUTE typedef TextFieldTTF CCTextFieldTTF;\nCC_DEPRECATED_ATTRIBUTE typedef __NotificationCenter CCNotificationCenter;\nCC_DEPRECATED_ATTRIBUTE typedef __NotificationCenter NotificationCenter;\n//CC_DEPRECATED_ATTRIBUTE typedef TargetedTouchDelegate CCTargetedTouchDelegate;\n//CC_DEPRECATED_ATTRIBUTE typedef StandardTouchDelegate CCStandardTouchDelegate;\n//CC_DEPRECATED_ATTRIBUTE typedef TouchDelegate CCTouchDelegate;\nCC_DEPRECATED_ATTRIBUTE typedef Image CCImage;\nCC_DEPRECATED_ATTRIBUTE typedef UserDefault CCUserDefault;\n\nCC_DEPRECATED_ATTRIBUTE typedef Action CCAction;\nCC_DEPRECATED_ATTRIBUTE typedef FiniteTimeAction CCFiniteTimeAction;\nCC_DEPRECATED_ATTRIBUTE typedef Speed CCSpeed;\nCC_DEPRECATED_ATTRIBUTE typedef Follow CCFollow;\nCC_DEPRECATED_ATTRIBUTE typedef GLProgram CCGLProgram;\nCC_DEPRECATED_ATTRIBUTE typedef Touch CCTouch;\nCC_DEPRECATED_ATTRIBUTE typedef Texture2D CCTexture2D;\nCC_DEPRECATED_ATTRIBUTE typedef Node CCNode;\nCC_DEPRECATED_ATTRIBUTE typedef Node CCNodeRGBA;\nCC_DEPRECATED_ATTRIBUTE typedef Node CCRGBAProtocol;\nCC_DEPRECATED_ATTRIBUTE typedef SpriteFrame CCSpriteFrame;\nCC_DEPRECATED_ATTRIBUTE typedef AnimationFrame CCAnimationFrame;\nCC_DEPRECATED_ATTRIBUTE typedef Animation CCAnimation;\nCC_DEPRECATED_ATTRIBUTE typedef ActionInterval CCActionInterval;\nCC_DEPRECATED_ATTRIBUTE typedef Sequence CCSequence;\nCC_DEPRECATED_ATTRIBUTE typedef Repeat CCRepeat;\nCC_DEPRECATED_ATTRIBUTE typedef RepeatForever CCRepeatForever;\nCC_DEPRECATED_ATTRIBUTE typedef Spawn CCSpawn;\nCC_DEPRECATED_ATTRIBUTE typedef RotateTo CCRotateTo;\nCC_DEPRECATED_ATTRIBUTE typedef RotateBy CCRotateBy;\nCC_DEPRECATED_ATTRIBUTE typedef MoveBy CCMoveBy;\nCC_DEPRECATED_ATTRIBUTE typedef MoveTo CCMoveTo;\nCC_DEPRECATED_ATTRIBUTE typedef SkewTo CCSkewTo;\nCC_DEPRECATED_ATTRIBUTE typedef SkewBy CCSkewBy;\nCC_DEPRECATED_ATTRIBUTE typedef JumpBy CCJumpBy;\nCC_DEPRECATED_ATTRIBUTE typedef JumpTo CCJumpTo;\nCC_DEPRECATED_ATTRIBUTE typedef BezierBy CCBezierBy;\nCC_DEPRECATED_ATTRIBUTE typedef BezierTo CCBezierTo;\nCC_DEPRECATED_ATTRIBUTE typedef ScaleTo CCScaleTo;\nCC_DEPRECATED_ATTRIBUTE typedef ScaleBy CCScaleBy;\nCC_DEPRECATED_ATTRIBUTE typedef Blink CCBlink;\nCC_DEPRECATED_ATTRIBUTE typedef FadeIn CCFadeIn;\nCC_DEPRECATED_ATTRIBUTE typedef FadeOut CCFadeOut;\nCC_DEPRECATED_ATTRIBUTE typedef FadeTo CCFadeTo;\nCC_DEPRECATED_ATTRIBUTE typedef TintTo CCTintTo;\nCC_DEPRECATED_ATTRIBUTE typedef TintBy CCTintBy;\nCC_DEPRECATED_ATTRIBUTE typedef DelayTime CCDelayTime;\nCC_DEPRECATED_ATTRIBUTE typedef Animate CCAnimate;\nCC_DEPRECATED_ATTRIBUTE typedef TargetedAction CCTargetedAction;\nCC_DEPRECATED_ATTRIBUTE typedef ActionCamera CCActionCamera;\nCC_DEPRECATED_ATTRIBUTE typedef OrbitCamera CCOrbitCamera;\nCC_DEPRECATED_ATTRIBUTE typedef ActionManager CCActionManager;\nCC_DEPRECATED_ATTRIBUTE typedef ActionEase CCActionEase;\nCC_DEPRECATED_ATTRIBUTE typedef EaseRateAction CCEaseRateAction;\nCC_DEPRECATED_ATTRIBUTE typedef EaseIn CCEaseIn;\nCC_DEPRECATED_ATTRIBUTE typedef EaseOut CCEaseOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseInOut CCEaseInOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseExponentialIn CCEaseExponentialIn;\nCC_DEPRECATED_ATTRIBUTE typedef EaseExponentialOut CCEaseExponentialOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseExponentialInOut CCEaseExponentialInOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseSineIn CCEaseSineIn;\nCC_DEPRECATED_ATTRIBUTE typedef EaseSineOut CCEaseSineOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseSineInOut CCEaseSineInOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseElastic CCEaseElastic;\nCC_DEPRECATED_ATTRIBUTE typedef EaseElasticIn CCEaseElasticIn;\nCC_DEPRECATED_ATTRIBUTE typedef EaseElasticOut CCEaseElasticOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseElasticInOut CCEaseElasticInOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseBounce CCEaseBounce;\nCC_DEPRECATED_ATTRIBUTE typedef EaseBounceIn CCEaseBounceIn;\nCC_DEPRECATED_ATTRIBUTE typedef EaseBounceOut CCEaseBounceOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseBounceInOut CCEaseBounceInOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseBackIn CCEaseBackIn;\nCC_DEPRECATED_ATTRIBUTE typedef EaseBackOut CCEaseBackOut;\nCC_DEPRECATED_ATTRIBUTE typedef EaseBackInOut CCEaseBackInOut;\nCC_DEPRECATED_ATTRIBUTE typedef ActionInstant CCActionInstant;\nCC_DEPRECATED_ATTRIBUTE typedef Show CCShow;\nCC_DEPRECATED_ATTRIBUTE typedef Hide CCHide;\nCC_DEPRECATED_ATTRIBUTE typedef ToggleVisibility CCToggleVisibility;\nCC_DEPRECATED_ATTRIBUTE typedef FlipX CCFlipX;\nCC_DEPRECATED_ATTRIBUTE typedef FlipY CCFlipY;\nCC_DEPRECATED_ATTRIBUTE typedef Place CCPlace;\nCC_DEPRECATED_ATTRIBUTE typedef CallFunc CCCallFunc;\nCC_DEPRECATED_ATTRIBUTE typedef CallFuncN CCCallFuncN;\nCC_DEPRECATED_ATTRIBUTE typedef __CCCallFuncND CCCallFuncND;\nCC_DEPRECATED_ATTRIBUTE typedef __CCCallFuncO CCCallFuncO;\nCC_DEPRECATED_ATTRIBUTE typedef GridAction CCGridAction;\nCC_DEPRECATED_ATTRIBUTE typedef Grid3DAction CCGrid3DAction;\nCC_DEPRECATED_ATTRIBUTE typedef TiledGrid3DAction CCTiledGrid3DAction;\nCC_DEPRECATED_ATTRIBUTE typedef StopGrid CCStopGrid;\nCC_DEPRECATED_ATTRIBUTE typedef ReuseGrid CCReuseGrid;\nCC_DEPRECATED_ATTRIBUTE typedef Waves3D CCWaves3D;\nCC_DEPRECATED_ATTRIBUTE typedef FlipX3D CCFlipX3D;\nCC_DEPRECATED_ATTRIBUTE typedef FlipY3D CCFlipY3D;\nCC_DEPRECATED_ATTRIBUTE typedef Lens3D CCLens3D;\nCC_DEPRECATED_ATTRIBUTE typedef Ripple3D CCRipple3D;\nCC_DEPRECATED_ATTRIBUTE typedef Shaky3D CCShaky3D;\nCC_DEPRECATED_ATTRIBUTE typedef Liquid CCLiquid;\nCC_DEPRECATED_ATTRIBUTE typedef Waves CCWaves;\nCC_DEPRECATED_ATTRIBUTE typedef Twirl CCTwirl;\nCC_DEPRECATED_ATTRIBUTE typedef PageTurn3D CCPageTurn3D;\nCC_DEPRECATED_ATTRIBUTE typedef ProgressTo CCProgressTo;\nCC_DEPRECATED_ATTRIBUTE typedef ProgressFromTo CCProgressFromTo;\nCC_DEPRECATED_ATTRIBUTE typedef ShakyTiles3D CCShakyTiles3D;\nCC_DEPRECATED_ATTRIBUTE typedef ShatteredTiles3D CCShatteredTiles3D;\nCC_DEPRECATED_ATTRIBUTE typedef ShuffleTiles CCShuffleTiles;\nCC_DEPRECATED_ATTRIBUTE typedef FadeOutTRTiles CCFadeOutTRTiles;\nCC_DEPRECATED_ATTRIBUTE typedef FadeOutBLTiles CCFadeOutBLTiles;\nCC_DEPRECATED_ATTRIBUTE typedef FadeOutUpTiles CCFadeOutUpTiles;\nCC_DEPRECATED_ATTRIBUTE typedef FadeOutDownTiles CCFadeOutDownTiles;\nCC_DEPRECATED_ATTRIBUTE typedef TurnOffTiles CCTurnOffTiles;\nCC_DEPRECATED_ATTRIBUTE typedef WavesTiles3D CCWavesTiles3D;\nCC_DEPRECATED_ATTRIBUTE typedef JumpTiles3D CCJumpTiles3D;\nCC_DEPRECATED_ATTRIBUTE typedef SplitRows CCSplitRows;\nCC_DEPRECATED_ATTRIBUTE typedef SplitCols CCSplitCols;\nCC_DEPRECATED_ATTRIBUTE typedef ActionTween CCActionTween;\nCC_DEPRECATED_ATTRIBUTE typedef CardinalSplineTo CCCardinalSplineTo;\nCC_DEPRECATED_ATTRIBUTE typedef CardinalSplineBy CCCardinalSplineBy;\nCC_DEPRECATED_ATTRIBUTE typedef CatmullRomTo CCCatmullRomTo;\nCC_DEPRECATED_ATTRIBUTE typedef CatmullRomBy CCCatmullRomBy;\nCC_DEPRECATED_ATTRIBUTE typedef AtlasNode CCAtlasNode;\nCC_DEPRECATED_ATTRIBUTE typedef TextureProtocol CCTextureProtocol;\nCC_DEPRECATED_ATTRIBUTE typedef BlendProtocol CCBlendProtocol;\nCC_DEPRECATED_ATTRIBUTE typedef DrawNode CCDrawNode;\nCC_DEPRECATED_ATTRIBUTE typedef Camera CCCamera;\nCC_DEPRECATED_ATTRIBUTE typedef LabelAtlas CCLabelAtlas;\nCC_DEPRECATED_ATTRIBUTE typedef LabelProtocol CCLabelProtocol;\nCC_DEPRECATED_ATTRIBUTE typedef Director CCDirector;\nCC_DEPRECATED_ATTRIBUTE typedef GridBase CCGridBase;\nCC_DEPRECATED_ATTRIBUTE typedef Grid3D CCGrid3D;\nCC_DEPRECATED_ATTRIBUTE typedef TiledGrid3D CCTiledGrid3D;\nCC_DEPRECATED_ATTRIBUTE typedef Sprite CCSprite;\nCC_DEPRECATED_ATTRIBUTE typedef LabelTTF CCLabelTTF;\nCC_DEPRECATED_ATTRIBUTE typedef SpriteBatchNode CCSpriteBatchNode;\nCC_DEPRECATED_ATTRIBUTE typedef LabelBMFont CCLabelBMFont;\nCC_DEPRECATED_ATTRIBUTE typedef Layer CCLayer;\n//CC_DEPRECATED_ATTRIBUTE typedef KeypadDelegate CCKeypadDelegate;\nCC_DEPRECATED_ATTRIBUTE typedef Layer CCLayerRGBA;\nCC_DEPRECATED_ATTRIBUTE typedef LayerColor CCLayerColor;\nCC_DEPRECATED_ATTRIBUTE typedef LayerGradient CCLayerGradient;\nCC_DEPRECATED_ATTRIBUTE typedef LayerMultiplex CCLayerMultiplex;\nCC_DEPRECATED_ATTRIBUTE typedef Scene CCScene;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionEaseScene CCTransitionEaseScene;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionScene CCTransitionScene;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionSceneOriented CCTransitionSceneOriented;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionRotoZoom CCTransitionRotoZoom;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionJumpZoom CCTransitionJumpZoom;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionMoveInL CCTransitionMoveInL;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionMoveInR CCTransitionMoveInR;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionMoveInT CCTransitionMoveInT;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionMoveInB CCTransitionMoveInB;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionSlideInL CCTransitionSlideInL;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionSlideInR CCTransitionSlideInR;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionSlideInB CCTransitionSlideInB;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionSlideInT CCTransitionSlideInT;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionShrinkGrow CCTransitionShrinkGrow;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFlipX CCTransitionFlipX;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFlipY CCTransitionFlipY;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFlipAngular CCTransitionFlipAngular;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionZoomFlipX CCTransitionZoomFlipX;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionZoomFlipY CCTransitionZoomFlipY;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionZoomFlipAngular CCTransitionZoomFlipAngular;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFade CCTransitionFade;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionCrossFade CCTransitionCrossFade;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionTurnOffTiles CCTransitionTurnOffTiles;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionSplitCols CCTransitionSplitCols;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionSplitRows CCTransitionSplitRows;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFadeTR CCTransitionFadeTR;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFadeBL CCTransitionFadeBL;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFadeUp CCTransitionFadeUp;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionFadeDown CCTransitionFadeDown;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionPageTurn CCTransitionPageTurn;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionProgress CCTransitionProgress;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionProgressRadialCCW CCTransitionProgressRadialCCW;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionProgressRadialCW CCTransitionProgressRadialCW;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionProgressHorizontal CCTransitionProgressHorizontal;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionProgressVertical CCTransitionProgressVertical;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionProgressInOut CCTransitionProgressInOut;\nCC_DEPRECATED_ATTRIBUTE typedef TransitionProgressOutIn CCTransitionProgressOutIn;\nCC_DEPRECATED_ATTRIBUTE typedef MenuItem CCMenuItem;\nCC_DEPRECATED_ATTRIBUTE typedef MenuItemLabel CCMenuItemLabel;\nCC_DEPRECATED_ATTRIBUTE typedef MenuItemAtlasFont CCMenuItemAtlasFont;\nCC_DEPRECATED_ATTRIBUTE typedef MenuItemFont CCMenuItemFont;\nCC_DEPRECATED_ATTRIBUTE typedef MenuItemSprite CCMenuItemSprite;\nCC_DEPRECATED_ATTRIBUTE typedef MenuItemImage CCMenuItemImage;\nCC_DEPRECATED_ATTRIBUTE typedef MenuItemToggle CCMenuItemToggle;\nCC_DEPRECATED_ATTRIBUTE typedef Menu CCMenu;\nCC_DEPRECATED_ATTRIBUTE typedef ClippingNode CCClippingNode;\nCC_DEPRECATED_ATTRIBUTE typedef MotionStreak CCMotionStreak;\nCC_DEPRECATED_ATTRIBUTE typedef ProgressTimer CCProgressTimer;\nCC_DEPRECATED_ATTRIBUTE typedef RenderTexture CCRenderTexture;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleBatchNode CCParticleBatchNode;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleSystem CCParticleSystem;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleSystemQuad CCParticleSystemQuad;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleFire CCParticleFire;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleFireworks CCParticleFireworks;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleSun CCParticleSun;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleGalaxy CCParticleGalaxy;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleFlower CCParticleFlower;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleMeteor CCParticleMeteor;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleSpiral CCParticleSpiral;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleExplosion CCParticleExplosion;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleSmoke CCParticleSmoke;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleSnow CCParticleSnow;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleRain CCParticleRain;\nCC_DEPRECATED_ATTRIBUTE typedef FileUtils CCFileUtils;\nCC_DEPRECATED_ATTRIBUTE typedef Application CCApplication;\nCC_DEPRECATED_ATTRIBUTE typedef ShaderCache CCShaderCache;\nCC_DEPRECATED_ATTRIBUTE typedef AnimationCache CCAnimationCache;\nCC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCache CCSpriteFrameCache;\nCC_DEPRECATED_ATTRIBUTE typedef TextureCache CCTextureCache;\nCC_DEPRECATED_ATTRIBUTE typedef ParallaxNode CCParallaxNode;\nCC_DEPRECATED_ATTRIBUTE typedef TMXObjectGroup CCTMXObjectGroup;\nCC_DEPRECATED_ATTRIBUTE typedef TMXLayerInfo CCTMXLayerInfo;\nCC_DEPRECATED_ATTRIBUTE typedef TMXTilesetInfo CCTMXTilesetInfo;\nCC_DEPRECATED_ATTRIBUTE typedef TMXMapInfo CCTMXMapInfo;\nCC_DEPRECATED_ATTRIBUTE typedef TMXLayer CCTMXLayer;\nCC_DEPRECATED_ATTRIBUTE typedef TMXTiledMap CCTMXTiledMap;\nCC_DEPRECATED_ATTRIBUTE typedef TileMapAtlas CCTileMapAtlas;\nCC_DEPRECATED_ATTRIBUTE typedef Timer CCTimer;\nCC_DEPRECATED_ATTRIBUTE typedef Scheduler CCScheduler;\nCC_DEPRECATED_ATTRIBUTE typedef EGLView CCEGLView;\n\nCC_DEPRECATED_ATTRIBUTE typedef Component CCComponent;\nCC_DEPRECATED_ATTRIBUTE typedef AffineTransform CCAffineTransform;\nCC_DEPRECATED_ATTRIBUTE typedef Point CCPoint;\nCC_DEPRECATED_ATTRIBUTE typedef Size CCSize;\nCC_DEPRECATED_ATTRIBUTE typedef Rect CCRect;\nCC_DEPRECATED_ATTRIBUTE typedef Color3B ccColor3B;\nCC_DEPRECATED_ATTRIBUTE typedef Color4F ccColor4F;\nCC_DEPRECATED_ATTRIBUTE typedef Color4B ccColor4B;\nCC_DEPRECATED_ATTRIBUTE typedef Vertex2F ccVertex2F;\nCC_DEPRECATED_ATTRIBUTE typedef Vertex3F ccVertex3F;\nCC_DEPRECATED_ATTRIBUTE typedef Tex2F ccTex2F;\nCC_DEPRECATED_ATTRIBUTE typedef PointSprite ccPointSprite;\nCC_DEPRECATED_ATTRIBUTE typedef Quad2 ccQuad2;\nCC_DEPRECATED_ATTRIBUTE typedef Quad3 ccQuad3;\nCC_DEPRECATED_ATTRIBUTE typedef V2F_C4B_T2F ccV2F_C4B_T2F;\nCC_DEPRECATED_ATTRIBUTE typedef V2F_C4F_T2F ccV2F_C4F_T2F;\nCC_DEPRECATED_ATTRIBUTE typedef V3F_C4B_T2F ccV3F_C4B_T2F;\nCC_DEPRECATED_ATTRIBUTE typedef V2F_C4B_T2F_Triangle ccV2F_C4B_T2F_Triangle;\nCC_DEPRECATED_ATTRIBUTE typedef V2F_C4B_T2F_Quad ccV2F_C4B_T2F_Quad;\nCC_DEPRECATED_ATTRIBUTE typedef V3F_C4B_T2F_Quad ccV3F_C4B_T2F_Quad;\nCC_DEPRECATED_ATTRIBUTE typedef V2F_C4F_T2F_Quad ccV2F_C4F_T2F_Quad;\nCC_DEPRECATED_ATTRIBUTE typedef BlendFunc ccBlendFunc;\nCC_DEPRECATED_ATTRIBUTE typedef T2F_Quad ccT2F_Quad;\nCC_DEPRECATED_ATTRIBUTE typedef AnimationFrameData ccAnimationFrameData;\nCC_DEPRECATED_ATTRIBUTE typedef FontShadow ccFontShadow;\nCC_DEPRECATED_ATTRIBUTE typedef FontStroke ccFontStroke;\nCC_DEPRECATED_ATTRIBUTE typedef FontDefinition ccFontDefinition;\n\nCC_DEPRECATED_ATTRIBUTE typedef TextVAlignment CCVerticalTextAlignment;\nCC_DEPRECATED_ATTRIBUTE typedef TextHAlignment CCTextAlignment;\nCC_DEPRECATED_ATTRIBUTE typedef ProgressTimer::Type CCProgressTimerType;\n\nCC_DEPRECATED_ATTRIBUTE typedef void* CCZone;\n\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_Position = GLProgram::VERTEX_ATTRIB_POSITION;\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_Color = GLProgram::VERTEX_ATTRIB_COLOR;\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_TexCoords = GLProgram::VERTEX_ATTRIB_TEX_COORDS;\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttrib_MAX = GLProgram::VERTEX_ATTRIB_MAX;\n\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformPMatrix = GLProgram::UNIFORM_P_MATRIX;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformMVMatrix = GLProgram::UNIFORM_MV_MATRIX;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformMVPMatrix = GLProgram::UNIFORM_MVP_MATRIX;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformTime = GLProgram::UNIFORM_TIME;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformSinTime = GLProgram::UNIFORM_SIN_TIME;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformCosTime = GLProgram::UNIFORM_COS_TIME;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformRandom01 = GLProgram::UNIFORM_RANDOM01;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniformSampler = GLProgram::UNIFORM_SAMPLER;\nCC_DEPRECATED_ATTRIBUTE const int kCCUniform_MAX = GLProgram::UNIFORM_MAX;\n\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTextureColor;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTextureColorAlphaTest;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionColor;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTexture;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTexture_uColor;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionTextureA8Color;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_Position_uColor;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCShader_PositionLengthTexureColor;\n\n// uniform names\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformPMatrix_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformMVMatrix_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformMVPMatrix_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformTime_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformSinTime_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformCosTime_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformRandom01_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformSampler_s;\nCC_DEPRECATED_ATTRIBUTE extern const char* kCCUniformAlphaTestValue;\n\n// Attribute names\nCC_DEPRECATED_ATTRIBUTE extern const char*    kCCAttributeNameColor;\nCC_DEPRECATED_ATTRIBUTE extern const char*    kCCAttributeNamePosition;\nCC_DEPRECATED_ATTRIBUTE extern const char*    kCCAttributeNameTexCoord;\n\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_None = GL::VERTEX_ATTRIB_FLAT_NONE;\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_Position = GL::VERTEX_ATTRIB_FLAG_POSITION;\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_Color = GL::VERTEX_ATTRIB_FLAG_COLOR;\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_TexCoords = GL::VERTEX_ATTRIB_FLAG_TEX_COORDS;\nCC_DEPRECATED_ATTRIBUTE const int kCCVertexAttribFlag_PosColorTex = GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX;\n\nCC_DEPRECATED_ATTRIBUTE const ProgressTimer::Type kCCProgressTimerTypeRadial = ProgressTimer::Type::RADIAL;\nCC_DEPRECATED_ATTRIBUTE const ProgressTimer::Type kCCProgressTimerTypeBar = ProgressTimer::Type::BAR;\nCC_DEPRECATED_ATTRIBUTE typedef ProgressTimer::Type ProgressTimerType;\n\nCC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjection2D = Director::Projection::_2D;\nCC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjection3D = Director::Projection::_3D;\nCC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjectionCustom = Director::Projection::CUSTOM;\nCC_DEPRECATED_ATTRIBUTE const Director::Projection kCCDirectorProjectionDefault = Director::Projection::DEFAULT;\nCC_DEPRECATED_ATTRIBUTE typedef Director::Projection ccDirectorProjection;\n\nCC_DEPRECATED_ATTRIBUTE const TextVAlignment kCCVerticalTextAlignmentTop = TextVAlignment::TOP;\nCC_DEPRECATED_ATTRIBUTE const TextVAlignment kCCVerticalTextAlignmentCenter = TextVAlignment::CENTER;\nCC_DEPRECATED_ATTRIBUTE const TextVAlignment kCCVerticalTextAlignmentBottom = TextVAlignment::BOTTOM;\n\nCC_DEPRECATED_ATTRIBUTE const TextHAlignment kCCTextAlignmentLeft = TextHAlignment::LEFT;\nCC_DEPRECATED_ATTRIBUTE const TextHAlignment kCCTextAlignmentCenter = TextHAlignment::CENTER;\nCC_DEPRECATED_ATTRIBUTE const TextHAlignment kCCTextAlignmentRight = TextHAlignment::RIGHT;\n\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA8888 = Texture2D::PixelFormat::RGBA8888;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB888 = Texture2D::PixelFormat::RGB888;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB565 = Texture2D::PixelFormat::RGB565;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_A8 = Texture2D::PixelFormat::A8;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_I8 = Texture2D::PixelFormat::I8;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_AI88 = Texture2D::PixelFormat::AI88;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGBA4444 = Texture2D::PixelFormat::RGBA4444;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_RGB5A1 = Texture2D::PixelFormat::RGB5A1;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC4 = Texture2D::PixelFormat::PVRTC4;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_PVRTC2 = Texture2D::PixelFormat::PVRTC2;\nCC_DEPRECATED_ATTRIBUTE const Texture2D::PixelFormat kCCTexture2DPixelFormat_Default = Texture2D::PixelFormat::DEFAULT;\n\nCC_DEPRECATED_ATTRIBUTE typedef Texture2D::PixelFormat CCTexture2DPixelFormat;\n\n\nCC_DEPRECATED_ATTRIBUTE const int kCCParticleDurationInfinity = ParticleSystem::DURATION_INFINITY;\nCC_DEPRECATED_ATTRIBUTE const int kCCParticleStartSizeEqualToEndSize = ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE;\nCC_DEPRECATED_ATTRIBUTE const int kCCParticleStartRadiusEqualToEndRadius = ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS;\n\nCC_DEPRECATED_ATTRIBUTE const int kParticleDurationInfinity = ParticleSystem::DURATION_INFINITY;\nCC_DEPRECATED_ATTRIBUTE const int kParticleStartSizeEqualToEndSize = ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE;\nCC_DEPRECATED_ATTRIBUTE const int kParticleStartRadiusEqualToEndRadius = ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS;\n\nCC_DEPRECATED_ATTRIBUTE const ParticleSystem::Mode kCCParticleModeGravity = ParticleSystem::Mode::GRAVITY;\nCC_DEPRECATED_ATTRIBUTE const ParticleSystem::Mode kCCParticleModeRadius = ParticleSystem::Mode::RADIUS;\nCC_DEPRECATED_ATTRIBUTE const int kCCParticleDefaultCapacity = kParticleDefaultCapacity;\n\nCC_DEPRECATED_ATTRIBUTE const ParticleSystem::PositionType kCCPositionTypeFree =  ParticleSystem::PositionType::FREE;\nCC_DEPRECATED_ATTRIBUTE const ParticleSystem::PositionType kCCPositionTypeRelative =  ParticleSystem::PositionType::RELATIVE;\nCC_DEPRECATED_ATTRIBUTE const ParticleSystem::PositionType kCCPositionTypeGrouped =  ParticleSystem::PositionType::GROUPED;\n\nCC_DEPRECATED_ATTRIBUTE typedef ParticleSystem::PositionType tPositionType;\n\n#define kCCLabelAutomaticWidth  kLabelAutomaticWidth\n\n\nCC_DEPRECATED_ATTRIBUTE const Menu::State kCCMenuStateWaiting = Menu::State::WAITING;\nCC_DEPRECATED_ATTRIBUTE const Menu::State kCCMenuStateTrackingTouch = Menu::State::TRACKING_TOUCH;\n\nCC_DEPRECATED_ATTRIBUTE typedef Menu::State tMenuState;\n\nCC_DEPRECATED_ATTRIBUTE const Touch::DispatchMode kCCTouchesOneByOne = Touch::DispatchMode::ONE_BY_ONE;\nCC_DEPRECATED_ATTRIBUTE const Touch::DispatchMode kCCTouchesAllAtOnce = Touch::DispatchMode::ALL_AT_ONCE;\n\nCC_DEPRECATED_ATTRIBUTE typedef Touch::DispatchMode ccTouchesMode;\n\nCC_DEPRECATED_ATTRIBUTE const Image::Format kCCImageFormatPNG = Image::Format::PNG;\nCC_DEPRECATED_ATTRIBUTE const Image::Format kCCImageFormatJPEG = Image::Format::JPG;\n\nCC_DEPRECATED_ATTRIBUTE typedef Image::Format tImageFormat;\n\nCC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationLeftOver = TransitionScene::Orientation::LEFT_OVER;\nCC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationRightOver = TransitionScene::Orientation::RIGHT_OVER;\nCC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationUpOver = TransitionScene::Orientation::UP_OVER;\nCC_DEPRECATED_ATTRIBUTE const TransitionScene::Orientation kCCTransitionOrientationDownOver = TransitionScene::Orientation::DOWN_OVER;\n\nCC_DEPRECATED_ATTRIBUTE typedef TransitionScene::Orientation tOrientation;\n\nCC_DEPRECATED_ATTRIBUTE const int kCCPrioritySystem = Scheduler::PRIORITY_SYSTEM;\nCC_DEPRECATED_ATTRIBUTE const int kCCPriorityNonSystemMin = Scheduler::PRIORITY_NON_SYSTEM_MIN;\n\nCC_DEPRECATED_ATTRIBUTE const int kCCActionTagInvalid = Action::INVALID_TAG;\nCC_DEPRECATED_ATTRIBUTE const int kCCNodeTagInvalid = Node::INVALID_TAG;\n\nCC_DEPRECATED_ATTRIBUTE const int kCCNodeOnEnter = kNodeOnEnter;\nCC_DEPRECATED_ATTRIBUTE const int kCCNodeOnExit = kNodeOnExit;\nCC_DEPRECATED_ATTRIBUTE const int kCCNodeOnEnterTransitionDidFinish = kNodeOnEnterTransitionDidFinish;\nCC_DEPRECATED_ATTRIBUTE const int kCCNodeOnExitTransitionDidStart = kNodeOnExitTransitionDidStart;\nCC_DEPRECATED_ATTRIBUTE const int kCCNodeOnCleanup = kNodeOnCleanup;\n\n\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageEnglish     = LanguageType::ENGLISH;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageChinese     = LanguageType::CHINESE;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageFrench      = LanguageType::FRENCH;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageItalian     = LanguageType::ITALIAN;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageGerman      = LanguageType::GERMAN;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageSpanish     = LanguageType::SPANISH;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageRussian     = LanguageType::RUSSIAN;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageKorean      = LanguageType::KOREAN;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageJapanese    = LanguageType::JAPANESE;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageHungarian   = LanguageType::HUNGARIAN;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguagePortuguese  = LanguageType::PORTUGUESE;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageArabic      = LanguageType::ARABIC;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguageNorwegian   = LanguageType::NORWEGIAN;\nCC_DEPRECATED_ATTRIBUTE const LanguageType kLanguagePolish      = LanguageType::POLISH;\nCC_DEPRECATED_ATTRIBUTE typedef LanguageType ccLanguageType;\n\n\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetWindows      = Application::Platform::OS_WINDOWS;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetLinux        = Application::Platform::OS_LINUX;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetMacOS        = Application::Platform::OS_MAC;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetAndroid      = Application::Platform::OS_ANDROID;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetIphone       = Application::Platform::OS_IPHONE;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetIpad         = Application::Platform::OS_IPAD;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetBlackBerry   = Application::Platform::OS_BLACKBERRY;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetNaCl         = Application::Platform::OS_NACL;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetEmscripten   = Application::Platform::OS_EMSCRIPTEN;\nCC_DEPRECATED_ATTRIBUTE const Application::Platform kTargetTizen        = Application::Platform::OS_TIZEN;\nCC_DEPRECATED_ATTRIBUTE typedef Application::Platform TargetPlatform;\n\nCC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionExactFit      = ResolutionPolicy::EXACT_FIT;\nCC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionNoBorder      = ResolutionPolicy::NO_BORDER;\nCC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionShowAll       = ResolutionPolicy::SHOW_ALL;\nCC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionFixedHeight   = ResolutionPolicy::FIXED_HEIGHT;\nCC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionFixedWidth    = ResolutionPolicy::FIXED_WIDTH;\nCC_DEPRECATED_ATTRIBUTE const ResolutionPolicy kResolutionUnKnown       = ResolutionPolicy::UNKNOWN;\n\n\n#define kCCTMXTileHorizontalFlag      kTMXTileHorizontalFlag\n#define kCCTMXTileVerticalFlag        kTMXTileVerticalFlag\n#define kCCTMXTileDiagonalFlag        kTMXTileDiagonalFlag\n#define kCCFlipedAll                  kFlipedAll\n#define kCCFlippedMask                kFlippedMask\n\n\n/** use log() instead */\nCC_DEPRECATED_ATTRIBUTE void CC_DLL CCLog(const char * pszFormat, ...) CC_FORMAT_PRINTF(1, 2);\n\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawInit();\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawFree();\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoint( const Point& point );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoints( const Point *points, unsigned int numberOfPoints );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawLine( const Point& origin, const Point& destination );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawRect( Point origin, Point destination );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidRect( Point origin, Point destination, Color4F color );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawPoly( const Point *vertices, unsigned int numOfVertices, bool closePolygon );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidPoly( const Point *poli, unsigned int numberOfPoints, Color4F color );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY);\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter);\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY);\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments);\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawQuadBezier(const Point& origin, const Point& control, const Point& destination, unsigned int segments);\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCubicBezier(const Point& origin, const Point& control1, const Point& control2, const Point& destination, unsigned int segments);\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCatmullRom( PointArray *arrayOfControlPoints, unsigned int segments );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawCardinalSpline( PointArray *config, float tension,  unsigned int segments );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawColor4B( GLubyte r, GLubyte g, GLubyte b, GLubyte a );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccDrawColor4F( GLfloat r, GLfloat g, GLfloat b, GLfloat a );\nCC_DEPRECATED_ATTRIBUTE void CC_DLL ccPointSize( GLfloat pointSize );\n\n\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLInvalidateStateCache() { GL::invalidateStateCache(); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLUseProgram(GLuint program) { GL::useProgram(program); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteProgram(GLuint program){ GL::deleteProgram(program); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBlendFunc(GLenum sfactor, GLenum dfactor) { GL::blendFunc(sfactor, dfactor); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBlendResetToCache() { GL::blendResetToCache(); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccSetProjectionMatrixDirty() { GL::setProjectionMatrixDirty(); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnableVertexAttribs(unsigned int flags) { GL::enableVertexAttribs(flags); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2D(GLuint textureId) { GL::bindTexture2D(textureId); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindTexture2DN(GLuint textureUnit, GLuint textureId) { GL::bindTexture2DN(textureUnit, textureId); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTexture(GLuint textureId) { GL::deleteTexture(textureId); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLDeleteTextureN(GLuint textureUnit, GLuint textureId) { GL::deleteTextureN(textureUnit, textureId); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLBindVAO(GLuint vaoId) { GL::bindVAO(vaoId); }\nCC_DEPRECATED_ATTRIBUTE inline void CC_DLL ccGLEnable( int flags ) { /* ignore */ };\nCC_DEPRECATED_ATTRIBUTE typedef int ccGLServerState;\n\nCC_DEPRECATED_ATTRIBUTE typedef Data CCData;\nCC_DEPRECATED_ATTRIBUTE typedef __Set CCSet;\nCC_DEPRECATED_ATTRIBUTE typedef __SetIterator CCSetIterator;\nCC_DEPRECATED_ATTRIBUTE typedef __Set Set;\nCC_DEPRECATED_ATTRIBUTE typedef __SetIterator SetIterator;\n\nCC_DEPRECATED_ATTRIBUTE typedef __Array CCArray;\nCC_DEPRECATED_ATTRIBUTE typedef __Array Array;\n\nCC_DEPRECATED_ATTRIBUTE typedef __Dictionary Dictionary;\nCC_DEPRECATED_ATTRIBUTE typedef __Dictionary CCDictionary;\n\nCC_DEPRECATED_ATTRIBUTE typedef __Double Double;\nCC_DEPRECATED_ATTRIBUTE typedef __Double CCDouble;\nCC_DEPRECATED_ATTRIBUTE typedef __Float Float;\nCC_DEPRECATED_ATTRIBUTE typedef __Float CCFloat;\nCC_DEPRECATED_ATTRIBUTE typedef __Integer Integer;\nCC_DEPRECATED_ATTRIBUTE typedef __Integer CCInteger;\nCC_DEPRECATED_ATTRIBUTE typedef __Bool Bool;\nCC_DEPRECATED_ATTRIBUTE typedef __Bool CCBool;\nCC_DEPRECATED_ATTRIBUTE typedef __String CCString;\nCC_DEPRECATED_ATTRIBUTE typedef __String String;\n\nCC_DEPRECATED_ATTRIBUTE typedef __RGBAProtocol RGBAProtocol;\nCC_DEPRECATED_ATTRIBUTE typedef __NodeRGBA NodeRGBA;\nCC_DEPRECATED_ATTRIBUTE typedef __LayerRGBA LayerRGBA;\n\nNS_CC_END\n\n\n#endif // __COCOS2D_CCDEPRECATED_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDirector.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2013 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n// cocos2d includes\n#include \"CCDirector.h\"\n\n// standard includes\n#include <string>\n\n#include \"ccFPSImages.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"CCNS.h\"\n#include \"CCScene.h\"\n#include \"CCArray.h\"\n#include \"CCScheduler.h\"\n#include \"ccMacros.h\"\n#include \"CCTransition.h\"\n#include \"CCTextureCache.h\"\n#include \"CCSpriteFrameCache.h\"\n#include \"CCAutoreleasePool.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCApplication.h\"\n#include \"CCLabelBMFont.h\"\n#include \"CCActionManager.h\"\n#include \"CCAnimationCache.h\"\n#include \"CCTouch.h\"\n#include \"CCUserDefault.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCShaderCache.h\"\n#include \"kazmath/kazmath.h\"\n#include \"kazmath/GL/matrix.h\"\n#include \"CCProfiling.h\"\n#include \"platform/CCImage.h\"\n#include \"CCEGLView.h\"\n#include \"CCConfiguration.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventCustom.h\"\n#include \"CCFontFreeType.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCFrustum.h\"\n#include \"CCConsole.h\"\n\n/**\n Position of the FPS\n \n Default: 0,0 (bottom-left corner)\n */\n#ifndef CC_DIRECTOR_STATS_POSITION\n#define CC_DIRECTOR_STATS_POSITION Director::getInstance()->getVisibleOrigin()\n#endif\n\nusing namespace std;\n\nunsigned int g_uNumberOfDraws = 0;\n\nNS_CC_BEGIN\n// XXX it should be a Director ivar. Move it there once support for multiple directors is added\n\n// singleton stuff\nstatic DisplayLinkDirector *s_SharedDirector = nullptr;\n\n#define kDefaultFPS        60  // 60 frames per second\nextern const char* cocos2dVersion(void);\n\nconst char *Director::EVENT_PROJECTION_CHANGED = \"director_projection_changed\";\nconst char *Director::EVENT_AFTER_DRAW = \"director_after_draw\";\nconst char *Director::EVENT_AFTER_VISIT = \"director_after_visit\";\nconst char *Director::EVENT_AFTER_UPDATE = \"director_after_udpate\";\n\nDirector* Director::getInstance()\n{\n    if (!s_SharedDirector)\n    {\n        s_SharedDirector = new DisplayLinkDirector();\n        s_SharedDirector->init();\n    }\n\n    return s_SharedDirector;\n}\n\nDirector::Director()\n{\n}\n\nbool Director::init(void)\n{\n    setDefaultValues();\n\n    // scenes\n    _runningScene = nullptr;\n    _nextScene = nullptr;\n\n    _notificationNode = nullptr;\n\n    _scenesStack.reserve(15);\n\n    // FPS\n    _accumDt = 0.0f;\n    _frameRate = 0.0f;\n    _FPSLabel = nullptr;\n    _SPFLabel = nullptr;\n    _drawsLabel = nullptr;\n    _totalFrames = _frames = 0;\n    _FPS = new char[10];\n    _lastUpdate = new struct timeval;\n\n    // paused ?\n    _paused = false;\n\n    // purge ?\n    _purgeDirectorInNextLoop = false;\n\n    _winSizeInPoints = Size::ZERO;\n\n    _openGLView = nullptr;\n\n    _cullingFrustum = new Frustum();\n\n    _contentScaleFactor = 1.0f;\n\n    // scheduler\n    _scheduler = new Scheduler();\n    // action manager\n    _actionManager = new ActionManager();\n    _scheduler->scheduleUpdateForTarget(_actionManager, Scheduler::PRIORITY_SYSTEM, false);\n\n    _eventDispatcher = new EventDispatcher();\n    _eventAfterDraw = new EventCustom(EVENT_AFTER_DRAW);\n    _eventAfterDraw->setUserData(this);\n    _eventAfterVisit = new EventCustom(EVENT_AFTER_VISIT);\n    _eventAfterVisit->setUserData(this);\n    _eventAfterUpdate = new EventCustom(EVENT_AFTER_UPDATE);\n    _eventAfterUpdate->setUserData(this);\n    _eventProjectionChanged = new EventCustom(EVENT_PROJECTION_CHANGED);\n    _eventProjectionChanged->setUserData(this);\n\n\n    //init TextureCache\n    initTextureCache();\n\n    _renderer = new Renderer;\n    _console = new Console;\n\n    return true;\n}\n\nDirector::~Director(void)\n{\n    CCLOGINFO(\"deallocing Director: %p\", this);\n\n    CC_SAFE_RELEASE(_FPSLabel);\n    CC_SAFE_RELEASE(_SPFLabel);\n    CC_SAFE_RELEASE(_drawsLabel);\n\n    CC_SAFE_RELEASE(_runningScene);\n    CC_SAFE_RELEASE(_notificationNode);\n    CC_SAFE_RELEASE(_scheduler);\n    CC_SAFE_RELEASE(_actionManager);\n    CC_SAFE_RELEASE(_eventDispatcher);\n\n    delete _eventAfterUpdate;\n    delete _eventAfterDraw;\n    delete _eventAfterVisit;\n    delete _eventProjectionChanged;\n\n    delete _renderer;\n    delete _console;\n\n    // clean auto release pool\n    PoolManager::destroyInstance();\n\n    // delete _lastUpdate\n    CC_SAFE_DELETE(_lastUpdate);\n    // delete fps string\n    delete []_FPS;\n\n    s_SharedDirector = nullptr;\n}\n\nvoid Director::setDefaultValues(void)\n{\n\tConfiguration *conf = Configuration::getInstance();\n\n\t// default FPS\n\tdouble fps = conf->getValue(\"cocos2d.x.fps\", Value(kDefaultFPS)).asDouble();\n\t_oldAnimationInterval = _animationInterval = 1.0 / fps;\n\n\t// Display FPS\n\t_displayStats = conf->getValue(\"cocos2d.x.display_fps\", Value(false)).asBool();\n\n\t// GL projection\n    std::string projection = conf->getValue(\"cocos2d.x.gl.projection\", Value(\"3d\")).asString();\n\tif (projection == \"3d\")\n\t\t_projection = Projection::_3D;\n\telse if (projection == \"2d\")\n\t\t_projection = Projection::_2D;\n\telse if (projection == \"custom\")\n\t\t_projection = Projection::CUSTOM;\n\telse\n\t\tCCASSERT(false, \"Invalid projection value\");\n\n\t// Default pixel format for PNG images with alpha\n    std::string pixel_format = conf->getValue(\"cocos2d.x.texture.pixel_format_for_png\", Value(\"rgba8888\")).asString();\n\tif (pixel_format == \"rgba8888\")\n\t\tTexture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);\n\telse if(pixel_format == \"rgba4444\")\n\t\tTexture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);\n\telse if(pixel_format == \"rgba5551\")\n\t\tTexture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1);\n\n\t// PVR v2 has alpha premultiplied ?\n\tbool pvr_alpha_premultipled = conf->getValue(\"cocos2d.x.texture.pvrv2_has_alpha_premultiplied\", Value(false)).asBool();\n\tTexture2D::PVRImagesHavePremultipliedAlpha(pvr_alpha_premultipled);\n}\n\nvoid Director::setGLDefaultValues()\n{\n    // This method SHOULD be called only after openGLView_ was initialized\n    CCASSERT(_openGLView, \"opengl view should not be null\");\n\n    setAlphaBlending(true);\n    // XXX: Fix me, should enable/disable depth test according the depth format as cocos2d-iphone did\n    // [self setDepthTest: view_.depthFormat];\n    setDepthTest(false);\n    setProjection(_projection);\n\n    // set other opengl default values\n    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);\n}\n\n// Draw the Scene\nvoid Director::drawScene()\n{\n    // calculate \"global\" dt\n    calculateDeltaTime();\n\n    if (_openGLView)\n    {\n        _openGLView->pollInputEvents();\n    }\n\n    //tick before glClear: issue #533\n    if (! _paused)\n    {\n        _scheduler->update(_deltaTime);\n        _eventDispatcher->dispatchEvent(_eventAfterUpdate);\n    }\n\n    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n\n    /* to avoid flickr, nextScene MUST be here: after tick and before draw.\n     XXX: Which bug is this one. It seems that it can't be reproduced with v0.9 */\n    if (_nextScene)\n    {\n        setNextScene();\n    }\n\n    kmGLPushMatrix();\n\n    //construct the frustum\n    {\n        kmMat4 view;\n        kmMat4 projection;\n        kmGLGetMatrix(KM_GL_PROJECTION, &projection);\n        kmGLGetMatrix(KM_GL_MODELVIEW, &view);\n\n        _cullingFrustum->setupFromMatrix(view, projection);\n    }\n\n    // draw the scene\n    if (_runningScene)\n    {\n        _runningScene->visit();\n        _eventDispatcher->dispatchEvent(_eventAfterVisit);\n    }\n\n    // draw the notifications node\n    if (_notificationNode)\n    {\n        _notificationNode->visit();\n    }\n\n    if (_displayStats)\n    {\n        showStats();\n    }\n\n    _renderer->render();\n    _eventDispatcher->dispatchEvent(_eventAfterDraw);\n\n    kmGLPopMatrix();\n\n    _totalFrames++;\n\n    // swap buffers\n    if (_openGLView)\n    {\n        _openGLView->swapBuffers();\n    }\n\n    if (_displayStats)\n    {\n        calculateMPF();\n    }\n}\n\nvoid Director::calculateDeltaTime()\n{\n    struct timeval now;\n\n    if (gettimeofday(&now, nullptr) != 0)\n    {\n        CCLOG(\"error in gettimeofday\");\n        _deltaTime = 0;\n        return;\n    }\n\n    // new delta time. Re-fixed issue #1277\n    if (_nextDeltaTimeZero)\n    {\n        _deltaTime = 0;\n        _nextDeltaTimeZero = false;\n    }\n    else\n    {\n        _deltaTime = (now.tv_sec - _lastUpdate->tv_sec) + (now.tv_usec - _lastUpdate->tv_usec) / 1000000.0f;\n        _deltaTime = MAX(0, _deltaTime);\n    }\n\n#if COCOS2D_DEBUG\n    // If we are debugging our code, prevent big delta time\n    if (_deltaTime > 0.2f)\n    {\n        _deltaTime = 1 / 60.0f;\n    }\n#endif\n\n    *_lastUpdate = now;\n}\nfloat Director::getDeltaTime() const\n{\n\treturn _deltaTime;\n}\nvoid Director::setOpenGLView(EGLView *openGLView)\n{\n    CCASSERT(openGLView, \"opengl view should not be null\");\n\n    if (_openGLView != openGLView)\n    {\n\t\t// Configuration. Gather GPU info\n\t\tConfiguration *conf = Configuration::getInstance();\n\t\tconf->gatherGPUInfo();\n        CCLOG(\"%s\\n\",conf->getInfo().c_str());\n\n        // EAGLView is not a Object\n        delete _openGLView; // [openGLView_ release]\n        _openGLView = openGLView;\n\n        // set size\n        _winSizeInPoints = _openGLView->getDesignResolutionSize();\n\n        createStatsLabel();\n\n        if (_openGLView)\n        {\n            setGLDefaultValues();\n        }\n\n        _renderer->initGLView();\n\n        CHECK_GL_ERROR_DEBUG();\n\n//        _touchDispatcher->setDispatchEvents(true);\n    }\n}\n\nTextureCache* Director::getTextureCache() const\n{\n    return _textureCache;\n}\n\nvoid Director::initTextureCache()\n{\n#ifdef EMSCRIPTEN\n    _textureCache = new TextureCacheEmscripten();\n#else\n    _textureCache = new TextureCache();\n#endif // EMSCRIPTEN\n}\n\nvoid Director::destroyTextureCache()\n{\n    if (_textureCache)\n    {\n        _textureCache->waitForQuit();\n        CC_SAFE_RELEASE_NULL(_textureCache);\n    }\n}\n\nvoid Director::setViewport()\n{\n    if (_openGLView)\n    {\n        _openGLView->setViewPortInPoints(0, 0, _winSizeInPoints.width, _winSizeInPoints.height);\n    }\n}\n\nvoid Director::setNextDeltaTimeZero(bool bNextDeltaTimeZero)\n{\n    _nextDeltaTimeZero = bNextDeltaTimeZero;\n}\n\nvoid Director::setProjection(Projection projection)\n{\n    Size size = _winSizeInPoints;\n\n    setViewport();\n\n    switch (projection)\n    {\n        case Projection::_2D:\n            kmGLMatrixMode(KM_GL_PROJECTION);\n            kmGLLoadIdentity();\n            kmMat4 orthoMatrix;\n            kmMat4OrthographicProjection(&orthoMatrix, 0, size.width, 0, size.height, -1024, 1024);\n            kmGLMultMatrix(&orthoMatrix);\n            kmGLMatrixMode(KM_GL_MODELVIEW);\n            kmGLLoadIdentity();\n            break;\n\n        case Projection::_3D:\n        {\n            float zeye = this->getZEye();\n\n            kmMat4 matrixPerspective, matrixLookup;\n\n            kmGLMatrixMode(KM_GL_PROJECTION);\n            kmGLLoadIdentity();\n\n            // issue #1334\n            kmMat4PerspectiveProjection(&matrixPerspective, 60, (GLfloat)size.width/size.height, 0.1f, zeye*2);\n            // kmMat4PerspectiveProjection( &matrixPerspective, 60, (GLfloat)size.width/size.height, 0.1f, 1500);\n\n            kmGLMultMatrix(&matrixPerspective);\n\n            kmGLMatrixMode(KM_GL_MODELVIEW);\n            kmGLLoadIdentity();\n            kmVec3 eye, center, up;\n            kmVec3Fill(&eye, size.width/2, size.height/2, zeye);\n            kmVec3Fill(&center, size.width/2, size.height/2, 0.0f);\n            kmVec3Fill(&up, 0.0f, 1.0f, 0.0f);\n            kmMat4LookAt(&matrixLookup, &eye, &center, &up);\n            kmGLMultMatrix(&matrixLookup);\n            break;\n        }\n\n        case Projection::CUSTOM:\n            // Projection Delegate is no longer needed\n            // since the event \"PROJECTION CHANGED\" is emitted\n            break;\n\n        default:\n            CCLOG(\"cocos2d: Director: unrecognized projection\");\n            break;\n    }\n\n    _projection = projection;\n    GL::setProjectionMatrixDirty();\n\n    _eventDispatcher->dispatchEvent(_eventProjectionChanged);\n}\n\nvoid Director::purgeCachedData(void)\n{\n    LabelBMFont::purgeCachedData();\n    if (s_SharedDirector->getOpenGLView())\n    {\n        SpriteFrameCache::getInstance()->removeUnusedSpriteFrames();\n        _textureCache->removeUnusedTextures();\n    }\n    FileUtils::getInstance()->purgeCachedEntries();\n}\n\nfloat Director::getZEye(void) const\n{\n    return (_winSizeInPoints.height / 1.1566f);\n}\n\nvoid Director::setAlphaBlending(bool on)\n{\n    if (on)\n    {\n        GL::blendFunc(CC_BLEND_SRC, CC_BLEND_DST);\n    }\n    else\n    {\n        GL::blendFunc(GL_ONE, GL_ZERO);\n    }\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\nvoid Director::setDepthTest(bool on)\n{\n    if (on)\n    {\n        glClearDepth(1.0f);\n        glEnable(GL_DEPTH_TEST);\n        glDepthFunc(GL_LEQUAL);\n//        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);\n    }\n    else\n    {\n        glDisable(GL_DEPTH_TEST);\n    }\n    CHECK_GL_ERROR_DEBUG();\n}\n\nstatic void GLToClipTransform(kmMat4 *transformOut)\n{\n\tkmMat4 projection;\n\tkmGLGetMatrix(KM_GL_PROJECTION, &projection);\n\n\tkmMat4 modelview;\n\tkmGLGetMatrix(KM_GL_MODELVIEW, &modelview);\n\n\tkmMat4Multiply(transformOut, &projection, &modelview);\n}\n\nPoint Director::convertToGL(const Point& uiPoint)\n{\n    kmMat4 transform;\n\tGLToClipTransform(&transform);\n\n\tkmMat4 transformInv;\n\tkmMat4Inverse(&transformInv, &transform);\n\n\t// Calculate z=0 using -> transform*[0, 0, 0, 1]/w\n\tkmScalar zClip = transform.mat[14]/transform.mat[15];\n\n    Size glSize = _openGLView->getDesignResolutionSize();\n\tkmVec3 clipCoord = {2.0f*uiPoint.x/glSize.width - 1.0f, 1.0f - 2.0f*uiPoint.y/glSize.height, zClip};\n\n\tkmVec3 glCoord;\n\tkmVec3TransformCoord(&glCoord, &clipCoord, &transformInv);\n\n\treturn Point(glCoord.x, glCoord.y);\n}\n\nPoint Director::convertToUI(const Point& glPoint)\n{\n    kmMat4 transform;\n\tGLToClipTransform(&transform);\n\n\tkmVec3 clipCoord;\n\t// Need to calculate the zero depth from the transform.\n\tkmVec3 glCoord = {glPoint.x, glPoint.y, 0.0};\n\tkmVec3TransformCoord(&clipCoord, &glCoord, &transform);\n\n\tSize glSize = _openGLView->getDesignResolutionSize();\n\treturn Point(glSize.width*(clipCoord.x*0.5 + 0.5), glSize.height*(-clipCoord.y*0.5 + 0.5));\n}\n\nconst Size& Director::getWinSize(void) const\n{\n    return _winSizeInPoints;\n}\n\nSize Director::getWinSizeInPixels() const\n{\n    return Size(_winSizeInPoints.width * _contentScaleFactor, _winSizeInPoints.height * _contentScaleFactor);\n}\n\nSize Director::getVisibleSize() const\n{\n    if (_openGLView)\n    {\n        return _openGLView->getVisibleSize();\n    }\n    else\n    {\n        return Size::ZERO;\n    }\n}\n\nPoint Director::getVisibleOrigin() const\n{\n    if (_openGLView)\n    {\n        return _openGLView->getVisibleOrigin();\n    }\n    else\n    {\n        return Point::ZERO;\n    }\n}\n\n// scene management\n\nvoid Director::runWithScene(Scene *scene)\n{\n    CCASSERT(scene != nullptr, \"This command can only be used to start the Director. There is already a scene present.\");\n    CCASSERT(_runningScene == nullptr, \"_runningScene should be null\");\n\n    pushScene(scene);\n    startAnimation();\n}\n\nvoid Director::replaceScene(Scene *scene)\n{\n    CCASSERT(_runningScene, \"Use runWithScene: instead to start the director\");\n    CCASSERT(scene != nullptr, \"the scene should not be null\");\n\n    ssize_t index = _scenesStack.size();\n\n    _sendCleanupToScene = true;\n    _scenesStack.replace(index - 1, scene);\n\n    _nextScene = scene;\n}\n\nvoid Director::pushScene(Scene *scene)\n{\n    CCASSERT(scene, \"the scene should not null\");\n\n    _sendCleanupToScene = false;\n\n    _scenesStack.pushBack(scene);\n    _nextScene = scene;\n}\n\nvoid Director::popScene(void)\n{\n    CCASSERT(_runningScene != nullptr, \"running scene should not null\");\n\n    _scenesStack.popBack();\n    ssize_t c = _scenesStack.size();\n\n    if (c == 0)\n    {\n        end();\n    }\n    else\n    {\n        _sendCleanupToScene = true;\n        _nextScene = _scenesStack.at(c - 1);\n    }\n}\n\nvoid Director::popToRootScene(void)\n{\n    popToSceneStackLevel(1);\n}\n\nvoid Director::popToSceneStackLevel(int level)\n{\n    CCASSERT(_runningScene != nullptr, \"A running Scene is needed\");\n    ssize_t c = _scenesStack.size();\n\n    // level 0? -> end\n    if (level == 0)\n    {\n        end();\n        return;\n    }\n\n    // current level or lower -> nothing\n    if (level >= c)\n        return;\n\n\t// pop stack until reaching desired level\n\twhile (c > level)\n    {\n        auto current = _scenesStack.back();\n\n\t\tif (current->isRunning())\n        {\n            current->onExitTransitionDidStart();\n            current->onExit();\n\t\t}\n\n        current->cleanup();\n        _scenesStack.popBack();\n\t\t--c;\n\t}\n\n    _nextScene = _scenesStack.back();\n\t_sendCleanupToScene = false;\n}\n\nvoid Director::end()\n{\n    _purgeDirectorInNextLoop = true;\n}\n\nvoid Director::purgeDirector()\n{\n    // cleanup scheduler\n    getScheduler()->unscheduleAll();\n    \n    // don't release the event handlers\n    // They are needed in case the director is run again\n//    _touchDispatcher->removeAllDelegates();\n\n    if (_runningScene)\n    {\n        _runningScene->onExitTransitionDidStart();\n        _runningScene->onExit();\n        _runningScene->cleanup();\n        _runningScene->release();\n    }\n    \n    _runningScene = nullptr;\n    _nextScene = nullptr;\n\n    // remove all objects, but don't release it.\n    // runWithScene might be executed after 'end'.\n    _scenesStack.clear();\n\n    stopAnimation();\n\n    CC_SAFE_RELEASE_NULL(_FPSLabel);\n    CC_SAFE_RELEASE_NULL(_SPFLabel);\n    CC_SAFE_RELEASE_NULL(_drawsLabel);\n    CC_SAFE_DELETE(_cullingFrustum);\n\n    // purge bitmap cache\n    LabelBMFont::purgeCachedData();\n\n    FontFreeType::shutdownFreeType();\n\n    // purge all managed caches\n    DrawPrimitives::free();\n    AnimationCache::destroyInstance();\n    SpriteFrameCache::destroyInstance();\n    ShaderCache::destroyInstance();\n    FileUtils::destroyInstance();\n    Configuration::destroyInstance();\n\n    // cocos2d-x specific data structures\n    UserDefault::destroyInstance();\n    \n    GL::invalidateStateCache();\n    \n    destroyTextureCache();\n\n    CHECK_GL_ERROR_DEBUG();\n    \n    // OpenGL view\n    if (_openGLView)\n    {\n        _openGLView->end();\n        _openGLView = nullptr;\n    }\n\n    // delete Director\n    release();\n}\n\nvoid Director::setNextScene()\n{\n    bool runningIsTransition = dynamic_cast<TransitionScene*>(_runningScene) != nullptr;\n    bool newIsTransition = dynamic_cast<TransitionScene*>(_nextScene) != nullptr;\n\n    // If it is not a transition, call onExit/cleanup\n     if (! newIsTransition)\n     {\n         if (_runningScene)\n         {\n             _runningScene->onExitTransitionDidStart();\n             _runningScene->onExit();\n         }\n \n         // issue #709. the root node (scene) should receive the cleanup message too\n         // otherwise it might be leaked.\n         if (_sendCleanupToScene && _runningScene)\n         {\n             _runningScene->cleanup();\n         }\n     }\n\n    if (_runningScene)\n    {\n        _runningScene->release();\n    }\n    _runningScene = _nextScene;\n    _nextScene->retain();\n    _nextScene = nullptr;\n\n    if ((! runningIsTransition) && _runningScene)\n    {\n        _runningScene->onEnter();\n        _runningScene->onEnterTransitionDidFinish();\n    }\n}\n\nvoid Director::pause()\n{\n    if (_paused)\n    {\n        return;\n    }\n\n    _oldAnimationInterval = _animationInterval;\n\n    // when paused, don't consume CPU\n    setAnimationInterval(1 / 4.0);\n    _paused = true;\n}\n\nvoid Director::resume()\n{\n    if (! _paused)\n    {\n        return;\n    }\n\n    setAnimationInterval(_oldAnimationInterval);\n\n    _paused = false;\n    _deltaTime = 0;\n    // fix issue #3509, skip one fps to avoid incorrect time calculation.\n    setNextDeltaTimeZero(true);\n}\n\n// display the FPS using a LabelAtlas\n// updates the FPS every frame\nvoid Director::showStats()\n{\n    ++_frames;\n    _accumDt += _deltaTime;\n    \n    if (_displayStats)\n    {\n        if (_FPSLabel && _SPFLabel && _drawsLabel)\n        {\n            if (_accumDt > CC_DIRECTOR_STATS_INTERVAL)\n            {\n                sprintf(_FPS, \"%.3f\", _secondsPerFrame);\n                _SPFLabel->setString(_FPS);\n                \n                _frameRate = _frames / _accumDt;\n                _frames = 0;\n                _accumDt = 0;\n                \n                sprintf(_FPS, \"%.1f\", _frameRate);\n                _FPSLabel->setString(_FPS);\n                \n                sprintf(_FPS, \"%4lu\", (unsigned long)g_uNumberOfDraws);\n                _drawsLabel->setString(_FPS);\n            }\n            \n            _drawsLabel->visit();\n            _FPSLabel->visit();\n            _SPFLabel->visit();\n        }\n    }    \n    \n    g_uNumberOfDraws = 0;\n}\n\nvoid Director::calculateMPF()\n{\n    struct timeval now;\n    gettimeofday(&now, nullptr);\n    \n    _secondsPerFrame = (now.tv_sec - _lastUpdate->tv_sec) + (now.tv_usec - _lastUpdate->tv_usec) / 1000000.0f;\n}\n\n// returns the FPS image data pointer and len\nvoid Director::getFPSImageData(unsigned char** datapointer, ssize_t* length)\n{\n    // XXX fixed me if it should be used \n    *datapointer = cc_fps_images_png;\n\t*length = cc_fps_images_len();\n}\n\nvoid Director::createStatsLabel()\n{\n    Texture2D *texture = nullptr;\n\n    if (_FPSLabel && _SPFLabel)\n    {\n        CC_SAFE_RELEASE_NULL(_FPSLabel);\n        CC_SAFE_RELEASE_NULL(_SPFLabel);\n        CC_SAFE_RELEASE_NULL(_drawsLabel);\n        _textureCache->removeTextureForKey(\"/cc_fps_images\");\n        FileUtils::getInstance()->purgeCachedEntries();\n    }\n\n    Texture2D::PixelFormat currentFormat = Texture2D::getDefaultAlphaPixelFormat();\n    Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);\n    unsigned char *data = nullptr;\n    ssize_t dataLength = 0;\n    getFPSImageData(&data, &dataLength);\n\n    Image* image = new Image();\n    bool isOK = image->initWithImageData(data, dataLength);\n    if (! isOK) {\n        CCLOGERROR(\"%s\", \"Fails: init fps_images\");\n        return;\n    }\n\n    texture = _textureCache->addImage(image, \"/cc_fps_images\");\n    CC_SAFE_RELEASE(image);\n\n    /*\n     We want to use an image which is stored in the file named ccFPSImage.c \n     for any design resolutions and all resource resolutions. \n     \n     To achieve this,\n     \n     Firstly, we need to ignore 'contentScaleFactor' in 'AtlasNode' and 'LabelAtlas'.\n     So I added a new method called 'setIgnoreContentScaleFactor' for 'AtlasNode',\n     this is not exposed to game developers, it's only used for displaying FPS now.\n     \n     Secondly, the size of this image is 480*320, to display the FPS label with correct size, \n     a factor of design resolution ratio of 480x320 is also needed.\n     */\n    float factor = EGLView::getInstance()->getDesignResolutionSize().height / 320.0f;\n\n    _FPSLabel = LabelAtlas::create();\n    _FPSLabel->retain();\n    _FPSLabel->setIgnoreContentScaleFactor(true);\n    _FPSLabel->initWithString(\"00.0\", texture, 12, 32 , '.');\n    _FPSLabel->setScale(factor);\n\n    _SPFLabel = LabelAtlas::create();\n    _SPFLabel->retain();\n    _SPFLabel->setIgnoreContentScaleFactor(true);\n    _SPFLabel->initWithString(\"0.000\", texture, 12, 32, '.');\n    _SPFLabel->setScale(factor);\n\n    _drawsLabel = LabelAtlas::create();\n    _drawsLabel->retain();\n    _drawsLabel->setIgnoreContentScaleFactor(true);\n    _drawsLabel->initWithString(\"000\", texture, 12, 32, '.');\n    _drawsLabel->setScale(factor);\n\n    Texture2D::setDefaultAlphaPixelFormat(currentFormat);\n\n    _drawsLabel->setPosition(Point(0, 34*factor) + CC_DIRECTOR_STATS_POSITION);\n    _SPFLabel->setPosition(Point(0, 17*factor) + CC_DIRECTOR_STATS_POSITION);\n    _FPSLabel->setPosition(CC_DIRECTOR_STATS_POSITION);\n}\n\nvoid Director::setContentScaleFactor(float scaleFactor)\n{\n    if (scaleFactor != _contentScaleFactor)\n    {\n        _contentScaleFactor = scaleFactor;\n        createStatsLabel();\n    }\n}\n\nvoid Director::setNotificationNode(Node *node)\n{\n    CC_SAFE_RELEASE(_notificationNode);\n    _notificationNode = node;\n    CC_SAFE_RETAIN(_notificationNode);\n}\n\nvoid Director::setScheduler(Scheduler* scheduler)\n{\n    if (_scheduler != scheduler)\n    {\n        CC_SAFE_RETAIN(scheduler);\n        CC_SAFE_RELEASE(_scheduler);\n        _scheduler = scheduler;\n    }\n}\n\nvoid Director::setActionManager(ActionManager* actionManager)\n{\n    if (_actionManager != actionManager)\n    {\n        CC_SAFE_RETAIN(actionManager);\n        CC_SAFE_RELEASE(_actionManager);\n        _actionManager = actionManager;\n    }    \n}\n\nvoid Director::setEventDispatcher(EventDispatcher* dispatcher)\n{\n    if (_eventDispatcher != dispatcher)\n    {\n        CC_SAFE_RETAIN(dispatcher);\n        CC_SAFE_RELEASE(_eventDispatcher);\n        _eventDispatcher = dispatcher;\n    }\n}\n\n/***************************************************\n* implementation of DisplayLinkDirector\n**************************************************/\n\n// should we implement 4 types of director ??\n// I think DisplayLinkDirector is enough\n// so we now only support DisplayLinkDirector\nvoid DisplayLinkDirector::startAnimation()\n{\n    if (gettimeofday(_lastUpdate, nullptr) != 0)\n    {\n        CCLOG(\"cocos2d: DisplayLinkDirector: Error on gettimeofday\");\n    }\n\n    _invalid = false;\n\n    Application::getInstance()->setAnimationInterval(_animationInterval);\n}\n\nvoid DisplayLinkDirector::mainLoop()\n{\n    if (_purgeDirectorInNextLoop)\n    {\n        _purgeDirectorInNextLoop = false;\n        purgeDirector();\n    }\n    else if (! _invalid)\n    {\n        drawScene();\n     \n        // release the objects\n        PoolManager::getInstance()->getCurrentPool()->clear();\n    }\n}\n\nvoid DisplayLinkDirector::stopAnimation()\n{\n    _invalid = true;\n}\n\nvoid DisplayLinkDirector::setAnimationInterval(double interval)\n{\n    _animationInterval = interval;\n    if (! _invalid)\n    {\n        stopAnimation();\n        startAnimation();\n    }    \n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDirector.h",
    "content": "/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2010-2013 cocos2d-x.org\n Copyright (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDIRECTOR_H__\n#define __CCDIRECTOR_H__\n\n#include \"CCPlatformMacros.h\"\n\n#include \"CCObject.h\"\n#include \"ccTypes.h\"\n#include \"CCGeometry.h\"\n#include \"CCVector.h\"\n#include \"CCGL.h\"\n#include \"kazmath/mat4.h\"\n#include \"CCLabelAtlas.h\"\n\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup base_nodes\n * @{\n */\n\n/* Forward declarations. */\nclass LabelAtlas;\nclass Scene;\nclass EGLView;\nclass DirectorDelegate;\nclass Node;\nclass Scheduler;\nclass ActionManager;\nclass EventDispatcher;\nclass EventCustom;\nclass EventListenerCustom;\nclass TextureCache;\nclass Frustum;\nclass Renderer;\nclass Console;\n\n/**\n@brief Class that creates and handles the main Window and manages how\nand when to execute the Scenes.\n \n The Director is also responsible for:\n  - initializing the OpenGL context\n  - setting the OpenGL pixel format (default on is RGB565)\n  - setting the OpenGL buffer depth (default one is 0-bit)\n  - setting the projection (default one is 3D)\n  - setting the orientation (default one is Portrait)\n \n Since the Director is a singleton, the standard way to use it is by calling:\n  _ Director::getInstance()->methodName();\n \n The Director also sets the default OpenGL context:\n  - GL_TEXTURE_2D is enabled\n  - GL_VERTEX_ARRAY is enabled\n  - GL_COLOR_ARRAY is enabled\n  - GL_TEXTURE_COORD_ARRAY is enabled\n*/\nclass CC_DLL Director : public Object\n{\npublic:\n    static const char *EVENT_PROJECTION_CHANGED;\n    static const char* EVENT_AFTER_UPDATE;\n    static const char* EVENT_AFTER_VISIT;\n    static const char* EVENT_AFTER_DRAW;\n\n\n    /** @typedef ccDirectorProjection\n     Possible OpenGL projections used by director\n     */\n    enum class Projection\n    {\n        /// sets a 2D projection (orthogonal projection)\n        _2D,\n        \n        /// sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.\n        _3D,\n        \n        /// it calls \"updateProjection\" on the projection delegate.\n        CUSTOM,\n        \n        /// Default projection is 3D projection\n        DEFAULT = _3D,\n    };\n    \n    /** returns a shared instance of the director */\n    static Director* getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static Director* sharedDirector() { return Director::getInstance(); }\n    /**\n     * @js ctor\n     */\n    Director(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Director(void);\n    virtual bool init(void);\n\n    // attribute\n\n    /** Get current running Scene. Director can only run one Scene at a time */\n    inline Scene* getRunningScene() { return _runningScene; }\n\n    /** Get the FPS value */\n    inline double getAnimationInterval() { return _animationInterval; }\n    /** Set the FPS value. */\n    virtual void setAnimationInterval(double interval) = 0;\n\n    /** Whether or not to display the FPS on the bottom-left corner */\n    inline bool isDisplayStats() { return _displayStats; }\n    /** Display the FPS on the bottom-left corner */\n    inline void setDisplayStats(bool displayStats) { _displayStats = displayStats; }\n    \n    /** seconds per frame */\n    inline float getSecondsPerFrame() { return _secondsPerFrame; }\n\n    /** Get the EGLView, where everything is rendered\n    * @js NA\n    * @lua NA\n    */\n    inline EGLView* getOpenGLView() { return _openGLView; }\n    void setOpenGLView(EGLView *openGLView);\n\n    TextureCache* getTextureCache() const;\n\n    inline bool isNextDeltaTimeZero() { return _nextDeltaTimeZero; }\n    void setNextDeltaTimeZero(bool nextDeltaTimeZero);\n\n    /** Whether or not the Director is paused */\n    inline bool isPaused() { return _paused; }\n\n    /** How many frames were called since the director started */\n    inline unsigned int getTotalFrames() { return _totalFrames; }\n    \n    /** Sets an OpenGL projection\n     @since v0.8.2\n     * @js NA\n     * @lua NA\n     */\n    inline Projection getProjection() { return _projection; }\n    void setProjection(Projection projection);\n    \n    /** Sets the glViewport*/\n    void setViewport();\n\n    /** How many frames were called since the director started */\n    \n    \n    /** Whether or not the replaced scene will receive the cleanup message.\n     If the new scene is pushed, then the old scene won't receive the \"cleanup\" message.\n     If the new scene replaces the old one, the it will receive the \"cleanup\" message.\n     @since v0.99.0\n     */\n    inline bool isSendCleanupToScene() { return _sendCleanupToScene; }\n\n    /** This object will be visited after the main scene is visited.\n     This object MUST implement the \"visit\" selector.\n     Useful to hook a notification object, like Notifications (http://github.com/manucorporat/CCNotifications)\n     @since v0.99.5\n     */\n    Node* getNotificationNode() const { return _notificationNode; }\n    void setNotificationNode(Node *node);\n    \n    // window size\n\n    /** returns the size of the OpenGL view in points.\n    */\n    const Size& getWinSize() const;\n\n    /** returns the size of the OpenGL view in pixels.\n    */\n    Size getWinSizeInPixels() const;\n    \n    /** returns visible size of the OpenGL view in points.\n     *  the value is equal to getWinSize if don't invoke\n     *  EGLView::setDesignResolutionSize()\n     */\n    Size getVisibleSize() const;\n    \n    /** returns visible origin of the OpenGL view in points.\n     */\n    Point getVisibleOrigin() const;\n\n    /** converts a UIKit coordinate to an OpenGL coordinate\n     Useful to convert (multi) touch coordinates to the current layout (portrait or landscape)\n     */\n    Point convertToGL(const Point& point);\n\n    /** converts an OpenGL coordinate to a UIKit coordinate\n     Useful to convert node points to window points for calls such as glScissor\n     */\n    Point convertToUI(const Point& point);\n\n    /// XXX: missing description \n    float getZEye() const;\n\n    // Scene Management\n\n    /** Enters the Director's main loop with the given Scene.\n     * Call it to run only your FIRST scene.\n     * Don't call it if there is already a running scene.\n     *\n     * It will call pushScene: and then it will call startAnimation\n     */\n    void runWithScene(Scene *scene);\n\n    /** Suspends the execution of the running scene, pushing it on the stack of suspended scenes.\n     * The new scene will be executed.\n     * Try to avoid big stacks of pushed scenes to reduce memory allocation. \n     * ONLY call it if there is a running scene.\n     */\n    void pushScene(Scene *scene);\n\n    /** Pops out a scene from the stack.\n     * This scene will replace the running one.\n     * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.\n     * ONLY call it if there is a running scene.\n     */\n    void popScene();\n\n    /** Pops out all scenes from the stack until the root scene in the queue.\n     * This scene will replace the running one.\n     * Internally it will call `popToSceneStackLevel(1)`\n     */\n    void popToRootScene();\n\n    /** Pops out all scenes from the stack until it reaches `level`.\n     If level is 0, it will end the director.\n     If level is 1, it will pop all scenes until it reaches to root scene.\n     If level is <= than the current stack level, it won't do anything.\n     */\n \tvoid popToSceneStackLevel(int level);\n\n    /** Replaces the running scene with a new one. The running scene is terminated.\n     * ONLY call it if there is a running scene.\n     */\n    void replaceScene(Scene *scene);\n\n    /** Ends the execution, releases the running scene.\n     It doesn't remove the OpenGL view from its parent. You have to do it manually.\n     * @lua endToLua\n     */\n    void end();\n\n    /** Pauses the running scene.\n     The running scene will be _drawed_ but all scheduled timers will be paused\n     While paused, the draw rate will be 4 FPS to reduce CPU consumption\n     */\n    void pause();\n\n    /** Resumes the paused scene\n     The scheduled timers will be activated again.\n     The \"delta time\" will be 0 (as if the game wasn't paused)\n     */\n    void resume();\n\n    /** Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore.\n     If you don't want to pause your animation call [pause] instead.\n     */\n    virtual void stopAnimation() = 0;\n\n    /** The main loop is triggered again.\n     Call this function only if [stopAnimation] was called earlier\n     @warning Don't call this function to start the main loop. To run the main loop call runWithScene\n     */\n    virtual void startAnimation() = 0;\n\n    /** Draw the scene.\n    This method is called every frame. Don't call it manually.\n    */\n    void drawScene();\n\n    // Memory Helper\n\n    /** Removes all cocos2d cached data.\n     It will purge the TextureCache, SpriteFrameCache, LabelBMFont cache\n     @since v0.99.3\n     */\n    void purgeCachedData();\n\n\t/** sets the default values based on the Configuration info */\n    void setDefaultValues();\n\n    // OpenGL Helper\n\n    /** sets the OpenGL default values */\n    void setGLDefaultValues();\n\n    /** enables/disables OpenGL alpha blending */\n    void setAlphaBlending(bool on);\n\n    /** enables/disables OpenGL depth test */\n    void setDepthTest(bool on);\n\n    virtual void mainLoop() = 0;\n\n    /** The size in pixels of the surface. It could be different than the screen size.\n    High-res devices might have a higher surface size than the screen size.\n    Only available when compiled using SDK >= 4.0.\n    @since v0.99.4\n    */\n    void setContentScaleFactor(float scaleFactor);\n    float getContentScaleFactor() const { return _contentScaleFactor; }\n    \n    /**\n     Get the Culling Frustum\n     */\n    \n    Frustum* getFrustum() const { return _cullingFrustum; }\n\n    /** Gets the Scheduler associated with this director\n     @since v2.0\n     */\n    Scheduler* getScheduler() const { return _scheduler; }\n    \n    /** Sets the Scheduler associated with this director\n     @since v2.0\n     */\n    void setScheduler(Scheduler* scheduler);\n\n    /** Gets the ActionManager associated with this director\n     @since v2.0\n     */\n    ActionManager* getActionManager() const { return _actionManager; }\n    \n    /** Sets the ActionManager associated with this director\n     @since v2.0\n     */\n    void setActionManager(ActionManager* actionManager);\n    \n    /** Gets the EventDispatcher associated with this director \n     @since v3.0\n     */\n    EventDispatcher* getEventDispatcher() const { return _eventDispatcher; }\n    \n    /** Sets the EventDispatcher associated with this director \n     @since v3.0\n     */\n    void setEventDispatcher(EventDispatcher* dispatcher);\n\n    /** Returns the Renderer\n     @since v3.0\n     */\n    Renderer* getRenderer() const { return _renderer; }\n\n    /** Returns the Console \n     @since v3.0\n     */\n    Console* getConsole() const { return _console; }\n\n    /* Gets delta time since last tick to main loop */\n\tfloat getDeltaTime() const;\n    \n    /**\n     *  get Frame Rate\n     */\n    float getFrameRate() const { return _frameRate; }\n\nprotected:\n    void purgeDirector();\n    bool _purgeDirectorInNextLoop; // this flag will be set to true in end()\n    \n    void setNextScene();\n    \n    void showStats();\n    void createStatsLabel();\n    void calculateMPF();\n    void getFPSImageData(unsigned char** datapointer, ssize_t* length);\n    \n    /** calculates delta time since last time it was called */    \n    void calculateDeltaTime();\n\n    //textureCache creation or release\n    void initTextureCache();\n    void destroyTextureCache();\n\n    /** Scheduler associated with this director\n     @since v2.0\n     */\n    Scheduler *_scheduler;\n    \n    /** ActionManager associated with this director\n     @since v2.0\n     */\n    ActionManager *_actionManager;\n    \n    /** EventDispatcher associated with this director\n     @since v3.0\n     */\n    EventDispatcher* _eventDispatcher;\n    EventCustom *_eventProjectionChanged, *_eventAfterDraw, *_eventAfterVisit, *_eventAfterUpdate;\n        \n    /* delta time since last tick to main loop */\n\tfloat _deltaTime;\n    \n    /* The EGLView, where everything is rendered */\n    EGLView *_openGLView;\n\n    //texture cache belongs to this director\n    TextureCache *_textureCache;\n\n    double _animationInterval;\n    double _oldAnimationInterval;\n\n    /* landscape mode ? */\n    bool _landscape;\n    \n    bool _displayStats;\n    float _accumDt;\n    float _frameRate;\n    \n    LabelAtlas *_FPSLabel;\n    LabelAtlas *_SPFLabel;\n    LabelAtlas *_drawsLabel;\n    \n    /** Whether or not the Director is paused */\n    bool _paused;\n\n    /* How many frames were called since the director started */\n    unsigned int _totalFrames;\n    unsigned int _frames;\n    float _secondsPerFrame;\n    \n    Frustum *_cullingFrustum;\n     \n    /* The running scene */\n    Scene *_runningScene;\n    \n    /* will be the next 'runningScene' in the next frame\n     nextScene is a weak reference. */\n    Scene *_nextScene;\n    \n    /* If true, then \"old\" scene will receive the cleanup message */\n    bool _sendCleanupToScene;\n\n    /* scheduled scenes */\n    Vector<Scene*> _scenesStack;\n    \n    /* last time the main loop was updated */\n    struct timeval *_lastUpdate;\n\n    /* whether or not the next delta time will be zero */\n    bool _nextDeltaTimeZero;\n    \n    /* projection used */\n    Projection _projection;\n\n    /* window size in points */\n    Size _winSizeInPoints;\n    \n    /* content scale factor */\n    float _contentScaleFactor;\n\n    /* store the fps string */\n    char *_FPS;\n\n    /* This object will be visited after the scene. Useful to hook a notification node */\n    Node *_notificationNode;\n\n    /* Renderer for the Director */\n    Renderer *_renderer;\n\n    /* Console for the director */\n    Console *_console;\n    \n    // EGLViewProtocol will recreate stats labels to fit visible rect\n    friend class EGLViewProtocol;\n};\n\n/** \n @brief DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display.\n \n Features and Limitations:\n  - Scheduled timers & drawing are synchronizes with the refresh rate of the display\n  - Only supports animation intervals of 1/60 1/30 & 1/15\n \n @since v0.8.2\n */\nclass DisplayLinkDirector : public Director\n{\npublic:\n    DisplayLinkDirector() \n        : _invalid(false)\n    {}\n\n    //\n    // Overrides\n    //\n    virtual void mainLoop() override;\n    virtual void setAnimationInterval(double value) override;\n    virtual void startAnimation() override;\n    virtual void stopAnimation() override;\n\nprotected:\n    bool _invalid;\n};\n\n// end of base_node group\n/// @}\n\nNS_CC_END\n\n#endif // __CCDIRECTOR_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDrawNode.cpp",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * Copyright (c) 2012 cocos2d-x.org\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"CCDrawNode.h\"\n#include \"CCShaderCache.h\"\n#include \"CCGL.h\"\n#include \"CCEventType.h\"\n#include \"CCConfiguration.h\"\n#include \"renderer/CCCustomCommand.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"CCDirector.h\"\n#include \"CCEventListenerCustom.h\"\n#include \"CCEventDispatcher.h\"\n\nNS_CC_BEGIN\n\n// Vertex2F == CGPoint in 32-bits, but not in 64-bits (OS X)\n// that's why the \"v2f\" functions are needed\nstatic Vertex2F v2fzero(0.0f,0.0f);\n\nstatic inline Vertex2F v2f(float x, float y)\n{\n    Vertex2F ret(x, y);\n\treturn ret;\n}\n\nstatic inline Vertex2F v2fadd(const Vertex2F &v0, const Vertex2F &v1)\n{\n\treturn v2f(v0.x+v1.x, v0.y+v1.y);\n}\n\nstatic inline Vertex2F v2fsub(const Vertex2F &v0, const Vertex2F &v1)\n{\n\treturn v2f(v0.x-v1.x, v0.y-v1.y);\n}\n\nstatic inline Vertex2F v2fmult(const Vertex2F &v, float s)\n{\n\treturn v2f(v.x * s, v.y * s);\n}\n\nstatic inline Vertex2F v2fperp(const Vertex2F &p0)\n{\n\treturn v2f(-p0.y, p0.x);\n}\n\nstatic inline Vertex2F v2fneg(const Vertex2F &p0)\n{\n\treturn v2f(-p0.x, - p0.y);\n}\n\nstatic inline float v2fdot(const Vertex2F &p0, const Vertex2F &p1)\n{\n\treturn  p0.x * p1.x + p0.y * p1.y;\n}\n\nstatic inline Vertex2F v2fforangle(float _a_)\n{\n\treturn v2f(cosf(_a_), sinf(_a_));\n}\n\nstatic inline Vertex2F v2fnormalize(const Vertex2F &p)\n{\n\tPoint r = Point(p.x, p.y).normalize();\n\treturn v2f(r.x, r.y);\n}\n\nstatic inline Vertex2F __v2f(const Point &v)\n{\n//#ifdef __LP64__\n\treturn v2f(v.x, v.y);\n// #else\n// \treturn * ((Vertex2F*) &v);\n// #endif\n}\n\nstatic inline Tex2F __t(const Vertex2F &v)\n{\n\treturn *(Tex2F*)&v;\n}\n\n// implementation of DrawNode\n\nDrawNode::DrawNode()\n: _vao(0)\n, _vbo(0)\n, _bufferCapacity(0)\n, _bufferCount(0)\n, _buffer(nullptr)\n, _dirty(false)\n{\n    _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n}\n\nDrawNode::~DrawNode()\n{\n    free(_buffer);\n    _buffer = nullptr;\n    \n    glDeleteBuffers(1, &_vbo);\n    _vbo = 0;\n    \n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        glDeleteVertexArrays(1, &_vao);\n        GL::bindVAO(0);\n        _vao = 0;\n    }\n}\n\nDrawNode* DrawNode::create()\n{\n    DrawNode* ret = new DrawNode();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    \n    return ret;\n}\n\nvoid DrawNode::ensureCapacity(int count)\n{\n    CCASSERT(count>=0, \"capacity must be >= 0\");\n    \n    if(_bufferCount + count > _bufferCapacity)\n    {\n\t\t_bufferCapacity += MAX(_bufferCapacity, count);\n\t\t_buffer = (V2F_C4B_T2F*)realloc(_buffer, _bufferCapacity*sizeof(V2F_C4B_T2F));\n\t}\n}\n\nbool DrawNode::init()\n{\n    _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR));\n    \n    ensureCapacity(512);\n    \n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        glGenVertexArrays(1, &_vao);\n        GL::bindVAO(_vao);\n    }\n    \n    glGenBuffers(1, &_vbo);\n    glBindBuffer(GL_ARRAY_BUFFER, _vbo);\n    glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)* _bufferCapacity, _buffer, GL_STREAM_DRAW);\n    \n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));\n    \n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));\n    \n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));\n    \n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n    \n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        GL::bindVAO(0);\n    }\n    \n    CHECK_GL_ERROR_DEBUG();\n    \n    _dirty = true;\n    \n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    // Need to listen the event only when not use batchnode, because it will use VBO\n    auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){\n    /** listen the event that coming to foreground on Android */\n        this->init();\n    });\n\n    _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);\n#endif\n    \n    return true;\n}\n\nvoid DrawNode::render()\n{\n    if (_dirty)\n    {\n        glBindBuffer(GL_ARRAY_BUFFER, _vbo);\n        glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacity, _buffer, GL_STREAM_DRAW);\n        _dirty = false;\n    }\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        GL::bindVAO(_vao);\n    }\n    else\n    {\n        GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);\n    \n        glBindBuffer(GL_ARRAY_BUFFER, _vbo);\n        // vertex\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));\n    \n        // color\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));\n    \n        // texcood\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));\n    }\n\n    glDrawArrays(GL_TRIANGLES, 0, _bufferCount);\n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n    \n    CC_INCREMENT_GL_DRAWS(1);\n    CHECK_GL_ERROR_DEBUG();\n}\n\nvoid DrawNode::draw()\n{\n    _customCommand.init(_globalZOrder);\n    _customCommand.func = CC_CALLBACK_0(DrawNode::onDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_customCommand);\n}\n\nvoid DrawNode::onDraw()\n{\n    CC_NODE_DRAW_SETUP();\n    GL::blendFunc(_blendFunc.src, _blendFunc.dst);\n    \n    render();\n}\n\nvoid DrawNode::drawDot(const Point &pos, float radius, const Color4F &color)\n{\n    unsigned int vertex_count = 2*3;\n    ensureCapacity(vertex_count);\n\t\n\tV2F_C4B_T2F a = {Vertex2F(pos.x - radius, pos.y - radius), Color4B(color), Tex2F(-1.0, -1.0) };\n\tV2F_C4B_T2F b = {Vertex2F(pos.x - radius, pos.y + radius), Color4B(color), Tex2F(-1.0,  1.0) };\n\tV2F_C4B_T2F c = {Vertex2F(pos.x + radius, pos.y + radius), Color4B(color), Tex2F( 1.0,  1.0) };\n\tV2F_C4B_T2F d = {Vertex2F(pos.x + radius, pos.y - radius), Color4B(color), Tex2F( 1.0, -1.0) };\n\t\n\tV2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount);\n    V2F_C4B_T2F_Triangle triangle0 = {a, b, c};\n    V2F_C4B_T2F_Triangle triangle1 = {a, c, d};\n\ttriangles[0] = triangle0;\n\ttriangles[1] = triangle1;\n\t\n\t_bufferCount += vertex_count;\n\t\n\t_dirty = true;\n}\n\nvoid DrawNode::drawSegment(const Point &from, const Point &to, float radius, const Color4F &color)\n{\n    unsigned int vertex_count = 6*3;\n    ensureCapacity(vertex_count);\n\t\n\tVertex2F a = __v2f(from);\n\tVertex2F b = __v2f(to);\n\t\n\t\n\tVertex2F n = v2fnormalize(v2fperp(v2fsub(b, a)));\n\tVertex2F t = v2fperp(n);\n\t\n\tVertex2F nw = v2fmult(n, radius);\n\tVertex2F tw = v2fmult(t, radius);\n\tVertex2F v0 = v2fsub(b, v2fadd(nw, tw));\n\tVertex2F v1 = v2fadd(b, v2fsub(nw, tw));\n\tVertex2F v2 = v2fsub(b, nw);\n\tVertex2F v3 = v2fadd(b, nw);\n\tVertex2F v4 = v2fsub(a, nw);\n\tVertex2F v5 = v2fadd(a, nw);\n\tVertex2F v6 = v2fsub(a, v2fsub(nw, tw));\n\tVertex2F v7 = v2fadd(a, v2fadd(nw, tw));\n\t\n\t\n\tV2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount);\n\t\n    V2F_C4B_T2F_Triangle triangles0 = {\n        {v0, Color4B(color), __t(v2fneg(v2fadd(n, t)))},\n        {v1, Color4B(color), __t(v2fsub(n, t))},\n        {v2, Color4B(color), __t(v2fneg(n))},\n    };\n\ttriangles[0] = triangles0;\n\t\n    V2F_C4B_T2F_Triangle triangles1 = {\n        {v3, Color4B(color), __t(n)},\n        {v1, Color4B(color), __t(v2fsub(n, t))},\n        {v2, Color4B(color), __t(v2fneg(n))},\n    };\n\ttriangles[1] = triangles1;\n\t\n    V2F_C4B_T2F_Triangle triangles2 = {\n        {v3, Color4B(color), __t(n)},\n        {v4, Color4B(color), __t(v2fneg(n))},\n        {v2, Color4B(color), __t(v2fneg(n))},\n    };\n\ttriangles[2] = triangles2;\n\n    V2F_C4B_T2F_Triangle triangles3 = {\n        {v3, Color4B(color), __t(n)},\n        {v4, Color4B(color), __t(v2fneg(n))},\n        {v5, Color4B(color), __t(n) },\n    };\n    triangles[3] = triangles3;\n\n    V2F_C4B_T2F_Triangle triangles4 = {\n        {v6, Color4B(color), __t(v2fsub(t, n))},\n        {v4, Color4B(color), __t(v2fneg(n)) },\n        {v5, Color4B(color), __t(n)},\n    };\n\ttriangles[4] = triangles4;\n\n    V2F_C4B_T2F_Triangle triangles5 = {\n        {v6, Color4B(color), __t(v2fsub(t, n))},\n        {v7, Color4B(color), __t(v2fadd(n, t))},\n        {v5, Color4B(color), __t(n)},\n    };\n\ttriangles[5] = triangles5;\n\t\n\t_bufferCount += vertex_count;\n\t\n\t_dirty = true;\n}\n\nvoid DrawNode::drawPolygon(Point *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor)\n{\n    CCASSERT(count >= 0, \"invalid count value\");\n\n    struct ExtrudeVerts {Vertex2F offset, n;};\n\tstruct ExtrudeVerts* extrude = (struct ExtrudeVerts*)malloc(sizeof(struct ExtrudeVerts)*count);\n\tmemset(extrude, 0, sizeof(struct ExtrudeVerts)*count);\n\t\n\tfor (int i = 0; i < count; i++)\n    {\n\t\tVertex2F v0 = __v2f(verts[(i-1+count)%count]);\n\t\tVertex2F v1 = __v2f(verts[i]);\n\t\tVertex2F v2 = __v2f(verts[(i+1)%count]);\n        \n\t\tVertex2F n1 = v2fnormalize(v2fperp(v2fsub(v1, v0)));\n\t\tVertex2F n2 = v2fnormalize(v2fperp(v2fsub(v2, v1)));\n\t\t\n\t\tVertex2F offset = v2fmult(v2fadd(n1, n2), 1.0/(v2fdot(n1, n2) + 1.0));\n        struct ExtrudeVerts tmp = {offset, n2};\n\t\textrude[i] = tmp;\n\t}\n\t\n\tbool outline = (borderColor.a > 0.0 && borderWidth > 0.0);\n\t\n\tauto triangle_count = 3*count - 2;\n\tauto vertex_count = 3*triangle_count;\n    ensureCapacity(vertex_count);\n\t\n\tV2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount);\n\tV2F_C4B_T2F_Triangle *cursor = triangles;\n\t\n\tfloat inset = (outline == false ? 0.5 : 0.0);\n\tfor (int i = 0; i < count-2; i++)\n    {\n\t\tVertex2F v0 = v2fsub(__v2f(verts[0  ]), v2fmult(extrude[0  ].offset, inset));\n\t\tVertex2F v1 = v2fsub(__v2f(verts[i+1]), v2fmult(extrude[i+1].offset, inset));\n\t\tVertex2F v2 = v2fsub(__v2f(verts[i+2]), v2fmult(extrude[i+2].offset, inset));\n\t\t\n        V2F_C4B_T2F_Triangle tmp = {\n            {v0, Color4B(fillColor), __t(v2fzero)},\n            {v1, Color4B(fillColor), __t(v2fzero)},\n            {v2, Color4B(fillColor), __t(v2fzero)},\n        };\n\n\t\t*cursor++ = tmp;\n\t}\n\t\n\tfor(int i = 0; i < count; i++)\n    {\n\t\tint j = (i+1)%count;\n\t\tVertex2F v0 = __v2f(verts[i]);\n\t\tVertex2F v1 = __v2f(verts[j]);\n\t\t\n\t\tVertex2F n0 = extrude[i].n;\n\t\t\n\t\tVertex2F offset0 = extrude[i].offset;\n\t\tVertex2F offset1 = extrude[j].offset;\n\t\t\n\t\tif(outline)\n        {\n\t\t\tVertex2F inner0 = v2fsub(v0, v2fmult(offset0, borderWidth));\n\t\t\tVertex2F inner1 = v2fsub(v1, v2fmult(offset1, borderWidth));\n\t\t\tVertex2F outer0 = v2fadd(v0, v2fmult(offset0, borderWidth));\n\t\t\tVertex2F outer1 = v2fadd(v1, v2fmult(offset1, borderWidth));\n\t\t\t\n            V2F_C4B_T2F_Triangle tmp1 = {\n                {inner0, Color4B(borderColor), __t(v2fneg(n0))},\n                {inner1, Color4B(borderColor), __t(v2fneg(n0))},\n                {outer1, Color4B(borderColor), __t(n0)}\n            };\n\t\t\t*cursor++ = tmp1;\n\n            V2F_C4B_T2F_Triangle tmp2 = {\n                {inner0, Color4B(borderColor), __t(v2fneg(n0))},\n                {outer0, Color4B(borderColor), __t(n0)},\n                {outer1, Color4B(borderColor), __t(n0)}\n            };\n\t\t\t*cursor++ = tmp2;\n\t\t}\n        else {\n\t\t\tVertex2F inner0 = v2fsub(v0, v2fmult(offset0, 0.5));\n\t\t\tVertex2F inner1 = v2fsub(v1, v2fmult(offset1, 0.5));\n\t\t\tVertex2F outer0 = v2fadd(v0, v2fmult(offset0, 0.5));\n\t\t\tVertex2F outer1 = v2fadd(v1, v2fmult(offset1, 0.5));\n\t\t\t\n            V2F_C4B_T2F_Triangle tmp1 = {\n                {inner0, Color4B(fillColor), __t(v2fzero)},\n                {inner1, Color4B(fillColor), __t(v2fzero)},\n                {outer1, Color4B(fillColor), __t(n0)}\n            };\n\t\t\t*cursor++ = tmp1;\n\n            V2F_C4B_T2F_Triangle tmp2 = {\n                {inner0, Color4B(fillColor), __t(v2fzero)},\n                {outer0, Color4B(fillColor), __t(n0)},\n                {outer1, Color4B(fillColor), __t(n0)}\n            };\n\t\t\t*cursor++ = tmp2;\n\t\t}\n\t}\n\t\n\t_bufferCount += vertex_count;\n\t\n\t_dirty = true;\n\n    free(extrude);\n}\n\nvoid DrawNode::drawTriangle(const Point &p1, const Point &p2, const Point &p3, const Color4F &color)\n{\n    unsigned int vertex_count = 2*3;\n    ensureCapacity(vertex_count);\n\n    Color4B col = Color4B(color);\n    V2F_C4B_T2F a = {Vertex2F(p1.x, p1.y), col, Tex2F(0.0, 0.0) };\n    V2F_C4B_T2F b = {Vertex2F(p2.x, p2.y), col, Tex2F(0.0,  0.0) };\n    V2F_C4B_T2F c = {Vertex2F(p3.x, p3.y), col, Tex2F(0.0,  0.0) };\n\n    V2F_C4B_T2F_Triangle *triangles = (V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount);\n    V2F_C4B_T2F_Triangle triangle = {a, b, c};\n    triangles[0] = triangle;\n\n    _bufferCount += vertex_count;\n    _dirty = true;\n}\n\nvoid DrawNode::drawCubicBezier(const Point& from, const Point& control1, const Point& control2, const Point& to, unsigned int segments, const Color4F &color)\n{\n    unsigned int vertex_count = (segments + 1) * 3;\n    ensureCapacity(vertex_count);\n\n    Tex2F texCoord = Tex2F(0.0, 0.0);\n    Color4B col = Color4B(color);\n    Vertex2F vertex;\n    Vertex2F firstVertex = Vertex2F(from.x, from.y);\n    Vertex2F lastVertex = Vertex2F(to.x, to.y);\n\n    float t = 0;\n    for(unsigned int i = segments + 1; i > 0; i--)\n    {\n        float x = powf(1 - t, 3) * from.x + 3.0f * powf(1 - t, 2) * t * control1.x + 3.0f * (1 - t) * t * t * control2.x + t * t * t * to.x;\n        float y = powf(1 - t, 3) * from.y + 3.0f * powf(1 - t, 2) * t * control1.y + 3.0f * (1 - t) * t * t * control2.y + t * t * t * to.y;\n        vertex = Vertex2F(x, y);\n\n        V2F_C4B_T2F a = {firstVertex, col, texCoord };\n        V2F_C4B_T2F b = {lastVertex, col, texCoord };\n        V2F_C4B_T2F c = {vertex, col, texCoord };\n        V2F_C4B_T2F_Triangle triangle = {a, b, c};\n        ((V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount))[0] = triangle;\n\n        lastVertex = vertex;\n        t += 1.0f / segments;\n        _bufferCount += 3;\n    }\n    _dirty = true;\n}\n\nvoid DrawNode::drawQuadraticBezier(const Point& from, const Point& control, const Point& to, unsigned int segments, const Color4F &color)\n{\n    unsigned int vertex_count = (segments + 1) * 3;\n    ensureCapacity(vertex_count);\n\n    Tex2F texCoord = Tex2F(0.0, 0.0);\n    Color4B col = Color4B(color);\n    Vertex2F vertex;\n    Vertex2F firstVertex = Vertex2F(from.x, from.y);\n    Vertex2F lastVertex = Vertex2F(to.x, to.y);\n\n    float t = 0;\n    for(unsigned int i = segments + 1; i > 0; i--)\n    {\n        float x = powf(1 - t, 2) * from.x + 2.0f * (1 - t) * t * control.x + t * t * to.x;\n        float y = powf(1 - t, 2) * from.y + 2.0f * (1 - t) * t * control.y + t * t * to.y;\n        vertex = Vertex2F(x, y);\n\n        V2F_C4B_T2F a = {firstVertex, col, texCoord };\n        V2F_C4B_T2F b = {lastVertex, col, texCoord };\n        V2F_C4B_T2F c = {vertex, col, texCoord };\n        V2F_C4B_T2F_Triangle triangle = {a, b, c};\n        ((V2F_C4B_T2F_Triangle *)(_buffer + _bufferCount))[0] = triangle;\n\n        lastVertex = vertex;\n        t += 1.0f / segments;\n        _bufferCount += 3;\n    }\n    _dirty = true;\n}\n\nvoid DrawNode::clear()\n{\n    _bufferCount = 0;\n    _dirty = true;\n}\n\nconst BlendFunc& DrawNode::getBlendFunc() const\n{\n    return _blendFunc;\n}\n\nvoid DrawNode::setBlendFunc(const BlendFunc &blendFunc)\n{\n    _blendFunc = blendFunc;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDrawNode.h",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * Copyright (c) 2012 cocos2d-x.org\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/*\n * Code copied & pasted from SpacePatrol game https://github.com/slembcke/SpacePatrol\n *\n * Renamed and added some changes for cocos2d\n *\n */\n\n#ifndef __CCDRAWNODES_CCDRAW_NODE_H__\n#define __CCDRAWNODES_CCDRAW_NODE_H__\n\n#include \"CCNode.h\"\n#include \"ccTypes.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\n/** DrawNode\n Node that draws dots, segments and polygons.\n Faster than the \"drawing primitives\" since they it draws everything in one single batch.\n \n @since v2.1\n */\nclass CC_DLL DrawNode : public Node\n{\npublic:\n    /** creates and initialize a DrawNode node */\n    static DrawNode* create();\n\n    /** draw a dot at a position, with a given radius and color */\n    void drawDot(const Point &pos, float radius, const Color4F &color);\n    \n    /** draw a segment with a radius and color */\n    void drawSegment(const Point &from, const Point &to, float radius, const Color4F &color);\n    \n    /** draw a polygon with a fill color and line color\n    * @code\n    * When this function bound into js or lua,the parameter will be changed\n    * In js: var drawPolygon(var Arrayofpoints, var fillColor, var width, var borderColor)\n    * In lua:local drawPolygon(local pointTable,local tableCount,local fillColor,local width,local borderColor)\n    * @endcode\n    */\n    void drawPolygon(Point *verts, int count, const Color4F &fillColor, float borderWidth, const Color4F &borderColor);\n\t\n    /** draw a triangle with color */\n    void drawTriangle(const Point &p1, const Point &p2, const Point &p3, const Color4F &color);\n\n    /** draw a cubic bezier curve with color and number of segments */\n    void drawCubicBezier(const Point& from, const Point& control1, const Point& control2, const Point& to, unsigned int segments, const Color4F &color);\n\n    /** draw a quadratic bezier curve with color and number of segments */\n    void drawQuadraticBezier(const Point& from, const Point& control, const Point& to, unsigned int segments, const Color4F &color);\n    \n    /** Clear the geometry in the node's buffer. */\n    void clear();\n    /**\n    * @js NA\n    * @lua NA\n    */\n    const BlendFunc& getBlendFunc() const;\n    /**\n    * @code\n    * When this function bound into js or lua,the parameter will be changed\n    * In js: var setBlendFunc(var src, var dst)\n    * @endcode\n    * @lua NA\n    */\n    void setBlendFunc(const BlendFunc &blendFunc);\n\n    void onDraw();\n    \n    // Overrides\n    virtual void draw() override;\n\nprotected:\n    DrawNode();\n    virtual ~DrawNode();\n    virtual bool init();\n\n    void ensureCapacity(int count);\n    void render();\n\n    GLuint      _vao;\n    GLuint      _vbo;\n\n    int         _bufferCapacity;\n    GLsizei     _bufferCount;\n    V2F_C4B_T2F *_buffer;\n\n    BlendFunc   _blendFunc;\n    CustomCommand _customCommand;\n\n    bool        _dirty;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(DrawNode);\n};\n\nNS_CC_END\n\n#endif // __CCDRAWNODES_CCDRAW_NODE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDrawingPrimitives.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2013 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n/*\n *\n * IMPORTANT       IMPORTANT        IMPORTANT        IMPORTANT\n *\n *\n * LEGACY FUNCTIONS\n *\n * USE DrawNode instead\n *\n */\n\n#include \"CCDrawingPrimitives.h\"\n#include \"ccTypes.h\"\n#include \"ccMacros.h\"\n#include \"CCGL.h\"\n#include \"CCDirector.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCShaderCache.h\"\n#include \"CCGLProgram.h\"\n#include \"CCActionCatmullRom.h\"\n#include <string.h>\n#include <cmath>\n\nNS_CC_BEGIN\n#ifndef M_PI\n    #define M_PI       3.14159265358979323846\n#endif\n\nnamespace DrawPrimitives {\n\nstatic bool s_initialized = false;\nstatic GLProgram* s_shader = nullptr;\nstatic int s_colorLocation = -1;\nstatic Color4F s_color(1.0f,1.0f,1.0f,1.0f);\nstatic int s_pointSizeLocation = -1;\nstatic GLfloat s_pointSize = 1.0f;\n\n#ifdef EMSCRIPTEN\nstatic GLuint s_bufferObject = 0;\nstatic GLuint s_bufferSize = 0;\n\nstatic void setGLBufferData(void *buf, GLuint bufSize)\n{\n    if(s_bufferSize < bufSize)\n    {\n        if(s_bufferObject)\n        {\n            glDeleteBuffers(1, &s_bufferObject);\n        }\n        glGenBuffers(1, &s_bufferObject);\n        s_bufferSize = bufSize;\n\n        glBindBuffer(GL_ARRAY_BUFFER, s_bufferObject);\n        glBufferData(GL_ARRAY_BUFFER, bufSize, buf, GL_DYNAMIC_DRAW);\n    }\n    else\n    {\n        glBindBuffer(GL_ARRAY_BUFFER, s_bufferObject);\n        glBufferSubData(GL_ARRAY_BUFFER, 0, bufSize, buf);\n    }\n}\n\n#endif // EMSCRIPTEN\n\nstatic void lazy_init( void )\n{\n    if( ! s_initialized ) {\n\n        //\n        // Position and 1 color passed as a uniform (to simulate glColor4ub )\n        //\n        s_shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_U_COLOR);\n        s_shader->retain();\n        \n        s_colorLocation = glGetUniformLocation( s_shader->getProgram(), \"u_color\");\n    CHECK_GL_ERROR_DEBUG();\n        s_pointSizeLocation = glGetUniformLocation( s_shader->getProgram(), \"u_pointSize\");\n    CHECK_GL_ERROR_DEBUG();\n\n        s_initialized = true;\n    }\n}\n\n// When switching from backround to foreground on android, we want the params to be initialized again\nvoid init()\n{\n    lazy_init();\n}\n\nvoid free()\n{\n\tCC_SAFE_RELEASE_NULL(s_shader);\n\ts_initialized = false;\n}\n\nvoid drawPoint( const Point& point )\n{\n    lazy_init();\n\n    Vertex2F p;\n    p.x = point.x;\n    p.y = point.y;\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n    s_shader->setUniformLocationWith1f(s_pointSizeLocation, s_pointSize);\n\n#ifdef EMSCRIPTEN\n    setGLBufferData(&p, 8);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, &p);\n#endif // EMSCRIPTEN\n\n    glDrawArrays(GL_POINTS, 0, 1);\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawPoints( const Point *points, unsigned int numberOfPoints )\n{\n    lazy_init();\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n    s_shader->setUniformLocationWith1f(s_pointSizeLocation, s_pointSize);\n\n    // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed\n    Vertex2F* newPoints = new Vertex2F[numberOfPoints];\n\n    // iPhone and 32-bit machines optimization\n    if( sizeof(Point) == sizeof(Vertex2F) )\n    {\n#ifdef EMSCRIPTEN\n        setGLBufferData((void*) points, numberOfPoints * sizeof(Point));\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, points);\n#endif // EMSCRIPTEN\n    }\n    else\n    {\n        // Mac on 64-bit\n        for( unsigned int i=0; i<numberOfPoints;i++) {\n            newPoints[i].x = points[i].x;\n            newPoints[i].y = points[i].y;\n        }\n#ifdef EMSCRIPTEN\n        // Suspect Emscripten won't be emitting 64-bit code for a while yet,\n        // but want to make sure this continues to work even if they do.\n        setGLBufferData(newPoints, numberOfPoints * sizeof(Vertex2F));\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, newPoints);\n#endif // EMSCRIPTEN\n    }\n\n    glDrawArrays(GL_POINTS, 0, (GLsizei) numberOfPoints);\n\n    CC_SAFE_DELETE_ARRAY(newPoints);\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\n\nvoid drawLine( const Point& origin, const Point& destination )\n{\n    lazy_init();\n\n    Vertex2F vertices[2] = {\n        Vertex2F(origin.x, origin.y),\n        Vertex2F(destination.x, destination.y)\n    };\n\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, 16);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n#endif // EMSCRIPTEN\n    glDrawArrays(GL_LINES, 0, 2);\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawRect( Point origin, Point destination )\n{\n    drawLine(Point(origin.x, origin.y), Point(destination.x, origin.y));\n    drawLine(Point(destination.x, origin.y), Point(destination.x, destination.y));\n    drawLine(Point(destination.x, destination.y), Point(origin.x, destination.y));\n    drawLine(Point(origin.x, destination.y), Point(origin.x, origin.y));\n}\n\nvoid drawSolidRect( Point origin, Point destination, Color4F color )\n{\n    Point vertices[] = {\n        origin,\n        Point(destination.x, origin.y),\n        destination,\n        Point(origin.x, destination.y)\n    };\n\n    drawSolidPoly(vertices, 4, color );\n}\n\nvoid drawPoly( const Point *poli, unsigned int numberOfPoints, bool closePolygon )\n{\n    lazy_init();\n\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n\n    // iPhone and 32-bit machines optimization\n    if( sizeof(Point) == sizeof(Vertex2F) )\n    {\n#ifdef EMSCRIPTEN\n        setGLBufferData((void*) poli, numberOfPoints * sizeof(Point));\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, poli);\n#endif // EMSCRIPTEN\n\n        if( closePolygon )\n            glDrawArrays(GL_LINE_LOOP, 0, (GLsizei) numberOfPoints);\n        else\n            glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) numberOfPoints);\n    }\n    else\n    {\n        // Mac on 64-bit\n        // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed\n        Vertex2F* newPoli = new Vertex2F[numberOfPoints];\n        for( unsigned int i=0; i<numberOfPoints;i++) {\n            newPoli[i].x = poli[i].x;\n            newPoli[i].y = poli[i].y;\n        }\n#ifdef EMSCRIPTEN\n        setGLBufferData(newPoli, numberOfPoints * sizeof(Vertex2F));\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, newPoli);\n#endif // EMSCRIPTEN\n\n        if( closePolygon )\n            glDrawArrays(GL_LINE_LOOP, 0, (GLsizei) numberOfPoints);\n        else\n            glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) numberOfPoints);\n\n        CC_SAFE_DELETE_ARRAY(newPoli);\n    }\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawSolidPoly( const Point *poli, unsigned int numberOfPoints, Color4F color )\n{\n    lazy_init();\n\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &color.r, 1);\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n\n    // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed\n    Vertex2F* newPoli = new Vertex2F[numberOfPoints];\n\n    // iPhone and 32-bit machines optimization\n    if( sizeof(Point) == sizeof(Vertex2F) )\n    {\n#ifdef EMSCRIPTEN\n        setGLBufferData((void*) poli, numberOfPoints * sizeof(Point));\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, poli);\n#endif // EMSCRIPTEN\n    }\n    else\n    {\n        // Mac on 64-bit\n        for( unsigned int i=0; i<numberOfPoints;i++)\n        {\n            newPoli[i] = Vertex2F( poli[i].x, poli[i].y );\n        }\n#ifdef EMSCRIPTEN\n        setGLBufferData(newPoli, numberOfPoints * sizeof(Vertex2F));\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, newPoli);\n#endif // EMSCRIPTEN\n    }    \n\n    glDrawArrays(GL_TRIANGLE_FAN, 0, (GLsizei) numberOfPoints);\n\n    CC_SAFE_DELETE_ARRAY(newPoli);\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY)\n{\n    lazy_init();\n\n    int additionalSegment = 1;\n    if (drawLineToCenter)\n        additionalSegment++;\n\n    const float coef = 2.0f * (float)M_PI/segments;\n\n    GLfloat *vertices = (GLfloat*)calloc( sizeof(GLfloat)*2*(segments+2), 1);\n    if( ! vertices )\n        return;\n\n    for(unsigned int i = 0;i <= segments; i++) {\n        float rads = i*coef;\n        GLfloat j = radius * cosf(rads + angle) * scaleX + center.x;\n        GLfloat k = radius * sinf(rads + angle) * scaleY + center.y;\n\n        vertices[i*2] = j;\n        vertices[i*2+1] = k;\n    }\n    vertices[(segments+1)*2] = center.x;\n    vertices[(segments+1)*2+1] = center.y;\n\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n\n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, sizeof(GLfloat)*2*(segments+2));\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n#endif // EMSCRIPTEN\n    glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments+additionalSegment);\n\n    ::free( vertices );\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter)\n{\n    drawCircle(center, radius, angle, segments, drawLineToCenter, 1.0f, 1.0f);\n}\n\nvoid drawSolidCircle( const Point& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY)\n{\n    lazy_init();\n    \n    const float coef = 2.0f * (float)M_PI/segments;\n    \n    GLfloat *vertices = (GLfloat*)calloc( sizeof(GLfloat)*2*(segments+2), 1);\n    if( ! vertices )\n        return;\n    \n    for(unsigned int i = 0;i <= segments; i++) {\n        float rads = i*coef;\n        GLfloat j = radius * cosf(rads + angle) * scaleX + center.x;\n        GLfloat k = radius * sinf(rads + angle) * scaleY + center.y;\n        \n        vertices[i*2] = j;\n        vertices[i*2+1] = k;\n    }\n    vertices[(segments+1)*2] = center.x;\n    vertices[(segments+1)*2+1] = center.y;\n    \n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n    \n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n    \n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, sizeof(GLfloat)*2*(segments+2));\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n#endif // EMSCRIPTEN\n    \n    glDrawArrays(GL_TRIANGLE_FAN, 0, (GLsizei) segments+1);\n    \n    ::free( vertices );\n    \n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawSolidCircle( const Point& center, float radius, float angle, unsigned int segments)\n{\n    drawSolidCircle(center, radius, angle, segments, 1.0f, 1.0f);\n}\n\nvoid drawQuadBezier(const Point& origin, const Point& control, const Point& destination, unsigned int segments)\n{\n    lazy_init();\n\n    Vertex2F* vertices = new Vertex2F[segments + 1];\n\n    float t = 0.0f;\n    for(unsigned int i = 0; i < segments; i++)\n    {\n        vertices[i].x = powf(1 - t, 2) * origin.x + 2.0f * (1 - t) * t * control.x + t * t * destination.x;\n        vertices[i].y = powf(1 - t, 2) * origin.y + 2.0f * (1 - t) * t * control.y + t * t * destination.y;\n        t += 1.0f / segments;\n    }\n    vertices[segments].x = destination.x;\n    vertices[segments].y = destination.y;\n\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n\n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, (segments + 1) * sizeof(Vertex2F));\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n#endif // EMSCRIPTEN\n    glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1);\n    CC_SAFE_DELETE_ARRAY(vertices);\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawCatmullRom( PointArray *points, unsigned int segments )\n{\n    drawCardinalSpline( points, 0.5f, segments );\n}\n\nvoid drawCardinalSpline( PointArray *config, float tension,  unsigned int segments )\n{\n    lazy_init();\n\n    Vertex2F* vertices = new Vertex2F[segments + 1];\n\n    ssize_t p;\n    float lt;\n    float deltaT = 1.0f / config->count();\n\n    for( unsigned int i=0; i < segments+1;i++) {\n\n        float dt = (float)i / segments;\n\n        // border\n        if( dt == 1 ) {\n            p = config->count() - 1;\n            lt = 1;\n        } else {\n            p = dt / deltaT;\n            lt = (dt - deltaT * (float)p) / deltaT;\n        }\n\n        // Interpolate\n        Point pp0 = config->getControlPointAtIndex(p-1);\n        Point pp1 = config->getControlPointAtIndex(p+0);\n        Point pp2 = config->getControlPointAtIndex(p+1);\n        Point pp3 = config->getControlPointAtIndex(p+2);\n\n        Point newPos = ccCardinalSplineAt( pp0, pp1, pp2, pp3, tension, lt);\n        vertices[i].x = newPos.x;\n        vertices[i].y = newPos.y;\n    }\n\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*)&s_color.r, 1);\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n\n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, (segments + 1) * sizeof(Vertex2F));\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n#endif // EMSCRIPTEN\n    glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1);\n\n    CC_SAFE_DELETE_ARRAY(vertices);\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid drawCubicBezier(const Point& origin, const Point& control1, const Point& control2, const Point& destination, unsigned int segments)\n{\n    lazy_init();\n\n    Vertex2F* vertices = new Vertex2F[segments + 1];\n\n    float t = 0;\n    for(unsigned int i = 0; i < segments; i++)\n    {\n        vertices[i].x = powf(1 - t, 3) * origin.x + 3.0f * powf(1 - t, 2) * t * control1.x + 3.0f * (1 - t) * t * t * control2.x + t * t * t * destination.x;\n        vertices[i].y = powf(1 - t, 3) * origin.y + 3.0f * powf(1 - t, 2) * t * control1.y + 3.0f * (1 - t) * t * t * control2.y + t * t * t * destination.y;\n        t += 1.0f / segments;\n    }\n    vertices[segments].x = destination.x;\n    vertices[segments].y = destination.y;\n\n    s_shader->use();\n    s_shader->setUniformsForBuiltins();\n    s_shader->setUniformLocationWith4fv(s_colorLocation, (GLfloat*) &s_color.r, 1);\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );\n\n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, (segments + 1) * sizeof(Vertex2F));\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n#endif // EMSCRIPTEN\n    glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) segments + 1);\n    CC_SAFE_DELETE_ARRAY(vertices);\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid setDrawColor4F( GLfloat r, GLfloat g, GLfloat b, GLfloat a )\n{\n    s_color.r = r;\n    s_color.g = g;\n    s_color.b = b;\n    s_color.a = a;\n}\n\nvoid setPointSize( GLfloat pointSize )\n{\n    s_pointSize = pointSize * CC_CONTENT_SCALE_FACTOR();\n\n    //TODO :glPointSize( pointSize );\n\n}\n\nvoid setDrawColor4B( GLubyte r, GLubyte g, GLubyte b, GLubyte a )\n{\n    s_color.r = r/255.0f;\n    s_color.g = g/255.0f;\n    s_color.b = b/255.0f;\n    s_color.a = a/255.0f;\n}\n\n} // DrawPrimitives namespace\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCDrawingPrimitives.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2013 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n/*\n *\n * IMPORTANT       IMPORTANT        IMPORTANT        IMPORTANT\n *\n *\n * LEGACY FUNCTIONS\n *\n * USE DrawNode instead\n *\n */\n\n\n#ifndef __CCDRAWING_PRIMITIVES__\n#define __CCDRAWING_PRIMITIVES__\n    \n\n#include \"ccTypes.h\"\n#include \"ccMacros.h\"\n#include \"CCGeometry.h\"    // for Point\n\n/**\n @file\n Drawing OpenGL ES primitives.\n - drawPoint, drawPoints\n - drawLine\n - drawRect, drawSolidRect\n - drawPoly, drawSolidPoly\n - drawCircle\n - drawQuadBezier\n - drawCubicBezier\n - drawCatmullRom\n - drawCardinalSpline\n \n You can change the color, point size, width by calling:\n - drawColor4B(), drawColor4F()\n - ccPointSize()\n - glLineWidth()\n \n @warning These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. Instead you should use DrawNode\n \n */\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup global\n * @{\n */\n\nclass PointArray;\n\nnamespace DrawPrimitives\n{\n    /** Initializes the drawing primitives */\n    void init();\n\n    /** Frees allocated resources by the drawing primitives */\n    void free();\n\n    /** draws a point given x and y coordinate measured in points */\n    void drawPoint( const Point& point );\n\n    /** draws an array of points.\n     @since v0.7.2\n     */\n    void drawPoints( const Point *points, unsigned int numberOfPoints );\n\n    /** draws a line given the origin and destination point measured in points */\n    void drawLine( const Point& origin, const Point& destination );\n\n    /** draws a rectangle given the origin and destination point measured in points. */\n    void drawRect( Point origin, Point destination );\n\n    /** draws a solid rectangle given the origin and destination point measured in points.\n        @since 1.1\n     */\n    void drawSolidRect( Point origin, Point destination, Color4F color );\n\n    /** draws a polygon given a pointer to Point coordinates and the number of vertices measured in points.\n    The polygon can be closed or open\n    */\n    void drawPoly( const Point *vertices, unsigned int numOfVertices, bool closePolygon );\n\n    /** draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.\n     */\n    void drawSolidPoly( const Point *poli, unsigned int numberOfPoints, Color4F color );\n\n    /** draws a circle given the center, radius and number of segments. */\n    void drawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY);\n    void drawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter);\n\n    /** draws a solid circle given the center, radius and number of segments. */\n    void drawSolidCircle( const Point& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY);\n    void drawSolidCircle( const Point& center, float radius, float angle, unsigned int segments);\n\n    /** draws a quad bezier path\n     @warning This function could be pretty slow. Use it only for debugging purposes.\n     @since v0.8\n     */\n    void drawQuadBezier(const Point& origin, const Point& control, const Point& destination, unsigned int segments);\n\n    /** draws a cubic bezier path\n     @warning This function could be pretty slow. Use it only for debugging purposes.\n     @since v0.8\n     */\n    void drawCubicBezier(const Point& origin, const Point& control1, const Point& control2, const Point& destination, unsigned int segments);\n\n    /** draws a Catmull Rom path.\n     @warning This function could be pretty slow. Use it only for debugging purposes.\n     @since v2.0\n     */\n    void drawCatmullRom( PointArray *arrayOfControlPoints, unsigned int segments );\n\n    /** draws a Cardinal Spline path.\n     @warning This function could be pretty slow. Use it only for debugging purposes.\n     @since v2.0\n     */\n    void drawCardinalSpline( PointArray *config, float tension,  unsigned int segments );\n\n    /** set the drawing color with 4 unsigned bytes\n     @since v2.0\n     */\n    void setDrawColor4B( GLubyte r, GLubyte g, GLubyte b, GLubyte a );\n\n    /** set the drawing color with 4 floats\n     @since v2.0\n     */\n    void setDrawColor4F( GLfloat r, GLfloat g, GLfloat b, GLfloat a );\n\n    /** set the point size in points. Default 1.\n     @since v2.0\n     */\n    void setPointSize( GLfloat pointSize );\n\n};\n\n// end of global group\n/// @}\n\nNS_CC_END\n\n#endif // __CCDRAWING_PRIMITIVES__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEvent.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEvent.h\"\n\nNS_CC_BEGIN\n\nEvent::Event(Type type)\n: _type(type)\n, _isStopped(false)\n, _currentTarget(nullptr)\n{\n}\n\nEvent::~Event()\n{\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEvent.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef __CCEVENT_H__\n#define __CCEVENT_H__\n\n#include <string>\n#include <stdint.h>\n\n#include \"CCObject.h\"\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\nclass Node;\n\n/**\n *   Base class of all kinds of events.\n */\nclass Event : public Object\n{\npublic:\n    enum class Type\n    {\n        TOUCH,\n        KEYBOARD,\n        ACCELERATION,\n        MOUSE,\n        CUSTOM\n    };\n    \nprotected:\n    /** Constructor */\n    Event(Type type);\npublic:\n    /** Destructor */\n    virtual ~Event();\n\n    /** Gets the event type */\n\tinline Type getType() const { return _type; };\n    \n    /** Stops propagation for current event */\n    inline void stopPropagation() { _isStopped = true; };\n    \n    /** Checks whether the event has been stopped */\n    inline bool isStopped() const { return _isStopped; };\n    \n    /** @brief Gets current target of the event\n     *  @return The target with which the event associates.\n     *  @note It onlys be available when the event listener is associated with node. \n     *        It returns 0 when the listener is associated with fixed priority.\n     */\n    inline Node* getCurrentTarget() { return _currentTarget; };\n    \nprotected:\n    /** Sets current target */\n    inline void setCurrentTarget(Node* target) { _currentTarget = target; };\n    \n\tType _type;     ///< Event type\n    \n    bool _isStopped;       ///< whether the event has been stopped.\n    Node* _currentTarget;  ///< Current target\n    \n    friend class EventDispatcher;\n};\n\nNS_CC_END\n\n\n#endif // __CCEVENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventAcceleration.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEventAcceleration.h\"\n\nNS_CC_BEGIN\n\nEventAcceleration::EventAcceleration(Acceleration acc)\n: Event(Type::ACCELERATION)\n, _acc(acc)\n{\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventAcceleration.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCAccelerometerEvent__\n#define __cocos2d_libs__CCAccelerometerEvent__\n\n#include \"CCEvent.h\"\n#include \"ccTypes.h\"\n\nNS_CC_BEGIN\n\nclass EventAcceleration : public Event\n{\npublic:\n\n    EventAcceleration(Acceleration acc);\n    \nprivate:\n    Acceleration _acc;\n    friend class EventListenerAcceleration;\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCAccelerometerEvent__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventCustom.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEventCustom.h\"\n#include \"ccMacros.h\"\n#include <functional>\n\nNS_CC_BEGIN\n\nEventCustom::EventCustom(const std::string& eventName)\n: Event(Type::CUSTOM)\n, _userData(nullptr)\n, _eventName(eventName)\n{\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventCustom.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCCustomEvent__\n#define __cocos2d_libs__CCCustomEvent__\n\n#include \"CCEvent.h\"\n\nNS_CC_BEGIN\n\nclass EventCustom : public Event\n{\npublic:\n    /** Constructor */\n    EventCustom(const std::string& eventName);\n    \n    /** Sets user data */\n    inline void setUserData(void* data) { _userData = data; };\n    \n    /** Gets user data */\n    inline void* getUserData() const { return _userData; };\n    \n    /** Gets event name */\n    inline const std::string& getEventName() const { return _eventName; };\nprotected:\n    void* _userData;       ///< User data\n    std::string _eventName;\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCCustomEvent__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventDispatcher.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"CCEventDispatcher.h\"\n#include \"CCEvent.h\"\n#include \"CCEventTouch.h\"\n#include \"CCEventCustom.h\"\n#include \"CCEventListenerTouch.h\"\n#include \"CCEventListenerAcceleration.h\"\n#include \"CCEventListenerMouse.h\"\n#include \"CCEventListenerKeyboard.h\"\n#include \"CCEventListenerCustom.h\"\n\n#include \"CCNode.h\"\n#include \"CCDirector.h\"\n\n#include <algorithm>\n\n\n#define DUMP_LISTENER_ITEM_PRIORITY_INFO 0\n\nnamespace\n{\n\nclass DispatchGuard\n{\npublic:\n    DispatchGuard(int& count):\n            _count(count)\n    {\n        ++_count;\n    }\n\n    ~DispatchGuard()\n    {\n        --_count;\n    }\n\nprivate:\n    int& _count;\n};\n\n}\n\nNS_CC_BEGIN\n\nstatic EventListener::ListenerID __getListenerID(Event* event)\n{\n    EventListener::ListenerID ret;\n    switch (event->getType())\n    {\n        case Event::Type::ACCELERATION:\n            ret = EventListenerAcceleration::LISTENER_ID;\n            break;\n        case Event::Type::CUSTOM:\n            {\n                auto customEvent = static_cast<EventCustom*>(event);\n                ret = customEvent->getEventName();\n            }\n            break;\n        case Event::Type::KEYBOARD:\n            ret = EventListenerKeyboard::LISTENER_ID;\n            break;\n        case Event::Type::MOUSE:\n            ret = EventListenerMouse::LISTENER_ID;\n            break;\n        case Event::Type::TOUCH:\n            // Touch listener is very special, it contains two kinds of listeners, EventListenerTouchOneByOne and EventListenerTouchAllAtOnce.\n            // return UNKNOWN instead.\n            CCASSERT(false, \"Don't call this method if the event is for touch.\");\n            break;\n        default:\n            CCASSERT(false, \"Invalid type!\");\n            break;\n    }\n    \n    return ret;\n}\n\nEventDispatcher::EventListenerVector::EventListenerVector() :\n _fixedListeners(nullptr),\n _sceneGraphListeners(nullptr),\n _gt0Index(0)\n{\n}\n\nEventDispatcher::EventListenerVector::~EventListenerVector()\n{\n    CC_SAFE_DELETE(_sceneGraphListeners);\n    CC_SAFE_DELETE(_fixedListeners);\n}\n\nsize_t EventDispatcher::EventListenerVector::size() const\n{\n    size_t ret = 0;\n    if (_sceneGraphListeners)\n        ret += _sceneGraphListeners->size();\n    if (_fixedListeners)\n        ret += _fixedListeners->size();\n    \n    return ret;\n}\n\nbool EventDispatcher::EventListenerVector::empty() const\n{\n    return (_sceneGraphListeners == nullptr || _sceneGraphListeners->empty())\n        && (_fixedListeners == nullptr || _fixedListeners->empty());\n}\n\nvoid EventDispatcher::EventListenerVector::push_back(EventListener* listener)\n{\n    if (listener->getFixedPriority() == 0)\n    {\n        if (_sceneGraphListeners == nullptr)\n        {\n            _sceneGraphListeners = new std::vector<EventListener*>();\n            _sceneGraphListeners->reserve(100);\n        }\n        \n        _sceneGraphListeners->push_back(listener);\n    }\n    else\n    {\n        if (_fixedListeners == nullptr)\n        {\n            _fixedListeners = new std::vector<EventListener*>();\n            _fixedListeners->reserve(100);\n        }\n        \n        _fixedListeners->push_back(listener);\n    }\n}\n\nvoid EventDispatcher::EventListenerVector::clearSceneGraphListeners()\n{\n    if (_sceneGraphListeners)\n    {\n        _sceneGraphListeners->clear();\n        delete _sceneGraphListeners;\n        _sceneGraphListeners = nullptr;\n    }\n}\n\nvoid EventDispatcher::EventListenerVector::clearFixedListeners()\n{\n    if (_fixedListeners)\n    {\n        _fixedListeners->clear();\n        delete _fixedListeners;\n        _fixedListeners = nullptr;\n    }\n}\n\nvoid EventDispatcher::EventListenerVector::clear()\n{\n    clearSceneGraphListeners();\n    clearFixedListeners();\n}\n\n\nEventDispatcher::EventDispatcher()\n: _inDispatch(0)\n, _isEnabled(true)\n, _nodePriorityIndex(0)\n{\n    _toAddedListeners.reserve(50);\n}\n\nEventDispatcher::~EventDispatcher()\n{\n    removeAllEventListeners();\n}\n\nvoid EventDispatcher::visitTarget(Node* node, bool isRootNode)\n{    \n    int i = 0;\n    auto& children = node->getChildren();\n    \n    auto childrenCount = children.size();\n    \n    if(childrenCount > 0)\n    {\n        Node* child = nullptr;\n        // visit children zOrder < 0\n        for( ; i < childrenCount; i++ )\n        {\n            child = children.at(i);\n            \n            if ( child && child->getLocalZOrder() < 0 )\n                visitTarget(child, false);\n            else\n                break;\n        }\n        \n        if (_nodeListenersMap.find(node) != _nodeListenersMap.end())\n        {\n            _globalZOrderNodeMap[node->getGlobalZOrder()].push_back(node);\n        }\n        \n        for( ; i < childrenCount; i++ )\n        {\n            child = children.at(i);\n            if (child)\n                visitTarget(child, false);\n        }\n    }\n    else\n    {\n        if (_nodeListenersMap.find(node) != _nodeListenersMap.end())\n        {\n            _globalZOrderNodeMap[node->getGlobalZOrder()].push_back(node);\n        }\n    }\n    \n    if (isRootNode)\n    {\n        std::vector<float> globalZOrders;\n        globalZOrders.reserve(_globalZOrderNodeMap.size());\n        \n        for (const auto& e : _globalZOrderNodeMap)\n        {\n            globalZOrders.push_back(e.first);\n        }\n        \n        std::sort(globalZOrders.begin(), globalZOrders.end(), [](const float a, const float b){\n            return a < b;\n        });\n        \n        for (const auto& globalZ : globalZOrders)\n        {\n            for (const auto& n : _globalZOrderNodeMap[globalZ])\n            {\n                _nodePriorityMap[n] = ++_nodePriorityIndex;\n            }\n        }\n        \n        _globalZOrderNodeMap.clear();\n    }\n}\n\nvoid EventDispatcher::pauseTarget(Node* node)\n{\n    auto listenerIter = _nodeListenersMap.find(node);\n    if (listenerIter != _nodeListenersMap.end())\n    {\n        auto listeners = listenerIter->second;\n        for (auto& l : *listeners)\n        {\n            l->setPaused(true);\n        }\n    }\n}\n\nvoid EventDispatcher::resumeTarget(Node* node)\n{\n    auto listenerIter = _nodeListenersMap.find(node);\n    if (listenerIter != _nodeListenersMap.end())\n    {\n        auto listeners = listenerIter->second;\n        for (auto& l : *listeners)\n        {\n            l->setPaused(false);\n        }\n    }\n    setDirtyForNode(node);\n}\n\nvoid EventDispatcher::cleanTarget(Node* node)\n{\n    auto listenerIter = _nodeListenersMap.find(node);\n    if (listenerIter != _nodeListenersMap.end())\n    {\n        auto listeners = listenerIter->second;\n        auto listenersCopy = *listeners;\n        for (auto& l : listenersCopy)\n        {\n            removeEventListener(l);\n        }\n    }\n}\n\nvoid EventDispatcher::associateNodeAndEventListener(Node* node, EventListener* listener)\n{\n    std::vector<EventListener*>* listeners = nullptr;\n    auto found = _nodeListenersMap.find(node);\n    if (found != _nodeListenersMap.end())\n    {\n        listeners = found->second;\n    }\n    else\n    {\n        listeners = new std::vector<EventListener*>();\n        _nodeListenersMap.insert(std::make_pair(node, listeners));\n    }\n    \n    listeners->push_back(listener);\n}\n\nvoid EventDispatcher::dissociateNodeAndEventListener(Node* node, EventListener* listener)\n{\n    std::vector<EventListener*>* listeners = nullptr;\n    auto found = _nodeListenersMap.find(node);\n    if (found != _nodeListenersMap.end())\n    {\n        listeners = found->second;\n        auto iter = std::find(listeners->begin(), listeners->end(), listener);\n        if (iter != listeners->end())\n        {\n            listeners->erase(iter);\n        }\n        \n        if (listeners->empty())\n        {\n            _nodeListenersMap.erase(found);\n            delete listeners;\n        }\n    }\n}\n\nvoid EventDispatcher::addEventListener(EventListener* listener)\n{\n    if (_inDispatch == 0)\n    {\n        forceAddEventListener(listener);\n    }\n    else\n    {\n        _toAddedListeners.push_back(listener);\n    }\n\n    listener->retain();\n}\n\nvoid EventDispatcher::forceAddEventListener(EventListener* listener)\n{\n    EventListenerVector* listeners = nullptr;\n    EventListener::ListenerID listenerID = listener->getListenerID();\n    auto itr = _listeners.find(listenerID);\n    if (itr == _listeners.end())\n    {\n        \n        listeners = new EventListenerVector();\n        _listeners.insert(std::make_pair(listenerID, listeners));\n    }\n    else\n    {\n        listeners = itr->second;\n    }\n    \n    listeners->push_back(listener);\n    \n    if (listener->getFixedPriority() == 0)\n    {\n        setDirty(listenerID, DirtyFlag::SCENE_GRAPH_PRIORITY);\n        \n        auto node = listener->getSceneGraphPriority();\n        CCASSERT(node != nullptr, \"Invalid scene graph priority!\");\n        \n        associateNodeAndEventListener(node, listener);\n        \n        if (node->isRunning())\n        {\n            resumeTarget(node);\n        }\n    }\n    else\n    {\n        setDirty(listenerID, DirtyFlag::FIXED_PRIORITY);\n    }\n}\n\nvoid EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* listener, Node* node)\n{\n    CCASSERT(listener && node, \"Invalid parameters.\");\n    CCASSERT(!listener->isRegistered(), \"The listener has been registered.\");\n    \n    if (!listener->checkAvailable())\n        return;\n    \n    listener->setSceneGraphPriority(node);\n    listener->setFixedPriority(0);\n    listener->setRegistered(true);\n    \n    addEventListener(listener);\n}\n\nvoid EventDispatcher::addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority)\n{\n    CCASSERT(listener, \"Invalid parameters.\");\n    CCASSERT(!listener->isRegistered(), \"The listener has been registered.\");\n    CCASSERT(fixedPriority != 0, \"0 priority is forbidden for fixed priority since it's used for scene graph based priority.\");\n    \n    if (!listener->checkAvailable())\n        return;\n    \n    listener->setSceneGraphPriority(nullptr);\n    listener->setFixedPriority(fixedPriority);\n    listener->setRegistered(true);\n    listener->setPaused(false);\n\n    addEventListener(listener);\n}\n\nEventListenerCustom* EventDispatcher::addCustomEventListener(const std::string &eventName, std::function<void(EventCustom*)> callback)\n{\n    EventListenerCustom *listener = EventListenerCustom::create(eventName, callback);\n    addEventListenerWithFixedPriority(listener, 1);\n    return listener;\n}\n\nvoid EventDispatcher::removeEventListener(EventListener* listener)\n{\n    if (listener == nullptr)\n        return;\n\n    bool isFound = false;\n\n    auto removeListenerInVector = [&](std::vector<EventListener*>* listeners){\n        if (listeners == nullptr)\n            return;\n        \n        for (auto iter = listeners->begin(); iter != listeners->end(); ++iter)\n        {\n            auto l = *iter;\n            if (l == listener)\n            {\n                CC_SAFE_RETAIN(l);\n                l->setRegistered(false);\n                if (l->getSceneGraphPriority() != nullptr)\n                {\n                    dissociateNodeAndEventListener(l->getSceneGraphPriority(), l);\n                }\n                \n                if (_inDispatch == 0)\n                {\n                    listeners->erase(iter);\n                    CC_SAFE_RELEASE(l);\n                }\n                \n                isFound = true;\n                break;\n            }\n        }\n    };\n    \n    for (auto iter = _listeners.begin(); iter != _listeners.end();)\n    {\n        auto listeners = iter->second;\n        auto fixedPriorityListeners = listeners->getFixedPriorityListeners();\n        auto sceneGraphPriorityListeners = listeners->getSceneGraphPriorityListeners();\n\n        removeListenerInVector(sceneGraphPriorityListeners);\n        if (!isFound)\n        {\n            removeListenerInVector(fixedPriorityListeners);\n        }\n\n        if (iter->second->empty())\n        {\n            _priorityDirtyFlagMap.erase(listener->getListenerID());\n            auto list = iter->second;\n            iter = _listeners.erase(iter);\n            CC_SAFE_DELETE(list);\n        }\n        else\n        {\n            ++iter;\n        }\n        \n        if (isFound)\n            break;\n    }\n\n    if (isFound)\n    {\n        CC_SAFE_RELEASE(listener);\n    }\n    else\n    {\n        for(auto iter = _toAddedListeners.begin(); iter != _toAddedListeners.end(); ++iter)\n        {\n            if (*iter == listener)\n            {\n                listener->release();\n                _toAddedListeners.erase(iter);\n                break;\n            }\n        }\n    }\n}\n\nvoid EventDispatcher::setPriority(EventListener* listener, int fixedPriority)\n{\n    if (listener == nullptr)\n        return;\n    \n    for (auto iter = _listeners.begin(); iter != _listeners.end(); ++iter)\n    {\n        auto fixedPriorityListeners = iter->second->getFixedPriorityListeners();\n        if (fixedPriorityListeners)\n        {\n            auto found = std::find(fixedPriorityListeners->begin(), fixedPriorityListeners->end(), listener);\n            if (found != fixedPriorityListeners->end())\n            {\n                CCASSERT(listener->getSceneGraphPriority() == nullptr, \"Can't set fixed priority with scene graph based listener.\");\n                \n                if (listener->getFixedPriority() != fixedPriority)\n                {\n                    listener->setFixedPriority(fixedPriority);\n                    setDirty(listener->getListenerID(), DirtyFlag::FIXED_PRIORITY);\n                }\n                return;\n            }\n        }\n    }\n}\n\nvoid EventDispatcher::dispatchEventToListeners(EventListenerVector* listeners, std::function<bool(EventListener*)> onEvent)\n{\n    bool shouldStopPropagation = false;\n    auto fixedPriorityListeners = listeners->getFixedPriorityListeners();\n    auto sceneGraphPriorityListeners = listeners->getSceneGraphPriorityListeners();\n    \n    ssize_t i = 0;\n    // priority < 0\n    if (fixedPriorityListeners)\n    {\n        bool isEmpty = fixedPriorityListeners->empty();\n        for (; !isEmpty && i < listeners->getGt0Index(); ++i)\n        {\n            auto l = fixedPriorityListeners->at(i);\n            if (!l->isPaused() && l->isRegistered() && onEvent(l))\n            {\n                shouldStopPropagation = true;\n                break;\n            }\n        }\n    }\n    \n    if (sceneGraphPriorityListeners)\n    {\n        if (!shouldStopPropagation)\n        {\n            // priority == 0, scene graph priority\n            for (auto& l : *sceneGraphPriorityListeners)\n            {\n                if (!l->isPaused() && l->isRegistered() && onEvent(l))\n                {\n                    shouldStopPropagation = true;\n                    break;\n                }\n            }\n        }\n    }\n\n    if (fixedPriorityListeners)\n    {\n        if (!shouldStopPropagation)\n        {\n            // priority > 0\n            ssize_t size = fixedPriorityListeners->size();\n            for (; i < size; ++i)\n            {\n                auto l = fixedPriorityListeners->at(i);\n                \n                if (!l->isPaused() && l->isRegistered() && onEvent(fixedPriorityListeners->at(i)))\n                {\n                    shouldStopPropagation = true;\n                    break;\n                }\n            }\n        }\n    }\n}\n\nvoid EventDispatcher::dispatchEvent(Event* event)\n{\n    if (!_isEnabled)\n        return;\n    \n    updateDirtyFlagForSceneGraph();\n    \n    \n    DispatchGuard guard(_inDispatch);\n    \n    if (event->getType() == Event::Type::TOUCH)\n    {\n        dispatchTouchEvent(static_cast<EventTouch*>(event));\n        return;\n    }\n    \n    auto listenerID = __getListenerID(event);\n    \n    sortEventListeners(listenerID);\n    \n    auto iter = _listeners.find(listenerID);\n    if (iter != _listeners.end())\n    {\n        auto listeners = iter->second;\n        \n        auto onEvent = [&event](EventListener* listener) -> bool{\n            event->setCurrentTarget(listener->getSceneGraphPriority());\n            listener->_onEvent(event);\n            return event->isStopped();\n        };\n        \n        dispatchEventToListeners(listeners, onEvent);\n    }\n    \n    updateListeners(event);\n}\n\nvoid EventDispatcher::dispatchCustomEvent(const std::string &eventName, void *optionalUserData)\n{\n    EventCustom ev(eventName);\n    ev.setUserData(optionalUserData);\n    dispatchEvent(&ev);\n}\n\n\nvoid EventDispatcher::dispatchTouchEvent(EventTouch* event)\n{\n    sortEventListeners(EventListenerTouchOneByOne::LISTENER_ID);\n    sortEventListeners(EventListenerTouchAllAtOnce::LISTENER_ID);\n    \n    auto oneByOnelisteners = getListeners(EventListenerTouchOneByOne::LISTENER_ID);\n    auto allAtOncelisteners = getListeners(EventListenerTouchAllAtOnce::LISTENER_ID);\n    \n    // If there aren't any touch listeners, return directly.\n    if (nullptr == oneByOnelisteners && nullptr == allAtOncelisteners)\n        return;\n    \n    bool isNeedsMutableSet = (oneByOnelisteners && allAtOncelisteners);\n    \n    std::vector<Touch*> orignalTouches = event->getTouches();\n    std::vector<Touch*> mutableTouches(orignalTouches.size());\n    std::copy(orignalTouches.begin(), orignalTouches.end(), mutableTouches.begin());\n\n    //\n    // process the target handlers 1st\n    //\n    if (oneByOnelisteners)\n    {\n        auto mutableTouchesIter = mutableTouches.begin();\n        auto touchesIter = orignalTouches.begin();\n        \n        for (; touchesIter != orignalTouches.end(); ++touchesIter)\n        {\n            bool isSwallowed = false;\n\n            auto onTouchEvent = [&](EventListener* l) -> bool { // Return true to break\n                EventListenerTouchOneByOne* listener = static_cast<EventListenerTouchOneByOne*>(l);\n                \n                // Skip if the listener was removed.\n                if (!listener->_isRegistered)\n                    return false;\n             \n                event->setCurrentTarget(listener->_node);\n                \n                bool isClaimed = false;\n                std::vector<Touch*>::iterator removedIter;\n                \n                EventTouch::EventCode eventCode = event->getEventCode();\n                \n                if (eventCode == EventTouch::EventCode::BEGAN)\n                {\n                    if (listener->onTouchBegan)\n                    {\n                        isClaimed = listener->onTouchBegan(*touchesIter, event);\n                        if (isClaimed && listener->_isRegistered)\n                        {\n                            listener->_claimedTouches.push_back(*touchesIter);\n                        }\n                    }\n                }\n                else if (listener->_claimedTouches.size() > 0\n                         && ((removedIter = std::find(listener->_claimedTouches.begin(), listener->_claimedTouches.end(), *touchesIter)) != listener->_claimedTouches.end()))\n                {\n                    isClaimed = true;\n                    \n                    switch (eventCode)\n                    {\n                        case EventTouch::EventCode::MOVED:\n                            if (listener->onTouchMoved)\n                            {\n                                listener->onTouchMoved(*touchesIter, event);\n                            }\n                            break;\n                        case EventTouch::EventCode::ENDED:\n                            if (listener->onTouchEnded)\n                            {\n                                listener->onTouchEnded(*touchesIter, event);\n                            }\n                            if (listener->_isRegistered)\n                            {\n                                listener->_claimedTouches.erase(removedIter);\n                            }\n                            break;\n                        case EventTouch::EventCode::CANCELLED:\n                            if (listener->onTouchCancelled)\n                            {\n                                listener->onTouchCancelled(*touchesIter, event);\n                            }\n                            if (listener->_isRegistered)\n                            {\n                                listener->_claimedTouches.erase(removedIter);\n                            }\n                            break;\n                        default:\n                            CCASSERT(false, \"The eventcode is invalid.\");\n                            break;\n                    }\n                }\n                \n                // If the event was stopped, return directly.\n                if (event->isStopped())\n                {\n                    updateListeners(event);\n                    return true;\n                }\n                \n                CCASSERT((*touchesIter)->getID() == (*mutableTouchesIter)->getID(), \"\");\n                \n                if (isClaimed && listener->_isRegistered && listener->_needSwallow)\n                {\n                    if (isNeedsMutableSet)\n                    {\n                        mutableTouchesIter = mutableTouches.erase(mutableTouchesIter);\n                        isSwallowed = true;\n                    }\n                    return true;\n                }\n                \n                return false;\n            };\n            \n            //\n            dispatchEventToListeners(oneByOnelisteners, onTouchEvent);\n            if (event->isStopped())\n            {\n                return;\n            }\n            \n            if (!isSwallowed)\n                ++mutableTouchesIter;\n        }\n    }\n    \n    //\n    // process standard handlers 2nd\n    //\n    if (allAtOncelisteners && mutableTouches.size() > 0)\n    {\n        \n        auto onTouchesEvent = [&](EventListener* l) -> bool{\n            EventListenerTouchAllAtOnce* listener = static_cast<EventListenerTouchAllAtOnce*>(l);\n            // Skip if the listener was removed.\n            if (!listener->_isRegistered)\n                return false;\n            \n            event->setCurrentTarget(listener->_node);\n            \n            switch (event->getEventCode())\n            {\n                case EventTouch::EventCode::BEGAN:\n                    if (listener->onTouchesBegan)\n                    {\n                        listener->onTouchesBegan(mutableTouches, event);\n                    }\n                    break;\n                case EventTouch::EventCode::MOVED:\n                    if (listener->onTouchesMoved)\n                    {\n                        listener->onTouchesMoved(mutableTouches, event);\n                    }\n                    break;\n                case EventTouch::EventCode::ENDED:\n                    if (listener->onTouchesEnded)\n                    {\n                        listener->onTouchesEnded(mutableTouches, event);\n                    }\n                    break;\n                case EventTouch::EventCode::CANCELLED:\n                    if (listener->onTouchesCancelled)\n                    {\n                        listener->onTouchesCancelled(mutableTouches, event);\n                    }\n                    break;\n                default:\n                    CCASSERT(false, \"The eventcode is invalid.\");\n                    break;\n            }\n            \n            // If the event was stopped, return directly.\n            if (event->isStopped())\n            {\n                updateListeners(event);\n                return true;\n            }\n            \n            return false;\n        };\n        \n        dispatchEventToListeners(allAtOncelisteners, onTouchesEvent);\n        if (event->isStopped())\n        {\n            return;\n        }\n    }\n    \n    updateListeners(event);\n}\n\nvoid EventDispatcher::updateListeners(Event* event)\n{\n    auto onUpdateListeners = [this](const EventListener::ListenerID& listenerID)\n    {\n        auto listenersIter = _listeners.find(listenerID);\n        if (listenersIter == _listeners.end())\n            return;\n        \n        auto listeners = listenersIter->second;\n        auto fixedPriorityListeners = listeners->getFixedPriorityListeners();\n        auto sceneGraphPriorityListeners = listeners->getSceneGraphPriorityListeners();\n        \n        if (sceneGraphPriorityListeners)\n        {\n            for (auto iter = sceneGraphPriorityListeners->begin(); iter != sceneGraphPriorityListeners->end();)\n            {\n                auto l = *iter;\n                if (!l->isRegistered())\n                {\n                    iter = sceneGraphPriorityListeners->erase(iter);\n                    l->release();\n                }\n                else\n                {\n                    ++iter;\n                }\n            }\n        }\n        \n        if (fixedPriorityListeners)\n        {\n            for (auto iter = fixedPriorityListeners->begin(); iter != fixedPriorityListeners->end();)\n            {\n                auto l = *iter;\n                if (!l->isRegistered())\n                {\n                    iter = fixedPriorityListeners->erase(iter);\n                    l->release();\n                }\n                else\n                {\n                    ++iter;\n                }\n            }\n        }\n        \n        if (sceneGraphPriorityListeners && sceneGraphPriorityListeners->empty())\n        {\n            listeners->clearSceneGraphListeners();\n        }\n\n        if (fixedPriorityListeners && fixedPriorityListeners->empty())\n        {\n            listeners->clearFixedListeners();\n        }\n\n        if (listenersIter->second->empty())\n        {\n            _priorityDirtyFlagMap.erase(listenersIter->first);\n            delete listenersIter->second;\n            listenersIter =  _listeners.erase(listenersIter);\n        }\n        else\n        {\n            ++listenersIter;\n        }\n    };\n    \n    if (event->getType() == Event::Type::TOUCH)\n    {\n        onUpdateListeners(EventListenerTouchOneByOne::LISTENER_ID);\n        onUpdateListeners(EventListenerTouchAllAtOnce::LISTENER_ID);\n    }\n    else\n    {\n        onUpdateListeners(__getListenerID(event));\n    }\n    \n    \n    if (!_toAddedListeners.empty())\n    {\n        for (auto& listener : _toAddedListeners)\n        {\n            forceAddEventListener(listener);\n        }\n        _toAddedListeners.clear();\n    }\n}\n\nvoid EventDispatcher::updateDirtyFlagForSceneGraph()\n{\n    if (!_dirtyNodes.empty())\n    {\n        for (auto& node : _dirtyNodes)\n        {\n            auto iter = _nodeListenersMap.find(node);\n            if (iter != _nodeListenersMap.end())\n            {\n                for (auto& l : *iter->second)\n                {\n                    setDirty(l->getListenerID(), DirtyFlag::SCENE_GRAPH_PRIORITY);\n                }\n            }\n        }\n        \n        _dirtyNodes.clear();\n    }\n}\n\nvoid EventDispatcher::sortEventListeners(const EventListener::ListenerID& listenerID)\n{\n    DirtyFlag dirtyFlag = DirtyFlag::NONE;\n    \n    auto dirtyIter = _priorityDirtyFlagMap.find(listenerID);\n    if (dirtyIter != _priorityDirtyFlagMap.end())\n    {\n        dirtyFlag = dirtyIter->second;\n    }\n    \n    if (dirtyFlag != DirtyFlag::NONE)\n    {\n        if ((int)dirtyFlag & (int)DirtyFlag::FIXED_PRIORITY)\n        {\n            sortEventListenersOfFixedPriority(listenerID);\n        }\n        \n        if ((int)dirtyFlag & (int)DirtyFlag::SCENE_GRAPH_PRIORITY)\n        {\n            sortEventListenersOfSceneGraphPriority(listenerID);\n        }\n        \n        dirtyIter->second = DirtyFlag::NONE;\n    }\n}\n\nvoid EventDispatcher::sortEventListenersOfSceneGraphPriority(const EventListener::ListenerID& listenerID)\n{\n    auto listeners = getListeners(listenerID);\n    \n    if (listeners == nullptr)\n        return;\n    \n    Node* rootNode = (Node*)Director::getInstance()->getRunningScene();\n    // Reset priority index\n    _nodePriorityIndex = 0;\n    _nodePriorityMap.clear();\n\n    visitTarget(rootNode, true);\n    \n    // After sort: priority < 0, > 0\n    auto sceneGraphlisteners = listeners->getSceneGraphPriorityListeners();\n    std::sort(sceneGraphlisteners->begin(), sceneGraphlisteners->end(), [this](const EventListener* l1, const EventListener* l2) {\n        return _nodePriorityMap[l1->getSceneGraphPriority()] > _nodePriorityMap[l2->getSceneGraphPriority()];\n    });\n    \n#if DUMP_LISTENER_ITEM_PRIORITY_INFO\n    log(\"-----------------------------------\");\n    for (auto& l : *sceneGraphlisteners)\n    {\n        log(\"listener priority: node ([%s]%p), priority (%d)\", typeid(*l->_node).name(), l->_node, _nodePriorityMap[l->_node]);\n    }\n#endif\n}\n\nvoid EventDispatcher::sortEventListenersOfFixedPriority(const EventListener::ListenerID& listenerID)\n{\n    auto listeners = getListeners(listenerID);\n\n    if (listeners == nullptr)\n        return;\n    \n    // After sort: priority < 0, > 0\n    auto fixedlisteners = listeners->getFixedPriorityListeners();\n    std::sort(fixedlisteners->begin(), fixedlisteners->end(), [](const EventListener* l1, const EventListener* l2) {\n        return l1->getFixedPriority() < l2->getFixedPriority();\n    });\n    \n    // FIXME: Should use binary search\n    int index = 0;\n    for (auto& listener : *fixedlisteners)\n    {\n        if (listener->getFixedPriority() >= 0)\n            break;\n        ++index;\n    }\n    \n    listeners->setGt0Index(index);\n    \n#if DUMP_LISTENER_ITEM_PRIORITY_INFO\n    log(\"-----------------------------------\");\n    for (auto& l : *fixedlisteners)\n    {\n        log(\"listener priority: node (%p), fixed (%d)\", l->_node, l->_fixedPriority);\n    }    \n#endif\n    \n}\n\nEventDispatcher::EventListenerVector* EventDispatcher::getListeners(const EventListener::ListenerID& listenerID)\n{\n    auto iter = _listeners.find(listenerID);\n    if (iter != _listeners.end())\n    {\n        return iter->second;\n    }\n    \n    return nullptr;\n}\n\nvoid EventDispatcher::removeEventListenersForListenerID(const EventListener::ListenerID& listenerID)\n{\n    auto listenerItemIter = _listeners.find(listenerID);\n    if (listenerItemIter != _listeners.end())\n    {\n        auto listeners = listenerItemIter->second;\n        auto fixedPriorityListeners = listeners->getFixedPriorityListeners();\n        auto sceneGraphPriorityListeners = listeners->getSceneGraphPriorityListeners();\n        \n        auto removeAllListenersInVector = [&](std::vector<EventListener*>* listenerVector){\n            if (listenerVector == nullptr)\n                return;\n            \n            for (auto iter = listenerVector->begin(); iter != listenerVector->end();)\n            {\n                auto l = *iter;\n                l->setRegistered(false);\n                if (l->getSceneGraphPriority() != nullptr)\n                {\n                    dissociateNodeAndEventListener(l->getSceneGraphPriority(), l);\n                }\n                \n                if (_inDispatch == 0)\n                {\n                    iter = listenerVector->erase(iter);\n                    CC_SAFE_RELEASE(l);\n                }\n                else\n                {\n                    ++iter;\n                }\n            }\n        };\n        \n        removeAllListenersInVector(sceneGraphPriorityListeners);\n        removeAllListenersInVector(fixedPriorityListeners);\n        \n        if (!_inDispatch)\n        {\n            listeners->clear();\n            delete listeners;\n            _listeners.erase(listenerItemIter);\n            _priorityDirtyFlagMap.erase(listenerID);\n        }\n    }\n    \n    for (auto iter = _toAddedListeners.begin(); iter != _toAddedListeners.end();)\n    {\n        if ((*iter)->getListenerID() == listenerID)\n        {\n            (*iter)->release();\n            iter = _toAddedListeners.erase(iter);\n        }\n        else\n        {\n            ++iter;\n        }\n    }\n}\n\nvoid EventDispatcher::removeEventListeners(EventListener::Type listenerType)\n{\n    if (listenerType == EventListener::Type::TOUCH_ONE_BY_ONE)\n    {\n        removeEventListenersForListenerID(EventListenerTouchOneByOne::LISTENER_ID);\n    }\n    else if (listenerType == EventListener::Type::TOUCH_ALL_AT_ONCE)\n    {\n        removeEventListenersForListenerID(EventListenerTouchAllAtOnce::LISTENER_ID);\n    }\n    else if (listenerType == EventListener::Type::MOUSE)\n    {\n        removeEventListenersForListenerID(EventListenerMouse::LISTENER_ID);\n    }\n    else if (listenerType == EventListener::Type::ACCELERATION)\n    {\n        removeEventListenersForListenerID(EventListenerAcceleration::LISTENER_ID);\n    }\n    else if (listenerType == EventListener::Type::KEYBOARD)\n    {\n        removeEventListenersForListenerID(EventListenerKeyboard::LISTENER_ID);\n    }\n    else\n    {\n        CCASSERT(false, \"Invalid listener type!\");\n    }\n}\n\nvoid EventDispatcher::removeCustomEventListeners(const std::string& customEventName)\n{\n    removeEventListenersForListenerID(customEventName);\n}\n\nvoid EventDispatcher::removeAllEventListeners()\n{\n    std::vector<EventListener::ListenerID> types(_listeners.size());\n\n    for (const auto& e : _listeners)\n    {\n        types.push_back(e.first);\n    }\n\n    for (const auto& type : types)\n    {\n        removeEventListenersForListenerID(type);\n    }\n    \n    if (!_inDispatch)\n    {\n        _listeners.clear();\n    }\n}\n\nvoid EventDispatcher::setEnabled(bool isEnabled)\n{\n    _isEnabled = isEnabled;\n}\n\n\nbool EventDispatcher::isEnabled() const\n{\n    return _isEnabled;\n}\n\nvoid EventDispatcher::setDirtyForNode(Node* node)\n{\n    // Mark the node dirty only when there is an eventlistener associated with it. \n    if (_nodeListenersMap.find(node) != _nodeListenersMap.end())\n    {\n        _dirtyNodes.insert(node);\n    }\n}\n\nvoid EventDispatcher::setDirty(const EventListener::ListenerID& listenerID, DirtyFlag flag)\n{    \n    auto iter = _priorityDirtyFlagMap.find(listenerID);\n    if (iter == _priorityDirtyFlagMap.end())\n    {\n        _priorityDirtyFlagMap.insert(std::make_pair(listenerID, flag));\n    }\n    else\n    {\n        int ret = (int)flag | (int)iter->second;\n        iter->second = (DirtyFlag) ret;\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventDispatcher.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CC_EVENT_DISPATCHER_H__\n#define __CC_EVENT_DISPATCHER_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"CCEventListener.h\"\n#include \"CCEvent.h\"\n\n#include <functional>\n#include <string>\n#include <unordered_map>\n#include <list>\n#include <vector>\n\nNS_CC_BEGIN\n\nclass Event;\nclass EventTouch;\nclass Node;\nclass EventCustom;\nclass EventListenerCustom;\n\n/**\nThis class manages event listener subscriptions\nand event dispatching.\n\nThe EventListener list is managed in such a way that\nevent listeners can be added and removed even\nfrom within an EventListener, while events are being\ndispatched.\n*/\nclass EventDispatcher : public Object\n{\npublic:\n    /** Adds a event listener for a specified event with the priority of scene graph.\n     *  @param listener The listener of a specified event.\n     *  @param node The priority of the listener is based on the draw order of this node.\n     *  @note  The priority of scene graph will be fixed value 0. So the order of listener item\n     *          in the vector will be ' <0, scene graph (0 priority), >0'.\n     */\n    void addEventListenerWithSceneGraphPriority(EventListener* listener, Node* node);\n\n    /** Adds a event listener for a specified event with the fixed priority.\n     *  @param listener The listener of a specified event.\n     *  @param fixedPriority The fixed priority of the listener.\n     *  @note A lower priority will be called before the ones that have a higher value.\n     *        0 priority is forbidden for fixed priority since it's used for scene graph based priority.\n     */\n    void addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority);\n\n    /** Adds a Custom event listener.\n     It will use a fixed priority of 1.\n     @return the generated event. Needed in order to remove the event from the dispather\n     */\n    EventListenerCustom* addCustomEventListener(const std::string &eventName, std::function<void(EventCustom*)> callback);\n\n    /** Remove a listener\n     *  @param listener The specified event listener which needs to be removed.\n     */\n    void removeEventListener(EventListener* listener);\n\n    /** Removes all listeners with the same event listener type */\n    void removeEventListeners(EventListener::Type listenerType);\n\n    /** Removes all custom listeners with the same event name */\n    void removeCustomEventListeners(const std::string& customEventName);\n\n    /** Removes all listeners */\n    void removeAllEventListeners();\n\n    /** Sets listener's priority with fixed value. */\n    void setPriority(EventListener* listener, int fixedPriority);\n\n    /** Whether to enable dispatching events */\n    void setEnabled(bool isEnabled);\n\n    /** Checks whether dispatching events is enabled */\n    bool isEnabled() const;\n\n    /** Dispatches the event\n     *  Also removes all EventListeners marked for deletion from the\n     *  event dispatcher list.\n     */\n    void dispatchEvent(Event* event);\n\n    /** Dispatches a Custom Event with a event name an optional user data */\n    void dispatchCustomEvent(const std::string &eventName, void *optionalUserData);\n\n    /** Constructor of EventDispatcher */\n    EventDispatcher();\n    /** Destructor of EventDispatcher */\n    ~EventDispatcher();\n\nprotected:\n    friend class Node;\n    \n    /** Sets the dirty flag for a node. */\n    void setDirtyForNode(Node* node);\n    \n    /** Notifys event dispatcher that the node has been paused. */\n    void pauseTarget(Node* node);\n    \n    /** Notifys event dispatcher that the node has been resumed. */\n    void resumeTarget(Node* node);\n    \n    /** Notifys event dispatcher that the node has been deleted. */\n    void cleanTarget(Node* node);\n    \n    /**\n     *  The vector to store event listeners with scene graph based priority and fixed priority.\n     */\n    class EventListenerVector\n    {\n    public:\n        EventListenerVector();\n        ~EventListenerVector();\n        size_t size() const;\n        bool empty() const;\n        \n        void push_back(EventListener* item);\n        void clearSceneGraphListeners();\n        void clearFixedListeners();\n        void clear();\n        \n        inline std::vector<EventListener*>* getFixedPriorityListeners() const { return _fixedListeners; };\n        inline std::vector<EventListener*>* getSceneGraphPriorityListeners() const { return _sceneGraphListeners; };\n        inline ssize_t getGt0Index() const { return _gt0Index; };\n        inline void setGt0Index(ssize_t index) { _gt0Index = index; };\n    private:\n        std::vector<EventListener*>* _fixedListeners;\n        std::vector<EventListener*>* _sceneGraphListeners;\n        ssize_t _gt0Index;\n    };\n    \n    /** Adds an event listener with item\n     *  @note if it is dispatching event, the added operation will be delayed to the end of current dispatch\n     *  @see forceAddEventListener\n     */\n    void addEventListener(EventListener* listener);\n    \n    /** Force adding an event listener\n     *  @note force add an event listener which will ignore whether it's in dispatching.\n     *  @see addEventListener\n     */\n    void forceAddEventListener(EventListener* listener);\n    \n    /** Gets event the listener list for the event listener type. */\n    EventListenerVector* getListeners(const EventListener::ListenerID& listenerID);\n    \n    /** Update dirty flag */\n    void updateDirtyFlagForSceneGraph();\n    \n    /** Removes all listeners with the same event listener ID */\n    void removeEventListenersForListenerID(const EventListener::ListenerID& listenerID);\n    \n    /** Sort event listener */\n    void sortEventListeners(const EventListener::ListenerID& listenerID);\n    \n    /** Sorts the listeners of specified type by scene graph priority */\n    void sortEventListenersOfSceneGraphPriority(const EventListener::ListenerID& listenerID);\n    \n    /** Sorts the listeners of specified type by fixed priority */\n    void sortEventListenersOfFixedPriority(const EventListener::ListenerID& listenerID);\n    \n    /** Updates all listeners\n     *  1) Removes all listener items that have been marked as 'removed' when dispatching event.\n     *  2) Adds all listener items that have been marked as 'added' when dispatching event.\n     */\n    void updateListeners(Event* event);\n\n    /** Touch event needs to be processed different with other events since it needs support ALL_AT_ONCE and ONE_BY_NONE mode. */\n    void dispatchTouchEvent(EventTouch* event);\n    \n    /** Associates node with event listener */\n    void associateNodeAndEventListener(Node* node, EventListener* listener);\n    \n    /** Dissociates node with event listener */\n    void dissociateNodeAndEventListener(Node* node, EventListener* listener);\n    \n    /** Dispatches event to listeners with a specified listener type */\n    void dispatchEventToListeners(EventListenerVector* listeners, std::function<bool(EventListener*)> onEvent);\n    \n    /// Priority dirty flag\n    enum class DirtyFlag\n    {\n        NONE = 0,\n        FIXED_PRIORITY = 1 << 0,\n        SCENE_GRAPH_PRIORITY = 1 << 1,\n        ALL = FIXED_PRIORITY | SCENE_GRAPH_PRIORITY\n    };\n    \n    /** Sets the dirty flag for a specified listener ID */\n    void setDirty(const EventListener::ListenerID& listenerID, DirtyFlag flag);\n    \n    /** Walks though scene graph to get the draw order for each node, it's called before sorting event listener with scene graph priority */\n    void visitTarget(Node* node, bool isRootNode);\n    \n    /** Listeners map */\n    std::unordered_map<EventListener::ListenerID, EventListenerVector*> _listeners;\n    \n    /** The map of dirty flag */\n    std::unordered_map<EventListener::ListenerID, DirtyFlag> _priorityDirtyFlagMap;\n    \n    /** The map of node and event listeners */\n    std::unordered_map<Node*, std::vector<EventListener*>*> _nodeListenersMap;\n    \n    /** The map of node and its event priority */\n    std::unordered_map<Node*, int> _nodePriorityMap;\n    \n    /** key: Global Z Order, value: Sorted Nodes */\n    std::unordered_map<float, std::vector<Node*>> _globalZOrderNodeMap;\n    \n    /** The listeners to be added after dispatching event */\n    std::vector<EventListener*> _toAddedListeners;\n    \n    /** The nodes were associated with scene graph based priority listeners */\n    std::set<Node*> _dirtyNodes;\n    \n    /** Whether the dispatcher is dispatching event */\n    int _inDispatch;\n    \n    /** Whether to enable dispatching event */\n    bool _isEnabled;\n    \n    int _nodePriorityIndex;\n};\n\n\nNS_CC_END\n\n\n#endif // __CC_EVENT_DISPATCHER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventKeyboard.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n ****************************************************************************/\n\n#include \"CCEventKeyboard.h\"\n\nNS_CC_BEGIN\n\nEventKeyboard::EventKeyboard(KeyCode keyCode, bool isPressed)\n: Event(Type::KEYBOARD)\n, _keyCode(keyCode)\n, _isPressed(isPressed)\n{}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventKeyboard.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCKeyboardEvent__\n#define __cocos2d_libs__CCKeyboardEvent__\n\n#include \"CCEvent.h\"\n\nNS_CC_BEGIN\n\nclass EventKeyboard : public Event\n{\npublic:\n    /**\n     * The key (code).\n     */\n    enum class KeyCode\n    {\n        KEY_NONE              = 0,\n        KEY_PAUSE             = 0x0013,\n        KEY_SCROLL_LOCK       = 0x1014,\n        KEY_PRINT             = 0x1061,\n        KEY_SYSREQ            = 0x106A,\n        KEY_BREAK             = 0x106B,\n        KEY_ESCAPE            = 0x001B,\n        KEY_BACKSPACE         = 0x0008,\n        KEY_TAB               = 0x0009,\n        KEY_BACK_TAB          = 0x0089,\n        KEY_RETURN            = 0x000D,\n        KEY_CAPS_LOCK         = 0x00E5,\n        KEY_SHIFT             = 0x00E1,\n        KEY_CTRL              = 0x00E3,\n        KEY_ALT               = 0x00E9,\n        KEY_MENU              = 0x1067,\n        KEY_HYPER             = 0x10ED,\n        KEY_INSERT            = 0x1063,\n        KEY_HOME              = 0x1050,\n        KEY_PG_UP             = 0x1055,\n        KEY_DELETE            = 0x10FF,\n        KEY_END               = 0x1057,\n        KEY_PG_DOWN           = 0x1056,\n        KEY_LEFT_ARROW        = 0x1051,\n        KEY_RIGHT_ARROW       = 0x1053,\n        KEY_UP_ARROW          = 0x1052,\n        KEY_DOWN_ARROW        = 0x1054,\n        KEY_NUM_LOCK          = 0x107F,\n        KEY_KP_PLUS           = 0x10AB,\n        KEY_KP_MINUS          = 0x10AD,\n        KEY_KP_MULTIPLY       = 0x10AA,\n        KEY_KP_DIVIDE         = 0x10AF,\n        KEY_KP_ENTER          = 0x108D,\n        KEY_KP_HOME           = 0x10B7,\n        KEY_KP_UP             = 0x10B8,\n        KEY_KP_PG_UP          = 0x10B9,\n        KEY_KP_LEFT           = 0x10B4,\n        KEY_KP_FIVE           = 0x10B5,\n        KEY_KP_RIGHT          = 0x10B6,\n        KEY_KP_END            = 0x10B1,\n        KEY_KP_DOWN           = 0x10B2,\n        KEY_KP_PG_DOWN        = 0x10B3,\n        KEY_KP_INSERT         = 0x10B0,\n        KEY_KP_DELETE         = 0x10AE,\n        KEY_F1                = 0x00BE,\n        KEY_F2                = 0x00BF,\n        KEY_F3                = 0x00C0,\n        KEY_F4                = 0x00C1,\n        KEY_F5                = 0x00C2,\n        KEY_F6                = 0x00C3,\n        KEY_F7                = 0x00C4,\n        KEY_F8                = 0x00C5,\n        KEY_F9                = 0x00C6,\n        KEY_F10               = 0x00C7,\n        KEY_F11               = 0x00C8,\n        KEY_F12               = 0x00C9,\n        KEY_SPACE             = ' ',\n        KEY_EXCLAM            = '!',\n        KEY_QUOTE             = '\"',\n        KEY_NUMBER            = '#',\n        KEY_DOLLAR            = '$',\n        KEY_PERCENT           = '%',\n        KEY_CIRCUMFLEX        = '^',\n        KEY_AMPERSAND         = '&',\n        KEY_APOSTROPHE        = '\\'',\n        KEY_LEFT_PARENTHESIS  = '(',\n        KEY_RIGHT_PARENTHESIS = ')',\n        KEY_ASTERISK          = '*',\n        KEY_PLUS              = '+',\n        KEY_COMMA             = ',',\n        KEY_MINUS             = '-',\n        KEY_PERIOD            = '.',\n        KEY_SLASH             = '/',\n        KEY_0                 = '0',\n        KEY_1                 = '1',\n        KEY_2                 = '2',\n        KEY_3                 = '3',\n        KEY_4                 = '4',\n        KEY_5                 = '5',\n        KEY_6                 = '6',\n        KEY_7                 = '7',\n        KEY_8                 = '8',\n        KEY_9                 = '9',\n        KEY_COLON             = ':',\n        KEY_SEMICOLON         = ';',\n        KEY_LESS_THAN         = '<',\n        KEY_EQUAL             = '=',\n        KEY_GREATER_THAN      = '>',\n        KEY_QUESTION          = '?',\n        KEY_AT                = '@',\n        KEY_CAPITAL_A         = 'A',\n        KEY_CAPITAL_B         = 'B',\n        KEY_CAPITAL_C         = 'C',\n        KEY_CAPITAL_D         = 'D',\n        KEY_CAPITAL_E         = 'E',\n        KEY_CAPITAL_F         = 'F',\n        KEY_CAPITAL_G         = 'G',\n        KEY_CAPITAL_H         = 'H',\n        KEY_CAPITAL_I         = 'I',\n        KEY_CAPITAL_J         = 'J',\n        KEY_CAPITAL_K         = 'K',\n        KEY_CAPITAL_L         = 'L',\n        KEY_CAPITAL_M         = 'M',\n        KEY_CAPITAL_N         = 'N',\n        KEY_CAPITAL_O         = 'O',\n        KEY_CAPITAL_P         = 'P',\n        KEY_CAPITAL_Q         = 'Q',\n        KEY_CAPITAL_R         = 'R',\n        KEY_CAPITAL_S         = 'S',\n        KEY_CAPITAL_T         = 'T',\n        KEY_CAPITAL_U         = 'U',\n        KEY_CAPITAL_V         = 'V',\n        KEY_CAPITAL_W         = 'W',\n        KEY_CAPITAL_X         = 'X',\n        KEY_CAPITAL_Y         = 'Y',\n        KEY_CAPITAL_Z         = 'Z',\n        KEY_LEFT_BRACKET      = '[',\n        KEY_BACK_SLASH        = '\\\\',\n        KEY_RIGHT_BRACKET     = ']',\n        KEY_UNDERSCORE        = '_',\n        KEY_GRAVE             = '`',\n        KEY_A                 = 'a',\n        KEY_B                 = 'b',\n        KEY_C                 = 'c',\n        KEY_D                 = 'd',\n        KEY_E                 = 'e',\n        KEY_F                 = 'f',\n        KEY_G                 = 'g',\n        KEY_H                 = 'h',\n        KEY_I                 = 'i',\n        KEY_J                 = 'j',\n        KEY_K                 = 'k',\n        KEY_L                 = 'l',\n        KEY_M                 = 'm',\n        KEY_N                 = 'n',\n        KEY_O                 = 'o',\n        KEY_P                 = 'p',\n        KEY_Q                 = 'q',\n        KEY_R                 = 'r',\n        KEY_S                 = 's',\n        KEY_T                 = 't',\n        KEY_U                 = 'u',\n        KEY_V                 = 'v',\n        KEY_W                 = 'w',\n        KEY_X                 = 'x',\n        KEY_Y                 = 'y',\n        KEY_Z                 = 'z',\n        KEY_LEFT_BRACE        = '{',\n        KEY_BAR               = '|',\n        KEY_RIGHT_BRACE       = '}',\n        KEY_TILDE             = '~',\n        KEY_EURO              = 0x20AC,\n        KEY_POUND             = 0x00A3,\n        KEY_YEN               = 0x00A5,\n        KEY_MIDDLE_DOT        = 0x0095,\n        KEY_SEARCH            = 0xFFAA\n    };\n    \n    EventKeyboard(KeyCode keyCode, bool isPressed);\n    \nprivate:\n    KeyCode _keyCode;\n    bool _isPressed;\n    \n    friend class EventListenerKeyboard;\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCKeyboardEvent__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListener.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEventListener.h\"\n#include \"platform/CCCommon.h\"\n\nNS_CC_BEGIN\n\nEventListener::EventListener()\n{}\n    \nEventListener::~EventListener() \n{\n\tCCLOGINFO(\"In the destructor of EventListener. %p\", this);\n}\n\nbool EventListener::init(Type t, ListenerID listenerID, std::function<void(Event*)> callback)\n{\n    _onEvent = callback;\n    _type = t;\n    _listenerID = listenerID;\n    _isRegistered = false;\n    _paused = true;\n    \n    return true;\n}\n\nbool EventListener::checkAvailable()\n{ \n\treturn (_onEvent != nullptr);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListener.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef cocos2d_libs_EventListener_h\n#define cocos2d_libs_EventListener_h\n\n#include \"CCPlatformMacros.h\"\n#include \"CCObject.h\"\n\n#include <functional>\n#include <string>\n#include <memory>\n#include <set>\n\nNS_CC_BEGIN\n\nclass Event;\nclass Node;\n\n/**\n *  The base class of event listener.\n *  If you need custom listener which with different callback, you need to inherit this class.\n *  For instance, you could refer to EventListenerAcceleration, EventListenerKeyboard, EventListenerTouchOneByOne, EventListenerCustom.\n */\nclass EventListener : public Object\n{\npublic:\n    enum class Type\n    {\n        UNKNOWN,\n        TOUCH_ONE_BY_ONE,\n        TOUCH_ALL_AT_ONCE,\n        KEYBOARD,\n        MOUSE,\n        ACCELERATION,\n        CUSTOM\n    };\n    \n    typedef std::string ListenerID;\n    \nprotected:\n    /** Constructor */\n    EventListener();\n    \n    /** Initializes event with type and callback function */\n    bool init(Type t, ListenerID listenerID, std::function<void(Event*)>callback);\npublic:\n    /** Destructor */\n    virtual ~EventListener();\n    \n    /** Checks whether the listener is available. */\n    virtual bool checkAvailable() = 0;\n    \n    /** Clones the listener, its subclasses have to override this method. */\n    virtual EventListener* clone() = 0;\n    \nprotected:\n    inline void setPaused(bool paused) { _paused = paused; };\n    inline bool isPaused() const { return _paused; };\n    \n    inline void setRegistered(bool registered) { _isRegistered = registered; };\n    inline bool isRegistered() const { return _isRegistered; };\n    \n    inline Type getType() const { return _type; };\n    inline const ListenerID& getListenerID() const { return _listenerID; };\n    \n    inline void setFixedPriority(int fixedPriority) { _fixedPriority = fixedPriority; };\n    inline int getFixedPriority() const { return _fixedPriority; };\n    \n    inline void setSceneGraphPriority(Node* node) { _node = node; };\n    inline Node* getSceneGraphPriority() const { return _node; };\n    \n    std::function<void(Event*)> _onEvent;   /// Event callback function\n    \n    Type _type;                             /// Event listener type\n    ListenerID _listenerID;                         /// Event listener ID\n    bool _isRegistered;                     /// Whether the listener has been added to dispatcher.\n    \n    // The priority of event listener\n    int   _fixedPriority;   // The higher the number, the higher the priority, 0 is for scene graph base priority.\n    Node* _node;            // scene graph based priority\n    bool _paused;           // Whether the listener is paused\n    \n    friend class EventDispatcher;\n};\n\nNS_CC_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerAcceleration.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEventListenerAcceleration.h\"\n#include \"CCEventAcceleration.h\"\n\nNS_CC_BEGIN\n\nconst std::string EventListenerAcceleration::LISTENER_ID = \"__cc_acceleration\";\n\nEventListenerAcceleration::EventListenerAcceleration()\n{\n\n}\n\nEventListenerAcceleration::~EventListenerAcceleration()\n{\n    CCLOGINFO(\"In the destructor of AccelerationEventListener. %p\", this);\n}\n\nEventListenerAcceleration* EventListenerAcceleration::create(std::function<void(Acceleration*, Event*)> callback)\n{\n    EventListenerAcceleration* ret = new EventListenerAcceleration();\n    if (ret && ret->init(callback))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    \n    return ret;\n}\n\nbool EventListenerAcceleration::init(std::function<void(Acceleration*, Event* event)> callback)\n{\n    auto listener = [this](Event* event){\n        auto accEvent = static_cast<EventAcceleration*>(event);\n        this->onAccelerationEvent(&accEvent->_acc, event);\n    };\n    \n    if (EventListener::init(Type::ACCELERATION, LISTENER_ID, listener))\n    {\n        onAccelerationEvent = callback;\n        return true;\n    }\n    \n    return false;\n}\n\nEventListenerAcceleration* EventListenerAcceleration::clone()\n{\n    auto ret = new EventListenerAcceleration();\n    \n    if (ret && ret->init(onAccelerationEvent))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    \n    return ret;\n}\n\nbool EventListenerAcceleration::checkAvailable()\n{\n    CCASSERT(onAccelerationEvent, \"\");\n    \n    return true;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerAcceleration.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCAccelerometerListener__\n#define __cocos2d_libs__CCAccelerometerListener__\n\n#include \"CCEventListener.h\"\n#include \"ccTypes.h\"\n\nNS_CC_BEGIN\n\nclass EventListenerAcceleration : public EventListener\n{\npublic:\n    static const std::string LISTENER_ID;\n    \n    static EventListenerAcceleration* create(std::function<void(Acceleration*, Event*)> callback);\n    virtual ~EventListenerAcceleration();\n    \n    /// Overrides\n    virtual EventListenerAcceleration* clone() override;\n    virtual bool checkAvailable() override;\nprivate:\n    EventListenerAcceleration();\n    \n    bool init(std::function<void(Acceleration*, Event* event)> callback);\n    std::function<void(Acceleration*, Event*)> onAccelerationEvent;\n    \n    friend class LuaEventListenerAcceleration;\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCAccelerometerListener__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerCustom.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEventListenerCustom.h\"\n#include \"CCEventCustom.h\"\n\nNS_CC_BEGIN\n\nEventListenerCustom::EventListenerCustom()\n: _onCustomEvent(nullptr)\n{\n}\n\nEventListenerCustom* EventListenerCustom::create(const std::string& eventName, std::function<void(EventCustom*)> callback)\n{\n    EventListenerCustom* ret = new EventListenerCustom();\n    if (ret && ret->init(eventName, callback))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool EventListenerCustom::init(ListenerID listenerId, std::function<void(EventCustom*)>callback)\n{\n    bool ret = false;\n    \n    _onCustomEvent = callback;\n    \n    auto listener = [this](Event* event){\n        if (_onCustomEvent != nullptr)\n        {\n            _onCustomEvent(static_cast<EventCustom*>(event));\n        }\n    };\n    \n    if (EventListener::init(EventListener::Type::CUSTOM, listenerId, listener))\n    {\n        ret = true;\n    }\n    return ret;\n}\n\nEventListenerCustom* EventListenerCustom::clone()\n{\n    EventListenerCustom* ret = new EventListenerCustom();\n    if (ret && ret->init(_listenerID, _onCustomEvent))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool EventListenerCustom::checkAvailable()\n{\n    bool ret = false;\n    if (EventListener::checkAvailable() && _onCustomEvent != nullptr)\n    {\n        ret = true;\n    }\n    return ret;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerCustom.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCCustomEventListener__\n#define __cocos2d_libs__CCCustomEventListener__\n\n#include \"CCEventListener.h\"\n\nNS_CC_BEGIN\n\nclass EventCustom;\n\n/**\n *  Usage:\n *        auto dispatcher = Director::getInstance()->getEventDispatcher();\n *     Adds a listener:\n *\n *        auto callback = [](EventCustom* event){ do_some_thing(); };\n *        auto listener = EventListenerCustom::create(callback);\n *        dispatcher->addEventListenerWithSceneGraphPriority(listener, one_node);\n *\n *     Dispatchs a custom event:\n *\n *        EventCustom event(\"your_event_type\");\n *        dispatcher->dispatchEvent(&event);\n *\n *     Removes a listener\n *\n *        dispatcher->removeEventListener(listener);\n */\nclass EventListenerCustom : public EventListener\n{\npublic:\n    /** Creates an event listener with type and callback.\n     *  @param eventType The type of the event.\n     *  @param callback The callback function when the specified event was emitted.\n     */\n    static EventListenerCustom* create(const std::string& eventName, std::function<void(EventCustom*)> callback);\n    \n    /// Overrides\n    virtual bool checkAvailable() override;\n    virtual EventListenerCustom* clone() override;\n    \nprotected:\n    /** Constructor */\n    EventListenerCustom();\n    \n    /** Initializes event with type and callback function */\n    bool init(ListenerID listenerId, std::function<void(EventCustom*)> callback);\n    \n    std::function<void(EventCustom*)> _onCustomEvent;\n    \n    friend class LuaEventListenerCustom;\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCCustomEventListener__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerKeyboard.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n ****************************************************************************/\n\n#include \"CCEventListenerKeyboard.h\"\n#include \"CCEventKeyboard.h\"\n#include \"ccMacros.h\"\n\nNS_CC_BEGIN\n\nconst std::string EventListenerKeyboard::LISTENER_ID = \"__cc_keyboard\";\n\nbool EventListenerKeyboard::checkAvailable()\n{\n    if (onKeyPressed == nullptr && onKeyReleased == nullptr)\n    {\n        CCASSERT(false, \"Invalid EventListenerKeyboard!\");\n        return false;\n    }\n    \n    return true;\n}\n\nEventListenerKeyboard* EventListenerKeyboard::create()\n{\n    auto ret = new EventListenerKeyboard();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nEventListenerKeyboard* EventListenerKeyboard::clone()\n{\n    auto ret = new EventListenerKeyboard();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n        ret->onKeyPressed = onKeyPressed;\n        ret->onKeyReleased = onKeyReleased;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nEventListenerKeyboard::EventListenerKeyboard()\n: onKeyPressed(nullptr)\n, onKeyReleased(nullptr)\n{\n}\n\nbool EventListenerKeyboard::init()\n{\n    auto listener = [this](Event* event){\n        auto keyboardEvent = static_cast<EventKeyboard*>(event);\n        if (keyboardEvent->_isPressed)\n        {\n            if (onKeyPressed != nullptr)\n                onKeyPressed(keyboardEvent->_keyCode, event);\n        }\n        else\n        {\n            if (onKeyReleased != nullptr)\n                onKeyReleased(keyboardEvent->_keyCode, event);\n        }\n    };\n    \n    if (EventListener::init(Type::KEYBOARD, LISTENER_ID, listener))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerKeyboard.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCKeyboardEventListener__\n#define __cocos2d_libs__CCKeyboardEventListener__\n\n#include \"CCEventListener.h\"\n#include \"CCEventKeyboard.h\"\n\nNS_CC_BEGIN\n\nclass Event;\n\nclass EventListenerKeyboard : public EventListener\n{\npublic:\n    static const std::string LISTENER_ID;\n    \n    static EventListenerKeyboard* create();\n    \n    /// Overrides\n    virtual EventListenerKeyboard* clone() override;\n    virtual bool checkAvailable() override;\n    \n    std::function<void(EventKeyboard::KeyCode, Event*)> onKeyPressed;\n    std::function<void(EventKeyboard::KeyCode, Event*)> onKeyReleased;\nprivate:\n    EventListenerKeyboard();\n    bool init();\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCKeyboardEventListener__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerMouse.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n ****************************************************************************/\n\n#include \"CCEventListenerMouse.h\"\n\nNS_CC_BEGIN\n\nconst std::string EventListenerMouse::LISTENER_ID = \"__cc_mouse\";\n\nbool EventListenerMouse::checkAvailable()\n{\n    return true;\n}\n\nEventListenerMouse* EventListenerMouse::create()\n{\n    auto ret = new EventListenerMouse();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nEventListenerMouse* EventListenerMouse::clone()\n{\n    auto ret = new EventListenerMouse();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n        ret->onMouseUp = onMouseUp;\n        ret->onMouseDown = onMouseDown;\n        ret->onMouseMove = onMouseMove;\n        ret->onMouseScroll = onMouseScroll;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nEventListenerMouse::EventListenerMouse()\n: onMouseDown(nullptr)\n, onMouseUp(nullptr)\n, onMouseMove(nullptr)\n, onMouseScroll(nullptr)\n{\n}\n\nbool EventListenerMouse::init()\n{\n    auto listener = [this](Event* event){\n        auto mouseEvent = static_cast<EventMouse*>(event);\n        switch (mouseEvent->_mouseEventType)\n        {\n            case EventMouse::MouseEventType::MOUSE_DOWN:\n                if(onMouseDown != nullptr)\n                    onMouseDown(event);\n                break;\n            case EventMouse::MouseEventType::MOUSE_UP:\n                if(onMouseUp != nullptr)\n                    onMouseUp(event);\n                break;\n            case EventMouse::MouseEventType::MOUSE_MOVE:\n                if(onMouseMove != nullptr)\n                    onMouseMove(event);\n                break;\n            case EventMouse::MouseEventType::MOUSE_SCROLL:\n                if(onMouseScroll != nullptr)\n                    onMouseScroll(event);\n                break;\n            default:\n                break;\n        }\n    };\n\n    if (EventListener::init(Type::MOUSE, LISTENER_ID, listener))\n    {\n        return true;\n    }\n\n    return false;\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerMouse.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n ****************************************************************************/\n\n#include \"CCEventListener.h\"\n#include \"CCEventMouse.h\"\n\n#ifndef __cocos2d_libs__CCMouseEventListener__\n#define __cocos2d_libs__CCMouseEventListener__\n\nNS_CC_BEGIN\n\nclass Event;\n\nclass EventListenerMouse : public EventListener\n{\npublic:\n    static const std::string LISTENER_ID;\n    \n    static EventListenerMouse* create();\n\n    /// Overrides\n    virtual EventListenerMouse* clone() override;\n    virtual bool checkAvailable() override;\n\n    std::function<void(Event* event)> onMouseDown;\n    std::function<void(Event* event)> onMouseUp;\n    std::function<void(Event* event)> onMouseMove;\n    std::function<void(Event* event)> onMouseScroll;\n\nprivate:\n    EventListenerMouse();\n    bool init();\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCMouseEventListener__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerTouch.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEventListenerTouch.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventTouch.h\"\n\n#include <algorithm>\n\nNS_CC_BEGIN\n\nconst std::string EventListenerTouchOneByOne::LISTENER_ID = \"__cc_touch_one_by_one\";\n\nEventListenerTouchOneByOne::EventListenerTouchOneByOne()\n: onTouchBegan(nullptr)\n, onTouchMoved(nullptr)\n, onTouchEnded(nullptr)\n, onTouchCancelled(nullptr)\n, _needSwallow(false)\n{\n}\n\nEventListenerTouchOneByOne::~EventListenerTouchOneByOne()\n{\n    CCLOGINFO(\"In the destructor of EventListenerTouchOneByOne, %p\", this);\n}\n\nbool EventListenerTouchOneByOne::init()\n{\n    if (EventListener::init(Type::TOUCH_ONE_BY_ONE, LISTENER_ID, nullptr))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nvoid EventListenerTouchOneByOne::setSwallowTouches(bool needSwallow)\n{\n    _needSwallow = needSwallow;\n}\n\nEventListenerTouchOneByOne* EventListenerTouchOneByOne::create()\n{\n    auto ret = new EventListenerTouchOneByOne();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool EventListenerTouchOneByOne::checkAvailable()\n{\n    if (onTouchBegan == nullptr)\n    {\n        CCASSERT(false, \"Invalid EventListenerTouchOneByOne!\");\n        return false;\n    }\n    \n    return true;\n}\n\nEventListenerTouchOneByOne* EventListenerTouchOneByOne::clone()\n{\n    auto ret = new EventListenerTouchOneByOne();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n        \n        ret->onTouchBegan = onTouchBegan;\n        ret->onTouchMoved = onTouchMoved;\n        ret->onTouchEnded = onTouchEnded;\n        ret->onTouchCancelled = onTouchCancelled;\n        \n        ret->_claimedTouches = _claimedTouches;\n        ret->_needSwallow = _needSwallow;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\n/////////\n\nconst std::string EventListenerTouchAllAtOnce::LISTENER_ID = \"__cc_touch_all_at_once\";\n\nEventListenerTouchAllAtOnce::EventListenerTouchAllAtOnce()\n: onTouchesBegan(nullptr)\n, onTouchesMoved(nullptr)\n, onTouchesEnded(nullptr)\n, onTouchesCancelled(nullptr)\n{\n}\n\nEventListenerTouchAllAtOnce::~EventListenerTouchAllAtOnce()\n{\n    CCLOGINFO(\"In the destructor of EventListenerTouchAllAtOnce, %p\", this);\n}\n\nbool EventListenerTouchAllAtOnce::init()\n{\n    if (EventListener::init(Type::TOUCH_ALL_AT_ONCE, LISTENER_ID, nullptr))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nEventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::create()\n{\n    auto ret = new EventListenerTouchAllAtOnce();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool EventListenerTouchAllAtOnce::checkAvailable()\n{\n    if (onTouchesBegan == nullptr && onTouchesMoved == nullptr\n        && onTouchesEnded == nullptr && onTouchesCancelled == nullptr)\n    {\n        CCASSERT(false, \"Invalid EventListenerTouchAllAtOnce!\");\n        return false;\n    }\n    \n    return true;\n}\n\nEventListenerTouchAllAtOnce* EventListenerTouchAllAtOnce::clone()\n{\n    auto ret = new EventListenerTouchAllAtOnce();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n        \n        ret->onTouchesBegan = onTouchesBegan;\n        ret->onTouchesMoved = onTouchesMoved;\n        ret->onTouchesEnded = onTouchesEnded;\n        ret->onTouchesCancelled = onTouchesCancelled;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventListenerTouch.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCTouchEventListener__\n#define __cocos2d_libs__CCTouchEventListener__\n\n#include \"CCEventListener.h\"\n#include \"CCTouch.h\"\n\n#include <vector>\n\nNS_CC_BEGIN\n\nclass EventListenerTouchOneByOne : public EventListener\n{\npublic:\n    static const std::string LISTENER_ID;\n    \n    static EventListenerTouchOneByOne* create();\n    \n    virtual ~EventListenerTouchOneByOne();\n    \n    void setSwallowTouches(bool needSwallow);\n    \n    /// Overrides\n    virtual EventListenerTouchOneByOne* clone() override;\n    virtual bool checkAvailable() override;\n    //\n\npublic:\n    std::function<bool(Touch*, Event*)> onTouchBegan;\n    std::function<void(Touch*, Event*)> onTouchMoved;\n    std::function<void(Touch*, Event*)> onTouchEnded;\n    std::function<void(Touch*, Event*)> onTouchCancelled;\n    \nprivate:\n    EventListenerTouchOneByOne();\n    bool init();\n    \n    std::vector<Touch*> _claimedTouches;\n    bool _needSwallow;\n    \n    friend class EventDispatcher;\n};\n\n\nclass EventListenerTouchAllAtOnce : public EventListener\n{\npublic:\n    static const std::string LISTENER_ID;\n    \n    static EventListenerTouchAllAtOnce* create();\n    virtual ~EventListenerTouchAllAtOnce();\n    \n    /// Overrides\n    virtual EventListenerTouchAllAtOnce* clone() override;\n    virtual bool checkAvailable() override;\n    //\npublic:\n    std::function<void(const std::vector<Touch*>&, Event*)> onTouchesBegan;\n    std::function<void(const std::vector<Touch*>&, Event*)> onTouchesMoved;\n    std::function<void(const std::vector<Touch*>&, Event*)> onTouchesEnded;\n    std::function<void(const std::vector<Touch*>&, Event*)> onTouchesCancelled;\n    \nprivate:\n    EventListenerTouchAllAtOnce();\n    bool init();\nprivate:\n    \n    friend class EventDispatcher;\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCTouchEventListener__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventMouse.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n ****************************************************************************/\n\n#include \"CCEventMouse.h\"\n\nNS_CC_BEGIN\n\nEventMouse::EventMouse(MouseEventType mouseEventCode)\n: Event(Type::MOUSE)\n, _mouseEventType(mouseEventCode)\n, _mouseButton(0)\n, _x(0.0f)\n, _y(0.0f)\n, _scrollX(0.0f)\n, _scrollY(0.0f)\n{\n};\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventMouse.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCMouseEvent__\n#define __cocos2d_libs__CCMouseEvent__\n\n#include \"CCEvent.h\"\n\n#define MOUSE_BUTTON_LEFT       0\n#define MOUSE_BUTTON_RIGHT      1\n#define MOUSE_BUTTON_MIDDLE     2\n#define MOUSE_BUTTON_4          3\n#define MOUSE_BUTTON_5          4\n#define MOUSE_BUTTON_6          5\n#define MOUSE_BUTTON_7          6\n#define MOUSE_BUTTON_8          7\n\nNS_CC_BEGIN\n\nclass EventMouse : public Event\n{\npublic:\n    /**\n    * Different types of MouseEvent\n    */\n    enum class MouseEventType\n    {\n        MOUSE_NONE,\n        MOUSE_DOWN,\n        MOUSE_UP,\n        MOUSE_MOVE,\n        MOUSE_SCROLL,\n    };\n\n    EventMouse(MouseEventType mouseEventCode);\n\n    /** Set mouse scroll data */\n    inline void setScrollData(float scrollX, float scrollY) { _scrollX = scrollX; _scrollY = scrollY; };\n    inline float getScrollX() { return _scrollX; };\n    inline float getScrollY() { return _scrollY; };\n\n    inline void setCursorPosition(float x, float y) { _x = x; _y = y; };\n    inline void setMouseButton(int button) { _mouseButton = button; };\n    inline int getMouseButton() { return _mouseButton; };\n    inline float getCursorX() { return _x; };\n    inline float getCursorY() { return _y; };\n\nprivate:\n    MouseEventType _mouseEventType;\n    int _mouseButton;\n    float _x;\n    float _y;\n    float _scrollX;\n    float _scrollY;\n\n    friend class EventListenerMouse;\n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCMouseEvent__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventTouch.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEventTouch.h\"\n\nNS_CC_BEGIN\n\nEventTouch::EventTouch()\n: Event(Type::TOUCH)\n{\n    _touches.reserve(MAX_TOUCHES);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventTouch.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __cocos2d_libs__TouchEvent__\n#define __cocos2d_libs__TouchEvent__\n\n#include \"CCEvent.h\"\n#include \"CCTouch.h\"\n#include <vector>\n\nNS_CC_BEGIN\n\n#define TOUCH_PERF_DEBUG 1\n\nclass EventTouch : public Event\n{\npublic:\n    static const int MAX_TOUCHES = 5;\n    \n    enum class EventCode\n    {\n        BEGAN,\n        MOVED,\n        ENDED,\n        CANCELLED\n    };\n\n    EventTouch();\n\n    EventCode getEventCode() { return _eventCode; };\n    std::vector<Touch*> getTouches() { return _touches; };\n\n#if TOUCH_PERF_DEBUG\n    void setEventCode(EventCode eventCode) { _eventCode = eventCode; };\n    void setTouches(const std::vector<Touch*>& touches) { _touches = touches; };\n#endif\n    \nprivate:\n    EventCode _eventCode;\n    std::vector<Touch*> _touches;\n\n    friend class EGLViewProtocol;\n};\n\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__TouchEvent__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCEventType.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEVENT_TYPE_H__\n#define __CCEVENT_TYPE_H__\n\n/**\n * This header is used for defining event types using in NotificationCenter\n */\n\n// The application will come to foreground.\n// This message is used for reloading resources before come to foreground on Android.\n// This message is posted in main.cpp.\n#define EVENT_COME_TO_FOREGROUND    \"event_come_to_foreground\"\n\n// The application will come to background.\n// This message is used for doing something before coming to background, such as save RenderTexture.\n// This message is posted in cocos2dx/platform/android/jni/MessageJni.cpp.\n#define EVENT_COME_TO_BACKGROUND    \"event_come_to_background\"\n\n#endif // __CCEVENT_TYPE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFont.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCFont.h\"\n#include \"ccUTF8.h\"\n\nNS_CC_BEGIN\n\nconst char * Font::_glyphASCII = \"\\\"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ \";\n\nconst char * Font::_glyphNEHE =  \"!\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ \";\n\n\nFont::Font() : \n_usedGlyphs(GlyphCollection::ASCII)\n, _customGlyphs(nullptr)\n{\n}\n\nconst char * Font::getGlyphCollection(GlyphCollection glyphs) const\n{\n    switch (glyphs)\n    {\n        case GlyphCollection::NEHE:\n            return _glyphNEHE;\n            break;\n            \n        case GlyphCollection::ASCII:\n            return _glyphASCII;\n            break;\n            \n        default:\n            return 0;\n            break;\n    }\n}\n\nvoid Font::setCurrentGlyphCollection(GlyphCollection glyphs, const char *customGlyphs)\n{\n    if (_customGlyphs)\n        delete [] _customGlyphs;\n    \n    switch (glyphs)\n    {\n        case GlyphCollection::NEHE:\n            _customGlyphs = 0;\n            break;\n            \n        case GlyphCollection::ASCII:\n            _customGlyphs = 0;\n            break;\n            \n        default:\n            if (customGlyphs)\n            {\n                size_t lenght = strlen(customGlyphs);\n                _customGlyphs = new char [lenght + 2];\n                memcpy(_customGlyphs, customGlyphs, lenght);\n\n                _customGlyphs[lenght]   = 0;\n                _customGlyphs[lenght+1] = 0;\n            }           \n            \n            break;\n    }\n    _usedGlyphs = glyphs;\n}\n\nconst char * Font::getCurrentGlyphCollection() const\n{\n    if (_customGlyphs)\n    {\n        return _customGlyphs;\n    }\n    else\n    {\n        return getGlyphCollection(_usedGlyphs);\n    }\n}\n\nunsigned short* Font::getUTF16Text(const char *text, int &outNumLetters) const\n{\n    unsigned short* utf16String = cc_utf8_to_utf16(text);\n    \n    if(!utf16String)\n        return 0;\n    \n    outNumLetters = cc_wcslen(utf16String);\n    return utf16String;\n}\n\nint Font::getUTF16TextLenght(unsigned short int *text) const\n{\n     return cc_wcslen(text);\n}\n\nunsigned short * Font::trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const\n{\n    if ( newBegin < 0 || newEnd <= 0 )\n        return 0;\n    \n    if ( newBegin >= newEnd )\n        return 0;\n    \n    if (newEnd >= cc_wcslen(text))\n        return 0;\n    \n    int newLenght = newEnd - newBegin + 2;\n    unsigned short* trimmedString = new unsigned short[newLenght];\n    \n    for(int c = 0; c < (newLenght - 1); ++c)\n    {\n        trimmedString[c] = text[newBegin + c];\n    }\n    \n    // last char\n    trimmedString[newLenght-1] = 0x0000;\n    \n    // done\n    return trimmedString;\n}\n\nNS_CC_END\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFont.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _CCFont_h_\n#define _CCFont_h_\n\n#include <string>\n\n#include \"CCLabel.h\"\n\nNS_CC_BEGIN\n\n// fwd\nclass FontAtlas;\n\n\nclass CC_DLL Font : public Object\n{\npublic:\n    virtual  FontAtlas *createFontAtlas() = 0;\n\n    virtual int* getHorizontalKerningForTextUTF16(unsigned short *text, int &outNumLetters) const = 0;\n    virtual const char* getCurrentGlyphCollection() const;\n    \n    virtual unsigned char * getGlyphBitmap(unsigned short theChar, int &outWidth, int &outHeight) const { return 0; }\n    \n    virtual int getFontMaxHeight() const { return 0; }\n    \n    virtual int getUTF16TextLenght(unsigned short int *text) const;\n    virtual unsigned short * getUTF16Text(const char *text, int &outNumLetters) const;\n    virtual unsigned short * trimUTF16Text(unsigned short int *text, int newBegin, int newEnd) const;\n    \nprotected:\n    \n    Font();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Font() {}\n    void setCurrentGlyphCollection(GlyphCollection glyphs, const char *customGlyphs = 0);\n    const char * getGlyphCollection(GlyphCollection glyphs) const;\n    \n\n    GlyphCollection     _usedGlyphs;\n    char              * _customGlyphs;\n    static const char * _glyphASCII;\n    static const char * _glyphNEHE;\n\n};\n\nNS_CC_END\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontAtlas.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCFontAtlas.h\"\n#include \"CCFontFreeType.h\"\n#include \"ccUTF8.h\"\n#include \"CCDirector.h\"\n\n#define  PAGE_WIDTH 1024\n#define  PAGE_HEIGHT 1024\n\nNS_CC_BEGIN\n\nFontAtlas::FontAtlas(Font &theFont) : \n_font(&theFont),\n_currentPageData(nullptr)\n{\n    _font->retain();\n\n    FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);\n    if (fontTTf)\n    {\n        _currentPageLineHeight = _font->getFontMaxHeight();\n        _commonLineHeight = _currentPageLineHeight * 0.8f;\n        Texture2D * tex = new Texture2D;\n        _currentPage = 0;\n        _currentPageOrigX = 0;\n        _currentPageOrigY = 0;\n        _letterPadding = 0;\n\n        _makeDistanceMap = fontTTf->isDistanceFieldEnabled();\n        if(_makeDistanceMap)\n        {\n            _commonLineHeight += 2 * FontFreeType::DistanceMapSpread;\n            _letterPadding += 2 * FontFreeType::DistanceMapSpread;    \n        }\n        _currentPageDataSize = (PAGE_WIDTH * PAGE_HEIGHT * 1);\n\n        _currentPageData = new unsigned char[_currentPageDataSize];       \n        memset(_currentPageData, 0, _currentPageDataSize);  \n        addTexture(*tex,0);\n        tex->release();\n    }\n    else\n    {\n        _makeDistanceMap = false;\n    }\n}\n\nFontAtlas::~FontAtlas()\n{\n    _font->release();\n    relaseTextures();\n\n    delete []_currentPageData;\n}\n\nvoid FontAtlas::relaseTextures()\n{\n    for( auto &item: _atlasTextures)\n    {\n        item.second->release();\n    }\n}\n\nvoid FontAtlas::addLetterDefinition(const FontLetterDefinition &letterDefinition)\n{\n    _fontLetterDefinitions[letterDefinition.letteCharUTF16] = letterDefinition;\n}\n\nbool FontAtlas::getLetterDefinitionForChar(unsigned short  letteCharUTF16, FontLetterDefinition &outDefinition)\n{\n    auto outIterator = _fontLetterDefinitions.find(letteCharUTF16);\n    \n    if (outIterator != _fontLetterDefinitions.end())\n    {\n        outDefinition = (*outIterator).second;\n        return true;\n    }\n    else\n    {\n        outDefinition.validDefinition = false;\n        return false;\n    }\n}\n\nbool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String)\n{\n    if(_currentPageData == nullptr)\n        return false;\n\n    FontFreeType* fontTTf = (FontFreeType*)_font;\n\n    std::unordered_map<unsigned short, FontLetterDefinition> fontDefs;\n    int length = cc_wcslen(utf16String);\n\n    float offsetAdjust = _letterPadding / 2;\n    //find out new letter\n    for (int i = 0; i < length; ++i)\n    {\n        auto outIterator = _fontLetterDefinitions.find(utf16String[i]);\n        \n        if (outIterator == _fontLetterDefinitions.end())\n        {  \n            auto outIterator2 = fontDefs.find(utf16String[i]);\n            if(outIterator2 != fontDefs.end())\n                continue;\n\n            Rect tempRect;           \n\n            FontLetterDefinition tempDef;\n\n            if (!fontTTf->getBBOXFotChar(utf16String[i], tempRect,tempDef.xAdvance))\n            {\n                tempDef.validDefinition = false;\n                tempDef.letteCharUTF16   = utf16String[i];\n                tempDef.width            = 0;\n                tempDef.height           = 0;\n                tempDef.U                = 0;\n                tempDef.V                = 0;\n                tempDef.offsetX          = 0;\n                tempDef.offsetY          = 0;\n                tempDef.textureID        = 0;\n                tempDef.xAdvance         = 0;\n            }\n            else\n            {\n                tempDef.validDefinition = true;\n                tempDef.letteCharUTF16   = utf16String[i];\n                tempDef.width            = tempRect.size.width + _letterPadding;\n                tempDef.height           = tempRect.size.height + _letterPadding;\n                tempDef.offsetX          = tempRect.origin.x + offsetAdjust;\n                tempDef.offsetY          = _commonLineHeight + tempRect.origin.y - offsetAdjust;\n            } \n            fontDefs[utf16String[i]] = tempDef;\n        }       \n    }\n\n    Size _pageContentSize = Size(PAGE_WIDTH,PAGE_HEIGHT);\n    float scaleFactor = CC_CONTENT_SCALE_FACTOR();\n    float glyphWidth;\n    Texture2D::PixelFormat  pixelFormat = Texture2D::PixelFormat::A8;\n    \n\n    for(auto it = fontDefs.begin(); it != fontDefs.end(); it++)\n    {\n        if(it->second.validDefinition)\n        {\n            glyphWidth = it->second.width;\n\n            if (_currentPageOrigX + glyphWidth > PAGE_WIDTH)\n            {\n                _currentPageOrigY += _currentPageLineHeight;\n                _currentPageOrigX = 0;\n                if(_currentPageOrigY >= PAGE_HEIGHT)\n                {             \n                    _atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize, pixelFormat, PAGE_WIDTH, PAGE_HEIGHT, _pageContentSize );\n                    _currentPageOrigY = 0;\n\n                    delete []_currentPageData;\n                    _currentPageData = new unsigned char[_currentPageDataSize];\n                    if(_currentPageData == nullptr)\n                        return false;\n                    memset(_currentPageData, 0, _currentPageDataSize);\n                    _currentPage++;\n                    Texture2D* tex = new Texture2D;\n                    addTexture(*tex,_currentPage);\n                    tex->release();\n                }\n            }\n            fontTTf->renderCharAt(it->second.letteCharUTF16,_currentPageOrigX,_currentPageOrigY,_currentPageData,PAGE_WIDTH);\n\n            it->second.U                = _currentPageOrigX;\n            it->second.V                = _currentPageOrigY;\n            it->second.textureID        = _currentPage;\n            // take from pixels to points\n            it->second.width  =    it->second.width  / scaleFactor;\n            it->second.height =    it->second.height / scaleFactor;      \n            it->second.U      =    it->second.U      / scaleFactor;\n            it->second.V      =    it->second.V      / scaleFactor;\n        }\n        else\n            glyphWidth = 0;       \n       \n        _fontLetterDefinitions[it->second.letteCharUTF16] = it->second;\n        _currentPageOrigX += glyphWidth + 1;\n    }\n    if(fontDefs.size() > 0)\n        _atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize, pixelFormat, PAGE_WIDTH, PAGE_HEIGHT, _pageContentSize );\n    return true;\n}\n\nvoid FontAtlas::addTexture(Texture2D &texture, int slot)\n{\n    texture.retain();\n    _atlasTextures[slot] = &texture;\n}\n\nTexture2D & FontAtlas::getTexture(int slot)\n{\n    return *(_atlasTextures[slot]);\n}\n\nfloat FontAtlas::getCommonLineHeight() const\n{\n    return _commonLineHeight;\n}\n\nvoid  FontAtlas::setCommonLineHeight(float newHeight)\n{\n    _commonLineHeight = newHeight;\n}\n\nconst Font * FontAtlas::getFont() const\n{\n    return _font;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontAtlas.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef _CCFontAtlas_h_\n#define _CCFontAtlas_h_\n\n#include <unordered_map>\n#include \"CCPlatformMacros.h\"\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\n//fwd\nclass Font;\nclass Texture2D;\n\nstruct FontLetterDefinition\n{\n    unsigned short  letteCharUTF16;\n    float U;\n    float V;\n    float width;\n    float height;\n    float offsetX;\n    float offsetY;\n    int textureID;\n    bool validDefinition;\n    int xAdvance;\n};\n\nclass CC_DLL FontAtlas : public Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    FontAtlas(Font &theFont);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~FontAtlas();\n    \n    void addLetterDefinition(const FontLetterDefinition &letterDefinition);\n    bool getLetterDefinitionForChar(unsigned short  letteCharUTF16, FontLetterDefinition &outDefinition);\n    \n    bool prepareLetterDefinitions(unsigned short  *utf16String);\n\n    void  addTexture(Texture2D &texture, int slot);\n    float getCommonLineHeight() const;\n    void  setCommonLineHeight(float newHeight);\n    \n    Texture2D& getTexture(int slot);\n    const Font* getFont() const;\n    \nprivate:\n\n    void relaseTextures();\n    std::unordered_map<int, Texture2D*> _atlasTextures;\n    std::unordered_map<unsigned short, FontLetterDefinition> _fontLetterDefinitions;\n    float _commonLineHeight;\n    Font * _font;\n\n    // Dynamic GlyphCollection related stuff\n    int _currentPage;\n    unsigned char *_currentPageData;\n    int _currentPageDataSize;\n    float _currentPageOrigX;\n    float _currentPageOrigY;\n    float _currentPageLineHeight;\n    float _letterPadding;\n    bool  _makeDistanceMap;\n};\n\n\nNS_CC_END\n\n\n#endif /* defined(__cocos2d_libs__CCFontAtlas__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontAtlasCache.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include <sstream>\n\n#include \"CCFontAtlasCache.h\"\n\n#include \"CCFontFNT.h\"\n#include \"CCFontFreeType.h\"\n#include \"CCFontCharMap.h\"\n\nNS_CC_BEGIN\n\nstd::unordered_map<std::string, FontAtlas *> FontAtlasCache::_atlasMap;\n\nFontAtlas * FontAtlasCache::getFontAtlasTTF(const std::string& fontFileName, int size, GlyphCollection glyphs, const char *customGlyphs, bool useDistanceField)\n{\n    std::string atlasName = generateFontName(fontFileName, size, glyphs, useDistanceField);\n    FontAtlas  *tempAtlas = _atlasMap[atlasName];\n    \n    if ( !tempAtlas )\n    {\n        FontFreeType *font = FontFreeType::create(fontFileName, size, glyphs, customGlyphs);\n        if (font)\n        {\n            font->setDistanceFieldEnabled(useDistanceField);\n            tempAtlas = font->createFontAtlas();\n            if (tempAtlas)\n                _atlasMap[atlasName] = tempAtlas;\n        }\n        else\n        {\n            return nullptr;\n        }\n    }\n    else\n    {\n        tempAtlas->retain();\n    }\n\n    return tempAtlas;\n}\n\nFontAtlas * FontAtlasCache::getFontAtlasFNT(const std::string& fontFileName)\n{\n    std::string atlasName = generateFontName(fontFileName, 0, GlyphCollection::CUSTOM,false);\n    FontAtlas *tempAtlas = _atlasMap[atlasName];\n    \n    if ( !tempAtlas )\n    {\n        Font *font = FontFNT::create(fontFileName);\n\n        if(font)\n        {\n            tempAtlas = font->createFontAtlas();\n            if (tempAtlas)\n                _atlasMap[atlasName] = tempAtlas;\n        }\n        else\n        {\n            return nullptr;\n        }\n    }\n    else\n    {\n        tempAtlas->retain();\n    }\n    \n    return tempAtlas;\n}\n\nFontAtlas * FontAtlasCache::getFontAtlasCharMap(const std::string& plistFile)\n{\n    std::string atlasName = generateFontName(plistFile, 0, GlyphCollection::CUSTOM,false);\n    FontAtlas *tempAtlas = _atlasMap[atlasName];\n\n    if ( !tempAtlas )\n    {\n        Font *font = FontCharMap::create(plistFile);\n\n        if(font)\n        {\n            tempAtlas = font->createFontAtlas();\n            if (tempAtlas)\n                _atlasMap[atlasName] = tempAtlas;\n        }\n        else\n        {\n            return nullptr;\n        }\n    }\n    else\n    {\n        tempAtlas->retain();\n    }\n\n    return tempAtlas;\n}\n\nFontAtlas * FontAtlasCache::getFontAtlasCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap)\n{\n    char tmp[30];\n    sprintf(tmp,\"name:%u_%d_%d_%d\",texture->getName(),itemWidth,itemHeight,startCharMap);\n    std::string atlasName = generateFontName(tmp, 0, GlyphCollection::CUSTOM,false);\n    FontAtlas *tempAtlas = _atlasMap[atlasName];\n\n    if ( !tempAtlas )\n    {\n        Font *font = FontCharMap::create(texture,itemWidth,itemHeight,startCharMap);\n\n        if(font)\n        {\n            tempAtlas = font->createFontAtlas();\n            if (tempAtlas)\n                _atlasMap[atlasName] = tempAtlas;\n        }\n        else\n        {\n            return nullptr;\n        }\n    }\n    else\n    {\n        tempAtlas->retain();\n    }\n\n    return tempAtlas;\n}\n\nFontAtlas * FontAtlasCache::getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)\n{\n    std::string atlasName = generateFontName(charMapFile, 0, GlyphCollection::CUSTOM,false);\n    FontAtlas *tempAtlas = _atlasMap[atlasName];\n\n    if ( !tempAtlas )\n    {\n        Font *font = FontCharMap::create(charMapFile,itemWidth,itemHeight,startCharMap);\n\n        if(font)\n        {\n            tempAtlas = font->createFontAtlas();\n            if (tempAtlas)\n                _atlasMap[atlasName] = tempAtlas;\n        }\n        else\n        {\n            return nullptr;\n        }\n    }\n    else\n    {\n        tempAtlas->retain();\n    }\n\n    return tempAtlas;\n}\n\nstd::string FontAtlasCache::generateFontName(const std::string& fontFileName, int size, GlyphCollection theGlyphs, bool useDistanceField)\n{\n    std::string tempName(fontFileName);\n    \n    switch (theGlyphs)\n    {\n        case GlyphCollection::DYNAMIC:\n            tempName.append(\"_DYNAMIC_\");\n        break;\n            \n        case GlyphCollection::NEHE:\n            tempName.append(\"_NEHE_\");\n            break;\n            \n        case GlyphCollection::ASCII:\n            tempName.append(\"_ASCII_\");\n            break;\n            \n        case GlyphCollection::CUSTOM:\n            tempName.append(\"_CUSTOM_\");\n            break;\n            \n        default:\n            break;\n    }\n    if(useDistanceField)\n        tempName.append(\"df\");\n    // std::to_string is not supported on android, using std::stringstream instead.\n    std::stringstream ss;\n    ss << size;\n    return  tempName.append(ss.str());\n}\n\nbool FontAtlasCache::releaseFontAtlas(FontAtlas *atlas)\n{\n    if (nullptr != atlas)\n    {\n        for( auto &item: _atlasMap )\n        {\n            if ( item.second == atlas )\n            {\n                if (atlas->getReferenceCount() == 1)\n                {\n                  _atlasMap.erase(item.first);\n                }\n                \n                atlas->release();\n                \n                return true;\n            }\n        }\n    }\n    \n    return false;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontAtlasCache.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _CCFontAtlasCache_h_\n#define _CCFontAtlasCache_h_\n\n#include <iostream>\n#include <unordered_map>\n\n#include \"CCFontAtlas.h\"\n#include \"CCLabel.h\"\n\nNS_CC_BEGIN\n\nclass CC_DLL FontAtlasCache\n{  \npublic:\n    static FontAtlas * getFontAtlasTTF(const std::string& fontFileName, int size, GlyphCollection glyphs, const char *customGlyphs = 0, bool useDistanceField = false);\n    static FontAtlas * getFontAtlasFNT(const std::string& fontFileName);\n\n    static FontAtlas * getFontAtlasCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap);\n    static FontAtlas * getFontAtlasCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap);\n    static FontAtlas * getFontAtlasCharMap(const std::string& plistFile);\n    \n    static bool releaseFontAtlas(FontAtlas *atlas);\n    \nprivate: \n    static std::string generateFontName(const std::string& fontFileName, int size, GlyphCollection theGlyphs, bool useDistanceField);\n    static std::unordered_map<std::string, FontAtlas *> _atlasMap;\n};\n\nNS_CC_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontCharMap.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCFontCharMap.h\"\n#include \"CCFontAtlas.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCDirector.h\"\n#include \"CCTextureCache.h\"\n#include \"ccUTF8.h\"\n\nNS_CC_BEGIN\n\nFontCharMap * FontCharMap::create(const std::string& plistFile)\n{\n    std::string pathStr = FileUtils::getInstance()->fullPathForFilename(plistFile);\n    std::string relPathStr = pathStr.substr(0, pathStr.find_last_of(\"/\"))+\"/\";\n\n    ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(pathStr.c_str());\n\n    CCASSERT(dict[\"version\"].asInt() == 1, \"Unsupported version. Upgrade cocos2d version\");\n\n    std::string textureFilename = relPathStr + dict[\"textureFilename\"].asString();\n\n    unsigned int width = dict[\"itemWidth\"].asInt() / CC_CONTENT_SCALE_FACTOR();\n    unsigned int height = dict[\"itemHeight\"].asInt() / CC_CONTENT_SCALE_FACTOR();\n    unsigned int startChar = dict[\"firstChar\"].asInt();\n\n    Texture2D *tempTexture = Director::getInstance()->getTextureCache()->addImage(textureFilename);\n    if (!tempTexture)\n    {\n        return nullptr;\n    }\n    \n    FontCharMap *tempFont =  new FontCharMap(tempTexture,width,height,startChar);\n    \n    if (!tempFont)\n    {\n        return nullptr;\n    }\n    tempFont->autorelease();\n    return tempFont;\n}\n\nFontCharMap* FontCharMap::create(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)\n{\n    Texture2D *tempTexture = Director::getInstance()->getTextureCache()->addImage(charMapFile);\n\n    if (!tempTexture)\n    {\n        return nullptr;\n    }\n\n    FontCharMap *tempFont =  new FontCharMap(tempTexture,itemWidth,itemHeight,startCharMap);\n\n    if (!tempFont)\n    {\n        return nullptr;\n    }\n    tempFont->autorelease();\n    return tempFont;\n}\n\nFontCharMap* FontCharMap::create(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap)\n{\n    FontCharMap *tempFont =  new FontCharMap(texture,itemWidth,itemHeight,startCharMap);\n\n    if (!tempFont)\n    {\n        return nullptr;\n    }\n    tempFont->autorelease();\n    return tempFont;\n}\n\nFontCharMap::~FontCharMap()\n{\n\n}\n\nint * FontCharMap::getHorizontalKerningForTextUTF16(unsigned short *text, int &outNumLetters) const\n{\n    if (!text)\n        return 0;\n    \n    outNumLetters = cc_wcslen(text);\n    \n    if (!outNumLetters)\n        return 0;\n    \n    int *sizes = new int[outNumLetters];\n    if (!sizes)\n        return 0;\n    \n    for (int c = 0; c < outNumLetters; ++c)\n    {\n        sizes[c] = 0;\n    }\n    \n    return sizes;\n}\n\nFontAtlas * FontCharMap::createFontAtlas()\n{\n    FontAtlas *tempAtlas = new FontAtlas(*this);\n    if (!tempAtlas)\n        return nullptr;\n    \n    Size s = _texture->getContentSize();\n\n    int itemsPerColumn = (int)(s.height / _itemHeight);\n    int itemsPerRow = (int)(s.width / _itemWidth);\n\n    tempAtlas->setCommonLineHeight(_itemHeight);\n    \n    FontLetterDefinition tempDefinition;\n    tempDefinition.textureID = 0;\n    tempDefinition.offsetX  = 0.0f;\n    tempDefinition.offsetY  = 0.0f;\n    tempDefinition.validDefinition = true;\n    tempDefinition.width    = _itemWidth;\n    tempDefinition.height   = _itemHeight;\n    tempDefinition.xAdvance = _itemWidth * CC_CONTENT_SCALE_FACTOR();\n\n    int charId = _mapStartChar;\n    for (int row = 0; row < itemsPerColumn; ++row)\n    {\n        for (int col = 0; col < itemsPerRow; ++col)\n        {\n            tempDefinition.letteCharUTF16 = charId;\n\n            tempDefinition.U        = _itemWidth * col;\n            tempDefinition.V        = _itemHeight * row;           \n\n            tempAtlas->addLetterDefinition(tempDefinition);\n            charId++;\n        }\n    }\n    \n    tempAtlas->addTexture(*_texture,0);\n\n    return tempAtlas;\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontCharMap.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _CCFontCharMap_h_\n#define _CCFontCharMap_h_\n\n#include \"CCFont.h\"\n\nNS_CC_BEGIN\n\nclass FontCharMap : public Font\n{  \npublic:\n    static FontCharMap * create(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap);\n    static FontCharMap * create(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap);\n    static FontCharMap * create(const std::string& plistFile);\n    \n    virtual int* getHorizontalKerningForTextUTF16(unsigned short *text, int &outNumLetters) const override;\n    virtual FontAtlas *createFontAtlas() override;\n    \nprotected:    \n    FontCharMap(Texture2D* texture,int itemWidth, int itemHeight, int startCharMap)\n        :_texture(texture)\n        ,_mapStartChar(startCharMap)\n        ,_itemWidth(itemWidth)\n        ,_itemHeight(itemHeight)\n    {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~FontCharMap();\n    \nprivate:\n    Texture2D* _texture;\n    int _mapStartChar;\n    int _itemWidth;\n    int _itemHeight;\n\n};\n\nNS_CC_END\n\n#endif /* defined(_CCFontCharMap_h_) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontFNT.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCFontFNT.h\"\n#include \"CCFontAtlas.h\"\n#include \"CCLabelBMFont.h\"\n#include \"CCDirector.h\"\n#include \"CCTextureCache.h\"\n#include \"ccUTF8.h\"\n\nNS_CC_BEGIN\n\nFontFNT * FontFNT::create(const std::string& fntFilePath)\n{\n    CCBMFontConfiguration *newConf = FNTConfigLoadFile(fntFilePath);\n    if (!newConf)\n        return nullptr;\n    \n    // add the texture\n    Texture2D *tempTexture = Director::getInstance()->getTextureCache()->addImage(newConf->getAtlasName());\n    if (!tempTexture)\n    {\n        delete newConf;\n        return nullptr;\n    }\n    \n    FontFNT *tempFont =  new FontFNT(newConf);\n    \n    if (!tempFont)\n    {\n        delete newConf;\n        return nullptr;\n    }\n    tempFont->autorelease();\n    return tempFont;\n}\n\nFontFNT::~FontFNT()\n{\n\n}\n\nint * FontFNT::getHorizontalKerningForTextUTF16(unsigned short *text, int &outNumLetters) const\n{\n    if (!text)\n        return 0;\n    \n    outNumLetters = cc_wcslen(text);\n    \n    if (!outNumLetters)\n        return 0;\n    \n    int *sizes = new int[outNumLetters];\n    if (!sizes)\n        return 0;\n    \n    for (int c = 0; c < outNumLetters; ++c)\n    {\n        if (c < (outNumLetters-1))\n            sizes[c] = getHorizontalKerningForChars(text[c], text[c+1]);\n        else\n            sizes[c] = 0;\n    }\n    \n    return sizes;\n}\n\nint  FontFNT::getHorizontalKerningForChars(unsigned short firstChar, unsigned short secondChar) const\n{\n    int ret = 0;\n    unsigned int key = (firstChar << 16) | (secondChar & 0xffff);\n    \n    if (_configuration->_kerningDictionary)\n    {\n        tKerningHashElement *element = nullptr;\n        HASH_FIND_INT(_configuration->_kerningDictionary, &key, element);\n        \n        if (element)\n            ret = element->amount;\n    }\n    \n    return ret;\n}\n\nFontAtlas * FontFNT::createFontAtlas()\n{\n    FontAtlas *tempAtlas = new FontAtlas(*this);\n    if (!tempAtlas)\n        return nullptr;\n    \n    // check that everything is fine with the BMFontCofniguration\n    if (!_configuration->_fontDefDictionary)\n        return nullptr;\n    \n    size_t numGlyphs = _configuration->_characterSet->size();\n    if (!numGlyphs)\n        return nullptr;\n    \n    if (_configuration->_commonHeight == 0)\n        return nullptr;\n    \n    // commone height\n    tempAtlas->setCommonLineHeight(_configuration->_commonHeight);\n    \n    \n    ccBMFontDef fontDef;\n    tFontDefHashElement *currentElement, *tmp;\n    \n    // Purge uniform hash\n    HASH_ITER(hh, _configuration->_fontDefDictionary, currentElement, tmp)\n    {\n        \n        FontLetterDefinition tempDefinition;\n        \n        fontDef = currentElement->fontDef;\n        Rect tempRect;\n        \n        tempRect = fontDef.rect;\n        tempRect = CC_RECT_PIXELS_TO_POINTS(tempRect);\n        \n        tempDefinition.letteCharUTF16 = fontDef.charID;\n        \n        tempDefinition.offsetX  = fontDef.xOffset;\n        tempDefinition.offsetY  = fontDef.yOffset;\n        \n        tempDefinition.U        = tempRect.origin.x;\n        tempDefinition.V        = tempRect.origin.y;\n        \n        tempDefinition.width    = tempRect.size.width;\n        tempDefinition.height   = tempRect.size.height;\n        \n        //carloX: only one texture supported FOR NOW\n        tempDefinition.textureID = 0;\n        \n        tempDefinition.validDefinition = true;\n        tempDefinition.xAdvance = fontDef.xAdvance;\n        // add the new definition\n        tempAtlas->addLetterDefinition(tempDefinition);\n    }\n    \n    // add the texture (only one texture for now)\n    \n    Texture2D *tempTexture = Director::getInstance()->getTextureCache()->addImage(_configuration->getAtlasName());\n    if (!tempTexture)\n        return 0;\n    \n    // add the texture\n    tempAtlas->addTexture(*tempTexture, 0);\n    \n    // done\n    return tempAtlas;\n}\n\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontFNT.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _CCFontFNT_h_\n#define _CCFontFNT_h_\n\n#include \"CCFont.h\"\n\nNS_CC_BEGIN\n\nclass CCBMFontConfiguration;\n\nclass FontFNT : public Font\n{\n    \npublic:\n    \n    static FontFNT * create(const std::string& fntFilePath);\n    \n    virtual int* getHorizontalKerningForTextUTF16(unsigned short *text, int &outNumLetters) const override;\n    virtual FontAtlas *createFontAtlas() override;\n    \nprotected:\n    \n    FontFNT(CCBMFontConfiguration *theContfig) :\n        _configuration(theContfig) {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~FontFNT();\n    \nprivate:\n    \n    int  getHorizontalKerningForChars(unsigned short firstChar, unsigned short secondChar) const;\n    \n    CCBMFontConfiguration * _configuration;\n    \n};\n\nNS_CC_END\n\n#endif /* defined(__cocos2d_libs__CCFontFNT__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontFreeType.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include <stdio.h>\n#include <algorithm>\n\n#include \"ccUTF8.h\"\n#include \"CCFontFreeType.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"edtaa3func.h\"\n\nNS_CC_BEGIN\n\n\nFT_Library FontFreeType::_FTlibrary;\nbool       FontFreeType::_FTInitialized = false;\nconst int  FontFreeType::DistanceMapSpread = 3;\n\nFontFreeType * FontFreeType::create(const std::string &fontName, int fontSize, GlyphCollection glyphs, const char *customGlyphs)\n{\n    FontFreeType *tempFont =  new FontFreeType();\n\n    if (!tempFont)\n        return nullptr;\n    \n    tempFont->setCurrentGlyphCollection(glyphs, customGlyphs);\n    \n    if (!tempFont->createFontObject(fontName, fontSize))\n    {\n        delete tempFont;\n        return nullptr;\n    }\n    return tempFont;\n}\n\nbool FontFreeType::initFreeType()\n{\n    if (_FTInitialized == false)\n    {\n        // begin freetype\n        if (FT_Init_FreeType( &_FTlibrary ))\n            return false;\n        \n        _FTInitialized = true;\n    }\n    \n    return  _FTInitialized;\n}\n\nvoid FontFreeType::shutdownFreeType()\n{\n    if (_FTInitialized == true)\n    {\n        FT_Done_FreeType(_FTlibrary);\n        _FTInitialized = false;\n    }\n}\n\nFT_Library FontFreeType::getFTLibrary()\n{\n    initFreeType();\n    return _FTlibrary;\n}\n\nFontFreeType::FontFreeType()\n: _fontRef(nullptr)\n,_distanceFieldEnabled(false)\n{\n}\n\nbool FontFreeType::createFontObject(const std::string &fontName, int fontSize)\n{\n    FT_Face face;\n\n    _ttfData = FileUtils::getInstance()->getDataFromFile(fontName);\n    \n    if (_ttfData.isNull())\n        return false;\n\n    // create the face from the data\n    if (FT_New_Memory_Face(getFTLibrary(), _ttfData.getBytes(), _ttfData.getSize(), 0, &face ))\n        return false;\n\n    //we want to use unicode\n    if (FT_Select_Charmap(face, FT_ENCODING_UNICODE))\n        return false;\n\n    // set the requested font size\n    int dpi = 72;\n    int fontSizePoints = (int)(64.f * fontSize);\n    if (FT_Set_Char_Size(face, fontSizePoints, fontSizePoints, dpi, dpi))\n        return false;\n    \n    // store the face globally\n    _fontRef = face;\n    \n    // save font name locally\n    _fontName = fontName;\n    \n    // done and good\n    return true;\n}\n\nFontFreeType::~FontFreeType()\n{\n    if (_fontRef)\n    {\n        FT_Done_Face(_fontRef);\n    }\n}\n\nFontAtlas * FontFreeType::createFontAtlas()\n{\n    FontAtlas *atlas = new FontAtlas(*this);\n    if (_usedGlyphs != GlyphCollection::DYNAMIC)\n    {\n        unsigned short* utf16 = cc_utf8_to_utf16(getCurrentGlyphCollection());\n        atlas->prepareLetterDefinitions(utf16);\n        CC_SAFE_DELETE_ARRAY(utf16);\n    }\n    this->release();\n    return atlas;\n}\n\nbool FontFreeType::getBBOXFotChar(unsigned short theChar, Rect &outRect, int &xAdvance) const\n{\n    if (!_fontRef)\n        return false;\n    \n    // get the ID to the char we need\n    int glyph_index = FT_Get_Char_Index(_fontRef, theChar);\n    \n    if (!glyph_index)\n        return false;\n    \n    // load glyph infos\n    if (FT_Load_Glyph(_fontRef, glyph_index, FT_LOAD_DEFAULT))\n        return false;\n    \n    // store result in the passed rectangle\n    outRect.origin.x    = _fontRef->glyph->metrics.horiBearingX >> 6;\n    outRect.origin.y    = - (_fontRef->glyph->metrics.horiBearingY >> 6);\n    outRect.size.width  =   (_fontRef->glyph->metrics.width  >> 6);\n    outRect.size.height =   (_fontRef->glyph->metrics.height >> 6);\n    \n    xAdvance = (static_cast<int>(_fontRef->glyph->metrics.horiAdvance >> 6));\n\n    return true;\n}\n\nint * FontFreeType::getHorizontalKerningForTextUTF16(unsigned short *text, int &outNumLetters) const\n{\n    if (!text)\n        return 0;\n    \n    outNumLetters = cc_wcslen(text);\n\n    if (!outNumLetters)\n        return 0;\n    \n    int *sizes = new int[outNumLetters];\n    if (!sizes)\n        return 0;\n    \n    for (int c = 0; c < outNumLetters; ++c)\n    {\n        if (c < (outNumLetters-1))\n            sizes[c] = getHorizontalKerningForChars(text[c], text[c+1]);\n        else\n            sizes[c] = 0;\n    }\n    \n    return sizes;\n}\n\nint  FontFreeType::getHorizontalKerningForChars(unsigned short firstChar, unsigned short secondChar) const\n{\n    if (!_fontRef)\n        return 0;\n\n    bool hasKerning = FT_HAS_KERNING( _fontRef ) != 0;\n    \n    if (!hasKerning)\n        return 0;\n    \n    // get the ID to the char we need\n    int glyphIndex1 = FT_Get_Char_Index(_fontRef, firstChar);\n    \n    if (!glyphIndex1)\n        return 0;\n    \n    // get the ID to the char we need\n    int glyphIndex2 = FT_Get_Char_Index(_fontRef, secondChar);\n    \n    if (!glyphIndex2)\n        return 0;\n    \n    FT_Vector kerning;\n    \n    if (FT_Get_Kerning( _fontRef, glyphIndex1, glyphIndex2,  FT_KERNING_DEFAULT,  &kerning))\n        return 0;\n    \n    return (static_cast<int>(kerning.x >> 6));\n}\n\nint FontFreeType::getFontMaxHeight() const\n{\n    return (static_cast<int>(_fontRef->size->metrics.height >> 6));\n}\n\nunsigned char * FontFreeType::getGlyphBitmap(unsigned short theChar, int &outWidth, int &outHeight) const\n{\n    if (!_fontRef)\n        return 0;\n    \n    if (_distanceFieldEnabled)\n    {    \n        if (FT_Load_Char(_fontRef,theChar,FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT))\n            return 0;\n    }\n    else\n    {\n        if (FT_Load_Char(_fontRef,theChar,FT_LOAD_RENDER))\n            return 0;\n    }\n    \n    outWidth  = _fontRef->glyph->bitmap.width;\n    outHeight = _fontRef->glyph->bitmap.rows;\n    \n    // return the pointer to the bitmap\n    return _fontRef->glyph->bitmap.buffer;\n}\n\nunsigned char * makeDistanceMap( unsigned char *img, unsigned int width, unsigned int height)\n{\n    unsigned int pixelAmount = (width + 2 * FontFreeType::DistanceMapSpread) * (height + 2 * FontFreeType::DistanceMapSpread);\n\n    short * xdist = (short *)  malloc( pixelAmount * sizeof(short) );\n    short * ydist = (short *)  malloc( pixelAmount * sizeof(short) );\n    double * gx   = (double *) calloc( pixelAmount, sizeof(double) );\n    double * gy      = (double *) calloc( pixelAmount, sizeof(double) );\n    double * data    = (double *) calloc( pixelAmount, sizeof(double) );\n    double * outside = (double *) calloc( pixelAmount, sizeof(double) );\n    double * inside  = (double *) calloc( pixelAmount, sizeof(double) );\n    unsigned int i,j;\n\n    // Convert img into double (data) rescale image levels between 0 and 1\n    unsigned int outWidth = width + 2 * FontFreeType::DistanceMapSpread;\n    for (i = 0; i < width; ++i)\n    {\n        for (j = 0; j < height; ++j)\n        {\n            data[j * outWidth + FontFreeType::DistanceMapSpread + i] = img[j * width + i] / 255.0;\n        }\n    }\n\n    width += 2 * FontFreeType::DistanceMapSpread;\n    height += 2 * FontFreeType::DistanceMapSpread;\n\n    // Transform background (outside contour, in areas of 0's)   \n    computegradient( data, width, height, gx, gy);\n    edtaa3(data, gx, gy, width, height, xdist, ydist, outside);\n    for( i=0; i< pixelAmount; i++)\n        if( outside[i] < 0.0 )\n            outside[i] = 0.0;\n\n    // Transform foreground (inside contour, in areas of 1's)   \n    for( i=0; i< pixelAmount; i++)\n        data[i] = 1 - data[i];\n    computegradient( data, width, height, gx, gy);\n    edtaa3(data, gx, gy, width, height, xdist, ydist, inside);\n    for( i=0; i< pixelAmount; i++)\n        if( inside[i] < 0.0 )\n            inside[i] = 0.0;\n\n    // The bipolar distance field is now outside-inside\n    double dist;\n    /* Single channel 8-bit output (bad precision and range, but simple) */    \n    unsigned char *out = (unsigned char *) malloc( pixelAmount * sizeof(unsigned char) );\n    for( i=0; i < pixelAmount; i++)\n    {\n        dist = outside[i] - inside[i];\n        dist = 128.0 - dist*16;\n        if( dist < 0 ) dist = 0;\n        if( dist > 255 ) dist = 255;\n        out[i] = (unsigned char) dist;\n    }\n    /* Dual channel 16-bit output (more complicated, but good precision and range) */\n    /*unsigned char *out = (unsigned char *) malloc( pixelAmount * 3 * sizeof(unsigned char) ); \n    for( i=0; i< pixelAmount; i++)\n    {\n        dist = outside[i] - inside[i];\n        dist = 128.0 - dist*16;\n        if( dist < 0.0 ) dist = 0.0;\n        if( dist >= 256.0 ) dist = 255.999;\n        // R channel is a copy of the original grayscale image\n        out[3*i] = img[i];\n        // G channel is fraction\n        out[3*i + 1] = (unsigned char) ( 256 - (dist - floor(dist)* 256.0 ));\n        // B channel is truncated integer part\n        out[3*i + 2] = (unsigned char)dist; \n    }*/\n    \n    free( xdist );\n    free( ydist );\n    free( gx );\n    free( gy );\n    free( data );\n    free( outside );\n    free( inside );\n\n    return out;\n}\n\nvoid FontFreeType::setDistanceFieldEnabled(bool distanceFieldEnabled)\n{\n    _distanceFieldEnabled = distanceFieldEnabled;\n}\n\nbool FontFreeType::renderCharAt(unsigned short int charToRender, int posX, int posY, unsigned char *destMemory, int destSize)\n{\n    unsigned char *sourceBitmap = 0;\n    int sourceWidth  = 0;\n    int sourceHeight = 0;\n\n    sourceBitmap = getGlyphBitmap(charToRender, sourceWidth, sourceHeight);\n\n    if (!sourceBitmap)\n        return false;\n\n    if (_distanceFieldEnabled)\n    {\n        unsigned char * out = makeDistanceMap(sourceBitmap,sourceWidth,sourceHeight);\n\n        int iX = posX;\n        int iY = posY;\n\n        sourceWidth += 2 * DistanceMapSpread;\n        sourceHeight += 2 * DistanceMapSpread;\n\n        for (int y = 0; y < sourceHeight; ++y)\n        {\n            int bitmap_y = y * sourceWidth;\n\n            for (int x = 0; x < sourceWidth; ++x)\n            {    \n                /* Dual channel 16-bit output (more complicated, but good precision and range) */\n                /*int index = (iX + ( iY * destSize )) * 3;                \n                int index2 = (bitmap_y + x)*3;\n                destMemory[index] = out[index2];\n                destMemory[index + 1] = out[index2 + 1];\n                destMemory[index + 2] = out[index2 + 2];*/\n\n                //Single channel 8-bit output \n                destMemory[iX + ( iY * destSize )] = out[bitmap_y + x];\n\n                iX += 1;\n            }\n\n            iX  = posX;\n            iY += 1;\n        }\n        free(out);        \n        return true;\n    }\n\n    int iX = posX;\n    int iY = posY;\n\n    for (int y = 0; y < sourceHeight; ++y)\n    {\n        int bitmap_y = y * sourceWidth;\n\n        for (int x = 0; x < sourceWidth; ++x)\n        {\n            unsigned char cTemp = sourceBitmap[bitmap_y + x];\n\n            // the final pixel\n            destMemory[(iX + ( iY * destSize ) )] = cTemp;\n\n            iX += 1;\n        }\n\n        iX  = posX;\n        iY += 1;\n    }\n\n    //everything good\n    return true;\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCFontFreeType.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _FontFreetype_h_\n#define _FontFreetype_h_\n\n#include \"CCFont.h\"\n#include \"CCData.h\"\n\n#include <string>\n#include <ft2build.h>\n\n#include FT_FREETYPE_H\n\nNS_CC_BEGIN\n\nclass CC_DLL FontFreeType : public Font\n{\npublic:\n    static const int DistanceMapSpread;\n\n    static FontFreeType * create(const std::string &fontName, int fontSize, GlyphCollection glyphs, const char *customGlyphs);\n\n    static void shutdownFreeType();\n\n    void     setDistanceFieldEnabled(bool distanceFieldEnabled);\n    bool     isDistanceFieldEnabled() const { return _distanceFieldEnabled;}\n    bool     renderCharAt(unsigned short int charToRender, int posX, int posY, unsigned char *destMemory, int destSize); \n\n    virtual FontAtlas   * createFontAtlas() override;\n    virtual int         * getHorizontalKerningForTextUTF16(unsigned short *text, int &outNumLetters) const override;\n    \n    unsigned char       * getGlyphBitmap(unsigned short theChar, int &outWidth, int &outHeight) const override;\n    virtual int           getFontMaxHeight() const override;\n    \n    bool getBBOXFotChar(unsigned short theChar, Rect &outRect,int &xAdvance) const; \n\nprotected:\n    \n    FontFreeType();\n    virtual ~FontFreeType();\n    bool   createFontObject(const std::string &fontName, int fontSize);\n    \nprivate:\n\n    bool initFreeType();\n    FT_Library getFTLibrary();\n    \n    int  getHorizontalKerningForChars(unsigned short firstChar, unsigned short secondChar) const;\n    \n    static FT_Library _FTlibrary;\n    static bool       _FTInitialized;\n    FT_Face           _fontRef;\n    std::string       _fontName;\n    Data              _ttfData;\n    bool              _distanceFieldEnabled;\n};\n\nNS_CC_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGLBufferedNode.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCGLBufferedNode.h\"\n\nGLBufferedNode::GLBufferedNode()\n{\n    for(int i = 0; i < BUFFER_SLOTS; i++)\n    {\n        _bufferObject[i] = 0;\n        _bufferSize[i] = 0;\n        _indexBufferObject[i] = 0;\n        _indexBufferSize[i] = 0;\n    }\n}\n\nGLBufferedNode::~GLBufferedNode()\n{\n    for(int i = 0; i < BUFFER_SLOTS; i++)\n    {\n        if(_bufferSize[i])\n        {\n            glDeleteBuffers(1, &(_bufferObject[i]));\n        }\n        if(_indexBufferSize[i])\n        {\n            glDeleteBuffers(1, &(_indexBufferObject[i]));\n        }\n    }\n}\n\nvoid GLBufferedNode::setGLBufferData(void *buf, GLuint bufSize, int slot)\n{\n    // WebGL doesn't support client-side arrays, so generate a buffer and load the data first.\n    if(_bufferSize[slot] < bufSize)\n    {\n        if(_bufferObject[slot])\n        {\n            glDeleteBuffers(1, &(_bufferObject[slot]));\n        }\n        glGenBuffers(1, &(_bufferObject[slot]));\n        _bufferSize[slot] = bufSize;\n\n        glBindBuffer(GL_ARRAY_BUFFER, _bufferObject[slot]);\n        glBufferData(GL_ARRAY_BUFFER, bufSize, buf, GL_DYNAMIC_DRAW);\n    }\n    else\n    {\n        glBindBuffer(GL_ARRAY_BUFFER, _bufferObject[slot]);\n        glBufferSubData(GL_ARRAY_BUFFER, 0, bufSize, buf);\n    }\n}\n\nvoid GLBufferedNode::setGLIndexData(void *buf, GLuint bufSize, int slot)\n{\n    // WebGL doesn't support client-side arrays, so generate a buffer and load the data first.\n    if(_indexBufferSize[slot] < bufSize)\n    {\n        if(_indexBufferObject[slot])\n        {\n            glDeleteBuffers(1, &(_indexBufferObject[slot]));\n        }\n        glGenBuffers(1, &(_indexBufferObject[slot]));\n        _indexBufferSize[slot] = bufSize;\n\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBufferObject[slot]);\n        glBufferData(GL_ELEMENT_ARRAY_BUFFER, bufSize, buf, GL_DYNAMIC_DRAW);\n    }\n    else\n    {\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBufferObject[slot]);\n        glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, bufSize, buf);\n    }\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGLBufferedNode.h",
    "content": "/****************************************************************************\nCopyright (c) 2013      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_GL_BUFFERED_NODE__\n#define __CC_GL_BUFFERED_NODE__\n\n#include \"CCGL.h\"\n\nclass GLBufferedNode\n{\npublic:\n    /**\n     * @js ctor\n     */\n    GLBufferedNode();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~GLBufferedNode();\n\n    /**\n     * Load the given data into this Node's GL Buffer. Needed for WebGL, as it does not support client-side arrays.\n     */\n    void setGLBufferData(void *buf, GLuint bufSize, int slot);\n    void setGLIndexData(void *buf, GLuint bufSize, int slot);\n\n    // We allocate 4 buffer objs per node, and index into them as slots.\n#define BUFFER_SLOTS 4\n    GLuint _bufferObject[BUFFER_SLOTS];\n    GLuint _bufferSize[BUFFER_SLOTS];\n\n    GLuint _indexBufferObject[BUFFER_SLOTS];\n    GLuint _indexBufferSize[BUFFER_SLOTS];\n};\n#endif // __CC_GL_BUFFERED_NODE__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGLProgram.cpp",
    "content": "/****************************************************************************\nCopyright 2011 Jeff Lamarche\nCopyright 2012 Goffredo Marocchi\nCopyright 2012 Ricardo Quesada\nCopyright 2012 cocos2d-x.org\nCopyright 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n \nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN false EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCDirector.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"ccMacros.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"uthash.h\"\n#include \"CCString.h\"\n// extern\n#include \"kazmath/GL/matrix.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\ntypedef struct _hashUniformEntry\n{\n    GLvoid*         value;       // value\n    unsigned int    location;    // Key\n    UT_hash_handle  hh;          // hash entry\n} tHashUniformEntry;\n\nconst char* GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR = \"ShaderPositionTextureColor\";\nconst char* GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP = \"ShaderPositionTextureColor_noMVP\";\nconst char* GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST = \"ShaderPositionTextureColorAlphaTest\";\nconst char* GLProgram::SHADER_NAME_POSITION_COLOR = \"ShaderPositionColor\";\nconst char* GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP = \"ShaderPositionColor_noMVP\";\nconst char* GLProgram::SHADER_NAME_POSITION_TEXTURE = \"ShaderPositionTexture\";\nconst char* GLProgram::SHADER_NAME_POSITION_TEXTURE_U_COLOR = \"ShaderPositionTexture_uColor\";\nconst char* GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR = \"ShaderPositionTextureA8Color\";\nconst char* GLProgram::SHADER_NAME_POSITION_U_COLOR = \"ShaderPosition_uColor\";\nconst char* GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR = \"ShaderPositionLengthTextureColor\";\n\nconst char* GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL = \"ShaderLabelNormol\";\nconst char* GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW = \"ShaderLabelGlow\";\nconst char* GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_OUTLINE = \"ShaderLabelOutline\";\nconst char* GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_SHADOW = \"ShaderLabelShadow\";\n\n\n// uniform names\nconst char* GLProgram::UNIFORM_NAME_P_MATRIX = \"CC_PMatrix\";\nconst char* GLProgram::UNIFORM_NAME_MV_MATRIX = \"CC_MVMatrix\";\nconst char* GLProgram::UNIFORM_NAME_MVP_MATRIX  = \"CC_MVPMatrix\";\nconst char* GLProgram::UNIFORM_NAME_TIME = \"CC_Time\";\nconst char* GLProgram::UNIFORM_NAME_SIN_TIME = \"CC_SinTime\";\nconst char* GLProgram::UNIFORM_NAME_COS_TIME = \"CC_CosTime\";\nconst char* GLProgram::UNIFORM_NAME_RANDOM01 = \"CC_Random01\";\nconst char* GLProgram::UNIFORM_NAME_SAMPLER\t= \"CC_Texture0\";\nconst char* GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE = \"CC_alpha_value\";\n\n// Attribute names\nconst char* GLProgram::ATTRIBUTE_NAME_COLOR = \"a_color\";\nconst char* GLProgram::ATTRIBUTE_NAME_POSITION = \"a_position\";\nconst char* GLProgram::ATTRIBUTE_NAME_TEX_COORD = \"a_texCoord\";\n\nGLProgram::GLProgram()\n: _program(0)\n, _vertShader(0)\n, _fragShader(0)\n, _hashForUniforms(nullptr)\n, _flags()\n{\n    memset(_uniforms, 0, sizeof(_uniforms));\n}\n\nGLProgram::~GLProgram()\n{\n    CCLOGINFO(\"%s %d deallocing GLProgram: %p\", __FUNCTION__, __LINE__, this);\n\n    // there is no need to delete the shaders. They should have been already deleted.\n    CCASSERT(_vertShader == 0, \"Vertex Shaders should have been already deleted\");\n    CCASSERT(_fragShader == 0, \"Fragment Shaders should have been already deleted\");\n\n    if (_program) \n    {\n        GL::deleteProgram(_program);\n    }\n\n    tHashUniformEntry *current_element, *tmp;\n\n    // Purge uniform hash\n    HASH_ITER(hh, _hashForUniforms, current_element, tmp)\n    {\n        HASH_DEL(_hashForUniforms, current_element);\n        free(current_element->value);\n        free(current_element);\n    }\n}\n\nbool GLProgram::initWithVertexShaderByteArray(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray)\n{\n    _program = glCreateProgram();\n    CHECK_GL_ERROR_DEBUG();\n\n    _vertShader = _fragShader = 0;\n\n    if (vShaderByteArray)\n    {\n        if (!compileShader(&_vertShader, GL_VERTEX_SHADER, vShaderByteArray))\n        {\n            CCLOG(\"cocos2d: ERROR: Failed to compile vertex shader\");\n        }\n    }\n\n    // Create and compile fragment shader\n    if (fShaderByteArray)\n    {\n        if (!compileShader(&_fragShader, GL_FRAGMENT_SHADER, fShaderByteArray))\n        {\n            CCLOG(\"cocos2d: ERROR: Failed to compile fragment shader\");\n        }\n    }\n\n    if (_vertShader)\n    {\n        glAttachShader(_program, _vertShader);\n    }\n    CHECK_GL_ERROR_DEBUG();\n\n    if (_fragShader)\n    {\n        glAttachShader(_program, _fragShader);\n    }\n    _hashForUniforms = nullptr;\n    \n    CHECK_GL_ERROR_DEBUG();\n\n    return true;\n}\n\nbool GLProgram::initWithVertexShaderFilename(const char* vShaderFilename, const char* fShaderFilename)\n{\n    std::string vertexSource = FileUtils::getInstance()->getStringFromFile(FileUtils::getInstance()->fullPathForFilename(vShaderFilename).c_str());\n    std::string fragmentSource = FileUtils::getInstance()->getStringFromFile(FileUtils::getInstance()->fullPathForFilename(fShaderFilename).c_str());\n\n    return initWithVertexShaderByteArray(vertexSource.c_str(), fragmentSource.c_str());\n}\n\nstd::string GLProgram::getDescription() const\n{\n    return StringUtils::format(\"<GLProgram = \"\n                                      CC_FORMAT_PRINTF_SIZE_T\n                                      \" | Program = %i, VertexShader = %i, FragmentShader = %i>\",\n                                      (size_t)this, _program, _vertShader, _fragShader);\n}\n\nbool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source)\n{\n    GLint status;\n \n    if (!source)\n    {\n        return false;\n    }\n    \n    const GLchar *sources[] = {\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)\n        (type == GL_VERTEX_SHADER ? \"precision highp float;\\n\" : \"precision mediump float;\\n\"),\n#endif\n        \"uniform mat4 CC_PMatrix;\\n\"\n        \"uniform mat4 CC_MVMatrix;\\n\"\n        \"uniform mat4 CC_MVPMatrix;\\n\"\n        \"uniform vec4 CC_Time;\\n\"\n        \"uniform vec4 CC_SinTime;\\n\"\n        \"uniform vec4 CC_CosTime;\\n\"\n        \"uniform vec4 CC_Random01;\\n\"\n        \"//CC INCLUDES END\\n\\n\",\n        source,\n    };\n\n    *shader = glCreateShader(type);\n    glShaderSource(*shader, sizeof(sources)/sizeof(*sources), sources, nullptr);\n    glCompileShader(*shader);\n\n    glGetShaderiv(*shader, GL_COMPILE_STATUS, &status);\n\n    if (! status)\n    {\n        GLsizei length;\n\t\tglGetShaderiv(*shader, GL_SHADER_SOURCE_LENGTH, &length);\n\t\tGLchar* src = (GLchar *)malloc(sizeof(GLchar) * length);\n\t\t\n\t\tglGetShaderSource(*shader, length, nullptr, src);\n\t\tCCLOG(\"cocos2d: ERROR: Failed to compile shader:\\n%s\", src);\n        \n        if (type == GL_VERTEX_SHADER)\n        {\n            CCLOG(\"cocos2d: %s\", getVertexShaderLog().c_str());\n        }\n        else\n        {\n            CCLOG(\"cocos2d: %s\", getFragmentShaderLog().c_str());\n        }\n        free(src);\n\n        abort();\n    }\n    return (status == GL_TRUE);\n}\n\nvoid GLProgram::addAttribute(const char* attributeName, GLuint index)\n{\n    glBindAttribLocation(_program, index, attributeName);\n}\n\nvoid GLProgram::updateUniforms()\n{\n    _uniforms[UNIFORM_P_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_P_MATRIX);\n\t_uniforms[UNIFORM_MV_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_MV_MATRIX);\n\t_uniforms[UNIFORM_MVP_MATRIX] = glGetUniformLocation(_program, UNIFORM_NAME_MVP_MATRIX);\n\t\n\t_uniforms[UNIFORM_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_TIME);\n\t_uniforms[UNIFORM_SIN_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_SIN_TIME);\n\t_uniforms[UNIFORM_COS_TIME] = glGetUniformLocation(_program, UNIFORM_NAME_COS_TIME);\n\n    _uniforms[UNIFORM_RANDOM01] = glGetUniformLocation(_program, UNIFORM_NAME_RANDOM01);\n\n    _uniforms[UNIFORM_SAMPLER] = glGetUniformLocation(_program, UNIFORM_NAME_SAMPLER);\n\n    _flags.usesP = _uniforms[UNIFORM_P_MATRIX] != -1;\n\t_flags.usesMV = _uniforms[UNIFORM_MV_MATRIX] != -1;\n    _flags.usesMVP = _uniforms[UNIFORM_MVP_MATRIX] != -1;\n\t_flags.usesTime = (\n                       _uniforms[UNIFORM_TIME] != -1 ||\n                       _uniforms[UNIFORM_SIN_TIME] != -1 ||\n                       _uniforms[UNIFORM_COS_TIME] != -1\n                       );\n\t_flags.usesRandom = _uniforms[UNIFORM_RANDOM01] != -1;\n\n    this->use();\n    \n    // Since sample most probably won't change, set it to 0 now.\n    this->setUniformLocationWith1i(_uniforms[UNIFORM_SAMPLER], 0);\n}\n\nbool GLProgram::link()\n{\n    CCASSERT(_program != 0, \"Cannot link invalid program\");\n    \n    GLint status = GL_TRUE;\n    \n    glLinkProgram(_program);\n\n    if (_vertShader)\n    {\n        glDeleteShader(_vertShader);\n    }\n    \n    if (_fragShader)\n    {\n        glDeleteShader(_fragShader);\n    }\n    \n    _vertShader = _fragShader = 0;\n\t\n#if COCOS2D_DEBUG\n    glGetProgramiv(_program, GL_LINK_STATUS, &status);\n\t\n    if (status == GL_FALSE)\n    {\n        CCLOG(\"cocos2d: ERROR: Failed to link program: %i\", _program);\n        GL::deleteProgram(_program);\n        _program = 0;\n    }\n#endif\n\t\n    return (status == GL_TRUE);\n}\n\nvoid GLProgram::use()\n{\n    GL::useProgram(_program);\n}\n\nstd::string GLProgram::logForOpenGLObject(GLuint object, GLInfoFunction infoFunc, GLLogFunction logFunc) const\n{\n    std::string ret;\n    GLint logLength = 0, charsWritten = 0;\n\n    infoFunc(object, GL_INFO_LOG_LENGTH, &logLength);\n    if (logLength < 1)\n        return \"\";\n\n    char *logBytes = (char*)malloc(logLength);\n    logFunc(object, logLength, &charsWritten, logBytes);\n\n    ret = logBytes;\n\n    free(logBytes);\n    return ret;\n}\n\nstd::string GLProgram::getVertexShaderLog() const\n{\n    return this->logForOpenGLObject(_vertShader, (GLInfoFunction)&glGetShaderiv, (GLLogFunction)&glGetShaderInfoLog);\n}\n\nstd::string GLProgram::getFragmentShaderLog() const\n{\n    return this->logForOpenGLObject(_fragShader, (GLInfoFunction)&glGetShaderiv, (GLLogFunction)&glGetShaderInfoLog);\n}\n\nstd::string GLProgram::getProgramLog() const\n{\n    return this->logForOpenGLObject(_program, (GLInfoFunction)&glGetProgramiv, (GLLogFunction)&glGetProgramInfoLog);\n}\n\n// Uniform cache\n\nbool GLProgram::updateUniformLocation(GLint location, const GLvoid* data, unsigned int bytes)\n{\n    if (location < 0)\n    {\n        return false;\n    }\n    \n    bool updated = true;\n    tHashUniformEntry *element = nullptr;\n    HASH_FIND_INT(_hashForUniforms, &location, element);\n\n    if (! element)\n    {\n        element = (tHashUniformEntry*)malloc( sizeof(*element) );\n\n        // key\n        element->location = location;\n\n        // value\n        element->value = malloc( bytes );\n        memcpy(element->value, data, bytes );\n\n        HASH_ADD_INT(_hashForUniforms, location, element);\n    }\n    else\n    {\n        if (memcmp(element->value, data, bytes) == 0)\n        {\n            updated = false;\n        }\n        else\n        {\n            memcpy(element->value, data, bytes);\n        }\n    }\n\n    return updated;\n}\n\nGLint GLProgram::getUniformLocationForName(const char* name) const\n{\n    CCASSERT(name != nullptr, \"Invalid uniform name\" );\n    CCASSERT(_program != 0, \"Invalid operation. Cannot get uniform location when program is not initialized\");\n    \n    return glGetUniformLocation(_program, name);\n}\n\nvoid GLProgram::setUniformLocationWith1i(GLint location, GLint i1)\n{\n    bool updated =  updateUniformLocation(location, &i1, sizeof(i1)*1);\n    \n    if( updated )\n    {\n        glUniform1i( (GLint)location, i1);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith2i(GLint location, GLint i1, GLint i2)\n{\n    GLint ints[2] = {i1,i2};\n    bool updated =  updateUniformLocation(location, ints, sizeof(ints));\n    \n    if( updated )\n    {\n        glUniform2i( (GLint)location, i1, i2);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith3i(GLint location, GLint i1, GLint i2, GLint i3)\n{\n    GLint ints[3] = {i1,i2,i3};\n    bool updated =  updateUniformLocation(location, ints, sizeof(ints));\n    \n    if( updated )\n    {\n        glUniform3i( (GLint)location, i1, i2, i3);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith4i(GLint location, GLint i1, GLint i2, GLint i3, GLint i4)\n{\n    GLint ints[4] = {i1,i2,i3,i4};\n    bool updated =  updateUniformLocation(location, ints, sizeof(ints));\n    \n    if( updated )\n    {\n        glUniform4i( (GLint)location, i1, i2, i3, i4);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith2iv(GLint location, GLint* ints, unsigned int numberOfArrays)\n{\n    bool updated =  updateUniformLocation(location, ints, sizeof(int)*2*numberOfArrays);\n    \n    if( updated )\n    {\n        glUniform2iv( (GLint)location, (GLsizei)numberOfArrays, ints );\n    }\n}\n\nvoid GLProgram::setUniformLocationWith3iv(GLint location, GLint* ints, unsigned int numberOfArrays)\n{\n    bool updated =  updateUniformLocation(location, ints, sizeof(int)*3*numberOfArrays);\n    \n    if( updated )\n    {\n        glUniform3iv( (GLint)location, (GLsizei)numberOfArrays, ints );\n    }\n}\n\nvoid GLProgram::setUniformLocationWith4iv(GLint location, GLint* ints, unsigned int numberOfArrays)\n{\n    bool updated =  updateUniformLocation(location, ints, sizeof(int)*4*numberOfArrays);\n    \n    if( updated )\n    {\n        glUniform4iv( (GLint)location, (GLsizei)numberOfArrays, ints );\n    }\n}\n\nvoid GLProgram::setUniformLocationWith1f(GLint location, GLfloat f1)\n{\n    bool updated =  updateUniformLocation(location, &f1, sizeof(f1)*1);\n\n    if( updated )\n    {\n        glUniform1f( (GLint)location, f1);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith2f(GLint location, GLfloat f1, GLfloat f2)\n{\n    GLfloat floats[2] = {f1,f2};\n    bool updated =  updateUniformLocation(location, floats, sizeof(floats));\n\n    if( updated )\n    {\n        glUniform2f( (GLint)location, f1, f2);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith3f(GLint location, GLfloat f1, GLfloat f2, GLfloat f3)\n{\n    GLfloat floats[3] = {f1,f2,f3};\n    bool updated =  updateUniformLocation(location, floats, sizeof(floats));\n\n    if( updated )\n    {\n        glUniform3f( (GLint)location, f1, f2, f3);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith4f(GLint location, GLfloat f1, GLfloat f2, GLfloat f3, GLfloat f4)\n{\n    GLfloat floats[4] = {f1,f2,f3,f4};\n    bool updated =  updateUniformLocation(location, floats, sizeof(floats));\n\n    if( updated )\n    {\n        glUniform4f( (GLint)location, f1, f2, f3,f4);\n    }\n}\n\nvoid GLProgram::setUniformLocationWith2fv(GLint location, const GLfloat* floats, unsigned int numberOfArrays)\n{\n    bool updated =  updateUniformLocation(location, floats, sizeof(float)*2*numberOfArrays);\n\n    if( updated )\n    {\n        glUniform2fv( (GLint)location, (GLsizei)numberOfArrays, floats );\n    }\n}\n\nvoid GLProgram::setUniformLocationWith3fv(GLint location, const GLfloat* floats, unsigned int numberOfArrays)\n{\n    bool updated =  updateUniformLocation(location, floats, sizeof(float)*3*numberOfArrays);\n\n    if( updated )\n    {\n        glUniform3fv( (GLint)location, (GLsizei)numberOfArrays, floats );\n    }\n}\n\nvoid GLProgram::setUniformLocationWith4fv(GLint location, const GLfloat* floats, unsigned int numberOfArrays)\n{\n    bool updated =  updateUniformLocation(location, floats, sizeof(float)*4*numberOfArrays);\n\n    if( updated )\n    {\n        glUniform4fv( (GLint)location, (GLsizei)numberOfArrays, floats );\n    }\n}\n\nvoid GLProgram::setUniformLocationWithMatrix2fv(GLint location, const GLfloat* matrixArray, unsigned int numberOfMatrices) {\n    bool updated =  updateUniformLocation(location, matrixArray, sizeof(float)*4*numberOfMatrices);\n    \n    if( updated )\n    {\n        glUniformMatrix2fv( (GLint)location, (GLsizei)numberOfMatrices, GL_FALSE, matrixArray);\n    }\n}\n\nvoid GLProgram::setUniformLocationWithMatrix3fv(GLint location, const GLfloat* matrixArray, unsigned int numberOfMatrices) {\n    bool updated =  updateUniformLocation(location, matrixArray, sizeof(float)*9*numberOfMatrices);\n    \n    if( updated )\n    {\n        glUniformMatrix3fv( (GLint)location, (GLsizei)numberOfMatrices, GL_FALSE, matrixArray);\n    }\n}\n\n\nvoid GLProgram::setUniformLocationWithMatrix4fv(GLint location, const GLfloat* matrixArray, unsigned int numberOfMatrices)\n{\n    bool updated =  updateUniformLocation(location, matrixArray, sizeof(float)*16*numberOfMatrices);\n\n    if( updated )\n    {\n        glUniformMatrix4fv( (GLint)location, (GLsizei)numberOfMatrices, GL_FALSE, matrixArray);\n    }\n}\n\nvoid GLProgram::setUniformsForBuiltins()\n{\n\tkmMat4 matrixMV;\n\tkmGLGetMatrix(KM_GL_MODELVIEW, &matrixMV);\n\n    setUniformsForBuiltins(matrixMV);\n}\n\nvoid GLProgram::setUniformsForBuiltins(const kmMat4 &matrixMV)\n{\n    kmMat4 matrixP;\n\n\tkmGLGetMatrix(KM_GL_PROJECTION, &matrixP);\n\n    if(_flags.usesP)\n        setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_P_MATRIX], matrixP.mat, 1);\n\n    if(_flags.usesMV)\n        setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MV_MATRIX], matrixMV.mat, 1);\n\n    if(_flags.usesMVP) {\n        kmMat4 matrixMVP;\n        kmMat4Multiply(&matrixMVP, &matrixP, &matrixMV);\n        setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MVP_MATRIX], matrixMVP.mat, 1);\n    }\n\n\tif(_flags.usesTime) {\n\t\tDirector *director = Director::getInstance();\n\t\t// This doesn't give the most accurate global time value.\n\t\t// Cocos2D doesn't store a high precision time value, so this will have to do.\n\t\t// Getting Mach time per frame per shader using time could be extremely expensive.\n        float time = director->getTotalFrames() * director->getAnimationInterval();\n\t\t\n        setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_TIME], time/10.0, time, time*2, time*4);\n        setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_SIN_TIME], time/8.0, time/4.0, time/2.0, sinf(time));\n        setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_COS_TIME], time/8.0, time/4.0, time/2.0, cosf(time));\n\t}\n\t\n\tif(_flags.usesRandom)\n        setUniformLocationWith4f(_uniforms[GLProgram::UNIFORM_RANDOM01], CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1(), CCRANDOM_0_1());\n}\n\nvoid GLProgram::reset()\n{\n    _vertShader = _fragShader = 0;\n    memset(_uniforms, 0, sizeof(_uniforms));\n    \n\n    // it is already deallocated by android\n    //GL::deleteProgram(_program);\n    _program = 0;\n\n    \n    tHashUniformEntry *current_element, *tmp;\n    \n    // Purge uniform hash\n    HASH_ITER(hh, _hashForUniforms, current_element, tmp) \n    {\n        HASH_DEL(_hashForUniforms, current_element);\n        free(current_element->value);\n        free(current_element);\n    }\n    _hashForUniforms = nullptr;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGLProgram.h",
    "content": "/****************************************************************************\nCopyright 2011 Jeff Lamarche\nCopyright 2012 Goffredo Marocchi\nCopyright 2012 Ricardo Quesada\nCopyright 2012 cocos2d-x.org\nCopyright 2013-2014 Chukong Technologies Inc.\n \n \nhttp://www.cocos2d-x.org\n \nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCGLPROGRAM_H__\n#define __CCGLPROGRAM_H__\n\n#include \"ccMacros.h\"\n#include \"CCObject.h\"\n\n#include \"CCGL.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup shaders\n * @{\n */\n\nstruct _hashUniformEntry;\n\ntypedef void (*GLInfoFunction)(GLuint program, GLenum pname, GLint* params);\ntypedef void (*GLLogFunction) (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);\n\n/** GLProgram\n Class that implements a glProgram\n \n \n @since v2.0.0\n */\nclass CC_DLL GLProgram : public Object\n{\npublic:\n    enum\n    {\n        VERTEX_ATTRIB_POSITION,\n        VERTEX_ATTRIB_COLOR,\n        VERTEX_ATTRIB_TEX_COORDS,\n        \n        VERTEX_ATTRIB_MAX,\n    };\n    \n    enum\n    {\n        UNIFORM_P_MATRIX,\n        UNIFORM_MV_MATRIX,\n        UNIFORM_MVP_MATRIX,\n        UNIFORM_TIME,\n        UNIFORM_SIN_TIME,\n        UNIFORM_COS_TIME,\n        UNIFORM_RANDOM01,\n        UNIFORM_SAMPLER,\n        \n        UNIFORM_MAX,\n    };\n    \n    static const char* SHADER_NAME_POSITION_TEXTURE_COLOR;\n    static const char* SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP;\n    static const char* SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST;\n    static const char* SHADER_NAME_POSITION_COLOR;\n    static const char* SHADER_NAME_POSITION_COLOR_NO_MVP;\n    static const char* SHADER_NAME_POSITION_TEXTURE;\n    static const char* SHADER_NAME_POSITION_TEXTURE_U_COLOR;\n    static const char* SHADER_NAME_POSITION_TEXTURE_A8_COLOR;\n    static const char* SHADER_NAME_POSITION_U_COLOR;\n    static const char* SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR;\n\n    static const char* SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL;\n    static const char* SHADER_NAME_LABEL_DISTANCEFIELD_GLOW;\n    static const char* SHADER_NAME_LABEL_DISTANCEFIELD_OUTLINE;\n    static const char* SHADER_NAME_LABEL_DISTANCEFIELD_SHADOW;\n    \n    // uniform names\n    static const char* UNIFORM_NAME_P_MATRIX;\n    static const char* UNIFORM_NAME_MV_MATRIX;\n    static const char* UNIFORM_NAME_MVP_MATRIX;\n    static const char* UNIFORM_NAME_TIME;\n    static const char* UNIFORM_NAME_SIN_TIME;\n    static const char* UNIFORM_NAME_COS_TIME;\n    static const char* UNIFORM_NAME_RANDOM01;\n    static const char* UNIFORM_NAME_SAMPLER;\n    static const char* UNIFORM_NAME_ALPHA_TEST_VALUE;\n    \n    // Attribute names\n    static const char* ATTRIBUTE_NAME_COLOR;\n    static const char* ATTRIBUTE_NAME_POSITION;\n    static const char* ATTRIBUTE_NAME_TEX_COORD;\n    /**\n     * @js ctor\n     */\n    GLProgram();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~GLProgram();\n    /** Initializes the GLProgram with a vertex and fragment with bytes array \n     * @js initWithString\n     * @lua initWithString\n     */\n    bool initWithVertexShaderByteArray(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray);\n    /** Initializes the GLProgram with a vertex and fragment with contents of filenames \n     * @js init\n     * @lua init\n     */\n    bool initWithVertexShaderFilename(const char* vShaderFilename, const char* fShaderFilename);\n    /**  It will add a new attribute to the shader */\n    void addAttribute(const char* attributeName, GLuint index);\n    /** links the glProgram */\n    bool link();\n    /** it will call glUseProgram() */\n    void use();\n/** It will create 4 uniforms:\n    - kUniformPMatrix\n    - kUniformMVMatrix\n    - kUniformMVPMatrix\n    - GLProgram::UNIFORM_SAMPLER\n\n And it will bind \"GLProgram::UNIFORM_SAMPLER\" to 0\n\n */\n    void updateUniforms();\n    \n    /** calls retrieves the named uniform location for this shader program. */\n    GLint getUniformLocationForName(const char* name) const;\n    \n    /** calls glUniform1i only if the values are different than the previous call for this same shader program. \n     * @js setUniformLocationI32\n     * @lua setUniformLocationI32\n     */\n    void setUniformLocationWith1i(GLint location, GLint i1);\n    \n    /** calls glUniform2i only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith2i(GLint location, GLint i1, GLint i2);\n    \n    /** calls glUniform3i only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith3i(GLint location, GLint i1, GLint i2, GLint i3);\n    \n    /** calls glUniform4i only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith4i(GLint location, GLint i1, GLint i2, GLint i3, GLint i4);\n    \n    /** calls glUniform2iv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith2iv(GLint location, GLint* ints, unsigned int numberOfArrays);\n    \n    /** calls glUniform3iv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith3iv(GLint location, GLint* ints, unsigned int numberOfArrays);\n    \n    /** calls glUniform4iv only if the values are different than the previous call for this same shader program. */\n    \n    void setUniformLocationWith4iv(GLint location, GLint* ints, unsigned int numberOfArrays);\n\n    /** calls glUniform1f only if the values are different than the previous call for this same shader program. \n     * In js or lua,please use setUniformLocationF32\n     * @js NA\n     */\n    void setUniformLocationWith1f(GLint location, GLfloat f1);\n\n    /** calls glUniform2f only if the values are different than the previous call for this same shader program. \n     * In js or lua,please use setUniformLocationF32\n     * @js NA\n     */\n    void setUniformLocationWith2f(GLint location, GLfloat f1, GLfloat f2);\n\n    /** calls glUniform3f only if the values are different than the previous call for this same shader program. \n     * In js or lua,please use setUniformLocationF32\n     * @js NA\n     */\n    void setUniformLocationWith3f(GLint location, GLfloat f1, GLfloat f2, GLfloat f3);\n\n    /** calls glUniform4f only if the values are different than the previous call for this same shader program. \n     * In js or lua,please use setUniformLocationF32\n     * @js NA\n     */\n    void setUniformLocationWith4f(GLint location, GLfloat f1, GLfloat f2, GLfloat f3, GLfloat f4);\n\n    /** calls glUniform2fv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith2fv(GLint location, const GLfloat* floats, unsigned int numberOfArrays);\n\n    /** calls glUniform3fv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith3fv(GLint location, const GLfloat* floats, unsigned int numberOfArrays);\n\n    /** calls glUniform4fv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWith4fv(GLint location, const GLfloat* floats, unsigned int numberOfArrays);\n\n    /** calls glUniformMatrix2fv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWithMatrix2fv(GLint location, const GLfloat* matrixArray, unsigned int numberOfMatrices);\n    \n    /** calls glUniformMatrix3fv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWithMatrix3fv(GLint location, const GLfloat* matrixArray, unsigned int numberOfMatrices);\n    \n    /** calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program. */\n    void setUniformLocationWithMatrix4fv(GLint location, const GLfloat* matrixArray, unsigned int numberOfMatrices);\n    \n    /** will update the builtin uniforms if they are different than the previous call for this same shader program. */\n    void setUniformsForBuiltins();\n    void setUniformsForBuiltins(const kmMat4 &modelView);\n\n    /** returns the vertexShader error log */\n    std::string getVertexShaderLog() const;\n\n    /** returns the fragmentShader error log */\n    std::string getFragmentShaderLog() const;\n\n    /** returns the program error log */\n    std::string getProgramLog() const;\n    \n    // reload all shaders, this function is designed for android\n    // when opengl context lost, so don't call it.\n    void reset();\n    \n    inline const GLuint getProgram() const { return _program; }\n\nprivate:\n    bool updateUniformLocation(GLint location, const GLvoid* data, unsigned int bytes);\n    virtual std::string getDescription() const;\n\n    bool compileShader(GLuint * shader, GLenum type, const GLchar* source);\n    std::string logForOpenGLObject(GLuint object, GLInfoFunction infoFunc, GLLogFunction logFunc) const;\n\nprivate:\n    GLuint            _program;\n    GLuint            _vertShader;\n    GLuint            _fragShader;\n    GLint             _uniforms[UNIFORM_MAX];\n    struct _hashUniformEntry* _hashForUniforms;\n\n    struct flag_struct {\n        unsigned int usesTime:1;\n        unsigned int usesMVP:1;\n        unsigned int usesMV:1;\n        unsigned int usesP:1;\n\t\tunsigned int usesRandom:1;\n\n        // handy way to initialize the bitfield\n        flag_struct() { memset(this, 0, sizeof(*this)); }\n    } _flags;\n};\n\n// end of shaders group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCGLPROGRAM_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGrabber.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (C) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCGrabber.h\"\n#include \"ccMacros.h\"\n#include \"CCTexture2D.h\"\n\nNS_CC_BEGIN\n\nGrabber::Grabber(void)\n    : _FBO(0)\n    , _oldFBO(0)\n{\n    memset(_oldClearColor, 0, sizeof(_oldClearColor));\n\n    // generate FBO\n    glGenFramebuffers(1, &_FBO);\n}\n\nvoid Grabber::grab(Texture2D *texture)\n{\n    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);\n\n    // bind\n    glBindFramebuffer(GL_FRAMEBUFFER, _FBO);\n\n    // associate texture with FBO\n    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->getName(), 0);\n\n    // check if it worked (probably worth doing :) )\n    GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER);\n    if (status != GL_FRAMEBUFFER_COMPLETE)\n    {\n        CCASSERT(0, \"Frame Grabber: could not attach texture to framebuffer\");\n    }\n\n    glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);\n}\n\nvoid Grabber::beforeRender(Texture2D *texture)\n{\n    CC_UNUSED_PARAM(texture);\n\n    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);\n    glBindFramebuffer(GL_FRAMEBUFFER, _FBO);\n    \n    // save clear color\n    glGetFloatv(GL_COLOR_CLEAR_VALUE, _oldClearColor);\n    // BUG XXX: doesn't work with RGB565.\n\n    glClearColor(0, 0, 0, 0);\n\n    // BUG #631: To fix #631, uncomment the lines with #631\n    // Warning: But it Grabber won't work with 2 effects at the same time\n//  glClearColor(0.0f,0.0f,0.0f,1.0f);    // #631\n\n    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n\n//  glColorMask(true, true, true, false);    // #631\n}\n\nvoid Grabber::afterRender(cocos2d::Texture2D *texture)\n{\n    CC_UNUSED_PARAM(texture);\n\n    glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);\n//  glColorMask(true, true, true, true);    // #631\n    \n    // Restore clear color\n    glClearColor(_oldClearColor[0], _oldClearColor[1], _oldClearColor[2], _oldClearColor[3]);\n}\n\nGrabber::~Grabber()\n{\n    CCLOGINFO(\"deallocing Grabber: %p\", this);\n    glDeleteFramebuffers(1, &_FBO);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGrabber.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (C) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __EFFECTS_CCGRABBER_H__\n#define __EFFECTS_CCGRABBER_H__\n\n#include \"CCConfiguration.h\"\n#include \"CCObject.h\"\n#include \"CCGL.h\"\n\nNS_CC_BEGIN\n\nclass Texture2D;\n\n/**\n * @addtogroup effects\n * @{\n */\n\n/** FBO class that grabs the the contents of the screen */\nclass Grabber : public Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    Grabber(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~Grabber(void);\n\n    void grab(Texture2D *texture);\n    void beforeRender(Texture2D *texture);\n    void afterRender(Texture2D *texture);\n\nprotected:\n    GLuint _FBO;\n    GLint _oldFBO;\n    GLfloat _oldClearColor[4];\n};\n\n// end of effects group\n/// @}\n\nNS_CC_END\n\n#endif // __EFFECTS_CCGRABBER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGrid.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (C) 2013-2014 Chukong Technologies Inc. \n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ccMacros.h\"\n#include \"CCGrid.h\"\n#include \"CCDirector.h\"\n#include \"CCGrabber.h\"\n#include \"ccUtils.h\"\n#include \"CCGLProgram.h\"\n#include \"CCShaderCache.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCGL.h\"\n#include \"TransformUtils.h\"\n#include \"kazmath/kazmath.h\"\n#include \"kazmath/GL/matrix.h\"\n\nNS_CC_BEGIN\n// implementation of GridBase\n\nGridBase* GridBase::create(const Size& gridSize)\n{\n    GridBase *pGridBase = new GridBase();\n\n    if (pGridBase)\n    {\n        if (pGridBase->initWithSize(gridSize))\n        {\n            pGridBase->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(pGridBase);\n        }\n    }\n\n    return pGridBase;\n}\n\nGridBase* GridBase::create(const Size& gridSize, Texture2D *texture, bool flipped)\n{\n    GridBase *pGridBase = new GridBase();\n\n    if (pGridBase)\n    {\n        if (pGridBase->initWithSize(gridSize, texture, flipped))\n        {\n            pGridBase->autorelease();\n        }\n        else\n        {\n            CC_SAFE_RELEASE_NULL(pGridBase);\n        }\n    }\n\n    return pGridBase;\n}\n\nbool GridBase::initWithSize(const Size& gridSize, Texture2D *texture, bool flipped)\n{\n    bool ret = true;\n\n    _active = false;\n    _reuseGrid = 0;\n    _gridSize = gridSize;\n\n    _texture = texture;\n    CC_SAFE_RETAIN(_texture);\n    _isTextureFlipped = flipped;\n\n    Size texSize = _texture->getContentSize();\n    _step.x = texSize.width / _gridSize.width;\n    _step.y = texSize.height / _gridSize.height;\n\n    _grabber = new Grabber();\n    if (_grabber)\n    {\n        _grabber->grab(_texture);\n    }\n    else\n    {\n        ret = false;\n    }\n    \n    _shaderProgram = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE);\n    calculateVertexPoints();\n\n    return ret;\n}\n\nbool GridBase::initWithSize(const Size& gridSize)\n{\n    Director *director = Director::getInstance();\n    Size s = director->getWinSizeInPixels();\n    \n    auto POTWide = ccNextPOT((unsigned int)s.width);\n    auto POTHigh = ccNextPOT((unsigned int)s.height);\n\n    // we only use rgba8888\n    Texture2D::PixelFormat format = Texture2D::PixelFormat::RGBA8888;\n\n    auto dataLen = POTWide * POTHigh * 4;\n    void *data = calloc(dataLen, 1);\n    if (! data)\n    {\n        CCLOG(\"cocos2d: Grid: not enough memory.\");\n        this->release();\n        return false;\n    }\n\n    Texture2D *texture = new Texture2D();\n    texture->initWithData(data, dataLen,  format, POTWide, POTHigh, s);\n\n    free(data);\n\n    if (! texture)\n    {\n        CCLOG(\"cocos2d: Grid: error creating texture\");\n        return false;\n    }\n\n    initWithSize(gridSize, texture, false);\n\n    texture->release();\n\n    return true;\n}\n\nGridBase::~GridBase(void)\n{\n    CCLOGINFO(\"deallocing GridBase: %p\", this);\n\n//TODO: ? why 2.0 comments this line        setActive(false);\n    CC_SAFE_RELEASE(_texture);\n    CC_SAFE_RELEASE(_grabber);\n}\n\n// properties\nvoid GridBase::setActive(bool active)\n{\n    _active = active;\n    if (! active)\n    {\n        Director *pDirector = Director::getInstance();\n        Director::Projection proj = pDirector->getProjection();\n        pDirector->setProjection(proj);\n    }\n}\n\nvoid GridBase::setTextureFlipped(bool flipped)\n{\n    if (_isTextureFlipped != flipped)\n    {\n        _isTextureFlipped = flipped;\n        calculateVertexPoints();\n    }\n}\n\nvoid GridBase::set2DProjection()\n{\n    Director *director = Director::getInstance();\n\n    Size    size = director->getWinSizeInPixels();\n\n    glViewport(0, 0, (GLsizei)(size.width), (GLsizei)(size.height) );\n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLLoadIdentity();\n\n    kmMat4 orthoMatrix;\n    kmMat4OrthographicProjection(&orthoMatrix, 0, size.width, 0, size.height, -1, 1);\n    kmGLMultMatrix( &orthoMatrix );\n\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLLoadIdentity();\n\n    GL::setProjectionMatrixDirty();\n}\n\nvoid GridBase::beforeDraw(void)\n{\n    // save projection\n    Director *director = Director::getInstance();\n    _directorProjection = director->getProjection();\n\n    // 2d projection\n    //    [director setProjection:Director::Projection::_2D];\n    set2DProjection();\n    _grabber->beforeRender(_texture);\n}\n\nvoid GridBase::afterDraw(cocos2d::Node *target)\n{\n    _grabber->afterRender(_texture);\n\n    // restore projection\n    Director *director = Director::getInstance();\n    director->setProjection(_directorProjection);\n\n//    if (target->getCamera()->isDirty())\n//    {\n//        Point offset = target->getAnchorPointInPoints();\n//\n//        //\n//        // XXX: Camera should be applied in the AnchorPoint\n//        //\n//        kmGLTranslatef(offset.x, offset.y, 0);\n//        target->getCamera()->locate();\n//        kmGLTranslatef(-offset.x, -offset.y, 0);\n//    }\n\n    GL::bindTexture2D(_texture->getName());\n\n    // restore projection for default FBO .fixed bug #543 #544\n//TODO:         Director::getInstance()->setProjection(Director::getInstance()->getProjection());\n//TODO:         Director::getInstance()->applyOrientation();\n    blit();\n}\n\nvoid GridBase::blit(void)\n{\n    CCASSERT(0, \"\");\n}\n\nvoid GridBase::reuse(void)\n{\n    CCASSERT(0, \"\");\n}\n\nvoid GridBase::calculateVertexPoints(void)\n{\n    CCASSERT(0, \"\");\n}\n\n// implementation of Grid3D\n\nGrid3D* Grid3D::create(const Size& gridSize, Texture2D *texture, bool flipped)\n{\n    Grid3D *ret= new Grid3D();\n\n    if (ret)\n    {\n        if (ret->initWithSize(gridSize, texture, flipped))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            delete ret;\n            ret = nullptr;\n        }\n    }\n\n    return ret;\n}\n\nGrid3D* Grid3D::create(const Size& gridSize)\n{\n    Grid3D *ret= new Grid3D();\n\n    if (ret)\n    {\n        if (ret->initWithSize(gridSize))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            delete ret;\n            ret = nullptr;\n        }\n    }\n\n    return ret;\n}\n\n\nGrid3D::Grid3D()\n    : _texCoordinates(nullptr)\n    , _vertices(nullptr)\n    , _originalVertices(nullptr)\n    , _indices(nullptr)\n{\n\n}\n\nGrid3D::~Grid3D(void)\n{\n    CC_SAFE_FREE(_texCoordinates);\n    CC_SAFE_FREE(_vertices);\n    CC_SAFE_FREE(_indices);\n    CC_SAFE_FREE(_originalVertices);\n}\n\nvoid Grid3D::blit(void)\n{\n    int n = _gridSize.width * _gridSize.height;\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORDS );\n    _shaderProgram->use();\n    _shaderProgram->setUniformsForBuiltins();;\n\n    //\n    // Attributes\n    //\n#ifdef EMSCRIPTEN\n    // Size calculations from calculateVertexPoints().\n    unsigned int numOfPoints = (_gridSize.width+1) * (_gridSize.height+1);\n\n    // position\n    setGLBufferData(_vertices, numOfPoints * sizeof(Vertex3F), 0);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0);\n\n    // texCoords\n    setGLBufferData(_texCoordinates, numOfPoints * sizeof(Vertex2F), 1);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, 0);\n\n    setGLIndexData(_indices, n * 12, 0);\n    glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, 0);\n#else\n    // position\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _vertices);\n\n    // texCoords\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, _texCoordinates);\n\n    glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, _indices);\n#endif // EMSCRIPTEN\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid Grid3D::calculateVertexPoints(void)\n{\n    float width = (float)_texture->getPixelsWide();\n    float height = (float)_texture->getPixelsHigh();\n    float imageH = _texture->getContentSizeInPixels().height;\n\n    int x, y, i;\n    CC_SAFE_FREE(_vertices);\n    CC_SAFE_FREE(_originalVertices);\n    CC_SAFE_FREE(_texCoordinates);\n    CC_SAFE_FREE(_indices);\n\n    unsigned int numOfPoints = (_gridSize.width+1) * (_gridSize.height+1);\n\n    _vertices = malloc(numOfPoints * sizeof(Vertex3F));\n    _originalVertices = malloc(numOfPoints * sizeof(Vertex3F));\n    _texCoordinates = malloc(numOfPoints * sizeof(Vertex2F));\n    _indices = (GLushort*)malloc(_gridSize.width * _gridSize.height * sizeof(GLushort) * 6);\n\n    GLfloat *vertArray = (GLfloat*)_vertices;\n    GLfloat *texArray = (GLfloat*)_texCoordinates;\n    GLushort *idxArray = _indices;\n\n    for (x = 0; x < _gridSize.width; ++x)\n    {\n        for (y = 0; y < _gridSize.height; ++y)\n        {\n            int idx = (y * _gridSize.width) + x;\n\n            GLfloat x1 = x * _step.x;\n            GLfloat x2 = x1 + _step.x;\n            GLfloat y1 = y * _step.y;\n            GLfloat y2= y1 + _step.y;\n\n            GLushort a = (GLushort)(x * (_gridSize.height + 1) + y);\n            GLushort b = (GLushort)((x + 1) * (_gridSize.height + 1) + y);\n            GLushort c = (GLushort)((x + 1) * (_gridSize.height + 1) + (y + 1));\n            GLushort d = (GLushort)(x * (_gridSize.height + 1) + (y + 1));\n\n            GLushort tempidx[6] = {a, b, d, b, c, d};\n\n            memcpy(&idxArray[6*idx], tempidx, 6*sizeof(GLushort));\n\n            int l1[4] = {a*3, b*3, c*3, d*3};\n            Vertex3F e(x1, y1, 0);\n            Vertex3F f(x2, y1, 0);\n            Vertex3F g(x2, y2, 0);\n            Vertex3F h(x1, y2, 0);\n\n            Vertex3F l2[4] = {e, f, g, h};\n\n            int tex1[4] = {a*2, b*2, c*2, d*2};\n            Point Tex2F[4] = {Point(x1, y1), Point(x2, y1), Point(x2, y2), Point(x1, y2)};\n\n            for (i = 0; i < 4; ++i)\n            {\n                vertArray[l1[i]] = l2[i].x;\n                vertArray[l1[i] + 1] = l2[i].y;\n                vertArray[l1[i] + 2] = l2[i].z;\n\n                texArray[tex1[i]] = Tex2F[i].x / width;\n                if (_isTextureFlipped)\n                {\n                    texArray[tex1[i] + 1] = (imageH - Tex2F[i].y) / height;\n                }\n                else\n                {\n                    texArray[tex1[i] + 1] = Tex2F[i].y / height;\n                }\n            }\n        }\n    }\n\n    memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(Vertex3F));\n}\n\nVertex3F Grid3D::getVertex(const Point& pos) const\n{\n    CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , \"Numbers must be integers\");\n    \n    int index = (pos.x * (_gridSize.height+1) + pos.y) * 3;\n    float *vertArray = (float*)_vertices;\n\n    Vertex3F vert(vertArray[index], vertArray[index+1], vertArray[index+2]);\n\n    return vert;\n}\n\nVertex3F Grid3D::getOriginalVertex(const Point& pos) const\n{\n    CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , \"Numbers must be integers\");\n    \n    int index = (pos.x * (_gridSize.height+1) + pos.y) * 3;\n    float *vertArray = (float*)_originalVertices;\n\n    Vertex3F vert(vertArray[index], vertArray[index+1], vertArray[index+2]);\n\n    return vert;\n}\n\nvoid Grid3D::setVertex(const Point& pos, const Vertex3F& vertex)\n{\n    CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , \"Numbers must be integers\");\n    int index = (pos.x * (_gridSize.height + 1) + pos.y) * 3;\n    float *vertArray = (float*)_vertices;\n    vertArray[index] = vertex.x;\n    vertArray[index+1] = vertex.y;\n    vertArray[index+2] = vertex.z;\n}\n\nvoid Grid3D::reuse(void)\n{\n    if (_reuseGrid > 0)\n    {\n        memcpy(_originalVertices, _vertices, (_gridSize.width+1) * (_gridSize.height+1) * sizeof(Vertex3F));\n        --_reuseGrid;\n    }\n}\n\n// implementation of TiledGrid3D\n\nTiledGrid3D::TiledGrid3D()\n    : _texCoordinates(nullptr)\n    , _vertices(nullptr)\n    , _originalVertices(nullptr)\n    , _indices(nullptr)\n{\n\n}\n\nTiledGrid3D::~TiledGrid3D(void)\n{\n    CC_SAFE_FREE(_texCoordinates);\n    CC_SAFE_FREE(_vertices);\n    CC_SAFE_FREE(_originalVertices);\n    CC_SAFE_FREE(_indices);\n}\n\nTiledGrid3D* TiledGrid3D::create(const Size& gridSize, Texture2D *texture, bool flipped)\n{\n    TiledGrid3D *ret= new TiledGrid3D();\n\n    if (ret)\n    {\n        if (ret->initWithSize(gridSize, texture, flipped))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            delete ret;\n            ret = nullptr;\n        }\n    }\n\n    return ret;\n}\n\nTiledGrid3D* TiledGrid3D::create(const Size& gridSize)\n{\n    TiledGrid3D *ret= new TiledGrid3D();\n\n    if (ret)\n    {\n        if (ret->initWithSize(gridSize))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            delete ret;\n            ret = nullptr;\n        }\n    }\n\n    return ret;\n}\n\nvoid TiledGrid3D::blit(void)\n{\n    int n = _gridSize.width * _gridSize.height;\n\n    \n    _shaderProgram->use();\n    _shaderProgram->setUniformsForBuiltins();\n\n    //\n    // Attributes\n    //\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORDS );\n#ifdef EMSCRIPTEN\n    int numQuads = _gridSize.width * _gridSize.height;\n\n    // position\n    setGLBufferData(_vertices, (numQuads*4*sizeof(Vertex3F)), 0);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0);\n\n    // texCoords\n    setGLBufferData(_texCoordinates, (numQuads*4*sizeof(Vertex2F)), 1);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, 0);\n\n    setGLIndexData(_indices, n * 12, 0);\n    glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, 0);\n#else\n    // position\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _vertices);\n\n    // texCoords\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, _texCoordinates);\n\n    glDrawElements(GL_TRIANGLES, (GLsizei)n*6, GL_UNSIGNED_SHORT, _indices);\n#endif // EMSCRIPTEN\n\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid TiledGrid3D::calculateVertexPoints(void)\n{\n    float width = (float)_texture->getPixelsWide();\n    float height = (float)_texture->getPixelsHigh();\n    float imageH = _texture->getContentSizeInPixels().height;\n    \n    int numQuads = _gridSize.width * _gridSize.height;\n    CC_SAFE_FREE(_vertices);\n    CC_SAFE_FREE(_originalVertices);\n    CC_SAFE_FREE(_texCoordinates);\n    CC_SAFE_FREE(_indices);\n\n    _vertices = malloc(numQuads*4*sizeof(Vertex3F));\n    _originalVertices = malloc(numQuads*4*sizeof(Vertex3F));\n    _texCoordinates = malloc(numQuads*4*sizeof(Vertex2F));\n    _indices = (GLushort*)malloc(numQuads*6*sizeof(GLushort));\n\n    GLfloat *vertArray = (GLfloat*)_vertices;\n    GLfloat *texArray = (GLfloat*)_texCoordinates;\n    GLushort *idxArray = _indices;\n    \n    int x, y;\n    \n    for( x = 0; x < _gridSize.width; x++ )\n    {\n        for( y = 0; y < _gridSize.height; y++ )\n        {\n            float x1 = x * _step.x;\n            float x2 = x1 + _step.x;\n            float y1 = y * _step.y;\n            float y2 = y1 + _step.y;\n            \n            *vertArray++ = x1;\n            *vertArray++ = y1;\n            *vertArray++ = 0;\n            *vertArray++ = x2;\n            *vertArray++ = y1;\n            *vertArray++ = 0;\n            *vertArray++ = x1;\n            *vertArray++ = y2;\n            *vertArray++ = 0;\n            *vertArray++ = x2;\n            *vertArray++ = y2;\n            *vertArray++ = 0;\n            \n            float newY1 = y1;\n            float newY2 = y2;\n            \n            if (_isTextureFlipped) \n            {\n                newY1 = imageH - y1;\n                newY2 = imageH - y2;\n            }\n\n            *texArray++ = x1 / width;\n            *texArray++ = newY1 / height;\n            *texArray++ = x2 / width;\n            *texArray++ = newY1 / height;\n            *texArray++ = x1 / width;\n            *texArray++ = newY2 / height;\n            *texArray++ = x2 / width;\n            *texArray++ = newY2 / height;\n        }\n    }\n    \n    for (x = 0; x < numQuads; x++)\n    {\n        idxArray[x*6+0] = (GLushort)(x * 4 + 0);\n        idxArray[x*6+1] = (GLushort)(x * 4 + 1);\n        idxArray[x*6+2] = (GLushort)(x * 4 + 2);\n        \n        idxArray[x*6+3] = (GLushort)(x * 4 + 1);\n        idxArray[x*6+4] = (GLushort)(x * 4 + 2);\n        idxArray[x*6+5] = (GLushort)(x * 4 + 3);\n    }\n    \n    memcpy(_originalVertices, _vertices, numQuads * 12 * sizeof(GLfloat));\n}\n\nvoid TiledGrid3D::setTile(const Point& pos, const Quad3& coords)\n{\n    CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , \"Numbers must be integers\");\n    int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3;\n    float *vertArray = (float*)_vertices;\n    memcpy(&vertArray[idx], &coords, sizeof(Quad3));\n}\n\nQuad3 TiledGrid3D::getOriginalTile(const Point& pos) const\n{\n    CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , \"Numbers must be integers\");\n    int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3;\n    float *vertArray = (float*)_originalVertices;\n\n    Quad3 ret;\n    memcpy(&ret, &vertArray[idx], sizeof(Quad3));\n\n    return ret;\n}\n\nQuad3 TiledGrid3D::getTile(const Point& pos) const\n{\n    CCASSERT( pos.x == (unsigned int)pos.x && pos.y == (unsigned int) pos.y , \"Numbers must be integers\");\n    int idx = (_gridSize.height * pos.x + pos.y) * 4 * 3;\n    float *vertArray = (float*)_vertices;\n\n    Quad3 ret;\n    memcpy(&ret, &vertArray[idx], sizeof(Quad3));\n\n    return ret;\n}\n\nvoid TiledGrid3D::reuse(void)\n{\n    if (_reuseGrid > 0)\n    {\n        int numQuads = _gridSize.width * _gridSize.height;\n\n        memcpy(_originalVertices, _vertices, numQuads * 12 * sizeof(GLfloat));\n        --_reuseGrid;\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCGrid.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      On-Core\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (C) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __EFFECTS_CCGRID_H__\n#define __EFFECTS_CCGRID_H__\n\n#include \"CCObject.h\"\n#include \"CCNode.h\"\n#include \"ccTypes.h\"\n#include \"CCTexture2D.h\"\n#include \"CCDirector.h\"\n#include \"kazmath/mat4.h\"\n#ifdef EMSCRIPTEN\n#include \"CCGLBufferedNode.h\"\n#endif // EMSCRIPTEN\n\nNS_CC_BEGIN\n\nclass Texture2D;\nclass Grabber;\nclass GLProgram;\n\n/**\n * @addtogroup effects\n * @{\n */\n\n/** Base class for other\n*/\nclass CC_DLL GridBase : public Object\n{\npublic:\n    /** create one Grid */\n    static GridBase* create(const Size& gridSize, Texture2D *texture, bool flipped);\n    /** create one Grid */\n    static GridBase* create(const Size& gridSize);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~GridBase(void);\n\n    bool initWithSize(const Size& gridSize, Texture2D *texture, bool flipped);\n    bool initWithSize(const Size& gridSize);\n\n    /** whether or not the grid is active */\n    inline bool isActive(void) const { return _active; }\n    void setActive(bool active);\n\n    /** number of times that the grid will be reused */\n    inline int getReuseGrid(void) const { return _reuseGrid; }\n    inline void setReuseGrid(int reuseGrid) { _reuseGrid = reuseGrid; }\n\n    /** size of the grid */\n    inline const Size& getGridSize(void) const { return _gridSize; }\n    inline void setGridSize(const Size& gridSize) { _gridSize = gridSize; }\n\n    /** pixels between the grids */\n    inline const Point& getStep(void) const { return _step; }\n    inline void setStep(const Point& step) { _step = step; }\n\n    /** is texture flipped */\n    inline bool isTextureFlipped(void) const { return _isTextureFlipped; }\n    void setTextureFlipped(bool flipped);\n\n    void beforeDraw(void);\n    void afterDraw(Node *target);\n    virtual void blit(void);\n    virtual void reuse(void);\n    virtual void calculateVertexPoints(void);\n\n    void set2DProjection(void);\n\nprotected:\n    bool _active;\n    int  _reuseGrid;\n    Size _gridSize;\n    Texture2D *_texture;\n    Point _step;\n    Grabber *_grabber;\n    bool _isTextureFlipped;\n    GLProgram* _shaderProgram;\n    Director::Projection _directorProjection;\n};\n\n/**\n Grid3D is a 3D grid implementation. Each vertex has 3 dimensions: x,y,z\n */\nclass CC_DLL Grid3D : public GridBase\n#ifdef EMSCRIPTEN\n, public GLBufferedNode\n#endif // EMSCRIPTEN\n{\npublic:\n    /** create one Grid */\n    static Grid3D* create(const Size& gridSize, Texture2D *texture, bool flipped);\n    /** create one Grid */\n    static Grid3D* create(const Size& gridSize);\n    /**\n     * @js ctor\n     */\n    Grid3D();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~Grid3D(void);\n\n    /** returns the vertex at a given position \n     * @js NA\n     * @lua NA\n     */\n    Vertex3F getVertex(const Point& pos) const;\n    /** @deprecated Use getVertex() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Vertex3F vertex(const Point& pos) const { return getVertex(pos); }\n    /** returns the original (non-transformed) vertex at a given position\n     * @js NA\n     * @lua NA\n     */\n    Vertex3F getOriginalVertex(const Point& pos) const;\n    /** @deprecated Use getOriginalVertex() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Vertex3F originalVertex(const Point& pos) const { return getOriginalVertex(pos); }\n\n    /** sets a new vertex at a given position \n     * @js NA\n     * @lua NA\n     */\n    void setVertex(const Point& pos, const Vertex3F& vertex);\n\n    // Overrides\n    virtual void blit() override;\n    virtual void reuse() override;\n    virtual void calculateVertexPoints() override;\n\nprotected:\n    GLvoid *_texCoordinates;\n    GLvoid *_vertices;\n    GLvoid *_originalVertices;\n    GLushort *_indices;\n};\n\n/**\n TiledGrid3D is a 3D grid implementation. It differs from Grid3D in that\n the tiles can be separated from the grid.\n*/\nclass CC_DLL TiledGrid3D : public GridBase\n#ifdef EMSCRIPTEN\n, public GLBufferedNode\n#endif // EMSCRIPTEN\n{\npublic:\n    /** create one Grid */\n    static TiledGrid3D* create(const Size& gridSize, Texture2D *texture, bool flipped);\n    /** create one Grid */\n    static TiledGrid3D* create(const Size& gridSize);\n    /**\n     * @js ctor\n     */\n    TiledGrid3D();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~TiledGrid3D();\n\n    /** returns the tile at the given position \n     * @js NA\n     * @lua NA\n     */\n    Quad3 getTile(const Point& pos) const;\n    /** returns the tile at the given position \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Point& pos) const { return getTile(pos); }\n    /** returns the original tile (untransformed) at the given position \n     * @js NA\n     * @lua NA\n     */\n    Quad3 getOriginalTile(const Point& pos) const;\n    /** returns the original tile (untransformed) at the given position \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Point& pos) const { return getOriginalTile(pos); }\n\n    /** sets a new tile \n     * @js NA\n     * @lua NA\n     */\n    void setTile(const Point& pos, const Quad3& coords);\n\n    // Overrides\n    virtual void blit() override;\n    virtual void reuse() override;\n    virtual void calculateVertexPoints() override;\n\nprotected:\n    GLvoid *_texCoordinates;\n    GLvoid *_vertices;\n    GLvoid *_originalVertices;\n    GLushort *_indices;\n};\n\n// end of effects group\n/// @}\n\nNS_CC_END\n\n#endif // __EFFECTS_CCGRID_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCIMEDelegate.h",
    "content": "/****************************************************************************\nCopyright (c) 2010 cocos2d-x.org\nCopyright (C) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_IME_DELEGATE_H__\n#define __CC_IME_DELEGATE_H__\n\n#include <string>\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN\nextern const std::string STD_STRING_EMPTY;\n\n/**\n * @addtogroup input\n * @{\n */\n\ntypedef struct\n{\n    Rect  begin;              // the soft keyboard rectangle when animation begins\n    Rect  end;                // the soft keyboard rectangle when animation ends\n    float     duration;           // the soft keyboard animation duration\n} IMEKeyboardNotificationInfo;\n\n/**\n@brief    Input method editor delegate.\n*/\nclass CC_DLL IMEDelegate\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~IMEDelegate();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual bool attachWithIME();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual bool detachWithIME();\n\nprotected:\n    friend class IMEDispatcher;\n\n    /**\n    @brief    Decide if the delegate instance is ready to receive an IME message.\n\n    Called by IMEDispatcher.\n    * @js NA\n    * @lua NA\n    */\n    virtual bool canAttachWithIME() { return false; }\n    /**\n    @brief    When the delegate detaches from the IME, this method is called by IMEDispatcher.\n    * @js NA\n    * @lua NA\n    */\n    virtual void didAttachWithIME() {}\n\n    /**\n    @brief    Decide if the delegate instance can stop receiving IME messages.\n    * @js NA\n    * @lua NA\n    */\n    virtual bool canDetachWithIME() { return false; }\n\n    /**\n    @brief    When the delegate detaches from the IME, this method is called by IMEDispatcher.\n    * @js NA\n    * @lua NA\n    */\n    virtual void didDetachWithIME() {}\n\n    /**\n    @brief    Called by IMEDispatcher when text input received from the IME.\n    * @js NA\n    * @lua NA\n    */\n    virtual void insertText(const char * text, int len) {CC_UNUSED_PARAM(text);CC_UNUSED_PARAM(len);}\n\n    /**\n    @brief    Called by IMEDispatcher after the user clicks the backward key.\n    * @js NA\n    * @lua NA\n    */\n    virtual void deleteBackward() {}\n\n    /**\n    @brief    Called by IMEDispatcher for text stored in delegate.\n    * @js NA\n    * @lua NA\n    */\n    virtual const std::string& getContentText() { return STD_STRING_EMPTY; }\n\n    //////////////////////////////////////////////////////////////////////////\n    // keyboard show/hide notification\n    //////////////////////////////////////////////////////////////////////////\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info)   {CC_UNUSED_PARAM(info);}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardDidShow(IMEKeyboardNotificationInfo& info)    {CC_UNUSED_PARAM(info);}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardWillHide(IMEKeyboardNotificationInfo& info)   {CC_UNUSED_PARAM(info);}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardDidHide(IMEKeyboardNotificationInfo& info)    {CC_UNUSED_PARAM(info);}\n\nprotected:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    IMEDelegate();\n};\n\n// end of input group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_IME_DELEGATE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCIMEDispatcher.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010      cocos2d-x.org\nCopyright (C) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCIMEDispatcher.h\"\n\n#include <list>\n\nNS_CC_BEGIN\n\n//////////////////////////////////////////////////////////////////////////\n// add/remove delegate in IMEDelegate Cons/Destructor\n//////////////////////////////////////////////////////////////////////////\n\nIMEDelegate::IMEDelegate()\n{\n    IMEDispatcher::sharedDispatcher()->addDelegate(this);\n}\n\nIMEDelegate::~IMEDelegate()\n{\n    IMEDispatcher::sharedDispatcher()->removeDelegate(this);\n}\n\nbool IMEDelegate::attachWithIME()\n{\n    return IMEDispatcher::sharedDispatcher()->attachDelegateWithIME(this);\n}\n\nbool IMEDelegate::detachWithIME()\n{\n    return IMEDispatcher::sharedDispatcher()->detachDelegateWithIME(this);\n}\n\n//////////////////////////////////////////////////////////////////////////\n\ntypedef std::list< IMEDelegate * > DelegateList;\ntypedef std::list< IMEDelegate * >::iterator  DelegateIter;\n\n//////////////////////////////////////////////////////////////////////////\n// Delegate List manage class\n//////////////////////////////////////////////////////////////////////////\n\nclass IMEDispatcher::Impl\n{\npublic:\n    Impl()\n    {\n    }\n\n    ~Impl()\n    {\n\n    }\n\n    void init()\n    {\n        _delegateWithIme = 0;\n    }\n\n    DelegateIter findDelegate(IMEDelegate* delegate)\n    {\n        DelegateIter end = _delegateList.end();\n        for (DelegateIter iter = _delegateList.begin(); iter != end; ++iter)\n        {\n            if (delegate == *iter)\n            {\n                return iter;\n            }\n        }\n        return end;\n    }\n\n    DelegateList    _delegateList;\n    IMEDelegate*  _delegateWithIme;\n};\n\n//////////////////////////////////////////////////////////////////////////\n// Cons/Destructor\n//////////////////////////////////////////////////////////////////////////\n\nIMEDispatcher::IMEDispatcher()\n: _impl(new IMEDispatcher::Impl)\n{\n    _impl->init();\n}\n\nIMEDispatcher::~IMEDispatcher()\n{\n    CC_SAFE_DELETE(_impl);\n}\n\n//////////////////////////////////////////////////////////////////////////\n// Add/Attach/Remove IMEDelegate\n//////////////////////////////////////////////////////////////////////////\n\nvoid IMEDispatcher::addDelegate(IMEDelegate* delegate)\n{\n    if (! delegate || ! _impl)\n    {\n        return;\n    }\n    if (_impl->_delegateList.end() != _impl->findDelegate(delegate))\n    {\n        // pDelegate already in list\n        return;\n    }\n    _impl->_delegateList.push_front(delegate);\n}\n\nbool IMEDispatcher::attachDelegateWithIME(IMEDelegate * delegate)\n{\n    bool ret = false;\n    do\n    {\n        CC_BREAK_IF(! _impl || ! delegate);\n\n        DelegateIter end  = _impl->_delegateList.end();\n        DelegateIter iter = _impl->findDelegate(delegate);\n\n        // if pDelegate is not in delegate list, return\n        CC_BREAK_IF(end == iter);\n\n        if (_impl->_delegateWithIme)\n        {\n            // if old delegate canDetachWithIME return false \n            // or pDelegate canAttachWithIME return false,\n            // do nothing.\n            CC_BREAK_IF(! _impl->_delegateWithIme->canDetachWithIME()\n                || ! delegate->canAttachWithIME());\n\n            // detach first\n            IMEDelegate * oldDelegate = _impl->_delegateWithIme;\n            _impl->_delegateWithIme = 0;\n            oldDelegate->didDetachWithIME();\n\n            _impl->_delegateWithIme = *iter;\n            delegate->didAttachWithIME();\n            ret = true;\n            break;\n        }\n\n        // delegate hasn't attached to IME yet\n        CC_BREAK_IF(! delegate->canAttachWithIME());\n\n        _impl->_delegateWithIme = *iter;\n        delegate->didAttachWithIME();\n        ret = true;\n    } while (0);\n    return ret;\n}\n\nbool IMEDispatcher::detachDelegateWithIME(IMEDelegate * delegate)\n{\n    bool ret = false;\n    do\n    {\n        CC_BREAK_IF(! _impl || ! delegate);\n\n        // if pDelegate is not the current delegate attached to IME, return\n        CC_BREAK_IF(_impl->_delegateWithIme != delegate);\n\n        CC_BREAK_IF(! delegate->canDetachWithIME());\n\n        _impl->_delegateWithIme = 0;\n        delegate->didDetachWithIME();\n        ret = true;\n    } while (0);\n    return ret;\n}\n\nvoid IMEDispatcher::removeDelegate(IMEDelegate* delegate)\n{\n    do \n    {\n        CC_BREAK_IF(! delegate || ! _impl);\n\n        DelegateIter iter = _impl->findDelegate(delegate);\n        DelegateIter end  = _impl->_delegateList.end();\n        CC_BREAK_IF(end == iter);\n\n        if (_impl->_delegateWithIme)\n\n        if (*iter == _impl->_delegateWithIme)\n        {\n            _impl->_delegateWithIme = 0;\n        }\n        _impl->_delegateList.erase(iter);\n    } while (0);\n}\n\n//////////////////////////////////////////////////////////////////////////\n// dispatch text message\n//////////////////////////////////////////////////////////////////////////\n\nvoid IMEDispatcher::dispatchInsertText(const char * text, int len)\n{\n    do \n    {\n        CC_BREAK_IF(! _impl || ! text || len <= 0);\n\n        // there is no delegate attached to IME\n        CC_BREAK_IF(! _impl->_delegateWithIme);\n\n        _impl->_delegateWithIme->insertText(text, len);\n    } while (0);\n}\n\nvoid IMEDispatcher::dispatchDeleteBackward()\n{\n    do \n    {\n        CC_BREAK_IF(! _impl);\n\n        // there is no delegate attached to IME\n        CC_BREAK_IF(! _impl->_delegateWithIme);\n\n        _impl->_delegateWithIme->deleteBackward();\n    } while (0);\n}\n\nconst std::string& IMEDispatcher::getContentText()\n{\n    if (_impl && _impl->_delegateWithIme)\n    {\n        return _impl->_delegateWithIme->getContentText();\n    }\n    return STD_STRING_EMPTY;\n}\n\n//////////////////////////////////////////////////////////////////////////\n// dispatch keyboard message\n//////////////////////////////////////////////////////////////////////////\n\nvoid IMEDispatcher::dispatchKeyboardWillShow(IMEKeyboardNotificationInfo& info)\n{\n    if (_impl)\n    {\n        IMEDelegate * delegate = 0;\n        DelegateIter last = _impl->_delegateList.end();\n        for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first)\n        {\n            delegate = *(first);\n            if (delegate)\n            {\n                delegate->keyboardWillShow(info);\n            }\n        }\n    }\n}\n\nvoid IMEDispatcher::dispatchKeyboardDidShow(IMEKeyboardNotificationInfo& info)\n{\n    if (_impl)\n    {\n        IMEDelegate * delegate = 0;\n        DelegateIter last = _impl->_delegateList.end();\n        for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first)\n        {\n            delegate = *(first);\n            if (delegate)\n            {\n                delegate->keyboardDidShow(info);\n            }\n        }\n    }\n}\n\nvoid IMEDispatcher::dispatchKeyboardWillHide(IMEKeyboardNotificationInfo& info)\n{\n    if (_impl)\n    {\n        IMEDelegate * delegate = 0;\n        DelegateIter last = _impl->_delegateList.end();\n        for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first)\n        {\n            delegate = *(first);\n            if (delegate)\n            {\n                delegate->keyboardWillHide(info);\n            }\n        }\n    }\n}\n\nvoid IMEDispatcher::dispatchKeyboardDidHide(IMEKeyboardNotificationInfo& info)\n{\n    if (_impl)\n    {\n        IMEDelegate * delegate = 0;\n        DelegateIter last = _impl->_delegateList.end();\n        for (DelegateIter first = _impl->_delegateList.begin(); first != last; ++first)\n        {\n            delegate = *(first);\n            if (delegate)\n            {\n                delegate->keyboardDidHide(info);\n            }\n        }\n    }\n}\n\n//////////////////////////////////////////////////////////////////////////\n// protected member function\n//////////////////////////////////////////////////////////////////////////\n\n\n//////////////////////////////////////////////////////////////////////////\n// static member function\n//////////////////////////////////////////////////////////////////////////\n\nIMEDispatcher* IMEDispatcher::sharedDispatcher()\n{\n    static IMEDispatcher s_instance;\n    return &s_instance;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCIMEDispatcher.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_IME_DISPATCHER_H__\n#define __CC_IME_DISPATCHER_H__\n\n#include \"CCIMEDelegate.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup input\n * @{\n */\n\n/**\n@brief    Input Method Edit Message Dispatcher.\n*/\nclass CC_DLL IMEDispatcher\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~IMEDispatcher();\n\n    /**\n     @brief Returns the shared IMEDispatcher object for the system.\n     * @js NA\n     * @lua NA\n     */\n    static IMEDispatcher* sharedDispatcher();\n\n//     /**\n//     @brief Releases all IMEDelegates from the shared dispatcher.\n//     */\n//     static void purgeSharedDispatcher();\n\n    /**\n     @brief Dispatches the input text from IME.\n     * @js NA\n     * @lua NA\n     */\n    void dispatchInsertText(const char * text, int len);\n\n    /**\n     @brief Dispatches the delete-backward operation.\n     * @js NA\n     * @lua NA\n     */\n    void dispatchDeleteBackward();\n\n    /**\n     @brief Get the content text from IMEDelegate, retrieved previously from IME.\n     * @js NA\n     * @lua NA\n     */\n    const std::string& getContentText();\n\n    //////////////////////////////////////////////////////////////////////////\n    // dispatch keyboard notification\n    //////////////////////////////////////////////////////////////////////////\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void dispatchKeyboardWillShow(IMEKeyboardNotificationInfo& info);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void dispatchKeyboardDidShow(IMEKeyboardNotificationInfo& info);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void dispatchKeyboardWillHide(IMEKeyboardNotificationInfo& info);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void dispatchKeyboardDidHide(IMEKeyboardNotificationInfo& info);\n\nprotected:\n    friend class IMEDelegate;\n\n    /**\n    @brief Add delegate to receive IME messages.\n    */\n    void addDelegate(IMEDelegate * delegate);\n\n    /**\n    @brief Attach the pDelegate to the IME.\n    @return If the old delegate can detach from the IME, and the new delegate \n            can attach to the IME, return true, otherwise false.\n    */\n    bool attachDelegateWithIME(IMEDelegate * delegate);\n    bool detachDelegateWithIME(IMEDelegate * delegate);\n\n    /**\n    @brief Remove the delegate from the delegates which receive IME messages.\n    */\n    void removeDelegate(IMEDelegate * delegate);\n\nprivate:\n    IMEDispatcher();\n    \n    class Impl;\n    Impl * _impl;\n};\n\n// end of input group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_IME_DISPATCHER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabel.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCLabel.h\"\n#include \"CCFontAtlasCache.h\"\n#include \"CCLabelTextFormatter.h\"\n#include \"CCSprite.h\"\n#include \"CCShaderCache.h\"\n#include \"ccUTF8.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCDirector.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"CCFont.h\"\n\n#define DISTANCEFIELD_ATLAS_FONTSIZE 50\n\nNS_CC_BEGIN\n\nLabel* Label::create()\n{\n    Label *ret = new Label();\n\n    if (!ret)\n        return nullptr;\n\n    ret->autorelease();\n\n    return ret;\n}\n\nLabel* Label::createWithTTF(const TTFConfig& ttfConfig, const std::string& text, TextHAlignment alignment /* = TextHAlignment::CENTER */, int lineSize /* = 0 */)\n{\n    Label *ret = new Label(nullptr,alignment);\n\n    if (!ret)\n        return nullptr;\n      \n    if (ret->setTTFConfig(ttfConfig))\n    {\n        if(ttfConfig.distanceFieldEnabled)\n            ret->setFontSize(ttfConfig.fontSize);\n        ret->setWidth(lineSize);\n        ret->setString(text);\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        delete ret;\n        return nullptr;\n    }\n}\n\nLabel* Label::createWithTTF(const std::string& text, const std::string& fontFilePath, int fontSize, int lineSize /* = 0 */, TextHAlignment alignment /* = TextHAlignment::CENTER */, GlyphCollection glyphs /* = GlyphCollection::NEHE */, const char *customGlyphs /* = 0 */, bool useDistanceField /* = false */)\n{\n    TTFConfig ttfConfig(fontFilePath.c_str(),fontSize,glyphs,customGlyphs,useDistanceField);\n    return createWithTTF(ttfConfig,text,alignment,lineSize);\n}\n\nLabel* Label::createWithBMFont(const std::string& bmfontFilePath, const std::string& text,const TextHAlignment& alignment /* = TextHAlignment::CENTER */, int lineSize /* = 0 */)\n{\n    Label *ret = new Label(nullptr,alignment);\n\n    if (!ret)\n        return nullptr;\n\n    if (ret->setBMFontFilePath(bmfontFilePath))\n    {\n        ret->setWidth(lineSize);\n        ret->setString(text);\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        delete ret;\n        return nullptr;\n    }\n}\n\nLabel* Label::createWithCharMap(const std::string& plistFile)\n{\n    Label *ret = new Label();\n\n    if (!ret)\n        return nullptr;\n\n    if (ret->setCharMap(plistFile))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        delete ret;\n        return nullptr;\n    }\n}\n\nLabel* Label::createWithCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap)\n{\n    Label *ret = new Label();\n\n    if (!ret)\n        return nullptr;\n\n    if (ret->setCharMap(texture,itemWidth,itemHeight,startCharMap))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        delete ret;\n        return nullptr;\n    }\n}\n\nLabel* Label::createWithCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)\n{\n    Label *ret = new Label();\n\n    if (!ret)\n        return nullptr;\n\n    if (ret->setCharMap(charMapFile,itemWidth,itemHeight,startCharMap))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        delete ret;\n        return nullptr;\n    }\n}\n\nbool Label::setCharMap(const std::string& plistFile)\n{\n    FontAtlas *newAtlas = FontAtlasCache::getFontAtlasCharMap(plistFile);\n\n    if (!newAtlas)\n        return false;\n\n    return initWithFontAtlas(newAtlas);\n}\n\nbool Label::setCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap)\n{\n    FontAtlas *newAtlas = FontAtlasCache::getFontAtlasCharMap(texture,itemWidth,itemHeight,startCharMap);\n\n    if (!newAtlas)\n        return false;\n\n    return initWithFontAtlas(newAtlas);\n}\n\nbool Label::setCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)\n{\n    FontAtlas *newAtlas = FontAtlasCache::getFontAtlasCharMap(charMapFile,itemWidth,itemHeight,startCharMap);\n\n    if (!newAtlas)\n        return false;\n\n    return initWithFontAtlas(newAtlas);\n}\n\nLabel::Label(FontAtlas *atlas, TextHAlignment alignment, bool useDistanceField,bool useA8Shader)\n: _reusedLetter(nullptr)\n, _commonLineHeight(0.0f)\n, _lineBreakWithoutSpaces(false)\n, _width(0.0f)\n, _alignment(alignment)\n, _currentUTF16String(nullptr)\n, _originalUTF16String(nullptr)\n, _horizontalKernings(nullptr)\n, _fontAtlas(atlas)\n, _isOpacityModifyRGB(false)\n, _useDistanceField(useDistanceField)\n, _useA8Shader(useA8Shader)\n, _fontSize(0)\n, _uniformEffectColor(0)\n{\n    _cascadeColorEnabled = true;\n}\n\nLabel::~Label()\n{   \n    delete [] _currentUTF16String;\n    delete [] _originalUTF16String;\n    delete [] _horizontalKernings;\n    \n    if (_fontAtlas)\n        FontAtlasCache::releaseFontAtlas(_fontAtlas);\n\n    _reusedLetter->release();\n}\n\nbool Label::init()\n{ \n    bool ret = true;\n    if(_fontAtlas)\n    {\n        if (_reusedLetter == nullptr)\n        {\n            _reusedLetter = Sprite::createWithTexture(&_fontAtlas->getTexture(0));\n            _reusedLetter->setOpacityModifyRGB(_isOpacityModifyRGB);            \n            _reusedLetter->retain();\n            _reusedLetter->setAnchorPoint(Point::ANCHOR_TOP_LEFT);\n        }\n       ret = SpriteBatchNode::initWithTexture(&_fontAtlas->getTexture(0), 30);\n    }\n    if (_useDistanceField)\n        setLabelEffect(LabelEffect::NORMAL,Color3B::BLACK);\n    else if(_useA8Shader)\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR));\n    else\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n\n    return ret;\n}\n\nbool Label::initWithFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false */, bool useA8Shader /* = false */)\n{\n    FontAtlas *oldAtlas = _fontAtlas;\n    bool oldDistanceFieldEnable = _useDistanceField;\n    bool oldA8ShaderEnabel = _useA8Shader;\n\n    _fontAtlas = atlas;\n    _useDistanceField = distanceFieldEnabled;\n    _useA8Shader = useA8Shader;\n\n    bool ret = Label::init();\n    if (oldAtlas)\n    {\n        if (ret)\n        {\n            FontAtlasCache::releaseFontAtlas(oldAtlas);        \n        }\n        else\n        {\n            _fontAtlas = oldAtlas;\n            _useDistanceField = oldDistanceFieldEnable;\n            _useA8Shader = oldA8ShaderEnabel;\n            Label::init();\n\n            FontAtlasCache::releaseFontAtlas(atlas);\n        }\n    }\n\n    if (_fontAtlas)\n    {\n        _commonLineHeight = _fontAtlas->getCommonLineHeight();\n        if(_currentUTF16String)\n        {\n            resetCurrentString();\n            alignText();\n        }\n    }\n\n    return ret;\n}\n\nbool Label::setTTFConfig(const TTFConfig& ttfConfig)\n{\n    FontAtlas *newAtlas = nullptr;\n    if(ttfConfig.distanceFieldEnabled)\n        newAtlas = FontAtlasCache::getFontAtlasTTF(ttfConfig.fontFilePath, DISTANCEFIELD_ATLAS_FONTSIZE, ttfConfig.glyphs, ttfConfig.customGlyphs,true);\n    else\n        newAtlas = FontAtlasCache::getFontAtlasTTF(ttfConfig.fontFilePath, ttfConfig.fontSize, ttfConfig.glyphs, ttfConfig.customGlyphs,false);\n\n    if (!newAtlas)\n        return false;\n\n    return initWithFontAtlas(newAtlas,ttfConfig.distanceFieldEnabled,true);\n}\n\nbool Label::setBMFontFilePath(const std::string& bmfontFilePath)\n{\n    FontAtlas *newAtlas = FontAtlasCache::getFontAtlasFNT(bmfontFilePath);\n\n    if (!newAtlas)\n        return false;\n\n    return initWithFontAtlas(newAtlas);\n}\n\nvoid Label::setString(const std::string& text)\n{\n    if (!_fontAtlas || _commonLineHeight <= 0)\n        return ;\n    \n    unsigned short* utf16String = cc_utf8_to_utf16(text.c_str());\n    if(!utf16String)\n        return ;\n    _originalUTF8String = text;\n    setCurrentString(utf16String);\n    setOriginalString(utf16String);\n    \n    // align text\n    alignText();\n}\n\nvoid Label::setAlignment(TextHAlignment alignment)\n{\n    // store the new alignment\n    if (alignment != _alignment)\n    {\n        // store\n        _alignment = alignment;\n        \n        if (_currentUTF16String)\n        {\n            // reset the string\n            resetCurrentString();\n\n            // need to align text again\n            alignText();\n        }\n    }\n}\n\nvoid Label::setWidth(float width)\n{\n    if (width != _width)\n    {\n        // store\n        _width = width;\n        \n        if (_currentUTF16String)\n        {\n            // reset the string\n            resetCurrentString();\n\n            // need to align text again\n            alignText();\n        }\n    }\n}\n\nvoid Label::setLineBreakWithoutSpace(bool breakWithoutSpace)\n{\n    if (breakWithoutSpace != _lineBreakWithoutSpaces)\n    {\n        // store\n        _lineBreakWithoutSpaces = breakWithoutSpace;\n        \n        // need to align text again\n        if(_currentUTF16String)\n        {\n            resetCurrentString();\n            alignText();\n        }\n    }\n}\n\nvoid Label::setScale(float scale)\n{\n    if (_useDistanceField)\n    {\n        scale *= 1.0f * _fontSize / DISTANCEFIELD_ATLAS_FONTSIZE;\n    } \n    Node::setScale(scale);\n}\n\nvoid Label::setScaleX(float scaleX)\n{\n    if (_useDistanceField)\n    {\n        scaleX *= 1.0f * _fontSize / DISTANCEFIELD_ATLAS_FONTSIZE;\n    } \n    Node::setScaleX(scaleX);\n}\n\nvoid Label::setScaleY(float scaleY)\n{\n    if (_useDistanceField)\n    {\n        scaleY *= 1.0f * _fontSize / DISTANCEFIELD_ATLAS_FONTSIZE;\n    } \n    Node::setScaleY(scaleY);\n}\n\nfloat Label::getScaleY() const\n{\n    if (_useDistanceField)\n    {\n        return _scaleY / (1.0f * _fontSize / DISTANCEFIELD_ATLAS_FONTSIZE);\n    }\n    else\n    {\n        return _scaleY;\n    }\n}\n\nfloat Label::getScaleX() const\n{\n    if (_useDistanceField)\n    {\n        return _scaleX / (1.0f * _fontSize / DISTANCEFIELD_ATLAS_FONTSIZE);\n    }\n    else\n    {\n        return _scaleX;\n    }\n}\n\nvoid Label::alignText()\n{\n    if(_textureAtlas)\n        _textureAtlas->removeAllQuads();  \n    _fontAtlas->prepareLetterDefinitions(_currentUTF16String);\n    LabelTextFormatter::createStringSprites(this);    \n    if(_width > 0 && LabelTextFormatter::multilineText(this) )      \n        LabelTextFormatter::createStringSprites(this);\n    \n    LabelTextFormatter::alignText(this);\n  \n    int strLen = cc_wcslen(_currentUTF16String);\n    for(const auto &child : _children) {\n        int tag = child->getTag();\n        if(tag < 0 || tag >= strLen)\n            SpriteBatchNode::removeChild(child, true);\n    }\n\n    _reusedLetter->setBatchNode(nullptr);\n   \n    int vaildIndex = 0;\n    Sprite* child = nullptr;\n    Rect uvRect;\n    for (int ctr = 0; ctr < strLen; ++ctr)\n    {        \n        if (_lettersInfo[ctr].def.validDefinition)\n        {\n            child = static_cast<Sprite*>( this->getChildByTag(ctr) );\n            if (child)\n            {\n                uvRect.size.height = _lettersInfo[ctr].def.height;\n                uvRect.size.width  = _lettersInfo[ctr].def.width;\n                uvRect.origin.x    = _lettersInfo[ctr].def.U;\n                uvRect.origin.y    = _lettersInfo[ctr].def.V;\n\n                child->setTexture(&_fontAtlas->getTexture(_lettersInfo[ctr].def.textureID));\n                child->setTextureRect(uvRect);              \n            }\n           \n            updateSpriteWithLetterDefinition(_reusedLetter,_lettersInfo[ctr].def,&_fontAtlas->getTexture(_lettersInfo[ctr].def.textureID));\n            _reusedLetter->setPosition(_lettersInfo[ctr].position);\n            insertQuadFromSprite(_reusedLetter,vaildIndex++);\n        }     \n    }\n\n    updateColor();\n}\n\nbool Label::computeHorizontalKernings(unsigned short int *stringToRender)\n{\n    if (_horizontalKernings)\n    {\n        delete [] _horizontalKernings;\n        _horizontalKernings = 0;\n    }\n    \n    int letterCount = 0;\n    _horizontalKernings = _fontAtlas->getFont()->getHorizontalKerningForTextUTF16(stringToRender, letterCount);\n    \n    if(!_horizontalKernings)\n        return false;\n    else\n        return true;\n}\n\nbool Label::setOriginalString(unsigned short *stringToSet)\n{\n    if (_originalUTF16String)\n    {\n        delete [] _originalUTF16String;\n        _originalUTF16String = 0;\n    }\n    \n    int newStringLenght = cc_wcslen(stringToSet);\n    _originalUTF16String = new unsigned short int [newStringLenght + 1];\n    memset(_originalUTF16String, 0, (newStringLenght + 1) * 2);\n    memcpy(_originalUTF16String, stringToSet, (newStringLenght * 2));\n    _originalUTF16String[newStringLenght] = 0;\n    \n    return true;\n}\n\nbool Label::setCurrentString(unsigned short *stringToSet)\n{\n    // set the new string\n    if (_currentUTF16String)\n    {\n        delete [] _currentUTF16String;\n        _currentUTF16String = 0;\n    }\n    //\n    _currentUTF16String  = stringToSet;\n    // compute the advances\n    return computeHorizontalKernings(stringToSet);\n}\n\nvoid Label::resetCurrentString()\n{\n    if ((!_currentUTF16String) && (!_originalUTF16String))\n        return;\n    \n    // set the new string\n    if (_currentUTF16String)\n    {\n        delete [] _currentUTF16String;\n        _currentUTF16String = 0;\n    }\n    \n    int stringLenght = cc_wcslen(_originalUTF16String);\n    _currentUTF16String = new unsigned short int [stringLenght + 1];\n    memcpy(_currentUTF16String, _originalUTF16String, stringLenght * 2);\n    _currentUTF16String[stringLenght] = 0;\n    \n}\n\nSprite * Label::updateSpriteWithLetterDefinition(Sprite *spriteToUpdate, const FontLetterDefinition &theDefinition, Texture2D *theTexture)\n{\n    if (!spriteToUpdate)\n    {\n        return 0;\n    }\n    else\n    {\n        Rect uvRect;\n        uvRect.size.height = theDefinition.height;\n        uvRect.size.width  = theDefinition.width;\n        uvRect.origin.x    = theDefinition.U;\n        uvRect.origin.y    = theDefinition.V;\n        \n        SpriteFrame *frame = SpriteFrame::createWithTexture(theTexture, uvRect);\n        if (frame)\n        {\n            spriteToUpdate->setBatchNode(this);\n            spriteToUpdate->setSpriteFrame(frame);                                       \n        }     \n        \n        return spriteToUpdate;\n    }\n}\n\nbool Label::recordLetterInfo(const cocos2d::Point& point,unsigned short int theChar, int spriteIndex)\n{\n    if (static_cast<std::size_t>(spriteIndex) >= _lettersInfo.size())\n    {\n        LetterInfo tmpInfo;\n        _lettersInfo.push_back(tmpInfo);\n    }    \n       \n    _fontAtlas->getLetterDefinitionForChar(theChar, _lettersInfo[spriteIndex].def);\n    _lettersInfo[spriteIndex].position = point;\n    _lettersInfo[spriteIndex].contentSize.width = _lettersInfo[spriteIndex].def.width;\n    _lettersInfo[spriteIndex].contentSize.height = _lettersInfo[spriteIndex].def.height;\n\n    return _lettersInfo[spriteIndex].def.validDefinition;\n}\n\nbool Label::recordPlaceholderInfo(int spriteIndex)\n{\n    if (static_cast<std::size_t>(spriteIndex) >= _lettersInfo.size())\n    {\n        LetterInfo tmpInfo;\n        _lettersInfo.push_back(tmpInfo);\n    }\n\n    _lettersInfo[spriteIndex].def.validDefinition = false;\n    \n    return false;\n}\n\nvoid Label::addChild(Node * child, int zOrder/* =0 */, int tag/* =0 */)\n{\n    CCASSERT(0, \"addChild: is not supported on Label.\");\n}\n\nvoid Label::setLabelEffect(LabelEffect effect,const Color3B& effectColor)\n{\n    if(_useDistanceField == false)\n        return;\n\n    _currLabelEffect = effect;\n    _effectColor = effectColor;\n\n    switch (_currLabelEffect)\n    {\n    case cocos2d::LabelEffect::NORMAL:  \n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL));\n        break;\n    case cocos2d::LabelEffect::OUTLINE:\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_OUTLINE));\n        break;\n    case cocos2d::LabelEffect::SHADOW:\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_SHADOW));\n        break;\n    case cocos2d::LabelEffect::GLOW:\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW));\n        break;\n    default:\n        return;\n    }\n\n    _uniformEffectColor = glGetUniformLocation(_shaderProgram->getProgram(), \"v_effectColor\");\n}\n\nvoid Label::setFontSize(int fontSize)\n{\n    _fontSize = fontSize;\n    Node::setScale(1.0f*_fontSize/DISTANCEFIELD_ATLAS_FONTSIZE);\n}\n\nvoid Label::onDraw()\n{\n    CC_PROFILER_START(\"CCSpriteBatchNode - draw\");\n\n    // Optimization: Fast Dispatch\n    if( _textureAtlas->getTotalQuads() == 0 )\n    {\n        return;\n    }\n\n    CC_NODE_DRAW_SETUP();\n\n    if (_useDistanceField && _currLabelEffect != LabelEffect::NORMAL)\n    {\n        _shaderProgram->setUniformLocationWith3f(_uniformEffectColor, _effectColor.r/255.0f,_effectColor.g/255.0f,_effectColor.b/255.0f);\n    }\n\n    for(const auto &child: _children)\n        child->updateTransform();\n\n    GL::blendFunc( _blendFunc.src, _blendFunc.dst );\n\n    _textureAtlas->drawQuads();\n\n    CC_PROFILER_STOP(\"CCSpriteBatchNode - draw\");\n}\n\nvoid Label::draw()\n{\n    _customCommand.init(_globalZOrder);\n    _customCommand.func = CC_CALLBACK_0(Label::onDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_customCommand);\n}\n\n///// PROTOCOL STUFF\n\nSprite * Label::getLetter(int ID)\n{\n    if (ID < getStringLenght())\n    {       \n        if(_lettersInfo[ID].def.validDefinition == false)\n            return nullptr;\n       \n        Sprite* sp = static_cast<Sprite*>(this->getChildByTag(ID));\n\n        if (!sp)\n        {\n            Rect uvRect;\n            uvRect.size.height = _lettersInfo[ID].def.height;\n            uvRect.size.width  = _lettersInfo[ID].def.width;\n            uvRect.origin.x    = _lettersInfo[ID].def.U;\n            uvRect.origin.y    = _lettersInfo[ID].def.V;\n\n            sp = Sprite::createWithTexture(&_fontAtlas->getTexture(_lettersInfo[ID].def.textureID),uvRect);\n            sp->setBatchNode(this);\n            sp->setAnchorPoint(Point::ANCHOR_MIDDLE);\n            sp->setPosition(Point(_lettersInfo[ID].position.x+uvRect.size.width/2,_lettersInfo[ID].position.y-uvRect.size.height/2));\n            sp->setOpacity(_realOpacity);\n         \n            this->addSpriteWithoutQuad(sp, ID, ID);\n        }\n        return sp;\n    }\n    \n    return nullptr;\n}\n\nint Label::getCommonLineHeight() const\n{\n    return _commonLineHeight;\n}\n\n// string related stuff\nint Label::getStringNumLines() const\n{\n    int quantityOfLines = 1;\n    \n    unsigned int stringLen = _currentUTF16String ? cc_wcslen(_currentUTF16String) : -1;\n    if (stringLen < 1)\n        return stringLen;\n    if (stringLen == 0)\n        return (-1);\n    \n    // count number of lines\n    for (unsigned int i = 0; i < stringLen - 1; ++i)\n    {\n        unsigned short c = _currentUTF16String[i];\n        if (c == '\\n')\n        {\n            quantityOfLines++;\n        }\n    }\n    \n    return quantityOfLines;\n}\n\nint Label::getStringLenght() const\n{\n    return _currentUTF16String ? cc_wcslen(_currentUTF16String) : 0;\n}\n\nunsigned short * Label::getUTF16String() const\n{\n    return _currentUTF16String;\n}\n\nvoid Label::assignNewUTF16String(unsigned short *newString)\n{\n    setCurrentString(newString);\n}\n\nTextHAlignment Label::getTextAlignment() const\n{\n    return _alignment;\n}\n\n// label related stuff\nfloat Label::getMaxLineWidth() const\n{\n    return _width;\n}\n\nbool Label::breakLineWithoutSpace() const\n{\n    return _lineBreakWithoutSpaces;\n}\n\n// RGBA protocol\n\n\nbool Label::isOpacityModifyRGB() const\n{\n    return _isOpacityModifyRGB;\n}\n\nvoid Label::setOpacityModifyRGB(bool isOpacityModifyRGB)\n{\n    _isOpacityModifyRGB = isOpacityModifyRGB;\n    \n    for(const auto& child: _children) {\n        child->setOpacityModifyRGB(_isOpacityModifyRGB);\n    }\n\n    _reusedLetter->setOpacityModifyRGB(true);\n}\n\nvoid Label::setColor(const Color3B& color)\n{\n\t_reusedLetter->setColor(color);\n    SpriteBatchNode::setColor(color);\n}\n\nvoid Label::updateColor()\n{\n    V3F_C4B_T2F_Quad *quads = _textureAtlas->getQuads();\n    auto count = _textureAtlas->getTotalQuads();\n    Color4B color4( _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity );\n    \n    // special opacity for premultiplied textures\n    if (_isOpacityModifyRGB)\n    {\n        color4.r *= _displayedOpacity/255.0f;\n        color4.g *= _displayedOpacity/255.0f;\n        color4.b *= _displayedOpacity/255.0f;\n    }\n    for (int index=0; index<count; ++index)\n    {\n        quads[index].bl.colors = color4;\n        quads[index].br.colors = color4;\n        quads[index].tl.colors = color4;\n        quads[index].tr.colors = color4;\n        _textureAtlas->updateQuad(&quads[index], index);\n    }\n}\n\nstd::string Label::getDescription() const\n{\n    return StringUtils::format(\"<Label | Tag = %d, Label = '%s'>\", _tag, cc_utf16_to_utf8(_currentUTF16String,-1,nullptr,nullptr));\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabel.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef _COCOS2D_CCLABEL_H_\n#define _COCOS2D_CCLABEL_H_\n\n#include \"CCSpriteBatchNode.h\"\n#include \"ccTypes.h\"\n#include \"renderer/CCCustomCommand.h\"\n#include \"CCFontAtlas.h\"\n\nNS_CC_BEGIN\n\nenum class GlyphCollection {\n    \n    DYNAMIC,\n    NEHE,\n    ASCII,\n    CUSTOM\n};\n\nenum class LabelEffect {\n\n    NORMAL,\n    OUTLINE,\n    SHADOW,\n    GLOW\n};\n\nstruct LetterInfo\n{\n    FontLetterDefinition def;\n\n    Point position;\n    Size  contentSize;\n};\n\ntypedef struct _ttfConfig\n{\n    std::string fontFilePath;\n    int fontSize;\n    GlyphCollection glyphs;\n    const char *customGlyphs;\n    bool distanceFieldEnabled;\n\n    _ttfConfig(const char* filePath,int size = 36, const GlyphCollection& glyphCollection = GlyphCollection::NEHE,\n        const char *customGlyphCollection = nullptr,bool useDistanceField = false)\n        :fontFilePath(filePath)\n        ,fontSize(size)\n        ,glyphs(glyphCollection)\n        ,customGlyphs(customGlyphCollection)\n        ,distanceFieldEnabled(useDistanceField)\n    {}\n}TTFConfig;\n\nclass CC_DLL Label : public SpriteBatchNode, public LabelProtocol\n{\npublic:\n    static Label* create();\n\n    CC_DEPRECATED_ATTRIBUTE static Label* createWithTTF(const std::string& label, const std::string& fontFilePath, int fontSize, int lineSize = 0, TextHAlignment alignment = TextHAlignment::LEFT, GlyphCollection glyphs = GlyphCollection::NEHE, const char *customGlyphs = 0, bool useDistanceField = false);\n    static Label* createWithTTF(const TTFConfig& ttfConfig, const std::string& text, TextHAlignment alignment = TextHAlignment::LEFT, int lineWidth = 0);\n    \n    static Label* createWithBMFont(const std::string& bmfontFilePath, const std::string& text,const TextHAlignment& alignment = TextHAlignment::LEFT, int lineWidth = 0);\n    \n    static Label * createWithCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap);\n    static Label * createWithCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap);\n    static Label * createWithCharMap(const std::string& plistFile);\n\n    bool setTTFConfig(const TTFConfig& ttfConfig);\n\n    bool setBMFontFilePath(const std::string& bmfontFilePath);\n\n    bool setCharMap(const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap);\n    bool setCharMap(Texture2D* texture, int itemWidth, int itemHeight, int startCharMap);\n    bool setCharMap(const std::string& plistFile);\n\n    virtual void setString(const std::string& text) override;\n\n    //only support for TTF\n    void setLabelEffect(LabelEffect effect,const Color3B& effectColor);\n    \n    virtual void setAlignment(TextHAlignment alignment);\n    virtual void setWidth(float width);\n    virtual void setLineBreakWithoutSpace(bool breakWithoutSpace);\n    virtual void setScale(float scale) override;\n    virtual void setScaleX(float scaleX) override;\n    virtual void setScaleY(float scaleY) override;\n    virtual float getScaleX() const;\n    virtual float getScaleY() const;\n\n    virtual bool isOpacityModifyRGB() const override;\n    virtual void setOpacityModifyRGB(bool isOpacityModifyRGB) override;\n    virtual void setColor(const Color3B& color) override;\n    \n     // CCLabelTextFormat protocol implementation\n    virtual std::vector<LetterInfo>     *getLettersInfo() { return &_lettersInfo; };\n    virtual bool recordLetterInfo(const cocos2d::Point& point,unsigned short int theChar, int spriteIndex);\n    virtual bool recordPlaceholderInfo(int spriteIndex);\n\n    virtual Sprite * getLetter(int ID);\n    \n    // font related stuff\n    virtual int getCommonLineHeight() const;\n    virtual int* getKernings() const { return _horizontalKernings;}\n    \n    // string related stuff\n    virtual int getStringNumLines() const;\n    virtual int getStringLenght() const;\n    virtual unsigned short * getUTF16String() const;\n    virtual void assignNewUTF16String(unsigned short *newString);\n    virtual TextHAlignment getTextAlignment() const;\n    \n    // label related stuff\n    virtual float getMaxLineWidth() const;\n    virtual bool breakLineWithoutSpace() const;\n    \n    // carloX\n    virtual const std::string& getString() const override {  return _originalUTF8String; }\n    void addChild(Node * child, int zOrder=0, int tag=0) override;\n\n    virtual std::string getDescription() const override;\n    virtual void draw(void) override;\n    virtual void onDraw();\n\n    virtual FontAtlas* getFontAtlas() const {return _fontAtlas;}\n\nprivate:\n    /**\n     * @js NA\n     */\n    Label(FontAtlas *atlas = nullptr, TextHAlignment alignment = TextHAlignment::LEFT, bool useDistanceField = false,bool useA8Shader = false);\n    /**\n     * @js NA\n     * @lua NA\n     */\n   ~Label();\n    \n   bool initWithFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled = false, bool useA8Shader = false);\n\n    void setFontSize(int fontSize);\n    \n    bool init();\n    \n    void alignText();   \n    \n    bool computeHorizontalKernings(unsigned short int *stringToRender);\n    bool setCurrentString(unsigned short *stringToSet);\n    bool setOriginalString(unsigned short *stringToSet);\n    void resetCurrentString();\n\n    Sprite * updateSpriteWithLetterDefinition(Sprite *spriteToUpdate, const FontLetterDefinition &theDefinition, Texture2D *theTexture);\n\n    virtual void updateColor() override;\n\n    //! used for optimization\n    Sprite *_reusedLetter;\n    std::vector<LetterInfo> _lettersInfo;\n\n    float _commonLineHeight;\n    bool _lineBreakWithoutSpaces;\n    float _width;\n    TextHAlignment _alignment;\n    unsigned short int * _currentUTF16String;\n    unsigned short int * _originalUTF16String;\n    std::string          _originalUTF8String;\n    int * _horizontalKernings;\n    FontAtlas * _fontAtlas;\n    bool _isOpacityModifyRGB;\n\n    bool _useDistanceField;\n    bool _useA8Shader;\n    int _fontSize;\n\n    LabelEffect _currLabelEffect;\n    Color3B _effectColor;\n\n    GLuint _uniformEffectColor;\n\n    CustomCommand _customCommand;\n};\n\n\nNS_CC_END\n\n#endif /*__COCOS2D_CCLABEL_H */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelAtlas.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCLabelAtlas.h\"\n#include \"CCTextureAtlas.h\"\n#include \"CCTextureCache.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"ccConfig.h\"\n#include \"CCShaderCache.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCDirector.h\"\n#include \"TransformUtils.h\"\n#include \"CCInteger.h\"\n#include \"platform/CCFileUtils.h\"\n// external\n#include \"kazmath/GL/matrix.h\"\n\nNS_CC_BEGIN\n\n//CCLabelAtlas - Creation & Init\n\nLabelAtlas* LabelAtlas::create()\n{\n    LabelAtlas* ret = new LabelAtlas();\n    if (ret)\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_RELEASE_NULL(ret);\n    }\n    \n    return ret;\n}\n\nLabelAtlas* LabelAtlas::create(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)\n{\n    LabelAtlas* ret = new LabelAtlas();\n    if(ret && ret->initWithString(string, charMapFile, itemWidth, itemHeight, startCharMap))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool LabelAtlas::initWithString(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap)\n{\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(charMapFile);\n\treturn initWithString(string, texture, itemWidth, itemHeight, startCharMap);\n}\n\nbool LabelAtlas::initWithString(const std::string& string, Texture2D* texture, int itemWidth, int itemHeight, int startCharMap)\n{\n    if (AtlasNode::initWithTexture(texture, itemWidth, itemHeight, static_cast<int>(string.size())))\n    {\n        _mapStartChar = startCharMap;\n        this->setString(string);\n        return true;\n    }\n    return false;\n}\n\nLabelAtlas* LabelAtlas::create(const std::string& string, const std::string& fntFile)\n{    \n    LabelAtlas *ret = new LabelAtlas();\n    if (ret)\n    {\n        if (ret->initWithString(string, fntFile))\n        {\n            ret->autorelease();\n        }\n        else \n        {\n            CC_SAFE_RELEASE_NULL(ret);\n        }\n    }\n    \n    return ret;\n}\n\nbool LabelAtlas::initWithString(const std::string& theString, const std::string& fntFile)\n{\n    std::string pathStr = FileUtils::getInstance()->fullPathForFilename(fntFile);\n    std::string relPathStr = pathStr.substr(0, pathStr.find_last_of(\"/\"))+\"/\";\n    \n    ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(pathStr.c_str());\n\n    CCASSERT(dict[\"version\"].asInt() == 1, \"Unsupported version. Upgrade cocos2d version\");\n\n    std::string textureFilename = relPathStr + dict[\"textureFilename\"].asString();\n\n    unsigned int width = dict[\"itemWidth\"].asInt() / CC_CONTENT_SCALE_FACTOR();\n    unsigned int height = dict[\"itemHeight\"].asInt() / CC_CONTENT_SCALE_FACTOR();\n    unsigned int startChar = dict[\"firstChar\"].asInt();\n\n\n    this->initWithString(theString, textureFilename.c_str(), width, height, startChar);\n\n    return true;\n}\n\n//CCLabelAtlas - Atlas generation\nvoid LabelAtlas::updateAtlasValues()\n{\n    ssize_t n = _string.length();\n\n    const unsigned char *s = (unsigned char*)_string.c_str();\n\n    Texture2D *texture = _textureAtlas->getTexture();\n    float textureWide = (float) texture->getPixelsWide();\n    float textureHigh = (float) texture->getPixelsHigh();\n    float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR();\n    float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR();\n    if (_ignoreContentScaleFactor)\n    {\n        itemWidthInPixels = _itemWidth;\n        itemHeightInPixels = _itemHeight;\n    }\n\n    CCASSERT(n <= _textureAtlas->getCapacity(), \"updateAtlasValues: Invalid String length\");\n    V3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads();\n    for(ssize_t i = 0; i < n; i++) {\n\n        unsigned char a = s[i] - _mapStartChar;\n        float row = (float) (a % _itemsPerRow);\n        float col = (float) (a / _itemsPerRow);\n\n#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n        // Issue #938. Don't use texStepX & texStepY\n        float left        = (2 * row * itemWidthInPixels + 1) / (2 * textureWide);\n        float right        = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide);\n        float top        = (2 * col * itemHeightInPixels + 1) / (2 * textureHigh);\n        float bottom    = top + (itemHeightInPixels * 2 - 2) / (2 * textureHigh);\n#else\n        float left        = row * itemWidthInPixels / textureWide;\n        float right        = left + itemWidthInPixels / textureWide;\n        float top        = col * itemHeightInPixels / textureHigh;\n        float bottom    = top + itemHeightInPixels / textureHigh;\n#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n\n        quads[i].tl.texCoords.u = left;\n        quads[i].tl.texCoords.v = top;\n        quads[i].tr.texCoords.u = right;\n        quads[i].tr.texCoords.v = top;\n        quads[i].bl.texCoords.u = left;\n        quads[i].bl.texCoords.v = bottom;\n        quads[i].br.texCoords.u = right;\n        quads[i].br.texCoords.v = bottom;\n\n        quads[i].bl.vertices.x = (float) (i * _itemWidth);\n        quads[i].bl.vertices.y = 0;\n        quads[i].bl.vertices.z = 0.0f;\n        quads[i].br.vertices.x = (float)(i * _itemWidth + _itemWidth);\n        quads[i].br.vertices.y = 0;\n        quads[i].br.vertices.z = 0.0f;\n        quads[i].tl.vertices.x = (float)(i * _itemWidth);\n        quads[i].tl.vertices.y = (float)(_itemHeight);\n        quads[i].tl.vertices.z = 0.0f;\n        quads[i].tr.vertices.x = (float)(i * _itemWidth + _itemWidth);\n        quads[i].tr.vertices.y = (float)(_itemHeight);\n        quads[i].tr.vertices.z = 0.0f;\n        Color4B c(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity);\n        quads[i].tl.colors = c;\n        quads[i].tr.colors = c;\n        quads[i].bl.colors = c;\n        quads[i].br.colors = c;\n    }\n    if (n > 0 ){\n        _textureAtlas->setDirty(true);\n        ssize_t totalQuads = _textureAtlas->getTotalQuads();\n        if (n > totalQuads) {\n            _textureAtlas->increaseTotalQuadsWith(static_cast<int>(n - totalQuads));\n        }\n    }\n}\n\n//CCLabelAtlas - LabelProtocol\nvoid LabelAtlas::setString(const std::string &label)\n{\n    ssize_t len = label.size();\n    if (len > _textureAtlas->getTotalQuads())\n    {\n        _textureAtlas->resizeCapacity(len);\n    }\n    _string.clear();\n    _string = label;\n    this->updateAtlasValues();\n\n    Size s = Size(len * _itemWidth, _itemHeight);\n\n    this->setContentSize(s);\n\n    _quadsToDraw = len;\n}\n\nconst std::string& LabelAtlas::getString(void) const\n{\n    return _string;\n}\n\n//CCLabelAtlas - draw\n\n#if CC_LABELATLAS_DEBUG_DRAW    \nvoid LabelAtlas::draw()\n{\n    AtlasNode::draw();\n\n    const Size& s = this->getContentSize();\n    Point vertices[4]={\n        Point(0,0),Point(s.width,0),\n        Point(s.width,s.height),Point(0,s.height),\n    };\n    ccDrawPoly(vertices, 4, true);\n}\n#endif\n\nstd::string LabelAtlas::getDescription() const\n{\n    return StringUtils::format(\"<LabelAtlas | Tag = %d, Label = '%s'>\", _tag, _string.c_str());\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelAtlas.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCLABEL_ATLAS_H__\n#define __CCLABEL_ATLAS_H__\n\n#include \"CCAtlasNode.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup label\n * @{\n */\n\n/** @brief LabelAtlas is a subclass of AtlasNode.\n\nIt can be as a replacement of Label since it is MUCH faster.\n\nLabelAtlas versus Label:\n- LabelAtlas is MUCH faster than Label\n- LabelAtlas \"characters\" have a fixed height and width\n- LabelAtlas \"characters\" can be anything you want since they are taken from an image file\n\nA more flexible class is LabelBMFont. It supports variable width characters and it also has a nice editor.\n*/\nclass CC_DLL LabelAtlas : public AtlasNode, public LabelProtocol\n{\npublic:\n    /** creates an empty LabelAtlas, user need to call initWithString(...) later to make this object work properly **/\n    static LabelAtlas* create();\n    \n    /** creates the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */\n    static LabelAtlas* create(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap);\n    \n    /** creates the LabelAtlas with a string and a configuration file\n     @since v2.0\n     */\n    static LabelAtlas* create(const std::string& string, const std::string& fntFile);\n\n    /** initializes the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */\n    bool initWithString(const std::string& string, const std::string& charMapFile, int itemWidth, int itemHeight, int startCharMap);\n    \n    /** initializes the LabelAtlas with a string and a configuration file\n     @since v2.0\n     */\n    bool initWithString(const std::string& string, const std::string& fntFile);\n    \n    /** initializes the LabelAtlas with a string, a texture, the width and height in points of each element and the starting char of the atlas */\n    bool initWithString(const std::string& string, Texture2D* texture, int itemWidth, int itemHeight, int startCharMap);\n    \n    // super methods\n    virtual void updateAtlasValues();\n\n    virtual void setString(const std::string &label) override;\n    virtual const std::string& getString(void) const override;\n    virtual std::string getDescription() const override;\n\n#if CC_LABELATLAS_DEBUG_DRAW\n    virtual void draw() override;\n#endif\n\nprotected:\n    LabelAtlas()\n    :_string(\"\")\n    {}\n\n    virtual ~LabelAtlas()\n    {\n        _string.clear();\n    }\n    \n    // string to render\n    std::string _string;\n    // the first char in the charmap\n    int _mapStartChar;\n};\n\n// end of GUI group\n/// @}\n/// @}\n\n\nNS_CC_END\n\n#endif //__CCLABEL_ATLAS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelBMFont.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\nUse any of these editors to generate BMFonts:\nhttp://glyphdesigner.71squared.com/ (Commercial, Mac OS X)\nhttp://www.n4te.com/hiero/hiero.jnlp (Free, Java)\nhttp://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)\nhttp://www.angelcode.com/products/bmfont/ (Free, Windows only)\n\n****************************************************************************/\n#include \"CCLabelBMFont.h\"\n#include \"CCString.h\"\n#include \"CCDictionary.h\"\n#include \"CCConfiguration.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"CCSprite.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCDirector.h\"\n#include \"CCTextureCache.h\"\n#include \"ccUTF8.h\"\n#include \"CCMap.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n// The return value needs to be deleted by CC_SAFE_DELETE_ARRAY.\nstatic unsigned short* copyUTF16StringN(unsigned short* str)\n{\n    int length = str ? cc_wcslen(str) : 0;\n    unsigned short* ret = new unsigned short[length+1];\n    for (int i = 0; i < length; ++i) {\n        ret[i] = str[i];\n    }\n    ret[length] = 0;\n    return ret;\n}\n\n//\n//FNTConfig Cache - free functions\n//\nstatic Map<std::string, CCBMFontConfiguration*>* s_configurations = nullptr;\n\nCCBMFontConfiguration* FNTConfigLoadFile(const std::string& fntFile)\n{\n    CCBMFontConfiguration* ret = nullptr;\n\n    if( s_configurations == nullptr )\n    {\n        s_configurations = new Map<std::string, CCBMFontConfiguration*>();\n    }\n\n    ret = s_configurations->at(fntFile);\n    if( ret == nullptr )\n    {\n        ret = CCBMFontConfiguration::create(fntFile.c_str());\n        if (ret)\n        {\n            s_configurations->insert(fntFile, ret);\n        }        \n    }\n\n    return ret;\n}\n\nvoid FNTConfigRemoveCache( void )\n{\n    if (s_configurations)\n    {\n        s_configurations->clear();\n        CC_SAFE_DELETE(s_configurations);\n    }\n}\n\n//\n//BitmapFontConfiguration\n//\n\nCCBMFontConfiguration * CCBMFontConfiguration::create(const std::string& FNTfile)\n{\n    CCBMFontConfiguration * ret = new CCBMFontConfiguration();\n    if (ret->initWithFNTfile(FNTfile))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool CCBMFontConfiguration::initWithFNTfile(const std::string& FNTfile)\n{\n    _kerningDictionary = nullptr;\n    _fontDefDictionary = nullptr;\n    \n    _characterSet = this->parseConfigFile(FNTfile);\n    \n    if (! _characterSet)\n    {\n        return false;\n    }\n\n    return true;\n}\n\nstd::set<unsigned int>* CCBMFontConfiguration::getCharacterSet() const\n{\n    return _characterSet;\n}\n\nCCBMFontConfiguration::CCBMFontConfiguration()\n: _fontDefDictionary(nullptr)\n, _commonHeight(0)\n, _kerningDictionary(nullptr)\n, _characterSet(nullptr)\n{\n\n}\n\nCCBMFontConfiguration::~CCBMFontConfiguration()\n{\n    CCLOGINFO( \"deallocing CCBMFontConfiguration: %p\", this );\n    this->purgeFontDefDictionary();\n    this->purgeKerningDictionary();\n    _atlasName.clear();\n    CC_SAFE_DELETE(_characterSet);\n}\n\nstd::string CCBMFontConfiguration::description(void) const\n{\n    return StringUtils::format(\n        \"<CCBMFontConfiguration = \" CC_FORMAT_PRINTF_SIZE_T \" | Glphys:%d Kernings:%d | Image = %s>\",\n        (size_t)this,\n        HASH_COUNT(_fontDefDictionary),\n        HASH_COUNT(_kerningDictionary),\n        _atlasName.c_str()\n    );\n}\n\nvoid CCBMFontConfiguration::purgeKerningDictionary()\n{\n    tKerningHashElement *current;\n    while(_kerningDictionary) \n    {\n        current = _kerningDictionary; \n        HASH_DEL(_kerningDictionary,current);\n        free(current);\n    }\n}\n\nvoid CCBMFontConfiguration::purgeFontDefDictionary()\n{    \n    tFontDefHashElement *current, *tmp;\n\n    HASH_ITER(hh, _fontDefDictionary, current, tmp) {\n        HASH_DEL(_fontDefDictionary, current);\n        free(current);\n    }\n}\n\nstd::set<unsigned int>* CCBMFontConfiguration::parseConfigFile(const std::string& controlFile)\n{    \n    std::string fullpath = FileUtils::getInstance()->fullPathForFilename(controlFile);\n\n\tData data = FileUtils::getInstance()->getDataFromFile(fullpath);\n    CCASSERT((!data.isNull() && data.getSize() > 0), \"CCBMFontConfiguration::parseConfigFile | Open file error.\");\n\n    if (memcmp(\"BMF\", data.getBytes(), 3) == 0) {\n        std::set<unsigned int>* ret = parseBinaryConfigFile(data.getBytes(), data.getSize(), controlFile);\n        return ret;\n    }\n\n    std::string contents((const char*)data.getBytes(), data.getSize());\n    \n    std::set<unsigned int> *validCharsString = new std::set<unsigned int>();\n\n    if (contents.empty())\n    {\n        CCLOG(\"cocos2d: Error parsing FNTfile %s\", controlFile.c_str());\n        return nullptr;\n    }\n\n    // parse spacing / padding\n    std::string line;\n    std::string strLeft(contents);\n    while (strLeft.length() > 0)\n    {\n        size_t pos = strLeft.find('\\n');\n\n        if (pos != std::string::npos)\n        {\n            // the data is more than a line.get one line\n            line = strLeft.substr(0, pos);\n            strLeft = strLeft.substr(pos + 1);\n        }\n        else\n        {\n            // get the left data\n            line = strLeft;\n            strLeft.erase();\n        }\n\n        if(line.substr(0,strlen(\"info face\")) == \"info face\") \n        {\n            // XXX: info parsing is incomplete\n            // Not needed for the Hiero editors, but needed for the AngelCode editor\n            //            [self parseInfoArguments:line];\n            this->parseInfoArguments(line);\n        }\n        // Check to see if the start of the line is something we are interested in\n        else if(line.substr(0,strlen(\"common lineHeight\")) == \"common lineHeight\")\n        {\n            this->parseCommonArguments(line);\n        }\n        else if(line.substr(0,strlen(\"page id\")) == \"page id\")\n        {\n            this->parseImageFileName(line, controlFile);\n        }\n        else if(line.substr(0,strlen(\"chars c\")) == \"chars c\")\n        {\n            // Ignore this line\n        }\n        else if(line.substr(0,strlen(\"char\")) == \"char\")\n        {\n            // Parse the current line and create a new CharDef\n            tFontDefHashElement* element = (tFontDefHashElement*)malloc( sizeof(*element) );\n            this->parseCharacterDefinition(line, &element->fontDef);\n\n            element->key = element->fontDef.charID;\n            HASH_ADD_INT(_fontDefDictionary, key, element);\n            \n            validCharsString->insert(element->fontDef.charID);\n        }\n//        else if(line.substr(0,strlen(\"kernings count\")) == \"kernings count\")\n//        {\n//            this->parseKerningCapacity(line);\n//        }\n        else if(line.substr(0,strlen(\"kerning first\")) == \"kerning first\")\n        {\n            this->parseKerningEntry(line);\n        }\n    }\n    \n    return validCharsString;\n}\n\nstd::set<unsigned int>* CCBMFontConfiguration::parseBinaryConfigFile(unsigned char* pData, unsigned long size, const std::string& controlFile)\n{\n    /* based on http://www.angelcode.com/products/bmfont/doc/file_format.html file format */\n\n    set<unsigned int> *validCharsString = new set<unsigned int>();\n\n    unsigned long remains = size;\n\n    CCASSERT(pData[3] == 3, \"Only version 3 is supported\");\n\n    pData += 4; remains -= 4;\n\n    while (remains > 0)\n\t{\n        unsigned char blockId = pData[0]; pData += 1; remains -= 1;\n        uint32_t blockSize = 0; memcpy(&blockSize, pData, 4);\n\n        pData += 4; remains -= 4;\n\n        if (blockId == 1)\n\t\t{\n            /*\n             fontSize \t2 \tint \t0\n             bitField \t1 \tbits \t2 \tbit 0: smooth, bit 1: unicode, bit 2: italic, bit 3: bold, bit 4: fixedHeigth, bits 5-7: reserved\n             charSet \t1 \tuint \t3\n             stretchH \t2 \tuint \t4\n             aa \t1 \tuint \t6\n             paddingUp \t1 \tuint \t7\n             paddingRight\t1 \tuint \t8\n             paddingDown \t1 \tuint \t9\n             paddingLeft \t1 \tuint \t10\n             spacingHoriz\t1 \tuint \t11\n             spacingVert \t1 \tuint \t12\n             outline \t1 \tuint \t13\tadded with version 2\n             fontName \tn+1\tstring \t14\tnull terminated string with length n\n             */\n\n            _padding.top = (unsigned char)pData[7];\n            _padding.right = (unsigned char)pData[8];\n            _padding.bottom = (unsigned char)pData[9];\n            _padding.left = (unsigned char)pData[10];\n        }\n\t\telse if (blockId == 2)\n\t\t{\n            /*\n             lineHeight \t2 \tuint \t0\n             base \t2 \tuint \t2\n             scaleW \t2 \tuint \t4\n             scaleH \t2 \tuint \t6\n             pages \t2 \tuint \t8\n             bitField \t1 \tbits \t10 \tbits 0-6: reserved, bit 7: packed\n             alphaChnl \t1 \tuint \t11\n             redChnl \t1 \tuint \t12\n             greenChnl \t1 \tuint \t13\n             blueChnl \t1 \tuint \t14\n             */\n\n            uint16_t lineHeight = 0; memcpy(&lineHeight, pData, 2);\n            _commonHeight = lineHeight;\n\n            uint16_t scaleW = 0; memcpy(&scaleW, pData + 4, 2);\n            uint16_t scaleH = 0; memcpy(&scaleH, pData + 6, 2);\n\n            CCASSERT(scaleW <= Configuration::getInstance()->getMaxTextureSize() && scaleH <= Configuration::getInstance()->getMaxTextureSize(), \"CCLabelBMFont: page can't be larger than supported\");\n\n            uint16_t pages = 0; memcpy(&pages, pData + 8, 2);\n            CCASSERT(pages == 1, \"CCBitfontAtlas: only supports 1 page\");\n        }\n\t\telse if (blockId == 3)\n\t\t{\n            /*\n             pageNames \tp*(n+1) \tstrings \t0 \tp null terminated strings, each with length n\n             */\n\n            const char *value = (const char *)pData;\n            CCASSERT(strlen(value) < blockSize, \"Block size should be less then string\");\n\n            _atlasName = FileUtils::getInstance()->fullPathFromRelativeFile(value, controlFile);\n        }\n\t\telse if (blockId == 4)\n\t\t{\n            /*\n             id \t4 \tuint \t0+c*20 \tThese fields are repeated until all characters have been described\n             x \t2 \tuint \t4+c*20\n             y \t2 \tuint \t6+c*20\n             width \t2 \tuint \t8+c*20\n             height \t2 \tuint \t10+c*20\n             xoffset \t2 \tint \t12+c*20\n             yoffset \t2 \tint \t14+c*20\n             xadvance \t2 \tint \t16+c*20\n             page \t1 \tuint \t18+c*20\n             chnl \t1 \tuint \t19+c*20\n             */\n\n            unsigned long count = blockSize / 20;\n\n            for (unsigned long i = 0; i < count; i++)\n\t\t\t{\n                tFontDefHashElement* element = (tFontDefHashElement*)malloc( sizeof(*element) );\n\n                uint32_t charId = 0; memcpy(&charId, pData + (i * 20), 4);\n                element->fontDef.charID = charId;\n\n                uint16_t charX = 0; memcpy(&charX, pData + (i * 20) + 4, 2);\n                element->fontDef.rect.origin.x = charX;\n\n                uint16_t charY = 0; memcpy(&charY, pData + (i * 20) + 6, 2);\n                element->fontDef.rect.origin.y = charY;\n\n                uint16_t charWidth = 0; memcpy(&charWidth, pData + (i * 20) + 8, 2);\n                element->fontDef.rect.size.width = charWidth;\n\n                uint16_t charHeight = 0; memcpy(&charHeight, pData + (i * 20) + 10, 2);\n                element->fontDef.rect.size.height = charHeight;\n\n                int16_t xoffset = 0; memcpy(&xoffset, pData + (i * 20) + 12, 2);\n                element->fontDef.xOffset = xoffset;\n\n                int16_t yoffset = 0; memcpy(&yoffset, pData + (i * 20) + 14, 2);\n                element->fontDef.yOffset = yoffset;\n\n                int16_t xadvance = 0; memcpy(&xadvance, pData + (i * 20) + 16, 2);\n                element->fontDef.xAdvance = xadvance;\n\n                element->key = element->fontDef.charID;\n                HASH_ADD_INT(_fontDefDictionary, key, element);\n\n                validCharsString->insert(element->fontDef.charID);\n            }\n        }\n\t\telse if (blockId == 5) {\n            /*\n\t\t\t first \t4 \tuint \t0+c*10 \tThese fields are repeated until all kerning pairs have been described\n\t\t\t second \t4 \tuint \t4+c*10\n\t\t\t amount \t2 \tint \t8+c*10\n             */\n\n            unsigned long count = blockSize / 20;\n\n            for (unsigned long i = 0; i < count; i++)\n\t\t\t{\n\n                uint32_t first = 0; memcpy(&first, pData + (i * 10), 4);\n                uint32_t second = 0; memcpy(&second, pData + (i * 10) + 4, 4);\n                int16_t amount = 0; memcpy(&amount, pData + (i * 10) + 8, 2);\n\n                tKerningHashElement *element = (tKerningHashElement *)calloc( sizeof( *element ), 1 );\n                element->amount = amount;\n                element->key = (first<<16) | (second&0xffff);\n                HASH_ADD_INT(_kerningDictionary,key, element);\n            }\n        }\n\n        pData += blockSize; remains -= blockSize;\n    }\n\n    return validCharsString;\n}\n\nvoid CCBMFontConfiguration::parseImageFileName(std::string line, const std::string& fntFile)\n{\n    //////////////////////////////////////////////////////////////////////////\n    // line to parse:\n    // page id=0 file=\"bitmapFontTest.png\"\n    //////////////////////////////////////////////////////////////////////////\n\n    // page ID. Sanity check\n    auto index = line.find('=')+1;\n    auto index2 = line.find(' ', index);\n    std::string value = line.substr(index, index2-index);\n    CCASSERT(atoi(value.c_str()) == 0, \"LabelBMFont file could not be found\");\n    // file \n    index = line.find('\"')+1;\n    index2 = line.find('\"', index);\n    value = line.substr(index, index2-index);\n\n    _atlasName = FileUtils::getInstance()->fullPathFromRelativeFile(value.c_str(), fntFile);\n}\n\nvoid CCBMFontConfiguration::parseInfoArguments(std::string line)\n{\n    //////////////////////////////////////////////////////////////////////////\n    // possible lines to parse:\n    // info face=\"Script\" size=32 bold=0 italic=0 charset=\"\" unicode=1 stretchH=100 smooth=1 aa=1 padding=1,4,3,2 spacing=0,0 outline=0\n    // info face=\"Cracked\" size=36 bold=0 italic=0 charset=\"\" unicode=0 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1\n    //////////////////////////////////////////////////////////////////////////\n\n    // padding\n    auto index = line.find(\"padding=\");\n    auto index2 = line.find(' ', index);\n    std::string value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"padding=%d,%d,%d,%d\", &_padding.top, &_padding.right, &_padding.bottom, &_padding.left);\n    CCLOG(\"cocos2d: padding: %d,%d,%d,%d\", _padding.left, _padding.top, _padding.right, _padding.bottom);\n}\n\nvoid CCBMFontConfiguration::parseCommonArguments(std::string line)\n{\n    //////////////////////////////////////////////////////////////////////////\n    // line to parse:\n    // common lineHeight=104 base=26 scaleW=1024 scaleH=512 pages=1 packed=0\n    //////////////////////////////////////////////////////////////////////////\n\n    // Height\n    auto index = line.find(\"lineHeight=\");\n    auto index2 = line.find(' ', index);\n    std::string value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"lineHeight=%d\", &_commonHeight);\n    // scaleW. sanity check\n    index = line.find(\"scaleW=\") + strlen(\"scaleW=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    CCASSERT(atoi(value.c_str()) <= Configuration::getInstance()->getMaxTextureSize(), \"CCLabelBMFont: page can't be larger than supported\");\n    // scaleH. sanity check\n    index = line.find(\"scaleH=\") + strlen(\"scaleH=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    CCASSERT(atoi(value.c_str()) <= Configuration::getInstance()->getMaxTextureSize(), \"CCLabelBMFont: page can't be larger than supported\");\n    // pages. sanity check\n    index = line.find(\"pages=\") + strlen(\"pages=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    CCASSERT(atoi(value.c_str()) == 1, \"CCBitfontAtlas: only supports 1 page\");\n\n    // packed (ignore) What does this mean ??\n}\n\nvoid CCBMFontConfiguration::parseCharacterDefinition(std::string line, ccBMFontDef *characterDefinition)\n{    \n    //////////////////////////////////////////////////////////////////////////\n    // line to parse:\n    // char id=32   x=0     y=0     width=0     height=0     xoffset=0     yoffset=44    xadvance=14     page=0  chnl=0 \n    //////////////////////////////////////////////////////////////////////////\n\n    // Character ID\n    auto index = line.find(\"id=\");\n    auto index2 = line.find(' ', index);\n    std::string value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"id=%u\", &characterDefinition->charID);\n\n    // Character x\n    index = line.find(\"x=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"x=%f\", &characterDefinition->rect.origin.x);\n    // Character y\n    index = line.find(\"y=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"y=%f\", &characterDefinition->rect.origin.y);\n    // Character width\n    index = line.find(\"width=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"width=%f\", &characterDefinition->rect.size.width);\n    // Character height\n    index = line.find(\"height=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"height=%f\", &characterDefinition->rect.size.height);\n    // Character xoffset\n    index = line.find(\"xoffset=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"xoffset=%hd\", &characterDefinition->xOffset);\n    // Character yoffset\n    index = line.find(\"yoffset=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"yoffset=%hd\", &characterDefinition->yOffset);\n    // Character xadvance\n    index = line.find(\"xadvance=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"xadvance=%hd\", &characterDefinition->xAdvance);\n}\n\nvoid CCBMFontConfiguration::parseKerningEntry(std::string line)\n{        \n    //////////////////////////////////////////////////////////////////////////\n    // line to parse:\n    // kerning first=121  second=44  amount=-7\n    //////////////////////////////////////////////////////////////////////////\n\n    // first\n    int first;\n    auto index = line.find(\"first=\");\n    auto index2 = line.find(' ', index);\n    std::string value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"first=%d\", &first);\n\n    // second\n    int second;\n    index = line.find(\"second=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"second=%d\", &second);\n\n    // amount\n    int amount;\n    index = line.find(\"amount=\");\n    index2 = line.find(' ', index);\n    value = line.substr(index, index2-index);\n    sscanf(value.c_str(), \"amount=%d\", &amount);\n\n    tKerningHashElement *element = (tKerningHashElement *)calloc( sizeof( *element ), 1 );\n    element->amount = amount;\n    element->key = (first<<16) | (second&0xffff);\n    HASH_ADD_INT(_kerningDictionary,key, element);\n}\n//\n//CCLabelBMFont\n//\n\n//LabelBMFont - Purge Cache\nvoid LabelBMFont::purgeCachedData()\n{\n    FNTConfigRemoveCache();\n}\n\nLabelBMFont * LabelBMFont::create()\n{\n    LabelBMFont * pRet = new LabelBMFont();\n    if (pRet && pRet->init())\n    {\n        pRet->autorelease();\n        return pRet;\n    }\n    CC_SAFE_DELETE(pRet);\n    return nullptr;\n}\n\nLabelBMFont * LabelBMFont::create(const std::string& str, const std::string& fntFile, float width, TextHAlignment alignment)\n{\n    return LabelBMFont::create(str, fntFile, width, alignment, Point::ZERO);\n}\n\nLabelBMFont * LabelBMFont::create(const std::string& str, const std::string& fntFile, float width)\n{\n    return LabelBMFont::create(str, fntFile, width, TextHAlignment::LEFT, Point::ZERO);\n}\n\nLabelBMFont * LabelBMFont::create(const std::string& str, const std::string& fntFile)\n{\n    return LabelBMFont::create(str, fntFile, kLabelAutomaticWidth, TextHAlignment::LEFT, Point::ZERO);\n}\n\n//LabelBMFont - Creation & Init\nLabelBMFont *LabelBMFont::create(const std::string& str, const std::string& fntFile, float width/* = kLabelAutomaticWidth*/, TextHAlignment alignment/* = TextHAlignment::LEFT*/, Point imageOffset/* = Point::ZERO*/)\n{\n    LabelBMFont *ret = new LabelBMFont();\n    if(ret && ret->initWithString(str, fntFile, width, alignment, imageOffset))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool LabelBMFont::init()\n{\n    return initWithString(\"\", \"\", kLabelAutomaticWidth, TextHAlignment::LEFT, Point::ZERO);\n}\n\nbool LabelBMFont::initWithString(const std::string& theString, const std::string& fntFile, float width/* = kLabelAutomaticWidth*/, TextHAlignment alignment/* = TextHAlignment::LEFT*/, Point imageOffset/* = Point::ZERO*/)\n{\n    CCASSERT(!_configuration, \"re-init is no longer supported\");\n\n    Texture2D *texture = nullptr;\n    \n    if (fntFile.size() > 0 )\n    {\n        CCBMFontConfiguration *newConf = FNTConfigLoadFile(fntFile);\n        if (!newConf)\n        {\n            CCLOG(\"cocos2d: WARNING. LabelBMFont: Impossible to create font. Please check file: '%s'\", fntFile.c_str());\n            release();\n            return false;\n        }\n        \n        newConf->retain();\n        CC_SAFE_RELEASE(_configuration);\n        _configuration = newConf;\n        \n        _fntFile = fntFile;\n        \n        texture = Director::getInstance()->getTextureCache()->addImage(_configuration->getAtlasName());\n    }\n    else \n    {\n        texture = new Texture2D();\n        texture->autorelease();\n    }\n\n    if (SpriteBatchNode::initWithTexture(texture, static_cast<int>(theString.size())))\n    {\n        _width = width;\n        _alignment = alignment;\n        \n        _displayedOpacity = _realOpacity = 255;\n\t\t_displayedColor = _realColor = Color3B::WHITE;\n        _cascadeOpacityEnabled = true;\n        _cascadeColorEnabled = true;\n        \n        _contentSize = Size::ZERO;\n        \n        _isOpacityModifyRGB = _textureAtlas->getTexture()->hasPremultipliedAlpha();\n        _anchorPoint = Point(0.5f, 0.5f);\n        \n        _imageOffset = imageOffset;\n        \n        _reusedChar = Sprite::createWithTexture(_textureAtlas->getTexture(), Rect(0, 0, 0, 0));\n        _reusedChar->retain();\n        _reusedChar->setBatchNode(this);\n        \n        this->setString(theString, true);\n        \n        return true;\n    }\n    return false;\n}\n\nLabelBMFont::LabelBMFont()\n: _string(nullptr)\n, _initialString(nullptr)\n, _alignment(TextHAlignment::CENTER)\n, _width(-1.0f)\n, _configuration(nullptr)\n, _lineBreakWithoutSpaces(false)\n, _imageOffset(Point::ZERO)\n, _reusedChar(nullptr)\n, _isOpacityModifyRGB(false)\n{\n\n}\n\nLabelBMFont::~LabelBMFont()\n{\n    CC_SAFE_RELEASE(_reusedChar);\n    CC_SAFE_DELETE_ARRAY(_string);\n    CC_SAFE_DELETE_ARRAY(_initialString);\n    CC_SAFE_RELEASE(_configuration);\n}\n\n// LabelBMFont - Atlas generation\nint LabelBMFont::kerningAmountForFirst(unsigned short first, unsigned short second)\n{\n    int ret = 0;\n    unsigned int key = (first<<16) | (second & 0xffff);\n\n    if( _configuration->_kerningDictionary ) {\n        tKerningHashElement *element = nullptr;\n        HASH_FIND_INT(_configuration->_kerningDictionary, &key, element);        \n        if(element)\n            ret = element->amount;\n    }\n    return ret;\n}\n\nvoid LabelBMFont::createFontChars()\n{\n    int nextFontPositionX = 0;\n    int nextFontPositionY = 0;\n    unsigned short prev = -1;\n    int kerningAmount = 0;\n\n    Size tmpSize = Size::ZERO;\n\n    int longestLine = 0;\n    unsigned int totalHeight = 0;\n\n    unsigned int quantityOfLines = 1;\n    unsigned int stringLen = _string ? cc_wcslen(_string) : 0;\n    if (stringLen == 0)\n    {\n        return;\n    }\n\n    set<unsigned int> *charSet = _configuration->getCharacterSet();\n\n    for (unsigned int i = 0; i < stringLen - 1; ++i)\n    {\n        unsigned short c = _string[i];\n        if (c == '\\n')\n        {\n            quantityOfLines++;\n        }\n    }\n\n    totalHeight = _configuration->_commonHeight * quantityOfLines;\n    nextFontPositionY = 0-(_configuration->_commonHeight - _configuration->_commonHeight * quantityOfLines);\n    \n    Rect rect;\n    ccBMFontDef fontDef;\n\n    for (unsigned int i= 0; i < stringLen; i++)\n    {\n        unsigned short c = _string[i];\n\n        if (c == '\\n')\n        {\n            nextFontPositionX = 0;\n            nextFontPositionY -= _configuration->_commonHeight;\n            continue;\n        }\n        \n        if (charSet->find(c) == charSet->end())\n        {\n            CCLOGWARN(\"cocos2d::LabelBMFont: Attempted to use character not defined in this bitmap: %d\", c);\n            continue;      \n        }\n\n        kerningAmount = this->kerningAmountForFirst(prev, c);\n        \n        tFontDefHashElement *element = nullptr;\n\n        // unichar is a short, and an int is needed on HASH_FIND_INT\n        unsigned int key = c;\n        HASH_FIND_INT(_configuration->_fontDefDictionary, &key, element);\n        if (! element)\n        {\n            CCLOGWARN(\"cocos2d::LabelBMFont: characer not found %d\", c);\n            continue;\n        }\n\n        fontDef = element->fontDef;\n\n        rect = fontDef.rect;\n        rect = CC_RECT_PIXELS_TO_POINTS(rect);\n\n        rect.origin.x += _imageOffset.x;\n        rect.origin.y += _imageOffset.y;\n\n        Sprite *fontChar;\n\n        bool hasSprite = true;\n        fontChar = static_cast<Sprite*>( this->getChildByTag(i) );\n        if(fontChar )\n        {\n            // Reusing previous Sprite\n\t\t\tfontChar->setVisible(true);\n        }\n        else\n        {\n            // New Sprite ? Set correct color, opacity, etc...\n            if( 0 )\n            {\n\t\t\t\t/* WIP: Doesn't support many features yet.\n\t\t\t\t But this code is super fast. It doesn't create any sprite.\n\t\t\t\t Ideal for big labels.\n\t\t\t\t */\n\t\t\t\tfontChar = _reusedChar;\n\t\t\t\tfontChar->setBatchNode(nullptr);\n\t\t\t\thasSprite = false;\n\t\t\t}\n            else\n            {\n                fontChar = Sprite::createWithTexture(_textureAtlas->getTexture(), rect);\n                addChild(fontChar, i, i);\n\t\t\t}\n            \n            // Apply label properties\n\t\t\tfontChar->setOpacityModifyRGB(_isOpacityModifyRGB);\n            \n\t\t\t// Color MUST be set before opacity, since opacity might change color if OpacityModifyRGB is on\n\t\t\tfontChar->updateDisplayedColor(_displayedColor);\n\t\t\tfontChar->updateDisplayedOpacity(_displayedOpacity);\n        }\n\n        // updating previous sprite\n        fontChar->setTextureRect(rect, false, rect.size);\n\n        // See issue 1343. cast( signed short + unsigned integer ) == unsigned integer (sign is lost!)\n        int yOffset = _configuration->_commonHeight - fontDef.yOffset;\n        Point fontPos = Point( (float)nextFontPositionX + fontDef.xOffset + fontDef.rect.size.width*0.5f + kerningAmount,\n            (float)nextFontPositionY + yOffset - rect.size.height*0.5f * CC_CONTENT_SCALE_FACTOR() );\n        fontChar->setPosition(CC_POINT_PIXELS_TO_POINTS(fontPos));\n\n        // update kerning\n        nextFontPositionX += fontDef.xAdvance + kerningAmount;\n        prev = c;\n\n        if (longestLine < nextFontPositionX)\n        {\n            longestLine = nextFontPositionX;\n        }\n        \n        if (! hasSprite)\n        {\n            updateQuadFromSprite(fontChar, i);\n        }\n    }\n\n    // If the last character processed has an xAdvance which is less that the width of the characters image, then we need\n    // to adjust the width of the string to take this into account, or the character will overlap the end of the bounding\n    // box\n    if (fontDef.xAdvance < fontDef.rect.size.width)\n    {\n        tmpSize.width = longestLine + fontDef.rect.size.width - fontDef.xAdvance;\n    }\n    else\n    {\n        tmpSize.width = longestLine;\n    }\n    tmpSize.height = totalHeight;\n\n    this->setContentSize(CC_SIZE_PIXELS_TO_POINTS(tmpSize));\n}\n\n//LabelBMFont - LabelProtocol protocol\nvoid LabelBMFont::setString(const std::string &newString)\n{\n    this->setString(newString, true);\n}\n\nvoid LabelBMFont::setString(const std::string &newString, bool needUpdateLabel)\n{\n    if (needUpdateLabel) {\n        _initialStringUTF8 = newString;\n    }\n    unsigned short* utf16String = cc_utf8_to_utf16(newString.c_str());\n    setString(utf16String, needUpdateLabel);\n    CC_SAFE_DELETE_ARRAY(utf16String);\n }\n\nvoid LabelBMFont::setString(unsigned short *newString, bool needUpdateLabel)\n{\n    if (!needUpdateLabel)\n    {\n        unsigned short* tmp = _string;\n        _string = copyUTF16StringN(newString);\n        CC_SAFE_DELETE_ARRAY(tmp);\n    }\n    else\n    {\n        unsigned short* tmp = _initialString;\n        _initialString = copyUTF16StringN(newString);\n        CC_SAFE_DELETE_ARRAY(tmp);\n    }\n    \n    for(const auto &child : _children)\n        child->setVisible(false);\n\n    this->createFontChars();\n    \n    if (needUpdateLabel) {\n        updateLabel();\n    }\n}\n\nconst std::string& LabelBMFont::getString() const\n{\n    return _initialStringUTF8;\n}\n\nvoid LabelBMFont::setCString(const char *label)\n{\n    setString(label);\n}\n\n/** Override synthesized setOpacity to recurse items */\n\nvoid LabelBMFont::setOpacityModifyRGB(bool var)\n{\n    _isOpacityModifyRGB = var;\n    for(const auto &child : _children) {\n        child->setOpacityModifyRGB(_isOpacityModifyRGB);\n    }\n}\nbool LabelBMFont::isOpacityModifyRGB() const\n{\n    return _isOpacityModifyRGB;\n}\n\n// LabelBMFont - AnchorPoint\nvoid LabelBMFont::setAnchorPoint(const Point& point)\n{\n    if( ! point.equals(_anchorPoint))\n    {\n        SpriteBatchNode::setAnchorPoint(point);\n        updateLabel();\n    }\n}\n\n// LabelBMFont - Alignment\nvoid LabelBMFont::updateLabel()\n{\n    this->setString(_initialString, false);\n\n    if (_width > 0)\n    {\n        // Step 1: Make multiline\n        vector<unsigned short> str_whole = cc_utf16_vec_from_utf16_str(_string);\n        size_t stringLength = str_whole.size();\n        vector<unsigned short> multiline_string;\n        multiline_string.reserve( stringLength );\n        vector<unsigned short> last_word;\n        last_word.reserve( stringLength );\n\n        unsigned int line = 1, i = 0;\n        bool start_line = false, start_word = false;\n        float startOfLine = -1, startOfWord = -1;\n        int skip = 0;\n\n        auto children = getChildren();\n        for (int j = 0; j < children.size(); j++)\n        {\n            Sprite* characterSprite;\n            unsigned int justSkipped = 0;\n            \n            while (!(characterSprite = static_cast<Sprite*>( this->getChildByTag(j + skip + justSkipped))) )\n            {\n                justSkipped++;\n            }\n            \n            skip += justSkipped;\n\n            if (i >= stringLength)\n                break;\n\n            unsigned short character = str_whole[i];\n\n            if (!start_word)\n            {\n                startOfWord = getLetterPosXLeft( characterSprite );\n                start_word = true;\n            }\n            if (!start_line)\n            {\n                startOfLine = startOfWord;\n                start_line = true;\n            }\n\n            // Newline.\n            if (character == '\\n')\n            {\n                cc_utf8_trim_ws(&last_word);\n\n                last_word.push_back('\\n');\n                multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n                last_word.clear();\n                start_word = false;\n                start_line = false;\n                startOfWord = -1;\n                startOfLine = -1;\n                i+=justSkipped;\n                line++;\n\n                if (i >= stringLength)\n                    break;\n\n                character = str_whole[i];\n\n                if (!startOfWord)\n                {\n                    startOfWord = getLetterPosXLeft( characterSprite );\n                    start_word = true;\n                }\n                if (!startOfLine)\n                {\n                    startOfLine  = startOfWord;\n                    start_line = true;\n                }\n                ++i;\n                continue;\n            }\n\n            // Whitespace.\n            if (isspace_unicode(character))\n            {\n                last_word.push_back(character);\n                multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n                last_word.clear();\n                start_word = false;\n                startOfWord = -1;\n                i++;\n                continue;\n            }\n\n            // Out of bounds.\n            if ( getLetterPosXRight( characterSprite ) - startOfLine > _width )\n            {\n                if (!_lineBreakWithoutSpaces)\n                {\n                    last_word.push_back(character);\n\n                    int found = cc_utf8_find_last_not_char(multiline_string, ' ');\n                    if (found != -1)\n                        cc_utf8_trim_ws(&multiline_string);\n                    else\n                        multiline_string.clear();\n\n                    if (multiline_string.size() > 0)\n                        multiline_string.push_back('\\n');\n\n                    line++;\n                    start_line = false;\n                    startOfLine = -1;\n                    i++;\n                }\n                else\n                {\n                    cc_utf8_trim_ws(&last_word);\n\n                    last_word.push_back('\\n');\n                    multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n                    last_word.clear();\n                    start_word = false;\n                    start_line = false;\n                    startOfWord = -1;\n                    startOfLine = -1;\n                    line++;\n\n                    if (i >= stringLength)\n                        break;\n\n                    if (!startOfWord)\n                    {\n                        startOfWord = getLetterPosXLeft( characterSprite );\n                        start_word = true;\n                    }\n                    if (!startOfLine)\n                    {\n                        startOfLine  = startOfWord;\n                        start_line = true;\n                    }\n\n                    j--;\n                }\n\n                continue;\n            }\n            else\n            {\n                // Character is normal.\n                last_word.push_back(character);\n                i++;\n                continue;\n            }\n        }\n\n        multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n\n        size_t size = multiline_string.size();\n        unsigned short* str_new = new unsigned short[size + 1];\n\n        for (size_t j = 0; j < size; ++j)\n        {\n            str_new[j] = multiline_string[j];\n        }\n\n        str_new[size] = '\\0';\n\n        this->setString(str_new, false);\n        \n        CC_SAFE_DELETE_ARRAY(str_new);\n    }\n\n    // Step 2: Make alignment\n    if (_alignment != TextHAlignment::LEFT)\n    {\n        int i = 0;\n\n        int lineNumber = 0;\n        int str_len = cc_wcslen(_string);\n        vector<unsigned short> last_line;\n        for (int ctr = 0; ctr <= str_len; ++ctr)\n        {\n            if (_string[ctr] == '\\n' || _string[ctr] == 0)\n            {\n                float lineWidth = 0.0f;\n                size_t line_length = last_line.size();\n\t\t\t\t// if last line is empty we must just increase lineNumber and work with next line\n                if (line_length == 0)\n                {\n                    lineNumber++;\n                    continue;\n                }\n                int index = static_cast<int>(i + line_length - 1 + lineNumber);\n                if (index < 0) continue;\n\n                Sprite* lastChar = static_cast<Sprite*>( getChildByTag(index) );\n                if ( lastChar == nullptr )\n                    continue;\n\n                lineWidth = lastChar->getPosition().x + lastChar->getContentSize().width/2.0f;\n\n                float shift = 0;\n                switch (_alignment)\n                {\n                case TextHAlignment::CENTER:\n                    shift = getContentSize().width/2.0f - lineWidth/2.0f;\n                    break;\n                case TextHAlignment::RIGHT:\n                    shift = getContentSize().width - lineWidth;\n                    break;\n                default:\n                    break;\n                }\n\n                if (shift != 0)\n                {\n                    for (unsigned j = 0; j < line_length; j++)\n                    {\n                        index = i + j + lineNumber;\n                        if (index < 0) continue;\n\n                        Sprite* characterSprite = static_cast<Sprite*>( getChildByTag(index) );\n                        characterSprite->setPosition(characterSprite->getPosition() + Point(shift, 0.0f));\n                    }\n                }\n\n                i += line_length;\n                lineNumber++;\n\n                last_line.clear();\n                continue;\n            }\n\n            last_line.push_back(_string[ctr]);\n        }\n    }\n}\n\n// LabelBMFont - Alignment\nvoid LabelBMFont::setAlignment(TextHAlignment alignment)\n{\n    this->_alignment = alignment;\n    updateLabel();\n}\n\nvoid LabelBMFont::setWidth(float width)\n{\n    this->_width = width;\n    updateLabel();\n}\n\nvoid LabelBMFont::setLineBreakWithoutSpace( bool breakWithoutSpace )\n{\n    _lineBreakWithoutSpaces = breakWithoutSpace;\n    updateLabel();\n}\n\nvoid LabelBMFont::setScale(float scale)\n{\n    SpriteBatchNode::setScale(scale);\n    updateLabel();\n}\n\nvoid LabelBMFont::setScaleX(float scaleX)\n{\n    SpriteBatchNode::setScaleX(scaleX);\n    updateLabel();\n}\n\nvoid LabelBMFont::setScaleY(float scaleY)\n{\n    SpriteBatchNode::setScaleY(scaleY);\n    updateLabel();\n}\n\nfloat LabelBMFont::getLetterPosXLeft( Sprite* sp )\n{\n    return sp->getPosition().x * _scaleX - (sp->getContentSize().width * _scaleX * sp->getAnchorPoint().x);\n}\n\nfloat LabelBMFont::getLetterPosXRight( Sprite* sp )\n{\n    return sp->getPosition().x * _scaleX + (sp->getContentSize().width * _scaleX * sp->getAnchorPoint().x);\n}\n\n// LabelBMFont - FntFile\nvoid LabelBMFont::setFntFile(const std::string& fntFile)\n{\n    if (_fntFile.compare(fntFile) != 0)\n    {\n        CCBMFontConfiguration *newConf = FNTConfigLoadFile(fntFile);\n\n        CCASSERT( newConf, \"CCLabelBMFont: Impossible to create font. Please check file\");\n\n        _fntFile = fntFile;\n\n        CC_SAFE_RETAIN(newConf);\n        CC_SAFE_RELEASE(_configuration);\n        _configuration = newConf;\n\n        this->setTexture(Director::getInstance()->getTextureCache()->addImage(_configuration->getAtlasName()));\n        this->createFontChars();\n    }\n}\n\nconst std::string& LabelBMFont::getFntFile() const\n{\n    return _fntFile;\n}\n\nstd::string LabelBMFont::getDescription() const\n{\n    return StringUtils::format(\"<LabelBMFont | Tag = %d, Label = '%s'>\", _tag, _initialStringUTF8.c_str());\n}\n\n//LabelBMFont - Debug draw\n#if CC_LABELBMFONT_DEBUG_DRAW\nvoid LabelBMFont::draw()\n{\n    SpriteBatchNode::draw();\n    const Size& s = this->getContentSize();\n    Point vertices[4]={\n        Point(0,0),Point(s.width,0),\n        Point(s.width,s.height),Point(0,s.height),\n    };\n    ccDrawPoly(vertices, 4, true);\n}\n\n#endif // CC_LABELBMFONT_DEBUG_DRAW\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelBMFont.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\nUse any of these editors to generate BMFonts:\n  http://glyphdesigner.71squared.com/ (Commercial, Mac OS X)\n  http://www.n4te.com/hiero/hiero.jnlp (Free, Java)\n  http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)\n  http://www.angelcode.com/products/bmfont/ (Free, Windows only)\n\n****************************************************************************/\n#ifndef __CCBITMAP_FONT_ATLAS_H__\n#define __CCBITMAP_FONT_ATLAS_H__\n\n#include \"CCSpriteBatchNode.h\"\n#include \"uthash.h\"\n#include <map>\n#include <sstream>\n#include <iostream>\n#include <vector>\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup label\n * @{\n */\n\nenum {\n    kLabelAutomaticWidth = -1,\n};\n\nstruct _FontDefHashElement;\n\n/**\n@struct ccBMFontDef\nBMFont definition\n*/\ntypedef struct _BMFontDef {\n    //! ID of the character\n    unsigned int charID;\n    //! origin and size of the font\n    Rect rect;\n    //! The X amount the image should be offset when drawing the image (in pixels)\n    short xOffset;\n    //! The Y amount the image should be offset when drawing the image (in pixels)\n    short yOffset;\n    //! The amount to move the current position after drawing the character (in pixels)\n    short xAdvance;\n} ccBMFontDef;\n\n/** @struct ccBMFontPadding\nBMFont padding\n@since v0.8.2\n*/\ntypedef struct _BMFontPadding {\n    /// padding left\n    int    left;\n    /// padding top\n    int top;\n    /// padding right\n    int right;\n    /// padding bottom\n    int bottom;\n} ccBMFontPadding;\n\ntypedef struct _FontDefHashElement\n{\n\tunsigned int\tkey;\t\t// key. Font Unicode value\n\tccBMFontDef\t\tfontDef;\t// font definition\n\tUT_hash_handle\thh;\n} tFontDefHashElement;\n\n// Equal function for targetSet.\ntypedef struct _KerningHashElement\n{\n\tint\t\t\t\tkey;\t\t// key for the hash. 16-bit for 1st element, 16-bit for 2nd element\n\tint\t\t\t\tamount;\n\tUT_hash_handle\thh;\n} tKerningHashElement;\n\n/** @brief CCBMFontConfiguration has parsed configuration of the the .fnt file\n@since v0.8\n*/\nclass CC_DLL CCBMFontConfiguration : public Object\n{\n    // XXX: Creating a public interface so that the bitmapFontArray[] is accessible\npublic://@public\n    // BMFont definitions\n    tFontDefHashElement *_fontDefDictionary;\n\n    //! FNTConfig: Common Height Should be signed (issue #1343)\n    int _commonHeight;\n    //! Padding\n    ccBMFontPadding    _padding;\n    //! atlas name\n    std::string _atlasName;\n    //! values for kerning\n    tKerningHashElement *_kerningDictionary;\n    \n    // Character Set defines the letters that actually exist in the font\n    std::set<unsigned int> *_characterSet;\npublic:\n    /**\n     * @js ctor\n     */\n    CCBMFontConfiguration();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~CCBMFontConfiguration();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    std::string description() const;\n\n    /** allocates a CCBMFontConfiguration with a FNT file */\n    static CCBMFontConfiguration * create(const std::string& FNTfile);\n\n    /** initializes a BitmapFontConfiguration with a FNT file */\n    bool initWithFNTfile(const std::string& FNTfile);\n    \n    inline const std::string& getAtlasName(){ return _atlasName; }\n    inline void setAtlasName(const std::string& atlasName) { _atlasName = atlasName; }\n    \n    std::set<unsigned int>* getCharacterSet() const;\nprivate:\n    std::set<unsigned int>* parseConfigFile(const std::string& controlFile);\n\tstd::set<unsigned int>* parseBinaryConfigFile(unsigned char* pData, unsigned long size, const std::string& controlFile);\n    void parseCharacterDefinition(std::string line, ccBMFontDef *characterDefinition);\n    void parseInfoArguments(std::string line);\n    void parseCommonArguments(std::string line);\n    void parseImageFileName(std::string line, const std::string& fntFile);\n    void parseKerningEntry(std::string line);\n    void purgeKerningDictionary();\n    void purgeFontDefDictionary();\n};\n\n/** @brief LabelBMFont is a subclass of SpriteBatchNode.\n\nFeatures:\n- Treats each character like a Sprite. This means that each individual character can be:\n- rotated\n- scaled\n- translated\n- tinted\n- change the opacity\n- It can be used as part of a menu item.\n- anchorPoint can be used to align the \"label\"\n- Supports AngelCode text format\n\nLimitations:\n- All inner characters are using an anchorPoint of (0.5f, 0.5f) and it is not recommend to change it\nbecause it might affect the rendering\n\nLabelBMFont implements the protocol LabelProtocol, like Label and LabelAtlas.\nLabelBMFont has the flexibility of Label, the speed of LabelAtlas and all the features of Sprite.\nIf in doubt, use LabelBMFont instead of LabelAtlas / Label.\n\nSupported editors:\nhttp://glyphdesigner.71squared.com/ (Commercial, Mac OS X)\nhttp://www.n4te.com/hiero/hiero.jnlp (Free, Java)\nhttp://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java)\nhttp://www.angelcode.com/products/bmfont/ (Free, Windows only)\n\n@since v0.8\n*/\n\nclass CC_DLL LabelBMFont : public SpriteBatchNode, public LabelProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    LabelBMFont();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LabelBMFont();\n    /** Purges the cached data.\n    Removes from memory the cached configurations and the atlas name dictionary.\n    @since v0.99.3\n    */\n    static void purgeCachedData();\n\n    /** creates a bitmap font atlas with an initial string and the FNT file */\n    static LabelBMFont * create(const std::string& str, const std::string& fntFile, float width, TextHAlignment alignment, Point imageOffset);\n    \n\tstatic LabelBMFont * create(const std::string& str, const std::string& fntFile, float width, TextHAlignment alignment);\n\n\tstatic LabelBMFont * create(const std::string& str, const std::string& fntFile, float width);\n\n\tstatic LabelBMFont * create(const std::string& str, const std::string& fntFile);\n\n    /** Creates an label.\n     */\n    static LabelBMFont * create();\n\n    bool init();\n    /** init a bitmap font atlas with an initial string and the FNT file */\n    bool initWithString(const std::string& str, const std::string& fntFile, float width = kLabelAutomaticWidth, TextHAlignment alignment = TextHAlignment::LEFT, Point imageOffset = Point::ZERO);\n\n    /** updates the font chars based on the string to render */\n    void createFontChars();\n    // super method\n    virtual void setString(const std::string& newString) override;\n    virtual void setString(const std::string& newString, bool needUpdateLabel);\n\n    virtual const std::string& getString() const override;\n    virtual void setCString(const char *label);\n    virtual void setAnchorPoint(const Point& var) override;\n    virtual void updateLabel();\n    virtual void setAlignment(TextHAlignment alignment);\n    virtual void setWidth(float width);\n    virtual void setLineBreakWithoutSpace(bool breakWithoutSpace);\n    virtual void setScale(float scale);\n    virtual void setScaleX(float scaleX);\n    virtual void setScaleY(float scaleY);\n    \n    // RGBAProtocol \n    virtual bool isOpacityModifyRGB() const;\n    virtual void setOpacityModifyRGB(bool isOpacityModifyRGB);\n\n    void setFntFile(const std::string& fntFile);\n    const std::string& getFntFile() const;\n\n    virtual std::string getDescription() const override;\n\n#if CC_LABELBMFONT_DEBUG_DRAW\n    virtual void draw();\n#endif // CC_LABELBMFONT_DEBUG_DRAW\nprotected:\n    char * atlasNameFromFntFile(const std::string& fntFile);\n    int kerningAmountForFirst(unsigned short first, unsigned short second);\n    float getLetterPosXLeft( Sprite* characterSprite );\n    float getLetterPosXRight( Sprite* characterSprite );\n    \n    virtual void setString(unsigned short *newString, bool needUpdateLabel);\n    // string to render\n    unsigned short* _string;\n    \n    // name of fntFile\n    std::string _fntFile;\n    \n    // initial string without line breaks\n    unsigned short* _initialString;\n    std::string _initialStringUTF8;\n    \n    // alignment of all lines\n    TextHAlignment _alignment;\n    // max width until a line break is added\n    float _width;\n    \n    CCBMFontConfiguration *_configuration;\n    \n    bool _lineBreakWithoutSpaces;\n    // offset of the texture atlas\n    Point    _imageOffset;\n    \n    // reused char\n    Sprite *_reusedChar;\n    \n    // texture RGBA\n    bool _isOpacityModifyRGB;\n\n};\n\n/** Free function that parses a FNT file a place it on the cache\n*/\nCC_DLL CCBMFontConfiguration * FNTConfigLoadFile(const std::string &file);\n/** Purges the FNT config cache\n*/\nCC_DLL void FNTConfigRemoveCache( void );\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_END\n\n#endif //__CCBITMAP_FONT_ATLAS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelTTF.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCLabelTTF.h\"\n#include \"CCDirector.h\"\n#include \"CCGLProgram.h\"\n#include \"CCShaderCache.h\"\n#include \"CCApplication.h\"\n\nNS_CC_BEGIN\n\n#if CC_USE_LA88_LABELS\n#define SHADER_PROGRAM GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR\n#else\n#define SHADER_PROGRAM GLProgram::SHADER_NAME_POSITION_TEXTUREA8Color\n#endif\n\n//\n//CCLabelTTF\n//\nLabelTTF::LabelTTF()\n: _alignment(TextHAlignment::CENTER)\n, _vAlignment(TextVAlignment::TOP)\n, _fontName(\"\")\n, _fontSize(0.0)\n, _string(\"\")\n, _shadowEnabled(false)\n, _strokeEnabled(false)\n, _textFillColor(Color3B::WHITE)\n{\n}\n\nLabelTTF::~LabelTTF()\n{\n}\n\nLabelTTF * LabelTTF::create()\n{\n    LabelTTF * ret = new LabelTTF();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nLabelTTF * LabelTTF::create(const std::string& string, const std::string& fontName, float fontSize)\n{\n    return LabelTTF::create(string, fontName, fontSize,\n                              Size::ZERO, TextHAlignment::CENTER, TextVAlignment::TOP);\n}\n\nLabelTTF * LabelTTF::create(const std::string& string, const std::string& fontName, float fontSize,\n                                const Size& dimensions, TextHAlignment hAlignment)\n{\n    return LabelTTF::create(string, fontName, fontSize, dimensions, hAlignment, TextVAlignment::TOP);\n}\n\nLabelTTF* LabelTTF::create(const std::string& string, const std::string& fontName, float fontSize,\n                               const Size &dimensions, TextHAlignment hAlignment, \n                               TextVAlignment vAlignment)\n{\n    LabelTTF *ret = new LabelTTF();\n    if(ret && ret->initWithString(string, fontName, fontSize, dimensions, hAlignment, vAlignment))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nLabelTTF * LabelTTF::createWithFontDefinition(const std::string& string, FontDefinition &textDefinition)\n{\n    LabelTTF *ret = new LabelTTF();\n    if(ret && ret->initWithStringAndTextDefinition(string, textDefinition))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool LabelTTF::init()\n{\n    return this->initWithString(\"\", \"Helvetica\", 12);\n}\n\nbool LabelTTF::initWithString(const std::string& label, const std::string& fontName, float fontSize,\n                                const Size& dimensions, TextHAlignment alignment)\n{\n    return this->initWithString(label, fontName, fontSize, dimensions, alignment, TextVAlignment::TOP);\n}\n\nbool LabelTTF::initWithString(const std::string& label, const std::string& fontName, float fontSize)\n{\n    return this->initWithString(label, fontName, fontSize, \n                                Size::ZERO, TextHAlignment::LEFT, TextVAlignment::TOP);\n}\n\nbool LabelTTF::initWithString(const std::string& string, const std::string& fontName, float fontSize,\n                                const cocos2d::Size &dimensions, TextHAlignment hAlignment,\n                                TextVAlignment vAlignment)\n{\n    if (Sprite::init())\n    {\n        // shader program\n//        this->setShaderProgram(ShaderCache::getInstance()->getProgram(SHADER_PROGRAM));\n\n        _dimensions = Size(dimensions.width, dimensions.height);\n        _alignment = hAlignment;\n        _vAlignment = vAlignment;\n        _fontName = fontName;\n        _fontSize = fontSize;\n        \n        this->setString(string);\n        \n        return true;\n    }\n    \n    return false;\n}\n\nbool LabelTTF::initWithStringAndTextDefinition(const std::string& string, FontDefinition &textDefinition)\n{\n    if (Sprite::init())\n    {\n        // shader program\n        this->setShaderProgram(ShaderCache::getInstance()->getProgram(SHADER_PROGRAM));\n        \n        // prepare everythin needed to render the label\n        _updateWithTextDefinition(textDefinition, false);\n        \n        // set the string\n        this->setString(string);\n        \n        //\n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\n\nvoid LabelTTF::setString(const std::string &string)\n{\n    if (_string.compare(string))\n    {\n        _string = string;\n        \n        this->updateTexture();\n    }\n}\n\nconst std::string& LabelTTF::getString() const\n{\n    return _string;\n}\n\nstd::string LabelTTF::getDescription() const\n{\n    return StringUtils::format(\"<LabelTTF | FontName = %s, FontSize = %.1f, Label = '%s'>\", _fontName.c_str(), _fontSize, _string.c_str());\n}\n\nTextHAlignment LabelTTF::getHorizontalAlignment() const\n{\n    return _alignment;\n}\n\nvoid LabelTTF::setHorizontalAlignment(TextHAlignment alignment)\n{\n    if (alignment != _alignment)\n    {\n        _alignment = alignment;\n        \n        // Force update\n        if (_string.size() > 0)\n        {\n            this->updateTexture();\n        }\n    }\n}\n\nTextVAlignment LabelTTF::getVerticalAlignment() const\n{\n    return _vAlignment;\n}\n\nvoid LabelTTF::setVerticalAlignment(TextVAlignment verticalAlignment)\n{\n    if (verticalAlignment != _vAlignment)\n    {\n        _vAlignment = verticalAlignment;\n        \n        // Force update\n        if (_string.size() > 0)\n        {\n            this->updateTexture();\n        }\n    }\n}\n\nconst Size& LabelTTF::getDimensions() const\n{\n    return _dimensions;\n}\n\nvoid LabelTTF::setDimensions(const Size &dim)\n{\n    // XXX: float comparison... very unreliable\n    if (dim.width != _dimensions.width || dim.height != _dimensions.height)\n    {\n        _dimensions = dim;\n        \n        // Force update\n        if (_string.size() > 0)\n        {\n            this->updateTexture();\n        }\n    }\n}\n\nfloat LabelTTF::getFontSize() const\n{\n    return _fontSize;\n}\n\nvoid LabelTTF::setFontSize(float fontSize)\n{\n    // XXX: float comparison... very unreliable\n    if (_fontSize != fontSize)\n    {\n        _fontSize = fontSize;\n        \n        // Force update\n        if (_string.size() > 0)\n        {\n            this->updateTexture();\n        }\n    }\n}\n\nconst std::string& LabelTTF::getFontName() const\n{\n    return _fontName;\n}\n\nvoid LabelTTF::setFontName(const std::string& fontName)\n{\n    if (_fontName.compare(fontName))\n    {\n        _fontName = fontName;\n        \n        // Force update\n        if (_string.size() > 0)\n        {\n            this->updateTexture();\n        }\n    }\n}\n\n// Helper\nbool LabelTTF::updateTexture()\n{\n    Texture2D *tex;\n    tex = new Texture2D();\n    \n    if (!tex)\n        return false;\n    \n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    \n        FontDefinition texDef = _prepareTextDefinition(true);\n        tex->initWithString( _string.c_str(), texDef );\n    \n#else\n    \n        tex->initWithString( _string.c_str(),\n                            _fontName.c_str(),\n                            _fontSize * CC_CONTENT_SCALE_FACTOR(),\n                            CC_SIZE_POINTS_TO_PIXELS(_dimensions),\n                            _alignment,\n                            _vAlignment);\n    \n#endif\n    \n    // set the texture\n    this->setTexture(tex);\n    // release it\n    tex->release();\n    \n    // set the size in the sprite\n    Rect rect =Rect::ZERO;\n    rect.size   = _texture->getContentSize();\n    this->setTextureRect(rect);\n    \n    //ok\n    return true;\n}\n\nvoid LabelTTF::enableShadow(const Size &shadowOffset, float shadowOpacity, float shadowBlur, bool updateTexture)\n{\n    #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    \n        bool valueChanged = false;\n        \n        if (false == _shadowEnabled)\n        {\n            _shadowEnabled = true;\n            valueChanged    = true;\n        }\n        \n        if ( (_shadowOffset.width != shadowOffset.width) || (_shadowOffset.height!=shadowOffset.height) )\n        {\n            _shadowOffset.width = shadowOffset.width;\n            _shadowOffset.height = shadowOffset.height;\n            \n            valueChanged = true;\n        }\n        \n        if (_shadowOpacity != shadowOpacity )\n        {\n            _shadowOpacity = shadowOpacity;\n            valueChanged = true;\n        }\n\n        if (_shadowBlur != shadowBlur)\n        {\n            _shadowBlur = shadowBlur;\n            valueChanged = true;\n        }\n        \n        if ( valueChanged && updateTexture )\n        {\n            this->updateTexture();\n        }\n    \n#else\n        CCLOGERROR(\"Currently only supported on iOS and Android!\");\n#endif\n    \n}\n\nvoid LabelTTF::disableShadow(bool updateTexture)\n{\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    \n        if (_shadowEnabled)\n        {\n            _shadowEnabled = false;\n    \n            if (updateTexture)\n                this->updateTexture();\n        }\n    \n#else\n        CCLOGERROR(\"Currently only supported on iOS and Android!\");\n#endif\n}\n\nvoid LabelTTF::enableStroke(const Color3B &strokeColor, float strokeSize, bool updateTexture)\n{\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    \n        bool valueChanged = false;\n        \n        if(_strokeEnabled == false)\n        {\n            _strokeEnabled = true;\n            valueChanged = true;\n        }\n        \n        if ( (_strokeColor.r != strokeColor.r) || (_strokeColor.g != strokeColor.g) || (_strokeColor.b != strokeColor.b) )\n        {\n            _strokeColor = strokeColor;\n            valueChanged = true;\n        }\n        \n        if (_strokeSize!=strokeSize)\n        {\n            _strokeSize = strokeSize;\n            valueChanged = true;\n        }\n        \n        if ( valueChanged && updateTexture )\n        {\n            this->updateTexture();\n        }\n    \n#else\n        CCLOGERROR(\"Currently only supported on iOS and Android!\");\n#endif\n    \n}\n\nvoid LabelTTF::disableStroke(bool updateTexture)\n{\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    \n        if (_strokeEnabled)\n        {\n            _strokeEnabled = false;\n            \n            if (updateTexture)\n                this->updateTexture();\n        }\n    \n#else\n        CCLOGERROR(\"Currently only supported on iOS and Android!\");\n#endif\n    \n}\n\nvoid LabelTTF::setFontFillColor(const Color3B &tintColor, bool updateTexture)\n{\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n        if (_textFillColor.r != tintColor.r || _textFillColor.g != tintColor.g || _textFillColor.b != tintColor.b)\n        {\n            _textFillColor = tintColor;\n            \n            if (updateTexture)\n                this->updateTexture();\n        }\n#else\n        CCLOGERROR(\"Currently only supported on iOS and Android!\");\n#endif\n}\n\nvoid LabelTTF::setTextDefinition(const FontDefinition& theDefinition)\n{\n    _updateWithTextDefinition(theDefinition, true);\n}\n\nFontDefinition LabelTTF::getTextDefinition()\n{\n    return _prepareTextDefinition(false);\n}\n\nvoid LabelTTF::_updateWithTextDefinition(const FontDefinition& textDefinition, bool mustUpdateTexture)\n{\n    _dimensions = Size(textDefinition._dimensions.width, textDefinition._dimensions.height);\n    _alignment = textDefinition._alignment;\n    _vAlignment = textDefinition._vertAlignment;\n    \n    _fontName = textDefinition._fontName;\n    _fontSize = textDefinition._fontSize;\n    \n    \n    // shadow\n    if ( textDefinition._shadow._shadowEnabled )\n    {\n        enableShadow(textDefinition._shadow._shadowOffset, textDefinition._shadow._shadowOpacity, textDefinition._shadow._shadowBlur, false);\n    }\n    \n    // stroke\n    if ( textDefinition._stroke._strokeEnabled )\n    {\n        enableStroke(textDefinition._stroke._strokeColor, textDefinition._stroke._strokeSize, false);\n    }\n    \n    // fill color\n    setFontFillColor(textDefinition._fontFillColor, false);\n    \n    if (mustUpdateTexture)\n        updateTexture();\n}\n\nFontDefinition LabelTTF::_prepareTextDefinition(bool adjustForResolution)\n{\n    FontDefinition texDef;\n    \n    if (adjustForResolution)\n        texDef._fontSize = _fontSize * CC_CONTENT_SCALE_FACTOR();\n    else\n        texDef._fontSize = _fontSize;\n    \n    texDef._fontName = _fontName;\n    texDef._alignment = _alignment;\n    texDef._vertAlignment = _vAlignment;\n    \n    \n    if (adjustForResolution)\n        texDef._dimensions = CC_SIZE_POINTS_TO_PIXELS(_dimensions);\n    else\n        texDef._dimensions = _dimensions;\n    \n    \n    // stroke\n    if ( _strokeEnabled )\n    {\n        texDef._stroke._strokeEnabled = true;\n        texDef._stroke._strokeColor   = _strokeColor;\n        \n        if (adjustForResolution)\n            texDef._stroke._strokeSize = _strokeSize * CC_CONTENT_SCALE_FACTOR();\n        else\n            texDef._stroke._strokeSize = _strokeSize;\n    }\n    else\n    {\n        texDef._stroke._strokeEnabled = false;\n    }\n    \n    // shadow\n    if ( _shadowEnabled )\n    {\n        texDef._shadow._shadowEnabled = true;\n        texDef._shadow._shadowBlur = _shadowBlur;\n        texDef._shadow._shadowOpacity = _shadowOpacity;\n        \n        if (adjustForResolution)\n            texDef._shadow._shadowOffset = CC_SIZE_POINTS_TO_PIXELS(_shadowOffset);\n        else\n            texDef._shadow._shadowOffset = _shadowOffset;\n    }\n    else\n    {\n        texDef._shadow._shadowEnabled = false;\n    }\n    \n    // text tint\n    texDef._fontFillColor = _textFillColor;\n    \n    return texDef;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelTTF.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCLABELTTF_H__\n#define __CCLABELTTF_H__\n\n#include \"CCTexture2D.h\"\n#include \"CCSprite.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup label\n * @{\n */\n\n\n\n/** @brief LabelTTF is a subclass of TextureNode that knows how to render text labels\n *\n * All features from TextureNode are valid in LabelTTF\n *\n * LabelTTF objects are slow. Consider using LabelAtlas or LabelBMFont instead.\n *\n * Custom ttf file can be put in assets/ or external storage that the Application can access.\n * @code\n * LabelTTF *label1 = LabelTTF::create(\"alignment left\", \"A Damn Mess\", fontSize, blockSize, \n *                                          TextHAlignment::LEFT, TextVAlignment::CENTER);\n * LabelTTF *label2 = LabelTTF::create(\"alignment right\", \"/mnt/sdcard/Scissor Cuts.ttf\", fontSize, blockSize,\n *                                          TextHAlignment::LEFT, TextVAlignment::CENTER);\n * @endcode\n *\n */\nclass CC_DLL LabelTTF : public Sprite, public LabelProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    LabelTTF();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LabelTTF();\n\n    /** creates a LabelTTF with a font name and font size in points\n     @since v2.0.1\n     */\n    static LabelTTF * create(const std::string& string, const std::string& fontName, float fontSize);\n    \n    /** creates a LabelTTF from a fontname, horizontal alignment, dimension in points,  and font size in points.\n     @since v2.0.1\n     */\n    static LabelTTF * create(const std::string& string, const std::string& fontName, float fontSize,\n                             const Size& dimensions, TextHAlignment hAlignment);\n  \n    /** creates a Label from a fontname, alignment, dimension in points and font size in points\n     @since v2.0.1\n     */\n    static LabelTTF * create(const std::string& string, const std::string& fontName, float fontSize,\n                             const Size& dimensions, TextHAlignment hAlignment,\n                             TextVAlignment vAlignment);\n    \n    \n    /** Create a lable with string and a font definition*/\n    static LabelTTF * createWithFontDefinition(const std::string& string, FontDefinition &textDefinition);\n    \n    /** initializes the LabelTTF with a font name and font size */\n    bool initWithString(const std::string& string, const std::string& fontName, float fontSize);\n    \n    /** initializes the LabelTTF with a font name, alignment, dimension and font size */\n    bool initWithString(const std::string& string, const std::string& fontName, float fontSize,\n                        const Size& dimensions, TextHAlignment hAlignment);\n\n    /** initializes the LabelTTF with a font name, alignment, dimension and font size */\n    bool initWithString(const std::string& string, const std::string& fontName, float fontSize,\n                        const Size& dimensions, TextHAlignment hAlignment, \n                        TextVAlignment vAlignment);\n    \n    /** initializes the LabelTTF with a font name, alignment, dimension and font size */\n    bool initWithStringAndTextDefinition(const std::string& string, FontDefinition &textDefinition);\n    \n    /** set the text definition used by this label */\n    void setTextDefinition(const FontDefinition& theDefinition);\n    \n    /** get the text definition used by this label */\n    FontDefinition getTextDefinition();\n    \n    \n    \n    /** enable or disable shadow for the label */\n    void enableShadow(const Size &shadowOffset, float shadowOpacity, float shadowBlur, bool mustUpdateTexture = true);\n    \n    /** disable shadow rendering */\n    void disableShadow(bool mustUpdateTexture = true);\n    \n    /** enable or disable stroke */\n    void enableStroke(const Color3B &strokeColor, float strokeSize, bool mustUpdateTexture = true);\n    \n    /** disable stroke */\n    void disableStroke(bool mustUpdateTexture = true);\n    \n    /** set text tinting */\n    void setFontFillColor(const Color3B &tintColor, bool mustUpdateTexture = true);\n\n    \n    \n    /** initializes the LabelTTF */\n    bool init();\n\n    /** Creates an label.\n     */\n    static LabelTTF * create();\n\n    /** changes the string to render\n    * @warning Changing the string is as expensive as creating a new LabelTTF. To obtain better performance use LabelAtlas\n    */\n    virtual void setString(const std::string &label) override;\n    virtual const std::string& getString(void) const override;\n    \n    TextHAlignment getHorizontalAlignment() const;\n    void setHorizontalAlignment(TextHAlignment alignment);\n    \n    TextVAlignment getVerticalAlignment() const;\n    void setVerticalAlignment(TextVAlignment verticalAlignment);\n    \n    const Size& getDimensions() const;\n    void setDimensions(const Size &dim);\n    \n    float getFontSize() const;\n    void setFontSize(float fontSize);\n    \n    const std::string& getFontName() const;\n    void setFontName(const std::string& fontName);\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual std::string getDescription() const override;\n\nprotected:\n    bool updateTexture();\n\n    /** set the text definition for this label */\n    void _updateWithTextDefinition(const FontDefinition& textDefinition, bool mustUpdateTexture = true);\n    FontDefinition    _prepareTextDefinition(bool adjustForResolution = false);\n    \n    /** Dimensions of the label in Points */\n    Size _dimensions;\n    /** The alignment of the label */\n    TextHAlignment         _alignment;\n    /** The vertical alignment of the label */\n    TextVAlignment _vAlignment;\n    /** Font name used in the label */\n    std::string _fontName;\n    /** Font size of the label */\n    float _fontSize;\n    /** label's string */\n    std::string _string;\n    \n    /** font shadow */\n    bool    _shadowEnabled;\n    Size    _shadowOffset;\n    float   _shadowOpacity;\n    float   _shadowBlur;\n    \n    \n    /** font stroke */\n    bool        _strokeEnabled;\n    Color3B     _strokeColor;\n    float       _strokeSize;\n        \n    /** font tint */\n    Color3B   _textFillColor;\n};\n\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_END\n\n#endif //__CCLABEL_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelTextFormatter.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include <vector>\n\n#include \"ccUTF8.h\"\n#include \"CCLabelTextFormatter.h\"\n#include \"CCDirector.h\"\n#include \"CCLabel.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nbool LabelTextFormatter::multilineText(Label *theLabel)\n{\n    int strLen = theLabel->getStringLenght();\n    auto strWhole = theLabel->getUTF16String();\n\n    vector<unsigned short> multiline_string;\n    multiline_string.reserve( strLen );\n\n    vector<unsigned short> last_word;\n    last_word.reserve( strLen );\n\n    unsigned int line = 1;\n\n    bool   isStartOfLine  = false, isStartOfWord = false;\n    float  startOfLine = -1, startOfWord   = -1;\n\n    int skip = 0;\n    \n    std::vector<LetterInfo>  *leterInfo = theLabel->getLettersInfo();\n    int tIndex = 0;\n    float scalsX = theLabel->getScaleX();\n    float lineWidth = theLabel->getMaxLineWidth();\n    bool breakLineWithoutSpace = theLabel->breakLineWithoutSpace();\n\n    for (int j = 0; j+skip < strLen; j++)\n    {            \n        LetterInfo* info = &leterInfo->at(j+skip);\n\n        unsigned int justSkipped = 0;\n\n        while (info->def.validDefinition == false)\n        {\n            justSkipped++;\n            tIndex = j+skip+justSkipped;\n            if (strWhole[tIndex-1] == '\\n')\n            {\n                cc_utf8_trim_ws(&last_word);\n\n                last_word.push_back('\\n');\n                multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n                last_word.clear();\n                isStartOfWord = false;\n                isStartOfLine = false;\n                startOfWord = -1;\n                startOfLine = -1;\n                ++line;\n            }\n            if(tIndex < strLen)\n            {\n                info = &leterInfo->at( tIndex );\n            }\n            else\n                break;\n        }\n        skip += justSkipped;\n        tIndex = j + skip;\n\n        if (tIndex >= strLen)\n            break;\n\n        unsigned short character = strWhole[tIndex];\n\n        if (!isStartOfWord)\n        {\n            startOfWord = info->position.x * scalsX;\n            isStartOfWord = true;\n        }\n\n        if (!isStartOfLine)\n        {\n            startOfLine = startOfWord;\n            isStartOfLine  = true;\n        }\n\n        // Whitespace.\n        if (isspace_unicode(character))\n        {\n            last_word.push_back(character);\n            multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n            last_word.clear();\n            isStartOfWord = false;\n            startOfWord = -1;\n            continue;\n        }\n\n        float posRight = (info->position.x + info->contentSize.width) * scalsX;\n        // Out of bounds.\n        if (posRight - startOfLine > lineWidth)\n        {\n            if (!breakLineWithoutSpace)\n            {\n                last_word.push_back(character);\n\n                int found = cc_utf8_find_last_not_char(multiline_string, ' ');\n                if (found != -1)\n                    cc_utf8_trim_ws(&multiline_string);\n                else\n                    multiline_string.clear();\n\n                if (multiline_string.size() > 0)\n                    multiline_string.push_back('\\n');\n\n                ++line;\n                isStartOfLine = false;\n                startOfLine = -1;\n            }\n            else\n            {\n                cc_utf8_trim_ws(&last_word);\n\n                last_word.push_back('\\n');\n                multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n                last_word.clear();\n                isStartOfWord = false;\n                isStartOfLine = false;\n                startOfWord = -1;\n                startOfLine = -1;\n                ++line;\n                --j;\n            }\n        }\n        else\n        {\n            // Character is normal.\n            last_word.push_back(character);\n        }\n    }\n\n    multiline_string.insert(multiline_string.end(), last_word.begin(), last_word.end());\n\n    size_t size = multiline_string.size();\n    unsigned short* strNew = new unsigned short[size + 1];\n\n    for (size_t j = 0; j < size; ++j)\n    {\n        strNew[j] = multiline_string[j];\n    }\n\n    strNew[size] = 0;\n    theLabel->assignNewUTF16String(strNew);\n\n    return true;\n}\n\nbool LabelTextFormatter::alignText(Label *theLabel)\n{\n    int i = 0;\n    \n    int lineNumber = 0;\n    int strLen = cc_wcslen(theLabel->getUTF16String());\n    vector<unsigned short> lastLine;\n    std::vector<LetterInfo>  *leterInfo = theLabel->getLettersInfo();\n    auto strWhole = theLabel->getUTF16String();\n\n    for (int ctr = 0; ctr <= strLen; ++ctr)\n    { \n        unsigned short currentChar = strWhole[ctr];\n\n        if (currentChar == '\\n' || currentChar == 0)\n        {\n            float lineWidth = 0.0f;\n            size_t lineLength = lastLine.size();\n            \n            // if last line is empty we must just increase lineNumber and work with next line\n            if (lineLength == 0)\n            {\n                lineNumber++;\n                continue;\n            }\n            int index = static_cast<int>(i + lineLength - 1 + lineNumber);\n            if (index < 0) continue;\n            \n            LetterInfo* info = &leterInfo->at( index );\n            if(info->def.validDefinition == false)\n                continue;\n            lineWidth = info->position.x + info->contentSize.width;\n            \n            float shift = 0;\n            switch (theLabel->getTextAlignment())\n            {\n                case TextHAlignment::CENTER:\n                    shift = theLabel->getContentSize().width/2.0f - lineWidth/2.0f;\n                    break;\n                case TextHAlignment::RIGHT:\n                    shift = theLabel->getContentSize().width - lineWidth;\n                    break;\n                default:\n                    break;\n            }\n            \n            if (shift != 0)\n            {\n                for (unsigned j = 0; j < lineLength; ++j)\n                {\n                    index = i + j + lineNumber;\n                    if (index < 0) continue;\n                    \n                    info = &leterInfo->at( index );\n                    if(info)\n                    {\n                        info->position.x += shift;\n                    }\n                }\n            }\n            \n            i += lineLength;\n            ++lineNumber;\n            \n            lastLine.clear();\n            continue;\n        }\n        \n        lastLine.push_back(currentChar);\n    }\n    \n    return true;\n}\n\nbool LabelTextFormatter::createStringSprites(Label *theLabel)\n{\n    // check for string\n    unsigned int stringLen = theLabel->getStringLenght();\n    \n    // no string\n    if (stringLen == 0)\n        return false;\n    \n    int nextFontPositionX       = 0;\n    int nextFontPositionY       = 0;\n    \n    unsigned short prev         = -1;\n    \n    Size tmpSize                = Size::ZERO;\n    \n    int longestLine             = 0;\n    unsigned int totalHeight    = 0;\n    \n    int quantityOfLines         = theLabel->getStringNumLines();\n    int commonLineHeight        = theLabel->getCommonLineHeight();\n    \n    totalHeight                 = commonLineHeight * quantityOfLines;\n    nextFontPositionY           = totalHeight;\n    \n    Rect charRect;\n    int charXOffset = 0;\n    int charYOffset = 0;\n    int charAdvance = 0;\n\n    auto strWhole = theLabel->getUTF16String();\n    FontAtlas* fontAtlas = theLabel->getFontAtlas();\n    FontLetterDefinition tempDefinition;\n    auto kernings = theLabel->getKernings();\n    \n    for (unsigned int i = 0; i < stringLen; i++)\n    {\n        unsigned short c    = strWhole[i];\n        if (fontAtlas->getLetterDefinitionForChar(c, tempDefinition))\n        {\n            charXOffset         = tempDefinition.offsetX;\n            charYOffset         = tempDefinition.offsetY;\n            charAdvance         = tempDefinition.xAdvance;\n        }\n        else\n        {\n            charXOffset         = -1;\n            charYOffset         = -1;\n            charAdvance         = -1;\n        }\n        \n        if (c == '\\n')\n        {\n            nextFontPositionX  = 0;\n            nextFontPositionY -= commonLineHeight;\n            \n            theLabel->recordPlaceholderInfo(i);\n            continue;\n        }\n        \n        Point fontPos = Point((float)nextFontPositionX + charXOffset + kernings[i],\n            (float)nextFontPositionY - charYOffset);\n               \n        if( theLabel->recordLetterInfo(CC_POINT_PIXELS_TO_POINTS(fontPos),c,i) == false)\n        {\n            log(\"WARNING: can't find letter definition in font file for letter: %c\", c);\n            continue;\n        }\n\n        // update kerning\n        nextFontPositionX += charAdvance + kernings[i];\n        prev = c;\n        \n        if (longestLine < nextFontPositionX)\n        {\n            longestLine = nextFontPositionX;\n        }\n    }\n    \n    float lastCharWidth = tempDefinition.width * CC_CONTENT_SCALE_FACTOR();\n    // If the last character processed has an xAdvance which is less that the width of the characters image, then we need\n    // to adjust the width of the string to take this into account, or the character will overlap the end of the bounding\n    // box\n    if(charAdvance < lastCharWidth)\n    {\n        tmpSize.width = longestLine - charAdvance + lastCharWidth;\n    }\n    else\n    {\n        tmpSize.width = longestLine;\n    }\n    \n    tmpSize.height = totalHeight;\n    theLabel->setContentSize(CC_SIZE_PIXELS_TO_POINTS(tmpSize));\n    return true;\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCLabelTextFormatter.h",
    "content": "/****************************************************************************\n Copyright (c) 2013      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _CCLabelTextFormatter_h_\n#define _CCLabelTextFormatter_h_\n\nNS_CC_BEGIN\n\nclass Label;\n\nclass CC_DLL LabelTextFormatter\n{\npublic:\n    \n    static bool multilineText(Label *theLabel);\n    static bool alignText(Label *theLabel);\n    static bool createStringSprites(Label *theLabel);\n\n};\n\nNS_CC_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLayer.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include <stdarg.h>\n#include \"CCLayer.h\"\n#include \"CCDirector.h\"\n#include \"CCScriptSupport.h\"\n#include \"CCShaderCache.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"TransformUtils.h\"\n// extern\n#include \"kazmath/GL/matrix.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventListenerTouch.h\"\n#include \"CCEventTouch.h\"\n#include \"CCEventKeyboard.h\"\n#include \"CCEventListenerKeyboard.h\"\n#include \"CCEventAcceleration.h\"\n#include \"CCEventListenerAcceleration.h\"\n#include \"platform/CCDevice.h\"\n#include \"CCScene.h\"\n#include \"renderer/CCCustomCommand.h\"\n#include \"renderer/CCRenderer.h\"\n\nNS_CC_BEGIN\n\n// Layer\nLayer::Layer()\n: _touchEnabled(false)\n, _accelerometerEnabled(false)\n, _keyboardEnabled(false)\n, _touchListener(nullptr)\n, _keyboardListener(nullptr)\n, _accelerationListener(nullptr)\n, _touchMode(Touch::DispatchMode::ALL_AT_ONCE)\n, _swallowsTouches(true)\n{\n    _ignoreAnchorPointForPosition = true;\n    setAnchorPoint(Point(0.5f, 0.5f));\n}\n\nLayer::~Layer()\n{\n\n}\n\nbool Layer::init()\n{\n    bool ret = false;\n    do \n    {        \n        Director * director;\n        CC_BREAK_IF(!(director = Director::getInstance()));\n        this->setContentSize(director->getWinSize());\n        // success\n        ret = true;\n    } while(0);\n    return ret;\n}\n\nLayer *Layer::create()\n{\n    Layer *ret = new Layer();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n        return nullptr;\n    }\n}\n\nint Layer::executeScriptTouchHandler(EventTouch::EventCode eventType, Touch* touch)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        TouchScriptData data(eventType, this, touch);\n        ScriptEvent event(kTouchEvent, &data);\n        return ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n\n    //can not reach it\n    return 0;\n}\n\nint Layer::executeScriptTouchesHandler(EventTouch::EventCode eventType, const std::vector<Touch*>& touches)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        TouchesScriptData data(eventType, this, touches);\n        ScriptEvent event(kTouchesEvent, &data);\n        return ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n\n    return 0;\n}\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (push)\n#pragma warning (disable: 4996)\n#endif\n\n/// isTouchEnabled getter\nbool Layer::isTouchEnabled() const\n{\n    return _touchEnabled;\n}\n\n/// isTouchEnabled setter\nvoid Layer::setTouchEnabled(bool enabled)\n{\n    if (_touchEnabled != enabled)\n    {\n        _touchEnabled = enabled;\n        if (enabled)\n        {\n            if (_touchListener != nullptr)\n                return;\n\n            if( _touchMode == Touch::DispatchMode::ALL_AT_ONCE )\n            {\n                // Register Touch Event\n                auto listener = EventListenerTouchAllAtOnce::create();\n\n                listener->onTouchesBegan = CC_CALLBACK_2(Layer::onTouchesBegan, this);\n                listener->onTouchesMoved = CC_CALLBACK_2(Layer::onTouchesMoved, this);\n                listener->onTouchesEnded = CC_CALLBACK_2(Layer::onTouchesEnded, this);\n                listener->onTouchesCancelled = CC_CALLBACK_2(Layer::onTouchesCancelled, this);\n\n                _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);\n                _touchListener = listener;\n            }\n            else\n            {\n                // Register Touch Event\n                auto listener = EventListenerTouchOneByOne::create();\n                listener->setSwallowTouches(_swallowsTouches);\n\n                listener->onTouchBegan = CC_CALLBACK_2(Layer::onTouchBegan, this);\n                listener->onTouchMoved = CC_CALLBACK_2(Layer::onTouchMoved, this);\n                listener->onTouchEnded = CC_CALLBACK_2(Layer::onTouchEnded, this);\n                listener->onTouchCancelled = CC_CALLBACK_2(Layer::onTouchCancelled, this);\n\n                _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);\n                _touchListener = listener;\n            }\n        }\n        else\n        {\n            _eventDispatcher->removeEventListener(_touchListener);\n            _touchListener = nullptr;\n        }\n    }\n}\n\nvoid Layer::setTouchMode(Touch::DispatchMode mode)\n{\n    if(_touchMode != mode)\n    {\n        _touchMode = mode;\n\n        if( _touchEnabled)\n        {\n            setTouchEnabled(false);\n            setTouchEnabled(true);\n        }\n    }\n}\n\nvoid Layer::setSwallowsTouches(bool swallowsTouches)\n{\n    if (_swallowsTouches != swallowsTouches)\n    {\n        _swallowsTouches = swallowsTouches;\n\n        if( _touchEnabled)\n        {\n            setTouchEnabled(false);\n            setTouchEnabled(true);\n        }\n    }\n}\n\nTouch::DispatchMode Layer::getTouchMode() const\n{\n    return _touchMode;\n}\n\nbool Layer::isSwallowsTouches() const\n{\n    return _swallowsTouches;\n}\n\n/// isAccelerometerEnabled getter\nbool Layer::isAccelerometerEnabled() const\n{\n    return _accelerometerEnabled;\n}\n/// isAccelerometerEnabled setter\nvoid Layer::setAccelerometerEnabled(bool enabled)\n{\n    if (enabled != _accelerometerEnabled)\n    {\n        _accelerometerEnabled = enabled;\n\n        Device::setAccelerometerEnabled(enabled);\n\n        _eventDispatcher->removeEventListener(_accelerationListener);\n        _accelerationListener = nullptr;\n\n        if (enabled)\n        {\n            _accelerationListener = EventListenerAcceleration::create(CC_CALLBACK_2(Layer::onAcceleration, this));\n            _eventDispatcher->addEventListenerWithSceneGraphPriority(_accelerationListener, this);\n        }\n    }\n}\n\nvoid Layer::setAccelerometerInterval(double interval) {\n    if (_accelerometerEnabled)\n    {\n        if (_running)\n        {\n            Device::setAccelerometerInterval(interval);\n        }\n    }\n}\n\nvoid Layer::onAcceleration(Acceleration* acc, Event* unused_event)\n{\n    CC_UNUSED_PARAM(acc);\n\n    if(kScriptTypeNone != _scriptType)\n    {\n        BasicScriptData data(this,(void*)acc);\n        ScriptEvent event(kAccelerometerEvent,&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n    CC_UNUSED_PARAM(unused_event);\n}\n\nvoid Layer::onKeyPressed(EventKeyboard::KeyCode keyCode, Event* unused_event)\n{\n    CC_UNUSED_PARAM(keyCode);\n    CC_UNUSED_PARAM(unused_event);\n}\n\nvoid Layer::onKeyReleased(EventKeyboard::KeyCode keyCode, Event* unused_event)\n{\n    CC_UNUSED_PARAM(unused_event);\n    if(kScriptTypeNone != _scriptType)\n    {\n        KeypadScriptData data(keyCode, this);\n        ScriptEvent event(kKeypadEvent,&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n}\n\n/// isKeyboardEnabled getter\nbool Layer::isKeyboardEnabled() const\n{\n    return _keyboardEnabled;\n}\n/// isKeyboardEnabled setter\nvoid Layer::setKeyboardEnabled(bool enabled)\n{\n    if (enabled != _keyboardEnabled)\n    {\n        _keyboardEnabled = enabled;\n\n        _eventDispatcher->removeEventListener(_keyboardListener);\n        _keyboardListener = nullptr;\n\n        if (enabled)\n        {\n            auto listener = EventListenerKeyboard::create();\n            listener->onKeyPressed = CC_CALLBACK_2(Layer::onKeyPressed, this);\n            listener->onKeyReleased = CC_CALLBACK_2(Layer::onKeyReleased, this);\n\n            _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);\n            _keyboardListener = listener;\n        }\n    }\n}\n\nvoid Layer::setKeypadEnabled(bool enabled)\n{\n    setKeyboardEnabled(enabled);\n}\n/// Callbacks\n\nbool Layer::onTouchBegan(Touch *touch, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        return executeScriptTouchHandler(EventTouch::EventCode::BEGAN, touch) == 0 ? false : true;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n    CCASSERT(false, \"Layer#ccTouchBegan override me\");\n    return true;\n}\n\nvoid Layer::onTouchMoved(Touch *touch, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        executeScriptTouchHandler(EventTouch::EventCode::MOVED, touch);\n        return;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n}\n\nvoid Layer::onTouchEnded(Touch *touch, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        executeScriptTouchHandler(EventTouch::EventCode::ENDED, touch);\n        return;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n}\n\nvoid Layer::onTouchCancelled(Touch *touch, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        executeScriptTouchHandler(EventTouch::EventCode::CANCELLED, touch);\n        return;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n}    \n\nvoid Layer::onTouchesBegan(const std::vector<Touch*>& touches, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        executeScriptTouchesHandler(EventTouch::EventCode::BEGAN, touches);\n        return;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n}\n\nvoid Layer::onTouchesMoved(const std::vector<Touch*>& touches, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        executeScriptTouchesHandler(EventTouch::EventCode::MOVED, touches);\n        return;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n}\n\nvoid Layer::onTouchesEnded(const std::vector<Touch*>& touches, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        executeScriptTouchesHandler(EventTouch::EventCode::ENDED, touches);\n        return;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n}\n\nvoid Layer::onTouchesCancelled(const std::vector<Touch*>& touches, Event *unused_event)\n{\n    if (kScriptTypeNone != _scriptType)\n    {\n        executeScriptTouchesHandler(EventTouch::EventCode::CANCELLED, touches);\n        return;\n    }\n\n    CC_UNUSED_PARAM(unused_event);\n}\n\nstd::string Layer::getDescription() const\n{\n    return StringUtils::format(\"<Layer | Tag = %d>\", _tag);\n}\n\n__LayerRGBA::__LayerRGBA()\n{\n    CCLOG(\"LayerRGBA deprecated.\");\n}\n\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic warning \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (pop)\n#endif\n/// LayerColor\n\nLayerColor::LayerColor()\n{\n    // default blend function\n    _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n}\n    \nLayerColor::~LayerColor()\n{\n}\n\n/// blendFunc getter\nconst BlendFunc &LayerColor::getBlendFunc() const\n{\n    return _blendFunc;\n}\n/// blendFunc setter\nvoid LayerColor::setBlendFunc(const BlendFunc &var)\n{\n    _blendFunc = var;\n}\n\nLayerColor* LayerColor::create()\n{\n    LayerColor* ret = new LayerColor();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nLayerColor * LayerColor::create(const Color4B& color, GLfloat width, GLfloat height)\n{\n    LayerColor * layer = new LayerColor();\n    if( layer && layer->initWithColor(color,width,height))\n    {\n        layer->autorelease();\n        return layer;\n    }\n    CC_SAFE_DELETE(layer);\n    return nullptr;\n}\n\nLayerColor * LayerColor::create(const Color4B& color)\n{\n    LayerColor * layer = new LayerColor();\n    if(layer && layer->initWithColor(color))\n    {\n        layer->autorelease();\n        return layer;\n    }\n    CC_SAFE_DELETE(layer);\n    return nullptr;\n}\n\nbool LayerColor::init()\n{\n    Size s = Director::getInstance()->getWinSize();\n    return initWithColor(Color4B(0,0,0,0), s.width, s.height);\n}\n\nbool LayerColor::initWithColor(const Color4B& color, GLfloat w, GLfloat h)\n{\n    if (Layer::init())\n    {\n\n        // default blend function\n        _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n\n        _displayedColor.r = _realColor.r = color.r;\n        _displayedColor.g = _realColor.g = color.g;\n        _displayedColor.b = _realColor.b = color.b;\n        _displayedOpacity = _realOpacity = color.a;\n\n        for (size_t i = 0; i<sizeof(_squareVertices) / sizeof( _squareVertices[0]); i++ )\n        {\n            _squareVertices[i].x = 0.0f;\n            _squareVertices[i].y = 0.0f;\n        }\n\n        updateColor();\n        setContentSize(Size(w, h));\n\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP));\n        return true;\n    }\n    return false;\n}\n\nbool LayerColor::initWithColor(const Color4B& color)\n{\n    Size s = Director::getInstance()->getWinSize();\n    this->initWithColor(color, s.width, s.height);\n    return true;\n}\n\n/// override contentSize\nvoid LayerColor::setContentSize(const Size & size)\n{\n    _squareVertices[1].x = size.width;\n    _squareVertices[2].y = size.height;\n    _squareVertices[3].x = size.width;\n    _squareVertices[3].y = size.height;\n\n    Layer::setContentSize(size);\n}\n\nvoid LayerColor::changeWidthAndHeight(GLfloat w ,GLfloat h)\n{\n    this->setContentSize(Size(w, h));\n}\n\nvoid LayerColor::changeWidth(GLfloat w)\n{\n    this->setContentSize(Size(w, _contentSize.height));\n}\n\nvoid LayerColor::changeHeight(GLfloat h)\n{\n    this->setContentSize(Size(_contentSize.width, h));\n}\n\nvoid LayerColor::updateColor()\n{\n    for( unsigned int i=0; i < 4; i++ )\n    {\n        _squareColors[i].r = _displayedColor.r / 255.0f;\n        _squareColors[i].g = _displayedColor.g / 255.0f;\n        _squareColors[i].b = _displayedColor.b / 255.0f;\n        _squareColors[i].a = _displayedOpacity / 255.0f;\n    }\n}\n\nvoid LayerColor::draw()\n{\n    _customCommand.init(_globalZOrder);\n    _customCommand.func = CC_CALLBACK_0(LayerColor::onDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_customCommand);\n    \n    for(int i = 0; i < 4; ++i)\n    {\n        kmVec3 pos;\n        pos.x = _squareVertices[i].x; pos.y = _squareVertices[i].y; pos.z = _vertexZ;\n        kmVec3TransformCoord(&pos, &pos, &_modelViewTransform);\n        _noMVPVertices[i] = Vertex3F(pos.x,pos.y,pos.z);\n    }\n    \n}\n\nvoid LayerColor::onDraw()\n{\n    CC_NODE_DRAW_SETUP();\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR );\n    //\n    // Attributes\n    //\n#ifdef EMSCRIPTEN\n    setGLBufferData(_noMVPVertices, 4 * sizeof(Vertex3F), 0);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0);\n\n    setGLBufferData(_squareColors, 4 * sizeof(Color4F), 1);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors);\n#endif // EMSCRIPTEN\n\n    GL::blendFunc( _blendFunc.src, _blendFunc.dst );\n\n    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);\n\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nstd::string LayerColor::getDescription() const\n{\n    return StringUtils::format(\"<LayerColor | Tag = %d>\", _tag);\n}\n//\n// LayerGradient\n// \nLayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end)\n{\n    LayerGradient * layer = new LayerGradient();\n    if( layer && layer->initWithColor(start, end))\n    {\n        layer->autorelease();\n        return layer;\n    }\n    CC_SAFE_DELETE(layer);\n    return nullptr;\n}\n\nLayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end, const Point& v)\n{\n    LayerGradient * layer = new LayerGradient();\n    if( layer && layer->initWithColor(start, end, v))\n    {\n        layer->autorelease();\n        return layer;\n    }\n    CC_SAFE_DELETE(layer);\n    return nullptr;\n}\n\nLayerGradient* LayerGradient::create()\n{\n    LayerGradient* ret = new LayerGradient();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool LayerGradient::init()\n{\n\treturn initWithColor(Color4B(0, 0, 0, 255), Color4B(0, 0, 0, 255));\n}\n\nbool LayerGradient::initWithColor(const Color4B& start, const Color4B& end)\n{\n    return initWithColor(start, end, Point(0, -1));\n}\n\nbool LayerGradient::initWithColor(const Color4B& start, const Color4B& end, const Point& v)\n{\n    _endColor.r  = end.r;\n    _endColor.g  = end.g;\n    _endColor.b  = end.b;\n\n    _endOpacity   = end.a;\n    _startOpacity    = start.a;\n    _alongVector   = v;\n\n    _compressedInterpolation = true;\n\n    return LayerColor::initWithColor(Color4B(start.r, start.g, start.b, 255));\n}\n\nvoid LayerGradient::updateColor()\n{\n    LayerColor::updateColor();\n\n    float h = _alongVector.getLength();\n    if (h == 0)\n        return;\n\n    float c = sqrtf(2.0f);\n    Point u = Point(_alongVector.x / h, _alongVector.y / h);\n\n    // Compressed Interpolation mode\n    if (_compressedInterpolation)\n    {\n        float h2 = 1 / ( fabsf(u.x) + fabsf(u.y) );\n        u = u * (h2 * (float)c);\n    }\n\n    float opacityf = (float)_displayedOpacity / 255.0f;\n\n    Color4F S(\n        _displayedColor.r / 255.0f,\n        _displayedColor.g / 255.0f,\n        _displayedColor.b / 255.0f,\n        _startOpacity * opacityf / 255.0f\n    );\n\n    Color4F E(\n        _endColor.r / 255.0f,\n        _endColor.g / 255.0f,\n        _endColor.b / 255.0f,\n        _endOpacity * opacityf / 255.0f\n    );\n\n    // (-1, -1)\n    _squareColors[0].r = E.r + (S.r - E.r) * ((c + u.x + u.y) / (2.0f * c));\n    _squareColors[0].g = E.g + (S.g - E.g) * ((c + u.x + u.y) / (2.0f * c));\n    _squareColors[0].b = E.b + (S.b - E.b) * ((c + u.x + u.y) / (2.0f * c));\n    _squareColors[0].a = E.a + (S.a - E.a) * ((c + u.x + u.y) / (2.0f * c));\n    // (1, -1)\n    _squareColors[1].r = E.r + (S.r - E.r) * ((c - u.x + u.y) / (2.0f * c));\n    _squareColors[1].g = E.g + (S.g - E.g) * ((c - u.x + u.y) / (2.0f * c));\n    _squareColors[1].b = E.b + (S.b - E.b) * ((c - u.x + u.y) / (2.0f * c));\n    _squareColors[1].a = E.a + (S.a - E.a) * ((c - u.x + u.y) / (2.0f * c));\n    // (-1, 1)\n    _squareColors[2].r = E.r + (S.r - E.r) * ((c + u.x - u.y) / (2.0f * c));\n    _squareColors[2].g = E.g + (S.g - E.g) * ((c + u.x - u.y) / (2.0f * c));\n    _squareColors[2].b = E.b + (S.b - E.b) * ((c + u.x - u.y) / (2.0f * c));\n    _squareColors[2].a = E.a + (S.a - E.a) * ((c + u.x - u.y) / (2.0f * c));\n    // (1, 1)\n    _squareColors[3].r = E.r + (S.r - E.r) * ((c - u.x - u.y) / (2.0f * c));\n    _squareColors[3].g = E.g + (S.g - E.g) * ((c - u.x - u.y) / (2.0f * c));\n    _squareColors[3].b = E.b + (S.b - E.b) * ((c - u.x - u.y) / (2.0f * c));\n    _squareColors[3].a = E.a + (S.a - E.a) * ((c - u.x - u.y) / (2.0f * c));\n}\n\nconst Color3B& LayerGradient::getStartColor() const\n{\n    return _realColor;\n}\n\nvoid LayerGradient::setStartColor(const Color3B& color)\n{\n    setColor(color);\n}\n\nvoid LayerGradient::setEndColor(const Color3B& color)\n{\n    _endColor = color;\n    updateColor();\n}\n\nconst Color3B& LayerGradient::getEndColor() const\n{\n    return _endColor;\n}\n\nvoid LayerGradient::setStartOpacity(GLubyte o)\n{\n    _startOpacity = o;\n    updateColor();\n}\n\nGLubyte LayerGradient::getStartOpacity() const\n{\n    return _startOpacity;\n}\n\nvoid LayerGradient::setEndOpacity(GLubyte o)\n{\n    _endOpacity = o;\n    updateColor();\n}\n\nGLubyte LayerGradient::getEndOpacity() const\n{\n    return _endOpacity;\n}\n\nvoid LayerGradient::setVector(const Point& var)\n{\n    _alongVector = var;\n    updateColor();\n}\n\nconst Point& LayerGradient::getVector() const\n{\n    return _alongVector;\n}\n\nbool LayerGradient::isCompressedInterpolation() const\n{\n    return _compressedInterpolation;\n}\n\nvoid LayerGradient::setCompressedInterpolation(bool compress)\n{\n    _compressedInterpolation = compress;\n    updateColor();\n}\n\nstd::string LayerGradient::getDescription() const\n{\n    return StringUtils::format(\"<LayerGradient | Tag = %d>\", _tag);\n}\n\n/// MultiplexLayer\n\nLayerMultiplex::LayerMultiplex()\n: _enabledLayer(0)\n{\n}\n\nLayerMultiplex::~LayerMultiplex()\n{\n    for(const auto &layer : _layers) {\n        layer->cleanup();\n    }\n}\n\nLayerMultiplex * LayerMultiplex::create(Layer * layer, ...)\n{\n    va_list args;\n    va_start(args,layer);\n\n    LayerMultiplex * multiplexLayer = new LayerMultiplex();\n    if(multiplexLayer && multiplexLayer->initWithLayers(layer, args))\n    {\n        multiplexLayer->autorelease();\n        va_end(args);\n        return multiplexLayer;\n    }\n    va_end(args);\n    CC_SAFE_DELETE(multiplexLayer);\n    return nullptr;\n}\n\nLayerMultiplex * LayerMultiplex::createWithLayer(Layer* layer)\n{\n    return LayerMultiplex::create(layer, nullptr);\n}\n\nLayerMultiplex* LayerMultiplex::create()\n{\n    LayerMultiplex* ret = new LayerMultiplex();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nLayerMultiplex* LayerMultiplex::createWithArray(const Vector<Layer*>& arrayOfLayers)\n{\n    LayerMultiplex* ret = new LayerMultiplex();\n    if (ret && ret->initWithArray(arrayOfLayers))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nvoid LayerMultiplex::addLayer(Layer* layer)\n{\n    _layers.pushBack(layer);\n}\n\nbool LayerMultiplex::init()\n{\n    if (Layer::init())\n    {\n        _enabledLayer = 0;\n        return true;\n    }\n    return false;\n}\n\nbool LayerMultiplex::initWithLayers(Layer *layer, va_list params)\n{\n    if (Layer::init())\n    {\n        _layers.reserve(5);\n        _layers.pushBack(layer);\n\n        Layer *l = va_arg(params,Layer*);\n        while( l ) {\n            _layers.pushBack(l);\n            l = va_arg(params,Layer*);\n        }\n\n        _enabledLayer = 0;\n        this->addChild(_layers.at(_enabledLayer));\n        return true;\n    }\n\n    return false;\n}\n\nbool LayerMultiplex::initWithArray(const Vector<Layer*>& arrayOfLayers)\n{\n    if (Layer::init())\n    {\n        _layers.reserve(arrayOfLayers.size());\n        _layers.pushBack(arrayOfLayers);\n\n        _enabledLayer = 0;\n        this->addChild(_layers.at(_enabledLayer));\n        return true;\n    }\n    return false;\n}\n\nvoid LayerMultiplex::switchTo(int n)\n{\n    CCASSERT( n < _layers.size(), \"Invalid index in MultiplexLayer switchTo message\" );\n\n    this->removeChild(_layers.at(_enabledLayer), true);\n\n    _enabledLayer = n;\n\n    this->addChild(_layers.at(n));\n}\n\nvoid LayerMultiplex::switchToAndReleaseMe(int n)\n{\n    CCASSERT( n < _layers.size(), \"Invalid index in MultiplexLayer switchTo message\" );\n\n    this->removeChild(_layers.at(_enabledLayer), true);\n\n    _layers.replace(_enabledLayer, nullptr);\n\n    _enabledLayer = n;\n\n    this->addChild(_layers.at(n));\n}\n\nstd::string LayerMultiplex::getDescription() const\n{\n    return StringUtils::format(\"<LayerMultiplex | Tag = %d, Layers = %d\", _tag, static_cast<int>(_children.size()));\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCLayer.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCLAYER_H__\n#define __CCLAYER_H__\n\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"CCArray.h\"\n#ifdef EMSCRIPTEN\n#include \"CCGLBufferedNode.h\"\n#endif // EMSCRIPTEN\n\n#include \"CCEventKeyboard.h\"\n#include \"renderer/CCCustomCommand.h\"\n#include \"renderer/CCQuadCommand.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup layer\n * @{\n */\n\nclass TouchScriptHandlerEntry;\n\nclass EventListenerTouch;\nclass EventListenerKeyboard;\nclass EventListenerAcceleration;\n\n//\n// Layer\n//\n/** @brief Layer is a subclass of Node that implements the TouchEventsDelegate protocol.\n\nAll features from Node are valid, plus the following new features:\n- It can receive iPhone Touches\n- It can receive Accelerometer input\n*/\nclass CC_DLL Layer : public Node\n{\npublic:    \n    /** creates a fullscreen black layer */\n    static Layer *create();\n\n    // Deprecated touch callbacks.\n    CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;};\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(Touch *pTouch, Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}\n    \n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(__Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(__Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(__Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(__Set *pTouches, Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    \n\t/* Callback function should not be deprecated, it will generate lots of warnings.\n\tSince 'setTouchEnabled' was deprecated, it will make warnings if developer overrides onTouchXXX and invokes setTouchEnabled(true) instead of using EventDispatcher::addEventListenerWithXXX.\n    */\n\tvirtual bool onTouchBegan(Touch *touch, Event *unused_event); \n    virtual void onTouchMoved(Touch *touch, Event *unused_event); \n    virtual void onTouchEnded(Touch *touch, Event *unused_event); \n    virtual void onTouchCancelled(Touch *touch, Event *unused_event);\n\n    virtual void onTouchesBegan(const std::vector<Touch*>& touches, Event *unused_event);\n    virtual void onTouchesMoved(const std::vector<Touch*>& touches, Event *unused_event);\n    virtual void onTouchesEnded(const std::vector<Touch*>& touches, Event *unused_event);\n    virtual void onTouchesCancelled(const std::vector<Touch*>&touches, Event *unused_event);\n    /** @deprecated Please override onAcceleration */\n    CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(Acceleration* accelerationValue) final {};\n\n\t/* Callback function should not be deprecated, it will generate lots of warnings.\n\tSince 'setAccelerometerEnabled' was deprecated, it will make warnings if developer overrides onAcceleration and invokes setAccelerometerEnabled(true) instead of using EventDispatcher::addEventListenerWithXXX.\n    */\n    virtual void onAcceleration(Acceleration* acc, Event* unused_event);\n\n    /** If isTouchEnabled, this method is called onEnter. Override it to change the\n    way Layer receives touch events.\n    ( Default: TouchDispatcher::sharedDispatcher()->addStandardDelegate(this,0); )\n    Example:\n    void Layer::registerWithTouchDispatcher()\n    {\n    TouchDispatcher::sharedDispatcher()->addTargetedDelegate(this,INT_MIN+1,true);\n    }\n    @since v0.8.0\n    */\n    CC_DEPRECATED_ATTRIBUTE virtual void registerWithTouchDispatcher() final {};\n\n    /** whether or not it will receive Touch events.\n    You can enable / disable touch events with this property.\n    Only the touches of this node will be affected. This \"method\" is not propagated to it's children.\n    @since v0.8.1\n    */\n    CC_DEPRECATED_ATTRIBUTE bool isTouchEnabled() const;\n    CC_DEPRECATED_ATTRIBUTE void setTouchEnabled(bool value);\n    \n    CC_DEPRECATED_ATTRIBUTE virtual void setTouchMode(Touch::DispatchMode mode);\n    CC_DEPRECATED_ATTRIBUTE virtual Touch::DispatchMode getTouchMode() const;\n\n    /** swallowsTouches of the touch events. Default is true */\n    CC_DEPRECATED_ATTRIBUTE virtual void setSwallowsTouches(bool swallowsTouches);\n    CC_DEPRECATED_ATTRIBUTE virtual bool isSwallowsTouches() const;\n\n    /** whether or not it will receive Accelerometer events\n    You can enable / disable accelerometer events with this property.\n    @since v0.8.1\n    */\n    CC_DEPRECATED_ATTRIBUTE virtual bool isAccelerometerEnabled() const;\n    CC_DEPRECATED_ATTRIBUTE virtual void setAccelerometerEnabled(bool value);\n    CC_DEPRECATED_ATTRIBUTE virtual void setAccelerometerInterval(double interval);\n\n    /** whether or not it will receive keyboard or keypad events\n    You can enable / disable accelerometer events with this property.\n    it's new in cocos2d-x\n    */\n\n    CC_DEPRECATED_ATTRIBUTE virtual bool isKeyboardEnabled() const;\n    CC_DEPRECATED_ATTRIBUTE virtual void setKeyboardEnabled(bool value);\n\n    /** Please use onKeyPressed instead. */\n    CC_DEPRECATED_ATTRIBUTE virtual void keyPressed(int keyCode) final {};\n    \n    /** Please use onKeyReleased instead. */\n    CC_DEPRECATED_ATTRIBUTE virtual void keyReleased(int keyCode) final {};\n\n\t/* Callback function should not be deprecated, it will generate lots of warnings.\n\tSince 'setKeyboardEnabled' was deprecated, it will make warnings if developer overrides onKeyXXX and invokes setKeyboardEnabled(true) instead of using EventDispatcher::addEventListenerWithXXX.\n    */\n    virtual void onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event);\n    virtual void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event);\n\n    CC_DEPRECATED_ATTRIBUTE virtual bool isKeypadEnabled() const final { return _keyboardEnabled; }\n    CC_DEPRECATED_ATTRIBUTE virtual void setKeypadEnabled(bool value);\n\n    /** @deprecated Please override onKeyReleased and check the keycode of KeyboardEvent::KeyCode::Menu(KEY_BACKSPACE) instead. */\n    CC_DEPRECATED_ATTRIBUTE virtual void keyBackClicked() final {};\n    CC_DEPRECATED_ATTRIBUTE virtual void keyMenuClicked() final {};\n\n    // Overrides\n    virtual std::string getDescription() const override;\n\nprotected:\n    Layer();\n    virtual ~Layer();\n    virtual bool init();\n\n    //add the api for avoid use deprecated api\n    void _addTouchListener();\n\n    CC_DEPRECATED_ATTRIBUTE void addTouchListener() { _addTouchListener();};\n    CC_DEPRECATED_ATTRIBUTE int executeScriptTouchHandler(EventTouch::EventCode eventType, Touch* touch);\n    CC_DEPRECATED_ATTRIBUTE int executeScriptTouchesHandler(EventTouch::EventCode eventType, const std::vector<Touch*>& touches);\n\n    bool _touchEnabled;\n    bool _accelerometerEnabled;\n    bool _keyboardEnabled;\n    EventListener* _touchListener;\n    EventListenerKeyboard* _keyboardListener;\n    EventListenerAcceleration* _accelerationListener;\n\n    Touch::DispatchMode _touchMode;\n    bool _swallowsTouches;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Layer);\n\n};\n\n\n/** LayerRGBA is a subclass of Layer that implements the RGBAProtocol protocol using a solid color as the background.\n \n All features from Layer are valid, plus the following new features that propagate into children that conform to the RGBAProtocol:\n - opacity\n - RGB colors\n @since 2.1\n */\nclass CC_DLL __LayerRGBA : public Layer, public __RGBAProtocol\n{\npublic:\n    CREATE_FUNC(__LayerRGBA);\n    \n    \n    //\n    // Overrides\n    //\n    virtual GLubyte getOpacity() const override { return Layer::getOpacity(); }\n    virtual GLubyte getDisplayedOpacity() const override { return Layer::getDisplayedOpacity(); }\n    virtual void setOpacity(GLubyte opacity) override { return Layer::setOpacity(opacity); }\n    virtual void updateDisplayedOpacity(GLubyte parentOpacity) override { return Layer::updateDisplayedOpacity(parentOpacity); }\n    virtual bool isCascadeOpacityEnabled() const override { return Layer::isCascadeOpacityEnabled(); }\n    virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled) override { return Layer::setCascadeOpacityEnabled(cascadeOpacityEnabled); }\n\n    virtual const Color3B& getColor() const override { return Layer::getColor(); }\n    virtual const Color3B& getDisplayedColor() const override { return Layer::getDisplayedColor(); }\n    virtual void setColor(const Color3B& color) override { return Layer::setColor(color); }\n    virtual void updateDisplayedColor(const Color3B& parentColor) override { return Layer::updateDisplayedColor(parentColor); }\n    virtual bool isCascadeColorEnabled() const override { return Layer::isCascadeOpacityEnabled(); }\n    virtual void setCascadeColorEnabled(bool cascadeColorEnabled) override { return Layer::setCascadeColorEnabled(cascadeColorEnabled); }\n\n    virtual void setOpacityModifyRGB(bool bValue) override { return Layer::setOpacityModifyRGB(bValue); }\n    virtual bool isOpacityModifyRGB() const override { return Layer::isOpacityModifyRGB(); }\n\nprotected:\n    __LayerRGBA();\n    virtual ~__LayerRGBA() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(__LayerRGBA);\n};\n\n//\n// LayerColor\n//\n/** @brief LayerColor is a subclass of Layer that implements the RGBAProtocol protocol.\n\nAll features from Layer are valid, plus the following new features:\n- opacity\n- RGB colors\n*/\nclass CC_DLL LayerColor : public Layer, public BlendProtocol\n#ifdef EMSCRIPTEN\n, public GLBufferedNode\n#endif // EMSCRIPTEN\n{\npublic:\n    /** creates a fullscreen black layer */\n    static LayerColor* create();\n    /** creates a Layer with color, width and height in Points */\n    static LayerColor * create(const Color4B& color, GLfloat width, GLfloat height);\n    /** creates a Layer with color. Width and height are the window size. */\n    static LayerColor * create(const Color4B& color);\n\n    /** change width in Points*/\n    void changeWidth(GLfloat w);\n    /** change height in Points*/\n    void changeHeight(GLfloat h);\n    /** change width and height in Points\n    @since v0.8\n    */\n    void changeWidthAndHeight(GLfloat w ,GLfloat h);\n\n    //\n    // Overrides\n    //\n    virtual void draw() override;\n    virtual void onDraw();\n    \n    virtual void setContentSize(const Size & var) override;\n    /** BlendFunction. Conforms to BlendProtocol protocol */\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const BlendFunc& getBlendFunc() const override;\n    /**\n    *@code\n    *When this function bound into js or lua,the parameter will be changed\n    *In js: var setBlendFunc(var src, var dst)\n    *In lua: local setBlendFunc(local src, local dst)\n    *@endcode\n    */\n    virtual void setBlendFunc(const BlendFunc& blendFunc) override;\n\n    virtual std::string getDescription() const override;\n\nprotected:\n    LayerColor();\n    virtual ~LayerColor();\n    virtual bool init();\n    bool initWithColor(const Color4B& color, GLfloat width, GLfloat height);\n    bool initWithColor(const Color4B& color);\n\n    virtual void updateColor() override;\n\n    BlendFunc _blendFunc;\n    Vertex2F _squareVertices[4];\n    Color4F  _squareColors[4];\n    CustomCommand _customCommand;\n    Vertex3F _noMVPVertices[4];\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(LayerColor);\n\n};\n\n//\n// LayerGradient\n//\n/** @brief LayerGradient is a subclass of LayerColor that draws gradients across the background.\n\nAll features from LayerColor are valid, plus the following new features:\n- direction\n- final color\n- interpolation mode\n\nColor is interpolated between the startColor and endColor along the given\nvector (starting at the origin, ending at the terminus).  If no vector is\nsupplied, it defaults to (0, -1) -- a fade from top to bottom.\n\nIf 'compressedInterpolation' is disabled, you will not see either the start or end color for\nnon-cardinal vectors; a smooth gradient implying both end points will be still\nbe drawn, however.\n\nIf ' compressedInterpolation' is enabled (default mode) you will see both the start and end colors of the gradient.\n\n@since v0.99.5\n*/\nclass CC_DLL LayerGradient : public LayerColor\n{\npublic:\n    /** Creates a fullscreen black layer */\n    static LayerGradient* create();\n\n    /** Creates a full-screen Layer with a gradient between start and end. */\n    static LayerGradient* create(const Color4B& start, const Color4B& end);\n\n    /** Creates a full-screen Layer with a gradient between start and end in the direction of v. */\n    static LayerGradient* create(const Color4B& start, const Color4B& end, const Point& v);\n\n    virtual bool init();\n    /** Initializes the Layer with a gradient between start and end. \n     * @js init\n     * @lua init\n     */\n    bool initWithColor(const Color4B& start, const Color4B& end);\n\n    /** Initializes the Layer with a gradient between start and end in the direction of v. \n     * @js init\n     * @lua init\n     */\n    bool initWithColor(const Color4B& start, const Color4B& end, const Point& v);\n    \n    /** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors\n     Default: true\n     */\n    void setCompressedInterpolation(bool compressedInterpolation);\n    bool isCompressedInterpolation() const;\n\n    /** Sets the start color of the gradient */\n    void setStartColor( const Color3B& startColor );\n    /** Returns the start color of the gradient */\n    const Color3B& getStartColor() const;\n\n    /** Sets the end color of the gradient */\n    void setEndColor( const Color3B& endColor );\n    /** Returns the end color of the gradient */\n    const Color3B& getEndColor() const;\n\n    /** Returns the start opacity of the gradient */\n    void setStartOpacity( GLubyte startOpacity );\n    /** Returns the start opacity of the gradient */\n    GLubyte getStartOpacity() const;\n\n    /** Returns the end opacity of the gradient */\n    void setEndOpacity( GLubyte endOpacity );\n    /** Returns the end opacity of the gradient */\n    GLubyte getEndOpacity() const;\n\n    /** Sets the directional vector that will be used for the gradient.\n    The default value is vertical direction (0,-1). \n     */\n    void setVector(const Point& alongVector);\n    /** Returns the directional vector used for the gradient */\n    const Point& getVector() const;\n\n    virtual std::string getDescription() const override;\n\nprotected:\n    virtual void updateColor() override;\n\n    Color3B _startColor;\n    Color3B _endColor;\n    GLubyte _startOpacity;\n    GLubyte _endOpacity;\n    Point   _alongVector;\n    bool    _compressedInterpolation;\n};\n\n\n/** @brief MultipleLayer is a Layer with the ability to multiplex it's children.\nFeatures:\n- It supports one or more children\n- Only one children will be active a time\n*/\nclass CC_DLL LayerMultiplex : public Layer\n{\npublic:\n    /** creates and initializes a LayerMultiplex object \n     * @js NA\n     * @lua NA\n     */\n    static LayerMultiplex* create();\n\n    /** creates a LayerMultiplex with an array of layers.\n     @since v2.1\n     * @js NA\n     */\n    static LayerMultiplex* createWithArray(const Vector<Layer*>& arrayOfLayers);\n\n    /** creates a LayerMultiplex with one or more layers using a variable argument list. \n     * @code\n     * When this function bound to lua or js,the input params are changed.\n     * In js:var create(...)\n     * In lua:local create(...)\n     * @endcode\n     */\n    static LayerMultiplex * create(Layer* layer, ... );\n\n    /**\n     * lua script can not init with undetermined number of variables\n     * so add these functions to be used with lua.\n     * @js NA\n     * @lua NA\n     */\n    static LayerMultiplex * createWithLayer(Layer* layer);\n\n\n    void addLayer(Layer* layer);\n\n    /** switches to a certain layer indexed by n.\n     The current (old) layer will be removed from it's parent with 'cleanup=true'.\n     */\n    void switchTo(int n);\n    /** release the current layer and switches to another layer indexed by n.\n    The current (old) layer will be removed from it's parent with 'cleanup=true'.\n    */\n    void switchToAndReleaseMe(int n);\n\n    virtual std::string getDescription() const override;\n\nprotected:\n    \n    /**\n     * @js ctor\n     */\n    LayerMultiplex();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LayerMultiplex();\n    \n    virtual bool init();\n    /** initializes a MultiplexLayer with one or more layers using a variable argument list.\n     * @js NA\n     * @lua NA\n     */\n    bool initWithLayers(Layer* layer, va_list params);\n    \n    /** initializes a MultiplexLayer with an array of layers\n     @since v2.1\n     */\n    bool initWithArray(const Vector<Layer*>& arrayOfLayers);\n    \n    unsigned int _enabledLayer;\n    Vector<Layer*>    _layers;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(LayerMultiplex);\n};\n\n\n// end of layer group\n/// @}\n\nNS_CC_END\n\n#endif // __CCLAYER_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCMenu.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCMenu.h\"\n#include \"CCDirector.h\"\n#include \"CCApplication.h\"\n#include \"CCTouch.h\"\n#include \"CCStdC.h\"\n#include \"CCInteger.h\"\n#include \"CCEventListenerTouch.h\"\n#include \"CCString.h\"\n\n#include <vector>\n#include <stdarg.h>\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nenum \n{\n    kDefaultPadding =  5,\n};\n\n//\n//CCMenu\n//\n\nMenu::~Menu()\n{\n    CCLOGINFO(\"In the destructor of Menu. %p\", this);\n}\n\nMenu* Menu::create()\n{\n    return Menu::create(nullptr, nullptr);\n}\n\nMenu * Menu::create(MenuItem* item, ...)\n{\n    va_list args;\n    va_start(args,item);\n    \n    Menu *ret = Menu::createWithItems(item, args);\n    \n    va_end(args);\n    \n    return ret;\n}\n\nMenu* Menu::createWithArray(const Vector<MenuItem*>& arrayOfItems)\n{\n    auto ret = new Menu();\n    if (ret && ret->initWithArray(arrayOfItems))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    \n    return ret;\n}\n\nMenu* Menu::createWithItems(MenuItem* item, va_list args)\n{\n    Vector<MenuItem*> items;\n    if( item )\n    {\n        items.pushBack(item);\n        MenuItem *i = va_arg(args, MenuItem*);\n        while(i)\n        {\n            items.pushBack(i);\n            i = va_arg(args, MenuItem*);\n        }\n    }\n    \n    return Menu::createWithArray(items);\n}\n\nMenu* Menu::createWithItem(MenuItem* item)\n{\n    return Menu::create(item, nullptr);\n}\n\nbool Menu::init()\n{\n    return initWithArray(Vector<MenuItem*>());\n}\n\nbool Menu::initWithArray(const Vector<MenuItem*>& arrayOfItems)\n{\n    if (Layer::init())\n    {\n        _enabled = true;\n        // menu in the center of the screen\n        Size s = Director::getInstance()->getWinSize();\n\n        this->ignoreAnchorPointForPosition(true);\n        setAnchorPoint(Point(0.5f, 0.5f));\n        this->setContentSize(s);\n\n        setPosition(Point(s.width/2, s.height/2));\n        \n        int z=0;\n        \n        for (auto& item : arrayOfItems)\n        {\n            this->addChild(item, z);\n            z++;\n        }\n    \n        _selectedItem = nullptr;\n        _state = Menu::State::WAITING;\n        \n        // enable cascade color and opacity on menus\n        setCascadeColorEnabled(true);\n        setCascadeOpacityEnabled(true);\n        \n        \n        auto touchListener = EventListenerTouchOneByOne::create();\n        touchListener->setSwallowTouches(true);\n        \n        touchListener->onTouchBegan = CC_CALLBACK_2(Menu::onTouchBegan, this);\n        touchListener->onTouchMoved = CC_CALLBACK_2(Menu::onTouchMoved, this);\n        touchListener->onTouchEnded = CC_CALLBACK_2(Menu::onTouchEnded, this);\n        touchListener->onTouchCancelled = CC_CALLBACK_2(Menu::onTouchCancelled, this);\n        \n        _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);\n        \n        return true;\n    }\n    return false;\n}\n\n/*\n* override add:\n*/\nvoid Menu::addChild(Node * child)\n{\n    Layer::addChild(child);\n}\n\nvoid Menu::addChild(Node * child, int zOrder)\n{\n    Layer::addChild(child, zOrder);\n}\n\nvoid Menu::addChild(Node * child, int zOrder, int tag)\n{\n    CCASSERT( dynamic_cast<MenuItem*>(child) != nullptr, \"Menu only supports MenuItem objects as children\");\n    Layer::addChild(child, zOrder, tag);\n}\n\nvoid Menu::onEnter()\n{\n    Layer::onEnter();\n}\n\nvoid Menu::onExit()\n{\n    if (_state == Menu::State::TRACKING_TOUCH)\n    {\n        if (_selectedItem)\n        {\n            _selectedItem->unselected();\n            _selectedItem = nullptr;\n        }\n        \n        _state = Menu::State::WAITING;\n    }\n\n    Layer::onExit();\n}\n\nvoid Menu::removeChild(Node* child, bool cleanup)\n{\n    MenuItem *menuItem = dynamic_cast<MenuItem*>(child);\n    CCASSERT(menuItem != nullptr, \"Menu only supports MenuItem objects as children\");\n    \n    if (_selectedItem == menuItem)\n    {\n        _selectedItem = nullptr;\n    }\n    \n    Node::removeChild(child, cleanup);\n}\n\n//Menu - Events\n\nbool Menu::onTouchBegan(Touch* touch, Event* event)\n{\n    if (_state != Menu::State::WAITING || ! _visible || !_enabled)\n    {\n        return false;\n    }\n    \n    for (Node *c = this->_parent; c != nullptr; c = c->getParent())\n    {\n        if (c->isVisible() == false)\n        {\n            return false;\n        }\n    }\n    \n    _selectedItem = this->getItemForTouch(touch);\n    if (_selectedItem)\n    {\n        _state = Menu::State::TRACKING_TOUCH;\n        _selectedItem->selected();\n        \n        return true;\n    }\n    \n    return false;\n}\n\nvoid Menu::onTouchEnded(Touch* touch, Event* event)\n{\n    CCASSERT(_state == Menu::State::TRACKING_TOUCH, \"[Menu ccTouchEnded] -- invalid state\");\n    this->retain();\n    if (_selectedItem)\n    {\n        _selectedItem->unselected();\n        _selectedItem->activate();\n    }\n    _state = Menu::State::WAITING;\n    this->release();\n}\n\nvoid Menu::onTouchCancelled(Touch* touch, Event* event)\n{\n    CCASSERT(_state == Menu::State::TRACKING_TOUCH, \"[Menu ccTouchCancelled] -- invalid state\");\n    this->retain();\n    if (_selectedItem)\n    {\n        _selectedItem->unselected();\n    }\n    _state = Menu::State::WAITING;\n    this->release();\n}\n\nvoid Menu::onTouchMoved(Touch* touch, Event* event)\n{\n    CCASSERT(_state == Menu::State::TRACKING_TOUCH, \"[Menu ccTouchMoved] -- invalid state\");\n    MenuItem *currentItem = this->getItemForTouch(touch);\n    if (currentItem != _selectedItem)\n    {\n        if (_selectedItem)\n        {\n            _selectedItem->unselected();\n        }\n        _selectedItem = currentItem;\n        if (_selectedItem)\n        {\n            _selectedItem->selected();\n        }\n    }\n}\n\n//Menu - Alignment\nvoid Menu::alignItemsVertically()\n{\n    this->alignItemsVerticallyWithPadding(kDefaultPadding);\n}\n\nvoid Menu::alignItemsVerticallyWithPadding(float padding)\n{\n    float height = -padding;\n\n    for(const auto &child : _children)\n        height += child->getContentSize().height * child->getScaleY() + padding;\n\n    float y = height / 2.0f;\n    \n    for(const auto &child : _children) {\n        child->setPosition(Point(0, y - child->getContentSize().height * child->getScaleY() / 2.0f));\n        y -= child->getContentSize().height * child->getScaleY() + padding;\n    }\n}\n\nvoid Menu::alignItemsHorizontally(void)\n{\n    this->alignItemsHorizontallyWithPadding(kDefaultPadding);\n}\n\nvoid Menu::alignItemsHorizontallyWithPadding(float padding)\n{\n    float width = -padding;\n    for(const auto &child : _children)\n        width += child->getContentSize().width * child->getScaleX() + padding;\n\n    float x = -width / 2.0f;\n    \n    for(const auto &child : _children) {\n        child->setPosition(Point(x + child->getContentSize().width * child->getScaleX() / 2.0f, 0));\n        x += child->getContentSize().width * child->getScaleX() + padding;\n    }\n}\n\nvoid Menu::alignItemsInColumns(int columns, ...)\n{\n    va_list args;\n    va_start(args, columns);\n\n    this->alignItemsInColumns(columns, args);\n\n    va_end(args);\n}\n\nvoid Menu::alignItemsInColumns(int columns, va_list args)\n{\n    CCASSERT(columns >= 0, \"Columns must be >= 0\");\n    ValueVector rows;\n    while (columns)\n    {\n        rows.push_back(Value(columns));\n        columns = va_arg(args, int);\n    }\n    alignItemsInColumnsWithArray(rows);\n}\n\nvoid Menu::alignItemsInColumnsWithArray(const ValueVector& rows)\n{\n    int height = -5;\n    size_t row = 0;\n    int rowHeight = 0;\n    int columnsOccupied = 0;\n    int rowColumns = 0;\n\n    for(const auto &child : _children) {\n        CCASSERT(row < rows.size(), \"\");\n        \n        rowColumns = rows[row].asInt();\n        // can not have zero columns on a row\n        CCASSERT(rowColumns, \"\");\n        \n        float tmp = child->getContentSize().height;\n        rowHeight = (unsigned int)((rowHeight >= tmp || isnan(tmp)) ? rowHeight : tmp);\n        \n        ++columnsOccupied;\n        if (columnsOccupied >= rowColumns)\n        {\n            height += rowHeight + 5;\n            \n            columnsOccupied = 0;\n            rowHeight = 0;\n            ++row;\n        }\n    }\n\n    // check if too many rows/columns for available menu items\n    CCASSERT(! columnsOccupied, \"\");\n\n    Size winSize = Director::getInstance()->getWinSize();\n\n    row = 0;\n    rowHeight = 0;\n    rowColumns = 0;\n    float w = 0.0;\n    float x = 0.0;\n    float y = (float)(height / 2);\n\n    for(const auto &child : _children) {\n        if (rowColumns == 0)\n        {\n            rowColumns = rows[row].asInt();\n            w = winSize.width / (1 + rowColumns);\n            x = w;\n        }\n\n        float tmp = child->getContentSize().height;\n        rowHeight = (unsigned int)((rowHeight >= tmp || isnan(tmp)) ? rowHeight : tmp);\n\n        child->setPosition(Point(x - winSize.width / 2,\n                               y - child->getContentSize().height / 2));\n\n        x += w;\n        ++columnsOccupied;\n\n        if (columnsOccupied >= rowColumns)\n        {\n            y -= rowHeight + 5;\n\n            columnsOccupied = 0;\n            rowColumns = 0;\n            rowHeight = 0;\n            ++row;\n        }\n    }\n}\n\nvoid Menu::alignItemsInRows(int rows, ...)\n{\n    va_list args;\n    va_start(args, rows);\n\n    this->alignItemsInRows(rows, args);\n\n    va_end(args);\n}\n\nvoid Menu::alignItemsInRows(int rows, va_list args)\n{\n    ValueVector array;\n    while (rows)\n    {\n        array.push_back(Value(rows));\n        rows = va_arg(args, int);\n    }\n    alignItemsInRowsWithArray(array);\n}\n\nvoid Menu::alignItemsInRowsWithArray(const ValueVector& columns)\n{\n    vector<int> columnWidths;\n    vector<int> columnHeights;\n\n    int width = -10;\n    int columnHeight = -5;\n    size_t column = 0;\n    int columnWidth = 0;\n    int rowsOccupied = 0;\n    int columnRows;\n\n    for(const auto &child : _children) {\n        // check if too many menu items for the amount of rows/columns\n        CCASSERT(column < columns.size(), \"\");\n\n        columnRows = columns[column].asInt();\n        // can't have zero rows on a column\n        CCASSERT(columnRows, \"\");\n\n        // columnWidth = fmaxf(columnWidth, [item contentSize].width);\n        float tmp = child->getContentSize().width;\n        columnWidth = (unsigned int)((columnWidth >= tmp || isnan(tmp)) ? columnWidth : tmp);\n\n        columnHeight += (int)(child->getContentSize().height + 5);\n        ++rowsOccupied;\n\n        if (rowsOccupied >= columnRows)\n        {\n            columnWidths.push_back(columnWidth);\n            columnHeights.push_back(columnHeight);\n            width += columnWidth + 10;\n\n            rowsOccupied = 0;\n            columnWidth = 0;\n            columnHeight = -5;\n            ++column;\n        }\n    }\n\n    // check if too many rows/columns for available menu items.\n    CCASSERT(! rowsOccupied, \"\");\n\n    Size winSize = Director::getInstance()->getWinSize();\n\n    column = 0;\n    columnWidth = 0;\n    columnRows = 0;\n    float x = (float)(-width / 2);\n    float y = 0.0;\n\n    for(const auto &child : _children) {\n        if (columnRows == 0)\n        {\n            columnRows = columns[column].asInt();\n            y = (float) columnHeights[column];\n        }\n\n        // columnWidth = fmaxf(columnWidth, [item contentSize].width);\n        float tmp = child->getContentSize().width;\n        columnWidth = (unsigned int)((columnWidth >= tmp || isnan(tmp)) ? columnWidth : tmp);\n\n        child->setPosition(Point(x + columnWidths[column] / 2,\n                               y - winSize.height / 2));\n\n        y -= child->getContentSize().height + 10;\n        ++rowsOccupied;\n\n        if (rowsOccupied >= columnRows)\n        {\n            x += columnWidth + 5;\n            rowsOccupied = 0;\n            columnRows = 0;\n            columnWidth = 0;\n            ++column;\n        }\n    }\n}\n\nMenuItem* Menu::getItemForTouch(Touch *touch)\n{\n    Point touchLocation = touch->getLocation();\n\n    if (!_children.empty())\n    {\n        for (auto iter = _children.crbegin(); iter != _children.crend(); ++iter)\n        {\n            MenuItem* child = dynamic_cast<MenuItem*>(*iter);\n            if (child && child->isVisible() && child->isEnabled())\n            {\n                Point local = child->convertToNodeSpace(touchLocation);\n                Rect r = child->rect();\n                r.origin = Point::ZERO;\n                \n                if (r.containsPoint(local))\n                {\n                    return child;\n                }\n            }\n        }\n    }\n\n    return nullptr;\n}\n\nstd::string Menu::getDescription() const\n{\n    return StringUtils::format(\"<Menu | Tag = %d>\", _tag);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCMenu.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCMENU_H_\n#define __CCMENU_H_\n\n#include \"CCMenuItem.h\"\n#include \"CCLayer.h\"\n#include \"CCVector.h\"\n#include \"CCEventTouch.h\"\n#include \"CCValue.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup menu\n * @{\n */\n\n\n\n/** @brief A Menu\n* \n* Features and Limitation:\n*  - You can add MenuItem objects in runtime using addChild:\n*  - But the only accepted children are MenuItem objects\n*/\nclass CC_DLL Menu : public Layer\n{\npublic:\n    enum class State\n    {\n        WAITING,\n        TRACKING_TOUCH,\n    };\n    \n    /** creates an empty Menu */\n    static Menu* create();\n\n    /** creates a Menu with MenuItem objects */\n    static Menu* create(MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION;\n\n    /** creates a Menu with a Array of MenuItem objects */\n    static Menu* createWithArray(const Vector<MenuItem*>& arrayOfItems);\n\n    /** creates a Menu with it's item, then use addChild() to add \n      * other items. It is used for script, it can't init with undetermined\n      * number of variables.\n    */\n    static Menu* createWithItem(MenuItem* item);\n    \n    /** creates a Menu with MenuItem objects */\n    static Menu* createWithItems(MenuItem *firstItem, va_list args);\n\n    /** align items vertically */\n    void alignItemsVertically();\n    /** align items vertically with padding\n    @since v0.7.2\n    */\n    void alignItemsVerticallyWithPadding(float padding);\n\n    /** align items horizontally */\n    void alignItemsHorizontally();\n    /** align items horizontally with padding\n    @since v0.7.2\n    */\n    void alignItemsHorizontallyWithPadding(float padding);\n\n    /** align items in rows of columns */\n    void alignItemsInColumns(int columns, ...) CC_REQUIRES_NULL_TERMINATION;\n    void alignItemsInColumns(int columns, va_list args);\n    void alignItemsInColumnsWithArray(const ValueVector& rows);\n\n    /** align items in columns of rows */\n    void alignItemsInRows(int rows, ...) CC_REQUIRES_NULL_TERMINATION;\n    void alignItemsInRows(int rows, va_list args);\n    void alignItemsInRowsWithArray(const ValueVector& columns);\n\n    virtual bool isEnabled() const { return _enabled; }\n    virtual void setEnabled(bool value) { _enabled = value; };\n\n    virtual bool onTouchBegan(Touch* touch, Event* event);\n    virtual void onTouchEnded(Touch* touch, Event* event);\n    virtual void onTouchCancelled(Touch* touch, Event* event);\n    virtual void onTouchMoved(Touch* touch, Event* event);\n    \n    // overrides\n    virtual void removeChild(Node* child, bool cleanup) override;\n    \n    virtual void addChild(Node * child) override;\n    virtual void addChild(Node * child, int zOrder) override;\n    virtual void addChild(Node * child, int zOrder, int tag) override;\n    \n    virtual void onEnter() override;\n    virtual void onExit() override;\n    virtual void setOpacityModifyRGB(bool bValue) override {CC_UNUSED_PARAM(bValue);}\n    virtual bool isOpacityModifyRGB(void) const override { return false;}\n\n    virtual std::string getDescription() const override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    Menu() : _selectedItem(nullptr) {}\n    virtual ~Menu();\n\n    /** initializes an empty Menu */\n    bool init();\n\n    /** initializes a Menu with a NSArray of MenuItem objects */\n    bool initWithArray(const Vector<MenuItem*>& arrayOfItems);\n\n    /** whether or not the menu will receive events */\n    bool _enabled;\n\n    MenuItem* getItemForTouch(Touch * touch);\n    State _state;\n    MenuItem *_selectedItem;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Menu);\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_END\n\n#endif//__CCMENU_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCMenuItem.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCMenuItem.h\"\n#include \"CCActionInterval.h\"\n#include \"CCSprite.h\"\n#include \"CCLabelAtlas.h\"\n#include \"CCLabelTTF.h\"\n#include \"CCScriptSupport.h\"\n#include <stdarg.h>\n#include <cstring>\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (push)\n#pragma warning (disable: 4996)\n#endif\n\nNS_CC_BEGIN\n    \nstatic int _globalFontSize = kItemSize;\nstatic std::string _globalFontName = \"Marker Felt\";\nstatic bool _globalFontNameRelease = false;\n\nconst unsigned int    kCurrentItem = 0xc0c05001;\nconst unsigned int    kZoomActionTag = 0xc0c05002;\n\nconst unsigned int    kNormalTag = 0x1;\nconst unsigned int    kSelectedTag = 0x2;\nconst unsigned int    kDisableTag = 0x3;\n//\n// MenuItem\n//\n\nMenuItem* MenuItem::create()\n{\n    return MenuItem::create((const ccMenuCallback&)nullptr);\n}\n\n// XXX deprecated\nMenuItem* MenuItem::create(Object *target, SEL_MenuHandler selector)\n{\n    MenuItem *ret = new MenuItem();\n    ret->initWithTarget(target, selector);\n    ret->autorelease();\n    return ret;\n}\n\nMenuItem* MenuItem::create( const ccMenuCallback& callback)\n{\n    MenuItem *ret = new MenuItem();\n    ret->initWithCallback(callback);\n    ret->autorelease();\n    return ret;\n}\n\n// XXX deprecated\nbool MenuItem::initWithTarget(cocos2d::Object *target, SEL_MenuHandler selector )\n{\n\t_target = target;\n\tCC_SAFE_RETAIN(_target);\n\treturn initWithCallback( std::bind(selector,target, std::placeholders::_1) );\n}\n\nbool MenuItem::initWithCallback(const ccMenuCallback& callback)\n{\n    setAnchorPoint(Point(0.5f, 0.5f));\n\t_callback = callback;\n    _enabled = true;\n    _selected = false;\n    return true;\n}\n\nMenuItem::~MenuItem()\n{\n\tCC_SAFE_RELEASE(_target);\n}\n\nvoid MenuItem::selected()\n{\n    _selected = true;\n}\n\nvoid MenuItem::unselected()\n{\n    _selected = false;\n}\n\nvoid MenuItem::activate()\n{\n    if (_enabled)\n    {\n        if( _callback )\n        {\n\t\t\t_callback(this);\n        }\n        \n        if (kScriptTypeNone != _scriptType)\n        {\n            BasicScriptData data(this);\n            ScriptEvent scriptEvent(kMenuClickedEvent,&data);\n            ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n        }\n    }\n}\n\nvoid MenuItem::setEnabled(bool enabled)\n{\n    _enabled = enabled;\n}\n\nbool MenuItem::isEnabled() const\n{\n    return _enabled;\n}\n\nRect MenuItem::rect() const\n{\n    return Rect( _position.x - _contentSize.width * _anchorPoint.x,\n                      _position.y - _contentSize.height * _anchorPoint.y,\n                      _contentSize.width, _contentSize.height);\n}\n\nbool MenuItem::isSelected() const\n{\n    return _selected;\n}\n\n// XXX deprecated\nvoid MenuItem::setTarget(Object *target, SEL_MenuHandler selector)\n{\n\t_target = target;\n\tCC_SAFE_RETAIN(_target);\n\tsetCallback( std::bind( selector, target, std::placeholders::_1) );\n}\n\nvoid MenuItem::setCallback(const ccMenuCallback& callback)\n{\n\t_callback = callback;\n}\n\nstd::string MenuItem::getDescription() const\n{\n    return StringUtils::format(\"<MenuItem | tag = %d>\", _tag);\n}\n\n//\n//CCMenuItemLabel\n//\n\nvoid MenuItemLabel::setLabel(Node* var)\n{\n    if (var)\n    {\n        addChild(var);\n        var->setAnchorPoint(Point(0, 0));\n        setContentSize(var->getContentSize());\n    }\n    \n    if (_label)\n    {\n        removeChild(_label, true);\n    }\n    \n    _label = var;\n}\n\n// XXX: deprecated\nMenuItemLabel * MenuItemLabel::create(Node*label, Object* target, SEL_MenuHandler selector)\n{\n    MenuItemLabel *ret = new MenuItemLabel();\n    ret->initWithLabel(label, target, selector);\n    ret->autorelease();\n    return ret;\n}\n\nMenuItemLabel * MenuItemLabel::create(Node*label, const ccMenuCallback& callback)\n{\n    MenuItemLabel *ret = new MenuItemLabel();\n    ret->initWithLabel(label, callback);\n    ret->autorelease();\n    return ret;\n}\n\nMenuItemLabel* MenuItemLabel::create(Node *label)\n{\n    MenuItemLabel *ret = new MenuItemLabel();\n    ret->initWithLabel(label, (const ccMenuCallback&) nullptr);\n    ret->autorelease();\n    return ret;\n}\n\n// XXX: deprecated\nbool MenuItemLabel::initWithLabel(Node* label, Object* target, SEL_MenuHandler selector)\n{\n\t_target = target;\n\tCC_SAFE_RETAIN(_target);\n\treturn initWithLabel(label, std::bind(selector,target, std::placeholders::_1) );\n}\n\nbool MenuItemLabel::initWithLabel(Node* label, const ccMenuCallback& callback)\n{\n    MenuItem::initWithCallback(callback);\n    _originalScale = 1.0f;\n    _colorBackup = Color3B::WHITE;\n    setDisabledColor(Color3B(126,126,126));\n    this->setLabel(label);\n\n    setCascadeColorEnabled(true);\n    setCascadeOpacityEnabled(true);\n\n    return true;\n}\n\n\nMenuItemLabel::~MenuItemLabel()\n{\n}\n\nvoid MenuItemLabel::setString(const std::string& label)\n{\n    dynamic_cast<LabelProtocol*>(_label)->setString(label);\n    this->setContentSize(_label->getContentSize());\n}\n\nvoid MenuItemLabel::activate()\n{\n    if(_enabled)\n    {\n        this->stopAllActions();\n        this->setScale( _originalScale );\n        MenuItem::activate();\n    }\n}\n\nvoid MenuItemLabel::selected()\n{\n    // subclass to change the default action\n    if(_enabled)\n    {\n        MenuItem::selected();\n        \n        Action *action = getActionByTag(kZoomActionTag);\n        if (action)\n        {\n            this->stopAction(action);\n        }\n        else\n        {\n            _originalScale = this->getScale();\n        }\n        \n        Action *zoomAction = ScaleTo::create(0.1f, _originalScale * 1.2f);\n        zoomAction->setTag(kZoomActionTag);\n        this->runAction(zoomAction);\n    }\n}\n\nvoid MenuItemLabel::unselected()\n{\n    // subclass to change the default action\n    if(_enabled)\n    {\n        MenuItem::unselected();\n        this->stopActionByTag(kZoomActionTag);\n        Action *zoomAction = ScaleTo::create(0.1f, _originalScale);\n        zoomAction->setTag(kZoomActionTag);\n        this->runAction(zoomAction);\n    }\n}\n\nvoid MenuItemLabel::setEnabled(bool enabled)\n{\n    if( _enabled != enabled ) \n    {\n        if(enabled == false)\n        {\n            _colorBackup = _label->getColor();\n            _label->setColor(_disabledColor);\n        }\n        else\n        {\n            _label->setColor(_colorBackup);\n        }\n    }\n    MenuItem::setEnabled(enabled);\n}\n\n//\n//CCMenuItemAtlasFont\n//\n\nMenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap)\n{\n    return MenuItemAtlasFont::create(value, charMapFile, itemWidth, itemHeight, startCharMap, (const ccMenuCallback&)nullptr);\n}\n\n// XXX: deprecated\nMenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Object* target, SEL_MenuHandler selector)\n{\n    MenuItemAtlasFont *ret = new MenuItemAtlasFont();\n    ret->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, target, selector);\n    ret->autorelease();\n    return ret;\n}\n\nMenuItemAtlasFont * MenuItemAtlasFont::create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, const ccMenuCallback& callback)\n{\n    MenuItemAtlasFont *ret = new MenuItemAtlasFont();\n    ret->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, callback);\n    ret->autorelease();\n    return ret;\n}\n\n// XXX: deprecated\nbool MenuItemAtlasFont::initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Object* target, SEL_MenuHandler selector)\n{\n\t_target = target;\n\tCC_SAFE_RETAIN(_target);\n\treturn initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap, std::bind(selector,target, std::placeholders::_1) );\n}\n\nbool MenuItemAtlasFont::initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, const ccMenuCallback& callback)\n{\n    CCASSERT( value.size() != 0, \"value length must be greater than 0\");\n    LabelAtlas *label = LabelAtlas::create();\n    label->initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap);\n    if (MenuItemLabel::initWithLabel(label, callback))\n    {\n        // do something ?\n    }\n    return true;\n}\n\n//\n//CCMenuItemFont\n//\n\nvoid MenuItemFont::setFontSize(int s)\n{\n    _globalFontSize = s;\n}\n\nint MenuItemFont::getFontSize()\n{\n    return _globalFontSize;\n}\n\nvoid MenuItemFont::setFontName(const std::string& name)\n{\n    if (_globalFontNameRelease)\n    {\n        _globalFontName.clear();\n    }\n    _globalFontName = name;\n    _globalFontNameRelease = true;\n}\n\nconst std::string& MenuItemFont::getFontName()\n{\n    return _globalFontName;\n}\n\n// XXX: deprecated\nMenuItemFont * MenuItemFont::create(const std::string& value, Object* target, SEL_MenuHandler selector)\n{\n    MenuItemFont *ret = new MenuItemFont();\n    ret->initWithString(value, target, selector);\n    ret->autorelease();\n    return ret;\n}\n\nMenuItemFont * MenuItemFont::create(const std::string& value, const ccMenuCallback& callback)\n{\n    MenuItemFont *ret = new MenuItemFont();\n    ret->initWithString(value, callback);\n    ret->autorelease();\n    return ret;\n}\n\n\nMenuItemFont * MenuItemFont::create(const std::string& value)\n{\n    MenuItemFont *ret = new MenuItemFont();\n    ret->initWithString(value, (const ccMenuCallback&)nullptr);\n    ret->autorelease();\n    return ret;\n}\n\nMenuItemFont::MenuItemFont()\n : _fontSize(0), _fontName(\"\")\n{}\n\nMenuItemFont::~MenuItemFont()\n{\n    CCLOGINFO(\"In the destructor of MenuItemFont (%p).\", this);\n}\n\n// XXX: deprecated\nbool MenuItemFont::initWithString(const std::string& value, Object* target, SEL_MenuHandler selector)\n{\n    CCASSERT( !value.empty(), \"Value length must be greater than 0\");\n\n\t_target = target;\n    CC_SAFE_RETAIN(target);\n\treturn initWithString(value, std::bind(selector,target, std::placeholders::_1) );\n}\n\nbool MenuItemFont::initWithString(const std::string& value, const ccMenuCallback& callback)\n{\n    CCASSERT( !value.empty(), \"Value length must be greater than 0\");\n\n    _fontName = _globalFontName;\n    _fontSize = _globalFontSize;\n\n    LabelTTF *label = LabelTTF::create(value, _fontName, (float)_fontSize);\n    if (MenuItemLabel::initWithLabel(label, callback))\n    {\n        // do something ?\n    }\n    return true;\n}\n\nvoid MenuItemFont::recreateLabel()\n{\n    LabelTTF *label = LabelTTF::create(dynamic_cast<LabelProtocol*>(_label)->getString(), \n                                                    _fontName.c_str(), (float)_fontSize);\n    this->setLabel(label);\n}\n\nvoid MenuItemFont::setFontSizeObj(int s)\n{\n    _fontSize = s;\n    recreateLabel();\n}\n\nint MenuItemFont::getFontSizeObj() const\n{\n    return _fontSize;\n}\n\nvoid MenuItemFont::setFontNameObj(const std::string& name)\n{\n    _fontName = name;\n    recreateLabel();\n}\n\nconst std::string& MenuItemFont::getFontNameObj() const\n{\n    return _fontName;\n}\n\n//\n//CCMenuItemSprite\n//\n\nvoid MenuItemSprite::setNormalImage(Node* image)\n{\n    if (image != _normalImage)\n    {\n        if (image)\n        {\n            addChild(image, 0, kNormalTag);\n            image->setAnchorPoint(Point(0, 0));\n        }\n\n        if (_normalImage)\n        {\n            removeChild(_normalImage, true);\n        }\n\n        _normalImage = image;\n        this->setContentSize(_normalImage->getContentSize());\n        this->updateImagesVisibility();\n    }\n}\n\nvoid MenuItemSprite::setSelectedImage(Node* image)\n{\n    if (image != _normalImage)\n    {\n        if (image)\n        {\n            addChild(image, 0, kSelectedTag);\n            image->setAnchorPoint(Point(0, 0));\n        }\n\n        if (_selectedImage)\n        {\n            removeChild(_selectedImage, true);\n        }\n\n        _selectedImage = image;\n        this->updateImagesVisibility();\n    }\n}\n\nvoid MenuItemSprite::setDisabledImage(Node* image)\n{\n    if (image != _normalImage)\n    {\n        if (image)\n        {\n            addChild(image, 0, kDisableTag);\n            image->setAnchorPoint(Point(0, 0));\n        }\n\n        if (_disabledImage)\n        {\n            removeChild(_disabledImage, true);\n        }\n\n        _disabledImage = image;\n        this->updateImagesVisibility();\n    }\n}\n\n//\n//CCMenuItemSprite\n//\n\nMenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, Node* disabledSprite)\n{\n    return MenuItemSprite::create(normalSprite, selectedSprite, disabledSprite, (const ccMenuCallback&)nullptr);\n}\n\n// XXX deprecated\nMenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, Object* target, SEL_MenuHandler selector)\n{\n    return MenuItemSprite::create(normalSprite, selectedSprite, nullptr, target, selector);\n}\n\nMenuItemSprite * MenuItemSprite::create(Node* normalSprite, Node* selectedSprite, const ccMenuCallback& callback)\n{\n    return MenuItemSprite::create(normalSprite, selectedSprite, nullptr, callback);\n}\n\n// XXX deprecated\nMenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite, Node *disabledSprite, Object *target, SEL_MenuHandler selector)\n{\n    MenuItemSprite *ret = new MenuItemSprite();\n    ret->initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, target, selector); \n    ret->autorelease();\n    return ret;\n}\n\nMenuItemSprite * MenuItemSprite::create(Node *normalSprite, Node *selectedSprite, Node *disabledSprite, const ccMenuCallback& callback)\n{\n    MenuItemSprite *ret = new MenuItemSprite();\n    ret->initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, callback);\n    ret->autorelease();\n    return ret;\n}\n\n// XXX deprecated\nbool MenuItemSprite::initWithNormalSprite(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, Object* target, SEL_MenuHandler selector)\n{\n\t_target = target;\n\tCC_SAFE_RETAIN(_target);\n\treturn initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, std::bind(selector,target, std::placeholders::_1) );\n}\n\nbool MenuItemSprite::initWithNormalSprite(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, const ccMenuCallback& callback)\n{\n    MenuItem::initWithCallback(callback);\n    setNormalImage(normalSprite);\n    setSelectedImage(selectedSprite);\n    setDisabledImage(disabledSprite);\n\n    if(_normalImage)\n    {\n        this->setContentSize(_normalImage->getContentSize());\n    }\n\n    setCascadeColorEnabled(true);\n    setCascadeOpacityEnabled(true);\n\n    return true;\n}\n\n/**\n @since v0.99.5\n */\nvoid MenuItemSprite::selected()\n{\n    MenuItem::selected();\n\n    if (_normalImage)\n    {\n        if (_disabledImage)\n        {\n            _disabledImage->setVisible(false);\n        }\n\n        if (_selectedImage)\n        {\n            _normalImage->setVisible(false);\n            _selectedImage->setVisible(true);\n        }\n        else\n        {\n            _normalImage->setVisible(true);\n        }\n    }\n}\n\nvoid MenuItemSprite::unselected()\n{\n    MenuItem::unselected();\n    if (_normalImage)\n    {\n        _normalImage->setVisible(true);\n\n        if (_selectedImage)\n        {\n            _selectedImage->setVisible(false);\n        }\n\n        if (_disabledImage)\n        {\n            _disabledImage->setVisible(false);\n        }\n    }\n}\n\nvoid MenuItemSprite::setEnabled(bool bEnabled)\n{\n    if( _enabled != bEnabled ) \n    {\n        MenuItem::setEnabled(bEnabled);\n        this->updateImagesVisibility();\n    }\n}\n\n// Helper \nvoid MenuItemSprite::updateImagesVisibility()\n{\n    if (_enabled)\n    {\n        if (_normalImage)   _normalImage->setVisible(true);\n        if (_selectedImage) _selectedImage->setVisible(false);\n        if (_disabledImage) _disabledImage->setVisible(false);\n    }\n    else\n    {\n        if (_disabledImage)\n        {\n            if (_normalImage)   _normalImage->setVisible(false);\n            if (_selectedImage) _selectedImage->setVisible(false);\n            if (_disabledImage) _disabledImage->setVisible(true);\n        }\n        else\n        {\n            if (_normalImage)   _normalImage->setVisible(true);\n            if (_selectedImage) _selectedImage->setVisible(false);\n            if (_disabledImage) _disabledImage->setVisible(false);\n        }\n    }\n}\n\n///\n/// MenuItemImage\n///\n\nMenuItemImage* MenuItemImage::create()\n{\n    MenuItemImage *ret = new MenuItemImage();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool MenuItemImage::init(void)\n{\n    return initWithNormalImage(\"\", \"\", \"\", (const ccMenuCallback&)nullptr);\n}\n\nMenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage)\n{\n    return MenuItemImage::create(normalImage, selectedImage, \"\", (const ccMenuCallback&)nullptr);\n}\n\n// XXX deprecated\nMenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, Object* target, SEL_MenuHandler selector)\n{\n    return MenuItemImage::create(normalImage, selectedImage, \"\", target, selector);\n}\n\nMenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const ccMenuCallback& callback)\n{\n    return MenuItemImage::create(normalImage, selectedImage, \"\", callback);\n}\n\n// XXX deprecated\nMenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Object* target, SEL_MenuHandler selector)\n{\n    MenuItemImage *ret = new MenuItemImage();\n    if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, target, selector))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nMenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, const ccMenuCallback& callback)\n{\n    MenuItemImage *ret = new MenuItemImage();\n    if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, callback))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nMenuItemImage * MenuItemImage::create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage)\n{\n    MenuItemImage *ret = new MenuItemImage();\n    if (ret && ret->initWithNormalImage(normalImage, selectedImage, disabledImage, (const ccMenuCallback&)nullptr))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\n// XXX: deprecated\nbool MenuItemImage::initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Object* target, SEL_MenuHandler selector)\n{\n\t_target = target;\n\tCC_SAFE_RETAIN(_target);\n\treturn initWithNormalImage(normalImage, selectedImage, disabledImage, std::bind(selector,target, std::placeholders::_1) );\n}\nbool MenuItemImage::initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, const ccMenuCallback& callback)\n{\n    Node *normalSprite = nullptr;\n    Node *selectedSprite = nullptr;\n    Node *disabledSprite = nullptr;\n\n    if (normalImage.size() >0)\n    {\n        normalSprite = Sprite::create(normalImage);\n    }\n\n    if (selectedImage.size() >0)\n    {\n        selectedSprite = Sprite::create(selectedImage);\n    }\n\n    if(disabledImage.size() >0)\n    {\n        disabledSprite = Sprite::create(disabledImage);\n    }\n    return initWithNormalSprite(normalSprite, selectedSprite, disabledSprite, callback);\n}\n\n//\n// Setter of sprite frames\n//\nvoid MenuItemImage::setNormalSpriteFrame(SpriteFrame * frame)\n{\n    setNormalImage(Sprite::createWithSpriteFrame(frame));\n}\n\nvoid MenuItemImage::setSelectedSpriteFrame(SpriteFrame * frame)\n{\n    setSelectedImage(Sprite::createWithSpriteFrame(frame));\n}\n\nvoid MenuItemImage::setDisabledSpriteFrame(SpriteFrame * frame)\n{\n    setDisabledImage(Sprite::createWithSpriteFrame(frame));\n}\n\n//\n// MenuItemToggle\n//\n\n// XXX: deprecated\nMenuItemToggle * MenuItemToggle::createWithTarget(Object* target, SEL_MenuHandler selector, const Vector<MenuItem*>& menuItems)\n{\n    MenuItemToggle *ret = new MenuItemToggle();\n    ret->MenuItem::initWithTarget(target, selector);\n    ret->_subItems = menuItems;\n    ret->_selectedIndex = UINT_MAX;\n    ret->setSelectedIndex(0);\n    return ret;\n}\n\nMenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callback, const Vector<MenuItem*>& menuItems)\n{\n    MenuItemToggle *ret = new MenuItemToggle();\n    ret->MenuItem::initWithCallback(callback);\n    ret->_subItems = menuItems;\n    ret->_selectedIndex = UINT_MAX;\n    ret->setSelectedIndex(0);\n    return ret;\n}\n\n// XXX: deprecated\nMenuItemToggle * MenuItemToggle::createWithTarget(Object* target, SEL_MenuHandler selector, MenuItem* item, ...)\n{\n    va_list args;\n    va_start(args, item);\n    MenuItemToggle *ret = new MenuItemToggle();\n    ret->initWithTarget(target, selector, item, args);\n    ret->autorelease();\n    va_end(args);\n    return ret;\n}\n\nMenuItemToggle * MenuItemToggle::createWithCallback(const ccMenuCallback &callback, MenuItem* item, ...)\n{\n    va_list args;\n    va_start(args, item);\n    MenuItemToggle *ret = new MenuItemToggle();\n    ret->initWithCallback(callback, item, args);\n    ret->autorelease();\n    va_end(args);\n    return ret;\n}\n\nMenuItemToggle * MenuItemToggle::create()\n{\n    MenuItemToggle *ret = new MenuItemToggle();\n    ret->initWithItem(nullptr);\n    ret->autorelease();\n    return ret;\n}\n\n// XXX: deprecated\nbool MenuItemToggle::initWithTarget(Object* target, SEL_MenuHandler selector, MenuItem* item, va_list args)\n{\n\t_target = target;\n\tCC_SAFE_RETAIN(_target);\n\treturn initWithCallback(std::bind( selector, target, std::placeholders::_1), item, args);\n}\n\nbool MenuItemToggle::initWithCallback(const ccMenuCallback &callback, MenuItem *item, va_list args)\n{\n    MenuItem::initWithCallback(callback);\n\n    int z = 0;\n    MenuItem *i = item;\n    while(i)\n    {\n        z++;\n        _subItems.pushBack(i);\n        i = va_arg(args, MenuItem*);\n    }\n    _selectedIndex = UINT_MAX;\n    this->setSelectedIndex(0);\n    return true;\n}\n\nMenuItemToggle* MenuItemToggle::create(MenuItem *item)\n{\n    MenuItemToggle *ret = new MenuItemToggle();\n    ret->initWithItem(item);\n    ret->autorelease();\n    return ret;\n}\n\nbool MenuItemToggle::initWithItem(MenuItem *item)\n{\n    MenuItem::initWithCallback((const ccMenuCallback&)nullptr);\n\n    if (item)\n    {\n        _subItems.pushBack(item);\n    }\n    _selectedIndex = UINT_MAX;\n    this->setSelectedIndex(0);\n    \n    setCascadeColorEnabled(true);\n    setCascadeOpacityEnabled(true);\n    \n    return true;\n}\n\nvoid MenuItemToggle::addSubItem(MenuItem *item)\n{\n    _subItems.pushBack(item);\n}\n\nMenuItemToggle::~MenuItemToggle()\n{\n    for(const auto &item : _subItems) {\n        item->cleanup();\n    }\n}\n\nvoid MenuItemToggle::setSelectedIndex(unsigned int index)\n{\n    if( index != _selectedIndex && _subItems.size() > 0 )\n    {\n        _selectedIndex = index;\n        MenuItem *currentItem = (MenuItem*)getChildByTag(kCurrentItem);\n        if( currentItem )\n        {\n            currentItem->removeFromParentAndCleanup(false);\n        }\n\n        MenuItem* item = _subItems.at(_selectedIndex);\n        this->addChild(item, 0, kCurrentItem);\n        Size s = item->getContentSize();\n        this->setContentSize(s);\n        item->setPosition( Point( s.width/2, s.height/2 ) );\n    }\n}\n\nvoid MenuItemToggle::selected()\n{\n    MenuItem::selected();\n    _subItems.at(_selectedIndex)->selected();\n}\n\nvoid MenuItemToggle::unselected()\n{\n    MenuItem::unselected();\n    _subItems.at(_selectedIndex)->unselected();\n}\n\nvoid MenuItemToggle::activate()\n{\n    // update index\n    if( _enabled ) \n    {\n        unsigned int newIndex = (_selectedIndex + 1) % _subItems.size();\n        this->setSelectedIndex(newIndex);\n    }\n    MenuItem::activate();\n}\nvoid MenuItemToggle::setEnabled(bool enabled)\n{\n    if (_enabled != enabled)\n    {\n        MenuItem::setEnabled(enabled);\n\n        for(const auto &item : _subItems) {\n            item->setEnabled(enabled);\n        }\n    }\n}\n\nMenuItem* MenuItemToggle::getSelectedItem()\n{\n    return _subItems.at(_selectedIndex);\n}\n\nNS_CC_END\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic warning \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (pop)\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCMenuItem.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCMENU_ITEM_H__\n#define __CCMENU_ITEM_H__\n\n// C++ includes\n#include <functional>\n\n// cocos2d includes\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"CCArray.h\"\n\nNS_CC_BEGIN\n\ntypedef std::function<void(Object*)> ccMenuCallback;\n\nclass LabelTTF;\nclass LabelAtlas;\nclass Sprite;\nclass SpriteFrame;\n#define kItemSize 32\n    \n/**\n * @addtogroup GUI\n * @{\n * @addtogroup menu\n * @{\n */\n\n/** @brief MenuItem base class\n *\n *  Subclass MenuItem (or any subclass) to create your custom MenuItem objects.\n */\nclass CC_DLL MenuItem : public Node\n{\npublic:\n    /** Creates a MenuItem with no target/selector */\n    static MenuItem* create();\n    /** Creates a MenuItem with a target/selector */\n    CC_DEPRECATED_ATTRIBUTE static MenuItem* create(Object *rec, SEL_MenuHandler selector);\n    /** Creates a MenuItem with a target/selector */\n    static MenuItem* create(const ccMenuCallback& callback);\n\n    /** Returns the outside box */\n    Rect rect() const;\n    /** Activate the item */\n    virtual void activate();\n    /** The item was selected (not activated), similar to \"mouse-over\" */\n    virtual void selected();\n    /** The item was unselected */\n    virtual void unselected();\n    /** returns whether or not the item is enabled */\n    virtual bool isEnabled() const;\n    /** enables or disables the item */\n    virtual void setEnabled(bool value);\n    /** returns whether or not the item is selected */\n    virtual bool isSelected() const;\n\n    /** set the callback to the menu item\n    * @code\n    * In js,can contain two params,the second param is jsptr\n    * @endcode\n    * @lua NA\n    */\n    void setCallback(const ccMenuCallback& callback);\n    /** set the target/selector of the menu item\n    * @js NA\n    * @lua NA\n    */\n    CC_DEPRECATED_ATTRIBUTE void setTarget(Object *rec, SEL_MenuHandler selector);\n\n\n    virtual std::string getDescription() const override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    MenuItem()\n    : _selected(false)\n    , _enabled(false)\n\t, _callback(nullptr)\n    , _target(nullptr)\n    {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItem();\n\n    /** Initializes a MenuItem with a target/selector\n     * @js NA\n     * @lua NA\n     */\n    bool initWithCallback(const ccMenuCallback& callback);\n    /** Initializes a MenuItem with a target/selector\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE bool initWithTarget( Object *rec, SEL_MenuHandler selector);\n\n    bool            _selected;\n    bool            _enabled;\n\t// callback\n\tccMenuCallback _callback;\n\t// If using the old API, the _target needs to be retained / released\n\tObject\t\t*_target;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MenuItem);\n};\n\n/** @brief An abstract class for \"label\" MenuItemLabel items \n Any Node that supports the LabelProtocol protocol can be added.\n Supported nodes:\n - BitmapFontAtlas\n - LabelAtlas\n - LabelTTF\n */\nclass CC_DLL MenuItemLabel : public MenuItem\n{\npublic:\n    /** creates a MenuItemLabel with a Label, target and selector */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemLabel * create(Node*label, Object* target, SEL_MenuHandler selector);\n\n\t/** creates a MenuItemLabel with a Label and a callback */\n    static MenuItemLabel * create(Node*label, const ccMenuCallback& callback);\n\n    /** creates a MenuItemLabel with a Label. Target and selector will be nil */\n    static MenuItemLabel* create(Node *label);\n\n    /** sets a new string to the inner label */\n    void setString(const std::string& label);\n\n    /** Gets the color that will be used to disable the item */\n    inline const Color3B& getDisabledColor() const { return _disabledColor; };\n\n    /** Sets the color that will be used to disable the item */\n    inline void setDisabledColor(const Color3B& color) { _disabledColor = color; };\n    \n    /** Gets the label that is rendered. */\n    inline Node* getLabel() const { return _label; };\n    \n    /** Sets the label that is rendered. */\n    void setLabel(Node* node);\n    \n    // Overrides\n    virtual void activate() override;\n    virtual void selected() override;\n    virtual void unselected() override;\n    virtual void setEnabled(bool enabled) override;\n    \nprotected:\n    /**\n     * @js ctor\n     */\n    MenuItemLabel()\n    : _originalScale(0.0)\n    , _label(nullptr)\n    {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItemLabel();\n\n\t/** initializes a MenuItemLabel with a Label, target and selector */\n    bool initWithLabel(Node* label, const ccMenuCallback& callback);\n\n    /** initializes a MenuItemLabel with a Label, target and selector */\n    CC_DEPRECATED_ATTRIBUTE bool initWithLabel(Node* label, Object* target, SEL_MenuHandler selector);\n\n    Color3B    _colorBackup;\n    float      _originalScale;\n\n    /** the color that will be used to disable the item */\n    Color3B _disabledColor;\n    /** Label that is rendered. It can be any Node that implements the LabelProtocol */\n    Node* _label;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MenuItemLabel);\n};\n\n\n/** @brief A MenuItemAtlasFont\n Helper class that creates a MenuItemLabel class with a LabelAtlas\n */\nclass CC_DLL MenuItemAtlasFont : public MenuItemLabel\n{\npublic:\n    /** creates a menu item from a string and atlas with a target/selector */\n    static MenuItemAtlasFont* create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap);\n    /** creates a menu item from a string and atlas. Use it with MenuItemToggle */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemAtlasFont* create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Object* target, SEL_MenuHandler selector);\n    /** creates a menu item from a string and atlas. Use it with MenuItemToggle */\n    static MenuItemAtlasFont* create(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, const ccMenuCallback& callback);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    MenuItemAtlasFont(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItemAtlasFont(){}\n\n    /** initializes a menu item from a string and atlas with a target/selector */\n    CC_DEPRECATED_ATTRIBUTE bool initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, Object* target, SEL_MenuHandler selector);\n    /** initializes a menu item from a string and atlas with a target/selector */\n    bool initWithString(const std::string& value, const std::string& charMapFile, int itemWidth, int itemHeight, char startCharMap, const ccMenuCallback& callback);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MenuItemAtlasFont);\n};\n\n\n/** @brief A MenuItemFont\n Helper class that creates a MenuItemLabel class with a Label\n */\nclass CC_DLL MenuItemFont : public MenuItemLabel\n{\npublic:\n    /** creates a menu item from a string without target/selector. To be used with MenuItemToggle */\n    static MenuItemFont * create(const std::string& value = \"\");\n    /** creates a menu item from a string with a target/selector */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemFont * create(const std::string& value, Object* target, SEL_MenuHandler selector);\n    /** creates a menu item from a string with a target/selector */\n    static MenuItemFont * create(const std::string& value, const ccMenuCallback& callback);\n\n    /** set default font size */\n    static void setFontSize(int size);\n    /** get default font size */\n    static int getFontSize();\n    CC_DEPRECATED_ATTRIBUTE static int fontSize() { return MenuItemFont::getFontSize(); };\n    /** set the default font name */\n    static void setFontName(const std::string& name);\n    /** get the default font name */\n    static const std::string& getFontName();\n    CC_DEPRECATED_ATTRIBUTE static const std::string& fontName() { return MenuItemFont::getFontName(); };\n\n    /** set font size\n     * c++ can not overload static and non-static member functions with the same parameter types\n     * so change the name to setFontSizeObj\n     * @js setFontSize\n     */\n    void setFontSizeObj(int size);\n    \n    /** get font size \n     * @js getFontSize\n     */\n    int getFontSizeObj() const;\n    CC_DEPRECATED_ATTRIBUTE int fontSizeObj() const { return getFontSizeObj(); };\n    \n    /** set the font name \n     * c++ can not overload static and non-static member functions with the same parameter types\n     * so change the name to setFontNameObj\n     * @js setFontName\n     */\n    void setFontNameObj(const std::string& name);\n\n    /** returns the name of the Font \n     * @js getFontNameObj\n     */\n    const std::string& getFontNameObj() const;\n\n    /** deprecated Use getFontNameObj() instead */\n    CC_DEPRECATED_ATTRIBUTE const std::string& fontNameObj() const { return getFontNameObj(); }\n    \nprotected:\n    /**\n     * @js ctor\n     */\n    MenuItemFont();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItemFont();\n\n    /** initializes a menu item from a string with a target/selector */\n    CC_DEPRECATED_ATTRIBUTE bool initWithString(const std::string& value, Object* target, SEL_MenuHandler selector);\n    /** initializes a menu item from a string with a target/selector */\n    bool initWithString(const std::string& value, const ccMenuCallback& callback);\n\n    void recreateLabel();\n    \n    int _fontSize;\n    std::string _fontName;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MenuItemFont);\n};\n\n\n/** @brief MenuItemSprite accepts Node<RGBAProtocol> objects as items.\n The images has 3 different states:\n - unselected image\n - selected image\n - disabled image\n \n @since v0.8.0\n */\nclass CC_DLL MenuItemSprite : public MenuItem\n{\npublic:\n    /** creates a menu item with a normal, selected and disabled image*/\n    static MenuItemSprite * create(Node* normalSprite, Node* selectedSprite, Node* disabledSprite = nullptr);\n    /** creates a menu item with a normal and selected image with target/selector */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemSprite * create(Node* normalSprite, Node* selectedSprite, Object* target, SEL_MenuHandler selector);\n    /** creates a menu item with a normal,selected  and disabled image with target/selector */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemSprite * create(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, Object* target, SEL_MenuHandler selector);\n    /** creates a menu item with a normal and selected image with a callable object */\n    static MenuItemSprite * create(Node* normalSprite, Node* selectedSprite, const ccMenuCallback& callback);\n    /** creates a menu item with a normal,selected  and disabled image with target/selector */\n    static MenuItemSprite * create(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, const ccMenuCallback& callback);\n\n    /** Gets the image used when the item is not selected */\n    inline Node* getNormalImage() const { return _normalImage; };\n    \n    /** Sets the image used when the item is not selected */\n    void setNormalImage(Node* image);\n    \n    /** Gets the image used when the item is selected */\n    inline Node* getSelectedImage() const { return _selectedImage; };\n    \n    /** Sets the image used when the item is selected */\n    void setSelectedImage(Node* image);\n    \n    /** Gets the image used when the item is disabled */\n    inline Node* getDisabledImage() const { return _disabledImage; };\n    \n    /** Sets the image used when the item is disabled */\n    void setDisabledImage(Node* image);\n    \n    /**\n     @since v0.99.5\n     */\n    virtual void selected();\n    virtual void unselected();\n    virtual void setEnabled(bool bEnabled);\n    \nprotected:\n    MenuItemSprite()\n    :_normalImage(nullptr)\n    ,_selectedImage(nullptr)\n    ,_disabledImage(nullptr)\n    {}\n\n    /** initializes a menu item with a normal, selected  and disabled image with target/selector */\n    CC_DEPRECATED_ATTRIBUTE bool initWithNormalSprite(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, Object* target, SEL_MenuHandler selector);\n    /** initializes a menu item with a normal, selected  and disabled image with a callable object */\n    bool initWithNormalSprite(Node* normalSprite, Node* selectedSprite, Node* disabledSprite, const ccMenuCallback& callback);\n\n    virtual void updateImagesVisibility();\n\n    /** the image used when the item is not selected */\n    Node* _normalImage;\n    /** the image used when the item is selected */\n    Node* _selectedImage;\n    /** the image used when the item is disabled */\n    Node* _disabledImage;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MenuItemSprite);\n};\n\n\n/** @brief MenuItemImage accepts images as items.\n The images has 3 different states:\n - unselected image\n - selected image\n - disabled image\n \n For best results try that all images are of the same size\n */\nclass CC_DLL MenuItemImage : public MenuItemSprite\n{\npublic:\n    /** Creates an MenuItemImage. */\n    static MenuItemImage* create();\n    /** creates a menu item with a normal and selected image*/\n    static MenuItemImage* create(const std::string& normalImage, const std::string& selectedImage);\n    /** creates a menu item with a normal,selected  and disabled image*/\n    static MenuItemImage* create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage);\n    /** creates a menu item with a normal and selected image with target/selector */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemImage* create(const std::string& normalImage, const std::string& selectedImage, Object* target, SEL_MenuHandler selector);\n    /** creates a menu item with a normal and selected image with a callable object */\n    static MenuItemImage* create(const std::string&normalImage, const std::string&selectedImage, const ccMenuCallback& callback);\n\n    /** creates a menu item with a normal,selected  and disabled image with target/selector */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemImage* create(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Object* target, SEL_MenuHandler selector);\n    /** creates a menu item with a normal,selected  and disabled image with a callable object */\n    static MenuItemImage* create(const std::string&normalImage, const std::string&selectedImage, const std::string&disabledImage, const ccMenuCallback& callback);\n\n    /** sets the sprite frame for the normal image */\n    void setNormalSpriteFrame(SpriteFrame* frame);\n    /** sets the sprite frame for the selected image */\n    void setSelectedSpriteFrame(SpriteFrame* frame);\n    /** sets the sprite frame for the disabled image */\n    void setDisabledSpriteFrame(SpriteFrame* frame);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    MenuItemImage(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItemImage(){}\n\n    bool init();\n    /** initializes a menu item with a normal, selected  and disabled image with target/selector */\n    CC_DEPRECATED_ATTRIBUTE bool initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, Object* target, SEL_MenuHandler selector);\n    /** initializes a menu item with a normal, selected  and disabled image with a callable object */\n    bool initWithNormalImage(const std::string& normalImage, const std::string& selectedImage, const std::string& disabledImage, const ccMenuCallback& callback);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MenuItemImage);\n};\n\n\n/** @brief A MenuItemToggle\n A simple container class that \"toggles\" it's inner items\n The inner items can be any MenuItem\n */\nclass CC_DLL MenuItemToggle : public MenuItem\n{\npublic:\n    /** creates a menu item from a Array with a target selector\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemToggle * createWithTarget(Object* target, SEL_MenuHandler selector, const Vector<MenuItem*>& menuItems);\n    /** creates a menu item from a list of items with a target/selector\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static MenuItemToggle* createWithTarget(Object* target, SEL_MenuHandler selector, MenuItem* item, ...)CC_REQUIRES_NULL_TERMINATION;\n    \n    /** creates a menu item from a Array with a callable object */\n    static MenuItemToggle * createWithCallback(const ccMenuCallback& callback, const Vector<MenuItem*>& menuItems);\n    /** creates a menu item from a list of items with a callable object */\n    static MenuItemToggle* createWithCallback(const ccMenuCallback& callback, MenuItem* item, ...) CC_REQUIRES_NULL_TERMINATION;\n    /** creates a menu item with no target/selector and no items */\n    static MenuItemToggle* create();\n    /** creates a menu item with a item */\n    static MenuItemToggle* create(MenuItem *item);\n    /** add more menu item */\n    void addSubItem(MenuItem *item);\n    \n    /** return the selected item */\n    MenuItem* getSelectedItem();\n    /** @deprecated Use getSelectedItem() instead */\n    CC_DEPRECATED_ATTRIBUTE MenuItem* selectedItem() { return getSelectedItem(); }\n\n    /** Gets the index of the selected item */\n    inline unsigned int getSelectedIndex() const { return _selectedIndex; };\n    \n    /** Sets the index of the selected item */\n    void setSelectedIndex(unsigned int index);\n    \n    /** Gets the array that contains the subitems.\n     You can add/remove items in runtime, and you can replace the array with a new one.\n     @since v0.7.2\n     * @js NA\n     * @lua NA\n     */\n    inline const Vector<MenuItem*>& getSubItems() const { return _subItems; };\n    inline Vector<MenuItem*>& getSubItems() { return _subItems; };\n\n    /** Sets the array that contains the subitems. */\n    inline void setSubItems(const Vector<MenuItem*>& items) {\n        _subItems = items;\n    }\n    \n    // Overrides\n    virtual void activate() override;\n    virtual void selected() override;\n    virtual void unselected() override;\n    virtual void setEnabled(bool var) override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    MenuItemToggle()\n    : _selectedIndex(0)\n    {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItemToggle();\n\n    /** initializes a menu item from a list of items with a target selector\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE bool initWithTarget(Object* target, SEL_MenuHandler selector, MenuItem* item, va_list args);\n    /** initializes a menu item from a list of items with a callable object */\n    bool initWithCallback(const ccMenuCallback& callback, MenuItem* item, va_list args);\n\n    /** initializes a menu item with a item */\n    bool initWithItem(MenuItem *item);\n\n    /** returns the selected item */\n    unsigned int _selectedIndex;\n    /** Array that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one.\n     @since v0.7.2\n     */\n    Vector<MenuItem*> _subItems;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MenuItemToggle);\n\n};\n\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_END\n\n#endif //__CCMENU_ITEM_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCMotionStreak.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      ForzeField Studios S.L.\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN false EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCMotionStreak.h\"\n#include \"CCTextureCache.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCGLProgram.h\"\n#include \"CCShaderCache.h\"\n#include \"ccMacros.h\"\n#include \"CCDirector.h\"\n#include \"CCVertex.h\"\n#include \"renderer/CCCustomCommand.h\"\n#include \"renderer/CCRenderer.h\"\n\nNS_CC_BEGIN\n\nMotionStreak::MotionStreak()\n: _fastMode(false)\n, _startingPositionInitialized(false)\n, _texture(nullptr)\n, _blendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED)\n, _positionR(Point::ZERO)\n, _stroke(0.0f)\n, _fadeDelta(0.0f)\n, _minSeg(0.0f)\n, _maxPoints(0)\n, _nuPoints(0)\n, _previousNuPoints(0)\n, _pointVertexes(nullptr)\n, _pointState(nullptr)\n, _vertices(nullptr)\n, _colorPointer(nullptr)\n, _texCoords(nullptr)\n{\n}\n\nMotionStreak::~MotionStreak()\n{\n    CC_SAFE_RELEASE(_texture);\n    CC_SAFE_FREE(_pointState);\n    CC_SAFE_FREE(_pointVertexes);\n    CC_SAFE_FREE(_vertices);\n    CC_SAFE_FREE(_colorPointer);\n    CC_SAFE_FREE(_texCoords);\n}\n\nMotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path)\n{\n    MotionStreak *ret = new MotionStreak();\n    if (ret && ret->initWithFade(fade, minSeg, stroke, color, path))\n    {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nMotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture)\n{\n    MotionStreak *ret = new MotionStreak();\n    if (ret && ret->initWithFade(fade, minSeg, stroke, color, texture))\n    {\n        ret->autorelease();\n        return ret;\n    }\n\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path)\n{\n    CCASSERT(!path.empty(), \"Invalid filename\");\n\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(path);\n    return initWithFade(fade, minSeg, stroke, color, texture);\n}\n\nbool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture)\n{\n    Node::setPosition(Point::ZERO);\n    setAnchorPoint(Point::ZERO);\n    ignoreAnchorPointForPosition(true);\n    _startingPositionInitialized = false;\n\n    _positionR = Point::ZERO;\n    _fastMode = true;\n    _minSeg = (minSeg == -1.0f) ? stroke/5.0f : minSeg;\n    _minSeg *= _minSeg;\n\n    _stroke = stroke;\n    _fadeDelta = 1.0f/fade;\n\n    _maxPoints = (int)(fade*60.0f)+2;\n    _nuPoints = 0;\n    _pointState = (float *)malloc(sizeof(float) * _maxPoints);\n    _pointVertexes = (Point*)malloc(sizeof(Point) * _maxPoints);\n\n    _vertices = (Vertex2F*)malloc(sizeof(Vertex2F) * _maxPoints * 2);\n    _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2);\n    _colorPointer =  (GLubyte*)malloc(sizeof(GLubyte) * _maxPoints * 2 * 4);\n\n    // Set blend mode\n    _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n\n    // shader program\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n\n    setTexture(texture);\n    setColor(color);\n    scheduleUpdate();\n\n    return true;\n}\n\nvoid MotionStreak::setPosition(const Point& position)\n{\n    _startingPositionInitialized = true;\n    _positionR = position;\n}\n\nvoid MotionStreak::tintWithColor(const Color3B& colors)\n{\n    setColor(colors);\n\n    // Fast assignation\n    for(unsigned int i = 0; i<_nuPoints*2; i++) \n    {\n        *((Color3B*) (_colorPointer+i*4)) = colors;\n    }\n}\n\nTexture2D* MotionStreak::getTexture(void) const\n{\n    return _texture;\n}\n\nvoid MotionStreak::setTexture(Texture2D *texture)\n{\n    if (_texture != texture)\n    {\n        CC_SAFE_RETAIN(texture);\n        CC_SAFE_RELEASE(_texture);\n        _texture = texture;\n    }\n}\n\nvoid MotionStreak::setBlendFunc(const BlendFunc &blendFunc)\n{\n    _blendFunc = blendFunc;\n}\n\nconst BlendFunc& MotionStreak::getBlendFunc(void) const\n{\n    return _blendFunc;\n}\n\nvoid MotionStreak::setOpacity(GLubyte opacity)\n{\n    CCASSERT(false, \"Set opacity no supported\");\n}\n\nGLubyte MotionStreak::getOpacity(void) const\n{\n    CCASSERT(false, \"Opacity no supported\");\n    return 0;\n}\n\nvoid MotionStreak::setOpacityModifyRGB(bool bValue)\n{\n    CC_UNUSED_PARAM(bValue);\n}\n\nbool MotionStreak::isOpacityModifyRGB(void) const\n{\n    return false;\n}\n\nvoid MotionStreak::update(float delta)\n{\n    if (!_startingPositionInitialized)\n    {\n        return;\n    }\n    \n    delta *= _fadeDelta;\n\n    unsigned int newIdx, newIdx2, i, i2;\n    unsigned int mov = 0;\n\n    // Update current points\n    for(i = 0; i<_nuPoints; i++)\n    {\n        _pointState[i]-=delta;\n\n        if(_pointState[i] <= 0)\n            mov++;\n        else\n        {\n            newIdx = i-mov;\n\n            if(mov>0)\n            {\n                // Move data\n                _pointState[newIdx] = _pointState[i];\n\n                // Move point\n                _pointVertexes[newIdx] = _pointVertexes[i];\n\n                // Move vertices\n                i2 = i*2;\n                newIdx2 = newIdx*2;\n                _vertices[newIdx2] = _vertices[i2];\n                _vertices[newIdx2+1] = _vertices[i2+1];\n\n                // Move color\n                i2 *= 4;\n                newIdx2 *= 4;\n                _colorPointer[newIdx2+0] = _colorPointer[i2+0];\n                _colorPointer[newIdx2+1] = _colorPointer[i2+1];\n                _colorPointer[newIdx2+2] = _colorPointer[i2+2];\n                _colorPointer[newIdx2+4] = _colorPointer[i2+4];\n                _colorPointer[newIdx2+5] = _colorPointer[i2+5];\n                _colorPointer[newIdx2+6] = _colorPointer[i2+6];\n            }else\n                newIdx2 = newIdx*8;\n\n            const GLubyte op = (GLubyte)(_pointState[newIdx] * 255.0f);\n            _colorPointer[newIdx2+3] = op;\n            _colorPointer[newIdx2+7] = op;\n        }\n    }\n    _nuPoints-=mov;\n\n    // Append new point\n    bool appendNewPoint = true;\n    if(_nuPoints >= _maxPoints)\n    {\n        appendNewPoint = false;\n    }\n\n    else if(_nuPoints>0)\n    {\n        bool a1 = _pointVertexes[_nuPoints-1].getDistanceSq(_positionR) < _minSeg;\n        bool a2 = (_nuPoints == 1) ? false : (_pointVertexes[_nuPoints-2].getDistanceSq(_positionR)< (_minSeg * 2.0f));\n        if(a1 || a2)\n        {\n            appendNewPoint = false;\n        }\n    }\n\n    if(appendNewPoint)\n    {\n        _pointVertexes[_nuPoints] = _positionR;\n        _pointState[_nuPoints] = 1.0f;\n\n        // Color assignment\n        const unsigned int offset = _nuPoints*8;\n        *((Color3B*)(_colorPointer + offset)) = _displayedColor;\n        *((Color3B*)(_colorPointer + offset+4)) = _displayedColor;\n\n        // Opacity\n        _colorPointer[offset+3] = 255;\n        _colorPointer[offset+7] = 255;\n\n        // Generate polygon\n        if(_nuPoints > 0 && _fastMode )\n        {\n            if(_nuPoints > 1)\n            {\n                ccVertexLineToPolygon(_pointVertexes, _stroke, _vertices, _nuPoints, 1);\n            }\n            else\n            {\n                ccVertexLineToPolygon(_pointVertexes, _stroke, _vertices, 0, 2);\n            }\n        }\n\n        _nuPoints ++;\n    }\n\n    if( ! _fastMode )\n    {\n        ccVertexLineToPolygon(_pointVertexes, _stroke, _vertices, 0, _nuPoints);\n    }\n\n    // Updated Tex Coords only if they are different than previous step\n    if( _nuPoints  && _previousNuPoints != _nuPoints ) {\n        float texDelta = 1.0f / _nuPoints;\n        for( i=0; i < _nuPoints; i++ ) {\n            _texCoords[i*2] = Tex2F(0, texDelta*i);\n            _texCoords[i*2+1] = Tex2F(1, texDelta*i);\n        }\n\n        _previousNuPoints = _nuPoints;\n    }\n}\n\nvoid MotionStreak::reset()\n{\n    _nuPoints = 0;\n}\n\nvoid MotionStreak::onDraw()\n{  \n    getShaderProgram()->use();\n    getShaderProgram()->setUniformsForBuiltins(_cachedMV);\n\n    GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX );\n    GL::blendFunc( _blendFunc.src, _blendFunc.dst );\n\n    GL::bindTexture2D( _texture->getName() );\n\n#ifdef EMSCRIPTEN\n    // Size calculations from ::initWithFade\n    setGLBufferData(_vertices, (sizeof(Vertex2F) * _maxPoints * 2), 0);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n\n    setGLBufferData(_texCoords, (sizeof(Tex2F) * _maxPoints * 2), 1);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, 0);\n\n    setGLBufferData(_colorPointer, (sizeof(GLubyte) * _maxPoints * 2 * 4), 2);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, _vertices);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, _texCoords);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, _colorPointer);\n#endif // EMSCRIPTEN\n\n    glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)_nuPoints*2);\n}\n\nvoid MotionStreak::draw()\n{\n    if(_nuPoints <= 1)\n        return;\n    kmGLGetMatrix(KM_GL_MODELVIEW,&_cachedMV);\n    _customCommand.init(_globalZOrder);\n    _customCommand.func = CC_CALLBACK_0(MotionStreak::onDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_customCommand);\n\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCMotionStreak.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      ForzeField Studios S.L.\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCMOTION_STREAK_H__\n#define __CCMOTION_STREAK_H__\n\n#include \"CCProtocols.h\"\n#include \"CCTexture2D.h\"\n#include \"ccTypes.h\"\n#include \"CCNode.h\"\n#include \"renderer/CCCustomCommand.h\"\n#ifdef EMSCRIPTEN\n#include \"CCGLBufferedNode.h\"\n#endif // EMSCRIPTEN\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup misc_nodes\n * @{\n */\n\n/** MotionStreak.\n Creates a trailing path.\n */\nclass CC_DLL MotionStreak : public Node, public TextureProtocol\n#ifdef EMSCRIPTEN\n, public GLBufferedNode\n#endif // EMSCRIPTEN\n{\npublic:\n    /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */\n    static MotionStreak* create(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path);\n    /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */\n    static MotionStreak* create(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture);\n\n    /** color used for the tint */\n    void tintWithColor(const Color3B& colors);\n\n    /** Remove all living segments of the ribbon */\n    void reset();\n\n    /** When fast mode is enabled, new points are added faster but with lower precision */\n    inline bool isFastMode() const { return _fastMode; }\n    inline void setFastMode(bool bFastMode) { _fastMode = bFastMode; }\n\n    inline bool isStartingPositionInitialized() const { return _startingPositionInitialized; }\n    inline void setStartingPositionInitialized(bool bStartingPositionInitialized) \n    { \n        _startingPositionInitialized = bStartingPositionInitialized; \n    }\n\n    // Overrides\n    virtual void setPosition(const Point& position) override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual void draw() override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual void update(float delta) override;\n    virtual Texture2D* getTexture() const override;\n    virtual void setTexture(Texture2D *texture) override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual void setBlendFunc(const BlendFunc &blendFunc) override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const BlendFunc& getBlendFunc() const override;\n    virtual GLubyte getOpacity() const override;\n    virtual void setOpacity(GLubyte opacity) override;\n    virtual void setOpacityModifyRGB(bool value) override;\n    virtual bool isOpacityModifyRGB() const override;\n\nprotected:\n    kmMat4 _cachedMV;\n    //renderer callback\n    void onDraw();\n\nprotected:\n    /**\n     * @js ctor\n     */\n    MotionStreak();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MotionStreak();\n\n    /** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename */\n    bool initWithFade(float fade, float minSeg, float stroke, const Color3B& color, const std::string& path);\n    /** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture  */\n    bool initWithFade(float fade, float minSeg, float stroke, const Color3B& color, Texture2D* texture);\n\n    bool _fastMode;\n    bool _startingPositionInitialized;\n\n    /** texture used for the motion streak */\n    Texture2D* _texture;\n    BlendFunc _blendFunc;\n    Point _positionR;\n\n    float _stroke;\n    float _fadeDelta;\n    float _minSeg;\n\n    unsigned int _maxPoints;\n    unsigned int _nuPoints;\n    unsigned int _previousNuPoints;\n\n    /** Pointers */\n    Point* _pointVertexes;\n    float* _pointState;\n\n    // Opengl\n    Vertex2F* _vertices;\n    GLubyte* _colorPointer;\n    Tex2F* _texCoords;\n    \n    CustomCommand _customCommand;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(MotionStreak);\n};\n\n// end of misc_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCMOTION_STREAK_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCNode.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2009      Valentin Milea\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCNode.h\"\n\n#include <algorithm>\n\n#include \"CCString.h\"\n#include \"ccCArray.h\"\n#include \"TransformUtils.h\"\n#include \"CCGrid.h\"\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n#include \"CCTouch.h\"\n#include \"CCActionManager.h\"\n#include \"CCScriptSupport.h\"\n#include \"CCGLProgram.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEvent.h\"\n#include \"CCEventTouch.h\"\n#include \"CCScene.h\"\n\n#if CC_USE_PHYSICS\n#include \"CCPhysicsBody.h\"\n#endif\n\n// externals\n#include \"kazmath/GL/matrix.h\"\n#include \"CCComponent.h\"\n#include \"CCComponentContainer.h\"\n\n\n\n#if CC_NODE_RENDER_SUBPIXEL\n#define RENDER_IN_SUBPIXEL\n#else\n#define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__))\n#endif\n\nNS_CC_BEGIN\n\nbool nodeComparisonLess(Node* n1, Node* n2)\n{\n    return( n1->getLocalZOrder() < n2->getLocalZOrder() ||\n           ( n1->getLocalZOrder() == n2->getLocalZOrder() && n1->getOrderOfArrival() < n2->getOrderOfArrival() )\n           );\n}\n\n// XXX: Yes, nodes might have a sort problem once every 15 days if the game runs at 60 FPS and each frame sprites are reordered.\nstatic int s_globalOrderOfArrival = 1;\n\nNode::Node(void)\n: _rotationX(0.0f)\n, _rotationY(0.0f)\n, _scaleX(1.0f)\n, _scaleY(1.0f)\n, _vertexZ(0.0f)\n, _position(Point::ZERO)\n, _skewX(0.0f)\n, _skewY(0.0f)\n, _anchorPointInPoints(Point::ZERO)\n, _anchorPoint(Point::ZERO)\n, _contentSize(Size::ZERO)\n, _useAdditionalTransform(false)\n, _transformDirty(true)\n, _inverseDirty(true)\n// children (lazy allocs)\n// lazy alloc\n, _localZOrder(0)\n, _globalZOrder(0)\n, _parent(nullptr)\n// \"whole screen\" objects. like Scenes and Layers, should set _ignoreAnchorPointForPosition to true\n, _tag(Node::INVALID_TAG)\n// userData is always inited as nil\n, _userData(nullptr)\n, _userObject(nullptr)\n, _shaderProgram(nullptr)\n, _orderOfArrival(0)\n, _running(false)\n, _visible(true)\n, _ignoreAnchorPointForPosition(false)\n, _reorderChildDirty(false)\n, _isTransitionFinished(false)\n, _updateScriptHandler(0)\n, _componentContainer(nullptr)\n#if CC_USE_PHYSICS\n, _physicsBody(nullptr)\n#endif\n, _displayedOpacity(255)\n, _realOpacity(255)\n, _displayedColor(Color3B::WHITE)\n, _realColor(Color3B::WHITE)\n, _cascadeColorEnabled(false)\n, _cascadeOpacityEnabled(false)\n{\n    // set default scheduler and actionManager\n    Director *director = Director::getInstance();\n    _actionManager = director->getActionManager();\n    _actionManager->retain();\n    _scheduler = director->getScheduler();\n    _scheduler->retain();\n    _eventDispatcher = director->getEventDispatcher();\n    _eventDispatcher->retain();\n    \n    ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine();\n    _scriptType = engine != nullptr ? engine->getScriptType() : kScriptTypeNone;\n\n    kmMat4Identity(&_transform);\n    kmMat4Identity(&_inverse);\n    kmMat4Identity(&_additionalTransform);\n}\n\nNode::~Node()\n{\n    CCLOGINFO( \"deallocing Node: %p - tag: %i\", this, _tag );\n    \n    if (_updateScriptHandler)\n    {\n        ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler);\n    }\n\n    CC_SAFE_RELEASE(_actionManager);\n    CC_SAFE_RELEASE(_scheduler);\n    \n    _eventDispatcher->cleanTarget(this);\n    CC_SAFE_RELEASE(_eventDispatcher);\n    \n    // attributes\n    CC_SAFE_RELEASE(_shaderProgram);\n    CC_SAFE_RELEASE(_userObject);\n\n    for (auto& child : _children)\n    {\n        child->_parent = nullptr;\n    }\n\n    removeAllComponents();\n    \n    CC_SAFE_DELETE(_componentContainer);\n    \n#if CC_USE_PHYSICS\n    CC_SAFE_RELEASE(_physicsBody);\n#endif\n}\n\nbool Node::init()\n{\n    return true;\n}\n\nfloat Node::getSkewX() const\n{\n    return _skewX;\n}\n\nvoid Node::setSkewX(float newSkewX)\n{\n    _skewX = newSkewX;\n    _transformDirty = _inverseDirty = true;\n}\n\nfloat Node::getSkewY() const\n{\n    return _skewY;\n}\n\nvoid Node::setSkewY(float newSkewY)\n{\n    _skewY = newSkewY;\n\n    _transformDirty = _inverseDirty = true;\n}\n\n\n/// zOrder setter : private method\n/// used internally to alter the zOrder variable. DON'T call this method manually \nvoid Node::_setLocalZOrder(int z)\n{\n    _localZOrder = z;\n}\n\nvoid Node::setLocalZOrder(int z)\n{\n    _localZOrder = z;\n    if (_parent)\n    {\n        _parent->reorderChild(this, z);\n    }\n\n    _eventDispatcher->setDirtyForNode(this);\n}\n\nvoid Node::setGlobalZOrder(float globalZOrder)\n{\n    if (_globalZOrder != globalZOrder)\n    {\n        _globalZOrder = globalZOrder;\n        _eventDispatcher->setDirtyForNode(this);\n    }\n}\n\n/// vertexZ getter\nfloat Node::getVertexZ() const\n{\n    return _vertexZ;\n}\n\n\n/// vertexZ setter\nvoid Node::setVertexZ(float zOrder)\n{\n    _vertexZ = zOrder;\n    setGlobalZOrder(zOrder);\n}\n\n\n/// rotation getter\nfloat Node::getRotation() const\n{\n    CCASSERT(_rotationX == _rotationY, \"CCNode#rotation. RotationX != RotationY. Don't know which one to return\");\n    return _rotationX;\n}\n\n/// rotation setter\nvoid Node::setRotation(float newRotation)\n{\n    _rotationX = _rotationY = newRotation;\n    _transformDirty = _inverseDirty = true;\n    \n#if CC_USE_PHYSICS\n    if (_physicsBody)\n    {\n        _physicsBody->setRotation(newRotation);\n    }\n#endif\n}\n\nfloat Node::getRotationX() const\n{\n    return _rotationX;\n}\n\nvoid Node::setRotationX(float fRotationX)\n{\n    _rotationX = fRotationX;\n    _transformDirty = _inverseDirty = true;\n}\n\nfloat Node::getRotationY() const\n{\n    return _rotationY;\n}\n\nvoid Node::setRotationY(float rotationY)\n{\n    _rotationY = rotationY;\n    _transformDirty = _inverseDirty = true;\n}\n\n/// scale getter\nfloat Node::getScale(void) const\n{\n    CCASSERT( _scaleX == _scaleY, \"CCNode#scale. ScaleX != ScaleY. Don't know which one to return\");\n    return _scaleX;\n}\n\n/// scale setter\nvoid Node::setScale(float scale)\n{\n    _scaleX = _scaleY = scale;\n    _transformDirty = _inverseDirty = true;\n}\n\n/// scaleX getter\nfloat Node::getScaleX() const\n{\n    return _scaleX;\n}\n\n/// scale setter\nvoid Node::setScale(float scaleX,float scaleY)\n{\n    _scaleX = scaleX;\n    _scaleY = scaleY;\n    _transformDirty = _inverseDirty = true;\n}\n\n/// scaleX setter\nvoid Node::setScaleX(float newScaleX)\n{\n    _scaleX = newScaleX;\n    _transformDirty = _inverseDirty = true;\n}\n\n/// scaleY getter\nfloat Node::getScaleY() const\n{\n    return _scaleY;\n}\n\n/// scaleY setter\nvoid Node::setScaleY(float newScaleY)\n{\n    _scaleY = newScaleY;\n    _transformDirty = _inverseDirty = true;\n}\n\n/// position getter\nconst Point& Node::getPosition() const\n{\n    return _position;\n}\n\n/// position setter\nvoid Node::setPosition(const Point& newPosition)\n{\n    _position = newPosition;\n    _transformDirty = _inverseDirty = true;\n    \n#if CC_USE_PHYSICS\n    if (_physicsBody)\n    {\n        _physicsBody->setPosition(newPosition);\n    }\n#endif\n}\n\nvoid Node::getPosition(float* x, float* y) const\n{\n    *x = _position.x;\n    *y = _position.y;\n}\n\nvoid Node::setPosition(float x, float y)\n{\n    setPosition(Point(x, y));\n}\n\nfloat Node::getPositionX() const\n{\n    return _position.x;\n}\n\nfloat Node::getPositionY() const\n{\n    return  _position.y;\n}\n\nvoid Node::setPositionX(float x)\n{\n    setPosition(Point(x, _position.y));\n}\n\nvoid Node::setPositionY(float y)\n{\n    setPosition(Point(_position.x, y));\n}\n\nssize_t Node::getChildrenCount() const\n{\n    return _children.size();\n}\n\n/// isVisible getter\nbool Node::isVisible() const\n{\n    return _visible;\n}\n\n/// isVisible setter\nvoid Node::setVisible(bool var)\n{\n    _visible = var;\n}\n\nconst Point& Node::getAnchorPointInPoints() const\n{\n    return _anchorPointInPoints;\n}\n\n/// anchorPoint getter\nconst Point& Node::getAnchorPoint() const\n{\n    return _anchorPoint;\n}\n\nvoid Node::setAnchorPoint(const Point& point)\n{\n    if( ! point.equals(_anchorPoint))\n    {\n        _anchorPoint = point;\n        _anchorPointInPoints = Point(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y );\n        _transformDirty = _inverseDirty = true;\n    }\n}\n\n/// contentSize getter\nconst Size& Node::getContentSize() const\n{\n    return _contentSize;\n}\n\nvoid Node::setContentSize(const Size & size)\n{\n    if ( ! size.equals(_contentSize))\n    {\n        _contentSize = size;\n\n        _anchorPointInPoints = Point(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y );\n        _transformDirty = _inverseDirty = true;\n    }\n}\n\n// isRunning getter\nbool Node::isRunning() const\n{\n    return _running;\n}\n\n/// parent setter\nvoid Node::setParent(Node * var)\n{\n    _parent = var;\n}\n\n/// isRelativeAnchorPoint getter\nbool Node::isIgnoreAnchorPointForPosition() const\n{\n    return _ignoreAnchorPointForPosition;\n}\n/// isRelativeAnchorPoint setter\nvoid Node::ignoreAnchorPointForPosition(bool newValue)\n{\n    if (newValue != _ignoreAnchorPointForPosition) \n    {\n\t\t_ignoreAnchorPointForPosition = newValue;\n\t\t_transformDirty = _inverseDirty = true;\n\t}\n}\n\n/// tag getter\nint Node::getTag() const\n{\n    return _tag;\n}\n\n/// tag setter\nvoid Node::setTag(int var)\n{\n    _tag = var;\n}\n\n/// userData setter\nvoid Node::setUserData(void *var)\n{\n    _userData = var;\n}\n\nint Node::getOrderOfArrival() const\n{\n    return _orderOfArrival;\n}\n\nvoid Node::setOrderOfArrival(int orderOfArrival)\n{\n    CCASSERT(orderOfArrival >=0, \"Invalid orderOfArrival\");\n    _orderOfArrival = orderOfArrival;\n}\n\nvoid Node::setUserObject(Object *pUserObject)\n{\n    CC_SAFE_RETAIN(pUserObject);\n    CC_SAFE_RELEASE(_userObject);\n    _userObject = pUserObject;\n}\n\nvoid Node::setShaderProgram(GLProgram *pShaderProgram)\n{\n    CC_SAFE_RETAIN(pShaderProgram);\n    CC_SAFE_RELEASE(_shaderProgram);\n    _shaderProgram = pShaderProgram;\n}\n\nScene* Node::getScene()\n{\n    if(!_parent)\n        return nullptr;\n    return _parent->getScene();\n}\n\nRect Node::getBoundingBox() const\n{\n    Rect rect = Rect(0, 0, _contentSize.width, _contentSize.height);\n    return RectApplyAffineTransform(rect, getNodeToParentAffineTransform());\n}\n\nNode * Node::create(void)\n{\n\tNode * ret = new Node();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n\treturn ret;\n}\n\nvoid Node::cleanup()\n{\n    // actions\n    this->stopAllActions();\n    this->unscheduleAllSelectors();\n    \n    if ( _scriptType != kScriptTypeNone)\n    {\n        int action = kNodeOnCleanup;\n        BasicScriptData data(this,(void*)&action);\n        ScriptEvent scriptEvent(kNodeEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n    }\n    \n    // timers\n    for( const auto &child: _children)\n        child->cleanup();\n}\n\n\nstd::string Node::getDescription() const\n{\n    return StringUtils::format(\"<Node | Tag = %d\", _tag);\n}\n\n// lazy allocs\nvoid Node::childrenAlloc(void)\n{\n    _children.reserve(4);\n}\n\nNode* Node::getChildByTag(int tag)\n{\n    CCASSERT( tag != Node::INVALID_TAG, \"Invalid tag\");\n\n    for (auto& child : _children)\n    {\n        if(child && child->_tag == tag)\n            return child;\n    }\n    return nullptr;\n}\n\n/* \"add\" logic MUST only be on this method\n* If a class want's to extend the 'addChild' behavior it only needs\n* to override this method\n*/\nvoid Node::addChild(Node *child, int zOrder, int tag)\n{    \n    CCASSERT( child != nullptr, \"Argument must be non-nil\");\n    CCASSERT( child->_parent == nullptr, \"child already added. It can't be added again\");\n\n    if (_children.empty())\n    {\n        this->childrenAlloc();\n    }\n\n    this->insertChild(child, zOrder);\n    \n#if CC_USE_PHYSICS\n    for (Node* node = this->getParent(); node != nullptr; node = node->getParent())\n    {\n        if (dynamic_cast<Scene*>(node) != nullptr)\n        {\n            (dynamic_cast<Scene*>(node))->addChildToPhysicsWorld(child);\n            break;\n        }\n    }\n#endif\n\n    child->_tag = tag;\n\n    child->setParent(this);\n    child->setOrderOfArrival(s_globalOrderOfArrival++);\n\n    if( _running )\n    {\n        child->onEnter();\n        // prevent onEnterTransitionDidFinish to be called twice when a node is added in onEnter\n        if (_isTransitionFinished) {\n            child->onEnterTransitionDidFinish();\n        }\n    }\n    \n    if (_cascadeColorEnabled)\n    {\n        updateCascadeColor();\n    }\n    \n    if (_cascadeOpacityEnabled)\n    {\n        updateCascadeOpacity();\n    }\n}\n\nvoid Node::addChild(Node *child, int zOrder)\n{\n    CCASSERT( child != nullptr, \"Argument must be non-nil\");\n    this->addChild(child, zOrder, child->_tag);\n}\n\nvoid Node::addChild(Node *child)\n{\n    CCASSERT( child != nullptr, \"Argument must be non-nil\");\n    this->addChild(child, child->_localZOrder, child->_tag);\n}\n\nvoid Node::removeFromParent()\n{\n    this->removeFromParentAndCleanup(true);\n}\n\nvoid Node::removeFromParentAndCleanup(bool cleanup)\n{\n    if (_parent != nullptr)\n    {\n        _parent->removeChild(this,cleanup);\n    } \n}\n\n/* \"remove\" logic MUST only be on this method\n* If a class want's to extend the 'removeChild' behavior it only needs\n* to override this method\n*/\nvoid Node::removeChild(Node* child, bool cleanup /* = true */)\n{\n    // explicit nil handling\n    if (_children.empty())\n    {\n        return;\n    }\n\n    ssize_t index = _children.getIndex(child);\n    if( index != CC_INVALID_INDEX )\n        this->detachChild( child, index, cleanup );\n}\n\nvoid Node::removeChildByTag(int tag, bool cleanup/* = true */)\n{\n    CCASSERT( tag != Node::INVALID_TAG, \"Invalid tag\");\n\n    Node *child = this->getChildByTag(tag);\n\n    if (child == nullptr)\n    {\n        CCLOG(\"cocos2d: removeChildByTag(tag = %d): child not found!\", tag);\n    }\n    else\n    {\n        this->removeChild(child, cleanup);\n    }\n}\n\nvoid Node::removeAllChildren()\n{\n    this->removeAllChildrenWithCleanup(true);\n}\n\nvoid Node::removeAllChildrenWithCleanup(bool cleanup)\n{\n    // not using detachChild improves speed here\n    for (auto& child : _children)\n    {\n        // IMPORTANT:\n        //  -1st do onExit\n        //  -2nd cleanup\n        if(_running)\n        {\n            child->onExitTransitionDidStart();\n            child->onExit();\n        }\n\n        if (cleanup)\n        {\n            child->cleanup();\n        }\n        // set parent nil at the end\n        child->setParent(nullptr);\n    }\n    \n    _children.clear();\n}\n\nvoid Node::detachChild(Node *child, ssize_t childIndex, bool doCleanup)\n{\n    // IMPORTANT:\n    //  -1st do onExit\n    //  -2nd cleanup\n    if (_running)\n    {\n        child->onExitTransitionDidStart();\n        child->onExit();\n    }\n    \n#if CC_USE_PHYSICS\n    if (child->_physicsBody != nullptr)\n    {\n        child->_physicsBody->removeFromWorld();\n    }\n    \n#endif\n\n    // If you don't do cleanup, the child's actions will not get removed and the\n    // its scheduledSelectors_ dict will not get released!\n    if (doCleanup)\n    {\n        child->cleanup();\n    }\n\n    // set parent nil at the end\n    child->setParent(nullptr);\n\n    _children.erase(childIndex);\n}\n\n\n// helper used by reorderChild & add\nvoid Node::insertChild(Node* child, int z)\n{\n    _reorderChildDirty = true;\n    _children.pushBack(child);\n    child->_setLocalZOrder(z);\n}\n\nvoid Node::reorderChild(Node *child, int zOrder)\n{\n    CCASSERT( child != nullptr, \"Child must be non-nil\");\n    _reorderChildDirty = true;\n    child->setOrderOfArrival(s_globalOrderOfArrival++);\n    child->_setLocalZOrder(zOrder);\n}\n\nvoid Node::sortAllChildren()\n{\n    if( _reorderChildDirty ) {\n        std::sort( std::begin(_children), std::end(_children), nodeComparisonLess );\n        _reorderChildDirty = false;\n    }\n}\n\n\n void Node::draw()\n {\n     //CCASSERT(0);\n     // override me\n     // Only use- this function to draw your stuff.\n     // DON'T draw your stuff outside this method\n }\n\nvoid Node::visit()\n{\n    // quick return if not visible. children won't be drawn.\n    if (!_visible)\n    {\n        return;\n    }\n    \n    kmGLPushMatrix();\n\n    this->transform();\n    int i = 0;\n\n    if(!_children.empty())\n    {\n        sortAllChildren();\n        // draw children zOrder < 0\n        for( ; i < _children.size(); i++ )\n        {\n            auto node = _children.at(i);\n\n            if ( node && node->_localZOrder < 0 )\n                node->visit();\n            else\n                break;\n        }\n        // self draw\n        this->draw();\n\n        for(auto it=_children.cbegin()+i; it != _children.cend(); ++it)\n            (*it)->visit();\n    }\n    else\n    {\n        this->draw();\n    }\n\n    // reset for next frame\n    _orderOfArrival = 0;\n \n    kmGLPopMatrix();\n}\n\nvoid Node::transformAncestors()\n{\n    if( _parent != nullptr  )\n    {\n        _parent->transformAncestors();\n        _parent->transform();\n    }\n}\n\nvoid Node::transform()\n{\n#if CC_USE_PHYSICS\n    updatePhysicsTransform();\n#endif\n\n    kmMat4 transfrom4x4 = this->getNodeToParentTransform();\n\n    kmGLMultMatrix( &transfrom4x4 );\n\n    // saves the MV matrix\n    kmGLGetMatrix(KM_GL_MODELVIEW, &_modelViewTransform);\n}\n\nvoid Node::onEnter()\n{\n    _isTransitionFinished = false;\n\n    if (_scriptType != kScriptTypeNone)\n    {\n        int action = kNodeOnEnter;\n        BasicScriptData data(this,(void*)&action);\n        ScriptEvent scriptEvent(kNodeEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n    }\n    \n    for( const auto &child: _children)\n        child->onEnter();\n\n    this->resume();\n    \n    _running = true;\n}\n\nvoid Node::onEnterTransitionDidFinish()\n{\n    _isTransitionFinished = true;\n\n    if (_scriptType != kScriptTypeNone)\n    {\n        int action = kNodeOnEnterTransitionDidFinish;\n        BasicScriptData data(this,(void*)&action);\n        ScriptEvent scriptEvent(kNodeEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n    }\n    \n    for( const auto &child: _children)\n        child->onEnterTransitionDidFinish();\n}\n\nvoid Node::onExitTransitionDidStart()\n{\n    for( const auto &child: _children)\n        child->onExitTransitionDidStart();\n    \n    if (_scriptType != kScriptTypeNone)\n    {\n        int action = kNodeOnExitTransitionDidStart;\n        BasicScriptData data(this,(void*)&action);\n        ScriptEvent scriptEvent(kNodeEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n    }\n}\n\nvoid Node::onExit()\n{\n    this->pause();\n\n    _running = false;\n\n    for( const auto &child: _children)\n        child->onExit();\n    \n    if (_scriptType != kScriptTypeNone)\n    {\n        int action = kNodeOnExit;\n        BasicScriptData data(this,(void*)&action);\n        ScriptEvent scriptEvent(kNodeEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n    }\n}\n\nvoid Node::setEventDispatcher(EventDispatcher* dispatcher)\n{\n    if (dispatcher != _eventDispatcher)\n    {\n        _eventDispatcher->cleanTarget(this);\n        CC_SAFE_RETAIN(dispatcher);\n        CC_SAFE_RELEASE(_eventDispatcher);\n        _eventDispatcher = dispatcher;\n    }\n}\n\nvoid Node::setActionManager(ActionManager* actionManager)\n{\n    if( actionManager != _actionManager ) {\n        this->stopAllActions();\n        CC_SAFE_RETAIN(actionManager);\n        CC_SAFE_RELEASE(_actionManager);\n        _actionManager = actionManager;\n    }\n}\n\nAction * Node::runAction(Action* action)\n{\n    CCASSERT( action != nullptr, \"Argument must be non-nil\");\n    _actionManager->addAction(action, this, !_running);\n    return action;\n}\n\nvoid Node::stopAllActions()\n{\n    _actionManager->removeAllActionsFromTarget(this);\n}\n\nvoid Node::stopAction(Action* action)\n{\n    _actionManager->removeAction(action);\n}\n\nvoid Node::stopActionByTag(int tag)\n{\n    CCASSERT( tag != Action::INVALID_TAG, \"Invalid tag\");\n    _actionManager->removeActionByTag(tag, this);\n}\n\nAction * Node::getActionByTag(int tag)\n{\n    CCASSERT( tag != Action::INVALID_TAG, \"Invalid tag\");\n    return _actionManager->getActionByTag(tag, this);\n}\n\nssize_t Node::getNumberOfRunningActions() const\n{\n    return _actionManager->getNumberOfRunningActionsInTarget(this);\n}\n\n// Node - Callbacks\n\nvoid Node::setScheduler(Scheduler* scheduler)\n{\n    if( scheduler != _scheduler ) {\n        this->unscheduleAllSelectors();\n        CC_SAFE_RETAIN(scheduler);\n        CC_SAFE_RELEASE(_scheduler);\n        _scheduler = scheduler;\n    }\n}\n\nbool Node::isScheduled(SEL_SCHEDULE selector)\n{\n    return _scheduler->isScheduledForTarget(selector, this);\n}\n\nvoid Node::scheduleUpdate()\n{\n    scheduleUpdateWithPriority(0);\n}\n\nvoid Node::scheduleUpdateWithPriority(int priority)\n{\n    _scheduler->scheduleUpdateForTarget(this, priority, !_running);\n}\n\nvoid Node::scheduleUpdateWithPriorityLua(int nHandler, int priority)\n{\n    unscheduleUpdate();\n    _updateScriptHandler = nHandler;\n    _scheduler->scheduleUpdateForTarget(this, priority, !_running);\n}\n\nvoid Node::unscheduleUpdate()\n{\n    _scheduler->unscheduleUpdateForTarget(this);\n    if (_updateScriptHandler)\n    {\n        ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_updateScriptHandler);\n        _updateScriptHandler = 0;\n    }\n}\n\nvoid Node::schedule(SEL_SCHEDULE selector)\n{\n    this->schedule(selector, 0.0f, kRepeatForever, 0.0f);\n}\n\nvoid Node::schedule(SEL_SCHEDULE selector, float interval)\n{\n    this->schedule(selector, interval, kRepeatForever, 0.0f);\n}\n\nvoid Node::schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay)\n{\n    CCASSERT( selector, \"Argument must be non-nil\");\n    CCASSERT( interval >=0, \"Argument must be positive\");\n\n    _scheduler->scheduleSelector(selector, this, interval , repeat, delay, !_running);\n}\n\nvoid Node::scheduleOnce(SEL_SCHEDULE selector, float delay)\n{\n    this->schedule(selector, 0.0f, 0, delay);\n}\n\nvoid Node::unschedule(SEL_SCHEDULE selector)\n{\n    // explicit nil handling\n    if (selector == 0)\n        return;\n\n    _scheduler->unscheduleSelector(selector, this);\n}\n\nvoid Node::unscheduleAllSelectors()\n{\n    _scheduler->unscheduleAllForTarget(this);\n}\n\nvoid Node::resume()\n{\n    _scheduler->resumeTarget(this);\n    _actionManager->resumeTarget(this);\n    _eventDispatcher->resumeTarget(this);\n}\n\nvoid Node::pause()\n{\n    _scheduler->pauseTarget(this);\n    _actionManager->pauseTarget(this);\n    _eventDispatcher->pauseTarget(this);\n}\n\nvoid Node::resumeSchedulerAndActions()\n{\n    resume();\n}\n\nvoid Node::pauseSchedulerAndActions()\n{\n    pause();\n}\n\n// override me\nvoid Node::update(float fDelta)\n{\n    if (0 != _updateScriptHandler)\n    {\n        //only lua use\n        SchedulerScriptData data(_updateScriptHandler,fDelta);\n        ScriptEvent event(kScheduleEvent,&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n    \n    if (_componentContainer && !_componentContainer->isEmpty())\n    {\n        _componentContainer->visit(fDelta);\n    }\n}\n\nAffineTransform Node::getNodeToParentAffineTransform() const\n{\n    AffineTransform ret;\n    kmMat4 ret4 = getNodeToParentTransform();\n    GLToCGAffine(ret4.mat, &ret);\n\n    return ret;\n}\n\nconst kmMat4& Node::getNodeToParentTransform() const\n{\n    if (_transformDirty)\n    {\n        // Translate values\n        float x = _position.x;\n        float y = _position.y;\n\n        if (_ignoreAnchorPointForPosition)\n        {\n            x += _anchorPointInPoints.x;\n            y += _anchorPointInPoints.y;\n        }\n\n        // Rotation values\n\t\t// Change rotation code to handle X and Y\n\t\t// If we skew with the exact same value for both x and y then we're simply just rotating\n        float cx = 1, sx = 0, cy = 1, sy = 0;\n        if (_rotationX || _rotationY)\n        {\n            float radiansX = -CC_DEGREES_TO_RADIANS(_rotationX);\n            float radiansY = -CC_DEGREES_TO_RADIANS(_rotationY);\n            cx = cosf(radiansX);\n            sx = sinf(radiansX);\n            cy = cosf(radiansY);\n            sy = sinf(radiansY);\n        }\n\n        bool needsSkewMatrix = ( _skewX || _skewY );\n\n\n        // optimization:\n        // inline anchor point calculation if skew is not needed\n        // Adjusted transform calculation for rotational skew\n        if (! needsSkewMatrix && !_anchorPointInPoints.equals(Point::ZERO))\n        {\n            x += cy * -_anchorPointInPoints.x * _scaleX + -sx * -_anchorPointInPoints.y * _scaleY;\n            y += sy * -_anchorPointInPoints.x * _scaleX +  cx * -_anchorPointInPoints.y * _scaleY;\n        }\n\n\n        // Build Transform Matrix\n        // Adjusted transform calculation for rotational skew\n        kmScalar mat[] = { cy * _scaleX, sy * _scaleX, 0,  0,\n                      -sx * _scaleY, cx * _scaleY, 0,  0,\n                        0,  0,  1,  0,\n                        x,  y,  0,  1 };\n        \n        kmMat4Fill(&_transform, mat);\n\n        // XXX: Try to inline skew\n        // If skew is needed, apply skew and then anchor point\n        if (needsSkewMatrix)\n        {\n            kmMat4 skewMatrix = { 1, (float)tanf(CC_DEGREES_TO_RADIANS(_skewY)), 0, 0,\n                                  (float)tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1, 0, 0,\n                                  0,  0,  1, 0,\n                                  0,  0,  0, 1};\n\n            kmMat4Multiply(&_transform, &_transform, &skewMatrix);\n\n            // adjust anchor point\n            if (!_anchorPointInPoints.equals(Point::ZERO))\n            {\n                // XXX: Argh, kmMat needs a \"translate\" method.\n                // XXX: Although this is faster than multiplying a vec4 * mat4\n                _transform.mat[12] += _transform.mat[0] * -_anchorPointInPoints.x + _transform.mat[4] * -_anchorPointInPoints.y;\n                _transform.mat[13] += _transform.mat[1] * -_anchorPointInPoints.x + _transform.mat[5] * -_anchorPointInPoints.y;\n            }\n        }\n\n        // vertex Z\n        _transform.mat[14] = _vertexZ;\n\n        if (_useAdditionalTransform)\n        {\n            kmMat4Multiply(&_transform, &_transform, &_additionalTransform);\n        }\n\n        _transformDirty = false;\n    }\n\n    return _transform;\n}\n\nvoid Node::setNodeToParentTransform(const kmMat4& transform)\n{\n    _transform = transform;\n    _transformDirty = false;\n}\n\nvoid Node::setAdditionalTransform(const AffineTransform& additionalTransform)\n{\n    CGAffineToGL(additionalTransform, _additionalTransform.mat);\n    _transformDirty = true;\n    _useAdditionalTransform = true;\n}\n\nvoid Node::setAdditionalTransform(const kmMat4& additionalTransform)\n{\n    _additionalTransform = additionalTransform;\n    _transformDirty = true;\n    _useAdditionalTransform = true;\n}\n\n\nAffineTransform Node::getParentToNodeAffineTransform() const\n{\n    AffineTransform ret;\n    kmMat4 ret4 = getParentToNodeTransform();\n\n    GLToCGAffine(ret4.mat,&ret);\n    return ret;\n}\n\nconst kmMat4& Node::getParentToNodeTransform() const\n{\n    if ( _inverseDirty ) {\n        kmMat4Inverse(&_inverse, &_transform);\n        _inverseDirty = false;\n    }\n\n    return _inverse;\n}\n\n\nAffineTransform Node::getNodeToWorldAffineTransform() const\n{\n    AffineTransform t = this->getNodeToParentAffineTransform();\n\n    for (Node *p = _parent; p != nullptr; p = p->getParent())\n        t = AffineTransformConcat(t, p->getNodeToParentAffineTransform());\n\n    return t;\n}\n\nkmMat4 Node::getNodeToWorldTransform() const\n{\n    kmMat4 t = this->getNodeToParentTransform();\n\n    for (Node *p = _parent; p != nullptr; p = p->getParent())\n        kmMat4Multiply(&t, &p->getNodeToParentTransform(), &t);\n\n    return t;\n}\n\nAffineTransform Node::getWorldToNodeAffineTransform() const\n{\n    return AffineTransformInvert(this->getNodeToWorldAffineTransform());\n}\n\nkmMat4 Node::getWorldToNodeTransform() const\n{\n    kmMat4 tmp, tmp2;\n\n    tmp2 = this->getNodeToWorldTransform();\n    kmMat4Inverse(&tmp, &tmp2);\n    return tmp;\n}\n\n\nPoint Node::convertToNodeSpace(const Point& worldPoint) const\n{\n    kmMat4 tmp = getWorldToNodeTransform();\n    kmVec3 vec3 = {worldPoint.x, worldPoint.y, 0};\n    kmVec3 ret;\n    kmVec3Transform(&ret, &vec3, &tmp);\n    return Point(ret.x, ret.y);\n}\n\nPoint Node::convertToWorldSpace(const Point& nodePoint) const\n{\n    kmMat4 tmp = getNodeToWorldTransform();\n    kmVec3 vec3 = {nodePoint.x, nodePoint.y, 0};\n    kmVec3 ret;\n    kmVec3Transform(&ret, &vec3, &tmp);\n    return Point(ret.x, ret.y);\n\n}\n\nPoint Node::convertToNodeSpaceAR(const Point& worldPoint) const\n{\n    Point nodePoint = convertToNodeSpace(worldPoint);\n    return nodePoint - _anchorPointInPoints;\n}\n\nPoint Node::convertToWorldSpaceAR(const Point& nodePoint) const\n{\n    Point pt = nodePoint + _anchorPointInPoints;\n    return convertToWorldSpace(pt);\n}\n\nPoint Node::convertToWindowSpace(const Point& nodePoint) const\n{\n    Point worldPoint = this->convertToWorldSpace(nodePoint);\n    return Director::getInstance()->convertToUI(worldPoint);\n}\n\n// convenience methods which take a Touch instead of Point\nPoint Node::convertTouchToNodeSpace(Touch *touch) const\n{\n    Point point = touch->getLocation();\n    return this->convertToNodeSpace(point);\n}\nPoint Node::convertTouchToNodeSpaceAR(Touch *touch) const\n{\n    Point point = touch->getLocation();\n    return this->convertToNodeSpaceAR(point);\n}\n\n#if CC_USE_PHYSICS\nbool Node::updatePhysicsTransform()\n{\n    if (_physicsBody != nullptr && _physicsBody->getWorld() != nullptr && !_physicsBody->isResting())\n    {\n        _position = _physicsBody->getPosition();\n        _rotationX = _rotationY = _physicsBody->getRotation();\n        _transformDirty = _inverseDirty = true;\n        return true;\n    }\n    \n    return false;\n}\n#endif\n\nvoid Node::updateTransform()\n{\n    // Recursively iterate over children\n    for( const auto &child: _children)\n        child->updateTransform();\n}\n\nComponent* Node::getComponent(const std::string& pName)\n{\n    if( _componentContainer )\n        return _componentContainer->get(pName);\n    return nullptr;\n}\n\nbool Node::addComponent(Component *pComponent)\n{\n    // lazy alloc\n    if( !_componentContainer )\n        _componentContainer = new ComponentContainer(this);\n    return _componentContainer->add(pComponent);\n}\n\nbool Node::removeComponent(const std::string& pName)\n{\n    if( _componentContainer )\n        return _componentContainer->remove(pName);\n    return false;\n}\n\nvoid Node::removeAllComponents()\n{\n    if( _componentContainer )\n        _componentContainer->removeAll();\n}\n\n#if CC_USE_PHYSICS\nvoid Node::setPhysicsBody(PhysicsBody* body)\n{\n    if (_physicsBody != nullptr)\n    {\n        _physicsBody->_node = nullptr;\n        _physicsBody->release();\n    }\n    \n    _physicsBody = body;\n    _physicsBody->_node = this;\n    _physicsBody->retain();\n    _physicsBody->setPosition(getPosition());\n    _physicsBody->setRotation(getRotation());\n}\n\nPhysicsBody* Node::getPhysicsBody() const\n{\n    return _physicsBody;\n}\n#endif //CC_USE_PHYSICS\n\nGLubyte Node::getOpacity(void) const\n{\n\treturn _realOpacity;\n}\n\nGLubyte Node::getDisplayedOpacity(void) const\n{\n\treturn _displayedOpacity;\n}\n\nvoid Node::setOpacity(GLubyte opacity)\n{\n    _displayedOpacity = _realOpacity = opacity;\n    \n    updateCascadeOpacity();\n}\n\nvoid Node::updateDisplayedOpacity(GLubyte parentOpacity)\n{\n\t_displayedOpacity = _realOpacity * parentOpacity/255.0;\n    updateColor();\n    \n    if (_cascadeOpacityEnabled)\n    {\n        for(auto child : _children){\n            child->updateDisplayedOpacity(_displayedOpacity);\n        }\n    }\n}\n\nbool Node::isCascadeOpacityEnabled(void) const\n{\n    return _cascadeOpacityEnabled;\n}\n\nvoid Node::setCascadeOpacityEnabled(bool cascadeOpacityEnabled)\n{\n    if (_cascadeOpacityEnabled == cascadeOpacityEnabled)\n    {\n        return;\n    }\n    \n    _cascadeOpacityEnabled = cascadeOpacityEnabled;\n    \n    if (cascadeOpacityEnabled)\n    {\n        updateCascadeOpacity();\n    }\n    else\n    {\n        disableCascadeOpacity();\n    }\n}\n\nvoid Node::updateCascadeOpacity()\n{\n    GLubyte parentOpacity = 255;\n    \n    if (_parent != nullptr && _parent->isCascadeOpacityEnabled())\n    {\n        parentOpacity = _parent->getDisplayedOpacity();\n    }\n    \n    updateDisplayedOpacity(parentOpacity);\n}\n\nvoid Node::disableCascadeOpacity()\n{\n    _displayedOpacity = _realOpacity;\n    \n    for(auto child : _children){\n        child->updateDisplayedOpacity(255);\n    }\n}\n\nconst Color3B& Node::getColor(void) const\n{\n\treturn _realColor;\n}\n\nconst Color3B& Node::getDisplayedColor() const\n{\n\treturn _displayedColor;\n}\n\nvoid Node::setColor(const Color3B& color)\n{\n\t_displayedColor = _realColor = color;\n\t\n\tupdateCascadeColor();\n}\n\nvoid Node::updateDisplayedColor(const Color3B& parentColor)\n{\n\t_displayedColor.r = _realColor.r * parentColor.r/255.0;\n\t_displayedColor.g = _realColor.g * parentColor.g/255.0;\n\t_displayedColor.b = _realColor.b * parentColor.b/255.0;\n    updateColor();\n    \n    if (_cascadeColorEnabled)\n    {\n        for(const auto &child : _children){\n            child->updateDisplayedColor(_displayedColor);\n        }\n    }\n}\n\nbool Node::isCascadeColorEnabled(void) const\n{\n    return _cascadeColorEnabled;\n}\n\nvoid Node::setCascadeColorEnabled(bool cascadeColorEnabled)\n{\n    if (_cascadeColorEnabled == cascadeColorEnabled)\n    {\n        return;\n    }\n    \n    _cascadeColorEnabled = cascadeColorEnabled;\n    \n    if (_cascadeColorEnabled)\n    {\n        updateCascadeColor();\n    }\n    else\n    {\n        disableCascadeColor();\n    }\n}\n\nvoid Node::updateCascadeColor()\n{\n\tColor3B parentColor = Color3B::WHITE;\n    if (_parent && _parent->isCascadeColorEnabled())\n    {\n        parentColor = _parent->getDisplayedColor();\n    }\n    \n    updateDisplayedColor(parentColor);\n}\n\nvoid Node::disableCascadeColor()\n{\n    for(auto child : _children){\n        child->updateDisplayedColor(Color3B::WHITE);\n    }\n}\n\n__NodeRGBA::__NodeRGBA()\n{\n    CCLOG(\"NodeRGBA deprecated.\");\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCNode.h",
    "content": "/****************************************************************************\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2009      Valentin Milea\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __PLATFORM_CCNODE_H__\n#define __PLATFORM_CCNODE_H__\n\n#include \"ccMacros.h\"\n#include \"CCAffineTransform.h\"\n#include \"CCArray.h\"\n#include \"CCGL.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCGLProgram.h\"\n#include \"kazmath/kazmath.h\"\n#include \"CCScriptSupport.h\"\n#include \"CCProtocols.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCVector.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\nclass GridBase;\nclass Point;\nclass Touch;\nclass Action;\nclass LabelProtocol;\nclass Scheduler;\nclass ActionManager;\nclass Component;\nclass ComponentContainer;\nclass EventDispatcher;\nclass Scene;\n#if CC_USE_PHYSICS\nclass PhysicsBody;\n#endif\n\n/**\n * @addtogroup base_nodes\n * @{\n */\n\nenum {\n    kNodeOnEnter,\n    kNodeOnExit,\n    kNodeOnEnterTransitionDidFinish,\n    kNodeOnExitTransitionDidStart,\n    kNodeOnCleanup\n};\n\nbool nodeComparisonLess(Node* n1, Node* n2);\n\nclass EventListener;\n\n/** @brief Node is the base element of the Scene Graph. Element of the Scene Graph must be Node objects or subclasses of it.\n The most common Node objects are: Scene, Layer, Sprite, Menu.\n\n The main features of a Node are:\n - They can contain other Node objects (`addChild`, `getChildByTag`, `removeChild`, etc)\n - They can schedule periodic callback (`schedule`, `unschedule`, etc)\n - They can execute actions (`runAction`, `stopAction`, etc)\n\n Some Node objects provide extra functionality for them or their children.\n\n Subclassing a Node usually means (one/all) of:\n - overriding init to initialize resources and schedule callbacks\n - create callbacks to handle the advancement of time\n - overriding draw to render the node\n\n Properties of Node:\n - position\n - scale (x, y)\n - rotation (in degrees, clockwise)\n - GridBase (to do mesh transformations)\n - anchor point\n - size\n - visible\n - z-order\n - openGL z position\n\n Default values:\n - rotation: 0\n - position: (x=0,y=0)\n - scale: (x=1,y=1)\n - contentSize: (x=0,y=0)\n - anchorPoint: (x=0,y=0)\n\n Limitations:\n - A Node is a \"invisible\" object. If you want to draw something on the screen, you should use a Sprite instead. Or subclass Node and override `draw`.\n\n Order in transformations with grid disabled\n -# The node will be translated (position)\n -# The node will be rotated (rotation)\n -# The node will be scaled (scale)\n\n Order in transformations with grid enabled\n -# The node will be translated (position)\n -# The node will be rotated (rotation)\n -# The node will be scaled (scale)\n -# The grid will capture the screen\n -# The grid will render the captured screen\n\n */\n\nclass CC_DLL Node : public Object\n{\npublic:\n    /// Default tag used for all the nodes\n    static const int INVALID_TAG = -1;\n\n    /// @{\n    /// @name Constructor, Destructor and Initializers\n\n    /**\n     * Allocates and initializes a node.\n     * @return A initialized node which is marked as \"autorelease\".\n     */\n    static Node * create(void);\n\n    /**\n     * Gets the description string. It makes debugging easier.\n     * @return A string\n     * @js NA\n     * @lua NA\n     */\n    virtual std::string getDescription() const;\n\n    /// @} end of initializers\n\n\n\n    /// @{\n    /// @name Setters & Getters for Graphic Peroperties\n\n    /**\n     LocalZOrder is the 'key' used to sort the node relative to its siblings.\n\n     The Node's parent will sort all its children based ont the LocalZOrder value.\n     If two nodes have the same LocalZOrder, then the node that was added first to the children's array will be in front of the other node in the array.\n     \n     Also, the Scene Graph is traversed using the \"In-Order\" tree traversal algorithm ( http://en.wikipedia.org/wiki/Tree_traversal#In-order )\n     And Nodes that have LocalZOder values < 0 are the \"left\" subtree\n     While Nodes with LocalZOder >=0 are the \"right\" subtree.\n     \n     @see `setGlobalZOrder`\n     @see `setVertexZ`\n     */\n    virtual void setLocalZOrder(int localZOrder);\n\n    CC_DEPRECATED_ATTRIBUTE virtual void setZOrder(int localZOrder) { setLocalZOrder(localZOrder); }\n    /* Helper function used by `setLocalZOrder`. Don't use it unless you know what you are doing.\n     */\n    virtual void _setLocalZOrder(int z);\n    /**\n     * Gets the local Z order of this node.\n     *\n     * @see `setLocalZOrder(int)`\n     *\n     * @return The local (relative to its siblings) Z order.\n     */\n    virtual int getLocalZOrder() const { return _localZOrder; }\n    CC_DEPRECATED_ATTRIBUTE virtual int getZOrder() const { return getLocalZOrder(); }\n\n    /**\n     Defines the oder in which the nodes are renderer.\n     Nodes that have a Global Z Order lower, are renderer first.\n     \n     In case two or more nodes have the same Global Z Order, the oder is not guaranteed.\n     The only exception if the Nodes have a Global Z Order == 0. In that case, the Scene Graph order is used.\n     \n     By default, all nodes have a Global Z Order = 0. That means that by default, the Scene Graph order is used to render the nodes.\n     \n     Global Z Order is useful when you need to render nodes in an order different than the Scene Graph order.\n     \n     Limitations: Global Z Order can't be used used by Nodes that have SpriteBatchNode as one of their acenstors.\n     And if ClippingNode is one of the ancestors, then \"global Z order\" will be relative to the ClippingNode.\n\n     @see `setLocalZOrder()`\n     @see `setVertexZ()`\n\n     @since v3.0\n     */\n    virtual void setGlobalZOrder(float globalZOrder);\n    /**\n     * Returns the Node's Global Z Order.\n     *\n     * @see `setGlobalZOrder(int)`\n     *\n     * @return The node's global Z order\n     */\n    virtual float getGlobalZOrder() const { return _globalZOrder; }\n\n    /**\n     * Sets the 'z' value in the OpenGL Depth Buffer.\n     *\n     * The OpenGL depth buffer and depth testing are disabled by default. You need to turn them on \n     * in order to use this property correctly.\n     *\n     * `setVertexZ()` also sets the `setGlobalZValue()` with the vertexZ value.\n     *\n     * @see `setGlobalZValue()`\n     *\n     * @param vertexZ  OpenGL Z vertex of this node.\n     */\n    virtual void setVertexZ(float vertexZ);\n    /**\n     * Gets OpenGL Z vertex of this node.\n     *\n     * @see setVertexZ(float)\n     *\n     * @return OpenGL Z vertex of this node\n     */\n    virtual float getVertexZ() const;\n\n\n    /**\n     * Changes the scale factor on X axis of this node\n     *\n     * The deafult value is 1.0 if you haven't changed it before\n     *\n     * @param scaleX   The scale factor on X axis.\n     */\n    virtual void setScaleX(float scaleX);\n    /**\n     * Returns the scale factor on X axis of this node\n     *\n     * @see setScaleX(float)\n     *\n     * @return The scale factor on X axis.\n     */\n    virtual float getScaleX() const;\n\n\n    /**\n     * Changes the scale factor on Y axis of this node\n     *\n     * The Default value is 1.0 if you haven't changed it before.\n     *\n     * @param scaleY   The scale factor on Y axis.\n     */\n    virtual void setScaleY(float scaleY);\n    /**\n     * Returns the scale factor on Y axis of this node\n     *\n     * @see `setScaleY(float)`\n     *\n     * @return The scale factor on Y axis.\n     */\n    virtual float getScaleY() const;\n\n\n    /**\n     * Changes both X and Y scale factor of the node.\n     *\n     * 1.0 is the default scale factor. It modifies the X and Y scale at the same time.\n     *\n     * @param scale     The scale factor for both X and Y axis.\n     */\n    virtual void setScale(float scale);\n    /**\n     * Gets the scale factor of the node,  when X and Y have the same scale factor.\n     *\n     * @warning Assert when `_scaleX != _scaleY`\n     * @see setScale(float)\n     *\n     * @return The scale factor of the node.\n     */\n    virtual float getScale() const;\n\n     /**\n     * Changes both X and Y scale factor of the node.\n     *\n     * 1.0 is the default scale factor. It modifies the X and Y scale at the same time.\n     *\n     * @param scaleX     The scale factor on X axis.\n     * @param scaleY     The scale factor on Y axis.\n     */\n    virtual void setScale(float scaleX,float scaleY);\n\n    /**\n     * Changes the position (x,y) of the node in OpenGL coordinates\n     *\n     * Usually we use `Point(x,y)` to compose Point object.\n     * The original point (0,0) is at the left-bottom corner of screen.\n     * For example, this codesnip sets the node in the center of screen.\n     @code\n     Size size = Director::getInstance()->getWinSize();\n     node->setPosition( Point(size.width/2, size.height/2) )\n     @endcode\n     *\n     * @param position  The position (x,y) of the node in OpenGL coordinates\n     */\n    virtual void setPosition(const Point &position);\n    /**\n     * Gets the position (x,y) of the node in OpenGL coordinates\n     *\n     * @see setPosition(const Point&)\n     *\n     * @return The position (x,y) of the node in OpenGL coordinates\n     * @code\n     * In js and lua return value is table which contains x,y\n     * @endcode\n     */\n    virtual const Point& getPosition() const;\n    /**\n     * Sets position in a more efficient way.\n     *\n     * Passing two numbers (x,y) is much efficient than passing Point object.\n     * This method is binded to lua and javascript.\n     * Passing a number is 10 times faster than passing a object from lua to c++\n     *\n     @code\n     // sample code in lua\n     local pos  = node::getPosition()  -- returns Point object from C++\n     node:setPosition(x, y)            -- pass x, y coordinate to C++\n     @endcode\n     *\n     * @param x     X coordinate for position\n     * @param y     Y coordinate for position\n     */\n    virtual void setPosition(float x, float y);\n    /**\n     * Gets position in a more efficient way, returns two number instead of a Point object\n     *\n     * @see `setPosition(float, float)`\n     * In js,out value not return\n     */\n    virtual void getPosition(float* x, float* y) const;\n    /**\n     * Gets/Sets x or y coordinate individually for position.\n     * These methods are used in Lua and Javascript Bindings\n     */\n    virtual void  setPositionX(float x);\n    virtual float getPositionX(void) const;\n    virtual void  setPositionY(float y);\n    virtual float getPositionY(void) const;\n\n\n    /**\n     * Changes the X skew angle of the node in degrees.\n     *\n     * This angle describes the shear distortion in the X direction.\n     * Thus, it is the angle between the Y axis and the left edge of the shape\n     * The default skewX angle is 0. Positive values distort the node in a CW direction.\n     *\n     * @param fSkewX The X skew angle of the node in degrees.\n     */\n    virtual void setSkewX(float fSkewX);\n    /**\n     * Returns the X skew angle of the node in degrees.\n     *\n     * @see `setSkewX(float)`\n     *\n     * @return The X skew angle of the node in degrees.\n     */\n    virtual float getSkewX() const;\n\n\n    /**\n     * Changes the Y skew angle of the node in degrees.\n     *\n     * This angle describes the shear distortion in the Y direction.\n     * Thus, it is the angle between the X axis and the bottom edge of the shape\n     * The default skewY angle is 0. Positive values distort the node in a CCW direction.\n     *\n     * @param fSkewY    The Y skew angle of the node in degrees.\n     */\n    virtual void setSkewY(float fSkewY);\n    /**\n     * Returns the Y skew angle of the node in degrees.\n     *\n     * @see `setSkewY(float)`\n     *\n     * @return The Y skew angle of the node in degrees.\n     */\n    virtual float getSkewY() const;\n\n\n    /**\n     * Sets the anchor point in percent.\n     *\n     * anchorPoint is the point around which all transformations and positioning manipulations take place.\n     * It's like a pin in the node where it is \"attached\" to its parent.\n     * The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner.\n     * But you can use values higher than (1,1) and lower than (0,0) too.\n     * The default anchorPoint is (0.5,0.5), so it starts in the center of the node.\n     *\n     * @param anchorPoint   The anchor point of node.\n     */\n    virtual void setAnchorPoint(const Point& anchorPoint);\n    /**\n     * Returns the anchor point in percent.\n     *\n     * @see `setAnchorPoint(const Point&)`\n     *\n     * @return The anchor point of node.\n     */\n    virtual const Point& getAnchorPoint() const;\n    /**\n     * Returns the anchorPoint in absolute pixels.\n     *\n     * @warning You can only read it. If you wish to modify it, use anchorPoint instead.\n     * @see `getAnchorPoint()`\n     *\n     * @return The anchor point in absolute pixels.\n     */\n    virtual const Point& getAnchorPointInPoints() const;\n\n\n    /**\n     * Sets the untransformed size of the node.\n     *\n     * The contentSize remains the same no matter the node is scaled or rotated.\n     * All nodes has a size. Layer and Scene has the same size of the screen.\n     *\n     * @param contentSize   The untransformed size of the node.\n     */\n    virtual void setContentSize(const Size& contentSize);\n    /**\n     * Returns the untransformed size of the node.\n     *\n     * @see `setContentSize(const Size&)`\n     *\n     * @return The untransformed size of the node.\n     */\n    virtual const Size& getContentSize() const;\n\n\n    /**\n     * Sets whether the node is visible\n     *\n     * The default value is true, a node is default to visible\n     *\n     * @param visible   true if the node is visible, false if the node is hidden.\n     */\n    virtual void setVisible(bool visible);\n    /**\n     * Determines if the node is visible\n     *\n     * @see `setVisible(bool)`\n     *\n     * @return true if the node is visible, false if the node is hidden.\n     */\n    virtual bool isVisible() const;\n\n\n    /**\n     * Sets the rotation (angle) of the node in degrees.\n     *\n     * 0 is the default rotation angle.\n     * Positive values rotate node clockwise, and negative values for anti-clockwise.\n     *\n     * @param rotation     The rotation of the node in degrees.\n     */\n    virtual void setRotation(float rotation);\n    /**\n     * Returns the rotation of the node in degrees.\n     *\n     * @see `setRotation(float)`\n     *\n     * @return The rotation of the node in degrees.\n     */\n    virtual float getRotation() const;\n\n\n    /**\n     * Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew.\n     *\n     * 0 is the default rotation angle.\n     * Positive values rotate node clockwise, and negative values for anti-clockwise.\n     *\n     * @param rotationX    The X rotation in degrees which performs a horizontal rotational skew.\n     */\n    virtual void setRotationX(float rotationX);\n    /**\n     * Gets the X rotation (angle) of the node in degrees which performs a horizontal rotation skew.\n     *\n     * @see `setRotationX(float)`\n     *\n     * @return The X rotation in degrees.\n     */\n    virtual float getRotationX() const;\n\n\n    /**\n     * Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew.\n     *\n     * 0 is the default rotation angle.\n     * Positive values rotate node clockwise, and negative values for anti-clockwise.\n     *\n     * @param rotationY    The Y rotation in degrees.\n     */\n    virtual void setRotationY(float rotationY);\n    /**\n     * Gets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew.\n     *\n     * @see `setRotationY(float)`\n     *\n     * @return The Y rotation in degrees.\n     */\n    virtual float getRotationY() const;\n\n\n    /**\n     * Sets the arrival order when this node has a same ZOrder with other children.\n     *\n     * A node which called addChild subsequently will take a larger arrival order,\n     * If two children have the same Z order, the child with larger arrival order will be drawn later.\n     *\n     * @warning This method is used internally for localZOrder sorting, don't change this manually\n     *\n     * @param orderOfArrival   The arrival order.\n     */\n    void setOrderOfArrival(int orderOfArrival);\n    /**\n     * Returns the arrival order, indecates which children is added previously.\n     *\n     * @see `setOrderOfArrival(unsigned int)`\n     *\n     * @return The arrival order.\n     */\n    int getOrderOfArrival() const;\n\n\n    /** @deprecated No longer needed\n    * @js NA\n    * @lua NA\n    */\n    CC_DEPRECATED_ATTRIBUTE void setGLServerState(int serverState) { /* ignore */ };\n    /** @deprecated No longer needed\n    * @js NA\n    * @lua NA\n    */\n    CC_DEPRECATED_ATTRIBUTE int getGLServerState() const { return 0; }\n\n    /**\n     * Sets whether the anchor point will be (0,0) when you position this node.\n     *\n     * This is an internal method, only used by Layer and Scene. Don't call it outside framework.\n     * The default value is false, while in Layer and Scene are true\n     *\n     * @param ignore    true if anchor point will be (0,0) when you position this node\n     * @todo This method shoud be renamed as setIgnoreAnchorPointForPosition(bool) or something with \"set\"\n     */\n    virtual void ignoreAnchorPointForPosition(bool ignore);\n    /**\n     * Gets whether the anchor point will be (0,0) when you position this node.\n     *\n     * @see `ignoreAnchorPointForPosition(bool)`\n     *\n     * @return true if the anchor point will be (0,0) when you position this node.\n     */\n    virtual bool isIgnoreAnchorPointForPosition() const;\n\n    /// @}  end of Setters & Getters for Graphic Peroperties\n\n\n    /// @{\n    /// @name Children and Parent\n\n    /**\n     * Adds a child to the container with z-order as 0.\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child A child node\n     */\n    virtual void addChild(Node * child);\n    /**\n     * Adds a child to the container with a local z-order\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to `setLocalZOrder(int)`\n     */\n    virtual void addChild(Node * child, int localZOrder);\n    /**\n     * Adds a child to the container with z order and tag\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to setLocalZOrder(int)\n     * @param tag       A interger to identify the node easily. Please refer to setTag(int)\n     */\n    virtual void addChild(Node* child, int localZOrder, int tag);\n    /**\n     * Gets a child from the container with its tag\n     *\n     * @param tag   An identifier to find the child node.\n     *\n     * @return a Node object whose tag equals to the input parameter\n     */\n    virtual Node * getChildByTag(int tag);\n    /**\n     * Return an array of children\n     *\n     * Composing a \"tree\" structure is a very important feature of Node\n     * Here's a sample code of traversing children array:\n     @code\n     Node* node = nullptr;\n     CCARRAY_FOREACH(parent->getChildren(), node)\n     {\n        node->setPosition(0,0);\n     }\n     @endcode\n     * This sample code traverses all children nodes, and set their position to (0,0)\n     *\n     * @return An array of children\n     */\n    virtual Vector<Node*>& getChildren() { return _children; }\n    virtual const Vector<Node*>& getChildren() const { return _children; }\n    \n    /** \n     * Get the amount of children.\n     *\n     * @return The amount of children.\n     */\n    virtual ssize_t getChildrenCount() const;\n\n    /**\n     * Sets the parent node\n     *\n     * @param parent    A pointer to the parent node\n     */\n    virtual void setParent(Node* parent);\n    /**\n     * Returns a pointer to the parent node\n     *\n     * @see `setParent(Node*)`\n     *\n     * @returns A pointer to the parent node\n     */\n    virtual Node* getParent() { return _parent; }\n    virtual const Node* getParent() const { return _parent; }\n\n\n    ////// REMOVES //////\n\n    /**\n     * Removes this node itself from its parent node with a cleanup.\n     * If the node orphan, then nothing happens.\n     * @see `removeFromParentAndCleanup(bool)`\n     */\n    virtual void removeFromParent();\n    /**\n     * Removes this node itself from its parent node.\n     * If the node orphan, then nothing happens.\n     * @param cleanup   true if all actions and callbacks on this node should be removed, false otherwise.\n     * @js removeFromParent\n     * @lua removeFromParent\n     */\n    virtual void removeFromParentAndCleanup(bool cleanup);\n\n    /**\n     * Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.\n     *\n     * @param child     The child node which will be removed.\n     * @param cleanup   true if all running actions and callbacks on the child node will be cleanup, false otherwise.\n     */\n    virtual void removeChild(Node* child, bool cleanup = true);\n\n    /**\n     * Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter\n     *\n     * @param tag       An interger number that identifies a child node\n     * @param cleanup   true if all running actions and callbacks on the child node will be cleanup, false otherwise.\n     */\n    virtual void removeChildByTag(int tag, bool cleanup = true);\n    /**\n     * Removes all children from the container with a cleanup.\n     *\n     * @see `removeAllChildrenWithCleanup(bool)`\n     */\n    virtual void removeAllChildren();\n    /**\n     * Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.\n     *\n     * @param cleanup   true if all running actions on all children nodes should be cleanup, false oterwise.\n     * @js removeAllChildren\n     * @lua removeAllChildren\n     */\n    virtual void removeAllChildrenWithCleanup(bool cleanup);\n\n    /**\n     * Reorders a child according to a new z value.\n     *\n     * @param child     An already added child node. It MUST be already added.\n     * @param localZOrder Z order for drawing priority. Please refer to setLocalZOrder(int)\n     */\n    virtual void reorderChild(Node * child, int localZOrder);\n\n    /**\n     * Sorts the children array once before drawing, instead of every time when a child is added or reordered.\n     * This appraoch can improves the performance massively.\n     * @note Don't call this manually unless a child added needs to be removed in the same frame\n     */\n    virtual void sortAllChildren();\n\n    /// @} end of Children and Parent\n    \n    /// @{\n    /// @name Tag & User data\n\n    /**\n     * Returns a tag that is used to identify the node easily.\n     *\n     * You can set tags to node then identify them easily.\n     @code\n     #define TAG_PLAYER  1\n     #define TAG_MONSTER 2\n     #define TAG_BOSS    3\n     // set tags\n     node1->setTag(TAG_PLAYER);\n     node2->setTag(TAG_MONSTER);\n     node3->setTag(TAG_BOSS);\n     parent->addChild(node1);\n     parent->addChild(node2);\n     parent->addChild(node3);\n     // identify by tags\n     Node* node = nullptr;\n     CCARRAY_FOREACH(parent->getChildren(), node)\n     {\n         switch(node->getTag())\n         {\n             case TAG_PLAYER:\n                 break;\n             case TAG_MONSTER:\n                 break;\n             case TAG_BOSS:\n                 break;\n         }\n     }\n     @endcode\n     *\n     * @return A interger that identifies the node.\n     */\n    virtual int getTag() const;\n    /**\n     * Changes the tag that is used to identify the node easily.\n     *\n     * Please refer to getTag for the sample code.\n     *\n     * @param tag   A interger that indentifies the node.\n     */\n    virtual void setTag(int tag);\n\n    /**\n     * Returns a custom user data pointer\n     *\n     * You can set everything in UserData pointer, a data block, a structure or an object.\n     *\n     * @return A custom user data pointer\n     * @js NA\n     * @lua NA\n     */\n    virtual void* getUserData() { return _userData; }\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const void* getUserData() const { return _userData; }\n\n    /**\n     * Sets a custom user data pointer\n     *\n     * You can set everything in UserData pointer, a data block, a structure or an object, etc.\n     * @warning Don't forget to release the memory manually,\n     *          especially before you change this data pointer, and before this node is autoreleased.\n     *\n     * @param userData  A custom user data pointer\n     * @js NA\n     * @lua NA\n     */\n    virtual void setUserData(void *userData);\n\n    /**\n     * Returns a user assigned Object\n     *\n     * Similar to userData, but instead of holding a void* it holds an object\n     *\n     * @return A user assigned Object\n     * @js NA\n     * @lua NA\n     */\n    virtual Object* getUserObject() { return _userObject; }\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const Object* getUserObject() const { return _userObject; }\n\n    /**\n     * Returns a user assigned Object\n     *\n     * Similar to UserData, but instead of holding a void* it holds an object.\n     * The UserObject will be retained once in this method,\n     * and the previous UserObject (if existed) will be relese.\n     * The UserObject will be released in Node's destructure.\n     *\n     * @param userObject    A user assigned Object\n     */\n    virtual void setUserObject(Object *userObject);\n\n    /// @} end of Tag & User Data\n\n\n    /// @{\n    /// @name Shader Program\n    /**\n     * Return the shader program currently used for this node\n     *\n     * @return The shader program currelty used for this node\n     */\n    virtual GLProgram* getShaderProgram() { return _shaderProgram; }\n    virtual const GLProgram* getShaderProgram() const { return _shaderProgram; }\n\n    /**\n     * Sets the shader program for this node\n     *\n     * Since v2.0, each rendering node must set its shader program.\n     * It should be set in initialize phase.\n     @code\n     node->setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n     @endcode\n     *\n     * @param shaderProgram The shader program which fetchs from ShaderCache.\n     */\n    virtual void setShaderProgram(GLProgram *shaderProgram);\n    /// @} end of Shader Program\n\n\n    /**\n     * Returns whether or not the node accepts event callbacks.\n     *\n     * Running means the node accept event callbacks like onEnter(), onExit(), update()\n     *\n     * @return Whether or not the node is running.\n     */\n    virtual bool isRunning() const;\n\n    /**\n     * Schedules for lua script.\n     * @js NA\n     */\n    void scheduleUpdateWithPriorityLua(int handler, int priority);\n\n    /// @}  end Script Bindings\n\n\n    /// @{\n    /// @name Event Callbacks\n\n    /**\n     * Event callback that is invoked every time when Node enters the 'stage'.\n     * If the Node enters the 'stage' with a transition, this event is called when the transition starts.\n     * During onEnter you can't access a \"sister/brother\" node.\n     * If you override onEnter, you shall call its parent's one, e.g., Node::onEnter().\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter();\n\n    /** Event callback that is invoked when the Node enters in the 'stage'.\n     * If the Node enters the 'stage' with a transition, this event is called when the transition finishes.\n     * If you override onEnterTransitionDidFinish, you shall call its parent's one, e.g. Node::onEnterTransitionDidFinish()\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnterTransitionDidFinish();\n\n    /**\n     * Event callback that is invoked every time the Node leaves the 'stage'.\n     * If the Node leaves the 'stage' with a transition, this event is called when the transition finishes.\n     * During onExit you can't access a sibling node.\n     * If you override onExit, you shall call its parent's one, e.g., Node::onExit().\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit();\n\n    /**\n     * Event callback that is called every time the Node leaves the 'stage'.\n     * If the Node leaves the 'stage' with a transition, this callback is called when the transition starts.\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExitTransitionDidStart();\n\n    /// @} end of event callbacks.\n\n\n    /**\n     * Stops all running actions and schedulers\n     */\n    virtual void cleanup();\n\n    /**\n     * Override this method to draw your own node.\n     * The following GL states will be enabled by default:\n     * - `glEnableClientState(GL_VERTEX_ARRAY);`\n     * - `glEnableClientState(GL_COLOR_ARRAY);`\n     * - `glEnableClientState(GL_TEXTURE_COORD_ARRAY);`\n     * - `glEnable(GL_TEXTURE_2D);`\n     * AND YOU SHOULD NOT DISABLE THEM AFTER DRAWING YOUR NODE\n     * But if you enable any other GL state, you should disable it after drawing your node.\n     */\n    virtual void draw();\n\n    /**\n     * Visits this node's children and draw them recursively.\n     */\n    virtual void visit();\n\n    /** Returns the Scene that contains the Node.\n     It returns `nullptr` if the node doesn't belong to any Scene.\n     This function recursively calls parent->getScene() until parent is a Scene object. The results are not cached. It is that the user caches the results in case this functions is being used inside a loop.\n     */\n    virtual Scene* getScene();\n\n    /**\n     * Returns a \"local\" axis aligned bounding box of the node.\n     * The returned box is relative only to its parent.\n     *\n     * @note This method returns a temporaty variable, so it can't returns const Rect&\n     * @todo Rename to `getBoundingBox()` in the future versions.\n     *\n     * @return A \"local\" axis aligned boudning box of the node.\n     */\n    virtual Rect getBoundingBox() const;\n\n    /** @deprecated Use getBoundingBox instead */\n    CC_DEPRECATED_ATTRIBUTE inline virtual Rect boundingBox() const { return getBoundingBox(); }\n\n    virtual void setEventDispatcher(EventDispatcher* dispatcher);\n    virtual EventDispatcher* getEventDispatcher() const { return _eventDispatcher; };\n\n    /// @{\n    /// @name Actions\n\n    /**\n     * Sets the ActionManager object that is used by all actions.\n     *\n     * @warning If you set a new ActionManager, then previously created actions will be removed.\n     *\n     * @param actionManager     A ActionManager object that is used by all actions.\n     */\n    virtual void setActionManager(ActionManager* actionManager);\n    /**\n     * Gets the ActionManager object that is used by all actions.\n     * @see setActionManager(ActionManager*)\n     * @return A ActionManager object.\n     */\n    virtual ActionManager* getActionManager() { return _actionManager; }\n    virtual const ActionManager* getActionManager() const { return _actionManager; }\n\n    /**\n     * Executes an action, and returns the action that is executed.\n     *\n     * This node becomes the action's target. Refer to Action::getTarget()\n     * @warning Actions don't retain their target.\n     *\n     * @return An Action pointer\n     */\n    Action* runAction(Action* action);\n\n    /**\n     * Stops and removes all actions from the running action list .\n     */\n    void stopAllActions();\n\n    /**\n     * Stops and removes an action from the running action list.\n     *\n     * @param action    The action object to be removed.\n     */\n    void stopAction(Action* action);\n\n    /**\n     * Removes an action from the running action list by its tag.\n     *\n     * @param tag   A tag that indicates the action to be removed.\n     */\n    void stopActionByTag(int tag);\n\n    /**\n     * Gets an action from the running action list by its tag.\n     *\n     * @see `setTag(int)`, `getTag()`.\n     *\n     * @return The action object with the given tag.\n     */\n    Action* getActionByTag(int tag);\n\n    /**\n     * Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).\n     *\n     * Composable actions are counted as 1 action. Example:\n     *    If you are running 1 Sequence of 7 actions, it will return 1.\n     *    If you are running 7 Sequences of 2 actions, it will return 7.\n     * @todo Rename to getNumberOfRunningActions()\n     *\n     * @return The number of actions that are running plus the ones that are schedule to run\n     */\n    ssize_t getNumberOfRunningActions() const;\n\n    /** @deprecated Use getNumberOfRunningActions() instead */\n    CC_DEPRECATED_ATTRIBUTE ssize_t numberOfRunningActions() const { return getNumberOfRunningActions(); };\n\n    /// @} end of Actions\n\n\n    /// @{\n    /// @name Scheduler and Timer\n\n    /**\n     * Sets a Scheduler object that is used to schedule all \"updates\" and timers.\n     *\n     * @warning If you set a new Scheduler, then previously created timers/update are going to be removed.\n     * @param scheduler     A Shdeduler object that is used to schedule all \"update\" and timers.\n     */\n    virtual void setScheduler(Scheduler* scheduler);\n    /**\n     * Gets a Sheduler object.\n     *\n     * @see setScheduler(Scheduler*)\n     * @return A Scheduler object.\n     */\n    virtual Scheduler* getScheduler() { return _scheduler; }\n    virtual const Scheduler* getScheduler() const { return _scheduler; }\n\n\n    /**\n     * Checks whether a selector is scheduled.\n     *\n     * @param selector      A function selector\n     * @return Whether the funcion selector is scheduled.\n     * @js NA\n     * @lua NA\n     */\n    bool isScheduled(SEL_SCHEDULE selector);\n\n    /**\n     * Schedules the \"update\" method.\n     *\n     * It will use the order number 0. This method will be called every frame.\n     * Scheduled methods with a lower order value will be called before the ones that have a higher order value.\n     * Only one \"update\" method could be scheduled per node.\n     * @js NA\n     * @lua NA\n     */\n    void scheduleUpdate(void);\n\n    /**\n     * Schedules the \"update\" method with a custom priority.\n     *\n     * This selector will be called every frame.\n     * Scheduled methods with a lower priority will be called before the ones that have a higher value.\n     * Only one \"update\" selector could be scheduled per node (You can't have 2 'update' selectors).\n     * @js NA\n     * @lua NA\n     */\n    void scheduleUpdateWithPriority(int priority);\n\n    /*\n     * Unschedules the \"update\" method.\n     * @see scheduleUpdate();\n     */\n    void unscheduleUpdate(void);\n\n    /**\n     * Schedules a custom selector.\n     *\n     * If the selector is already scheduled, then the interval parameter will be updated without scheduling it again.\n     @code\n     // firstly, implement a schedule function\n     void MyNode::TickMe(float dt);\n     // wrap this function into a selector via schedule_selector marco.\n     this->schedule(schedule_selector(MyNode::TickMe), 0, 0, 0);\n     @endcode\n     *\n     * @param selector  The SEL_SCHEDULE selector to be scheduled.\n     * @param interval  Tick interval in seconds. 0 means tick every frame. If interval = 0, it's recommended to use scheduleUpdate() instead.\n     * @param repeat    The selector will be excuted (repeat + 1) times, you can use kRepeatForever for tick infinitely.\n     * @param delay     The amount of time that the first tick will wait before execution.\n     * @lua NA\n     */\n    void schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay);\n\n    /**\n     * Schedules a custom selector with an interval time in seconds.\n     * @see `schedule(SEL_SCHEDULE, float, unsigned int, float)`\n     *\n     * @param selector      The SEL_SCHEDULE selector to be scheduled.\n     * @param interval      Callback interval time in seconds. 0 means tick every frame,\n     * @lua NA\n     */\n    void schedule(SEL_SCHEDULE selector, float interval);\n\n    /**\n     * Schedules a selector that runs only once, with a delay of 0 or larger\n     * @see `schedule(SEL_SCHEDULE, float, unsigned int, float)`\n     *\n     * @param selector      The SEL_SCHEDULE selector to be scheduled.\n     * @param delay         The amount of time that the first tick will wait before execution.\n     * @lua NA\n     */\n    void scheduleOnce(SEL_SCHEDULE selector, float delay);\n\n    /**\n     * Schedules a custom selector, the scheduled selector will be ticked every frame\n     * @see schedule(SEL_SCHEDULE, float, unsigned int, float)\n     *\n     * @param selector      A function wrapped as a selector\n     * @lua NA\n     */\n    void schedule(SEL_SCHEDULE selector);\n\n    /**\n     * Unschedules a custom selector.\n     * @see `schedule(SEL_SCHEDULE, float, unsigned int, float)`\n     *\n     * @param selector      A function wrapped as a selector\n     * @lua NA\n     */\n    void unschedule(SEL_SCHEDULE selector);\n\n    /**\n     * Unschedule all scheduled selectors: custom selectors, and the 'update' selector.\n     * Actions are not affected by this method.\n     * @lua NA\n     */\n    void unscheduleAllSelectors(void);\n\n    /**\n     * Resumes all scheduled selectors, actions and event listeners.\n     * This method is called internally by onEnter\n     */\n    void resume(void);\n    /**\n     * Pauses all scheduled selectors, actions and event listeners..\n     * This method is called internally by onExit\n     */\n    void pause(void);\n\n    /**\n     * Resumes all scheduled selectors, actions and event listeners.\n     * This method is called internally by onEnter\n     */\n    CC_DEPRECATED_ATTRIBUTE void resumeSchedulerAndActions(void);\n    /**\n     * Pauses all scheduled selectors, actions and event listeners..\n     * This method is called internally by onExit\n     */\n    CC_DEPRECATED_ATTRIBUTE void pauseSchedulerAndActions(void);\n\n    /*\n     * Update method will be called automatically every frame if \"scheduleUpdate\" is called, and the node is \"live\"\n     */\n    virtual void update(float delta);\n\n    /// @} end of Scheduler and Timer\n\n    /// @{\n    /// @name Transformations\n\n    /**\n     * Performs OpenGL view-matrix transformation based on position, scale, rotation and other attributes.\n     */\n    void transform();\n    /**\n     * Performs OpenGL view-matrix transformation of it's ancestors.\n     * Generally the ancestors are already transformed, but in certain cases (eg: attaching a FBO)\n     * It's necessary to transform the ancestors again.\n     */\n    void transformAncestors();\n    /**\n     * Calls children's updateTransform() method recursively.\n     *\n     * This method is moved from Sprite, so it's no longer specific to Sprite.\n     * As the result, you apply SpriteBatchNode's optimization on your customed Node.\n     * e.g., `batchNode->addChild(myCustomNode)`, while you can only addChild(sprite) before.\n     */\n    virtual void updateTransform();\n\n    /**\n     * Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.\n     * The matrix is in Pixels.\n     */\n    virtual const kmMat4& getNodeToParentTransform() const;\n    virtual AffineTransform getNodeToParentAffineTransform() const;\n\n    /** \n     * Sets the Transformation matrix manually.\n     */\n    virtual void setNodeToParentTransform(const kmMat4& transform);\n\n    /** @deprecated use getNodeToParentTransform() instead */\n    CC_DEPRECATED_ATTRIBUTE inline virtual AffineTransform nodeToParentTransform() const { return getNodeToParentAffineTransform(); }\n\n    /**\n     * Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates.\n     * The matrix is in Pixels.\n     */\n    virtual const kmMat4& getParentToNodeTransform() const;\n    virtual AffineTransform getParentToNodeAffineTransform() const;\n\n    /** @deprecated Use getParentToNodeTransform() instead */\n    CC_DEPRECATED_ATTRIBUTE inline virtual AffineTransform parentToNodeTransform() const { return getParentToNodeAffineTransform(); }\n\n    /**\n     * Returns the world affine transform matrix. The matrix is in Pixels.\n     */\n    virtual kmMat4 getNodeToWorldTransform() const;\n    virtual AffineTransform getNodeToWorldAffineTransform() const;\n\n    /** @deprecated Use getNodeToWorldTransform() instead */\n    CC_DEPRECATED_ATTRIBUTE inline virtual AffineTransform nodeToWorldTransform() const { return getNodeToWorldAffineTransform(); }\n\n    /**\n     * Returns the inverse world affine transform matrix. The matrix is in Pixels.\n     */\n    virtual kmMat4 getWorldToNodeTransform() const;\n    virtual AffineTransform getWorldToNodeAffineTransform() const;\n\n\n    /** @deprecated Use worldToNodeTransform() instead */\n    CC_DEPRECATED_ATTRIBUTE inline virtual AffineTransform worldToNodeTransform() const { return getWorldToNodeAffineTransform(); }\n\n    /// @} end of Transformations\n\n\n    /// @{\n    /// @name Coordinate Converters\n\n    /**\n     * Converts a Point to node (local) space coordinates. The result is in Points.\n     */\n    Point convertToNodeSpace(const Point& worldPoint) const;\n\n    /**\n     * Converts a Point to world space coordinates. The result is in Points.\n     */\n    Point convertToWorldSpace(const Point& nodePoint) const;\n\n    /**\n     * Converts a Point to node (local) space coordinates. The result is in Points.\n     * treating the returned/received node point as anchor relative.\n     */\n    Point convertToNodeSpaceAR(const Point& worldPoint) const;\n\n    /**\n     * Converts a local Point to world space coordinates.The result is in Points.\n     * treating the returned/received node point as anchor relative.\n     */\n    Point convertToWorldSpaceAR(const Point& nodePoint) const;\n\n    /**\n     * convenience methods which take a Touch instead of Point\n     */\n    Point convertTouchToNodeSpace(Touch * touch) const;\n\n    /**\n     * converts a Touch (world coordinates) into a local coordinate. This method is AR (Anchor Relative).\n     */\n    Point convertTouchToNodeSpaceAR(Touch * touch) const;\n\n\t/**\n     *  Sets an additional transform matrix to the node.\n     *\n     *  In order to remove it, set the Identity Matrix to the additional transform.\n     *\n     *  @note The additional transform will be concatenated at the end of getNodeToParentTransform.\n     *        It could be used to simulate `parent-child` relationship between two nodes (e.g. one is in BatchNode, another isn't).\n     @code\n     // create a batchNode\n     SpriteBatchNode* batch= SpriteBatchNode::create(\"Icon-114.png\");\n     this->addChild(batch);\n\n     // create two sprites, spriteA will be added to batchNode, they are using different textures.\n     Sprite* spriteA = Sprite::createWithTexture(batch->getTexture());\n     Sprite* spriteB = Sprite::create(\"Icon-72.png\");\n\n     batch->addChild(spriteA);\n\n     // We can't make spriteB as spriteA's child since they use different textures. So just add it to layer.\n     // But we want to simulate `parent-child` relationship for these two node.\n     this->addChild(spriteB);\n\n     //position\n     spriteA->setPosition(Point(200, 200));\n\n     // Gets the spriteA's transform.\n     auto t = spriteA->getNodeToParentTransform();\n\n     // Sets the additional transform to spriteB, spriteB's postion will based on its pseudo parent i.e. spriteA.\n     spriteB->setAdditionalTransform(t);\n\n     //scale\n     spriteA->setScale(2);\n\n     // Gets the spriteA's transform.\n     t = spriteA->getNodeToParentTransform();\n\n     // Sets the additional transform to spriteB, spriteB's scale will based on its pseudo parent i.e. spriteA.\n     spriteB->setAdditionalTransform(t);\n\n     //rotation\n     spriteA->setRotation(20);\n\n     // Gets the spriteA's transform.\n     t = spriteA->getNodeToParentTransform();\n\n     // Sets the additional transform to spriteB, spriteB's rotation will based on its pseudo parent i.e. spriteA.\n     spriteB->setAdditionalTransform(t);\n     @endcode\n     */\n    void setAdditionalTransform(const AffineTransform& additionalTransform);\n    void setAdditionalTransform(const kmMat4& additionalTransform);\n\n    /// @} end of Coordinate Converters\n\n      /// @{\n    /// @name component functions\n    /**\n     *   gets a component by its name\n     */\n    Component* getComponent(const std::string& pName);\n\n    /**\n     *   adds a component\n     */\n    virtual bool addComponent(Component *pComponent);\n\n    /**\n     *   removes a component by its name\n     */\n    virtual bool removeComponent(const std::string& pName);\n\n    /**\n     *   removes all components\n     */\n    virtual void removeAllComponents();\n    /// @} end of component functions\n\n\n#if CC_USE_PHYSICS\n    /**\n     *   set the PhysicsBody that let the sprite effect with physics\n     */\n    void setPhysicsBody(PhysicsBody* body);\n\n    /**\n     *   get the PhysicsBody the sprite have\n     */\n    PhysicsBody* getPhysicsBody() const;\n\n    /**\n     *   update rotation and position from physics body\n     */\n    virtual bool updatePhysicsTransform();\n\n#endif\n    \n    // overrides\n    virtual GLubyte getOpacity() const;\n    virtual GLubyte getDisplayedOpacity() const;\n    virtual void setOpacity(GLubyte opacity);\n    virtual void updateDisplayedOpacity(GLubyte parentOpacity);\n    virtual bool isCascadeOpacityEnabled() const;\n    virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled);\n    \n    virtual const Color3B& getColor(void) const;\n    virtual const Color3B& getDisplayedColor() const;\n    virtual void setColor(const Color3B& color);\n    virtual void updateDisplayedColor(const Color3B& parentColor);\n    virtual bool isCascadeColorEnabled() const;\n    virtual void setCascadeColorEnabled(bool cascadeColorEnabled);\n    \n    virtual void setOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}\n    virtual bool isOpacityModifyRGB() const { return false; };\n\nprotected:\n    // Nodes should be created using create();\n    Node();\n    virtual ~Node();\n    virtual bool init();\n\n    /// lazy allocs\n    void childrenAlloc(void);\n    \n    /// helper that reorder a child\n    void insertChild(Node* child, int z);\n\n    /// Removes a child, call child->onExit(), do cleanup, remove it from children array.\n    void detachChild(Node *child, ssize_t index, bool doCleanup);\n\n    /// Convert cocos2d coordinates to UI windows coordinate.\n    Point convertToWindowSpace(const Point& nodePoint) const;\n    \n    virtual void updateCascadeOpacity();\n    virtual void disableCascadeOpacity();\n    virtual void updateCascadeColor();\n    virtual void disableCascadeColor();\n    virtual void updateColor() {}\n\n\n    float _rotationX;                 ///< rotation angle on x-axis\n    float _rotationY;                 ///< rotation angle on y-axis\n\n    float _scaleX;                    ///< scaling factor on x-axis\n    float _scaleY;                    ///< scaling factor on y-axis\n\n\n    Point _position;               ///< position of the node\n\n    float _skewX;                     ///< skew angle on x-axis\n    float _skewY;                     ///< skew angle on y-axis\n\n    Point _anchorPointInPoints;    ///< anchor point in points\n    Point _anchorPoint;            ///< anchor point normalized (NOT in points)\n\n    Size _contentSize;             ///< untransformed size of the node\n\n    kmMat4  _modelViewTransform;    ///< ModelView transform of the Node.\n\n    // \"cache\" variables are allowed to be mutable\n    mutable kmMat4 _additionalTransform; ///< transform\n    mutable kmMat4 _transform;     ///< transform\n    mutable kmMat4 _inverse;       ///< inverse transform\n    bool _useAdditionalTransform;   ///< The flag to check whether the additional transform is dirty\n    mutable bool _transformDirty;             ///< transform dirty flag\n    mutable bool _inverseDirty;               ///< inverse transform dirty flag\n\n\n    int _localZOrder;                   ///< Local order (relative to its siblings) used to sort the node\n    float _globalZOrder;                ///< Global order used to sort the node\n    float _vertexZ;                     ///< OpenGL real Z vertex\n\n\n    Vector<Node*> _children;               ///< array of children nodes\n    Node *_parent;                  ///< weak reference to parent node\n\n    int _tag;                         ///< a tag. Can be any number you assigned just to identify this node\n\n    void *_userData;                  ///< A user assingned void pointer, Can be point to any cpp object\n    Object *_userObject;            ///< A user assigned Object\n\n    GLProgram *_shaderProgram;      ///< OpenGL shader\n\n    int _orderOfArrival;            ///< used to preserve sequence while sorting children with the same localZOrder\n\n    Scheduler *_scheduler;          ///< scheduler used to schedule timers and updates\n\n    ActionManager *_actionManager;  ///< a pointer to ActionManager singleton, which is used to handle all the actions\n\n    EventDispatcher* _eventDispatcher;  ///< event dispatcher used to dispatch all kinds of events\n\n    bool _running;                    ///< is running\n\n    bool _visible;                    ///< is this node visible\n\n    bool _ignoreAnchorPointForPosition; ///< true if the Anchor Point will be (0,0) when you position the Node, false otherwise.\n                                          ///< Used by Layer and Scene.\n\n    bool _reorderChildDirty;          ///< children order dirty flag\n    bool _isTransitionFinished;       ///< flag to indicate whether the transition was finished\n\n    int _scriptHandler;               ///< script handler for onEnter() & onExit(), used in Javascript binding and Lua binding.\n    int _updateScriptHandler;         ///< script handler for update() callback per frame, which is invoked from lua & javascript.\n    ccScriptType _scriptType;         ///< type of script binding, lua or javascript\n\n    ComponentContainer *_componentContainer;        ///< Dictionary of components\n\n#if CC_USE_PHYSICS\n    PhysicsBody* _physicsBody;        ///< the physicsBody the node have\n#endif\n    \n    // opacity controls\n    GLubyte\t\t_displayedOpacity;\n    GLubyte     _realOpacity;\n    Color3B\t    _displayedColor;\n    Color3B     _realColor;\n    bool\t\t_cascadeColorEnabled;\n    bool        _cascadeOpacityEnabled;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Node);\n};\n\n//#pragma mark - NodeRGBA\n\n/** NodeRGBA is a subclass of Node that implements the RGBAProtocol protocol.\n \n All features from Node are valid, plus the following new features:\n - opacity\n - RGB colors\n \n Opacity/Color propagates into children that conform to the RGBAProtocol if cascadeOpacity/cascadeColor is enabled.\n @since v2.1\n */\nclass CC_DLL __NodeRGBA : public Node, public __RGBAProtocol\n{\npublic:\n    // overrides\n    virtual GLubyte getOpacity() const override { return Node::getOpacity(); }\n    virtual GLubyte getDisplayedOpacity() const  override { return Node::getDisplayedOpacity(); }\n    virtual void setOpacity(GLubyte opacity) override { return Node::setOpacity(opacity); }\n    virtual void updateDisplayedOpacity(GLubyte parentOpacity) override { return Node::updateDisplayedOpacity(parentOpacity); }\n    virtual bool isCascadeOpacityEnabled() const  override { return Node::isCascadeOpacityEnabled(); }\n    virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled) override { return Node::setCascadeOpacityEnabled(cascadeOpacityEnabled); }\n\n    virtual const Color3B& getColor(void) const override { return Node::getColor(); }\n    virtual const Color3B& getDisplayedColor() const override { return Node::getDisplayedColor(); }\n    virtual void setColor(const Color3B& color) override { return Node::setColor(color); }\n    virtual void updateDisplayedColor(const Color3B& parentColor) override { return Node::updateDisplayedColor(parentColor); }\n    virtual bool isCascadeColorEnabled() const override { return Node::isCascadeColorEnabled(); }\n    virtual void setCascadeColorEnabled(bool cascadeColorEnabled) override { return Node::setCascadeColorEnabled(cascadeColorEnabled); }\n\n    virtual void setOpacityModifyRGB(bool bValue) override { return Node::setOpacityModifyRGB(bValue); }\n    virtual bool isOpacityModifyRGB() const override { return Node::isOpacityModifyRGB(); }\n\nprotected:\n    __NodeRGBA();\n    virtual ~__NodeRGBA() {}\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(__NodeRGBA);\n};\n\n// end of base_node group\n/// @}\n\nNS_CC_END\n\n#endif // __PLATFORM_CCNODE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCNodeGrid.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCNodeGrid.h\"\n#include \"CCGrid.h\"\n\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCCustomCommand.h\"\n\n\nNS_CC_BEGIN\n\nNodeGrid* NodeGrid::create()\n{\n    NodeGrid * ret = new NodeGrid();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nNodeGrid::NodeGrid()\n: _gridTarget(nullptr)\n, _nodeGrid(nullptr)\n{\n\n}\n\nvoid NodeGrid::setTarget(Node* target)\n{\n    CC_SAFE_RELEASE(_gridTarget);\n    CC_SAFE_RETAIN(target);\n    _gridTarget = target;\n}\n\nNodeGrid::~NodeGrid()\n{\n    CC_SAFE_RELEASE(_nodeGrid);\n    CC_SAFE_RELEASE(_gridTarget);\n}\n\nvoid NodeGrid::onGridBeginDraw()\n{\n    if (_nodeGrid && _nodeGrid->isActive())\n    {\n        _nodeGrid->beforeDraw();\n    }\n}\n\nvoid NodeGrid::onGridEndDraw()\n{\n    if(_nodeGrid && _nodeGrid->isActive())\n    {\n        _nodeGrid->afterDraw(this);\n    }\n}\n\nvoid NodeGrid::visit()\n{\n    // quick return if not visible. children won't be drawn.\n    if (!_visible)\n    {\n        return;\n    }\n    \n    Renderer* renderer = Director::getInstance()->getRenderer();\n\n    _groupCommand.init(_globalZOrder);\n    renderer->addCommand(&_groupCommand);\n    renderer->pushGroup(_groupCommand.getRenderQueueID());\n\n    kmGLPushMatrix();\n    Director::Projection beforeProjectionType;\n    if(_nodeGrid && _nodeGrid->isActive())\n    {\n        beforeProjectionType = Director::getInstance()->getProjection();\n        _nodeGrid->set2DProjection();\n    }\n\n    _gridBeginCommand.init(_globalZOrder);\n    _gridBeginCommand.func = CC_CALLBACK_0(NodeGrid::onGridBeginDraw, this);\n    renderer->addCommand(&_gridBeginCommand);\n\n    this->transform();\n    \n    if(_gridTarget)\n    {\n        _gridTarget->visit();\n    }\n    \n    int i = 0;\n\n    if(!_children.empty())\n    {\n        sortAllChildren();\n        // draw children zOrder < 0\n        for( ; i < _children.size(); i++ )\n        {\n            auto node = _children.at(i);\n\n            if ( node && node->getLocalZOrder() < 0 )\n                node->visit();\n            else\n                break;\n        }\n        // self draw,currently we have nothing to draw on NodeGrid, so there is no need to add render command\n        this->draw();\n\n        for(auto it=_children.cbegin()+i; it != _children.cend(); ++it) {\n            (*it)->visit();\n        }\n    }\n    else\n    {\n        this->draw();\n    }\n    \n    // reset for next frame\n    _orderOfArrival = 0;\n    \n    if(_nodeGrid && _nodeGrid->isActive())\n    {\n        // restore projection\n        Director *director = Director::getInstance();\n        director->setProjection(beforeProjectionType);\n    }\n\n    _gridEndCommand.init(_globalZOrder);\n    _gridEndCommand.func = CC_CALLBACK_0(NodeGrid::onGridEndDraw, this);\n    renderer->addCommand(&_gridEndCommand);\n\n    renderer->popGroup();\n \n    kmGLPopMatrix();\n}\n\nvoid NodeGrid::setGrid(GridBase *grid)\n{\n    CC_SAFE_RELEASE(_nodeGrid);\n    CC_SAFE_RETAIN(grid);\n    _nodeGrid = grid;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCNodeGrid.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __MISCNODE_CCGRID_NODE_H__\n#define __MISCNODE_CCGRID_NODE_H__\n\n#include \"CCNode.h\"\n#include \"kazmath/GL/matrix.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\nclass GridBase;\n\nclass NodeGrid : public Node\n{\npublic:\n    static NodeGrid* create();\n\n    GridBase* getGrid() { return _nodeGrid; }\n    /**\n    * @js NA\n    */\n    const GridBase* getGrid() const { return _nodeGrid; }\n\n    /**\n     * Changes a grid object that is used when applying effects\n     *\n     * @param grid  A Grid object that is used when applying effects\n     */\n    void setGrid(GridBase *grid);\n\n    void setTarget(Node *target);\n\n    // overrides\n    virtual void visit() override;\n\nprotected:\n    NodeGrid();\n    virtual ~NodeGrid();\n\n    void onGridBeginDraw();\n    void onGridEndDraw();\n\n    Node* _gridTarget;\n    GridBase* _nodeGrid;\n    GroupCommand _groupCommand;\n    CustomCommand _gridBeginCommand;\n    CustomCommand _gridEndCommand;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(NodeGrid);\n};\nNS_CC_END\n\n#endif"
  },
  {
    "path": "cocos2d/cocos/2d/CCNotificationCenter.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Erawppa\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCNotificationCenter.h\"\n#include \"CCArray.h\"\n#include \"CCScriptSupport.h\"\n#include <string>\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nstatic __NotificationCenter *s_sharedNotifCenter = nullptr;\n\n__NotificationCenter::__NotificationCenter()\n: _scriptHandler(0)\n{\n    _observers = __Array::createWithCapacity(3);\n    _observers->retain();\n}\n\n__NotificationCenter::~__NotificationCenter()\n{\n    _observers->release();\n}\n\n__NotificationCenter *__NotificationCenter::getInstance()\n{\n    if (!s_sharedNotifCenter)\n    {\n        s_sharedNotifCenter = new __NotificationCenter;\n    }\n    return s_sharedNotifCenter;\n}\n\nvoid __NotificationCenter::destroyInstance()\n{\n    CC_SAFE_RELEASE_NULL(s_sharedNotifCenter);\n}\n\n// XXX: deprecated\n__NotificationCenter *__NotificationCenter::sharedNotificationCenter(void)\n{\n    return __NotificationCenter::getInstance();\n}\n\n// XXX: deprecated\nvoid __NotificationCenter::purgeNotificationCenter(void)\n{\n    __NotificationCenter::destroyInstance();\n}\n\n//\n// internal functions\n//\nbool __NotificationCenter::observerExisted(Object *target, const std::string& name, Object *sender)\n{\n    Object* obj = nullptr;\n    CCARRAY_FOREACH(_observers, obj)\n    {\n        NotificationObserver* observer = (NotificationObserver*) obj;\n        if (!observer)\n            continue;\n        \n        if (observer->getName() == name && observer->getTarget() == target && observer->getSender() == sender)\n            return true;\n    }\n    return false;\n}\n\n//\n// observer functions\n//\nvoid __NotificationCenter::addObserver(Object *target, \n                                       SEL_CallFuncO selector,\n                                       const std::string& name,\n                                       Object *sender)\n{\n    if (this->observerExisted(target, name, sender))\n        return;\n    \n    NotificationObserver *observer = new NotificationObserver(target, selector, name, sender);\n    if (!observer)\n        return;\n    \n    observer->autorelease();\n    _observers->addObject(observer);\n}\n\nvoid __NotificationCenter::removeObserver(Object *target, const std::string& name)\n{\n    Object* obj = nullptr;\n    CCARRAY_FOREACH(_observers, obj)\n    {\n        NotificationObserver* observer = static_cast<NotificationObserver*>(obj);\n        if (!observer)\n            continue;\n        \n        if (observer->getName() == name && observer->getTarget() == target)\n        {\n            _observers->removeObject(observer);\n            return;\n        }\n    }\n}\n\nint __NotificationCenter::removeAllObservers(Object *target)\n{\n    Object *obj = nullptr;\n    __Array *toRemove = __Array::create();\n\n    CCARRAY_FOREACH(_observers, obj)\n    {\n        NotificationObserver *observer = static_cast<NotificationObserver *>(obj);\n        if (!observer)\n            continue;\n\n        if (observer->getTarget() == target)\n        {\n            toRemove->addObject(observer);\n        }\n    }\n\n    _observers->removeObjectsInArray(toRemove);\n    return static_cast<int>(toRemove->count());\n}\n\nvoid __NotificationCenter::registerScriptObserver( Object *target, int handler,const std::string& name)\n{\n    \n    if (this->observerExisted(target, name, nullptr))\n        return;\n    \n    NotificationObserver *observer = new NotificationObserver(target, nullptr, name, nullptr);\n    if (!observer)\n        return;\n    \n    observer->setHandler(handler);\n    observer->autorelease();\n    _observers->addObject(observer);\n}\n\nvoid __NotificationCenter::unregisterScriptObserver(Object *target,const std::string& name)\n{        \n    Object* obj = nullptr;\n    CCARRAY_FOREACH(_observers, obj)\n    {\n        NotificationObserver* observer = static_cast<NotificationObserver*>(obj);\n        if (!observer)\n            continue;\n            \n        if ( observer->getName() == name && observer->getTarget() == target)\n        {\n            _observers->removeObject(observer);\n        }\n    }\n}\n\nvoid __NotificationCenter::postNotification(const std::string& name, Object *sender)\n{\n    __Array* ObserversCopy = __Array::createWithCapacity(_observers->count());\n    ObserversCopy->addObjectsFromArray(_observers);\n    Object* obj = nullptr;\n    CCARRAY_FOREACH(ObserversCopy, obj)\n    {\n        NotificationObserver* observer = static_cast<NotificationObserver*>(obj);\n        if (!observer)\n            continue;\n        \n        if (observer->getName() == name && (observer->getSender() == sender || observer->getSender() == nullptr || sender == nullptr))\n        {\n            if (0 == observer->getHandler())\n            {\n                observer->performSelector(sender);\n            }\n        }\n    }\n}\n\nvoid __NotificationCenter::postNotification(const std::string& name)\n{\n    this->postNotification(name,nullptr);\n}\n\nint __NotificationCenter::getObserverHandlerByName(const std::string& name)\n{\n    if (name.empty())\n    {\n        return 0;\n    }\n    \n    Object* obj = nullptr;\n    CCARRAY_FOREACH(_observers, obj)\n    {\n        NotificationObserver* observer = static_cast<NotificationObserver*>(obj);\n        if (nullptr == observer)\n            continue;\n        \n        if ( observer->getName() == name )\n        {\n            return observer->getHandler();\n            break;\n        }\n    }\n    \n    return 0;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n///\n/// NotificationObserver\n///\n////////////////////////////////////////////////////////////////////////////////\nNotificationObserver::NotificationObserver(Object *target, \n                                               SEL_CallFuncO selector,\n                                               const std::string& name,\n                                               Object *sender)\n{\n    _target = target;\n    _selector = selector;\n    _sender = sender;\n    \n    _name = name;\n    _handler = 0;\n}\n\nNotificationObserver::~NotificationObserver()\n{\n\n}\n\nvoid NotificationObserver::performSelector(Object *sender)\n{\n    if (_target)\n    {\n\t\tif (sender) {\n\t\t\t(_target->*_selector)(sender);\n\t\t} else {\n\t\t\t(_target->*_selector)(_sender);\n\t\t}\n    }\n}\n\nObject *NotificationObserver::getTarget() const\n{\n    return _target;\n}\n\nSEL_CallFuncO NotificationObserver::getSelector() const\n{\n    return _selector;\n}\n\nconst std::string& NotificationObserver::getName() const\n{\n    return _name;\n}\n\nObject* NotificationObserver::getSender() const\n{\n    return _sender;\n}\n\nint NotificationObserver::getHandler() const\n{\n    return _handler;\n}\n\nvoid NotificationObserver::setHandler(int var)\n{\n    _handler = var;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCNotificationCenter.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Erawppa\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCNOTIFICATIONCENTER_H__\n#define __CCNOTIFICATIONCENTER_H__\n\n#include \"CCObject.h\"\n#include \"CCArray.h\"\n\nNS_CC_BEGIN\n\nclass ScriptHandlerMgr;\nclass CC_DLL __NotificationCenter : public Object\n{\n    friend class ScriptHandlerMgr;\npublic:\n    /** __NotificationCenter constructor\n     * @js ctor\n     */\n    __NotificationCenter();\n\n    /** __NotificationCenter destructor\n     * @js NA\n     * @lua NA\n     */\n    ~__NotificationCenter();\n    \n    /** Gets the single instance of __NotificationCenter. */\n    static __NotificationCenter *getInstance();\n\n    /** Destroys the single instance of __NotificationCenter. */\n    static void destroyInstance();\n\n    /** @deprecated use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static __NotificationCenter *sharedNotificationCenter(void);\n\n    /** @deprecated use destroyInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static void purgeNotificationCenter(void);\n\n\n    /** @brief Adds an observer for the specified target.\n     *  @param target The target which wants to observe notification events.\n     *  @param selector The callback function which will be invoked when the specified notification event was posted.\n     *  @param name The name of this notification.\n     *  @param sender The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target.\n     */\n    void addObserver(Object *target, \n                     SEL_CallFuncO selector,\n                     const std::string& name,\n                     Object *sender);\n\n    /** @brief Removes the observer by the specified target and name.\n     *  @param target The target of this notification.\n     *  @param name The name of this notification. \n     */\n    void removeObserver(Object *target,const std::string& name);\n    \n    /** @brief Removes all notifications registered by this target\n     *  @param target The target of this notification.\n     *  @returns the number of observers removed\n     */\n    int removeAllObservers(Object *target);\n\n    /** @brief Registers one hander for script binding.\n     *  @note Only supports Lua Binding now.\n     *  @param handler The lua handler.\n     */\n    void registerScriptObserver(Object *target,int handler,const std::string& name);\n\n    /** Unregisters script observer */\n    void unregisterScriptObserver(Object *target,const std::string& name);\n    \n    /** @brief Posts one notification event by name.\n     *  @param name The name of this notification.\n     */\n    void postNotification(const std::string& name);\n\n    /** @brief Posts one notification event by name.\n     *  @param name The name of this notification.\n     *  @param sender The object posting the notification. Can be nullptr\n     */\n    void postNotification(const std::string& name, Object *sender);\n    \n    /** @brief Gets script handler.\n     *  @note Only supports Lua Binding now.\n     *  @return The script handle.\n     */\n    inline int getScriptHandler() const { return _scriptHandler; };\n    \n    /** @brief Gets observer script handler.\n     *  @param name The name of this notification.\n     *  @return The observer script handle.\n     */\n    int getObserverHandlerByName(const std::string& name);\nprivate:\n    // internal functions\n\n    // Check whether the observer exists by the specified target and name.\n    bool observerExisted(Object *target,const std::string& name, Object *sender);\n    \n    // variables\n    //\n    __Array *_observers;\n    int     _scriptHandler;\n};\n\nclass CC_DLL NotificationObserver : public Object\n{\npublic:\n    /** @brief NotificationObserver constructor\n     *  @param target The target which wants to observer notification events.\n     *  @param selector The callback function which will be invoked when the specified notification event was posted.\n     *  @param name The name of this notification.\n     *  @param sender The object whose notifications the target wants to receive. Only notifications sent by this sender are delivered to the target. nullptr means that the sender is not used to decide whether to deliver the notification to target.\n     * @js NA\n     * @lua NA\n     */\n    NotificationObserver(Object *target, \n                           SEL_CallFuncO selector,\n                           const std::string& name,\n                           Object *sender);\n\n    /** NotificationObserver destructor function \n     * @js NA\n     * @lua NA\n     */\n    ~NotificationObserver();      \n    \n    /** Invokes the callback function of this observer \n     * @js NA\n     * @lua NA\n     */\n    void performSelector(Object *sender);\n    \n    // Getters / Setters\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Object* getTarget() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    SEL_CallFuncO getSelector() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    const std::string& getName() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Object* getSender() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    int getHandler() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setHandler(int handler);\n\nprivate:\n    Object* _target;\n    SEL_CallFuncO _selector;\n    std::string _name;\n    Object* _sender;\n    int _handler;\n};\n\nNS_CC_END\n\n#endif//__CCNOTIFICATIONCENTER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParallaxNode.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCParallaxNode.h\"\n#include \"ccCArray.h\"\n\nNS_CC_BEGIN\n\nclass PointObject : Object\n{\npublic:\n    static PointObject * create(Point ratio, Point offset)\n    {\n        PointObject *ret = new PointObject();\n        ret->initWithPoint(ratio, offset);\n        ret->autorelease();\n        return ret;\n    }\n    \n    bool initWithPoint(Point ratio, Point offset)\n    {\n        _ratio = ratio;\n        _offset = offset;\n        _child = nullptr;\n        return true;\n    }\n    \n    inline const Point& getRatio() const { return _ratio; };\n    inline void setRatio(const Point& ratio) { _ratio = ratio; };\n\n    inline const Point& getOffset() const { return _offset; };\n    inline void setOffset(const Point& offset) { _offset = offset; };\n    \n    inline Node* getChild() const { return _child; };\n    inline void setChild(Node* child) { _child = child; };\n    \nprivate:\n    Point _ratio;\n    Point _offset;\n    Node *_child; // weak ref\n};\n\nParallaxNode::ParallaxNode()\n{\n    _parallaxArray = ccArrayNew(5);        \n    _lastPosition = Point(-100,-100);\n}\n\nParallaxNode::~ParallaxNode()\n{\n    if( _parallaxArray )\n    {\n        ccArrayFree(_parallaxArray);\n        _parallaxArray = nullptr;\n    }\n}\n\nParallaxNode * ParallaxNode::create()\n{\n    ParallaxNode *ret = new ParallaxNode();\n    ret->autorelease();\n    return ret;\n}\n\nvoid ParallaxNode::addChild(Node * child, int zOrder, int tag)\n{\n    CC_UNUSED_PARAM(zOrder);\n    CC_UNUSED_PARAM(child);\n    CC_UNUSED_PARAM(tag);\n    CCASSERT(0,\"ParallaxNode: use addChild:z:parallaxRatio:positionOffset instead\");\n}\n\nvoid ParallaxNode::addChild(Node *child, int z, const Point& ratio, const Point& offset)\n{\n    CCASSERT( child != nullptr, \"Argument must be non-nil\");\n    PointObject *obj = PointObject::create(ratio, offset);\n    obj->setChild(child);\n    ccArrayAppendObjectWithResize(_parallaxArray, (Object*)obj);\n\n    Point pos = this->absolutePosition();\n    pos.x = -pos.x + pos.x * ratio.x + offset.x;\n    pos.y = -pos.y + pos.y * ratio.y + offset.y;\n    child->setPosition(pos);\n\n    Node::addChild(child, z, child->getTag());\n}\nvoid ParallaxNode::removeChild(Node* child, bool cleanup)\n{\n    for( int i=0;i < _parallaxArray->num;i++)\n    {\n        PointObject *point = (PointObject*)_parallaxArray->arr[i];\n        if( point->getChild()->isEqual(child)) \n        {\n            ccArrayRemoveObjectAtIndex(_parallaxArray, i, true);\n            break;\n        }\n    }\n    Node::removeChild(child, cleanup);\n}\nvoid ParallaxNode::removeAllChildrenWithCleanup(bool cleanup)\n{\n    ccArrayRemoveAllObjects(_parallaxArray);\n    Node::removeAllChildrenWithCleanup(cleanup);\n}\nPoint ParallaxNode::absolutePosition()\n{\n    Point ret = _position;\n    Node *cn = this;\n    while (cn->getParent() != nullptr)\n    {\n        cn = cn->getParent();\n        ret = ret + cn->getPosition();\n    }\n    return ret;\n}\n\n/*\nThe positions are updated at visit because:\n- using a timer is not guaranteed that it will called after all the positions were updated\n- overriding \"draw\" will only precise if the children have a z > 0\n*/\nvoid ParallaxNode::visit()\n{\n    //    Point pos = position_;\n    //    Point    pos = [self convertToWorldSpace:Point::ZERO];\n    Point pos = this->absolutePosition();\n    if( ! pos.equals(_lastPosition) )\n    {\n        for( int i=0; i < _parallaxArray->num; i++ ) \n        {\n            PointObject *point = (PointObject*)_parallaxArray->arr[i];\n            float x = -pos.x + pos.x * point->getRatio().x + point->getOffset().x;\n            float y = -pos.y + pos.y * point->getRatio().y + point->getOffset().y;            \n            point->getChild()->setPosition(Point(x,y));\n        }\n        _lastPosition = pos;\n    }\n    Node::visit();\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParallaxNode.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCPARALLAX_NODE_H__\n#define __CCPARALLAX_NODE_H__\n\n#include \"CCNode.h\"\n/*#include \"ccArray.h\"*/\n\nNS_CC_BEGIN\n\nstruct _ccArray;\n\n/**\n * @addtogroup tilemap_parallax_nodes\n * @{\n */\n\n/** @brief ParallaxNode: A node that simulates a parallax scroller\n\nThe children will be moved faster / slower than the parent according the the parallax ratio.\n\n*/\nclass CC_DLL ParallaxNode : public Node\n{\npublic:\n    // Create a Parallax node\n    static ParallaxNode * create();\n\n    // prevents compiler warning: \"Included function hides overloaded virtual functions\"\n    using Node::addChild;\n\n    void addChild(Node * child, int z, const Point& parallaxRatio, const Point& positionOffset);\n\n    /** Sets an array of layers for the Parallax node */\n    void setParallaxArray( struct _ccArray *parallaxArray) { _parallaxArray = parallaxArray; }\n    /** Returns the array of layers of the Parallax node */\n    struct _ccArray* getParallaxArray() { return _parallaxArray; }\n    const struct _ccArray* getParallaxArray() const { return _parallaxArray; }\n\n    //\n    // Overrides\n    //\n    virtual void addChild(Node * child, int zOrder, int tag) override;\n    virtual void removeChild(Node* child, bool cleanup) override;\n    virtual void removeAllChildrenWithCleanup(bool cleanup) override;\n    virtual void visit(void) override;\n\nprotected:\n    /** Adds a child to the container with a z-order, a parallax ratio and a position offset\n     It returns self, so you can chain several addChilds.\n     @since v0.8\n     * @js ctor\n     */\n    ParallaxNode();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParallaxNode();\n\n    Point absolutePosition();\n\n    Point    _lastPosition;\n    struct _ccArray* _parallaxArray;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParallaxNode);\n};\n\n// end of tilemap_parallax_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCPARALLAX_NODE_H__\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleBatchNode.cpp",
    "content": "/*\n * Copyright (C) 2009 Matt Oswald\n * Copyright (c) 2009-2010 Ricardo Quesada\n * Copyright (c) 2010-2012 cocos2d-x.org\n * Copyright (c) 2011      Zynga Inc.\n * Copyright (c) 2011      Marco Tillemans\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * http://www.cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#include \"CCParticleBatchNode.h\"\n#include \"CCTextureCache.h\"\n#include \"CCTextureAtlas.h\"\n#include \"ccConfig.h\"\n#include \"ccMacros.h\"\n#include \"CCGrid.h\"\n#include \"CCParticleSystem.h\"\n#include \"CCShaderCache.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"base64.h\"\n#include \"ZipUtils.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"kazmath/GL/matrix.h\"\n#include \"CCProfiling.h\"\n#include \"renderer/CCQuadCommand.h\"\n#include \"renderer/CCRenderer.h\"\n\nNS_CC_BEGIN\n\nParticleBatchNode::ParticleBatchNode()\n: _textureAtlas(nullptr)\n{\n\n}\n\nParticleBatchNode::~ParticleBatchNode()\n{\n    CC_SAFE_RELEASE(_textureAtlas);\n}\n/*\n * creation with Texture2D\n */\n\nParticleBatchNode* ParticleBatchNode::createWithTexture(Texture2D *tex, int capacity/* = kParticleDefaultCapacity*/)\n{\n    ParticleBatchNode * p = new ParticleBatchNode();\n    if( p && p->initWithTexture(tex, capacity))\n    {\n        p->autorelease();\n        return p;\n    }\n    CC_SAFE_DELETE(p);\n    return nullptr;\n}\n\n/*\n * creation with File Image\n */\n\nParticleBatchNode* ParticleBatchNode::create(const std::string& imageFile, int capacity/* = kParticleDefaultCapacity*/)\n{\n    ParticleBatchNode * p = new ParticleBatchNode();\n    if( p && p->initWithFile(imageFile, capacity))\n    {\n        p->autorelease();\n        return p;\n    }\n    CC_SAFE_DELETE(p);\n    return nullptr;\n}\n\n/*\n * init with Texture2D\n */\nbool ParticleBatchNode::initWithTexture(Texture2D *tex, int capacity)\n{\n    _textureAtlas = new TextureAtlas();\n    _textureAtlas->initWithTexture(tex, capacity);\n\n    _children.reserve(capacity);\n    \n    _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n\n    return true;\n}\n\n/*\n * init with FileImage\n */\nbool ParticleBatchNode::initWithFile(const std::string& fileImage, int capacity)\n{\n    Texture2D *tex = Director::getInstance()->getTextureCache()->addImage(fileImage);\n    return initWithTexture(tex, capacity);\n}\n\n// ParticleBatchNode - composition\n\n// override visit.\n// Don't call visit on it's children\nvoid ParticleBatchNode::visit()\n{\n    // CAREFUL:\n    // This visit is almost identical to Node#visit\n    // with the exception that it doesn't call visit on it's children\n    //\n    // The alternative is to have a void Sprite#visit, but\n    // although this is less maintainable, is faster\n    //\n    if (!_visible)\n    {\n        return;\n    }\n\n    kmGLPushMatrix();\n\n    transform();\n\n    draw();\n\n    kmGLPopMatrix();\n}\n\n// override addChild:\nvoid ParticleBatchNode::addChild(Node * aChild, int zOrder, int tag)\n{\n    CCASSERT( aChild != nullptr, \"Argument must be non-nullptr\");\n    CCASSERT( dynamic_cast<ParticleSystem*>(aChild) != nullptr, \"CCParticleBatchNode only supports QuadParticleSystems as children\");\n    ParticleSystem* child = static_cast<ParticleSystem*>(aChild);\n    CCASSERT( child->getTexture()->getName() == _textureAtlas->getTexture()->getName(), \"CCParticleSystem is not using the same texture id\");\n    // If this is the 1st children, then copy blending function\n    if (_children.empty())\n    {\n        setBlendFunc(child->getBlendFunc());\n    }\n\n    CCASSERT( _blendFunc.src  == child->getBlendFunc().src && _blendFunc.dst  == child->getBlendFunc().dst, \"Can't add a ParticleSystem that uses a different blending function\");\n\n    //no lazy sorting, so don't call super addChild, call helper instead\n    auto pos = addChildHelper(child,zOrder,tag);\n\n    //get new atlasIndex\n    int atlasIndex = 0;\n\n    if (pos != 0)\n    {\n        ParticleSystem* p = static_cast<ParticleSystem*>(_children.at(pos-1));\n        atlasIndex = p->getAtlasIndex() + p->getTotalParticles();\n    }\n    else\n    {\n        atlasIndex = 0;\n    }\n\n    insertChild(child, atlasIndex);\n\n    // update quad info\n    child->setBatchNode(this);\n}\n\n// don't use lazy sorting, reordering the particle systems quads afterwards would be too complex\n// XXX research whether lazy sorting + freeing current quads and calloc a new block with size of capacity would be faster\n// XXX or possibly using vertexZ for reordering, that would be fastest\n// this helper is almost equivalent to Node's addChild, but doesn't make use of the lazy sorting\nint ParticleBatchNode::addChildHelper(ParticleSystem* child, int z, int aTag)\n{\n    CCASSERT( child != nullptr, \"Argument must be non-nil\");\n    CCASSERT( child->getParent() == nullptr, \"child already added. It can't be added again\");\n\n    _children.reserve(4);\n\n    //don't use a lazy insert\n    auto pos = searchNewPositionInChildrenForZ(z);\n\n    _children.insert(pos, child);\n\n    child->setTag(aTag);\n    child->_setLocalZOrder(z);\n\n    child->setParent(this);\n\n    if( _running )\n    {\n        child->onEnter();\n        child->onEnterTransitionDidFinish();\n    }\n    return pos;\n}\n\n// Reorder will be done in this function, no \"lazy\" reorder to particles\nvoid ParticleBatchNode::reorderChild(Node * aChild, int zOrder)\n{\n    CCASSERT( aChild != nullptr, \"Child must be non-nullptr\");\n    CCASSERT( dynamic_cast<ParticleSystem*>(aChild) != nullptr, \"CCParticleBatchNode only supports QuadParticleSystems as children\");\n    CCASSERT( _children.contains(aChild), \"Child doesn't belong to batch\" );\n\n    ParticleSystem* child = static_cast<ParticleSystem*>(aChild);\n\n    if( zOrder == child->getLocalZOrder() )\n    {\n        return;\n    }\n\n    // no reordering if only 1 child\n    if (!_children.empty())\n    {\n        int newIndex = 0, oldIndex = 0;\n\n        getCurrentIndex(&oldIndex, &newIndex, child, zOrder);\n\n        if( oldIndex != newIndex )\n        {\n\n            // reorder _children->array\n            child->retain();\n            _children.erase(oldIndex);\n            _children.insert(newIndex, child);\n            child->release();\n\n            // save old altasIndex\n            int oldAtlasIndex = child->getAtlasIndex();\n\n            // update atlas index\n            updateAllAtlasIndexes();\n\n            // Find new AtlasIndex\n            int newAtlasIndex = 0;\n            for( int i=0;i < _children.size();i++)\n            {\n                ParticleSystem* node = static_cast<ParticleSystem*>(_children.at(i));\n                if( node == child )\n                {\n                    newAtlasIndex = child->getAtlasIndex();\n                    break;\n                }\n            }\n\n            // reorder textureAtlas quads\n            _textureAtlas->moveQuadsFromIndex(oldAtlasIndex, child->getTotalParticles(), newAtlasIndex);\n\n            child->updateWithNoTime();\n        }\n    }\n\n    child->_setLocalZOrder(zOrder);\n}\n\nvoid ParticleBatchNode::getCurrentIndex(int* oldIndex, int* newIndex, Node* child, int z)\n{\n    bool foundCurrentIdx = false;\n    bool foundNewIdx = false;\n\n    int  minusOne = 0;\n    auto count = _children.size();\n\n    for( int i=0; i < count; i++ )\n    {\n        Node* pNode = _children.at(i);\n\n        // new index\n        if( pNode->getLocalZOrder() > z &&  ! foundNewIdx )\n        {\n            *newIndex = i;\n            foundNewIdx = true;\n\n            if( foundCurrentIdx && foundNewIdx )\n            {\n                break;\n            }\n        }\n\n        // current index\n        if( child == pNode )\n        {\n            *oldIndex = i;\n            foundCurrentIdx = true;\n\n            if( ! foundNewIdx )\n            {\n                minusOne = -1;\n            }\n\n            if( foundCurrentIdx && foundNewIdx )\n            {\n                break;\n            }\n        }\n\n    }\n\n    if( ! foundNewIdx )\n    {\n        *newIndex = static_cast<int>(count);\n    }\n\n    *newIndex += minusOne;\n}\n\nint ParticleBatchNode::searchNewPositionInChildrenForZ(int z)\n{\n    auto count = _children.size();\n\n    for( int i=0; i < count; i++ )\n    {\n        Node *child = _children.at(i);\n        if (child->getLocalZOrder() > z)\n        {\n            return i;\n        }\n    }\n    return static_cast<int>(count);\n}\n\n// override removeChild:\nvoid  ParticleBatchNode::removeChild(Node* aChild, bool cleanup)\n{\n    // explicit nil handling\n    if (aChild == nullptr)\n        return;\n\n    CCASSERT( dynamic_cast<ParticleSystem*>(aChild) != nullptr, \"CCParticleBatchNode only supports QuadParticleSystems as children\");\n    CCASSERT(_children.contains(aChild), \"CCParticleBatchNode doesn't contain the sprite. Can't remove it\");\n\n    ParticleSystem* child = static_cast<ParticleSystem*>(aChild);\n    Node::removeChild(child, cleanup);\n\n    // remove child helper\n    _textureAtlas->removeQuadsAtIndex(child->getAtlasIndex(), child->getTotalParticles());\n\n    // after memmove of data, empty the quads at the end of array\n    _textureAtlas->fillWithEmptyQuadsFromIndex(_textureAtlas->getTotalQuads(), child->getTotalParticles());\n\n    // particle could be reused for self rendering\n    child->setBatchNode(nullptr);\n\n    updateAllAtlasIndexes();\n}\n\nvoid ParticleBatchNode::removeChildAtIndex(int index, bool doCleanup)\n{\n    removeChild(_children.at(index), doCleanup);\n}\n\nvoid ParticleBatchNode::removeAllChildrenWithCleanup(bool doCleanup)\n{\n    for(const auto &child : _children)\n        static_cast<ParticleSystem*>(child)->setBatchNode(nullptr);\n\n    Node::removeAllChildrenWithCleanup(doCleanup);\n\n    _textureAtlas->removeAllQuads();\n}\n\nvoid ParticleBatchNode::draw(void)\n{\n    CC_PROFILER_START(\"CCParticleBatchNode - draw\");\n\n    if( _textureAtlas->getTotalQuads() == 0 )\n    {\n        return;\n    }\n\n    _batchCommand.init(\n                       _globalZOrder,\n                       _shaderProgram,\n                       _blendFunc,\n                       _textureAtlas,\n                       _modelViewTransform);\n    Director::getInstance()->getRenderer()->addCommand(&_batchCommand);\n    CC_PROFILER_STOP(\"CCParticleBatchNode - draw\");\n}\n\n\n\nvoid ParticleBatchNode::increaseAtlasCapacityTo(ssize_t quantity)\n{\n    CCLOG(\"cocos2d: ParticleBatchNode: resizing TextureAtlas capacity from [%lu] to [%lu].\",\n          (long)_textureAtlas->getCapacity(),\n          (long)quantity);\n\n    if( ! _textureAtlas->resizeCapacity(quantity) ) {\n        // serious problems\n        CCLOGWARN(\"cocos2d: WARNING: Not enough memory to resize the atlas\");\n        CCASSERT(false,\"XXX: ParticleBatchNode #increaseAtlasCapacity SHALL handle this assert\");\n    }\n}\n\n//sets a 0'd quad into the quads array\nvoid ParticleBatchNode::disableParticle(int particleIndex)\n{\n    V3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[particleIndex]);\n    quad->br.vertices.x = quad->br.vertices.y = quad->tr.vertices.x = quad->tr.vertices.y = quad->tl.vertices.x = quad->tl.vertices.y = quad->bl.vertices.x = quad->bl.vertices.y = 0.0f;\n}\n\n// ParticleBatchNode - add / remove / reorder helper methods\n\n// add child helper\nvoid ParticleBatchNode::insertChild(ParticleSystem* system, int index)\n{\n    system->setAtlasIndex(index);\n\n    if(_textureAtlas->getTotalQuads() + system->getTotalParticles() > _textureAtlas->getCapacity())\n    {\n        increaseAtlasCapacityTo(_textureAtlas->getTotalQuads() + system->getTotalParticles());\n\n        // after a realloc empty quads of textureAtlas can be filled with gibberish (realloc doesn't perform calloc), insert empty quads to prevent it\n        _textureAtlas->fillWithEmptyQuadsFromIndex(_textureAtlas->getCapacity() - system->getTotalParticles(), system->getTotalParticles());\n    }\n\n    // make room for quads, not necessary for last child\n    if (system->getAtlasIndex() + system->getTotalParticles() != _textureAtlas->getTotalQuads())\n    {\n        _textureAtlas->moveQuadsFromIndex(index, index+system->getTotalParticles());\n    }\n\n    // increase totalParticles here for new particles, update method of particle-system will fill the quads\n    _textureAtlas->increaseTotalQuadsWith(system->getTotalParticles());\n\n    updateAllAtlasIndexes();\n}\n\n//rebuild atlas indexes\nvoid ParticleBatchNode::updateAllAtlasIndexes()\n{\n    int index = 0;\n    \n    for(const auto &child : _children) {\n        ParticleSystem* partiSys = static_cast<ParticleSystem*>(child);\n        partiSys->setAtlasIndex(index);\n        index += partiSys->getTotalParticles();\n    }\n}\n\n// ParticleBatchNode - CocosNodeTexture protocol\n\nvoid ParticleBatchNode::updateBlendFunc()\n{\n    if( ! _textureAtlas->getTexture()->hasPremultipliedAlpha())\n        _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n}\n\nvoid ParticleBatchNode::setTexture(Texture2D* texture)\n{\n    _textureAtlas->setTexture(texture);\n\n    // If the new texture has No premultiplied alpha, AND the blendFunc hasn't been changed, then update it\n    if( texture && ! texture->hasPremultipliedAlpha() && ( _blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST ) )\n    {\n        _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n    }\n}\n\nTexture2D* ParticleBatchNode::getTexture() const\n{\n    return _textureAtlas->getTexture();\n}\n\nvoid ParticleBatchNode::setBlendFunc(const BlendFunc &blendFunc)\n{\n    _blendFunc = blendFunc;\n}\n// returns the blending function used for the texture\nconst BlendFunc& ParticleBatchNode::getBlendFunc() const\n{\n    return _blendFunc;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleBatchNode.h",
    "content": "/*\n * Copyright (C) 2009 Matt Oswald\n * Copyright (c) 2009-2010 Ricardo Quesada\n * Copyright (c) 2010-2012 cocos2d-x.org\n * Copyright (c) 2011      Zynga Inc.\n * Copyright (c) 2011      Marco Tillemans\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * http://www.cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n#ifndef __CCPARTICLEBATCHNODE_H__\n#define __CCPARTICLEBATCHNODE_H__\n\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"renderer/CCBatchCommand.h\"\n\nNS_CC_BEGIN\n\nclass Texture2D;\nclass TextureAtlas;\nclass ParticleSystem;\n\n/**\n * @addtogroup particle_nodes\n * @{\n */\n\n#define kParticleDefaultCapacity 500\n\n/** ParticleBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call\n * (often known as \"batch draw\").\n *\n * A ParticleBatchNode can reference one and only one texture (one image file, one texture atlas).\n * Only the ParticleSystems that are contained in that texture can be added to the SpriteBatchNode.\n * All ParticleSystems added to a SpriteBatchNode are drawn in one OpenGL ES draw call.\n * If the ParticleSystems are not added to a ParticleBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.\n *\n *\n * Limitations:\n * - At the moment only ParticleSystemQuad is supported\n * - All systems need to be drawn with the same parameters, blend function, aliasing, texture\n *\n * Most efficient usage\n * - Initialize the ParticleBatchNode with the texture and enough capacity for all the particle systems\n * - Initialize all particle systems and add them as child to the batch node\n * @since v1.1\n */\n\nclass CC_DLL ParticleBatchNode : public Node, public TextureProtocol\n{\npublic:\n    /** initializes the particle system with Texture2D, a capacity of particles, which particle system to use */\n    static ParticleBatchNode* createWithTexture(Texture2D *tex, int capacity = kParticleDefaultCapacity);\n\n    /** initializes the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles */\n    static ParticleBatchNode* create(const std::string& fileImage, int capacity = kParticleDefaultCapacity);\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleBatchNode();\n\n    /** Inserts a child into the ParticleBatchNode */\n    void insertChild(ParticleSystem* system, int index);\n\n    void removeChildAtIndex(int index, bool doCleanup);\n    void removeAllChildrenWithCleanup(bool doCleanup);\n\n    /** disables a particle by inserting a 0'd quad into the texture atlas */\n    void disableParticle(int particleIndex);\n\n    /** Gets the texture atlas used for drawing the quads */\n    inline TextureAtlas* getTextureAtlas() const { return _textureAtlas; };\n    \n    /** Sets the texture atlas used for drawing the quads */\n    inline void setTextureAtlas(TextureAtlas* atlas) { _textureAtlas = atlas; };\n    \n    // Overrides\n    void visit();\n\n    using Node::addChild;\n    virtual void addChild(Node * child, int zOrder, int tag) override;\n    virtual void removeChild(Node* child, bool cleanup) override;\n    virtual void reorderChild(Node * child, int zOrder) override;\n    virtual void draw(void) override;\n    virtual Texture2D* getTexture(void) const override;\n    virtual void setTexture(Texture2D *texture) override;\n    /**\n    * @code\n    * When this function bound into js or lua,the parameter will be changed\n    * In js: var setBlendFunc(var src, var dst)\n    * @endcode\n    * @lua NA\n    */\n    virtual void setBlendFunc(const BlendFunc &blendFunc) override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const BlendFunc& getBlendFunc(void) const override;\n    \nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleBatchNode();\n    \n    /** initializes the particle system with Texture2D, a capacity of particles */\n    bool initWithTexture(Texture2D *tex, int capacity);\n    \n    /** initializes the particle system with the name of a file on disk (for a list of supported formats look at the Texture2D class), a capacity of particles */\n    bool initWithFile(const std::string& fileImage, int capacity);\n\nprivate:\n    void updateAllAtlasIndexes();\n    void increaseAtlasCapacityTo(ssize_t quantity);\n    int searchNewPositionInChildrenForZ(int z);\n    void getCurrentIndex(int* oldIndex, int* newIndex, Node* child, int z);\n    int addChildHelper(ParticleSystem* child, int z, int aTag);\n    void updateBlendFunc(void);\n    /** the texture atlas used for drawing the quads */\n    TextureAtlas* _textureAtlas;\n\nprivate:\n    /** the blend function used for drawing the quads */\n    BlendFunc _blendFunc;\n    // quad command\n    BatchCommand _batchCommand;\n};\n\n// end of particle_nodes group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCPARTICLEBATCHNODE_H__ */\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleExamples.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCParticleExamples.h\"\n#include \"CCDirector.h\"\n#include \"CCTextureCache.h\"\n#include \"firePngData.h\"\n#include \"platform/CCImage.h\"\n\nNS_CC_BEGIN\n//\n// ParticleFire\n//\n\nstatic Texture2D* getDefaultTexture()\n{\n    Texture2D* texture = nullptr;\n    Image* image = nullptr;\n    do \n    {\n        bool ret = false;\n        const std::string key = \"/__firePngData\";\n        texture = Director::getInstance()->getTextureCache()->getTextureForKey(key);\n        CC_BREAK_IF(texture != nullptr);\n\n        image = new Image();\n        CC_BREAK_IF(nullptr == image);\n        ret = image->initWithImageData(__firePngData, sizeof(__firePngData));\n        CC_BREAK_IF(!ret);\n\n        texture = Director::getInstance()->getTextureCache()->addImage(image, key);\n    } while (0);\n\n    CC_SAFE_RELEASE(image);\n\n    return texture;\n}\n\nParticleFire* ParticleFire::create()\n{\n    ParticleFire* ret = new ParticleFire();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleFire* ParticleFire::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleFire* ret = new ParticleFire();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleFire::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // Gravity Mode\n        this->_emitterMode = Mode::GRAVITY;\n\n        // Gravity Mode: gravity\n        this->modeA.gravity = Point(0,0);\n\n        // Gravity Mode: radial acceleration\n        this->modeA.radialAccel = 0;\n        this->modeA.radialAccelVar = 0;\n\n        // Gravity Mode: speed of particles\n        this->modeA.speed = 60;\n        this->modeA.speedVar = 20;        \n\n        // starting angle\n        _angle = 90;\n        _angleVar = 10;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, 60));\n        this->_posVar = Point(40, 20);\n\n        // life of particles\n        _life = 3;\n        _lifeVar = 0.25f;\n\n\n        // size, in pixels\n        _startSize = 54.0f;\n        _startSizeVar = 10.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per frame\n        _emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.76f;\n        _startColor.g = 0.25f;\n        _startColor.b = 0.12f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.0f;\n        _startColorVar.g = 0.0f;\n        _startColorVar.b = 0.0f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 0.0f;\n        _endColor.g = 0.0f;\n        _endColor.b = 0.0f;\n        _endColor.a = 1.0f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n        \n        // additive\n        this->setBlendAdditive(true);\n        return true;\n    }\n    return false;\n}\n//\n// ParticleFireworks\n//\n\nParticleFireworks* ParticleFireworks::create()\n{\n    ParticleFireworks* ret = new ParticleFireworks();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleFireworks* ParticleFireworks::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleFireworks* ret = new ParticleFireworks();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleFireworks::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // duration\n        _duration= DURATION_INFINITY;\n\n        // Gravity Mode\n        this->_emitterMode = Mode::GRAVITY;\n\n        // Gravity Mode: gravity\n        this->modeA.gravity = Point(0,-90);\n\n        // Gravity Mode:  radial\n        this->modeA.radialAccel = 0;\n        this->modeA.radialAccelVar = 0;\n\n        //  Gravity Mode: speed of particles\n        this->modeA.speed = 180;\n        this->modeA.speedVar = 50;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height/2));\n\n        // angle\n        this->_angle= 90;\n        this->_angleVar = 20;\n\n        // life of particles\n        this->_life = 3.5f;\n        this->_lifeVar = 1;\n\n        // emits per frame\n        this->_emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.5f;\n        _startColor.g = 0.5f;\n        _startColor.b = 0.5f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.5f;\n        _startColorVar.g = 0.5f;\n        _startColorVar.b = 0.5f;\n        _startColorVar.a = 0.1f;\n        _endColor.r = 0.1f;\n        _endColor.g = 0.1f;\n        _endColor.b = 0.1f;\n        _endColor.a = 0.2f;\n        _endColorVar.r = 0.1f;\n        _endColorVar.g = 0.1f;\n        _endColorVar.b = 0.1f;\n        _endColorVar.a = 0.2f;\n\n        // size, in pixels\n        _startSize = 8.0f;\n        _startSizeVar = 2.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n        // additive\n        this->setBlendAdditive(false);\n        return true;\n    }\n    return false;\n}\n//\n// ParticleSun\n//\nParticleSun* ParticleSun::create()\n{\n    ParticleSun* ret = new ParticleSun();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleSun* ParticleSun::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleSun* ret = new ParticleSun();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleSun::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // additive\n        this->setBlendAdditive(true);\n\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // Gravity Mode\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(0,0));\n\n        // Gravity mode: radial acceleration\n        setRadialAccel(0);\n        setRadialAccelVar(0);\n\n        // Gravity mode: speed of particles\n        setSpeed(20);\n        setSpeedVar(5);\n\n\n        // angle\n        _angle = 90;\n        _angleVar = 360;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height/2));\n        setPosVar(Point::ZERO);\n\n        // life of particles\n        _life = 1;\n        _lifeVar = 0.5f;\n\n        // size, in pixels\n        _startSize = 30.0f;\n        _startSizeVar = 10.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per seconds\n        _emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.76f;\n        _startColor.g = 0.25f;\n        _startColor.b = 0.12f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.0f;\n        _startColorVar.g = 0.0f;\n        _startColorVar.b = 0.0f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 0.0f;\n        _endColor.g = 0.0f;\n        _endColor.b = 0.0f;\n        _endColor.a = 1.0f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        return true;\n    }\n    return false;\n}\n\n//\n// ParticleGalaxy\n//\n\nParticleGalaxy* ParticleGalaxy::create()\n{\n    ParticleGalaxy* ret = new ParticleGalaxy();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleGalaxy* ParticleGalaxy::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleGalaxy* ret = new ParticleGalaxy();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleGalaxy::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // Gravity Mode\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(0,0));\n\n        // Gravity Mode: speed of particles\n        setSpeed(60);\n        setSpeedVar(10);\n\n        // Gravity Mode: radial\n        setRadialAccel(-80);\n        setRadialAccelVar(0);\n\n        // Gravity Mode: tangential\n        setTangentialAccel(80);\n        setTangentialAccelVar(0);\n\n        // angle\n        _angle = 90;\n        _angleVar = 360;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height/2));\n        setPosVar(Point::ZERO);\n\n        // life of particles\n        _life = 4;\n        _lifeVar = 1;\n\n        // size, in pixels\n        _startSize = 37.0f;\n        _startSizeVar = 10.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per second\n        _emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.12f;\n        _startColor.g = 0.25f;\n        _startColor.b = 0.76f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.0f;\n        _startColorVar.g = 0.0f;\n        _startColorVar.b = 0.0f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 0.0f;\n        _endColor.g = 0.0f;\n        _endColor.b = 0.0f;\n        _endColor.a = 1.0f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(true);\n        return true;\n    }\n    return false;\n}\n\n//\n// ParticleFlower\n//\n\nParticleFlower* ParticleFlower::create()\n{\n    ParticleFlower* ret = new ParticleFlower();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleFlower* ParticleFlower::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleFlower* ret = new ParticleFlower();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleFlower::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // Gravity Mode\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(0,0));\n\n        // Gravity Mode: speed of particles\n        setSpeed(80);\n        setSpeedVar(10);\n\n        // Gravity Mode: radial\n        setRadialAccel(-60);\n        setRadialAccelVar(0);\n\n        // Gravity Mode: tangential\n        setTangentialAccel(15);\n        setTangentialAccelVar(0);\n\n        // angle\n        _angle = 90;\n        _angleVar = 360;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height/2));\n        setPosVar(Point::ZERO);\n\n        // life of particles\n        _life = 4;\n        _lifeVar = 1;\n\n        // size, in pixels\n        _startSize = 30.0f;\n        _startSizeVar = 10.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per second\n        _emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.50f;\n        _startColor.g = 0.50f;\n        _startColor.b = 0.50f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.5f;\n        _startColorVar.g = 0.5f;\n        _startColorVar.b = 0.5f;\n        _startColorVar.a = 0.5f;\n        _endColor.r = 0.0f;\n        _endColor.g = 0.0f;\n        _endColor.b = 0.0f;\n        _endColor.a = 1.0f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(true);\n        return true;\n    }\n    return false;\n}\n//\n// ParticleMeteor\n//\n\nParticleMeteor * ParticleMeteor::create()\n{\n    ParticleMeteor *ret = new ParticleMeteor();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleMeteor* ParticleMeteor::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleMeteor* ret = new ParticleMeteor();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleMeteor::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // Gravity Mode\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(-200,200));\n\n        // Gravity Mode: speed of particles\n        setSpeed(15);\n        setSpeedVar(5);\n\n        // Gravity Mode: radial\n        setRadialAccel(0);\n        setRadialAccelVar(0);\n\n        // Gravity Mode: tangential\n        setTangentialAccel(0);\n        setTangentialAccelVar(0);\n\n        // angle\n        _angle = 90;\n        _angleVar = 360;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height/2));\n        setPosVar(Point::ZERO);\n\n        // life of particles\n        _life = 2;\n        _lifeVar = 1;\n\n        // size, in pixels\n        _startSize = 60.0f;\n        _startSizeVar = 10.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per second\n        _emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.2f;\n        _startColor.g = 0.4f;\n        _startColor.b = 0.7f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.0f;\n        _startColorVar.g = 0.0f;\n        _startColorVar.b = 0.2f;\n        _startColorVar.a = 0.1f;\n        _endColor.r = 0.0f;\n        _endColor.g = 0.0f;\n        _endColor.b = 0.0f;\n        _endColor.a = 1.0f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(true);\n        return true;\n    }\n    return false;\n}\n\n//\n// ParticleSpiral\n//\n\nParticleSpiral* ParticleSpiral::create()\n{\n    ParticleSpiral* ret = new ParticleSpiral();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleSpiral* ParticleSpiral::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleSpiral* ret = new ParticleSpiral();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleSpiral::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) ) \n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // Gravity Mode\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(0,0));\n\n        // Gravity Mode: speed of particles\n        setSpeed(150);\n        setSpeedVar(0);\n\n        // Gravity Mode: radial\n        setRadialAccel(-380);\n        setRadialAccelVar(0);\n\n        // Gravity Mode: tangential\n        setTangentialAccel(45);\n        setTangentialAccelVar(0);\n\n        // angle\n        _angle = 90;\n        _angleVar = 0;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height/2));\n        setPosVar(Point::ZERO);\n\n        // life of particles\n        _life = 12;\n        _lifeVar = 0;\n\n        // size, in pixels\n        _startSize = 20.0f;\n        _startSizeVar = 0.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per second\n        _emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.5f;\n        _startColor.g = 0.5f;\n        _startColor.b = 0.5f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.5f;\n        _startColorVar.g = 0.5f;\n        _startColorVar.b = 0.5f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 0.5f;\n        _endColor.g = 0.5f;\n        _endColor.b = 0.5f;\n        _endColor.a = 1.0f;\n        _endColorVar.r = 0.5f;\n        _endColorVar.g = 0.5f;\n        _endColorVar.b = 0.5f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(false);\n        return true;\n    }\n    return false;\n}\n\n//\n// ParticleExplosion\n//\n\nParticleExplosion* ParticleExplosion::create()\n{\n    ParticleExplosion* ret = new ParticleExplosion();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleExplosion* ParticleExplosion::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleExplosion* ret = new ParticleExplosion();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleExplosion::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) ) \n    {\n        // duration\n        _duration = 0.1f;\n\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(0,0));\n\n        // Gravity Mode: speed of particles\n        setSpeed(70);\n        setSpeedVar(40);\n\n        // Gravity Mode: radial\n        setRadialAccel(0);\n        setRadialAccelVar(0);\n\n        // Gravity Mode: tangential\n        setTangentialAccel(0);\n        setTangentialAccelVar(0);\n\n        // angle\n        _angle = 90;\n        _angleVar = 360;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height/2));\n        setPosVar(Point::ZERO);\n\n        // life of particles\n        _life = 5.0f;\n        _lifeVar = 2;\n\n        // size, in pixels\n        _startSize = 15.0f;\n        _startSizeVar = 10.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per second\n        _emissionRate = _totalParticles/_duration;\n\n        // color of particles\n        _startColor.r = 0.7f;\n        _startColor.g = 0.1f;\n        _startColor.b = 0.2f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.5f;\n        _startColorVar.g = 0.5f;\n        _startColorVar.b = 0.5f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 0.5f;\n        _endColor.g = 0.5f;\n        _endColor.b = 0.5f;\n        _endColor.a = 0.0f;\n        _endColorVar.r = 0.5f;\n        _endColorVar.g = 0.5f;\n        _endColorVar.b = 0.5f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(false);\n        return true;\n    }\n    return false;\n}\n\n//\n// ParticleSmoke\n//\n\nParticleSmoke* ParticleSmoke::create()\n{\n    ParticleSmoke* ret = new ParticleSmoke();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleSmoke* ParticleSmoke::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleSmoke* ret = new ParticleSmoke();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleSmoke::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // Emitter mode: Gravity Mode\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(0,0));\n\n        // Gravity Mode: radial acceleration\n        setRadialAccel(0);\n        setRadialAccelVar(0);\n\n        // Gravity Mode: speed of particles\n        setSpeed(25);\n        setSpeedVar(10);\n\n        // angle\n        _angle = 90;\n        _angleVar = 5;\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, 0));\n        setPosVar(Point(20, 0));\n\n        // life of particles\n        _life = 4;\n        _lifeVar = 1;\n\n        // size, in pixels\n        _startSize = 60.0f;\n        _startSizeVar = 10.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per frame\n        _emissionRate = _totalParticles/_life;\n\n        // color of particles\n        _startColor.r = 0.8f;\n        _startColor.g = 0.8f;\n        _startColor.b = 0.8f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.02f;\n        _startColorVar.g = 0.02f;\n        _startColorVar.b = 0.02f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 0.0f;\n        _endColor.g = 0.0f;\n        _endColor.b = 0.0f;\n        _endColor.a = 1.0f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(false);\n        return true;\n    }\n    return false;\n}\n\n//\n// ParticleSnow\n//\n\nParticleSnow* ParticleSnow::create()\n{\n    ParticleSnow* ret = new ParticleSnow();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleSnow* ParticleSnow::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleSnow* ret = new ParticleSnow();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleSnow::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) ) \n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        // set gravity mode.\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(0,-1));\n\n        // Gravity Mode: speed of particles\n        setSpeed(5);\n        setSpeedVar(1);\n\n        // Gravity Mode: radial\n        setRadialAccel(0);\n        setRadialAccelVar(1);\n\n        // Gravity mode: tangential\n        setTangentialAccel(0);\n        setTangentialAccelVar(1);\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height + 10));\n        setPosVar(Point(winSize.width/2, 0));\n\n        // angle\n        _angle = -90;\n        _angleVar = 5;\n\n        // life of particles\n        _life = 45;\n        _lifeVar = 15;\n\n        // size, in pixels\n        _startSize = 10.0f;\n        _startSizeVar = 5.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per second\n        _emissionRate = 10;\n\n        // color of particles\n        _startColor.r = 1.0f;\n        _startColor.g = 1.0f;\n        _startColor.b = 1.0f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.0f;\n        _startColorVar.g = 0.0f;\n        _startColorVar.b = 0.0f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 1.0f;\n        _endColor.g = 1.0f;\n        _endColor.b = 1.0f;\n        _endColor.a = 0.0f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(false);\n        return true;\n    }\n    return false;\n}\n//\n// ParticleRain\n//\n\nParticleRain* ParticleRain::create()\n{\n    ParticleRain* ret = new ParticleRain();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nParticleRain* ParticleRain::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleRain* ret = new ParticleRain();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n    return ret;\n}\n\nbool ParticleRain::initWithTotalParticles(int numberOfParticles)\n{\n    if( ParticleSystemQuad::initWithTotalParticles(numberOfParticles) )\n    {\n        // duration\n        _duration = DURATION_INFINITY;\n\n        setEmitterMode(Mode::GRAVITY);\n\n        // Gravity Mode: gravity\n        setGravity(Point(10,-10));\n\n        // Gravity Mode: radial\n        setRadialAccel(0);\n        setRadialAccelVar(1);\n\n        // Gravity Mode: tangential\n        setTangentialAccel(0);\n        setTangentialAccelVar(1);\n\n        // Gravity Mode: speed of particles\n        setSpeed(130);\n        setSpeedVar(30);\n\n        // angle\n        _angle = -90;\n        _angleVar = 5;\n\n\n        // emitter position\n        Size winSize = Director::getInstance()->getWinSize();\n        this->setPosition(Point(winSize.width/2, winSize.height));\n        setPosVar(Point(winSize.width/2, 0));\n\n        // life of particles\n        _life = 4.5f;\n        _lifeVar = 0;\n\n        // size, in pixels\n        _startSize = 4.0f;\n        _startSizeVar = 2.0f;\n        _endSize = START_SIZE_EQUAL_TO_END_SIZE;\n\n        // emits per second\n        _emissionRate = 20;\n\n        // color of particles\n        _startColor.r = 0.7f;\n        _startColor.g = 0.8f;\n        _startColor.b = 1.0f;\n        _startColor.a = 1.0f;\n        _startColorVar.r = 0.0f;\n        _startColorVar.g = 0.0f;\n        _startColorVar.b = 0.0f;\n        _startColorVar.a = 0.0f;\n        _endColor.r = 0.7f;\n        _endColor.g = 0.8f;\n        _endColor.b = 1.0f;\n        _endColor.a = 0.5f;\n        _endColorVar.r = 0.0f;\n        _endColorVar.g = 0.0f;\n        _endColorVar.b = 0.0f;\n        _endColorVar.a = 0.0f;\n\n        Texture2D* texture = getDefaultTexture();\n        if (texture != nullptr)\n        {\n            setTexture(texture);\n        }\n\n        // additive\n        this->setBlendAdditive(false);\n        return true;\n    }\n    return false;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleExamples.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCPARTICLE_EXAMPLE_H__\n#define __CCPARTICLE_EXAMPLE_H__\n\n#include \"CCParticleSystemQuad.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup particle_nodes\n * @{\n */\n\n//! @brief A fire particle system\nclass CC_DLL ParticleFire : public ParticleSystemQuad\n{\npublic:\n    static ParticleFire* create();\n    static ParticleFire* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleFire(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleFire(){}\n    bool init(){ return initWithTotalParticles(250); }\n    virtual bool initWithTotalParticles(int numberOfParticles) override;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleFire);\n};\n\n//! @brief A fireworks particle system\nclass CC_DLL ParticleFireworks : public ParticleSystemQuad\n{\npublic:\n    static ParticleFireworks* create();\n    static ParticleFireworks* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleFireworks(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleFireworks(){}\n    bool init(){ return initWithTotalParticles(1500); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleFireworks);\n\n};\n\n//! @brief A sun particle system\nclass CC_DLL ParticleSun : public ParticleSystemQuad\n{\npublic:\n    static ParticleSun* create();\n    static ParticleSun* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleSun(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleSun(){}\n    bool init(){ return initWithTotalParticles(350); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleSun);\n\n};\n\n//! @brief A galaxy particle system\nclass CC_DLL ParticleGalaxy : public ParticleSystemQuad\n{\npublic:\n    static ParticleGalaxy* create();\n    static ParticleGalaxy* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleGalaxy(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleGalaxy(){}\n    bool init(){ return initWithTotalParticles(200); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleGalaxy);\n\n};\n\n//! @brief A flower particle system\nclass CC_DLL ParticleFlower : public ParticleSystemQuad\n{\npublic:\n    static ParticleFlower* create();\n    static ParticleFlower* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleFlower(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleFlower(){}\n    bool init(){ return initWithTotalParticles(250); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleFlower);\n};\n\n//! @brief A meteor particle system\nclass CC_DLL ParticleMeteor : public ParticleSystemQuad\n{\npublic:\n    static ParticleMeteor * create();\n    static ParticleMeteor* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleMeteor(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleMeteor(){}\n    bool init(){ return initWithTotalParticles(150); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleMeteor);\n};\n\n//! @brief An spiral particle system\nclass CC_DLL ParticleSpiral : public ParticleSystemQuad\n{\npublic:\n    static ParticleSpiral* create();\n    static ParticleSpiral* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleSpiral(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleSpiral(){}\n    bool init(){ return initWithTotalParticles(500); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleSpiral);\n\n};\n\n//! @brief An explosion particle system\nclass CC_DLL ParticleExplosion : public ParticleSystemQuad\n{\npublic:\n    static ParticleExplosion* create();\n    static ParticleExplosion* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleExplosion(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleExplosion(){}\n    bool init(){ return initWithTotalParticles(700); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleExplosion);\n};\n\n//! @brief An smoke particle system\nclass CC_DLL ParticleSmoke : public ParticleSystemQuad\n{\npublic:\n    static ParticleSmoke* create();\n    static ParticleSmoke* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleSmoke(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleSmoke(){}\n    bool init(){ return initWithTotalParticles(200); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleSmoke);\n};\n\n//! @brief An snow particle system\nclass CC_DLL ParticleSnow : public ParticleSystemQuad\n{\npublic:\n    static ParticleSnow* create();\n    static ParticleSnow* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleSnow(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleSnow(){}\n    bool init(){ return initWithTotalParticles(700); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleSnow);\n};\n\n//! @brief A rain particle system\nclass CC_DLL ParticleRain : public ParticleSystemQuad\n{\npublic:\n    static ParticleRain* create();\n    static ParticleRain* createWithTotalParticles(int numberOfParticles);\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleRain(){}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleRain(){}\n    bool init(){ return initWithTotalParticles(1000); }\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleRain);\n};\n\n// end of particle_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCPARTICLE_EXAMPLE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleSystem.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n// ideas taken from:\n//     . The ocean spray in your face [Jeff Lander]\n//        http://www.double.co.nz/dust/col0798.pdf\n//     . Building an Advanced Particle System [John van der Burg]\n//        http://www.gamasutra.com/features/20000623/vanderburg_01.htm\n//   . LOVE game engine\n//        http://love2d.org/\n//\n//\n// Radius mode support, from 71 squared\n//        http://particledesigner.71squared.com/\n//\n// IMPORTANT: Particle Designer is supported by cocos2d, but\n// 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,\n//  cocos2d uses a another approach, but the results are almost identical. \n//\n\n#include \"CCParticleSystem.h\"\n\n#include <string>\n\n#include \"CCParticleBatchNode.h\"\n#include \"ccTypes.h\"\n#include \"CCTextureCache.h\"\n#include \"CCTextureAtlas.h\"\n#include \"base64.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"platform/CCImage.h\"\n#include \"ZipUtils.h\"\n#include \"CCDirector.h\"\n#include \"CCProfiling.h\"\n// opengl\n#include \"CCGL.h\"\n\nusing namespace std;\n\n\nNS_CC_BEGIN\n\n// ideas taken from:\n//     . The ocean spray in your face [Jeff Lander]\n//        http://www.double.co.nz/dust/col0798.pdf\n//     . Building an Advanced Particle System [John van der Burg]\n//        http://www.gamasutra.com/features/20000623/vanderburg_01.htm\n//   . LOVE game engine\n//        http://love2d.org/\n//\n//\n// Radius mode support, from 71 squared\n//        http://particledesigner.71squared.com/\n//\n// IMPORTANT: Particle Designer is supported by cocos2d, but\n// 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,\n//  cocos2d uses a another approach, but the results are almost identical. \n//\n\nParticleSystem::ParticleSystem()\n: _isBlendAdditive(false)\n, _isAutoRemoveOnFinish(false)\n, _plistFile(\"\")\n, _elapsed(0)\n, _particles(nullptr)\n, _configName(\"\")\n, _emitCounter(0)\n, _particleIdx(0)\n, _batchNode(nullptr)\n, _atlasIndex(0)\n, _transformSystemDirty(false)\n, _allocatedParticles(0)\n, _isActive(true)\n, _particleCount(0)\n, _duration(0)\n, _sourcePosition(Point::ZERO)\n, _posVar(Point::ZERO)\n, _life(0)\n, _lifeVar(0)\n, _angle(0)\n, _angleVar(0)\n, _emitterMode(Mode::GRAVITY)\n, _startSize(0)\n, _startSizeVar(0)\n, _endSize(0)\n, _endSizeVar(0)\n, _startSpin(0)\n, _startSpinVar(0)\n, _endSpin(0)\n, _endSpinVar(0)\n, _emissionRate(0)\n, _totalParticles(0)\n, _texture(nullptr)\n, _blendFunc(BlendFunc::ALPHA_PREMULTIPLIED)\n, _opacityModifyRGB(false)\n, _yCoordFlipped(0)\n, _positionType(PositionType::FREE)\n{\n    modeA.gravity = Point::ZERO;\n    modeA.speed = 0;\n    modeA.speedVar = 0;\n    modeA.tangentialAccel = 0;\n    modeA.tangentialAccelVar = 0;\n    modeA.radialAccel = 0;\n    modeA.radialAccelVar = 0;\n    modeA.rotationIsDir = false;\n    modeB.startRadius = 0;\n    modeB.startRadiusVar = 0;\n    modeB.endRadius = 0;\n    modeB.endRadiusVar = 0;            \n    modeB.rotatePerSecond = 0;\n    modeB.rotatePerSecondVar = 0;\n}\n// implementation ParticleSystem\n\nParticleSystem * ParticleSystem::create(const std::string& plistFile)\n{\n    ParticleSystem *ret = new ParticleSystem();\n    if (ret && ret->initWithFile(plistFile))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return ret;\n}\n\nParticleSystem* ParticleSystem::createWithTotalParticles(int numberOfParticles)\n{\n    ParticleSystem *ret = new ParticleSystem();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return ret;\n}\n\nbool ParticleSystem::init()\n{\n    return initWithTotalParticles(150);\n}\n\nbool ParticleSystem::initWithFile(const std::string& plistFile)\n{\n    bool ret = false;\n    _plistFile = FileUtils::getInstance()->fullPathForFilename(plistFile);\n    ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(_plistFile.c_str());\n\n    CCASSERT( !dict.empty(), \"Particles: file not found\");\n    \n    // XXX compute path from a path, should define a function somewhere to do it\n    string listFilePath = plistFile;\n    if (listFilePath.find('/') != string::npos)\n    {\n        listFilePath = listFilePath.substr(0, listFilePath.rfind('/') + 1);\n        ret = this->initWithDictionary(dict, listFilePath.c_str());\n    }\n    else\n    {\n        ret = this->initWithDictionary(dict, \"\");\n    }\n    \n    return ret;\n}\n\nbool ParticleSystem::initWithDictionary(ValueMap& dictionary)\n{\n    return initWithDictionary(dictionary, \"\");\n}\n\nbool ParticleSystem::initWithDictionary(ValueMap& dictionary, const std::string& dirname)\n{\n    bool ret = false;\n    unsigned char *buffer = nullptr;\n    unsigned char *deflated = nullptr;\n    Image *image = nullptr;\n    do \n    {\n        int maxParticles = dictionary[\"maxParticles\"].asInt();\n        // self, not super\n        if(this->initWithTotalParticles(maxParticles))\n        {\n            // Emitter name in particle designer 2.0\n            _configName = dictionary[\"configName\"].asString();\n\n            // angle\n            _angle = dictionary[\"angle\"].asFloat();\n            _angleVar = dictionary[\"angleVariance\"].asFloat();\n\n            // duration\n            _duration = dictionary[\"duration\"].asFloat();\n\n            // blend function \n            if (_configName.length()>0)\n            {\n                _blendFunc.src = dictionary[\"blendFuncSource\"].asFloat();\n            }\n            else\n            {\n                _blendFunc.src = dictionary[\"blendFuncSource\"].asInt();\n            }\n            _blendFunc.dst = dictionary[\"blendFuncDestination\"].asInt();\n\n            // color\n            _startColor.r = dictionary[\"startColorRed\"].asFloat();\n            _startColor.g = dictionary[\"startColorGreen\"].asFloat();\n            _startColor.b = dictionary[\"startColorBlue\"].asFloat();\n            _startColor.a = dictionary[\"startColorAlpha\"].asFloat();\n\n            _startColorVar.r = dictionary[\"startColorVarianceRed\"].asFloat();\n            _startColorVar.g = dictionary[\"startColorVarianceGreen\"].asFloat();\n            _startColorVar.b = dictionary[\"startColorVarianceBlue\"].asFloat();\n            _startColorVar.a = dictionary[\"startColorVarianceAlpha\"].asFloat();\n\n            _endColor.r = dictionary[\"finishColorRed\"].asFloat();\n            _endColor.g = dictionary[\"finishColorGreen\"].asFloat();\n            _endColor.b = dictionary[\"finishColorBlue\"].asFloat();\n            _endColor.a = dictionary[\"finishColorAlpha\"].asFloat();\n\n            _endColorVar.r = dictionary[\"finishColorVarianceRed\"].asFloat();\n            _endColorVar.g = dictionary[\"finishColorVarianceGreen\"].asFloat();\n            _endColorVar.b = dictionary[\"finishColorVarianceBlue\"].asFloat();\n            _endColorVar.a = dictionary[\"finishColorVarianceAlpha\"].asFloat();\n\n            // particle size\n            _startSize = dictionary[\"startParticleSize\"].asFloat();\n            _startSizeVar = dictionary[\"startParticleSizeVariance\"].asFloat();\n            _endSize = dictionary[\"finishParticleSize\"].asFloat();\n            _endSizeVar = dictionary[\"finishParticleSizeVariance\"].asFloat();\n\n            // position\n            float x = dictionary[\"sourcePositionx\"].asFloat();\n            float y = dictionary[\"sourcePositiony\"].asFloat();\n            this->setPosition( Point(x,y) );            \n            _posVar.x = dictionary[\"sourcePositionVariancex\"].asFloat();\n            _posVar.y = dictionary[\"sourcePositionVariancey\"].asFloat();\n\n            // Spinning\n            _startSpin = dictionary[\"rotationStart\"].asFloat();\n            _startSpinVar = dictionary[\"rotationStartVariance\"].asFloat();\n            _endSpin= dictionary[\"rotationEnd\"].asFloat();\n            _endSpinVar= dictionary[\"rotationEndVariance\"].asFloat();\n\n            _emitterMode = (Mode) dictionary[\"emitterType\"].asInt();\n\n            // Mode A: Gravity + tangential accel + radial accel\n            if (_emitterMode == Mode::GRAVITY)\n            {\n                // gravity\n                modeA.gravity.x = dictionary[\"gravityx\"].asFloat();\n                modeA.gravity.y = dictionary[\"gravityy\"].asFloat();\n\n                // speed\n                modeA.speed = dictionary[\"speed\"].asFloat();\n                modeA.speedVar = dictionary[\"speedVariance\"].asFloat();\n\n                // radial acceleration\n                modeA.radialAccel = dictionary[\"radialAcceleration\"].asFloat();\n                modeA.radialAccelVar = dictionary[\"radialAccelVariance\"].asFloat();\n\n                // tangential acceleration\n                modeA.tangentialAccel = dictionary[\"tangentialAcceleration\"].asFloat();\n                modeA.tangentialAccelVar = dictionary[\"tangentialAccelVariance\"].asFloat();\n                \n                // rotation is dir\n                modeA.rotationIsDir = dictionary[\"rotationIsDir\"].asBool();\n            }\n\n            // or Mode B: radius movement\n            else if (_emitterMode == Mode::RADIUS)\n            {\n                if (_configName.length()>0)\n                {\n                    modeB.startRadius = dictionary[\"maxRadius\"].asInt();\n                }\n                else\n                {\n                    modeB.startRadius = dictionary[\"maxRadius\"].asFloat();\n                }\n                modeB.startRadiusVar = dictionary[\"maxRadiusVariance\"].asFloat();\n                if (_configName.length()>0)\n                {\n                    modeB.endRadius = dictionary[\"minRadius\"].asInt();\n                }\n                else\n                {\n                    modeB.endRadius = dictionary[\"minRadius\"].asFloat();\n                }\n                modeB.endRadiusVar = 0.0f;\n               if (_configName.length()>0)\n                {\n                    modeB.rotatePerSecond = dictionary[\"rotatePerSecond\"].asInt();\n                }\n                else\n                {\n                    modeB.rotatePerSecond = dictionary[\"rotatePerSecond\"].asFloat();\n                }\n                modeB.rotatePerSecondVar = dictionary[\"rotatePerSecondVariance\"].asFloat();\n\n            } else {\n                CCASSERT( false, \"Invalid emitterType in config file\");\n                CC_BREAK_IF(true);\n            }\n\n            // life span\n            _life = dictionary[\"particleLifespan\"].asFloat();\n            _lifeVar = dictionary[\"particleLifespanVariance\"].asFloat();\n\n            // emission Rate\n            _emissionRate = _totalParticles / _life;\n\n            //don't get the internal texture if a batchNode is used\n            if (!_batchNode)\n            {\n                // Set a compatible default for the alpha transfer\n                _opacityModifyRGB = false;\n\n                // texture        \n                // Try to get the texture from the cache\n                std::string textureName = dictionary[\"textureFileName\"].asString();\n                \n                size_t rPos = textureName.rfind('/');\n               \n                if (rPos != string::npos)\n                {\n                    string textureDir = textureName.substr(0, rPos + 1);\n                    \n                    if (!dirname.empty() && textureDir != dirname)\n                    {\n                        textureName = textureName.substr(rPos+1);\n                        textureName = dirname + textureName;\n                    }\n                }\n                else if (!dirname.empty() && !textureName.empty())\n                {\n                \ttextureName = dirname + textureName;\n                }\n                \n                Texture2D *tex = nullptr;\n                \n                if (textureName.length() > 0)\n                {\n                    // set not pop-up message box when load image failed\n                    bool notify = FileUtils::getInstance()->isPopupNotify();\n                    FileUtils::getInstance()->setPopupNotify(false);\n                    tex = Director::getInstance()->getTextureCache()->addImage(textureName);\n                    // reset the value of UIImage notify\n                    FileUtils::getInstance()->setPopupNotify(notify);\n                }\n                \n                if (tex)\n                {\n                    setTexture(tex);\n                }\n                else\n                {                        \n                    std::string textureData = dictionary[\"textureImageData\"].asString();\n                    CCASSERT(!textureData.empty(), \"\");\n                    \n                    auto dataLen = textureData.size();\n                    if (dataLen != 0)\n                    {\n                        // if it fails, try to get it from the base64-gzipped data    \n                        int decodeLen = base64Decode((unsigned char*)textureData.c_str(), (unsigned int)dataLen, &buffer);\n                        CCASSERT( buffer != nullptr, \"CCParticleSystem: error decoding textureImageData\");\n                        CC_BREAK_IF(!buffer);\n                        \n                        ssize_t deflatedLen = ZipUtils::inflateMemory(buffer, decodeLen, &deflated);\n                        CCASSERT( deflated != nullptr, \"CCParticleSystem: error ungzipping textureImageData\");\n                        CC_BREAK_IF(!deflated);\n                        \n                        // For android, we should retain it in VolatileTexture::addImage which invoked in Director::getInstance()->getTextureCache()->addUIImage()\n                        image = new Image();\n                        bool isOK = image->initWithImageData(deflated, deflatedLen);\n                        CCASSERT(isOK, \"CCParticleSystem: error init image with Data\");\n                        CC_BREAK_IF(!isOK);\n                        \n                        setTexture(Director::getInstance()->getTextureCache()->addImage(image, textureName.c_str()));\n\n                        image->release();\n                    }\n                }\n                \n                if (!_configName.empty())\n                {\n                    _yCoordFlipped = dictionary[\"yCoordFlipped\"].asInt();\n                }\n                \n                CCASSERT( this->_texture != nullptr, \"CCParticleSystem: error loading the texture\");\n            }\n            ret = true;\n        }\n    } while (0);\n    free(buffer);\n    free(deflated);\n    return ret;\n}\n\nbool ParticleSystem::initWithTotalParticles(int numberOfParticles)\n{\n    _totalParticles = numberOfParticles;\n\n    CC_SAFE_FREE(_particles);\n    \n    _particles = (tParticle*)calloc(_totalParticles, sizeof(tParticle));\n\n    if( ! _particles )\n    {\n        CCLOG(\"Particle system: not enough memory\");\n        this->release();\n        return false;\n    }\n    _allocatedParticles = numberOfParticles;\n\n    if (_batchNode)\n    {\n        for (int i = 0; i < _totalParticles; i++)\n        {\n            _particles[i].atlasIndex=i;\n        }\n    }\n    // default, active\n    _isActive = true;\n\n    // default blend function\n    _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n\n    // default movement type;\n    _positionType = PositionType::FREE;\n\n    // by default be in mode A:\n    _emitterMode = Mode::GRAVITY;\n\n    // default: modulate\n    // XXX: not used\n    //    colorModulate = YES;\n\n    _isAutoRemoveOnFinish = false;\n\n    // Optimization: compile updateParticle method\n    //updateParticleSel = @selector(updateQuadWithParticle:newPosition:);\n    //updateParticleImp = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel];\n    //for batchNode\n    _transformSystemDirty = false;\n    // update after action in run!\n    this->scheduleUpdateWithPriority(1);\n\n    return true;\n}\n\nParticleSystem::~ParticleSystem()\n{\n    // Since the scheduler retains the \"target (in this case the ParticleSystem)\n\t// it is not needed to call \"unscheduleUpdate\" here. In fact, it will be called in \"cleanup\"\n    //unscheduleUpdate();\n    CC_SAFE_FREE(_particles);\n    CC_SAFE_RELEASE(_texture);\n}\n\nbool ParticleSystem::addParticle()\n{\n    if (this->isFull())\n    {\n        return false;\n    }\n\n    tParticle * particle = &_particles[ _particleCount ];\n    this->initParticle(particle);\n    ++_particleCount;\n\n    return true;\n}\n\nvoid ParticleSystem::initParticle(tParticle* particle)\n{\n    // timeToLive\n    // no negative life. prevent division by 0\n    particle->timeToLive = _life + _lifeVar * CCRANDOM_MINUS1_1();\n    particle->timeToLive = MAX(0, particle->timeToLive);\n\n    // position\n    particle->pos.x = _sourcePosition.x + _posVar.x * CCRANDOM_MINUS1_1();\n\n    particle->pos.y = _sourcePosition.y + _posVar.y * CCRANDOM_MINUS1_1();\n\n\n    // Color\n    Color4F start;\n    start.r = clampf(_startColor.r + _startColorVar.r * CCRANDOM_MINUS1_1(), 0, 1);\n    start.g = clampf(_startColor.g + _startColorVar.g * CCRANDOM_MINUS1_1(), 0, 1);\n    start.b = clampf(_startColor.b + _startColorVar.b * CCRANDOM_MINUS1_1(), 0, 1);\n    start.a = clampf(_startColor.a + _startColorVar.a * CCRANDOM_MINUS1_1(), 0, 1);\n\n    Color4F end;\n    end.r = clampf(_endColor.r + _endColorVar.r * CCRANDOM_MINUS1_1(), 0, 1);\n    end.g = clampf(_endColor.g + _endColorVar.g * CCRANDOM_MINUS1_1(), 0, 1);\n    end.b = clampf(_endColor.b + _endColorVar.b * CCRANDOM_MINUS1_1(), 0, 1);\n    end.a = clampf(_endColor.a + _endColorVar.a * CCRANDOM_MINUS1_1(), 0, 1);\n\n    particle->color = start;\n    particle->deltaColor.r = (end.r - start.r) / particle->timeToLive;\n    particle->deltaColor.g = (end.g - start.g) / particle->timeToLive;\n    particle->deltaColor.b = (end.b - start.b) / particle->timeToLive;\n    particle->deltaColor.a = (end.a - start.a) / particle->timeToLive;\n\n    // size\n    float startS = _startSize + _startSizeVar * CCRANDOM_MINUS1_1();\n    startS = MAX(0, startS); // No negative value\n\n    particle->size = startS;\n\n    if (_endSize == START_SIZE_EQUAL_TO_END_SIZE)\n    {\n        particle->deltaSize = 0;\n    }\n    else\n    {\n        float endS = _endSize + _endSizeVar * CCRANDOM_MINUS1_1();\n        endS = MAX(0, endS); // No negative values\n        particle->deltaSize = (endS - startS) / particle->timeToLive;\n    }\n\n    // rotation\n    float startA = _startSpin + _startSpinVar * CCRANDOM_MINUS1_1();\n    float endA = _endSpin + _endSpinVar * CCRANDOM_MINUS1_1();\n    particle->rotation = startA;\n    particle->deltaRotation = (endA - startA) / particle->timeToLive;\n\n    // position\n    if (_positionType == PositionType::FREE)\n    {\n        particle->startPos = this->convertToWorldSpace(Point::ZERO);\n    }\n    else if (_positionType == PositionType::RELATIVE)\n    {\n        particle->startPos = _position;\n    }\n\n    // direction\n    float a = CC_DEGREES_TO_RADIANS( _angle + _angleVar * CCRANDOM_MINUS1_1() );    \n\n    // Mode Gravity: A\n    if (_emitterMode == Mode::GRAVITY)\n    {\n        Point v(cosf( a ), sinf( a ));\n        float s = modeA.speed + modeA.speedVar * CCRANDOM_MINUS1_1();\n\n        // direction\n        particle->modeA.dir = v * s ;\n\n        // radial accel\n        particle->modeA.radialAccel = modeA.radialAccel + modeA.radialAccelVar * CCRANDOM_MINUS1_1();\n \n\n        // tangential accel\n        particle->modeA.tangentialAccel = modeA.tangentialAccel + modeA.tangentialAccelVar * CCRANDOM_MINUS1_1();\n\n        // rotation is dir\n        if(modeA.rotationIsDir)\n            particle->rotation = -CC_RADIANS_TO_DEGREES(particle->modeA.dir.getAngle());\n    }\n\n    // Mode Radius: B\n    else \n    {\n        // Set the default diameter of the particle from the source position\n        float startRadius = modeB.startRadius + modeB.startRadiusVar * CCRANDOM_MINUS1_1();\n        float endRadius = modeB.endRadius + modeB.endRadiusVar * CCRANDOM_MINUS1_1();\n\n        particle->modeB.radius = startRadius;\n\n        if (modeB.endRadius == START_RADIUS_EQUAL_TO_END_RADIUS)\n        {\n            particle->modeB.deltaRadius = 0;\n        }\n        else\n        {\n            particle->modeB.deltaRadius = (endRadius - startRadius) / particle->timeToLive;\n        }\n\n        particle->modeB.angle = a;\n        particle->modeB.degreesPerSecond = CC_DEGREES_TO_RADIANS(modeB.rotatePerSecond + modeB.rotatePerSecondVar * CCRANDOM_MINUS1_1());\n    }    \n}\n\nvoid ParticleSystem::stopSystem()\n{\n    _isActive = false;\n    _elapsed = _duration;\n    _emitCounter = 0;\n}\n\nvoid ParticleSystem::resetSystem()\n{\n    _isActive = true;\n    _elapsed = 0;\n    for (_particleIdx = 0; _particleIdx < _particleCount; ++_particleIdx)\n    {\n        tParticle *p = &_particles[_particleIdx];\n        p->timeToLive = 0;\n    }\n}\nbool ParticleSystem::isFull()\n{\n    return (_particleCount == _totalParticles);\n}\n\n// ParticleSystem - MainLoop\nvoid ParticleSystem::update(float dt)\n{\n    CC_PROFILER_START_CATEGORY(kProfilerCategoryParticles , \"CCParticleSystem - update\");\n\n    if (_isActive && _emissionRate)\n    {\n        float rate = 1.0f / _emissionRate;\n        //issue #1201, prevent bursts of particles, due to too high emitCounter\n        if (_particleCount < _totalParticles)\n        {\n            _emitCounter += dt;\n        }\n        \n        while (_particleCount < _totalParticles && _emitCounter > rate) \n        {\n            this->addParticle();\n            _emitCounter -= rate;\n        }\n\n        _elapsed += dt;\n        if (_duration != -1 && _duration < _elapsed)\n        {\n            this->stopSystem();\n        }\n    }\n\n    _particleIdx = 0;\n\n    Point currentPosition = Point::ZERO;\n    if (_positionType == PositionType::FREE)\n    {\n        currentPosition = this->convertToWorldSpace(Point::ZERO);\n    }\n    else if (_positionType == PositionType::RELATIVE)\n    {\n        currentPosition = _position;\n    }\n\n    if (_visible)\n    {\n        while (_particleIdx < _particleCount)\n        {\n            tParticle *p = &_particles[_particleIdx];\n\n            // life\n            p->timeToLive -= dt;\n\n            if (p->timeToLive > 0) \n            {\n                // Mode A: gravity, direction, tangential accel & radial accel\n                if (_emitterMode == Mode::GRAVITY)\n                {\n                    Point tmp, radial, tangential;\n\n                    radial = Point::ZERO;\n                    // radial acceleration\n                    if (p->pos.x || p->pos.y)\n                    {\n                        radial = p->pos.normalize();\n                    }\n                    tangential = radial;\n                    radial = radial * p->modeA.radialAccel;\n\n                    // tangential acceleration\n                    float newy = tangential.x;\n                    tangential.x = -tangential.y;\n                    tangential.y = newy;\n                    tangential = tangential * p->modeA.tangentialAccel;\n\n                    // (gravity + radial + tangential) * dt\n                    tmp = radial + tangential + modeA.gravity;\n                    tmp = tmp * dt;\n                    p->modeA.dir = p->modeA.dir + tmp;\n\t\t\t\t\tif (_configName.length()>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (_yCoordFlipped == -1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t tmp = p->modeA.dir * dt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t tmp = p->modeA.dir * -dt;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t tmp = p->modeA.dir * dt;\n\t\t\t\t\t}\n                    p->pos = p->pos + tmp;\n                }\n\n                // Mode B: radius movement\n                else \n                {                \n                    // Update the angle and radius of the particle.\n                    p->modeB.angle += p->modeB.degreesPerSecond * dt;\n                    p->modeB.radius += p->modeB.deltaRadius * dt;\n\n                    p->pos.x = - cosf(p->modeB.angle) * p->modeB.radius;\n                    p->pos.y = - sinf(p->modeB.angle) * p->modeB.radius;\n                    if (_yCoordFlipped == 1)\n                    {\n                      p->pos.y = -p->pos.y;\n                    }\n\t\t\t\t}\n\n                // color\n                p->color.r += (p->deltaColor.r * dt);\n                p->color.g += (p->deltaColor.g * dt);\n                p->color.b += (p->deltaColor.b * dt);\n                p->color.a += (p->deltaColor.a * dt);\n\n                // size\n                p->size += (p->deltaSize * dt);\n                p->size = MAX( 0, p->size );\n\n                // angle\n                p->rotation += (p->deltaRotation * dt);\n\n                //\n                // update values in quad\n                //\n\n                Point    newPos;\n\n                if (_positionType == PositionType::FREE || _positionType == PositionType::RELATIVE)\n                {\n                    Point diff = currentPosition - p->startPos;\n                    newPos = p->pos - diff;\n                } \n                else\n                {\n                    newPos = p->pos;\n                }\n\n                // translate newPos to correct position, since matrix transform isn't performed in batchnode\n                // don't update the particle with the new position information, it will interfere with the radius and tangential calculations\n                if (_batchNode)\n                {\n                    newPos.x+=_position.x;\n                    newPos.y+=_position.y;\n                }\n\n                updateQuadWithParticle(p, newPos);\n                //updateParticleImp(self, updateParticleSel, p, newPos);\n\n                // update particle counter\n                ++_particleIdx;\n            } \n            else \n            {\n                // life < 0\n                int currentIndex = p->atlasIndex;\n                if( _particleIdx != _particleCount-1 )\n                {\n                    _particles[_particleIdx] = _particles[_particleCount-1];\n                }\n                if (_batchNode)\n                {\n                    //disable the switched particle\n                    _batchNode->disableParticle(_atlasIndex+currentIndex);\n\n                    //switch indexes\n                    _particles[_particleCount-1].atlasIndex = currentIndex;\n                }\n\n\n                --_particleCount;\n\n                if( _particleCount == 0 && _isAutoRemoveOnFinish )\n                {\n                    this->unscheduleUpdate();\n                    _parent->removeChild(this, true);\n                    return;\n                }\n            }\n        } //while\n        _transformSystemDirty = false;\n    }\n    if (! _batchNode)\n    {\n        postStep();\n    }\n\n    CC_PROFILER_STOP_CATEGORY(kProfilerCategoryParticles , \"CCParticleSystem - update\");\n}\n\nvoid ParticleSystem::updateWithNoTime(void)\n{\n    this->update(0.0f);\n}\n\nvoid ParticleSystem::updateQuadWithParticle(tParticle* particle, const Point& newPosition)\n{\n    CC_UNUSED_PARAM(particle);\n    CC_UNUSED_PARAM(newPosition);\n    // should be overridden\n}\n\nvoid ParticleSystem::postStep()\n{\n    // should be overridden\n}\n\n// ParticleSystem - Texture protocol\nvoid ParticleSystem::setTexture(Texture2D* var)\n{\n    if (_texture != var)\n    {\n        CC_SAFE_RETAIN(var);\n        CC_SAFE_RELEASE(_texture);\n        _texture = var;\n        updateBlendFunc();\n    }\n}\n\nvoid ParticleSystem::updateBlendFunc()\n{\n    CCASSERT(! _batchNode, \"Can't change blending functions when the particle is being batched\");\n\n    if(_texture)\n    {\n        bool premultiplied = _texture->hasPremultipliedAlpha();\n        \n        _opacityModifyRGB = false;\n        \n        if( _texture && ( _blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST ) )\n        {\n            if( premultiplied )\n            {\n                _opacityModifyRGB = true;\n            }\n            else\n            {\n                _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n            }\n        }\n    }\n}\n\nTexture2D * ParticleSystem::getTexture() const\n{\n    return _texture;\n}\n\n// ParticleSystem - Additive Blending\nvoid ParticleSystem::setBlendAdditive(bool additive)\n{\n    if( additive )\n    {\n        _blendFunc = BlendFunc::ADDITIVE;\n    }\n    else\n    {\n        if( _texture && ! _texture->hasPremultipliedAlpha() )\n            _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n        else \n            _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n    }\n}\n\nbool ParticleSystem::isBlendAdditive() const\n{\n    return( _blendFunc.src == GL_SRC_ALPHA && _blendFunc.dst == GL_ONE);\n}\n\n// ParticleSystem - Properties of Gravity Mode \nvoid ParticleSystem::setTangentialAccel(float t)\n{\n    CCASSERT( _emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.tangentialAccel = t;\n}\n\nfloat ParticleSystem::getTangentialAccel() const\n{\n    CCASSERT( _emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.tangentialAccel;\n}\n\nvoid ParticleSystem::setTangentialAccelVar(float t)\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.tangentialAccelVar = t;\n}\n\nfloat ParticleSystem::getTangentialAccelVar() const\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.tangentialAccelVar;\n}    \n\nvoid ParticleSystem::setRadialAccel(float t)\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.radialAccel = t;\n}\n\nfloat ParticleSystem::getRadialAccel() const\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.radialAccel;\n}\n\nvoid ParticleSystem::setRadialAccelVar(float t)\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.radialAccelVar = t;\n}\n\nfloat ParticleSystem::getRadialAccelVar() const\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.radialAccelVar;\n}\n\nvoid ParticleSystem::setRotationIsDir(bool t)\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.rotationIsDir = t;\n}\n\nbool ParticleSystem::getRotationIsDir() const\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.rotationIsDir;\n}\n\nvoid ParticleSystem::setGravity(const Point& g)\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.gravity = g;\n}\n\nconst Point& ParticleSystem::getGravity()\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.gravity;\n}\n\nvoid ParticleSystem::setSpeed(float speed)\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.speed = speed;\n}\n\nfloat ParticleSystem::getSpeed() const\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.speed;\n}\n\nvoid ParticleSystem::setSpeedVar(float speedVar)\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    modeA.speedVar = speedVar;\n}\n\nfloat ParticleSystem::getSpeedVar() const\n{\n    CCASSERT(_emitterMode == Mode::GRAVITY, \"Particle Mode should be Gravity\");\n    return modeA.speedVar;\n}\n\n// ParticleSystem - Properties of Radius Mode\nvoid ParticleSystem::setStartRadius(float startRadius)\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    modeB.startRadius = startRadius;\n}\n\nfloat ParticleSystem::getStartRadius() const\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    return modeB.startRadius;\n}\n\nvoid ParticleSystem::setStartRadiusVar(float startRadiusVar)\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    modeB.startRadiusVar = startRadiusVar;\n}\n\nfloat ParticleSystem::getStartRadiusVar() const\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    return modeB.startRadiusVar;\n}\n\nvoid ParticleSystem::setEndRadius(float endRadius)\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    modeB.endRadius = endRadius;\n}\n\nfloat ParticleSystem::getEndRadius() const\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    return modeB.endRadius;\n}\n\nvoid ParticleSystem::setEndRadiusVar(float endRadiusVar)\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    modeB.endRadiusVar = endRadiusVar;\n}\n\nfloat ParticleSystem::getEndRadiusVar() const\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    return modeB.endRadiusVar;\n}\n\nvoid ParticleSystem::setRotatePerSecond(float degrees)\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    modeB.rotatePerSecond = degrees;\n}\n\nfloat ParticleSystem::getRotatePerSecond() const\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    return modeB.rotatePerSecond;\n}\n\nvoid ParticleSystem::setRotatePerSecondVar(float degrees)\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    modeB.rotatePerSecondVar = degrees;\n}\n\nfloat ParticleSystem::getRotatePerSecondVar() const\n{\n    CCASSERT(_emitterMode == Mode::RADIUS, \"Particle Mode should be Radius\");\n    return modeB.rotatePerSecondVar;\n}\n\nbool ParticleSystem::isActive() const\n{\n    return _isActive;\n}\n\nint ParticleSystem::getTotalParticles() const\n{\n    return _totalParticles;\n}\n\nvoid ParticleSystem::setTotalParticles(int var)\n{\n    CCASSERT( var <= _allocatedParticles, \"Particle: resizing particle array only supported for quads\");\n    _totalParticles = var;\n}\n\nconst BlendFunc& ParticleSystem::getBlendFunc() const\n{\n    return _blendFunc;\n}\n\nvoid ParticleSystem::setBlendFunc(const BlendFunc &blendFunc)\n{\n    if( _blendFunc.src != blendFunc.src || _blendFunc.dst != blendFunc.dst ) {\n        _blendFunc = blendFunc;\n        this->updateBlendFunc();\n    }\n}\n\nbool ParticleSystem::isAutoRemoveOnFinish() const\n{\n    return _isAutoRemoveOnFinish;\n}\n\nvoid ParticleSystem::setAutoRemoveOnFinish(bool var)\n{\n    _isAutoRemoveOnFinish = var;\n}\n\n\n// ParticleSystem - methods for batchNode rendering\n\nParticleBatchNode* ParticleSystem::getBatchNode(void) const\n{\n    return _batchNode;\n}\n\nvoid ParticleSystem::setBatchNode(ParticleBatchNode* batchNode)\n{\n    if( _batchNode != batchNode ) {\n\n        _batchNode = batchNode; // weak reference\n\n        if( batchNode ) {\n            //each particle needs a unique index\n            for (int i = 0; i < _totalParticles; i++)\n            {\n                _particles[i].atlasIndex=i;\n            }\n        }\n    }\n}\n\n//don't use a transform matrix, this is faster\nvoid ParticleSystem::setScale(float s)\n{\n    _transformSystemDirty = true;\n    Node::setScale(s);\n}\n\nvoid ParticleSystem::setRotation(float newRotation)\n{\n    _transformSystemDirty = true;\n    Node::setRotation(newRotation);\n}\n\nvoid ParticleSystem::setScaleX(float newScaleX)\n{\n    _transformSystemDirty = true;\n    Node::setScaleX(newScaleX);\n}\n\nvoid ParticleSystem::setScaleY(float newScaleY)\n{\n    _transformSystemDirty = true;\n    Node::setScaleY(newScaleY);\n}\n\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleSystem.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCPARTICLE_SYSTEM_H__\n#define __CCPARTICLE_SYSTEM_H__\n\n#include \"CCProtocols.h\"\n#include \"CCNode.h\"\n#include \"CCValue.h\"\n#include \"CCString.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup particle_nodes\n * @{\n */\n\nclass ParticleBatchNode;\n\n/**\nStructure that contains the values of each particle\n*/\ntypedef struct sParticle {\n    Point     pos;\n    Point     startPos;\n\n    Color4F    color;\n    Color4F    deltaColor;\n\n    float        size;\n    float        deltaSize;\n\n    float        rotation;\n    float        deltaRotation;\n\n    float        timeToLive;\n\n    unsigned int    atlasIndex;\n\n    //! Mode A: gravity, direction, radial accel, tangential accel\n    struct {\n        Point        dir;\n        float        radialAccel;\n        float        tangentialAccel;\n    } modeA;\n\n    //! Mode B: radius mode\n    struct {\n        float        angle;\n        float        degreesPerSecond;\n        float        radius;\n        float        deltaRadius;\n    } modeB;\n\n}tParticle;\n\n//typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tParticle*, Point);\n\nclass Texture2D;\n\n/** @brief Particle System base class.\nAttributes of a Particle System:\n- emission rate of the particles\n- Gravity Mode (Mode A):\n- gravity\n- direction\n- speed +-  variance\n- tangential acceleration +- variance\n- radial acceleration +- variance\n- Radius Mode (Mode B):\n- startRadius +- variance\n- endRadius +- variance\n- rotate +- variance\n- Properties common to all modes:\n- life +- life variance\n- start spin +- variance\n- end spin +- variance\n- start size +- variance\n- end size +- variance\n- start color +- variance\n- end color +- variance\n- life +- variance\n- blending function\n- texture\n\ncocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).\n'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guaranteed in cocos2d,\ncocos2d uses a another approach, but the results are almost identical. \n\ncocos2d supports all the variables used by Particle Designer plus a bit more:\n- spinning particles (supported when using ParticleSystemQuad)\n- tangential acceleration (Gravity mode)\n- radial acceleration (Gravity mode)\n- radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only)\n\nIt is possible to customize any of the above mentioned properties in runtime. Example:\n\n@code\nemitter.radialAccel = 15;\nemitter.startSpin = 0;\n@endcode\n\n*/\nclass CC_DLL ParticleSystem : public Node, public TextureProtocol\n{\npublic:\n    enum class Mode\n    {\n        GRAVITY,\n        RADIUS,\n    };\n    \n    /** @typedef PositionType\n     possible types of particle positions\n     */\n    enum class PositionType\n    {\n        /** Living particles are attached to the world and are unaffected by emitter repositioning. */\n        FREE,\n        \n        /** Living particles are attached to the world but will follow the emitter repositioning.\n         Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite.\n         */\n        RELATIVE,\n        \n        /** Living particles are attached to the emitter and are translated along with it. */\n        GROUPED,\n    };\n    \n    //* @enum\n    enum {\n        /** The Particle emitter lives forever */\n        DURATION_INFINITY = -1,\n        \n        /** The starting size of the particle is equal to the ending size */\n        START_SIZE_EQUAL_TO_END_SIZE = -1,\n        \n        /** The starting radius of the particle is equal to the ending radius */\n        START_RADIUS_EQUAL_TO_END_RADIUS = -1,\n    };\n    \n    /** creates an initializes a ParticleSystem from a plist file.\n    This plist files can be created manually or with Particle Designer:\n    http://particledesigner.71squared.com/\n    @since v2.0\n    */\n    static ParticleSystem * create(const std::string& plistFile);\n\n    //! create a system with a fixed number of particles\n    static ParticleSystem* createWithTotalParticles(int numberOfParticles);\n\n    //! Add a particle to the emitter\n    bool addParticle();\n    //! Initializes a particle\n    void initParticle(tParticle* particle);\n    //! stop emitting particles. Running particles will continue to run until they die\n    void stopSystem();\n    //! Kill all living particles.\n    void resetSystem();\n    //! whether or not the system is full\n    bool isFull();\n\n    //! should be overridden by subclasses\n    virtual void updateQuadWithParticle(tParticle* particle, const Point& newPosition);\n    //! should be overridden by subclasses\n    virtual void postStep();\n\n    virtual void updateWithNoTime(void);\n\n    virtual bool isAutoRemoveOnFinish() const;\n    virtual void setAutoRemoveOnFinish(bool var);\n\n    // mode A\n    virtual const Point& getGravity();\n    virtual void setGravity(const Point& g);\n    virtual float getSpeed() const;\n    virtual void setSpeed(float speed);\n    virtual float getSpeedVar() const;\n    virtual void setSpeedVar(float speed);\n    virtual float getTangentialAccel() const;\n    virtual void setTangentialAccel(float t);\n    virtual float getTangentialAccelVar() const;\n    virtual void setTangentialAccelVar(float t);\n    virtual float getRadialAccel() const;\n    virtual void setRadialAccel(float t);\n    virtual float getRadialAccelVar() const;\n    virtual void setRadialAccelVar(float t);\n    virtual bool getRotationIsDir() const;\n    virtual void setRotationIsDir(bool t);\n    // mode B\n    virtual float getStartRadius() const;\n    virtual void setStartRadius(float startRadius);\n    virtual float getStartRadiusVar() const;\n    virtual void setStartRadiusVar(float startRadiusVar);\n    virtual float getEndRadius() const;\n    virtual void setEndRadius(float endRadius);\n    virtual float getEndRadiusVar() const;\n    virtual void setEndRadiusVar(float endRadiusVar);\n    virtual float getRotatePerSecond() const;\n    virtual void setRotatePerSecond(float degrees);\n    virtual float getRotatePerSecondVar() const;\n    virtual void setRotatePerSecondVar(float degrees);\n\n    virtual void setScale(float s);\n    virtual void setRotation(float newRotation);\n    virtual void setScaleX(float newScaleX);\n    virtual void setScaleY(float newScaleY);\n\n    virtual bool isActive() const;\n    virtual bool isBlendAdditive() const;\n    virtual void setBlendAdditive(bool value);\n\n    virtual ParticleBatchNode* getBatchNode() const;\n    virtual void setBatchNode(ParticleBatchNode* batchNode);\n    \n    // index of system in batch node array\n    inline int getAtlasIndex() const { return _atlasIndex; };\n    inline void setAtlasIndex(int index) { _atlasIndex = index; };\n\n    /** Quantity of particles that are being simulated at the moment */\n    inline unsigned int getParticleCount() const { return _particleCount; };\n    \n    /** How many seconds the emitter will run. -1 means 'forever' */\n    inline float getDuration() const { return _duration; };\n    inline void setDuration(float duration) { _duration = duration; };\n    \n    /** sourcePosition of the emitter */\n    inline const Point& getSourcePosition() const { return _sourcePosition; };\n    inline void setSourcePosition(const Point& pos) { _sourcePosition = pos; };\n    \n    /** Position variance of the emitter */\n    inline const Point& getPosVar() const { return _posVar; };\n    inline void setPosVar(const Point& pos) { _posVar = pos; };\n\n    /** life, and life variation of each particle */\n    inline float getLife() const { return _life; };\n    inline void setLife(float life) { _life = life; };\n\n    /** life variance of each particle */\n    inline float getLifeVar() const { return _lifeVar; };\n    inline void setLifeVar(float lifeVar) { _lifeVar = lifeVar; };\n\n    /** angle and angle variation of each particle */\n    inline float getAngle() const { return _angle; };\n    inline void setAngle(float angle) { _angle = angle; };\n\n    /** angle variance of each particle */\n    inline float getAngleVar() const { return _angleVar; };\n    inline void setAngleVar(float angleVar) { _angleVar = angleVar; };\n    \n    /** Switch between different kind of emitter modes:\n     - kParticleModeGravity: uses gravity, speed, radial and tangential acceleration\n     - kParticleModeRadius: uses radius movement + rotation\n     */\n    inline Mode getEmitterMode() const { return _emitterMode; };\n    inline void setEmitterMode(Mode mode) { _emitterMode = mode; };\n    \n    /** start size in pixels of each particle */\n    inline float getStartSize() const { return _startSize; };\n    inline void setStartSize(float startSize) { _startSize = startSize; };\n\n    /** size variance in pixels of each particle */\n    inline float getStartSizeVar() const { return _startSizeVar; };\n    inline void setStartSizeVar(float sizeVar) { _startSizeVar = sizeVar; };\n\n    /** end size in pixels of each particle */\n    inline float getEndSize() const { return _endSize; };\n    inline void setEndSize(float endSize) { _endSize = endSize; };\n\n    /** end size variance in pixels of each particle */\n    inline float getEndSizeVar() const { return _endSizeVar; };\n    inline void setEndSizeVar(float sizeVar) { _endSizeVar = sizeVar; };\n\n    /** start color of each particle */\n    inline const Color4F& getStartColor() const { return _startColor; };\n    inline void setStartColor(const Color4F& color) { _startColor = color; };\n\n    /** start color variance of each particle */\n    inline const Color4F& getStartColorVar() const { return _startColorVar; };\n    inline void setStartColorVar(const Color4F& color) { _startColorVar = color; };\n\n    /** end color and end color variation of each particle */\n    inline const Color4F& getEndColor() const { return _endColor; };\n    inline void setEndColor(const Color4F& color) { _endColor = color; };\n\n    /** end color variance of each particle */\n    inline const Color4F& getEndColorVar() const { return _endColorVar; };\n    inline void setEndColorVar(const Color4F& color) { _endColorVar = color; };\n\n    //* initial angle of each particle\n    inline float getStartSpin() const { return _startSpin; };\n    inline void setStartSpin(float spin) { _startSpin = spin; };\n\n    //* initial angle of each particle\n    inline float getStartSpinVar() const { return _startSpinVar; };\n    inline void setStartSpinVar(float pinVar) { _startSpinVar = pinVar; };\n\n    //* initial angle of each particle\n    inline float getEndSpin() const { return _endSpin; };\n    inline void setEndSpin(float endSpin) { _endSpin = endSpin; };\n\n    //* initial angle of each particle\n    inline float getEndSpinVar() const { return _endSpinVar; };\n    inline void setEndSpinVar(float endSpinVar) { _endSpinVar = endSpinVar; };\n\n    /** emission rate of the particles */\n    inline float getEmissionRate() const { return _emissionRate; };\n    inline void setEmissionRate(float rate) { _emissionRate = rate; };\n\n    /** maximum particles of the system */\n    virtual int getTotalParticles() const;\n    virtual void setTotalParticles(int totalParticles);\n\n    /** does the alpha value modify color */\n    inline void setOpacityModifyRGB(bool opacityModifyRGB) { _opacityModifyRGB = opacityModifyRGB; };\n    inline bool isOpacityModifyRGB() const { return _opacityModifyRGB; };\n    CC_DEPRECATED_ATTRIBUTE inline bool getOpacityModifyRGB() const { return isOpacityModifyRGB(); }\n    \n    /** particles movement type: Free or Grouped\n     @since v0.8\n     */\n    inline PositionType getPositionType() const { return _positionType; };\n    inline void setPositionType(PositionType type) { _positionType = type; };\n    \n    // Overrides\n    virtual void update(float dt) override;\n    virtual Texture2D* getTexture() const override;\n    virtual void setTexture(Texture2D *texture) override;\n    /**\n    *@code\n    *When this function bound into js or lua,the parameter will be changed\n    *In js: var setBlendFunc(var src, var dst)\n    *In lua: local setBlendFunc(local src, local dst)\n    *@endcode\n    */\n    virtual void setBlendFunc(const BlendFunc &blendFunc) override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const BlendFunc &getBlendFunc() const override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleSystem();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleSystem();\n\n    /** initializes a ParticleSystem*/\n    bool init();\n    /** initializes a ParticleSystem from a plist file.\n     This plist files can be created manually or with Particle Designer:\n     http://particledesigner.71squared.com/\n     @since v0.99.3\n     */\n    bool initWithFile(const std::string& plistFile);\n\n    /** initializes a QuadParticleSystem from a Dictionary.\n     @since v0.99.3\n     */\n    bool initWithDictionary(ValueMap& dictionary);\n\n    /** initializes a particle system from a NSDictionary and the path from where to load the png\n     @since v2.1\n     */\n    bool initWithDictionary(ValueMap& dictionary, const std::string& dirname);\n\n    //! Initializes a system with a fixed number of particles\n    virtual bool initWithTotalParticles(int numberOfParticles);\n\n    virtual void updateBlendFunc();\n\n    /** whether or not the particles are using blend additive.\n     If enabled, the following blending function will be used.\n     @code\n     source blend function = GL_SRC_ALPHA;\n     dest blend function = GL_ONE;\n     @endcode\n     */\n    bool _isBlendAdditive;\n\n    /** whether or not the node will be auto-removed when it has no particles left.\n     By default it is false.\n     @since v0.8\n     */\n    bool _isAutoRemoveOnFinish;\n\n    std::string _plistFile;\n    //! time elapsed since the start of the system (in seconds)\n    float _elapsed;\n\n    // Different modes\n    //! Mode A:Gravity + Tangential Accel + Radial Accel\n    struct {\n        /** Gravity value. Only available in 'Gravity' mode. */\n        Point gravity;\n        /** speed of each particle. Only available in 'Gravity' mode.  */\n        float speed;\n        /** speed variance of each particle. Only available in 'Gravity' mode. */\n        float speedVar;\n        /** tangential acceleration of each particle. Only available in 'Gravity' mode. */\n        float tangentialAccel;\n        /** tangential acceleration variance of each particle. Only available in 'Gravity' mode. */\n        float tangentialAccelVar;\n        /** radial acceleration of each particle. Only available in 'Gravity' mode. */\n        float radialAccel;\n        /** radial acceleration variance of each particle. Only available in 'Gravity' mode. */\n        float radialAccelVar;\n        /** set the rotation of each particle to its direction Only available in 'Gravity' mode. */\n        bool rotationIsDir;\n    } modeA;\n\n    //! Mode B: circular movement (gravity, radial accel and tangential accel don't are not used in this mode)\n    struct {\n        /** The starting radius of the particles. Only available in 'Radius' mode. */\n        float startRadius;\n        /** The starting radius variance of the particles. Only available in 'Radius' mode. */\n        float startRadiusVar;\n        /** The ending radius of the particles. Only available in 'Radius' mode. */\n        float endRadius;\n        /** The ending radius variance of the particles. Only available in 'Radius' mode. */\n        float endRadiusVar;\n        /** Number of degrees to rotate a particle around the source pos per second. Only available in 'Radius' mode. */\n        float rotatePerSecond;\n        /** Variance in degrees for rotatePerSecond. Only available in 'Radius' mode. */\n        float rotatePerSecondVar;\n    } modeB;\n\n    //! Array of particles\n    tParticle *_particles;\n\n    //Emitter name\n    std::string _configName;\n\n    // color modulate\n    //    BOOL colorModulate;\n\n    //! How many particles can be emitted per second\n    float _emitCounter;\n\n    //!  particle idx\n    int _particleIdx;\n\n    // Optimization\n    //CC_UPDATE_PARTICLE_IMP    updateParticleImp;\n    //SEL                        updateParticleSel;\n\n    /** weak reference to the SpriteBatchNode that renders the Sprite */\n    ParticleBatchNode* _batchNode;\n\n    // index of system in batch node array\n    int _atlasIndex;\n\n    //true if scaled or rotated\n    bool _transformSystemDirty;\n    // Number of allocated particles\n    int _allocatedParticles;\n\n    /** Is the emitter active */\n    bool _isActive;\n    \n    /** Quantity of particles that are being simulated at the moment */\n    int _particleCount;\n    /** How many seconds the emitter will run. -1 means 'forever' */\n    float _duration;\n    /** sourcePosition of the emitter */\n    Point _sourcePosition;\n    /** Position variance of the emitter */\n    Point _posVar;\n    /** life, and life variation of each particle */\n    float _life;\n    /** life variance of each particle */\n    float _lifeVar;\n    /** angle and angle variation of each particle */\n    float _angle;\n    /** angle variance of each particle */\n    float _angleVar;\n\n    /** Switch between different kind of emitter modes:\n     - kParticleModeGravity: uses gravity, speed, radial and tangential acceleration\n     - kParticleModeRadius: uses radius movement + rotation\n     */\n    Mode _emitterMode;\n\n    /** start size in pixels of each particle */\n    float _startSize;\n    /** size variance in pixels of each particle */\n    float _startSizeVar;\n    /** end size in pixels of each particle */\n    float _endSize;\n    /** end size variance in pixels of each particle */\n    float _endSizeVar;\n    /** start color of each particle */\n    Color4F _startColor;\n    /** start color variance of each particle */\n    Color4F _startColorVar;\n    /** end color and end color variation of each particle */\n    Color4F _endColor;\n    /** end color variance of each particle */\n    Color4F _endColorVar;\n    //* initial angle of each particle\n    float _startSpin;\n    //* initial angle of each particle\n    float _startSpinVar;\n    //* initial angle of each particle\n    float _endSpin;\n    //* initial angle of each particle\n    float _endSpinVar;\n    /** emission rate of the particles */\n    float _emissionRate;\n    /** maximum particles of the system */\n    int _totalParticles;\n    /** conforms to CocosNodeTexture protocol */\n    Texture2D* _texture;\n    /** conforms to CocosNodeTexture protocol */\n    BlendFunc _blendFunc;\n    /** does the alpha value modify color */\n    bool _opacityModifyRGB;\n    /** does FlippedY variance of each particle */\n    int _yCoordFlipped;\n\n\n    /** particles movement type: Free or Grouped\n     @since v0.8\n     */\n    PositionType _positionType;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystem);\n};\n\n// end of particle_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCPARTICLE_SYSTEM_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleSystemQuad.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2009      Leonardo Kasperavičius\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n \nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCGL.h\"\n#include \"CCParticleSystemQuad.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCDirector.h\"\n#include \"CCParticleBatchNode.h\"\n#include \"CCTextureAtlas.h\"\n#include \"CCShaderCache.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCGLProgram.h\"\n#include \"TransformUtils.h\"\n#include \"CCEventType.h\"\n#include \"CCConfiguration.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCQuadCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n\n// extern\n#include \"kazmath/GL/matrix.h\"\n#include \"CCEventListenerCustom.h\"\n#include \"CCEventDispatcher.h\"\n\nNS_CC_BEGIN\n\n//implementation ParticleSystemQuad\n// overriding the init method\nbool ParticleSystemQuad::initWithTotalParticles(int numberOfParticles)\n{\n    // base initialization\n    if( ParticleSystem::initWithTotalParticles(numberOfParticles) ) \n    {\n        // allocating data space\n        if( ! this->allocMemory() ) {\n            this->release();\n            return false;\n        }\n\n        initIndices();\n        if (Configuration::getInstance()->supportsShareableVAO())\n        {\n            setupVBOandVAO();\n        }\n        else\n        {\n            setupVBO();\n        }\n\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n        \n#if CC_ENABLE_CACHE_TEXTURE_DATA\n        // Need to listen the event only when not use batchnode, because it will use VBO\n        auto listener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(ParticleSystemQuad::listenBackToForeground, this));\n        _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);\n#endif\n\n        return true;\n    }\n    return false;\n}\n\nParticleSystemQuad::ParticleSystemQuad()\n:_quads(nullptr)\n,_indices(nullptr)\n,_VAOname(0)\n{\n    memset(_buffersVBO, 0, sizeof(_buffersVBO));\n}\n\nParticleSystemQuad::~ParticleSystemQuad()\n{\n    if (nullptr == _batchNode)\n    {\n        CC_SAFE_FREE(_quads);\n        CC_SAFE_FREE(_indices);\n        glDeleteBuffers(2, &_buffersVBO[0]);\n        if (Configuration::getInstance()->supportsShareableVAO())\n        {\n            glDeleteVertexArrays(1, &_VAOname);\n            GL::bindVAO(0);\n        }\n    }\n}\n\n// implementation ParticleSystemQuad\n\nParticleSystemQuad * ParticleSystemQuad::create(const std::string& filename)\n{\n    ParticleSystemQuad *ret = new ParticleSystemQuad();\n    if (ret && ret->initWithFile(filename))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return ret;\n}\n\nParticleSystemQuad * ParticleSystemQuad::createWithTotalParticles(int numberOfParticles) {\n    ParticleSystemQuad *ret = new ParticleSystemQuad();\n    if (ret && ret->initWithTotalParticles(numberOfParticles))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return ret;\n}\n\n\n// pointRect should be in Texture coordinates, not pixel coordinates\nvoid ParticleSystemQuad::initTexCoordsWithRect(const Rect& pointRect)\n{\n    // convert to Tex coords\n\n    Rect rect = Rect(\n        pointRect.origin.x * CC_CONTENT_SCALE_FACTOR(),\n        pointRect.origin.y * CC_CONTENT_SCALE_FACTOR(),\n        pointRect.size.width * CC_CONTENT_SCALE_FACTOR(),\n        pointRect.size.height * CC_CONTENT_SCALE_FACTOR());\n\n    GLfloat wide = (GLfloat) pointRect.size.width;\n    GLfloat high = (GLfloat) pointRect.size.height;\n\n    if (_texture)\n    {\n        wide = (GLfloat)_texture->getPixelsWide();\n        high = (GLfloat)_texture->getPixelsHigh();\n    }\n\n#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n    GLfloat left = (rect.origin.x*2+1) / (wide*2);\n    GLfloat bottom = (rect.origin.y*2+1) / (high*2);\n    GLfloat right = left + (rect.size.width*2-2) / (wide*2);\n    GLfloat top = bottom + (rect.size.height*2-2) / (high*2);\n#else\n    GLfloat left = rect.origin.x / wide;\n    GLfloat bottom = rect.origin.y / high;\n    GLfloat right = left + rect.size.width / wide;\n    GLfloat top = bottom + rect.size.height / high;\n#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n\n    // Important. Texture in cocos2d are inverted, so the Y component should be inverted\n    CC_SWAP( top, bottom, float);\n\n    V3F_C4B_T2F_Quad *quads = nullptr;\n    unsigned int start = 0, end = 0;\n    if (_batchNode)\n    {\n        quads = _batchNode->getTextureAtlas()->getQuads();\n        start = _atlasIndex;\n        end = _atlasIndex + _totalParticles;\n    }\n    else\n    {\n        quads = _quads;\n        start = 0;\n        end = _totalParticles;\n    }\n\n    for(unsigned int i=start; i<end; i++) \n    {\n        // bottom-left vertex:\n        quads[i].bl.texCoords.u = left;\n        quads[i].bl.texCoords.v = bottom;\n        // bottom-right vertex:\n        quads[i].br.texCoords.u = right;\n        quads[i].br.texCoords.v = bottom;\n        // top-left vertex:\n        quads[i].tl.texCoords.u = left;\n        quads[i].tl.texCoords.v = top;\n        // top-right vertex:\n        quads[i].tr.texCoords.u = right;\n        quads[i].tr.texCoords.v = top;\n    }\n}\nvoid ParticleSystemQuad::setTextureWithRect(Texture2D *texture, const Rect& rect)\n{\n    // Only update the texture if is different from the current one\n    if( !_texture || texture->getName() != _texture->getName() )\n    {\n        ParticleSystem::setTexture(texture);\n    }\n\n    this->initTexCoordsWithRect(rect);\n}\nvoid ParticleSystemQuad::setTexture(Texture2D* texture)\n{\n    const Size& s = texture->getContentSize();\n    this->setTextureWithRect(texture, Rect(0, 0, s.width, s.height));\n}\nvoid ParticleSystemQuad::setDisplayFrame(SpriteFrame *spriteFrame)\n{\n    CCASSERT(spriteFrame->getOffsetInPixels().equals(Point::ZERO), \n             \"QuadParticle only supports SpriteFrames with no offsets\");\n\n    // update texture before updating texture rect\n    if ( !_texture || spriteFrame->getTexture()->getName() != _texture->getName())\n    {\n        this->setTexture(spriteFrame->getTexture());\n    }\n}\n\nvoid ParticleSystemQuad::initIndices()\n{\n    for(int i = 0; i < _totalParticles; ++i)\n    {\n        const unsigned int i6 = i*6;\n        const unsigned int i4 = i*4;\n        _indices[i6+0] = (GLushort) i4+0;\n        _indices[i6+1] = (GLushort) i4+1;\n        _indices[i6+2] = (GLushort) i4+2;\n\n        _indices[i6+5] = (GLushort) i4+1;\n        _indices[i6+4] = (GLushort) i4+2;\n        _indices[i6+3] = (GLushort) i4+3;\n    }\n}\n\nvoid ParticleSystemQuad::updateQuadWithParticle(tParticle* particle, const Point& newPosition)\n{\n    V3F_C4B_T2F_Quad *quad;\n\n    if (_batchNode)\n    {\n        V3F_C4B_T2F_Quad *batchQuads = _batchNode->getTextureAtlas()->getQuads();\n        quad = &(batchQuads[_atlasIndex+particle->atlasIndex]);\n    }\n    else\n    {\n        quad = &(_quads[_particleIdx]);\n    }\n    Color4B color = (_opacityModifyRGB)\n        ? Color4B( particle->color.r*particle->color.a*255, particle->color.g*particle->color.a*255, particle->color.b*particle->color.a*255, particle->color.a*255)\n        : Color4B( particle->color.r*255, particle->color.g*255, particle->color.b*255, particle->color.a*255);\n\n    quad->bl.colors = color;\n    quad->br.colors = color;\n    quad->tl.colors = color;\n    quad->tr.colors = color;\n\n    // vertices\n    GLfloat size_2 = particle->size/2;\n    if (particle->rotation) \n    {\n        GLfloat x1 = -size_2;\n        GLfloat y1 = -size_2;\n\n        GLfloat x2 = size_2;\n        GLfloat y2 = size_2;\n        GLfloat x = newPosition.x;\n        GLfloat y = newPosition.y;\n\n        GLfloat r = (GLfloat)-CC_DEGREES_TO_RADIANS(particle->rotation);\n        GLfloat cr = cosf(r);\n        GLfloat sr = sinf(r);\n        GLfloat ax = x1 * cr - y1 * sr + x;\n        GLfloat ay = x1 * sr + y1 * cr + y;\n        GLfloat bx = x2 * cr - y1 * sr + x;\n        GLfloat by = x2 * sr + y1 * cr + y;\n        GLfloat cx = x2 * cr - y2 * sr + x;\n        GLfloat cy = x2 * sr + y2 * cr + y;\n        GLfloat dx = x1 * cr - y2 * sr + x;\n        GLfloat dy = x1 * sr + y2 * cr + y;\n\n        // bottom-left\n        quad->bl.vertices.x = ax;\n        quad->bl.vertices.y = ay;\n\n        // bottom-right vertex:\n        quad->br.vertices.x = bx;\n        quad->br.vertices.y = by;\n\n        // top-left vertex:\n        quad->tl.vertices.x = dx;\n        quad->tl.vertices.y = dy;\n\n        // top-right vertex:\n        quad->tr.vertices.x = cx;\n        quad->tr.vertices.y = cy;\n    } \n    else \n    {\n        // bottom-left vertex:\n        quad->bl.vertices.x = newPosition.x - size_2;\n        quad->bl.vertices.y = newPosition.y - size_2;\n\n        // bottom-right vertex:\n        quad->br.vertices.x = newPosition.x + size_2;\n        quad->br.vertices.y = newPosition.y - size_2;\n\n        // top-left vertex:\n        quad->tl.vertices.x = newPosition.x - size_2;\n        quad->tl.vertices.y = newPosition.y + size_2;\n\n        // top-right vertex:\n        quad->tr.vertices.x = newPosition.x + size_2;\n        quad->tr.vertices.y = newPosition.y + size_2;                \n    }\n}\nvoid ParticleSystemQuad::postStep()\n{\n    glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n    \n    // Option 1: Sub Data\n    glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(_quads[0])*_totalParticles, _quads);\n    \n    // Option 2: Data\n    //  glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * particleCount, quads_, GL_DYNAMIC_DRAW);\n    \n    // Option 3: Orphaning + glMapBuffer\n    // glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0])*_totalParticles, nullptr, GL_STREAM_DRAW);\n    // void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);\n    // memcpy(buf, _quads, sizeof(_quads[0])*_totalParticles);\n    // glUnmapBuffer(GL_ARRAY_BUFFER);\n    \n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n    \n    CHECK_GL_ERROR_DEBUG();\n}\n\n// overriding draw method\n//void ParticleSystemQuad::draw()\n//{\n//    CCASSERT(!_batchNode,\"draw should not be called when added to a particleBatchNode\");\n//\n//    CC_NODE_DRAW_SETUP();\n//\n//    GL::bindTexture2D( _texture->getName() );\n//    GL::blendFunc( _blendFunc.src, _blendFunc.dst );\n//\n//    CCASSERT( _particleIdx == _particleCount, \"Abnormal error in particle quad\");\n//\n//    if (Configuration::getInstance()->supportsShareableVAO())\n//    {\n//        //\n//        // Using VBO and VAO\n//        //\n//        GL::bindVAO(_VAOname);\n//\n//#if CC_REBIND_INDICES_BUFFER\n//        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n//#endif\n//\n//        glDrawElements(GL_TRIANGLES, (GLsizei) _particleIdx*6, GL_UNSIGNED_SHORT, 0);\n//\n//#if CC_REBIND_INDICES_BUFFER\n//        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n//#endif\n//    }\n//    else\n//    {\n//        //\n//        // Using VBO without VAO\n//        //\n//\n//        #define kQuadSize sizeof(_quads[0].bl)\n//\n//        GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX );\n//\n//        glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n//        // vertices\n//        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, vertices));\n//        // colors\n//        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, colors));\n//        // tex coords\n//        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, texCoords));\n//\n//        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n//\n//        glDrawElements(GL_TRIANGLES, (GLsizei) _particleIdx*6, GL_UNSIGNED_SHORT, 0);\n//\n//        glBindBuffer(GL_ARRAY_BUFFER, 0);\n//        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n//    }\n//\n//    CC_INCREMENT_GL_DRAWS(1);\n//    CHECK_GL_ERROR_DEBUG();\n//}\n\nvoid ParticleSystemQuad::draw()\n{\n    CCASSERT( _particleIdx == _particleCount, \"Abnormal error in particle quad\");\n    //quad command\n    if(_particleIdx > 0)\n    {\n//        //transform vertices\n//        std::vector<V3F_C4B_T2F_Quad> drawQuads(_particleIdx);\n//        memcpy(&drawQuads[0], _quads, sizeof(V3F_C4B_T2F_Quad) * _particleIdx);\n//        AffineTransform worldTM = getNodeToWorldTransform();\n//        for(int index = 0; index <_particleIdx; ++index)\n//        {\n//            V3F_C4B_T2F_Quad* quad = _quads + index;\n//            \n//            Point pt(0,0);\n//            pt = PointApplyAffineTransform( Point(quad->bl.vertices.x, quad->bl.vertices.y), worldTM);\n//            drawQuads[index].bl.vertices.x = pt.x;\n//            drawQuads[index].bl.vertices.y = pt.y;\n//            \n//            pt = PointApplyAffineTransform( Point(quad->br.vertices.x, quad->br.vertices.y), worldTM);\n//            drawQuads[index].br.vertices.x = pt.x;\n//            drawQuads[index].br.vertices.y = pt.y;\n//            \n//            pt = PointApplyAffineTransform( Point(quad->tl.vertices.x, quad->tl.vertices.y), worldTM);\n//            drawQuads[index].tl.vertices.x = pt.x;\n//            drawQuads[index].tl.vertices.y = pt.y;\n//            \n//            pt = PointApplyAffineTransform( Point(quad->tr.vertices.x, quad->tr.vertices.y), worldTM);\n//            drawQuads[index].tr.vertices.x = pt.x;\n//            drawQuads[index].tr.vertices.y = pt.y;\n//            \n//        }\n\n        auto shader = ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);\n\n        _quadCommand.init(_globalZOrder, _texture->getName(), shader, _blendFunc, _quads, _particleIdx, _modelViewTransform);\n        Director::getInstance()->getRenderer()->addCommand(&_quadCommand);\n    }\n\n}\n\nvoid ParticleSystemQuad::setTotalParticles(int tp)\n{\n    // If we are setting the total number of particles to a number higher\n    // than what is allocated, we need to allocate new arrays\n    if( tp > _allocatedParticles )\n    {\n        // Allocate new memory\n        size_t particlesSize = tp * sizeof(tParticle);\n        size_t quadsSize = sizeof(_quads[0]) * tp * 1;\n        size_t indicesSize = sizeof(_indices[0]) * tp * 6 * 1;\n\n        tParticle* particlesNew = (tParticle*)realloc(_particles, particlesSize);\n        V3F_C4B_T2F_Quad* quadsNew = (V3F_C4B_T2F_Quad*)realloc(_quads, quadsSize);\n        GLushort* indicesNew = (GLushort*)realloc(_indices, indicesSize);\n\n        if (particlesNew && quadsNew && indicesNew)\n        {\n            // Assign pointers\n            _particles = particlesNew;\n            _quads = quadsNew;\n            _indices = indicesNew;\n\n            // Clear the memory\n            // XXX: Bug? If the quads are cleared, then drawing doesn't work... WHY??? XXX\n            memset(_particles, 0, particlesSize);\n            memset(_quads, 0, quadsSize);\n            memset(_indices, 0, indicesSize);\n\n            _allocatedParticles = tp;\n        }\n        else\n        {\n            // Out of memory, failed to resize some array\n            if (particlesNew) _particles = particlesNew;\n            if (quadsNew) _quads = quadsNew;\n            if (indicesNew) _indices = indicesNew;\n\n            CCLOG(\"Particle system: out of memory\");\n            return;\n        }\n\n        _totalParticles = tp;\n\n        // Init particles\n        if (_batchNode)\n        {\n            for (int i = 0; i < _totalParticles; i++)\n            {\n                _particles[i].atlasIndex=i;\n            }\n        }\n\n        initIndices();\n        if (Configuration::getInstance()->supportsShareableVAO())\n        {\n            setupVBOandVAO();\n        }\n        else\n        {\n            setupVBO();\n        }\n    }\n    else\n    {\n        _totalParticles = tp;\n    }\n    \n    resetSystem();\n}\n\nvoid ParticleSystemQuad::setupVBOandVAO()\n{\n    // clean VAO\n    glDeleteBuffers(2, &_buffersVBO[0]);\n    glDeleteVertexArrays(1, &_VAOname);\n    GL::bindVAO(0);\n    \n    glGenVertexArrays(1, &_VAOname);\n    GL::bindVAO(_VAOname);\n\n#define kQuadSize sizeof(_quads[0].bl)\n\n    glGenBuffers(2, &_buffersVBO[0]);\n\n    glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n    glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _totalParticles, _quads, GL_DYNAMIC_DRAW);\n\n    // vertices\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, vertices));\n\n    // colors\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, colors));\n\n    // tex coords\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, texCoords));\n\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _totalParticles * 6, _indices, GL_STATIC_DRAW);\n\n    // Must unbind the VAO before changing the element buffer.\n    GL::bindVAO(0);\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\nvoid ParticleSystemQuad::setupVBO()\n{\n    glDeleteBuffers(2, &_buffersVBO[0]);\n    \n    glGenBuffers(2, &_buffersVBO[0]);\n\n    glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n    glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _totalParticles, _quads, GL_DYNAMIC_DRAW);\n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _totalParticles * 6, _indices, GL_STATIC_DRAW);\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\nvoid ParticleSystemQuad::listenBackToForeground(EventCustom* event)\n{\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        setupVBOandVAO();\n    }\n    else\n    {\n        setupVBO();\n    }\n}\n\nbool ParticleSystemQuad::allocMemory()\n{\n    CCASSERT( ( !_quads && !_indices), \"Memory already alloced\");\n    CCASSERT( !_batchNode, \"Memory should not be alloced when not using batchNode\");\n\n    CC_SAFE_FREE(_quads);\n    CC_SAFE_FREE(_indices);\n\n    _quads = (V3F_C4B_T2F_Quad*)malloc(_totalParticles * sizeof(V3F_C4B_T2F_Quad));\n    _indices = (GLushort*)malloc(_totalParticles * 6 * sizeof(GLushort));\n    \n    if( !_quads || !_indices) \n    {\n        CCLOG(\"cocos2d: Particle system: not enough memory\");\n        CC_SAFE_FREE(_quads);\n        CC_SAFE_FREE(_indices);\n\n        return false;\n    }\n\n    memset(_quads, 0, _totalParticles * sizeof(V3F_C4B_T2F_Quad));\n    memset(_indices, 0, _totalParticles * 6 * sizeof(GLushort));\n\n    return true;\n}\n\nvoid ParticleSystemQuad::setBatchNode(ParticleBatchNode * batchNode)\n{\n    if( _batchNode != batchNode ) \n    {\n        ParticleBatchNode* oldBatch = _batchNode;\n\n        ParticleSystem::setBatchNode(batchNode);\n\n        // NEW: is self render ?\n        if( ! batchNode ) \n        {\n            allocMemory();\n            initIndices();\n            setTexture(oldBatch->getTexture());\n            if (Configuration::getInstance()->supportsShareableVAO())\n            {\n                setupVBOandVAO();\n            }\n            else\n            {\n                setupVBO();\n            }\n        }\n        // OLD: was it self render ? cleanup\n        else if( !oldBatch )\n        {\n            // copy current state to batch\n            V3F_C4B_T2F_Quad *batchQuads = _batchNode->getTextureAtlas()->getQuads();\n            V3F_C4B_T2F_Quad *quad = &(batchQuads[_atlasIndex] );\n            memcpy( quad, _quads, _totalParticles * sizeof(_quads[0]) );\n\n            CC_SAFE_FREE(_quads);\n            CC_SAFE_FREE(_indices);\n\n            glDeleteBuffers(2, &_buffersVBO[0]);\n            memset(_buffersVBO, 0, sizeof(_buffersVBO));\n            if (Configuration::getInstance()->supportsShareableVAO())\n            {\n                glDeleteVertexArrays(1, &_VAOname);\n                GL::bindVAO(0);\n                _VAOname = 0;\n            }\n        }\n    }\n}\n\nParticleSystemQuad * ParticleSystemQuad::create() {\n    ParticleSystemQuad *particleSystemQuad = new ParticleSystemQuad();\n    if (particleSystemQuad && particleSystemQuad->init())\n    {\n        particleSystemQuad->autorelease();\n        return particleSystemQuad;\n    }\n    CC_SAFE_DELETE(particleSystemQuad);\n    return nullptr;\n}\n\nstd::string ParticleSystemQuad::getDescription() const\n{\n    return StringUtils::format(\"<ParticleSystemQuad | Tag = %d, Total Particles = %d>\", _tag, _totalParticles);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCParticleSystemQuad.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2009      Leonardo Kasperavičius\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_PARTICLE_SYSTEM_QUAD_H__\n#define __CC_PARTICLE_SYSTEM_QUAD_H__\n\n#include  \"CCParticleSystem.h\"\n#include \"renderer/CCQuadCommand.h\"\n\nNS_CC_BEGIN\n\nclass SpriteFrame;\nclass EventCustom;\n\n/**\n * @addtogroup particle_nodes\n * @{\n */\n\n/** @brief ParticleSystemQuad is a subclass of ParticleSystem\n\nIt includes all the features of ParticleSystem.\n\nSpecial features and Limitations:    \n- Particle size can be any float number.\n- The system can be scaled\n- The particles can be rotated\n- It supports subrects\n- It supports batched rendering since 1.1\n@since v0.8\n*/\nclass CC_DLL ParticleSystemQuad : public ParticleSystem\n{\npublic:\n\n    /** creates a Particle Emitter */\n    static ParticleSystemQuad * create();\n    /** creates a Particle Emitter with a number of particles */\n    static ParticleSystemQuad * createWithTotalParticles(int numberOfParticles);\n    /** creates an initializes a ParticleSystemQuad from a plist file.\n     This plist files can be created manually or with Particle Designer:\n     */\n    static ParticleSystemQuad * create(const std::string& filename);\n\n    /** Sets a new SpriteFrame as particle.\n    WARNING: this method is experimental. Use setTextureWithRect instead.\n    @since v0.99.4\n    */\n    void setDisplayFrame(SpriteFrame *spriteFrame);\n\n    /** Sets a new texture with a rect. The rect is in Points.\n     @since v0.99.4\n     * @js NA\n     * @lua NA\n     */\n    void setTextureWithRect(Texture2D *texture, const Rect& rect);\n\n    /** listen the event that coming to foreground on Android\n     * @js NA\n     * @lua NA\n     */\n    void listenBackToForeground(EventCustom* event);\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void setTexture(Texture2D* texture) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void updateQuadWithParticle(tParticle* particle, const Point& newPosition) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void postStep() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void draw() override;\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void setBatchNode(ParticleBatchNode* batchNode) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void setTotalParticles(int tp) override;\n\n    virtual std::string getDescription() const override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    ParticleSystemQuad();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleSystemQuad();\n\n    /** initializes the indices for the vertices*/\n    void initIndices();\n\n    /** initializes the texture with a rectangle measured Points */\n    void initTexCoordsWithRect(const Rect& rect);\n    \n    // Overrides\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual bool initWithTotalParticles(int numberOfParticles) override;\n\n    void setupVBOandVAO();\n    void setupVBO();\n    bool allocMemory();\n\n    V3F_C4B_T2F_Quad    *_quads;        // quads to be rendered\n    GLushort            *_indices;    // indices\n    \n    GLuint                _VAOname;\n    \n    GLuint                _buffersVBO[2]; //0: vertex  1: indices\n\n    kmMat4                _transformMatrix;\n    \n    QuadCommand _quadCommand;     // quad command\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ParticleSystemQuad);\n};\n\n// end of particle_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CC_PARTICLE_SYSTEM_QUAD_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCProfiling.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010      Stuart Carnie\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCProfiling.h\"\n\n#include <chrono>\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n//#pragma mark - Profiling Categories\n/* set to false the categories that you don't want to profile */\nbool kProfilerCategorySprite = false;\nbool kProfilerCategoryBatchSprite = false;\nbool kProfilerCategoryParticles = false;\n\n\nstatic Profiler* g_sSharedProfiler = nullptr;\n\nProfiler* Profiler::getInstance()\n{\n    if (! g_sSharedProfiler)\n    {\n        g_sSharedProfiler = new Profiler();\n        g_sSharedProfiler->init();\n    }\n\n    return g_sSharedProfiler;\n}\n\n// XXX: deprecated\nProfiler* Profiler::sharedProfiler(void)\n{\n    return Profiler::getInstance();\n}\n\nProfilingTimer* Profiler::createAndAddTimerWithName(const char* timerName)\n{\n    ProfilingTimer *t = new ProfilingTimer();\n    t->initWithName(timerName);\n    _activeTimers.insert(timerName, t);\n    t->release();\n\n    return t;\n}\n\nvoid Profiler::releaseTimer(const char* timerName)\n{\n    _activeTimers.erase(timerName);\n}\n\nvoid Profiler::releaseAllTimers()\n{\n    _activeTimers.clear();\n}\n\nbool Profiler::init()\n{\n    return true;\n}\n\nProfiler::~Profiler(void)\n{\n}\n\nvoid Profiler::displayTimers()\n{\n    for (auto iter = _activeTimers.begin(); iter != _activeTimers.end(); ++iter)\n    {\n        ProfilingTimer* timer = iter->second;\n        log(\"%s\", timer->getDescription().c_str());\n    }\n}\n\n// implementation of ProfilingTimer\n\nProfilingTimer::ProfilingTimer()\n: _averageTime1(0)\n, _averageTime2(0)\n, minTime(100000000)\n, maxTime(0)\n, totalTime(0)\n, numberOfCalls(0)\n{\n}\n\nbool ProfilingTimer::initWithName(const char* timerName)\n{\n    _nameStr = timerName;\n    return true;\n}\n\nProfilingTimer::~ProfilingTimer(void)\n{\n    \n}\n\nstd::string ProfilingTimer::getDescription() const\n{\n    static char s_desciption[512] = {0};\n\n    sprintf(s_desciption, \"%s ::\\tavg1: %ldµ,\\tavg2: %ldµ,\\tmin: %ldµ,\\tmax: %ldµ,\\ttotal: %.2fs,\\tnr calls: %ld\", _nameStr.c_str(), _averageTime1, _averageTime2, minTime, maxTime, totalTime/1000000., numberOfCalls);\n    return s_desciption;\n}\n\nvoid ProfilingTimer::reset()\n{\n    numberOfCalls = 0;\n    _averageTime1 = 0;\n    _averageTime2 = 0;\n    totalTime = 0;\n    minTime = 100000000;\n    maxTime = 0;\n    _startTime = chrono::high_resolution_clock::now();\n}\n\nvoid ProfilingBeginTimingBlock(const char *timerName)\n{\n    Profiler* p = Profiler::getInstance();\n    ProfilingTimer* timer = p->_activeTimers.at(timerName);\n    if( ! timer )\n    {\n        timer = p->createAndAddTimerWithName(timerName);\n    }\n\n    timer->numberOfCalls++;\n\n    // should be the last instruction in order to be more reliable\n    timer->_startTime = chrono::high_resolution_clock::now();\n}\n\nvoid ProfilingEndTimingBlock(const char *timerName)\n{\n    // should be the 1st instruction in order to be more reliable\n    auto now = chrono::high_resolution_clock::now();\n\n    Profiler* p = Profiler::getInstance();\n    ProfilingTimer* timer = p->_activeTimers.at(timerName);\n\n    CCASSERT(timer, \"CCProfilingTimer  not found\");\n\n\n    long duration = static_cast<long>(chrono::duration_cast<chrono::microseconds>(now - timer->_startTime).count());\n\n    timer->totalTime += duration;\n    timer->_averageTime1 = (timer->_averageTime1 + duration) / 2.0f;\n    timer->_averageTime2 = timer->totalTime / timer->numberOfCalls;\n    timer->maxTime = MAX( timer->maxTime, duration);\n    timer->minTime = MIN( timer->minTime, duration);\n}\n\nvoid ProfilingResetTimingBlock(const char *timerName)\n{\n    Profiler* p = Profiler::getInstance();\n    ProfilingTimer *timer = p->_activeTimers.at(timerName);\n\n    CCASSERT(timer, \"CCProfilingTimer not found\");\n\n    timer->reset();\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCProfiling.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      Stuart Carnie\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __SUPPORT_CCPROFILING_H__\n#define __SUPPORT_CCPROFILING_H__\n\n#include <string>\n#include <chrono>\n#include \"ccConfig.h\"\n#include \"CCObject.h\"\n#include \"CCMap.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup global\n * @{\n */\n\nclass ProfilingTimer;\n\n/** Profiler\n cocos2d builtin profiler.\n\n To use it, enable set the CC_ENABLE_PROFILERS=1 in the ccConfig.h file\n */\n\nclass CC_DLL Profiler : public Object\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~Profiler(void);\n    /** display the timers\n     * @js NA\n     * @lua NA\n     */\n    void displayTimers(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool init(void);\n\npublic:\n    /** returns the singleton \n     * @js NA\n     * @lua NA\n     */\n    static Profiler* getInstance(void);\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static Profiler* sharedProfiler(void);\n\n    /** Creates and adds a new timer \n     * @js NA\n     * @lua NA\n     */\n    ProfilingTimer* createAndAddTimerWithName(const char* timerName);\n    /** releases a timer \n     * @js NA\n     * @lua NA\n     */\n    void releaseTimer(const char* timerName);\n    /** releases all timers \n     * @js NA\n     * @lua NA\n     */\n    void releaseAllTimers();\n\n    Map<std::string, ProfilingTimer*> _activeTimers;\n};\n\nclass ProfilingTimer : public Object\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ProfilingTimer();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ProfilingTimer(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool initWithName(const char* timerName);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual std::string getDescription() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    inline const std::chrono::high_resolution_clock::time_point& getStartTime(void) { return _startTime; };\n\n    /** resets the timer properties\n     * @js NA\n     * @lua NA\n     */\n    void reset();\n\n    std::string _nameStr;\n    std::chrono::high_resolution_clock::time_point _startTime;\n    long _averageTime1;\n    long _averageTime2;\n    long minTime;\n    long maxTime;\n    long totalTime;\n    long numberOfCalls;\n};\n\nextern void ProfilingBeginTimingBlock(const char *timerName);\nextern void ProfilingEndTimingBlock(const char *timerName);\nextern void ProfilingResetTimingBlock(const char *timerName);\n\n/*\n * cocos2d profiling categories\n * used to enable / disable profilers with granularity\n */\n\nextern bool kProfilerCategorySprite;\nextern bool kProfilerCategoryBatchSprite;\nextern bool kProfilerCategoryParticles;\n\n// end of global group\n/// @}\n\nNS_CC_END\n\n#endif // __SUPPORT_CCPROFILING_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCProgressTimer.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010      Lam Pham\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCProgressTimer.h\"\n\n#include \"ccMacros.h\"\n#include \"CCTextureCache.h\"\n#include \"CCGLProgram.h\"\n#include \"CCShaderCache.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCDirector.h\"\n#include \"TransformUtils.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCCustomCommand.h\"\n\n// extern\n#include \"kazmath/GL/matrix.h\"\n\n#include <float.h>\n\nNS_CC_BEGIN\n\n#define kProgressTextureCoordsCount 4\n//  kProgressTextureCoords holds points {0,1} {0,0} {1,0} {1,1} we can represent it as bits\nconst char kProgressTextureCoords = 0x4b;\n\n\nProgressTimer::ProgressTimer()\n:_type(Type::RADIAL)\n,_midpoint(0,0)\n,_barChangeRate(0,0)\n,_percentage(0.0f)\n,_sprite(nullptr)\n,_vertexDataCount(0)\n,_vertexData(nullptr)\n,_reverseDirection(false)\n{}\n\nProgressTimer* ProgressTimer::create(Sprite* sp)\n{\n    ProgressTimer *progressTimer = new ProgressTimer();\n    if (progressTimer->initWithSprite(sp))\n    {\n        progressTimer->autorelease();\n    }\n    else\n    {\n        delete progressTimer;\n        progressTimer = nullptr;\n    }        \n\n    return progressTimer;\n}\n\nbool ProgressTimer::initWithSprite(Sprite* sp)\n{\n    setPercentage(0.0f);\n    _vertexData = nullptr;\n    _vertexDataCount = 0;\n\n    setAnchorPoint(Point(0.5f,0.5f));\n    _type = Type::RADIAL;\n    _reverseDirection = false;\n    setMidpoint(Point(0.5f, 0.5f));\n    setBarChangeRate(Point(1,1));\n    setSprite(sp);\n    // shader program\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n    return true;\n}\n\nProgressTimer::~ProgressTimer(void)\n{\n    CC_SAFE_FREE(_vertexData);\n    CC_SAFE_RELEASE(_sprite);\n}\n\nvoid ProgressTimer::setPercentage(float percentage)\n{\n    if (_percentage != percentage)\n    {\n        _percentage = clampf(percentage, 0, 100);\n        updateProgress();\n    }\n}\n\nvoid ProgressTimer::setSprite(Sprite *sprite)\n{\n    if (_sprite != sprite)\n    {\n        CC_SAFE_RETAIN(sprite);\n        CC_SAFE_RELEASE(_sprite);\n        _sprite = sprite;\n        setContentSize(_sprite->getContentSize());\n\n        //    Every time we set a new sprite, we free the current vertex data\n        if (_vertexData)\n        {\n            CC_SAFE_FREE(_vertexData);\n            _vertexDataCount = 0;\n        }\n    }        \n}\n\nvoid ProgressTimer::setType(Type type)\n{\n    if (type != _type)\n    {\n        //    release all previous information\n        if (_vertexData)\n        {\n            CC_SAFE_FREE(_vertexData);\n            _vertexData = nullptr;\n            _vertexDataCount = 0;\n        }\n\n        _type = type;\n    }\n}\n\nvoid ProgressTimer::setReverseProgress(bool reverse)\n{\n    if( _reverseDirection != reverse ) {\n        _reverseDirection = reverse;\n\n        //    release all previous information\n        CC_SAFE_FREE(_vertexData);\n        _vertexDataCount = 0;\n    }\n}\n\n// Interval\n\n///\n//    @returns the vertex position from the texture coordinate\n///\nTex2F ProgressTimer::textureCoordFromAlphaPoint(Point alpha)\n{\n    Tex2F ret(0.0f, 0.0f);\n    if (!_sprite) {\n        return ret;\n    }\n    V3F_C4B_T2F_Quad quad = _sprite->getQuad();\n    Point min = Point(quad.bl.texCoords.u,quad.bl.texCoords.v);\n    Point max = Point(quad.tr.texCoords.u,quad.tr.texCoords.v);\n    //  Fix bug #1303 so that progress timer handles sprite frame texture rotation\n    if (_sprite->isTextureRectRotated()) {\n        CC_SWAP(alpha.x, alpha.y, float);\n    }\n    return Tex2F(min.x * (1.f - alpha.x) + max.x * alpha.x, min.y * (1.f - alpha.y) + max.y * alpha.y);\n}\n\nVertex2F ProgressTimer::vertexFromAlphaPoint(Point alpha)\n{\n    Vertex2F ret(0.0f, 0.0f);\n    if (!_sprite) {\n        return ret;\n    }\n    V3F_C4B_T2F_Quad quad = _sprite->getQuad();\n    Point min = Point(quad.bl.vertices.x,quad.bl.vertices.y);\n    Point max = Point(quad.tr.vertices.x,quad.tr.vertices.y);\n    ret.x = min.x * (1.f - alpha.x) + max.x * alpha.x;\n    ret.y = min.y * (1.f - alpha.y) + max.y * alpha.y;\n    return ret;\n}\n\nvoid ProgressTimer::updateColor(void)\n{\n    if (!_sprite) {\n        return;\n    }\n\n    if (_vertexData)\n    {\n        Color4B sc = _sprite->getQuad().tl.colors;\n        for (int i = 0; i < _vertexDataCount; ++i)\n        {\n            _vertexData[i].colors = sc;\n        }            \n    }\n}\n\nvoid ProgressTimer::updateProgress(void)\n{\n    switch (_type)\n    {\n    case Type::RADIAL:\n        updateRadial();\n        break;\n    case Type::BAR:\n        updateBar();\n        break;\n    default:\n        break;\n    }\n}\n\nvoid ProgressTimer::setAnchorPoint(const Point& anchorPoint)\n{\n    Node::setAnchorPoint(anchorPoint);\n}\n\nPoint ProgressTimer::getMidpoint() const\n{\n    return _midpoint;\n}\n\nvoid ProgressTimer::setColor(const Color3B &color)\n{\n    _sprite->setColor(color);\n    updateColor();\n}\n\nconst Color3B& ProgressTimer::getColor() const\n{\n    return _sprite->getColor();\n}\n\nvoid ProgressTimer::setOpacity(GLubyte opacity)\n{\n    _sprite->setOpacity(opacity);\n    updateColor();\n}\n\nGLubyte ProgressTimer::getOpacity() const\n{\n    return _sprite->getOpacity();\n}\n\nvoid ProgressTimer::setMidpoint(const Point& midPoint)\n{\n    _midpoint = midPoint.getClampPoint(Point::ZERO, Point(1, 1));\n}\n\n///\n//    Update does the work of mapping the texture onto the triangles\n//    It now doesn't occur the cost of free/alloc data every update cycle.\n//    It also only changes the percentage point but no other points if they have not\n//    been modified.\n//    \n//    It now deals with flipped texture. If you run into this problem, just use the\n//    sprite property and enable the methods flipX, flipY.\n///\nvoid ProgressTimer::updateRadial(void)\n{\n    if (!_sprite) {\n        return;\n    }\n    float alpha = _percentage / 100.f;\n\n    float angle = 2.f*((float)M_PI) * ( _reverseDirection ? alpha : 1.0f - alpha);\n\n    //    We find the vector to do a hit detection based on the percentage\n    //    We know the first vector is the one @ 12 o'clock (top,mid) so we rotate\n    //    from that by the progress angle around the _midpoint pivot\n    Point topMid = Point(_midpoint.x, 1.f);\n    Point percentagePt = topMid.rotateByAngle(_midpoint, angle);\n\n\n    int index = 0;\n    Point hit = Point::ZERO;\n\n    if (alpha == 0.f) {\n        //    More efficient since we don't always need to check intersection\n        //    If the alpha is zero then the hit point is top mid and the index is 0.\n        hit = topMid;\n        index = 0;\n    } else if (alpha == 1.f) {\n        //    More efficient since we don't always need to check intersection\n        //    If the alpha is one then the hit point is top mid and the index is 4.\n        hit = topMid;\n        index = 4;\n    } else {\n        //    We run a for loop checking the edges of the texture to find the\n        //    intersection point\n        //    We loop through five points since the top is split in half\n\n        float min_t = FLT_MAX;\n\n        for (int i = 0; i <= kProgressTextureCoordsCount; ++i) {\n            int pIndex = (i + (kProgressTextureCoordsCount - 1))%kProgressTextureCoordsCount;\n\n            Point edgePtA = boundaryTexCoord(i % kProgressTextureCoordsCount);\n            Point edgePtB = boundaryTexCoord(pIndex);\n\n            //    Remember that the top edge is split in half for the 12 o'clock position\n            //    Let's deal with that here by finding the correct endpoints\n            if(i == 0){\n                edgePtB = edgePtA.lerp(edgePtB, 1-_midpoint.x);\n            } else if(i == 4){\n                edgePtA = edgePtA.lerp(edgePtB, 1-_midpoint.x);\n            }\n\n            //    s and t are returned by ccpLineIntersect\n            float s = 0, t = 0;\n            if(Point::isLineIntersect(edgePtA, edgePtB, _midpoint, percentagePt, &s, &t))\n            {\n\n                //    Since our hit test is on rays we have to deal with the top edge\n                //    being in split in half so we have to test as a segment\n                if ((i == 0 || i == 4)) {\n                    //    s represents the point between edgePtA--edgePtB\n                    if (!(0.f <= s && s <= 1.f)) {\n                        continue;\n                    }\n                }\n                //    As long as our t isn't negative we are at least finding a\n                //    correct hitpoint from _midpoint to percentagePt.\n                if (t >= 0.f) {\n                    //    Because the percentage line and all the texture edges are\n                    //    rays we should only account for the shortest intersection\n                    if (t < min_t) {\n                        min_t = t;\n                        index = i;\n                    }\n                }\n            }\n        }\n\n        //    Now that we have the minimum magnitude we can use that to find our intersection\n        hit = _midpoint+ ((percentagePt - _midpoint) * min_t);\n\n    }\n\n\n    //    The size of the vertex data is the index from the hitpoint\n    //    the 3 is for the _midpoint, 12 o'clock point and hitpoint position.\n\n    bool sameIndexCount = true;\n    if(_vertexDataCount != index + 3){\n        sameIndexCount = false;\n        CC_SAFE_FREE(_vertexData);\n        _vertexDataCount = 0;\n    }\n\n\n    if(!_vertexData) {\n        _vertexDataCount = index + 3;\n        _vertexData = (V2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(V2F_C4B_T2F));\n        CCASSERT( _vertexData, \"CCProgressTimer. Not enough memory\");\n    }\n    updateColor();\n\n    if (!sameIndexCount) {\n\n        //    First we populate the array with the _midpoint, then all\n        //    vertices/texcoords/colors of the 12 'o clock start and edges and the hitpoint\n        _vertexData[0].texCoords = textureCoordFromAlphaPoint(_midpoint);\n        _vertexData[0].vertices = vertexFromAlphaPoint(_midpoint);\n\n        _vertexData[1].texCoords = textureCoordFromAlphaPoint(topMid);\n        _vertexData[1].vertices = vertexFromAlphaPoint(topMid);\n\n        for(int i = 0; i < index; ++i){\n            Point alphaPoint = boundaryTexCoord(i);\n            _vertexData[i+2].texCoords = textureCoordFromAlphaPoint(alphaPoint);\n            _vertexData[i+2].vertices = vertexFromAlphaPoint(alphaPoint);\n        }\n    }\n\n    //    hitpoint will go last\n    _vertexData[_vertexDataCount - 1].texCoords = textureCoordFromAlphaPoint(hit);\n    _vertexData[_vertexDataCount - 1].vertices = vertexFromAlphaPoint(hit);\n\n}\n\n///\n//    Update does the work of mapping the texture onto the triangles for the bar\n//    It now doesn't occur the cost of free/alloc data every update cycle.\n//    It also only changes the percentage point but no other points if they have not\n//    been modified.\n//    \n//    It now deals with flipped texture. If you run into this problem, just use the\n//    sprite property and enable the methods flipX, flipY.\n///\nvoid ProgressTimer::updateBar(void)\n{\n    if (!_sprite) {\n        return;\n    }\n    float alpha = _percentage / 100.0f;\n    Point alphaOffset = Point(1.0f * (1.0f - _barChangeRate.x) + alpha * _barChangeRate.x, 1.0f * (1.0f - _barChangeRate.y) + alpha * _barChangeRate.y) * 0.5f;\n    Point min = _midpoint - alphaOffset;\n    Point max = _midpoint + alphaOffset;\n\n    if (min.x < 0.f) {\n        max.x += -min.x;\n        min.x = 0.f;\n    }\n\n    if (max.x > 1.f) {\n        min.x -= max.x - 1.f;\n        max.x = 1.f;\n    }\n\n    if (min.y < 0.f) {\n        max.y += -min.y;\n        min.y = 0.f;\n    }\n\n    if (max.y > 1.f) {\n        min.y -= max.y - 1.f;\n        max.y = 1.f;\n    }\n\n\n    if (!_reverseDirection) {\n        if(!_vertexData) {\n            _vertexDataCount = 4;\n            _vertexData = (V2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(V2F_C4B_T2F));\n            CCASSERT( _vertexData, \"CCProgressTimer. Not enough memory\");\n        }\n        //    TOPLEFT\n        _vertexData[0].texCoords = textureCoordFromAlphaPoint(Point(min.x,max.y));\n        _vertexData[0].vertices = vertexFromAlphaPoint(Point(min.x,max.y));\n\n        //    BOTLEFT\n        _vertexData[1].texCoords = textureCoordFromAlphaPoint(Point(min.x,min.y));\n        _vertexData[1].vertices = vertexFromAlphaPoint(Point(min.x,min.y));\n\n        //    TOPRIGHT\n        _vertexData[2].texCoords = textureCoordFromAlphaPoint(Point(max.x,max.y));\n        _vertexData[2].vertices = vertexFromAlphaPoint(Point(max.x,max.y));\n\n        //    BOTRIGHT\n        _vertexData[3].texCoords = textureCoordFromAlphaPoint(Point(max.x,min.y));\n        _vertexData[3].vertices = vertexFromAlphaPoint(Point(max.x,min.y));\n    } else {\n        if(!_vertexData) {\n            _vertexDataCount = 8;\n            _vertexData = (V2F_C4B_T2F*)malloc(_vertexDataCount * sizeof(V2F_C4B_T2F));\n            CCASSERT( _vertexData, \"CCProgressTimer. Not enough memory\");\n            //    TOPLEFT 1\n            _vertexData[0].texCoords = textureCoordFromAlphaPoint(Point(0,1));\n            _vertexData[0].vertices = vertexFromAlphaPoint(Point(0,1));\n\n            //    BOTLEFT 1\n            _vertexData[1].texCoords = textureCoordFromAlphaPoint(Point(0,0));\n            _vertexData[1].vertices = vertexFromAlphaPoint(Point(0,0));\n\n            //    TOPRIGHT 2\n            _vertexData[6].texCoords = textureCoordFromAlphaPoint(Point(1,1));\n            _vertexData[6].vertices = vertexFromAlphaPoint(Point(1,1));\n\n            //    BOTRIGHT 2\n            _vertexData[7].texCoords = textureCoordFromAlphaPoint(Point(1,0));\n            _vertexData[7].vertices = vertexFromAlphaPoint(Point(1,0));\n        }\n\n        //    TOPRIGHT 1\n        _vertexData[2].texCoords = textureCoordFromAlphaPoint(Point(min.x,max.y));\n        _vertexData[2].vertices = vertexFromAlphaPoint(Point(min.x,max.y));\n\n        //    BOTRIGHT 1\n        _vertexData[3].texCoords = textureCoordFromAlphaPoint(Point(min.x,min.y));\n        _vertexData[3].vertices = vertexFromAlphaPoint(Point(min.x,min.y));\n\n        //    TOPLEFT 2\n        _vertexData[4].texCoords = textureCoordFromAlphaPoint(Point(max.x,max.y));\n        _vertexData[4].vertices = vertexFromAlphaPoint(Point(max.x,max.y));\n\n        //    BOTLEFT 2\n        _vertexData[5].texCoords = textureCoordFromAlphaPoint(Point(max.x,min.y));\n        _vertexData[5].vertices = vertexFromAlphaPoint(Point(max.x,min.y));\n    }\n    updateColor();\n}\n\nPoint ProgressTimer::boundaryTexCoord(char index)\n{\n    if (index < kProgressTextureCoordsCount) {\n        if (_reverseDirection) {\n            return Point((kProgressTextureCoords>>(7-(index<<1)))&1,(kProgressTextureCoords>>(7-((index<<1)+1)))&1);\n        } else {\n            return Point((kProgressTextureCoords>>((index<<1)+1))&1,(kProgressTextureCoords>>(index<<1))&1);\n        }\n    }\n    return Point::ZERO;\n}\n\nvoid ProgressTimer::onDraw()\n{\n\n    CC_NODE_DRAW_SETUP();\n\n    GL::blendFunc( _sprite->getBlendFunc().src, _sprite->getBlendFunc().dst );\n\n    GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX );\n\n    GL::bindTexture2D( _sprite->getTexture()->getName() );\n\n#ifdef EMSCRIPTEN\n    setGLBufferData((void*) _vertexData, (_vertexDataCount * sizeof(V2F_C4B_T2F)), 0);\n\n    int offset = 0;\n    glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid*)offset);\n\n    offset += sizeof(Vertex2F);\n    glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid*)offset);\n\n    offset += sizeof(Color4B);\n    glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid*)offset);\n#else\n    glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]) , &_vertexData[0].vertices);\n    glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]), &_vertexData[0].texCoords);\n    glVertexAttribPointer( GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(_vertexData[0]), &_vertexData[0].colors);\n#endif // EMSCRIPTEN\n\n    if(_type == Type::RADIAL)\n    {\n        glDrawArrays(GL_TRIANGLE_FAN, 0, _vertexDataCount);\n    } \n    else if (_type == Type::BAR)\n    {\n        if (!_reverseDirection) \n        {\n            glDrawArrays(GL_TRIANGLE_STRIP, 0, _vertexDataCount);\n        } \n        else \n        {\n            glDrawArrays(GL_TRIANGLE_STRIP, 0, _vertexDataCount/2);\n            glDrawArrays(GL_TRIANGLE_STRIP, 4, _vertexDataCount/2);\n            // 2 draw calls\n            CC_INCREMENT_GL_DRAWS(1);\n        }\n    }\n    CC_INCREMENT_GL_DRAWS(1);\n}\n\nvoid ProgressTimer::draw()\n{\n    if( ! _vertexData || ! _sprite)\n        return;\n\n    _customCommand.init(_globalZOrder);\n    _customCommand.func = CC_CALLBACK_0(ProgressTimer::onDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_customCommand);\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCProgressTimer.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      Lam Pham\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __MISC_NODE_CCPROGRESS_TIMER_H__\n#define __MISC_NODE_CCPROGRESS_TIMER_H__\n\n#include \"CCSprite.h\"\n#include \"renderer/CCCustomCommand.h\"\n#ifdef EMSCRIPTEN\n#include \"CCGLBufferedNode.h\"\n#endif // EMSCRIPTEN\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup misc_nodes\n * @{\n */\n\n/**\n @brief ProgressTimer is a subclass of Node.\n It renders the inner sprite according to the percentage.\n The progress can be Radial, Horizontal or vertical.\n @since v0.99.1\n */\nclass CC_DLL ProgressTimer : public Node\n#ifdef EMSCRIPTEN\n, public GLBufferedNode\n#endif // EMSCRIPTEN\n{\npublic:\n    /** Types of progress\n     @since v0.99.1\n     */\n    enum class Type\n    {\n        /// Radial Counter-Clockwise\n        RADIAL,\n        /// Bar\n        BAR,\n    };\n    \n    /** Creates a progress timer with the sprite as the shape the timer goes through */\n    static ProgressTimer* create(Sprite* sp);\n\n    /** Change the percentage to change progress. */\n    inline Type getType() const { return _type; }\n\n    /** Percentages are from 0 to 100 */\n    inline float getPercentage() const {return _percentage; }\n\n    /** The image to show the progress percentage, retain */\n    inline Sprite* getSprite() const { return _sprite; }\n\n    void setPercentage(float percentage);\n    void setSprite(Sprite *sprite);\n    void setType(Type type);\n    /**\n     * @js setReverseDirection\n     * @lua setReverseDirection\n     */\n    void setReverseProgress(bool reverse);\n\n    inline bool isReverseDirection() { return _reverseDirection; };\n    inline void setReverseDirection(bool value) { _reverseDirection = value; };\n\n    /**\n     *    Midpoint is used to modify the progress start position.\n     *    If you're using radials type then the midpoint changes the center point\n     *    If you're using bar type the the midpoint changes the bar growth\n     *        it expands from the center but clamps to the sprites edge so:\n     *        you want a left to right then set the midpoint all the way to Point(0,y)\n     *        you want a right to left then set the midpoint all the way to Point(1,y)\n     *        you want a bottom to top then set the midpoint all the way to Point(x,0)\n     *        you want a top to bottom then set the midpoint all the way to Point(x,1)\n     */\n    void setMidpoint(const Point& point);\n    /** Returns the Midpoint */\n    Point getMidpoint() const;\n\n    /**\n     *    This allows the bar type to move the component at a specific rate\n     *    Set the component to 0 to make sure it stays at 100%.\n     *    For example you want a left to right bar but not have the height stay 100%\n     *    Set the rate to be Point(0,1); and set the midpoint to = Point(0,.5f);\n     */\n    inline void setBarChangeRate(const Point& barChangeRate ) { _barChangeRate = barChangeRate; }\n    /** Returns the BarChangeRate */\n    inline Point getBarChangeRate() const { return _barChangeRate; }\n\n    // Overrides\n    virtual void draw() override;\n    virtual void setAnchorPoint(const Point& anchorPoint) override;\n    virtual void setColor(const Color3B &color) override;\n    virtual const Color3B& getColor() const override;\n    virtual void setOpacity(GLubyte opacity) override;\n    virtual GLubyte getOpacity() const override;\n    \nprotected:\n    /**\n     * @js ctor\n     */\n    ProgressTimer();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ProgressTimer();\n\n    /** Initializes a progress timer with the sprite as the shape the timer goes through */\n    bool initWithSprite(Sprite* sp);\n\n    void onDraw();\n    \n    Tex2F textureCoordFromAlphaPoint(Point alpha);\n    Vertex2F vertexFromAlphaPoint(Point alpha);\n    void updateProgress(void);\n    void updateBar(void);\n    void updateRadial(void);\n    virtual void updateColor(void) override;\n    Point boundaryTexCoord(char index);\n\n    Type _type;\n    Point _midpoint;\n    Point _barChangeRate;\n    float _percentage;\n    Sprite *_sprite;\n    int _vertexDataCount;\n    V2F_C4B_T2F *_vertexData;\n    \n    CustomCommand _customCommand;\n\n    bool _reverseDirection;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ProgressTimer);\n};\n\n// end of misc_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__MISC_NODE_CCPROGRESS_TIMER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCProtocols.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCPROTOCOLS_H__\n#define __CCPROTOCOLS_H__\n\n#include \"ccTypes.h\"\n#include \"CCTexture2D.h\"\n#include <string>\n\nNS_CC_BEGIN\n\n/**\n * RGBA protocol that affects Node's color and opacity\n */\nclass CC_DLL __RGBAProtocol\n{\npublic:\n    virtual ~__RGBAProtocol() {}\n    \n    /**\n     * Changes the color with R,G,B bytes\n     *\n     * @param color Example: Color3B(255,100,0) means R=255, G=100, B=0\n     * @js NA\n     * @lua NA\n     */\n    virtual void setColor(const Color3B& color) = 0;\n    \n    /**\n     * Returns color that is currently used.\n     *\n     * @return The Color3B contains R,G,B bytes.\n     * @js NA\n     * @lua NA\n     */\n    virtual const Color3B& getColor() const = 0;\n    \n    /**\n     * Returns the displayed color.\n     *\n     * @return The Color3B contains R,G,B bytes.\n     * @js NA\n     * @lua NA\n     */\n    virtual const Color3B& getDisplayedColor() const = 0;\n    \n    /**\n     * Returns the displayed opacity.\n     *\n     * @return  The opacity of sprite, from 0 ~ 255\n     * @js NA\n     * @lua NA\n     */\n    virtual GLubyte getDisplayedOpacity() const = 0;\n    /**\n     * Returns the opacity.\n     *\n     * The opacity which indicates how transparent or opaque this node is.\n     * 0 indicates fully transparent and 255 is fully opaque.\n     *\n     * @return  The opacity of sprite, from 0 ~ 255\n     * @js NA\n     * @lua NA\n     */\n    virtual GLubyte getOpacity() const = 0;\n    \n    /**\n     * Changes the opacity.\n     *\n     * @param opacity   Goes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.\n     * @js NA\n     * @lua NA\n     */\n    virtual void setOpacity(GLubyte opacity) = 0;\n    \n    // optional\n    \n    /**\n     * Changes the OpacityModifyRGB property.\n     * If thie property is set to true, then the rendered color will be affected by opacity.\n     * Normally, r = r * opacity/255, g = g * opacity/255, b = b * opacity/255.\n     *\n     * @param value If true, then the opacity will be applied as: glColor(R,G,B,opacity);\n     *              If false, then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);\n     * @js NA\n     * @lua NA\n     */\n    virtual void setOpacityModifyRGB(bool value) = 0;\n    \n    /**\n     * Returns whether or not the opacity will be applied using glColor(R,G,B,opacity)\n     * or glColor(opacity, opacity, opacity, opacity)\n     *\n     * @return  Returns opacity modify flag.\n     * @js NA\n     * @lua NA\n     */\n    virtual bool isOpacityModifyRGB() const = 0;\n    \n    /**\n     *  whether or not color should be propagated to its children.\n     * @js NA\n     * @lua NA\n     */\n    virtual bool isCascadeColorEnabled() const = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void setCascadeColorEnabled(bool cascadeColorEnabled) = 0;\n    \n    /**\n     *  recursive method that updates display color\n     * @js NA\n     * @lua NA\n     */\n    virtual void updateDisplayedColor(const Color3B& color) = 0;\n    \n    /**\n     *  whether or not opacity should be propagated to its children.\n     * @js NA\n     * @lua NA\n     */\n    virtual bool isCascadeOpacityEnabled() const = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled) = 0;\n    \n    /**\n     *  recursive method that updates the displayed opacity.\n     * @js NA\n     * @lua NA\n     */\n    virtual void updateDisplayedOpacity(GLubyte opacity) = 0;\n};\n\n/**\n * Specify the blending function according glBlendFunc\n * Please refer to glBlendFunc in OpenGL ES Manual\n * http://www.khronos.org/opengles/sdk/docs/man/xhtml/glBlendFunc.xml for more details.\n */\nclass CC_DLL BlendProtocol\n{\npublic:\n    virtual ~BlendProtocol() {}\n\n    /**\n     * Sets the source blending function.\n     *\n     * @param blendFunc A structure with source and destination factor to specify pixel arithmetic, \n     *                  e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.\n     * @js NA\n     * @lua NA\n     */\n    virtual void setBlendFunc(const BlendFunc &blendFunc) = 0;\n\n    /**\n     * Returns the blending function that is currently being used.\n     * \n     * @return A BlendFunc structure with source and destination factor which specified pixel arithmetic.\n     * @js NA\n     * @lua NA\n     */\n    virtual const BlendFunc &getBlendFunc() const = 0;\n};\n\n/** \n * Node objects that uses a Texture2D to render the images.\n * The texture can have a blending function.\n * If the texture has alpha premultiplied the default blending function is:\n *   src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA\n * else\n *   src=GL_SRC_ALPHA dst= GL_ONE_MINUS_SRC_ALPHA\n * But you can change the blending function at any time.\n */\nclass CC_DLL TextureProtocol : public BlendProtocol\n{\npublic:\n    virtual ~TextureProtocol() {}\n    /**\n     * Returns the currently used texture\n     *\n     * @return  The texture that is currenlty being used.\n     * @js NA\n     * @lua NA\n     */\n    virtual Texture2D* getTexture() const = 0;\n\n    /**\n     * Sets a new texuture. It will be retained.\n     *\n     * @param   texture A valid Texture2D object, which will be applied to this sprite object.\n     * @js NA\n     * @lua NA\n     */\n    virtual void setTexture(Texture2D *texture) = 0;\n};\n\n/**\n * Common interface for Labels\n */\nclass CC_DLL LabelProtocol\n{\npublic:\n    virtual ~LabelProtocol() {}\n\n    /**\n     * Sets a new label using a string\n     *\n     * @param label A null terminated string\n     * @js NA\n     * @lua NA\n     */\n    virtual void setString(const std::string &label) = 0;\n\n    /** \n     * Returns the string that is currently being used in this label \n     *\n     * @return The string that is currently being used in this label\n     * @js NA\n     * @lua NA\n     */\n    virtual const std::string& getString() const = 0;\n};\n\n/** \n * OpenGL projection protocol \n */\nclass CC_DLL DirectorDelegate\n{\npublic:\n    virtual ~DirectorDelegate() {}\n\n    /**\n     * Will be called by Director when the projection is updated, and \"custom\" projection is used\n     * @js NA\n     * @lua NA\n     */\n    virtual void updateProjection() = 0;\n};\n\nNS_CC_END\n\n#endif // __CCPROTOCOLS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCRenderTexture.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      Jason Booth\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCConfiguration.h\"\n#include \"CCRenderTexture.h\"\n#include \"CCDirector.h\"\n#include \"platform/CCImage.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCConfiguration.h\"\n#include \"ccUtils.h\"\n#include \"CCTextureCache.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCGL.h\"\n#include \"CCEventType.h\"\n#include \"CCGrid.h\"\n\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n\n// extern\n#include \"kazmath/GL/matrix.h\"\n#include \"CCEventListenerCustom.h\"\n#include \"CCEventDispatcher.h\"\n\nNS_CC_BEGIN\n\n// implementation RenderTexture\nRenderTexture::RenderTexture()\n: _FBO(0)\n, _depthRenderBufffer(0)\n, _oldFBO(0)\n, _texture(0)\n, _textureCopy(0)\n, _UITextureImage(nullptr)\n, _pixelFormat(Texture2D::PixelFormat::RGBA8888)\n, _clearFlags(0)\n, _clearColor(Color4F(0,0,0,0))\n, _clearDepth(0.0f)\n, _clearStencil(0)\n, _autoDraw(false)\n, _sprite(nullptr)\n{\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    // Listen this event to save render texture before come to background.\n    // Then it can be restored after coming to foreground on Android.\n    auto toBackgroundListener = EventListenerCustom::create(EVENT_COME_TO_BACKGROUND, CC_CALLBACK_1(RenderTexture::listenToBackground, this));\n    _eventDispatcher->addEventListenerWithSceneGraphPriority(toBackgroundListener, this);\n\n    auto toForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(RenderTexture::listenToForeground, this));\n    _eventDispatcher->addEventListenerWithSceneGraphPriority(toForegroundListener, this);\n#endif\n}\n\nRenderTexture::~RenderTexture()\n{\n    CC_SAFE_RELEASE(_sprite);\n    CC_SAFE_RELEASE(_textureCopy);\n    \n    glDeleteFramebuffers(1, &_FBO);\n    if (_depthRenderBufffer)\n    {\n        glDeleteRenderbuffers(1, &_depthRenderBufffer);\n    }\n    CC_SAFE_DELETE(_UITextureImage);\n}\n\nvoid RenderTexture::listenToBackground(EventCustom *event)\n{\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    CC_SAFE_DELETE(_UITextureImage);\n    \n    // to get the rendered texture data\n    _UITextureImage = newImage(false);\n\n    if (_UITextureImage)\n    {\n        const Size& s = _texture->getContentSizeInPixels();\n        VolatileTextureMgr::addDataTexture(_texture, _UITextureImage->getData(), s.width * s.height * 4, Texture2D::PixelFormat::RGBA8888, s);\n        \n        if ( _textureCopy )\n        {\n            VolatileTextureMgr::addDataTexture(_textureCopy, _UITextureImage->getData(), s.width * s.height * 4, Texture2D::PixelFormat::RGBA8888, s);\n        }\n    }\n    else\n    {\n        CCLOG(\"Cache rendertexture failed!\");\n    }\n    \n    glDeleteFramebuffers(1, &_FBO);\n    _FBO = 0;\n#endif\n}\n\nvoid RenderTexture::listenToForeground(EventCustom *event)\n{\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    // -- regenerate frame buffer object and attach the texture\n    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);\n    \n    glGenFramebuffers(1, &_FBO);\n    glBindFramebuffer(GL_FRAMEBUFFER, _FBO);\n    \n    _texture->setAliasTexParameters();\n    \n    if ( _textureCopy )\n    {\n        _textureCopy->setAliasTexParameters();\n    }\n    \n    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture->getName(), 0);\n    glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);\n#endif\n}\n\nRenderTexture * RenderTexture::create(int w, int h, Texture2D::PixelFormat eFormat)\n{\n    RenderTexture *ret = new RenderTexture();\n\n    if(ret && ret->initWithWidthAndHeight(w, h, eFormat))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nRenderTexture * RenderTexture::create(int w ,int h, Texture2D::PixelFormat eFormat, GLuint uDepthStencilFormat)\n{\n    RenderTexture *ret = new RenderTexture();\n\n    if(ret && ret->initWithWidthAndHeight(w, h, eFormat, uDepthStencilFormat))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nRenderTexture * RenderTexture::create(int w, int h)\n{\n    RenderTexture *ret = new RenderTexture();\n\n    if(ret && ret->initWithWidthAndHeight(w, h, Texture2D::PixelFormat::RGBA8888, 0))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat eFormat)\n{\n    return initWithWidthAndHeight(w, h, eFormat, 0);\n}\n\nbool RenderTexture::initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat format, GLuint depthStencilFormat)\n{\n    CCASSERT(format != Texture2D::PixelFormat::A8, \"only RGB and RGBA formats are valid for a render texture\");\n\n    bool ret = false;\n    void *data = nullptr;\n    do \n    {\n        w = (int)(w * CC_CONTENT_SCALE_FACTOR());\n        h = (int)(h * CC_CONTENT_SCALE_FACTOR());\n\n        glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);\n\n        // textures must be power of two squared\n        int powW = 0;\n        int powH = 0;\n\n        if (Configuration::getInstance()->supportsNPOT())\n        {\n            powW = w;\n            powH = h;\n        }\n        else\n        {\n            powW = ccNextPOT(w);\n            powH = ccNextPOT(h);\n        }\n\n        auto dataLen = powW * powH * 4;\n        data = malloc(dataLen);\n        CC_BREAK_IF(! data);\n\n        memset(data, 0, dataLen);\n        _pixelFormat = format;\n\n        _texture = new Texture2D();\n        if (_texture)\n        {\n            _texture->initWithData(data, dataLen, (Texture2D::PixelFormat)_pixelFormat, powW, powH, Size((float)w, (float)h));\n        }\n        else\n        {\n            break;\n        }\n        GLint oldRBO;\n        glGetIntegerv(GL_RENDERBUFFER_BINDING, &oldRBO);\n        \n        if (Configuration::getInstance()->checkForGLExtension(\"GL_QCOM\"))\n        {\n            _textureCopy = new Texture2D();\n            if (_textureCopy)\n            {\n                _textureCopy->initWithData(data, dataLen, (Texture2D::PixelFormat)_pixelFormat, powW, powH, Size((float)w, (float)h));\n            }\n            else\n            {\n                break;\n            }\n        }\n\n        // generate FBO\n        glGenFramebuffers(1, &_FBO);\n        glBindFramebuffer(GL_FRAMEBUFFER, _FBO);\n\n        // associate texture with FBO\n        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture->getName(), 0);\n\n        if (depthStencilFormat != 0)\n        {\n            //create and attach depth buffer\n            glGenRenderbuffers(1, &_depthRenderBufffer);\n            glBindRenderbuffer(GL_RENDERBUFFER, _depthRenderBufffer);\n            glRenderbufferStorage(GL_RENDERBUFFER, depthStencilFormat, (GLsizei)powW, (GLsizei)powH);\n            glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, _depthRenderBufffer);\n\n            // if depth format is the one with stencil part, bind same render buffer as stencil attachment\n            if (depthStencilFormat == GL_DEPTH24_STENCIL8)\n            {\n                glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, _depthRenderBufffer);\n            }\n        }\n\n        // check if it worked (probably worth doing :) )\n        CCASSERT(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE, \"Could not attach texture to framebuffer\");\n\n        _texture->setAliasTexParameters();\n\n        // retained\n        setSprite(Sprite::createWithTexture(_texture));\n\n        _texture->release();\n        _sprite->setScaleY(-1);\n\n        _sprite->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED );\n\n        glBindRenderbuffer(GL_RENDERBUFFER, oldRBO);\n        glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);\n        \n        // Diabled by default.\n        _autoDraw = false;\n        \n        // add sprite for backward compatibility\n        addChild(_sprite);\n        \n        ret = true;\n    } while (0);\n    \n    CC_SAFE_FREE(data);\n    \n    return ret;\n}\n\nvoid RenderTexture::beginWithClear(float r, float g, float b, float a)\n{\n    beginWithClear(r, g, b, a, 0, 0, GL_COLOR_BUFFER_BIT);\n}\n\nvoid RenderTexture::beginWithClear(float r, float g, float b, float a, float depthValue)\n{\n    beginWithClear(r, g, b, a, depthValue, 0, GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);\n}\n\nvoid RenderTexture::beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue)\n{\n    beginWithClear(r, g, b, a, depthValue, stencilValue, GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);\n}\n\nvoid RenderTexture::beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue, GLbitfield flags)\n{\n    setClearColor(Color4F(r, g, b, a));\n\n    setClearDepth(depthValue);\n\n    setClearStencil(stencilValue);\n\n    setClearFlags(flags);\n\n    this->begin();\n\n    //clear screen\n    _beginWithClearCommand.init(_globalZOrder);\n    _beginWithClearCommand.func = CC_CALLBACK_0(RenderTexture::onClear, this);\n    Director::getInstance()->getRenderer()->addCommand(&_beginWithClearCommand);\n}\n\n//TODO find a better way to clear the screen, there is no need to rebind render buffer there.\nvoid RenderTexture::clear(float r, float g, float b, float a)\n{\n    this->beginWithClear(r, g, b, a);\n    this->end();\n}\n\nvoid RenderTexture::clearDepth(float depthValue)\n{\n    setClearDepth(depthValue);\n\n    this->begin();\n\n    _clearDepthCommand.init(_globalZOrder);\n    _clearDepthCommand.func = CC_CALLBACK_0(RenderTexture::onClearDepth, this);\n\n    Director::getInstance()->getRenderer()->addCommand(&_clearDepthCommand);\n\n    this->end();\n}\n\nvoid RenderTexture::clearStencil(int stencilValue)\n{\n    // save old stencil value\n    int stencilClearValue;\n    glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &stencilClearValue);\n\n    glClearStencil(stencilValue);\n    glClear(GL_STENCIL_BUFFER_BIT);\n\n    // restore clear color\n    glClearStencil(stencilClearValue);\n}\n\nvoid RenderTexture::visit()\n{\n    // override visit.\n\t// Don't call visit on its children\n    if (!_visible)\n    {\n        return;\n    }\n\t\n\tkmGLPushMatrix();\n    \n    transform();\n    _sprite->visit();\n    draw();\n    \n\tkmGLPopMatrix();\n\n    _orderOfArrival = 0;\n}\n\nbool RenderTexture::saveToFile(const std::string& filename)\n{\n    bool ret = false;\n\n    Image *image = newImage(true);\n    if (image)\n    {\n        ret = image->saveToFile(filename);\n    }\n\n    CC_SAFE_DELETE(image);\n    return ret;\n}\nbool RenderTexture::saveToFile(const std::string& fileName, Image::Format format)\n{\n    bool ret = false;\n    CCASSERT(format == Image::Format::JPG || format == Image::Format::PNG,\n             \"the image can only be saved as JPG or PNG format\");\n\n    Image *image = newImage(true);\n    if (image)\n    {\n        std::string fullpath = FileUtils::getInstance()->getWritablePath() + fileName;\n        \n        ret = image->saveToFile(fullpath.c_str(), true);\n    }\n\n    CC_SAFE_DELETE(image);\n\n    return ret;\n}\n\n/* get buffer as Image */\nImage* RenderTexture::newImage(bool fliimage)\n{\n    CCASSERT(_pixelFormat == Texture2D::PixelFormat::RGBA8888, \"only RGBA8888 can be saved as image\");\n\n    if (nullptr == _texture)\n    {\n        return nullptr;\n    }\n\n    const Size& s = _texture->getContentSizeInPixels();\n\n    // to get the image size to save\n    //        if the saving image domain exceeds the buffer texture domain,\n    //        it should be cut\n    int savedBufferWidth = (int)s.width;\n    int savedBufferHeight = (int)s.height;\n\n    GLubyte *buffer = nullptr;\n    GLubyte *tempData = nullptr;\n    Image *image = new Image();\n\n    do\n    {\n        CC_BREAK_IF(! (buffer = new GLubyte[savedBufferWidth * savedBufferHeight * 4]));\n\n        if(! (tempData = new GLubyte[savedBufferWidth * savedBufferHeight * 4]))\n        {\n            delete[] buffer;\n            buffer = nullptr;\n            break;\n        }\n\n        this->begin();\n        glPixelStorei(GL_PACK_ALIGNMENT, 1);\n        glReadPixels(0,0,savedBufferWidth, savedBufferHeight,GL_RGBA,GL_UNSIGNED_BYTE, tempData);\n        this->end();\n\n        if ( fliimage ) // -- flip is only required when saving image to file\n        {\n            // to get the actual texture data\n            // #640 the image read from rendertexture is dirty\n            for (int i = 0; i < savedBufferHeight; ++i)\n            {\n                memcpy(&buffer[i * savedBufferWidth * 4],\n                       &tempData[(savedBufferHeight - i - 1) * savedBufferWidth * 4],\n                       savedBufferWidth * 4);\n            }\n\n            image->initWithRawData(buffer, savedBufferWidth * savedBufferHeight * 4, savedBufferWidth, savedBufferHeight, 8);\n        }\n        else\n        {\n            image->initWithRawData(tempData, savedBufferWidth * savedBufferHeight * 4, savedBufferWidth, savedBufferHeight, 8);\n        }\n        \n    } while (0);\n\n    CC_SAFE_DELETE_ARRAY(buffer);\n    CC_SAFE_DELETE_ARRAY(tempData);\n\n    return image;\n}\n\nvoid RenderTexture::onBegin()\n{\n    //\n    kmGLGetMatrix(KM_GL_PROJECTION, &_oldProjMatrix);\n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLLoadMatrix(&_projectionMatrix);\n\n    kmGLGetMatrix(KM_GL_MODELVIEW, &_oldTransMatrix);\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLLoadMatrix(&_transformMatrix);\n\n    Director *director = Director::getInstance();\n    director->setProjection(director->getProjection());\n\n    const Size& texSize = _texture->getContentSizeInPixels();\n\n    // Calculate the adjustment ratios based on the old and new projections\n    Size size = director->getWinSizeInPixels();\n    float widthRatio = size.width / texSize.width;\n    float heightRatio = size.height / texSize.height;\n\n    // Adjust the orthographic projection and viewport\n    glViewport(0, 0, (GLsizei)size.width, (GLsizei)size.height);\n\n\n    kmMat4 orthoMatrix;\n    kmMat4OrthographicProjection(&orthoMatrix, (float)-1.0 / widthRatio,  (float)1.0 / widthRatio,\n            (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1,1 );\n    kmGLMultMatrix(&orthoMatrix);\n\n    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);\n    glBindFramebuffer(GL_FRAMEBUFFER, _FBO);\n\n    //TODO move this to configration, so we don't check it every time\n    /*  Certain Qualcomm Andreno gpu's will retain data in memory after a frame buffer switch which corrupts the render to the texture. The solution is to clear the frame buffer before rendering to the texture. However, calling glClear has the unintended result of clearing the current texture. Create a temporary texture to overcome this. At the end of RenderTexture::begin(), switch the attached texture to the second one, call glClear, and then switch back to the original texture. This solution is unnecessary for other devices as they don't have the same issue with switching frame buffers.\n     */\n    if (Configuration::getInstance()->checkForGLExtension(\"GL_QCOM\"))\n    {\n        // -- bind a temporary texture so we can clear the render buffer without losing our texture\n        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _textureCopy->getName(), 0);\n        CHECK_GL_ERROR_DEBUG();\n        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n        glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture->getName(), 0);\n    }\n}\n\nvoid RenderTexture::onEnd()\n{\n    Director *director = Director::getInstance();\n\n    glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);\n\n    // restore viewport\n    director->setViewport();\n\n    //\n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLLoadMatrix(&_oldProjMatrix);\n\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLLoadMatrix(&_oldTransMatrix);\n}\n\nvoid RenderTexture::onClear()\n{\n    // save clear color\n    GLfloat oldClearColor[4] = {0.0f};\n    GLfloat oldDepthClearValue = 0.0f;\n    GLint oldStencilClearValue = 0;\n\n    // backup and set\n    if (_clearFlags & GL_COLOR_BUFFER_BIT)\n    {\n        glGetFloatv(GL_COLOR_CLEAR_VALUE, oldClearColor);\n        glClearColor(_clearColor.r, _clearColor.g, _clearColor.b, _clearColor.a);\n    }\n\n    if (_clearFlags & GL_DEPTH_BUFFER_BIT)\n    {\n        glGetFloatv(GL_DEPTH_CLEAR_VALUE, &oldDepthClearValue);\n        glClearDepth(_clearDepth);\n    }\n\n    if (_clearFlags & GL_STENCIL_BUFFER_BIT)\n    {\n        glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &oldStencilClearValue);\n        glClearStencil(_clearStencil);\n    }\n\n    // clear\n    glClear(_clearFlags);\n\n    // restore\n    if (_clearFlags & GL_COLOR_BUFFER_BIT)\n    {\n        glClearColor(oldClearColor[0], oldClearColor[1], oldClearColor[2], oldClearColor[3]);\n    }\n    if (_clearFlags & GL_DEPTH_BUFFER_BIT)\n    {\n        glClearDepth(oldDepthClearValue);\n    }\n    if (_clearFlags & GL_STENCIL_BUFFER_BIT)\n    {\n        glClearStencil(oldStencilClearValue);\n    }\n}\n\nvoid RenderTexture::onClearDepth()\n{\n    //! save old depth value\n    GLfloat depthClearValue;\n    glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depthClearValue);\n\n    glClearDepth(_clearDepth);\n    glClear(GL_DEPTH_BUFFER_BIT);\n\n    // restore clear color\n    glClearDepth(depthClearValue);\n}\n\nvoid RenderTexture::draw()\n{\n    if (_autoDraw)\n    {\n        //Begin will create a render group using new render target\n        begin();\n\n        //clear screen\n        _clearCommand.init(_globalZOrder);\n        _clearCommand.func = CC_CALLBACK_0(RenderTexture::onClear, this);\n        Director::getInstance()->getRenderer()->addCommand(&_clearCommand);\n\n        //! make sure all children are drawn\n        sortAllChildren();\n\n        for(const auto &child: _children)\n        {\n            if (child != _sprite)\n                child->visit();\n        }\n\n        //End will pop the current render group\n        end();\n    }\n}\n\nvoid RenderTexture::begin()\n{\n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLPushMatrix();\n    kmGLGetMatrix(KM_GL_PROJECTION, &_projectionMatrix);\n\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPushMatrix();\n    kmGLGetMatrix(KM_GL_MODELVIEW, &_transformMatrix);\n    \n    Director *director = Director::getInstance();\n    director->setProjection(director->getProjection());\n    \n    const Size& texSize = _texture->getContentSizeInPixels();\n    \n    // Calculate the adjustment ratios based on the old and new projections\n    Size size = director->getWinSizeInPixels();\n    float widthRatio = size.width / texSize.width;\n    float heightRatio = size.height / texSize.height;\n    \n    kmMat4 orthoMatrix;\n    kmMat4OrthographicProjection(&orthoMatrix, (float)-1.0 / widthRatio,  (float)1.0 / widthRatio,\n                                 (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1,1 );\n    kmGLMultMatrix(&orthoMatrix);\n\n    _groupCommand.init(_globalZOrder);\n\n    Renderer *renderer =  Director::getInstance()->getRenderer();\n    renderer->addCommand(&_groupCommand);\n    renderer->pushGroup(_groupCommand.getRenderQueueID());\n\n    _beginCommand.init(_globalZOrder);\n    _beginCommand.func = CC_CALLBACK_0(RenderTexture::onBegin, this);\n\n    Director::getInstance()->getRenderer()->addCommand(&_beginCommand);\n}\n\nvoid RenderTexture::end()\n{\n    _endCommand.init(_globalZOrder);\n    _endCommand.func = CC_CALLBACK_0(RenderTexture::onEnd, this);\n\n    Renderer *renderer = Director::getInstance()->getRenderer();\n    renderer->addCommand(&_endCommand);\n    renderer->popGroup();\n    \n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLPopMatrix();\n    \n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPopMatrix();\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCRenderTexture.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      Jason Booth\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCRENDER_TEXTURE_H__\n#define __CCRENDER_TEXTURE_H__\n\n#include \"CCNode.h\"\n#include \"CCSprite.h\"\n#include \"kazmath/mat4.h\"\n#include \"platform/CCImage.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\nclass EventCustom;\n\n/**\n * @addtogroup textures\n * @{\n */\n\n/**\n@brief RenderTexture is a generic rendering target. To render things into it,\nsimply construct a render target, call begin on it, call visit on any cocos\nscenes or objects to render them, and call end. For convenience, render texture\nadds a sprite as it's display child with the results, so you can simply add\nthe render texture to your scene and treat it like any other CocosNode.\nThere are also functions for saving the render texture to disk in PNG or JPG format.\n\n@since v0.8.1\n*/\nclass CC_DLL RenderTexture : public Node \n{\npublic:\n    /** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/\n    static RenderTexture * create(int w ,int h, Texture2D::PixelFormat format, GLuint depthStencilFormat);\n\n    /** creates a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */\n    static RenderTexture * create(int w, int h, Texture2D::PixelFormat format);\n\n    /** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 */\n    static RenderTexture * create(int w, int h);\n\n    /** starts grabbing */\n    virtual void begin();\n\n    /** starts rendering to the texture while clearing the texture first.\n    This is more efficient then calling -clear first and then -begin */\n    virtual void beginWithClear(float r, float g, float b, float a);\n\n    /** starts rendering to the texture while clearing the texture first.\n     This is more efficient then calling -clear first and then -begin */\n    virtual void beginWithClear(float r, float g, float b, float a, float depthValue);\n\n    /** starts rendering to the texture while clearing the texture first.\n     This is more efficient then calling -clear first and then -begin */\n    virtual void beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue);\n\n    /** end is key word of lua, use other name to export to lua. */\n    inline void endToLua(){ end();};\n\n    /** ends grabbing*/\n    virtual void end();\n\n    /** clears the texture with a color */\n    void clear(float r, float g, float b, float a);\n\n    /** clears the texture with a specified depth value */\n    virtual void clearDepth(float depthValue);\n\n    /** clears the texture with a specified stencil value */\n    virtual void clearStencil(int stencilValue);\n    /* creates a new Image from with the texture's data.\n       Caller is responsible for releasing it by calling delete.\n     */\n    \n    Image* newImage(bool flipImage = true);\n    \n    CC_DEPRECATED_ATTRIBUTE Image* newCCImage(bool flipImage = true) { return newImage(flipImage); };\n\n    /** saves the texture into a file using JPEG format. The file will be saved in the Documents folder.\n        Returns true if the operation is successful.\n     */\n    bool saveToFile(const std::string& filename);\n\n    /** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder.\n        Returns true if the operation is successful.\n     */\n    bool saveToFile(const std::string& filename, Image::Format format);\n    \n    /** Listen \"come to background\" message, and save render texture.\n     It only has effect on Android.\n     */\n    void listenToBackground(EventCustom *event);\n    \n    /** Listen \"come to foreground\" message and restore the frame buffer object\n     It only has effect on Android.\n     */\n    void listenToForeground(EventCustom *event);\n    \n    /** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when \"autoDraw\" is true. */\n    inline unsigned int getClearFlags() const { return _clearFlags; };\n    inline void setClearFlags(unsigned int clearFlags) { _clearFlags = clearFlags; };\n    \n    /** Clear color value. Valid only when \"autoDraw\" is true. */\n    inline const Color4F& getClearColor() const { return _clearColor; };\n    inline void setClearColor(const Color4F &clearColor) { _clearColor = clearColor; };\n    \n    /** Value for clearDepth. Valid only when \"autoDraw\" is true. */\n    inline float getClearDepth() const { return _clearDepth; };\n    inline void setClearDepth(float clearDepth) { _clearDepth = clearDepth; };\n    \n    /** Value for clear Stencil. Valid only when \"autoDraw\" is true */\n    inline int getClearStencil() const { return _clearStencil; };\n    inline void setClearStencil(int clearStencil) { _clearStencil = clearStencil; };\n    \n    /** When enabled, it will render its children into the texture automatically. Disabled by default for compatiblity reasons.\n     Will be enabled in the future.\n     */\n    inline bool isAutoDraw() const { return _autoDraw; };\n    inline void setAutoDraw(bool isAutoDraw) { _autoDraw = isAutoDraw; };\n\n    /** Gets the Sprite being used. */\n    inline Sprite* getSprite() const { return _sprite; };\n    \n    /** Sets the Sprite being used. */\n    inline void setSprite(Sprite* sprite) {\n        CC_SAFE_RETAIN(sprite);\n        CC_SAFE_RELEASE(_sprite);\n        _sprite = sprite;\n    };\n    \n    // Overrides\n    virtual void visit() override;\n    virtual void draw() override;\n\npublic:\n    // XXX should be procted.\n    // but due to a bug in PowerVR + Android,\n    // the constructor is public again\n    RenderTexture();\n    virtual ~RenderTexture();\n    /** initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */\n    bool initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat format);\n    /** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/\n    bool initWithWidthAndHeight(int w, int h, Texture2D::PixelFormat format, GLuint depthStencilFormat);\n\nprotected:\n    virtual void beginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue, GLbitfield flags);\n\n    GLuint       _FBO;\n    GLuint       _depthRenderBufffer;\n    GLint        _oldFBO;\n    Texture2D* _texture;\n    Texture2D* _textureCopy;    // a copy of _texture\n    Image*     _UITextureImage;\n    Texture2D::PixelFormat _pixelFormat;\n    \n    // code for \"auto\" update\n    GLbitfield   _clearFlags;\n    Color4F    _clearColor;\n    GLclampf     _clearDepth;\n    GLint        _clearStencil;\n    bool         _autoDraw;\n\n    /** The Sprite being used.\n     The sprite, by default, will use the following blending function: GL_ONE, GL_ONE_MINUS_SRC_ALPHA.\n     The blending function can be changed in runtime by calling:\n     - [[renderTexture sprite] setBlendFunc:(BlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}];\n     */\n    Sprite* _sprite;\n    \n    GroupCommand _groupCommand;\n    CustomCommand _beginWithClearCommand;\n    CustomCommand _clearDepthCommand;\n    CustomCommand _clearCommand;\n    CustomCommand _beginCommand;\n    CustomCommand _endCommand;\nprotected:\n    //renderer caches and callbacks\n    void onBegin();\n    void onEnd();\n\n    void onClear();\n    void onClearDepth();\n    \n    kmMat4 _oldTransMatrix, _oldProjMatrix;\n    kmMat4 _transformMatrix, _projectionMatrix;\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(RenderTexture);\n\n};\n\n// end of textures group\n/// @}\n\nNS_CC_END\n\n#endif //__CCRENDER_TEXTURE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCScene.h\"\n#include \"CCDirector.h\"\n#include \"CCLayer.h\"\n#include \"CCSprite.h\"\n#include \"CCSpriteBatchNode.h\"\n#include \"CCPhysicsWorld.h\"\n\nNS_CC_BEGIN\n\nScene::Scene()\n#if CC_USE_PHYSICS\n: _physicsWorld(nullptr)\n#endif\n{\n    _ignoreAnchorPointForPosition = true;\n    setAnchorPoint(Point(0.5f, 0.5f));\n}\n\nScene::~Scene()\n{\n#if CC_USE_PHYSICS\n    CC_SAFE_DELETE(_physicsWorld);\n#endif\n}\n\nbool Scene::init()\n{\n    bool ret = false;\n     do \n     {\n         Director * director;\n         CC_BREAK_IF( ! (director = Director::getInstance()) );\n         this->setContentSize(director->getWinSize());\n         // success\n         ret = true;\n     } while (0);\n     return ret;\n}\n\nScene *Scene::create()\n{\n    Scene *ret = new Scene();\n    if (ret && ret->init())\n    {\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n        return nullptr;\n    }\n}\n\nstd::string Scene::getDescription() const\n{\n    return StringUtils::format(\"<Scene | tag = %d>\", _tag);\n}\n\nScene* Scene::getScene()\n{\n    return this;\n}\n\n#if CC_USE_PHYSICS\nvoid Scene::addChild(Node* child, int zOrder, int tag)\n{\n    Node::addChild(child, zOrder, tag);\n    addChildToPhysicsWorld(child);\n}\n\nvoid Scene::update(float delta)\n{\n    Node::update(delta);\n    if (nullptr != _physicsWorld)\n    {\n        _physicsWorld->update(delta);\n    }\n}\n\nScene *Scene::createWithPhysics()\n{\n    Scene *ret = new Scene();\n    if (ret && ret->initWithPhysics())\n    {\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n        return nullptr;\n    }\n}\n\nbool Scene::initWithPhysics()\n{\n    bool ret = false;\n    do\n    {\n        Director * director;\n        CC_BREAK_IF( ! (director = Director::getInstance()) );\n        this->setContentSize(director->getWinSize());\n        CC_BREAK_IF(! (_physicsWorld = PhysicsWorld::construct(*this)));\n        \n        this->scheduleUpdate();\n        // success\n        ret = true;\n    } while (0);\n    return ret;\n}\n\nvoid Scene::addChildToPhysicsWorld(Node* child)\n{\n    if (_physicsWorld)\n    {\n        std::function<void(Node*)> addToPhysicsWorldFunc = nullptr;\n        addToPhysicsWorldFunc = [this, &addToPhysicsWorldFunc](Node* node) -> void\n        {\n            if (node->getPhysicsBody())\n            {\n                _physicsWorld->addBody(node->getPhysicsBody());\n            }\n            \n            auto& children = node->getChildren();\n            for( const auto &n : children) {\n                addToPhysicsWorldFunc(n);\n            }\n        };\n        \n        addToPhysicsWorldFunc(child);\n    }\n}\n#endif\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCSCENE_H__\n#define __CCSCENE_H__\n\n#include \"CCNode.h\"\n#include \"CCPhysicsWorld.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup scene\n * @{\n */\n\n/** @brief Scene is a subclass of Node that is used only as an abstract concept.\n\nScene and Node are almost identical with the difference that Scene has its\nanchor point (by default) at the center of the screen.\n\nFor the moment Scene has no other logic than that, but in future releases it might have\nadditional logic.\n\nIt is a good practice to use a Scene as the parent of all your nodes.\n*/\nclass CC_DLL Scene : public Node\n{\npublic:\n    /** creates a new Scene object */\n    static Scene *create();\n\n    // Overrides\n    virtual Scene *getScene() override;\n\n    using Node::addChild;\n    virtual std::string getDescription() const override;\n\nprotected:\n    Scene();\n    virtual ~Scene();\n    bool init();\n    \n    friend class Node;\n    friend class SpriteBatchNode;\n    \nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Scene);\n    \n#if CC_USE_PHYSICS\npublic:\n    virtual void addChild(Node* child, int zOrder, int tag) override;\n    virtual void update(float delta) override;\n    inline PhysicsWorld* getPhysicsWorld() { return _physicsWorld; }\n    static Scene *createWithPhysics();\nprotected:\n    bool initWithPhysics();\n    void addChildToPhysicsWorld(Node* child);\n\n    PhysicsWorld* _physicsWorld;\n#endif // CC_USE_PHYSICS\n};\n\n// end of scene group\n/// @}\n\nNS_CC_END\n\n#endif // __CCSCENE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCScheduler.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCScheduler.h\"\n#include \"ccMacros.h\"\n#include \"CCDirector.h\"\n#include \"utlist.h\"\n#include \"ccCArray.h\"\n#include \"CCArray.h\"\n#include \"CCScriptSupport.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n// data structures\n\n// A list double-linked list used for \"updates with priority\"\ntypedef struct _listEntry\n{\n    struct _listEntry   *prev, *next;\n    Object            *target;        // not retained (retained by hashUpdateEntry)\n    int                 priority;\n    bool                paused;\n    bool                markedForDeletion; // selector will no longer be called and entry will be removed at end of the next tick\n} tListEntry;\n\ntypedef struct _hashUpdateEntry\n{\n    tListEntry          **list;        // Which list does it belong to ?\n    tListEntry          *entry;        // entry in the list\n    Object            *target;        // hash key (retained)\n    UT_hash_handle      hh;\n} tHashUpdateEntry;\n\n// Hash Element used for \"selectors with interval\"\ntypedef struct _hashSelectorEntry\n{\n    ccArray             *timers;\n    Object            *target;    // hash key (retained)\n    int        timerIndex;\n    Timer             *currentTimer;\n    bool                currentTimerSalvaged;\n    bool                paused;\n    UT_hash_handle      hh;\n} tHashTimerEntry;\n\n// implementation Timer\n\nTimer::Timer()\n: _target(nullptr)\n, _elapsed(-1)\n, _runForever(false)\n, _useDelay(false)\n, _timesExecuted(0)\n, _repeat(0)\n, _delay(0.0f)\n, _interval(0.0f)\n, _selector(nullptr)\n, _scriptHandler(0)\n{\n}\n\nTimer* Timer::create(Object *target, SEL_SCHEDULE selector)\n{\n    Timer *timer = new Timer();\n\n    timer->initWithTarget(target, selector, 0.0f, kRepeatForever, 0.0f);\n    timer->autorelease();\n\n    return timer;\n}\n\nTimer* Timer::create(Object *target, SEL_SCHEDULE selector, float seconds)\n{\n    Timer *timer = new Timer();\n\n    timer->initWithTarget(target, selector, seconds, kRepeatForever, 0.0f);\n    timer->autorelease();\n\n    return timer;\n}\n\nTimer* Timer::createWithScriptHandler(int handler, float seconds)\n{\n    Timer *timer = new Timer();\n\n    timer->initWithScriptHandler(handler, seconds);\n    timer->autorelease();\n\n    return timer;\n}\n\nbool Timer::initWithScriptHandler(int handler, float seconds)\n{\n    _scriptHandler = handler;\n    _elapsed = -1;\n    _interval = seconds;\n\n    return true;\n}\n\nbool Timer::initWithTarget(Object *target, SEL_SCHEDULE selector)\n{\n    return initWithTarget(target, selector, 0, kRepeatForever, 0.0f);\n}\n\nbool Timer::initWithTarget(Object *target, SEL_SCHEDULE selector, float seconds, unsigned int repeat, float delay)\n{\n    _target = target;\n    _selector = selector;\n    _elapsed = -1;\n    _interval = seconds;\n    _delay = delay;\n    _useDelay = (delay > 0.0f) ? true : false;\n    _repeat = repeat;\n    _runForever = (repeat == kRepeatForever) ? true : false;\n    return true;\n}\n\nvoid Timer::update(float dt)\n{\n    if (_elapsed == -1)\n    {\n        _elapsed = 0;\n        _timesExecuted = 0;\n    }\n    else\n    {\n        if (_runForever && !_useDelay)\n        {//standard timer usage\n            _elapsed += dt;\n            if (_elapsed >= _interval)\n            {\n                if (_target && _selector)\n                {\n                    (_target->*_selector)(_elapsed);\n                }\n\n                if (0 != _scriptHandler)\n                {\n                    SchedulerScriptData data(_scriptHandler,_elapsed);\n                    ScriptEvent event(kScheduleEvent,&data);\n                    ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n                }\n                _elapsed = 0;\n            }\n        }    \n        else\n        {//advanced usage\n            _elapsed += dt;\n            if (_useDelay)\n            {\n                if( _elapsed >= _delay )\n                {\n                    if (_target && _selector)\n                    {\n                        (_target->*_selector)(_elapsed);\n                    }\n\n                    if (0 != _scriptHandler)\n                    {\n                        SchedulerScriptData data(_scriptHandler,_elapsed);\n                        ScriptEvent event(kScheduleEvent,&data);\n                        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n                    }\n\n                    _elapsed = _elapsed - _delay;\n                    _timesExecuted += 1;\n                    _useDelay = false;\n                }\n            }\n            else\n            {\n                if (_elapsed >= _interval)\n                {\n                    if (_target && _selector)\n                    {\n                        (_target->*_selector)(_elapsed);\n                    }\n\n                    if (0 != _scriptHandler)\n                    {\n                        SchedulerScriptData data(_scriptHandler,_elapsed);\n                        ScriptEvent event(kScheduleEvent,&data);\n                        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n                    }\n\n                    _elapsed = 0;\n                    _timesExecuted += 1;\n\n                }\n            }\n\n            if (!_runForever && _timesExecuted > _repeat)\n            {    //unschedule timer\n                Director::getInstance()->getScheduler()->unscheduleSelector(_selector, _target);\n            }\n        }\n    }\n}\n\nfloat Timer::getInterval() const\n{\n    return _interval;\n}\n\nvoid Timer::setInterval(float interval)\n{\n    _interval = interval;\n}\n\nSEL_SCHEDULE Timer::getSelector() const\n{\n    return _selector;\n}\n\n// implementation of Scheduler\n\n// Priority level reserved for system services.\nconst int Scheduler::PRIORITY_SYSTEM = INT_MIN;\n\n// Minimum priority level for user scheduling.\nconst int Scheduler::PRIORITY_NON_SYSTEM_MIN = PRIORITY_SYSTEM + 1;\n\nScheduler::Scheduler(void)\n: _timeScale(1.0f)\n, _updatesNegList(nullptr)\n, _updates0List(nullptr)\n, _updatesPosList(nullptr)\n, _hashForUpdates(nullptr)\n, _hashForTimers(nullptr)\n, _currentTarget(nullptr)\n, _currentTargetSalvaged(false)\n, _updateHashLocked(false)\n, _scriptHandlerEntries(20)\n{\n    // I don't expect to have more than 30 functions to all per frame\n    _functionsToPerform.reserve(30);\n}\n\nScheduler::~Scheduler(void)\n{\n    unscheduleAll();\n}\n\nvoid Scheduler::removeHashElement(_hashSelectorEntry *element)\n{\n\n\tcocos2d::Object *target = element->target;\n\n    ccArrayFree(element->timers);\n    HASH_DEL(_hashForTimers, element);\n    free(element);\n\n    // make sure the target is released after we have removed the hash element\n    // otherwise we access invalid memory when the release call deletes the target\n    // and the target calls removeAllSelectors() during its destructor\n    target->release();\n\n}\n\nvoid Scheduler::scheduleSelector(SEL_SCHEDULE selector, Object *target, float interval, bool paused)\n{\n    this->scheduleSelector(selector, target, interval, kRepeatForever, 0.0f, paused);\n}\n\nvoid Scheduler::scheduleSelector(SEL_SCHEDULE selector, Object *target, float interval, unsigned int repeat, float delay, bool paused)\n{\n    CCASSERT(selector, \"Argument selector must be non-nullptr\");\n    CCASSERT(target, \"Argument target must be non-nullptr\");\n\n    tHashTimerEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForTimers, &target, element);\n\n    if (! element)\n    {\n        element = (tHashTimerEntry *)calloc(sizeof(*element), 1);\n        element->target = target;\n        if (target)\n        {\n            target->retain();\n        }\n        HASH_ADD_PTR(_hashForTimers, target, element);\n\n        // Is this the 1st element ? Then set the pause level to all the selectors of this target\n        element->paused = paused;\n    }\n    else\n    {\n        CCASSERT(element->paused == paused, \"\");\n    }\n\n    if (element->timers == nullptr)\n    {\n        element->timers = ccArrayNew(10);\n    }\n    else \n    {\n        for (int i = 0; i < element->timers->num; ++i)\n        {\n            Timer *timer = (Timer*)element->timers->arr[i];\n\n            if (selector == timer->getSelector())\n            {\n                CCLOG(\"CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: %.4f to %.4f\", timer->getInterval(), interval);\n                timer->setInterval(interval);\n                return;\n            }        \n        }\n        ccArrayEnsureExtraCapacity(element->timers, 1);\n    }\n\n    Timer *pTimer = new Timer();\n    pTimer->initWithTarget(target, selector, interval, repeat, delay);\n    ccArrayAppendObject(element->timers, pTimer);\n    pTimer->release();    \n}\n\nvoid Scheduler::unscheduleSelector(SEL_SCHEDULE selector, Object *target)\n{\n    // explicity handle nil arguments when removing an object\n    if (target == 0 || selector == 0)\n    {\n        return;\n    }\n\n    //CCASSERT(target);\n    //CCASSERT(selector);\n\n    tHashTimerEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForTimers, &target, element);\n\n    if (element)\n    {\n        for (int i = 0; i < element->timers->num; ++i)\n        {\n            Timer *timer = static_cast<Timer*>(element->timers->arr[i]);\n\n            if (selector == timer->getSelector())\n            {\n                if (timer == element->currentTimer && (! element->currentTimerSalvaged))\n                {\n                    element->currentTimer->retain();\n                    element->currentTimerSalvaged = true;\n                }\n\n                ccArrayRemoveObjectAtIndex(element->timers, i, true);\n\n                // update timerIndex in case we are in tick:, looping over the actions\n                if (element->timerIndex >= i)\n                {\n                    element->timerIndex--;\n                }\n\n                if (element->timers->num == 0)\n                {\n                    if (_currentTarget == element)\n                    {\n                        _currentTargetSalvaged = true;\n                    }\n                    else\n                    {\n                        removeHashElement(element);\n                    }\n                }\n\n                return;\n            }\n        }\n    }\n}\n\nvoid Scheduler::priorityIn(tListEntry **list, Object *target, int priority, bool paused)\n{\n    tListEntry *listElement = (tListEntry *)malloc(sizeof(*listElement));\n\n    listElement->target = target;\n    listElement->priority = priority;\n    listElement->paused = paused;\n    listElement->next = listElement->prev = nullptr;\n    listElement->markedForDeletion = false;\n\n    // empty list ?\n    if (! *list)\n    {\n        DL_APPEND(*list, listElement);\n    }\n    else\n    {\n        bool added = false;\n\n        for (tListEntry *element = *list; element; element = element->next)\n        {\n            if (priority < element->priority)\n            {\n                if (element == *list)\n                {\n                    DL_PREPEND(*list, listElement);\n                }\n                else\n                {\n                    listElement->next = element;\n                    listElement->prev = element->prev;\n\n                    element->prev->next = listElement;\n                    element->prev = listElement;\n                }\n\n                added = true;\n                break;\n            }\n        }\n\n        // Not added? priority has the higher value. Append it.\n        if (! added)\n        {\n            DL_APPEND(*list, listElement);\n        }\n    }\n\n    // update hash entry for quick access\n    tHashUpdateEntry *hashElement = (tHashUpdateEntry *)calloc(sizeof(*hashElement), 1);\n    hashElement->target = target;\n    target->retain();\n    hashElement->list = list;\n    hashElement->entry = listElement;\n    HASH_ADD_PTR(_hashForUpdates, target, hashElement);\n}\n\nvoid Scheduler::appendIn(_listEntry **list, Object *target, bool paused)\n{\n    tListEntry *listElement = (tListEntry *)malloc(sizeof(*listElement));\n\n    listElement->target = target;\n    listElement->paused = paused;\n    listElement->markedForDeletion = false;\n\n    DL_APPEND(*list, listElement);\n\n    // update hash entry for quicker access\n    tHashUpdateEntry *hashElement = (tHashUpdateEntry *)calloc(sizeof(*hashElement), 1);\n    hashElement->target = target;\n    target->retain();\n    hashElement->list = list;\n    hashElement->entry = listElement;\n    HASH_ADD_PTR(_hashForUpdates, target, hashElement);\n}\n\nvoid Scheduler::scheduleUpdateForTarget(Object *target, int priority, bool paused)\n{\n\n    tHashUpdateEntry *hashElement = nullptr;\n    HASH_FIND_PTR(_hashForUpdates, &target, hashElement);\n    if (hashElement)\n    {\n#if COCOS2D_DEBUG >= 1\n        CCASSERT(hashElement->entry->markedForDeletion,\"\");\n#endif\n        // TODO: check if priority has changed!\n\n        hashElement->entry->markedForDeletion = false;\n        return;\n    }\n\n    // most of the updates are going to be 0, that's way there\n    // is an special list for updates with priority 0\n    if (priority == 0)\n    {\n        appendIn(&_updates0List, target, paused);\n    }\n    else if (priority < 0)\n    {\n        priorityIn(&_updatesNegList, target, priority, paused);\n    }\n    else\n    {\n        // priority > 0\n        priorityIn(&_updatesPosList, target, priority, paused);\n    }\n}\n\nbool Scheduler::isScheduledForTarget(SEL_SCHEDULE selector, Object *target)\n{\n    CCASSERT(selector, \"Argument selector must be non-nullptr\");\n    CCASSERT(target, \"Argument target must be non-nullptr\");\n    \n    tHashTimerEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForTimers, &target, element);\n    \n    if (!element)\n    {\n        return false;\n    }\n    \n    if (element->timers == nullptr)\n    {\n        return false;\n    }else\n    {\n        for (int i = 0; i < element->timers->num; ++i)\n        {\n            Timer *timer = (Timer*)element->timers->arr[i];\n            \n            if (selector == timer->getSelector())\n            {\n                return true;\n            }\n        }\n        \n        return false;\n    }\n    \n    return false;  // should never get here\n}\n\nvoid Scheduler::removeUpdateFromHash(struct _listEntry *entry)\n{\n    tHashUpdateEntry *element = nullptr;\n\n    HASH_FIND_PTR(_hashForUpdates, &entry->target, element);\n    if (element)\n    {\n        // list entry\n        DL_DELETE(*element->list, element->entry);\n        free(element->entry);\n\n        // hash entry\n        Object* target = element->target;\n        HASH_DEL(_hashForUpdates, element);\n        free(element);\n\n        // target#release should be the last one to prevent\n        // a possible double-free. eg: If the [target dealloc] might want to remove it itself from there\n        target->release();\n    }\n}\n\nvoid Scheduler::unscheduleUpdateForTarget(const Object *target)\n{\n    if (target == nullptr)\n    {\n        return;\n    }\n\n    tHashUpdateEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForUpdates, &target, element);\n    if (element)\n    {\n        if (_updateHashLocked)\n        {\n            element->entry->markedForDeletion = true;\n        }\n        else\n        {\n            this->removeUpdateFromHash(element->entry);\n        }\n    }\n}\n\nvoid Scheduler::unscheduleAll(void)\n{\n    unscheduleAllWithMinPriority(PRIORITY_SYSTEM);\n}\n\nvoid Scheduler::unscheduleAllWithMinPriority(int minPriority)\n{\n    // Custom Selectors\n    tHashTimerEntry *element = nullptr;\n    tHashTimerEntry *nextElement = nullptr;\n    for (element = _hashForTimers; element != nullptr;)\n    {\n        // element may be removed in unscheduleAllSelectorsForTarget\n        nextElement = (tHashTimerEntry *)element->hh.next;\n        unscheduleAllForTarget(element->target);\n\n        element = nextElement;\n    }\n\n    // Updates selectors\n    tListEntry *entry, *tmp;\n    if(minPriority < 0)\n    {\n        DL_FOREACH_SAFE(_updatesNegList, entry, tmp)\n        {\n            if(entry->priority >= minPriority)\n            {\n                unscheduleUpdateForTarget(entry->target);\n            }\n        }\n    }\n\n    if(minPriority <= 0)\n    {\n        DL_FOREACH_SAFE(_updates0List, entry, tmp)\n        {\n            unscheduleUpdateForTarget(entry->target);\n        }\n    }\n\n    DL_FOREACH_SAFE(_updatesPosList, entry, tmp)\n    {\n        if(entry->priority >= minPriority)\n        {\n            unscheduleUpdateForTarget(entry->target);\n        }\n    }\n\n    _scriptHandlerEntries.clear();\n}\n\nvoid Scheduler::unscheduleAllForTarget(Object *target)\n{\n    // explicit nullptr handling\n    if (target == nullptr)\n    {\n        return;\n    }\n\n    // Custom Selectors\n    tHashTimerEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForTimers, &target, element);\n\n    if (element)\n    {\n        if (ccArrayContainsObject(element->timers, element->currentTimer)\n            && (! element->currentTimerSalvaged))\n        {\n            element->currentTimer->retain();\n            element->currentTimerSalvaged = true;\n        }\n        ccArrayRemoveAllObjects(element->timers);\n\n        if (_currentTarget == element)\n        {\n            _currentTargetSalvaged = true;\n        }\n        else\n        {\n            removeHashElement(element);\n        }\n    }\n\n    // update selector\n    unscheduleUpdateForTarget(target);\n}\n\nunsigned int Scheduler::scheduleScriptFunc(unsigned int handler, float interval, bool paused)\n{\n    SchedulerScriptHandlerEntry* entry = SchedulerScriptHandlerEntry::create(handler, interval, paused);\n    _scriptHandlerEntries.pushBack(entry);\n    return entry->getEntryId();\n}\n\nvoid Scheduler::unscheduleScriptEntry(unsigned int scheduleScriptEntryID)\n{\n    for (ssize_t i = _scriptHandlerEntries.size() - 1; i >= 0; i--)\n    {\n        SchedulerScriptHandlerEntry* entry = _scriptHandlerEntries.at(i);\n        if (entry->getEntryId() == (int)scheduleScriptEntryID)\n        {\n            entry->markedForDeletion();\n            break;\n        }\n    }\n}\n\nvoid Scheduler::resumeTarget(Object *target)\n{\n    CCASSERT(target != nullptr, \"\");\n\n    // custom selectors\n    tHashTimerEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForTimers, &target, element);\n    if (element)\n    {\n        element->paused = false;\n    }\n\n    // update selector\n    tHashUpdateEntry *elementUpdate = nullptr;\n    HASH_FIND_PTR(_hashForUpdates, &target, elementUpdate);\n    if (elementUpdate)\n    {\n        CCASSERT(elementUpdate->entry != nullptr, \"\");\n        elementUpdate->entry->paused = false;\n    }\n}\n\nvoid Scheduler::pauseTarget(Object *target)\n{\n    CCASSERT(target != nullptr, \"\");\n\n    // custom selectors\n    tHashTimerEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForTimers, &target, element);\n    if (element)\n    {\n        element->paused = true;\n    }\n\n    // update selector\n    tHashUpdateEntry *elementUpdate = nullptr;\n    HASH_FIND_PTR(_hashForUpdates, &target, elementUpdate);\n    if (elementUpdate)\n    {\n        CCASSERT(elementUpdate->entry != nullptr, \"\");\n        elementUpdate->entry->paused = true;\n    }\n}\n\nbool Scheduler::isTargetPaused(Object *target)\n{\n    CCASSERT( target != nullptr, \"target must be non nil\" );\n\n    // Custom selectors\n    tHashTimerEntry *element = nullptr;\n    HASH_FIND_PTR(_hashForTimers, &target, element);\n    if( element )\n    {\n        return element->paused;\n    }\n    \n    // We should check update selectors if target does not have custom selectors\n\ttHashUpdateEntry *elementUpdate = nullptr;\n\tHASH_FIND_PTR(_hashForUpdates, &target, elementUpdate);\n\tif ( elementUpdate )\n    {\n\t\treturn elementUpdate->entry->paused;\n    }\n    \n    return false;  // should never get here\n}\n\nVector<Object*> Scheduler::pauseAllTargets()\n{\n    return pauseAllTargetsWithMinPriority(PRIORITY_SYSTEM);\n}\n\nVector<Object*> Scheduler::pauseAllTargetsWithMinPriority(int minPriority)\n{\n    Vector<Object*> idsWithSelectors(50);\n\n    // Custom Selectors\n    for(tHashTimerEntry *element = _hashForTimers; element != nullptr;\n        element = (tHashTimerEntry*)element->hh.next)\n    {\n        element->paused = true;\n        idsWithSelectors.pushBack(element->target);\n    }\n\n    // Updates selectors\n    tListEntry *entry, *tmp;\n    if(minPriority < 0)\n    {\n        DL_FOREACH_SAFE( _updatesNegList, entry, tmp ) \n        {\n            if(entry->priority >= minPriority)\n            {\n                entry->paused = true;\n                idsWithSelectors.pushBack(entry->target);\n            }\n        }\n    }\n\n    if(minPriority <= 0)\n    {\n        DL_FOREACH_SAFE( _updates0List, entry, tmp )\n        {\n            entry->paused = true;\n            idsWithSelectors.pushBack(entry->target);\n        }\n    }\n\n    DL_FOREACH_SAFE( _updatesPosList, entry, tmp ) \n    {\n        if(entry->priority >= minPriority) \n        {\n            entry->paused = true;\n            idsWithSelectors.pushBack(entry->target);\n        }\n    }\n\n    return idsWithSelectors;\n}\n\nvoid Scheduler::resumeTargets(const Vector<Object*>& targetsToResume)\n{\n    for(const auto &obj : targetsToResume) {\n        this->resumeTarget(obj);\n    }\n}\n\nvoid Scheduler::performFunctionInCocosThread(const std::function<void ()> &function)\n{\n    _performMutex.lock();\n\n    _functionsToPerform.push_back(function);\n\n    _performMutex.unlock();\n}\n\n// main loop\nvoid Scheduler::update(float dt)\n{\n    _updateHashLocked = true;\n\n    if (_timeScale != 1.0f)\n    {\n        dt *= _timeScale;\n    }\n\n    //\n    // Selector callbacks\n    //\n\n    // Iterate over all the Updates' selectors\n    tListEntry *entry, *tmp;\n\n    // updates with priority < 0\n    DL_FOREACH_SAFE(_updatesNegList, entry, tmp)\n    {\n        if ((! entry->paused) && (! entry->markedForDeletion))\n        {\n            entry->target->update(dt);\n        }\n    }\n\n    // updates with priority == 0\n    DL_FOREACH_SAFE(_updates0List, entry, tmp)\n    {\n        if ((! entry->paused) && (! entry->markedForDeletion))\n        {\n            entry->target->update(dt);\n        }\n    }\n\n    // updates with priority > 0\n    DL_FOREACH_SAFE(_updatesPosList, entry, tmp)\n    {\n        if ((! entry->paused) && (! entry->markedForDeletion))\n        {\n            entry->target->update(dt);\n        }\n    }\n\n    // Iterate over all the custom selectors\n    for (tHashTimerEntry *elt = _hashForTimers; elt != nullptr; )\n    {\n        _currentTarget = elt;\n        _currentTargetSalvaged = false;\n\n        if (! _currentTarget->paused)\n        {\n            // The 'timers' array may change while inside this loop\n            for (elt->timerIndex = 0; elt->timerIndex < elt->timers->num; ++(elt->timerIndex))\n            {\n                elt->currentTimer = (Timer*)(elt->timers->arr[elt->timerIndex]);\n                elt->currentTimerSalvaged = false;\n\n                elt->currentTimer->update(dt);\n\n                if (elt->currentTimerSalvaged)\n                {\n                    // The currentTimer told the remove itself. To prevent the timer from\n                    // accidentally deallocating itself before finishing its step, we retained\n                    // it. Now that step is done, it's safe to release it.\n                    elt->currentTimer->release();\n                }\n\n                elt->currentTimer = nullptr;\n            }\n        }\n\n        // elt, at this moment, is still valid\n        // so it is safe to ask this here (issue #490)\n        elt = (tHashTimerEntry *)elt->hh.next;\n\n        // only delete currentTarget if no actions were scheduled during the cycle (issue #481)\n        if (_currentTargetSalvaged && _currentTarget->timers->num == 0)\n        {\n            removeHashElement(_currentTarget);\n        }\n    }\n\n    // delete all updates that are marked for deletion\n    // updates with priority < 0\n    DL_FOREACH_SAFE(_updatesNegList, entry, tmp)\n    {\n        if (entry->markedForDeletion)\n        {\n            this->removeUpdateFromHash(entry);\n        }\n    }\n\n    // updates with priority == 0\n    DL_FOREACH_SAFE(_updates0List, entry, tmp)\n    {\n        if (entry->markedForDeletion)\n        {\n            this->removeUpdateFromHash(entry);\n        }\n    }\n\n    // updates with priority > 0\n    DL_FOREACH_SAFE(_updatesPosList, entry, tmp)\n    {\n        if (entry->markedForDeletion)\n        {\n            this->removeUpdateFromHash(entry);\n        }\n    }\n\n    _updateHashLocked = false;\n    _currentTarget = nullptr;\n\n    //\n    // Script callbacks\n    //\n\n    // Iterate over all the script callbacks\n    if (!_scriptHandlerEntries.empty())\n    {\n        for (auto i = _scriptHandlerEntries.size() - 1; i >= 0; i--)\n        {\n            SchedulerScriptHandlerEntry* eachEntry = _scriptHandlerEntries.at(i);\n            if (eachEntry->isMarkedForDeletion())\n            {\n                _scriptHandlerEntries.erase(i);\n            }\n            else if (!eachEntry->isPaused())\n            {\n                eachEntry->getTimer()->update(dt);\n            }\n        }\n    }\n\n    //\n    // Functions allocated from another thread\n    //\n\n    // Testing size is faster than locking / unlocking.\n    // And almost never there will be functions scheduled to be called.\n    if( !_functionsToPerform.empty() ) {\n        _performMutex.lock();\n        for( const auto &function : _functionsToPerform ) {\n            function();\n        }\n        _functionsToPerform.clear();\n        _performMutex.unlock();\n    }\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCScheduler.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCSCHEDULER_H__\n#define __CCSCHEDULER_H__\n\n#include \"CCObject.h\"\n#include \"CCVector.h\"\n#include \"uthash.h\"\n\n#include <functional>\n#include <mutex>\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup global\n * @{\n */\n\n//\n// Timer\n//\n/** @brief Light-weight timer */\n//\nclass CC_DLL Timer : public Object\n{\npublic:\n    /** Allocates a timer with a target and a selector. */\n    static Timer* create(Object *target, SEL_SCHEDULE selector);\n    /** Allocates a timer with a target, a selector and an interval in seconds. */\n    static Timer* create(Object *target, SEL_SCHEDULE selector, float seconds);\n    /** Allocates a timer with a script callback function and an interval in seconds. \n     * @js NA\n     * @lua NA\n     */\n    static Timer* createWithScriptHandler(int handler, float seconds);\n\n    CC_DEPRECATED_ATTRIBUTE static Timer* timerWithTarget(Object *target, SEL_SCHEDULE selector) { return Timer::create(target, selector); }\n    CC_DEPRECATED_ATTRIBUTE static Timer* timerWithTarget(Object *target, SEL_SCHEDULE selector, float seconds) { return Timer::create(target, selector, seconds); }\n    CC_DEPRECATED_ATTRIBUTE static Timer* timerWithScriptHandler(int handler, float seconds) { return Timer::createWithScriptHandler(handler, seconds); }\n\n    Timer(void);\n\n    /** Initializes a timer with a target and a selector. */\n    bool initWithTarget(Object *target, SEL_SCHEDULE selector);\n    /** Initializes a timer with a target, a selector and an interval in seconds, repeat in number of times to repeat, delay in seconds. */\n    bool initWithTarget(Object *target, SEL_SCHEDULE selector, float seconds, unsigned int repeat, float delay);\n    /** Initializes a timer with a script callback function and an interval in seconds. */\n    bool initWithScriptHandler(int handler, float seconds);\n\n    /** get interval in seconds */\n    float getInterval() const;\n    /** set interval in seconds */\n    void setInterval(float interval);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    SEL_SCHEDULE getSelector() const;\n\n    /** triggers the timer */\n    void update(float dt);\n    \n    inline int getScriptHandler() const { return _scriptHandler; };\n\nprotected:\n    Object *_target;\n    float _elapsed;\n    bool _runForever;\n    bool _useDelay;\n    unsigned int _timesExecuted;\n    unsigned int _repeat; //0 = once, 1 is 2 x executed\n    float _delay;\n    float _interval;\n    SEL_SCHEDULE _selector;\n    \n    int _scriptHandler;\n};\n\n//\n// Scheduler\n//\nstruct _listEntry;\nstruct _hashSelectorEntry;\nstruct _hashUpdateEntry;\nclass SchedulerScriptHandlerEntry;\n\n/** @brief Scheduler is responsible for triggering the scheduled callbacks.\nYou should not use NSTimer. Instead use this class.\n\nThere are 2 different types of callbacks (selectors):\n\n- update selector: the 'update' selector will be called every frame. You can customize the priority.\n- custom selector: A custom selector will be called every frame, or with a custom interval of time\n\nThe 'custom selectors' should be avoided when possible. It is faster, and consumes less memory to use the 'update selector'.\n\n*/\nclass CC_DLL Scheduler : public Object\n{\npublic:\n    // Priority level reserved for system services.\n    static const int PRIORITY_SYSTEM;\n    \n    // Minimum priority level for user scheduling.\n    static const int PRIORITY_NON_SYSTEM_MIN;\n    /**\n     * @js ctor\n     */\n    Scheduler();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~Scheduler(void);\n\n    inline float getTimeScale() { return _timeScale; }\n    /** Modifies the time of all scheduled callbacks.\n    You can use this property to create a 'slow motion' or 'fast forward' effect.\n    Default is 1.0. To create a 'slow motion' effect, use values below 1.0.\n    To create a 'fast forward' effect, use values higher than 1.0.\n    @since v0.8\n    @warning It will affect EVERY scheduled selector / action.\n    */\n    inline void setTimeScale(float timeScale) { _timeScale = timeScale; }\n\n    /** 'update' the scheduler.\n     You should NEVER call this method, unless you know what you are doing.\n     * @js NA\n     * @lua NA\n     */\n    void update(float dt);\n\n    /** The scheduled method will be called every 'interval' seconds.\n     If paused is true, then it won't be called until it is resumed.\n     If 'interval' is 0, it will be called every frame, but if so, it's recommended to use 'scheduleUpdateForTarget:' instead.\n     If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it again.\n     repeat let the action be repeated repeat + 1 times, use kRepeatForever to let the action run continuously\n     delay is the amount of time the action will wait before it'll start\n\n     @since v0.99.3, repeat and delay added in v1.1\n     */\n    void scheduleSelector(SEL_SCHEDULE selector, Object *target, float interval, unsigned int repeat, float delay, bool paused);\n\n    /** calls scheduleSelector with kRepeatForever and a 0 delay */\n    void scheduleSelector(SEL_SCHEDULE selector, Object *target, float interval, bool paused);\n    /** Schedules the 'update' selector for a given target with a given priority.\n     The 'update' selector will be called every frame.\n     The lower the priority, the earlier it is called.\n     @since v0.99.3\n     */\n    void scheduleUpdateForTarget(Object *target, int priority, bool paused);\n    \n    /** Checks whether a selector for a given taget is scheduled.\n     @since v3.0.0\n     */\n    bool isScheduledForTarget(SEL_SCHEDULE selector, Object *target);\n\n    /** Unschedule a selector for a given target.\n     If you want to unschedule the \"update\", use unscheudleUpdateForTarget.\n     @since v0.99.3\n     */\n    void unscheduleSelector(SEL_SCHEDULE selector, Object *target);\n\n    /** Unschedules the update selector for a given target\n     @since v0.99.3\n     */\n    void unscheduleUpdateForTarget(const Object *target);\n\n    /** Unschedules all selectors for a given target.\n     This also includes the \"update\" selector.\n     @since v0.99.3\n     */\n    void unscheduleAllForTarget(Object *target);\n\n    /** Unschedules all selectors from all targets.\n     You should NEVER call this method, unless you know what you are doing.\n\n     @since v0.99.3\n     */\n    void unscheduleAll(void);\n    \n    /** Unschedules all selectors from all targets with a minimum priority.\n      You should only call this with kPriorityNonSystemMin or higher.\n      @since v2.0.0\n      */\n    void unscheduleAllWithMinPriority(int minPriority);\n\n    /** The scheduled script callback will be called every 'interval' seconds.\n     If paused is true, then it won't be called until it is resumed.\n     If 'interval' is 0, it will be called every frame.\n     return schedule script entry ID, used for unscheduleScriptFunc().\n     */\n    unsigned int scheduleScriptFunc(unsigned int handler, float interval, bool paused);\n    \n    /** Unschedule a script entry. */\n    void unscheduleScriptEntry(unsigned int scheduleScriptEntryID);\n\n    /** Pauses the target.\n     All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed.\n     If the target is not present, nothing happens.\n     @since v0.99.3\n     */\n    void pauseTarget(Object *target);\n\n    /** Resumes the target.\n     The 'target' will be unpaused, so all schedule selectors/update will be 'ticked' again.\n     If the target is not present, nothing happens.\n     @since v0.99.3\n     */\n    void resumeTarget(Object *target);\n\n    /** Returns whether or not the target is paused\n    @since v1.0.0\n    * In js: var isTargetPaused(var jsObject)\n    * @lua NA \n    */\n    bool isTargetPaused(Object *target);\n\n    /** Pause all selectors from all targets.\n      You should NEVER call this method, unless you know what you are doing.\n     @since v2.0.0\n      */\n    Vector<Object*> pauseAllTargets();\n\n    /** Pause all selectors from all targets with a minimum priority.\n      You should only call this with kPriorityNonSystemMin or higher.\n      @since v2.0.0\n      */\n    Vector<Object*> pauseAllTargetsWithMinPriority(int minPriority);\n\n    /** Resume selectors on a set of targets.\n     This can be useful for undoing a call to pauseAllSelectors.\n     @since v2.0.0\n      */\n    void resumeTargets(const Vector<Object*>& targetsToResume);\n\n    /** calls a function on the cocos2d thread. Useful when you need to call a cocos2d function from another thread.\n     This function is thread safe.\n     @since v3.0\n     */\n    void performFunctionInCocosThread( const std::function<void()> &function);\n\nprotected:\n    void removeHashElement(struct _hashSelectorEntry *element);\n    void removeUpdateFromHash(struct _listEntry *entry);\n\n    // update specific\n\n    void priorityIn(struct _listEntry **list, Object *target, int priority, bool paused);\n    void appendIn(struct _listEntry **list, Object *target, bool paused);\n\n\n    float _timeScale;\n\n    //\n    // \"updates with priority\" stuff\n    //\n    struct _listEntry *_updatesNegList;        // list of priority < 0\n    struct _listEntry *_updates0List;            // list priority == 0\n    struct _listEntry *_updatesPosList;        // list priority > 0\n    struct _hashUpdateEntry *_hashForUpdates; // hash used to fetch quickly the list entries for pause,delete,etc\n\n    // Used for \"selectors with interval\"\n    struct _hashSelectorEntry *_hashForTimers;\n    struct _hashSelectorEntry *_currentTarget;\n    bool _currentTargetSalvaged;\n    // If true unschedule will not remove anything from a hash. Elements will only be marked for deletion.\n    bool _updateHashLocked;\n    Vector<SchedulerScriptHandlerEntry*> _scriptHandlerEntries;\n\n    // Used for \"perform Function\"\n    std::vector<std::function<void()>> _functionsToPerform;\n    std::mutex _performMutex;\n};\n\n// end of global group\n/// @}\n\nNS_CC_END\n\n#endif // __CCSCHEDULER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCScriptSupport.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCScriptSupport.h\"\n#include \"CCScheduler.h\"\n\nbool CC_DLL cc_assert_script_compatible(const char *msg)\n{\n    cocos2d::ScriptEngineProtocol* engine = cocos2d::ScriptEngineManager::getInstance()->getScriptEngine();\n    if (engine && engine->handleAssert(msg))\n    {\n        return true;\n    }\n    return false;\n}\n\nNS_CC_BEGIN\n\n// #pragma mark -\n// #pragma mark ScriptHandlerEntry\n\nScriptHandlerEntry* ScriptHandlerEntry::create(int handler)\n{\n    ScriptHandlerEntry* entry = new ScriptHandlerEntry(handler);\n    entry->autorelease();\n    return entry;\n}\n\nScriptHandlerEntry::~ScriptHandlerEntry(void)\n{\n    ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_handler);\n}\n\n// #pragma mark -\n// #pragma mark SchedulerScriptHandlerEntry\n\nSchedulerScriptHandlerEntry* SchedulerScriptHandlerEntry::create(int handler, float interval, bool paused)\n{\n    SchedulerScriptHandlerEntry* entry = new SchedulerScriptHandlerEntry(handler);\n    entry->init(interval, paused);\n    entry->autorelease();\n    return entry;\n}\n\nbool SchedulerScriptHandlerEntry::init(float interval, bool paused)\n{\n    _timer = new Timer();\n    _timer->initWithScriptHandler(_handler, interval);\n    _timer->autorelease();\n    _timer->retain();\n    _paused = paused;\n    LUALOG(\"[LUA] ADD script schedule: %d, entryID: %d\", _handler, _entryId);\n    return true;\n}\n\nSchedulerScriptHandlerEntry::~SchedulerScriptHandlerEntry(void)\n{\n    _timer->release();\n    LUALOG(\"[LUA] DEL script schedule %d, entryID: %d\", _handler, _entryId);\n}\n\n\n// #pragma mark -\n// #pragma mark TouchScriptHandlerEntry\n\nTouchScriptHandlerEntry* TouchScriptHandlerEntry::create(int handler,\n                                                             bool isMultiTouches,\n                                                             int priority,\n                                                             bool swallowsTouches)\n{\n    TouchScriptHandlerEntry* entry = new TouchScriptHandlerEntry(handler);\n    entry->init(isMultiTouches, priority, swallowsTouches);\n    entry->autorelease();\n    return entry;\n}\n\nTouchScriptHandlerEntry::~TouchScriptHandlerEntry(void)\n{\n    ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_handler);\n    LUALOG(\"[LUA] Remove touch event handler: %d\", _handler);\n}\n\nbool TouchScriptHandlerEntry::init(bool isMultiTouches, int priority, bool swallowsTouches)\n{\n    _isMultiTouches = isMultiTouches;\n    _priority = priority;\n    _swallowsTouches = swallowsTouches;\n    \n    return true;\n}\n\n// #pragma mark -\n// #pragma mark ScriptEngineManager\n\nstatic ScriptEngineManager* s_pSharedScriptEngineManager = nullptr;\n\n\nScriptEngineManager::~ScriptEngineManager(void)\n{\n    removeScriptEngine();\n}\n\nvoid ScriptEngineManager::setScriptEngine(ScriptEngineProtocol *scriptEngine)\n{\n    removeScriptEngine();\n    _scriptEngine = scriptEngine;\n}\n\nvoid ScriptEngineManager::removeScriptEngine(void)\n{\n    if (_scriptEngine)\n    {\n        delete _scriptEngine;\n        _scriptEngine = nullptr;\n    }\n}\n\nScriptEngineManager* ScriptEngineManager::getInstance()\n{\n    if (!s_pSharedScriptEngineManager)\n    {\n        s_pSharedScriptEngineManager = new ScriptEngineManager();\n    }\n    return s_pSharedScriptEngineManager;\n}\n\nvoid ScriptEngineManager::destroyInstance()\n{\n    if (s_pSharedScriptEngineManager)\n    {\n        delete s_pSharedScriptEngineManager;\n        s_pSharedScriptEngineManager = nullptr;\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCScriptSupport.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __SCRIPT_SUPPORT_H__\n#define __SCRIPT_SUPPORT_H__\n\n#include \"platform/CCCommon.h\"\n#include \"CCTouch.h\"\n#include \"CCEventTouch.h\"\n#include \"CCEventKeyboard.h\"\n#include \"CCSet.h\"\n#include <map>\n#include <string>\n#include <list>\n\ntypedef struct lua_State lua_State;\n\nNS_CC_BEGIN\n\nclass Timer;\nclass Layer;\nclass MenuItem;\nclass CallFunc;\nclass Acceleration;\n\nenum ccScriptType {\n    kScriptTypeNone = 0,\n    kScriptTypeLua,\n    kScriptTypeJavascript\n};\n\nclass ScriptHandlerEntry : public Object\n{\npublic:\n    static ScriptHandlerEntry* create(int handler);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ScriptHandlerEntry(void);\n    \n    int getHandler(void) {\n        return _handler;\n    }\n    \n    int getEntryId(void) {\n        return _entryId;\n    }\n    \nprotected:\n    ScriptHandlerEntry(int handler)\n    : _handler(handler)\n    {\n        static int newEntryId = 0;\n        newEntryId++;\n        _entryId = newEntryId;\n    }\n    \n    int _handler;\n    int _entryId;\n};\n\n/**\n * @addtogroup script_support\n * @{\n */\n\nclass SchedulerScriptHandlerEntry : public ScriptHandlerEntry\n{\npublic:\n    // nHandler return by tolua_ref_function(), called from LuaCocos2d.cpp\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static SchedulerScriptHandlerEntry* create(int handler, float interval, bool paused);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~SchedulerScriptHandlerEntry(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    cocos2d::Timer* getTimer(void) {\n        return _timer;\n    }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool isPaused(void) {\n        return _paused;\n    }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void markedForDeletion(void) {\n        _markedForDeletion = true;\n    }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool isMarkedForDeletion(void) {\n        return _markedForDeletion;\n    }\n    \nprivate:\n    SchedulerScriptHandlerEntry(int handler)\n    : ScriptHandlerEntry(handler)\n    , _timer(nullptr)\n    , _paused(false)\n    , _markedForDeletion(false)\n    {\n    }\n    bool init(float interval, bool paused);\n    \n    cocos2d::Timer*   _timer;\n    bool                _paused;\n    bool                _markedForDeletion;\n};\n\n\n\nclass TouchScriptHandlerEntry : public ScriptHandlerEntry\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static TouchScriptHandlerEntry* create(int handler, bool isMultiTouches, int priority, bool swallowsTouches);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~TouchScriptHandlerEntry(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool isMultiTouches(void) {\n        return _isMultiTouches;\n    }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    int getPriority(void) {\n        return _priority;\n    }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool getSwallowsTouches(void) {\n        return _swallowsTouches;\n    }\n    \nprivate:\n    TouchScriptHandlerEntry(int handler)\n    : ScriptHandlerEntry(handler)\n    , _isMultiTouches(false)\n    , _priority(0)\n    , _swallowsTouches(false)\n    {\n    }\n    bool init(bool isMultiTouches, int priority, bool swallowsTouches);\n    \n    bool    _isMultiTouches;\n    int     _priority;\n    bool    _swallowsTouches;\n};\n\nenum ScriptEventType\n{\n    kNodeEvent = 0,\n    kMenuClickedEvent,\n    kCallFuncEvent,\n    kScheduleEvent,\n    kTouchEvent,\n    kTouchesEvent,\n    kKeypadEvent,\n    kAccelerometerEvent,\n    kControlEvent,\n    kCommonEvent,\n};\n\nstruct BasicScriptData\n{\n    // nativeobject:to get handler for lua or to get jsobject for js\n    void* nativeObject;\n    // value: a pointer to a object that already defined\n    void* value;\n    \n    // Constructor\n    /**\n     * @js NA\n     * @lua NA\n     */\n    BasicScriptData(void* inObject,void* inValue = nullptr)\n    : nativeObject(inObject),value(inValue)\n    {\n    }\n};\n\nstruct SchedulerScriptData\n{\n    // lua use\n    int handler;\n    float elapse;\n    // js use\n    void* node;\n    \n    // Constructor\n    /**\n     * @js NA\n     * @lua NA\n     */\n    SchedulerScriptData(int inHandler,float inElapse,void* inNode = nullptr)\n    : handler(inHandler),\n      elapse(inElapse),\n      node(inNode)\n    {\n    }\n};\n\nstruct TouchesScriptData\n{\n    EventTouch::EventCode actionType;\n    void* nativeObject;\n    const std::vector<Touch*>& touches;\n    \n    // Constructor\n    /**\n     * @js NA\n     * @lua NA\n     */\n    TouchesScriptData(EventTouch::EventCode inActionType, void* inNativeObject, const std::vector<Touch*>& inTouches)\n    : actionType(inActionType),\n      nativeObject(inNativeObject),\n      touches(inTouches)\n    {\n    }\n};\n\nstruct TouchScriptData\n{\n    EventTouch::EventCode actionType;\n    void* nativeObject;\n    Touch* touch;\n    \n    // Constructor\n    /**\n     * @js NA\n     * @lua NA\n     */\n    TouchScriptData(EventTouch::EventCode inActionType, void* inNativeObject, Touch* inTouch)\n    : actionType(inActionType),\n      nativeObject(inNativeObject),\n      touch(inTouch)\n    {\n    }\n};\n\nstruct KeypadScriptData\n{\n    EventKeyboard::KeyCode actionType;\n    void* nativeObject;\n    \n    // Constructor\n    /**\n     * @js NA\n     * @lua NA\n     */\n    KeypadScriptData(EventKeyboard::KeyCode inActionType,void* inNativeObject)\n    : actionType(inActionType),nativeObject(inNativeObject)\n    {\n    }\n};\n\nstruct CommonScriptData\n{\n    // Now this struct is only used in LuaBinding.\n    int handler;\n    char eventName[64];\n    Object* eventSource;\n    char eventSourceClassName[64];\n    \n    // Constructor\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CommonScriptData(int inHandler,const char* inName,Object* inSource = nullptr,const char* inClassName = nullptr)\n    : handler(inHandler),\n      eventSource(inSource)\n    {\n        strncpy(eventName, inName, 64);\n        \n        if (nullptr == inClassName)\n        {\n            memset(eventSourceClassName, 0, 64*sizeof(char));\n        }\n        else\n        {\n            strncpy(eventSourceClassName, inClassName, 64);\n        }\n    }\n};\n\nstruct ScriptEvent\n{\n    ScriptEventType type;\n    void* data;\n    \n    // Constructor\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ScriptEvent(ScriptEventType inType,void* inData)\n    : type(inType),\n      data(inData)\n    {\n    }\n};\n\n// Don't make ScriptEngineProtocol inherits from Object since setScriptEngine is invoked only once in AppDelegate.cpp,\n// It will affect the lifecycle of ScriptCore instance, the autorelease pool will be destroyed before destructing ScriptCore.\n// So a crash will appear on Win32 if you click the close button.\nclass CC_DLL ScriptEngineProtocol\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ScriptEngineProtocol() {};\n    \n    /** Get script type \n     * @js NA\n     * @lua NA\n     */\n    virtual ccScriptType getScriptType() { return kScriptTypeNone; };\n\n    /** Remove script object. \n     * @js NA\n     * @lua NA\n     */\n    virtual void removeScriptObjectByObject(Object* obj) = 0;\n    \n    /** Remove script function handler, only LuaEngine class need to implement this function. \n     * @js NA\n     * @lua NA\n     */\n    virtual void removeScriptHandler(int handler) {};\n    \n    /** Reallocate script function handler, only LuaEngine class need to implement this function. \n     * @js NA\n     * @lua NA\n     */\n    virtual int reallocateScriptHandler(int handler) { return 0;}\n    \n    /**\n     @brief Execute script code contained in the given string.\n     @param codes holding the valid script code that should be executed.\n     @return 0 if the string is executed correctly.\n     @return other if the string is executed wrongly.\n     * @js NA\n     * @lua NA\n     */\n    virtual int executeString(const char* codes) = 0;\n    \n    /**\n     @brief Execute a script file.\n     @param filename String object holding the filename of the script file that is to be executed\n     * @js NA\n     * @lua NA\n     */\n    virtual int executeScriptFile(const char* filename) = 0;\n    \n    /**\n     @brief Execute a scripted global function.\n     @brief The function should not take any parameters and should return an integer.\n     @param functionName String object holding the name of the function, in the global script environment, that is to be executed.\n     @return The integer value returned from the script function.\n     * @js NA\n     * @lua NA\n     */\n    virtual int executeGlobalFunction(const char* functionName) = 0;\n    \n    /**when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be nullptr in lua\n     * @js NA\n     * @lua NA\n     */\n    virtual int sendEvent(ScriptEvent* evt) = 0;\n    \n    /** called by CCAssert to allow scripting engine to handle failed assertions\n     * @return true if the assert was handled by the script engine, false otherwise.\n     * @js NA\n     * @lua NA\n     */\n    virtual bool handleAssert(const char *msg) = 0;\n    \n    enum class ConfigType\n    {\n        NONE,\n        COCOSTUDIO\n    };\n    /** Parse configuration file */\n    virtual bool parseConfig(ConfigType type, const std::string& str) = 0;\n};\n\n/**\n ScriptEngineManager is a singleton which holds an object instance of ScriptEngineProtocl\n It helps cocos2d-x and the user code to find back LuaEngine object\n @since v0.99.5-x-0.8.5\n */\nclass CC_DLL ScriptEngineManager\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ScriptEngineManager(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ScriptEngineProtocol* getScriptEngine(void) {\n        return _scriptEngine;\n    }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setScriptEngine(ScriptEngineProtocol *scriptEngine);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void removeScriptEngine(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static ScriptEngineManager* getInstance();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static void destroyInstance();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static ScriptEngineManager* sharedManager() { return ScriptEngineManager::getInstance(); };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static void purgeSharedManager() { ScriptEngineManager::destroyInstance(); };\n    \nprivate:\n    ScriptEngineManager(void)\n    : _scriptEngine(nullptr)\n    {\n    }\n    \n    ScriptEngineProtocol *_scriptEngine;\n};\n\n// end of script_support group\n/// @}\n\nNS_CC_END\n\n#endif // __SCRIPT_SUPPORT_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCShaderCache.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCShaderCache.h\"\n#include \"CCGLProgram.h\"\n#include \"ccMacros.h\"\n#include \"ccShaders.h\"\n\nNS_CC_BEGIN\n\nenum {\n    kShaderType_PositionTextureColor,\n    kShaderType_PositionTextureColor_noMVP,\n    kShaderType_PositionTextureColorAlphaTest,\n    kShaderType_PositionColor,\n    kShaderType_PositionColor_noMVP,\n    kShaderType_PositionTexture,\n    kShaderType_PositionTexture_uColor,\n    kShaderType_PositionTextureA8Color,\n    kShaderType_Position_uColor,\n    kShaderType_PositionLengthTexureColor,\n    kShaderType_LabelDistanceFieldNormal,\n    kShaderType_LabelDistanceFieldGlow,\n    kShaderType_LabelDistanceFieldOutline,\n    kShaderType_LabelDistanceFieldShadow,\n    kShaderType_MAX,\n};\n\nstatic ShaderCache *_sharedShaderCache = 0;\n\nShaderCache* ShaderCache::getInstance()\n{\n    if (!_sharedShaderCache) {\n        _sharedShaderCache = new ShaderCache();\n        if (!_sharedShaderCache->init())\n        {\n            CC_SAFE_DELETE(_sharedShaderCache);\n        }\n    }\n    return _sharedShaderCache;\n}\n\nvoid ShaderCache::destroyInstance()\n{\n    CC_SAFE_RELEASE_NULL(_sharedShaderCache);\n}\n\n// XXX: deprecated\nShaderCache* ShaderCache::sharedShaderCache()\n{\n    return ShaderCache::getInstance();\n}\n\n// XXX: deprecated\nvoid ShaderCache::purgeSharedShaderCache()\n{\n    ShaderCache::destroyInstance();\n}\n\nShaderCache::ShaderCache()\n: _programs()\n{\n\n}\n\nShaderCache::~ShaderCache()\n{\n    for( auto it = _programs.begin(); it != _programs.end(); ++it ) {\n        (it->second)->release();\n    }\n\n    CCLOGINFO(\"deallocing ShaderCache: %p\", this);\n}\n\nbool ShaderCache::init()\n{    \n    loadDefaultShaders();\n    return true;\n}\n\nvoid ShaderCache::loadDefaultShaders()\n{\n    // Position Texture Color shader\n    GLProgram *p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionTextureColor);\n    _programs.insert( std::make_pair( GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR, p ) );\n\n    // Position Texture Color without MVP shader\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionTextureColor_noMVP);\n    _programs.insert( std::make_pair( GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP, p ) );\n\n    // Position Texture Color alpha test\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionTextureColorAlphaTest);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST, p) );\n\n    //\n    // Position, Color shader\n    //\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionColor);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_COLOR, p) );\n\n    //\n    // Position, Color shader no MVP\n    //\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionColor_noMVP);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP, p) );\n\n    //\n    // Position Texture shader\n    //\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionTexture);\n    _programs.insert( std::make_pair( GLProgram::SHADER_NAME_POSITION_TEXTURE, p) );\n\n    //\n    // Position, Texture attribs, 1 Color as uniform shader\n    //\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionTexture_uColor);\n    _programs.insert( std::make_pair( GLProgram::SHADER_NAME_POSITION_TEXTURE_U_COLOR, p) );\n\n    //\n    // Position Texture A8 Color shader\n    //\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionTextureA8Color);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR, p) );\n\n    //\n    // Position and 1 color passed as a uniform (to simulate glColor4ub )\n    //\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_Position_uColor);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_U_COLOR, p) );\n    \n    //\n\t// Position, Legth(TexCoords, Color (used by Draw Node basically )\n\t//\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_PositionLengthTexureColor);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR, p) );\n\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldNormal);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL, p) );\n\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldGlow);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW, p) );\n\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldOutline);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_OUTLINE, p) );\n\n    p = new GLProgram();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldShadow);\n    _programs.insert( std::make_pair(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_SHADOW, p) );\n}\n\nvoid ShaderCache::reloadDefaultShaders()\n{\n    // reset all programs and reload them\n    \n    // Position Texture Color shader\n    GLProgram *p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR);    \n    p->reset();\n    loadDefaultShader(p, kShaderType_PositionTextureColor);\n\n    // Position Texture Color without MVP shader\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP);\n    p->reset();    \n    loadDefaultShader(p, kShaderType_PositionTextureColor_noMVP);\n\n    // Position Texture Color alpha test\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST);\n    p->reset();    \n    loadDefaultShader(p, kShaderType_PositionTextureColorAlphaTest);\n    \n    //\n    // Position, Color shader\n    //\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_COLOR);\n    p->reset();\n    loadDefaultShader(p, kShaderType_PositionColor);\n    \n    //\n    // Position, Color shader no MVP\n    //\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP);\n    loadDefaultShader(p, kShaderType_PositionColor_noMVP);\n\n    //\n    // Position Texture shader\n    //\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE);\n    p->reset();\n    loadDefaultShader(p, kShaderType_PositionTexture);\n    \n    //\n    // Position, Texture attribs, 1 Color as uniform shader\n    //\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_U_COLOR);\n    p->reset();\n    loadDefaultShader(p, kShaderType_PositionTexture_uColor);\n    \n    //\n    // Position Texture A8 Color shader\n    //\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_A8_COLOR);\n    p->reset();\n    loadDefaultShader(p, kShaderType_PositionTextureA8Color);\n    \n    //\n    // Position and 1 color passed as a uniform (to simulate glColor4ub )\n    //\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_U_COLOR);\n    p->reset();\n    loadDefaultShader(p, kShaderType_Position_uColor);\n    \n    //\n\t// Position, Legth(TexCoords, Color (used by Draw Node basically )\n\t//\n    p = getProgram(GLProgram::SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR);\n    p->reset();\n    loadDefaultShader(p, kShaderType_PositionLengthTexureColor);\n\n    p = getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL);\n    p->reset();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldNormal);\n\n    p = getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_GLOW);\n    p->reset();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldGlow);\n\n    p = getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_OUTLINE);\n    p->reset();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldOutline);\n\n    p = getProgram(GLProgram::SHADER_NAME_LABEL_DISTANCEFIELD_SHADOW);\n    p->reset();\n    loadDefaultShader(p, kShaderType_LabelDistanceFieldShadow);\n}\n\nvoid ShaderCache::loadDefaultShader(GLProgram *p, int type)\n{\n    switch (type) {\n        case kShaderType_PositionTextureColor:\n            p->initWithVertexShaderByteArray(ccPositionTextureColor_vert, ccPositionTextureColor_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n            \n            break;\n        case kShaderType_PositionTextureColor_noMVP:\n            p->initWithVertexShaderByteArray(ccPositionTextureColor_noMVP_vert, ccPositionTextureColor_noMVP_frag);\n\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n\n        case kShaderType_PositionTextureColorAlphaTest:\n            p->initWithVertexShaderByteArray(ccPositionTextureColor_vert, ccPositionTextureColorAlphaTest_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        case kShaderType_PositionColor:  \n            p->initWithVertexShaderByteArray(ccPositionColor_vert ,ccPositionColor_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n\n            break;\n        case kShaderType_PositionColor_noMVP:\n            p->initWithVertexShaderByteArray(ccPositionTextureColor_noMVP_vert ,ccPositionColor_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            break;\n        case kShaderType_PositionTexture:\n            p->initWithVertexShaderByteArray(ccPositionTexture_vert ,ccPositionTexture_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        case kShaderType_PositionTexture_uColor:\n            p->initWithVertexShaderByteArray(ccPositionTexture_uColor_vert, ccPositionTexture_uColor_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        case kShaderType_PositionTextureA8Color:\n            p->initWithVertexShaderByteArray(ccPositionTextureA8Color_vert, ccPositionTextureA8Color_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        case kShaderType_Position_uColor:\n            p->initWithVertexShaderByteArray(ccPosition_uColor_vert, ccPosition_uColor_frag);    \n            \n            p->addAttribute(\"aVertex\", GLProgram::VERTEX_ATTRIB_POSITION);    \n            \n            break;\n        case kShaderType_PositionLengthTexureColor:\n            p->initWithVertexShaderByteArray(ccPositionColorLengthTexture_vert, ccPositionColorLengthTexture_frag);\n            \n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            \n            break;\n        case kShaderType_LabelDistanceFieldNormal:\n            p->initWithVertexShaderByteArray(ccLabelDistanceFieldNormal_vert, ccLabelDistanceFieldNormal_frag);\n\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        case kShaderType_LabelDistanceFieldGlow:\n            p->initWithVertexShaderByteArray(ccLabelDistanceFieldGlow_vert, ccLabelDistanceFieldGlow_frag);\n\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        case kShaderType_LabelDistanceFieldOutline:\n            p->initWithVertexShaderByteArray(ccLabelDistanceFieldOutline_vert, ccLabelDistanceFieldOutline_frag);\n\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        case kShaderType_LabelDistanceFieldShadow:\n            p->initWithVertexShaderByteArray(ccLabelDistanceFieldShadow_vert, ccLabelDistanceFieldShadow_frag);\n\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n            p->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n\n            break;\n        default:\n            CCLOG(\"cocos2d: %s:%d, error shader type\", __FUNCTION__, __LINE__);\n            return;\n    }\n    \n    p->link();\n    p->updateUniforms();\n    \n    CHECK_GL_ERROR_DEBUG();\n}\n\nGLProgram* ShaderCache::getProgram(const std::string &key)\n{\n    auto it = _programs.find(key);\n    if( it != _programs.end() )\n        return it->second;\n    return nullptr;\n}\n\nvoid ShaderCache::addProgram(GLProgram* program, const std::string &key)\n{\n    program->retain();\n    _programs.insert( std::make_pair( key, program) );\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCShaderCache.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCSHADERCACHE_H__\n#define __CCSHADERCACHE_H__\n\n#include <string>\n#include <unordered_map>\n\n#include \"CCDictionary.h\"\n\nNS_CC_BEGIN\n\nclass GLProgram;\n\n/**\n * @addtogroup shaders\n * @{\n */\n\n/** ShaderCache\n Singleton that stores manages GL shaders\n @since v2.0\n */\nclass CC_DLL ShaderCache : public Object \n{\npublic:\n    /**\n     * @js ctor\n     */\n    ShaderCache();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ShaderCache();\n\n    /** returns the shared instance */\n    static ShaderCache* getInstance();\n\n    /** purges the cache. It releases the retained instance. */\n    static void destroyInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static ShaderCache* sharedShaderCache();\n\n    /** @deprecated Use destroyInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static void purgeSharedShaderCache();\n\n    /** loads the default shaders */\n    void loadDefaultShaders();\n    \n    /** reload the default shaders */\n    void reloadDefaultShaders();\n\n    /** returns a GL program for a given key \n     */\n    GLProgram * getProgram(const std::string &key);\n    /** @deprecated Use getProgram() instead\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE GLProgram * programForKey(const std::string &key){ return getProgram(key); }\n\n    /** adds a GLProgram to the cache for a given name */\n    void addProgram(GLProgram* program, const std::string &key);\n\nprivate:\n    bool init();\n    void loadDefaultShader(GLProgram *program, int type);\n\n//    Dictionary* _programs;\n    std::unordered_map<std::string, GLProgram*> _programs;\n};\n\n// end of shaders group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCSHADERCACHE_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSprite.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCSpriteBatchNode.h\"\n#include <string.h>\n#include <algorithm>\n#include \"CCAnimation.h\"\n#include \"CCAnimationCache.h\"\n#include \"ccConfig.h\"\n#include \"CCSprite.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCSpriteFrameCache.h\"\n#include \"CCTextureCache.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"CCShaderCache.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCGLProgram.h\"\n#include \"CCDirector.h\"\n#include \"CCGeometry.h\"\n#include \"CCTexture2D.h\"\n#include \"CCAffineTransform.h\"\n#include \"TransformUtils.h\"\n#include \"CCProfiling.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCQuadCommand.h\"\n#include \"renderer/CCFrustum.h\"\n\n// external\n#include \"kazmath/GL/matrix.h\"\n\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL\n#define RENDER_IN_SUBPIXEL\n#else\n#define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__))\n#endif\n\nSprite* Sprite::createWithTexture(Texture2D *texture)\n{\n    Sprite *sprite = new Sprite();\n    if (sprite && sprite->initWithTexture(texture))\n    {\n        sprite->autorelease();\n        return sprite;\n    }\n    CC_SAFE_DELETE(sprite);\n    return nullptr;\n}\n\nSprite* Sprite::createWithTexture(Texture2D *texture, const Rect& rect, bool rotated)\n{\n    Sprite *sprite = new Sprite();\n    if (sprite && sprite->initWithTexture(texture, rect, rotated))\n    {\n        sprite->autorelease();\n        return sprite;\n    }\n    CC_SAFE_DELETE(sprite);\n    return nullptr;\n}\n\nSprite* Sprite::create(const std::string& filename)\n{\n    Sprite *sprite = new Sprite();\n    if (sprite && sprite->initWithFile(filename))\n    {\n        sprite->autorelease();\n        return sprite;\n    }\n    CC_SAFE_DELETE(sprite);\n    return nullptr;\n}\n\nSprite* Sprite::create(const std::string& filename, const Rect& rect)\n{\n    Sprite *sprite = new Sprite();\n    if (sprite && sprite->initWithFile(filename, rect))\n    {\n        sprite->autorelease();\n        return sprite;\n    }\n    CC_SAFE_DELETE(sprite);\n    return nullptr;\n}\n\nSprite* Sprite::createWithSpriteFrame(SpriteFrame *spriteFrame)\n{\n    Sprite *sprite = new Sprite();\n    if (spriteFrame && sprite && sprite->initWithSpriteFrame(spriteFrame))\n    {\n        sprite->autorelease();\n        return sprite;\n    }\n    CC_SAFE_DELETE(sprite);\n    return nullptr;\n}\n\nSprite* Sprite::createWithSpriteFrameName(const std::string& spriteFrameName)\n{\n    SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);\n    \n#if COCOS2D_DEBUG > 0\n    char msg[256] = {0};\n    sprintf(msg, \"Invalid spriteFrameName: %s\", spriteFrameName.c_str());\n    CCASSERT(frame != nullptr, msg);\n#endif\n    \n    return createWithSpriteFrame(frame);\n}\n\nSprite* Sprite::create()\n{\n    Sprite *sprite = new Sprite();\n    if (sprite && sprite->init())\n    {\n        sprite->autorelease();\n        return sprite;\n    }\n    CC_SAFE_DELETE(sprite);\n    return nullptr;\n}\n\nbool Sprite::init(void)\n{\n    return initWithTexture(nullptr, Rect::ZERO );\n}\n\nbool Sprite::initWithTexture(Texture2D *texture)\n{\n    CCASSERT(texture != nullptr, \"Invalid texture for sprite\");\n\n    Rect rect = Rect::ZERO;\n    rect.size = texture->getContentSize();\n\n    return initWithTexture(texture, rect);\n}\n\nbool Sprite::initWithTexture(Texture2D *texture, const Rect& rect)\n{\n    return initWithTexture(texture, rect, false);\n}\n\nbool Sprite::initWithFile(const std::string& filename)\n{\n    CCASSERT(filename.size()>0, \"Invalid filename for sprite\");\n\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename);\n    if (texture)\n    {\n        Rect rect = Rect::ZERO;\n        rect.size = texture->getContentSize();\n        return initWithTexture(texture, rect);\n    }\n\n    // don't release here.\n    // when load texture failed, it's better to get a \"transparent\" sprite then a crashed program\n    // this->release();\n    return false;\n}\n\nbool Sprite::initWithFile(const std::string &filename, const Rect& rect)\n{\n    CCASSERT(filename.size()>0, \"Invalid filename\");\n\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename);\n    if (texture)\n    {\n        return initWithTexture(texture, rect);\n    }\n\n    // don't release here.\n    // when load texture failed, it's better to get a \"transparent\" sprite then a crashed program\n    // this->release();\n    return false;\n}\n\nbool Sprite::initWithSpriteFrameName(const std::string& spriteFrameName)\n{\n    CCASSERT(spriteFrameName.size() > 0, \"Invalid spriteFrameName\");\n\n    SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);\n    return initWithSpriteFrame(frame);\n}\n\nbool Sprite::initWithSpriteFrame(SpriteFrame *spriteFrame)\n{\n    CCASSERT(spriteFrame != nullptr, \"\");\n\n    bool bRet = initWithTexture(spriteFrame->getTexture(), spriteFrame->getRect());\n    setSpriteFrame(spriteFrame);\n\n    return bRet;\n}\n\n// designated initializer\nbool Sprite::initWithTexture(Texture2D *texture, const Rect& rect, bool rotated)\n{\n    bool result;\n    if (Node::init())\n    {\n        _batchNode = nullptr;\n        \n        _recursiveDirty = false;\n        setDirty(false);\n        \n        _opacityModifyRGB = true;\n        \n        _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n        \n        _flippedX = _flippedY = false;\n        \n        // default transform anchor: center\n        setAnchorPoint(Point(0.5f, 0.5f));\n        \n        // zwoptex default values\n        _offsetPosition = Point::ZERO;\n\n        // clean the Quad\n        memset(&_quad, 0, sizeof(_quad));\n        \n        // Atlas: Color\n        _quad.bl.colors = Color4B::WHITE;\n        _quad.br.colors = Color4B::WHITE;\n        _quad.tl.colors = Color4B::WHITE;\n        _quad.tr.colors = Color4B::WHITE;\n        \n        // shader program\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP));\n        \n        // update texture (calls updateBlendFunc)\n        setTexture(texture);\n        setTextureRect(rect, rotated, rect.size);\n        \n        // by default use \"Self Render\".\n        // if the sprite is added to a batchnode, then it will automatically switch to \"batchnode Render\"\n        setBatchNode(nullptr);\n        result = true;\n    }\n    else\n    {\n        result = false;\n    }\n    _recursiveDirty = true;\n    setDirty(true);\n    return result;\n}\n\nSprite::Sprite(void)\n: _shouldBeHidden(false)\n, _texture(nullptr)\n{\n}\n\nSprite::~Sprite(void)\n{\n    CC_SAFE_RELEASE(_texture);\n}\n\n/*\n * Texture methods\n */\n\n/*\n * This array is the data of a white image with 2 by 2 dimension.\n * It's used for creating a default texture when sprite's texture is set to nullptr.\n * Supposing codes as follows:\n *\n *   auto sp = new Sprite();\n *   sp->init();  // Texture was set to nullptr, in order to make opacity and color to work correctly, we need to create a 2x2 white texture.\n *\n * The test is in \"TestCpp/SpriteTest/Sprite without texture\".\n */\nstatic unsigned char cc_2x2_white_image[] = {\n    // RGBA8888\n    0xFF, 0xFF, 0xFF, 0xFF,\n    0xFF, 0xFF, 0xFF, 0xFF,\n    0xFF, 0xFF, 0xFF, 0xFF,\n    0xFF, 0xFF, 0xFF, 0xFF\n};\n\n#define CC_2x2_WHITE_IMAGE_KEY  \"/cc_2x2_white_image\"\n\nvoid Sprite::setTexture(const std::string &filename)\n{\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(filename);\n    setTexture(texture);\n\n    Rect rect = Rect::ZERO;\n    rect.size = texture->getContentSize();\n    setTextureRect(rect);\n}\n\nvoid Sprite::setTexture(Texture2D *texture)\n{\n    // If batchnode, then texture id should be the same\n    CCASSERT(! _batchNode || texture->getName() == _batchNode->getTexture()->getName(), \"CCSprite: Batched sprites should use the same texture as the batchnode\");\n    // accept texture==nil as argument\n    CCASSERT( !texture || dynamic_cast<Texture2D*>(texture), \"setTexture expects a Texture2D. Invalid argument\");\n\n    if (texture == nullptr)\n    {\n        // Gets the texture by key firstly.\n        texture = Director::getInstance()->getTextureCache()->getTextureForKey(CC_2x2_WHITE_IMAGE_KEY);\n\n        // If texture wasn't in cache, create it from RAW data.\n        if (texture == nullptr)\n        {\n            Image* image = new Image();\n            bool isOK = image->initWithRawData(cc_2x2_white_image, sizeof(cc_2x2_white_image), 2, 2, 8);\n            CCASSERT(isOK, \"The 2x2 empty texture was created unsuccessfully.\");\n\n            texture = Director::getInstance()->getTextureCache()->addImage(image, CC_2x2_WHITE_IMAGE_KEY);\n            CC_SAFE_RELEASE(image);\n        }\n    }\n\n    if (!_batchNode && _texture != texture)\n    {\n        CC_SAFE_RETAIN(texture);\n        CC_SAFE_RELEASE(_texture);\n        _texture = texture;\n        updateBlendFunc();\n    }\n}\n\nTexture2D* Sprite::getTexture() const\n{\n    return _texture;\n}\n\nvoid Sprite::setTextureRect(const Rect& rect)\n{\n    setTextureRect(rect, false, rect.size);\n}\n\nvoid Sprite::setTextureRect(const Rect& rect, bool rotated, const Size& untrimmedSize)\n{\n    _rectRotated = rotated;\n\n    setContentSize(untrimmedSize);\n    setVertexRect(rect);\n    setTextureCoords(rect);\n\n    Point relativeOffset = _unflippedOffsetPositionFromCenter;\n\n    // issue #732\n    if (_flippedX)\n    {\n        relativeOffset.x = -relativeOffset.x;\n    }\n    if (_flippedY)\n    {\n        relativeOffset.y = -relativeOffset.y;\n    }\n\n    _offsetPosition.x = relativeOffset.x + (_contentSize.width - _rect.size.width) / 2;\n    _offsetPosition.y = relativeOffset.y + (_contentSize.height - _rect.size.height) / 2;\n\n    // rendering using batch node\n    if (_batchNode)\n    {\n        // update dirty_, don't update recursiveDirty_\n        setDirty(true);\n    }\n    else\n    {\n        // self rendering\n        \n        // Atlas: Vertex\n        float x1 = 0 + _offsetPosition.x;\n        float y1 = 0 + _offsetPosition.y;\n        float x2 = x1 + _rect.size.width;\n        float y2 = y1 + _rect.size.height;\n\n        // Don't update Z.\n        _quad.bl.vertices = Vertex3F(x1, y1, 0);\n        _quad.br.vertices = Vertex3F(x2, y1, 0);\n        _quad.tl.vertices = Vertex3F(x1, y2, 0);\n        _quad.tr.vertices = Vertex3F(x2, y2, 0);\n    }\n}\n\n// override this method to generate \"double scale\" sprites\nvoid Sprite::setVertexRect(const Rect& rect)\n{\n    _rect = rect;\n}\n\nvoid Sprite::setTextureCoords(Rect rect)\n{\n    rect = CC_RECT_POINTS_TO_PIXELS(rect);\n\n    Texture2D *tex = _batchNode ? _textureAtlas->getTexture() : _texture;\n    if (! tex)\n    {\n        return;\n    }\n\n    float atlasWidth = (float)tex->getPixelsWide();\n    float atlasHeight = (float)tex->getPixelsHigh();\n\n    float left, right, top, bottom;\n\n    if (_rectRotated)\n    {\n#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n        left    = (2*rect.origin.x+1)/(2*atlasWidth);\n        right   = left+(rect.size.height*2-2)/(2*atlasWidth);\n        top     = (2*rect.origin.y+1)/(2*atlasHeight);\n        bottom  = top+(rect.size.width*2-2)/(2*atlasHeight);\n#else\n        left    = rect.origin.x/atlasWidth;\n        right   = (rect.origin.x+rect.size.height) / atlasWidth;\n        top     = rect.origin.y/atlasHeight;\n        bottom  = (rect.origin.y+rect.size.width) / atlasHeight;\n#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n\n        if (_flippedX)\n        {\n            CC_SWAP(top, bottom, float);\n        }\n\n        if (_flippedY)\n        {\n            CC_SWAP(left, right, float);\n        }\n\n        _quad.bl.texCoords.u = left;\n        _quad.bl.texCoords.v = top;\n        _quad.br.texCoords.u = left;\n        _quad.br.texCoords.v = bottom;\n        _quad.tl.texCoords.u = right;\n        _quad.tl.texCoords.v = top;\n        _quad.tr.texCoords.u = right;\n        _quad.tr.texCoords.v = bottom;\n    }\n    else\n    {\n#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n        left    = (2*rect.origin.x+1)/(2*atlasWidth);\n        right    = left + (rect.size.width*2-2)/(2*atlasWidth);\n        top        = (2*rect.origin.y+1)/(2*atlasHeight);\n        bottom    = top + (rect.size.height*2-2)/(2*atlasHeight);\n#else\n        left    = rect.origin.x/atlasWidth;\n        right    = (rect.origin.x + rect.size.width) / atlasWidth;\n        top        = rect.origin.y/atlasHeight;\n        bottom    = (rect.origin.y + rect.size.height) / atlasHeight;\n#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n\n        if(_flippedX)\n        {\n            CC_SWAP(left,right,float);\n        }\n\n        if(_flippedY)\n        {\n            CC_SWAP(top,bottom,float);\n        }\n\n        _quad.bl.texCoords.u = left;\n        _quad.bl.texCoords.v = bottom;\n        _quad.br.texCoords.u = right;\n        _quad.br.texCoords.v = bottom;\n        _quad.tl.texCoords.u = left;\n        _quad.tl.texCoords.v = top;\n        _quad.tr.texCoords.u = right;\n        _quad.tr.texCoords.v = top;\n    }\n}\n\nvoid Sprite::updateTransform(void)\n{\n    CCASSERT(_batchNode, \"updateTransform is only valid when Sprite is being rendered using an SpriteBatchNode\");\n\n#if CC_USE_PHYSICS\n    if (updatePhysicsTransform())\n    {\n        setDirty(true);\n    };\n#endif\n\n    // recalculate matrix only if it is dirty\n    if( isDirty() ) {\n\n        // If it is not visible, or one of its ancestors is not visible, then do nothing:\n        if( !_visible || ( _parent && _parent != _batchNode && static_cast<Sprite*>(_parent)->_shouldBeHidden) )\n        {\n            _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vertex3F(0,0,0);\n            _shouldBeHidden = true;\n        }\n        else\n        {\n            _shouldBeHidden = false;\n\n            if( ! _parent || _parent == _batchNode )\n            {\n                _transformToBatch = getNodeToParentTransform();\n            }\n            else\n            {\n                CCASSERT( dynamic_cast<Sprite*>(_parent), \"Logic error in Sprite. Parent must be a Sprite\");\n                kmMat4 nodeToParent = getNodeToParentTransform();\n                kmMat4 parentTransform = static_cast<Sprite*>(_parent)->_transformToBatch;\n                kmMat4Multiply(&_transformToBatch, &parentTransform, &nodeToParent);\n            }\n\n            //\n            // calculate the Quad based on the Affine Matrix\n            //\n\n            Size size = _rect.size;\n\n            float x1 = _offsetPosition.x;\n            float y1 = _offsetPosition.y;\n\n            float x2 = x1 + size.width;\n            float y2 = y1 + size.height;\n            float x = _transformToBatch.mat[12];\n            float y = _transformToBatch.mat[13];\n\n            float cr = _transformToBatch.mat[0];\n            float sr = _transformToBatch.mat[1];\n            float cr2 = _transformToBatch.mat[5];\n            float sr2 = -_transformToBatch.mat[4];\n            float ax = x1 * cr - y1 * sr2 + x;\n            float ay = x1 * sr + y1 * cr2 + y;\n\n            float bx = x2 * cr - y1 * sr2 + x;\n            float by = x2 * sr + y1 * cr2 + y;\n\n            float cx = x2 * cr - y2 * sr2 + x;\n            float cy = x2 * sr + y2 * cr2 + y;\n\n            float dx = x1 * cr - y2 * sr2 + x;\n            float dy = x1 * sr + y2 * cr2 + y;\n\n            _quad.bl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _vertexZ );\n            _quad.br.vertices = Vertex3F( RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _vertexZ );\n            _quad.tl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _vertexZ );\n            _quad.tr.vertices = Vertex3F( RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _vertexZ );\n        }\n\n        // MARMALADE CHANGE: ADDED CHECK FOR nullptr, TO PERMIT SPRITES WITH NO BATCH NODE / TEXTURE ATLAS\n        if (_textureAtlas)\n\t\t{\n            _textureAtlas->updateQuad(&_quad, _atlasIndex);\n        }\n\n        _recursiveDirty = false;\n        setDirty(false);\n    }\n\n    // MARMALADE CHANGED\n    // recursively iterate over children\n/*    if( _hasChildren )\n    {\n        // MARMALADE: CHANGED TO USE Node*\n        // NOTE THAT WE HAVE ALSO DEFINED virtual Node::updateTransform()\n        arrayMakeObjectsPerformSelector(_children, updateTransform, Sprite*);\n    }*/\n    Node::updateTransform();\n\n#if CC_SPRITE_DEBUG_DRAW\n    // draw bounding box\n    Point vertices[4] = {\n        Point( _quad.bl.vertices.x, _quad.bl.vertices.y ),\n        Point( _quad.br.vertices.x, _quad.br.vertices.y ),\n        Point( _quad.tr.vertices.x, _quad.tr.vertices.y ),\n        Point( _quad.tl.vertices.x, _quad.tl.vertices.y ),\n    };\n    ccDrawPoly(vertices, 4, true);\n#endif // CC_SPRITE_DEBUG_DRAW\n}\n\n// draw\n\n//void Sprite::draw(void)\n//{\n//    CC_PROFILER_START_CATEGORY(kProfilerCategorySprite, \"CCSprite - draw\");\n//\n//    CCASSERT(!_batchNode, \"If Sprite is being rendered by SpriteBatchNode, Sprite#draw SHOULD NOT be called\");\n//\n//    CC_NODE_DRAW_SETUP();\n//\n//    GL::blendFunc( _blendFunc.src, _blendFunc.dst );\n//\n//    GL::bindTexture2D( _texture->getName() );\n//    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX );\n//\n//#define kQuadSize sizeof(_quad.bl)\n//#ifdef EMSCRIPTEN\n//    long offset = 0;\n//    setGLBufferData(&_quad, 4 * kQuadSize, 0);\n//#else\n//    long offset = (long)&_quad;\n//#endif // EMSCRIPTEN\n//\n//    // vertex\n//    int diff = offsetof( V3F_C4B_T2F, vertices);\n//    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (void*) (offset + diff));\n//\n//    // texCoods\n//    diff = offsetof( V3F_C4B_T2F, texCoords);\n//    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (void*)(offset + diff));\n//\n//    // color\n//    diff = offsetof( V3F_C4B_T2F, colors);\n//    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (void*)(offset + diff));\n//\n//\n//    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);\n//\n//    CHECK_GL_ERROR_DEBUG();\n//\n//\n//#if CC_SPRITE_DEBUG_DRAW == 1\n//    // draw bounding box\n//    Point vertices[4]={\n//        Point(_quad.tl.vertices.x,_quad.tl.vertices.y),\n//        Point(_quad.bl.vertices.x,_quad.bl.vertices.y),\n//        Point(_quad.br.vertices.x,_quad.br.vertices.y),\n//        Point(_quad.tr.vertices.x,_quad.tr.vertices.y),\n//    };\n//    ccDrawPoly(vertices, 4, true);\n//#elif CC_SPRITE_DEBUG_DRAW == 2\n//    // draw texture box\n//    Size s = this->getTextureRect().size;\n//    Point offsetPix = this->getOffsetPosition();\n//    Point vertices[4] = {\n//        Point(offsetPix.x,offsetPix.y), Point(offsetPix.x+s.width,offsetPix.y),\n//        Point(offsetPix.x+s.width,offsetPix.y+s.height), Point(offsetPix.x,offsetPix.y+s.height)\n//    };\n//    ccDrawPoly(vertices, 4, true);\n//#endif // CC_SPRITE_DEBUG_DRAW\n//\n//    CC_INCREMENT_GL_DRAWS(1);\n//\n//    CC_PROFILER_STOP_CATEGORY(kProfilerCategorySprite, \"CCSprite - draw\");\n//}\n\nvoid Sprite::draw(void)\n{\n    //TODO implement z order\n    _quadCommand.init(_globalZOrder, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, _modelViewTransform);\n\n//    if(culling())\n    {\n        Director::getInstance()->getRenderer()->addCommand(&_quadCommand);\n    }\n}\n\nbool Sprite::culling() const\n{\n    Frustum* frustum = Director::getInstance()->getFrustum();\n    //TODO optimize this transformation, should use parent's transformation instead\n    kmMat4 worldTM = getNodeToWorldTransform();\n    //generate aabb\n\n    //\n    // calculate the Quad based on the Affine Matrix\n    //\n    Rect newRect = RectApplyTransform(_rect, worldTM);\n\n    kmVec3 point = {newRect.getMinX(), newRect.getMinY(), _vertexZ};\n    \n    AABB aabb(point,point);\n    kmVec3Fill(&point,newRect.getMaxX(), newRect.getMinY(), _vertexZ);\n    aabb.expand(point);\n    kmVec3Fill(&point,newRect.getMinX(), newRect.getMaxY(), _vertexZ);\n    aabb.expand(point);\n    kmVec3Fill(&point,newRect.getMaxX(), newRect.getMaxY(), _vertexZ);\n    aabb.expand(point);\n\n    return Frustum::IntersectResult::OUTSIDE !=frustum->intersectAABB(aabb);\n}\n\nvoid Sprite::updateQuadVertices()\n{\n#if CC_USE_PHYSICS\n    updatePhysicsTransform();\n    setDirty(true);\n#endif\n\n    //TODO optimize the performance cache affineTransformation\n\n    // recalculate matrix only if it is dirty\n    if(isDirty())\n    {\n\n//        if( ! _parent || _parent == (Node*)_batchNode )\n//        {\n//            _transformToBatch = getNodeToParentTransform();\n//        }\n//        else\n//        {\n//            CCASSERT( dynamic_cast<Sprite*>(_parent), \"Logic error in Sprite. Parent must be a Sprite\");\n//            _transformToBatch = AffineTransformConcat( getNodeToParentTransform() , static_cast<Sprite*>(_parent)->_transformToBatch );\n//        }\n\n        //TODO optimize this transformation, should use parent's transformation instead\n        _transformToBatch = getNodeToWorldTransform();\n\n        //\n        // calculate the Quad based on the Affine Matrix\n        //\n        Rect newRect = RectApplyTransform(_rect, _transformToBatch);\n\n        _quad.bl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(newRect.getMinX()), RENDER_IN_SUBPIXEL(newRect.getMinY()), _vertexZ );\n        _quad.br.vertices = Vertex3F( RENDER_IN_SUBPIXEL(newRect.getMaxX()), RENDER_IN_SUBPIXEL(newRect.getMinY()), _vertexZ );\n        _quad.tl.vertices = Vertex3F( RENDER_IN_SUBPIXEL(newRect.getMinX()), RENDER_IN_SUBPIXEL(newRect.getMaxY()), _vertexZ );\n        _quad.tr.vertices = Vertex3F( RENDER_IN_SUBPIXEL(newRect.getMaxX()), RENDER_IN_SUBPIXEL(newRect.getMaxY()), _vertexZ );\n        \n        _recursiveDirty = false;\n        setDirty(false);\n    }\n}\n\n// Node overrides\n\nvoid Sprite::addChild(Node *child, int zOrder, int tag)\n{\n    CCASSERT(child != nullptr, \"Argument must be non-nullptr\");\n\n    if (_batchNode)\n    {\n        Sprite* childSprite = dynamic_cast<Sprite*>(child);\n        CCASSERT( childSprite, \"CCSprite only supports Sprites as children when using SpriteBatchNode\");\n        CCASSERT(childSprite->getTexture()->getName() == _textureAtlas->getTexture()->getName(), \"\");\n        //put it in descendants array of batch node\n        _batchNode->appendChild(childSprite);\n\n        if (!_reorderChildDirty)\n        {\n            setReorderChildDirtyRecursively();\n        }\n    }\n    //CCNode already sets isReorderChildDirty_ so this needs to be after batchNode check\n    Node::addChild(child, zOrder, tag);\n}\n\nvoid Sprite::reorderChild(Node *child, int zOrder)\n{\n    CCASSERT(child != nullptr, \"child must be non null\");\n    CCASSERT(_children.contains(child), \"child does not belong to this\");\n\n    if( _batchNode && ! _reorderChildDirty)\n    {\n        setReorderChildDirtyRecursively();\n        _batchNode->reorderBatch(true);\n    }\n\n    Node::reorderChild(child, zOrder);\n}\n\nvoid Sprite::removeChild(Node *child, bool cleanup)\n{\n    if (_batchNode)\n    {\n        _batchNode->removeSpriteFromAtlas((Sprite*)(child));\n    }\n\n    Node::removeChild(child, cleanup);\n}\n\nvoid Sprite::removeAllChildrenWithCleanup(bool cleanup)\n{\n    if (_batchNode)\n    {\n        for(const auto &child : _children) {\n            Sprite* sprite = dynamic_cast<Sprite*>(child);\n            if (sprite)\n            {\n                _batchNode->removeSpriteFromAtlas(sprite);\n            }\n        }\n    }\n\n    Node::removeAllChildrenWithCleanup(cleanup);\n}\n\nvoid Sprite::sortAllChildren()\n{\n    if (_reorderChildDirty)\n    {\n#if 0\n        int i = 0, j = 0, length = _children->count();\n\n        // insertion sort\n        for(i=1; i<length; i++)\n        {\n            j = i-1;\n            auto tempI = static_cast<Node*>( _children->getObjectAtIndex(i) );\n            auto tempJ = static_cast<Node*>( _children->getObjectAtIndex(j) );\n\n            //continue moving element downwards while zOrder is smaller or when zOrder is the same but mutatedIndex is smaller\n            while(j>=0 && ( tempI->getLocalZOrder() < tempJ->getLocalZOrder() ||\n                           ( tempI->getLocalZOrder() == tempJ->getLocalZOrder() &&\n                            tempI->getOrderOfArrival() < tempJ->getOrderOfArrival() ) ) )\n            {\n                _children->fastSetObject( tempJ, j+1 );\n                j = j-1;\n                if(j>=0)\n                    tempJ = static_cast<Node*>( _children->getObjectAtIndex(j) );\n            }\n            _children->fastSetObject(tempI, j+1);\n        }\n#else\n        std::sort(std::begin(_children), std::end(_children), nodeComparisonLess);\n#endif\n\n        if ( _batchNode)\n        {\n            for(const auto &child : _children)\n                child->sortAllChildren();\n        }\n\n        _reorderChildDirty = false;\n    }\n}\n\n//\n// Node property overloads\n// used only when parent is SpriteBatchNode\n//\n\nvoid Sprite::setReorderChildDirtyRecursively(void)\n{\n    //only set parents flag the first time\n    if ( ! _reorderChildDirty )\n    {\n        _reorderChildDirty = true;\n        Node* node = static_cast<Node*>(_parent);\n        while (node && node != _batchNode)\n        {\n            static_cast<Sprite*>(node)->setReorderChildDirtyRecursively();\n            node=node->getParent();\n        }\n    }\n}\n\n\nvoid Sprite::setDirtyRecursively(bool bValue)\n{\n    _recursiveDirty = bValue;\n    setDirty(bValue);\n\n    for(const auto &child: _children) {\n        Sprite* sp = dynamic_cast<Sprite*>(child);\n        if (sp)\n        {\n            sp->setDirtyRecursively(true);\n        }\n    }\n}\n\n// XXX HACK: optimization\n#define SET_DIRTY_RECURSIVELY() {                       \\\n                    if (! _recursiveDirty) {            \\\n                        _recursiveDirty = true;         \\\n                        setDirty(true);                 \\\n                        if (!_children.empty())         \\\n                            setDirtyRecursively(true);  \\\n                        }                               \\\n                    }\n\nvoid Sprite::setPosition(const Point& pos)\n{\n    Node::setPosition(pos);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setPosition(float x, float y)\n{\n    Node::setPosition(x, y);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setRotation(float rotation)\n{\n    Node::setRotation(rotation);\n    \n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setRotationX(float fRotationX)\n{\n    Node::setRotationX(fRotationX);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setRotationY(float fRotationY)\n{\n    Node::setRotationY(fRotationY);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setSkewX(float sx)\n{\n    Node::setSkewX(sx);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setSkewY(float sy)\n{\n    Node::setSkewY(sy);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setScaleX(float scaleX)\n{\n    Node::setScaleX(scaleX);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setScaleY(float scaleY)\n{\n    Node::setScaleY(scaleY);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setScale(float fScale)\n{\n    Node::setScale(fScale);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setScale(float scaleX, float scaleY)\n{\n    Node::setScale(scaleX, scaleY);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setVertexZ(float fVertexZ)\n{\n    Node::setVertexZ(fVertexZ);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setAnchorPoint(const Point& anchor)\n{\n    Node::setAnchorPoint(anchor);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::ignoreAnchorPointForPosition(bool value)\n{\n    CCASSERT(! _batchNode, \"ignoreAnchorPointForPosition is invalid in Sprite\");\n    Node::ignoreAnchorPointForPosition(value);\n}\n\nvoid Sprite::setVisible(bool bVisible)\n{\n    Node::setVisible(bVisible);\n    SET_DIRTY_RECURSIVELY();\n}\n\nvoid Sprite::setFlippedX(bool flippedX)\n{\n    if (_flippedX != flippedX)\n    {\n        _flippedX = flippedX;\n        setTextureRect(_rect, _rectRotated, _contentSize);\n    }\n}\n\nbool Sprite::isFlippedX(void) const\n{\n    return _flippedX;\n}\n\nvoid Sprite::setFlippedY(bool flippedY)\n{\n    if (_flippedY != flippedY)\n    {\n        _flippedY = flippedY;\n        setTextureRect(_rect, _rectRotated, _contentSize);\n    }\n}\n\nbool Sprite::isFlippedY(void) const\n{\n    return _flippedY;\n}\n\n//\n// RGBA protocol\n//\n\nvoid Sprite::updateColor(void)\n{\n    Color4B color4( _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity );\n    \n    // special opacity for premultiplied textures\n\tif (_opacityModifyRGB)\n    {\n\t\tcolor4.r *= _displayedOpacity/255.0f;\n\t\tcolor4.g *= _displayedOpacity/255.0f;\n\t\tcolor4.b *= _displayedOpacity/255.0f;\n    }\n\n    _quad.bl.colors = color4;\n    _quad.br.colors = color4;\n    _quad.tl.colors = color4;\n    _quad.tr.colors = color4;\n\n    // renders using batch node\n    if (_batchNode)\n    {\n        if (_atlasIndex != INDEX_NOT_INITIALIZED)\n        {\n            _textureAtlas->updateQuad(&_quad, _atlasIndex);\n        }\n        else\n        {\n            // no need to set it recursively\n            // update dirty_, don't update recursiveDirty_\n            setDirty(true);\n        }\n    }\n\n    // self render\n    // do nothing\n}\n\nvoid Sprite::setOpacityModifyRGB(bool modify)\n{\n    if (_opacityModifyRGB != modify)\n    {\n        _opacityModifyRGB = modify;\n        updateColor();\n    }\n}\n\nbool Sprite::isOpacityModifyRGB(void) const\n{\n    return _opacityModifyRGB;\n}\n\n// Frames\n\nvoid Sprite::setSpriteFrame(const std::string &spriteFrameName)\n{\n    SpriteFrameCache *cache = SpriteFrameCache::getInstance();\n    SpriteFrame *spriteFrame = cache->getSpriteFrameByName(spriteFrameName);\n\n    CCASSERT(spriteFrame, \"Invalid spriteFrameName\");\n\n    setSpriteFrame(spriteFrame);\n}\n\nvoid Sprite::setSpriteFrame(SpriteFrame *spriteFrame)\n{\n    _unflippedOffsetPositionFromCenter = spriteFrame->getOffset();\n\n    Texture2D *texture = spriteFrame->getTexture();\n    // update texture before updating texture rect\n    if (texture != _texture)\n    {\n        setTexture(texture);\n    }\n\n    // update rect\n    _rectRotated = spriteFrame->isRotated();\n    setTextureRect(spriteFrame->getRect(), _rectRotated, spriteFrame->getOriginalSize());\n}\n\nvoid Sprite::setDisplayFrameWithAnimationName(const std::string& animationName, ssize_t frameIndex)\n{\n    CCASSERT(animationName.size()>0, \"CCSprite#setDisplayFrameWithAnimationName. animationName must not be nullptr\");\n\n    Animation *a = AnimationCache::getInstance()->getAnimation(animationName);\n\n    CCASSERT(a, \"CCSprite#setDisplayFrameWithAnimationName: Frame not found\");\n\n    AnimationFrame* frame = a->getFrames().at(frameIndex);\n\n    CCASSERT(frame, \"CCSprite#setDisplayFrame. Invalid frame\");\n\n    setSpriteFrame(frame->getSpriteFrame());\n}\n\nbool Sprite::isFrameDisplayed(SpriteFrame *frame) const\n{\n    Rect r = frame->getRect();\n\n    return (r.equals(_rect) &&\n            frame->getTexture()->getName() == _texture->getName() &&\n            frame->getOffset().equals(_unflippedOffsetPositionFromCenter));\n}\n\nSpriteFrame* Sprite::getSpriteFrame() const\n{\n    return SpriteFrame::createWithTexture(_texture,\n                                           CC_RECT_POINTS_TO_PIXELS(_rect),\n                                           _rectRotated,\n                                           CC_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter),\n                                           CC_SIZE_POINTS_TO_PIXELS(_contentSize));\n}\n\nSpriteBatchNode* Sprite::getBatchNode()\n{\n    return _batchNode;\n}\n\nvoid Sprite::setBatchNode(SpriteBatchNode *spriteBatchNode)\n{\n    _batchNode = spriteBatchNode; // weak reference\n\n    // self render\n    if( ! _batchNode ) {\n        _atlasIndex = INDEX_NOT_INITIALIZED;\n        setTextureAtlas(nullptr);\n        _recursiveDirty = false;\n        setDirty(false);\n\n        float x1 = _offsetPosition.x;\n        float y1 = _offsetPosition.y;\n        float x2 = x1 + _rect.size.width;\n        float y2 = y1 + _rect.size.height;\n        _quad.bl.vertices = Vertex3F( x1, y1, 0 );\n        _quad.br.vertices = Vertex3F( x2, y1, 0 );\n        _quad.tl.vertices = Vertex3F( x1, y2, 0 );\n        _quad.tr.vertices = Vertex3F( x2, y2, 0 );\n\n    } else {\n\n        // using batch\n        kmMat4Identity(&_transformToBatch);\n        setTextureAtlas(_batchNode->getTextureAtlas()); // weak ref\n    }\n}\n\n// Texture protocol\n\nvoid Sprite::updateBlendFunc(void)\n{\n    CCASSERT(! _batchNode, \"CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a SpriteBatchNode\");\n\n    // it is possible to have an untextured sprite\n    if (! _texture || ! _texture->hasPremultipliedAlpha())\n    {\n        _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n        setOpacityModifyRGB(false);\n    }\n    else\n    {\n        _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n        setOpacityModifyRGB(true);\n    }\n}\n\nstd::string Sprite::getDescription() const\n{\n    int texture_id = -1;\n    if( _batchNode )\n        texture_id = _batchNode->getTextureAtlas()->getTexture()->getName();\n    else\n        texture_id = _texture->getName();\n    return StringUtils::format(\"<Sprite | Tag = %d, TextureID = %d>\", _tag, texture_id );\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSprite.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __SPRITE_NODE_CCSPRITE_H__\n#define __SPRITE_NODE_CCSPRITE_H__\n\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"CCTextureAtlas.h\"\n#include \"ccTypes.h\"\n#include \"CCDictionary.h\"\n#include <string>\n#ifdef EMSCRIPTEN\n#include \"CCGLBufferedNode.h\"\n#endif // EMSCRIPTEN\n#include \"CCPhysicsBody.h\"\n#include \"renderer/CCQuadCommand.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\nclass SpriteBatchNode;\nclass SpriteFrame;\nclass Animation;\nclass Rect;\nclass Point;\nclass Size;\nclass Texture2D;\nstruct transformValues_;\n\n/**\n * @addtogroup sprite_nodes\n * @{\n */\n\n/**\n * Sprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) )\n *\n * Sprite can be created with an image, or with a sub-rectangle of an image.\n *\n * If the parent or any of its ancestors is a SpriteBatchNode then the following features/limitations are valid\n *    - Features when the parent is a BatchNode:\n *        - MUCH faster rendering, specially if the SpriteBatchNode has many children. All the children will be drawn in a single batch.\n *\n *    - Limitations\n *        - Camera is not supported yet (eg: OrbitCamera action doesn't work)\n *        - GridBase actions are not supported (eg: Lens, Ripple, Twirl)\n *        - The Alias/Antialias property belongs to SpriteBatchNode, so you can't individually set the aliased property.\n *        - The Blending function property belongs to SpriteBatchNode, so you can't individually set the blending function property.\n *        - Parallax scroller is not supported, but can be simulated with a \"proxy\" sprite.\n *\n *  If the parent is an standard Node, then Sprite behaves like any other Node:\n *    - It supports blending functions\n *    - It supports aliasing / antialiasing\n *    - But the rendering will be slower: 1 draw per children.\n *\n * The default anchorPoint in Sprite is (0.5, 0.5).\n */\nclass CC_DLL Sprite : public Node, public TextureProtocol\n{\npublic:\n\n    static const int INDEX_NOT_INITIALIZED = -1; /// Sprite invalid index on the SpriteBatchNode\n\n    /// @{\n    /// @name Creators\n\n    /**\n     * Creates an empty sprite without texture. You can call setTexture method subsequently.\n     *\n     * @return An empty sprite object that is marked as autoreleased.\n     */\n    static Sprite* create();\n\n    /**\n     * Creates a sprite with an image filename.\n     *\n     * After creation, the rect of sprite will be the size of the image,\n     * and the offset will be (0,0).\n     *\n     * @param   filename The string which indicates a path to image file, e.g., \"scene1/monster.png\".\n     * @return  A valid sprite object that is marked as autoreleased.\n     */\n    static Sprite* create(const std::string& filename);\n\n    /**\n     * Creates a sprite with an image filename and a rect.\n     *\n     * @param   filename The string wich indicates a path to image file, e.g., \"scene1/monster.png\"\n     * @param   rect        Only the contents inside rect of filename's texture will be applied for this sprite.\n     * @return  A valid sprite object that is marked as autoreleased.\n     */\n    static Sprite* create(const std::string& filename, const Rect& rect);\n\n    /**\n     * Creates a sprite with an exsiting texture contained in a Texture2D object\n     * After creation, the rect will be the size of the texture, and the offset will be (0,0).\n     *\n     * @param   texture    A pointer to a Texture2D object.\n     * @return  A valid sprite object that is marked as autoreleased.\n     */\n    static Sprite* createWithTexture(Texture2D *texture);\n\n    /**\n     * Creates a sprite with a texture and a rect.\n     *\n     * After creation, the offset will be (0,0).\n     *\n     * @param   texture    A pointer to an existing Texture2D object.\n     *                      You can use a Texture2D object for many sprites.\n     * @param   rect        Only the contents inside the rect of this texture will be applied for this sprite.\n     * @param   rotated     Whether or not the rect is rotated\n     * @return  A valid sprite object that is marked as autoreleased.\n     */\n    static Sprite* createWithTexture(Texture2D *texture, const Rect& rect, bool rotated=false);\n\n    /**\n     * Creates a sprite with an sprite frame.\n     *\n     * @param   pSpriteFrame    A sprite frame which involves a texture and a rect\n     * @return  A valid sprite object that is marked as autoreleased.\n     */\n    static Sprite* createWithSpriteFrame(SpriteFrame *pSpriteFrame);\n\n    /**\n     * Creates a sprite with an sprite frame name.\n     *\n     * A SpriteFrame will be fetched from the SpriteFrameCache by spriteFrameName param.\n     * If the SpriteFrame doesn't exist it will raise an exception.\n     *\n     * @param   spriteFrameName A null terminated string which indicates the sprite frame name.\n     * @return  A valid sprite object that is marked as autoreleased.\n     */\n    static Sprite* createWithSpriteFrameName(const std::string& spriteFrameName);\n\n    /// @}  end of creators group\n\n\n    /// @{\n    /// @name BatchNode methods\n\n    /**\n     * Updates the quad according the rotation, position, scale values.\n     */\n    virtual void updateTransform(void);\n\n    /**\n     * Returns the batch node object if this sprite is rendered by SpriteBatchNode\n     *\n     * @return The SpriteBatchNode object if this sprite is rendered by SpriteBatchNode,\n     *         nullptr if the sprite isn't used batch node.\n     */\n    virtual SpriteBatchNode* getBatchNode(void);\n    /**\n     * Sets the batch node to sprite\n     * @warning This method is not recommended for game developers. Sample code for using batch node\n     * @code\n     * SpriteBatchNode *batch = SpriteBatchNode::create(\"Images/grossini_dance_atlas.png\", 15);\n     * Sprite *sprite = Sprite::createWithTexture(batch->getTexture(), Rect(0, 0, 57, 57));\n     * batch->addChild(sprite);\n     * layer->addChild(batch);\n     * @endcode\n     */\n    virtual void setBatchNode(SpriteBatchNode *spriteBatchNode);\n\n    /// @} end of BatchNode methods\n\n\n\n    /// @{\n    /// @name Texture / Frame methods\n\n    /** Sets a new texture (from a filename) to the sprite.\n     It will call `setTextureRect()` with the texture's content size.\n     TODO: The whole Sprite API needs to be reviewed.\n     */\n    virtual void setTexture(const std::string &filename );\n\n    /** Sets a new texture to the sprite.\n     The Texture's rect is not changed.\n     */\n    virtual void setTexture(Texture2D *texture) override;\n\n    /** returns the Texture2D object used by the sprite */\n    virtual Texture2D* getTexture() const override;\n\n    /**\n     * Updates the texture rect of the Sprite in points.\n     * It will call setTextureRect(const Rect& rect, bool rotated, const Size& untrimmedSize) with \\p rotated = false, and \\p utrimmedSize = rect.size.\n     */\n    virtual void setTextureRect(const Rect& rect);\n\n    /**\n     * Sets the texture rect, rectRotated and untrimmed size of the Sprite in points.\n     * It will update the texture coordinates and the vertex rectangle.\n     */\n    virtual void setTextureRect(const Rect& rect, bool rotated, const Size& untrimmedSize);\n\n    /**\n     * Sets the vertex rect.\n     * It will be called internally by setTextureRect.\n     * Useful if you want to create 2x images from SD images in Retina Display.\n     * Do not call it manually. Use setTextureRect instead.\n     */\n    virtual void setVertexRect(const Rect& rect);\n\n    /**\n     * Sets a new SpriteFrame to the Sprite.\n     */\n    virtual void setSpriteFrame(const std::string &spriteFrameName);\n    virtual void setSpriteFrame(SpriteFrame* newFrame);\n\n    /** @deprecated Use `setSpriteFrame()` instead. */\n    CC_DEPRECATED_ATTRIBUTE virtual void setDisplayFrame(SpriteFrame *newFrame) { setSpriteFrame(newFrame); }\n\n    /**\n     * Returns whether or not a SpriteFrame is being displayed\n     */\n    virtual bool isFrameDisplayed(SpriteFrame *pFrame) const;\n\n    /**\n     * Returns the current displayed frame.\n     */\n    virtual SpriteFrame* getSpriteFrame() const;\n    /** @deprecated Use `getSpriteFrame()` instead */\n    CC_DEPRECATED_ATTRIBUTE virtual SpriteFrame* getDisplayFrame() const { return getSpriteFrame(); }\n    /** @deprecated Use `getSpriteFrame()` instead */\n    CC_DEPRECATED_ATTRIBUTE virtual SpriteFrame* displayFrame() const { return getSpriteFrame(); };\n\n    /// @} End of frames methods\n\n\n    /// @{\n    /// @name Animation methods\n    /**\n     * Changes the display frame with animation name and index.\n     * The animation name will be get from the AnimationCache\n     */\n    virtual void setDisplayFrameWithAnimationName(const std::string& animationName, ssize_t frameIndex);\n    /// @}\n\n\n    /// @{\n    /// @name Sprite Properties' setter/getters\n\n    /**\n     * Whether or not the Sprite needs to be updated in the Atlas.\n     *\n     * @return true if the sprite needs to be updated in the Atlas, false otherwise.\n     */\n    virtual bool isDirty(void) const { return _dirty; }\n\n    /**\n     * Makes the Sprite to be updated in the Atlas.\n     */\n    virtual void setDirty(bool bDirty) { _dirty = bDirty; }\n\n    /**\n     * Returns the quad (tex coords, vertex coords and color) information.\n     * @js  NA\n     * @lua NA\n     */\n    inline V3F_C4B_T2F_Quad getQuad(void) const { return _quad; }\n\n    /**\n     * Returns whether or not the texture rectangle is rotated.\n     */\n    inline bool isTextureRectRotated(void) const { return _rectRotated; }\n\n    /**\n     * Returns the index used on the TextureAtlas.\n     */\n    inline ssize_t getAtlasIndex(void) const { return _atlasIndex; }\n\n    /**\n     * Sets the index used on the TextureAtlas.\n     * @warning Don't modify this value unless you know what you are doing\n     */\n    inline void setAtlasIndex(ssize_t atlasIndex) { _atlasIndex = atlasIndex; }\n\n    /**\n     * Returns the rect of the Sprite in points\n     */\n    inline const Rect& getTextureRect(void) { return _rect; }\n\n    /**\n     * Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode\n     */\n    inline TextureAtlas* getTextureAtlas(void) { return _textureAtlas; }\n\n    /**\n     * Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode\n     */\n    inline void setTextureAtlas(TextureAtlas *pobTextureAtlas) { _textureAtlas = pobTextureAtlas; }\n\n    /**\n     * Gets the offset position of the sprite. Calculated automatically by editors like Zwoptex.\n     */\n    inline const Point& getOffsetPosition(void) const { return _offsetPosition; }\n\n\n    /**\n     * Returns the flag which indicates whether the sprite is flipped horizontally or not.\n     *\n     * It only flips the texture of the sprite, and not the texture of the sprite's children.\n     * Also, flipping the texture doesn't alter the anchorPoint.\n     * If you want to flip the anchorPoint too, and/or to flip the children too use:\n     * sprite->setScaleX(sprite->getScaleX() * -1);\n     *\n     * @return true if the sprite is flipped horizontally, false otherwise.\n     */\n    bool isFlippedX(void) const;\n    /**\n     * Sets whether the sprite should be flipped horizontally or not.\n     *\n     * @param flippedX true if the sprite should be flipped horizontally, false otherwise.\n     */\n    void setFlippedX(bool flippedX);\n\n    /** @deprecated Use isFlippedX() instead\n    * @js NA\n    * @lua NA\n    */\n    CC_DEPRECATED_ATTRIBUTE bool isFlipX() { return isFlippedX(); };\n    /** @deprecated Use setFlippedX() instead */\n    CC_DEPRECATED_ATTRIBUTE void setFlipX(bool flippedX) { setFlippedX(flippedX); };\n\n    /**\n     * Return the flag which indicates whether the sprite is flipped vertically or not.\n     *\n     * It only flips the texture of the sprite, and not the texture of the sprite's children.\n     * Also, flipping the texture doesn't alter the anchorPoint.\n     * If you want to flip the anchorPoint too, and/or to flip the children too use:\n     * sprite->setScaleY(sprite->getScaleY() * -1);\n     *\n     * @return true if the sprite is flipped vertically, false otherwise.\n     */\n    bool isFlippedY(void) const;\n    /**\n     * Sets whether the sprite should be flipped vertically or not.\n     *\n     * @param flippedY true if the sprite should be flipped vertically, false otherwise.\n     */\n    void setFlippedY(bool flippedY);\n\n    /// @} End of Sprite properties getter/setters\n\n    /** @deprecated Use isFlippedY() instead */\n    CC_DEPRECATED_ATTRIBUTE bool isFlipY() { return isFlippedY(); };\n    /** @deprecated Use setFlippedY() instead */\n    CC_DEPRECATED_ATTRIBUTE void setFlipY(bool flippedY) { setFlippedY(flippedY); };\n\n    //\n    // Overrides\n    //\n    /// @{\n    /// @name Functions inherited from TextureProtocol\n    /**\n    *@code\n    *When this function bound into js or lua,the parameter will be changed\n    *In js: var setBlendFunc(var src, var dst)\n    *In lua: local setBlendFunc(local src, local dst)\n    *@endcode\n    */\n    inline void setBlendFunc(const BlendFunc &blendFunc) override { _blendFunc = blendFunc; }\n    /**\n    * @js  NA\n    * @lua NA\n    */\n    inline const BlendFunc& getBlendFunc() const override { return _blendFunc; }\n    /// @}\n\n    virtual std::string getDescription() const override;\n\n    /// @{\n    /// @name Functions inherited from Node\n    virtual void setScaleX(float scaleX) override;\n    virtual void setScaleY(float scaleY) override;\n    virtual void setScale(float scaleX, float scaleY) override;\n    /**\n    * @js  NA\n    * @lua NA\n    */\n    virtual void setPosition(const Point& pos) override;\n    virtual void setPosition(float x, float y) override;\n    virtual void setRotation(float rotation) override;\n    virtual void setRotationX(float rotationX) override;\n    virtual void setRotationY(float rotationY) override;\n    virtual void setSkewX(float sx) override;\n    virtual void setSkewY(float sy) override;\n    virtual void removeChild(Node* child, bool cleanup) override;\n    virtual void removeAllChildrenWithCleanup(bool cleanup) override;\n    virtual void reorderChild(Node *child, int zOrder) override;\n    using Node::addChild;\n    virtual void addChild(Node *child, int zOrder, int tag) override;\n    virtual void sortAllChildren() override;\n    virtual void setScale(float scale) override;\n    virtual void setVertexZ(float vertexZ) override;\n    virtual void setAnchorPoint(const Point& anchor) override;\n    virtual void ignoreAnchorPointForPosition(bool value) override;\n    virtual void setVisible(bool bVisible) override;\n    virtual void updateQuadVertices();\n    virtual void draw(void) override;\n    virtual void setOpacityModifyRGB(bool modify) override;\n    virtual bool isOpacityModifyRGB(void) const override;\n    /// @}\n\nprotected:\n\n    Sprite(void);\n    virtual ~Sprite(void);\n\n    /* Initializes an empty sprite with nothing init. */\n    virtual bool init(void);\n\n    /**\n     * Initializes a sprite with a texture.\n     *\n     * After initialization, the rect used will be the size of the texture, and the offset will be (0,0).\n     *\n     * @param   texture    A pointer to an existing Texture2D object.\n     *                      You can use a Texture2D object for many sprites.\n     * @return  true if the sprite is initialized properly, false otherwise.\n     */\n    virtual bool initWithTexture(Texture2D *texture);\n\n    /**\n     * Initializes a sprite with a texture and a rect.\n     *\n     * After initialization, the offset will be (0,0).\n     *\n     * @param   texture    A pointer to an exisiting Texture2D object.\n     *                      You can use a Texture2D object for many sprites.\n     * @param   rect        Only the contents inside rect of this texture will be applied for this sprite.\n     * @return  true if the sprite is initialized properly, false otherwise.\n     */\n    virtual bool initWithTexture(Texture2D *texture, const Rect& rect);\n\n    /**\n     * Initializes a sprite with a texture and a rect in points, optionally rotated.\n     *\n     * After initialization, the offset will be (0,0).\n     * @note    This is the designated initializer.\n     *\n     * @param   texture    A Texture2D object whose texture will be applied to this sprite.\n     * @param   rect        A rectangle assigned the contents of texture.\n     * @param   rotated     Whether or not the texture rectangle is rotated.\n     * @return  true if the sprite is initialized properly, false otherwise.\n     */\n    virtual bool initWithTexture(Texture2D *texture, const Rect& rect, bool rotated);\n\n    /**\n     * Initializes a sprite with an SpriteFrame. The texture and rect in SpriteFrame will be applied on this sprite\n     *\n     * @param   pSpriteFrame  A SpriteFrame object. It should includes a valid texture and a rect\n     * @return  true if the sprite is initialized properly, false otherwise.\n     */\n    virtual bool initWithSpriteFrame(SpriteFrame *pSpriteFrame);\n\n    /**\n     * Initializes a sprite with an sprite frame name.\n     *\n     * A SpriteFrame will be fetched from the SpriteFrameCache by name.\n     * If the SpriteFrame doesn't exist it will raise an exception.\n     *\n     * @param   spriteFrameName  A key string that can fected a volid SpriteFrame from SpriteFrameCache\n     * @return  true if the sprite is initialized properly, false otherwise.\n     */\n    virtual bool initWithSpriteFrameName(const std::string& spriteFrameName);\n\n    /**\n     * Initializes a sprite with an image filename.\n     *\n     * This method will find filename from local file system, load its content to Texture2D,\n     * then use Texture2D to create a sprite.\n     * After initialization, the rect used will be the size of the image. The offset will be (0,0).\n     *\n     * @param   filename The path to an image file in local file system\n     * @return  true if the sprite is initialized properly, false otherwise.\n     * @js      init\n     * @lua     init\n     */\n    virtual bool initWithFile(const std::string& filename);\n\n    /**\n     * Initializes a sprite with an image filename, and a rect.\n     *\n     * This method will find filename from local file system, load its content to Texture2D,\n     * then use Texture2D to create a sprite.\n     * After initialization, the offset will be (0,0).\n     *\n     * @param   filename The path to an image file in local file system.\n     * @param   rect        The rectangle assigned the content area from texture.\n     * @return  true if the sprite is initialized properly, false otherwise.\n     * @js      init\n     * @lua     init\n     */\n    virtual bool initWithFile(const std::string& filename, const Rect& rect);\n\n    void updateColor(void);\n    virtual void setTextureCoords(Rect rect);\n    virtual void updateBlendFunc(void);\n    virtual void setReorderChildDirtyRecursively(void);\n    virtual void setDirtyRecursively(bool bValue);\n\n    bool culling() const;\n\n    //\n    // Data used when the sprite is rendered using a SpriteSheet\n    //\n    TextureAtlas*       _textureAtlas;      /// SpriteBatchNode texture atlas (weak reference)\n    ssize_t             _atlasIndex;        /// Absolute (real) Index on the SpriteSheet\n    SpriteBatchNode*    _batchNode;         /// Used batch node (weak reference)\n\n    bool                _dirty;             /// Whether the sprite needs to be updated\n    bool                _recursiveDirty;    /// Whether all of the sprite's children needs to be updated\n    bool                _shouldBeHidden;    /// should not be drawn because one of the ancestors is not visible\n    kmMat4              _transformToBatch;\n\n    //\n    // Data used when the sprite is self-rendered\n    //\n    BlendFunc        _blendFunc;            /// It's required for TextureProtocol inheritance\n    Texture2D*       _texture;              /// Texture2D object that is used to render the sprite\n    QuadCommand      _quadCommand;          /// quad command\n\n    //\n    // Shared data\n    //\n\n    // texture\n    Rect _rect;                             /// Retangle of Texture2D\n    bool   _rectRotated;                    /// Whether the texture is rotated\n\n    // Offset Position (used by Zwoptex)\n    Point _offsetPosition;\n    Point _unflippedOffsetPositionFromCenter;\n\n    // vertex coords, texture coords and color info\n    V3F_C4B_T2F_Quad _quad;\n\n    // opacity and RGB protocol\n    bool _opacityModifyRGB;\n\n    // image is flipped\n    bool _flippedX;                         /// Whether the sprite is flipped horizontally or not\n    bool _flippedY;                         /// Whether the sprite is flipped vertically or not\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Sprite);\n};\n\n\n// end of sprite_nodes group\n/// @}\n\nNS_CC_END\n\n#endif // __SPRITE_NODE_CCSPRITE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSpriteBatchNode.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2009      Matt Oswald\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCSpriteBatchNode.h\"\n\n#include <algorithm>\n\n#include \"ccConfig.h\"\n#include \"CCSprite.h\"\n#include \"CCGrid.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"CCTextureCache.h\"\n#include \"CCShaderCache.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCDirector.h\"\n#include \"TransformUtils.h\"\n#include \"CCProfiling.h\"\n#include \"CCLayer.h\"\n#include \"CCScene.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCQuadCommand.h\"\n// external\n#include \"kazmath/GL/matrix.h\"\n\nNS_CC_BEGIN\n\n/*\n* creation with Texture2D\n*/\n\nSpriteBatchNode* SpriteBatchNode::createWithTexture(Texture2D* tex, ssize_t capacity/* = DEFAULT_CAPACITY*/)\n{\n    SpriteBatchNode *batchNode = new SpriteBatchNode();\n    batchNode->initWithTexture(tex, capacity);\n    batchNode->autorelease();\n\n    return batchNode;\n}\n\n/*\n* creation with File Image\n*/\n\nSpriteBatchNode* SpriteBatchNode::create(const std::string& fileImage, ssize_t capacity/* = DEFAULT_CAPACITY*/)\n{\n    SpriteBatchNode *batchNode = new SpriteBatchNode();\n    batchNode->initWithFile(fileImage, capacity);\n    batchNode->autorelease();\n\n    return batchNode;\n}\n\n/*\n* init with Texture2D\n*/\nbool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity)\n{\n    CCASSERT(capacity>=0, \"Capacity must be >= 0\");\n    \n    _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED;\n    _textureAtlas = new TextureAtlas();\n\n    if (capacity == 0)\n    {\n        capacity = DEFAULT_CAPACITY;\n    }\n    \n    _textureAtlas->initWithTexture(tex, capacity);\n\n    updateBlendFunc();\n\n    _children.reserve(capacity);\n\n    _descendants.reserve(capacity);\n    \n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n    return true;\n}\n\nbool SpriteBatchNode::init()\n{\n    Texture2D * texture = new Texture2D();\n    texture->autorelease();\n    return this->initWithTexture(texture, 0);\n}\n\n/*\n* init with FileImage\n*/\nbool SpriteBatchNode::initWithFile(const std::string& fileImage, ssize_t capacity)\n{\n    Texture2D *texture2D = Director::getInstance()->getTextureCache()->addImage(fileImage);\n    return initWithTexture(texture2D, capacity);\n}\n\nSpriteBatchNode::SpriteBatchNode()\n: _textureAtlas(nullptr)\n{\n}\n\nSpriteBatchNode::~SpriteBatchNode()\n{\n    CC_SAFE_RELEASE(_textureAtlas);\n}\n\n// override visit\n// don't call visit on it's children\nvoid SpriteBatchNode::visit(void)\n{\n    CC_PROFILER_START_CATEGORY(kProfilerCategoryBatchSprite, \"CCSpriteBatchNode - visit\");\n\n    // CAREFUL:\n    // This visit is almost identical to CocosNode#visit\n    // with the exception that it doesn't call visit on it's children\n    //\n    // The alternative is to have a void Sprite#visit, but\n    // although this is less maintainable, is faster\n    //\n    if (! _visible)\n    {\n        return;\n    }\n\n    kmGLPushMatrix();\n\n    sortAllChildren();\n    transform();\n\n    draw();\n\n    kmGLPopMatrix();\n    setOrderOfArrival(0);\n\n    CC_PROFILER_STOP_CATEGORY(kProfilerCategoryBatchSprite, \"CCSpriteBatchNode - visit\");\n}\n\nvoid SpriteBatchNode::addChild(Node *child, int zOrder, int tag)\n{\n    CCASSERT(child != nullptr, \"child should not be null\");\n    CCASSERT(dynamic_cast<Sprite*>(child) != nullptr, \"CCSpriteBatchNode only supports Sprites as children\");\n    Sprite *sprite = static_cast<Sprite*>(child);\n    // check Sprite is using the same texture id\n    CCASSERT(sprite->getTexture()->getName() == _textureAtlas->getTexture()->getName(), \"CCSprite is not using the same texture id\");\n\n    Node::addChild(child, zOrder, tag);\n\n    appendChild(sprite);\n}\n\n// override reorderChild\nvoid SpriteBatchNode::reorderChild(Node *child, int zOrder)\n{\n    CCASSERT(child != nullptr, \"the child should not be null\");\n    CCASSERT(_children.contains(child), \"Child doesn't belong to Sprite\");\n\n    if (zOrder == child->getLocalZOrder())\n    {\n        return;\n    }\n\n    //set the z-order and sort later\n    Node::reorderChild(child, zOrder);\n}\n\n// override remove child\nvoid SpriteBatchNode::removeChild(Node *child, bool cleanup)\n{\n    Sprite *sprite = static_cast<Sprite*>(child);\n\n    // explicit null handling\n    if (sprite == nullptr)\n    {\n        return;\n    }\n\n    CCASSERT(_children.contains(sprite), \"sprite batch node should contain the child\");\n\n    // cleanup before removing\n    removeSpriteFromAtlas(sprite);\n\n    Node::removeChild(sprite, cleanup);\n}\n\nvoid SpriteBatchNode::removeChildAtIndex(ssize_t index, bool doCleanup)\n{\n    CCASSERT(index>=0 && index < _children.size(), \"Invalid index\");\n    removeChild(_children.at(index), doCleanup);\n}\n\nvoid SpriteBatchNode::removeAllChildrenWithCleanup(bool doCleanup)\n{\n    // Invalidate atlas index. issue #569\n    // useSelfRender should be performed on all descendants. issue #1216\n    for(const auto &sprite: _descendants) {\n        sprite->setBatchNode(nullptr);\n    }\n\n    Node::removeAllChildrenWithCleanup(doCleanup);\n\n    _descendants.clear();\n    _textureAtlas->removeAllQuads();\n}\n\n//override sortAllChildren\nvoid SpriteBatchNode::sortAllChildren()\n{\n    if (_reorderChildDirty)\n    {\n        std::sort(std::begin(_children), std::end(_children), nodeComparisonLess);\n\n        //sorted now check all children\n        if (!_children.empty())\n        {\n            //first sort all children recursively based on zOrder\n            for(const auto &child: _children) {\n                child->sortAllChildren();\n            }\n\n            ssize_t index=0;\n\n            //fast dispatch, give every child a new atlasIndex based on their relative zOrder (keep parent -> child relations intact)\n            // and at the same time reorder descendants and the quads to the right index\n            for(const auto &child: _children) {\n                Sprite* sp = static_cast<Sprite*>(child);\n                updateAtlasIndex(sp, &index);\n            }\n        }\n\n        _reorderChildDirty=false;\n    }\n}\n\nvoid SpriteBatchNode::updateAtlasIndex(Sprite* sprite, ssize_t* curIndex)\n{\n    auto& array = sprite->getChildren();\n    auto count = array.size();\n    \n    ssize_t oldIndex = 0;\n\n    if( count == 0 )\n    {\n        oldIndex = sprite->getAtlasIndex();\n        sprite->setAtlasIndex(*curIndex);\n        sprite->setOrderOfArrival(0);\n        if (oldIndex != *curIndex){\n            swap(oldIndex, *curIndex);\n        }\n        (*curIndex)++;\n    }\n    else\n    {\n        bool needNewIndex=true;\n\n        if (array.at(0)->getLocalZOrder() >= 0)\n        {\n            //all children are in front of the parent\n            oldIndex = sprite->getAtlasIndex();\n            sprite->setAtlasIndex(*curIndex);\n            sprite->setOrderOfArrival(0);\n            if (oldIndex != *curIndex)\n            {\n                swap(oldIndex, *curIndex);\n            }\n            (*curIndex)++;\n\n            needNewIndex = false;\n        }\n\n        for(const auto &child: array) {\n            Sprite* sp = static_cast<Sprite*>(child);\n            if (needNewIndex && sp->getLocalZOrder() >= 0)\n            {\n                oldIndex = sprite->getAtlasIndex();\n                sprite->setAtlasIndex(*curIndex);\n                sprite->setOrderOfArrival(0);\n                if (oldIndex != *curIndex) {\n                    this->swap(oldIndex, *curIndex);\n                }\n                (*curIndex)++;\n                needNewIndex = false;\n            }\n            \n            updateAtlasIndex(sp, curIndex);\n        }\n\n        if (needNewIndex)\n        {//all children have a zOrder < 0)\n            oldIndex = sprite->getAtlasIndex();\n            sprite->setAtlasIndex(*curIndex);\n            sprite->setOrderOfArrival(0);\n            if (oldIndex != *curIndex) {\n                swap(oldIndex, *curIndex);\n            }\n            (*curIndex)++;\n        }\n    }\n}\n\nvoid SpriteBatchNode::swap(ssize_t oldIndex, ssize_t newIndex)\n{\n    CCASSERT(oldIndex>=0 && oldIndex < (int)_descendants.size() && newIndex >=0 && newIndex < (int)_descendants.size(), \"Invalid index\");\n\n    V3F_C4B_T2F_Quad* quads = _textureAtlas->getQuads();\n    std::swap( quads[oldIndex], quads[newIndex] );\n\n    //update the index of other swapped item\n\n    auto oldIt = std::next( _descendants.begin(), oldIndex );\n    auto newIt = std::next( _descendants.begin(), newIndex );\n\n    (*newIt)->setAtlasIndex(oldIndex);\n//    (*oldIt)->setAtlasIndex(newIndex);\n\n    std::swap( *oldIt, *newIt );\n}\n\nvoid SpriteBatchNode::reorderBatch(bool reorder)\n{\n    _reorderChildDirty=reorder;\n}\n\nvoid SpriteBatchNode::draw()\n{\n    // Optimization: Fast Dispatch\n    if( _textureAtlas->getTotalQuads() == 0 )\n    {\n        return;\n    }\n\n    for(const auto &child: _children)\n        child->updateTransform();\n\n    _batchCommand.init(\n                       _globalZOrder,\n                       _shaderProgram,\n                       _blendFunc,\n                       _textureAtlas,\n                       _modelViewTransform);\n    Director::getInstance()->getRenderer()->addCommand(&_batchCommand);\n}\n\nvoid SpriteBatchNode::increaseAtlasCapacity(void)\n{\n    // if we're going beyond the current TextureAtlas's capacity,\n    // all the previously initialized sprites will need to redo their texture coords\n    // this is likely computationally expensive\n    ssize_t quantity = (_textureAtlas->getCapacity() + 1) * 4 / 3;\n\n    CCLOG(\"cocos2d: SpriteBatchNode: resizing TextureAtlas capacity from [%d] to [%d].\",\n        static_cast<int>(_textureAtlas->getCapacity()),\n        static_cast<int>(quantity));\n\n    if (! _textureAtlas->resizeCapacity(quantity))\n    {\n        // serious problems\n        CCLOGWARN(\"cocos2d: WARNING: Not enough memory to resize the atlas\");\n        CCASSERT(false, \"Not enough memory to resize the atlas\");\n    }\n}\n\nssize_t SpriteBatchNode::rebuildIndexInOrder(Sprite *parent, ssize_t index)\n{\n    CCASSERT(index>=0 && index < _children.size(), \"Invalid index\");\n\n    auto& children = parent->getChildren();\n    for(const auto &child: children) {\n        Sprite* sp = static_cast<Sprite*>(child);\n        if (sp && (sp->getLocalZOrder() < 0))\n        {\n            index = rebuildIndexInOrder(sp, index);\n        }\n    }\n\n    // ignore self (batch node)\n    if (! parent->isEqual(this))\n    {\n        parent->setAtlasIndex(index);\n        index++;\n    }\n\n    for(const auto &child: children) {\n        Sprite* sp = static_cast<Sprite*>(child);\n        if (sp && (sp->getLocalZOrder() >= 0))\n        {\n            index = rebuildIndexInOrder(sp, index);\n        }\n    }\n\n    return index;\n}\n\nssize_t SpriteBatchNode::highestAtlasIndexInChild(Sprite *sprite)\n{\n    auto& children = sprite->getChildren();\n\n    if (children.size() == 0)\n    {\n        return sprite->getAtlasIndex();\n    }\n    else\n    {\n        return highestAtlasIndexInChild( static_cast<Sprite*>(children.back()));\n    }\n}\n\nssize_t SpriteBatchNode::lowestAtlasIndexInChild(Sprite *sprite)\n{\n    auto& children = sprite->getChildren();\n\n    if (children.size() == 0)\n    {\n        return sprite->getAtlasIndex();\n    }\n    else\n    {\n        return lowestAtlasIndexInChild(static_cast<Sprite*>(children.at(0)));\n    }\n}\n\nssize_t SpriteBatchNode::atlasIndexForChild(Sprite *sprite, int nZ)\n{\n    auto& siblings = sprite->getParent()->getChildren();\n    auto childIndex = siblings.getIndex(sprite);\n\n    // ignore parent Z if parent is spriteSheet\n    bool ignoreParent = (SpriteBatchNode*)(sprite->getParent()) == this;\n    Sprite *prev = nullptr;\n    if (childIndex > 0 && childIndex != -1)\n    {\n        prev = static_cast<Sprite*>(siblings.at(childIndex - 1));\n    }\n\n    // first child of the sprite sheet\n    if (ignoreParent)\n    {\n        if (childIndex == 0)\n        {\n            return 0;\n        }\n\n        return highestAtlasIndexInChild(prev) + 1;\n    }\n\n    // parent is a Sprite, so, it must be taken into account\n\n    // first child of an Sprite ?\n    if (childIndex == 0)\n    {\n        Sprite *p = static_cast<Sprite*>(sprite->getParent());\n\n        // less than parent and brothers\n        if (nZ < 0)\n        {\n            return p->getAtlasIndex();\n        }\n        else\n        {\n            return p->getAtlasIndex() + 1;\n        }\n    }\n    else\n    {\n        // previous & sprite belong to the same branch\n        if ((prev->getLocalZOrder() < 0 && nZ < 0) || (prev->getLocalZOrder() >= 0 && nZ >= 0))\n        {\n            return highestAtlasIndexInChild(prev) + 1;\n        }\n\n        // else (previous < 0 and sprite >= 0 )\n        Sprite *p = static_cast<Sprite*>(sprite->getParent());\n        return p->getAtlasIndex() + 1;\n    }\n\n    // Should not happen. Error calculating Z on SpriteSheet\n    CCASSERT(0, \"should not run here\");\n    return 0;\n}\n\n// addChild helper, faster than insertChild\nvoid SpriteBatchNode::appendChild(Sprite* sprite)\n{\n    _reorderChildDirty=true;\n    sprite->setBatchNode(this);\n    sprite->setDirty(true);\n\n    if(_textureAtlas->getTotalQuads() == _textureAtlas->getCapacity()) {\n        increaseAtlasCapacity();\n    }\n\n    _descendants.push_back(sprite);\n    int index = static_cast<int>(_descendants.size()-1);\n\n    sprite->setAtlasIndex(index);\n\n    V3F_C4B_T2F_Quad quad = sprite->getQuad();\n    _textureAtlas->insertQuad(&quad, index);\n\n    // add children recursively\n    auto& children = sprite->getChildren();\n    for(const auto &child: children) {\n        appendChild(static_cast<Sprite*>(child));\n    }\n}\n\nvoid SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)\n{\n    // remove from TextureAtlas\n    _textureAtlas->removeQuadAtIndex(sprite->getAtlasIndex());\n\n    // Cleanup sprite. It might be reused (issue #569)\n    sprite->setBatchNode(nullptr);\n\n    auto it = std::find(_descendants.begin(), _descendants.end(), sprite );\n    if( it != _descendants.end() )\n    {\n        auto next = std::next(it);\n\n        for(; next != _descendants.end(); ++next) {\n            Sprite *spr = *next;\n            spr->setAtlasIndex( spr->getAtlasIndex() - 1 );\n        }\n\n        _descendants.erase(it);\n    }\n\n    // remove children recursively\n    auto& children = sprite->getChildren();\n    for(const auto &obj: children) {\n        Sprite* child = static_cast<Sprite*>(obj);\n        if (child)\n        {\n            removeSpriteFromAtlas(child);\n        }\n    }\n}\n\nvoid SpriteBatchNode::updateBlendFunc(void)\n{\n    if (! _textureAtlas->getTexture()->hasPremultipliedAlpha())\n        _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n}\n\n// CocosNodeTexture protocol\nvoid SpriteBatchNode::setBlendFunc(const BlendFunc &blendFunc)\n{\n    _blendFunc = blendFunc;\n}\n\nconst BlendFunc& SpriteBatchNode::getBlendFunc(void) const\n{\n    return _blendFunc;\n}\n\nTexture2D* SpriteBatchNode::getTexture(void) const\n{\n    return _textureAtlas->getTexture();\n}\n\nvoid SpriteBatchNode::setTexture(Texture2D *texture)\n{\n    _textureAtlas->setTexture(texture);\n    updateBlendFunc();\n}\n\n\n// SpriteSheet Extension\n//implementation SpriteSheet (TMXTiledMapExtension)\n\nvoid SpriteBatchNode::insertQuadFromSprite(Sprite *sprite, ssize_t index)\n{\n    CCASSERT( sprite != nullptr, \"Argument must be non-nullptr\");\n    CCASSERT( dynamic_cast<Sprite*>(sprite), \"CCSpriteBatchNode only supports Sprites as children\");\n\n    // make needed room\n    while(index >= _textureAtlas->getCapacity() || _textureAtlas->getCapacity() == _textureAtlas->getTotalQuads())\n    {\n        this->increaseAtlasCapacity();\n    }\n    //\n    // update the quad directly. Don't add the sprite to the scene graph\n    //\n    sprite->setBatchNode(this);\n    sprite->setAtlasIndex(index);\n\n    V3F_C4B_T2F_Quad quad = sprite->getQuad();\n    _textureAtlas->insertQuad(&quad, index);\n\n    // XXX: updateTransform will update the textureAtlas too, using updateQuad.\n    // XXX: so, it should be AFTER the insertQuad\n    sprite->setDirty(true);\n    sprite->updateTransform();\n}\n\nvoid SpriteBatchNode::updateQuadFromSprite(Sprite *sprite, ssize_t index)\n{\n    CCASSERT(sprite != nullptr, \"Argument must be non-nil\");\n    CCASSERT(dynamic_cast<Sprite*>(sprite) != nullptr, \"CCSpriteBatchNode only supports Sprites as children\");\n    \n\t// make needed room\n\twhile (index >= _textureAtlas->getCapacity() || _textureAtlas->getCapacity() == _textureAtlas->getTotalQuads())\n    {\n\t\tthis->increaseAtlasCapacity();\n    }\n    \n\t//\n\t// update the quad directly. Don't add the sprite to the scene graph\n\t//\n\tsprite->setBatchNode(this);\n    sprite->setAtlasIndex(index);\n    \n\tsprite->setDirty(true);\n\t\n\t// UpdateTransform updates the textureAtlas quad\n\tsprite->updateTransform();\n}\n\nSpriteBatchNode * SpriteBatchNode::addSpriteWithoutQuad(Sprite*child, int z, int aTag)\n{\n    CCASSERT( child != nullptr, \"Argument must be non-nullptr\");\n    CCASSERT( dynamic_cast<Sprite*>(child), \"CCSpriteBatchNode only supports Sprites as children\");\n\n    // quad index is Z\n    child->setAtlasIndex(z);\n\n    // XXX: optimize with a binary search\n    auto it = std::begin(_descendants);\n    for(const auto &sprite: _descendants) {\n        if(sprite->getAtlasIndex() >= z)\n            std::next(it);\n    }\n\n    _descendants.insert(it, child);\n\n    // IMPORTANT: Call super, and not self. Avoid adding it to the texture atlas array\n    Node::addChild(child, z, aTag);\n\n    //#issue 1262 don't use lazy sorting, tiles are added as quads not as sprites, so sprites need to be added in order\n    reorderBatch(false);\n\n    return this;\n}\n\nstd::string SpriteBatchNode::getDescription() const\n{\n    return StringUtils::format(\"<SpriteBatchNode | tag = %d>\", _tag);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSpriteBatchNode.h",
    "content": "/****************************************************************************\nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2009      Matt Oswald\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_SPRITE_BATCH_NODE_H__\n#define __CC_SPRITE_BATCH_NODE_H__\n\n#include <vector>\n\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"CCTextureAtlas.h\"\n#include \"ccMacros.h\"\n#include \"renderer/CCBatchCommand.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup sprite_nodes\n * @{\n */\n\n\nclass Sprite;\n\n/** SpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call\n* (often known as \"batch draw\").\n*\n* A SpriteBatchNode can reference one and only one texture (one image file, one texture atlas).\n* Only the Sprites that are contained in that texture can be added to the SpriteBatchNode.\n* All Sprites added to a SpriteBatchNode are drawn in one OpenGL ES draw call.\n* If the Sprites are not added to a SpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.\n*\n*\n* Limitations:\n*  - The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is Sprite or any subclass of Sprite. eg: particles, labels and layer can't be added to a SpriteBatchNode.\n*  - Either all its children are Aliased or Antialiased. It can't be a mix. This is because \"alias\" is a property of the texture, and all the sprites share the same texture.\n* \n* @since v0.7.1\n*/\nclass CC_DLL SpriteBatchNode : public Node, public TextureProtocol\n{\n    static const int DEFAULT_CAPACITY = 29;\n\npublic:\n    /** creates a SpriteBatchNode with a texture2d and capacity of children.\n     The capacity will be increased in 33% in runtime if it run out of space.\n     */\n    static SpriteBatchNode* createWithTexture(Texture2D* tex, ssize_t capacity = DEFAULT_CAPACITY);\n\n    /** creates a SpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children.\n     The capacity will be increased in 33% in runtime if it run out of space.\n     The file will be loaded using the TextureMgr.\n     */\n    static SpriteBatchNode* create(const std::string& fileImage, ssize_t capacity = DEFAULT_CAPACITY);\n    /**\n     * @js ctor\n     */\n    SpriteBatchNode();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~SpriteBatchNode();\n\n    /** initializes a SpriteBatchNode with a texture2d and capacity of children.\n     The capacity will be increased in 33% in runtime if it run out of space.\n     */\n    bool initWithTexture(Texture2D *tex, ssize_t capacity);\n    /** initializes a SpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and a capacity of children.\n     The capacity will be increased in 33% in runtime if it run out of space.\n     The file will be loaded using the TextureMgr.\n     * @js init\n     * @lua init\n     */\n    bool initWithFile(const std::string& fileImage, ssize_t capacity);\n    bool init();\n\n    /** returns the TextureAtlas object */\n    inline TextureAtlas* getTextureAtlas(void) { return _textureAtlas; }\n\n    /** sets the TextureAtlas object */\n    inline void setTextureAtlas(TextureAtlas* textureAtlas)\n    { \n        if (textureAtlas != _textureAtlas)\n        {\n            CC_SAFE_RETAIN(textureAtlas);\n            CC_SAFE_RELEASE(_textureAtlas);\n            _textureAtlas = textureAtlas;\n        }\n    }\n\n    /** returns an array with the descendants (children, gran children, etc.). \n     This is specific to BatchNode. In order to use the children, use getChildren() instead */\n    inline const std::vector<Sprite*>& getDescendants() const { return _descendants; }\n\n    void increaseAtlasCapacity();\n\n    /** removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter.\n    @warning Removing a child from a SpriteBatchNode is very slow\n    */\n    void removeChildAtIndex(ssize_t index, bool doCleanup);\n\n    void appendChild(Sprite* sprite);\n    void removeSpriteFromAtlas(Sprite *sprite);\n\n    ssize_t rebuildIndexInOrder(Sprite *parent, ssize_t index);\n    ssize_t highestAtlasIndexInChild(Sprite *sprite);\n    ssize_t lowestAtlasIndexInChild(Sprite *sprite);\n    ssize_t atlasIndexForChild(Sprite *sprite, int z);\n    /* Sprites use this to start sortChildren, don't call this manually */\n    void reorderBatch(bool reorder);\n\n    //\n    // Overrides\n    //\n    // TextureProtocol\n    virtual Texture2D* getTexture() const override;\n    virtual void setTexture(Texture2D *texture) override;\n    /**\n    *@code\n    *When this function bound into js or lua,the parameter will be changed\n    *In js: var setBlendFunc(var src, var dst)\n    *@endcode\n    * @lua NA \n    */\n    virtual void setBlendFunc(const BlendFunc &blendFunc) override;\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual const BlendFunc& getBlendFunc() const override;\n\n    virtual void visit() override;\n    \n    using Node::addChild;\n    virtual void addChild(Node * child, int zOrder, int tag) override;\n    virtual void reorderChild(Node *child, int zOrder) override;\n        \n    virtual void removeChild(Node *child, bool cleanup) override;\n    virtual void removeAllChildrenWithCleanup(bool cleanup) override;\n    virtual void sortAllChildren() override;\n    virtual void draw(void) override;\n    virtual std::string getDescription() const override;\n\nprotected:\n    /** Inserts a quad at a certain index into the texture atlas. The Sprite won't be added into the children array.\n     This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated.\n     For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)\n     */\n    void insertQuadFromSprite(Sprite *sprite, ssize_t index);\n    /** Updates a quad at a certain index into the texture atlas. The Sprite won't be added into the children array.\n     This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated.\n     For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)\n     */\n    void updateQuadFromSprite(Sprite *sprite, ssize_t index);\n    /* This is the opposite of \"addQuadFromSprite.\n    It add the sprite to the children and descendants array, but it doesn't update add it to the texture atlas\n    */\n    SpriteBatchNode * addSpriteWithoutQuad(Sprite *child, int z, int aTag);\n\n    void updateAtlasIndex(Sprite* sprite, ssize_t* curIndex);\n    void swap(ssize_t oldIndex, ssize_t newIndex);\n    void updateBlendFunc();\n\n    TextureAtlas *_textureAtlas;\n    BlendFunc _blendFunc;\n    BatchCommand _batchCommand;     // render command\n\n    // all descendants: children, grand children, etc...\n    // There is not need to retain/release these objects, since they are already retained by _children\n    // So, using std::vector<Sprite*> is slightly faster than using cocos2d::Array for this particular case\n    std::vector<Sprite*> _descendants;\n};\n\n// end of sprite_nodes group\n/// @}\n\nNS_CC_END\n\n#endif // __CC_SPRITE_BATCH_NODE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSpriteFrame.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2011 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCTextureCache.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCDirector.h\"\n\nNS_CC_BEGIN\n\n// implementation of SpriteFrame\n\nSpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect)\n{\n    SpriteFrame *spriteFrame = new SpriteFrame();\n    spriteFrame->initWithTextureFilename(filename, rect);\n    spriteFrame->autorelease();\n\n    return spriteFrame;\n}\n\nSpriteFrame* SpriteFrame::createWithTexture(Texture2D *texture, const Rect& rect)\n{\n    SpriteFrame *spriteFrame = new SpriteFrame();\n    spriteFrame->initWithTexture(texture, rect);\n    spriteFrame->autorelease();\n    \n    return spriteFrame;\n}\n\nSpriteFrame* SpriteFrame::createWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize)\n{\n    SpriteFrame *spriteFrame = new SpriteFrame();\n    spriteFrame->initWithTexture(texture, rect, rotated, offset, originalSize);\n    spriteFrame->autorelease();\n\n    return spriteFrame;\n}\n\nSpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize)\n{\n    SpriteFrame *spriteFrame = new SpriteFrame();\n    spriteFrame->initWithTextureFilename(filename, rect, rotated, offset, originalSize);\n    spriteFrame->autorelease();\n\n    return spriteFrame;\n}\n\nbool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect)\n{\n    Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect);\n    return initWithTexture(texture, rectInPixels, false, Point::ZERO, rectInPixels.size);\n}\n\nbool SpriteFrame::initWithTextureFilename(const std::string& filename, const Rect& rect)\n{\n    Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS( rect );\n    return initWithTextureFilename(filename, rectInPixels, false, Point::ZERO, rectInPixels.size);\n}\n\nbool SpriteFrame::initWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize)\n{\n    _texture = texture;\n\n    if (texture)\n    {\n        texture->retain();\n    }\n\n    _rectInPixels = rect;\n    _rect = CC_RECT_PIXELS_TO_POINTS(rect);\n    _offsetInPixels = offset;\n    _offset = CC_POINT_PIXELS_TO_POINTS( _offsetInPixels );\n    _originalSizeInPixels = originalSize;\n    _originalSize = CC_SIZE_PIXELS_TO_POINTS( _originalSizeInPixels );\n    _rotated = rotated;\n\n    return true;\n}\n\nbool SpriteFrame::initWithTextureFilename(const std::string& filename, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize)\n{\n    _texture = nullptr;\n    _textureFilename = filename;\n    _rectInPixels = rect;\n    _rect = CC_RECT_PIXELS_TO_POINTS( rect );\n    _offsetInPixels = offset;\n    _offset = CC_POINT_PIXELS_TO_POINTS( _offsetInPixels );\n    _originalSizeInPixels = originalSize;\n    _originalSize = CC_SIZE_PIXELS_TO_POINTS( _originalSizeInPixels );\n    _rotated = rotated;\n\n    return true;\n}\n\nSpriteFrame::~SpriteFrame(void)\n{\n    CCLOGINFO(\"deallocing SpriteFrame: %p\", this);\n    CC_SAFE_RELEASE(_texture);\n}\n\nSpriteFrame* SpriteFrame::clone() const\n{\n\t// no copy constructor\t\n    SpriteFrame *copy = new SpriteFrame();\n    copy->initWithTextureFilename(_textureFilename.c_str(), _rectInPixels, _rotated, _offsetInPixels, _originalSizeInPixels);\n    copy->setTexture(_texture);\n    copy->autorelease();\n    return copy;\n}\n\nvoid SpriteFrame::setRect(const Rect& rect)\n{\n    _rect = rect;\n    _rectInPixels = CC_RECT_POINTS_TO_PIXELS(_rect);\n}\n\nvoid SpriteFrame::setRectInPixels(const Rect& rectInPixels)\n{\n    _rectInPixels = rectInPixels;\n    _rect = CC_RECT_PIXELS_TO_POINTS(rectInPixels);\n}\n\nconst Point& SpriteFrame::getOffset() const\n{\n    return _offset;\n}\n\nvoid SpriteFrame::setOffset(const Point& offsets)\n{\n    _offset = offsets;\n    _offsetInPixels = CC_POINT_POINTS_TO_PIXELS( _offset );\n}\n\nconst Point& SpriteFrame::getOffsetInPixels() const\n{\n    return _offsetInPixels;\n}\n\nvoid SpriteFrame::setOffsetInPixels(const Point& offsetInPixels)\n{\n    _offsetInPixels = offsetInPixels;\n    _offset = CC_POINT_PIXELS_TO_POINTS( _offsetInPixels );\n}\n\nvoid SpriteFrame::setTexture(Texture2D * texture)\n{\n    if( _texture != texture ) {\n        CC_SAFE_RELEASE(_texture);\n        CC_SAFE_RETAIN(texture);\n        _texture = texture;\n    }\n}\n\nTexture2D* SpriteFrame::getTexture(void)\n{\n    if( _texture ) {\n        return _texture;\n    }\n\n    if( _textureFilename.length() > 0 ) {\n        return Director::getInstance()->getTextureCache()->addImage(_textureFilename.c_str());\n    }\n    // no texture or texture filename\n    return nullptr;\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSpriteFrame.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2011 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __SPRITE_CCSPRITE_FRAME_H__\n#define __SPRITE_CCSPRITE_FRAME_H__\n\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN\n\nclass Texture2D;\n\n/**\n * @addtogroup sprite_nodes\n * @{\n */\n\n/** @brief A SpriteFrame has:\n    - texture: A Texture2D that will be used by the Sprite\n    - rectangle: A rectangle of the texture\n\n\n You can modify the frame of a Sprite by doing:\n \n    SpriteFrame *frame = SpriteFrame::frameWithTexture(texture, rect, offset);\n    sprite->setDisplayFrame(frame);\n */\nclass CC_DLL SpriteFrame : public Object, public Clonable\n{\npublic:\n\n    /** Create a SpriteFrame with a texture filename, rect in points.\n     It is assumed that the frame was not trimmed.\n     */\n    static SpriteFrame* create(const std::string& filename, const Rect& rect);\n    \n    /** Create a SpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels.\n     The originalSize is the size in pixels of the frame before being trimmed.\n     */\n    static SpriteFrame* create(const std::string& filename, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize);\n    \n    /** Create a SpriteFrame with a texture, rect in points.\n     It is assumed that the frame was not trimmed.\n     */\n    static SpriteFrame* createWithTexture(Texture2D* pobTexture, const Rect& rect);\n\n    /** Create a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.\n     The originalSize is the size in points of the frame before being trimmed.\n     */\n    static SpriteFrame* createWithTexture(Texture2D* pobTexture, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~SpriteFrame(void);\n\n    /** Initializes a SpriteFrame with a texture, rect in points.\n     It is assumed that the frame was not trimmed.\n     */\n    bool initWithTexture(Texture2D* pobTexture, const Rect& rect);\n\n    /** Initializes a SpriteFrame with a texture filename, rect in points;\n     It is assumed that the frame was not trimmed.\n     */\n    bool initWithTextureFilename(const std::string& filename, const Rect& rect);\n\n    /** Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.\n    The originalSize is the size in points of the frame before being trimmed.\n    */\n    bool initWithTexture(Texture2D* pobTexture, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize);\n\n    /** Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.\n     The originalSize is the size in pixels of the frame before being trimmed.\n\n     @since v1.1\n     */\n    bool initWithTextureFilename(const std::string& filename, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize);\n\n\n    // attributes\n    inline const Rect& getRectInPixels() const { return _rectInPixels; }\n    void setRectInPixels(const Rect& rectInPixels);\n\n    inline bool isRotated(void) const { return _rotated; }\n    inline void setRotated(bool rotated) { _rotated = rotated; }\n\n    /** get rect of the frame */\n    inline const Rect& getRect(void) const { return _rect; }\n    /** set rect of the frame */\n    void setRect(const Rect& rect);\n\n    /** get offset of the frame */\n    const Point& getOffsetInPixels(void) const;\n    /** set offset of the frame */\n    void setOffsetInPixels(const Point& offsetInPixels);\n\n    /** get original size of the trimmed image */\n    inline const Size& getOriginalSizeInPixels(void) const { return _originalSizeInPixels; }\n    /** set original size of the trimmed image */\n    inline void setOriginalSizeInPixels(const Size& sizeInPixels) { _originalSizeInPixels = sizeInPixels; }\n\n    /** get original size of the trimmed image */\n    inline const Size& getOriginalSize(void) const { return _originalSize; }\n    /** set original size of the trimmed image */\n    inline void setOriginalSize(const Size& sizeInPixels) { _originalSize = sizeInPixels; }\n\n    /** get texture of the frame */\n    Texture2D* getTexture(void);\n    /** set texture of the frame, the texture is retained */\n    void setTexture(Texture2D* pobTexture);\n\n    const Point& getOffset(void) const;\n    void setOffset(const Point& offsets);\n\n    // Overrides\n\tvirtual SpriteFrame *clone() const override;\n\nprotected:\n    Point _offset;\n    Size _originalSize;\n    Rect _rectInPixels;\n    bool   _rotated;\n    Rect _rect;\n    Point _offsetInPixels;\n    Size _originalSizeInPixels;\n    Texture2D *_texture;\n    std::string  _textureFilename;\n};\n\n// end of sprite_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__SPRITE_CCSPRITE_FRAME_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSpriteFrameCache.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2009      Jason Booth\nCopyright (c) 2009      Robert J Payne\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCNS.h\"\n#include \"ccMacros.h\"\n#include \"CCTextureCache.h\"\n#include \"CCSpriteFrameCache.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCSprite.h\"\n#include \"TransformUtils.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCString.h\"\n#include \"CCArray.h\"\n#include \"CCDictionary.h\"\n#include \"CCDirector.h\"\n#include <vector>\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nstatic SpriteFrameCache *_sharedSpriteFrameCache = nullptr;\n\nSpriteFrameCache* SpriteFrameCache::getInstance()\n{\n    if (! _sharedSpriteFrameCache)\n    {\n        _sharedSpriteFrameCache = new SpriteFrameCache();\n        _sharedSpriteFrameCache->init();\n    }\n\n    return _sharedSpriteFrameCache;\n}\n\nvoid SpriteFrameCache::destroyInstance()\n{\n    CC_SAFE_RELEASE_NULL(_sharedSpriteFrameCache);\n}\n\nbool SpriteFrameCache::init(void)\n{\n    _spriteFrames.reserve(20);\n    _spriteFramesAliases.reserve(20);\n    _loadedFileNames = new std::set<std::string>();\n    return true;\n}\n\nSpriteFrameCache::~SpriteFrameCache(void)\n{\n    CC_SAFE_DELETE(_loadedFileNames);\n}\n\nvoid SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D* texture)\n{\n    /*\n    Supported Zwoptex Formats:\n\n    ZWTCoordinatesFormatOptionXMLLegacy = 0, // Flash Version\n    ZWTCoordinatesFormatOptionXML1_0 = 1, // Desktop Version 0.0 - 0.4b\n    ZWTCoordinatesFormatOptionXML1_1 = 2, // Desktop Version 1.0.0 - 1.0.1\n    ZWTCoordinatesFormatOptionXML1_2 = 3, // Desktop Version 1.0.2+\n    */\n\n    \n    ValueMap& framesDict = dictionary[\"frames\"].asValueMap();\n    int format = 0;\n\n    // get the format\n    if (dictionary.find(\"metadata\") != dictionary.end())\n    {\n        ValueMap& metadataDict = dictionary[\"metadata\"].asValueMap();\n        format = metadataDict[\"format\"].asInt();\n    }\n\n    // check the format\n    CCASSERT(format >=0 && format <= 3, \"format is not supported for SpriteFrameCache addSpriteFramesWithDictionary:textureFilename:\");\n\n    for (auto iter = framesDict.begin(); iter != framesDict.end(); ++iter)\n    {\n        ValueMap& frameDict = iter->second.asValueMap();\n        std::string spriteFrameName = iter->first;\n        SpriteFrame* spriteFrame = _spriteFrames.at(spriteFrameName);\n        if (spriteFrame)\n        {\n            continue;\n        }\n        \n        if(format == 0) \n        {\n            float x = frameDict[\"x\"].asFloat();\n            float y = frameDict[\"y\"].asFloat();\n            float w = frameDict[\"width\"].asFloat();\n            float h = frameDict[\"height\"].asFloat();\n            float ox = frameDict[\"offsetX\"].asFloat();\n            float oy = frameDict[\"offsetY\"].asFloat();\n            int ow = frameDict[\"originalWidth\"].asInt();\n            int oh = frameDict[\"originalHeight\"].asInt();\n            // check ow/oh\n            if(!ow || !oh)\n            {\n                CCLOGWARN(\"cocos2d: WARNING: originalWidth/Height not found on the SpriteFrame. AnchorPoint won't work as expected. Regenrate the .plist\");\n            }\n            // abs ow/oh\n            ow = abs(ow);\n            oh = abs(oh);\n            // create frame\n            spriteFrame = new SpriteFrame();\n            spriteFrame->initWithTexture(texture,\n                                        Rect(x, y, w, h), \n                                        false,\n                                        Point(ox, oy),\n                                        Size((float)ow, (float)oh)\n                                        );\n        } \n        else if(format == 1 || format == 2) \n        {\n            Rect frame = RectFromString(frameDict[\"frame\"].asString());\n            bool rotated = false;\n\n            // rotation\n            if (format == 2)\n            {\n                rotated = frameDict[\"rotated\"].asBool();\n            }\n\n            Point offset = PointFromString(frameDict[\"offset\"].asString());\n            Size sourceSize = SizeFromString(frameDict[\"sourceSize\"].asString());\n\n            // create frame\n            spriteFrame = new SpriteFrame();\n            spriteFrame->initWithTexture(texture,\n                frame,\n                rotated,\n                offset,\n                sourceSize\n                );\n        } \n        else if (format == 3)\n        {\n            // get values\n            Size spriteSize = SizeFromString(frameDict[\"spriteSize\"].asString());\n            Point spriteOffset = PointFromString(frameDict[\"spriteOffset\"].asString());\n            Size spriteSourceSize = SizeFromString(frameDict[\"spriteSourceSize\"].asString());\n            Rect textureRect = RectFromString(frameDict[\"textureRect\"].asString());\n            bool textureRotated = frameDict[\"textureRotated\"].asBool();\n\n            // get aliases\n            ValueVector& aliases = frameDict[\"aliases\"].asValueVector();\n\n            for(const auto &value : aliases) {\n                std::string oneAlias = value.asString();\n                if (_spriteFramesAliases.find(oneAlias) != _spriteFramesAliases.end())\n                {\n                    CCLOGWARN(\"cocos2d: WARNING: an alias with name %s already exists\", oneAlias.c_str());\n                }\n\n                _spriteFramesAliases[oneAlias] = Value(spriteFrameName);\n            }\n            \n            // create frame\n            spriteFrame = new SpriteFrame();\n            spriteFrame->initWithTexture(texture,\n                            Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height),\n                            textureRotated,\n                            spriteOffset,\n                            spriteSourceSize);\n        }\n\n        // add sprite frame\n        _spriteFrames.insert(spriteFrameName, spriteFrame);\n        spriteFrame->release();\n    }\n}\n\nvoid SpriteFrameCache::addSpriteFramesWithFile(const std::string& pszPlist, Texture2D *pobTexture)\n{\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszPlist);\n    ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);\n\n    addSpriteFramesWithDictionary(dict, pobTexture);\n}\n\nvoid SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName)\n{\n    CCASSERT(textureFileName.size()>0, \"texture name should not be null\");\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(textureFileName);\n\n    if (texture)\n    {\n        addSpriteFramesWithFile(plist, texture);\n    }\n    else\n    {\n        CCLOG(\"cocos2d: SpriteFrameCache: couldn't load texture file. File not found %s\", textureFileName.c_str());\n    }\n}\n\nvoid SpriteFrameCache::addSpriteFramesWithFile(const std::string& pszPlist)\n{\n    CCASSERT(pszPlist.size()>0, \"plist filename should not be nullptr\");\n\n    if (_loadedFileNames->find(pszPlist) == _loadedFileNames->end())\n    {\n        std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszPlist);\n        ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);\n\n        string texturePath(\"\");\n\n        if (dict.find(\"metadata\") != dict.end())\n        {\n            ValueMap& metadataDict = dict[\"metadata\"].asValueMap();\n            // try to read  texture file name from meta data\n            texturePath = metadataDict[\"textureFileName\"].asString();\n        }\n\n        if (!texturePath.empty())\n        {\n            // build texture path relative to plist file\n            texturePath = FileUtils::getInstance()->fullPathFromRelativeFile(texturePath.c_str(), pszPlist);\n        }\n        else\n        {\n            // build texture path by replacing file extension\n            texturePath = pszPlist;\n\n            // remove .xxx\n            size_t startPos = texturePath.find_last_of(\".\"); \n            texturePath = texturePath.erase(startPos);\n\n            // append .png\n            texturePath = texturePath.append(\".png\");\n\n            CCLOG(\"cocos2d: SpriteFrameCache: Trying to use file %s as texture\", texturePath.c_str());\n        }\n\n        Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(texturePath.c_str());\n\n        if (texture)\n        {\n            addSpriteFramesWithDictionary(dict, texture);\n            _loadedFileNames->insert(pszPlist);\n        }\n        else\n        {\n            CCLOG(\"cocos2d: SpriteFrameCache: Couldn't load texture\");\n        }\n    }\n}\n\nvoid SpriteFrameCache::addSpriteFrame(SpriteFrame* frame, const std::string& frameName)\n{\n    _spriteFrames.insert(frameName, frame);\n}\n\nvoid SpriteFrameCache::removeSpriteFrames()\n{\n    _spriteFrames.clear();\n    _spriteFramesAliases.clear();\n    _loadedFileNames->clear();\n}\n\nvoid SpriteFrameCache::removeUnusedSpriteFrames()\n{\n    bool removed = false;\n    std::vector<std::string> toRemoveFrames;\n    \n    for (auto iter = _spriteFrames.begin(); iter != _spriteFrames.end(); ++iter)\n    {\n        SpriteFrame* spriteFrame = iter->second;\n        if( spriteFrame->getReferenceCount() == 1 )\n        {\n            toRemoveFrames.push_back(iter->first);\n            CCLOG(\"cocos2d: SpriteFrameCache: removing unused frame: %s\", iter->first.c_str());\n            removed = true;\n        }\n    }\n\n    _spriteFrames.erase(toRemoveFrames);\n    \n    // XXX. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache\n    if( removed )\n    {\n        _loadedFileNames->clear();\n    }\n}\n\n\nvoid SpriteFrameCache::removeSpriteFrameByName(const std::string& name)\n{\n    // explicit nil handling\n    if( !(name.size()>0) )\n        return;\n\n    // Is this an alias ?\n    std::string key = _spriteFramesAliases[name].asString();\n\n    if (!key.empty())\n    {\n        _spriteFrames.erase(key);\n        _spriteFramesAliases.erase(key);\n    }\n    else\n    {\n        _spriteFrames.erase(name);\n    }\n\n    // XXX. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache\n    _loadedFileNames->clear();\n}\n\nvoid SpriteFrameCache::removeSpriteFramesFromFile(const std::string& plist)\n{\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);\n    ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);\n    if (dict.empty())\n    {\n        CCLOG(\"cocos2d:SpriteFrameCache:removeSpriteFramesFromFile: create dict by %s fail.\",plist.c_str());\n        return;\n    }\n    removeSpriteFramesFromDictionary(dict);\n\n    // remove it from the cache\n    set<string>::iterator ret = _loadedFileNames->find(plist);\n    if (ret != _loadedFileNames->end())\n    {\n        _loadedFileNames->erase(ret);\n    }\n}\n\nvoid SpriteFrameCache::removeSpriteFramesFromDictionary(ValueMap& dictionary)\n{\n    ValueMap framesDict = dictionary[\"frames\"].asValueMap();\n    std::vector<std::string> keysToRemove;\n\n    for (auto iter = framesDict.cbegin(); iter != framesDict.cend(); ++iter)\n    {\n        if (_spriteFrames.at(iter->first))\n        {\n            keysToRemove.push_back(iter->first);\n        }\n    }\n\n    _spriteFrames.erase(keysToRemove);\n}\n\nvoid SpriteFrameCache::removeSpriteFramesFromTexture(Texture2D* texture)\n{\n    std::vector<std::string> keysToRemove;\n\n    for (auto iter = _spriteFrames.cbegin(); iter != _spriteFrames.cend(); ++iter)\n    {\n        std::string key = iter->first;\n        SpriteFrame* frame = _spriteFrames.at(key);\n        if (frame && (frame->getTexture() == texture))\n        {\n            keysToRemove.push_back(key);\n        }\n    }\n\n    _spriteFrames.erase(keysToRemove);\n}\n\nSpriteFrame* SpriteFrameCache::getSpriteFrameByName(const std::string& name)\n{\n    SpriteFrame* frame = _spriteFrames.at(name);\n    if (!frame)\n    {\n        // try alias dictionary\n        std::string key = _spriteFramesAliases[name].asString();\n        if (!key.empty())\n        {\n            frame = _spriteFrames.at(key);\n            if (!frame)\n            {\n                CCLOG(\"cocos2d: SpriteFrameCache: Frame '%s' not found\", name.c_str());\n            }\n        }\n    }\n    return frame;\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCSpriteFrameCache.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2009      Jason Booth\nCopyright (c) 2009      Robert J Payne\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __SPRITE_CCSPRITE_FRAME_CACHE_H__\n#define __SPRITE_CCSPRITE_FRAME_CACHE_H__\n\n/*\n * To create sprite frames and texture atlas, use this tool:\n * http://zwoptex.zwopple.com/\n */\n\n#include \"CCSpriteFrame.h\"\n#include \"CCTexture2D.h\"\n#include \"CCObject.h\"\n#include \"CCValue.h\"\n#include \"CCMap.h\"\n#include <set>\n#include <string>\n\nNS_CC_BEGIN\n\nclass Sprite;\n\n/**\n * @addtogroup sprite_nodes\n * @{\n */\n\n/** @brief Singleton that handles the loading of the sprite frames.\n It saves in a cache the sprite frames.\n @since v0.9\n */\nclass CC_DLL SpriteFrameCache : public Object\n{\npublic:\n    /** Returns the shared instance of the Sprite Frame cache */\n    static SpriteFrameCache* getInstance(void);\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static SpriteFrameCache* sharedSpriteFrameCache() { return SpriteFrameCache::getInstance(); }\n\n    /** Destroys the cache. It releases all the Sprite Frames and the retained instance. */\n    static void destroyInstance();\n\n    /** @deprecated Use destroyInstance() instead  */\n    CC_DEPRECATED_ATTRIBUTE static void purgeSharedSpriteFrameCache() { return SpriteFrameCache::destroyInstance(); }\n\nprotected:\n    // MARMALADE: Made this protected not private, as deriving from this class is pretty useful\n    SpriteFrameCache(){}\n\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~SpriteFrameCache();\n    bool init(void);\n\npublic:\n    /** Adds multiple Sprite Frames from a plist file.\n     * A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png\n     * If you want to use another texture, you should use the addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName) method.\n     * @js addSpriteFrames\n     * @lua addSpriteFrames\n     */\n    void addSpriteFramesWithFile(const std::string& plist);\n\n    /** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames.\n     @since v0.99.5\n     * @js addSpriteFrames\n     * @lua addSpriteFrames\n     */\n    void addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName);\n\n    /** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames. \n     * @js addSpriteFrames\n     * @lua addSpriteFrames\n     */\n    void addSpriteFramesWithFile(const std::string&plist, Texture2D *texture);\n\n    /** Adds an sprite frame with a given name.\n     If the name already exists, then the contents of the old name will be replaced with the new one.\n     */\n    void addSpriteFrame(SpriteFrame *frame, const std::string& frameName);\n\n    /** Purges the dictionary of loaded sprite frames.\n     * Call this method if you receive the \"Memory Warning\".\n     * In the short term: it will free some resources preventing your app from being killed.\n     * In the medium term: it will allocate more resources.\n     * In the long term: it will be the same.\n     */\n    void removeSpriteFrames();\n\n    /** Removes unused sprite frames.\n     * Sprite Frames that have a retain count of 1 will be deleted.\n     * It is convenient to call this method after when starting a new Scene.\n     */\n    void removeUnusedSpriteFrames();\n\n    /** Deletes an sprite frame from the sprite frame cache. */\n    void removeSpriteFrameByName(const std::string& name);\n\n    /** Removes multiple Sprite Frames from a plist file.\n    * Sprite Frames stored in this file will be removed.\n    * It is convenient to call this method when a specific texture needs to be removed.\n    * @since v0.99.5\n    */\n    void removeSpriteFramesFromFile(const std::string& plist);\n\n    /** Removes all Sprite Frames associated with the specified textures.\n     * It is convenient to call this method when a specific texture needs to be removed.\n     * @since v0.995.\n     */\n    void removeSpriteFramesFromTexture(Texture2D* texture);\n\n    /** Returns an Sprite Frame that was previously added.\n     If the name is not found it will return nil.\n     You should retain the returned copy if you are going to use it.\n     * @js getSpriteFrame\n     * @lua getSpriteFrame\n     */\n    SpriteFrame* getSpriteFrameByName(const std::string& name);\n\n    /** @deprecated use getSpriteFrameByName() instead */\n    CC_DEPRECATED_ATTRIBUTE SpriteFrame* spriteFrameByName(const std::string&name) { return getSpriteFrameByName(name); }\n\nprivate:\n    /*Adds multiple Sprite Frames with a dictionary. The texture will be associated with the created sprite frames.\n     */\n    void addSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture);\n\n    /** Removes multiple Sprite Frames from Dictionary.\n    * @since v0.99.5\n    */\n    void removeSpriteFramesFromDictionary(ValueMap& dictionary);\n\nprotected:\n    Map<std::string, SpriteFrame*> _spriteFrames;\n    ValueMap _spriteFramesAliases;\n    std::set<std::string>*  _loadedFileNames;\n};\n\n// end of sprite_nodes group\n/// @}\n\nNS_CC_END\n\n#endif // __SPRITE_CCSPRITE_FRAME_CACHE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXLayer.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCTMXLayer.h\"\n#include \"CCTMXXMLParser.h\"\n#include \"CCTMXTiledMap.h\"\n#include \"CCSprite.h\"\n#include \"CCTextureCache.h\"\n#include \"CCShaderCache.h\"\n#include \"CCGLProgram.h\"\n#include \"ccCArray.h\"\n#include \"CCDirector.h\"\n\nNS_CC_BEGIN\n\n\n// TMXLayer - init & alloc & dealloc\n\nTMXLayer * TMXLayer::create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)\n{\n    TMXLayer *ret = new TMXLayer();\n    if (ret->initWithTilesetInfo(tilesetInfo, layerInfo, mapInfo))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    return nullptr;\n}\nbool TMXLayer::initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)\n{    \n    // XXX: is 35% a good estimate ?\n    Size size = layerInfo->_layerSize;\n    float totalNumberOfTiles = size.width * size.height;\n    float capacity = totalNumberOfTiles * 0.35f + 1; // 35 percent is occupied ?\n\n    Texture2D *texture = nullptr;\n    if( tilesetInfo )\n    {\n        texture = Director::getInstance()->getTextureCache()->addImage(tilesetInfo->_sourceImage.c_str());\n    }\n\n    if (SpriteBatchNode::initWithTexture(texture, static_cast<ssize_t>(capacity)))\n    {\n        // layerInfo\n        _layerName = layerInfo->_name;\n        _layerSize = size;\n        _tiles = layerInfo->_tiles;\n        _opacity = layerInfo->_opacity;\n        setProperties(layerInfo->getProperties());\n        _contentScaleFactor = Director::getInstance()->getContentScaleFactor(); \n\n        // tilesetInfo\n        _tileSet = tilesetInfo;\n        CC_SAFE_RETAIN(_tileSet);\n\n        // mapInfo\n        _mapTileSize = mapInfo->getTileSize();\n        _layerOrientation = mapInfo->getOrientation();\n\n        // offset (after layer orientation is set);\n        Point offset = this->calculateLayerOffset(layerInfo->_offset);\n        this->setPosition(CC_POINT_PIXELS_TO_POINTS(offset));\n\n        _atlasIndexArray = ccCArrayNew(totalNumberOfTiles);\n\n        this->setContentSize(CC_SIZE_PIXELS_TO_POINTS(Size(_layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height)));\n\n        _useAutomaticVertexZ = false;\n        _vertexZvalue = 0;\n        \n        return true;\n    }\n    return false;\n}\n\nTMXLayer::TMXLayer()\n:_layerName(\"\")\n,_opacity(0)\n,_vertexZvalue(0)\n,_useAutomaticVertexZ(false)\n,_reusedTile(nullptr)\n,_atlasIndexArray(nullptr)\n,_contentScaleFactor(1.0f)\n,_layerSize(Size::ZERO)\n,_mapTileSize(Size::ZERO)\n,_tiles(nullptr)\n,_tileSet(nullptr)\n,_layerOrientation(TMXOrientationOrtho)\n{}\n\nTMXLayer::~TMXLayer()\n{\n    CC_SAFE_RELEASE(_tileSet);\n    CC_SAFE_RELEASE(_reusedTile);\n\n    if (_atlasIndexArray)\n    {\n        ccCArrayFree(_atlasIndexArray);\n        _atlasIndexArray = nullptr;\n    }\n\n    CC_SAFE_DELETE_ARRAY(_tiles);\n}\n\nvoid TMXLayer::releaseMap()\n{\n    if (_tiles)\n    {\n        delete [] _tiles;\n        _tiles = nullptr;\n    }\n\n    if (_atlasIndexArray)\n    {\n        ccCArrayFree(_atlasIndexArray);\n        _atlasIndexArray = nullptr;\n    }\n}\n\n// TMXLayer - setup Tiles\nvoid TMXLayer::setupTiles()\n{    \n    // Optimization: quick hack that sets the image size on the tileset\n    _tileSet->_imageSize = _textureAtlas->getTexture()->getContentSizeInPixels();\n\n    // By default all the tiles are aliased\n    // pros:\n    //  - easier to render\n    // cons:\n    //  - difficult to scale / rotate / etc.\n    _textureAtlas->getTexture()->setAliasTexParameters();\n\n    //CFByteOrder o = CFByteOrderGetCurrent();\n\n    // Parse cocos2d properties\n    this->parseInternalProperties();\n\n    for (int y=0; y < _layerSize.height; y++)\n    {\n        for (int x=0; x < _layerSize.width; x++)\n        {\n            int pos = static_cast<int>(x + _layerSize.width * y);\n            int gid = _tiles[ pos ];\n\n            // gid are stored in little endian.\n            // if host is big endian, then swap\n            //if( o == CFByteOrderBigEndian )\n            //    gid = CFSwapInt32( gid );\n            /* We support little endian.*/\n\n            // XXX: gid == 0 --> empty tile\n            if (gid != 0) \n            {\n                this->appendTileForGID(gid, Point(x, y));\n            }\n        }\n    }\n}\n\n// TMXLayer - Properties\nValue TMXLayer::getProperty(const std::string& propertyName) const\n{\n    if (_properties.find(propertyName) != _properties.end())\n        return _properties.at(propertyName);\n    \n    return Value();\n}\n\nvoid TMXLayer::parseInternalProperties()\n{\n    // if cc_vertex=automatic, then tiles will be rendered using vertexz\n\n    auto vertexz = getProperty(\"cc_vertexz\");\n    if (!vertexz.isNull())\n    {\n        std::string vertexZStr = vertexz.asString();\n        // If \"automatic\" is on, then parse the \"cc_alpha_func\" too\n        if (vertexZStr == \"automatic\")\n        {\n            _useAutomaticVertexZ = true;\n            auto alphaFuncVal = getProperty(\"cc_alpha_func\");\n            float alphaFuncValue = alphaFuncVal.asFloat();\n            setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST));\n\n            GLint alphaValueLocation = glGetUniformLocation(getShaderProgram()->getProgram(), GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE);\n\n            // NOTE: alpha test shader is hard-coded to use the equivalent of a glAlphaFunc(GL_GREATER) comparison\n            \n            // use shader program to set uniform\n            getShaderProgram()->use();\n            getShaderProgram()->setUniformLocationWith1f(alphaValueLocation, alphaFuncValue);\n            CHECK_GL_ERROR_DEBUG();\n        }\n        else\n        {\n            _vertexZvalue = vertexz.asInt();\n        }\n    }\n}\n\nvoid TMXLayer::setupTileSprite(Sprite* sprite, Point pos, int gid)\n{\n    sprite->setPosition(getPositionAt(pos));\n    sprite->setVertexZ((float)getVertexZForPos(pos));\n    sprite->setAnchorPoint(Point::ZERO);\n    sprite->setOpacity(_opacity);\n\n    //issue 1264, flip can be undone as well\n    sprite->setFlippedX(false);\n    sprite->setFlippedY(false);\n    sprite->setRotation(0.0f);\n    sprite->setAnchorPoint(Point(0,0));\n\n    // Rotation in tiled is achieved using 3 flipped states, flipping across the horizontal, vertical, and diagonal axes of the tiles.\n    if (gid & kTMXTileDiagonalFlag)\n    {\n        // put the anchor in the middle for ease of rotation.\n        sprite->setAnchorPoint(Point(0.5f,0.5f));\n        sprite->setPosition(Point(getPositionAt(pos).x + sprite->getContentSize().height/2,\n           getPositionAt(pos).y + sprite->getContentSize().width/2 ) );\n\n        int flag = gid & (kTMXTileHorizontalFlag | kTMXTileVerticalFlag );\n\n        // handle the 4 diagonally flipped states.\n        if (flag == kTMXTileHorizontalFlag)\n        {\n            sprite->setRotation(90.0f);\n        }\n        else if (flag == kTMXTileVerticalFlag)\n        {\n            sprite->setRotation(270.0f);\n        }\n        else if (flag == (kTMXTileVerticalFlag | kTMXTileHorizontalFlag) )\n        {\n            sprite->setRotation(90.0f);\n            sprite->setFlippedX(true);\n        }\n        else\n        {\n            sprite->setRotation(270.0f);\n            sprite->setFlippedX(true);\n        }\n    }\n    else\n    {\n        if (gid & kTMXTileHorizontalFlag)\n        {\n            sprite->setFlippedX(true);\n        }\n\n        if (gid & kTMXTileVerticalFlag)\n        {\n            sprite->setFlippedY(true);\n        }\n    }\n}\n\nSprite* TMXLayer::reusedTileWithRect(Rect rect)\n{\n    if (! _reusedTile) \n    {\n        _reusedTile = Sprite::createWithTexture(_textureAtlas->getTexture(), rect);\n        _reusedTile->setBatchNode(this);\n        _reusedTile->retain();\n    }\n    else\n    {\n        // XXX HACK: Needed because if \"batch node\" is nil,\n\t\t// then the Sprite'squad will be reset\n        _reusedTile->setBatchNode(nullptr);\n        \n\t\t// Re-init the sprite\n        _reusedTile->setTextureRect(rect, false, rect.size);\n        \n\t\t// restore the batch node\n        _reusedTile->setBatchNode(this);\n    }\n\n    return _reusedTile;\n}\n\n// TMXLayer - obtaining tiles/gids\nSprite * TMXLayer::getTileAt(const Point& pos)\n{\n    CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, \"TMXLayer: invalid position\");\n    CCASSERT(_tiles && _atlasIndexArray, \"TMXLayer: the tiles map has been released\");\n\n    Sprite *tile = nullptr;\n    int gid = this->getTileGIDAt(pos);\n\n    // if GID == 0, then no tile is present\n    if (gid) \n    {\n        int z = (int)(pos.x + pos.y * _layerSize.width);\n        tile = static_cast<Sprite*>(this->getChildByTag(z));\n\n        // tile not created yet. create it\n        if (! tile) \n        {\n            Rect rect = _tileSet->rectForGID(gid);\n            rect = CC_RECT_PIXELS_TO_POINTS(rect);\n\n            tile = Sprite::createWithTexture(this->getTexture(), rect);\n            tile->setBatchNode(this);\n            tile->setPosition(getPositionAt(pos));\n            tile->setVertexZ((float)getVertexZForPos(pos));\n            tile->setAnchorPoint(Point::ZERO);\n            tile->setOpacity(_opacity);\n\n            ssize_t indexForZ = atlasIndexForExistantZ(z);\n            this->addSpriteWithoutQuad(tile, static_cast<int>(indexForZ), z);\n        }\n    }\n    \n    return tile;\n}\n\nint TMXLayer::getTileGIDAt(const Point& pos, ccTMXTileFlags* flags/* = nullptr*/)\n{\n    CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, \"TMXLayer: invalid position\");\n    CCASSERT(_tiles && _atlasIndexArray, \"TMXLayer: the tiles map has been released\");\n\n    int idx = static_cast<int>((pos.x + pos.y * _layerSize.width));\n    // Bits on the far end of the 32-bit global tile ID are used for tile flags\n    int tile = _tiles[idx];\n\n    // issue1264, flipped tiles can be changed dynamically\n    if (flags) \n    {\n        *flags = (ccTMXTileFlags)(tile & kFlipedAll);\n    }\n    \n    return (tile & kFlippedMask);\n}\n\n// TMXLayer - adding helper methods\nSprite * TMXLayer::insertTileForGID(int gid, const Point& pos)\n{\n    if (gid != 0 && (static_cast<int>((gid & kFlippedMask)) - _tileSet->_firstGid) >= 0)\n    {\n        Rect rect = _tileSet->rectForGID(gid);\n        rect = CC_RECT_PIXELS_TO_POINTS(rect);\n        \n        intptr_t z = (intptr_t)(pos.x + pos.y * _layerSize.width);\n        \n        Sprite *tile = reusedTileWithRect(rect);\n        \n        setupTileSprite(tile, pos, gid);\n        \n        // get atlas index\n        ssize_t indexForZ = atlasIndexForNewZ(static_cast<int>(z));\n        \n        // Optimization: add the quad without adding a child\n        this->insertQuadFromSprite(tile, indexForZ);\n        \n        // insert it into the local atlasindex array\n        ccCArrayInsertValueAtIndex(_atlasIndexArray, (void*)z, indexForZ);\n        \n        // update possible children\n        \n        for(const auto &child : _children) {\n            Sprite* sp = static_cast<Sprite*>(child);\n            ssize_t ai = sp->getAtlasIndex();\n            if ( ai >= indexForZ )\n            {\n                sp->setAtlasIndex(ai+1);\n            }\n        }\n        \n        _tiles[z] = gid;\n        return tile;\n    }\n    \n    return nullptr;\n}\n\nSprite * TMXLayer::updateTileForGID(int gid, const Point& pos)    \n{\n    Rect rect = _tileSet->rectForGID(gid);\n    rect = Rect(rect.origin.x / _contentScaleFactor, rect.origin.y / _contentScaleFactor, rect.size.width/ _contentScaleFactor, rect.size.height/ _contentScaleFactor);\n    int z = (int)(pos.x + pos.y * _layerSize.width);\n\n    Sprite *tile = reusedTileWithRect(rect);\n\n    setupTileSprite(tile ,pos ,gid);\n\n    // get atlas index\n    ssize_t indexForZ = atlasIndexForExistantZ(z);\n    tile->setAtlasIndex(indexForZ);\n    tile->setDirty(true);\n    tile->updateTransform();\n    _tiles[z] = gid;\n\n    return tile;\n}\n\n// used only when parsing the map. useless after the map was parsed\n// since lot's of assumptions are no longer true\nSprite * TMXLayer::appendTileForGID(int gid, const Point& pos)\n{\n    if (gid != 0 && (static_cast<int>((gid & kFlippedMask)) - _tileSet->_firstGid) >= 0)\n    {\n        Rect rect = _tileSet->rectForGID(gid);\n        rect = CC_RECT_PIXELS_TO_POINTS(rect);\n        \n        intptr_t z = (intptr_t)(pos.x + pos.y * _layerSize.width);\n        \n        Sprite *tile = reusedTileWithRect(rect);\n        \n        setupTileSprite(tile ,pos ,gid);\n        \n        // optimization:\n        // The difference between appendTileForGID and insertTileforGID is that append is faster, since\n        // it appends the tile at the end of the texture atlas\n        ssize_t indexForZ = _atlasIndexArray->num;\n        \n        // don't add it using the \"standard\" way.\n        insertQuadFromSprite(tile, indexForZ);\n        \n        // append should be after addQuadFromSprite since it modifies the quantity values\n        ccCArrayInsertValueAtIndex(_atlasIndexArray, (void*)z, indexForZ);\n        \n        return tile;\n    }\n    \n    return nullptr;\n}\n\n// TMXLayer - atlasIndex and Z\nstatic inline int compareInts(const void * a, const void * b)\n{\n    return ((*(int*)a) - (*(int*)b));\n}\n\nssize_t TMXLayer::atlasIndexForExistantZ(int z)\n{\n    int key=z;\n    int *item = (int*)bsearch((void*)&key, (void*)&_atlasIndexArray->arr[0], _atlasIndexArray->num, sizeof(void*), compareInts);\n\n    CCASSERT(item, \"TMX atlas index not found. Shall not happen\");\n\n    ssize_t index = ((size_t)item - (size_t)_atlasIndexArray->arr) / sizeof(void*);\n    return index;\n}\n\nssize_t TMXLayer::atlasIndexForNewZ(int z)\n{\n    // XXX: This can be improved with a sort of binary search\n    ssize_t i=0;\n    for (i=0; i< _atlasIndexArray->num ; i++) \n    {\n        ssize_t val = (size_t) _atlasIndexArray->arr[i];\n        if (z < val)\n        {\n            break;\n        }\n    } \n    \n    return i;\n}\n\n// TMXLayer - adding / remove tiles\nvoid TMXLayer::setTileGID(int gid, const Point& pos)\n{\n    setTileGID(gid, pos, (ccTMXTileFlags)0);\n}\n\nvoid TMXLayer::setTileGID(int gid, const Point& pos, ccTMXTileFlags flags)\n{\n    CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, \"TMXLayer: invalid position\");\n    CCASSERT(_tiles && _atlasIndexArray, \"TMXLayer: the tiles map has been released\");\n    CCASSERT(gid == 0 || gid >= _tileSet->_firstGid, \"TMXLayer: invalid gid\" );\n\n    ccTMXTileFlags currentFlags;\n    int currentGID = getTileGIDAt(pos, &currentFlags);\n\n    if (currentGID != gid || currentFlags != flags) \n    {\n        int gidAndFlags = gid | flags;\n\n        // setting gid=0 is equal to remove the tile\n        if (gid == 0)\n        {\n            removeTileAt(pos);\n        }\n        // empty tile. create a new one\n        else if (currentGID == 0)\n        {\n            insertTileForGID(gidAndFlags, pos);\n        }\n        // modifying an existing tile with a non-empty tile\n        else \n        {\n            int z = pos.x + pos.y * _layerSize.width;\n            Sprite *sprite = static_cast<Sprite*>(getChildByTag(z));\n            if (sprite)\n            {\n                Rect rect = _tileSet->rectForGID(gid);\n                rect = CC_RECT_PIXELS_TO_POINTS(rect);\n\n                sprite->setTextureRect(rect, false, rect.size);\n                if (flags) \n                {\n                    setupTileSprite(sprite, sprite->getPosition(), gidAndFlags);\n                }\n                _tiles[z] = gidAndFlags;\n            } \n            else \n            {\n                updateTileForGID(gidAndFlags, pos);\n            }\n        }\n    }\n}\n\nvoid TMXLayer::addChild(Node * child, int zOrder, int tag)\n{\n    CC_UNUSED_PARAM(child);\n    CC_UNUSED_PARAM(zOrder);\n    CC_UNUSED_PARAM(tag);\n    CCASSERT(0, \"addChild: is not supported on TMXLayer. Instead use setTileGID:at:/tileAt:\");\n}\n\nvoid TMXLayer::removeChild(Node* node, bool cleanup)\n{\n    Sprite *sprite = (Sprite*)node;\n    // allows removing nil objects\n    if (! sprite)\n    {\n        return;\n    }\n\n    CCASSERT(_children.contains(sprite), \"Tile does not belong to TMXLayer\");\n\n    ssize_t atlasIndex = sprite->getAtlasIndex();\n    ssize_t zz = (ssize_t)_atlasIndexArray->arr[atlasIndex];\n    _tiles[zz] = 0;\n    ccCArrayRemoveValueAtIndex(_atlasIndexArray, atlasIndex);\n    SpriteBatchNode::removeChild(sprite, cleanup);\n}\n\nvoid TMXLayer::removeTileAt(const Point& pos)\n{\n    CCASSERT(pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, \"TMXLayer: invalid position\");\n    CCASSERT(_tiles && _atlasIndexArray, \"TMXLayer: the tiles map has been released\");\n\n    int gid = getTileGIDAt(pos);\n\n    if (gid) \n    {\n        int z = pos.x + pos.y * _layerSize.width;\n        ssize_t atlasIndex = atlasIndexForExistantZ(z);\n\n        // remove tile from GID map\n        _tiles[z] = 0;\n\n        // remove tile from atlas position array\n        ccCArrayRemoveValueAtIndex(_atlasIndexArray, atlasIndex);\n\n        // remove it from sprites and/or texture atlas\n        Sprite *sprite = (Sprite*)getChildByTag(z);\n        if (sprite)\n        {\n            SpriteBatchNode::removeChild(sprite, true);\n        }\n        else \n        {\n            _textureAtlas->removeQuadAtIndex(atlasIndex);\n\n            // update possible children\n            for(const auto &obj : _children) {\n                Sprite* child = static_cast<Sprite*>(obj);\n                ssize_t ai = child->getAtlasIndex();\n                if ( ai >= atlasIndex )\n                {\n                    child->setAtlasIndex(ai-1);\n                }\n            }\n        }\n    }\n}\n\n//CCTMXLayer - obtaining positions, offset\nPoint TMXLayer::calculateLayerOffset(const Point& pos)\n{\n    Point ret = Point::ZERO;\n    switch (_layerOrientation) \n    {\n    case TMXOrientationOrtho:\n        ret = Point( pos.x * _mapTileSize.width, -pos.y *_mapTileSize.height);\n        break;\n    case TMXOrientationIso:\n        ret = Point((_mapTileSize.width /2) * (pos.x - pos.y),\n                  (_mapTileSize.height /2 ) * (-pos.x - pos.y));\n        break;\n    case TMXOrientationHex:\n        CCASSERT(pos.equals(Point::ZERO), \"offset for hexagonal map not implemented yet\");\n        break;\n    }\n    return ret;    \n}\n\nPoint TMXLayer::getPositionAt(const Point& pos)\n{\n    Point ret = Point::ZERO;\n    switch (_layerOrientation)\n    {\n    case TMXOrientationOrtho:\n        ret = getPositionForOrthoAt(pos);\n        break;\n    case TMXOrientationIso:\n        ret = getPositionForIsoAt(pos);\n        break;\n    case TMXOrientationHex:\n        ret = getPositionForHexAt(pos);\n        break;\n    }\n    ret = CC_POINT_PIXELS_TO_POINTS( ret );\n    return ret;\n}\n\nPoint TMXLayer::getPositionForOrthoAt(const Point& pos)\n{\n    return Point(pos.x * _mapTileSize.width,\n                            (_layerSize.height - pos.y - 1) * _mapTileSize.height);\n}\n\nPoint TMXLayer::getPositionForIsoAt(const Point& pos)\n{\n    return Point(_mapTileSize.width /2 * (_layerSize.width + pos.x - pos.y - 1),\n                             _mapTileSize.height /2 * ((_layerSize.height * 2 - pos.x - pos.y) - 2));\n}\n\nPoint TMXLayer::getPositionForHexAt(const Point& pos)\n{\n    float diffY = 0;\n    if ((int)pos.x % 2 == 1)\n    {\n        diffY = -_mapTileSize.height/2 ;\n    }\n\n    Point xy = Point(pos.x * _mapTileSize.width*3/4,\n                            (_layerSize.height - pos.y - 1) * _mapTileSize.height + diffY);\n    return xy;\n}\n\nint TMXLayer::getVertexZForPos(const Point& pos)\n{\n    int ret = 0;\n    int maxVal = 0;\n    if (_useAutomaticVertexZ)\n    {\n        switch (_layerOrientation) \n        {\n        case TMXOrientationIso:\n            maxVal = static_cast<int>(_layerSize.width + _layerSize.height);\n            ret = static_cast<int>(-(maxVal - (pos.x + pos.y)));\n            break;\n        case TMXOrientationOrtho:\n            ret = static_cast<int>(-(_layerSize.height-pos.y));\n            break;\n        case TMXOrientationHex:\n            CCASSERT(0, \"TMX Hexa zOrder not supported\");\n            break;\n        default:\n            CCASSERT(0, \"TMX invalid value\");\n            break;\n        }\n    } \n    else\n    {\n        ret = _vertexZvalue;\n    }\n    \n    return ret;\n}\n\nstd::string TMXLayer::getDescription() const\n{\n    return StringUtils::format(\"<TMXLayer | tag = %d, size = %d,%d>\", _tag, (int)_mapTileSize.width, (int)_mapTileSize.height);\n}\n\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXLayer.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCTMX_LAYER_H__\n#define __CCTMX_LAYER_H__\n\n#include \"CCTMXObjectGroup.h\"\n#include \"CCAtlasNode.h\"\n#include \"CCSpriteBatchNode.h\"\n#include \"CCTMXXMLParser.h\"\n#include \"ccCArray.h\"\nNS_CC_BEGIN\n\nclass TMXMapInfo;\nclass TMXLayerInfo;\nclass TMXTilesetInfo;\nstruct _ccCArray;\n\n/**\n * @addtogroup tilemap_parallax_nodes\n * @{\n */\n\n/** @brief TMXLayer represents the TMX layer.\n\nIt is a subclass of SpriteBatchNode. By default the tiles are rendered using a TextureAtlas.\nIf you modify a tile on runtime, then, that tile will become a Sprite, otherwise no Sprite objects are created.\nThe benefits of using Sprite objects as tiles are:\n- tiles (Sprite) can be rotated/scaled/moved with a nice API\n\nIf the layer contains a property named \"cc_vertexz\" with an integer (in can be positive or negative),\nthen all the tiles belonging to the layer will use that value as their OpenGL vertex Z for depth.\n\nOn the other hand, if the \"cc_vertexz\" property has the \"automatic\" value, then the tiles will use an automatic vertex Z value.\nAlso before drawing the tiles, GL_ALPHA_TEST will be enabled, and disabled after drawing them. The used alpha func will be:\n\nglAlphaFunc( GL_GREATER, value )\n\n\"value\" by default is 0, but you can change it from Tiled by adding the \"cc_alpha_func\" property to the layer.\nThe value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a different\nvalue, like 0.5.\n\nFor further information, please see the programming guide:\n\nhttp://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps\n\n@since v0.8.1\nTiles can have tile flags for additional properties. At the moment only flip horizontal and flip vertical are used. These bit flags are defined in TMXXMLParser.h.\n\n@since 1.1\n*/\n\nclass CC_DLL TMXLayer : public SpriteBatchNode\n{\npublic:\n    /** creates a TMXLayer with an tileset info, a layer info and a map info */\n    static TMXLayer * create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);\n    /**\n     * @js ctor\n     */\n    TMXLayer();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TMXLayer();\n\n    /** initializes a TMXLayer with a tileset info, a layer info and a map info */\n    bool initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);\n\n    /** dealloc the map that contains the tile position from memory.\n    Unless you want to know at runtime the tiles positions, you can safely call this method.\n    If you are going to call layer->tileGIDAt() then, don't release the map\n    */\n    void releaseMap();\n\n    /** returns the tile (Sprite) at a given a tile coordinate.\n    The returned Sprite will be already added to the TMXLayer. Don't add it again.\n    The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.\n    You can remove either by calling:\n    - layer->removeChild(sprite, cleanup);\n    - or layer->removeTileAt(Point(x,y));\n    */\n    Sprite* getTileAt(const Point& tileCoordinate);\n    CC_DEPRECATED_ATTRIBUTE Sprite* tileAt(const Point& tileCoordinate) { return getTileAt(tileCoordinate); };\n    \n    /** returns the tile gid at a given tile coordinate. It also returns the tile flags.\n     This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap])\n     */\n    int getTileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr);\n    CC_DEPRECATED_ATTRIBUTE int tileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr){\n        return getTileGIDAt(tileCoordinate, flags);\n    };\n\n    /** sets the tile gid (gid = tile global id) at a given tile coordinate.\n    The Tile GID can be obtained by using the method \"tileGIDAt\" or by using the TMX editor -> Tileset Mgr +1.\n    If a tile is already placed at that position, then it will be removed.\n    */\n    void setTileGID(int gid, const Point& tileCoordinate);\n\n    /** sets the tile gid (gid = tile global id) at a given tile coordinate.\n     The Tile GID can be obtained by using the method \"tileGIDAt\" or by using the TMX editor -> Tileset Mgr +1.\n     If a tile is already placed at that position, then it will be removed.\n     \n     Use withFlags if the tile flags need to be changed as well\n     */\n\n    void setTileGID(int gid, const Point& tileCoordinate, ccTMXTileFlags flags);\n\n    /** removes a tile at given tile coordinate */\n    void removeTileAt(const Point& tileCoordinate);\n\n    /** returns the position in points of a given tile coordinate */\n    Point getPositionAt(const Point& tileCoordinate);\n    CC_DEPRECATED_ATTRIBUTE Point positionAt(const Point& tileCoordinate) { return getPositionAt(tileCoordinate); };\n\n    /** return the value for the specific property name */\n    Value getProperty(const std::string& propertyName) const;\n    CC_DEPRECATED_ATTRIBUTE Value propertyNamed(const std::string& propertyName) const { return getProperty(propertyName); };\n\n    /** Creates the tiles */\n    void setupTiles();\n\n    inline const std::string& getLayerName(){ return _layerName; }\n    inline void setLayerName(const std::string& layerName){ _layerName = layerName; }\n\n    /** size of the layer in tiles */\n    inline const Size& getLayerSize() const { return _layerSize; };\n    inline void setLayerSize(const Size& size) { _layerSize = size; };\n    \n    /** size of the map's tile (could be different from the tile's size) */\n    inline const Size& getMapTileSize() const { return _mapTileSize; };\n    inline void setMapTileSize(const Size& size) { _mapTileSize = size; };\n    \n    /** pointer to the map of tiles \n     * @js NA\n     * @lua NA\n     */\n    inline int* getTiles() const { return _tiles; };\n    inline void setTiles(int* tiles) { _tiles = tiles; };\n    \n    /** Tileset information for the layer */\n    inline TMXTilesetInfo* getTileSet() const { return _tileSet; };\n    inline void setTileSet(TMXTilesetInfo* info) {\n        CC_SAFE_RETAIN(info);\n        CC_SAFE_RELEASE(_tileSet);\n        _tileSet = info;\n    };\n    \n    /** Layer orientation, which is the same as the map orientation */\n    inline int getLayerOrientation() const { return _layerOrientation; };\n    inline void setLayerOrientation(int orientation) { _layerOrientation = orientation; };\n    \n    /** properties from the layer. They can be added using Tiled */\n    inline const ValueMap& getProperties() const { return _properties; };\n    inline ValueMap& getProperties() { return _properties; };\n    inline void setProperties(const ValueMap& properties) {\n        _properties = properties;\n    };\n    //\n    // Override\n    //\n    /** TMXLayer doesn't support adding a Sprite manually.\n     @warning addchild(z, tag); is not supported on TMXLayer. Instead of setTileGID.\n     */\n    using SpriteBatchNode::addChild;\n    virtual void addChild(Node * child, int zOrder, int tag) override;\n    // super method\n    void removeChild(Node* child, bool cleanup) override;\n    virtual std::string getDescription() const override;\n\nprivate:\n    Point getPositionForIsoAt(const Point& pos);\n    Point getPositionForOrthoAt(const Point& pos);\n    Point getPositionForHexAt(const Point& pos);\n\n    Point calculateLayerOffset(const Point& offset);\n\n    /* optimization methods */\n    Sprite* appendTileForGID(int gid, const Point& pos);\n    Sprite* insertTileForGID(int gid, const Point& pos);\n    Sprite* updateTileForGID(int gid, const Point& pos);\n\n    /* The layer recognizes some special properties, like cc_vertez */\n    void parseInternalProperties();\n    void setupTileSprite(Sprite* sprite, Point pos, int gid);\n    Sprite* reusedTileWithRect(Rect rect);\n    int getVertexZForPos(const Point& pos);\n\n    // index\n    ssize_t atlasIndexForExistantZ(int z);\n    ssize_t atlasIndexForNewZ(int z);\n    \nprotected:\n    //! name of the layer\n    std::string _layerName;\n    //! TMX Layer supports opacity\n    unsigned char        _opacity;\n    \n    //! Only used when vertexZ is used\n    int                    _vertexZvalue;\n    bool                _useAutomaticVertexZ;\n\n    //! used for optimization\n    Sprite            *_reusedTile;\n    ccCArray            *_atlasIndexArray;\n    \n    // used for retina display\n    float               _contentScaleFactor;\n    \n    /** size of the layer in tiles */\n    Size _layerSize;\n    /** size of the map's tile (could be different from the tile's size) */\n    Size _mapTileSize;\n    /** pointer to the map of tiles */\n    int* _tiles;\n    /** Tileset information for the layer */\n    TMXTilesetInfo* _tileSet;\n    /** Layer orientation, which is the same as the map orientation */\n    int _layerOrientation;\n    /** properties from the layer. They can be added using Tiled */\n    ValueMap _properties;\n};\n\n// end of tilemap_parallax_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCTMX_LAYER_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXObjectGroup.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010      Neophit\nCopyright (c) 2010      Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCTMXObjectGroup.h\"\n#include \"ccMacros.h\"\n\nNS_CC_BEGIN\n\n//implementation TMXObjectGroup\n\nTMXObjectGroup::TMXObjectGroup()\n    : _groupName(\"\")\n    , _positionOffset(Point::ZERO)\n{\n}\n\nTMXObjectGroup::~TMXObjectGroup()\n{\n    CCLOGINFO(\"deallocing TMXObjectGroup: %p\", this);\n}\n\nValueMap TMXObjectGroup::getObject(const std::string& objectName) const\n{\n    if (!_objects.empty())\n    {\n        for (const auto& v : _objects)\n        {\n            const ValueMap& dict = v.asValueMap();\n            if (dict.find(\"name\") != dict.end())\n            {\n                if (dict.at(\"name\").asString() == objectName)\n                    return dict;\n            }\n        }\n    }\n    \n    // object not found\n    return ValueMap();\n}\n\nValue TMXObjectGroup::getProperty(const std::string& propertyName) const\n{\n    if (_properties.find(propertyName) != _properties.end())\n        return _properties.at(propertyName);\n\n    return Value();\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXObjectGroup.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      Neophit\nCopyright (c) 2010      Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCTMX_OBJECT_GROUP_H__\n#define __CCTMX_OBJECT_GROUP_H__\n\n#include \"CCGeometry.h\"\n#include \"CCString.h\"\n#include \"CCArray.h\"\n#include \"CCValue.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup tilemap_parallax_nodes\n * @{\n */\n\n/** @brief TMXObjectGroup represents the TMX object group.\n@since v0.99.0\n*/\nclass CC_DLL TMXObjectGroup : public Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    TMXObjectGroup();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TMXObjectGroup();\n\n    inline const std::string& getGroupName(){ return _groupName; }\n    inline void setGroupName(const std::string& groupName){ _groupName = groupName; }\n\n    /** return the value for the specific property name */\n    Value getProperty(const std::string& propertyName) const;\n    \n    CC_DEPRECATED_ATTRIBUTE Value propertyNamed(const std::string& propertyName) const { return getProperty(propertyName); };\n\n    /** return the dictionary for the specific object name.\n    It will return the 1st object found on the array for the given name.\n    */\n    ValueMap getObject(const std::string& objectName) const;\n    \n    CC_DEPRECATED_ATTRIBUTE ValueMap objectNamed(const std::string& objectName) const { return getObject(objectName); };\n    \n    /** Gets the offset position of child objects */\n    inline const Point& getPositionOffset() const { return _positionOffset; };\n    \n    /** Sets the offset position of child objects */\n    inline void setPositionOffset(const Point& offset) { _positionOffset = offset; };\n    \n    /** Gets the list of properties stored in a dictionary */\n    inline const ValueMap& getProperties() const { return _properties; };\n    inline ValueMap& getProperties() { return _properties; };\n    \n    /** Sets the list of properties */\n    inline void setProperties(const ValueMap& properties) {\n        _properties = properties;\n    };\n    \n    /** Gets the array of the objects */\n    inline const ValueVector& getObjects() const { return _objects; };\n    inline ValueVector& getObjects() { return _objects; };\n    \n    /** Sets the array of the objects */\n    inline void setObjects(const ValueVector& objects) {\n        _objects = objects;\n    };\n    \nprotected:\n    /** name of the group */\n    std::string _groupName;\n    /** offset position of child objects */\n    Point _positionOffset;\n    /** list of properties stored in a dictionary */\n    ValueMap _properties;\n    /** array of the objects */\n    ValueVector _objects;\n};\n\n// end of tilemap_parallax_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCTMX_OBJECT_GROUP_H__"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXTiledMap.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCTMXTiledMap.h\"\n#include \"CCTMXXMLParser.h\"\n#include \"CCTMXLayer.h\"\n#include \"CCSprite.h\"\n#include <algorithm>\n\nNS_CC_BEGIN\n\n// implementation TMXTiledMap\n\nTMXTiledMap * TMXTiledMap::create(const std::string& tmxFile)\n{\n    TMXTiledMap *ret = new TMXTiledMap();\n    if (ret->initWithTMXFile(tmxFile))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nTMXTiledMap* TMXTiledMap::createWithXML(const std::string& tmxString, const std::string& resourcePath)\n{\n    TMXTiledMap *ret = new TMXTiledMap();\n    if (ret->initWithXML(tmxString, resourcePath))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool TMXTiledMap::initWithTMXFile(const std::string& tmxFile)\n{\n    CCASSERT(tmxFile.size()>0, \"TMXTiledMap: tmx file should not be empty\");\n    \n    setContentSize(Size::ZERO);\n\n    TMXMapInfo *mapInfo = TMXMapInfo::create(tmxFile);\n\n    if (! mapInfo)\n    {\n        return false;\n    }\n    CCASSERT( !mapInfo->getTilesets().empty(), \"TMXTiledMap: Map not found. Please check the filename.\");\n    buildWithMapInfo(mapInfo);\n\n    return true;\n}\n\nbool TMXTiledMap::initWithXML(const std::string& tmxString, const std::string& resourcePath)\n{\n    setContentSize(Size::ZERO);\n\n    TMXMapInfo *mapInfo = TMXMapInfo::createWithXML(tmxString, resourcePath);\n\n    CCASSERT( !mapInfo->getTilesets().empty(), \"TMXTiledMap: Map not found. Please check the filename.\");\n    buildWithMapInfo(mapInfo);\n\n    return true;\n}\n\nTMXTiledMap::TMXTiledMap()\n    :_mapSize(Size::ZERO)\n    ,_tileSize(Size::ZERO)        \n{\n}\n\nTMXTiledMap::~TMXTiledMap()\n{\n}\n\n// private\nTMXLayer * TMXTiledMap::parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)\n{\n    TMXTilesetInfo *tileset = tilesetForLayer(layerInfo, mapInfo);\n    TMXLayer *layer = TMXLayer::create(tileset, layerInfo, mapInfo);\n\n    // tell the layerinfo to release the ownership of the tiles map.\n    layerInfo->_ownTiles = false;\n    layer->setupTiles();\n\n    return layer;\n}\n\nTMXTilesetInfo * TMXTiledMap::tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo)\n{\n    Size size = layerInfo->_layerSize;\n    auto& tilesets = mapInfo->getTilesets();\n    if (tilesets.size()>0)\n    {\n        TMXTilesetInfo* tileset = nullptr;\n        for (auto iter = tilesets.crbegin(); iter != tilesets.crend(); ++iter)\n        {\n            tileset = *iter;\n            if (tileset)\n            {\n                for( int y=0; y < size.height; y++ )\n                {\n                    for( int x=0; x < size.width; x++ )\n                    {\n                        int pos = static_cast<int>(x + size.width * y);\n                        int gid = layerInfo->_tiles[ pos ];\n\n                        // gid are stored in little endian.\n                        // if host is big endian, then swap\n                        //if( o == CFByteOrderBigEndian )\n                        //    gid = CFSwapInt32( gid );\n                        /* We support little endian.*/\n\n                        // XXX: gid == 0 --> empty tile\n                        if( gid != 0 ) \n                        {\n                            // Optimization: quick return\n                            // if the layer is invalid (more than 1 tileset per layer) an CCAssert will be thrown later\n                            if( (gid & kFlippedMask) >= tileset->_firstGid )\n                                return tileset;\n                        }\n                    }\n                }        \n            }\n        }\n    }\n\n    // If all the tiles are 0, return empty tileset\n    CCLOG(\"cocos2d: Warning: TMX Layer '%s' has no tiles\", layerInfo->_name.c_str());\n    return nullptr;\n}\n\nvoid TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo)\n{\n    _mapSize = mapInfo->getMapSize();\n    _tileSize = mapInfo->getTileSize();\n    _mapOrientation = mapInfo->getOrientation();\n\n    _objectGroups = mapInfo->getObjectGroups();\n\n    _properties = mapInfo->getProperties();\n\n    _tileProperties = mapInfo->getTileProperties();\n\n    int idx=0;\n\n    auto& layers = mapInfo->getLayers();\n    for(const auto &layerInfo : layers) {\n        if (layerInfo->_visible)\n        {\n            TMXLayer *child = parseLayer(layerInfo, mapInfo);\n            addChild(child, idx, idx);\n            \n            // update content size with the max size\n            const Size& childSize = child->getContentSize();\n            Size currentSize = this->getContentSize();\n            currentSize.width = std::max( currentSize.width, childSize.width );\n            currentSize.height = std::max( currentSize.height, childSize.height );\n            this->setContentSize(currentSize);\n            \n            idx++;\n        }\n    }\n}\n\n// public\nTMXLayer * TMXTiledMap::getLayer(const std::string& layerName) const\n{\n    CCASSERT(layerName.size() > 0, \"Invalid layer name!\");\n    \n    for (auto& child : _children)\n    {\n        TMXLayer* layer = dynamic_cast<TMXLayer*>(child);\n        if(layer)\n        {\n            if(layerName.compare( layer->getLayerName()) == 0)\n            {\n                return layer;\n            }\n        }\n    }\n\n    // layer not found\n    return nullptr;\n}\n\nTMXObjectGroup * TMXTiledMap::getObjectGroup(const std::string& groupName) const\n{\n    CCASSERT(groupName.size() > 0, \"Invalid group name!\");\n\n    if (_objectGroups.size()>0)\n    {\n        TMXObjectGroup* objectGroup = nullptr;\n        for (auto iter = _objectGroups.cbegin(); iter != _objectGroups.cend(); ++iter)\n        {\n            objectGroup = *iter;\n            if (objectGroup && objectGroup->getGroupName() == groupName)\n            {\n                return objectGroup;\n            }\n        }\n    }\n\n    // objectGroup not found\n    return nullptr;\n}\n\nValue TMXTiledMap::getProperty(const std::string& propertyName) const\n{\n    if (_properties.find(propertyName) != _properties.end())\n        return _properties.at(propertyName);\n    \n    return Value();\n}\n\nValue TMXTiledMap::getPropertiesForGID(int GID) const\n{\n    if (_tileProperties.find(GID) != _tileProperties.end())\n        return _tileProperties.at(GID);\n    \n    return Value();\n}\n\nstd::string TMXTiledMap::getDescription() const\n{\n    return StringUtils::format(\"<TMXTiledMap | Tag = %d, Layers = %d\", _tag, static_cast<int>(_children.size()));\n}\n\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXTiledMap.h",
    "content": "/****************************************************************************\nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCTMX_TILE_MAP_H__\n#define __CCTMX_TILE_MAP_H__\n\n#include \"CCNode.h\"\n#include \"CCTMXObjectGroup.h\"\n#include \"CCValue.h\"\n\nNS_CC_BEGIN\n\nclass TMXObjectGroup;\nclass TMXLayer;\nclass TMXLayerInfo;\nclass TMXTilesetInfo;\nclass TMXMapInfo;\n\n/**\n * @addtogroup tilemap_parallax_nodes\n * @{\n */\n\n/** Possible orientations of the TMX map */\nenum\n{\n    /** Orthogonal orientation */\n    TMXOrientationOrtho,\n\n    /** Hexagonal orientation */\n    TMXOrientationHex,\n\n    /** Isometric orientation */\n    TMXOrientationIso,\n};\n\n/** @brief TMXTiledMap knows how to parse and render a TMX map.\n\nIt adds support for the TMX tiled map format used by http://www.mapeditor.org\nIt supports isometric, hexagonal and orthogonal tiles.\nIt also supports object groups, objects, and properties.\n\nFeatures:\n- Each tile will be treated as an Sprite\n- The sprites are created on demand. They will be created only when you call \"layer->tileAt(position)\"\n- Each tile can be rotated / moved / scaled / tinted / \"opaqued\", since each tile is a Sprite\n- Tiles can be added/removed in runtime\n- The z-order of the tiles can be modified in runtime\n- Each tile has an anchorPoint of (0,0)\n- The anchorPoint of the TMXTileMap is (0,0)\n- The TMX layers will be added as a child\n- The TMX layers will be aliased by default\n- The tileset image will be loaded using the TextureCache\n- Each tile will have a unique tag\n- Each tile will have a unique z value. top-left: z=1, bottom-right: z=max z\n- Each object group will be treated as an MutableArray\n- Object class which will contain all the properties in a dictionary\n- Properties can be assigned to the Map, Layer, Object Group, and Object\n\nLimitations:\n- It only supports one tileset per layer.\n- Embedded images are not supported\n- It only supports the XML format (the JSON format is not supported)\n\nTechnical description:\nEach layer is created using an TMXLayer (subclass of SpriteBatchNode). If you have 5 layers, then 5 TMXLayer will be created,\nunless the layer visibility is off. In that case, the layer won't be created at all.\nYou can obtain the layers (TMXLayer objects) at runtime by:\n- map->getChildByTag(tag_number);  // 0=1st layer, 1=2nd layer, 2=3rd layer, etc...\n- map->getLayer(name_of_the_layer);\n\nEach object group is created using a TMXObjectGroup which is a subclass of MutableArray.\nYou can obtain the object groups at runtime by:\n- map->getObjectGroup(name_of_the_object_group);\n\nEach object is a TMXObject.\n\nEach property is stored as a key-value pair in an MutableDictionary.\nYou can obtain the properties at runtime by:\n\nmap->getProperty(name_of_the_property);\nlayer->getProperty(name_of_the_property);\nobjectGroup->getProperty(name_of_the_property);\nobject->getProperty(name_of_the_property);\n\n@since v0.8.1\n*/\nclass CC_DLL TMXTiledMap : public Node\n{\npublic:\n    /** creates a TMX Tiled Map with a TMX file.*/\n    static TMXTiledMap* create(const std::string& tmxFile);\n\n    /** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */\n    static TMXTiledMap* createWithXML(const std::string& tmxString, const std::string& resourcePath);\n\n    /** return the TMXLayer for the specific layer */\n    TMXLayer* getLayer(const std::string& layerName) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE TMXLayer* layerNamed(const std::string& layerName) const { return getLayer(layerName); };\n\n    /** return the TMXObjectGroup for the specific group */\n    TMXObjectGroup* getObjectGroup(const std::string& groupName) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE TMXObjectGroup* objectGroupNamed(const std::string& groupName) const { return getObjectGroup(groupName); };\n\n    /** return the value for the specific property name */\n    Value getProperty(const std::string& propertyName) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Value propertyNamed(const char *propertyName) const { return getProperty(propertyName); };\n\n    /** return properties dictionary for tile GID */\n    Value getPropertiesForGID(int GID) const;\n    CC_DEPRECATED_ATTRIBUTE Value propertiesForGID(int GID) const { return getPropertiesForGID(GID); };\n\n    /** the map's size property measured in tiles */\n    inline const Size& getMapSize() const { return _mapSize; };\n    inline void setMapSize(const Size& mapSize) { _mapSize = mapSize; };\n\n    /** the tiles's size property measured in pixels */\n    inline const Size& getTileSize() const { return _tileSize; };\n    inline void setTileSize(const Size& tileSize) { _tileSize = tileSize; };\n\n    /** map orientation */\n    inline int getMapOrientation() const { return _mapOrientation; };\n    inline void setMapOrientation(int mapOrientation) { _mapOrientation = mapOrientation; };\n\n    /** object groups */\n    inline const Vector<TMXObjectGroup*>& getObjectGroups() const { return _objectGroups; };\n    inline Vector<TMXObjectGroup*>& getObjectGroups() { return _objectGroups; };\n    inline void setObjectGroups(const Vector<TMXObjectGroup*>& groups) {\n        _objectGroups = groups;\n    };\n    \n    /** properties */\n    inline ValueMap& getProperties() { return _properties; };\n    inline void setProperties(const ValueMap& properties) {\n        _properties = properties;\n    };\n\n    virtual std::string getDescription() const override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    TMXTiledMap();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TMXTiledMap();\n\n    /** initializes a TMX Tiled Map with a TMX file */\n    bool initWithTMXFile(const std::string& tmxFile);\n\n    /** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */\n    bool initWithXML(const std::string& tmxString, const std::string& resourcePath);\n    \n    TMXLayer * parseLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);\n    TMXTilesetInfo * tilesetForLayer(TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);\n    void buildWithMapInfo(TMXMapInfo* mapInfo);\n\n    /** the map's size property measured in tiles */\n    Size _mapSize;\n    /** the tiles's size property measured in pixels */\n    Size _tileSize;\n    /** map orientation */\n    int _mapOrientation;\n    /** object groups */\n    Vector<TMXObjectGroup*> _objectGroups;\n    /** properties */\n    ValueMap _properties;\n    \n    //! tile properties\n    ValueMapIntKey _tileProperties;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TMXTiledMap);\n\n};\n\n// end of tilemap_parallax_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCTMX_TILE_MAP_H__\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXXMLParser.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Максим Аксенов \nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include <unordered_map>\n#include <sstream>\n#include \"CCTMXXMLParser.h\"\n#include \"CCTMXTiledMap.h\"\n#include \"ccMacros.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"ZipUtils.h\"\n#include \"base64.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n// implementation TMXLayerInfo\nTMXLayerInfo::TMXLayerInfo()\n: _name(\"\")\n, _tiles(nullptr)\n, _ownTiles(true)\n, _offset(Point::ZERO)\n{\n}\n\nTMXLayerInfo::~TMXLayerInfo()\n{\n    CCLOGINFO(\"deallocing TMXLayerInfo: %p\", this);\n    if( _ownTiles && _tiles )\n    {\n        free(_tiles);\n        _tiles = nullptr;\n    }\n}\n\nValueMap& TMXLayerInfo::getProperties()\n{\n    return _properties;\n}\nvoid TMXLayerInfo::setProperties(ValueMap var)\n{\n    _properties = var;\n}\n\n// implementation TMXTilesetInfo\nTMXTilesetInfo::TMXTilesetInfo()\n    :_firstGid(0)\n    ,_tileSize(Size::ZERO)\n    ,_spacing(0)\n    ,_margin(0)\n    ,_imageSize(Size::ZERO)\n{\n}\n\nTMXTilesetInfo::~TMXTilesetInfo()\n{\n    CCLOGINFO(\"deallocing TMXTilesetInfo: %p\", this);\n}\n\nRect TMXTilesetInfo::rectForGID(int gid)\n{\n    Rect rect;\n    rect.size = _tileSize;\n    gid &= kFlippedMask;\n    gid = gid - _firstGid;\n    int max_x = (int)((_imageSize.width - _margin*2 + _spacing) / (_tileSize.width + _spacing));\n    //    int max_y = (imageSize.height - margin*2 + spacing) / (tileSize.height + spacing);\n    rect.origin.x = (gid % max_x) * (_tileSize.width + _spacing) + _margin;\n    rect.origin.y = (gid / max_x) * (_tileSize.height + _spacing) + _margin;\n    return rect;\n}\n\n// implementation TMXMapInfo\n\nTMXMapInfo * TMXMapInfo::create(const std::string& tmxFile)\n{\n    TMXMapInfo *ret = new TMXMapInfo();\n    if(ret->initWithTMXFile(tmxFile))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nTMXMapInfo * TMXMapInfo::createWithXML(const std::string& tmxString, const std::string& resourcePath)\n{\n    TMXMapInfo *ret = new TMXMapInfo();\n    if(ret->initWithXML(tmxString, resourcePath))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nvoid TMXMapInfo::internalInit(const std::string& tmxFileName, const std::string& resourcePath)\n{\n    if (tmxFileName.size() > 0)\n    {\n        _TMXFileName = FileUtils::getInstance()->fullPathForFilename(tmxFileName);\n    }\n    \n    if (resourcePath.size() > 0)\n    {\n        _resources = resourcePath;\n    }\n    \n    _objectGroups.reserve(4);\n\n    // tmp vars\n    _currentString = \"\";\n    _storingCharacters = false;\n    _layerAttribs = TMXLayerAttribNone;\n    _parentElement = TMXPropertyNone;\n    _currentFirstGID = -1;\n}\nbool TMXMapInfo::initWithXML(const std::string& tmxString, const std::string& resourcePath)\n{\n    internalInit(\"\", resourcePath);\n    return parseXMLString(tmxString);\n}\n\nbool TMXMapInfo::initWithTMXFile(const std::string& tmxFile)\n{\n    internalInit(tmxFile, \"\");\n    return parseXMLFile(_TMXFileName.c_str());\n}\n\nTMXMapInfo::TMXMapInfo()\n: _mapSize(Size::ZERO)    \n, _tileSize(Size::ZERO)\n, _layerAttribs(0)\n, _storingCharacters(false)\n, _currentFirstGID(-1)\n, _recordFirstGID(true)\n{\n}\n\nTMXMapInfo::~TMXMapInfo()\n{\n    CCLOGINFO(\"deallocing TMXMapInfo: %p\", this);\n}\n\nbool TMXMapInfo::parseXMLString(const std::string& xmlString)\n{\n    size_t len = xmlString.size();\n    if (len <= 0)\n        return false;\n\n    SAXParser parser;\n\n    if (false == parser.init(\"UTF-8\") )\n    {\n        return false;\n    }\n\n    parser.setDelegator(this);\n\n    return parser.parse(xmlString.c_str(), len);\n}\n\nbool TMXMapInfo::parseXMLFile(const std::string& xmlFilename)\n{\n    SAXParser parser;\n    \n    if (false == parser.init(\"UTF-8\") )\n    {\n        return false;\n    }\n    \n    parser.setDelegator(this);\n\n    return parser.parse(FileUtils::getInstance()->fullPathForFilename(xmlFilename).c_str());\n}\n\n\n// the XML parser calls here with all the elements\nvoid TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)\n{    \n    CC_UNUSED_PARAM(ctx);\n    TMXMapInfo *tmxMapInfo = this;\n    std::string elementName = (char*)name;\n    ValueMap attributeDict;\n    if (atts && atts[0])\n    {\n        for(int i = 0; atts[i]; i += 2) \n        {\n            std::string key = (char*)atts[i];\n            std::string value = (char*)atts[i+1];\n            attributeDict.insert(std::make_pair(key, Value(value)));\n        }\n    }\n    if (elementName == \"map\")\n    {\n        std::string version = attributeDict[\"version\"].asString();\n        if ( version != \"1.0\")\n        {\n            CCLOG(\"cocos2d: TMXFormat: Unsupported TMX version: %s\", version.c_str());\n        }\n        std::string orientationStr = attributeDict[\"orientation\"].asString();\n        if (orientationStr == \"orthogonal\")\n            tmxMapInfo->setOrientation(TMXOrientationOrtho);\n        else if (orientationStr  == \"isometric\")\n            tmxMapInfo->setOrientation(TMXOrientationIso);\n        else if(orientationStr == \"hexagonal\")\n            tmxMapInfo->setOrientation(TMXOrientationHex);\n        else\n            CCLOG(\"cocos2d: TMXFomat: Unsupported orientation: %d\", tmxMapInfo->getOrientation());\n\n        Size s;\n        s.width = attributeDict[\"width\"].asFloat();\n        s.height = attributeDict[\"height\"].asFloat();\n        tmxMapInfo->setMapSize(s);\n\n        s.width = attributeDict[\"tilewidth\"].asFloat();\n        s.height = attributeDict[\"tileheight\"].asFloat();\n        tmxMapInfo->setTileSize(s);\n\n        // The parent element is now \"map\"\n        tmxMapInfo->setParentElement(TMXPropertyMap);\n    } \n    else if (elementName == \"tileset\") \n    {\n        // If this is an external tileset then start parsing that\n        std::string externalTilesetFilename = attributeDict[\"source\"].asString();\n        if (externalTilesetFilename != \"\")\n        {\n            // Tileset file will be relative to the map file. So we need to convert it to an absolute path\n            if (_TMXFileName.find_last_of(\"/\") != string::npos)\n            {\n                string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of(\"/\") + 1);\n                externalTilesetFilename = dir + externalTilesetFilename;\n            }\n            else \n            {\n                externalTilesetFilename = _resources + \"/\" + externalTilesetFilename;\n            }\n            externalTilesetFilename = FileUtils::getInstance()->fullPathForFilename(externalTilesetFilename.c_str());\n            \n            _currentFirstGID = attributeDict[\"firstgid\"].asInt();\n            if (_currentFirstGID < 0)\n            {\n                _currentFirstGID = 0;\n            }\n            _recordFirstGID = false;\n            \n            tmxMapInfo->parseXMLFile(externalTilesetFilename.c_str());\n        }\n        else\n        {\n            TMXTilesetInfo *tileset = new TMXTilesetInfo();\n            tileset->_name = attributeDict[\"name\"].asString();\n            \n            if (_recordFirstGID)\n            {\n                // unset before, so this is tmx file.\n                tileset->_firstGid = attributeDict[\"firstgid\"].asInt();\n                \n                if (tileset->_firstGid < 0)\n                {\n                    tileset->_firstGid = 0;\n                }\n            }\n            else\n            {\n                tileset->_firstGid = _currentFirstGID;\n                _currentFirstGID = 0;\n            }\n            \n            tileset->_spacing = attributeDict[\"spacing\"].asInt();\n            tileset->_margin = attributeDict[\"margin\"].asInt();\n            Size s;\n            s.width = attributeDict[\"tilewidth\"].asFloat();\n            s.height = attributeDict[\"tileheight\"].asFloat();\n            tileset->_tileSize = s;\n\n            tmxMapInfo->getTilesets().pushBack(tileset);\n            tileset->release();\n        }\n    }\n    else if (elementName == \"tile\")\n    {\n        if (tmxMapInfo->getParentElement() == TMXPropertyLayer)\n        {\n            TMXLayerInfo* layer = tmxMapInfo->getLayers().back();\n            Size layerSize = layer->_layerSize;\n            int gid = attributeDict[\"gid\"].asInt();\n            int tilesAmount = layerSize.width*layerSize.height;\n            \n            do\n            {\n                if (tilesAmount > 1)\n                {\n                    // Check the value is all set or not\n                    CC_BREAK_IF(layer->_tiles[tilesAmount - 2] != -1 && layer->_tiles[tilesAmount - 1] != -1);\n                    \n                    int currentTileIndex = tilesAmount - layer->_tiles[tilesAmount - 1] - 2;\n                    layer->_tiles[currentTileIndex] = gid;\n                    \n                    if (currentTileIndex != tilesAmount - 1)\n                    {\n                        --layer->_tiles[tilesAmount - 1];\n                    }\n                }\n                else if(tilesAmount == 1)\n                {\n                    if (layer->_tiles[0] == -1)\n                    {\n                        layer->_tiles[0] = gid;\n                    }\n                }\n            } while (0);\n        }\n        else\n        {\n            TMXTilesetInfo* info = tmxMapInfo->getTilesets().back();\n            tmxMapInfo->setParentGID(info->_firstGid + attributeDict[\"id\"].asInt());\n            tmxMapInfo->getTileProperties()[tmxMapInfo->getParentGID()] = Value(ValueMap());\n            tmxMapInfo->setParentElement(TMXPropertyTile);\n        }\n    }\n    else if (elementName == \"layer\")\n    {\n        TMXLayerInfo *layer = new TMXLayerInfo();\n        layer->_name = attributeDict[\"name\"].asString();\n\n        Size s;\n        s.width = attributeDict[\"width\"].asFloat();\n        s.height = attributeDict[\"height\"].asFloat();\n        layer->_layerSize = s;\n\n        layer->_visible = attributeDict[\"visible\"].asBool();\n\n        Value& opacityValue = attributeDict[\"opacity\"];\n\n        if( !opacityValue.isNull() )\n        {\n            layer->_opacity = (unsigned char)(255.0f * opacityValue.asFloat());\n        }\n        else\n        {\n            layer->_opacity = 255;\n        }\n\n        float x = attributeDict[\"x\"].asFloat();\n        float y = attributeDict[\"y\"].asFloat();\n        layer->_offset = Point(x,y);\n\n        tmxMapInfo->getLayers().pushBack(layer);\n        layer->release();\n\n        // The parent element is now \"layer\"\n        tmxMapInfo->setParentElement(TMXPropertyLayer);\n\n    } \n    else if (elementName == \"objectgroup\")\n    {\n        TMXObjectGroup *objectGroup = new TMXObjectGroup();\n        objectGroup->setGroupName(attributeDict[\"name\"].asString());\n        Point positionOffset;\n        positionOffset.x = attributeDict[\"x\"].asFloat() * tmxMapInfo->getTileSize().width;\n        positionOffset.y = attributeDict[\"y\"].asFloat() * tmxMapInfo->getTileSize().height;\n        objectGroup->setPositionOffset(positionOffset);\n\n        tmxMapInfo->getObjectGroups().pushBack(objectGroup);\n        objectGroup->release();\n\n        // The parent element is now \"objectgroup\"\n        tmxMapInfo->setParentElement(TMXPropertyObjectGroup);\n\n    }\n    else if (elementName == \"image\")\n    {\n        TMXTilesetInfo* tileset = tmxMapInfo->getTilesets().back();\n\n        // build full path\n        std::string imagename = attributeDict[\"source\"].asString();\n\n        if (_TMXFileName.find_last_of(\"/\") != string::npos)\n        {\n            string dir = _TMXFileName.substr(0, _TMXFileName.find_last_of(\"/\") + 1);\n            tileset->_sourceImage = dir + imagename;\n        }\n        else \n        {\n            tileset->_sourceImage = _resources + (_resources.size() ? \"/\" : \"\") + imagename;\n        }\n    } \n    else if (elementName == \"data\")\n    {\n        std::string encoding = attributeDict[\"encoding\"].asString();\n        std::string compression = attributeDict[\"compression\"].asString();\n\n        if (encoding == \"\")\n        {\n            tmxMapInfo->setLayerAttribs(tmxMapInfo->getLayerAttribs() | TMXLayerAttribNone);\n            \n            TMXLayerInfo* layer = tmxMapInfo->getLayers().back();\n            Size layerSize = layer->_layerSize;\n            int tilesAmount = layerSize.width*layerSize.height;\n\n            int *tiles = (int *) malloc(tilesAmount*sizeof(int));\n            // set all value to -1\n            memset(tiles, 0xFF, tilesAmount*sizeof(int));\n            \n            /* Save the special index in tiles[tilesAmount - 1];\n             * When we load tiles, we can do this:\n             * tiles[tilesAmount - tiles[tilesAmount - 1] - 1] = tileNum;\n             * --tiles[tilesAmount - 1];\n             * We do this because we can easily contorl how much tiles we loaded without add a \"curTilesAmount\" into class member.\n             */\n            if (tilesAmount > 1)\n            {\n                tiles[tilesAmount - 1] = tilesAmount - 2;\n            }\n\n            layer->_tiles = tiles;\n        }\n        else if (encoding == \"base64\")\n        {\n            int layerAttribs = tmxMapInfo->getLayerAttribs();\n            tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribBase64);\n            tmxMapInfo->setStoringCharacters(true);\n\n            if( compression == \"gzip\" )\n            {\n                layerAttribs = tmxMapInfo->getLayerAttribs();\n                tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribGzip);\n            } else\n            if (compression == \"zlib\")\n            {\n                layerAttribs = tmxMapInfo->getLayerAttribs();\n                tmxMapInfo->setLayerAttribs(layerAttribs | TMXLayerAttribZlib);\n            }\n            CCASSERT( compression == \"\" || compression == \"gzip\" || compression == \"zlib\", \"TMX: unsupported compression method\" );\n        }\n\n    } \n    else if (elementName == \"object\")\n    {\n        TMXObjectGroup* objectGroup = tmxMapInfo->getObjectGroups().back();\n\n        // The value for \"type\" was blank or not a valid class name\n        // Create an instance of TMXObjectInfo to store the object and its properties\n        ValueMap dict;\n        // Parse everything automatically\n        const char* array[] = {\"name\", \"type\", \"width\", \"height\", \"gid\"};\n        \n        for(size_t i = 0; i < sizeof(array)/sizeof(array[0]); ++i )\n        {\n            const char* key = array[i];\n            Value value = attributeDict[key];\n            dict[key] = value;\n        }\n\n        // But X and Y since they need special treatment\n        // X\n\n        int x = attributeDict[\"x\"].asInt() + (int)objectGroup->getPositionOffset().x;\n        dict[\"x\"] = Value(x);\n\n        // Y\n        int y = attributeDict[\"y\"].asInt() + (int)objectGroup->getPositionOffset().y;\n\n        // Correct y position. (Tiled uses Flipped, cocos2d uses Standard)\n        y = (int)(_mapSize.height * _tileSize.height) - y - attributeDict[\"height\"].asInt();\n        dict[\"y\"] = Value(y);\n\n        // Add the object to the objectGroup\n        objectGroup->getObjects().push_back(Value(dict));\n\n         // The parent element is now \"object\"\n         tmxMapInfo->setParentElement(TMXPropertyObject);\n\n    } \n    else if (elementName == \"property\")\n    {\n        if ( tmxMapInfo->getParentElement() == TMXPropertyNone ) \n        {\n            CCLOG( \"TMX tile map: Parent element is unsupported. Cannot add property named '%s' with value '%s'\",\n                  attributeDict[\"name\"].asString().c_str(), attributeDict[\"value\"].asString().c_str() );\n        } \n        else if ( tmxMapInfo->getParentElement() == TMXPropertyMap )\n        {\n            // The parent element is the map\n            Value value = attributeDict[\"value\"];\n            std::string key = attributeDict[\"name\"].asString();\n            tmxMapInfo->getProperties().insert(std::make_pair(key, value));\n        }\n        else if ( tmxMapInfo->getParentElement() == TMXPropertyLayer )\n        {\n            // The parent element is the last layer\n            TMXLayerInfo* layer = tmxMapInfo->getLayers().back();\n            Value value = attributeDict[\"value\"];\n            std::string key = attributeDict[\"name\"].asString();\n            // Add the property to the layer\n            layer->getProperties().insert(std::make_pair(key, value));\n        }\n        else if ( tmxMapInfo->getParentElement() == TMXPropertyObjectGroup ) \n        {\n            // The parent element is the last object group\n            TMXObjectGroup* objectGroup = tmxMapInfo->getObjectGroups().back();\n            Value value = attributeDict[\"value\"];\n            std::string key = attributeDict[\"name\"].asString();\n            objectGroup->getProperties().insert(std::make_pair(key, value));\n        }\n        else if ( tmxMapInfo->getParentElement() == TMXPropertyObject )\n        {\n            // The parent element is the last object\n            TMXObjectGroup* objectGroup = tmxMapInfo->getObjectGroups().back();\n            ValueMap& dict = objectGroup->getObjects().rbegin()->asValueMap();\n\n            std::string propertyName = attributeDict[\"name\"].asString();\n            dict[propertyName] = attributeDict[\"value\"];\n        }\n        else if ( tmxMapInfo->getParentElement() == TMXPropertyTile ) \n        {\n            ValueMap& dict = tmxMapInfo->getTileProperties().at(tmxMapInfo->getParentGID()).asValueMap();\n\n            std::string propertyName = attributeDict[\"name\"].asString();\n            dict[propertyName] = attributeDict[\"value\"];\n        }\n    }\n    else if (elementName == \"polygon\") \n    {\n        // find parent object's dict and add polygon-points to it\n        TMXObjectGroup* objectGroup = _objectGroups.back();\n        ValueMap& dict = objectGroup->getObjects().rbegin()->asValueMap();\n\n        // get points value string\n        std::string value = attributeDict[\"points\"].asString();\n        if (!value.empty())\n        {\n            ValueVector pointsArray;\n            pointsArray.reserve(10);\n\n            // parse points string into a space-separated set of points\n            stringstream pointsStream(value);\n            string pointPair;\n            while(std::getline(pointsStream, pointPair, ' '))\n            {\n                // parse each point combo into a comma-separated x,y point\n                stringstream pointStream(pointPair);\n                string xStr,yStr;\n                \n                ValueMap pointDict;\n\n                // set x\n                if(std::getline(pointStream, xStr, ','))\n                {\n                    int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x;\n                    pointDict[\"x\"] = Value(x);\n                }\n\n                // set y\n                if(std::getline(pointStream, yStr, ','))\n                {\n                    int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y;\n                    pointDict[\"y\"] = Value(y);\n                }\n                \n                // add to points array\n                pointsArray.push_back(Value(pointDict));\n            }\n            \n            dict[\"points\"] = Value(pointsArray);\n        }\n    } \n    else if (elementName == \"polyline\")\n    {\n        // find parent object's dict and add polyline-points to it\n        TMXObjectGroup* objectGroup = _objectGroups.back();\n        ValueMap& dict = objectGroup->getObjects().rbegin()->asValueMap();\n        \n        // get points value string\n        std::string value = attributeDict[\"points\"].asString();\n        if (!value.empty())\n        {\n            ValueVector pointsArray;\n            pointsArray.reserve(10);\n            \n            // parse points string into a space-separated set of points\n            stringstream pointsStream(value);\n            string pointPair;\n            while(std::getline(pointsStream, pointPair, ' '))\n            {\n                // parse each point combo into a comma-separated x,y point\n                stringstream pointStream(pointPair);\n                string xStr,yStr;\n                \n                ValueMap pointDict;\n                \n                // set x\n                if(std::getline(pointStream, xStr, ','))\n                {\n                    int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x;\n                    pointDict[\"x\"] = Value(x);\n                }\n                \n                // set y\n                if(std::getline(pointStream, yStr, ','))\n                {\n                    int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y;\n                    pointDict[\"y\"] = Value(y);\n                }\n                \n                // add to points array\n                pointsArray.push_back(Value(pointDict));\n            }\n            \n            dict[\"polylinePoints\"] = Value(pointsArray);\n        }\n    }\n}\n\nvoid TMXMapInfo::endElement(void *ctx, const char *name)\n{\n    CC_UNUSED_PARAM(ctx);\n    TMXMapInfo *tmxMapInfo = this;\n    std::string elementName = (char*)name;\n\n    int len = 0;\n\n    if(elementName == \"data\")\n    {\n        if (tmxMapInfo->getLayerAttribs() & TMXLayerAttribBase64)\n        {\n            tmxMapInfo->setStoringCharacters(false);\n            \n            TMXLayerInfo* layer = tmxMapInfo->getLayers().back();\n            \n            std::string currentString = tmxMapInfo->getCurrentString();\n            unsigned char *buffer;\n            len = base64Decode((unsigned char*)currentString.c_str(), (unsigned int)currentString.length(), &buffer);\n            if( ! buffer )\n            {\n                CCLOG(\"cocos2d: TiledMap: decode data error\");\n                return;\n            }\n            \n            if( tmxMapInfo->getLayerAttribs() & (TMXLayerAttribGzip | TMXLayerAttribZlib) )\n            {\n                unsigned char *deflated = nullptr;\n                Size s = layer->_layerSize;\n                // int sizeHint = s.width * s.height * sizeof(uint32_t);\n                ssize_t sizeHint = s.width * s.height * sizeof(unsigned int);\n                \n                ssize_t CC_UNUSED inflatedLen = ZipUtils::inflateMemoryWithHint(buffer, len, &deflated, sizeHint);\n                CCASSERT(inflatedLen == sizeHint, \"\");\n                \n                free(buffer);\n                buffer = nullptr;\n                \n                if( ! deflated )\n                {\n                    CCLOG(\"cocos2d: TiledMap: inflate data error\");\n                    return;\n                }\n                \n                layer->_tiles = reinterpret_cast<int*>(deflated);\n            }\n            else\n            {\n                layer->_tiles = reinterpret_cast<int*>(buffer);\n            }\n            \n            tmxMapInfo->setCurrentString(\"\");\n        }\n        else if (tmxMapInfo->getLayerAttribs() & TMXLayerAttribNone)\n        {\n            TMXLayerInfo* layer = tmxMapInfo->getLayers().back();\n            Size layerSize = layer->_layerSize;\n            int tilesAmount = layerSize.width * layerSize.height;\n            \n            //set all the tiles unseted to 0\n            if (tilesAmount > 1 && layer->_tiles[tilesAmount - 2] == -1)\n            {\n                for (int i = tilesAmount - layer->_tiles[tilesAmount - 1] - 2; i < tilesAmount; ++i)\n                {\n                    layer->_tiles[i] = 0;\n                }\n            }\n            else if (layer->_tiles[tilesAmount - 1] == -1)\n            {\n                layer->_tiles[tilesAmount - 1] = 0;\n            }\n                \n        }\n\n    }\n    else if (elementName == \"map\")\n    {\n        // The map element has ended\n        tmxMapInfo->setParentElement(TMXPropertyNone);\n    }    \n    else if (elementName == \"layer\")\n    {\n        // The layer element has ended\n        tmxMapInfo->setParentElement(TMXPropertyNone);\n    }\n    else if (elementName == \"objectgroup\")\n    {\n        // The objectgroup element has ended\n        tmxMapInfo->setParentElement(TMXPropertyNone);\n    } \n    else if (elementName == \"object\") \n    {\n        // The object element has ended\n        tmxMapInfo->setParentElement(TMXPropertyNone);\n    }\n    else if (elementName == \"tileset\")\n    {\n        _recordFirstGID = true;\n    }\n}\n\nvoid TMXMapInfo::textHandler(void *ctx, const char *ch, int len)\n{\n    CC_UNUSED_PARAM(ctx);\n    TMXMapInfo *tmxMapInfo = this;\n    std::string text((char*)ch,0,len);\n\n    if (tmxMapInfo->isStoringCharacters())\n    {\n        std::string currentString = tmxMapInfo->getCurrentString();\n        currentString += text;\n        tmxMapInfo->setCurrentString(currentString.c_str());\n    }\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTMXXMLParser.h",
    "content": "/****************************************************************************\nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#ifndef __CC_TM_XML_PARSER__\n#define __CC_TM_XML_PARSER__\n\n#include \"CCArray.h\"\n#include \"CCGeometry.h\"\n#include \"platform/CCSAXParser.h\"\n#include \"CCVector.h\"\n#include \"CCValue.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass TMXLayerInfo;\nclass TMXObjectGroup;\nclass TMXTilesetInfo;\n\n/** @file\n* Internal TMX parser\n*\n* IMPORTANT: These classed should not be documented using doxygen strings\n* since the user should not use them.\n*\n*/\n\n/**\n * @addtogroup tilemap_parallax_nodes\n * @{\n */\n\nenum {\n    TMXLayerAttribNone = 1 << 0,\n    TMXLayerAttribBase64 = 1 << 1,\n    TMXLayerAttribGzip = 1 << 2,\n    TMXLayerAttribZlib = 1 << 3,\n};\n\nenum {\n    TMXPropertyNone,\n    TMXPropertyMap,\n    TMXPropertyLayer,\n    TMXPropertyObjectGroup,\n    TMXPropertyObject,\n    TMXPropertyTile\n};\n\ntypedef enum ccTMXTileFlags_ {\n    kTMXTileHorizontalFlag        = 0x80000000,\n    kTMXTileVerticalFlag            = 0x40000000,\n    kTMXTileDiagonalFlag            = 0x20000000,\n    kFlipedAll                    = (kTMXTileHorizontalFlag|kTMXTileVerticalFlag|kTMXTileDiagonalFlag),\n    kFlippedMask                    = ~(kFlipedAll)\n} ccTMXTileFlags;\n\n// Bits on the far end of the 32-bit global tile ID (GID's) are used for tile flags\n\n/** @brief TMXLayerInfo contains the information about the layers like:\n- Layer name\n- Layer size\n- Layer opacity at creation time (it can be modified at runtime)\n- Whether the layer is visible (if it's not visible, then the CocosNode won't be created)\n\nThis information is obtained from the TMX file.\n*/\nclass CC_DLL TMXLayerInfo : public Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    TMXLayerInfo();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TMXLayerInfo();\n\n    void setProperties(ValueMap properties);\n    ValueMap& getProperties();\n\n    ValueMap           _properties;\n    std::string         _name;\n    Size                _layerSize;\n    int                 *_tiles;\n    bool                _visible;\n    unsigned char       _opacity;\n    bool                _ownTiles;\n    Point               _offset;\n};\n\n/** @brief TMXTilesetInfo contains the information about the tilesets like:\n- Tileset name\n- Tileset spacing\n- Tileset margin\n- size of the tiles\n- Image used for the tiles\n- Image size\n\nThis information is obtained from the TMX file. \n*/\nclass CC_DLL TMXTilesetInfo : public Object\n{\npublic:\n    std::string     _name;\n    int             _firstGid;\n    Size            _tileSize;\n    int             _spacing;\n    int             _margin;\n    //! filename containing the tiles (should be spritesheet / texture atlas)\n    std::string     _sourceImage;\n    //! size in pixels of the image\n    Size            _imageSize;\npublic:\n    /**\n     * @js ctor\n     */\n    TMXTilesetInfo();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TMXTilesetInfo();\n    Rect rectForGID(int gid);\n};\n\n/** @brief TMXMapInfo contains the information about the map like:\n- Map orientation (hexagonal, isometric or orthogonal)\n- Tile size\n- Map size\n\nAnd it also contains:\n- Layers (an array of TMXLayerInfo objects)\n- Tilesets (an array of TMXTilesetInfo objects)\n- ObjectGroups (an array of TMXObjectGroupInfo objects)\n\nThis information is obtained from the TMX file.\n\n*/\nclass CC_DLL TMXMapInfo : public Object, public SAXDelegator\n{    \npublic:    \n    /** creates a TMX Format with a tmx file */\n    static TMXMapInfo * create(const std::string& tmxFile);\n    /** creates a TMX Format with an XML string and a TMX resource path */\n    static TMXMapInfo * createWithXML(const std::string& tmxString, const std::string& resourcePath);\n    \n    /** creates a TMX Format with a tmx file */\n    CC_DEPRECATED_ATTRIBUTE static TMXMapInfo * formatWithTMXFile(const char *tmxFile) { return TMXMapInfo::create(tmxFile); };\n    /** creates a TMX Format with an XML string and a TMX resource path */\n    CC_DEPRECATED_ATTRIBUTE static TMXMapInfo * formatWithXML(const char* tmxString, const char* resourcePath) { return TMXMapInfo::createWithXML(tmxString, resourcePath); };\n    /**\n     * @js ctor\n     */\n    TMXMapInfo();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TMXMapInfo();\n    \n    /** initializes a TMX format with a  tmx file */\n    bool initWithTMXFile(const std::string& tmxFile);\n    /** initializes a TMX format with an XML string and a TMX resource path */\n    bool initWithXML(const std::string& tmxString, const std::string& resourcePath);\n    /** initializes parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file */\n    bool parseXMLFile(const std::string& xmlFilename);\n    /* initializes parsing of an XML string, either a tmx (Map) string or tsx (Tileset) string */\n    bool parseXMLString(const std::string& xmlString);\n\n    ValueMapIntKey& getTileProperties() { return _tileProperties; };\n    void setTileProperties(const ValueMapIntKey& tileProperties) {\n        _tileProperties = tileProperties;\n    };\n\n    /// map orientation\n    inline int getOrientation() const { return _orientation; };\n    inline void setOrientation(int orientation) { _orientation = orientation; };\n\n    /// map width & height\n    inline const Size& getMapSize() const { return _mapSize; };\n    inline void setMapSize(const Size& mapSize) { _mapSize = mapSize; };\n\n    /// tiles width & height\n    inline const Size& getTileSize() const { return _tileSize; };\n    inline void setTileSize(const Size& tileSize) { _tileSize = tileSize; };\n    \n    /// Layers\n    inline const Vector<TMXLayerInfo*>& getLayers() const { return _layers; };\n    inline Vector<TMXLayerInfo*>& getLayers() { return _layers; };\n    inline void setLayers(const Vector<TMXLayerInfo*>& layers) {\n        _layers = layers;\n    };\n\n    /// tilesets\n    inline const Vector<TMXTilesetInfo*>& getTilesets() const { return _tilesets; };\n    inline Vector<TMXTilesetInfo*>& getTilesets() { return _tilesets; };\n    inline void setTilesets(const Vector<TMXTilesetInfo*>& tilesets) {\n        _tilesets = tilesets;\n    };\n\n    /// ObjectGroups\n    inline const Vector<TMXObjectGroup*>& getObjectGroups() const { return _objectGroups; };\n    inline Vector<TMXObjectGroup*>& getObjectGroups() { return _objectGroups; };\n    inline void setObjectGroups(const Vector<TMXObjectGroup*>& groups) {\n        _objectGroups = groups;\n    };\n\n    /// parent element\n    inline int getParentElement() const { return _parentElement; };\n    inline void setParentElement(int element) { _parentElement = element; };\n\n    /// parent GID\n    inline int getParentGID() const { return _parentGID; };\n    inline void setParentGID(int gid) { _parentGID = gid; };\n\n    /// layer attribs\n    inline int getLayerAttribs() const { return _layerAttribs; };\n    inline void setLayerAttribs(int layerAttribs) { _layerAttribs = layerAttribs; };\n\n    /// is storing characters?\n    inline bool isStoringCharacters() const { return _storingCharacters; };\n    CC_DEPRECATED_ATTRIBUTE inline bool getStoringCharacters() const { return isStoringCharacters(); };\n    inline void setStoringCharacters(bool storingCharacters) { _storingCharacters = storingCharacters; };\n\n    /// properties\n    inline const ValueMap& getProperties() const { return _properties; }\n    inline ValueMap& getProperties() { return _properties; }\n    inline void setProperties(const ValueMap& properties) {\n        _properties = properties;\n    };\n    \n    // implement pure virtual methods of SAXDelegator\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void startElement(void *ctx, const char *name, const char **atts);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void endElement(void *ctx, const char *name);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void textHandler(void *ctx, const char *ch, int len);\n    \n    inline const std::string& getCurrentString() const { return _currentString; }\n    inline void setCurrentString(const std::string& currentString){ _currentString = currentString; }\n    inline const std::string& getTMXFileName() const { return _TMXFileName; }\n    inline void setTMXFileName(const std::string& fileName){ _TMXFileName = fileName; }\n\nprotected:\n    void internalInit(const std::string& tmxFileName, const std::string& resourcePath);\n\n    /// map orientation\n    int    _orientation;\n    /// map width & height\n    Size _mapSize;\n    /// tiles width & height\n    Size _tileSize;\n    /// Layers\n    Vector<TMXLayerInfo*> _layers;\n    /// tilesets\n    Vector<TMXTilesetInfo*> _tilesets;\n    /// ObjectGroups\n    Vector<TMXObjectGroup*> _objectGroups;\n    /// parent element\n    int _parentElement;\n    /// parent GID\n    int _parentGID;\n    /// layer attribs\n    int _layerAttribs;\n    /// is storing characters?\n    bool _storingCharacters;\n    /// properties\n    ValueMap _properties;\n    \n    //! tmx filename\n    std::string _TMXFileName;\n    // tmx resource path\n    std::string _resources;\n    //! current string\n    std::string _currentString;\n    //! tile properties\n    ValueMapIntKey _tileProperties;\n    int _currentFirstGID;\n    bool _recordFirstGID;\n};\n\n// end of tilemap_parallax_nodes group\n/// @}\n\nNS_CC_END\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTextFieldTTF.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCTextFieldTTF.h\"\n\n#include \"CCDirector.h\"\n#include \"CCEGLView.h\"\n\nNS_CC_BEGIN\n\nstatic int _calcCharCount(const char * text)\n{\n    int n = 0;\n    char ch = 0;\n    while ((ch = *text))\n    {\n        CC_BREAK_IF(! ch);\n\n        if (0x80 != (0xC0 & ch))\n        {\n            ++n;\n        }\n        ++text;\n    }\n    return n;\n}\n\n//////////////////////////////////////////////////////////////////////////\n// constructor and destructor\n//////////////////////////////////////////////////////////////////////////\n\nTextFieldTTF::TextFieldTTF()\n: _delegate(0)\n, _charCount(0)\n, _inputText(\"\")\n, _placeHolder(\"\")   // prevent LabelTTF initWithString assertion\n, _secureTextEntry(false)\n{\n    _colorSpaceHolder.r = _colorSpaceHolder.g = _colorSpaceHolder.b = 127;\n}\n\nTextFieldTTF::~TextFieldTTF()\n{\n}\n\n//////////////////////////////////////////////////////////////////////////\n// static constructor\n//////////////////////////////////////////////////////////////////////////\n\nTextFieldTTF * TextFieldTTF::textFieldWithPlaceHolder(const std::string& placeholder, const Size& dimensions, TextHAlignment alignment, const std::string& fontName, float fontSize)\n{\n    TextFieldTTF *ret = new TextFieldTTF();\n    if(ret && ret->initWithPlaceHolder(\"\", dimensions, alignment, fontName, fontSize))\n    {\n        ret->autorelease();\n        if (placeholder.size()>0)\n        {\n            ret->setPlaceHolder(placeholder);\n        }\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nTextFieldTTF * TextFieldTTF::textFieldWithPlaceHolder(const std::string& placeholder, const std::string& fontName, float fontSize)\n{\n    TextFieldTTF *ret = new TextFieldTTF();\n    if(ret && ret->initWithString(\"\", fontName, fontSize))\n    {\n        ret->autorelease();\n        if (placeholder.size()>0)\n        {\n            ret->setPlaceHolder(placeholder);\n        }\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\n//////////////////////////////////////////////////////////////////////////\n// initialize\n//////////////////////////////////////////////////////////////////////////\n\nbool TextFieldTTF::initWithPlaceHolder(const std::string& placeholder, const Size& dimensions, TextHAlignment alignment, const std::string& fontName, float fontSize)\n{\n    _placeHolder = placeholder;\n    return LabelTTF::initWithString(_placeHolder, fontName, fontSize, dimensions, alignment);\n}\nbool TextFieldTTF::initWithPlaceHolder(const std::string& placeholder, const std::string& fontName, float fontSize)\n{\n    _placeHolder = std::string(placeholder);\n    return LabelTTF::initWithString(_placeHolder, fontName, fontSize);\n}\n\n//////////////////////////////////////////////////////////////////////////\n// IMEDelegate\n//////////////////////////////////////////////////////////////////////////\n\nbool TextFieldTTF::attachWithIME()\n{\n    bool ret = IMEDelegate::attachWithIME();\n    if (ret)\n    {\n        // open keyboard\n        EGLView * pGlView = Director::getInstance()->getOpenGLView();\n        if (pGlView)\n        {\n            pGlView->setIMEKeyboardState(true);\n        }\n    }\n    return ret;\n}\n\nbool TextFieldTTF::detachWithIME()\n{\n    bool ret = IMEDelegate::detachWithIME();\n    if (ret)\n    {\n        // close keyboard\n        EGLView * glView = Director::getInstance()->getOpenGLView();\n        if (glView)\n        {\n            glView->setIMEKeyboardState(false);\n        }\n    }\n    return ret;\n}\n\nbool TextFieldTTF::canAttachWithIME()\n{\n    return (_delegate) ? (! _delegate->onTextFieldAttachWithIME(this)) : true;\n}\n\nbool TextFieldTTF::canDetachWithIME()\n{\n    return (_delegate) ? (! _delegate->onTextFieldDetachWithIME(this)) : true;\n}\n\nvoid TextFieldTTF::insertText(const char * text, int len)\n{\n    std::string insert(text, len);\n\n    // insert \\n means input end\n    int pos = static_cast<int>(insert.find('\\n'));\n    if ((int)insert.npos != pos)\n    {\n        len = pos;\n        insert.erase(pos);\n    }\n\n    if (len > 0)\n    {\n        if (_delegate && _delegate->onTextFieldInsertText(this, insert.c_str(), len))\n        {\n            // delegate doesn't want to insert text\n            return;\n        }\n\n        _charCount += _calcCharCount(insert.c_str());\n        std::string sText(_inputText);\n        sText.append(insert);\n        setString(sText);\n    }\n\n    if ((int)insert.npos == pos) {\n        return;\n    }\n\n    // '\\n' inserted, let delegate process first\n    if (_delegate && _delegate->onTextFieldInsertText(this, \"\\n\", 1))\n    {\n        return;\n    }\n\n    // if delegate hasn't processed, detach from IME by default\n    detachWithIME();\n}\n\nvoid TextFieldTTF::deleteBackward()\n{\n    size_t len = _inputText.length();\n    if (! len)\n    {\n        // there is no string\n        return;\n    }\n\n    // get the delete byte number\n    size_t deleteLen = 1;    // default, erase 1 byte\n\n    while(0x80 == (0xC0 & _inputText.at(len - deleteLen)))\n    {\n        ++deleteLen;\n    }\n\n    if (_delegate && _delegate->onTextFieldDeleteBackward(this, _inputText.c_str() + len - deleteLen, static_cast<int>(deleteLen)))\n    {\n        // delegate doesn't wan't to delete backwards\n        return;\n    }\n\n    // if all text deleted, show placeholder string\n    if (len <= deleteLen)\n    {\n        _inputText = \"\";\n        _charCount = 0;\n        LabelTTF::setString(_placeHolder);\n        return;\n    }\n\n    // set new input text\n    std::string text(_inputText.c_str(), len - deleteLen);\n    setString(text);\n}\n\nconst std::string& TextFieldTTF::getContentText()\n{\n    return _inputText;\n}\n\nvoid TextFieldTTF::draw()\n{\n    if (_delegate && _delegate->onDraw(this))\n    {\n        return;\n    }\n    if (_inputText.length())\n    {\n        LabelTTF::draw();\n        return;\n    }\n\n    // draw placeholder\n    Color3B color = getColor();\n    setColor(_colorSpaceHolder);\n    LabelTTF::draw();\n    setColor(color);\n}\n\nconst Color3B& TextFieldTTF::getColorSpaceHolder()\n{\n    return _colorSpaceHolder;\n}\n\nvoid TextFieldTTF::setColorSpaceHolder(const Color3B& color)\n{\n    _colorSpaceHolder = color;\n}\n\n//////////////////////////////////////////////////////////////////////////\n// properties\n//////////////////////////////////////////////////////////////////////////\n\n// input text property\nvoid TextFieldTTF::setString(const std::string &text)\n{\n    static char bulletString[] = {(char)0xe2, (char)0x80, (char)0xa2, (char)0x00};\n    std::string displayText;\n    size_t length;\n\n    if (text.length()>0)\n    {\n        _inputText = text;\n        displayText = _inputText;\n        if (_secureTextEntry)\n        {\n            displayText = \"\";\n            length = _inputText.length();\n            while (length)\n            {\n                displayText.append(bulletString);\n                --length;\n            }\n        }\n    }\n    else\n    {\n        _inputText = \"\";\n    }\n\n    // if there is no input text, display placeholder instead\n    if (! _inputText.length())\n    {\n        LabelTTF::setString(_placeHolder);\n    }\n    else\n    {\n        LabelTTF::setString(displayText);\n    }\n    _charCount = _calcCharCount(_inputText.c_str());\n}\n\nconst std::string& TextFieldTTF::getString() const\n{\n    return _inputText;\n}\n\n// place holder text property\nvoid TextFieldTTF::setPlaceHolder(const std::string& text)\n{\n    _placeHolder = text;\n    if (! _inputText.length())\n    {\n        LabelTTF::setString(_placeHolder);\n    }\n}\n\nconst std::string& TextFieldTTF::getPlaceHolder() const\n{\n    return _placeHolder;\n}\n\n// secureTextEntry\nvoid TextFieldTTF::setSecureTextEntry(bool value)\n{\n    if (_secureTextEntry != value)\n    {\n        _secureTextEntry = value;\n        setString(getString());\n    }\n}\n\nbool TextFieldTTF::isSecureTextEntry()\n{\n    return _secureTextEntry;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTextFieldTTF.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_TEXT_FIELD_H__\n#define __CC_TEXT_FIELD_H__\n\n#include \"CCLabelTTF.h\"\n#include \"CCIMEDelegate.h\"\n\nNS_CC_BEGIN\n\nclass TextFieldTTF;\n\n/**\n * @addtogroup input\n * @{\n */\n\nclass CC_DLL TextFieldDelegate\n{\npublic:\n    virtual ~TextFieldDelegate() {}\n\n    /**\n    @brief    If the sender doesn't want to attach to the IME, return true;\n    */\n    virtual bool onTextFieldAttachWithIME(TextFieldTTF * sender)\n    {\n        CC_UNUSED_PARAM(sender);\n        return false;\n    }\n\n    /**\n    @brief    If the sender doesn't want to detach from the IME, return true;\n    */\n    virtual bool onTextFieldDetachWithIME(TextFieldTTF * sender)\n    {\n        CC_UNUSED_PARAM(sender);\n        return false;\n    }\n\n    /**\n    @brief    If the sender doesn't want to insert the text, return true;\n    */\n    virtual bool onTextFieldInsertText(TextFieldTTF * sender, const char * text, int nLen)\n    {\n        CC_UNUSED_PARAM(sender);\n        CC_UNUSED_PARAM(text);\n        CC_UNUSED_PARAM(nLen);\n        return false;\n    }\n\n    /**\n    @brief    If the sender doesn't want to delete the delText, return true;\n    */\n    virtual bool onTextFieldDeleteBackward(TextFieldTTF * sender, const char * delText, int nLen)\n    {\n        CC_UNUSED_PARAM(sender);\n        CC_UNUSED_PARAM(delText);\n        CC_UNUSED_PARAM(nLen);\n        return false;\n    }\n\n    /**\n    @brief    If the sender doesn't want to draw, return true.\n    */\n    virtual bool onDraw(TextFieldTTF * sender)\n    {\n        CC_UNUSED_PARAM(sender);\n        return false;\n    }\n};\n\n/**\n@brief    A simple text input field with TTF font.\n*/\nclass CC_DLL TextFieldTTF : public LabelTTF, public IMEDelegate\n{\npublic:\n    /**\n     * @js ctor\n     */\n    TextFieldTTF();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TextFieldTTF();\n\n    //char * description();\n\n    /** creates a TextFieldTTF from a fontname, alignment, dimension and font size */\n    static TextFieldTTF * textFieldWithPlaceHolder(const std::string& placeholder, const Size& dimensions, TextHAlignment alignment, const std::string& fontName, float fontSize);\n    /** creates a LabelTTF from a fontname and font size */\n    static TextFieldTTF * textFieldWithPlaceHolder(const std::string& placeholder, const std::string& fontName, float fontSize);\n    /** initializes the TextFieldTTF with a font name, alignment, dimension and font size */\n    bool initWithPlaceHolder(const std::string& placeholder, const Size& dimensions, TextHAlignment alignment, const std::string& fontName, float fontSize);\n    /** initializes the TextFieldTTF with a font name and font size */\n    bool initWithPlaceHolder(const std::string& placeholder, const std::string& fontName, float fontSize);\n\n    /**\n    @brief    Open keyboard and receive input text.\n    */\n    virtual bool attachWithIME();\n\n    /**\n    @brief    End text input and close keyboard.\n    */\n    virtual bool detachWithIME();\n\n    //////////////////////////////////////////////////////////////////////////\n    // properties\n    //////////////////////////////////////////////////////////////////////////\n    /**\n     * @js NA\n     * @lua NA\n     */\n    inline TextFieldDelegate* getDelegate() const { return _delegate; };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    inline void setDelegate(TextFieldDelegate* delegate) { _delegate = delegate; };\n\n    inline int getCharCount() const { return _charCount; };\n    virtual const Color3B& getColorSpaceHolder();\n    virtual void setColorSpaceHolder(const Color3B& color);\n\n    // input text property\npublic:\n    virtual void setString(const std::string& text) override;\n    virtual const std::string& getString() const override;\nprotected:\n    TextFieldDelegate * _delegate;\n    int _charCount;\n    \n    std::string _inputText;\n\n    // place holder text property\n    // place holder text displayed when there is no text in the text field.\npublic:\n    virtual void setPlaceHolder(const std::string& text);\n    virtual const std::string& getPlaceHolder(void) const;\nprotected:\n    std::string _placeHolder;\n    Color3B _colorSpaceHolder;\npublic:\n    virtual void setSecureTextEntry(bool value);\n    virtual bool isSecureTextEntry();\nprotected:\n    bool _secureTextEntry;\nprotected:\n\n    virtual void draw();\n\n    //////////////////////////////////////////////////////////////////////////\n    // IMEDelegate interface\n    //////////////////////////////////////////////////////////////////////////\n\n    virtual bool canAttachWithIME() override;\n    virtual bool canDetachWithIME() override;\n    virtual void insertText(const char * text, int len) override;\n    virtual void deleteBackward() override;\n    virtual const std::string& getContentText() override;\nprivate:\n    class LengthStack;\n    LengthStack * _lens;\n};\n\n// end of input group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_TEXT_FIELD_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTexture2D.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008      Apple Inc. All Rights Reserved.\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n\n/*\n* Support for RGBA_4_4_4_4 and RGBA_5_5_5_1 was copied from:\n* https://devforums.apple.com/message/37855#37855 by a1studmuffin\n*/\n\n#include \"CCTexture2D.h\"\n#include \"ccConfig.h\"\n#include \"ccMacros.h\"\n#include \"CCConfiguration.h\"\n#include \"platform/CCImage.h\"\n#include \"CCGL.h\"\n#include \"ccUtils.h\"\n#include \"CCPlatformMacros.h\"\n#include \"CCDirector.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCShaderCache.h\"\n\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    #include \"CCTextureCache.h\"\n#endif\n\nNS_CC_BEGIN\n\nnamespace {\n    typedef Texture2D::PixelFormatInfoMap::value_type PixelFormatInfoMapValue;\n    static const PixelFormatInfoMapValue TexturePixelFormatInfoTablesValue[] =\n    {\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::BGRA8888, Texture2D::PixelFormatInfo(GL_RGBA, GL_BGRA, GL_UNSIGNED_BYTE, 32, false, true)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::RGBA8888, Texture2D::PixelFormatInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, 32, false, true)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::RGBA4444, Texture2D::PixelFormatInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 16, false, true)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::RGB5A1, Texture2D::PixelFormatInfo(GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 16, false, true)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::RGB565, Texture2D::PixelFormatInfo(GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 16, false, false)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::RGB888, Texture2D::PixelFormatInfo(GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, 24, false, false)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::A8, Texture2D::PixelFormatInfo(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, 8, false, false)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::I8, Texture2D::PixelFormatInfo(GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, 8, false, false)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::AI88, Texture2D::PixelFormatInfo(GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 16, false, true)),\n        \n#ifdef GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::PVRTC2, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, 0xFFFFFFFF, 0xFFFFFFFF, 2, true, false)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::PVRTC2A, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, 0xFFFFFFFF, 0xFFFFFFFF, 2, true, true)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::PVRTC4, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, 0xFFFFFFFF, 0xFFFFFFFF, 4, true, false)),\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::PVRTC4A, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, 0xFFFFFFFF, 0xFFFFFFFF, 4, true, true)),\n#endif\n        \n#ifdef GL_ETC1_RGB8_OES\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::ETC, Texture2D::PixelFormatInfo(GL_ETC1_RGB8_OES, 0xFFFFFFFF, 0xFFFFFFFF, 24, true, false)),\n#endif\n        \n#ifdef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::S3TC_DXT1, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 0xFFFFFFFF, 0xFFFFFFFF, 4, true, false)),\n#endif\n        \n#ifdef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::S3TC_DXT3, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 0xFFFFFFFF, 0xFFFFFFFF, 8, true, false)),\n#endif\n        \n#ifdef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::S3TC_DXT5, Texture2D::PixelFormatInfo(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, 0xFFFFFFFF, 0xFFFFFFFF, 8, true, false)),\n#endif\n        \n#ifdef GL_ATC_RGB_AMD\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::ATC_RGB, Texture2D::PixelFormatInfo(GL_ATC_RGB_AMD,\n            0xFFFFFFFF, 0xFFFFFFFF, 4, true, false)),\n#endif\n        \n#ifdef GL_ATC_RGBA_EXPLICIT_ALPHA_AMD\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::ATC_EXPLICIT_ALPHA, Texture2D::PixelFormatInfo(GL_ATC_RGBA_EXPLICIT_ALPHA_AMD,\n            0xFFFFFFFF, 0xFFFFFFFF, 8, true, false)),\n#endif\n        \n#ifdef GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD\n        PixelFormatInfoMapValue(Texture2D::PixelFormat::ATC_INTERPOLATED_ALPHA, Texture2D::PixelFormatInfo(GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD,\n            0xFFFFFFFF, 0xFFFFFFFF, 8, true, false)),\n#endif\n    };\n}\n\n//CLASS IMPLEMENTATIONS:\n\n//The PixpelFormat corresponding information\nconst Texture2D::PixelFormatInfoMap Texture2D::_pixelFormatInfoTables(TexturePixelFormatInfoTablesValue,\n                                                                     TexturePixelFormatInfoTablesValue + sizeof(TexturePixelFormatInfoTablesValue) / sizeof(TexturePixelFormatInfoTablesValue[0]));\n\n// If the image has alpha, you can create RGBA8 (32-bit) or RGBA4 (16-bit) or RGB5A1 (16-bit)\n// Default is: RGBA8888 (32-bit textures)\nstatic Texture2D::PixelFormat g_defaultAlphaPixelFormat = Texture2D::PixelFormat::DEFAULT;\n\nstatic bool _PVRHaveAlphaPremultiplied = false;\n\n//////////////////////////////////////////////////////////////////////////\n//conventer function\n\n// IIIIIIII -> RRRRRRRRGGGGGGGGGBBBBBBBB\nvoid Texture2D::convertI8ToRGB888(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i=0; i < dataLen; ++i)\n    {\n        *outData++ = data[i];     //R\n        *outData++ = data[i];     //G\n        *outData++ = data[i];     //B\n    }\n}\n\n// IIIIIIIIAAAAAAAA -> RRRRRRRRGGGGGGGGBBBBBBBB\nvoid Texture2D::convertAI88ToRGB888(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 1; i < l; i += 2)\n    {\n        *outData++ = data[i];     //R\n        *outData++ = data[i];     //G\n        *outData++ = data[i];     //B\n    }\n}\n\n// IIIIIIII -> RRRRRRRRGGGGGGGGGBBBBBBBBAAAAAAAA\nvoid Texture2D::convertI8ToRGBA8888(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0; i < dataLen; ++i)\n    {\n        *outData++ = data[i];     //R\n        *outData++ = data[i];     //G\n        *outData++ = data[i];     //B\n        *outData++ = 0xFF;        //A\n    }\n}\n\n// IIIIIIIIAAAAAAAA -> RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA\nvoid Texture2D::convertAI88ToRGBA8888(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 1; i < l; i += 2)\n    {\n        *outData++ = data[i];     //R\n        *outData++ = data[i];     //G\n        *outData++ = data[i];     //B\n        *outData++ = data[i + 1]; //A\n    }\n}\n\n// IIIIIIII -> RRRRRGGGGGGBBBBB\nvoid Texture2D::convertI8ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (int i = 0; i < dataLen; ++i)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i] & 0x00FC) << 3         //G\n            | (data[i] & 0x00F8) >> 3;        //B\n    }\n}\n\n// IIIIIIIIAAAAAAAA -> RRRRRGGGGGGBBBBB\nvoid Texture2D::convertAI88ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 1; i < l; i += 2)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i] & 0x00FC) << 3         //G\n            | (data[i] & 0x00F8) >> 3;        //B\n    }\n}\n\n// IIIIIIII -> RRRRGGGGBBBBAAAA\nvoid Texture2D::convertI8ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0; i < dataLen; ++i)\n    {\n        *out16++ = (data[i] & 0x00F0) << 8    //R\n        | (data[i] & 0x00F0) << 4             //G\n        | (data[i] & 0x00F0)                  //B\n        | 0x000F;                             //A\n    }\n}\n\n// IIIIIIIIAAAAAAAA -> RRRRGGGGBBBBAAAA\nvoid Texture2D::convertAI88ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 1; i < l; i += 2)\n    {\n        *out16++ = (data[i] & 0x00F0) << 8    //R\n        | (data[i] & 0x00F0) << 4             //G\n        | (data[i] & 0x00F0)                  //B\n        | (data[i+1] & 0x00F0) >> 4;          //A\n    }\n}\n\n// IIIIIIII -> RRRRRGGGGGBBBBBA\nvoid Texture2D::convertI8ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (int i = 0; i < dataLen; ++i)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i] & 0x00F8) << 3         //G\n            | (data[i] & 0x00F8) >> 2         //B\n            | 0x0001;                         //A\n    }\n}\n\n// IIIIIIIIAAAAAAAA -> RRRRRGGGGGBBBBBA\nvoid Texture2D::convertAI88ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 1; i < l; i += 2)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i] & 0x00F8) << 3         //G\n            | (data[i] & 0x00F8) >> 2         //B\n            | (data[i + 1] & 0x0080) >> 7;    //A\n    }\n}\n\n// IIIIIIII -> IIIIIIIIAAAAAAAA\nvoid Texture2D::convertI8ToAI88(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0; i < dataLen; ++i)\n    {\n        *out16++ = 0xFF00     //A\n        | data[i];            //I\n    }\n}\n\n// IIIIIIIIAAAAAAAA -> AAAAAAAA\nvoid Texture2D::convertAI88ToA8(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 1; i < dataLen; i += 2)\n    {\n        *outData++ = data[i]; //A\n    }\n}\n\n// IIIIIIIIAAAAAAAA -> IIIIIIII\nvoid Texture2D::convertAI88ToI8(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 1; i < l; i += 2)\n    {\n        *outData++ = data[i]; //R\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBB -> RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA\nvoid Texture2D::convertRGB888ToRGBA8888(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 2; i < l; i += 3)\n    {\n        *outData++ = data[i];         //R\n        *outData++ = data[i + 1];     //G\n        *outData++ = data[i + 2];     //B\n        *outData++ = 0xFF;            //A\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA -> RRRRRRRRGGGGGGGGBBBBBBBB\nvoid Texture2D::convertRGBA8888ToRGB888(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 3; i < l; i += 4)\n    {\n        *outData++ = data[i];         //R\n        *outData++ = data[i + 1];     //G\n        *outData++ = data[i + 2];     //B\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBB -> RRRRRGGGGGGBBBBB\nvoid Texture2D::convertRGB888ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 2; i < l; i += 3)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i + 1] & 0x00FC) << 3     //G\n            | (data[i + 2] & 0x00F8) >> 3;    //B\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA -> RRRRRGGGGGGBBBBB\nvoid Texture2D::convertRGBA8888ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 3; i < l; i += 4)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i + 1] & 0x00FC) << 3     //G\n            | (data[i + 2] & 0x00F8) >> 3;    //B\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBB -> IIIIIIII\nvoid Texture2D::convertRGB888ToI8(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 2; i < l; i += 3)\n    {\n        *outData++ = (data[i] * 299 + data[i + 1] * 587 + data[i + 2] * 114 + 500) / 1000;  //I =  (R*299 + G*587 + B*114 + 500) / 1000\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA -> IIIIIIII\nvoid Texture2D::convertRGBA8888ToI8(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 3; i < l; i += 4)\n    {\n        *outData++ = (data[i] * 299 + data[i + 1] * 587 + data[i + 2] * 114 + 500) / 1000;  //I =  (R*299 + G*587 + B*114 + 500) / 1000\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA -> AAAAAAAA\nvoid Texture2D::convertRGBA8888ToA8(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen -3; i < l; i += 4)\n    {\n        *outData++ = data[i + 3]; //A\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBB -> IIIIIIIIAAAAAAAA\nvoid Texture2D::convertRGB888ToAI88(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 2; i < l; i += 3)\n    {\n        *outData++ = (data[i] * 299 + data[i + 1] * 587 + data[i + 2] * 114 + 500) / 1000;  //I =  (R*299 + G*587 + B*114 + 500) / 1000\n        *outData++ = 0xFF;\n    }\n}\n\n\n// RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA -> IIIIIIIIAAAAAAAA\nvoid Texture2D::convertRGBA8888ToAI88(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    for (ssize_t i = 0, l = dataLen - 3; i < l; i += 4)\n    {\n        *outData++ = (data[i] * 299 + data[i + 1] * 587 + data[i + 2] * 114 + 500) / 1000;  //I =  (R*299 + G*587 + B*114 + 500) / 1000\n        *outData++ = data[i + 3];\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBB -> RRRRGGGGBBBBAAAA\nvoid Texture2D::convertRGB888ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 2; i < l; i += 3)\n    {\n        *out16++ = ((data[i] & 0x00F0) << 8           //R\n                    | (data[i + 1] & 0x00F0) << 4     //G\n                    | (data[i + 2] & 0xF0)            //B\n                    |  0x0F);                         //A\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA -> RRRRGGGGBBBBAAAA\nvoid Texture2D::convertRGBA8888ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 3; i < l; i += 4)\n    {\n        *out16++ = (data[i] & 0x00F0) << 8    //R\n        | (data[i + 1] & 0x00F0) << 4         //G\n        | (data[i + 2] & 0xF0)                //B\n        |  (data[i + 3] & 0xF0) >> 4;         //A\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBB -> RRRRRGGGGGBBBBBA\nvoid Texture2D::convertRGB888ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 2; i < l; i += 3)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i + 1] & 0x00F8) << 3     //G\n            | (data[i + 2] & 0x00F8) >> 2     //B\n            |  0x01;                          //A\n    }\n}\n\n// RRRRRRRRGGGGGGGGBBBBBBBB -> RRRRRGGGGGBBBBBA\nvoid Texture2D::convertRGBA8888ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData)\n{\n    unsigned short* out16 = (unsigned short*)outData;\n    for (ssize_t i = 0, l = dataLen - 2; i < l; i += 4)\n    {\n        *out16++ = (data[i] & 0x00F8) << 8    //R\n            | (data[i + 1] & 0x00F8) << 3     //G\n            | (data[i + 2] & 0x00F8) >> 2     //B\n            |  (data[i + 3] & 0x0080) >> 7;   //A\n    }\n}\n// conventer function end\n//////////////////////////////////////////////////////////////////////////\n\nTexture2D::Texture2D()\n: _pixelFormat(Texture2D::PixelFormat::DEFAULT)\n, _pixelsWide(0)\n, _pixelsHigh(0)\n, _name(0)\n, _maxS(0.0)\n, _maxT(0.0)\n, _hasPremultipliedAlpha(false)\n, _hasMipmaps(false)\n, _shaderProgram(nullptr)\n{\n}\n\nTexture2D::~Texture2D()\n{\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    VolatileTextureMgr::removeTexture(this);\n#endif\n\n    CCLOGINFO(\"deallocing Texture2D: %p - id=%u\", this, _name);\n    CC_SAFE_RELEASE(_shaderProgram);\n\n    if(_name)\n    {\n        GL::deleteTexture(_name);\n    }\n}\n\nTexture2D::PixelFormat Texture2D::getPixelFormat() const\n{\n    return _pixelFormat;\n}\n\nint Texture2D::getPixelsWide() const\n{\n    return _pixelsWide;\n}\n\nint Texture2D::getPixelsHigh() const\n{\n    return _pixelsHigh;\n}\n\nGLuint Texture2D::getName() const\n{\n    return _name;\n}\n\nSize Texture2D::getContentSize() const\n{\n    Size ret;\n    ret.width = _contentSize.width / CC_CONTENT_SCALE_FACTOR();\n    ret.height = _contentSize.height / CC_CONTENT_SCALE_FACTOR();\n    \n    return ret;\n}\n\nconst Size& Texture2D::getContentSizeInPixels()\n{\n    return _contentSize;\n}\n\nGLfloat Texture2D::getMaxS() const\n{\n    return _maxS;\n}\n\nvoid Texture2D::setMaxS(GLfloat maxS)\n{\n    _maxS = maxS;\n}\n\nGLfloat Texture2D::getMaxT() const\n{\n    return _maxT;\n}\n\nvoid Texture2D::setMaxT(GLfloat maxT)\n{\n    _maxT = maxT;\n}\n\nGLProgram* Texture2D::getShaderProgram() const\n{\n    return _shaderProgram;\n}\n\nvoid Texture2D::setShaderProgram(GLProgram* shaderProgram)\n{\n    CC_SAFE_RETAIN(shaderProgram);\n    CC_SAFE_RELEASE(_shaderProgram);\n    _shaderProgram = shaderProgram;\n}\n\nvoid Texture2D::releaseData(void *data)\n{\n    free(data);\n}\n\nvoid* Texture2D::keepData(void *data, unsigned int length)\n{\n    CC_UNUSED_PARAM(length);\n    //The texture data mustn't be saved because it isn't a mutable texture.\n    return data;\n}\n\nbool Texture2D::hasPremultipliedAlpha() const\n{\n    return _hasPremultipliedAlpha;\n}\n\nbool Texture2D::initWithData(const void *data, ssize_t dataLen, Texture2D::PixelFormat pixelFormat, int pixelsWide, int pixelsHigh, const Size& contentSize)\n{\n    CCASSERT(dataLen>0 && pixelsWide>0 && pixelsHigh>0, \"Invalid size\");\n\n    //if data has no mipmaps, we will consider it has only one mipmap\n    MipmapInfo mipmap;\n    mipmap.address = (unsigned char*)data;\n    mipmap.len = static_cast<int>(dataLen);\n    return initWithMipmaps(&mipmap, 1, pixelFormat, pixelsWide, pixelsHigh);\n\n    //update information\n    _contentSize = contentSize;\n    _maxS = contentSize.width / (float)(pixelsWide);\n    _maxT = contentSize.height / (float)(pixelsHigh);\n}\n\nbool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat pixelFormat, int pixelsWide, int pixelsHigh)\n{\n    //the pixelFormat must be a certain value \n    CCASSERT(pixelFormat != PixelFormat::NONE && pixelFormat != PixelFormat::AUTO, \"the \\\"pixelFormat\\\" param must be a certain value!\");\n    CCASSERT(pixelsWide>0 && pixelsHigh>0, \"Invalid size\");\n\n    if (mipmapsNum <= 0)\n    {\n        CCLOG(\"cocos2d: WARNING: mipmap number is less than 1\");\n        return false;\n    }\n    \n\n    if(_pixelFormatInfoTables.find(pixelFormat) == _pixelFormatInfoTables.end())\n    {\n        CCLOG(\"cocos2d: WARNING: unsupported pixelformat: %lx\", (unsigned long)pixelFormat );\n        return false;\n    }\n\n    const PixelFormatInfo& info = _pixelFormatInfoTables.at(pixelFormat);\n\n    if (info.compressed && !Configuration::getInstance()->supportsPVRTC()\n                        && !Configuration::getInstance()->supportsETC()\n                        && !Configuration::getInstance()->supportsS3TC()\n                        && !Configuration::getInstance()->supportsATITC())\n    {\n        CCLOG(\"cocos2d: WARNING: PVRTC/ETC images are not supported\");\n        return false;\n    }\n\n    //Set the row align only when mipmapsNum == 1 and the data is uncompressed\n    if (mipmapsNum == 1 && !info.compressed)\n    {\n        unsigned int bytesPerRow = pixelsWide * info.bpp / 8;\n\n        if(bytesPerRow % 8 == 0)\n        {\n            glPixelStorei(GL_UNPACK_ALIGNMENT, 8);\n        }\n        else if(bytesPerRow % 4 == 0)\n        {\n            glPixelStorei(GL_UNPACK_ALIGNMENT, 4);\n        }\n        else if(bytesPerRow % 2 == 0)\n        {\n            glPixelStorei(GL_UNPACK_ALIGNMENT, 2);\n        }\n        else\n        {\n            glPixelStorei(GL_UNPACK_ALIGNMENT, 1);\n        }\n    }else\n    {\n        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);\n    }\n    \n\n\n    glGenTextures(1, &_name);\n    GL::bindTexture2D(_name);\n\n    if (mipmapsNum == 1)\n    {\n        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );\n    }else\n    {\n        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);\n    }\n    \n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );\n\n    CHECK_GL_ERROR_DEBUG(); // clean possible GL error\n    \n    // Specify OpenGL texture image\n    int width = pixelsWide;\n    int height = pixelsHigh;\n    \n    for (int i = 0; i < mipmapsNum; ++i)\n    {\n        unsigned char *data = mipmaps[i].address;\n        GLsizei datalen = mipmaps[i].len;\n\n        if (info.compressed)\n        {\n            glCompressedTexImage2D(GL_TEXTURE_2D, i, info.internalFormat, (GLsizei)width, (GLsizei)height, 0, datalen, data);\n        }\n        else\n        {\n            glTexImage2D(GL_TEXTURE_2D, i, info.internalFormat, (GLsizei)width, (GLsizei)height, 0, info.format, info.type, data);\n        }\n\n        if (i > 0 && (width != height || ccNextPOT(width) != width ))\n        {\n            CCLOG(\"cocos2d: Texture2D. WARNING. Mipmap level %u is not squared. Texture won't render correctly. width=%d != height=%d\", i, width, height);\n        }\n\n        GLenum err = glGetError();\n        if (err != GL_NO_ERROR)\n        {\n            CCLOG(\"cocos2d: Texture2D: Error uploading compressed texture level: %u . glError: 0x%04X\", i, err);\n            return false;\n        }\n\n        width = MAX(width >> 1, 1);\n        height = MAX(height >> 1, 1);\n    }\n\n    _contentSize = Size((float)pixelsWide, (float)pixelsHigh);\n    _pixelsWide = pixelsWide;\n    _pixelsHigh = pixelsHigh;\n    _pixelFormat = pixelFormat;\n    _maxS = 1;\n    _maxT = 1;\n\n    _hasPremultipliedAlpha = false;\n    _hasMipmaps = mipmapsNum > 1;\n\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE));\n\n    return true;\n}\n\n\nstd::string Texture2D::getDescription() const\n{\n    return StringUtils::format(\"<Texture2D | Name = %u | Dimensions = %ld x %ld | Coordinates = (%.2f, %.2f)>\", _name, (long)_pixelsWide, (long)_pixelsHigh, _maxS, _maxT);\n}\n\n// implementation Texture2D (Image)\nbool Texture2D::initWithImage(Image *image)\n{\n    return initWithImage(image, PixelFormat::NONE);\n}\n\nbool Texture2D::initWithImage(Image *image, PixelFormat format)\n{\n    if (image == nullptr)\n    {\n        CCLOG(\"cocos2d: Texture2D. Can't create Texture. UIImage is nil\");\n        return false;\n    }\n\n    int imageWidth = image->getWidth();\n    int imageHeight = image->getHeight();\n\n    Configuration *conf = Configuration::getInstance();\n\n    int maxTextureSize = conf->getMaxTextureSize();\n    if (imageWidth > maxTextureSize || imageHeight > maxTextureSize) \n    {\n        CCLOG(\"cocos2d: WARNING: Image (%u x %u) is bigger than the supported %u x %u\", imageWidth, imageHeight, maxTextureSize, maxTextureSize);\n        return false;\n    }\n\n    unsigned char*   tempData = image->getData();\n    Size             imageSize = Size((float)imageWidth, (float)imageHeight);\n    PixelFormat      pixelFormat = PixelFormat::NONE;\n    PixelFormat      renderFormat = image->getRenderFormat();\n    size_t\t         tempDataLen = image->getDataLen();\n\n\n    if (image->getNumberOfMipmaps() > 1)\n    {\n        if (format != PixelFormat::NONE)\n        {\n            CCLOG(\"cocos2d: WARNING: This image has more than 1 mipmaps and we will not convert the data format\");\n        }\n\n        initWithMipmaps(image->getMipmaps(), image->getNumberOfMipmaps(), image->getRenderFormat(), imageWidth, imageHeight);\n        \n        return true;\n    }\n    else if (image->isCompressed())\n    {\n        if (format != PixelFormat::NONE)\n        {\n            CCLOG(\"cocos2d: WARNING: This image is compressed and we cann't convert it for now\");\n        }\n\n        initWithData(tempData, tempDataLen, image->getRenderFormat(), imageWidth, imageHeight, imageSize);\n        return true;\n    }\n    else\n    {\n        // compute pixel format\n        if (format != PixelFormat::NONE)\n        {\n            pixelFormat = format;\n        }else\n        {\n            pixelFormat = g_defaultAlphaPixelFormat;\n        }\n\n        unsigned char* outTempData = nullptr;\n        ssize_t outTempDataLen = 0;\n\n        pixelFormat = convertDataToFormat(tempData, tempDataLen, renderFormat, pixelFormat, &outTempData, &outTempDataLen);\n\n        initWithData(outTempData, outTempDataLen, pixelFormat, imageWidth, imageHeight, imageSize);\n\n\n        if (outTempData != nullptr && outTempData != tempData)\n        {\n\n            delete [] outTempData;\n        }\n\n        // set the premultiplied tag\n        if (!image->hasPremultipliedAlpha())\n        {\n            if (image->getFileType() == Image::Format::PVR)\n            {\n                _hasPremultipliedAlpha = _PVRHaveAlphaPremultiplied;\n            }else\n            {\n                CCLOG(\"wanning: We cann't find the data is premultiplied or not, we will assume it's false.\");\n                _hasPremultipliedAlpha = false;\n            }\n        }else\n        {\n            _hasPremultipliedAlpha = image->isPremultipliedAlpha();\n        }\n        return true;\n    }\n}\n\nTexture2D::PixelFormat Texture2D::convertI8ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen)\n{\n    switch (format)\n    {\n    case PixelFormat::RGBA8888:\n        *outDataLen = dataLen*4;\n        *outData = new unsigned char[*outDataLen];\n        convertI8ToRGBA8888(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB888:\n        *outDataLen = dataLen*3;\n        *outData = new unsigned char[*outDataLen];\n        convertI8ToRGB888(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB565:\n        *outDataLen = dataLen*2;\n        *outData = new unsigned char[*outDataLen];\n        convertI8ToRGB565(data, dataLen, *outData);\n        break;\n    case PixelFormat::AI88:\n        *outDataLen = dataLen*2;\n        *outData = new unsigned char[*outDataLen];\n        convertI8ToAI88(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGBA4444:\n        *outDataLen = dataLen*2;\n        *outData = new unsigned char[*outDataLen];\n        convertI8ToRGBA4444(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB5A1:\n        *outDataLen = dataLen*2;\n        *outData = new unsigned char[*outDataLen];\n        convertI8ToRGB5A1(data, dataLen, *outData);\n        break;\n    default:\n        // unsupport convertion or don't need to convert\n        if (format != PixelFormat::AUTO && format != PixelFormat::I8)\n        {\n            CCLOG(\"Can not convert image format PixelFormat::I8 to format ID:%d, we will use it's origin format PixelFormat::I8\", format);\n        }\n\n        *outData = (unsigned char*)data;\n        *outDataLen = dataLen;\n        return PixelFormat::I8;\n    }\n\n    return format;\n}\n\nTexture2D::PixelFormat Texture2D::convertAI88ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen)\n{\n    switch (format)\n    {\n    case PixelFormat::RGBA8888:\n        *outDataLen = dataLen*2;\n        *outData = new unsigned char[*outDataLen];\n        convertAI88ToRGBA8888(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB888:\n        *outDataLen = dataLen/2*3;\n        *outData = new unsigned char[*outDataLen];\n        convertAI88ToRGB888(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB565:\n        *outDataLen = dataLen;\n        *outData = new unsigned char[*outDataLen];\n        convertAI88ToRGB565(data, dataLen, *outData);\n        break;\n    case PixelFormat::A8:\n        *outDataLen = dataLen/2;\n        *outData = new unsigned char[*outDataLen];\n        convertAI88ToA8(data, dataLen, *outData);\n        break;\n    case PixelFormat::I8:\n        *outDataLen = dataLen/2;\n        *outData = new unsigned char[*outDataLen];\n        convertAI88ToI8(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGBA4444:\n        *outDataLen = dataLen;\n        *outData = new unsigned char[*outDataLen];\n        convertAI88ToRGBA4444(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB5A1:\n        *outDataLen = dataLen;\n        *outData = new unsigned char[*outDataLen];\n        convertAI88ToRGB5A1(data, dataLen, *outData);\n        break;\n    default:\n        // unsupport convertion or don't need to convert\n        if (format != PixelFormat::AUTO && format != PixelFormat::AI88)\n        {\n            CCLOG(\"Can not convert image format PixelFormat::AI88 to format ID:%d, we will use it's origin format PixelFormat::AI88\", format);\n        }\n\n        *outData = (unsigned char*)data;\n        *outDataLen = dataLen;\n        return PixelFormat::AI88;\n        break;\n    }\n\n    return format;\n}\n\nTexture2D::PixelFormat Texture2D::convertRGB888ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen)\n{\n    switch (format)\n    {\n    case PixelFormat::RGBA8888:\n        *outDataLen = dataLen/3*4;\n        *outData = new unsigned char[*outDataLen];\n        convertRGB888ToRGBA8888(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB565:\n        *outDataLen = dataLen/3*2;\n        *outData = new unsigned char[*outDataLen];\n        convertRGB888ToRGB565(data, dataLen, *outData);\n        break;\n    case PixelFormat::I8:\n        *outDataLen = dataLen/3;\n        *outData = new unsigned char[*outDataLen];\n        convertRGB888ToI8(data, dataLen, *outData);\n        break;\n    case PixelFormat::AI88:\n        *outDataLen = dataLen/3*2;\n        *outData = new unsigned char[*outDataLen];\n        convertRGB888ToAI88(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGBA4444:\n        *outDataLen = dataLen/3*2;\n        *outData = new unsigned char[*outDataLen];\n        convertRGB888ToRGBA4444(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB5A1:\n        *outDataLen = dataLen;\n        *outData = new unsigned char[*outDataLen];\n        convertRGB888ToRGB5A1(data, dataLen, *outData);\n        break;\n    default:\n        // unsupport convertion or don't need to convert\n        if (format != PixelFormat::AUTO && format != PixelFormat::RGB888)\n        {\n            CCLOG(\"Can not convert image format PixelFormat::RGB888 to format ID:%d, we will use it's origin format PixelFormat::RGB888\", format);\n        }\n\n        *outData = (unsigned char*)data;\n        *outDataLen = dataLen;\n        return PixelFormat::RGB888;\n    }\n    return format;\n}\n\nTexture2D::PixelFormat Texture2D::convertRGBA8888ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen)\n{\n\n    switch (format)\n    {\n    case PixelFormat::RGB888:\n        *outDataLen = dataLen/4*3;\n        *outData = new unsigned char[*outDataLen];\n        convertRGBA8888ToRGB888(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB565:\n        *outDataLen = dataLen/2;\n        *outData = new unsigned char[*outDataLen];\n        convertRGBA8888ToRGB565(data, dataLen, *outData);\n        break;\n    case PixelFormat::A8:\n        *outDataLen = dataLen/4;\n        *outData = new unsigned char[*outDataLen];\n        convertRGBA8888ToA8(data, dataLen, *outData);\n        break;\n    case PixelFormat::I8:\n        *outDataLen = dataLen/4;\n        *outData = new unsigned char[*outDataLen];\n        convertRGBA8888ToI8(data, dataLen, *outData);\n        break;\n    case PixelFormat::AI88:\n        *outDataLen = dataLen/2;\n        *outData = new unsigned char[*outDataLen];\n        convertRGBA8888ToAI88(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGBA4444:\n        *outDataLen = dataLen/2;\n        *outData = new unsigned char[*outDataLen];\n        convertRGBA8888ToRGBA4444(data, dataLen, *outData);\n        break;\n    case PixelFormat::RGB5A1:\n        *outDataLen = dataLen/2;\n        *outData = new unsigned char[*outDataLen];\n        convertRGBA8888ToRGB5A1(data, dataLen, *outData);\n        break;\n    default:\n        // unsupport convertion or don't need to convert\n        if (format != PixelFormat::AUTO && format != PixelFormat::RGBA8888)\n        {\n            CCLOG(\"Can not convert image format PixelFormat::RGBA8888 to format ID:%d, we will use it's origin format PixelFormat::RGBA8888\", format);\n        }\n\n        *outData = (unsigned char*)data;\n        *outDataLen = dataLen;\n        return PixelFormat::RGBA8888;\n    }\n\n    return format;\n}\n\n/*\nconvert map:\n1.PixelFormat::RGBA8888\n2.PixelFormat::RGB888\n3.PixelFormat::RGB565\n4.PixelFormat::A8\n5.PixelFormat::I8\n6.PixelFormat::AI88\n7.PixelFormat::RGBA4444\n8.PixelFormat::RGB5A1\n\ngray(5) -> 1235678\ngray alpha(6) -> 12345678\nrgb(2) -> 1235678\nrgba(1) -> 12345678\n\n*/\nTexture2D::PixelFormat Texture2D::convertDataToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat originFormat, PixelFormat format, unsigned char** outData, ssize_t* outDataLen)\n{\n    switch (originFormat)\n    {\n    case PixelFormat::I8:\n        return convertI8ToFormat(data, dataLen, format, outData, outDataLen);\n    case PixelFormat::AI88:\n        return convertAI88ToFormat(data, dataLen, format, outData, outDataLen);\n    case PixelFormat::RGB888:\n        return convertRGB888ToFormat(data, dataLen, format, outData, outDataLen);\n    case PixelFormat::RGBA8888:\n        return convertRGBA8888ToFormat(data, dataLen, format, outData, outDataLen);\n    default:\n        CCLOG(\"unsupport convert for format %d to format %d\", originFormat, format);\n        *outData = (unsigned char*)data;\n        *outDataLen = dataLen;\n        return originFormat;\n    }\n}\n\n// implementation Texture2D (Text)\nbool Texture2D::initWithString(const char *text, const char *fontName, float fontSize, const Size& dimensions/* = Size(0, 0)*/, TextHAlignment hAlignment/* =  TextHAlignment::CENTER */, TextVAlignment vAlignment/* =  TextVAlignment::TOP */)\n{\n    FontDefinition tempDef;\n    \n    tempDef._shadow._shadowEnabled = false;\n    tempDef._stroke._strokeEnabled = false;\n   \n    \n    tempDef._fontName      = std::string(fontName);\n    tempDef._fontSize      = fontSize;\n    tempDef._dimensions    = dimensions;\n    tempDef._alignment     = hAlignment;\n    tempDef._vertAlignment = vAlignment;\n    tempDef._fontFillColor = Color3B::WHITE;\n\n    return initWithString(text, tempDef);\n}\n\nbool Texture2D::initWithString(const char *text, const FontDefinition& textDefinition)\n{\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    // cache the texture data\n    VolatileTextureMgr::addStringTexture(this, text, textDefinition);\n#endif\n\n    bool ret = false;\n    Image::TextAlign align;\n    \n    if (TextVAlignment::TOP == textDefinition._vertAlignment)\n    {\n        align = (TextHAlignment::CENTER == textDefinition._alignment) ? Image::TextAlign::TOP\n        : (TextHAlignment::LEFT == textDefinition._alignment) ? Image::TextAlign::TOP_LEFT : Image::TextAlign::TOP_RIGHT;\n    }\n    else if (TextVAlignment::CENTER == textDefinition._vertAlignment)\n    {\n        align = (TextHAlignment::CENTER == textDefinition._alignment) ? Image::TextAlign::CENTER\n        : (TextHAlignment::LEFT == textDefinition._alignment) ? Image::TextAlign::LEFT : Image::TextAlign::RIGHT;\n    }\n    else if (TextVAlignment::BOTTOM == textDefinition._vertAlignment)\n    {\n        align = (TextHAlignment::CENTER == textDefinition._alignment) ? Image::TextAlign::BOTTOM\n        : (TextHAlignment::LEFT == textDefinition._alignment) ? Image::TextAlign::BOTTOM_LEFT : Image::TextAlign::BOTTOM_RIGHT;\n    }\n    else\n    {\n        CCASSERT(false, \"Not supported alignment format!\");\n        return false;\n    }\n    \n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n\n    // handle shadow parameters\n    bool  shadowEnabled = false;\n    float shadowDX      = 0.0f;\n    float shadowDY      = 0.0f;\n    float shadowBlur    = 0.0f;\n    float shadowOpacity = 0.0f;\n    \n    if ( textDefinition._shadow._shadowEnabled )\n    {\n        shadowEnabled =  true;\n        shadowDX      = textDefinition._shadow._shadowOffset.width;\n        shadowDY      = textDefinition._shadow._shadowOffset.height;\n        shadowBlur    = textDefinition._shadow._shadowBlur;\n        shadowOpacity = textDefinition._shadow._shadowOpacity;\n    }\n    \n    // handle stroke parameters\n    bool strokeEnabled = false;\n    float strokeColorR = 0.0f;\n    float strokeColorG = 0.0f;\n    float strokeColorB = 0.0f;\n    float strokeSize   = 0.0f;\n    \n    if ( textDefinition._stroke._strokeEnabled )\n    {\n        strokeEnabled = true;\n        strokeColorR = textDefinition._stroke._strokeColor.r / 255.0f;\n        strokeColorG = textDefinition._stroke._strokeColor.g / 255.0f;\n        strokeColorB = textDefinition._stroke._strokeColor.b / 255.0f;\n        strokeSize   = textDefinition._stroke._strokeSize;\n    }\n    \n    Image* image = new Image();\n    do\n    {\n        CC_BREAK_IF(nullptr == image);\n        \n        ret = image->initWithStringShadowStroke(text,\n                                                  (int)textDefinition._dimensions.width,\n                                                  (int)textDefinition._dimensions.height,\n                                                  align,\n                                                  textDefinition._fontName.c_str(),\n                                                  textDefinition._fontSize,\n                                                  textDefinition._fontFillColor.r / 255.0f,\n                                                  textDefinition._fontFillColor.g / 255.0f,\n                                                  textDefinition._fontFillColor.b / 255.0f,\n                                                  shadowEnabled,\n                                                  shadowDX,\n                                                  shadowDY,\n                                                  shadowOpacity,\n                                                  shadowBlur,\n                                                  strokeEnabled,\n                                                  strokeColorR,\n                                                  strokeColorG,\n                                                  strokeColorB,\n                                                  strokeSize);\n        \n        \n        CC_BREAK_IF(!ret);\n        ret = initWithImage(image);\n        \n    } while (0);\n    \n    CC_SAFE_RELEASE(image);\n    \n    return ret;\n\n#else\n    bool requestUnsupported = textDefinition._shadow._shadowEnabled || textDefinition._stroke._strokeEnabled;\n\n    CCASSERT(requestUnsupported == false, \"Currently shadow and stroke only supported on iOS and Android!\");\n\n    Image* image = new Image();\n    do\n    {\n        CC_BREAK_IF(nullptr == image);\n        ret = image->initWithString(text, (int)textDefinition._dimensions.width, (int)textDefinition._dimensions.height, align, textDefinition._fontName.c_str(), (int)textDefinition._fontSize);\n        CC_BREAK_IF(!ret);\n        ret = initWithImage(image);\n    } while (0);\n    \n    CC_SAFE_RELEASE(image);\n\n    return ret;\n#endif\n}\n\n\n// implementation Texture2D (Drawing)\n\nvoid Texture2D::drawAtPoint(const Point& point)\n{\n    GLfloat    coordinates[] = {\n        0.0f,    _maxT,\n        _maxS,_maxT,\n        0.0f,    0.0f,\n        _maxS,0.0f };\n\n    GLfloat    width = (GLfloat)_pixelsWide * _maxS,\n        height = (GLfloat)_pixelsHigh * _maxT;\n\n    GLfloat        vertices[] = {    \n        point.x,            point.y,\n        width + point.x,    point.y,\n        point.x,            height  + point.y,\n        width + point.x,    height  + point.y };\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORDS );\n    _shaderProgram->use();\n    _shaderProgram->setUniformsForBuiltins();\n\n    GL::bindTexture2D( _name );\n\n\n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, 8 * sizeof(GLfloat), 0);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n\n    setGLBufferData(coordinates, 8 * sizeof(GLfloat), 1);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, coordinates);\n#endif // EMSCRIPTEN\n\n    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);\n}\n\nvoid Texture2D::drawInRect(const Rect& rect)\n{\n    GLfloat    coordinates[] = {    \n        0.0f,    _maxT,\n        _maxS,_maxT,\n        0.0f,    0.0f,\n        _maxS,0.0f };\n\n    GLfloat    vertices[] = {    rect.origin.x,        rect.origin.y,                            /*0.0f,*/\n        rect.origin.x + rect.size.width,        rect.origin.y,                            /*0.0f,*/\n        rect.origin.x,                            rect.origin.y + rect.size.height,        /*0.0f,*/\n        rect.origin.x + rect.size.width,        rect.origin.y + rect.size.height,        /*0.0f*/ };\n\n    GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_TEX_COORDS );\n    _shaderProgram->use();\n    _shaderProgram->setUniformsForBuiltins();\n\n    GL::bindTexture2D( _name );\n\n#ifdef EMSCRIPTEN\n    setGLBufferData(vertices, 8 * sizeof(GLfloat), 0);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, 0);\n\n    setGLBufferData(coordinates, 8 * sizeof(GLfloat), 1);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, 0);\n#else\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, 0, coordinates);\n#endif // EMSCRIPTEN\n    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);\n}\n\nvoid Texture2D::PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied)\n{\n    _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied;\n}\n\n    \n//\n// Use to apply MIN/MAG filter\n//\n// implementation Texture2D (GLFilter)\n\nvoid Texture2D::generateMipmap()\n{\n    CCASSERT(_pixelsWide == ccNextPOT(_pixelsWide) && _pixelsHigh == ccNextPOT(_pixelsHigh), \"Mipmap texture only works in POT textures\");\n    GL::bindTexture2D( _name );\n    glGenerateMipmap(GL_TEXTURE_2D);\n    _hasMipmaps = true;\n}\n\nbool Texture2D::hasMipmaps() const\n{\n    return _hasMipmaps;\n}\n\nvoid Texture2D::setTexParameters(const TexParams &texParams)\n{\n    CCASSERT((_pixelsWide == ccNextPOT(_pixelsWide) || texParams.wrapS == GL_CLAMP_TO_EDGE) &&\n        (_pixelsHigh == ccNextPOT(_pixelsHigh) || texParams.wrapT == GL_CLAMP_TO_EDGE),\n        \"GL_CLAMP_TO_EDGE should be used in NPOT dimensions\");\n\n    GL::bindTexture2D( _name );\n    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texParams.minFilter );\n    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texParams.magFilter );\n    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texParams.wrapS );\n    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texParams.wrapT );\n\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    VolatileTextureMgr::setTexParameters(this, texParams);\n#endif\n}\n\nvoid Texture2D::setAliasTexParameters()\n{\n    GL::bindTexture2D( _name );\n\n    if( ! _hasMipmaps )\n    {\n        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );\n    }\n    else\n    {\n        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST );\n    }\n\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    TexParams texParams = {(GLuint)(_hasMipmaps?GL_NEAREST_MIPMAP_NEAREST:GL_NEAREST),GL_NEAREST,GL_NONE,GL_NONE};\n    VolatileTextureMgr::setTexParameters(this, texParams);\n#endif\n}\n\nvoid Texture2D::setAntiAliasTexParameters()\n{\n    GL::bindTexture2D( _name );\n\n    if( ! _hasMipmaps )\n    {\n        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );\n    }\n    else\n    {\n        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );\n    }\n\n    glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    TexParams texParams = {(GLuint)(_hasMipmaps?GL_LINEAR_MIPMAP_NEAREST:GL_LINEAR),GL_LINEAR,GL_NONE,GL_NONE};\n    VolatileTextureMgr::setTexParameters(this, texParams);\n#endif\n}\n\nconst char* Texture2D::getStringForFormat() const\n{\n\tswitch (_pixelFormat) \n\t{\n\t\tcase Texture2D::PixelFormat::RGBA8888:\n\t\t\treturn  \"RGBA8888\";\n\n\t\tcase Texture2D::PixelFormat::RGB888:\n\t\t\treturn  \"RGB888\";\n\n\t\tcase Texture2D::PixelFormat::RGB565:\n\t\t\treturn  \"RGB565\";\n\n\t\tcase Texture2D::PixelFormat::RGBA4444:\n\t\t\treturn  \"RGBA4444\";\n\n\t\tcase Texture2D::PixelFormat::RGB5A1:\n\t\t\treturn  \"RGB5A1\";\n\n\t\tcase Texture2D::PixelFormat::AI88:\n\t\t\treturn  \"AI88\";\n\n\t\tcase Texture2D::PixelFormat::A8:\n\t\t\treturn  \"A8\";\n\n\t\tcase Texture2D::PixelFormat::I8:\n\t\t\treturn  \"I8\";\n\n\t\tcase Texture2D::PixelFormat::PVRTC4:\n\t\t\treturn  \"PVRTC4\";\n\n\t\tcase Texture2D::PixelFormat::PVRTC2:\n\t\t\treturn  \"PVRTC2\";\n\n\t\tdefault:\n\t\t\tCCASSERT(false , \"unrecognized pixel format\");\n\t\t\tCCLOG(\"stringForFormat: %ld, cannot give useful result\", (long)_pixelFormat);\n\t\t\tbreak;\n\t}\n\n\treturn  nullptr;\n}\n\n//\n// Texture options for images that contains alpha\n//\n// implementation Texture2D (PixelFormat)\n\nvoid Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat format)\n{\n    g_defaultAlphaPixelFormat = format;\n}\n\nTexture2D::PixelFormat Texture2D::getDefaultAlphaPixelFormat()\n{\n    return g_defaultAlphaPixelFormat;\n}\n\nunsigned int Texture2D::getBitsPerPixelForFormat(Texture2D::PixelFormat format) const\n{\n    if (format == PixelFormat::NONE)\n    {\n        return 0;\n    }\n    \n\treturn _pixelFormatInfoTables.at(format).bpp;\n}\n\nunsigned int Texture2D::getBitsPerPixelForFormat() const\n{\n\treturn this->getBitsPerPixelForFormat(_pixelFormat);\n}\n\nconst Texture2D::PixelFormatInfoMap& Texture2D::getPixelFormatInfoMap()\n{\n    return _pixelFormatInfoTables;\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTexture2D.h",
    "content": "/****************************************************************************\nCopyright (c) 2008      Apple Inc. All Rights Reserved.\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTEXTURE2D_H__\n#define __CCTEXTURE2D_H__\n\n#include <string>\n#include <map>\n#include <map>\n\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n#include \"ccTypes.h\"\n#ifdef EMSCRIPTEN\n#include \"CCGLBufferedNode.h\"\n#endif // EMSCRIPTEN\n\nNS_CC_BEGIN\n\nclass Image;\ntypedef struct _MipmapInfo MipmapInfo;\n\n/**\n * @addtogroup textures\n * @{\n */\n\n//CONSTANTS:\n\nclass GLProgram;\n\n//CLASS INTERFACES:\n\n/** @brief Texture2D class.\n* This class allows to easily create OpenGL 2D textures from images, text or raw data.\n* The created Texture2D object will always have power-of-two dimensions.\n* Depending on how you create the Texture2D object, the actual image area of the texture might be smaller than the texture dimensions i.e. \"contentSize\" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0).\n* Be aware that the content of the generated textures will be upside-down!\n*/\nclass CC_DLL Texture2D : public Object\n#ifdef EMSCRIPTEN\n, public GLBufferedNode\n#endif // EMSCRIPTEN\n{\npublic:\n    /** @typedef Texture2D::PixelFormat\n     Possible texture pixel formats\n     */\n    enum class PixelFormat\n    {\n        //! auto detect the type\n        AUTO,\n        //! 32-bit texture: BGRA8888\n        BGRA8888,\n        //! 32-bit texture: RGBA8888\n        RGBA8888,\n        //! 24-bit texture: RGBA888\n        RGB888,\n        //! 16-bit texture without Alpha channel\n        RGB565,\n        //! 8-bit textures used as masks\n        A8,\n        //! 8-bit intensity texture\n        I8,\n        //! 16-bit textures used as masks\n        AI88,\n        //! 16-bit textures: RGBA4444\n        RGBA4444,\n        //! 16-bit textures: RGB5A1\n        RGB5A1,\n        //! 4-bit PVRTC-compressed texture: PVRTC4\n        PVRTC4,\n        //! 4-bit PVRTC-compressed texture: PVRTC4 (has alpha channel)\n        PVRTC4A,\n        //! 2-bit PVRTC-compressed texture: PVRTC2\n        PVRTC2,\n        //! 2-bit PVRTC-compressed texture: PVRTC2 (has alpha channel)\n        PVRTC2A,\n        //! ETC-compressed texture: ETC\n        ETC,\n        //! S3TC-compressed texture: S3TC_Dxt1\n        S3TC_DXT1,\n        //! S3TC-compressed texture: S3TC_Dxt3\n        S3TC_DXT3,\n        //! S3TC-compressed texture: S3TC_Dxt5\n        S3TC_DXT5,\n        //! ATITC-compressed texture: ATC_RGB\n        ATC_RGB,\n        //! ATITC-compressed texture: ATC_EXPLICIT_ALPHA\n        ATC_EXPLICIT_ALPHA,\n        //! ATITC-compresed texture: ATC_INTERPOLATED_ALPHA\n        ATC_INTERPOLATED_ALPHA,\n        //! Default texture format: AUTO\n        DEFAULT = AUTO,\n        \n        NONE = -1\n    };\n    \n    \n    struct PixelFormatInfo {\n\n        PixelFormatInfo(GLenum anInternalFormat, GLenum aFormat, GLenum aType, int aBpp, bool aCompressed, bool anAlpha)\n            : internalFormat(anInternalFormat)\n            , format(aFormat)\n            , type(aType)\n            , bpp(aBpp)\n            , compressed(aCompressed)\n            , alpha(anAlpha)\n        {}\n\n        GLenum internalFormat;\n        GLenum format;\n        GLenum type;\n        int bpp;\n        bool compressed;\n        bool alpha;\n    };\n    \n    typedef std::map<Texture2D::PixelFormat, const PixelFormatInfo> PixelFormatInfoMap;\n    \n    /**\n     Extension to set the Min / Mag filter\n     */\n    typedef struct _TexParams {\n        GLuint    minFilter;\n        GLuint    magFilter;\n        GLuint    wrapS;\n        GLuint    wrapT;\n    }TexParams;\n    \npublic:\n    /** sets the default pixel format for UIImagescontains alpha channel.\n     If the UIImage contains alpha channel, then the options are:\n     - generate 32-bit textures: Texture2D::PixelFormat::RGBA8888 (default one)\n     - generate 24-bit textures: Texture2D::PixelFormat::RGB888\n     - generate 16-bit textures: Texture2D::PixelFormat::RGBA4444\n     - generate 16-bit textures: Texture2D::PixelFormat::RGB5A1\n     - generate 16-bit textures: Texture2D::PixelFormat::RGB565\n     - generate 8-bit textures: Texture2D::PixelFormat::A8 (only use it if you use just 1 color)\n\n     How does it work ?\n     - If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture)\n     - If the image is an RGB (without Alpha) then: If the default pixel format is RGBA8888 then a RGBA8888 (32-bit) will be used. Otherwise a RGB565 (16-bit texture) will be used.\n\n     This parameter is not valid for PVR / PVR.CCZ images.\n\n     @since v0.8\n     */\n    static void setDefaultAlphaPixelFormat(Texture2D::PixelFormat format);\n\n    /** returns the alpha pixel format\n     @since v0.8\n     */\n    static Texture2D::PixelFormat getDefaultAlphaPixelFormat();\n    CC_DEPRECATED_ATTRIBUTE static Texture2D::PixelFormat defaultAlphaPixelFormat() { return Texture2D::getDefaultAlphaPixelFormat(); };\n\n    /** treats (or not) PVR files as if they have alpha premultiplied.\n     Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is\n     possible load them as if they have (or not) the alpha channel premultiplied.\n\n     By default it is disabled.\n\n     @since v0.99.5\n     */\n    static void PVRImagesHavePremultipliedAlpha(bool haveAlphaPremultiplied);\n    \npublic:\n    /**\n     * @js ctor\n     */\n    Texture2D();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Texture2D();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual std::string getDescription() const;\n\n    /** These functions are needed to create mutable textures\n     * @js NA\n     * @lua NA\n     */\n    void releaseData(void *data);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void* keepData(void *data, unsigned int length);\n\n    /** Initializes with a texture2d with data \n     * @js NA\n     * @lua NA\n     */\n    bool initWithData(const void *data, ssize_t dataLen, Texture2D::PixelFormat pixelFormat, int pixelsWide, int pixelsHigh, const Size& contentSize);\n\n    /** Initializes with mipmaps */\n    bool initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, Texture2D::PixelFormat pixelFormat, int pixelsWide, int pixelsHigh);\n\n    /**\n    Drawing extensions to make it easy to draw basic quads using a Texture2D object.\n    These functions require GL_TEXTURE_2D and both GL_VERTEX_ARRAY and GL_TEXTURE_COORD_ARRAY client states to be enabled.\n    */\n    /** draws a texture at a given point */\n    void drawAtPoint(const Point& point);\n    /** draws a texture inside a rect */\n    void drawInRect(const Rect& rect);\n\n    /**\n    Extensions to make it easy to create a Texture2D object from an image file.\n    */\n    /** \n\tInitializes a texture from a UIImage object.\n    We will use the format you specified with setDefaultAlphaPixelFormat to convert the image for texture.\n    NOTE: It will not convert the pvr image file.\n\t*/\n    bool initWithImage(Image * image);\n    \n    /** \n\tInitializes a texture from a UIImage object.\n\twe will use the format you passed to the function to convert the image format to the texture format.\n    If you pass PixelFormat::Automatic, we will auto detect the image render type and use that type for texture to render.\n    **/\n    bool initWithImage(Image * image, PixelFormat format);\n\n    /** Initializes a texture from a string with dimensions, alignment, font name and font size */\n    bool initWithString(const char *text,  const char *fontName, float fontSize, const Size& dimensions = Size(0, 0), TextHAlignment hAlignment = TextHAlignment::CENTER, TextVAlignment vAlignment = TextVAlignment::TOP);\n    /** Initializes a texture from a string using a text definition*/\n    bool initWithString(const char *text, const FontDefinition& textDefinition);\n\n    /** sets the min filter, mag filter, wrap s and wrap t texture parameters.\n    If the texture size is NPOT (non power of 2), then in can only use GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}.\n\n    @warning Calling this method could allocate additional texture memory.\n\n    @since v0.8\n    * @code \n    * When this function bound into js or lua,the input parameter will be changed\n    * In js: var setBlendFunc(var arg1, var arg2, var arg3, var arg4)\n    * In lua: local setBlendFunc(local arg1, local arg2, local arg3, local arg4)\n    * @endcode\n    */\n    void setTexParameters(const TexParams& texParams);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE void setTexParameters(const TexParams* texParams) { return setTexParameters(*texParams); };\n\n    /** sets antialias texture parameters:\n    - GL_TEXTURE_MIN_FILTER = GL_LINEAR\n    - GL_TEXTURE_MAG_FILTER = GL_LINEAR\n\n    @warning Calling this method could allocate additional texture memory.\n\n    @since v0.8\n    */\n    void setAntiAliasTexParameters();\n\n    /** sets alias texture parameters:\n    - GL_TEXTURE_MIN_FILTER = GL_NEAREST\n    - GL_TEXTURE_MAG_FILTER = GL_NEAREST\n\n    @warning Calling this method could allocate additional texture memory.\n\n    @since v0.8\n    */\n    void setAliasTexParameters();\n\n\n    /** Generates mipmap images for the texture.\n    It only works if the texture size is POT (power of 2).\n    @since v0.99.0\n    */\n    void generateMipmap();\n\n    /** returns the pixel format.\n     @since v2.0\n     */\n    const char* getStringForFormat() const;\n    CC_DEPRECATED_ATTRIBUTE const char* stringForFormat() const { return getStringForFormat(); };\n\n    /** returns the bits-per-pixel of the in-memory OpenGL texture\n    @since v1.0\n    */\n    unsigned int getBitsPerPixelForFormat() const;\n    CC_DEPRECATED_ATTRIBUTE unsigned int bitsPerPixelForFormat() const { return getBitsPerPixelForFormat(); };\n\n    /** Helper functions that returns bits per pixels for a given format.\n     @since v2.0\n     */\n    unsigned int getBitsPerPixelForFormat(Texture2D::PixelFormat format) const;\n    CC_DEPRECATED_ATTRIBUTE unsigned int bitsPerPixelForFormat(Texture2D::PixelFormat format) const { return getBitsPerPixelForFormat(format); };\n\n    /** content size */\n    const Size& getContentSizeInPixels();\n\n    bool hasPremultipliedAlpha() const;\n    bool hasMipmaps() const;\n\n    /** Gets the pixel format of the texture */\n    Texture2D::PixelFormat getPixelFormat() const;\n    \n    /** Gets the width of the texture in pixels */\n    int getPixelsWide() const;\n    \n    /** Gets the height of the texture in pixels */\n    int getPixelsHigh() const;\n    \n    /** Gets the texture name */\n    GLuint getName() const;\n    \n    /** Gets max S */\n    GLfloat getMaxS() const;\n    /** Sets max S */\n    void setMaxS(GLfloat maxS);\n    \n    /** Gets max T */\n    GLfloat getMaxT() const;\n    /** Sets max T */\n    void setMaxT(GLfloat maxT);\n    \n    Size getContentSize() const;\n    \n    void setShaderProgram(GLProgram* program);\n    GLProgram* getShaderProgram() const;\n    \npublic:\n    static const PixelFormatInfoMap& getPixelFormatInfoMap();\n    \nprivate:\n\n    /**convert functions*/\n\n    /**\n    Convert the format to the format param you specified, if the format is PixelFormat::Automatic, it will detect it automatically and convert to the closest format for you.\n    It will return the converted format to you. if the outData != data, you must delete it manually.\n    */\n    static PixelFormat convertDataToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat originFormat, PixelFormat format, unsigned char** outData, ssize_t* outDataLen);\n\n    static PixelFormat convertI8ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen);\n    static PixelFormat convertAI88ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen);\n    static PixelFormat convertRGB888ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen);\n    static PixelFormat convertRGBA8888ToFormat(const unsigned char* data, ssize_t dataLen, PixelFormat format, unsigned char** outData, ssize_t* outDataLen);\n\n    //I8 to XXX\n    static void convertI8ToRGB888(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertI8ToRGBA8888(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertI8ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertI8ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertI8ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertI8ToAI88(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n\n    //AI88 to XXX\n    static void convertAI88ToRGB888(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertAI88ToRGBA8888(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertAI88ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertAI88ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertAI88ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertAI88ToA8(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertAI88ToI8(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n\n    //RGB888 to XXX\n    static void convertRGB888ToRGBA8888(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGB888ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGB888ToI8(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGB888ToAI88(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGB888ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGB888ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n\n    //RGBA8888 to XXX\n    static void convertRGBA8888ToRGB888(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGBA8888ToRGB565(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGBA8888ToI8(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGBA8888ToA8(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGBA8888ToAI88(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGBA8888ToRGBA4444(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n    static void convertRGBA8888ToRGB5A1(const unsigned char* data, ssize_t dataLen, unsigned char* outData);\n\nprotected:\n    /** pixel format of the texture */\n    Texture2D::PixelFormat _pixelFormat;\n\n    /** width in pixels */\n    int _pixelsWide;\n\n    /** height in pixels */\n    int _pixelsHigh;\n\n    /** texture name */\n    GLuint _name;\n\n    /** texture max S */\n    GLfloat _maxS;\n    \n    /** texture max T */\n    GLfloat _maxT;\n\n    /** content size */\n    Size _contentSize;\n\n    /** whether or not the texture has their Alpha premultiplied */\n    bool _hasPremultipliedAlpha;\n\n    bool _hasMipmaps;\n\n    /** shader program used by drawAtPoint and drawInRect */\n    GLProgram* _shaderProgram;\n\n    static const PixelFormatInfoMap _pixelFormatInfoTables;\n};\n\n\n// end of textures group\n/// @}\n\nNS_CC_END\n\n#endif //__CCTEXTURE2D_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTextureAtlas.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n// cocos2d\n#include \"CCTextureAtlas.h\"\n#include \"CCTextureCache.h\"\n#include \"ccMacros.h\"\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCEventType.h\"\n#include \"CCDirector.h\"\n#include \"CCGL.h\"\n#include \"CCConfiguration.h\"\n// support\n#include \"CCTexture2D.h\"\n#include \"CCString.h\"\n#include <stdlib.h>\n#include \"CCEventDispatcher.h\"\n#include \"CCEventListenerCustom.h\"\n\n//According to some tests GL_TRIANGLE_STRIP is slower, MUCH slower. Probably I'm doing something very wrong\n\n// implementation TextureAtlas\n\nNS_CC_BEGIN\n\nTextureAtlas::TextureAtlas()\n    :_indices(nullptr)\n    ,_dirty(false)\n    ,_texture(nullptr)\n    ,_quads(nullptr)\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    ,_backToForegroundlistener(nullptr)\n#endif\n{}\n\nTextureAtlas::~TextureAtlas()\n{\n    CCLOGINFO(\"deallocing TextureAtlas: %p\", this);\n\n    CC_SAFE_FREE(_quads);\n    CC_SAFE_FREE(_indices);\n\n    glDeleteBuffers(2, _buffersVBO);\n\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        glDeleteVertexArrays(1, &_VAOname);\n        GL::bindVAO(0);\n    }\n    CC_SAFE_RELEASE(_texture);\n    \n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundlistener);\n#endif\n}\n\nssize_t TextureAtlas::getTotalQuads() const\n{\n    return _totalQuads;\n}\n\nssize_t TextureAtlas::getCapacity() const\n{\n    return _capacity;\n}\n\nTexture2D* TextureAtlas::getTexture() const\n{\n    return _texture;\n}\n\nvoid TextureAtlas::setTexture(Texture2D * var)\n{\n    CC_SAFE_RETAIN(var);\n    CC_SAFE_RELEASE(_texture);\n    _texture = var;\n}\n\nV3F_C4B_T2F_Quad* TextureAtlas::getQuads()\n{\n    //if someone accesses the quads directly, presume that changes will be made\n    _dirty = true;\n    return _quads;\n}\n\nvoid TextureAtlas::setQuads(V3F_C4B_T2F_Quad* quads)\n{\n    _quads = quads;\n}\n\n// TextureAtlas - alloc & init\n\nTextureAtlas * TextureAtlas::create(const std::string& file, ssize_t capacity)\n{\n    TextureAtlas * textureAtlas = new TextureAtlas();\n    if(textureAtlas && textureAtlas->initWithFile(file, capacity))\n    {\n        textureAtlas->autorelease();\n        return textureAtlas;\n    }\n    CC_SAFE_DELETE(textureAtlas);\n    return nullptr;\n}\n\nTextureAtlas * TextureAtlas::createWithTexture(Texture2D *texture, ssize_t capacity)\n{\n    TextureAtlas * textureAtlas = new TextureAtlas();\n    if (textureAtlas && textureAtlas->initWithTexture(texture, capacity))\n    {\n        textureAtlas->autorelease();\n        return textureAtlas;\n    }\n    CC_SAFE_DELETE(textureAtlas);\n    return nullptr;\n}\n\nbool TextureAtlas::initWithFile(const std::string& file, ssize_t capacity)\n{\n    // retained in property\n    Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(file);\n\n    if (texture)\n    {   \n        return initWithTexture(texture, capacity);\n    }\n    else\n    {\n        CCLOG(\"cocos2d: Could not open file: %s\", file.c_str());\n        return false;\n    }\n}\n\nbool TextureAtlas::initWithTexture(Texture2D *texture, ssize_t capacity)\n{\n    CCASSERT(capacity>=0, \"Capacity must be >= 0\");\n    \n//    CCASSERT(texture != nullptr, \"texture should not be null\");\n    _capacity = capacity;\n    _totalQuads = 0;\n\n    // retained in property\n    this->_texture = texture;\n    CC_SAFE_RETAIN(_texture);\n\n    // Re-initialization is not allowed\n    CCASSERT(_quads == nullptr && _indices == nullptr, \"\");\n\n    _quads = (V3F_C4B_T2F_Quad*)malloc( _capacity * sizeof(V3F_C4B_T2F_Quad) );\n    _indices = (GLushort *)malloc( _capacity * 6 * sizeof(GLushort) );\n    \n    if( ! ( _quads && _indices) && _capacity > 0) \n    {\n        //CCLOG(\"cocos2d: TextureAtlas: not enough memory\");\n        CC_SAFE_FREE(_quads);\n        CC_SAFE_FREE(_indices);\n\n        // release texture, should set it to null, because the destruction will\n        // release it too. see cocos2d-x issue #484\n        CC_SAFE_RELEASE_NULL(_texture);\n        return false;\n    }\n\n    memset( _quads, 0, _capacity * sizeof(V3F_C4B_T2F_Quad) );\n    memset( _indices, 0, _capacity * 6 * sizeof(GLushort) );\n    \n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    // listen the event when app go to background\n    _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(TextureAtlas::listenBackToForeground, this));\n    Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1);\n#endif\n    \n    this->setupIndices();\n\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        setupVBOandVAO();\n    }\n    else\n    {\n        setupVBO();\n    }\n\n    _dirty = true;\n\n    return true;\n}\n\nvoid TextureAtlas::listenBackToForeground(EventCustom* event)\n{  \n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        setupVBOandVAO();\n    }\n    else\n    {\n        setupVBO();\n    }\n    \n    // set _dirty to true to force it rebinding buffer\n    _dirty = true;\n}\n\nstd::string TextureAtlas::getDescription() const\n{\n    return StringUtils::format(\"<TextureAtlas | totalQuads = %d>\", static_cast<int>(_totalQuads));\n}\n\n\nvoid TextureAtlas::setupIndices()\n{\n    if (_capacity == 0)\n        return;\n\n    for( int i=0; i < _capacity; i++)\n    {\n#if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP\n        _indices[i*6+0] = i*4+0;\n        _indices[i*6+1] = i*4+0;\n        _indices[i*6+2] = i*4+2;        \n        _indices[i*6+3] = i*4+1;\n        _indices[i*6+4] = i*4+3;\n        _indices[i*6+5] = i*4+3;\n#else\n        _indices[i*6+0] = i*4+0;\n        _indices[i*6+1] = i*4+1;\n        _indices[i*6+2] = i*4+2;\n\n        // inverted index. issue #179\n        _indices[i*6+3] = i*4+3;\n        _indices[i*6+4] = i*4+2;\n        _indices[i*6+5] = i*4+1;        \n#endif    \n    }\n}\n\n//TextureAtlas - VAO / VBO specific\n\nvoid TextureAtlas::setupVBOandVAO()\n{\n    glGenVertexArrays(1, &_VAOname);\n    GL::bindVAO(_VAOname);\n\n#define kQuadSize sizeof(_quads[0].bl)\n\n    glGenBuffers(2, &_buffersVBO[0]);\n\n    glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n    glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _capacity, _quads, GL_DYNAMIC_DRAW);\n\n    // vertices\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, vertices));\n\n    // colors\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, colors));\n\n    // tex coords\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, texCoords));\n\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _capacity * 6, _indices, GL_STATIC_DRAW);\n\n    // Must unbind the VAO before changing the element buffer.\n    GL::bindVAO(0);\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\nvoid TextureAtlas::setupVBO()\n{\n    glGenBuffers(2, &_buffersVBO[0]);\n\n    mapBuffers();\n}\n\nvoid TextureAtlas::mapBuffers()\n{\n    // Avoid changing the element buffer for whatever VAO might be bound.\n\tGL::bindVAO(0);\n    \n    glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n    glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _capacity, _quads, GL_DYNAMIC_DRAW);\n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _capacity * 6, _indices, GL_STATIC_DRAW);\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\n// TextureAtlas - Update, Insert, Move & Remove\n\nvoid TextureAtlas::updateQuad(V3F_C4B_T2F_Quad *quad, ssize_t index)\n{\n    CCASSERT( index >= 0 && index < _capacity, \"updateQuadWithTexture: Invalid index\");\n\n    _totalQuads = MAX( index+1, _totalQuads);\n\n    _quads[index] = *quad;    \n\n\n    _dirty = true;\n\n}\n\nvoid TextureAtlas::insertQuad(V3F_C4B_T2F_Quad *quad, ssize_t index)\n{\n    CCASSERT( index>=0 && index<_capacity, \"insertQuadWithTexture: Invalid index\");\n\n    _totalQuads++;\n    CCASSERT( _totalQuads <= _capacity, \"invalid totalQuads\");\n\n    // issue #575. index can be > totalQuads\n    auto remaining = (_totalQuads-1) - index;\n\n    // last object doesn't need to be moved\n    if( remaining > 0) \n    {\n        // texture coordinates\n        memmove( &_quads[index+1],&_quads[index], sizeof(_quads[0]) * remaining );        \n    }\n\n    _quads[index] = *quad;\n\n\n    _dirty = true;\n\n}\n\nvoid TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, ssize_t index, ssize_t amount)\n{\n    CCASSERT(index>=0 && amount>=0 && index+amount<=_capacity, \"insertQuadWithTexture: Invalid index + amount\");\n\n    _totalQuads += amount;\n\n    CCASSERT( _totalQuads <= _capacity, \"invalid totalQuads\");\n\n    // issue #575. index can be > totalQuads\n    auto remaining = (_totalQuads-1) - index - amount;\n\n    // last object doesn't need to be moved\n    if( remaining > 0)\n    {\n        // tex coordinates\n        memmove( &_quads[index+amount],&_quads[index], sizeof(_quads[0]) * remaining );\n    }\n\n\n    auto max = index + amount;\n    int j = 0;\n    for (ssize_t i = index; i < max ; i++)\n    {\n        _quads[index] = quads[j];\n        index++;\n        j++;\n    }\n\n    _dirty = true;\n}\n\nvoid TextureAtlas::insertQuadFromIndex(ssize_t oldIndex, ssize_t newIndex)\n{\n    CCASSERT( newIndex >= 0 && newIndex < _totalQuads, \"insertQuadFromIndex:atIndex: Invalid index\");\n    CCASSERT( oldIndex >= 0 && oldIndex < _totalQuads, \"insertQuadFromIndex:atIndex: Invalid index\");\n\n    if( oldIndex == newIndex )\n    {\n        return;\n    }\n    // because it is ambiguous in iphone, so we implement abs ourselves\n    // unsigned int howMany = abs( oldIndex - newIndex);\n    auto howMany = (oldIndex - newIndex) > 0 ? (oldIndex - newIndex) :  (newIndex - oldIndex);\n    auto dst = oldIndex;\n    auto src = oldIndex + 1;\n    if( oldIndex > newIndex)\n    {\n        dst = newIndex+1;\n        src = newIndex;\n    }\n\n    // texture coordinates\n    V3F_C4B_T2F_Quad quadsBackup = _quads[oldIndex];\n    memmove( &_quads[dst],&_quads[src], sizeof(_quads[0]) * howMany );\n    _quads[newIndex] = quadsBackup;\n\n\n    _dirty = true;\n}\n\nvoid TextureAtlas::removeQuadAtIndex(ssize_t index)\n{\n    CCASSERT( index>=0 && index<_totalQuads, \"removeQuadAtIndex: Invalid index\");\n\n    auto remaining = (_totalQuads-1) - index;\n\n    // last object doesn't need to be moved\n    if( remaining ) \n    {\n        // texture coordinates\n        memmove( &_quads[index],&_quads[index+1], sizeof(_quads[0]) * remaining );\n    }\n\n    _totalQuads--;\n\n\n    _dirty = true;\n}\n\nvoid TextureAtlas::removeQuadsAtIndex(ssize_t index, ssize_t amount)\n{\n    CCASSERT(index>=0 && amount>=0 && index+amount<=_totalQuads, \"removeQuadAtIndex: index + amount out of bounds\");\n\n    auto remaining = (_totalQuads) - (index + amount);\n\n    _totalQuads -= amount;\n\n    if ( remaining )\n    {\n        memmove( &_quads[index], &_quads[index+amount], sizeof(_quads[0]) * remaining );\n    }\n\n    _dirty = true;\n}\n\nvoid TextureAtlas::removeAllQuads()\n{\n    _totalQuads = 0;\n}\n\n// TextureAtlas - Resize\nbool TextureAtlas::resizeCapacity(ssize_t newCapacity)\n{\n    CCASSERT(newCapacity>=0, \"capacity >= 0\");\n    if( newCapacity == _capacity )\n    {\n        return true;\n    }\n    auto oldCapactiy = _capacity;\n    // update capacity and totolQuads\n    _totalQuads = MIN(_totalQuads, newCapacity);\n    _capacity = newCapacity;\n\n    V3F_C4B_T2F_Quad* tmpQuads = nullptr;\n    GLushort* tmpIndices = nullptr;\n    \n    // when calling initWithTexture(fileName, 0) on bada device, calloc(0, 1) will fail and return nullptr,\n    // so here must judge whether _quads and _indices is nullptr.\n    if (_quads == nullptr)\n    {\n        tmpQuads = (V3F_C4B_T2F_Quad*)malloc( _capacity * sizeof(_quads[0]) );\n        if (tmpQuads != nullptr)\n        {\n            memset(tmpQuads, 0, _capacity * sizeof(_quads[0]) );\n        }\n    }\n    else\n    {\n        tmpQuads = (V3F_C4B_T2F_Quad*)realloc( _quads, sizeof(_quads[0]) * _capacity );\n        if (tmpQuads != nullptr && _capacity > oldCapactiy)\n        {\n            memset(tmpQuads+oldCapactiy, 0, (_capacity - oldCapactiy)*sizeof(_quads[0]) );\n        }\n    }\n\n    if (_indices == nullptr)\n    {    \n        tmpIndices = (GLushort*)malloc( _capacity * 6 * sizeof(_indices[0]) );\n        if (tmpIndices != nullptr)\n        {\n            memset( tmpIndices, 0, _capacity * 6 * sizeof(_indices[0]) );\n        }\n        \n    }\n    else\n    {\n        tmpIndices = (GLushort*)realloc( _indices, sizeof(_indices[0]) * _capacity * 6 );\n        if (tmpIndices != nullptr && _capacity > oldCapactiy)\n        {\n            memset( tmpIndices+oldCapactiy, 0, (_capacity-oldCapactiy) * 6 * sizeof(_indices[0]) );\n        }\n    }\n\n    if( ! ( tmpQuads && tmpIndices) ) {\n        CCLOG(\"cocos2d: TextureAtlas: not enough memory\");\n        CC_SAFE_FREE(tmpQuads);\n        CC_SAFE_FREE(tmpIndices);\n        CC_SAFE_FREE(_quads);\n        CC_SAFE_FREE(_indices);\n        _capacity = _totalQuads = 0;\n        return false;\n    }\n\n    _quads = tmpQuads;\n    _indices = tmpIndices;\n\n\n    setupIndices();\n    mapBuffers();\n\n    _dirty = true;\n\n    return true;\n}\n\nvoid TextureAtlas::increaseTotalQuadsWith(ssize_t amount)\n{\n    CCASSERT(amount>=0, \"amount >= 0\");\n    _totalQuads += amount;\n}\n\nvoid TextureAtlas::moveQuadsFromIndex(ssize_t oldIndex, ssize_t amount, ssize_t newIndex)\n{\n    CCASSERT(oldIndex>=0 && amount>=0 && newIndex>=0, \"values must be >= 0\");\n    CCASSERT(newIndex + amount <= _totalQuads, \"insertQuadFromIndex:atIndex: Invalid index\");\n    CCASSERT(oldIndex < _totalQuads, \"insertQuadFromIndex:atIndex: Invalid index\");\n\n    if( oldIndex == newIndex )\n    {\n        return;\n    }\n    //create buffer\n    size_t quadSize = sizeof(V3F_C4B_T2F_Quad);\n    V3F_C4B_T2F_Quad* tempQuads = (V3F_C4B_T2F_Quad*)malloc( quadSize * amount);\n    memcpy( tempQuads, &_quads[oldIndex], quadSize * amount );\n\n    if (newIndex < oldIndex)\n    {\n        // move quads from newIndex to newIndex + amount to make room for buffer\n        memmove( &_quads[newIndex], &_quads[newIndex+amount], (oldIndex-newIndex)*quadSize);\n    }\n    else\n    {\n        // move quads above back\n        memmove( &_quads[oldIndex], &_quads[oldIndex+amount], (newIndex-oldIndex)*quadSize);\n    }\n    memcpy( &_quads[newIndex], tempQuads, amount*quadSize);\n\n    free(tempQuads);\n\n    _dirty = true;\n}\n\nvoid TextureAtlas::moveQuadsFromIndex(ssize_t index, ssize_t newIndex)\n{\n    CCASSERT(index>=0 && newIndex>=0, \"values must be >= 0\");\n    CCASSERT(newIndex + (_totalQuads - index) <= _capacity, \"moveQuadsFromIndex move is out of bounds\");\n\n    memmove(_quads + newIndex,_quads + index, (_totalQuads - index) * sizeof(_quads[0]));\n}\n\nvoid TextureAtlas::fillWithEmptyQuadsFromIndex(ssize_t index, ssize_t amount)\n{\n    CCASSERT(index>=0 && amount>=0, \"values must be >= 0\");\n    V3F_C4B_T2F_Quad quad;\n    memset(&quad, 0, sizeof(quad));\n\n    auto to = index + amount;\n    for (ssize_t i = index ; i < to ; i++)\n    {\n        _quads[i] = quad;\n    }\n}\n\n// TextureAtlas - Drawing\n\nvoid TextureAtlas::drawQuads()\n{\n    this->drawNumberOfQuads(_totalQuads, 0);\n}\n\nvoid TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads)\n{\n    CCASSERT(numberOfQuads>=0, \"numberOfQuads must be >= 0\");\n    this->drawNumberOfQuads(numberOfQuads, 0);\n}\n\nvoid TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start)\n{\n    CCASSERT(numberOfQuads>=0 && start>=0, \"numberOfQuads and start must be >= 0\");\n\n    if(!numberOfQuads)\n        return;\n\n    GL::bindTexture2D(_texture->getName());\n\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        //\n        // Using VBO and VAO\n        //\n\n        // XXX: update is done in draw... perhaps it should be done in a timer\n        if (_dirty) \n        {\n            glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n            // option 1: subdata\n//            glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] );\n\n            // option 2: data\n//            glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW);\n\n            // option 3: orphaning + glMapBuffer\n            glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (numberOfQuads-start), nullptr, GL_DYNAMIC_DRAW);\n            void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);\n            memcpy(buf, _quads, sizeof(_quads[0])* (numberOfQuads-start));\n            glUnmapBuffer(GL_ARRAY_BUFFER);\n            \n            glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n            _dirty = false;\n        }\n\n        GL::bindVAO(_VAOname);\n\n#if CC_REBIND_INDICES_BUFFER\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n#endif\n\n#if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP\n        glDrawElements(GL_TRIANGLE_STRIP, (GLsizei) numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) );\n#else\n        glDrawElements(GL_TRIANGLES, (GLsizei) numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) );\n#endif // CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP\n\n#if CC_REBIND_INDICES_BUFFER\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n#endif\n\n//    glBindVertexArray(0);\n    }\n    else\n    {\n        //\n        // Using VBO without VAO\n        //\n\n#define kQuadSize sizeof(_quads[0].bl)\n        glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n\n        // XXX: update is done in draw... perhaps it should be done in a timer\n        if (_dirty) \n        {\n            glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * numberOfQuads , &_quads[start] );\n            _dirty = false;\n        }\n\n        GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);\n\n        // vertices\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, vertices));\n\n        // colors\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, colors));\n\n        // tex coords\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, texCoords));\n\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n\n#if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP\n        glDrawElements(GL_TRIANGLE_STRIP, (GLsizei)numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])));\n#else\n        glDrawElements(GL_TRIANGLES, (GLsizei)numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])));\n#endif // CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP\n\n        glBindBuffer(GL_ARRAY_BUFFER, 0);\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n    }\n\n    CC_INCREMENT_GL_DRAWS(1);\n    CHECK_GL_ERROR_DEBUG();\n}\n\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTextureAtlas.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTEXTURE_ATLAS_H__\n#define __CCTEXTURE_ATLAS_H__\n\n#include \"ccTypes.h\"\n#include \"CCObject.h\"\n#include \"ccConfig.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass Texture2D;\nclass EventCustom;\nclass EventListenerCustom;\n\n/**\n * @addtogroup textures\n * @{\n */\n\n/** @brief A class that implements a Texture Atlas.\nSupported features:\n* The atlas file can be a PVRTC, PNG or any other format supported by Texture2D\n* Quads can be updated in runtime\n* Quads can be added in runtime\n* Quads can be removed in runtime\n* Quads can be re-ordered in runtime\n* The TextureAtlas capacity can be increased or decreased in runtime\n* OpenGL component: V3F, C4B, T2F.\nThe quads are rendered using an OpenGL ES VBO.\nTo render the quads using an interleaved vertex array list, you should modify the ccConfig.h file \n*/\nclass CC_DLL TextureAtlas : public Object \n{\npublic:\n    /** creates a TextureAtlas with an filename and with an initial capacity for Quads.\n     * The TextureAtlas capacity can be increased in runtime.\n     */\n    static TextureAtlas* create(const std::string& file , ssize_t capacity);\n\n    /** creates a TextureAtlas with a previously initialized Texture2D object, and\n     * with an initial capacity for n Quads.\n     * The TextureAtlas capacity can be increased in runtime.\n     */\n    static TextureAtlas* createWithTexture(Texture2D *texture, ssize_t capacity);\n    /**\n     * @js ctor\n     */\n    TextureAtlas();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TextureAtlas();\n\n    /** initializes a TextureAtlas with a filename and with a certain capacity for Quads.\n    * The TextureAtlas capacity can be increased in runtime.\n    *\n    * WARNING: Do not reinitialize the TextureAtlas because it will leak memory (issue #706)\n    */\n    bool initWithFile(const std::string& file, ssize_t capacity);\n\n    /** initializes a TextureAtlas with a previously initialized Texture2D object, and\n    * with an initial capacity for Quads. \n    * The TextureAtlas capacity can be increased in runtime.\n    *\n    * WARNING: Do not reinitialize the TextureAtlas because it will leak memory (issue #706)\n    */\n    bool initWithTexture(Texture2D *texture, ssize_t capacity);\n\n    /** updates a Quad (texture, vertex and color) at a certain index\n    * index must be between 0 and the atlas capacity - 1\n    @since v0.8\n    */\n    void updateQuad(V3F_C4B_T2F_Quad* quad, ssize_t index);\n\n    /** Inserts a Quad (texture, vertex and color) at a certain index\n    index must be between 0 and the atlas capacity - 1\n    @since v0.8\n    */\n    void insertQuad(V3F_C4B_T2F_Quad* quad, ssize_t index);\n\n    /** Inserts a c array of quads at a given index\n     index must be between 0 and the atlas capacity - 1\n     this method doesn't enlarge the array when amount + index > totalQuads\n     @since v1.1\n    */\n    void insertQuads(V3F_C4B_T2F_Quad* quads, ssize_t index, ssize_t amount);\n\n    /** Removes the quad that is located at a certain index and inserts it at a new index\n    This operation is faster than removing and inserting in a quad in 2 different steps\n    @since v0.7.2\n    */\n    void insertQuadFromIndex(ssize_t fromIndex, ssize_t newIndex);\n\n    /** removes a quad at a given index number.\n    The capacity remains the same, but the total number of quads to be drawn is reduced in 1\n    @since v0.7.2\n    */\n    void removeQuadAtIndex(ssize_t index);\n\n    /** removes a amount of quads starting from index\n        @since 1.1\n     */\n    void removeQuadsAtIndex(ssize_t index, ssize_t amount);\n    /** removes all Quads.\n    The TextureAtlas capacity remains untouched. No memory is freed.\n    The total number of quads to be drawn will be 0\n    @since v0.7.2\n    */\n    void removeAllQuads();\n\n    /** resize the capacity of the TextureAtlas.\n    * The new capacity can be lower or higher than the current one\n    * It returns true if the resize was successful.\n    * If it fails to resize the capacity it will return false with a new capacity of 0.\n    */\n    bool resizeCapacity(ssize_t capacity);\n\n    /**\n     Used internally by ParticleBatchNode\n     don't use this unless you know what you're doing\n     @since 1.1\n    */\n    void increaseTotalQuadsWith(ssize_t amount);\n\n    /** Moves an amount of quads from oldIndex at newIndex\n     @since v1.1\n     */\n    void moveQuadsFromIndex(ssize_t oldIndex, ssize_t amount, ssize_t newIndex);\n\n    /**\n     Moves quads from index till totalQuads to the newIndex\n     Used internally by ParticleBatchNode\n     This method doesn't enlarge the array if newIndex + quads to be moved > capacity\n     @since 1.1\n    */\n    void moveQuadsFromIndex(ssize_t index, ssize_t newIndex);\n\n    /**\n     Ensures that after a realloc quads are still empty\n     Used internally by ParticleBatchNode\n     @since 1.1\n    */\n    void fillWithEmptyQuadsFromIndex(ssize_t index, ssize_t amount);\n\n    /** draws n quads\n    * n can't be greater than the capacity of the Atlas\n    */\n    void drawNumberOfQuads(ssize_t n);\n\n    /** draws n quads from an index (offset).\n    n + start can't be greater than the capacity of the atlas\n\n    @since v1.0\n    */\n    void drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start);\n\n    /** draws all the Atlas's Quads\n    */\n    void drawQuads();\n    /** listen the event that coming to foreground on Android\n     */\n    void listenBackToForeground(EventCustom* event);\n\n    /** whether or not the array buffer of the VBO needs to be updated*/\n    inline bool isDirty(void) { return _dirty; }\n    /** specify if the array buffer of the VBO needs to be updated */\n    inline void setDirty(bool bDirty) { _dirty = bDirty; }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual std::string getDescription() const;\n\n    /** Gets the quantity of quads that are going to be drawn */\n    ssize_t getTotalQuads() const;\n    \n    /** Gets the quantity of quads that can be stored with the current texture atlas size */\n    ssize_t getCapacity() const;\n    \n    /** Gets the texture of the texture atlas */\n    Texture2D* getTexture() const;\n    \n    /** Sets the texture for the texture atlas */\n    void setTexture(Texture2D* texture);\n    \n    /** Gets the quads that are going to be rendered */\n    V3F_C4B_T2F_Quad* getQuads();\n    \n    /** Sets the quads that are going to be rendered */\n    void setQuads(V3F_C4B_T2F_Quad* quads);\n    \nprivate:\n    void renderCommand();\n\n    void setupIndices();\n    void mapBuffers();\n    void setupVBOandVAO();\n    void setupVBO();\n\nprotected:\n    GLushort*           _indices;\n    GLuint              _VAOname;\n    GLuint              _buffersVBO[2]; //0: vertex  1: indices\n    bool                _dirty; //indicates whether or not the array buffer of the VBO needs to be updated\n    /** quantity of quads that are going to be drawn */\n    ssize_t _totalQuads;\n    /** quantity of quads that can be stored with the current texture atlas size */\n    ssize_t _capacity;\n    /** Texture of the texture atlas */\n    Texture2D* _texture;\n    /** Quads that are going to be rendered */\n    V3F_C4B_T2F_Quad* _quads;\n    \n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    EventListenerCustom* _backToForegroundlistener;\n#endif\n};\n\n// end of textures group\n/// @}\n\nNS_CC_END\n\n#endif //__CCTEXTURE_ATLAS_H__\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTextureCache.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include <errno.h>\n#include <stack>\n#include <cctype>\n#include <list>\n\n#include \"CCTextureCache.h\"\n#include \"CCTexture2D.h\"\n#include \"ccMacros.h\"\n#include \"CCDirector.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"ccUtils.h\"\n#include \"CCScheduler.h\"\n#include \"CCString.h\"\n\n\n#ifdef EMSCRIPTEN\n#include <emscripten/emscripten.h>\n#include \"platform/emscripten/CCTextureCacheEmscripten.h\"\n#endif // EMSCRIPTEN\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n// implementation TextureCache\n\nTextureCache * TextureCache::getInstance()\n{\n    return Director::getInstance()->getTextureCache();\n}\n\nTextureCache::TextureCache()\n: _loadingThread(nullptr)\n, _asyncStructQueue(nullptr)\n, _imageInfoQueue(nullptr)\n, _needQuit(false)\n, _asyncRefCount(0)\n{\n}\n\nTextureCache::~TextureCache()\n{\n    CCLOGINFO(\"deallocing TextureCache: %p\", this);\n\n    for( auto it=_textures.begin(); it!=_textures.end(); ++it)\n        (it->second)->release();\n\n    CC_SAFE_DELETE(_loadingThread);\n}\n\nvoid TextureCache::destroyInstance()\n{\n}\n\nTextureCache * TextureCache::sharedTextureCache() \n{\n    return Director::getInstance()->getTextureCache();\n}\n\nvoid TextureCache::purgeSharedTextureCache() \n{ \n}\n\nstd::string TextureCache::getDescription() const\n{\n    return StringUtils::format(\"<TextureCache | Number of textures = %d>\", static_cast<int>(_textures.size()));\n}\n\nvoid TextureCache::addImageAsync(const std::string &path, std::function<void(Texture2D*)> callback)\n{\n    Texture2D *texture = nullptr;\n\n    std::string fullpath = FileUtils::getInstance()->fullPathForFilename(path);\n\n    auto it = _textures.find(fullpath);\n    if( it != _textures.end() )\n        texture = it->second;\n\n    if (texture != nullptr)\n    {\n        callback(texture);\n        return;\n    }\n\n    // lazy init\n    if (_asyncStructQueue == nullptr)\n    {             \n        _asyncStructQueue = new queue<AsyncStruct*>();\n        _imageInfoQueue   = new deque<ImageInfo*>();        \n\n        // create a new thread to load images\n        _loadingThread = new std::thread(&TextureCache::loadImage, this);\n\n        _needQuit = false;\n    }\n\n    if (0 == _asyncRefCount)\n    {\n        Director::getInstance()->getScheduler()->scheduleSelector(schedule_selector(TextureCache::addImageAsyncCallBack), this, 0, false);\n    }\n\n    ++_asyncRefCount;\n\n    // generate async struct\n    AsyncStruct *data = new AsyncStruct(fullpath, callback);\n\n    // add async struct into queue\n    _asyncStructQueueMutex.lock();\n    _asyncStructQueue->push(data);\n    _asyncStructQueueMutex.unlock();\n\n    _sleepCondition.notify_one();\n}\n\nvoid TextureCache::loadImage()\n{\n    AsyncStruct *asyncStruct = nullptr;\n\n    while (true)\n    {\n        std::queue<AsyncStruct*> *pQueue = _asyncStructQueue;\n        _asyncStructQueueMutex.lock();\n        if (pQueue->empty())\n        {\n            _asyncStructQueueMutex.unlock();\n            if (_needQuit) {\n                break;\n            }\n            else {\n                std::unique_lock<std::mutex> lk(_sleepMutex);\n                _sleepCondition.wait(lk);\n                continue;\n            }\n        }\n        else\n        {\n            asyncStruct = pQueue->front();\n            pQueue->pop();\n            _asyncStructQueueMutex.unlock();\n        }        \n\n        Image *image = nullptr;\n        bool generateImage = false;\n\n        auto it = _textures.find(asyncStruct->filename);\n        if( it == _textures.end() )\n        {\n           _imageInfoMutex.lock();\n           ImageInfo *imageInfo;\n           size_t pos = 0;\n           size_t infoSize = _imageInfoQueue->size();\n           for (; pos < infoSize; pos++)\n           {\n               imageInfo = (*_imageInfoQueue)[pos];\n               if(imageInfo->asyncStruct->filename.compare(asyncStruct->filename))\n                   break;\n           }\n           _imageInfoMutex.unlock();\n           if(infoSize == 0 || pos < infoSize)\n               generateImage = true;\n        }\n\n        if (generateImage)\n        {\n            const std::string& filename = asyncStruct->filename;\n            // generate image      \n            image = new Image();\n            if (image && !image->initWithImageFileThreadSafe(filename))\n            {\n                CC_SAFE_RELEASE(image);\n                CCLOG(\"can not load %s\", filename.c_str());\n                continue;\n            }\n        }    \n\n        // generate image info\n        ImageInfo *imageInfo = new ImageInfo();\n        imageInfo->asyncStruct = asyncStruct;\n        imageInfo->image = image;\n\n        // put the image info into the queue\n        _imageInfoMutex.lock();\n        _imageInfoQueue->push_back(imageInfo);\n        _imageInfoMutex.unlock();\n    }\n    \n\tif(_asyncStructQueue != nullptr)\n    {\n        delete _asyncStructQueue;\n\t    _asyncStructQueue = nullptr;\n        delete _imageInfoQueue;\n\t    _imageInfoQueue = nullptr;\n    }\n}\n\nvoid TextureCache::addImageAsyncCallBack(float dt)\n{\n    // the image is generated in loading thread\n    std::deque<ImageInfo*> *imagesQueue = _imageInfoQueue;\n\n    _imageInfoMutex.lock();\n    if (imagesQueue->empty())\n    {\n        _imageInfoMutex.unlock();\n    }\n    else\n    {\n        ImageInfo *imageInfo = imagesQueue->front();\n        imagesQueue->pop_front();\n        _imageInfoMutex.unlock();\n\n        AsyncStruct *asyncStruct = imageInfo->asyncStruct;\n        Image *image = imageInfo->image;\n\n        const std::string& filename = asyncStruct->filename;\n\n        Texture2D *texture = nullptr;\n        if (image)\n        {\n            // generate texture in render thread\n            texture = new Texture2D();\n\n            texture->initWithImage(image);\n\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n            // cache the texture file name\n            VolatileTextureMgr::addImageTexture(texture, filename);\n#endif\n            // cache the texture. retain it, since it is added in the map\n            _textures.insert( std::make_pair(filename, texture) );\n            texture->retain();\n\n            texture->autorelease();\n        }\n        else\n        {\n            auto it = _textures.find(asyncStruct->filename);\n            if(it != _textures.end())\n                texture = it->second;\n        }\n        \n        asyncStruct->callback(texture);\n        if(image)\n        {\n            image->release();\n        }       \n        delete asyncStruct;\n        delete imageInfo;\n\n        --_asyncRefCount;\n        if (0 == _asyncRefCount)\n        {\n            Director::getInstance()->getScheduler()->unscheduleSelector(schedule_selector(TextureCache::addImageAsyncCallBack), this);\n        }\n    }\n}\n\nTexture2D * TextureCache::addImage(const std::string &path)\n{\n    Texture2D * texture = nullptr;\n    Image* image = nullptr;\n    // Split up directory and filename\n    // MUTEX:\n    // Needed since addImageAsync calls this method from a different thread\n\n    std::string fullpath = FileUtils::getInstance()->fullPathForFilename(path);\n    if (fullpath.size() == 0)\n    {\n        return nullptr;\n    }\n    auto it = _textures.find(fullpath);\n    if( it != _textures.end() )\n        texture = it->second;\n\n    if (! texture)\n    {\n        // all images are handled by UIImage except PVR extension that is handled by our own handler\n        do \n        {\n            image = new Image();\n            CC_BREAK_IF(nullptr == image);\n\n            bool bRet = image->initWithImageFile(fullpath);\n            CC_BREAK_IF(!bRet);\n\n            texture = new Texture2D();\n\n            if( texture && texture->initWithImage(image) )\n            {\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n                // cache the texture file name\n                VolatileTextureMgr::addImageTexture(texture, fullpath);\n#endif\n                // texture already retained, no need to re-retain it\n                _textures.insert( std::make_pair(fullpath, texture) );\n            }\n            else\n            {\n                CCLOG(\"cocos2d: Couldn't create texture for file:%s in TextureCache\", path.c_str());\n            }\n        } while (0);\n    }\n\n    CC_SAFE_RELEASE(image);\n\n    return texture;\n}\n\nTexture2D* TextureCache::addImage(Image *image, const std::string &key)\n{\n    CCASSERT(image != nullptr, \"TextureCache: image MUST not be nil\");\n\n    Texture2D * texture = nullptr;\n\n    do\n    {\n        auto it = _textures.find(key);\n        if( it != _textures.end() ) {\n            texture = it->second;\n            break;\n        }\n\n        // prevents overloading the autorelease pool\n        texture = new Texture2D();\n        texture->initWithImage(image);\n\n        if(texture)\n        {\n            _textures.insert( std::make_pair(key, texture) );\n            texture->retain();\n\n            texture->autorelease();\n        }\n        else\n        {\n            CCLOG(\"cocos2d: Couldn't add UIImage in TextureCache\");\n        }\n\n    } while (0);\n    \n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    VolatileTextureMgr::addImage(texture, image);\n#endif\n    \n    return texture;\n}\n\n// TextureCache - Remove\n\nvoid TextureCache::removeAllTextures()\n{\n    for( auto it=_textures.begin(); it!=_textures.end(); ++it ) {\n        (it->second)->release();\n    }\n    _textures.clear();\n}\n\nvoid TextureCache::removeUnusedTextures()\n{\n    for( auto it=_textures.cbegin(); it!=_textures.cend(); /* nothing */) {\n        Texture2D *tex = it->second;\n        if( tex->getReferenceCount() == 1 ) {\n            CCLOG(\"cocos2d: TextureCache: removing unused texture: %s\", it->first.c_str());\n\n            tex->release();\n            _textures.erase(it++);\n        } else {\n            ++it;\n        }\n\n    }\n}\n\nvoid TextureCache::removeTexture(Texture2D* texture)\n{\n    if( ! texture )\n    {\n        return;\n    }\n\n    for( auto it=_textures.cbegin(); it!=_textures.cend(); /* nothing */ ) {\n        if( it->second == texture ) {\n            texture->release();\n            _textures.erase(it++);\n            break;\n        } else\n            ++it;\n    }\n}\n\nvoid TextureCache::removeTextureForKey(const std::string &textureKeyName)\n{\n    std::string key = textureKeyName;\n    auto it = _textures.find(key);\n\n    if( it == _textures.end() ) {\n        key = FileUtils::getInstance()->fullPathForFilename(textureKeyName);\n        it = _textures.find(key);\n    }\n\n    if( it != _textures.end() ) {\n        (it->second)->release();\n        _textures.erase(it);\n    }\n}\n\nTexture2D* TextureCache::getTextureForKey(const std::string &textureKeyName) const\n{\n    std::string key = textureKeyName;\n    auto it = _textures.find(key);\n\n    if( it == _textures.end() ) {\n        key = FileUtils::getInstance()->fullPathForFilename(textureKeyName);\n        it = _textures.find(key);\n    }\n\n    if( it != _textures.end() )\n        return it->second;\n    return nullptr;\n}\n\nvoid TextureCache::reloadAllTextures()\n{\n//will do nothing\n// #if CC_ENABLE_CACHE_TEXTURE_DATA\n//     VolatileTextureMgr::reloadAllTextures();\n// #endif\n}\n\nvoid TextureCache::waitForQuit()\n{\n    // notify sub thread to quick\n    _needQuit = true;\n    _sleepCondition.notify_one();\n    if (_loadingThread) _loadingThread->join();\n}\n\nstd::string TextureCache::getCachedTextureInfo() const\n{\n    char buffer[16386];\n    char buftmp[4096];\n\n    memset(buffer,0,sizeof(buffer));\n\n    unsigned int count = 0;\n    unsigned int totalBytes = 0;\n\n    for( auto it = _textures.begin(); it != _textures.end(); ++it ) {\n\n        memset(buftmp,0,sizeof(buftmp));\n\n\n        Texture2D* tex = it->second;\n        unsigned int bpp = tex->getBitsPerPixelForFormat();\n        // Each texture takes up width * height * bytesPerPixel bytes.\n        auto bytes = tex->getPixelsWide() * tex->getPixelsHigh() * bpp / 8;\n        totalBytes += bytes;\n        count++;\n        snprintf(buftmp,sizeof(buftmp)-1,\"\\\"%s\\\" rc=%lu id=%lu %lu x %lu @ %ld bpp => %lu KB\\n\",\n               it->first.c_str(),\n               (long)tex->getReferenceCount(),\n               (long)tex->getName(),\n               (long)tex->getPixelsWide(),\n               (long)tex->getPixelsHigh(),\n               (long)bpp,\n               (long)bytes / 1024);\n        strcat(buffer, buftmp);\n    }\n\n    snprintf(buftmp, sizeof(buftmp)-1, \"TextureCache dumpDebugInfo: %ld textures, for %lu KB (%.2f MB)\\n\", (long)count, (long)totalBytes / 1024, totalBytes / (1024.0f*1024.0f));\n    strcat(buffer, buftmp);\n\n    return std::string(buffer);\n}\n\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n\nstd::list<VolatileTexture*> VolatileTextureMgr::_textures;\nbool VolatileTextureMgr::_isReloading = false;\n\nVolatileTexture::VolatileTexture(Texture2D *t)\n: _texture(t)\n, _cashedImageType(kInvalid)\n, _textureData(nullptr)\n, _pixelFormat(Texture2D::PixelFormat::RGBA8888)\n, _fileName(\"\")\n, _text(\"\")\n, _uiImage(nullptr)\n{\n    _texParams.minFilter = GL_LINEAR;\n    _texParams.magFilter = GL_LINEAR;\n    _texParams.wrapS = GL_CLAMP_TO_EDGE;\n    _texParams.wrapT = GL_CLAMP_TO_EDGE;\n}\n\nVolatileTexture::~VolatileTexture()\n{\n    CC_SAFE_RELEASE(_uiImage);\n}\n\nvoid VolatileTextureMgr::addImageTexture(Texture2D *tt, const std::string& imageFileName)\n{\n    if (_isReloading)\n    {\n        return;\n    }\n\n    VolatileTexture *vt = findVolotileTexture(tt);\n\n    vt->_cashedImageType = VolatileTexture::kImageFile;\n    vt->_fileName = imageFileName;\n    vt->_pixelFormat = tt->getPixelFormat();\n}\n\nvoid VolatileTextureMgr::addImage(Texture2D *tt, Image *image)\n{\n    VolatileTexture *vt = findVolotileTexture(tt);\n    image->retain();\n    vt->_uiImage = image;\n    vt->_cashedImageType = VolatileTexture::kImage;\n}\n\nVolatileTexture* VolatileTextureMgr::findVolotileTexture(Texture2D *tt)\n{\n    VolatileTexture *vt = 0;\n    auto i = _textures.begin();\n    while (i != _textures.end())\n    {\n        VolatileTexture *v = *i++;\n        if (v->_texture == tt)\n        {\n            vt = v;\n            break;\n        }\n    }\n    \n    if (! vt)\n    {\n        vt = new VolatileTexture(tt);\n        _textures.push_back(vt);\n    }\n    \n    return vt;\n}\n\nvoid VolatileTextureMgr::addDataTexture(Texture2D *tt, void* data, int dataLen, Texture2D::PixelFormat pixelFormat, const Size& contentSize)\n{\n    if (_isReloading)\n    {\n        return;\n    }\n\n    VolatileTexture *vt = findVolotileTexture(tt);\n\n    vt->_cashedImageType = VolatileTexture::kImageData;\n    vt->_textureData = data;\n    vt->_dataLen = dataLen;\n    vt->_pixelFormat = pixelFormat;\n    vt->_textureSize = contentSize;\n}\n\nvoid VolatileTextureMgr::addStringTexture(Texture2D *tt, const char* text, const FontDefinition& fontDefinition)\n{\n    if (_isReloading)\n    {\n        return;\n    }\n\n    VolatileTexture *vt = findVolotileTexture(tt);\n\n    vt->_cashedImageType = VolatileTexture::kString;\n    vt->_text     = text;\n    vt->_fontDefinition = fontDefinition;\n}\n\nvoid VolatileTextureMgr::setTexParameters(Texture2D *t, const Texture2D::TexParams &texParams)\n{\n    VolatileTexture *vt = findVolotileTexture(t);\n\n    if (texParams.minFilter != GL_NONE)\n        vt->_texParams.minFilter = texParams.minFilter;\n    if (texParams.magFilter != GL_NONE)\n        vt->_texParams.magFilter = texParams.magFilter;\n    if (texParams.wrapS != GL_NONE)\n        vt->_texParams.wrapS = texParams.wrapS;\n    if (texParams.wrapT != GL_NONE)\n        vt->_texParams.wrapT = texParams.wrapT;\n}\n\nvoid VolatileTextureMgr::removeTexture(Texture2D *t) \n{\n    auto i = _textures.begin();\n    while (i != _textures.end())\n    {\n        VolatileTexture *vt = *i++;\n        if (vt->_texture == t) \n        {\n            _textures.remove(vt);\n            delete vt;\n            break;\n        }\n    }\n}\n\nvoid VolatileTextureMgr::reloadAllTextures()\n{\n    _isReloading = true;\n\n    CCLOG(\"reload all texture\");\n    auto iter = _textures.begin();\n\n    while (iter != _textures.end())\n    {\n        VolatileTexture *vt = *iter++;\n\n        switch (vt->_cashedImageType)\n        {\n        case VolatileTexture::kImageFile:\n            {\n                Image* image = new Image();\n                \n                Data data = FileUtils::getInstance()->getDataFromFile(vt->_fileName);\n                \n                if (image && image->initWithImageData(data.getBytes(), data.getSize()))\n                {\n                    Texture2D::PixelFormat oldPixelFormat = Texture2D::getDefaultAlphaPixelFormat();\n                    Texture2D::setDefaultAlphaPixelFormat(vt->_pixelFormat);\n                    vt->_texture->initWithImage(image);\n                    Texture2D::setDefaultAlphaPixelFormat(oldPixelFormat);\n                }\n                \n                CC_SAFE_RELEASE(image);\n            }\n            break;\n        case VolatileTexture::kImageData:\n            {\n                vt->_texture->initWithData(vt->_textureData,\n                                           vt->_dataLen,\n                                          vt->_pixelFormat, \n                                          vt->_textureSize.width, \n                                          vt->_textureSize.height, \n                                          vt->_textureSize);\n            }\n            break;\n        case VolatileTexture::kString:\n            {\n                vt->_texture->initWithString(vt->_text.c_str(), vt->_fontDefinition);\n            }\n            break;\n        case VolatileTexture::kImage:\n            {\n                vt->_texture->initWithImage(vt->_uiImage);\n            }\n            break;\n        default:\n            break;\n        }\n        vt->_texture->setTexParameters(vt->_texParams);\n    }\n\n    _isReloading = false;\n}\n\n#endif // CC_ENABLE_CACHE_TEXTURE_DATA\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTextureCache.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTEXTURE_CACHE_H__\n#define __CCTEXTURE_CACHE_H__\n\n#include <string>\n#include <mutex>\n#include <thread>\n#include <condition_variable>\n#include <queue>\n#include <string>\n#include <unordered_map>\n#include <functional>\n\n#include \"CCObject.h\"\n#include \"CCTexture2D.h\"\n#include \"platform/CCImage.h\"\n\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    #include \"platform/CCImage.h\"\n    #include <list>\n#endif\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup textures\n * @{\n */\n/*\n* from version 3.0, TextureCache will never to treated as a singleton, it will be owned by director.\n* all call by TextureCache::getInstance() should be replaced by Director::getInstance()->getTextureCache()\n*/\n\n/** @brief Singleton that handles the loading of textures\n* Once the texture is loaded, the next time it will return\n* a reference of the previously loaded texture reducing GPU & CPU memory\n*/\nclass CC_DLL TextureCache : public Object\n{\npublic:\n    /** Returns the shared instance of the cache */\n    CC_DEPRECATED_ATTRIBUTE static TextureCache * getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static TextureCache * sharedTextureCache();\n\n    /** purges the cache. It releases the retained instance.\n     @since v0.99.0\n     */\n    CC_DEPRECATED_ATTRIBUTE static void destroyInstance();\n\n    /** @deprecated Use destroyInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static void purgeSharedTextureCache();\n\n    /** Reload all textures\n    should not call it, called by frame work\n    now the function do nothing, use VolatileTextureMgr::reloadAllTextures\n     */\n    CC_DEPRECATED_ATTRIBUTE static void reloadAllTextures();\n\npublic:\n    /**\n     * @js ctor\n     */\n    TextureCache();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TextureCache();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual std::string getDescription() const;\n\n//    Dictionary* snapshotTextures();\n\n    /** Returns a Texture2D object given an filename.\n    * If the filename was not previously loaded, it will create a new Texture2D\n    *  object and it will return it. It will use the filename as a key.\n    * Otherwise it will return a reference of a previously loaded image.\n    * Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr\n    */\n    Texture2D* addImage(const std::string &filepath);\n\n    /* Returns a Texture2D object given a file image\n    * If the file image was not previously loaded, it will create a new Texture2D object and it will return it.\n    * Otherwise it will load a texture in a new thread, and when the image is loaded, the callback will be called with the Texture2D as a parameter.\n    * The callback will be called from the main thread, so it is safe to create any cocos2d object from the callback.\n    * Supported image extensions: .png, .jpg\n    * @since v0.8\n    */\n    virtual void addImageAsync(const std::string &filepath, std::function<void(Texture2D*)> callback);\n\n    /** Returns a Texture2D object given an Image.\n    * If the image was not previously loaded, it will create a new Texture2D object and it will return it.\n    * Otherwise it will return a reference of a previously loaded image.\n    * The \"key\" parameter will be used as the \"key\" for the cache.\n    * If \"key\" is nil, then a new texture will be created each time.\n    */\n    Texture2D* addImage(Image *image, const std::string &key);\n    CC_DEPRECATED_ATTRIBUTE Texture2D* addUIImage(Image *image, const std::string& key) { return addImage(image,key); }\n\n    /** Returns an already created texture. Returns nil if the texture doesn't exist.\n    @since v0.99.5\n    */\n    Texture2D* getTextureForKey(const std::string& key) const;\n    CC_DEPRECATED_ATTRIBUTE Texture2D* textureForKey(const std::string& key) const { return getTextureForKey(key); }\n\n    /** Purges the dictionary of loaded textures.\n    * Call this method if you receive the \"Memory Warning\"\n    * In the short term: it will free some resources preventing your app from being killed\n    * In the medium term: it will allocate more resources\n    * In the long term: it will be the same\n    */\n    void removeAllTextures();\n\n    /** Removes unused textures\n    * Textures that have a retain count of 1 will be deleted\n    * It is convenient to call this method after when starting a new Scene\n    * @since v0.8\n    */\n    void removeUnusedTextures();\n\n    /** Deletes a texture from the cache given a texture\n    */\n    void removeTexture(Texture2D* texture);\n\n    /** Deletes a texture from the cache given a its key name\n    @since v0.99.4\n    */\n    void removeTextureForKey(const std::string &key);\n\n    /** Output to CCLOG the current contents of this TextureCache\n    * This will attempt to calculate the size of each texture, and the total texture memory in use\n    *\n    * @since v1.0\n    */\n    std::string getCachedTextureInfo() const;\n\n    //wait for texture cahe to quit befor destroy instance\n    //called by director, please do not called outside\n    void waitForQuit();\n\nprivate:\n    void addImageAsyncCallBack(float dt);\n    void loadImage();\n\npublic:\n    struct AsyncStruct\n    {\n    public:\n        AsyncStruct(const std::string& fn, std::function<void(Texture2D*)> f) : filename(fn), callback(f) {}\n\n        std::string filename;\n        std::function<void(Texture2D*)> callback;\n    };\n\nprotected:\n    typedef struct _ImageInfo\n    {\n        AsyncStruct *asyncStruct;\n        Image        *image;\n    } ImageInfo;\n    \n    std::thread* _loadingThread;\n\n    std::queue<AsyncStruct*>* _asyncStructQueue;\n    std::deque<ImageInfo*>* _imageInfoQueue;\n\n    std::mutex _asyncStructQueueMutex;\n    std::mutex _imageInfoMutex;\n\n    std::mutex _sleepMutex;\n    std::condition_variable _sleepCondition;\n\n    bool _needQuit;\n\n    int _asyncRefCount;\n\n    std::unordered_map<std::string, Texture2D*> _textures;\n};\n\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n\nclass VolatileTexture\n{\n    typedef enum {\n        kInvalid = 0,\n        kImageFile,\n        kImageData,\n        kString,\n        kImage,\n    }ccCachedImageType;\n\nprivate:\n    VolatileTexture(Texture2D *t);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~VolatileTexture();\n\nprotected:\n    friend class  VolatileTextureMgr;\n    Texture2D *_texture;\n    \n    Image *_uiImage;\n\n    ccCachedImageType _cashedImageType;\n\n    void *_textureData;\n    int  _dataLen;\n    Size _textureSize;\n    Texture2D::PixelFormat _pixelFormat;\n\n    std::string _fileName;\n\n    Texture2D::TexParams      _texParams;\n    std::string               _text;\n    FontDefinition            _fontDefinition;\n};\n\nclass VolatileTextureMgr\n{\npublic:\n    static void addImageTexture(Texture2D *tt, const std::string& imageFileName);\n    static void addStringTexture(Texture2D *tt, const char* text, const FontDefinition& fontDefinition);\n    static void addDataTexture(Texture2D *tt, void* data, int dataLen, Texture2D::PixelFormat pixelFormat, const Size& contentSize);\n    static void addImage(Texture2D *tt, Image *image);\n\n    static void setTexParameters(Texture2D *t, const Texture2D::TexParams &texParams);\n    static void removeTexture(Texture2D *t);\n    static void reloadAllTextures();\npublic:\n    static std::list<VolatileTexture*> _textures;\n    static bool _isReloading;\nprivate:\n    // find VolatileTexture by Texture2D*\n    // if not found, create a new one\n    static VolatileTexture* findVolotileTexture(Texture2D *tt);\n};\n\n#endif\n\n// end of textures group\n/// @}\n\nNS_CC_END\n\n#endif //__CCTEXTURE_CACHE_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTileMapAtlas.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCTileMapAtlas.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCTextureAtlas.h\"\n#include \"TGAlib.h\"\n#include \"ccConfig.h\"\n#include \"CCInteger.h\"\n#include \"CCDirector.h\"\n#include \"CCString.h\"\n#include <sstream>\n\nNS_CC_BEGIN\n\n// implementation TileMapAtlas\n\nTileMapAtlas * TileMapAtlas::create(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight)\n{\n    TileMapAtlas *ret = new TileMapAtlas();\n    if (ret->initWithTileFile(tile, mapFile, tileWidth, tileHeight))\n    {\n        ret->autorelease();\n        return ret;\n    }\n    CC_SAFE_DELETE(ret);\n    return nullptr;\n}\n\nbool TileMapAtlas::initWithTileFile(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight)\n{\n    this->loadTGAfile(mapFile);\n    this->calculateItemsToRender();\n\n    if( AtlasNode::initWithTileFile(tile, tileWidth, tileHeight, _itemsToRender) )\n    {\n        this->updateAtlasValues();\n        this->setContentSize(Size((float)(_TGAInfo->width*_itemWidth),\n                                        (float)(_TGAInfo->height*_itemHeight)));\n        return true;\n    }\n    return false;\n}\n\nTileMapAtlas::TileMapAtlas()\n : _itemsToRender(0)\n , _TGAInfo(nullptr)\n{\n}\n\nTileMapAtlas::~TileMapAtlas()\n{\n    if (_TGAInfo)\n    {\n        tgaDestroy(_TGAInfo);\n    }\n}\n\nvoid TileMapAtlas::releaseMap()\n{\n    if (_TGAInfo)\n    {\n        tgaDestroy(_TGAInfo);\n    }\n    _TGAInfo = nullptr;\n}\n\nvoid TileMapAtlas::calculateItemsToRender()\n{\n    CCASSERT( _TGAInfo != nullptr, \"tgaInfo must be non-nil\");\n\n    _itemsToRender = 0;\n    for(int x=0;x < _TGAInfo->width; x++ ) \n    {\n        for( int y=0; y < _TGAInfo->height; y++ ) \n        {\n            Color3B *ptr = (Color3B*) _TGAInfo->imageData;\n            Color3B value = ptr[x + y * _TGAInfo->width];\n            if( value.r )\n            {\n                ++_itemsToRender;\n            }\n        }\n    }\n}\n\nvoid TileMapAtlas::loadTGAfile(const std::string& file)\n{\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(file);\n\n    //    //Find the path of the file\n    //    NSBundle *mainBndl = [Director sharedDirector].loadingBundle;\n    //    String *resourcePath = [mainBndl resourcePath];\n    //    String * path = [resourcePath stringByAppendingPathComponent:file];\n\n    _TGAInfo = tgaLoad( fullPath.c_str() );\n#if 1\n    if( _TGAInfo->status != TGA_OK ) \n    {\n        CCASSERT(0, \"TileMapAtlasLoadTGA : TileMapAtlas cannot load TGA file\");\n    }\n#endif\n}\n\n// TileMapAtlas - Atlas generation / updates\nvoid TileMapAtlas::setTile(const Color3B& tile, const Point& position)\n{\n    CCASSERT(_TGAInfo != nullptr, \"tgaInfo must not be nil\");\n    CCASSERT(position.x < _TGAInfo->width, \"Invalid position.x\");\n    CCASSERT(position.y < _TGAInfo->height, \"Invalid position.x\");\n    CCASSERT(tile.r != 0, \"R component must be non 0\");\n\n    Color3B *ptr = (Color3B*)_TGAInfo->imageData;\n    Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)];\n    if( value.r == 0 )\n    {\n        CCLOG(\"cocos2d: Value.r must be non 0.\");\n    } \n    else\n    {\n        ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)] = tile;\n\n        // XXX: this method consumes a lot of memory\n        // XXX: a tree of something like that shall be implemented\n        std::string key = StringUtils::toString(position.x) + \",\" + StringUtils::toString(position.y);\n        int num = _posToAtlasIndex[key].asInt();\n\n        this->updateAtlasValueAt(position, tile, num);\n    }    \n}\n\nColor3B TileMapAtlas::getTileAt(const Point& position) const\n{\n    CCASSERT( _TGAInfo != nullptr, \"tgaInfo must not be nil\");\n    CCASSERT( position.x < _TGAInfo->width, \"Invalid position.x\");\n    CCASSERT( position.y < _TGAInfo->height, \"Invalid position.y\");\n\n    Color3B *ptr = (Color3B*)_TGAInfo->imageData;\n    Color3B value = ptr[(unsigned int)(position.x + position.y * _TGAInfo->width)];\n\n    return value;    \n}\n\nvoid TileMapAtlas::updateAtlasValueAt(const Point& pos, const Color3B& value, int index)\n{\n    CCASSERT( index >= 0 && index < _textureAtlas->getCapacity(), \"updateAtlasValueAt: Invalid index\");\n\n    V3F_C4B_T2F_Quad* quad = &((_textureAtlas->getQuads())[index]);\n\n    int x = pos.x;\n    int y = pos.y;\n    float row = (float) (value.r % _itemsPerRow);\n    float col = (float) (value.r / _itemsPerRow);\n\n    float textureWide = (float) (_textureAtlas->getTexture()->getPixelsWide());\n    float textureHigh = (float) (_textureAtlas->getTexture()->getPixelsHigh());\n\n    float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR();\n    float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR();\n\n#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n    float left        = (2 * row * itemWidthInPixels + 1) / (2 * textureWide);\n    float right       = left + (itemWidthInPixels * 2 - 2) / (2 * textureWide);\n    float top         = (2 * col * itemHeightInPixels + 1) / (2 * textureHigh);\n    float bottom      = top + (itemHeightInPixels * 2 - 2) / (2 * textureHigh);\n#else\n    float left        = (row * itemWidthInPixels) / textureWide;\n    float right       = left + itemWidthInPixels / textureWide;\n    float top         = (col * itemHeightInPixels) / textureHigh;\n    float bottom      = top + itemHeightInPixels / textureHigh;\n#endif\n\n    quad->tl.texCoords.u = left;\n    quad->tl.texCoords.v = top;\n    quad->tr.texCoords.u = right;\n    quad->tr.texCoords.v = top;\n    quad->bl.texCoords.u = left;\n    quad->bl.texCoords.v = bottom;\n    quad->br.texCoords.u = right;\n    quad->br.texCoords.v = bottom;\n\n    quad->bl.vertices.x = (float) (x * _itemWidth);\n    quad->bl.vertices.y = (float) (y * _itemHeight);\n    quad->bl.vertices.z = 0.0f;\n    quad->br.vertices.x = (float)(x * _itemWidth + _itemWidth);\n    quad->br.vertices.y = (float)(y * _itemHeight);\n    quad->br.vertices.z = 0.0f;\n    quad->tl.vertices.x = (float)(x * _itemWidth);\n    quad->tl.vertices.y = (float)(y * _itemHeight + _itemHeight);\n    quad->tl.vertices.z = 0.0f;\n    quad->tr.vertices.x = (float)(x * _itemWidth + _itemWidth);\n    quad->tr.vertices.y = (float)(y * _itemHeight + _itemHeight);\n    quad->tr.vertices.z = 0.0f;\n\n    Color4B color(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity);\n    quad->tr.colors = color;\n    quad->tl.colors = color;\n    quad->br.colors = color;\n    quad->bl.colors = color;\n\n    _textureAtlas->setDirty(true);\n    ssize_t totalQuads = _textureAtlas->getTotalQuads();\n    if (index + 1 > totalQuads) {\n        _textureAtlas->increaseTotalQuadsWith(index + 1 - totalQuads);\n    }\n}\n\nvoid TileMapAtlas::updateAtlasValues()\n{\n    CCASSERT( _TGAInfo != nullptr, \"tgaInfo must be non-nil\");\n\n    int total = 0;\n\n    for(int x=0;x < _TGAInfo->width; x++ ) \n    {\n        for( int y=0; y < _TGAInfo->height; y++ ) \n        {\n            if( total < _itemsToRender ) \n            {\n                Color3B *ptr = (Color3B*) _TGAInfo->imageData;\n                Color3B value = ptr[x + y * _TGAInfo->width];\n\n                if( value.r != 0 )\n                {\n                    this->updateAtlasValueAt(Point(x,y), value, total);\n\n                    std::string key = StringUtils::toString(x) + \",\" + StringUtils::toString(y);\n                    _posToAtlasIndex[key] = total;\n\n                    total++;\n                }\n            }\n        }\n    }\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTileMapAtlas.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCTILE_MAP_ATLAS__\n#define __CCTILE_MAP_ATLAS__\n\n#include \"CCAtlasNode.h\"\n#include \"CCValue.h\"\n\nNS_CC_BEGIN\n\nstruct sImageTGA;\n\n/**\n * @addtogroup tilemap_parallax_nodes\n * @{\n */\n\n/** @brief TileMapAtlas is a subclass of AtlasNode.\n\nIt knows how to render a map based of tiles.\nThe tiles must be in a .PNG format while the map must be a .TGA file.\n\nFor more information regarding the format, please see this post:\nhttp://www.cocos2d-iphone.org/archives/27\n\nAll features from AtlasNode are valid in TileMapAtlas\n\nIMPORTANT:\nThis class is deprecated. It is maintained for compatibility reasons only.\nYou SHOULD not use this class.\nInstead, use the newer TMX file format: TMXTiledMap\n*/\nclass CC_DLL TileMapAtlas : public AtlasNode \n{\npublic:\n    /** creates a TileMap with a tile file (atlas) with a map file and the width and height of each tile in points.\n     The tile file will be loaded using the TextureMgr.\n     */\n    static TileMapAtlas * create(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight);\n    /**\n     * @js ctor\n     */\n    TileMapAtlas();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TileMapAtlas();\n    \n    /** initializes a TileMap with a tile file (atlas) with a map file and the width and height of each tile in points.\n    The file will be loaded using the TextureMgr.\n    */\n    bool initWithTileFile(const std::string& tile, const std::string& mapFile, int tileWidth, int tileHeight);\n    /** returns a tile from position x,y.\n    For the moment only channel R is used\n    */\n    Color3B getTileAt(const Point& position) const;\n    CC_DEPRECATED_ATTRIBUTE Color3B tileAt(const Point& position) const { return getTileAt(position); };\n    /** sets a tile at position x,y.\n    For the moment only channel R is used\n    */\n    void setTile(const Color3B& tile, const Point& position);\n    /** dealloc the map from memory */\n    void releaseMap();\n    \n    inline struct sImageTGA* getTGAInfo() const { return _TGAInfo; };\n    inline void setTGAInfo(struct sImageTGA* TGAInfo) { _TGAInfo = TGAInfo; };\n\nprotected:\n    void loadTGAfile(const std::string& file);\n    void calculateItemsToRender();\n    void updateAtlasValueAt(const Point& pos, const Color3B& value, int index);\n    void updateAtlasValues();\n\n\n    //! x,y to atlas dictionary\n    ValueMap _posToAtlasIndex;\n    //! numbers of tiles to render\n    int _itemsToRender;\n    /** TileMap info */\n    struct sImageTGA* _TGAInfo;\n};\n\n// end of tilemap_parallax_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__CCTILE_MAP_ATLAS__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTouch.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCTouch.h\"\n#include \"CCDirector.h\"\n\nNS_CC_BEGIN\n\n// returns the current touch location in screen coordinates\nPoint Touch::getLocationInView() const \n{ \n    return _point; \n}\n\n// returns the previous touch location in screen coordinates\nPoint Touch::getPreviousLocationInView() const \n{ \n    return _prevPoint; \n}\n\n// returns the start touch location in screen coordinates\nPoint Touch::getStartLocationInView() const \n{ \n    return _startPoint; \n}\n\n// returns the current touch location in OpenGL coordinates\nPoint Touch::getLocation() const\n{ \n    return Director::getInstance()->convertToGL(_point); \n}\n\n// returns the previous touch location in OpenGL coordinates\nPoint Touch::getPreviousLocation() const\n{ \n    return Director::getInstance()->convertToGL(_prevPoint);  \n}\n\n// returns the start touch location in OpenGL coordinates\nPoint Touch::getStartLocation() const\n{ \n    return Director::getInstance()->convertToGL(_startPoint);  \n}\n\n// returns the delta position between the current location and the previous location in OpenGL coordinates\nPoint Touch::getDelta() const\n{     \n    return getLocation() - getPreviousLocation();\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/CCTouch.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_TOUCH_H__\n#define __CC_TOUCH_H__\n\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup input\n * @{\n */\n\nclass CC_DLL Touch : public Object\n{\npublic:\n    /** how the touches are dispathced */\n    enum class DispatchMode {\n        /** All at once */\n        ALL_AT_ONCE,\n        /** one by one */\n        ONE_BY_ONE,\n    };\n\n    Touch() \n        : _id(0),\n        _startPointCaptured(false)\n    {}\n\n    /** returns the current touch location in OpenGL coordinates */\n    Point getLocation() const;\n    /** returns the previous touch location in OpenGL coordinates */\n    Point getPreviousLocation() const;\n    /** returns the start touch location in OpenGL coordinates */\n    Point getStartLocation() const;\n    /** returns the delta of 2 current touches locations in screen coordinates */\n    Point getDelta() const;\n    /** returns the current touch location in screen coordinates */\n    Point getLocationInView() const;\n    /** returns the previous touch location in screen coordinates */\n    Point getPreviousLocationInView() const;\n    /** returns the start touch location in screen coordinates */\n    Point getStartLocationInView() const;\n    \n    void setTouchInfo(int id, float x, float y)\n    {\n        _id = id;\n        _prevPoint = _point;\n        _point.x   = x;\n        _point.y   = y;\n        if (!_startPointCaptured)\n        {\n            _startPoint = _point;\n            _startPointCaptured = true;\n        }\n    }\n    /**\n     * @js getId\n     * @lua getId\n     */\n    int getID() const\n    {\n        return _id;\n    }\n\nprivate:\n    int _id;\n    bool _startPointCaptured;\n    Point _startPoint;\n    Point _point;\n    Point _prevPoint;\n};\n\n// end of input group\n/// @}\n\nNS_CC_END\n\n#endif  // __PLATFORM_TOUCH_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTransition.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCTransition.h\"\n#include \"CCDirector.h\"\n#include \"CCActionInterval.h\"\n#include \"CCActionInstant.h\"\n#include \"CCActionEase.h\"\n#include \"CCActionCamera.h\"\n#include \"CCActionTiledGrid.h\"\n#include \"CCActionGrid.h\"\n#include \"CCLayer.h\"\n#include \"CCRenderTexture.h\"\n#include \"CCNodeGrid.h\"\n\nNS_CC_BEGIN\n\nconst unsigned int kSceneFade = 0xFADEFADE;\n\nTransitionScene::TransitionScene()\n{\n}\nTransitionScene::~TransitionScene()\n{\n    _inScene->release();\n    _outScene->release();\n}\n\nTransitionScene * TransitionScene::create(float t, Scene *scene)\n{\n    TransitionScene * pScene = new TransitionScene();\n    if(pScene && pScene->initWithDuration(t,scene))\n    {\n        pScene->autorelease();\n        return pScene;\n    }\n    CC_SAFE_DELETE(pScene);\n    return nullptr;\n}\n\nbool TransitionScene::initWithDuration(float t, Scene *scene)\n{\n    CCASSERT( scene != nullptr, \"Argument scene must be non-nil\");\n\n    if (Scene::init())\n    {\n        _duration = t;\n\n        // retain\n        _inScene = scene;\n        _inScene->retain();\n        _outScene = Director::getInstance()->getRunningScene();\n        if (_outScene == nullptr)\n        {\n            _outScene = Scene::create();\n        }\n        _outScene->retain();\n\n        CCASSERT( _inScene != _outScene, \"Incoming scene must be different from the outgoing scene\" );\n        \n        sceneOrder();\n\n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\nvoid TransitionScene::sceneOrder()\n{\n    _isInSceneOnTop = true;\n}\n\nvoid TransitionScene::draw()\n{\n    Scene::draw();\n\n    if( _isInSceneOnTop ) {\n        _outScene->visit();\n        _inScene->visit();\n    } else {\n        _inScene->visit();\n        _outScene->visit();\n    }\n}\n\nvoid TransitionScene::finish()\n{\n    kmMat4 identity;\n    kmMat4Identity(&identity);\n\n    // clean up\n    _inScene->setVisible(true);\n    _inScene->setPosition(Point(0,0));\n    _inScene->setScale(1.0f);\n    _inScene->setRotation(0.0f);\n    _inScene->setAdditionalTransform(identity);\n\n    _outScene->setVisible(false);\n    _outScene->setPosition(Point(0,0));\n    _outScene->setScale(1.0f);\n    _outScene->setRotation(0.0f);\n    _outScene->setAdditionalTransform(identity);\n\n    //[self schedule:@selector(setNewScene:) interval:0];\n    this->schedule(schedule_selector(TransitionScene::setNewScene), 0);\n}\n\nvoid TransitionScene::setNewScene(float dt)\n{    \n    CC_UNUSED_PARAM(dt);\n\n    this->unschedule(schedule_selector(TransitionScene::setNewScene));\n    \n    // Before replacing, save the \"send cleanup to scene\"\n    Director *director = Director::getInstance();\n    _isSendCleanupToScene = director->isSendCleanupToScene();\n    \n    director->replaceScene(_inScene);\n    \n    // issue #267\n    _outScene->setVisible(true);\n}\n\nvoid TransitionScene::hideOutShowIn()\n{\n    _inScene->setVisible(true);\n    _outScene->setVisible(false);\n}\n\n\n// custom onEnter\nvoid TransitionScene::onEnter()\n{\n    Scene::onEnter();\n    \n    // disable events while transitions\n    _eventDispatcher->setEnabled(false);\n    \n    // outScene should not receive the onEnter callback\n    // only the onExitTransitionDidStart\n    _outScene->onExitTransitionDidStart();\n    \n    _inScene->onEnter();\n}\n\n// custom onExit\nvoid TransitionScene::onExit()\n{\n    Scene::onExit();\n    \n    // enable events while transitions\n    _eventDispatcher->setEnabled(true);\n    _outScene->onExit();\n\n    // _inScene should not receive the onEnter callback\n    // only the onEnterTransitionDidFinish\n    _inScene->onEnterTransitionDidFinish();\n}\n\n// custom cleanup\nvoid TransitionScene::cleanup()\n{\n    Scene::cleanup();\n\n    if( _isSendCleanupToScene )\n        _outScene->cleanup();\n}\n\n//\n// Oriented Transition\n//\n\nTransitionSceneOriented::TransitionSceneOriented()\n{\n}\n\nTransitionSceneOriented::~TransitionSceneOriented()\n{\n}\n\nTransitionSceneOriented * TransitionSceneOriented::create(float t, Scene *scene, Orientation orientation)\n{\n    TransitionSceneOriented * newScene = new TransitionSceneOriented();\n    newScene->initWithDuration(t,scene,orientation);\n    newScene->autorelease();\n    return newScene;\n}\n\nbool TransitionSceneOriented::initWithDuration(float t, Scene *scene, Orientation orientation)\n{\n    if ( TransitionScene::initWithDuration(t, scene) )\n    {\n        _orientation = orientation;\n    }\n    return true;\n}\n\n//\n// RotoZoom\n//\nTransitionRotoZoom::TransitionRotoZoom()\n{\n}\n\nTransitionRotoZoom* TransitionRotoZoom::create(float t, Scene* scene)                   \n{                                                               \n    TransitionRotoZoom* newScene = new TransitionRotoZoom();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {                                                           \n        newScene->autorelease();\n        return newScene;\n    }                                                           \n    CC_SAFE_DELETE(newScene);                                     \n    return nullptr;                                                \n}\n\nTransitionRotoZoom::~TransitionRotoZoom()\n{\n}\n\nvoid TransitionRotoZoom:: onEnter()\n{\n    TransitionScene::onEnter();\n\n    _inScene->setScale(0.001f);\n    _outScene->setScale(1.0f);\n\n    _inScene->setAnchorPoint(Point(0.5f, 0.5f));\n    _outScene->setAnchorPoint(Point(0.5f, 0.5f));\n\n    ActionInterval *rotozoom = (ActionInterval*)(Sequence::create\n    (\n        Spawn::create\n        (\n            ScaleBy::create(_duration/2, 0.001f),\n            RotateBy::create(_duration/2, 360 * 2),\n            nullptr\n        ),\n        DelayTime::create(_duration/2),\n        nullptr\n    ));\n\n    _outScene->runAction(rotozoom);\n    _inScene->runAction\n    (\n        Sequence::create\n        (\n            rotozoom->reverse(),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        )\n    );\n}\n\n//\n// JumpZoom\n//\nTransitionJumpZoom::TransitionJumpZoom()\n{\n}\nTransitionJumpZoom::~TransitionJumpZoom()\n{\n}\n\nTransitionJumpZoom* TransitionJumpZoom::create(float t, Scene* scene)\n{\n    TransitionJumpZoom* newScene = new TransitionJumpZoom();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionJumpZoom::onEnter()\n{\n    TransitionScene::onEnter();\n    Size s = Director::getInstance()->getWinSize();\n\n    _inScene->setScale(0.5f);\n    _inScene->setPosition(Point(s.width, 0));\n    _inScene->setAnchorPoint(Point(0.5f, 0.5f));\n    _outScene->setAnchorPoint(Point(0.5f, 0.5f));\n\n    ActionInterval *jump = JumpBy::create(_duration/4, Point(-s.width,0), s.width/4, 2);\n    ActionInterval *scaleIn = ScaleTo::create(_duration/4, 1.0f);\n    ActionInterval *scaleOut = ScaleTo::create(_duration/4, 0.5f);\n\n    ActionInterval *jumpZoomOut = (ActionInterval*)(Sequence::create(scaleOut, jump, nullptr));\n    ActionInterval *jumpZoomIn = (ActionInterval*)(Sequence::create(jump, scaleIn, nullptr));\n\n    ActionInterval *delay = DelayTime::create(_duration/2);\n\n    _outScene->runAction(jumpZoomOut);\n    _inScene->runAction\n    (\n        Sequence::create\n        (\n            delay,\n            jumpZoomIn,\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        )\n    );\n}\n\n//\n// MoveInL\n//\nTransitionMoveInL::TransitionMoveInL()\n{\n}\n\nTransitionMoveInL::~TransitionMoveInL()\n{\n}\n\nTransitionMoveInL* TransitionMoveInL::create(float t, Scene* scene)\n{\n    TransitionMoveInL* newScene = new TransitionMoveInL();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionMoveInL::onEnter()\n{\n    TransitionScene::onEnter();\n    this->initScenes();\n\n    ActionInterval *a = this->action();\n\n    _inScene->runAction\n    (\n        Sequence::create\n        (\n            this->easeActionWithAction(a),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        )\n    );\n}\n \nActionInterval* TransitionMoveInL::action()\n{\n    return MoveTo::create(_duration, Point(0,0));\n}\n\nActionInterval* TransitionMoveInL::easeActionWithAction(ActionInterval* action)\n{\n    return EaseOut::create(action, 2.0f);\n//    return [EaseElasticOut actionWithAction:action period:0.4f];\n}\n\nvoid TransitionMoveInL::initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition(Point(-s.width,0));\n}\n\n//\n// MoveInR\n//\nTransitionMoveInR::TransitionMoveInR()\n{\n}\nTransitionMoveInR::~TransitionMoveInR()\n{\n}\n\nTransitionMoveInR* TransitionMoveInR::create(float t, Scene* scene)\n{\n    TransitionMoveInR* newScene = new TransitionMoveInR();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionMoveInR::initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition( Point(s.width,0) );\n}\n\n//\n// MoveInT\n//\nTransitionMoveInT::TransitionMoveInT()\n{\n}\nTransitionMoveInT::~TransitionMoveInT()\n{\n}\n\nTransitionMoveInT* TransitionMoveInT::create(float t, Scene* scene)\n{\n    TransitionMoveInT* newScene = new TransitionMoveInT();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionMoveInT::initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition( Point(0,s.height) );\n}\n\n//\n// MoveInB\n//\nTransitionMoveInB::TransitionMoveInB()\n{\n}\nTransitionMoveInB::~TransitionMoveInB()\n{\n}\n\nTransitionMoveInB* TransitionMoveInB::create(float t, Scene* scene)\n{\n    TransitionMoveInB* newScene = new TransitionMoveInB();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionMoveInB::initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition( Point(0,-s.height) );\n}\n\n\n//\n// SlideInL\n//\n\n// The adjust factor is needed to prevent issue #442\n// One solution is to use DONT_RENDER_IN_SUBPIXELS images, but NO\n// The other issue is that in some transitions (and I don't know why)\n// the order should be reversed (In in top of Out or vice-versa).\n#define ADJUST_FACTOR 0.5f\nTransitionSlideInL::TransitionSlideInL()\n{\n}\n\nTransitionSlideInL::~TransitionSlideInL()\n{\n}\n\nvoid TransitionSlideInL::onEnter()\n{\n    TransitionScene::onEnter();\n    this->initScenes();\n\n    ActionInterval *in = this->action();\n    ActionInterval *out = this->action();\n\n    ActionInterval* inAction = easeActionWithAction(in);\n    ActionInterval* outAction = (ActionInterval*)Sequence::create\n    (\n        easeActionWithAction(out),\n        CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n        nullptr\n    );\n    _inScene->runAction(inAction);\n    _outScene->runAction(outAction);\n}\n\nvoid TransitionSlideInL::sceneOrder()\n{\n    _isInSceneOnTop = false;\n}\n\nvoid TransitionSlideInL:: initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition( Point(-(s.width-ADJUST_FACTOR),0) );\n}\n\nActionInterval* TransitionSlideInL::action()\n{\n    Size s = Director::getInstance()->getWinSize();\n    return MoveBy::create(_duration, Point(s.width-ADJUST_FACTOR,0));\n}\n\nActionInterval* TransitionSlideInL::easeActionWithAction(ActionInterval* action)\n{\n    return EaseOut::create(action, 2.0f);\n}\n\nTransitionSlideInL* TransitionSlideInL::create(float t, Scene* scene)\n{\n    TransitionSlideInL* newScene = new TransitionSlideInL();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\n//\n// SlideInR\n//\nTransitionSlideInR::TransitionSlideInR()\n{\n}\nTransitionSlideInR::~TransitionSlideInR()\n{\n}\n\nTransitionSlideInR* TransitionSlideInR::create(float t, Scene* scene)\n{\n    TransitionSlideInR* newScene = new TransitionSlideInR();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionSlideInR::sceneOrder()\n{\n    _isInSceneOnTop = true;\n}\n\nvoid TransitionSlideInR::initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition( Point(s.width-ADJUST_FACTOR,0) );\n}\n\n\nActionInterval* TransitionSlideInR:: action()\n{\n    Size s = Director::getInstance()->getWinSize();\n    return MoveBy::create(_duration, Point(-(s.width-ADJUST_FACTOR),0));\n}\n\n\n//\n// SlideInT\n//\nTransitionSlideInT::TransitionSlideInT()\n{\n}\nTransitionSlideInT::~TransitionSlideInT()\n{\n}\n\nTransitionSlideInT* TransitionSlideInT::create(float t, Scene* scene)\n{\n    TransitionSlideInT* newScene = new TransitionSlideInT();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionSlideInT::sceneOrder()\n{\n    _isInSceneOnTop = false;\n}\n\nvoid TransitionSlideInT::initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition( Point(0,s.height-ADJUST_FACTOR) );\n}\n\n\nActionInterval* TransitionSlideInT::action()\n{\n    Size s = Director::getInstance()->getWinSize();\n    return MoveBy::create(_duration, Point(0,-(s.height-ADJUST_FACTOR)));\n}\n\n//\n// SlideInB\n//\nTransitionSlideInB::TransitionSlideInB()\n{\n}\nTransitionSlideInB::~TransitionSlideInB()\n{\n}\n\nTransitionSlideInB* TransitionSlideInB::create(float t, Scene* scene)\n{\n    TransitionSlideInB* newScene = new TransitionSlideInB();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionSlideInB::sceneOrder()\n{\n    _isInSceneOnTop = true;\n}\n\nvoid TransitionSlideInB:: initScenes()\n{\n    Size s = Director::getInstance()->getWinSize();\n    _inScene->setPosition( Point(0,-(s.height-ADJUST_FACTOR)) );\n}\n\n\nActionInterval* TransitionSlideInB:: action()\n{\n    Size s = Director::getInstance()->getWinSize();\n    return MoveBy::create(_duration, Point(0,s.height-ADJUST_FACTOR));\n}\n\n//\n// ShrinkGrow Transition\n//\nTransitionShrinkGrow::TransitionShrinkGrow()\n{\n}\nTransitionShrinkGrow::~TransitionShrinkGrow()\n{\n}\n\nTransitionShrinkGrow* TransitionShrinkGrow::create(float t, Scene* scene)\n{\n    TransitionShrinkGrow* newScene = new TransitionShrinkGrow();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionShrinkGrow::onEnter()\n{\n    TransitionScene::onEnter();\n\n    _inScene->setScale(0.001f);\n    _outScene->setScale(1.0f);\n\n    _inScene->setAnchorPoint(Point(2/3.0f,0.5f));\n    _outScene->setAnchorPoint(Point(1/3.0f,0.5f));    \n\n    ActionInterval* scaleOut = ScaleTo::create(_duration, 0.01f);\n    ActionInterval* scaleIn = ScaleTo::create(_duration, 1.0f);\n\n    _inScene->runAction(this->easeActionWithAction(scaleIn));\n    _outScene->runAction\n    (\n        Sequence::create\n        (\n            this->easeActionWithAction(scaleOut),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        )\n    );\n}\nActionInterval* TransitionShrinkGrow:: easeActionWithAction(ActionInterval* action)\n{\n    return EaseOut::create(action, 2.0f);\n//    return [EaseElasticOut actionWithAction:action period:0.3f];\n}\n\n//\n// FlipX Transition\n//\nTransitionFlipX::TransitionFlipX()\n{\n}\nTransitionFlipX::~TransitionFlipX()\n{\n}\n\nvoid TransitionFlipX::onEnter()\n{\n    TransitionSceneOriented::onEnter();\n\n    ActionInterval *inA, *outA;\n    _inScene->setVisible(false);\n\n    float inDeltaZ, inAngleZ;\n    float outDeltaZ, outAngleZ;\n\n    if( _orientation == TransitionScene::Orientation::RIGHT_OVER )\n    {\n        inDeltaZ = 90;\n        inAngleZ = 270;\n        outDeltaZ = 90;\n        outAngleZ = 0;\n    }\n    else\n    {\n        inDeltaZ = -90;\n        inAngleZ = 90;\n        outDeltaZ = -90;\n        outAngleZ = 0;\n    }\n\n    inA = (ActionInterval*)Sequence::create\n        (\n            DelayTime::create(_duration/2),\n            Show::create(),\n            OrbitCamera::create(_duration/2, 1, 0, inAngleZ, inDeltaZ, 0, 0),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        );\n\n    outA = (ActionInterval *)Sequence::create\n        (\n            OrbitCamera::create(_duration/2, 1, 0, outAngleZ, outDeltaZ, 0, 0),\n            Hide::create(),\n            DelayTime::create(_duration/2),                            \n            nullptr \n        );\n\n    _inScene->runAction(inA);\n    _outScene->runAction(outA);\n}\n\nTransitionFlipX* TransitionFlipX::create(float t, Scene* s, Orientation o)\n{\n    TransitionFlipX* newScene = new TransitionFlipX();\n    newScene->initWithDuration(t, s, o);\n    newScene->autorelease();\n\n    return newScene;\n}\n\nTransitionFlipX* TransitionFlipX::create(float t, Scene* s)\n{\n    return TransitionFlipX::create(t, s, TransitionScene::Orientation::RIGHT_OVER);\n}\n\n//\n// FlipY Transition\n//\nTransitionFlipY::TransitionFlipY()\n{\n}\nTransitionFlipY::~TransitionFlipY()\n{\n}\n\nvoid TransitionFlipY::onEnter()\n{\n    TransitionSceneOriented::onEnter();\n\n    ActionInterval *inA, *outA;\n    _inScene->setVisible(false);\n\n    float inDeltaZ, inAngleZ;\n    float outDeltaZ, outAngleZ;\n\n    if( _orientation == TransitionScene::Orientation::UP_OVER ) \n    {\n        inDeltaZ = 90;\n        inAngleZ = 270;\n        outDeltaZ = 90;\n        outAngleZ = 0;\n    } \n    else \n    {\n        inDeltaZ = -90;\n        inAngleZ = 90;\n        outDeltaZ = -90;\n        outAngleZ = 0;\n    }\n\n    inA = (ActionInterval*)Sequence::create\n        (\n            DelayTime::create(_duration/2),\n            Show::create(),\n            OrbitCamera::create(_duration/2, 1, 0, inAngleZ, inDeltaZ, 90, 0),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        );\n    outA = (ActionInterval*)Sequence::create\n        (\n            OrbitCamera::create(_duration/2, 1, 0, outAngleZ, outDeltaZ, 90, 0),\n            Hide::create(),\n            DelayTime::create(_duration/2),                            \n            nullptr\n        );\n\n    _inScene->runAction(inA);\n    _outScene->runAction(outA);\n\n}\n\nTransitionFlipY* TransitionFlipY::create(float t, Scene* s, Orientation o)\n{\n    TransitionFlipY* newScene = new TransitionFlipY();\n    newScene->initWithDuration(t, s, o);\n    newScene->autorelease();\n\n    return newScene;\n}\n\nTransitionFlipY* TransitionFlipY::create(float t, Scene* s)\n{\n    return TransitionFlipY::create(t, s, TransitionScene::Orientation::UP_OVER);\n}\n\n//\n// FlipAngular Transition\n//\nTransitionFlipAngular::TransitionFlipAngular()\n{\n}\n\nTransitionFlipAngular::~TransitionFlipAngular()\n{\n}\n\nvoid TransitionFlipAngular::onEnter()\n{\n    TransitionSceneOriented::onEnter();\n\n    ActionInterval *inA, *outA;\n    _inScene->setVisible(false);\n\n    float inDeltaZ, inAngleZ;\n    float outDeltaZ, outAngleZ;\n\n    if( _orientation == TransitionScene::Orientation::RIGHT_OVER ) \n    {\n        inDeltaZ = 90;\n        inAngleZ = 270;\n        outDeltaZ = 90;\n        outAngleZ = 0;\n    } \n    else \n    {\n        inDeltaZ = -90;\n        inAngleZ = 90;\n        outDeltaZ = -90;\n        outAngleZ = 0;\n    }\n\n    inA = (ActionInterval *)Sequence::create\n        (\n            DelayTime::create(_duration/2),\n            Show::create(),\n            OrbitCamera::create(_duration/2, 1, 0, inAngleZ, inDeltaZ, -45, 0),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        );\n    outA = (ActionInterval *)Sequence::create\n        (\n            OrbitCamera::create(_duration/2, 1, 0, outAngleZ, outDeltaZ, 45, 0),\n            Hide::create(),\n            DelayTime::create(_duration/2),                            \n            nullptr\n        );\n\n    _inScene->runAction(inA);\n    _outScene->runAction(outA);\n}\n\nTransitionFlipAngular* TransitionFlipAngular::create(float t, Scene* s, Orientation o)\n{\n    TransitionFlipAngular* newScene = new TransitionFlipAngular();\n    newScene->initWithDuration(t, s, o);\n    newScene->autorelease();\n\n    return newScene;\n}\n\nTransitionFlipAngular* TransitionFlipAngular::create(float t, Scene* s)\n{\n    return TransitionFlipAngular::create(t, s, TransitionScene::Orientation::RIGHT_OVER);\n}\n\n//\n// ZoomFlipX Transition\n//\nTransitionZoomFlipX::TransitionZoomFlipX()\n{\n}\nTransitionZoomFlipX::~TransitionZoomFlipX()\n{\n}\n\nvoid TransitionZoomFlipX::onEnter()\n{\n    TransitionSceneOriented::onEnter();\n\n    ActionInterval *inA, *outA;\n    _inScene->setVisible(false);\n\n    float inDeltaZ, inAngleZ;\n    float outDeltaZ, outAngleZ;\n\n    if( _orientation == TransitionScene::Orientation::RIGHT_OVER ) {\n        inDeltaZ = 90;\n        inAngleZ = 270;\n        outDeltaZ = 90;\n        outAngleZ = 0;\n    } \n    else \n    {\n        inDeltaZ = -90;\n        inAngleZ = 90;\n        outDeltaZ = -90;\n        outAngleZ = 0;\n    }\n    inA = (ActionInterval *)Sequence::create\n        (\n            DelayTime::create(_duration/2),\n            Spawn::create\n            (\n                OrbitCamera::create(_duration/2, 1, 0, inAngleZ, inDeltaZ, 0, 0),\n                ScaleTo::create(_duration/2, 1),\n                Show::create(),\n                nullptr\n            ),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        );\n    outA = (ActionInterval *)Sequence::create\n        (\n            Spawn::create\n            (\n                OrbitCamera::create(_duration/2, 1, 0, outAngleZ, outDeltaZ, 0, 0),\n                ScaleTo::create(_duration/2, 0.5f),\n                nullptr\n            ),\n            Hide::create(),\n            DelayTime::create(_duration/2),                            \n            nullptr\n        );\n\n    _inScene->setScale(0.5f);\n    _inScene->runAction(inA);\n    _outScene->runAction(outA);\n}\n\nTransitionZoomFlipX* TransitionZoomFlipX::create(float t, Scene* s, Orientation o)\n{\n    TransitionZoomFlipX* newScene = new TransitionZoomFlipX();\n    newScene->initWithDuration(t, s, o);\n    newScene->autorelease();\n\n    return newScene;\n}\n\nTransitionZoomFlipX* TransitionZoomFlipX::create(float t, Scene* s)\n{\n    return TransitionZoomFlipX::create(t, s, TransitionScene::Orientation::RIGHT_OVER);\n}\n\n//\n// ZoomFlipY Transition\n//\nTransitionZoomFlipY::TransitionZoomFlipY()\n{\n}\n\nTransitionZoomFlipY::~TransitionZoomFlipY()\n{\n}\n\nvoid TransitionZoomFlipY::onEnter()\n{\n    TransitionSceneOriented::onEnter();\n\n    ActionInterval *inA, *outA;\n    _inScene->setVisible(false);\n\n    float inDeltaZ, inAngleZ;\n    float outDeltaZ, outAngleZ;\n\n    if( _orientation== TransitionScene::Orientation::UP_OVER ) {\n        inDeltaZ = 90;\n        inAngleZ = 270;\n        outDeltaZ = 90;\n        outAngleZ = 0;\n    } else {\n        inDeltaZ = -90;\n        inAngleZ = 90;\n        outDeltaZ = -90;\n        outAngleZ = 0;\n    }\n\n    inA = (ActionInterval *)Sequence::create\n        (\n            DelayTime::create(_duration/2),\n            Spawn::create\n            (\n                OrbitCamera::create(_duration/2, 1, 0, inAngleZ, inDeltaZ, 90, 0),\n                ScaleTo::create(_duration/2, 1),\n                Show::create(),\n                nullptr\n            ),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        );\n\n    outA = (ActionInterval *)Sequence::create\n        (\n            Spawn::create\n            (\n                OrbitCamera::create(_duration/2, 1, 0, outAngleZ, outDeltaZ, 90, 0),\n                ScaleTo::create(_duration/2, 0.5f),\n                nullptr\n            ),                            \n            Hide::create(),\n            DelayTime::create(_duration/2),\n            nullptr\n        );\n\n    _inScene->setScale(0.5f);\n    _inScene->runAction(inA);\n    _outScene->runAction(outA);\n}\n\nTransitionZoomFlipY* TransitionZoomFlipY::create(float t, Scene* s, Orientation o)\n{\n    TransitionZoomFlipY* newScene = new TransitionZoomFlipY();\n    newScene->initWithDuration(t, s, o);\n    newScene->autorelease();\n\n    return newScene;\n}\n\nTransitionZoomFlipY* TransitionZoomFlipY::create(float t, Scene* s)\n{\n    return TransitionZoomFlipY::create(t, s, TransitionScene::Orientation::UP_OVER);\n}\n\n//\n// ZoomFlipAngular Transition\n//\nTransitionZoomFlipAngular::TransitionZoomFlipAngular()\n{\n}\nTransitionZoomFlipAngular::~TransitionZoomFlipAngular()\n{\n}\n\n\nvoid TransitionZoomFlipAngular::onEnter()\n{\n    TransitionSceneOriented::onEnter();\n\n    ActionInterval *inA, *outA;\n    _inScene->setVisible(false);\n\n    float inDeltaZ, inAngleZ;\n    float outDeltaZ, outAngleZ;\n\n    if( _orientation == TransitionScene::Orientation::RIGHT_OVER ) {\n        inDeltaZ = 90;\n        inAngleZ = 270;\n        outDeltaZ = 90;\n        outAngleZ = 0;\n    } \n    else \n    {\n        inDeltaZ = -90;\n        inAngleZ = 90;\n        outDeltaZ = -90;\n        outAngleZ = 0;\n    }\n\n    inA = (ActionInterval *)Sequence::create\n        (\n            DelayTime::create(_duration/2),\n            Spawn::create\n            (\n                OrbitCamera::create(_duration/2, 1, 0, inAngleZ, inDeltaZ, -45, 0),\n                ScaleTo::create(_duration/2, 1),\n                Show::create(),\n                nullptr\n            ),\n            Show::create(),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            nullptr\n        );\n    outA = (ActionInterval *)Sequence::create\n        (\n            Spawn::create\n            (\n                OrbitCamera::create(_duration/2, 1, 0 , outAngleZ, outDeltaZ, 45, 0),\n                ScaleTo::create(_duration/2, 0.5f),\n                nullptr\n            ),                            \n            Hide::create(),\n            DelayTime::create(_duration/2),                            \n            nullptr\n        );\n\n    _inScene->setScale(0.5f);\n    _inScene->runAction(inA);\n    _outScene->runAction(outA);\n}\n\nTransitionZoomFlipAngular* TransitionZoomFlipAngular::create(float t, Scene* s, Orientation o)\n{\n    TransitionZoomFlipAngular* newScene = new TransitionZoomFlipAngular();\n    newScene->initWithDuration(t, s, o);\n    newScene->autorelease();\n\n    return newScene;\n}\n\nTransitionZoomFlipAngular* TransitionZoomFlipAngular::create(float t, Scene* s)\n{\n    return TransitionZoomFlipAngular::create(t, s, TransitionScene::Orientation::RIGHT_OVER);\n}\n\n//\n// Fade Transition\n//\nTransitionFade::TransitionFade()\n{\n}\nTransitionFade::~TransitionFade()\n{\n}\n\nTransitionFade * TransitionFade::create(float duration, Scene *scene, const Color3B& color)\n{\n    TransitionFade * transition = new TransitionFade();\n    transition->initWithDuration(duration, scene, color);\n    transition->autorelease();\n    return transition;\n}\n\nTransitionFade* TransitionFade::create(float duration,Scene* scene)\n{\n    return TransitionFade::create(duration, scene, Color3B::BLACK);\n}\n\nbool TransitionFade::initWithDuration(float duration, Scene *scene, const Color3B& color)\n{\n    if (TransitionScene::initWithDuration(duration, scene))\n    {\n        _color.r = color.r;\n        _color.g = color.g;\n        _color.b = color.b;\n        _color.a = 0;\n    }\n    return true;\n}\n\nbool TransitionFade::initWithDuration(float t, Scene *scene)\n{\n    this->initWithDuration(t, scene, Color3B::BLACK);\n    return true;\n}\n\nvoid TransitionFade :: onEnter()\n{\n    TransitionScene::onEnter();\n\n    LayerColor* l = LayerColor::create(_color);\n    _inScene->setVisible(false);\n\n    addChild(l, 2, kSceneFade);\n    Node* f = getChildByTag(kSceneFade);\n\n    ActionInterval* a = (ActionInterval *)Sequence::create\n        (\n            FadeIn::create(_duration/2),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn,this)),\n            FadeOut::create(_duration/2),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n\n         nullptr\n        );\n    f->runAction(a);\n}\n\nvoid TransitionFade::onExit()\n{\n    TransitionScene::onExit();\n    this->removeChildByTag(kSceneFade, false);\n}\n\n//\n// Cross Fade Transition\n//\nTransitionCrossFade::TransitionCrossFade()\n{\n}\nTransitionCrossFade::~TransitionCrossFade()\n{\n}\n\nTransitionCrossFade* TransitionCrossFade::create(float t, Scene* scene)\n{\n    TransitionCrossFade* newScene = new TransitionCrossFade();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionCrossFade::draw()\n{\n    // override draw since both scenes (textures) are rendered in 1 scene\n}\n\nvoid TransitionCrossFade::onEnter()\n{\n    TransitionScene::onEnter();\n\n    // create a transparent color layer\n    // in which we are going to add our rendertextures\n    Color4B  color(0,0,0,0);\n    Size size = Director::getInstance()->getWinSize();\n    LayerColor* layer = LayerColor::create(color);\n\n    // create the first render texture for inScene\n    RenderTexture* inTexture = RenderTexture::create((int)size.width, (int)size.height);\n\n    if (nullptr == inTexture)\n    {\n        return;\n    }\n\n    inTexture->getSprite()->setAnchorPoint( Point(0.5f,0.5f) );\n    inTexture->setPosition( Point(size.width/2, size.height/2) );\n    inTexture->setAnchorPoint( Point(0.5f,0.5f) );\n\n    // render inScene to its texturebuffer\n    inTexture->begin();\n    _inScene->visit();\n    inTexture->end();\n\n    // create the second render texture for outScene\n    RenderTexture* outTexture = RenderTexture::create((int)size.width, (int)size.height);\n    outTexture->getSprite()->setAnchorPoint( Point(0.5f,0.5f) );\n    outTexture->setPosition( Point(size.width/2, size.height/2) );\n    outTexture->setAnchorPoint( Point(0.5f,0.5f) );\n\n    // render outScene to its texturebuffer\n    outTexture->begin();\n    _outScene->visit();\n    outTexture->end();\n\n    // create blend functions\n\n    BlendFunc blend1 = {GL_ONE, GL_ONE}; // inScene will lay on background and will not be used with alpha\n    BlendFunc blend2 = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; // we are going to blend outScene via alpha \n\n    // set blendfunctions\n    inTexture->getSprite()->setBlendFunc(blend1);\n    outTexture->getSprite()->setBlendFunc(blend2);    \n\n    // add render textures to the layer\n    layer->addChild(inTexture);\n    layer->addChild(outTexture);\n\n    // initial opacity:\n    inTexture->getSprite()->setOpacity(255);\n    outTexture->getSprite()->setOpacity(255);\n\n    // create the blend action\n    Action* layerAction = Sequence::create\n    (\n        FadeTo::create(_duration, 0),\n        CallFunc::create(CC_CALLBACK_0(TransitionScene::hideOutShowIn,this)),\n        CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n        nullptr\n    );\n\n\n    // run the blend action\n    outTexture->getSprite()->runAction( layerAction );\n\n    // add the layer (which contains our two rendertextures) to the scene\n    addChild(layer, 2, kSceneFade);\n}\n\n// clean up on exit\nvoid TransitionCrossFade::onExit()\n{\n    // remove our layer and release all containing objects \n    this->removeChildByTag(kSceneFade, false);\n    TransitionScene::onExit();\n}\n\n//\n// TurnOffTilesTransition\n//\nTransitionTurnOffTiles::TransitionTurnOffTiles()\n{\n    _outSceneProxy = NodeGrid::create();\n    _outSceneProxy->retain();\n}\n\nTransitionTurnOffTiles::~TransitionTurnOffTiles()\n{\n    CC_SAFE_RELEASE(_outSceneProxy);\n}\n\nTransitionTurnOffTiles* TransitionTurnOffTiles::create(float t, Scene* scene)\n{\n    TransitionTurnOffTiles* newScene = new TransitionTurnOffTiles();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\n// override addScenes, and change the order\nvoid TransitionTurnOffTiles::sceneOrder()\n{\n    _isInSceneOnTop = false;\n}\n\nvoid TransitionTurnOffTiles::onEnter()\n{\n    TransitionScene::onEnter();\n    _outSceneProxy->setTarget(_outScene);\n    _outSceneProxy->onEnter();\n\n    Size s = Director::getInstance()->getWinSize();\n    float aspect = s.width / s.height;\n    int x = (int)(12 * aspect);\n    int y = 12;\n\n    TurnOffTiles* toff = TurnOffTiles::create(_duration, Size(x,y));\n    ActionInterval* action = easeActionWithAction(toff);\n    _outSceneProxy->runAction\n    (\n        Sequence::create\n        (\n            action,\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            StopGrid::create(),\n            nullptr\n        )\n    );\n}\n\nvoid TransitionTurnOffTiles::onExit()\n{\n    _outSceneProxy->setTarget(nullptr);\n    _outSceneProxy->onExit();\n    TransitionScene::onExit();\n}\n\nvoid TransitionTurnOffTiles::draw()\n{\n    Scene::draw();\n    \n    if( _isInSceneOnTop )\n    {\n        _outSceneProxy->visit();\n        _inScene->visit();\n    } \n    else\n    {\n        _inScene->visit();\n        _outSceneProxy->visit();\n    }\n}\n\n\nActionInterval* TransitionTurnOffTiles:: easeActionWithAction(ActionInterval* action)\n{\n    return action;\n}\n\n//\n// SplitCols Transition\n//\nTransitionSplitCols::TransitionSplitCols()\n{\n    _gridProxy = NodeGrid::create();\n    _gridProxy->retain();\n}\nTransitionSplitCols::~TransitionSplitCols()\n{\n    CC_SAFE_RELEASE(_gridProxy);\n}\n\nTransitionSplitCols* TransitionSplitCols::create(float t, Scene* scene)\n{\n    TransitionSplitCols* newScene = new TransitionSplitCols();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionSplitCols::onEnter()\n{\n    TransitionScene::onEnter();\n\n    _gridProxy->setTarget(_outScene);\n    _gridProxy->onEnter();\n\n    ActionInterval* split = action();\n    ActionInterval* seq = (ActionInterval*)Sequence::create\n    (\n        split,\n        CallFunc::create(CC_CALLBACK_0(TransitionSplitCols::switchTargetToInscene,this)),\n        split->reverse(),\n        nullptr\n    );\n\n    _gridProxy->runAction\n    ( \n        Sequence::create\n        (\n            easeActionWithAction(seq),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            StopGrid::create(),\n            nullptr\n        )\n    );\n}\n\nvoid TransitionSplitCols::switchTargetToInscene()\n{\n    _gridProxy->setTarget(_inScene);\n}\n\nvoid TransitionSplitCols::draw()\n{\n    Scene::draw();\n    _gridProxy->visit();\n}\n\nvoid TransitionSplitCols::onExit()\n{\n    _gridProxy->setTarget(nullptr);\n    _gridProxy->onExit();\n    TransitionScene::onExit();\n}\n\nActionInterval* TransitionSplitCols:: action()\n{\n    return SplitCols::create(_duration/2.0f, 3);\n}\n\n\nActionInterval* TransitionSplitCols::easeActionWithAction(ActionInterval * action)\n{\n    return EaseInOut::create(action, 3.0f);\n}\n\n\n//\n// SplitRows Transition\n//\nTransitionSplitRows::TransitionSplitRows()\n{\n}\n\nTransitionSplitRows::~TransitionSplitRows()\n{\n}\n\nActionInterval* TransitionSplitRows::action()\n{\n    return SplitRows::create(_duration/2.0f, 3);\n}\n\nTransitionSplitRows* TransitionSplitRows::create(float t, Scene* scene)\n{\n    TransitionSplitRows* newScene = new TransitionSplitRows();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\n//\n// FadeTR Transition\n//\nTransitionFadeTR::TransitionFadeTR()\n{\n    _outSceneProxy = NodeGrid::create();\n    _outSceneProxy->retain();\n}\nTransitionFadeTR::~TransitionFadeTR()\n{\n    CC_SAFE_RELEASE(_outSceneProxy);\n}\n\nTransitionFadeTR* TransitionFadeTR::create(float t, Scene* scene)\n{\n    TransitionFadeTR* newScene = new TransitionFadeTR();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionFadeTR::sceneOrder()\n{\n    _isInSceneOnTop = false;\n}\n\nvoid TransitionFadeTR::onEnter()\n{\n    TransitionScene::onEnter();\n\n    _outSceneProxy->setTarget(_outScene);\n    _outSceneProxy->onEnter();\n\n    Size s = Director::getInstance()->getWinSize();\n    float aspect = s.width / s.height;\n    int x = (int)(12 * aspect);\n    int y = 12;\n\n    ActionInterval* action  = actionWithSize(Size(x,y));\n\n    _outSceneProxy->runAction\n    (\n        Sequence::create\n        (\n            easeActionWithAction(action),\n            CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n            StopGrid::create(),\n            nullptr\n        )\n    );\n}\n\nvoid TransitionFadeTR::onExit()\n{\n    _outSceneProxy->setTarget(nullptr);\n    _outSceneProxy->onExit();\n    TransitionScene::onExit();\n}\n\nvoid TransitionFadeTR::draw()\n{\n    Scene::draw();\n    \n    if( _isInSceneOnTop )\n    {\n        _outSceneProxy->visit();\n        _inScene->visit();\n    } \n    else\n    {\n        _inScene->visit();\n        _outSceneProxy->visit();\n    }\n}\n\nActionInterval*  TransitionFadeTR::actionWithSize(const Size& size)\n{\n    return FadeOutTRTiles::create(_duration, size);\n}\n\nActionInterval* TransitionFadeTR:: easeActionWithAction(ActionInterval* action)\n{\n    return action;\n}\n\n\n//\n// FadeBL Transition\n//\n\nTransitionFadeBL::TransitionFadeBL()\n{\n}\nTransitionFadeBL::~TransitionFadeBL()\n{\n}\n\nTransitionFadeBL* TransitionFadeBL::create(float t, Scene* scene)\n{\n    TransitionFadeBL* newScene = new TransitionFadeBL();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nActionInterval*  TransitionFadeBL::actionWithSize(const Size& size)\n{\n    return FadeOutBLTiles::create(_duration, size);\n}\n\n//\n// FadeUp Transition\n//\nTransitionFadeUp::TransitionFadeUp()\n{\n}\n\nTransitionFadeUp::~TransitionFadeUp()\n{\n}\n\nTransitionFadeUp* TransitionFadeUp::create(float t, Scene* scene)\n{\n    TransitionFadeUp* newScene = new TransitionFadeUp();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nActionInterval* TransitionFadeUp::actionWithSize(const Size& size)\n{\n    return FadeOutUpTiles::create(_duration, size);\n}\n\n//\n// FadeDown Transition\n//\nTransitionFadeDown::TransitionFadeDown()\n{\n}\nTransitionFadeDown::~TransitionFadeDown()\n{\n}\n\nTransitionFadeDown* TransitionFadeDown::create(float t, Scene* scene)\n{\n    TransitionFadeDown* newScene = new TransitionFadeDown();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nActionInterval* TransitionFadeDown::actionWithSize(const Size& size)\n{\n    return FadeOutDownTiles::create(_duration, size);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTransition.h",
    "content": "/****************************************************************************\nCopyright (c) 2009-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTRANSITION_H__\n#define __CCTRANSITION_H__\n\n#include \"CCScene.h\"\n#include \"ccTypes.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup transition\n * @{\n */\n\n//static creation function macro\n//c/c++ don't support object creation of using class name\n//so, all classes need creation method.\n\nclass ActionInterval;\nclass Node;\nclass NodeGrid;\n\n/** @brief TransitionEaseScene can ease the actions of the scene protocol.\n@since v0.8.2\n*/\nclass CC_DLL TransitionEaseScene// : public Object\n{\npublic:\n    virtual ~TransitionEaseScene() {}\n\n    /** returns the Ease action that will be performed on a linear action.\n    @since v0.8.2\n    */\n    virtual ActionInterval * easeActionWithAction(ActionInterval * action) = 0;\n};\n\n/** @brief Base class for Transition scenes\n*/\nclass CC_DLL TransitionScene : public Scene\n{\npublic:\n    /** Orientation Type used by some transitions\n     */\n    enum class Orientation\n    {\n        /// An horizontal orientation where the Left is nearer\n        LEFT_OVER = 0,\n        /// An horizontal orientation where the Right is nearer\n        RIGHT_OVER = 1,\n        /// A vertical orientation where the Up is nearer\n        UP_OVER = 0,\n        /// A vertical orientation where the Bottom is nearer\n        DOWN_OVER = 1,\n    };\n    \n    /** creates a base transition with duration and incoming scene */\n    static TransitionScene * create(float t, Scene *scene);\n\n    /** called after the transition finishes */\n    void finish(void);\n\n    /** used by some transitions to hide the outer scene */\n    void hideOutShowIn(void);\n\n    //\n    // Overrides\n    //\n    virtual void draw() override;\n    virtual void onEnter() override;\n    virtual void onExit() override;\n    virtual void cleanup() override;\n\nprotected:\n    TransitionScene();\n    virtual ~TransitionScene();\n    /** initializes a transition with duration and incoming scene */\n    bool initWithDuration(float t,Scene* scene);\n\n    virtual void sceneOrder();\n    void setNewScene(float dt);\n\n    Scene *_inScene;\n    Scene *_outScene;\n    float _duration;\n    bool _isInSceneOnTop;\n    bool _isSendCleanupToScene;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionScene);\n};\n\n/** @brief A Transition that supports orientation like.\n* Possible orientation: LeftOver, RightOver, UpOver, DownOver\n*/\nclass CC_DLL TransitionSceneOriented : public TransitionScene\n{\npublic:\n    /** creates a base transition with duration and incoming scene */\n    static TransitionSceneOriented * create(float t,Scene* scene, Orientation orientation);\n\nprotected:\n    TransitionSceneOriented();\n    virtual ~TransitionSceneOriented();\n\n    /** initializes a transition with duration and incoming scene */\n    bool initWithDuration(float t,Scene* scene,Orientation orientation);\n\n    Orientation _orientation;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionSceneOriented);\n};\n\n/** @brief TransitionRotoZoom:\nRotate and zoom out the outgoing scene, and then rotate and zoom in the incoming \n*/\nclass CC_DLL TransitionRotoZoom : public TransitionScene\n{\npublic:\n    static TransitionRotoZoom* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    virtual void onEnter() override;\n\nprotected:\n    TransitionRotoZoom();\n    virtual ~TransitionRotoZoom();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionRotoZoom);\n\n};\n\n/** @brief TransitionJumpZoom:\nZoom out and jump the outgoing scene, and then jump and zoom in the incoming \n*/\nclass CC_DLL TransitionJumpZoom : public TransitionScene\n{\npublic:\n    static TransitionJumpZoom* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    virtual void onEnter() override;\n\nprotected:\n    TransitionJumpZoom();\n    virtual ~TransitionJumpZoom();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionJumpZoom);\n};\n\n/** @brief TransitionMoveInL:\nMove in from to the left the incoming scene.\n*/\nclass CC_DLL TransitionMoveInL : public TransitionScene, public TransitionEaseScene\n{\npublic:\n    static TransitionMoveInL* create(float t, Scene* scene);\n\n    /** returns the action that will be performed */\n    virtual ActionInterval* action(void);\n\n    virtual ActionInterval* easeActionWithAction(ActionInterval * action);\n\n    //\n    // Overrides\n    //\n    virtual void onEnter() override;\n\nprotected:\n    TransitionMoveInL();\n    virtual ~TransitionMoveInL();\n\n    /** initializes the scenes */\n    virtual void initScenes();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInL);\n};\n\n/** @brief TransitionMoveInR:\nMove in from to the right the incoming scene.\n*/\nclass CC_DLL TransitionMoveInR : public TransitionMoveInL\n{\npublic:\n    static TransitionMoveInR* create(float t, Scene* scene);\n\nprotected:\n    TransitionMoveInR();\n    virtual ~TransitionMoveInR();\n\n    virtual void initScenes();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInR);\n};\n\n/** @brief TransitionMoveInT:\nMove in from to the top the incoming scene.\n*/\nclass CC_DLL TransitionMoveInT : public TransitionMoveInL \n{\npublic:\n    static TransitionMoveInT* create(float t, Scene* scene);\n\nprotected:\n    TransitionMoveInT();\n    virtual ~TransitionMoveInT();\n\n    virtual void initScenes();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInT);\n};\n\n/** @brief TransitionMoveInB:\nMove in from to the bottom the incoming scene.\n*/\nclass CC_DLL TransitionMoveInB : public TransitionMoveInL\n{\npublic:\n    static TransitionMoveInB* create(float t, Scene* scene);\n\nprotected:\n    TransitionMoveInB();\n    virtual ~TransitionMoveInB();\n\n    virtual void initScenes();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionMoveInB);\n};\n\n/** @brief TransitionSlideInL:\nSlide in the incoming scene from the left border.\n*/\nclass CC_DLL TransitionSlideInL : public TransitionScene, public TransitionEaseScene\n{\npublic:\n    static TransitionSlideInL* create(float t, Scene* scene);\n\n    virtual ActionInterval* easeActionWithAction(ActionInterval * action);\n\n    /** returns the action that will be performed by the incoming and outgoing scene */\n    virtual ActionInterval* action(void);\n\n    //\n    // Overrides\n    //\n    virtual void onEnter() override;\n\nprotected:\n    TransitionSlideInL();\n    virtual ~TransitionSlideInL();\n\n    /** initializes the scenes */\n    virtual void initScenes(void);\n\n    virtual void sceneOrder() override;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInL);\n};\n\n/** @brief TransitionSlideInR:\nSlide in the incoming scene from the right border.\n*/\nclass CC_DLL TransitionSlideInR : public TransitionSlideInL \n{\npublic:\n    static TransitionSlideInR* create(float t, Scene* scene);\n\n    /** returns the action that will be performed by the incoming and outgoing scene */\n    virtual ActionInterval* action(void);\n\nprotected:\n    TransitionSlideInR();\n    virtual ~TransitionSlideInR();\n\n    /** initializes the scenes */\n    virtual void initScenes(void);\n\n    virtual void sceneOrder() override;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInR);\n};\n\n/** @brief TransitionSlideInB:\nSlide in the incoming scene from the bottom border.\n*/\nclass CC_DLL TransitionSlideInB : public TransitionSlideInL\n{\npublic:\n    static TransitionSlideInB* create(float t, Scene* scene);\n\n    /** returns the action that will be performed by the incoming and outgoing scene */\n    virtual ActionInterval* action(void);\n\nprotected:\n    TransitionSlideInB();\n    virtual ~TransitionSlideInB();\n\n    /** initializes the scenes */\n    virtual void initScenes();\n\n    virtual void sceneOrder() override;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInB);\n};\n\n/** @brief TransitionSlideInT:\nSlide in the incoming scene from the top border.\n*/\nclass CC_DLL TransitionSlideInT : public TransitionSlideInL\n{\npublic:\n    static TransitionSlideInT* create(float t, Scene* scene);\n\n    /** returns the action that will be performed by the incoming and outgoing scene */\n    virtual ActionInterval* action(void);\n\nprotected:\n    TransitionSlideInT();\n    virtual ~TransitionSlideInT();\n\n    /** initializes the scenes */\n    virtual void initScenes(void);\n\n    virtual void sceneOrder() override;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionSlideInT);\n};\n\n/**\n@brief Shrink the outgoing scene while grow the incoming scene\n*/\nclass CC_DLL TransitionShrinkGrow : public TransitionScene , public TransitionEaseScene\n{\npublic:\n    static TransitionShrinkGrow* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    virtual ActionInterval* easeActionWithAction(ActionInterval * action) override;\n\nprotected:\n    TransitionShrinkGrow();\n    virtual ~TransitionShrinkGrow();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionShrinkGrow);\n};\n\n/** @brief TransitionFlipX:\nFlips the screen horizontally.\nThe front face is the outgoing scene and the back face is the incoming scene.\n*/\nclass CC_DLL TransitionFlipX : public TransitionSceneOriented\n{\npublic:\n    static TransitionFlipX* create(float t, Scene* s, Orientation o);\n    static TransitionFlipX* create(float t, Scene* s);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n\nprotected:\n    TransitionFlipX();\n    virtual ~TransitionFlipX();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipX);\n};\n\n/** @brief TransitionFlipY:\nFlips the screen vertically.\nThe front face is the outgoing scene and the back face is the incoming scene.\n*/\nclass CC_DLL TransitionFlipY : public TransitionSceneOriented\n{\npublic:\n    static TransitionFlipY* create(float t, Scene* s, Orientation o);\n    static TransitionFlipY* create(float t, Scene* s);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n\nprotected:\n    TransitionFlipY();\n    virtual ~TransitionFlipY();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipY);\n};\n\n/** @brief TransitionFlipAngular:\nFlips the screen half horizontally and half vertically.\nThe front face is the outgoing scene and the back face is the incoming scene.\n*/\nclass CC_DLL TransitionFlipAngular : public TransitionSceneOriented\n{\npublic:\n    static TransitionFlipAngular* create(float t, Scene* s, Orientation o);\n    static TransitionFlipAngular* create(float t, Scene* s);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n\nprotected:\n    TransitionFlipAngular();\n    virtual ~TransitionFlipAngular();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFlipAngular);\n};\n\n/** @brief TransitionZoomFlipX:\nFlips the screen horizontally doing a zoom out/in\nThe front face is the outgoing scene and the back face is the incoming scene.\n*/\nclass CC_DLL TransitionZoomFlipX : public TransitionSceneOriented\n{\npublic:\n    static TransitionZoomFlipX* create(float t, Scene* s, Orientation o);\n    static TransitionZoomFlipX* create(float t, Scene* s);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n\nprotected:\n    TransitionZoomFlipX();\n    virtual ~TransitionZoomFlipX();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipX);\n};\n\n/** @brief TransitionZoomFlipY:\nFlips the screen vertically doing a little zooming out/in\nThe front face is the outgoing scene and the back face is the incoming scene.\n*/\nclass CC_DLL TransitionZoomFlipY : public TransitionSceneOriented\n{\npublic:\n    static TransitionZoomFlipY* create(float t, Scene* s, Orientation o);\n    static TransitionZoomFlipY* create(float t, Scene* s);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n\nprotected:\n    TransitionZoomFlipY();\n    virtual ~TransitionZoomFlipY();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipY);\n};\n\n/** @brief TransitionZoomFlipAngular:\nFlips the screen half horizontally and half vertically doing a little zooming out/in.\nThe front face is the outgoing scene and the back face is the incoming scene.\n*/\nclass CC_DLL TransitionZoomFlipAngular : public TransitionSceneOriented\n{\npublic:\n    static TransitionZoomFlipAngular* create(float t, Scene* s, Orientation o);\n    static TransitionZoomFlipAngular* create(float t, Scene* s);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n\nprotected:\n    TransitionZoomFlipAngular();\n    virtual ~TransitionZoomFlipAngular();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionZoomFlipAngular);\n};\n\n/** @brief TransitionFade:\nFade out the outgoing scene and then fade in the incoming scene.'''\n*/\nclass CC_DLL TransitionFade : public TransitionScene\n{\npublic:\n    /** creates the transition with a duration and with an RGB color\n    * Example: FadeTransition::create(2, scene, Color3B(255,0,0); // red color\n    */\n    static TransitionFade* create(float duration, Scene* scene, const Color3B& color);\n    static TransitionFade* create(float duration, Scene* scene);\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit();\n\nprotected:\n    TransitionFade();\n    virtual ~TransitionFade();\n\n    /** initializes the transition with a duration and with an RGB color */\n    bool initWithDuration(float t, Scene*scene, const Color3B& color);\n    bool initWithDuration(float t, Scene* scene);\n\n    Color4B _color;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFade);\n\n};\n\nclass RenderTexture;\n/**\n@brief TransitionCrossFade:\nCross fades two scenes using the RenderTexture object.\n*/\nclass CC_DLL TransitionCrossFade : public TransitionScene\n{\npublic :\n    static TransitionCrossFade* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void draw() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit() override;\n\nprotected:\n    TransitionCrossFade();\n    virtual ~TransitionCrossFade();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionCrossFade);\n};\n\n/** @brief TransitionTurnOffTiles:\nTurn off the tiles of the outgoing scene in random order\n*/\nclass CC_DLL TransitionTurnOffTiles : public TransitionScene ,public TransitionEaseScene\n{\npublic :\n    static TransitionTurnOffTiles* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    virtual void onExit() override;\n    virtual ActionInterval * easeActionWithAction(ActionInterval * action) override;\n    virtual void draw() override;\n\nprotected:\n    TransitionTurnOffTiles();\n    virtual ~TransitionTurnOffTiles();\n\n    virtual void sceneOrder() override;\n    NodeGrid* _outSceneProxy;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionTurnOffTiles);\n};\n\n/** @brief TransitionSplitCols:\nThe odd columns goes upwards while the even columns goes downwards.\n*/\nclass CC_DLL TransitionSplitCols : public TransitionScene , public TransitionEaseScene\n{\npublic:\n    static TransitionSplitCols* create(float t, Scene* scene);\n\n    virtual ActionInterval* action();\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    virtual ActionInterval * easeActionWithAction(ActionInterval * action) override;\n    virtual void onExit() override;\n    virtual void draw() override;\nprotected:\n    TransitionSplitCols();\n    virtual ~TransitionSplitCols();\n    void switchTargetToInscene();\n    NodeGrid* _gridProxy;\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitCols);\n};\n\n/** @brief TransitionSplitRows:\nThe odd rows goes to the left while the even rows goes to the right.\n*/\nclass CC_DLL TransitionSplitRows : public TransitionSplitCols\n{\npublic:\n    static TransitionSplitRows* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    virtual ActionInterval* action(void) override;\n\nprotected:\n    TransitionSplitRows();\n    virtual ~TransitionSplitRows();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionSplitRows);\n};\n\n/** @brief TransitionFadeTR:\nFade the tiles of the outgoing scene from the left-bottom corner the to top-right corner.\n*/\nclass CC_DLL TransitionFadeTR : public TransitionScene , public TransitionEaseScene\n{\npublic:\n    static TransitionFadeTR* create(float t, Scene* scene);\n\n    virtual ActionInterval* actionWithSize(const Size& size);\n\n    //\n    // Overrides\n    //\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    virtual ActionInterval* easeActionWithAction(ActionInterval * action) override;\n    virtual void onExit() override;\n    virtual void draw() override;\nprotected:\n    TransitionFadeTR();\n    virtual ~TransitionFadeTR();\n\n    virtual void sceneOrder();\n\n    NodeGrid* _outSceneProxy;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeTR);\n};\n\n/** @brief TransitionFadeBL:\nFade the tiles of the outgoing scene from the top-right corner to the bottom-left corner.\n*/\nclass CC_DLL TransitionFadeBL : public TransitionFadeTR\n{\npublic:\n    static TransitionFadeBL* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    virtual ActionInterval* actionWithSize(const Size& size) override;\n\nprotected:\n    TransitionFadeBL();\n    virtual ~TransitionFadeBL();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeBL);\n};\n\n/** @brief TransitionFadeUp:\n* Fade the tiles of the outgoing scene from the bottom to the top.\n*/\nclass CC_DLL TransitionFadeUp : public TransitionFadeTR\n{\npublic:\n    static TransitionFadeUp* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    virtual ActionInterval* actionWithSize(const Size& size) override;\n\nprotected:\n    TransitionFadeUp();\n    virtual ~TransitionFadeUp();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeUp);\n};\n\n/** @brief TransitionFadeDown:\n* Fade the tiles of the outgoing scene from the top to the bottom.\n*/\nclass CC_DLL TransitionFadeDown : public TransitionFadeTR\n{\npublic:\n    static TransitionFadeDown* create(float t, Scene* scene);\n\n    //\n    // Overrides\n    //\n    virtual ActionInterval* actionWithSize(const Size& size) override;\n\nprotected:\n    TransitionFadeDown();\n    virtual ~TransitionFadeDown();\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(TransitionFadeDown);\n\n};\n\n// end of transition group\n/// @}\n\nNS_CC_END\n\n#endif // __CCTRANSITION_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTransitionPageTurn.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      Sindesso Pty Ltd http://www.sindesso.com/\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCTransitionPageTurn.h\"\n#include \"CCDirector.h\"\n#include \"CCActionInterval.h\"\n#include \"CCActionInstant.h\"\n#include \"CCActionGrid.h\"\n#include \"CCActionPageTurn3D.h\"\n#include \"CCNodeGrid.h\"\n#include \"renderer/CCRenderer.h\"\n\nNS_CC_BEGIN\n\nfloat TransitionPageTurn::POLYGON_OFFSET_FACTOR = -20.f;\nfloat TransitionPageTurn::POLYGON_OFFSET_UNITS = -20.f;\n\nTransitionPageTurn::TransitionPageTurn()\n{\n    _inSceneProxy = NodeGrid::create();\n    _outSceneProxy = NodeGrid::create();\n    \n    _inSceneProxy->retain();\n    _outSceneProxy->retain();\n}\n\nTransitionPageTurn::~TransitionPageTurn()\n{\n    CC_SAFE_RELEASE(_inSceneProxy);\n    CC_SAFE_RELEASE(_outSceneProxy);\n}\n\n/** creates a base transition with duration and incoming scene */\nTransitionPageTurn * TransitionPageTurn::create(float t, Scene *scene, bool backwards)\n{\n    TransitionPageTurn * transition = new TransitionPageTurn();\n    transition->initWithDuration(t,scene,backwards);\n    transition->autorelease();\n    return transition;\n}\n\n/** initializes a transition with duration and incoming scene */\nbool TransitionPageTurn::initWithDuration(float t, Scene *scene, bool backwards)\n{\n    // XXX: needed before [super init]\n    _back = backwards;\n\n    if (TransitionScene::initWithDuration(t, scene))\n    {\n        // do something\n    }\n    return true;\n}\n\nvoid TransitionPageTurn::sceneOrder()\n{\n    _isInSceneOnTop = _back;\n}\n\nvoid TransitionPageTurn::onEnablePolygonOffset()\n{\n    glEnable(GL_POLYGON_OFFSET_FILL);\n    glPolygonOffset(POLYGON_OFFSET_FACTOR, POLYGON_OFFSET_UNITS);\n}\n\nvoid TransitionPageTurn::onDisablePolygonOffset()\n{\n    glDisable(GL_POLYGON_OFFSET_FILL);\n    glPolygonOffset(0, 0);\n}\n\nvoid TransitionPageTurn::draw()\n{\n    Scene::draw();\n    \n    if( _isInSceneOnTop ) {\n        _outSceneProxy->visit();\n        _enableOffsetCmd.init(_globalZOrder);\n        _enableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onEnablePolygonOffset, this);\n        Director::getInstance()->getRenderer()->addCommand(&_enableOffsetCmd);\n        _inSceneProxy->visit();\n        _disableOffsetCmd.init(_globalZOrder);\n        _disableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onDisablePolygonOffset, this);\n        Director::getInstance()->getRenderer()->addCommand(&_disableOffsetCmd);\n    } else {\n        _inSceneProxy->visit();\n        \n        _enableOffsetCmd.init(_globalZOrder);\n        _enableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onEnablePolygonOffset, this);\n        Director::getInstance()->getRenderer()->addCommand(&_enableOffsetCmd);\n        \n        _outSceneProxy->visit();\n        \n        _disableOffsetCmd.init(_globalZOrder);\n        _disableOffsetCmd.func = CC_CALLBACK_0(TransitionPageTurn::onDisablePolygonOffset, this);\n        Director::getInstance()->getRenderer()->addCommand(&_disableOffsetCmd);\n    }\n}\n\nvoid TransitionPageTurn::onEnter()\n{\n    TransitionScene::onEnter();\n\n    _inSceneProxy->setTarget(_inScene);\n    _outSceneProxy->setTarget(_outScene);\n\n    _inSceneProxy->onEnter();\n    _outSceneProxy->onEnter();\n    \n    Size s = Director::getInstance()->getWinSize();\n    int x,y;\n    if (s.width > s.height)\n    {\n        x=16;\n        y=12;\n    }\n    else\n    {\n        x=12;\n        y=16;\n    }\n\n    ActionInterval *action  = this->actionWithSize(Size(x,y));\n\n    if (! _back )\n    {\n        _outSceneProxy->runAction\n        (\n            Sequence::create\n            (\n                action,\n                CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n                StopGrid::create(),\n                nullptr\n            )\n        );\n    }\n    else\n    {\n        // to prevent initial flicker\n        _inSceneProxy->setVisible(false);\n        _inSceneProxy->runAction\n        (\n            Sequence::create\n            (\n                Show::create(),\n                action,\n                CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n                StopGrid::create(),\n                nullptr\n            )\n        );\n    }\n}\nvoid TransitionPageTurn::onExit()\n{\n    _outSceneProxy->setTarget(nullptr);\n    _outSceneProxy->setTarget(nullptr);\n    _outSceneProxy->onExit();\n    _inSceneProxy->onExit();\n    \n    TransitionScene::onExit();\n}\n\nActionInterval* TransitionPageTurn:: actionWithSize(const Size& vector)\n{\n    if (_back)\n    {\n        // Get hold of the PageTurn3DAction\n        return ReverseTime::create\n        (\n            PageTurn3D::create(_duration, vector)\n        );\n    }\n    else\n    {\n        // Get hold of the PageTurn3DAction\n        return PageTurn3D::create(_duration, vector);\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTransitionPageTurn.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      Sindesso Pty Ltd http://www.sindesso.com/\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCPAGE_TURN_TRANSITION_H__\n#define __CCPAGE_TURN_TRANSITION_H__\n\n#include \"CCTransition.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\nclass NodeGrid;\n\n/**\n * @addtogroup transition\n * @{\n */\n\n/**\n@brief A transition which peels back the bottom right hand corner of a scene\nto transition to the scene beneath it simulating a page turn.\n\nThis uses a 3DAction so it's strongly recommended that depth buffering\nis turned on in Director using:\n\n Director::getInstance()->setDepthBufferFormat(kDepthBuffer16);\n\n @since v0.8.2\n*/\nclass CC_DLL TransitionPageTurn : public TransitionScene\n{\npublic:\n    /**\n     * Creates a base transition with duration and incoming scene.\n     * If back is true then the effect is reversed to appear as if the incoming\n     * scene is being turned from left over the outgoing scene.\n     */\n    static TransitionPageTurn* create(float t,Scene* scene,bool backwards);\n    /**\n     * @js ctor\n     */\n    TransitionPageTurn();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TransitionPageTurn();\n    \n    //\n    // Overrides\n    //\n    virtual void draw() override;\n\n    /**\n    * Creates a base transition with duration and incoming scene.\n    * If back is true then the effect is reversed to appear as if the incoming \n    * scene is being turned from left over the outgoing scene.\n    */\n    bool initWithDuration(float t,Scene* scene,bool backwards);\n\n    ActionInterval* actionWithSize(const Size& vector);\n\n    //\n    // Overrides\n    //\n    virtual void onEnter() override;\n    virtual void onExit() override;\n\nprotected:\n    virtual void sceneOrder() override;\n\nprotected:\n    NodeGrid* _inSceneProxy;\n    NodeGrid* _outSceneProxy;\n    bool    _back;    \n    static float POLYGON_OFFSET_FACTOR;\n    static float POLYGON_OFFSET_UNITS;\n    \nprotected:\n    CustomCommand _enableOffsetCmd;\n    CustomCommand _disableOffsetCmd;\n    void onEnablePolygonOffset();\n    void onDisablePolygonOffset();\n};\n\n// end of transition group\n/// @}\n\nNS_CC_END\n\n#endif // __CCPAGE_TURN_TRANSITION_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTransitionProgress.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      Lam Pham\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2012      Ricardo Quesada\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#include \"CCTransitionProgress.h\"\n#include \"CCDirector.h\"\n#include \"CCRenderTexture.h\"\n#include \"CCProgressTimer.h\"\n#include \"CCLayer.h\"\n#include \"CCActionInstant.h\"\n#include \"CCActionProgressTimer.h\"\n\nNS_CC_BEGIN\n\nenum {\n    kSceneRadial = 0xc001,\n};\n\nTransitionProgress::TransitionProgress()\n: _to(0.0f)\n, _from(0.0f)\n, _sceneToBeModified(nullptr)\n{\n\n}\n\nTransitionProgress* TransitionProgress::create(float t, Scene* scene)\n{\n    TransitionProgress* newScene = new TransitionProgress();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\n// TransitionProgress\nvoid TransitionProgress::onEnter()\n{\n    TransitionScene::onEnter();\n\n    setupTransition();\n    \n    // create a transparent color layer\n    // in which we are going to add our rendertextures\n    Size size = Director::getInstance()->getWinSize();\n\n    // create the second render texture for outScene\n    RenderTexture *texture = RenderTexture::create((int)size.width, (int)size.height);\n    texture->getSprite()->setAnchorPoint(Point(0.5f,0.5f));\n    texture->setPosition(Point(size.width/2, size.height/2));\n    texture->setAnchorPoint(Point(0.5f,0.5f));\n\n    // render outScene to its texturebuffer\n    texture->beginWithClear(0, 0, 0, 1);\n    _sceneToBeModified->visit();\n    texture->end();\n\n\n    //    Since we've passed the outScene to the texture we don't need it.\n    if (_sceneToBeModified == _outScene)\n    {\n        hideOutShowIn();\n    }\n    //    We need the texture in RenderTexture.\n    ProgressTimer *node = progressTimerNodeWithRenderTexture(texture);\n\n    // create the blend action\n    ActionInterval* layerAction = (ActionInterval*)Sequence::create(\n        ProgressFromTo::create(_duration, _from, _to),\n        CallFunc::create(CC_CALLBACK_0(TransitionScene::finish,this)),\n        nullptr);\n    // run the blend action\n    node->runAction(layerAction);\n\n    // add the layer (which contains our two rendertextures) to the scene\n    addChild(node, 2, kSceneRadial);\n}\n\n// clean up on exit\nvoid TransitionProgress::onExit()\n{\n    // remove our layer and release all containing objects\n    removeChildByTag(kSceneRadial, true);\n    TransitionScene::onExit();\n}\n\nvoid TransitionProgress::sceneOrder()\n{\n    _isInSceneOnTop = false;\n}\n\nvoid TransitionProgress::setupTransition()\n{\n    _sceneToBeModified = _outScene;\n    _from = 100;\n    _to = 0;\n}\n\nProgressTimer* TransitionProgress::progressTimerNodeWithRenderTexture(RenderTexture* texture)\n{\n    CCASSERT(false, \"override me - abstract class\");\n    return nullptr;\n}\n\n\n// TransitionProgressRadialCCW\n\nProgressTimer* TransitionProgressRadialCCW::progressTimerNodeWithRenderTexture(RenderTexture* texture)\n{\n    Size size = Director::getInstance()->getWinSize();\n\n    ProgressTimer* node = ProgressTimer::create(texture->getSprite());\n\n    // but it is flipped upside down so we flip the sprite\n    node->getSprite()->setFlippedY(true);\n    node->setType(ProgressTimer::Type::RADIAL);\n\n    //    Return the radial type that we want to use\n    node->setReverseDirection(false);\n    node->setPercentage(100);\n    node->setPosition(Point(size.width/2, size.height/2));\n    node->setAnchorPoint(Point(0.5f,0.5f));\n    \n    return node;\n}\n\nTransitionProgressRadialCCW* TransitionProgressRadialCCW::create(float t, Scene* scene)\n{\n    TransitionProgressRadialCCW* newScene = new TransitionProgressRadialCCW();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\n// TransitionProgressRadialCW\nTransitionProgressRadialCW* TransitionProgressRadialCW::create(float t, Scene* scene)\n{\n    TransitionProgressRadialCW* newScene = new TransitionProgressRadialCW();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nProgressTimer* TransitionProgressRadialCW::progressTimerNodeWithRenderTexture(RenderTexture* texture)\n{\n    Size size = Director::getInstance()->getWinSize();\n    \n    ProgressTimer* node = ProgressTimer::create(texture->getSprite());\n    \n    // but it is flipped upside down so we flip the sprite\n    node->getSprite()->setFlippedY(true);\n    node->setType( ProgressTimer::Type::RADIAL );\n    \n    //    Return the radial type that we want to use\n    node->setReverseDirection(true);\n    node->setPercentage(100);\n    node->setPosition(Point(size.width/2, size.height/2));\n    node->setAnchorPoint(Point(0.5f,0.5f));\n    \n    return node;\n}\n\n// TransitionProgressHorizontal\nTransitionProgressHorizontal* TransitionProgressHorizontal::create(float t, Scene* scene)\n{\n    TransitionProgressHorizontal* newScene = new TransitionProgressHorizontal();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nProgressTimer* TransitionProgressHorizontal::progressTimerNodeWithRenderTexture(RenderTexture* texture)\n{    \n    Size size = Director::getInstance()->getWinSize();\n\n    ProgressTimer* node = ProgressTimer::create(texture->getSprite());\n    \n    // but it is flipped upside down so we flip the sprite\n    node->getSprite()->setFlippedY(true);\n    node->setType( ProgressTimer::Type::BAR);\n    \n    node->setMidpoint(Point(1, 0));\n    node->setBarChangeRate(Point(1,0));\n    \n    node->setPercentage(100);\n    node->setPosition(Point(size.width/2, size.height/2));\n    node->setAnchorPoint(Point(0.5f,0.5f));\n\n    return node;\n}\n\n// TransitionProgressVertical\nTransitionProgressVertical* TransitionProgressVertical::create(float t, Scene* scene)\n{\n    TransitionProgressVertical* newScene = new TransitionProgressVertical();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nProgressTimer* TransitionProgressVertical::progressTimerNodeWithRenderTexture(RenderTexture* texture)\n{    \n    Size size = Director::getInstance()->getWinSize();\n    \n    ProgressTimer* node = ProgressTimer::create(texture->getSprite());\n    \n    // but it is flipped upside down so we flip the sprite\n    node->getSprite()->setFlippedY(true);\n    node->setType(ProgressTimer::Type::BAR);\n    \n    node->setMidpoint(Point(0, 0));\n    node->setBarChangeRate(Point(0,1));\n    \n    node->setPercentage(100);\n    node->setPosition(Point(size.width/2, size.height/2));\n    node->setAnchorPoint(Point(0.5f,0.5f));\n    \n    return node;\n}\n\n\n// TransitionProgressInOut\nTransitionProgressInOut* TransitionProgressInOut::create(float t, Scene* scene)\n{\n    TransitionProgressInOut* newScene = new TransitionProgressInOut();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nvoid TransitionProgressInOut::sceneOrder()\n{\n    _isInSceneOnTop = false;\n}\n\nvoid TransitionProgressInOut::setupTransition()\n{\n    _sceneToBeModified = _inScene;\n    _from = 0;\n    _to = 100;    \n}\n\nProgressTimer* TransitionProgressInOut::progressTimerNodeWithRenderTexture(RenderTexture* texture)\n{    \n    Size size = Director::getInstance()->getWinSize();\n    \n    ProgressTimer* node = ProgressTimer::create(texture->getSprite());\n    \n    // but it is flipped upside down so we flip the sprite\n    node->getSprite()->setFlippedY(true);\n    node->setType( ProgressTimer::Type::BAR);\n    \n    node->setMidpoint(Point(0.5f, 0.5f));\n    node->setBarChangeRate(Point(1, 1));\n    \n    node->setPercentage(0);\n    node->setPosition(Point(size.width/2, size.height/2));\n    node->setAnchorPoint(Point(0.5f,0.5f));\n    \n    return node;\n}\n\n\n// TransitionProgressOutIn\nTransitionProgressOutIn* TransitionProgressOutIn::create(float t, Scene* scene)\n{\n    TransitionProgressOutIn* newScene = new TransitionProgressOutIn();\n    if(newScene && newScene->initWithDuration(t, scene))\n    {\n        newScene->autorelease();\n        return newScene;\n    }\n    CC_SAFE_DELETE(newScene);\n    return nullptr;\n}\n\nProgressTimer* TransitionProgressOutIn::progressTimerNodeWithRenderTexture(RenderTexture* texture)\n{    \n    Size size = Director::getInstance()->getWinSize();\n    \n    ProgressTimer* node = ProgressTimer::create(texture->getSprite());\n    \n    // but it is flipped upside down so we flip the sprite\n    node->getSprite()->setFlippedY(true);\n    node->setType( ProgressTimer::Type::BAR );\n    \n    node->setMidpoint(Point(0.5f, 0.5f));\n    node->setBarChangeRate(Point(1, 1));\n    \n    node->setPercentage(100);\n    node->setPosition(Point(size.width/2, size.height/2));\n    node->setAnchorPoint(Point(0.5f,0.5f));\n    \n    return node;\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCTransitionProgress.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      Lam Pham\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2012      Ricardo Quesada\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTRANSITIONPROGRESS_H__\n#define __CCTRANSITIONPROGRESS_H__\n\n#include \"CCTransition.h\"\n\nNS_CC_BEGIN\n\nclass ProgressTimer;\nclass RenderTexture;\n\n/**\n * @addtogroup transition\n * @{\n */\nclass CC_DLL TransitionProgress : public TransitionScene\n{\npublic:\n    static TransitionProgress* create(float t, Scene* scene);\n\n    TransitionProgress();\n\n    //\n    // Overrides\n    //\n    virtual void onEnter() override;\n    virtual void onExit() override;\n\nprotected:\n    virtual void sceneOrder() override;\n\nprotected:\n    virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture);\n    virtual void setupTransition();\n\nprotected:\n    float _to;\n    float _from;\n    Scene* _sceneToBeModified;\n};\n\n\n/** TransitionRadialCCW transition.\n A counter clock-wise radial transition to the next scene\n */\nclass CC_DLL TransitionProgressRadialCCW : public TransitionProgress\n{\npublic:\n    static TransitionProgressRadialCCW* create(float t, Scene* scene);\n\nprotected:\n    //\n    // Overrides\n    //\n    virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;\n  \n};\n\n\n/** TransitionRadialCW transition.\n A counter clock-wise radial transition to the next scene\n*/\nclass CC_DLL TransitionProgressRadialCW : public TransitionProgress\n{\npublic:\n    static TransitionProgressRadialCW* create(float t, Scene* scene);\n\nprotected:\n    //\n    // Overrides\n    //\n    virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;\n\n};\n\n/** TransitionProgressHorizontal transition.\n A  clock-wise radial transition to the next scene\n */\nclass CC_DLL TransitionProgressHorizontal : public TransitionProgress\n{\npublic:\n    static TransitionProgressHorizontal* create(float t, Scene* scene);\n\nprotected:\n    //\n    // Overrides\n    //\n    virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;\n};\n\nclass CC_DLL TransitionProgressVertical : public TransitionProgress\n{\npublic:\n    static TransitionProgressVertical* create(float t, Scene* scene);\n\nprotected:\n    //\n    // Overrides\n    //\n    virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;\n};\n\nclass CC_DLL TransitionProgressInOut : public TransitionProgress\n{\npublic:\n    static TransitionProgressInOut* create(float t, Scene* scene);\n\nprotected:\n    //\n    // Overrides\n    //\n    virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;\n    virtual void sceneOrder() override;\n    virtual void setupTransition() override;\n};\n\nclass CC_DLL TransitionProgressOutIn : public TransitionProgress\n{\npublic:\n    static TransitionProgressOutIn* create(float t, Scene* scene);\n\nprotected:\n    //\n    // Overrides\n    //\n    virtual ProgressTimer* progressTimerNodeWithRenderTexture(RenderTexture* texture) override;\n\n};\n\n// end of transition group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCTRANSITIONPROGRESS_H__ */\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCUserDefault.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCUserDefault.h\"\n#include \"platform/CCCommon.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"tinyxml2.h\"\n#include \"base64.h\"\n\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID)\n\n// root name of xml\n#define USERDEFAULT_ROOT_NAME    \"userDefaultRoot\"\n\n#define XML_FILE_NAME \"UserDefault.xml\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n/**\n * define the functions here because we don't want to\n * export xmlNodePtr and other types in \"CCUserDefault.h\"\n */\n\nstatic tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLElement** rootNode, tinyxml2::XMLDocument **doc)\n{\n    tinyxml2::XMLElement* curNode = nullptr;\n\n    // check the key value\n    if (! pKey)\n    {\n        return nullptr;\n    }\n\n    do \n    {\n \t\ttinyxml2::XMLDocument* xmlDoc = new tinyxml2::XMLDocument();\n\t\t*doc = xmlDoc;\n\n        std::string xmlBuffer = FileUtils::getInstance()->getStringFromFile(UserDefault::getInstance()->getXMLFilePath());\n\n\t\tif (xmlBuffer.empty())\n\t\t{\n\t\t\tCCLOG(\"can not read xml file\");\n\t\t\tbreak;\n\t\t}\n\t\txmlDoc->Parse(xmlBuffer.c_str(), xmlBuffer.size());\n\n\t\t// get root node\n\t\t*rootNode = xmlDoc->RootElement();\n\t\tif (nullptr == *rootNode)\n\t\t{\n\t\t\tCCLOG(\"read root node error\");\n\t\t\tbreak;\n\t\t}\n\t\t// find the node\n\t\tcurNode = (*rootNode)->FirstChildElement();\n\t\twhile (nullptr != curNode)\n\t\t{\n\t\t\tconst char* nodeName = curNode->Value();\n\t\t\tif (!strcmp(nodeName, pKey))\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcurNode = curNode->NextSiblingElement();\n\t\t}\n\t} while (0);\n\n\treturn curNode;\n}\n\nstatic void setValueForKey(const char* pKey, const char* pValue)\n{\n \ttinyxml2::XMLElement* rootNode;\n\ttinyxml2::XMLDocument* doc;\n\ttinyxml2::XMLElement* node;\n\t// check the params\n\tif (! pKey || ! pValue)\n\t{\n\t\treturn;\n\t}\n\t// find the node\n\tnode = getXMLNodeForKey(pKey, &rootNode, &doc);\n\t// if node exist, change the content\n\tif (node)\n\t{\n        if (node->FirstChild())\n        {\n            node->FirstChild()->SetValue(pValue);\n        }\n        else\n        {\n            tinyxml2::XMLText* content = doc->NewText(pValue);\n            node->LinkEndChild(content);\n        }\n\t}\n\telse\n\t{\n\t\tif (rootNode)\n\t\t{\n\t\t\ttinyxml2::XMLElement* tmpNode = doc->NewElement(pKey);//new tinyxml2::XMLElement(pKey);\n\t\t\trootNode->LinkEndChild(tmpNode);\n\t\t\ttinyxml2::XMLText* content = doc->NewText(pValue);//new tinyxml2::XMLText(pValue);\n\t\t\ttmpNode->LinkEndChild(content);\n\t\t}\t\n\t}\n\n    // save file and free doc\n\tif (doc)\n\t{\n\t\tdoc->SaveFile(UserDefault::getInstance()->getXMLFilePath().c_str());\n\t\tdelete doc;\n\t}\n}\n\n/**\n * implements of UserDefault\n */\n\nUserDefault* UserDefault::_userDefault = nullptr;\nstring UserDefault::_filePath = string(\"\");\nbool UserDefault::_isFilePathInitialized = false;\n\nUserDefault::~UserDefault()\n{\n}\n\nUserDefault::UserDefault()\n{\n}\n\nbool UserDefault::getBoolForKey(const char* pKey)\n{\n return getBoolForKey(pKey, false);\n}\n\nbool UserDefault::getBoolForKey(const char* pKey, bool defaultValue)\n{\n    const char* value = nullptr;\n\ttinyxml2::XMLElement* rootNode;\n\ttinyxml2::XMLDocument* doc;\n\ttinyxml2::XMLElement* node;\n\tnode =  getXMLNodeForKey(pKey, &rootNode, &doc);\n\t// find the node\n\tif (node && node->FirstChild())\n\t{\n        value = (const char*)(node->FirstChild()->Value());\n\t}\n\n\tbool ret = defaultValue;\n\n\tif (value)\n\t{\n\t\tret = (! strcmp(value, \"true\"));\n\t}\n\n    if (doc) delete doc;\n\n\treturn ret;\n}\n\nint UserDefault::getIntegerForKey(const char* pKey)\n{\n    return getIntegerForKey(pKey, 0);\n}\n\nint UserDefault::getIntegerForKey(const char* pKey, int defaultValue)\n{\n\tconst char* value = nullptr;\n\ttinyxml2::XMLElement* rootNode;\n\ttinyxml2::XMLDocument* doc;\n\ttinyxml2::XMLElement* node;\n\tnode =  getXMLNodeForKey(pKey, &rootNode, &doc);\n\t// find the node\n\tif (node && node->FirstChild())\n\t{\n        value = (const char*)(node->FirstChild()->Value());\n\t}\n\n\tint ret = defaultValue;\n\n\tif (value)\n\t{\n\t\tret = atoi(value);\n\t}\n\n\tif(doc)\n\t{\n\t\tdelete doc;\n\t}\n\n\n\treturn ret;\n}\n\nfloat UserDefault::getFloatForKey(const char* pKey)\n{\n    return getFloatForKey(pKey, 0.0f);\n}\n\nfloat UserDefault::getFloatForKey(const char* pKey, float defaultValue)\n{\n    float ret = (float)getDoubleForKey(pKey, (double)defaultValue);\n \n    return ret;\n}\n\ndouble  UserDefault::getDoubleForKey(const char* pKey)\n{\n    return getDoubleForKey(pKey, 0.0);\n}\n\ndouble UserDefault::getDoubleForKey(const char* pKey, double defaultValue)\n{\n\tconst char* value = nullptr;\n\ttinyxml2::XMLElement* rootNode;\n\ttinyxml2::XMLDocument* doc;\n\ttinyxml2::XMLElement* node;\n\tnode =  getXMLNodeForKey(pKey, &rootNode, &doc);\n\t// find the node\n\tif (node && node->FirstChild())\n\t{\n        value = (const char*)(node->FirstChild()->Value());\n\t}\n\n\tdouble ret = defaultValue;\n\n\tif (value)\n\t{\n\t\tret = atof(value);\n\t}\n\n    if (doc) delete doc;\n\n\treturn ret;\n}\n\nstd::string UserDefault::getStringForKey(const char* pKey)\n{\n    return getStringForKey(pKey, \"\");\n}\n\nstring UserDefault::getStringForKey(const char* pKey, const std::string & defaultValue)\n{\n    const char* value = nullptr;\n\ttinyxml2::XMLElement* rootNode;\n\ttinyxml2::XMLDocument* doc;\n\ttinyxml2::XMLElement* node;\n\tnode =  getXMLNodeForKey(pKey, &rootNode, &doc);\n\t// find the node\n\tif (node && node->FirstChild())\n\t{\n        value = (const char*)(node->FirstChild()->Value());\n\t}\n\n\tstring ret = defaultValue;\n\n\tif (value)\n\t{\n\t\tret = string(value);\n\t}\n\n    if (doc) delete doc;\n\n\treturn ret;\n}\n\nData UserDefault::getDataForKey(const char* pKey)\n{\n    return getDataForKey(pKey, Data::Null);\n}\n\nData UserDefault::getDataForKey(const char* pKey, const Data& defaultValue)\n{\n    const char* encodedData = nullptr;\n\ttinyxml2::XMLElement* rootNode;\n\ttinyxml2::XMLDocument* doc;\n\ttinyxml2::XMLElement* node;\n\tnode =  getXMLNodeForKey(pKey, &rootNode, &doc);\n\t// find the node\n\tif (node && node->FirstChild())\n\t{\n        encodedData = (const char*)(node->FirstChild()->Value());\n\t}\n    \n\tData ret = defaultValue;\n    \n\tif (encodedData)\n\t{\n        unsigned char * decodedData = nullptr;\n        int decodedDataLen = base64Decode((unsigned char*)encodedData, (unsigned int)strlen(encodedData), &decodedData);\n        \n        if (decodedData) {\n            ret.fastSet(decodedData, decodedDataLen);\n        }\n\t}\n    \n    if (doc) delete doc;\n    \n\treturn ret;    \n}\n\n\nvoid UserDefault::setBoolForKey(const char* pKey, bool value)\n{\n    // save bool value as string\n\n    if (true == value)\n    {\n        setStringForKey(pKey, \"true\");\n    }\n    else\n    {\n        setStringForKey(pKey, \"false\");\n    }\n}\n\nvoid UserDefault::setIntegerForKey(const char* pKey, int value)\n{\n    // check key\n    if (! pKey)\n    {\n        return;\n    }\n\n    // format the value\n    char tmp[50];\n    memset(tmp, 0, 50);\n    sprintf(tmp, \"%d\", value);\n\n    setValueForKey(pKey, tmp);\n}\n\nvoid UserDefault::setFloatForKey(const char* pKey, float value)\n{\n    setDoubleForKey(pKey, value);\n}\n\nvoid UserDefault::setDoubleForKey(const char* pKey, double value)\n{\n    // check key\n    if (! pKey)\n    {\n        return;\n    }\n\n    // format the value\n    char tmp[50];\n    memset(tmp, 0, 50);\n    sprintf(tmp, \"%f\", value);\n\n    setValueForKey(pKey, tmp);\n}\n\nvoid UserDefault::setStringForKey(const char* pKey, const std::string & value)\n{\n    // check key\n    if (! pKey)\n    {\n        return;\n    }\n\n    setValueForKey(pKey, value.c_str());\n}\n\nvoid UserDefault::setDataForKey(const char* pKey, const Data& value) {\n    // check key\n    if (! pKey)\n    {\n        return;\n    }\n\n    char *encodedData = 0;\n    \n    base64Encode(value.getBytes(), static_cast<unsigned int>(value.getSize()), &encodedData);\n        \n    setValueForKey(pKey, encodedData);\n    \n    if (encodedData)\n        free(encodedData);\n}\n\nUserDefault* UserDefault::getInstance()\n{\n    initXMLFilePath();\n\n    // only create xml file one time\n    // the file exists after the program exit\n    if ((! isXMLFileExist()) && (! createXMLFile()))\n    {\n        return nullptr;\n    }\n\n    if (! _userDefault)\n    {\n        _userDefault = new UserDefault();\n    }\n\n    return _userDefault;\n}\n\nvoid UserDefault::destroyInstance()\n{\n    CC_SAFE_DELETE(_userDefault);\n}\n\n// XXX: deprecated\nUserDefault* UserDefault::sharedUserDefault()\n{\n    return UserDefault::getInstance();\n}\n\n// XXX: deprecated\nvoid UserDefault::purgeSharedUserDefault()\n{\n    return UserDefault::destroyInstance();\n}\n\nbool UserDefault::isXMLFileExist()\n{\n    FILE *fp = fopen(_filePath.c_str(), \"r\");\n\tbool bRet = false;\n\n\tif (fp)\n\t{\n\t\tbRet = true;\n\t\tfclose(fp);\n\t}\n\n\treturn bRet;\n}\n\nvoid UserDefault::initXMLFilePath()\n{\n    if (! _isFilePathInitialized)\n    {\n        _filePath += FileUtils::getInstance()->getWritablePath() + XML_FILE_NAME;\n        _isFilePathInitialized = true;\n    }    \n}\n\n// create new xml file\nbool UserDefault::createXMLFile()\n{\n\tbool bRet = false;  \n    tinyxml2::XMLDocument *pDoc = new tinyxml2::XMLDocument(); \n    if (nullptr==pDoc)  \n    {  \n        return false;  \n    }  \n\ttinyxml2::XMLDeclaration *pDeclaration = pDoc->NewDeclaration(nullptr);  \n\tif (nullptr==pDeclaration)  \n\t{  \n\t\treturn false;  \n\t}  \n\tpDoc->LinkEndChild(pDeclaration); \n\ttinyxml2::XMLElement *pRootEle = pDoc->NewElement(USERDEFAULT_ROOT_NAME);  \n\tif (nullptr==pRootEle)  \n\t{  \n\t\treturn false;  \n\t}  \n\tpDoc->LinkEndChild(pRootEle);  \n\tbRet = tinyxml2::XML_SUCCESS == pDoc->SaveFile(_filePath.c_str());\n\n\tif(pDoc)\n\t{\n\t\tdelete pDoc;\n\t}\n\n\treturn bRet;\n}\n\nconst string& UserDefault::getXMLFilePath()\n{\n    return _filePath;\n}\n\nvoid UserDefault::flush()\n{\n}\n\nNS_CC_END\n\n#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_PLATFORM != CC_PLATFORM_ANDROID)\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCUserDefault.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __SUPPORT_CCUSERDEFAULT_H__\n#define __SUPPORT_CCUSERDEFAULT_H__\n\n#include \"CCPlatformMacros.h\"\n#include <string>\n#include \"CCData.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_storage\n * @{\n */\n\n/**\n * UserDefault acts as a tiny database. You can save and get base type values by it.\n * For example, setBoolForKey(\"played\", true) will add a bool value true into the database.\n * Its key is \"played\". You can get the value of the key by getBoolForKey(\"played\").\n * \n * It supports the following base types:\n * bool, int, float, double, string\n */\nclass CC_DLL UserDefault\n{\npublic:\n    // get value methods\n\n    /**\n    @brief Get bool value by key, if the key doesn't exist, a default value will return.\n     You can set the default value, or it is false.\n    * @js NA\n    */\n    bool    getBoolForKey(const char* pKey);\n    /**\n     * @js NA\n     */\n    bool    getBoolForKey(const char* pKey, bool defaultValue);\n    /**\n    @brief Get integer value by key, if the key doesn't exist, a default value will return.\n     You can set the default value, or it is 0.\n    * @js NA\n    */\n    int     getIntegerForKey(const char* pKey);\n    /**\n     * @js NA\n     */\n    int     getIntegerForKey(const char* pKey, int defaultValue);\n    /**\n    @brief Get float value by key, if the key doesn't exist, a default value will return.\n     You can set the default value, or it is 0.0f.\n    * @js NA\n    */\n    float    getFloatForKey(const char* pKey);\n    /**\n     * @js NA\n     */\n    float    getFloatForKey(const char* pKey, float defaultValue);\n    /**\n    @brief Get double value by key, if the key doesn't exist, a default value will return.\n     You can set the default value, or it is 0.0.\n    * @js NA\n    */\n    double  getDoubleForKey(const char* pKey);\n    /**\n     * @js NA\n     */\n    double  getDoubleForKey(const char* pKey, double defaultValue);\n    /**\n    @brief Get string value by key, if the key doesn't exist, a default value will return.\n    You can set the default value, or it is \"\".\n    * @js NA\n    */\n    std::string getStringForKey(const char* pKey);\n    /**\n     * @js NA\n     */\n    std::string getStringForKey(const char* pKey, const std::string & defaultValue);\n    /**\n     @brief Get binary data value by key, if the key doesn't exist, a default value will return.\n     You can set the default value, or it is null.\n     * @js NA\n     * @lua NA\n     */\n    Data getDataForKey(const char* pKey);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Data getDataForKey(const char* pKey, const Data& defaultValue);\n\n    // set value methods\n\n    /**\n     @brief Set bool value by key.\n     * @js NA\n     */\n    void    setBoolForKey(const char* pKey, bool value);\n    /**\n     @brief Set integer value by key.\n     * @js NA\n     */\n    void    setIntegerForKey(const char* pKey, int value);\n    /**\n     @brief Set float value by key.\n     * @js NA\n     */\n    void    setFloatForKey(const char* pKey, float value);\n    /**\n     @brief Set double value by key.\n     * @js NA\n     */\n    void    setDoubleForKey(const char* pKey, double value);\n    /**\n     @brief Set string value by key.\n     * @js NA\n     */\n    void    setStringForKey(const char* pKey, const std::string & value);\n    /**\n     @brief Set binary data value by key.\n     * @js NA\n     * @lua NA\n     */\n    void    setDataForKey(const char* pKey, const Data& value);\n    /**\n     @brief Save content to xml file\n     * @js NA\n     */\n    void    flush();\n\n    /** returns the singleton \n     * @js NA\n     * @lua NA\n     */\n    static UserDefault* getInstance();\n    /**\n     * @js NA\n     */\n    static void destroyInstance();\n\n    /** deprecated. Use getInstace() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static UserDefault* sharedUserDefault();\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static void purgeSharedUserDefault();\n    /**\n     * @js NA\n     */\n    const static std::string& getXMLFilePath();\n    /**\n     * @js NA\n     */\n    static bool isXMLFileExist();\n\nprivate:\n    UserDefault();\n    ~UserDefault();\n    \n    static bool createXMLFile();\n    static void initXMLFilePath();\n    \n    static UserDefault* _userDefault;\n    static std::string _filePath;\n    static bool _isFilePathInitialized;\n};\n\n// end of data_storage group\n/// @}\n\nNS_CC_END\n\n#endif // __SUPPORT_CCUSERDEFAULT_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCUserDefault.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"CCUserDefault.h\"\n#import <string>\n#import \"platform/CCFileUtils.h\"\n#import \"tinyxml2.h\"\n#import \"CCPlatformConfig.h\"\n#import \"CCPlatformMacros.h\"\n#import \"base64.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n\n\n#define XML_FILE_NAME \"UserDefault.xml\"\n\n// root name of xml\n#define USERDEFAULT_ROOT_NAME    \"userDefaultRoot\"\n\n#define KEEP_COMPATABILITY\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n/**\n * implements of UserDefault\n */\n\nUserDefault* UserDefault::_userDefault = nullptr;\nstring UserDefault::_filePath = string(\"\");\nbool UserDefault::_isFilePathInitialized = false;\n\n#ifdef KEEP_COMPATABILITY\nstatic tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDocument **doc)\n{\n    tinyxml2::XMLElement* curNode = nullptr;\n    tinyxml2::XMLElement* rootNode = nullptr;\n    \n    if (! UserDefault::isXMLFileExist())\n    {\n        return nullptr;\n    }\n    \n    // check the key value\n    if (! pKey)\n    {\n        return nullptr;\n    }\n    \n    do\n    {\n \t\ttinyxml2::XMLDocument* xmlDoc = new tinyxml2::XMLDocument();\n\t\t*doc = xmlDoc;\n\n        std::string xmlBuffer = FileUtils::getInstance()->getStringFromFile(UserDefault::getInstance()->getXMLFilePath());\n\n\t\tif (xmlBuffer.empty())\n\t\t{\n            NSLog(@\"can not read xml file\");\n\t\t\tbreak;\n\t\t}\n\t\txmlDoc->Parse(xmlBuffer.c_str(), xmlBuffer.size());\n\n\t\t// get root node\n\t\trootNode = xmlDoc->RootElement();\n\t\tif (nullptr == rootNode)\n\t\t{\n            NSLog(@\"read root node error\");\n\t\t\tbreak;\n\t\t}\n\t\t// find the node\n\t\tcurNode = rootNode->FirstChildElement();\n        if (!curNode)\n        {\n            // There is not xml node, delete xml file.\n            remove(UserDefault::getInstance()->getXMLFilePath().c_str());\n            \n            return nullptr;\n        }\n        \n\t\twhile (nullptr != curNode)\n\t\t{\n\t\t\tconst char* nodeName = curNode->Value();\n\t\t\tif (!strcmp(nodeName, pKey))\n\t\t\t{\n                // delete the node\n\t\t\t\tbreak;\n\t\t\t}\n            \n\t\t\tcurNode = curNode->NextSiblingElement();\n\t\t}\n\t} while (0);\n    \n\treturn curNode;\n}\n\nstatic void deleteNode(tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* node)\n{\n    if (node)\n    {\n        doc->DeleteNode(node);\n        doc->SaveFile(UserDefault::getInstance()->getXMLFilePath().c_str());\n        delete doc;\n    }\n}\n\nstatic void deleteNodeByKey(const char *pKey)\n{\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    deleteNode(doc, node);\n}\n#endif\n\nUserDefault::~UserDefault()\n{\n}\n\nUserDefault::UserDefault()\n{\n}\n\nbool UserDefault::getBoolForKey(const char* pKey)\n{\n    return getBoolForKey(pKey, false);\n}\n\nbool UserDefault::getBoolForKey(const char* pKey, bool defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            const char* value = (const char*)node->FirstChild()->Value();\n            bool ret = (! strcmp(value, \"true\"));\n            \n            // set value in NSUserDefaults\n            setBoolForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n    bool ret = defaultValue;\n    \n    NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithUTF8String:pKey]];\n    if (value)\n    {\n        ret = [value boolValue];\n    }\n    \n    return ret;\n}\n\nint UserDefault::getIntegerForKey(const char* pKey)\n{\n    return getIntegerForKey(pKey, 0);\n}\n\nint UserDefault::getIntegerForKey(const char* pKey, int defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            int ret = atoi((const char*)node->FirstChild()->Value());\n            \n            // set value in NSUserDefaults\n            setIntegerForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n    int ret = defaultValue;\n    \n    NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithUTF8String:pKey]];\n    if (value)\n    {\n        ret = [value intValue];\n    }\n    \n    return ret;\n}\n\nfloat UserDefault::getFloatForKey(const char* pKey)\n{\n    return getFloatForKey(pKey, 0);\n}\n\nfloat UserDefault::getFloatForKey(const char* pKey, float defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            float ret = atof((const char*)node->FirstChild()->Value());\n            \n            // set value in NSUserDefaults\n            setFloatForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n    float ret = defaultValue;\n    \n    NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithUTF8String:pKey]];\n    if (value)\n    {\n        ret = [value floatValue];\n    }\n    \n    return ret;\n}\n\ndouble  UserDefault::getDoubleForKey(const char* pKey)\n{\n    return getDoubleForKey(pKey, 0);\n}\n\ndouble UserDefault::getDoubleForKey(const char* pKey, double defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            double ret = atof((const char*)node->FirstChild()->Value());\n            \n            // set value in NSUserDefaults\n            setDoubleForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n\tdouble ret = defaultValue;\n    \n    NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithUTF8String:pKey]];\n    if (value)\n    {\n        ret = [value doubleValue];\n    }\n    \n    return ret;\n}\n\nstd::string UserDefault::getStringForKey(const char* pKey)\n{\n    return getStringForKey(pKey, \"\");\n}\n\nstring UserDefault::getStringForKey(const char* pKey, const std::string & defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            string ret = (const char*)node->FirstChild()->Value();\n            \n            // set value in NSUserDefaults\n            setStringForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n    NSString *str = [[NSUserDefaults standardUserDefaults] stringForKey:[NSString stringWithUTF8String:pKey]];\n    if (! str)\n    {\n        return defaultValue;\n    }\n    else\n    {\n        return [str UTF8String];\n    }\n}\n\nData UserDefault::getDataForKey(const char* pKey)\n{\n    return getDataForKey(pKey, Data::Null);\n}\n\nData UserDefault::getDataForKey(const char* pKey, const Data& defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            const char * encodedData = node->FirstChild()->Value();\n            unsigned char * decodedData;\n            int decodedDataLen = base64Decode((unsigned char*)encodedData, (unsigned int)strlen(encodedData), &decodedData);\n\n            if (decodedData) {\n                Data ret;\n                ret.fastSet(decodedData, decodedDataLen);\n                \n                // set value in NSUserDefaults\n                setDataForKey(pKey, ret);\n                \n                flush();\n                \n                // delete xmle node\n                deleteNode(doc, node);\n                \n                return ret;\n            }\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n    NSData *data = [[NSUserDefaults standardUserDefaults] dataForKey:[NSString stringWithUTF8String:pKey]];\n    if (! data)\n    {\n        return defaultValue;\n    }\n    else\n    {\n        Data ret;\n        ret.copy((unsigned char*)data.bytes, data.length);\n        return ret;\n    }\n}\n\nvoid UserDefault::setBoolForKey(const char* pKey, bool value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n    \n    [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:value] forKey:[NSString stringWithUTF8String:pKey]];\n}\n\nvoid UserDefault::setIntegerForKey(const char* pKey, int value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n    \n    [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:value] forKey:[NSString stringWithUTF8String:pKey]];\n}\n\nvoid UserDefault::setFloatForKey(const char* pKey, float value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n    \n    [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithFloat:value] forKey:[NSString stringWithUTF8String:pKey]];\n}\n\nvoid UserDefault::setDoubleForKey(const char* pKey, double value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n    \n    [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:value] forKey:[NSString stringWithUTF8String:pKey]];\n}\n\nvoid UserDefault::setStringForKey(const char* pKey, const std::string & value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n    \n    [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithUTF8String:value.c_str()] forKey:[NSString stringWithUTF8String:pKey]];\n}\n\nvoid UserDefault::setDataForKey(const char* pKey, const Data& value) {\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n        \n    [[NSUserDefaults standardUserDefaults] setObject:[NSData dataWithBytes: value.getBytes() length: value.getSize()] forKey:[NSString stringWithUTF8String:pKey]];\n}\n\nUserDefault* UserDefault::getInstance()\n{\n#ifdef KEEP_COMPATABILITY\n    initXMLFilePath();\n#endif\n    \n    if (! _userDefault)\n    {\n        _userDefault = new UserDefault();\n    }\n    \n    return _userDefault;\n}\n\nvoid UserDefault::destroyInstance()\n{\n    CC_SAFE_DELETE(_userDefault);\n}\n\n// XXX: deprecated\nUserDefault* UserDefault::sharedUserDefault()\n{\n    return UserDefault::getInstance();\n}\n\n// XXX: deprecated\nvoid UserDefault::purgeSharedUserDefault()\n{\n    UserDefault::destroyInstance();\n}\n\nbool UserDefault::isXMLFileExist()\n{\n    FILE *fp = fopen(_filePath.c_str(), \"r\");\n\tbool bRet = false;\n    \n\tif (fp)\n\t{\n\t\tbRet = true;\n\t\tfclose(fp);\n\t}\n    \n\treturn bRet;\n}\n\nvoid UserDefault::initXMLFilePath()\n{\n#ifdef KEEP_COMPATABILITY\n    if (! _isFilePathInitialized)\n    {\n        // xml file is stored in cache directory before 2.1.2\n        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);\n        NSString *documentsDirectory = [paths objectAtIndex:0];\n        _filePath = [documentsDirectory UTF8String];\n        _filePath.append(\"/\");\n        \n        _filePath +=  XML_FILE_NAME;\n        _isFilePathInitialized = true;\n    }\n#endif\n}\n\n// create new xml file\nbool UserDefault::createXMLFile()\n{\n    return false;\n}\n\nconst string& UserDefault::getXMLFilePath()\n{\n    return _filePath;\n}\n\nvoid UserDefault::flush()\n{\n    [[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n\nNS_CC_END\n\n#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCUserDefaultAndroid.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCUserDefault.h\"\n#include \"CCPlatformConfig.h\"\n#include \"platform/CCCommon.h\"\n#include \"base64.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n#include \"platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n\n// root name of xml\n#define USERDEFAULT_ROOT_NAME    \"userDefaultRoot\"\n\n#define KEEP_COMPATABILITY\n\n#define XML_FILE_NAME \"UserDefault.xml\"\n\n#ifdef KEEP_COMPATABILITY\n#include \"platform/CCFileUtils.h\"\n#include \"../tinyxml2/tinyxml2.h\"\n#endif\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n/**\n * implements of UserDefault\n */\n\nUserDefault* UserDefault::_userDefault = nullptr;\nstring UserDefault::_filePath = string(\"\");\nbool UserDefault::_isFilePathInitialized = false;\n\n#ifdef KEEP_COMPATABILITY\nstatic tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDocument **doc)\n{\n    tinyxml2::XMLElement* curNode = nullptr;\n    tinyxml2::XMLElement* rootNode = nullptr;\n    \n    if (! UserDefault::isXMLFileExist())\n    {\n        return nullptr;\n    }\n    \n    // check the key value\n    if (! pKey)\n    {\n        return nullptr;\n    }\n    \n    do\n    {\n        tinyxml2::XMLDocument* xmlDoc = new tinyxml2::XMLDocument();\n        *doc = xmlDoc;\n        ssize_t size;\n        \n        std::string xmlBuffer = FileUtils::getInstance()->getStringFromFile(UserDefault::getInstance()->getXMLFilePath().c_str());\n\n        if (xmlBuffer.empty())\n        {\n            CCLOG(\"can not read xml file\");\n            break;\n        }\n        xmlDoc->Parse(xmlBuffer.c_str());\n\n        // get root node\n        rootNode = xmlDoc->RootElement();\n        if (nullptr == rootNode)\n        {\n            CCLOG(\"read root node error\");\n            break;\n        }\n        // find the node\n        curNode = rootNode->FirstChildElement();\n        if (!curNode)\n        {\n            // There is not xml node, delete xml file.\n            remove(UserDefault::getInstance()->getXMLFilePath().c_str());\n            \n            return nullptr;\n        }\n        \n        while (nullptr != curNode)\n        {\n            const char* nodeName = curNode->Value();\n            if (!strcmp(nodeName, pKey))\n            {\n                // delete the node\n                break;\n            }\n            \n            curNode = curNode->NextSiblingElement();\n        }\n    } while (0);\n    \n    return curNode;\n}\n\nstatic void deleteNode(tinyxml2::XMLDocument* doc, tinyxml2::XMLElement* node)\n{\n    if (node)\n    {\n        doc->DeleteNode(node);\n        doc->SaveFile(UserDefault::getInstance()->getXMLFilePath().c_str());\n        delete doc;\n    }\n}\n\nstatic void deleteNodeByKey(const char *pKey)\n{\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    deleteNode(doc, node);\n}\n#endif\n\nUserDefault::~UserDefault()\n{\n}\n\nUserDefault::UserDefault()\n{\n}\n\n// XXX: deprecated\nvoid UserDefault::purgeSharedUserDefault()\n{\n    UserDefault::destroyInstance();\n}\n\nvoid UserDefault::destroyInstance()\n{\n   CC_SAFE_DELETE(_userDefault);\n}\n\nbool UserDefault::getBoolForKey(const char* pKey)\n{\n    return getBoolForKey(pKey, false);\n}\n\nbool UserDefault::getBoolForKey(const char* pKey, bool defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            const char* value = (const char*)node->FirstChild()->Value();\n            bool ret = (! strcmp(value, \"true\"));\n            \n            // set value in NSUserDefaults\n            setBoolForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n\n    return getBoolForKeyJNI(pKey, defaultValue);\n}\n\nint UserDefault::getIntegerForKey(const char* pKey)\n{\n    return getIntegerForKey(pKey, 0);\n}\n\nint UserDefault::getIntegerForKey(const char* pKey, int defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            int ret = atoi((const char*)node->FirstChild()->Value());\n            \n            // set value in NSUserDefaults\n            setIntegerForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n\treturn getIntegerForKeyJNI(pKey, defaultValue);\n}\n\nfloat UserDefault::getFloatForKey(const char* pKey)\n{\n    return getFloatForKey(pKey, 0.0f);\n}\n\nfloat UserDefault::getFloatForKey(const char* pKey, float defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            float ret = atof((const char*)node->FirstChild()->Value());\n            \n            // set value in NSUserDefaults\n            setFloatForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n\n    return getFloatForKeyJNI(pKey, defaultValue);\n}\n\ndouble  UserDefault::getDoubleForKey(const char* pKey)\n{\n    return getDoubleForKey(pKey, 0.0);\n}\n\ndouble UserDefault::getDoubleForKey(const char* pKey, double defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            double ret = atof((const char*)node->FirstChild()->Value());\n            \n            // set value in NSUserDefaults\n            setDoubleForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n\n\treturn getDoubleForKeyJNI(pKey, defaultValue);\n}\n\nstd::string UserDefault::getStringForKey(const char* pKey)\n{\n    return getStringForKey(pKey, \"\");\n}\n\nstring UserDefault::getStringForKey(const char* pKey, const std::string & defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            string ret = (const char*)node->FirstChild()->Value();\n            \n            // set value in NSUserDefaults\n            setStringForKey(pKey, ret);\n            flush();\n            \n            // delete xmle node\n            deleteNode(doc, node);\n            \n            return ret;\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n\n    return getStringForKeyJNI(pKey, defaultValue.c_str());\n}\n\nData UserDefault::getDataForKey(const char* pKey)\n{\n    return getDataForKey(pKey, Data::Null);\n}\n\nData UserDefault::getDataForKey(const char* pKey, const Data& defaultValue)\n{\n#ifdef KEEP_COMPATABILITY\n    tinyxml2::XMLDocument* doc = nullptr;\n    tinyxml2::XMLElement* node = getXMLNodeForKey(pKey, &doc);\n    if (node)\n    {\n        if (node->FirstChild())\n        {\n            const char * encodedData = node->FirstChild()->Value();\n            \n            unsigned char * decodedData;\n            int decodedDataLen = base64Decode((unsigned char*)encodedData, (unsigned int)strlen(encodedData), &decodedData);\n            \n            if (decodedData) {\n                Data ret;\n                ret.fastSet(decodedData, decodedDataLen);\n                \n                // set value in NSUserDefaults\n                setDataForKey(pKey, ret);\n                \n                flush();\n                \n                // delete xmle node\n                deleteNode(doc, node);\n                \n                return ret;\n            }\n        }\n        else\n        {\n            // delete xmle node\n            deleteNode(doc, node);\n        }\n    }\n#endif\n    \n    char * encodedDefaultData = NULL;\n    unsigned int encodedDefaultDataLen = !defaultValue.isNull() ? base64Encode(defaultValue.getBytes(), defaultValue.getSize(), &encodedDefaultData) : 0;\n    \n    string encodedStr = getStringForKeyJNI(pKey, encodedDefaultData);\n\n    if (encodedDefaultData)\n        free(encodedDefaultData);\n\n    CCLOG(\"ENCODED STRING: --%s--%d\", encodedStr.c_str(), encodedStr.length());\n      \n    unsigned char * decodedData = NULL;\n    int decodedDataLen = base64Decode((unsigned char*)encodedStr.c_str(), (unsigned int)encodedStr.length(), &decodedData);\n\n    CCLOG(\"DECODED DATA: %s %d\", decodedData, decodedDataLen);\n    \n    if (decodedData && decodedDataLen) {\n        Data ret;\n        ret.fastSet(decodedData, decodedDataLen);\n        return ret;\n    }\n\n    return defaultValue;\n}\n\n\nvoid UserDefault::setBoolForKey(const char* pKey, bool value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n\n    return setBoolForKeyJNI(pKey, value);\n}\n\nvoid UserDefault::setIntegerForKey(const char* pKey, int value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n\n    return setIntegerForKeyJNI(pKey, value);\n}\n\nvoid UserDefault::setFloatForKey(const char* pKey, float value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n\n    return setFloatForKeyJNI(pKey, value);\n}\n\nvoid UserDefault::setDoubleForKey(const char* pKey, double value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n\n    return setDoubleForKeyJNI(pKey, value);\n}\n\nvoid UserDefault::setStringForKey(const char* pKey, const std::string & value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n\n    return setStringForKeyJNI(pKey, value.c_str());\n}\n\nvoid UserDefault::setDataForKey(const char* pKey, const Data& value)\n{\n#ifdef KEEP_COMPATABILITY\n    deleteNodeByKey(pKey);\n#endif\n    \n    CCLOG(\"SET DATA FOR KEY: --%s--%d\", value.getBytes(), value.getSize());\n    char * encodedData = nullptr;\n    unsigned int encodedDataLen = base64Encode(value.getBytes(), value.getSize(), &encodedData);\n\n    CCLOG(\"SET DATA ENCODED: --%s\", encodedData);\n    \n    setStringForKeyJNI(pKey, encodedData);\n    \n    if (encodedData)\n        free(encodedData);\n}\n\n// XXX: deprecated\nUserDefault* UserDefault::sharedUserDefault()\n{\n    return UserDefault::getInstance();\n}\n\nUserDefault* UserDefault::getInstance()\n{\n#ifdef KEEP_COMPATABILITY\n    initXMLFilePath();\n#endif\n    \n    if (! _userDefault)\n    {\n        _userDefault = new UserDefault();\n    }\n\n    return _userDefault;\n}\n\nbool UserDefault::isXMLFileExist()\n{\n    FILE *fp = fopen(_filePath.c_str(), \"r\");\n    bool bRet = false;\n    \n    if (fp)\n    {\n        bRet = true;\n        fclose(fp);\n    }\n    \n    return bRet;\n}\n\nvoid UserDefault::initXMLFilePath()\n{\n#ifdef KEEP_COMPATABILITY\n    if (! _isFilePathInitialized)\n    {\n        // UserDefault.xml is stored in /data/data/<package-path>/ before v2.1.2\n        _filePath += \"/data/data/\" + getPackageNameJNI() + \"/\" + XML_FILE_NAME;\n        _isFilePathInitialized = true;\n    }\n#endif\n}\n\n// create new xml file\nbool UserDefault::createXMLFile()\n{\n    return false;\n}\n\nconst string& UserDefault::getXMLFilePath()\n{\n    return _filePath;\n}\n\nvoid UserDefault::flush()\n{\n}\n\nNS_CC_END\n\n#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCVertex.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2011 ForzeField Studios S.L\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCVertex.h\"\n#include \"ccMacros.h\"\n\nNS_CC_BEGIN\n\nvoid ccVertexLineToPolygon(Point *points, float stroke, Vertex2F *vertices, unsigned int offset, unsigned int nuPoints)\n{\n    nuPoints += offset;\n    if(nuPoints<=1) return;\n\n    stroke *= 0.5f;\n\n    unsigned int idx;\n    unsigned int nuPointsMinus = nuPoints-1;\n\n    for(unsigned int i = offset; i<nuPoints; i++)\n    {\n        idx = i*2;\n        Point p1 = points[i];\n        Point perpVector;\n\n        if(i == 0)\n            perpVector = (p1 - points[i+1]).normalize().getPerp();\n        else if(i == nuPointsMinus)\n            perpVector = (points[i-1] - p1).normalize().getPerp();\n        else\n        {\n            Point p2 = points[i+1];\n            Point p0 = points[i-1];\n\n            Point p2p1 = (p2 - p1).normalize();\n            Point p0p1 = (p0 - p1).normalize();\n\n            // Calculate angle between vectors\n            float angle = acosf(p2p1.dot(p0p1));\n\n            if(angle < CC_DEGREES_TO_RADIANS(70))\n                perpVector = p2p1.getMidpoint(p0p1).normalize().getPerp();\n            else if(angle < CC_DEGREES_TO_RADIANS(170))\n                perpVector = p2p1.getMidpoint(p0p1).normalize();\n            else\n                perpVector = (p2 - p0).normalize().getPerp();\n        }\n        perpVector = perpVector * stroke;\n\n        vertices[idx] = Vertex2F(p1.x+perpVector.x, p1.y+perpVector.y);\n        vertices[idx+1] = Vertex2F(p1.x-perpVector.x, p1.y-perpVector.y);\n\n    }\n\n    // Validate vertexes\n    offset = (offset==0) ? 0 : offset-1;\n    for(unsigned int i = offset; i<nuPointsMinus; i++)\n    {\n        idx = i*2;\n        const unsigned int idx1 = idx+2;\n\n        Vertex2F p1 = vertices[idx];\n        Vertex2F p2 = vertices[idx+1];\n        Vertex2F p3 = vertices[idx1];\n        Vertex2F p4 = vertices[idx1+1];\n\n        float s;\n        //BOOL fixVertex = !ccpLineIntersect(Point(p1.x, p1.y), Point(p4.x, p4.y), Point(p2.x, p2.y), Point(p3.x, p3.y), &s, &t);\n        bool fixVertex = !ccVertexLineIntersect(p1.x, p1.y, p4.x, p4.y, p2.x, p2.y, p3.x, p3.y, &s);\n        if(!fixVertex)\n            if (s<0.0f || s>1.0f)\n                fixVertex = true;\n\n        if(fixVertex)\n        {\n            vertices[idx1] = p4;\n            vertices[idx1+1] = p3;\n        }\n    }\n}\n\nbool ccVertexLineIntersect(float Ax, float Ay,\n                               float Bx, float By,\n                               float Cx, float Cy,\n                               float Dx, float Dy, float *T)\n{\n    float  distAB, theCos, theSin, newX;\n\n    // FAIL: Line undefined\n    if ((Ax==Bx && Ay==By) || (Cx==Dx && Cy==Dy)) return false;\n\n    //  Translate system to make A the origin\n    Bx-=Ax; By-=Ay;\n    Cx-=Ax; Cy-=Ay;\n    Dx-=Ax; Dy-=Ay;\n\n    // Length of segment AB\n    distAB = sqrtf(Bx*Bx+By*By);\n\n    // Rotate the system so that point B is on the positive X axis.\n    theCos = Bx/distAB;\n    theSin = By/distAB;\n    newX = Cx*theCos+Cy*theSin;\n    Cy  = Cy*theCos-Cx*theSin; Cx = newX;\n    newX = Dx*theCos+Dy*theSin;\n    Dy  = Dy*theCos-Dx*theSin; Dx = newX;\n\n    // FAIL: Lines are parallel.\n    if (Cy == Dy) return false;\n\n    // Discover the relative position of the intersection in the line AB\n    *T = (Dx+(Cx-Dx)*Dy/(Dy-Cy))/distAB;\n\n    // Success.\n    return true;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/CCVertex.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2011 ForzeField Studios S.L\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __CCVERTEX_H__\n#define __CCVERTEX_H__\n\n#include \"ccTypes.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\n/** @file CCVertex.h */\n\n/** converts a line to a polygon */\nvoid CC_DLL ccVertexLineToPolygon(Point *points, float stroke, Vertex2F *vertices, unsigned int offset, unsigned int nuPoints);\n\n/** returns whether or not the line intersects */\nbool CC_DLL ccVertexLineIntersect(float Ax, float Ay,\n                             float Bx, float By,\n                             float Cx, float Cy,\n                             float Dx, float Dy, float *T);\n\n// end of data_structures group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCVERTEX_H__ */\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/CMakeLists.txt",
    "content": "if(WIN32)\n\nADD_DEFINITIONS(-DUNICODE -D_UNICODE)\n\nset(PLATFORM_SRC\n  platform/win32/CCStdC.cpp\n  platform/win32/CCFileUtilsWin32.cpp\n  platform/win32/CCCommon.cpp\n  platform/win32/CCApplication.cpp\n  platform/win32/CCEGLView.cpp\n  platform/win32/CCImage.cpp\n  platform/win32/CCDevice.cpp\n)\n\nelseif(APPLE)\n\nelse()\n\nset(PLATFORM_SRC\n  platform/linux/CCStdC.cpp\n  platform/linux/CCFileUtilsLinux.cpp\n  platform/linux/CCCommon.cpp\n  platform/linux/CCApplication.cpp\n  platform/desktop/CCEGLView.cpp\n  platform/linux/CCImage.cpp\n  platform/linux/CCDevice.cpp\n)\n\nendif()\n\n\nset(COCOS2D_SRC\n  CCAction.cpp\n  CCActionCamera.cpp\n  CCActionEase.cpp\n  CCActionGrid.cpp\n  CCActionGrid3D.cpp\n  CCActionInstant.cpp\n  CCActionInterval.cpp\n  CCActionManager.cpp\n  CCActionPageTurn3D.cpp\n  CCActionProgressTimer.cpp\n  CCActionTiledGrid.cpp\n  CCActionCatmullRom.cpp\n  CCActionTween.cpp\n  CCAtlasNode.cpp\n  CCNode.cpp\n  CCEventAcceleration.cpp\n  CCEventListenerAcceleration.cpp\n  CCEvent.cpp\n  CCEventDispatcher.cpp\n  CCEventListener.cpp\n  CCEventKeyboard.cpp\n  CCEventListenerKeyboard.cpp\n  CCEventMouse.cpp\n  CCEventListenerMouse.cpp\n  CCTouch.cpp\n  CCEventTouch.cpp\n  CCEventListenerTouch.cpp\n  CCEventCustom.cpp\n  CCEventListenerCustom.cpp\n  CCDrawingPrimitives.cpp\n  CCDrawNode.cpp\n  CCGrabber.cpp\n  CCGrid.cpp\n  CCNodeGrid.cpp\n  CCFont.cpp\n  CCFontAtlas.cpp\n  CCFontAtlasCache.cpp\n  CCFontFNT.cpp\n  CCFontFreeType.cpp\n  CCFontCharMap.cpp\n  CCLabel.cpp\n  CCLabelAtlas.cpp\n  CCLabelBMFont.cpp\n  CCLabelTTF.cpp\n  CCLabelTextFormatter.cpp\n  CCLayer.cpp\n  CCScene.cpp\n  CCTransition.cpp\n  CCTransitionPageTurn.cpp\n  CCTransitionProgress.cpp\n  CCMenu.cpp\n  CCMenuItem.cpp\n  CCMotionStreak.cpp\n  CCProgressTimer.cpp\n  CCClippingNode.cpp\n  CCRenderTexture.cpp\n  CCParticleExamples.cpp\n  CCParticleSystem.cpp\n  CCParticleSystemQuad.cpp\n  CCParticleBatchNode.cpp\n  CCScriptSupport.cpp\n  CCAnimation.cpp\n  CCAnimationCache.cpp\n  CCSprite.cpp\n  CCSpriteBatchNode.cpp\n  CCSpriteFrame.cpp\n  CCSpriteFrameCache.cpp\n  ccUTF8.cpp\n  CCProfiling.cpp\n  CCUserDefault.cpp\n  TransformUtils.cpp\n  base64.cpp\n  ccUtils.cpp\n  CCVertex.cpp\n  CCNotificationCenter.cpp\n  TGAlib.cpp\n  ZipUtils.cpp\n  ccCArray.cpp\n  CCComponent.cpp\n  CCComponentContainer.cpp\n  CCIMEDispatcher.cpp\n  CCTextFieldTTF.cpp\n  CCTexture2D.cpp\n  CCTextureAtlas.cpp\n  CCTextureCache.cpp\n  CCParallaxNode.cpp\n  CCTMXLayer.cpp\n  CCTMXObjectGroup.cpp\n  CCTMXTiledMap.cpp\n  CCTMXXMLParser.cpp\n  CCTileMapAtlas.cpp\n  CCGLProgram.cpp\n  ccGLStateCache.cpp\n  CCShaderCache.cpp\n  ccShaders.cpp\n  CCConfiguration.cpp\n  CCDirector.cpp\n  CCScheduler.cpp\n  ccFPSImages.c\n  ccTypes.cpp\n  cocos2d.cpp\n  CCDeprecated.cpp\n  platform/CCSAXParser.cpp\n  platform/CCThread.cpp\n  platform/CCEGLViewProtocol.cpp\n  platform/CCFileUtils.cpp\n  ../../external/edtaa3func/edtaa3func.cpp\n  renderer/CCCustomCommand.cpp\n  renderer/CCFrustum.cpp\n  renderer/CCGroupCommand.cpp\n  renderer/CCMaterialManager.cpp\n  renderer/CCQuadCommand.cpp\n  renderer/CCBatchCommand.cpp\n  renderer/CCRenderCommand.cpp\n  renderer/CCRenderer.cpp\n  renderer/CCRenderMaterial.cpp\n)\n\ninclude(../physics/CMakeLists.txt)\n\nadd_library(cocos2d STATIC\n  ${COCOS2D_SRC}\n  ${PLATFORM_SRC}\n  ${COCOS_PHYSICS_SRC}\n)\n\nif(WIN32)\n\nif(MINGW)\n\nset(COCOS_LINK\n  z\n  jpeg\n  png\n  webp\n  tiff\n  glfw3\n  glew32\n  opengl32\n  iconv\n  freetype\n  bz2\n  )\n\nelse()\n\n\nset(COCOS_LINK\n  libjpeg\n  libpng\n  libwebp\n  libtiff\n  freetype250\n  glfw3\n  glew32\n  opengl32\n  libiconv\n  libzlib\n  )\n\nendif()\n\nelseif(APPLE)\n\nelse()\nset(COCOS_LINK\n  jpeg\n  webp\n  tiff\n  freetype\n  fontconfig\n  png\n  pthread\n  glfw\n  GLEW\n  GL\n  X11\n  rt\n  z\n)\nendif()\n\ntarget_link_libraries(cocos2d\n  cocosbase\n  chipmunk_static\n  tinyxml2\n  kazmath\n  unzip\n  ${COCOS_LINK}\n)\n\nset_target_properties(cocos2d\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/TGAlib.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include <string.h>\n#include <stdlib.h>\n\n#include \"TGAlib.h\"\n#include \"CCData.h\"\n#include \"platform/CCFileUtils.h\"\n\nNS_CC_BEGIN\n\nstatic bool tgaLoadRLEImageData(unsigned char* Buffer, unsigned long bufSize, tImageTGA *info);\nvoid tgaFlipImage( tImageTGA *info );\n\n// load the image header field from stream\nbool tgaLoadHeader(unsigned char* buffer, unsigned long bufSize, tImageTGA *info)\n{\n    bool ret = false;\n\n    do \n    {\n        size_t step = sizeof(unsigned char) * 2;\n        CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize);\n        memcpy(&info->type, buffer + step, sizeof(unsigned char));\n\n        step += sizeof(unsigned char) * 2;\n        step += sizeof(signed short) * 4;\n        CC_BREAK_IF((step + sizeof(signed short) * 2 + sizeof(unsigned char)) > bufSize);\n        memcpy(&info->width, buffer + step, sizeof(signed short));\n        memcpy(&info->height, buffer + step + sizeof(signed short), sizeof(signed short));\n        memcpy(&info->pixelDepth, buffer + step + sizeof(signed short) * 2, sizeof(unsigned char));\n\n        step += sizeof(unsigned char);\n        step += sizeof(signed short) * 2;\n        CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize);\n        unsigned char cGarbage;\n        memcpy(&cGarbage, buffer + step, sizeof(unsigned char));\n\n        info->flipped = 0;\n        if ( cGarbage & 0x20 ) \n        {\n            info->flipped = 1;\n        }\n        ret = true;\n    } while (0);\n\n    return ret;\n}\n\nbool tgaLoadImageData(unsigned char *Buffer, unsigned long bufSize, tImageTGA *info)\n{\n    bool ret = false;\n\n    do \n    {\n        int mode,total,i;\n        unsigned char aux;\n        size_t step = (sizeof(unsigned char) + sizeof(signed short)) * 6;\n\n        // mode equal the number of components for each pixel\n        mode = info->pixelDepth / 8;\n        // total is the number of unsigned chars we'll have to read\n        total = info->height * info->width * mode;\n\n        size_t dataSize = sizeof(unsigned char) * total;\n        CC_BREAK_IF((step + dataSize) > bufSize);\n        memcpy(info->imageData, Buffer + step, dataSize);\n\n        // mode=3 or 4 implies that the image is RGB(A). However TGA\n        // stores it as BGR(A) so we'll have to swap R and B.\n        if (mode >= 3)\n        {\n            for (i=0; i < total; i+= mode)\n            {\n                aux = info->imageData[i];\n                info->imageData[i] = info->imageData[i+2];\n                info->imageData[i+2] = aux;\n            }\n        }\n\n        ret = true;\n    } while (0);\n\n    return ret;\n}\n\nstatic bool tgaLoadRLEImageData(unsigned char* buffer, unsigned long bufSize, tImageTGA *info)\n{\n    unsigned int mode,total,i, index = 0;\n    unsigned char aux[4], runlength = 0;\n    unsigned int skip = 0, flag = 0;\n    size_t step = (sizeof(unsigned char) + sizeof(signed short)) * 6;\n\n    // mode equal the number of components for each pixel\n    mode = info->pixelDepth / 8;\n    // total is the number of unsigned chars we'll have to read\n    total = info->height * info->width;\n\n    for( i = 0; i < total; i++ )\n    {\n        // if we have a run length pending, run it\n        if ( runlength != 0 )\n        {\n            // we do, update the run length count\n            runlength--;\n            skip = (flag != 0);\n        }\n        else\n        {\n            // otherwise, read in the run length token\n            CC_BREAK_IF((step + sizeof(unsigned char)) > bufSize);\n            memcpy(&runlength, buffer + step, sizeof(unsigned char));\n            step += sizeof(unsigned char);\n\n            // see if it's a RLE encoded sequence\n            flag = runlength & 0x80;\n            if ( flag )\n            {\n                runlength -= 128;\n            }\n            skip = 0;\n        }\n\n        // do we need to skip reading this pixel?\n        if ( !skip )\n        {\n            // no, read in the pixel data\n            CC_BREAK_IF((step + sizeof(unsigned char) * mode) > bufSize);\n\n            memcpy(aux, buffer + step, sizeof(unsigned char) * mode);\n            step += sizeof(unsigned char) * mode;\n\n            // mode=3 or 4 implies that the image is RGB(A). However TGA\n            // stores it as BGR(A) so we'll have to swap R and B.\n            if ( mode >= 3 )\n            {\n                unsigned char tmp;\n\n                tmp = aux[0];\n                aux[0] = aux[2];\n                aux[2] = tmp;\n            }\n        }\n\n        // add the pixel to our image\n        memcpy(&info->imageData[index], aux, mode);\n        index += mode;\n    }\n    \n    return true;\n}\n\nvoid tgaFlipImage( tImageTGA *info )\n{\n    // mode equal the number of components for each pixel\n    int mode = info->pixelDepth / 8;\n    int rowbytes = info->width*mode;\n    unsigned char *row = (unsigned char *)malloc(rowbytes);\n    int y;\n    \n    if (row == NULL) return;\n    \n    for( y = 0; y < (info->height/2); y++ )\n    {\n        memcpy(row, &info->imageData[y*rowbytes],rowbytes);\n        memcpy(&info->imageData[y*rowbytes], &info->imageData[(info->height-(y+1))*rowbytes], rowbytes);\n        memcpy(&info->imageData[(info->height-(y+1))*rowbytes], row, rowbytes);\n    }\n    \n    free(row);\n    info->flipped = 0;\n}\n    \ntImageTGA* tgaLoadBuffer(unsigned char* buffer, long size)\n{\n    int mode,total;\n    tImageTGA *info = nullptr;\n    \n    do\n    {\n        CC_BREAK_IF(! buffer);\n        info = (tImageTGA *)malloc(sizeof(tImageTGA));\n\n        // get the file header info\n        if (! tgaLoadHeader(buffer, size, info))\n        {\n            info->status = TGA_ERROR_MEMORY;\n            break;\n        }\n\n        // check if the image is color indexed\n        if (info->type == 1)\n        {\n            info->status = TGA_ERROR_INDEXED_COLOR;\n            break;\n        }\n\n        // check for other types (compressed images)\n        if ((info->type != 2) && (info->type !=3) && (info->type !=10) )\n        {\n            info->status = TGA_ERROR_COMPRESSED_FILE;\n            break;\n        }\n\n        // mode equals the number of image components\n        mode = info->pixelDepth / 8;\n        // total is the number of unsigned chars to read\n        total = info->height * info->width * mode;\n        // allocate memory for image pixels\n        info->imageData = (unsigned char *)malloc(sizeof(unsigned char) * total);\n\n        // check to make sure we have the memory required\n        if (info->imageData == NULL)\n        {\n            info->status = TGA_ERROR_MEMORY;\n            break;\n        }\n\n        bool bLoadImage = false;\n        // finally load the image pixels\n        if ( info->type == 10 )\n        {\n            bLoadImage = tgaLoadRLEImageData(buffer, size, info);\n        }\n        else\n        {\n            bLoadImage = tgaLoadImageData(buffer, size, info);\n        }\n\n        // check for errors when reading the pixels\n        if (! bLoadImage)\n        {\n            info->status = TGA_ERROR_READING_FILE;\n            break;\n        }\n        info->status = TGA_OK;\n\n        if ( info->flipped )\n        {\n            tgaFlipImage( info );\n            if ( info->flipped )\n            {\n                info->status = TGA_ERROR_MEMORY;\n            }\n        }\n    } while(0);\n\n    return info;\n}\n\n// this is the function to call when we want to load an image\ntImageTGA * tgaLoad(const char *filename)\n{\n    Data data = FileUtils::getInstance()->getDataFromFile(filename);\n\n    if (!data.isNull())\n    {\n        return tgaLoadBuffer(data.getBytes(), data.getSize());\n    }\n    \n    return nullptr;\n}\n\n// converts RGB to grayscale\nvoid tgaRGBtogreyscale(tImageTGA *info) {\n    \n    int mode,i,j;\n    \n    unsigned char *newImageData;\n    \n    // if the image is already grayscale do nothing\n    if (info->pixelDepth == 8)\n        return;\n    \n    // compute the number of actual components\n    mode = info->pixelDepth / 8;\n    \n    // allocate an array for the new image data\n    newImageData = (unsigned char *)malloc(sizeof(unsigned char) * \n                                           info->height * info->width);\n    if (newImageData == nullptr) {\n        return;\n    }\n    \n    // convert pixels: grayscale = o.30 * R + 0.59 * G + 0.11 * B\n    for (i = 0,j = 0; j < info->width * info->height; i +=mode, j++)\n        newImageData[j] =    \n        (unsigned char)(0.30 * info->imageData[i] +\n                        0.59 * info->imageData[i+1] +\n                        0.11 * info->imageData[i+2]);\n    \n    \n    //free old image data\n    free(info->imageData);\n    \n    // reassign pixelDepth and type according to the new image type\n    info->pixelDepth = 8;\n    info->type = 3;\n    // reassigning imageData to the new array.\n    info->imageData = newImageData;\n}\n\n// releases the memory used for the image\nvoid tgaDestroy(tImageTGA *info) {\n    \n    if (info != nullptr) {\n        if (info->imageData != nullptr)\n        {\n            free(info->imageData);\n        }\n\n        free(info);\n    }\n}\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/TGAlib.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __SUPPORT_DATA_SUPPORT_TGALIB_H__\n#define __SUPPORT_DATA_SUPPORT_TGALIB_H__\n\nnamespace cocos2d {\n\nenum {\n    TGA_OK,\n    TGA_ERROR_FILE_OPEN,\n    TGA_ERROR_READING_FILE,\n    TGA_ERROR_INDEXED_COLOR,\n    TGA_ERROR_MEMORY,\n    TGA_ERROR_COMPRESSED_FILE,\n};\n\n/** TGA format */\ntypedef struct sImageTGA {\n    int status;\n    unsigned char type, pixelDepth;\n    \n    /** map width */\n    signed short width;\n    \n    /** map height */\n    signed short height;\n    \n    /** raw data */\n    unsigned char *imageData;\n    int flipped;\n} tImageTGA;\n\n/// load the image header fields. We only keep those that matter!\nbool tgaLoadHeader(unsigned char *buffer, unsigned long bufSize, tImageTGA *info);\n\n/// loads the image pixels. You shouldn't call this function directly\nbool tgaLoadImageData(unsigned char *buffer, unsigned long bufSize, tImageTGA *info);\n\n/// this is the function to call when we want to load an image buffer.\ntImageTGA* tgaLoadBuffer(unsigned char* buffer, long size);\n\n/// this is the function to call when we want to load an image\ntImageTGA * tgaLoad(const char *filename);\n\n// /converts RGB to grayscale\nvoid tgaRGBtogreyscale(tImageTGA *info);\n\n/// releases the memory used for the image\nvoid tgaDestroy(tImageTGA *info);\n\n}//namespace cocos2d \n\n#endif // __SUPPORT_DATA_SUPPORT_TGALIB_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/TransformUtils.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2009      Valentin Milea\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"TransformUtils.h\"\n#include \"CCAffineTransform.h\"\n\nnamespace cocos2d {\n\nvoid CGAffineToGL(const AffineTransform& t, GLfloat *m)\n{\n    // | m[0] m[4] m[8]  m[12] |     | m11 m21 m31 m41 |     | a c 0 tx |\n    // | m[1] m[5] m[9]  m[13] |     | m12 m22 m32 m42 |     | b d 0 ty |\n    // | m[2] m[6] m[10] m[14] | <=> | m13 m23 m33 m43 | <=> | 0 0 1  0 |\n    // | m[3] m[7] m[11] m[15] |     | m14 m24 m34 m44 |     | 0 0 0  1 |\n    \n    m[2] = m[3] = m[6] = m[7] = m[8] = m[9] = m[11] = m[14] = 0.0f;\n    m[10] = m[15] = 1.0f;\n    m[0] = t.a; m[4] = t.c; m[12] = t.tx;\n    m[1] = t.b; m[5] = t.d; m[13] = t.ty;\n}\n\nvoid GLToCGAffine(const GLfloat *m, AffineTransform *t)\n{\n    t->a = m[0]; t->c = m[4]; t->tx = m[12];\n    t->b = m[1]; t->d = m[5]; t->ty = m[13];\n}\n\n}//namespace   cocos2d \n\n"
  },
  {
    "path": "cocos2d/cocos/2d/TransformUtils.h",
    "content": "/****************************************************************************\nCopyright (c) 2009      Valentin Milea\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __SUPPORT_TRANSFORM_UTILS_H__\n#define __SUPPORT_TRANSFORM_UTILS_H__\n\n// todo:\n// when in MAC or windows, it includes <OpenGL/gl.h>\n#include \"CCGL.h\"\n\nnamespace   cocos2d {\n\nstruct AffineTransform;\n\nvoid CGAffineToGL(const AffineTransform &t, GLfloat *m);\nvoid GLToCGAffine(const GLfloat *m, AffineTransform *t);\n}//namespace   cocos2d \n\n#endif // __SUPPORT_TRANSFORM_UTILS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/ZipUtils.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include <zlib.h>\n#include <assert.h>\n#include <stdlib.h>\n\n#include \"ZipUtils.h\"\n#include \"CCData.h\"\n#include \"ccMacros.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"unzip.h\"\n#include <map>\n\nNS_CC_BEGIN\n\nunsigned int ZipUtils::s_uEncryptedPvrKeyParts[4] = {0,0,0,0};\nunsigned int ZipUtils::s_uEncryptionKey[1024];\nbool ZipUtils::s_bEncryptionKeyIsValid = false;\n\n// --------------------- ZipUtils ---------------------\n\ninline void ZipUtils::decodeEncodedPvr(unsigned int *data, ssize_t len)\n{\n    const int enclen = 1024;\n    const int securelen = 512;\n    const int distance = 64;\n    \n    // check if key was set\n    // make sure to call caw_setkey_part() for all 4 key parts\n    CCASSERT(s_uEncryptedPvrKeyParts[0] != 0, \"Cocos2D: CCZ file is encrypted but key part 0 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?\");\n    CCASSERT(s_uEncryptedPvrKeyParts[1] != 0, \"Cocos2D: CCZ file is encrypted but key part 1 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?\");\n    CCASSERT(s_uEncryptedPvrKeyParts[2] != 0, \"Cocos2D: CCZ file is encrypted but key part 2 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?\");\n    CCASSERT(s_uEncryptedPvrKeyParts[3] != 0, \"Cocos2D: CCZ file is encrypted but key part 3 is not set. Did you call ZipUtils::setPvrEncryptionKeyPart(...)?\");\n    \n    // create long key\n    if(!s_bEncryptionKeyIsValid)\n    {\n        unsigned int y, p, e;\n        unsigned int rounds = 6;\n        unsigned int sum = 0;\n        unsigned int z = s_uEncryptionKey[enclen-1];\n        \n        do\n        {\n#define DELTA 0x9e3779b9\n#define MX (((z>>5^y<<2) + (y>>3^z<<4)) ^ ((sum^y) + (s_uEncryptedPvrKeyParts[(p&3)^e] ^ z)))\n            \n            sum += DELTA;\n            e = (sum >> 2) & 3;\n            \n            for (p = 0; p < enclen - 1; p++)\n            {\n                y = s_uEncryptionKey[p + 1];\n                z = s_uEncryptionKey[p] += MX;\n            }\n            \n            y = s_uEncryptionKey[0];\n            z = s_uEncryptionKey[enclen - 1] += MX;\n            \n        } while (--rounds);\n        \n        s_bEncryptionKeyIsValid = true;\n    }\n    \n    int b = 0;\n    int i = 0;\n    \n    // encrypt first part completely\n    for(; i < len && i < securelen; i++)\n    {\n        data[i] ^= s_uEncryptionKey[b++];\n        \n        if(b >= enclen)\n        {\n            b = 0;\n        }\n    }\n    \n    // encrypt second section partially\n    for(; i < len; i += distance)\n    {\n        data[i] ^= s_uEncryptionKey[b++];\n        \n        if(b >= enclen)\n        {\n            b = 0;\n        }\n    }\n}\n\ninline unsigned int ZipUtils::checksumPvr(const unsigned int *data, ssize_t len)\n{\n    unsigned int cs = 0;\n    const int cslen = 128;\n    \n    len = (len < cslen) ? len : cslen;\n    \n    for(int i = 0; i < len; i++)\n    {\n        cs = cs ^ data[i];\n    }\n    \n    return cs;\n}\n\n// memory in iPhone is precious\n// Should buffer factor be 1.5 instead of 2 ?\n#define BUFFER_INC_FACTOR (2)\n\nint ZipUtils::inflateMemoryWithHint(unsigned char *in, ssize_t inLength, unsigned char **out, ssize_t *outLength, ssize_t outLenghtHint)\n{\n    /* ret value */\n    int err = Z_OK;\n    \n    ssize_t bufferSize = outLenghtHint;\n    *out = (unsigned char*)malloc(bufferSize);\n    \n    z_stream d_stream; /* decompression stream */\n    d_stream.zalloc = (alloc_func)0;\n    d_stream.zfree = (free_func)0;\n    d_stream.opaque = (voidpf)0;\n    \n    d_stream.next_in  = in;\n    d_stream.avail_in = static_cast<unsigned int>(inLength);\n    d_stream.next_out = *out;\n    d_stream.avail_out = static_cast<unsigned int>(bufferSize);\n    \n    /* window size to hold 256k */\n    if( (err = inflateInit2(&d_stream, 15 + 32)) != Z_OK )\n        return err;\n    \n    for (;;)\n    {\n        err = inflate(&d_stream, Z_NO_FLUSH);\n        \n        if (err == Z_STREAM_END)\n        {\n            break;\n        }\n        \n        switch (err)\n        {\n            case Z_NEED_DICT:\n                err = Z_DATA_ERROR;\n            case Z_DATA_ERROR:\n            case Z_MEM_ERROR:\n                inflateEnd(&d_stream);\n                return err;\n        }\n        \n        // not enough memory ?\n        if (err != Z_STREAM_END)\n        {\n            *out = (unsigned char*)realloc(*out, bufferSize * BUFFER_INC_FACTOR);\n            \n            /* not enough memory, ouch */\n            if (! *out )\n            {\n                CCLOG(\"cocos2d: ZipUtils: realloc failed\");\n                inflateEnd(&d_stream);\n                return Z_MEM_ERROR;\n            }\n            \n            d_stream.next_out = *out + bufferSize;\n            d_stream.avail_out = static_cast<unsigned int>(bufferSize);\n            bufferSize *= BUFFER_INC_FACTOR;\n        }\n    }\n    \n    *outLength = bufferSize - d_stream.avail_out;\n    err = inflateEnd(&d_stream);\n    return err;\n}\n\nssize_t ZipUtils::inflateMemoryWithHint(unsigned char *in, ssize_t inLength, unsigned char **out, ssize_t outLengthHint)\n{\n    ssize_t outLength = 0;\n    int err = inflateMemoryWithHint(in, inLength, out, &outLength, outLengthHint);\n    \n    if (err != Z_OK || *out == nullptr) {\n        if (err == Z_MEM_ERROR)\n        {\n            CCLOG(\"cocos2d: ZipUtils: Out of memory while decompressing map data!\");\n        } else\n            if (err == Z_VERSION_ERROR)\n            {\n                CCLOG(\"cocos2d: ZipUtils: Incompatible zlib version!\");\n            } else\n                if (err == Z_DATA_ERROR)\n                {\n                    CCLOG(\"cocos2d: ZipUtils: Incorrect zlib compressed data!\");\n                }\n                else\n                {\n                    CCLOG(\"cocos2d: ZipUtils: Unknown error while decompressing map data!\");\n                }\n\n        if(*out) {\n            free(*out);\n            *out = nullptr;\n        }\n        outLength = 0;\n    }\n    \n    return outLength;\n}\n\nssize_t ZipUtils::inflateMemory(unsigned char *in, ssize_t inLength, unsigned char **out)\n{\n    // 256k for hint\n    return inflateMemoryWithHint(in, inLength, out, 256 * 1024);\n}\n\nint ZipUtils::inflateGZipFile(const char *path, unsigned char **out)\n{\n    int len;\n    unsigned int offset = 0;\n    \n    CCASSERT(out, \"\");\n    CCASSERT(&*out, \"\");\n    \n    gzFile inFile = gzopen(path, \"rb\");\n    if( inFile == nullptr ) {\n        CCLOG(\"cocos2d: ZipUtils: error open gzip file: %s\", path);\n        return -1;\n    }\n    \n    /* 512k initial decompress buffer */\n    unsigned int bufferSize = 512 * 1024;\n    unsigned int totalBufferSize = bufferSize;\n    \n    *out = (unsigned char*)malloc( bufferSize );\n    if( ! out )\n    {\n        CCLOG(\"cocos2d: ZipUtils: out of memory\");\n        return -1;\n    }\n    \n    for (;;) {\n        len = gzread(inFile, *out + offset, bufferSize);\n        if (len < 0)\n        {\n            CCLOG(\"cocos2d: ZipUtils: error in gzread\");\n            free( *out );\n            *out = nullptr;\n            return -1;\n        }\n        if (len == 0)\n        {\n            break;\n        }\n        \n        offset += len;\n        \n        // finish reading the file\n        if( (unsigned int)len < bufferSize )\n        {\n            break;\n        }\n        \n        bufferSize *= BUFFER_INC_FACTOR;\n        totalBufferSize += bufferSize;\n        unsigned char *tmp = (unsigned char*)realloc(*out, totalBufferSize );\n        \n        if( ! tmp )\n        {\n            CCLOG(\"cocos2d: ZipUtils: out of memory\");\n            free( *out );\n            *out = nullptr;\n            return -1;\n        }\n        \n        *out = tmp;\n    }\n    \n    if (gzclose(inFile) != Z_OK)\n    {\n        CCLOG(\"cocos2d: ZipUtils: gzclose failed\");\n    }\n    \n    return offset;\n}\n\nbool ZipUtils::isCCZFile(const char *path)\n{\n    // load file into memory\n    Data compressedData = FileUtils::getInstance()->getDataFromFile(path);\n\n    if (compressedData.isNull())\n    {\n        CCLOG(\"cocos2d: ZipUtils: loading file failed\");\n        return false;\n    }\n\n    return isCCZBuffer(compressedData.getBytes(), compressedData.getSize());\n}\n\nbool ZipUtils::isCCZBuffer(const unsigned char *buffer, ssize_t len)\n{\n    if (static_cast<size_t>(len) < sizeof(struct CCZHeader))\n    {\n        return false;\n    }\n    \n    struct CCZHeader *header = (struct CCZHeader*) buffer;\n    return header->sig[0] == 'C' && header->sig[1] == 'C' && header->sig[2] == 'Z' && (header->sig[3] == '!' || header->sig[3] == 'p');\n}\n\n\nbool ZipUtils::isGZipFile(const char *path)\n{\n    // load file into memory\n    Data compressedData = FileUtils::getInstance()->getDataFromFile(path);\n\n    if (compressedData.isNull())\n    {\n        CCLOG(\"cocos2d: ZipUtils: loading file failed\");\n        return false;\n    }\n\n    return isGZipBuffer(compressedData.getBytes(), compressedData.getSize());\n}\n\nbool ZipUtils::isGZipBuffer(const unsigned char *buffer, ssize_t len)\n{\n    if (len < 2)\n    {\n        return false;\n    }\n\n    return buffer[0] == 0x1F && buffer[1] == 0x8B;\n}\n\n\nint ZipUtils::inflateCCZBuffer(const unsigned char *buffer, ssize_t bufferLen, unsigned char **out)\n{\n    struct CCZHeader *header = (struct CCZHeader*) buffer;\n\n    // verify header\n    if( header->sig[0] == 'C' && header->sig[1] == 'C' && header->sig[2] == 'Z' && header->sig[3] == '!' )\n    {\n        // verify header version\n        unsigned int version = CC_SWAP_INT16_BIG_TO_HOST( header->version );\n        if( version > 2 )\n        {\n            CCLOG(\"cocos2d: Unsupported CCZ header format\");\n            return -1;\n        }\n\n        // verify compression format\n        if( CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB )\n        {\n            CCLOG(\"cocos2d: CCZ Unsupported compression method\");\n            return -1;\n        }\n    }\n    else if( header->sig[0] == 'C' && header->sig[1] == 'C' && header->sig[2] == 'Z' && header->sig[3] == 'p' )\n    {\n        // encrypted ccz file\n        header = (struct CCZHeader*) buffer;\n\n        // verify header version\n        unsigned int version = CC_SWAP_INT16_BIG_TO_HOST( header->version );\n        if( version > 0 )\n        {\n            CCLOG(\"cocos2d: Unsupported CCZ header format\");\n            return -1;\n        }\n\n        // verify compression format\n        if( CC_SWAP_INT16_BIG_TO_HOST(header->compression_type) != CCZ_COMPRESSION_ZLIB )\n        {\n            CCLOG(\"cocos2d: CCZ Unsupported compression method\");\n            return -1;\n        }\n\n        // decrypt\n        unsigned int* ints = (unsigned int*)(buffer+12);\n        ssize_t enclen = (bufferLen-12)/4;\n\n        decodeEncodedPvr(ints, enclen);\n\n#if COCOS2D_DEBUG > 0\n        // verify checksum in debug mode\n        unsigned int calculated = checksumPvr(ints, enclen);\n        unsigned int required = CC_SWAP_INT32_BIG_TO_HOST( header->reserved );\n\n        if(calculated != required)\n        {\n            CCLOG(\"cocos2d: Can't decrypt image file. Is the decryption key valid?\");\n            return -1;\n        }\n#endif\n    }\n    else\n    {\n        CCLOG(\"cocos2d: Invalid CCZ file\");\n        return -1;\n    }\n\n    unsigned int len = CC_SWAP_INT32_BIG_TO_HOST( header->len );\n\n    *out = (unsigned char*)malloc( len );\n    if(! *out )\n    {\n        CCLOG(\"cocos2d: CCZ: Failed to allocate memory for texture\");\n        return -1;\n    }\n\n    unsigned long destlen = len;\n    size_t source = (size_t) buffer + sizeof(*header);\n    int ret = uncompress(*out, &destlen, (Bytef*)source, bufferLen - sizeof(*header) );\n\n    if( ret != Z_OK )\n    {\n        CCLOG(\"cocos2d: CCZ: Failed to uncompress data\");\n        free( *out );\n        *out = nullptr;\n        return -1;\n    }\n\n    return len;\n}\n\nint ZipUtils::inflateCCZFile(const char *path, unsigned char **out)\n{\n    CCASSERT(out, \"Invalid pointer for buffer!\");\n    \n    // load file into memory\n    Data compressedData = FileUtils::getInstance()->getDataFromFile(path);\n    \n    if (compressedData.isNull())\n    {\n        CCLOG(\"cocos2d: Error loading CCZ compressed file\");\n        return -1;\n    }\n    \n    return inflateCCZBuffer(compressedData.getBytes(), compressedData.getSize(), out);\n}\n\nvoid ZipUtils::setPvrEncryptionKeyPart(int index, unsigned int value)\n{\n    CCASSERT(index >= 0, \"Cocos2d: key part index cannot be less than 0\");\n    CCASSERT(index <= 3, \"Cocos2d: key part index cannot be greater than 3\");\n    \n    if(s_uEncryptedPvrKeyParts[index] != value)\n    {\n        s_uEncryptedPvrKeyParts[index] = value;\n        s_bEncryptionKeyIsValid = false;\n    }\n}\n\nvoid ZipUtils::setPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4)\n{\n    setPvrEncryptionKeyPart(0, keyPart1);\n    setPvrEncryptionKeyPart(1, keyPart2);\n    setPvrEncryptionKeyPart(2, keyPart3);\n    setPvrEncryptionKeyPart(3, keyPart4);\n}\n\n// --------------------- ZipFile ---------------------\n// from unzip.cpp\n#define UNZ_MAXFILENAMEINZIP 256\n\nstruct ZipEntryInfo\n{\n    unz_file_pos pos;\n    uLong uncompressed_size;\n};\n\nclass ZipFilePrivate\n{\npublic:\n    unzFile zipFile;\n    \n    // std::unordered_map is faster if available on the platform\n    typedef std::unordered_map<std::string, struct ZipEntryInfo> FileListContainer;\n    FileListContainer fileList;\n};\n\nZipFile::ZipFile(const std::string &zipFile, const std::string &filter)\n: _data(new ZipFilePrivate)\n{\n    _data->zipFile = unzOpen(zipFile.c_str());\n    setFilter(filter);\n}\n\nZipFile::~ZipFile()\n{\n    if (_data && _data->zipFile)\n    {\n        unzClose(_data->zipFile);\n    }\n\n    CC_SAFE_DELETE(_data);\n}\n\nbool ZipFile::setFilter(const std::string &filter)\n{\n    bool ret = false;\n    do\n    {\n        CC_BREAK_IF(!_data);\n        CC_BREAK_IF(!_data->zipFile);\n        \n        // clear existing file list\n        _data->fileList.clear();\n        \n        // UNZ_MAXFILENAMEINZIP + 1 - it is done so in unzLocateFile\n        char szCurrentFileName[UNZ_MAXFILENAMEINZIP + 1];\n        unz_file_info64 fileInfo;\n        \n        // go through all files and store position information about the required files\n        int err = unzGoToFirstFile64(_data->zipFile, &fileInfo,\n                                     szCurrentFileName, sizeof(szCurrentFileName) - 1);\n        while (err == UNZ_OK)\n        {\n            unz_file_pos posInfo;\n            int posErr = unzGetFilePos(_data->zipFile, &posInfo);\n            if (posErr == UNZ_OK)\n            {\n                std::string currentFileName = szCurrentFileName;\n                // cache info about filtered files only (like 'assets/')\n                if (filter.empty()\n                    || currentFileName.substr(0, filter.length()) == filter)\n                {\n                    ZipEntryInfo entry;\n                    entry.pos = posInfo;\n                    entry.uncompressed_size = (uLong)fileInfo.uncompressed_size;\n                    _data->fileList[currentFileName] = entry;\n                }\n            }\n            // next file - also get the information about it\n            err = unzGoToNextFile64(_data->zipFile, &fileInfo,\n                                    szCurrentFileName, sizeof(szCurrentFileName) - 1);\n        }\n        ret = true;\n        \n    } while(false);\n    \n    return ret;\n}\n\nbool ZipFile::fileExists(const std::string &fileName) const\n{\n    bool ret = false;\n    do\n    {\n        CC_BREAK_IF(!_data);\n        \n        ret = _data->fileList.find(fileName) != _data->fileList.end();\n    } while(false);\n    \n    return ret;\n}\n\nunsigned char *ZipFile::getFileData(const std::string &fileName, ssize_t *size)\n{\n    unsigned char * buffer = nullptr;\n    if (size)\n        *size = 0;\n\n    do\n    {\n        CC_BREAK_IF(!_data->zipFile);\n        CC_BREAK_IF(fileName.empty());\n        \n        ZipFilePrivate::FileListContainer::const_iterator it = _data->fileList.find(fileName);\n        CC_BREAK_IF(it ==  _data->fileList.end());\n        \n        ZipEntryInfo fileInfo = it->second;\n        \n        int nRet = unzGoToFilePos(_data->zipFile, &fileInfo.pos);\n        CC_BREAK_IF(UNZ_OK != nRet);\n        \n        nRet = unzOpenCurrentFile(_data->zipFile);\n        CC_BREAK_IF(UNZ_OK != nRet);\n        \n        buffer = (unsigned char*)malloc(fileInfo.uncompressed_size);\n        int CC_UNUSED nSize = unzReadCurrentFile(_data->zipFile, buffer, static_cast<unsigned int>(fileInfo.uncompressed_size));\n        CCASSERT(nSize == 0 || nSize == (int)fileInfo.uncompressed_size, \"the file size is wrong\");\n        \n        if (size)\n        {\n            *size = fileInfo.uncompressed_size;\n        }\n        unzCloseCurrentFile(_data->zipFile);\n    } while (0);\n    \n    return buffer;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/ZipUtils.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __SUPPORT_ZIPUTILS_H__\n#define __SUPPORT_ZIPUTILS_H__\n\n#include <string>\n#include \"CCPlatformConfig.h\"\n#include \"CCPlatformDefine.h\"\n#include \"CCPlatformMacros.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n#include \"platform/android/CCFileUtilsAndroid.h\"\n#elif(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n// for import ssize_t on win32 platform\n#include \"CCStdC.h\"\n#endif\n\nnamespace cocos2d\n{\n    /* XXX: pragma pack ??? */\n    /** @struct CCZHeader\n    */\n    struct CCZHeader {\n        unsigned char   sig[4];             // signature. Should be 'CCZ!' 4 bytes\n        unsigned short  compression_type;   // should 0\n        unsigned short  version;            // should be 2 (although version type==1 is also supported)\n        unsigned int    reserved;           // Reserved for users.\n        unsigned int    len;                // size of the uncompressed file\n    };\n\n    enum {\n        CCZ_COMPRESSION_ZLIB,               // zlib format.\n        CCZ_COMPRESSION_BZIP2,              // bzip2 format (not supported yet)\n        CCZ_COMPRESSION_GZIP,               // gzip format (not supported yet)\n        CCZ_COMPRESSION_NONE,               // plain (not supported yet)\n    };\n\n    class CC_DLL ZipUtils\n    {\n    public:\n        /** \n        * Inflates either zlib or gzip deflated memory. The inflated memory is\n        * expected to be freed by the caller.\n        *\n        * It will allocate 256k for the destination buffer. If it is not enough it will multiply the previous buffer size per 2, until there is enough memory.\n        * @returns the length of the deflated buffer\n        *\n        @since v0.8.1\n        */\n        CC_DEPRECATED_ATTRIBUTE static ssize_t ccInflateMemory(unsigned char *in, ssize_t inLength, unsigned char **out) { return inflateMemory(in, inLength, out); }\n        static ssize_t inflateMemory(unsigned char *in, ssize_t inLength, unsigned char **out);\n\n        /** \n        * Inflates either zlib or gzip deflated memory. The inflated memory is\n        * expected to be freed by the caller.\n        *\n        * outLenghtHint is assumed to be the needed room to allocate the inflated buffer.\n        *\n        * @returns the length of the deflated buffer\n        *\n        @since v1.0.0\n        */\n        CC_DEPRECATED_ATTRIBUTE static ssize_t ccInflateMemoryWithHint(unsigned char *in, ssize_t inLength, unsigned char **out, ssize_t outLengthHint) { return inflateMemoryWithHint(in, inLength, out, outLengthHint); }\n        static ssize_t inflateMemoryWithHint(unsigned char *in, ssize_t inLength, unsigned char **out, ssize_t outLengthHint);\n\n        /** inflates a GZip file into memory\n        *\n        * @returns the length of the deflated buffer\n        *\n        * @since v0.99.5\n        */\n        CC_DEPRECATED_ATTRIBUTE static int ccInflateGZipFile(const char *filename, unsigned char **out) { return inflateGZipFile(filename, out); }\n        static int inflateGZipFile(const char *filename, unsigned char **out);\n        \n        /** test a file is a GZip format file or not\n        *\n        * @returns true is a GZip format file. false is not\n        *\n        * @since v3.0\n        */\n        CC_DEPRECATED_ATTRIBUTE static bool ccIsGZipFile(const char *filename) { return isGZipFile(filename); }\n        static bool isGZipFile(const char *filename);\n\n        /** test the buffer is GZip format or not\n        *\n        * @returns true is GZip format. false is not\n        *\n        * @since v3.0\n        */\n        CC_DEPRECATED_ATTRIBUTE static bool ccIsGZipBuffer(const unsigned char *buffer, ssize_t len) { return isGZipBuffer(buffer, len); }\n        static bool isGZipBuffer(const unsigned char *buffer, ssize_t len);\n\n        /** inflates a CCZ file into memory\n        *\n        * @returns the length of the deflated buffer\n        *\n        * @since v0.99.5\n        */\n        CC_DEPRECATED_ATTRIBUTE static int ccInflateCCZFile(const char *filename, unsigned char **out) { return inflateCCZFile(filename, out); }\n        static int inflateCCZFile(const char *filename, unsigned char **out);\n\n        /** inflates a buffer with CCZ format into memory\n        *\n        * @returns the length of the deflated buffer\n        *\n        * @since v3.0\n        */\n        CC_DEPRECATED_ATTRIBUTE static int ccInflateCCZBuffer(const unsigned char *buffer, ssize_t len, unsigned char **out) { return inflateCCZBuffer(buffer, len, out); }\n        static int inflateCCZBuffer(const unsigned char *buffer, ssize_t len, unsigned char **out);\n        \n        /** test a file is a CCZ format file or not\n        *\n        * @returns true is a CCZ format file. false is not\n        *\n        * @since v3.0\n        */\n        CC_DEPRECATED_ATTRIBUTE static bool ccIsCCZFile(const char *filename) { return isCCZFile(filename); }\n        static bool isCCZFile(const char *filename);\n\n        /** test the buffer is CCZ format or not\n        *\n        * @returns true is CCZ format. false is not\n        *\n        * @since v3.0\n        */\n        CC_DEPRECATED_ATTRIBUTE static bool ccIsCCZBuffer(const unsigned char *buffer, ssize_t len) { return isCCZBuffer(buffer, len); }\n        static bool isCCZBuffer(const unsigned char *buffer, ssize_t len);\n\n        /** Sets the pvr.ccz encryption key parts separately for added\n        * security.\n        *\n        * Example: If the key used to encrypt the pvr.ccz file is\n        * 0xaaaaaaaabbbbbbbbccccccccdddddddd you will call this function 4 \n        * different times, preferably from 4 different source files, as follows\n        *\n        * ZipUtils::setPvrEncryptionKeyPart(0, 0xaaaaaaaa);\n        * ZipUtils::setPvrEncryptionKeyPart(1, 0xbbbbbbbb);\n        * ZipUtils::setPvrEncryptionKeyPart(2, 0xcccccccc);\n        * ZipUtils::setPvrEncryptionKeyPart(3, 0xdddddddd);\n        *\n        * Splitting the key into 4 parts and calling the function\n        * from 4 different source files increases the difficulty to\n        * reverse engineer the encryption key. Be aware that encrpytion \n        * is *never* 100% secure and the key code can be cracked by\n        * knowledgable persons.\n        *\n        * IMPORTANT: Be sure to call setPvrEncryptionKey or\n        * setPvrEncryptionKeyPart with all of the key parts *before* loading\n        * the spritesheet or decryption will fail and the spritesheet\n        * will fail to load.\n        *\n        * @param index part of the key [0..3]\n        * @param value value of the key part\n        */\n        CC_DEPRECATED_ATTRIBUTE static void ccSetPvrEncryptionKeyPart(int index, unsigned int value) { setPvrEncryptionKeyPart(index, value); }\n        static void setPvrEncryptionKeyPart(int index, unsigned int value);\n        \n        /** Sets the pvr.ccz encryption key.\n        *\n        * Example: If the key used to encrypt the pvr.ccz file is\n        * 0xaaaaaaaabbbbbbbbccccccccdddddddd you will call this function with\n        * the key split into 4 parts as follows\n        *\n        * ZipUtils::setPvrEncryptionKey(0xaaaaaaaa, 0xbbbbbbbb, 0xcccccccc, 0xdddddddd);\n        *\n        * Note that using this function makes it easier to reverse engineer and\n        * discover the complete key because the key parts are present in one \n        * function call.\n        *\n        * IMPORTANT: Be sure to call setPvrEncryptionKey or\n        * setPvrEncryptionKeyPart with all of the key parts *before* loading\n        * the spritesheet or decryption will fail and the spritesheet\n        * will fail to load.\n        *\n        * @param keyPart1 the key value part 1.\n        * @param keyPart2 the key value part 2.\n        * @param keyPart3 the key value part 3.\n        * @param keyPart4 the key value part 4.\n        */\n        CC_DEPRECATED_ATTRIBUTE static void ccSetPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4) { setPvrEncryptionKey(keyPart1, keyPart2, keyPart3, keyPart4); }\n        static void setPvrEncryptionKey(unsigned int keyPart1, unsigned int keyPart2, unsigned int keyPart3, unsigned int keyPart4);\n\n    private:\n        static int inflateMemoryWithHint(unsigned char *in, ssize_t inLength, unsigned char **out, ssize_t *outLength, ssize_t outLenghtHint);\n        static inline void decodeEncodedPvr (unsigned int *data, ssize_t len);\n        static inline unsigned int checksumPvr(const unsigned int *data, ssize_t len);\n\n        static unsigned int s_uEncryptedPvrKeyParts[4];\n        static unsigned int s_uEncryptionKey[1024];\n        static bool s_bEncryptionKeyIsValid;\n    };\n\n    // forward declaration\n    class ZipFilePrivate;\n\n    /**\n    * Zip file - reader helper class.\n    *\n    * It will cache the file list of a particular zip file with positions inside an archive,\n    * so it would be much faster to read some particular files or to check their existance.\n    *\n    * @since v2.0.5\n    */\n    class ZipFile\n    {\n    public:\n        /**\n        * Constructor, open zip file and store file list.\n        *\n        * @param zipFile Zip file name\n        * @param filter The first part of file names, which should be accessible.\n        *               For example, \"assets/\". Other files will be missed.\n        *\n        * @since v2.0.5\n        */\n        ZipFile(const std::string &zipFile, const std::string &filter = std::string());\n        virtual ~ZipFile();\n\n        /**\n        * Regenerate accessible file list based on a new filter string.\n        *\n        * @param filter New filter string (first part of files names)\n        * @return true whenever zip file is open successfully and it is possible to locate\n        *              at least the first file, false otherwise\n        *\n        * @since v2.0.5\n        */\n        bool setFilter(const std::string &filter);\n\n        /**\n        * Check does a file exists or not in zip file\n        *\n        * @param fileName File to be checked on existance\n        * @return true whenever file exists, false otherwise\n        *\n        * @since v2.0.5\n        */\n        bool fileExists(const std::string &fileName) const;\n\n        /**\n        * Get resource file data from a zip file.\n        * @param fileName File name\n        * @param[out] pSize If the file read operation succeeds, it will be the data size, otherwise 0.\n        * @return Upon success, a pointer to the data is returned, otherwise nullptr.\n        * @warning Recall: you are responsible for calling free() on any Non-nullptr pointer returned.\n        *\n        * @since v2.0.5\n        */\n        unsigned char *getFileData(const std::string &fileName, ssize_t *size);\n\n    private:\n        /** Internal data like zip file pointer / file list array and so on */\n        ZipFilePrivate *_data;\n    };\n} // end of namespace cocos2d\n#endif // __SUPPORT_ZIPUTILS_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/base64.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"base64.h\"\n\nnamespace cocos2d {\n\nunsigned char alphabet[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n    \nint _base64Decode(const unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len )\n{\n    static char inalphabet[256], decoder[256];\n    int i, bits, c = 0, char_count, errors = 0;\n    unsigned int input_idx = 0;\n    unsigned int output_idx = 0;\n\n    for (i = (sizeof alphabet) - 1; i >= 0 ; i--) {\n        inalphabet[alphabet[i]] = 1;\n        decoder[alphabet[i]] = i;\n    }\n\n    char_count = 0;\n    bits = 0;\n    for( input_idx=0; input_idx < input_len ; input_idx++ ) {\n        c = input[ input_idx ];\n        if (c == '=')\n            break;\n        if (c > 255 || ! inalphabet[c])\n            continue;\n        bits += decoder[c];\n        char_count++;\n        if (char_count == 4) {\n            output[ output_idx++ ] = (bits >> 16);\n            output[ output_idx++ ] = ((bits >> 8) & 0xff);\n            output[ output_idx++ ] = ( bits & 0xff);\n            bits = 0;\n            char_count = 0;\n        } else {\n            bits <<= 6;\n        }\n    }\n    \n    if( c == '=' ) {\n        switch (char_count) {\n            case 1:\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA)\n                std::fprintf(stderr, \"base64Decode: encoding incomplete: at least 2 bits missing\");\n#endif\n                errors++;\n                break;\n            case 2:\n                output[ output_idx++ ] = ( bits >> 10 );\n                break;\n            case 3:\n                output[ output_idx++ ] = ( bits >> 16 );\n                output[ output_idx++ ] = (( bits >> 8 ) & 0xff);\n                break;\n            }\n    } else if ( input_idx < input_len ) {\n        if (char_count) {\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA)\n            std::fprintf(stderr, \"base64 encoding incomplete: at least %d bits truncated\",\n                    ((4 - char_count) * 6));\n#endif\n            errors++;\n        }\n    }\n    \n    *output_len = output_idx;\n    return errors;\n}\n    \nvoid _base64Encode( const unsigned char *input, unsigned int input_len, char *output )\n{\n    unsigned int char_count;\n    unsigned int bits;\n    unsigned int input_idx = 0;\n    unsigned int output_idx = 0;\n    \n    char_count = 0;\n    bits = 0;    \n    for( input_idx=0; input_idx < input_len ; input_idx++ ) {\n        bits |= input[ input_idx ];\n        \n        char_count++;\n        if (char_count == 3) {\n            output[ output_idx++ ] = alphabet[(bits >> 18) & 0x3f];\n            output[ output_idx++ ] = alphabet[(bits >> 12) & 0x3f];\n            output[ output_idx++ ] = alphabet[(bits >> 6) & 0x3f];\n            output[ output_idx++ ] = alphabet[bits & 0x3f];\n            bits = 0;\n            char_count = 0;\n        } else {\n            bits <<= 8;\n        }\n    }\n    \n    if (char_count) {\n        if (char_count == 1) {\n            bits <<= 8;\n        }\n\n        output[ output_idx++ ] = alphabet[(bits >> 18) & 0x3f];\n        output[ output_idx++ ] = alphabet[(bits >> 12) & 0x3f];\n        if (char_count > 1) {\n            output[ output_idx++ ] = alphabet[(bits >> 6) & 0x3f];\n        } else {\n            output[ output_idx++ ] = '=';\n        }\n        output[ output_idx++ ] = '=';\n    }\n    \n    output[ output_idx++ ] = 0;\n}\n    \nint base64Decode(const unsigned char *in, unsigned int inLength, unsigned char **out)\n{\n    unsigned int outLength = 0;\n    \n    //should be enough to store 6-bit buffers in 8-bit buffers\n    *out = (unsigned char*)malloc(inLength * 3.0f / 4.0f + 1);\n    if( *out ) {\n        int ret = _base64Decode(in, inLength, *out, &outLength);\n        \n        if (ret > 0 )\n        {\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA)\n            printf(\"Base64Utils: error decoding\");\n#endif\n            free(*out);\n            *out = nullptr;            \n            outLength = 0;\n        }\n    }\n    return outLength;\n}\n\nint base64Encode(const unsigned char *in, unsigned int inLength, char **out) {\n    unsigned int outLength = inLength * 4 / 3 + (inLength % 3 > 0 ? 4 : 0);\n    \n    //should be enough to store 8-bit buffers in 6-bit buffers\n    *out = (char*)malloc(outLength+1);\n    if( *out ) {\n        _base64Encode(in, inLength, *out);\n    }\n    return outLength;\n}\n    \n}//namespace   cocos2d \n"
  },
  {
    "path": "cocos2d/cocos/2d/base64.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __SUPPORT_BASE64_H__\n#define __SUPPORT_BASE64_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif    \n    \nnamespace cocos2d {\n\n/** @file\n base64 helper functions\n */\n\n/** \n * Decodes a 64base encoded memory. The decoded memory is\n * expected to be freed by the caller by calling `free()`\n *\n * @returns the length of the out buffer\n *\n @since v0.8.1\n */\nint base64Decode(const unsigned char *in, unsigned int inLength, unsigned char **out);\n    \n/**\n * Encodes bytes into a 64base encoded memory with terminating '\\0' character. \n * The encoded memory is expected to be freed by the caller by calling `free()`\n *\n * @returns the length of the out buffer\n *\n @since v2.1.4\n */\nint base64Encode(const unsigned char *in, unsigned int inLength, char **out);\n\n}//namespace   cocos2d \n\n#ifdef __cplusplus\n}\n#endif    \n\n#endif // __SUPPORT_BASE64_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccCArray.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2007      Scott Lembcke\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyRight (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"ccCArray.h\"\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\nconst ssize_t CC_INVALID_INDEX = -1;\n\n/** Allocates and initializes a new array with specified capacity */\nccArray* ccArrayNew(ssize_t capacity)\n{\n\tif (capacity == 0)\n\t\tcapacity = 7;\n\t\n\tccArray *arr = (ccArray*)malloc( sizeof(ccArray) );\n\tarr->num = 0;\n\tarr->arr =  (Object**)calloc(capacity, sizeof(Object*));\n\tarr->max = capacity;\n\t\n\treturn arr;\n}\n\n/** Frees array after removing all remaining objects. Silently ignores nullptr arr. */\nvoid ccArrayFree(ccArray*& arr)\n{\n    if( arr == nullptr ) \n    {\n        return;\n    }\n\tccArrayRemoveAllObjects(arr);\n\t\n\tfree(arr->arr);\n\tfree(arr);\n\n    arr = nullptr;\n}\n\nvoid ccArrayDoubleCapacity(ccArray *arr)\n{\n\tarr->max *= 2;\n\tObject** newArr = (Object**)realloc( arr->arr, arr->max * sizeof(Object*) );\n\t// will fail when there's not enough memory\n    CCASSERT(newArr != 0, \"ccArrayDoubleCapacity failed. Not enough memory\");\n\tarr->arr = newArr;\n}\n\nvoid ccArrayEnsureExtraCapacity(ccArray *arr, ssize_t extra)\n{\n\twhile (arr->max < arr->num + extra)\n    {\n        CCLOGINFO(\"cocos2d: ccCArray: resizing ccArray capacity from [%d] to [%d].\",\n              static_cast<int>(arr->max),\n              static_cast<int>(arr->max*2));\n\n\t\tccArrayDoubleCapacity(arr);\n    }\n}\n\nvoid ccArrayShrink(ccArray *arr)\n{\n    ssize_t newSize = 0;\n\t\n\t//only resize when necessary\n\tif (arr->max > arr->num && !(arr->num==0 && arr->max==1))\n\t{\n\t\tif (arr->num!=0)\n\t\t{\n\t\t\tnewSize=arr->num;\n\t\t\tarr->max=arr->num;\n\t\t}\n\t\telse\n\t\t{//minimum capacity of 1, with 0 elements the array would be free'd by realloc\n\t\t\tnewSize=1;\n\t\t\tarr->max=1;\n\t\t}\n\t\t\n\t\tarr->arr = (Object**)realloc(arr->arr,newSize * sizeof(Object*) );\n\t\tCCASSERT(arr->arr!=nullptr,\"could not reallocate the memory\");\n\t}\n}\n\n/** Returns index of first occurrence of object, CC_INVALID_INDEX if object not found. */\nssize_t ccArrayGetIndexOfObject(ccArray *arr, Object* object)\n{\n    const auto arrNum = arr->num;\n    Object** ptr = arr->arr;\n\tfor (ssize_t i = 0; i < arrNum; ++i, ++ptr)\n    {\n\t\tif (*ptr == object)\n            return i;\n    }\n    \n\treturn CC_INVALID_INDEX;\n}\n\n/** Returns a Boolean value that indicates whether object is present in array. */\nbool ccArrayContainsObject(ccArray *arr, Object* object)\n{\n\treturn ccArrayGetIndexOfObject(arr, object) != CC_INVALID_INDEX;\n}\n\n/** Appends an object. Behavior undefined if array doesn't have enough capacity. */\nvoid ccArrayAppendObject(ccArray *arr, Object* object)\n{\n    CCASSERT(object != nullptr, \"Invalid parameter!\");\n    object->retain();\n\tarr->arr[arr->num] = object;\n\tarr->num++;\n}\n\n/** Appends an object. Capacity of arr is increased if needed. */\nvoid ccArrayAppendObjectWithResize(ccArray *arr, Object* object)\n{\n\tccArrayEnsureExtraCapacity(arr, 1);\n\tccArrayAppendObject(arr, object);\n}\n\n/** Appends objects from plusArr to arr. Behavior undefined if arr doesn't have\n enough capacity. */\nvoid ccArrayAppendArray(ccArray *arr, ccArray *plusArr)\n{\n\tfor (ssize_t i = 0; i < plusArr->num; i++)\n    {\n\t\tccArrayAppendObject(arr, plusArr->arr[i]);\n    }\n}\n\n/** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */\nvoid ccArrayAppendArrayWithResize(ccArray *arr, ccArray *plusArr)\n{\n\tccArrayEnsureExtraCapacity(arr, plusArr->num);\n\tccArrayAppendArray(arr, plusArr);\n}\n\n/** Inserts an object at index */\nvoid ccArrayInsertObjectAtIndex(ccArray *arr, Object* object, ssize_t index)\n{\n\tCCASSERT(index<=arr->num, \"Invalid index. Out of bounds\");\n\tCCASSERT(object != nullptr, \"Invalid parameter!\");\n\n\tccArrayEnsureExtraCapacity(arr, 1);\n\t\n\tssize_t remaining = arr->num - index;\n\tif (remaining > 0)\n    {\n\t\tmemmove((void *)&arr->arr[index+1], (void *)&arr->arr[index], sizeof(Object*) * remaining );\n    }\n\n    object->retain();\n\tarr->arr[index] = object;\n\tarr->num++;\n}\n\n/** Swaps two objects */\nvoid ccArraySwapObjectsAtIndexes(ccArray *arr, ssize_t index1, ssize_t index2)\n{\n\tCCASSERT(index1>=0 && index1 < arr->num, \"(1) Invalid index. Out of bounds\");\n\tCCASSERT(index2>=0 && index2 < arr->num, \"(2) Invalid index. Out of bounds\");\n\t\n\tObject* object1 = arr->arr[index1];\n\t\n\tarr->arr[index1] = arr->arr[index2];\n\tarr->arr[index2] = object1;\n}\n\n/** Removes all objects from arr */\nvoid ccArrayRemoveAllObjects(ccArray *arr)\n{\n\twhile (arr->num > 0)\n    {\n\t\t(arr->arr[--arr->num])->release();\n    }\n}\n\n/** Removes object at specified index and pushes back all subsequent objects.\n Behavior undefined if index outside [0, num-1]. */\nvoid ccArrayRemoveObjectAtIndex(ccArray *arr, ssize_t index, bool releaseObj/* = true*/)\n{\n    CCASSERT(arr && arr->num > 0 && index>=0 && index < arr->num, \"Invalid index. Out of bounds\");\n    if (releaseObj)\n    {\n        CC_SAFE_RELEASE(arr->arr[index]);\n    }\n    \n\tarr->num--;\n\t\n\tssize_t remaining = arr->num - index;\n\tif(remaining>0)\n    {\n\t\tmemmove((void *)&arr->arr[index], (void *)&arr->arr[index+1], remaining * sizeof(Object*));\n    }\n}\n\n/** Removes object at specified index and fills the gap with the last object,\n thereby avoiding the need to push back subsequent objects.\n Behavior undefined if index outside [0, num-1]. */\nvoid ccArrayFastRemoveObjectAtIndex(ccArray *arr, ssize_t index)\n{\n\tCC_SAFE_RELEASE(arr->arr[index]);\n\tauto last = --arr->num;\n\tarr->arr[index] = arr->arr[last];\n}\n\nvoid ccArrayFastRemoveObject(ccArray *arr, Object* object)\n{\n\tauto index = ccArrayGetIndexOfObject(arr, object);\n\tif (index != CC_INVALID_INDEX)\n    {\n\t\tccArrayFastRemoveObjectAtIndex(arr, index);\n    }\n}\n\n/** Searches for the first occurrence of object and removes it. If object is not\n found the function has no effect. */\nvoid ccArrayRemoveObject(ccArray *arr, Object* object, bool releaseObj/* = true*/)\n{\n\tauto index = ccArrayGetIndexOfObject(arr, object);\n\tif (index != CC_INVALID_INDEX)\n    {\n\t\tccArrayRemoveObjectAtIndex(arr, index, releaseObj);\n    }\n}\n\n/** Removes from arr all objects in minusArr. For each object in minusArr, the\n first matching instance in arr will be removed. */\nvoid ccArrayRemoveArray(ccArray *arr, ccArray *minusArr)\n{\n\tfor (ssize_t i = 0; i < minusArr->num; i++)\n    {\n\t\tccArrayRemoveObject(arr, minusArr->arr[i]);\n    }\n}\n\n/** Removes from arr all objects in minusArr. For each object in minusArr, all\n matching instances in arr will be removed. */\nvoid ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr)\n{\n\tssize_t back = 0;\n\t\n\tfor (ssize_t i = 0; i < arr->num; i++)\n    {\n\t\tif (ccArrayContainsObject(minusArr, arr->arr[i]))\n        {\n\t\t\tCC_SAFE_RELEASE(arr->arr[i]);\n\t\t\tback++;\n\t\t} \n        else\n        {\n\t\t\tarr->arr[i - back] = arr->arr[i];\n        }\n\t}\n\t\n\tarr->num -= back;\n}\n\n// #pragma mark -\n// #pragma mark ccCArray for Values (c structures)\n\n/** Allocates and initializes a new C array with specified capacity */\nccCArray* ccCArrayNew(ssize_t capacity)\n{\n\tif (capacity == 0)\n    {\n\t\tcapacity = 7;\n    }\n\n\tccCArray *arr = (ccCArray*)malloc(sizeof(ccCArray));\n\tarr->num = 0;\n\tarr->arr = (void**)malloc(capacity * sizeof(void*));\n\tarr->max = capacity;\n\t\n\treturn arr;\n}\n\n/** Frees C array after removing all remaining values. Silently ignores nullptr arr. */\nvoid ccCArrayFree(ccCArray *arr)\n{\n    if (arr == nullptr)\n    {\n        return;\n    }\n\tccCArrayRemoveAllValues(arr);\n\t\n\tfree(arr->arr);\n\tfree(arr);\n}\n\n/** Doubles C array capacity */\nvoid ccCArrayDoubleCapacity(ccCArray *arr)\n{\n    ccArrayDoubleCapacity((ccArray*)arr);\n}\n\n/** Increases array capacity such that max >= num + extra. */\nvoid ccCArrayEnsureExtraCapacity(ccCArray *arr, ssize_t extra)\n{\n    ccArrayEnsureExtraCapacity((ccArray*)arr,extra);\n}\n\n/** Returns index of first occurrence of value, CC_INVALID_INDEX if value not found. */\nssize_t ccCArrayGetIndexOfValue(ccCArray *arr, void* value)\n{\n\tfor(ssize_t i = 0; i < arr->num; i++)\n    {\n\t\tif( arr->arr[i] == value )\n            return i;\n    }\n\treturn CC_INVALID_INDEX;\n}\n\n/** Returns a Boolean value that indicates whether value is present in the C array. */\nbool ccCArrayContainsValue(ccCArray *arr, void* value)\n{\n\treturn ccCArrayGetIndexOfValue(arr, value) != CC_INVALID_INDEX;\n}\n\n/** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */\nvoid ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, ssize_t index)\n{\n\tCCASSERT( index < arr->max, \"ccCArrayInsertValueAtIndex: invalid index\");\n\t\n\tauto remaining = arr->num - index;\n    // make sure it has enough capacity\n    if (arr->num + 1 == arr->max)\n    {\n        ccCArrayDoubleCapacity(arr);\n    }\n\t// last Value doesn't need to be moved\n\tif( remaining > 0) {\n\t\t// tex coordinates\n\t\tmemmove((void *)&arr->arr[index+1], (void *)&arr->arr[index], sizeof(void*) * remaining );\n\t}\n\t\n\tarr->num++;\n\tarr->arr[index] = value;\n}\n\n/** Appends an value. Behavior undefined if array doesn't have enough capacity. */\nvoid ccCArrayAppendValue(ccCArray *arr, void* value)\n{\n\tarr->arr[arr->num] = value;\n\tarr->num++;\n    // double the capacity for the next append action\n    // if the num >= max\n    if (arr->num >= arr->max)\n    {\n        ccCArrayDoubleCapacity(arr);\n    }\n}\n\n/** Appends an value. Capacity of arr is increased if needed. */\nvoid ccCArrayAppendValueWithResize(ccCArray *arr, void* value)\n{\n\tccCArrayEnsureExtraCapacity(arr, 1);\n\tccCArrayAppendValue(arr, value);\n}\n\n\n/** Appends values from plusArr to arr. Behavior undefined if arr doesn't have\n enough capacity. */\nvoid ccCArrayAppendArray(ccCArray *arr, ccCArray *plusArr)\n{\n\tfor( ssize_t i = 0; i < plusArr->num; i++)\n    {\n\t\tccCArrayAppendValue(arr, plusArr->arr[i]);\n    }\n}\n\n/** Appends values from plusArr to arr. Capacity of arr is increased if needed. */\nvoid ccCArrayAppendArrayWithResize(ccCArray *arr, ccCArray *plusArr)\n{\n\tccCArrayEnsureExtraCapacity(arr, plusArr->num);\n\tccCArrayAppendArray(arr, plusArr);\n}\n\n/** Removes all values from arr */\nvoid ccCArrayRemoveAllValues(ccCArray *arr)\n{\n\tarr->num = 0;\n}\n\n/** Removes value at specified index and pushes back all subsequent values.\n Behavior undefined if index outside [0, num-1].\n @since v0.99.4\n */\nvoid ccCArrayRemoveValueAtIndex(ccCArray *arr, ssize_t index)\n{\n\tfor( ssize_t last = --arr->num; index < last; index++)\n    {\n\t\tarr->arr[index] = arr->arr[index + 1];\n    }\n}\n\n/** Removes value at specified index and fills the gap with the last value,\n thereby avoiding the need to push back subsequent values.\n Behavior undefined if index outside [0, num-1].\n @since v0.99.4\n */\nvoid ccCArrayFastRemoveValueAtIndex(ccCArray *arr, ssize_t index)\n{\n\tssize_t last = --arr->num;\n\tarr->arr[index] = arr->arr[last];\n}\n\n/** Searches for the first occurrence of value and removes it. If value is not found the function has no effect.\n @since v0.99.4\n */\nvoid ccCArrayRemoveValue(ccCArray *arr, void* value)\n{\n\tauto index = ccCArrayGetIndexOfValue(arr, value);\n\tif (index != CC_INVALID_INDEX)\n    {\n\t\tccCArrayRemoveValueAtIndex(arr, index);\n    }\n}\n\n/** Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed.\n @since v0.99.4\n */\nvoid ccCArrayRemoveArray(ccCArray *arr, ccCArray *minusArr)\n{\n\tfor(ssize_t i = 0; i < minusArr->num; i++)\n    {\n\t\tccCArrayRemoveValue(arr, minusArr->arr[i]);\n    }\n}\n\n/** Removes from arr all values in minusArr. For each value in minusArr, all matching instances in arr will be removed.\n @since v0.99.4\n */\nvoid ccCArrayFullRemoveArray(ccCArray *arr, ccCArray *minusArr)\n{\n\tssize_t back = 0;\n\t\n\tfor(ssize_t i = 0; i < arr->num; i++)\n    {\n\t\tif( ccCArrayContainsValue(minusArr, arr->arr[i]) ) \n        {\n\t\t\tback++;\n\t\t} \n        else\n        {\n\t\t\tarr->arr[i - back] = arr->arr[i];\n        }\n\t}\n\t\n\tarr->num -= back;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccCArray.h",
    "content": "/****************************************************************************\nCopyright (c) 2007      Scott Lembcke\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n/**\n @file\n based on Chipmunk cpArray.\n ccArray is a faster alternative to NSMutableArray, it does pretty much the\n same thing (stores NSObjects and retains/releases them appropriately). It's\n faster because:\n - it uses a plain C interface so it doesn't incur Objective-c messaging overhead\n - it assumes you know what you're doing, so it doesn't spend time on safety checks\n (index out of bounds, required capacity etc.)\n - comparisons are done using pointer equality instead of isEqual\n\n There are 2 kind of functions:\n - ccArray functions that manipulates objective-c objects (retain and release are performed)\n - ccCArray functions that manipulates values like if they were standard C structures (no retain/release is performed)\n */\n\n#ifndef CC_ARRAY_H\n#define CC_ARRAY_H\n\n#include \"ccMacros.h\"\n#include \"CCObject.h\"\n\n#include <stdlib.h>\n#include <string.h>\n#include <limits.h>\n\nNS_CC_BEGIN\n\nextern const ssize_t CC_INVALID_INDEX;\n\n// Easy integration\n#define CCARRAYDATA_FOREACH(__array__, __object__)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n__object__=__array__->arr[0]; for(ssize_t i=0, num=__array__->num; i<num; i++, __object__=__array__->arr[i])\t\\\n\n\ntypedef struct _ccArray {\n\tssize_t num, max;\n\tObject** arr;\n} ccArray;\n\n/** Allocates and initializes a new array with specified capacity */\nccArray* ccArrayNew(ssize_t capacity);\n\n/** Frees array after removing all remaining objects. Silently ignores nil arr. */\nvoid ccArrayFree(ccArray*& arr);\n\n/** Doubles array capacity */\nvoid ccArrayDoubleCapacity(ccArray *arr);\n\n/** Increases array capacity such that max >= num + extra. */\nvoid ccArrayEnsureExtraCapacity(ccArray *arr, ssize_t extra);\n\n/** shrinks the array so the memory footprint corresponds with the number of items */\nvoid ccArrayShrink(ccArray *arr);\n\n/** Returns index of first occurrence of object, NSNotFound if object not found. */\nssize_t ccArrayGetIndexOfObject(ccArray *arr, Object* object);\n\n/** Returns a Boolean value that indicates whether object is present in array. */\nbool ccArrayContainsObject(ccArray *arr, Object* object);\n\n/** Appends an object. Behavior undefined if array doesn't have enough capacity. */\nvoid ccArrayAppendObject(ccArray *arr, Object* object);\n\n/** Appends an object. Capacity of arr is increased if needed. */\nvoid ccArrayAppendObjectWithResize(ccArray *arr, Object* object);\n\n/** Appends objects from plusArr to arr. \n Behavior undefined if arr doesn't have enough capacity. */\nvoid ccArrayAppendArray(ccArray *arr, ccArray *plusArr);\n\n/** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */\nvoid ccArrayAppendArrayWithResize(ccArray *arr, ccArray *plusArr);\n\n/** Inserts an object at index */\nvoid ccArrayInsertObjectAtIndex(ccArray *arr, Object* object, ssize_t index);\n\n/** Swaps two objects */\nvoid ccArraySwapObjectsAtIndexes(ccArray *arr, ssize_t index1, ssize_t index2);\n\n/** Removes all objects from arr */\nvoid ccArrayRemoveAllObjects(ccArray *arr);\n\n/** Removes object at specified index and pushes back all subsequent objects.\n Behavior undefined if index outside [0, num-1]. */\nvoid ccArrayRemoveObjectAtIndex(ccArray *arr, ssize_t index, bool releaseObj = true);\n\n/** Removes object at specified index and fills the gap with the last object,\n thereby avoiding the need to push back subsequent objects.\n Behavior undefined if index outside [0, num-1]. */\nvoid ccArrayFastRemoveObjectAtIndex(ccArray *arr, ssize_t index);\n\nvoid ccArrayFastRemoveObject(ccArray *arr, Object* object);\n\n/** Searches for the first occurrence of object and removes it. If object is not\n found the function has no effect. */\nvoid ccArrayRemoveObject(ccArray *arr, Object* object, bool releaseObj = true);\n\n/** Removes from arr all objects in minusArr. For each object in minusArr, the\n first matching instance in arr will be removed. */\nvoid ccArrayRemoveArray(ccArray *arr, ccArray *minusArr);\n\n/** Removes from arr all objects in minusArr. For each object in minusArr, all\n matching instances in arr will be removed. */\nvoid ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr);\n\n// #pragma mark -\n// #pragma mark ccCArray for Values (c structures)\n\ntypedef struct _ccCArray {\n    ssize_t num, max;\n    void** arr;\n} ccCArray;\n\n/** Allocates and initializes a new C array with specified capacity */\nccCArray* ccCArrayNew(ssize_t capacity);\n\n/** Frees C array after removing all remaining values. Silently ignores nil arr. */\nvoid ccCArrayFree(ccCArray *arr);\n\n/** Doubles C array capacity */\nvoid ccCArrayDoubleCapacity(ccCArray *arr);\n\n/** Increases array capacity such that max >= num + extra. */\nvoid ccCArrayEnsureExtraCapacity(ccCArray *arr, ssize_t extra);\n\n/** Returns index of first occurrence of value, NSNotFound if value not found. */\nssize_t ccCArrayGetIndexOfValue(ccCArray *arr, void* value);\n\n/** Returns a Boolean value that indicates whether value is present in the C array. */\nbool ccCArrayContainsValue(ccCArray *arr, void* value);\n\n/** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */\nvoid ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, ssize_t index);\n\n/** Appends an value. Behavior undefined if array doesn't have enough capacity. */\nvoid ccCArrayAppendValue(ccCArray *arr, void* value);\n\n/** Appends an value. Capacity of arr is increased if needed. */\nvoid ccCArrayAppendValueWithResize(ccCArray *arr, void* value);\n\n/** Appends values from plusArr to arr. Behavior undefined if arr doesn't have\n enough capacity. */\nvoid ccCArrayAppendArray(ccCArray *arr, ccCArray *plusArr);\n\n/** Appends values from plusArr to arr. Capacity of arr is increased if needed. */\nvoid ccCArrayAppendArrayWithResize(ccCArray *arr, ccCArray *plusArr);\n\n/** Removes all values from arr */\nvoid ccCArrayRemoveAllValues(ccCArray *arr);\n\n/** Removes value at specified index and pushes back all subsequent values.\n Behavior undefined if index outside [0, num-1].\n @since v0.99.4\n */\nvoid ccCArrayRemoveValueAtIndex(ccCArray *arr, ssize_t index);\n\n/** Removes value at specified index and fills the gap with the last value,\n thereby avoiding the need to push back subsequent values.\n Behavior undefined if index outside [0, num-1].\n @since v0.99.4\n */\nvoid ccCArrayFastRemoveValueAtIndex(ccCArray *arr, ssize_t index);\n\n/** Searches for the first occurrence of value and removes it. If value is not found the function has no effect.\n @since v0.99.4\n */\nvoid ccCArrayRemoveValue(ccCArray *arr, void* value);\n\n/** Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed.\n @since v0.99.4\n */\nvoid ccCArrayRemoveArray(ccCArray *arr, ccCArray *minusArr);\n\n/** Removes from arr all values in minusArr. For each value in minusArr, all matching instances in arr will be removed.\n @since v0.99.4\n */\nvoid ccCArrayFullRemoveArray(ccCArray *arr, ccCArray *minusArr);\n\nNS_CC_END\n\t\n#endif // CC_ARRAY_H\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccConfig.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCCONFIG_H__\n#define __CCCONFIG_H__\n\n#include \"CCPlatformConfig.h\"\n\n/**\n @file\n cocos2d (cc) configuration file\n*/\n\n/** @def CC_ENABLE_STACKABLE_ACTIONS\n If enabled, actions that alter the position property (eg: MoveBy, JumpBy, BezierBy, etc..) will be stacked.\n If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions.\n If disabled, only the last run action will take effect.\n \n Enabled by default. Disable to be compatible with v2.0 and older versions.\n \n @since v2.1\n */\n#ifndef CC_ENABLE_STACKABLE_ACTIONS\n#define CC_ENABLE_STACKABLE_ACTIONS 1\n#endif\n\n/** @def CC_ENABLE_GL_STATE_CACHE\n If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches.\n In order to use them, you have to use the following functions, instead of the the GL ones:\n    - ccGLUseProgram() instead of glUseProgram()\n    - GL::deleteProgram() instead of glDeleteProgram()\n    - GL::blendFunc() instead of glBlendFunc()\n\n If this functionality is disabled, then ccGLUseProgram(), GL::deleteProgram(), GL::blendFunc() will call the GL ones, without using the cache.\n\n It is recommended to enable whenever possible to improve speed.\n If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on.\n \n Default value: Enabled by default\n \n @since v2.0.0\n */\n#ifndef CC_ENABLE_GL_STATE_CACHE\n#define CC_ENABLE_GL_STATE_CACHE 1\n#endif\n\n/** @def CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\nIf enabled, the texture coordinates will be calculated by using this formula:\n- texCoord.left = (rect.origin.x*2+1) / (texture.wide*2);\n- texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2);\n\nThe same for bottom and top.\n\nThis formula prevents artifacts by using 99% of the texture.\nThe \"correct\" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.\n\nAffected nodes:\n- Sprite / SpriteBatchNode and subclasses: LabelBMFont, TMXTiledMap\n- LabelAtlas\n- QuadParticleSystem\n- TileMap\n\nTo enabled set it to 1. Disabled by default.\n\n@since v0.99.5\n*/\n#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL\n#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0\n#endif\n\n/** @def CC_DIRECTOR_FPS_INTERVAL\n Seconds between FPS updates.\n 0.5 seconds, means that the FPS number will be updated every 0.5 seconds.\n Having a bigger number means a more reliable FPS\n \n Default value: 0.1f\n */\n#ifndef CC_DIRECTOR_STATS_INTERVAL\n#define CC_DIRECTOR_STATS_INTERVAL (0.1f)\n#endif\n\n/** @def CC_DIRECTOR_FPS_POSITION\n Position of the FPS\n\n Default: 0,0 (bottom-left corner)\n */\n#ifndef CC_DIRECTOR_FPS_POSITION\n#define CC_DIRECTOR_FPS_POSITION Point(0,0)\n#endif\n\n/** @def CC_DIRECTOR_DISPATCH_FAST_EVENTS\n If enabled, and only when it is used with FastDirector, the main loop will wait 0.04 seconds to\n dispatch all the events, even if there are not events to dispatch.\n If your game uses lot's of events (eg: touches) it might be a good idea to enable this feature.\n Otherwise, it is safe to leave it disabled.\n \n To enable set it to 1. Disabled by default.\n \n @warning This feature is experimental\n */\n#ifndef CC_DIRECTOR_DISPATCH_FAST_EVENTS\n #define CC_DIRECTOR_DISPATCH_FAST_EVENTS 0\n#endif\n\n/** @def CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD\nIf enabled, cocos2d-mac will run on the Display Link thread. If disabled cocos2d-mac will run in its own thread.\n\nIf enabled, the images will be drawn at the \"correct\" time, but the events might not be very responsive.\nIf disabled, some frames might be skipped, but the events will be dispatched as they arrived.\n\nTo enable set it to a 1, to disable it set to 0. Enabled by default.\n\nOnly valid for cocos2d-mac. Not supported on cocos2d-ios.\n\n*/\n#ifndef CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD\n#define CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD 1\n#endif\n\n/** @def CC_NODE_RENDER_SUBPIXEL\n If enabled, the Node objects (Sprite, Label,etc) will be able to render in subpixels.\n If disabled, integer pixels will be used.\n \n To enable set it to 1. Enabled by default.\n */\n#ifndef CC_NODE_RENDER_SUBPIXEL\n#define CC_NODE_RENDER_SUBPIXEL 1\n#endif\n\n/** @def CC_SPRITEBATCHNODE_RENDER_SUBPIXEL\n If enabled, the Sprite objects rendered with SpriteBatchNode will be able to render in subpixels.\n If disabled, integer pixels will be used.\n \n To enable set it to 1. Enabled by default.\n */\n#ifndef CC_SPRITEBATCHNODE_RENDER_SUBPIXEL\n#define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL    1\n#endif\n\n/** @def CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP\n Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas.\n It seems it is the recommend way, but it is much slower, so, enable it at your own risk\n \n To enable set it to a value different than 0. Disabled by default.\n\n */\n#ifndef CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP\n#define CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP 0\n#endif\n\n/** @def CC_TEXTURE_ATLAS_USE_VAO\n By default, TextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects).\n Apple recommends its usage but they might consume a lot of memory, specially if you use many of them.\n So for certain cases, where you might need hundreds of VAO objects, it might be a good idea to disable it.\n \n To disable it set it to 0. Enabled by default.\n \n */\n#ifndef CC_TEXTURE_ATLAS_USE_VAO\n    #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n        #define CC_TEXTURE_ATLAS_USE_VAO 1\n    #else\n        /* Some Windows display adapter driver cannot support VAO. */\n        /* Some android devices cannot support VAO very well, so we disable it by default for android platform. */\n        /* Blackberry also doesn't support this feature. */\n\t\t#define CC_TEXTURE_ATLAS_USE_VAO 0\n    #endif\n#endif\n\n\n/** @def CC_USE_LA88_LABELS\n If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for LabelTTF objects.\n If it is disabled, it will use A8 (Alpha 8-bit textures).\n LA88 textures are 6% faster than A8 textures, but they will consume 2x memory.\n\n This feature is enabled by default.\n\n @since v0.99.5\n */\n#ifndef CC_USE_LA88_LABELS\n#define CC_USE_LA88_LABELS 1\n#endif\n\n/** @def CC_SPRITE_DEBUG_DRAW\n If enabled, all subclasses of Sprite will draw a bounding box\n Useful for debugging purposes only. It is recommended to leave it disabled.\n \n To enable set it to a value different than 0. Disabled by default:\n 0 -- disabled\n 1 -- draw bounding box\n 2 -- draw texture box\n 0 -- disabled\n 1 -- draw bounding box\n 2 -- draw texture box\n*/\n#ifndef CC_SPRITE_DEBUG_DRAW\n#define CC_SPRITE_DEBUG_DRAW 0\n#endif\n\n/** @def CC_SPRITEBATCHNODE_DEBUG_DRAW\nIf enabled, all subclasses of Sprite that are rendered using an SpriteBatchNode draw a bounding box.\nUseful for debugging purposes only. It is recommended to leave it disabled.\n\nTo enable set it to a value different than 0. Disabled by default.\n*/\n#ifndef CC_SPRITEBATCHNODE_DEBUG_DRAW\n#define CC_SPRITEBATCHNODE_DEBUG_DRAW 0\n#endif\n\n/** @def CC_LABELBMFONT_DEBUG_DRAW\nIf enabled, all subclasses of LabelBMFont will draw a bounding box\nUseful for debugging purposes only. It is recommended to leave it disabled.\n\nTo enable set it to a value different than 0. Disabled by default.\n*/\n#ifndef CC_LABELBMFONT_DEBUG_DRAW\n#define CC_LABELBMFONT_DEBUG_DRAW 0\n#endif\n\n/** @def CC_LABELATLAS_DEBUG_DRAW\n If enabled, all subclasses of LabeltAtlas will draw a bounding box\n Useful for debugging purposes only. It is recommended to leave it disabled.\n \n To enable set it to a value different than 0. Disabled by default.\n */\n#ifndef CC_LABELATLAS_DEBUG_DRAW\n#define CC_LABELATLAS_DEBUG_DRAW 0\n#endif\n\n/** @def CC_ENABLE_PROFILERS\n If enabled, will activate various profilers within cocos2d. This statistical data will be output to the console\n once per second showing average time (in milliseconds) required to execute the specific routine(s).\n Useful for debugging purposes only. It is recommended to leave it disabled.\n \n To enable set it to a value different than 0. Disabled by default.\n */\n#ifndef CC_ENABLE_PROFILERS\n#define CC_ENABLE_PROFILERS 0\n#endif\n\n/** Enable Lua engine debug log */\n#ifndef CC_LUA_ENGINE_DEBUG\n#define CC_LUA_ENGINE_DEBUG 0\n#endif\n\n/** Use physics integration API */\n#ifndef CC_USE_PHYSICS\n#define CC_USE_PHYSICS 1\n#endif\n\n#endif // __CCCONFIG_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccFPSImages.c",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n#include \"ccFPSImages.h\"\n\nunsigned char cc_fps_images_png[] = {\n  0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,\n  0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x20,\n  0x08, 0x06, 0x00, 0x00, 0x00, 0xfd, 0xa9, 0xa6, 0xe4, 0x00, 0x00, 0x0a,\n  0x43, 0x69, 0x43, 0x43, 0x50, 0x49, 0x43, 0x43, 0x20, 0x70, 0x72, 0x6f,\n  0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x78, 0xda, 0x9d, 0x53, 0x77, 0x58,\n  0x93, 0xf7, 0x16, 0x3e, 0xdf, 0xf7, 0x65, 0x0f, 0x56, 0x42, 0xd8, 0xf0,\n  0xb1, 0x97, 0x6c, 0x81, 0x00, 0x22, 0x23, 0xac, 0x08, 0xc8, 0x10, 0x59,\n  0xa2, 0x10, 0x92, 0x00, 0x61, 0x84, 0x10, 0x12, 0x40, 0xc5, 0x85, 0x88,\n  0x0a, 0x56, 0x14, 0x15, 0x11, 0x9c, 0x48, 0x55, 0xc4, 0x82, 0xd5, 0x0a,\n  0x48, 0x9d, 0x88, 0xe2, 0xa0, 0x28, 0xb8, 0x67, 0x41, 0x8a, 0x88, 0x5a,\n  0x8b, 0x55, 0x5c, 0x38, 0xee, 0x1f, 0xdc, 0xa7, 0xb5, 0x7d, 0x7a, 0xef,\n  0xed, 0xed, 0xfb, 0xd7, 0xfb, 0xbc, 0xe7, 0x9c, 0xe7, 0xfc, 0xce, 0x79,\n  0xcf, 0x0f, 0x80, 0x11, 0x12, 0x26, 0x91, 0xe6, 0xa2, 0x6a, 0x00, 0x39,\n  0x52, 0x85, 0x3c, 0x3a, 0xd8, 0x1f, 0x8f, 0x4f, 0x48, 0xc4, 0xc9, 0xbd,\n  0x80, 0x02, 0x15, 0x48, 0xe0, 0x04, 0x20, 0x10, 0xe6, 0xcb, 0xc2, 0x67,\n  0x05, 0xc5, 0x00, 0x00, 0xf0, 0x03, 0x79, 0x78, 0x7e, 0x74, 0xb0, 0x3f,\n  0xfc, 0x01, 0xaf, 0x6f, 0x00, 0x02, 0x00, 0x70, 0xd5, 0x2e, 0x24, 0x12,\n  0xc7, 0xe1, 0xff, 0x83, 0xba, 0x50, 0x26, 0x57, 0x00, 0x20, 0x91, 0x00,\n  0xe0, 0x22, 0x12, 0xe7, 0x0b, 0x01, 0x90, 0x52, 0x00, 0xc8, 0x2e, 0x54,\n  0xc8, 0x14, 0x00, 0xc8, 0x18, 0x00, 0xb0, 0x53, 0xb3, 0x64, 0x0a, 0x00,\n  0x94, 0x00, 0x00, 0x6c, 0x79, 0x7c, 0x42, 0x22, 0x00, 0xaa, 0x0d, 0x00,\n  0xec, 0xf4, 0x49, 0x3e, 0x05, 0x00, 0xd8, 0xa9, 0x93, 0xdc, 0x17, 0x00,\n  0xd8, 0xa2, 0x1c, 0xa9, 0x08, 0x00, 0x8d, 0x01, 0x00, 0x99, 0x28, 0x47,\n  0x24, 0x02, 0x40, 0xbb, 0x00, 0x60, 0x55, 0x81, 0x52, 0x2c, 0x02, 0xc0,\n  0xc2, 0x00, 0xa0, 0xac, 0x40, 0x22, 0x2e, 0x04, 0xc0, 0xae, 0x01, 0x80,\n  0x59, 0xb6, 0x32, 0x47, 0x02, 0x80, 0xbd, 0x05, 0x00, 0x76, 0x8e, 0x58,\n  0x90, 0x0f, 0x40, 0x60, 0x00, 0x80, 0x99, 0x42, 0x2c, 0xcc, 0x00, 0x20,\n  0x38, 0x02, 0x00, 0x43, 0x1e, 0x13, 0xcd, 0x03, 0x20, 0x4c, 0x03, 0xa0,\n  0x30, 0xd2, 0xbf, 0xe0, 0xa9, 0x5f, 0x70, 0x85, 0xb8, 0x48, 0x01, 0x00,\n  0xc0, 0xcb, 0x95, 0xcd, 0x97, 0x4b, 0xd2, 0x33, 0x14, 0xb8, 0x95, 0xd0,\n  0x1a, 0x77, 0xf2, 0xf0, 0xe0, 0xe2, 0x21, 0xe2, 0xc2, 0x6c, 0xb1, 0x42,\n  0x61, 0x17, 0x29, 0x10, 0x66, 0x09, 0xe4, 0x22, 0x9c, 0x97, 0x9b, 0x23,\n  0x13, 0x48, 0xe7, 0x03, 0x4c, 0xce, 0x0c, 0x00, 0x00, 0x1a, 0xf9, 0xd1,\n  0xc1, 0xfe, 0x38, 0x3f, 0x90, 0xe7, 0xe6, 0xe4, 0xe1, 0xe6, 0x66, 0xe7,\n  0x6c, 0xef, 0xf4, 0xc5, 0xa2, 0xfe, 0x6b, 0xf0, 0x6f, 0x22, 0x3e, 0x21,\n  0xf1, 0xdf, 0xfe, 0xbc, 0x8c, 0x02, 0x04, 0x00, 0x10, 0x4e, 0xcf, 0xef,\n  0xda, 0x5f, 0xe5, 0xe5, 0xd6, 0x03, 0x70, 0xc7, 0x01, 0xb0, 0x75, 0xbf,\n  0x6b, 0xa9, 0x5b, 0x00, 0xda, 0x56, 0x00, 0x68, 0xdf, 0xf9, 0x5d, 0x33,\n  0xdb, 0x09, 0xa0, 0x5a, 0x0a, 0xd0, 0x7a, 0xf9, 0x8b, 0x79, 0x38, 0xfc,\n  0x40, 0x1e, 0x9e, 0xa1, 0x50, 0xc8, 0x3c, 0x1d, 0x1c, 0x0a, 0x0b, 0x0b,\n  0xed, 0x25, 0x62, 0xa1, 0xbd, 0x30, 0xe3, 0x8b, 0x3e, 0xff, 0x33, 0xe1,\n  0x6f, 0xe0, 0x8b, 0x7e, 0xf6, 0xfc, 0x40, 0x1e, 0xfe, 0xdb, 0x7a, 0xf0,\n  0x00, 0x71, 0x9a, 0x40, 0x99, 0xad, 0xc0, 0xa3, 0x83, 0xfd, 0x71, 0x61,\n  0x6e, 0x76, 0xae, 0x52, 0x8e, 0xe7, 0xcb, 0x04, 0x42, 0x31, 0x6e, 0xf7,\n  0xe7, 0x23, 0xfe, 0xc7, 0x85, 0x7f, 0xfd, 0x8e, 0x29, 0xd1, 0xe2, 0x34,\n  0xb1, 0x5c, 0x2c, 0x15, 0x8a, 0xf1, 0x58, 0x89, 0xb8, 0x50, 0x22, 0x4d,\n  0xc7, 0x79, 0xb9, 0x52, 0x91, 0x44, 0x21, 0xc9, 0x95, 0xe2, 0x12, 0xe9,\n  0x7f, 0x32, 0xf1, 0x1f, 0x96, 0xfd, 0x09, 0x93, 0x77, 0x0d, 0x00, 0xac,\n  0x86, 0x4f, 0xc0, 0x4e, 0xb6, 0x07, 0xb5, 0xcb, 0x6c, 0xc0, 0x7e, 0xee,\n  0x01, 0x02, 0x8b, 0x0e, 0x58, 0xd2, 0x76, 0x00, 0x40, 0x7e, 0xf3, 0x2d,\n  0x8c, 0x1a, 0x0b, 0x91, 0x00, 0x10, 0x67, 0x34, 0x32, 0x79, 0xf7, 0x00,\n  0x00, 0x93, 0xbf, 0xf9, 0x8f, 0x40, 0x2b, 0x01, 0x00, 0xcd, 0x97, 0xa4,\n  0xe3, 0x00, 0x00, 0xbc, 0xe8, 0x18, 0x5c, 0xa8, 0x94, 0x17, 0x4c, 0xc6,\n  0x08, 0x00, 0x00, 0x44, 0xa0, 0x81, 0x2a, 0xb0, 0x41, 0x07, 0x0c, 0xc1,\n  0x14, 0xac, 0xc0, 0x0e, 0x9c, 0xc1, 0x1d, 0xbc, 0xc0, 0x17, 0x02, 0x61,\n  0x06, 0x44, 0x40, 0x0c, 0x24, 0xc0, 0x3c, 0x10, 0x42, 0x06, 0xe4, 0x80,\n  0x1c, 0x0a, 0xa1, 0x18, 0x96, 0x41, 0x19, 0x54, 0xc0, 0x3a, 0xd8, 0x04,\n  0xb5, 0xb0, 0x03, 0x1a, 0xa0, 0x11, 0x9a, 0xe1, 0x10, 0xb4, 0xc1, 0x31,\n  0x38, 0x0d, 0xe7, 0xe0, 0x12, 0x5c, 0x81, 0xeb, 0x70, 0x17, 0x06, 0x60,\n  0x18, 0x9e, 0xc2, 0x18, 0xbc, 0x86, 0x09, 0x04, 0x41, 0xc8, 0x08, 0x13,\n  0x61, 0x21, 0x3a, 0x88, 0x11, 0x62, 0x8e, 0xd8, 0x22, 0xce, 0x08, 0x17,\n  0x99, 0x8e, 0x04, 0x22, 0x61, 0x48, 0x34, 0x92, 0x80, 0xa4, 0x20, 0xe9,\n  0x88, 0x14, 0x51, 0x22, 0xc5, 0xc8, 0x72, 0xa4, 0x02, 0xa9, 0x42, 0x6a,\n  0x91, 0x5d, 0x48, 0x23, 0xf2, 0x2d, 0x72, 0x14, 0x39, 0x8d, 0x5c, 0x40,\n  0xfa, 0x90, 0xdb, 0xc8, 0x20, 0x32, 0x8a, 0xfc, 0x8a, 0xbc, 0x47, 0x31,\n  0x94, 0x81, 0xb2, 0x51, 0x03, 0xd4, 0x02, 0x75, 0x40, 0xb9, 0xa8, 0x1f,\n  0x1a, 0x8a, 0xc6, 0xa0, 0x73, 0xd1, 0x74, 0x34, 0x0f, 0x5d, 0x80, 0x96,\n  0xa2, 0x6b, 0xd1, 0x1a, 0xb4, 0x1e, 0x3d, 0x80, 0xb6, 0xa2, 0xa7, 0xd1,\n  0x4b, 0xe8, 0x75, 0x74, 0x00, 0x7d, 0x8a, 0x8e, 0x63, 0x80, 0xd1, 0x31,\n  0x0e, 0x66, 0x8c, 0xd9, 0x61, 0x5c, 0x8c, 0x87, 0x45, 0x60, 0x89, 0x58,\n  0x1a, 0x26, 0xc7, 0x16, 0x63, 0xe5, 0x58, 0x35, 0x56, 0x8f, 0x35, 0x63,\n  0x1d, 0x58, 0x37, 0x76, 0x15, 0x1b, 0xc0, 0x9e, 0x61, 0xef, 0x08, 0x24,\n  0x02, 0x8b, 0x80, 0x13, 0xec, 0x08, 0x5e, 0x84, 0x10, 0xc2, 0x6c, 0x82,\n  0x90, 0x90, 0x47, 0x58, 0x4c, 0x58, 0x43, 0xa8, 0x25, 0xec, 0x23, 0xb4,\n  0x12, 0xba, 0x08, 0x57, 0x09, 0x83, 0x84, 0x31, 0xc2, 0x27, 0x22, 0x93,\n  0xa8, 0x4f, 0xb4, 0x25, 0x7a, 0x12, 0xf9, 0xc4, 0x78, 0x62, 0x3a, 0xb1,\n  0x90, 0x58, 0x46, 0xac, 0x26, 0xee, 0x21, 0x1e, 0x21, 0x9e, 0x25, 0x5e,\n  0x27, 0x0e, 0x13, 0x5f, 0x93, 0x48, 0x24, 0x0e, 0xc9, 0x92, 0xe4, 0x4e,\n  0x0a, 0x21, 0x25, 0x90, 0x32, 0x49, 0x0b, 0x49, 0x6b, 0x48, 0xdb, 0x48,\n  0x2d, 0xa4, 0x53, 0xa4, 0x3e, 0xd2, 0x10, 0x69, 0x9c, 0x4c, 0x26, 0xeb,\n  0x90, 0x6d, 0xc9, 0xde, 0xe4, 0x08, 0xb2, 0x80, 0xac, 0x20, 0x97, 0x91,\n  0xb7, 0x90, 0x0f, 0x90, 0x4f, 0x92, 0xfb, 0xc9, 0xc3, 0xe4, 0xb7, 0x14,\n  0x3a, 0xc5, 0x88, 0xe2, 0x4c, 0x09, 0xa2, 0x24, 0x52, 0xa4, 0x94, 0x12,\n  0x4a, 0x35, 0x65, 0x3f, 0xe5, 0x04, 0xa5, 0x9f, 0x32, 0x42, 0x99, 0xa0,\n  0xaa, 0x51, 0xcd, 0xa9, 0x9e, 0xd4, 0x08, 0xaa, 0x88, 0x3a, 0x9f, 0x5a,\n  0x49, 0x6d, 0xa0, 0x76, 0x50, 0x2f, 0x53, 0x87, 0xa9, 0x13, 0x34, 0x75,\n  0x9a, 0x25, 0xcd, 0x9b, 0x16, 0x43, 0xcb, 0xa4, 0x2d, 0xa3, 0xd5, 0xd0,\n  0x9a, 0x69, 0x67, 0x69, 0xf7, 0x68, 0x2f, 0xe9, 0x74, 0xba, 0x09, 0xdd,\n  0x83, 0x1e, 0x45, 0x97, 0xd0, 0x97, 0xd2, 0x6b, 0xe8, 0x07, 0xe9, 0xe7,\n  0xe9, 0x83, 0xf4, 0x77, 0x0c, 0x0d, 0x86, 0x0d, 0x83, 0xc7, 0x48, 0x62,\n  0x28, 0x19, 0x6b, 0x19, 0x7b, 0x19, 0xa7, 0x18, 0xb7, 0x19, 0x2f, 0x99,\n  0x4c, 0xa6, 0x05, 0xd3, 0x97, 0x99, 0xc8, 0x54, 0x30, 0xd7, 0x32, 0x1b,\n  0x99, 0x67, 0x98, 0x0f, 0x98, 0x6f, 0x55, 0x58, 0x2a, 0xf6, 0x2a, 0x7c,\n  0x15, 0x91, 0xca, 0x12, 0x95, 0x3a, 0x95, 0x56, 0x95, 0x7e, 0x95, 0xe7,\n  0xaa, 0x54, 0x55, 0x73, 0x55, 0x3f, 0xd5, 0x79, 0xaa, 0x0b, 0x54, 0xab,\n  0x55, 0x0f, 0xab, 0x5e, 0x56, 0x7d, 0xa6, 0x46, 0x55, 0xb3, 0x50, 0xe3,\n  0xa9, 0x09, 0xd4, 0x16, 0xab, 0xd5, 0xa9, 0x1d, 0x55, 0xbb, 0xa9, 0x36,\n  0xae, 0xce, 0x52, 0x77, 0x52, 0x8f, 0x50, 0xcf, 0x51, 0x5f, 0xa3, 0xbe,\n  0x5f, 0xfd, 0x82, 0xfa, 0x63, 0x0d, 0xb2, 0x86, 0x85, 0x46, 0xa0, 0x86,\n  0x48, 0xa3, 0x54, 0x63, 0xb7, 0xc6, 0x19, 0x8d, 0x21, 0x16, 0xc6, 0x32,\n  0x65, 0xf1, 0x58, 0x42, 0xd6, 0x72, 0x56, 0x03, 0xeb, 0x2c, 0x6b, 0x98,\n  0x4d, 0x62, 0x5b, 0xb2, 0xf9, 0xec, 0x4c, 0x76, 0x05, 0xfb, 0x1b, 0x76,\n  0x2f, 0x7b, 0x4c, 0x53, 0x43, 0x73, 0xaa, 0x66, 0xac, 0x66, 0x91, 0x66,\n  0x9d, 0xe6, 0x71, 0xcd, 0x01, 0x0e, 0xc6, 0xb1, 0xe0, 0xf0, 0x39, 0xd9,\n  0x9c, 0x4a, 0xce, 0x21, 0xce, 0x0d, 0xce, 0x7b, 0x2d, 0x03, 0x2d, 0x3f,\n  0x2d, 0xb1, 0xd6, 0x6a, 0xad, 0x66, 0xad, 0x7e, 0xad, 0x37, 0xda, 0x7a,\n  0xda, 0xbe, 0xda, 0x62, 0xed, 0x72, 0xed, 0x16, 0xed, 0xeb, 0xda, 0xef,\n  0x75, 0x70, 0x9d, 0x40, 0x9d, 0x2c, 0x9d, 0xf5, 0x3a, 0x6d, 0x3a, 0xf7,\n  0x75, 0x09, 0xba, 0x36, 0xba, 0x51, 0xba, 0x85, 0xba, 0xdb, 0x75, 0xcf,\n  0xea, 0x3e, 0xd3, 0x63, 0xeb, 0x79, 0xe9, 0x09, 0xf5, 0xca, 0xf5, 0x0e,\n  0xe9, 0xdd, 0xd1, 0x47, 0xf5, 0x6d, 0xf4, 0xa3, 0xf5, 0x17, 0xea, 0xef,\n  0xd6, 0xef, 0xd1, 0x1f, 0x37, 0x30, 0x34, 0x08, 0x36, 0x90, 0x19, 0x6c,\n  0x31, 0x38, 0x63, 0xf0, 0xcc, 0x90, 0x63, 0xe8, 0x6b, 0x98, 0x69, 0xb8,\n  0xd1, 0xf0, 0x84, 0xe1, 0xa8, 0x11, 0xcb, 0x68, 0xba, 0x91, 0xc4, 0x68,\n  0xa3, 0xd1, 0x49, 0xa3, 0x27, 0xb8, 0x26, 0xee, 0x87, 0x67, 0xe3, 0x35,\n  0x78, 0x17, 0x3e, 0x66, 0xac, 0x6f, 0x1c, 0x62, 0xac, 0x34, 0xde, 0x65,\n  0xdc, 0x6b, 0x3c, 0x61, 0x62, 0x69, 0x32, 0xdb, 0xa4, 0xc4, 0xa4, 0xc5,\n  0xe4, 0xbe, 0x29, 0xcd, 0x94, 0x6b, 0x9a, 0x66, 0xba, 0xd1, 0xb4, 0xd3,\n  0x74, 0xcc, 0xcc, 0xc8, 0x2c, 0xdc, 0xac, 0xd8, 0xac, 0xc9, 0xec, 0x8e,\n  0x39, 0xd5, 0x9c, 0x6b, 0x9e, 0x61, 0xbe, 0xd9, 0xbc, 0xdb, 0xfc, 0x8d,\n  0x85, 0xa5, 0x45, 0x9c, 0xc5, 0x4a, 0x8b, 0x36, 0x8b, 0xc7, 0x96, 0xda,\n  0x96, 0x7c, 0xcb, 0x05, 0x96, 0x4d, 0x96, 0xf7, 0xac, 0x98, 0x56, 0x3e,\n  0x56, 0x79, 0x56, 0xf5, 0x56, 0xd7, 0xac, 0x49, 0xd6, 0x5c, 0xeb, 0x2c,\n  0xeb, 0x6d, 0xd6, 0x57, 0x6c, 0x50, 0x1b, 0x57, 0x9b, 0x0c, 0x9b, 0x3a,\n  0x9b, 0xcb, 0xb6, 0xa8, 0xad, 0x9b, 0xad, 0xc4, 0x76, 0x9b, 0x6d, 0xdf,\n  0x14, 0xe2, 0x14, 0x8f, 0x29, 0xd2, 0x29, 0xf5, 0x53, 0x6e, 0xda, 0x31,\n  0xec, 0xfc, 0xec, 0x0a, 0xec, 0x9a, 0xec, 0x06, 0xed, 0x39, 0xf6, 0x61,\n  0xf6, 0x25, 0xf6, 0x6d, 0xf6, 0xcf, 0x1d, 0xcc, 0x1c, 0x12, 0x1d, 0xd6,\n  0x3b, 0x74, 0x3b, 0x7c, 0x72, 0x74, 0x75, 0xcc, 0x76, 0x6c, 0x70, 0xbc,\n  0xeb, 0xa4, 0xe1, 0x34, 0xc3, 0xa9, 0xc4, 0xa9, 0xc3, 0xe9, 0x57, 0x67,\n  0x1b, 0x67, 0xa1, 0x73, 0x9d, 0xf3, 0x35, 0x17, 0xa6, 0x4b, 0x90, 0xcb,\n  0x12, 0x97, 0x76, 0x97, 0x17, 0x53, 0x6d, 0xa7, 0x8a, 0xa7, 0x6e, 0x9f,\n  0x7a, 0xcb, 0x95, 0xe5, 0x1a, 0xee, 0xba, 0xd2, 0xb5, 0xd3, 0xf5, 0xa3,\n  0x9b, 0xbb, 0x9b, 0xdc, 0xad, 0xd9, 0x6d, 0xd4, 0xdd, 0xcc, 0x3d, 0xc5,\n  0x7d, 0xab, 0xfb, 0x4d, 0x2e, 0x9b, 0x1b, 0xc9, 0x5d, 0xc3, 0x3d, 0xef,\n  0x41, 0xf4, 0xf0, 0xf7, 0x58, 0xe2, 0x71, 0xcc, 0xe3, 0x9d, 0xa7, 0x9b,\n  0xa7, 0xc2, 0xf3, 0x90, 0xe7, 0x2f, 0x5e, 0x76, 0x5e, 0x59, 0x5e, 0xfb,\n  0xbd, 0x1e, 0x4f, 0xb3, 0x9c, 0x26, 0x9e, 0xd6, 0x30, 0x6d, 0xc8, 0xdb,\n  0xc4, 0x5b, 0xe0, 0xbd, 0xcb, 0x7b, 0x60, 0x3a, 0x3e, 0x3d, 0x65, 0xfa,\n  0xce, 0xe9, 0x03, 0x3e, 0xc6, 0x3e, 0x02, 0x9f, 0x7a, 0x9f, 0x87, 0xbe,\n  0xa6, 0xbe, 0x22, 0xdf, 0x3d, 0xbe, 0x23, 0x7e, 0xd6, 0x7e, 0x99, 0x7e,\n  0x07, 0xfc, 0x9e, 0xfb, 0x3b, 0xfa, 0xcb, 0xfd, 0x8f, 0xf8, 0xbf, 0xe1,\n  0x79, 0xf2, 0x16, 0xf1, 0x4e, 0x05, 0x60, 0x01, 0xc1, 0x01, 0xe5, 0x01,\n  0xbd, 0x81, 0x1a, 0x81, 0xb3, 0x03, 0x6b, 0x03, 0x1f, 0x04, 0x99, 0x04,\n  0xa5, 0x07, 0x35, 0x05, 0x8d, 0x05, 0xbb, 0x06, 0x2f, 0x0c, 0x3e, 0x15,\n  0x42, 0x0c, 0x09, 0x0d, 0x59, 0x1f, 0x72, 0x93, 0x6f, 0xc0, 0x17, 0xf2,\n  0x1b, 0xf9, 0x63, 0x33, 0xdc, 0x67, 0x2c, 0x9a, 0xd1, 0x15, 0xca, 0x08,\n  0x9d, 0x15, 0x5a, 0x1b, 0xfa, 0x30, 0xcc, 0x26, 0x4c, 0x1e, 0xd6, 0x11,\n  0x8e, 0x86, 0xcf, 0x08, 0xdf, 0x10, 0x7e, 0x6f, 0xa6, 0xf9, 0x4c, 0xe9,\n  0xcc, 0xb6, 0x08, 0x88, 0xe0, 0x47, 0x6c, 0x88, 0xb8, 0x1f, 0x69, 0x19,\n  0x99, 0x17, 0xf9, 0x7d, 0x14, 0x29, 0x2a, 0x32, 0xaa, 0x2e, 0xea, 0x51,\n  0xb4, 0x53, 0x74, 0x71, 0x74, 0xf7, 0x2c, 0xd6, 0xac, 0xe4, 0x59, 0xfb,\n  0x67, 0xbd, 0x8e, 0xf1, 0x8f, 0xa9, 0x8c, 0xb9, 0x3b, 0xdb, 0x6a, 0xb6,\n  0x72, 0x76, 0x67, 0xac, 0x6a, 0x6c, 0x52, 0x6c, 0x63, 0xec, 0x9b, 0xb8,\n  0x80, 0xb8, 0xaa, 0xb8, 0x81, 0x78, 0x87, 0xf8, 0x45, 0xf1, 0x97, 0x12,\n  0x74, 0x13, 0x24, 0x09, 0xed, 0x89, 0xe4, 0xc4, 0xd8, 0xc4, 0x3d, 0x89,\n  0xe3, 0x73, 0x02, 0xe7, 0x6c, 0x9a, 0x33, 0x9c, 0xe4, 0x9a, 0x54, 0x96,\n  0x74, 0x63, 0xae, 0xe5, 0xdc, 0xa2, 0xb9, 0x17, 0xe6, 0xe9, 0xce, 0xcb,\n  0x9e, 0x77, 0x3c, 0x59, 0x35, 0x59, 0x90, 0x7c, 0x38, 0x85, 0x98, 0x12,\n  0x97, 0xb2, 0x3f, 0xe5, 0x83, 0x20, 0x42, 0x50, 0x2f, 0x18, 0x4f, 0xe5,\n  0xa7, 0x6e, 0x4d, 0x1d, 0x13, 0xf2, 0x84, 0x9b, 0x85, 0x4f, 0x45, 0xbe,\n  0xa2, 0x8d, 0xa2, 0x51, 0xb1, 0xb7, 0xb8, 0x4a, 0x3c, 0x92, 0xe6, 0x9d,\n  0x56, 0x95, 0xf6, 0x38, 0xdd, 0x3b, 0x7d, 0x43, 0xfa, 0x68, 0x86, 0x4f,\n  0x46, 0x75, 0xc6, 0x33, 0x09, 0x4f, 0x52, 0x2b, 0x79, 0x91, 0x19, 0x92,\n  0xb9, 0x23, 0xf3, 0x4d, 0x56, 0x44, 0xd6, 0xde, 0xac, 0xcf, 0xd9, 0x71,\n  0xd9, 0x2d, 0x39, 0x94, 0x9c, 0x94, 0x9c, 0xa3, 0x52, 0x0d, 0x69, 0x96,\n  0xb4, 0x2b, 0xd7, 0x30, 0xb7, 0x28, 0xb7, 0x4f, 0x66, 0x2b, 0x2b, 0x93,\n  0x0d, 0xe4, 0x79, 0xe6, 0x6d, 0xca, 0x1b, 0x93, 0x87, 0xca, 0xf7, 0xe4,\n  0x23, 0xf9, 0x73, 0xf3, 0xdb, 0x15, 0x6c, 0x85, 0x4c, 0xd1, 0xa3, 0xb4,\n  0x52, 0xae, 0x50, 0x0e, 0x16, 0x4c, 0x2f, 0xa8, 0x2b, 0x78, 0x5b, 0x18,\n  0x5b, 0x78, 0xb8, 0x48, 0xbd, 0x48, 0x5a, 0xd4, 0x33, 0xdf, 0x66, 0xfe,\n  0xea, 0xf9, 0x23, 0x0b, 0x82, 0x16, 0x7c, 0xbd, 0x90, 0xb0, 0x50, 0xb8,\n  0xb0, 0xb3, 0xd8, 0xb8, 0x78, 0x59, 0xf1, 0xe0, 0x22, 0xbf, 0x45, 0xbb,\n  0x16, 0x23, 0x8b, 0x53, 0x17, 0x77, 0x2e, 0x31, 0x5d, 0x52, 0xba, 0x64,\n  0x78, 0x69, 0xf0, 0xd2, 0x7d, 0xcb, 0x68, 0xcb, 0xb2, 0x96, 0xfd, 0x50,\n  0xe2, 0x58, 0x52, 0x55, 0xf2, 0x6a, 0x79, 0xdc, 0xf2, 0x8e, 0x52, 0x83,\n  0xd2, 0xa5, 0xa5, 0x43, 0x2b, 0x82, 0x57, 0x34, 0x95, 0xa9, 0x94, 0xc9,\n  0xcb, 0x6e, 0xae, 0xf4, 0x5a, 0xb9, 0x63, 0x15, 0x61, 0x95, 0x64, 0x55,\n  0xef, 0x6a, 0x97, 0xd5, 0x5b, 0x56, 0x7f, 0x2a, 0x17, 0x95, 0x5f, 0xac,\n  0x70, 0xac, 0xa8, 0xae, 0xf8, 0xb0, 0x46, 0xb8, 0xe6, 0xe2, 0x57, 0x4e,\n  0x5f, 0xd5, 0x7c, 0xf5, 0x79, 0x6d, 0xda, 0xda, 0xde, 0x4a, 0xb7, 0xca,\n  0xed, 0xeb, 0x48, 0xeb, 0xa4, 0xeb, 0x6e, 0xac, 0xf7, 0x59, 0xbf, 0xaf,\n  0x4a, 0xbd, 0x6a, 0x41, 0xd5, 0xd0, 0x86, 0xf0, 0x0d, 0xad, 0x1b, 0xf1,\n  0x8d, 0xe5, 0x1b, 0x5f, 0x6d, 0x4a, 0xde, 0x74, 0xa1, 0x7a, 0x6a, 0xf5,\n  0x8e, 0xcd, 0xb4, 0xcd, 0xca, 0xcd, 0x03, 0x35, 0x61, 0x35, 0xed, 0x5b,\n  0xcc, 0xb6, 0xac, 0xdb, 0xf2, 0xa1, 0x36, 0xa3, 0xf6, 0x7a, 0x9d, 0x7f,\n  0x5d, 0xcb, 0x56, 0xfd, 0xad, 0xab, 0xb7, 0xbe, 0xd9, 0x26, 0xda, 0xd6,\n  0xbf, 0xdd, 0x77, 0x7b, 0xf3, 0x0e, 0x83, 0x1d, 0x15, 0x3b, 0xde, 0xef,\n  0x94, 0xec, 0xbc, 0xb5, 0x2b, 0x78, 0x57, 0x6b, 0xbd, 0x45, 0x7d, 0xf5,\n  0x6e, 0xd2, 0xee, 0x82, 0xdd, 0x8f, 0x1a, 0x62, 0x1b, 0xba, 0xbf, 0xe6,\n  0x7e, 0xdd, 0xb8, 0x47, 0x77, 0x4f, 0xc5, 0x9e, 0x8f, 0x7b, 0xa5, 0x7b,\n  0x07, 0xf6, 0x45, 0xef, 0xeb, 0x6a, 0x74, 0x6f, 0x6c, 0xdc, 0xaf, 0xbf,\n  0xbf, 0xb2, 0x09, 0x6d, 0x52, 0x36, 0x8d, 0x1e, 0x48, 0x3a, 0x70, 0xe5,\n  0x9b, 0x80, 0x6f, 0xda, 0x9b, 0xed, 0x9a, 0x77, 0xb5, 0x70, 0x5a, 0x2a,\n  0x0e, 0xc2, 0x41, 0xe5, 0xc1, 0x27, 0xdf, 0xa6, 0x7c, 0x7b, 0xe3, 0x50,\n  0xe8, 0xa1, 0xce, 0xc3, 0xdc, 0xc3, 0xcd, 0xdf, 0x99, 0x7f, 0xb7, 0xf5,\n  0x08, 0xeb, 0x48, 0x79, 0x2b, 0xd2, 0x3a, 0xbf, 0x75, 0xac, 0x2d, 0xa3,\n  0x6d, 0xa0, 0x3d, 0xa1, 0xbd, 0xef, 0xe8, 0x8c, 0xa3, 0x9d, 0x1d, 0x5e,\n  0x1d, 0x47, 0xbe, 0xb7, 0xff, 0x7e, 0xef, 0x31, 0xe3, 0x63, 0x75, 0xc7,\n  0x35, 0x8f, 0x57, 0x9e, 0xa0, 0x9d, 0x28, 0x3d, 0xf1, 0xf9, 0xe4, 0x82,\n  0x93, 0xe3, 0xa7, 0x64, 0xa7, 0x9e, 0x9d, 0x4e, 0x3f, 0x3d, 0xd4, 0x99,\n  0xdc, 0x79, 0xf7, 0x4c, 0xfc, 0x99, 0x6b, 0x5d, 0x51, 0x5d, 0xbd, 0x67,\n  0x43, 0xcf, 0x9e, 0x3f, 0x17, 0x74, 0xee, 0x4c, 0xb7, 0x5f, 0xf7, 0xc9,\n  0xf3, 0xde, 0xe7, 0x8f, 0x5d, 0xf0, 0xbc, 0x70, 0xf4, 0x22, 0xf7, 0x62,\n  0xdb, 0x25, 0xb7, 0x4b, 0xad, 0x3d, 0xae, 0x3d, 0x47, 0x7e, 0x70, 0xfd,\n  0xe1, 0x48, 0xaf, 0x5b, 0x6f, 0xeb, 0x65, 0xf7, 0xcb, 0xed, 0x57, 0x3c,\n  0xae, 0x74, 0xf4, 0x4d, 0xeb, 0x3b, 0xd1, 0xef, 0xd3, 0x7f, 0xfa, 0x6a,\n  0xc0, 0xd5, 0x73, 0xd7, 0xf8, 0xd7, 0x2e, 0x5d, 0x9f, 0x79, 0xbd, 0xef,\n  0xc6, 0xec, 0x1b, 0xb7, 0x6e, 0x26, 0xdd, 0x1c, 0xb8, 0x25, 0xba, 0xf5,\n  0xf8, 0x76, 0xf6, 0xed, 0x17, 0x77, 0x0a, 0xee, 0x4c, 0xdc, 0x5d, 0x7a,\n  0x8f, 0x78, 0xaf, 0xfc, 0xbe, 0xda, 0xfd, 0xea, 0x07, 0xfa, 0x0f, 0xea,\n  0x7f, 0xb4, 0xfe, 0xb1, 0x65, 0xc0, 0x6d, 0xe0, 0xf8, 0x60, 0xc0, 0x60,\n  0xcf, 0xc3, 0x59, 0x0f, 0xef, 0x0e, 0x09, 0x87, 0x9e, 0xfe, 0x94, 0xff,\n  0xd3, 0x87, 0xe1, 0xd2, 0x47, 0xcc, 0x47, 0xd5, 0x23, 0x46, 0x23, 0x8d,\n  0x8f, 0x9d, 0x1f, 0x1f, 0x1b, 0x0d, 0x1a, 0xbd, 0xf2, 0x64, 0xce, 0x93,\n  0xe1, 0xa7, 0xb2, 0xa7, 0x13, 0xcf, 0xca, 0x7e, 0x56, 0xff, 0x79, 0xeb,\n  0x73, 0xab, 0xe7, 0xdf, 0xfd, 0xe2, 0xfb, 0x4b, 0xcf, 0x58, 0xfc, 0xd8,\n  0xf0, 0x0b, 0xf9, 0x8b, 0xcf, 0xbf, 0xae, 0x79, 0xa9, 0xf3, 0x72, 0xef,\n  0xab, 0xa9, 0xaf, 0x3a, 0xc7, 0x23, 0xc7, 0x1f, 0xbc, 0xce, 0x79, 0x3d,\n  0xf1, 0xa6, 0xfc, 0xad, 0xce, 0xdb, 0x7d, 0xef, 0xb8, 0xef, 0xba, 0xdf,\n  0xc7, 0xbd, 0x1f, 0x99, 0x28, 0xfc, 0x40, 0xfe, 0x50, 0xf3, 0xd1, 0xfa,\n  0x63, 0xc7, 0xa7, 0xd0, 0x4f, 0xf7, 0x3e, 0xe7, 0x7c, 0xfe, 0xfc, 0x2f,\n  0xf7, 0x84, 0xf3, 0xfb, 0x80, 0x39, 0x25, 0x11, 0x00, 0x00, 0x00, 0x06,\n  0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, 0xbd,\n  0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00,\n  0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00,\n  0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xdc, 0x02, 0x07, 0x10,\n  0x2f, 0x1c, 0x54, 0x04, 0xda, 0x7f, 0x00, 0x00, 0x10, 0x67, 0x49, 0x44,\n  0x41, 0x54, 0x78, 0xda, 0xed, 0x9b, 0x7b, 0x74, 0x15, 0x55, 0x96, 0xc6,\n  0xbf, 0x53, 0x75, 0xef, 0xcd, 0xbd, 0x79, 0x12, 0xf2, 0x20, 0xa0, 0x04,\n  0x3a, 0x22, 0x12, 0x12, 0xd3, 0xe1, 0x25, 0x32, 0x40, 0x62, 0xec, 0x81,\n  0x0e, 0x68, 0x56, 0x8c, 0x01, 0x31, 0xe2, 0x20, 0x06, 0x06, 0x1c, 0x40,\n  0xe3, 0x00, 0x01, 0x6d, 0x50, 0x0c, 0x59, 0x40, 0x1e, 0xca, 0x43, 0x02,\n  0x33, 0xe1, 0xd1, 0x4d, 0xc0, 0x51, 0x5a, 0x43, 0x47, 0xda, 0x5e, 0x66,\n  0xa1, 0x2d, 0x0b, 0x08, 0x2a, 0xd0, 0x4e, 0x46, 0x1e, 0x41, 0x60, 0x50,\n  0x48, 0x20, 0x08, 0x81, 0x84, 0x57, 0x12, 0x92, 0x9b, 0x5b, 0xf5, 0xcd,\n  0x1f, 0x9c, 0xd2, 0xe2, 0x7a, 0x11, 0xed, 0xf6, 0x8f, 0x11, 0xeb, 0xb7,\n  0xd6, 0x5d, 0x21, 0xe1, 0xd4, 0xa9, 0xbd, 0xcf, 0xad, 0xfd, 0x9d, 0x7d,\n  0xf6, 0x39, 0x05, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,\n  0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,\n  0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,\n  0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,\n  0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58,\n  0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xfc, 0x7f, 0x43, 0xfc, 0xc4, 0x7d,\n  0xa9, 0xf2, 0xa7, 0x2e, 0x3f, 0xf4, 0xd1, 0x4e, 0xf5, 0x6a, 0xa7, 0xc9,\n  0x9f, 0xdf, 0x87, 0x0a, 0x40, 0x91, 0xfd, 0x69, 0x37, 0xe9, 0xd7, 0x6c,\n  0x83, 0x22, 0x7f, 0xd7, 0x01, 0x78, 0x7e, 0x40, 0xdf, 0xaa, 0xa9, 0xbd,\n  0xfe, 0x03, 0xec, 0x51, 0xe4, 0xe7, 0x56, 0xbe, 0x9a, 0xdb, 0x19, 0x50,\n  0x7e, 0x7c, 0x5d, 0x23, 0xbc, 0xec, 0xd1, 0x6e, 0xe2, 0xaf, 0x30, 0xf5,\n  0xed, 0x8b, 0x5b, 0xd9, 0x64, 0xfb, 0x11, 0xe3, 0x6f, 0xfe, 0xbe, 0x28,\n  0xc7, 0x53, 0xb7, 0x42, 0xe7, 0xf6, 0x40, 0xfd, 0xa9, 0x82, 0xdf, 0x6e,\n  0xb7, 0x07, 0xe8, 0xba, 0xde, 0x05, 0x40, 0x4f, 0x00, 0x54, 0x14, 0xa5,\n  0x9d, 0xa4, 0x66, 0x7e, 0xf0, 0x14, 0x45, 0x09, 0x20, 0xd9, 0x19, 0x40,\n  0x6f, 0x00, 0x7d, 0x01, 0x38, 0x65, 0x5b, 0x92, 0xf4, 0x19, 0xa8, 0x8a,\n  0xa2, 0x38, 0x49, 0x86, 0x03, 0x88, 0x06, 0xa0, 0xda, 0xed, 0x76, 0x8f,\n  0xae, 0xeb, 0x1d, 0x3e, 0xda, 0xf9, 0x91, 0x0c, 0x05, 0xd0, 0x15, 0x40,\n  0x02, 0x80, 0x48, 0x00, 0x14, 0x42, 0x28, 0x37, 0x79, 0x68, 0x55, 0x21,\n  0x44, 0x30, 0x00, 0xc3, 0x9e, 0xde, 0x00, 0xec, 0x00, 0x84, 0xa2, 0x28,\n  0xba, 0x97, 0xed, 0xdf, 0x3a, 0x2a, 0x84, 0x1d, 0x40, 0xa8, 0xbc, 0x2e,\n  0x1c, 0x80, 0x6e, 0xb7, 0xdb, 0x85, 0xb7, 0x4d, 0xaa, 0xaa, 0xfa, 0x91,\n  0x0c, 0x94, 0x76, 0x74, 0x01, 0x10, 0x26, 0x3f, 0xc1, 0x00, 0xe8, 0xe7,\n  0xe7, 0xa7, 0x6a, 0x9a, 0x66, 0xbe, 0xc6, 0x26, 0x84, 0x08, 0x01, 0x10,\n  0x01, 0x60, 0x20, 0x80, 0xbb, 0x01, 0xe8, 0x0e, 0x87, 0x43, 0x68, 0x9a,\n  0x66, 0x08, 0x01, 0x84, 0x10, 0x2a, 0x80, 0x40, 0x00, 0x9d, 0x00, 0x74,\n  0x93, 0x36, 0x84, 0x99, 0x3e, 0x21, 0x00, 0x84, 0xd3, 0xe9, 0x54, 0x3c,\n  0x1e, 0x8f, 0xc7, 0x24, 0x02, 0x8a, 0x10, 0x22, 0x50, 0xb6, 0xbf, 0x0b,\n  0xc0, 0x3d, 0x72, 0xfc, 0x0d, 0x7f, 0xbd, 0xc7, 0x5f, 0x11, 0x42, 0x04,\n  0xc9, 0xf6, 0x7d, 0x01, 0xc4, 0x1b, 0x62, 0xf6, 0x7d, 0xe3, 0x63, 0xf1,\n  0xf3, 0xc2, 0xf6, 0x53, 0x09, 0x49, 0x47, 0x47, 0x47, 0xd0, 0x43, 0x0f,\n  0x3d, 0xb4, 0x63, 0xe6, 0xcc, 0x99, 0x3d, 0x47, 0x8d, 0x1a, 0xb5, 0xd1,\n  0xed, 0x76, 0xff, 0xeb, 0x8d, 0x71, 0x23, 0x02, 0x75, 0x5d, 0x8f, 0x4d,\n  0x49, 0x49, 0x59, 0x9b, 0x9d, 0x9d, 0x7d, 0x6f, 0x97, 0x2e, 0x5d, 0x70,\n  0xf2, 0xe4, 0x49, 0xcc, 0x9f, 0x3f, 0xff, 0xe3, 0x86, 0x86, 0x86, 0x09,\n  0xaa, 0xaa, 0x9e, 0xd5, 0x34, 0xad, 0xd5, 0x6b, 0x26, 0xf4, 0xd3, 0x75,\n  0x3d, 0x22, 0x2a, 0x2a, 0x6a, 0xf5, 0xda, 0xb5, 0x6b, 0x47, 0x95, 0x94,\n  0x94, 0x7c, 0xb5, 0x6d, 0xdb, 0xb6, 0x01, 0x00, 0xae, 0x99, 0x67, 0x37,\n  0x21, 0x84, 0x43, 0xd7, 0xf5, 0x30, 0x55, 0x55, 0xe7, 0x15, 0x14, 0x14,\n  0x4c, 0x8b, 0x8d, 0x8d, 0x45, 0x73, 0x73, 0x33, 0x76, 0xef, 0xde, 0xdd,\n  0x58, 0x52, 0x52, 0x92, 0xaf, 0x28, 0xca, 0x66, 0x5d, 0xd7, 0x9b, 0x00,\n  0x18, 0x01, 0x27, 0x14, 0x45, 0x09, 0xd6, 0x75, 0xfd, 0x9f, 0x32, 0x33,\n  0x33, 0x57, 0x67, 0x66, 0x66, 0x46, 0x87, 0x84, 0x84, 0xe0, 0xe4, 0xc9,\n  0x93, 0x98, 0x39, 0x73, 0xe6, 0x5f, 0xdb, 0xdb, 0xdb, 0xa7, 0xda, 0x6c,\n  0xb6, 0xb3, 0x1e, 0x8f, 0xa7, 0xd5, 0x3b, 0x28, 0x48, 0x86, 0x00, 0x18,\n  0x53, 0x58, 0x58, 0xf8, 0x1f, 0xa1, 0xa1, 0xa1, 0xa8, 0xa8, 0xa8, 0x38,\n  0x5d, 0x59, 0x59, 0x79, 0xaf, 0x97, 0x4d, 0x42, 0xd3, 0x34, 0x57, 0x42,\n  0x42, 0xc2, 0xc6, 0x89, 0x13, 0x27, 0x3e, 0xe4, 0x76, 0xbb, 0x75, 0x21,\n  0x04, 0xe5, 0x7d, 0x79, 0xe0, 0xc0, 0x01, 0x65, 0xd3, 0xa6, 0x4d, 0x3d,\n  0xe4, 0x35, 0x1e, 0xe9, 0x6b, 0x28, 0xc9, 0x11, 0x39, 0x39, 0x39, 0x6b,\n  0xd2, 0xd2, 0xd2, 0x02, 0xec, 0x76, 0x3b, 0xf6, 0xec, 0xd9, 0xc3, 0xb9,\n  0x73, 0xe7, 0xbe, 0xa6, 0x28, 0xca, 0x52, 0x92, 0x17, 0x48, 0x76, 0x90,\n  0x54, 0x01, 0xa4, 0xbc, 0xf2, 0xca, 0x2b, 0xef, 0xba, 0x5c, 0xae, 0x0e,\n  0x92, 0xc2, 0x4b, 0x08, 0x59, 0x57, 0x57, 0x67, 0x2f, 0x29, 0x29, 0x49,\n  0x04, 0x50, 0x23, 0x85, 0x4f, 0xb1, 0xd9, 0x6c, 0x21, 0x1e, 0x8f, 0x67,\n  0x50, 0x7a, 0x7a, 0xfa, 0xea, 0xcc, 0xcc, 0xcc, 0xbb, 0xc2, 0xc2, 0xc2,\n  0x50, 0x5f, 0x5f, 0x8f, 0x17, 0x5f, 0x7c, 0xf1, 0xe3, 0xc6, 0xc6, 0xc6,\n  0x89, 0x36, 0x9b, 0xed, 0x6b, 0x8f, 0xc7, 0xd3, 0x62, 0x12, 0xeb, 0x4e,\n  0xba, 0xae, 0x0f, 0xc8, 0xc8, 0xc8, 0xf8, 0xcf, 0xac, 0xac, 0xac, 0x98,\n  0xa8, 0xa8, 0x28, 0x1c, 0x3e, 0x7c, 0x18, 0x33, 0x66, 0xcc, 0xd8, 0xea,\n  0xf1, 0x78, 0x72, 0x54, 0x55, 0x3d, 0x6f, 0xfa, 0xbe, 0x2c, 0x7e, 0xe1,\n  0x04, 0x01, 0x18, 0xbb, 0x73, 0xe7, 0x4e, 0x56, 0x55, 0x55, 0x11, 0x40,\n  0x1a, 0x00, 0x97, 0xe9, 0xff, 0xed, 0x00, 0x7a, 0x0e, 0x1c, 0x38, 0xf0,\n  0x6b, 0x4a, 0x76, 0xee, 0xdc, 0x69, 0xfc, 0x93, 0xbd, 0x7b, 0xf7, 0xfe,\n  0x40, 0xce, 0xdc, 0x8a, 0x9c, 0x3d, 0x9d, 0xf2, 0xf7, 0x91, 0x00, 0x4a,\n  0xb7, 0x6c, 0xd9, 0x42, 0x92, 0x7c, 0xee, 0xb9, 0xe7, 0xea, 0x64, 0x26,\n  0xa0, 0x78, 0xa5, 0xc3, 0x61, 0x00, 0x0a, 0xcf, 0x9c, 0x39, 0x43, 0x92,\n  0xac, 0xaf, 0xaf, 0x67, 0x53, 0x53, 0x13, 0x49, 0xf2, 0xa3, 0x8f, 0x3e,\n  0x22, 0x80, 0x69, 0xc6, 0xcc, 0x28, 0x05, 0xc3, 0x09, 0xe0, 0xd7, 0x63,\n  0xc7, 0x8e, 0xf5, 0x90, 0xe4, 0xc5, 0x8b, 0x17, 0xb9, 0x77, 0xef, 0x5e,\n  0x92, 0xa4, 0xc7, 0xe3, 0x61, 0xff, 0xfe, 0xfd, 0x77, 0x03, 0x88, 0xf2,\n  0xce, 0x90, 0x14, 0x45, 0xf1, 0x07, 0xd0, 0x7f, 0xce, 0x9c, 0x39, 0xed,\n  0x86, 0xed, 0x73, 0xe6, 0xcc, 0x39, 0xe7, 0xc3, 0x26, 0x15, 0x40, 0x8f,\n  0x59, 0xb3, 0x66, 0x9d, 0xa3, 0x0f, 0xde, 0x7a, 0xeb, 0x2d, 0x9a, 0x32,\n  0x0e, 0x63, 0xfc, 0x1e, 0x5e, 0xbc, 0x78, 0x31, 0x49, 0xf2, 0xc8, 0x91,\n  0x23, 0xdf, 0xd8, 0x73, 0xec, 0xd8, 0x31, 0x02, 0x98, 0x29, 0xdb, 0x40,\n  0xce, 0xda, 0xd3, 0xae, 0x5d, 0xbb, 0xc6, 0x9b, 0x51, 0x5d, 0x5d, 0x4d,\n  0x00, 0xa3, 0x00, 0x38, 0x0c, 0x81, 0x04, 0x10, 0x3f, 0x63, 0xc6, 0x8c,\n  0x76, 0x92, 0xec, 0xe8, 0xe8, 0xe0, 0xc7, 0x1f, 0x7f, 0xfc, 0x4d, 0xfb,\n  0xfb, 0xef, 0xbf, 0xff, 0x6f, 0x72, 0xbc, 0x55, 0xe9, 0xa7, 0x0b, 0xc0,\n  0xc0, 0xc7, 0x1e, 0x7b, 0xcc, 0x63, 0xb4, 0x31, 0xec, 0xb9, 0x72, 0xe5,\n  0x0a, 0xa3, 0xa3, 0xa3, 0xff, 0xe2, 0x6b, 0x7c, 0x2c, 0x7e, 0x99, 0x28,\n  0x00, 0xba, 0x85, 0x86, 0x86, 0x6e, 0x21, 0xc9, 0x09, 0x13, 0x26, 0x9c,\n  0x92, 0x29, 0xa6, 0xdd, 0xd4, 0x26, 0x10, 0xc0, 0xd4, 0x9a, 0x9a, 0x1a,\n  0x92, 0x64, 0x48, 0x48, 0xc8, 0x61, 0x00, 0x73, 0x87, 0x0f, 0x1f, 0xde,\n  0x40, 0x92, 0x1b, 0x37, 0x6e, 0x24, 0x80, 0xa1, 0x32, 0x30, 0x01, 0xc0,\n  0x15, 0x13, 0x13, 0xb3, 0x65, 0xd7, 0xae, 0x5d, 0x6c, 0x69, 0x69, 0x21,\n  0x49, 0x9d, 0x24, 0xa7, 0x4f, 0x9f, 0x7e, 0x1a, 0xc0, 0xaf, 0x7c, 0x04,\n  0x5b, 0xf4, 0xbc, 0x79, 0xf3, 0xae, 0x90, 0xe4, 0x4b, 0x2f, 0xbd, 0xa4,\n  0x03, 0x58, 0x0a, 0x60, 0xc3, 0xd6, 0xad, 0x5b, 0x49, 0x92, 0x4f, 0x3d,\n  0xf5, 0xd4, 0x49, 0x00, 0x77, 0x98, 0xae, 0x0b, 0x04, 0xb0, 0x84, 0x24,\n  0x8f, 0x1f, 0x3f, 0x4e, 0x00, 0xef, 0x00, 0xf8, 0xdd, 0xe3, 0x8f, 0x3f,\n  0xde, 0x46, 0x92, 0x6f, 0xbc, 0xf1, 0x06, 0x65, 0x1a, 0xee, 0xf0, 0xba,\n  0xcf, 0x9d, 0xc1, 0xc1, 0xc1, 0x5b, 0x48, 0x72, 0xfd, 0xfa, 0xf5, 0x3a,\n  0x49, 0xce, 0x9a, 0x35, 0xeb, 0x3c, 0x80, 0x5e, 0x5e, 0xc1, 0x60, 0x07,\n  0xd0, 0xf7, 0xd5, 0x57, 0x5f, 0x25, 0x49, 0x02, 0xf8, 0x0c, 0xc0, 0x46,\n  0x21, 0xc4, 0x3a, 0x00, 0xab, 0x5c, 0x2e, 0x57, 0x81, 0x14, 0x2d, 0xa3,\n  0x5e, 0xd1, 0x6d, 0xf0, 0xe0, 0xc1, 0x7b, 0x48, 0xb2, 0xa2, 0xa2, 0x82,\n  0x00, 0x96, 0x01, 0xc8, 0x2f, 0x2a, 0x2a, 0x62, 0x43, 0x43, 0x03, 0xb3,\n  0xb2, 0xb2, 0xbe, 0x30, 0x09, 0xaa, 0xa3, 0x53, 0xa7, 0x4e, 0xf7, 0x87,\n  0x86, 0x86, 0xbe, 0x19, 0x19, 0x19, 0xf9, 0x76, 0x64, 0x64, 0xe4, 0x96,\n  0x88, 0x88, 0x88, 0xbf, 0x38, 0x1c, 0x8e, 0x4f, 0x66, 0xce, 0x9c, 0xa9,\n  0x91, 0x64, 0x66, 0x66, 0xe6, 0x69, 0x99, 0xb6, 0x1b, 0x19, 0x5e, 0x00,\n  0x80, 0xf9, 0xcd, 0xcd, 0xcd, 0x6c, 0x6b, 0x6b, 0x23, 0x80, 0xdd, 0x00,\n  0xe6, 0x24, 0x26, 0x26, 0xd6, 0x92, 0x64, 0x79, 0x79, 0x39, 0x01, 0xdc,\n  0x6f, 0xf2, 0xb7, 0xb3, 0xcd, 0x66, 0x5b, 0x4b, 0x92, 0x4d, 0x4d, 0x4d,\n  0x04, 0x50, 0x05, 0x60, 0x56, 0xdf, 0xbe, 0x7d, 0x4f, 0x93, 0xe4, 0xdb,\n  0x6f, 0xbf, 0x4d, 0x00, 0x0f, 0x08, 0x21, 0x5c, 0xd6, 0xe3, 0x6f, 0xe1,\n  0x07, 0x20, 0x3e, 0x3f, 0x3f, 0xdf, 0x2d, 0x1f, 0xf6, 0x65, 0x72, 0x1d,\n  0x6b, 0x4e, 0x4d, 0x23, 0xfc, 0xfd, 0xfd, 0x37, 0x91, 0xe4, 0x9e, 0x3d,\n  0x7b, 0x08, 0x60, 0xaa, 0x5c, 0x53, 0xae, 0xd2, 0x34, 0x8d, 0x8d, 0x8d,\n  0x8d, 0x04, 0x30, 0xdf, 0x34, 0xcb, 0xb9, 0x62, 0x62, 0x62, 0x36, 0x94,\n  0x94, 0x94, 0xe8, 0x4b, 0x96, 0x2c, 0xe9, 0xf8, 0xe4, 0x93, 0x4f, 0x34,\n  0x93, 0x00, 0xc4, 0x78, 0x09, 0x80, 0x0d, 0xc0, 0x3d, 0x1b, 0x36, 0x6c,\n  0x20, 0x49, 0x46, 0x45, 0x45, 0xbd, 0x0b, 0x20, 0x16, 0xc0, 0xb0, 0x29,\n  0x53, 0xa6, 0x34, 0x90, 0xe4, 0x8a, 0x15, 0x2b, 0x28, 0x83, 0xd4, 0x08,\n  0x08, 0x67, 0x44, 0x44, 0xc4, 0xc6, 0xb2, 0xb2, 0x32, 0x66, 0x65, 0x65,\n  0x11, 0xc0, 0xbd, 0x00, 0x1e, 0x08, 0x0f, 0x0f, 0xdf, 0x4e, 0x92, 0xdb,\n  0xb6, 0x6d, 0x23, 0x80, 0xdf, 0x78, 0x09, 0x40, 0x27, 0x00, 0x99, 0x95,\n  0x95, 0x95, 0x5c, 0xb3, 0x66, 0x8d, 0x67, 0xf2, 0xe4, 0xc9, 0x17, 0x49,\n  0x72, 0xf6, 0xec, 0xd9, 0xbe, 0x04, 0xc0, 0x09, 0x20, 0x65, 0xf3, 0xe6,\n  0xcd, 0x3c, 0x70, 0xe0, 0x00, 0x01, 0x14, 0x03, 0x78, 0x06, 0x40, 0xba,\n  0xbc, 0x57, 0x94, 0x49, 0xec, 0x1c, 0x00, 0xee, 0x5d, 0xb9, 0x72, 0x25,\n  0x49, 0x32, 0x21, 0x21, 0xa1, 0x1a, 0xc0, 0x63, 0x00, 0xc6, 0x02, 0x98,\n  0x02, 0x60, 0x06, 0x80, 0x24, 0xbb, 0xdd, 0xee, 0x6f, 0xac, 0xa5, 0x64,\n  0xff, 0x21, 0xb2, 0xb6, 0x10, 0x0d, 0x60, 0x48, 0x42, 0x42, 0xc2, 0x21,\n  0x92, 0x5c, 0xbe, 0x7c, 0x39, 0x01, 0xa4, 0xaa, 0xaa, 0x1a, 0x62, 0xfa,\n  0x0e, 0x02, 0x00, 0x2c, 0x32, 0x8d, 0xff, 0x7c, 0x99, 0xa5, 0x55, 0x90,\n  0x64, 0x65, 0x65, 0x25, 0x01, 0x3c, 0x68, 0xf2, 0x37, 0x2a, 0x23, 0x23,\n  0xa3, 0x9a, 0x24, 0x57, 0xad, 0x5a, 0x45, 0x00, 0x23, 0x00, 0xf4, 0x01,\n  0x30, 0xf7, 0xc8, 0x91, 0x23, 0x74, 0xbb, 0xdd, 0x04, 0x50, 0x20, 0x6d,\n  0xb0, 0xf8, 0x85, 0x13, 0x0a, 0x60, 0x6e, 0x7d, 0x7d, 0x3d, 0xd7, 0xad,\n  0x5b, 0x67, 0xcc, 0xe4, 0xde, 0x33, 0x43, 0xd7, 0xa4, 0xa4, 0xa4, 0x2a,\n  0x92, 0xdc, 0xb4, 0x69, 0x13, 0x01, 0xa4, 0xc8, 0xe2, 0x58, 0xce, 0x89,\n  0x13, 0x27, 0x48, 0x92, 0x8a, 0xa2, 0xac, 0x95, 0x05, 0x27, 0xa8, 0xaa,\n  0xea, 0x90, 0x0f, 0x57, 0x2f, 0x00, 0xe9, 0xc6, 0x4c, 0x7a, 0x13, 0x01,\n  0x50, 0x00, 0x84, 0xb9, 0x5c, 0xae, 0x17, 0x01, 0xbc, 0x1c, 0x1c, 0x1c,\n  0x3c, 0x42, 0x16, 0xc7, 0x7e, 0xbb, 0x64, 0xc9, 0x12, 0x8d, 0x24, 0x17,\n  0x2d, 0x5a, 0xd4, 0x26, 0x8b, 0x93, 0x46, 0x8a, 0xeb, 0x90, 0x01, 0xdd,\n  0x03, 0xc0, 0x5d, 0x42, 0x88, 0x2c, 0x00, 0xeb, 0x0a, 0x0b, 0x0b, 0x49,\n  0x92, 0x63, 0xc6, 0x8c, 0x39, 0x2f, 0x33, 0x0d, 0x9b, 0x0c, 0x3a, 0x3f,\n  0x00, 0x31, 0x23, 0x46, 0x8c, 0xf8, 0x5f, 0x29, 0x72, 0x15, 0xb9, 0xb9,\n  0xb9, 0x8d, 0x26, 0x01, 0xb8, 0xcb, 0xcb, 0x26, 0x7f, 0x00, 0xe3, 0xab,\n  0xab, 0xab, 0x59, 0x56, 0x56, 0xd6, 0xb1, 0x60, 0xc1, 0x82, 0x8e, 0xbd,\n  0x7b, 0xf7, 0xb2, 0xa2, 0xa2, 0x82, 0x83, 0x07, 0x0f, 0x3e, 0x0e, 0x20,\n  0x49, 0x06, 0xa8, 0x21, 0x16, 0xe9, 0xdb, 0xb7, 0x6f, 0x37, 0xb2, 0x85,\n  0xfa, 0xd2, 0xd2, 0x52, 0xbd, 0xbc, 0xbc, 0x9c, 0x05, 0x05, 0x05, 0xed,\n  0x32, 0x9b, 0xe9, 0x61, 0x12, 0x0c, 0xef, 0xec, 0x2b, 0x02, 0x40, 0xde,\n  0xa9, 0x53, 0xa7, 0x78, 0xf6, 0xec, 0x59, 0x02, 0x28, 0x34, 0xa7, 0xf3,\n  0xa6, 0x25, 0xcf, 0x83, 0xcb, 0x97, 0x2f, 0x27, 0x49, 0x26, 0x27, 0x27,\n  0x37, 0x01, 0x78, 0x7f, 0xe9, 0xd2, 0xa5, 0x6e, 0x92, 0x4c, 0x4b, 0x4b,\n  0xab, 0x97, 0xe3, 0x63, 0x08, 0x64, 0xd7, 0x09, 0x13, 0x26, 0xd4, 0x90,\n  0xe4, 0xeb, 0xaf, 0xbf, 0x4e, 0x00, 0xa9, 0x32, 0xa3, 0xf8, 0xdd, 0xb1,\n  0x63, 0xc7, 0x48, 0x92, 0x01, 0x01, 0x01, 0x6f, 0xc8, 0x7b, 0x5b, 0xfc,\n  0xc2, 0x77, 0x11, 0x7a, 0x0c, 0x19, 0x32, 0x64, 0x2f, 0x49, 0xf6, 0xeb,\n  0xd7, 0x6f, 0xb7, 0x51, 0xad, 0xf7, 0x5a, 0xa3, 0xdf, 0x39, 0x66, 0xcc,\n  0x98, 0xfd, 0x24, 0x59, 0x5a, 0x5a, 0x4a, 0x00, 0x83, 0x64, 0x0a, 0x9c,\n  0x7d, 0xe8, 0xd0, 0x21, 0x63, 0x59, 0xb0, 0x41, 0x8a, 0x82, 0xf9, 0xe1,\n  0xf6, 0x07, 0xd0, 0x6f, 0xd9, 0xb2, 0x65, 0xdf, 0x27, 0x00, 0x42, 0x55,\n  0x55, 0x9b, 0x4c, 0x91, 0x43, 0x64, 0xf0, 0x27, 0x0d, 0x1d, 0x3a, 0xb4,\n  0x96, 0x24, 0x75, 0x5d, 0x67, 0x58, 0x58, 0xd8, 0x66, 0x1f, 0x59, 0x89,\n  0x22, 0x67, 0xbc, 0xd0, 0xe9, 0xd3, 0xa7, 0x5f, 0x31, 0xd6, 0xba, 0x79,\n  0x79, 0x79, 0x04, 0xb0, 0xd2, 0x66, 0xb3, 0xdd, 0x85, 0x6f, 0xb7, 0xbf,\n  0x22, 0x01, 0x2c, 0xbc, 0x7c, 0xf9, 0x32, 0x9f, 0x7d, 0xf6, 0xd9, 0x26,\n  0x00, 0x8f, 0xe5, 0xe6, 0xe6, 0x5e, 0x30, 0x2d, 0x01, 0xee, 0xf1, 0x2a,\n  0xa8, 0x06, 0x00, 0xc8, 0xbd, 0x74, 0xe9, 0x12, 0x49, 0xb2, 0xb6, 0xb6,\n  0x96, 0x95, 0x95, 0x95, 0xdf, 0xac, 0xb9, 0xc7, 0x8f, 0x1f, 0x7f, 0x19,\n  0x40, 0x6f, 0xb9, 0x36, 0x77, 0x01, 0x78, 0xea, 0xe0, 0xc1, 0x83, 0x24,\n  0xa9, 0xb7, 0xb7, 0xb7, 0xf3, 0xe8, 0xd1, 0xa3, 0xac, 0xad, 0xad, 0x35,\n  0xd7, 0x00, 0x16, 0xca, 0x5d, 0x07, 0xef, 0x1d, 0x09, 0x27, 0x80, 0xc4,\n  0xf9, 0xf3, 0xe7, 0xbb, 0x49, 0x32, 0x3d, 0x3d, 0xbd, 0x0e, 0xc0, 0xdd,\n  0x52, 0xb0, 0x6e, 0xc8, 0xd2, 0x84, 0x10, 0x09, 0x00, 0x76, 0x9c, 0x3f,\n  0x7f, 0xfe, 0x86, 0x7a, 0x81, 0x0c, 0xf0, 0x65, 0x26, 0x7f, 0x01, 0x20,\n  0x3c, 0x22, 0x22, 0xa2, 0x9c, 0x24, 0x1b, 0x1b, 0x1b, 0x69, 0xb3, 0xd9,\n  0x3e, 0x03, 0xb0, 0xe8, 0xbe, 0xfb, 0xee, 0xfb, 0xe6, 0xe2, 0x9e, 0x3d,\n  0x7b, 0x6e, 0x95, 0x19, 0x88, 0xc5, 0x2f, 0x15, 0x21, 0x84, 0x3f, 0x80,\n  0xa4, 0xb2, 0xb2, 0x32, 0x9e, 0x38, 0x71, 0xc2, 0x28, 0x56, 0x75, 0xf2,\n  0x6e, 0x06, 0xe0, 0xce, 0x47, 0x1f, 0x7d, 0xf4, 0x73, 0x92, 0x5c, 0xb3,\n  0x66, 0x0d, 0x01, 0x0c, 0x96, 0x02, 0x30, 0xc9, 0xa8, 0x0b, 0x04, 0x05,\n  0x05, 0x79, 0x0b, 0x80, 0xb1, 0x96, 0xbe, 0xf7, 0x16, 0x02, 0x00, 0x53,\n  0xa1, 0x2b, 0x0a, 0xc0, 0xd3, 0xd3, 0xa7, 0x4f, 0x6f, 0x31, 0x1e, 0xd4,\n  0xb8, 0xb8, 0xb8, 0xaf, 0x01, 0xf4, 0x96, 0x05, 0x3c, 0x73, 0xf0, 0xdb,\n  0xe5, 0xec, 0xdb, 0x79, 0xe4, 0xc8, 0x91, 0x15, 0xb3, 0x67, 0xcf, 0xbe,\n  0x68, 0xcc, 0x6e, 0xf9, 0xf9, 0xf9, 0x04, 0xf0, 0x80, 0x0c, 0x1c, 0x07,\n  0x80, 0xfe, 0x0b, 0x17, 0x2e, 0xf4, 0xd4, 0xd5, 0xd5, 0x11, 0x40, 0x09,\n  0x80, 0x09, 0xcf, 0x3f, 0xff, 0x7c, 0x93, 0x2c, 0x4c, 0x36, 0x01, 0xe8,\n  0xe7, 0x70, 0x38, 0xcc, 0x7e, 0xfb, 0x05, 0x04, 0x04, 0x4c, 0xcb, 0xcf,\n  0xcf, 0xbf, 0x94, 0x9b, 0x9b, 0xdb, 0x06, 0xe0, 0x25, 0x00, 0x53, 0x12,\n  0x13, 0x13, 0xcf, 0x99, 0xd6, 0xd5, 0x2f, 0x4a, 0xa1, 0xf0, 0x07, 0x30,\n  0xf1, 0xf0, 0xe1, 0xc3, 0x94, 0x82, 0x72, 0x15, 0x40, 0x11, 0x80, 0x15,\n  0x6f, 0xbe, 0xf9, 0x26, 0x49, 0xf2, 0x85, 0x17, 0x5e, 0x68, 0x96, 0x33,\n  0xb4, 0x77, 0xf1, 0x33, 0x02, 0xc0, 0x6a, 0xa3, 0x70, 0x08, 0x60, 0xb6,\n  0x14, 0x0a, 0xef, 0xf3, 0x1d, 0x21, 0x00, 0x72, 0x8d, 0x2c, 0x63, 0xca,\n  0x94, 0x29, 0x9e, 0xe4, 0xe4, 0xe4, 0xfd, 0x9b, 0x37, 0x6f, 0x36, 0xfb,\n  0x3b, 0x4c, 0x0a, 0x8a, 0x21, 0xbc, 0x29, 0x79, 0x79, 0x79, 0xdf, 0x08,\n  0xc5, 0xe9, 0xd3, 0xa7, 0x49, 0x92, 0x47, 0x8f, 0x1e, 0xd5, 0x49, 0xb2,\n  0x5b, 0xb7, 0x6e, 0x5b, 0x2c, 0x01, 0xb8, 0x3d, 0xb1, 0xc9, 0x07, 0x20,\n  0x14, 0x40, 0xa0, 0xa2, 0x28, 0x7e, 0xf0, 0x7d, 0x60, 0xc8, 0x98, 0x19,\n  0x57, 0x92, 0xe4, 0xcb, 0x2f, 0xbf, 0xdc, 0x26, 0xd3, 0x44, 0x87, 0x8f,\n  0xb6, 0x5d, 0x87, 0x0c, 0x19, 0xb2, 0xc3, 0x54, 0x01, 0x1f, 0x21, 0x83,\n  0x75, 0x76, 0x5d, 0x5d, 0x1d, 0x49, 0x52, 0x08, 0x51, 0x2a, 0x45, 0xc1,\n  0x8c, 0xe3, 0x07, 0x0a, 0x80, 0x5d, 0xa6, 0xbd, 0x0b, 0xde, 0x7b, 0xef,\n  0x3d, 0x92, 0xe4, 0x17, 0x5f, 0x7c, 0xc1, 0xe8, 0xe8, 0xe8, 0xed, 0x00,\n  0xe2, 0x55, 0x55, 0x0d, 0x36, 0xfb, 0xe0, 0x74, 0x3a, 0x03, 0x00, 0xfc,\n  0x5a, 0xae, 0xc9, 0x87, 0xca, 0xe0, 0x1a, 0x00, 0xe0, 0x43, 0x5d, 0xd7,\n  0x8d, 0x54, 0x7c, 0xa9, 0xac, 0x49, 0xb8, 0x00, 0xcc, 0x6e, 0x69, 0x69,\n  0x61, 0x79, 0x79, 0xb9, 0x5e, 0x54, 0x54, 0xd4, 0x56, 0x50, 0x50, 0xe0,\n  0x7e, 0xff, 0xfd, 0xf7, 0x75, 0x63, 0xfd, 0x9c, 0x9d, 0x9d, 0x4d, 0x5c,\n  0xdf, 0xb7, 0x87, 0x5c, 0xc2, 0xf8, 0x4b, 0x7b, 0xe2, 0x01, 0xc4, 0x2a,\n  0x8a, 0xd2, 0x43, 0xda, 0x5d, 0x74, 0xe1, 0xc2, 0x05, 0x63, 0xc9, 0x53,\n  0x2a, 0xc5, 0xd2, 0x05, 0x60, 0x4c, 0x55, 0x55, 0x95, 0x71, 0xdf, 0x72,\n  0x79, 0xdd, 0x80, 0xd4, 0xd4, 0xd4, 0x43, 0xa6, 0x65, 0xd3, 0x40, 0xaf,\n  0x2c, 0xc3, 0x0e, 0xa0, 0x77, 0x6e, 0x6e, 0x6e, 0xb3, 0x14, 0x89, 0x56,\n  0x39, 0xfe, 0x7e, 0x3e, 0xc6, 0x3f, 0x2a, 0x3d, 0x3d, 0xbd, 0xda, 0xd4,\n  0xd7, 0x54, 0x00, 0xc3, 0x01, 0xac, 0xbf, 0x78, 0xf1, 0x22, 0x4d, 0xb5,\n  0x9b, 0x60, 0xd9, 0xaf, 0x5d, 0x08, 0xd1, 0x15, 0xc0, 0xb8, 0x07, 0x1f,\n  0x7c, 0xf0, 0x60, 0x69, 0x69, 0x29, 0x57, 0xaf, 0x5e, 0x4d, 0x87, 0xc3,\n  0x71, 0xd8, 0xb0, 0x53, 0x16, 0x34, 0xc3, 0xac, 0x70, 0xf9, 0xf9, 0x57,\n  0xf0, 0xbd, 0x71, 0x02, 0x98, 0xde, 0xbd, 0x7b, 0xf7, 0x95, 0x11, 0x11,\n  0x11, 0xa5, 0xba, 0xae, 0x87, 0xc1, 0xf7, 0x76, 0x8f, 0x0d, 0x40, 0xd0,\n  0xa4, 0x49, 0x93, 0x32, 0x01, 0xe0, 0xb5, 0xd7, 0x5e, 0xab, 0x00, 0x70,\n  0x11, 0xdf, 0xee, 0xb5, 0x9b, 0xe9, 0xa8, 0xae, 0xae, 0x3e, 0x01, 0x00,\n  0x71, 0x71, 0x71, 0x90, 0x0f, 0x78, 0x37, 0x00, 0x7d, 0xba, 0x77, 0xef,\n  0x8e, 0xb3, 0x67, 0xcf, 0x82, 0xe4, 0x97, 0x00, 0xdc, 0x7f, 0x4f, 0x22,\n  0x22, 0xab, 0xfa, 0xe9, 0x9b, 0x36, 0x6d, 0x7a, 0xe5, 0xe1, 0x87, 0x1f,\n  0xc6, 0x8a, 0x15, 0x2b, 0x10, 0x1b, 0x1b, 0xbb, 0xaa, 0xae, 0xae, 0x6e,\n  0x01, 0x80, 0x36, 0x4d, 0xd3, 0x84, 0xaa, 0xaa, 0x46, 0x60, 0x88, 0xb6,\n  0xb6, 0x36, 0xe5, 0xe9, 0xa7, 0x9f, 0x7e, 0xef, 0xd8, 0xb1, 0x63, 0xef,\n  0xe6, 0xe4, 0xe4, 0xec, 0x96, 0x82, 0xd7, 0x01, 0xe0, 0xe0, 0xf9, 0xf3,\n  0xe7, 0x8d, 0x8c, 0xc2, 0x85, 0x6f, 0x4f, 0x1f, 0xb6, 0xd5, 0xd6, 0xd6,\n  0x62, 0xf8, 0xf0, 0xe1, 0x62, 0xe2, 0xc4, 0x89, 0x7e, 0xd9, 0xd9, 0xd9,\n  0xf6, 0x51, 0xa3, 0x46, 0x09, 0x92, 0x4c, 0x4d, 0x4d, 0x45, 0x4a, 0x4a,\n  0x0a, 0x4c, 0x05, 0x4c, 0x68, 0x9a, 0xc6, 0xd4, 0xd4, 0xd4, 0xe5, 0xd3,\n  0xa6, 0x4d, 0xfb, 0xd3, 0xb0, 0x61, 0xc3, 0xfe, 0xa0, 0xeb, 0xba, 0x43,\n  0x8a, 0x99, 0xd3, 0xe1, 0xb8, 0xae, 0x8f, 0xba, 0xae, 0xb7, 0xe2, 0xdb,\n  0x93, 0x75, 0x5f, 0xd6, 0xd4, 0xd4, 0x5c, 0x8f, 0x6a, 0xbb, 0xdd, 0x4f,\n  0x8e, 0xad, 0x50, 0x14, 0x45, 0x01, 0x80, 0x96, 0x96, 0x16, 0x00, 0x68,\n  0xf3, 0x21, 0x8e, 0x43, 0xc7, 0x8d, 0x1b, 0x17, 0x00, 0x00, 0xeb, 0xd7,\n  0xaf, 0xff, 0x10, 0xc0, 0x15, 0x1f, 0x63, 0x28, 0x00, 0x28, 0xbd, 0x7a,\n  0xf5, 0xea, 0x02, 0x00, 0x17, 0x2e, 0x5c, 0x00, 0x80, 0x5a, 0xd9, 0xf6,\n  0x84, 0xe1, 0xaf, 0xd3, 0xe9, 0x0c, 0x34, 0xed, 0x4a, 0x88, 0xf0, 0xf0,\n  0xf0, 0x5e, 0x00, 0xe2, 0xb6, 0x6f, 0xdf, 0xfe, 0xd1, 0xd4, 0xa9, 0x53,\n  0x47, 0x4f, 0x9b, 0x36, 0xed, 0x61, 0xb7, 0xdb, 0xbd, 0xaf, 0x5f, 0xbf,\n  0x7e, 0xa8, 0xad, 0xad, 0x05, 0xc9, 0x83, 0x00, 0xda, 0xad, 0x10, 0xba,\n  0xfd, 0x08, 0xcf, 0xce, 0xce, 0x3e, 0x40, 0x92, 0x1f, 0x7c, 0xf0, 0x81,\n  0xf7, 0xf6, 0x90, 0x99, 0x20, 0x00, 0xe3, 0x77, 0xed, 0xda, 0x65, 0xb4,\n  0x7b, 0x54, 0x06, 0xa2, 0x2f, 0x02, 0x00, 0xfc, 0x8b, 0xb1, 0x97, 0x1c,\n  0x13, 0x13, 0x53, 0x0b, 0x60, 0x65, 0x46, 0x46, 0xc6, 0x45, 0xd3, 0xb2,\n  0x60, 0x90, 0x8f, 0xd9, 0xcb, 0x01, 0x20, 0xde, 0x94, 0x01, 0x9c, 0xc2,\n  0x77, 0xb7, 0x01, 0x6d, 0x00, 0xa2, 0x8d, 0x8a, 0x7f, 0x75, 0x75, 0x35,\n  0x13, 0x13, 0x13, 0xcf, 0xa4, 0xa6, 0xa6, 0xd6, 0x8c, 0x1e, 0x3d, 0xfa,\n  0x7f, 0xd2, 0xd2, 0xd2, 0xf6, 0x25, 0x24, 0x24, 0x6c, 0x97, 0xa9, 0xb1,\n  0x21, 0x64, 0x9d, 0xbb, 0x77, 0xef, 0xfe, 0x0e, 0x49, 0xee, 0xdf, 0xbf,\n  0x9f, 0x00, 0xb6, 0x01, 0x28, 0x4c, 0x4e, 0x4e, 0xbe, 0x48, 0x92, 0x9f,\n  0x7f, 0xfe, 0x39, 0x01, 0x64, 0x4b, 0x61, 0xb0, 0xfb, 0xf9, 0xf9, 0xdd,\n  0x01, 0xe0, 0xdf, 0xe4, 0x12, 0x67, 0x2e, 0x80, 0x82, 0xc9, 0x93, 0x27,\n  0xb7, 0x92, 0x64, 0x76, 0x76, 0x76, 0x0b, 0x80, 0x7f, 0x17, 0x42, 0x84,\n  0x9b, 0x53, 0xee, 0xf8, 0xf8, 0xf8, 0xad, 0x24, 0xf9, 0xe5, 0x97, 0x5f,\n  0x12, 0xc0, 0x56, 0x00, 0xaf, 0xa6, 0xa5, 0xa5, 0x5d, 0x32, 0x8d, 0xeb,\n  0x68, 0x39, 0xfb, 0x2b, 0x00, 0xee, 0x48, 0x4a, 0x4a, 0xfa, 0x6f, 0x92,\n  0xdc, 0xb0, 0x61, 0x03, 0x01, 0xbc, 0x0e, 0xe0, 0xad, 0x1d, 0x3b, 0x76,\n  0x50, 0x16, 0xe9, 0x8e, 0x00, 0xb8, 0xd3, 0xcb, 0xef, 0x70, 0x55, 0x55,\n  0xd7, 0x91, 0xe4, 0xb9, 0x73, 0xe7, 0x8c, 0xca, 0x7e, 0xa7, 0x9b, 0x8c,\n  0x7f, 0x44, 0x5c, 0x5c, 0xdc, 0x87, 0x24, 0xd9, 0xd0, 0xd0, 0x40, 0x55,\n  0x55, 0xf7, 0x02, 0x58, 0x14, 0x17, 0x17, 0x77, 0xc6, 0xf8, 0x9b, 0xf4,\n  0xcb, 0x10, 0x01, 0x3f, 0x00, 0x79, 0x2d, 0x2d, 0x2d, 0x46, 0x61, 0x71,\n  0x37, 0x80, 0x65, 0x4f, 0x3c, 0xf1, 0xc4, 0x65, 0x92, 0x5c, 0xbc, 0x78,\n  0xb1, 0x2e, 0x45, 0xdc, 0x61, 0x85, 0xcb, 0xed, 0x47, 0xa7, 0x94, 0x94,\n  0x94, 0x9a, 0xba, 0xba, 0x3a, 0x16, 0x17, 0x17, 0x53, 0xa6, 0xc6, 0x76,\n  0x1f, 0xed, 0x22, 0x23, 0x23, 0x23, 0xff, 0x48, 0x92, 0x59, 0x59, 0x59,\n  0x5f, 0x99, 0xab, 0xe6, 0x37, 0xc9, 0x16, 0xba, 0x0f, 0x1b, 0x36, 0xac,\n  0xc6, 0x58, 0x53, 0x9e, 0x3a, 0x75, 0x8a, 0x24, 0xd9, 0xdc, 0xdc, 0x4c,\n  0x97, 0xcb, 0x65, 0xac, 0x27, 0x7d, 0xa5, 0xf6, 0xbd, 0x4a, 0x4a, 0x4a,\n  0x48, 0x92, 0x39, 0x39, 0x39, 0xa7, 0x64, 0xe6, 0xa0, 0x78, 0xb5, 0x19,\n  0x66, 0xac, 0x6f, 0x7d, 0x51, 0x56, 0x56, 0x46, 0x5c, 0x3f, 0x07, 0x60,\n  0x37, 0x09, 0xd2, 0x08, 0xa3, 0xea, 0x6f, 0x5e, 0xe3, 0x92, 0x64, 0x7c,\n  0x7c, 0xfc, 0xdf, 0x64, 0xc0, 0xd9, 0xe4, 0x24, 0x6c, 0x14, 0x19, 0x8d,\n  0x23, 0xb8, 0x7d, 0xe6, 0xcd, 0x9b, 0xd7, 0x28, 0x53, 0xef, 0xf3, 0x00,\n  0x62, 0x64, 0xad, 0xc0, 0x2c, 0x78, 0xbf, 0x2d, 0x2e, 0x2e, 0xa6, 0xb7,\n  0xbf, 0x9a, 0xa6, 0x11, 0xc0, 0x9f, 0xbd, 0x2a, 0xf5, 0x41, 0x00, 0x1e,\n  0x5d, 0xbd, 0x7a, 0x35, 0x8d, 0xc2, 0x9b, 0x71, 0xd0, 0xe7, 0x9d, 0x77,\n  0xde, 0x21, 0x80, 0xa7, 0xe4, 0xb1, 0x65, 0x33, 0x61, 0x29, 0x29, 0x29,\n  0x7f, 0x35, 0x1d, 0x76, 0x4a, 0xc5, 0x8d, 0x87, 0xaf, 0xcc, 0x04, 0x02,\n  0x78, 0x68, 0xe9, 0xd2, 0xa5, 0xdf, 0xb1, 0x87, 0x24, 0x63, 0x63, 0x63,\n  0x4f, 0x00, 0xf8, 0x95, 0xe1, 0x83, 0x2c, 0x22, 0xf6, 0x1d, 0x37, 0x6e,\n  0x9c, 0xdb, 0x68, 0x63, 0xec, 0xd6, 0x48, 0x71, 0x5c, 0x20, 0x77, 0x6c,\n  0x14, 0x2b, 0x5c, 0x7e, 0xe6, 0x75, 0xbc, 0xef, 0x44, 0xaa, 0xcd, 0xe6,\n  0xef, 0xf1, 0x78, 0xee, 0xc6, 0xf5, 0x93, 0x6a, 0x97, 0xfd, 0xfd, 0xfd,\n  0xf7, 0xb5, 0xb6, 0xb6, 0x5e, 0xc1, 0x8d, 0x67, 0xe9, 0x05, 0x80, 0xce,\n  0xcf, 0x3c, 0xf3, 0xcc, 0x85, 0x49, 0x93, 0x26, 0x61, 0xd0, 0xa0, 0x41,\n  0x0b, 0x01, 0x2c, 0x07, 0x70, 0x09, 0xbe, 0x5f, 0x40, 0x11, 0x36, 0x9b,\n  0x2d, 0xc0, 0xe3, 0xf1, 0xdc, 0x11, 0x15, 0x15, 0xb5, 0x72, 0xd6, 0xac,\n  0x59, 0xbf, 0x09, 0x0a, 0x0a, 0x52, 0xce, 0x9d, 0x3b, 0x77, 0xad, 0xb0,\n  0xb0, 0xf0, 0xbf, 0x5a, 0x5b, 0x5b, 0xf3, 0x14, 0x45, 0x69, 0xd4, 0x75,\n  0xfd, 0x9a, 0x8f, 0x5d, 0x86, 0xe0, 0x01, 0x03, 0x06, 0x6c, 0x8d, 0x8f,\n  0x8f, 0x0f, 0xfe, 0xea, 0xab, 0xaf, 0xf6, 0x57, 0x55, 0x55, 0x3d, 0x2b,\n  0xd3, 0x57, 0xb3, 0xb8, 0xf4, 0x49, 0x49, 0x49, 0xf9, 0x63, 0xd7, 0xae,\n  0x5d, 0x75, 0x5d, 0xd7, 0x55, 0xb3, 0x0d, 0xaa, 0xaa, 0xea, 0x47, 0x8f,\n  0x1e, 0x6d, 0xfe, 0xec, 0xb3, 0xcf, 0x46, 0x03, 0xb8, 0x2a, 0x53, 0x6e,\n  0xc5, 0x66, 0xb3, 0x85, 0x7a, 0x3c, 0x9e, 0xe4, 0xe4, 0xe4, 0xe4, 0x97,\n  0x32, 0x32, 0x32, 0x12, 0x5d, 0x2e, 0x17, 0x1a, 0x1a, 0x1a, 0xda, 0x8a,\n  0x8a, 0x8a, 0xfe, 0x74, 0xf5, 0xea, 0xd5, 0x57, 0x54, 0x55, 0x3d, 0x23,\n  0x8f, 0xba, 0xfa, 0xf2, 0x27, 0xa8, 0x4f, 0x9f, 0x3e, 0xbf, 0x1f, 0x32,\n  0x64, 0xc8, 0xdd, 0xc7, 0x8f, 0x1f, 0x3f, 0x52, 0x55, 0x55, 0x35, 0x45,\n  0xf6, 0x6d, 0xb4, 0x55, 0x6d, 0x36, 0x5b, 0x27, 0xd9, 0x7f, 0xde, 0xd8,\n  0xb1, 0x63, 0xe3, 0x5d, 0x2e, 0x17, 0xea, 0xea, 0xea, 0x5a, 0xf3, 0xf2,\n  0xf2, 0x36, 0x02, 0x58, 0x2c, 0x84, 0xb8, 0x40, 0xd2, 0xf0, 0x57, 0x55,\n  0x14, 0xa5, 0xb3, 0xae, 0xeb, 0xff, 0xfc, 0xe4, 0x93, 0x4f, 0x2e, 0x4e,\n  0x4e, 0x4e, 0xee, 0xa9, 0x69, 0x1a, 0x3e, 0xfd, 0xf4, 0xd3, 0xba, 0xb2,\n  0xb2, 0xb2, 0x7c, 0x45, 0x51, 0xfe, 0x2c, 0x8f, 0x32, 0x9b, 0xcf, 0xeb,\n  0x07, 0x74, 0xee, 0xdc, 0x79, 0xd1, 0x23, 0x8f, 0x3c, 0x92, 0x72, 0xe8,\n  0xd0, 0xa1, 0xb6, 0x7d, 0xfb, 0xf6, 0x65, 0x02, 0x38, 0x0b, 0xdf, 0x2f,\n  0x3f, 0xa9, 0xaa, 0xaa, 0x86, 0x6a, 0x9a, 0x96, 0x9c, 0x96, 0x96, 0xb6,\n  0x70, 0xe4, 0xc8, 0x91, 0x7d, 0xfd, 0xfd, 0xfd, 0xd1, 0xd0, 0xd0, 0xd0,\n  0x51, 0x5c, 0x5c, 0xfc, 0x6e, 0x53, 0x53, 0xd3, 0xcb, 0xaa, 0xaa, 0xd6,\n  0x6b, 0x9a, 0xd6, 0x2c, 0x7d, 0x50, 0x54, 0x55, 0x0d, 0xd1, 0x34, 0xad,\n  0x5f, 0x52, 0x52, 0x52, 0xf1, 0xf8, 0xf1, 0xe3, 0xfb, 0x07, 0x06, 0x06,\n  0xe2, 0xe0, 0xc1, 0x83, 0x57, 0x0a, 0x0a, 0x0a, 0x5e, 0x05, 0xb0, 0x5e,\n  0xda, 0xef, 0xb6, 0x42, 0xe8, 0x36, 0x13, 0x00, 0xf9, 0x37, 0x9b, 0x0c,\n  0x3e, 0xe3, 0x6d, 0x31, 0xef, 0x17, 0x3f, 0x84, 0xd3, 0xe9, 0x0c, 0x68,\n  0x6b, 0x6b, 0x1b, 0x20, 0x67, 0x97, 0xbd, 0x42, 0x88, 0x2b, 0xb7, 0x78,\n  0x20, 0x84, 0xa2, 0x28, 0x2e, 0x5d, 0xd7, 0x03, 0xe5, 0x8c, 0xe7, 0xc0,\n  0xf5, 0xb3, 0xf0, 0xcd, 0x8a, 0xa2, 0x5c, 0xd5, 0x75, 0xdd, 0xd7, 0x7a,\n  0x52, 0xa8, 0xaa, 0xea, 0xa7, 0x69, 0x9a, 0x5d, 0xa6, 0xa5, 0xed, 0x36,\n  0x9b, 0xad, 0xdd, 0xe3, 0xf1, 0xb8, 0xbd, 0xc4, 0xc5, 0xe5, 0xf1, 0x78,\n  0xec, 0xb2, 0x5f, 0xef, 0x59, 0xc9, 0x03, 0xa0, 0x59, 0x55, 0x55, 0xb7,\n  0xa6, 0x69, 0xed, 0xb8, 0xf1, 0xe5, 0x98, 0x00, 0xf9, 0xc2, 0x4e, 0x90,\n  0xf4, 0xd9, 0xdb, 0x1e, 0x9f, 0x6f, 0x1d, 0xaa, 0xaa, 0xea, 0xd0, 0x34,\n  0xcd, 0x4f, 0xfa, 0xe0, 0xf6, 0x61, 0x93, 0x51, 0x5f, 0x09, 0x90, 0x7d,\n  0x1b, 0xfd, 0xb7, 0x00, 0xb8, 0xaa, 0x28, 0x4a, 0xb3, 0x0f, 0x7f, 0x6d,\n  0xa6, 0xf6, 0xc6, 0x52, 0xaa, 0x05, 0xc0, 0x55, 0x21, 0x44, 0xb3, 0xf7,\n  0xcb, 0x3a, 0x42, 0x08, 0x3b, 0x49, 0xa7, 0x1c, 0x97, 0x0e, 0xe9, 0x5f,\n  0x1b, 0x6e, 0xfe, 0xa6, 0xa4, 0x51, 0xdc, 0x35, 0xec, 0x51, 0x65, 0x5d,\n  0xe1, 0x8a, 0xb4, 0xc7, 0xfb, 0x5a, 0x55, 0x08, 0xe1, 0x22, 0x19, 0x2c,\n  0x0b, 0xc2, 0xfe, 0x00, 0x1a, 0x4c, 0xf6, 0x58, 0xc1, 0x7f, 0x9b, 0x0a,\n  0xc0, 0x8f, 0x29, 0x20, 0x1a, 0xfb, 0xe4, 0xbe, 0x44, 0xe2, 0xfb, 0xee,\n  0xf9, 0x43, 0x5e, 0x1b, 0xf6, 0xbe, 0x86, 0xff, 0x80, 0x2f, 0xbc, 0x85,\n  0x1f, 0xca, 0x8f, 0xb4, 0xe7, 0xc7, 0x8e, 0xd3, 0x8f, 0xe9, 0x5f, 0xc1,\n  0x8d, 0xaf, 0x03, 0xeb, 0x3f, 0xc1, 0xd8, 0xdc, 0xac, 0xff, 0x5b, 0xbd,\n  0x5e, 0xfd, 0xf7, 0xb4, 0xb7, 0xf8, 0x19, 0xf1, 0x7f, 0x2c, 0x2e, 0x06,\n  0x08, 0x9c, 0x01, 0xc9, 0x62, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,\n  0x44, 0xae, 0x42, 0x60, 0x82\n};\n\nunsigned int cc_fps_images_len(void)\n{\n\treturn sizeof(cc_fps_images_png);\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccFPSImages.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n    \nextern unsigned char cc_fps_images_png[];\nunsigned int cc_fps_images_len(void);\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccGLStateCache.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (C) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"ccGLStateCache.h\"\n#include \"CCGLProgram.h\"\n#include \"CCDirector.h\"\n#include \"ccConfig.h\"\n#include \"CCConfiguration.h\"\n\n// extern\n#include \"kazmath/GL/matrix.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\nnamespace\n{\n    static GLuint      s_currentProjectionMatrix = -1;\n    static bool        s_vertexAttribPosition = false;\n    static bool        s_vertexAttribColor = false;\n    static bool        s_vertexAttribTexCoords = false;\n    \n#if CC_ENABLE_GL_STATE_CACHE\n    \n#define kMaxActiveTexture 16\n    \n    static GLuint    s_currentShaderProgram = -1;\n    static GLuint    s_currentBoundTexture[kMaxActiveTexture] =  {(GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, (GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, (GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, (GLuint)-1,(GLuint)-1,(GLuint)-1,(GLuint)-1, };\n    static GLenum    s_blendingSource = -1;\n    static GLenum    s_blendingDest = -1;\n    static int       s_GLServerState = 0;\n    static GLuint    s_VAO = 0;\n    static GLenum    s_activeTexture = -1;\n\n#endif // CC_ENABLE_GL_STATE_CACHE\n}\n\n// GL State Cache functions\n\nnamespace GL {\n\nvoid invalidateStateCache( void )\n{\n    kmGLFreeAll();\n    \n    s_currentProjectionMatrix = -1;\n    s_vertexAttribPosition = false;\n    s_vertexAttribColor = false;\n    s_vertexAttribTexCoords = false;\n    \n#if CC_ENABLE_GL_STATE_CACHE\n    s_currentShaderProgram = -1;\n    for( int i=0; i < kMaxActiveTexture; i++ )\n    {\n        s_currentBoundTexture[i] = -1;\n    }\n\n    s_blendingSource = -1;\n    s_blendingDest = -1;\n    s_GLServerState = 0;\n    s_VAO = 0;\n    \n#endif // CC_ENABLE_GL_STATE_CACHE\n}\n\nvoid deleteProgram( GLuint program )\n{\n#if CC_ENABLE_GL_STATE_CACHE\n    if(program == s_currentShaderProgram)\n    {\n        s_currentShaderProgram = -1;\n    }\n#endif // CC_ENABLE_GL_STATE_CACHE\n\n    glDeleteProgram( program );\n}\n\nvoid useProgram( GLuint program )\n{\n#if CC_ENABLE_GL_STATE_CACHE\n    if( program != s_currentShaderProgram ) {\n        s_currentShaderProgram = program;\n        glUseProgram(program);\n    }\n#else\n    glUseProgram(program);\n#endif // CC_ENABLE_GL_STATE_CACHE\n}\n\nstatic void SetBlending(GLenum sfactor, GLenum dfactor)\n{\n\tif (sfactor == GL_ONE && dfactor == GL_ZERO)\n    {\n\t\tglDisable(GL_BLEND);\n\t}\n    else\n    {\n\t\tglEnable(GL_BLEND);\n\t\tglBlendFunc(sfactor, dfactor);\n\t}\n}\n\nvoid blendFunc(GLenum sfactor, GLenum dfactor)\n{\n#if CC_ENABLE_GL_STATE_CACHE\n    if (sfactor != s_blendingSource || dfactor != s_blendingDest)\n    {\n        s_blendingSource = sfactor;\n        s_blendingDest = dfactor;\n        SetBlending(sfactor, dfactor);\n    }\n#else\n    SetBlending( sfactor, dfactor );\n#endif // CC_ENABLE_GL_STATE_CACHE\n}\n\nvoid blendResetToCache(void)\n{\n\tglBlendEquation(GL_FUNC_ADD);\n#if CC_ENABLE_GL_STATE_CACHE\n\tSetBlending(s_blendingSource, s_blendingDest);\n#else\n\tSetBlending(CC_BLEND_SRC, CC_BLEND_DST);\n#endif // CC_ENABLE_GL_STATE_CACHE\n}\n\nvoid bindTexture2D(GLuint textureId)\n{\n    GL::bindTexture2DN(0, textureId);\n}\n\nvoid bindTexture2DN(GLuint textureUnit, GLuint textureId)\n{\n#if CC_ENABLE_GL_STATE_CACHE\n    CCASSERT(textureUnit < kMaxActiveTexture, \"textureUnit is too big\");\n    if (s_currentBoundTexture[textureUnit] != textureId)\n    {\n        s_currentBoundTexture[textureUnit] = textureId;\n        activeTexture(GL_TEXTURE0 + textureUnit);\n        glBindTexture(GL_TEXTURE_2D, textureId);\n    }\n#else\n    glActiveTexture(GL_TEXTURE0 + textureUnit);\n    glBindTexture(GL_TEXTURE_2D, textureId);\n#endif\n}\n\n\nvoid deleteTexture(GLuint textureId)\n{\n    deleteTextureN(0, textureId);\n}\n\nvoid deleteTextureN(GLuint textureUnit, GLuint textureId)\n{\n#if CC_ENABLE_GL_STATE_CACHE\n\tif (s_currentBoundTexture[textureUnit] == textureId)\n    {\n\t\ts_currentBoundTexture[textureUnit] = -1;\n    }\n#endif // CC_ENABLE_GL_STATE_CACHE\n    \n\tglDeleteTextures(1, &textureId);\n}\n\nvoid activeTexture(GLenum texture)\n{\n#if CC_ENABLE_GL_STATE_CACHE\n    if(s_activeTexture != texture) {\n        s_activeTexture = texture;\n        glActiveTexture(s_activeTexture);\n    }\n#else\n    glActiveTexture(texture);\n#endif\n}\n\nvoid bindVAO(GLuint vaoId)\n{\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n    \n#if CC_ENABLE_GL_STATE_CACHE\n        if (s_VAO != vaoId)\n        {\n            s_VAO = vaoId;\n            glBindVertexArray(vaoId);\n        }\n#else\n        glBindVertexArray(vaoId);\n#endif // CC_ENABLE_GL_STATE_CACHE\n    \n    }\n}\n\n//#pragma mark - GL Vertex Attrib functions\n\nvoid enableVertexAttribs( unsigned int flags )\n{\n    bindVAO(0);\n    \n    /* Position */\n    bool enablePosition = flags & VERTEX_ATTRIB_FLAG_POSITION;\n\n    if( enablePosition != s_vertexAttribPosition ) {\n        if( enablePosition )\n            glEnableVertexAttribArray( GLProgram::VERTEX_ATTRIB_POSITION );\n        else\n            glDisableVertexAttribArray( GLProgram::VERTEX_ATTRIB_POSITION );\n\n        s_vertexAttribPosition = enablePosition;\n    }\n\n    /* Color */\n    bool enableColor = (flags & VERTEX_ATTRIB_FLAG_COLOR) != 0 ? true : false;\n\n    if( enableColor != s_vertexAttribColor ) {\n        if( enableColor )\n            glEnableVertexAttribArray( GLProgram::VERTEX_ATTRIB_COLOR );\n        else\n            glDisableVertexAttribArray( GLProgram::VERTEX_ATTRIB_COLOR );\n\n        s_vertexAttribColor = enableColor;\n    }\n\n    /* Tex Coords */\n    bool enableTexCoords = (flags & VERTEX_ATTRIB_FLAG_TEX_COORDS) != 0 ? true : false;\n\n    if( enableTexCoords != s_vertexAttribTexCoords ) {\n        if( enableTexCoords )\n            glEnableVertexAttribArray( GLProgram::VERTEX_ATTRIB_TEX_COORDS );\n        else\n            glDisableVertexAttribArray( GLProgram::VERTEX_ATTRIB_TEX_COORDS );\n\n        s_vertexAttribTexCoords = enableTexCoords;\n    }\n}\n\n//#pragma mark - GL Uniforms functions\n\nvoid setProjectionMatrixDirty( void )\n{\n    s_currentProjectionMatrix = -1;\n}\n\n} // Namespace GL\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccGLStateCache.h",
    "content": "/****************************************************************************\n Copyright (c) 2011      Ricardo Quesada\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2011      Zynga Inc.\n Copyright (C) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCGLSTATE_H__\n#define __CCGLSTATE_H__\n\n#include \"CCGL.h\"\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup shaders\n * @{\n */\n\nclass GLProgram;\n\nnamespace GL {\n\n/** vertex attrib flags */\nenum {\n    VERTEX_ATTRIB_FLAT_NONE       = 0,\n\n    VERTEX_ATTRIB_FLAG_POSITION   = 1 << 0,\n    VERTEX_ATTRIB_FLAG_COLOR      = 1 << 1,\n    VERTEX_ATTRIB_FLAG_TEX_COORDS = 1 << 2,\n\n    VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = (VERTEX_ATTRIB_FLAG_POSITION | VERTEX_ATTRIB_FLAG_COLOR | VERTEX_ATTRIB_FLAG_TEX_COORDS),\n};\n\n/** @file ccGLStateCache.h\n*/\n\n/** Invalidates the GL state cache.\n If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache.\n @since v2.0.0\n */\nvoid CC_DLL invalidateStateCache(void);\n\n/** Uses the GL program in case program is different than the current one.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly.\n @since v2.0.0\n */\nvoid CC_DLL useProgram(GLuint program);\n\n/** Deletes the GL program. If it is the one that is being used, it invalidates it.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly.\n @since v2.0.0\n */\nvoid CC_DLL deleteProgram(GLuint program);\n\n/** Uses a blending function in case it not already used.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly.\n @since v2.0.0\n */\nvoid CC_DLL blendFunc(GLenum sfactor, GLenum dfactor);\n\n/** Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation().\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD.\n @since v2.0.0\n */\nvoid CC_DLL blendResetToCache(void);\n\n/** sets the projection matrix as dirty\n @since v2.0.0\n */\nvoid CC_DLL setProjectionMatrixDirty(void);\n\n/** Will enable the vertex attribs that are passed as flags.\n Possible flags:\n\n    * VERTEX_ATTRIB_FLAG_POSITION\n    * VERTEX_ATTRIB_FLAG_COLOR\n    * VERTEX_ATTRIB_FLAG_TEX_COORDS\n\n These flags can be ORed. The flags that are not present, will be disabled.\n\n @since v2.0.0\n */\nvoid CC_DLL enableVertexAttribs(unsigned int flags);\n\n/** If the texture is not already bound to texture unit 0, it binds it.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.\n @since v2.0.0\n */\nvoid CC_DLL bindTexture2D(GLuint textureId);\n\n\n/** If the texture is not already bound to a given unit, it binds it.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly.\n @since v2.1.0\n */\nvoid CC_DLL bindTexture2DN(GLuint textureUnit, GLuint textureId);\n\n/** It will delete a given texture. If the texture was bound, it will invalidate the cached.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly.\n @since v2.0.0\n */\nvoid CC_DLL deleteTexture(GLuint textureId);\n\n/** It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly.\n @since v2.1.0\n */\nvoid CC_DLL deleteTextureN(GLuint textureUnit, GLuint textureId);\n\n/** Select active texture unit.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly.\n @since v3.0\n */\nvoid CC_DLL activeTexture(GLenum texture);\n\n/** If the vertex array is not already bound, it binds it.\n If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly.\n @since v2.0.0\n */\nvoid CC_DLL bindVAO(GLuint vaoId);\n\n// end of shaders group\n/// @}\n\n} // Namespace GL\nNS_CC_END\n    \n\n#endif /* __CCGLSTATE_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccMacros.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCMACROS_H__\n#define __CCMACROS_H__\n\n#ifndef _USE_MATH_DEFINES\n#define _USE_MATH_DEFINES\n#endif\n\n#include \"CCConsole.h\"\n#include \"CCStdC.h\"\n\n#ifndef CCASSERT\n#if COCOS2D_DEBUG > 0\nextern bool CC_DLL cc_assert_script_compatible(const char *msg);\n#define CCASSERT(cond, msg) do {                              \\\n      if (!(cond)) {                                          \\\n        if (!cc_assert_script_compatible(msg) && strlen(msg)) \\\n          cocos2d::log(\"Assert failed: %s\", msg);             \\\n        CC_ASSERT(cond);                                      \\\n      } \\\n    } while (0)\n#else\n#define CCASSERT(cond, msg)\n#endif\n// XXX: Backward compatible\n#define CCAssert CCASSERT\n#endif  // CCASSERT\n\n#include \"ccConfig.h\"\n\n/** @def CC_SWAP\nsimple macro that swaps 2 variables\n*/\n#define CC_SWAP(x, y, type)    \\\n{    type temp = (x);        \\\n    x = y; y = temp;        \\\n}\n\n\n/** @def CCRANDOM_MINUS1_1\n returns a random float between -1 and 1\n */\n#define CCRANDOM_MINUS1_1() ((2.0f*((float)rand()/RAND_MAX))-1.0f)\n\n/** @def CCRANDOM_0_1\n returns a random float between 0 and 1\n */\n#define CCRANDOM_0_1() ((float)rand()/RAND_MAX)\n\n/** @def CC_DEGREES_TO_RADIANS\n converts degrees to radians\n */\n#define CC_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__) * 0.01745329252f) // PI / 180\n\n/** @def CC_RADIANS_TO_DEGREES\n converts radians to degrees\n */\n#define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__) * 57.29577951f) // PI * 180\n\n#define kRepeatForever (UINT_MAX -1)\n\n/** @def CC_BLEND_SRC\ndefault gl blend src function. Compatible with premultiplied alpha images.\n*/\n#define CC_BLEND_SRC GL_ONE\n#define CC_BLEND_DST GL_ONE_MINUS_SRC_ALPHA\n\n\n/** @def CC_NODE_DRAW_SETUP\n Helpful macro that setups the GL server state, the correct GL program and sets the Model View Projection matrix\n @since v2.0\n */\n#define CC_NODE_DRAW_SETUP() \\\ndo { \\\n    CCASSERT(getShaderProgram(), \"No shader program set for this node\"); \\\n    { \\\n        getShaderProgram()->use(); \\\n        getShaderProgram()->setUniformsForBuiltins(_modelViewTransform); \\\n    } \\\n} while(0)\n\n\n /** @def CC_DIRECTOR_END\n  Stops and removes the director from memory.\n  Removes the GLView from its parent\n\n  @since v0.99.4\n  */\n#define CC_DIRECTOR_END()                                       \\\ndo {                                                            \\\n    Director *__director = Director::getInstance();             \\\n    __director->end();                                          \\\n} while(0)\n\n/** @def CC_CONTENT_SCALE_FACTOR\nOn Mac it returns 1;\nOn iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1\n*/\n#define CC_CONTENT_SCALE_FACTOR() Director::getInstance()->getContentScaleFactor()\n\n/****************************/\n/** RETINA DISPLAY ENABLED **/\n/****************************/\n\n/** @def CC_RECT_PIXELS_TO_POINTS\n Converts a rect in pixels to points\n */\n#define CC_RECT_PIXELS_TO_POINTS(__rect_in_pixels__)                                                                        \\\n    Rect( (__rect_in_pixels__).origin.x / CC_CONTENT_SCALE_FACTOR(), (__rect_in_pixels__).origin.y / CC_CONTENT_SCALE_FACTOR(),    \\\n            (__rect_in_pixels__).size.width / CC_CONTENT_SCALE_FACTOR(), (__rect_in_pixels__).size.height / CC_CONTENT_SCALE_FACTOR() )\n\n/** @def CC_RECT_POINTS_TO_PIXELS\n Converts a rect in points to pixels\n */\n#define CC_RECT_POINTS_TO_PIXELS(__rect_in_points_points__)                                                                        \\\n    Rect( (__rect_in_points_points__).origin.x * CC_CONTENT_SCALE_FACTOR(), (__rect_in_points_points__).origin.y * CC_CONTENT_SCALE_FACTOR(),    \\\n            (__rect_in_points_points__).size.width * CC_CONTENT_SCALE_FACTOR(), (__rect_in_points_points__).size.height * CC_CONTENT_SCALE_FACTOR() )\n\n/** @def CC_POINT_PIXELS_TO_POINTS\n Converts a rect in pixels to points\n */\n#define CC_POINT_PIXELS_TO_POINTS(__pixels__)                                                                        \\\nPoint( (__pixels__).x / CC_CONTENT_SCALE_FACTOR(), (__pixels__).y / CC_CONTENT_SCALE_FACTOR())\n\n/** @def CC_POINT_POINTS_TO_PIXELS\n Converts a rect in points to pixels\n */\n#define CC_POINT_POINTS_TO_PIXELS(__points__)                                                                        \\\nPoint( (__points__).x * CC_CONTENT_SCALE_FACTOR(), (__points__).y * CC_CONTENT_SCALE_FACTOR())\n\n/** @def CC_POINT_PIXELS_TO_POINTS\n Converts a rect in pixels to points\n */\n#define CC_SIZE_PIXELS_TO_POINTS(__size_in_pixels__)                                                                        \\\nSize( (__size_in_pixels__).width / CC_CONTENT_SCALE_FACTOR(), (__size_in_pixels__).height / CC_CONTENT_SCALE_FACTOR())\n\n/** @def CC_POINT_POINTS_TO_PIXELS\n Converts a rect in points to pixels\n */\n#define CC_SIZE_POINTS_TO_PIXELS(__size_in_points__)                                                                        \\\nSize( (__size_in_points__).width * CC_CONTENT_SCALE_FACTOR(), (__size_in_points__).height * CC_CONTENT_SCALE_FACTOR())\n\n\n#ifndef FLT_EPSILON\n#define FLT_EPSILON     1.192092896e-07F\n#endif // FLT_EPSILON\n\n#define DISALLOW_COPY_AND_ASSIGN(TypeName) \\\n            TypeName(const TypeName&);\\\n            void operator=(const TypeName&)\n\n/**\nHelper macros which converts 4-byte little/big endian \nintegral number to the machine native number representation\n \nIt should work same as apples CFSwapInt32LittleToHost(..)\n*/\n\n/// when define returns true it means that our architecture uses big endian\n#define CC_HOST_IS_BIG_ENDIAN (bool)(*(unsigned short *)\"\\0\\xff\" < 0x100) \n#define CC_SWAP32(i)  ((i & 0x000000ff) << 24 | (i & 0x0000ff00) << 8 | (i & 0x00ff0000) >> 8 | (i & 0xff000000) >> 24)\n#define CC_SWAP16(i)  ((i & 0x00ff) << 8 | (i &0xff00) >> 8)   \n#define CC_SWAP_INT32_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true)? CC_SWAP32(i) : (i) )\n#define CC_SWAP_INT16_LITTLE_TO_HOST(i) ((CC_HOST_IS_BIG_ENDIAN == true)? CC_SWAP16(i) : (i) )\n#define CC_SWAP_INT32_BIG_TO_HOST(i)    ((CC_HOST_IS_BIG_ENDIAN == true)? (i) : CC_SWAP32(i) )\n#define CC_SWAP_INT16_BIG_TO_HOST(i)    ((CC_HOST_IS_BIG_ENDIAN == true)? (i):  CC_SWAP16(i) )\n\n/**********************/\n/** Profiling Macros **/\n/**********************/\n#if CC_ENABLE_PROFILERS\n\n#define CC_PROFILER_DISPLAY_TIMERS() Profiler::getInstance()->displayTimers()\n#define CC_PROFILER_PURGE_ALL() Profiler::getInstance()->releaseAllTimers()\n\n#define CC_PROFILER_START(__name__) ProfilingBeginTimingBlock(__name__)\n#define CC_PROFILER_STOP(__name__) ProfilingEndTimingBlock(__name__)\n#define CC_PROFILER_RESET(__name__) ProfilingResetTimingBlock(__name__)\n\n#define CC_PROFILER_START_CATEGORY(__cat__, __name__) do{ if(__cat__) ProfilingBeginTimingBlock(__name__); } while(0)\n#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) do{ if(__cat__) ProfilingEndTimingBlock(__name__); } while(0)\n#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) do{ if(__cat__) ProfilingResetTimingBlock(__name__); } while(0)\n\n#define CC_PROFILER_START_INSTANCE(__id__, __name__) do{ ProfilingBeginTimingBlock( String::createWithFormat(\"%08X - %s\", __id__, __name__)->getCString() ); } while(0)\n#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) do{ ProfilingEndTimingBlock(    String::createWithFormat(\"%08X - %s\", __id__, __name__)->getCString() ); } while(0)\n#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) do{ ProfilingResetTimingBlock( String::createWithFormat(\"%08X - %s\", __id__, __name__)->getCString() ); } while(0)\n\n\n#else\n\n#define CC_PROFILER_DISPLAY_TIMERS() do {} while (0)\n#define CC_PROFILER_PURGE_ALL() do {} while (0)\n\n#define CC_PROFILER_START(__name__)  do {} while (0)\n#define CC_PROFILER_STOP(__name__) do {} while (0)\n#define CC_PROFILER_RESET(__name__) do {} while (0)\n\n#define CC_PROFILER_START_CATEGORY(__cat__, __name__) do {} while(0)\n#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) do {} while(0)\n#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) do {} while(0)\n\n#define CC_PROFILER_START_INSTANCE(__id__, __name__) do {} while(0)\n#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) do {} while(0)\n#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) do {} while(0)\n\n#endif\n\n#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0\n#define CHECK_GL_ERROR_DEBUG()\n#else\n#define CHECK_GL_ERROR_DEBUG() \\\n    do { \\\n        GLenum __error = glGetError(); \\\n        if(__error) { \\\n            cocos2d::log(\"OpenGL error 0x%04X in %s %s %d\\n\", __error, __FILE__, __FUNCTION__, __LINE__); \\\n        } \\\n    } while (false)\n#endif\n\n/** @def CC_INCREMENT_GL_DRAWS_BY_ONE\n Increments the GL Draws counts by one.\n The number of calls per frame are displayed on the screen when the Director's stats are enabled.\n */\nextern unsigned int CC_DLL g_uNumberOfDraws;\n#define CC_INCREMENT_GL_DRAWS(__n__) g_uNumberOfDraws += __n__\n\n/*******************/\n/** Notifications **/\n/*******************/\n/** @def AnimationFrameDisplayedNotification\n Notification name when a SpriteFrame is displayed\n */\n#define AnimationFrameDisplayedNotification \"CCAnimationFrameDisplayedNotification\"\n\n#endif // __CCMACROS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShaderEx_SwitchMask_frag.h",
    "content": "\"                                                \\n\\\n#ifdef GL_ES                                     \\n\\\nprecision lowp float;                            \\n\\\n#endif                                           \\n\\\n                                                 \\n\\\nvarying vec4        v_fragmentColor;             \\n\\\nvarying vec2        v_texCoord;                  \\n\\\nuniform sampler2D   u_texture;                   \\n\\\nuniform sampler2D   u_mask;                      \\n\\\n                                                 \\n\\\nvoid main()                                      \\n\\\n{                                                \\n\\\n    vec4 texColor   = texture2D(u_texture, v_texCoord);                                      \\n\\\n    vec4 maskColor  = texture2D(u_mask, v_texCoord);                                         \\n\\\n    vec4 finalColor = vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a);    \\n\\\n    gl_FragColor    = v_fragmentColor * finalColor;                                          \\n\\\n}                                                                                            \\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_Label_frag.h",
    "content": "\"\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES \\n\\\nprecision lowp float; \\n\\\n#endif \\n\\\n \\n\\\nvarying vec4 v_fragmentColor; \\n\\\nvarying vec2 v_texCoord; \\n\\\nuniform sampler2D CC_Texture0; \\n\\\n \\n\\\nvoid main() \\n\\\n{\t\\n\\\n  vec4 color = texture2D(CC_Texture0, v_texCoord); \\n\\\n  //the texture use dual channel 16-bit output for distance_map \\n\\\n  //float dist = color.b+color.g/256.0; \\n\\\n  // the texture use single channel 8-bit output for distance_map \\n\\\n  float dist = color.a; \\n\\\n  //todo:Implementation 'fwidth' for glsl 1.0 \\n\\\n  //float width = fwidth(dist); \\n\\\n  //assign width for constant will lead to a little bit fuzzy,it's temporary measure.\\n\\\n  float width = 0.04; \\n\\\n  float alpha = smoothstep(0.5-width, 0.5+width, dist); \\n\\\n  gl_FragColor = vec4(v_fragmentColor.rgb,alpha); \\n\\\n} \\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_Label_frag_glow.h",
    "content": "\"\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES \\n\\\nprecision lowp float; \\n\\\n#endif \\n\\\n \\n\\\nvarying vec4 v_fragmentColor; \\n\\\nvarying vec2 v_texCoord; \\n\\\nuniform sampler2D CC_Texture0; \\n\\\nuniform vec3 v_effectColor; \\n\\\n \\n\\\nvoid main() \\n\\\n{\t\\n\\\n  float dist = texture2D(CC_Texture0, v_texCoord).a; \\n\\\n  //todo:Implementation 'fwidth' for glsl 1.0 \\n\\\n  //float width = fwidth(dist); \\n\\\n  //assign width for constant will lead to a little bit fuzzy,it's temporary measure.\\n\\\n  float width = 0.04; \\n\\\n  float alpha = smoothstep(0.5-width, 0.5+width, dist); \\n\\\n  //glow \\n\\\n  float mu = smoothstep(0.5, 1.0, sqrt(dist)); \\n\\\n  vec3 rgb = v_effectColor*(1.0-alpha) + v_fragmentColor.rgb*alpha; \\n\\\n  gl_FragColor = vec4(rgb, max(alpha,mu)); \\n\\\n} \\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_Label_frag_outline.h",
    "content": "\"\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES \\n\\\nprecision lowp float; \\n\\\n#endif \\n\\\n \\n\\\nvarying vec4 v_fragmentColor; \\n\\\nvarying vec2 v_texCoord; \\n\\\nuniform sampler2D CC_Texture0; \\n\\\nuniform vec3 v_effectColor; \\n\\\n \\n\\\nvoid main() \\n\\\n{\t\\n\\\n  float dist = texture2D(CC_Texture0, v_texCoord).a; \\n\\\n  //todo:Implementation 'fwidth' for glsl 1.0 \\n\\\n  //float width = fwidth(dist); \\n\\\n  //assign width for constant will lead to a little bit fuzzy,it's temporary measure.\\n\\\n  float width = 0.04; \\n\\\n  float alpha = smoothstep(0.5-width, 0.5+width, dist); \\n\\\n  //outline \\n\\\n  float mu = smoothstep(0.545-width, 0.545+width, dist); \\n\\\n  vec3 rgb = v_effectColor*(1.0-mu) + v_fragmentColor.rgb*mu; \\n\\\n  gl_FragColor = vec4(rgb, max(alpha,mu)); \\n\\\n} \\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_Label_frag_shadow.h",
    "content": "\"\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES \\n\\\nprecision lowp float; \\n\\\n#endif \\n\\\n \\n\\\nvarying vec4 v_fragmentColor; \\n\\\nvarying vec2 v_texCoord; \\n\\\nuniform sampler2D CC_Texture0; \\n\\\nuniform vec3 v_effectColor; \\n\\\nuniform vec2 v_shadowOffset; \\n\\\n \\n\\\nvoid main() \\n\\\n{\t\\n\\\n  float dist = texture2D(CC_Texture0, v_texCoord).a; \\n\\\n  //todo:support for assign offset,but the shadow is limited by renderable area \\n\\\n  vec2 offset = vec2(-0.0015,-0.0015); \\n\\\n  float dist2 = texture2D(CC_Texture0, v_texCoord+offset).a; \\n\\\n  //todo:Implementation 'fwidth' for glsl 1.0 \\n\\\n  //float width = fwidth(dist); \\n\\\n  //assign width for constant will lead to a little bit fuzzy,it's temporary measure.\\n\\\n  float width = 0.04; \\n\\\n  // If v is 1 then it's inside the Glyph; if it's 0 then it's outside \\n\\\n  float v = smoothstep(0.5-width, 0.5+width, dist); \\n\\\n  // If s is 1 then it's inside the shadow; if it's 0 then it's outside \\n\\\n  float s = smoothstep(0.5-width, 0.5+width, dist2); \\n\\\n  if(v == 1.0) gl_FragColor = vec4(v_fragmentColor.rgb,1.0); \\n\\\n  else if(v == 0.0) gl_FragColor = vec4(v_effectColor,s); \\n\\\n  else \\n\\\n  { \\n\\\n    vec3 color = v_fragmentColor.rgb*v + v_effectColor*s*(1.0-v); \\n\\\n    gl_FragColor = vec4(color,max(s,v)); \\n\\\n  } \\n\\\n} \\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_Label_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\\n\\\nattribute vec2 a_texCoord;\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_color;\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying lowp vec4 v_fragmentColor;\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texCoord;\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n  gl_Position = CC_MVPMatrix * a_position;\t\t\\n\\\n\tv_fragmentColor = a_color;\t\t\t\t\t\t\\n\\\n\tv_texCoord = a_texCoord;\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionColorLengthTexture_frag.h",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n// #extension GL_OES_standard_derivatives : enable\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying mediump vec4 v_color;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texcoord;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_color;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec2 v_texcoord;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n// #if defined GL_OES_standard_derivatives\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t// gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord));\t\t\t\t\t\t\t\\n\\\n// #else\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n// #endif\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionColorLengthTexture_vert.h",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute mediump vec4 a_position;\t\t\t\t\t\t\t\t\t\\n\\\nattribute mediump vec2 a_texcoord;\t\t\t\t\t\t\t\t\t\\n\\\nattribute mediump vec4 a_color;\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying mediump vec4 v_color;\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texcoord;\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec2 a_texcoord;\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_color;\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_color;\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec2 v_texcoord;\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tv_color = vec4(a_color.rgb * a_color.a, a_color.a);\t\t\t\t\\n\\\n\tv_texcoord = a_texcoord;\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_Position = CC_MVPMatrix * a_position;\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionColor_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor = v_fragmentColor;\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionColor_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_color;\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying lowp vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n    gl_Position = CC_MVPMatrix * a_position;\t\t\t\\n\\\n\tv_fragmentColor = a_color;\t\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTextureA8Color_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\\n\\\nuniform sampler2D CC_Texture0;\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor = vec4( v_fragmentColor.rgb,\t\t\t\t\t\t\t\t\t\t// RGB from uniform\t\t\t\t\\n\\\n\t\t\t\t\t\tv_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a\t// A from texture & uniform\t\t\\n\\\n\t\t\t\t\t\t);\t\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTextureA8Color_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\\n\\\nattribute vec2 a_texCoord;\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_color;\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying lowp vec4 v_fragmentColor;\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texCoord;\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n    gl_Position = CC_MVPMatrix * a_position;\t\t\\n\\\n\tv_fragmentColor = a_color;\t\t\t\t\t\t\\n\\\n\tv_texCoord = a_texCoord;\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTextureColorAlphaTest_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Brian Chapados\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\t\t\\n\\\nuniform sampler2D CC_Texture0;\t\t\t\t\t\t\t\t\\n\\\nuniform float CC_alpha_value;\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tvec4 texColor = texture2D(CC_Texture0, v_texCoord);\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t// mimic: glAlphaFunc(GL_GREATER)\t\t\t\t\t\t\\n\\\n\t// pass if ( incoming_pixel >= CC_alpha_value ) => fail if incoming_pixel < CC_alpha_value\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tif ( texColor.a <= CC_alpha_value )\t\t\t\t\t\t\\n\\\n\t\tdiscard;\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor = texColor * v_fragmentColor;\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTextureColor_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\\n\\\nuniform sampler2D CC_Texture0;\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord);\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTextureColor_noMVP_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\\n\\\nuniform sampler2D CC_Texture0;\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord);\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\\n\\\nattribute vec2 a_texCoord;\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_color;\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying lowp vec4 v_fragmentColor;\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texCoord;\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n    gl_Position = CC_PMatrix * a_position;          \\n\\\n\tv_fragmentColor = a_color;\t\t\t\t\t\t\\n\\\n\tv_texCoord = a_texCoord;\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTextureColor_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\\n\\\nattribute vec2 a_texCoord;\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_color;\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying lowp vec4 v_fragmentColor;\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texCoord;\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n    gl_Position = CC_MVPMatrix * a_position;\t\t\\n\\\n\tv_fragmentColor = a_color;\t\t\t\t\t\t\\n\\\n\tv_texCoord = a_texCoord;\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTexture_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nuniform sampler2D CC_Texture0;\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor =  texture2D(CC_Texture0, v_texCoord);\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTexture_uColor_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\\n\\\nuniform\t\tvec4 u_color;\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\\n\\\nuniform sampler2D CC_Texture0;\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor =  texture2D(CC_Texture0, v_texCoord) * u_color;\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTexture_uColor_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\\n\\\nattribute vec2 a_texCoord;\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texCoord;\t\\n\\\n#else\t\t\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\\n\\\n    gl_Position = CC_MVPMatrix * a_position;\t\t\\n\\\n\tv_texCoord = a_texCoord;\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_PositionTexture_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\t\\n\\\nattribute vec2 a_texCoord;\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying mediump vec2 v_texCoord;\t\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec2 v_texCoord;\t\t\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n    gl_Position = CC_MVPMatrix * a_position;\t\t\t\\n\\\n\tv_texCoord = a_texCoord;\t\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_Position_uColor_frag.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\\n\\\nprecision lowp float;\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\\n\\\n\tgl_FragColor = v_fragmentColor;\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShader_Position_uColor_vert.h",
    "content": "/*\n * cocos2d for iPhone: http://www.cocos2d-iphone.org\n *\n * Copyright (c) 2011 Ricardo Quesada\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\"\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nattribute vec4 a_position;\t\t\t\t\t\t\t\\n\\\nuniform\tvec4 u_color;\t\t\t\t\t\t\t\t\\n\\\nuniform float u_pointSize;\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n#ifdef GL_ES\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying lowp vec4 v_fragmentColor;\t\t\t\t\t\\n\\\n#else\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvarying vec4 v_fragmentColor;\t\t\t\t\t\t\\n\\\n#endif\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\nvoid main()\t\t\t\t\t\t\t\t\t\t\t\\n\\\n{\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n    gl_Position = CC_MVPMatrix * a_position;\t\t\\n\\\n\tgl_PointSize = u_pointSize;\t\t\t\t\t\t\\n\\\n\tv_fragmentColor = u_color;\t\t\t\t\t\t\\n\\\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\\n\\\n\";\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShaders.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2012 \t\tcocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"ccShaders.h\"\n\nNS_CC_BEGIN\n//\nconst GLchar * ccPosition_uColor_frag = \n#include \"ccShader_Position_uColor_frag.h\"\nconst GLchar * ccPosition_uColor_vert =\n#include \"ccShader_Position_uColor_vert.h\"\n\n//\nconst GLchar * ccPositionColor_frag =\n#include \"ccShader_PositionColor_frag.h\"\nconst GLchar * ccPositionColor_vert =\n#include \"ccShader_PositionColor_vert.h\"\n\n//\nconst GLchar * ccPositionTexture_frag =\n#include \"ccShader_PositionTexture_frag.h\"\nconst GLchar * ccPositionTexture_vert =\n#include \"ccShader_PositionTexture_vert.h\"\n\n//\nconst GLchar * ccPositionTextureA8Color_frag =\n#include \"ccShader_PositionTextureA8Color_frag.h\"\nconst GLchar * ccPositionTextureA8Color_vert =\n#include \"ccShader_PositionTextureA8Color_vert.h\"\n\n//\nconst GLchar * ccPositionTextureColor_frag =\n#include \"ccShader_PositionTextureColor_frag.h\"\nconst GLchar * ccPositionTextureColor_vert =\n#include \"ccShader_PositionTextureColor_vert.h\"\n\n//\nconst GLchar * ccPositionTextureColor_noMVP_frag =\n#include \"ccShader_PositionTextureColor_noMVP_frag.h\"\nconst GLchar * ccPositionTextureColor_noMVP_vert =\n#include \"ccShader_PositionTextureColor_noMVP_vert.h\"\n\n//\nconst GLchar * ccPositionTextureColorAlphaTest_frag = \n#include \"ccShader_PositionTextureColorAlphaTest_frag.h\"\n\n//\nconst GLchar * ccPositionTexture_uColor_frag = \n#include \"ccShader_PositionTexture_uColor_frag.h\"\nconst GLchar * ccPositionTexture_uColor_vert = \n#include \"ccShader_PositionTexture_uColor_vert.h\"\n\nconst GLchar * ccExSwitchMask_frag = \n#include \"ccShaderEx_SwitchMask_frag.h\"\n\nconst GLchar * ccPositionColorLengthTexture_frag =\n#include \"ccShader_PositionColorLengthTexture_frag.h\"\nconst GLchar * ccPositionColorLengthTexture_vert =\n#include \"ccShader_PositionColorLengthTexture_vert.h\"\n\nconst GLchar * ccLabelDistanceFieldNormal_frag =\n#include \"ccShader_Label_frag.h\"\nconst GLchar * ccLabelDistanceFieldNormal_vert =\n#include \"ccShader_Label_vert.h\"\n\nconst GLchar * ccLabelDistanceFieldGlow_frag =\n#include \"ccShader_Label_frag_glow.h\"\nconst GLchar * ccLabelDistanceFieldGlow_vert =\n#include \"ccShader_Label_vert.h\"\n\nconst GLchar * ccLabelDistanceFieldOutline_frag =\n#include \"ccShader_Label_frag_outline.h\"\nconst GLchar * ccLabelDistanceFieldOutline_vert =\n#include \"ccShader_Label_vert.h\"\n\nconst GLchar * ccLabelDistanceFieldShadow_frag =\n#include \"ccShader_Label_frag_shadow.h\"\nconst GLchar * ccLabelDistanceFieldShadow_vert =\n#include \"ccShader_Label_vert.h\"\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccShaders.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2012 \t\tcocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCSHADER_H__\n#define __CCSHADER_H__\n\n#include \"CCGL.h\"\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup shaders\n * @{\n */\n\nextern CC_DLL const GLchar * ccPosition_uColor_frag;\nextern CC_DLL const GLchar * ccPosition_uColor_vert;\n\nextern CC_DLL const GLchar * ccPositionColor_frag;\nextern CC_DLL const GLchar * ccPositionColor_vert;\n\nextern CC_DLL const GLchar * ccPositionTexture_frag;\nextern CC_DLL const GLchar * ccPositionTexture_vert;\n\nextern CC_DLL const GLchar * ccPositionTextureA8Color_frag;\nextern CC_DLL const GLchar * ccPositionTextureA8Color_vert;\n\nextern CC_DLL const GLchar * ccPositionTextureColor_frag;\nextern CC_DLL const GLchar * ccPositionTextureColor_vert;\n\nextern CC_DLL const GLchar * ccPositionTextureColor_noMVP_frag;\nextern CC_DLL const GLchar * ccPositionTextureColor_noMVP_vert;\n\nextern CC_DLL const GLchar * ccPositionTextureColorAlphaTest_frag;\n\nextern CC_DLL const GLchar * ccPositionTexture_uColor_frag;\nextern CC_DLL const GLchar * ccPositionTexture_uColor_vert;\n\nextern CC_DLL const GLchar * ccPositionColorLengthTexture_frag;\nextern CC_DLL const GLchar * ccPositionColorLengthTexture_vert;\n\nextern CC_DLL const GLchar * ccLabelDistanceFieldNormal_frag;\nextern CC_DLL const GLchar * ccLabelDistanceFieldNormal_vert;\n\nextern CC_DLL const GLchar * ccLabelDistanceFieldGlow_frag;\nextern CC_DLL const GLchar * ccLabelDistanceFieldGlow_vert;\n\nextern CC_DLL const GLchar * ccLabelDistanceFieldOutline_frag;\nextern CC_DLL const GLchar * ccLabelDistanceFieldOutline_vert;\n\nextern CC_DLL const GLchar * ccLabelDistanceFieldShadow_frag;\nextern CC_DLL const GLchar * ccLabelDistanceFieldShadow_vert;\n\nextern CC_DLL const GLchar * ccExSwitchMask_frag;\n\n// end of shaders group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCSHADER_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccTypes.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"ccTypes.h\"\n\nNS_CC_BEGIN\nconst std::string STD_STRING_EMPTY(\"\");\n\n/**\n * Color3B\n */\n\nColor3B::Color3B()\n: r(0)\n, g(0)\n, b(0)\n{}\n\nColor3B::Color3B(GLubyte _r, GLubyte _g, GLubyte _b)\n: r(_r)\n, g(_g)\n, b(_b)\n{}\n\nColor3B::Color3B(const Color4B& color)\n: r(color.r)\n, g(color.g)\n, b(color.b)\n{}\n\nColor3B::Color3B(const Color4F& color)\n: r(color.r * 255.0f)\n, g(color.g * 255.0f)\n, b(color.b * 255.0f)\n{}\n\nbool Color3B::operator==(const Color3B& right) const\n{\n    return (r == right.r && g == right.g && b == right.b);\n}\n\nbool Color3B::operator==(const Color4B& right) const\n{\n    return (r == right.r && g == right.g && b == right.b && 255 == right.a);\n}\n\nbool Color3B::operator==(const Color4F& right) const\n{\n    return (right.a == 1.0f && Color4F(*this) == right);\n}\n\nbool Color3B::operator!=(const Color3B& right) const\n{\n    return !(*this == right);\n}\n\nbool Color3B::operator!=(const Color4B& right) const\n{\n    return !(*this == right);\n}\n\nbool Color3B::operator!=(const Color4F& right) const\n{\n    return !(*this == right);\n}\n\n/**\n * Color4B\n */\n\nColor4B::Color4B()\n: r(0)\n, g(0)\n, b(0)\n, a(0)\n{}\n\nColor4B::Color4B(GLubyte _r, GLubyte _g, GLubyte _b, GLubyte _a)\n: r(_r)\n, g(_g)\n, b(_b)\n, a(_a)\n{}\n\nColor4B::Color4B(const Color3B& color)\n: r(color.r)\n, g(color.g)\n, b(color.b)\n, a(255)\n{}\n\nColor4B::Color4B(const Color4F& color)\n: r(color.r * 255)\n, g(color.g * 255)\n, b(color.b * 255)\n, a(color.a * 255)\n{}\n\nbool Color4B::operator==(const Color4B& right) const\n{\n    return (r == right.r && g == right.g && b == right.b && a == right.a);\n}\n\nbool Color4B::operator==(const Color3B& right) const\n{\n    return (r == right.r && g == right.g && b == right.b && a == 255);\n}\n\nbool Color4B::operator==(const Color4F& right) const\n{\n    return (*this == Color4B(right));\n}\n\nbool Color4B::operator!=(const Color4B& right) const\n{\n    return !(*this == right);\n}\n\nbool Color4B::operator!=(const Color3B& right) const\n{\n    return !(*this == right);\n}\n\nbool Color4B::operator!=(const Color4F& right) const\n{\n    return !(*this == right);\n}\n\n/**\n * Color4F\n */\n\nColor4F::Color4F()\n: r(0.0f)\n, g(0.0f)\n, b(0.0f)\n, a(0.0f)\n{}\n\nColor4F::Color4F(float _r, float _g, float _b, float _a)\n: r(_r)\n, g(_g)\n, b(_b)\n, a(_a)\n{}\n\nColor4F::Color4F(const Color3B& color)\n: r(color.r / 255.0f)\n, g(color.g / 255.0f)\n, b(color.b / 255.0f)\n, a(1.0f)\n{}\n\nColor4F::Color4F(const Color4B& color)\n: r(color.r / 255.0f)\n, g(color.g / 255.0f)\n, b(color.b / 255.0f)\n, a(color.a / 255.0f)\n{}\n\nbool Color4F::operator==(const Color4F& right) const\n{\n    return (r == right.r && g == right.g && b == right.b && a == right.a);\n}\n\nbool Color4F::operator==(const Color3B& right) const\n{\n    return (a == 1.0f && Color3B(*this) == right);\n}\n\nbool Color4F::operator==(const Color4B& right) const\n{\n    return (*this == Color4F(right));\n}\n\nbool Color4F::operator!=(const Color4F& right) const\n{\n    return !(*this == right);\n}\n\nbool Color4F::operator!=(const Color3B& right) const\n{\n    return !(*this == right);\n}\n\nbool Color4F::operator!=(const Color4B& right) const\n{\n    return !(*this == right);\n}\n\n/**\n * Color constants\n */\n\nconst Color3B Color3B::WHITE  (255, 255, 255);\nconst Color3B Color3B::YELLOW (255, 255,   0);\nconst Color3B Color3B::GREEN  (  0, 255,   0);\nconst Color3B Color3B::BLUE   (  0,   0, 255);\nconst Color3B Color3B::RED    (255,   0,   0);\nconst Color3B Color3B::MAGENTA(255,   0, 255);\nconst Color3B Color3B::BLACK  (  0,   0,   0);\nconst Color3B Color3B::ORANGE (255, 127,   0);\nconst Color3B Color3B::GRAY   (166, 166, 166);\n\nconst Color4B Color4B::WHITE  (255, 255, 255, 255);\nconst Color4B Color4B::YELLOW (255, 255,   0, 255);\nconst Color4B Color4B::GREEN  (  0, 255,   0, 255);\nconst Color4B Color4B::BLUE   (  0,   0, 255, 255);\nconst Color4B Color4B::RED    (255,   0,   0, 255);\nconst Color4B Color4B::MAGENTA(255,   0, 255, 255);\nconst Color4B Color4B::BLACK  (  0,   0,   0, 255);\nconst Color4B Color4B::ORANGE (255, 127,   0, 255);\nconst Color4B Color4B::GRAY   (166, 166, 166, 255);\n\nconst Color4F Color4F::WHITE  (    1,     1,     1, 1);\nconst Color4F Color4F::YELLOW (    1,     1,     0, 1);\nconst Color4F Color4F::GREEN  (    0,     1,     0, 1);\nconst Color4F Color4F::BLUE   (    0,     0,     1, 1);\nconst Color4F Color4F::RED    (    1,     0,     0, 1);\nconst Color4F Color4F::MAGENTA(    1,     0,     1, 1);\nconst Color4F Color4F::BLACK  (    0,     0,     0, 1);\nconst Color4F Color4F::ORANGE (    1,  0.5f,     0, 1);\nconst Color4F Color4F::GRAY   (0.65f, 0.65f, 0.65f, 1);\n\nconst BlendFunc BlendFunc::DISABLE = {GL_ONE, GL_ZERO};\nconst BlendFunc BlendFunc::ALPHA_PREMULTIPLIED = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA};\nconst BlendFunc BlendFunc::ALPHA_NON_PREMULTIPLIED = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA};\nconst BlendFunc BlendFunc::ADDITIVE = {GL_SRC_ALPHA, GL_ONE};\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccTypes.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTYPES_H__\n#define __CCTYPES_H__\n\n#include <string>\n#include \"CCGeometry.h\"\n#include \"CCGL.h\"\n\nNS_CC_BEGIN\n\nstruct Color4B;\nstruct Color4F;\n\n/** RGB color composed of bytes 3 bytes\n@since v3.0\n */\nstruct Color3B\n{\n    Color3B();\n    Color3B(GLubyte _r, GLubyte _g, GLubyte _b);\n    explicit Color3B(const Color4B& color);\n    explicit Color3B(const Color4F& color);\n\n    bool operator==(const Color3B& right) const;\n    bool operator==(const Color4B& right) const;\n    bool operator==(const Color4F& right) const;\n    bool operator!=(const Color3B& right) const;\n    bool operator!=(const Color4B& right) const;\n    bool operator!=(const Color4F& right) const;\n\n    bool equals(const Color3B& other)\n    {\n        return (*this == other);\n    }\n\n    GLubyte r;\n    GLubyte g;\n    GLubyte b;\n    \n    const static Color3B WHITE;\n    const static Color3B YELLOW;\n    const static Color3B BLUE;\n    const static Color3B GREEN;\n    const static Color3B RED;\n    const static Color3B MAGENTA;\n    const static Color3B BLACK;\n    const static Color3B ORANGE;\n    const static Color3B GRAY;\n};\n\n/** RGBA color composed of 4 bytes\n@since v3.0\n*/\nstruct Color4B\n{\n    Color4B();\n    Color4B(GLubyte _r, GLubyte _g, GLubyte _b, GLubyte _a);\n    explicit Color4B(const Color3B& color);\n    explicit Color4B(const Color4F& color);\n\n    bool operator==(const Color4B& right) const;\n    bool operator==(const Color3B& right) const;\n    bool operator==(const Color4F& right) const;\n    bool operator!=(const Color4B& right) const;\n    bool operator!=(const Color3B& right) const;\n    bool operator!=(const Color4F& right) const;\n\n    GLubyte r;\n    GLubyte g;\n    GLubyte b;\n    GLubyte a;\n\n    const static Color4B WHITE;\n    const static Color4B YELLOW;\n    const static Color4B BLUE;\n    const static Color4B GREEN;\n    const static Color4B RED;\n    const static Color4B MAGENTA;\n    const static Color4B BLACK;\n    const static Color4B ORANGE;\n    const static Color4B GRAY;\n};\n\n\n/** RGBA color composed of 4 floats\n@since v3.0\n*/\nstruct Color4F\n{\n    Color4F();\n    Color4F(float _r, float _g, float _b, float _a);\n    explicit Color4F(const Color3B& color);\n    explicit Color4F(const Color4B& color);\n\n    bool operator==(const Color4F& right) const;\n    bool operator==(const Color3B& right) const;\n    bool operator==(const Color4B& right) const;\n    bool operator!=(const Color4F& right) const;\n    bool operator!=(const Color3B& right) const;\n    bool operator!=(const Color4B& right) const;\n\n    bool equals(const Color4F &other)\n    {\n        return (*this == other);\n    }\n    \n    GLfloat r;\n    GLfloat g;\n    GLfloat b;\n    GLfloat a;\n\n    const static Color4F WHITE;\n    const static Color4F YELLOW;\n    const static Color4F BLUE;\n    const static Color4F GREEN;\n    const static Color4F RED;\n    const static Color4F MAGENTA;\n    const static Color4F BLACK;\n    const static Color4F ORANGE;\n    const static Color4F GRAY;\n};\n\n/** A vertex composed of 2 floats: x, y\n @since v3.0\n */\nstruct Vertex2F\n{\n    Vertex2F(float _x, float _y) :x(_x), y(_y) {}\n    \n    Vertex2F(): x(0.f), y(0.f) {}\n    \n    GLfloat x;\n    GLfloat y;\n};\n\n\n/** A vertex composed of 2 floats: x, y\n @since v3.0\n */\nstruct Vertex3F\n{\n    Vertex3F(float _x, float _y, float _z)\n        : x(_x)\n        , y(_y)\n        , z(_z)\n    {}\n    \n    Vertex3F(): x(0.f), y(0.f), z(0.f) {}\n    \n    GLfloat x;\n    GLfloat y;\n    GLfloat z;\n};\n        \n/** A texcoord composed of 2 floats: u, y\n @since v3.0\n */\nstruct Tex2F {\n    Tex2F(float _u, float _v): u(_u), v(_v) {}\n    \n    Tex2F(): u(0.f), v(0.f) {}\n    \n    GLfloat u;\n    GLfloat v;\n};\n\n \n//! Point Sprite component\nstruct PointSprite\n{\n    Vertex2F   pos;        // 8 bytes\n    Color4B    color;      // 4 bytes\n    GLfloat    size;       // 4 bytes\n};\n\n//!    A 2D Quad. 4 * 2 floats\nstruct Quad2\n{\n    Vertex2F        tl;\n    Vertex2F        tr;\n    Vertex2F        bl;\n    Vertex2F        br;\n};\n\n\n//!    A 3D Quad. 4 * 3 floats\nstruct Quad3 {\n    Vertex3F        bl;\n    Vertex3F        br;\n    Vertex3F        tl;\n    Vertex3F        tr;\n};\n\n//! a Point with a vertex point, a tex coord point and a color 4B\nstruct V2F_C4B_T2F\n{\n    //! vertices (2F)\n    Vertex2F       vertices;\n    //! colors (4B)\n    Color4B        colors;\n    //! tex coords (2F)\n    Tex2F          texCoords;\n};\n\n//! a Point with a vertex point, a tex coord point and a color 4F\nstruct V2F_C4F_T2F\n{\n    //! vertices (2F)\n    Vertex2F       vertices;\n    //! colors (4F)\n    Color4F        colors;\n    //! tex coords (2F)\n    Tex2F          texCoords;\n};\n\n//! a Point with a vertex point, a tex coord point and a color 4B\nstruct V3F_C4B_T2F\n{\n    //! vertices (3F)\n    Vertex3F     vertices;            // 12 bytes\n\n    //! colors (4B)\n    Color4B      colors;              // 4 bytes\n\n    // tex coords (2F)\n    Tex2F        texCoords;           // 8 bytes\n};\n\n//! A Triangle of V2F_C4B_T2F\nstruct V2F_C4B_T2F_Triangle\n{\n\t//! Point A\n\tV2F_C4B_T2F a;\n\t//! Point B\n\tV2F_C4B_T2F b;\n\t//! Point B\n\tV2F_C4B_T2F c;\n};\n\n//! A Quad of V2F_C4B_T2F\nstruct V2F_C4B_T2F_Quad\n{\n    //! bottom left\n    V2F_C4B_T2F    bl;\n    //! bottom right\n    V2F_C4B_T2F    br;\n    //! top left\n    V2F_C4B_T2F    tl;\n    //! top right\n    V2F_C4B_T2F    tr;\n};\n\n//! 4 Vertex3FTex2FColor4B\nstruct V3F_C4B_T2F_Quad\n{\n    //! top left\n    V3F_C4B_T2F    tl;\n    //! bottom left\n    V3F_C4B_T2F    bl;\n    //! top right\n    V3F_C4B_T2F    tr;\n    //! bottom right\n    V3F_C4B_T2F    br;\n};\n\n//! 4 Vertex2FTex2FColor4F Quad\nstruct V2F_C4F_T2F_Quad\n{\n    //! bottom left\n    V2F_C4F_T2F    bl;\n    //! bottom right\n    V2F_C4F_T2F    br;\n    //! top left\n    V2F_C4F_T2F    tl;\n    //! top right\n    V2F_C4F_T2F    tr;\n};\n\n//! Blend Function used for textures\nstruct BlendFunc\n{\n    //! source blend function\n    GLenum src;\n    //! destination blend function\n    GLenum dst;\n\n    //! Blending disabled. Uses {GL_ONE, GL_ZERO}\n    const static BlendFunc DISABLE;\n    //! Blending enabled for textures with Alpha premultiplied. Uses {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}\n    const static BlendFunc ALPHA_PREMULTIPLIED;\n    //! Blending enabled for textures with Alpha NON premultiplied. Uses {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}\n    const static BlendFunc ALPHA_NON_PREMULTIPLIED;\n    //! Enables Additive blending. Uses {GL_SRC_ALPHA, GL_ONE}\n    const static BlendFunc ADDITIVE;\n\n    bool operator==(const BlendFunc &a) const\n    {\n        return src == a.src && dst == a.dst;\n    }\n\n    bool operator<(const BlendFunc &a) const\n    {\n        return src < a.src || (src < a.src && dst < a.dst);\n    }\n};\n\n// Label::VAlignment\n// Label::HAlignment\n\n// XXX: If any of these enums are edited and/or reordered, update Texture2D.m\n//! Vertical text alignment type\nenum class TextVAlignment\n{\n    TOP,\n    CENTER,\n    BOTTOM,\n};\n\n// XXX: If any of these enums are edited and/or reordered, update Texture2D.m\n//! Horizontal text alignment type\nenum class TextHAlignment\n{\n    LEFT,\n    CENTER,\n    RIGHT,\n};\n\n// types for animation in particle systems\n\n// texture coordinates for a quad\nstruct T2F_Quad\n{\n    //! bottom left\n    Tex2F    bl;\n    //! bottom right\n    Tex2F    br;\n    //! top left\n    Tex2F    tl;\n    //! top right\n    Tex2F    tr;\n};\n\n// struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad\nstruct AnimationFrameData\n{\n    T2F_Quad texCoords;\n    float delay;\n    Size size; \n};\n\n/**\n types used for defining fonts properties (i.e. font name, size, stroke or shadow)\n */\n\n\n// shadow attributes\nstruct FontShadow\n{\npublic:\n    \n    // shadow is not enabled by default\n    FontShadow()\n        : _shadowEnabled(false)\n        , _shadowBlur(0)\n        , _shadowOpacity(0)\n    {}\n\n    // true if shadow enabled\n    bool   _shadowEnabled;\n    // shadow x and y offset\n\tSize   _shadowOffset;\n    // shadow blurrines\n\tfloat  _shadowBlur;\n    // shadow opacity\n\tfloat  _shadowOpacity;\n};\n\n// stroke attributes\nstruct FontStroke\n{\npublic:\n    \n    // stroke is disabled by default\n    FontStroke()\n\t    : _strokeEnabled(false)\n        , _strokeColor(Color3B::BLACK)\n        , _strokeSize(0)\n    {}\n    \n    // true if stroke enabled\n    bool      _strokeEnabled;\n    // stroke color\n\tColor3B   _strokeColor;\n    // stroke size\n    float     _strokeSize;\n    \n};\n\n// font attributes\nstruct FontDefinition\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    FontDefinition()\n        : _fontSize(0)\n        , _alignment(TextHAlignment::CENTER)\n        , _vertAlignment(TextVAlignment::TOP)\n    \t, _dimensions(Size::ZERO)\n        , _fontFillColor(Color3B::WHITE)\n    {}\n    \n    // font name\n    std::string           _fontName;\n    // font size\n    int                   _fontSize;\n    // horizontal alignment\n    TextHAlignment        _alignment;\n    // vertical alignment\n    TextVAlignment _vertAlignment;\n    // renering box\n    Size                  _dimensions;\n    // font color\n    Color3B               _fontFillColor;\n    // font shadow\n    FontShadow            _shadow;\n    // font stroke\n    FontStroke            _stroke;\n    \n};\n\n/**\n @brief The device accelerometer reports values for each axis in units of g-force\n */\nclass Acceleration\n{\npublic:\n    double x;\n    double y;\n    double z;\n    \n    double timestamp;\n    \n    Acceleration(): x(0), y(0), z(0), timestamp(0) {}\n};\n\nextern const std::string STD_STRING_EMPTY;\n\nNS_CC_END\n\n#endif //__CCTYPES_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccUTF8.cpp",
    "content": "/* \n * This file uses some implementations of gutf8.c in glib.\n *\n * gutf8.c - Operations on UTF-8 strings.\n *\n * Copyright (C) 1999      Tom Tromey\n * Copyright (C) 2000      Red Hat, Inc.\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\t See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n * Boston, MA 02111-1307, USA.\n */\n\n#include \"ccUTF8.h\"\n#include \"platform/CCCommon.h\"\n#include \"CCConsole.h\"\n\nNS_CC_BEGIN\n\nint cc_wcslen(const unsigned short* str)\n{\n    int i=0;\n    while(*str++) i++;\n    return i;\n}\n\n/* Code from GLIB gutf8.c starts here. */\n\n#define UTF8_COMPUTE(Char, Mask, Len)        \\\nif (Char < 128)                \\\n{                        \\\nLen = 1;                    \\\nMask = 0x7f;                \\\n}                        \\\nelse if ((Char & 0xe0) == 0xc0)        \\\n{                        \\\nLen = 2;                    \\\nMask = 0x1f;                \\\n}                        \\\nelse if ((Char & 0xf0) == 0xe0)        \\\n{                        \\\nLen = 3;                    \\\nMask = 0x0f;                \\\n}                        \\\nelse if ((Char & 0xf8) == 0xf0)        \\\n{                        \\\nLen = 4;                    \\\nMask = 0x07;                \\\n}                        \\\nelse if ((Char & 0xfc) == 0xf8)        \\\n{                        \\\nLen = 5;                    \\\nMask = 0x03;                \\\n}                        \\\nelse if ((Char & 0xfe) == 0xfc)        \\\n{                        \\\nLen = 6;                    \\\nMask = 0x01;                \\\n}                        \\\nelse                        \\\nLen = -1;\n\n#define UTF8_LENGTH(Char)            \\\n((Char) < 0x80 ? 1 :                \\\n((Char) < 0x800 ? 2 :            \\\n((Char) < 0x10000 ? 3 :            \\\n((Char) < 0x200000 ? 4 :            \\\n((Char) < 0x4000000 ? 5 : 6)))))\n\n\n#define UTF8_GET(Result, Chars, Count, Mask, Len)    \\\n(Result) = (Chars)[0] & (Mask);            \\\nfor ((Count) = 1; (Count) < (Len); ++(Count))        \\\n{                            \\\nif (((Chars)[(Count)] & 0xc0) != 0x80)        \\\n{                        \\\n(Result) = -1;                \\\nbreak;                    \\\n}                        \\\n(Result) <<= 6;                    \\\n(Result) |= ((Chars)[(Count)] & 0x3f);        \\\n}\n\n#define UNICODE_VALID(Char)            \\\n((Char) < 0x110000 &&                \\\n(((Char) & 0xFFFFF800) != 0xD800) &&        \\\n((Char) < 0xFDD0 || (Char) > 0xFDEF) &&    \\\n((Char) & 0xFFFE) != 0xFFFE)\n\n\nstatic const char utf8_skip_data[256] = {\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n    2, 2, 2, 2, 2, 2, 2,\n    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,\n    5, 5, 5, 6, 6, 1, 1\n};\n\nstatic const char *const g_utf8_skip = utf8_skip_data;\n\n#define cc_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(unsigned char *)(p)])\n\n/*\n * @str:    the string to search through.\n * @c:        the character to not look for.\n *\n * Return value: the index of the last character that is not c.\n * */\nunsigned int cc_utf8_find_last_not_char(std::vector<unsigned short> str, unsigned short c)\n{\n    int len = static_cast<int>(str.size());\n    \n    int i = len - 1;\n    for (; i >= 0; --i)\n        if (str[i] != c) return i;\n    \n    return i;\n}\n\n/*\n * @str:    the string to trim\n * @index:    the index to start trimming from.\n *\n * Trims str st str=[0, index) after the operation.\n *\n * Return value: the trimmed string.\n * */\nstatic void cc_utf8_trim_from(std::vector<unsigned short>* str, int index)\n{\n    int size = static_cast<int>(str->size());\n    if (index >= size || index < 0)\n        return;\n    \n    str->erase(str->begin() + index, str->begin() + size);\n}\n\n/*\n * @ch is the unicode character whitespace?\n *\n * Reference: http://en.wikipedia.org/wiki/Whitespace_character#Unicode\n *\n * Return value: weather the character is a whitespace character.\n * */\nbool isspace_unicode(unsigned short ch)\n{\n    return  (ch >= 0x0009 && ch <= 0x000D) || ch == 0x0020 || ch == 0x0085 || ch == 0x00A0 || ch == 0x1680\n    || (ch >= 0x2000 && ch <= 0x200A) || ch == 0x2028 || ch == 0x2029 || ch == 0x202F\n    ||  ch == 0x205F || ch == 0x3000;\n}\n\nvoid cc_utf8_trim_ws(std::vector<unsigned short>* str)\n{\n    int len = static_cast<int>(str->size());\n    \n    if ( len <= 0 )\n        return;\n    \n    int last_index = len - 1;\n    \n    // Only start trimming if the last character is whitespace..\n    if (isspace_unicode((*str)[last_index]))\n    {\n        for (int i = last_index - 1; i >= 0; --i)\n        {\n            if (isspace_unicode((*str)[i]))\n                last_index = i;\n            else\n                break;\n        }\n        \n        cc_utf8_trim_from(str, last_index);\n    }\n}\n\n/*\n * cc_utf8_strlen:\n * @p: pointer to the start of a UTF-8 encoded string.\n * @max: the maximum number of bytes to examine. If @max\n *       is less than 0, then the string is assumed to be\n *       null-terminated. If @max is 0, @p will not be examined and\n *       may be %nullptr.\n *\n * Returns the length of the string in characters.\n *\n * Return value: the length of the string in characters\n **/\nlong\ncc_utf8_strlen (const char * p, int max)\n{\n    long len = 0;\n    const char *start = p;\n    \n    if (!(p != nullptr || max == 0))\n    {\n        return 0;\n    }\n    \n    if (max < 0)\n    {\n        while (*p)\n        {\n            p = cc_utf8_next_char (p);\n            ++len;\n        }\n    }\n    else\n    {\n        if (max == 0 || !*p)\n            return 0;\n        \n        p = cc_utf8_next_char (p);\n        \n        while (p - start < max && *p)\n        {\n            ++len;\n            p = cc_utf8_next_char (p);\n        }\n        \n        /* only do the last len increment if we got a complete\n         * char (don't count partial chars)\n         */\n        if (p - start == max)\n            ++len;\n    }\n    \n    return len;\n}\n\n/*\n * g_utf8_get_char:\n * @p: a pointer to Unicode character encoded as UTF-8\n *\n * Converts a sequence of bytes encoded as UTF-8 to a Unicode character.\n * If @p does not point to a valid UTF-8 encoded character, results are\n * undefined. If you are not sure that the bytes are complete\n * valid Unicode characters, you should use g_utf8_get_char_validated()\n * instead.\n *\n * Return value: the resulting character\n **/\nstatic unsigned int\ncc_utf8_get_char (const char * p)\n{\n    int i, mask = 0, len;\n    unsigned int result;\n    unsigned char c = (unsigned char) *p;\n    \n    UTF8_COMPUTE (c, mask, len);\n    if (len == -1)\n        return (unsigned int) - 1;\n    UTF8_GET (result, p, i, mask, len);\n    \n    return result;\n}\n\n\nunsigned short* cc_utf8_to_utf16(const char* str_old, int length/* = -1 */, int* rUtf16Size/* = nullptr */)\n{\n    long len = cc_utf8_strlen(str_old, length);\n    if (rUtf16Size != nullptr) {\n        *rUtf16Size = static_cast<int>(len);\n    }\n    \n    unsigned short* str_new = new unsigned short[len + 1];\n    str_new[len] = 0;\n    \n    for (int i = 0; i < len; ++i)\n    {\n        str_new[i] = cc_utf8_get_char(str_old);\n        str_old = cc_utf8_next_char(str_old);\n    }\n    \n    return str_new;\n}\n\nstd::vector<unsigned short> cc_utf16_vec_from_utf16_str(const unsigned short* str)\n{\n    int len = cc_wcslen(str);\n    std::vector<unsigned short> str_new;\n    \n    for (int i = 0; i < len; ++i)\n    {\n        str_new.push_back(str[i]);\n    }\n    return str_new;\n}\n\n/**\n * cc_unichar_to_utf8:\n * @c: a ISO10646 character code\n * @outbuf: output buffer, must have at least 6 bytes of space.\n *       If %nullptr, the length will be computed and returned\n *       and nothing will be written to @outbuf.\n *\n * Converts a single character to UTF-8.\n *\n * Return value: number of bytes written\n **/\nint\ncc_unichar_to_utf8 (unsigned int c,\n                   char   *outbuf)\n{\n    int len = 0;\n    int first;\n    int i;\n    \n    if (c < 0x80)\n    {\n        first = 0;\n        len = 1;\n    }\n    else if (c < 0x800)\n    {\n        first = 0xc0;\n        len = 2;\n    }\n    else if (c < 0x10000)\n    {\n        first = 0xe0;\n        len = 3;\n    }\n    else if (c < 0x200000)\n    {\n        first = 0xf0;\n        len = 4;\n    }\n    else if (c < 0x4000000)\n    {\n        first = 0xf8;\n        len = 5;\n    }\n    else\n    {\n        first = 0xfc;\n        len = 6;\n    }\n    \n    if (outbuf)\n    {\n        for (i = len - 1; i > 0; --i)\n        {\n            outbuf[i] = (c & 0x3f) | 0x80;\n            c >>= 6;\n        }\n        outbuf[0] = c | first;\n    }\n    \n    return len;\n}\n\n#define SURROGATE_VALUE(h,l) (((h) - 0xd800) * 0x400 + (l) - 0xdc00 + 0x10000)\n\n/**\n * cc_utf16_to_utf8:\n * @str: a UTF-16 encoded string\n * @len: the maximum length of @str to use. If @len < 0, then\n *       the string is terminated with a 0 character.\n * @items_read: location to store number of words read, or %nullptr.\n *              If %nullptr, then %G_CONVERT_ERROR_PARTIAL_INPUT will be\n *              returned in case @str contains a trailing partial\n *              character. If an error occurs then the index of the\n *              invalid input is stored here.\n * @items_written: location to store number of bytes written, or %nullptr.\n *                 The value stored here does not include the trailing\n *                 0 byte.\n * @error: location to store the error occuring, or %nullptr to ignore\n *         errors. Any of the errors in #GConvertError other than\n *         %G_CONVERT_ERROR_NO_CONVERSION may occur.\n *\n * Convert a string from UTF-16 to UTF-8. The result will be\n * terminated with a 0 byte.\n *\n * Return value: a pointer to a newly allocated UTF-8 string.\n *               This value must be freed with free(). If an\n *               error occurs, %nullptr will be returned and\n *               @error set.\n **/\nchar *\ncc_utf16_to_utf8 (const unsigned short  *str,\n                 int             len,\n                 long            *items_read,\n                 long            *items_written)\n{\n    /* This function and g_utf16_to_ucs4 are almost exactly identical - The lines that differ\n     * are marked.\n     */\n    const unsigned short *in;\n    char *out;\n    char *result = nullptr;\n    int n_bytes;\n    unsigned int high_surrogate;\n    \n    if (str == 0) return nullptr;\n    \n    n_bytes = 0;\n    in = str;\n    high_surrogate = 0;\n    while ((len < 0 || in - str < len) && *in)\n    {\n        unsigned short c = *in;\n        unsigned int wc;\n        \n        if (c >= 0xdc00 && c < 0xe000) /* low surrogate */\n        {\n            if (high_surrogate)\n            {\n                wc = SURROGATE_VALUE (high_surrogate, c);\n                high_surrogate = 0;\n            }\n            else\n            {\n                CCLOGERROR(\"Invalid sequence in conversion input\");\n                goto err_out;\n            }\n        }\n        else\n        {\n            if (high_surrogate)\n            {\n                CCLOGERROR(\"Invalid sequence in conversion input\");\n                goto err_out;\n            }\n            \n            if (c >= 0xd800 && c < 0xdc00) /* high surrogate */\n            {\n                high_surrogate = c;\n                goto next1;\n            }\n            else\n                wc = c;\n        }\n        \n        /********** DIFFERENT for UTF8/UCS4 **********/\n        n_bytes += UTF8_LENGTH (wc);\n        \n    next1:\n        in++;\n    }\n    \n    if (high_surrogate && !items_read)\n    {        \n        CCLOGERROR(\"Partial character sequence at end of input\");\n        goto err_out;\n    }\n    \n    /* At this point, everything is valid, and we just need to convert\n     */\n    /********** DIFFERENT for UTF8/UCS4 **********/\n    result = new char[n_bytes + 1];\n    \n    high_surrogate = 0;\n    out = result;\n    in = str;\n    while (out < result + n_bytes)\n    {\n        unsigned short c = *in;\n        unsigned int wc;\n        \n        if (c >= 0xdc00 && c < 0xe000) /* low surrogate */\n        {\n            wc = SURROGATE_VALUE (high_surrogate, c);\n            high_surrogate = 0;\n        }\n        else if (c >= 0xd800 && c < 0xdc00) /* high surrogate */\n        {\n            high_surrogate = c;\n            goto next2;\n        }\n        else\n            wc = c;\n        \n        /********** DIFFERENT for UTF8/UCS4 **********/\n        out += cc_unichar_to_utf8 (wc, out);\n        \n    next2:\n        in++;\n    }\n    \n    /********** DIFFERENT for UTF8/UCS4 **********/\n    *out = '\\0';\n    \n    if (items_written)\n    /********** DIFFERENT for UTF8/UCS4 **********/\n        *items_written = out - result;\n    \nerr_out:\n    if (items_read)\n        *items_read = in - str;\n    \n    return result;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccUTF8.h",
    "content": "/*\n * Copyright (C) 1999      Tom Tromey\n * Copyright (C) 2000      Red Hat, Inc.\n * Copyright (c) 2013-2014 Chukong Technologies Inc.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\t See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n * Boston, MA 02111-1307, USA.\n */\n\n#ifndef __cocos2dx__ccUTF8__\n#define __cocos2dx__ccUTF8__\n\n#include \"CCPlatformMacros.h\"\n#include <vector>\n\nNS_CC_BEGIN\n\nCC_DLL int cc_wcslen(const unsigned short* str);\n\nCC_DLL void cc_utf8_trim_ws(std::vector<unsigned short>* str);\n\n/**\n * Whether the character is a whitespace character.\n *\n * @param ch    the unicode character\n * @returns     whether the character is a white space character.\n *\n * @see http://en.wikipedia.org/wiki/Whitespace_character#Unicode\n * */\nCC_DLL bool isspace_unicode(unsigned short ch);\n\n/**\n * Returns the length of the string in characters.\n *\n * @param p     pointer to the start of a UTF-8 encoded string.\n * @param max   the maximum number of bytes to examine. If \\p max is less than\n *              0, then the string is assumed to be null-terminated. If \\p max\n *              is 0, \\p p will not be examined and my be %nullptr.\n *\n * @returns the length of the string in characters\n **/\nCC_DLL long\ncc_utf8_strlen (const char * p, int max);\n\n/**\n * Find the last character that is not equal to the character given.\n *\n * @param str   the string to be searched.\n * @param c     the character to be searched for.\n *\n * @returns the index of the last character that is not \\p c.\n * */\nCC_DLL unsigned int cc_utf8_find_last_not_char(std::vector<unsigned short> str, unsigned short c);\n\nCC_DLL std::vector<unsigned short> cc_utf16_vec_from_utf16_str(const unsigned short* str);\n\n/**\n * Creates a utf8 string from a cstring.\n *\n * @param str_old   pointer to the start of a C string.\n *\n * @returns the newly created utf8 string.\n * */\nCC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, int* rUtf16Size = nullptr);\n\n/**\n * Convert a string from UTF-16 to UTF-8. The result will be null terminated.\n *\n * @param str   a UTF-16 encoded string\n * @param len   the maximum length of \\p str to use. If \\p len < 0, then the\n *              string is null terminated.\n * @param items_read    location to store number of words read, or %nullptr.\n *                      If %nullptr, then %G_CONVERT_ERROR_PARTIAL_INPUT will be\n *                      returned in case \\p str contains a trailing partial\n *                      character. If an error occurs then the index of the\n *                      invalid input is stored here.\n * @param items_written location to store number of bytes written, or %nullptr.\n *                      The value stored here does not include the trailing null.\n *\n * @returns a pointer to a newly allocated UTF-8 string. This value must be\n *          freed with free(). If an error occurs, %nullptr will be returned.\n **/\nCC_DLL char *\ncc_utf16_to_utf8 (const unsigned short  *str,\n                  int             len,\n                  long            *items_read,\n                  long            *items_written);\n\nNS_CC_END\n\n#endif /* defined(__cocos2dx__ccUTF8__) */\n"
  },
  {
    "path": "cocos2d/cocos/2d/ccUtils.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010      cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ccUtils.h\"\n\nnamespace cocos2d {\n\nint ccNextPOT(int x)\n{\n    x = x - 1;\n    x = x | (x >> 1);\n    x = x | (x >> 2);\n    x = x | (x >> 4);\n    x = x | (x >> 8);\n    x = x | (x >>16);\n    return x + 1;\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/2d/ccUtils.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __SUPPORT_CC_UTILS_H__\n#define __SUPPORT_CC_UTILS_H__\n\n/** @file ccUtils.h\nMisc free functions\n*/\n\nnamespace cocos2d {\n/*\nccNextPOT function is licensed under the same license that is used in Texture2D.m.\n*/\n\n/** returns the Next Power of Two value.\n\nExamples:\n- If \"value\" is 15, it will return 16.\n- If \"value\" is 16, it will return 16.\n- If \"value\" is 17, it will return 32.\n\n@since v0.99.5\n*/\n\nint ccNextPOT(int value);\n\n}\n\n#endif // __SUPPORT_CC_UTILS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/cocos2d.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\nconst char* cocos2dVersion()\n{\n    return \"3.0-beta2\";\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/cocos2d.h",
    "content": "/****************************************************************************\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __COCOS2D_H__\n#define __COCOS2D_H__\n\n// 0x00 HI ME LO\n// 00   03 00 00\n#define COCOS2D_VERSION 0x00030000\n\n//\n// all cocos2d include files\n//\n#include \"ccConfig.h\"\n\n// actions\n#include \"CCAction.h\"\n#include \"CCActionInterval.h\"\n#include \"CCActionCamera.h\"\n#include \"CCActionManager.h\"\n#include \"CCActionEase.h\"\n#include \"CCActionPageTurn3D.h\"\n#include \"CCActionGrid.h\"\n#include \"CCActionProgressTimer.h\"\n#include \"CCActionGrid3D.h\"\n#include \"CCActionTiledGrid.h\"\n#include \"CCActionInstant.h\"\n#include \"CCActionTween.h\"\n#include \"CCActionCatmullRom.h\"\n\n// base_nodes\n#include \"CCNode.h\"\n#include \"CCAtlasNode.h\"\n\n// cocoa\n#include \"CCAffineTransform.h\"\n#include \"CCDictionary.h\"\n#include \"CCObject.h\"\n#include \"CCArray.h\"\n#include \"CCVector.h\"\n#include \"CCMap.h\"\n#include \"CCGeometry.h\"\n#include \"CCSet.h\"\n#include \"CCAutoreleasePool.h\"\n#include \"CCInteger.h\"\n#include \"CCFloat.h\"\n#include \"CCDouble.h\"\n#include \"CCBool.h\"\n#include \"CCString.h\"\n#include \"CCNS.h\"\n#include \"CCData.h\"\n#include \"CCValue.h\"\n\n// draw nodes\n#include \"CCDrawingPrimitives.h\"\n#include \"CCDrawNode.h\"\n\n// effects\n#include \"CCGrabber.h\"\n#include \"CCGrid.h\"\n\n// include\n#include \"CCEventType.h\"\n#include \"CCProtocols.h\"\n#include \"ccConfig.h\"\n#include \"ccMacros.h\"\n#include \"ccTypes.h\"\n\n// label_nodes\n#include \"CCLabelAtlas.h\"\n#include \"CCLabelTTF.h\"\n#include \"CCLabelBMFont.h\"\n#include \"CCLabel.h\"\n\n// layers_scenes_transitions_nodes\n#include \"CCLayer.h\"\n#include \"CCScene.h\"\n#include \"CCTransition.h\"\n#include \"CCTransitionPageTurn.h\"\n#include \"CCTransitionProgress.h\"\n\n// menu_nodes\n#include \"CCMenu.h\"\n#include \"CCMenuItem.h\"\n\n// misc_nodes\n#include \"CCClippingNode.h\"\n#include \"CCMotionStreak.h\"\n#include \"CCProgressTimer.h\"\n#include \"CCRenderTexture.h\"\n#include \"CCNodeGrid.h\"\n\n// particle_nodes\n#include \"CCParticleBatchNode.h\"\n#include \"CCParticleSystem.h\"\n#include \"CCParticleExamples.h\"\n#include \"CCParticleSystemQuad.h\"\n\n// new renderer\n#include \"renderer/CCCustomCommand.h\"\n#include \"renderer/CCFrustum.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCMaterialManager.h\"\n#include \"renderer/CCQuadCommand.h\"\n#include \"renderer/CCRenderCommand.h\"\n#include \"renderer/CCRenderCommandPool.h\"\n#include \"renderer/CCRenderMaterial.h\"\n#include \"renderer/CCRenderer.h\"\n\n// physics\n#include \"CCPhysicsBody.h\"\n#include \"CCPhysicsContact.h\"\n#include \"CCPhysicsShape.h\"\n#include \"CCPhysicsJoint.h\"\n#include \"CCPhysicsWorld.h\"\n\n// kazmath\n#include \"kazmath/kazmath.h\"\n#include \"kazmath/GL/matrix.h\"\n\n// platform\n#include \"platform/CCDevice.h\"\n#include \"platform/CCCommon.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"platform/CCImage.h\"\n#include \"platform/CCSAXParser.h\"\n#include \"platform/CCThread.h\"\n#include \"CCPlatformConfig.h\"\n#include \"CCPlatformMacros.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    #include \"platform/ios/CCApplication.h\"\n    #include \"platform/ios/CCEGLView.h\"\n    #include \"platform/ios/CCGL.h\"\n    #include \"platform/ios/CCStdC.h\"\n#endif // CC_TARGET_PLATFORM == CC_PLATFORM_IOS\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n    #include \"platform/android/CCApplication.h\"\n    #include \"platform/android/CCEGLView.h\"\n    #include \"platform/android/CCGL.h\"\n    #include \"platform/android/CCStdC.h\"\n#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)\n    #include \"platform/blackberry/CCApplication.h\"\n    #include \"platform/blackberry/CCEGLView.h\"\n    #include \"platform/blackberry/CCGL.h\"\n    #include \"platform/blackberry/CCStdC.h\"\n#endif // CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n    #include \"platform/win32/CCApplication.h\"\n    #include \"platform/desktop/CCEGLView.h\"\n    #include \"platform/win32/CCGL.h\"\n    #include \"platform/win32/CCStdC.h\"\n#endif // CC_TARGET_PLATFORM == CC_PLATFORM_WIN32\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n    #include \"platform/mac/CCApplication.h\"\n    #include \"platform/desktop/CCEGLView.h\"\n    #include \"platform/mac/CCGL.h\"\n    #include \"platform/mac/CCStdC.h\"\n#endif // CC_TARGET_PLATFORM == CC_PLATFORM_MAC\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)\n    #include \"platform/linux/CCApplication.h\"\n    #include \"platform/desktop/CCEGLView.h\"\n    #include \"platform/linux/CCGL.h\"\n    #include \"platform/linux/CCStdC.h\"\n#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX\n\n// script_support\n#include \"CCScriptSupport.h\"\n\n// shaders\n#include \"CCGLProgram.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCShaderCache.h\"\n#include \"ccShaders.h\"\n\n// sprite_nodes\n#include \"CCAnimation.h\"\n#include \"CCAnimationCache.h\"\n#include \"CCSprite.h\"\n#include \"CCSpriteBatchNode.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCSpriteFrameCache.h\"\n\n// support\n#include \"ccUTF8.h\"\n#include \"CCNotificationCenter.h\"\n#include \"CCProfiling.h\"\n#include \"CCConsole.h\"\n#include \"CCUserDefault.h\"\n#include \"CCVertex.h\"\n\n// text_input_node\n#include \"CCIMEDelegate.h\"\n#include \"CCIMEDispatcher.h\"\n#include \"CCTextFieldTTF.h\"\n\n// textures\n#include \"CCTexture2D.h\"\n#include \"CCTextureAtlas.h\"\n#include \"CCTextureCache.h\"\n\n// tilemap_parallax_nodes\n#include \"CCParallaxNode.h\"\n#include \"CCTMXLayer.h\"\n#include \"CCTMXObjectGroup.h\"\n#include \"CCTMXTiledMap.h\"\n#include \"CCTMXXMLParser.h\"\n#include \"CCTileMapAtlas.h\"\n\n// EventDispatcher\n#include \"CCEventDispatcher.h\"\n#include \"CCEventListenerTouch.h\"\n#include \"CCEventTouch.h\"\n#include \"CCEventListenerKeyboard.h\"\n#include \"CCEventKeyboard.h\"\n#include \"CCEventListenerMouse.h\"\n#include \"CCEventMouse.h\"\n#include \"CCEventAcceleration.h\"\n#include \"CCEventListenerAcceleration.h\"\n#include \"CCEventCustom.h\"\n#include \"CCEventListenerCustom.h\"\n\n// root\n#include \"CCConfiguration.h\"\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n\n// component\n#include \"CCComponent.h\"\n#include \"CCComponentContainer.h\"\n\n// Deprecated include\n#include \"CCDeprecated.h\"\n\nNS_CC_BEGIN\n\nCC_DLL const char* cocos2dVersion();\n\nNS_CC_END\n\n#endif // __COCOS2D_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/cocos2d.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libcocos2d</ProjectName>\n    <ProjectGuid>{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}</ProjectGuid>\n    <RootNamespace>cocos2d-x.win32</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"cocos2dx.props\" />\n    <Import Project=\"cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"cocos2dx.props\" />\n    <Import Project=\"cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(Configuration).win32\\</IntDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration).win32\\</IntDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;$(EngineRoot)external\\sqlite3\\include;$(EngineRoot)external\\unzip;$(EngineRoot)external\\edtaa3func;$(EngineRoot)external\\tinyxml2;$(EngineRoot)external\\png\\include\\win32;$(EngineRoot)external\\jpeg\\include\\win32;$(EngineRoot)external\\tiff\\include\\win32;$(EngineRoot)external\\webp\\include\\win32;$(EngineRoot)external\\freetype2\\include\\win32;$(EngineRoot)external\\win32-specific\\icon\\include;$(EngineRoot)external\\win32-specific\\zlib\\include;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>false</MinimalRebuild>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>OldStyle</DebugInformationFormat>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <PreLinkEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\freetype2\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\glfw3\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\curl\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\jpeg\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\png\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\tiff\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\webp\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\win32-specific\\zlib\\prebuilt\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\win32-specific\\icon\\prebuilt\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\win32-specific\\gles\\prebuilt\\*.*\" \"$(OutDir)\"\n</Command>\n    </PreLinkEvent>\n    <Link>\n      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\n      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>\n      <IgnoreSpecificDefaultLibraries> ;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n    <PostBuildEvent>\n      <Command>\n      </Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;$(EngineRoot)external\\sqlite3\\include;$(EngineRoot)external\\unzip;$(EngineRoot)external\\edtaa3func;$(EngineRoot)external\\tinyxml2;$(EngineRoot)external\\png\\include\\win32;$(EngineRoot)external\\jpeg\\include\\win32;$(EngineRoot)external\\tiff\\include\\win32;$(EngineRoot)external\\webp\\include\\win32;$(EngineRoot)external\\freetype2\\include\\win32;$(EngineRoot)external\\win32-specific\\icon\\include;$(EngineRoot)external\\win32-specific\\zlib\\include;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <PreLinkEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\freetype2\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\glfw3\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\curl\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\jpeg\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\png\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\tiff\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\webp\\prebuilt\\win32\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\win32-specific\\zlib\\prebuilt\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\win32-specific\\icon\\prebuilt\\*.*\" \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\external\\win32-specific\\gles\\prebuilt\\*.*\" \"$(OutDir)\"\n</Command>\n    </PreLinkEvent>\n    <Link>\n      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\n      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <IgnoreSpecificDefaultLibraries> ;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <OptimizeReferences>true</OptimizeReferences>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>\n      <TargetMachine>MachineX86</TargetMachine>\n    </Link>\n    <PostBuildEvent>\n      <Command>\n      </Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\external\\edtaa3func\\edtaa3func.cpp\" />\n    <ClCompile Include=\"..\\..\\external\\tinyxml2\\tinyxml2.cpp\" />\n    <ClCompile Include=\"..\\..\\external\\unzip\\ioapi.cpp\" />\n    <ClCompile Include=\"..\\..\\external\\unzip\\unzip.cpp\" />\n    <ClCompile Include=\"..\\base\\atitc.cpp\" />\n    <ClCompile Include=\"..\\base\\CCAffineTransform.cpp\" />\n    <ClCompile Include=\"..\\base\\CCArray.cpp\" />\n    <ClCompile Include=\"..\\base\\CCAutoreleasePool.cpp\" />\n    <ClCompile Include=\"..\\base\\CCConsole.cpp\" />\n    <ClCompile Include=\"..\\base\\CCData.cpp\" />\n    <ClCompile Include=\"..\\base\\CCDataVisitor.cpp\" />\n    <ClCompile Include=\"..\\base\\CCDictionary.cpp\" />\n    <ClCompile Include=\"..\\base\\CCGeometry.cpp\" />\n    <ClCompile Include=\"..\\base\\CCNS.cpp\" />\n    <ClCompile Include=\"..\\base\\CCObject.cpp\" />\n    <ClCompile Include=\"..\\base\\CCSet.cpp\" />\n    <ClCompile Include=\"..\\base\\CCString.cpp\" />\n    <ClCompile Include=\"..\\base\\CCValue.cpp\" />\n    <ClCompile Include=\"..\\base\\etc1.cpp\" />\n    <ClCompile Include=\"..\\base\\s3tc.cpp\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\aabb.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\GL\\mat4stack.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\GL\\matrix.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\mat3.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\mat4.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\neon_matrix_impl.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\plane.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\quaternion.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\ray2.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\utility.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\vec2.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\vec3.c\" />\n    <ClCompile Include=\"..\\math\\kazmath\\src\\vec4.c\" />\n    <ClCompile Include=\"..\\physics\\CCPhysicsBody.cpp\" />\n    <ClCompile Include=\"..\\physics\\CCPhysicsContact.cpp\" />\n    <ClCompile Include=\"..\\physics\\CCPhysicsJoint.cpp\" />\n    <ClCompile Include=\"..\\physics\\CCPhysicsShape.cpp\" />\n    <ClCompile Include=\"..\\physics\\CCPhysicsWorld.cpp\" />\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsBodyInfo_chipmunk.cpp\" />\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsContactInfo_chipmunk.cpp\" />\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsJointInfo_chipmunk.cpp\" />\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsShapeInfo_chipmunk.cpp\" />\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsWorldInfo_chipmunk.cpp\" />\n    <ClCompile Include=\"base64.cpp\" />\n    <ClCompile Include=\"CCAction.cpp\" />\n    <ClCompile Include=\"CCActionCamera.cpp\" />\n    <ClCompile Include=\"CCActionCatmullRom.cpp\" />\n    <ClCompile Include=\"CCActionEase.cpp\" />\n    <ClCompile Include=\"CCActionGrid.cpp\" />\n    <ClCompile Include=\"CCActionGrid3D.cpp\" />\n    <ClCompile Include=\"CCActionInstant.cpp\" />\n    <ClCompile Include=\"CCActionInterval.cpp\" />\n    <ClCompile Include=\"CCActionManager.cpp\" />\n    <ClCompile Include=\"CCActionPageTurn3D.cpp\" />\n    <ClCompile Include=\"CCActionProgressTimer.cpp\" />\n    <ClCompile Include=\"CCActionTiledGrid.cpp\" />\n    <ClCompile Include=\"CCActionTween.cpp\" />\n    <ClCompile Include=\"CCAnimation.cpp\" />\n    <ClCompile Include=\"CCAnimationCache.cpp\" />\n    <ClCompile Include=\"CCAtlasNode.cpp\" />\n    <ClCompile Include=\"ccCArray.cpp\" />\n    <ClCompile Include=\"CCClippingNode.cpp\" />\n    <ClCompile Include=\"CCComponent.cpp\" />\n    <ClCompile Include=\"CCComponentContainer.cpp\" />\n    <ClCompile Include=\"CCConfiguration.cpp\" />\n    <ClCompile Include=\"CCDeprecated.cpp\" />\n    <ClCompile Include=\"CCDirector.cpp\" />\n    <ClCompile Include=\"CCDrawingPrimitives.cpp\" />\n    <ClCompile Include=\"CCDrawNode.cpp\" />\n    <ClCompile Include=\"CCEvent.cpp\" />\n    <ClCompile Include=\"CCEventAcceleration.cpp\" />\n    <ClCompile Include=\"CCEventCustom.cpp\" />\n    <ClCompile Include=\"CCEventDispatcher.cpp\" />\n    <ClCompile Include=\"CCEventKeyboard.cpp\" />\n    <ClCompile Include=\"CCEventListener.cpp\" />\n    <ClCompile Include=\"CCEventListenerAcceleration.cpp\" />\n    <ClCompile Include=\"CCEventListenerCustom.cpp\" />\n    <ClCompile Include=\"CCEventListenerKeyboard.cpp\" />\n    <ClCompile Include=\"CCEventListenerMouse.cpp\" />\n    <ClCompile Include=\"CCEventListenerTouch.cpp\" />\n    <ClCompile Include=\"CCEventMouse.cpp\" />\n    <ClCompile Include=\"CCEventTouch.cpp\" />\n    <ClCompile Include=\"CCFont.cpp\" />\n    <ClCompile Include=\"CCFontAtlas.cpp\" />\n    <ClCompile Include=\"CCFontAtlasCache.cpp\" />\n    <ClCompile Include=\"CCFontCharMap.cpp\" />\n    <ClCompile Include=\"CCFontFNT.cpp\" />\n    <ClCompile Include=\"CCFontFreeType.cpp\" />\n    <ClCompile Include=\"ccFPSImages.c\" />\n    <ClCompile Include=\"CCGLProgram.cpp\" />\n    <ClCompile Include=\"ccGLStateCache.cpp\" />\n    <ClCompile Include=\"CCGrabber.cpp\" />\n    <ClCompile Include=\"CCGrid.cpp\" />\n    <ClCompile Include=\"CCNodeGrid.cpp\" />\n    <ClCompile Include=\"CCIMEDispatcher.cpp\" />\n    <ClCompile Include=\"CCLabel.cpp\" />\n    <ClCompile Include=\"CCLabelAtlas.cpp\" />\n    <ClCompile Include=\"CCLabelBMFont.cpp\" />\n    <ClCompile Include=\"CCLabelTextFormatter.cpp\" />\n    <ClCompile Include=\"CCLabelTTF.cpp\" />\n    <ClCompile Include=\"CCLayer.cpp\" />\n    <ClCompile Include=\"CCMenu.cpp\" />\n    <ClCompile Include=\"CCMenuItem.cpp\" />\n    <ClCompile Include=\"CCMotionStreak.cpp\" />\n    <ClCompile Include=\"CCNode.cpp\" />\n    <ClCompile Include=\"CCNotificationCenter.cpp\" />\n    <ClCompile Include=\"CCParallaxNode.cpp\" />\n    <ClCompile Include=\"CCParticleBatchNode.cpp\" />\n    <ClCompile Include=\"CCParticleExamples.cpp\" />\n    <ClCompile Include=\"CCParticleSystem.cpp\" />\n    <ClCompile Include=\"CCParticleSystemQuad.cpp\" />\n    <ClCompile Include=\"CCProfiling.cpp\" />\n    <ClCompile Include=\"CCProgressTimer.cpp\" />\n    <ClCompile Include=\"CCRenderTexture.cpp\" />\n    <ClCompile Include=\"CCScene.cpp\" />\n    <ClCompile Include=\"CCScheduler.cpp\" />\n    <ClCompile Include=\"CCScriptSupport.cpp\" />\n    <ClCompile Include=\"CCShaderCache.cpp\" />\n    <ClCompile Include=\"ccShaders.cpp\" />\n    <ClCompile Include=\"CCSprite.cpp\" />\n    <ClCompile Include=\"CCSpriteBatchNode.cpp\" />\n    <ClCompile Include=\"CCSpriteFrame.cpp\" />\n    <ClCompile Include=\"CCSpriteFrameCache.cpp\" />\n    <ClCompile Include=\"CCTextFieldTTF.cpp\" />\n    <ClCompile Include=\"CCTexture2D.cpp\" />\n    <ClCompile Include=\"CCTextureAtlas.cpp\" />\n    <ClCompile Include=\"CCTextureCache.cpp\" />\n    <ClCompile Include=\"CCTileMapAtlas.cpp\" />\n    <ClCompile Include=\"CCTMXLayer.cpp\" />\n    <ClCompile Include=\"CCTMXObjectGroup.cpp\" />\n    <ClCompile Include=\"CCTMXTiledMap.cpp\" />\n    <ClCompile Include=\"CCTMXXMLParser.cpp\" />\n    <ClCompile Include=\"CCTouch.cpp\" />\n    <ClCompile Include=\"CCTransition.cpp\" />\n    <ClCompile Include=\"CCTransitionPageTurn.cpp\" />\n    <ClCompile Include=\"CCTransitionProgress.cpp\" />\n    <ClCompile Include=\"ccTypes.cpp\" />\n    <ClCompile Include=\"CCUserDefault.cpp\" />\n    <ClCompile Include=\"ccUTF8.cpp\" />\n    <ClCompile Include=\"ccUtils.cpp\" />\n    <ClCompile Include=\"CCVertex.cpp\" />\n    <ClCompile Include=\"cocos2d.cpp\" />\n    <ClCompile Include=\"platform\\CCEGLViewProtocol.cpp\" />\n    <ClCompile Include=\"platform\\CCFileUtils.cpp\" />\n    <ClCompile Include=\"platform\\CCSAXParser.cpp\" />\n    <ClCompile Include=\"platform\\CCThread.cpp\" />\n    <ClCompile Include=\"platform\\desktop\\CCEGLView.cpp\" />\n    <ClCompile Include=\"platform\\win32\\CCApplication.cpp\" />\n    <ClCompile Include=\"platform\\win32\\CCCommon.cpp\" />\n    <ClCompile Include=\"platform\\win32\\CCDevice.cpp\" />\n    <ClCompile Include=\"platform\\win32\\CCFileUtilsWin32.cpp\" />\n    <ClCompile Include=\"platform\\win32\\CCImage.cpp\" />\n    <ClCompile Include=\"platform\\win32\\CCStdC.cpp\" />\n    <ClCompile Include=\"renderer\\CCBatchCommand.cpp\" />\n    <ClCompile Include=\"renderer\\CCCustomCommand.cpp\" />\n    <ClCompile Include=\"renderer\\CCFrustum.cpp\" />\n    <ClCompile Include=\"renderer\\CCGroupCommand.cpp\" />\n    <ClCompile Include=\"renderer\\CCMaterialManager.cpp\" />\n    <ClCompile Include=\"renderer\\CCQuadCommand.cpp\" />\n    <ClCompile Include=\"renderer\\CCRenderCommand.cpp\" />\n    <ClCompile Include=\"renderer\\CCRenderer.cpp\" />\n    <ClCompile Include=\"renderer\\CCRenderMaterial.cpp\" />\n    <ClCompile Include=\"TGAlib.cpp\" />\n    <ClCompile Include=\"TransformUtils.cpp\" />\n    <ClCompile Include=\"ZipUtils.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\external\\edtaa3func\\edtaa3func.h\" />\n    <ClInclude Include=\"..\\..\\external\\tinyxml2\\tinyxml2.h\" />\n    <ClInclude Include=\"..\\..\\external\\unzip\\ioapi.h\" />\n    <ClInclude Include=\"..\\..\\external\\unzip\\unzip.h\" />\n    <ClInclude Include=\"..\\base\\atitc.h\" />\n    <ClInclude Include=\"..\\base\\CCAffineTransform.h\" />\n    <ClInclude Include=\"..\\base\\CCArray.h\" />\n    <ClInclude Include=\"..\\base\\CCAutoreleasePool.h\" />\n    <ClInclude Include=\"..\\base\\CCBool.h\" />\n    <ClInclude Include=\"..\\base\\CCConsole.h\" />\n    <ClInclude Include=\"..\\base\\CCData.h\" />\n    <ClInclude Include=\"..\\base\\CCDataVisitor.h\" />\n    <ClInclude Include=\"..\\base\\CCDictionary.h\" />\n    <ClInclude Include=\"..\\base\\CCDouble.h\" />\n    <ClInclude Include=\"..\\base\\CCFloat.h\" />\n    <ClInclude Include=\"..\\base\\CCGeometry.h\" />\n    <ClInclude Include=\"..\\base\\CCInteger.h\" />\n    <ClInclude Include=\"..\\base\\CCMap.h\" />\n    <ClInclude Include=\"..\\base\\CCNS.h\" />\n    <ClInclude Include=\"..\\base\\CCObject.h\" />\n    <ClInclude Include=\"..\\base\\CCPlatformConfig.h\" />\n    <ClInclude Include=\"..\\base\\CCPlatformMacros.h\" />\n    <ClInclude Include=\"..\\base\\CCSet.h\" />\n    <ClInclude Include=\"..\\base\\CCString.h\" />\n    <ClInclude Include=\"..\\base\\CCValue.h\" />\n    <ClInclude Include=\"..\\base\\CCVector.h\" />\n    <ClInclude Include=\"..\\base\\etc1.h\" />\n    <ClInclude Include=\"..\\base\\s3tc.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\aabb.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\GL\\mat4stack.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\GL\\matrix.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\kazmath.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\mat3.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\mat4.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\neon_matrix_impl.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\plane.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\quaternion.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\ray2.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\utility.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\vec2.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\vec3.h\" />\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\vec4.h\" />\n    <ClInclude Include=\"..\\physics\\CCPhysicsBody.h\" />\n    <ClInclude Include=\"..\\physics\\CCPhysicsContact.h\" />\n    <ClInclude Include=\"..\\physics\\CCPhysicsJoint.h\" />\n    <ClInclude Include=\"..\\physics\\CCPhysicsShape.h\" />\n    <ClInclude Include=\"..\\physics\\CCPhysicsWorld.h\" />\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsBodyInfo_chipmunk.h\" />\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsContactInfo_chipmunk.h\" />\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsHelper_chipmunk.h\" />\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsJointInfo_chipmunk.h\" />\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsShapeInfo_chipmunk.h\" />\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsWorldInfo_chipmunk.h\" />\n    <ClInclude Include=\"base64.h\" />\n    <ClInclude Include=\"CCAction.h\" />\n    <ClInclude Include=\"CCActionCamera.h\" />\n    <ClInclude Include=\"CCActionCatmullRom.h\" />\n    <ClInclude Include=\"CCActionEase.h\" />\n    <ClInclude Include=\"CCActionGrid.h\" />\n    <ClInclude Include=\"CCActionGrid3D.h\" />\n    <ClInclude Include=\"CCActionInstant.h\" />\n    <ClInclude Include=\"CCActionInterval.h\" />\n    <ClInclude Include=\"CCActionManager.h\" />\n    <ClInclude Include=\"CCActionPageTurn3D.h\" />\n    <ClInclude Include=\"CCActionProgressTimer.h\" />\n    <ClInclude Include=\"CCActionTiledGrid.h\" />\n    <ClInclude Include=\"CCActionTween.h\" />\n    <ClInclude Include=\"CCAnimation.h\" />\n    <ClInclude Include=\"CCAnimationCache.h\" />\n    <ClInclude Include=\"CCAtlasNode.h\" />\n    <ClInclude Include=\"ccCArray.h\" />\n    <ClInclude Include=\"CCClippingNode.h\" />\n    <ClInclude Include=\"CCComponent.h\" />\n    <ClInclude Include=\"CCComponentContainer.h\" />\n    <ClInclude Include=\"ccConfig.h\" />\n    <ClInclude Include=\"CCConfiguration.h\" />\n    <ClInclude Include=\"CCDeprecated.h\" />\n    <ClInclude Include=\"CCDirector.h\" />\n    <ClInclude Include=\"CCDrawingPrimitives.h\" />\n    <ClInclude Include=\"CCDrawNode.h\" />\n    <ClInclude Include=\"CCEvent.h\" />\n    <ClInclude Include=\"CCEventAcceleration.h\" />\n    <ClInclude Include=\"CCEventCustom.h\" />\n    <ClInclude Include=\"CCEventDispatcher.h\" />\n    <ClInclude Include=\"CCEventKeyboard.h\" />\n    <ClInclude Include=\"CCEventListener.h\" />\n    <ClInclude Include=\"CCEventListenerAcceleration.h\" />\n    <ClInclude Include=\"CCEventListenerCustom.h\" />\n    <ClInclude Include=\"CCEventListenerKeyboard.h\" />\n    <ClInclude Include=\"CCEventListenerMouse.h\" />\n    <ClInclude Include=\"CCEventListenerTouch.h\" />\n    <ClInclude Include=\"CCEventMouse.h\" />\n    <ClInclude Include=\"CCEventTouch.h\" />\n    <ClInclude Include=\"CCEventType.h\" />\n    <ClInclude Include=\"CCFont.h\" />\n    <ClInclude Include=\"CCFontAtlas.h\" />\n    <ClInclude Include=\"CCFontAtlasCache.h\" />\n    <ClInclude Include=\"CCFontCharMap.h\" />\n    <ClInclude Include=\"CCFontFNT.h\" />\n    <ClInclude Include=\"CCFontFreeType.h\" />\n    <ClInclude Include=\"ccFPSImages.h\" />\n    <ClInclude Include=\"CCGLProgram.h\" />\n    <ClInclude Include=\"ccGLStateCache.h\" />\n    <ClInclude Include=\"CCGrabber.h\" />\n    <ClInclude Include=\"CCGrid.h\" />\n    <ClInclude Include=\"CCNodeGrid.h\" />\n    <ClInclude Include=\"CCIMEDelegate.h\" />\n    <ClInclude Include=\"CCIMEDispatcher.h\" />\n    <ClInclude Include=\"CCLabel.h\" />\n    <ClInclude Include=\"CCLabelAtlas.h\" />\n    <ClInclude Include=\"CCLabelBMFont.h\" />\n    <ClInclude Include=\"CCLabelTextFormatter.h\" />\n    <ClInclude Include=\"CCLabelTTF.h\" />\n    <ClInclude Include=\"CCLayer.h\" />\n    <ClInclude Include=\"ccMacros.h\" />\n    <ClInclude Include=\"CCMenu.h\" />\n    <ClInclude Include=\"CCMenuItem.h\" />\n    <ClInclude Include=\"CCMotionStreak.h\" />\n    <ClInclude Include=\"CCNode.h\" />\n    <ClInclude Include=\"CCNotificationCenter.h\" />\n    <ClInclude Include=\"CCParallaxNode.h\" />\n    <ClInclude Include=\"CCParticleBatchNode.h\" />\n    <ClInclude Include=\"CCParticleExamples.h\" />\n    <ClInclude Include=\"CCParticleSystem.h\" />\n    <ClInclude Include=\"CCParticleSystemQuad.h\" />\n    <ClInclude Include=\"CCProfiling.h\" />\n    <ClInclude Include=\"CCProgressTimer.h\" />\n    <ClInclude Include=\"CCProtocols.h\" />\n    <ClInclude Include=\"CCRenderTexture.h\" />\n    <ClInclude Include=\"CCScene.h\" />\n    <ClInclude Include=\"CCScheduler.h\" />\n    <ClInclude Include=\"CCScriptSupport.h\" />\n    <ClInclude Include=\"CCShaderCache.h\" />\n    <ClInclude Include=\"ccShaderEx_SwitchMask_frag.h\" />\n    <ClInclude Include=\"ccShaders.h\" />\n    <ClInclude Include=\"ccShader_PositionColorLengthTexture_frag.h\" />\n    <ClInclude Include=\"ccShader_PositionColorLengthTexture_vert.h\" />\n    <ClInclude Include=\"ccShader_PositionColor_frag.h\" />\n    <ClInclude Include=\"ccShader_PositionColor_vert.h\" />\n    <ClInclude Include=\"ccShader_PositionTextureA8Color_frag.h\" />\n    <ClInclude Include=\"ccShader_PositionTextureA8Color_vert.h\" />\n    <ClInclude Include=\"ccShader_PositionTextureColorAlphaTest_frag.h\" />\n    <ClInclude Include=\"ccShader_PositionTextureColor_frag.h\" />\n    <ClInclude Include=\"ccShader_PositionTextureColor_vert.h\" />\n    <ClInclude Include=\"ccShader_PositionTexture_frag.h\" />\n    <ClInclude Include=\"ccShader_PositionTexture_uColor_frag.h\" />\n    <ClInclude Include=\"ccShader_PositionTexture_uColor_vert.h\" />\n    <ClInclude Include=\"ccShader_PositionTexture_vert.h\" />\n    <ClInclude Include=\"ccShader_Position_uColor_frag.h\" />\n    <ClInclude Include=\"ccShader_Position_uColor_vert.h\" />\n    <ClInclude Include=\"CCSprite.h\" />\n    <ClInclude Include=\"CCSpriteBatchNode.h\" />\n    <ClInclude Include=\"CCSpriteFrame.h\" />\n    <ClInclude Include=\"CCSpriteFrameCache.h\" />\n    <ClInclude Include=\"CCTextFieldTTF.h\" />\n    <ClInclude Include=\"CCTexture2D.h\" />\n    <ClInclude Include=\"CCTextureAtlas.h\" />\n    <ClInclude Include=\"CCTextureCache.h\" />\n    <ClInclude Include=\"CCTileMapAtlas.h\" />\n    <ClInclude Include=\"CCTMXLayer.h\" />\n    <ClInclude Include=\"CCTMXObjectGroup.h\" />\n    <ClInclude Include=\"CCTMXTiledMap.h\" />\n    <ClInclude Include=\"CCTMXXMLParser.h\" />\n    <ClInclude Include=\"CCTouch.h\" />\n    <ClInclude Include=\"CCTransition.h\" />\n    <ClInclude Include=\"CCTransitionPageTurn.h\" />\n    <ClInclude Include=\"CCTransitionProgress.h\" />\n    <ClInclude Include=\"ccTypes.h\" />\n    <ClInclude Include=\"CCUserDefault.h\" />\n    <ClInclude Include=\"ccUTF8.h\" />\n    <ClInclude Include=\"ccUtils.h\" />\n    <ClInclude Include=\"CCVertex.h\" />\n    <ClInclude Include=\"cocos2d.h\" />\n    <ClInclude Include=\"platform\\CCApplicationProtocol.h\" />\n    <ClInclude Include=\"platform\\CCCommon.h\" />\n    <ClInclude Include=\"platform\\CCDevice.h\" />\n    <ClInclude Include=\"platform\\CCEGLViewProtocol.h\" />\n    <ClInclude Include=\"platform\\CCFileUtils.h\" />\n    <ClInclude Include=\"platform\\CCImage.h\" />\n    <ClInclude Include=\"platform\\CCImageCommon_cpp.h\" />\n    <ClInclude Include=\"platform\\CCSAXParser.h\" />\n    <ClInclude Include=\"platform\\CCThread.h\" />\n    <ClInclude Include=\"platform\\desktop\\CCEGLView.h\" />\n    <ClInclude Include=\"platform\\win32\\CCApplication.h\" />\n    <ClInclude Include=\"platform\\win32\\CCFileUtilsWin32.h\" />\n    <ClInclude Include=\"platform\\win32\\CCGL.h\" />\n    <ClInclude Include=\"platform\\win32\\CCPlatformDefine.h\" />\n    <ClInclude Include=\"platform\\win32\\CCStdC.h\" />\n    <ClInclude Include=\"renderer\\CCBatchCommand.h\" />\n    <ClInclude Include=\"renderer\\CCCustomCommand.h\" />\n    <ClInclude Include=\"renderer\\CCFrustum.h\" />\n    <ClInclude Include=\"renderer\\CCGroupCommand.h\" />\n    <ClInclude Include=\"renderer\\CCMaterialManager.h\" />\n    <ClInclude Include=\"renderer\\CCQuadCommand.h\" />\n    <ClInclude Include=\"renderer\\CCRenderCommand.h\" />\n    <ClInclude Include=\"renderer\\CCRenderCommandPool.h\" />\n    <ClInclude Include=\"renderer\\CCRenderer.h\" />\n    <ClInclude Include=\"renderer\\CCRenderMaterial.h\" />\n    <ClInclude Include=\"TGAlib.h\" />\n    <ClInclude Include=\"TransformUtils.h\" />\n    <ClInclude Include=\"uthash.h\" />\n    <ClInclude Include=\"utlist.h\" />\n    <ClInclude Include=\"ZipUtils.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/2d/cocos2d.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"base_nodes\">\n      <UniqueIdentifier>{cc64f5ad-2234-494c-9c51-b7a20c8887aa}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"effects\">\n      <UniqueIdentifier>{736cf4ab-e0d6-40ba-912a-b062d28d318a}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"actions\">\n      <UniqueIdentifier>{1c7c61b8-3d36-4ba0-a87c-457eb4c782d0}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"include\">\n      <UniqueIdentifier>{0b3a64bd-79fa-476a-a461-6b97e5072453}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"label_nodes\">\n      <UniqueIdentifier>{e455af5e-da09-4f41-b79f-df4dd311820d}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"layers_scenes_transitions_nodes\">\n      <UniqueIdentifier>{206bd96b-f80e-4722-8675-d7c6ff9b3639}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"menu_nodes\">\n      <UniqueIdentifier>{075492ba-08bc-404c-92da-32029797a600}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"misc_nodes\">\n      <UniqueIdentifier>{41abe422-1602-4fe0-ac1c-6b04a14c1abb}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"particle_nodes\">\n      <UniqueIdentifier>{8bf0f517-2ac3-4fc3-a1ad-999d9ea103cd}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"platform\">\n      <UniqueIdentifier>{926fc31c-8742-4984-9940-c972dd02fc8a}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"platform\\win32\">\n      <UniqueIdentifier>{9428f8e6-4ce3-4596-b8af-14d70b7c5b5d}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"sprite_nodes\">\n      <UniqueIdentifier>{755e5282-111e-46a5-9169-7c12b37f5ffc}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"support\">\n      <UniqueIdentifier>{d94bbf20-8de9-49a7-ae20-6a1140cf633b}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"support\\data_support\">\n      <UniqueIdentifier>{4a64789e-cc8d-4f84-a869-e6dae2e0d58c}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"support\\image_support\">\n      <UniqueIdentifier>{bb98a889-9a48-4e31-af2f-117f14da388a}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"support\\zip_support\">\n      <UniqueIdentifier>{fdea327e-b905-47db-8c33-b70d7866166b}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"textures\">\n      <UniqueIdentifier>{46c8d130-b8b5-47f5-a063-ca700e1c32cc}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"tilemap_parallax_nodes\">\n      <UniqueIdentifier>{f2671200-b2d8-4d2e-9728-06719cf6f835}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"text_input_node\">\n      <UniqueIdentifier>{535c04b0-fe2b-44c9-9a8c-9029e2b6de5c}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"script_support\">\n      <UniqueIdentifier>{5b082c5c-d396-43ca-b3b1-997d0f6247d0}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"kazmath\">\n      <UniqueIdentifier>{7751500e-ac9e-4604-a96d-670b30b7d8bd}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"shaders\">\n      <UniqueIdentifier>{163895ae-8a8e-46bf-bdf2-98bb2c1347fc}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"draw_nodes\">\n      <UniqueIdentifier>{1179d205-d065-49f0-8457-bc4c3f1d0cb3}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"support\\tinyxml2\">\n      <UniqueIdentifier>{cc25bb83-527d-4218-8d68-ebf963ce7698}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"support\\user_default\">\n      <UniqueIdentifier>{c45b97e8-fa1f-4e58-8ec5-d46371c2dd26}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"support\\component\">\n      <UniqueIdentifier>{caa78ce0-9b58-4314-b117-1acae278691e}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"platform\\etc\">\n      <UniqueIdentifier>{47fda93e-6eb4-4abc-b5bc-725bf667a395}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"event_dispatcher\">\n      <UniqueIdentifier>{3ff2746c-a91b-4b86-93b7-43a9ec14825b}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"physics\">\n      <UniqueIdentifier>{08593631-5bf5-46aa-9436-62595c4f7bf6}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"physics\\chipmunk\">\n      <UniqueIdentifier>{aeadfa95-9c89-4212-98ae-89ad57db596a}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"kazmath\\include\">\n      <UniqueIdentifier>{05e27e68-7574-4a8b-af68-553dd3bafdfa}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"kazmath\\src\">\n      <UniqueIdentifier>{b797075f-7437-46d5-b4ee-2aa2c108e98f}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"kazmath\\src\\GL\">\n      <UniqueIdentifier>{c755509d-1610-4e6c-b01b-e01d4d0de46e}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"kazmath\\include\\kazmath\">\n      <UniqueIdentifier>{e1b64497-c099-4f06-8d61-9d4c6b7a215a}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"kazmath\\include\\kazmath\\GL\">\n      <UniqueIdentifier>{7c71abeb-8b4b-4be8-a23c-e32fedc65fc9}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"base\">\n      <UniqueIdentifier>{aec8225f-81a7-4213-b97b-7004d5535398}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"renderer\">\n      <UniqueIdentifier>{cba0f362-878c-438b-ad0f-43d287516357}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"platform\\desktop\">\n      <UniqueIdentifier>{32373f63-2c2d-4eab-bc4a-21745ba0b3fb}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\physics\\CCPhysicsBody.cpp\">\n      <Filter>physics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\CCPhysicsContact.cpp\">\n      <Filter>physics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\CCPhysicsJoint.cpp\">\n      <Filter>physics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\CCPhysicsShape.cpp\">\n      <Filter>physics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\CCPhysicsWorld.cpp\">\n      <Filter>physics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCNode.cpp\">\n      <Filter>base_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCAtlasNode.cpp\">\n      <Filter>base_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCGrabber.cpp\">\n      <Filter>effects</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCGrid.cpp\">\n      <Filter>effects</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventDispatcher.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventKeyboard.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventListener.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventListenerAcceleration.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventListenerCustom.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventListenerKeyboard.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventListenerTouch.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventTouch.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEvent.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventAcceleration.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventCustom.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTouch.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\GL\\mat4stack.c\">\n      <Filter>kazmath\\src\\GL</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\GL\\matrix.c\">\n      <Filter>kazmath\\src\\GL</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\aabb.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\mat3.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\mat4.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\neon_matrix_impl.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\plane.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\quaternion.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\ray2.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\utility.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\vec2.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\vec3.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\math\\kazmath\\src\\vec4.c\">\n      <Filter>kazmath\\src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLayer.cpp\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCScene.cpp\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTransition.cpp\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTransitionPageTurn.cpp\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTransitionProgress.cpp\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCMenuItem.cpp\">\n      <Filter>menu_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCMenu.cpp\">\n      <Filter>menu_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCClippingNode.cpp\">\n      <Filter>misc_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCMotionStreak.cpp\">\n      <Filter>misc_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCProgressTimer.cpp\">\n      <Filter>misc_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCRenderTexture.cpp\">\n      <Filter>misc_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCParticleBatchNode.cpp\">\n      <Filter>particle_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCParticleExamples.cpp\">\n      <Filter>particle_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCParticleSystem.cpp\">\n      <Filter>particle_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCParticleSystemQuad.cpp\">\n      <Filter>particle_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCScriptSupport.cpp\">\n      <Filter>script_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCAction.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionCamera.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionCatmullRom.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionEase.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionGrid.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionGrid3D.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionInstant.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionInterval.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionManager.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionPageTurn3D.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionProgressTimer.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionTiledGrid.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCActionTween.cpp\">\n      <Filter>actions</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCDrawNode.cpp\">\n      <Filter>draw_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCDrawingPrimitives.cpp\">\n      <Filter>draw_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCFont.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCFontAtlas.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCFontAtlasCache.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCFontFNT.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCFontFreeType.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLabel.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLabelAtlas.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLabelBMFont.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLabelTextFormatter.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLabelTTF.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\etc1.cpp\">\n      <Filter>platform\\etc</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\win32\\CCApplication.cpp\">\n      <Filter>platform\\win32</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\win32\\CCCommon.cpp\">\n      <Filter>platform\\win32</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\win32\\CCDevice.cpp\">\n      <Filter>platform\\win32</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\win32\\CCFileUtilsWin32.cpp\">\n      <Filter>platform\\win32</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\win32\\CCImage.cpp\">\n      <Filter>platform\\win32</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\win32\\CCStdC.cpp\">\n      <Filter>platform\\win32</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\CCEGLViewProtocol.cpp\">\n      <Filter>platform</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\CCFileUtils.cpp\">\n      <Filter>platform</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\CCSAXParser.cpp\">\n      <Filter>platform</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\CCThread.cpp\">\n      <Filter>platform</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\atitc.cpp\">\n      <Filter>platform</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\s3tc.cpp\">\n      <Filter>platform</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCGLProgram.cpp\">\n      <Filter>shaders</Filter>\n    </ClCompile>\n    <ClCompile Include=\"ccGLStateCache.cpp\">\n      <Filter>shaders</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCShaderCache.cpp\">\n      <Filter>shaders</Filter>\n    </ClCompile>\n    <ClCompile Include=\"ccShaders.cpp\">\n      <Filter>shaders</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCSpriteBatchNode.cpp\">\n      <Filter>sprite_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCSpriteFrame.cpp\">\n      <Filter>sprite_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCSpriteFrameCache.cpp\">\n      <Filter>sprite_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCSprite.cpp\">\n      <Filter>sprite_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCAnimation.cpp\">\n      <Filter>sprite_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCAnimationCache.cpp\">\n      <Filter>sprite_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCIMEDispatcher.cpp\">\n      <Filter>text_input_node</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTextFieldTTF.cpp\">\n      <Filter>text_input_node</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTexture2D.cpp\">\n      <Filter>textures</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTextureAtlas.cpp\">\n      <Filter>textures</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTextureCache.cpp\">\n      <Filter>textures</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTMXLayer.cpp\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTMXObjectGroup.cpp\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTMXTiledMap.cpp\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTMXXMLParser.cpp\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCTileMapAtlas.cpp\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCParallaxNode.cpp\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCConfiguration.cpp\" />\n    <ClCompile Include=\"CCDeprecated.cpp\" />\n    <ClCompile Include=\"CCDirector.cpp\" />\n    <ClCompile Include=\"ccFPSImages.c\" />\n    <ClCompile Include=\"CCScheduler.cpp\" />\n    <ClCompile Include=\"ccTypes.cpp\" />\n    <ClCompile Include=\"cocos2d.cpp\" />\n    <ClCompile Include=\"base64.cpp\">\n      <Filter>support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCNotificationCenter.cpp\">\n      <Filter>support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCProfiling.cpp\">\n      <Filter>support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"ccUTF8.cpp\">\n      <Filter>support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCVertex.cpp\">\n      <Filter>support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"TransformUtils.cpp\">\n      <Filter>support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCComponent.cpp\">\n      <Filter>support\\component</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCComponentContainer.cpp\">\n      <Filter>support\\component</Filter>\n    </ClCompile>\n    <ClCompile Include=\"ccCArray.cpp\">\n      <Filter>support\\data_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"TGAlib.cpp\">\n      <Filter>support\\image_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\external\\tinyxml2\\tinyxml2.cpp\">\n      <Filter>support\\tinyxml2</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCUserDefault.cpp\">\n      <Filter>support\\user_default</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\external\\unzip\\ioapi.cpp\">\n      <Filter>support\\zip_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\external\\unzip\\unzip.cpp\">\n      <Filter>support\\zip_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"ZipUtils.cpp\">\n      <Filter>support\\zip_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCAffineTransform.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCArray.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCAutoreleasePool.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCData.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCDataVisitor.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCDictionary.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCGeometry.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCNS.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCObject.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCSet.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCString.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"ccUtils.cpp\">\n      <Filter>support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventListenerMouse.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCEventMouse.cpp\">\n      <Filter>event_dispatcher</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsBodyInfo_chipmunk.cpp\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsContactInfo_chipmunk.cpp\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsJointInfo_chipmunk.cpp\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsShapeInfo_chipmunk.cpp\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics\\chipmunk\\CCPhysicsWorldInfo_chipmunk.cpp\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCConsole.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\base\\CCValue.cpp\">\n      <Filter>base</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCNodeGrid.cpp\">\n      <Filter>misc_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\external\\edtaa3func\\edtaa3func.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCCustomCommand.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCFrustum.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCGroupCommand.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCMaterialManager.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCQuadCommand.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCRenderCommand.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCRenderer.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCRenderMaterial.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"renderer\\CCBatchCommand.cpp\">\n      <Filter>renderer</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCFontCharMap.cpp\">\n      <Filter>label_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"platform\\desktop\\CCEGLView.cpp\">\n      <Filter>platform\\desktop</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\physics\\CCPhysicsBody.h\">\n      <Filter>physics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\CCPhysicsContact.h\">\n      <Filter>physics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\CCPhysicsJoint.h\">\n      <Filter>physics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\CCPhysicsShape.h\">\n      <Filter>physics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\CCPhysicsWorld.h\">\n      <Filter>physics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCNode.h\">\n      <Filter>base_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCAtlasNode.h\">\n      <Filter>base_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCGrabber.h\">\n      <Filter>effects</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCGrid.h\">\n      <Filter>effects</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventDispatcher.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventKeyboard.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventListener.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventListenerAcceleration.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventListenerCustom.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventListenerKeyboard.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventListenerTouch.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventTouch.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEvent.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventAcceleration.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventCustom.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTouch.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccConfig.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCDeprecated.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventType.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccMacros.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCProtocols.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccTypes.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"cocos2d.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\aabb.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\kazmath.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\mat3.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\mat4.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\neon_matrix_impl.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\plane.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\quaternion.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\ray2.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\utility.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\vec2.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\vec3.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\vec4.h\">\n      <Filter>kazmath\\include\\kazmath</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\GL\\mat4stack.h\">\n      <Filter>kazmath\\include\\kazmath\\GL</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\math\\kazmath\\include\\kazmath\\GL\\matrix.h\">\n      <Filter>kazmath\\include\\kazmath\\GL</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLayer.h\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCScene.h\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTransition.h\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTransitionPageTurn.h\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTransitionProgress.h\">\n      <Filter>layers_scenes_transitions_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCMenu.h\">\n      <Filter>menu_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCMenuItem.h\">\n      <Filter>menu_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCClippingNode.h\">\n      <Filter>misc_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCMotionStreak.h\">\n      <Filter>misc_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCProgressTimer.h\">\n      <Filter>misc_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCRenderTexture.h\">\n      <Filter>misc_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCParticleBatchNode.h\">\n      <Filter>particle_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCParticleExamples.h\">\n      <Filter>particle_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCParticleSystem.h\">\n      <Filter>particle_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCParticleSystemQuad.h\">\n      <Filter>particle_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCScriptSupport.h\">\n      <Filter>script_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCAction.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionCamera.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionCatmullRom.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionEase.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionGrid.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionGrid3D.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionInstant.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionInterval.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionManager.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionPageTurn3D.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionProgressTimer.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionTiledGrid.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCActionTween.h\">\n      <Filter>actions</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCDrawNode.h\">\n      <Filter>draw_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCDrawingPrimitives.h\">\n      <Filter>draw_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCFont.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCFontAtlas.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCFontAtlasCache.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCFontFNT.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCFontFreeType.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLabel.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLabelAtlas.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLabelBMFont.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLabelTextFormatter.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLabelTTF.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\etc1.h\">\n      <Filter>platform\\etc</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\win32\\CCApplication.h\">\n      <Filter>platform\\win32</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\win32\\CCFileUtilsWin32.h\">\n      <Filter>platform\\win32</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\win32\\CCGL.h\">\n      <Filter>platform\\win32</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\win32\\CCPlatformDefine.h\">\n      <Filter>platform\\win32</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\win32\\CCStdC.h\">\n      <Filter>platform\\win32</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCApplicationProtocol.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCCommon.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCDevice.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCEGLViewProtocol.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCFileUtils.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCImage.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCImageCommon_cpp.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCSAXParser.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\CCThread.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\atitc.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCPlatformConfig.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCPlatformMacros.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\s3tc.h\">\n      <Filter>platform</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_Position_uColor_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_Position_uColor_vert.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionColor_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionColor_vert.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionColorLengthTexture_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionColorLengthTexture_vert.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTexture_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTexture_uColor_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTexture_uColor_vert.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTexture_vert.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTextureA8Color_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTextureA8Color_vert.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTextureColor_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTextureColor_vert.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShader_PositionTextureColorAlphaTest_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCGLProgram.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccGLStateCache.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCShaderCache.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShaderEx_SwitchMask_frag.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccShaders.h\">\n      <Filter>shaders</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCSpriteBatchNode.h\">\n      <Filter>sprite_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCSpriteFrame.h\">\n      <Filter>sprite_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCSpriteFrameCache.h\">\n      <Filter>sprite_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCSprite.h\">\n      <Filter>sprite_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCAnimation.h\">\n      <Filter>sprite_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCAnimationCache.h\">\n      <Filter>sprite_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCIMEDelegate.h\">\n      <Filter>text_input_node</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCIMEDispatcher.h\">\n      <Filter>text_input_node</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTextFieldTTF.h\">\n      <Filter>text_input_node</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTexture2D.h\">\n      <Filter>textures</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTextureAtlas.h\">\n      <Filter>textures</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTextureCache.h\">\n      <Filter>textures</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTMXLayer.h\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTMXObjectGroup.h\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTMXTiledMap.h\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTMXXMLParser.h\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCTileMapAtlas.h\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCParallaxNode.h\">\n      <Filter>tilemap_parallax_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCConfiguration.h\" />\n    <ClInclude Include=\"CCDirector.h\" />\n    <ClInclude Include=\"ccFPSImages.h\" />\n    <ClInclude Include=\"CCScheduler.h\" />\n    <ClInclude Include=\"base64.h\">\n      <Filter>support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCNotificationCenter.h\">\n      <Filter>support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCProfiling.h\">\n      <Filter>support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccUTF8.h\">\n      <Filter>support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccUtils.h\">\n      <Filter>support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCVertex.h\">\n      <Filter>support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"TransformUtils.h\">\n      <Filter>support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCComponent.h\">\n      <Filter>support\\component</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCComponentContainer.h\">\n      <Filter>support\\component</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ccCArray.h\">\n      <Filter>support\\data_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"utlist.h\">\n      <Filter>support\\data_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"uthash.h\">\n      <Filter>support\\data_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"TGAlib.h\">\n      <Filter>support\\image_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\external\\tinyxml2\\tinyxml2.h\">\n      <Filter>support\\tinyxml2</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCUserDefault.h\">\n      <Filter>support\\user_default</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\external\\unzip\\ioapi.h\">\n      <Filter>support\\zip_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\external\\unzip\\unzip.h\">\n      <Filter>support\\zip_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"ZipUtils.h\">\n      <Filter>support\\zip_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCAffineTransform.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCArray.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCAutoreleasePool.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCBool.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCData.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCDataVisitor.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCDictionary.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCDouble.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCFloat.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCGeometry.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCInteger.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCNS.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCObject.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCSet.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCString.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventListenerMouse.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCEventMouse.h\">\n      <Filter>event_dispatcher</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsBodyInfo_chipmunk.h\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsContactInfo_chipmunk.h\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsHelper_chipmunk.h\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsJointInfo_chipmunk.h\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsShapeInfo_chipmunk.h\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics\\chipmunk\\CCPhysicsWorldInfo_chipmunk.h\">\n      <Filter>physics\\chipmunk</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCConsole.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCMap.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCValue.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\base\\CCVector.h\">\n      <Filter>base</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCNodeGrid.h\">\n      <Filter>misc_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\external\\edtaa3func\\edtaa3func.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCCustomCommand.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCFrustum.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCGroupCommand.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCMaterialManager.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCQuadCommand.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCRenderCommand.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCRenderCommandPool.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCRenderer.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCRenderMaterial.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"renderer\\CCBatchCommand.h\">\n      <Filter>renderer</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCFontCharMap.h\">\n      <Filter>label_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"platform\\desktop\\CCEGLView.h\">\n      <Filter>platform\\desktop</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/2d/cocos2d_headers.props",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ImportGroup Label=\"PropertySheets\" />\n  <PropertyGroup Label=\"UserMacros\">\n    <EngineRoot>$(MSBuildThisFileDirectory)..\\..\\</EngineRoot>\n  </PropertyGroup>\n  <PropertyGroup />\n  <ItemDefinitionGroup>\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(EngineRoot)cocos\\2d;$(EngineRoot)cocos\\2d\\renderer;$(EngineRoot)cocos\\gui;$(EngineRoot)cocos\\base;$(EngineRoot)cocos\\physics;$(EngineRoot)cocos\\math\\kazmath\\include;$(EngineRoot)cocos\\2d\\platform\\win32;$(EngineRoot)cocos\\2d\\platform\\desktop;$(EngineRoot)external\\glfw3\\include\\win32;$(EngineRoot)external\\win32-specific\\gles\\include\\OGLES</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_VARIADIC_MAX=10;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <BuildMacro Include=\"EngineRoot\">\n      <Value>$(EngineRoot)</Value>\n      <EnvironmentVariable>true</EnvironmentVariable>\n    </BuildMacro>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/2d/cocos2dx-Prefix.pch",
    "content": "//\n// Prefix header for all source files of the 'cocos2dx' target in the 'cocos2dx' project\n//\n\n#ifdef __OBJC__\n    #import <Foundation/Foundation.h>\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/cocos2dx.props",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ImportGroup Label=\"PropertySheets\" />\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <LinkIncremental>false</LinkIncremental>\n  </PropertyGroup>\n  <ItemDefinitionGroup>\n    <Link>\n      <AdditionalDependencies>opengl32.lib;glew32.lib;libzlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;libwebp.lib;libiconv.lib;glfw3.lib;freetype250.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>\n    </Link>\n    <ClCompile />\n  </ItemDefinitionGroup>\n  <ItemGroup />\n</Project>"
  },
  {
    "path": "cocos2d/cocos/2d/firePngData.h",
    "content": "const unsigned char __firePngData[] = {\n0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, \n0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7A, 0x7A, \n0xF4, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4D, 0x41, 0x00, 0x00, 0xAF, 0xC8, 0x37, 0x05, 0x8A, \n0xE9, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, \n0x65, 0x00, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x20, 0x49, 0x6D, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, \n0x64, 0x79, 0x71, 0xC9, 0x65, 0x3C, 0x00, 0x00, 0x02, 0x64, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA, \n0xC4, 0x97, 0x89, 0x6E, 0xEB, 0x20, 0x10, 0x45, 0xBD, 0xE1, 0x2D, 0x4B, 0xFF, 0xFF, 0x37, 0x5F, \n0x5F, 0x0C, 0xD8, 0xC4, 0xAE, 0x2D, 0xDD, 0xA9, 0x6E, 0xA7, 0x38, 0xC1, 0x91, 0xAA, 0x44, 0xBA, \n0xCA, 0x06, 0xCC, 0x99, 0x85, 0x01, 0xE7, 0xCB, 0xB2, 0x64, 0xEF, 0x7C, 0x55, 0x2F, 0xCC, 0x69, \n0x56, 0x15, 0xAB, 0x72, 0x68, 0x81, 0xE6, 0x55, 0xFE, 0xE8, 0x62, 0x79, 0x62, 0x04, 0x36, 0xA3, \n0x06, 0xC0, 0x9B, 0xCA, 0x08, 0xC0, 0x7D, 0x55, 0x80, 0xA6, 0x54, 0x98, 0x67, 0x11, 0xA8, 0xA1, \n0x86, 0x3E, 0x0B, 0x44, 0x41, 0x00, 0x33, 0x19, 0x1F, 0x21, 0x43, 0x9F, 0x5F, 0x02, 0x68, 0x49, \n0x1D, 0x20, 0x1A, 0x82, 0x28, 0x09, 0xE0, 0x4E, 0xC6, 0x3D, 0x64, 0x57, 0x39, 0x80, 0xBA, 0xA3, \n0x00, 0x1D, 0xD4, 0x93, 0x3A, 0xC0, 0x34, 0x0F, 0x00, 0x3C, 0x8C, 0x59, 0x4A, 0x99, 0x44, 0xCA, \n0xA6, 0x02, 0x88, 0xC7, 0xA7, 0x55, 0x67, 0xE8, 0x44, 0x10, 0x12, 0x05, 0x0D, 0x30, 0x92, 0xE7, \n0x52, 0x33, 0x32, 0x26, 0xC3, 0x38, 0xF7, 0x0C, 0xA0, 0x06, 0x40, 0x0F, 0xC3, 0xD7, 0x55, 0x17, \n0x05, 0xD1, 0x92, 0x77, 0x02, 0x20, 0x85, 0xB7, 0x19, 0x18, 0x28, 0x4D, 0x05, 0x19, 0x9F, 0xA1, \n0xF1, 0x08, 0xC0, 0x05, 0x10, 0x57, 0x7C, 0x4F, 0x01, 0x10, 0xEF, 0xC5, 0xF8, 0xAC, 0x76, 0xC8, \n0x2E, 0x80, 0x14, 0x99, 0xE4, 0xFE, 0x44, 0x51, 0xB8, 0x52, 0x14, 0x3A, 0x32, 0x22, 0x00, 0x13, \n0x85, 0xBF, 0x52, 0xC6, 0x05, 0x8E, 0xE5, 0x63, 0x00, 0x86, 0xB6, 0x9C, 0x86, 0x38, 0xAB, 0x54, \n0x74, 0x18, 0x5B, 0x50, 0x58, 0x6D, 0xC4, 0xF3, 0x89, 0x6A, 0xC3, 0x61, 0x8E, 0xD9, 0x03, 0xA8, \n0x08, 0xA0, 0x55, 0xBB, 0x40, 0x40, 0x3E, 0x00, 0xD2, 0x53, 0x47, 0x94, 0x0E, 0x38, 0xD0, 0x7A, \n0x73, 0x64, 0x57, 0xF0, 0x16, 0xFE, 0x95, 0x82, 0x86, 0x1A, 0x4C, 0x4D, 0xE9, 0x68, 0xD5, 0xAE, \n0xB8, 0x00, 0xE2, 0x8C, 0xDF, 0x4B, 0xE4, 0xD7, 0xC1, 0xB3, 0x4C, 0x75, 0xC2, 0x36, 0xD2, 0x3F, \n0x2A, 0x7C, 0xF7, 0x0C, 0x50, 0x60, 0xB1, 0x4A, 0x81, 0x18, 0x88, 0xD3, 0x22, 0x75, 0xD1, 0x63, \n0x5C, 0x80, 0xF7, 0x19, 0x15, 0xA2, 0xA5, 0xB9, 0xB5, 0x5A, 0xB7, 0xA4, 0x34, 0x7D, 0x03, 0x48, \n0x5F, 0x17, 0x90, 0x52, 0x01, 0x19, 0x95, 0x9E, 0x1E, 0xD1, 0x30, 0x30, 0x9A, 0x21, 0xD7, 0x0D, \n0x81, 0xB3, 0xC1, 0x92, 0x0C, 0xE7, 0xD4, 0x1B, 0xBE, 0x49, 0xF2, 0x04, 0x15, 0x2A, 0x52, 0x06, \n0x69, 0x31, 0xCA, 0xB3, 0x22, 0x71, 0xBD, 0x1F, 0x00, 0x4B, 0x82, 0x66, 0xB5, 0xA7, 0x37, 0xCF, \n0x6F, 0x78, 0x0F, 0xF8, 0x5D, 0xC6, 0xA4, 0xAC, 0xF7, 0x23, 0x05, 0x6C, 0xE4, 0x4E, 0xE2, 0xE3, \n0x95, 0xB7, 0xD3, 0x40, 0xF3, 0xA5, 0x06, 0x1C, 0xFE, 0x1F, 0x09, 0x2A, 0xA8, 0xF5, 0xE6, 0x3D, \n0x00, 0xDD, 0xAD, 0x02, 0x2D, 0xC4, 0x4D, 0x66, 0xA0, 0x6A, 0x1F, 0xD5, 0x2E, 0xF8, 0x8F, 0xFF, \n0x2D, 0xC6, 0x4F, 0x04, 0x1E, 0x14, 0xD0, 0xAC, 0x01, 0x3C, 0xAA, 0x5C, 0x1F, 0xA9, 0x2E, 0x72, \n0xBA, 0x49, 0xB5, 0xC7, 0xFA, 0xC0, 0x27, 0xD2, 0x62, 0x69, 0xAE, 0xA7, 0xC8, 0x04, 0xEA, 0x0F, \n0xBF, 0x1A, 0x51, 0x50, 0x61, 0x16, 0x8F, 0x1B, 0xD5, 0x5E, 0x03, 0x75, 0x35, 0xDD, 0x09, 0x6F, \n0x88, 0xC4, 0x0D, 0x73, 0x07, 0x82, 0x61, 0x88, 0xE8, 0x59, 0x30, 0x45, 0x8E, 0xD4, 0x7A, 0xA7, \n0xBD, 0xDA, 0x07, 0x67, 0x81, 0x40, 0x30, 0x88, 0x55, 0xF5, 0x11, 0x05, 0xF0, 0x58, 0x94, 0x9B, \n0x48, 0xEC, 0x60, 0xF1, 0x09, 0xC7, 0xF1, 0x66, 0xFC, 0xDF, 0x0E, 0x84, 0x7F, 0x74, 0x1C, 0x8F, \n0x58, 0x44, 0x77, 0xAC, 0x59, 0xB5, 0xD7, 0x67, 0x00, 0x12, 0x85, 0x4F, 0x2A, 0x4E, 0x17, 0xBB, \n0x1F, 0xC6, 0x00, 0xB8, 0x99, 0xB0, 0xE7, 0x23, 0x9D, 0xF7, 0xCF, 0x6E, 0x44, 0x83, 0x4A, 0x45, \n0x32, 0x40, 0x86, 0x81, 0x7C, 0x8D, 0xBA, 0xAB, 0x1C, 0xA7, 0xDE, 0x09, 0x87, 0x48, 0x21, 0x26, \n0x5F, 0x4A, 0xAD, 0xBA, 0x6E, 0x4F, 0xCA, 0xFB, 0x23, 0xB7, 0x62, 0xF7, 0xCA, 0xAD, 0x58, 0x22, \n0xC1, 0x00, 0x47, 0x9F, 0x0B, 0x7C, 0xCA, 0x73, 0xC1, 0xDB, 0x9F, 0x8C, 0xF2, 0x17, 0x1E, 0x4E, \n0xDF, 0xF2, 0x6C, 0xF8, 0x67, 0xAF, 0x22, 0x7B, 0xF3, 0xEB, 0x4B, 0x80, 0x01, 0x00, 0xB8, 0x21, \n0x72, 0x89, 0x08, 0x10, 0x07, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, \n0x60, 0x82\n};\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCApplicationProtocol.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_APPLICATION_PROTOCOL_H__\n#define __CC_APPLICATION_PROTOCOL_H__\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\nclass CC_DLL ApplicationProtocol\n{\npublic:\n\n    // Since WINDOWS and ANDROID are defined as macros, we could not just use these keywords in enumeration(Platform).\n    // Therefore, 'OS_' prefix is added to avoid conflicts with the definitions of system macros.\n    enum class Platform\n    {\n        OS_WINDOWS,\n        OS_LINUX,\n        OS_MAC,\n        OS_ANDROID,\n        OS_IPHONE,\n        OS_IPAD,\n        OS_BLACKBERRY,\n        OS_NACL,\n        OS_EMSCRIPTEN,\n        OS_TIZEN\n    };\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ApplicationProtocol() {}\n\n    /**\n    @brief    Implement Director and Scene init code here.\n    @return true    Initialize success, app continue.\n    @return false   Initialize failed, app terminate.\n    * @js NA\n    * @lua NA\n    */\n    virtual bool applicationDidFinishLaunching() = 0;\n\n    /**\n    @brief  This function will be called when the application enters background.\n    * @js NA\n    * @lua NA\n    */\n    virtual void applicationDidEnterBackground() = 0;\n\n    /**\n    @brief  This function will be called when the application enters foreground.\n    * @js NA\n    * @lua NA\n    */\n    virtual void applicationWillEnterForeground() = 0;\n\n    /**\n    @brief    Callback by Director for limit FPS.\n    @param interval The time, expressed in seconds, between current frame and next.\n    * @js NA\n    * @lua NA\n    */\n    virtual void setAnimationInterval(double interval) = 0;\n\n    /**\n    @brief Get current language config\n    @return Current language config\n    * @js NA\n    * @lua NA\n    */\n    virtual LanguageType getCurrentLanguage() = 0;\n    \n    /**\n     @brief Get target platform\n     * @js NA\n     * @lua NA\n     */\n    virtual Platform getTargetPlatform() = 0;\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_APPLICATION_PROTOCOL_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCCommon.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_COMMON_H__\n#define __CC_COMMON_H__\n\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n/**\n * lua can not deal with ...\n */\nvoid CC_DLL LuaLog(const char * format);\n\n/**\n@brief Pop out a message box\n*/\nvoid CC_DLL MessageBox(const char * msg, const char * title);\n\n/**\n@brief Enum the language type supported now\n*/\nenum class LanguageType\n{\n    ENGLISH = 0,\n    CHINESE,\n    FRENCH,\n    ITALIAN,\n    GERMAN,\n    SPANISH,\n    RUSSIAN,\n    KOREAN,\n    JAPANESE,\n    HUNGARIAN,\n    PORTUGUESE,\n    ARABIC,\n    NORWEGIAN,\n    POLISH\n};\n\n// END of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_COMMON_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCDevice.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDEVICE_H__\n#define __CCDEVICE_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"ccMacros.h\"\n\nNS_CC_BEGIN\n\nclass CC_DLL Device\n{\npublic:\n    /**\n     *  Gets the DPI of device\n     *  @return The DPI of device.\n     */\n    static int getDPI();\n    \n    /**\n     * To enable or disable accelerometer.\n     */\n    static void setAccelerometerEnabled(bool isEnabled);\n    /**\n     *  Sets the interval of accelerometer.\n     */\n    static void setAccelerometerInterval(float interval);\n\nprivate:\n    CC_DISALLOW_IMPLICIT_CONSTRUCTORS(Device);\n};\n\n\nNS_CC_END\n\n#endif /* __CCDEVICE_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCEGLViewProtocol.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCEGLViewProtocol.h\"\n#include \"CCTouch.h\"\n#include \"CCDirector.h\"\n#include \"CCSet.h\"\n#include \"CCEventDispatcher.h\"\n\n\nNS_CC_BEGIN\n\nnamespace {\n    \n    static Touch* g_touches[EventTouch::MAX_TOUCHES] = { nullptr };\n    static unsigned int g_indexBitsUsed = 0;\n    // System touch pointer ID (It may not be ascending order number) <-> Ascending order number from 0\n    static std::map<int, int> g_touchIdReorderMap;\n    \n    static int getUnUsedIndex()\n    {\n        int i;\n        int temp = g_indexBitsUsed;\n        \n        for (i = 0; i < EventTouch::MAX_TOUCHES; i++) {\n            if (! (temp & 0x00000001)) {\n                g_indexBitsUsed |= (1 <<  i);\n                return i;\n            }\n            \n            temp >>= 1;\n        }\n        \n        // all bits are used\n        return -1;\n    }\n    \n    static void removeUsedIndexBit(int index)\n    {\n        if (index < 0 || index >= EventTouch::MAX_TOUCHES)\n        {\n            return;\n        }\n        \n        unsigned int temp = 1 << index;\n        temp = ~temp;\n        g_indexBitsUsed &= temp;\n    }\n    \n}\n\nEGLViewProtocol::EGLViewProtocol()\n: _delegate(nullptr)\n, _scaleX(1.0f)\n, _scaleY(1.0f)\n, _resolutionPolicy(ResolutionPolicy::UNKNOWN)\n{\n}\n\nEGLViewProtocol::~EGLViewProtocol()\n{\n\n}\n\nvoid EGLViewProtocol::pollInputEvents()\n{\n}\n\nvoid EGLViewProtocol::setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy)\n{\n    CCASSERT(resolutionPolicy != ResolutionPolicy::UNKNOWN, \"should set resolutionPolicy\");\n    \n    if (width == 0.0f || height == 0.0f)\n    {\n        return;\n    }\n\n    _designResolutionSize.setSize(width, height);\n    \n    _scaleX = (float)_screenSize.width / _designResolutionSize.width;\n    _scaleY = (float)_screenSize.height / _designResolutionSize.height;\n    \n    if (resolutionPolicy == ResolutionPolicy::NO_BORDER)\n    {\n        _scaleX = _scaleY = MAX(_scaleX, _scaleY);\n    }\n    \n    if (resolutionPolicy == ResolutionPolicy::SHOW_ALL)\n    {\n        _scaleX = _scaleY = MIN(_scaleX, _scaleY);\n    }\n\n    if ( resolutionPolicy == ResolutionPolicy::FIXED_HEIGHT) {\n    \t_scaleX = _scaleY;\n    \t_designResolutionSize.width = ceilf(_screenSize.width/_scaleX);\n    }\n\n    if ( resolutionPolicy == ResolutionPolicy::FIXED_WIDTH) {\n    \t_scaleY = _scaleX;\n    \t_designResolutionSize.height = ceilf(_screenSize.height/_scaleY);\n    }\n\n    // calculate the rect of viewport    \n    float viewPortW = _designResolutionSize.width * _scaleX;\n    float viewPortH = _designResolutionSize.height * _scaleY;\n\n    _viewPortRect.setRect((_screenSize.width - viewPortW) / 2, (_screenSize.height - viewPortH) / 2, viewPortW, viewPortH);\n    \n    _resolutionPolicy = resolutionPolicy;\n    \n\t// reset director's member variables to fit visible rect\n    Director::getInstance()->_winSizeInPoints = getDesignResolutionSize();\n    Director::getInstance()->createStatsLabel();\n    Director::getInstance()->setGLDefaultValues();\n}\n\nconst Size& EGLViewProtocol::getDesignResolutionSize() const \n{\n    return _designResolutionSize;\n}\n\nconst Size& EGLViewProtocol::getFrameSize() const\n{\n    return _screenSize;\n}\n\nvoid EGLViewProtocol::setFrameSize(float width, float height)\n{\n    _designResolutionSize = _screenSize = Size(width, height);\n}\n\nSize  EGLViewProtocol::getVisibleSize() const\n{\n    if (_resolutionPolicy == ResolutionPolicy::NO_BORDER)\n    {\n        return Size(_screenSize.width/_scaleX, _screenSize.height/_scaleY);\n    }\n    else \n    {\n        return _designResolutionSize;\n    }\n}\n\nPoint EGLViewProtocol::getVisibleOrigin() const\n{\n    if (_resolutionPolicy == ResolutionPolicy::NO_BORDER)\n    {\n        return Point((_designResolutionSize.width - _screenSize.width/_scaleX)/2, \n                           (_designResolutionSize.height - _screenSize.height/_scaleY)/2);\n    }\n    else \n    {\n        return Point::ZERO;\n    }\n}\n\nvoid EGLViewProtocol::setTouchDelegate(EGLTouchDelegate * delegate)\n{\n    _delegate = delegate;\n}\n\nvoid EGLViewProtocol::setViewPortInPoints(float x , float y , float w , float h)\n{\n    glViewport((GLint)(x * _scaleX + _viewPortRect.origin.x),\n               (GLint)(y * _scaleY + _viewPortRect.origin.y),\n               (GLsizei)(w * _scaleX),\n               (GLsizei)(h * _scaleY));\n}\n\nvoid EGLViewProtocol::setScissorInPoints(float x , float y , float w , float h)\n{\n    glScissor((GLint)(x * _scaleX + _viewPortRect.origin.x),\n              (GLint)(y * _scaleY + _viewPortRect.origin.y),\n              (GLsizei)(w * _scaleX),\n              (GLsizei)(h * _scaleY));\n}\n\nbool EGLViewProtocol::isScissorEnabled()\n{\n\treturn (GL_FALSE == glIsEnabled(GL_SCISSOR_TEST)) ? false : true;\n}\n\nRect EGLViewProtocol::getScissorRect() const\n{\n\tGLfloat params[4];\n\tglGetFloatv(GL_SCISSOR_BOX, params);\n\tfloat x = (params[0] - _viewPortRect.origin.x) / _scaleX;\n\tfloat y = (params[1] - _viewPortRect.origin.y) / _scaleY;\n\tfloat w = params[2] / _scaleX;\n\tfloat h = params[3] / _scaleY;\n\treturn Rect(x, y, w, h);\n}\n\nvoid EGLViewProtocol::setViewName(const std::string& viewname )\n{\n    _viewName = viewname;\n}\n\nconst std::string& EGLViewProtocol::getViewName() const\n{\n    return _viewName;\n}\n\nvoid EGLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float ys[])\n{\n    int id = 0;\n    float x = 0.0f;\n    float y = 0.0f;\n    int unusedIndex = 0;\n    EventTouch touchEvent;\n    \n    for (int i = 0; i < num; ++i)\n    {\n        id = ids[i];\n        x = xs[i];\n        y = ys[i];\n\n        auto iter = g_touchIdReorderMap.find(id);\n        unusedIndex = 0;\n\n        // it is a new touch\n        if (iter == g_touchIdReorderMap.end())\n        {\n            unusedIndex = getUnUsedIndex();\n\n            // The touches is more than MAX_TOUCHES ?\n            if (unusedIndex == -1) {\n                CCLOG(\"The touches is more than MAX_TOUCHES, unusedIndex = %d\", unusedIndex);\n                continue;\n            }\n\n            Touch* touch = g_touches[unusedIndex] = new Touch();\n\t\t\ttouch->setTouchInfo(unusedIndex, (x - _viewPortRect.origin.x) / _scaleX,\n                                     (y - _viewPortRect.origin.y) / _scaleY);\n            \n            CCLOGINFO(\"x = %f y = %f\", pTouch->getLocationInView().x, pTouch->getLocationInView().y);\n            \n            g_touchIdReorderMap.insert(std::make_pair(id, unusedIndex));\n            touchEvent._touches.push_back(touch);\n        }\n    }\n\n    if (touchEvent._touches.size() == 0)\n    {\n        CCLOG(\"touchesBegan: size = 0\");\n        return;\n    }\n    \n    touchEvent._eventCode = EventTouch::EventCode::BEGAN;\n    auto dispatcher = Director::getInstance()->getEventDispatcher();\n    dispatcher->dispatchEvent(&touchEvent);\n}\n\nvoid EGLViewProtocol::handleTouchesMove(int num, int ids[], float xs[], float ys[])\n{\n    int id = 0;\n    float x = 0.0f;\n    float y = 0.0f;\n    EventTouch touchEvent;\n    \n    for (int i = 0; i < num; ++i)\n    {\n        id = ids[i];\n        x = xs[i];\n        y = ys[i];\n\n        auto iter = g_touchIdReorderMap.find(id);\n        if (iter == g_touchIdReorderMap.end())\n        {\n            CCLOG(\"if the index doesn't exist, it is an error\");\n            continue;\n        }\n\n        CCLOGINFO(\"Moving touches with id: %d, x=%f, y=%f\", id, x, y);\n        Touch* touch = g_touches[iter->second];\n        if (touch)\n        {\n\t\t\ttouch->setTouchInfo(iter->second, (x - _viewPortRect.origin.x) / _scaleX,\n\t\t\t\t\t\t\t\t(y - _viewPortRect.origin.y) / _scaleY);\n            \n            touchEvent._touches.push_back(touch);\n        }\n        else\n        {\n            // It is error, should return.\n            CCLOG(\"Moving touches with id: %d error\", id);\n            return;\n        }\n    }\n\n    if (touchEvent._touches.size() == 0)\n    {\n        CCLOG(\"touchesMoved: size = 0\");\n        return;\n    }\n    \n    touchEvent._eventCode = EventTouch::EventCode::MOVED;\n    auto dispatcher = Director::getInstance()->getEventDispatcher();\n    dispatcher->dispatchEvent(&touchEvent);\n}\n\nvoid EGLViewProtocol::handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, int num, int ids[], float xs[], float ys[])\n{\n    int id = 0;\n    float x = 0.0f;\n    float y = 0.0f;\n    EventTouch touchEvent;\n    \n    for (int i = 0; i < num; ++i)\n    {\n        id = ids[i];\n        x = xs[i];\n        y = ys[i];\n\n        auto iter = g_touchIdReorderMap.find(id);\n        if (iter == g_touchIdReorderMap.end())\n        {\n            CCLOG(\"if the index doesn't exist, it is an error\");\n            continue;\n        }\n        \n        /* Add to the set to send to the director */\n        Touch* touch = g_touches[iter->second];\n        if (touch)\n        {\n            CCLOGINFO(\"Ending touches with id: %d, x=%f, y=%f\", id, x, y);\n\t\t\ttouch->setTouchInfo(iter->second, (x - _viewPortRect.origin.x) / _scaleX,\n\t\t\t\t\t\t\t\t(y - _viewPortRect.origin.y) / _scaleY);\n\n            touchEvent._touches.push_back(touch);\n            \n            g_touches[iter->second] = nullptr;\n            removeUsedIndexBit(iter->second);\n\n            g_touchIdReorderMap.erase(id);\n        } \n        else\n        {\n            CCLOG(\"Ending touches with id: %d error\", id);\n            return;\n        } \n\n    }\n\n    if (touchEvent._touches.size() == 0)\n    {\n        CCLOG(\"touchesEnded or touchesCancel: size = 0\");\n        return;\n    }\n    \n    touchEvent._eventCode = eventCode;\n    auto dispatcher = Director::getInstance()->getEventDispatcher();\n    dispatcher->dispatchEvent(&touchEvent);\n    \n    for (auto& touch : touchEvent._touches)\n    {\n        // release the touch object.\n        touch->release();\n    }\n}\n\nvoid EGLViewProtocol::handleTouchesEnd(int num, int ids[], float xs[], float ys[])\n{\n    handleTouchesOfEndOrCancel(EventTouch::EventCode::ENDED, num, ids, xs, ys);\n}\n\nvoid EGLViewProtocol::handleTouchesCancel(int num, int ids[], float xs[], float ys[])\n{\n    handleTouchesOfEndOrCancel(EventTouch::EventCode::CANCELLED, num, ids, xs, ys);\n}\n\nconst Rect& EGLViewProtocol::getViewPortRect() const\n{\n    return _viewPortRect;\n}\n\nfloat EGLViewProtocol::getScaleX() const\n{\n    return _scaleX;\n}\n\nfloat EGLViewProtocol::getScaleY() const\n{\n    return _scaleY;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCEGLViewProtocol.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCEGLVIEWPROTOCOL_H__\n#define __CCEGLVIEWPROTOCOL_H__\n\n#include \"ccTypes.h\"\n#include \"CCEventTouch.h\"\n\n#include <vector>\n\nenum class ResolutionPolicy\n{\n    // The entire application is visible in the specified area without trying to preserve the original aspect ratio.\n    // Distortion can occur, and the application may appear stretched or compressed.\n    EXACT_FIT,\n    // The entire application fills the specified area, without distortion but possibly with some cropping,\n    // while maintaining the original aspect ratio of the application.\n    NO_BORDER,\n    // The entire application is visible in the specified area without distortion while maintaining the original\n    // aspect ratio of the application. Borders can appear on two sides of the application.\n    SHOW_ALL,\n    // The application takes the height of the design resolution size and modifies the width of the internal\n    // canvas so that it fits the aspect ratio of the device\n    // no distortion will occur however you must make sure your application works on different\n    // aspect ratios\n    FIXED_HEIGHT,\n    // The application takes the width of the design resolution size and modifies the height of the internal\n    // canvas so that it fits the aspect ratio of the device\n    // no distortion will occur however you must make sure your application works on different\n    // aspect ratios\n    FIXED_WIDTH,\n\n    UNKNOWN,\n};\n\nNS_CC_BEGIN\n\nclass EGLTouchDelegate;\n\n/**\n * @addtogroup platform\n * @{\n */\n\nclass CC_DLL EGLViewProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    EGLViewProtocol();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EGLViewProtocol();\n\n    /** Force destroying EGL view, subclass must implement this method. */\n    virtual void    end() = 0;\n\n    /** Get whether opengl render system is ready, subclass must implement this method. */\n    virtual bool    isOpenGLReady() = 0;\n\n    /** Exchanges the front and back buffers, subclass must implement this method. */\n    virtual void    swapBuffers() = 0;\n\n    /** Open or close IME keyboard , subclass must implement this method. */\n    virtual void    setIMEKeyboardState(bool open) = 0;\n\n    /**\n     * Polls input events. Subclass must implement methods if platform\n     * does not provide event callbacks.\n     */\n    virtual void pollInputEvents();\n\n    /**\n     * Get the frame size of EGL view.\n     * In general, it returns the screen size since the EGL view is a fullscreen view.\n     */\n    virtual const Size& getFrameSize() const;\n\n    /**\n     * Set the frame size of EGL view.\n     */\n    virtual void setFrameSize(float width, float height);\n\n    /**\n     * Get the visible area size of opengl viewport.\n     */\n    virtual Size getVisibleSize() const;\n\n    /**\n     * Get the visible origin point of opengl viewport.\n     */\n    virtual Point getVisibleOrigin() const;\n\n    /**\n     * Set the design resolution size.\n     * @param width Design resolution width.\n     * @param height Design resolution height.\n     * @param resolutionPolicy The resolution policy desired, you may choose:\n     *                         [1] EXACT_FIT Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.\n     *                         [2] NO_BORDER Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.\n     *                         [3] SHOW_ALL  Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.\n     */\n    virtual void setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy);\n\n    /** Get design resolution size.\n     *  Default resolution size is the same as 'getFrameSize'.\n     */\n    virtual const Size&  getDesignResolutionSize() const;\n\n    /** Set touch delegate */\n    virtual void setTouchDelegate(EGLTouchDelegate * delegate);\n\n    /**\n     * Set opengl view port rectangle with points.\n     */\n    virtual void setViewPortInPoints(float x , float y , float w , float h);\n\n    /**\n     * Set Scissor rectangle with points.\n     */\n    virtual void setScissorInPoints(float x , float y , float w , float h);\n\n    /**\n     * Get whether GL_SCISSOR_TEST is enable\n     */\n    virtual bool isScissorEnabled();\n\n    /**\n     * Get the current scissor rectangle\n     */\n    virtual Rect getScissorRect() const;\n\n    virtual void setViewName(const std::string& viewname);\n    const std::string& getViewName() const;\n\n    /** Touch events are handled by default; if you want to customize your handlers, please override these functions: */\n    virtual void handleTouchesBegin(int num, int ids[], float xs[], float ys[]);\n    virtual void handleTouchesMove(int num, int ids[], float xs[], float ys[]);\n    virtual void handleTouchesEnd(int num, int ids[], float xs[], float ys[]);\n    virtual void handleTouchesCancel(int num, int ids[], float xs[], float ys[]);\n\n    /**\n     * Get the opengl view port rectangle.\n     */\n    const Rect& getViewPortRect() const;\n\n    /**\n     * Get scale factor of the horizontal direction.\n     */\n    float getScaleX() const;\n\n    /**\n     * Get scale factor of the vertical direction.\n     */\n    float getScaleY() const;\n\n\nprotected:\n    void handleTouchesOfEndOrCancel(EventTouch::EventCode eventCode, int num, int ids[], float xs[], float ys[]);\n\n    EGLTouchDelegate* _delegate;\n\n    // real screen size\n    Size _screenSize;\n    // resolution size, it is the size appropriate for the app resources.\n    Size _designResolutionSize;\n    // the view port size\n    Rect _viewPortRect;\n    // the view name\n    std::string _viewName;\n\n    float  _scaleX;\n    float  _scaleY;\n    ResolutionPolicy _resolutionPolicy;\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCEGLVIEWPROTOCOL_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCFileUtils.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2013 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCFileUtils.h\"\n#include \"CCData.h\"\n#include \"ccMacros.h\"\n#include \"CCDirector.h\"\n#include \"CCSAXParser.h\"\n#include \"tinyxml2.h\"\n#include \"unzip.h\"\n#include <stack>\n\nusing namespace std;\n\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC)\n\nNS_CC_BEGIN\n\ntypedef enum \n{\n    SAX_NONE = 0,\n    SAX_KEY,\n    SAX_DICT,\n    SAX_INT,\n    SAX_REAL,\n    SAX_STRING,\n    SAX_ARRAY\n}SAXState;\n\ntypedef enum\n{\n    SAX_RESULT_NONE = 0,\n    SAX_RESULT_DICT,\n    SAX_RESULT_ARRAY\n}SAXResult;\n\nclass DictMaker : public SAXDelegator\n{\npublic:\n    SAXResult _resultType;\n\tValueMap _rootDict;\n\tValueVector _rootArray;\n\n    std::string _curKey;   ///< parsed key\n    std::string _curValue; // parsed value\n    SAXState _state;\n\n\tValueMap*  _curDict;\n    ValueVector* _curArray;\n\n\tstd::stack<ValueMap*> _dictStack;\n    std::stack<ValueVector*> _arrayStack;\n    std::stack<SAXState>  _stateStack;\n\npublic:\n    DictMaker()        \n        : _resultType(SAX_RESULT_NONE)\n    {\n    }\n\n    ~DictMaker()\n    {\n    }\n\n    ValueMap dictionaryWithContentsOfFile(const std::string& fileName)\n    {\n        _resultType = SAX_RESULT_DICT;\n        SAXParser parser;\n\n        CCASSERT(parser.init(\"UTF-8\"), \"The file format isn't UTF-8\");\n        parser.setDelegator(this);\n\n        parser.parse(fileName);\n\t\treturn _rootDict;\n    }\n\n    ValueVector arrayWithContentsOfFile(const std::string& fileName)\n    {\n        _resultType = SAX_RESULT_ARRAY;\n        SAXParser parser;\n\n        CCASSERT(parser.init(\"UTF-8\"), \"The file format isn't UTF-8\");\n        parser.setDelegator(this);\n\n        parser.parse(fileName);\n\t\treturn _rootArray;\n    }\n\n    void startElement(void *ctx, const char *name, const char **atts)\n    {\n        CC_UNUSED_PARAM(ctx);\n        CC_UNUSED_PARAM(atts);\n        std::string sName(name);\n        if( sName == \"dict\" )\n        {\n\t\t\tif(_resultType == SAX_RESULT_DICT && _rootDict.empty())\n            {\n                _curDict = &_rootDict;\n            }\n\n            _state = SAX_DICT;\n\n            SAXState preState = SAX_NONE;\n            if (! _stateStack.empty())\n            {\n                preState = _stateStack.top();\n            }\n\n            if (SAX_ARRAY == preState)\n            {\n                // add a new dictionary into the array\n                _curArray->push_back(Value(ValueMap()));\n\t\t\t\t_curDict = &(_curArray->rbegin())->asValueMap();\n            }\n            else if (SAX_DICT == preState)\n            {\n                // add a new dictionary into the pre dictionary\n                CCASSERT(! _dictStack.empty(), \"The state is wrong!\");\n                ValueMap* preDict = _dictStack.top();\n                (*preDict)[_curKey] = Value(ValueMap());\n\t\t\t\t_curDict = &(*preDict)[_curKey].asValueMap();\n            }\n\n            // record the dict state\n            _stateStack.push(_state);\n            _dictStack.push(_curDict);\n        }\n        else if(sName == \"key\")\n        {\n            _state = SAX_KEY;\n        }\n        else if(sName == \"integer\")\n        {\n            _state = SAX_INT;\n        }\n        else if(sName == \"real\")\n        {\n            _state = SAX_REAL;\n        }\n        else if(sName == \"string\")\n        {\n            _state = SAX_STRING;\n        }\n        else if (sName == \"array\")\n        {\n            _state = SAX_ARRAY;\n\n\t\t\tif (_resultType == SAX_RESULT_ARRAY && _rootArray.empty())\n            {\n\t\t\t\t_curArray = &_rootArray;\n            }\n            SAXState preState = SAX_NONE;\n            if (! _stateStack.empty())\n            {\n                preState = _stateStack.top();\n            }\n\n            if (preState == SAX_DICT)\n            {\n                (*_curDict)[_curKey] = Value(ValueVector());\n\t\t\t\t_curArray = &(*_curDict)[_curKey].asValueVector();\n            }\n            else if (preState == SAX_ARRAY)\n            {\n                CCASSERT(! _arrayStack.empty(), \"The state is wrong!\");\n                ValueVector* preArray = _arrayStack.top();\n                preArray->push_back(Value(ValueVector()));\n\t\t\t\t_curArray = &(_curArray->rbegin())->asValueVector();\n            }\n            // record the array state\n            _stateStack.push(_state);\n            _arrayStack.push(_curArray);\n        }\n        else\n        {\n            _state = SAX_NONE;\n        }\n    }\n\n    void endElement(void *ctx, const char *name)\n    {\n        CC_UNUSED_PARAM(ctx);\n        SAXState curState = _stateStack.empty() ? SAX_DICT : _stateStack.top();\n        std::string sName((char*)name);\n        if( sName == \"dict\" )\n        {\n            _stateStack.pop();\n            _dictStack.pop();\n            if ( !_dictStack.empty())\n            {\n                _curDict = _dictStack.top();\n            }\n        }\n        else if (sName == \"array\")\n        {\n            _stateStack.pop();\n            _arrayStack.pop();\n            if (! _arrayStack.empty())\n            {\n                _curArray = _arrayStack.top();\n            }\n        }\n        else if (sName == \"true\")\n        {\n            if (SAX_ARRAY == curState)\n            {\n                _curArray->push_back(Value(true));\n            }\n            else if (SAX_DICT == curState)\n            {\n                (*_curDict)[_curKey] = Value(true);\n            }\n        }\n        else if (sName == \"false\")\n        {\n            if (SAX_ARRAY == curState)\n            {\n                _curArray->push_back(Value(false));\n            }\n            else if (SAX_DICT == curState)\n            {\n                (*_curDict)[_curKey] = Value(false);\n            }\n        }\n        else if (sName == \"string\" || sName == \"integer\" || sName == \"real\")\n        {\n            if (SAX_ARRAY == curState)\n            {\n                if (sName == \"string\")\n                    _curArray->push_back(Value(_curValue));\n                else if (sName == \"integer\")\n                    _curArray->push_back(Value(atoi(_curValue.c_str())));\n                else\n                    _curArray->push_back(Value(atof(_curValue.c_str())));\n            }\n            else if (SAX_DICT == curState)\n            {\n                if (sName == \"string\")\n                    (*_curDict)[_curKey] = Value(_curValue);\n                else if (sName == \"integer\")\n                    (*_curDict)[_curKey] = Value(atoi(_curValue.c_str()));\n                else\n                    (*_curDict)[_curKey] = Value(atof(_curValue.c_str()));\n            }\n\n            _curValue.clear();\n        }\n        \n        _state = SAX_NONE;\n    }\n\n    void textHandler(void *ctx, const char *ch, int len)\n    {\n        CC_UNUSED_PARAM(ctx);\n        if (_state == SAX_NONE)\n        {\n            return;\n        }\n\n        SAXState curState = _stateStack.empty() ? SAX_DICT : _stateStack.top();\n        std::string text = std::string((char*)ch,0,len);\n\n        switch(_state)\n        {\n        case SAX_KEY:\n            _curKey = text;\n            break;\n        case SAX_INT:\n        case SAX_REAL:\n        case SAX_STRING:\n            {\n                if (curState == SAX_DICT)\n                {\n                    CCASSERT(!_curKey.empty(), \"key not found : <integer/real>\");\n                }\n                \n                _curValue.append(text);\n            }\n            break;\n        default:\n            break;\n        }\n    }\n};\n\nValueMap FileUtils::getValueMapFromFile(const std::string& filename)\n{\n    std::string fullPath = fullPathForFilename(filename.c_str());\n    DictMaker tMaker;\n    return tMaker.dictionaryWithContentsOfFile(fullPath.c_str());\n}\n\nValueVector FileUtils::getValueVectorFromFile(const std::string& filename)\n{\n    std::string fullPath = fullPathForFilename(filename.c_str());\n    DictMaker tMaker;\n    return tMaker.arrayWithContentsOfFile(fullPath.c_str());\n}\n\n\n/*\n * forward statement\n */\nstatic tinyxml2::XMLElement* generateElementForArray(const ValueVector& array, tinyxml2::XMLDocument *doc);\nstatic tinyxml2::XMLElement* generateElementForDict(const ValueMap& dict, tinyxml2::XMLDocument *doc);\n\n/*\n * Use tinyxml2 to write plist files\n */\nbool FileUtils::writeToFile(ValueMap& dict, const std::string &fullPath)\n{\n    //CCLOG(\"tinyxml2 Dictionary %d writeToFile %s\", dict->_ID, fullPath.c_str());\n    tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();\n    if (nullptr == doc)\n        return false;\n    \n    tinyxml2::XMLDeclaration *declaration = doc->NewDeclaration(\"xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\");\n    if (nullptr == declaration)\n    {\n        delete doc;\n        return false;\n    }\n    \n    doc->LinkEndChild(declaration);\n    tinyxml2::XMLElement *docType = doc->NewElement(\"!DOCTYPE plist PUBLIC \\\"-//Apple//DTD PLIST 1.0//EN\\\" \\\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\\\"\");\n    doc->LinkEndChild(docType);\n    \n    tinyxml2::XMLElement *rootEle = doc->NewElement(\"plist\");\n    rootEle->SetAttribute(\"version\", \"1.0\");\n    if (nullptr == rootEle)\n    {\n        delete doc;\n        return false;\n    }\n    doc->LinkEndChild(rootEle);\n    \n    tinyxml2::XMLElement *innerDict = generateElementForDict(dict, doc);\n    if (nullptr == innerDict )\n    {\n        delete doc;\n        return false;\n    }\n    rootEle->LinkEndChild(innerDict);\n    \n    bool ret = tinyxml2::XML_SUCCESS == doc->SaveFile(fullPath.c_str());\n    \n    delete doc;\n    return ret;\n}\n\n/*\n * Generate tinyxml2::XMLElement for Object through a tinyxml2::XMLDocument\n */\nstatic tinyxml2::XMLElement* generateElementForObject(const Value& value, tinyxml2::XMLDocument *doc)\n{\n    // object is String\n    if (value.getType() == Value::Type::STRING)\n    {\n        tinyxml2::XMLElement* node = doc->NewElement(\"string\");\n        tinyxml2::XMLText* content = doc->NewText(value.asString().c_str());\n        node->LinkEndChild(content);\n        return node;\n    }\n    \n    // object is integer\n    if (value.getType() == Value::Type::INTEGER)\n    {\n        tinyxml2::XMLElement* node = doc->NewElement(\"integer\");\n        tinyxml2::XMLText* content = doc->NewText(value.asString().c_str());\n        node->LinkEndChild(content);\n        return node;\n    }\n\n    // object is real\n    if (value.getType() == Value::Type::FLOAT || value.getType() == Value::Type::DOUBLE)\n    {\n        tinyxml2::XMLElement* node = doc->NewElement(\"real\");\n        tinyxml2::XMLText* content = doc->NewText(value.asString().c_str());\n        node->LinkEndChild(content);\n        return node;\n    }\n\n    //FIXME:XXX How to deal with Boolean ??\n\n    // object is Array\n    if (value.getType() == Value::Type::VECTOR)\n        return generateElementForArray(value.asValueVector(), doc);\n    \n    // object is Dictionary\n    if (value.getType() == Value::Type::MAP)\n        return generateElementForDict(value.asValueMap(), doc);\n    \n    CCLOG(\"This type cannot appear in property list\");\n    return nullptr;\n}\n\n/*\n * Generate tinyxml2::XMLElement for Dictionary through a tinyxml2::XMLDocument\n */\nstatic tinyxml2::XMLElement* generateElementForDict(const ValueMap& dict, tinyxml2::XMLDocument *doc)\n{\n    tinyxml2::XMLElement* rootNode = doc->NewElement(\"dict\");\n    \n    for (auto iter = dict.begin(); iter != dict.end(); ++iter)\n    {\n        tinyxml2::XMLElement* tmpNode = doc->NewElement(\"key\");\n        rootNode->LinkEndChild(tmpNode);\n        tinyxml2::XMLText* content = doc->NewText(iter->first.c_str());\n        tmpNode->LinkEndChild(content);\n        \n        tinyxml2::XMLElement *element = generateElementForObject(iter->second, doc);\n        if (element)\n            rootNode->LinkEndChild(element);\n    }\n    return rootNode;\n}\n\n/*\n * Generate tinyxml2::XMLElement for Array through a tinyxml2::XMLDocument\n */\nstatic tinyxml2::XMLElement* generateElementForArray(const ValueVector& array, tinyxml2::XMLDocument *pDoc)\n{\n    tinyxml2::XMLElement* rootNode = pDoc->NewElement(\"array\");\n\n    for(const auto &value : array) {\n        tinyxml2::XMLElement *element = generateElementForObject(value, pDoc);\n        if (element)\n            rootNode->LinkEndChild(element);\n    }\n    return rootNode;\n}\n\n\n#else\nNS_CC_BEGIN\n\n/* The subclass FileUtilsApple should override these two method. */\nValueMap FileUtils::getValueMapFromFile(const std::string& filename) {return ValueMap();}\nValueVector FileUtils::getValueVectorFromFile(const std::string& filename) {return ValueVector();}\nbool FileUtils::writeToFile(ValueMap& dict, const std::string &fullPath) {return false;}\n\n#endif /* (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) */\n\n\nFileUtils* FileUtils::s_sharedFileUtils = nullptr;\n\n\nvoid FileUtils::destroyInstance()\n{\n    CC_SAFE_DELETE(s_sharedFileUtils);\n}\n\nFileUtils::FileUtils()\n{\n}\n\nFileUtils::~FileUtils()\n{\n}\n\n\nbool FileUtils::init()\n{\n    _searchPathArray.push_back(_defaultResRootPath);\n    _searchResolutionsOrderArray.push_back(\"\");\n    return true;\n}\n\nvoid FileUtils::purgeCachedEntries()\n{\n    _fullPathCache.clear();\n}\n\nstatic Data getData(const std::string& filename, bool forString)\n{\n    CCASSERT(!filename.empty(), \"Invalid filename!\");\n    \n    Data ret;\n    unsigned char* buffer = nullptr;\n    ssize_t size = 0;\n    const char* mode = nullptr;\n    if (forString)\n        mode = \"rt\";\n    else\n        mode = \"rb\";\n    \n    do\n    {\n        // Read the file from hardware\n        std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filename);\n        FILE *fp = fopen(fullPath.c_str(), mode);\n        CC_BREAK_IF(!fp);\n        fseek(fp,0,SEEK_END);\n        size = ftell(fp);\n        fseek(fp,0,SEEK_SET);\n        \n        if (forString)\n        {\n            buffer = (unsigned char*)malloc(sizeof(unsigned char) * (size + 1));\n            buffer[size] = '\\0';\n        }\n        else\n        {\n            buffer = (unsigned char*)malloc(sizeof(unsigned char) * size);\n        }\n        \n        size = fread(buffer, sizeof(unsigned char), size, fp);\n        fclose(fp);\n    } while (0);\n    \n    if (nullptr == buffer || 0 == size)\n    {\n        std::string msg = \"Get data from file(\";\n        msg.append(filename).append(\") failed!\");\n        CCLOG(\"%s\", msg.c_str());\n    }\n    else\n    {\n        ret.fastSet(buffer, size);\n    }\n    \n    return ret;\n}\n\nstd::string FileUtils::getStringFromFile(const std::string& filename)\n{\n    Data data = getData(filename, true);\n    if (data.isNull())\n    \treturn \"\";\n    std::string ret((const char*)data.getBytes());\n    return ret;\n}\n\nData FileUtils::getDataFromFile(const std::string& filename)\n{\n    return getData(filename, false);\n}\n\nunsigned char* FileUtils::getFileData(const std::string& filename, const char* mode, ssize_t *size)\n{\n    unsigned char * buffer = nullptr;\n    CCASSERT(!filename.empty() && size != nullptr && mode != nullptr, \"Invalid parameters.\");\n    *size = 0;\n    do\n    {\n        // read the file from hardware\n        std::string fullPath = fullPathForFilename(filename);\n        FILE *fp = fopen(fullPath.c_str(), mode);\n        CC_BREAK_IF(!fp);\n        \n        fseek(fp,0,SEEK_END);\n        *size = ftell(fp);\n        fseek(fp,0,SEEK_SET);\n        buffer = (unsigned char*)malloc(*size);\n        *size = fread(buffer,sizeof(unsigned char), *size,fp);\n        fclose(fp);\n    } while (0);\n    \n    if (! buffer)\n    {\n        std::string msg = \"Get data from file(\";\n        msg.append(filename).append(\") failed!\");\n        \n        CCLOG(\"%s\", msg.c_str());\n    }\n    return buffer;\n}\n\nunsigned char* FileUtils::getFileDataFromZip(const std::string& zipFilePath, const std::string& filename, ssize_t *size)\n{\n    unsigned char * buffer = nullptr;\n    unzFile file = nullptr;\n    *size = 0;\n\n    do \n    {\n        CC_BREAK_IF(zipFilePath.empty());\n\n        file = unzOpen(zipFilePath.c_str());\n        CC_BREAK_IF(!file);\n\n        int ret = unzLocateFile(file, filename.c_str(), 1);\n        CC_BREAK_IF(UNZ_OK != ret);\n\n        char filePathA[260];\n        unz_file_info fileInfo;\n        ret = unzGetCurrentFileInfo(file, &fileInfo, filePathA, sizeof(filePathA), nullptr, 0, nullptr, 0);\n        CC_BREAK_IF(UNZ_OK != ret);\n\n        ret = unzOpenCurrentFile(file);\n        CC_BREAK_IF(UNZ_OK != ret);\n\n        buffer = (unsigned char*)malloc(fileInfo.uncompressed_size);\n        int CC_UNUSED readedSize = unzReadCurrentFile(file, buffer, static_cast<unsigned>(fileInfo.uncompressed_size));\n        CCASSERT(readedSize == 0 || readedSize == (int)fileInfo.uncompressed_size, \"the file size is wrong\");\n\n        *size = fileInfo.uncompressed_size;\n        unzCloseCurrentFile(file);\n    } while (0);\n\n    if (file)\n    {\n        unzClose(file);\n    }\n\n    return buffer;\n}\n\nstd::string FileUtils::getNewFilename(const std::string &filename)\n{\n    std::string newFileName;\n    \n    // in Lookup Filename dictionary ?\n    auto iter = _filenameLookupDict.find(filename);\n\n    if (iter == _filenameLookupDict.end())\n    {\n        newFileName = filename;\n    }\n    else\n    {\n        newFileName = iter->second.asString();\n    }\n    return newFileName;\n}\n\nstd::string FileUtils::getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath)\n{\n    std::string file = filename;\n    std::string file_path = \"\";\n    size_t pos = filename.find_last_of(\"/\");\n    if (pos != std::string::npos)\n    {\n        file_path = filename.substr(0, pos+1);\n        file = filename.substr(pos+1);\n    }\n    \n    // searchPath + file_path + resourceDirectory\n    std::string path = searchPath;\n    path += file_path;\n    path += resolutionDirectory;\n    \n    path = getFullPathForDirectoryAndFilename(path, file);\n    \n    //CCLOG(\"getPathForFilename, fullPath = %s\", path.c_str());\n    return path;\n}\n\n\nstd::string FileUtils::fullPathForFilename(const std::string &filename)\n{\n    if (isAbsolutePath(filename))\n    {\n        return filename;\n    }\n\n    // Already Cached ?\n    auto cacheIter = _fullPathCache.find(filename);\n    if( cacheIter != _fullPathCache.end() )\n    {\n        return cacheIter->second;\n    }\n    \n    // Get the new file name.\n    std::string newFilename( getNewFilename(filename) );\n    \n    string fullpath = \"\";\n    \n    for (auto searchIt = _searchPathArray.begin(); searchIt != _searchPathArray.end(); ++searchIt) {\n        for (auto resolutionIt = _searchResolutionsOrderArray.begin(); resolutionIt != _searchResolutionsOrderArray.end(); ++resolutionIt) {\n            \n            fullpath = this->getPathForFilename(newFilename, *resolutionIt, *searchIt);\n            \n            if (fullpath.length() > 0)\n            {\n                // Using the filename passed in as key.\n                _fullPathCache.insert(std::pair<std::string, std::string>(filename, fullpath));\n                return fullpath;\n            }\n        }\n    }\n    \n    CCLOG(\"cocos2d: fullPathForFilename: No file found at %s. Possible missing file.\", filename.c_str());\n\n    // XXX: Should it return nullptr ? or an empty string ?\n    // The file wasn't found, return the file name passed in.\n    return filename;\n}\n\nstd::string FileUtils::fullPathFromRelativeFile(const std::string &filename, const std::string &relativeFile)\n{\n    return relativeFile.substr(0, relativeFile.rfind('/')+1) + getNewFilename(filename);\n}\n\nvoid FileUtils::setSearchResolutionsOrder(const std::vector<std::string>& searchResolutionsOrder)\n{\n    bool existDefault = false;\n    _fullPathCache.clear();\n    _searchResolutionsOrderArray.clear();\n    for(auto iter = searchResolutionsOrder.begin(); iter != searchResolutionsOrder.end(); ++iter)\n    {\n        std::string resolutionDirectory = *iter;\n        if (!existDefault && resolutionDirectory == \"\")\n        {\n            existDefault = true;\n        }\n        \n        if (resolutionDirectory.length() > 0 && resolutionDirectory[resolutionDirectory.length()-1] != '/')\n        {\n            resolutionDirectory += \"/\";\n        }\n        \n        _searchResolutionsOrderArray.push_back(resolutionDirectory);\n    }\n    if (!existDefault)\n    {\n        _searchResolutionsOrderArray.push_back(\"\");\n    }\n}\n\nvoid FileUtils::addSearchResolutionsOrder(const std::string &order)\n{\n    _searchResolutionsOrderArray.push_back(order);\n}\n\nconst std::vector<std::string>& FileUtils::getSearchResolutionsOrder()\n{\n    return _searchResolutionsOrderArray;\n}\n\nconst std::vector<std::string>& FileUtils::getSearchPaths() const\n{\n    return _searchPathArray;\n}\n\nvoid FileUtils::setSearchPaths(const std::vector<std::string>& searchPaths)\n{\n    bool existDefaultRootPath = false;\n    \n    _fullPathCache.clear();\n    _searchPathArray.clear();\n    for (auto iter = searchPaths.begin(); iter != searchPaths.end(); ++iter)\n    {\n        std::string prefix;\n        std::string path;\n        \n        if (!isAbsolutePath(*iter))\n        { // Not an absolute path\n            prefix = _defaultResRootPath;\n        }\n        path = prefix + (*iter);\n        if (path.length() > 0 && path[path.length()-1] != '/')\n        {\n            path += \"/\";\n        }\n        if (!existDefaultRootPath && path == _defaultResRootPath)\n        {\n            existDefaultRootPath = true;\n        }\n        _searchPathArray.push_back(path);\n    }\n    \n    if (!existDefaultRootPath)\n    {\n        //CCLOG(\"Default root path doesn't exist, adding it.\");\n        _searchPathArray.push_back(_defaultResRootPath);\n    }\n}\n\nvoid FileUtils::addSearchPath(const std::string &searchpath)\n{\n    std::string prefix;\n    if (!isAbsolutePath(searchpath))\n        prefix = _defaultResRootPath;\n\n    std::string path = prefix + searchpath;\n    if (path.length() > 0 && path[path.length()-1] != '/')\n    {\n        path += \"/\";\n    }\n    _searchPathArray.push_back(path);\n}\n\nvoid FileUtils::setFilenameLookupDictionary(const ValueMap& filenameLookupDict)\n{\n    _fullPathCache.clear();    \n    _filenameLookupDict = filenameLookupDict;\n}\n\nvoid FileUtils::loadFilenameLookupDictionaryFromFile(const std::string &filename)\n{\n    std::string fullPath = fullPathForFilename(filename);\n    if (fullPath.length() > 0)\n    {\n        ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);\n        if (!dict.empty())\n        {\n            ValueMap& metadata =  dict[\"metadata\"].asValueMap();\n            int version = metadata[\"version\"].asInt();\n            if (version != 1)\n            {\n                CCLOG(\"cocos2d: ERROR: Invalid filenameLookup dictionary version: %d. Filename: %s\", version, filename.c_str());\n                return;\n            }\n            setFilenameLookupDictionary( dict[\"filenames\"].asValueMap());\n        }\n    }\n}\n\nstd::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename)\n{\n    // get directory+filename, safely adding '/' as necessary \n    std::string ret = directory;\n    if (directory.size() && directory[directory.size()-1] != '/'){\n        ret += '/';\n    }\n    ret += filename;\n    \n    // if the file doesn't exist, return an empty string\n    if (!isFileExist(ret)) {\n        ret = \"\";\n    }\n    return ret;\n}\n\nbool FileUtils::isAbsolutePath(const std::string& path) const\n{\n    return (path[0] == '/');\n}\n\n//////////////////////////////////////////////////////////////////////////\n// Notification support when getFileData from invalid file path.\n//////////////////////////////////////////////////////////////////////////\nstatic bool s_popupNotify = true;\n\nvoid FileUtils::setPopupNotify(bool notify)\n{\n    s_popupNotify = notify;\n}\n\nbool FileUtils::isPopupNotify()\n{\n    return s_popupNotify;\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCFileUtils.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2013 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_FILEUTILS_H__\n#define __CC_FILEUTILS_H__\n\n#include <string>\n#include <vector>\n#include <unordered_map>\n#include \"CCPlatformMacros.h\"\n#include \"ccTypes.h\"\n#include \"CCValue.h\"\n#include \"CCData.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n//! @brief  Helper class to handle file operations\nclass CC_DLL FileUtils\n{\npublic:\n    /**\n     *  Gets the instance of FileUtils.\n     */\n    static FileUtils* getInstance();\n\n    /**\n     *  Destroys the instance of FileUtils.\n     */\n    static void destroyInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static FileUtils* sharedFileUtils() { return getInstance(); }\n\n    /** @deprecated Use destroyInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static void purgeFileUtils() { destroyInstance(); }\n\n    /**\n     *  The destructor of FileUtils.\n     * @js NA\n     * @lua NA\n     */\n    virtual ~FileUtils();\n    \n    /**\n     *  Purges the file searching cache.\n     *\n     *  @note It should be invoked after the resources were updated.\n     *        For instance, in the CocosPlayer sample, every time you run application from CocosBuilder,\n     *        All the resources will be downloaded to the writable folder, before new js app launchs,\n     *        this method should be invoked to clean the file search cache.\n     */\n    virtual void purgeCachedEntries();\n    \n    /**\n     *  Gets string from a file.\n     */\n    virtual std::string getStringFromFile(const std::string& filename);\n    \n    /**\n     *  Creates binary data from a file.\n     *  @return A data object.\n     */\n    virtual Data getDataFromFile(const std::string& filename);\n    \n    /**\n     *  Gets resource file data\n     *\n     *  @param[in]  filename The resource file name which contains the path.\n     *  @param[in]  pszMode The read mode of the file.\n     *  @param[out] pSize If the file read operation succeeds, it will be the data size, otherwise 0.\n     *  @return Upon success, a pointer to the data is returned, otherwise NULL.\n     *  @warning Recall: you are responsible for calling free() on any Non-NULL pointer returned.\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual unsigned char* getFileData(const std::string& filename, const char* mode, ssize_t *size);\n\n    /**\n     *  Gets resource file data from a zip file.\n     *\n     *  @param[in]  filename The resource file name which contains the relative path of the zip file.\n     *  @param[out] size If the file read operation succeeds, it will be the data size, otherwise 0.\n     *  @return Upon success, a pointer to the data is returned, otherwise nullptr.\n     *  @warning Recall: you are responsible for calling free() on any Non-nullptr pointer returned.\n     */\n    virtual unsigned char* getFileDataFromZip(const std::string& zipFilePath, const std::string& filename, ssize_t *size);\n\n    \n    /** Returns the fullpath for a given filename.\n     \n     First it will try to get a new filename from the \"filenameLookup\" dictionary.\n     If a new filename can't be found on the dictionary, it will use the original filename.\n     Then it will try to obtain the full path of the filename using the FileUtils search rules: resolutions, and search paths.\n     The file search is based on the array element order of search paths and resolution directories.\n     \n     For instance:\n\n     \tWe set two elements(\"/mnt/sdcard/\", \"internal_dir/\") to search paths vector by setSearchPaths,\n     \tand set three elements(\"resources-ipadhd/\", \"resources-ipad/\", \"resources-iphonehd\")\n     \tto resolutions vector by setSearchResolutionsOrder. The \"internal_dir\" is relative to \"Resources/\".\n\n\t\tIf we have a file named 'sprite.png', the mapping in fileLookup dictionary contains `key: sprite.png -> value: sprite.pvr.gz`.\n     \tFirstly, it will replace 'sprite.png' with 'sprite.pvr.gz', then searching the file sprite.pvr.gz as follows:\n\n     \t    /mnt/sdcard/resources-ipadhd/sprite.pvr.gz      (if not found, search next)\n     \t    /mnt/sdcard/resources-ipad/sprite.pvr.gz        (if not found, search next)\n     \t    /mnt/sdcard/resources-iphonehd/sprite.pvr.gz    (if not found, search next)\n     \t    /mnt/sdcard/sprite.pvr.gz                       (if not found, search next)\n     \t    internal_dir/resources-ipadhd/sprite.pvr.gz     (if not found, search next)\n     \t    internal_dir/resources-ipad/sprite.pvr.gz       (if not found, search next)\n     \t    internal_dir/resources-iphonehd/sprite.pvr.gz   (if not found, search next)\n     \t    internal_dir/sprite.pvr.gz                      (if not found, return \"sprite.png\")\n\n        If the filename contains relative path like \"gamescene/uilayer/sprite.png\",\n        and the mapping in fileLookup dictionary contains `key: gamescene/uilayer/sprite.png -> value: gamescene/uilayer/sprite.pvr.gz`.\n        The file search order will be:\n\n     \t    /mnt/sdcard/gamescene/uilayer/resources-ipadhd/sprite.pvr.gz      (if not found, search next)\n     \t    /mnt/sdcard/gamescene/uilayer/resources-ipad/sprite.pvr.gz        (if not found, search next)\n     \t    /mnt/sdcard/gamescene/uilayer/resources-iphonehd/sprite.pvr.gz    (if not found, search next)\n     \t    /mnt/sdcard/gamescene/uilayer/sprite.pvr.gz                       (if not found, search next)\n     \t    internal_dir/gamescene/uilayer/resources-ipadhd/sprite.pvr.gz     (if not found, search next)\n     \t    internal_dir/gamescene/uilayer/resources-ipad/sprite.pvr.gz       (if not found, search next)\n     \t    internal_dir/gamescene/uilayer/resources-iphonehd/sprite.pvr.gz   (if not found, search next)\n     \t    internal_dir/gamescene/uilayer/sprite.pvr.gz                      (if not found, return \"gamescene/uilayer/sprite.png\")\n\n     If the new file can't be found on the file system, it will return the parameter filename directly.\n     \n     This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable,\n     you might need to load different resources for a given file in the different platforms.\n\n     @since v2.1\n     */\n    virtual std::string fullPathForFilename(const std::string &filename);\n    \n    /**\n     * Loads the filenameLookup dictionary from the contents of a filename.\n     * \n     * @note The plist file name should follow the format below:\n     * \n     * @code\n     * <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n     * <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n     * <plist version=\"1.0\">\n     * <dict>\n     *     <key>filenames</key>\n     *     <dict>\n     *         <key>sounds/click.wav</key>\n     *         <string>sounds/click.caf</string>\n     *         <key>sounds/endgame.wav</key>\n     *         <string>sounds/endgame.caf</string>\n     *         <key>sounds/gem-0.wav</key>\n     *         <string>sounds/gem-0.caf</string>\n     *     </dict>\n     *     <key>metadata</key>\n     *     <dict>\n     *         <key>version</key>\n     *         <integer>1</integer>\n     *     </dict>\n     * </dict>\n     * </plist>\n     * @endcode\n     * @param filename The plist file name.\n     *\n     @since v2.1\n     * @js loadFilenameLookup\n     * @lua loadFilenameLookup\n     */\n    virtual void loadFilenameLookupDictionaryFromFile(const std::string &filename);\n    \n    /** \n     *  Sets the filenameLookup dictionary.\n     *\n     *  @param pFilenameLookupDict The dictionary for replacing filename.\n     *  @since v2.1\n     */\n    virtual void setFilenameLookupDictionary(const ValueMap& filenameLookupDict);\n    \n    /**\n     *  Gets full path from a file name and the path of the reletive file.\n     *  @param filename The file name.\n     *  @param pszRelativeFile The path of the relative file.\n     *  @return The full path.\n     *          e.g. filename: hello.png, pszRelativeFile: /User/path1/path2/hello.plist\n     *               Return: /User/path1/path2/hello.pvr (If there a a key(hello.png)-value(hello.pvr) in FilenameLookup dictionary. )\n     *\n     */\n    virtual std::string fullPathFromRelativeFile(const std::string &filename, const std::string &relativeFile);\n\n    /** \n     *  Sets the array that contains the search order of the resources.\n     *\n     *  @param searchResolutionsOrder The source array that contains the search order of the resources.\n     *  @see getSearchResolutionsOrder(void), fullPathForFilename(const char*).\n     *  @since v2.1\n     *  In js:var setSearchResolutionsOrder(var jsval)\n     *  @lua NA\n     */\n    virtual void setSearchResolutionsOrder(const std::vector<std::string>& searchResolutionsOrder);\n\n    /**\n      * Append search order of the resources.\n      *\n      * @see setSearchResolutionsOrder(), fullPathForFilename().\n      * @since v2.1\n      */\n    virtual void addSearchResolutionsOrder(const std::string &order);\n    \n    /**\n     *  Gets the array that contains the search order of the resources.\n     *\n     *  @see setSearchResolutionsOrder(const std::vector<std::string>&), fullPathForFilename(const char*).\n     *  @since v2.1\n     *  @lua NA\n     */\n    virtual const std::vector<std::string>& getSearchResolutionsOrder();\n    \n    /** \n     *  Sets the array of search paths.\n     * \n     *  You can use this array to modify the search path of the resources.\n     *  If you want to use \"themes\" or search resources in the \"cache\", you can do it easily by adding new entries in this array.\n     *\n     *  @note This method could access relative path and absolute path.\n     *        If the relative path was passed to the vector, FileUtils will add the default resource directory before the relative path.\n     *        For instance:\n     *        \tOn Android, the default resource root path is \"assets/\".\n     *        \tIf \"/mnt/sdcard/\" and \"resources-large\" were set to the search paths vector,\n     *        \t\"resources-large\" will be converted to \"assets/resources-large\" since it was a relative path.\n     *\n     *  @param searchPaths The array contains search paths.\n     *  @see fullPathForFilename(const char*)\n     *  @since v2.1\n     *  In js:var setSearchPaths(var jsval);\n     *  @lua NA\n     */\n    virtual void setSearchPaths(const std::vector<std::string>& searchPaths);\n    \n    /**\n      * Add search path.\n      *\n      * @since v2.1\n      */\n    void addSearchPath(const std::string & path);\n    \n    /**\n     *  Gets the array of search paths.\n     *  \n     *  @return The array of search paths.\n     *  @see fullPathForFilename(const char*).\n     *  @lua NA\n     */\n    virtual const std::vector<std::string>& getSearchPaths() const;\n\n    /**\n     *  Gets the writable path.\n     *  @return  The path that can be write/read a file in\n     */\n    virtual std::string getWritablePath() const = 0;\n    \n    /**\n     *  Checks whether a file exists.\n     *\n     *  @note If a relative path was passed in, it will be inserted a default root path at the beginning.\n     *  @param strFilePath The path of the file, it could be a relative or absolute path.\n     *  @return true if the file exists, otherwise it will return false.\n     */\n    virtual bool isFileExist(const std::string& filePath) const = 0;\n    \n    /**\n     *  Checks whether the path is an absolute path.\n     *\n     *  @note On Android, if the parameter passed in is relative to \"assets/\", this method will treat it as an absolute path.\n     *        Also on Blackberry, path starts with \"app/native/Resources/\" is treated as an absolute path.\n     *\n     *  @param strPath The path that needs to be checked.\n     *  @return true if it's an absolute path, otherwise it will return false.\n     */\n    virtual bool isAbsolutePath(const std::string& path) const;\n    \n    \n    /**\n     *  Sets/Gets whether to pop-up a message box when failed to load an image.\n     */\n    virtual void setPopupNotify(bool notify);\n    virtual bool isPopupNotify();\n\n    /**\n     *  Converts the contents of a file to a ValueMap.\n     *  @note This method is used internally.\n     */\n    virtual ValueMap getValueMapFromFile(const std::string& filename);\n    \n    /**\n     *  Write a ValueMap to a plist file.\n     *  @note This method is used internally.\n     */\n    virtual bool writeToFile(ValueMap& dict, const std::string& fullPath);\n    \n    /**\n     *  Converts the contents of a file to a ValueVector.\n     *  @note This method is used internally.\n     */\n    virtual ValueVector getValueVectorFromFile(const std::string& filename);\n\n    /** Returns the full path cache */\n    const std::unordered_map<std::string, std::string>& getFullPathCache() const { return _fullPathCache; }\n\nprotected:\n    /**\n     *  The default constructor.\n     */\n    FileUtils();\n    \n    /**\n     *  Initializes the instance of FileUtils. It will set _searchPathArray and _searchResolutionsOrderArray to default values.\n     *\n     *  @note When you are porting Cocos2d-x to a new platform, you may need to take care of this method.\n     *        You could assign a default value to _defaultResRootPath in the subclass of FileUtils(e.g. FileUtilsAndroid). Then invoke the FileUtils::init().\n     *  @return true if successed, otherwise it returns false.\n     *\n     */\n    virtual bool init();\n    \n    /**\n     *  Gets the new filename from the filename lookup dictionary.\n     *  It is possible to have a override names.\n     *  @param filename The original filename.\n     *  @return The new filename after searching in the filename lookup dictionary.\n     *          If the original filename wasn't in the dictionary, it will return the original filename.\n     */\n    virtual std::string getNewFilename(const std::string &filename);\n    \n    /**\n     *  Gets full path for filename, resolution directory and search path.\n     *\n     *  @param filename The file name.\n     *  @param resolutionDirectory The resolution directory.\n     *  @param searchPath The search path.\n     *  @return The full path of the file. It will return an empty string if the full path of the file doesn't exist.\n     */\n    virtual std::string getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath);\n    \n    /**\n     *  Gets full path for the directory and the filename.\n     *\n     *  @note Only iOS and Mac need to override this method since they are using\n     *        `[[NSBundle mainBundle] pathForResource: ofType: inDirectory:]` to make a full path.\n     *        Other platforms will use the default implementation of this method.\n     *  @param strDirectory The directory contains the file we are looking for.\n     *  @param strFilename  The name of the file.\n     *  @return The full path of the file, if the file can't be found, it will return an empty string.\n     */\n    virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename);\n    \n    \n    /** Dictionary used to lookup filenames based on a key.\n     *  It is used internally by the following methods:\n     *\n     *  std::string fullPathForFilename(const char*);\n     *\n     *  @since v2.1\n     */\n    ValueMap _filenameLookupDict;\n    \n    /** \n     *  The vector contains resolution folders.\n     *  The lower index of the element in this vector, the higher priority for this resolution directory.\n     */\n    std::vector<std::string> _searchResolutionsOrderArray;\n    \n    /**\n     * The vector contains search paths.\n     * The lower index of the element in this vector, the higher priority for this search path.\n     */\n    std::vector<std::string> _searchPathArray;\n    \n    /**\n     *  The default root path of resources.\n     *  If the default root path of resources needs to be changed, do it in the `init` method of FileUtils's subclass.\n     *  For instance:\n     *  On Android, the default root path of resources will be assigned with \"assets/\" in FileUtilsAndroid::init().\n     *  Similarly on Blackberry, we assign \"app/native/Resources/\" to this variable in FileUtilsBlackberry::init().\n     */\n    std::string _defaultResRootPath;\n    \n    /**\n     *  The full path cache. When a file is found, it will be added into this cache. \n     *  This variable is used for improving the performance of file search.\n     */\n    std::unordered_map<std::string, std::string> _fullPathCache;\n    \n    /**\n     *  The singleton pointer of FileUtils.\n     */\n    static FileUtils* s_sharedFileUtils;\n    \n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_FILEUTILS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCImage.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_IMAGE_H__\n#define __CC_IMAGE_H__\n\n#include \"CCObject.h\"\n#include \"CCTexture2D.h\"\n\n// premultiply alpha, or the effect will wrong when want to use other pixel format in Texture2D,\n// such as RGB888, RGB5A1\n#define CC_RGB_PREMULTIPLY_ALPHA(vr, vg, vb, va) \\\n    (unsigned)(((unsigned)((unsigned char)(vr) * ((unsigned char)(va) + 1)) >> 8) | \\\n    ((unsigned)((unsigned char)(vg) * ((unsigned char)(va) + 1) >> 8) << 8) | \\\n    ((unsigned)((unsigned char)(vb) * ((unsigned char)(va) + 1) >> 8) << 16) | \\\n    ((unsigned)(unsigned char)(va) << 24))\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n/**\n @brief Structure which can tell where mipmap begins and how long is it\n */\ntypedef struct _MipmapInfo\n{\n    unsigned char* address;\n    int len;\n}MipmapInfo;\n\nclass CC_DLL Image : public Object\n{\npublic:\n    friend class TextureCache;\n    /**\n     * @js ctor\n     */\n    Image();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Image();\n\n    /** Supported formats for Image */\n    enum class Format\n    {\n        //! JPEG\n        JPG,\n        //! PNG\n        PNG,\n        //! TIFF\n        TIFF,\n        //! WebP\n        WEBP,\n        //! PVR\n        PVR,\n        //! ETC\n        ETC,\n        //! S3TC\n        S3TC,\n        //! ATITC\n        ATITC,\n        //! TGA\n        TGA,\n        //! Raw Data\n        RAW_DATA,\n        //! Unknown format\n        UNKOWN\n    };\n\n    enum class TextAlign\n    {\n        CENTER        = 0x33, ///< Horizontal center and vertical center.\n        TOP           = 0x13, ///< Horizontal center and vertical top.\n        TOP_RIGHT     = 0x12, ///< Horizontal right and vertical top.\n        RIGHT         = 0x32, ///< Horizontal right and vertical center.\n        BOTTOM_RIGHT = 0x22, ///< Horizontal right and vertical bottom.\n        BOTTOM        = 0x23, ///< Horizontal center and vertical bottom.\n        BOTTOM_LEFT  = 0x21, ///< Horizontal left and vertical bottom.\n        LEFT          = 0x31, ///< Horizontal left and vertical center.\n        TOP_LEFT      = 0x11, ///< Horizontal left and vertical top.\n    };\n    \n    /**\n    @brief Load the image from the specified path.\n    @param path   the absolute file path.\n    @return true if loaded correctly.\n    */\n    bool initWithImageFile(const std::string& path);\n\n    /**\n    @brief Load image from stream buffer.\n    @param data  stream buffer which holds the image data.\n    @param dataLen  data length expressed in (number of) bytes.\n    @return true if loaded correctly.\n    * @js NA\n    * @lua NA\n    */\n    bool initWithImageData(const unsigned char * data, ssize_t dataLen);\n\n    // @warning kFmtRawData only support RGBA8888\n    bool initWithRawData(const unsigned char * data, ssize_t dataLen, int width, int height, int bitsPerComponent, bool preMulti = false);\n\n    /**\n    @brief Create image with specified string.\n    @param text       the text the image will show (cannot be nil).\n    @param width      the image width, if 0, the width will match the text's width.\n    @param height     the image height, if 0, the height will match the text's height.\n    @param alignMask  the test Alignment\n    @param fontName   the name of the font used to draw the text. If nil, use the default system font.\n    @param size       the font size, if 0, use the system default size.\n    * @js NA\n    * @lua NA\n    */\n    bool initWithString(\n        const char *    text,\n        int             width = 0,\n        int             height = 0,\n        TextAlign       alignMask = TextAlign::CENTER,\n        const char *    fontName = 0,\n        int             size = 0);\n    \n    #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    \n        bool initWithStringShadowStroke(\n                                            const char *    pText,\n                                            int             nWidth      = 0,\n                                            int             nHeight     = 0,\n                                            TextAlign       eAlignMask  = TextAlign::CENTER,\n                                            const char *    pFontName   = 0,\n                                            int             nSize       = 0,\n                                            float           textTintR   = 1,\n                                            float           textTintG   = 1,\n                                            float           textTintB   = 1,\n                                            bool shadow                 = false,\n                                            float shadowOffsetX         = 0.0,\n                                            float shadowOffsetY         = 0.0,\n                                            float shadowOpacity         = 0.0,\n                                            float shadowBlur            = 0.0,\n                                            bool  stroke                =  false,\n                                            float strokeR               = 1,\n                                            float strokeG               = 1,\n                                            float strokeB               = 1,\n                                            float strokeSize            = 1\n                                        \n                                        );\n    \n    #endif\n    \n    \n    // Getters\n    inline unsigned char *   getData()               { return _data; }\n    inline ssize_t           getDataLen()            { return _dataLen; }\n    inline Format            getFileType()           {return _fileType; }\n    inline Texture2D::PixelFormat getRenderFormat()  { return _renderFormat; }\n    inline int               getWidth()              { return _width; }\n    inline int               getHeight()             { return _height; }\n    inline bool              isPremultipliedAlpha()  { return _preMulti;   }\n    inline int               getNumberOfMipmaps()    { return _numberOfMipmaps; }\n    inline MipmapInfo*       getMipmaps()            { return _mipmaps; }\n    inline bool              hasPremultipliedAlpha() { return _hasPremultipliedAlpha; }\n\n    int                      getBitPerPixel();\n    bool                     hasAlpha();\n    bool                     isCompressed();\n\n\n    /**\n     @brief    Save Image data to the specified file, with specified format.\n     @param    filePath        the file's absolute path, including file suffix.\n     @param    isToRGB        whether the image is saved as RGB format.\n     */\n    bool saveToFile(const std::string &filename, bool isToRGB = true);\n\nprotected:\n    bool initWithJpgData(const unsigned char *  data, ssize_t dataLen);\n    bool initWithPngData(const unsigned char * data, ssize_t dataLen);\n    bool initWithTiffData(const unsigned char * data, ssize_t dataLen);\n    bool initWithWebpData(const unsigned char * data, ssize_t dataLen);\n    bool initWithPVRData(const unsigned char * data, ssize_t dataLen);\n    bool initWithPVRv2Data(const unsigned char * data, ssize_t dataLen);\n    bool initWithPVRv3Data(const unsigned char * data, ssize_t dataLen);\n    bool initWithETCData(const unsigned char * data, ssize_t dataLen);\n    bool initWithS3TCData(const unsigned char * data, ssize_t dataLen);\n    bool initWithATITCData(const unsigned char *data, ssize_t dataLen);\n    typedef struct sImageTGA tImageTGA;\n    bool initWithTGAData(tImageTGA* tgaData);\n\n    bool saveImageToPNG(const std::string& filePath, bool isToRGB = true);\n    bool saveImageToJPG(const std::string& filePath);\n    \nprivate:\n    /**\n     @brief Determine how many mipmaps can we have.\n     Its same as define but it respects namespaces\n     */\n    static const int MIPMAP_MAX = 16;\n    unsigned char *_data;\n    ssize_t _dataLen;\n    int _width;\n    int _height;\n    Format _fileType;\n    Texture2D::PixelFormat _renderFormat;\n    bool _preMulti;\n    MipmapInfo _mipmaps[MIPMAP_MAX];   // pointer to mipmap images\n    int _numberOfMipmaps;\n    // false if we cann't auto detect the image is premultiplied or not.\n    bool _hasPremultipliedAlpha;\n    std::string _filePath;\n\n\nprivate:\n    // noncopyable\n    Image(const Image&    rImg);\n    Image & operator=(const Image&);\n    \n    /*\n     @brief The same result as with initWithImageFile, but thread safe. It is caused by\n     loadImage() in TextureCache.cpp.\n     @param fullpath  full path of the file.\n     @param imageType the type of image, currently only supporting two types.\n     @return  true if loaded correctly.\n     */\n    bool initWithImageFileThreadSafe(const std::string& fullpath);\n    \n    Format detectFormat(const unsigned char * data, ssize_t dataLen);\n    bool isPng(const unsigned char * data, ssize_t dataLen);\n    bool isJpg(const unsigned char * data, ssize_t dataLen);\n    bool isTiff(const unsigned char * data, ssize_t dataLen);\n    bool isWebp(const unsigned char * data, ssize_t dataLen);\n    bool isPvr(const unsigned char * data, ssize_t dataLen);\n    bool isEtc(const unsigned char * data, ssize_t dataLen);\n    bool isS3TC(const unsigned char * data,ssize_t dataLen);\n    bool isATITC(const unsigned char *data, ssize_t dataLen);\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_IMAGE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCImageCommon_cpp.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#include \"CCImage.h\"\n#include \"CCData.h\"\n\n#include <string>\n#include <ctype.h>\n\n#ifdef EMSCRIPTEN\n#include <SDL/SDL.h>\n#include <SDL/SDL_image.h>\n#endif // EMSCRIPTEN\n\nextern \"C\"\n{\n#include \"png.h\"\n#include \"tiffio.h\"\n#include \"etc1.h\"\n#include \"jpeglib.h\"\n}\n#include \"s3tc.h\"\n#include \"atitc.h\"\n#include \"TGAlib.h\"\n\n#include \"decode.h\"\n\n#include \"ccMacros.h\"\n#include \"CCCommon.h\"\n#include \"CCStdC.h\"\n#include \"CCFileUtils.h\"\n#include \"CCConfiguration.h\"\n#include \"ccUtils.h\"\n#include \"ZipUtils.h\"\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n#include \"android/CCFileUtilsAndroid.h\"\n#endif\n\n#define CC_GL_ATC_RGB_AMD                                          0x8C92\n#define CC_GL_ATC_RGBA_EXPLICIT_ALPHA_AMD                          0x8C93\n#define CC_GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD                      0x87EE\n\nNS_CC_BEGIN\n\n//////////////////////////////////////////////////////////////////////////\n//struct and data for pvr structure\n\nnamespace\n{\n    static const int PVR_TEXTURE_FLAG_TYPE_MASK = 0xff;\n    \n    // Values taken from PVRTexture.h from http://www.imgtec.com\n    enum class PVR2TextureFlag\n    {\n        Mipmap         = (1<<8),        // has mip map levels\n        Twiddle        = (1<<9),        // is twiddled\n        Bumpmap        = (1<<10),       // has normals encoded for a bump map\n        Tiling         = (1<<11),       // is bordered for tiled pvr\n        Cubemap        = (1<<12),       // is a cubemap/skybox\n        FalseMipCol    = (1<<13),       // are there false colored MIP levels\n        Volume         = (1<<14),       // is this a volume texture\n        Alpha          = (1<<15),       // v2.1 is there transparency info in the texture\n        VerticalFlip   = (1<<16),       // v2.1 is the texture vertically flipped\n    };\n    \n    enum class PVR3TextureFlag\n    {\n        PremultipliedAlpha\t= (1<<1)\t// has premultiplied alpha\n    };\n    \n    static const char gPVRTexIdentifier[5] = \"PVR!\";\n    \n    // v2\n    enum class PVR2TexturePixelFormat : unsigned char\n    {\n        RGBA4444 = 0x10,\n        RGBA5551,\n        RGBA8888,\n        RGB565,\n        RGB555,          // unsupported\n        RGB888,\n        I8,\n        AI88,\n        PVRTC2BPP_RGBA,\n        PVRTC4BPP_RGBA,\n        BGRA8888,\n        A8,\n    };\n        \n    // v3\n    enum class PVR3TexturePixelFormat : uint64_t\n    {\n        PVRTC2BPP_RGB  = 0ULL,\n        PVRTC2BPP_RGBA = 1ULL,\n        PVRTC4BPP_RGB  = 2ULL,\n        PVRTC4BPP_RGBA = 3ULL,\n            \n        BGRA8888       = 0x0808080861726762ULL,\n        RGBA8888       = 0x0808080861626772ULL,\n        RGBA4444       = 0x0404040461626772ULL,\n        RGBA5551       = 0x0105050561626772ULL,\n        RGB565         = 0x0005060500626772ULL,\n        RGB888         = 0x0008080800626772ULL,\n        A8             = 0x0000000800000061ULL,\n        L8             = 0x000000080000006cULL,\n        LA88           = 0x000008080000616cULL,\n    };\n        \n        \n    // v2\n    typedef const std::map<PVR2TexturePixelFormat, Texture2D::PixelFormat> _pixel2_formathash;\n    \n    static const _pixel2_formathash::value_type v2_pixel_formathash_value[] =\n    {\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::BGRA8888,\t    Texture2D::PixelFormat::BGRA8888),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA8888,\t    Texture2D::PixelFormat::RGBA8888),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA4444,\t    Texture2D::PixelFormat::RGBA4444),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGBA5551,\t    Texture2D::PixelFormat::RGB5A1),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGB565,\t    Texture2D::PixelFormat::RGB565),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::RGB888,\t    Texture2D::PixelFormat::RGB888),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::A8,\t        Texture2D::PixelFormat::A8),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::I8,\t        Texture2D::PixelFormat::I8),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::AI88,\t        Texture2D::PixelFormat::AI88),\n            \n#ifdef GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC2BPP_RGBA,\t    Texture2D::PixelFormat::PVRTC2A),\n        _pixel2_formathash::value_type(PVR2TexturePixelFormat::PVRTC4BPP_RGBA,\t    Texture2D::PixelFormat::PVRTC4A),\n#endif\n    };\n        \n    static const int PVR2_MAX_TABLE_ELEMENTS = sizeof(v2_pixel_formathash_value) / sizeof(v2_pixel_formathash_value[0]);\n    static const _pixel2_formathash v2_pixel_formathash(v2_pixel_formathash_value, v2_pixel_formathash_value + PVR2_MAX_TABLE_ELEMENTS);\n        \n    // v3\n    typedef const std::map<PVR3TexturePixelFormat, Texture2D::PixelFormat> _pixel3_formathash;\n    static _pixel3_formathash::value_type v3_pixel_formathash_value[] =\n    {\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::BGRA8888,\tTexture2D::PixelFormat::BGRA8888),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA8888,\tTexture2D::PixelFormat::RGBA8888),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA4444,\tTexture2D::PixelFormat::RGBA4444),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGBA5551,\tTexture2D::PixelFormat::RGB5A1),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGB565,\t    Texture2D::PixelFormat::RGB565),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::RGB888,\t    Texture2D::PixelFormat::RGB888),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::A8,\t        Texture2D::PixelFormat::A8),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::L8,\t        Texture2D::PixelFormat::I8),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::LA88,\t    Texture2D::PixelFormat::AI88),\n            \n#ifdef GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGB,\t    Texture2D::PixelFormat::PVRTC2),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC2BPP_RGBA,\t    Texture2D::PixelFormat::PVRTC2A),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGB,\t    Texture2D::PixelFormat::PVRTC4),\n        _pixel3_formathash::value_type(PVR3TexturePixelFormat::PVRTC4BPP_RGBA,\t    Texture2D::PixelFormat::PVRTC4A),\n#endif\n    };\n        \n    static const int PVR3_MAX_TABLE_ELEMENTS = sizeof(v3_pixel_formathash_value) / sizeof(v3_pixel_formathash_value[0]);\n        \n    static const _pixel3_formathash v3_pixel_formathash(v3_pixel_formathash_value, v3_pixel_formathash_value + PVR3_MAX_TABLE_ELEMENTS);\n        \n    typedef struct _PVRTexHeader\n    {\n        unsigned int headerLength;\n        unsigned int height;\n        unsigned int width;\n        unsigned int numMipmaps;\n        unsigned int flags;\n        unsigned int dataLength;\n        unsigned int bpp;\n        unsigned int bitmaskRed;\n        unsigned int bitmaskGreen;\n        unsigned int bitmaskBlue;\n        unsigned int bitmaskAlpha;\n        unsigned int pvrTag;\n        unsigned int numSurfs;\n    } PVRv2TexHeader;\n        \n#ifdef _MSC_VER\n#pragma pack(push,1)\n#endif\n    typedef struct\n    {\n        uint32_t version;\n        uint32_t flags;\n        uint64_t pixelFormat;\n        uint32_t colorSpace;\n        uint32_t channelType;\n        uint32_t height;\n        uint32_t width;\n        uint32_t depth;\n        uint32_t numberOfSurfaces;\n        uint32_t numberOfFaces;\n        uint32_t numberOfMipmaps;\n        uint32_t metadataLength;\n#ifdef _MSC_VER\n    } PVRv3TexHeader;\n#pragma pack(pop)\n#else\n    } __attribute__((packed)) PVRv3TexHeader;\n#endif\n}\n//pvr structure end\n\n//////////////////////////////////////////////////////////////////////////\n\n//struct and data for s3tc(dds) struct\nnamespace\n{\n    struct DDColorKey\n    {\n        uint32_t colorSpaceLowValue;\n        uint32_t colorSpaceHighValue;\n    };\n    \n    struct DDSCaps\n    {\n        uint32_t caps;\n        uint32_t caps2;\n        uint32_t caps3;\n        uint32_t caps4;\n    };\n    \n    struct DDPixelFormat\n    {\n        uint32_t size;\n        uint32_t flags;\n        uint32_t fourCC;\n        uint32_t RGBBitCount;\n        uint32_t RBitMask;\n        uint32_t GBitMask;\n        uint32_t BBitMask;\n        uint32_t ABitMask;\n    };\n    \n    \n    struct DDSURFACEDESC2\n    {\n        uint32_t size;\n        uint32_t flags;\n        uint32_t height;\n        uint32_t width;\n        \n        union\n        {\n            uint32_t pitch;\n            uint32_t linearSize;\n        } DUMMYUNIONNAMEN1;\n        \n        union\n        {\n            uint32_t backBufferCount;\n            uint32_t depth;\n        } DUMMYUNIONNAMEN5;\n        \n        union\n        {\n            uint32_t mipMapCount;\n            uint32_t refreshRate;\n            uint32_t srcVBHandle;\n        } DUMMYUNIONNAMEN2;\n        \n        uint32_t alphaBitDepth;\n        uint32_t reserved;\n        uint32_t surface;\n        \n        union\n        {\n            DDColorKey ddckCKDestOverlay;\n            uint32_t emptyFaceColor;\n        } DUMMYUNIONNAMEN3;\n        \n        DDColorKey ddckCKDestBlt;\n        DDColorKey ddckCKSrcOverlay;\n        DDColorKey ddckCKSrcBlt;\n        \n        union\n        {\n            DDPixelFormat ddpfPixelFormat;\n            uint32_t FVF;\n        } DUMMYUNIONNAMEN4;\n        \n        DDSCaps ddsCaps;\n        uint32_t textureStage;\n    } ;\n    \n#pragma pack(push,1)\n    \n    struct S3TCTexHeader\n    {\n        char fileCode[4];\n        DDSURFACEDESC2 ddsd;\n    };\n    \n#pragma pack(pop)\n\n}\n//s3tc struct end\n\n//////////////////////////////////////////////////////////////////////////\n\n//struct and data for atitc(ktx) struct\nnamespace\n{\n    struct ATITCTexHeader\n    {\n        //HEADER\n        char identifier[12];\n        uint32_t endianness;\n        uint32_t glType;\n        uint32_t glTypeSize;\n        uint32_t glFormat;\n        uint32_t glInternalFormat;\n        uint32_t glBaseInternalFormat;\n        uint32_t pixelWidth;\n        uint32_t pixelHeight;\n        uint32_t pixelDepth;\n        uint32_t numberOfArrayElements;\n        uint32_t numberOfFaces;\n        uint32_t numberOfMipmapLevels;\n        uint32_t bytesOfKeyValueData;\n    };\n}\n//atittc struct end\n\n//////////////////////////////////////////////////////////////////////////\n\nnamespace\n{\n    typedef struct \n    {\n        const unsigned char * data;\n        ssize_t size;\n        int offset;\n    }tImageSource;\n    \n    static void pngReadCallback(png_structp png_ptr, png_bytep data, png_size_t length)\n    {\n        tImageSource* isource = (tImageSource*)png_get_io_ptr(png_ptr);\n        \n        if((int)(isource->offset + length) <= isource->size)\n        {\n            memcpy(data, isource->data+isource->offset, length);\n            isource->offset += length;\n        }\n        else\n        {\n            png_error(png_ptr, \"pngReaderCallback failed\");\n        }\n    }\n}\n\n//////////////////////////////////////////////////////////////////////////\n// Implement Image\n//////////////////////////////////////////////////////////////////////////\n\nImage::Image()\n: _data(nullptr)\n, _dataLen(0)\n, _width(0)\n, _height(0)\n, _fileType(Format::UNKOWN)\n, _renderFormat(Texture2D::PixelFormat::NONE)\n, _preMulti(false)\n, _numberOfMipmaps(0)\n, _hasPremultipliedAlpha(true)\n{\n\n}\n\nImage::~Image()\n{\n    CC_SAFE_FREE(_data);\n}\n\nbool Image::initWithImageFile(const std::string& path)\n{\n    bool ret = false;\n    _filePath = FileUtils::getInstance()->fullPathForFilename(path);\n\n#ifdef EMSCRIPTEN\n    // Emscripten includes a re-implementation of SDL that uses HTML5 canvas\n    // operations underneath. Consequently, loading images via IMG_Load (an SDL\n    // API) will be a lot faster than running libpng et al as compiled with\n    // Emscripten.\n    SDL_Surface *iSurf = IMG_Load(fullPath.c_str());\n\n    int size = 4 * (iSurf->w * iSurf->h);\n    ret = initWithRawData((const unsigned char*)iSurf->pixels, size, iSurf->w, iSurf->h, 8, true);\n\n    unsigned int *tmp = (unsigned int *)_data;\n    int nrPixels = iSurf->w * iSurf->h;\n    for(int i = 0; i < nrPixels; i++)\n    {\n        unsigned char *p = _data + i * 4;\n        tmp[i] = CC_RGB_PREMULTIPLY_ALPHA( p[0], p[1], p[2], p[3] );\n    }\n\n    SDL_FreeSurface(iSurf);\n#else\n    Data data = FileUtils::getInstance()->getDataFromFile(_filePath);\n\n    if (!data.isNull())\n    {\n        ret = initWithImageData(data.getBytes(), data.getSize());\n    }\n#endif // EMSCRIPTEN\n\n    return ret;\n}\n\nbool Image::initWithImageFileThreadSafe(const std::string& fullpath)\n{\n    bool ret = false;\n    _filePath = fullpath;\n\n    Data data = FileUtils::getInstance()->getDataFromFile(fullpath);\n\n    if (!data.isNull())\n    {\n        ret = initWithImageData(data.getBytes(), data.getSize());\n    }\n\n    return ret;\n}\n\nbool Image::initWithImageData(const unsigned char * data, ssize_t dataLen)\n{\n    bool ret = false;\n    \n    do\n    {\n        CC_BREAK_IF(! data || dataLen <= 0);\n        \n        unsigned char* unpackedData = nullptr;\n        ssize_t unpackedLen = 0;\n        \n        //detecgt and unzip the compress file\n        if (ZipUtils::isCCZBuffer(data, dataLen))\n        {\n            unpackedLen = ZipUtils::inflateCCZBuffer(data, dataLen, &unpackedData);\n        }\n        else if (ZipUtils::isGZipBuffer(data, dataLen))\n        {\n            unpackedLen = ZipUtils::inflateMemory(const_cast<unsigned char*>(data), dataLen, &unpackedData);\n        }\n        else\n        {\n            unpackedData = const_cast<unsigned char*>(data);\n            unpackedLen = dataLen;\n        }\n\n        _fileType = detectFormat(unpackedData, unpackedLen);\n\n        switch (_fileType)\n        {\n        case Format::PNG:\n            ret = initWithPngData(unpackedData, unpackedLen);\n            break;\n        case Format::JPG:\n            ret = initWithJpgData(unpackedData, unpackedLen);\n            break;\n        case Format::TIFF:\n            ret = initWithTiffData(unpackedData, unpackedLen);\n            break;\n        case Format::WEBP:\n            ret = initWithWebpData(unpackedData, unpackedLen);\n            break;\n        case Format::PVR:\n            ret = initWithPVRData(unpackedData, unpackedLen);\n            break;\n        case Format::ETC:\n            ret = initWithETCData(unpackedData, unpackedLen);\n            break;\n        case Format::S3TC:\n            ret = initWithS3TCData(unpackedData, unpackedLen);\n            break;\n        case Format::ATITC:\n            ret = initWithATITCData(unpackedData, unpackedLen);\n            break;\n        default:\n            {\n                // load and detect image format\n                tImageTGA* tgaData = tgaLoadBuffer(unpackedData, unpackedLen);\n                \n                if (tgaData != nullptr && tgaData->status == TGA_OK)\n                {\n                    ret = initWithTGAData(tgaData);\n                }\n                else\n                {\n                    CCAssert(false, \"unsupport image format!\");\n                }\n                \n                free(tgaData);\n                break;\n            }\n        }\n        \n        if(unpackedData != data)\n        {\n            free(unpackedData);\n        }\n    } while (0);\n    \n    return ret;\n}\n\nbool Image::isPng(const unsigned char * data, ssize_t dataLen)\n{\n    if (dataLen <= 8)\n    {\n        return false;\n    }\n\n    static const unsigned char PNG_SIGNATURE[] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};\n\n    return memcmp(PNG_SIGNATURE, data, sizeof(PNG_SIGNATURE)) == 0;\n}\n\n\nbool Image::isEtc(const unsigned char * data, ssize_t dataLen)\n{\n    return etc1_pkm_is_valid((etc1_byte*)data) ? true : false;\n}\n\n\nbool Image::isS3TC(const unsigned char * data, ssize_t dataLen)\n{\n\n    S3TCTexHeader *header = (S3TCTexHeader *)data;\n    \n    if (strncmp(header->fileCode, \"DDS\", 3) != 0)\n    {\n        CCLOG(\"cocos2d: the file is not a dds file!\");\n        return false;\n    }\n    return true;\n}\n\nbool Image::isATITC(const unsigned char *data, ssize_t dataLen)\n{\n    ATITCTexHeader *header = (ATITCTexHeader *)data;\n    \n    if (strncmp(&header->identifier[1], \"KTX\", 3) != 0)\n    {\n        CCLOG(\"cocos3d: the file is not a ktx file!\");\n        return false;\n    }\n    return true;\n}\n\nbool Image::isJpg(const unsigned char * data, ssize_t dataLen)\n{\n    if (dataLen <= 4)\n    {\n        return false;\n    }\n\n    static const unsigned char JPG_SOI[] = {0xFF, 0xD8};\n\n    return memcmp(data, JPG_SOI, 2) == 0;\n}\n\nbool Image::isTiff(const unsigned char * data, ssize_t dataLen)\n{\n    if (dataLen <= 4)\n    {\n        return false;\n    }\n\n    static const char* TIFF_II = \"II\";\n    static const char* TIFF_MM = \"MM\";\n\n    return (memcmp(data, TIFF_II, 2) == 0 && *(static_cast<const unsigned char*>(data) + 2) == 42 && *(static_cast<const unsigned char*>(data) + 3) == 0) ||\n        (memcmp(data, TIFF_MM, 2) == 0 && *(static_cast<const unsigned char*>(data) + 2) == 0 && *(static_cast<const unsigned char*>(data) + 3) == 42);\n}\n\nbool Image::isWebp(const unsigned char * data, ssize_t dataLen)\n{\n    if (dataLen <= 12)\n    {\n        return false;\n    }\n\n    static const char* WEBP_RIFF = \"RIFF\";\n    static const char* WEBP_WEBP = \"WEBP\";\n\n    return memcmp(data, WEBP_RIFF, 4) == 0 \n        && memcmp(static_cast<const unsigned char*>(data) + 8, WEBP_WEBP, 4) == 0;\n}\n\nbool Image::isPvr(const unsigned char * data, ssize_t dataLen)\n{\n    if (static_cast<size_t>(dataLen) < sizeof(PVRv2TexHeader) || static_cast<size_t>(dataLen) < sizeof(PVRv3TexHeader))\n    {\n        return false;\n    }\n    \n    const PVRv2TexHeader* headerv2 = static_cast<const PVRv2TexHeader*>(static_cast<const void*>(data));\n    const PVRv3TexHeader* headerv3 = static_cast<const PVRv3TexHeader*>(static_cast<const void*>(data));\n    \n    return memcmp(&headerv2->pvrTag, gPVRTexIdentifier, strlen(gPVRTexIdentifier)) == 0 || CC_SWAP_INT32_BIG_TO_HOST(headerv3->version) == 0x50565203;\n}\n\nImage::Format Image::detectFormat(const unsigned char * data, ssize_t dataLen)\n{\n    if (isPng(data, dataLen))\n    {\n        return Format::PNG;\n    }\n    else if (isJpg(data, dataLen))\n    {\n        return Format::JPG;\n    }\n    else if (isTiff(data, dataLen))\n    {\n        return Format::TIFF;\n    }\n    else if (isWebp(data, dataLen))\n    {\n        return Format::WEBP;\n    }\n    else if (isPvr(data, dataLen))\n    {\n        return Format::PVR;\n    }\n    else if (isEtc(data, dataLen))\n    {\n        return Format::ETC;\n    }\n    else if (isS3TC(data, dataLen))\n    {\n        return Format::S3TC;\n    }\n    else if (isATITC(data, dataLen))\n    {\n        return Format::ATITC;\n    }\n    else\n    {\n        return Format::UNKOWN;\n    }\n}\n\nint Image::getBitPerPixel()\n{\n    return Texture2D::getPixelFormatInfoMap().at(_renderFormat).bpp;\n}\n\nbool Image::hasAlpha()\n{\n    return Texture2D::getPixelFormatInfoMap().at(_renderFormat).alpha;\n}\n\nbool Image::isCompressed()\n{\n    return Texture2D::getPixelFormatInfoMap().at(_renderFormat).compressed;\n}\n\nnamespace\n{\n/*\n * ERROR HANDLING:\n *\n * The JPEG library's standard error handler (jerror.c) is divided into\n * several \"methods\" which you can override individually.  This lets you\n * adjust the behavior without duplicating a lot of code, which you might\n * have to update with each future release.\n *\n * We override the \"error_exit\" method so that control is returned to the\n * library's caller when a fatal error occurs, rather than calling exit()\n * as the standard error_exit method does.\n *\n * We use C's setjmp/longjmp facility to return control.  This means that the\n * routine which calls the JPEG library must first execute a setjmp() call to\n * establish the return point.  We want the replacement error_exit to do a\n * longjmp().  But we need to make the setjmp buffer accessible to the\n * error_exit routine.  To do this, we make a private extension of the\n * standard JPEG error handler object.  (If we were using C++, we'd say we\n * were making a subclass of the regular error handler.)\n *\n * Here's the extended error handler struct:\n */\n    struct MyErrorMgr\n    {\n        struct jpeg_error_mgr pub;\t/* \"public\" fields */\n        jmp_buf setjmp_buffer;\t/* for return to caller */\n    };\n    \n    typedef struct MyErrorMgr * MyErrorPtr;\n    \n    /*\n     * Here's the routine that will replace the standard error_exit method:\n     */\n    \n    METHODDEF(void)\n    myErrorExit(j_common_ptr cinfo)\n    {\n        /* cinfo->err really points to a MyErrorMgr struct, so coerce pointer */\n        MyErrorPtr myerr = (MyErrorPtr) cinfo->err;\n        \n        /* Always display the message. */\n        /* We could postpone this until after returning, if we chose. */\n        /* internal message function cann't show error message in some platforms, so we rewrite it here.\n         * edit it if has version confilict.\n         */\n        //(*cinfo->err->output_message) (cinfo);\n        char buffer[JMSG_LENGTH_MAX];\n        (*cinfo->err->format_message) (cinfo, buffer);\n        CCLOG(\"jpeg error: %s\", buffer);\n        \n        /* Return control to the setjmp point */\n        longjmp(myerr->setjmp_buffer, 1);\n    }\n}\n\nbool Image::initWithJpgData(const unsigned char * data, ssize_t dataLen)\n{\n    /* these are standard libjpeg structures for reading(decompression) */\n    struct jpeg_decompress_struct cinfo;\n    /* We use our private extension JPEG error handler.\n\t * Note that this struct must live as long as the main JPEG parameter\n\t * struct, to avoid dangling-pointer problems.\n\t */\n\tstruct MyErrorMgr jerr;\n    /* libjpeg data structure for storing one row, that is, scanline of an image */\n    JSAMPROW row_pointer[1] = {0};\n    unsigned long location = 0;\n    unsigned int i = 0;\n\n    bool bRet = false;\n    do \n    {\n        /* We set up the normal JPEG error routines, then override error_exit. */\n\t\tcinfo.err = jpeg_std_error(&jerr.pub);\n\t\tjerr.pub.error_exit = myErrorExit;\n\t\t/* Establish the setjmp return context for MyErrorExit to use. */\n\t\tif (setjmp(jerr.setjmp_buffer)) {\n\t\t\t/* If we get here, the JPEG code has signaled an error.\n\t\t\t * We need to clean up the JPEG object, close the input file, and return.\n\t\t\t */\n\t\t\tjpeg_destroy_decompress(&cinfo);\n\t\t\tbreak;\n\t\t}\n\n        /* setup decompression process and source, then read JPEG header */\n        jpeg_create_decompress( &cinfo );\n\n#ifndef CC_TARGET_QT5\n        jpeg_mem_src( &cinfo, const_cast<unsigned char*>(data), dataLen );\n#endif /* CC_TARGET_QT5 */\n\n        /* reading the image header which contains image information */\n#if (JPEG_LIB_VERSION >= 90)\n        // libjpeg 0.9 adds stricter types.\n        jpeg_read_header( &cinfo, TRUE );\n#else\n        jpeg_read_header( &cinfo, true );\n#endif\n\n        // we only support RGB or grayscale\n        if (cinfo.jpeg_color_space == JCS_GRAYSCALE)\n        {\n            _renderFormat = Texture2D::PixelFormat::I8;\n        }else\n        {\n            cinfo.out_color_space = JCS_RGB;\n            _renderFormat = Texture2D::PixelFormat::RGB888;\n        }\n\n        /* Start decompression jpeg here */\n        jpeg_start_decompress( &cinfo );\n\n        /* init image info */\n        _width  = cinfo.output_width;\n        _height = cinfo.output_height;\n        _preMulti = false;\n        row_pointer[0] = static_cast<unsigned char*>(malloc(cinfo.output_width*cinfo.output_components * sizeof(unsigned char)));\n        CC_BREAK_IF(! row_pointer[0]);\n\n        _dataLen = cinfo.output_width*cinfo.output_height*cinfo.output_components;\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        CC_BREAK_IF(! _data);\n\n        /* now actually read the jpeg into the raw buffer */\n        /* read one scan line at a time */\n        while( cinfo.output_scanline < cinfo.output_height )\n        {\n            jpeg_read_scanlines( &cinfo, row_pointer, 1 );\n            for( i=0; i<cinfo.output_width*cinfo.output_components;i++) \n            {\n                _data[location++] = row_pointer[0][i];\n            }\n        }\n\n\t\t/* When read image file with broken data, jpeg_finish_decompress() may cause error.\n\t\t * Besides, jpeg_destroy_decompress() shall deallocate and release all memory associated\n\t\t * with the decompression object.\n\t\t * So it doesn't need to call jpeg_finish_decompress().\n\t\t */\n\t\t//jpeg_finish_decompress( &cinfo );\n        jpeg_destroy_decompress( &cinfo );\n        /* wrap up decompression, destroy objects, free pointers and close open files */        \n        bRet = true;\n    } while (0);\n\n    if (row_pointer[0] != nullptr)\n    {\n        free(row_pointer[0]);\n    };\n    return bRet;\n}\n\nbool Image::initWithPngData(const unsigned char * data, ssize_t dataLen)\n{\n    // length of bytes to check if it is a valid png file\n#define PNGSIGSIZE  8\n    bool bRet = false;\n    png_byte        header[PNGSIGSIZE]   = {0}; \n    png_structp     png_ptr     =   0;\n    png_infop       info_ptr    = 0;\n\n    do \n    {\n        // png header len is 8 bytes\n        CC_BREAK_IF(dataLen < PNGSIGSIZE);\n\n        // check the data is png or not\n        memcpy(header, data, PNGSIGSIZE);\n        CC_BREAK_IF(png_sig_cmp(header, 0, PNGSIGSIZE));\n\n        // init png_struct\n        png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);\n        CC_BREAK_IF(! png_ptr);\n\n        // init png_info\n        info_ptr = png_create_info_struct(png_ptr);\n        CC_BREAK_IF(!info_ptr);\n\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL)\n        CC_BREAK_IF(setjmp(png_jmpbuf(png_ptr)));\n#endif\n\n        // set the read call back function\n        tImageSource imageSource;\n        imageSource.data    = (unsigned char*)data;\n        imageSource.size    = dataLen;\n        imageSource.offset  = 0;\n        png_set_read_fn(png_ptr, &imageSource, pngReadCallback);\n\n        // read png header info\n\n        // read png file info\n        png_read_info(png_ptr, info_ptr);\n\n        _width = png_get_image_width(png_ptr, info_ptr);\n        _height = png_get_image_height(png_ptr, info_ptr);\n        png_byte bit_depth = png_get_bit_depth(png_ptr, info_ptr);\n        png_uint_32 color_type = png_get_color_type(png_ptr, info_ptr);\n\n        //CCLOG(\"color type %u\", color_type);\n\n        // force palette images to be expanded to 24-bit RGB\n        // it may include alpha channel\n        if (color_type == PNG_COLOR_TYPE_PALETTE)\n        {\n            png_set_palette_to_rgb(png_ptr);\n        }\n        // low-bit-depth grayscale images are to be expanded to 8 bits\n        if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)\n        {\n            bit_depth = 8;\n            png_set_expand_gray_1_2_4_to_8(png_ptr);\n        }\n        // expand any tRNS chunk data into a full alpha channel\n        if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))\n        {\n            png_set_tRNS_to_alpha(png_ptr);\n        }  \n        // reduce images with 16-bit samples to 8 bits\n        if (bit_depth == 16)\n        {\n            png_set_strip_16(png_ptr);            \n        } \n\n        // Expanded earlier for grayscale, now take care of palette and rgb\n        if (bit_depth < 8) {\n            png_set_packing(png_ptr);\n        }\n        // update info\n        png_read_update_info(png_ptr, info_ptr);\n        bit_depth = png_get_bit_depth(png_ptr, info_ptr);\n        color_type = png_get_color_type(png_ptr, info_ptr);\n\n        switch (color_type)\n        {\n        case PNG_COLOR_TYPE_GRAY:\n            _renderFormat = Texture2D::PixelFormat::I8;\n            break;\n        case PNG_COLOR_TYPE_GRAY_ALPHA:\n            _renderFormat = Texture2D::PixelFormat::AI88;\n            break;\n        case PNG_COLOR_TYPE_RGB:\n            _renderFormat = Texture2D::PixelFormat::RGB888;\n            break;\n        case PNG_COLOR_TYPE_RGB_ALPHA:\n            _renderFormat = Texture2D::PixelFormat::RGBA8888;\n            break;\n        default:\n            break;\n        }\n\n        // read png data\n        png_size_t rowbytes;\n        png_bytep* row_pointers = (png_bytep*)malloc( sizeof(png_bytep) * _height );\n\n        rowbytes = png_get_rowbytes(png_ptr, info_ptr);\n\n        _dataLen = rowbytes * _height;\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        CC_BREAK_IF(!_data);\n\n        for (unsigned short i = 0; i < _height; ++i)\n        {\n            row_pointers[i] = _data + i*rowbytes;\n        }\n        png_read_image(png_ptr, row_pointers);\n\n        png_read_end(png_ptr, NULL);\n\n        _preMulti = false;\n\n        if (row_pointers != nullptr)\n        {\n            free(row_pointers);\n        };\n\n        bRet = true;\n    } while (0);\n\n    if (png_ptr)\n    {\n        png_destroy_read_struct(&png_ptr, (info_ptr) ? &info_ptr : 0, 0);\n    }\n    return bRet;\n}\n\nnamespace\n{\n    static tmsize_t tiffReadProc(thandle_t fd, void* buf, tmsize_t size)\n    {\n        tImageSource* isource = (tImageSource*)fd;\n        uint8* ma;\n        uint64 mb;\n        unsigned long n;\n        unsigned long o;\n        tmsize_t p;\n        ma=(uint8*)buf;\n        mb=size;\n        p=0;\n        while (mb>0)\n        {\n            n=0x80000000UL;\n            if ((uint64)n>mb)\n            n=(unsigned long)mb;\n            \n            \n            if((int)(isource->offset + n) <= isource->size)\n            {\n                memcpy(ma, isource->data+isource->offset, n);\n                isource->offset += n;\n                o = n;\n            }\n            else\n            {\n                return 0;\n            }\n            \n            ma+=o;\n            mb-=o;\n            p+=o;\n            if (o!=n)\n            {\n                break;\n            }\n        }\n        return p;\n    }\n    \n    static tmsize_t tiffWriteProc(thandle_t fd, void* buf, tmsize_t size)\n    {\n        CC_UNUSED_PARAM(fd);\n        CC_UNUSED_PARAM(buf);\n        CC_UNUSED_PARAM(size);\n        return 0;\n    }\n    \n    \n    static uint64 tiffSeekProc(thandle_t fd, uint64 off, int whence)\n    {\n        tImageSource* isource = (tImageSource*)fd;\n        uint64 ret = -1;\n        do\n        {\n            if (whence == SEEK_SET)\n            {\n                CC_BREAK_IF(off >= (uint64)isource->size);\n                ret = isource->offset = (uint32)off;\n            }\n            else if (whence == SEEK_CUR)\n            {\n                CC_BREAK_IF(isource->offset + off >= (uint64)isource->size);\n                ret = isource->offset += (uint32)off;\n            }\n            else if (whence == SEEK_END)\n            {\n                CC_BREAK_IF(off >= (uint64)isource->size);\n                ret = isource->offset = (uint32)(isource->size-1 - off);\n            }\n            else\n            {\n                CC_BREAK_IF(off >= (uint64)isource->size);\n                ret = isource->offset = (uint32)off;\n            }\n        } while (0);\n        \n        return ret;\n    }\n    \n    static uint64 tiffSizeProc(thandle_t fd)\n    {\n        tImageSource* pImageSrc = (tImageSource*)fd;\n        return pImageSrc->size;\n    }\n    \n    static int tiffCloseProc(thandle_t fd)\n    {\n        CC_UNUSED_PARAM(fd);\n        return 0;\n    }\n    \n    static int tiffMapProc(thandle_t fd, void** pbase, toff_t* psize)\n    {\n        CC_UNUSED_PARAM(fd);\n        CC_UNUSED_PARAM(pbase);\n        CC_UNUSED_PARAM(psize);\n        return 0;\n    }\n    \n    static void tiffUnmapProc(thandle_t fd, void* base, toff_t size)\n    {\n        CC_UNUSED_PARAM(fd);\n        CC_UNUSED_PARAM(base);\n        CC_UNUSED_PARAM(size);\n    }\n}\n\nbool Image::initWithTiffData(const unsigned char * data, ssize_t dataLen)\n{\n    bool bRet = false;\n    do \n    {\n        // set the read call back function\n        tImageSource imageSource;\n        imageSource.data    = data;\n        imageSource.size    = dataLen;\n        imageSource.offset  = 0;\n\n        TIFF* tif = TIFFClientOpen(\"file.tif\", \"r\", (thandle_t)&imageSource, \n            tiffReadProc, tiffWriteProc,\n            tiffSeekProc, tiffCloseProc, tiffSizeProc,\n            tiffMapProc,\n            tiffUnmapProc);\n\n        CC_BREAK_IF(NULL == tif);\n\n        uint32 w = 0, h = 0;\n        uint16 bitsPerSample = 0, samplePerPixel = 0, planarConfig = 0;\n        size_t npixels = 0;\n        \n        TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);\n        TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);\n        TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bitsPerSample);\n        TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplePerPixel);\n        TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planarConfig);\n\n        npixels = w * h;\n        \n        _renderFormat = Texture2D::PixelFormat::RGBA8888;\n        _width = w;\n        _height = h;\n\n        _dataLen = npixels * sizeof (uint32);\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n\n        uint32* raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));\n        if (raster != NULL) \n        {\n           if (TIFFReadRGBAImageOriented(tif, w, h, raster, ORIENTATION_TOPLEFT, 0))\n           {\n                /* the raster data is pre-multiplied by the alpha component \n                   after invoking TIFFReadRGBAImageOriented*/\n                _preMulti = true;\n\n               memcpy(_data, raster, npixels*sizeof (uint32));\n           }\n\n          _TIFFfree(raster);\n        }\n        \n\n        TIFFClose(tif);\n\n        bRet = true;\n    } while (0);\n    return bRet;\n}\n\nnamespace\n{\n    bool testFormatForPvr2TCSupport(PVR2TexturePixelFormat format)\n    {\n        if (!Configuration::getInstance()->supportsPVRTC())\n        {\n            if (format == PVR2TexturePixelFormat::PVRTC2BPP_RGBA ||\n                format == PVR2TexturePixelFormat::PVRTC4BPP_RGBA)\n            {\n                return false;\n            }\n        }\n        \n        return true;\n    }\n    \n    bool testFormatForPvr3TCSupport(PVR3TexturePixelFormat format)\n    {\n        if (!Configuration::getInstance()->supportsPVRTC())\n        {\n            if (format == PVR3TexturePixelFormat::PVRTC2BPP_RGB  ||\n                format == PVR3TexturePixelFormat::PVRTC2BPP_RGBA ||\n                format == PVR3TexturePixelFormat::PVRTC4BPP_RGB  ||\n                format == PVR3TexturePixelFormat::PVRTC4BPP_RGBA)\n            {\n                return false;\n            }\n        }\n        \n        return true;\n    }\n}\n\nbool Image::initWithPVRv2Data(const unsigned char * data, ssize_t dataLen)\n{\n    int dataLength = 0, dataOffset = 0, dataSize = 0;\n    int blockSize = 0, widthBlocks = 0, heightBlocks = 0;\n    int width = 0, height = 0;\n    \n    //Cast first sizeof(PVRTexHeader) bytes of data stream as PVRTexHeader\n    const PVRv2TexHeader *header = static_cast<const PVRv2TexHeader *>(static_cast<const void*>(data));\n    \n    //Make sure that tag is in correct formatting\n    if (memcmp(&header->pvrTag, gPVRTexIdentifier, strlen(gPVRTexIdentifier)) != 0)\n    {\n        return false;\n    }\n    \n    Configuration *configuration = Configuration::getInstance();\n    \n    _hasPremultipliedAlpha = false;\n    unsigned int flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags);\n    PVR2TexturePixelFormat formatFlags = static_cast<PVR2TexturePixelFormat>(flags & PVR_TEXTURE_FLAG_TYPE_MASK);\n    bool flipped = (flags & (unsigned int)PVR2TextureFlag::VerticalFlip) ? true : false;\n    if (flipped)\n    {\n        CCLOG(\"cocos2d: WARNING: Image is flipped. Regenerate it using PVRTexTool\");\n    }\n    \n    if (! configuration->supportsNPOT() &&\n        (static_cast<int>(header->width) != ccNextPOT(header->width)\n            || static_cast<int>(header->height) != ccNextPOT(header->height)))\n    {\n        CCLOG(\"cocos2d: ERROR: Loading an NPOT texture (%dx%d) but is not supported on this device\", header->width, header->height);\n        return false;\n    }\n    \n    if (!testFormatForPvr2TCSupport(formatFlags))\n    {\n        CCLOG(\"cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant\", (int)formatFlags);\n        return false;\n    }\n\n    if (v2_pixel_formathash.find(formatFlags) == v2_pixel_formathash.end())\n    {\n        CCLOG(\"cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant\", (int)formatFlags);\n        return false;\n    }\n    \n    auto it = Texture2D::getPixelFormatInfoMap().find(v2_pixel_formathash.at(formatFlags));\n\n    if (it == Texture2D::getPixelFormatInfoMap().end())\n    {\n        CCLOG(\"cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%02X. Re-encode it with a OpenGL pixel format variant\", (int)formatFlags);\n        return false;\n    }\n\n    _renderFormat = it->first;\n\n    //Reset num of mipmaps\n    _numberOfMipmaps = 0;\n\n    //Get size of mipmap\n    _width = width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width);\n    _height = height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height);\n\n    //Get ptr to where data starts..\n    dataLength = CC_SWAP_INT32_LITTLE_TO_HOST(header->dataLength);\n\n    //Move by size of header\n    _dataLen = dataLen - sizeof(PVRv2TexHeader);\n    _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n    memcpy(_data, (unsigned char*)data + sizeof(PVRv2TexHeader), _dataLen);\n\n    // Calculate the data size for each texture level and respect the minimum number of blocks\n    while (dataOffset < dataLength)\n    {\n        switch (formatFlags) {\n        case PVR2TexturePixelFormat::PVRTC2BPP_RGBA:\n            blockSize = 8 * 4; // Pixel by pixel block size for 2bpp\n            widthBlocks = width / 8;\n            heightBlocks = height / 4;\n            break;\n        case PVR2TexturePixelFormat::PVRTC4BPP_RGBA:\n            blockSize = 4 * 4; // Pixel by pixel block size for 4bpp\n            widthBlocks = width / 4;\n            heightBlocks = height / 4;\n            break;\n        case PVR2TexturePixelFormat::BGRA8888:\n            if (Configuration::getInstance()->supportsBGRA8888() == false)\n            {\n                CCLOG(\"cocos2d: Image. BGRA8888 not supported on this device\");\n                return false;\n            }\n        default:\n            blockSize = 1;\n            widthBlocks = width;\n            heightBlocks = height;\n            break;\n        }\n\n        // Clamp to minimum number of blocks\n        if (widthBlocks < 2)\n        {\n            widthBlocks = 2;\n        }\n        if (heightBlocks < 2)\n        {\n            heightBlocks = 2;\n        }\n\n        dataSize = widthBlocks * heightBlocks * ((blockSize  * it->second.bpp) / 8);\n        int packetLength = (dataLength - dataOffset);\n        packetLength = packetLength > dataSize ? dataSize : packetLength;\n\n        //Make record to the mipmaps array and increment counter\n        _mipmaps[_numberOfMipmaps].address = _data + dataOffset;\n        _mipmaps[_numberOfMipmaps].len = packetLength;\n        _numberOfMipmaps++;\n\n        dataOffset += packetLength;\n\n        //Update width and height to the next lower power of two\n        width = MAX(width >> 1, 1);\n        height = MAX(height >> 1, 1);\n    }\n\n    return true;\n}\n\nbool Image::initWithPVRv3Data(const unsigned char * data, ssize_t dataLen)\n{\n    if (static_cast<size_t>(dataLen) < sizeof(PVRv3TexHeader))\n    {\n\t\treturn false;\n\t}\n\t\n\tconst PVRv3TexHeader *header = static_cast<const PVRv3TexHeader *>(static_cast<const void*>(data));\n\t\n\t// validate version\n\tif (CC_SWAP_INT32_BIG_TO_HOST(header->version) != 0x50565203)\n    {\n\t\tCCLOG(\"cocos2d: WARNING: pvr file version mismatch\");\n\t\treturn false;\n\t}\n\t\n\t// parse pixel format\n\tPVR3TexturePixelFormat pixelFormat = static_cast<PVR3TexturePixelFormat>(header->pixelFormat);\n    \n    if (!testFormatForPvr3TCSupport(pixelFormat))\n    {\n        CCLOG(\"cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant\",\n              static_cast<unsigned long long>(pixelFormat));\n        return false;\n    }\n\n\n    if (v3_pixel_formathash.find(pixelFormat) == v3_pixel_formathash.end())\n    {\n        CCLOG(\"cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant\",\n              static_cast<unsigned long long>(pixelFormat));\n        return false;\n    }\n\n    auto it = Texture2D::getPixelFormatInfoMap().find(v3_pixel_formathash.at(pixelFormat));\n\n    if (it == Texture2D::getPixelFormatInfoMap().end())\n    {\n        CCLOG(\"cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%016llX. Re-encode it with a OpenGL pixel format variant\",\n              static_cast<unsigned long long>(pixelFormat));\n        return false;\n    }\n\n    _renderFormat = it->first;\n    \n    // flags\n\tint flags = CC_SWAP_INT32_LITTLE_TO_HOST(header->flags);\n\n    // PVRv3 specifies premultiply alpha in a flag -- should always respect this in PVRv3 files\n    if (flags & (unsigned int)PVR3TextureFlag::PremultipliedAlpha)\n    {\n        _preMulti = true;\n    }\n    \n\t// sizing\n\tint width = CC_SWAP_INT32_LITTLE_TO_HOST(header->width);\n\tint height = CC_SWAP_INT32_LITTLE_TO_HOST(header->height);\n\t_width = width;\n\t_height = height;\n\tint dataOffset = 0, dataSize = 0;\n\tint blockSize = 0, widthBlocks = 0, heightBlocks = 0;\n\t\n    _dataLen = dataLen - (sizeof(PVRv3TexHeader) + header->metadataLength);\n    _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n    memcpy(_data, static_cast<const unsigned char*>(data) + sizeof(PVRv3TexHeader) + header->metadataLength, _dataLen);\n\t\n\t_numberOfMipmaps = header->numberOfMipmaps;\n\tCCAssert(_numberOfMipmaps < MIPMAP_MAX, \"Image: Maximum number of mimpaps reached. Increate the CC_MIPMAP_MAX value\");\n    \n\tfor (int i = 0; i < _numberOfMipmaps; i++)\n    {\n\t\tswitch ((PVR3TexturePixelFormat)pixelFormat)\n        {\n\t\t\tcase PVR3TexturePixelFormat::PVRTC2BPP_RGB :\n\t\t\tcase PVR3TexturePixelFormat::PVRTC2BPP_RGBA :\n\t\t\t\tblockSize = 8 * 4; // Pixel by pixel block size for 2bpp\n\t\t\t\twidthBlocks = width / 8;\n\t\t\t\theightBlocks = height / 4;\n\t\t\t\tbreak;\n\t\t\tcase PVR3TexturePixelFormat::PVRTC4BPP_RGB :\n\t\t\tcase PVR3TexturePixelFormat::PVRTC4BPP_RGBA :\n\t\t\t\tblockSize = 4 * 4; // Pixel by pixel block size for 4bpp\n\t\t\t\twidthBlocks = width / 4;\n\t\t\t\theightBlocks = height / 4;\n\t\t\t\tbreak;\n\t\t\tcase PVR3TexturePixelFormat::BGRA8888:\n\t\t\t\tif( ! Configuration::getInstance()->supportsBGRA8888())\n                {\n\t\t\t\t\tCCLOG(\"cocos2d: Image. BGRA8888 not supported on this device\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tblockSize = 1;\n\t\t\t\twidthBlocks = width;\n\t\t\t\theightBlocks = height;\n\t\t\t\tbreak;\n\t\t}\n        \n\t\t// Clamp to minimum number of blocks\n\t\tif (widthBlocks < 2)\n        {\n\t\t\twidthBlocks = 2;\n        }\n\t\tif (heightBlocks < 2)\n        {\n\t\t\theightBlocks = 2;\n        }\n\t\t\n\t\tdataSize = widthBlocks * heightBlocks * ((blockSize  * it->second.bpp) / 8);\n\t\tauto packetLength = _dataLen - dataOffset;\n\t\tpacketLength = packetLength > dataSize ? dataSize : packetLength;\n\t\t\n\t\t_mipmaps[i].address = _data + dataOffset;\n\t\t_mipmaps[i].len = static_cast<int>(packetLength);\n\t\t\n\t\tdataOffset += packetLength;\n\t\tCCAssert(dataOffset <= _dataLen, \"CCTexurePVR: Invalid lenght\");\n\t\t\n\t\t\n\t\twidth = MAX(width >> 1, 1);\n\t\theight = MAX(height >> 1, 1);\n\t}\n\t\n\treturn true;\n}\n\nbool Image::initWithETCData(const unsigned char * data, ssize_t dataLen)\n{\n    const etc1_byte* header = static_cast<const etc1_byte*>(data);\n    \n    //check the data\n    if(!etc1_pkm_is_valid(header))\n    {\n        return  false;\n    }\n\n    _width = etc1_pkm_get_width(header);\n    _height = etc1_pkm_get_height(header);\n\n    if( 0 == _width || 0 == _height )\n    {\n        return false;\n    }\n\n    if(Configuration::getInstance()->supportsETC())\n    {\n        //old opengl version has no define for GL_ETC1_RGB8_OES, add macro to make compiler happy. \n#ifdef GL_ETC1_RGB8_OES\n        _renderFormat = Texture2D::PixelFormat::ETC;\n        _dataLen = dataLen - ETC_PKM_HEADER_SIZE;\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        memcpy(_data, static_cast<const unsigned char*>(data) + ETC_PKM_HEADER_SIZE, _dataLen);\n        return true;\n#endif\n    }\n    else\n    {\n        CCLOG(\"cocos2d: Hardware ETC1 decoder not present. Using software decoder\");\n\n         //if it is not gles or device do not support ETC, decode texture by software\n        int bytePerPixel = 3;\n        unsigned int stride = _width * bytePerPixel;\n        _renderFormat = Texture2D::PixelFormat::RGB888;\n        \n        _dataLen =  _width * _height * bytePerPixel;\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        \n        if (etc1_decode_image(static_cast<const unsigned char*>(data) + ETC_PKM_HEADER_SIZE, static_cast<etc1_byte*>(_data), _width, _height, bytePerPixel, stride) != 0)\n        {\n            _dataLen = 0;\n            if (_data != nullptr)\n            {\n                free(_data);\n            }\n            return false;\n        }\n        \n        return true;\n    }\n    return false;\n}\n\nbool Image::initWithTGAData(tImageTGA* tgaData)\n{\n    bool ret = false;\n    \n    do\n    {\n        CC_BREAK_IF(tgaData == nullptr);\n        \n        // tgaLoadBuffer only support type 2, 3, 10\n        if (2 == tgaData->type || 10 == tgaData->type)\n        {\n            // true color\n            // unsupport RGB555\n            if (tgaData->pixelDepth == 16)\n            {\n                _renderFormat = Texture2D::PixelFormat::RGB5A1;\n            }\n            else if(tgaData->pixelDepth == 24)\n            {\n                _renderFormat = Texture2D::PixelFormat::RGB888;\n            }\n            else if(tgaData->pixelDepth == 32)\n            {\n                _renderFormat = Texture2D::PixelFormat::RGBA8888;\n            }\n            else\n            {\n                CCLOG(\"Image WARNING: unsupport true color tga data pixel format. FILE: %s\", _filePath.c_str());\n                break;\n            }\n        }\n        else if(3 == tgaData->type)\n        {\n            // gray\n            if (8 == tgaData->pixelDepth)\n            {\n                _renderFormat = Texture2D::PixelFormat::I8;\n            }\n            else\n            {\n                // actually this won't happen, if it happens, maybe the image file is not a tga\n                CCLOG(\"Image WARNING: unsupport gray tga data pixel format. FILE: %s\", _filePath.c_str());\n                break;\n            }\n        }\n        \n        _width = tgaData->width;\n        _height = tgaData->height;\n        _data = tgaData->imageData;\n        _dataLen = _width * _height * tgaData->pixelDepth / 8;\n        _fileType = Format::TGA;\n        _preMulti = false;\n        ret = true;\n        \n    }while(false);\n    \n    if (ret)\n    {\n        const unsigned char tgaSuffix[] = \".tga\";\n        for(int i = 0; i < 4; ++i)\n        {\n            if (tolower(_filePath[_filePath.length() - i - 1]) != tgaSuffix[3 - i])\n            {\n                CCLOG(\"Image WARNING: the image file suffix is not tga, but parsed as a tga image file. FILE: %s\", _filePath.c_str());\n                break;\n            };\n        }\n    }\n    else\n    {\n        if (tgaData->imageData != nullptr)\n        {\n            free(tgaData->imageData);\n            _data = nullptr;\n        }\n    }\n    \n    return ret;\n}\n\nnamespace\n{\n    static const uint32_t makeFourCC(char ch0, char ch1, char ch2, char ch3)\n    {\n        const uint32_t fourCC = ((uint32_t)(char)(ch0) | ((uint32_t)(char)(ch1) << 8) | ((uint32_t)(char)(ch2) << 16) | ((uint32_t)(char)(ch3) << 24 ));\n        return fourCC;\n    }\n}\n\nbool Image::initWithS3TCData(const unsigned char * data, ssize_t dataLen)\n{\n    \n    const uint32_t FOURCC_DXT1 = makeFourCC('D', 'X', 'T', '1');\n    const uint32_t FOURCC_DXT3 = makeFourCC('D', 'X', 'T', '3');\n    const uint32_t FOURCC_DXT5 = makeFourCC('D', 'X', 'T', '5');\n    \n    /* load the .dds file */\n    \n    S3TCTexHeader *header = (S3TCTexHeader *)data;\n    unsigned char *pixelData = static_cast<unsigned char*>(malloc((dataLen - sizeof(S3TCTexHeader)) * sizeof(unsigned char)));\n    memcpy((void *)pixelData, data + sizeof(S3TCTexHeader), dataLen - sizeof(S3TCTexHeader));\n    \n    _width = header->ddsd.width;\n    _height = header->ddsd.height;\n    _numberOfMipmaps = header->ddsd.DUMMYUNIONNAMEN2.mipMapCount;\n    _dataLen = 0;\n    int blockSize = (FOURCC_DXT1 == header->ddsd.DUMMYUNIONNAMEN4.ddpfPixelFormat.fourCC) ? 8 : 16;\n    \n    /* caculate the dataLen */\n    \n    int width = _width;\n    int height = _height;\n    \n    if (Configuration::getInstance()->supportsS3TC())  //compressed data length\n    {\n        _dataLen = dataLen - sizeof(S3TCTexHeader);\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        memcpy((void *)_data,(void *)pixelData , _dataLen);\n    }\n    else                                               //decompressed data length\n    {\n        for (int i = 0; i < _numberOfMipmaps && (width || height); ++i)\n        {\n            if (width == 0) width = 1;\n            if (height == 0) height = 1;\n            \n            _dataLen += (height * width *4);\n\n            width >>= 1;\n            height >>= 1;\n        }\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n    }\n    \n    /* load the mipmaps */\n    \n    int encodeOffset = 0;\n    int decodeOffset = 0;\n    width = _width;  height = _height;\n    \n    for (int i = 0; i < _numberOfMipmaps && (width || height); ++i)  \n    {\n        if (width == 0) width = 1;\n        if (height == 0) height = 1;\n        \n        int size = ((width+3)/4)*((height+3)/4)*blockSize;\n                \n        if (Configuration::getInstance()->supportsS3TC())\n        {   //decode texture throught hardware\n            \n            if (FOURCC_DXT1 == header->ddsd.DUMMYUNIONNAMEN4.ddpfPixelFormat.fourCC)\n            {\n                _renderFormat = Texture2D::PixelFormat::S3TC_DXT1;\n            }\n            else if (FOURCC_DXT3 == header->ddsd.DUMMYUNIONNAMEN4.ddpfPixelFormat.fourCC)\n            {\n                _renderFormat = Texture2D::PixelFormat::S3TC_DXT3;\n            }\n            else if (FOURCC_DXT5 == header->ddsd.DUMMYUNIONNAMEN4.ddpfPixelFormat.fourCC)\n            {\n                _renderFormat = Texture2D::PixelFormat::S3TC_DXT5;\n            }\n\n            _mipmaps[i].address = (unsigned char *)_data + encodeOffset;\n            _mipmaps[i].len = size;\n        }\n        else\n        {   //if it is not gles or device do not support S3TC, decode texture by software\n            \n            CCLOG(\"cocos2d: Hardware S3TC decoder not present. Using software decoder\");\n\n            int bytePerPixel = 4;\n            unsigned int stride = width * bytePerPixel;\n            _renderFormat = Texture2D::PixelFormat::RGBA8888;\n\n            std::vector<unsigned char> decodeImageData(stride * height);\n            if (FOURCC_DXT1 == header->ddsd.DUMMYUNIONNAMEN4.ddpfPixelFormat.fourCC)\n            {\n                s3tc_decode(pixelData + encodeOffset, &decodeImageData[0], width, height, S3TCDecodeFlag::DXT1);\n            }\n            else if (FOURCC_DXT3 == header->ddsd.DUMMYUNIONNAMEN4.ddpfPixelFormat.fourCC)\n            {\n                s3tc_decode(pixelData + encodeOffset, &decodeImageData[0], width, height, S3TCDecodeFlag::DXT3);\n            }\n            else if (FOURCC_DXT5 == header->ddsd.DUMMYUNIONNAMEN4.ddpfPixelFormat.fourCC)\n            {\n                s3tc_decode(pixelData + encodeOffset, &decodeImageData[0], width, height, S3TCDecodeFlag::DXT5);\n            }\n            \n            _mipmaps[i].address = (unsigned char *)_data + decodeOffset;\n            _mipmaps[i].len = (stride * height);\n            memcpy((void *)_mipmaps[i].address, (void *)&decodeImageData[0], _mipmaps[i].len);\n            decodeOffset += stride * height;\n        }\n        \n        encodeOffset += size;\n        width >>= 1;\n        height >>= 1;\n    }\n    \n    /* end load the mipmaps */\n    \n    if (pixelData != nullptr)\n    {\n        free(pixelData);\n    };\n    \n    return true;\n}\n\n\nbool Image::initWithATITCData(const unsigned char *data, ssize_t dataLen)\n{\n    /* load the .ktx file */\n    ATITCTexHeader *header = (ATITCTexHeader *)data;\n    _width =  header->pixelWidth;\n    _height = header->pixelHeight;\n    _numberOfMipmaps = header->numberOfMipmapLevels;\n    \n    int blockSize = 0;\n    switch (header->glInternalFormat)\n    {\n        case CC_GL_ATC_RGB_AMD:\n            blockSize = 8;\n            break;\n        case CC_GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:\n            blockSize = 16;\n            break;\n        case CC_GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:\n            blockSize = 16;\n            break;\n        default:\n            break;\n    }\n    \n    /* pixelData point to the compressed data address */\n    unsigned char *pixelData = (unsigned char *)data + sizeof(ATITCTexHeader) + header->bytesOfKeyValueData + 4;\n    \n    /* caculate the dataLen */\n    int width = _width;\n    int height = _height;\n    \n    if (Configuration::getInstance()->supportsATITC())  //compressed data length\n    {\n        _dataLen = dataLen - sizeof(ATITCTexHeader) - header->bytesOfKeyValueData - 4;\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        memcpy((void *)_data,(void *)pixelData , _dataLen);\n    }\n    else                                               //decompressed data length\n    {\n        for (int i = 0; i < _numberOfMipmaps && (width || height); ++i)\n        {\n            if (width == 0) width = 1;\n            if (height == 0) height = 1;\n            \n            _dataLen += (height * width *4);\n            \n            width >>= 1;\n            height >>= 1;\n        }\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n    }\n    \n    /* load the mipmaps */\n    int encodeOffset = 0;\n    int decodeOffset = 0;\n    width = _width;  height = _height;\n    \n    for (int i = 0; i < _numberOfMipmaps && (width || height); ++i)\n    {\n        if (width == 0) width = 1;\n        if (height == 0) height = 1;\n        \n        int size = ((width+3)/4)*((height+3)/4)*blockSize;\n        \n        if (Configuration::getInstance()->supportsATITC())\n        {\n            /* decode texture throught hardware */\n            \n            CCLOG(\"this is atitc H decode\");\n            \n            switch (header->glInternalFormat)\n            {\n                case CC_GL_ATC_RGB_AMD:\n                    _renderFormat = Texture2D::PixelFormat::ATC_RGB;\n                    break;\n                case CC_GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:\n                    _renderFormat = Texture2D::PixelFormat::ATC_EXPLICIT_ALPHA;\n                    break;\n                case CC_GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:\n                    _renderFormat = Texture2D::PixelFormat::ATC_INTERPOLATED_ALPHA;\n                    break;\n                default:\n                    break;\n            }\n            \n            _mipmaps[i].address = (unsigned char *)_data + encodeOffset;\n            _mipmaps[i].len = size;\n        }\n        else\n        {\n            /* if it is not gles or device do not support ATITC, decode texture by software */\n            \n            CCLOG(\"cocos2d: Hardware ATITC decoder not present. Using software decoder\");\n            \n            int bytePerPixel = 4;\n            unsigned int stride = width * bytePerPixel;\n            _renderFormat = Texture2D::PixelFormat::RGBA8888;\n            \n            std::vector<unsigned char> decodeImageData(stride * height);\n            switch (header->glInternalFormat)\n            {\n                case CC_GL_ATC_RGB_AMD:\n                    atitc_decode(pixelData + encodeOffset, &decodeImageData[0], width, height, ATITCDecodeFlag::ATC_RGB);\n                    break;\n                case CC_GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:\n                    atitc_decode(pixelData + encodeOffset, &decodeImageData[0], width, height, ATITCDecodeFlag::ATC_EXPLICIT_ALPHA);\n                    break;\n                case CC_GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:\n                    atitc_decode(pixelData + encodeOffset, &decodeImageData[0], width, height, ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA);\n                    break;\n                default:\n                    break;\n            }\n\n            _mipmaps[i].address = (unsigned char *)_data + decodeOffset;\n            _mipmaps[i].len = (stride * height);\n            memcpy((void *)_mipmaps[i].address, (void *)&decodeImageData[0], _mipmaps[i].len);\n            decodeOffset += stride * height;\n        }\n\n        encodeOffset += (size + 4);\n        width >>= 1;\n        height >>= 1;\n    }\n    /* end load the mipmaps */\n    \n    return true;\n}\n\nbool Image::initWithPVRData(const unsigned char * data, ssize_t dataLen)\n{\n    return initWithPVRv2Data(data, dataLen) || initWithPVRv3Data(data, dataLen);\n}\n\nbool Image::initWithWebpData(const unsigned char * data, ssize_t dataLen)\n{\n\tbool bRet = false;\n\tdo\n\t{\n        WebPDecoderConfig config;\n        if (WebPInitDecoderConfig(&config) == 0) break;\n        if (WebPGetFeatures(static_cast<const uint8_t*>(data), dataLen, &config.input) != VP8_STATUS_OK) break;\n        if (config.input.width == 0 || config.input.height == 0) break;\n        \n        config.output.colorspace = MODE_RGBA;\n        _renderFormat = Texture2D::PixelFormat::RGBA8888;\n        _width    = config.input.width;\n        _height   = config.input.height;\n        \n        _dataLen = _width * _height * 4;\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        \n        config.output.u.RGBA.rgba = static_cast<uint8_t*>(_data);\n        config.output.u.RGBA.stride = _width * 4;\n        config.output.u.RGBA.size = _dataLen;\n        config.output.is_external_memory = 1;\n        \n        if (WebPDecode(static_cast<const uint8_t*>(data), dataLen, &config) != VP8_STATUS_OK)\n        {\n            free(_data);\n            _data = NULL;\n            break;\n        }\n        \n        bRet = true;\n\t} while (0);\n\treturn bRet;\n}\n\nbool Image::initWithRawData(const unsigned char * data, ssize_t dataLen, int width, int height, int bitsPerComponent, bool preMulti)\n{\n    bool bRet = false;\n    do \n    {\n        CC_BREAK_IF(0 == width || 0 == height);\n\n        _height   = height;\n        _width    = width;\n        _preMulti = preMulti;\n        _renderFormat = Texture2D::PixelFormat::RGBA8888;\n\n        // only RGBA8888 supported\n        int bytesPerComponent = 4;\n        _dataLen = height * width * bytesPerComponent;\n        _data = static_cast<unsigned char*>(malloc(_dataLen * sizeof(unsigned char)));\n        CC_BREAK_IF(! _data);\n        memcpy(_data, data, _dataLen);\n\n        bRet = true;\n    } while (0);\n\n    return bRet;\n}\n\n\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)\nbool Image::saveToFile(const std::string& filename, bool bIsToRGB)\n{\n    //only support for Texture2D::PixelFormat::RGB888 or Texture2D::PixelFormat::RGBA8888 uncompressed data\n    if (isCompressed() || (_renderFormat != Texture2D::PixelFormat::RGB888 && _renderFormat != Texture2D::PixelFormat::RGBA8888))\n    {\n        CCLOG(\"cocos2d: Image: saveToFile is only support for Texture2D::PixelFormat::RGB888 or Texture2D::PixelFormat::RGBA8888 uncompressed data for now\");\n        return false;\n    }\n\n    bool bRet = false;\n\n    do \n    {\n\n        CC_BREAK_IF(filename.size() <= 4);\n\n        std::string strLowerCasePath(filename);\n        for (unsigned int i = 0; i < strLowerCasePath.length(); ++i)\n        {\n            strLowerCasePath[i] = tolower(filename[i]);\n        }\n\n        if (std::string::npos != strLowerCasePath.find(\".png\"))\n        {\n            CC_BREAK_IF(!saveImageToPNG(filename, bIsToRGB));\n        }\n        else if (std::string::npos != strLowerCasePath.find(\".jpg\"))\n        {\n            CC_BREAK_IF(!saveImageToJPG(filename));\n        }\n        else\n        {\n            break;\n        }\n\n        bRet = true;\n    } while (0);\n\n    return bRet;\n}\n#endif\n\nbool Image::saveImageToPNG(const std::string& filePath, bool isToRGB)\n{\n    bool bRet = false;\n    do \n    {\n        FILE *fp;\n        png_structp png_ptr;\n        png_infop info_ptr;\n        png_colorp palette;\n        png_bytep *row_pointers;\n\n        fp = fopen(filePath.c_str(), \"wb\");\n        CC_BREAK_IF(NULL == fp);\n\n        png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);\n\n        if (NULL == png_ptr)\n        {\n            fclose(fp);\n            break;\n        }\n\n        info_ptr = png_create_info_struct(png_ptr);\n        if (NULL == info_ptr)\n        {\n            fclose(fp);\n            png_destroy_write_struct(&png_ptr, NULL);\n            break;\n        }\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA && CC_TARGET_PLATFORM != CC_PLATFORM_NACL)\n        if (setjmp(png_jmpbuf(png_ptr)))\n        {\n            fclose(fp);\n            png_destroy_write_struct(&png_ptr, &info_ptr);\n            break;\n        }\n#endif\n        png_init_io(png_ptr, fp);\n\n        if (!isToRGB && hasAlpha())\n        {\n            png_set_IHDR(png_ptr, info_ptr, _width, _height, 8, PNG_COLOR_TYPE_RGB_ALPHA,\n                PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);\n        } \n        else\n        {\n            png_set_IHDR(png_ptr, info_ptr, _width, _height, 8, PNG_COLOR_TYPE_RGB,\n                PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);\n        }\n\n        palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH * sizeof (png_color));\n        png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH);\n\n        png_write_info(png_ptr, info_ptr);\n\n        png_set_packing(png_ptr);\n\n        row_pointers = (png_bytep *)malloc(_height * sizeof(png_bytep));\n        if(row_pointers == NULL)\n        {\n            fclose(fp);\n            png_destroy_write_struct(&png_ptr, &info_ptr);\n            break;\n        }\n\n        if (hasAlpha())\n        {\n            for (int i = 0; i < (int)_height; i++)\n            {\n                row_pointers[i] = (png_bytep)_data + i * _width * 3;\n            }\n\n            png_write_image(png_ptr, row_pointers);\n\n            free(row_pointers);\n            row_pointers = NULL;\n        }\n        else\n        {\n            if (isToRGB)\n            {\n                unsigned char *pTempData = static_cast<unsigned char*>(malloc(_width * _height * 3 * sizeof(unsigned char*)));\n                if (NULL == pTempData)\n                {\n                    fclose(fp);\n                    png_destroy_write_struct(&png_ptr, &info_ptr);\n                    break;\n                }\n\n                for (int i = 0; i < _height; ++i)\n                {\n                    for (int j = 0; j < _width; ++j)\n                    {\n                        pTempData[(i * _width + j) * 3] = _data[(i * _width + j) * 4];\n                        pTempData[(i * _width + j) * 3 + 1] = _data[(i * _width + j) * 4 + 1];\n                        pTempData[(i * _width + j) * 3 + 2] = _data[(i * _width + j) * 4 + 2];\n                    }\n                }\n\n                for (int i = 0; i < (int)_height; i++)\n                {\n                    row_pointers[i] = (png_bytep)pTempData + i * _width * 3;\n                }\n\n                png_write_image(png_ptr, row_pointers);\n\n                free(row_pointers);\n                row_pointers = NULL;\n\n                if (pTempData != nullptr)\n                {\n                    free(pTempData);\n                }\n            } \n            else\n            {\n                for (int i = 0; i < (int)_height; i++)\n                {\n                    row_pointers[i] = (png_bytep)_data + i * _width * 4;\n                }\n\n                png_write_image(png_ptr, row_pointers);\n\n                free(row_pointers);\n                row_pointers = NULL;\n            }\n        }\n\n        png_write_end(png_ptr, info_ptr);\n\n        png_free(png_ptr, palette);\n        palette = NULL;\n\n        png_destroy_write_struct(&png_ptr, &info_ptr);\n\n        fclose(fp);\n\n        bRet = true;\n    } while (0);\n    return bRet;\n}\nbool Image::saveImageToJPG(const std::string& filePath)\n{\n    bool bRet = false;\n    do \n    {\n        struct jpeg_compress_struct cinfo;\n        struct jpeg_error_mgr jerr;\n        FILE * outfile;                 /* target file */\n        JSAMPROW row_pointer[1];        /* pointer to JSAMPLE row[s] */\n        int     row_stride;          /* physical row width in image buffer */\n\n        cinfo.err = jpeg_std_error(&jerr);\n        /* Now we can initialize the JPEG compression object. */\n        jpeg_create_compress(&cinfo);\n\n        CC_BREAK_IF((outfile = fopen(filePath.c_str(), \"wb\")) == NULL);\n        \n        jpeg_stdio_dest(&cinfo, outfile);\n\n        cinfo.image_width = _width;    /* image width and height, in pixels */\n        cinfo.image_height = _height;\n        cinfo.input_components = 3;       /* # of color components per pixel */\n        cinfo.in_color_space = JCS_RGB;       /* colorspace of input image */\n\n        jpeg_set_defaults(&cinfo);\n\n        jpeg_start_compress(&cinfo, TRUE);\n\n        row_stride = _width * 3; /* JSAMPLEs per row in image_buffer */\n\n        if (hasAlpha())\n        {\n            unsigned char *pTempData = static_cast<unsigned char*>(malloc(_width * _height * 3 * sizeof(unsigned char)));\n            if (NULL == pTempData)\n            {\n                jpeg_finish_compress(&cinfo);\n                jpeg_destroy_compress(&cinfo);\n                fclose(outfile);\n                break;\n            }\n\n            for (int i = 0; i < _height; ++i)\n            {\n                for (int j = 0; j < _width; ++j)\n\n                {\n                    pTempData[(i * _width + j) * 3] = _data[(i * _width + j) * 4];\n                    pTempData[(i * _width + j) * 3 + 1] = _data[(i * _width + j) * 4 + 1];\n                    pTempData[(i * _width + j) * 3 + 2] = _data[(i * _width + j) * 4 + 2];\n                }\n            }\n\n            while (cinfo.next_scanline < cinfo.image_height) {\n                row_pointer[0] = & pTempData[cinfo.next_scanline * row_stride];\n                (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);\n            }\n\n            if (pTempData != nullptr)\n            {\n                free(pTempData);\n            }\n        } \n        else\n        {\n            while (cinfo.next_scanline < cinfo.image_height) {\n                row_pointer[0] = & _data[cinfo.next_scanline * row_stride];\n                (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);\n            }\n        }\n\n        jpeg_finish_compress(&cinfo);\n        fclose(outfile);\n        jpeg_destroy_compress(&cinfo);\n        \n        bRet = true;\n    } while (0);\n    return bRet;\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCSAXParser.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010 Максим Аксенов\n Copyright (c) 2010 cocos2d-x.org  \n Copyright (c) 2013 Martell Malone\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCSAXParser.h\"\n#include \"CCFileUtils.h\"\n#include \"tinyxml2.h\"\n\n#include <vector> // because its based on windows 8 build :P\n\nNS_CC_BEGIN\n\nclass XmlSaxHander : public tinyxml2::XMLVisitor\n{\npublic:\n\tXmlSaxHander():_ccsaxParserImp(0){};\n\t\n\tvirtual bool VisitEnter( const tinyxml2::XMLElement& element, const tinyxml2::XMLAttribute* firstAttribute );\n\tvirtual bool VisitExit( const tinyxml2::XMLElement& element );\n\tvirtual bool Visit( const tinyxml2::XMLText& text );\n\tvirtual bool Visit( const tinyxml2::XMLUnknown&){ return true; }\n\n\tvoid setSAXParserImp(SAXParser* parser)\n\t{\n\t\t_ccsaxParserImp = parser;\n\t}\n\nprivate:\n\tSAXParser *_ccsaxParserImp;\n};\n\n\nbool XmlSaxHander::VisitEnter( const tinyxml2::XMLElement& element, const tinyxml2::XMLAttribute* firstAttribute )\n{\n\t//log(\" VisitEnter %s\",element.Value());\n\n\tstd::vector<const char*> attsVector;\n\tfor( const tinyxml2::XMLAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() )\n\t{\n\t\t//log(\"%s\", attrib->Name());\n\t\tattsVector.push_back(attrib->Name());\n\t\t//log(\"%s\",attrib->Value());\n\t\tattsVector.push_back(attrib->Value());\n\t}\n    \n    // nullptr is used in c++11\n\t//attsVector.push_back(nullptr);\n    attsVector.push_back(nullptr);\n\n\tSAXParser::startElement(_ccsaxParserImp, (const CC_XML_CHAR *)element.Value(), (const CC_XML_CHAR **)(&attsVector[0]));\n\treturn true;\n}\nbool XmlSaxHander::VisitExit( const tinyxml2::XMLElement& element )\n{\n\t//log(\"VisitExit %s\",element.Value());\n\n\tSAXParser::endElement(_ccsaxParserImp, (const CC_XML_CHAR *)element.Value());\n\treturn true;\n}\n\nbool XmlSaxHander::Visit( const tinyxml2::XMLText& text )\n{\n\t//log(\"Visit %s\",text.Value());\n\tSAXParser::textHandler(_ccsaxParserImp, (const CC_XML_CHAR *)text.Value(), static_cast<int>(strlen(text.Value())));\n\treturn true;\n}\n\nSAXParser::SAXParser()\n{\n    _delegator = nullptr;\n}\n\nSAXParser::~SAXParser(void)\n{\n}\n\nbool SAXParser::init(const char *encoding)\n{\n    CC_UNUSED_PARAM(encoding);\n    // nothing to do\n    return true;\n}\n\nbool SAXParser::parse(const char* xmlData, size_t dataLength)\n{\n\ttinyxml2::XMLDocument tinyDoc;\n\ttinyDoc.Parse(xmlData, dataLength);\n\tXmlSaxHander printer;\n\tprinter.setSAXParserImp(this);\n\t\n\treturn tinyDoc.Accept( &printer );\t\n}\n\nbool SAXParser::parse(const std::string& filename)\n{\n    bool ret = false;\n    Data data = FileUtils::getInstance()->getDataFromFile(filename);\n    if (!data.isNull())\n    {\n        ret = parse((const char*)data.getBytes(), data.getSize());\n    }\n\n    return ret;\n}\n\nvoid SAXParser::startElement(void *ctx, const CC_XML_CHAR *name, const CC_XML_CHAR **atts)\n{\n    ((SAXParser*)(ctx))->_delegator->startElement(ctx, (char*)name, (const char**)atts);\n}\n\nvoid SAXParser::endElement(void *ctx, const CC_XML_CHAR *name)\n{\n    ((SAXParser*)(ctx))->_delegator->endElement(ctx, (char*)name);\n}\nvoid SAXParser::textHandler(void *ctx, const CC_XML_CHAR *name, int len)\n{\n    ((SAXParser*)(ctx))->_delegator->textHandler(ctx, (char*)name, len);\n}\nvoid SAXParser::setDelegator(SAXDelegator* delegator)\n{\n    _delegator = delegator;\n}\n\nNS_CC_END\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCSAXParser.h",
    "content": "/****************************************************************************\n Copyright (c) 2010 cocos2d-x.org\n Copyright (c) 2010 Максим Аксенов\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCSAXPARSER_H__\n#define __CCSAXPARSER_H__\n\n#include \"CCPlatformConfig.h\"\n#include \"platform/CCCommon.h\"\n#include <string>\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\ntypedef unsigned char CC_XML_CHAR;\n\nclass CC_DLL SAXDelegator\n{\npublic:\n    virtual ~SAXDelegator() {}\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void startElement(void *ctx, const char *name, const char **atts) = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void endElement(void *ctx, const char *name) = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void textHandler(void *ctx, const char *s, int len) = 0;\n};\n\nclass CC_DLL SAXParser\n{\n    SAXDelegator*    _delegator;\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    SAXParser();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~SAXParser(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool init(const char *encoding);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool parse(const char* xmlData, size_t dataLength);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool parse(const std::string& filename);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setDelegator(SAXDelegator* delegator);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static void startElement(void *ctx, const CC_XML_CHAR *name, const CC_XML_CHAR **atts);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static void endElement(void *ctx, const CC_XML_CHAR *name);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static void textHandler(void *ctx, const CC_XML_CHAR *name, int len);\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif //__CCSAXPARSER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCThread.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCThread.h\"\n\nNS_CC_BEGIN\n\n// iOS and Mac already has a Thread.mm\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)\n\n\nvoid* ThreadHelper::createAutoreleasePool()\n{\n    return nullptr;\n}\n\nvoid ThreadHelper::releaseAutoreleasePool(void* autoreleasePool)\n{\n    \n}\n\n#endif\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/CCThread.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_PLATFORM_THREAD_H__\n#define __CC_PLATFORM_THREAD_H__\n\n#include <functional>\n#include <list>\n#include <mutex>\n#include \"platform/CCCommon.h\"\n#include \"CCPlatformMacros.h\"\n#include \"CCDirector.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n/* On iOS, should create autorelease pool when create a new thread\n * and release it when the thread end.\n */\n\nclass CC_DLL ThreadHelper\n{\npublic:\n    friend DisplayLinkDirector;\n\n    /** Create an autorelease pool for objective-c codes.\n     * @js NA\n     * @lua NA\n     */\n    static void* createAutoreleasePool();\n    \n    /**\n     * @js NA\n     * @lua NA\n    */\n    static void releaseAutoreleasePool(void *autoreleasePool);\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_PLATFORM_THREAD_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos2dxandroid_static\n\nLOCAL_MODULE_FILENAME := libcocos2dandroid\n\nLOCAL_SRC_FILES := \\\nCCApplication.cpp \\\nCCCommon.cpp \\\nCCDevice.cpp \\\nCCEGLView.cpp \\\nCCFileUtilsAndroid.cpp \\\nCCImage.cpp \\\nnativeactivity.cpp \\\njni/DPIJni.cpp \\\njni/IMEJni.cpp \\\njni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp \\\njni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp \\\njni/JniHelper.cpp\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../.. \\\n                    $(LOCAL_PATH)/../../../base \\\n                    $(LOCAL_PATH)/../../../math/kazmath/include \\\n                    $(LOCAL_PATH)/../../../physics\n\nLOCAL_LDLIBS := -lGLESv1_CM \\\n                -lGLESv2 \\\n                -lEGL \\\n                -llog \\\n                -lz \\\n                -landroid\n\nLOCAL_EXPORT_LDLIBS := -lGLESv1_CM \\\n                       -lGLESv2 \\\n                       -lEGL \\\n                       -llog \\\n                       -lz \\\n                       -landroid\n\nLOCAL_WHOLE_STATIC_LIBRARIES\t:= android_native_app_glue cocos_png_static cocos_jpeg_static cocos_tiff_static cocos_webp_static\n\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,jpeg/prebuilt/android)\n$(call import-module,png/prebuilt/android)\n$(call import-module,tiff/prebuilt/android)\n$(call import-module,webp/prebuilt/android)\n$(call import-module,android/native_app_glue)\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCApplication.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"jni/JniHelper.h\"\n#include \"jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n#include \"CCApplication.h\"\n#include \"CCDirector.h\"\n#include \"CCEGLView.h\"\n#include <android/log.h>\n#include <jni.h>\n#include <cstring>\n\n#define  LOG_TAG    \"CCApplication_android Debug\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nNS_CC_BEGIN\n\n// sharedApplication pointer\nApplication * Application::sm_pSharedApplication = 0;\n\nApplication::Application()\n{\n    CCAssert(! sm_pSharedApplication, \"\");\n    sm_pSharedApplication = this;\n}\n\nApplication::~Application()\n{\n    CCAssert(this == sm_pSharedApplication, \"\");\n    sm_pSharedApplication = NULL;\n}\n\nint Application::run()\n{\n    // Initialize instance and cocos2d.\n    if (! applicationDidFinishLaunching())\n    {\n        return 0;\n    }\n    \n    return -1;\n}\n\nvoid Application::setAnimationInterval(double interval)\n{\n    // NYI\n}\n\n//////////////////////////////////////////////////////////////////////////\n// static member function\n//////////////////////////////////////////////////////////////////////////\nApplication* Application::getInstance()\n{\n    CCAssert(sm_pSharedApplication, \"\");\n    return sm_pSharedApplication;\n}\n\n// @deprecated Use getInstance() instead\nApplication* Application::sharedApplication()\n{\n    return Application::getInstance();\n}\n\nLanguageType Application::getCurrentLanguage()\n{\n    std::string languageName = getCurrentLanguageJNI();\n    const char* pLanguageName = languageName.c_str();\n    LanguageType ret = LanguageType::ENGLISH;\n\n    if (0 == strcmp(\"zh\", pLanguageName))\n    {\n        ret = LanguageType::CHINESE;\n    }\n    else if (0 == strcmp(\"en\", pLanguageName))\n    {\n        ret = LanguageType::ENGLISH;\n    }\n    else if (0 == strcmp(\"fr\", pLanguageName))\n    {\n        ret = LanguageType::FRENCH;\n    }\n    else if (0 == strcmp(\"it\", pLanguageName))\n    {\n        ret = LanguageType::ITALIAN;\n    }\n    else if (0 == strcmp(\"de\", pLanguageName))\n    {\n        ret = LanguageType::GERMAN;\n    }\n    else if (0 == strcmp(\"es\", pLanguageName))\n    {\n        ret = LanguageType::SPANISH;\n    }\n    else if (0 == strcmp(\"ru\", pLanguageName))\n    {\n        ret = LanguageType::RUSSIAN;\n    }\n    else if (0 == strcmp(\"ko\", pLanguageName))\n    {\n        ret = LanguageType::KOREAN;\n    }\n    else if (0 == strcmp(\"ja\", pLanguageName))\n    {\n        ret = LanguageType::JAPANESE;\n    }\n    else if (0 == strcmp(\"hu\", pLanguageName))\n    {\n        ret = LanguageType::HUNGARIAN;\n    }\n    else if (0 == strcmp(\"pt\", pLanguageName))\n    {\n        ret = LanguageType::PORTUGUESE;\n    }\n    else if (0 == strcmp(\"ar\", pLanguageName))\n    {\n        ret = LanguageType::ARABIC;\n    }\n    else if (0 == strcmp(\"nb\", pLanguageName))\n    {\n        ret = LanguageType::NORWEGIAN;\n    }\n    else if (0 == strcmp(\"pl\", pLanguageName))\n    {\n        ret = LanguageType::POLISH;\n    }\n    return ret;\n}\n\nApplication::Platform Application::getTargetPlatform()\n{\n    return Platform::OS_ANDROID;\n}\n\nvoid Application::applicationScreenSizeChanged(int newWidth, int newHeight) {\n\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCApplication.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_APPLICATION_ANDROID_H__\n#define __CC_APPLICATION_ANDROID_H__\n\n#include \"platform/CCCommon.h\"\n#include \"platform/CCApplicationProtocol.h\"\n\nNS_CC_BEGIN\n\nclass CC_DLL Application : public ApplicationProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    Application();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Application();\n\n    /**\n    @brief    Callback by Director to limit FPS.\n    @param interval The time, expressed in seconds, between current frame and next.\n    */\n    void setAnimationInterval(double interval);\n\n    /**\n    @brief    Run the message loop.\n    */\n    int run();\n\n    /**\n    @brief    Get current application instance.\n    @return Current application instance pointer.\n    */\n    static Application* getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();\n\n    /**\n    @brief Get current language config\n    @return Current language config\n    */\n    virtual LanguageType getCurrentLanguage();\n    \n    /**\n     @brief Get target platform\n     */\n    virtual Platform getTargetPlatform();\n\n\t/**\n\t@brief  This function will be called when the application screen size is changed.\n\t@param new width\n\t@param new height\n\t*/\n\tvirtual void applicationScreenSizeChanged(int newWidth, int newHeight);\n\nprotected:\n    static Application * sm_pSharedApplication;\n};\n\nNS_CC_END\n\n#endif    // __CC_APPLICATION_ANDROID_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCCommon.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"platform/CCCommon.h\"\n#include \"jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n#include <android/log.h>\n#include <stdio.h>\n#include <jni.h>\n\nNS_CC_BEGIN\n\n#define MAX_LEN         (cocos2d::kMaxLogLen + 1)\n\nvoid MessageBox(const char * pszMsg, const char * pszTitle)\n{\n    showDialogJNI(pszMsg, pszTitle);\n}\n\nvoid LuaLog(const char * pszFormat)\n{\n    __android_log_write(ANDROID_LOG_DEBUG, \"cocos2d-x debug info\", pszFormat);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCDevice.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"platform/CCDevice.h\"\n#include \"jni/DPIJni.h\"\n#include \"nativeactivity.h\"\n\nNS_CC_BEGIN\n\nint Device::getDPI()\n{\n    static int dpi = -1;\n    if (dpi == -1)\n    {\n        dpi = (int)getDPIJNI();\n    }\n    return dpi;\n}\n\nvoid Device::setAccelerometerEnabled(bool isEnabled)\n{\n    if (isEnabled)\n    {\n        enableAccelerometerJni();\n    }\n    else\n    {\n        disableAccelerometerJni();\n    }\n}\n\nvoid Device::setAccelerometerInterval(float interval)\n{\n\tsetAccelerometerIntervalJni(interval);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCEGLView.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCEGLView.h\"\n#include \"CCSet.h\"\n#include \"CCDirector.h\"\n#include \"ccMacros.h\"\n#include \"jni/IMEJni.h\"\n#include \"jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n#include \"CCGL.h\"\n\n#include <stdlib.h>\n#include <android/log.h>\n\n\n// <EGL/egl.h> exists since android 2.3\n#include <EGL/egl.h>\nPFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOESEXT = 0;\nPFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOESEXT = 0;\nPFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESEXT = 0;\n\nvoid initExtensions() {\n     glGenVertexArraysOESEXT = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress(\"glGenVertexArraysOES\");\n     glBindVertexArrayOESEXT = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress(\"glBindVertexArrayOES\");\n     glDeleteVertexArraysOESEXT = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress(\"glDeleteVertexArraysOES\");\n}\n\nNS_CC_BEGIN\n\nEGLView::EGLView()\n{\n    initExtensions();\n}\n\nEGLView::~EGLView()\n{\n\n}\n\nbool EGLView::isOpenGLReady()\n{\n    return (_screenSize.width != 0 && _screenSize.height != 0);\n}\n\nvoid EGLView::end()\n{\n    terminateProcessJNI();\n}\n\nvoid EGLView::swapBuffers()\n{\n}\n\nEGLView* EGLView::getInstance()\n{\n    static EGLView instance;\n    return &instance;\n}\n\n// XXX: deprecated\nEGLView* EGLView::sharedOpenGLView()\n{\n    return EGLView::getInstance();\n}\n\nvoid EGLView::setIMEKeyboardState(bool bOpen)\n{\n    setKeyboardStateJNI((int)bOpen);\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCEGLView.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EGLVIEW_ANDROID_H__\n#define __CC_EGLVIEW_ANDROID_H__\n\n#include \"CCGeometry.h\"\n#include \"platform/CCEGLViewProtocol.h\"\n\nNS_CC_BEGIN\n\nclass CC_DLL EGLView : public EGLViewProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    EGLView();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EGLView();\n\n    bool    isOpenGLReady();\n\n    // keep compatible\n    void    end();\n    void    swapBuffers();\n    void    setIMEKeyboardState(bool bOpen);\n    \n    // static function\n    /**\n    @brief    get the shared main open gl window\n    */\n    static EGLView* getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView();\n};\n\nNS_CC_END\n\n#endif    // end of __CC_EGLVIEW_ANDROID_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCFileUtilsAndroid.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCFileUtilsAndroid.h\"\n#include \"platform/CCCommon.h\"\n#include \"jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n#include \"android/asset_manager.h\"\n#include \"android/asset_manager_jni.h\"\n\n#include <stdlib.h>\n\n#define  LOG_TAG    \"CCFileUtilsAndroid.cpp\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nAAssetManager* FileUtilsAndroid::assetmanager = nullptr;\n\nvoid FileUtilsAndroid::setassetmanager(AAssetManager* a) {\n    if (nullptr == a) {\n        LOGD(\"setassetmanager : received unexpected nullptr parameter\");\n        return;\n    }\n\n    cocos2d::FileUtilsAndroid::assetmanager = a;\n}\n\nFileUtils* FileUtils::getInstance()\n{\n    if (s_sharedFileUtils == nullptr)\n    {\n        s_sharedFileUtils = new FileUtilsAndroid();\n        if(!s_sharedFileUtils->init())\n        {\n          delete s_sharedFileUtils;\n          s_sharedFileUtils = nullptr;\n          CCLOG(\"ERROR: Could not init CCFileUtilsAndroid\");\n        }\n    }\n    return s_sharedFileUtils;\n}\n\nFileUtilsAndroid::FileUtilsAndroid()\n{\n}\n\nFileUtilsAndroid::~FileUtilsAndroid()\n{\n}\n\nbool FileUtilsAndroid::init()\n{\n    _defaultResRootPath = \"assets/\";\n    return FileUtils::init();\n}\n\nbool FileUtilsAndroid::isFileExist(const std::string& strFilePath) const\n{\n    if (0 == strFilePath.length())\n    {\n        return false;\n    }\n\n    bool bFound = false;\n    \n    // Check whether file exists in apk.\n    if (strFilePath[0] != '/')\n    {\n        const char* s = strFilePath.c_str();\n\n        // Found \"assets/\" at the beginning of the path and we don't want it\n        if (strFilePath.find(_defaultResRootPath) == 0) s += strlen(\"assets/\");\n\n        if (FileUtilsAndroid::assetmanager) {\n            AAsset* aa = AAssetManager_open(FileUtilsAndroid::assetmanager, s, AASSET_MODE_UNKNOWN);\n            if (aa)\n            {\n                bFound = true;\n                AAsset_close(aa);\n            } else {\n                // CCLOG(\"[AssetManager] ... in APK %s, found = false!\", strFilePath.c_str());\n            }\n        }\n    }\n    else\n    {\n        FILE *fp = fopen(strFilePath.c_str(), \"r\");\n        if(fp)\n        {\n            bFound = true;\n            fclose(fp);\n        }\n    }\n    return bFound;\n}\n\nbool FileUtilsAndroid::isAbsolutePath(const std::string& strPath) const\n{\n    // On Android, there are two situations for full path.\n    // 1) Files in APK, e.g. assets/path/path/file.png\n    // 2) Files not in APK, e.g. /data/data/org.cocos2dx.hellocpp/cache/path/path/file.png, or /sdcard/path/path/file.png.\n    // So these two situations need to be checked on Android.\n    if (strPath[0] == '/' || strPath.find(_defaultResRootPath) == 0)\n    {\n        return true;\n    }\n    return false;\n}\n\nData FileUtilsAndroid::getData(const std::string& filename, bool forString)\n{\n    if (filename.empty())\n    {\n        return Data::Null;\n    }\n    \n    unsigned char* data = nullptr;\n    ssize_t size = 0;\n    string fullPath = fullPathForFilename(filename);\n    \n    if (fullPath[0] != '/')\n    {\n        string relativePath = string();\n\n        size_t position = fullPath.find(\"assets/\");\n        if (0 == position) {\n            // \"assets/\" is at the beginning of the path and we don't want it\n            relativePath += fullPath.substr(strlen(\"assets/\"));\n        } else {\n            relativePath += fullPath;\n        }\n        LOGD(\"relative path = %s\", relativePath.c_str());\n\n        if (nullptr == FileUtilsAndroid::assetmanager) {\n            LOGD(\"... FileUtilsAndroid::assetmanager is nullptr\");\n            return Data::Null;\n        }\n\n        // read asset data\n        AAsset* asset =\n            AAssetManager_open(FileUtilsAndroid::assetmanager,\n                               relativePath.c_str(),\n                               AASSET_MODE_UNKNOWN);\n        if (nullptr == asset) {\n            LOGD(\"asset is nullptr\");\n            return Data::Null;\n        }\n\n        off_t fileSize = AAsset_getLength(asset);\n\n        if (forString)\n        {\n            data = (unsigned char*) malloc(fileSize + 1);\n            data[fileSize] = '\\0';\n        }\n        else\n        {\n            data = (unsigned char*) malloc(fileSize);\n        }\n\n        int bytesread = AAsset_read(asset, (void*)data, fileSize);\n        size = bytesread;\n\n        AAsset_close(asset);\n    }\n    else\n    {\n        do\n        {\n            // read rrom other path than user set it\n            //CCLOG(\"GETTING FILE ABSOLUTE DATA: %s\", filename);\n            const char* mode = nullptr;\n            if (forString)\n                mode = \"rt\";\n            else\n                mode = \"rb\";\n\n            FILE *fp = fopen(fullPath.c_str(), mode);\n            CC_BREAK_IF(!fp);\n            \n            long fileSize;\n            fseek(fp,0,SEEK_END);\n            fileSize = ftell(fp);\n            fseek(fp,0,SEEK_SET);\n            if (forString)\n            {\n                data = (unsigned char*) malloc(fileSize + 1);\n                data[fileSize] = '\\0';\n            }\n            else\n            {\n                data = (unsigned char*) malloc(fileSize);\n            }\n            fileSize = fread(data,sizeof(unsigned char), fileSize,fp);\n            fclose(fp);\n            \n            size = fileSize;\n        } while (0);\n    }\n    \n    Data ret;\n    if (data == nullptr || size == 0)\n    {\n        std::string msg = \"Get data from file(\";\n        msg.append(filename).append(\") failed!\");\n        CCLOG(\"%s\", msg.c_str());\n    }\n    else\n    {\n        ret.fastSet(data, size);\n    }\n\n    return ret;\n}\n\nstd::string FileUtilsAndroid::getStringFromFile(const std::string& filename)\n{\n    Data data = getData(filename, true);\n    std::string ret((const char*)data.getBytes());\n    return ret;\n}\n    \nData FileUtilsAndroid::getDataFromFile(const std::string& filename)\n{\n    return getData(filename, false);\n}\n\nunsigned char* FileUtilsAndroid::getFileData(const std::string& filename, const char* mode, ssize_t * size)\n{    \n    unsigned char * data = 0;\n    \n    if ( filename.empty() || (! mode) )\n    {\n        return 0;\n    }\n    \n    string fullPath = fullPathForFilename(filename);\n    \n    if (fullPath[0] != '/')\n    {\n        string relativePath = string();\n\n        size_t position = fullPath.find(\"assets/\");\n        if (0 == position) {\n            // \"assets/\" is at the beginning of the path and we don't want it\n            relativePath += fullPath.substr(strlen(\"assets/\"));\n        } else {\n            relativePath += fullPath;\n        }\n        LOGD(\"relative path = %s\", relativePath.c_str());\n\n        if (nullptr == FileUtilsAndroid::assetmanager) {\n            LOGD(\"... FileUtilsAndroid::assetmanager is nullptr\");\n            return nullptr;\n        }\n\n        // read asset data\n        AAsset* asset =\n            AAssetManager_open(FileUtilsAndroid::assetmanager,\n                               relativePath.c_str(),\n                               AASSET_MODE_UNKNOWN);\n        if (nullptr == asset) {\n            LOGD(\"asset is nullptr\");\n            return nullptr;\n        }\n\n        off_t fileSize = AAsset_getLength(asset);\n\n        data = (unsigned char*) malloc(fileSize);\n\n        int bytesread = AAsset_read(asset, (void*)data, fileSize);\n        if (size)\n        {\n            *size = bytesread;\n        }\n\n        AAsset_close(asset);\n    }\n    else\n    {\n        do\n        {\n            // read rrom other path than user set it\n            //CCLOG(\"GETTING FILE ABSOLUTE DATA: %s\", filename);\n            FILE *fp = fopen(fullPath.c_str(), mode);\n            CC_BREAK_IF(!fp);\n            \n            long fileSize;\n            fseek(fp,0,SEEK_END);\n            fileSize = ftell(fp);\n            fseek(fp,0,SEEK_SET);\n            data = (unsigned char*) malloc(fileSize);\n            fileSize = fread(data,sizeof(unsigned char), fileSize,fp);\n            fclose(fp);\n            \n            if (size)\n            {\n                *size = fileSize;\n            }\n        } while (0);\n    }\n    \n    if (! data)\n    {\n        std::string msg = \"Get data from file(\";\n        msg.append(filename).append(\") failed!\");\n        CCLOG(\"%s\", msg.c_str());\n    }\n    \n    return data;\n}\n\nstring FileUtilsAndroid::getWritablePath() const\n{\n    // Fix for Nexus 10 (Android 4.2 multi-user environment)\n    // the path is retrieved through Java Context.getCacheDir() method\n    string dir(\"\");\n    string tmp = getFileDirectoryJNI();\n\n    if (tmp.length() > 0)\n    {\n        dir.append(tmp).append(\"/\");\n\n        return dir;\n    }\n    else\n    {\n        return \"\";\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCFileUtilsAndroid.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __CC_FILEUTILS_ANDROID_H__\n#define __CC_FILEUTILS_ANDROID_H__\n\n#include \"platform/CCFileUtils.h\"\n#include \"CCPlatformMacros.h\"\n#include \"ccTypes.h\"\n#include <string>\n#include <vector>\n#include \"jni.h\"\n#include \"android/asset_manager.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n//! @brief  Helper class to handle file operations\nclass CC_DLL FileUtilsAndroid : public FileUtils\n{\n    friend class FileUtils;\n    FileUtilsAndroid();\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~FileUtilsAndroid();\n\n    static void setassetmanager(AAssetManager* a);\n\n    /* override funtions */\n    bool init();\n\n    /** @deprecated Please use FileUtils::getDataFromFile or FileUtils::getStringFromFile instead. */\n    CC_DEPRECATED_ATTRIBUTE virtual unsigned char* getFileData(const std::string& filename, const char* mode, ssize_t * size) override;\n\n    /**\n     *  Gets string from a file.\n     */\n    virtual std::string getStringFromFile(const std::string& filename) override;\n    \n    /**\n     *  Creates binary data from a file.\n     *  @return A data object.\n     */\n    virtual Data getDataFromFile(const std::string& filename) override;\n\n    virtual std::string getWritablePath() const;\n    virtual bool isFileExist(const std::string& strFilePath) const;\n    virtual bool isAbsolutePath(const std::string& strPath) const;\n    \nprivate:\n    Data getData(const std::string& filename, bool forString);\n\n    static AAssetManager* assetmanager;\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_FILEUTILS_ANDROID_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCGL.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCGL_H__\n#define __CCGL_H__\n\n#define\tglClearDepth\t\t\t\tglClearDepthf\n#define glDeleteVertexArrays\t\tglDeleteVertexArraysOES\n#define glGenVertexArrays\t\t\tglGenVertexArraysOES\n#define glBindVertexArray\t\t\tglBindVertexArrayOES\n#define glMapBuffer\t\t\t\t\tglMapBufferOES\n#define glUnmapBuffer\t\t\t\tglUnmapBufferOES\n\n#define GL_DEPTH24_STENCIL8\t\t\tGL_DEPTH24_STENCIL8_OES\n#define GL_WRITE_ONLY\t\t\t\tGL_WRITE_ONLY_OES\n\n// GL_GLEXT_PROTOTYPES isn't defined in glplatform.h on android ndk r7 \n// we manually define it here\n#include <GLES2/gl2platform.h>\n#ifndef GL_GLEXT_PROTOTYPES\n#define GL_GLEXT_PROTOTYPES 1\n#endif\n\n// normal process\n#include <GLES2/gl2.h>\n#include <GLES2/gl2ext.h>\n// gl2.h doesn't define GLchar on Android\ntypedef char GLchar;\n// android defines GL_BGRA_EXT but not GL_BRGA\n#ifndef GL_BGRA\n#define GL_BGRA  0x80E1\n#endif\n\n//declare here while define in EGLView_android.cpp\nextern PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOESEXT;\nextern PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOESEXT;\nextern PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESEXT;\n\n#define glGenVertexArraysOES glGenVertexArraysOESEXT\n#define glBindVertexArrayOES glBindVertexArrayOESEXT\n#define glDeleteVertexArraysOES glDeleteVertexArraysOESEXT\n\n\n#endif // __CCGL_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCImage.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n//#define COCOS2D_DEBUG 1\n\n#define __CC_PLATFORM_IMAGE_CPP__\n#include \"platform/CCImageCommon_cpp.h\"\n#include \"CCPlatformMacros.h\"\n#include \"platform/CCImage.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"jni/JniHelper.h\"\n\n#include <android/log.h>\n#include <string.h>\n#include <jni.h>\n\nNS_CC_BEGIN\n\nclass BitmapDC\n{\npublic:\n\n    BitmapDC()\n    : _data(NULL)\n    , _width(0)\n    , _height(0)\n    {\n    }\n\n    ~BitmapDC(void)\n    {\n        if (_data)\n        {\n            delete [] _data;\n        }\n    }\n\n    bool getBitmapFromJavaShadowStroke(\tconst char *text,\n    \t\t\t\t\t\t\t\t\tint nWidth,\n    \t\t\t\t\t\t\t\t\tint nHeight,\n    \t\t\t\t\t\t\t\t\tImage::TextAlign eAlignMask,\n    \t\t\t\t\t\t\t\t\tconst char * pFontName,\n    \t\t\t\t\t\t\t\t\tfloat fontSize,\n    \t\t\t\t\t\t\t\t\tfloat textTintR \t\t= 1.0,\n    \t\t\t\t\t\t\t\t\tfloat textTintG \t\t= 1.0,\n    \t\t\t\t\t\t\t\t\tfloat textTintB \t\t= 1.0,\n    \t\t\t\t\t\t\t\t\tbool shadow \t\t\t= false,\n    \t\t\t\t\t\t\t\t\tfloat shadowDeltaX \t\t= 0.0,\n    \t\t\t\t\t\t\t\t\tfloat shadowDeltaY \t\t= 0.0,\n    \t\t\t\t\t\t\t\t\tfloat shadowBlur \t\t= 0.0,\n    \t\t\t\t\t\t\t\t\tfloat shadowOpacity \t= 0.0,\n    \t\t\t\t\t\t\t\t\tbool stroke \t\t\t= false,\n    \t\t\t\t\t\t\t\t\tfloat strokeColorR \t\t= 0.0,\n    \t\t\t\t\t\t\t\t\tfloat strokeColorG \t\t= 0.0,\n    \t\t\t\t\t\t\t\t\tfloat strokeColorB \t\t= 0.0,\n    \t\t\t\t\t\t\t\t\tfloat strokeSize \t\t= 0.0 )\n    {\n           JniMethodInfo methodInfo;\n           if (! JniHelper::getStaticMethodInfo(methodInfo, \"org/cocos2dx/lib/Cocos2dxBitmap\", \"createTextBitmapShadowStroke\",\n               \"(Ljava/lang/String;Ljava/lang/String;IFFFIIIZFFFFZFFFF)Z\"))\n           {\n               CCLOG(\"%s %d: error to get methodInfo\", __FILE__, __LINE__);\n               return false;\n           }\n        \n        \n        \n           // Do a full lookup for the font path using FileUtils in case the given font name is a relative path to a font file asset,\n           // or the path has been mapped to a different location in the app package:\n           std::string fullPathOrFontName = FileUtils::getInstance()->fullPathForFilename(pFontName);\n        \n\t\t   // If the path name returned includes the 'assets' dir then that needs to be removed, because the android.content.Context\n\t\t   // requires this portion of the path to be omitted for assets inside the app package.\n\t\t   if (fullPathOrFontName.find(\"assets/\") == 0)\n\t\t   {\n               fullPathOrFontName = fullPathOrFontName.substr(strlen(\"assets/\"));\t// Chop out the 'assets/' portion of the path.\n           }\n\n           /**create bitmap\n            * this method call Cococs2dx.createBitmap()(java code) to create the bitmap, the java code\n            * will call Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC() to init the width, height\n            * and data.\n            * use this approach to decrease the jni call number\n           */\n           jstring jstrText = methodInfo.env->NewStringUTF(text);\n           jstring jstrFont = methodInfo.env->NewStringUTF(fullPathOrFontName.c_str());\n\n           if(!methodInfo.env->CallStaticBooleanMethod(methodInfo.classID, methodInfo.methodID, jstrText,\n               jstrFont, (int)fontSize, textTintR, textTintG, textTintB, eAlignMask, nWidth, nHeight, shadow, shadowDeltaX, -shadowDeltaY, shadowBlur, shadowOpacity, stroke, strokeColorR, strokeColorG, strokeColorB, strokeSize))\n           {\n                return false;\n           }\n\n\n           methodInfo.env->DeleteLocalRef(jstrText);\n           methodInfo.env->DeleteLocalRef(jstrFont);\n           methodInfo.env->DeleteLocalRef(methodInfo.classID);\n\n           return true;\n    }\n\n\n    bool getBitmapFromJava(const char *text, int nWidth, int nHeight, Image::TextAlign eAlignMask, const char * pFontName, float fontSize)\n    {\n    \treturn  getBitmapFromJavaShadowStroke(\ttext, nWidth, nHeight, eAlignMask, pFontName, fontSize );\n    }\n\npublic:\n    int _width;\n    int _height;\n    unsigned char *_data;\n    JNIEnv *env;\n};\n\nstatic BitmapDC& sharedBitmapDC()\n{\n    static BitmapDC s_BmpDC;\n    return s_BmpDC;\n}\n\nbool Image::initWithString(\n                               const char *    pText, \n                               int             nWidth/* = 0*/, \n                               int             nHeight/* = 0*/,\n                               TextAlign      eAlignMask/* = kAlignCenter*/,\n                               const char *    pFontName/* = nil*/,\n                               int             nSize/* = 0*/)\n{\n    bool bRet = false;\n\n    do \n    {\n        CC_BREAK_IF(! pText);\n        \n        BitmapDC &dc = sharedBitmapDC();\n\n        CC_BREAK_IF(! dc.getBitmapFromJava(pText, nWidth, nHeight, eAlignMask, pFontName, nSize));\n\n        // assign the dc._data to _data in order to save time\n        _data = dc._data;\n        CC_BREAK_IF(! _data);\n\n        _width    = (short)dc._width;\n        _height   = (short)dc._height;\n        _preMulti = true;\n        _renderFormat = Texture2D::PixelFormat::RGBA8888;\n        _dataLen = _width * _height * 4;\n\n        bRet = true;\n    } while (0);\n\n    return bRet;\n}\n\nbool Image::initWithStringShadowStroke(\n                                         const char * pText,\n                                         int         nWidth ,\n                                         int         nHeight ,\n                                         TextAlign eAlignMask ,\n                                         const char * pFontName ,\n                                         int          nSize ,\n                                         float        textTintR,\n                                         float        textTintG,\n                                         float        textTintB,\n                                         bool shadow,\n                                         float shadowOffsetX,\n                                         float shadowOffsetY,\n                                         float shadowOpacity,\n                                         float shadowBlur,\n                                         bool  stroke,\n                                         float strokeR,\n                                         float strokeG,\n                                         float strokeB,\n                                         float strokeSize)\n{\n\t bool bRet = false;\n\t    do\n\t    {\n\t        CC_BREAK_IF(! pText);\n\n\t        BitmapDC &dc = sharedBitmapDC();\n\n\n\t        CC_BREAK_IF(! dc.getBitmapFromJavaShadowStroke(pText, nWidth, nHeight, eAlignMask, pFontName,\n\t        \t\t\t\t\t\t\t\t\t\t\t   nSize, textTintR, textTintG, textTintB, shadow,\n\t        \t\t\t\t\t\t\t\t\t\t\t   shadowOffsetX, shadowOffsetY, shadowBlur, shadowOpacity,\n\t        \t\t\t\t\t\t\t\t\t\t\t   stroke, strokeR, strokeG, strokeB, strokeSize ));\n\n\n\t        // assign the dc._data to _data in order to save time\n\t        _data = dc._data;\n\n\t        CC_BREAK_IF(! _data);\n\n\t        _width    = (short)dc._width;\n\t        _height   = (short)dc._height;\n\t        _preMulti = true;\n\t\t    _renderFormat = Texture2D::PixelFormat::RGBA8888;\n            _dataLen = _width * _height * 4;\n\n\t        // ok\n\t        bRet = true;\n\n\t    } while (0);\n\n\t    return bRet;\n}\n\nNS_CC_END\n\n// this method is called by Cocos2dxBitmap\nextern \"C\"\n{\n    /**\n    * this method is called by java code to init width, height and pixels data\n    */\n    JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC(JNIEnv*  env, jobject thiz, int width, int height, jbyteArray pixels)\n    {\n        int size = width * height * 4;\n        cocos2d::BitmapDC& bitmapDC = cocos2d::sharedBitmapDC();\n        bitmapDC._width = width;\n        bitmapDC._height = height;\n        bitmapDC._data = new unsigned char[size];\n        env->GetByteArrayRegion(pixels, 0, size, (jbyte*)bitmapDC._data);\n    }\n};\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCPlatformDefine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCPLATFORMDEFINE_H__\n#define __CCPLATFORMDEFINE_H__\n\n#include \"android/log.h\"\n\n#define CC_DLL\n\n#define CC_NO_MESSAGE_PSEUDOASSERT(cond)                        \\\n    if (!(cond)) {                                              \\\n        __android_log_print(ANDROID_LOG_ERROR,                  \\\n                            \"cocos2d-x assert\",                 \\\n                            \"%s function:%s line:%d\",           \\\n                            __FILE__, __FUNCTION__, __LINE__);  \\\n    }\n\n#define CC_MESSAGE_PSEUDOASSERT(cond, msg)                          \\\n    if (!(cond)) {                                                  \\\n        __android_log_print(ANDROID_LOG_ERROR,                      \\\n                            \"cocos2d-x assert\",                     \\\n                            \"file:%s function:%s line:%d, %s\",      \\\n                            __FILE__, __FUNCTION__, __LINE__, msg); \\\n    }\n\n#define CC_ASSERT(cond) CC_NO_MESSAGE_PSEUDOASSERT(cond)\n\n#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam\n\n/* Define NULL pointer value */\n#ifndef NULL\n#ifdef __cplusplus\n#define NULL    0\n#else\n#define NULL    ((void *)0)\n#endif\n#endif\n\n#endif /* __CCPLATFORMDEFINE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/CCStdC.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_STD_C_H__\n#define __CC_STD_C_H__\n\n#include \"CCPlatformMacros.h\"\n#include <float.h>\n#include <math.h>\n#include <string.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n#include <sys/time.h>\n#include <stdint.h>\n\n#ifndef MIN\n#define MIN(x,y) (((x) > (y)) ? (y) : (x))\n#endif  // MIN\n\n#ifndef MAX\n#define MAX(x,y) (((x) < (y)) ? (y) : (x))\n#endif  // MAX\n\n#endif  // __CC_STD_C_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libcocos2dx</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/.settings/org.eclipse.jdt.core.prefs",
    "content": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.compliance=1.6\norg.eclipse.jdt.core.compiler.source=1.6\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.lib\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"9\"/>\n\n</manifest> \n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/ant.properties",
    "content": "# This file is used to override default values used by the Ant build system.\n#\n# This file must be checked into Version Control Systems, as it is\n# integral to the build system of your project.\n\n# This file is only used by the Ant script.\n\n# You can use this to override default values such as\n#  'source.dir' for the location of your java source folder and\n#  'out.dir' for the location of your output folder.\n\n# You can also use it define how the release builds are signed by declaring\n# the following properties:\n#  'key.store' for the location of your keystore and\n#  'key.alias' for the name of the key to use.\n# The password will be asked during the build when you use the 'release' target.\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"cocos2dxandroid\" default=\"help\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${sdk.dir}/tools/ant/build.xml\" />\n\n</project>\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\nandroid.library=true\n# Project target.\ntarget=android-10\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n ****************************************************************************/\npackage org.cocos2dx.lib;\n\nimport java.nio.ByteBuffer;\nimport java.nio.ByteOrder;\nimport java.util.LinkedList;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Paint.Align;\nimport android.graphics.Paint.FontMetricsInt;\nimport android.graphics.Rect;\nimport android.graphics.Typeface;\nimport android.text.TextPaint;\nimport android.text.TextUtils;\nimport android.util.FloatMath;\nimport android.util.Log;\n\npublic class Cocos2dxBitmap {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\t/* The values are the same as cocos2dx/platform/CCImage.h. */\n\tprivate static final int HORIZONTALALIGN_LEFT = 1;\n\tprivate static final int HORIZONTALALIGN_RIGHT = 2;\n\tprivate static final int HORIZONTALALIGN_CENTER = 3;\n\tprivate static final int VERTICALALIGN_TOP = 1;\n\tprivate static final int VERTICALALIGN_BOTTOM = 2;\n\tprivate static final int VERTICALALIGN_CENTER = 3;\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\n\tprivate static Context _context;\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\tpublic static void setContext(final Context context) {\n\t\tCocos2dxBitmap._context = context;\n\t}\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\n\tprivate static native void nativeInitBitmapDC(final int width,\n\t\t\tfinal int height, final byte[] pixels);\n\n\t/**\n\t * @param pWidth\n\t *            the width to draw, it can be 0\n\t * @param pHeight\n\t *            the height to draw, it can be 0\n\t */\n\tpublic static void createTextBitmap(String string, final String fontName,\n\t\t\tfinal int fontSize, final int alignment, final int width,\n\t\t\tfinal int height) {\n\t\t\n\t\t//\n\t\tcreateTextBitmapShadowStroke( string, fontName, fontSize, 1.0f, 1.0f, 1.0f,   \t// text font and color\n\t\t\t\t\t\t\t\t\t  alignment, width, height,\t\t\t\t\t\t\t// alignment and size\n\t\t\t\t\t\t\t\t\t  false, 0.0f, 0.0f, 0.0f, 0.0f,           \t\t\t\t// no shadow\n\t\t\t\t\t\t\t\t\t  false, 1.0f, 1.0f, 1.0f, 1.0f);\t\t\t\t\t\t// no stroke\n\t\t\t\t\t\t\t\t\t \n\t}\n\n\tpublic static boolean createTextBitmapShadowStroke(String string,  final String fontName, final int fontSize,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfinal float fontTintR, final float fontTintG, final float fontTintB,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfinal int alignment, final int width, final int height, final boolean shadow,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfinal float shadowDX, final float shadowDY, final float shadowBlur, final float shadowOpacity, final boolean stroke,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfinal float strokeR, final float strokeG, final float strokeB, final float strokeSize) {\n\n\t\t\n\t\tfinal int horizontalAlignment = alignment & 0x0F;\n\t\tfinal int verticalAlignment   = (alignment >> 4) & 0x0F;\n\n\t\tstring = Cocos2dxBitmap.refactorString(string);\n\t\tfinal Paint paint = Cocos2dxBitmap.newPaint(fontName, fontSize, horizontalAlignment);\n\t\t/**\n\t\t * if the first word width less than designed width,It means no words to show\n\t\t */\n\t\tif(0 != width)\n\t\t{\n\t\t\tfinal int firstWordWidth = (int) FloatMath.ceil(paint.measureText(string, 0,1));\n\t\t\tif ( firstWordWidth > width)\n\t\t\t{\n\t\t\t\tLog.w(\"createTextBitmapShadowStroke warning:\",\"the input width is less than the width of the pString's first word\\n\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\t// set the paint color\n\t\tpaint.setARGB(255, (int)(255.0 * fontTintR), (int)(255.0 * fontTintG), (int)(255.0 * fontTintB));\n\n\t\tfinal TextProperty textProperty = Cocos2dxBitmap.computeTextProperty(string, width, height, paint);\n\t\tfinal int bitmapTotalHeight = (height == 0 ? textProperty.mTotalHeight: height);\n\t\t\n\t\t// padding needed when using shadows (not used otherwise)\n\t\tfloat bitmapPaddingX   = 0.0f;\n\t\tfloat bitmapPaddingY   = 0.0f;\n\t\tfloat renderTextDeltaX = 0.0f;\n\t\tfloat renderTextDeltaY = 0.0f;\n\t\t\n\t\tif ( shadow ) {\n\n\t\t\tint shadowColor = ((int)(255 * shadowOpacity) & 0xff) << 24;\n\t\t\tpaint.setShadowLayer(shadowBlur, shadowDX, shadowDY, shadowColor);\n\t\n\t\t\tbitmapPaddingX = Math.abs(shadowDX);\n\t\t\tbitmapPaddingY = Math.abs(shadowDY);\n\t\t\t\t\t\n\t\t\tif ( shadowDX < 0.0 )\n\t\t\t{\n\t\t\t\trenderTextDeltaX = bitmapPaddingX;\n\t\t\t}\n\t\t\t\n\t\t\tif ( shadowDY < 0.0 )\n\t\t\t{\n\t\t\t\trenderTextDeltaY = \tbitmapPaddingY;\n\t\t\t}\n\t\t}\n\n\t\tif (0 == textProperty.mMaxWidth || 0 == bitmapTotalHeight)\n\t\t{\n\t\t\tLog.w(\"createTextBitmapShadowStroke warning:\",\"textProperty MaxWidth is 0 or bitMapTotalHeight is 0\\n\");\n\t\t\treturn false;\n\t\t}\n\n\t\t\n\t\tfinal Bitmap bitmap = Bitmap.createBitmap(textProperty.mMaxWidth + (int)bitmapPaddingX,\n\t\t\t\tbitmapTotalHeight + (int)bitmapPaddingY, Bitmap.Config.ARGB_8888);\n\t\t\n\t\tfinal Canvas canvas = new Canvas(bitmap);\n\n\t\t/* Draw string. */\n\t\tfinal FontMetricsInt fontMetricsInt = paint.getFontMetricsInt();\n\t\t\n\t\tint x = 0;\n\t\tint y = Cocos2dxBitmap.computeY(fontMetricsInt, height, textProperty.mTotalHeight, verticalAlignment);\n\t\t\n\t\tfinal String[] lines = textProperty.mLines;\n\t\t\n\t\tfor (final String line : lines) {\n\t\t\t\n\t\t\tx = Cocos2dxBitmap.computeX(line, textProperty.mMaxWidth, horizontalAlignment);\n\t\t\tcanvas.drawText(line, x + renderTextDeltaX, y + renderTextDeltaY, paint);\n\t\t\ty += textProperty.mHeightPerLine;\n\t\t\t\n\t\t}\n\t\t \n\t\t// draw again with stroke on if needed \n\t\tif ( stroke ) {\n\t\t\t\n\t\t\tfinal Paint paintStroke = Cocos2dxBitmap.newPaint(fontName, fontSize, horizontalAlignment);\n\t\t\tpaintStroke.setStyle(Paint.Style.STROKE);\n\t\t\tpaintStroke.setStrokeWidth(strokeSize * 0.5f);\n\t\t\tpaintStroke.setARGB(255, (int) (strokeR * 255), (int) (strokeG * 255), (int) (strokeB * 255));\n\t\t\t\n\t\t\tx = 0;\n\t\t\ty = Cocos2dxBitmap.computeY(fontMetricsInt, height, textProperty.mTotalHeight, verticalAlignment);\n\t\t\tfinal String[] lines2 = textProperty.mLines;\n\t\t\t\n\t\t\tfor (final String line : lines2) {\n\t\t\t\t\n\t\t\t\tx = Cocos2dxBitmap.computeX(line, textProperty.mMaxWidth, horizontalAlignment);\n\t\t\t\tcanvas.drawText(line, x + renderTextDeltaX, y + renderTextDeltaY, paintStroke);\n\t\t\t\ty += textProperty.mHeightPerLine;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tCocos2dxBitmap.initNativeObject(bitmap);\n\n\t\treturn true;\n\t}\n\n\tprivate static Paint newPaint(final String fontName, final int fontSize,\n\t\t\tfinal int horizontalAlignment) {\n\t\tfinal Paint paint = new Paint();\n\t\tpaint.setColor(Color.WHITE);\n\t\tpaint.setTextSize(fontSize); \n\t\tpaint.setAntiAlias(true);\n\n\t\t/* Set type face for paint, now it support .ttf file. */\n\t\tif (fontName.endsWith(\".ttf\")) {\n\t\t\ttry {\n\t\t\t\tfinal Typeface typeFace = Cocos2dxTypefaces.get(\n\t\t\t\t\t\tCocos2dxBitmap._context, fontName);\n\t\t\t\tpaint.setTypeface(typeFace);\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.e(\"Cocos2dxBitmap\", \"error to create ttf type face: \"\n\t\t\t\t\t\t+ fontName);\n\n\t\t\t\t/* The file may not find, use system font. */\n\t\t\t\tpaint.setTypeface(Typeface.create(fontName, Typeface.NORMAL));\n\t\t\t}\n\t\t} else {\n\t\t\tpaint.setTypeface(Typeface.create(fontName, Typeface.NORMAL));\n\t\t}\n\n\t\tswitch (horizontalAlignment) {\n\t\tcase HORIZONTALALIGN_CENTER:\n\t\t\tpaint.setTextAlign(Align.CENTER);\n\t\t\tbreak;\n\t\tcase HORIZONTALALIGN_RIGHT:\n\t\t\tpaint.setTextAlign(Align.RIGHT);\n\t\t\tbreak;\n\t\tcase HORIZONTALALIGN_LEFT:\n\t\tdefault:\n\t\t\tpaint.setTextAlign(Align.LEFT);\n\t\t\tbreak;\n\t\t}\n\n\t\treturn paint;\n\t}\n\t\n\tprivate static TextProperty computeTextProperty(final String string,\n\t\t\tfinal int width, final int height, final Paint paint) {\n\t\tfinal FontMetricsInt fm = paint.getFontMetricsInt();\n\t\tfinal int h = (int) Math.ceil(fm.bottom - fm.top);\n\t\tint maxContentWidth = 0;\n\n\t\tfinal String[] lines = Cocos2dxBitmap.splitString(string, width,\n\t\t\t\theight, paint);\n\n\t\tif (width != 0) {\n\t\t\tmaxContentWidth = width;\n\t\t} else {\n\t\t\t/* Compute the max width. */\n\t\t\tint temp = 0;\n\t\t\tfor (final String line : lines) {\n\t\t\t\ttemp = (int) FloatMath.ceil(paint.measureText(line, 0,\n\t\t\t\t\t\tline.length()));\n\t\t\t\tif (temp > maxContentWidth) {\n\t\t\t\t\tmaxContentWidth = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn new TextProperty(maxContentWidth, h, lines);\n\t}\n\n\tprivate static int computeX(final String text, final int maxWidth,\n\t\t\tfinal int horizontalAlignment) {\n\t\tint ret = 0;\n\n\t\tswitch (horizontalAlignment) {\n\t\tcase HORIZONTALALIGN_CENTER:\n\t\t\tret = maxWidth / 2;\n\t\t\tbreak;\n\t\tcase HORIZONTALALIGN_RIGHT:\n\t\t\tret = maxWidth;\n\t\t\tbreak;\n\t\tcase HORIZONTALALIGN_LEFT:\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tprivate static int computeY(final FontMetricsInt fontMetricsInt,\n\t\t\tfinal int constrainHeight, final int totalHeight,\n\t\t\tfinal int verticalAlignment) {\n\t\tint y = -fontMetricsInt.top;\n\n\t\tif (constrainHeight > totalHeight) {\n\t\t\tswitch (verticalAlignment) {\n\t\t\tcase VERTICALALIGN_TOP:\n\t\t\t\ty = -fontMetricsInt.top;\n\t\t\t\tbreak;\n\t\t\tcase VERTICALALIGN_CENTER:\n\t\t\t\ty = -fontMetricsInt.top + (constrainHeight - totalHeight)\n\t\t\t\t\t\t/ 2;\n\t\t\t\tbreak;\n\t\t\tcase VERTICALALIGN_BOTTOM:\n\t\t\t\ty = -fontMetricsInt.top + (constrainHeight - totalHeight);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn y;\n\t}\n\n\t/*\n\t * If maxWidth or maxHeight is not 0, split the string to fix the maxWidth\n\t * and maxHeight.\n\t */\n\tprivate static String[] splitString(final String string,\n\t\t\tfinal int maxWidth, final int maxHeight, final Paint paint) {\n\t\tfinal String[] lines = string.split(\"\\\\n\");\n\t\tString[] ret = null;\n\t\tfinal FontMetricsInt fm = paint.getFontMetricsInt();\n\t\tfinal int heightPerLine = (int) Math.ceil(fm.bottom - fm.top);\n\t\tfinal int maxLines = maxHeight / heightPerLine;\n\n\t\tif (maxWidth != 0) {\n\t\t\tfinal LinkedList<String> strList = new LinkedList<String>();\n\t\t\tfor (final String line : lines) {\n\t\t\t\t/*\n\t\t\t\t * The width of line is exceed maxWidth, should divide it into\n\t\t\t\t * two or more lines.\n\t\t\t\t */\n\t\t\t\tfinal int lineWidth = (int) FloatMath.ceil(paint\n\t\t\t\t\t\t.measureText(line));\n\t\t\t\tif (lineWidth > maxWidth) {\n\t\t\t\t\tstrList.addAll(Cocos2dxBitmap.divideStringWithMaxWidth(\n\t\t\t\t\t\t\tline, maxWidth, paint));\n\t\t\t\t} else {\n\t\t\t\t\tstrList.add(line);\n\t\t\t\t}\n\n\t\t\t\t/* Should not exceed the max height. */\n\t\t\t\tif (maxLines > 0 && strList.size() >= maxLines) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Remove exceeding lines. */\n\t\t\tif (maxLines > 0 && strList.size() > maxLines) {\n\t\t\t\twhile (strList.size() > maxLines) {\n\t\t\t\t\tstrList.removeLast();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tret = new String[strList.size()];\n\t\t\tstrList.toArray(ret);\n\t\t} else if (maxHeight != 0 && lines.length > maxLines) {\n\t\t\t/* Remove exceeding lines. */\n\t\t\tfinal LinkedList<String> strList = new LinkedList<String>();\n\t\t\tfor (int i = 0; i < maxLines; i++) {\n\t\t\t\tstrList.add(lines[i]);\n\t\t\t}\n\t\t\tret = new String[strList.size()];\n\t\t\tstrList.toArray(ret);\n\t\t} else {\n\t\t\tret = lines;\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tprivate static LinkedList<String> divideStringWithMaxWidth(\n\t\t\tfinal String string, final int maxWidth, final Paint paint) {\n\t\tfinal int charLength = string.length();\n\t\tint start = 0;\n\t\tint tempWidth = 0;\n\t\tfinal LinkedList<String> strList = new LinkedList<String>();\n\n\t\t/* Break a String into String[] by the width & should wrap the word. */\n\t\tfor (int i = 1; i <= charLength; ++i) {\n\t\t\ttempWidth = (int) FloatMath.ceil(paint.measureText(string, start,\n\t\t\t\t\ti));\n\t\t\tif (tempWidth >= maxWidth) {\n\t\t\t\tfinal int lastIndexOfSpace = string.substring(0, i)\n\t\t\t\t\t\t.lastIndexOf(\" \");\n\n\t\t\t\tif (lastIndexOfSpace != -1 && lastIndexOfSpace > start) {\n\t\t\t\t\t/* Should wrap the word. */\n\t\t\t\t\tstrList.add(string.substring(start, lastIndexOfSpace));\n\t\t\t\t\ti = lastIndexOfSpace + 1; // skip space\n\t\t\t\t} else {\n\t\t\t\t\t/* Should not exceed the width. */\n\t\t\t\t\tif (tempWidth > maxWidth) {\n\t\t\t\t\t\tstrList.add(string.substring(start, i - 1));\n\t\t\t\t\t\t/* Compute from previous char. */\n\t\t\t\t\t\t--i;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrList.add(string.substring(start, i));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Remove spaces at the beginning of a new line. */\n\t\t\t\twhile (i < charLength && string.charAt(i) == ' ') {\n\t\t\t\t\t++i;\n\t\t\t\t}\n\n\t\t\t\tstart = i;\n\t\t\t}\n\t\t}\n\n\t\t/* Add the last chars. */\n\t\tif (start < charLength) {\n\t\t\tstrList.add(string.substring(start));\n\t\t}\n\n\t\treturn strList;\n\t}\n\n\tprivate static String refactorString(final String string) {\n\t\t/* Avoid error when content is \"\". */\n\t\tif (string.compareTo(\"\") == 0) {\n\t\t\treturn \" \";\n\t\t}\n\n\t\t/*\n\t\t * If the font of \"\\n\" is \"\" or \"\\n\", insert \" \" in front of it. For\n\t\t * example: \"\\nabc\" -> \" \\nabc\" \"\\nabc\\n\\n\" -> \" \\nabc\\n \\n\".\n\t\t */\n\t\tfinal StringBuilder strBuilder = new StringBuilder(string);\n\t\tint start = 0;\n\t\tint index = strBuilder.indexOf(\"\\n\");\n\t\twhile (index != -1) {\n\t\t\tif (index == 0 || strBuilder.charAt(index - 1) == '\\n') {\n\t\t\t\tstrBuilder.insert(start, \" \");\n\t\t\t\tstart = index + 2;\n\t\t\t} else {\n\t\t\t\tstart = index + 1;\n\t\t\t}\n\n\t\t\tif (start > strBuilder.length() || index == strBuilder.length()) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex = strBuilder.indexOf(\"\\n\", start);\n\t\t}\n\n\t\treturn strBuilder.toString();\n\t}\n\n\tprivate static void initNativeObject(final Bitmap bitmap) {\n\t\tfinal byte[] pixels = Cocos2dxBitmap.getPixels(bitmap);\n\t\tif (pixels == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tCocos2dxBitmap.nativeInitBitmapDC(bitmap.getWidth(),\n\t\t\t\tbitmap.getHeight(), pixels);\n\t}\n\n\tprivate static byte[] getPixels(final Bitmap bitmap) {\n\t\tif (bitmap != null) {\n\t\t\tfinal byte[] pixels = new byte[bitmap.getWidth()\n\t\t\t\t\t* bitmap.getHeight() * 4];\n\t\t\tfinal ByteBuffer buf = ByteBuffer.wrap(pixels);\n\t\t\tbuf.order(ByteOrder.nativeOrder());\n\t\t\tbitmap.copyPixelsToBuffer(buf);\n\t\t\treturn pixels;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate static int getFontSizeAccordingHeight(int height) {\n\t\tPaint paint = new Paint();\n\t\tRect bounds = new Rect();\n\n\t\tpaint.setTypeface(Typeface.DEFAULT);\n\t\tint incr_text_size = 1;\n\t\tboolean found_desired_size = false;\n\n\t\twhile (!found_desired_size) {\n\n\t\t\tpaint.setTextSize(incr_text_size);\n\t\t\tString text = \"SghMNy\";\n\t\t\tpaint.getTextBounds(text, 0, text.length(), bounds);\n\n\t\t\tincr_text_size++;\n\n\t\t\tif (height - bounds.height() <= 2) {\n\t\t\t\tfound_desired_size = true;\n\t\t\t}\n\t\t\tLog.d(\"font size\", \"incr size:\" + incr_text_size);\n\t\t}\n\t\treturn incr_text_size;\n\t}\n\n\tprivate static String getStringWithEllipsis(String string, float width,\n\t\t\tfloat fontSize) {\n\t\tif (TextUtils.isEmpty(string)) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tTextPaint paint = new TextPaint();\n\t\tpaint.setTypeface(Typeface.DEFAULT);\n\t\tpaint.setTextSize(fontSize);\n\n\t\treturn TextUtils.ellipsize(string, paint, width,\n\t\t\t\tTextUtils.TruncateAt.END).toString();\n\t}\n\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n\n\tprivate static class TextProperty {\n\t\t/** The max width of lines. */\n\t\tprivate final int mMaxWidth;\n\t\t/** The height of all lines. */\n\t\tprivate final int mTotalHeight;\n\t\tprivate final int mHeightPerLine;\n\t\tprivate final String[] mLines;\n\n\t\tTextProperty(final int maxWidth, final int heightPerLine,\n\t\t\t\tfinal String[] lines) {\n\t\t\tthis.mMaxWidth = maxWidth;\n\t\t\tthis.mHeightPerLine = heightPerLine;\n\t\t\tthis.mTotalHeight = heightPerLine * lines.length;\n\t\t\tthis.mLines = lines;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n ****************************************************************************/\n\npackage org.cocos2dx.lib;\n\nimport android.app.Dialog;\nimport android.content.Context;\nimport android.graphics.drawable.ColorDrawable;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.text.InputFilter;\nimport android.text.InputType;\nimport android.util.TypedValue;\nimport android.view.KeyEvent;\nimport android.view.ViewGroup;\nimport android.view.WindowManager;\nimport android.view.inputmethod.EditorInfo;\nimport android.view.inputmethod.InputMethodManager;\nimport android.widget.EditText;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\nimport android.widget.TextView.OnEditorActionListener;\n\npublic class Cocos2dxEditBoxDialog extends Dialog {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\t/**\n\t * The user is allowed to enter any text, including line breaks.\n\t */\n\tprivate final int kEditBoxInputModeAny = 0;\n\n\t/**\n\t * The user is allowed to enter an e-mail address.\n\t */\n\tprivate final int kEditBoxInputModeEmailAddr = 1;\n\n\t/**\n\t * The user is allowed to enter an integer value.\n\t */\n\tprivate final int kEditBoxInputModeNumeric = 2;\n\n\t/**\n\t * The user is allowed to enter a phone number.\n\t */\n\tprivate final int kEditBoxInputModePhoneNumber = 3;\n\n\t/**\n\t * The user is allowed to enter a URL.\n\t */\n\tprivate final int kEditBoxInputModeUrl = 4;\n\n\t/**\n\t * The user is allowed to enter a real number value. This extends kEditBoxInputModeNumeric by allowing a decimal point.\n\t */\n\tprivate final int kEditBoxInputModeDecimal = 5;\n\n\t/**\n\t * The user is allowed to enter any text, except for line breaks.\n\t */\n\tprivate final int kEditBoxInputModeSingleLine = 6;\n\n\t/**\n\t * Indicates that the text entered is confidential data that should be obscured whenever possible. This implies EDIT_BOX_INPUT_FLAG_SENSITIVE.\n\t */\n\tprivate final int kEditBoxInputFlagPassword = 0;\n\n\t/**\n\t * Indicates that the text entered is sensitive data that the implementation must never store into a dictionary or table for use in predictive, auto-completing, or other accelerated input schemes. A credit card number is an example of sensitive data.\n\t */\n\tprivate final int kEditBoxInputFlagSensitive = 1;\n\n\t/**\n\t * This flag is a hint to the implementation that during text editing, the initial letter of each word should be capitalized.\n\t */\n\tprivate final int kEditBoxInputFlagInitialCapsWord = 2;\n\n\t/**\n\t * This flag is a hint to the implementation that during text editing, the initial letter of each sentence should be capitalized.\n\t */\n\tprivate final int kEditBoxInputFlagInitialCapsSentence = 3;\n\n\t/**\n\t * Capitalize all characters automatically.\n\t */\n\tprivate final int kEditBoxInputFlagInitialCapsAllCharacters = 4;\n\n\tprivate final int kKeyboardReturnTypeDefault = 0;\n\tprivate final int kKeyboardReturnTypeDone = 1;\n\tprivate final int kKeyboardReturnTypeSend = 2;\n\tprivate final int kKeyboardReturnTypeSearch = 3;\n\tprivate final int kKeyboardReturnTypeGo = 4;\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\n\tprivate EditText mInputEditText;\n\tprivate TextView mTextViewTitle;\n\n\tprivate final String mTitle;\n\tprivate final String mMessage;\n\tprivate final int mInputMode;\n\tprivate final int mInputFlag;\n\tprivate final int mReturnType;\n\tprivate final int mMaxLength;\n\n\tprivate int mInputFlagConstraints;\n\tprivate int mInputModeContraints;\n\tprivate boolean mIsMultiline;\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\tpublic Cocos2dxEditBoxDialog(final Context pContext, final String pTitle, final String pMessage, final int pInputMode, final int pInputFlag, final int pReturnType, final int pMaxLength) {\n\t\tsuper(pContext, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);\n//\t\tsuper(context, R.style.Theme_Translucent);\n\n\t\tthis.mTitle = pTitle;\n\t\tthis.mMessage = pMessage;\n\t\tthis.mInputMode = pInputMode;\n\t\tthis.mInputFlag = pInputFlag;\n\t\tthis.mReturnType = pReturnType;\n\t\tthis.mMaxLength = pMaxLength;\n\t}\n\n\t@Override\n\tprotected void onCreate(final Bundle pSavedInstanceState) {\n\t\tsuper.onCreate(pSavedInstanceState);\n\n\t\tthis.getWindow().setBackgroundDrawable(new ColorDrawable(0x80000000));\n\n\t\tfinal LinearLayout layout = new LinearLayout(this.getContext());\n\t\tlayout.setOrientation(LinearLayout.VERTICAL);\n\n\t\tfinal LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);\n\n\t\tthis.mTextViewTitle = new TextView(this.getContext());\n\t\tfinal LinearLayout.LayoutParams textviewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n\t\ttextviewParams.leftMargin = textviewParams.rightMargin = this.convertDipsToPixels(10);\n\t\tthis.mTextViewTitle.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);\n\t\tlayout.addView(this.mTextViewTitle, textviewParams);\n\n\t\tthis.mInputEditText = new EditText(this.getContext());\n\t\tfinal LinearLayout.LayoutParams editTextParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n\t\teditTextParams.leftMargin = editTextParams.rightMargin = this.convertDipsToPixels(10);\n\n\t\tlayout.addView(this.mInputEditText, editTextParams);\n\n\t\tthis.setContentView(layout, layoutParams);\n\n\t\tthis.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);\n\n\t\tthis.mTextViewTitle.setText(this.mTitle);\n\t\tthis.mInputEditText.setText(this.mMessage);\n\n\t\tint oldImeOptions = this.mInputEditText.getImeOptions();\n\t\tthis.mInputEditText.setImeOptions(oldImeOptions | EditorInfo.IME_FLAG_NO_EXTRACT_UI);\n\t\toldImeOptions = this.mInputEditText.getImeOptions();\n\n\t\tswitch (this.mInputMode) {\n\t\t\tcase kEditBoxInputModeAny:\n\t\t\t\tthis.mInputModeContraints = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputModeEmailAddr:\n\t\t\t\tthis.mInputModeContraints = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputModeNumeric:\n\t\t\t\tthis.mInputModeContraints = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputModePhoneNumber:\n\t\t\t\tthis.mInputModeContraints = InputType.TYPE_CLASS_PHONE;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputModeUrl:\n\t\t\t\tthis.mInputModeContraints = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputModeDecimal:\n\t\t\t\tthis.mInputModeContraints = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_NUMBER_FLAG_SIGNED;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputModeSingleLine:\n\t\t\t\tthis.mInputModeContraints = InputType.TYPE_CLASS_TEXT;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (this.mIsMultiline) {\n\t\t\tthis.mInputModeContraints |= InputType.TYPE_TEXT_FLAG_MULTI_LINE;\n\t\t}\n\n\t\tthis.mInputEditText.setInputType(this.mInputModeContraints | this.mInputFlagConstraints);\n\n\t\tswitch (this.mInputFlag) {\n\t\t\tcase kEditBoxInputFlagPassword:\n\t\t\t\tthis.mInputFlagConstraints = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputFlagSensitive:\n\t\t\t\tthis.mInputFlagConstraints = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputFlagInitialCapsWord:\n\t\t\t\tthis.mInputFlagConstraints = InputType.TYPE_TEXT_FLAG_CAP_WORDS;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputFlagInitialCapsSentence:\n\t\t\t\tthis.mInputFlagConstraints = InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;\n\t\t\t\tbreak;\n\t\t\tcase kEditBoxInputFlagInitialCapsAllCharacters:\n\t\t\t\tthis.mInputFlagConstraints = InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.mInputEditText.setInputType(this.mInputFlagConstraints | this.mInputModeContraints);\n\n\t\tswitch (this.mReturnType) {\n\t\t\tcase kKeyboardReturnTypeDefault:\n\t\t\t\tthis.mInputEditText.setImeOptions(oldImeOptions | EditorInfo.IME_ACTION_NONE);\n\t\t\t\tbreak;\n\t\t\tcase kKeyboardReturnTypeDone:\n\t\t\t\tthis.mInputEditText.setImeOptions(oldImeOptions | EditorInfo.IME_ACTION_DONE);\n\t\t\t\tbreak;\n\t\t\tcase kKeyboardReturnTypeSend:\n\t\t\t\tthis.mInputEditText.setImeOptions(oldImeOptions | EditorInfo.IME_ACTION_SEND);\n\t\t\t\tbreak;\n\t\t\tcase kKeyboardReturnTypeSearch:\n\t\t\t\tthis.mInputEditText.setImeOptions(oldImeOptions | EditorInfo.IME_ACTION_SEARCH);\n\t\t\t\tbreak;\n\t\t\tcase kKeyboardReturnTypeGo:\n\t\t\t\tthis.mInputEditText.setImeOptions(oldImeOptions | EditorInfo.IME_ACTION_GO);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.mInputEditText.setImeOptions(oldImeOptions | EditorInfo.IME_ACTION_NONE);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (this.mMaxLength > 0) {\n\t\t\tthis.mInputEditText.setFilters(new InputFilter[] { new InputFilter.LengthFilter(this.mMaxLength) });\n\t\t}\n\n\t\tfinal Handler initHandler = new Handler();\n\t\tinitHandler.postDelayed(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tCocos2dxEditBoxDialog.this.mInputEditText.requestFocus();\n\t\t\t\tCocos2dxEditBoxDialog.this.mInputEditText.setSelection(Cocos2dxEditBoxDialog.this.mInputEditText.length());\n\t\t\t\tCocos2dxEditBoxDialog.this.openKeyboard();\n\t\t\t}\n\t\t}, 200);\n\n\t\tthis.mInputEditText.setOnEditorActionListener(new OnEditorActionListener() {\n\t\t\t@Override\n\t\t\tpublic boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {\n\t\t\t\t/* If user didn't set keyboard type, this callback will be invoked twice with 'KeyEvent.ACTION_DOWN' and 'KeyEvent.ACTION_UP'. */\n\t\t\t\tif (actionId != EditorInfo.IME_NULL || (actionId == EditorInfo.IME_NULL && event != null && event.getAction() == KeyEvent.ACTION_DOWN)) {\n\t\t\t\t\tCocos2dxHelper.setEditTextDialogResult(Cocos2dxEditBoxDialog.this.mInputEditText.getText().toString());\n\t\t\t\t\tCocos2dxEditBoxDialog.this.closeKeyboard();\n\t\t\t\t\tCocos2dxEditBoxDialog.this.dismiss();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t}\n\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\n\tprivate int convertDipsToPixels(final float pDIPs) {\n\t\tfinal float scale = this.getContext().getResources().getDisplayMetrics().density;\n\t\treturn Math.round(pDIPs * scale);\n\t}\n\n\tprivate void openKeyboard() {\n\t\tfinal InputMethodManager imm = (InputMethodManager) this.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\timm.showSoftInput(this.mInputEditText, 0);\n\t}\n\n\tprivate void closeKeyboard() {\n\t\tfinal InputMethodManager imm = (InputMethodManager) this.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\timm.hideSoftInputFromWindow(this.mInputEditText.getWindowToken(), 0);\n\t}\n\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n ****************************************************************************/\npackage org.cocos2dx.lib;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.text.Editable;\nimport android.text.TextWatcher;\nimport android.view.KeyEvent;\nimport android.view.ViewGroup;\nimport android.view.inputmethod.EditorInfo;\nimport android.view.inputmethod.InputMethodManager;\nimport android.widget.EditText;\nimport android.widget.TextView;\nimport android.widget.TextView.OnEditorActionListener;\n\npublic class Cocos2dxEditText extends EditText {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\t\n\tprivate Cocos2dxTextInputWraper mTextWatcher = null;\n\tprivate Context mContext = null;\n\tprivate static Cocos2dxEditText instance = null;\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\tpublic Cocos2dxEditText(final Context context) {\n\t\tsuper(context);\n\t\t\n\t\tthis.mContext = context;\n\t\tthis.mTextWatcher = new Cocos2dxTextInputWraper(context, this);\n\t\tthis.setOnEditorActionListener(this.mTextWatcher);\n\t\t\n\t\tViewGroup.LayoutParams layout =\n\t            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,\n\t                                       ViewGroup.LayoutParams.WRAP_CONTENT);\n\t\t\n\t\tActivity activity = (Activity)context;\n\t\tactivity.addContentView(this, layout);\n\t}\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\t\n\tpublic static Cocos2dxEditText getInstance(final Context context) {\n\t\tif (instance == null) {\n\t\t\tinstance = new Cocos2dxEditText(context);\n\t\t}\n\t\treturn instance;\n\t}\n\t\n\tpublic void closeIMEKeyboard() {\n\t\tthis.removeTextChangedListener(mTextWatcher);\n\t\tfinal InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\timm.hideSoftInputFromWindow(this.getWindowToken(), 0);\n\t\t//Cocos2dxHelper.nativeRequestFocus();\n\t}\n\t\n\tpublic void openIMEKeyboard() {\n\t\tthis.requestFocus();\n\t\tfinal String content = nativeGetContent();\n\t\tthis.setText(content);\n\t\t\t\n\t\tmTextWatcher.setOriginText(content);\n\t\tthis.addTextChangedListener(mTextWatcher);\n\t\t\n\t\tfinal InputMethodManager imm = (InputMethodManager)mContext.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\timm.showSoftInput(this, InputMethodManager.SHOW_FORCED);\n\t}\n\n\t@Override\n\tpublic boolean onKeyDown(final int keyCode, final KeyEvent keyEvent) {\n\t\tsuper.onKeyDown(keyCode, keyEvent);\n\n\t\t/* Let GlSurfaceView get focus if back key is input. */\n\t\tif (keyCode == KeyEvent.KEYCODE_BACK) {\n\t\t\t//Cocos2dxHelper.nativeRequestFocus();\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\t\n\tprivate native static String nativeGetContent();\n\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n}\n\nclass Cocos2dxTextInputWraper implements TextWatcher, OnEditorActionListener {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\tprivate static final String TAG = Cocos2dxTextInputWraper.class.getSimpleName();\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\n\tprivate String mText;\n\tprivate String mOriginText;\n\tprivate Context mContext;\n\tprivate TextView mTextView;\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\tpublic Cocos2dxTextInputWraper(Context context, TextView textView) {\n\t\tthis.mContext = context;\n\t\tthis.mTextView = textView;\n\t}\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\tprivate boolean isFullScreenEdit() {\n\t\tfinal InputMethodManager imm = (InputMethodManager) this.mContext.getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\treturn imm.isFullscreenMode();\n\t}\n\n\tpublic void setOriginText(final String originText) {\n\t\tthis.mOriginText = originText;\n\t}\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\n\t@Override\n\tpublic void afterTextChanged(final Editable s) {\n\t\tif (this.isFullScreenEdit()) {\n\t\t\treturn;\n\t\t}\n\n\t\tint nModified = s.length() - this.mText.length();\n\t\tif (nModified > 0) {\n\t\t\tfinal String insertText = s.subSequence(this.mText.length(), s.length()).toString();\n\t\t\tnativeInsertText(insertText);\n\t\t} else {\n\t\t\tfor (; nModified < 0; ++nModified) {\n\t\t\t\tnativeDeleteBackward();\n\t\t\t}\n\t\t}\n\t\tthis.mText = s.toString();\n\t}\n\n\t@Override\n\tpublic void beforeTextChanged(final CharSequence pCharSequence, final int start, final int count, final int after) {\n\t\tthis.mText = pCharSequence.toString();\n\t}\n\n\t@Override\n\tpublic void onTextChanged(final CharSequence pCharSequence, final int start, final int before, final int count) {\n\t}\n\n\t@Override\n\tpublic boolean onEditorAction(final TextView pTextView, final int pActionID, final KeyEvent pKeyEvent) {\n\t\tif (this.mTextView  == pTextView && this.isFullScreenEdit()) {\n\t\t\t// user press the action button, delete all old text and insert new text\n\t\t\tfor (int i = this.mOriginText.length(); i > 0; i--) {\n\t\t\t\tCocos2dxHelper.runOnGLThread(new Runnable() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tnativeDeleteBackward();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t\tString text = pTextView.getText().toString();\n\n\t\t\t/* If user input nothing, translate \"\\n\" to engine. */\n\t\t\tif (text.compareTo(\"\") == 0) {\n\t\t\t\ttext = \"\\n\";\n\t\t\t}\n\n\t\t\tif ('\\n' != text.charAt(text.length() - 1)) {\n\t\t\t\ttext += '\\n';\n\t\t\t}\n\n\t\t\tfinal String insertText = text;\n\t\t\tCocos2dxHelper.runOnGLThread(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tnativeInsertText(insertText);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\tif (pActionID == EditorInfo.IME_ACTION_DONE) {\n\t\t\t//Cocos2dxHelper.nativeRequestFocus();\n\t\t}\n\t\treturn false;\n\t}\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\t\n\tprivate native static void nativeInsertText(String text);\n\tprivate native static void nativeDeleteBackward();\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n ****************************************************************************/\npackage org.cocos2dx.lib;\n\nimport java.util.concurrent.ConcurrentLinkedQueue;\nimport java.io.UnsupportedEncodingException;\nimport java.util.Locale;\nimport java.lang.Runnable;\n\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.content.DialogInterface;\nimport android.content.SharedPreferences;\nimport android.content.pm.ActivityInfo;\nimport android.content.pm.ApplicationInfo;\nimport android.content.pm.PackageManager;\nimport android.content.res.AssetManager;\nimport android.os.Build;\nimport android.util.DisplayMetrics;\nimport android.view.Display;\nimport android.view.WindowManager;\n\npublic class Cocos2dxHelper {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\tprivate static final String PREFS_NAME = \"Cocos2dxPrefsFile\";\n\tprivate static final int RUNNABLES_PER_FRAME = 5;\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\n\tprivate static Cocos2dxMusic sCocos2dMusic;\n\tprivate static Cocos2dxSound sCocos2dSound;\n\tprivate static AssetManager sAssetManager;\n\tprivate static boolean sAccelerometerEnabled;\n\tprivate static String sPackageName;\n\tprivate static String sFileDirectory;\n\tprivate static Activity sActivity = null;\n\tprivate static Cocos2dxHelperListener sCocos2dxHelperListener;\n\tprivate static ConcurrentLinkedQueue<Runnable> jobs = new ConcurrentLinkedQueue<Runnable>();\n\n    /**\n     * Optional meta-that can be in the manifest for this component, specifying\n     * the name of the native shared library to load.  If not specified,\n     * \"main\" is used.\n     */\n    private static final String META_DATA_LIB_NAME = \"android.app.lib_name\";\n    private static final String DEFAULT_LIB_NAME = \"main\";\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\tpublic static void dispatchPendingRunnables() {\n\t\tfor (int i = RUNNABLES_PER_FRAME; i > 0; i--) {\n\t\t\tRunnable job = jobs.poll();\n\t\t\tif (job == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tjob.run();\n\t\t}\n\t}\n\n\tpublic static void runOnGLThread(final Runnable r) {\n\t\tjobs.add(r);\n\t}\n\n\tprivate static boolean sInited = false;\n\tpublic static void init(final Activity activity) {\n\t    if (!sInited) {\n    \t\tfinal ApplicationInfo applicationInfo = activity.getApplicationInfo();\n    \t\t\n            initListener();\n                \n            try {\n            // Get the lib_name from AndroidManifest.xml metadata\n                ActivityInfo ai =\n                    activity.getPackageManager().getActivityInfo(activity.getIntent().getComponent(), PackageManager.GET_META_DATA);\n                if (null != ai.metaData) {\n                    String lib_name = ai.metaData.getString(META_DATA_LIB_NAME);\n                    if (null != lib_name) {\n                        System.loadLibrary(lib_name);\n                    } else {\n                        System.loadLibrary(DEFAULT_LIB_NAME);\n                    }\n                }\n            } catch (PackageManager.NameNotFoundException e) {\n                throw new RuntimeException(\"Error getting activity info\", e);\n            }\n    \n    \t\tCocos2dxHelper.sPackageName = applicationInfo.packageName;\n    \t\tCocos2dxHelper.sFileDirectory = activity.getFilesDir().getAbsolutePath();\n    \t\t//Cocos2dxHelper.nativeSetApkPath(applicationInfo.sourceDir);\n    \n    \t\tCocos2dxHelper.sCocos2dMusic = new Cocos2dxMusic(activity);\n    \t\tCocos2dxHelper.sCocos2dSound = new Cocos2dxSound(activity);\n    \t\tCocos2dxHelper.sAssetManager = activity.getAssets();\n    \n    \t\t//Cocos2dxHelper.nativeSetAssetManager(sAssetManager);\n            Cocos2dxBitmap.setContext(activity);\n            sActivity = activity;\n\n            sInited = true;\n\t    }\n\t}\n\t\n\tpublic static void initListener() {\n        Cocos2dxHelper.sCocos2dxHelperListener = new Cocos2dxHelperListener() {\n            \n            @Override\n            public void showEditTextDialog(final String title, final String message,\n                    final int inputMode, final int inputFlag, final int returnType, final int maxLength) {           \t\n            \tsActivity.runOnUiThread(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tnew Cocos2dxEditBoxDialog(sActivity,\n\t                            title,\n\t            \t\t\t\tmessage,\n\t            \t\t\t\tinputMode,\n\t            \t\t\t\tinputFlag,\n\t            \t\t\t\treturnType,\n\t            \t\t\t\tmaxLength).show();\n\t\t\t\t\t}\n\t\t\t\t});\t\n            }\n            \t\n            @Override\n            public void openIMEKeyboard() {\n            \tsActivity.runOnUiThread(new Runnable() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tCocos2dxEditText.getInstance(sActivity).openIMEKeyboard();\n\t\t\t\t\t}\n            \t\t\n            \t});\n            }\n            \n            @Override\n            public void closeIMEKeyboard() {\n            \tsActivity.runOnUiThread(new Runnable() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tCocos2dxEditText.getInstance(sActivity).closeIMEKeyboard();\n\t\t\t\t\t}\n            \t\t\n            \t});\n            }\n            \n            @Override\n            public void showDialog(final String title, final String message) {\n\n                sActivity.runOnUiThread(new Runnable() {\n\n                    @Override\n                    public void run() {\n                        new AlertDialog.Builder(sActivity)\n                        .setTitle(title)\n                        .setMessage(message)\n                        .setPositiveButton(\"Ok\", \n                                new DialogInterface.OnClickListener() {\n                                    @Override\n                                    public void onClick(DialogInterface dialog, int which) {\n                                        // TODO Auto-generated method stub\n                                    }\n                                }).create().show();\n                    }\n                });\n            }\n        };\n\t}\n\n    public static Activity getActivity() {\n        return sActivity;\n    }\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\n\tprivate static native void nativeSetEditTextDialogResult(final byte[] pBytes);\n\n\tpublic static String getCocos2dxPackageName() {\n\t\treturn Cocos2dxHelper.sPackageName;\n\t}\n\n\tpublic static String getCocos2dxWritablePath() {\n\t\treturn Cocos2dxHelper.sFileDirectory;\n\t}\n\n\tpublic static String getCurrentLanguage() {\n\t\treturn Locale.getDefault().getLanguage();\n\t}\n\t\n\tpublic static String getDeviceModel(){\n\t\treturn Build.MODEL;\n    }\n\n\tpublic static AssetManager getAssetManager() {\n\t\treturn Cocos2dxHelper.sAssetManager;\n\t}\n\n\tpublic static void preloadBackgroundMusic(final String pPath) {\n\t\tCocos2dxHelper.sCocos2dMusic.preloadBackgroundMusic(pPath);\n\t}\n\n\tpublic static void playBackgroundMusic(final String pPath, final boolean isLoop) {\n\t\tCocos2dxHelper.sCocos2dMusic.playBackgroundMusic(pPath, isLoop);\n\t}\n\n\tpublic static void resumeBackgroundMusic() {\n\t\tCocos2dxHelper.sCocos2dMusic.resumeBackgroundMusic();\n\t}\n\n\tpublic static void pauseBackgroundMusic() {\n\t\tCocos2dxHelper.sCocos2dMusic.pauseBackgroundMusic();\n\t}\n\n\tpublic static void stopBackgroundMusic() {\n\t\tCocos2dxHelper.sCocos2dMusic.stopBackgroundMusic();\n\t}\n\n\tpublic static void rewindBackgroundMusic() {\n\t\tCocos2dxHelper.sCocos2dMusic.rewindBackgroundMusic();\n\t}\n\n\tpublic static boolean isBackgroundMusicPlaying() {\n\t\treturn Cocos2dxHelper.sCocos2dMusic.isBackgroundMusicPlaying();\n\t}\n\n\tpublic static float getBackgroundMusicVolume() {\n\t\treturn Cocos2dxHelper.sCocos2dMusic.getBackgroundVolume();\n\t}\n\n\tpublic static void setBackgroundMusicVolume(final float volume) {\n\t\tCocos2dxHelper.sCocos2dMusic.setBackgroundVolume(volume);\n\t}\n\n\tpublic static void preloadEffect(final String path) {\n\t\tCocos2dxHelper.sCocos2dSound.preloadEffect(path);\n\t}\n\n\tpublic static int playEffect(final String path, final boolean isLoop, final float pitch, final float pan, final float gain) {\n\t\treturn Cocos2dxHelper.sCocos2dSound.playEffect(path, isLoop, pitch, pan, gain);\n\t}\n\n\tpublic static void resumeEffect(final int soundId) {\n\t\tCocos2dxHelper.sCocos2dSound.resumeEffect(soundId);\n\t}\n\n\tpublic static void pauseEffect(final int soundId) {\n\t\tCocos2dxHelper.sCocos2dSound.pauseEffect(soundId);\n\t}\n\n\tpublic static void stopEffect(final int soundId) {\n\t\tCocos2dxHelper.sCocos2dSound.stopEffect(soundId);\n\t}\n\n\tpublic static float getEffectsVolume() {\n\t\treturn Cocos2dxHelper.sCocos2dSound.getEffectsVolume();\n\t}\n\n\tpublic static void setEffectsVolume(final float volume) {\n\t\tCocos2dxHelper.sCocos2dSound.setEffectsVolume(volume);\n\t}\n\n\tpublic static void unloadEffect(final String path) {\n\t\tCocos2dxHelper.sCocos2dSound.unloadEffect(path);\n\t}\n\n\tpublic static void pauseAllEffects() {\n\t\tCocos2dxHelper.sCocos2dSound.pauseAllEffects();\n\t}\n\n\tpublic static void resumeAllEffects() {\n\t\tCocos2dxHelper.sCocos2dSound.resumeAllEffects();\n\t}\n\n\tpublic static void stopAllEffects() {\n\t\tCocos2dxHelper.sCocos2dSound.stopAllEffects();\n\t}\n\n\tpublic static void end() {\n\t\tCocos2dxHelper.sCocos2dMusic.end();\n\t\tCocos2dxHelper.sCocos2dSound.end();\n\t}\n\n\tpublic static void terminateProcess() {\n\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\t}\n\n\tprivate static void showDialog(final String pTitle, final String pMessage) {\n\t\tCocos2dxHelper.sCocos2dxHelperListener.showDialog(pTitle, pMessage);\n\t}\n\n\tprivate static void showEditTextDialog(final String pTitle, final String pMessage, final int pInputMode, final int pInputFlag, final int pReturnType, final int pMaxLength) {\n\t\tCocos2dxHelper.sCocos2dxHelperListener.showEditTextDialog(pTitle, pMessage, pInputMode, pInputFlag, pReturnType, pMaxLength);\n\t}\n\n\tpublic static void setEditTextDialogResult(final String pResult) {\n\t\ttry {\n\t\t\tfinal byte[] bytesUTF8 = pResult.getBytes(\"UTF8\");\n\t\t\tCocos2dxHelper.nativeSetEditTextDialogResult(bytesUTF8);\t\t\t\n\t\t} catch (UnsupportedEncodingException pUnsupportedEncodingException) {\n\t\t\t/* Nothing. */\n\t\t}\n\t}\n\t\n\tprivate static void openIMEKeyboard() {\n\t\tsCocos2dxHelperListener.openIMEKeyboard();\n\t}\n\t\n\tprivate static void closeIMEKeyboard() {\n\t\tsCocos2dxHelperListener.closeIMEKeyboard();\n\t}\n\n    public static int getDPI()\n    {\n\t\tif (sActivity != null)\n\t\t{\n\t\t\tDisplayMetrics metrics = new DisplayMetrics();\n\t\t\tWindowManager wm = sActivity.getWindowManager();\n\t\t\tif (wm != null)\n\t\t\t{\n\t\t\t\tDisplay d = wm.getDefaultDisplay();\n\t\t\t\tif (d != null)\n\t\t\t\t{\n\t\t\t\t\td.getMetrics(metrics);\n\t\t\t\t\treturn (int)(metrics.density*160.0f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n    }\n    \n    // ===========================================================\n \t// Functions for CCUserDefault\n \t// ===========================================================\n    \n    public static boolean getBoolForKey(String key, boolean defaultValue) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \treturn settings.getBoolean(key, defaultValue);\n    }\n    \n    public static int getIntegerForKey(String key, int defaultValue) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \treturn settings.getInt(key, defaultValue);\n    }\n    \n    public static float getFloatForKey(String key, float defaultValue) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \treturn settings.getFloat(key, defaultValue);\n    }\n    \n    public static double getDoubleForKey(String key, double defaultValue) {\n    \t// SharedPreferences doesn't support saving double value\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \treturn settings.getFloat(key, (float)defaultValue);\n    }\n    \n    public static String getStringForKey(String key, String defaultValue) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \treturn settings.getString(key, defaultValue);\n    }\n    \n    public static void setBoolForKey(String key, boolean value) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \tSharedPreferences.Editor editor = settings.edit();\n    \teditor.putBoolean(key, value);\n    \teditor.commit();\n    }\n    \n    public static void setIntegerForKey(String key, int value) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \tSharedPreferences.Editor editor = settings.edit();\n    \teditor.putInt(key, value);\n    \teditor.commit();\n    }\n    \n    public static void setFloatForKey(String key, float value) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \tSharedPreferences.Editor editor = settings.edit();\n    \teditor.putFloat(key, value);\n    \teditor.commit();\n    }\n    \n    public static void setDoubleForKey(String key, double value) {\n    \t// SharedPreferences doesn't support recording double value\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \tSharedPreferences.Editor editor = settings.edit();\n    \teditor.putFloat(key, (float)value);\n    \teditor.commit();\n    }\n    \n    public static void setStringForKey(String key, String value) {\n    \tSharedPreferences settings = sActivity.getSharedPreferences(Cocos2dxHelper.PREFS_NAME, 0);\n    \tSharedPreferences.Editor editor = settings.edit();\n    \teditor.putString(key, value);\n    \teditor.commit();\n    }\n    \n    public static native void nativeRequestFocus();\n\t\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n\n\tpublic static interface Cocos2dxHelperListener {\n\t\tpublic void showDialog(final String title, final String message);\n\t\tpublic void showEditTextDialog(final String title, final String message, final int inputMode, final int inputFlag, final int returnType, final int maxLength);\n\t\tpublic void openIMEKeyboard();\n\t\tpublic void closeIMEKeyboard();\n\t}\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.lib;\n\nimport android.content.Context;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.database.sqlite.SQLiteOpenHelper;\nimport android.util.Log;\n\n\npublic class Cocos2dxLocalStorage {\n\n    private static final String TAG = \"Cocos2dxLocalStorage\";\n\n    private static String DATABASE_NAME = \"jsb.sqlite\";\n    private static String TABLE_NAME = \"data\";\n    private static final int DATABASE_VERSION = 1;\n\t\n    private static DBOpenHelper mDatabaseOpenHelper = null;\n    private static SQLiteDatabase mDatabase = null;\n    /**\n     * Constructor\n     * @param context The Context within which to work, used to create the DB\n     * @return \n     */\n    public static boolean init(String dbName, String tableName) {\n    \tif (Cocos2dxHelper.getActivity() != null) {\n    \t\tDATABASE_NAME = dbName;\n    \t\tTABLE_NAME = tableName;\n    \t\tmDatabaseOpenHelper = new DBOpenHelper(Cocos2dxHelper.getActivity());\n    \t\tmDatabase = mDatabaseOpenHelper.getWritableDatabase();\n    \t\treturn true;\n    \t}\n        return false;\n    }\n    \n    public static void destory() {\n    \tif (mDatabase != null) {\n    \t\tmDatabase.close();\n    \t}\n    }\n    \n    public static void setItem(String key, String value) {\n    \ttry {\n    \t\tString sql = \"replace into \"+TABLE_NAME+\"(key,value)values(?,?)\";\n    \t\tmDatabase.execSQL(sql, new Object[] { key, value });\n    \t} catch (Exception e) {\n    \t\te.printStackTrace();\n    \t}\n    }\n    \n    public static String getItem(String key) {\n    \tString ret = null;\n    \ttry {\n    \tString sql = \"select value from \"+TABLE_NAME+\" where key=?\";\n    \tCursor c = mDatabase.rawQuery(sql, new String[]{key});  \n        while (c.moveToNext()) {\n        \t// only return the first value\n        \tif (ret != null) \n        \t{\n        \t\tLog.e(TAG, \"The key contains more than one value.\");\n        \t\tbreak;\n        \t}\n            ret = c.getString(c.getColumnIndex(\"value\"));  \n        }  \n        c.close();\n    \t} catch (Exception e) {\n    \t\te.printStackTrace();\n    \t}\n    \treturn ret == null ? \"\" : ret;\n    }\n    \n    public static void removeItem(String key) {\n    \ttry {\n    \t\tString sql = \"delete from \"+TABLE_NAME+\" where key=?\";\n    \t\tmDatabase.execSQL(sql, new Object[] {key});\n    \t} catch (Exception e) {\n    \t\te.printStackTrace();\n    \t}\n    }\n    \n\n    /**\n     * This creates/opens the database.\n     */\n    private static class DBOpenHelper extends SQLiteOpenHelper {\n\n        DBOpenHelper(Context context) {\n            super(context, DATABASE_NAME, null, DATABASE_VERSION);\n        }\n\n        @Override\n        public void onCreate(SQLiteDatabase db) {\n            db.execSQL(\"CREATE TABLE IF NOT EXISTS \"+TABLE_NAME+\"(key TEXT PRIMARY KEY,value TEXT);\");\n        }\n        \n        @Override\n        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n            Log.w(TAG, \"Upgrading database from version \" + oldVersion + \" to \"\n                    + newVersion + \", which will destroy all old data\");\n            //db.execSQL(\"DROP TABLE IF EXISTS \" + VIRTUAL_TABLE);\n            //onCreate(db);\n        }\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\npackage org.cocos2dx.lib;\n\npublic class Cocos2dxLuaJavaBridge\n{\n    public static native int callLuaFunctionWithString(int luaFunctionId, String value);\n    public static native int callLuaGlobalFunctionWithString(String luaFunctionName, String value);\n    public static native int retainLuaFunction(int luaFunctionId);\n    public static native int releaseLuaFunction(int luaFunctionId);\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n ****************************************************************************/\n\npackage org.cocos2dx.lib;\n\nimport java.io.FileInputStream;\n\nimport android.content.Context;\nimport android.content.res.AssetFileDescriptor;\nimport android.media.MediaPlayer;\nimport android.util.Log;\n\npublic class Cocos2dxMusic {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\tprivate static final String TAG = Cocos2dxMusic.class.getSimpleName();\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\n\tprivate final Context mContext;\n\tprivate MediaPlayer mBackgroundMediaPlayer;\n\tprivate float mLeftVolume;\n\tprivate float mRightVolume;\n\tprivate boolean mPaused;\n\tprivate String mCurrentPath;\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\tpublic Cocos2dxMusic(final Context pContext) {\n\t\tthis.mContext = pContext;\n\n\t\tthis.initData();\n\t}\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\n\tpublic void preloadBackgroundMusic(final String pPath) {\n\t\tif ((this.mCurrentPath == null) || (!this.mCurrentPath.equals(pPath))) {\n\t\t\t// preload new background music\n\n\t\t\t// release old resource and create a new one\n\t\t\tif (this.mBackgroundMediaPlayer != null) {\n\t\t\t\tthis.mBackgroundMediaPlayer.release();\n\t\t\t}\n\n\t\t\tthis.mBackgroundMediaPlayer = this.createMediaplayer(pPath);\n\n\t\t\t// record the path\n\t\t\tthis.mCurrentPath = pPath;\n\t\t}\n\t}\n\n\tpublic void playBackgroundMusic(final String pPath, final boolean isLoop) {\n\t\tif (this.mCurrentPath == null) {\n\t\t\t// it is the first time to play background music or end() was called\n\t\t\tthis.mBackgroundMediaPlayer = this.createMediaplayer(pPath);\n\t\t\tthis.mCurrentPath = pPath;\n\t\t} else {\n\t\t\tif (!this.mCurrentPath.equals(pPath)) {\n\t\t\t\t// play new background music\n\n\t\t\t\t// release old resource and create a new one\n\t\t\t\tif (this.mBackgroundMediaPlayer != null) {\n\t\t\t\t\tthis.mBackgroundMediaPlayer.release();\n\t\t\t\t}\n\t\t\t\tthis.mBackgroundMediaPlayer = this.createMediaplayer(pPath);\n\n\t\t\t\t// record the path\n\t\t\t\tthis.mCurrentPath = pPath;\n\t\t\t}\n\t\t}\n\n\t\tif (this.mBackgroundMediaPlayer == null) {\n\t\t\tLog.e(Cocos2dxMusic.TAG, \"playBackgroundMusic: background media player is null\");\n\t\t} else {\n\t\t\t// if the music is playing or paused, stop it\n\t\t\tthis.mBackgroundMediaPlayer.stop();\n\n\t\t\tthis.mBackgroundMediaPlayer.setLooping(isLoop);\n\n\t\t\ttry {\n\t\t\t\tthis.mBackgroundMediaPlayer.prepare();\n\t\t\t\tthis.mBackgroundMediaPlayer.seekTo(0);\n\t\t\t\tthis.mBackgroundMediaPlayer.start();\n\n\t\t\t\tthis.mPaused = false;\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.e(Cocos2dxMusic.TAG, \"playBackgroundMusic: error state\");\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void stopBackgroundMusic() {\n\t\tif (this.mBackgroundMediaPlayer != null) {\n\t\t\tthis.mBackgroundMediaPlayer.stop();\n\n\t\t\t// should set the state, if not, the following sequence will be error\n\t\t\t// play -> pause -> stop -> resume\n\t\t\tthis.mPaused = false;\n\t\t}\n\t}\n\n\tpublic void pauseBackgroundMusic() {\n\t\tif (this.mBackgroundMediaPlayer != null && this.mBackgroundMediaPlayer.isPlaying()) {\n\t\t\tthis.mBackgroundMediaPlayer.pause();\n\t\t\tthis.mPaused = true;\n\t\t}\n\t}\n\n\tpublic void resumeBackgroundMusic() {\n\t\tif (this.mBackgroundMediaPlayer != null && this.mPaused) {\n\t\t\tthis.mBackgroundMediaPlayer.start();\n\t\t\tthis.mPaused = false;\n\t\t}\n\t}\n\n\tpublic void rewindBackgroundMusic() {\n\t\tif (this.mBackgroundMediaPlayer != null) {\n\t\t\tthis.mBackgroundMediaPlayer.stop();\n\n\t\t\ttry {\n\t\t\t\tthis.mBackgroundMediaPlayer.prepare();\n\t\t\t\tthis.mBackgroundMediaPlayer.seekTo(0);\n\t\t\t\tthis.mBackgroundMediaPlayer.start();\n\n\t\t\t\tthis.mPaused = false;\n\t\t\t} catch (final Exception e) {\n\t\t\t\tLog.e(Cocos2dxMusic.TAG, \"rewindBackgroundMusic: error state\");\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic boolean isBackgroundMusicPlaying() {\n\t\tboolean ret = false;\n\n\t\tif (this.mBackgroundMediaPlayer == null) {\n\t\t\tret = false;\n\t\t} else {\n\t\t\tret = this.mBackgroundMediaPlayer.isPlaying();\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tpublic void end() {\n\t\tif (this.mBackgroundMediaPlayer != null) {\n\t\t\tthis.mBackgroundMediaPlayer.release();\n\t\t}\n\n\t\tthis.initData();\n\t}\n\n\tpublic float getBackgroundVolume() {\n\t\tif (this.mBackgroundMediaPlayer != null) {\n\t\t\treturn (this.mLeftVolume + this.mRightVolume) / 2;\n\t\t} else {\n\t\t\treturn 0.0f;\n\t\t}\n\t}\n\n\tpublic void setBackgroundVolume(float pVolume) {\n\t\tif (pVolume < 0.0f) {\n\t\t\tpVolume = 0.0f;\n\t\t}\n\n\t\tif (pVolume > 1.0f) {\n\t\t\tpVolume = 1.0f;\n\t\t}\n\n\t\tthis.mLeftVolume = this.mRightVolume = pVolume;\n\t\tif (this.mBackgroundMediaPlayer != null) {\n\t\t\tthis.mBackgroundMediaPlayer.setVolume(this.mLeftVolume, this.mRightVolume);\n\t\t}\n\t}\n\n\tprivate void initData() {\n\t\tthis.mLeftVolume = 0.5f;\n\t\tthis.mRightVolume = 0.5f;\n\t\tthis.mBackgroundMediaPlayer = null;\n\t\tthis.mPaused = false;\n\t\tthis.mCurrentPath = null;\n\t}\n\n\t/**\n\t * create mediaplayer for music\n\t * \n\t * @param pPath\n\t *            the pPath relative to assets\n\t * @return\n\t */\n\tprivate MediaPlayer createMediaplayer(final String pPath) {\n\t\tMediaPlayer mediaPlayer = new MediaPlayer();\n\n\t\ttry {\n\t\t\tif (pPath.startsWith(\"/\")) {\n\t\t\t\tfinal FileInputStream fis = new FileInputStream(pPath);\n\t\t\t\tmediaPlayer.setDataSource(fis.getFD());\n\t\t\t\tfis.close();\n\t\t\t} else {\n\t\t\t\tfinal AssetFileDescriptor assetFileDescritor = this.mContext.getAssets().openFd(pPath);\n\t\t\t\tmediaPlayer.setDataSource(assetFileDescritor.getFileDescriptor(), assetFileDescritor.getStartOffset(), assetFileDescritor.getLength());\n\t\t\t}\n\n\t\t\tmediaPlayer.prepare();\n\n\t\t\tmediaPlayer.setVolume(this.mLeftVolume, this.mRightVolume);\n\t\t} catch (final Exception e) {\n\t\t\tmediaPlayer = null;\n\t\t\tLog.e(Cocos2dxMusic.TAG, \"error: \" + e.getMessage(), e);\n\t\t}\n\n\t\treturn mediaPlayer;\n\t}\n\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n ****************************************************************************/\npackage org.cocos2dx.lib;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.concurrent.Semaphore;\n\nimport android.content.Context;\nimport android.media.AudioManager;\nimport android.media.SoundPool;\nimport android.util.Log;\n\npublic class Cocos2dxSound {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\tprivate static final String TAG = \"Cocos2dxSound\";\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\n\tprivate final Context mContext;\n\tprivate SoundPool mSoundPool;\n\tprivate float mLeftVolume;\n\tprivate float mRightVolume;\n\n\t// sound path and stream ids map\n\t// a file may be played many times at the same time\n\t// so there is an array map to a file path\n\tprivate final HashMap<String, ArrayList<Integer>> mPathStreamIDsMap = new HashMap<String, ArrayList<Integer>>();\n\n\tprivate final HashMap<String, Integer> mPathSoundIDMap = new HashMap<String, Integer>();\n\n\tprivate final ArrayList<SoundInfoForLoadedCompleted> mEffecToPlayWhenLoadedArray = new ArrayList<SoundInfoForLoadedCompleted>();\n\n\tprivate int mStreamIdSyn;\n\tprivate Semaphore mSemaphore;\n\n\tprivate static final int MAX_SIMULTANEOUS_STREAMS_DEFAULT = 5;\n\tprivate static final float SOUND_RATE = 1.0f;\n\tprivate static final int SOUND_PRIORITY = 1;\n\tprivate static final int SOUND_QUALITY = 5;\n\n\tprivate final static int INVALID_SOUND_ID = -1;\n\tprivate final static int INVALID_STREAM_ID = -1;\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\tpublic Cocos2dxSound(final Context pContext) {\n\t\tthis.mContext = pContext;\n\n\t\tthis.initData();\n\t}\n\n\tprivate void initData() {\n\t\tthis.mSoundPool = new SoundPool(Cocos2dxSound.MAX_SIMULTANEOUS_STREAMS_DEFAULT, AudioManager.STREAM_MUSIC, Cocos2dxSound.SOUND_QUALITY);\n\t\tthis.mSoundPool.setOnLoadCompleteListener(new OnLoadCompletedListener());\n\n\t\tthis.mLeftVolume = 0.5f;\n\t\tthis.mRightVolume = 0.5f;\n\n\t\tthis.mSemaphore = new Semaphore(0, true);\n\t}\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\n\tpublic int preloadEffect(final String pPath) {\n\t\tInteger soundID = this.mPathSoundIDMap.get(pPath);\n\n\t\tif (soundID == null) {\n\t\t\tsoundID = this.createSoundIDFromAsset(pPath);\n\t\t\t// save value just in case if file is really loaded\n\t\t\tif (soundID != Cocos2dxSound.INVALID_SOUND_ID) {\n\t\t\t\tthis.mPathSoundIDMap.put(pPath, soundID);\n\t\t\t}\n\t\t}\n\n\t\treturn soundID;\n\t}\n\n\tpublic void unloadEffect(final String pPath) {\n\t\t// stop effects\n\t\tfinal ArrayList<Integer> streamIDs = this.mPathStreamIDsMap.get(pPath);\n\t\tif (streamIDs != null) {\n\t\t\tfor (final Integer pStreamID : streamIDs) {\n\t\t\t\tthis.mSoundPool.stop(pStreamID);\n\t\t\t}\n\t\t}\n\t\tthis.mPathStreamIDsMap.remove(pPath);\n\n\t\t// unload effect\n\t\tfinal Integer soundID = this.mPathSoundIDMap.get(pPath);\n\t\tif(soundID != null){\n\t\t\tthis.mSoundPool.unload(soundID);\n\t\t\tthis.mPathSoundIDMap.remove(pPath);\n\t\t}\n\t}\n\n\tpublic int playEffect(final String pPath, final boolean pLoop, float pitch, float pan, float gain){\n\t\tInteger soundID = this.mPathSoundIDMap.get(pPath);\n\t\tint streamID = Cocos2dxSound.INVALID_STREAM_ID;\n\n\t\tif (soundID != null) {\n\t\t\t// parameters; pan = -1 for left channel, 1 for right channel, 0 for both channels\n\n\t\t\t// play sound\n\t\t\tstreamID = this.doPlayEffect(pPath, soundID.intValue(), pLoop, pitch, pan, gain);\n\t\t} else {\n\t\t\t// the effect is not prepared\n\t\t\tsoundID = this.preloadEffect(pPath);\n\t\t\tif (soundID == Cocos2dxSound.INVALID_SOUND_ID) {\n\t\t\t\t// can not preload effect\n\t\t\t\treturn Cocos2dxSound.INVALID_SOUND_ID;\n\t\t\t}\n\n\t\t\t// only allow one playEffect at a time, or the semaphore will not work correctly\n\t\t\tsynchronized(this.mSoundPool) {\n\t\t\t\t// add this effect into mEffecToPlayWhenLoadedArray, and it will be played when loaded completely\n\t\t\t\tmEffecToPlayWhenLoadedArray.add(new SoundInfoForLoadedCompleted(pPath, soundID.intValue(), pLoop,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpitch, pan, gain));\n\n\t\t\t\ttry {\n\t\t\t\t\t// wait OnloadedCompleteListener to set streamID\n\t\t\t\t\tthis.mSemaphore.acquire();\n\n\t\t\t\t\tstreamID = this.mStreamIdSyn;\n\t\t\t\t} catch(Exception e) {\n\t\t\t\t\treturn Cocos2dxSound.INVALID_SOUND_ID;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn streamID;\n\t}\n\n\tpublic void stopEffect(final int pStreamID) {\n\t\tthis.mSoundPool.stop(pStreamID);\n\n\t\t// remove record\n\t\tfor (final String pPath : this.mPathStreamIDsMap.keySet()) {\n\t\t\tif (this.mPathStreamIDsMap.get(pPath).contains(pStreamID)) {\n\t\t\t\tthis.mPathStreamIDsMap.get(pPath).remove(this.mPathStreamIDsMap.get(pPath).indexOf(pStreamID));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void pauseEffect(final int pStreamID) {\n\t\tthis.mSoundPool.pause(pStreamID);\n\t}\n\n\tpublic void resumeEffect(final int pStreamID) {\n\t\tthis.mSoundPool.resume(pStreamID);\n\t}\n\n\tpublic void pauseAllEffects() {\n\t\tthis.mSoundPool.autoPause();\n\t}\n\n\tpublic void resumeAllEffects() {\n\t\t// can not only invoke SoundPool.autoResume() here, because\n\t\t// it only resumes all effects paused by pauseAllEffects()\n\t\tif (!this.mPathStreamIDsMap.isEmpty()) {\n\t\t\tfinal Iterator<Entry<String, ArrayList<Integer>>> iter = this.mPathStreamIDsMap.entrySet().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tfinal Entry<String, ArrayList<Integer>> entry = iter.next();\n\t\t\t\tfor (final int pStreamID : entry.getValue()) {\n\t\t\t\t\tthis.mSoundPool.resume(pStreamID);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void stopAllEffects() {\n\t\t// stop effects\n\t\tif (!this.mPathStreamIDsMap.isEmpty()) {\n\t\t\tfinal Iterator<?> iter = this.mPathStreamIDsMap.entrySet().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tfinal Map.Entry<String, ArrayList<Integer>> entry = (Map.Entry<String, ArrayList<Integer>>) iter.next();\n\t\t\t\tfor (final int pStreamID : entry.getValue()) {\n\t\t\t\t\tthis.mSoundPool.stop(pStreamID);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// remove records\n\t\tthis.mPathStreamIDsMap.clear();\n\t}\n\n\tpublic float getEffectsVolume() {\n\t\treturn (this.mLeftVolume + this.mRightVolume) / 2;\n\t}\n\n\tpublic void setEffectsVolume(float pVolume) {\n\t\t// pVolume should be in [0, 1.0]\n\t\tif (pVolume < 0) {\n\t\t\tpVolume = 0;\n\t\t}\n\t\tif (pVolume > 1) {\n\t\t\tpVolume = 1;\n\t\t}\n\n\t\tthis.mLeftVolume = this.mRightVolume = pVolume;\n\n\t\t// change the volume of playing sounds\n\t\tif (!this.mPathStreamIDsMap.isEmpty()) {\n\t\t\tfinal Iterator<Entry<String, ArrayList<Integer>>> iter = this.mPathStreamIDsMap.entrySet().iterator();\n\t\t\twhile (iter.hasNext()) {\n\t\t\t\tfinal Entry<String, ArrayList<Integer>> entry = iter.next();\n\t\t\t\tfor (final int pStreamID : entry.getValue()) {\n\t\t\t\t\tthis.mSoundPool.setVolume(pStreamID, this.mLeftVolume, this.mRightVolume);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic void end() {\n\t\tthis.mSoundPool.release();\n\t\tthis.mPathStreamIDsMap.clear();\n\t\tthis.mPathSoundIDMap.clear();\n\t\tthis.mEffecToPlayWhenLoadedArray.clear();\n\n\t\tthis.mLeftVolume = 0.5f;\n\t\tthis.mRightVolume = 0.5f;\n\n\t\tthis.initData();\n\t}\n\n\tpublic int createSoundIDFromAsset(final String pPath) {\n\t\tint soundID = Cocos2dxSound.INVALID_SOUND_ID;\n\n\t\ttry {\n\t\t\tif (pPath.startsWith(\"/\")) {\n\t\t\t\tsoundID = this.mSoundPool.load(pPath, 0);\n\t\t\t} else {\n\t\t\t\tsoundID = this.mSoundPool.load(this.mContext.getAssets().openFd(pPath), 0);\n\t\t\t}\n\t\t} catch (final Exception e) {\n\t\t\tsoundID = Cocos2dxSound.INVALID_SOUND_ID;\n\t\t\tLog.e(Cocos2dxSound.TAG, \"error: \" + e.getMessage(), e);\n\t\t}\n\n\t\t// mSoundPool.load returns 0 if something goes wrong, for example a file does not exist\n\t\tif (soundID == 0) {\n\t\t\tsoundID = Cocos2dxSound.INVALID_SOUND_ID;\n\t\t}\n\n\t\treturn soundID;\n\t}\n\n\t\tprivate float clamp(float value, float min, float max) {\n\t\t\treturn Math.max(min, (Math.min(value, max)));\n\t\t}\n\n\tprivate int doPlayEffect(final String pPath, final int soundId, final boolean pLoop, float pitch, float pan, float gain) {\n\t\tfloat leftVolume = this.mLeftVolume * gain * (1.0f - this.clamp(pan, 0.0f, 1.0f));\n\t\tfloat rightVolume = this.mRightVolume * gain * (1.0f - this.clamp(-pan, 0.0f, 1.0f));\n\t\tfloat soundRate = this.clamp(SOUND_RATE * pitch, 0.5f, 2.0f);\n\n\t\t// play sound\n\t\tint streamID = this.mSoundPool.play(soundId, this.clamp(leftVolume, 0.0f, 1.0f), this.clamp(rightVolume, 0.0f, 1.0f), Cocos2dxSound.SOUND_PRIORITY, pLoop ? -1 : 0, soundRate);\n\n\t\t// record stream id\n\t\tArrayList<Integer> streamIDs = this.mPathStreamIDsMap.get(pPath);\n\t\tif (streamIDs == null) {\n\t\t\tstreamIDs = new ArrayList<Integer>();\n\t\t\tthis.mPathStreamIDsMap.put(pPath, streamIDs);\n\t\t}\n\t\tstreamIDs.add(streamID);\n\n\t\treturn streamID;\n\t}\n\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n\n\tpublic class SoundInfoForLoadedCompleted {\n\t\tpublic int soundID;\n\t\tpublic boolean isLoop;\n\t\tpublic float pitch;\n\t\tpublic float pan;\n\t\tpublic float gain;\n\t\tpublic String path;\n\n\t\tpublic SoundInfoForLoadedCompleted(String path, int soundId, boolean isLoop,\n\t\t\t\t\t\t\t\t\t\t\t   float pitch, float pan, float gain) {\n\t\t\tthis.path = path;\n\t\t\tthis.soundID = soundId;\n\t\t\tthis.isLoop = isLoop;\n\t\t\tthis.pitch = pitch;\n\t\t\tthis.pan = pan;\n\t\t\tthis.gain = gain;\n\t\t}\n\t}\n\n\tpublic class OnLoadCompletedListener implements SoundPool.OnLoadCompleteListener {\n\n\t\t@Override\n\t\tpublic void onLoadComplete(SoundPool soundPool, int sampleId, int status) {\n\t\t\tif (status == 0)\n\t\t\t{\n\t\t\t\t// only play effect that are in mEffecToPlayWhenLoadedArray\n\t\t\t\tfor ( SoundInfoForLoadedCompleted info : mEffecToPlayWhenLoadedArray) {\n\t\t\t\t\tif (sampleId == info.soundID) {\n\t\t\t\t\t\t// set the stream id which will be returned by playEffect()\n\t\t\t\t\t\tmStreamIdSyn = doPlayEffect(info.path, info.soundID, info.isLoop, info.pitch, info.pan, info.gain);\n\n\t\t\t\t\t\t// remove it from array, because we will break here\n\t\t\t\t\t\t// so it is safe to do\n\t\t\t\t\t\tmEffecToPlayWhenLoadedArray.remove(info);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmStreamIdSyn = Cocos2dxSound.INVALID_SOUND_ID;\n\t\t\t}\n\n\t\t\tmSemaphore.release();\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n ****************************************************************************/\npackage org.cocos2dx.lib;\n\nimport java.util.HashMap;\n\nimport android.content.Context;\nimport android.graphics.Typeface;\n\npublic class Cocos2dxTypefaces {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Fields\n\t// ===========================================================\n\n\tprivate static final HashMap<String, Typeface> sTypefaceCache = new HashMap<String, Typeface>();\n\n\t// ===========================================================\n\t// Constructors\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Getter & Setter\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods for/from SuperClass/Interfaces\n\t// ===========================================================\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n\n\tpublic static synchronized Typeface get(final Context pContext, final String pAssetName) {\n\t\tif (!Cocos2dxTypefaces.sTypefaceCache.containsKey(pAssetName)) {\n\t\t\tTypeface typeface = null;\n\t\t\tif (pAssetName.startsWith(\"/\"))\n\t\t\t{\n\t\t\t\ttypeface = Typeface.createFromFile(pAssetName);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttypeface = Typeface.createFromAsset(pContext.getAssets(), pAssetName);\n\t\t\t}\n\t\t\tCocos2dxTypefaces.sTypefaceCache.put(pAssetName, typeface);\n\t\t}\n\n\t\treturn Cocos2dxTypefaces.sTypefaceCache.get(pAssetName);\n\t}\n\n\t// ===========================================================\n\t// Inner and Anonymous Classes\n\t// ===========================================================\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/DPIJni.cpp",
    "content": "#include \"DPIJni.h\"\n#include \"jni/JniHelper.h\"\n\nUSING_NS_CC;\n\nextern \"C\" {\n\nint getDPIJNI()\n{\n    JniMethodInfo t;\n    jint ret = -1;\n    if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxHelper\", \"getDPI\", \"()I\")) {\n        ret = t.env->CallStaticIntMethod(t.classID, t.methodID);\n        t.env->DeleteLocalRef(t.classID);\n    }\n    return ret;\n}\n\n} // extern \"C\""
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/DPIJni.h",
    "content": "#ifndef __DPIJNI_H__\n#define __DPIJNI_H__\n\nextern \"C\" {\n\nint getDPIJNI();\n\n} // extern \"C\"\n\n#endif /* __DPIJNI_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/IMEJni.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"IMEJni.h\"\n#include \"CCIMEDispatcher.h\"\n#include \"JniHelper.h\"\n\n#include <android/log.h>\n#include <string.h>\n#include <jni.h>\n\nusing namespace cocos2d;\n\nextern \"C\" {\n    void setKeyboardStateJNI(int bOpen) {\n        if (bOpen) {\n            openKeyboardJNI();\n        } else {\n            closeKeyboardJNI();\n        }\n    }\n\n    void openKeyboardJNI() {\n        JniMethodInfo t;\n\n        if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxHelper\", \"openIMEKeyboard\", \"()V\")) {\n            t.env->CallStaticVoidMethod(t.classID, t.methodID);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n\n    void closeKeyboardJNI() {\n        JniMethodInfo t;\n\n        if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxHelper\", \"closeIMEKeyboard\", \"()V\")) {\n            t.env->CallStaticVoidMethod(t.classID, t.methodID);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n\n    JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxTextInputWraper_nativeInsertText(JNIEnv* env, jobject thiz, jstring text) {\n        const char*  tmpText = env->GetStringUTFChars(text, nullptr);\n        cocos2d::IMEDispatcher::sharedDispatcher()->dispatchInsertText(tmpText, strlen(tmpText));\n        env->ReleaseStringUTFChars(text, tmpText);\n    }\n\n    JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxTextInputWraper_nativeDeleteBackward(JNIEnv* env, jobject thiz) {\n        cocos2d::IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward();\n    }\n\n    JNIEXPORT jstring JNICALL Java_org_cocos2dx_lib_Cocos2dxEditText_nativeGetContent() {\n        JNIEnv * env = 0;\n\n        if (JniHelper::getJavaVM()->GetEnv((void**)&env, JNI_VERSION_1_4) != JNI_OK || ! env) {\n            return 0;\n        }\n        const std::string& text = cocos2d::IMEDispatcher::sharedDispatcher()->getContentText();\n        return env->NewStringUTF(text.c_str());\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/IMEJni.h",
    "content": "/****************************************************************************\nCopyright (c) 2011-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __ANDROID_IME_JNI_H__\n#define __ANDROID_IME_JNI_H__\n\nextern \"C\" {\n    extern void setKeyboardStateJNI(int bOpen);\n    extern void openKeyboardJNI();\n    extern void closeKeyboardJNI();\n}\n\n#endif // __ANDROID_IME_JNI_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"JniHelper.h\"\n#include <string.h>\n#include \"CCDirector.h\"\n#include \"../CCApplication.h\"\n#include \"platform/CCFileUtils.h\"\n#include <jni.h>\n\nusing namespace cocos2d;\n\n\nint getFontSizeAccordingHeightJni(int height) {\n    int ret = 0;\n\n    JniMethodInfo t;\n    if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxBitmap\", \"getFontSizeAccordingHeight\", \"(I)I\")) {\n        ret = t.env->CallStaticIntMethod(t.classID, t.methodID, height);\n        t.env->DeleteLocalRef(t.classID);\n    }\n\n    return ret;\n}\n\nstd::string getStringWithEllipsisJni(const char* pszText, float width, float fontSize) {\n    std::string ret;\n    JniMethodInfo t;\n\n    if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxBitmap\", \"getStringWithEllipsis\", \"(Ljava/lang/String;FF)Ljava/lang/String;\")) {\n        jstring stringArg1;\n\n        if (!pszText) {\n            stringArg1 = t.env->NewStringUTF(\"\");\n        } else {\n            stringArg1 = t.env->NewStringUTF(pszText);\n        }\n\n        jstring retFromJava = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID, stringArg1, width, fontSize);\n        const char* str = t.env->GetStringUTFChars(retFromJava, 0);\n        ret = str;\n\n        t.env->ReleaseStringUTFChars(retFromJava, str);\n        t.env->DeleteLocalRef(stringArg1);\n        t.env->DeleteLocalRef(t.classID);\n    }\n    return ret;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h",
    "content": "/****************************************************************************\nCopyright (c) 2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __EDITBOX_JNI_H__\n#define __EDITBOX_JNI_H__\n\n#include <string>\n\nint getFontSizeAccordingHeightJni(int height);\nstd::string getStringWithEllipsisJni(const char* pszText, float width, float fontSize);\n\n#endif // __EDITBOX_JNI_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include <stdlib.h>\n#include <jni.h>\n#include <android/log.h>\n#include <string>\n#include \"JniHelper.h\"\n#include \"CCString.h\"\n#include \"Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n\n#define  LOG_TAG    \"Java_org_cocos2dx_lib_Cocos2dxHelper.cpp\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\n#define  CLASS_NAME \"org/cocos2dx/lib/Cocos2dxHelper\"\n\nEditTextCallback s_pfEditTextCallback = NULL;\nvoid* s_ctx = NULL;\n\nusing namespace cocos2d;\nusing namespace std;\n\nstring g_apkPath;\n\nextern \"C\" {\n\n    JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetApkPath(JNIEnv*  env, jobject thiz, jstring apkPath) {\n        g_apkPath = JniHelper::jstring2string(apkPath);\n    }\n}\n\nconst char * getApkPath() {\n    return g_apkPath.c_str();\n}\n\nvoid showDialogJNI(const char * pszMsg, const char * pszTitle) {\n    if (!pszMsg) {\n        return;\n    }\n\n    JniMethodInfo t;\n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"showDialog\", \"(Ljava/lang/String;Ljava/lang/String;)V\")) {\n        jstring stringArg1;\n\n        if (!pszTitle) {\n            stringArg1 = t.env->NewStringUTF(\"\");\n        } else {\n            stringArg1 = t.env->NewStringUTF(pszTitle);\n        }\n\n        jstring stringArg2 = t.env->NewStringUTF(pszMsg);\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, stringArg1, stringArg2);\n\n        t.env->DeleteLocalRef(stringArg1);\n        t.env->DeleteLocalRef(stringArg2);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\nvoid showEditTextDialogJNI(const char* pszTitle, const char* pszMessage, int nInputMode, int nInputFlag, int nReturnType, int nMaxLength, EditTextCallback pfEditTextCallback, void* ctx) {\n    if (pszMessage == NULL) {\n        return;\n    }\n\n    s_pfEditTextCallback = pfEditTextCallback;\n    s_ctx = ctx;\n\n    JniMethodInfo t;\n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"showEditTextDialog\", \"(Ljava/lang/String;Ljava/lang/String;IIII)V\")) {\n        jstring stringArg1;\n\n        if (!pszTitle) {\n            stringArg1 = t.env->NewStringUTF(\"\");\n        } else {\n            stringArg1 = t.env->NewStringUTF(pszTitle);\n        }\n\n        jstring stringArg2 = t.env->NewStringUTF(pszMessage);\n\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, stringArg1, stringArg2, nInputMode, nInputFlag, nReturnType, nMaxLength);\n\n        t.env->DeleteLocalRef(stringArg1);\n        t.env->DeleteLocalRef(stringArg2);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\nvoid terminateProcessJNI() {\n    JniMethodInfo t;\n\n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"terminateProcess\", \"()V\")) {\n        t.env->CallStaticVoidMethod(t.classID, t.methodID);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\nstd::string getPackageNameJNI() {\n    JniMethodInfo t;\n    std::string ret(\"\");\n\n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getCocos2dxPackageName\", \"()Ljava/lang/String;\")) {\n        jstring str = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID);\n        t.env->DeleteLocalRef(t.classID);\n        ret = JniHelper::jstring2string(str);\n        t.env->DeleteLocalRef(str);\n    }\n    return ret;\n}\n\nstd::string getFileDirectoryJNI() {\n    JniMethodInfo t;\n    std::string ret(\"\");\n\n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getCocos2dxWritablePath\", \"()Ljava/lang/String;\")) {\n        jstring str = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID);\n        t.env->DeleteLocalRef(t.classID);\n        ret = JniHelper::jstring2string(str);\n        t.env->DeleteLocalRef(str);\n    }\n    \n    return ret;\n}\n\nstd::string getCurrentLanguageJNI() {\n    JniMethodInfo t;\n    std::string ret(\"\");\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getCurrentLanguage\", \"()Ljava/lang/String;\")) {\n        jstring str = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID);\n        t.env->DeleteLocalRef(t.classID);\n        ret = JniHelper::jstring2string(str);\n        t.env->DeleteLocalRef(str);\n    }\n\n    return ret;\n}\n\n// functions for UserDefault\nbool getBoolForKeyJNI(const char* pKey, bool defaultValue)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getBoolForKey\", \"(Ljava/lang/String;Z)Z\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        jboolean ret = t.env->CallStaticBooleanMethod(t.classID, t.methodID, stringArg, defaultValue);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n        \n        return ret;\n    }\n    \n    return defaultValue;\n}\n\nint getIntegerForKeyJNI(const char* pKey, int defaultValue)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getIntegerForKey\", \"(Ljava/lang/String;I)I\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        jint ret = t.env->CallStaticIntMethod(t.classID, t.methodID, stringArg, defaultValue);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n        \n        return ret;\n    }\n    \n    return defaultValue;\n}\n\nfloat getFloatForKeyJNI(const char* pKey, float defaultValue)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getFloatForKey\", \"(Ljava/lang/String;F)F\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        jfloat ret = t.env->CallStaticFloatMethod(t.classID, t.methodID, stringArg, defaultValue);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n        \n        return ret;\n    }\n    \n    return defaultValue;\n}\n\ndouble getDoubleForKeyJNI(const char* pKey, double defaultValue)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getDoubleForKey\", \"(Ljava/lang/String;D)D\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        jdouble ret = t.env->CallStaticDoubleMethod(t.classID, t.methodID, stringArg, defaultValue);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n        \n        return ret;\n    }\n    \n    return defaultValue;\n}\n\nstd::string getStringForKeyJNI(const char* pKey, const char* defaultValue)\n{\n    JniMethodInfo t;\n    std::string ret(\"\");\n\n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"getStringForKey\", \"(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;\")) {\n        jstring stringArg1 = t.env->NewStringUTF(pKey);\n        jstring stringArg2 = t.env->NewStringUTF(defaultValue);\n        jstring str = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID, stringArg1, stringArg2);\n        ret = JniHelper::jstring2string(str);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg1);\n        t.env->DeleteLocalRef(stringArg2);\n        t.env->DeleteLocalRef(str);\n        \n        return ret;\n    }\n    \n    return defaultValue;\n}\n\nvoid setBoolForKeyJNI(const char* pKey, bool value)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"setBoolForKey\", \"(Ljava/lang/String;Z)V\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, stringArg, value);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n    }\n}\n\nvoid setIntegerForKeyJNI(const char* pKey, int value)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"setIntegerForKey\", \"(Ljava/lang/String;I)V\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, stringArg, value);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n    }\n}\n\nvoid setFloatForKeyJNI(const char* pKey, float value)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"setFloatForKey\", \"(Ljava/lang/String;F)V\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, stringArg, value);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n    }\n}\n\nvoid setDoubleForKeyJNI(const char* pKey, double value)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"setDoubleForKey\", \"(Ljava/lang/String;D)V\")) {\n        jstring stringArg = t.env->NewStringUTF(pKey);\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, stringArg, value);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg);\n    }\n}\n\nvoid setStringForKeyJNI(const char* pKey, const char* value)\n{\n    JniMethodInfo t;\n    \n    if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, \"setStringForKey\", \"(Ljava/lang/String;Ljava/lang/String;)V\")) {\n        jstring stringArg1 = t.env->NewStringUTF(pKey);\n        jstring stringArg2 = t.env->NewStringUTF(value);\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, stringArg1, stringArg2);\n        \n        t.env->DeleteLocalRef(t.classID);\n        t.env->DeleteLocalRef(stringArg1);\n        t.env->DeleteLocalRef(stringArg2);\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __Java_org_cocos2dx_lib_Cocos2dxHelper_H__\n#define __Java_org_cocos2dx_lib_Cocos2dxHelper_H__\n\n#include <string>\n\ntypedef void (*EditTextCallback)(const char* pText, void* ctx);\n\nextern const char * getApkPath();\nextern void showDialogJNI(const char * pszMsg, const char * pszTitle);\nextern void showEditTextDialogJNI(const char* pszTitle, const char* pszContent, int nInputMode, int nInputFlag, int nReturnType, int nMaxLength, EditTextCallback pfEditTextCallback, void* ctx);\nextern void terminateProcessJNI();\nextern std::string getCurrentLanguageJNI();\nextern std::string getPackageNameJNI();\nextern std::string getFileDirectoryJNI();\n// functions for UserDefault\nextern bool getBoolForKeyJNI(const char* pKey, bool defaultValue);\nextern int getIntegerForKeyJNI(const char* pKey, int defaultValue);\nextern float getFloatForKeyJNI(const char* pKey, float defaultValue);\nextern double getDoubleForKeyJNI(const char* pKey, double defaultValue);\nextern std::string getStringForKeyJNI(const char* pKey, const char* defaultValue);\nextern void setBoolForKeyJNI(const char* pKey, bool value);\nextern void setIntegerForKeyJNI(const char* pKey, int value);\nextern void setFloatForKeyJNI(const char* pKey, float value);\nextern void setDoubleForKeyJNI(const char* pKey, double value);\nextern void setStringForKeyJNI(const char* pKey, const char* value);\n\n#endif /* __Java_org_cocos2dx_lib_Cocos2dxHelper_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/JniHelper.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"JniHelper.h\"\n#include <android/log.h>\n#include <string.h>\n#include <pthread.h>\n\n#define  LOG_TAG    \"JniHelper\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\njclass _getClassID(const char *className) {\n    if (NULL == className) {\n        return NULL;\n    }\n\n    JNIEnv* env = cocos2d::JniHelper::getEnv();\n\n    jstring _jstrClassName = env->NewStringUTF(className);\n\n    jclass _clazz = (jclass) env->CallObjectMethod(cocos2d::JniHelper::classloader,\n                                                   cocos2d::JniHelper::loadclassMethod_methodID,\n                                                   _jstrClassName);\n\n    if (NULL == _clazz) {\n        LOGD(\"Classloader failed to find class of %s\", className);\n    }\n\n    env->DeleteLocalRef(_jstrClassName);\n        \n    return _clazz;\n}\n\nnamespace cocos2d {\n\n    JavaVM* JniHelper::_psJavaVM = NULL;\n    jmethodID JniHelper::loadclassMethod_methodID = NULL;\n    jobject JniHelper::classloader = NULL;\n    JNIEnv* JniHelper::env = NULL;\n\n    static pthread_key_t s_threadKey;\n\n    JavaVM* JniHelper::getJavaVM() {\n        pthread_t thisthread = pthread_self();\n        LOGD(\"JniHelper::getJavaVM(), pthread_self() = %X\", thisthread);\n        return _psJavaVM;\n    }\n\n    void JniHelper::setJavaVM(JavaVM *javaVM) {\n        pthread_t thisthread = pthread_self();\n        LOGD(\"JniHelper::setJavaVM(%p), pthread_self() = %X\", javaVM, thisthread);\n        _psJavaVM = javaVM;\n\n        JniHelper::cacheEnv(javaVM);\n    }\n\n    void JniHelper::detach_current_thread (void *env) {\n        _psJavaVM->DetachCurrentThread();\n    }\n\n    bool JniHelper::cacheEnv(JavaVM* jvm) {\n        JNIEnv* _env = NULL;\n        // get jni environment\n        jint ret = jvm->GetEnv((void**)&_env, JNI_VERSION_1_4);\n        \n        switch (ret) {\n        case JNI_OK :\n            // Success!\n            JniHelper::env = _env;\n            return true;\n                \n        case JNI_EDETACHED :\n            // Thread not attached\n                \n            // TODO : If calling AttachCurrentThread() on a native thread\n            // must call DetachCurrentThread() in future.\n            // see: http://developer.android.com/guide/practices/design/jni.html\n            \n            pthread_key_create (&s_threadKey, JniHelper::detach_current_thread);\n            if (jvm->AttachCurrentThread(&_env, NULL) < 0)\n                {\n                    LOGD(\"Failed to get the environment using AttachCurrentThread()\");\n\n                    JniHelper::env = NULL;\n                    return false;\n                } else {\n                // Success : Attached and obtained JNIEnv!\n                JniHelper::env = _env;\n                if (pthread_getspecific(s_threadKey) == NULL)\n                    pthread_setspecific(s_threadKey, _env); \n                return true;\n            }\n                \n        case JNI_EVERSION :\n            // Cannot recover from this error\n            LOGD(\"JNI interface version 1.4 not supported\");\n        default :\n            LOGD(\"Failed to get the environment using GetEnv()\");\n            JniHelper::env = NULL;\n            return false;\n        }\n    }\n\n    JNIEnv* JniHelper::getEnv() {\n        return JniHelper::env;\n    }\n\n    bool JniHelper::setClassLoaderFrom(jobject nativeactivityinstance) {\n        JniMethodInfo _getclassloaderMethod;\n        if (!JniHelper::getMethodInfo_DefaultClassLoader(_getclassloaderMethod,\n                                                         \"android/app/NativeActivity\",\n                                                         \"getClassLoader\",\n                                                         \"()Ljava/lang/ClassLoader;\")) {\n            return false;\n        }\n\n        jobject _c = cocos2d::JniHelper::getEnv()->CallObjectMethod(nativeactivityinstance,\n                                                                    _getclassloaderMethod.methodID);\n\n        if (NULL == _c) {\n            return false;\n        }\n\n        JniMethodInfo _m;\n        if (!JniHelper::getMethodInfo_DefaultClassLoader(_m,\n                                                         \"java/lang/ClassLoader\",\n                                                         \"loadClass\",\n                                                         \"(Ljava/lang/String;)Ljava/lang/Class;\")) {\n            return false;\n        }\n\n        JniHelper::classloader = _c;\n        JniHelper::loadclassMethod_methodID = _m.methodID;\n\n        return true;\n    }\n\n    bool JniHelper::getStaticMethodInfo(JniMethodInfo &methodinfo,\n                                        const char *className, \n                                        const char *methodName,\n                                        const char *paramCode) {\n        if ((NULL == className) ||\n            (NULL == methodName) ||\n            (NULL == paramCode)) {\n            return false;\n        }\n\n        JNIEnv *pEnv = JniHelper::getEnv();\n        if (!pEnv) {\n            LOGD(\"Failed to get JNIEnv\");\n            return false;\n        }\n            \n        jclass classID = _getClassID(className);\n        if (! classID) {\n            LOGD(\"Failed to find class %s\", className);\n            return false;\n        }\n\n        jmethodID methodID = pEnv->GetStaticMethodID(classID, methodName, paramCode);\n        if (! methodID) {\n            LOGD(\"Failed to find static method id of %s\", methodName);\n            return false;\n        }\n            \n        methodinfo.classID = classID;\n        methodinfo.env = pEnv;\n        methodinfo.methodID = methodID;\n        return true;\n    }\n\n    bool JniHelper::getMethodInfo_DefaultClassLoader(JniMethodInfo &methodinfo,\n                                                     const char *className,\n                                                     const char *methodName,\n                                                     const char *paramCode) {\n        if ((NULL == className) ||\n            (NULL == methodName) ||\n            (NULL == paramCode)) {\n            return false;\n        }\n\n        JNIEnv *pEnv = JniHelper::getEnv();\n        if (!pEnv) {\n            return false;\n        }\n\n        jclass classID = pEnv->FindClass(className);\n        if (! classID) {\n            LOGD(\"Failed to find class %s\", className);\n            return false;\n        }\n\n        jmethodID methodID = pEnv->GetMethodID(classID, methodName, paramCode);\n        if (! methodID) {\n            LOGD(\"Failed to find method id of %s\", methodName);\n            pEnv->ExceptionClear();\n            return false;\n        }\n\n        methodinfo.classID = classID;\n        methodinfo.env = pEnv;\n        methodinfo.methodID = methodID;\n\n        return true;\n    }\n\n    bool JniHelper::getMethodInfo(JniMethodInfo &methodinfo,\n                                  const char *className,\n                                  const char *methodName,\n                                  const char *paramCode) {\n        if ((NULL == className) ||\n            (NULL == methodName) ||\n            (NULL == paramCode)) {\n            return false;\n        }\n\n        JNIEnv *pEnv = JniHelper::getEnv();\n        if (!pEnv) {\n            return false;\n        }\n\n        jclass classID = _getClassID(className);\n        if (! classID) {\n            LOGD(\"Failed to find class %s\", className);\n            return false;\n        }\n\n        jmethodID methodID = pEnv->GetMethodID(classID, methodName, paramCode);\n        if (! methodID) {\n            LOGD(\"Failed to find method id of %s\", methodName);\n            pEnv->ExceptionClear();\n            return false;\n        }\n\n        methodinfo.classID = classID;\n        methodinfo.env = pEnv;\n        methodinfo.methodID = methodID;\n\n        return true;\n    }\n\n    std::string JniHelper::jstring2string(jstring jstr) {\n        if (jstr == NULL) {\n            return \"\";\n        }\n        \n        JNIEnv *pEnv = JniHelper::getEnv();\n        if (!pEnv) {\n            return NULL;\n        }\n\n        const char* chars = pEnv->GetStringUTFChars(jstr, NULL);\n        std::string ret(chars);\n        pEnv->ReleaseStringUTFChars(jstr, chars);\n\n        return ret;\n    }\n\n} //namespace cocos2d\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/jni/JniHelper.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __ANDROID_JNI_HELPER_H__\n#define __ANDROID_JNI_HELPER_H__\n\n#include <jni.h>\n#include <string>\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\ntypedef struct JniMethodInfo_\n{\n    JNIEnv *    env;\n    jclass      classID;\n    jmethodID   methodID;\n} JniMethodInfo;\n\nclass CC_DLL JniHelper\n{\npublic:\n    static void setJavaVM(JavaVM *javaVM);\n    static JavaVM* getJavaVM();\n    static JNIEnv* getEnv();\n\n    static bool setClassLoaderFrom(jobject nativeActivityInstance);\n    static bool getStaticMethodInfo(JniMethodInfo &methodinfo,\n                                    const char *className,\n                                    const char *methodName,\n                                    const char *paramCode);\n    static bool getMethodInfo(JniMethodInfo &methodinfo,\n                              const char *className,\n                              const char *methodName,\n                              const char *paramCode);\n\n    static std::string jstring2string(jstring str);\n\n    static jmethodID loadclassMethod_methodID;\n    static jobject classloader;\n\nprivate:\n    static void detach_current_thread (void *env);\n    static bool cacheEnv(JavaVM* jvm);\n\n    static bool getMethodInfo_DefaultClassLoader(JniMethodInfo &methodinfo,\n                                                 const char *className,\n                                                 const char *methodName,\n                                                 const char *paramCode);\n\n    static JavaVM* _psJavaVM;\n    static JNIEnv* env;\n};\n\nNS_CC_END\n\n#endif // __ANDROID_JNI_HELPER_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/nativeactivity.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"nativeactivity.h\"\n\n#include <jni.h>\n#include <errno.h>\n\n#include <EGL/egl.h>\n#include <GLES/gl.h>\n\n#include <android/sensor.h>\n#include <android/log.h>\n#include <android_native_app_glue.h>\n#include <android/configuration.h>\n\n#include <pthread.h>\n#include <chrono>\n\n#include \"CCDirector.h\"\n#include \"CCApplication.h\"\n#include \"CCEventType.h\"\n#include \"CCFileUtilsAndroid.h\"\n#include \"jni/JniHelper.h\"\n\n#include \"CCEGLView.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"CCShaderCache.h\"\n#include \"CCTextureCache.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventAcceleration.h\"\n#include \"CCEventKeyboard.h\"\n#include \"CCEventCustom.h\"\n\n#include \"jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n\n#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, \"cocos2dx/nativeactivity.cpp\", __VA_ARGS__))\n#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, \"cocos2dx/nativeactivity.cpp\", __VA_ARGS__))\n#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, \"cocos2dx/nativeactivity.cpp\", __VA_ARGS__))\n\n#define LOG_RENDER_DEBUG(...)\n// #define LOG_RENDER_DEBUG(...)  ((void)__android_log_print(ANDROID_LOG_INFO, \"cocos2dx/nativeactivity.cpp\", __VA_ARGS__))\n\n#define LOG_EVENTS_DEBUG(...)\n// #define LOG_EVENTS_DEBUG(...)  ((void)__android_log_print(ANDROID_LOG_INFO, \"cocos2dx/nativeactivity.cpp\", __VA_ARGS__))\n\n/* For debug builds, always enable the debug traces in this library */\n#ifndef NDEBUG\n#  define LOGV(...)  ((void)__android_log_print(ANDROID_LOG_VERBOSE, \"cocos2dx/nativeactivity.cpp\", __VA_ARGS__))\n#else\n#  define LOGV(...)  ((void)0)\n#endif\n\nvoid cocos_android_app_init(struct android_app* app);\n\n/**\n * Our saved state data.\n */\nstruct saved_state {\n    float angle;\n    int32_t x;\n    int32_t y;\n};\n\n/**\n * Shared state for our app.\n */\nstruct engine {\n    struct android_app* app;\n\n    ASensorManager* sensorManager;\n    const ASensor* accelerometerSensor;\n    ASensorEventQueue* sensorEventQueue;\n\n    int animating;\n    EGLDisplay display;\n    EGLSurface surface;\n    EGLContext context;\n    int32_t width;\n    int32_t height;\n    struct saved_state state;\n};\n\nstatic bool isContentRectChanged = false;\nstatic std::chrono::steady_clock::time_point timeRectChanged;\n\nstatic struct engine engine;\n\nstatic char* editboxText = NULL;\nextern EditTextCallback s_pfEditTextCallback;\nextern void* s_ctx;\n\nextern \"C\" {\n\tJNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetEditTextDialogResult(JNIEnv * env, jobject obj, jbyteArray text) {\t\n\t\tjsize  size = env->GetArrayLength(text);\n\t\tpthread_mutex_lock(&(engine.app->mutex));\n\t\tif (size > 0) {\n\t\t\t\n\n\t\t\tjbyte * data = (jbyte*)env->GetByteArrayElements(text, 0);\n\t\t\tchar* pBuf = (char*)malloc(size+1);\n\t\t\tif (pBuf != NULL) {\n\t\t\t\tmemcpy(pBuf, data, size);\n\t\t\t\tpBuf[size] = '\\0';\n\t\t\t\teditboxText = pBuf;\t\t\t\t\n\t\t\t}\n\t\t\tenv->ReleaseByteArrayElements(text, data, 0);\n\t\t\t\n\t\t} else {\n\t\t\tchar* pBuf = (char*)malloc(1);\n\t\t\tpBuf[0] = '\\0';\n\t\t\teditboxText = pBuf;\t\t\t\n\t\t}\n\t\tpthread_cond_broadcast(&engine.app->cond);\n\t\tpthread_mutex_unlock(&(engine.app->mutex));\n\t}\n}\n\ntypedef struct cocos_dimensions {\n    int w;\n    int h;\n} cocos_dimensions;\n\nstatic void cocos_init(cocos_dimensions d, struct android_app* app) {\n    LOGI(\"cocos_init(...)\");\n    pthread_t thisthread = pthread_self();\n    LOGI(\"pthread_self() = %X\", thisthread);\n\n    cocos2d::FileUtilsAndroid::setassetmanager(app->activity->assetManager);\n\n    if (!cocos2d::Director::getInstance()->getOpenGLView())\n    {\n        cocos2d::EGLView *view = cocos2d::EGLView::getInstance();\n        view->setFrameSize(d.w, d.h);\n\n        cocos_android_app_init(app);\n\n        cocos2d::Application::getInstance()->run();\n    }\n    else\n    {\n        cocos2d::GL::invalidateStateCache();\n        cocos2d::ShaderCache::getInstance()->reloadDefaultShaders();\n        cocos2d::DrawPrimitives::init();\n        cocos2d::VolatileTextureMgr::reloadAllTextures();\n        cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND);\n        cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent);\n        cocos2d::Director::getInstance()->setGLDefaultValues(); \n    }\n}\n\n/**\n * Initialize an EGL context for the current display.\n */\nstatic cocos_dimensions engine_init_display(struct engine* engine) {\n    cocos_dimensions r;\n    r.w = -1;\n    r.h = -1;\n\n    // initialize OpenGL ES and EGL\n\n    /*\n     * Here specify the attributes of the desired configuration.\n     * Below, we select an EGLConfig with at least 8 bits per color\n     * component compatible with on-screen windows\n     */\n    const EGLint attribs[] = {\n            EGL_SURFACE_TYPE, EGL_WINDOW_BIT,\n            EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,\n            EGL_BLUE_SIZE, 5,\n            EGL_GREEN_SIZE, 6,\n            EGL_RED_SIZE, 5,\n            EGL_DEPTH_SIZE, 16,\n            EGL_STENCIL_SIZE, 8,\n            EGL_NONE\n    };\n    EGLint w, h, dummy, format;\n    EGLint numConfigs;\n    EGLConfig config;\n    EGLSurface surface;\n    EGLContext context;\n\n    EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);\n\n    eglInitialize(display, 0, 0);\n\n    /* Here, the application chooses the configuration it desires. In this\n     * sample, we have a very simplified selection process, where we pick\n     * the first EGLConfig that matches our criteria */\n    eglChooseConfig(display, attribs, &config, 1, &numConfigs);\n\n    /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is\n     * guaranteed to be accepted by ANativeWindow_setBuffersGeometry().\n     * As soon as we picked a EGLConfig, we can safely reconfigure the\n     * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */\n    eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);\n\n    ANativeWindow_setBuffersGeometry(engine->app->window, 0, 0, format);\n\n    surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);\n\n    const EGLint eglContextAttrs[] =\n    {\n        EGL_CONTEXT_CLIENT_VERSION, 2,\n        EGL_NONE\n    };\n\n    context = eglCreateContext(display, config, NULL, eglContextAttrs);\n\n    if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) {\n        LOGW(\"Unable to eglMakeCurrent\");\n        return r;\n    }\n\n    eglQuerySurface(display, surface, EGL_WIDTH, &w);\n    eglQuerySurface(display, surface, EGL_HEIGHT, &h);\n\n    engine->display = display;\n    engine->context = context;\n    engine->surface = surface;\n    engine->width = w;\n    engine->height = h;\n    engine->state.angle = 0;\n\n    r.w = w;\n    r.h = h;\n\n    return r;\n}\n\n/**\n * Invoke the dispatching of the next bunch of Runnables in the Java-Land\n */\nstatic bool s_methodInitialized = false;\nstatic void dispatch_pending_runnables() {\n    static cocos2d::JniMethodInfo info;\n    \n    if (!s_methodInitialized) {\n        s_methodInitialized = cocos2d::JniHelper::getStaticMethodInfo(\n            info,\n            \"org/cocos2dx/lib/Cocos2dxHelper\",\n            \"dispatchPendingRunnables\",\n            \"()V\"\n        );\n\n        if (!s_methodInitialized) {\n            LOGW(\"Unable to dispatch pending Runnables!\");\n            return;\n        }\n    }\n\n    info.env->CallStaticVoidMethod(info.classID, info.methodID);\n}\n\n/**\n * Just the current frame in the display.\n */\nstatic void engine_draw_frame(struct engine* engine) {\n    LOG_RENDER_DEBUG(\"engine_draw_frame(...)\");\n    pthread_t thisthread = pthread_self();\n    LOG_RENDER_DEBUG(\"pthread_self() = %X\", thisthread);\n\n    if (engine->display == NULL) {\n        // No display.\n        LOGW(\"engine_draw_frame : No display.\");\n        return;\n    }\n\n    dispatch_pending_runnables();\n    cocos2d::Director::getInstance()->mainLoop();\n    LOG_RENDER_DEBUG(\"engine_draw_frame : just called cocos' mainLoop()\");\n\n    /* // Just fill the screen with a color. */\n    /* glClearColor(((float)engine->state.x)/engine->width, engine->state.angle, */\n    /*         ((float)engine->state.y)/engine->height, 1); */\n    /* glClear(GL_COLOR_BUFFER_BIT); */\t\n\t\n\tif (s_pfEditTextCallback && editboxText)\n\t{\n\t\ts_pfEditTextCallback(editboxText, s_ctx);\n\t\tfree(editboxText);\n\t\teditboxText = NULL;\n\t}\t\n\n    eglSwapBuffers(engine->display, engine->surface);\n}\n\n/**\n * Tear down the EGL context currently associated with the display.\n */\nstatic void engine_term_display(struct engine* engine) {\n    if (engine->display != EGL_NO_DISPLAY) {\n        eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);\n        if (engine->context != EGL_NO_CONTEXT) {\n            eglDestroyContext(engine->display, engine->context);\n        }\n        if (engine->surface != EGL_NO_SURFACE) {\n            eglDestroySurface(engine->display, engine->surface);\n        }\n        eglTerminate(engine->display);\n    }\n    engine->animating = 0;\n    engine->display = EGL_NO_DISPLAY;\n    engine->context = EGL_NO_CONTEXT;\n    engine->surface = EGL_NO_SURFACE;\n}\n\n/*\n * Get X, Y positions and ID's for all pointers\n */\nstatic void getTouchPos(AInputEvent *event, int ids[], float xs[], float ys[]) {\n    int pointerCount = AMotionEvent_getPointerCount(event);\n    for(int i = 0; i < pointerCount; ++i) {\n        ids[i] = AMotionEvent_getPointerId(event, i);\n        xs[i] = AMotionEvent_getX(event, i);\n        ys[i] = AMotionEvent_getY(event, i);\n    }\n}\n\n/*\n * Handle Touch Inputs\n */\nstatic int32_t handle_touch_input(AInputEvent *event) {\n\n    pthread_t thisthread = pthread_self();\n    LOG_EVENTS_DEBUG(\"handle_touch_input(%X), pthread_self() = %X\", event, thisthread);\n\n    switch(AMotionEvent_getAction(event) &\n           AMOTION_EVENT_ACTION_MASK) {\n\n    case AMOTION_EVENT_ACTION_DOWN:\n        {\n            LOG_EVENTS_DEBUG(\"AMOTION_EVENT_ACTION_DOWN\");\n            int pointerId = AMotionEvent_getPointerId(event, 0);\n            float xP = AMotionEvent_getX(event,0);\n            float yP = AMotionEvent_getY(event,0);\n\n            LOG_EVENTS_DEBUG(\"Event: Action DOWN x=%f y=%f pointerID=%d\\n\",\n                 xP, yP, pointerId);\n            float x = xP;\n            float y = yP;\n\n            cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &pointerId, &x, &y);\n            return 1;\n        }\n        break;\n\n    case AMOTION_EVENT_ACTION_POINTER_DOWN:\n        {\n            LOG_EVENTS_DEBUG(\"AMOTION_EVENT_ACTION_POINTER_DOWN\");\n            int pointerIndex = AMotionEvent_getAction(event) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;\n            int pointerId = AMotionEvent_getPointerId(event, pointerIndex);\n            float xP = AMotionEvent_getX(event,pointerIndex);\n            float yP = AMotionEvent_getY(event,pointerIndex);\n\n            LOG_EVENTS_DEBUG(\"Event: Action POINTER DOWN x=%f y=%f pointerID=%d\\n\",\n                 xP, yP, pointerId);\n            float x = xP;\n            float y = yP;\n\n            cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &pointerId, &x, &y);\n            return 1;\n        }\n        break;\n\n    case AMOTION_EVENT_ACTION_MOVE:\n        {\n            LOG_EVENTS_DEBUG(\"AMOTION_EVENT_ACTION_MOVE\");\n            int pointerCount = AMotionEvent_getPointerCount(event);\n            int ids[pointerCount];\n            float xs[pointerCount], ys[pointerCount];\n            getTouchPos(event, ids, xs, ys);\n\t\t\tcocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(pointerCount, ids, xs, ys);\n            return 1;\n        }\n        break;\n\n    case AMOTION_EVENT_ACTION_UP:\n        {\n            LOG_EVENTS_DEBUG(\"AMOTION_EVENT_ACTION_UP\");\n            int pointerId = AMotionEvent_getPointerId(event, 0);\n            float xP = AMotionEvent_getX(event,0);\n            float yP = AMotionEvent_getY(event,0);\n            LOG_EVENTS_DEBUG(\"Event: Action UP x=%f y=%f pointerID=%d\\n\",\n                 xP, yP, pointerId);\n            float x = xP;\n            float y = yP;\n\n            cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &pointerId, &x, &y);\n            return 1;\n        }\n        break;\n\n    case AMOTION_EVENT_ACTION_POINTER_UP:\n        {\n            LOG_EVENTS_DEBUG(\"AMOTION_EVENT_ACTION_POINTER_UP\");\n            int pointerIndex = AMotionEvent_getAction(event) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;\n            int pointerId = AMotionEvent_getPointerId(event, pointerIndex);\n            float xP = AMotionEvent_getX(event,pointerIndex);\n            float yP = AMotionEvent_getY(event,pointerIndex);\n            LOG_EVENTS_DEBUG(\"Event: Action POINTER UP x=%f y=%f pointerID=%d\\n\",\n                 xP, yP, pointerIndex);\n            float x = xP;\n            float y = yP;\n\n            cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &pointerId, &x, &y);\n            return 1;\n        }\n        break;\n\n    case AMOTION_EVENT_ACTION_CANCEL:\n        {\n            LOG_EVENTS_DEBUG(\"AMOTION_EVENT_ACTION_CANCEL\");\n            int pointerCount = AMotionEvent_getPointerCount(event);\n            int ids[pointerCount];\n            float xs[pointerCount], ys[pointerCount];\n            getTouchPos(event, ids, xs, ys);\n\t\t\tcocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(pointerCount, ids, xs, ys);\n            return 1;\n        }\n        break;\n\n    default:\n        LOG_EVENTS_DEBUG(\"handle_touch_input() default case.... NOT HANDLE\");\n        return 0;\n        break;\n    }\n}\n\n/*\n* Handle Key Inputs\n*/\nstatic int32_t handle_key_input(AInputEvent *event)\n{\n    if (AKeyEvent_getAction(event) == AKEY_EVENT_ACTION_UP)\n    {\n        auto dispatcher = cocos2d::Director::getInstance()->getEventDispatcher();\n\n        switch (AKeyEvent_getKeyCode(event))\n        {\n        case AKEYCODE_BACK:\t\n            {\n                cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_BACKSPACE, false);\n                dispatcher->dispatchEvent(&event);\n            }\n            return 1;\n        case AKEYCODE_MENU:\n            {\n                cocos2d::EventKeyboard event(cocos2d::EventKeyboard::KeyCode::KEY_MENU, false);\n                dispatcher->dispatchEvent(&event);\n            }\n            return 1;\n        default:\n            break;\n        }\n    }\n    return 0;\n}\n\n/**\n * Process the next input event.\n */\nstatic int32_t engine_handle_input(struct android_app* app, AInputEvent* event) {\n\n    pthread_t thisthread = pthread_self();\n    LOG_EVENTS_DEBUG(\"engine_handle_input(%X, %X), pthread_self() = %X\", app, event, thisthread);\n\n    struct engine* engine = (struct engine*)app->userData;\n\n    if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {\n        engine->animating = 1;\n        engine->state.x = AMotionEvent_getX(event, 0);\n        engine->state.y = AMotionEvent_getY(event, 0);\n\n        return handle_touch_input(event);\n    }\n\telse\n\t\treturn handle_key_input(event);\n\n    return 0;\n}\n\nvoid enableAccelerometerJni(void) {\n    LOGI(\"enableAccelerometerJni()\");\n\n    if (engine.accelerometerSensor != NULL) {\n        ASensorEventQueue_enableSensor(engine.sensorEventQueue,\n                                       engine.accelerometerSensor);\n\n        // Set a default sample rate\n        // We'd like to get 60 events per second (in us).\n        ASensorEventQueue_setEventRate(engine.sensorEventQueue,\n                                       engine.accelerometerSensor, (1000L/60)*1000);\n    }\n}\n\nvoid disableAccelerometerJni(void) {\n    LOGI(\"disableAccelerometerJni()\");\n\n    if (engine.accelerometerSensor != NULL) {\n        ASensorEventQueue_disableSensor(engine.sensorEventQueue,\n                                        engine.accelerometerSensor);\n    }\n}\n\nvoid setAccelerometerIntervalJni(float interval) {\n    LOGI(\"setAccelerometerIntervalJni(%f)\", interval);\n        // We'd like to get 60 events per second (in us).\n        ASensorEventQueue_setEventRate(engine.sensorEventQueue,\n                                       engine.accelerometerSensor, interval * 1000000L);\n}\n\n/**\n * Process the next main command.\n */\nstatic void engine_handle_cmd(struct android_app* app, int32_t cmd) {\n    struct engine* engine = (struct engine*)app->userData;\n    switch (cmd) {\n        case APP_CMD_SAVE_STATE:\n            // The system has asked us to save our current state.  Do so.\n            engine->app->savedState = malloc(sizeof(struct saved_state));\n            *((struct saved_state*)engine->app->savedState) = engine->state;\n            engine->app->savedStateSize = sizeof(struct saved_state);\n            break;\n        case APP_CMD_INIT_WINDOW:\n            // The window is being shown, get it ready.\n            if (engine->app->window != NULL) {\n                cocos_dimensions d = engine_init_display(engine);\n                if ((d.w > 0) &&\n                    (d.h > 0)) {\n                    cocos2d::JniHelper::setJavaVM(app->activity->vm);\n                    cocos2d::JniHelper::setClassLoaderFrom(app->activity->clazz);\n\n                    // call Cocos2dxHelper.init()\n                    cocos2d::JniMethodInfo ccxhelperInit;\n                    if (!cocos2d::JniHelper::getStaticMethodInfo(ccxhelperInit,\n                                                                 \"org/cocos2dx/lib/Cocos2dxHelper\",\n                                                                 \"init\",\n                                                                 \"(Landroid/app/Activity;)V\")) {\n                        LOGI(\"cocos2d::JniHelper::getStaticMethodInfo(ccxhelperInit) FAILED\");\n                    }\n                    ccxhelperInit.env->CallStaticVoidMethod(ccxhelperInit.classID,\n                                                            ccxhelperInit.methodID,\n                                                            app->activity->clazz);\n\n                    cocos_init(d, app);\n                }\n                engine->animating = 1;\n                engine_draw_frame(engine);\n            }\n            break;\n        case APP_CMD_TERM_WINDOW:\n            // The window is being hidden or closed, clean it up.\n            engine_term_display(engine);\n            break;\n        case APP_CMD_GAINED_FOCUS:\n            if (cocos2d::Director::getInstance()->getOpenGLView()) {\n                cocos2d::Application::getInstance()->applicationWillEnterForeground();\n\t\t\t\tengine->animating = 1;\n            }\n\n            break;\n        case APP_CMD_LOST_FOCUS:\n            {\n                cocos2d::Application::getInstance()->applicationDidEnterBackground();\n                cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);\n                cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);\n                // Also stop animating.\n                engine->animating = 0;\n                engine_draw_frame(engine);\n            }\n            break;\n    }\n}\n\nstatic void onContentRectChanged(ANativeActivity* activity, const ARect* rect) {\n\ttimeRectChanged = std::chrono::steady_clock::now();\n\tisContentRectChanged = true;\n}\n\nstatic void process_input(struct android_app* app, struct android_poll_source* source) {\n    AInputEvent* event = NULL;\n    while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) {\n        LOGV(\"New input event: type=%d\\n\", AInputEvent_getType(event));\n        if (AInputQueue_preDispatchEvent(app->inputQueue, event)) {\n            continue;\n        }\n        int32_t handled = 0;\n        if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event);\n        AInputQueue_finishEvent(app->inputQueue, event, handled);\n    }\n}\n/**\n * This is the main entry point of a native application that is using\n * android_native_app_glue.  It runs in its own thread, with its own\n * event loop for receiving input events and doing other things.\n */\nvoid android_main(struct android_app* state) {\n\n    // Make sure glue isn't stripped.\n    app_dummy();\n\n    memset(&engine, 0, sizeof(engine));\n    state->userData = &engine;\n    state->onAppCmd = engine_handle_cmd;\n    state->onInputEvent = engine_handle_input;\n    state->inputPollSource.process = process_input;\n    engine.app = state;\n\n    // Prepare to monitor accelerometer\n    engine.sensorManager = ASensorManager_getInstance();\n    engine.accelerometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager,\n            ASENSOR_TYPE_ACCELEROMETER);\n    engine.sensorEventQueue = ASensorManager_createEventQueue(engine.sensorManager,\n            state->looper, LOOPER_ID_USER, NULL, NULL);\n\n    if (state->savedState != NULL) {\n        // We are starting with a previous saved state; restore from it.\n        engine.state = *(struct saved_state*)state->savedState;\n    }\n\n\t// Screen size change support\n\tstate->activity->callbacks->onContentRectChanged = onContentRectChanged;\n\n    // loop waiting for stuff to do.\n\n    while (1) {\n        // Read all pending events.\n        int ident;\n        int events;\n        struct android_poll_source* source;\n\n        // If not animating, we will block forever waiting for events.\n        // If animating, we loop until all events are read, then continue\n        // to draw the next frame of animation.\n        while ((ident=ALooper_pollAll(engine.animating ? 0 : -1, NULL, &events,\n                (void**)&source)) >= 0) {\n\n            // Process this event.\n            if (source != NULL) {\n                source->process(state, source);\n            }\n\n            // If a sensor has data, process it now.\n            if (ident == LOOPER_ID_USER) {\n                if (engine.accelerometerSensor != NULL) {\n                    ASensorEvent event;\n                    while (ASensorEventQueue_getEvents(engine.sensorEventQueue,\n                            &event, 1) > 0) {\n\n                        LOG_EVENTS_DEBUG(\"accelerometer: x=%f y=%f z=%f\",\n                                event.acceleration.x, event.acceleration.y,\n                                event.acceleration.z);\n\n                        AConfiguration* _currentconf = AConfiguration_new();\n                        AConfiguration_fromAssetManager(_currentconf,\n                                                        state->activity->assetManager);\n                        static int32_t _orientation = AConfiguration_getOrientation(_currentconf);\n\n                        if (ACONFIGURATION_ORIENTATION_LAND != _orientation) {\n                            // ACONFIGURATION_ORIENTATION_ANY\n                            // ACONFIGURATION_ORIENTATION_PORT\n                            // ACONFIGURATION_ORIENTATION_SQUARE\n                            cocos2d::Acceleration acc;\n                            acc.x = -event.acceleration.x/10;\n                            acc.y = -event.acceleration.y/10;\n                            acc.z = event.acceleration.z/10;\n                            acc.timestamp = 0;\n                            cocos2d::EventAcceleration accEvent(acc);\n                            auto dispatcher = cocos2d::Director::getInstance()->getEventDispatcher();\n                            dispatcher->dispatchEvent(&accEvent);\n                        } else {\n                            // ACONFIGURATION_ORIENTATION_LAND\n                            // swap x and y parameters\n                            cocos2d::Acceleration acc;\n                            acc.x = event.acceleration.y/10;\n                            acc.y = -event.acceleration.x/10;\n                            acc.z = event.acceleration.z/10;\n                            acc.timestamp = 0;\n                            cocos2d::EventAcceleration accEvent(acc);\n                            auto dispatcher = cocos2d::Director::getInstance()->getEventDispatcher();\n                            dispatcher->dispatchEvent(&accEvent);\n                        }\n                    }\n                }\n            }\n\n            // Check if we are exiting.\n            if (state->destroyRequested != 0) {\n                engine_term_display(&engine);\n\n                memset(&engine, 0, sizeof(engine));\n                s_methodInitialized = false;\n                return;\n            }\n        }\n\n        if (engine.animating) {\n            // Done with events; draw next animation frame.\n            engine.state.angle += .01f;\n            if (engine.state.angle > 1) {\n                engine.state.angle = 0;\n            }\n\n            // Drawing is throttled to the screen update rate, so there\n            // is no need to do timing here.\n            LOG_RENDER_DEBUG(\"android_main : engine.animating\");\n            engine_draw_frame(&engine);\n        } else {\n            LOG_RENDER_DEBUG(\"android_main : !engine.animating\");\n        }\n\n\t\t// Check if screen size changed\n\t\tif (isContentRectChanged) {\n\t\t\tstd::chrono::duration<int, std::milli> duration(\n\t\t\t\t\tstd::chrono::duration_cast<std::chrono::duration<int, std::milli>>(std::chrono::steady_clock::now() - timeRectChanged));\n\n\t\t\t// Wait about 30 ms to get new width and height. Without waiting we can get old values sometime\n\t\t\tif (duration.count() > 30) {\n\t\t\t\tisContentRectChanged = false;\n\n\t\t\t\tint32_t newWidth = ANativeWindow_getWidth(engine.app->window);\n\t\t\t\tint32_t newHeight = ANativeWindow_getHeight(engine.app->window);\n\t\t\t\tcocos2d::Application::getInstance()->applicationScreenSizeChanged(newWidth, newHeight);\n\t\t\t}\n\t\t}\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/android/nativeactivity.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __COCOSNATIVEACTIVITY_H__\n#define __COCOSNATIVEACTIVITY_H__\n\n/**\n * This is the interface to the Android native activity\n */\n\nvoid enableAccelerometerJni(void);\nvoid disableAccelerometerJni(void);\nvoid setAccelerometerIntervalJni(float interval);\n\n#endif // __COCOSNATIVEACTIVITY_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/apple/CCFileUtilsApple.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __CC_FILEUTILS_APPLE_H__\n#define __CC_FILEUTILS_APPLE_H__\n\n#include \"CCFileUtils.h\"\n#include <string>\n#include <vector>\n#include \"CCPlatformMacros.h\"\n#include \"ccTypes.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n//! @brief  Helper class to handle file operations\nclass CC_DLL FileUtilsApple : public FileUtils\n{\npublic:\n    /* override funtions */\n    virtual std::string getWritablePath() const override;\n    virtual bool isFileExist(const std::string& filePath) const override;\n    virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) override;\n    \n    virtual ValueMap getValueMapFromFile(const std::string& filename) override;\n    virtual bool writeToFile(ValueMap& dict, const std::string& fullPath) override;\n    \n    virtual ValueVector getValueVectorFromFile(const std::string& filename) override;\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_FILEUTILS_APPLE_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/apple/CCFileUtilsApple.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2011      Zynga Inc.\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import <Foundation/Foundation.h>\n\n#include <string>\n#include <stack>\n#include \"CCString.h\"\n#include \"CCFileUtils.h\"\n#include \"CCDirector.h\"\n#include \"CCSAXParser.h\"\n#include \"CCDictionary.h\"\n#include \"unzip.h\"\n\n#include \"CCFileUtilsApple.h\"\n\nNS_CC_BEGIN\n\nstatic void addValueToDict(id nsKey, id nsValue, ValueMap& dict);\nstatic void addObjectToNSDict(const std::string& key, const Value& value, NSMutableDictionary *dict);\n\nstatic void addItemToArray(id item, ValueVector& array)\n{\n    // add string value into array\n    if ([item isKindOfClass:[NSString class]])\n    {\n        array.push_back(Value([item UTF8String]));\n        return;\n    }\n    \n    // add number value into array(such as int, float, bool and so on)\n    if ([item isKindOfClass:[NSNumber class]])\n    {\n        array.push_back(Value([item doubleValue]));\n        return;\n    }\n    \n    // add dictionary value into array\n    if ([item isKindOfClass:[NSDictionary class]])\n    {\n        ValueMap dict;\n        for (id subKey in [item allKeys])\n        {\n            id subValue = [item objectForKey:subKey];\n            addValueToDict(subKey, subValue, dict);\n        }\n        \n        array.push_back(Value(dict));\n        return;\n    }\n    \n    // add array value into array\n    if ([item isKindOfClass:[NSArray class]])\n    {\n        ValueVector subArray;\n        for (id subItem in item)\n        {\n            addItemToArray(subItem, subArray);\n        }\n        array.push_back(Value(subArray));\n        return;\n    }\n}\n\nstatic void addObjectToNSArray(const Value& value, NSMutableArray *array)\n{\n    // add string into array\n    if (value.getType() == Value::Type::STRING)\n    {\n        NSString *element = [NSString stringWithCString:value.asString().c_str() encoding:NSUTF8StringEncoding];\n        [array addObject:element];\n        return;\n    }\n    \n    // add array into array\n    if (value.getType() == Value::Type::VECTOR)\n    {\n        NSMutableArray *element = [NSMutableArray array];\n        \n        ValueVector valueArray = value.asValueVector();\n        \n        for (const auto &e : valueArray)\n        {\n            addObjectToNSArray(e, element);\n        }\n        \n        [array addObject:element];\n        return;\n    }\n    \n    // add dictionary value into array\n    if (value.getType() == Value::Type::MAP)\n    {\n        NSMutableDictionary *element = [NSMutableDictionary dictionary];\n\n        auto valueDict = value.asValueMap();\n        for (auto iter = valueDict.begin(); iter != valueDict.end(); ++iter)\n        {\n            addObjectToNSDict(iter->first, iter->second, element);\n        }\n        \n        [array addObject:element];\n    }\n}\n\nstatic void addValueToDict(id nsKey, id nsValue, ValueMap& dict)\n{\n    // the key must be a string\n    CCASSERT([nsKey isKindOfClass:[NSString class]], \"The key should be a string!\");\n    std::string key = [nsKey UTF8String];\n    \n    // the value is a string\n    if ([nsValue isKindOfClass:[NSString class]])\n    {\n        dict[key] = Value([nsValue UTF8String]);\n        return;\n    }\n    \n    // the value is a number\n    if ([nsValue isKindOfClass:[NSNumber class]])\n    {\n        dict[key] = Value([nsValue doubleValue]);\n        return;\n    }\n    \n    // the value is a new dictionary\n    if ([nsValue isKindOfClass:[NSDictionary class]])\n    {\n        ValueMap subDict;\n        \n        for (id subKey in [nsValue allKeys])\n        {\n            id subValue = [nsValue objectForKey:subKey];\n            addValueToDict(subKey, subValue, subDict);\n        }\n        dict[key] = Value(subDict);\n        return;\n    }\n    \n    // the value is a array\n    if ([nsValue isKindOfClass:[NSArray class]])\n    {\n        ValueVector valueArray;\n\n        for (id item in nsValue)\n        {\n            addItemToArray(item, valueArray);\n        }\n        dict[key] = Value(valueArray);\n        return;\n    }\n}\n\nstatic void addObjectToNSDict(const std::string& key, const Value& value, NSMutableDictionary *dict)\n{\n    NSString *NSkey = [NSString stringWithCString:key.c_str() encoding:NSUTF8StringEncoding];\n    \n    // the object is a Dictionary\n    if (value.getType() == Value::Type::MAP)\n    {\n        NSMutableDictionary *dictElement = [NSMutableDictionary dictionary];\n        ValueMap subDict = value.asValueMap();\n        for (auto iter = subDict.begin(); iter != subDict.end(); ++iter)\n        {\n            addObjectToNSDict(iter->first, iter->second, dictElement);\n        }\n        \n        [dict setObject:dictElement forKey:NSkey];\n        return;\n    }\n    \n    // the object is a String\n    if (value.getType() == Value::Type::STRING)\n    {\n        NSString *strElement = [NSString stringWithCString:value.asString().c_str() encoding:NSUTF8StringEncoding];\n        [dict setObject:strElement forKey:NSkey];\n        return;\n    }\n    \n    // the object is a Array\n    if (value.getType() == Value::Type::VECTOR)\n    {\n        NSMutableArray *arrElement = [NSMutableArray array];\n        \n        ValueVector array = value.asValueVector();\n        \n        for(const auto& v : array)\n        {\n            addObjectToNSArray(v, arrElement);\n        }\n\n        [dict setObject:arrElement forKey:NSkey];\n        return;\n    }\n}\n\n\n#pragma mark - FileUtils\n\nstatic NSFileManager* s_fileManager = [NSFileManager defaultManager];\n\nFileUtils* FileUtils::getInstance()\n{\n    if (s_sharedFileUtils == nullptr)\n    {\n        s_sharedFileUtils = new FileUtilsApple();\n        if(!s_sharedFileUtils->init())\n        {\n          delete s_sharedFileUtils;\n          s_sharedFileUtils = nullptr;\n          CCLOG(\"ERROR: Could not init CCFileUtilsApple\");\n        }\n    }\n    return s_sharedFileUtils;\n}\n\n\nstd::string FileUtilsApple::getWritablePath() const\n{\n    // save to document folder\n    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);\n    NSString *documentsDirectory = [paths objectAtIndex:0];\n    std::string strRet = [documentsDirectory UTF8String];\n    strRet.append(\"/\");\n    return strRet;\n}\n\nbool FileUtilsApple::isFileExist(const std::string& filePath) const\n{\n    if(filePath.length() == 0)\n    {\n        return false;\n    }\n\n    bool ret = false;\n    \n    if (filePath[0] != '/')\n    {\n        std::string path;\n        std::string file;\n        size_t pos = filePath.find_last_of(\"/\");\n        if (pos != std::string::npos)\n        {\n            file = filePath.substr(pos+1);\n            path = filePath.substr(0, pos+1);\n        }\n        else\n        {\n            file = filePath;\n        }\n        \n        NSString* fullpath = [[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String:file.c_str()]\n                                                             ofType:nil\n                                                        inDirectory:[NSString stringWithUTF8String:path.c_str()]];\n        if (fullpath != nil) {\n            ret = true;\n        }\n    }\n    else\n    {\n        // Search path is an absolute path.\n        if ([s_fileManager fileExistsAtPath:[NSString stringWithUTF8String:filePath.c_str()]]) {\n            ret = true;\n        }\n    }\n    \n    return ret;\n}\n\nstd::string FileUtilsApple::getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename)\n{\n    if (directory[0] != '/')\n    {\n        NSString* fullpath = [[NSBundle mainBundle] pathForResource:[NSString stringWithUTF8String:filename.c_str()]\n                                                             ofType:nil\n                                                        inDirectory:[NSString stringWithUTF8String:directory.c_str()]];\n        if (fullpath != nil) {\n            return [fullpath UTF8String];\n        }\n    }\n    else\n    {\n        std::string fullPath = directory+filename;\n        // Search path is an absolute path.\n        if ([s_fileManager fileExistsAtPath:[NSString stringWithUTF8String:fullPath.c_str()]]) {\n            return fullPath;\n        }\n    }\n    return \"\";\n}\n\nValueMap FileUtilsApple::getValueMapFromFile(const std::string& filename)\n{\n    std::string fullPath = fullPathForFilename(filename);\n    NSString* path = [NSString stringWithUTF8String:fullPath.c_str()];\n    NSDictionary* dict = [NSDictionary dictionaryWithContentsOfFile:path];\n    \n    ValueMap ret;\n    \n    if (dict != nil)\n    {\n        for (id key in [dict allKeys])\n        {\n            id value = [dict objectForKey:key];\n            addValueToDict(key, value, ret);\n        }\n    }\n    return ret;\n}\n\nbool FileUtilsApple::writeToFile(ValueMap& dict, const std::string &fullPath)\n{\n    //CCLOG(\"iOS||Mac Dictionary %d write to file %s\", dict->_ID, fullPath.c_str());\n    NSMutableDictionary *nsDict = [NSMutableDictionary dictionary];\n    \n    for (auto iter = dict.begin(); iter != dict.end(); ++iter)\n    {\n        addObjectToNSDict(iter->first, iter->second, nsDict);\n    }\n    \n    NSString *file = [NSString stringWithUTF8String:fullPath.c_str()];\n    // do it atomically\n    [nsDict writeToFile:file atomically:YES];\n    \n    return true;\n}\n\nValueVector FileUtilsApple::getValueVectorFromFile(const std::string& filename)\n{\n    //    NSString* pPath = [NSString stringWithUTF8String:pFileName];\n    //    NSString* pathExtension= [pPath pathExtension];\n    //    pPath = [pPath stringByDeletingPathExtension];\n    //    pPath = [[NSBundle mainBundle] pathForResource:pPath ofType:pathExtension];\n    //    fixing cannot read data using Array::createWithContentsOfFile\n    std::string fullPath = fullPathForFilename(filename);\n    NSString* path = [NSString stringWithUTF8String:fullPath.c_str()];\n    NSArray* array = [NSArray arrayWithContentsOfFile:path];\n    \n    ValueVector ret;\n    \n    for (id value in array)\n    {\n        addItemToArray(value, ret);\n    }\n    \n    return ret;\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/apple/CCLock.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCLock.h\"\n\nNS_CC_BEGIN\n\nLock::Lock(void)\n{\n}\n\nLock::~Lock(void)\n{\n\n}\n\nvoid Lock::lock(void)\n{\n    \n}\n\nvoid Lock::unlock(void)\n{\n    \n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/apple/CCLock.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__\n#define __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__\n\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\nclass Lock\n{\npublic:\n    /**\n     * @js ctor\n     */\n    Lock(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~Lock(void);\n\n    void lock(void);\n    void unlock(void);\n};\n\nNS_CC_END\n\n#endif // __PLATFORM_IPHONE_PLATFORM_CCLOCK_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/apple/CCThread.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n//#import <UIKit/UIKit.h>\n#include \"CCThread.h\"\n\nNS_CC_BEGIN\n\nvoid* ThreadHelper::createAutoreleasePool()\n{\n    id pool = [[NSAutoreleasePool alloc] init];\n    return pool;\n}\n\nvoid ThreadHelper::releaseAutoreleasePool(void *autoreleasePool)\n{\n    [(NSAutoreleasePool*)autoreleasePool release];\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/desktop/CCEGLView.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCEGLView.h\"\n\n#include <unordered_map>\n\n#include \"CCDirector.h\"\n#include \"CCSet.h\"\n#include \"CCTouch.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventKeyboard.h\"\n#include \"CCEventMouse.h\"\n#include \"CCIMEDispatcher.h\"\n\nNS_CC_BEGIN\n\nstruct keyCodeItem\n{\n    int glfwKeyCode;\n    EventKeyboard::KeyCode keyCode;\n};\n\nstatic std::unordered_map<int, EventKeyboard::KeyCode> g_keyCodeMap;\n\nstatic keyCodeItem g_keyCodeStructArray[] = {\n    /* The unknown key */\n    { GLFW_KEY_UNKNOWN         , EventKeyboard::KeyCode::KEY_NONE          },\n    \n    /* Printable keys */\n    { GLFW_KEY_SPACE           , EventKeyboard::KeyCode::KEY_SPACE         },\n    { GLFW_KEY_APOSTROPHE      , EventKeyboard::KeyCode::KEY_APOSTROPHE    },\n    { GLFW_KEY_COMMA           , EventKeyboard::KeyCode::KEY_COMMA         },\n    { GLFW_KEY_MINUS           , EventKeyboard::KeyCode::KEY_MINUS         },\n    { GLFW_KEY_PERIOD          , EventKeyboard::KeyCode::KEY_PERIOD        },\n    { GLFW_KEY_SLASH           , EventKeyboard::KeyCode::KEY_SLASH         },\n    { GLFW_KEY_0               , EventKeyboard::KeyCode::KEY_0             },\n    { GLFW_KEY_1               , EventKeyboard::KeyCode::KEY_1             },\n    { GLFW_KEY_2               , EventKeyboard::KeyCode::KEY_2             },\n    { GLFW_KEY_3               , EventKeyboard::KeyCode::KEY_3             },\n    { GLFW_KEY_4               , EventKeyboard::KeyCode::KEY_4             },\n    { GLFW_KEY_5               , EventKeyboard::KeyCode::KEY_5             },\n    { GLFW_KEY_6               , EventKeyboard::KeyCode::KEY_6             },\n    { GLFW_KEY_7               , EventKeyboard::KeyCode::KEY_7             },\n    { GLFW_KEY_8               , EventKeyboard::KeyCode::KEY_8             },\n    { GLFW_KEY_9               , EventKeyboard::KeyCode::KEY_9             },\n    { GLFW_KEY_SEMICOLON       , EventKeyboard::KeyCode::KEY_SEMICOLON     },\n    { GLFW_KEY_EQUAL           , EventKeyboard::KeyCode::KEY_EQUAL         },\n    { GLFW_KEY_A               , EventKeyboard::KeyCode::KEY_A             },\n    { GLFW_KEY_B               , EventKeyboard::KeyCode::KEY_B             },\n    { GLFW_KEY_C               , EventKeyboard::KeyCode::KEY_C             },\n    { GLFW_KEY_D               , EventKeyboard::KeyCode::KEY_D             },\n    { GLFW_KEY_E               , EventKeyboard::KeyCode::KEY_E             },\n    { GLFW_KEY_F               , EventKeyboard::KeyCode::KEY_F             },\n    { GLFW_KEY_G               , EventKeyboard::KeyCode::KEY_G             },\n    { GLFW_KEY_H               , EventKeyboard::KeyCode::KEY_H             },\n    { GLFW_KEY_I               , EventKeyboard::KeyCode::KEY_I             },\n    { GLFW_KEY_J               , EventKeyboard::KeyCode::KEY_J             },\n    { GLFW_KEY_K               , EventKeyboard::KeyCode::KEY_K             },\n    { GLFW_KEY_L               , EventKeyboard::KeyCode::KEY_L             },\n    { GLFW_KEY_M               , EventKeyboard::KeyCode::KEY_M             },\n    { GLFW_KEY_N               , EventKeyboard::KeyCode::KEY_N             },\n    { GLFW_KEY_O               , EventKeyboard::KeyCode::KEY_O             },\n    { GLFW_KEY_P               , EventKeyboard::KeyCode::KEY_P             },\n    { GLFW_KEY_Q               , EventKeyboard::KeyCode::KEY_Q             },\n    { GLFW_KEY_R               , EventKeyboard::KeyCode::KEY_R             },\n    { GLFW_KEY_S               , EventKeyboard::KeyCode::KEY_S             },\n    { GLFW_KEY_T               , EventKeyboard::KeyCode::KEY_T             },\n    { GLFW_KEY_U               , EventKeyboard::KeyCode::KEY_U             },\n    { GLFW_KEY_V               , EventKeyboard::KeyCode::KEY_V             },\n    { GLFW_KEY_W               , EventKeyboard::KeyCode::KEY_W             },\n    { GLFW_KEY_X               , EventKeyboard::KeyCode::KEY_X             },\n    { GLFW_KEY_Y               , EventKeyboard::KeyCode::KEY_Y             },\n    { GLFW_KEY_Z               , EventKeyboard::KeyCode::KEY_Z             },\n    { GLFW_KEY_LEFT_BRACKET    , EventKeyboard::KeyCode::KEY_LEFT_BRACKET  },\n    { GLFW_KEY_BACKSLASH       , EventKeyboard::KeyCode::KEY_BACK_SLASH    },\n    { GLFW_KEY_RIGHT_BRACKET   , EventKeyboard::KeyCode::KEY_RIGHT_BRACKET },\n    { GLFW_KEY_GRAVE_ACCENT    , EventKeyboard::KeyCode::KEY_GRAVE         },\n    { GLFW_KEY_WORLD_1         , EventKeyboard::KeyCode::KEY_GRAVE         },\n    { GLFW_KEY_WORLD_2         , EventKeyboard::KeyCode::KEY_NONE          },\n    \n    /* Function keys */\n    { GLFW_KEY_ESCAPE          , EventKeyboard::KeyCode::KEY_ESCAPE        },\n    { GLFW_KEY_ENTER           , EventKeyboard::KeyCode::KEY_KP_ENTER      },\n    { GLFW_KEY_TAB             , EventKeyboard::KeyCode::KEY_TAB           },\n    { GLFW_KEY_BACKSPACE       , EventKeyboard::KeyCode::KEY_BACKSPACE     },\n    { GLFW_KEY_INSERT          , EventKeyboard::KeyCode::KEY_INSERT        },\n    { GLFW_KEY_DELETE          , EventKeyboard::KeyCode::KEY_DELETE        },\n    { GLFW_KEY_RIGHT           , EventKeyboard::KeyCode::KEY_RIGHT_ARROW   },\n    { GLFW_KEY_LEFT            , EventKeyboard::KeyCode::KEY_LEFT_ARROW    },\n    { GLFW_KEY_DOWN            , EventKeyboard::KeyCode::KEY_DOWN_ARROW    },\n    { GLFW_KEY_UP              , EventKeyboard::KeyCode::KEY_UP_ARROW      },\n    { GLFW_KEY_PAGE_UP         , EventKeyboard::KeyCode::KEY_KP_PG_UP      },\n    { GLFW_KEY_PAGE_DOWN       , EventKeyboard::KeyCode::KEY_KP_PG_DOWN    },\n    { GLFW_KEY_HOME            , EventKeyboard::KeyCode::KEY_KP_HOME       },\n    { GLFW_KEY_END             , EventKeyboard::KeyCode::KEY_END           },\n    { GLFW_KEY_CAPS_LOCK       , EventKeyboard::KeyCode::KEY_CAPS_LOCK     },\n    { GLFW_KEY_SCROLL_LOCK     , EventKeyboard::KeyCode::KEY_SCROLL_LOCK   },\n    { GLFW_KEY_NUM_LOCK        , EventKeyboard::KeyCode::KEY_NUM_LOCK      },\n    { GLFW_KEY_PRINT_SCREEN    , EventKeyboard::KeyCode::KEY_PRINT         },\n    { GLFW_KEY_PAUSE           , EventKeyboard::KeyCode::KEY_PAUSE         },\n    { GLFW_KEY_F1              , EventKeyboard::KeyCode::KEY_F1            },\n    { GLFW_KEY_F2              , EventKeyboard::KeyCode::KEY_F2            },\n    { GLFW_KEY_F3              , EventKeyboard::KeyCode::KEY_F3            },\n    { GLFW_KEY_F4              , EventKeyboard::KeyCode::KEY_F4            },\n    { GLFW_KEY_F5              , EventKeyboard::KeyCode::KEY_F5            },\n    { GLFW_KEY_F6              , EventKeyboard::KeyCode::KEY_F6            },\n    { GLFW_KEY_F7              , EventKeyboard::KeyCode::KEY_F7            },\n    { GLFW_KEY_F8              , EventKeyboard::KeyCode::KEY_F8            },\n    { GLFW_KEY_F9              , EventKeyboard::KeyCode::KEY_F9            },\n    { GLFW_KEY_F10             , EventKeyboard::KeyCode::KEY_F10           },\n    { GLFW_KEY_F11             , EventKeyboard::KeyCode::KEY_F11           },\n    { GLFW_KEY_F12             , EventKeyboard::KeyCode::KEY_F12           },\n    { GLFW_KEY_F13             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F14             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F15             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F16             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F17             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F18             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F19             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F20             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F21             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F22             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F23             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F24             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_F25             , EventKeyboard::KeyCode::KEY_NONE          },\n    { GLFW_KEY_KP_0            , EventKeyboard::KeyCode::KEY_0             },\n    { GLFW_KEY_KP_1            , EventKeyboard::KeyCode::KEY_1             },\n    { GLFW_KEY_KP_2            , EventKeyboard::KeyCode::KEY_2             },\n    { GLFW_KEY_KP_3            , EventKeyboard::KeyCode::KEY_3             },\n    { GLFW_KEY_KP_4            , EventKeyboard::KeyCode::KEY_4             },\n    { GLFW_KEY_KP_5            , EventKeyboard::KeyCode::KEY_5             },\n    { GLFW_KEY_KP_6            , EventKeyboard::KeyCode::KEY_6             },\n    { GLFW_KEY_KP_7            , EventKeyboard::KeyCode::KEY_7             },\n    { GLFW_KEY_KP_8            , EventKeyboard::KeyCode::KEY_8             },\n    { GLFW_KEY_KP_9            , EventKeyboard::KeyCode::KEY_9             },\n    { GLFW_KEY_KP_DECIMAL      , EventKeyboard::KeyCode::KEY_PERIOD        },\n    { GLFW_KEY_KP_DIVIDE       , EventKeyboard::KeyCode::KEY_KP_DIVIDE     },\n    { GLFW_KEY_KP_MULTIPLY     , EventKeyboard::KeyCode::KEY_KP_MULTIPLY   },\n    { GLFW_KEY_KP_SUBTRACT     , EventKeyboard::KeyCode::KEY_KP_MINUS      },\n    { GLFW_KEY_KP_ADD          , EventKeyboard::KeyCode::KEY_KP_PLUS       },\n    { GLFW_KEY_KP_ENTER        , EventKeyboard::KeyCode::KEY_KP_ENTER      },\n    { GLFW_KEY_KP_EQUAL        , EventKeyboard::KeyCode::KEY_EQUAL         },\n    { GLFW_KEY_LEFT_SHIFT      , EventKeyboard::KeyCode::KEY_SHIFT         },\n    { GLFW_KEY_LEFT_CONTROL    , EventKeyboard::KeyCode::KEY_CTRL          },\n    { GLFW_KEY_LEFT_ALT        , EventKeyboard::KeyCode::KEY_ALT           },\n    { GLFW_KEY_LEFT_SUPER      , EventKeyboard::KeyCode::KEY_HYPER         },\n    { GLFW_KEY_RIGHT_SHIFT     , EventKeyboard::KeyCode::KEY_SHIFT         },\n    { GLFW_KEY_RIGHT_CONTROL   , EventKeyboard::KeyCode::KEY_CTRL          },\n    { GLFW_KEY_RIGHT_ALT       , EventKeyboard::KeyCode::KEY_ALT           },\n    { GLFW_KEY_RIGHT_SUPER     , EventKeyboard::KeyCode::KEY_HYPER         },\n    { GLFW_KEY_MENU            , EventKeyboard::KeyCode::KEY_MENU          },\n    { GLFW_KEY_LAST            , EventKeyboard::KeyCode::KEY_NONE          }\n};\n\n\n//begin EGLViewEventHandler\nclass EGLViewEventHandler\n{\npublic:\n    static bool s_captured;\n    static float s_mouseX;\n    static float s_mouseY;\n    \n    static void onGLFWError(int errorID, const char* errorDesc);\n    static void onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify);\n    static void onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y);\n    static void onGLFWMouseScrollCallback(GLFWwindow* window, double x, double y);\n    static void onGLFWKeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);\n    static void onGLFWCharCallback(GLFWwindow* window, unsigned int character);\n    static void onGLFWWindowPosCallback(GLFWwindow* windows, int x, int y);\n    static void onGLFWframebuffersize(GLFWwindow* window, int w, int h);\n};\n\nbool EGLViewEventHandler::s_captured = false;\nfloat EGLViewEventHandler::s_mouseX = 0;\nfloat EGLViewEventHandler::s_mouseY = 0;\n\nvoid EGLViewEventHandler::onGLFWError(int errorID, const char* errorDesc)\n{\n    CCLOGERROR(\"GLFWError #%d Happen, %s\\n\", errorID, errorDesc);\n}\n\nvoid EGLViewEventHandler::onGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify)\n{\n    EGLView* eglView = EGLView::getInstance();\n    if(nullptr == eglView) return;\n    if(GLFW_MOUSE_BUTTON_LEFT == button)\n    {\n        if(GLFW_PRESS == action)\n        {\n            s_captured = true;\n            if (eglView->getViewPortRect().equals(Rect::ZERO) || eglView->getViewPortRect().containsPoint(Point(s_mouseX,s_mouseY)))\n            {\n                int id = 0;\n                eglView->handleTouchesBegin(1, &id, &s_mouseX, &s_mouseY);\n            }\n        }\n        else if(GLFW_RELEASE == action)\n        {\n            s_captured = false;\n            if (eglView->getViewPortRect().equals(Rect::ZERO) || eglView->getViewPortRect().containsPoint(Point(s_mouseX,s_mouseY)))\n            {\n                int id = 0;\n                eglView->handleTouchesEnd(1, &id, &s_mouseX, &s_mouseY);\n            }\n        }\n    }\n    \n    if(GLFW_PRESS == action)\n    {\n        EventMouse event(EventMouse::MouseEventType::MOUSE_DOWN);\n        //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here\n        event.setCursorPosition(s_mouseX, eglView->getViewPortRect().size.height - s_mouseY);\n        event.setMouseButton(button);\n        Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);\n    }\n    else if(GLFW_RELEASE == action)\n    {\n        EventMouse event(EventMouse::MouseEventType::MOUSE_UP);\n        //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here\n        event.setCursorPosition(s_mouseX, eglView->getViewPortRect().size.height - s_mouseY);\n        event.setMouseButton(button);\n        Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);\n    }\n}\n\nvoid EGLViewEventHandler::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y)\n{\n    EGLView* eglView = EGLView::getInstance();\n    if(nullptr == eglView) return;\n    \n    if (eglView->isRetina()) {\n        x *= 2;\n        y *= 2;\n    }\n    \n    s_mouseX = (float)x;\n    s_mouseY = (float)y;\n    \n    s_mouseX /= eglView->getFrameZoomFactor();\n    s_mouseY /= eglView->getFrameZoomFactor();\n    \n    if(s_captured)\n    {\n        if (eglView->getViewPortRect().equals(Rect::ZERO) || eglView->getViewPortRect().containsPoint(Point(s_mouseX,eglView->getFrameSize().height - s_mouseY)))\n        {\n            int id = 0;\n            eglView->handleTouchesMove(1, &id, &s_mouseX, &s_mouseY);\n        }\n    }\n    \n    EventMouse event(EventMouse::MouseEventType::MOUSE_MOVE);\n    //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here\n    event.setCursorPosition(s_mouseX, eglView->getViewPortRect().size.height - s_mouseY);\n    Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);\n}\n\nvoid EGLViewEventHandler::onGLFWMouseScrollCallback(GLFWwindow* window, double x, double y)\n{\n    EGLView* eglView = EGLView::getInstance();\n    if(nullptr == eglView) return;\n    \n    EventMouse event(EventMouse::MouseEventType::MOUSE_SCROLL);\n    //Because OpenGL and cocos2d-x uses different Y axis, we need to convert the coordinate here\n    event.setScrollData((float)x, -(float)y);\n    event.setCursorPosition(s_mouseX, eglView->getViewPortRect().size.height - s_mouseY);\n    Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);\n}\n\nvoid EGLViewEventHandler::onGLFWKeyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)\n{\n    if (GLFW_REPEAT != action)\n    {\n        EventKeyboard event(g_keyCodeMap[key], GLFW_PRESS == action);\n        auto dispatcher = Director::getInstance()->getEventDispatcher();\n        dispatcher->dispatchEvent(&event);\n    }\n}\n\nvoid EGLViewEventHandler::onGLFWCharCallback(GLFWwindow *window, unsigned int character)\n{\n    IMEDispatcher::sharedDispatcher()->dispatchInsertText((const char*) &character, 1);\n}\n\nvoid EGLViewEventHandler::onGLFWWindowPosCallback(GLFWwindow *windows, int x, int y)\n{\n    Director::getInstance()->setViewport();\n}\n\nvoid EGLViewEventHandler::onGLFWframebuffersize(GLFWwindow* window, int w, int h)\n{\n    auto view = EGLView::getInstance();\n\n    float frameSizeW = view->getFrameSize().width;\n    float frameSizeH = view->getFrameSize().height;\n    float factorX = frameSizeW / w * view->getFrameZoomFactor();\n    float factorY = frameSizeH / h * view->getFrameZoomFactor();;\n    \n    if (fabs(factorX - 0.5f) < FLT_EPSILON && fabs(factorY - 0.5f) < FLT_EPSILON )\n    {\n        view->_isRetina = true;\n        view->setFrameZoomFactor(2.0f * view->getFrameZoomFactor());\n        glfwSetWindowSize(window, static_cast<int>(frameSizeW * 0.5f * view->getFrameZoomFactor()) , static_cast<int>(frameSizeH * 0.5f * view->getFrameZoomFactor()));\n    }\n    else if(fabs(factorX - 2.0f) < FLT_EPSILON && fabs(factorY - 2.0f) < FLT_EPSILON)\n    {\n        view->_isRetina = false;\n        view->setFrameZoomFactor(0.5f * view->getFrameZoomFactor());\n        glfwSetWindowSize(window, static_cast<int>(frameSizeW * view->getFrameZoomFactor()), static_cast<int>(frameSizeH * view->getFrameZoomFactor()));\n    }\n}\n\n\n//end EGLViewEventHandler\n\n\n//////////////////////////////////////////////////////////////////////////\n// implement EGLView\n//////////////////////////////////////////////////////////////////////////\n\nEGLView* EGLView::s_pEglView = nullptr;\n\nEGLView::EGLView()\n: _captured(false)\n, _frameZoomFactor(1.0f)\n, _supportTouch(false)\n, _isRetina(false)\n, _mainWindow(nullptr)\n, _primaryMonitor(nullptr)\n{\n    CCASSERT(nullptr == s_pEglView, \"EGLView is singleton, Should be inited only one time\\n\");\n    _viewName = \"cocos2dx\";\n    s_pEglView = this;\n    g_keyCodeMap.clear();\n    for (auto& item : g_keyCodeStructArray)\n    {\n        g_keyCodeMap[item.glfwKeyCode] = item.keyCode;\n    }\n    glfwSetErrorCallback(EGLViewEventHandler::onGLFWError);\n    glfwInit();\n}\n\nEGLView::~EGLView()\n{\n    CCLOGINFO(\"deallocing EGLView: %p\", this);\n    glfwTerminate();\n    s_pEglView = nullptr;\n}\n\nbool EGLView::init(const std::string& viewName, float width, float height, float frameZoomFactor)\n{\n    if(_mainWindow != nullptr)\n        return true;\n    \n    setViewName(viewName);\n    setFrameSize(width, height);\n    setFrameZoomFactor(frameZoomFactor);\n    \n    glfwWindowHint(GLFW_RESIZABLE,GL_FALSE);\n    \n    _mainWindow = glfwCreateWindow(_screenSize.width * _frameZoomFactor,\n                                   _screenSize.height * _frameZoomFactor,\n                                   _viewName.c_str(),\n                                   _primaryMonitor,\n                                   NULL);\n    glfwMakeContextCurrent(_mainWindow);\n    \n    int w, h;\n    glfwGetWindowSize(_mainWindow, &w, &h);\n    int frameBufferW, frameBufferH;\n    glfwGetFramebufferSize(_mainWindow, &frameBufferW, &frameBufferH);\n    \n    if (frameBufferW == 2 * w && frameBufferH == 2 * h)\n    {\n        _isRetina = true;\n        setFrameZoomFactor(frameZoomFactor * 2);\n        glfwSetWindowSize(_mainWindow, width/2 * _frameZoomFactor, height/2 * _frameZoomFactor);\n    }\n    \n    glfwSetMouseButtonCallback(_mainWindow,EGLViewEventHandler::onGLFWMouseCallBack);\n    glfwSetCursorPosCallback(_mainWindow,EGLViewEventHandler::onGLFWMouseMoveCallBack);\n    glfwSetScrollCallback(_mainWindow, EGLViewEventHandler::onGLFWMouseScrollCallback);\n    glfwSetCharCallback(_mainWindow, EGLViewEventHandler::onGLFWCharCallback);\n    glfwSetKeyCallback(_mainWindow, EGLViewEventHandler::onGLFWKeyCallback);\n    glfwSetWindowPosCallback(_mainWindow, EGLViewEventHandler::onGLFWWindowPosCallback);\n    glfwSetFramebufferSizeCallback(_mainWindow, EGLViewEventHandler::onGLFWframebuffersize);\n    // check OpenGL version at first\n    const GLubyte* glVersion = glGetString(GL_VERSION);\n    \n    if ( atof((const char*)glVersion) < 1.5 )\n    {\n        char strComplain[256] = {0};\n        sprintf(strComplain,\n                \"OpenGL 1.5 or higher is required (your version is %s). Please upgrade the driver of your video card.\",\n                glVersion);\n        MessageBox(strComplain, \"OpenGL version too old\");\n        return false;\n    }\n    \n    initGlew();\n\n    // Enable point size by default.\n    glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);\n    \n    return true;\n}\n\nbool EGLView::initWithFullScreen(const std::string& viewName)\n{\n    _primaryMonitor = glfwGetPrimaryMonitor();\n    if (nullptr == _primaryMonitor)\n        return false;\n    \n    const GLFWvidmode* videoMode = glfwGetVideoMode(_primaryMonitor);\n    return init(viewName, videoMode->width, videoMode->height, 1.0f);\n}\n\nbool EGLView::isOpenGLReady()\n{\n    return nullptr != _mainWindow;\n}\n\nvoid EGLView::end()\n{\n    if(_mainWindow)\n        glfwSetWindowShouldClose(_mainWindow,1);\n}\n\nvoid EGLView::swapBuffers()\n{\n    if(_mainWindow)\n        glfwSwapBuffers(_mainWindow);\n}\n\nbool EGLView::windowShouldClose()\n{\n    if(_mainWindow)\n        return glfwWindowShouldClose(_mainWindow);\n    else\n        return true;\n}\n\nvoid EGLView::pollEvents()\n{\n    glfwPollEvents();\n}\n\nvoid EGLView::setIMEKeyboardState(bool /*bOpen*/)\n{\n    \n}\n\nvoid EGLView::setFrameZoomFactor(float zoomFactor)\n{\n    _frameZoomFactor = zoomFactor;\n    Director::getInstance()->setProjection(Director::getInstance()->getProjection());\n}\n\nfloat EGLView::getFrameZoomFactor()\n{\n    return _frameZoomFactor;\n}\n\nvoid EGLView::setFrameSize(float width, float height)\n{\n    EGLViewProtocol::setFrameSize(width, height);\n}\n\nvoid EGLView::setViewPortInPoints(float x , float y , float w , float h)\n{\n    glViewport((GLint)(x * _scaleX * _frameZoomFactor + _viewPortRect.origin.x * _frameZoomFactor),\n               (GLint)(y * _scaleY  * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor),\n               (GLsizei)(w * _scaleX * _frameZoomFactor),\n               (GLsizei)(h * _scaleY * _frameZoomFactor));\n}\n\nvoid EGLView::setScissorInPoints(float x , float y , float w , float h)\n{\n    glScissor((GLint)(x * _scaleX * _frameZoomFactor + _viewPortRect.origin.x * _frameZoomFactor),\n               (GLint)(y * _scaleY  * _frameZoomFactor + _viewPortRect.origin.y * _frameZoomFactor),\n               (GLsizei)(w * _scaleX * _frameZoomFactor),\n               (GLsizei)(h * _scaleY * _frameZoomFactor));\n}\n\nEGLView* EGLView::getInstance()\n{\n    CCASSERT(nullptr != s_pEglView, \"EGL singleton should not be null\");\n    return s_pEglView;\n}\n\n// XXX: deprecated\nEGLView* EGLView::sharedOpenGLView()\n{\n    return EGLView::getInstance();\n}\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\nstatic bool glew_dynamic_binding()\n{\n\tconst char *gl_extensions = (const char*)glGetString(GL_EXTENSIONS);\n\n\t// If the current opengl driver doesn't have framebuffers methods, check if an extension exists\n\tif (glGenFramebuffers == NULL)\n\t{\n\t\tlog(\"OpenGL: glGenFramebuffers is NULL, try to detect an extension\");\n\t\tif (strstr(gl_extensions, \"ARB_framebuffer_object\"))\n\t\t{\n\t\t\tlog(\"OpenGL: ARB_framebuffer_object is supported\");\n\n\t\t\tglIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) wglGetProcAddress(\"glIsRenderbuffer\");\n\t\t\tglBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) wglGetProcAddress(\"glBindRenderbuffer\");\n\t\t\tglDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) wglGetProcAddress(\"glDeleteRenderbuffers\");\n\t\t\tglGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) wglGetProcAddress(\"glGenRenderbuffers\");\n\t\t\tglRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) wglGetProcAddress(\"glRenderbufferStorage\");\n\t\t\tglGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) wglGetProcAddress(\"glGetRenderbufferParameteriv\");\n\t\t\tglIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) wglGetProcAddress(\"glIsFramebuffer\");\n\t\t\tglBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) wglGetProcAddress(\"glBindFramebuffer\");\n\t\t\tglDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) wglGetProcAddress(\"glDeleteFramebuffers\");\n\t\t\tglGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) wglGetProcAddress(\"glGenFramebuffers\");\n\t\t\tglCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) wglGetProcAddress(\"glCheckFramebufferStatus\");\n\t\t\tglFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) wglGetProcAddress(\"glFramebufferTexture1D\");\n\t\t\tglFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) wglGetProcAddress(\"glFramebufferTexture2D\");\n\t\t\tglFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) wglGetProcAddress(\"glFramebufferTexture3D\");\n\t\t\tglFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) wglGetProcAddress(\"glFramebufferRenderbuffer\");\n\t\t\tglGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) wglGetProcAddress(\"glGetFramebufferAttachmentParameteriv\");\n\t\t\tglGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) wglGetProcAddress(\"glGenerateMipmap\");\n\t\t}\n\t\telse\n\t\tif (strstr(gl_extensions, \"EXT_framebuffer_object\"))\n\t\t{\n\t\t\tlog(\"OpenGL: EXT_framebuffer_object is supported\");\n\t\t\tglIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) wglGetProcAddress(\"glIsRenderbufferEXT\");\n\t\t\tglBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) wglGetProcAddress(\"glBindRenderbufferEXT\");\n\t\t\tglDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) wglGetProcAddress(\"glDeleteRenderbuffersEXT\");\n\t\t\tglGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) wglGetProcAddress(\"glGenRenderbuffersEXT\");\n\t\t\tglRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) wglGetProcAddress(\"glRenderbufferStorageEXT\");\n\t\t\tglGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) wglGetProcAddress(\"glGetRenderbufferParameterivEXT\");\n\t\t\tglIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) wglGetProcAddress(\"glIsFramebufferEXT\");\n\t\t\tglBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) wglGetProcAddress(\"glBindFramebufferEXT\");\n\t\t\tglDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) wglGetProcAddress(\"glDeleteFramebuffersEXT\");\n\t\t\tglGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) wglGetProcAddress(\"glGenFramebuffersEXT\");\n\t\t\tglCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) wglGetProcAddress(\"glCheckFramebufferStatusEXT\");\n\t\t\tglFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) wglGetProcAddress(\"glFramebufferTexture1DEXT\");\n\t\t\tglFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) wglGetProcAddress(\"glFramebufferTexture2DEXT\");\n\t\t\tglFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) wglGetProcAddress(\"glFramebufferTexture3DEXT\");\n\t\t\tglFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) wglGetProcAddress(\"glFramebufferRenderbufferEXT\");\n\t\t\tglGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) wglGetProcAddress(\"glGetFramebufferAttachmentParameterivEXT\");\n\t\t\tglGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) wglGetProcAddress(\"glGenerateMipmapEXT\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tlog(\"OpenGL: No framebuffers extension is supported\");\n\t\t\tlog(\"OpenGL: Any call to Fbo will crash!\");\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n#endif\n\n// helper\nbool EGLView::initGlew()\n{\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC)\n    GLenum GlewInitResult = glewInit();\n    if (GLEW_OK != GlewInitResult)\n    {\n        MessageBox((char *)glewGetErrorString(GlewInitResult), \"OpenGL error\");\n        return false;\n    }\n\n    if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader)\n    {\n        log(\"Ready for GLSL\");\n    }\n    else\n    {\n        log(\"Not totally ready :(\");\n    }\n\n    if (glewIsSupported(\"GL_VERSION_2_0\"))\n    {\n        log(\"Ready for OpenGL 2.0\");\n    }\n    else\n    {\n        log(\"OpenGL 2.0 not supported\");\n    }\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n    if(glew_dynamic_binding() == false)\n    {\n        MessageBox(\"No OpenGL framebuffer support. Please upgrade the driver of your video card.\", \"OpenGL error\");\n        return false;\n\t}\n#endif\n\n#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_MAC)\n\n    return true;\n}\n\nNS_CC_END // end of namespace cocos2d;\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/desktop/CCEGLView.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EGLVIEW_DESKTOP_H__\n#define __CC_EGLVIEW_DESKTOP_H__\n\n#include \"platform/CCCommon.h\"\n#include \"platform/CCEGLViewProtocol.h\"\n#include \"glfw3.h\"\n\nNS_CC_BEGIN\n\nclass CC_DLL EGLView : public EGLViewProtocol\n{\npublic:\n    // static function\n    /**\n     @brief    get the shared main open gl window\n     */\n    static EGLView* getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView();\n\n    /**\n     * @js ctor\n     */\n    EGLView();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EGLView();\n    \n    /* override functions */\n    virtual bool isOpenGLReady();\n    virtual void end();\n    virtual void swapBuffers();\n    virtual void setFrameSize(float width, float height);\n    virtual void setIMEKeyboardState(bool bOpen);\n    /*\n     *frameZoomFactor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.\n     */\n    bool init(const std::string& viewName, float width, float height, float frameZoomFactor = 1.0f);\n    bool initWithFullScreen(const std::string& viewName);\n\n    //void resize(int width, int height);\n \n\tfloat getFrameZoomFactor();\n    //void centerWindow();\n\n    \n    virtual void setViewPortInPoints(float x , float y , float w , float h);\n    virtual void setScissorInPoints(float x , float y , float w , float h);\n\n\n    bool windowShouldClose();\n    void pollEvents();\n    GLFWwindow* getWindow() const { return _mainWindow; }\n\nprotected:\n    /*\n     * Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.\n     */\n    void setFrameZoomFactor(float zoomFactor);\n    bool initGlew();\n    inline bool isRetina() { return _isRetina; };\n\n    bool _captured;\n    bool _supportTouch;\n    bool _isRetina;\n\n    float _frameZoomFactor;\n    static EGLView* s_pEglView;\n\n    GLFWwindow* _mainWindow;\n    GLFWmonitor* _primaryMonitor;\n    friend class EGLViewEventHandler;\n};\n\nNS_CC_END   // end of namespace   cocos2d\n\n#endif\t// end of __CC_EGLVIEW_DESKTOP_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCApplication.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_APPLICATION_IOS_H__\n#define __CC_APPLICATION_IOS_H__\n\n#include \"platform/CCCommon.h\"\n#include \"platform/CCApplicationProtocol.h\"\n\nNS_CC_BEGIN\n\nclass Rect;\n\nclass CC_DLL Application : public ApplicationProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    Application();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Application();\n        \n    /**\n    @brief    Run the message loop.\n    */\n    int run();\n        \n    /**\n    @brief    Get the current application instance.\n    @return Current application instance pointer.\n    */\n    static Application* getInstance();\n    \n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();\n    \n    /**\n     @brief    Callback by Director for limit FPS.\n     @param interval    The time, expressed in seconds, between current frame and next.\n     */\n    virtual void setAnimationInterval(double interval);\n\n    /**\n    @brief Get current language config\n    @return Current language config\n    */\n    virtual LanguageType getCurrentLanguage();\n    \n    /**\n     @brief Get target platform\n     */\n    virtual Platform getTargetPlatform();\n\n\t/**\n\t@brief  This function will be called when the application screen size is changed.\n\t@param new width\n\t@param new height\n\t*/\n\tvirtual void applicationScreenSizeChanged(int newWidth, int newHeight);\n\nprotected:\n    static Application * sm_pSharedApplication;\n};\n\nNS_CC_END\n\n#endif    // end of __CC_APPLICATION_IOS_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCApplication.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"CCApplication.h\"\n\n#import <UIKit/UIKit.h>\n\n#import \"CCGeometry.h\"\n#import \"CCDirectorCaller.h\"\n\nNS_CC_BEGIN\n\nApplication* Application::sm_pSharedApplication = 0;\n\nApplication::Application()\n{\n    CC_ASSERT(! sm_pSharedApplication);\n    sm_pSharedApplication = this;\n}\n\nApplication::~Application()\n{\n    CC_ASSERT(this == sm_pSharedApplication);\n    sm_pSharedApplication = 0;\n}\n\nint Application::run()\n{\n    if (applicationDidFinishLaunching()) \n    {\n        [[CCDirectorCaller sharedDirectorCaller] startMainLoop];\n    }\n    return 0;\n}\n\nvoid Application::setAnimationInterval(double interval)\n{\n    [[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ];\n}\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n// static member function\n//////////////////////////////////////////////////////////////////////////////////////////////////\n\nApplication* Application::getInstance()\n{\n    CC_ASSERT(sm_pSharedApplication);\n    return sm_pSharedApplication;\n}\n\n// @deprecated Use getInstance() instead\nApplication* Application::sharedApplication()\n{\n    return Application::getInstance();\n}\n\nLanguageType Application::getCurrentLanguage()\n{\n    // get the current language and country config\n    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n    NSArray *languages = [defaults objectForKey:@\"AppleLanguages\"];\n    NSString *currentLanguage = [languages objectAtIndex:0];\n\n    // get the current language code.(such as English is \"en\", Chinese is \"zh\" and so on)\n    NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];\n    NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];\n\n    LanguageType ret = LanguageType::ENGLISH;\n    if ([languageCode isEqualToString:@\"zh\"])\n    {\n        ret = LanguageType::CHINESE;\n    }\n    else if ([languageCode isEqualToString:@\"en\"])\n    {\n        ret = LanguageType::ENGLISH;\n    }\n    else if ([languageCode isEqualToString:@\"fr\"]){\n        ret = LanguageType::FRENCH;\n    }\n    else if ([languageCode isEqualToString:@\"it\"]){\n        ret = LanguageType::ITALIAN;\n    }\n    else if ([languageCode isEqualToString:@\"de\"]){\n        ret = LanguageType::GERMAN;\n    }\n    else if ([languageCode isEqualToString:@\"es\"]){\n        ret = LanguageType::SPANISH;\n    }\n    else if ([languageCode isEqualToString:@\"ru\"]){\n        ret = LanguageType::RUSSIAN;\n    }\n    else if ([languageCode isEqualToString:@\"ko\"]){\n        ret = LanguageType::KOREAN;\n    }\n    else if ([languageCode isEqualToString:@\"ja\"]){\n        ret = LanguageType::JAPANESE;\n    }\n    else if ([languageCode isEqualToString:@\"hu\"]){\n        ret = LanguageType::HUNGARIAN;\n    }\n    else if ([languageCode isEqualToString:@\"pt\"]){\n        ret = LanguageType::PORTUGUESE;\n    }\n    else if ([languageCode isEqualToString:@\"ar\"]){\n        ret = LanguageType::ARABIC;\n    }\n    else if ([languageCode isEqualToString:@\"nb\"]){\n        ret = LanguageType::NORWEGIAN;\n    }\n    else if ([languageCode isEqualToString:@\"pl\"]){\n        ret = LanguageType::POLISH;\n    }\n    return ret;\n}\n\nApplication::Platform Application::getTargetPlatform()\n{\n    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) // idiom for iOS <= 3.2, otherwise: [UIDevice userInterfaceIdiom] is faster.\n    {\n        return Platform::OS_IPAD;\n    }\n    else \n    {\n        return Platform::OS_IPHONE;\n    }\n}\n\nvoid Application::applicationScreenSizeChanged(int newWidth, int newHeight) {\n\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCCommon.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"platform/CCCommon.h\"\n\n#include <stdarg.h>\n#include <stdio.h>\n\n#import <UIKit/UIAlert.h>\n#include \"CCDirector.h\"\n#include \"CCConsole.h\"\n\nNS_CC_BEGIN\n\n// ios no MessageBox, use log instead\nvoid MessageBox(const char * msg, const char * title)\n{\n    NSString * tmpTitle = (title) ? [NSString stringWithUTF8String : title] : nil;\n    NSString * tmpMsg = (msg) ? [NSString stringWithUTF8String : msg] : nil;\n    UIAlertView * messageBox = [[UIAlertView alloc] initWithTitle: tmpTitle\n                                                          message: tmpMsg\n                                                         delegate: nil\n                                                cancelButtonTitle: @\"OK\"\n                                                otherButtonTitles: nil];\n    [messageBox autorelease];\n    [messageBox show];\n}\n\nvoid LuaLog(const char * format)\n{\n    puts(format);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCDevice.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"CCDevice.h\"\n#include \"ccTypes.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventAcceleration.h\"\n#include \"CCDirector.h\"\n#import <UIKit/UIKit.h>\n\n// Accelerometer\n#import<CoreMotion/CoreMotion.h>\n#import<CoreFoundation/CoreFoundation.h>\n\n@interface CCAccelerometerDispatcher : NSObject<UIAccelerometerDelegate>\n{\n    cocos2d::Acceleration *_acceleration;\n    CMMotionManager *_motionManager;\n}\n\n+ (id) sharedAccelerometerDispather;\n- (id) init;\n- (void) setAccelerometerEnabled: (bool) isEnabled;\n- (void) setAccelerometerInterval:(float) interval;\n\n@end\n\n@implementation CCAccelerometerDispatcher\n\nstatic CCAccelerometerDispatcher* s_pAccelerometerDispatcher;\n\n+ (id) sharedAccelerometerDispather\n{\n    if (s_pAccelerometerDispatcher == nil) {\n        s_pAccelerometerDispatcher = [[self alloc] init];\n    }\n    \n    return s_pAccelerometerDispatcher;\n}\n\n- (id) init\n{\n    if( (self = [super init]) ) {\n        _acceleration = new cocos2d::Acceleration();\n        _motionManager = [[CMMotionManager alloc] init];\n    }\n    return self;\n}\n\n- (void) dealloc\n{\n    s_pAccelerometerDispatcher = nullptr;\n    delete _acceleration;\n    [_motionManager release];\n    [super dealloc];\n}\n\n- (void) setAccelerometerEnabled: (bool) isEnabled\n{\n    if (isEnabled)\n    {\n        [_motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) {\n            [self accelerometer:accelerometerData];\n        }];\n    }\n    else\n    {\n        [_motionManager stopAccelerometerUpdates];\n    }\n}\n\n-(void) setAccelerometerInterval:(float)interval\n{\n    _motionManager.accelerometerUpdateInterval = interval;\n}\n\n- (void)accelerometer:(CMAccelerometerData *)accelerometerData\n{\n    _acceleration->x = accelerometerData.acceleration.x;\n    _acceleration->y = accelerometerData.acceleration.y;\n    _acceleration->z = accelerometerData.acceleration.z;\n    _acceleration->timestamp = accelerometerData.timestamp;\n    \n    double tmp = _acceleration->x;\n    \n    switch ([[UIApplication sharedApplication] statusBarOrientation])\n    {\n        case UIInterfaceOrientationLandscapeRight:\n            _acceleration->x = -_acceleration->y;\n            _acceleration->y = tmp;\n            break;\n            \n        case UIInterfaceOrientationLandscapeLeft:\n            _acceleration->x = _acceleration->y;\n            _acceleration->y = -tmp;\n            break;\n            \n        case UIInterfaceOrientationPortraitUpsideDown:\n            _acceleration->x = -_acceleration->y;\n            _acceleration->y = -tmp;\n            break;\n            \n        case UIInterfaceOrientationPortrait:\n            break;\n    }\n\n    cocos2d::EventAcceleration event(*_acceleration);\n    auto dispatcher = cocos2d::Director::getInstance()->getEventDispatcher();\n    dispatcher->dispatchEvent(&event);\n}\n\n@end\n\n//\n\nNS_CC_BEGIN\n\nint Device::getDPI()\n{\n    static int dpi = -1;\n\n    if (dpi == -1)\n    {\n        float scale = 1.0f;\n        \n        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {\n            scale = [[UIScreen mainScreen] scale];\n        }\n        \n        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {\n            dpi = 132 * scale;\n        } else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {\n            dpi = 163 * scale;\n        } else {\n            dpi = 160 * scale;\n        }\n    }\n    return dpi;\n}\n\n\n\n\nvoid Device::setAccelerometerEnabled(bool isEnabled)\n{\n    [[CCAccelerometerDispatcher sharedAccelerometerDispather] setAccelerometerEnabled:isEnabled];\n}\n\nvoid Device::setAccelerometerInterval(float interval)\n{\n    [[CCAccelerometerDispatcher sharedAccelerometerDispather] setAccelerometerInterval:interval];\n}\n\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCDirectorCaller.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#import <Foundation/Foundation.h>\n\n@interface CCDirectorCaller : NSObject {\n        id displayLink;\n        int interval;\n}\n@property (readwrite) int interval;\n-(void) startMainLoop;\n-(void) doCaller: (id) sender;\n-(void) setAnimationInterval:(double)interval;\n+(id) sharedDirectorCaller;\n+(void) destroy;\n@end\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCDirectorCaller.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#import <Foundation/Foundation.h>\n#import \"CCDirectorCaller.h\"\n#import \"CCDirector.h\"\n\nstatic id s_sharedDirectorCaller;\n\n@interface NSObject(CADisplayLink)\n+(id) displayLinkWithTarget: (id)arg1 selector:(SEL)arg2;\n-(void) addToRunLoop: (id)arg1 forMode: (id)arg2;\n-(void) setFrameInterval: (int)interval;\n-(void) invalidate;\n@end\n\n@implementation CCDirectorCaller\n\n@synthesize interval;\n\n+(id) sharedDirectorCaller\n{\n    if (s_sharedDirectorCaller == nil)\n    {\n        s_sharedDirectorCaller = [CCDirectorCaller new];\n    }\n    \n    return s_sharedDirectorCaller;\n}\n\n+(void) destroy\n{\n    [s_sharedDirectorCaller release];\n    s_sharedDirectorCaller = nil;\n}\n\n-(void) alloc\n{\n        interval = 1;\n}\n\n-(void) dealloc\n{\n    [displayLink release];\n    [super dealloc];\n}\n\n-(void) startMainLoop\n{\n        // Director::setAnimationInterval() is called, we should invalidate it first\n        [displayLink invalidate];\n        displayLink = nil;\n        \n        displayLink = [NSClassFromString(@\"CADisplayLink\") displayLinkWithTarget:self selector:@selector(doCaller:)];\n        [displayLink setFrameInterval: self.interval];\n        [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];\n}\n\n-(void) setAnimationInterval:(double)intervalNew\n{\n        // Director::setAnimationInterval() is called, we should invalidate it first\n        [displayLink invalidate];\n        displayLink = nil;\n        \n        self.interval = 60.0 * intervalNew;\n        \n        displayLink = [NSClassFromString(@\"CADisplayLink\") displayLinkWithTarget:self selector:@selector(doCaller:)];\n        [displayLink setFrameInterval: self.interval];\n        [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];\n}\n                      \n-(void) doCaller: (id) sender\n{\n    cocos2d::Director::getInstance()->mainLoop();\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCEGLView.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CC_EGLVIEW_IPHONE_H__\n#define __CC_EGLVIEW_IPHONE_H__\n\n#include \"platform/CCCommon.h\"\n#include \"platform/CCEGLViewProtocol.h\"\n\nNS_CC_BEGIN\n\n\n\nclass CC_DLL EGLView : public EGLViewProtocol\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    EGLView();\n    /**\n     * @js NA\n     * @lua NA\n     */\n   ~EGLView();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual bool    isOpenGLReady();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual bool    setContentScaleFactor(float contentScaleFactor);\n    \n    // keep compatible\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void    end();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void    swapBuffers();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void setIMEKeyboardState(bool bOpen);\n\n    /** returns the singleton\n     * @js NA\n     */\n    static EGLView* getInstance();\n\n    /** @deprecated Use getInstance() instead \n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static EGLView* sharedOpenGLView();\n\n};\n\nNS_CC_END\n\n#endif    // end of __CC_EGLVIEW_IPHONE_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCEGLView.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"EAGLView.h\"\n#include \"CCDirectorCaller.h\"\n#include \"CCEGLView.h\"\n#include \"CCSet.h\"\n#include \"CCTouch.h\"\n\nNS_CC_BEGIN\n\nEGLView::EGLView()\n{\n    _screenSize.width = _designResolutionSize.width = [[CCEAGLView sharedEGLView] getWidth];\n    _screenSize.height = _designResolutionSize.height = [[CCEAGLView sharedEGLView] getHeight];\n}\n\nEGLView::~EGLView()\n{\n\n}\n\nbool EGLView::isOpenGLReady()\n{\n    return [CCEAGLView sharedEGLView] != nullptr;\n}\n    \nbool EGLView::setContentScaleFactor(float contentScaleFactor)\n{\n    assert(_resolutionPolicy == ResolutionPolicy::UNKNOWN); // cannot enable retina mode\n\t\n\t_scaleX = _scaleY = contentScaleFactor;\n\t[[CCEAGLView sharedEGLView] setNeedsLayout];\n        \n\treturn true;\n}\n\nvoid EGLView::end()\n{\n    [CCDirectorCaller destroy];\n    \n    // destroy EAGLView\n    [[CCEAGLView sharedEGLView] removeFromSuperview];\n}\n\n\nvoid EGLView::swapBuffers()\n{\n    [[CCEAGLView sharedEGLView] swapBuffers];\n}\n\nvoid EGLView::setIMEKeyboardState(bool bOpen)\n{\n    if (bOpen)\n    {\n        [[CCEAGLView sharedEGLView] becomeFirstResponder];\n    }\n    else\n    {\n        [[CCEAGLView sharedEGLView] resignFirstResponder];\n    }\n}\n\nEGLView* EGLView::getInstance()\n{\n    static EGLView instance;\n    return &instance;\n}\n\n// XXX: deprecated\nEGLView* EGLView::sharedOpenGLView()\n{\n    return EGLView::getInstance();\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCES2Renderer.h",
    "content": "/****************************************************************************\n Copyright (c) 2010      Ricardo Quesada\n Copyright (c) 2010-2012 cocos2d-x.org\n Corpyight (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n// Only compile this code on iOS. These files should NOT be included on your Mac project.\n// But in case they are included, it won't be compiled.\n#import \"CCPlatformMacros.h\"\n#import \"CCESRenderer.h\"\n#import <OpenGLES/ES2/gl.h>\n#import <OpenGLES/ES2/glext.h>\n\n@interface CCES2Renderer : NSObject <CCESRenderer>\n{\n    // The pixel dimensions of the CAEAGLLayer\n    GLint backingWidth_;\n    GLint backingHeight_;\n\n    unsigned int    samplesToUse_;\n    BOOL            multiSampling_;\n\n    unsigned int    depthFormat_;\n    unsigned int    pixelFormat_;\n\n    // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view\n    GLuint defaultFramebuffer_;\n    GLuint colorRenderbuffer_;\n    GLuint depthBuffer_;\n\n\n    //buffers for MSAA\n    GLuint msaaFramebuffer_;\n    GLuint msaaColorbuffer_;\n\n    EAGLContext *context_;\n}\n\n/** Color Renderbuffer */\n@property (nonatomic,readonly) GLuint colorRenderbuffer;\n\n/** Default Renderbuffer */\n@property (nonatomic,readonly) GLuint defaultFramebuffer;\n\n/** MSAA Framebuffer */\n@property (nonatomic,readonly) GLuint msaaFramebuffer;\n\n/** MSAA Color Buffer */\n@property (nonatomic,readonly) GLuint msaaColorbuffer;\n\n/** EAGLContext */\n@property (nonatomic,readonly) EAGLContext* context;\n\n- (BOOL)resizeFromLayer:(CAEAGLLayer *)layer;\n@end\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCES2Renderer.m",
    "content": "/****************************************************************************\n Copyright (c) 2010      Ricardo Quesada\n Copyright (c) 2010-2012 cocos2d-x.org\n Corpyight (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n// Only compile this code on iOS. These files should NOT be included on your Mac project.\n// But in case they are included, it won't be compiled.\n\n#import \"CCPlatformMacros.h\"\n#import \"CCES2Renderer.h\"\n#import \"OpenGL_Internal.h\"\n\n#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0\n#define NSLog(...)       do {} while (0)\n#endif\n\n@implementation CCES2Renderer\n\n@synthesize context=context_;\n@synthesize defaultFramebuffer=defaultFramebuffer_;\n@synthesize colorRenderbuffer=colorRenderbuffer_;\n@synthesize msaaColorbuffer=msaaColorbuffer_;\n@synthesize msaaFramebuffer=msaaFramebuffer_;\n\n// Create an OpenGL ES 2.0 context\n- (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples\n{\n    self = [super init];\n    if (self)\n    {\n        if( ! sharegroup )\n            context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];\n        else\n            context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:sharegroup];\n\n        if (!context_ || ![EAGLContext setCurrentContext:context_] )\n        {\n            [self release];\n            return nil;\n        }\n        \n        depthFormat_ = depthFormat;\n        pixelFormat_ = pixelFormat;\n        multiSampling_ = multiSampling;\n\n        // Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer\n        glGenFramebuffers(1, &defaultFramebuffer_);\n        NSAssert( defaultFramebuffer_, @\"Can't create default frame buffer\");\n\n        glGenRenderbuffers(1, &colorRenderbuffer_);\n        NSAssert( colorRenderbuffer_, @\"Can't create default render buffer\");\n\n        glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer_);\n        glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_);\n        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderbuffer_);\n\n        if (multiSampling_)\n        {\n            GLint maxSamplesAllowed;\n            glGetIntegerv(GL_MAX_SAMPLES_APPLE, &maxSamplesAllowed);\n            samplesToUse_ = MIN(maxSamplesAllowed,requestedSamples);\n            \n            /* Create the MSAA framebuffer (offscreen) */\n            glGenFramebuffers(1, &msaaFramebuffer_);\n            NSAssert( msaaFramebuffer_, @\"Can't create default MSAA frame buffer\");\n            glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer_);\n            \n        }\n\n        CHECK_GL_ERROR();\n    }\n\n    return self;\n}\n\n- (BOOL)resizeFromLayer:(CAEAGLLayer *)layer\n{\n    // Allocate color buffer backing based on the current layer size\n    glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_);\n\n    if( ! [context_ renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer] )\n    {\n        NSLog(@\"failed to call context\");\n    }\n    \n    glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth_);\n    glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight_);\n\n    NSLog(@\"cocos2d: surface size: %dx%d\", (int)backingWidth_, (int)backingHeight_);\n\n    if (multiSampling_)\n    {\n        if ( msaaColorbuffer_) {\n            glDeleteRenderbuffers(1, &msaaColorbuffer_);\n            msaaColorbuffer_ = 0;\n        }\n        \n        /* Create the offscreen MSAA color buffer.\n         After rendering, the contents of this will be blitted into ColorRenderbuffer */\n        \n        //msaaFrameBuffer needs to be binded\n        glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer_);\n        glGenRenderbuffers(1, &msaaColorbuffer_);\n        NSAssert(msaaFramebuffer_, @\"Can't create MSAA color buffer\");\n        \n        glBindRenderbuffer(GL_RENDERBUFFER, msaaColorbuffer_);\n        \n        glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, samplesToUse_, pixelFormat_ , backingWidth_, backingHeight_);\n        \n        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, msaaColorbuffer_);\n        \n        GLenum error;\n        if ( (error=glCheckFramebufferStatus(GL_FRAMEBUFFER)) != GL_FRAMEBUFFER_COMPLETE)\n        {\n            NSLog(@\"Failed to make complete framebuffer object 0x%X\", error);\n            return NO;\n        }\n    }\n\n    CHECK_GL_ERROR();\n\n    if (depthFormat_)\n    {\n        if( ! depthBuffer_ ) {\n            glGenRenderbuffers(1, &depthBuffer_);\n            NSAssert(depthBuffer_, @\"Can't create depth buffer\");\n        }\n\n        glBindRenderbuffer(GL_RENDERBUFFER, depthBuffer_);\n        \n        if( multiSampling_ )\n            glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, samplesToUse_, depthFormat_,backingWidth_, backingHeight_);\n        else\n            glRenderbufferStorage(GL_RENDERBUFFER, depthFormat_, backingWidth_, backingHeight_);\n\n        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer_);\n        \n        if (depthFormat_ == GL_DEPTH24_STENCIL8_OES) {\n\t\t\tglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthBuffer_);\n\t\t}\n\n        // bind color buffer\n        glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_);        \n    }\n\n    CHECK_GL_ERROR();\n\n    GLenum error;\n    if( (error=glCheckFramebufferStatus(GL_FRAMEBUFFER)) != GL_FRAMEBUFFER_COMPLETE)\n    {\n        NSLog(@\"Failed to make complete framebuffer object 0x%X\", error);\n        return NO;\n    }\n\n    return YES;\n}\n\n-(CGSize) backingSize\n{\n    return CGSizeMake( backingWidth_, backingHeight_);\n}\n\n- (NSString*) description\n{\n    return [NSString stringWithFormat:@\"<%@ = %08X | size = %ix%i>\", [self class], (unsigned int)self, backingWidth_, backingHeight_];\n}\n\n- (unsigned int) colorRenderBuffer\n{\n    return colorRenderbuffer_;\n}\n\n- (unsigned int) defaultFrameBuffer\n{\n    return defaultFramebuffer_;\n}\n\n- (unsigned int) msaaFrameBuffer\n{\n    return msaaFramebuffer_;\n}\n\n- (unsigned int) msaaColorBuffer\n{\n    return msaaColorbuffer_;\n}\n\n- (void)dealloc\n{\n//    CCLOGINFO(\"deallocing CCES2Renderer: %p\", self);\n\n    // Tear down GL\n    if (defaultFramebuffer_) {\n        glDeleteFramebuffers(1, &defaultFramebuffer_);\n        defaultFramebuffer_ = 0;\n    }\n\n    if (colorRenderbuffer_) {\n        glDeleteRenderbuffers(1, &colorRenderbuffer_);\n        colorRenderbuffer_ = 0;\n    }\n\n    if( depthBuffer_ ) {\n        glDeleteRenderbuffers(1, &depthBuffer_ );\n        depthBuffer_ = 0;\n    }\n    \n    if ( msaaColorbuffer_)\n    {\n        glDeleteRenderbuffers(1, &msaaColorbuffer_);\n        msaaColorbuffer_ = 0;\n    }\n    \n    if ( msaaFramebuffer_)\n    {\n        glDeleteRenderbuffers(1, &msaaFramebuffer_);\n        msaaFramebuffer_ = 0;\n    }\n\n    // Tear down context\n    if ([EAGLContext currentContext] == context_)\n        [EAGLContext setCurrentContext:nil];\n\n    [context_ release];\n    context_ = nil;\n\n    [super dealloc];\n}\n\n@end\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCESRenderer.h",
    "content": "/****************************************************************************\n Copyright (c) 2010      Ricardo Quesada\n Copyright (c) 2010-2012 cocos2d-x.org\n Corpyight (c) 2011      Zynga Inc.\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n// Only compile this code on iOS. These files should NOT be included on your Mac project.\n// But in case they are included, it won't be compiled.\n#include \"CCPlatformMacros.h\"\n#import <QuartzCore/QuartzCore.h>\n\n#import <OpenGLES/EAGL.h>\n#import <OpenGLES/EAGLDrawable.h>\n\n@protocol CCESRenderer <NSObject>\n\n- (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples;\n\n- (BOOL) resizeFromLayer:(CAEAGLLayer *)layer;\n\n- (EAGLContext*) context;\n- (CGSize) backingSize;\n\n- (unsigned int) colorRenderBuffer;\n- (unsigned int) defaultFrameBuffer;\n- (unsigned int) msaaFrameBuffer;\n- (unsigned int) msaaColorBuffer;\n@end\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCGL.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __PLATFORM_IOS_CCGL_H__\n#define __PLATFORM_IOS_CCGL_H__\n\n#define\tglClearDepth\t\t\t\tglClearDepthf\n#define glDeleteVertexArrays\t\tglDeleteVertexArraysOES\n#define glGenVertexArrays\t\t\tglGenVertexArraysOES\n#define glBindVertexArray\t\t\tglBindVertexArrayOES\n#define glMapBuffer\t\t\t\t\tglMapBufferOES\n#define glUnmapBuffer\t\t\t\tglUnmapBufferOES\n\n#define GL_DEPTH24_STENCIL8\t\t\tGL_DEPTH24_STENCIL8_OES\n#define GL_WRITE_ONLY\t\t\t\tGL_WRITE_ONLY_OES\n\n#include <OpenGLES/ES2/gl.h>\n#include <OpenGLES/ES2/glext.h>\n\n\n#endif // __PLATFORM_IOS_CCGL_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCImage.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCImageCommon_cpp.h\"\n\n#import \"CCImage.h\"\n#import \"CCFileUtils.h\"\n#import \"platform/CCCommon.h\"\n#import <string>\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n\n#include<math.h>\n\n\ntypedef struct\n{\n    unsigned int height;\n    unsigned int width;\n    bool         isPremultipliedAlpha;\n    bool         hasShadow;\n    CGSize       shadowOffset;\n    float        shadowBlur;\n    float        shadowOpacity;\n    bool         hasStroke;\n    float        strokeColorR;\n    float        strokeColorG;\n    float        strokeColorB;\n    float        strokeSize;\n    float        tintColorR;\n    float        tintColorG;\n    float        tintColorB;\n    \n    unsigned char*  data;\n    \n} tImageInfo;\n\nstatic CGSize _calculateStringSize(NSString *str, id font, CGSize *constrainSize)\n{\n    NSArray *listItems = [str componentsSeparatedByString: @\"\\n\"];\n    CGSize dim = CGSizeZero;\n    CGSize textRect = CGSizeZero;\n    textRect.width = constrainSize->width > 0 ? constrainSize->width\n                                              : 0x7fffffff;\n    textRect.height = constrainSize->height > 0 ? constrainSize->height\n                                              : 0x7fffffff;\n    \n    \n    for (NSString *s in listItems)\n    {\n        CGSize tmp = [s sizeWithFont:font constrainedToSize:textRect];\n        \n        if (tmp.width > dim.width)\n        {\n           dim.width = tmp.width; \n        }\n        \n        dim.height += tmp.height;\n    }\n    \n    return dim;\n}\n\n// refer Image::ETextAlign\n#define ALIGN_TOP    1\n#define ALIGN_CENTER 3\n#define ALIGN_BOTTOM 2\n\nstatic bool _initWithString(const char * text, cocos2d::Image::TextAlign align, const char * fontName, int size, tImageInfo* info)\n{\n    bool bRet = false;\n    do \n    {\n        CC_BREAK_IF(! text || ! info);\n        \n        NSString * str          = [NSString stringWithUTF8String:text];\n        NSString * fntName      = [NSString stringWithUTF8String:fontName];\n        \n        CGSize dim, constrainSize;\n        \n        constrainSize.width     = info->width;\n        constrainSize.height    = info->height;\n        \n        // On iOS custom fonts must be listed beforehand in the App info.plist (in order to be usable) and referenced only the by the font family name itself when\n        // calling [UIFont fontWithName]. Therefore even if the developer adds 'SomeFont.ttf' or 'fonts/SomeFont.ttf' to the App .plist, the font must\n        // be referenced as 'SomeFont' when calling [UIFont fontWithName]. Hence we strip out the folder path components and the extension here in order to get just\n        // the font family name itself. This stripping step is required especially for references to user fonts stored in CCB files; CCB files appear to store\n        // the '.ttf' extensions when referring to custom fonts.\n        fntName = [[fntName lastPathComponent] stringByDeletingPathExtension];\n        \n        // create the font   \n        id font = [UIFont fontWithName:fntName size:size];\n        \n        if (font)\n        {\n            dim = _calculateStringSize(str, font, &constrainSize);\n        }\n        else\n        {\n            if (!font)\n            {\n                font = [UIFont systemFontOfSize:size];\n            }\n                \n            if (font)\n            {\n                dim = _calculateStringSize(str, font, &constrainSize);\n            }\n        }\n\n        CC_BREAK_IF(! font);\n        \n        // compute start point\n        int startH = 0;\n        if (constrainSize.height > dim.height)\n        {\n            // vertical alignment\n            unsigned int vAlignment = ((int)align >> 4) & 0x0F;\n            if (vAlignment == ALIGN_TOP)\n            {\n                startH = 0;\n            }\n            else if (vAlignment == ALIGN_CENTER)\n            {\n                startH = (constrainSize.height - dim.height) / 2;\n            }\n            else \n            {\n                startH = constrainSize.height - dim.height;\n            }\n        }\n        \n        // adjust text rect\n        if (constrainSize.width > 0 && constrainSize.width > dim.width)\n        {\n            dim.width = constrainSize.width;\n        }\n        if (constrainSize.height > 0 && constrainSize.height > dim.height)\n        {\n            dim.height = constrainSize.height;\n        }\n        \n        \n        // compute the padding needed by shadow and stroke\n        float shadowStrokePaddingX = 0.0f;\n        float shadowStrokePaddingY = 0.0f;\n        \n        if ( info->hasStroke )\n        {\n            shadowStrokePaddingX = ceilf(info->strokeSize);\n            shadowStrokePaddingY = ceilf(info->strokeSize);\n        }\n        \n        if ( info->hasShadow )\n        {\n            shadowStrokePaddingX = std::max(shadowStrokePaddingX, (float)fabs(info->shadowOffset.width));\n            shadowStrokePaddingY = std::max(shadowStrokePaddingY, (float)fabs(info->shadowOffset.height));\n        }\n        \n        // add the padding (this could be 0 if no shadow and no stroke)\n        dim.width  += shadowStrokePaddingX;\n        dim.height += shadowStrokePaddingY;\n        \n        \n        unsigned char* data = new unsigned char[(int)(dim.width * dim.height * 4)];\n        memset(data, 0, (int)(dim.width * dim.height * 4));\n        \n        // draw text\n        CGColorSpaceRef colorSpace  = CGColorSpaceCreateDeviceRGB();\n        CGContextRef context        = CGBitmapContextCreate(data,\n                                                            dim.width,\n                                                            dim.height,\n                                                            8,\n                                                            (int)(dim.width) * 4,\n                                                            colorSpace,\n                                                            kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);                \n        if (!context)\n        {\n            CGColorSpaceRelease(colorSpace);\n            delete[] data;\n            break;\n        }\n\n        // text color\n        CGContextSetRGBFillColor(context, info->tintColorR, info->tintColorG, info->tintColorB, 1);\n        // move Y rendering to the top of the image\n        CGContextTranslateCTM(context, 0.0f, (dim.height - shadowStrokePaddingY) );\n        CGContextScaleCTM(context, 1.0f, -1.0f); //NOTE: NSString draws in UIKit referential i.e. renders upside-down compared to CGBitmapContext referential\n        \n        // store the current context\n        UIGraphicsPushContext(context);\n        \n        // measure text size with specified font and determine the rectangle to draw text in\n        unsigned uHoriFlag = (int)align & 0x0f;\n        UITextAlignment testAlign = (UITextAlignment)((2 == uHoriFlag) ? UITextAlignmentRight\n                                : (3 == uHoriFlag) ? UITextAlignmentCenter\n                                : UITextAlignmentLeft);\n\n        \n        // take care of stroke if needed\n        if ( info->hasStroke )\n        {\n            CGContextSetTextDrawingMode(context, kCGTextFillStroke);\n            CGContextSetRGBStrokeColor(context, info->strokeColorR, info->strokeColorG, info->strokeColorB, 1);\n            CGContextSetLineWidth(context, info->strokeSize);\n        }\n        \n        // take care of shadow if needed\n        if ( info->hasShadow )\n        {\n            CGSize offset;\n            offset.height = info->shadowOffset.height;\n            offset.width  = info->shadowOffset.width;\n            CGFloat shadowColorValues[] = {0, 0, 0, info->shadowOpacity};\n            CGColorRef shadowColor = CGColorCreate (colorSpace, shadowColorValues);\n            \n            CGContextSetShadowWithColor(context, offset, info->shadowBlur, shadowColor);\n            \n            CGColorRelease (shadowColor);\n        }\n        \n        CGColorSpaceRelease(colorSpace);        \n        \n        \n        // normal fonts\n        //if( [font isKindOfClass:[UIFont class] ] )\n        //{\n        //    [str drawInRect:CGRectMake(0, startH, dim.width, dim.height) withFont:font lineBreakMode:(UILineBreakMode)UILineBreakModeWordWrap alignment:align];\n        //}\n        //else // ZFont class\n        //{\n        //    [FontLabelStringDrawingHelper drawInRect:str rect:CGRectMake(0, startH, dim.width, dim.height) withZFont:font lineBreakMode:(UILineBreakMode)UILineBreakModeWordWrap \n        ////alignment:align];\n        //}\n    \n        \n        \n        // compute the rect used for rendering the text\n        // based on wether shadows or stroke are enabled\n        \n        float textOriginX  = 0.0;\n        float textOrigingY = 0.0;\n        \n        float textWidth    = dim.width  - shadowStrokePaddingX;\n        float textHeight   = dim.height - shadowStrokePaddingY;\n        \n        \n        if ( info->shadowOffset.width < 0 )\n        {\n            textOriginX = shadowStrokePaddingX;\n        }\n        else\n        {\n            textOriginX = 0.0;\n        }\n        \n        if (info->shadowOffset.height > 0)\n        {\n            textOrigingY = startH;\n        }\n        else\n        {\n            textOrigingY = startH - shadowStrokePaddingY;\n        }\n        \n        CGRect rect = CGRectMake(textOriginX, textOrigingY, textWidth, textHeight);\n        \n        CGContextBeginTransparencyLayerWithRect(context, rect, nullptr);\n        // actually draw the text in the context\n\t\t// XXX: ios7 casting\n        [str drawInRect: rect withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:(NSTextAlignment)testAlign];\n\n        CGContextEndTransparencyLayer(context);\n        \n        // pop the context\n        UIGraphicsPopContext();\n        \n        // release the context\n        CGContextRelease(context);\n               \n        // output params\n        info->data                 = data;\n        info->isPremultipliedAlpha = true;\n        info->width                = dim.width;\n        info->height               = dim.height;\n        bRet                        = true;\n        \n    } while (0);\n\n    return bRet;\n}\n\nNS_CC_BEGIN\n\nbool Image::initWithString(\n                            const char * pText,\n                            int         nWidth /* = 0 */,\n                            int         nHeight /* = 0 */,\n                            TextAlign   eAlignMask /* = kAlignCenter */,\n                            const char * pFontName /* = nil */,\n                            int         nSize /* = 0 */)\n{\n    return initWithStringShadowStroke(pText, nWidth, nHeight, eAlignMask , pFontName, nSize);\n}\n\nbool Image::initWithStringShadowStroke(\n                                         const char * text,\n                                         int         width ,\n                                         int         height ,\n                                         TextAlign   alignMask ,\n                                         const char * fontName ,\n                                         int         size ,\n                                         float       textTintR,\n                                         float       textTintG,\n                                         float       textTintB,\n                                         bool shadow,\n                                         float shadowOffsetX,\n                                         float shadowOffsetY,\n                                         float shadowOpacity,\n                                         float shadowBlur,\n                                         bool  stroke,\n                                         float strokeR,\n                                         float strokeG,\n                                         float strokeB,\n                                         float strokeSize)\n{\n    \n    \n    \n    tImageInfo info = {0};\n    info.width                  = width;\n    info.height                 = height;\n    info.hasShadow              = shadow;\n    info.shadowOffset.width     = shadowOffsetX;\n    info.shadowOffset.height    = shadowOffsetY;\n    info.shadowBlur             = shadowBlur;\n    info.shadowOpacity          = shadowOpacity;\n    info.hasStroke              =  stroke;\n    info.strokeColorR           =  strokeR;\n    info.strokeColorG           = strokeG;\n    info.strokeColorB           = strokeB;\n    info.strokeSize             = strokeSize;\n    info.tintColorR             = textTintR;\n    info.tintColorG             = textTintG;\n    info.tintColorB             = textTintB;\n    \n    \n    if (! _initWithString(text, alignMask, fontName, size, &info))\n    {\n        return false;\n    }\n    _height = (short)info.height;\n    _width = (short)info.width;\n    _renderFormat = Texture2D::PixelFormat::RGBA8888;\n    _preMulti = info.isPremultipliedAlpha;\n    _data = info.data;\n    _dataLen = _width * _height * 4;\n    \n    return true;\n}\n\nbool Image::saveToFile(const std::string& filename, bool isToRGB)\n{\n    bool saveToPNG = false;\n    bool needToCopyPixels = false;\n\n    if (std::string::npos != filename.find(\".png\"))\n    {\n        saveToPNG = true;\n    }\n        \n    int bitsPerComponent = 8;            \n    int bitsPerPixel = hasAlpha() ? 32 : 24;\n    if ((! saveToPNG) || isToRGB)\n    {\n        bitsPerPixel = 24;\n    }            \n    \n    int bytesPerRow    = (bitsPerPixel/8) * _width;\n    int myDataLength = bytesPerRow * _height;\n    \n    unsigned char *pixels    = _data;\n    \n    // The data has alpha channel, and want to save it with an RGB png file,\n    // or want to save as jpg,  remove the alpha channel.\n    if ((saveToPNG && hasAlpha() && isToRGB)\n       || (! saveToPNG))\n    {\n        pixels = new unsigned char[myDataLength];\n        \n        for (int i = 0; i < _height; ++i)\n        {\n            for (int j = 0; j < _width; ++j)\n            {\n                pixels[(i * _width + j) * 3] = _data[(i * _width + j) * 4];\n                pixels[(i * _width + j) * 3 + 1] = _data[(i * _width + j) * 4 + 1];\n                pixels[(i * _width + j) * 3 + 2] = _data[(i * _width + j) * 4 + 2];\n            }\n        }\n        \n        needToCopyPixels = true;\n    }\n        \n    // make data provider with data.\n    CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault;\n    if (saveToPNG && hasAlpha() && (! isToRGB))\n    {\n        bitmapInfo |= kCGImageAlphaPremultipliedLast;\n    }\n    CGDataProviderRef provider        = CGDataProviderCreateWithData(nullptr, pixels, myDataLength, nullptr);\n    CGColorSpaceRef colorSpaceRef    = CGColorSpaceCreateDeviceRGB();\n    CGImageRef iref                    = CGImageCreate(_width, _height,\n                                                        bitsPerComponent, bitsPerPixel, bytesPerRow,\n                                                        colorSpaceRef, bitmapInfo, provider,\n                                                        nullptr, false,\n                                                        kCGRenderingIntentDefault);\n        \n    UIImage* image                    = [[UIImage alloc] initWithCGImage:iref];\n        \n    CGImageRelease(iref);    \n    CGColorSpaceRelease(colorSpaceRef);\n    CGDataProviderRelease(provider);\n    \n    NSData *data;\n                \n    if (saveToPNG)\n    {\n        data = UIImagePNGRepresentation(image);\n    }\n    else\n    {\n        data = UIImageJPEGRepresentation(image, 1.0f);\n    }\n    \n    [data writeToFile:[NSString stringWithUTF8String:filename.c_str()] atomically:YES];\n        \n    [image release];\n        \n    if (needToCopyPixels)\n    {\n        delete [] pixels;\n    }\n    \n    return true;\n}\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCPlatformDefine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCPLATFORMDEFINE_H__\n#define __CCPLATFORMDEFINE_H__\n\n#include <assert.h>\n\n#define CC_DLL \n\n#define CC_ASSERT(cond) assert(cond)\n\n\n#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam\n\n/* Define NULL pointer value */\n#ifndef NULL\n#ifdef __cplusplus\n#define NULL    0\n#else\n#define NULL    ((void *)0)\n#endif\n#endif\n\n\n\n#endif /* __CCPLATFORMDEFINE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/CCStdC.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_STD_C_H__\n#define __CC_STD_C_H__\n\n#include \"CCPlatformMacros.h\"\n#include <float.h>\n#include <math.h>\n#include <string.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n#include <sys/time.h>\n#include <stdint.h>\n\n#ifndef MIN\n#define MIN(x,y) (((x) > (y)) ? (y) : (x))\n#endif  // MIN\n\n#ifndef MAX\n#define MAX(x,y) (((x) < (y)) ? (y) : (x))\n#endif  // MAX\n\n#endif  // __CC_STD_C_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/EAGLView.h",
    "content": "/*\n\n===== IMPORTANT =====\n\nThis is sample code demonstrating API, technology or techniques in development.\nAlthough this sample code has been reviewed for technical accuracy, it is not\nfinal. Apple is supplying this information to help you plan for the adoption of\nthe technologies and programming interfaces described herein. This information\nis subject to change, and software implemented based on this sample code should\nbe tested with final operating system software and final documentation. Newer\nversions of this sample code may be provided with future seeds of the API or\ntechnology. For information about updates to this and other developer\ndocumentation, view the New & Updated sidebars in subsequent documentation\nseeds.\n\n=====================\n\nFile: EAGLView.h\nAbstract: Convenience class that wraps the CAEAGLLayer from CoreAnimation into a\nUIView subclass.\n\nVersion: 1.3\n\nDisclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc.\n(\"Apple\") in consideration of your agreement to the following terms, and your\nuse, installation, modification or redistribution of this Apple software\nconstitutes acceptance of these terms.  If you do not agree with these terms,\nplease do not use, install, modify or redistribute this Apple software.\n\nIn consideration of your agreement to abide by the following terms, and subject\nto these terms, Apple grants you a personal, non-exclusive license, under\nApple's copyrights in this original Apple software (the \"Apple Software\"), to\nuse, reproduce, modify and redistribute the Apple Software, with or without\nmodifications, in source and/or binary forms; provided that if you redistribute\nthe Apple Software in its entirety and without modifications, you must retain\nthis notice and the following text and disclaimers in all such redistributions\nof the Apple Software.\nNeither the name, trademarks, service marks or logos of Apple Inc. may be used\nto endorse or promote products derived from the Apple Software without specific\nprior written permission from Apple.  Except as expressly stated in this notice,\nno other rights or licenses, express or implied, are granted by Apple herein,\nincluding but not limited to any patent rights that may be infringed by your\nderivative works or by other works in which the Apple Software may be\nincorporated.\n\nThe Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE MAKES NO\nWARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\nWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN\nCOMBINATION WITH YOUR PRODUCTS.\n\nIN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\nGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR\nDISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF\nCONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF\nAPPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nCopyright (C) 2008 Apple Inc. All Rights Reserved.\n\n*/\n\n#import <UIKit/UIKit.h>\n#import <OpenGLES/EAGL.h>\n#import <OpenGLES/EAGLDrawable.h>\n#import <OpenGLES/ES2/gl.h>\n#import <OpenGLES/ES2/glext.h>\n#import <CoreFoundation/CoreFoundation.h>\n\n#import \"CCESRenderer.h\"\n\n//CLASS INTERFACE:\n\n/** CCEAGLView Class.\n * This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.\n * The view content is basically an EAGL surface you render your OpenGL scene into.\n * Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.\n */\n@interface CCEAGLView : UIView <UIKeyInput, UITextInput>\n{\n    id                        <CCESRenderer> renderer_;    \n    EAGLContext                *context_; // weak ref\n\n    NSString                *pixelformat_;\n    GLuint                    depthFormat_;\n    BOOL                    preserveBackbuffer_;\n\n    CGSize                    size_;\n    BOOL                    discardFramebufferSupported_;\n\n    //fsaa addition\n    BOOL                    multisampling_;\n    unsigned int               requestedSamples_;\n    BOOL                    isUseUITextField;\n@private\n    NSString *              markedText_;\n    CGRect                  caretRect_;\n    CGRect                  originalRect_;\n    NSNotification*         keyboardShowNotification_;\n    BOOL                    isKeyboardShown_;\n}\n\n@property(nonatomic, readonly) UITextPosition *beginningOfDocument;\n@property(nonatomic, readonly) UITextPosition *endOfDocument;\n@property(nonatomic, assign) id<UITextInputDelegate> inputDelegate;\n@property(nonatomic, readonly) UITextRange *markedTextRange;\n@property (nonatomic, copy) NSDictionary *markedTextStyle;\n@property(readwrite, copy) UITextRange *selectedTextRange;\n@property(nonatomic, readonly) id<UITextInputTokenizer> tokenizer;\n@property(nonatomic, readonly, getter = isKeyboardShown) BOOL isKeyboardShown;\n@property(nonatomic, copy) NSNotification* keyboardShowNotification;\n/** creates an initializes an CCEAGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer */\n+ (id) viewWithFrame:(CGRect)frame;\n/** creates an initializes an CCEAGLView with a frame, a color buffer format, and 0-bit depth buffer */\n+ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format;\n/** creates an initializes an CCEAGLView with a frame, a color buffer format, and a depth buffer format */\n+ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth;\n/** creates an initializes an CCEAGLView with a frame, a color buffer format, a depth buffer format, a sharegroup, and multisamping */\n+ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)multisampling numberOfSamples:(unsigned int)samples;\n\n// get the view object\n+(id) sharedEGLView;\n\n/** Initializes an CCEAGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer */\n- (id) initWithFrame:(CGRect)frame; //These also set the current context\n/** Initializes an CCEAGLView with a frame, a color buffer format, and 0-bit depth buffer */\n- (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format;\n/** Initializes an CCEAGLView with a frame, a color buffer format, a depth buffer format, a sharegroup and multisampling support */\n- (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)sampling numberOfSamples:(unsigned int)nSamples;\n\n/** pixel format: it could be RGBA8 (32-bit) or RGB565 (16-bit) */\n@property(nonatomic,readonly) NSString* pixelFormat;\n/** depth format of the render buffer: 0, 16 or 24 bits*/\n@property(nonatomic,readonly) GLuint depthFormat;\n\n/** returns surface size in pixels */\n@property(nonatomic,readonly) CGSize surfaceSize;\n\n/** OpenGL context */\n@property(nonatomic,readonly) EAGLContext *context;\n\n@property(nonatomic,readwrite) BOOL multiSampling;\n\n\n/** CCEAGLView uses double-buffer. This method swaps the buffers */\n-(void) swapBuffers;\n\n- (CGRect) convertRectFromViewToSurface:(CGRect)rect;\n- (CGPoint) convertPointFromViewToSurface:(CGPoint)point;\n\n-(int) getWidth;\n-(int) getHeight;\n\n-(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis;\n-(void) doAnimationWhenAnotherEditBeClicked;\n@end\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/EAGLView.mm",
    "content": "/*\n\n===== IMPORTANT =====\n\nThis is sample code demonstrating API, technology or techniques in development.\nAlthough this sample code has been reviewed for technical accuracy, it is not\nfinal. Apple is supplying this information to help you plan for the adoption of\nthe technologies and programming interfaces described herein. This information\nis subject to change, and software implemented based on this sample code should\nbe tested with final operating system software and final documentation. Newer\nversions of this sample code may be provided with future seeds of the API or\ntechnology. For information about updates to this and other developer\ndocumentation, view the New & Updated sidebars in subsequent documentation\nseeds.\n\n=====================\n\nFile: EAGLView.m\nAbstract: Convenience class that wraps the CAEAGLLayer from CoreAnimation into a\nUIView subclass.\n\nVersion: 1.3\n\nDisclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc.\n(\"Apple\") in consideration of your agreement to the following terms, and your\nuse, installation, modification or redistribution of this Apple software\nconstitutes acceptance of these terms.  If you do not agree with these terms,\nplease do not use, install, modify or redistribute this Apple software.\n\nIn consideration of your agreement to abide by the following terms, and subject\nto these terms, Apple grants you a personal, non-exclusive license, under\nApple's copyrights in this original Apple software (the \"Apple Software\"), to\nuse, reproduce, modify and redistribute the Apple Software, with or without\nmodifications, in source and/or binary forms; provided that if you redistribute\nthe Apple Software in its entirety and without modifications, you must retain\nthis notice and the following text and disclaimers in all such redistributions\nof the Apple Software.\nNeither the name, trademarks, service marks or logos of Apple Inc. may be used\nto endorse or promote products derived from the Apple Software without specific\nprior written permission from Apple.  Except as expressly stated in this notice,\nno other rights or licenses, express or implied, are granted by Apple herein,\nincluding but not limited to any patent rights that may be infringed by your\nderivative works or by other works in which the Apple Software may be\nincorporated.\n\nThe Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE MAKES NO\nWARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\nWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN\nCOMBINATION WITH YOUR PRODUCTS.\n\nIN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\nGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR\nDISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF\nCONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF\nAPPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nCopyright (C) 2008 Apple Inc. All Rights Reserved.\n\n*/\n\n#import <QuartzCore/QuartzCore.h>\n#import \"CCEGLView.h\"\n#import \"EAGLView.h\"\n#import \"CCES2Renderer.h\"\n#import \"CCDirector.h\"\n#import \"CCSet.h\"\n#import \"CCTouch.h\"\n#import \"CCIMEDispatcher.h\"\n#import \"OpenGL_Internal.h\"\n#import \"CCEGLView.h\"\n//CLASS IMPLEMENTATIONS:\n\n#define IOS_MAX_TOUCHES_COUNT     10\n\nstatic CCEAGLView *__view = 0;\n\n@interface CCEAGLView (Private)\n- (BOOL) setupSurfaceWithSharegroup:(EAGLSharegroup*)sharegroup;\n- (unsigned int) convertPixelFormat:(NSString*) pixelFormat;\n@end\n\n@implementation CCEAGLView\n\n@synthesize surfaceSize=size_;\n@synthesize pixelFormat=pixelformat_, depthFormat=depthFormat_;\n@synthesize context=context_;\n@synthesize multiSampling=multiSampling_;\n@synthesize isKeyboardShown=isKeyboardShown_;\n@synthesize keyboardShowNotification = keyboardShowNotification_;\n+ (Class) layerClass\n{\n    return [CAEAGLLayer class];\n}\n\n+ (id) viewWithFrame:(CGRect)frame\n{\n    return [[[self alloc] initWithFrame:frame] autorelease];\n}\n\n+ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format\n{\n    return [[[self alloc]initWithFrame:frame pixelFormat:format] autorelease];\n}\n\n+ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth\n{\n    return [[[self alloc] initWithFrame:frame pixelFormat:format depthFormat:depth preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0] autorelease];\n}\n\n+ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)multisampling numberOfSamples:(unsigned int)samples\n{\n    return [[[self alloc]initWithFrame:frame pixelFormat:format depthFormat:depth preserveBackbuffer:retained sharegroup:sharegroup multiSampling:multisampling numberOfSamples:samples] autorelease];\n}\n\n+ (id) sharedEGLView\n{\n    return __view;\n}\n\n- (id) initWithFrame:(CGRect)frame\n{\n    return [self initWithFrame:frame pixelFormat:kEAGLColorFormatRGB565 depthFormat:0 preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0];\n}\n\n- (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format \n{\n    return [self initWithFrame:frame pixelFormat:format depthFormat:0 preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0];\n}\n\n- (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)sampling numberOfSamples:(unsigned int)nSamples;\n{\n    if((self = [super initWithFrame:frame]))\n    {\n        isUseUITextField = YES;\n        pixelformat_ = format;\n        depthFormat_ = depth;\n        multiSampling_ = sampling;\n        requestedSamples_ = nSamples;\n        preserveBackbuffer_ = retained;\n        markedText_ = nil;\n        if( ! [self setupSurfaceWithSharegroup:sharegroup] ) {\n            [self release];\n            return nil;\n        }\n\n        \n        __view = self;\n        \n        originalRect_ = self.frame;\n        self.keyboardShowNotification = nil;\n\t\t\n\t\tif ([__view respondsToSelector:@selector(setContentScaleFactor:)])\n\t\t{\n\t\t\t__view.contentScaleFactor = [[UIScreen mainScreen] scale];\n\t\t}\n    }\n        \n    return self;\n}\n\n-(id) initWithCoder:(NSCoder *)aDecoder\n{\n    if( (self = [super initWithCoder:aDecoder]) ) {\n        \n        CAEAGLLayer*            eaglLayer = (CAEAGLLayer*)[self layer];\n        \n        pixelformat_ = kEAGLColorFormatRGB565;\n        depthFormat_ = 0; // GL_DEPTH_COMPONENT24_OES;\n        multiSampling_= NO;\n        requestedSamples_ = 0;\n        size_ = [eaglLayer bounds].size;\n        markedText_ = nil;\n        \n        if( ! [self setupSurfaceWithSharegroup:nil] ) {\n            [self release];\n            return nil;\n        }\n    }\n    \n    __view = self;\n    return self;\n}\n\n- (void)didMoveToWindow;\n{\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(onUIKeyboardNotification:)\n                                                 name:UIKeyboardWillShowNotification object:nil];\n    \n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(onUIKeyboardNotification:)\n                                                 name:UIKeyboardDidShowNotification object:nil];\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(onUIKeyboardNotification:)\n                                                 name:UIKeyboardWillHideNotification object:nil];\n    \n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(onUIKeyboardNotification:)\n                                                 name:UIKeyboardDidHideNotification object:nil];\n}\n\n-(int) getWidth\n{\n    CGSize bound = [self bounds].size;\n    return (int)bound.width * self.contentScaleFactor;\n}\n\n-(int) getHeight\n{\n    CGSize bound = [self bounds].size;\n    return (int)bound.height * self.contentScaleFactor;\n}\n\n\n-(BOOL) setupSurfaceWithSharegroup:(EAGLSharegroup*)sharegroup\n{\n    CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;\n    \n    eaglLayer.opaque = YES;\n    eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:\n                                    [NSNumber numberWithBool:preserveBackbuffer_], kEAGLDrawablePropertyRetainedBacking,\n                                    pixelformat_, kEAGLDrawablePropertyColorFormat, nil];\n    \n    \n    renderer_ = [[CCES2Renderer alloc] initWithDepthFormat:depthFormat_\n                                         withPixelFormat:[self convertPixelFormat:pixelformat_]\n                                          withSharegroup:sharegroup\n                                       withMultiSampling:multiSampling_\n                                     withNumberOfSamples:requestedSamples_];\n    \n    NSAssert(renderer_, @\"OpenGL ES 2.O is required.\");\n    if (!renderer_)\n        return NO;\n    \n    context_ = [renderer_ context];\n    \n    #if GL_EXT_discard_framebuffer == 1\n        discardFramebufferSupported_ = YES;\n    #else\n        discardFramebufferSupported_ = NO;\n    #endif\n    \n    CHECK_GL_ERROR();\n    \n    return YES;\n}\n\n- (void) dealloc\n{\n    [renderer_ release];\n    self.keyboardShowNotification = nullptr; // implicit release\n    [super dealloc];\n}\n\n- (void) layoutSubviews\n{\n    [renderer_ resizeFromLayer:(CAEAGLLayer*)self.layer];\n    size_ = [renderer_ backingSize];\n\n    // Issue #914 #924\n//     Director *director = [Director sharedDirector];\n//     [director reshapeProjection:size_];\n    cocos2d::Size size;\n    size.width = size_.width;\n    size.height = size_.height;\n    //cocos2d::Director::getInstance()->reshapeProjection(size);\n\n    // Avoid flicker. Issue #350\n    //[director performSelectorOnMainThread:@selector(drawScene) withObject:nil waitUntilDone:YES];\n    cocos2d::Director::getInstance()->drawScene();\n}\n\n- (void) swapBuffers\n{\n    // IMPORTANT:\n    // - preconditions\n    //    -> context_ MUST be the OpenGL context\n    //    -> renderbuffer_ must be the the RENDER BUFFER\n\n#ifdef __IPHONE_4_0\n    \n    if (multiSampling_)\n    {\n        /* Resolve from msaaFramebuffer to resolveFramebuffer */\n        //glDisable(GL_SCISSOR_TEST);     \n        glBindFramebuffer(GL_READ_FRAMEBUFFER_APPLE, [renderer_ msaaFrameBuffer]);\n        glBindFramebuffer(GL_DRAW_FRAMEBUFFER_APPLE, [renderer_ defaultFrameBuffer]);\n        glResolveMultisampleFramebufferAPPLE();\n    }\n    \n    if(discardFramebufferSupported_)\n    {    \n        if (multiSampling_)\n        {\n            if (depthFormat_)\n            {\n                GLenum attachments[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT};\n                glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 2, attachments);\n            }\n            else\n            {\n                GLenum attachments[] = {GL_COLOR_ATTACHMENT0};\n                glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 1, attachments);\n            }\n            \n            glBindRenderbuffer(GL_RENDERBUFFER, [renderer_ colorRenderBuffer]);\n    \n        }    \n        \n        // not MSAA\n        else if (depthFormat_ ) {\n            GLenum attachments[] = { GL_DEPTH_ATTACHMENT};\n            glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments);\n        }\n    }\n    \n#endif // __IPHONE_4_0\n    \n     if(![context_ presentRenderbuffer:GL_RENDERBUFFER])\n        {\n//         CCLOG(@\"cocos2d: Failed to swap renderbuffer in %s\\n\", __FUNCTION__);\n        }\n\n#if COCOS2D_DEBUG\n    CHECK_GL_ERROR();\n#endif\n    \n    // We can safely re-bind the framebuffer here, since this will be the\n    // 1st instruction of the new main loop\n    if( multiSampling_ )\n        glBindFramebuffer(GL_FRAMEBUFFER, [renderer_ msaaFrameBuffer]);    \n}\n\n- (unsigned int) convertPixelFormat:(NSString*) pixelFormat\n{\n    // define the pixel format\n    GLenum pFormat;\n    \n    \n    if([pixelFormat isEqualToString:@\"EAGLColorFormat565\"]) \n        pFormat = GL_RGB565;\n    else \n        pFormat = GL_RGBA8_OES;\n    \n    return pFormat;\n}\n\n#pragma mark CCEAGLView - Point conversion\n\n- (CGPoint) convertPointFromViewToSurface:(CGPoint)point\n{\n    CGRect bounds = [self bounds];\n        \n        CGPoint ret;\n        ret.x = (point.x - bounds.origin.x) / bounds.size.width * size_.width;\n        ret.y =  (point.y - bounds.origin.y) / bounds.size.height * size_.height;\n    \n        return ret;\n}\n\n- (CGRect) convertRectFromViewToSurface:(CGRect)rect\n{\n    CGRect bounds = [self bounds];\n    \n        CGRect ret;\n        ret.origin.x = (rect.origin.x - bounds.origin.x) / bounds.size.width * size_.width;\n        ret.origin.y = (rect.origin.y - bounds.origin.y) / bounds.size.height * size_.height;\n        ret.size.width = rect.size.width / bounds.size.width * size_.width;\n        ret.size.height = rect.size.height / bounds.size.height * size_.height;\n    \n        return ret;\n}\n\n\n-(void) handleTouchesAfterKeyboardShow\n{\n    NSArray *subviews = self.subviews;\n    \n    for(UIView* view in subviews)\n    {\n        if([view isKindOfClass:NSClassFromString(@\"CCCustomUITextField\")])\n        {\n            if ([view isFirstResponder])\n            {\n                [view resignFirstResponder];\n                return;\n            }\n        }\n    }\n}\n\n// Pass the touches to the superview\n#pragma mark CCEAGLView - Touch Delegate\n- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    if (isKeyboardShown_)\n    {\n        [self handleTouchesAfterKeyboardShow];\n        return;\n    }\n    \n    UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0};\n    float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    \n    int i = 0;\n    for (UITouch *touch in touches) {\n        ids[i] = touch;\n        xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;;\n        ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;;\n        ++i;\n    }\n    cocos2d::EGLView::getInstance()->handleTouchesBegin(i, (int*)ids, xs, ys);\n}\n\n- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    if (isKeyboardShown_)\n    {\n        return;\n    }\n    UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0};\n    float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    \n    int i = 0;\n    for (UITouch *touch in touches) {\n        ids[i] = touch;\n        xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;;\n        ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;;\n        ++i;\n    }\n    cocos2d::EGLView::getInstance()->handleTouchesMove(i, (int*)ids, xs, ys);\n}\n\n- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    if (isKeyboardShown_)\n    {\n        return;\n    }\n    \n    UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0};\n    float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    \n    int i = 0;\n    for (UITouch *touch in touches) {\n        ids[i] = touch;\n        xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;;\n        ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;;\n        ++i;\n    }\n    cocos2d::EGLView::getInstance()->handleTouchesEnd(i, (int*)ids, xs, ys);\n}\n    \n- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event\n{\n    if (isKeyboardShown_)\n    {\n        return;\n    }\n    \n    UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0};\n    float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};\n    \n    int i = 0;\n    for (UITouch *touch in touches) {\n        ids[i] = touch;\n        xs[i] = [touch locationInView: [touch view]].x * __view.contentScaleFactor;;\n        ys[i] = [touch locationInView: [touch view]].y * __view.contentScaleFactor;;\n        ++i;\n    }\n    cocos2d::EGLView::getInstance()->handleTouchesCancel(i, (int*)ids, xs, ys);\n}\n\n#pragma mark - UIView - Responder\n\n- (BOOL)canBecomeFirstResponder\n{\n    if (nil != markedText_) {\n        [markedText_ release];\n    }\n    markedText_ = nil;\n    if (isUseUITextField)\n    {\n        return NO;\n    }\n    return YES;\n}\n\n- (BOOL)becomeFirstResponder\n{\n    isUseUITextField = NO;\n    return [super becomeFirstResponder];\n}\n\n- (BOOL)resignFirstResponder\n{\n    isUseUITextField = YES;\n    return [super resignFirstResponder];\n}\n\n#pragma mark - UIKeyInput protocol\n\n\n- (BOOL)hasText\n{\n    return NO;\n}\n\n- (void)insertText:(NSString *)text\n{\n    if (nil != markedText_) {\n        [markedText_ release];\n        markedText_ = nil;\n    }\n    const char * pszText = [text cStringUsingEncoding:NSUTF8StringEncoding];\n    cocos2d::IMEDispatcher::sharedDispatcher()->dispatchInsertText(pszText, strlen(pszText));\n}\n\n- (void)deleteBackward\n{\n    if (nil != markedText_) {\n        [markedText_ release];\n        markedText_ = nil;\n    }\n    cocos2d::IMEDispatcher::sharedDispatcher()->dispatchDeleteBackward();\n}\n\n#pragma mark - UITextInputTrait protocol\n\n-(UITextAutocapitalizationType) autocapitalizationType\n{\n    return UITextAutocapitalizationTypeNone;\n}\n\n#pragma mark - UITextInput protocol\n\n#pragma mark UITextInput - properties\n\n@synthesize beginningOfDocument;\n@synthesize endOfDocument;\n@synthesize inputDelegate;\n@synthesize markedTextRange;\n@synthesize markedTextStyle;\n// @synthesize selectedTextRange;       // must implement\n@synthesize tokenizer;\n\n/* Text may have a selection, either zero-length (a caret) or ranged.  Editing operations are\n * always performed on the text from this selection.  nil corresponds to no selection. */\n- (void)setSelectedTextRange:(UITextRange *)aSelectedTextRange;\n{\n    CCLOG(\"UITextRange:setSelectedTextRange\");\n}\n- (UITextRange *)selectedTextRange;\n{\n    return [[[UITextRange alloc] init] autorelease];\n}\n\n#pragma mark UITextInput - Replacing and Returning Text\n\n- (NSString *)textInRange:(UITextRange *)range;\n{\n    CCLOG(\"textInRange\");\n    return @\"\";\n}\n- (void)replaceRange:(UITextRange *)range withText:(NSString *)theText;\n{\n    CCLOG(\"replaceRange\");\n}\n\n#pragma mark UITextInput - Working with Marked and Selected Text\n\n\n\n/* If text can be selected, it can be marked. Marked text represents provisionally\n * inserted text that has yet to be confirmed by the user.  It requires unique visual\n * treatment in its display.  If there is any marked text, the selection, whether a\n * caret or an extended range, always resides within.\n *\n * Setting marked text either replaces the existing marked text or, if none is present,\n * inserts it from the current selection. */ \n\n- (void)setMarkedTextRange:(UITextRange *)markedTextRange;\n{\n    CCLOG(\"setMarkedTextRange\");\n}\n\n- (UITextRange *)markedTextRange;\n{\n    CCLOG(\"markedTextRange\");\n    return nil; // Nil if no marked text.\n}\n- (void)setMarkedTextStyle:(NSDictionary *)markedTextStyle;\n{\n    CCLOG(\"setMarkedTextStyle\");\n    \n}\n- (NSDictionary *)markedTextStyle;\n{\n    CCLOG(\"markedTextStyle\");\n    return nil;\n}\n- (void)setMarkedText:(NSString *)markedText selectedRange:(NSRange)selectedRange;\n{\n    CCLOG(\"setMarkedText\");\n    if (markedText == markedText_) {\n        return;\n    }\n    if (nil != markedText_) {\n        [markedText_ release];\n    }\n    markedText_ = markedText;\n    [markedText_ retain];\n}\n- (void)unmarkText;\n{\n    CCLOG(\"unmarkText\");\n    if (nil == markedText_)\n    {\n        return;\n    }\n    const char * pszText = [markedText_ cStringUsingEncoding:NSUTF8StringEncoding];\n    cocos2d::IMEDispatcher::sharedDispatcher()->dispatchInsertText(pszText, strlen(pszText));\n    [markedText_ release];\n    markedText_ = nil;\n}\n\n#pragma mark Methods for creating ranges and positions.\n\n- (UITextRange *)textRangeFromPosition:(UITextPosition *)fromPosition toPosition:(UITextPosition *)toPosition;\n{\n    CCLOG(\"textRangeFromPosition\");\n    return nil;\n}\n- (UITextPosition *)positionFromPosition:(UITextPosition *)position offset:(NSInteger)offset;\n{\n    CCLOG(\"positionFromPosition\");\n    return nil;\n}\n- (UITextPosition *)positionFromPosition:(UITextPosition *)position inDirection:(UITextLayoutDirection)direction offset:(NSInteger)offset;\n{\n    CCLOG(\"positionFromPosition\");\n    return nil;\n}\n\n/* Simple evaluation of positions */\n- (NSComparisonResult)comparePosition:(UITextPosition *)position toPosition:(UITextPosition *)other;\n{\n    CCLOG(\"comparePosition\");\n    return (NSComparisonResult)0;\n}\n- (NSInteger)offsetFromPosition:(UITextPosition *)from toPosition:(UITextPosition *)toPosition;\n{\n    CCLOG(\"offsetFromPosition\");\n    return 0;\n}\n\n- (UITextPosition *)positionWithinRange:(UITextRange *)range farthestInDirection:(UITextLayoutDirection)direction;\n{\n    CCLOG(\"positionWithinRange\");\n    return nil;\n}\n- (UITextRange *)characterRangeByExtendingPosition:(UITextPosition *)position inDirection:(UITextLayoutDirection)direction;\n{\n    CCLOG(\"characterRangeByExtendingPosition\");\n    return nil;\n}\n\n#pragma mark Writing direction\n\n- (UITextWritingDirection)baseWritingDirectionForPosition:(UITextPosition *)position inDirection:(UITextStorageDirection)direction;\n{\n    CCLOG(\"baseWritingDirectionForPosition\");\n    return UITextWritingDirectionNatural;\n}\n- (void)setBaseWritingDirection:(UITextWritingDirection)writingDirection forRange:(UITextRange *)range;\n{\n    CCLOG(\"setBaseWritingDirection\");\n}\n\n#pragma mark Geometry\n\n/* Geometry used to provide, for example, a correction rect. */\n- (CGRect)firstRectForRange:(UITextRange *)range;\n{\n    CCLOG(\"firstRectForRange\");\n    return CGRectNull;\n}\n- (CGRect)caretRectForPosition:(UITextPosition *)position;\n{\n    CCLOG(\"caretRectForPosition\");\n    return caretRect_;\n}\n\n#pragma mark Hit testing\n\n/* JS - Find the closest position to a given point */\n- (UITextPosition *)closestPositionToPoint:(CGPoint)point;\n{\n    CCLOG(\"closestPositionToPoint\");\n    return nil;\n}\n- (UITextPosition *)closestPositionToPoint:(CGPoint)point withinRange:(UITextRange *)range;\n{\n    CCLOG(\"closestPositionToPoint\");\n    return nil;\n}\n- (UITextRange *)characterRangeAtPoint:(CGPoint)point;\n{\n    CCLOG(\"characterRangeAtPoint\");\n    return nil;\n}\n\n- (NSArray *)selectionRectsForRange:(UITextRange *)range\n{\n    CCLOG(\"selectionRectsForRange\");\n    return nil;\n}\n\n#pragma mark - UIKeyboard notification\n\n- (void)onUIKeyboardNotification:(NSNotification *)notif;\n{\n    NSString * type = notif.name;\n    \n    NSDictionary* info = [notif userInfo];\n    CGRect begin = [self convertRect: \n                    [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]\n                            fromView:self];\n    CGRect end = [self convertRect: \n                  [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]\n                          fromView:self];\n    double aniDuration = [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];\n    \n    CGSize viewSize = self.frame.size;\n    CGFloat tmp;\n    \n    switch ([[UIApplication sharedApplication] statusBarOrientation])\n    {\n        case UIInterfaceOrientationPortrait:\n            begin.origin.y = viewSize.height - begin.origin.y - begin.size.height;\n            end.origin.y = viewSize.height - end.origin.y - end.size.height;\n            break;\n            \n        case UIInterfaceOrientationPortraitUpsideDown:\n            begin.origin.x = viewSize.width - (begin.origin.x + begin.size.width);\n            end.origin.x = viewSize.width - (end.origin.x + end.size.width);\n            break;\n            \n        case UIInterfaceOrientationLandscapeLeft:\n            tmp = begin.size.width;\n            begin.size.width = begin.size.height;\n            begin.size.height = tmp;\n            tmp = end.size.width;\n            end.size.width = end.size.height;\n            end.size.height = tmp;\n            tmp = viewSize.width;\n            viewSize.width = viewSize.height;\n            viewSize.height = tmp;\n            \n            tmp = begin.origin.x;\n            begin.origin.x = begin.origin.y;\n            begin.origin.y = viewSize.height - tmp - begin.size.height;\n            tmp = end.origin.x;\n            end.origin.x = end.origin.y;\n            end.origin.y = viewSize.height - tmp - end.size.height;\n            break;\n            \n        case UIInterfaceOrientationLandscapeRight:\n            tmp = begin.size.width;\n            begin.size.width = begin.size.height;\n            begin.size.height = tmp;\n            tmp = end.size.width;\n            end.size.width = end.size.height;\n            end.size.height = tmp;\n            tmp = viewSize.width;\n            viewSize.width = viewSize.height;\n            viewSize.height = tmp;\n            \n            tmp = begin.origin.x;\n            begin.origin.x = begin.origin.y;\n            begin.origin.y = tmp;\n            tmp = end.origin.x;\n            end.origin.x = end.origin.y;\n            end.origin.y = tmp;\n            break;\n            \n        default:\n            break;\n    }\n    \n    float scaleX = cocos2d::EGLView::getInstance()->getScaleX();\n\tfloat scaleY = cocos2d::EGLView::getInstance()->getScaleY();\n    \n    \n    if (self.contentScaleFactor == 2.0f)\n    {\n        // Convert to pixel coordinate\n        \n        begin = CGRectApplyAffineTransform(begin, CGAffineTransformScale(CGAffineTransformIdentity, 2.0f, 2.0f));\n        end = CGRectApplyAffineTransform(end, CGAffineTransformScale(CGAffineTransformIdentity, 2.0f, 2.0f));\n    }\n    \n    float offestY = cocos2d::EGLView::getInstance()->getViewPortRect().origin.y;\n    CCLOG(\"offestY = %f\", offestY);\n    if (offestY < 0.0f)\n    {\n        begin.origin.y += offestY;\n        begin.size.height -= offestY;\n        end.size.height -= offestY;\n    }\n    \n    // Convert to desigin coordinate\n    begin = CGRectApplyAffineTransform(begin, CGAffineTransformScale(CGAffineTransformIdentity, 1.0f/scaleX, 1.0f/scaleY));\n    end = CGRectApplyAffineTransform(end, CGAffineTransformScale(CGAffineTransformIdentity, 1.0f/scaleX, 1.0f/scaleY));\n\n    \n    cocos2d::IMEKeyboardNotificationInfo notiInfo;\n    notiInfo.begin = cocos2d::Rect(begin.origin.x,\n                                     begin.origin.y,\n                                     begin.size.width,\n                                     begin.size.height);\n    notiInfo.end = cocos2d::Rect(end.origin.x,\n                                   end.origin.y,\n                                   end.size.width,\n                                   end.size.height);\n    notiInfo.duration = (float)aniDuration;\n    \n    cocos2d::IMEDispatcher* dispatcher = cocos2d::IMEDispatcher::sharedDispatcher();\n    if (UIKeyboardWillShowNotification == type) \n    {\n        self.keyboardShowNotification = notif; // implicit copy\n        dispatcher->dispatchKeyboardWillShow(notiInfo);\n    }\n    else if (UIKeyboardDidShowNotification == type)\n    {\n        //CGSize screenSize = self.window.screen.bounds.size;\n        dispatcher->dispatchKeyboardDidShow(notiInfo);\n        caretRect_ = end;\n        caretRect_.origin.y = viewSize.height - (caretRect_.origin.y + caretRect_.size.height + [UIFont smallSystemFontSize]);\n        caretRect_.size.height = 0;\n        isKeyboardShown_ = YES;\n    }\n    else if (UIKeyboardWillHideNotification == type)\n    {\n        dispatcher->dispatchKeyboardWillHide(notiInfo);\n    }\n    else if (UIKeyboardDidHideNotification == type)\n    {\n        caretRect_ = CGRectZero;\n        dispatcher->dispatchKeyboardDidHide(notiInfo);\n        isKeyboardShown_ = NO;\n    }\n}\n\n-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)dis\n{\n    [UIView beginAnimations:nil context:nullptr];\n\t[UIView setAnimationDelegate:self];\n\t[UIView setAnimationDuration:duration];\n\t[UIView setAnimationBeginsFromCurrentState:YES];\n    \n    //NSLog(@\"[animation] dis = %f, scale = %f \\n\", dis, cocos2d::EGLView::getInstance()->getScaleY());\n    \n    if (dis < 0.0f) dis = 0.0f;\n\n\tdis *= cocos2d::EGLView::getInstance()->getScaleY();\n    \n    if (self.contentScaleFactor == 2.0f)\n    {\n        dis /= 2.0f;\n    }\n    \n    switch ([[UIApplication sharedApplication] statusBarOrientation])\n    {\n        case UIInterfaceOrientationPortrait:\n            self.frame = CGRectMake(originalRect_.origin.x, originalRect_.origin.y - dis, originalRect_.size.width, originalRect_.size.height);\n            break;\n            \n        case UIInterfaceOrientationPortraitUpsideDown:\n            self.frame = CGRectMake(originalRect_.origin.x, originalRect_.origin.y + dis, originalRect_.size.width, originalRect_.size.height);\n            break;\n            \n        case UIInterfaceOrientationLandscapeLeft:\n            self.frame = CGRectMake(originalRect_.origin.x - dis, originalRect_.origin.y , originalRect_.size.width, originalRect_.size.height);\n            break;\n            \n        case UIInterfaceOrientationLandscapeRight:\n            self.frame = CGRectMake(originalRect_.origin.x + dis, originalRect_.origin.y , originalRect_.size.width, originalRect_.size.height);\n            break;\n            \n        default:\n            break;\n    }\n    \n\t[UIView commitAnimations];\n}\n\n\n-(void) doAnimationWhenAnotherEditBeClicked\n{\n    if (self.keyboardShowNotification != nil)\n    {\n        [[NSNotificationCenter defaultCenter]postNotification:self.keyboardShowNotification];\n    }\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/OpenGL_Internal.h",
    "content": "/*\n\n===== IMPORTANT =====\n\nThis is sample code demonstrating API, technology or techniques in development.\nAlthough this sample code has been reviewed for technical accuracy, it is not\nfinal. Apple is supplying this information to help you plan for the adoption of\nthe technologies and programming interfaces described herein. This information\nis subject to change, and software implemented based on this sample code should\nbe tested with final operating system software and final documentation. Newer\nversions of this sample code may be provided with future seeds of the API or\ntechnology. For information about updates to this and other developer\ndocumentation, view the New & Updated sidebars in subsequent documentation\nseeds.\n\n=====================\n\nFile: OpenGL_Internal.h\nAbstract: This file is included for support purposes and isn't necessary for\nunderstanding this sample.\n\nVersion: 1.0\n\nDisclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc.\n(\"Apple\") in consideration of your agreement to the following terms, and your\nuse, installation, modification or redistribution of this Apple software\nconstitutes acceptance of these terms.  If you do not agree with these terms,\nplease do not use, install, modify or redistribute this Apple software.\n\nIn consideration of your agreement to abide by the following terms, and subject\nto these terms, Apple grants you a personal, non-exclusive license, under\nApple's copyrights in this original Apple software (the \"Apple Software\"), to\nuse, reproduce, modify and redistribute the Apple Software, with or without\nmodifications, in source and/or binary forms; provided that if you redistribute\nthe Apple Software in its entirety and without modifications, you must retain\nthis notice and the following text and disclaimers in all such redistributions\nof the Apple Software.\nNeither the name, trademarks, service marks or logos of Apple Inc. may be used\nto endorse or promote products derived from the Apple Software without specific\nprior written permission from Apple.  Except as expressly stated in this notice,\nno other rights or licenses, express or implied, are granted by Apple herein,\nincluding but not limited to any patent rights that may be infringed by your\nderivative works or by other works in which the Apple Software may be\nincorporated.\n\nThe Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE MAKES NO\nWARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\nWARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN\nCOMBINATION WITH YOUR PRODUCTS.\n\nIN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\nGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR\nDISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF\nCONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF\nAPPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nCopyright (C) 2008 Apple Inc. All Rights Reserved.\n\n*/\n\n/* Generic error reporting */\n#define REPORT_ERROR(__FORMAT__, ...) printf(\"%s: %s\\n\", __FUNCTION__, [[NSString stringWithFormat:__FORMAT__, __VA_ARGS__] UTF8String])\n\n/* EAGL and GL functions calling wrappers that log on error */\n#define CALL_EAGL_FUNCTION(__FUNC__, ...) ({ EAGLError __error = __FUNC__( __VA_ARGS__ ); if(__error != kEAGLErrorSuccess) printf(\"%s() called from %s returned error %i\\n\", #__FUNC__, __FUNCTION__, __error); (__error ? NO : YES); })\n//#define CHECK_GL_ERROR() ({ GLenum __error = glGetError(); if(__error) printf(\"OpenGL error 0x%04X in %s\\n\", __error, __FUNCTION__); (__error ? NO : YES); })\n#define CHECK_GL_ERROR() ({ GLenum __error = glGetError(); if(__error) printf(\"OpenGL error 0x%04X in %s %d\\n\", __error, __FUNCTION__, __LINE__); })\n\n\n/* Optional delegate methods support */\n#ifndef __DELEGATE_IVAR__\n#define __DELEGATE_IVAR__ _delegate\n#endif\n#ifndef __DELEGATE_METHODS_IVAR__\n#define __DELEGATE_METHODS_IVAR__ _delegateMethods\n#endif\n#define TEST_DELEGATE_METHOD_BIT(__BIT__) (self->__DELEGATE_METHODS_IVAR__ & (1 << __BIT__))\n#define SET_DELEGATE_METHOD_BIT(__BIT__, __NAME__) { if([self->__DELEGATE_IVAR__ respondsToSelector:@selector(__NAME__)]) self->__DELEGATE_METHODS_IVAR__ |= (1 << __BIT__); else self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); }\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h",
    "content": "/****************************************************************************\nCopyright (c) 2008 Otto Chrons at Seastringo Oy.\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import <TargetConditionals.h>\n\n// when compiling to ARM (iPhone device), hide everything and use system defaults\n// if you wish to use simulation mode even on the device, remove the #if/#endif\n#if !TARGET_CPU_ARM\n#import <UIKit/UIKit.h>\n\n// this is exactly the same as UIAcceleration, but we can modify the member variables\n@interface UIAccelerationSimulation: NSObject\n{\n    NSTimeInterval timestamp;\n    UIAccelerationValue x, y, z;\n}\n@property(nonatomic, readonly) NSTimeInterval timestamp;\n@property(nonatomic, readonly) UIAccelerationValue x, y, z;\n\n@end\n\n// override UIAccelerometer behavior\n@interface UIAccelerometer (Simulation)\n+ (UIAccelerometer *)sharedAccelerometer;\n@end\n\n// our own version of the Accelerometer\n@interface CCAccelerometerSimulation : UIAccelerometer <NSMachPortDelegate>\n{\n    \n    //CFSocketRef udpSocket;\n    int udpSocket;\n    NSThread *thread;\n    BOOL isExiting;\n    id<UIAccelerometerDelegate> accelDelegate;\n    UIAccelerationSimulation *accObject;\n    // Threaded notification support \n    NSMutableArray *notifications;\n    NSThread *notificationThread;\n    NSLock *notificationLock;\n    NSMachPort *notificationPort;\n}\n\n@property(nonatomic, assign) id<UIAccelerometerDelegate> delegate;\n\n- (void) setUpThreadingSupport;\n- (void) handleMachMessage:(void *) msg;\n- (void) processNotification:(NSNotification *) notification;\n+ (CCAccelerometerSimulation *)getAccelerometer;\n- (CCAccelerometerSimulation *)initialize;\n\n@end\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m",
    "content": "/****************************************************************************\nCopyright (c) 2008 Otto Chrons at Seastringo Oy.\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import \"AccelerometerSimulation.h\"\n\n// when compiling to ARM (iPhone device), hide everything and use system defaults\n// if you wish to use simulation mode even on the device, remove the #if/#endif\n#if !TARGET_CPU_ARM\n\n#import <netdb.h>\n\n#define kAccelerometerSimulationPort 10552\n\n@implementation UIAccelerationSimulation\n\n@synthesize timestamp;\n@synthesize x;\n@synthesize y;\n@synthesize z;\n\n-(UIAccelerationSimulation*)initWithTimestamp:(NSTimeInterval)aTimeStamp\n                                            X:(UIAccelerationValue)ax\n                                            Y:(UIAccelerationValue)ay\n                                            Z:(UIAccelerationValue)az \n{\n    timestamp = aTimeStamp;\n    x = ax;\n    y = ay;\n    z = az;\n    \n    return self;\n}    \n@end\n\n@implementation UIAccelerometer (Simulation)\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wobjc-protocol-method-implementation\"\n// override the static method and return our simulated version instead\n+ (UIAccelerometer *)sharedAccelerometer\n{\n    return [CCAccelerometerSimulation getAccelerometer];\n}\n#pragma clang diagnostic pop\n@end\n/*\n // callback that never got called with CFSocket UDP...\n \n void mySocketCallBack( CFSocketRef s,\n CFSocketCallBackType callbackType,\n CFDataRef address,\n const void *data,\n void *info)\n {\n AccelerometerSimulation *accSim = (AccelerometerSimulation*)info;\n \n NSLog(@\"Data %s received\", (char*)data);\n }\n */\n\n// singleton\nstatic CCAccelerometerSimulation *sharedAccelerometer = NULL;\n\n@implementation CCAccelerometerSimulation\n\n- (void) dealloc {\n    if (sharedAccelerometer) {\n        [sharedAccelerometer release];\n        sharedAccelerometer = NULL;\n    }\n    [super dealloc];\n}\n\n// this is straight from developer guide example for multi-threaded notifications\n- (void) setUpThreadingSupport {\n    if ( notifications ) return;\n    \n    notifications      = [[NSMutableArray alloc] init];\n    notificationLock   = [[NSLock alloc] init];\n    notificationThread = [[NSThread currentThread] retain];\n    \n    notificationPort = [[NSMachPort alloc] init];\n    [notificationPort setDelegate:self];\n    [[NSRunLoop currentRunLoop] addPort:notificationPort\n                                forMode:(NSString *) kCFRunLoopCommonModes];\n}\n\n// this is straight from developer guide example\n\n- (void) processNotification:(NSNotification *) notification {\n    if( [NSThread currentThread] != notificationThread ) {\n        // Forward the notification to the correct thread, this is the socket thread\n        NSDate* date = [[NSDate alloc] init];\n        [notificationLock lock];\n        [notifications addObject:notification];\n        [notificationLock unlock];\n        [notificationPort sendBeforeDate:date\n                              components:nil\n                                    from:nil\n                                reserved:0];\n        [date release];\n    }\n    else {\n        // now we are in the main thread\n        // Process the notification here;\n        NSString *data = (NSString*)[notification object];\n        \n        // parse the data, no error handling!\n        NSArray *components = [data componentsSeparatedByString:@\",\"];\n        \n        // create our own acceleration object\n        [accObject initWithTimestamp:[[components objectAtIndex:1] doubleValue] \n                                   X:[[components objectAtIndex:2] doubleValue] \n                                   Y:[[components objectAtIndex:3] doubleValue]\n                                   Z:[[components objectAtIndex:4] doubleValue]];\n        [accelDelegate accelerometer:self didAccelerate:(UIAcceleration*)accObject];\n    }\n}\n\n// this is straight from developer guide example\n- (void) handleMachMessage:(void *) msg {\n    [notificationLock lock];\n    while ( [notifications count] ) {\n        NSNotification *notification = [[notifications objectAtIndex:0] retain];\n        [notifications removeObjectAtIndex:0];\n        [notificationLock unlock];\n        [self processNotification:notification];\n        [notification release];\n        [notificationLock lock];\n    };\n    [notificationLock unlock];\n}\n#ifndef __clang_analyzer__\n+ (CCAccelerometerSimulation *)getAccelerometer\n{\n    if( sharedAccelerometer == NULL )\n        sharedAccelerometer = [[CCAccelerometerSimulation alloc] initialize];\n    \n    return sharedAccelerometer;\n}\n#endif\n- (void)threadLoop:(id)object\n{\n    char buffer[1024];\n    // we never exit...\n    while(1) {\n        int count = recv( udpSocket, buffer, sizeof(buffer), 0 );\n        if( count > 0 )\n        {\n            // got data, let's pass it on\n            buffer[count] = 0;\n            NSString *str = [[NSString alloc] initWithUTF8String:buffer];\n            [[NSNotificationCenter defaultCenter]  postNotificationName:@\"ThreadAccelNotification\" object:str];\n            [str release];\n        }\n        \n    }\n}\n\n// initialize our version of the accelerometer\n- (CCAccelerometerSimulation *)initialize\n{\n    accObject = [UIAccelerationSimulation alloc];\n    isExiting = false;\n    \n    // couldn't get the CFSocket version to work with UDP and runloop, so used Berkeley sockets and a thread instead\n    \n    udpSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);\n    struct sockaddr_in sin;\n    memset(&sin, 0, sizeof(sin));\n    // listen on all interfaces\n    sin.sin_addr.s_addr = INADDR_ANY;\n    sin.sin_len = sizeof(struct sockaddr_in);\n    sin.sin_family = AF_INET;\n    sin.sin_port = htons(kAccelerometerSimulationPort);\n    \n    bind(udpSocket, (const struct sockaddr*)&sin, sizeof(sin));\n    \n    // create a separate thread for receiving UDP packets\n    thread = [[NSThread alloc] initWithTarget:self\n                                     selector:@selector(threadLoop:)\n                                       object:nil];\n    [thread start];    \n    \n    // cross-thread communication setup\n    [self setUpThreadingSupport];\n    [[NSNotificationCenter defaultCenter]\n     addObserver:self\n     selector:@selector(processNotification:)\n     name:@\"ThreadAccelNotification\"\n     object:nil];\n    /*\n     // create and initialize a socket\n     CFSocketContext ctx;\n     \n     ctx.info = self;\n     ctx.version = 0;\n     ctx.retain = NULL;\n     ctx.release = NULL;\n     ctx.copyDescription = NULL;\n     udpSocket = CFSocketCreate(NULL, PF_INET, SOCK_DGRAM, IPPROTO_UDP, kCFSocketDataCallBack | 0xF, mySocketCallBack, NULL);\n     \n     CFRunLoopSourceRef source;\n     CFDataRef addr;\n     CFSocketError theErr;\n     struct sockaddr_in sin;\n     memset(&sin, 0, sizeof(sin));\n     sin.sin_addr.s_addr = INADDR_ANY;\n     sin.sin_len = sizeof(struct sockaddr_in);\n     sin.sin_family = AF_INET;\n     sin.sin_port = htons(10552);\n     addr = CFDataCreate(NULL, (unsigned char *)&sin, sizeof(sin));\n     theErr = CFSocketConnectToAddress(udpSocket, addr, 0);\n     switch (theErr) {\n     case kCFSocketSuccess:\n     NSLog(@\"UDP Logged in\");\n     source = CFSocketCreateRunLoopSource(NULL, udpSocket, 0);\n     CFRunLoopAddSource(CFRunLoopGetMain(), source, \n     kCFRunLoopDefaultMode);\n     break;\n     case kCFSocketError:\n     NSLog(@\"UDP Error\");\n     break;\n     default:\n     NSLog(@\"UDP Networking Error\");\n     break;\n     }\n     */\n    return self;\n}\n\n// we grab the delegate setting action\n- (void)setDelegate:(id<UIAccelerometerDelegate>)delegate\n{\n    accelDelegate = delegate;\n}\n\n- (id<UIAccelerometerDelegate>)delegate\n{\n    return accelDelegate;\n}\n@end\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCApplication.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCApplication.h\"\n#include <unistd.h>\n#include <sys/time.h>\n#include <string>\n#include \"CCDirector.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCEGLView.h\"\n\nNS_CC_BEGIN\n\n\n// sharedApplication pointer\nApplication * Application::sm_pSharedApplication = 0;\n\nstatic long getCurrentMillSecond() {\n\tlong lLastTime;\n\tstruct timeval stCurrentTime;\n\n\tgettimeofday(&stCurrentTime,NULL);\n\tlLastTime = stCurrentTime.tv_sec*1000+stCurrentTime.tv_usec*0.001; //millseconds\n\treturn lLastTime;\n}\n\nApplication::Application()\n{\n\tCC_ASSERT(! sm_pSharedApplication);\n\tsm_pSharedApplication = this;\n}\n\nApplication::~Application()\n{\n\tCC_ASSERT(this == sm_pSharedApplication);\n\tsm_pSharedApplication = NULL;\n\t_animationInterval = 1.0f/60.0f*1000.0f;\n}\n\nint Application::run()\n{\n\t// Initialize instance and cocos2d.\n\tif (! applicationDidFinishLaunching())\n\t{\n\t\treturn 0;\n\t}\n\n\tEGLView* pMainWnd = EGLView::getInstance();\n    \n    while (!pMainWnd->windowShouldClose())\n    {\n    \tlong iLastTime = getCurrentMillSecond();\n        Director::getInstance()->mainLoop();\n        pMainWnd->pollEvents();\n\t\tlong iCurTime = getCurrentMillSecond();\n\t\tif (iCurTime-iLastTime<_animationInterval){\n\t\t\tusleep((_animationInterval - iCurTime+iLastTime)*1000);\n\t\t}\n    }\n    /* Only work on Desktop\n    *  Director::mainLoop is really one frame logic\n    *  when we want to close the window, we should call Director::end();\n    *  then call Director::mainLoop to do release of internal resources\n    */\n    Director::getInstance()->end();\n    Director::getInstance()->mainLoop();\n\treturn -1;\n}\n\nvoid Application::setAnimationInterval(double interval)\n{\n\t//TODO do something else\n\t_animationInterval = interval*1000.0f;\n}\n\nvoid Application::setResourceRootPath(const std::string& rootResDir)\n{\n    _resourceRootPath = rootResDir;\n    if (_resourceRootPath[_resourceRootPath.length() - 1] != '/')\n    {\n        _resourceRootPath += '/';\n    }\n    FileUtils* pFileUtils = FileUtils::getInstance();\n    std::vector<std::string> searchPaths = pFileUtils->getSearchPaths();\n    searchPaths.insert(searchPaths.begin(), _resourceRootPath);\n    pFileUtils->setSearchPaths(searchPaths);\n}\n\nconst std::string& Application::getResourceRootPath(void)\n{\n    return _resourceRootPath;\n}\n\nApplication::Platform Application::getTargetPlatform()\n{\n    return Platform::OS_LINUX;\n}\n\n//////////////////////////////////////////////////////////////////////////\n// static member function\n//////////////////////////////////////////////////////////////////////////\nApplication* Application::getInstance()\n{\n\tCC_ASSERT(sm_pSharedApplication);\n\treturn sm_pSharedApplication;\n}\n\n// @deprecated Use getInstance() instead\nApplication* Application::sharedApplication()\n{\n    return Application::getInstance();\n}\n\nLanguageType Application::getCurrentLanguage()\n{\n\tchar *pLanguageName = getenv(\"LANG\");\n\tLanguageType ret = LanguageType::ENGLISH;\n\tif (!pLanguageName)\n\t{\n\t\treturn LanguageType::ENGLISH;\n\t}\n\tstrtok(pLanguageName, \"_\");\n\tif (!pLanguageName)\n\t{\n\t\treturn LanguageType::ENGLISH;\n\t}\n\t\n\tif (0 == strcmp(\"zh\", pLanguageName))\n\t{\n\t\tret = LanguageType::CHINESE;\n\t}\n\telse if (0 == strcmp(\"en\", pLanguageName))\n\t{\n\t\tret = LanguageType::ENGLISH;\n\t}\n\telse if (0 == strcmp(\"fr\", pLanguageName))\n\t{\n\t\tret = LanguageType::FRENCH;\n\t}\n\telse if (0 == strcmp(\"it\", pLanguageName))\n\t{\n\t\tret = LanguageType::ITALIAN;\n\t}\n\telse if (0 == strcmp(\"de\", pLanguageName))\n\t{\n\t\tret = LanguageType::GERMAN;\n\t}\n\telse if (0 == strcmp(\"es\", pLanguageName))\n\t{\n\t\tret = LanguageType::SPANISH;\n\t}\n\telse if (0 == strcmp(\"ru\", pLanguageName))\n\t{\n\t\tret = LanguageType::RUSSIAN;\n\t}\n\telse if (0 == strcmp(\"ko\", pLanguageName))\n\t{\n\t\tret = LanguageType::KOREAN;\n\t}\n\telse if (0 == strcmp(\"ja\", pLanguageName))\n\t{\n\t\tret = LanguageType::JAPANESE;\n\t}\n\telse if (0 == strcmp(\"hu\", pLanguageName))\n\t{\n\t\tret = LanguageType::HUNGARIAN;\n\t}\n    else if (0 == strcmp(\"pt\", pLanguageName))\n\t{\n\t\tret = LanguageType::PORTUGUESE;\n\t}\n    else if (0 == strcmp(\"ar\", pLanguageName))\n\t{\n\t\tret = LanguageType::ARABIC;\n\t}\n\telse if (0 == strcmp(\"nb\", pLanguageName))\n\t{\n\t\tret = LanguageType::NORWEGIAN;\n\t}\n\telse if (0 == strcmp(\"pl\", pLanguageName))\n\t{\n\t\tret = LanguageType::POLISH;\n\t}\n\t\n\treturn ret;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCApplication.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef CCAPLICATION_H_\n#define CCAPLICATION_H_\n\n#include \"platform/CCCommon.h\"\n#include \"platform/CCApplicationProtocol.h\"\n#include <string>\n\nNS_CC_BEGIN\nclass Rect;\n\nclass Application : public ApplicationProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n\tApplication();\n    /**\n     * @js NA\n     * @lua NA\n     */\n\tvirtual ~Application();\n\n\t/**\n\t @brief\tCallback by Director for limit FPS.\n\t @param interval    The time, which expressed in second in second, between current frame and next.\n\t */\n\tvoid setAnimationInterval(double interval);\n\n\t/**\n\t @brief\tRun the message loop.\n\t */\n\tint run();\n\n\t/**\n\t @brief\tGet current applicaiton instance.\n\t @return Current application instance pointer.\n\t */\n\tstatic Application* getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();\n    \n\t/* override functions */\n\tvirtual LanguageType getCurrentLanguage();\n\n\t/**\n     *  Sets the Resource root path.\n     *  @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.\n     */\n    CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir);\n    \n\t/** \n     *  Gets the Resource root path.\n     *  @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. \n     */\n    CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void);\n    \n    /**\n     @brief Get target platform\n     */\n    virtual Platform getTargetPlatform();\nprotected:\n    long       _animationInterval;  //micro second\n    std::string _resourceRootPath;\n    \n\tstatic Application * sm_pSharedApplication;\n};\n\nNS_CC_END\n\n#endif /* CCAPLICATION_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCCommon.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"platform/CCCommon.h\"\n#include \"CCStdC.h\"\n#include \"CCConsole.h\"\n\nNS_CC_BEGIN\n\nvoid MessageBox(const char * msg, const char * title)\n{\n    log(\"%s: %s\", title, msg);\n}\n\nvoid LuaLog(const char * format)\n{\n    puts(format);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCDevice.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"platform/CCDevice.h\"\n#include <X11/Xlib.h>\n#include <stdio.h>\n\nNS_CC_BEGIN\n\nint Device::getDPI()\n{\n\tstatic int dpi = -1;\n\tif (dpi == -1)\n\t{\n\t\tDisplay *dpy;\n\t    char *displayname = NULL;\n\t    int scr = 0; /* Screen number */\n\t    dpy = XOpenDisplay (displayname);\n\t    /*\n\t     * there are 2.54 centimeters to an inch; so there are 25.4 millimeters.\n\t     *\n\t     *     dpi = N pixels / (M millimeters / (25.4 millimeters / 1 inch))\n\t     *         = N pixels / (M inch / 25.4)\n\t     *         = N * 25.4 pixels / M inch\n\t     */\n\t    double xres = ((((double) DisplayWidth(dpy,scr)) * 25.4) / \n\t        ((double) DisplayWidthMM(dpy,scr)));\n\t    dpi = (int) (xres + 0.5);\n\t    //printf(\"dpi = %d\\n\", dpi);\n\t\tXCloseDisplay (dpy);\n\t}\n\treturn dpi;\n}\n\nvoid Device::setAccelerometerEnabled(bool isEnabled)\n{\n\n}\n\nvoid Device::setAccelerometerInterval(float interval)\n{\n\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCFileUtilsLinux.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCFileUtilsLinux.h\"\n#include \"platform/CCCommon.h\"\n#include \"ccMacros.h\"\n#include \"CCApplication.h\"\n#include \"CCString.h\"\n#include <unistd.h>\n#include <sys/stat.h>\n#include <stdio.h>\n#include <errno.h>\n\nusing namespace std;\n\nNS_CC_BEGIN\n\nFileUtils* FileUtils::getInstance()\n{\n    if (s_sharedFileUtils == NULL)\n    {\n        s_sharedFileUtils = new FileUtilsLinux();\n        if(!s_sharedFileUtils->init())\n        {\n          delete s_sharedFileUtils;\n          s_sharedFileUtils = NULL;\n          CCLOG(\"ERROR: Could not init CCFileUtilsLinux\");\n        }\n    }\n    return s_sharedFileUtils;\n}\n\nFileUtilsLinux::FileUtilsLinux()\n{}\n\nbool FileUtilsLinux::init()\n{\n    // get application path\n    char fullpath[256] = {0};\n    ssize_t length = readlink(\"/proc/self/exe\", fullpath, sizeof(fullpath)-1);\n\n    if (length <= 0) {\n        return false;\n    }\n\n    fullpath[length] = '\\0';\n    std::string appPath = fullpath;\n    _defaultResRootPath = appPath.substr(0, appPath.find_last_of(\"/\"));\n    _defaultResRootPath += \"/Resources/\";\n\n    // Set writable path to $XDG_CONFIG_HOME or ~/.config/<app name>/ if $XDG_CONFIG_HOME not exists.\n    const char* xdg_config_path = getenv(\"XDG_CONFIG_HOME\");\n    std::string xdgConfigPath;\n    if (xdg_config_path == NULL) {\n        xdgConfigPath = getenv(\"HOME\");\n        xdgConfigPath += \"/.config\";\n    } else {\n        xdgConfigPath  = xdg_config_path;\n    }\n    _writablePath = xdgConfigPath;\n    _writablePath += appPath.substr(appPath.find_last_of(\"/\"));\n    _writablePath += \"/\";\n\n    return FileUtils::init();\n}\n\nstring FileUtilsLinux::getWritablePath() const\n{\n    struct stat st;\n    stat(_writablePath.c_str(), &st);\n    if (!S_ISDIR(st.st_mode)) {\n        mkdir(_writablePath.c_str(), 0744);\n    }\n\n    return _writablePath;\n}\n\nbool FileUtilsLinux::isFileExist(const std::string& strFilePath) const\n{\n    if (0 == strFilePath.length())\n    {\n        return false;\n    }\n\n    std::string strPath = strFilePath;\n    if (!isAbsolutePath(strPath))\n    { // Not absolute path, add the default root path at the beginning.\n        strPath.insert(0, _defaultResRootPath);\n    }\n    \n    struct stat sts;\n    return (stat(strPath.c_str(), &sts) != -1) ? true : false;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCFileUtilsLinux.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_FILEUTILS_LINUX_H__\n#define __CC_FILEUTILS_LINUX_H__\n\n#include \"platform/CCFileUtils.h\"\n#include \"CCPlatformMacros.h\"\n#include \"ccTypes.h\"\n#include <string>\n#include <vector>\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n//! @brief  Helper class to handle file operations\nclass CC_DLL FileUtilsLinux : public FileUtils\n{\n    friend class FileUtils;\n    FileUtilsLinux();\n    std::string _writablePath;\npublic:\n    /* override funtions */\n    bool init();\n    virtual std::string getWritablePath() const;\n    virtual bool isFileExist(const std::string& strFilePath) const;\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_FILEUTILS_LINUX_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCGL.h",
    "content": "/****************************************************************************\nCopyright (c) 2010 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCGL_H__\n#define __CCGL_H__\n\n#include \"GL/glew.h\"\n\n#define CC_GL_DEPTH24_STENCIL8\t\tGL_DEPTH24_STENCIL8\n\n#endif // __CCGL_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCImage.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include <string.h>\n\n#include <algorithm>\n#include <vector>\n#include <string>\n#include <sstream>\n#include <fontconfig/fontconfig.h>\n\n#include \"platform/CCFileUtils.h\"\n#include \"CCPlatformMacros.h\"\n#define __CC_PLATFORM_IMAGE_CPP__\n#include \"platform/CCImageCommon_cpp.h\"\n#include \"platform/CCImage.h\"\n#include \"platform/linux/CCApplication.h\"\n\n#include \"ft2build.h\"\n#include \"CCStdC.h\"\n\n#include FT_FREETYPE_H\n\nusing namespace std;\n\n// as FcFontMatch is quite an expensive call, cache the results of getFontFile\nstatic std::map<std::string, std::string> fontCache;\n\nstruct LineBreakGlyph {\n\tFT_UInt glyphIndex;\n\tint paintPosition;\n\tint glyphWidth;\n\n\tint bearingX;\n\tint kerning;\n\tint horizAdvance;\n};\n\nstruct LineBreakLine {\n\tLineBreakLine() : lineWidth(0) {}\n\n\tstd::vector<LineBreakGlyph> glyphs;\n\tint lineWidth;\n\n\tvoid reset() {\n\t\tglyphs.clear();\n\t\tlineWidth = 0;\n\t}\n\n\tvoid calculateWidth() {\n\t\tlineWidth = 0;\n\t\tif ( glyphs.empty() == false ) {\n\t\t\tlineWidth = glyphs.at(glyphs.size() - 1).paintPosition + glyphs.at(glyphs.size() - 1).glyphWidth;\n\t\t}\n\t}\n};\n\nNS_CC_BEGIN\n\nclass BitmapDC\n{\npublic:\n\tBitmapDC() {\n\t\tlibError = FT_Init_FreeType( &library );\n\t\tFcInit();\n\t\t_data = NULL;\n\t\treset();\n\t}\n\n\t~BitmapDC() {\n\t\tFT_Done_FreeType(library);\n\t\tFcFini();\n\t\t//data will be deleted by Image\n//\t\tif (_data) {\n//\t\t\tdelete _data;\n//\t\t}\n        reset();\n\t}\n\n\tvoid reset() {\n\t\tiMaxLineWidth = 0;\n\t\tiMaxLineHeight = 0;\n\t\ttextLines.clear();\n\t}\n\n    int utf8(char **p)\n    {\n        if ((**p & 0x80) == 0x00)\n        {\n            int a = *((*p)++);\n\n            return a;\n        }\n        if ((**p & 0xE0) == 0xC0)\n        {\n            int a = *((*p)++) & 0x1F;\n            int b = *((*p)++) & 0x3F;\n\n            return (a << 6) | b;\n        }\n        if ((**p & 0xF0) == 0xE0)\n        {\n            int a = *((*p)++) & 0x0F;\n            int b = *((*p)++) & 0x3F;\n            int c = *((*p)++) & 0x3F;\n\n            return (a << 12) | (b << 6) | c;\n        }\n        if ((**p & 0xF8) == 0xF0)\n        {\n            int a = *((*p)++) & 0x07;\n            int b = *((*p)++) & 0x3F;\n            int c = *((*p)++) & 0x3F;\n            int d = *((*p)++) & 0x3F;\n\n            return (a << 18) | (b << 12) | (c << 8) | d;\n        }\n        return 0;\n    }\n\n    bool isBreakPoint(FT_UInt currentCharacter, FT_UInt previousCharacter) {\n    \tif ( previousCharacter == '-' || previousCharacter == '/' || previousCharacter == '\\\\' ) {\n    \t   \t// we can insert a line break after one of these characters\n    \t    return true;\n    \t}\n    \treturn false;\n    }\n\n\tbool divideString(FT_Face face, const char* sText, int iMaxWidth, int iMaxHeight) {\n\t\tconst char* pText = sText;\n\t\ttextLines.clear();\n\t\tiMaxLineWidth = 0;\n\n\t\tFT_UInt unicode;\n\t\tFT_UInt prevCharacter = 0;\n\t\tFT_UInt glyphIndex = 0;\n\t\tFT_UInt prevGlyphIndex = 0;\n\t\tFT_Vector delta;\n\t\tLineBreakLine currentLine;\n\n\t\tint currentPaintPosition = 0;\n\t\tint lastBreakIndex = -1;\n\t\tbool hasKerning = FT_HAS_KERNING( face );\n        while ((unicode=utf8((char**)&pText))) {\n            if (unicode == '\\n') {\n\t\t\t\tcurrentLine.calculateWidth();\n\t\t\t\tiMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);\n\t\t\t\ttextLines.push_back(currentLine);\n\t\t\t\tcurrentLine.reset();\n\t\t\t\tprevGlyphIndex = 0;\n\t\t\t\tprevCharacter = 0;\n\t\t\t\tlastBreakIndex = -1;\n\t\t\t\tcurrentPaintPosition = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\n            if ( isBreakPoint(unicode, prevCharacter) ) {\n            \tlastBreakIndex = currentLine.glyphs.size() - 1;\n            }\n\n\t\t\tglyphIndex = FT_Get_Char_Index(face, unicode);\n\t\t\tif (FT_Load_Glyph(face, glyphIndex, FT_LOAD_DEFAULT)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (isspace(unicode)) {\n\t\t\t\tcurrentPaintPosition += face->glyph->metrics.horiAdvance >> 6;\n\t\t\t\tprevGlyphIndex = glyphIndex;\n\t\t\t\tprevCharacter = unicode;\n\t\t\t\tlastBreakIndex = currentLine.glyphs.size();\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tLineBreakGlyph glyph;\n\t\t\tglyph.glyphIndex = glyphIndex;\n\t\t\tglyph.glyphWidth = face->glyph->metrics.width >> 6;\n\t\t\tglyph.bearingX = face->glyph->metrics.horiBearingX >> 6;\n\t\t\tglyph.horizAdvance = face->glyph->metrics.horiAdvance >> 6;\n\t\t\tglyph.kerning = 0;\n\n\t\t\tif (prevGlyphIndex != 0 && hasKerning) {\n\t\t\t\tFT_Get_Kerning(face, prevGlyphIndex, glyphIndex, FT_KERNING_DEFAULT, &delta);\n\t\t\t\tglyph.kerning = delta.x >> 6;\n\t\t\t}\n\n\t\t\tif (iMaxWidth > 0 && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth > iMaxWidth) {\n\n\t\t\t\tint glyphCount = currentLine.glyphs.size();\n\t\t\t\tif ( lastBreakIndex >= 0 && lastBreakIndex < glyphCount && currentPaintPosition + glyph.bearingX + glyph.kerning + glyph.glyphWidth - currentLine.glyphs.at(lastBreakIndex).paintPosition < iMaxWidth ) {\n\t\t\t\t\t// we insert a line break at our last break opportunity\n\t\t\t\t\tstd::vector<LineBreakGlyph> tempGlyphs;\n\t\t\t\t\tstd::vector<LineBreakGlyph>::iterator it = currentLine.glyphs.begin();\n\t\t\t\t\tstd::advance(it, lastBreakIndex);\n\t\t\t\t\ttempGlyphs.insert(tempGlyphs.begin(), it, currentLine.glyphs.end());\n\t\t\t\t\tcurrentLine.glyphs.erase(it, currentLine.glyphs.end());\n\t\t\t\t\tcurrentLine.calculateWidth();\n\t\t\t\t\tiMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);\n\t\t\t\t\ttextLines.push_back(currentLine);\n\t\t\t\t\tcurrentLine.reset();\n\t\t\t\t\tcurrentPaintPosition = 0;\n\t\t\t\t\tfor ( it = tempGlyphs.begin(); it != tempGlyphs.end(); it++ ) {\n\t\t\t\t\t\tif ( currentLine.glyphs.empty() ) {\n\t\t\t\t\t\t\tcurrentPaintPosition = -(*it).bearingX;\n\t\t\t\t\t\t\t(*it).kerning = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t(*it).paintPosition = currentPaintPosition + (*it).bearingX + (*it).kerning;\n\t\t\t\t\t\tcurrentLine.glyphs.push_back((*it));\n\t\t\t\t\t\tcurrentPaintPosition += (*it).kerning + (*it).horizAdvance;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// the current word is too big to fit into one line, insert line break right here\n\t\t\t\t\tcurrentPaintPosition = 0;\n\t\t\t\t\tglyph.kerning = 0;\n\t\t\t\t\tcurrentLine.calculateWidth();\n\t\t\t\t\tiMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);\n\t\t\t\t\ttextLines.push_back(currentLine);\n\t\t\t\t\tcurrentLine.reset();\n\t\t\t\t}\n\n\t\t\t\tprevGlyphIndex = 0;\n\t\t\t\tprevCharacter = 0;\n\t\t\t\tlastBreakIndex = -1;\n\t\t\t} else {\n\t\t\t\tprevGlyphIndex = glyphIndex;\n\t\t\t\tprevCharacter = unicode;\n\t\t\t}\n\n\t\t\tif ( currentLine.glyphs.empty() ) {\n\t\t\t\tcurrentPaintPosition = -glyph.bearingX;\n\t\t\t}\n\t\t\tglyph.paintPosition = currentPaintPosition + glyph.bearingX + glyph.kerning;\n\t\t\tcurrentLine.glyphs.push_back(glyph);\n\t\t\tcurrentPaintPosition += glyph.kerning + glyph.horizAdvance;\n\t\t}\n\n\t\tif ( currentLine.glyphs.empty() == false ) {\n\t\t\tcurrentLine.calculateWidth();\n\t\t\tiMaxLineWidth = max(iMaxLineWidth, currentLine.lineWidth);\n\t\t\ttextLines.push_back(currentLine);\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * compute the start pos of every line\n\t */\n\tint computeLineStart(FT_Face face, Image::TextAlign eAlignMask, int line) {\n\t\t\t\tint lineWidth = textLines.at(line).lineWidth;\n\t\tif (eAlignMask == Image::TextAlign::CENTER || eAlignMask == Image::TextAlign::TOP || eAlignMask == Image::TextAlign::BOTTOM) {\n\t\t\treturn (iMaxLineWidth - lineWidth) / 2;\n\t\t} else if (eAlignMask == Image::TextAlign::RIGHT || eAlignMask == Image::TextAlign::TOP_RIGHT || eAlignMask == Image::TextAlign::BOTTOM_RIGHT) {\n\t\t\treturn (iMaxLineWidth - lineWidth);\n\t\t}\n\n\t\t// left or other situation\n\t\treturn 0;\n\t}\n\n\tint computeLineStartY( FT_Face face, Image::TextAlign eAlignMask, int txtHeight, int borderHeight ){\n\t\tint baseLinePos = ceilf(FT_MulFix( face->bbox.yMax, face->size->metrics.y_scale )/64.0f);\n\t\tif (eAlignMask == Image::TextAlign::CENTER || eAlignMask == Image::TextAlign::LEFT || eAlignMask == Image::TextAlign::RIGHT) {\n\t\t\t//vertical center\n\t\t\treturn (borderHeight - txtHeight) / 2 + baseLinePos;\n\t\t} else if (eAlignMask == Image::TextAlign::BOTTOM_RIGHT || eAlignMask == Image::TextAlign::BOTTOM || eAlignMask == Image::TextAlign::BOTTOM_LEFT) {\n\t\t\t//vertical bottom\n\t\t\treturn borderHeight - txtHeight + baseLinePos;\n\t\t}\n\n\t\t// top alignment\n\t\treturn baseLinePos;\n\t}\n\n    std::string getFontFile(const char* family_name) {\n    \tstd::string fontPath = family_name;\n\n    \tstd::map<std::string, std::string>::iterator it = fontCache.find(family_name);\n    \tif ( it != fontCache.end() ) {\n    \t\treturn it->second;\n    \t}\n\n    \t// check if the parameter is a font file shipped with the application\n    \tstd::string lowerCasePath = fontPath;\n    \tstd::transform(lowerCasePath.begin(), lowerCasePath.end(), lowerCasePath.begin(), ::tolower);\n    \tif ( lowerCasePath.find(\".ttf\") != std::string::npos ) {\n    \t\tfontPath = cocos2d::FileUtils::getInstance()->fullPathForFilename(fontPath.c_str());\n\n    \t\tFILE *f = fopen(fontPath.c_str(), \"r\");\n    \t\tif ( f ) {\n    \t\t\tfclose(f);\n    \t\t\tfontCache.insert(std::pair<std::string, std::string>(family_name, fontPath));\n    \t\t\treturn fontPath;\n    \t\t}\n    \t}\n\n    \t// use fontconfig to match the parameter against the fonts installed on the system\n    \tFcPattern *pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, family_name, (char *) 0);\n    \tFcConfigSubstitute(0, pattern, FcMatchPattern);\n    \tFcDefaultSubstitute(pattern);\n\n    \tFcResult result;\n    \tFcPattern *font = FcFontMatch(0, pattern, &result);\n    \tif ( font ) {\n    \t\tFcChar8 *s = NULL;\n    \t\tif ( FcPatternGetString(font, FC_FILE, 0, &s) == FcResultMatch ) {\n    \t\t\tfontPath = (const char*)s;\n\n    \t\t\tFcPatternDestroy(font);\n    \t\t\tFcPatternDestroy(pattern);\n\n    \t\t\tfontCache.insert(std::pair<std::string, std::string>(family_name, fontPath));\n    \t\t\treturn fontPath;\n    \t\t}\n    \t\tFcPatternDestroy(font);\n    \t}\n    \tFcPatternDestroy(pattern);\n\n    \treturn family_name;\n    }\n\n\tbool getBitmap(const char *text, int nWidth, int nHeight, Image::TextAlign eAlignMask, const char * pFontName, float fontSize) {\n\t\tif (libError) {\n\t\t\treturn false;\n\t\t}\n\n\t\tFT_Face face;\n\t\tstd::string fontfile = getFontFile(pFontName);\n\t\tif ( FT_New_Face(library, fontfile.c_str(), 0, &face) ) {\n\t\t\t//no valid font found use default\n\t\t\tif ( FT_New_Face(library, \"/usr/share/fonts/truetype/freefont/FreeSerif.ttf\", 0, &face) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t//select utf8 charmap\n\t\tif ( FT_Select_Charmap(face, FT_ENCODING_UNICODE) ) {\n\t\t\tFT_Done_Face(face);\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( FT_Set_Pixel_Sizes(face, fontSize, fontSize) ) {\n\t\t\tFT_Done_Face(face);\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( divideString(face, text, nWidth, nHeight) == false ) {\n\t\t\tFT_Done_Face(face);\n\t\t\treturn false;\n\t\t}\n\n\t\t//compute the final line width\n\t\tiMaxLineWidth = MAX(iMaxLineWidth, nWidth);\n\n\t\t//compute the final line height\n\t\tiMaxLineHeight = ceilf(FT_MulFix( face->bbox.yMax - face->bbox.yMin, face->size->metrics.y_scale )/64.0f);\n\t\tint lineHeight = face->size->metrics.height>>6;\n\t\tif ( textLines.size() > 0 ) {\n\t\t\tiMaxLineHeight += (lineHeight * (textLines.size() -1));\n\t\t}\n\t\tint txtHeight = iMaxLineHeight;\n\t\tiMaxLineHeight = MAX(iMaxLineHeight, nHeight);\n\n\t\t_data = new unsigned char[iMaxLineWidth * iMaxLineHeight * 4];\n\t\tmemset(_data,0, iMaxLineWidth * iMaxLineHeight*4);\n\n\t\tint iCurYCursor = computeLineStartY(face, eAlignMask, txtHeight, iMaxLineHeight);\n\n\t\tint lineCount = textLines.size();\n\t\tfor (int line = 0; line < lineCount; line++) {\n\t\t\tint iCurXCursor = computeLineStart(face, eAlignMask, line);\n\n\t\t\tint glyphCount = textLines.at(line).glyphs.size();\n\t\t\tfor (int i = 0; i < glyphCount; i++) {\n\t\t\t\tLineBreakGlyph glyph = textLines.at(line).glyphs.at(i);\n\n\t\t\t\tif (FT_Load_Glyph(face, glyph.glyphIndex, FT_LOAD_RENDER)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tFT_Bitmap& bitmap = face->glyph->bitmap;\n\t\t\t\tint yoffset = iCurYCursor - (face->glyph->metrics.horiBearingY >> 6);\n\t\t\t\tint xoffset = iCurXCursor + glyph.paintPosition;\n\n\t\t\t\tfor (int y = 0; y < bitmap.rows; ++y) {\n                    int iY = yoffset + y;\n                    if (iY>=iMaxLineHeight) {\n                        //exceed the height truncate\n                        break;\n                    }\n                    iY *= iMaxLineWidth;\n\n                    int bitmap_y = y * bitmap.width;\n\n\t\t\t\t\tfor (int x = 0; x < bitmap.width; ++x) {\n\t\t\t\t\t\tunsigned char cTemp = bitmap.buffer[bitmap_y + x];\n\t\t\t\t\t\tif (cTemp == 0) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tint iX = xoffset + x;\n\n\t\t\t\t\t\tint iTemp = cTemp << 24 | cTemp << 16 | cTemp << 8 | cTemp;\n\t\t\t\t\t\t*(int*) &_data[(iY + iX) * 4 + 0] = iTemp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// step to next line\n\t\t\tiCurYCursor += lineHeight;\n\t\t}\n\n\t\t//  free face\n\t\tFT_Done_Face(face);\n\t\treturn true;\n\t}\n\npublic:\n\tFT_Library library;\n\n\tunsigned char *_data;\n\tint libError;\n\tstd::vector<LineBreakLine> textLines;\n\tint iMaxLineWidth;\n\tint iMaxLineHeight;\n};\n\nstatic BitmapDC& sharedBitmapDC()\n{\n\tstatic BitmapDC s_BmpDC;\n\treturn s_BmpDC;\n}\n\nbool Image::initWithString(\n\t\tconst char * text,\n\t\tint width/* = 0*/,\n\t\tint height/* = 0*/,\n\t\tTextAlign alignMask/* = kAlignCenter*/,\n\t\tconst char * fontName/* = nil*/,\n\t\tint size/* = 0*/)\n{\n\tbool ret = false;\n\tdo\n    {\n\t\tCC_BREAK_IF(!text || 0 == strlen(text));\n\n\t\tBitmapDC &dc = sharedBitmapDC();\n\n\t\tCC_BREAK_IF(! dc.getBitmap(text, width, height, alignMask, fontName, size));\n\n\t\t// assign the dc._data to _data in order to save time\n\t\t_data = dc._data;\n\t\tCC_BREAK_IF(! _data);\n\n\t\t_width = (short)dc.iMaxLineWidth;\n\t\t_height = (short)dc.iMaxLineHeight;\n        _renderFormat = Texture2D::PixelFormat::RGBA8888;\n\t\t_preMulti = true;\n        _dataLen = _width * _height * 4;\n\n\t\tret = true;\n\n\t\tdc.reset();\n\t}while (0);\n\n\t//do nothing\n\treturn ret;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCPlatformDefine.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCPLATFORMDEFINE_H__\n#define __CCPLATFORMDEFINE_H__\n\n#include <string.h>\n\n#if defined(_USRDLL)\n#define CC_DLL __attribute__ ((visibility (\"default\")))\n#else         /* use a DLL library */\n#define CC_DLL __attribute__ ((visibility (\"default\")))\n#endif\n\n#include <assert.h>\n#define CC_ASSERT(cond)    assert(cond)\n#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam\n\n/* Define NULL pointer value */\n#ifndef NULL\n#ifdef __cplusplus\n#define NULL    0\n#else\n#define NULL    ((void *)0)\n#endif\n#endif\n\n\n\n#endif /* __CCPLATFORMDEFINE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCStdC.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCStdC.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n\nint CC_DLL gettimeofday(struct timeval * val, struct timezone *)\n{\n    if (val)\n    {\n        SYSTEMTIME wtm;\n        GetLocalTime(&wtm);\n\n        struct tm tTm;\n        tTm.tm_year     = wtm.wYear - 1900;\n        tTm.tm_mon      = wtm.wMonth - 1;\n        tTm.tm_mday     = wtm.wDay;\n        tTm.tm_hour     = wtm.wHour;\n        tTm.tm_min      = wtm.wMinute;\n        tTm.tm_sec      = wtm.wSecond;\n        tTm.tm_isdst    = -1;\n\n        val->tv_sec     = (long)mktime(&tTm);       // time_t is 64-bit on win32\n        val->tv_usec    = wtm.wMilliseconds * 1000;\n    }\n    return 0;\n}\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)\n\nusing namespace Osp::System;\n\nint CC_DLL gettimeofday(struct timeval * val, struct timezone *)\n{\n    if (val)\n    {\n    \tlong long curTick = 0;\n    \tSystemTime::GetTicks(curTick);\n    \tunsigned int ms = curTick;\n    \tval->tv_sec = ms / 1000;\n    \tval->tv_usec = (ms % 1000) * 1000;\n    }\n    return 0;\n}\n\n\n#endif  // CC_PLATFORM_WIN32\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/linux/CCStdC.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_STD_C_H__\n#define __CC_STD_C_H__\n\n#include \"CCPlatformMacros.h\"\n\n#include <float.h>\n#include <math.h>\n#include <string.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n#include <sys/time.h>\n#include <stdint.h>\n\n#ifndef MIN\n#define MIN(x,y) (((x) > (y)) ? (y) : (x))\n#endif  // MIN\n\n#ifndef MAX\n#define MAX(x,y) (((x) < (y)) ? (y) : (x))\n#endif  // MAX\n\n// some function linux do not have\n#define tanf tan\n#define sqrtf sqrt\n#define cosf cos\n#define sinf sin\n\n#endif  // __CC_STD_C_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCApplication.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_APPLICATION_MAC_H__\n#define __CC_APPLICATION_MAC_H__\n\n#include \"platform/CCCommon.h\"\n#include \"platform/CCApplicationProtocol.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass CC_DLL Application : public ApplicationProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    Application();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Application();\n        \n    /**\n    @brief\tCallback by Director for limit FPS.\n    @param interval The time, which expressed in second in second, between current frame and next.\n    */\n    virtual void setAnimationInterval(double interval);\n        \n    /**\n    @brief\tGet status bar rectangle in EGLView window.\n    */\n        \n    /**\n    @brief\tRun the message loop.\n    * @js NA\n    * @lua NA\n    */\n    int run();\n        \n    /**\n    @brief\tGet current applicaiton instance.\n    @return Current application instance pointer.\n    */\n    static Application* getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();\n    \n    /**\n    @brief Get current language config\n    @return Current language config\n    */\n    virtual LanguageType getCurrentLanguage();\n\t\t\n    /**\n     @brief Get target platform\n     */\n    virtual Platform getTargetPlatform();\n\n    /**\n     *  Sets the Resource root path.\n     *  @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.\n     */\n    CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir);\n    \n    /** \n     *  Gets the Resource root path.\n     *  @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. \n     */\n    CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void);\n    \n    void setStartupScriptFilename(const std::string& startupScriptFile);\n    \n    const std::string& getStartupScriptFilename(void);\n    \nprotected:\n    static Application * sm_pSharedApplication;\n    \n    std::string _resourceRootPath;\n    std::string _startupScriptFilename;\n};\n\nNS_CC_END\n\n#endif\t// end of __CC_APPLICATION_MAC_H__;\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCApplication.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import \"CCApplication.h\"\n#import <Cocoa/Cocoa.h>\n#include <algorithm>\n#include \"platform/CCFileUtils.h\"\n#include \"CCGeometry.h\"\n#include \"CCDirector.h\"\n#import \"CCDirectorCaller.h\"\n#include \"CCEGLView.h\"\n\nNS_CC_BEGIN\n\nApplication* Application::sm_pSharedApplication = 0;\n\nApplication::Application()\n{\n    CCASSERT(! sm_pSharedApplication, \"sm_pSharedApplication already exist\");\n    sm_pSharedApplication = this;\n}\n\nApplication::~Application()\n{\n    CCASSERT(this == sm_pSharedApplication, \"sm_pSharedApplication != this\");\n    sm_pSharedApplication = 0;\n}\n\nint Application::run()\n{\n    if(!applicationDidFinishLaunching())\n    {\n        return 0;\n    }\n    EGLView* pMainWnd = EGLView::getInstance();\n    \n    while (!pMainWnd->windowShouldClose())\n    {\n        Director::getInstance()->mainLoop();\n        pMainWnd->pollEvents();\n    }\n\n    /* Only work on Desktop\n    *  Director::mainLoop is really one frame logic\n    *  when we want to close the window, we should call Director::end();\n    *  then call Director::mainLoop to do release of internal resources\n    */\n    Director::getInstance()->end();\n    Director::getInstance()->mainLoop();\n    return true;\n}\n\nvoid Application::setAnimationInterval(double interval)\n{\n    [[CCDirectorCaller sharedDirectorCaller] setAnimationInterval: interval ];\n}\n\nApplication::Platform Application::getTargetPlatform()\n{\n    return Platform::OS_MAC;\n}\n\n/////////////////////////////////////////////////////////////////////////////////////////////////\n// static member function\n//////////////////////////////////////////////////////////////////////////////////////////////////\n\nApplication* Application::getInstance()\n{\n    CCASSERT(sm_pSharedApplication, \"sm_pSharedApplication not set\");\n    return sm_pSharedApplication;\n}\n\n// @deprecated Use getInstance() instead\nApplication* Application::sharedApplication()\n{\n    return Application::getInstance();\n}\n\nLanguageType Application::getCurrentLanguage()\n{\n    // get the current language and country config\n    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];\n    NSArray *languages = [defaults objectForKey:@\"AppleLanguages\"];\n    NSString *currentLanguage = [languages objectAtIndex:0];\n\n    // get the current language code.(such as English is \"en\", Chinese is \"zh\" and so on)\n    NSDictionary* temp = [NSLocale componentsFromLocaleIdentifier:currentLanguage];\n    NSString * languageCode = [temp objectForKey:NSLocaleLanguageCode];\n\n    LanguageType ret = LanguageType::ENGLISH;\n    if ([languageCode isEqualToString:@\"zh\"])\n    {\n        ret = LanguageType::CHINESE;\n    }\n    else if ([languageCode isEqualToString:@\"en\"])\n    {\n        ret = LanguageType::ENGLISH;\n    }\n    else if ([languageCode isEqualToString:@\"fr\"]){\n        ret = LanguageType::FRENCH;\n    }\n    else if ([languageCode isEqualToString:@\"it\"]){\n        ret = LanguageType::ITALIAN;\n    }\n    else if ([languageCode isEqualToString:@\"de\"]){\n        ret = LanguageType::GERMAN;\n    }\n    else if ([languageCode isEqualToString:@\"es\"]){\n        ret = LanguageType::SPANISH;\n    }\n    else if ([languageCode isEqualToString:@\"ru\"]){\n        ret = LanguageType::RUSSIAN;\n    }\n    else if ([languageCode isEqualToString:@\"ko\"]){\n        ret = LanguageType::KOREAN;\n    }\n    else if ([languageCode isEqualToString:@\"ja\"]){\n        ret = LanguageType::JAPANESE;\n    }\n    else if ([languageCode isEqualToString:@\"hu\"]){\n        ret = LanguageType::HUNGARIAN;\n    }\n    else if ([languageCode isEqualToString:@\"pt\"])\n    {\n        ret = LanguageType::PORTUGUESE;\n    }\n    else if ([languageCode isEqualToString:@\"ar\"])\n    {\n        ret = LanguageType::ARABIC;\n    }\n    else if ([languageCode isEqualToString:@\"nb\"]){\n        ret = LanguageType::NORWEGIAN;\n    }\n    else if ([languageCode isEqualToString:@\"pl\"]){\n        ret = LanguageType::POLISH;\n    }\n    return ret;\n}\n\nvoid Application::setResourceRootPath(const std::string& rootResDir)\n{\n    _resourceRootPath = rootResDir;\n    if (_resourceRootPath[_resourceRootPath.length() - 1] != '/')\n    {\n        _resourceRootPath += '/';\n    }\n    FileUtils* pFileUtils = FileUtils::getInstance();\n    std::vector<std::string> searchPaths = pFileUtils->getSearchPaths();\n    searchPaths.insert(searchPaths.begin(), _resourceRootPath);\n    pFileUtils->setSearchPaths(searchPaths);\n}\n\nconst std::string& Application::getResourceRootPath(void)\n{\n    return _resourceRootPath;\n}\n\nvoid Application::setStartupScriptFilename(const std::string& startupScriptFile)\n{\n    _startupScriptFilename = startupScriptFile;\n    std::replace(_startupScriptFilename.begin(), _startupScriptFilename.end(), '\\\\', '/');\n}\n\nconst std::string& Application::getStartupScriptFilename(void)\n{\n    return _startupScriptFilename;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCCommon.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"platform/CCCommon.h\"\n#include \"CCEGLView.h\"\n#define GLFW_EXPOSE_NATIVE_NSGL\n#define GLFW_EXPOSE_NATIVE_COCOA\n#include \"glfw3native.h\"\n\n#include <stdarg.h>\n#include <stdio.h>\n#include <Cocoa/Cocoa.h>\n\nNS_CC_BEGIN\n\nvoid LuaLog(const char * format)\n{\n    puts(format);\n}\n\n// ios no MessageBox, use log instead\nvoid MessageBox(const char * msg, const char * title)\n{\n    NSString * tmpTitle = (title) ? [NSString stringWithUTF8String : title] : nil;\n    NSString * tmpMsg = (msg) ? [NSString stringWithUTF8String : msg] : nil;\n\n\tNSAlert *alert = [[[NSAlert alloc] init] autorelease];\n\t[alert addButtonWithTitle:@\"OK\"];\n\t[alert setMessageText:tmpMsg];\n\t[alert setInformativeText:tmpTitle];\n\t[alert setAlertStyle:NSWarningAlertStyle];\n\n    id window = glfwGetCocoaWindow(EGLView::getInstance()->getWindow());\n\t[alert beginSheetModalForWindow:window\n\t\t\t\t\t  modalDelegate:[window delegate]\n\t\t\t\t\t didEndSelector:nil\n\t\t\t\t\t\tcontextInfo:nil];\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCDevice.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"platform/CCDevice.h\"\n\nNS_CC_BEGIN\n\nint Device::getDPI()\n{\n//TODO: \n    return 160;\n}\n\nvoid Device::setAccelerometerEnabled(bool isEnabled)\n{\n\n}\n\nvoid Device::setAccelerometerInterval(float interval)\n{\n\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCDirectorCaller.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import <Foundation/Foundation.h>\n#import <QuartzCore/CVDisplayLink.h>\n\n@interface CCDirectorCaller : NSObject {\n        CVDisplayLinkRef displayLink;\n\t\tNSTimer *renderTimer;\n        int interval;\n}\n@property (readwrite) int interval;\n-(void) startMainLoop;\n-(void) end;\n-(void) doCaller: (id) sender;\n-(void) setAnimationInterval:(double)interval;\n\n+(id) sharedDirectorCaller;\n@end\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCDirectorCaller.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import \"CCDirectorCaller.h\"\n#include \"CCDirector.h\"\n#include \"CCAutoreleasePool.h\"\n\n#import <Foundation/Foundation.h>\n#import <AppKit/AppKit.h>\n\nstatic id s_sharedDirectorCaller;\n\n@interface NSObject(CADisplayLink)\n+(id) displayLinkWithTarget: (id)arg1 selector:(SEL)arg2;\n-(void) addToRunLoop: (id)arg1 forMode: (id)arg2;\n-(void) setFrameInterval: (int)interval;\n-(void) invalidate;\n@end\n\n@implementation CCDirectorCaller\n\n@synthesize interval;\n\n+(id) sharedDirectorCaller\n{\n\tif (s_sharedDirectorCaller == nil)\n\t{\n\t\ts_sharedDirectorCaller = [[CCDirectorCaller alloc] init];\n\t}\n\t\n\treturn s_sharedDirectorCaller;\n}\n\n-(void) alloc\n{\n    interval = 1;\n}\n\n-(void) dealloc\n{\n    s_sharedDirectorCaller = nil;\n    CCLOGINFO(\"deallocing DirectorCaller: %p\", self);\n\tif (displayLink) {\n\t\tCVDisplayLinkRelease(displayLink);\n\t}\n    \n    CCLOG(\"--------------------------------------------------------------------------------\");\n    CCLOG(\"\");\n    CCLOG(\"\");\n    CCLOG(\"\");\n\t[super dealloc];\n}\n\n- (CVReturn) getFrameForTime:(const CVTimeStamp*)outputTime\n{\n#if CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD\n\t//if( ! runningThread_ )\n\t//runningThread_ = [NSThread currentThread];\n    \n\tNSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\t\n\tcocos2d::Director::getInstance()->drawScene();\n    cocos2d::PoolManager::getInstance()->getCurrentPool()->clear();\n\t\n\t[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:nil];\n\t\n\t// release the objects\n\t[pool release];\n\t\n#else\n\t[self performSelector:@selector(drawScene) onThread:[NSThread currentThread] withObject:nil waitUntilDone:YES];\n#endif\n\t\n    return kCVReturnSuccess;\n}\n\n// This is the renderer output callback function\nstatic CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext)\n{\n    //    CVReturn result = [(DirectorCaller*)displayLinkContext getFrameForTime:outputTime];\n    //    return result;\n\tNSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\tcocos2d::Director::getInstance()->mainLoop();\n\t[pool release];\n    \n\treturn kCVReturnSuccess;\n}\n\n- (void)timerFired:(id)sender\n{\n    // It is good practice in a Cocoa application to allow the system to send the -drawRect:\n    // message when it needs to draw, and not to invoke it directly from the timer.\n    // All we do here is tell the display it needs a refresh\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n    \n\t// run the main cocos2d loop\n\tcocos2d::Director::getInstance()->mainLoop();\n    \n\t[pool release];\n}\n\n-(void) startMainLoop\n{\n    // Director::setAnimationInterval() is called, we should invalide it first\n    //        [displayLink invalidate];\n    //        displayLink = nil;\n    //\n    //        displayLink = [NSClassFromString(@\"CADisplayLink\") displayLinkWithTarget:self selector:@selector(doCaller:)];\n    //        [displayLink setFrameInterval: self.interval];\n    //        [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];\n#if ! CC_DIRECTOR_MAC_USE_DISPLAY_LINK_THREAD\n\tNSThread* thread = [[NSThread alloc] initWithTarget:self selector:@selector(mainLoop) object:nil];\n\t[thread start];\n#endif\n\t// NSTimer\n\t[renderTimer invalidate];\n\trenderTimer = nil;\n    \n\trenderTimer = [NSTimer timerWithTimeInterval:self.interval/60.0f   //a 1ms time interval\n                                          target:self\n                                        selector:@selector(timerFired:)\n                                        userInfo:nil\n                                         repeats:YES];\n    \n    [[NSRunLoop currentRunLoop] addTimer:renderTimer\n                                 forMode:NSDefaultRunLoopMode];\n    [[NSRunLoop currentRunLoop] addTimer:renderTimer\n                                 forMode:NSEventTrackingRunLoopMode]; //Ensure timer fires during resize\n    \n    /*\n     // CVDisplayLink\n     //cocos2d::Director::getInstance()->gettimeofday();\n     \n     // Create a display link capable of being used with all active displays\n     CVDisplayLinkCreateWithActiveCGDisplays(&displayLink);\n     \n     // Set the renderer output callback function\n     CVDisplayLinkSetOutputCallback(displayLink, &MyDisplayLinkCallback, self);\n     \n     // Set the display link for the current renderer\n     CCEAGLView *openGLView_ = (CCEAGLView*)[CCEAGLView sharedEGLView];\n     CGLContextObj cglContext = (CGLContextObj)[[openGLView_ openGLContext] CGLContextObj];\n     CGLPixelFormatObj cglPixelFormat = (CGLPixelFormatObj)[[openGLView_ pixelFormat] CGLPixelFormatObj];\n     CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(displayLink, cglContext, cglPixelFormat);\n     \n     // Activate the display link\n     CVDisplayLinkStart(displayLink);\n     */\n}\n\n-(void) end\n{\n    [renderTimer invalidate];\n\trenderTimer = nil;\n    [self release];\n}\n\n-(void) setAnimationInterval:(double)intervalNew\n{\n\tself.interval = 60.0 * intervalNew;\n\t[renderTimer invalidate];\n\trenderTimer = nil;\n\trenderTimer = [NSTimer timerWithTimeInterval:self.interval/60.0f   //a 1ms time interval\n\t\t\t\t\t\t\t\t\t\t  target:self\n\t\t\t\t\t\t\t\t\t\tselector:@selector(timerFired:)\n\t\t\t\t\t\t\t\t\t\tuserInfo:nil\n\t\t\t\t\t\t\t\t\t\t repeats:YES];\n\t\n\t[[NSRunLoop currentRunLoop] addTimer:renderTimer \n\t\t\t\t\t\t\t\t forMode:NSDefaultRunLoopMode];\n\t[[NSRunLoop currentRunLoop] addTimer:renderTimer \n\t\t\t\t\t\t\t\t forMode:NSEventTrackingRunLoopMode];\n}\n\n-(void) doCaller: (id) sender\n{\n\tcocos2d::Director::getInstance()->mainLoop();\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCGL.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __PLATFORM_MAC_CCGL_H__\n#define __PLATFORM_MAC_CCGL_H__\n\n#import <OpenGL/gl.h>\n#import <OpenGL/glu.h>\n#import <OpenGL/glext.h>\n\n#define CC_GL_DEPTH24_STENCIL8      -1\n\n\n#define glDeleteVertexArrays            glDeleteVertexArraysAPPLE\n#define glGenVertexArrays               glGenVertexArraysAPPLE\n#define glBindVertexArray               glBindVertexArrayAPPLE\n#define glClearDepthf                   glClearDepth\n#define glDepthRangef                   glDepthRange\n#define glReleaseShaderCompiler(xxx)\n\n\n#endif // __PLATFORM_MAC_CCGL_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCImage.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCImageCommon_cpp.h\"\n#include <Foundation/Foundation.h>\n#include <Cocoa/Cocoa.h>\n#include \"CCDirector.h\"\n#include \"ccMacros.h\"\n#include \"CCImage.h\"\n#include \"CCFileUtils.h\"\n#include \"CCTexture2D.h\"\n#include <string>\n#include <sys/stat.h>\n#include <stdio.h>\n#include <unistd.h>\n\nNS_CC_BEGIN\n\ntypedef struct\n{\n    int height;\n    int width;\n    bool        hasAlpha;\n    bool        isPremultipliedAlpha;\n    unsigned char*  data;\n} tImageInfo;\n\nstatic bool _initWithString(const char * text, cocos2d::Image::TextAlign align, const char * fontName, int size, tImageInfo* info, cocos2d::Color3B* strokeColor)\n{\n    bool ret = false;\n\n\tCCASSERT(text, \"Invalid pText\");\n\tCCASSERT(info, \"Invalid pInfo\");\n\t\n\tdo {\n\t\tNSString * string  = [NSString stringWithUTF8String:text];\n\t\t\n\t\t// font\n\t\tNSFont *font = [[NSFontManager sharedFontManager]\n\t\t\t\t\t\t fontWithFamily:[NSString stringWithUTF8String:fontName]\n\t\t\t\t\t\ttraits:NSUnboldFontMask | NSUnitalicFontMask\n\t\t\t\t\t\t weight:0\n\t\t\t\t\t\t size:size];\n\t\t\n\t\tif (font == nil) {\n\t\t\tfont = [[NSFontManager sharedFontManager]\n\t\t\t\t\tfontWithFamily:@\"Arial\"\n\t\t\t\t\ttraits:NSUnboldFontMask | NSUnitalicFontMask\n\t\t\t\t\tweight:0\n\t\t\t\t\tsize:size];\n\t\t}\n\t\tCC_BREAK_IF(!font);\n\t\t\n\t\t// color\n\t\tNSColor* foregroundColor;\n\t\tif (strokeColor) {\n\t\t\tforegroundColor = [NSColor colorWithDeviceRed:strokeColor->r/255.0 green:strokeColor->g/255.0 blue:strokeColor->b/255.0 alpha:1];\n\t\t} else {\n\t\t\tforegroundColor = [NSColor whiteColor];\n\t\t}\n\t\t\n\t\t\n\t\t// alignment, linebreak\n\t\tunsigned horiFlag = (int)align & 0x0f;\n\t\tunsigned vertFlag = ((int)align >> 4) & 0x0f;\n\t\tNSTextAlignment textAlign = (2 == horiFlag) ? NSRightTextAlignment\n\t\t\t: (3 == horiFlag) ? NSCenterTextAlignment\n\t\t\t: NSLeftTextAlignment;\n\t\t\n\t\tNSMutableParagraphStyle *paragraphStyle = [[[NSMutableParagraphStyle alloc] init] autorelease];\n\t\t[paragraphStyle setParagraphStyle:[NSParagraphStyle defaultParagraphStyle]];\n\t\t[paragraphStyle setLineBreakMode:NSLineBreakByCharWrapping];\n\t\t[paragraphStyle setAlignment:textAlign];\n\n\t\t// attribute\n\t\tNSDictionary* tokenAttributesDict = [NSDictionary dictionaryWithObjectsAndKeys:\n\t\t\t\t\t\t\t\t\t\t\t foregroundColor,NSForegroundColorAttributeName,\n\t\t\t\t\t\t\t\t\t\t\t font, NSFontAttributeName,\n\t\t\t\t\t\t\t\t\t\t\t paragraphStyle, NSParagraphStyleAttributeName, nil];\n\n\t\t// linebreak\n\t\tif (info->width > 0) {\n\t\t\tif ([string sizeWithAttributes:tokenAttributesDict].width > info->width) {\n\t\t\t\tNSMutableString *lineBreak = [[[NSMutableString alloc] init] autorelease];\n\t\t\t\tNSUInteger length = [string length];\n\t\t\t\tNSRange range = NSMakeRange(0, 1);\n\t\t\t\tNSUInteger width = 0;\n\t\t\t\tNSUInteger lastBreakLocation = 0;\n\t\t\t\tfor (NSUInteger i = 0; i < length; i++) {\n\t\t\t\t\trange.location = i;\n\t\t\t\t\tNSString *character = [string substringWithRange:range];\n\t\t\t\t\t[lineBreak appendString:character];\n\t\t\t\t\tif ([@\"!?.,-= \" rangeOfString:character].location != NSNotFound) { lastBreakLocation = i; }\n\t\t\t\t\twidth = [lineBreak sizeWithAttributes:tokenAttributesDict].width;\n\t\t\t\t\tif (width > info->width) {\n\t\t\t\t\t\t[lineBreak insertString:@\"\\r\\n\" atIndex:(lastBreakLocation > 0) ? lastBreakLocation : [lineBreak length] - 1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstring = lineBreak;\n\t\t\t}\n\t\t}\n\n\t\tNSAttributedString *stringWithAttributes =[[[NSAttributedString alloc] initWithString:string\n\t\t\t\t\t\t\t\t\t\t attributes:tokenAttributesDict] autorelease];\n\t\t\t\t\n\t\tNSSize realDimensions = [stringWithAttributes size];\n\t\t// Mac crashes if the width or height is 0\n\t\tCC_BREAK_IF(realDimensions.width <= 0 || realDimensions.height <= 0);\n\t\t\t\t\n\t\tCGSize dimensions = CGSizeMake(info->width, info->height);\n\t\t\n\t\n\t\tif(dimensions.width <= 0 && dimensions.height <= 0) {\n\t\t\tdimensions.width = realDimensions.width;\n\t\t\tdimensions.height = realDimensions.height;\n\t\t} else if (dimensions.height <= 0) {\n\t\t\tdimensions.height = realDimensions.height;\n\t\t}\n\n\t\tNSInteger POTWide = dimensions.width;\n\t\tNSInteger POTHigh = MAX(dimensions.height, realDimensions.height);\n\t\tunsigned char*\t\t\tdata;\n\t\t//Alignment\n\t\t\t\n\t\tCGFloat xPadding = 0;\n\t\tswitch (textAlign) {\n\t\t\tcase NSLeftTextAlignment: xPadding = 0; break;\n\t\t\tcase NSCenterTextAlignment: xPadding = (dimensions.width-realDimensions.width)/2.0f; break;\n\t\t\tcase NSRightTextAlignment: xPadding = dimensions.width-realDimensions.width; break;\n\t\t\tdefault: break;\n\t\t}\n\n\t\t// 1: TOP\n\t\t// 2: BOTTOM\n\t\t// 3: CENTER\n\t\tCGFloat yPadding = (1 == vertFlag || realDimensions.height >= dimensions.height) ? (dimensions.height - realDimensions.height)\t// align to top\n\t\t: (2 == vertFlag) ? 0\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// align to bottom\n\t\t: (dimensions.height - realDimensions.height) / 2.0f;\t\t\t\t\t\t\t\t\t// align to center\n\t\t\n\t\t\n\t\tNSRect textRect = NSMakeRect(xPadding, POTHigh - dimensions.height + yPadding, realDimensions.width, realDimensions.height);\n\t\t//Disable antialias\n\t\t\n\t\t[[NSGraphicsContext currentContext] setShouldAntialias:NO];\t\n\t\t\n\t\tNSImage *image = [[NSImage alloc] initWithSize:NSMakeSize(POTWide, POTHigh)];\n        \n\t\t[image lockFocus];\n        \n        // patch for mac retina display and lableTTF\n        [[NSAffineTransform transform] set];\n\t\t\n\t\t//[stringWithAttributes drawAtPoint:NSMakePoint(xPadding, offsetY)]; // draw at offset position\t\n\t\t[stringWithAttributes drawInRect:textRect];\n\t\t//[stringWithAttributes drawInRect:textRect withAttributes:tokenAttributesDict];\n\t\tNSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect (0.0f, 0.0f, POTWide, POTHigh)];\n\t\t[image unlockFocus];\n\t\t\n\t\tdata = (unsigned char*) [bitmap bitmapData];  //Use the same buffer to improve the performance.\n\t\t\n\t\tNSUInteger textureSize = POTWide*POTHigh*4;\n\t\t\n\t\tunsigned char* dataNew = new unsigned char[textureSize];\n\t\tif (dataNew) {\n\t\t\tmemcpy(dataNew, data, textureSize);\n\t\t\t// output params\n\t\t\tinfo->width = static_cast<int>(POTWide);\n\t\t\tinfo->height = static_cast<int>(POTHigh);\n\t\t\tinfo->data = dataNew;\n\t\t\tinfo->hasAlpha = true;\n\t\t\tinfo->isPremultipliedAlpha = true;\n\t\t\tret = true;\n\t\t}\n\t\t[bitmap release];\n\t\t[image release];\n\t} while (0);\n    return ret;\n}\n\nbool Image::initWithString(\n\tconst char *    text,\n\tint             width,\n\tint             height,\n\tTextAlign       alignMask,\n\tconst char *    fontName,\n\tint             size)\n{\n    tImageInfo info = {0};\n    info.width = width;\n    info.height = height;\n\t\n    if (! _initWithString(text, alignMask, fontName, size, &info, nullptr)) //pStrokeColor))\n    {\n        return false;\n    }\n    _height = (short)info.height;\n    _width = (short)info.width;\n    _renderFormat = Texture2D::PixelFormat::RGBA8888;\n    _preMulti = info.isPremultipliedAlpha;\n\tif (_data) {\n\t\tCC_SAFE_DELETE_ARRAY(_data);\n\t}\n    _data = info.data;\n    _dataLen = _width * _height * 4;\n\n    return true;\n}\n\n\nNS_CC_END\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCPlatformDefine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCPLATFORMDEFINE_H__\n#define __CCPLATFORMDEFINE_H__\n\n#include <assert.h>\n\n#define CC_DLL \n\n#if CC_DISABLE_ASSERT > 0\n#define CC_ASSERT(cond)\n#else\n#define CC_ASSERT(cond) assert(cond)\n#endif\n\n#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam\n\n/* Define NULL pointer value */\n#ifndef NULL\n#ifdef __cplusplus\n#define NULL    0\n#else\n#define NULL    ((void *)0)\n#endif\n#endif\n\n\n\n#endif /* __CCPLATFORMDEFINE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/mac/CCStdC.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_STD_C_H__\n#define __CC_STD_C_H__\n\n#include \"CCPlatformMacros.h\"\n#include <float.h>\n#include <math.h>\n#include <string.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n#include <sys/time.h>\n#include <stdint.h>\n\n#ifndef MIN\n#define MIN(x,y) (((x) > (y)) ? (y) : (x))\n#endif  // MIN\n\n#ifndef MAX\n#define MAX(x,y) (((x) < (y)) ? (y) : (x))\n#endif  // MAX\n\n#endif  // __CC_STD_C_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCApplication.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCApplication.h\"\n#include \"CCEGLView.h\"\n#include \"CCDirector.h\"\n#include <algorithm>\n#include \"platform/CCFileUtils.h\"\n/**\n@brief    This function change the PVRFrame show/hide setting in register.\n@param  bEnable If true show the PVRFrame window, otherwise hide.\n*/\nstatic void PVRFrameEnableControlWindow(bool bEnable);\n\nNS_CC_BEGIN\n\n// sharedApplication pointer\nApplication * Application::sm_pSharedApplication = 0;\n\nApplication::Application()\n: _instance(NULL)\n, _accelTable(NULL)\n{\n    _instance    = GetModuleHandle(NULL);\n    _animationInterval.QuadPart = 0;\n    CC_ASSERT(! sm_pSharedApplication);\n    sm_pSharedApplication = this;\n}\n\nApplication::~Application()\n{\n    CC_ASSERT(this == sm_pSharedApplication);\n    sm_pSharedApplication = NULL;\n}\n\nint Application::run()\n{\n    PVRFrameEnableControlWindow(false);\n\n    // Main message loop:\n    LARGE_INTEGER nFreq;\n    LARGE_INTEGER nLast;\n    LARGE_INTEGER nNow;\n\n    QueryPerformanceFrequency(&nFreq);\n    QueryPerformanceCounter(&nLast);\n\n    // Initialize instance and cocos2d.\n    if (!applicationDidFinishLaunching())\n    {\n        return 0;\n    }\n\n    EGLView* pMainWnd = EGLView::getInstance();\n\n    while(!pMainWnd->windowShouldClose())\n    {\n        QueryPerformanceCounter(&nNow);\n        if (nNow.QuadPart - nLast.QuadPart > _animationInterval.QuadPart)\n        {\n            nLast.QuadPart = nNow.QuadPart;\n            Director::getInstance()->mainLoop();\n            pMainWnd->pollEvents();\n        }\n        else\n        {\n            Sleep(0);\n        }\n    }\n\n    /* Only work on Desktop\n    *  Director::mainLoop is really one frame logic\n    *  when we want to close the window, we should call Director::end();\n    *  then call Director::mainLoop to do release of internal resources\n    */\n    Director::getInstance()->end();\n    Director::getInstance()->mainLoop();\n    return true;\n}\n\nvoid Application::setAnimationInterval(double interval)\n{\n    LARGE_INTEGER nFreq;\n    QueryPerformanceFrequency(&nFreq);\n    _animationInterval.QuadPart = (LONGLONG)(interval * nFreq.QuadPart);\n}\n\n//////////////////////////////////////////////////////////////////////////\n// static member function\n//////////////////////////////////////////////////////////////////////////\nApplication* Application::getInstance()\n{\n    CC_ASSERT(sm_pSharedApplication);\n    return sm_pSharedApplication;\n}\n\n// @deprecated Use getInstance() instead\nApplication* Application::sharedApplication()\n{\n    return Application::getInstance();\n}\n\nLanguageType Application::getCurrentLanguage()\n{\n    LanguageType ret = LanguageType::ENGLISH;\n\n    LCID localeID = GetUserDefaultLCID();\n    unsigned short primaryLanguageID = localeID & 0xFF;\n    \n    switch (primaryLanguageID)\n    {\n        case LANG_CHINESE:\n            ret = LanguageType::CHINESE;\n            break;\n        case LANG_ENGLISH:\n            ret = LanguageType::ENGLISH;\n            break;\n        case LANG_FRENCH:\n            ret = LanguageType::FRENCH;\n            break;\n        case LANG_ITALIAN:\n            ret = LanguageType::ITALIAN;\n            break;\n        case LANG_GERMAN:\n            ret = LanguageType::GERMAN;\n            break;\n        case LANG_SPANISH:\n            ret = LanguageType::SPANISH;\n            break;\n        case LANG_RUSSIAN:\n            ret = LanguageType::RUSSIAN;\n            break;\n        case LANG_KOREAN:\n            ret = LanguageType::KOREAN;\n            break;\n        case LANG_JAPANESE:\n            ret = LanguageType::JAPANESE;\n            break;\n        case LANG_HUNGARIAN:\n            ret = LanguageType::HUNGARIAN;\n            break;\n        case LANG_PORTUGUESE:\n            ret = LanguageType::PORTUGUESE;\n            break;\n        case LANG_ARABIC:\n            ret = LanguageType::ARABIC;\n            break;\n\t    case LANG_NORWEGIAN:\n            ret = LanguageType::NORWEGIAN;\n            break;\n \t    case LANG_POLISH:\n            ret = LanguageType::POLISH;\n            break;\n    }\n\n    return ret;\n}\n\nApplication::Platform Application::getTargetPlatform()\n{\n    return Platform::OS_WINDOWS;\n}\n\nvoid Application::setResourceRootPath(const std::string& rootResDir)\n{\n    _resourceRootPath = rootResDir;\n    std::replace(_resourceRootPath.begin(), _resourceRootPath.end(), '\\\\', '/');\n    if (_resourceRootPath[_resourceRootPath.length() - 1] != '/')\n    {\n        _resourceRootPath += '/';\n    }\n    FileUtils* pFileUtils = FileUtils::getInstance();\n    std::vector<std::string> searchPaths = pFileUtils->getSearchPaths();\n    searchPaths.insert(searchPaths.begin(), _resourceRootPath);\n    pFileUtils->setSearchPaths(searchPaths);\n}\n\nconst std::string& Application::getResourceRootPath(void)\n{\n    return _resourceRootPath;\n}\n\nvoid Application::setStartupScriptFilename(const std::string& startupScriptFile)\n{\n    _startupScriptFilename = startupScriptFile;\n    std::replace(_startupScriptFilename.begin(), _startupScriptFilename.end(), '\\\\', '/');\n}\n\nNS_CC_END\n\n//////////////////////////////////////////////////////////////////////////\n// Local function\n//////////////////////////////////////////////////////////////////////////\nstatic void PVRFrameEnableControlWindow(bool bEnable)\n{\n    HKEY hKey = 0;\n\n    // Open PVRFrame control key, if not exist create it.\n    if(ERROR_SUCCESS != RegCreateKeyExW(HKEY_CURRENT_USER,\n        L\"Software\\\\Imagination Technologies\\\\PVRVFRame\\\\STARTUP\\\\\",\n        0,\n        0,\n        REG_OPTION_NON_VOLATILE,\n        KEY_ALL_ACCESS,\n        0,\n        &hKey,\n        NULL))\n    {\n        return;\n    }\n\n    const WCHAR* wszValue = L\"hide_gui\";\n    const WCHAR* wszNewData = (bEnable) ? L\"NO\" : L\"YES\";\n    WCHAR wszOldData[256] = {0};\n    DWORD   dwSize = sizeof(wszOldData);\n    LSTATUS status = RegQueryValueExW(hKey, wszValue, 0, NULL, (LPBYTE)wszOldData, &dwSize);\n    if (ERROR_FILE_NOT_FOUND == status              // the key not exist\n        || (ERROR_SUCCESS == status                 // or the hide_gui value is exist\n        && 0 != wcscmp(wszNewData, wszOldData)))    // but new data and old data not equal\n    {\n        dwSize = sizeof(WCHAR) * (wcslen(wszNewData) + 1);\n        RegSetValueEx(hKey, wszValue, 0, REG_SZ, (const BYTE *)wszNewData, dwSize);\n    }\n\n    RegCloseKey(hKey);\n}\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCApplication.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_APPLICATION_WIN32_H__\n#define __CC_APPLICATION_WIN32_H__\n\n#include \"CCStdC.h\"\n#include \"platform/CCCommon.h\"\n#include \"platform/CCApplicationProtocol.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass Rect;\n\nclass CC_DLL Application : public ApplicationProtocol\n{\npublic:\n    /**\n     * @js ctor\n     */\n    Application();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Application();\n\n    /**\n    @brief    Run the message loop.\n    */\n    int run();\n\n    /**\n    @brief    Get current applicaiton instance.\n    @return Current application instance pointer.\n    */\n    static Application* getInstance();\n\n    /** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static Application* sharedApplication();\n    \n    /* override functions */\n    virtual void setAnimationInterval(double interval);\n    virtual LanguageType getCurrentLanguage();\n    \n    /**\n     @brief Get target platform\n     */\n    virtual Platform getTargetPlatform();\n\n    /**\n     *  Sets the Resource root path.\n     *  @deprecated Please use FileUtils::getInstance()->setSearchPaths() instead.\n     */\n    CC_DEPRECATED_ATTRIBUTE void setResourceRootPath(const std::string& rootResDir);\n\n    /** \n     *  Gets the Resource root path.\n     *  @deprecated Please use FileUtils::getInstance()->getSearchPaths() instead. \n     */\n    CC_DEPRECATED_ATTRIBUTE const std::string& getResourceRootPath(void);\n\n    void setStartupScriptFilename(const std::string& startupScriptFile);\n\n    const std::string& getStartupScriptFilename(void)\n    {\n        return _startupScriptFilename;\n    }\n\nprotected:\n    HINSTANCE           _instance;\n    HACCEL              _accelTable;\n    LARGE_INTEGER       _animationInterval;\n    std::string         _resourceRootPath;\n    std::string         _startupScriptFilename;\n\n    static Application * sm_pSharedApplication;\n};\n\nNS_CC_END\n\n#endif    // __CC_APPLICATION_WIN32_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCCommon.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"platform/CCCommon.h\"\n#include \"CCStdC.h\"\n\nNS_CC_BEGIN\n\n#define MAX_LEN         (cocos2d::kMaxLogLen + 1)\n\nvoid MessageBox(const char * pszMsg, const char * pszTitle)\n{\n    MessageBoxA(NULL, pszMsg, pszTitle, MB_OK);\n}\n\nvoid LuaLog(const char *pszMsg)\n{\n    int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, NULL, 0);\n    WCHAR* widebuff = new WCHAR[bufflen + 1];\n    memset(widebuff, 0, sizeof(WCHAR) * (bufflen + 1));\n    MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, widebuff, bufflen);\n\n    OutputDebugStringW(widebuff);\n    OutputDebugStringA(\"\\n\");\n\n\tbufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, NULL, 0, NULL, NULL);\n\tchar* buff = new char[bufflen + 1];\n\tmemset(buff, 0, sizeof(char) * (bufflen + 1));\n\tWideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, NULL, NULL);\n\tputs(buff);\n\n\tdelete[] widebuff;\n\tdelete[] buff;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCDevice.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"platform/CCDevice.h\"\n#include \"CCStdC.h\"\n\nNS_CC_BEGIN\n\nint Device::getDPI()\n{\n    static int dpi = -1;\n    if (dpi == -1)\n    {\n        HDC hScreenDC = GetDC( NULL );\n        int PixelsX = GetDeviceCaps( hScreenDC, HORZRES );\n        int MMX = GetDeviceCaps( hScreenDC, HORZSIZE );\n        ReleaseDC( NULL, hScreenDC );   \n        dpi = 254.0f*PixelsX/MMX/10;\n    }\n    return dpi;\n}\n\nvoid Device::setAccelerometerEnabled(bool isEnabled)\n{}\n\nvoid Device::setAccelerometerInterval(float interval)\n{}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCFileUtilsWin32.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCFileUtilsWin32.h\"\n#include \"platform/CCCommon.h\"\n#include <Shlobj.h>\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n#define CC_MAX_PATH  512\n\n// The root path of resources, the character encoding is UTF-8.\n// UTF-8 is the only encoding supported by cocos2d-x API.\nstatic std::string s_resourcePath = \"\";\n\n// D:\\aaa\\bbb\\ccc\\ddd\\abc.txt --> D:/aaa/bbb/ccc/ddd/abc.txt\nstatic inline std::string convertPathFormatToUnixStyle(const std::string& path)\n{\n    std::string ret = path;\n    int len = ret.length();\n    for (int i = 0; i < len; ++i)\n    {\n        if (ret[i] == '\\\\')\n        {\n            ret[i] = '/';\n        }\n    }\n    return ret;\n}\n\nstatic void _checkPath()\n{\n    if (0 == s_resourcePath.length())\n    {\n        WCHAR utf16Path[CC_MAX_PATH] = {0};\n        GetCurrentDirectoryW(sizeof(utf16Path)-1, utf16Path);\n        \n        char utf8Path[CC_MAX_PATH] = {0};\n        int nNum = WideCharToMultiByte(CP_UTF8, 0, utf16Path, -1, utf8Path, sizeof(utf8Path), NULL, NULL);\n\n        s_resourcePath = convertPathFormatToUnixStyle(utf8Path);\n        s_resourcePath.append(\"/\");\n    }\n}\n\nFileUtils* FileUtils::getInstance()\n{\n    if (s_sharedFileUtils == NULL)\n    {\n        s_sharedFileUtils = new FileUtilsWin32();\n        if(!s_sharedFileUtils->init())\n        {\n          delete s_sharedFileUtils;\n          s_sharedFileUtils = NULL;\n          CCLOG(\"ERROR: Could not init CCFileUtilsWin32\");\n        }\n    }\n    return s_sharedFileUtils;\n}\n\nFileUtilsWin32::FileUtilsWin32()\n{\n}\n\nbool FileUtilsWin32::init()\n{\n    _checkPath();\n    _defaultResRootPath = s_resourcePath;\n    return FileUtils::init();\n}\n\nbool FileUtilsWin32::isFileExist(const std::string& strFilePath) const\n{\n    if (0 == strFilePath.length())\n    {\n        return false;\n    }\n    \n    std::string strPath = strFilePath;\n    if (!isAbsolutePath(strPath))\n    { // Not absolute path, add the default root path at the beginning.\n        strPath.insert(0, _defaultResRootPath);\n    }\n\n    WCHAR utf16Buf[CC_MAX_PATH] = {0};\n    MultiByteToWideChar(CP_UTF8, 0, strPath.c_str(), -1, utf16Buf, sizeof(utf16Buf));\n\n    return GetFileAttributesW(utf16Buf) != -1 ? true : false;\n}\n\nbool FileUtilsWin32::isAbsolutePath(const std::string& strPath) const\n{\n    if (   strPath.length() > 2 \n        && ( (strPath[0] >= 'a' && strPath[0] <= 'z') || (strPath[0] >= 'A' && strPath[0] <= 'Z') )\n        && strPath[1] == ':')\n    {\n        return true;\n    }\n    return false;\n}\n\nstatic Data getData(const std::string& filename, bool forString)\n{\n    unsigned char *buffer = nullptr;\n    CCASSERT(!filename.empty(), \"Invalid parameters.\");\n    size_t size = 0;\n    do\n    {\n        // read the file from hardware\n        std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filename);\n\n        WCHAR wszBuf[CC_MAX_PATH] = {0};\n        MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf));\n\n        HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, NULL);\n        CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE);\n        \n        size = ::GetFileSize(fileHandle, NULL);\n\n        if (forString)\n        {\n            buffer = (unsigned char*) malloc(size + 1);\n            buffer[size] = '\\0';\n        }\n        else\n        {\n            buffer = (unsigned char*) malloc(size);\n        }\n        DWORD sizeRead = 0;\n        BOOL successed = FALSE;\n        successed = ::ReadFile(fileHandle, buffer, size, &sizeRead, NULL);\n        ::CloseHandle(fileHandle);\n\n        if (!successed)\n        {\n            free(buffer);\n            buffer = nullptr;\n        }\n    } while (0);\n    \n    Data ret;\n\n    if (buffer == nullptr || size == 0)\n    {\n        std::string msg = \"Get data from file(\";\n        // Gets error code.\n        DWORD errorCode = ::GetLastError();\n        char errorCodeBuffer[20] = {0};\n        snprintf(errorCodeBuffer, sizeof(errorCodeBuffer), \"%d\", errorCode);\n\n        msg = msg + filename + \") failed, error code is \" + errorCodeBuffer;\n        CCLOG(\"%s\", msg.c_str());\n    }\n    else\n    {\n        ret.fastSet(buffer, size);\n    }\n    return ret;\n}\n\nstd::string FileUtilsWin32::getStringFromFile(const std::string& filename)\n{\n    Data data = getData(filename, true);\n    std::string ret((const char*)data.getBytes());\n    return ret;\n}\n    \nData FileUtilsWin32::getDataFromFile(const std::string& filename)\n{\n    return getData(filename, false);\n}\n\nunsigned char* FileUtilsWin32::getFileData(const std::string& filename, const char* mode, ssize_t* size)\n{\n    unsigned char * pBuffer = NULL;\n    *size = 0;\n    do\n    {\n        // read the file from hardware\n        std::string fullPath = fullPathForFilename(filename);\n\n        WCHAR wszBuf[CC_MAX_PATH] = {0};\n        MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf));\n\n        HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, NULL);\n        CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE);\n        \n        *size = ::GetFileSize(fileHandle, NULL);\n\n        pBuffer = (unsigned char*) malloc(*size);\n        DWORD sizeRead = 0;\n        BOOL successed = FALSE;\n        successed = ::ReadFile(fileHandle, pBuffer, *size, &sizeRead, NULL);\n        ::CloseHandle(fileHandle);\n\n        if (!successed)\n        {\n            free(pBuffer);\n            pBuffer = nullptr;\n        }\n    } while (0);\n    \n    if (! pBuffer)\n    {\n        std::string msg = \"Get data from file(\";\n        // Gets error code.\n        DWORD errorCode = ::GetLastError();\n        char errorCodeBuffer[20] = {0};\n        snprintf(errorCodeBuffer, sizeof(errorCodeBuffer), \"%d\", errorCode);\n\n        msg = msg + filename + \") failed, error code is \" + errorCodeBuffer;\n        CCLOG(\"%s\", msg.c_str());\n    }\n    return pBuffer;\n}\n\nstd::string FileUtilsWin32::getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath)\n{\n    std::string unixFileName = convertPathFormatToUnixStyle(filename);\n    std::string unixResolutionDirectory = convertPathFormatToUnixStyle(resolutionDirectory);\n    std::string unixSearchPath = convertPathFormatToUnixStyle(searchPath);\n\n    return FileUtils::getPathForFilename(unixFileName, unixResolutionDirectory, unixSearchPath);\n}\n\nstd::string FileUtilsWin32::getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename)\n{\n    std::string unixDirectory = convertPathFormatToUnixStyle(strDirectory);\n    std::string unixFilename = convertPathFormatToUnixStyle(strFilename);\n    \n    return FileUtils::getFullPathForDirectoryAndFilename(unixDirectory, unixFilename);\n}\n\nstring FileUtilsWin32::getWritablePath() const\n{\n    // Get full path of executable, e.g. c:\\Program Files (x86)\\My Game Folder\\MyGame.exe\n    char full_path[CC_MAX_PATH + 1];\n    ::GetModuleFileNameA(NULL, full_path, CC_MAX_PATH + 1);\n\n    // Debug app uses executable directory; Non-debug app uses local app data directory\n#ifndef _DEBUG\n        // Get filename of executable only, e.g. MyGame.exe\n        char *base_name = strrchr(full_path, '\\\\');\n\n        if(base_name)\n        {\n            char app_data_path[CC_MAX_PATH + 1];\n\n            // Get local app data directory, e.g. C:\\Documents and Settings\\username\\Local Settings\\Application Data\n            if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, app_data_path)))\n            {\n                string ret((char*)app_data_path);\n\n                // Adding executable filename, e.g. C:\\Documents and Settings\\username\\Local Settings\\Application Data\\MyGame.exe\n                ret += base_name;\n\n                // Remove \".exe\" extension, e.g. C:\\Documents and Settings\\username\\Local Settings\\Application Data\\MyGame\n                ret = ret.substr(0, ret.rfind(\".\"));\n\n                ret += \"\\\\\";\n\n                // Create directory\n                if (SUCCEEDED(SHCreateDirectoryExA(NULL, ret.c_str(), NULL)))\n                {\n                    return ret;\n                }\n            }\n        }\n#endif // not defined _DEBUG\n\n    // If fetching of local app data directory fails, use the executable one\n    string ret((char*)full_path);\n\n    // remove xxx.exe\n    ret =  ret.substr(0, ret.rfind(\"\\\\\") + 1);\n\n    ret = convertPathFormatToUnixStyle(ret);\n\n    return ret;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCFileUtilsWin32.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CC_FILEUTILS_WIN32_H__\n#define __CC_FILEUTILS_WIN32_H__\n\n#include \"platform/CCFileUtils.h\"\n#include \"CCPlatformMacros.h\"\n#include \"ccTypes.h\"\n#include <string>\n#include <vector>\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup platform\n * @{\n */\n\n//! @brief  Helper class to handle file operations\nclass CC_DLL FileUtilsWin32 : public FileUtils\n{\n    friend class FileUtils;\n    FileUtilsWin32();\npublic:\n    /* override funtions */\n    bool init();\n    virtual std::string getWritablePath() const;\n    virtual bool isFileExist(const std::string& strFilePath) const;\n    virtual bool isAbsolutePath(const std::string& strPath) const;\nprotected:\n    /**\n     *  Gets resource file data\n     *\n     *  @param[in]  filename    The resource file name which contains the path.\n     *  @param[in]  mode        The read mode of the file.\n     *  @param[out] size        If the file read operation succeeds, it will be the data size, otherwise 0.\n     *  @return Upon success, a pointer to the data is returned, otherwise NULL.\n     *  @warning Recall: you are responsible for calling delete[] on any Non-NULL pointer returned.\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual unsigned char* getFileData(const std::string& filename, const char* mode, ssize_t * size) override;\n\n    /**\n     *  Gets string from a file.\n     */\n    virtual std::string getStringFromFile(const std::string& filename) override;\n    \n    /**\n     *  Creates binary data from a file.\n     *  @return A data object.\n     */\n    virtual Data getDataFromFile(const std::string& filename) override;\n\n    /**\n     *  Gets full path for filename, resolution directory and search path.\n     *\n     *  @param filename The file name.\n     *  @param resolutionDirectory The resolution directory.\n     *  @param searchPath The search path.\n     *  @return The full path of the file. It will return an empty string if the full path of the file doesn't exist.\n     */\n    virtual std::string getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath) override;\n\n    /**\n     *  Gets full path for the directory and the filename.\n     *\n     *  @note Only iOS and Mac need to override this method since they are using\n     *        `[[NSBundle mainBundle] pathForResource: ofType: inDirectory:]` to make a full path.\n     *        Other platforms will use the default implementation of this method.\n     *  @param directory The directory contains the file we are looking for.\n     *  @param filename  The name of the file.\n     *  @return The full path of the file, if the file can't be found, it will return an empty string.\n     */\n    virtual std::string getFullPathForDirectoryAndFilename(const std::string& directory, const std::string& filename) override;\n\n};\n\n// end of platform group\n/// @}\n\nNS_CC_END\n\n#endif    // __CC_FILEUTILS_WIN32_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCGL.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCGL_H__\n#define __CCGL_H__\n\n#include \"GL/glew.h\"\n\n#define CC_GL_DEPTH24_STENCIL8\t\tGL_DEPTH24_STENCIL8\n\n// These macros are only for making TexturePVR.cpp complied without errors since they are not included in GLEW.\n#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG                      0x8C00\n#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG                      0x8C01\n#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG                     0x8C02\n#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG                     0x8C03\n\n#endif // __CCGL_H__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCImage.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#define __CC_PLATFORM_IMAGE_CPP__\n#if _MSC_VER\n#include <cctype>\n#endif\n#include \"platform/CCImageCommon_cpp.h\"\n\nNS_CC_BEGIN\n\n/**\n@brief    A memory DC which uses to draw text on bitmap.\n*/\nclass BitmapDC\n{\npublic:\n    BitmapDC(HWND hWnd = NULL)\n    : _DC(NULL)\n    , _bmp(NULL)\n    , _font((HFONT)GetStockObject(DEFAULT_GUI_FONT))\n    , _wnd(NULL)\n    {\n        _wnd = hWnd;\n        HDC hdc = GetDC(hWnd);\n        _DC   = CreateCompatibleDC(hdc);\n        ReleaseDC(hWnd, hdc);\n    }\n\n    ~BitmapDC()\n    {\n        prepareBitmap(0, 0);\n        if (_DC)\n        {\n            DeleteDC(_DC);\n        }\n        HFONT hDefFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);\n        if (hDefFont != _font)\n        {\n            DeleteObject(_font);\n            _font = hDefFont;\n        }\n\t\t// release temp font resource\t\n\t\tif (_curFontPath.size() > 0)\n\t\t{\n\t\t\twchar_t * pwszBuffer = utf8ToUtf16(_curFontPath);\n\t\t\tif (pwszBuffer)\n\t\t\t{\n\t\t\t\tRemoveFontResource(pwszBuffer);\n\t\t\t\tSendMessage( _wnd, WM_FONTCHANGE, 0, 0);\n\t\t\t\tdelete [] pwszBuffer;\n\t\t\t\tpwszBuffer = NULL;\n\t\t\t}\n\t\t}\n    }\n\n\twchar_t * utf8ToUtf16(std::string nString)\n\t{\n\t\twchar_t * pwszBuffer = NULL;\n\t\tdo \n\t\t{\n\t\t\tif (nString.size() < 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// utf-8 to utf-16\n\t\t\tint nLen = nString.size();\n\t\t\tint nBufLen  = nLen + 1;\t\t\t\n\t\t\tpwszBuffer = new wchar_t[nBufLen];\n\t\t\tCC_BREAK_IF(! pwszBuffer);\n\t\t\tmemset(pwszBuffer,0,nBufLen);\n\t\t\tnLen = MultiByteToWideChar(CP_UTF8, 0, nString.c_str(), nLen, pwszBuffer, nBufLen);\t\t\n\t\t\tpwszBuffer[nLen] = '\\0';\n\t\t} while (0);\t\n\t\treturn pwszBuffer;\n\n\t}\n\n    bool setFont(const char * pFontName = NULL, int nSize = 0)\n    {\n        bool bRet = false;\n        do \n        {\n            std::string fontName = pFontName;\n            std::string fontPath;\n            HFONT       hDefFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);\n            LOGFONTA    tNewFont = {0};\n            LOGFONTA    tOldFont = {0};\n            GetObjectA(hDefFont, sizeof(tNewFont), &tNewFont);\n            if (fontName.c_str())\n            {    \n                // create font from ttf file\n                int nFindttf = fontName.find(\".ttf\");\n                int nFindTTF = fontName.find(\".TTF\");\n                if (nFindttf >= 0 || nFindTTF >= 0)\n                {\n                    fontPath = FileUtils::getInstance()->fullPathForFilename(fontName.c_str());\n                    int nFindPos = fontName.rfind(\"/\");\n                    fontName = &fontName[nFindPos+1];\n                    nFindPos = fontName.rfind(\".\");\n                    fontName = fontName.substr(0,nFindPos);                \n                }\n                tNewFont.lfCharSet = DEFAULT_CHARSET;\n                strcpy_s(tNewFont.lfFaceName, LF_FACESIZE, fontName.c_str());\n            }\n            if (nSize)\n            {\n                tNewFont.lfHeight = -nSize;\n            }\n            GetObjectA(_font,  sizeof(tOldFont), &tOldFont);\n\n            if (tOldFont.lfHeight == tNewFont.lfHeight\n                && 0 == strcmp(tOldFont.lfFaceName, tNewFont.lfFaceName))\n            {\n                // already has the font \n                bRet = true;\n                break;\n            }\n\n            // delete old font\n            if (_font != hDefFont)\n            {\n                DeleteObject(_font);\n\t\t\t\t// release old font register\n\t\t\t\tif (_curFontPath.size() > 0)\n\t\t\t\t{\n\t\t\t\t\twchar_t * pwszBuffer = utf8ToUtf16(_curFontPath);\n\t\t\t\t\tif (pwszBuffer)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(RemoveFontResource(pwszBuffer))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSendMessage( _wnd, WM_FONTCHANGE, 0, 0);\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tdelete [] pwszBuffer;\n\t\t\t\t\t\tpwszBuffer = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (fontPath.size() > 0)\n\t\t\t\t\t_curFontPath = fontPath;\n\t\t\t\telse\n\t\t\t\t\t_curFontPath.clear();\n\t\t\t\t// register temp font\n\t\t\t\tif (_curFontPath.size() > 0)\n\t\t\t\t{\n\t\t\t\t\twchar_t * pwszBuffer = utf8ToUtf16(_curFontPath);\n\t\t\t\t\tif (pwszBuffer)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(AddFontResource(pwszBuffer))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSendMessage( _wnd, WM_FONTCHANGE, 0, 0);\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tdelete [] pwszBuffer;\n\t\t\t\t\t\tpwszBuffer = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n            }\n            _font = NULL;\n\n            // disable Cleartype\n            tNewFont.lfQuality = ANTIALIASED_QUALITY;\n\n            // create new font\n            _font = CreateFontIndirectA(&tNewFont);\n            if (! _font)\n            {\n                // create failed, use default font\n                _font = hDefFont;\n                break;\n            }\n            \n            bRet = true;\n        } while (0);\n        return bRet;\n    }\n\n    SIZE sizeWithText(const wchar_t * pszText, int nLen, DWORD dwFmt, LONG nWidthLimit)\n    {\n        SIZE tRet = {0};\n        do \n        {\n            CC_BREAK_IF(! pszText || nLen <= 0);\n\n            RECT rc = {0, 0, 0, 0};\n            DWORD dwCalcFmt = DT_CALCRECT;\n\n            if (nWidthLimit > 0)\n            {\n                rc.right = nWidthLimit;\n                dwCalcFmt |= DT_WORDBREAK\n                    | (dwFmt & DT_CENTER)\n                    | (dwFmt & DT_RIGHT);\n            }\n            // use current font to measure text extent\n            HGDIOBJ hOld = SelectObject(_DC, _font);\n\n            // measure text size\n            DrawTextW(_DC, pszText, nLen, &rc, dwCalcFmt);\n            SelectObject(_DC, hOld);\n\n            tRet.cx = rc.right;\n            tRet.cy = rc.bottom;\n        } while (0);\n\n        return tRet;\n    }\n\n    bool prepareBitmap(int nWidth, int nHeight)\n    {\n        // release bitmap\n        if (_bmp)\n        {\n            DeleteObject(_bmp);\n            _bmp = NULL;\n        }\n        if (nWidth > 0 && nHeight > 0)\n        {\n            _bmp = CreateBitmap(nWidth, nHeight, 1, 32, NULL);\n            if (! _bmp)\n            {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    int drawText(const char * pszText, SIZE& tSize, Image::TextAlign eAlign)\n    {\n        int nRet = 0;\n        wchar_t * pwszBuffer = 0;\n        do \n        {\n            CC_BREAK_IF(! pszText);\n\n            DWORD dwFmt = DT_WORDBREAK;\n            DWORD dwHoriFlag = (int)eAlign & 0x0f;\n            DWORD dwVertFlag = ((int)eAlign & 0xf0) >> 4;\n\n            switch (dwHoriFlag)\n            {\n            case 1: // left\n                dwFmt |= DT_LEFT;\n                break;\n            case 2: // right\n                dwFmt |= DT_RIGHT;\n                break;\n            case 3: // center\n                dwFmt |= DT_CENTER;\n                break;\n            }\n\n            int nLen = strlen(pszText);\n            // utf-8 to utf-16\n            int nBufLen  = nLen + 1;\n            pwszBuffer = new wchar_t[nBufLen];\n            CC_BREAK_IF(! pwszBuffer);\n\n            memset(pwszBuffer, 0, sizeof(wchar_t)*nBufLen);\n            nLen = MultiByteToWideChar(CP_UTF8, 0, pszText, nLen, pwszBuffer, nBufLen);\n\n            SIZE newSize = sizeWithText(pwszBuffer, nLen, dwFmt, tSize.cx);\n\n            RECT rcText = {0};\n            // if content width is 0, use text size as content size\n            if (tSize.cx <= 0)\n            {\n                tSize = newSize;\n                rcText.right  = newSize.cx;\n                rcText.bottom = newSize.cy;\n            }\n            else\n            {\n\n                LONG offsetX = 0;\n                LONG offsetY = 0;\n                rcText.right = newSize.cx; // store the text width to rectangle\n\n                // calculate text horizontal offset\n                if (1 != dwHoriFlag          // and text isn't align to left\n                    && newSize.cx < tSize.cx)   // and text's width less then content width,\n                {                               // then need adjust offset of X.\n                    offsetX = (2 == dwHoriFlag) ? tSize.cx - newSize.cx     // align to right\n                        : (tSize.cx - newSize.cx) / 2;                      // align to center\n                }\n\n                // if content height is 0, use text height as content height\n                // else if content height less than text height, use content height to draw text\n                if (tSize.cy <= 0)\n                {\n                    tSize.cy = newSize.cy;\n                    dwFmt   |= DT_NOCLIP;\n                    rcText.bottom = newSize.cy; // store the text height to rectangle\n                }\n                else if (tSize.cy < newSize.cy)\n                {\n                    // content height larger than text height need, clip text to rect\n                    rcText.bottom = tSize.cy;\n                }\n                else\n                {\n                    rcText.bottom = newSize.cy; // store the text height to rectangle\n\n                    // content larger than text, need adjust vertical position\n                    dwFmt |= DT_NOCLIP;\n\n                    // calculate text vertical offset\n                    offsetY = (2 == dwVertFlag) ? tSize.cy - newSize.cy     // align to bottom\n                        : (3 == dwVertFlag) ? (tSize.cy - newSize.cy) / 2   // align to middle\n                        : 0;                                                // align to top\n                }\n\n                if (offsetX || offsetY)\n                {\n                    OffsetRect(&rcText, offsetX, offsetY);\n                }\n            }\n\n            CC_BREAK_IF(! prepareBitmap(tSize.cx, tSize.cy));\n\n            // draw text\n            HGDIOBJ hOldFont = SelectObject(_DC, _font);\n            HGDIOBJ hOldBmp  = SelectObject(_DC, _bmp);\n            \n            SetBkMode(_DC, TRANSPARENT);\n            SetTextColor(_DC, RGB(255, 255, 255)); // white color\n\n            // draw text\n            nRet = DrawTextW(_DC, pwszBuffer, nLen, &rcText, dwFmt);\n            //DrawTextA(_DC, pszText, nLen, &rcText, dwFmt);\n\n            SelectObject(_DC, hOldBmp);\n            SelectObject(_DC, hOldFont);\n        } while (0);\n        CC_SAFE_DELETE_ARRAY(pwszBuffer);\n        return nRet;\n    }\n\n    CC_SYNTHESIZE_READONLY(HDC, _DC, DC);\n    CC_SYNTHESIZE_READONLY(HBITMAP, _bmp, Bitmap);\nprivate:\n    friend class Image;\n    HFONT   _font;\n    HWND    _wnd;\n    std::string _curFontPath;\n};\n\nstatic BitmapDC& sharedBitmapDC()\n{\n    static BitmapDC s_BmpDC;\n    return s_BmpDC;\n}\n\nbool Image::initWithString(\n                               const char *    pText, \n                               int             nWidth/* = 0*/, \n                               int             nHeight/* = 0*/,\n                               TextAlign       eAlignMask/* = kAlignCenter*/,\n                               const char *    pFontName/* = nil*/,\n                               int             nSize/* = 0*/)\n{\n    bool bRet = false;\n    do \n    {\n        CC_BREAK_IF(! pText);       \n\n        BitmapDC& dc = sharedBitmapDC();\n\n        if (! dc.setFont(pFontName, nSize))\n        {\n            log(\"Can't found font(%s), use system default\", pFontName);\n        }\n\n        // draw text\n        SIZE size = {nWidth, nHeight};\n        CC_BREAK_IF(! dc.drawText(pText, size, eAlignMask));\n\n        _dataLen = size.cx * size.cy * 4;\n        _data = new unsigned char[_dataLen];\n        CC_BREAK_IF(! _data);\n\n        struct\n        {\n            BITMAPINFOHEADER bmiHeader;\n            int mask[4];\n        } bi = {0};\n        bi.bmiHeader.biSize = sizeof(bi.bmiHeader);\n        CC_BREAK_IF(! GetDIBits(dc.getDC(), dc.getBitmap(), 0, 0, \n            NULL, (LPBITMAPINFO)&bi, DIB_RGB_COLORS));\n\n        _width    = (short)size.cx;\n        _height   = (short)size.cy;\n        _preMulti = false;\n        _renderFormat = Texture2D::PixelFormat::RGBA8888;\n        // copy pixed data\n        bi.bmiHeader.biHeight = (bi.bmiHeader.biHeight > 0)\n           ? - bi.bmiHeader.biHeight : bi.bmiHeader.biHeight;\n        GetDIBits(dc.getDC(), dc.getBitmap(), 0, _height, _data, \n            (LPBITMAPINFO)&bi, DIB_RGB_COLORS);\n\n        // change pixel's alpha value to 255, when it's RGB != 0\n        COLORREF * pPixel = NULL;\n        for (int y = 0; y < _height; ++y)\n        {\n            pPixel = (COLORREF *)_data + y * _width;\n            for (int x = 0; x < _width; ++x)\n            {\n                COLORREF& clr = *pPixel;\n                if (GetRValue(clr) || GetGValue(clr) || GetBValue(clr))\n                {\n                    clr |= 0xff000000;\n                }\n                ++pPixel;\n            }\n        }\n\n        bRet = true;\n    } while (0);\n\n    return bRet;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCPlatformDefine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCPLATFORMDEFINE_H__\n#define __CCPLATFORMDEFINE_H__\n\n#ifdef __MINGW32__\n#include <string.h>\n#endif\n\n//#if defined(_USRDLL)\n//    #define CC_DLL     __declspec(dllexport)\n//#else         /* use a DLL library */\n//    #define CC_DLL     __declspec(dllimport)\n//#endif\n\n#define CC_DLL\n\n#include <assert.h>\n\n#if CC_DISABLE_ASSERT > 0\n#define CC_ASSERT(cond)\n#else\n#define CC_ASSERT(cond)    assert(cond)\n#endif\n#define CC_UNUSED_PARAM(unusedparam) (void)unusedparam\n\n/* Define NULL pointer value */\n#ifndef NULL\n#ifdef __cplusplus\n#define NULL    0\n#else\n#define NULL    ((void *)0)\n#endif\n#endif\n\n\n\n#endif /* __CCPLATFORMDEFINE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCStdC.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCStdC.h\"\n\n#ifndef __MINGW32__\n\nNS_CC_BEGIN\n\nint gettimeofday(struct timeval * val, struct timezone *)\n{\n    if (val)\n    {\n        LARGE_INTEGER liTime, liFreq;\n        QueryPerformanceFrequency( &liFreq );\n        QueryPerformanceCounter( &liTime );\n        val->tv_sec     = (long)( liTime.QuadPart / liFreq.QuadPart );\n        val->tv_usec    = (long)( liTime.QuadPart * 1000000.0 / liFreq.QuadPart - val->tv_sec * 1000000.0 );\n    }\n    return 0;\n}\n\nNS_CC_END\n\n#endif // __MINGW32__\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/CCStdC.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_STD_C_H__\n#define __CC_STD_C_H__\n\n//typedef SSIZE_T ssize_t;\n// ssize_t was redefined as int in libwebsockets.h.\n// Therefore, to avoid conflict, we needs the same definition.\ntypedef int ssize_t;\n\n#include \"CCPlatformMacros.h\"\n#include <float.h>\n\n// for math.h on win32 platform\n#ifndef __MINGW32__\n\n#if !defined(_USE_MATH_DEFINES)\n    #define _USE_MATH_DEFINES       // make M_PI can be use\n#endif\n\n#if !defined(isnan)\n    #define isnan   _isnan\n#endif\n\n#ifndef snprintf\n#define snprintf _snprintf\n#endif\n\n#endif // __MINGW32__\n\n#include <math.h>\n#include <string.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\n#ifndef M_PI\n  #define M_PI      3.14159265358\n#endif\n#ifndef M_PI_2\n  #define M_PI_2    1.57079632679\n#endif\n// for MIN MAX and sys/time.h on win32 platform\n#ifdef __MINGW32__\n#include <sys/time.h>\n#endif // __MINGW32__\n\n#ifndef MIN\n#define MIN(x,y) (((x) > (y)) ? (y) : (x))\n#endif  // MIN\n\n#ifndef MAX\n#define MAX(x,y) (((x) < (y)) ? (y) : (x))\n#endif  // MAX\n\n\n#if _MSC_VER >= 1600 || defined(__MINGW32__)\n    #include <stdint.h>\n#else\n    #include \"./compat/stdint.h\"\n#endif\n\n#define _WINSOCKAPI_\n#ifndef NOMINMAX\n  #define NOMINMAX\n#endif\n// Structure timeval has define in winsock.h, include windows.h for it.\n#include <Windows.h>\n\n#ifndef __MINGW32__\n\n#include <WinSock2.h>\n\nNS_CC_BEGIN\n\nstruct timezone\n{\n    int tz_minuteswest;\n    int tz_dsttime;\n};\n\nint CC_DLL gettimeofday(struct timeval *, struct timezone *);\n\nNS_CC_END\n\n#else\n\n#undef _WINSOCKAPI_\n#include <winsock2.h>\n\n// Conflicted with math.h isnan\n#include <cmath>\nusing std::isnan;\n\ninline int vsnprintf_s(char *buffer, size_t sizeOfBuffer, size_t count,\n                 const char *format, va_list argptr) {\n  return vsnprintf(buffer, sizeOfBuffer, format, argptr);\n}\ninline errno_t strcpy_s(char *strDestination, size_t numberOfElements,\n        const char *strSource) {\n    strcpy(strDestination, strSource);\n    return 0;\n}\n\n#endif // __MINGW32__\n\n// Conflicted with cocos2d::MessageBox, so we need to undef it.\n#ifdef MessageBox\n#undef MessageBox\n#endif\n\n// Conflicted with ParticleSystem::PositionType::RELATIVE, so we need to undef it.\n#ifdef RELATIVE\n#undef RELATIVE\n#endif\n\n// Conflicted with CCBReader::SizeType::RELATIVE and CCBReader::ScaleType::RELATIVE, so we need to undef it.\n#ifdef ABSOLUTE\n#undef ABSOLUTE\n#endif\n\n// Conflicted with HttpRequest::Type::DELETE, so we need to undef it.\n#ifdef DELETE\n#undef DELETE\n#endif\n\n#undef min\n#undef max\n\n#endif  // __CC_STD_C_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/2d/platform/win32/compat/stdint.h",
    "content": "// ISO C9x  compliant stdint.h for Microsoft Visual Studio\n// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124\n//\n//  Copyright (c) 2006-2008 Alexander Chemeris\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n//   1. Redistributions of source code must retain the above copyright notice,\n//      this list of conditions and the following disclaimer.\n//\n//   2. Redistributions in binary form must reproduce the above copyright\n//      notice, this list of conditions and the following disclaimer in the\n//      documentation and/or other materials provided with the distribution.\n//\n//   3. The name of the author may be used to endorse or promote products\n//      derived from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n///////////////////////////////////////////////////////////////////////////////\n\n#ifndef _MSC_VER // [\n#error \"Use this header only with Microsoft Visual C++ compilers!\"\n#endif // _MSC_VER ]\n\n#ifndef _MSC_STDINT_H_ // [\n#define _MSC_STDINT_H_\n\n#if _MSC_VER > 1000\n#pragma once\n#endif\n\n#include <limits.h>\n\n// For Visual Studio 6 in C++ mode and for many Visual Studio versions when\n// compiling for ARM we should wrap <wchar.h> include with 'extern \"C++\" {}'\n// or compiler give many errors like this:\n//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#  include <wchar.h>\n#ifdef __cplusplus\n}\n#endif\n\n// Define _W64 macros to mark types changing their size, like intptr_t.\n#ifndef _W64\n#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300\n#     define _W64 __w64\n#  else\n#     define _W64\n#  endif\n#endif\n\n\n// 7.18.1 Integer types\n\n// 7.18.1.1 Exact-width integer types\n\n// Visual Studio 6 and Embedded Visual C++ 4 doesn't\n// realize that, e.g. char has the same size as __int8\n// so we give up on __intX for them.\n#if (_MSC_VER < 1300)\n   typedef signed char       int8_t;\n   typedef signed short      int16_t;\n   typedef signed int        int32_t;\n   typedef unsigned char     uint8_t;\n   typedef unsigned short    uint16_t;\n   typedef unsigned int      uint32_t;\n#else\n   typedef signed __int8     int8_t;\n   typedef signed __int16    int16_t;\n   typedef signed __int32    int32_t;\n   typedef unsigned __int8   uint8_t;\n   typedef unsigned __int16  uint16_t;\n   typedef unsigned __int32  uint32_t;\n#endif\ntypedef signed __int64       int64_t;\ntypedef unsigned __int64     uint64_t;\n\n\n// 7.18.1.2 Minimum-width integer types\ntypedef int8_t    int_least8_t;\ntypedef int16_t   int_least16_t;\ntypedef int32_t   int_least32_t;\ntypedef int64_t   int_least64_t;\ntypedef uint8_t   uint_least8_t;\ntypedef uint16_t  uint_least16_t;\ntypedef uint32_t  uint_least32_t;\ntypedef uint64_t  uint_least64_t;\n\n// 7.18.1.3 Fastest minimum-width integer types\ntypedef int8_t    int_fast8_t;\ntypedef int16_t   int_fast16_t;\ntypedef int32_t   int_fast32_t;\ntypedef int64_t   int_fast64_t;\ntypedef uint8_t   uint_fast8_t;\ntypedef uint16_t  uint_fast16_t;\ntypedef uint32_t  uint_fast32_t;\ntypedef uint64_t  uint_fast64_t;\n\n// 7.18.1.4 Integer types capable of holding object pointers\n#ifdef _WIN64 // [\n   typedef signed __int64    intptr_t;\n   typedef unsigned __int64  uintptr_t;\n#else // _WIN64 ][\n   typedef _W64 signed int   intptr_t;\n   typedef _W64 unsigned int uintptr_t;\n#endif // _WIN64 ]\n\n// 7.18.1.5 Greatest-width integer types\ntypedef int64_t   intmax_t;\ntypedef uint64_t  uintmax_t;\n\n\n// 7.18.2 Limits of specified-width integer types\n\n#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259\n\n// 7.18.2.1 Limits of exact-width integer types\n#define INT8_MIN     ((int8_t)_I8_MIN)\n#define INT8_MAX     _I8_MAX\n#define INT16_MIN    ((int16_t)_I16_MIN)\n#define INT16_MAX    _I16_MAX\n#define INT32_MIN    ((int32_t)_I32_MIN)\n#define INT32_MAX    _I32_MAX\n#define INT64_MIN    ((int64_t)_I64_MIN)\n#define INT64_MAX    _I64_MAX\n#define UINT8_MAX    _UI8_MAX\n#define UINT16_MAX   _UI16_MAX\n#define UINT32_MAX   _UI32_MAX\n#define UINT64_MAX   _UI64_MAX\n\n// 7.18.2.2 Limits of minimum-width integer types\n#define INT_LEAST8_MIN    INT8_MIN\n#define INT_LEAST8_MAX    INT8_MAX\n#define INT_LEAST16_MIN   INT16_MIN\n#define INT_LEAST16_MAX   INT16_MAX\n#define INT_LEAST32_MIN   INT32_MIN\n#define INT_LEAST32_MAX   INT32_MAX\n#define INT_LEAST64_MIN   INT64_MIN\n#define INT_LEAST64_MAX   INT64_MAX\n#define UINT_LEAST8_MAX   UINT8_MAX\n#define UINT_LEAST16_MAX  UINT16_MAX\n#define UINT_LEAST32_MAX  UINT32_MAX\n#define UINT_LEAST64_MAX  UINT64_MAX\n\n// 7.18.2.3 Limits of fastest minimum-width integer types\n#define INT_FAST8_MIN    INT8_MIN\n#define INT_FAST8_MAX    INT8_MAX\n#define INT_FAST16_MIN   INT16_MIN\n#define INT_FAST16_MAX   INT16_MAX\n#define INT_FAST32_MIN   INT32_MIN\n#define INT_FAST32_MAX   INT32_MAX\n#define INT_FAST64_MIN   INT64_MIN\n#define INT_FAST64_MAX   INT64_MAX\n#define UINT_FAST8_MAX   UINT8_MAX\n#define UINT_FAST16_MAX  UINT16_MAX\n#define UINT_FAST32_MAX  UINT32_MAX\n#define UINT_FAST64_MAX  UINT64_MAX\n\n// 7.18.2.4 Limits of integer types capable of holding object pointers\n#ifdef _WIN64 // [\n#  define INTPTR_MIN   INT64_MIN\n#  define INTPTR_MAX   INT64_MAX\n#  define UINTPTR_MAX  UINT64_MAX\n#else // _WIN64 ][\n#  define INTPTR_MIN   INT32_MIN\n#  define INTPTR_MAX   INT32_MAX\n#  define UINTPTR_MAX  UINT32_MAX\n#endif // _WIN64 ]\n\n// 7.18.2.5 Limits of greatest-width integer types\n#define INTMAX_MIN   INT64_MIN\n#define INTMAX_MAX   INT64_MAX\n#define UINTMAX_MAX  UINT64_MAX\n\n// 7.18.3 Limits of other integer types\n\n#ifdef _WIN64 // [\n#  define PTRDIFF_MIN  _I64_MIN\n#  define PTRDIFF_MAX  _I64_MAX\n#else  // _WIN64 ][\n#  define PTRDIFF_MIN  _I32_MIN\n#  define PTRDIFF_MAX  _I32_MAX\n#endif  // _WIN64 ]\n\n#define SIG_ATOMIC_MIN  INT_MIN\n#define SIG_ATOMIC_MAX  INT_MAX\n\n#ifndef SIZE_MAX // [\n#  ifdef _WIN64 // [\n#     define SIZE_MAX  _UI64_MAX\n#  else // _WIN64 ][\n#     define SIZE_MAX  _UI32_MAX\n#  endif // _WIN64 ]\n#endif // SIZE_MAX ]\n\n// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>\n#ifndef WCHAR_MIN // [\n#  define WCHAR_MIN  0\n#endif  // WCHAR_MIN ]\n#ifndef WCHAR_MAX // [\n#  define WCHAR_MAX  _UI16_MAX\n#endif  // WCHAR_MAX ]\n\n#define WINT_MIN  0\n#define WINT_MAX  _UI16_MAX\n\n#endif // __STDC_LIMIT_MACROS ]\n\n\n// 7.18.4 Limits of other integer types\n\n#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260\n\n// 7.18.4.1 Macros for minimum-width integer constants\n\n#define INT8_C(val)  val##i8\n#define INT16_C(val) val##i16\n#define INT32_C(val) val##i32\n#define INT64_C(val) val##i64\n\n#define UINT8_C(val)  val##ui8\n#define UINT16_C(val) val##ui16\n#define UINT32_C(val) val##ui32\n#define UINT64_C(val) val##ui64\n\n// 7.18.4.2 Macros for greatest-width integer constants\n#define INTMAX_C   INT64_C\n#define UINTMAX_C  UINT64_C\n\n#endif // __STDC_CONSTANT_MACROS ]\n\n\n#endif // _MSC_STDINT_H_ ]\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCBatchCommand.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#include \"renderer/CCBatchCommand.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCTextureAtlas.h\"\n#include \"CCTexture2D.h\"\n\nNS_CC_BEGIN\n\nBatchCommand::BatchCommand()\n: _textureID(0)\n, _blendType(BlendFunc::DISABLE)\n, _textureAtlas(nullptr)\n{\n    _type = RenderCommand::Type::BATCH_COMMAND;\n    _shader = nullptr;\n}\n\nvoid BatchCommand::init(float globalOrder, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const kmMat4& modelViewTransform)\n{\n    CCASSERT(shader, \"shader cannot be nill\");\n    CCASSERT(textureAtlas, \"textureAtlas cannot be nill\");\n    \n    _globalOrder = globalOrder;\n    _textureID = textureAtlas->getTexture()->getName();\n    _blendType = blendType;\n    _shader = shader;\n\n    _textureAtlas = textureAtlas;\n\n    _mv = modelViewTransform;\n}\n\nBatchCommand::~BatchCommand()\n{\n}\n\nvoid BatchCommand::execute()\n{\n    // Set material\n    _shader->use();\n    _shader->setUniformsForBuiltins(_mv);\n    GL::bindTexture2D(_textureID);\n    GL::blendFunc(_blendType.src, _blendType.dst);\n\n    // Draw\n    _textureAtlas->drawQuads();\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCBatchCommand.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _CC_BATCHCOMMAND_H_\n#define _CC_BATCHCOMMAND_H_\n\n#include \"CCRenderCommand.h\"\n#include \"CCGLProgram.h\"\n#include \"CCRenderCommandPool.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\nclass TextureAtlas;\n\n#define CC_NO_TEXTURE 0\n\nclass BatchCommand : public RenderCommand\n{\npublic:\n\n    BatchCommand();\n    ~BatchCommand();\n\n    void init(float depth, GLProgram* shader, BlendFunc blendType, TextureAtlas *textureAtlas, const kmMat4& modelViewTransform);\n\n    void execute();\n\nprotected:\n    //Material\n    int32_t _materialID;\n    GLuint _textureID;\n    GLProgram* _shader;\n    BlendFunc _blendType;\n\n    TextureAtlas *_textureAtlas;\n\n    // ModelView transform\n    kmMat4 _mv;\n};\nNS_CC_END\n\n#endif //_CC_BATCHCOMMAND_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCCustomCommand.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\nCustomCommand::CustomCommand()\n: func(nullptr)\n{\n    _type = RenderCommand::Type::CUSTOM_COMMAND;\n}\n\nvoid CustomCommand::init(float globalOrder)\n{\n    _globalOrder = globalOrder;\n}\n\nCustomCommand::~CustomCommand()\n{\n\n}\n\nvoid CustomCommand::execute()\n{\n    if(func)\n    {\n        func();\n    }\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCCustomCommand.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef _CC_CUSTOMCOMMAND_H_\n#define _CC_CUSTOMCOMMAND_H_\n\n#include \"CCRenderCommand.h\"\n#include \"CCRenderCommandPool.h\"\n\nNS_CC_BEGIN\n\nclass CustomCommand : public RenderCommand\n{\npublic:\n    CustomCommand();\n    ~CustomCommand();\n    \npublic:\n\n    void init(float depth);\n\n    void execute();\n\n    inline bool isTranslucent() { return true; }\n    std::function<void()> func;\n\nprotected:\n};\n\nNS_CC_END\n\n#endif //_CC_CUSTOMCOMMAND_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCFrustum.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"renderer/CCFrustum.h\"\n#include \"CCConsole.h\"\n\n#include <stdlib.h>\n\nNS_CC_BEGIN\n\nViewTransform::ViewTransform()\n{\n    kmVec3Fill(&_position,0,0,0);\n    kmVec3Fill(&_focus,0,0,-1);\n    kmVec3Fill(&_up,0,1,0);\n    _dirty = true;\n    kmMat4Identity(&_matrix);\n}\n\nViewTransform::~ViewTransform()\n{\n}\n\nvoid ViewTransform::Init(const kmVec3 &pos, const kmVec3 &focus, const kmVec3 &up)\n{\n    _position = pos;\n    _focus = focus;\n    _up = up;\n    _dirty = true;\n}\n\nvoid ViewTransform::LazyAdjust() const\n{\n    if(!_dirty) return;\n    kmVec3Subtract(&_adjustDir, &_focus, &_position);\n    kmVec3Normalize(&_adjustDir, &_adjustDir);\n    \n    kmVec3Cross(&_adjustRight, &_adjustDir, &_up);\n    kmVec3Normalize(&_adjustRight, &_adjustRight);\n    \n    kmVec3Cross(&_adjustUp, &_adjustRight, &_adjustDir);\n    kmVec3Normalize(&_adjustUp, &_adjustUp);\n    \n    _dirty = false;\n}\n\nconst kmVec3& ViewTransform::getDirection() const\n{\n    LazyAdjust();\n    return _adjustDir;\n}\n\nconst kmVec3& ViewTransform::getRight() const\n{\n    LazyAdjust();\n    return _adjustRight;\n}\n\nconst kmVec3& ViewTransform::getUp() const\n{\n    LazyAdjust();\n    return _adjustUp;\n}\n\nAABB::AABB(const kmVec3& min, const kmVec3& max)\n{\n    _min = min;\n    _max = max;\n    if(_min.x > _max.x)\n    {\n        CCLOG(\"_min.x is greater than _max.x, it will be swapped!\");\n        float temp = _min.x; _min.x = _max.x; _max.x = temp;\n    }\n    if(_min.y > _max.y)\n    {\n        CCLOG(\"_min.y is greater than _max.y, it will be swapped!\");\n        float temp = _min.y; _min.y = _max.y; _max.y = temp;\n    }\n    if(_min.z > _max.z)\n    {\n        CCLOG(\"_min.z is greater than _max.z, it will be swapped!\");\n        float temp = _min.z; _min.z = _max.z; _max.z = temp;\n    }\n}\n\nAABB::~AABB()\n{\n}\n\nkmVec3 AABB::getCenter() const\n{\n    kmVec3 result;\n    \n    kmVec3Add(&result, &_min, &_max);\n    kmVec3Scale(&result, &result, 0.5f);\n    return result;\n}\n\nfloat AABB::getDimensionX() const\n{\n    return _max.x - _min.x;\n}\n\nfloat AABB::getDimensionY() const\n{\n    return _max.y - _min.y;\n}\n\nfloat AABB::getDimensionZ() const\n{\n    return _max.z - _min.z;\n}\n\nkmVec3 AABB::getPositivePoint(const kmVec3& direction) const\n{\n    kmVec3 result = _max;\n    if( direction.x < 0 ) result.x = _min.x;\n    if( direction.y < 0 ) result.y = _min.y;\n    if( direction.z < 0 ) result.z = _min.z;\n    \n    return result;\n}\n\nconst AABB& AABB::expand(const kmVec3& point)\n{\n    if(point.x > _max.x) _max.x = point.x;\n    if(point.y > _max.y) _max.y = point.y;\n    if(point.z > _max.z) _max.z = point.z;\n\n    if(point.x < _min.x) _min.x = point.x;\n    if(point.y < _min.y) _min.y = point.y;\n    if(point.z < _min.z) _min.z = point.z;\n    \n    return *this;\n}\n\nkmVec3 AABB::getNegativePoint(const kmVec3& direction) const\n{\n    kmVec3 result = _min;\n    if( direction.x < 0 ) result.x = _max.x;\n    if( direction.y < 0 ) result.y = _max.y;\n    if( direction.z < 0 ) result.z = _max.z;\n    \n    return result;\n}\n\nFrustum::Frustum()\n{\n}\n\nFrustum::~Frustum()\n{\n}\n\nvoid Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, float width, float height, float nearPlane, float farPlane)\n{\n    kmVec3 cc = view.getPosition();\n    kmVec3 cDir = view.getDirection();\n    kmVec3 cRight = view.getRight();\n    kmVec3 cUp = view.getUp();\n    \n    kmVec3Normalize(&cDir, &cDir);\n    kmVec3Normalize(&cRight, &cRight);\n    kmVec3Normalize(&cUp, &cUp);\n    \n    //near\n    {\n        kmVec3 point;\n        kmVec3 normal;\n        normal = cDir;\n        kmVec3Scale(&point, &cDir, nearPlane);\n        kmVec3Add(&point, &point, &cc);\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_NEAR], &point, &normal);\n    }\n    \n    //far\n    {\n        kmVec3 point;\n        kmVec3 normal;\n        kmVec3Scale(&normal, &cDir, -1);\n        kmVec3Scale(&point, &cDir, farPlane);\n        kmVec3Add(&point, &point, &cc);\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_FAR], &point, &normal);\n    }\n    \n    //left\n    {\n        kmVec3 point;\n        kmVec3 normal;\n        normal = cRight;\n        kmVec3Scale(&point, &cRight, -width * 0.5);\n        kmVec3Add(&point, &point, &cc);\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_LEFT], &point, &normal);\n    }\n    \n    //right\n    {\n        kmVec3 point;\n        kmVec3 normal;\n        kmVec3Scale(&normal, &cRight, -1);\n        kmVec3Scale(&point, &cRight, width * 0.5);\n        kmVec3Add(&point, &point, &cc);\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_RIGHT], &point, &normal);\n    }\n    \n    //bottom\n    {\n        kmVec3 point;\n        kmVec3 normal;\n        normal = cUp;\n        kmVec3Scale(&point, &cUp, -height * 0.5);\n        kmVec3Add(&point, &point, &cc);\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_BOTTOM], &point, &normal);\n    }\n    \n    //top\n    {\n        kmVec3 point;\n        kmVec3 normal;\n        kmVec3Scale(&normal, &cUp, -1);\n        kmVec3Scale(&point, &cUp, height * 0.5);\n        kmVec3Add(&point, &point, &cc);\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_TOP], &point, &normal);\n    }\n}\n\nvoid Frustum::setupProjectionPerspective(const ViewTransform& view, float left, float right, float top, float bottom, float nearPlane, float farPlane)\n{\n    kmVec3 cc = view.getPosition();\n    kmVec3 cDir = view.getDirection();\n    kmVec3 cRight = view.getRight();\n    kmVec3 cUp = view.getUp();\n    \n    kmVec3Normalize(&cDir, &cDir);\n    kmVec3Normalize(&cRight, &cRight);\n    kmVec3Normalize(&cUp, &cUp);\n    \n    kmVec3 nearCenter;\n    kmVec3 farCenter;\n    \n    kmVec3Scale(&nearCenter, &cDir, nearPlane);\n    kmVec3Add(&nearCenter, &nearCenter, &cc);\n    \n    kmVec3Scale(&farCenter, &cDir, farPlane);\n    kmVec3Add(&farCenter, &farCenter, &cc);\n    \n    //near\n    {\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_NEAR], &nearCenter, &cDir);\n    }\n    \n    //far\n    {\n        kmVec3 normal;\n        kmVec3Scale(&normal, &cDir, -1);\n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_FAR], &farCenter, &normal);\n    }\n    \n    //left\n    {\n        kmVec3 point;\n        kmVec3Scale(&point, &cRight, left);\n        kmVec3Add(&point, &point, &nearCenter);\n        \n        kmVec3 normal;\n        kmVec3Subtract(&normal, &point, &cc);\n        kmVec3Cross(&normal, &normal, &cUp);\n        kmVec3Normalize(&normal, &normal);\n        \n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_LEFT], &point, &normal);\n    }\n    \n    //right\n    {\n        kmVec3 point;\n        kmVec3Scale(&point, &cRight, right);\n        kmVec3Add(&point, &point, &nearCenter);\n        \n        kmVec3 normal;\n        kmVec3Subtract(&normal, &point, &cc);\n        kmVec3Cross(&normal, &cUp, &normal);\n        kmVec3Normalize(&normal, &normal);\n        \n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_RIGHT], &point, &normal);\n    }\n    \n    //bottom\n    {\n        kmVec3 point;\n        kmVec3Scale(&point, &cUp, bottom);\n        kmVec3Add(&point, &point, &nearCenter);\n        \n        kmVec3 normal;\n        kmVec3Subtract(&normal, &point, &cc);\n        kmVec3Cross(&normal, &cRight, &normal);\n        kmVec3Normalize(&normal, &normal);\n        \n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_BOTTOM], &point, &normal);\n    }\n    \n    //top\n    {\n        kmVec3 point;\n        kmVec3Scale(&point, &cUp, top);\n        kmVec3Add(&point, &point, &nearCenter);\n        \n        kmVec3 normal;\n        kmVec3Subtract(&normal, &point, &cc);\n        kmVec3Cross(&normal, &normal, &cRight);\n        kmVec3Normalize(&normal, &normal);\n        \n        kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_TOP], &point, &normal);\n    }\n    \n}\n\nvoid Frustum::setupProjectionPerspectiveFov(const ViewTransform& view, float fov, float ratio, float nearPlane, float farPlane)\n{\n    float width = 2 * nearPlane * tan(fov * 0.5);\n    float height = width/ratio;\n    setupProjectionPerspective(view, -width/2, width/2, height/2, -height/2, nearPlane, farPlane);\n}\n\nvoid Frustum::setupFromMatrix(const kmMat4 &view, const kmMat4 &projection)\n{\n    kmMat4 mvp;\n    kmMat4Multiply(&mvp, &projection, &view);\n    \n    kmMat4ExtractPlane(&_frustumPlanes[FrustumPlane::FRUSTUM_NEAR], &mvp, KM_PLANE_NEAR);\n    kmMat4ExtractPlane(&_frustumPlanes[FrustumPlane::FRUSTUM_FAR], &mvp, KM_PLANE_FAR);\n    kmMat4ExtractPlane(&_frustumPlanes[FrustumPlane::FRUSTUM_LEFT], &mvp, KM_PLANE_LEFT);\n    kmMat4ExtractPlane(&_frustumPlanes[FrustumPlane::FRUSTUM_RIGHT], &mvp, KM_PLANE_RIGHT);\n    kmMat4ExtractPlane(&_frustumPlanes[FrustumPlane::FRUSTUM_BOTTOM], &mvp, KM_PLANE_BOTTOM);\n    kmMat4ExtractPlane(&_frustumPlanes[FrustumPlane::FRUSTUM_TOP], &mvp, KM_PLANE_TOP);\n}\n\nFrustum::IntersectResult Frustum::intersectPoint(const kmVec3 &point) const\n{\n    int indexFirst = static_cast<int>(FrustumPlane::FRUSTUM_NEAR);\n    int indexNumber = static_cast<int>(FrustumPlane::FRUSTUM_NUMBER);\n    \n    for(int planeIndex = indexFirst; planeIndex < indexNumber; ++planeIndex)\n    {\n        if(kmPlaneDotCoord(&_frustumPlanes[static_cast<FrustumPlane>(planeIndex)], &point) < 0)\n            return IntersectResult::OUTSIDE;\n    }\n    return IntersectResult::INSIDE;\n}\n\nFrustum::IntersectResult Frustum::intersectAABB(const AABB& aabb) const\n{\n    IntersectResult result = IntersectResult::INSIDE;\n    int indexFirst = static_cast<int>(FrustumPlane::FRUSTUM_NEAR);\n    int indexNumber = static_cast<int>(FrustumPlane::FRUSTUM_NUMBER);\n    \n    for(int planeIndex = indexFirst; planeIndex < indexNumber; ++planeIndex)\n    {\n        kmPlane plane = _frustumPlanes[static_cast<FrustumPlane>(planeIndex)];\n        kmVec3 normal = {plane.a, plane.b, plane.c};\n        kmVec3Normalize(&normal, &normal);\n        kmVec3 positivePoint = aabb.getPositivePoint(normal);\n        kmVec3 negativePoint = aabb.getNegativePoint(normal);\n        \n        if(kmPlaneDotCoord(&plane, &positivePoint) < 0)\n            return IntersectResult::OUTSIDE;\n        if(kmPlaneDotCoord(&plane, &negativePoint) < 0)\n            result = IntersectResult::INTERSECT;\n    }\n    \n    return result;\n}\n\nFrustum::IntersectResult Frustum::intersectSphere(const kmVec3& center, float radius) const\n{\n    IntersectResult result = IntersectResult::INSIDE;\n    int indexFirst = static_cast<int>(FrustumPlane::FRUSTUM_NEAR);\n    int indexNumber = static_cast<int>(FrustumPlane::FRUSTUM_NUMBER);\n    \n    for(int planeIndex = indexFirst; planeIndex < indexNumber; ++planeIndex)\n    {\n        kmPlane plane = _frustumPlanes[static_cast<FrustumPlane>(planeIndex)];\n        kmVec3 normal = {plane.a, plane.b, plane.c};\n        \n        float distance = kmPlaneDotCoord(&plane, &center);\n        distance = distance / kmVec3Length(&normal);\n        \n        if(distance < -radius) return IntersectResult::OUTSIDE;\n        if(distance <= radius && distance >= -radius) result = IntersectResult::INTERSECT;\n    }\n    \n    return result;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCFrustum.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CC_FRUSTUM_H__\n#define __CC_FRUSTUM_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\nclass ViewTransform\n{\npublic:\n    ViewTransform();\n    ~ViewTransform();\n    void Init(const kmVec3& pos, const kmVec3& focus, const kmVec3& up);\n    \n    const kmVec3& getPosition() const { return _position; }\n    const kmVec3& getFocus() const { return _focus; }\n    const kmVec3& getDirection() const;\n    const kmVec3& getRight() const;\n    const kmVec3& getUp() const;\n    \nprotected:\n    void LazyAdjust() const;\n\n    kmVec3 _position;\n    kmVec3 _focus;\n    kmVec3 _up;\n    \n    mutable bool _dirty;\n    mutable kmMat4 _matrix;\n    mutable kmVec3 _adjustDir;\n    mutable kmVec3 _adjustRight;\n    mutable kmVec3 _adjustUp;\n};\n\nclass AABB\n{\npublic:\n    AABB(const kmVec3& min, const kmVec3& max);\n    ~AABB();\n    \n    kmVec3 getCenter() const;\n    \n    float getDimensionX() const;\n    float getDimensionY() const;\n    float getDimensionZ() const;\n    \n    kmVec3 getPositivePoint(const kmVec3& direction) const;\n    kmVec3 getNegativePoint(const kmVec3& direction) const;\n    \n    const AABB& expand(const kmVec3& point);\n\nprotected:\n    kmVec3 _min;\n    kmVec3 _max;\n};\n\nclass Frustum\n{\npublic:\n    enum class IntersectResult\n    {\n        OUTSIDE = 0,\n        INTERSECT = 1,\n        INSIDE = 2\n    };\n\n    Frustum();\n    ~Frustum();\n\n    void setupProjectionOrthogonal(const ViewTransform& view, float width, float height, float near, float far);\n    void setupProjectionPerspective(const ViewTransform& view, float left, float right, float top, float bottom, float near, float far);\n    void setupProjectionPerspectiveFov(const ViewTransform& view, float fov, float ratio, float near, float far);\n    \n    void setupFromMatrix(const kmMat4& view, const kmMat4& projection);\n    \n    IntersectResult intersectPoint(const kmVec3& point) const;\n    IntersectResult intersectAABB(const AABB& aabb) const;\n    IntersectResult intersectSphere(const kmVec3& center, float radius) const;\n    \nprotected:\n    enum FrustumPlane\n    {\n        FRUSTUM_NEAR = 0,\n        FRUSTUM_FAR = 1,\n        FRUSTUM_BOTTOM = 2,\n        FRUSTUM_TOP = 3,\n        FRUSTUM_LEFT = 4,\n        FRUSTUM_RIGHT = 5,\n        FRUSTUM_NUMBER = 6\n    };\n    kmPlane _frustumPlanes[FrustumPlane::FRUSTUM_NUMBER];\n};\n\nNS_CC_END \n\n#endif"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCGroupCommand.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"CCDirector.h\"\n\nNS_CC_BEGIN\n\nstatic GroupCommandManager* s_instance;\nGroupCommandManager *GroupCommandManager::getInstance()\n{\n    if(!s_instance)\n    {\n        s_instance = new GroupCommandManager();\n        if(!s_instance->init())\n        {\n            CC_SAFE_DELETE(s_instance);\n        }\n    }\n    return s_instance;\n}\n\nGroupCommandManager::GroupCommandManager()\n{\n\n}\n\nGroupCommandManager::~GroupCommandManager()\n{\n    CC_SAFE_RELEASE_NULL(s_instance);\n}\n\nbool GroupCommandManager::init()\n{\n    //0 is the default render group\n    _groupMapping[0] = true;\n    return true;\n}\n\nint GroupCommandManager::getGroupID()\n{\n    //Reuse old id\n    for(auto it = _groupMapping.begin(); it != _groupMapping.end(); ++it)\n    {\n        if(!it->second)\n        {\n            _groupMapping[it->first] = true;\n            return it->first;\n        }\n    }\n\n    //Create new ID\n//    int newID = _groupMapping.size();\n    int newID = Director::getInstance()->getRenderer()->createRenderQueue();\n    _groupMapping[newID] = true;\n\n    return newID;\n}\n\nvoid GroupCommandManager::releaseGroupID(int groupID)\n{\n    _groupMapping[groupID] = false;\n}\n\nGroupCommand::GroupCommand()\n{\n    _type = RenderCommand::Type::GROUP_COMMAND;\n    _renderQueueID = GroupCommandManager::getInstance()->getGroupID();\n}\n\nvoid GroupCommand::init(float globalOrder)\n{\n    _globalOrder = globalOrder;\n    GroupCommandManager::getInstance()->releaseGroupID(_renderQueueID);\n    _renderQueueID = GroupCommandManager::getInstance()->getGroupID();\n}\n\nGroupCommand::~GroupCommand()\n{\n    GroupCommandManager::getInstance()->releaseGroupID(_renderQueueID);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCGroupCommand.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef _CC_GROUPCOMMAND_H_\n#define _CC_GROUPCOMMAND_H_\n\n#include \"CCPlatformMacros.h\"\n#include \"CCRenderCommand.h\"\n#include \"CCRenderCommandPool.h\"\n#include <unordered_map>\n\nNS_CC_BEGIN\n\nclass GroupCommandManager : public Object\n{\npublic:\n    static GroupCommandManager* getInstance();\n\n    ~GroupCommandManager();\n\n    bool init();\n\n    int getGroupID();\n    void releaseGroupID(int groupID);\n\nprotected:\n    GroupCommandManager();\n    std::unordered_map<int, bool> _groupMapping;\n};\n\nclass GroupCommand : public RenderCommand\n{\npublic:\n    GroupCommand();\n    ~GroupCommand();\n    \n    void init(float depth);\n\n    inline int getRenderQueueID() const {return _renderQueueID;}\n    \nprotected:\n    int _renderQueueID;\n};\n\nNS_CC_END\n\n#endif //_CC_GROUPCOMMAND_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCMaterialManager.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#include \"CCMaterialManager.h\"\n\nNS_CC_BEGIN\n\nusing namespace std;\n\nstatic MaterialManager* s_instance = nullptr;\n\nMaterialManager *MaterialManager::getInstance()\n{\n    if(!s_instance)\n    {\n        s_instance = new MaterialManager();\n        if(!s_instance->init())\n        {\n            CC_SAFE_DELETE(s_instance);\n        }\n    }\n    return s_instance;\n}\n\nvoid MaterialManager::destroyInstance()\n{\n    CC_SAFE_RELEASE_NULL(s_instance);\n}\n\nvoid MaterialManager::getMaterialID(GLuint textureID, GLuint shaderID, BlendFunc blendFunc)\n{\n\n}\n\nvoid MaterialManager::registerTexture(GLuint textureID)\n{\n\n}\n\nvoid MaterialManager::unregisterTexture(GLuint textureID)\n{\n\n}\n\nvoid MaterialManager::registerShader(GLuint shaderID)\n{\n\n}\n\nvoid MaterialManager::unregisterShader(GLuint shaderID)\n{\n\n}\n\nMaterialManager::MaterialManager()\n{\n\n}\n\nMaterialManager::~MaterialManager()\n{\n\n}\n\nbool MaterialManager::init()\n{\n    return false;\n}\n\nint MaterialManager::getTextureID(GLuint textureID)\n{\n    return 0;\n}\n\nint MaterialManager::getShaderID(GLuint shaderID)\n{\n    return 0;\n}\n\nint MaterialManager::getBlendFuncID(GLint blendFunc)\n{\n    return 0;\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCMaterialManager.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef _CC_MATERIALMANAGER_H_\n#define _CC_MATERIALMANAGER_H_\n\n#include \"CCPlatformMacros.h\"\n#include \"CCObject.h\"\n#include \"ccTypes.h\"\n#include <map>\n\nNS_CC_BEGIN\n\nclass MaterialManager : public Object\n{\npublic:\n    static MaterialManager* getInstance();\n    static void destroyInstance();\n\n\n    void getMaterialID(GLuint textureID, GLuint shaderID, BlendFunc blendFunc);\n\n    void registerTexture(GLuint textureID);\n    void unregisterTexture(GLuint textureID);\n\n    void registerShader(GLuint shaderID);\n    void unregisterShader(GLuint shaderID);\n\nprotected:\n    MaterialManager();\n    virtual ~MaterialManager();\n\n    bool init();\n\n    int getTextureID(GLuint textureID);\n    int getShaderID(GLuint shaderID);\n    int getBlendFuncID(GLint blendFunc);\n\n    std::map<GLuint, int> _textureIDMapping;\n    std::map<GLuint, int> _shaderIDMapping;\n    std::map<BlendFunc, int> _blendFuncMapping;\n};\n\nNS_CC_END\n\n#endif //_CC_MATERIALMANAGER_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCQuadCommand.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#include \"renderer/CCQuadCommand.h\"\n#include \"ccGLStateCache.h\"\n\nNS_CC_BEGIN\n\nQuadCommand::QuadCommand()\n:_textureID(0)\n,_blendType(BlendFunc::DISABLE)\n,_quadsCount(0)\n{\n    _type = RenderCommand::Type::QUAD_COMMAND;\n    _shader = nullptr;\n    _quads = nullptr;\n}\n\nvoid QuadCommand::init(float globalOrder, GLuint textureID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, ssize_t quadCount, const kmMat4 &mv)\n{\n    _globalOrder = globalOrder;\n    _textureID = textureID;\n    _blendType = blendType;\n    _shader = shader;\n\n    _quadsCount = quadCount;\n    _quads = quad;\n\n    _mv = mv;\n\n    generateMaterialID();\n}\n\nQuadCommand::~QuadCommand()\n{\n}\n\nvoid QuadCommand::generateMaterialID()\n{\n    //Generate Material ID\n    //TODO fix shader ID generation\n    CCASSERT(_shader->getProgram() < pow(2,10), \"ShaderID is greater than 2^10\");\n    //TODO fix texture ID generation\n    CCASSERT(_textureID < pow(2,18), \"TextureID is greater than 2^18\");\n\n    //TODO fix blend id generation\n    int blendID = 0;\n    if(_blendType == BlendFunc::DISABLE)\n    {\n        blendID = 0;\n    }\n    else if(_blendType == BlendFunc::ALPHA_PREMULTIPLIED)\n    {\n        blendID = 1;\n    }\n    else if(_blendType == BlendFunc::ALPHA_NON_PREMULTIPLIED)\n    {\n        blendID = 2;\n    }\n    else if(_blendType == BlendFunc::ADDITIVE)\n    {\n        blendID = 3;\n    }\n    else\n    {\n        blendID = 4;\n    }\n\n    //TODO Material ID should be part of the ID\n    //\n    // Temporal hack (later, these 32-bits should be packed in 24-bits\n    //\n    // +---------------------+-------------------+----------------------+\n    // | Shader ID (10 bits) | Blend ID (4 bits) | Texture ID (18 bits) |\n    // +---------------------+-------------------+----------------------+\n\n    _materialID = (uint32_t)_shader->getProgram() << 22\n            | (uint32_t)blendID << 18\n            | (uint32_t)_textureID << 0;\n}\n\nvoid QuadCommand::useMaterial() const\n{\n    _shader->use();\n\n    _shader->setUniformsForBuiltins();\n\n    //Set texture\n    GL::bindTexture2D(_textureID);\n\n    //set blend mode\n    GL::blendFunc(_blendType.src, _blendType.dst);\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCQuadCommand.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef _CC_QUADCOMMAND_H_\n#define _CC_QUADCOMMAND_H_\n\n#include \"CCRenderCommand.h\"\n#include \"CCGLProgram.h\"\n#include \"CCRenderCommandPool.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\n#define CC_NO_TEXTURE 0\n\nclass QuadCommand : public RenderCommand\n{\npublic:\n\n    QuadCommand();\n    ~QuadCommand();\n\n    void init(float depth, GLuint texutreID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quads, ssize_t quadCount,\n              const kmMat4& mv);\n\n    void useMaterial() const;\n\n    //TODO use material to decide if it is translucent\n    inline bool isTranslucent() const { return true; }\n\n    void generateMaterialID();\n    inline uint32_t getMaterialID() const { return _materialID; }\n\n    inline GLuint getTextureID() const { return _textureID; }\n\n    inline V3F_C4B_T2F_Quad* getQuads() const { return _quads; }\n\n    inline ssize_t getQuadCount() const { return _quadsCount; }\n\n    inline GLProgram* getShader() const { return _shader; }\n\n    inline BlendFunc getBlendType() const { return _blendType; }\n\n    inline const kmMat4& getModelView() const { return _mv; }\n    \nprotected:\n    uint32_t _materialID;\n\n    //Maternal\n    GLuint _textureID;\n\n    GLProgram* _shader;\n//    GLuint _shaderID;\n\n    BlendFunc _blendType;\n\n    V3F_C4B_T2F_Quad* _quads;\n    ssize_t _quadsCount;\n\n    kmMat4 _mv;\n};\nNS_CC_END\n\n#endif //_CC_QUADCOMMAND_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCRenderCommand.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#include \"CCRenderCommand.h\"\n\nNS_CC_BEGIN\n\nRenderCommand::RenderCommand()\n: _type(RenderCommand::Type::UNKNOWN_COMMAND)\n, _globalOrder(0)\n{\n}\n\nRenderCommand::~RenderCommand()\n{\n}\n\nvoid printBits(ssize_t const size, void const * const ptr)\n{\n    unsigned char *b = (unsigned char*) ptr;\n    unsigned char byte;\n    ssize_t i, j;\n\n    for (i=size-1;i>=0;i--)\n    {\n        for (j=7;j>=0;j--)\n        {\n            byte = b[i] & (1<<j);\n            byte >>= j;\n            printf(\"%u\", byte);\n        }\n    }\n    puts(\"\");\n}\n\nvoid RenderCommand::printID()\n{\n    printf(\"Command Depth: %f\\n\", _globalOrder);\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCRenderCommand.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef __CCRENDERCOMMAND_H_\n#define __CCRENDERCOMMAND_H_\n\n#include \"CCPlatformMacros.h\"\n#include <stdint.h>\n#include \"ccTypes.h\"\n#include \"kazmath/GL/matrix.h\"\n\nNS_CC_BEGIN\n\n/** Base class of the RenderCommand hierarchy.\n The Renderer knows how to render RenderCommands.\n */\nclass RenderCommand\n{\npublic:\n\n    enum class Type\n    {\n        UNKNOWN_COMMAND,\n        QUAD_COMMAND,\n        CUSTOM_COMMAND,\n        BATCH_COMMAND,\n        GROUP_COMMAND,\n    };\n\n    /** Get Render Command Id */\n    inline float getGlobalOrder() const { return _globalOrder; }\n\n    /** Returns the Command type */\n    inline Type getType() const { return _type; }\n\nprotected:\n    RenderCommand();\n    virtual ~RenderCommand();\n\n    void printID();\n\n    // Type used in order to avoid dynamic cast, faster\n    Type _type;\n\n    // commands are sort by depth\n    float _globalOrder;\n};\n\nNS_CC_END\n\n#endif //__CCRENDERCOMMAND_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCRenderCommandPool.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef __CC_RENDERCOMMANDPOOL_H__\n#define __CC_RENDERCOMMANDPOOL_H__\n\n#include <set>\n#include <list>\n#include \"CCPlatformMacros.h\"\nNS_CC_BEGIN\n\ntemplate <class T>\nclass RenderCommandPool\n{\npublic:\n    RenderCommandPool()\n    {\n    }\n    ~RenderCommandPool()\n    {\n//        if( 0 != _usedPool.size())\n//        {\n//            CCLOG(\"All RenderCommand should not be used when Pool is released!\");\n//        }\n        _freePool.clear();\n        for (typename std::list<T*>::iterator iter = _allocatedPoolBlocks.begin(); iter != _allocatedPoolBlocks.end(); ++iter)\n        {\n            delete[] *iter;\n            *iter = nullptr;\n        }\n        _allocatedPoolBlocks.clear();\n    }\n\n    T* generateCommand()\n    {\n        T* result = nullptr;\n        if(_freePool.empty())\n        {\n            AllocateCommands();\n        }\n        result = _freePool.front();\n        _freePool.pop_front();\n        //_usedPool.insert(result);\n        return result;\n    }\n    \n    void pushBackCommand(T* ptr)\n    {\n//        if(_usedPool.find(ptr) == _usedPool.end())\n//        {\n//            CCLOG(\"push Back Wrong command!\");\n//            return;\n//        }\n        \n        _freePool.push_back(ptr);\n        //_usedPool.erase(ptr);\n        \n    }\nprivate:\n    void AllocateCommands()\n    {\n        static const int COMMANDS_ALLOCATE_BLOCK_SIZE = 32;\n        T* commands = new T[COMMANDS_ALLOCATE_BLOCK_SIZE];\n        _allocatedPoolBlocks.push_back(commands);\n        for(int index = 0; index < COMMANDS_ALLOCATE_BLOCK_SIZE; ++index)\n        {\n            _freePool.push_back(commands+index);\n        }\n    }\n\n    std::list<T*> _allocatedPoolBlocks;\n    std::list<T*> _freePool;\n    //std::set<T*> _usedPool;\n};\n\nNS_CC_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCRenderMaterial.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#include \"CCRenderMaterial.h\"\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCRenderMaterial.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef __RenderMaterial_H_\n#define __RenderMaterial_H_\n\n\nclass RenderMaterial\n{\n\n};\n\n\n#endif //__RenderMaterial_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCRenderer.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCQuadCommand.h\"\n#include \"renderer/CCBatchCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"CCShaderCache.h\"\n#include \"ccGLStateCache.h\"\n#include \"CCConfiguration.h\"\n#include \"CCDirector.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventListenerCustom.h\"\n#include \"CCEventType.h\"\n#include <algorithm>\n\nNS_CC_BEGIN\n\nbool compareRenderCommand(RenderCommand* a, RenderCommand* b)\n{\n    return a->getGlobalOrder() < b->getGlobalOrder();\n}\n\nvoid RenderQueue::push_back(RenderCommand* command)\n{\n    float z = command->getGlobalOrder();\n    if(z < 0)\n        _queueNegZ.push_back(command);\n    else if(z > 0)\n        _queuePosZ.push_back(command);\n    else\n        _queue0.push_back(command);\n}\n\nssize_t RenderQueue::size() const\n{\n    return _queueNegZ.size() + _queue0.size() + _queuePosZ.size();\n}\n\nvoid RenderQueue::sort()\n{\n    // Don't sort _queue0, it already comes sorted\n    std::sort(std::begin(_queueNegZ), std::end(_queueNegZ), compareRenderCommand);\n    std::sort(std::begin(_queuePosZ), std::end(_queuePosZ), compareRenderCommand);\n}\n\nRenderCommand* RenderQueue::operator[](ssize_t index) const\n{\n    if(index < _queueNegZ.size())\n        return _queueNegZ[index];\n\n    index -= _queueNegZ.size();\n\n    if(index < _queue0.size())\n        return _queue0[index];\n\n    index -= _queue0.size();\n\n    if(index < _queuePosZ.size())\n        return _queuePosZ[index];\n\n    CCASSERT(false, \"invalid index\");\n    return nullptr;\n}\n\nvoid RenderQueue::clear()\n{\n    _queueNegZ.clear();\n    _queue0.clear();\n    _queuePosZ.clear();\n}\n\n\n//\n//\n//\n#define DEFAULT_RENDER_QUEUE 0\n\nRenderer::Renderer()\n:_lastMaterialID(0)\n,_numQuads(0)\n,_glViewAssigned(false)\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n,_cacheTextureListener(nullptr)\n#endif\n{\n    _commandGroupStack.push(DEFAULT_RENDER_QUEUE);\n    \n    RenderQueue defaultRenderQueue;\n    _renderGroups.push_back(defaultRenderQueue);\n    RenderStackElement elelment = {DEFAULT_RENDER_QUEUE, 0};\n    _renderStack.push(elelment);\n    _batchedQuadCommands.reserve(BATCH_QUADCOMMAND_RESEVER_SIZE);\n}\n\nRenderer::~Renderer()\n{\n    _renderGroups.clear();\n    \n    glDeleteBuffers(2, _buffersVBO);\n    \n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        glDeleteVertexArrays(1, &_quadVAO);\n        GL::bindVAO(0);\n    }\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    Director::getInstance()->getEventDispatcher()->removeEventListener(_cacheTextureListener);\n#endif\n}\n\nvoid Renderer::initGLView()\n{\n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    _cacheTextureListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom* event){\n        /** listen the event that coming to foreground on Android */\n        this->setupBuffer();\n    });\n    \n    Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_cacheTextureListener, -1);\n#endif\n\n    setupIndices();\n    \n    setupBuffer();\n    \n    _glViewAssigned = true;\n}\n\nvoid Renderer::setupIndices()\n{\n    for( int i=0; i < VBO_SIZE; i++)\n    {\n        _indices[i*6+0] = (GLushort) (i*4+0);\n        _indices[i*6+1] = (GLushort) (i*4+1);\n        _indices[i*6+2] = (GLushort) (i*4+2);\n        _indices[i*6+3] = (GLushort) (i*4+3);\n        _indices[i*6+4] = (GLushort) (i*4+2);\n        _indices[i*6+5] = (GLushort) (i*4+1);\n    }\n}\n\nvoid Renderer::setupBuffer()\n{\n    if(Configuration::getInstance()->supportsShareableVAO())\n    {\n        setupVBOAndVAO();\n    }\n    else\n    {\n        setupVBO();\n    }\n}\n\nvoid Renderer::setupVBOAndVAO()\n{\n    glGenVertexArrays(1, &_quadVAO);\n    GL::bindVAO(_quadVAO);\n\n    glGenBuffers(2, &_buffersVBO[0]);\n\n    glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n    glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * VBO_SIZE, _quads, GL_DYNAMIC_DRAW);\n\n    // vertices\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*) offsetof( V3F_C4B_T2F, vertices));\n\n    // colors\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_T2F), (GLvoid*) offsetof( V3F_C4B_T2F, colors));\n\n    // tex coords\n    glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n    glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*) offsetof( V3F_C4B_T2F, texCoords));\n\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * VBO_SIZE * 6, _indices, GL_STATIC_DRAW);\n\n    // Must unbind the VAO before changing the element buffer.\n    GL::bindVAO(0);\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\nvoid Renderer::setupVBO()\n{\n    glGenBuffers(2, &_buffersVBO[0]);\n\n    mapBuffers();\n}\n\nvoid Renderer::mapBuffers()\n{\n    // Avoid changing the element buffer for whatever VAO might be bound.\n    GL::bindVAO(0);\n\n    glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n    glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * VBO_SIZE, _quads, GL_DYNAMIC_DRAW);\n    glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * VBO_SIZE * 6, _indices, GL_STATIC_DRAW);\n    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\n    CHECK_GL_ERROR_DEBUG();\n}\n\nvoid Renderer::addCommand(RenderCommand* command)\n{\n    int renderQueue =_commandGroupStack.top();\n    addCommand(command, renderQueue);\n}\n\nvoid Renderer::addCommand(RenderCommand* command, int renderQueue)\n{\n    CCASSERT(renderQueue >=0, \"Invalid render queue\");\n    CCASSERT(command->getType() != RenderCommand::Type::UNKNOWN_COMMAND, \"Invalid Command Type\");\n    _renderGroups[renderQueue].push_back(command);\n}\n\nvoid Renderer::pushGroup(int renderQueueID)\n{\n    _commandGroupStack.push(renderQueueID);\n}\n\nvoid Renderer::popGroup()\n{\n    _commandGroupStack.pop();\n}\n\nint Renderer::createRenderQueue()\n{\n    RenderQueue newRenderQueue;\n    _renderGroups.push_back(newRenderQueue);\n    return (int)_renderGroups.size() - 1;\n}\n\nvoid Renderer::render()\n{\n    //Uncomment this once everything is rendered by new renderer\n    //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n\n    //TODO setup camera or MVP\n\n    if (_glViewAssigned)\n    {\n        //Process render commands\n        //1. Sort render commands based on ID\n        for (auto &renderqueue : _renderGroups)\n        {\n            renderqueue.sort();\n        }\n        \n        while(!_renderStack.empty())\n        {\n            RenderQueue currRenderQueue = _renderGroups[_renderStack.top().renderQueueID];\n            size_t len = currRenderQueue.size();\n            \n            //Process RenderQueue\n            for(size_t i = _renderStack.top().currentIndex; i < len; i++)\n            {\n                _renderStack.top().currentIndex = i;\n                auto command = currRenderQueue[i];\n\n                auto commandType = command->getType();\n                \n                if(commandType == RenderCommand::Type::QUAD_COMMAND)\n                {\n                    auto cmd = static_cast<QuadCommand*>(command);\n                    CCASSERT(nullptr!= cmd, \"Illegal command for RenderCommand Taged as QUAD_COMMAND\");\n                    \n                    //Batch quads\n                    if(_numQuads + cmd->getQuadCount() > VBO_SIZE)\n                    {\n                        CCASSERT(cmd->getQuadCount()>= 0 && cmd->getQuadCount() < VBO_SIZE, \"VBO is not big enough for quad data, please break the quad data down or use customized render command\");\n\n                        //Draw batched quads if VBO is full\n                        drawBatchedQuads();\n                    }\n                    \n                    _batchedQuadCommands.push_back(cmd);\n                    \n                    memcpy(_quads + _numQuads, cmd->getQuads(), sizeof(V3F_C4B_T2F_Quad) * cmd->getQuadCount());\n                    convertToWorldCoordinates(_quads + _numQuads, cmd->getQuadCount(), cmd->getModelView());\n\n                    _numQuads += cmd->getQuadCount();\n                }\n                else if(commandType == RenderCommand::Type::CUSTOM_COMMAND)\n                {\n                    flush();\n                    auto cmd = static_cast<CustomCommand*>(command);\n                    cmd->execute();\n                }\n                else if(commandType == RenderCommand::Type::BATCH_COMMAND)\n                {\n                    flush();\n                    auto cmd = static_cast<BatchCommand*>(command);\n                    cmd->execute();\n                }\n                else if(commandType == RenderCommand::Type::GROUP_COMMAND)\n                {\n                    flush();\n                    auto cmd = static_cast<GroupCommand*>(command);\n                    \n                    _renderStack.top().currentIndex = i + 1;\n                    \n                    //push new renderQueue to renderStack\n                    RenderStackElement element = {cmd->getRenderQueueID(), 0};\n                    _renderStack.push(element);\n                    \n                    //Exit current loop\n                    break;\n                }\n                else\n                {\n                    CCASSERT(true, \"Invalid command\");\n                    flush();\n                }\n            }\n            \n            //Draw the batched quads\n            drawBatchedQuads();\n            \n            currRenderQueue = _renderGroups[_renderStack.top().renderQueueID];\n            len = currRenderQueue.size();\n            //If pop the render stack if we already processed all the commands\n            if(_renderStack.top().currentIndex + 1 >= len)\n            {\n                _renderStack.pop();\n            }\n        }\n    }\n\n    for (size_t j = 0 ; j < _renderGroups.size(); j++)\n    {\n        //commands are owned by nodes\n        // for (const auto &cmd : _renderGroups[j])\n        // {\n        //     cmd->releaseToCommandPool();\n        // }\n        _renderGroups[j].clear();\n    }\n    \n    //Clear the stack incase gl view hasn't been initialized yet\n    while(!_renderStack.empty())\n    {\n        _renderStack.pop();\n    }\n    RenderStackElement element = {DEFAULT_RENDER_QUEUE, 0};\n    _renderStack.push(element);\n    _lastMaterialID = 0;\n}\n\nvoid Renderer::convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const kmMat4& modelView)\n{\n//    kmMat4 matrixP, mvp;\n//    kmGLGetMatrix(KM_GL_PROJECTION, &matrixP);\n//    kmMat4Multiply(&mvp, &matrixP, &modelView);\n\n    for(ssize_t i=0; i<quantity; ++i) {\n        V3F_C4B_T2F_Quad *q = &quads[i];\n\n        kmVec3 *vec1 = (kmVec3*)&q->bl.vertices;\n        kmVec3Transform(vec1, vec1, &modelView);\n\n        kmVec3 *vec2 = (kmVec3*)&q->br.vertices;\n        kmVec3Transform(vec2, vec2, &modelView);\n\n        kmVec3 *vec3 = (kmVec3*)&q->tr.vertices;\n        kmVec3Transform(vec3, vec3, &modelView);\n\n        kmVec3 *vec4 = (kmVec3*)&q->tl.vertices;\n        kmVec3Transform(vec4, vec4, &modelView);\n    }\n}\n\nvoid Renderer::drawBatchedQuads()\n{\n    //TODO we can improve the draw performance by insert material switching command before hand.\n\n    int quadsToDraw = 0;\n    int startQuad = 0;\n\n    //Upload buffer to VBO\n    if(_numQuads <= 0 || _batchedQuadCommands.empty())\n    {\n        return;\n    }\n\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        //Set VBO data\n        glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n\n        // option 1: subdata\n//        glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] );\n\n        // option 2: data\n//        glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * (n-start), &quads_[start], GL_DYNAMIC_DRAW);\n\n        // option 3: orphaning + glMapBuffer\n        glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (_numQuads), nullptr, GL_DYNAMIC_DRAW);\n        void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);\n        memcpy(buf, _quads, sizeof(_quads[0])* (_numQuads));\n        glUnmapBuffer(GL_ARRAY_BUFFER);\n\n        glBindBuffer(GL_ARRAY_BUFFER, 0);\n\n        //Bind VAO\n        GL::bindVAO(_quadVAO);\n    }\n    else\n    {\n#define kQuadSize sizeof(_quads[0].bl)\n        glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);\n\n        glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _numQuads , _quads, GL_DYNAMIC_DRAW);\n\n        GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);\n\n        // vertices\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, vertices));\n\n        // colors\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, colors));\n\n        // tex coords\n        glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORDS, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, texCoords));\n\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);\n    }\n\n    //Start drawing verties in batch\n    //for(auto i = _batchedQuadCommands.begin(); i != _batchedQuadCommands.end(); ++i)\n    for(const auto& cmd : _batchedQuadCommands)\n    {\n        if(_lastMaterialID != cmd->getMaterialID())\n        {\n            //Draw quads\n            if(quadsToDraw > 0)\n            {\n                glDrawElements(GL_TRIANGLES, (GLsizei) quadsToDraw*6, GL_UNSIGNED_SHORT, (GLvoid*) (startQuad*6*sizeof(_indices[0])) );\n                CC_INCREMENT_GL_DRAWS(1);\n\n                startQuad += quadsToDraw;\n                quadsToDraw = 0;\n            }\n\n            //Use new material\n            cmd->useMaterial();\n            _lastMaterialID = cmd->getMaterialID();\n        }\n\n        quadsToDraw += cmd->getQuadCount();\n    }\n\n    //Draw any remaining quad\n    if(quadsToDraw > 0)\n    {\n        glDrawElements(GL_TRIANGLES, (GLsizei) quadsToDraw*6, GL_UNSIGNED_SHORT, (GLvoid*) (startQuad*6*sizeof(_indices[0])) );\n        CC_INCREMENT_GL_DRAWS(1);\n    }\n\n    if (Configuration::getInstance()->supportsShareableVAO())\n    {\n        //Unbind VAO\n        GL::bindVAO(0);\n    }\n    else\n    {\n        glBindBuffer(GL_ARRAY_BUFFER, 0);\n        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n    }\n\n    _batchedQuadCommands.clear();\n    _numQuads = 0;\n}\n\nvoid Renderer::flush()\n{\n    drawBatchedQuads();\n    _lastMaterialID = 0;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/2d/renderer/CCRenderer.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef __CC_RENDERER_H_\n#define __CC_RENDERER_H_\n\n#include \"CCPlatformMacros.h\"\n#include \"CCRenderCommand.h\"\n#include \"CCGLProgram.h\"\n#include \"CCGL.h\"\n#include <vector>\n#include <stack>\n\nNS_CC_BEGIN\n\nclass EventListenerCustom;\nclass QuadCommand;\n\n/** Class that knows how to sort the Commands.\n Since the commands that have z==0 are \"pushed back\" in\n the correct order, the only Commands that need to be sorted, \n are the ones that have z <0 and z >0.\n And that is what this class does.\n*/\nclass RenderQueue {\n\npublic:\n    void push_back(RenderCommand* command);\n    ssize_t size() const;\n    void sort();\n    RenderCommand* operator[](ssize_t index) const;\n    void clear();\n\nprotected:\n    std::vector<RenderCommand*> _queueNegZ;\n    std::vector<RenderCommand*> _queue0;\n    std::vector<RenderCommand*> _queuePosZ;\n};\n\nstruct RenderStackElement\n{\n    int renderQueueID;\n    ssize_t currentIndex;\n};\n\nclass Renderer\n{\npublic:\n    static const int VBO_SIZE = 65536 / 6;\n    static const int BATCH_QUADCOMMAND_RESEVER_SIZE = 64;\n\n    Renderer();\n    ~Renderer();\n\n    //TODO manage GLView inside Render itself\n    void initGLView();\n    \n    //TODO support multiple viewport\n    void addCommand(RenderCommand* command);\n    void addCommand(RenderCommand* command, int renderQueue);\n    void pushGroup(int renderQueueID);\n    void popGroup();\n    \n    int createRenderQueue();\n    void render();\n\nprotected:\n\n    void setupIndices();\n    //Setup VBO or VAO based on OpenGL extensions\n    void setupBuffer();\n    void setupVBOAndVAO();\n    void setupVBO();\n    void mapBuffers();\n\n    void drawBatchedQuads();\n\n    //Draw the previews queued quads and flush previous context\n    void flush();\n\n    void convertToWorldCoordinates(V3F_C4B_T2F_Quad* quads, ssize_t quantity, const kmMat4& modelView);\n\n    std::stack<int> _commandGroupStack;\n    \n    std::stack<RenderStackElement> _renderStack;\n    std::vector<RenderQueue> _renderGroups;\n\n    uint32_t _lastMaterialID;\n\n    std::vector<QuadCommand*> _batchedQuadCommands;\n\n    V3F_C4B_T2F_Quad _quads[VBO_SIZE];\n    GLushort _indices[6 * VBO_SIZE];\n    GLuint _quadVAO;\n    GLuint _buffersVBO[2]; //0: vertex  1: indices\n\n    int _numQuads;\n    \n    bool _glViewAssigned;\n    \n#if CC_ENABLE_CACHE_TEXTURE_DATA\n    EventListenerCustom* _cacheTextureListener;\n#endif\n};\n\nNS_CC_END\n\n#endif //__CC_RENDERER_H_\n"
  },
  {
    "path": "cocos2d/cocos/2d/uthash.h",
    "content": "/*\nCopyright (c) 2003-2013, Troy D. Hanson     http://troydhanson.github.com/uthash/\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef UTHASH_H\n#define UTHASH_H \n\n#include <string.h>   /* memcmp,strlen */\n#include <stddef.h>   /* ptrdiff_t */\n#include <stdlib.h>   /* exit() */\n\n/* These macros use decltype or the earlier __typeof GNU extension.\n   As decltype is only available in newer compilers (VS2010 or gcc 4.3+\n   when compiling c++ source) this code uses whatever method is needed\n   or, for VS2008 where neither is available, uses casting workarounds. */\n#ifdef _MSC_VER         /* MS compiler */\n#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */\n#define DECLTYPE(x) (decltype(x))\n#else                   /* VS2008 or older (or VS2010 in C mode) */\n#define NO_DECLTYPE\n#define DECLTYPE(x)\n#endif\n#else                   /* GNU, Sun and other compilers */\n#define DECLTYPE(x) (__typeof(x))\n#endif\n\n#ifdef NO_DECLTYPE\n#define DECLTYPE_ASSIGN(dst,src)                                                 \\\ndo {                                                                             \\\n  char **_da_dst = (char**)(&(dst));                                             \\\n  *_da_dst = (char*)(src);                                                       \\\n} while(0)\n#else \n#define DECLTYPE_ASSIGN(dst,src)                                                 \\\ndo {                                                                             \\\n  (dst) = DECLTYPE(dst)(src);                                                    \\\n} while(0)\n#endif\n\n/* a number of the hash function use uint32_t which isn't defined on win32 */\n#ifdef _MSC_VER\ntypedef unsigned int uint32_t;\ntypedef unsigned char uint8_t;\n#else\n#include <inttypes.h>   /* uint32_t */\n#endif\n\n#define UTHASH_VERSION 1.9.8\n\n#ifndef uthash_fatal\n#define uthash_fatal(msg) exit(-1)        /* fatal error (out of memory,etc) */\n#endif\n#ifndef uthash_malloc\n#define uthash_malloc(sz) malloc(sz)      /* malloc fcn                      */\n#endif\n#ifndef uthash_free\n#define uthash_free(ptr,sz) free(ptr)     /* free fcn                        */\n#endif\n\n#ifndef uthash_noexpand_fyi\n#define uthash_noexpand_fyi(tbl)          /* can be defined to log noexpand  */\n#endif\n#ifndef uthash_expand_fyi\n#define uthash_expand_fyi(tbl)            /* can be defined to log expands   */\n#endif\n\n/* initial number of buckets */\n#define HASH_INITIAL_NUM_BUCKETS 32      /* initial number of buckets        */\n#define HASH_INITIAL_NUM_BUCKETS_LOG2 5  /* lg2 of initial number of buckets */\n#define HASH_BKT_CAPACITY_THRESH 10      /* expand when bucket count reaches */\n\n/* calculate the element whose hash handle address is hhe */\n#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))\n\n#define HASH_FIND(hh,head,keyptr,keylen,out)                                     \\\ndo {                                                                             \\\n  unsigned _hf_bkt,_hf_hashv;                                                    \\\n  out=NULL;                                                                      \\\n  if (head) {                                                                    \\\n     HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \\\n     if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) {                           \\\n       HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ],  \\\n                        keyptr,keylen,out);                                      \\\n     }                                                                           \\\n  }                                                                              \\\n} while (0)\n\n#ifdef HASH_BLOOM\n#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM)\n#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0)\n#define HASH_BLOOM_MAKE(tbl)                                                     \\\ndo {                                                                             \\\n  (tbl)->bloom_nbits = HASH_BLOOM;                                               \\\n  (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN);                 \\\n  if (!((tbl)->bloom_bv))  { uthash_fatal( \"out of memory\"); }                   \\\n  memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN);                                \\\n  (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE;                                       \\\n} while (0) \n\n#define HASH_BLOOM_FREE(tbl)                                                     \\\ndo {                                                                             \\\n  uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN);                              \\\n} while (0) \n\n#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8)))\n#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8)))\n\n#define HASH_BLOOM_ADD(tbl,hashv)                                                \\\n  HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))\n\n#define HASH_BLOOM_TEST(tbl,hashv)                                               \\\n  HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))\n\n#else\n#define HASH_BLOOM_MAKE(tbl) \n#define HASH_BLOOM_FREE(tbl) \n#define HASH_BLOOM_ADD(tbl,hashv) \n#define HASH_BLOOM_TEST(tbl,hashv) (1)\n#define HASH_BLOOM_BYTELEN 0\n#endif\n\n#define HASH_MAKE_TABLE(hh,head)                                                 \\\ndo {                                                                             \\\n  (head)->hh.tbl = (UT_hash_table*)uthash_malloc(                                \\\n                  sizeof(UT_hash_table));                                        \\\n  if (!((head)->hh.tbl))  { uthash_fatal( \"out of memory\"); }                    \\\n  memset((head)->hh.tbl, 0, sizeof(UT_hash_table));                              \\\n  (head)->hh.tbl->tail = &((head)->hh);                                          \\\n  (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS;                        \\\n  (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2;              \\\n  (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head);                    \\\n  (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc(                      \\\n          HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \\\n  if (! (head)->hh.tbl->buckets) { uthash_fatal( \"out of memory\"); }             \\\n  memset((head)->hh.tbl->buckets, 0,                                             \\\n          HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \\\n  HASH_BLOOM_MAKE((head)->hh.tbl);                                               \\\n  (head)->hh.tbl->signature = HASH_SIGNATURE;                                    \\\n} while(0)\n\n#define HASH_ADD(hh,head,fieldname,keylen_in,add)                                \\\n        HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add)\n\n#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced)                   \\\ndo {                                                                             \\\n  replaced=NULL;                                                                 \\\n  HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced);                     \\\n  if (replaced!=NULL) {                                                          \\\n     HASH_DELETE(hh,head,replaced);                                              \\\n  };                                                                             \\\n  HASH_ADD(hh,head,fieldname,keylen_in,add);                                     \\\n} while(0)\n \n#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)                            \\\ndo {                                                                             \\\n unsigned _ha_bkt;                                                               \\\n (add)->hh.next = NULL;                                                          \\\n (add)->hh.key = (char*)keyptr;                                                  \\\n (add)->hh.keylen = (unsigned)keylen_in;                                                   \\\n if (!(head)) {                                                                  \\\n    head = (add);                                                                \\\n    (head)->hh.prev = NULL;                                                      \\\n    HASH_MAKE_TABLE(hh,head);                                                    \\\n } else {                                                                        \\\n    (head)->hh.tbl->tail->next = (add);                                          \\\n    (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail);         \\\n    (head)->hh.tbl->tail = &((add)->hh);                                         \\\n }                                                                               \\\n (head)->hh.tbl->num_items++;                                                    \\\n (add)->hh.tbl = (head)->hh.tbl;                                                 \\\n HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets,                         \\\n         (add)->hh.hashv, _ha_bkt);                                              \\\n HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh);                   \\\n HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv);                                 \\\n HASH_EMIT_KEY(hh,head,keyptr,keylen_in);                                        \\\n HASH_FSCK(hh,head);                                                             \\\n} while(0)\n\n#define HASH_TO_BKT( hashv, num_bkts, bkt )                                      \\\ndo {                                                                             \\\n  bkt = ((hashv) & ((num_bkts) - 1));                                            \\\n} while(0)\n\n/* delete \"delptr\" from the hash table.\n * \"the usual\" patch-up process for the app-order doubly-linked-list.\n * The use of _hd_hh_del below deserves special explanation.\n * These used to be expressed using (delptr) but that led to a bug\n * if someone used the same symbol for the head and deletee, like\n *  HASH_DELETE(hh,users,users);\n * We want that to work, but by changing the head (users) below\n * we were forfeiting our ability to further refer to the deletee (users)\n * in the patch-up process. Solution: use scratch space to\n * copy the deletee pointer, then the latter references are via that\n * scratch pointer rather than through the repointed (users) symbol.\n */\n#define HASH_DELETE(hh,head,delptr)                                              \\\ndo {                                                                             \\\n    unsigned _hd_bkt;                                                            \\\n    struct UT_hash_handle *_hd_hh_del;                                           \\\n    if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) )  {         \\\n        uthash_free((head)->hh.tbl->buckets,                                     \\\n                    (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \\\n        HASH_BLOOM_FREE((head)->hh.tbl);                                         \\\n        uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                      \\\n        head = NULL;                                                             \\\n    } else {                                                                     \\\n        _hd_hh_del = &((delptr)->hh);                                            \\\n        if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) {     \\\n            (head)->hh.tbl->tail =                                               \\\n                (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) +               \\\n                (head)->hh.tbl->hho);                                            \\\n        }                                                                        \\\n        if ((delptr)->hh.prev) {                                                 \\\n            ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) +                  \\\n                    (head)->hh.tbl->hho))->next = (delptr)->hh.next;             \\\n        } else {                                                                 \\\n            DECLTYPE_ASSIGN(head,(delptr)->hh.next);                             \\\n        }                                                                        \\\n        if (_hd_hh_del->next) {                                                  \\\n            ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next +                     \\\n                    (head)->hh.tbl->hho))->prev =                                \\\n                    _hd_hh_del->prev;                                            \\\n        }                                                                        \\\n        HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt);   \\\n        HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del);        \\\n        (head)->hh.tbl->num_items--;                                             \\\n    }                                                                            \\\n    HASH_FSCK(hh,head);                                                          \\\n} while (0)\n\n\n/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */\n#define HASH_FIND_STR(head,findstr,out)                                          \\\n    HASH_FIND(hh,head,findstr,strlen(findstr),out)\n#define HASH_ADD_STR(head,strfield,add)                                          \\\n    HASH_ADD(hh,head,strfield,strlen(add->strfield),add)\n#define HASH_REPLACE_STR(head,strfield,add,replaced)                             \\\n  HASH_REPLACE(hh,head,strfield,strlen(add->strfield),add,replaced)\n#define HASH_FIND_INT(head,findint,out)                                          \\\n    HASH_FIND(hh,head,findint,sizeof(int),out)\n#define HASH_ADD_INT(head,intfield,add)                                          \\\n    HASH_ADD(hh,head,intfield,sizeof(int),add)\n#define HASH_REPLACE_INT(head,intfield,add,replaced)                             \\\n    HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced)\n#define HASH_FIND_PTR(head,findptr,out)                                          \\\n    HASH_FIND(hh,head,findptr,sizeof(void *),out)\n#define HASH_ADD_PTR(head,ptrfield,add)                                          \\\n    HASH_ADD(hh,head,ptrfield,sizeof(void *),add)\n#define HASH_REPLACE_PTR(head,ptrfield,add)                                      \\\n    HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced)\n#define HASH_DEL(head,delptr)                                                    \\\n    HASH_DELETE(hh,head,delptr)\n\n/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.\n * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.\n */\n#ifdef HASH_DEBUG\n#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)\n#define HASH_FSCK(hh,head)                                                       \\\ndo {                                                                             \\\n    unsigned _bkt_i;                                                             \\\n    unsigned _count, _bkt_count;                                                 \\\n    char *_prev;                                                                 \\\n    struct UT_hash_handle *_thh;                                                 \\\n    if (head) {                                                                  \\\n        _count = 0;                                                              \\\n        for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) {       \\\n            _bkt_count = 0;                                                      \\\n            _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head;                      \\\n            _prev = NULL;                                                        \\\n            while (_thh) {                                                       \\\n               if (_prev != (char*)(_thh->hh_prev)) {                            \\\n                   HASH_OOPS(\"invalid hh_prev %p, actual %p\\n\",                  \\\n                    _thh->hh_prev, _prev );                                      \\\n               }                                                                 \\\n               _bkt_count++;                                                     \\\n               _prev = (char*)(_thh);                                            \\\n               _thh = _thh->hh_next;                                             \\\n            }                                                                    \\\n            _count += _bkt_count;                                                \\\n            if ((head)->hh.tbl->buckets[_bkt_i].count !=  _bkt_count) {          \\\n               HASH_OOPS(\"invalid bucket count %d, actual %d\\n\",                 \\\n                (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count);              \\\n            }                                                                    \\\n        }                                                                        \\\n        if (_count != (head)->hh.tbl->num_items) {                               \\\n            HASH_OOPS(\"invalid hh item count %d, actual %d\\n\",                   \\\n                (head)->hh.tbl->num_items, _count );                             \\\n        }                                                                        \\\n        /* traverse hh in app order; check next/prev integrity, count */         \\\n        _count = 0;                                                              \\\n        _prev = NULL;                                                            \\\n        _thh =  &(head)->hh;                                                     \\\n        while (_thh) {                                                           \\\n           _count++;                                                             \\\n           if (_prev !=(char*)(_thh->prev)) {                                    \\\n              HASH_OOPS(\"invalid prev %p, actual %p\\n\",                          \\\n                    _thh->prev, _prev );                                         \\\n           }                                                                     \\\n           _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh);                    \\\n           _thh = ( _thh->next ?  (UT_hash_handle*)((char*)(_thh->next) +        \\\n                                  (head)->hh.tbl->hho) : NULL );                 \\\n        }                                                                        \\\n        if (_count != (head)->hh.tbl->num_items) {                               \\\n            HASH_OOPS(\"invalid app item count %d, actual %d\\n\",                  \\\n                (head)->hh.tbl->num_items, _count );                             \\\n        }                                                                        \\\n    }                                                                            \\\n} while (0)\n#else\n#define HASH_FSCK(hh,head) \n#endif\n\n/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to \n * the descriptor to which this macro is defined for tuning the hash function.\n * The app can #include <unistd.h> to get the prototype for write(2). */\n#ifdef HASH_EMIT_KEYS\n#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                                   \\\ndo {                                                                             \\\n    unsigned _klen = fieldlen;                                                   \\\n    write(HASH_EMIT_KEYS, &_klen, sizeof(_klen));                                \\\n    write(HASH_EMIT_KEYS, keyptr, fieldlen);                                     \\\n} while (0)\n#else \n#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                    \n#endif\n\n/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */\n#ifdef HASH_FUNCTION \n#define HASH_FCN HASH_FUNCTION\n#else\n#define HASH_FCN HASH_JEN\n#endif\n\n/* The Bernstein hash function, used in Perl prior to v5.6 */\n#define HASH_BER(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _hb_keylen=keylen;                                                    \\\n  char *_hb_key=(char*)(key);                                                    \\\n  (hashv) = 0;                                                                   \\\n  while (_hb_keylen--)  { (hashv) = ((hashv) * 33) + *_hb_key++; }               \\\n  bkt = (hashv) & (num_bkts-1);                                                  \\\n} while (0)\n\n\n/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at \n * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */\n#define HASH_SAX(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _sx_i;                                                                \\\n  char *_hs_key=(char*)(key);                                                    \\\n  hashv = 0;                                                                     \\\n  for(_sx_i=0; _sx_i < keylen; _sx_i++)                                          \\\n      hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i];                     \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while (0)\n\n#define HASH_FNV(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _fn_i;                                                                \\\n  char *_hf_key=(char*)(key);                                                    \\\n  hashv = 2166136261UL;                                                          \\\n  for(_fn_i=0; _fn_i < keylen; _fn_i++)                                          \\\n      hashv = (hashv * 16777619) ^ _hf_key[_fn_i];                               \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0) \n \n#define HASH_OAT(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _ho_i;                                                                \\\n  char *_ho_key=(char*)(key);                                                    \\\n  hashv = 0;                                                                     \\\n  for(_ho_i=0; _ho_i < keylen; _ho_i++) {                                        \\\n      hashv += _ho_key[_ho_i];                                                   \\\n      hashv += (hashv << 10);                                                    \\\n      hashv ^= (hashv >> 6);                                                     \\\n  }                                                                              \\\n  hashv += (hashv << 3);                                                         \\\n  hashv ^= (hashv >> 11);                                                        \\\n  hashv += (hashv << 15);                                                        \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n\n#define HASH_JEN_MIX(a,b,c)                                                      \\\ndo {                                                                             \\\n  a -= b; a -= c; a ^= ( c >> 13 );                                              \\\n  b -= c; b -= a; b ^= ( a << 8 );                                               \\\n  c -= a; c -= b; c ^= ( b >> 13 );                                              \\\n  a -= b; a -= c; a ^= ( c >> 12 );                                              \\\n  b -= c; b -= a; b ^= ( a << 16 );                                              \\\n  c -= a; c -= b; c ^= ( b >> 5 );                                               \\\n  a -= b; a -= c; a ^= ( c >> 3 );                                               \\\n  b -= c; b -= a; b ^= ( a << 10 );                                              \\\n  c -= a; c -= b; c ^= ( b >> 15 );                                              \\\n} while (0)\n\n#define HASH_JEN(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _hj_i,_hj_j,_hj_k;                                                    \\\n  unsigned char *_hj_key=(unsigned char*)(key);                                  \\\n  hashv = 0xfeedbeef;                                                            \\\n  _hj_i = _hj_j = 0x9e3779b9;                                                    \\\n  _hj_k = (unsigned)keylen;                                                      \\\n  while (_hj_k >= 12) {                                                          \\\n    _hj_i +=    (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 )                      \\\n        + ( (unsigned)_hj_key[2] << 16 )                                         \\\n        + ( (unsigned)_hj_key[3] << 24 ) );                                      \\\n    _hj_j +=    (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 )                      \\\n        + ( (unsigned)_hj_key[6] << 16 )                                         \\\n        + ( (unsigned)_hj_key[7] << 24 ) );                                      \\\n    hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 )                         \\\n        + ( (unsigned)_hj_key[10] << 16 )                                        \\\n        + ( (unsigned)_hj_key[11] << 24 ) );                                     \\\n                                                                                 \\\n     HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                          \\\n                                                                                 \\\n     _hj_key += 12;                                                              \\\n     _hj_k -= 12;                                                                \\\n  }                                                                              \\\n  hashv += keylen;                                                               \\\n  switch ( _hj_k ) {                                                             \\\n     case 11: hashv += ( (unsigned)_hj_key[10] << 24 );                          \\\n     case 10: hashv += ( (unsigned)_hj_key[9] << 16 );                           \\\n     case 9:  hashv += ( (unsigned)_hj_key[8] << 8 );                            \\\n     case 8:  _hj_j += ( (unsigned)_hj_key[7] << 24 );                           \\\n     case 7:  _hj_j += ( (unsigned)_hj_key[6] << 16 );                           \\\n     case 6:  _hj_j += ( (unsigned)_hj_key[5] << 8 );                            \\\n     case 5:  _hj_j += _hj_key[4];                                               \\\n     case 4:  _hj_i += ( (unsigned)_hj_key[3] << 24 );                           \\\n     case 3:  _hj_i += ( (unsigned)_hj_key[2] << 16 );                           \\\n     case 2:  _hj_i += ( (unsigned)_hj_key[1] << 8 );                            \\\n     case 1:  _hj_i += _hj_key[0];                                               \\\n  }                                                                              \\\n  HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                             \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n\n/* The Paul Hsieh hash function */\n#undef get16bits\n#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__)             \\\n  || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)\n#define get16bits(d) (*((const uint16_t *) (d)))\n#endif\n\n#if !defined (get16bits)\n#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)             \\\n                       +(uint32_t)(((const uint8_t *)(d))[0]) )\n#endif\n#define HASH_SFH(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned char *_sfh_key=(unsigned char*)(key);                                 \\\n  uint32_t _sfh_tmp, _sfh_len = keylen;                                          \\\n                                                                                 \\\n  int _sfh_rem = _sfh_len & 3;                                                   \\\n  _sfh_len >>= 2;                                                                \\\n  hashv = 0xcafebabe;                                                            \\\n                                                                                 \\\n  /* Main loop */                                                                \\\n  for (;_sfh_len > 0; _sfh_len--) {                                              \\\n    hashv    += get16bits (_sfh_key);                                            \\\n    _sfh_tmp       = (uint32_t)(get16bits (_sfh_key+2)) << 11  ^ hashv;          \\\n    hashv     = (hashv << 16) ^ _sfh_tmp;                                        \\\n    _sfh_key += 2*sizeof (uint16_t);                                             \\\n    hashv    += hashv >> 11;                                                     \\\n  }                                                                              \\\n                                                                                 \\\n  /* Handle end cases */                                                         \\\n  switch (_sfh_rem) {                                                            \\\n    case 3: hashv += get16bits (_sfh_key);                                       \\\n            hashv ^= hashv << 16;                                                \\\n            hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)] << 18);              \\\n            hashv += hashv >> 11;                                                \\\n            break;                                                               \\\n    case 2: hashv += get16bits (_sfh_key);                                       \\\n            hashv ^= hashv << 11;                                                \\\n            hashv += hashv >> 17;                                                \\\n            break;                                                               \\\n    case 1: hashv += *_sfh_key;                                                  \\\n            hashv ^= hashv << 10;                                                \\\n            hashv += hashv >> 1;                                                 \\\n  }                                                                              \\\n                                                                                 \\\n    /* Force \"avalanching\" of final 127 bits */                                  \\\n    hashv ^= hashv << 3;                                                         \\\n    hashv += hashv >> 5;                                                         \\\n    hashv ^= hashv << 4;                                                         \\\n    hashv += hashv >> 17;                                                        \\\n    hashv ^= hashv << 25;                                                        \\\n    hashv += hashv >> 6;                                                         \\\n    bkt = hashv & (num_bkts-1);                                                  \\\n} while(0) \n\n#ifdef HASH_USING_NO_STRICT_ALIASING\n/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads.\n * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error.\n * MurmurHash uses the faster approach only on CPU's where we know it's safe. \n *\n * Note the preprocessor built-in defines can be emitted using:\n *\n *   gcc -m64 -dM -E - < /dev/null                  (on gcc)\n *   cc -## a.c (where a.c is a simple test file)   (Sun Studio)\n */\n#if (defined(__i386__) || defined(__x86_64__)  || defined(_M_IX86))\n#define MUR_GETBLOCK(p,i) p[i]\n#else /* non intel */\n#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0)\n#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1)\n#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2)\n#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3)\n#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))\n#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))\n#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))\n#define MUR_TWO_TWO(p)   ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))\n#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >>  8))\n#else /* assume little endian non-intel */\n#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24))\n#define MUR_TWO_TWO(p)   ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16))\n#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) <<  8))\n#endif\n#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) :           \\\n                            (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \\\n                             (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) :  \\\n                                                      MUR_ONE_THREE(p))))\n#endif\n#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))\n#define MUR_FMIX(_h) \\\ndo {                 \\\n  _h ^= _h >> 16;    \\\n  _h *= 0x85ebca6b;  \\\n  _h ^= _h >> 13;    \\\n  _h *= 0xc2b2ae35l; \\\n  _h ^= _h >> 16;    \\\n} while(0)\n\n#define HASH_MUR(key,keylen,num_bkts,hashv,bkt)                        \\\ndo {                                                                   \\\n  const uint8_t *_mur_data = (const uint8_t*)(key);                    \\\n  const int _mur_nblocks = (keylen) / 4;                               \\\n  uint32_t _mur_h1 = 0xf88D5353;                                       \\\n  uint32_t _mur_c1 = 0xcc9e2d51;                                       \\\n  uint32_t _mur_c2 = 0x1b873593;                                       \\\n  uint32_t _mur_k1 = 0;                                                \\\n  const uint8_t *_mur_tail;                                            \\\n  const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \\\n  int _mur_i;                                                          \\\n  for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) {                      \\\n    _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i);                        \\\n    _mur_k1 *= _mur_c1;                                                \\\n    _mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \\\n    _mur_k1 *= _mur_c2;                                                \\\n                                                                       \\\n    _mur_h1 ^= _mur_k1;                                                \\\n    _mur_h1 = MUR_ROTL32(_mur_h1,13);                                  \\\n    _mur_h1 = _mur_h1*5+0xe6546b64;                                    \\\n  }                                                                    \\\n  _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4);            \\\n  _mur_k1=0;                                                           \\\n  switch((keylen) & 3) {                                               \\\n    case 3: _mur_k1 ^= _mur_tail[2] << 16;                             \\\n    case 2: _mur_k1 ^= _mur_tail[1] << 8;                              \\\n    case 1: _mur_k1 ^= _mur_tail[0];                                   \\\n    _mur_k1 *= _mur_c1;                                                \\\n    _mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \\\n    _mur_k1 *= _mur_c2;                                                \\\n    _mur_h1 ^= _mur_k1;                                                \\\n  }                                                                    \\\n  _mur_h1 ^= (keylen);                                                 \\\n  MUR_FMIX(_mur_h1);                                                   \\\n  hashv = _mur_h1;                                                     \\\n  bkt = hashv & (num_bkts-1);                                          \\\n} while(0)\n#endif  /* HASH_USING_NO_STRICT_ALIASING */\n\n/* key comparison function; return 0 if keys equal */\n#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) \n\n/* iterate over items in a known bucket to find desired item */\n#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out)                       \\\ndo {                                                                             \\\n if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head));          \\\n else out=NULL;                                                                  \\\n while (out) {                                                                   \\\n    if ((out)->hh.keylen == keylen_in) {                                           \\\n        if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break;             \\\n    }                                                                            \\\n    if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \\\n    else out = NULL;                                                             \\\n }                                                                               \\\n} while(0)\n\n/* add an item to a bucket  */\n#define HASH_ADD_TO_BKT(head,addhh)                                              \\\ndo {                                                                             \\\n head.count++;                                                                   \\\n (addhh)->hh_next = head.hh_head;                                                \\\n (addhh)->hh_prev = NULL;                                                        \\\n if (head.hh_head) { (head).hh_head->hh_prev = (addhh); }                        \\\n (head).hh_head=addhh;                                                           \\\n if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH)             \\\n     && (addhh)->tbl->noexpand != 1) {                                           \\\n       HASH_EXPAND_BUCKETS((addhh)->tbl);                                        \\\n }                                                                               \\\n} while(0)\n\n/* remove an item from a given bucket */\n#define HASH_DEL_IN_BKT(hh,head,hh_del)                                          \\\n    (head).count--;                                                              \\\n    if ((head).hh_head == hh_del) {                                              \\\n      (head).hh_head = hh_del->hh_next;                                          \\\n    }                                                                            \\\n    if (hh_del->hh_prev) {                                                       \\\n        hh_del->hh_prev->hh_next = hh_del->hh_next;                              \\\n    }                                                                            \\\n    if (hh_del->hh_next) {                                                       \\\n        hh_del->hh_next->hh_prev = hh_del->hh_prev;                              \\\n    }                                                                \n\n/* Bucket expansion has the effect of doubling the number of buckets\n * and redistributing the items into the new buckets. Ideally the\n * items will distribute more or less evenly into the new buckets\n * (the extent to which this is true is a measure of the quality of\n * the hash function as it applies to the key domain). \n * \n * With the items distributed into more buckets, the chain length\n * (item count) in each bucket is reduced. Thus by expanding buckets\n * the hash keeps a bound on the chain length. This bounded chain \n * length is the essence of how a hash provides constant time lookup.\n * \n * The calculation of tbl->ideal_chain_maxlen below deserves some\n * explanation. First, keep in mind that we're calculating the ideal\n * maximum chain length based on the *new* (doubled) bucket count.\n * In fractions this is just n/b (n=number of items,b=new num buckets).\n * Since the ideal chain length is an integer, we want to calculate \n * ceil(n/b). We don't depend on floating point arithmetic in this\n * hash, so to calculate ceil(n/b) with integers we could write\n * \n *      ceil(n/b) = (n/b) + ((n%b)?1:0)\n * \n * and in fact a previous version of this hash did just that.\n * But now we have improved things a bit by recognizing that b is\n * always a power of two. We keep its base 2 log handy (call it lb),\n * so now we can write this with a bit shift and logical AND:\n * \n *      ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)\n * \n */\n#define HASH_EXPAND_BUCKETS(tbl)                                                 \\\ndo {                                                                             \\\n    unsigned _he_bkt;                                                            \\\n    unsigned _he_bkt_i;                                                          \\\n    struct UT_hash_handle *_he_thh, *_he_hh_nxt;                                 \\\n    UT_hash_bucket *_he_new_buckets, *_he_newbkt;                                \\\n    _he_new_buckets = (UT_hash_bucket*)uthash_malloc(                            \\\n             2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));              \\\n    if (!_he_new_buckets) { uthash_fatal( \"out of memory\"); }                    \\\n    memset(_he_new_buckets, 0,                                                   \\\n            2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));               \\\n    tbl->ideal_chain_maxlen =                                                    \\\n       (tbl->num_items >> (tbl->log2_num_buckets+1)) +                           \\\n       ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0);                    \\\n    tbl->nonideal_items = 0;                                                     \\\n    for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++)                \\\n    {                                                                            \\\n        _he_thh = tbl->buckets[ _he_bkt_i ].hh_head;                             \\\n        while (_he_thh) {                                                        \\\n           _he_hh_nxt = _he_thh->hh_next;                                        \\\n           HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt);            \\\n           _he_newbkt = &(_he_new_buckets[ _he_bkt ]);                           \\\n           if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) {                \\\n             tbl->nonideal_items++;                                              \\\n             _he_newbkt->expand_mult = _he_newbkt->count /                       \\\n                                        tbl->ideal_chain_maxlen;                 \\\n           }                                                                     \\\n           _he_thh->hh_prev = NULL;                                              \\\n           _he_thh->hh_next = _he_newbkt->hh_head;                               \\\n           if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev =               \\\n                _he_thh;                                                         \\\n           _he_newbkt->hh_head = _he_thh;                                        \\\n           _he_thh = _he_hh_nxt;                                                 \\\n        }                                                                        \\\n    }                                                                            \\\n    uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \\\n    tbl->num_buckets *= 2;                                                       \\\n    tbl->log2_num_buckets++;                                                     \\\n    tbl->buckets = _he_new_buckets;                                              \\\n    tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ?         \\\n        (tbl->ineff_expands+1) : 0;                                              \\\n    if (tbl->ineff_expands > 1) {                                                \\\n        tbl->noexpand=1;                                                         \\\n        uthash_noexpand_fyi(tbl);                                                \\\n    }                                                                            \\\n    uthash_expand_fyi(tbl);                                                      \\\n} while(0)\n\n\n/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */\n/* Note that HASH_SORT assumes the hash handle name to be hh. \n * HASH_SRT was added to allow the hash handle name to be passed in. */\n#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn)\n#define HASH_SRT(hh,head,cmpfcn)                                                 \\\ndo {                                                                             \\\n  unsigned _hs_i;                                                                \\\n  unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize;               \\\n  struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail;            \\\n  if (head) {                                                                    \\\n      _hs_insize = 1;                                                            \\\n      _hs_looping = 1;                                                           \\\n      _hs_list = &((head)->hh);                                                  \\\n      while (_hs_looping) {                                                      \\\n          _hs_p = _hs_list;                                                      \\\n          _hs_list = NULL;                                                       \\\n          _hs_tail = NULL;                                                       \\\n          _hs_nmerges = 0;                                                       \\\n          while (_hs_p) {                                                        \\\n              _hs_nmerges++;                                                     \\\n              _hs_q = _hs_p;                                                     \\\n              _hs_psize = 0;                                                     \\\n              for ( _hs_i = 0; _hs_i  < _hs_insize; _hs_i++ ) {                  \\\n                  _hs_psize++;                                                   \\\n                  _hs_q = (UT_hash_handle*)((_hs_q->next) ?                      \\\n                          ((void*)((char*)(_hs_q->next) +                        \\\n                          (head)->hh.tbl->hho)) : NULL);                         \\\n                  if (! (_hs_q) ) break;                                         \\\n              }                                                                  \\\n              _hs_qsize = _hs_insize;                                            \\\n              while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) {           \\\n                  if (_hs_psize == 0) {                                          \\\n                      _hs_e = _hs_q;                                             \\\n                      _hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \\\n                              ((void*)((char*)(_hs_q->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_qsize--;                                               \\\n                  } else if ( (_hs_qsize == 0) || !(_hs_q) ) {                   \\\n                      _hs_e = _hs_p;                                             \\\n                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \\\n                              ((void*)((char*)(_hs_p->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_psize--;                                               \\\n                  } else if ((                                                   \\\n                      cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \\\n                             DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \\\n                             ) <= 0) {                                           \\\n                      _hs_e = _hs_p;                                             \\\n                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \\\n                              ((void*)((char*)(_hs_p->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_psize--;                                               \\\n                  } else {                                                       \\\n                      _hs_e = _hs_q;                                             \\\n                      _hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \\\n                              ((void*)((char*)(_hs_q->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_qsize--;                                               \\\n                  }                                                              \\\n                  if ( _hs_tail ) {                                              \\\n                      _hs_tail->next = ((_hs_e) ?                                \\\n                            ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL);          \\\n                  } else {                                                       \\\n                      _hs_list = _hs_e;                                          \\\n                  }                                                              \\\n                  _hs_e->prev = ((_hs_tail) ?                                    \\\n                     ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL);              \\\n                  _hs_tail = _hs_e;                                              \\\n              }                                                                  \\\n              _hs_p = _hs_q;                                                     \\\n          }                                                                      \\\n          _hs_tail->next = NULL;                                                 \\\n          if ( _hs_nmerges <= 1 ) {                                              \\\n              _hs_looping=0;                                                     \\\n              (head)->hh.tbl->tail = _hs_tail;                                   \\\n              DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list));      \\\n          }                                                                      \\\n          _hs_insize *= 2;                                                       \\\n      }                                                                          \\\n      HASH_FSCK(hh,head);                                                        \\\n }                                                                               \\\n} while (0)\n\n/* This function selects items from one hash into another hash. \n * The end result is that the selected items have dual presence \n * in both hashes. There is no copy of the items made; rather \n * they are added into the new hash through a secondary hash \n * hash handle that must be present in the structure. */\n#define HASH_SELECT(hh_dst, dst, hh_src, src, cond)                              \\\ndo {                                                                             \\\n  unsigned _src_bkt, _dst_bkt;                                                   \\\n  void *_last_elt=NULL, *_elt;                                                   \\\n  UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL;                         \\\n  ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst));                 \\\n  if (src) {                                                                     \\\n    for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) {     \\\n      for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head;                \\\n          _src_hh;                                                               \\\n          _src_hh = _src_hh->hh_next) {                                          \\\n          _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh);                       \\\n          if (cond(_elt)) {                                                      \\\n            _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho);               \\\n            _dst_hh->key = _src_hh->key;                                         \\\n            _dst_hh->keylen = _src_hh->keylen;                                   \\\n            _dst_hh->hashv = _src_hh->hashv;                                     \\\n            _dst_hh->prev = _last_elt;                                           \\\n            _dst_hh->next = NULL;                                                \\\n            if (_last_elt_hh) { _last_elt_hh->next = _elt; }                     \\\n            if (!dst) {                                                          \\\n              DECLTYPE_ASSIGN(dst,_elt);                                         \\\n              HASH_MAKE_TABLE(hh_dst,dst);                                       \\\n            } else {                                                             \\\n              _dst_hh->tbl = (dst)->hh_dst.tbl;                                  \\\n            }                                                                    \\\n            HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt);    \\\n            HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh);            \\\n            (dst)->hh_dst.tbl->num_items++;                                      \\\n            _last_elt = _elt;                                                    \\\n            _last_elt_hh = _dst_hh;                                              \\\n          }                                                                      \\\n      }                                                                          \\\n    }                                                                            \\\n  }                                                                              \\\n  HASH_FSCK(hh_dst,dst);                                                         \\\n} while (0)\n\n#define HASH_CLEAR(hh,head)                                                      \\\ndo {                                                                             \\\n  if (head) {                                                                    \\\n    uthash_free((head)->hh.tbl->buckets,                                         \\\n                (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket));      \\\n    HASH_BLOOM_FREE((head)->hh.tbl);                                             \\\n    uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                          \\\n    (head)=NULL;                                                                 \\\n  }                                                                              \\\n} while(0)\n\n#define HASH_OVERHEAD(hh,head)                                                   \\\n (size_t)((((head)->hh.tbl->num_items   * sizeof(UT_hash_handle))   +            \\\n           ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket))   +            \\\n            (sizeof(UT_hash_table))                                 +            \\\n            (HASH_BLOOM_BYTELEN)))\n\n#ifdef NO_DECLTYPE\n#define HASH_ITER(hh,head,el,tmp)                                                \\\nfor((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL);       \\\n  el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) \n#else\n#define HASH_ITER(hh,head,el,tmp)                                                \\\nfor((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL);                 \\\n  el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL))\n#endif\n\n/* obtain a count of items in the hash */\n#define HASH_COUNT(head) HASH_CNT(hh,head) \n#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0)\n\ntypedef struct UT_hash_bucket {\n   struct UT_hash_handle *hh_head;\n   unsigned count;\n\n   /* expand_mult is normally set to 0. In this situation, the max chain length\n    * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If\n    * the bucket's chain exceeds this length, bucket expansion is triggered). \n    * However, setting expand_mult to a non-zero value delays bucket expansion\n    * (that would be triggered by additions to this particular bucket)\n    * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.\n    * (The multiplier is simply expand_mult+1). The whole idea of this\n    * multiplier is to reduce bucket expansions, since they are expensive, in\n    * situations where we know that a particular bucket tends to be overused.\n    * It is better to let its chain length grow to a longer yet-still-bounded\n    * value, than to do an O(n) bucket expansion too often. \n    */\n   unsigned expand_mult;\n\n} UT_hash_bucket;\n\n/* random signature used only to find hash tables in external analysis */\n#define HASH_SIGNATURE 0xa0111fe1\n#define HASH_BLOOM_SIGNATURE 0xb12220f2\n\ntypedef struct UT_hash_table {\n   UT_hash_bucket *buckets;\n   unsigned num_buckets, log2_num_buckets;\n   unsigned num_items;\n   struct UT_hash_handle *tail; /* tail hh in app order, for fast append    */\n   ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */\n\n   /* in an ideal situation (all buckets used equally), no bucket would have\n    * more than ceil(#items/#buckets) items. that's the ideal chain length. */\n   unsigned ideal_chain_maxlen;\n\n   /* nonideal_items is the number of items in the hash whose chain position\n    * exceeds the ideal chain maxlen. these items pay the penalty for an uneven\n    * hash distribution; reaching them in a chain traversal takes >ideal steps */\n   unsigned nonideal_items;\n\n   /* ineffective expands occur when a bucket doubling was performed, but \n    * afterward, more than half the items in the hash had nonideal chain\n    * positions. If this happens on two consecutive expansions we inhibit any\n    * further expansion, as it's not helping; this happens when the hash\n    * function isn't a good fit for the key domain. When expansion is inhibited\n    * the hash will still work, albeit no longer in constant time. */\n   unsigned ineff_expands, noexpand;\n\n   uint32_t signature; /* used only to find hash tables in external analysis */\n#ifdef HASH_BLOOM\n   uint32_t bloom_sig; /* used only to test bloom exists in external analysis */\n   uint8_t *bloom_bv;\n   char bloom_nbits;\n#endif\n\n} UT_hash_table;\n\ntypedef struct UT_hash_handle {\n   struct UT_hash_table *tbl;\n   void *prev;                       /* prev element in app order      */\n   void *next;                       /* next element in app order      */\n   struct UT_hash_handle *hh_prev;   /* previous hh in bucket order    */\n   struct UT_hash_handle *hh_next;   /* next hh in bucket order        */\n   void *key;                        /* ptr to enclosing struct's key  */\n   unsigned keylen;                  /* enclosing struct's key len     */\n   unsigned hashv;                   /* result of hash-fcn(key)        */\n} UT_hash_handle;\n\n#endif /* UTHASH_H */\n"
  },
  {
    "path": "cocos2d/cocos/2d/utlist.h",
    "content": "/*\nCopyright (c) 2007-2013, Troy D. Hanson   http://troydhanson.github.com/uthash/\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef UTLIST_H\n#define UTLIST_H\n\n#define UTLIST_VERSION 1.9.8\n\n#include <assert.h>\n\n/* \n * This file contains macros to manipulate singly and doubly-linked lists.\n *\n * 1. LL_ macros:  singly-linked lists.\n * 2. DL_ macros:  doubly-linked lists.\n * 3. CDL_ macros: circular doubly-linked lists.\n *\n * To use singly-linked lists, your structure must have a \"next\" pointer.\n * To use doubly-linked lists, your structure must \"prev\" and \"next\" pointers.\n * Either way, the pointer to the head of the list must be initialized to NULL.\n * \n * ----------------.EXAMPLE -------------------------\n * struct item {\n *      int id;\n *      struct item *prev, *next;\n * }\n *\n * struct item *list = NULL:\n *\n * int main() {\n *      struct item *item;\n *      ... allocate and populate item ...\n *      DL_APPEND(list, item);\n * }\n * --------------------------------------------------\n *\n * For doubly-linked lists, the append and delete macros are O(1)\n * For singly-linked lists, append and delete are O(n) but prepend is O(1)\n * The sort macro is O(n log(n)) for all types of single/double/circular lists.\n */\n\n/* These macros use decltype or the earlier __typeof GNU extension.\n   As decltype is only available in newer compilers (VS2010 or gcc 4.3+\n   when compiling c++ code), this code uses whatever method is needed\n   or, for VS2008 where neither is available, uses casting workarounds. */\n#ifdef _MSC_VER            /* MS compiler */\n#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */\n#define LDECLTYPE(x) decltype(x)\n#else                     /* VS2008 or older (or VS2010 in C mode) */\n#define NO_DECLTYPE\n#define LDECLTYPE(x) char*\n#endif\n#else                      /* GNU, Sun and other compilers */\n#define LDECLTYPE(x) __typeof(x)\n#endif\n\n/* for VS2008 we use some workarounds to get around the lack of decltype,\n * namely, we always reassign our tmp variable to the list head if we need\n * to dereference its prev/next pointers, and save/restore the real head.*/\n#ifdef NO_DECLTYPE\n#define _SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); }\n#define _NEXT(elt,list,next) ((char*)((list)->next))\n#define _NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); }\n/* #define _PREV(elt,list,prev) ((char*)((list)->prev)) */\n#define _PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); }\n#define _RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; }\n#define _CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); }\n#else \n#define _SV(elt,list)\n#define _NEXT(elt,list,next) ((elt)->next)\n#define _NEXTASGN(elt,list,to,next) ((elt)->next)=(to)\n/* #define _PREV(elt,list,prev) ((elt)->prev) */\n#define _PREVASGN(elt,list,to,prev) ((elt)->prev)=(to)\n#define _RS(list)\n#define _CASTASGN(a,b) (a)=(b)\n#endif\n\n/******************************************************************************\n * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort    *\n * Unwieldy variable names used here to avoid shadowing passed-in variables.  *\n *****************************************************************************/\n#define LL_SORT(list, cmp)                                                                     \\\n    LL_SORT2(list, cmp, next)\n\n#define LL_SORT2(list, cmp, next)                                                              \\\ndo {                                                                                           \\\n  LDECLTYPE(list) _ls_p;                                                                       \\\n  LDECLTYPE(list) _ls_q;                                                                       \\\n  LDECLTYPE(list) _ls_e;                                                                       \\\n  LDECLTYPE(list) _ls_tail;                                                                    \\\n  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \\\n  if (list) {                                                                                  \\\n    _ls_insize = 1;                                                                            \\\n    _ls_looping = 1;                                                                           \\\n    while (_ls_looping) {                                                                      \\\n      _CASTASGN(_ls_p,list);                                                                   \\\n      list = NULL;                                                                             \\\n      _ls_tail = NULL;                                                                         \\\n      _ls_nmerges = 0;                                                                         \\\n      while (_ls_p) {                                                                          \\\n        _ls_nmerges++;                                                                         \\\n        _ls_q = _ls_p;                                                                         \\\n        _ls_psize = 0;                                                                         \\\n        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \\\n          _ls_psize++;                                                                         \\\n          _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list);                          \\\n          if (!_ls_q) break;                                                                   \\\n        }                                                                                      \\\n        _ls_qsize = _ls_insize;                                                                \\\n        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \\\n          if (_ls_psize == 0) {                                                                \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q =                                            \\\n              _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--;                                  \\\n          } else if (_ls_qsize == 0 || !_ls_q) {                                               \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p =                                            \\\n              _NEXT(_ls_p,list,next); _RS(list); _ls_psize--;                                  \\\n          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p =                                            \\\n              _NEXT(_ls_p,list,next); _RS(list); _ls_psize--;                                  \\\n          } else {                                                                             \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q =                                            \\\n              _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--;                                  \\\n          }                                                                                    \\\n          if (_ls_tail) {                                                                      \\\n            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list);                \\\n          } else {                                                                             \\\n            _CASTASGN(list,_ls_e);                                                             \\\n          }                                                                                    \\\n          _ls_tail = _ls_e;                                                                    \\\n        }                                                                                      \\\n        _ls_p = _ls_q;                                                                         \\\n      }                                                                                        \\\n      if (_ls_tail) {                                                                          \\\n        _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list);                     \\\n      }                                                                                        \\\n      if (_ls_nmerges <= 1) {                                                                  \\\n        _ls_looping=0;                                                                         \\\n      }                                                                                        \\\n      _ls_insize *= 2;                                                                         \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0)\n\n\n#define DL_SORT(list, cmp)                                                                     \\\n    DL_SORT2(list, cmp, prev, next)\n\n#define DL_SORT2(list, cmp, prev, next)                                                        \\\ndo {                                                                                           \\\n  LDECLTYPE(list) _ls_p;                                                                       \\\n  LDECLTYPE(list) _ls_q;                                                                       \\\n  LDECLTYPE(list) _ls_e;                                                                       \\\n  LDECLTYPE(list) _ls_tail;                                                                    \\\n  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \\\n  if (list) {                                                                                  \\\n    _ls_insize = 1;                                                                            \\\n    _ls_looping = 1;                                                                           \\\n    while (_ls_looping) {                                                                      \\\n      _CASTASGN(_ls_p,list);                                                                   \\\n      list = NULL;                                                                             \\\n      _ls_tail = NULL;                                                                         \\\n      _ls_nmerges = 0;                                                                         \\\n      while (_ls_p) {                                                                          \\\n        _ls_nmerges++;                                                                         \\\n        _ls_q = _ls_p;                                                                         \\\n        _ls_psize = 0;                                                                         \\\n        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \\\n          _ls_psize++;                                                                         \\\n          _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list);                          \\\n          if (!_ls_q) break;                                                                   \\\n        }                                                                                      \\\n        _ls_qsize = _ls_insize;                                                                \\\n        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \\\n          if (_ls_psize == 0) {                                                                \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q =                                            \\\n              _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--;                                  \\\n          } else if (_ls_qsize == 0 || !_ls_q) {                                               \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p =                                            \\\n              _NEXT(_ls_p,list,next); _RS(list); _ls_psize--;                                  \\\n          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p =                                            \\\n              _NEXT(_ls_p,list,next); _RS(list); _ls_psize--;                                  \\\n          } else {                                                                             \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q =                                            \\\n              _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--;                                  \\\n          }                                                                                    \\\n          if (_ls_tail) {                                                                      \\\n            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list);                \\\n          } else {                                                                             \\\n            _CASTASGN(list,_ls_e);                                                             \\\n          }                                                                                    \\\n          _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list);                     \\\n          _ls_tail = _ls_e;                                                                    \\\n        }                                                                                      \\\n        _ls_p = _ls_q;                                                                         \\\n      }                                                                                        \\\n      _CASTASGN(list->prev, _ls_tail);                                                         \\\n      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list);                       \\\n      if (_ls_nmerges <= 1) {                                                                  \\\n        _ls_looping=0;                                                                         \\\n      }                                                                                        \\\n      _ls_insize *= 2;                                                                         \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0)\n\n#define CDL_SORT(list, cmp)                                                                    \\\n    CDL_SORT2(list, cmp, prev, next)\n\n#define CDL_SORT2(list, cmp, prev, next)                                                       \\\ndo {                                                                                           \\\n  LDECLTYPE(list) _ls_p;                                                                       \\\n  LDECLTYPE(list) _ls_q;                                                                       \\\n  LDECLTYPE(list) _ls_e;                                                                       \\\n  LDECLTYPE(list) _ls_tail;                                                                    \\\n  LDECLTYPE(list) _ls_oldhead;                                                                 \\\n  LDECLTYPE(list) _tmp;                                                                        \\\n  int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                       \\\n  if (list) {                                                                                  \\\n    _ls_insize = 1;                                                                            \\\n    _ls_looping = 1;                                                                           \\\n    while (_ls_looping) {                                                                      \\\n      _CASTASGN(_ls_p,list);                                                                   \\\n      _CASTASGN(_ls_oldhead,list);                                                             \\\n      list = NULL;                                                                             \\\n      _ls_tail = NULL;                                                                         \\\n      _ls_nmerges = 0;                                                                         \\\n      while (_ls_p) {                                                                          \\\n        _ls_nmerges++;                                                                         \\\n        _ls_q = _ls_p;                                                                         \\\n        _ls_psize = 0;                                                                         \\\n        for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                         \\\n          _ls_psize++;                                                                         \\\n          _SV(_ls_q,list);                                                                     \\\n          if (_NEXT(_ls_q,list,next) == _ls_oldhead) {                                         \\\n            _ls_q = NULL;                                                                      \\\n          } else {                                                                             \\\n            _ls_q = _NEXT(_ls_q,list,next);                                                    \\\n          }                                                                                    \\\n          _RS(list);                                                                           \\\n          if (!_ls_q) break;                                                                   \\\n        }                                                                                      \\\n        _ls_qsize = _ls_insize;                                                                \\\n        while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                    \\\n          if (_ls_psize == 0) {                                                                \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q =                                            \\\n              _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--;                                  \\\n            if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                        \\\n          } else if (_ls_qsize == 0 || !_ls_q) {                                               \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p =                                            \\\n              _NEXT(_ls_p,list,next); _RS(list); _ls_psize--;                                  \\\n            if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                        \\\n          } else if (cmp(_ls_p,_ls_q) <= 0) {                                                  \\\n            _ls_e = _ls_p; _SV(_ls_p,list); _ls_p =                                            \\\n              _NEXT(_ls_p,list,next); _RS(list); _ls_psize--;                                  \\\n            if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                        \\\n          } else {                                                                             \\\n            _ls_e = _ls_q; _SV(_ls_q,list); _ls_q =                                            \\\n              _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--;                                  \\\n            if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                        \\\n          }                                                                                    \\\n          if (_ls_tail) {                                                                      \\\n            _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list);                \\\n          } else {                                                                             \\\n            _CASTASGN(list,_ls_e);                                                             \\\n          }                                                                                    \\\n          _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list);                     \\\n          _ls_tail = _ls_e;                                                                    \\\n        }                                                                                      \\\n        _ls_p = _ls_q;                                                                         \\\n      }                                                                                        \\\n      _CASTASGN(list->prev,_ls_tail);                                                          \\\n      _CASTASGN(_tmp,list);                                                                    \\\n      _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp,next); _RS(list);                       \\\n      if (_ls_nmerges <= 1) {                                                                  \\\n        _ls_looping=0;                                                                         \\\n      }                                                                                        \\\n      _ls_insize *= 2;                                                                         \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0)\n\n/******************************************************************************\n * singly linked list macros (non-circular)                                   *\n *****************************************************************************/\n#define LL_PREPEND(head,add)                                                                   \\\n    LL_PREPEND2(head,add,next)\n\n#define LL_PREPEND2(head,add,next)                                                             \\\ndo {                                                                                           \\\n  (add)->next = head;                                                                          \\\n  head = add;                                                                                  \\\n} while (0)\n\n#define LL_CONCAT(head1,head2)                                                                 \\\n    LL_CONCAT2(head1,head2,next)\n\n#define LL_CONCAT2(head1,head2,next)                                                           \\\ndo {                                                                                           \\\n  LDECLTYPE(head1) _tmp;                                                                       \\\n  if (head1) {                                                                                 \\\n    _tmp = head1;                                                                              \\\n    while (_tmp->next) { _tmp = _tmp->next; }                                                  \\\n    _tmp->next=(head2);                                                                        \\\n  } else {                                                                                     \\\n    (head1)=(head2);                                                                           \\\n  }                                                                                            \\\n} while (0)\n\n#define LL_APPEND(head,add)                                                                    \\\n    LL_APPEND2(head,add,next)\n\n#define LL_APPEND2(head,add,next)                                                              \\\ndo {                                                                                           \\\n  LDECLTYPE(head) _tmp;                                                                        \\\n  (add)->next=NULL;                                                                            \\\n  if (head) {                                                                                  \\\n    _tmp = head;                                                                               \\\n    while (_tmp->next) { _tmp = _tmp->next; }                                                  \\\n    _tmp->next=(add);                                                                          \\\n  } else {                                                                                     \\\n    (head)=(add);                                                                              \\\n  }                                                                                            \\\n} while (0)\n\n#define LL_DELETE(head,del)                                                                    \\\n    LL_DELETE2(head,del,next)\n\n#define LL_DELETE2(head,del,next)                                                              \\\ndo {                                                                                           \\\n  LDECLTYPE(head) _tmp;                                                                        \\\n  if ((head) == (del)) {                                                                       \\\n    (head)=(head)->next;                                                                       \\\n  } else {                                                                                     \\\n    _tmp = head;                                                                               \\\n    while (_tmp->next && (_tmp->next != (del))) {                                              \\\n      _tmp = _tmp->next;                                                                       \\\n    }                                                                                          \\\n    if (_tmp->next) {                                                                          \\\n      _tmp->next = ((del)->next);                                                              \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0)\n\n/* Here are VS2008 replacements for LL_APPEND and LL_DELETE */\n#define LL_APPEND_VS2008(head,add)                                                             \\\n    LL_APPEND2_VS2008(head,add,next)\n\n#define LL_APPEND2_VS2008(head,add,next)                                                       \\\ndo {                                                                                           \\\n  if (head) {                                                                                  \\\n    (add)->next = head;     /* use add->next as a temp variable */                             \\\n    while ((add)->next->next) { (add)->next = (add)->next->next; }                             \\\n    (add)->next->next=(add);                                                                   \\\n  } else {                                                                                     \\\n    (head)=(add);                                                                              \\\n  }                                                                                            \\\n  (add)->next=NULL;                                                                            \\\n} while (0)\n\n#define LL_DELETE_VS2008(head,del)                                                             \\\n    LL_DELETE2_VS2008(head,del,next)\n\n#define LL_DELETE2_VS2008(head,del,next)                                                       \\\ndo {                                                                                           \\\n  if ((head) == (del)) {                                                                       \\\n    (head)=(head)->next;                                                                       \\\n  } else {                                                                                     \\\n    char *_tmp = (char*)(head);                                                                \\\n    while ((head)->next && ((head)->next != (del))) {                                          \\\n      head = (head)->next;                                                                     \\\n    }                                                                                          \\\n    if ((head)->next) {                                                                        \\\n      (head)->next = ((del)->next);                                                            \\\n    }                                                                                          \\\n    {                                                                                          \\\n      char **_head_alias = (char**)&(head);                                                    \\\n      *_head_alias = _tmp;                                                                     \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0)\n#ifdef NO_DECLTYPE\n#undef LL_APPEND\n#define LL_APPEND LL_APPEND_VS2008\n#undef LL_DELETE\n#define LL_DELETE LL_DELETE_VS2008\n#undef LL_DELETE2\n#define LL_DELETE2_VS2008\n#undef LL_APPEND2\n#define LL_APPEND2 LL_APPEND2_VS2008\n#undef LL_CONCAT /* no LL_CONCAT_VS2008 */\n#undef DL_CONCAT /* no DL_CONCAT_VS2008 */\n#endif\n/* end VS2008 replacements */\n\n#define LL_FOREACH(head,el)                                                                    \\\n    LL_FOREACH2(head,el,next)\n\n#define LL_FOREACH2(head,el,next)                                                              \\\n    for(el=head;el;el=(el)->next)\n\n#define LL_FOREACH_SAFE(head,el,tmp)                                                           \\\n    LL_FOREACH_SAFE2(head,el,tmp,next)\n\n#define LL_FOREACH_SAFE2(head,el,tmp,next)                                                     \\\n  for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)\n\n#define LL_SEARCH_SCALAR(head,out,field,val)                                                   \\\n    LL_SEARCH_SCALAR2(head,out,field,val,next)\n\n#define LL_SEARCH_SCALAR2(head,out,field,val,next)                                             \\\ndo {                                                                                           \\\n    LL_FOREACH2(head,out,next) {                                                               \\\n      if ((out)->field == (val)) break;                                                        \\\n    }                                                                                          \\\n} while(0) \n\n#define LL_SEARCH(head,out,elt,cmp)                                                            \\\n    LL_SEARCH2(head,out,elt,cmp,next)\n\n#define LL_SEARCH2(head,out,elt,cmp,next)                                                      \\\ndo {                                                                                           \\\n    LL_FOREACH2(head,out,next) {                                                               \\\n      if ((cmp(out,elt))==0) break;                                                            \\\n    }                                                                                          \\\n} while(0) \n\n#define LL_REPLACE_ELEM(head, el, add)                                                         \\\ndo {                                                                                           \\\n LDECLTYPE(head) _tmp;                                                                         \\\n assert(head != NULL);                                                                         \\\n assert(el != NULL);                                                                           \\\n assert(add != NULL);                                                                          \\\n (add)->next = (el)->next;                                                                     \\\n if ((head) == (el)) {                                                                         \\\n  (head) = (add);                                                                              \\\n } else {                                                                                      \\\n  _tmp = head;                                                                                 \\\n  while (_tmp->next && (_tmp->next != (el))) {                                                 \\\n   _tmp = _tmp->next;                                                                          \\\n  }                                                                                            \\\n  if (_tmp->next) {                                                                            \\\n    _tmp->next = (add);                                                                        \\\n  }                                                                                            \\\n }                                                                                             \\\n} while (0)\n\n#define LL_PREPEND_ELEM(head, el, add)                                                         \\\ndo {                                                                                           \\\n LDECLTYPE(head) _tmp;                                                                         \\\n assert(head != NULL);                                                                         \\\n assert(el != NULL);                                                                           \\\n assert(add != NULL);                                                                          \\\n (add)->next = (el);                                                                           \\\n if ((head) == (el)) {                                                                         \\\n  (head) = (add);                                                                              \\\n } else {                                                                                      \\\n  _tmp = head;                                                                                 \\\n  while (_tmp->next && (_tmp->next != (el))) {                                                 \\\n   _tmp = _tmp->next;                                                                          \\\n  }                                                                                            \\\n  if (_tmp->next) {                                                                            \\\n    _tmp->next = (add);                                                                        \\\n  }                                                                                            \\\n }                                                                                             \\\n} while (0)                                                                                    \\\n\n\n/******************************************************************************\n * doubly linked list macros (non-circular)                                   *\n *****************************************************************************/\n#define DL_PREPEND(head,add)                                                                   \\\n    DL_PREPEND2(head,add,prev,next)\n\n#define DL_PREPEND2(head,add,prev,next)                                                        \\\ndo {                                                                                           \\\n (add)->next = head;                                                                           \\\n if (head) {                                                                                   \\\n   (add)->prev = (head)->prev;                                                                 \\\n   (head)->prev = (add);                                                                       \\\n } else {                                                                                      \\\n   (add)->prev = (add);                                                                        \\\n }                                                                                             \\\n (head) = (add);                                                                               \\\n} while (0)\n\n#define DL_APPEND(head,add)                                                                    \\\n    DL_APPEND2(head,add,prev,next)\n\n#define DL_APPEND2(head,add,prev,next)                                                         \\\ndo {                                                                                           \\\n  if (head) {                                                                                  \\\n      (add)->prev = (head)->prev;                                                              \\\n      (head)->prev->next = (add);                                                              \\\n      (head)->prev = (add);                                                                    \\\n      (add)->next = NULL;                                                                      \\\n  } else {                                                                                     \\\n      (head)=(add);                                                                            \\\n      (head)->prev = (head);                                                                   \\\n      (head)->next = NULL;                                                                     \\\n  }                                                                                            \\\n} while (0) \n\n#define DL_CONCAT(head1,head2)                                                                 \\\n    DL_CONCAT2(head1,head2,prev,next)\n\n#define DL_CONCAT2(head1,head2,prev,next)                                                      \\\ndo {                                                                                           \\\n  LDECLTYPE(head1) _tmp;                                                                       \\\n  if (head2) {                                                                                 \\\n    if (head1) {                                                                               \\\n        _tmp = (head2)->prev;                                                                  \\\n        (head2)->prev = (head1)->prev;                                                         \\\n        (head1)->prev->next = (head2);                                                         \\\n        (head1)->prev = _tmp;                                                                  \\\n    } else {                                                                                   \\\n        (head1)=(head2);                                                                       \\\n    }                                                                                          \\\n  }                                                                                            \\\n} while (0) \n\n#define DL_DELETE(head,del)                                                                    \\\n    DL_DELETE2(head,del,prev,next)\n\n#define DL_DELETE2(head,del,prev,next)                                                         \\\ndo {                                                                                           \\\n  assert((del)->prev != NULL);                                                                 \\\n  if ((del)->prev == (del)) {                                                                  \\\n      (head)=NULL;                                                                             \\\n  } else if ((del)==(head)) {                                                                  \\\n      (del)->next->prev = (del)->prev;                                                         \\\n      (head) = (del)->next;                                                                    \\\n  } else {                                                                                     \\\n      (del)->prev->next = (del)->next;                                                         \\\n      if ((del)->next) {                                                                       \\\n          (del)->next->prev = (del)->prev;                                                     \\\n      } else {                                                                                 \\\n          (head)->prev = (del)->prev;                                                          \\\n      }                                                                                        \\\n  }                                                                                            \\\n} while (0) \n\n\n#define DL_FOREACH(head,el)                                                                    \\\n    DL_FOREACH2(head,el,next)\n\n#define DL_FOREACH2(head,el,next)                                                              \\\n    for(el=head;el;el=(el)->next)\n\n/* this version is safe for deleting the elements during iteration */\n#define DL_FOREACH_SAFE(head,el,tmp)                                                           \\\n    DL_FOREACH_SAFE2(head,el,tmp,next)\n\n#define DL_FOREACH_SAFE2(head,el,tmp,next)                                                     \\\n  for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)\n\n/* these are identical to their singly-linked list counterparts */\n#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR\n#define DL_SEARCH LL_SEARCH\n#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2\n#define DL_SEARCH2 LL_SEARCH2\n\n#define DL_REPLACE_ELEM(head, el, add)                                                         \\\ndo {                                                                                           \\\n assert(head != NULL);                                                                         \\\n assert(el != NULL);                                                                           \\\n assert(add != NULL);                                                                          \\\n if ((head) == (el)) {                                                                         \\\n  (head) = (add);                                                                              \\\n  (add)->next = (el)->next;                                                                    \\\n  if ((el)->next == NULL) {                                                                    \\\n   (add)->prev = (add);                                                                        \\\n  } else {                                                                                     \\\n   (add)->prev = (el)->prev;                                                                   \\\n   (add)->next->prev = (add);                                                                  \\\n  }                                                                                            \\\n } else {                                                                                      \\\n  (add)->next = (el)->next;                                                                    \\\n  (add)->prev = (el)->prev;                                                                    \\\n  (add)->prev->next = (add);                                                                   \\\n  if ((el)->next == NULL) {                                                                    \\\n   (head)->prev = (add);                                                                       \\\n  } else {                                                                                     \\\n   (add)->next->prev = (add);                                                                  \\\n  }                                                                                            \\\n }                                                                                             \\\n} while (0)\n\n#define DL_PREPEND_ELEM(head, el, add)                                                         \\\ndo {                                                                                           \\\n assert(head != NULL);                                                                         \\\n assert(el != NULL);                                                                           \\\n assert(add != NULL);                                                                          \\\n (add)->next = (el);                                                                           \\\n (add)->prev = (el)->prev;                                                                     \\\n (el)->prev = (add);                                                                           \\\n if ((head) == (el)) {                                                                         \\\n  (head) = (add);                                                                              \\\n } else {                                                                                      \\\n  (add)->prev->next = (add);                                                                   \\\n }                                                                                             \\\n} while (0)                                                                                    \\\n\n\n/******************************************************************************\n * circular doubly linked list macros                                         *\n *****************************************************************************/\n#define CDL_PREPEND(head,add)                                                                  \\\n    CDL_PREPEND2(head,add,prev,next)\n\n#define CDL_PREPEND2(head,add,prev,next)                                                       \\\ndo {                                                                                           \\\n if (head) {                                                                                   \\\n   (add)->prev = (head)->prev;                                                                 \\\n   (add)->next = (head);                                                                       \\\n   (head)->prev = (add);                                                                       \\\n   (add)->prev->next = (add);                                                                  \\\n } else {                                                                                      \\\n   (add)->prev = (add);                                                                        \\\n   (add)->next = (add);                                                                        \\\n }                                                                                             \\\n(head)=(add);                                                                                  \\\n} while (0)\n\n#define CDL_DELETE(head,del)                                                                   \\\n    CDL_DELETE2(head,del,prev,next)\n\n#define CDL_DELETE2(head,del,prev,next)                                                        \\\ndo {                                                                                           \\\n  if ( ((head)==(del)) && ((head)->next == (head))) {                                          \\\n      (head) = 0L;                                                                             \\\n  } else {                                                                                     \\\n     (del)->next->prev = (del)->prev;                                                          \\\n     (del)->prev->next = (del)->next;                                                          \\\n     if ((del) == (head)) (head)=(del)->next;                                                  \\\n  }                                                                                            \\\n} while (0) \n\n#define CDL_FOREACH(head,el)                                                                   \\\n    CDL_FOREACH2(head,el,next)\n\n#define CDL_FOREACH2(head,el,next)                                                             \\\n    for(el=head;el;el=((el)->next==head ? 0L : (el)->next)) \n\n#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2)                                                    \\\n    CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next)\n\n#define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next)                                         \\\n  for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL);                                        \\\n      (el) && ((tmp2)=(el)->next, 1);                                                          \\\n      ((el) = (((el)==(tmp1)) ? 0L : (tmp2))))\n\n#define CDL_SEARCH_SCALAR(head,out,field,val)                                                  \\\n    CDL_SEARCH_SCALAR2(head,out,field,val,next)\n\n#define CDL_SEARCH_SCALAR2(head,out,field,val,next)                                            \\\ndo {                                                                                           \\\n    CDL_FOREACH2(head,out,next) {                                                              \\\n      if ((out)->field == (val)) break;                                                        \\\n    }                                                                                          \\\n} while(0) \n\n#define CDL_SEARCH(head,out,elt,cmp)                                                           \\\n    CDL_SEARCH2(head,out,elt,cmp,next)\n\n#define CDL_SEARCH2(head,out,elt,cmp,next)                                                     \\\ndo {                                                                                           \\\n    CDL_FOREACH2(head,out,next) {                                                              \\\n      if ((cmp(out,elt))==0) break;                                                            \\\n    }                                                                                          \\\n} while(0) \n\n#define CDL_REPLACE_ELEM(head, el, add)                                                        \\\ndo {                                                                                           \\\n assert(head != NULL);                                                                         \\\n assert(el != NULL);                                                                           \\\n assert(add != NULL);                                                                          \\\n if ((el)->next == (el)) {                                                                     \\\n  (add)->next = (add);                                                                         \\\n  (add)->prev = (add);                                                                         \\\n  (head) = (add);                                                                              \\\n } else {                                                                                      \\\n  (add)->next = (el)->next;                                                                    \\\n  (add)->prev = (el)->prev;                                                                    \\\n  (add)->next->prev = (add);                                                                   \\\n  (add)->prev->next = (add);                                                                   \\\n  if ((head) == (el)) {                                                                        \\\n   (head) = (add);                                                                             \\\n  }                                                                                            \\\n }                                                                                             \\\n} while (0)\n\n#define CDL_PREPEND_ELEM(head, el, add)                                                        \\\ndo {                                                                                           \\\n assert(head != NULL);                                                                         \\\n assert(el != NULL);                                                                           \\\n assert(add != NULL);                                                                          \\\n (add)->next = (el);                                                                           \\\n (add)->prev = (el)->prev;                                                                     \\\n (el)->prev = (add);                                                                           \\\n (add)->prev->next = (add);                                                                    \\\n if ((head) == (el)) {                                                                         \\\n  (head) = (add);                                                                              \\\n }                                                                                             \\\n} while (0)                                                                                    \\\n\n#endif /* UTLIST_H */\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/CMakeLists.txt",
    "content": "# architecture\nif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )\nset(ARCH_DIR \"64-bit\")\nelse()\nset(ARCH_DIR \"32-bit\")\nendif()\n\nif(WIN32)\n  set(AUDIO_SRC\n    win32/SimpleAudioEngine.cpp\n    win32/MciPlayer.cpp\n  )\nelseif(APPLE)\n\nelse()\n  set(AUDIO_SRC\n    linux/SimpleAudioEngineFMOD.cpp\n    linux/FmodAudioPlayer.cpp\n  )\n\n  include_directories(\n    ../../external/linux-specific/fmod/include/${ARCH_DIR}\n  )\n\nendif()\n\nadd_library(audio STATIC\n  ${AUDIO_SRC}\n)\n\nif((NOT APPLE) AND (NOT WIN32))\n\nif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )\nset(FMOD_LIB \"fmodex64\")\nelse()\nset(FMOD_LIB \"fmodex\")\nendif()\n\ntarget_link_libraries(audio\n  ${FMOD_LIB}\n)\n\nset_target_properties(audio\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\nelseif(WIN32)\n\ntarget_link_libraries(audio\n  Winmm\n)\n\nendif()\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocosdenshion_static\n\nLOCAL_MODULE_FILENAME := libcocosdenshion\n\nLOCAL_SRC_FILES := cddSimpleAudioEngine.cpp \\\n                   ccdandroidUtils.cpp \\\n                   jni/cddandroidAndroidJavaEngine.cpp \\\n                   opensl/cddandroidOpenSLEngine.cpp\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../include\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../include \\\n                    $(LOCAL_PATH)/../../math/kazmath/include \\\n                    $(LOCAL_PATH)/../../2d \\\n                    $(LOCAL_PATH)/../../2d/platform/android \\\n                    $(LOCAL_PATH)/../../base \\\n                    $(LOCAL_PATH)/../../physics\n\nLOCAL_CFLAGS += -Wno-psabi\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\ninclude $(BUILD_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/ccdandroidUtils.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ccdandroidUtils.h\"\n#include \"cocos2d.h\"\n\n#include <jni.h>\n#include <android/log.h>\n#include \"jni/JniHelper.h\"\n\nUSING_NS_CC;\n\nnamespace CocosDenshion {\n    namespace android {\n\n#define  I9100_MODEL \"GT-I9100\"\n#define  LOG_TAG     \"Device Model\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n#define  CLASS_NAME   \"org/cocos2dx/lib/Cocos2dxHelper\"\n#define  METHOD_NAME  \"getDeviceModel\"\n\n        bool is_buggy_device(void) {\n            JniMethodInfo methodInfo;\n            jstring jstr;\n            if (JniHelper::getStaticMethodInfo(methodInfo,\n                                               CLASS_NAME,\n                                               METHOD_NAME,\n                                               \"()Ljava/lang/String;\")) {\n                jstr = (jstring)methodInfo.env->CallStaticObjectMethod(methodInfo.classID,\n                                                                       methodInfo.methodID);\n            }\n\t\n            const char* deviceModel = methodInfo.env->GetStringUTFChars(jstr, NULL);\n            if (NULL == deviceModel) {\n                return false;\n            }\n\n            LOGD(\"deviceModel = %s\", deviceModel);\n            methodInfo.env->ReleaseStringUTFChars(jstr, deviceModel);\n            methodInfo.env->DeleteLocalRef(jstr);\n    \n            if (strcmp(I9100_MODEL, deviceModel) == 0) {\n                LOGD(\"i9100 model\\nSwitch to OpenSLES\");\n                return true;\n            }\n\n            return false;\n        }\n\n        std::string getFullPathWithoutAssetsPrefix(const char* pszFilename) {\n            // Changing file path to full path\n            std::string fullPath = cocos2d::FileUtils::getInstance()->fullPathForFilename(pszFilename);\n            // Removing `assets` since it isn't needed for the API of playing sound.\n            size_t pos = fullPath.find(\"assets/\");\n            if (pos == 0)\n                {\n                    fullPath = fullPath.substr(strlen(\"assets/\"));\n                }\n            return fullPath;\n        }\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/ccdandroidUtils.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCDANDROIDUTILS_H__\n#define __CCDANDROIDUTILS_H__\n\n#include <string>\n\nnamespace CocosDenshion {\n    namespace android {\n        bool is_buggy_device(void);\n        std::string getFullPathWithoutAssetsPrefix(const char* pszFilename);\n    }\n}\n\n#endif //__CCDANDROIDUTILS_H__\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/cddSimpleAudioEngine.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"SimpleAudioEngine.h\"\n#include \"jni/cddandroidAndroidJavaEngine.h\"\n#include \"opensl/cddandroidOpenSLEngine.h\"\n#include \"ccdandroidUtils.h\"\n\nnamespace CocosDenshion {\n\n    static SimpleAudioEngine *s_pEngine = 0;\n\n    SimpleAudioEngine* SimpleAudioEngine::getInstance() {\n        if (! s_pEngine) {\n            // if (CocosDenshion::android::is_buggy_device()) {\n                // use the Java Audio implementation until compatibility is confirmed\n                s_pEngine = new CocosDenshion::android::AndroidJavaEngine();\n            // } else {\n            //     s_pEngine = new CocosDenshion::android::OpenSLEngine();\n            // }\n        }\n    \n        return s_pEngine;\n    }\n\n    void SimpleAudioEngine::end() {\n        if (s_pEngine) {\n            delete s_pEngine;\n            s_pEngine = NULL;\n        }\n    }\n\n    SimpleAudioEngine::SimpleAudioEngine() {\n    }\n\n    SimpleAudioEngine::~SimpleAudioEngine() {\n    }\n\n    // Empty implementations. On Android, only subclasses are meant to be used\n    void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath) { }\n    void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) { }\n    void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) { }\n    void SimpleAudioEngine::pauseBackgroundMusic() { }\n    void SimpleAudioEngine::resumeBackgroundMusic() { }\n    void SimpleAudioEngine::rewindBackgroundMusic() { }\n    bool SimpleAudioEngine::willPlayBackgroundMusic() { return false; }\n    bool SimpleAudioEngine::isBackgroundMusicPlaying() { return false; }\n    float SimpleAudioEngine::getBackgroundMusicVolume() { return 0.0f; }\n    void SimpleAudioEngine::setBackgroundMusicVolume(float volume) { }\n    float SimpleAudioEngine::getEffectsVolume() { return 0.0f; }\n    void SimpleAudioEngine::setEffectsVolume(float volume) { }\n    unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath,\n                                               bool bLoop,\n                                               float pitch,\n                                               float pan,\n                                               float gain) {\n        return 0; }\n    void SimpleAudioEngine::pauseEffect(unsigned int nSoundId) { }\n    void SimpleAudioEngine::pauseAllEffects() { }\n    void SimpleAudioEngine::resumeEffect(unsigned int nSoundId) { }\n    void SimpleAudioEngine::resumeAllEffects() { }\n    void SimpleAudioEngine::stopEffect(unsigned int nSoundId) { }\n    void SimpleAudioEngine::stopAllEffects() { }\n    void SimpleAudioEngine::preloadEffect(const char* pszFilePath) { }\n    void SimpleAudioEngine::unloadEffect(const char* pszFilePath) { }\n}\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cddandroidAndroidJavaEngine.h\"\n#include \"platform/android/jni/JniHelper.h\"\n#include \"ccdandroidUtils.h\"\n#include <android/log.h>\n#include <jni.h>\n\n// logging\n#define  LOG_TAG    \"cocosdenshion::android::AndroidJavaEngine\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\n// Java class\n#define  CLASS_NAME \"org/cocos2dx/lib/Cocos2dxHelper\"\n\nnamespace CocosDenshion {\n    namespace android {\n\n        bool AndroidJavaEngine::getJNIStaticMethodInfo(cocos2d::JniMethodInfo &methodinfo,\n                                                       const char *methodName,\n                                                       const char *paramCode) {\n            return cocos2d::JniHelper::getStaticMethodInfo(methodinfo,\n                                                           CLASS_NAME,\n                                                           methodName,\n                                                           paramCode);\n        }\n\n        AndroidJavaEngine::~AndroidJavaEngine() {\n            cocos2d::JniMethodInfo methodInfo;\n\n            if (!getJNIStaticMethodInfo(methodInfo, \"end\", \"()V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::preloadBackgroundMusic(const char* pszFilePath) {\n            std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(pszFilePath);\n\n            // void playBackgroundMusic(String,boolean)\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"preloadBackgroundMusic\", \"(Ljava/lang/String;)V\")) {\n                return;\n            }\n        \n            jstring stringArg = methodInfo.env->NewStringUTF(fullPath.c_str());\n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, stringArg);\n            methodInfo.env->DeleteLocalRef(stringArg);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) {\n            std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(pszFilePath);\n        \n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"playBackgroundMusic\", \"(Ljava/lang/String;Z)V\")) {\n                return;\n            }\n        \n            jstring stringArg = methodInfo.env->NewStringUTF(fullPath.c_str());\n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, stringArg, bLoop);\n            methodInfo.env->DeleteLocalRef(stringArg);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::stopBackgroundMusic(bool bReleaseData) {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"stopBackgroundMusic\", \"()V\")) {\n                return;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::pauseBackgroundMusic() {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"pauseBackgroundMusic\", \"()V\")) {\n                return;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::resumeBackgroundMusic() {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"resumeBackgroundMusic\", \"()V\")) {\n                return;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::rewindBackgroundMusic() {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"rewindBackgroundMusic\", \"()V\")) {\n                return;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n\n        bool AndroidJavaEngine::willPlayBackgroundMusic() {\n            return true;\n        }\n\n        bool AndroidJavaEngine::isBackgroundMusicPlaying() {\n            cocos2d::JniMethodInfo methodInfo;\n            jboolean ret = false;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"isBackgroundMusicPlaying\", \"()Z\")) {\n                return ret;\n            }\n        \n            ret = methodInfo.env->CallStaticBooleanMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        \n            return ret;\n        }\n\n        float AndroidJavaEngine::getBackgroundMusicVolume() {\n            cocos2d::JniMethodInfo methodInfo;\n            jfloat ret = -1.0;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"getBackgroundMusicVolume\", \"()F\")) {\n                return ret;\n            }\n        \n            ret = methodInfo.env->CallStaticFloatMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        \n            return ret;\n        }\n\n        void AndroidJavaEngine::setBackgroundMusicVolume(float volume) {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"setBackgroundMusicVolume\", \"(F)V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, volume);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        float AndroidJavaEngine::getEffectsVolume() {\n            cocos2d::JniMethodInfo methodInfo;\n            jfloat ret = -1.0;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"getEffectsVolume\", \"()F\")) {\n                return ret;\n            }\n        \n            ret = methodInfo.env->CallStaticFloatMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        \n            return ret;\n        }\n\n        void AndroidJavaEngine::setEffectsVolume(float volume) {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"setEffectsVolume\", \"(F)V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, volume);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        unsigned int AndroidJavaEngine::playEffect(const char* pszFilePath, bool bLoop,\n                                                   float pitch, float pan, float gain) {\n            cocos2d::JniMethodInfo methodInfo;\n            int ret = 0;\n            std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(pszFilePath);\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"playEffect\", \"(Ljava/lang/String;ZFFF)I\")) {\n                return ret;\n            }\n        \n            jstring stringArg = methodInfo.env->NewStringUTF(fullPath.c_str());\n            ret = methodInfo.env->CallStaticIntMethod(methodInfo.classID,\n                                                      methodInfo.methodID,\n                                                      stringArg,\n                                                      bLoop,\n                                                      pitch, pan, gain);\n            methodInfo.env->DeleteLocalRef(stringArg);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        \n            return (unsigned int)ret;\n        }\n\n        void AndroidJavaEngine::pauseEffect(unsigned int nSoundId) {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"pauseEffect\", \"(I)V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, (int)nSoundId);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::pauseAllEffects() {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"pauseAllEffects\", \"()V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::resumeEffect(unsigned int nSoundId) {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"resumeEffect\", \"(I)V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, (int)nSoundId);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::resumeAllEffects() {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"resumeAllEffects\", \"()V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::stopEffect(unsigned int nSoundId) {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"stopEffect\", \"(I)V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, (int)nSoundId);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::stopAllEffects() {\n            cocos2d::JniMethodInfo methodInfo;\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"stopAllEffects\", \"()V\")) {\n                return ;\n            }\n        \n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::preloadEffect(const char* pszFilePath) {\n            cocos2d::JniMethodInfo methodInfo;\n            std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(pszFilePath);\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"preloadEffect\", \"(Ljava/lang/String;)V\")) {\n                return ;\n            }\n        \n            jstring stringArg = methodInfo.env->NewStringUTF(fullPath.c_str());\n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, stringArg);\n            methodInfo.env->DeleteLocalRef(stringArg);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n\n        void AndroidJavaEngine::unloadEffect(const char* pszFilePath) {\n            cocos2d::JniMethodInfo methodInfo;\n            std::string fullPath = CocosDenshion::android::getFullPathWithoutAssetsPrefix(pszFilePath);\n        \n            if (! getJNIStaticMethodInfo(methodInfo, \"unloadEffect\", \"(Ljava/lang/String;)V\")) {\n                return ;\n            }\n        \n            jstring stringArg = methodInfo.env->NewStringUTF(fullPath.c_str());\n            methodInfo.env->CallStaticVoidMethod(methodInfo.classID, methodInfo.methodID, stringArg);\n            methodInfo.env->DeleteLocalRef(stringArg);\n            methodInfo.env->DeleteLocalRef(methodInfo.classID);\n        }\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/jni/cddandroidAndroidJavaEngine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CDDANDRIODANDROIDJAVAENGINE_H__\n#define __CDDANDRIODANDROIDJAVAENGINE_H__\n\n#include \"SimpleAudioEngine.h\"\n#include \"platform/android/jni/JniHelper.h\"\n\nnamespace CocosDenshion {\n    namespace android {\n        class AndroidJavaEngine : public SimpleAudioEngine {\n            ~AndroidJavaEngine();\n\n            void preloadBackgroundMusic(const char* pszFilePath);\n            void playBackgroundMusic(const char* pszFilePath, bool bLoop);\n            void stopBackgroundMusic(bool bReleaseData);\n            void pauseBackgroundMusic();\n            void resumeBackgroundMusic();\n            void rewindBackgroundMusic();\n            bool willPlayBackgroundMusic();\n            bool isBackgroundMusicPlaying();\n            float getBackgroundMusicVolume();\n            void setBackgroundMusicVolume(float volume);\n            float getEffectsVolume();\n            void setEffectsVolume(float volume);\n            unsigned int playEffect(const char* pszFilePath, bool bLoop = false,\n                                    float pitch = 1.0f, float pan = 0.0f, float gain = 1.0f);\n            void pauseEffect(unsigned int nSoundId);\n            void pauseAllEffects();\n            void resumeEffect(unsigned int nSoundId);\n            void resumeAllEffects();\n            void stopEffect(unsigned int nSoundId);\n            void stopAllEffects();\n            void preloadEffect(const char* pszFilePath);\n            void unloadEffect(const char* pszFilePath);\n\n        private :\n            static bool getJNIStaticMethodInfo(cocos2d::JniMethodInfo &methodinfo,\n                                               const char *methodName,\n                                               const char *paramCode);\n        };\n    }\n}\n\n#endif //__CDDANDRIODANDROIDJAVAENGINE_H__\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/opensl/OpenSLEngine.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"OpenSLEngine.h\"\n\n#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,\"OPENSL_ENGINE.CPP\", __VA_ARGS__)\n\nusing namespace std;\n\n\nOpenSLEngine::OpenSLEngine()\n :_musicVolume(0),\n  _effectVolume(0)\n{}\n\nOpenSLEngine::~OpenSLEngine()\n{\n\tcloseEngine();\n}\n\n/**********************************************************************************\n *   jni\n **********************************************************************************/\n#define  CLASS_NAME \"org/cocos2dx/lib/Cocos2dxHelper\"\n\ntypedef struct JniMethodInfo_\n{\n\tJNIEnv *    env;\n\tjclass      classID;\n\tjmethodID   methodID;\n} JniMethodInfo;\n\nextern \"C\" {\n\tstatic JNIEnv* getJNIEnv(void)\n\t{\n\n\t\tJavaVM* jvm = cocos2d::JniHelper::getJavaVM();\n\t\tif (NULL == jvm) {\n\t\t\tLOGD(\"Failed to get JNIEnv. JniHelper::getJavaVM() is NULL\");\n\t\t\treturn NULL;\n\t\t}\n\n\t\tJNIEnv *env = NULL;\n\t\t// get jni environment\n\t\tjint ret = jvm->GetEnv((void**)&env, JNI_VERSION_1_4);\n\n\t\tswitch (ret) {\n\t\tcase JNI_OK :\n\t\t\t// Success!\n\t\t\treturn env;\n\n\t\tcase JNI_EDETACHED :\n\t\t\t// Thread not attached\n\n\t\t\t// TODO : If calling AttachCurrentThread() on a native thread\n\t\t\t// must call DetachCurrentThread() in future.\n\t\t\t// see: http://developer.android.com/guide/practices/design/jni.html\n\n\t\t\tif (jvm->AttachCurrentThread(&env, NULL) < 0)\n\t\t\t{\n\t\t\t\tLOGD(\"Failed to get the environment using AttachCurrentThread()\");\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t\t\t\t// Success : Attached and obtained JNIEnv!\n\t\t\t\treturn env;\n\t\t\t}\n\n\t\tcase JNI_EVERSION :\n\t\t\t// Cannot recover from this error\n\t\t\tLOGD(\"JNI interface version 1.4 not supported\");\n\t\tdefault :\n\t\t\tLOGD(\"Failed to get the environment using GetEnv()\");\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tstatic jclass getClassID(JNIEnv *pEnv)\n\t{\n\t\tjclass ret = pEnv->FindClass(CLASS_NAME);\n\t\tif (! ret)\n\t\t{\n\t\t\tLOGD(\"Failed to find class of %s\", CLASS_NAME);\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tstatic bool getStaticMethodInfo(JniMethodInfo &methodinfo, const char *methodName, const char *paramCode)\n\t{\n\t\tjmethodID methodID = 0;\n\t\tJNIEnv *pEnv = 0;\n\t\tbool bRet = false;\n\n\t\tdo \n\t\t{\n\t\t\tpEnv = getJNIEnv();\n\t\t\tif (! pEnv)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tjclass classID = getClassID(pEnv);\n\n\t\t\tmethodID = pEnv->GetStaticMethodID(classID, methodName, paramCode);\n\t\t\tif (! methodID)\n\t\t\t{\n\t\t\t\tLOGD(\"Failed to find static method id of %s\", methodName);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tmethodinfo.classID = classID;\n\t\t\tmethodinfo.env = pEnv;\n\t\t\tmethodinfo.methodID = methodID;\n\n\t\t\tbRet = true;\n\t\t} while (0);\n\n\t\treturn bRet;\n\t}\n};\n\n\n/*********************************************************************************\n *   helper\n ********************************************************************************/\n#define PLAYSTATE_UNKNOWN 0\n#define FILE_NOT_FOUND -1\n\n#define ASSET_MANAGER_GETTER \"getAssetManager\"\n#define LIBANDROID \"libandroid.so\"\n\n#define MIN_VOLUME_MILLIBEL -4000\n#define MAX_VOLUME_MILLIBEL 0\n#define RANGE_VOLUME_MILLIBEL 4000\n\nclass AudioPlayer\n{\npublic:\n\tSLDataSource audioSrc;\n\tSLObjectItf fdPlayerObject;\n\tSLPlayItf fdPlayerPlay;\n\tSLSeekItf fdPlayerSeek;\n    SLVolumeItf fdPlayerVolume;\n    SLPlaybackRateItf fdPlaybackRate;\n\n    /// Applies global effects volume, takes effect gain into account.\n    /// @param volume In range 0..1.\n    void applyEffectsVolume(float volume)\n    {\n        SLmillibel finalVolume = int (RANGE_VOLUME_MILLIBEL * (volume * _gain)) + MIN_VOLUME_MILLIBEL;\n        SLresult result = (*fdPlayerVolume)->SetVolumeLevel(fdPlayerVolume, finalVolume);\n        assert(SL_RESULT_SUCCESS == result);\n    }\n\n    void applyParameters(bool isLooping, float pitch, float pan, float gain, float effectsVolume)\n    {\n        SLresult result = (*fdPlayerSeek)->SetLoop(fdPlayerSeek, (SLboolean) isLooping, 0, SL_TIME_UNKNOWN);\n        assert(SL_RESULT_SUCCESS == result);\n\n        SLpermille stereo = SLpermille(1000 * pan);\n        result = (*fdPlayerVolume)->EnableStereoPosition(fdPlayerVolume, SL_BOOLEAN_TRUE);\n        assert(SL_RESULT_SUCCESS == result);\n        result = (*fdPlayerVolume)->SetStereoPosition(fdPlayerVolume, stereo);\n        assert(SL_RESULT_SUCCESS == result);\n\n        SLpermille playbackRate = SLpermille(1000 * pitch);\n        if (fdPlaybackRate)\n            result = (*fdPlaybackRate)->SetRate(fdPlaybackRate, playbackRate);\n        assert(SL_RESULT_SUCCESS == result);\n\n        _gain = gain;\n        applyEffectsVolume(effectsVolume);\n    }\n\nprivate:\n    float _gain;\n};\n\nstatic AudioPlayer s_musicPlayer; /* for background music */\n\ntypedef map<unsigned int, vector<AudioPlayer*>* > EffectList;\ntypedef pair<unsigned int, vector<AudioPlayer*>* > Effect;\n\nvoid* s_pAndroidHandle  = NULL;\nvoid* s_pOpenSLESHandle = NULL;\n\nstatic EffectList& sharedList()\n{\n\tstatic EffectList s_List;\n\treturn s_List;\n}\n\nunsigned int _Hash(const char *key)\n{\n\tunsigned int len = strlen(key);\n\tconst char *end=key+len;\n\tunsigned int hash;\n\n\tfor (hash = 0; key < end; key++)\n\t{\n\t\thash *= 16777619;\n\t\thash ^= (unsigned int) (unsigned char) toupper(*key);\n\t}\n\treturn (hash);\n}\n\nSLInterfaceID getInterfaceID(const char *value)\n{\n\t// clear the error stack\n\tdlerror();\n\tSLInterfaceID* IID = (SLInterfaceID*)dlsym(s_pOpenSLESHandle, value);\n\tconst char* errorInfo = dlerror();\n\tif (errorInfo)\n\t{\n\t\tLOGD(\"Get interface id: %s from OpenSL failed\", errorInfo);\n\t\tIID = NULL;\n\t}\n\treturn *IID;\n}\n\nvoid* getFuncPtr(const char *value)\n{\n\t// clear the error stack\n\tdlerror();\n\tvoid* funcPtr = dlsym(s_pOpenSLESHandle, value);\n\tconst char* errorInfo = dlerror();\n\tif (errorInfo)\n\t{\n\t\tLOGD(\"Get function from OpenSL failed: %s\", errorInfo);\n\t\tfuncPtr = NULL;\n\t}\n\treturn funcPtr;\n}\n\nint getFileDescriptor(const char * filename, off_t & start, off_t & length)\n{\n\tJniMethodInfo methodInfo;\n\tif (! getStaticMethodInfo(methodInfo, ASSET_MANAGER_GETTER, \"()Landroid/content/res/AssetManager;\"))\n\t{\n\t\tmethodInfo.env->DeleteLocalRef(methodInfo.classID);\n\t\treturn FILE_NOT_FOUND;\n\t}\n\tjobject assetManager = methodInfo.env->CallStaticObjectMethod(methodInfo.classID, methodInfo.methodID);\n\tmethodInfo.env->DeleteLocalRef(methodInfo.classID);\n\n\tAAssetManager* (*AAssetManager_fromJava)(JNIEnv* env, jobject assetManager);\n\tAAssetManager_fromJava = (AAssetManager* (*)(JNIEnv* env, jobject assetManager))\n\t\tdlsym(s_pAndroidHandle, \"AAssetManager_fromJava\");\n\tAAssetManager* mgr = AAssetManager_fromJava(methodInfo.env, assetManager);\n\tassert(NULL != mgr);\n\n\tAAsset* (*AAssetManager_open)(AAssetManager* mgr, const char* filename, int mode);\n\tAAssetManager_open = (AAsset* (*)(AAssetManager* mgr, const char* filename, int mode))\n\t\tdlsym(s_pAndroidHandle, \"AAssetManager_open\");\n\tAAsset* Asset = AAssetManager_open(mgr, filename, AASSET_MODE_UNKNOWN);\n\tif (NULL == Asset)\n\t{\n\t\t//LOGD(\"file not found! Stop preload file: %s\", filename);\n\t\treturn FILE_NOT_FOUND;\n\t}\n\n\t// open asset as file descriptor\n\tint (*AAsset_openFileDescriptor)(AAsset* asset, off_t* outStart, off_t* outLength);\n\tAAsset_openFileDescriptor = (int (*)(AAsset* asset, off_t* outStart, off_t* outLength))\n\t\tdlsym(s_pAndroidHandle, \"AAsset_openFileDescriptor\");\n\tint fd = AAsset_openFileDescriptor(Asset, &start, &length);\n\tassert(0 <= fd);\n\n\tvoid (*AAsset_close)(AAsset* asset);\n\tAAsset_close = (void (*)(AAsset* asset))\n\t\tdlsym(s_pAndroidHandle, \"AAsset_close\");\n\tAAsset_close(Asset);\n\n\treturn fd;\n}\n\n\n/**********************************************************************************\n *   engine\n **********************************************************************************/\nstatic SLObjectItf s_pEngineObject = NULL;\nstatic SLEngineItf s_pEngineEngine = NULL;\nstatic SLObjectItf s_pOutputMixObject = NULL;\n\nbool createAudioPlayerBySource(AudioPlayer* player)\n{\n\t// configure audio sink\n\tSLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, s_pOutputMixObject};\n\tSLDataSink audioSnk = {&loc_outmix, NULL};\n\n\t// create audio player\n\tconst SLInterfaceID ids[3] = {\n\t\tgetInterfaceID(\"SL_IID_SEEK\"), getInterfaceID(\"SL_IID_MUTESOLO\"), getInterfaceID(\"SL_IID_VOLUME\")};\n\tconst SLboolean req[3] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE};\n\tSLresult result = (*s_pEngineEngine)->CreateAudioPlayer(s_pEngineEngine, &(player->fdPlayerObject), &(player->audioSrc), &audioSnk, 3, ids, req);\n\tif (SL_RESULT_MEMORY_FAILURE == result)\n\t{\n\t\treturn false;\n\t}\n\n\t// realize the player\n\tresult = (*(player->fdPlayerObject))->Realize(player->fdPlayerObject, SL_BOOLEAN_FALSE);\n\tassert(SL_RESULT_SUCCESS == result);\n\n\t// get the play interface\n\tresult = (*(player->fdPlayerObject))->GetInterface(player->fdPlayerObject, getInterfaceID(\"SL_IID_PLAY\"), &(player->fdPlayerPlay));\n\tassert(SL_RESULT_SUCCESS == result);\n\n\t// get the volume interface\n\tresult = (*(player->fdPlayerObject))->GetInterface(player->fdPlayerObject, getInterfaceID(\"SL_IID_VOLUME\"), &(player->fdPlayerVolume));\n\tassert(SL_RESULT_SUCCESS == result);\n\n\t// get the seek interface\n\tresult = (*(player->fdPlayerObject))->GetInterface(player->fdPlayerObject, getInterfaceID(\"SL_IID_SEEK\"), &(player->fdPlayerSeek));\n\tassert(SL_RESULT_SUCCESS == result);\n\n    // get the playback rate interface, if available\n    (*(player->fdPlayerObject))->GetInterface(player->fdPlayerObject, getInterfaceID(\"SL_IID_PLAYBACKRATE\"), &(player->fdPlaybackRate));\n\n\treturn true;\n}\n\nbool initAudioPlayer(AudioPlayer* player, const char* filename) \n{\n\t// configure audio source\n\toff_t start, length;\n\tint fd = getFileDescriptor(filename, start, length);\n\tif (FILE_NOT_FOUND == fd)\n\t{\n\t\tFILE* fp = fopen(filename , \"rb\");\n\t\tif(fp){\n\t\t\tSLDataLocator_URI loc_fd = {SL_DATALOCATOR_URI , (SLchar*)filename};\n\t\t\tSLDataFormat_MIME format_mime = {SL_DATAFORMAT_MIME, NULL, SL_CONTAINERTYPE_UNSPECIFIED};\n\t\t\tplayer->audioSrc.pLocator = &loc_fd;\n\t\t\tplayer->audioSrc.pFormat = &format_mime;\n\t\t\treturn createAudioPlayerBySource(player);\n\t\t}\n\t\tLOGD(\"file not found! Stop preload file: %s\", filename);\n\t\treturn false;\n\t}\n\tSLDataLocator_AndroidFD loc_fd = {SL_DATALOCATOR_ANDROIDFD, fd, start, length};\n\tSLDataFormat_MIME format_mime = {SL_DATAFORMAT_MIME, NULL, SL_CONTAINERTYPE_UNSPECIFIED};\n\tplayer->audioSrc.pLocator = &loc_fd;\n\tplayer->audioSrc.pFormat = &format_mime;\n\n\treturn createAudioPlayerBySource(player);\n}\n\nvoid destroyAudioPlayer(AudioPlayer * player)\n{\n\tif (player && player->fdPlayerObject != NULL)\n\t{\n\t\tSLresult result;\n\t\tresult = (*(player->fdPlayerPlay))->SetPlayState(player->fdPlayerPlay, SL_PLAYSTATE_STOPPED);\n\t\tassert(SL_RESULT_SUCCESS == result);\n\n\t\t(*(player->fdPlayerObject))->Destroy(player->fdPlayerObject);\n\t\tplayer->fdPlayerObject = NULL;\n\t\tplayer->fdPlayerPlay = NULL;\n\t\tplayer->fdPlayerSeek = NULL;\n\t\tplayer->fdPlayerVolume = NULL;\n        player->fdPlaybackRate = NULL;\n\t}\n}\n\nvoid OpenSLEngine::createEngine(void* pHandle)\n{\n\tassert(pHandle != NULL);\n\ts_pOpenSLESHandle = pHandle;\n\n\t// clear the error stack\n\tdlerror();\n\ts_pAndroidHandle = dlopen(LIBANDROID, RTLD_LAZY);\n\tconst char* errorInfo = dlerror();\n\tif (errorInfo)\n\t{\n\t\tLOGD(\"%s\", errorInfo);\n\t\treturn;\n\t}\n\n\tSLresult result;\n\tif (s_pEngineObject == NULL)\n\t{\n\t\t// create engine\n\t\tSLresult (*slCreateEngine)(SLObjectItf *pEngine, SLuint32 numOptions, const SLEngineOption *pEngineOptions, SLuint32 numInterfaces, const SLInterfaceID *pInterfaceIds, const SLboolean * pInterfaceRequired );\n\t\tslCreateEngine = (SLresult (*)(SLObjectItf *pEngine, SLuint32 numOptions, const SLEngineOption *pEngineOptions, SLuint32 numInterfaces, const SLInterfaceID *pInterfaceIds, const SLboolean * pInterfaceRequired ))\n\t\t\tgetFuncPtr(\"slCreateEngine\");\n\t\tresult = slCreateEngine(&s_pEngineObject, 0, NULL, 0, NULL, NULL);\n\t\tassert(SL_RESULT_SUCCESS == result);\n\n\t\t// realize the engine\n\t\tresult = (*s_pEngineObject)->Realize(s_pEngineObject, SL_BOOLEAN_FALSE);\n\t\tassert(SL_RESULT_SUCCESS == result);\n\n\t\t// get the engine interface, which is needed in order to create other objects\n\t\tresult = (*s_pEngineObject)->GetInterface(s_pEngineObject, getInterfaceID(\"SL_IID_ENGINE\"), &s_pEngineEngine);\n\t\tassert(SL_RESULT_SUCCESS == result);\n\n\t\t// create output mix\n\t\tconst SLInterfaceID ids[1] = {getInterfaceID(\"SL_IID_ENVIRONMENTALREVERB\")};\n\t\tconst SLboolean req[1] = {SL_BOOLEAN_FALSE};\n\t\tresult = (*s_pEngineEngine)->CreateOutputMix(s_pEngineEngine, &s_pOutputMixObject, 1, ids, req);\n\t\tassert(SL_RESULT_SUCCESS == result);\n\n\t\t// realize the output mix object in sync. mode\n\t\tresult = (*s_pOutputMixObject)->Realize(s_pOutputMixObject, SL_BOOLEAN_FALSE);\n\t\tassert(SL_RESULT_SUCCESS == result);\n\t}\n}\n\nvoid OpenSLEngine::closeEngine()\n{\n\t// destroy background players\n    destroyAudioPlayer(&s_musicPlayer);\n\n\t// destroy effect players\n\tvector<AudioPlayer*>* vec;\n\tEffectList::iterator p = sharedList().begin();\n\twhile (p != sharedList().end())\n\t{\n\t\tvec = p->second;\n\t\tfor (vector<AudioPlayer*>::iterator iter = vec->begin() ; iter != vec->end() ; ++ iter)\n\t\t{\n\t\t\tdestroyAudioPlayer(*iter);\n\t\t}\n\t\tvec->clear();\n\t\tp++;\n\t}\n\tsharedList().clear();\n\n\t// destroy output mix interface\n\tif (s_pOutputMixObject)\n\t{\n\t\t(*s_pOutputMixObject)->Destroy(s_pOutputMixObject);\n\t\ts_pOutputMixObject = NULL;\n\t}\n\n\t// destroy opensl engine\n\tif (s_pEngineObject)\n\t{\n\t\t(*s_pEngineObject)->Destroy(s_pEngineObject);\n\t\ts_pEngineObject = NULL;\n\t\ts_pEngineEngine = NULL;\n\t}\n\n\tLOGD(\"engine destory\");\n}\n\n\n/**********************************************************************************\n *   sound effect\n **********************************************************************************/\ntypedef struct _CallbackContext\n{\n\tvector<AudioPlayer*>* vec;\n\tAudioPlayer* player;\n} CallbackContext;\n\nvoid PlayOverEvent(SLPlayItf caller, void* pContext, SLuint32 playEvent)\n{\n\tCallbackContext* context = (CallbackContext*)pContext;\n\tif (playEvent == SL_PLAYEVENT_HEADATEND)\n\t{\n\t\tvector<AudioPlayer*>::iterator iter;\n\t\tfor (iter = (context->vec)->begin() ; iter != (context->vec)->end() ; ++ iter)\n\t\t{\n\t\t\tif (*iter == context->player)\n\t\t\t{\n\t\t\t\t(context->vec)->erase(iter);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdestroyAudioPlayer(context->player);\n\t\tfree(context);\n\t}\n}\n\nint getSingleEffectState(AudioPlayer * player)\n{\n\tSLuint32 state = 0;\n\tSLresult result;\n\tresult = (*(player->fdPlayerPlay))->GetPlayState(player->fdPlayerPlay, &state);\n\tassert(result == SL_RESULT_SUCCESS);\n\n\treturn (int)state;\n}\n\nvoid setSingleEffectState(AudioPlayer * player, int state)\n{\n\tSLresult result;\n\tif (player->fdPlayerPlay != NULL)\n\t{\n\t\t// don't set to PAUSED state if it's already set to STOPPED state\n\t\tint oldState = getSingleEffectState(player);\n\t\tif (oldState == SL_PLAYSTATE_STOPPED && state == SL_PLAYSTATE_PAUSED)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tresult = (*(player->fdPlayerPlay))->SetPlayState(player->fdPlayerPlay, state);\n\t\tassert(SL_RESULT_SUCCESS == result);\n\t}\n}\n\nvoid resumeSingleEffect(AudioPlayer * player)\n{\n\tint state = getSingleEffectState(player);\n\t// only resume the effect that has been paused\n\tif (state == SL_PLAYSTATE_PAUSED)\n\t{\n\t\tsetSingleEffectState(player, SL_PLAYSTATE_PLAYING);\n\t}\n}\n\nbool OpenSLEngine::recreatePlayer(const char* filename)\n{\n\tunsigned int effectID = _Hash(filename);\n\tEffectList::iterator p = sharedList().find(effectID);\n\tvector<AudioPlayer*>* vec = p->second;\n\tAudioPlayer* newPlayer = new AudioPlayer();\n\tif (!initAudioPlayer(newPlayer, filename))\n\t{\n\t\tLOGD(\"failed to recreate\");\n\t\treturn false;\n\t}\n\tvec->push_back(newPlayer);\n\n\t// set callback\n\tSLresult result;\n\tCallbackContext* context = new CallbackContext();\n\tcontext->vec = vec;\n\tcontext->player = newPlayer;\n\tresult = (*(newPlayer->fdPlayerPlay))->RegisterCallback(newPlayer->fdPlayerPlay, PlayOverEvent, (void*)context);\n\tassert(SL_RESULT_SUCCESS == result);\n\n\tresult = (*(newPlayer->fdPlayerPlay))->SetCallbackEventsMask(newPlayer->fdPlayerPlay, SL_PLAYEVENT_HEADATEND);\n\tassert(SL_RESULT_SUCCESS == result);\n\n\t// set volume \n    newPlayer->applyEffectsVolume(_effectVolume);\n\tsetSingleEffectState(newPlayer, SL_PLAYSTATE_STOPPED);\n\tsetSingleEffectState(newPlayer, SL_PLAYSTATE_PLAYING);\n\n\t// LOGD(\"vec count is %d of effectID %d\", vec->size(), effectID);\n\treturn true;\n}\n\nunsigned int OpenSLEngine::preloadEffect(const char * filename)\n{\n\tunsigned int nID = _Hash(filename);\n\t// if already exists\n\tEffectList::iterator p = sharedList().find(nID);\n\tif (p != sharedList().end())\n\t{\n\t\treturn nID;\n\t}\n\n\tAudioPlayer* player = new AudioPlayer();\n\tif (!initAudioPlayer(player, filename))\n\t{\n\t\tfree(player);\n\t\treturn FILE_NOT_FOUND;\n\t}\n\t\n    // set the new player's volume as others'\n    player->applyEffectsVolume(_effectVolume);\n\n\tvector<AudioPlayer*>* vec = new vector<AudioPlayer*>;\n\tvec->push_back(player);\n\tsharedList().insert(Effect(nID, vec));\n\treturn nID;\n}\n\nvoid OpenSLEngine::unloadEffect(const char * filename)\n{\n\tunsigned int nID = _Hash(filename);\n\n\tEffectList::iterator p = sharedList().find(nID);\n\tif (p != sharedList().end())\n\t{\n\t\tvector<AudioPlayer*>* vec = p->second;\n\t\tfor (vector<AudioPlayer*>::iterator iter = vec->begin() ; iter != vec->end() ; ++ iter)\n\t\t{\n\t\t\tdestroyAudioPlayer(*iter);\n\t\t}\n\t\tvec->clear();\n\t\tsharedList().erase(nID);\n\t}\n}\n\nint OpenSLEngine::getEffectState(unsigned int effectID)\n{\n\tint state = PLAYSTATE_UNKNOWN;\n\tEffectList::iterator p = sharedList().find(effectID);\n\tif (p != sharedList().end())\n\t{\n\t\tvector<AudioPlayer*>* vec = p->second;\n\t\t// get the last player's state\n\t\tvector<AudioPlayer*>::reverse_iterator r_iter = vec->rbegin();\n\t\tstate = getSingleEffectState(*r_iter);\n\t}\n\treturn state;\n}\n\nvoid OpenSLEngine::setEffectState(unsigned int effectID, int state, bool isClear)\n{\n\tEffectList::iterator p = sharedList().find(effectID);\n\tif (p != sharedList().end())\n\t{\n\t\tvector<AudioPlayer*>* vec = p->second;\n\t\tif (state == SL_PLAYSTATE_STOPPED || state == SL_PLAYSTATE_PAUSED)\n\t\t{\n\t\t\t// if stopped, clear the recreated players which are unused\n\t\t\tif (isClear)\n\t\t\t{\n\t\t\t\tsetSingleEffectState(*(vec->begin()), state);\n\t\t\t\tvector<AudioPlayer*>::reverse_iterator r_iter = vec->rbegin();\n\t\t\t\tfor (int i = 1, size = vec->size() ; i < size ; ++ i)\n\t\t\t\t{\n\t\t\t\t\tdestroyAudioPlayer(*r_iter);\n\t\t\t\t\tr_iter ++;\n\t\t\t\t\tvec->pop_back();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvector<AudioPlayer*>::iterator iter;\n\t\t\t\tfor (iter = vec->begin() ; iter != vec->end() ; ++ iter)\n\t\t\t\t{\n\t\t\t\t\tsetSingleEffectState(*iter, state);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsetSingleEffectState(*(vec->rbegin()), state);\n\t\t}\n\t}\n}\n\nvoid OpenSLEngine::setAllEffectState(int state)\n{\n\tEffectList::iterator p;\n\tfor (p = sharedList().begin(); p != sharedList().end(); p ++)\n\t{\n\t\tvector<AudioPlayer*>* vec = p->second;\n\t\tfor (vector<AudioPlayer*>::iterator iter = vec->begin() ; iter != vec->end() ; ++ iter)\n\t\t{\n\t\t\tsetSingleEffectState(*iter, state);\n\t\t}\n\t}\n}\n\nvoid OpenSLEngine::resumeEffect(unsigned int effectID)\n{\n\tEffectList::iterator p = sharedList().find(effectID);\n\tif (p != sharedList().end())\n\t{\n\t\tvector<AudioPlayer*>* vec = p->second;\n\t\tfor (vector<AudioPlayer*>::iterator iter = vec->begin() ; iter != vec->end() ; ++ iter)\n\t\t{\n\t\t\tresumeSingleEffect(*iter);\n\t\t}\n\t}\n}\n\nvoid OpenSLEngine::resumeAllEffects()\n{\n\tint state;\n\tEffectList::iterator p;\n\tfor (p = sharedList().begin(); p != sharedList().end() ; ++ p)\n\t{\n\t\tvector<AudioPlayer*>* vec = p->second;\n\t\tfor (vector<AudioPlayer*>::iterator iter = vec->begin() ; iter != vec->end() ; ++ iter)\n\t\t{\n\t\t\tresumeSingleEffect(*iter);\n\t\t}\n\t}\n}\n\nvoid OpenSLEngine::setEffectParameters(unsigned int effectID, bool isLooping,\n                                       float pitch, float pan, float gain)\n{\n\tvector<AudioPlayer*>* vec = sharedList()[effectID];\n\tassert(NULL != vec);\n\n\t// get the first effect player that to be set loop config\n\tvector<AudioPlayer*>::iterator iter = vec->begin();\n\tAudioPlayer * player = *iter;\n\n\tif (player && player->fdPlayerSeek) \n\t{\n        player->applyParameters(isLooping, pitch, pan, gain, _effectVolume);\n\t}\n}\n\nvoid OpenSLEngine::setEffectsVolume(float volume)\n{\n\tassert(volume <= 1.0f && volume >= 0.0f);\n    _effectVolume = volume;\n\n\tEffectList::iterator p;\n\tAudioPlayer * player;\n\tfor (p = sharedList().begin() ; p != sharedList().end() ; ++ p)\n\t{\n\t\tvector<AudioPlayer*>* vec = p->second;\n\t\tfor (vector<AudioPlayer*>::iterator iter = vec->begin() ; iter != vec->end() ; ++ iter)\n\t\t{\n\t\t\tplayer = *iter;\n            player->applyEffectsVolume(_effectVolume);\n\t\t}\n\t}\n}\n\nfloat OpenSLEngine::getEffectsVolume()\n{\n\tfloat volume = (_effectVolume - MIN_VOLUME_MILLIBEL) / (1.0f * RANGE_VOLUME_MILLIBEL);\n\treturn volume;\n}\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/opensl/OpenSLEngine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef _OPENSL_ENGINE_H_\n#define _OPENSL_ENGINE_H_\n\n#include <assert.h>\n#include <jni.h>\n#include <string.h>\n#include <stdio.h>\n#include <ctype.h>\n#include <map>\n#include <vector>\n#include <dlfcn.h>\n#include <SLES/OpenSLES.h>\n#include <SLES/OpenSLES_Android.h>\n#include <sys/types.h>\n#include <android/asset_manager.h>\n#include <android/asset_manager_jni.h>\n#include <android/log.h>\n#include <jni/JniHelper.h>\n#include <dlfcn.h>\n\n\nclass OpenSLEngine\n{\npublic:\n\tOpenSLEngine();\n\t~OpenSLEngine();\n\n\tvoid createEngine(void * pHandle);\n\n\tvoid closeEngine();\n\n\n\tbool preloadBackgroundMusic(const char * filename);\n\n\tvoid setBackgroundMusicState(int state);\n\n\tint getBackgroundMusicState();\n\n\tvoid rewindBackgroundMusic();\n\n\tvoid setBackgroundMusicLooping(bool isLooping);\n\n\tvoid setBackgroundVolume(int volume);\n\n\tint getBackgroundVolume();\n\n\n\n\tbool recreatePlayer(const char* filename);\n\n\tunsigned int preloadEffect(const char * filename);\n\n\tvoid unloadEffect(const char * filename);\n\n\tint getEffectState(unsigned int effectID);\n\n\tvoid setEffectState(unsigned int effectID, int state, bool isClear = false);\n\n\tvoid setAllEffectState(int state);\n\n\tvoid resumeEffect(unsigned int effectID);\n\n\tvoid resumeAllEffects();\n\n\tvoid setEffectParameters(unsigned int effectID, bool isLooping, float pitch, float pan, float gain);\n\n\tvoid setEffectsVolume(float volume);\n\n\tfloat getEffectsVolume();\n\nprivate:\n\tSLmillibel _musicVolume;\n    float _effectVolume;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"SimpleAudioEngineOpenSL.h\"\n#include <dlfcn.h>\n#include <android/log.h>\n\n#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,\"SIMPLEAUDIOENGINE_OPENSL\", __VA_ARGS__)\n\n#define  LIBOPENSLES \"libOpenSLES.so\"\n\n#define  PLAYSTATE_UNKNOWN 0\n#define  PLAYSTATE_STOPPED 1\n#define  PLAYSTATE_PAUSED  2\n#define  PLAYSTATE_PLAYING 3\n#define  FILE_NOT_FOUND\t   -1\n\nstatic void * s_pHandle = 0;\nstatic OpenSLEngine * s_pOpenSL = 0;\nstatic SimpleAudioEngineOpenSL * s_pEngine = 0;\n\nSimpleAudioEngineOpenSL::SimpleAudioEngineOpenSL()\n{\n}\n\nSimpleAudioEngineOpenSL::~SimpleAudioEngineOpenSL()\n{\n\tend();\n}\n\nbool SimpleAudioEngineOpenSL::initEngine()\n{\n\tbool bRet = false;\n\tdo \n\t{\n\t\tif (s_pOpenSL == NULL)\n\t\t{\n\t\t\t// clear the error stack\n\t\t\tdlerror();\n\t\t\ts_pHandle = dlopen(LIBOPENSLES, RTLD_LAZY);\n\t\t\tconst char* errorInfo = dlerror();\n\t\t\tif (errorInfo)\n\t\t\t{\n\t\t\t\tLOGD(\"%s\", errorInfo);\n\t\t\t\tbRet = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ts_pOpenSL = new OpenSLEngine();\n\t\t\ts_pOpenSL->createEngine(s_pHandle);\n\n\t\t\tbRet = true;\n\t\t}\n\t} while (0);\n\treturn bRet;\n}\n\nSimpleAudioEngineOpenSL* SimpleAudioEngineOpenSL::sharedEngine()\n{\n\tif (s_pEngine == NULL)\n\t{\n\t\ts_pEngine = new SimpleAudioEngineOpenSL();\n\t}\n\ts_pEngine->initEngine();\n\treturn s_pEngine;\n}\n\nvoid SimpleAudioEngineOpenSL::end()\n{\n\tif (s_pOpenSL)\n\t{\n\t\ts_pOpenSL->closeEngine();\n\t\tdelete s_pOpenSL;\n\t\ts_pOpenSL = NULL;\n\n\t\tdlclose(s_pHandle);\n\t\ts_pHandle = NULL;\n\t}\n}\n\nfloat SimpleAudioEngineOpenSL::getEffectsVolume()\n{\n\treturn s_pOpenSL->getEffectsVolume();\n}\n\nvoid SimpleAudioEngineOpenSL::setEffectsVolume(float volume)\n{\n\tif (volume < 0.0f) volume = 0.0f;\n\tif (volume > 1.0f) volume = 1.0f;\n\ts_pOpenSL->setEffectsVolume(volume);\n}\n\nunsigned int SimpleAudioEngineOpenSL::playEffect(const char* pszFilePath, bool bLoop,\n                                                 float pitch, float pan, float gain)\n{\n    unsigned int soundID = s_pOpenSL->preloadEffect(pszFilePath);\n\n    if (soundID != FILE_NOT_FOUND)\n    {\n        if (s_pOpenSL->getEffectState(soundID) == PLAYSTATE_PLAYING)\n        {\n           // recreate an effect player.\n           if (s_pOpenSL->recreatePlayer(pszFilePath))\n           {\n               s_pOpenSL->setEffectParameters(soundID, bLoop, pitch, pan, gain);\n           }\n        }\n        else\n        {\n            s_pOpenSL->setEffectState(soundID, PLAYSTATE_STOPPED);\n            s_pOpenSL->setEffectState(soundID, PLAYSTATE_PLAYING);\n            s_pOpenSL->setEffectParameters(soundID, bLoop, pitch, pan, gain);\n        }\n    }\n\n    return soundID;\n}\n\nvoid SimpleAudioEngineOpenSL::pauseEffect(unsigned int nSoundId)\n{\n\ts_pOpenSL->setEffectState(nSoundId, PLAYSTATE_PAUSED);\n}\n\nvoid SimpleAudioEngineOpenSL::pauseAllEffects()\n{\n\ts_pOpenSL->setAllEffectState(PLAYSTATE_PAUSED);\n}\n\nvoid SimpleAudioEngineOpenSL::resumeEffect(unsigned int nSoundId)\n{\n\ts_pOpenSL->resumeEffect(nSoundId);\n}\n\nvoid SimpleAudioEngineOpenSL::resumeAllEffects()\n{\n\ts_pOpenSL->resumeAllEffects();\n}\n\nvoid SimpleAudioEngineOpenSL::stopEffect(unsigned int nSoundId)\n{\n\ts_pOpenSL->setEffectState(nSoundId, PLAYSTATE_STOPPED, true);\n}\n\nvoid SimpleAudioEngineOpenSL::stopAllEffects()\n{\n\ts_pOpenSL->setAllEffectState(PLAYSTATE_STOPPED);\n}\n\nvoid SimpleAudioEngineOpenSL::preloadEffect(const char* pszFilePath)\n{\n\ts_pOpenSL->preloadEffect(pszFilePath);\n}\n\nvoid SimpleAudioEngineOpenSL::unloadEffect(const char* pszFilePath)\n{\n\ts_pOpenSL->unloadEffect(pszFilePath);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef _SIMPLE_AUDIO_ENGINE_OPENSL_H_\n#define _SIMPLE_AUDIO_ENGINE_OPENSL_H_\n\n#include \"OpenSLEngine.h\"\n\nclass SimpleAudioEngineOpenSL\n{\npublic:\n\tSimpleAudioEngineOpenSL();\n\t~SimpleAudioEngineOpenSL();\n\n\tbool initEngine();\n\n\tstatic SimpleAudioEngineOpenSL* sharedEngine();\n\n\tstatic void end();\n\n\tfloat getEffectsVolume();\n\n\tvoid setEffectsVolume(float volume);\n\n    unsigned int playEffect(const char* pszFilePath, bool bLoop, float pitch, float pan, float gain);\n\n\tvoid pauseEffect(unsigned int nSoundId);\n\n\tvoid pauseAllEffects();\n\n\tvoid resumeEffect(unsigned int nSoundId);\n\n\tvoid resumeAllEffects();\n\n\tvoid stopEffect(unsigned int nSoundId);\n\n\tvoid stopAllEffects();\n\n\tvoid preloadEffect(const char* pszFilePath);\n\n\tvoid unloadEffect(const char* pszFilePath);\n};\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"cddandroidOpenSLEngine.h\"\n\nnamespace CocosDenshion {\n    namespace android {\n        OpenSLEngine::~OpenSLEngine() {\n        }\n\n        void OpenSLEngine::preloadBackgroundMusic(const char* pszFilePath) { }\n        void OpenSLEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) { }\n        void OpenSLEngine::stopBackgroundMusic(bool bReleaseData) { }\n        void OpenSLEngine::pauseBackgroundMusic() { }\n        void OpenSLEngine::resumeBackgroundMusic() { }\n        void OpenSLEngine::rewindBackgroundMusic() { }\n        bool OpenSLEngine::willPlayBackgroundMusic() { }\n        bool OpenSLEngine::isBackgroundMusicPlaying() { }\n        float OpenSLEngine::getBackgroundMusicVolume() { }\n        void OpenSLEngine::setBackgroundMusicVolume(float volume) { }\n        float OpenSLEngine::getEffectsVolume() { }\n        void OpenSLEngine::setEffectsVolume(float volume) { }\n        unsigned int OpenSLEngine::playEffect(const char* pszFilePath,\n                                              bool bLoop,\n                                              float pitch, float pan,\n                                              float gain) {\n        }\n        void OpenSLEngine::pauseEffect(unsigned int nSoundId) { }\n        void OpenSLEngine::pauseAllEffects() { }\n        void OpenSLEngine::resumeEffect(unsigned int nSoundId) { }\n        void OpenSLEngine::resumeAllEffects() { }\n        void OpenSLEngine::stopEffect(unsigned int nSoundId) { }\n        void OpenSLEngine::stopAllEffects() { }\n        void OpenSLEngine::preloadEffect(const char* pszFilePath) { }\n        void OpenSLEngine::unloadEffect(const char* pszFilePath) { }\n\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/audio/android/opensl/cddandroidOpenSLEngine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CDDANDROIDOPENSLENGINE_H__\n#define __CDDANDROIDOPENSLENGINE_H__\n\n#include \"SimpleAudioEngine.h\"\n\nnamespace CocosDenshion {\n    namespace android {\n        class OpenSLEngine : public SimpleAudioEngine {\n            ~OpenSLEngine();\n\n            void preloadBackgroundMusic(const char* pszFilePath);\n            void playBackgroundMusic(const char* pszFilePath, bool bLoop);\n            void stopBackgroundMusic(bool bReleaseData);\n            void pauseBackgroundMusic();\n            void resumeBackgroundMusic();\n            void rewindBackgroundMusic();\n            bool willPlayBackgroundMusic();\n            bool isBackgroundMusicPlaying();\n            float getBackgroundMusicVolume();\n            void setBackgroundMusicVolume(float volume);\n            float getEffectsVolume();\n            void setEffectsVolume(float volume);\n            unsigned int playEffect(const char* pszFilePath,\n                                    bool bLoop = false,\n                                    float pitch = 1.0f, float pan = 0.0f,\n                                    float gain = 1.0f);\n            void pauseEffect(unsigned int nSoundId);\n            void pauseAllEffects();\n            void resumeEffect(unsigned int nSoundId);\n            void resumeAllEffects();\n            void stopEffect(unsigned int nSoundId);\n            void stopAllEffects();\n            void preloadEffect(const char* pszFilePath);\n            void unloadEffect(const char* pszFilePath);\n        };\n    }\n}\n\n#endif //__CDDANDROIDOPENSLENGINE_H__\n"
  },
  {
    "path": "cocos2d/cocos/audio/include/Export.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __EXPORT_COMMON__\n#define __EXPORT_COMMON__\n\n#if defined(SHP)\n    #include <FBaseConfig.h>\n    #define EXPORT_DLL  _EXPORT_\n#elif defined(_WIN32)\n    #if defined(_EXPORT_DLL_)\n    #define EXPORT_DLL//     __declspec(dllexport)\n    #elif defined(IGNORE_EXPORT)\n    #define EXPORT_DLL\n    #else         /* use a DLL library */\n    #define EXPORT_DLL//     __declspec(dllimport)\n    #endif\n#else\n    #if defined(_SHARED_)\n    #define EXPORT_DLL     __attribute__((visibility(\"default\")))\n    #elif defined(IGNORE_EXPORT)\n    #define EXPORT_DLL\n    #else\n    #define EXPORT_DLL\n    #endif\n#endif \n\n#endif    // end of __EXPORT_COMMON__\n"
  },
  {
    "path": "cocos2d/cocos/audio/include/SimpleAudioEngine.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      Steve Oldmeadow\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef _SIMPLE_AUDIO_ENGINE_H_\n#define _SIMPLE_AUDIO_ENGINE_H_\n\n#include <stddef.h>\n#include \"Export.h\"\n#include <typeinfo>\n#include <ctype.h>\n#include <string.h>\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated))\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated)\n#else\n#define CC_DEPRECATED_ATTRIBUTE\n#endif\n\nnamespace CocosDenshion {\n\n/**\n  @class          SimpleAudioEngine\n  @brief          Offers a VERY simple interface to play background music & sound effects.\n  @note           Make sure to call SimpleAudioEngine::end() when the sound engine is not needed anymore\n                  to release allocated resources.\n */\n\nclass EXPORT_DLL SimpleAudioEngine\n{\npublic:\n    /**\n     @brief Get the shared Engine object,it will new one when first time be called\n     */\n    static SimpleAudioEngine* getInstance();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static SimpleAudioEngine* sharedEngine() { return SimpleAudioEngine::getInstance(); }\n\n    /**\n     @brief Release the shared Engine object\n     @warning It must be called before the application exit, or a memory leak will be casued.\n     */\n    static void end();\n\nprotected:\n    SimpleAudioEngine();\n    virtual ~SimpleAudioEngine();\n\npublic:\n\n    /**\n     @brief Preload background music\n     @param pszFilePath The path of the background music file.\n     * @js preloadMusic\n     * @lua preloadMusic\n     */\n    virtual void preloadBackgroundMusic(const char* pszFilePath);\n    \n    /**\n     @brief Play background music\n     @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo\n     @param bLoop Whether the background music loop or not\n     * @js playMusic\n     * @lua playMusic\n     */\n    virtual void playBackgroundMusic(const char* pszFilePath, bool bLoop = false);\n\n    /**\n     @brief Stop playing background music\n     @param bReleaseData If release the background music data or not.As default value is false\n     * @js stopMusic\n     * @lua stopMusic\n     */\n    virtual void stopBackgroundMusic(bool bReleaseData = false);\n\n    /**\n     @brief Pause playing background music\n     * @js pauseMusic\n     * @lua pauseMusic\n     */\n    virtual void pauseBackgroundMusic();\n\n    /**\n     @brief Resume playing background music\n     * @js resumeMusic\n     * @lua resumeMusic\n     */\n    virtual void resumeBackgroundMusic();\n\n    /**\n     @brief Rewind playing background music\n     * @js rewindMusic\n     * @lua rewindMusic\n     */\n    virtual void rewindBackgroundMusic();\n\n    /**\n     @brief Indicates whether any background music can be played or not.\n     @return <i>true</i> if background music can be played, otherwise <i>false</i>.\n     * @js willPlayMusic\n     * @lua willPlayMusic\n     */\n    virtual bool willPlayBackgroundMusic();\n\n    /**\n     @brief Indicates whether the background music is playing\n     @return <i>true</i> if the background music is playing, otherwise <i>false</i>\n     * @js isMusicPlaying\n     * @lua isMusicPlaying\n     */\n    virtual bool isBackgroundMusicPlaying();\n\n    // \n    // properties\n    //\n\n    /**\n     @brief The volume of the background music within the range of 0.0 as the minimum and 1.0 as the maximum.\n     * @js getMusicVolume\n     * @lua getMusicVolume\n     */\n    virtual float getBackgroundMusicVolume();\n\n    /**\n     @brief Set the volume of background music\n     @param volume must be within the range of 0.0 as the minimum and 1.0 as the maximum.\n     * @js setMusicVolume\n     * @lua setMusicVolume\n     */\n    virtual void setBackgroundMusicVolume(float volume);\n\n    /**\n    @brief The volume of the effects within the range of 0.0 as the minimum and 1.0 as the maximum.\n    */\n    virtual float getEffectsVolume();\n\n    /**\n    @brief Set the volume of sound effects\n    @param volume must be within the range of 0.0 as the minimum and 1.0 as the maximum.\n    */\n    virtual void setEffectsVolume(float volume);\n\n    // \n    // for sound effects\n\n    /**\n    @brief Play sound effect with a file path, pitch, pan and gain\n    @param pszFilePath The path of the effect file.\n    @param bLoop Determines whether to loop the effect playing or not. The default value is false.\n    @param pitch Frequency, normal value is 1.0. Will also change effect play time.\n    @param pan   Stereo effect, in the range of [-1..1] where -1 enables only left channel.\n    @param gain  Volume, in the range of [0..1]. The normal value is 1.\n    @return the OpenAL source id\n\n    @note Full support is under development, now there are limitations:\n        - no pitch effect on Samsung Galaxy S2 with OpenSL backend enabled;\n        - no pitch/pan/gain on emscrippten, win32, marmalade.\n    */\n    virtual unsigned int playEffect(const char* pszFilePath, bool bLoop = false,\n                                    float pitch = 1.0f, float pan = 0.0f, float gain = 1.0f);\n\n    /**\n    @brief Pause playing sound effect\n    @param nSoundId The return value of function playEffect\n    */\n    virtual void pauseEffect(unsigned int nSoundId);\n\n    /**\n    @brief Pause all playing sound effect\n    */\n    virtual void pauseAllEffects();\n\n    /**\n    @brief Resume playing sound effect\n    @param nSoundId The return value of function playEffect\n    */\n    virtual void resumeEffect(unsigned int nSoundId);\n\n    /**\n    @brief Resume all playing sound effect\n    */\n    virtual void resumeAllEffects();\n\n    /**\n    @brief Stop playing sound effect\n    @param nSoundId The return value of function playEffect\n    */\n    virtual void stopEffect(unsigned int nSoundId);\n\n    /**\n    @brief Stop all playing sound effects\n    */\n    virtual void stopAllEffects();\n\n    /**\n    @brief          preload a compressed audio file\n    @details        the compressed audio will be decoded to wave, then written into an internal buffer in SimpleAudioEngine\n    @param pszFilePath The path of the effect file\n    */\n    virtual void preloadEffect(const char* pszFilePath);\n\n    /**\n    @brief          unload the preloaded effect from internal buffer\n    @param pszFilePath        The path of the effect file\n    */\n    virtual void unloadEffect(const char* pszFilePath);\n};\n\n} // end of namespace CocosDenshion\n\n#endif // _SIMPLE_AUDIO_ENGINE_H_\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/CDAudioManager.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n#import \"CocosDenshion.h\"\n#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000\n    #import <AVFoundation/AVFoundation.h>\n#else\n    #import \"CDXMacOSXSupport.h\"\n#endif\n\n/** Different modes of the engine */\ntypedef enum {\n    kAMM_FxOnly,                    //!Other apps will be able to play audio\n    kAMM_FxPlusMusic,                //!Only this app will play audio\n    kAMM_FxPlusMusicIfNoOtherAudio,    //!If another app is playing audio at start up then allow it to continue and don't play music\n    kAMM_MediaPlayback,                //!This app takes over audio e.g music player app\n    kAMM_PlayAndRecord                //!App takes over audio and has input and output\n} tAudioManagerMode;\n\n/** Possible states of the engine */\ntypedef enum {\n    kAMStateUninitialised, //!Audio manager has not been initialised - do not use\n    kAMStateInitialising,  //!Audio manager is in the process of initialising - do not use\n    kAMStateInitialised       //!Audio manager is initialised - safe to use\n} tAudioManagerState;\n\ntypedef enum {\n    kAMRBDoNothing,                //Audio manager will not do anything on resign or becoming active\n    kAMRBStopPlay,                //Background music is stopped on resign and resumed on become active\n    kAMRBStop                    //Background music is stopped on resign but not resumed - maybe because you want to do this from within your game\n} tAudioManagerResignBehavior;\n\n/** Notifications */\nextern NSString * const kCDN_AudioManagerInitialised;\n\n@interface CDAsynchInitialiser : NSOperation {}    \n@end\n\n/** CDAudioManager supports two long audio source channels called left and right*/\ntypedef enum {\n    kASC_Left = 0,\n    kASC_Right = 1\n} tAudioSourceChannel;    \n\ntypedef enum {\n    kLAS_Init,\n    kLAS_Loaded,\n    kLAS_Playing,\n    kLAS_Paused,\n    kLAS_Stopped,\n} tLongAudioSourceState;\n\n@class CDLongAudioSource;\n@protocol CDLongAudioSourceDelegate <NSObject>\n@optional\n/** The audio source completed playing */\n- (void) cdAudioSourceDidFinishPlaying:(CDLongAudioSource *) audioSource;\n/** The file used to load the audio source has changed */\n- (void) cdAudioSourceFileDidChange:(CDLongAudioSource *) audioSource;\n@end\n\n/**\n CDLongAudioSource represents an audio source that has a long duration which makes\n it costly to load into memory for playback as an effect using CDSoundEngine. Examples\n include background music and narration tracks. The audio file may or may not be compressed.\n Bear in mind that current iDevices can only use hardware to decode a single compressed\n audio file at a time and playing multiple compressed files will result in a performance drop\n as software decompression will take place.\n @since v0.99\n */\n@interface CDLongAudioSource : NSObject <AVAudioPlayerDelegate, CDAudioInterruptProtocol>{\n    AVAudioPlayer    *audioSourcePlayer;\n    NSString        *audioSourceFilePath;\n    NSInteger        numberOfLoops;\n    float            volume;\n    id<CDLongAudioSourceDelegate> delegate; \n    BOOL            mute;\n    BOOL            enabled_;\n    BOOL            backgroundMusic;\n    // whether background music is paused\n    BOOL            paused;\n@public    \n    BOOL            systemPaused;//Used for auto resign handling\n    NSTimeInterval    systemPauseLocation;//Used for auto resign handling\n@protected\n    tLongAudioSourceState state;\n}    \n@property (readonly) AVAudioPlayer *audioSourcePlayer;\n@property (readonly) NSString *audioSourceFilePath;\n@property (readwrite, nonatomic) NSInteger numberOfLoops;\n@property (readwrite, nonatomic) float volume;\n@property (assign) id<CDLongAudioSourceDelegate> delegate;\n/* This long audio source functions as background music */\n@property (readwrite, nonatomic) BOOL backgroundMusic;\n@property (readonly) BOOL paused;\n\n/** Loads the file into the audio source */\n-(void) load:(NSString*) filePath;\n/** Plays the audio source */\n-(void) play;\n/** Stops playing the audio soruce */\n-(void) stop;\n/** Pauses the audio source */\n-(void) pause;\n/** Rewinds the audio source */\n-(void) rewind;\n/** Resumes playing the audio source if it was paused */\n-(void) resume;\n/** Returns whether or not the audio source is playing */\n-(BOOL) isPlaying;\n\n@end\n\n/** \n CDAudioManager manages audio requirements for a game.  It provides access to a CDSoundEngine object\n for playing sound effects.  It provides access to two CDLongAudioSource object (left and right channel)\n for playing long duration audio such as background music and narration tracks.  Additionally it manages\n the audio session to take care of things like audio session interruption and interacting with the audio\n of other apps that are running on the device.\n \n Requirements:\n - Firmware: OS 2.2 or greater \n - Files: CDAudioManager.*, CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox, AVFoundation\n @since v0.8\n */\n@interface CDAudioManager : NSObject <CDLongAudioSourceDelegate, CDAudioInterruptProtocol, AVAudioSessionDelegate> {\n    CDSoundEngine        *soundEngine;\n    CDLongAudioSource    *backgroundMusic;\n    NSMutableArray        *audioSourceChannels;\n    NSString*            _audioSessionCategory;\n    BOOL                _audioWasPlayingAtStartup;\n    tAudioManagerMode    _mode;\n    SEL backgroundMusicCompletionSelector;\n    id backgroundMusicCompletionListener;\n    BOOL willPlayBackgroundMusic;\n    BOOL _mute;\n    BOOL _resigned;\n    BOOL _interrupted;\n    BOOL _audioSessionActive;\n    BOOL enabled_;\n    \n    //For handling resign/become active\n    BOOL _isObservingAppEvents;\n    tAudioManagerResignBehavior _resignBehavior;\n}\n\n@property (readonly) CDSoundEngine *soundEngine;\n@property (readonly) CDLongAudioSource *backgroundMusic;\n@property (readonly) BOOL willPlayBackgroundMusic;\n\n/** Returns the shared singleton */\n+ (CDAudioManager *) sharedManager;\n+ (tAudioManagerState) sharedManagerState;\n/** Configures the shared singleton with a mode*/\n+ (void) configure: (tAudioManagerMode) mode;\n/** Initializes the engine asynchronously with a mode */\n+ (void) initAsynchronously: (tAudioManagerMode) mode;\n/** Initializes the engine synchronously with a mode, channel definition and a total number of channels */\n- (id) init: (tAudioManagerMode) mode;\n-(void) audioSessionInterrupted;\n-(void) audioSessionResumed;\n-(void) setResignBehavior:(tAudioManagerResignBehavior) resignBehavior autoHandle:(BOOL) autoHandle;\n/** Returns true is audio is muted at a hardware level e.g user has ringer switch set to off */\n-(BOOL) isDeviceMuted;\n/** Returns true if another app is playing audio such as the iPod music player */\n-(BOOL) isOtherAudioPlaying;\n/** Sets the way the audio manager interacts with the operating system such as whether it shares output with other apps or obeys the mute switch */\n-(void) setMode:(tAudioManagerMode) mode;\n/** Shuts down the shared audio manager instance so that it can be reinitialised */\n+(void) end;\n\n/** Call if you want to use built in resign behavior but need to do some additional audio processing on resign active. */\n- (void) applicationWillResignActive;\n/** Call if you want to use built in resign behavior but need to do some additional audio processing on become active. */\n- (void) applicationDidBecomeActive;\n\n//New AVAudioPlayer API\n/** Loads the data from the specified file path to the channel's audio source */\n-(CDLongAudioSource*) audioSourceLoad:(NSString*) filePath channel:(tAudioSourceChannel) channel;\n/** Retrieves the audio source for the specified channel */\n-(CDLongAudioSource*) audioSourceForChannel:(tAudioSourceChannel) channel;\n\n//Legacy AVAudioPlayer API\n/** Plays music in background. The music can be looped or not\n It is recommended to use .aac files as background music since they are decoded by the device (hardware).\n */\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop;\n/** Preloads a background music */\n-(void) preloadBackgroundMusic:(NSString*) filePath;\n/** Stops playing the background music */\n-(void) stopBackgroundMusic;\n/** Pauses the background music */\n-(void) pauseBackgroundMusic;\n/** Rewinds the background music */\n-(void) rewindBackgroundMusic;\n/** Resumes playing the background music */\n-(void) resumeBackgroundMusic;\n/** Returns whether or not the background music is playing */\n-(BOOL) isBackgroundMusicPlaying;\n\n-(void) setBackgroundMusicCompletionListener:(id) listener selector:(SEL) selector;\n\n@end\n\n/** Fader for long audio source objects */\n@interface CDLongAudioSourceFader : CDPropertyModifier{}\n@end\n\nstatic const int kCDNoBuffer = -1;\n\n/** Allows buffers to be associated with file names */\n@interface CDBufferManager:NSObject{\n    NSMutableDictionary* loadedBuffers;\n    NSMutableArray    *freedBuffers;\n    CDSoundEngine *soundEngine;\n    int nextBufferId;\n}\n\n-(id) initWithEngine:(CDSoundEngine *) theSoundEngine;\n-(int) bufferForFile:(NSString*) filePath create:(BOOL) create;\n-(void) releaseBufferForFile:(NSString *) filePath;\n\n@end\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/CDAudioManager.m",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n\n#import \"CDAudioManager.h\"\n\nNSString * const kCDN_AudioManagerInitialised = @\"kCDN_AudioManagerInitialised\";\n\n//NSOperation object used to asynchronously initialise \n@implementation CDAsynchInitialiser\n\n-(void) main {\n    [super main];\n    [CDAudioManager sharedManager];\n}    \n\n@end\n\n@implementation CDLongAudioSource\n\n@synthesize audioSourcePlayer, audioSourceFilePath, delegate, backgroundMusic, paused;\n\n-(id) init {\n    if ((self = [super init])) {\n        state = kLAS_Init;\n        volume = 1.0f;\n        mute = NO;\n        enabled_ = YES;\n        paused = NO;\n    }\n    return self;\n}\n\n-(void) dealloc {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - deallocating %@\", self);\n    [audioSourcePlayer release];\n    [audioSourceFilePath release];\n    [super dealloc];\n}    \n\n-(void) load:(NSString*) filePath {\n    //We have alread loaded a file previously,  check if we are being asked to load the same file\n    if (state == kLAS_Init || ![filePath isEqualToString:audioSourceFilePath]) {\n        CDLOGINFO(@\"Denshion::CDLongAudioSource - Loading new audio source %@\",filePath);\n        //New file\n        if (state != kLAS_Init) {\n            [audioSourceFilePath release];//Release old file path\n            [audioSourcePlayer release];//Release old AVAudioPlayer, they can't be reused\n        }\n        audioSourceFilePath = [filePath copy];\n        NSError *error = nil;\n        NSString *path = [CDUtilities fullPathFromRelativePath:audioSourceFilePath];\n        audioSourcePlayer = [(AVAudioPlayer*)[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error];\n        if (error == nil) {\n            [audioSourcePlayer prepareToPlay];\n            audioSourcePlayer.delegate = self;\n            if (delegate && [delegate respondsToSelector:@selector(cdAudioSourceFileDidChange:)]) {\n                //Tell our delegate the file has changed\n                [delegate cdAudioSourceFileDidChange:self];\n            }    \n        } else {\n            CDLOG(@\"Denshion::CDLongAudioSource - Error initialising audio player: %@\",error);\n        }    \n    } else {\n        //Same file - just return it to a consistent state\n        [self pause];\n        [self rewind];\n    }\n    audioSourcePlayer.volume = volume;\n    audioSourcePlayer.numberOfLoops = numberOfLoops;\n    state = kLAS_Loaded;\n}    \n\n-(void) play {\n    if (enabled_) {\n        self->systemPaused = NO;\n        self->paused = NO;\n        [audioSourcePlayer play];\n    } else {\n        CDLOGINFO(@\"Denshion::CDLongAudioSource long audio source didn't play because it is disabled\");\n    }    \n}    \n\n-(void) stop {\n    self->paused = NO;\n    [audioSourcePlayer stop];\n}    \n\n-(void) pause {\n    self->paused = YES;\n    [audioSourcePlayer pause];\n}    \n\n-(void) rewind {\n    self->paused = NO;\n    [audioSourcePlayer setCurrentTime:0];\n}\n\n-(void) resume {\n    self->paused = NO;\n    [audioSourcePlayer play];\n}    \n\n-(BOOL) isPlaying {\n    if (state != kLAS_Init) {\n        return [audioSourcePlayer isPlaying];\n    } else {\n        return NO;\n    }\n}\n\n-(void) setVolume:(float) newVolume\n{\n    volume = newVolume;\n    if (state != kLAS_Init && !mute) {\n        audioSourcePlayer.volume = newVolume;\n    }    \n}\n\n-(float) volume \n{\n    return volume;\n}\n\n#pragma mark Audio Interrupt Protocol\n-(BOOL) mute\n{\n    return mute;\n}    \n\n-(void) setMute:(BOOL) muteValue \n{\n    if (mute != muteValue) {\n        if (mute) {\n            //Turn sound back on\n            audioSourcePlayer.volume = volume;\n        } else {\n            audioSourcePlayer.volume = 0.0f;\n        }\n        mute = muteValue;\n    }    \n}    \n\n-(BOOL) enabled \n{\n    return enabled_;\n}    \n\n-(void) setEnabled:(BOOL)enabledValue \n{\n    if (enabledValue != enabled_) {\n        enabled_ = enabledValue;\n        if (!enabled_) {\n            //\"Stop\" the sounds\n            [self pause];\n            [self rewind];\n        }    \n    }    \n}    \n\n-(NSInteger) numberOfLoops {\n    return numberOfLoops;\n}    \n\n-(void) setNumberOfLoops:(NSInteger) loopCount\n{\n    audioSourcePlayer.numberOfLoops = loopCount;\n    numberOfLoops = loopCount;\n}    \n\n- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - audio player finished\");\n#if TARGET_IPHONE_SIMULATOR    \n    CDLOGINFO(@\"Denshion::CDLongAudioSource - workaround for OpenAL clobbered audio issue\");\n    //This is a workaround for an issue in all simulators (tested to 3.1.2).  Problem is \n    //that OpenAL audio playback is clobbered when an AVAudioPlayer stops.  Workaround\n    //is to keep the player playing on an endless loop with 0 volume and then when\n    //it is played again reset the volume and set loop count appropriately.\n    //NB: this workaround is not foolproof but it is good enough for most situations.\n    player.numberOfLoops = -1;\n    player.volume = 0;\n    [player play];\n#endif    \n    if (delegate && [delegate respondsToSelector:@selector(cdAudioSourceDidFinishPlaying:)]) {\n        [delegate cdAudioSourceDidFinishPlaying:self];\n    }    \n}    \n\n-(void)audioPlayerBeginInterruption:(AVAudioPlayer *)player {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - audio player interrupted\");\n}\n\n-(void)audioPlayerEndInterruption:(AVAudioPlayer *)player {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - audio player resumed\");\n    if (self.backgroundMusic) {\n        //Check if background music can play as rules may have changed during \n        //the interruption. This is to address a specific issue in 4.x when\n        //fast task switching\n        if([CDAudioManager sharedManager].willPlayBackgroundMusic) {\n            [player play];\n        }    \n    } else {\n        [player play];\n    }    \n}    \n\n@end\n\n\n@interface CDAudioManager (PrivateMethods)\n-(BOOL) audioSessionSetActive:(BOOL) active;\n-(BOOL) audioSessionSetCategory:(NSString*) category;\n-(void) badAlContextHandler;\n@end\n\n\n@implementation CDAudioManager\n#define BACKGROUND_MUSIC_CHANNEL kASC_Left\n\n@synthesize soundEngine, willPlayBackgroundMusic;\nstatic CDAudioManager *sharedManager;\nstatic tAudioManagerState _sharedManagerState = kAMStateUninitialised;\nstatic tAudioManagerMode configuredMode;\nstatic BOOL configured = FALSE;\n\n-(BOOL) audioSessionSetActive:(BOOL) active {\n    NSError *activationError = nil;\n    if ([[AVAudioSession sharedInstance] setActive:active error:&activationError]) {\n        _audioSessionActive = active;\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session set active %i succeeded\", active); \n        return YES;\n    } else {\n        //Failed\n        CDLOG(@\"Denshion::CDAudioManager - Audio session set active %i failed with error %@\", active, activationError); \n        return NO;\n    }    \n}    \n\n-(BOOL) audioSessionSetCategory:(NSString*) category {\n    NSError *categoryError = nil;\n    if ([[AVAudioSession sharedInstance] setCategory:category error:&categoryError]) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session set category %@ succeeded\", category); \n        return YES;\n    } else {\n        //Failed\n        CDLOG(@\"Denshion::CDAudioManager - Audio session set category %@ failed with error %@\", category, categoryError); \n        return NO;\n    }    \n}    \n\n// Init\n+ (CDAudioManager *) sharedManager\n{\n    @synchronized(self)     {\n        if (!sharedManager) {\n            if (!configured) {\n                //Set defaults here\n                configuredMode = kAMM_FxPlusMusicIfNoOtherAudio;\n            }\n            sharedManager = [[CDAudioManager alloc] init:configuredMode];\n            _sharedManagerState = kAMStateInitialised;//This is only really relevant when using asynchronous initialisation\n            [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_AudioManagerInitialised object:nil];\n        }    \n    }\n    return sharedManager;\n}\n\n+ (tAudioManagerState) sharedManagerState {\n    return _sharedManagerState;\n}    \n\n/**\n * Call this to set up audio manager asynchronously.  Initialisation is finished when sharedManagerState == kAMStateInitialised\n */\n+ (void) initAsynchronously: (tAudioManagerMode) mode {\n    @synchronized(self) {\n        if (_sharedManagerState == kAMStateUninitialised) {\n            _sharedManagerState = kAMStateInitialising;\n            [CDAudioManager configure:mode];\n            CDAsynchInitialiser *initOp = [[[CDAsynchInitialiser alloc] init] autorelease];\n            NSOperationQueue *opQ = [[[NSOperationQueue alloc] init] autorelease];\n            [opQ addOperation:initOp];\n        }    \n    }\n}    \n\n+ (id) alloc\n{\n    @synchronized(self)     {\n        NSAssert(sharedManager == nil, @\"Attempted to allocate a second instance of a singleton.\");\n        return [super alloc];\n    }\n    return nil;\n}\n\n/*\n * Call this method before accessing the shared manager in order to configure the shared audio manager\n */\n+ (void) configure: (tAudioManagerMode) mode {\n    configuredMode = mode;\n    configured = TRUE;\n}    \n\n-(BOOL) isOtherAudioPlaying {\n    UInt32 isPlaying = 0;\n    UInt32 varSize = sizeof(isPlaying);\n    AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying, &varSize, &isPlaying);\n    return (isPlaying != 0);\n}\n\n-(void) setMode:(tAudioManagerMode) mode {\n\n    _mode = mode;\n    switch (_mode) {\n            \n        case kAMM_FxOnly:\n            //Share audio with other app\n            CDLOGINFO(@\"Denshion::CDAudioManager - Audio will be shared\");\n            //_audioSessionCategory = kAudioSessionCategory_AmbientSound;\n            _audioSessionCategory = AVAudioSessionCategoryAmbient;\n            willPlayBackgroundMusic = NO;\n            break;\n            \n        case kAMM_FxPlusMusic:\n            //Use audio exclusively - if other audio is playing it will be stopped\n            CDLOGINFO(@\"Denshion::CDAudioManager -  Audio will be exclusive\");\n            //_audioSessionCategory = kAudioSessionCategory_SoloAmbientSound;\n            _audioSessionCategory = AVAudioSessionCategorySoloAmbient;\n            willPlayBackgroundMusic = YES;\n            break;\n            \n        case kAMM_MediaPlayback:\n            //Use audio exclusively, ignore mute switch and sleep\n            CDLOGINFO(@\"Denshion::CDAudioManager -  Media playback mode, audio will be exclusive\");\n            //_audioSessionCategory = kAudioSessionCategory_MediaPlayback;\n            _audioSessionCategory = AVAudioSessionCategoryPlayback;\n            willPlayBackgroundMusic = YES;\n            break;\n            \n        case kAMM_PlayAndRecord:\n            //Use audio exclusively, ignore mute switch and sleep, has inputs and outputs\n            CDLOGINFO(@\"Denshion::CDAudioManager -  Play and record mode, audio will be exclusive\");\n            //_audioSessionCategory = kAudioSessionCategory_PlayAndRecord;\n            _audioSessionCategory = AVAudioSessionCategoryPlayAndRecord;\n            willPlayBackgroundMusic = YES;\n            break;\n            \n        default:\n            //kAudioManagerFxPlusMusicIfNoOtherAudio\n            if ([self isOtherAudioPlaying]) {\n                CDLOGINFO(@\"Denshion::CDAudioManager - Other audio is playing audio will be shared\");\n                //_audioSessionCategory = kAudioSessionCategory_AmbientSound;\n                _audioSessionCategory = AVAudioSessionCategoryAmbient;\n                willPlayBackgroundMusic = NO;\n            } else {\n                CDLOGINFO(@\"Denshion::CDAudioManager - Other audio is not playing audio will be exclusive\");\n                //_audioSessionCategory = kAudioSessionCategory_SoloAmbientSound;\n                _audioSessionCategory = AVAudioSessionCategorySoloAmbient;\n                willPlayBackgroundMusic = YES;\n            }    \n            \n            break;\n    }\n     \n    [self audioSessionSetCategory:_audioSessionCategory];\n    \n}    \n\n/**\n * This method is used to work around various bugs introduced in 4.x OS versions. In some circumstances the \n * audio session is interrupted but never resumed, this results in the loss of OpenAL audio when following \n * standard practices. If we detect this situation then we will attempt to resume the audio session ourselves.\n * Known triggers: lock the device then unlock it (iOS 4.2 gm), playback a song using MPMediaPlayer (iOS 4.0)\n */\n- (void) badAlContextHandler {\n    if (_interrupted && alcGetCurrentContext() == NULL) {\n        CDLOG(@\"Denshion::CDAudioManager - bad OpenAL context detected, attempting to resume audio session\");\n        [self audioSessionResumed];\n    }    \n}    \n\n- (id) init: (tAudioManagerMode) mode {\n    if ((self = [super init])) {\n        \n        //Initialise the audio session \n        AVAudioSession* session = [AVAudioSession sharedInstance];\n        session.delegate = self;\n    \n        _mode = mode;\n        backgroundMusicCompletionSelector = nil;\n        _isObservingAppEvents = FALSE;\n        _mute = NO;\n        _resigned = NO;\n        _interrupted = NO;\n        enabled_ = YES;\n        _audioSessionActive = NO;\n        [self setMode:mode];\n        soundEngine = [[CDSoundEngine alloc] init];\n        \n        //Set up audioSource channels\n        audioSourceChannels = [[NSMutableArray alloc] init];\n        CDLongAudioSource *leftChannel = [[CDLongAudioSource alloc] init];\n        leftChannel.backgroundMusic = YES;\n        CDLongAudioSource *rightChannel = [[CDLongAudioSource alloc] init];\n        rightChannel.backgroundMusic = NO;\n        [audioSourceChannels insertObject:leftChannel atIndex:kASC_Left];    \n        [audioSourceChannels insertObject:rightChannel atIndex:kASC_Right];\n        [leftChannel release];\n        [rightChannel release];\n        //Used to support legacy APIs\n        backgroundMusic = [self audioSourceForChannel:BACKGROUND_MUSIC_CHANNEL];\n        backgroundMusic.delegate = self;\n        \n        //Add handler for bad al context messages, these are posted by the sound engine.\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(badAlContextHandler) name:kCDN_BadAlContext object:nil];\n\n    }    \n    return self;        \n}    \n\n-(void) dealloc {\n    CDLOGINFO(@\"Denshion::CDAudioManager - deallocating\");\n    [self stopBackgroundMusic];\n    [soundEngine release];\n    [[NSNotificationCenter defaultCenter] removeObserver:self];\n    [self audioSessionSetActive:NO];\n    [audioSourceChannels release];\n    [super dealloc];\n}    \n\n/** Retrieves the audio source for the specified channel */\n-(CDLongAudioSource*) audioSourceForChannel:(tAudioSourceChannel) channel \n{\n    return (CDLongAudioSource*)[audioSourceChannels objectAtIndex:channel];\n}    \n\n/** Loads the data from the specified file path to the channel's audio source */\n-(CDLongAudioSource*) audioSourceLoad:(NSString*) filePath channel:(tAudioSourceChannel) channel\n{\n    CDLongAudioSource *audioSource = [self audioSourceForChannel:channel];\n    if (audioSource) {\n        [audioSource load:filePath];\n    }\n    return audioSource;\n}    \n\n-(BOOL) isBackgroundMusicPlaying {\n    return [self.backgroundMusic isPlaying];\n}    \n\n//NB: originally I tried using a route change listener and intended to store the current route,\n//however, on a 3gs running 3.1.2 no route change is generated when the user switches the \n//ringer mute switch to off (i.e. enables sound) therefore polling is the only reliable way to\n//determine ringer switch state\n-(BOOL) isDeviceMuted {\n\n#if TARGET_IPHONE_SIMULATOR\n    //Calling audio route stuff on the simulator causes problems\n    return NO;\n#else    \n    CFStringRef newAudioRoute;\n    UInt32 propertySize = sizeof (CFStringRef);\n    \n    AudioSessionGetProperty (\n                             kAudioSessionProperty_AudioRoute,\n                             &propertySize,\n                             &newAudioRoute\n                             );\n    \n    if (newAudioRoute == NULL) {\n        //Don't expect this to happen but playing safe otherwise a null in the CFStringCompare will cause a crash\n        return YES;\n    } else {    \n        CFComparisonResult newDeviceIsMuted =    CFStringCompare (\n                                                                 newAudioRoute,\n                                                                 (CFStringRef) @\"\",\n                                                                 0\n                                                                 );\n        \n        return (newDeviceIsMuted == kCFCompareEqualTo);\n    }    \n#endif\n}    \n\n#pragma mark Audio Interrupt Protocol\n\n-(BOOL) mute {\n    return _mute;\n}    \n\n-(void) setMute:(BOOL) muteValue {\n    if (muteValue != _mute) {\n        _mute = muteValue;\n        [soundEngine setMute:muteValue];\n        for( CDLongAudioSource *audioSource in audioSourceChannels) {\n            audioSource.mute = muteValue;\n        }    \n    }    \n}\n\n-(BOOL) enabled {\n    return enabled_;\n}    \n\n-(void) setEnabled:(BOOL) enabledValue {\n    if (enabledValue != enabled_) {\n        enabled_ = enabledValue;\n        [soundEngine setEnabled:enabled_];\n        for( CDLongAudioSource *audioSource in audioSourceChannels) {\n            audioSource.enabled = enabled_;\n        }    \n    }    \n}\n\n-(CDLongAudioSource*) backgroundMusic\n{\n    return backgroundMusic;\n}    \n\n//Load background music ready for playing\n-(void) preloadBackgroundMusic:(NSString*) filePath\n{\n    [self.backgroundMusic load:filePath];    \n}    \n\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop\n{\n    [self.backgroundMusic load:filePath];\n\n\tif (loop) {\n\t\t[self.backgroundMusic setNumberOfLoops:-1];\n\t} else {\n\t\t[self.backgroundMusic setNumberOfLoops:0];\n\t}\n\n\tif (!willPlayBackgroundMusic || _mute) {\n\t\tCDLOGINFO(@\"Denshion::CDAudioManager - play bgm aborted because audio is not exclusive or sound is muted\");\n\t\treturn;\n\t}\n\n\t[self.backgroundMusic play];\n}\n\n-(void) stopBackgroundMusic\n{\n    [self.backgroundMusic stop];\n}\n\n-(void) pauseBackgroundMusic\n{\n    [self.backgroundMusic pause];\n}    \n\n-(void) resumeBackgroundMusic\n{\n    if (!willPlayBackgroundMusic || _mute) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - resume bgm aborted because audio is not exclusive or sound is muted\");\n        return;\n    }\n    \n    if (![self.backgroundMusic paused]) {\n        return;\n    }\n    \n    [self.backgroundMusic resume];\n}    \n\n-(void) rewindBackgroundMusic\n{\n    [self.backgroundMusic rewind];\n}    \n\n-(void) setBackgroundMusicCompletionListener:(id) listener selector:(SEL) selector {\n    backgroundMusicCompletionListener = listener;\n    backgroundMusicCompletionSelector = selector;\n}    \n\n/*\n * Call this method to have the audio manager automatically handle application resign and\n * become active.  Pass a tAudioManagerResignBehavior to indicate the desired behavior\n * for resigning and becoming active again.\n *\n * If autohandle is YES then the applicationWillResignActive and applicationDidBecomActive \n * methods are automatically called, otherwise you must call them yourself at the appropriate time.\n *\n * Based on idea of Dominique Bongard\n */\n-(void) setResignBehavior:(tAudioManagerResignBehavior) resignBehavior autoHandle:(BOOL) autoHandle { \n\n    if (!_isObservingAppEvents && autoHandle) {\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(applicationWillResignActive:) name:@\"UIApplicationWillResignActiveNotification\" object:nil];\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(applicationDidBecomeActive:) name:@\"UIApplicationDidBecomeActiveNotification\" object:nil];\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(applicationWillTerminate:) name:@\"UIApplicationWillTerminateNotification\" object:nil];\n        _isObservingAppEvents = TRUE;\n    }\n    _resignBehavior = resignBehavior;\n}    \n\n- (void) applicationWillResignActive {\n    self->_resigned = YES;\n    \n    //Set the audio sesssion to one that allows sharing so that other audio won't be clobbered on resume\n    [self audioSessionSetCategory:AVAudioSessionCategoryAmbient];\n    \n    switch (_resignBehavior) {\n            \n        case kAMRBStopPlay:\n            \n            for( CDLongAudioSource *audioSource in audioSourceChannels) {\n                if (audioSource.isPlaying) {\n                    audioSource->systemPaused = YES;\n                    audioSource->systemPauseLocation = audioSource.audioSourcePlayer.currentTime;\n                    [audioSource stop];\n                } else {\n                    //Music is either paused or stopped, if it is paused it will be restarted\n                    //by OS so we will stop it.\n                    audioSource->systemPaused = NO;\n                    [audioSource stop];\n                }\n            }\n            break;\n            \n        case kAMRBStop:\n            //Stop music regardless of whether it is playing or not because if it was paused\n            //then the OS would resume it\n            for( CDLongAudioSource *audioSource in audioSourceChannels) {\n                [audioSource stop];\n            }    \n            \n        default:\n            break;\n            \n    }            \n    CDLOGINFO(@\"Denshion::CDAudioManager - handled resign active\");\n}\n\n//Called when application resigns active only if setResignBehavior has been called\n- (void) applicationWillResignActive:(NSNotification *) notification\n{\n    [self applicationWillResignActive];\n}    \n\n- (void) applicationDidBecomeActive {\n    \n    if (self->_resigned) {\n        _resigned = NO;\n        //Reset the mode incase something changed with audio while we were inactive\n        [self setMode:_mode];\n        switch (_resignBehavior) {\n                \n            case kAMRBStopPlay:\n                \n                //Music had been stopped but stop maintains current time\n                //so playing again will continue from where music was before resign active.\n                //We check if music can be played because while we were inactive the user might have\n                //done something that should force music to not play such as starting a track in the iPod\n                if (self.willPlayBackgroundMusic) {\n                    for( CDLongAudioSource *audioSource in audioSourceChannels) {\n                        if (audioSource->systemPaused) {\n                            [audioSource resume];\n                            audioSource->systemPaused = NO;\n                        }\n                    }\n                }\n                break;\n                \n            default:\n                break;\n                \n        }\n        CDLOGINFO(@\"Denshion::CDAudioManager - audio manager handled become active\");\n    }\n}\n\n//Called when application becomes active only if setResignBehavior has been called\n- (void) applicationDidBecomeActive:(NSNotification *) notification\n{\n    [self applicationDidBecomeActive];\n}\n\n//Called when application terminates only if setResignBehavior has been called \n- (void) applicationWillTerminate:(NSNotification *) notification\n{\n    CDLOGINFO(@\"Denshion::CDAudioManager - audio manager handling terminate\");\n    [self stopBackgroundMusic];\n}\n\n/** The audio source completed playing */\n- (void) cdAudioSourceDidFinishPlaying:(CDLongAudioSource *) audioSource {\n    CDLOGINFO(@\"Denshion::CDAudioManager - audio manager got told background music finished\");\n    if (backgroundMusicCompletionSelector != nil) {\n        [backgroundMusicCompletionListener performSelector:backgroundMusicCompletionSelector];\n    }    \n}    \n\n-(void) beginInterruption {\n    CDLOGINFO(@\"Denshion::CDAudioManager - begin interruption\");\n    [self audioSessionInterrupted];\n}\n\n-(void) endInterruption {\n    CDLOGINFO(@\"Denshion::CDAudioManager - end interruption\");\n    [self audioSessionResumed];\n}\n\n#if __CC_PLATFORM_IOS >= 40000\n-(void) endInterruptionWithFlags:(NSUInteger)flags {\n    CDLOGINFO(@\"Denshion::CDAudioManager - interruption ended with flags %i\",flags);\n    if (flags == AVAudioSessionInterruptionFlags_ShouldResume) {\n        [self audioSessionResumed];\n    }    \n}\n#endif\n\n-(void)audioSessionInterrupted \n{ \n    if (!_interrupted) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session interrupted\"); \n        _interrupted = YES;\n\n        // Deactivate the current audio session \n        [self audioSessionSetActive:NO];\n        \n        if (alcGetCurrentContext() != NULL) {\n            CDLOGINFO(@\"Denshion::CDAudioManager - Setting OpenAL context to NULL\"); \n\n            ALenum  error = AL_NO_ERROR;\n\n            // set the current context to NULL will 'shutdown' openAL \n            alcMakeContextCurrent(NULL); \n        \n            if((error = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDAudioManager - Error making context current %x\\n\", error);\n            } \n            #pragma unused(error)\n        }\n    }    \n} \n\n-(void)audioSessionResumed \n{ \n    if (_interrupted) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session resumed\"); \n        _interrupted = NO;\n        \n        BOOL activationResult = NO;\n        // Reactivate the current audio session\n        activationResult = [self audioSessionSetActive:YES]; \n        \n        //This code is to handle a problem with iOS 4.0 and 4.01 where reactivating the session can fail if\n        //task switching is performed too rapidly. A test case that reliably reproduces the issue is to call the\n        //iPhone and then hang up after two rings (timing may vary ;))\n        //Basically we keep waiting and trying to let the OS catch up with itself but the number of tries is\n        //limited.\n        if (!activationResult) {\n            CDLOG(@\"Denshion::CDAudioManager - Failure reactivating audio session, will try wait-try cycle\"); \n            int activateCount = 0;\n            while (!activationResult && activateCount < 10) {\n                [NSThread sleepForTimeInterval:0.5];\n                activationResult = [self audioSessionSetActive:YES]; \n                activateCount++;\n                CDLOGINFO(@\"Denshion::CDAudioManager - Reactivation attempt %i status = %i\",activateCount,activationResult); \n            }    \n        }\n        \n        if (alcGetCurrentContext() == NULL) {\n            CDLOGINFO(@\"Denshion::CDAudioManager - Restoring OpenAL context\"); \n            ALenum  error = AL_NO_ERROR;\n            // Restore open al context \n            alcMakeContextCurrent([soundEngine openALContext]); \n            if((error = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDAudioManager - Error making context current%x\\n\", error);\n            } \n            #pragma unused(error)\n        }    \n    }    \n}\n\n+(void) end {\n    [sharedManager release];\n    sharedManager = nil;\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n@implementation CDLongAudioSourceFader\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDLongAudioSource*)target).volume = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDLongAudioSource*)target).volume;\n}\n\n-(void) _stopTarget {\n    //Pause instead of stop as stop releases resources and causes problems in the simulator\n    [((CDLongAudioSource*)target) pause];\n}\n\n-(Class) _allowableType {\n    return [CDLongAudioSource class];\n}    \n\n@end\n///////////////////////////////////////////////////////////////////////////////////////\n@implementation CDBufferManager\n\n-(id) initWithEngine:(CDSoundEngine *) theSoundEngine {\n    if ((self = [super init])) {\n        soundEngine = theSoundEngine;\n        loadedBuffers = [[NSMutableDictionary alloc] initWithCapacity:CD_BUFFERS_START];\n        freedBuffers = [[NSMutableArray alloc] init];\n        nextBufferId = 0;\n    }    \n    return self;\n}    \n\n-(void) dealloc {\n    [loadedBuffers release];\n    [freedBuffers release];\n    [super dealloc];\n}    \n\n-(int) bufferForFile:(NSString*) filePath create:(BOOL) create {\n    \n    NSNumber* soundId = (NSNumber*)[loadedBuffers objectForKey:filePath];\n    if(soundId == nil)\n    {\n        if (create) {\n            NSNumber* bufferId = nil;\n            //First try to get a buffer from the free buffers\n            if ([freedBuffers count] > 0) {\n                bufferId = [[[freedBuffers lastObject] retain] autorelease];\n                [freedBuffers removeLastObject]; \n                CDLOGINFO(@\"Denshion::CDBufferManager reusing buffer id %i\",[bufferId intValue]);\n            } else {\n                bufferId = [[NSNumber alloc] initWithInt:nextBufferId];\n                [bufferId autorelease];\n                CDLOGINFO(@\"Denshion::CDBufferManager generating new buffer id %i\",[bufferId intValue]);\n                nextBufferId++;\n            }\n            \n            if ([soundEngine loadBuffer:[bufferId intValue] filePath:filePath]) {\n                //File successfully loaded\n                CDLOGINFO(@\"Denshion::CDBufferManager buffer loaded %@ %@\",bufferId,filePath);\n                [loadedBuffers setObject:bufferId forKey:filePath];\n                return [bufferId intValue];\n            } else {\n                //File didn't load, put buffer id on free list\n                [freedBuffers addObject:bufferId];\n                return kCDNoBuffer;\n            }    \n        } else {\n            //No matching buffer was found\n            return kCDNoBuffer;\n        }    \n    } else {\n        return [soundId intValue];\n    }    \n}    \n\n-(void) releaseBufferForFile:(NSString *) filePath {\n    int bufferId = [self bufferForFile:filePath create:NO];\n    if (bufferId != kCDNoBuffer) {\n        [soundEngine unloadBuffer:bufferId];\n        [loadedBuffers removeObjectForKey:filePath];\n        NSNumber *freedBufferId = [[NSNumber alloc] initWithInt:bufferId];\n        [freedBufferId autorelease];\n        [freedBuffers addObject:freedBufferId];\n    }    \n}    \n@end\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/CDConfig.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n#define COCOSDENSHION_VERSION \"Aphex.rc\"\n\n\n/**\n If enabled code useful for debugging such as parameter check assertions will be performed.\n If you experience any problems you should enable this and test your code with a debug build.\n */\n//#define CD_DEBUG 1\n\n/**\n The total number of sounds/buffers that can be loaded assuming memory is sufficient\n */\n//Number of buffers slots that will be initially created\n#define CD_BUFFERS_START 64\n//Number of buffers that will be added \n#define CD_BUFFERS_INCREMENT 16\n\n/**\n If enabled, OpenAL code will use static buffers. When static buffers are used the audio\n data is managed outside of OpenAL, this eliminates a memcpy operation which leads to \n higher performance when loading sounds.\n \n However, the downside is that when the audio data is freed you must\n be certain that it is no longer being accessed otherwise your app will crash. Testing on OS 2.2.1\n and 3.1.2 has shown that this may occur if a buffer is being used by a source with state = AL_PLAYING\n when the buffer is deleted. If the data is freed too quickly after the source is stopped then\n a crash will occur. The implemented workaround is that when static buffers are used the unloadBuffer code will wait for\n any playing sources to finish playing before the associated buffer and data are deleted, however, this delay may negate any \n performance gains that are achieved during loading.\n \n Performance tests on a 1st gen iPod running OS 2.2.1 loading the CocosDenshionDemo sounds were ~0.14 seconds without\n static buffers and ~0.12 seconds when using static buffers.\n\n */\n//#define CD_USE_STATIC_BUFFERS 1\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/CDOpenALSupport.h",
    "content": "/*\n \n Disclaimer: IMPORTANT:  This Apple software is supplied to you by\n Apple Inc. (\"Apple\") in consideration of your agreement to the\n following terms, and your use, installation, modification or\n redistribution of this Apple software constitutes acceptance of these\n terms.  If you do not agree with these terms, please do not use,\n install, modify or redistribute this Apple software.\n \n In consideration of your agreement to abide by the following terms, and\n subject to these terms, Apple grants you a personal, non-exclusive\n license, under Apple's copyrights in this original Apple software (the\n \"Apple Software\"), to use, reproduce, modify and redistribute the Apple\n Software, with or without modifications, in source and/or binary forms;\n provided that if you redistribute the Apple Software in its entirety and\n without modifications, you must retain this notice and the following\n text and disclaimers in all such redistributions of the Apple Software.\n Neither the name, trademarks, service marks or logos of Apple Inc.\n may be used to endorse or promote products derived from the Apple\n Software without specific prior written permission from Apple.  Except\n as expressly stated in this notice, no other rights or licenses, express\n or implied, are granted by Apple herein, including but not limited to\n any patent rights that may be infringed by your derivative works or by\n other works in which the Apple Software may be incorporated.\n \n The Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE\n MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION\n THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS\n FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND\n OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\n \n IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,\n MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED\n AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),\n STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n \n Copyright (C) 2009 Apple Inc. All Rights Reserved.\n \n $Id$\n */\n\n/*\n This file contains code from version 1.1 and 1.4 of MyOpenALSupport.h taken from Apple's oalTouch version.\n The 1.4 version code is used for loading IMA4 files, however, this code causes very noticeable clicking\n when used to load wave files that are looped so the 1.1 version code is used specifically for loading\n wav files.\n */\n\n#ifndef __CD_OPENAL_H\n#define __CD_OPENAL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif    \n    \n\n#import <OpenAL/al.h>\n#import <OpenAL/alc.h>\n#import <CoreFoundation/CFURL.h>\n\n\n//Taken from oalTouch MyOpenALSupport 1.1\nvoid* CDloadWaveAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei*    outSampleRate);\nvoid* CDloadCafAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate);\nvoid* CDGetOpenALAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate);\n    \n#ifdef __cplusplus\n}\n#endif\n\n#endif \n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/CDOpenALSupport.m",
    "content": "/*\n \n Disclaimer: IMPORTANT:  This Apple software is supplied to you by\n Apple Inc. (\"Apple\") in consideration of your agreement to the\n following terms, and your use, installation, modification or\n redistribution of this Apple software constitutes acceptance of these\n terms.  If you do not agree with these terms, please do not use,\n install, modify or redistribute this Apple software.\n \n In consideration of your agreement to abide by the following terms, and\n subject to these terms, Apple grants you a personal, non-exclusive\n license, under Apple's copyrights in this original Apple software (the\n \"Apple Software\"), to use, reproduce, modify and redistribute the Apple\n Software, with or without modifications, in source and/or binary forms;\n provided that if you redistribute the Apple Software in its entirety and\n without modifications, you must retain this notice and the following\n text and disclaimers in all such redistributions of the Apple Software.\n Neither the name, trademarks, service marks or logos of Apple Inc.\n may be used to endorse or promote products derived from the Apple\n Software without specific prior written permission from Apple.  Except\n as expressly stated in this notice, no other rights or licenses, express\n or implied, are granted by Apple herein, including but not limited to\n any patent rights that may be infringed by your derivative works or by\n other works in which the Apple Software may be incorporated.\n \n The Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE\n MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION\n THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS\n FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND\n OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\n \n IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,\n MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED\n AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),\n STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n \n Copyright (C) 2009 Apple Inc. All Rights Reserved.\n \n $Id: CDOpenALSupport.h 16 2010-03-11 06:22:10Z steveoldmeadow $\n */\n\n#import \"CDOpenALSupport.h\"\n#import \"CocosDenshion.h\"\n#import <AudioToolbox/AudioToolbox.h>\n#import <AudioToolbox/ExtendedAudioFile.h>\n\n//Taken from oalTouch MyOpenALSupport 1.1\nvoid* CDloadWaveAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei*    outSampleRate)\n{\n    OSStatus                        err = noErr;    \n    UInt64                            fileDataSize = 0;\n    AudioStreamBasicDescription        theFileFormat;\n    UInt32                            thePropertySize = sizeof(theFileFormat);\n    AudioFileID                        afid = 0;\n    void*                            theData = NULL;\n    \n    // Open a file with ExtAudioFileOpen()\n    err = AudioFileOpenURL(inFileURL, kAudioFileReadPermission, 0, &afid);\n    if(err) { CDLOG(@\"MyGetOpenALAudioData: AudioFileOpenURL FAILED, Error = %ld\\n\", err); goto Exit; }\n    \n    // Get the audio data format\n    err = AudioFileGetProperty(afid, kAudioFilePropertyDataFormat, &thePropertySize, &theFileFormat);\n    if(err) { CDLOG(@\"MyGetOpenALAudioData: AudioFileGetProperty(kAudioFileProperty_DataFormat) FAILED, Error = %ld\\n\", err); goto Exit; }\n    \n    if (theFileFormat.mChannelsPerFrame > 2)  { \n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, channel count is greater than stereo\\n\"); goto Exit;\n    }\n    \n    if ((theFileFormat.mFormatID != kAudioFormatLinearPCM) || (!TestAudioFormatNativeEndian(theFileFormat))) { \n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, must be little-endian PCM\\n\"); goto Exit;\n    }\n    \n    if ((theFileFormat.mBitsPerChannel != 8) && (theFileFormat.mBitsPerChannel != 16)) { \n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, must be 8 or 16 bit PCM\\n\"); goto Exit;\n    }\n    \n    \n    thePropertySize = sizeof(fileDataSize);\n    err = AudioFileGetProperty(afid, kAudioFilePropertyAudioDataByteCount, &thePropertySize, &fileDataSize);\n    if(err) { CDLOG(@\"MyGetOpenALAudioData: AudioFileGetProperty(kAudioFilePropertyAudioDataByteCount) FAILED, Error = %ld\\n\", err); goto Exit; }\n    \n    // Read all the data into memory\n    UInt32        dataSize = (UInt32)fileDataSize;\n    theData = malloc(dataSize);\n    if (theData)\n    {\n        memset(theData, 0, dataSize);\n        AudioFileReadBytes(afid, false, 0, &dataSize, theData);\n        if(err == noErr)\n        {\n            // success\n            *outDataSize = (ALsizei)dataSize;\n            //This fix was added by me, however, 8 bit sounds have a clipping sound at the end so aren't really usable (SO)\n            if (theFileFormat.mBitsPerChannel == 16) { \n                *outDataFormat = (theFileFormat.mChannelsPerFrame > 1) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;\n            } else {\n                *outDataFormat = (theFileFormat.mChannelsPerFrame > 1) ? AL_FORMAT_STEREO8 : AL_FORMAT_MONO8;    \n            }    \n            *outSampleRate = (ALsizei)theFileFormat.mSampleRate;\n        }\n        else \n        { \n            // failure\n            free (theData);\n            theData = NULL; // make sure to return NULL\n            CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileRead FAILED, Error = %ld\\n\", err); goto Exit;\n        }    \n    }\n    \nExit:\n    // Dispose the ExtAudioFileRef, it is no longer needed\n    if (afid) AudioFileClose(afid);\n    return theData;\n}\n\n//Taken from oalTouch MyOpenALSupport 1.4\nvoid* CDloadCafAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate)\n{\n    OSStatus                        status = noErr;\n    BOOL                            abort = NO;\n    SInt64                            theFileLengthInFrames = 0;\n    AudioStreamBasicDescription        theFileFormat;\n    UInt32                            thePropertySize = sizeof(theFileFormat);\n    ExtAudioFileRef                    extRef = NULL;\n    void*                            theData = NULL;\n    AudioStreamBasicDescription        theOutputFormat;\n    UInt32                            dataSize = 0;\n    \n    // Open a file with ExtAudioFileOpen()\n    status = ExtAudioFileOpenURL(inFileURL, &extRef);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileOpenURL FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Get the audio data format\n    status = ExtAudioFileGetProperty(extRef, kExtAudioFileProperty_FileDataFormat, &thePropertySize, &theFileFormat);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileGetProperty(kExtAudioFileProperty_FileDataFormat) FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    if (theFileFormat.mChannelsPerFrame > 2)\n    {\n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, channel count is greater than stereo\\n\");\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Set the client format to 16 bit signed integer (native-endian) data\n    // Maintain the channel count and sample rate of the original source format\n    theOutputFormat.mSampleRate = theFileFormat.mSampleRate;\n    theOutputFormat.mChannelsPerFrame = theFileFormat.mChannelsPerFrame;\n    \n    theOutputFormat.mFormatID = kAudioFormatLinearPCM;\n    theOutputFormat.mBytesPerPacket = 2 * theOutputFormat.mChannelsPerFrame;\n    theOutputFormat.mFramesPerPacket = 1;\n    theOutputFormat.mBytesPerFrame = 2 * theOutputFormat.mChannelsPerFrame;\n    theOutputFormat.mBitsPerChannel = 16;\n    theOutputFormat.mFormatFlags = kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger;\n    \n    // Set the desired client (output) data format\n    status = ExtAudioFileSetProperty(extRef, kExtAudioFileProperty_ClientDataFormat, sizeof(theOutputFormat), &theOutputFormat);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileSetProperty(kExtAudioFileProperty_ClientDataFormat) FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Get the total frame count\n    thePropertySize = sizeof(theFileLengthInFrames);\n    status = ExtAudioFileGetProperty(extRef, kExtAudioFileProperty_FileLengthFrames, &thePropertySize, &theFileLengthInFrames);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileGetProperty(kExtAudioFileProperty_FileLengthFrames) FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Read all the data into memory\n    dataSize = (UInt32) theFileLengthInFrames * theOutputFormat.mBytesPerFrame;\n    theData = malloc(dataSize);\n    if (theData)\n    {\n        memset(theData, 0, dataSize);\n        AudioBufferList        theDataBuffer;\n        theDataBuffer.mNumberBuffers = 1;\n        theDataBuffer.mBuffers[0].mDataByteSize = dataSize;\n        theDataBuffer.mBuffers[0].mNumberChannels = theOutputFormat.mChannelsPerFrame;\n        theDataBuffer.mBuffers[0].mData = theData;\n        \n        // Read the data into an AudioBufferList\n        status = ExtAudioFileRead(extRef, (UInt32*)&theFileLengthInFrames, &theDataBuffer);\n        if(status == noErr)\n        {\n            // success\n            *outDataSize = (ALsizei)dataSize;\n            *outDataFormat = (theOutputFormat.mChannelsPerFrame > 1) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;\n            *outSampleRate = (ALsizei)theOutputFormat.mSampleRate;\n        }\n        else\n        {\n            // failure\n            free (theData);\n            theData = NULL; // make sure to return NULL\n            CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileRead FAILED, Error = %ld\\n\", status);\n            abort = YES;\n        }\n    }\n    if (abort)\n        goto Exit;\n    \nExit:\n    // Dispose the ExtAudioFileRef, it is no longer needed\n    if (extRef) ExtAudioFileDispose(extRef);\n    return theData;\n}\n\nvoid* CDGetOpenALAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei*    outSampleRate) {\n    \n    CFStringRef extension = CFURLCopyPathExtension(inFileURL);\n    CFComparisonResult isWavFile = 0;\n    if (extension != NULL) {\n        isWavFile = CFStringCompare (extension,(CFStringRef)@\"wav\", kCFCompareCaseInsensitive);\n        CFRelease(extension);\n    }    \n    \n    if (isWavFile == kCFCompareEqualTo) {\n        return CDloadWaveAudioData(inFileURL, outDataSize, outDataFormat, outSampleRate);    \n    } else {\n        return CDloadCafAudioData(inFileURL, outDataSize, outDataFormat, outSampleRate);        \n    }\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/CocosDenshion.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n\n\n/** \n@file\n@b IMPORTANT\nThere are 3 different ways of using CocosDenshion. Depending on which you choose you \nwill need to include different files and frameworks.\n\n@par SimpleAudioEngine\nThis is recommended for basic audio requirements. If you just want to play some sound fx\nand some background music and have no interest in learning the lower level workings then\nthis is the interface to use.\n\nRequirements:\n - Firmware: OS 2.2 or greater \n - Files: SimpleAudioEngine.*, CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox, AVFoundation\n \n@par CDAudioManager\nCDAudioManager is basically a thin wrapper around an AVAudioPlayer object used for playing\nbackground music and a CDSoundEngine object used for playing sound effects. It manages the\naudio session for you deals with audio session interruption. It is fairly low level and it\nis expected you have some understanding of the underlying technologies. For example, for \nmany use cases regarding background music it is expected you will work directly with the\nbackgroundMusic AVAudioPlayer which is exposed as a property.\n \nRequirements:\n  - Firmware: OS 2.2 or greater \n  - Files: CDAudioManager.*, CocosDenshion.*\n  - Frameworks: OpenAL, AudioToolbox, AVFoundation\n\n@par CDSoundEngine\nCDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch \nexample. It can playback up to 32 sounds simultaneously with control over pitch, pan\nand gain.  It can be set up to handle audio session interruption automatically.  You \nmay decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine\nbecause you require OS 2.0 compatibility.\n \nRequirements:\n  - Firmware: OS 2.0 or greater \n  - Files: CocosDenshion.*\n  - Frameworks: OpenAL, AudioToolbox\n \n*/ \n\n#import <OpenAL/al.h>\n#import <OpenAL/alc.h>\n#import <AudioToolbox/AudioToolbox.h>\n#import <Foundation/Foundation.h>\n#import \"CDConfig.h\"\n\n\n#if !defined(CD_DEBUG) || CD_DEBUG == 0\n#define CDLOG(...) do {} while (0)\n#define CDLOGINFO(...) do {} while (0)\n\n#elif CD_DEBUG == 1\n#define CDLOG(...) NSLog(__VA_ARGS__)\n#define CDLOGINFO(...) do {} while (0)\n\n#elif CD_DEBUG > 1\n#define CDLOG(...) NSLog(__VA_ARGS__)\n#define CDLOGINFO(...) NSLog(__VA_ARGS__)\n#endif // CD_DEBUG\n\n\n#import \"CDOpenALSupport.h\"\n\n//Tested source limit on 2.2.1 and 3.1.2 with up to 128 sources and appears to work. Older OS versions e.g 2.2 may support only 32\n#define CD_SOURCE_LIMIT 32 //Total number of sources we will ever want, may actually get less\n#define CD_NO_SOURCE 0xFEEDFAC //Return value indicating playback failed i.e. no source\n#define CD_IGNORE_AUDIO_SESSION 0xBEEFBEE //Used internally to indicate audio session will not be handled\n#define CD_MUTE      0xFEEDBAB //Return value indicating sound engine is muted or non functioning\n#define CD_NO_SOUND = -1;\n\n#define CD_SAMPLE_RATE_HIGH 44100\n#define CD_SAMPLE_RATE_MID  22050\n#define CD_SAMPLE_RATE_LOW  16000\n#define CD_SAMPLE_RATE_BASIC 8000\n#define CD_SAMPLE_RATE_DEFAULT 44100\n\nextern NSString * const kCDN_BadAlContext;\nextern NSString * const kCDN_AsynchLoadComplete;\n\nextern float const kCD_PitchDefault;\nextern float const kCD_PitchLowerOneOctave;\nextern float const kCD_PitchHigherOneOctave;\nextern float const kCD_PanDefault;\nextern float const kCD_PanFullLeft;\nextern float const kCD_PanFullRight;\nextern float const kCD_GainDefault;\n\nenum bufferState {\n    CD_BS_EMPTY = 0,\n    CD_BS_LOADED = 1,\n    CD_BS_FAILED = 2\n};\n\ntypedef struct _sourceGroup {\n    int startIndex;\n    int currentIndex;\n    int totalSources;\n    bool enabled;\n    bool nonInterruptible;\n    int *sourceStatuses;//pointer into array of source status information\n} sourceGroup;\n\ntypedef struct _bufferInfo {\n    ALuint bufferId;\n    int bufferState;\n    void* bufferData;\n    ALenum format;\n    ALsizei sizeInBytes;\n    ALsizei frequencyInHertz;\n} bufferInfo;    \n\ntypedef struct _sourceInfo {\n    bool usable;\n    ALuint sourceId;\n    ALuint attachedBufferId;\n} sourceInfo;    \n\n#pragma mark CDAudioTransportProtocol\n\n@protocol CDAudioTransportProtocol <NSObject>\n/** Play the audio */\n-(BOOL) play;\n/** Pause the audio, retain resources */\n-(BOOL) pause;\n/** Stop the audio, release resources */\n-(BOOL) stop;\n/** Return playback to beginning */\n-(BOOL) rewind;\n@end\n\n#pragma mark CDAudioInterruptProtocol\n\n@protocol CDAudioInterruptProtocol <NSObject>\n/** Is audio mute */\n-(BOOL) mute;\n/** If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently */\n-(void) setMute:(BOOL) muteValue;\n/** Is audio enabled */\n-(BOOL) enabled;\n/** If NO then all audio is stopped and any calls to start new audio will be ignored */\n-(void) setEnabled:(BOOL) enabledValue;\n@end\n\n#pragma mark CDUtilities\n/**\n Collection of utilities required by CocosDenshion\n */\n@interface CDUtilities : NSObject\n{\n}    \n\n/** Fundamentally the same as the corresponding method is FileUtils but added to break binding to cocos2d */\n+(NSString*) fullPathFromRelativePath:(NSString*) relPath;\n\n@end\n\n\n#pragma mark CDSoundEngine\n\n/** CDSoundEngine is built upon OpenAL and works with SDK 2.0.\n CDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch \n example. It can playback up to 32 sounds simultaneously with control over pitch, pan\n and gain.  It can be set up to handle audio session interruption automatically.  You \n may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine\n because you require OS 2.0 compatibility.\n \n Requirements:\n - Firmware: OS 2.0 or greater \n - Files: CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox\n \n @since v0.8\n */\n@class CDSoundSource;\n@interface CDSoundEngine : NSObject <CDAudioInterruptProtocol> {\n    \n    bufferInfo        *_buffers;\n    sourceInfo        *_sources;\n    sourceGroup        *_sourceGroups;\n    ALCcontext        *context;\n    NSUInteger        _sourceGroupTotal;\n    UInt32            _audioSessionCategory;\n    BOOL            _handleAudioSession;\n    ALfloat            _preMuteGain;\n    NSObject        *_mutexBufferLoad;\n    BOOL            mute_;\n    BOOL            enabled_;\n\n    ALenum            lastErrorCode_;\n    BOOL            functioning_;\n    float            asynchLoadProgress_;\n    BOOL            getGainWorks_;\n    \n    //For managing dynamic allocation of sources and buffers\n    int sourceTotal_;\n    int bufferTotal;\n     \n}\n\n@property (readwrite, nonatomic) ALfloat masterGain;\n@property (readonly)  ALenum lastErrorCode;//Last OpenAL error code that was generated\n@property (readonly)  BOOL functioning;//Is the sound engine functioning\n@property (readwrite) float asynchLoadProgress;\n@property (readonly)  BOOL getGainWorks;//Does getting the gain for a source work\n/** Total number of sources available */\n@property (readonly) int sourceTotal;\n/** Total number of source groups that have been defined */\n@property (readonly) NSUInteger sourceGroupTotal;\n\n/** Sets the sample rate for the audio mixer. For best performance this should match the sample rate of your audio content */\n+(void) setMixerSampleRate:(Float32) sampleRate;\n\n/** Initializes the engine with a group definition and a total number of groups */\n-(id)init;\n\n/** Plays a sound in a channel group with a pitch, pan and gain. The sound could played looped or not */\n-(ALuint) playSound:(int) soundId sourceGroupId:(int)sourceGroupId pitch:(float) pitch pan:(float) pan gain:(float) gain loop:(BOOL) loop;\n\n/** Creates and returns a sound source object for the specified sound within the specified source group.\n */\n-(CDSoundSource *) soundSourceForSound:(int) soundId sourceGroupId:(int) sourceGroupId;\n\n/** Stops playing a sound */\n- (void) stopSound:(ALuint) sourceId;\n/** Stops playing a source group */\n- (void) stopSourceGroup:(int) sourceGroupId;\n/** Stops all playing sounds */\n-(void) stopAllSounds;\n/** Pause a sound */\n-(void) pauseSound:(ALuint) sourceId;\n/** Pause all sounds */\n-(void) pauseAllSounds;\n/** Resume a sound */\n-(void) resumeSound:(ALuint) sourceId;\n/** Resume all sounds */\n-(void) resumeAllSounds;\n-(void) defineSourceGroups:(NSArray*) sourceGroupDefinitions;\n-(void) defineSourceGroups:(int[]) sourceGroupDefinitions total:(NSUInteger) total;\n-(void) setSourceGroupNonInterruptible:(int) sourceGroupId isNonInterruptible:(BOOL) isNonInterruptible;\n-(void) setSourceGroupEnabled:(int) sourceGroupId enabled:(BOOL) enabled;\n-(BOOL) sourceGroupEnabled:(int) sourceGroupId;\n-(BOOL) loadBufferFromData:(int) soundId soundData:(ALvoid*) soundData format:(ALenum) format size:(ALsizei) size freq:(ALsizei) freq;\n-(BOOL) loadBuffer:(int) soundId filePath:(NSString*) filePath;\n-(void) loadBuffersAsynchronously:(NSArray *) loadRequests;\n-(BOOL) unloadBuffer:(int) soundId;\n-(ALCcontext *) openALContext;\n\n/** Returns the duration of the buffer in seconds or a negative value if the buffer id is invalid */\n-(float) bufferDurationInSeconds:(int) soundId;\n/** Returns the size of the buffer in bytes or a negative value if the buffer id is invalid */\n-(ALsizei) bufferSizeInBytes:(int) soundId;\n/** Returns the sampling frequency of the buffer in hertz or a negative value if the buffer id is invalid */\n-(ALsizei) bufferFrequencyInHertz:(int) soundId;\n\n/** Used internally, never call unless you know what you are doing */\n-(void) _soundSourcePreRelease:(CDSoundSource *) soundSource;\n\n@end\n\n#pragma mark CDSoundSource\n/** CDSoundSource is a wrapper around an OpenAL sound source.\n It allows you to manipulate properties such as pitch, gain, pan and looping while the \n sound is playing. CDSoundSource is based on the old CDSourceWrapper class but with much\n added functionality.\n \n @since v1.0\n */\n@interface CDSoundSource : NSObject <CDAudioTransportProtocol, CDAudioInterruptProtocol> {\n    ALenum lastError;\n@public\n    ALuint _sourceId;\n    ALuint _sourceIndex;\n    CDSoundEngine* _engine;\n    int _soundId;\n    float _preMuteGain;\n    BOOL enabled_;\n    BOOL mute_;\n}\n@property (readwrite, nonatomic) float pitch;\n@property (readwrite, nonatomic) float gain;\n@property (readwrite, nonatomic) float pan;\n@property (readwrite, nonatomic) BOOL looping;\n@property (readonly)  BOOL isPlaying;\n@property (readwrite, nonatomic) int soundId;\n/** Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid */\n@property (readonly) float durationInSeconds;\n\n/** Stores the last error code that occurred. Check against AL_NO_ERROR */\n@property (readonly) ALenum lastError;\n/** Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine */\n-(id)init:(ALuint) theSourceId sourceIndex:(int) index soundEngine:(CDSoundEngine*) engine;\n\n@end\n\n#pragma mark CDAudioInterruptTargetGroup\n\n/** Container for objects that implement audio interrupt protocol i.e. they can be muted and enabled.\n Setting mute and enabled for the group propagates to all children. \n Designed to be used with your CDSoundSource objects to get them to comply with global enabled and mute settings\n if that is what you want to do.*/\n@interface CDAudioInterruptTargetGroup : NSObject <CDAudioInterruptProtocol> {\n    BOOL mute_;\n    BOOL enabled_;\n    NSMutableArray *children_;\n}\n-(void) addAudioInterruptTarget:(NSObject<CDAudioInterruptProtocol>*) interruptibleTarget;\n@end\n\n#pragma mark CDAsynchBufferLoader\n\n/** CDAsynchBufferLoader\n TODO\n */\n@interface CDAsynchBufferLoader : NSOperation {\n    NSArray *_loadRequests;\n    CDSoundEngine *_soundEngine;\n}    \n\n-(id) init:(NSArray *)loadRequests soundEngine:(CDSoundEngine *) theSoundEngine;\n\n@end\n\n#pragma mark CDBufferLoadRequest\n\n/** CDBufferLoadRequest */\n@interface CDBufferLoadRequest: NSObject\n{\n    NSString *filePath;\n    int         soundId;\n    //id       loader;\n}\n\n@property (readonly) NSString *filePath;\n@property (readonly) int soundId;\n\n- (id)init:(int) theSoundId filePath:(const NSString *) theFilePath;\n@end\n\n/** Interpolation type */\ntypedef enum {\n    kIT_Linear,            //!Straight linear interpolation fade\n    kIT_SCurve,            //!S curved interpolation\n    kIT_Exponential     //!Exponential interpolation\n} tCDInterpolationType;\n\n#pragma mark CDFloatInterpolator\n@interface CDFloatInterpolator: NSObject\n{\n    float start;\n    float end;\n    float lastValue;\n    tCDInterpolationType interpolationType;\n}\n@property (readwrite, nonatomic) float start;\n@property (readwrite, nonatomic) float end;\n@property (readwrite, nonatomic) tCDInterpolationType interpolationType;\n\n/** Return a value between min and max based on t which represents fractional progress where 0 is the start\n and 1 is the end */\n-(float) interpolate:(float) t;\n-(id) init:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal;\n\n@end\n\n#pragma mark CDPropertyModifier\n\n/** Base class for classes that modify properties such as pitch, pan and gain */\n@interface CDPropertyModifier: NSObject\n{\n    CDFloatInterpolator *interpolator;\n    float startValue;\n    float endValue;\n    id target;\n    BOOL stopTargetWhenComplete;\n    \n}\n@property (readwrite, nonatomic) BOOL stopTargetWhenComplete;\n@property (readwrite, nonatomic) float startValue;\n@property (readwrite, nonatomic) float endValue;\n@property (readwrite, nonatomic) tCDInterpolationType interpolationType;\n\n-(id) init:(id) theTarget interpolationType:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal;\n/** Set to a fractional value between 0 and 1 where 0 equals the start and 1 equals the end*/\n-(void) modify:(float) t;\n\n-(void) _setTargetProperty:(float) newVal;\n-(float) _getTargetProperty;\n-(void) _stopTarget;\n-(Class) _allowableType;\n\n@end\n\n#pragma mark CDSoundSourceFader\n\n/** Fader for CDSoundSource objects */\n@interface CDSoundSourceFader : CDPropertyModifier{}\n@end\n\n#pragma mark CDSoundSourcePanner\n\n/** Panner for CDSoundSource objects */\n@interface CDSoundSourcePanner : CDPropertyModifier{}\n@end\n\n#pragma mark CDSoundSourcePitchBender\n\n/** Pitch bender for CDSoundSource objects */\n@interface CDSoundSourcePitchBender : CDPropertyModifier{}\n@end\n\n#pragma mark CDSoundEngineFader\n\n/** Fader for CDSoundEngine objects */\n@interface CDSoundEngineFader : CDPropertyModifier{}\n@end\n\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/CocosDenshion.m",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n#import \"CocosDenshion.h\"\n\nALvoid  alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);\nALvoid  alcMacOSXMixerOutputRateProc(const ALdouble value);\n\n\ntypedef ALvoid    AL_APIENTRY    (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);\nALvoid  alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq)\n{\n    static    alBufferDataStaticProcPtr    proc = NULL;\n    \n    if (proc == NULL) {\n        proc = (alBufferDataStaticProcPtr) alcGetProcAddress(NULL, (const ALCchar*) \"alBufferDataStatic\");\n    }\n    \n    if (proc)\n        proc(bid, format, data, size, freq);\n    \n    return;\n}\n\ntypedef ALvoid    AL_APIENTRY    (*alcMacOSXMixerOutputRateProcPtr) (const ALdouble value);\nALvoid  alcMacOSXMixerOutputRateProc(const ALdouble value)\n{\n    static    alcMacOSXMixerOutputRateProcPtr    proc = NULL;\n    \n    if (proc == NULL) {\n        proc = (alcMacOSXMixerOutputRateProcPtr) alcGetProcAddress(NULL, (const ALCchar*) \"alcMacOSXMixerOutputRate\");\n    }\n    \n    if (proc)\n        proc(value);\n    \n    return;\n}\n\nNSString * const kCDN_BadAlContext = @\"kCDN_BadAlContext\";\nNSString * const kCDN_AsynchLoadComplete = @\"kCDN_AsynchLoadComplete\";\nfloat const kCD_PitchDefault = 1.0f;\nfloat const kCD_PitchLowerOneOctave = 0.5f;\nfloat const kCD_PitchHigherOneOctave = 2.0f;\nfloat const kCD_PanDefault = 0.0f;\nfloat const kCD_PanFullLeft = -1.0f;\nfloat const kCD_PanFullRight = 1.0f;\nfloat const kCD_GainDefault = 1.0f;\n\n@interface CDSoundEngine (PrivateMethods)\n-(BOOL) _initOpenAL;\n-(void) _testGetGain;\n-(void) _dumpSourceGroupsInfo;\n-(void) _getSourceIndexForSourceGroup;\n-(void) _freeSourceGroups;\n-(BOOL) _setUpSourceGroups:(int[]) definitions total:(NSUInteger) total; \n@end\n\n#pragma mark - CDUtilities\n\n@implementation CDUtilities\n\n+(NSString*) fullPathFromRelativePath:(NSString*) relPath\n{\n    // do not convert an absolute path (starting with '/')\n    if(([relPath length] > 0) && ([relPath characterAtIndex:0] == '/'))\n    {\n        return relPath;\n    }\n    \n    NSMutableArray *imagePathComponents = [NSMutableArray arrayWithArray:[relPath pathComponents]];\n    NSString *file = [imagePathComponents lastObject];\n    \n    [imagePathComponents removeLastObject];\n    NSString *imageDirectory = [NSString pathWithComponents:imagePathComponents];\n    \n    NSString *fullpath = [[NSBundle mainBundle] pathForResource:file ofType:nil inDirectory:imageDirectory];\n    if (fullpath == nil)\n        fullpath = relPath;\n    \n    return fullpath;    \n}\n\n@end\n\n#pragma mark -\n#pragma mark CDSoundEngine\n\n@implementation CDSoundEngine\n\nstatic Float32 _mixerSampleRate;\nstatic BOOL _mixerRateSet = NO;\n\n@synthesize lastErrorCode = lastErrorCode_;\n@synthesize functioning = functioning_;\n@synthesize asynchLoadProgress = asynchLoadProgress_;\n@synthesize getGainWorks = getGainWorks_;\n@synthesize sourceTotal = sourceTotal_;\n\n+ (void) setMixerSampleRate:(Float32) sampleRate {\n    _mixerRateSet = YES;\n    _mixerSampleRate = sampleRate;\n}    \n\n- (void) _testGetGain {\n    float testValue = 0.7f;\n    ALuint testSourceId = _sources[0].sourceId;\n    alSourcef(testSourceId, AL_GAIN, 0.0f);//Start from know value\n    alSourcef(testSourceId, AL_GAIN, testValue);\n    ALfloat gainVal;\n    alGetSourcef(testSourceId, AL_GAIN, &gainVal);\n    getGainWorks_ = (gainVal == testValue);\n}\n\n//Generate sources one at a time until we fail\n-(void) _generateSources {\n    \n    _sources = (sourceInfo*)malloc( sizeof(_sources[0]) * CD_SOURCE_LIMIT);\n    BOOL hasFailed = NO;\n    sourceTotal_ = 0;\n    alGetError();//Clear error\n    while (!hasFailed && sourceTotal_ < CD_SOURCE_LIMIT) {\n        alGenSources(1, &(_sources[sourceTotal_].sourceId));\n        if (alGetError() == AL_NO_ERROR) {\n            //Now try attaching source to null buffer\n            alSourcei(_sources[sourceTotal_].sourceId, AL_BUFFER, 0);\n            if (alGetError() == AL_NO_ERROR) {\n                _sources[sourceTotal_].usable = true;    \n                sourceTotal_++;\n            } else {\n                hasFailed = YES;\n            }    \n        } else {\n            _sources[sourceTotal_].usable = false;\n            hasFailed = YES;\n        }    \n    }\n    //Mark the rest of the sources as not usable\n    for (int i=sourceTotal_; i < CD_SOURCE_LIMIT; i++) {\n        _sources[i].usable = false;\n    }    \n}    \n\n-(void) _generateBuffers:(int) startIndex endIndex:(int) endIndex {\n    if (_buffers) {\n        alGetError();\n        for (int i=startIndex; i <= endIndex; i++) {\n            alGenBuffers(1, &_buffers[i].bufferId);\n            _buffers[i].bufferData = NULL;\n            if (alGetError() == AL_NO_ERROR) {\n                _buffers[i].bufferState = CD_BS_EMPTY;\n            } else {\n                _buffers[i].bufferState = CD_BS_FAILED;\n                CDLOG(@\"Denshion::CDSoundEngine - buffer creation failed %i\",i);\n            }    \n        }\n    }    \n}\n\n/**\n * Internal method called during init\n */\n- (BOOL) _initOpenAL\n{\n    //ALenum            error;\n    context = NULL;\n    ALCdevice        *newDevice = NULL;\n\n    //Set the mixer rate for the audio mixer\n    if (!_mixerRateSet) {\n        _mixerSampleRate = CD_SAMPLE_RATE_DEFAULT;\n    }\n    alcMacOSXMixerOutputRateProc(_mixerSampleRate);\n    CDLOGINFO(@\"Denshion::CDSoundEngine - mixer output rate set to %0.2f\",_mixerSampleRate);\n    \n    // Create a new OpenAL Device\n    // Pass NULL to specify the system's default output device\n    newDevice = alcOpenDevice(NULL);\n    if (newDevice != NULL)\n    {\n        // Create a new OpenAL Context\n        // The new context will render to the OpenAL Device just created \n        context = alcCreateContext(newDevice, 0);\n        if (context != NULL)\n        {\n            // Make the new context the Current OpenAL Context\n            alcMakeContextCurrent(context);\n            \n            // Create some OpenAL Buffer Objects\n            [self _generateBuffers:0 endIndex:bufferTotal-1];\n            \n            // Create some OpenAL Source Objects\n            [self _generateSources];\n            \n        }\n    } else {\n        return FALSE;//No device\n    }    \n    alGetError();//Clear error\n    return TRUE;\n}\n\n- (void) dealloc {\n    \n    ALCcontext    *currentContext = NULL;\n    ALCdevice    *device = NULL;\n    \n    [self stopAllSounds];\n\n    CDLOGINFO(@\"Denshion::CDSoundEngine - Deallocing sound engine.\");\n    [self _freeSourceGroups];\n    \n    // Delete the Sources\n    CDLOGINFO(@\"Denshion::CDSoundEngine - deleting sources.\");\n    for (int i=0; i < sourceTotal_; i++) {\n        alSourcei(_sources[i].sourceId, AL_BUFFER, 0);//Detach from current buffer\n        alDeleteSources(1, &(_sources[i].sourceId));\n        if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n            CDLOG(@\"Denshion::CDSoundEngine - Error deleting source! %x\\n\", lastErrorCode_);\n        } \n    }    \n\n    // Delete the Buffers\n    CDLOGINFO(@\"Denshion::CDSoundEngine - deleting buffers.\");\n    for (int i=0; i < bufferTotal; i++) {\n        alDeleteBuffers(1, &_buffers[i].bufferId);\n#ifdef CD_USE_STATIC_BUFFERS\n        if (_buffers[i].bufferData) {\n            free(_buffers[i].bufferData);\n        }    \n#endif        \n    }    \n    CDLOGINFO(@\"Denshion::CDSoundEngine - free buffers.\");\n    free(_buffers);\n    currentContext = alcGetCurrentContext();\n    //Get device for active context\n    device = alcGetContextsDevice(currentContext);\n    //Release context\n    CDLOGINFO(@\"Denshion::CDSoundEngine - destroy context.\");\n    alcMakeContextCurrent(NULL);\n    alcDestroyContext(currentContext);\n    //Close device\n    CDLOGINFO(@\"Denshion::CDSoundEngine - close device.\");\n    alcCloseDevice(device);\n    CDLOGINFO(@\"Denshion::CDSoundEngine - free sources.\");\n    free(_sources);\n    \n    //Release mutexes\n    [_mutexBufferLoad release];\n    \n    [super dealloc];\n}    \n\n-(NSUInteger) sourceGroupTotal {\n    return _sourceGroupTotal;\n}    \n\n-(void) _freeSourceGroups \n{\n    CDLOGINFO(@\"Denshion::CDSoundEngine freeing source groups\");\n    if(_sourceGroups) {\n        for (int i=0; i < _sourceGroupTotal; i++) {\n            if (_sourceGroups[i].sourceStatuses) {\n                free(_sourceGroups[i].sourceStatuses);\n                CDLOGINFO(@\"Denshion::CDSoundEngine freed source statuses %i\",i);\n            }    \n        }\n        free(_sourceGroups);\n    }    \n}    \n\n-(BOOL) _redefineSourceGroups:(int[]) definitions total:(NSUInteger) total\n{\n    if (_sourceGroups) {\n        //Stop all sounds\n        [self stopAllSounds];\n        //Need to free source groups\n        [self _freeSourceGroups];\n    }\n    return [self _setUpSourceGroups:definitions total:total];\n}    \n\n-(BOOL) _setUpSourceGroups:(int[]) definitions total:(NSUInteger) total \n{\n    _sourceGroups = (sourceGroup *)malloc( sizeof(_sourceGroups[0]) * total);\n    if(!_sourceGroups) {\n        CDLOG(@\"Denshion::CDSoundEngine - source groups memory allocation failed\");\n        return NO;\n    }\n    \n    _sourceGroupTotal = total;\n    int sourceCount = 0;\n    for (int i=0; i < _sourceGroupTotal; i++) {\n        \n        _sourceGroups[i].startIndex = 0;\n        _sourceGroups[i].currentIndex = _sourceGroups[i].startIndex;\n        _sourceGroups[i].enabled = false;\n        _sourceGroups[i].nonInterruptible = false;\n        _sourceGroups[i].totalSources = definitions[i];\n        _sourceGroups[i].sourceStatuses = malloc(sizeof(_sourceGroups[i].sourceStatuses[0]) * _sourceGroups[i].totalSources);\n        if (_sourceGroups[i].sourceStatuses) {\n            for (int j=0; j < _sourceGroups[i].totalSources; j++) {\n                //First bit is used to indicate whether source is locked, index is shifted back 1 bit\n                _sourceGroups[i].sourceStatuses[j] = (sourceCount + j) << 1;    \n            }    \n        }    \n        sourceCount += definitions[i];\n    }\n    return YES;\n}\n\n-(void) defineSourceGroups:(int[]) sourceGroupDefinitions total:(NSUInteger) total {\n    [self _redefineSourceGroups:sourceGroupDefinitions total:total];\n}\n\n-(void) defineSourceGroups:(NSArray*) sourceGroupDefinitions {\n    CDLOGINFO(@\"Denshion::CDSoundEngine - source groups defined by NSArray.\");\n    NSUInteger totalDefs = [sourceGroupDefinitions count];\n    int* defs = (int *)malloc( sizeof(int) * totalDefs);\n    int currentIndex = 0;\n    for (id currentDef in sourceGroupDefinitions) {\n        if ([currentDef isKindOfClass:[NSNumber class]]) {\n            defs[currentIndex] = (int)[(NSNumber*)currentDef integerValue];\n            CDLOGINFO(@\"Denshion::CDSoundEngine - found definition %i.\",defs[currentIndex]);\n        } else {\n            CDLOG(@\"Denshion::CDSoundEngine - warning, did not understand source definition.\");\n            defs[currentIndex] = 0;\n        }    \n        currentIndex++;\n    }\n    [self _redefineSourceGroups:defs total:totalDefs];\n    free(defs);\n}    \n\n- (id)init\n{    \n    if ((self = [super init])) {\n        \n        //Create mutexes\n        _mutexBufferLoad = [[NSObject alloc] init];\n        \n        asynchLoadProgress_ = 0.0f;\n        \n        bufferTotal = CD_BUFFERS_START;\n        _buffers = (bufferInfo *)malloc( sizeof(_buffers[0]) * bufferTotal);\n    \n        // Initialize our OpenAL environment\n        if ([self _initOpenAL]) {\n            //Set up the default source group - a single group that contains all the sources\n            int sourceDefs[1];\n            sourceDefs[0] = self.sourceTotal;\n            [self _setUpSourceGroups:sourceDefs total:1];\n\n            functioning_ = YES;\n            //Synchronize premute gain\n            _preMuteGain = self.masterGain;\n            mute_ = NO;\n            enabled_ = YES;\n            //Test whether get gain works for sources\n            [self _testGetGain];\n        } else {\n            //Something went wrong with OpenAL\n            functioning_ = NO;\n        }\n    }\n    \n    return self;\n}\n\n/**\n * Delete the buffer identified by soundId\n * @return true if buffer deleted successfully, otherwise false\n */\n- (BOOL) unloadBuffer:(int) soundId \n{\n    //Ensure soundId is within array bounds otherwise memory corruption will occur\n    if (soundId < 0 || soundId >= bufferTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine - soundId is outside array bounds, maybe you need to increase CD_MAX_BUFFERS\");\n        return FALSE;\n    }    \n    \n    //Before a buffer can be deleted any sources that are attached to it must be stopped\n    for (int i=0; i < sourceTotal_; i++) {\n        //Note: tried getting the AL_BUFFER attribute of the source instead but doesn't\n        //appear to work on a device - just returned zero.\n        if (_buffers[soundId].bufferId == _sources[i].attachedBufferId) {\n            \n            CDLOG(@\"Denshion::CDSoundEngine - Found attached source %i %i %i\",i,_buffers[soundId].bufferId,_sources[i].sourceId);\n#ifdef CD_USE_STATIC_BUFFERS\n            //When using static buffers a crash may occur if a source is playing with a buffer that is about\n            //to be deleted even though we stop the source and successfully delete the buffer. Crash is confirmed\n            //on 2.2.1 and 3.1.2, however, it will only occur if a source is used rapidly after having its prior\n            //data deleted. To avoid any possibility of the crash we wait for the source to finish playing.\n            ALint state;\n            \n            alGetSourcei(_sources[i].sourceId, AL_SOURCE_STATE, &state);\n            \n            if (state == AL_PLAYING) {\n                CDLOG(@\"Denshion::CDSoundEngine - waiting for source to complete playing before removing buffer data\"); \n                alSourcei(_sources[i].sourceId, AL_LOOPING, FALSE);//Turn off looping otherwise loops will never end\n                while (state == AL_PLAYING) {\n                    alGetSourcei(_sources[i].sourceId, AL_SOURCE_STATE, &state);\n                    usleep(10000);\n                }\n            }\n#endif            \n            //Stop source and detach\n            alSourceStop(_sources[i].sourceId);    \n            if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDSoundEngine - error stopping source: %x\\n\", lastErrorCode_);\n            }    \n            \n            alSourcei(_sources[i].sourceId, AL_BUFFER, 0);//Attach to \"NULL\" buffer to detach\n            if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDSoundEngine - error detaching buffer: %x\\n\", lastErrorCode_);\n            } else {\n                //Record that source is now attached to nothing\n                _sources[i].attachedBufferId = 0;\n            }    \n        }    \n    }    \n    \n    alDeleteBuffers(1, &_buffers[soundId].bufferId);\n    if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n        CDLOG(@\"Denshion::CDSoundEngine - error deleting buffer: %x\\n\", lastErrorCode_);\n        _buffers[soundId].bufferState = CD_BS_FAILED;\n        return FALSE;\n    } else {\n#ifdef CD_USE_STATIC_BUFFERS\n        //Free previous data, if alDeleteBuffer has returned without error then no \n        if (_buffers[soundId].bufferData) {\n            CDLOGINFO(@\"Denshion::CDSoundEngine - freeing static data for soundId %i @ %i\",soundId,_buffers[soundId].bufferData);\n            free(_buffers[soundId].bufferData);//Free the old data\n            _buffers[soundId].bufferData = NULL;\n        }\n#endif        \n    }    \n    \n    alGenBuffers(1, &_buffers[soundId].bufferId);\n    if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n        CDLOG(@\"Denshion::CDSoundEngine - error regenerating buffer: %x\\n\", lastErrorCode_);\n        _buffers[soundId].bufferState = CD_BS_FAILED;\n        return FALSE;\n    } else {\n        //We now have an empty buffer\n        _buffers[soundId].bufferState = CD_BS_EMPTY;\n        CDLOGINFO(@\"Denshion::CDSoundEngine - buffer %i successfully unloaded\\n\",soundId);\n        return TRUE;\n    }    \n}    \n\n/**\n * Load buffers asynchronously \n * Check asynchLoadProgress for progress. asynchLoadProgress represents fraction of completion. When it equals 1.0 loading\n * is complete. NB: asynchLoadProgress is simply based on the number of load requests, it does not take into account\n * file sizes.\n * @param An array of CDBufferLoadRequest objects\n */\n- (void) loadBuffersAsynchronously:(NSArray *) loadRequests {\n    @synchronized(self) {\n        asynchLoadProgress_ = 0.0f;\n        CDAsynchBufferLoader *loaderOp = [[[CDAsynchBufferLoader alloc] init:loadRequests soundEngine:self] autorelease];\n        NSOperationQueue *opQ = [[[NSOperationQueue alloc] init] autorelease];\n        [opQ addOperation:loaderOp];\n    }\n}    \n\n-(BOOL) _resizeBuffers:(int) increment {\n    \n    void * tmpBufferInfos = realloc( _buffers, sizeof(_buffers[0]) * (bufferTotal + increment) );\n    \n    if(!tmpBufferInfos) {\n        free(tmpBufferInfos);\n        return NO;\n    } else {\n        _buffers = tmpBufferInfos;\n        int oldBufferTotal = bufferTotal;\n        bufferTotal = bufferTotal + increment;\n        [self _generateBuffers:oldBufferTotal endIndex:bufferTotal-1];\n        return YES;\n    }    \n}    \n\n-(BOOL) loadBufferFromData:(int) soundId soundData:(ALvoid*) soundData format:(ALenum) format size:(ALsizei) size freq:(ALsizei) freq {\n\n    @synchronized(_mutexBufferLoad) {\n        \n        if (!functioning_) {\n            //OpenAL initialisation has previously failed\n            CDLOG(@\"Denshion::CDSoundEngine - Loading buffer failed because sound engine state != functioning\");\n            return FALSE;\n        }\n        \n        //Ensure soundId is within array bounds otherwise memory corruption will occur\n        if (soundId < 0) {\n            CDLOG(@\"Denshion::CDSoundEngine - soundId is negative\");\n            return FALSE;\n        }\n        \n        if (soundId >= bufferTotal) {\n            //Need to resize the buffers\n            int requiredIncrement = CD_BUFFERS_INCREMENT;\n            while (bufferTotal + requiredIncrement < soundId) {\n                requiredIncrement += CD_BUFFERS_INCREMENT;\n            }\n            CDLOGINFO(@\"Denshion::CDSoundEngine - attempting to resize buffers by %i for sound %i\",requiredIncrement,soundId);\n            if (![self _resizeBuffers:requiredIncrement]) {\n                CDLOG(@\"Denshion::CDSoundEngine - buffer resize failed\");\n                return FALSE;\n            }    \n        }    \n        \n        if (soundData)\n        {\n            if (_buffers[soundId].bufferState != CD_BS_EMPTY) {\n                CDLOGINFO(@\"Denshion::CDSoundEngine - non empty buffer, regenerating\");\n                if (![self unloadBuffer:soundId]) {\n                    //Deletion of buffer failed, delete buffer routine has set buffer state and lastErrorCode\n                    return NO;\n                }    \n            }    \n            \n#ifdef CD_DEBUG\n            //Check that sample rate matches mixer rate and warn if they do not\n            if (freq != (int)_mixerSampleRate) {\n                CDLOGINFO(@\"Denshion::CDSoundEngine - WARNING sample rate does not match mixer sample rate performance may not be optimal.\");\n            }    \n#endif        \n            \n#ifdef CD_USE_STATIC_BUFFERS\n            alBufferDataStaticProc(_buffers[soundId].bufferId, format, soundData, size, freq);\n            _buffers[soundId].bufferData = data;//Save the pointer to the new data\n#else        \n            alBufferData(_buffers[soundId].bufferId, format, soundData, size, freq);\n#endif\n            if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDSoundEngine -  error attaching audio to buffer: %x\", lastErrorCode_);\n                _buffers[soundId].bufferState = CD_BS_FAILED;\n                return FALSE;\n            } \n        } else {\n            CDLOG(@\"Denshion::CDSoundEngine Buffer data is null!\");\n            _buffers[soundId].bufferState = CD_BS_FAILED;\n            return FALSE;\n        }    \n        \n        _buffers[soundId].format = format;\n        _buffers[soundId].sizeInBytes = size;\n        _buffers[soundId].frequencyInHertz = freq;\n        _buffers[soundId].bufferState = CD_BS_LOADED;\n        CDLOGINFO(@\"Denshion::CDSoundEngine Buffer %i loaded format:%i freq:%i size:%i\",soundId,format,freq,size);\n        return TRUE;\n    }//end mutex\n}    \n\n/**\n * Load sound data for later play back.\n * @return TRUE if buffer loaded okay for play back otherwise false\n */\n- (BOOL) loadBuffer:(int) soundId filePath:(NSString*) filePath\n{\n\n    ALvoid* data;\n    ALenum  format;\n    ALsizei size;\n    ALsizei freq;\n    \n    CDLOGINFO(@\"Denshion::CDSoundEngine - Loading openAL buffer %i %@\", soundId, filePath);\n    \n    CFURLRef fileURL = nil;\n    NSString *path = [CDUtilities fullPathFromRelativePath:filePath];\n    if (path) {\n        fileURL = (CFURLRef)[[NSURL fileURLWithPath:path] retain];\n    }\n\n    if (fileURL)\n    {\n        data = CDGetOpenALAudioData(fileURL, &size, &format, &freq);\n        CFRelease(fileURL);\n        BOOL result = [self loadBufferFromData:soundId soundData:data format:format size:size freq:freq];\n#ifndef CD_USE_STATIC_BUFFERS\n        free(data);//Data can be freed here because alBufferData performs a memcpy        \n#endif\n        return result;\n    } else {\n        CDLOG(@\"Denshion::CDSoundEngine Could not find file!\\n\");\n        //Don't change buffer state here as it will be the same as before method was called    \n        return FALSE;\n    }    \n}\n\n-(BOOL) validateBufferId:(int) soundId {\n    if (soundId < 0 || soundId >= bufferTotal) {\n        CDLOGINFO(@\"Denshion::CDSoundEngine - validateBufferId buffer outside range %i\",soundId);\n        return NO;\n    } else if (_buffers[soundId].bufferState != CD_BS_LOADED) {\n        CDLOGINFO(@\"Denshion::CDSoundEngine - validateBufferId invalide buffer state %i\",soundId);\n        return NO;\n    } else {\n        return YES;\n    }    \n}    \n\n-(float) bufferDurationInSeconds:(int) soundId {\n    if ([self validateBufferId:soundId]) {\n        float factor = 0.0f;\n        switch (_buffers[soundId].format) {\n            case AL_FORMAT_MONO8:\n                factor = 1.0f;\n                break;\n            case AL_FORMAT_MONO16:\n                factor = 0.5f;\n                break;\n            case AL_FORMAT_STEREO8:\n                factor = 0.5f;\n                break;\n            case AL_FORMAT_STEREO16:\n                factor = 0.25f;\n                break;\n        }    \n        return (float)_buffers[soundId].sizeInBytes/(float)_buffers[soundId].frequencyInHertz * factor;\n    } else {\n        return -1.0f;\n    }    \n}    \n\n-(ALsizei) bufferSizeInBytes:(int) soundId {\n    if ([self validateBufferId:soundId]) {\n        return _buffers[soundId].sizeInBytes;\n    } else {\n        return -1.0f;\n    }    \n}    \n\n-(ALsizei) bufferFrequencyInHertz:(int) soundId {\n    if ([self validateBufferId:soundId]) {\n        return _buffers[soundId].frequencyInHertz;\n    } else {\n        return -1.0f;\n    }    \n}    \n\n- (ALfloat) masterGain {\n    if (mute_) {\n        //When mute the real gain will always be 0 therefore return the preMuteGain value\n        return _preMuteGain;\n    } else {    \n        ALfloat gain;\n        alGetListenerf(AL_GAIN, &gain);\n        return gain;\n    }    \n}    \n\n/**\n * Overall gain setting multiplier. e.g 0.5 is half the gain.\n */\n- (void) setMasterGain:(ALfloat) newGainValue {\n    if (mute_) {\n        _preMuteGain = newGainValue;\n    } else {    \n        alListenerf(AL_GAIN, newGainValue);\n    }    \n}\n\n#pragma mark CDSoundEngine AudioInterrupt protocol\n- (BOOL) mute {\n    return mute_;\n}    \n\n/**\n * Setting mute silences all sounds but playing sounds continue to advance playback\n */\n- (void) setMute:(BOOL) newMuteValue {\n    \n    if (newMuteValue == mute_) {\n        return;\n    }\n    \n    mute_ = newMuteValue;\n    if (mute_) {\n        //Remember what the gain was\n        _preMuteGain = self.masterGain;\n        //Set gain to 0 - do not use the property as this will adjust preMuteGain when muted\n        alListenerf(AL_GAIN, 0.0f);\n    } else {\n        //Restore gain to what it was before being muted\n        self.masterGain = _preMuteGain;\n    }    \n}\n\n- (BOOL) enabled {\n    return enabled_;\n}\n\n- (void) setEnabled:(BOOL)enabledValue\n{\n    if (enabled_ == enabledValue) {\n        return;\n    }    \n    enabled_ = enabledValue;\n    if (enabled_ == NO) {\n        [self stopAllSounds];\n    }    \n}    \n\n-(void) _lockSource:(int) sourceIndex lock:(BOOL) lock {\n    BOOL found = NO;\n    for (int i=0; i < _sourceGroupTotal && !found; i++) {\n        if (_sourceGroups[i].sourceStatuses) {\n            for (int j=0; j < _sourceGroups[i].totalSources && !found; j++) {\n                //First bit is used to indicate whether source is locked, index is shifted back 1 bit\n                if((_sourceGroups[i].sourceStatuses[j] >> 1)==sourceIndex) {\n                    if (lock) {\n                        //Set first bit to lock this source\n                        _sourceGroups[i].sourceStatuses[j] |= 1;\n                    } else {\n                        //Unset first bit to unlock this source\n                        _sourceGroups[i].sourceStatuses[j] &= ~1; \n                    }    \n                    found = YES;\n                }    \n            }    \n        }    \n    }\n}    \n\n-(int) _getSourceIndexForSourceGroup:(int)sourceGroupId \n{\n    //Ensure source group id is valid to prevent memory corruption\n    if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine invalid source group id %i\",sourceGroupId);\n        return CD_NO_SOURCE;\n    }    \n\n    int sourceIndex = -1;//Using -1 to indicate no source found\n    BOOL complete = NO;\n    ALint sourceState = 0;\n    sourceGroup *thisSourceGroup = &_sourceGroups[sourceGroupId];\n    thisSourceGroup->currentIndex = thisSourceGroup->startIndex;\n    while (!complete) {\n        //Iterate over sources looking for one that is not locked, first bit indicates if source is locked\n        if ((thisSourceGroup->sourceStatuses[thisSourceGroup->currentIndex] & 1) == 0) {\n            //This source is not locked\n            sourceIndex = thisSourceGroup->sourceStatuses[thisSourceGroup->currentIndex] >> 1;//shift back to get the index\n            if (thisSourceGroup->nonInterruptible) {\n                //Check if this source is playing, if so it can't be interrupted\n                alGetSourcei(_sources[sourceIndex].sourceId, AL_SOURCE_STATE, &sourceState);\n                if (sourceState != AL_PLAYING) {\n                    //complete = YES;\n                    //Set start index so next search starts at the next position\n                    thisSourceGroup->startIndex = thisSourceGroup->currentIndex + 1;\n                    break;\n                } else {\n                    sourceIndex = -1;//The source index was no good because the source was playing\n                }    \n            } else {    \n                //complete = YES;\n                //Set start index so next search starts at the next position\n                thisSourceGroup->startIndex = thisSourceGroup->currentIndex + 1;\n                break;\n            }    \n        }\n        thisSourceGroup->currentIndex++;\n        if (thisSourceGroup->currentIndex >= thisSourceGroup->totalSources) {\n            //Reset to the beginning\n            thisSourceGroup->currentIndex = 0;    \n        }    \n        if (thisSourceGroup->currentIndex == thisSourceGroup->startIndex) {\n            //We have looped around and got back to the start\n            complete = YES;\n        }    \n    }\n\n    //Reset start index to beginning if beyond bounds\n    if (thisSourceGroup->startIndex >= thisSourceGroup->totalSources) {\n        thisSourceGroup->startIndex = 0;    \n    }    \n    \n    if (sourceIndex >= 0) {\n        return sourceIndex;\n    } else {    \n        return CD_NO_SOURCE;\n    }    \n    \n}    \n\n/**\n * Play a sound.\n * @param soundId the id of the sound to play (buffer id).\n * @param SourceGroupId the source group that will be used to play the sound.\n * @param pitch pitch multiplier. e.g 1.0 is unaltered, 0.5 is 1 octave lower. \n * @param pan stereo position. -1 is fully left, 0 is centre and 1 is fully right.\n * @param gain gain multiplier. e.g. 1.0 is unaltered, 0.5 is half the gain\n * @param loop should the sound be looped or one shot.\n * @return the id of the source being used to play the sound or CD_MUTE if the sound engine is muted or non functioning \n * or CD_NO_SOURCE if a problem occurs setting up the source\n * \n */\n- (ALuint)playSound:(int) soundId sourceGroupId:(int)sourceGroupId pitch:(float) pitch pan:(float) pan gain:(float) gain loop:(BOOL) loop {\n\n#ifdef CD_DEBUG\n    //Sanity check parameters - only in DEBUG\n    NSAssert(soundId >= 0, @\"soundId can not be negative\");\n    NSAssert(soundId < bufferTotal, @\"soundId exceeds limit\");\n    NSAssert(sourceGroupId >= 0, @\"sourceGroupId can not be negative\");\n    NSAssert(sourceGroupId < _sourceGroupTotal, @\"sourceGroupId exceeds limit\");\n    NSAssert(pitch > 0, @\"pitch must be greater than zero\");\n    NSAssert(pan >= -1 && pan <= 1, @\"pan must be between -1 and 1\");\n    NSAssert(gain >= 0, @\"gain can not be negative\");\n#endif\n    //If mute or initialisation has failed or buffer is not loaded then do nothing\n    if (!enabled_ || !functioning_ || _buffers[soundId].bufferState != CD_BS_LOADED || _sourceGroups[sourceGroupId].enabled) {\n#ifdef CD_DEBUG\n        if (!functioning_) {\n            CDLOGINFO(@\"Denshion::CDSoundEngine - sound playback aborted because sound engine is not functioning\");\n        } else if (_buffers[soundId].bufferState != CD_BS_LOADED) {\n            CDLOGINFO(@\"Denshion::CDSoundEngine - sound playback aborted because buffer %i is not loaded\", soundId);\n        }    \n#endif        \n        return CD_MUTE;\n    }    \n\n    int sourceIndex = [self _getSourceIndexForSourceGroup:sourceGroupId];//This method ensures sourceIndex is valid\n    \n    if (sourceIndex != CD_NO_SOURCE) {\n        ALint state;\n        ALuint source = _sources[sourceIndex].sourceId;\n        ALuint buffer = _buffers[soundId].bufferId;\n        alGetError();//Clear the error code    \n        alGetSourcei(source, AL_SOURCE_STATE, &state);\n        if (state == AL_PLAYING) {\n            alSourceStop(source);\n        }    \n        alSourcei(source, AL_BUFFER, buffer);//Attach to sound\n        alSourcef(source, AL_PITCH, pitch);//Set pitch\n        alSourcei(source, AL_LOOPING, loop);//Set looping\n        alSourcef(source, AL_GAIN, gain);//Set gain/volume\n        float sourcePosAL[] = {pan, 0.0f, 0.0f};//Set position - just using left and right panning\n        alSourcefv(source, AL_POSITION, sourcePosAL);\n        alGetError();//Clear the error code\n        alSourcePlay(source);\n        if((lastErrorCode_ = alGetError()) == AL_NO_ERROR) {\n            //Everything was okay\n            _sources[sourceIndex].attachedBufferId = buffer;\n            return source;\n        } else {\n            if (alcGetCurrentContext() == NULL) {\n                CDLOGINFO(@\"Denshion::CDSoundEngine - posting bad OpenAL context message\");\n                [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_BadAlContext object:nil];\n            }                \n            return CD_NO_SOURCE;\n        }    \n    } else {    \n        return CD_NO_SOURCE;\n    }    \n}\n\n-(BOOL) _soundSourceAttachToBuffer:(CDSoundSource*) soundSource soundId:(int) soundId  {\n    //Attach the source to the buffer\n    ALint state;\n    ALuint source = soundSource->_sourceId;\n    ALuint buffer = _buffers[soundId].bufferId;\n    alGetSourcei(source, AL_SOURCE_STATE, &state);\n    if (state == AL_PLAYING) {\n        alSourceStop(source);\n    }\n    alGetError();//Clear the error code    \n    alSourcei(source, AL_BUFFER, buffer);//Attach to sound data\n    if((lastErrorCode_ = alGetError()) == AL_NO_ERROR) {\n        _sources[soundSource->_sourceIndex].attachedBufferId = buffer;\n        //_sourceBufferAttachments[soundSource->_sourceIndex] = buffer;//Keep track of which\n        soundSource->_soundId = soundId;\n        return YES;\n    } else {\n        return NO;\n    }    \n}    \n\n/**\n * Get a sound source for the specified sound in the specified source group\n */\n-(CDSoundSource *) soundSourceForSound:(int) soundId sourceGroupId:(int) sourceGroupId \n{\n    if (!functioning_) {\n        return nil;\n    }    \n    //Check if a source is available\n    int sourceIndex = [self _getSourceIndexForSourceGroup:sourceGroupId];\n    if (sourceIndex != CD_NO_SOURCE) { \n        CDSoundSource *result = [[CDSoundSource alloc] init:_sources[sourceIndex].sourceId sourceIndex:sourceIndex soundEngine:self];\n        [self _lockSource:sourceIndex lock:YES];\n        //Try to attach to the buffer\n        if ([self _soundSourceAttachToBuffer:result soundId:soundId]) {\n            //Set to a known state\n            result.pitch = 1.0f;\n            result.pan = 0.0f;\n            result.gain = 1.0f;\n            result.looping = NO;\n            return [result autorelease];\n        } else {\n            //Release the sound source we just created, this will also unlock the source\n            [result release];\n            return nil;\n        }    \n    } else {\n        //No available source within that source group\n        return nil;\n    }\n}    \n\n-(void) _soundSourcePreRelease:(CDSoundSource *) soundSource {\n    CDLOGINFO(@\"Denshion::CDSoundEngine _soundSourcePreRelease %i\",soundSource->_sourceIndex);\n    //Unlock the sound source's source\n    [self _lockSource:soundSource->_sourceIndex lock:NO];\n}    \n\n/**\n * Stop all sounds playing within a source group\n */\n- (void) stopSourceGroup:(int) sourceGroupId {\n    \n    if (!functioning_ || sourceGroupId >= _sourceGroupTotal || sourceGroupId < 0) {\n        return;\n    }    \n    int sourceCount = _sourceGroups[sourceGroupId].totalSources;\n    for (int i=0; i < sourceCount; i++) {\n        int sourceIndex = _sourceGroups[sourceGroupId].sourceStatuses[i] >> 1;\n        alSourceStop(_sources[sourceIndex].sourceId);\n    }\n    alGetError();//Clear error in case we stopped any sounds that couldn't be stopped\n}    \n\n/**\n * Stop a sound playing.\n * @param sourceId an OpenAL source identifier i.e. the return value of playSound\n */\n- (void)stopSound:(ALuint) sourceId {\n    if (!functioning_) {\n        return;\n    }    \n    alSourceStop(sourceId);\n    alGetError();//Clear error in case we stopped any sounds that couldn't be stopped\n}\n\n- (void) stopAllSounds {\n    for (int i=0; i < sourceTotal_; i++) {\n        alSourceStop(_sources[i].sourceId);\n    }    \n    alGetError();//Clear error in case we stopped any sounds that couldn't be stopped\n}    \n\n- (void) pauseSound:(ALuint) sourceId {\n  if (!functioning_) {\n      return;\n  }\n  alSourcePause(sourceId);\n  alGetError();//Clear error in case we pause any sounds that couldn't be paused\n}\n\n- (void) pauseAllSounds {\n  for (int i = 0; i < sourceTotal_; i++) {\n      [self pauseSound:_sources[i].sourceId];\n  }\n  alGetError();//Clear error in case we stopped any sounds that couldn't be paused\n}\n\n- (void) resumeSound:(ALuint) soundId {\n  if (!functioning_) {\n    return;\n  }\n  \n    // only resume a sound id that is paused\n    ALint state;\n    alGetSourcei(soundId, AL_SOURCE_STATE, &state);\n    if (state != AL_PAUSED)\n    {\n        return;\n    }\n        \n  alSourcePlay(soundId);\n  alGetError();//Clear error in case we stopped any sounds that couldn't be resumed\n}\n\n- (void) resumeAllSounds {\n  for (int i = 0; i < sourceTotal_; i++) {\n      [self resumeSound:_sources[i].sourceId];\n  }\n  alGetError();//Clear error in case we stopped any sounds that couldn't be resumed\n}\n\n/**\n * Set a source group as non interruptible.  Default is that source groups are interruptible.\n * Non interruptible means that if a request to play a sound is made for a source group and there are\n * no free sources available then the play request will be ignored and CD_NO_SOURCE will be returned.\n */\n- (void) setSourceGroupNonInterruptible:(int) sourceGroupId isNonInterruptible:(BOOL) isNonInterruptible {\n    //Ensure source group id is valid to prevent memory corruption\n    if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine setSourceGroupNonInterruptible invalid source group id %i\",sourceGroupId);\n        return;\n    }    \n    \n    if (isNonInterruptible) {\n        _sourceGroups[sourceGroupId].nonInterruptible = true;\n    } else {\n        _sourceGroups[sourceGroupId].nonInterruptible = false;\n    }    \n}\n\n/**\n * Set the mute property for a source group. If mute is turned on any sounds in that source group\n * will be stopped and further sounds in that source group will play. However, turning mute off\n * will not restart any sounds that were playing when mute was turned on. Also the mute setting \n * for the sound engine must be taken into account. If the sound engine is mute no sounds will play\n * no matter what the source group mute setting is.\n */\n- (void) setSourceGroupEnabled:(int) sourceGroupId enabled:(BOOL) enabled {\n    //Ensure source group id is valid to prevent memory corruption\n    if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine setSourceGroupEnabled invalid source group id %i\",sourceGroupId);\n        return;\n    }    \n    \n    if (enabled) {\n        _sourceGroups[sourceGroupId].enabled = true;\n        [self stopSourceGroup:sourceGroupId];\n    } else {\n        _sourceGroups[sourceGroupId].enabled = false;    \n    }    \n}\n\n/**\n * Return the mute property for the source group identified by sourceGroupId\n */\n- (BOOL) sourceGroupEnabled:(int) sourceGroupId {\n    return _sourceGroups[sourceGroupId].enabled;\n}\n\n-(ALCcontext *) openALContext {\n    return context;\n}    \n\n- (void) _dumpSourceGroupsInfo {\n#ifdef CD_DEBUG    \n    CDLOGINFO(@\"-------------- source Group Info --------------\");\n    for (int i=0; i < _sourceGroupTotal; i++) {\n        CDLOGINFO(@\"Group: %i start:%i total:%i\",i,_sourceGroups[i].startIndex, _sourceGroups[i].totalSources);\n        CDLOGINFO(@\"----- mute:%i nonInterruptible:%i\",_sourceGroups[i].enabled, _sourceGroups[i].nonInterruptible);\n        CDLOGINFO(@\"----- Source statuses ----\");\n        for (int j=0; j < _sourceGroups[i].totalSources; j++) {\n            CDLOGINFO(@\"Source status:%i index=%i locked=%i\",j,_sourceGroups[i].sourceStatuses[j] >> 1, _sourceGroups[i].sourceStatuses[j] & 1);\n        }    \n    }    \n#endif    \n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n@implementation CDSoundSource\n\n@synthesize lastError;\n\n//Macro for handling the al error code\n#define CDSOUNDSOURCE_UPDATE_LAST_ERROR (lastError = alGetError())\n#define CDSOUNDSOURCE_ERROR_HANDLER ( CDSOUNDSOURCE_UPDATE_LAST_ERROR == AL_NO_ERROR)\n\n-(id)init:(ALuint) theSourceId sourceIndex:(int) index soundEngine:(CDSoundEngine*) engine {\n    if ((self = [super init])) {\n        _sourceId = theSourceId;\n        _engine = engine;\n        _sourceIndex = index;\n        enabled_ = YES;\n        mute_ = NO;\n        _preMuteGain = self.gain;\n    } \n    return self;\n}\n\n-(void) dealloc\n{\n    CDLOGINFO(@\"Denshion::CDSoundSource deallocated %i\",self->_sourceIndex);\n\n    //Notify sound engine we are about to release\n    [_engine _soundSourcePreRelease:self];\n    [super dealloc];\n}    \n\n- (void) setPitch:(float) newPitchValue {\n    alSourcef(_sourceId, AL_PITCH, newPitchValue);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n}    \n\n- (void) setGain:(float) newGainValue {\n    if (!mute_) {\n        alSourcef(_sourceId, AL_GAIN, newGainValue);    \n    } else {\n        _preMuteGain = newGainValue;\n    }    \n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n}\n\n- (void) setPan:(float) newPanValue {\n    float sourcePosAL[] = {newPanValue, 0.0f, 0.0f};//Set position - just using left and right panning\n    alSourcefv(_sourceId, AL_POSITION, sourcePosAL);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n\n}\n\n- (void) setLooping:(BOOL) newLoopingValue {\n    alSourcei(_sourceId, AL_LOOPING, newLoopingValue);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n\n}\n\n- (BOOL) isPlaying {\n    ALint state;\n    alGetSourcei(_sourceId, AL_SOURCE_STATE, &state);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return (state == AL_PLAYING);\n}    \n\n- (float) pitch {\n    ALfloat pitchVal;\n    alGetSourcef(_sourceId, AL_PITCH, &pitchVal);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return pitchVal;\n}\n\n- (float) pan {\n    ALfloat sourcePosAL[] = {0.0f,0.0f,0.0f};\n    alGetSourcefv(_sourceId, AL_POSITION, sourcePosAL);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return sourcePosAL[0];\n}\n\n- (float) gain {\n    if (!mute_) {\n        ALfloat val;\n        alGetSourcef(_sourceId, AL_GAIN, &val);\n        CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n        return val;\n    } else {\n        return _preMuteGain;\n    }    \n}    \n\n- (BOOL) looping {\n    ALfloat val;\n    alGetSourcef(_sourceId, AL_LOOPING, &val);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return val;\n}\n\n-(BOOL) stop {\n    alSourceStop(_sourceId);\n    return CDSOUNDSOURCE_ERROR_HANDLER;\n}    \n\n-(BOOL) play {\n    if (enabled_) {\n        alSourcePlay(_sourceId);\n        CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n        if (lastError != AL_NO_ERROR) {\n            if (alcGetCurrentContext() == NULL) {\n                CDLOGINFO(@\"Denshion::CDSoundSource - posting bad OpenAL context message\");\n                [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_BadAlContext object:nil];\n            }    \n            return NO;\n        } else {\n            return YES;\n        }    \n    } else {\n        return NO;\n    }\n}    \n\n-(BOOL) pause {\n    alSourcePause(_sourceId);\n    return CDSOUNDSOURCE_ERROR_HANDLER;\n}\n\n-(BOOL) rewind {\n    alSourceRewind(_sourceId);\n    return CDSOUNDSOURCE_ERROR_HANDLER;\n}\n\n-(void) setSoundId:(int) soundId {\n    [_engine _soundSourceAttachToBuffer:self soundId:soundId];\n}\n\n-(int) soundId {\n    return _soundId;\n}    \n\n-(float) durationInSeconds {\n    return [_engine bufferDurationInSeconds:_soundId];\n}    \n\n#pragma mark CDSoundSource AudioInterrupt protocol\n- (BOOL) mute {\n    return mute_;\n}    \n\n/**\n * Setting mute silences all sounds but playing sounds continue to advance playback\n */\n- (void) setMute:(BOOL) newMuteValue {\n    \n    if (newMuteValue == mute_) {\n        return;\n    }\n    \n    if (newMuteValue) {\n        //Remember what the gain was\n        _preMuteGain = self.gain;\n        self.gain = 0.0f;\n        mute_ = newMuteValue;//Make sure this is done after setting the gain property as the setter behaves differently depending on mute value\n    } else {\n        //Restore gain to what it was before being muted\n        mute_ = newMuteValue;\n        self.gain = _preMuteGain;\n    }    \n}\n\n- (BOOL) enabled {\n    return enabled_;\n}\n\n- (void) setEnabled:(BOOL)enabledValue\n{\n    if (enabled_ == enabledValue) {\n        return;\n    }    \n    enabled_ = enabledValue;\n    if (enabled_ == NO) {\n        [self stop];\n    }    \n}    \n\n@end\n\n////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDAudioInterruptTargetGroup\n\n@implementation CDAudioInterruptTargetGroup\n\n-(id) init {\n    if ((self = [super init])) {\n        children_ = [[NSMutableArray alloc] initWithCapacity:32];\n        enabled_ = YES;\n        mute_ = NO;\n    }\n    return self;\n}    \n\n-(void) addAudioInterruptTarget:(NSObject<CDAudioInterruptProtocol>*) interruptibleTarget {\n    //Synchronize child with group settings;\n    [interruptibleTarget setMute:mute_];\n    [interruptibleTarget setEnabled:enabled_];\n    [children_ addObject:interruptibleTarget];\n}    \n\n-(void) removeAudioInterruptTarget:(NSObject<CDAudioInterruptProtocol>*) interruptibleTarget {\n    [children_ removeObjectIdenticalTo:interruptibleTarget];\n}    \n\n- (BOOL) mute {\n    return mute_;\n}    \n\n/**\n * Setting mute silences all sounds but playing sounds continue to advance playback\n */\n- (void) setMute:(BOOL) newMuteValue {\n    \n    if (newMuteValue == mute_) {\n        return;\n    }\n    \n    for (NSObject<CDAudioInterruptProtocol>* target in children_) {\n        [target setMute:newMuteValue];\n    }    \n}\n\n- (BOOL) enabled {\n    return enabled_;\n}\n\n- (void) setEnabled:(BOOL)enabledValue\n{\n    if (enabledValue == enabled_) {\n        return;\n    }\n    \n    for (NSObject<CDAudioInterruptProtocol>* target in children_) {\n        [target setEnabled:enabledValue];\n    }    \n}    \n\n@end\n\n\n\n////////////////////////////////////////////////////////////////////////////\n\n#pragma mark - CDAsynchBufferLoader\n\n@implementation CDAsynchBufferLoader\n\n-(id) init:(NSArray *)loadRequests soundEngine:(CDSoundEngine *) theSoundEngine {\n    if ((self = [super init])) {\n        _loadRequests = loadRequests;\n        [_loadRequests retain];\n        _soundEngine = theSoundEngine;\n        [_soundEngine retain];\n    } \n    return self;\n}    \n\n-(void) main {\n    CDLOGINFO(@\"Denshion::CDAsynchBufferLoader - loading buffers\");\n    [super main];\n    _soundEngine.asynchLoadProgress = 0.0f;\n\n    if ([_loadRequests count] > 0) {\n        float increment = 1.0f / [_loadRequests count];\n        //Iterate over load request and load\n        for (CDBufferLoadRequest *loadRequest in _loadRequests) {\n            [_soundEngine loadBuffer:loadRequest.soundId filePath:loadRequest.filePath];\n            _soundEngine.asynchLoadProgress += increment;\n        }    \n    }    \n    \n    //Completed\n    _soundEngine.asynchLoadProgress = 1.0f;\n    [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_AsynchLoadComplete object:nil];\n    \n}    \n\n-(void) dealloc {\n    [_loadRequests release];\n    [_soundEngine release];\n    [super dealloc];\n}    \n\n@end\n\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDBufferLoadRequest\n\n@implementation CDBufferLoadRequest\n\n@synthesize filePath, soundId;\n\n-(id) init:(int) theSoundId filePath:(const NSString *) theFilePath {\n\tif ((self = [super init])) {\n\t\tsoundId = theSoundId;\n\t\tfilePath = [theFilePath copy];\n\t}\n\treturn self;\n}\n\n-(void) dealloc {\n    [filePath release];\n    [super dealloc];\n}\n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDFloatInterpolator\n\n@implementation CDFloatInterpolator\n@synthesize start,end,interpolationType;\n\n-(float) interpolate:(float) t {\n    \n    if (t < 1.0f) {\n        switch (interpolationType) {\n            case kIT_Linear:\n                //Linear interpolation\n                return ((end - start) * t) + start;\n                \n            case kIT_SCurve:\n                //Cubic s curve t^2 * (3 - 2t)\n                return ((float)(t * t * (3.0 - (2.0 * t))) * (end - start)) + start;\n                \n            case kIT_Exponential:    \n                //Formulas taken from EaseAction\n                if (end > start) {\n                    //Fade in\n                    float logDelta = (t==0) ? 0 : powf(2, 10 * (t/1 - 1)) - 1 * 0.001f;\n                    return ((end - start) * logDelta) + start;\n                } else {\n                    //Fade Out\n                    float logDelta = (-powf(2, -10 * t/1) + 1);\n                    return ((end - start) * logDelta) + start;\n                }\n            default:\n                return 0.0f;\n        }\n    } else {\n        return end;\n    } \n}\n\n-(id) init:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal {\n    if ((self = [super init])) {\n        start = startVal;\n        end = endVal;\n        interpolationType = type;\n    } \n    return self;\n}\n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDPropertyModifier\n\n@implementation CDPropertyModifier\n\n@synthesize stopTargetWhenComplete;\n\n-(id) init:(id) theTarget interpolationType:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal {\n    if ((self = [super init])) {\n        if (target) {\n            //Release the previous target if there is one\n            [target release];\n        }    \n        target = theTarget;\n#if CD_DEBUG\n        //Check target is of the required type\n        if (![theTarget isMemberOfClass:[self _allowableType]] ) {\n            CDLOG(@\"Denshion::CDPropertyModifier target is not of type %@\",[self _allowableType]);\n            NSAssert([theTarget isKindOfClass:[CDSoundEngine class]], @\"CDPropertyModifier target not of required type\");\n        }\n#endif        \n        [target retain];\n        startValue = startVal;\n        endValue = endVal;\n        if (interpolator) {\n            //Release previous interpolator if there is one\n            [interpolator release];\n        }    \n        interpolator = [[CDFloatInterpolator alloc] init:type startVal:startVal endVal:endVal];\n        stopTargetWhenComplete = NO;\n    }\n    return self;\n}    \n\n-(void) dealloc {\n    CDLOGINFO(@\"Denshion::CDPropertyModifier deallocated %@\",self);\n    [target release];\n    [interpolator release];\n    [super dealloc];\n}    \n\n-(void) modify:(float) t {\n    if (t < 1.0) {\n        [self _setTargetProperty:[interpolator interpolate:t]];\n    } else {\n        //At the end\n        [self _setTargetProperty:endValue];\n        if (stopTargetWhenComplete) {\n            [self _stopTarget];\n        }    \n    }    \n}    \n\n-(float) startValue {\n    return startValue;\n}\n\n-(void) setStartValue:(float) startVal\n{\n    startValue = startVal;\n    interpolator.start = startVal;\n}    \n\n-(float) endValue {\n    return startValue;\n}\n\n-(void) setEndValue:(float) endVal\n{\n    endValue = endVal;\n    interpolator.end = endVal;\n}    \n\n-(tCDInterpolationType) interpolationType {\n    return interpolator.interpolationType;\n}\n\n-(void) setInterpolationType:(tCDInterpolationType) interpolationType {\n    interpolator.interpolationType = interpolationType;\n}    \n\n-(void) _setTargetProperty:(float) newVal {\n\n}    \n\n-(float) _getTargetProperty {\n    return 0.0f;\n}    \n\n-(void) _stopTarget {\n\n}    \n\n-(Class) _allowableType {\n    return [NSObject class];\n}    \n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDSoundSourceFader\n\n@implementation CDSoundSourceFader\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundSource*)target).gain = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundSource*)target).gain;\n}\n\n-(void) _stopTarget {\n    [((CDSoundSource*)target) stop];\n}\n\n-(Class) _allowableType {\n    return [CDSoundSource class];\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDSoundSourcePanner\n\n@implementation CDSoundSourcePanner\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundSource*)target).pan = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundSource*)target).pan;\n}\n\n-(void) _stopTarget {\n    [((CDSoundSource*)target) stop];\n}\n\n-(Class) _allowableType {\n    return [CDSoundSource class];\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDSoundSourcePitchBender\n\n@implementation CDSoundSourcePitchBender\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundSource*)target).pitch = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundSource*)target).pitch;\n}\n\n-(void) _stopTarget {\n    [((CDSoundSource*)target) stop];\n}\n\n-(Class) _allowableType {\n    return [CDSoundSource class];\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark - CDSoundEngineFader\n\n@implementation CDSoundEngineFader\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundEngine*)target).masterGain = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundEngine*)target).masterGain;\n}\n\n-(void) _stopTarget {\n    [((CDSoundEngine*)target) stopAllSounds];\n}\n\n-(Class) _allowableType {\n    return [CDSoundEngine class];\n}    \n\n@end\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/SimpleAudioEngine.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"SimpleAudioEngine.h\"\n#include \"SimpleAudioEngine_objc.h\"\n#include \"cocos2d.h\"\nUSING_NS_CC;\n\nstatic void static_end()\n{\n    [SimpleAudioEngine  end];\n}\n\nstatic void static_preloadBackgroundMusic(const char* pszFilePath)\n{\n    [[SimpleAudioEngine sharedEngine] preloadBackgroundMusic: [NSString stringWithUTF8String: pszFilePath]];\n}\n\nstatic void static_playBackgroundMusic(const char* pszFilePath, bool bLoop)\n{\n    [[SimpleAudioEngine sharedEngine] playBackgroundMusic: [NSString stringWithUTF8String: pszFilePath] loop: bLoop];\n}\n\nstatic void static_stopBackgroundMusic()\n{\n    [[SimpleAudioEngine sharedEngine] stopBackgroundMusic];\n}\n\nstatic void static_pauseBackgroundMusic()\n{\n     [[SimpleAudioEngine sharedEngine] pauseBackgroundMusic];\n}\n\nstatic void static_resumeBackgroundMusic()\n{\n    [[SimpleAudioEngine sharedEngine] resumeBackgroundMusic];\n} \n\nstatic void static_rewindBackgroundMusic()\n{\n    [[SimpleAudioEngine sharedEngine] rewindBackgroundMusic];\n}\n\nstatic bool static_willPlayBackgroundMusic()\n{\n    return [[SimpleAudioEngine sharedEngine] willPlayBackgroundMusic];\n}\n\nstatic bool static_isBackgroundMusicPlaying()\n{\n    return [[SimpleAudioEngine sharedEngine] isBackgroundMusicPlaying];\n}\n\nstatic float static_getBackgroundMusicVolume()\n{\n    return [[SimpleAudioEngine sharedEngine] backgroundMusicVolume];\n}\n\nstatic void static_setBackgroundMusicVolume(float volume)\n{\n    volume = MAX( MIN(volume, 1.0), 0 );\n    [SimpleAudioEngine sharedEngine].backgroundMusicVolume = volume;\n}\n     \nstatic float static_getEffectsVolume()\n{\n    return [[SimpleAudioEngine sharedEngine] effectsVolume];\n}\n     \nstatic void static_setEffectsVolume(float volume)\n{\n    volume = MAX( MIN(volume, 1.0), 0 );\n    [SimpleAudioEngine sharedEngine].effectsVolume = volume;\n}\n\nstatic unsigned int static_playEffect(const char* pszFilePath, bool bLoop, Float32 pszPitch, Float32 pszPan, Float32 pszGain)\n{\n    return [[SimpleAudioEngine sharedEngine] playEffect:[NSString stringWithUTF8String: pszFilePath] loop:bLoop pitch:pszPitch pan: pszPan gain:pszGain];\n}\n     \nstatic void static_stopEffect(int nSoundId)\n{\n    [[SimpleAudioEngine sharedEngine] stopEffect: nSoundId];\n}\n     \nstatic void static_preloadEffect(const char* pszFilePath)\n{\n    [[SimpleAudioEngine sharedEngine] preloadEffect: [NSString stringWithUTF8String: pszFilePath]];\n}\n     \nstatic void static_unloadEffect(const char* pszFilePath)\n{\n    [[SimpleAudioEngine sharedEngine] unloadEffect: [NSString stringWithUTF8String: pszFilePath]];\n}\n\nstatic void static_pauseEffect(unsigned int uSoundId)\n{\n    [[SimpleAudioEngine sharedEngine] pauseEffect: uSoundId];\n}\n\nstatic void static_pauseAllEffects()\n{\n    [[SimpleAudioEngine sharedEngine] pauseAllEffects];\n}\n\nstatic void static_resumeEffect(unsigned int uSoundId)\n{\n    [[SimpleAudioEngine sharedEngine] resumeEffect: uSoundId];\n}\n\nstatic void static_resumeAllEffects()\n{\n    [[SimpleAudioEngine sharedEngine] resumeAllEffects];\n}\n\nstatic void static_stopAllEffects()\n{\n    [[SimpleAudioEngine sharedEngine] stopAllEffects];\n}\n\nnamespace CocosDenshion {\n\nstatic SimpleAudioEngine *s_pEngine;\n\nSimpleAudioEngine::SimpleAudioEngine()\n{\n\n}\n\nSimpleAudioEngine::~SimpleAudioEngine()\n{\n\n}\n\nSimpleAudioEngine* SimpleAudioEngine::getInstance()\n{\n    if (! s_pEngine)\n    {\n        s_pEngine = new SimpleAudioEngine();\n    }\n    \n    return s_pEngine;\n}\n\nvoid SimpleAudioEngine::end()\n{\n    if (s_pEngine)\n    {\n        delete s_pEngine;\n        s_pEngine = NULL;\n    }\n    \n    static_end();\n}\n\nvoid SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_preloadBackgroundMusic(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_playBackgroundMusic(fullPath.c_str(), bLoop);\n}\n\nvoid SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)\n{\n    static_stopBackgroundMusic();\n}\n\nvoid SimpleAudioEngine::pauseBackgroundMusic()\n{\n    static_pauseBackgroundMusic();\n}\n\nvoid SimpleAudioEngine::resumeBackgroundMusic()\n{\n    static_resumeBackgroundMusic();\n} \n\nvoid SimpleAudioEngine::rewindBackgroundMusic()\n{\n    static_rewindBackgroundMusic();\n}\n\nbool SimpleAudioEngine::willPlayBackgroundMusic()\n{\n    return static_willPlayBackgroundMusic();\n}\n\nbool SimpleAudioEngine::isBackgroundMusicPlaying()\n{\n    return static_isBackgroundMusicPlaying();\n}\n\nfloat SimpleAudioEngine::getBackgroundMusicVolume()\n{\n    return static_getBackgroundMusicVolume();\n}\n\nvoid SimpleAudioEngine::setBackgroundMusicVolume(float volume)\n{\n    static_setBackgroundMusicVolume(volume);\n}\n\nfloat SimpleAudioEngine::getEffectsVolume()\n{\n    return static_getEffectsVolume();\n}\n\nvoid SimpleAudioEngine::setEffectsVolume(float volume)\n{\n    static_setEffectsVolume(volume);\n}\n\nunsigned int SimpleAudioEngine::playEffect(const char *pszFilePath, bool bLoop,\n                                           float pitch, float pan, float gain)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    return static_playEffect(fullPath.c_str(), bLoop, pitch, pan, gain);\n}\n\nvoid SimpleAudioEngine::stopEffect(unsigned int nSoundId)\n{\n    static_stopEffect(nSoundId);\n}\n\nvoid SimpleAudioEngine::preloadEffect(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_preloadEffect(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::unloadEffect(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_unloadEffect(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::pauseEffect(unsigned int uSoundId)\n{\n    static_pauseEffect(uSoundId);\n}\n\nvoid SimpleAudioEngine::resumeEffect(unsigned int uSoundId)\n{\n    static_resumeEffect(uSoundId);\n}\n\nvoid SimpleAudioEngine::pauseAllEffects()\n{\n    static_pauseAllEffects();\n}\n\nvoid SimpleAudioEngine::resumeAllEffects()\n{\n    static_resumeAllEffects();\n}\n\nvoid SimpleAudioEngine::stopAllEffects()\n{\n    static_stopAllEffects();\n}\n\n} // endof namespace CocosDenshion {\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/SimpleAudioEngine_objc.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n\n#import \"CDAudioManager.h\"\n\n/**\n A wrapper to the CDAudioManager object.\n This is recommended for basic audio requirements. If you just want to play some sound fx\n and some background music and have no interest in learning the lower level workings then\n this is the interface to use.\n \n Requirements:\n - Firmware: OS 2.2 or greater \n - Files: SimpleAudioEngine.*, CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox, AVFoundation\n @since v0.8\n */\n@interface SimpleAudioEngine : NSObject <CDAudioInterruptProtocol> {\n    \n    BOOL    mute_;\n    BOOL    enabled_;\n}\n\n/** Background music volume. Range is 0.0f to 1.0f. This will only have an effect if willPlayBackgroundMusic returns YES */\n@property (readwrite) float backgroundMusicVolume;\n/** Effects volume. Range is 0.0f to 1.0f */\n@property (readwrite) float effectsVolume;\n/** If NO it indicates background music will not be played either because no background music is loaded or the audio session does not permit it.*/\n@property (readonly) BOOL willPlayBackgroundMusic;\n\n/** returns the shared instance of the SimpleAudioEngine object */\n+ (SimpleAudioEngine*) sharedEngine;\n\n/** Preloads a music file so it will be ready to play as background music */\n-(void) preloadBackgroundMusic:(NSString*) filePath;\n\n/** plays background music in a loop*/\n-(void) playBackgroundMusic:(NSString*) filePath;\n/** plays background music, if loop is true the music will repeat otherwise it will be played once */\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop;\n/** stops playing background music */\n-(void) stopBackgroundMusic;\n/** pauses the background music */\n-(void) pauseBackgroundMusic;\n/** resume background music that has been paused */\n-(void) resumeBackgroundMusic;\n/** rewind the background music */\n-(void) rewindBackgroundMusic;\n/** returns whether or not the background music is playing */\n-(BOOL) isBackgroundMusicPlaying;\n\n/** plays an audio effect with a file path*/\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL) loop;\n/** stop a sound that is playing, note you must pass in the soundId that is returned when you started playing the sound with playEffect */\n-(void) stopEffect:(ALuint) soundId;\n/** plays an audio effect with a file path, pitch, pan and gain */\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL)loop pitch:(Float32) pitch pan:(Float32) pan gain:(Float32) gain;\n/** pause an audio */\n-(void) pauseEffect:(ALuint) soundId;\n/** pause all audioes */\n-(void) pauseAllEffects;\n/** resume an audio */\n-(void) resumeEffect:(ALuint) soundId;\n/** resume all audioes */\n-(void) resumeAllEffects;\n/** stop all audioes */\n-(void) stopAllEffects;\n/** preloads an audio effect */\n-(void) preloadEffect:(NSString*) filePath;\n/** unloads an audio effect from memory */\n-(void) unloadEffect:(NSString*) filePath;\n/** Gets a CDSoundSource object set up to play the specified file. */\n-(CDSoundSource *) soundSourceForFile:(NSString*) filePath;\n\n/** Shuts down the shared audio engine instance so that it can be reinitialised */\n+(void) end;\n\n@end\n"
  },
  {
    "path": "cocos2d/cocos/audio/ios/SimpleAudioEngine_objc.m",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n#import \"SimpleAudioEngine_objc.h\"\n\n@implementation SimpleAudioEngine\n\nstatic SimpleAudioEngine *sharedEngine = nil;\nstatic CDSoundEngine* soundEngine = nil;\nstatic CDAudioManager *am = nil;\nstatic CDBufferManager *bufferManager = nil;\n\n// Init\n+ (SimpleAudioEngine *) sharedEngine\n{\n    @synchronized(self)     {\n        if (!sharedEngine)\n            sharedEngine = [[SimpleAudioEngine alloc] init];\n    }\n    return sharedEngine;\n}\n\n+ (id) alloc\n{\n    @synchronized(self)     {\n        NSAssert(sharedEngine == nil, @\"Attempted to allocate a second instance of a singleton.\");\n        return [super alloc];\n    }\n    return nil;\n}\n\n-(id) init\n{\n    if((self=[super init])) {\n        am = [CDAudioManager sharedManager];\n        soundEngine = am.soundEngine;\n        bufferManager = [[CDBufferManager alloc] initWithEngine:soundEngine];\n        mute_ = NO;\n        enabled_ = YES;\n    }\n    return self;\n}\n\n// Memory\n- (void) dealloc\n{\n    am = nil;\n    soundEngine = nil;\n    bufferManager = nil;\n    [super dealloc];\n}\n\n+(void) end \n{\n    am = nil;\n    [CDAudioManager end];\n    [bufferManager release];\n    [sharedEngine release];\n    sharedEngine = nil;\n}    \n\n#pragma mark SimpleAudioEngine - background music\n\n-(void) preloadBackgroundMusic:(NSString*) filePath {\n    [am preloadBackgroundMusic:filePath];\n}\n\n-(void) playBackgroundMusic:(NSString*) filePath\n{\n    [am playBackgroundMusic:filePath loop:TRUE];\n}\n\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop\n{\n    [am playBackgroundMusic:filePath loop:loop];\n}\n\n-(void) stopBackgroundMusic\n{\n    [am stopBackgroundMusic];\n}\n\n-(void) pauseBackgroundMusic {\n    [am pauseBackgroundMusic];\n}    \n\n-(void) resumeBackgroundMusic {\n    [am resumeBackgroundMusic];\n}    \n\n-(void) rewindBackgroundMusic {\n    [am rewindBackgroundMusic];\n}\n\n-(BOOL) isBackgroundMusicPlaying {\n    return [am isBackgroundMusicPlaying];\n}    \n\n-(BOOL) willPlayBackgroundMusic {\n    return [am willPlayBackgroundMusic];\n}\n\n#pragma mark SimpleAudioEngine - sound effects\n\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL) loop\n{\n    return [self playEffect:filePath loop:loop pitch:1.0f pan:0.0f gain:1.0f];\n}\n\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL) loop pitch:(Float32) pitch pan:(Float32) pan gain:(Float32) gain\n{\n    int soundId = [bufferManager bufferForFile:filePath create:YES];\n    if (soundId != kCDNoBuffer) {\n        return [soundEngine playSound:soundId sourceGroupId:0 pitch:pitch pan:pan gain:gain loop:loop];\n    } else {\n        return CD_MUTE;\n    }    \n}\n\n-(void) stopEffect:(ALuint) soundId {\n    [soundEngine stopSound:soundId];\n}    \n\n-(void) pauseEffect:(ALuint) soundId {\n  [soundEngine pauseSound: soundId];\n}\n\n-(void) pauseAllEffects {\n  [soundEngine pauseAllSounds];\n}\n\n-(void) resumeEffect:(ALuint) soundId {\n  [soundEngine resumeSound: soundId];\n}\n\n-(void) resumeAllEffects {\n  [soundEngine resumeAllSounds];\n}\n\n-(void) stopAllEffects {\n  [soundEngine stopAllSounds];\n}\n\n-(void) preloadEffect:(NSString*) filePath\n{\n    int soundId = [bufferManager bufferForFile:filePath create:YES];\n    if (soundId == kCDNoBuffer) {\n        CDLOG(@\"Denshion::SimpleAudioEngine sound failed to preload %@\",filePath);\n    }\n}\n\n-(void) unloadEffect:(NSString*) filePath\n{\n    CDLOGINFO(@\"Denshion::SimpleAudioEngine unloadedEffect %@\",filePath);\n    [bufferManager releaseBufferForFile:filePath];\n}\n\n#pragma mark Audio Interrupt Protocol\n-(BOOL) mute\n{\n    return mute_;\n}\n\n-(void) setMute:(BOOL) muteValue\n{\n    if (mute_ != muteValue) {\n        mute_ = muteValue;\n        am.mute = mute_;\n    }    \n}\n\n-(BOOL) enabled\n{\n    return enabled_;\n}\n\n-(void) setEnabled:(BOOL) enabledValue\n{\n    if (enabled_ != enabledValue) {\n        enabled_ = enabledValue;\n        am.enabled = enabled_;\n    }    \n}\n\n\n#pragma mark SimpleAudioEngine - BackgroundMusicVolume\n-(float) backgroundMusicVolume\n{\n    return am.backgroundMusic.volume;\n}    \n\n-(void) setBackgroundMusicVolume:(float) volume\n{\n    am.backgroundMusic.volume = volume;\n}    \n\n#pragma mark SimpleAudioEngine - EffectsVolume\n-(float) effectsVolume\n{\n    return am.soundEngine.masterGain;\n}    \n\n-(void) setEffectsVolume:(float) volume\n{\n    am.soundEngine.masterGain = volume;\n}    \n\n-(CDSoundSource *) soundSourceForFile:(NSString*) filePath {\n    int soundId = [bufferManager bufferForFile:filePath create:YES];\n    if (soundId != kCDNoBuffer) {\n        CDSoundSource *result = [soundEngine soundSourceForSound:soundId sourceGroupId:0];\n        CDLOGINFO(@\"Denshion::SimpleAudioEngine sound source created for %@\",filePath);\n        return result;\n    } else {\n        return nil;\n    }    \n}    \n\n@end \n"
  },
  {
    "path": "cocos2d/cocos/audio/linux/AudioPlayer.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef AUDIOPLAYER_H_\n#define AUDIOPLAYER_H_\n\nnamespace CocosDenshion {\n\nclass AudioPlayer {\npublic:\n\tvirtual void close() = 0;\n\n\t/**\n\t @brief Preload background music\n\t @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo\n\t */\n\tvirtual void preloadBackgroundMusic(const char* pszFilePath) = 0;\n\n\t/**\n\t @brief Play background music\n\t @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo\n\t @param bLoop Whether the background music loop or not\n\t */\n\tvirtual void playBackgroundMusic(const char* pszFilePath, bool bLoop = false) = 0;\n\n\t/**\n\t @brief Stop playing background music\n\t @param bReleaseData If release the background music data or not.As default value is false\n\t */\n\tvirtual void stopBackgroundMusic(bool bReleaseData = false) = 0;\n\n\t/**\n\t @brief Pause playing background music\n\t */\n\tvirtual void pauseBackgroundMusic() = 0;\n\n\t/**\n\t @brief Resume playing background music\n\t */\n\tvirtual void resumeBackgroundMusic() = 0;\n\n\t/**\n\t @brief Rewind playing background music\n\t */\n\tvirtual void rewindBackgroundMusic() = 0;\n\n\tvirtual bool willPlayBackgroundMusic() = 0;\n\n\t/**\n\t @brief Whether the background music is playing\n\t @return If is playing return true,or return false\n\t */\n\tvirtual bool isBackgroundMusicPlaying() = 0;\n\n\t// properties\n\t/**\n\t @brief The volume of the background music max value is 1.0,the min value is 0.0\n\t */\n\tvirtual float getBackgroundMusicVolume() = 0;\n\n\t/**\n\t @brief set the volume of background music\n\t @param volume must be in 0.0~1.0\n\t */\n\tvirtual void setBackgroundMusicVolume(float volume) = 0;\n\n\t/**\n\t @brief The volume of the effects max value is 1.0,the min value is 0.0\n\t */\n\tvirtual float getEffectsVolume() = 0;\n\n\t/**\n\t @brief set the volume of sound effecs\n\t @param volume must be in 0.0~1.0\n\t */\n\tvirtual void setEffectsVolume(float volume) = 0;\n\n\t// for sound effects\n\t/**\n\t @brief Play sound effect\n\t @param pszFilePath The path of the effect file,or the FileName of T_SoundResInfo\n\t @bLoop Whether to loop the effect playing, default value is false\n\t */\n\tvirtual unsigned int playEffect(const char* pszFilePath, bool bLoop,\n                                    float pitch, float pan, float gain) = 0;\n\n\t/**\n\t @brief Stop playing sound effect\n\t @param nSoundId The return value of function playEffect\n\t */\n\tvirtual void stopEffect(unsigned int nSoundId) = 0;\n\n\t/**\n\t @brief  \t\tpreload a compressed audio file\n\t @details\t    the compressed audio will be decode to wave, then write into an\n\t internal buffer in SimpleaudioEngine\n\t */\n\tvirtual void preloadEffect(const char* pszFilePath) = 0;\n\n\t/**\n\t @brief  \t\tunload the preloaded effect from internal buffer\n\t @param[in]\t\tpszFilePath\t\tThe path of the effect file,or the FileName of T_SoundResInfo\n\t */\n\tvirtual void unloadEffect(const char* pszFilePath) = 0;\n\n\t/**\n\t @brief  \t\tpause an effect identified by sound id\n\t @param[in]\t\tuSoundId \tsound id\n\t */\n\tvirtual void pauseEffect(unsigned int uSoundId) = 0;\n\n\t/**\n\t @brief  \t\tpause all playing effects\n\t */\n\tvirtual void pauseAllEffects() = 0;\n\n\t/**\n\t @brief  \t\tresume an effect identified by sound id\n\t @param[in]\t\tuSoundId \tsound id\n\t */\n\tvirtual void resumeEffect(unsigned int uSoundId) = 0;\n\n\t/**\n\t @brief  \t\tresume a effect identified by sound id\n\t */\n\tvirtual void resumeAllEffects() = 0;\n\n\t/**\n\t @brief  \t\tstop all playing effects\n\t */\n\tvirtual void stopAllEffects() = 0;\n};\n}\n\n\n#endif /* AUDIOPLAYER_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/audio/linux/FmodAudioPlayer.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"FmodAudioPlayer.h\"\n#include <stdio.h>\n#include \"stdlib.h\"\n#include \"assert.h\"\n#include \"string.h\"\n\n#define szMusicSuffix \"|\"\n\nnamespace CocosDenshion {\n\nFmodAudioPlayer* FmodAudioPlayer::sharedPlayer() {\n\tstatic FmodAudioPlayer s_SharedPlayer;\n\treturn &s_SharedPlayer;\n}\n\nvoid ERRCHECKWITHEXIT(FMOD_RESULT result) {\n\tif (result != FMOD_OK) {\n\t\tprintf(\"FMOD error! (%d) %s\\n\", result, FMOD_ErrorString(result));\n//\t\texit(-1);\n\t}\n}\n\nbool ERRCHECK(FMOD_RESULT result) {\n\tif (result != FMOD_OK) {\n\t\tprintf(\"FMOD error! (%d) %s\\n\", result, FMOD_ErrorString(result));\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nFmodAudioPlayer::FmodAudioPlayer() :\n\t\tpMusic(0), pBGMChannel(0), iSoundChannelCount(0) {\n\tinit();\n}\n\nvoid FmodAudioPlayer::init() {\n\t//init\n\tFMOD_RESULT result;\n\tFMOD::ChannelGroup *masterChannelGroup;\n\n\t/*\n\t Create a System object and initialize.\n\t */\n\tresult = FMOD::System_Create(&pSystem);\n\tERRCHECKWITHEXIT(result);\n\n\tresult = pSystem->setOutput(FMOD_OUTPUTTYPE_ALSA);\n\tERRCHECKWITHEXIT(result);\n\n\tresult = pSystem->init(32, FMOD_INIT_NORMAL, 0);\n\tERRCHECKWITHEXIT(result);\n\n\tresult = pSystem->createChannelGroup(\"Channel Group\", &pChannelGroup);\n\tERRCHECKWITHEXIT(result);\n\n\tresult = pSystem->getMasterChannelGroup(&masterChannelGroup);\n\tERRCHECKWITHEXIT(result);\n\n\tresult = masterChannelGroup->addGroup(pChannelGroup);\n\tERRCHECKWITHEXIT(result);\n\n\tmapEffectSound.clear();\n\n}\n\nvoid FmodAudioPlayer::close() {\n\tFMOD_RESULT result;\n\t//BGM\n\tif (pBGMChannel != NULL) {\n\t\tresult = pBGMChannel->stop();\n\t\tERRCHECKWITHEXIT(result);\n\t\tpBGMChannel = 0;\n\t}\n\n\tif (pMusic != NULL) {\n\t\tresult = pMusic->release();\n\t\tERRCHECKWITHEXIT(result);\n\t\tpMusic = 0;\n\t}\n\n\tresult = pChannelGroup->release();\n\tERRCHECKWITHEXIT(result);\n\tsMusicPath.clear();\n\n\tresult = pSystem->close();\n\tERRCHECKWITHEXIT(result);\n\tresult = pSystem->release();\n\tERRCHECKWITHEXIT(result);\n\n\tinit();\n}\n\nFmodAudioPlayer::~FmodAudioPlayer() {\n\tFMOD_RESULT result;\n\t//BGM\n\tif (pBGMChannel != NULL) {\n\t\tresult = pBGMChannel->stop();\n\t\tERRCHECKWITHEXIT(result);\n\t}\n\n\tif (pMusic != NULL) {\n\t\tresult = pMusic->release();\n\t\tERRCHECKWITHEXIT(result);\n\t}\n\n\tresult = pChannelGroup->release();\n\tERRCHECKWITHEXIT(result);\n\n\tresult = pSystem->close();\n\tERRCHECKWITHEXIT(result);\n\tresult = pSystem->release();\n\tERRCHECKWITHEXIT(result);\n}\n\n// BGM\nvoid FmodAudioPlayer::preloadBackgroundMusic(const char* pszFilePath) {\n\tFMOD_RESULT result;\n\tpSystem->update();\n\tstring sNewMusicPath = string(pszFilePath) + szMusicSuffix;\n\tif (pMusic && sNewMusicPath != sMusicPath) {\n\t\t//release old\n\t\tresult = pMusic->release();\n\t\tERRCHECKWITHEXIT(result);\n\n\t\tsMusicPath = sNewMusicPath;\n\n\t}\n\n\tresult = pSystem->createSound(pszFilePath, FMOD_LOOP_NORMAL, 0, &pMusic);\n\tERRCHECK(result);\n}\n\nvoid FmodAudioPlayer::playBackgroundMusic(const char* pszFilePath, bool bLoop) {\n\tpSystem->update();\n\tif (pMusic == NULL) {\n\t\t//did not load it\n\t\t//load the new music\n\t\tFMOD_RESULT result = pSystem->createSound(pszFilePath, FMOD_LOOP_NORMAL,\n\t\t\t\t0, &pMusic);\n\t\tif (!ERRCHECK(result)) {\n\t\t\tsMusicPath = string(pszFilePath) + szMusicSuffix;\n\t\t}\n\n\t} else {\n\t\tstring sNewMusicPath = string(pszFilePath) + szMusicSuffix;\n\t\tif (pBGMChannel) {\n\t\t\tpBGMChannel->stop();\n\t\t\tpBGMChannel = 0;\n\t\t}\n\n\t\tif (sNewMusicPath != sMusicPath) {\n\n\t\t\tpMusic->release();\n\t\t\t//load the new music\n\t\t\tFMOD_RESULT result = pSystem->createSound(pszFilePath,\n\t\t\t\t\tFMOD_LOOP_NORMAL, 0, &pMusic);\n\n\t\t\tif (!ERRCHECK(result)) {\n\t\t\t\tsMusicPath = sNewMusicPath;\n\t\t\t}\n\t\t}\n\n\t}\n\n\tFMOD_RESULT result = pSystem->playSound(FMOD_CHANNEL_FREE, pMusic, true,\n\t\t\t&pBGMChannel);\n\tif (!ERRCHECK(result)) {\n\t\tpBGMChannel->setLoopCount((bLoop) ? -1 : 0);\n\t\tresult = pBGMChannel->setPaused(false);\n\t}\n}\n\nvoid FmodAudioPlayer::stopBackgroundMusic(bool bReleaseData) {\n\tFMOD_RESULT result;\n\tpSystem->update();\n\n\tif (pBGMChannel == NULL || pMusic == NULL) {\n\t\treturn;\n\t}\n\tif (bReleaseData) {\n\t\tresult = pBGMChannel->stop();\n\t\tERRCHECKWITHEXIT(result);\n\t\tresult = pMusic->release();\n\t\tERRCHECKWITHEXIT(result);\n\t\tpBGMChannel = 0;\n\t\tpMusic = 0;\n\t} else {\n\t\tresult = pBGMChannel->stop();\n\t\tERRCHECKWITHEXIT(result);\n\t\tpBGMChannel = 0;\n\t}\n\tsMusicPath.clear();\n\n}\n\nvoid FmodAudioPlayer::pauseBackgroundMusic() {\n\tif (pBGMChannel == NULL) {\n\t\treturn;\n\t}\n\tpSystem->update();\n\tFMOD_RESULT result = pBGMChannel->setPaused(true);\n\tERRCHECKWITHEXIT(result);\n\n}\n\nvoid FmodAudioPlayer::resumeBackgroundMusic() {\n\tif (pBGMChannel == NULL) {\n\t\treturn;\n\t}\n\tpSystem->update();\n\tFMOD_RESULT result = pBGMChannel->setPaused(false);\n\tERRCHECKWITHEXIT(result);\n}\n\nvoid FmodAudioPlayer::rewindBackgroundMusic() {\n\tif (pBGMChannel == NULL) {\n\t\treturn;\n\t}\n\tpSystem->update();\n\tFMOD_RESULT result = pBGMChannel->setPosition(0, FMOD_TIMEUNIT_MS);\n\tERRCHECKWITHEXIT(result);\n}\n\nbool FmodAudioPlayer::willPlayBackgroundMusic() {\n\tpSystem->update();\n\treturn false; //do it according to win\n}\n\nbool FmodAudioPlayer::isBackgroundMusicPlaying() {\n\tbool bPlaying;\n\tif (pBGMChannel == NULL) {\n\t\treturn false;\n\t}\n\tpSystem->update();\n\tFMOD_RESULT result = pBGMChannel->isPlaying(&bPlaying);\n\tERRCHECKWITHEXIT(result);\n\treturn bPlaying;\n\n}\n\nfloat FmodAudioPlayer::getBackgroundMusicVolume() {\n\tfloat fVolumn;\n\tif (pBGMChannel == NULL) {\n\t\treturn 0;\n\t}\n\tpSystem->update();\n\tFMOD_RESULT result = pBGMChannel->getVolume(&fVolumn);\n\tERRCHECKWITHEXIT(result);\n\treturn fVolumn;\n}\n\nvoid FmodAudioPlayer::setBackgroundMusicVolume(float volume) {\n\tif (pBGMChannel == NULL) {\n\t\treturn;\n\t}\n\tpSystem->update();\n\tFMOD_RESULT result = pBGMChannel->setVolume(volume);\n\tERRCHECKWITHEXIT(result);\n\n}\n//~BGM\n\n// for sound effects\nfloat FmodAudioPlayer::getEffectsVolume() {\n\tfloat fVolumn;\n\tpSystem->update();\n\tFMOD_RESULT result = pChannelGroup->getVolume(&fVolumn);\n\tERRCHECKWITHEXIT(result);\n\treturn fVolumn;\n}\n\nvoid FmodAudioPlayer::setEffectsVolume(float volume) {\n\tpSystem->update();\n\tFMOD_RESULT result = pChannelGroup->setVolume(volume);\n\tERRCHECKWITHEXIT(result);\n\n}\n\nunsigned int FmodAudioPlayer::playEffect(const char* pszFilePath, bool bLoop,\n                                         float pitch, float pan, float gain) {\n\tFMOD::Channel* pChannel;\n\tFMOD::Sound* pSound = NULL;\n\n\tdo {\n\t\tpSystem->update();\n\n\t\tmap<string, FMOD::Sound*>::iterator l_it = mapEffectSound.find(\n\t\t\t\tstring(pszFilePath));\n\t\tif (l_it == mapEffectSound.end()) {\n\t\t\t//no load it yet\n\t\t\tpreloadEffect(pszFilePath);\n\t\t\tl_it = mapEffectSound.find(string(pszFilePath));\n\t\t}\n\t\tpSound = l_it->second;\n\t\tif (pSound==NULL){\n\t\t\tbreak;\n\t\t}\n\n\t\tFMOD_RESULT result = pSystem->playSound(FMOD_CHANNEL_FREE, pSound, true,\n\t\t\t\t&pChannel);\n\n\t\tif (ERRCHECK(result)) {\n\t\t\tprintf(\"sound effect in %s could not be played\", pszFilePath);\n\t\t\tbreak;\n\t\t}\n\n\t\tpChannel->setChannelGroup(pChannelGroup);\n        pChannel->setPan(pan);\n        float freq = 0;\n        pChannel->getFrequency(&freq);\n        pChannel->setFrequency(pitch * freq);\n        pChannel->setVolume(gain);\n\n\t\t//set its loop\n\t\tpChannel->setLoopCount((bLoop) ? -1 : 0);\n\t\tresult = pChannel->setPaused(false);\n\n\t\tmapEffectSoundChannel[iSoundChannelCount] = pChannel;\n\t\treturn iSoundChannelCount++;\n\t} while (0);\n\n\treturn 0;\n}\n\nvoid FmodAudioPlayer::stopEffect(unsigned int nSoundId) {\n\tFMOD::Channel* pChannel;\n\tpSystem->update();\n\n\tmap<unsigned int, FMOD::Channel*>::iterator l_it =\n\t\t\tmapEffectSoundChannel.find(nSoundId);\n\tif (l_it == mapEffectSoundChannel.end()) {\n\t\t//no play  yet\n\t\treturn;\n\t}\n\tpChannel = l_it->second;\n\t//stop the channel;\n\tpChannel->stop();\n\n\t//delete from the map;\n\tmapEffectSoundChannel.erase(nSoundId);\n}\n\nvoid FmodAudioPlayer::pauseEffect(unsigned int uSoundId) {\n\tFMOD::Channel* pChannel;\n\tpSystem->update();\n\n\tmap<unsigned int, FMOD::Channel*>::iterator l_it =\n\t\t\tmapEffectSoundChannel.find(uSoundId);\n\tif (l_it == mapEffectSoundChannel.end()) {\n\t\t//no play  yet\n\t\treturn;\n\t}\n\tpChannel = l_it->second;\n\t//pause the channel;\n\tpChannel->setPaused(true);\n}\n\nvoid FmodAudioPlayer::pauseAllEffects() {\n\tFMOD::Channel* pChannel;\n\tpSystem->update();\n\n\tmap<unsigned int, FMOD::Channel*>::iterator l_it =\n\t\t\tmapEffectSoundChannel.begin();\n\t\n\tfor (; l_it != mapEffectSoundChannel.end(); l_it++) {\n\t\tpChannel = l_it->second;\n\t\t//pause the channel;\n\t\tpChannel->setPaused(true);\n\t}\n}\n\nvoid FmodAudioPlayer::resumeEffect(unsigned int uSoundId) {\n\tFMOD::Channel* pChannel;\n\tpSystem->update();\n\n\tmap<unsigned int, FMOD::Channel*>::iterator l_it =\n\t\t\tmapEffectSoundChannel.find(uSoundId);\n\tif (l_it == mapEffectSoundChannel.end()) {\n\t\t//no play  yet\n\t\treturn;\n\t}\n\n\tpChannel = l_it->second;\n\t//resume the channel;\n\tpChannel->setPaused(false);\n}\n\nvoid FmodAudioPlayer::resumeAllEffects() {\n\tFMOD::Channel* pChannel;\n\tpSystem->update();\n\n\tmap<unsigned int, FMOD::Channel*>::iterator l_it =\n\t\t\tmapEffectSoundChannel.begin();\n\t\n\tfor (; l_it != mapEffectSoundChannel.end(); l_it++) {\n\t\tpChannel = l_it->second;\n\t\t//resume the channel;\n\t\tpChannel->setPaused(false);\n\t}\n}\n\nvoid FmodAudioPlayer::stopAllEffects() {\n\tFMOD::Channel* pChannel;\n\tpSystem->update();\n\n\tmap<unsigned int, FMOD::Channel*>::iterator l_it =\n\t\t\tmapEffectSoundChannel.begin();\n\t\n\tfor (; l_it != mapEffectSoundChannel.end(); l_it++) {\n\t\tpChannel = l_it->second;\n\t\t//resume the channel;\n\t\tpChannel->stop();\n\t}\n\n\tmapEffectSoundChannel.clear();\n}\n\nvoid FmodAudioPlayer::preloadEffect(const char* pszFilePath) {\n\tFMOD::Sound* pLoadSound;\n\n\tpSystem->update();\n\tFMOD_RESULT result = pSystem->createSound(pszFilePath, FMOD_LOOP_NORMAL, 0,\n\t\t\t&pLoadSound);\n\tif (ERRCHECK(result)){\n\t\tprintf(\"sound effect in %s could not be preload\", pszFilePath);\n\t\treturn;\n\t}\n\tmapEffectSound[string(pszFilePath)] = pLoadSound;\n}\n\nvoid FmodAudioPlayer::unloadEffect(const char* pszFilePath) {\n\tFMOD::Sound* pSound;\n\tpSystem->update();\n\n\tmap<string, FMOD::Sound*>::iterator l_it = mapEffectSound.find(\n\t\t\tstring(pszFilePath));\n\tif (l_it == mapEffectSound.end()) {\n\t\t//no load  yet\n\t\treturn;\n\t}\n\tpSound = l_it->second;\n\n\t//release the sound;\n\tpSound->release();\n\n\t//delete from the map\n\tmapEffectSound.erase(string(pszFilePath));\n}\n\n//~for sound effects\n\n} /* namespace CocosDenshion */\n"
  },
  {
    "path": "cocos2d/cocos/audio/linux/FmodAudioPlayer.h",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef FMODAUDIOPLAYER_H_\n#define FMODAUDIOPLAYER_H_\n\n#include \"fmod.hpp\"\n#include \"fmod_errors.h\"\n#include \"AudioPlayer.h\"\n#include \"string\"\n#include <map>\n\n\nusing namespace std;\n\nnamespace CocosDenshion {\n\nclass FmodAudioPlayer : public AudioPlayer{\npublic:\n\tFmodAudioPlayer();\n\tvirtual ~FmodAudioPlayer();\n\n\tstatic FmodAudioPlayer* sharedPlayer();\n\n\tvirtual void close();\n\n\n\n\t/**\n\t @brief Preload background music\n\t @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo\n\t */\n\tvirtual void preloadBackgroundMusic(const char* pszFilePath);\n\n\t/**\n\t @brief Play background music\n\t @param pszFilePath The path of the background music file,or the FileName of T_SoundResInfo\n\t @param bLoop Whether the background music loop or not\n\t */\n\tvirtual void playBackgroundMusic(const char* pszFilePath, bool bLoop);\n\n\t/**\n\t @brief Stop playing background music\n\t @param bReleaseData If release the background music data or not.As default value is false\n\t */\n\tvirtual void stopBackgroundMusic(bool bReleaseData);\n\n\t/**\n\t @brief Pause playing background music\n\t */\n\tvirtual void pauseBackgroundMusic();\n\n\t/**\n\t @brief Resume playing background music\n\t */\n\tvirtual void resumeBackgroundMusic();\n\n\t/**\n\t @brief Rewind playing background music\n\t */\n\tvirtual void rewindBackgroundMusic();\n\n\tvirtual bool willPlayBackgroundMusic();\n\n\t/**\n\t @brief Whether the background music is playing\n\t @return If is playing return true,or return false\n\t */\n\tvirtual bool isBackgroundMusicPlaying();\n\n\t// properties\n\t/**\n\t @brief The volume of the background music max value is 1.0,the min value is 0.0\n\t */\n\tvirtual float getBackgroundMusicVolume();\n\n\t/**\n\t @brief set the volume of background music\n\t @param volume must be in 0.0~1.0\n\t */\n\tvirtual void setBackgroundMusicVolume(float volume);\n\n\t/**\n\t @brief The volume of the effects max value is 1.0,the min value is 0.0\n\t */\n\tvirtual float getEffectsVolume();\n\n\t/**\n\t @brief set the volume of sound effecs\n\t @param volume must be in 0.0~1.0\n\t */\n\tvirtual void setEffectsVolume(float volume);\n\n\t// for sound effects\n\t/**\n\t @brief Play sound effect\n\t @param pszFilePath The path of the effect file,or the FileName of T_SoundResInfo\n\t @bLoop Whether to loop the effect playing, default value is false\n\t */\n\tvirtual unsigned int playEffect(const char* pszFilePath, bool bLoop,\n                                    float pitch, float pan, float gain);\n\n\t/**\n\t @brief Stop playing sound effect\n\t @param nSoundId The return value of function playEffect\n\t */\n\tvirtual void stopEffect(unsigned int nSoundId);\n\n\t/**\n\t @brief  \t\tpreload a compressed audio file\n\t @details\t    the compressed audio will be decode to wave, then write into an\n\t internal buffer in SimpleaudioEngine\n\t */\n\tvirtual void preloadEffect(const char* pszFilePath);\n\n\t/**\n\t @brief  \t\tunload the preloaded effect from internal buffer\n\t @param[in]\t\tpszFilePath\t\tThe path of the effect file,or the FileName of T_SoundResInfo\n\t */\n\tvirtual void unloadEffect(const char* pszFilePath);\n\n\t/**\n\t @brief  \t\tpause an effect identified by sound id\n\t @param[in]\t\tuSoundId \tsound id\n\t */\n\tvirtual void pauseEffect(unsigned int uSoundId);\n\n\t/**\n\t @brief  \t\tpause all playing effects\n\t */\n\tvirtual void pauseAllEffects();\n\n\t/**\n\t @brief  \t\tresume an effect identified by sound id\n\t @param[in]\t\tuSoundId \tsound id\n\t */\n\tvirtual void resumeEffect(unsigned int uSoundId);\n\n\t/**\n\t @brief  \t\tresume a effect identified by sound id\n\t */\n\tvirtual void resumeAllEffects();\n\n\t/**\n\t @brief  \t\tstop all playing effects\n\t */\n\tvirtual void stopAllEffects();\n\nprivate:\n\n\tvoid init();\n\tmap<string, FMOD::Sound*> mapEffectSound;\n\tmap<unsigned int, FMOD::Channel*> mapEffectSoundChannel;\n\n\tFMOD::System* \tpSystem;\n\tFMOD::Sound* \tpMusic;   //BGM\n\tFMOD::Channel* \tpBGMChannel;\n\n\tFMOD::ChannelGroup* pChannelGroup;\n\n\tunsigned int iSoundChannelCount;\n\n\tstring sMusicPath;\n\n};\n\n} /* namespace CocosDenshion */\n#endif /* FMODAUDIOPLAYER_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/audio/linux/SimpleAudioEngineFMOD.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2011      Laschweinski\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef OPENAL\n\n#include \"SimpleAudioEngine.h\"\n#include \"FmodAudioPlayer.h\"\n#include \"cocos2d.h\"\nUSING_NS_CC;\n\nnamespace CocosDenshion {\n\nstatic AudioPlayer* oAudioPlayer;\n\nSimpleAudioEngine::SimpleAudioEngine() {\n\toAudioPlayer = FmodAudioPlayer::sharedPlayer();\n}\n\nSimpleAudioEngine::~SimpleAudioEngine() {\n}\n\nSimpleAudioEngine* SimpleAudioEngine::getInstance() {\n\tstatic SimpleAudioEngine s_SharedEngine;\n\treturn &s_SharedEngine;\n}\n\nvoid SimpleAudioEngine::end() {\n\toAudioPlayer->close();\n}\n\n//////////////////////////////////////////////////////////////////////////\n// BackgroundMusic\n//////////////////////////////////////////////////////////////////////////\n\nvoid SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath,\n\t\tbool bLoop) {\n\t// Changing file path to full path\n\tstd::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\toAudioPlayer->playBackgroundMusic(fullPath.c_str(), bLoop);\n}\n\nvoid SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) {\n\toAudioPlayer->stopBackgroundMusic(bReleaseData);\n}\n\nvoid SimpleAudioEngine::pauseBackgroundMusic() {\n\toAudioPlayer->pauseBackgroundMusic();\n}\n\nvoid SimpleAudioEngine::resumeBackgroundMusic() {\n\toAudioPlayer->resumeBackgroundMusic();\n}\n\nvoid SimpleAudioEngine::rewindBackgroundMusic() {\n\toAudioPlayer->rewindBackgroundMusic();\n}\n\nbool SimpleAudioEngine::willPlayBackgroundMusic() {\n\treturn oAudioPlayer->willPlayBackgroundMusic();\n}\n\nbool SimpleAudioEngine::isBackgroundMusicPlaying() {\n\treturn oAudioPlayer->isBackgroundMusicPlaying();\n}\n\nvoid SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath) {\n\t// Changing file path to full path\n\tstd::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\treturn oAudioPlayer->preloadBackgroundMusic(fullPath.c_str());\n}\n\n//////////////////////////////////////////////////////////////////////////\n// effect function\n//////////////////////////////////////////////////////////////////////////\n\nunsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,\n                                           float pitch, float pan, float gain) {\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    return oAudioPlayer->playEffect(fullPath.c_str(), bLoop, pitch, pan, gain);\n}\n\nvoid SimpleAudioEngine::stopEffect(unsigned int nSoundId) {\n\treturn oAudioPlayer->stopEffect(nSoundId);\n}\n\nvoid SimpleAudioEngine::preloadEffect(const char* pszFilePath) {\n\t// Changing file path to full path\n\tstd::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\treturn oAudioPlayer->preloadEffect(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::unloadEffect(const char* pszFilePath) {\n\t// Changing file path to full path\n\tstd::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\treturn oAudioPlayer->unloadEffect(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::pauseEffect(unsigned int uSoundId) {\n\toAudioPlayer->pauseEffect(uSoundId);\n}\n\nvoid SimpleAudioEngine::pauseAllEffects() {\n\toAudioPlayer->pauseAllEffects();\n}\n\nvoid SimpleAudioEngine::resumeEffect(unsigned int uSoundId) {\n\toAudioPlayer->resumeEffect(uSoundId);\n}\n\nvoid SimpleAudioEngine::resumeAllEffects() {\n\toAudioPlayer->resumeAllEffects();\n}\n\nvoid SimpleAudioEngine::stopAllEffects() {\n\toAudioPlayer->stopAllEffects();\n}\n\n\n\n//////////////////////////////////////////////////////////////////////////\n// volume interface\n//////////////////////////////////////////////////////////////////////////\n\nfloat SimpleAudioEngine::getBackgroundMusicVolume() {\n\treturn oAudioPlayer->getBackgroundMusicVolume();\n}\n\nvoid SimpleAudioEngine::setBackgroundMusicVolume(float volume) {\n\treturn oAudioPlayer->setBackgroundMusicVolume(volume);\n}\n\nfloat SimpleAudioEngine::getEffectsVolume() {\n\treturn oAudioPlayer->getEffectsVolume();\n}\n\nvoid SimpleAudioEngine::setEffectsVolume(float volume) {\n\treturn oAudioPlayer->setEffectsVolume(volume);\n}\n\n\n} // end of namespace CocosDenshion\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CDAudioManager.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n#import \"CocosDenshion.h\"\n#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000\n    #import <AVFoundation/AVFoundation.h>\n#else\n    #import \"CDXMacOSXSupport.h\"\n#endif\n\n/** Different modes of the engine */\ntypedef enum {\n    kAMM_FxOnly,                    //!Other apps will be able to play audio\n    kAMM_FxPlusMusic,                //!Only this app will play audio\n    kAMM_FxPlusMusicIfNoOtherAudio,    //!If another app is playing audio at start up then allow it to continue and don't play music\n    kAMM_MediaPlayback,                //!This app takes over audio e.g music player app\n    kAMM_PlayAndRecord                //!App takes over audio and has input and output\n} tAudioManagerMode;\n\n/** Possible states of the engine */\ntypedef enum {\n    kAMStateUninitialised, //!Audio manager has not been initialised - do not use\n    kAMStateInitialising,  //!Audio manager is in the process of initialising - do not use\n    kAMStateInitialised       //!Audio manager is initialised - safe to use\n} tAudioManagerState;\n\ntypedef enum {\n    kAMRBDoNothing,                //Audio manager will not do anything on resign or becoming active\n    kAMRBStopPlay,                //Background music is stopped on resign and resumed on become active\n    kAMRBStop                    //Background music is stopped on resign but not resumed - maybe because you want to do this from within your game\n} tAudioManagerResignBehavior;\n\n/** Notifications */\nextern NSString * const kCDN_AudioManagerInitialised;\n\n@interface CDAsynchInitialiser : NSOperation {}    \n@end\n\n/** CDAudioManager supports two long audio source channels called left and right*/\ntypedef enum {\n    kASC_Left = 0,\n    kASC_Right = 1\n} tAudioSourceChannel;    \n\ntypedef enum {\n    kLAS_Init,\n    kLAS_Loaded,\n    kLAS_Playing,\n    kLAS_Paused,\n    kLAS_Stopped,\n} tLongAudioSourceState;\n\n@class CDLongAudioSource;\n@protocol CDLongAudioSourceDelegate <NSObject>\n@optional\n/** The audio source completed playing */\n- (void) cdAudioSourceDidFinishPlaying:(CDLongAudioSource *) audioSource;\n/** The file used to load the audio source has changed */\n- (void) cdAudioSourceFileDidChange:(CDLongAudioSource *) audioSource;\n@end\n\n/**\n CDLongAudioSource represents an audio source that has a long duration which makes\n it costly to load into memory for playback as an effect using CDSoundEngine. Examples\n include background music and narration tracks. The audio file may or may not be compressed.\n Bear in mind that current iDevices can only use hardware to decode a single compressed\n audio file at a time and playing multiple compressed files will result in a performance drop\n as software decompression will take place.\n @since v0.99\n */\n@interface CDLongAudioSource : NSObject <AVAudioPlayerDelegate, CDAudioInterruptProtocol>{\n    AVAudioPlayer    *audioSourcePlayer;\n    NSString        *audioSourceFilePath;\n    NSInteger        numberOfLoops;\n    float            volume;\n    id<CDLongAudioSourceDelegate> delegate; \n    BOOL            mute;\n    BOOL            enabled_;\n    BOOL            backgroundMusic;\n    // whether background music is paused\n    BOOL            paused;\n@public    \n    BOOL            systemPaused;//Used for auto resign handling\n    NSTimeInterval    systemPauseLocation;//Used for auto resign handling\n@protected\n    tLongAudioSourceState state;\n}    \n@property (readonly) AVAudioPlayer *audioSourcePlayer;\n@property (readonly) NSString *audioSourceFilePath;\n@property (readwrite, nonatomic) NSInteger numberOfLoops;\n@property (readwrite, nonatomic) float volume;\n@property (assign) id<CDLongAudioSourceDelegate> delegate;\n/* This long audio source functions as background music */\n@property (readwrite, nonatomic) BOOL backgroundMusic;\n@property (readonly) BOOL paused;\n\n/** Loads the file into the audio source */\n-(void) load:(NSString*) filePath;\n/** Plays the audio source */\n-(void) play;\n/** Stops playing the audio soruce */\n-(void) stop;\n/** Pauses the audio source */\n-(void) pause;\n/** Rewinds the audio source */\n-(void) rewind;\n/** Resumes playing the audio source if it was paused */\n-(void) resume;\n/** Returns whether or not the audio source is playing */\n-(BOOL) isPlaying;\n\n@end\n\n/** \n CDAudioManager manages audio requirements for a game.  It provides access to a CDSoundEngine object\n for playing sound effects.  It provides access to two CDLongAudioSource object (left and right channel)\n for playing long duration audio such as background music and narration tracks.  Additionally it manages\n the audio session to take care of things like audio session interruption and interacting with the audio\n of other apps that are running on the device.\n \n Requirements:\n - Firmware: OS 2.2 or greater \n - Files: CDAudioManager.*, CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox, AVFoundation\n @since v0.8\n */\n@interface CDAudioManager : NSObject <CDLongAudioSourceDelegate, CDAudioInterruptProtocol, AVAudioSessionDelegate> {\n    CDSoundEngine        *soundEngine;\n    CDLongAudioSource    *backgroundMusic;\n    NSMutableArray        *audioSourceChannels;\n    NSString*            _audioSessionCategory;\n    BOOL                _audioWasPlayingAtStartup;\n    tAudioManagerMode    _mode;\n    SEL backgroundMusicCompletionSelector;\n    id backgroundMusicCompletionListener;\n    BOOL willPlayBackgroundMusic;\n    BOOL _mute;\n    BOOL _resigned;\n    BOOL _interrupted;\n    BOOL _audioSessionActive;\n    BOOL enabled_;\n    \n    //For handling resign/become active\n    BOOL _isObservingAppEvents;\n    tAudioManagerResignBehavior _resignBehavior;\n}\n\n@property (readonly) CDSoundEngine *soundEngine;\n@property (readonly) CDLongAudioSource *backgroundMusic;\n@property (readonly) BOOL willPlayBackgroundMusic;\n\n/** Returns the shared singleton */\n+ (CDAudioManager *) sharedManager;\n+ (tAudioManagerState) sharedManagerState;\n/** Configures the shared singleton with a mode*/\n+ (void) configure: (tAudioManagerMode) mode;\n/** Initializes the engine asynchronously with a mode */\n+ (void) initAsynchronously: (tAudioManagerMode) mode;\n/** Initializes the engine synchronously with a mode, channel definition and a total number of channels */\n- (id) init: (tAudioManagerMode) mode;\n-(void) audioSessionInterrupted;\n-(void) audioSessionResumed;\n-(void) setResignBehavior:(tAudioManagerResignBehavior) resignBehavior autoHandle:(BOOL) autoHandle;\n/** Returns true is audio is muted at a hardware level e.g user has ringer switch set to off */\n-(BOOL) isDeviceMuted;\n/** Returns true if another app is playing audio such as the iPod music player */\n-(BOOL) isOtherAudioPlaying;\n/** Sets the way the audio manager interacts with the operating system such as whether it shares output with other apps or obeys the mute switch */\n-(void) setMode:(tAudioManagerMode) mode;\n/** Shuts down the shared audio manager instance so that it can be reinitialised */\n+(void) end;\n\n/** Call if you want to use built in resign behavior but need to do some additional audio processing on resign active. */\n- (void) applicationWillResignActive;\n/** Call if you want to use built in resign behavior but need to do some additional audio processing on become active. */\n- (void) applicationDidBecomeActive;\n\n//New AVAudioPlayer API\n/** Loads the data from the specified file path to the channel's audio source */\n-(CDLongAudioSource*) audioSourceLoad:(NSString*) filePath channel:(tAudioSourceChannel) channel;\n/** Retrieves the audio source for the specified channel */\n-(CDLongAudioSource*) audioSourceForChannel:(tAudioSourceChannel) channel;\n\n//Legacy AVAudioPlayer API\n/** Plays music in background. The music can be looped or not\n It is recommended to use .aac files as background music since they are decoded by the device (hardware).\n */\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop;\n/** Preloads a background music */\n-(void) preloadBackgroundMusic:(NSString*) filePath;\n/** Stops playing the background music */\n-(void) stopBackgroundMusic;\n/** Pauses the background music */\n-(void) pauseBackgroundMusic;\n/** Rewinds the background music */\n-(void) rewindBackgroundMusic;\n/** Resumes playing the background music */\n-(void) resumeBackgroundMusic;\n/** Returns whether or not the background music is playing */\n-(BOOL) isBackgroundMusicPlaying;\n\n-(void) setBackgroundMusicCompletionListener:(id) listener selector:(SEL) selector;\n\n@end\n\n/** Fader for long audio source objects */\n@interface CDLongAudioSourceFader : CDPropertyModifier{}\n@end\n\nstatic const int kCDNoBuffer = -1;\n\n/** Allows buffers to be associated with file names */\n@interface CDBufferManager:NSObject{\n    NSMutableDictionary* loadedBuffers;\n    NSMutableArray    *freedBuffers;\n    CDSoundEngine *soundEngine;\n    int nextBufferId;\n}\n\n-(id) initWithEngine:(CDSoundEngine *) theSoundEngine;\n-(int) bufferForFile:(NSString*) filePath create:(BOOL) create;\n-(void) releaseBufferForFile:(NSString *) filePath;\n\n@end\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CDAudioManager.m",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n\n#import \"CDAudioManager.h\"\n\nNSString * const kCDN_AudioManagerInitialised = @\"kCDN_AudioManagerInitialised\";\n\n//NSOperation object used to asynchronously initialise \n@implementation CDAsynchInitialiser\n\n-(void) main {\n    [super main];\n    [CDAudioManager sharedManager];\n}    \n\n@end\n\n@implementation CDLongAudioSource\n\n@synthesize audioSourcePlayer, audioSourceFilePath, delegate, backgroundMusic, paused;\n\n-(id) init {\n    if ((self = [super init])) {\n        state = kLAS_Init;\n        volume = 1.0f;\n        mute = NO;\n        enabled_ = YES;\n        paused = NO;\n    }\n    return self;\n}\n\n-(void) dealloc {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - deallocating %@\", self);\n    [audioSourcePlayer release];\n    [audioSourceFilePath release];\n    [super dealloc];\n}    \n\n-(void) load:(NSString*) filePath {\n    //We have alread loaded a file previously,  check if we are being asked to load the same file\n    if (state == kLAS_Init || ![filePath isEqualToString:audioSourceFilePath]) {\n        CDLOGINFO(@\"Denshion::CDLongAudioSource - Loading new audio source %@\",filePath);\n        //New file\n        if (state != kLAS_Init) {\n            [audioSourceFilePath release];//Release old file path\n            [audioSourcePlayer release];//Release old AVAudioPlayer, they can't be reused\n        }\n        audioSourceFilePath = [filePath copy];\n        NSError *error = nil;\n        NSString *path = [CDUtilities fullPathFromRelativePath:audioSourceFilePath];\n        audioSourcePlayer = [(AVAudioPlayer*)[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:&error];\n        if (error == nil) {\n            [audioSourcePlayer prepareToPlay];\n            audioSourcePlayer.delegate = self;\n            if (delegate && [delegate respondsToSelector:@selector(cdAudioSourceFileDidChange:)]) {\n                //Tell our delegate the file has changed\n                [delegate cdAudioSourceFileDidChange:self];\n            }    \n        } else {\n            CDLOG(@\"Denshion::CDLongAudioSource - Error initialising audio player: %@\",error);\n        }    \n    } else {\n        //Same file - just return it to a consistent state\n        [self pause];\n        [self rewind];\n    }\n    audioSourcePlayer.volume = volume;\n    audioSourcePlayer.numberOfLoops = numberOfLoops;\n    state = kLAS_Loaded;\n}    \n\n-(void) play {\n    if (enabled_) {\n        self->systemPaused = NO;\n        self->paused = NO;\n        [audioSourcePlayer play];\n    } else {\n        CDLOGINFO(@\"Denshion::CDLongAudioSource long audio source didn't play because it is disabled\");\n    }    \n}    \n\n-(void) stop {\n    self->paused = NO;\n    [audioSourcePlayer stop];\n}    \n\n-(void) pause {\n    self->paused = YES;\n    [audioSourcePlayer pause];\n}    \n\n-(void) rewind {\n    self->paused = NO;\n    [audioSourcePlayer setCurrentTime:0];\n}\n\n-(void) resume {\n    self->paused = NO;\n    [audioSourcePlayer play];\n}    \n\n-(BOOL) isPlaying {\n    if (state != kLAS_Init) {\n        return [audioSourcePlayer isPlaying];\n    } else {\n        return NO;\n    }\n}\n\n-(void) setVolume:(float) newVolume\n{\n    volume = newVolume;\n    if (state != kLAS_Init && !mute) {\n        audioSourcePlayer.volume = newVolume;\n    }    \n}\n\n-(float) volume \n{\n    return volume;\n}\n\n#pragma mark Audio Interrupt Protocol\n-(BOOL) mute\n{\n    return mute;\n}    \n\n-(void) setMute:(BOOL) muteValue \n{\n    if (mute != muteValue) {\n        if (mute) {\n            //Turn sound back on\n            audioSourcePlayer.volume = volume;\n        } else {\n            audioSourcePlayer.volume = 0.0f;\n        }\n        mute = muteValue;\n    }    \n}    \n\n-(BOOL) enabled \n{\n    return enabled_;\n}    \n\n-(void) setEnabled:(BOOL)enabledValue \n{\n    if (enabledValue != enabled_) {\n        enabled_ = enabledValue;\n        if (!enabled_) {\n            //\"Stop\" the sounds\n            [self pause];\n            [self rewind];\n        }    \n    }    \n}    \n\n-(NSInteger) numberOfLoops {\n    return numberOfLoops;\n}    \n\n-(void) setNumberOfLoops:(NSInteger) loopCount\n{\n    audioSourcePlayer.numberOfLoops = loopCount;\n    numberOfLoops = loopCount;\n}    \n\n- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - audio player finished\");\n#if TARGET_IPHONE_SIMULATOR    \n    CDLOGINFO(@\"Denshion::CDLongAudioSource - workaround for OpenAL clobbered audio issue\");\n    //This is a workaround for an issue in all simulators (tested to 3.1.2).  Problem is \n    //that OpenAL audio playback is clobbered when an AVAudioPlayer stops.  Workaround\n    //is to keep the player playing on an endless loop with 0 volume and then when\n    //it is played again reset the volume and set loop count appropriately.\n    //NB: this workaround is not foolproof but it is good enough for most situations.\n    player.numberOfLoops = -1;\n    player.volume = 0;\n    [player play];\n#endif    \n    if (delegate && [delegate respondsToSelector:@selector(cdAudioSourceDidFinishPlaying:)]) {\n        [delegate cdAudioSourceDidFinishPlaying:self];\n    }    \n}    \n\n-(void)audioPlayerBeginInterruption:(AVAudioPlayer *)player {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - audio player interrupted\");\n}\n\n-(void)audioPlayerEndInterruption:(AVAudioPlayer *)player {\n    CDLOGINFO(@\"Denshion::CDLongAudioSource - audio player resumed\");\n    if (self.backgroundMusic) {\n        //Check if background music can play as rules may have changed during \n        //the interruption. This is to address a specific issue in 4.x when\n        //fast task switching\n        if([CDAudioManager sharedManager].willPlayBackgroundMusic) {\n            [player play];\n        }    \n    } else {\n        [player play];\n    }    \n}    \n\n@end\n\n\n@interface CDAudioManager (PrivateMethods)\n-(BOOL) audioSessionSetActive:(BOOL) active;\n-(BOOL) audioSessionSetCategory:(NSString*) category;\n-(void) badAlContextHandler;\n@end\n\n\n@implementation CDAudioManager\n#define BACKGROUND_MUSIC_CHANNEL kASC_Left\n\n@synthesize soundEngine, willPlayBackgroundMusic;\nstatic CDAudioManager *sharedManager;\nstatic tAudioManagerState _sharedManagerState = kAMStateUninitialised;\nstatic tAudioManagerMode configuredMode;\nstatic BOOL configured = FALSE;\n\n-(BOOL) audioSessionSetActive:(BOOL) active {\n    NSError *activationError = nil;\n    if ([[AVAudioSession sharedInstance] setActive:active error:&activationError]) {\n        _audioSessionActive = active;\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session set active %i succeeded\", active); \n        return YES;\n    } else {\n        //Failed\n        CDLOG(@\"Denshion::CDAudioManager - Audio session set active %i failed with error %@\", active, activationError); \n        return NO;\n    }    \n}    \n\n-(BOOL) audioSessionSetCategory:(NSString*) category {\n    NSError *categoryError = nil;\n    if ([[AVAudioSession sharedInstance] setCategory:category error:&categoryError]) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session set category %@ succeeded\", category); \n        return YES;\n    } else {\n        //Failed\n        CDLOG(@\"Denshion::CDAudioManager - Audio session set category %@ failed with error %@\", category, categoryError); \n        return NO;\n    }    \n}    \n\n// Init\n+ (CDAudioManager *) sharedManager\n{\n    @synchronized(self)     {\n        if (!sharedManager) {\n            if (!configured) {\n                //Set defaults here\n                configuredMode = kAMM_FxPlusMusicIfNoOtherAudio;\n            }\n            sharedManager = [[CDAudioManager alloc] init:configuredMode];\n            _sharedManagerState = kAMStateInitialised;//This is only really relevant when using asynchronous initialisation\n            [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_AudioManagerInitialised object:nil];\n        }    \n    }\n    return sharedManager;\n}\n\n+ (tAudioManagerState) sharedManagerState {\n    return _sharedManagerState;\n}    \n\n/**\n * Call this to set up audio manager asynchronously.  Initialisation is finished when sharedManagerState == kAMStateInitialised\n */\n+ (void) initAsynchronously: (tAudioManagerMode) mode {\n    @synchronized(self) {\n        if (_sharedManagerState == kAMStateUninitialised) {\n            _sharedManagerState = kAMStateInitialising;\n            [CDAudioManager configure:mode];\n            CDAsynchInitialiser *initOp = [[[CDAsynchInitialiser alloc] init] autorelease];\n            NSOperationQueue *opQ = [[[NSOperationQueue alloc] init] autorelease];\n            [opQ addOperation:initOp];\n        }    \n    }\n}    \n\n+ (id) alloc\n{\n    @synchronized(self)     {\n        NSAssert(sharedManager == nil, @\"Attempted to allocate a second instance of a singleton.\");\n        return [super alloc];\n    }\n    return nil;\n}\n\n/*\n * Call this method before accessing the shared manager in order to configure the shared audio manager\n */\n+ (void) configure: (tAudioManagerMode) mode {\n    configuredMode = mode;\n    configured = TRUE;\n}    \n\n-(BOOL) isOtherAudioPlaying {\n    UInt32 isPlaying = 0;\n    UInt32 varSize = sizeof(isPlaying);\n    AudioSessionGetProperty (kAudioSessionProperty_OtherAudioIsPlaying, &varSize, &isPlaying);\n    return (isPlaying != 0);\n}\n\n-(void) setMode:(tAudioManagerMode) mode {\n\n    _mode = mode;\n    switch (_mode) {\n            \n        case kAMM_FxOnly:\n            //Share audio with other app\n            CDLOGINFO(@\"Denshion::CDAudioManager - Audio will be shared\");\n            //_audioSessionCategory = kAudioSessionCategory_AmbientSound;\n            _audioSessionCategory = AVAudioSessionCategoryAmbient;\n            willPlayBackgroundMusic = NO;\n            break;\n            \n        case kAMM_FxPlusMusic:\n            //Use audio exclusively - if other audio is playing it will be stopped\n            CDLOGINFO(@\"Denshion::CDAudioManager -  Audio will be exclusive\");\n            //_audioSessionCategory = kAudioSessionCategory_SoloAmbientSound;\n            _audioSessionCategory = AVAudioSessionCategorySoloAmbient;\n            willPlayBackgroundMusic = YES;\n            break;\n            \n        case kAMM_MediaPlayback:\n            //Use audio exclusively, ignore mute switch and sleep\n            CDLOGINFO(@\"Denshion::CDAudioManager -  Media playback mode, audio will be exclusive\");\n            //_audioSessionCategory = kAudioSessionCategory_MediaPlayback;\n            _audioSessionCategory = AVAudioSessionCategoryPlayback;\n            willPlayBackgroundMusic = YES;\n            break;\n            \n        case kAMM_PlayAndRecord:\n            //Use audio exclusively, ignore mute switch and sleep, has inputs and outputs\n            CDLOGINFO(@\"Denshion::CDAudioManager -  Play and record mode, audio will be exclusive\");\n            //_audioSessionCategory = kAudioSessionCategory_PlayAndRecord;\n            _audioSessionCategory = AVAudioSessionCategoryPlayAndRecord;\n            willPlayBackgroundMusic = YES;\n            break;\n            \n        default:\n            //kAudioManagerFxPlusMusicIfNoOtherAudio\n            if ([self isOtherAudioPlaying]) {\n                CDLOGINFO(@\"Denshion::CDAudioManager - Other audio is playing audio will be shared\");\n                //_audioSessionCategory = kAudioSessionCategory_AmbientSound;\n                _audioSessionCategory = AVAudioSessionCategoryAmbient;\n                willPlayBackgroundMusic = NO;\n            } else {\n                CDLOGINFO(@\"Denshion::CDAudioManager - Other audio is not playing audio will be exclusive\");\n                //_audioSessionCategory = kAudioSessionCategory_SoloAmbientSound;\n                _audioSessionCategory = AVAudioSessionCategorySoloAmbient;\n                willPlayBackgroundMusic = YES;\n            }    \n            \n            break;\n    }\n     \n    [self audioSessionSetCategory:_audioSessionCategory];\n    \n}    \n\n/**\n * This method is used to work around various bugs introduced in 4.x OS versions. In some circumstances the \n * audio session is interrupted but never resumed, this results in the loss of OpenAL audio when following \n * standard practices. If we detect this situation then we will attempt to resume the audio session ourselves.\n * Known triggers: lock the device then unlock it (iOS 4.2 gm), playback a song using MPMediaPlayer (iOS 4.0)\n */\n- (void) badAlContextHandler {\n    if (_interrupted && alcGetCurrentContext() == NULL) {\n        CDLOG(@\"Denshion::CDAudioManager - bad OpenAL context detected, attempting to resume audio session\");\n        [self audioSessionResumed];\n    }    \n}    \n\n- (id) init: (tAudioManagerMode) mode {\n    if ((self = [super init])) {\n        \n        //Initialise the audio session \n        AVAudioSession* session = [AVAudioSession sharedInstance];\n        session.delegate = self;\n    \n        _mode = mode;\n        backgroundMusicCompletionSelector = nil;\n        _isObservingAppEvents = FALSE;\n        _mute = NO;\n        _resigned = NO;\n        _interrupted = NO;\n        enabled_ = YES;\n        _audioSessionActive = NO;\n        [self setMode:mode];\n        soundEngine = [[CDSoundEngine alloc] init];\n        \n        //Set up audioSource channels\n        audioSourceChannels = [[NSMutableArray alloc] init];\n        CDLongAudioSource *leftChannel = [[CDLongAudioSource alloc] init];\n        leftChannel.backgroundMusic = YES;\n        CDLongAudioSource *rightChannel = [[CDLongAudioSource alloc] init];\n        rightChannel.backgroundMusic = NO;\n        [audioSourceChannels insertObject:leftChannel atIndex:kASC_Left];    \n        [audioSourceChannels insertObject:rightChannel atIndex:kASC_Right];\n        [leftChannel release];\n        [rightChannel release];\n        //Used to support legacy APIs\n        backgroundMusic = [self audioSourceForChannel:BACKGROUND_MUSIC_CHANNEL];\n        backgroundMusic.delegate = self;\n        \n        //Add handler for bad al context messages, these are posted by the sound engine.\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(badAlContextHandler) name:kCDN_BadAlContext object:nil];\n\n    }    \n    return self;        \n}    \n\n-(void) dealloc {\n    CDLOGINFO(@\"Denshion::CDAudioManager - deallocating\");\n    [self stopBackgroundMusic];\n    [soundEngine release];\n    [[NSNotificationCenter defaultCenter] removeObserver:self];\n    [self audioSessionSetActive:NO];\n    [audioSourceChannels release];\n    [super dealloc];\n}    \n\n/** Retrieves the audio source for the specified channel */\n-(CDLongAudioSource*) audioSourceForChannel:(tAudioSourceChannel) channel \n{\n    return (CDLongAudioSource*)[audioSourceChannels objectAtIndex:channel];\n}    \n\n/** Loads the data from the specified file path to the channel's audio source */\n-(CDLongAudioSource*) audioSourceLoad:(NSString*) filePath channel:(tAudioSourceChannel) channel\n{\n    CDLongAudioSource *audioSource = [self audioSourceForChannel:channel];\n    if (audioSource) {\n        [audioSource load:filePath];\n    }\n    return audioSource;\n}    \n\n-(BOOL) isBackgroundMusicPlaying {\n    return [self.backgroundMusic isPlaying];\n}    \n\n//NB: originally I tried using a route change listener and intended to store the current route,\n//however, on a 3gs running 3.1.2 no route change is generated when the user switches the \n//ringer mute switch to off (i.e. enables sound) therefore polling is the only reliable way to\n//determine ringer switch state\n-(BOOL) isDeviceMuted {\n\n#if TARGET_IPHONE_SIMULATOR\n    //Calling audio route stuff on the simulator causes problems\n    return NO;\n#else    \n    CFStringRef newAudioRoute;\n    UInt32 propertySize = sizeof (CFStringRef);\n    \n    AudioSessionGetProperty (\n                             kAudioSessionProperty_AudioRoute,\n                             &propertySize,\n                             &newAudioRoute\n                             );\n    \n    if (newAudioRoute == NULL) {\n        //Don't expect this to happen but playing safe otherwise a null in the CFStringCompare will cause a crash\n        return YES;\n    } else {    \n        CFComparisonResult newDeviceIsMuted =    CFStringCompare (\n                                                                 newAudioRoute,\n                                                                 (CFStringRef) @\"\",\n                                                                 0\n                                                                 );\n        \n        return (newDeviceIsMuted == kCFCompareEqualTo);\n    }    \n#endif\n}    \n\n#pragma mark Audio Interrupt Protocol\n\n-(BOOL) mute {\n    return _mute;\n}    \n\n-(void) setMute:(BOOL) muteValue {\n    if (muteValue != _mute) {\n        _mute = muteValue;\n        [soundEngine setMute:muteValue];\n        for( CDLongAudioSource *audioSource in audioSourceChannels) {\n            audioSource.mute = muteValue;\n        }    \n    }    \n}\n\n-(BOOL) enabled {\n    return enabled_;\n}    \n\n-(void) setEnabled:(BOOL) enabledValue {\n    if (enabledValue != enabled_) {\n        enabled_ = enabledValue;\n        [soundEngine setEnabled:enabled_];\n        for( CDLongAudioSource *audioSource in audioSourceChannels) {\n            audioSource.enabled = enabled_;\n        }    \n    }    \n}\n\n-(CDLongAudioSource*) backgroundMusic\n{\n    return backgroundMusic;\n}    \n\n//Load background music ready for playing\n-(void) preloadBackgroundMusic:(NSString*) filePath\n{\n    [self.backgroundMusic load:filePath];    \n}    \n\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop\n{\n    [self.backgroundMusic load:filePath];\n\n\tif (loop) {\n\t\t[self.backgroundMusic setNumberOfLoops:-1];\n\t} else {\n\t\t[self.backgroundMusic setNumberOfLoops:0];\n\t}\n\n\tif (!willPlayBackgroundMusic || _mute) {\n\t\tCDLOGINFO(@\"Denshion::CDAudioManager - play bgm aborted because audio is not exclusive or sound is muted\");\n\t\treturn;\n\t}\n\n\t[self.backgroundMusic play];\n}\n\n-(void) stopBackgroundMusic\n{\n    [self.backgroundMusic stop];\n}\n\n-(void) pauseBackgroundMusic\n{\n    [self.backgroundMusic pause];\n}    \n\n-(void) resumeBackgroundMusic\n{\n    if (!willPlayBackgroundMusic || _mute) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - resume bgm aborted because audio is not exclusive or sound is muted\");\n        return;\n    }\n    \n    if (![self.backgroundMusic paused]) {\n        return;\n    }\n    \n    [self.backgroundMusic resume];\n}    \n\n-(void) rewindBackgroundMusic\n{\n    [self.backgroundMusic rewind];\n}    \n\n-(void) setBackgroundMusicCompletionListener:(id) listener selector:(SEL) selector {\n    backgroundMusicCompletionListener = listener;\n    backgroundMusicCompletionSelector = selector;\n}    \n\n/*\n * Call this method to have the audio manager automatically handle application resign and\n * become active.  Pass a tAudioManagerResignBehavior to indicate the desired behavior\n * for resigning and becoming active again.\n *\n * If autohandle is YES then the applicationWillResignActive and applicationDidBecomActive \n * methods are automatically called, otherwise you must call them yourself at the appropriate time.\n *\n * Based on idea of Dominique Bongard\n */\n-(void) setResignBehavior:(tAudioManagerResignBehavior) resignBehavior autoHandle:(BOOL) autoHandle { \n\n    if (!_isObservingAppEvents && autoHandle) {\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(applicationWillResignActive:) name:@\"UIApplicationWillResignActiveNotification\" object:nil];\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(applicationDidBecomeActive:) name:@\"UIApplicationDidBecomeActiveNotification\" object:nil];\n        [[NSNotificationCenter defaultCenter] addObserver:self    selector:@selector(applicationWillTerminate:) name:@\"UIApplicationWillTerminateNotification\" object:nil];\n        _isObservingAppEvents = TRUE;\n    }\n    _resignBehavior = resignBehavior;\n}    \n\n- (void) applicationWillResignActive {\n    self->_resigned = YES;\n    \n    //Set the audio sesssion to one that allows sharing so that other audio won't be clobbered on resume\n    [self audioSessionSetCategory:AVAudioSessionCategoryAmbient];\n    \n    switch (_resignBehavior) {\n            \n        case kAMRBStopPlay:\n            \n            for( CDLongAudioSource *audioSource in audioSourceChannels) {\n                if (audioSource.isPlaying) {\n                    audioSource->systemPaused = YES;\n                    audioSource->systemPauseLocation = audioSource.audioSourcePlayer.currentTime;\n                    [audioSource stop];\n                } else {\n                    //Music is either paused or stopped, if it is paused it will be restarted\n                    //by OS so we will stop it.\n                    audioSource->systemPaused = NO;\n                    [audioSource stop];\n                }\n            }\n            break;\n            \n        case kAMRBStop:\n            //Stop music regardless of whether it is playing or not because if it was paused\n            //then the OS would resume it\n            for( CDLongAudioSource *audioSource in audioSourceChannels) {\n                [audioSource stop];\n            }    \n            \n        default:\n            break;\n            \n    }            \n    CDLOGINFO(@\"Denshion::CDAudioManager - handled resign active\");\n}\n\n//Called when application resigns active only if setResignBehavior has been called\n- (void) applicationWillResignActive:(NSNotification *) notification\n{\n    [self applicationWillResignActive];\n}    \n\n- (void) applicationDidBecomeActive {\n    \n    if (self->_resigned) {\n        _resigned = NO;\n        //Reset the mode incase something changed with audio while we were inactive\n        [self setMode:_mode];\n        switch (_resignBehavior) {\n                \n            case kAMRBStopPlay:\n                \n                //Music had been stopped but stop maintains current time\n                //so playing again will continue from where music was before resign active.\n                //We check if music can be played because while we were inactive the user might have\n                //done something that should force music to not play such as starting a track in the iPod\n                if (self.willPlayBackgroundMusic) {\n                    for( CDLongAudioSource *audioSource in audioSourceChannels) {\n                        if (audioSource->systemPaused) {\n                            [audioSource resume];\n                            audioSource->systemPaused = NO;\n                        }\n                    }\n                }\n                break;\n                \n            default:\n                break;\n                \n        }\n        CDLOGINFO(@\"Denshion::CDAudioManager - audio manager handled become active\");\n    }\n}\n\n//Called when application becomes active only if setResignBehavior has been called\n- (void) applicationDidBecomeActive:(NSNotification *) notification\n{\n    [self applicationDidBecomeActive];\n}\n\n//Called when application terminates only if setResignBehavior has been called \n- (void) applicationWillTerminate:(NSNotification *) notification\n{\n    CDLOGINFO(@\"Denshion::CDAudioManager - audio manager handling terminate\");\n    [self stopBackgroundMusic];\n}\n\n/** The audio source completed playing */\n- (void) cdAudioSourceDidFinishPlaying:(CDLongAudioSource *) audioSource {\n    CDLOGINFO(@\"Denshion::CDAudioManager - audio manager got told background music finished\");\n    if (backgroundMusicCompletionSelector != nil) {\n        [backgroundMusicCompletionListener performSelector:backgroundMusicCompletionSelector];\n    }    \n}    \n\n-(void) beginInterruption {\n    CDLOGINFO(@\"Denshion::CDAudioManager - begin interruption\");\n    [self audioSessionInterrupted];\n}\n\n-(void) endInterruption {\n    CDLOGINFO(@\"Denshion::CDAudioManager - end interruption\");\n    [self audioSessionResumed];\n}\n\n#if __CC_PLATFORM_IOS >= 40000\n-(void) endInterruptionWithFlags:(NSUInteger)flags {\n    CDLOGINFO(@\"Denshion::CDAudioManager - interruption ended with flags %i\",flags);\n    if (flags == AVAudioSessionInterruptionFlags_ShouldResume) {\n        [self audioSessionResumed];\n    }    \n}\n#endif\n\n-(void)audioSessionInterrupted \n{ \n    if (!_interrupted) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session interrupted\"); \n        _interrupted = YES;\n\n        // Deactivate the current audio session \n        [self audioSessionSetActive:NO];\n        \n        if (alcGetCurrentContext() != NULL) {\n            CDLOGINFO(@\"Denshion::CDAudioManager - Setting OpenAL context to NULL\"); \n\n            ALenum  error = AL_NO_ERROR;\n\n            // set the current context to NULL will 'shutdown' openAL \n            alcMakeContextCurrent(NULL); \n        \n            if((error = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDAudioManager - Error making context current %x\\n\", error);\n            } \n            #pragma unused(error)\n        }\n    }    \n} \n\n-(void)audioSessionResumed \n{ \n    if (_interrupted) {\n        CDLOGINFO(@\"Denshion::CDAudioManager - Audio session resumed\"); \n        _interrupted = NO;\n        \n        BOOL activationResult = NO;\n        // Reactivate the current audio session\n        activationResult = [self audioSessionSetActive:YES]; \n        \n        //This code is to handle a problem with iOS 4.0 and 4.01 where reactivating the session can fail if\n        //task switching is performed too rapidly. A test case that reliably reproduces the issue is to call the\n        //iPhone and then hang up after two rings (timing may vary ;))\n        //Basically we keep waiting and trying to let the OS catch up with itself but the number of tries is\n        //limited.\n        if (!activationResult) {\n            CDLOG(@\"Denshion::CDAudioManager - Failure reactivating audio session, will try wait-try cycle\"); \n            int activateCount = 0;\n            while (!activationResult && activateCount < 10) {\n                [NSThread sleepForTimeInterval:0.5];\n                activationResult = [self audioSessionSetActive:YES]; \n                activateCount++;\n                CDLOGINFO(@\"Denshion::CDAudioManager - Reactivation attempt %i status = %i\",activateCount,activationResult); \n            }    \n        }\n        \n        if (alcGetCurrentContext() == NULL) {\n            CDLOGINFO(@\"Denshion::CDAudioManager - Restoring OpenAL context\"); \n            ALenum  error = AL_NO_ERROR;\n            // Restore open al context \n            alcMakeContextCurrent([soundEngine openALContext]); \n            if((error = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDAudioManager - Error making context current%x\\n\", error);\n            } \n            #pragma unused(error)\n        }    \n    }    \n}\n\n+(void) end {\n    [sharedManager release];\n    sharedManager = nil;\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n@implementation CDLongAudioSourceFader\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDLongAudioSource*)target).volume = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDLongAudioSource*)target).volume;\n}\n\n-(void) _stopTarget {\n    //Pause instead of stop as stop releases resources and causes problems in the simulator\n    [((CDLongAudioSource*)target) pause];\n}\n\n-(Class) _allowableType {\n    return [CDLongAudioSource class];\n}    \n\n@end\n///////////////////////////////////////////////////////////////////////////////////////\n@implementation CDBufferManager\n\n-(id) initWithEngine:(CDSoundEngine *) theSoundEngine {\n    if ((self = [super init])) {\n        soundEngine = theSoundEngine;\n        loadedBuffers = [[NSMutableDictionary alloc] initWithCapacity:CD_BUFFERS_START];\n        freedBuffers = [[NSMutableArray alloc] init];\n        nextBufferId = 0;\n    }    \n    return self;\n}    \n\n-(void) dealloc {\n    [loadedBuffers release];\n    [freedBuffers release];\n    [super dealloc];\n}    \n\n-(int) bufferForFile:(NSString*) filePath create:(BOOL) create {\n    \n    NSNumber* soundId = (NSNumber*)[loadedBuffers objectForKey:filePath];\n    if(soundId == nil)\n    {\n        if (create) {\n            NSNumber* bufferId = nil;\n            //First try to get a buffer from the free buffers\n            if ([freedBuffers count] > 0) {\n                bufferId = [[[freedBuffers lastObject] retain] autorelease];\n                [freedBuffers removeLastObject]; \n                CDLOGINFO(@\"Denshion::CDBufferManager reusing buffer id %i\",[bufferId intValue]);\n            } else {\n                bufferId = [[NSNumber alloc] initWithInt:nextBufferId];\n                [bufferId autorelease];\n                CDLOGINFO(@\"Denshion::CDBufferManager generating new buffer id %i\",[bufferId intValue]);\n                nextBufferId++;\n            }\n            \n            if ([soundEngine loadBuffer:[bufferId intValue] filePath:filePath]) {\n                //File successfully loaded\n                CDLOGINFO(@\"Denshion::CDBufferManager buffer loaded %@ %@\",bufferId,filePath);\n                [loadedBuffers setObject:bufferId forKey:filePath];\n                return [bufferId intValue];\n            } else {\n                //File didn't load, put buffer id on free list\n                [freedBuffers addObject:bufferId];\n                return kCDNoBuffer;\n            }    \n        } else {\n            //No matching buffer was found\n            return kCDNoBuffer;\n        }    \n    } else {\n        return [soundId intValue];\n    }    \n}    \n\n-(void) releaseBufferForFile:(NSString *) filePath {\n    int bufferId = [self bufferForFile:filePath create:NO];\n    if (bufferId != kCDNoBuffer) {\n        [soundEngine unloadBuffer:bufferId];\n        [loadedBuffers removeObjectForKey:filePath];\n        NSNumber *freedBufferId = [[NSNumber alloc] initWithInt:bufferId];\n        [freedBufferId autorelease];\n        [freedBuffers addObject:freedBufferId];\n    }    \n}    \n@end\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CDConfig.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n#define COCOSDENSHION_VERSION \"Aphex.rc\"\n\n\n/**\n If enabled code useful for debugging such as parameter check assertions will be performed.\n If you experience any problems you should enable this and test your code with a debug build.\n */\n//#define CD_DEBUG 1\n\n/**\n The total number of sounds/buffers that can be loaded assuming memory is sufficient\n */\n//Number of buffers slots that will be initially created\n#define CD_BUFFERS_START 64\n//Number of buffers that will be added \n#define CD_BUFFERS_INCREMENT 16\n\n/**\n If enabled, OpenAL code will use static buffers. When static buffers are used the audio\n data is managed outside of OpenAL, this eliminates a memcpy operation which leads to \n higher performance when loading sounds.\n \n However, the downside is that when the audio data is freed you must\n be certain that it is no longer being accessed otherwise your app will crash. Testing on OS 2.2.1\n and 3.1.2 has shown that this may occur if a buffer is being used by a source with state = AL_PLAYING\n when the buffer is deleted. If the data is freed too quickly after the source is stopped then\n a crash will occur. The implemented workaround is that when static buffers are used the unloadBuffer code will wait for\n any playing sources to finish playing before the associated buffer and data are deleted, however, this delay may negate any \n performance gains that are achieved during loading.\n \n Performance tests on a 1st gen iPod running OS 2.2.1 loading the CocosDenshionDemo sounds were ~0.14 seconds without\n static buffers and ~0.12 seconds when using static buffers.\n\n */\n//#define CD_USE_STATIC_BUFFERS 1\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CDOpenALSupport.h",
    "content": "/*\n \n Disclaimer: IMPORTANT:  This Apple software is supplied to you by\n Apple Inc. (\"Apple\") in consideration of your agreement to the\n following terms, and your use, installation, modification or\n redistribution of this Apple software constitutes acceptance of these\n terms.  If you do not agree with these terms, please do not use,\n install, modify or redistribute this Apple software.\n \n In consideration of your agreement to abide by the following terms, and\n subject to these terms, Apple grants you a personal, non-exclusive\n license, under Apple's copyrights in this original Apple software (the\n \"Apple Software\"), to use, reproduce, modify and redistribute the Apple\n Software, with or without modifications, in source and/or binary forms;\n provided that if you redistribute the Apple Software in its entirety and\n without modifications, you must retain this notice and the following\n text and disclaimers in all such redistributions of the Apple Software.\n Neither the name, trademarks, service marks or logos of Apple Inc.\n may be used to endorse or promote products derived from the Apple\n Software without specific prior written permission from Apple.  Except\n as expressly stated in this notice, no other rights or licenses, express\n or implied, are granted by Apple herein, including but not limited to\n any patent rights that may be infringed by your derivative works or by\n other works in which the Apple Software may be incorporated.\n \n The Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE\n MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION\n THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS\n FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND\n OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\n \n IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,\n MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED\n AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),\n STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n \n Copyright (C) 2009 Apple Inc. All Rights Reserved.\n \n $Id$\n */\n\n/*\n This file contains code from version 1.1 and 1.4 of MyOpenALSupport.h taken from Apple's oalTouch version.\n The 1.4 version code is used for loading IMA4 files, however, this code causes very noticeable clicking\n when used to load wave files that are looped so the 1.1 version code is used specifically for loading\n wav files.\n */\n\n#ifndef __CD_OPENAL_H\n#define __CD_OPENAL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif    \n    \n\n#import <OpenAL/al.h>\n#import <OpenAL/alc.h>\n#import <CoreFoundation/CFURL.h>\n\n\n//Taken from oalTouch MyOpenALSupport 1.1\nvoid* CDloadWaveAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei*    outSampleRate);\nvoid* CDloadCafAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate);\nvoid* CDGetOpenALAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate);\n    \n#ifdef __cplusplus\n}\n#endif\n\n#endif \n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CDOpenALSupport.m",
    "content": "/*\n \n Disclaimer: IMPORTANT:  This Apple software is supplied to you by\n Apple Inc. (\"Apple\") in consideration of your agreement to the\n following terms, and your use, installation, modification or\n redistribution of this Apple software constitutes acceptance of these\n terms.  If you do not agree with these terms, please do not use,\n install, modify or redistribute this Apple software.\n \n In consideration of your agreement to abide by the following terms, and\n subject to these terms, Apple grants you a personal, non-exclusive\n license, under Apple's copyrights in this original Apple software (the\n \"Apple Software\"), to use, reproduce, modify and redistribute the Apple\n Software, with or without modifications, in source and/or binary forms;\n provided that if you redistribute the Apple Software in its entirety and\n without modifications, you must retain this notice and the following\n text and disclaimers in all such redistributions of the Apple Software.\n Neither the name, trademarks, service marks or logos of Apple Inc.\n may be used to endorse or promote products derived from the Apple\n Software without specific prior written permission from Apple.  Except\n as expressly stated in this notice, no other rights or licenses, express\n or implied, are granted by Apple herein, including but not limited to\n any patent rights that may be infringed by your derivative works or by\n other works in which the Apple Software may be incorporated.\n \n The Apple Software is provided by Apple on an \"AS IS\" basis.  APPLE\n MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION\n THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS\n FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND\n OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\n \n IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,\n MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED\n AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),\n STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n \n Copyright (C) 2009 Apple Inc. All Rights Reserved.\n \n $Id: CDOpenALSupport.h 16 2010-03-11 06:22:10Z steveoldmeadow $\n */\n\n#import \"CDOpenALSupport.h\"\n#import \"CocosDenshion.h\"\n#import <AudioToolbox/AudioToolbox.h>\n#import <AudioToolbox/ExtendedAudioFile.h>\n\n//Taken from oalTouch MyOpenALSupport 1.1\nvoid* CDloadWaveAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei*    outSampleRate)\n{\n    OSStatus                        err = noErr;    \n    UInt64                            fileDataSize = 0;\n    AudioStreamBasicDescription        theFileFormat;\n    UInt32                            thePropertySize = sizeof(theFileFormat);\n    AudioFileID                        afid = 0;\n    void*                            theData = NULL;\n    \n    // Open a file with ExtAudioFileOpen()\n    err = AudioFileOpenURL(inFileURL, kAudioFileReadPermission, 0, &afid);\n    if(err) { CDLOG(@\"MyGetOpenALAudioData: AudioFileOpenURL FAILED, Error = %ld\\n\", err); goto Exit; }\n    \n    // Get the audio data format\n    err = AudioFileGetProperty(afid, kAudioFilePropertyDataFormat, &thePropertySize, &theFileFormat);\n    if(err) { CDLOG(@\"MyGetOpenALAudioData: AudioFileGetProperty(kAudioFileProperty_DataFormat) FAILED, Error = %ld\\n\", err); goto Exit; }\n    \n    if (theFileFormat.mChannelsPerFrame > 2)  { \n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, channel count is greater than stereo\\n\"); goto Exit;\n    }\n    \n    if ((theFileFormat.mFormatID != kAudioFormatLinearPCM) || (!TestAudioFormatNativeEndian(theFileFormat))) { \n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, must be little-endian PCM\\n\"); goto Exit;\n    }\n    \n    if ((theFileFormat.mBitsPerChannel != 8) && (theFileFormat.mBitsPerChannel != 16)) { \n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, must be 8 or 16 bit PCM\\n\"); goto Exit;\n    }\n    \n    \n    thePropertySize = sizeof(fileDataSize);\n    err = AudioFileGetProperty(afid, kAudioFilePropertyAudioDataByteCount, &thePropertySize, &fileDataSize);\n    if(err) { CDLOG(@\"MyGetOpenALAudioData: AudioFileGetProperty(kAudioFilePropertyAudioDataByteCount) FAILED, Error = %ld\\n\", err); goto Exit; }\n    \n    // Read all the data into memory\n    UInt32        dataSize = (UInt32)fileDataSize;\n    theData = malloc(dataSize);\n    if (theData)\n    {\n        memset(theData, 0, dataSize);\n        AudioFileReadBytes(afid, false, 0, &dataSize, theData);\n        if(err == noErr)\n        {\n            // success\n            *outDataSize = (ALsizei)dataSize;\n            //This fix was added by me, however, 8 bit sounds have a clipping sound at the end so aren't really usable (SO)\n            if (theFileFormat.mBitsPerChannel == 16) { \n                *outDataFormat = (theFileFormat.mChannelsPerFrame > 1) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;\n            } else {\n                *outDataFormat = (theFileFormat.mChannelsPerFrame > 1) ? AL_FORMAT_STEREO8 : AL_FORMAT_MONO8;    \n            }    \n            *outSampleRate = (ALsizei)theFileFormat.mSampleRate;\n        }\n        else \n        { \n            // failure\n            free (theData);\n            theData = NULL; // make sure to return NULL\n            CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileRead FAILED, Error = %ld\\n\", err); goto Exit;\n        }    \n    }\n    \nExit:\n    // Dispose the ExtAudioFileRef, it is no longer needed\n    if (afid) AudioFileClose(afid);\n    return theData;\n}\n\n//Taken from oalTouch MyOpenALSupport 1.4\nvoid* CDloadCafAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate)\n{\n    OSStatus                        status = noErr;\n    BOOL                            abort = NO;\n    SInt64                            theFileLengthInFrames = 0;\n    AudioStreamBasicDescription        theFileFormat;\n    UInt32                            thePropertySize = sizeof(theFileFormat);\n    ExtAudioFileRef                    extRef = NULL;\n    void*                            theData = NULL;\n    AudioStreamBasicDescription        theOutputFormat;\n    UInt32                            dataSize = 0;\n    \n    // Open a file with ExtAudioFileOpen()\n    status = ExtAudioFileOpenURL(inFileURL, &extRef);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileOpenURL FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Get the audio data format\n    status = ExtAudioFileGetProperty(extRef, kExtAudioFileProperty_FileDataFormat, &thePropertySize, &theFileFormat);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileGetProperty(kExtAudioFileProperty_FileDataFormat) FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    if (theFileFormat.mChannelsPerFrame > 2)\n    {\n        CDLOG(@\"MyGetOpenALAudioData - Unsupported Format, channel count is greater than stereo\\n\");\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Set the client format to 16 bit signed integer (native-endian) data\n    // Maintain the channel count and sample rate of the original source format\n    theOutputFormat.mSampleRate = theFileFormat.mSampleRate;\n    theOutputFormat.mChannelsPerFrame = theFileFormat.mChannelsPerFrame;\n    \n    theOutputFormat.mFormatID = kAudioFormatLinearPCM;\n    theOutputFormat.mBytesPerPacket = 2 * theOutputFormat.mChannelsPerFrame;\n    theOutputFormat.mFramesPerPacket = 1;\n    theOutputFormat.mBytesPerFrame = 2 * theOutputFormat.mChannelsPerFrame;\n    theOutputFormat.mBitsPerChannel = 16;\n    theOutputFormat.mFormatFlags = kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger;\n    \n    // Set the desired client (output) data format\n    status = ExtAudioFileSetProperty(extRef, kExtAudioFileProperty_ClientDataFormat, sizeof(theOutputFormat), &theOutputFormat);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileSetProperty(kExtAudioFileProperty_ClientDataFormat) FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Get the total frame count\n    thePropertySize = sizeof(theFileLengthInFrames);\n    status = ExtAudioFileGetProperty(extRef, kExtAudioFileProperty_FileLengthFrames, &thePropertySize, &theFileLengthInFrames);\n    if (status != noErr)\n    {\n        CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileGetProperty(kExtAudioFileProperty_FileLengthFrames) FAILED, Error = %ld\\n\", status);\n        abort = YES;\n    }\n    if (abort)\n        goto Exit;\n    \n    // Read all the data into memory\n    dataSize = (UInt32) theFileLengthInFrames * theOutputFormat.mBytesPerFrame;\n    theData = malloc(dataSize);\n    if (theData)\n    {\n        memset(theData, 0, dataSize);\n        AudioBufferList        theDataBuffer;\n        theDataBuffer.mNumberBuffers = 1;\n        theDataBuffer.mBuffers[0].mDataByteSize = dataSize;\n        theDataBuffer.mBuffers[0].mNumberChannels = theOutputFormat.mChannelsPerFrame;\n        theDataBuffer.mBuffers[0].mData = theData;\n        \n        // Read the data into an AudioBufferList\n        status = ExtAudioFileRead(extRef, (UInt32*)&theFileLengthInFrames, &theDataBuffer);\n        if(status == noErr)\n        {\n            // success\n            *outDataSize = (ALsizei)dataSize;\n            *outDataFormat = (theOutputFormat.mChannelsPerFrame > 1) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;\n            *outSampleRate = (ALsizei)theOutputFormat.mSampleRate;\n        }\n        else\n        {\n            // failure\n            free (theData);\n            theData = NULL; // make sure to return NULL\n            CDLOG(@\"MyGetOpenALAudioData: ExtAudioFileRead FAILED, Error = %ld\\n\", status);\n            abort = YES;\n        }\n    }\n    if (abort)\n        goto Exit;\n    \nExit:\n    // Dispose the ExtAudioFileRef, it is no longer needed\n    if (extRef) ExtAudioFileDispose(extRef);\n    return theData;\n}\n\nvoid* CDGetOpenALAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei*    outSampleRate) {\n    \n    CFStringRef extension = CFURLCopyPathExtension(inFileURL);\n    CFComparisonResult isWavFile = 0;\n    if (extension != NULL) {\n        isWavFile = CFStringCompare (extension,(CFStringRef)@\"wav\", kCFCompareCaseInsensitive);\n        CFRelease(extension);\n    }    \n    \n    if (isWavFile == kCFCompareEqualTo) {\n        return CDloadWaveAudioData(inFileURL, outDataSize, outDataFormat, outSampleRate);    \n    } else {\n        return CDloadCafAudioData(inFileURL, outDataSize, outDataFormat, outSampleRate);        \n    }\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CDXMacOSXSupport.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n/**\n A set of proxy classes to allow iOS audio code to run on MacOS X. AVAudioPlayer is implemented using NSSound.\n AVAudioSession is a \"do nothing\" class as it isn't really relevant on MacOS X.\n \n Limitations:\n AVAudioPlayer numberOfLoops not correctly supported.  Looping is either on or off, can not specify a specific number of loops.\n AVAudioPlayer panning not supported.\n AVAudioPlayer metering not supported.\n AVAudioSession nothing is supported, not applicable to MacOS X.\n */\n\n#import <Availability.h>\n#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED\n#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)\n\n#import <Foundation/Foundation.h>\n#import <AppKit/NSSound.h>\n\nenum AudioSessionProperties {\n\tkAudioSessionProperty_OtherAudioIsPlaying,\n\tkAudioSessionProperty_AudioRoute\t\n};\n#ifdef __cplusplus\nextern \"C\" {\n#endif\t\n\t\nextern OSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *outData);    \n\n#ifdef __cplusplus\n}\n#endif\n/**\n Based on AVAudioPlayer.h header in AVFoundation headers\n */\n@class NSData, NSURL, NSError, NSDictionary;\n@protocol AVAudioPlayerDelegate;\n\n/* This class is available with iPhone 2.2 or later */\n@interface AVAudioPlayer : NSObject <NSSoundDelegate> {\n\t\n\t// properties\n\tid<AVAudioPlayerDelegate> delegate;\n\tNSUInteger numberOfChannels;\n\tBOOL playing;\n\tNSTimeInterval duration; \n\tNSURL *url;\n\tNSData *data;\n\tfloat pan;\n\tfloat volume;\n\tNSTimeInterval currentTime;\n\tNSTimeInterval deviceCurrentTime; \n\tNSInteger numberOfLoops;\n\tBOOL meteringEnabled;\n\t\n\n@private\n    NSSound* _player;\n}\n\n/* For all of these init calls, if a return value of nil is given you can check outError to see what the problem was.\n If not nil, then the object is usable for playing\n */\n\n/* all data must be in the form of an audio file understood by CoreAudio */\n- (id)initWithContentsOfURL:(NSURL *)theUrl error:(NSError **)outError;\n- (id)initWithData:(NSData *)theData error:(NSError **)outError;\n\n/* transport control */\n/* methods that return BOOL return YES on success and NO on failure. */\n- (BOOL)prepareToPlay;\t/* get ready to play the sound. happens automatically on play. */\n- (BOOL)play;\t\t\t/* sound is played asynchronously. */\n- (BOOL)playAtTime:(NSTimeInterval) time;  /* play a sound some time in the future. time should be greater than deviceCurrentTime. */\n- (void)pause;\t\t\t/* pauses playback, but remains ready to play. */\n- (void)stop;\t\t\t/* stops playback. no longer ready to play. */\n\n/* properties */\n\n@property(readonly, getter=isPlaying) BOOL playing;\n\n@property(readonly) NSUInteger numberOfChannels;\n@property(readonly) NSTimeInterval duration; /* the duration of the sound. */\n\n@property(assign) id<AVAudioPlayerDelegate> delegate; /* the delegate will be sent playerDidFinishPlaying */ \n\n/* one of these three properties will be non-nil based on the init... method used */\n@property(readonly) NSURL *url; /* returns nil if object was not created with a URL */\n@property(readonly) NSData *data; /* returns nil if object was not created with a data object */\n@property float pan; /* set panning. -1.0 is left, 0.0 is center, 1.0 is right. */\n@property float volume; /* The volume for the sound. The nominal range is from 0.0 to 1.0. */\n\n/*  If the sound is playing, currentTime is the offset into the sound of the current playback position.  \n If the sound is not playing, currentTime is the offset into the sound where playing would start. */\n@property NSTimeInterval currentTime;\n\n/* returns the current time associated with the output device */\n@property(readonly) NSTimeInterval deviceCurrentTime; \n\n/* \"numberOfLoops\" is the number of times that the sound will return to the beginning upon reaching the end. \n A value of zero means to play the sound just once.\n A value of one will result in playing the sound twice, and so on..\n Any negative number will loop indefinitely until stopped.\n */\n@property NSInteger numberOfLoops;\n\n/* metering */\n\n@property(getter=isMeteringEnabled) BOOL meteringEnabled; /* turns level metering on or off. default is off. */\n\n- (void)updateMeters; /* call to refresh meter values */\n- (float)peakPowerForChannel:(NSUInteger)channelNumber; /* returns peak power in decibels for a given channel */\n- (float)averagePowerForChannel:(NSUInteger)channelNumber; /* returns average power in decibels for a given channel */\n\n@end\n\n/* A protocol for delegates of AVAudioPlayer */\n@protocol AVAudioPlayerDelegate <NSObject>\n@optional \n/* audioPlayerDidFinishPlaying:successfully: is called when a sound has finished playing. This method is NOT called if the player is stopped due to an interruption. */\n- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag;\n\n/* if an error occurs while decoding it will be reported to the delegate. */\n- (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error;\n\n/* audioPlayerBeginInterruption: is called when the audio session has been interrupted while the player was playing. The player will have been paused. */\n- (void)audioPlayerBeginInterruption:(AVAudioPlayer *)player;\n\n/* audioPlayerEndInterruption:withFlags: is called when the audio session interruption has ended and this player had been interrupted while playing. */\n/* Currently the only flag is AVAudioSessionInterruptionFlags_ShouldResume. */\n- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withFlags:(NSUInteger)flags;\n\n/* audioPlayerEndInterruption: is called when the preferred method, audioPlayerEndInterruption:withFlags:, is not implemented. */\n- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player;\n@end\n\n\n/**\n Taken from AVAudioSession.h header in AVFoundation headers\n */\n\n/* This protocol is available with iPhone 3.0 or later */\n@protocol AVAudioSessionDelegate;\n@class NSError, NSString;\n\n/* values for the category property */\nextern NSString *const AVAudioSessionCategoryAmbient;\nextern NSString *const AVAudioSessionCategorySoloAmbient;\nextern NSString *const AVAudioSessionCategoryPlayback;\nextern NSString *const AVAudioSessionCategoryRecord;\nextern NSString *const AVAudioSessionCategoryPlayAndRecord;\nextern NSString *const AVAudioSessionCategoryAudioProcessing;\n\nenum {\n\tAVAudioSessionInterruptionFlags_ShouldResume = 1\n};\n\nenum {\t\n\tAVAudioSessionSetActiveFlags_NotifyOthersOnDeactivation = 1\n};\n\n@interface AVAudioSession : NSObject {\n\t\n\t// properties\n\tNSString* category;\n\tdouble preferredHardwareSampleRate;\n\tNSTimeInterval preferredIOBufferDuration;\n\t\n\tBOOL inputIsAvailable;\n\tdouble currentHardwareSampleRate;\n\tNSInteger currentHardwareInputNumberOfChannels;\n\tNSInteger currentHardwareOutputNumberOfChannels;\n\tid<AVAudioSessionDelegate> delegate;\n\n@private\n    __strong void *_impl;\n}\n\n/* returns singleton instance */\n+ (id)sharedInstance;\n\n@property(assign) id<AVAudioSessionDelegate> delegate;\n\n- (BOOL)setActive:(BOOL)beActive error:(NSError**)outError;\n- (BOOL)setActive:(BOOL)beActive withFlags:(NSInteger)flags error:(NSError**)outError;\n\n- (BOOL)setCategory:(NSString*)theCategory error:(NSError**)outError;\n- (BOOL)setPreferredHardwareSampleRate:(double)sampleRate error:(NSError**)outError;\n- (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError**)outError;\n\n@property(readonly) NSString* category;\n@property(readonly) double preferredHardwareSampleRate;\n@property(readonly) NSTimeInterval preferredIOBufferDuration;\n\n@property(readonly) BOOL inputIsAvailable;\n@property(readonly) double currentHardwareSampleRate;\n@property(readonly) NSInteger currentHardwareInputNumberOfChannels;\n@property(readonly) NSInteger currentHardwareOutputNumberOfChannels;\n\n@end\n\n\n/* A protocol for delegates of AVAudioSession */\n@protocol AVAudioSessionDelegate <NSObject>\n@optional \n\n- (void)beginInterruption;\n\n- (void)endInterruptionWithFlags:(NSUInteger)flags;\n\n- (void)endInterruption; /* endInterruptionWithFlags: will be called instead if implemented. */\n\n- (void)inputIsAvailableChanged:(BOOL)isInputAvailable;\n@end\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CDXMacOSXSupport.mm",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n#import <Availability.h>\n#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED\n#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)\n\n#import \"CDXMacOSXSupport.h\"\n#import \"SimpleAudioEngine.h\"\n#import \"CocosDenshion.h\"\n\nNSString * const AVAudioSessionCategoryAmbient = @\"AVAudioSessionCategoryAmbient\";\nNSString *const AVAudioSessionCategorySoloAmbient = @\"AVAudioSessionCategorySoloAmbient\";\nNSString *const AVAudioSessionCategoryPlayback = @\"AVAudioSessionCategoryPlayback\";\nNSString *const AVAudioSessionCategoryRecord = @\"AVAudioSessionCategoryRecord\";\nNSString *const AVAudioSessionCategoryPlayAndRecord = @\"AVAudioSessionCategoryPlayAndRecord\";\nNSString *const AVAudioSessionCategoryAudioProcessing = @\"AVAudioSessionCategoryAudioProcessing\";\n\nOSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *outData) {\n\t//TODO: set outData appropriately\n\treturn 0;\n}    \n\n@implementation AVAudioPlayer\n\n@synthesize delegate, numberOfChannels, pan, deviceCurrentTime, url, data;\n\n- (id)initWithContentsOfURL:(NSURL *)theUrl error:(NSError **)outError {\n\tif ((self = [super init])) {\n\t\t_player = [[NSSound alloc] initWithContentsOfURL:theUrl byReference:YES];\n\t\tif (_player != nil) {\n\t\t\t_player.delegate = self;\n\t\t\tCDLOG(@\"Denshion::CDXMacOSXSupport - NSSound allocated for %@\", theUrl);\n\t\t}\t\n\t}\n\treturn self;\n}\n\n- (id)initWithData:(NSData *)theData error:(NSError **)outError { \n\tif ((self = [super init])) {\n\t\t_player = [[NSSound alloc] initWithData:theData];\n\t\tif (_player != nil) {\n\t\t\t_player.delegate = self;\n\t\t\tCDLOG(@\"Denshion::CDXMacOSXSupport - NSSound allocated for %@\", theData);\n\t\t}\t\n\t}\n\treturn self;\n}\n\n\n-(void) dealloc {\n\t[_player release];\n\t[super dealloc];\n}\t\n\n- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)finished {\n\tif (self.delegate && [self.delegate respondsToSelector:@selector(audioPlayerDidFinishPlaying:successfully:)]) {\n\t\t[self.delegate audioPlayerDidFinishPlaying:self successfully:finished];\n\t}\t\n}\t\n\n- (BOOL)play {\n\tBOOL result;\n\tresult = [_player play];\n\tif (!result) {\n\t\t//May be paused, try resuming instead \n\t\tresult = [_player resume];\n\t}\t\n\treturn result;\n}\t\n\n-(void) pause {\n\t[_player pause];\n}\t\n\n-(void) stop {\n\t[_player stop];\n}\t\n\n-(BOOL) isPlaying {\n\treturn [_player isPlaying];\n}\t\n\n-(void) setVolume:(float) vol {\n\t[_player setVolume:vol];\n}\n\n-(float) volume {\n\treturn [_player volume];\n}\t\n\n-(void) setNumberOfLoops:(NSInteger) nOfLoops {\n\tif (nOfLoops < 0) {\n\t\t[_player setLoops:YES];\n\t} else {\n\t\t[_player setLoops:NO];\n\t}\t\n}\t\n\n-(NSInteger) numberOfLoops {\n\tif (_player.loops) {\n\t\treturn -1;\n\t} else {\n\t\treturn 0;\n\t}\t\n}\t\n\n-(void) setCurrentTime:(NSTimeInterval) aCurrentTime {\n\t[_player setCurrentTime:aCurrentTime];\n}\n\n-(NSTimeInterval) currentTime {\n\treturn [_player currentTime];\n}\n\n-(NSTimeInterval) duration {\n\treturn [_player duration];\n}\n\n#pragma mark unsupported\n- (BOOL)prepareToPlay {\n\treturn YES;\n}\t\n-(BOOL)playAtTime:(NSTimeInterval)time {\n\treturn YES;\n}\t\n-(void) setMeteringEnabled:(BOOL) enabled {\n}\t\n-(BOOL) isMeteringEnabled {\n\treturn NO;\n}\t\n- (void)updateMeters{}\n- (float)peakPowerForChannel:(NSUInteger)channelNumber{return 0.0f;} \n- (float)averagePowerForChannel:(NSUInteger)channelNumber{return 0.0f;}\n@end\n\n/**\n A \"do nothing\" implementation - AVAudioSession is not really relevant to Mac OS X.\n */\n@implementation AVAudioSession\n@synthesize delegate, category, preferredHardwareSampleRate, preferredIOBufferDuration;\n@synthesize inputIsAvailable, currentHardwareSampleRate, currentHardwareInputNumberOfChannels, currentHardwareOutputNumberOfChannels;\n\n+ (id)sharedInstance {\n\treturn nil;\n}\t\n\n- (BOOL)setActive:(BOOL)beActive error:(NSError**)outError {return YES;}\n- (BOOL)setActive:(BOOL)beActive withFlags:(NSInteger)flags error:(NSError**)outError {return YES;}\n- (BOOL)setCategory:(NSString*)theCategory error:(NSError**)outError {return YES;}\n- (BOOL)setPreferredHardwareSampleRate:(double)sampleRate error:(NSError**)outError {return YES;}\n- (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError**)outError {return YES;}\n\n@end\n#endif"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CocosDenshion.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n\n\n/** \n@file\n@b IMPORTANT\nThere are 3 different ways of using CocosDenshion. Depending on which you choose you \nwill need to include different files and frameworks.\n\n@par SimpleAudioEngine\nThis is recommended for basic audio requirements. If you just want to play some sound fx\nand some background music and have no interest in learning the lower level workings then\nthis is the interface to use.\n\nRequirements:\n - Firmware: OS 2.2 or greater \n - Files: SimpleAudioEngine.*, CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox, AVFoundation\n \n@par CDAudioManager\nCDAudioManager is basically a thin wrapper around an AVAudioPlayer object used for playing\nbackground music and a CDSoundEngine object used for playing sound effects. It manages the\naudio session for you deals with audio session interruption. It is fairly low level and it\nis expected you have some understanding of the underlying technologies. For example, for \nmany use cases regarding background music it is expected you will work directly with the\nbackgroundMusic AVAudioPlayer which is exposed as a property.\n \nRequirements:\n  - Firmware: OS 2.2 or greater \n  - Files: CDAudioManager.*, CocosDenshion.*\n  - Frameworks: OpenAL, AudioToolbox, AVFoundation\n\n@par CDSoundEngine\nCDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch \nexample. It can playback up to 32 sounds simultaneously with control over pitch, pan\nand gain.  It can be set up to handle audio session interruption automatically.  You \nmay decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine\nbecause you require OS 2.0 compatibility.\n \nRequirements:\n  - Firmware: OS 2.0 or greater \n  - Files: CocosDenshion.*\n  - Frameworks: OpenAL, AudioToolbox\n \n*/ \n\n#import <OpenAL/al.h>\n#import <OpenAL/alc.h>\n#import <AudioToolbox/AudioToolbox.h>\n#import <Foundation/Foundation.h>\n#import \"CDConfig.h\"\n\n\n#if !defined(CD_DEBUG) || CD_DEBUG == 0\n#define CDLOG(...) do {} while (0)\n#define CDLOGINFO(...) do {} while (0)\n\n#elif CD_DEBUG == 1\n#define CDLOG(...) NSLog(__VA_ARGS__)\n#define CDLOGINFO(...) do {} while (0)\n\n#elif CD_DEBUG > 1\n#define CDLOG(...) NSLog(__VA_ARGS__)\n#define CDLOGINFO(...) NSLog(__VA_ARGS__)\n#endif // CD_DEBUG\n\n\n#import \"CDOpenALSupport.h\"\n\n//Tested source limit on 2.2.1 and 3.1.2 with up to 128 sources and appears to work. Older OS versions e.g 2.2 may support only 32\n#define CD_SOURCE_LIMIT 32 //Total number of sources we will ever want, may actually get less\n#define CD_NO_SOURCE 0xFEEDFAC //Return value indicating playback failed i.e. no source\n#define CD_IGNORE_AUDIO_SESSION 0xBEEFBEE //Used internally to indicate audio session will not be handled\n#define CD_MUTE      0xFEEDBAB //Return value indicating sound engine is muted or non functioning\n#define CD_NO_SOUND = -1;\n\n#define CD_SAMPLE_RATE_HIGH 44100\n#define CD_SAMPLE_RATE_MID  22050\n#define CD_SAMPLE_RATE_LOW  16000\n#define CD_SAMPLE_RATE_BASIC 8000\n#define CD_SAMPLE_RATE_DEFAULT 44100\n\nextern NSString * const kCDN_BadAlContext;\nextern NSString * const kCDN_AsynchLoadComplete;\n\nextern float const kCD_PitchDefault;\nextern float const kCD_PitchLowerOneOctave;\nextern float const kCD_PitchHigherOneOctave;\nextern float const kCD_PanDefault;\nextern float const kCD_PanFullLeft;\nextern float const kCD_PanFullRight;\nextern float const kCD_GainDefault;\n\nenum bufferState {\n    CD_BS_EMPTY = 0,\n    CD_BS_LOADED = 1,\n    CD_BS_FAILED = 2\n};\n\ntypedef struct _sourceGroup {\n    int startIndex;\n    int currentIndex;\n    int totalSources;\n    bool enabled;\n    bool nonInterruptible;\n    int *sourceStatuses;//pointer into array of source status information\n} sourceGroup;\n\ntypedef struct _bufferInfo {\n    ALuint bufferId;\n    int bufferState;\n    void* bufferData;\n    ALenum format;\n    ALsizei sizeInBytes;\n    ALsizei frequencyInHertz;\n} bufferInfo;    \n\ntypedef struct _sourceInfo {\n    bool usable;\n    ALuint sourceId;\n    ALuint attachedBufferId;\n} sourceInfo;    \n\n#pragma mark CDAudioTransportProtocol\n\n@protocol CDAudioTransportProtocol <NSObject>\n/** Play the audio */\n-(BOOL) play;\n/** Pause the audio, retain resources */\n-(BOOL) pause;\n/** Stop the audio, release resources */\n-(BOOL) stop;\n/** Return playback to beginning */\n-(BOOL) rewind;\n@end\n\n#pragma mark CDAudioInterruptProtocol\n\n@protocol CDAudioInterruptProtocol <NSObject>\n/** Is audio mute */\n-(BOOL) mute;\n/** If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently */\n-(void) setMute:(BOOL) muteValue;\n/** Is audio enabled */\n-(BOOL) enabled;\n/** If NO then all audio is stopped and any calls to start new audio will be ignored */\n-(void) setEnabled:(BOOL) enabledValue;\n@end\n\n#pragma mark CDUtilities\n/**\n Collection of utilities required by CocosDenshion\n */\n@interface CDUtilities : NSObject\n{\n}    \n\n/** Fundamentally the same as the corresponding method is FileUtils but added to break binding to cocos2d */\n+(NSString*) fullPathFromRelativePath:(NSString*) relPath;\n\n@end\n\n\n#pragma mark CDSoundEngine\n\n/** CDSoundEngine is built upon OpenAL and works with SDK 2.0.\n CDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch \n example. It can playback up to 32 sounds simultaneously with control over pitch, pan\n and gain.  It can be set up to handle audio session interruption automatically.  You \n may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine\n because you require OS 2.0 compatibility.\n \n Requirements:\n - Firmware: OS 2.0 or greater \n - Files: CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox\n \n @since v0.8\n */\n@class CDSoundSource;\n@interface CDSoundEngine : NSObject <CDAudioInterruptProtocol> {\n    \n    bufferInfo        *_buffers;\n    sourceInfo        *_sources;\n    sourceGroup        *_sourceGroups;\n    ALCcontext        *context;\n    NSUInteger        _sourceGroupTotal;\n    UInt32            _audioSessionCategory;\n    BOOL            _handleAudioSession;\n    ALfloat            _preMuteGain;\n    NSObject        *_mutexBufferLoad;\n    BOOL            mute_;\n    BOOL            enabled_;\n\n    ALenum            lastErrorCode_;\n    BOOL            functioning_;\n    float            asynchLoadProgress_;\n    BOOL            getGainWorks_;\n    \n    //For managing dynamic allocation of sources and buffers\n    int sourceTotal_;\n    int bufferTotal;\n     \n}\n\n@property (readwrite, nonatomic) ALfloat masterGain;\n@property (readonly)  ALenum lastErrorCode;//Last OpenAL error code that was generated\n@property (readonly)  BOOL functioning;//Is the sound engine functioning\n@property (readwrite) float asynchLoadProgress;\n@property (readonly)  BOOL getGainWorks;//Does getting the gain for a source work\n/** Total number of sources available */\n@property (readonly) int sourceTotal;\n/** Total number of source groups that have been defined */\n@property (readonly) NSUInteger sourceGroupTotal;\n\n/** Sets the sample rate for the audio mixer. For best performance this should match the sample rate of your audio content */\n+(void) setMixerSampleRate:(Float32) sampleRate;\n\n/** Initializes the engine with a group definition and a total number of groups */\n-(id)init;\n\n/** Plays a sound in a channel group with a pitch, pan and gain. The sound could played looped or not */\n-(ALuint) playSound:(int) soundId sourceGroupId:(int)sourceGroupId pitch:(float) pitch pan:(float) pan gain:(float) gain loop:(BOOL) loop;\n\n/** Creates and returns a sound source object for the specified sound within the specified source group.\n */\n-(CDSoundSource *) soundSourceForSound:(int) soundId sourceGroupId:(int) sourceGroupId;\n\n/** Stops playing a sound */\n- (void) stopSound:(ALuint) sourceId;\n/** Stops playing a source group */\n- (void) stopSourceGroup:(int) sourceGroupId;\n/** Stops all playing sounds */\n-(void) stopAllSounds;\n/** Pause a sound */\n-(void) pauseSound:(ALuint) sourceId;\n/** Pause all sounds */\n-(void) pauseAllSounds;\n/** Resume a sound */\n-(void) resumeSound:(ALuint) sourceId;\n/** Resume all sounds */\n-(void) resumeAllSounds;\n-(void) defineSourceGroups:(NSArray*) sourceGroupDefinitions;\n-(void) defineSourceGroups:(int[]) sourceGroupDefinitions total:(NSUInteger) total;\n-(void) setSourceGroupNonInterruptible:(int) sourceGroupId isNonInterruptible:(BOOL) isNonInterruptible;\n-(void) setSourceGroupEnabled:(int) sourceGroupId enabled:(BOOL) enabled;\n-(BOOL) sourceGroupEnabled:(int) sourceGroupId;\n-(BOOL) loadBufferFromData:(int) soundId soundData:(ALvoid*) soundData format:(ALenum) format size:(ALsizei) size freq:(ALsizei) freq;\n-(BOOL) loadBuffer:(int) soundId filePath:(NSString*) filePath;\n-(void) loadBuffersAsynchronously:(NSArray *) loadRequests;\n-(BOOL) unloadBuffer:(int) soundId;\n-(ALCcontext *) openALContext;\n\n/** Returns the duration of the buffer in seconds or a negative value if the buffer id is invalid */\n-(float) bufferDurationInSeconds:(int) soundId;\n/** Returns the size of the buffer in bytes or a negative value if the buffer id is invalid */\n-(ALsizei) bufferSizeInBytes:(int) soundId;\n/** Returns the sampling frequency of the buffer in hertz or a negative value if the buffer id is invalid */\n-(ALsizei) bufferFrequencyInHertz:(int) soundId;\n\n/** Used internally, never call unless you know what you are doing */\n-(void) _soundSourcePreRelease:(CDSoundSource *) soundSource;\n\n@end\n\n#pragma mark CDSoundSource\n/** CDSoundSource is a wrapper around an OpenAL sound source.\n It allows you to manipulate properties such as pitch, gain, pan and looping while the \n sound is playing. CDSoundSource is based on the old CDSourceWrapper class but with much\n added functionality.\n \n @since v1.0\n */\n@interface CDSoundSource : NSObject <CDAudioTransportProtocol, CDAudioInterruptProtocol> {\n    ALenum lastError;\n@public\n    ALuint _sourceId;\n    ALuint _sourceIndex;\n    CDSoundEngine* _engine;\n    int _soundId;\n    float _preMuteGain;\n    BOOL enabled_;\n    BOOL mute_;\n}\n@property (readwrite, nonatomic) float pitch;\n@property (readwrite, nonatomic) float gain;\n@property (readwrite, nonatomic) float pan;\n@property (readwrite, nonatomic) BOOL looping;\n@property (readonly)  BOOL isPlaying;\n@property (readwrite, nonatomic) int soundId;\n/** Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid */\n@property (readonly) float durationInSeconds;\n\n/** Stores the last error code that occurred. Check against AL_NO_ERROR */\n@property (readonly) ALenum lastError;\n/** Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine */\n-(id)init:(ALuint) theSourceId sourceIndex:(int) index soundEngine:(CDSoundEngine*) engine;\n\n@end\n\n#pragma mark CDAudioInterruptTargetGroup\n\n/** Container for objects that implement audio interrupt protocol i.e. they can be muted and enabled.\n Setting mute and enabled for the group propagates to all children. \n Designed to be used with your CDSoundSource objects to get them to comply with global enabled and mute settings\n if that is what you want to do.*/\n@interface CDAudioInterruptTargetGroup : NSObject <CDAudioInterruptProtocol> {\n    BOOL mute_;\n    BOOL enabled_;\n    NSMutableArray *children_;\n}\n-(void) addAudioInterruptTarget:(NSObject<CDAudioInterruptProtocol>*) interruptibleTarget;\n@end\n\n#pragma mark CDAsynchBufferLoader\n\n/** CDAsynchBufferLoader\n TODO\n */\n@interface CDAsynchBufferLoader : NSOperation {\n    NSArray *_loadRequests;\n    CDSoundEngine *_soundEngine;\n}    \n\n-(id) init:(NSArray *)loadRequests soundEngine:(CDSoundEngine *) theSoundEngine;\n\n@end\n\n#pragma mark CDBufferLoadRequest\n\n/** CDBufferLoadRequest */\n@interface CDBufferLoadRequest: NSObject\n{\n    NSString *filePath;\n    int         soundId;\n    //id       loader;\n}\n\n@property (readonly) NSString *filePath;\n@property (readonly) int soundId;\n\n- (id)init:(int) theSoundId filePath:(const NSString *) theFilePath;\n@end\n\n/** Interpolation type */\ntypedef enum {\n    kIT_Linear,            //!Straight linear interpolation fade\n    kIT_SCurve,            //!S curved interpolation\n    kIT_Exponential     //!Exponential interpolation\n} tCDInterpolationType;\n\n#pragma mark CDFloatInterpolator\n@interface CDFloatInterpolator: NSObject\n{\n    float start;\n    float end;\n    float lastValue;\n    tCDInterpolationType interpolationType;\n}\n@property (readwrite, nonatomic) float start;\n@property (readwrite, nonatomic) float end;\n@property (readwrite, nonatomic) tCDInterpolationType interpolationType;\n\n/** Return a value between min and max based on t which represents fractional progress where 0 is the start\n and 1 is the end */\n-(float) interpolate:(float) t;\n-(id) init:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal;\n\n@end\n\n#pragma mark CDPropertyModifier\n\n/** Base class for classes that modify properties such as pitch, pan and gain */\n@interface CDPropertyModifier: NSObject\n{\n    CDFloatInterpolator *interpolator;\n    float startValue;\n    float endValue;\n    id target;\n    BOOL stopTargetWhenComplete;\n    \n}\n@property (readwrite, nonatomic) BOOL stopTargetWhenComplete;\n@property (readwrite, nonatomic) float startValue;\n@property (readwrite, nonatomic) float endValue;\n@property (readwrite, nonatomic) tCDInterpolationType interpolationType;\n\n-(id) init:(id) theTarget interpolationType:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal;\n/** Set to a fractional value between 0 and 1 where 0 equals the start and 1 equals the end*/\n-(void) modify:(float) t;\n\n-(void) _setTargetProperty:(float) newVal;\n-(float) _getTargetProperty;\n-(void) _stopTarget;\n-(Class) _allowableType;\n\n@end\n\n#pragma mark CDSoundSourceFader\n\n/** Fader for CDSoundSource objects */\n@interface CDSoundSourceFader : CDPropertyModifier{}\n@end\n\n#pragma mark CDSoundSourcePanner\n\n/** Panner for CDSoundSource objects */\n@interface CDSoundSourcePanner : CDPropertyModifier{}\n@end\n\n#pragma mark CDSoundSourcePitchBender\n\n/** Pitch bender for CDSoundSource objects */\n@interface CDSoundSourcePitchBender : CDPropertyModifier{}\n@end\n\n#pragma mark CDSoundEngineFader\n\n/** Fader for CDSoundEngine objects */\n@interface CDSoundEngineFader : CDPropertyModifier{}\n@end\n\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/CocosDenshion.m",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n#import \"CocosDenshion.h\"\n\nALvoid  alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);\nALvoid  alcMacOSXMixerOutputRateProc(const ALdouble value);\n\n\ntypedef ALvoid    AL_APIENTRY    (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq);\nALvoid  alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq)\n{\n    static    alBufferDataStaticProcPtr    proc = NULL;\n    \n    if (proc == NULL) {\n        proc = (alBufferDataStaticProcPtr) alcGetProcAddress(NULL, (const ALCchar*) \"alBufferDataStatic\");\n    }\n    \n    if (proc)\n        proc(bid, format, data, size, freq);\n    \n    return;\n}\n\ntypedef ALvoid    AL_APIENTRY    (*alcMacOSXMixerOutputRateProcPtr) (const ALdouble value);\nALvoid  alcMacOSXMixerOutputRateProc(const ALdouble value)\n{\n    static    alcMacOSXMixerOutputRateProcPtr    proc = NULL;\n    \n    if (proc == NULL) {\n        proc = (alcMacOSXMixerOutputRateProcPtr) alcGetProcAddress(NULL, (const ALCchar*) \"alcMacOSXMixerOutputRate\");\n    }\n    \n    if (proc)\n        proc(value);\n    \n    return;\n}\n\nNSString * const kCDN_BadAlContext = @\"kCDN_BadAlContext\";\nNSString * const kCDN_AsynchLoadComplete = @\"kCDN_AsynchLoadComplete\";\nfloat const kCD_PitchDefault = 1.0f;\nfloat const kCD_PitchLowerOneOctave = 0.5f;\nfloat const kCD_PitchHigherOneOctave = 2.0f;\nfloat const kCD_PanDefault = 0.0f;\nfloat const kCD_PanFullLeft = -1.0f;\nfloat const kCD_PanFullRight = 1.0f;\nfloat const kCD_GainDefault = 1.0f;\n\n@interface CDSoundEngine (PrivateMethods)\n-(BOOL) _initOpenAL;\n-(void) _testGetGain;\n-(void) _dumpSourceGroupsInfo;\n-(void) _getSourceIndexForSourceGroup;\n-(void) _freeSourceGroups;\n-(BOOL) _setUpSourceGroups:(int[]) definitions total:(NSUInteger) total; \n@end\n\n#pragma mark -\n#pragma mark CDUtilities\n\n@implementation CDUtilities\n\n+(NSString*) fullPathFromRelativePath:(NSString*) relPath\n{\n    // do not convert an absolute path (starting with '/')\n    if(([relPath length] > 0) && ([relPath characterAtIndex:0] == '/'))\n    {\n        return relPath;\n    }\n    \n    NSMutableArray *imagePathComponents = [NSMutableArray arrayWithArray:[relPath pathComponents]];\n    NSString *file = [imagePathComponents lastObject];\n    \n    [imagePathComponents removeLastObject];\n    NSString *imageDirectory = [NSString pathWithComponents:imagePathComponents];\n    \n    NSString *fullpath = [[NSBundle mainBundle] pathForResource:file ofType:nil inDirectory:imageDirectory];\n    if (fullpath == nil)\n        fullpath = relPath;\n    \n    return fullpath;    \n}\n\n@end\n\n#pragma mark -\n#pragma mark CDSoundEngine\n\n@implementation CDSoundEngine\n\nstatic Float32 _mixerSampleRate;\nstatic BOOL _mixerRateSet = NO;\n\n@synthesize lastErrorCode = lastErrorCode_;\n@synthesize functioning = functioning_;\n@synthesize asynchLoadProgress = asynchLoadProgress_;\n@synthesize getGainWorks = getGainWorks_;\n@synthesize sourceTotal = sourceTotal_;\n\n+ (void) setMixerSampleRate:(Float32) sampleRate {\n    _mixerRateSet = YES;\n    _mixerSampleRate = sampleRate;\n}    \n\n- (void) _testGetGain {\n    float testValue = 0.7f;\n    ALuint testSourceId = _sources[0].sourceId;\n    alSourcef(testSourceId, AL_GAIN, 0.0f);//Start from know value\n    alSourcef(testSourceId, AL_GAIN, testValue);\n    ALfloat gainVal;\n    alGetSourcef(testSourceId, AL_GAIN, &gainVal);\n    getGainWorks_ = (gainVal == testValue);\n}\n\n//Generate sources one at a time until we fail\n-(void) _generateSources {\n    \n    _sources = (sourceInfo*)malloc( sizeof(_sources[0]) * CD_SOURCE_LIMIT);\n    BOOL hasFailed = NO;\n    sourceTotal_ = 0;\n    alGetError();//Clear error\n    while (!hasFailed && sourceTotal_ < CD_SOURCE_LIMIT) {\n        alGenSources(1, &(_sources[sourceTotal_].sourceId));\n        if (alGetError() == AL_NO_ERROR) {\n            //Now try attaching source to null buffer\n            alSourcei(_sources[sourceTotal_].sourceId, AL_BUFFER, 0);\n            if (alGetError() == AL_NO_ERROR) {\n                _sources[sourceTotal_].usable = true;    \n                sourceTotal_++;\n            } else {\n                hasFailed = YES;\n            }    \n        } else {\n            _sources[sourceTotal_].usable = false;\n            hasFailed = YES;\n        }    \n    }\n    //Mark the rest of the sources as not usable\n    for (int i=sourceTotal_; i < CD_SOURCE_LIMIT; i++) {\n        _sources[i].usable = false;\n    }    \n}    \n\n-(void) _generateBuffers:(int) startIndex endIndex:(int) endIndex {\n    if (_buffers) {\n        alGetError();\n        for (int i=startIndex; i <= endIndex; i++) {\n            alGenBuffers(1, &_buffers[i].bufferId);\n            _buffers[i].bufferData = NULL;\n            if (alGetError() == AL_NO_ERROR) {\n                _buffers[i].bufferState = CD_BS_EMPTY;\n            } else {\n                _buffers[i].bufferState = CD_BS_FAILED;\n                CDLOG(@\"Denshion::CDSoundEngine - buffer creation failed %i\",i);\n            }    \n        }\n    }    \n}\n\n/**\n * Internal method called during init\n */\n- (BOOL) _initOpenAL\n{\n    //ALenum            error;\n    context = NULL;\n    ALCdevice        *newDevice = NULL;\n\n    //Set the mixer rate for the audio mixer\n    if (!_mixerRateSet) {\n        _mixerSampleRate = CD_SAMPLE_RATE_DEFAULT;\n    }\n    alcMacOSXMixerOutputRateProc(_mixerSampleRate);\n    CDLOGINFO(@\"Denshion::CDSoundEngine - mixer output rate set to %0.2f\",_mixerSampleRate);\n    \n    // Create a new OpenAL Device\n    // Pass NULL to specify the system's default output device\n    newDevice = alcOpenDevice(NULL);\n    if (newDevice != NULL)\n    {\n        // Create a new OpenAL Context\n        // The new context will render to the OpenAL Device just created \n        context = alcCreateContext(newDevice, 0);\n        if (context != NULL)\n        {\n            // Make the new context the Current OpenAL Context\n            alcMakeContextCurrent(context);\n            \n            // Create some OpenAL Buffer Objects\n            [self _generateBuffers:0 endIndex:bufferTotal-1];\n            \n            // Create some OpenAL Source Objects\n            [self _generateSources];\n            \n        }\n    } else {\n        return FALSE;//No device\n    }    \n    alGetError();//Clear error\n    return TRUE;\n}\n\n- (void) dealloc {\n    \n    ALCcontext    *currentContext = NULL;\n    ALCdevice    *device = NULL;\n    \n    [self stopAllSounds];\n\n    CDLOGINFO(@\"Denshion::CDSoundEngine - Deallocing sound engine.\");\n    [self _freeSourceGroups];\n    \n    // Delete the Sources\n    CDLOGINFO(@\"Denshion::CDSoundEngine - deleting sources.\");\n    for (int i=0; i < sourceTotal_; i++) {\n        alSourcei(_sources[i].sourceId, AL_BUFFER, 0);//Detach from current buffer\n        alDeleteSources(1, &(_sources[i].sourceId));\n        if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n            CDLOG(@\"Denshion::CDSoundEngine - Error deleting source! %x\\n\", lastErrorCode_);\n        } \n    }    \n\n    // Delete the Buffers\n    CDLOGINFO(@\"Denshion::CDSoundEngine - deleting buffers.\");\n    for (int i=0; i < bufferTotal; i++) {\n        alDeleteBuffers(1, &_buffers[i].bufferId);\n#ifdef CD_USE_STATIC_BUFFERS\n        if (_buffers[i].bufferData) {\n            free(_buffers[i].bufferData);\n        }    \n#endif        \n    }    \n    CDLOGINFO(@\"Denshion::CDSoundEngine - free buffers.\");\n    free(_buffers);\n    currentContext = alcGetCurrentContext();\n    //Get device for active context\n    device = alcGetContextsDevice(currentContext);\n    //Release context\n    CDLOGINFO(@\"Denshion::CDSoundEngine - destroy context.\");\n    alcMakeContextCurrent(NULL);\n    alcDestroyContext(currentContext);\n    //Close device\n    CDLOGINFO(@\"Denshion::CDSoundEngine - close device.\");\n    alcCloseDevice(device);\n    CDLOGINFO(@\"Denshion::CDSoundEngine - free sources.\");\n    free(_sources);\n    \n    //Release mutexes\n    [_mutexBufferLoad release];\n    \n    [super dealloc];\n}    \n\n-(NSUInteger) sourceGroupTotal {\n    return _sourceGroupTotal;\n}    \n\n-(void) _freeSourceGroups \n{\n    CDLOGINFO(@\"Denshion::CDSoundEngine freeing source groups\");\n    if(_sourceGroups) {\n        for (int i=0; i < _sourceGroupTotal; i++) {\n            if (_sourceGroups[i].sourceStatuses) {\n                free(_sourceGroups[i].sourceStatuses);\n                CDLOGINFO(@\"Denshion::CDSoundEngine freed source statuses %i\",i);\n            }    \n        }\n        free(_sourceGroups);\n    }    \n}    \n\n-(BOOL) _redefineSourceGroups:(int[]) definitions total:(NSUInteger) total\n{\n    if (_sourceGroups) {\n        //Stop all sounds\n        [self stopAllSounds];\n        //Need to free source groups\n        [self _freeSourceGroups];\n    }\n    return [self _setUpSourceGroups:definitions total:total];\n}    \n\n-(BOOL) _setUpSourceGroups:(int[]) definitions total:(NSUInteger) total \n{\n    _sourceGroups = (sourceGroup *)malloc( sizeof(_sourceGroups[0]) * total);\n    if(!_sourceGroups) {\n        CDLOG(@\"Denshion::CDSoundEngine - source groups memory allocation failed\");\n        return NO;\n    }\n    \n    _sourceGroupTotal = total;\n    int sourceCount = 0;\n    for (int i=0; i < _sourceGroupTotal; i++) {\n        \n        _sourceGroups[i].startIndex = 0;\n        _sourceGroups[i].currentIndex = _sourceGroups[i].startIndex;\n        _sourceGroups[i].enabled = false;\n        _sourceGroups[i].nonInterruptible = false;\n        _sourceGroups[i].totalSources = definitions[i];\n        _sourceGroups[i].sourceStatuses = malloc(sizeof(_sourceGroups[i].sourceStatuses[0]) * _sourceGroups[i].totalSources);\n        if (_sourceGroups[i].sourceStatuses) {\n            for (int j=0; j < _sourceGroups[i].totalSources; j++) {\n                //First bit is used to indicate whether source is locked, index is shifted back 1 bit\n                _sourceGroups[i].sourceStatuses[j] = (sourceCount + j) << 1;    \n            }    \n        }    \n        sourceCount += definitions[i];\n    }\n    return YES;\n}\n\n-(void) defineSourceGroups:(int[]) sourceGroupDefinitions total:(NSUInteger) total {\n    [self _redefineSourceGroups:sourceGroupDefinitions total:total];\n}\n\n-(void) defineSourceGroups:(NSArray*) sourceGroupDefinitions {\n    CDLOGINFO(@\"Denshion::CDSoundEngine - source groups defined by NSArray.\");\n    NSUInteger totalDefs = [sourceGroupDefinitions count];\n    int* defs = (int *)malloc( sizeof(int) * totalDefs);\n    int currentIndex = 0;\n    for (id currentDef in sourceGroupDefinitions) {\n        if ([currentDef isKindOfClass:[NSNumber class]]) {\n            defs[currentIndex] = (int)[(NSNumber*)currentDef integerValue];\n            CDLOGINFO(@\"Denshion::CDSoundEngine - found definition %i.\",defs[currentIndex]);\n        } else {\n            CDLOG(@\"Denshion::CDSoundEngine - warning, did not understand source definition.\");\n            defs[currentIndex] = 0;\n        }    \n        currentIndex++;\n    }\n    [self _redefineSourceGroups:defs total:totalDefs];\n    free(defs);\n}    \n\n- (id)init\n{    \n    if ((self = [super init])) {\n        \n        //Create mutexes\n        _mutexBufferLoad = [[NSObject alloc] init];\n        \n        asynchLoadProgress_ = 0.0f;\n        \n        bufferTotal = CD_BUFFERS_START;\n        _buffers = (bufferInfo *)malloc( sizeof(_buffers[0]) * bufferTotal);\n    \n        // Initialize our OpenAL environment\n        if ([self _initOpenAL]) {\n            //Set up the default source group - a single group that contains all the sources\n            int sourceDefs[1];\n            sourceDefs[0] = self.sourceTotal;\n            [self _setUpSourceGroups:sourceDefs total:1];\n\n            functioning_ = YES;\n            //Synchronize premute gain\n            _preMuteGain = self.masterGain;\n            mute_ = NO;\n            enabled_ = YES;\n            //Test whether get gain works for sources\n            [self _testGetGain];\n        } else {\n            //Something went wrong with OpenAL\n            functioning_ = NO;\n        }\n    }\n    \n    return self;\n}\n\n/**\n * Delete the buffer identified by soundId\n * @return true if buffer deleted successfully, otherwise false\n */\n- (BOOL) unloadBuffer:(int) soundId \n{\n    //Ensure soundId is within array bounds otherwise memory corruption will occur\n    if (soundId < 0 || soundId >= bufferTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine - soundId is outside array bounds, maybe you need to increase CD_MAX_BUFFERS\");\n        return FALSE;\n    }    \n    \n    //Before a buffer can be deleted any sources that are attached to it must be stopped\n    for (int i=0; i < sourceTotal_; i++) {\n        //Note: tried getting the AL_BUFFER attribute of the source instead but doesn't\n        //appear to work on a device - just returned zero.\n        if (_buffers[soundId].bufferId == _sources[i].attachedBufferId) {\n            \n            CDLOG(@\"Denshion::CDSoundEngine - Found attached source %i %i %i\",i,_buffers[soundId].bufferId,_sources[i].sourceId);\n#ifdef CD_USE_STATIC_BUFFERS\n            //When using static buffers a crash may occur if a source is playing with a buffer that is about\n            //to be deleted even though we stop the source and successfully delete the buffer. Crash is confirmed\n            //on 2.2.1 and 3.1.2, however, it will only occur if a source is used rapidly after having its prior\n            //data deleted. To avoid any possibility of the crash we wait for the source to finish playing.\n            ALint state;\n            \n            alGetSourcei(_sources[i].sourceId, AL_SOURCE_STATE, &state);\n            \n            if (state == AL_PLAYING) {\n                CDLOG(@\"Denshion::CDSoundEngine - waiting for source to complete playing before removing buffer data\"); \n                alSourcei(_sources[i].sourceId, AL_LOOPING, FALSE);//Turn off looping otherwise loops will never end\n                while (state == AL_PLAYING) {\n                    alGetSourcei(_sources[i].sourceId, AL_SOURCE_STATE, &state);\n                    usleep(10000);\n                }\n            }\n#endif            \n            //Stop source and detach\n            alSourceStop(_sources[i].sourceId);    \n            if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDSoundEngine - error stopping source: %x\\n\", lastErrorCode_);\n            }    \n            \n            alSourcei(_sources[i].sourceId, AL_BUFFER, 0);//Attach to \"NULL\" buffer to detach\n            if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDSoundEngine - error detaching buffer: %x\\n\", lastErrorCode_);\n            } else {\n                //Record that source is now attached to nothing\n                _sources[i].attachedBufferId = 0;\n            }    \n        }    \n    }    \n    \n    alDeleteBuffers(1, &_buffers[soundId].bufferId);\n    if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n        CDLOG(@\"Denshion::CDSoundEngine - error deleting buffer: %x\\n\", lastErrorCode_);\n        _buffers[soundId].bufferState = CD_BS_FAILED;\n        return FALSE;\n    } else {\n#ifdef CD_USE_STATIC_BUFFERS\n        //Free previous data, if alDeleteBuffer has returned without error then no \n        if (_buffers[soundId].bufferData) {\n            CDLOGINFO(@\"Denshion::CDSoundEngine - freeing static data for soundId %i @ %i\",soundId,_buffers[soundId].bufferData);\n            free(_buffers[soundId].bufferData);//Free the old data\n            _buffers[soundId].bufferData = NULL;\n        }\n#endif        \n    }    \n    \n    alGenBuffers(1, &_buffers[soundId].bufferId);\n    if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n        CDLOG(@\"Denshion::CDSoundEngine - error regenerating buffer: %x\\n\", lastErrorCode_);\n        _buffers[soundId].bufferState = CD_BS_FAILED;\n        return FALSE;\n    } else {\n        //We now have an empty buffer\n        _buffers[soundId].bufferState = CD_BS_EMPTY;\n        CDLOGINFO(@\"Denshion::CDSoundEngine - buffer %i successfully unloaded\\n\",soundId);\n        return TRUE;\n    }    \n}    \n\n/**\n * Load buffers asynchronously \n * Check asynchLoadProgress for progress. asynchLoadProgress represents fraction of completion. When it equals 1.0 loading\n * is complete. NB: asynchLoadProgress is simply based on the number of load requests, it does not take into account\n * file sizes.\n * @param An array of CDBufferLoadRequest objects\n */\n- (void) loadBuffersAsynchronously:(NSArray *) loadRequests {\n    @synchronized(self) {\n        asynchLoadProgress_ = 0.0f;\n        CDAsynchBufferLoader *loaderOp = [[[CDAsynchBufferLoader alloc] init:loadRequests soundEngine:self] autorelease];\n        NSOperationQueue *opQ = [[[NSOperationQueue alloc] init] autorelease];\n        [opQ addOperation:loaderOp];\n    }\n}    \n\n-(BOOL) _resizeBuffers:(int) increment {\n    \n    void * tmpBufferInfos = realloc( _buffers, sizeof(_buffers[0]) * (bufferTotal + increment) );\n    \n    if(!tmpBufferInfos) {\n        free(tmpBufferInfos);\n        return NO;\n    } else {\n        _buffers = tmpBufferInfos;\n        int oldBufferTotal = bufferTotal;\n        bufferTotal = bufferTotal + increment;\n        [self _generateBuffers:oldBufferTotal endIndex:bufferTotal-1];\n        return YES;\n    }    \n}    \n\n-(BOOL) loadBufferFromData:(int) soundId soundData:(ALvoid*) soundData format:(ALenum) format size:(ALsizei) size freq:(ALsizei) freq {\n\n    @synchronized(_mutexBufferLoad) {\n        \n        if (!functioning_) {\n            //OpenAL initialisation has previously failed\n            CDLOG(@\"Denshion::CDSoundEngine - Loading buffer failed because sound engine state != functioning\");\n            return FALSE;\n        }\n        \n        //Ensure soundId is within array bounds otherwise memory corruption will occur\n        if (soundId < 0) {\n            CDLOG(@\"Denshion::CDSoundEngine - soundId is negative\");\n            return FALSE;\n        }\n        \n        if (soundId >= bufferTotal) {\n            //Need to resize the buffers\n            int requiredIncrement = CD_BUFFERS_INCREMENT;\n            while (bufferTotal + requiredIncrement < soundId) {\n                requiredIncrement += CD_BUFFERS_INCREMENT;\n            }\n            CDLOGINFO(@\"Denshion::CDSoundEngine - attempting to resize buffers by %i for sound %i\",requiredIncrement,soundId);\n            if (![self _resizeBuffers:requiredIncrement]) {\n                CDLOG(@\"Denshion::CDSoundEngine - buffer resize failed\");\n                return FALSE;\n            }    \n        }    \n        \n        if (soundData)\n        {\n            if (_buffers[soundId].bufferState != CD_BS_EMPTY) {\n                CDLOGINFO(@\"Denshion::CDSoundEngine - non empty buffer, regenerating\");\n                if (![self unloadBuffer:soundId]) {\n                    //Deletion of buffer failed, delete buffer routine has set buffer state and lastErrorCode\n                    return NO;\n                }    \n            }    \n            \n#ifdef CD_DEBUG\n            //Check that sample rate matches mixer rate and warn if they do not\n            if (freq != (int)_mixerSampleRate) {\n                CDLOGINFO(@\"Denshion::CDSoundEngine - WARNING sample rate does not match mixer sample rate performance may not be optimal.\");\n            }    \n#endif        \n            \n#ifdef CD_USE_STATIC_BUFFERS\n            alBufferDataStaticProc(_buffers[soundId].bufferId, format, soundData, size, freq);\n            _buffers[soundId].bufferData = data;//Save the pointer to the new data\n#else        \n            alBufferData(_buffers[soundId].bufferId, format, soundData, size, freq);\n#endif\n            if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) {\n                CDLOG(@\"Denshion::CDSoundEngine -  error attaching audio to buffer: %x\", lastErrorCode_);\n                _buffers[soundId].bufferState = CD_BS_FAILED;\n                return FALSE;\n            } \n        } else {\n            CDLOG(@\"Denshion::CDSoundEngine Buffer data is null!\");\n            _buffers[soundId].bufferState = CD_BS_FAILED;\n            return FALSE;\n        }    \n        \n        _buffers[soundId].format = format;\n        _buffers[soundId].sizeInBytes = size;\n        _buffers[soundId].frequencyInHertz = freq;\n        _buffers[soundId].bufferState = CD_BS_LOADED;\n        CDLOGINFO(@\"Denshion::CDSoundEngine Buffer %i loaded format:%i freq:%i size:%i\",soundId,format,freq,size);\n        return TRUE;\n    }//end mutex\n}    \n\n/**\n * Load sound data for later play back.\n * @return TRUE if buffer loaded okay for play back otherwise false\n */\n- (BOOL) loadBuffer:(int) soundId filePath:(NSString*) filePath\n{\n\n    ALvoid* data;\n    ALenum  format;\n    ALsizei size;\n    ALsizei freq;\n    \n    CDLOGINFO(@\"Denshion::CDSoundEngine - Loading openAL buffer %i %@\", soundId, filePath);\n    \n    CFURLRef fileURL = nil;\n    NSString *path = [CDUtilities fullPathFromRelativePath:filePath];\n    if (path) {\n        fileURL = (CFURLRef)[[NSURL fileURLWithPath:path] retain];\n    }\n\n    if (fileURL)\n    {\n        data = CDGetOpenALAudioData(fileURL, &size, &format, &freq);\n        CFRelease(fileURL);\n        BOOL result = [self loadBufferFromData:soundId soundData:data format:format size:size freq:freq];\n#ifndef CD_USE_STATIC_BUFFERS\n        free(data);//Data can be freed here because alBufferData performs a memcpy        \n#endif\n        return result;\n    } else {\n        CDLOG(@\"Denshion::CDSoundEngine Could not find file!\\n\");\n        //Don't change buffer state here as it will be the same as before method was called    \n        return FALSE;\n    }    \n}\n\n-(BOOL) validateBufferId:(int) soundId {\n    if (soundId < 0 || soundId >= bufferTotal) {\n        CDLOGINFO(@\"Denshion::CDSoundEngine - validateBufferId buffer outside range %i\",soundId);\n        return NO;\n    } else if (_buffers[soundId].bufferState != CD_BS_LOADED) {\n        CDLOGINFO(@\"Denshion::CDSoundEngine - validateBufferId invalide buffer state %i\",soundId);\n        return NO;\n    } else {\n        return YES;\n    }    \n}    \n\n-(float) bufferDurationInSeconds:(int) soundId {\n    if ([self validateBufferId:soundId]) {\n        float factor = 0.0f;\n        switch (_buffers[soundId].format) {\n            case AL_FORMAT_MONO8:\n                factor = 1.0f;\n                break;\n            case AL_FORMAT_MONO16:\n                factor = 0.5f;\n                break;\n            case AL_FORMAT_STEREO8:\n                factor = 0.5f;\n                break;\n            case AL_FORMAT_STEREO16:\n                factor = 0.25f;\n                break;\n        }    \n        return (float)_buffers[soundId].sizeInBytes/(float)_buffers[soundId].frequencyInHertz * factor;\n    } else {\n        return -1.0f;\n    }    \n}    \n\n-(ALsizei) bufferSizeInBytes:(int) soundId {\n    if ([self validateBufferId:soundId]) {\n        return _buffers[soundId].sizeInBytes;\n    } else {\n        return -1.0f;\n    }    \n}    \n\n-(ALsizei) bufferFrequencyInHertz:(int) soundId {\n    if ([self validateBufferId:soundId]) {\n        return _buffers[soundId].frequencyInHertz;\n    } else {\n        return -1.0f;\n    }    \n}    \n\n- (ALfloat) masterGain {\n    if (mute_) {\n        //When mute the real gain will always be 0 therefore return the preMuteGain value\n        return _preMuteGain;\n    } else {    \n        ALfloat gain;\n        alGetListenerf(AL_GAIN, &gain);\n        return gain;\n    }    \n}    \n\n/**\n * Overall gain setting multiplier. e.g 0.5 is half the gain.\n */\n- (void) setMasterGain:(ALfloat) newGainValue {\n    if (mute_) {\n        _preMuteGain = newGainValue;\n    } else {    \n        alListenerf(AL_GAIN, newGainValue);\n    }    \n}\n\n#pragma mark CDSoundEngine AudioInterrupt protocol\n- (BOOL) mute {\n    return mute_;\n}    \n\n/**\n * Setting mute silences all sounds but playing sounds continue to advance playback\n */\n- (void) setMute:(BOOL) newMuteValue {\n    \n    if (newMuteValue == mute_) {\n        return;\n    }\n    \n    mute_ = newMuteValue;\n    if (mute_) {\n        //Remember what the gain was\n        _preMuteGain = self.masterGain;\n        //Set gain to 0 - do not use the property as this will adjust preMuteGain when muted\n        alListenerf(AL_GAIN, 0.0f);\n    } else {\n        //Restore gain to what it was before being muted\n        self.masterGain = _preMuteGain;\n    }    \n}\n\n- (BOOL) enabled {\n    return enabled_;\n}\n\n- (void) setEnabled:(BOOL)enabledValue\n{\n    if (enabled_ == enabledValue) {\n        return;\n    }    \n    enabled_ = enabledValue;\n    if (enabled_ == NO) {\n        [self stopAllSounds];\n    }    \n}    \n\n-(void) _lockSource:(int) sourceIndex lock:(BOOL) lock {\n    BOOL found = NO;\n    for (int i=0; i < _sourceGroupTotal && !found; i++) {\n        if (_sourceGroups[i].sourceStatuses) {\n            for (int j=0; j < _sourceGroups[i].totalSources && !found; j++) {\n                //First bit is used to indicate whether source is locked, index is shifted back 1 bit\n                if((_sourceGroups[i].sourceStatuses[j] >> 1)==sourceIndex) {\n                    if (lock) {\n                        //Set first bit to lock this source\n                        _sourceGroups[i].sourceStatuses[j] |= 1;\n                    } else {\n                        //Unset first bit to unlock this source\n                        _sourceGroups[i].sourceStatuses[j] &= ~1; \n                    }    \n                    found = YES;\n                }    \n            }    \n        }    \n    }\n}    \n\n-(int) _getSourceIndexForSourceGroup:(int)sourceGroupId \n{\n    //Ensure source group id is valid to prevent memory corruption\n    if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine invalid source group id %i\",sourceGroupId);\n        return CD_NO_SOURCE;\n    }    \n\n    int sourceIndex = -1;//Using -1 to indicate no source found\n    BOOL complete = NO;\n    ALint sourceState = 0;\n    sourceGroup *thisSourceGroup = &_sourceGroups[sourceGroupId];\n    thisSourceGroup->currentIndex = thisSourceGroup->startIndex;\n    while (!complete) {\n        //Iterate over sources looking for one that is not locked, first bit indicates if source is locked\n        if ((thisSourceGroup->sourceStatuses[thisSourceGroup->currentIndex] & 1) == 0) {\n            //This source is not locked\n            sourceIndex = thisSourceGroup->sourceStatuses[thisSourceGroup->currentIndex] >> 1;//shift back to get the index\n            if (thisSourceGroup->nonInterruptible) {\n                //Check if this source is playing, if so it can't be interrupted\n                alGetSourcei(_sources[sourceIndex].sourceId, AL_SOURCE_STATE, &sourceState);\n                if (sourceState != AL_PLAYING) {\n                    //complete = YES;\n                    //Set start index so next search starts at the next position\n                    thisSourceGroup->startIndex = thisSourceGroup->currentIndex + 1;\n                    break;\n                } else {\n                    sourceIndex = -1;//The source index was no good because the source was playing\n                }    \n            } else {    \n                //complete = YES;\n                //Set start index so next search starts at the next position\n                thisSourceGroup->startIndex = thisSourceGroup->currentIndex + 1;\n                break;\n            }    \n        }\n        thisSourceGroup->currentIndex++;\n        if (thisSourceGroup->currentIndex >= thisSourceGroup->totalSources) {\n            //Reset to the beginning\n            thisSourceGroup->currentIndex = 0;    \n        }    \n        if (thisSourceGroup->currentIndex == thisSourceGroup->startIndex) {\n            //We have looped around and got back to the start\n            complete = YES;\n        }    \n    }\n\n    //Reset start index to beginning if beyond bounds\n    if (thisSourceGroup->startIndex >= thisSourceGroup->totalSources) {\n        thisSourceGroup->startIndex = 0;    \n    }    \n    \n    if (sourceIndex >= 0) {\n        return sourceIndex;\n    } else {    \n        return CD_NO_SOURCE;\n    }    \n    \n}    \n\n/**\n * Play a sound.\n * @param soundId the id of the sound to play (buffer id).\n * @param SourceGroupId the source group that will be used to play the sound.\n * @param pitch pitch multiplier. e.g 1.0 is unaltered, 0.5 is 1 octave lower. \n * @param pan stereo position. -1 is fully left, 0 is centre and 1 is fully right.\n * @param gain gain multiplier. e.g. 1.0 is unaltered, 0.5 is half the gain\n * @param loop should the sound be looped or one shot.\n * @return the id of the source being used to play the sound or CD_MUTE if the sound engine is muted or non functioning \n * or CD_NO_SOURCE if a problem occurs setting up the source\n * \n */\n- (ALuint)playSound:(int) soundId sourceGroupId:(int)sourceGroupId pitch:(float) pitch pan:(float) pan gain:(float) gain loop:(BOOL) loop {\n\n#ifdef CD_DEBUG\n    //Sanity check parameters - only in DEBUG\n    NSAssert(soundId >= 0, @\"soundId can not be negative\");\n    NSAssert(soundId < bufferTotal, @\"soundId exceeds limit\");\n    NSAssert(sourceGroupId >= 0, @\"sourceGroupId can not be negative\");\n    NSAssert(sourceGroupId < _sourceGroupTotal, @\"sourceGroupId exceeds limit\");\n    NSAssert(pitch > 0, @\"pitch must be greater than zero\");\n    NSAssert(pan >= -1 && pan <= 1, @\"pan must be between -1 and 1\");\n    NSAssert(gain >= 0, @\"gain can not be negative\");\n#endif\n    //If mute or initialisation has failed or buffer is not loaded then do nothing\n    if (!enabled_ || !functioning_ || _buffers[soundId].bufferState != CD_BS_LOADED || _sourceGroups[sourceGroupId].enabled) {\n#ifdef CD_DEBUG\n        if (!functioning_) {\n            CDLOGINFO(@\"Denshion::CDSoundEngine - sound playback aborted because sound engine is not functioning\");\n        } else if (_buffers[soundId].bufferState != CD_BS_LOADED) {\n            CDLOGINFO(@\"Denshion::CDSoundEngine - sound playback aborted because buffer %i is not loaded\", soundId);\n        }    \n#endif        \n        return CD_MUTE;\n    }    \n\n    int sourceIndex = [self _getSourceIndexForSourceGroup:sourceGroupId];//This method ensures sourceIndex is valid\n    \n    if (sourceIndex != CD_NO_SOURCE) {\n        ALint state;\n        ALuint source = _sources[sourceIndex].sourceId;\n        ALuint buffer = _buffers[soundId].bufferId;\n        alGetError();//Clear the error code    \n        alGetSourcei(source, AL_SOURCE_STATE, &state);\n        if (state == AL_PLAYING) {\n            alSourceStop(source);\n        }    \n        alSourcei(source, AL_BUFFER, buffer);//Attach to sound\n        alSourcef(source, AL_PITCH, pitch);//Set pitch\n        alSourcei(source, AL_LOOPING, loop);//Set looping\n        alSourcef(source, AL_GAIN, gain);//Set gain/volume\n        float sourcePosAL[] = {pan, 0.0f, 0.0f};//Set position - just using left and right panning\n        alSourcefv(source, AL_POSITION, sourcePosAL);\n        alGetError();//Clear the error code\n        alSourcePlay(source);\n        if((lastErrorCode_ = alGetError()) == AL_NO_ERROR) {\n            //Everything was okay\n            _sources[sourceIndex].attachedBufferId = buffer;\n            return source;\n        } else {\n            if (alcGetCurrentContext() == NULL) {\n                CDLOGINFO(@\"Denshion::CDSoundEngine - posting bad OpenAL context message\");\n                [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_BadAlContext object:nil];\n            }                \n            return CD_NO_SOURCE;\n        }    \n    } else {    \n        return CD_NO_SOURCE;\n    }    \n}\n\n-(BOOL) _soundSourceAttachToBuffer:(CDSoundSource*) soundSource soundId:(int) soundId  {\n    //Attach the source to the buffer\n    ALint state;\n    ALuint source = soundSource->_sourceId;\n    ALuint buffer = _buffers[soundId].bufferId;\n    alGetSourcei(source, AL_SOURCE_STATE, &state);\n    if (state == AL_PLAYING) {\n        alSourceStop(source);\n    }\n    alGetError();//Clear the error code    \n    alSourcei(source, AL_BUFFER, buffer);//Attach to sound data\n    if((lastErrorCode_ = alGetError()) == AL_NO_ERROR) {\n        _sources[soundSource->_sourceIndex].attachedBufferId = buffer;\n        //_sourceBufferAttachments[soundSource->_sourceIndex] = buffer;//Keep track of which\n        soundSource->_soundId = soundId;\n        return YES;\n    } else {\n        return NO;\n    }    \n}    \n\n/**\n * Get a sound source for the specified sound in the specified source group\n */\n-(CDSoundSource *) soundSourceForSound:(int) soundId sourceGroupId:(int) sourceGroupId \n{\n    if (!functioning_) {\n        return nil;\n    }    \n    //Check if a source is available\n    int sourceIndex = [self _getSourceIndexForSourceGroup:sourceGroupId];\n    if (sourceIndex != CD_NO_SOURCE) { \n        CDSoundSource *result = [[CDSoundSource alloc] init:_sources[sourceIndex].sourceId sourceIndex:sourceIndex soundEngine:self];\n        [self _lockSource:sourceIndex lock:YES];\n        //Try to attach to the buffer\n        if ([self _soundSourceAttachToBuffer:result soundId:soundId]) {\n            //Set to a known state\n            result.pitch = 1.0f;\n            result.pan = 0.0f;\n            result.gain = 1.0f;\n            result.looping = NO;\n            return [result autorelease];\n        } else {\n            //Release the sound source we just created, this will also unlock the source\n            [result release];\n            return nil;\n        }    \n    } else {\n        //No available source within that source group\n        return nil;\n    }\n}    \n\n-(void) _soundSourcePreRelease:(CDSoundSource *) soundSource {\n    CDLOGINFO(@\"Denshion::CDSoundEngine _soundSourcePreRelease %i\",soundSource->_sourceIndex);\n    //Unlock the sound source's source\n    [self _lockSource:soundSource->_sourceIndex lock:NO];\n}    \n\n/**\n * Stop all sounds playing within a source group\n */\n- (void) stopSourceGroup:(int) sourceGroupId {\n    \n    if (!functioning_ || sourceGroupId >= _sourceGroupTotal || sourceGroupId < 0) {\n        return;\n    }    \n    int sourceCount = _sourceGroups[sourceGroupId].totalSources;\n    for (int i=0; i < sourceCount; i++) {\n        int sourceIndex = _sourceGroups[sourceGroupId].sourceStatuses[i] >> 1;\n        alSourceStop(_sources[sourceIndex].sourceId);\n    }\n    alGetError();//Clear error in case we stopped any sounds that couldn't be stopped\n}    \n\n/**\n * Stop a sound playing.\n * @param sourceId an OpenAL source identifier i.e. the return value of playSound\n */\n- (void)stopSound:(ALuint) sourceId {\n    if (!functioning_) {\n        return;\n    }    \n    alSourceStop(sourceId);\n    alGetError();//Clear error in case we stopped any sounds that couldn't be stopped\n}\n\n- (void) stopAllSounds {\n    for (int i=0; i < sourceTotal_; i++) {\n        alSourceStop(_sources[i].sourceId);\n    }    \n    alGetError();//Clear error in case we stopped any sounds that couldn't be stopped\n}    \n\n- (void) pauseSound:(ALuint) sourceId {\n  if (!functioning_) {\n      return;\n  }\n  alSourcePause(sourceId);\n  alGetError();//Clear error in case we pause any sounds that couldn't be paused\n}\n\n- (void) pauseAllSounds {\n  for (int i = 0; i < sourceTotal_; i++) {\n      [self pauseSound:_sources[i].sourceId];\n  }\n  alGetError();//Clear error in case we stopped any sounds that couldn't be paused\n}\n\n- (void) resumeSound:(ALuint) soundId {\n  if (!functioning_) {\n    return;\n  }\n  \n    // only resume a sound id that is paused\n    ALint state;\n    alGetSourcei(soundId, AL_SOURCE_STATE, &state);\n    if (state != AL_PAUSED)\n    {\n        return;\n    }\n        \n  alSourcePlay(soundId);\n  alGetError();//Clear error in case we stopped any sounds that couldn't be resumed\n}\n\n- (void) resumeAllSounds {\n  for (int i = 0; i < sourceTotal_; i++) {\n      [self resumeSound:_sources[i].sourceId];\n  }\n  alGetError();//Clear error in case we stopped any sounds that couldn't be resumed\n}\n\n/**\n * Set a source group as non interruptible.  Default is that source groups are interruptible.\n * Non interruptible means that if a request to play a sound is made for a source group and there are\n * no free sources available then the play request will be ignored and CD_NO_SOURCE will be returned.\n */\n- (void) setSourceGroupNonInterruptible:(int) sourceGroupId isNonInterruptible:(BOOL) isNonInterruptible {\n    //Ensure source group id is valid to prevent memory corruption\n    if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine setSourceGroupNonInterruptible invalid source group id %i\",sourceGroupId);\n        return;\n    }    \n    \n    if (isNonInterruptible) {\n        _sourceGroups[sourceGroupId].nonInterruptible = true;\n    } else {\n        _sourceGroups[sourceGroupId].nonInterruptible = false;\n    }    \n}\n\n/**\n * Set the mute property for a source group. If mute is turned on any sounds in that source group\n * will be stopped and further sounds in that source group will play. However, turning mute off\n * will not restart any sounds that were playing when mute was turned on. Also the mute setting \n * for the sound engine must be taken into account. If the sound engine is mute no sounds will play\n * no matter what the source group mute setting is.\n */\n- (void) setSourceGroupEnabled:(int) sourceGroupId enabled:(BOOL) enabled {\n    //Ensure source group id is valid to prevent memory corruption\n    if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) {\n        CDLOG(@\"Denshion::CDSoundEngine setSourceGroupEnabled invalid source group id %i\",sourceGroupId);\n        return;\n    }    \n    \n    if (enabled) {\n        _sourceGroups[sourceGroupId].enabled = true;\n        [self stopSourceGroup:sourceGroupId];\n    } else {\n        _sourceGroups[sourceGroupId].enabled = false;    \n    }    \n}\n\n/**\n * Return the mute property for the source group identified by sourceGroupId\n */\n- (BOOL) sourceGroupEnabled:(int) sourceGroupId {\n    return _sourceGroups[sourceGroupId].enabled;\n}\n\n-(ALCcontext *) openALContext {\n    return context;\n}    \n\n- (void) _dumpSourceGroupsInfo {\n#ifdef CD_DEBUG    \n    CDLOGINFO(@\"-------------- source Group Info --------------\");\n    for (int i=0; i < _sourceGroupTotal; i++) {\n        CDLOGINFO(@\"Group: %i start:%i total:%i\",i,_sourceGroups[i].startIndex, _sourceGroups[i].totalSources);\n        CDLOGINFO(@\"----- mute:%i nonInterruptible:%i\",_sourceGroups[i].enabled, _sourceGroups[i].nonInterruptible);\n        CDLOGINFO(@\"----- Source statuses ----\");\n        for (int j=0; j < _sourceGroups[i].totalSources; j++) {\n            CDLOGINFO(@\"Source status:%i index=%i locked=%i\",j,_sourceGroups[i].sourceStatuses[j] >> 1, _sourceGroups[i].sourceStatuses[j] & 1);\n        }    \n    }    \n#endif    \n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n@implementation CDSoundSource\n\n@synthesize lastError;\n\n//Macro for handling the al error code\n#define CDSOUNDSOURCE_UPDATE_LAST_ERROR (lastError = alGetError())\n#define CDSOUNDSOURCE_ERROR_HANDLER ( CDSOUNDSOURCE_UPDATE_LAST_ERROR == AL_NO_ERROR)\n\n-(id)init:(ALuint) theSourceId sourceIndex:(int) index soundEngine:(CDSoundEngine*) engine {\n    if ((self = [super init])) {\n        _sourceId = theSourceId;\n        _engine = engine;\n        _sourceIndex = index;\n        enabled_ = YES;\n        mute_ = NO;\n        _preMuteGain = self.gain;\n    } \n    return self;\n}\n\n-(void) dealloc\n{\n    CDLOGINFO(@\"Denshion::CDSoundSource deallocated %i\",self->_sourceIndex);\n\n    //Notify sound engine we are about to release\n    [_engine _soundSourcePreRelease:self];\n    [super dealloc];\n}    \n\n- (void) setPitch:(float) newPitchValue {\n    alSourcef(_sourceId, AL_PITCH, newPitchValue);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n}    \n\n- (void) setGain:(float) newGainValue {\n    if (!mute_) {\n        alSourcef(_sourceId, AL_GAIN, newGainValue);    \n    } else {\n        _preMuteGain = newGainValue;\n    }    \n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n}\n\n- (void) setPan:(float) newPanValue {\n    float sourcePosAL[] = {newPanValue, 0.0f, 0.0f};//Set position - just using left and right panning\n    alSourcefv(_sourceId, AL_POSITION, sourcePosAL);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n\n}\n\n- (void) setLooping:(BOOL) newLoopingValue {\n    alSourcei(_sourceId, AL_LOOPING, newLoopingValue);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n\n}\n\n- (BOOL) isPlaying {\n    ALint state;\n    alGetSourcei(_sourceId, AL_SOURCE_STATE, &state);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return (state == AL_PLAYING);\n}    \n\n- (float) pitch {\n    ALfloat pitchVal;\n    alGetSourcef(_sourceId, AL_PITCH, &pitchVal);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return pitchVal;\n}\n\n- (float) pan {\n    ALfloat sourcePosAL[] = {0.0f,0.0f,0.0f};\n    alGetSourcefv(_sourceId, AL_POSITION, sourcePosAL);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return sourcePosAL[0];\n}\n\n- (float) gain {\n    if (!mute_) {\n        ALfloat val;\n        alGetSourcef(_sourceId, AL_GAIN, &val);\n        CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n        return val;\n    } else {\n        return _preMuteGain;\n    }    \n}    \n\n- (BOOL) looping {\n    ALfloat val;\n    alGetSourcef(_sourceId, AL_LOOPING, &val);\n    CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n    return val;\n}\n\n-(BOOL) stop {\n    alSourceStop(_sourceId);\n    return CDSOUNDSOURCE_ERROR_HANDLER;\n}    \n\n-(BOOL) play {\n    if (enabled_) {\n        alSourcePlay(_sourceId);\n        CDSOUNDSOURCE_UPDATE_LAST_ERROR;\n        if (lastError != AL_NO_ERROR) {\n            if (alcGetCurrentContext() == NULL) {\n                CDLOGINFO(@\"Denshion::CDSoundSource - posting bad OpenAL context message\");\n                [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_BadAlContext object:nil];\n            }    \n            return NO;\n        } else {\n            return YES;\n        }    \n    } else {\n        return NO;\n    }\n}    \n\n-(BOOL) pause {\n    alSourcePause(_sourceId);\n    return CDSOUNDSOURCE_ERROR_HANDLER;\n}\n\n-(BOOL) rewind {\n    alSourceRewind(_sourceId);\n    return CDSOUNDSOURCE_ERROR_HANDLER;\n}\n\n-(void) setSoundId:(int) soundId {\n    [_engine _soundSourceAttachToBuffer:self soundId:soundId];\n}\n\n-(int) soundId {\n    return _soundId;\n}    \n\n-(float) durationInSeconds {\n    return [_engine bufferDurationInSeconds:_soundId];\n}    \n\n#pragma mark CDSoundSource AudioInterrupt protocol\n- (BOOL) mute {\n    return mute_;\n}    \n\n/**\n * Setting mute silences all sounds but playing sounds continue to advance playback\n */\n- (void) setMute:(BOOL) newMuteValue {\n    \n    if (newMuteValue == mute_) {\n        return;\n    }\n    \n    if (newMuteValue) {\n        //Remember what the gain was\n        _preMuteGain = self.gain;\n        self.gain = 0.0f;\n        mute_ = newMuteValue;//Make sure this is done after setting the gain property as the setter behaves differently depending on mute value\n    } else {\n        //Restore gain to what it was before being muted\n        mute_ = newMuteValue;\n        self.gain = _preMuteGain;\n    }    \n}\n\n- (BOOL) enabled {\n    return enabled_;\n}\n\n- (void) setEnabled:(BOOL)enabledValue\n{\n    if (enabled_ == enabledValue) {\n        return;\n    }    \n    enabled_ = enabledValue;\n    if (enabled_ == NO) {\n        [self stop];\n    }    \n}    \n\n@end\n\n////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDAudioInterruptTargetGroup\n\n@implementation CDAudioInterruptTargetGroup\n\n-(id) init {\n    if ((self = [super init])) {\n        children_ = [[NSMutableArray alloc] initWithCapacity:32];\n        enabled_ = YES;\n        mute_ = NO;\n    }\n    return self;\n}    \n\n-(void) addAudioInterruptTarget:(NSObject<CDAudioInterruptProtocol>*) interruptibleTarget {\n    //Synchronize child with group settings;\n    [interruptibleTarget setMute:mute_];\n    [interruptibleTarget setEnabled:enabled_];\n    [children_ addObject:interruptibleTarget];\n}    \n\n-(void) removeAudioInterruptTarget:(NSObject<CDAudioInterruptProtocol>*) interruptibleTarget {\n    [children_ removeObjectIdenticalTo:interruptibleTarget];\n}    \n\n- (BOOL) mute {\n    return mute_;\n}    \n\n/**\n * Setting mute silences all sounds but playing sounds continue to advance playback\n */\n- (void) setMute:(BOOL) newMuteValue {\n    \n    if (newMuteValue == mute_) {\n        return;\n    }\n    \n    for (NSObject<CDAudioInterruptProtocol>* target in children_) {\n        [target setMute:newMuteValue];\n    }    \n}\n\n- (BOOL) enabled {\n    return enabled_;\n}\n\n- (void) setEnabled:(BOOL)enabledValue\n{\n    if (enabledValue == enabled_) {\n        return;\n    }\n    \n    for (NSObject<CDAudioInterruptProtocol>* target in children_) {\n        [target setEnabled:enabledValue];\n    }    \n}    \n\n@end\n\n\n\n////////////////////////////////////////////////////////////////////////////\n\n#pragma mark -\n#pragma mark CDAsynchBufferLoader\n\n@implementation CDAsynchBufferLoader\n\n-(id) init:(NSArray *)loadRequests soundEngine:(CDSoundEngine *) theSoundEngine {\n    if ((self = [super init])) {\n        _loadRequests = loadRequests;\n        [_loadRequests retain];\n        _soundEngine = theSoundEngine;\n        [_soundEngine retain];\n    } \n    return self;\n}    \n\n-(void) main {\n    CDLOGINFO(@\"Denshion::CDAsynchBufferLoader - loading buffers\");\n    [super main];\n    _soundEngine.asynchLoadProgress = 0.0f;\n\n    if ([_loadRequests count] > 0) {\n        float increment = 1.0f / [_loadRequests count];\n        //Iterate over load request and load\n        for (CDBufferLoadRequest *loadRequest in _loadRequests) {\n            [_soundEngine loadBuffer:loadRequest.soundId filePath:loadRequest.filePath];\n            _soundEngine.asynchLoadProgress += increment;\n        }    \n    }    \n    \n    //Completed\n    _soundEngine.asynchLoadProgress = 1.0f;\n    [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_AsynchLoadComplete object:nil];\n    \n}    \n\n-(void) dealloc {\n    [_loadRequests release];\n    [_soundEngine release];\n    [super dealloc];\n}    \n\n@end\n\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDBufferLoadRequest\n\n@implementation CDBufferLoadRequest\n\n@synthesize filePath, soundId;\n\n-(id) init:(int) theSoundId filePath:(const NSString *) theFilePath {\n\tif ((self = [super init])) {\n\t\tsoundId = theSoundId;\n\t\tfilePath = [theFilePath copy];\n\t}\n\treturn self;\n}\n\n-(void) dealloc {\n    [filePath release];\n    [super dealloc];\n}\n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDFloatInterpolator\n\n@implementation CDFloatInterpolator\n@synthesize start,end,interpolationType;\n\n-(float) interpolate:(float) t {\n    \n    if (t < 1.0f) {\n        switch (interpolationType) {\n            case kIT_Linear:\n                //Linear interpolation\n                return ((end - start) * t) + start;\n                \n            case kIT_SCurve:\n                //Cubic s curve t^2 * (3 - 2t)\n                return ((float)(t * t * (3.0 - (2.0 * t))) * (end - start)) + start;\n                \n            case kIT_Exponential:    \n                //Formulas taken from EaseAction\n                if (end > start) {\n                    //Fade in\n                    float logDelta = (t==0) ? 0 : powf(2, 10 * (t/1 - 1)) - 1 * 0.001f;\n                    return ((end - start) * logDelta) + start;\n                } else {\n                    //Fade Out\n                    float logDelta = (-powf(2, -10 * t/1) + 1);\n                    return ((end - start) * logDelta) + start;\n                }\n            default:\n                return 0.0f;\n        }\n    } else {\n        return end;\n    } \n}\n\n-(id) init:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal {\n    if ((self = [super init])) {\n        start = startVal;\n        end = endVal;\n        interpolationType = type;\n    } \n    return self;\n}\n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDPropertyModifier\n\n@implementation CDPropertyModifier\n\n@synthesize stopTargetWhenComplete;\n\n-(id) init:(id) theTarget interpolationType:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal {\n    if ((self = [super init])) {\n        if (target) {\n            //Release the previous target if there is one\n            [target release];\n        }    \n        target = theTarget;\n#if CD_DEBUG\n        //Check target is of the required type\n        if (![theTarget isMemberOfClass:[self _allowableType]] ) {\n            CDLOG(@\"Denshion::CDPropertyModifier target is not of type %@\",[self _allowableType]);\n            NSAssert([theTarget isKindOfClass:[CDSoundEngine class]], @\"CDPropertyModifier target not of required type\");\n        }\n#endif        \n        [target retain];\n        startValue = startVal;\n        endValue = endVal;\n        if (interpolator) {\n            //Release previous interpolator if there is one\n            [interpolator release];\n        }    \n        interpolator = [[CDFloatInterpolator alloc] init:type startVal:startVal endVal:endVal];\n        stopTargetWhenComplete = NO;\n    }\n    return self;\n}    \n\n-(void) dealloc {\n    CDLOGINFO(@\"Denshion::CDPropertyModifier deallocated %@\",self);\n    [target release];\n    [interpolator release];\n    [super dealloc];\n}    \n\n-(void) modify:(float) t {\n    if (t < 1.0) {\n        [self _setTargetProperty:[interpolator interpolate:t]];\n    } else {\n        //At the end\n        [self _setTargetProperty:endValue];\n        if (stopTargetWhenComplete) {\n            [self _stopTarget];\n        }    \n    }    \n}    \n\n-(float) startValue {\n    return startValue;\n}\n\n-(void) setStartValue:(float) startVal\n{\n    startValue = startVal;\n    interpolator.start = startVal;\n}    \n\n-(float) endValue {\n    return startValue;\n}\n\n-(void) setEndValue:(float) endVal\n{\n    endValue = endVal;\n    interpolator.end = endVal;\n}    \n\n-(tCDInterpolationType) interpolationType {\n    return interpolator.interpolationType;\n}\n\n-(void) setInterpolationType:(tCDInterpolationType) interpolationType {\n    interpolator.interpolationType = interpolationType;\n}    \n\n-(void) _setTargetProperty:(float) newVal {\n\n}    \n\n-(float) _getTargetProperty {\n    return 0.0f;\n}    \n\n-(void) _stopTarget {\n\n}    \n\n-(Class) _allowableType {\n    return [NSObject class];\n}    \n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDSoundSourceFader\n\n@implementation CDSoundSourceFader\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundSource*)target).gain = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundSource*)target).gain;\n}\n\n-(void) _stopTarget {\n    [((CDSoundSource*)target) stop];\n}\n\n-(Class) _allowableType {\n    return [CDSoundSource class];\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDSoundSourcePanner\n\n@implementation CDSoundSourcePanner\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundSource*)target).pan = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundSource*)target).pan;\n}\n\n-(void) _stopTarget {\n    [((CDSoundSource*)target) stop];\n}\n\n-(Class) _allowableType {\n    return [CDSoundSource class];\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDSoundSourcePitchBender\n\n@implementation CDSoundSourcePitchBender\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundSource*)target).pitch = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundSource*)target).pitch;\n}\n\n-(void) _stopTarget {\n    [((CDSoundSource*)target) stop];\n}\n\n-(Class) _allowableType {\n    return [CDSoundSource class];\n}    \n\n@end\n\n///////////////////////////////////////////////////////////////////////////////////////\n#pragma mark -\n#pragma mark CDSoundEngineFader\n\n@implementation CDSoundEngineFader\n\n-(void) _setTargetProperty:(float) newVal {\n    ((CDSoundEngine*)target).masterGain = newVal;\n}    \n\n-(float) _getTargetProperty {\n    return ((CDSoundEngine*)target).masterGain;\n}\n\n-(void) _stopTarget {\n    [((CDSoundEngine*)target) stopAllSounds];\n}\n\n-(Class) _allowableType {\n    return [CDSoundEngine class];\n}    \n\n@end\n\n\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/SimpleAudioEngine.mm",
    "content": "/****************************************************************************\nCopyright (c) 2010 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"SimpleAudioEngine.h\"\n#include \"SimpleAudioEngine_objc.h\"\n#include <string>\n\n#include \"CCFileUtils.h\"\nusing namespace cocos2d;\n\nstatic void static_end()\n{\n    [SimpleAudioEngine  end];\n}\n\nstatic void static_preloadBackgroundMusic(const char* pszFilePath)\n{\n    [[SimpleAudioEngine sharedEngine] preloadBackgroundMusic: [NSString stringWithUTF8String: pszFilePath]];\n}\n\nstatic void static_playBackgroundMusic(const char* pszFilePath, bool bLoop)\n{\n    [[SimpleAudioEngine sharedEngine] playBackgroundMusic: [NSString stringWithUTF8String: pszFilePath] loop: bLoop];\n}\n\nstatic void static_stopBackgroundMusic()\n{\n    [[SimpleAudioEngine sharedEngine] stopBackgroundMusic];\n}\n\nstatic void static_pauseBackgroundMusic()\n{\n     [[SimpleAudioEngine sharedEngine] pauseBackgroundMusic];\n}\n\nstatic void static_resumeBackgroundMusic()\n{\n    [[SimpleAudioEngine sharedEngine] resumeBackgroundMusic];\n} \n\nstatic void static_rewindBackgroundMusic()\n{\n    [[SimpleAudioEngine sharedEngine] rewindBackgroundMusic];\n}\n\nstatic bool static_willPlayBackgroundMusic()\n{\n    return [[SimpleAudioEngine sharedEngine] willPlayBackgroundMusic];\n}\n\nstatic bool static_isBackgroundMusicPlaying()\n{\n    return [[SimpleAudioEngine sharedEngine] isBackgroundMusicPlaying];\n}\n\nstatic float static_getBackgroundMusicVolume()\n{\n    return [[SimpleAudioEngine sharedEngine] backgroundMusicVolume];\n}\n\nstatic void static_setBackgroundMusicVolume(float volume)\n{\n    volume = MAX( MIN(volume, 1.0), 0 );\n    [SimpleAudioEngine sharedEngine].backgroundMusicVolume = volume;\n}\n     \nstatic float static_getEffectsVolume()\n{\n    return [[SimpleAudioEngine sharedEngine] effectsVolume];\n}\n     \nstatic void static_setEffectsVolume(float volume)\n{\n    volume = MAX( MIN(volume, 1.0), 0 );\n    [SimpleAudioEngine sharedEngine].effectsVolume = volume;\n}\n\nstatic unsigned int static_playEffect(const char* pszFilePath, bool bLoop, Float32 pszPitch, Float32 pszPan, Float32 pszGain)\n{\n    return [[SimpleAudioEngine sharedEngine] playEffect:[NSString stringWithUTF8String: pszFilePath] loop:bLoop pitch:pszPitch pan: pszPan gain:pszGain ];\n}\n     \nstatic void static_stopEffect(int nSoundId)\n{\n    [[SimpleAudioEngine sharedEngine] stopEffect: nSoundId];\n}\n     \nstatic void static_preloadEffect(const char* pszFilePath)\n{\n    [[SimpleAudioEngine sharedEngine] preloadEffect: [NSString stringWithUTF8String: pszFilePath]];\n}\n     \nstatic void static_unloadEffect(const char* pszFilePath)\n{\n    [[SimpleAudioEngine sharedEngine] unloadEffect: [NSString stringWithUTF8String: pszFilePath]];\n}\n\nstatic void static_pauseEffect(unsigned int uSoundId)\n{\n    [[SimpleAudioEngine sharedEngine] pauseEffect: uSoundId];\n}\n\nstatic void static_pauseAllEffects()\n{\n    [[SimpleAudioEngine sharedEngine] pauseAllEffects];\n}\n\nstatic void static_resumeEffect(unsigned int uSoundId)\n{\n    [[SimpleAudioEngine sharedEngine] resumeEffect: uSoundId];\n}\n\nstatic void static_resumeAllEffects()\n{\n    [[SimpleAudioEngine sharedEngine] resumeAllEffects];\n}\n\nstatic void static_stopAllEffects()\n{\n    [[SimpleAudioEngine sharedEngine] stopAllEffects];\n}\n\nnamespace CocosDenshion {\n\nstatic SimpleAudioEngine *s_pEngine;\n\nSimpleAudioEngine::SimpleAudioEngine()\n{\n\n}\n\nSimpleAudioEngine::~SimpleAudioEngine()\n{\n\n}\n\nSimpleAudioEngine* SimpleAudioEngine::getInstance()\n{\n    if (! s_pEngine)\n    {\n        s_pEngine = new SimpleAudioEngine();\n    }\n    \n    return s_pEngine;\n}\n\nvoid SimpleAudioEngine::end()\n{\n    if (s_pEngine)\n    {\n        delete s_pEngine;\n        s_pEngine = NULL;\n    }\n    \n    static_end();\n}\n\nvoid SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_preloadBackgroundMusic(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_playBackgroundMusic(fullPath.c_str(), bLoop);\n}\n\nvoid SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)\n{\n    static_stopBackgroundMusic();\n}\n\nvoid SimpleAudioEngine::pauseBackgroundMusic()\n{\n    static_pauseBackgroundMusic();\n}\n\nvoid SimpleAudioEngine::resumeBackgroundMusic()\n{\n    static_resumeBackgroundMusic();\n} \n\nvoid SimpleAudioEngine::rewindBackgroundMusic()\n{\n    static_rewindBackgroundMusic();\n}\n\nbool SimpleAudioEngine::willPlayBackgroundMusic()\n{\n    return static_willPlayBackgroundMusic();\n}\n\nbool SimpleAudioEngine::isBackgroundMusicPlaying()\n{\n    return static_isBackgroundMusicPlaying();\n}\n\nfloat SimpleAudioEngine::getBackgroundMusicVolume()\n{\n    return static_getBackgroundMusicVolume();\n}\n\nvoid SimpleAudioEngine::setBackgroundMusicVolume(float volume)\n{\n    static_setBackgroundMusicVolume(volume);\n}\n\nfloat SimpleAudioEngine::getEffectsVolume()\n{\n    return static_getEffectsVolume();\n}\n\nvoid SimpleAudioEngine::setEffectsVolume(float volume)\n{\n    static_setEffectsVolume(volume);\n}\n\nunsigned int SimpleAudioEngine::playEffect(const char *pszFilePath, bool bLoop,\n                                           float pitch, float pan, float gain)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    return static_playEffect(fullPath.c_str(), bLoop, pitch, pan, gain);\n}\n\nvoid SimpleAudioEngine::stopEffect(unsigned int nSoundId)\n{\n    static_stopEffect(nSoundId);\n}\n\nvoid SimpleAudioEngine::preloadEffect(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_preloadEffect(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::unloadEffect(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n    static_unloadEffect(fullPath.c_str());\n}\n\nvoid SimpleAudioEngine::pauseEffect(unsigned int uSoundId)\n{\n    static_pauseEffect(uSoundId);\n}\n\nvoid SimpleAudioEngine::resumeEffect(unsigned int uSoundId)\n{\n    static_resumeEffect(uSoundId);\n}\n\nvoid SimpleAudioEngine::pauseAllEffects()\n{\n    static_pauseAllEffects();\n}\n\nvoid SimpleAudioEngine::resumeAllEffects()\n{\n    static_resumeAllEffects();\n}\n\nvoid SimpleAudioEngine::stopAllEffects()\n{\n    static_stopAllEffects();\n}\n}\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/SimpleAudioEngine_objc.h",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n\n#import \"CDAudioManager.h\"\n\n/**\n A wrapper to the CDAudioManager object.\n This is recommended for basic audio requirements. If you just want to play some sound fx\n and some background music and have no interest in learning the lower level workings then\n this is the interface to use.\n \n Requirements:\n - Firmware: OS 2.2 or greater \n - Files: SimpleAudioEngine.*, CocosDenshion.*\n - Frameworks: OpenAL, AudioToolbox, AVFoundation\n @since v0.8\n */\n@interface SimpleAudioEngine : NSObject <CDAudioInterruptProtocol> {\n    \n    BOOL    mute_;\n    BOOL    enabled_;\n}\n\n/** Background music volume. Range is 0.0f to 1.0f. This will only have an effect if willPlayBackgroundMusic returns YES */\n@property (readwrite) float backgroundMusicVolume;\n/** Effects volume. Range is 0.0f to 1.0f */\n@property (readwrite) float effectsVolume;\n/** If NO it indicates background music will not be played either because no background music is loaded or the audio session does not permit it.*/\n@property (readonly) BOOL willPlayBackgroundMusic;\n\n/** returns the shared instance of the SimpleAudioEngine object */\n+ (SimpleAudioEngine*) sharedEngine;\n\n/** Preloads a music file so it will be ready to play as background music */\n-(void) preloadBackgroundMusic:(NSString*) filePath;\n\n/** plays background music in a loop*/\n-(void) playBackgroundMusic:(NSString*) filePath;\n/** plays background music, if loop is true the music will repeat otherwise it will be played once */\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop;\n/** stops playing background music */\n-(void) stopBackgroundMusic;\n/** pauses the background music */\n-(void) pauseBackgroundMusic;\n/** resume background music that has been paused */\n-(void) resumeBackgroundMusic;\n/** rewind the background music */\n-(void) rewindBackgroundMusic;\n/** returns whether or not the background music is playing */\n-(BOOL) isBackgroundMusicPlaying;\n\n/** plays an audio effect with a file path*/\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL) loop;\n/** stop a sound that is playing, note you must pass in the soundId that is returned when you started playing the sound with playEffect */\n-(void) stopEffect:(ALuint) soundId;\n/** plays an audio effect with a file path, pitch, pan and gain */\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL)loop pitch:(Float32) pitch pan:(Float32) pan gain:(Float32) gain;\n/** pause an audio */\n-(void) pauseEffect:(ALuint) soundId;\n/** pause all audioes */\n-(void) pauseAllEffects;\n/** resume an audio */\n-(void) resumeEffect:(ALuint) soundId;\n/** resume all audioes */\n-(void) resumeAllEffects;\n/** stop all audioes */\n-(void) stopAllEffects;\n/** preloads an audio effect */\n-(void) preloadEffect:(NSString*) filePath;\n/** unloads an audio effect from memory */\n-(void) unloadEffect:(NSString*) filePath;\n/** Gets a CDSoundSource object set up to play the specified file. */\n-(CDSoundSource *) soundSourceForFile:(NSString*) filePath;\n\n/** Shuts down the shared audio engine instance so that it can be reinitialised */\n+(void) end;\n\n@end\n"
  },
  {
    "path": "cocos2d/cocos/audio/mac/SimpleAudioEngine_objc.m",
    "content": "/*\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n $Id$\n */\n\n#import \"SimpleAudioEngine_objc.h\"\n\n@implementation SimpleAudioEngine\n\nstatic SimpleAudioEngine *sharedEngine = nil;\nstatic CDSoundEngine* soundEngine = nil;\nstatic CDAudioManager *am = nil;\nstatic CDBufferManager *bufferManager = nil;\n\n// Init\n+ (SimpleAudioEngine *) sharedEngine\n{\n    @synchronized(self)     {\n        if (!sharedEngine)\n            sharedEngine = [[SimpleAudioEngine alloc] init];\n    }\n    return sharedEngine;\n}\n\n+ (id) alloc\n{\n    @synchronized(self)     {\n        NSAssert(sharedEngine == nil, @\"Attempted to allocate a second instance of a singleton.\");\n        return [super alloc];\n    }\n    return nil;\n}\n\n-(id) init\n{\n    if((self=[super init])) {\n        am = [CDAudioManager sharedManager];\n        soundEngine = am.soundEngine;\n        bufferManager = [[CDBufferManager alloc] initWithEngine:soundEngine];\n        mute_ = NO;\n        enabled_ = YES;\n    }\n    return self;\n}\n\n// Memory\n- (void) dealloc\n{\n    am = nil;\n    soundEngine = nil;\n    bufferManager = nil;\n    [super dealloc];\n}\n\n+(void) end \n{\n    am = nil;\n    [CDAudioManager end];\n    [bufferManager release];\n    [sharedEngine release];\n    sharedEngine = nil;\n}    \n\n#pragma mark SimpleAudioEngine - background music\n\n-(void) preloadBackgroundMusic:(NSString*) filePath {\n    [am preloadBackgroundMusic:filePath];\n}\n\n-(void) playBackgroundMusic:(NSString*) filePath\n{\n    [am playBackgroundMusic:filePath loop:TRUE];\n}\n\n-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop\n{\n    [am playBackgroundMusic:filePath loop:loop];\n}\n\n-(void) stopBackgroundMusic\n{\n    [am stopBackgroundMusic];\n}\n\n-(void) pauseBackgroundMusic {\n    [am pauseBackgroundMusic];\n}    \n\n-(void) resumeBackgroundMusic {\n    [am resumeBackgroundMusic];\n}    \n\n-(void) rewindBackgroundMusic {\n    [am rewindBackgroundMusic];\n}\n\n-(BOOL) isBackgroundMusicPlaying {\n    return [am isBackgroundMusicPlaying];\n}    \n\n-(BOOL) willPlayBackgroundMusic {\n    return [am willPlayBackgroundMusic];\n}\n\n#pragma mark SimpleAudioEngine - sound effects\n\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL) loop\n{\n    return [self playEffect:filePath loop:loop pitch:1.0f pan:0.0f gain:1.0f];\n}\n\n-(ALuint) playEffect:(NSString*) filePath loop:(BOOL) loop pitch:(Float32) pitch pan:(Float32) pan gain:(Float32) gain\n{\n    int soundId = [bufferManager bufferForFile:filePath create:YES];\n    if (soundId != kCDNoBuffer) {\n        return [soundEngine playSound:soundId sourceGroupId:0 pitch:pitch pan:pan gain:gain loop:loop];\n    } else {\n        return CD_MUTE;\n    }    \n}\n\n-(void) stopEffect:(ALuint) soundId {\n    [soundEngine stopSound:soundId];\n}    \n\n-(void) pauseEffect:(ALuint) soundId {\n  [soundEngine pauseSound: soundId];\n}\n\n-(void) pauseAllEffects {\n  [soundEngine pauseAllSounds];\n}\n\n-(void) resumeEffect:(ALuint) soundId {\n  [soundEngine resumeSound: soundId];\n}\n\n-(void) resumeAllEffects {\n  [soundEngine resumeAllSounds];\n}\n\n-(void) stopAllEffects {\n  [soundEngine stopAllSounds];\n}\n\n-(void) preloadEffect:(NSString*) filePath\n{\n    int soundId = [bufferManager bufferForFile:filePath create:YES];\n    if (soundId == kCDNoBuffer) {\n        CDLOG(@\"Denshion::SimpleAudioEngine sound failed to preload %@\",filePath);\n    }\n}\n\n-(void) unloadEffect:(NSString*) filePath\n{\n    CDLOGINFO(@\"Denshion::SimpleAudioEngine unloadedEffect %@\",filePath);\n    [bufferManager releaseBufferForFile:filePath];\n}\n\n#pragma mark Audio Interrupt Protocol\n-(BOOL) mute\n{\n    return mute_;\n}\n\n-(void) setMute:(BOOL) muteValue\n{\n    if (mute_ != muteValue) {\n        mute_ = muteValue;\n        am.mute = mute_;\n    }    \n}\n\n-(BOOL) enabled\n{\n    return enabled_;\n}\n\n-(void) setEnabled:(BOOL) enabledValue\n{\n    if (enabled_ != enabledValue) {\n        enabled_ = enabledValue;\n        am.enabled = enabled_;\n    }    \n}\n\n\n#pragma mark SimpleAudioEngine - BackgroundMusicVolume\n-(float) backgroundMusicVolume\n{\n    return am.backgroundMusic.volume;\n}    \n\n-(void) setBackgroundMusicVolume:(float) volume\n{\n    am.backgroundMusic.volume = volume;\n}    \n\n#pragma mark SimpleAudioEngine - EffectsVolume\n-(float) effectsVolume\n{\n    return am.soundEngine.masterGain;\n}    \n\n-(void) setEffectsVolume:(float) volume\n{\n    am.soundEngine.masterGain = volume;\n}    \n\n-(CDSoundSource *) soundSourceForFile:(NSString*) filePath {\n    int soundId = [bufferManager bufferForFile:filePath create:YES];\n    if (soundId != kCDNoBuffer) {\n        CDSoundSource *result = [soundEngine soundSourceForSound:soundId sourceGroupId:0];\n        CDLOGINFO(@\"Denshion::SimpleAudioEngine sound source created for %@\",filePath);\n        return result;\n    } else {\n        return nil;\n    }    \n}    \n\n@end \n"
  },
  {
    "path": "cocos2d/cocos/audio/openal/OpenALDecoder.cpp",
    "content": "#include \"OpenALDecoder.h\"\n#include <sys/mman.h>\n#include <sys/stat.h>\n#include <AL/alut.h>\n\n#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN\n#include <FBase.h>\n#include <FBaseCol.h>\n#include <FMedia.h>\nusing namespace Tizen::Base;\nusing namespace Tizen::Base::Collection;\nusing namespace Tizen::Media;\n#endif\n\n#ifndef DISABLE_VORBIS\n#include <vorbis/vorbisfile.h>\n#endif\n\n#ifdef ENABLE_MPG123\n#include <mpg123.h>\n#endif\n\nnamespace CocosDenshion {\n\nstatic int checkALError(const char *funcName)\n{\n    int err = alGetError();\n\n    if (err != AL_NO_ERROR)\n    {\n        switch (err)\n        {\n            case AL_INVALID_NAME:\n                fprintf(stderr, \"AL_INVALID_NAME in %s\\n\", funcName);\n                break;\n\n            case AL_INVALID_ENUM:\n                fprintf(stderr, \"AL_INVALID_ENUM in %s\\n\", funcName);\n                break;\n\n            case AL_INVALID_VALUE:\n                fprintf(stderr, \"AL_INVALID_VALUE in %s\\n\", funcName);\n                break;\n\n            case AL_INVALID_OPERATION:\n                fprintf(stderr, \"AL_INVALID_OPERATION in %s\\n\", funcName);\n                break;\n\n            case AL_OUT_OF_MEMORY:\n                fprintf(stderr, \"AL_OUT_OF_MEMORY in %s\\n\", funcName);\n                break;\n        }\n    }\n\n    return err;\n}\n\nclass AlutDecoder : public OpenALDecoder\n{\n    bool decode(OpenALFile &file, ALuint &result)\n    {\n        if (!file.mapToMemory())\n            return false;\n        result = alutCreateBufferFromFileImage(file.mappedFile, file.fileSize);\n        if (AL_NONE == result)\n            return false;\n        return true;\n    }\n\n    bool acceptsFormat(Format format) const\n    {\n        return Wav == format || Raw == format;\n    }\n};\n\nclass DataRaii\n{\npublic:\n    char *data;\n    size_t size;\n\n    DataRaii() : data(0), size(0) {}\n    ~DataRaii() { delete [] data; }\n};\n\n#ifdef ENABLE_MPG123\nclass Mpg123Decoder : public OpenALDecoder\n{\nprivate:\n    mpg123_handle *handle;\n\npublic:\n    class MpgOpenRaii\n    {\n    public:\n        mpg123_handle *handle;\n\n        MpgOpenRaii(mpg123_handle *handle) : handle(handle) {}\n        ~MpgOpenRaii() { mpg123_close(handle); }\n    };\n\n    bool getInfo(ALenum &format, ALsizei &freq, ALsizei &size) const\n    {\n        int channels = 0;\n        int encoding = 0;\n        long rate = 0;\n        if (MPG123_OK != mpg123_getformat(handle, &rate, &channels, &encoding))\n            return false;\n        size = mpg123_length(handle);\n        if (size == MPG123_ERR)\n            return false;\n        freq = rate;\n        if (encoding == MPG123_ENC_UNSIGNED_8) {\n            if (channels == 1)\n                format = AL_FORMAT_MONO8;\n            else\n                format = AL_FORMAT_STEREO8;\n        } else {\n            if (channels == 1)\n                format = AL_FORMAT_MONO16;\n            else\n                format = AL_FORMAT_STEREO16;\n        }\n        return true;\n    }\n\n    bool decode(OpenALFile &file, ALuint &result)\n    {\n        if (MPG123_OK != mpg123_open_fd(handle, fileno(file.file)))\n            return false;\n        MpgOpenRaii raii(handle);\n        ALenum format = AL_NONE;\n        ALsizei freq = 0;\n        ALsizei size = 0;\n        if (!getInfo(format, freq, size))\n            return false;\n        DataRaii pcm;\n        pcm.size = size;\n        if (format == AL_FORMAT_MONO16 || format == AL_FORMAT_STEREO16)\n            pcm.size *= 2;\n        pcm.data = new char[pcm.size];\n        size_t done = 0;\n        if (MPG123_DONE != mpg123_read(handle, (unsigned char*)pcm.data, pcm.size, &done))\n            return false;\n        CCLOG(\"MP3 BUFFER SIZE: %ld, FORMAT %i.\", (long)done, (int)format);\n        return initALBuffer(result, format, pcm.data, done, freq);\n    }\n\n    bool acceptsFormat(Format format) const\n    {\n        return Mp3 == format;\n    }\n\n    Mpg123Decoder()\n        : handle(mpg123_new(NULL, NULL))\n    {\n        if (MPG123_OK != mpg123_format(handle, 44100, MPG123_MONO | MPG123_STEREO,\n                                       MPG123_ENC_UNSIGNED_8 | MPG123_ENC_SIGNED_16))\n            CCLOG(\"ERROR (CocosDenshion): cannot set specified mpg123 format.\");\n    }\n\n    ~Mpg123Decoder()\n    {\n        mpg123_delete(handle);\n    }\n};\n#endif\n\n#ifndef DISABLE_VORBIS\nclass VorbisDecoder : public OpenALDecoder\n{\n    class OggRaii\n    {\n    public:\n        OggVorbis_File file;\n\n        ~OggRaii() { ov_clear(&file); }\n    };\n\npublic:\n    bool decode(OpenALFile &file, ALuint &result)\n    {\n        OggRaii ogg;\n        int status = ov_test(file.file, &ogg.file, 0, 0);\n        if (status != 0) {\n            ov_clear(&ogg.file);\n            return false;\n        }\n        status = ov_test_open(&ogg.file);\n        if (status != 0) {\n            fprintf(stderr, \"Could not open OGG file '%s'\\n\", file.debugName.c_str());\n            return false;\n        }\n        // As vorbis documentation says, we should not fclose() file\n        // after successful opening by vorbis functions.\n        file.file = NULL;\n        vorbis_info *info = ov_info(&ogg.file, -1);\n        ALenum  format = (info->channels == 1) ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16;\n\n        DataRaii pcm;\n        pcm.size = ov_pcm_total(&ogg.file, -1) * info->channels * 2;\n        pcm.data = new char[pcm.size];\n\n        size_t size = 0;\n        int section = 0;\n        while (size < pcm.size) {\n            status = ov_read(&ogg.file, pcm.data + size, pcm.size - size, 0, 2, 1, &section);\n            if (status > 0) {\n                size += status;\n            } else if (status < 0) {\n                fprintf(stderr, \"OGG file decoding stopped, file '%s'\\n\", file.debugName.c_str());\n                return false;\n            } else {\n                break;\n            }\n        }\n        if (size == 0) {\n            fprintf(stderr, \"Unable to read OGG data from '%s'\\n\", file.debugName.c_str());\n\t\t\treturn false;\n        }\n        return initALBuffer(result, format, pcm.data, pcm.size, info->rate);\n    }\n\n    bool acceptsFormat(Format format) const\n    {\n        return Vorbis == format;\n    }\n};\n#endif\n\n#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN\nclass TizenDecoder : public OpenALDecoder\n{\npublic:\n    static TizenDecoder *create(Format format)\n    {\n        TizenDecoder *decoder = new TizenDecoder(format);\n        if (decoder && !decoder->init()) {\n            delete decoder;\n            decoder = NULL;\n        }\n        return decoder;\n    }\n\n    bool decode(OpenALFile &file, ALuint &result)\n    {\n        if (!file.mapToMemory())\n            return false;\n        ByteBuffer inputBuffer;\n        inputBuffer.Construct(/*capacity*/ file.fileSize);\n        inputBuffer.SetArray((const byte*)file.mappedFile, 0, file.fileSize);\n        inputBuffer.Flip();\n        ByteBuffer pcm;\n        pcm.Construct(/*capacity*/ 2 * file.fileSize);\n\n        AudioSampleType sampleType = AUDIO_TYPE_NONE;\n        AudioChannelType channelType = AUDIO_CHANNEL_TYPE_NONE;\n        int sampleRate = 0;\n        if (E_SUCCESS != _decoder.Probe(inputBuffer, sampleType, channelType, sampleRate))\n            return false;\n        while (inputBuffer.GetRemaining()) {\n            auto ret = _decoder.Decode(inputBuffer, pcm);\n        \tif (ret == E_OUT_OF_MEMORY) {\n        \t\tpcm.ExpandCapacity(2 * pcm.GetCapacity());\n        \t} else if (IsFailed(ret)) {\n                AppLogTag(\"CocosDenshion(TizenDecoder)\", \"failed to decode file '%s', supported format is %s.\", file.debugName.c_str(), getCodecName());\n                return false;\n            }\n        }\n\n        return initALBuffer(result, getALFormat(sampleType, channelType),\n                            pcm.GetPointer(), pcm.GetPosition(), sampleRate);\n    }\n\n    bool acceptsFormat(Format format) const\n    {\n        return _format == format;\n    }\n\nprivate:\n    TizenDecoder(Format format)\n        : _format(format)\n    {\n    }\n\n    bool init()\n    {\n        HashMap option;\n        option.Construct();\n        option.Add(*(new Integer(MEDIA_PROPERTY_AUDIO_CHANNEL_TYPE)), *(new Integer(AUDIO_CHANNEL_TYPE_NONE)));\n        option.Add(*(new Integer(MEDIA_PROPERTY_AUDIO_SAMPLE_RATE)), *(new Integer(44100)));\n\n        result r = _decoder.Construct(getCodecType());\n        if (IsFailed(r))\n            return false;\n        else\n            AppLogTag(\"CocosDenshion\", \"Tizen device supports audio format %s.\", getCodecName());\n        return true;\n    }\n\n    ALenum getALFormat(AudioSampleType sampleType, AudioChannelType channelType)\n    {\n        if (sampleType == AUDIO_TYPE_PCM_U8) {\n            if (channelType == AUDIO_CHANNEL_TYPE_MONO)\n                return AL_FORMAT_MONO8;\n            return AL_FORMAT_STEREO8;\n        }\n        if (sampleType == AUDIO_TYPE_PCM_S16_LE) {\n            if (channelType == AUDIO_CHANNEL_TYPE_MONO)\n                return AL_FORMAT_MONO16;\n            return AL_FORMAT_STEREO16;\n        }\n        AppLogTag(\"CocosDenshion(TizenDecoder)\", \"unsuppored sampleType=%d.\", sampleType, channelType);\n        return AL_NONE;\n    }\n\n    CodecType getCodecType() const\n    {\n        switch (_format) {\n        case Mp3:\n            return CODEC_MP3;\n        case Vorbis:\n            return CODEC_VORBIS;\n        case Flac:\n            return CODEC_FLAC;\n        case Midi:\n            return CODEC_MIDI;\n        case Aac:\n            return CODEC_AAC;\n        default:\n        \tbreak;\n        }\n        return CODEC_UNKNOWN;\n    }\n\n    const char *getCodecName() const\n    {\n        switch (_format) {\n        case Mp3:\n            return \"mp3\";\n        case Vorbis:\n            return \"vorbis\";\n        case Flac:\n            return \"flac\";\n        case Midi:\n            return \"midi\";\n        case Aac:\n            return \"aac\";\n        default:\n        \tbreak;\n        }\n        return \"unknown\";\n    }\n\n    Format _format;\n    AudioDecoder _decoder;\n};\n#endif\n\nstd::vector<OpenALDecoder *> OpenALDecoder::_decoders;\n\nvoid OpenALDecoder::installDecoders()\n{\n#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN\n    addDecoder(TizenDecoder::create(Mp3));\n    addDecoder(TizenDecoder::create(Vorbis));\n    addDecoder(TizenDecoder::create(Flac));\n    addDecoder(TizenDecoder::create(Midi));\n    addDecoder(TizenDecoder::create(Aac));\n#else\n#if !defined(DISABLE_VORBIS)\n    addDecoder(new VorbisDecoder());\n#endif\n#if defined(ENABLE_MPG123)\n    addDecoder(new Mpg123Decoder());\n#endif\n#endif\n    addDecoder(new AlutDecoder());\n}\n\nvoid OpenALDecoder::addDecoder(OpenALDecoder *decoder)\n{\n    if (decoder)\n        _decoders.push_back(decoder);\n}\n\nbool OpenALDecoder::initALBuffer(ALuint &result, ALenum format,\n                                 const ALvoid *data, ALsizei size, ALsizei freq)\n{\n    // Load audio data into a buffer.\n    alGenBuffers(1, &result);\n\n    if (checkALError(\"initALBuffer:alGenBuffers\") != AL_NO_ERROR)\n    {\n        fprintf(stderr, \"Couldn't generate OpenAL buffer\\n\");\n        return false;\n    }\n\n    alBufferData(result, format, data, size, freq);\n    checkALError(\"initALBuffer:alBufferData\");\n    return true;\n}\n\nconst std::vector<OpenALDecoder *> &OpenALDecoder::getDecoders()\n{\n    return _decoders;\n}\n\nvoid OpenALFile::clear()\n{\n    if (mappedFile) {\n        ::munmap(mappedFile, fileSize);\n        mappedFile = 0;\n        fileSize = 0;\n    }\n    if (file) {\n        fclose(file);\n        file = 0;\n    }\n}\n\nbool OpenALFile::mapToMemory()\n{\n    if (!file)\n        return false;\n    if (mappedFile != NULL)\n        return true;\n\n    const int fd = fileno(file);\n    struct stat fileStats;\n    if (0 != fstat(fd, &fileStats))\n        return false;\n    fileSize = fileStats.st_size;\n    mappedFile = ::mmap(NULL, fileSize, PROT_READ, MAP_PRIVATE, fd, 0);\n    if (mappedFile != MAP_FAILED)\n        return true;\n    mappedFile = NULL;\n    return false;\n}\n\n} // namespace CocosDenshion\n"
  },
  {
    "path": "cocos2d/cocos/audio/openal/OpenALDecoder.h",
    "content": "#ifndef COCOSDENSHION_OPENALLOADER_H\n#define COCOSDENSHION_OPENALLOADER_H\n\n#include <vector>\n#include <string>\n#include <stdio.h>\n#include <AL/al.h>\n#include \"cocos2d.h\"\n\n#if CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN\n#define DISABLE_VORBIS\n#endif\n\nnamespace CocosDenshion {\n\nstruct OpenALFile\n{\n    std::string debugName; ///< For logging.\n    FILE *file;\n    void *mappedFile; ///< Reserved by decoders.\n    size_t fileSize; ///< Reserved by decoders.\n\n    OpenALFile() : file(0), mappedFile(0), fileSize(0) {}\n    ~OpenALFile() { clear(); }\n\n    /// Unmaps from memory and closes file.\n    void clear();\n    /// Performs memory map, if was not mapped before.\n    bool mapToMemory();\n};\n\nclass OpenALDecoder\n{\npublic:\n    enum Format {\n        Mp3 = 0,\n        Vorbis,\n        Wav,\n        Raw,\n        Flac,\n        Midi,\n        Aac\n    };\n\n    virtual ~OpenALDecoder() {}\n\n    /// Returns true if such format is supported and decoding was successful.\n    virtual bool decode(OpenALFile &file, ALuint &result) = 0;\n    virtual bool acceptsFormat(Format format) const = 0;\n\n    static const std::vector<OpenALDecoder *> &getDecoders();\n    static void installDecoders();\n\nprotected:\n    static void addDecoder(OpenALDecoder *decoder);\n    bool initALBuffer(ALuint &result, ALenum format,\n                      const ALvoid* data, ALsizei size, ALsizei freq);\n\n    static std::vector<OpenALDecoder *> _decoders;\n};\n\n} // namespace CocosDenshion\n\n#endif // COCOSDENSHION_OPENALLOADER_H\n"
  },
  {
    "path": "cocos2d/cocos/audio/openal/SimpleAudioEngineOpenAL.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"SimpleAudioEngine.h\"\n\n#include <map>\n#include <string>\n#include <vector>\n#include <stdio.h>\n#include <unistd.h>\n\n#include <AL/al.h>\n#include <AL/alc.h>\n#include <AL/alut.h>\n#include \"OpenALDecoder.h\"\n\n#ifdef ENABLE_MPG123\n#include <mpg123.h>\n#endif\n\nUSING_NS_CC;\n\nusing namespace std;\n\nnamespace CocosDenshion {\n\nstruct soundData {\n    ALuint buffer;\n    ALuint source;\n    bool   isLooped;\n    float pitch;\n    float pan;\n    float gain;\n};\n\ntypedef map<string, soundData *> EffectsMap;\nEffectsMap s_effects;\n\ntypedef enum {\n    PLAYING,\n    STOPPED,\n    PAUSED,\n} playStatus;\n\nstatic float s_volume                  = 1.0f;\nstatic float s_effectVolume            = 1.0f;\n\nstruct backgroundMusicData {\n    ALuint buffer;\n    ALuint source;\n};\n\ntypedef map<string, backgroundMusicData *> BackgroundMusicsMap;\nBackgroundMusicsMap s_backgroundMusics;\n\nstatic ALuint s_backgroundSource = AL_NONE;\n\nstatic SimpleAudioEngine  *s_engine = nullptr;\n\nstatic int checkALError(const char *funcName)\n{\n    int err = alGetError();\n\n    if (err != AL_NO_ERROR)\n    {\n        switch (err)\n        {\n            case AL_INVALID_NAME:\n                fprintf(stderr, \"AL_INVALID_NAME in %s\\n\", funcName);\n                break;\n\n            case AL_INVALID_ENUM:\n                fprintf(stderr, \"AL_INVALID_ENUM in %s\\n\", funcName);\n                break;\n\n            case AL_INVALID_VALUE:\n                fprintf(stderr, \"AL_INVALID_VALUE in %s\\n\", funcName);\n                break;\n\n            case AL_INVALID_OPERATION:\n                fprintf(stderr, \"AL_INVALID_OPERATION in %s\\n\", funcName);\n                break;\n\n            case AL_OUT_OF_MEMORY:\n                fprintf(stderr, \"AL_OUT_OF_MEMORY in %s\\n\", funcName);\n                break;\n        }\n    }\n\n    return err;\n}\n\nstatic void stopBackground(bool bReleaseData)\n{\n    // The background music might have been already stopped\n    // Stop request can come from\n    //   - stopBackgroundMusic(..)\n    //   - end(..)\n    if (s_backgroundSource != AL_NONE)\n        alSourceStop(s_backgroundSource);\n\n    if (bReleaseData)\n    {\n        for (auto it = s_backgroundMusics.begin(); it != s_backgroundMusics.end(); ++it)\n        {\n            if (it->second->source == s_backgroundSource)\n            {\n                alDeleteSources(1, &it->second->source);\n                checkALError(\"stopBackground:alDeleteSources\");\n                alDeleteBuffers(1, &it->second->buffer);\n                checkALError(\"stopBackground:alDeleteBuffers\");\n                delete it->second;\n                s_backgroundMusics.erase(it);\n                break;\n            }\n        }\n    }\n\n    s_backgroundSource = AL_NONE;\n}\n\nstatic void setBackgroundVolume(float volume)\n{\n    alSourcef(s_backgroundSource, AL_GAIN, volume);\n}\n\nSimpleAudioEngine::SimpleAudioEngine()\n{\n    alutInit(0, 0);\n#ifdef ENABLE_MPG123\n    mpg123_init();\n#endif\n    checkALError(\"SimpleAudioEngine:alutInit\");\n    OpenALDecoder::installDecoders();\n}\n\nSimpleAudioEngine::~SimpleAudioEngine()\n{\n#ifdef ENABLE_MPG123\n    mpg123_exit();\n#endif\n    alutExit();\n}\n\nSimpleAudioEngine* SimpleAudioEngine::getInstance()\n{\n    if (!s_engine)\n        s_engine = new SimpleAudioEngine();\n\n    return s_engine;\n}\n\nvoid SimpleAudioEngine::end()\n{\n    checkALError(\"end:init\");\n\n    // clear all the sound effects\n    EffectsMap::const_iterator end = s_effects.end();\n    for (auto it = s_effects.begin(); it != end; ++it)\n    {\n        alSourceStop(it->second->source);\n        checkALError(\"end:alSourceStop\");\n\n        alDeleteSources(1, &it->second->source);\n        checkALError(\"end:alDeleteSources\");\n\n        alDeleteBuffers(1, &it->second->buffer);\n        checkALError(\"end:alDeleteBuffers\");\n\n        delete it->second;\n    }\n    s_effects.clear();\n\n    // and the background music too\n    stopBackground(true);\n\n    for (auto it = s_backgroundMusics.begin(); it != s_backgroundMusics.end(); ++it)\n    {\n        alSourceStop(it->second->source);\n        checkALError(\"end:alSourceStop\");\n\n        alDeleteSources(1, &it->second->source);\n        checkALError(\"end:alDeleteSources\");\n\n        alDeleteBuffers(1, &it->second->buffer);\n        checkALError(\"end:alDeleteBuffers\");\n\n        delete it->second;\n    }\n    s_backgroundMusics.clear();\n\n    CC_SAFE_DELETE(s_engine);\n}\n\n//\n// background audio\n//\nvoid SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\n    BackgroundMusicsMap::const_iterator it = s_backgroundMusics.find(fullPath);\n    if (it == s_backgroundMusics.end())\n    {\n        ALuint buffer = AL_NONE;\n        bool success = false;\n        OpenALFile file;\n        file.debugName = pszFilePath;\n        file.file = fopen(fullPath.c_str(), \"rb\");\n        if (!file.file) {\n            fprintf(stderr, \"Cannot read file: '%s'\\n\", fullPath.data());\n            return;\n        }\n\n        const std::vector<OpenALDecoder *> &decoders = OpenALDecoder::getDecoders();\n        for (size_t i = 0, n = decoders.size(); !success && i < n; ++i)\n            success = decoders[i]->decode(file, buffer);\n        file.clear();\n\n        ALuint source = AL_NONE;\n        alGenSources(1, &source);\n        checkALError(\"preloadBackgroundMusic:alGenSources\");\n\n        alSourcei(source, AL_BUFFER, buffer);\n        checkALError(\"preloadBackgroundMusic:alSourcei\");\n\n        backgroundMusicData* data = new backgroundMusicData();\n        data->buffer = buffer;\n        data->source = source;\n        s_backgroundMusics.insert(BackgroundMusicsMap::value_type(fullPath, data));\n    }\n}\n\nvoid SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)\n{\n    // If there is already a background music source we stop it first\n    if (s_backgroundSource != AL_NONE)\n        stopBackgroundMusic(false);\n\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\n    BackgroundMusicsMap::const_iterator it = s_backgroundMusics.find(fullPath);\n    if (it == s_backgroundMusics.end())\n    {\n        preloadBackgroundMusic(fullPath.c_str());\n        it = s_backgroundMusics.find(fullPath);\n    }\n\n    if (it != s_backgroundMusics.end())\n    {\n        s_backgroundSource = it->second->source;\n        alSourcei(s_backgroundSource, AL_LOOPING, bLoop ? AL_TRUE : AL_FALSE);\n        setBackgroundVolume(s_volume);\n        alSourcePlay(s_backgroundSource);\n        checkALError(\"playBackgroundMusic:alSourcePlay\");\n    }\n}\n\nvoid SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)\n{\n    // If there is no source, then there is nothing that can be stopped\n    if (s_backgroundSource == AL_NONE)\n        return;\n\n    ALint state;\n    alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &state);\n    if (state == AL_PLAYING)\n        stopBackground(bReleaseData);\n}\n\nvoid SimpleAudioEngine::pauseBackgroundMusic()\n{\n    // If there is no source, then there is nothing that can be paused\n    if (s_backgroundSource == AL_NONE)\n        return;\n\n    ALint state;\n    alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &state);\n    if (state == AL_PLAYING)\n        alSourcePause(s_backgroundSource);\n\n    checkALError(\"pauseBackgroundMusic:alSourcePause\");\n}\n\nvoid SimpleAudioEngine::resumeBackgroundMusic()\n{\n    // If there is no source, then there is nothing that can be resumed\n    if (s_backgroundSource == AL_NONE)\n        return;\n\n    ALint state;\n    alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &state);\n    if (state == AL_PAUSED)\n        alSourcePlay(s_backgroundSource);\n\n    checkALError(\"resumeBackgroundMusic:alSourcePlay\");\n}\n\nvoid SimpleAudioEngine::rewindBackgroundMusic()\n{\n    // If there is no source, then there is nothing that can be rewinded\n    if (s_backgroundSource == AL_NONE)\n        return;\n\n    // Rewind and prevent the last state the source had\n    ALint state;\n    alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &state);\n    alSourceRewind(s_backgroundSource);\n\n    if (state == AL_PLAYING)\n    {\n        alSourcePlay(s_backgroundSource);\n    }\n    else if (state == AL_PAUSED)\n    {\n        alSourcePlay(s_backgroundSource);\n        alSourcePause(s_backgroundSource);\n    }\n    checkALError(\"rewindBackgroundMusic:alSourceRewind\");\n}\n\nbool SimpleAudioEngine::willPlayBackgroundMusic()\n{\n    // We are able to play background music\n    // if we have a valid background source\n    if (s_backgroundSource == AL_NONE)\n        return false;\n\n    return (alIsSource(s_backgroundSource) == AL_TRUE ? true : false);\n}\n\nbool SimpleAudioEngine::isBackgroundMusicPlaying()\n{\n    // If there is no source, then there is nothing that is playing\n    if (s_backgroundSource == AL_NONE)\n        return false;\n\n    ALint play_status;\n    alGetSourcei(s_backgroundSource, AL_SOURCE_STATE, &play_status);\n    checkALError(\"isBackgroundMusicPlaying:alGetSourcei\");\n\n    return (play_status == AL_PLAYING);\n}\n\nfloat SimpleAudioEngine::getBackgroundMusicVolume()\n{\n    return s_volume;\n}\n\nvoid SimpleAudioEngine::setBackgroundMusicVolume(float volume)\n{\n    if (s_volume != volume && volume >= -0.0001 && volume <= 1.0001)\n    {\n        s_volume = volume;\n\n        // No source, no background music, no volume adjustment\n        if (s_backgroundSource != AL_NONE)\n        {\n            setBackgroundVolume(volume);\n        }\n    }\n}\n\n//\n// Effect audio (using OpenAL)\n//\nfloat SimpleAudioEngine::getEffectsVolume()\n{\n    return s_effectVolume;\n}\n\nvoid SimpleAudioEngine::setEffectsVolume(float volume)\n{\n    if (volume != s_effectVolume)\n    {\n        EffectsMap::const_iterator end = s_effects.end();\n        for (EffectsMap::const_iterator it = s_effects.begin(); it != end; it++)\n        {\n            alSourcef(it->second->source, AL_GAIN, volume * it->second->gain);\n        }\n\n        s_effectVolume = volume;\n    }\n}\n\nunsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,\n                                           float pitch, float pan, float gain)\n{\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\n    EffectsMap::iterator iter = s_effects.find(fullPath);\n\n    if (iter == s_effects.end())\n    {\n        preloadEffect(fullPath.c_str());\n\n        // let's try again\n        iter = s_effects.find(fullPath);\n        if (iter == s_effects.end())\n        {\n            fprintf(stderr, \"could not find play sound %s\\n\", fullPath.c_str());\n            return -1;\n        }\n    }\n\n    checkALError(\"playEffect:init\");\n\n    soundData &d = *iter->second;\n    d.isLooped = bLoop;\n    d.pitch = pitch;\n    d.pan = pan;\n    d.gain = gain;\n    alSourcei(d.source, AL_LOOPING, d.isLooped ? AL_TRUE : AL_FALSE);\n    alSourcef(d.source, AL_GAIN, s_effectVolume * d.gain);\n    alSourcef(d.source, AL_PITCH, d.pitch);\n    float sourcePosAL[] = {d.pan, 0.0f, 0.0f};//Set position - just using left and right panning\n    alSourcefv(d.source, AL_POSITION, sourcePosAL);\n    alSourcePlay(d.source);\n    checkALError(\"playEffect:alSourcePlay\");\n\n    return d.source;\n}\n\nvoid SimpleAudioEngine::stopEffect(unsigned int nSoundId)\n{\n    alSourceStop(nSoundId);\n    checkALError(\"stopEffect:alSourceStop\");\n}\n\nvoid SimpleAudioEngine::preloadEffect(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\n    EffectsMap::iterator iter = s_effects.find(fullPath);\n\n    // check if we have this already\n    if (iter == s_effects.end())\n    {\n        ALuint      buffer = AL_NONE;\n        ALuint      source = AL_NONE;\n        soundData  *data = new soundData;\n\n        checkALError(\"preloadEffect:init\");\n        OpenALFile file;\n        file.debugName = pszFilePath;\n        file.file = fopen(fullPath.c_str(), \"rb\");\n        if (!file.file) {\n            fprintf(stderr, \"Cannot read file: '%s'\\n\", fullPath.data());\n            return;\n        }\n\n        bool success = false;\n        const std::vector<OpenALDecoder *> &decoders = OpenALDecoder::getDecoders();\n        for (size_t i = 0, n = decoders.size(); !success && i < n; ++i)\n            success = decoders[i]->decode(file, buffer);\n        file.clear();\n\n        alGenSources(1, &source);\n\n        if (checkALError(\"preloadEffect:alGenSources\") != AL_NO_ERROR)\n        {\n            alDeleteBuffers(1, &buffer);\n            return;\n        }\n\n        alSourcei(source, AL_BUFFER, buffer);\n        checkALError(\"preloadEffect:alSourcei\");\n\n        data->isLooped = false;\n        data->buffer = buffer;\n        data->source = source;\n        data->pitch = 1.0;\n        data->pan = 0.0;\n        data->gain = 1.0;\n\n        s_effects.insert(EffectsMap::value_type(fullPath, data));\n    }\n}\n\nvoid SimpleAudioEngine::unloadEffect(const char* pszFilePath)\n{\n    // Changing file path to full path\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);\n\n    EffectsMap::iterator iter = s_effects.find(fullPath);\n\n    if (iter != s_effects.end())\n    {\n        checkALError(\"unloadEffect:init\");\n\n        alSourceStop(iter->second->source);\n        checkALError(\"unloadEffect:alSourceStop\");\n\n        alDeleteSources(1, &iter->second->source);\n        checkALError(\"unloadEffect:DeletSources\");\n\n        alDeleteBuffers(1, &iter->second->buffer);\n        checkALError(\"unloadEffect:alDeleteBuffers\");\n        delete iter->second;\n\n        s_effects.erase(iter);\n    }\n}\n\nvoid SimpleAudioEngine::pauseEffect(unsigned int nSoundId)\n{\n    ALint state;\n    alGetSourcei(nSoundId, AL_SOURCE_STATE, &state);\n    if (state == AL_PLAYING)\n        alSourcePause(nSoundId);\n    checkALError(\"pauseEffect:alSourcePause\");\n}\n\nvoid SimpleAudioEngine::pauseAllEffects()\n{\n    EffectsMap::iterator iter = s_effects.begin();\n    ALint state;\n    while (iter != s_effects.end())\n    {\n        alGetSourcei(iter->second->source, AL_SOURCE_STATE, &state);\n        if (state == AL_PLAYING)\n            alSourcePause(iter->second->source);\n        checkALError(\"pauseAllEffects:alSourcePause\");\n        ++iter;\n    }\n}\n\nvoid SimpleAudioEngine::resumeEffect(unsigned int nSoundId)\n{\n    ALint state;\n    alGetSourcei(nSoundId, AL_SOURCE_STATE, &state);\n    if (state == AL_PAUSED)\n        alSourcePlay(nSoundId);\n    checkALError(\"resumeEffect:alSourcePlay\");\n}\n\nvoid SimpleAudioEngine::resumeAllEffects()\n{\n    EffectsMap::iterator iter = s_effects.begin();\n    ALint state;\n    while (iter != s_effects.end())\n    {\n        alGetSourcei(iter->second->source, AL_SOURCE_STATE, &state);\n        if (state == AL_PAUSED)\n            alSourcePlay(iter->second->source);\n        checkALError(\"resumeAllEffects:alSourcePlay\");\n        ++iter;\n    }\n}\n\nvoid SimpleAudioEngine::stopAllEffects()\n{\n    EffectsMap::iterator iter = s_effects.begin();\n\n    if (iter != s_effects.end())\n    {\n        checkALError(\"stopAllEffects:init\");\n        alSourceStop(iter->second->source);\n        checkALError(\"stopAllEffects:alSourceStop\");\n    }\n}\n\n} // namespace CocosDenshion {\n"
  },
  {
    "path": "cocos2d/cocos/audio/proj.win32/CocosDenshion.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libAudio</ProjectName>\n    <ProjectGuid>{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}</ProjectGuid>\n    <RootNamespace>CocosDenshion.win32</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>NotSet</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>NotSet</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\2d\\cocos2dx.props\" />\n    <Import Project=\"..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\2d\\cocos2dx.props\" />\n    <Import Project=\"..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(Configuration).win32\\</IntDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration).win32\\</IntDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;..\\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>false</MinimalRebuild>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <DisableSpecificWarnings>4251</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <AdditionalDependencies>winmm.lib;libcocos2d.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>\n      <TargetMachine>MachineX86</TargetMachine>\n      <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;..\\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <DisableSpecificWarnings>4251</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <AdditionalDependencies>winmm.lib;libcocos2d.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <OptimizeReferences>true</OptimizeReferences>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>\n      <TargetMachine>MachineX86</TargetMachine>\n      <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\include\\Export.h\" />\n    <ClInclude Include=\"..\\win32\\MciPlayer.h\" />\n    <ClInclude Include=\"..\\include\\SimpleAudioEngine.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\win32\\MciPlayer.cpp\" />\n    <ClCompile Include=\"..\\win32\\SimpleAudioEngine.cpp\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/audio/proj.win32/CocosDenshion.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>\n    </Filter>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\include\\Export.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\win32\\MciPlayer.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\SimpleAudioEngine.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\win32\\MciPlayer.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\win32\\SimpleAudioEngine.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/audio/win32/MciPlayer.cpp",
    "content": "#include \"MciPlayer.h\"\n\n#define WIN_CLASS_NAME        \"CocosDenshionCallbackWnd\"\n#define BREAK_IF(cond)      if (cond) break;\n\nnamespace CocosDenshion {\n\nstatic HINSTANCE s_hInstance;\nstatic MCIERROR  s_mciError;\n\nLRESULT WINAPI _SoundPlayProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\n\nMciPlayer::MciPlayer()\n: _wnd(NULL)\n, _dev(0L)\n, _soundID(0)\n, _times(0)\n, _playing(false)\n{\n    if (! s_hInstance)\n    {\n        s_hInstance = GetModuleHandle( NULL );            // Grab An Instance For Our Window\n\n        WNDCLASS  wc;        // Windows Class Structure\n\n        // Redraw On Size, And Own DC For Window.\n        wc.style          = 0;  \n        wc.lpfnWndProc    = _SoundPlayProc;                    // WndProc Handles Messages\n        wc.cbClsExtra     = 0;                              // No Extra Window Data\n        wc.cbWndExtra     = 0;                                // No Extra Window Data\n        wc.hInstance      = s_hInstance;                    // Set The Instance\n        wc.hIcon          = 0;                                // Load The Default Icon\n        wc.hCursor        = LoadCursor( NULL, IDC_ARROW );    // Load The Arrow Pointer\n        wc.hbrBackground  = NULL;                           // No Background Required For GL\n        wc.lpszMenuName   = NULL;                           // We Don't Want A Menu\n        wc.lpszClassName  = WIN_CLASS_NAME;                 // Set The Class Name\n\n        if (! RegisterClass(&wc)\n            && 1410 != GetLastError())\n        {\n            return;\n        }\n    }\n\n    _wnd = CreateWindowEx(\n        WS_EX_APPWINDOW,                                    // Extended Style For The Window\n        WIN_CLASS_NAME,                                        // Class Name\n        NULL,                                        // Window Title\n        WS_POPUPWINDOW,/*WS_OVERLAPPEDWINDOW*/               // Defined Window Style\n        0, 0,                                                // Window Position\n        0,                                                    // Window Width\n        0,                                                    // Window Height\n        NULL,                                                // No Parent Window\n        NULL,                                                // No Menu\n        s_hInstance,                                        // Instance\n        NULL );\n    if (_wnd)\n    {\n        SetWindowLongPtr(_wnd, GWLP_USERDATA, (LONG_PTR)this);\n    }\n}\n\nMciPlayer::~MciPlayer()\n{\n    Close();\n    DestroyWindow(_wnd);\n}\n\nvoid MciPlayer::Open(const char* pFileName, UINT uId)\n{\n//     WCHAR * pBuf = NULL;\n    do \n    {\n        BREAK_IF(! pFileName || ! _wnd);\n        int nLen = (int)strlen(pFileName);\n        BREAK_IF(! nLen);\n//         pBuf = new WCHAR[nLen + 1];\n//         BREAK_IF(! pBuf);\n//         MultiByteToWideChar(CP_ACP, 0, pFileName, nLen + 1, pBuf, nLen + 1);\n\n        Close();\n\n        MCI_OPEN_PARMS mciOpen = {0};\n        MCIERROR mciError;\n        mciOpen.lpstrDeviceType = (LPCTSTR)MCI_ALL_DEVICE_ID;\n        mciOpen.lpstrElementName = pFileName;\n\n        mciError = mciSendCommand(0,MCI_OPEN, MCI_OPEN_ELEMENT, reinterpret_cast<DWORD_PTR>(&mciOpen));\n        BREAK_IF(mciError);\n\n        _dev = mciOpen.wDeviceID;\n        _soundID = uId;\n        _playing = false;\n    } while (0);\n}\n\nvoid MciPlayer::Play(UINT uTimes /* = 1 */)\n{\n    if (! _dev)\n    {\n        return;\n    }\n    MCI_PLAY_PARMS mciPlay = {0};\n    mciPlay.dwCallback = reinterpret_cast<DWORD_PTR>(_wnd);\n    s_mciError = mciSendCommand(_dev,MCI_PLAY, MCI_FROM|MCI_NOTIFY,reinterpret_cast<DWORD_PTR>(&mciPlay));\n    if (! s_mciError)\n    {\n        _playing = true;\n        _times = uTimes;\n    }\n}\n\nvoid MciPlayer::Close()\n{\n    if (_playing)\n    {\n        Stop();\n    }\n    if (_dev)\n    {\n         _SendGenericCommand(MCI_CLOSE);\n    }\n    _dev = 0;\n    _playing = false;\n}\n\nvoid MciPlayer::Pause()\n{\n    _SendGenericCommand(MCI_PAUSE);\n}\n\nvoid MciPlayer::Resume()\n{\n    _SendGenericCommand(MCI_RESUME);\n}\n\nvoid MciPlayer::Stop()\n{\n    _SendGenericCommand(MCI_STOP);\n    _playing = false;\n}\n\nvoid MciPlayer::Rewind()\n{\n    if (! _dev)\n    {\n        return;\n    }\n    mciSendCommand(_dev, MCI_SEEK, MCI_SEEK_TO_START, 0);\n\n    MCI_PLAY_PARMS mciPlay = {0};\n    mciPlay.dwCallback = reinterpret_cast<DWORD_PTR>(_wnd);\n    _playing = mciSendCommand(_dev, MCI_PLAY, MCI_NOTIFY,reinterpret_cast<DWORD_PTR>(&mciPlay)) ? false : true;\n}\n\nbool MciPlayer::IsPlaying()\n{\n    return _playing;\n}\n\nUINT MciPlayer::GetSoundID()\n{\n    return _soundID;\n}\n\n//////////////////////////////////////////////////////////////////////////\n// private member\n//////////////////////////////////////////////////////////////////////////\n\nvoid MciPlayer::_SendGenericCommand(int nCommand)\n{\n    if (! _dev)\n    {\n        return;\n    }\n    mciSendCommand(_dev, nCommand, 0, 0);\n}\n\n//////////////////////////////////////////////////////////////////////////\n// static function\n//////////////////////////////////////////////////////////////////////////\n\nLRESULT WINAPI _SoundPlayProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)\n{\n    MciPlayer * pPlayer = NULL;\n    if (MM_MCINOTIFY == Msg \n        && MCI_NOTIFY_SUCCESSFUL == wParam\n        &&(pPlayer = (MciPlayer *)GetWindowLongPtr(hWnd, GWLP_USERDATA)))\n    {\n        if (pPlayer->_times)\n        {\n            --pPlayer->_times;\n        }\n\n        if (pPlayer->_times)\n        {\n            mciSendCommand(lParam, MCI_SEEK, MCI_SEEK_TO_START, 0);\n\n            MCI_PLAY_PARMS mciPlay = {0};\n            mciPlay.dwCallback = reinterpret_cast<DWORD_PTR>(hWnd);\n            mciSendCommand(lParam, MCI_PLAY, MCI_NOTIFY,reinterpret_cast<DWORD_PTR>(&mciPlay));\n        }\n        else\n        {\n            pPlayer->_playing = false;\n        }\n        return 0;\n    }\n    return DefWindowProc(hWnd, Msg, wParam, lParam);\n}\n\n} // end of namespace CocosDenshion\n"
  },
  {
    "path": "cocos2d/cocos/audio/win32/MciPlayer.h",
    "content": "#ifndef _MCI_PLAYER_WIN32_H_\n#define _MCI_PLAYER_WIN32_H_\n\n#include \"CCStdC.h\"\n#include <mmsystem.h>\n\nnamespace CocosDenshion {\n\nclass MciPlayer\n{\npublic:\n    MciPlayer();\n    ~MciPlayer();\n\n    void Close();\n\n    /**\n    @brief ļ\n    @param pFileName ŵļƣҪļ·\n    @param nTimes    ļѭĬֵΪ 1һ\n    */\n    void Open(const char* pFileName, UINT uId);\n\n    void Play(UINT uTimes = 1);\n\n    /**\n    @brief ͣ\n    */\n    void Pause();\n\n    /**\n    @brief \n    */\n    void Resume();\n\n    /**\n    @brief ֹͣ\n    */\n    void Stop();\n\n    /**\n    @brief ²\n    */\n    void Rewind();\n\n    /**\n    @brief ȡǰǷڲ\n    */\n    bool IsPlaying();\n\n    /**\n    @brief ȡǰŵЧ ID\n    @return ǰŵЧID\n    */\n    UINT GetSoundID();\n\nprivate:\n    friend LRESULT WINAPI _SoundPlayProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);\n\n    void _SendGenericCommand(int nCommand);\n\n    HWND        _wnd;\n    MCIDEVICEID _dev;\n    UINT        _soundID;\n    UINT        _times;\n    bool        _playing;\n};\n\n} // end of namespace CocosDenshion\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/audio/win32/SimpleAudioEngine.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"SimpleAudioEngine.h\"\n\n#include <map>\n#include <cstdlib>\n\n#include \"MciPlayer.h\"\n#include \"cocos2d.h\"\nUSING_NS_CC;\n\nusing namespace std;\n\nnamespace CocosDenshion {\n\ntypedef map<unsigned int, MciPlayer *> EffectList;\ntypedef pair<unsigned int, MciPlayer *> Effect;\n\nstatic char     s_szRootPath[MAX_PATH];\nstatic DWORD    s_dwRootLen;\nstatic char     s_szFullPath[MAX_PATH];\n\nstatic std::string _FullPath(const char * szPath);\nstatic unsigned int _Hash(const char *key);\n\n#define BREAK_IF(cond)  if (cond) break;\n\nstatic EffectList& sharedList()\n{\n    static EffectList s_List;\n    return s_List;\n}\n\nstatic MciPlayer& sharedMusic()\n{\n    static MciPlayer s_Music;\n    return s_Music;\n}\n\nSimpleAudioEngine::SimpleAudioEngine()\n{\n}\n\nSimpleAudioEngine::~SimpleAudioEngine()\n{\n}\n\nSimpleAudioEngine* SimpleAudioEngine::getInstance()\n{\n    static SimpleAudioEngine s_SharedEngine;\n    return &s_SharedEngine;\n}\n\nvoid SimpleAudioEngine::end()\n{\n    sharedMusic().Close();\n\n    EffectList::iterator p = sharedList().begin();\n    while (p != sharedList().end())\n    {\n        delete p->second;\n        p->second = NULL;\n        p++;\n    }   \n    sharedList().clear();\n    return;\n}\n\n//////////////////////////////////////////////////////////////////////////\n// BackgroundMusic\n//////////////////////////////////////////////////////////////////////////\n\nvoid SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)\n{\n    if (! pszFilePath)\n    {\n        return;\n    }\n\n    sharedMusic().Open(_FullPath(pszFilePath).c_str(), _Hash(pszFilePath));\n    sharedMusic().Play((bLoop) ? -1 : 1);\n}\n\nvoid SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)\n{\n    if (bReleaseData)\n    {\n        sharedMusic().Close();\n    }\n    else\n    {\n        sharedMusic().Stop();\n    }\n}\n\nvoid SimpleAudioEngine::pauseBackgroundMusic()\n{\n    sharedMusic().Pause();\n}\n\nvoid SimpleAudioEngine::resumeBackgroundMusic()\n{\n    sharedMusic().Resume();\n}\n\nvoid SimpleAudioEngine::rewindBackgroundMusic()\n{\n    sharedMusic().Rewind();\n}\n\nbool SimpleAudioEngine::willPlayBackgroundMusic()\n{\n    return false;\n}\n\nbool SimpleAudioEngine::isBackgroundMusicPlaying()\n{\n    return sharedMusic().IsPlaying();\n}\n\n//////////////////////////////////////////////////////////////////////////\n// effect function\n//////////////////////////////////////////////////////////////////////////\n\nunsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,\n                                           float pitch, float pan, float gain)\n{\n    unsigned int nRet = _Hash(pszFilePath);\n\n    preloadEffect(pszFilePath);\n\n    EffectList::iterator p = sharedList().find(nRet);\n    if (p != sharedList().end())\n    {\n        p->second->Play((bLoop) ? -1 : 1);\n    }\n\n    return nRet;\n}\n\nvoid SimpleAudioEngine::stopEffect(unsigned int nSoundId)\n{\n    EffectList::iterator p = sharedList().find(nSoundId);\n    if (p != sharedList().end())\n    {\n        p->second->Stop();\n    }\n}\n\nvoid SimpleAudioEngine::preloadEffect(const char* pszFilePath)\n{\n    int nRet = 0;\n    do \n    {\n        BREAK_IF(! pszFilePath);\n\n        nRet = _Hash(pszFilePath);\n\n        BREAK_IF(sharedList().end() != sharedList().find(nRet));\n\n        sharedList().insert(Effect(nRet, new MciPlayer()));\n        MciPlayer * pPlayer = sharedList()[nRet];\n        pPlayer->Open(_FullPath(pszFilePath).c_str(), nRet);\n\n        BREAK_IF(nRet == pPlayer->GetSoundID());\n\n        delete pPlayer;\n        sharedList().erase(nRet);\n        nRet = 0;\n    } while (0);\n}\n\nvoid SimpleAudioEngine::pauseEffect(unsigned int nSoundId)\n{\n    EffectList::iterator p = sharedList().find(nSoundId);\n    if (p != sharedList().end())\n    {\n        p->second->Pause();\n    }\n}\n\nvoid SimpleAudioEngine::pauseAllEffects()\n{\n    EffectList::iterator iter;\n    for (iter = sharedList().begin(); iter != sharedList().end(); iter++)\n    {\n        iter->second->Pause();\n    }\n}\n\nvoid SimpleAudioEngine::resumeEffect(unsigned int nSoundId)\n{\n    EffectList::iterator p = sharedList().find(nSoundId);\n    if (p != sharedList().end())\n    {\n        p->second->Resume();\n    }\n}\n\nvoid SimpleAudioEngine::resumeAllEffects()\n{\n    EffectList::iterator iter;\n    for (iter = sharedList().begin(); iter != sharedList().end(); iter++)\n    {\n        iter->second->Resume();\n    }\n}\n\nvoid SimpleAudioEngine::stopAllEffects()\n{\n    EffectList::iterator iter;\n    for (iter = sharedList().begin(); iter != sharedList().end(); iter++)\n    {\n        iter->second->Stop();\n    }\n}\n\nvoid SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)\n{\n\n}\n\nvoid SimpleAudioEngine::unloadEffect(const char* pszFilePath)\n{\n    unsigned int nID = _Hash(pszFilePath);\n\n    EffectList::iterator p = sharedList().find(nID);\n    if (p != sharedList().end())\n    {\n        delete p->second;\n        p->second = NULL;\n        sharedList().erase(nID);\n    }    \n}\n\n//////////////////////////////////////////////////////////////////////////\n// volume interface\n//////////////////////////////////////////////////////////////////////////\n\nfloat SimpleAudioEngine::getBackgroundMusicVolume()\n{\n    return 1.0;\n}\n\nvoid SimpleAudioEngine::setBackgroundMusicVolume(float volume)\n{\n}\n\nfloat SimpleAudioEngine::getEffectsVolume()\n{\n    return 1.0;\n}\n\nvoid SimpleAudioEngine::setEffectsVolume(float volume)\n{\n}\n\n//////////////////////////////////////////////////////////////////////////\n// static function\n//////////////////////////////////////////////////////////////////////////\n\nstatic std::string _FullPath(const char * szPath)\n{\n    return FileUtils::getInstance()->fullPathForFilename(szPath);\n}\n\nunsigned int _Hash(const char *key)\n{\n    unsigned int len = strlen(key);\n    const char *end=key+len;\n    unsigned int hash;\n\n    for (hash = 0; key < end; key++)\n    {\n        hash *= 16777619;\n        hash ^= (unsigned int) (unsigned char) toupper(*key);\n    }\n    return (hash);\n}\n\n} // end of namespace CocosDenshion\n"
  },
  {
    "path": "cocos2d/cocos/base/CCAffineTransform.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCAffineTransform.h\"\n#include <algorithm>\n#include <math.h>\n\nusing namespace std;\n\n\nNS_CC_BEGIN\n\nAffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty)\n{\n  AffineTransform t;\n  t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty;\n  return t;\n}\n\nPoint __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t)\n{\n  Point p;\n  p.x = (float)((double)t.a * point.x + (double)t.c * point.y + t.tx);\n  p.y = (float)((double)t.b * point.x + (double)t.d * point.y + t.ty);\n  return p;\n}\n\nPoint PointApplyTransform(const Point& point, const kmMat4& transform)\n{\n    kmVec3 vec = {point.x, point.y, 0};\n    kmVec3Transform(&vec, &vec, &transform);\n    return Point(vec.x, vec.y);\n}\n\n\nSize __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t)\n{\n  Size s;\n  s.width = (float)((double)t.a * size.width + (double)t.c * size.height);\n  s.height = (float)((double)t.b * size.width + (double)t.d * size.height);\n  return s;\n}\n\n\nAffineTransform AffineTransformMakeIdentity()\n{\n    return __CCAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);\n}\n\nextern const AffineTransform AffineTransformIdentity = AffineTransformMakeIdentity();\nconst AffineTransform AffineTransform::IDENTITY = AffineTransformMakeIdentity();\n\nRect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform)\n{\n    float top    = rect.getMinY();\n    float left   = rect.getMinX();\n    float right  = rect.getMaxX();\n    float bottom = rect.getMaxY();\n    \n    Point topLeft = PointApplyAffineTransform(Point(left, top), anAffineTransform);\n    Point topRight = PointApplyAffineTransform(Point(right, top), anAffineTransform);\n    Point bottomLeft = PointApplyAffineTransform(Point(left, bottom), anAffineTransform);\n    Point bottomRight = PointApplyAffineTransform(Point(right, bottom), anAffineTransform);\n\n    float minX = min(min(topLeft.x, topRight.x), min(bottomLeft.x, bottomRight.x));\n    float maxX = max(max(topLeft.x, topRight.x), max(bottomLeft.x, bottomRight.x));\n    float minY = min(min(topLeft.y, topRight.y), min(bottomLeft.y, bottomRight.y));\n    float maxY = max(max(topLeft.y, topRight.y), max(bottomLeft.y, bottomRight.y));\n        \n    return Rect(minX, minY, (maxX - minX), (maxY - minY));\n}\n\nRect RectApplyTransform(const Rect& rect, const kmMat4& transform)\n{\n    float top    = rect.getMinY();\n    float left   = rect.getMinX();\n    float right  = rect.getMaxX();\n    float bottom = rect.getMaxY();\n\n    kmVec3 topLeft = {left, top};\n    kmVec3 topRight = {right, top};\n    kmVec3 bottomLeft = {left, bottom};\n    kmVec3 bottomRight = {right, bottom};\n\n    kmVec3Transform(&topLeft, &topLeft, &transform);\n    kmVec3Transform(&topRight, &topRight, &transform);\n    kmVec3Transform(&bottomLeft, &bottomLeft, &transform);\n    kmVec3Transform(&bottomRight, &bottomRight, &transform);\n\n    float minX = min(min(topLeft.x, topRight.x), min(bottomLeft.x, bottomRight.x));\n    float maxX = max(max(topLeft.x, topRight.x), max(bottomLeft.x, bottomRight.x));\n    float minY = min(min(topLeft.y, topRight.y), min(bottomLeft.y, bottomRight.y));\n    float maxY = max(max(topLeft.y, topRight.y), max(bottomLeft.y, bottomRight.y));\n\n    return Rect(minX, minY, (maxX - minX), (maxY - minY));\n}\n\n\nAffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty)\n{\n    return __CCAffineTransformMake(t.a, t.b, t.c, t.d, t.tx + t.a * tx + t.c * ty, t.ty + t.b * tx + t.d * ty);\n}\n\nAffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy)\n{\n    return __CCAffineTransformMake(t.a * sx, t.b * sx, t.c * sy, t.d * sy, t.tx, t.ty);\n}\n\nAffineTransform AffineTransformRotate(const AffineTransform& t, float anAngle)\n{\n    float sine = sinf(anAngle);\n    float cosine = cosf(anAngle);\n\n    return __CCAffineTransformMake(    t.a * cosine + t.c * sine,\n                                    t.b * cosine + t.d * sine,\n                                    t.c * cosine - t.a * sine,\n                                    t.d * cosine - t.b * sine,\n                                    t.tx,\n                                    t.ty);\n}\n\n/* Concatenate `t2' to `t1' and return the result:\n     t' = t1 * t2 */\nAffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2)\n{\n    return __CCAffineTransformMake(    t1.a * t2.a + t1.b * t2.c, t1.a * t2.b + t1.b * t2.d, //a,b\n                                    t1.c * t2.a + t1.d * t2.c, t1.c * t2.b + t1.d * t2.d, //c,d\n                                    t1.tx * t2.a + t1.ty * t2.c + t2.tx,                  //tx\n                                    t1.tx * t2.b + t1.ty * t2.d + t2.ty);                  //ty\n}\n\nkmMat4 TransformConcat(const kmMat4& t1, const kmMat4& t2)\n{\n    kmMat4 ret;\n    kmMat4Multiply(&ret, &t1, &t2);\n    return ret;\n}\n\n\n/* Return true if `t1' and `t2' are equal, false otherwise. */\nbool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2)\n{\n    return (t1.a == t2.a && t1.b == t2.b && t1.c == t2.c && t1.d == t2.d && t1.tx == t2.tx && t1.ty == t2.ty);\n}\n\nAffineTransform AffineTransformInvert(const AffineTransform& t)\n{\n    float determinant = 1 / (t.a * t.d - t.b * t.c);\n\n    return __CCAffineTransformMake(determinant * t.d, -determinant * t.b, -determinant * t.c, determinant * t.a,\n                            determinant * (t.c * t.ty - t.d * t.tx), determinant * (t.b * t.tx - t.a * t.ty) );\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCAffineTransform.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __COCOA_CGAFFINETRANSFORM_H__\n#define __COCOA_CGAFFINETRANSFORM_H__\n\n#include \"CCGeometry.h\"\n#include \"CCPlatformMacros.h\"\n#include \"kazmath/kazmath.h\"\n\nNS_CC_BEGIN\n\nstruct AffineTransform {\n    float a, b, c, d;\n    float tx, ty;\n\n    static const AffineTransform IDENTITY;\n};\n\nCC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty);\n#define AffineTransformMake __CCAffineTransformMake\n\nCC_DLL Point __CCPointApplyAffineTransform(const Point& point, const AffineTransform& t);\n#define PointApplyAffineTransform __CCPointApplyAffineTransform\n\nCC_DLL Size __CCSizeApplyAffineTransform(const Size& size, const AffineTransform& t);\n#define SizeApplyAffineTransform __CCSizeApplyAffineTransform\n\nCC_DLL AffineTransform AffineTransformMakeIdentity();\nCC_DLL Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform);\n\nCC_DLL Rect RectApplyTransform(const Rect& rect, const kmMat4& transform);\nCC_DLL Point PointApplyTransform(const Point& point, const kmMat4& transform);\n\nCC_DLL AffineTransform AffineTransformTranslate(const AffineTransform& t, float tx, float ty);\nCC_DLL AffineTransform AffineTransformRotate(const AffineTransform& aTransform, float anAngle);\nCC_DLL AffineTransform AffineTransformScale(const AffineTransform& t, float sx, float sy);\nCC_DLL AffineTransform AffineTransformConcat(const AffineTransform& t1, const AffineTransform& t2);\nCC_DLL bool AffineTransformEqualToTransform(const AffineTransform& t1, const AffineTransform& t2);\nCC_DLL AffineTransform AffineTransformInvert(const AffineTransform& t);\n\nkmMat4 TransformConcat(const kmMat4& t1, const kmMat4& t2);\n\nextern CC_DLL const AffineTransform AffineTransformIdentity;\n\nNS_CC_END\n\n#endif // __COCOA_CGAFFINETRANSFORM_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCArray.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010      ForzeField Studios S.L. http://forzefield.com\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCArray.h\"\n#include \"CCString.h\"\n#include \"platform/CCFileUtils.h\"\n\nNS_CC_BEGIN\n\n#if CC_USE_ARRAY_VECTOR\n\n//  ----------------------------------------------------------------------------------\n// std::vector implementation\n//  ----------------------------------------------------------------------------------\n\n__Array::__Array()\n: data(NULL)\n{\n    init();\n}\n\n__Array* __Array::create()\n{\n    __Array* array = new __Array();\n\n    if (array && array->initWithCapacity(7))\n    {\n        array->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n    \n    return array;\n}\n\n__Array* __Array::createWithObject(Object* object)\n{\n    __Array* array = new __Array();\n\n    if (array && array->initWithObject(object))\n    {\n        array->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n\n    return array;\n}\n\n__Array* __Array::create(Object* object, ...)\n{\n    va_list args;\n    va_start(args,object);\n\n    __Array* array = create();\n    if (array && object)\n    {\n        array->addObject(object);\n        Object *i = va_arg(args, Object*);\n        while (i) \n        {\n            array->addObject(i);\n            i = va_arg(args, Object*);\n        }\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n\n    va_end(args);\n\n    return array;\n}\n\n__Array* __Array::createWithArray(__Array* otherArray)\n{\n    return otherArray->clone();\n}\n\n__Array* __Array::createWithCapacity(int capacity)\n{\n    CCASSERT(capacity>=0, \"Invalid capacity\");\n\n    __Array* array = new __Array();\n    \n    if (array && array->initWithCapacity(capacity))\n    {\n        array->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n    \n    return array;\n}\n\n__Array* __Array::createWithContentsOfFile(const std::string& fileName)\n{\n    __Array* ret = __Array::createWithContentsOfFileThreadSafe(fileName);\n    if (ret != nullptr)\n    {\n        ret->autorelease();\n    }\n    return ret;\n}\n\n__Array* __Array::createWithContentsOfFileThreadSafe(const std::string& fileName)\n{\n    return FileUtils::getInstance()->createArrayWithContentsOfFile(fileName);\n}\n\nbool __Array::init()\n{\n    return initWithCapacity(7);\n}\n\nbool __Array::initWithObject(Object* object)\n{\n    bool ret = initWithCapacity(7);\n    if (ret)\n    {\n        addObject(object);\n    }\n    return ret;\n}\n\n/** Initializes an array with some objects */\nbool __Array::initWithObjects(Object* object, ...)\n{\n    bool ret = false;\n    do \n    {\n        CC_BREAK_IF(object == nullptr);\n\n        va_list args;\n        va_start(args, object);\n\n        if (object)\n        {\n            this->addObject(object);\n            Object* i = va_arg(args, Object*);\n            while (i) \n            {\n                this->addObject(i);\n                i = va_arg(args, Object*);\n            }\n            ret = true;\n        }\n        va_end(args);\n\n    } while (false);\n\n    return ret;\n}\n\nbool __Array::initWithCapacity(int capacity)\n{\n    CCASSERT(capacity>=0, \"Invalid capacity\");\n\n    data.reserve(capacity);\n    return true;\n}\n\nbool __Array::initWithArray(__Array* otherArray)\n{\n    data = otherArray->data;\n    return true;\n}\n\nssize_t __Array::getIndexOfObject(Object* object) const\n{\n    auto it = data.begin();\n\n    for (ssize_t i = 0; it != data.end(); ++it, ++i)\n    {\n        if (it->get() == object)\n        {\n            return i;\n        }\n    }\n    \n    return -1;\n}\n\nObject* __Array::getRandomObject()\n{\n    if (data.size()==0)\n    {\n        return nullptr;\n    }\n\n    float r = CCRANDOM_0_1();\n    \n    if (r == 1) // to prevent from accessing data-arr[data->num], out of range.\n    {\n        r = 0;\n    }\n\n    r *= data.size();\n    \n    return data[r].get();\n}\n\nbool __Array::containsObject(Object* object) const\n{\n    ssize_t i = this->getIndexOfObject(object);\n    return (i >= 0);\n}\n\nbool __Array::isEqualToArray(__Array* otherArray)\n{\n    for (ssize_t i = 0; i < this->count(); ++i)\n    {\n        if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i)))\n        {\n            return false;\n        }\n    }\n    return true;\n}\n\nvoid __Array::addObject(Object* object)\n{\n    data.push_back(RCPtr<Object>(object));\n}\n\nvoid __Array::addObjectsFromArray(__Array* otherArray)\n{\n    data.insert(data.end(), otherArray->data.begin(), otherArray->data.end());\n}\n\nvoid __Array::insertObject(Object* object, int index)\n{\n    data.insert(std::begin(data) + index, RCPtr<Object>(object));\n}\n\nvoid __Array::setObject(Object* object, int index)\n{\n    data[index] = RCPtr<Object>(object);\n}\n\nvoid __Array::removeLastObject(bool releaseObj)\n{\n    CCASSERT(data.size(), \"no objects added\");\n    data.pop_back();\n}\n\nvoid __Array::removeObject(Object* object, bool releaseObj /* ignored */)\n{\n    data.erase(std::remove(data.begin(), data.end(), object));\n}\n\nvoid __Array::removeObjectAtIndex(ssize_t index, bool releaseObj /* ignored */)\n{\n    auto obj = data[index];\n    data.erase(data.begin() + index);\n}\n\nvoid __Array::removeObjectsInArray(__Array* otherArray)\n{\n    CCASSERT(false, \"not implemented\");\n}\n\nvoid __Array::removeAllObjects()\n{\n    data.erase(std::begin(data), std::end(data));\n}\n\nvoid __Array::fastRemoveObjectAtIndex(int index)\n{\n    removeObjectAtIndex(index);\n}\n\nvoid __Array::fastRemoveObject(Object* object)\n{\n    removeObject(object);\n}\n\nvoid __Array::exchangeObject(Object* object1, Object* object2)\n{\n    ssize_t idx1 = getIndexOfObject(object1);\n    ssize_t idx2 = getIndexOfObject(object2);\n\n    CCASSERT(idx1 >= 0 && idx2 >= 2, \"invalid object index\");\n\n    std::swap(data[idx1], data[idx2]);\n}\n\nvoid __Array::exchangeObjectAtIndex(ssize_t index1, ssize_t index2)\n{\n    std::swap(data[index1], data[index2]);\n}\n\nvoid __Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject /* ignored */)\n{\n    data[index] = object;\n}\n\nvoid __Array::reverseObjects()\n{\n    std::reverse(std::begin(data), std::end(data));\n}\n\nvoid __Array::reduceMemoryFootprint()\n{\n    // N/A\n}\n\n__Array::~Array()\n{\n    CCLOGINFO(\"deallocing Array: %p - len: %d\", this, count() );\n}\n\n__Array* __Array::clone() const\n{\n    __Array* ret = new __Array();\n    ret->autorelease();\n    ret->initWithCapacity(this->data.size() > 0 ? this->data.size() : 1);\n\n    Object* obj = nullptr;\n    Object* tmpObj = nullptr;\n    Clonable* clonable = nullptr;\n    CCARRAY_FOREACH(this, obj)\n    {\n        clonable = dynamic_cast<Clonable*>(obj);\n        if (clonable)\n        {\n            tmpObj = dynamic_cast<Object*>(clonable->clone());\n            if (tmpObj)\n            {\n                ret->addObject(tmpObj);\n            }\n        }\n        else\n        {\n            CCLOGWARN(\"%s isn't clonable.\", typeid(*obj).name());\n        }\n    }\n    return ret;\n}\n\nvoid __Array::acceptVisitor(DataVisitor &visitor)\n{\n    visitor.visit(this);\n}\n\n// ----------------------------------------------------------------------------------\n// ccArray implementation\n// ----------------------------------------------------------------------------------\n\n#else\n\n__Array::__Array()\n: data(nullptr)\n{\n//    init();\n}\n\n__Array* __Array::create()\n{\n    __Array* array = new __Array();\n\n    if (array && array->initWithCapacity(7))\n    {\n        array->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n\n    return array;\n}\n\n__Array* __Array::createWithObject(Object* object)\n{\n    __Array* array = new __Array();\n\n    if (array && array->initWithObject(object))\n    {\n        array->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n\n    return array;\n}\n\n__Array* __Array::create(Object* object, ...)\n{\n    va_list args;\n    va_start(args,object);\n\n    __Array* array = create();\n    if (array && object)\n    {\n        array->addObject(object);\n        Object *i = va_arg(args, Object*);\n        while (i)\n        {\n            array->addObject(i);\n            i = va_arg(args, Object*);\n        }\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n\n    va_end(args);\n\n    return array;\n}\n\n__Array* __Array::createWithArray(__Array* otherArray)\n{\n    return otherArray->clone();\n}\n\n__Array* __Array::createWithCapacity(ssize_t capacity)\n{\n    CCASSERT(capacity>=0, \"Invalid capacity\");\n\n    __Array* array = new __Array();\n\n    if (array && array->initWithCapacity(capacity))\n    {\n        array->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(array);\n    }\n\n    return array;\n}\n\n__Array* __Array::createWithContentsOfFile(const std::string& fileName)\n{\n    __Array* ret = __Array::createWithContentsOfFileThreadSafe(fileName);\n    if (ret != nullptr)\n    {\n        ret->autorelease();\n    }\n    return ret;\n}\n\n__Array* __Array::createWithContentsOfFileThreadSafe(const std::string& fileName)\n{\n    ValueVector arr = FileUtils::getInstance()->getValueVectorFromFile(fileName);\n    \n    __Array* ret = __Array::createWithCapacity(static_cast<int>(arr.size()));\n\n    for(const auto &value : arr) {\n        ret->addObject(__String::create(value.asString()));\n    }\n    \n    return ret;\n}\n\nbool __Array::init()\n{\n    CCASSERT(!data, \"Array cannot be re-initialized\");\n\n    return initWithCapacity(7);\n}\n\nbool __Array::initWithObject(Object* object)\n{\n    CCASSERT(!data, \"Array cannot be re-initialized\");\n\n    bool ret = initWithCapacity(7);\n    if (ret)\n    {\n        addObject(object);\n    }\n    return ret;\n}\n\n/** Initializes an array with some objects */\nbool __Array::initWithObjects(Object* object, ...)\n{\n    CCASSERT(!data, \"Array cannot be re-initialized\");\n\n    bool ret = false;\n    do\n    {\n        CC_BREAK_IF(object == nullptr);\n\n        va_list args;\n        va_start(args, object);\n\n        if (object)\n        {\n            this->addObject(object);\n            Object* i = va_arg(args, Object*);\n            while (i)\n            {\n                this->addObject(i);\n                i = va_arg(args, Object*);\n            }\n            ret = true;\n        }\n        va_end(args);\n\n    } while (false);\n\n    return ret;\n}\n\nbool __Array::initWithCapacity(ssize_t capacity)\n{\n    CCASSERT(capacity>=0 && !data, \"Array cannot be re-initialized\");\n\n    data = ccArrayNew(capacity);\n    return true;\n}\n\nbool __Array::initWithArray(__Array* otherArray)\n{\n    CCASSERT(!data, \"Array cannot be re-initialized\");\n\n    bool ret = false;\n    do\n    {\n        CC_BREAK_IF(! initWithCapacity(otherArray->data->num));\n\n        addObjectsFromArray(otherArray);\n        ret = true;\n    } while (0);\n\n    return ret;\n}\n\nssize_t __Array::getIndexOfObject(Object* object) const\n{\n    return ccArrayGetIndexOfObject(data, object);\n}\n\nObject* __Array::getRandomObject()\n{\n    if (data->num == 0)\n    {\n        return nullptr;\n    }\n\n    float r = CCRANDOM_0_1();\n\n    if (r == 1) // to prevent from accessing data-arr[data->num], out of range.\n    {\n        r = 0;\n    }\n\n    return data->arr[static_cast<int>(data->num * r)];\n}\n\nbool __Array::containsObject(Object* object) const\n{\n    return ccArrayContainsObject(data, object);\n}\n\nbool __Array::isEqualToArray(__Array* otherArray)\n{\n    for (int i = 0; i < this->count(); ++i)\n    {\n        if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i)))\n        {\n            return false;\n        }\n    }\n    return true;\n}\n\nvoid __Array::addObject(Object* object) \n{\n    CCASSERT(data, \"Array not initialized\");\n    ccArrayAppendObjectWithResize(data, object);\n}\n\nvoid __Array::addObjectsFromArray(__Array* otherArray)\n{\n    CCASSERT(data, \"Array not initialized\");\n    ccArrayAppendArrayWithResize(data, otherArray->data);\n}\n\nvoid __Array::insertObject(Object* object, ssize_t index)\n{\n    CCASSERT(data, \"Array not initialized\");\n    ccArrayInsertObjectAtIndex(data, object, index);\n}\n\nvoid __Array::setObject(Object* object, ssize_t index)\n{\n    CCASSERT(index >= 0 && index < count(), \"Invalid index\");\n    \n    if (object != data->arr[index])\n    {\n        data->arr[index]->release();\n        data->arr[index] = object;\n        object->retain();\n    }\n}\n\nvoid __Array::removeLastObject(bool releaseObj)\n{\n    CCASSERT(data->num, \"no objects added\");\n    ccArrayRemoveObjectAtIndex(data, data->num - 1, releaseObj);\n}\n\nvoid __Array::removeObject(Object* object, bool releaseObj/* = true*/)\n{\n    ccArrayRemoveObject(data, object, releaseObj);\n}\n\nvoid __Array::removeObjectAtIndex(ssize_t index, bool releaseObj)\n{\n    ccArrayRemoveObjectAtIndex(data, index, releaseObj);\n}\n\nvoid __Array::removeObjectsInArray(__Array* otherArray)\n{\n    ccArrayRemoveArray(data, otherArray->data);\n}\n\nvoid __Array::removeAllObjects()\n{\n    ccArrayRemoveAllObjects(data);\n}\n\nvoid __Array::fastRemoveObjectAtIndex(ssize_t index)\n{\n    ccArrayFastRemoveObjectAtIndex(data, index);\n}\n\nvoid __Array::fastRemoveObject(Object* object)\n{\n    ccArrayFastRemoveObject(data, object);\n}\n\nvoid __Array::exchangeObject(Object* object1, Object* object2)\n{\n    auto index1 = ccArrayGetIndexOfObject(data, object1);\n    if (index1 == CC_INVALID_INDEX)\n    {\n        return;\n    }\n\n    auto index2 = ccArrayGetIndexOfObject(data, object2);\n    if (index2 == CC_INVALID_INDEX)\n    {\n        return;\n    }\n\n    ccArraySwapObjectsAtIndexes(data, index1, index2);\n}\n\nvoid __Array::exchangeObjectAtIndex(ssize_t index1, ssize_t index2)\n{\n    ccArraySwapObjectsAtIndexes(data, index1, index2);\n}\n\nvoid __Array::replaceObjectAtIndex(ssize_t index, Object* object, bool releaseObject/* = true*/)\n{\n    ccArrayInsertObjectAtIndex(data, object, index);\n    ccArrayRemoveObjectAtIndex(data, index + 1);\n}\n\nvoid __Array::reverseObjects()\n{\n    if (data->num > 1)\n    {\n        // floorf(), since in the case of an even number, the number of swaps stays the same\n        auto count = static_cast<ssize_t>(floorf(data->num/2.f));\n        ssize_t maxIndex = data->num - 1;\n\n        for (ssize_t i = 0; i < count ; ++i)\n        {\n            ccArraySwapObjectsAtIndexes(data, i, maxIndex);\n            --maxIndex;\n        }\n    }\n}\n\nvoid __Array::reduceMemoryFootprint()\n{\n    ccArrayShrink(data);\n}\n\n__Array::~__Array()\n{\n    CCLOGINFO(\"deallocing Array: %p - len: %d\", this, count() );\n\n    ccArrayFree(data);\n}\n\n__Array* __Array::clone() const\n{\n    __Array* ret = new __Array();\n    ret->autorelease();\n    ret->initWithCapacity(this->data->num > 0 ? this->data->num : 1);\n\n    Object* obj = nullptr;\n    Object* tmpObj = nullptr;\n    Clonable* clonable = nullptr;\n    CCARRAY_FOREACH(this, obj)\n    {\n        clonable = dynamic_cast<Clonable*>(obj);\n        if (clonable)\n        {\n            tmpObj = dynamic_cast<Object*>(clonable->clone());\n            if (tmpObj)\n            {\n                ret->addObject(tmpObj);\n            }\n        }\n        else\n        {\n            CCLOGWARN(\"%s isn't clonable.\", typeid(*obj).name());\n        }\n    }\n    return ret;\n}\n\nvoid __Array::acceptVisitor(DataVisitor &visitor)\n{\n    visitor.visit(this);\n}\n\n#endif // uses ccArray\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCArray.h",
    "content": "/****************************************************************************\nCopyright (c) 2010      ForzeField Studios S.L. http://forzefield.com\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCARRAY_H__\n#define __CCARRAY_H__\n\n#define CC_USE_ARRAY_VECTOR 0\n\n#if CC_USE_ARRAY_VECTOR\n#include <vector>\n#include <algorithm>\n#include \"CCObject.h\"\n#include \"ccMacros.h\"\n#else\n#include \"ccCArray.h\"\n#endif\n\n\n#if CC_USE_ARRAY_VECTOR\n/**\n * A reference counting-managed pointer for classes derived from RCBase which can\n * be used as C pointer\n * Original code: http://www.codeproject.com/Articles/64111/Building-a-Quick-and-Handy-Reference-Counting-Clas\n * License: http://www.codeproject.com/info/cpol10.aspx\n */\ntemplate < class T >\nclass RCPtr\n{\npublic:\n\t//Construct using a C pointer\n\t//e.g. RCPtr< T > x = new T();\n\tRCPtr(T* ptr = nullptr)\n    : _ptr(ptr)\n\t{\n        if(ptr != nullptr) {ptr->retain();}\n\t}\n\n\t//Copy constructor\n\tRCPtr(const RCPtr &ptr)\n    : _ptr(ptr._ptr)\n\t{\n//        printf(\"Array: copy constructor: %p\\n\", this);\n\t\tif(_ptr != NULL) {_ptr->retain();}\n\t}\n\n    //Move constructor\n\tRCPtr(RCPtr &&ptr)\n    : _ptr(ptr._ptr)\n\t{\n//        printf(\"Array: Move Constructor: %p\\n\", this);\n        ptr._ptr = nullptr;\n\t}\n\n\t~RCPtr()\n\t{\n//        printf(\"Array: Destructor: %p\\n\", this);\n        if(_ptr != nullptr) {_ptr->release();}\n\t}\n\n\t//Assign a pointer\n\t//e.g. x = new T();\n\tRCPtr &operator=(T* ptr)\n\t{\n//        printf(\"Array: operator= T*: %p\\n\", this);\n\n        //The following grab and release operations have to be performed\n        //in that order to handle the case where ptr == _ptr\n        //(See comment below by David Garlisch)\n        if(ptr != nullptr) {ptr->retain();}\n        if(_ptr != nullptr) {_ptr->release();}\n        _ptr = ptr;\n        return (*this);\n\t}\n\n\t//Assign another RCPtr\n\tRCPtr &operator=(const RCPtr &ptr)\n\t{\n//        printf(\"Array: operator= const&: %p\\n\", this);\n        return (*this) = ptr._ptr;\n\t}\n\n\t//Retrieve actual pointer\n\tT* get() const\n\t{\n        return _ptr;\n\t}\n\n    //Some overloaded operators to facilitate dealing with an RCPtr\n    //as a conventional C pointer.\n    //Without these operators, one can still use the less transparent\n    //get() method to access the pointer.\n    T* operator->() const {return _ptr;}\t\t//x->member\n    T &operator*() const {return *_ptr;}\t\t//*x, (*x).member\n    explicit operator T*() const {return _ptr;}\t\t//T* y = x;\n    explicit operator bool() const {return _ptr != nullptr;}\t//if(x) {/*x is not NULL*/}\n    bool operator==(const RCPtr &ptr) {return _ptr == ptr._ptr;}\n    bool operator==(const T *ptr) {return _ptr == ptr;}\n\nprivate:\n    T *_ptr;\t//Actual pointer\n};\n#endif // CC_USE_ARRAY_VECTOR\n\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\n/** @def CCARRAY_FOREACH\nA convenience macro to iterate over a Array using. It is faster than the \"fast enumeration\" interface.\n@since v0.99.4\n*/\n\n/*\nIn cocos2d-iphone 1.0.0, This macro have been update to like this:\n\n#define CCARRAY_FOREACH(__array__, __object__)                                                \\\nif (__array__ && __array__->data->num > 0)                                                    \\\nfor(id *__arr__ = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1;    \\\n__arr__ <= end && ((__object__ = *__arr__) != nil || true);                                        \\\n__arr__++)\n\nI found that it's not work in C++. So it keep what it's look like in version 1.0.0-rc3. ---By Bin\n*/\n\n#if CC_USE_ARRAY_VECTOR\n#define CCARRAY_FOREACH(__array__, __object__)                  \\\n    if (__array__) \\\n    for( auto __it__ = (__array__)->data.begin();              \\\n        __it__ != (__array__)->data.end() && ((__object__) = __it__->get()) != nullptr;                     \\\n        ++__it__)\n\n\n#define CCARRAY_FOREACH_REVERSE(__array__, __object__)          \\\n    if (__array__) \\\n    for( auto __it__ = (__array__)->data.rbegin();             \\\n    __it__ != (__array__)->data.rend() && ((__object__) = __it__->get()) != nullptr;                        \\\n    ++__it__ )\n\n\n#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0)\n\n#else // ! CC_USE_ARRAY_VECTOR --------------------------\n\n#define CCARRAY_FOREACH(__array__, __object__)                                                                         \\\n    if ((__array__) && (__array__)->data->num > 0)                                                                     \\\n    for(Object** __arr__ = (__array__)->data->arr, **__end__ = (__array__)->data->arr + (__array__)->data->num-1;    \\\n    __arr__ <= __end__ && (((__object__) = *__arr__) != NULL/* || true*/);                                             \\\n    __arr__++)\n\n#define CCARRAY_FOREACH_REVERSE(__array__, __object__)                                                                  \\\n    if ((__array__) && (__array__)->data->num > 0)                                                                      \\\n    for(Object** __arr__ = (__array__)->data->arr + (__array__)->data->num-1, **__end__ = (__array__)->data->arr;     \\\n    __arr__ >= __end__ && (((__object__) = *__arr__) != NULL/* || true*/);                                              \\\n    __arr__--)\n\n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n#define CCARRAY_VERIFY_TYPE(__array__, __type__)                                                                 \\\n    do {                                                                                                         \\\n        if ((__array__) && (__array__)->data->num > 0)                                                           \\\n            for(Object** __arr__ = (__array__)->data->arr,                                                     \\\n                **__end__ = (__array__)->data->arr + (__array__)->data->num-1; __arr__ <= __end__; __arr__++)    \\\n                CCASSERT(dynamic_cast<__type__>(*__arr__), \"element type is wrong!\");                            \\\n    } while(false)\n#else\n#define CCARRAY_VERIFY_TYPE(__array__, __type__) void(0)\n#endif\n\n#endif // ! CC_USE_ARRAY_VECTOR\n\n\n// Common defines -----------------------------------------------------------------------------------------------\n\n#define arrayMakeObjectsPerformSelector(pArray, func, elementType)    \\\ndo {                                                                  \\\n    if(pArray && pArray->count() > 0)                                 \\\n    {                                                                 \\\n        Object* child;                                                \\\n        CCARRAY_FOREACH(pArray, child)                                \\\n        {                                                             \\\n            elementType pNode = static_cast<elementType>(child);      \\\n            if(pNode)                                                 \\\n            {                                                         \\\n                pNode->func();                                        \\\n            }                                                         \\\n        }                                                             \\\n    }                                                                 \\\n}                                                                     \\\nwhile(false)\n\n#define arrayMakeObjectsPerformSelectorWithObject(pArray, func, object, elementType)   \\\ndo {                                                                  \\\n    if(pArray && pArray->count() > 0)                                 \\\n    {                                                                 \\\n        Object* child;                                                \\\n        CCARRAY_FOREACH(pArray, child)                                \\\n        {                                                             \\\n            elementType pNode = static_cast<elementType>(child);      \\\n            if(pNode)                                                 \\\n            {                                                         \\\n                pNode->func(object);                                 \\\n            }                                                         \\\n        }                                                             \\\n    }                                                                 \\\n}                                                                     \\\nwhile(false)\n\n\nNS_CC_BEGIN\n\nclass CC_DLL __Array : public Object, public Clonable\n{\npublic:\n\n    /** Creates an empty array. Default capacity is 10 \n     * @js NA\n     * @lua NA\n     */\n    static __Array* create();\n    /** Create an array with objects \n     * @js NA\n     */\n    static __Array* create(Object* object, ...) CC_REQUIRES_NULL_TERMINATION;\n    /** Create an array with one object \n     * @js NA\n     */\n    static __Array* createWithObject(Object* object);\n    /** Create an array with a default capacity \n     * @js NA\n     */\n    static __Array* createWithCapacity(ssize_t capacity);\n    /** Create an array with from an existing array \n     * @js NA\n     */\n    static __Array* createWithArray(__Array* otherArray);\n    /**\n     @brief   Generate a Array pointer by file\n     @param   pFileName  The file name of *.plist file\n     @return  The Array pointer generated from the file\n     * @js NA\n     */\n    static __Array* createWithContentsOfFile(const std::string& pFileName);\n    \n    /*\n     @brief The same meaning as arrayWithContentsOfFile(), but it doesn't call autorelease, so the\n     invoker should call release().\n     * @js NA\n     * @lua NA\n     */\n    static __Array* createWithContentsOfFileThreadSafe(const std::string& pFileName);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~__Array();\n\n    /** Initializes an array \n     * @js NA\n     * @lua NA\n     */\n    bool init();\n    /** Initializes an array with one object \n     * @js NA\n     * @lua NA\n     */\n    bool initWithObject(Object* object);\n    /** Initializes an array with some objects \n     * @js NA\n     * @lua NA\n     */\n    bool initWithObjects(Object* object, ...) CC_REQUIRES_NULL_TERMINATION;\n    /** Initializes an array with capacity \n     * @js NA\n     * @lua NA\n     */\n    bool initWithCapacity(ssize_t capacity);\n    /** Initializes an array with an existing array \n     * @js NA\n     * @lua NA\n     */\n    bool initWithArray(__Array* otherArray);\n\n    // Querying an Array\n\n    /** Returns element count of the array \n     * @js NA\n     */\n    ssize_t count() const\n    {\n#if CC_USE_ARRAY_VECTOR\n        return data.size();\n#else\n        return data->num;\n#endif\n    }\n    /** Returns capacity of the array \n     * @js NA\n     */\n    ssize_t capacity() const\n    {\n#if CC_USE_ARRAY_VECTOR\n        return data.capacity();\n#else\n        return data->max;\n#endif\n    }\n    /** Returns index of a certain object, return UINT_MAX if doesn't contain the object \n     * @js NA\n     * @lua NA\n     */\n    ssize_t getIndexOfObject(Object* object) const;\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE ssize_t indexOfObject(Object* object) const { return getIndexOfObject(object); }\n\n    /** Returns an element with a certain index \n     * @js NA\n     * @lua NA\n     */\n    Object* getObjectAtIndex(ssize_t index)\n    {\n        CCASSERT(index>=0 && index < count(), \"index out of range in getObjectAtIndex()\");\n#if CC_USE_ARRAY_VECTOR\n        return data[index].get();\n#else\n        return data->arr[index];\n#endif\n    }\n    CC_DEPRECATED_ATTRIBUTE Object* objectAtIndex(ssize_t index) { return getObjectAtIndex(index); }\n    /** Returns the last element of the array \n     * @js NA\n     */\n    Object* getLastObject()\n    {\n#if CC_USE_ARRAY_VECTOR\n        return data.back().get();\n#else\n        if(data->num > 0)\n            return data->arr[data->num-1];\n        \n        return nullptr;\n#endif\n    }\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Object* lastObject() { return getLastObject(); }\n    /** Returns a random element \n     * @js NA\n     * @lua NA\n     */\n    Object* getRandomObject();\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE Object* randomObject() { return getRandomObject(); }\n    /** Returns a Boolean value that indicates whether object is present in array. \n     * @js NA\n     */\n    bool containsObject(Object* object) const;\n    /** @since 1.1 \n     * @js NA\n     */\n    bool isEqualToArray(__Array* otherArray);\n    // Adding Objects\n\n    /** Add a certain object \n     * @js NA\n     */\n    void addObject(Object* object);\n    /**\n     * @js NA\n     */\n    /** Add all elements of an existing array \n     * @js NA\n     */\n    void addObjectsFromArray(__Array* otherArray);\n    /** Insert a certain object at a certain index \n     * @js NA\n     */\n    void insertObject(Object* object, ssize_t index);\n    /** sets a certain object at a certain index \n     * @js NA\n     * @lua NA\n     */\n    void setObject(Object* object, ssize_t index);\n    /** sets a certain object at a certain index without retaining. Use it with caution \n     * @js NA\n     * @lua NA\n     */\n    void fastSetObject(Object* object, ssize_t index)\n    {\n#if CC_USE_ARRAY_VECTOR\n        setObject(object, index);\n#else\n        // no retain\n        data->arr[index] = object;\n#endif\n    }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void swap( ssize_t indexOne, ssize_t indexTwo )\n    {\n        CCASSERT(indexOne >=0 && indexOne < count() && indexTwo >= 0 && indexTwo < count(), \"Invalid indices\");\n#if CC_USE_ARRAY_VECTOR\n        std::swap(data[indexOne], data[indexTwo]);\n#else\n        std::swap(data->arr[indexOne], data->arr[indexTwo]);\n#endif\n    }\n\n    // Removing Objects\n\n    /** Remove last object \n     * @js NA\n     */\n    void removeLastObject(bool releaseObj = true);\n    /** Remove a certain object \n     * @js NA\n     */\n    void removeObject(Object* object, bool releaseObj = true);\n    /** Remove an element with a certain index \n     * @js NA\n     */\n    void removeObjectAtIndex(ssize_t index, bool releaseObj = true);\n    /** Remove all elements \n     * @js NA\n     */\n    void removeObjectsInArray(__Array* otherArray);\n    /** Remove all objects \n     * @js NA\n     */\n    void removeAllObjects();\n    /** Fast way to remove a certain object \n     * @js NA\n     */\n    void fastRemoveObject(Object* object);\n    /** Fast way to remove an element with a certain index \n     * @js NA\n     */\n    void fastRemoveObjectAtIndex(ssize_t index);\n\n    // Rearranging Content\n\n    /** Swap two elements \n     * @js NA\n     */\n    void exchangeObject(Object* object1, Object* object2);\n    /** Swap two elements with certain indexes \n     * @js NA\n     */\n    void exchangeObjectAtIndex(ssize_t index1, ssize_t index2);\n\n    /** Replace object at index with another object. \n     * @js NA\n     */\n    void replaceObjectAtIndex(ssize_t index, Object* object, bool releaseObject = true);\n\n    /** Revers the array \n     * @js NA\n     */\n    void reverseObjects();\n    /* Shrinks the array so the memory footprint corresponds with the number of items \n     * @js NA\n     */\n    void reduceMemoryFootprint();\n  \n    /* override functions \n     * @js NA\n     */\n    virtual void acceptVisitor(DataVisitor &visitor);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual __Array* clone() const;\n\n    // ------------------------------------------\n    // Iterators\n    // ------------------------------------------\n#if CC_USE_ARRAY_VECTOR\n    typedef std::vector<RCPtr<Object>>::iterator iterator;\n    typedef std::vector<RCPtr<Object>>::const_iterator const_iterator;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    iterator begin() { return data.begin(); }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    iterator end() { return data.end(); }\n    const_iterator cbegin() { return data.cbegin(); }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    const_iterator cend() { return data.cend(); }\n\n    std::vector<RCPtr<Object>> data;\n\n#else\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Object** begin() { return &data->arr[0]; }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Object** end() { return &data->arr[data->num]; }\n\n    ccArray* data;\n\n#endif\n\n//protected:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    __Array();\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif // __CCARRAY_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCAutoreleasePool.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCAutoreleasePool.h\"\n#include \"ccMacros.h\"\n\nNS_CC_BEGIN\n\nAutoreleasePool::AutoreleasePool()\n: _name(\"\")\n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n, _isClearing(false)\n#endif\n{\n    _managedObjectArray.reserve(150);\n    PoolManager::getInstance()->push(this);\n}\n\nAutoreleasePool::AutoreleasePool(const std::string &name)\n: _name(name)\n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n, _isClearing(false)\n#endif\n{\n    _managedObjectArray.reserve(150);\n    PoolManager::getInstance()->push(this);\n}\n\nAutoreleasePool::~AutoreleasePool()\n{\n    CCLOGINFO(\"deallocing AutoreleasePool: %p\", this);\n    clear();\n    \n    PoolManager::getInstance()->pop();\n}\n\nvoid AutoreleasePool::addObject(Object* object)\n{\n    _managedObjectArray.push_back(object);\n}\n\nvoid AutoreleasePool::clear()\n{\n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n    _isClearing = true;\n#endif\n    for (const auto &obj : _managedObjectArray)\n    {\n        obj->release();\n    }\n    _managedObjectArray.clear();\n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n    _isClearing = false;\n#endif\n}\n\nbool AutoreleasePool::contains(Object* object) const\n{\n    for (const auto& obj : _managedObjectArray)\n    {\n        if (obj == object)\n            return true;\n    }\n    return false;\n}\n\nvoid AutoreleasePool::dump()\n{\n    CCLOG(\"autorelease pool: %s, number of managed object %d\\n\", _name.c_str(), static_cast<int>(_managedObjectArray.size()));\n    CCLOG(\"%20s%20s%20s\", \"Object pointer\", \"Object id\", \"reference count\");\n    for (const auto &obj : _managedObjectArray)\n    {\n        CCLOG(\"%20p%20u%20u\\n\", obj, obj->_ID, obj->getReferenceCount());\n    }\n}\n\n\n//--------------------------------------------------------------------\n//\n// PoolManager\n//\n//--------------------------------------------------------------------\n\nPoolManager* PoolManager::s_singleInstance = nullptr;\n\nPoolManager* PoolManager::getInstance()\n{\n    if (s_singleInstance == nullptr)\n    {\n        s_singleInstance = new PoolManager();\n        // Add the first auto release pool\n        s_singleInstance->_curReleasePool = new AutoreleasePool(\"cocos2d autorelease pool\");\n        s_singleInstance->_releasePoolStack.push_back(s_singleInstance->_curReleasePool);\n    }\n    return s_singleInstance;\n}\n\nvoid PoolManager::destroyInstance()\n{\n    delete s_singleInstance;\n    s_singleInstance = nullptr;\n}\n\nPoolManager::PoolManager()\n{\n}\n\nPoolManager::~PoolManager()\n{\n    CCLOGINFO(\"deallocing PoolManager: %p\", this);\n    \n    while (!_releasePoolStack.empty())\n    {\n        AutoreleasePool* pool = _releasePoolStack.back();\n        _releasePoolStack.pop_back();\n        \n        delete pool;\n    }\n}\n\n\nAutoreleasePool* PoolManager::getCurrentPool() const\n{\n    return _curReleasePool;\n}\n\nbool PoolManager::isObjectInPools(Object* obj) const\n{\n    for (const auto& pool : _releasePoolStack)\n    {\n        if (pool->contains(obj))\n            return true;\n    }\n    return false;\n}\n\nvoid PoolManager::push(AutoreleasePool *pool)\n{\n    _releasePoolStack.push_back(pool);\n    _curReleasePool = pool;\n}\n\nvoid PoolManager::pop()\n{\n    // Can not pop the pool that created by engine\n    CC_ASSERT(_releasePoolStack.size() >= 1);\n    \n    _releasePoolStack.pop_back();\n    \n    // Should update _curReleasePool if a temple pool is released\n    if (_releasePoolStack.size() > 1)\n    {\n        _curReleasePool = _releasePoolStack.back();\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCAutoreleasePool.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __AUTORELEASEPOOL_H__\n#define __AUTORELEASEPOOL_H__\n\n#include <stack>\n#include <vector>\n#include <string>\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup base_nodes\n * @{\n */\n\nclass CC_DLL AutoreleasePool\n{\npublic:\n    /**\n     * @warn Don't create an auto release pool in heap, create it in stack.\n     * @js NA\n     * @lua NA\n     */\n    AutoreleasePool();\n    \n    /**\n     * Create an autorelease pool with specific name. This name is useful for debugging.\n     */\n    AutoreleasePool(const std::string &name);\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~AutoreleasePool();\n\n    /**\n     * Add a given object to this pool.\n     *\n     * The same object may be added several times to the same pool; When the\n     * pool is destructed, the object's Object::release() method will be called\n     * for each time it was added.\n     *\n     * @param object    The object to add to the pool.\n     * @js NA\n     * @lua NA\n     */\n    void addObject(Object *object);\n\n    /**\n     * Clear the autorelease pool.\n     *\n     * Object::release() will be called for each time the managed object is\n     * added to the pool.\n     * @js NA\n     * @lua NA\n     */\n    void clear();\n    \n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n    /**\n     * Whether the pool is doing `clear` operation.\n     */\n    bool isClearing() const { return _isClearing; };\n#endif\n    \n    /**\n     * Checks whether the pool contains the specified object.\n     */\n    bool contains(Object* object) const;\n\n    /**\n     * Dump the objects that are put into autorelease pool. It is used for debugging.\n     *\n     * The result will look like:\n     * Object pointer address     object id     reference count\n     *\n     */\n    void dump();\n    \nprivate:\n    /**\n     * The underlying array of object managed by the pool.\n     *\n     * Although Array retains the object once when an object is added, proper\n     * Object::release() is called outside the array to make sure that the pool\n     * does not affect the managed object's reference count. So an object can\n     * be destructed properly by calling Object::release() even if the object\n     * is in the pool.\n     */\n    std::vector<Object*> _managedObjectArray;\n    std::string _name;\n    \n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n    /**\n     *  The flag for checking whether the pool is doing `clear` operation.\n     */\n    bool _isClearing;\n#endif\n};\n\nclass CC_DLL PoolManager\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static PoolManager* sharedPoolManager() { return getInstance(); }\n    static PoolManager* getInstance();\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static void purgePoolManager() { destroyInstance(); }\n    static void destroyInstance();\n    \n    /**\n     * Get current auto release pool, there is at least one auto release pool that created by engine.\n     * You can create your own auto release pool at demand, which will be put into auto releae pool stack.\n     */\n    AutoreleasePool *getCurrentPool() const;\n\n    bool isObjectInPools(Object* obj) const;\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    friend class AutoreleasePool;\n    \nprivate:\n    PoolManager();\n    ~PoolManager();\n    \n    void push(AutoreleasePool *pool);\n    void pop();\n    \n    static PoolManager* s_singleInstance;\n    \n    std::deque<AutoreleasePool*> _releasePoolStack;\n    AutoreleasePool *_curReleasePool;\n};\n\n// end of base_nodes group\n/// @}\n\nNS_CC_END\n\n#endif //__AUTORELEASEPOOL_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCBool.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCBOOL_H__\n#define __CCBOOL_H__\n\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\nclass CC_DLL __Bool : public Object, public Clonable\n{\npublic:\n    __Bool(bool v)\n        : _value(v) {}\n    bool getValue() const {return _value;}\n\n    static __Bool* create(bool v)\n    {\n        __Bool* pRet = new __Bool(v);\n        if (pRet)\n        {\n            pRet->autorelease();\n        }\n        return pRet;\n    }\n\n    /* override functions */\n    virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); }\n\n    __Bool* clone() const\n    {\n        return __Bool::create(_value);\n    }\nprivate:\n    bool _value;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCBOOL_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCConsole.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCConsole.h\"\n\n#include <thread>\n#include <algorithm>\n\n#include <stdio.h>\n#include <time.h>\n#include <fcntl.h>\n\n#if defined(_MSC_VER) || defined(__MINGW32__)\n#include <io.h>\n#include <WS2tcpip.h>\n\n#define bzero(a, b) memset(a, 0, b);\n\n#else\n#include <netdb.h>\n#include <unistd.h>\n#include <arpa/inet.h>\n#include <netinet/in.h>\n#include <sys/socket.h>\n#include <sys/un.h>\n#endif\n\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n#include \"CCScene.h\"\n#include \"CCPlatformConfig.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCConfiguration.h\"\n#include \"CCTextureCache.h\"\n\nNS_CC_BEGIN\n\n\n// helper free functions\n\n// dprintf() is not defined in Android\n// so we add our own 'dpritnf'\nstatic ssize_t mydprintf(int sock, const char *format, ...)\n{\n    va_list args;\n\tchar buf[16386];\n\n\tva_start(args, format);\n\tvsnprintf(buf, sizeof(buf), format, args);\n\tva_end(args);\n\n\treturn write(sock, buf, strlen(buf));\n}\n\nstatic int printSceneGraph(int fd, Node* node, int level)\n{\n    int total = 1;\n    for(int i=0; i<level; ++i)\n        write(fd, \"-\", 1);\n\n    mydprintf(fd, \" %s\\n\", node->getDescription().c_str());\n\n    for(const auto& child: node->getChildren())\n        total += printSceneGraph(fd, child, level+1);\n\n    return total;\n}\n\nstatic void printSceneGraphBoot(int fd)\n{\n    write(fd,\"\\n\",1);\n    auto scene = Director::getInstance()->getRunningScene();\n    int total = printSceneGraph(fd, scene, 0);\n    mydprintf(fd, \"Total Nodes: %d\\n\", total);\n}\n\nstatic void printFileUtils(int fd)\n{\n    FileUtils* fu = FileUtils::getInstance();\n\n    mydprintf(fd, \"\\nSearch Paths:\\n\");\n    auto list = fu->getSearchPaths();\n    for( const auto &item : list) {\n        mydprintf(fd, \"%s\\n\", item.c_str());\n    }\n\n    mydprintf(fd, \"\\nResolution Order:\\n\");\n    list = fu->getSearchResolutionsOrder();\n    for( const auto &item : list) {\n        mydprintf(fd, \"%s\\n\", item.c_str());\n    }\n\n    mydprintf(fd, \"\\nWriteble Path:\\n\");\n    mydprintf(fd, \"%s\\n\", fu->getWritablePath().c_str());\n\n    mydprintf(fd, \"\\nFull Path Cache:\\n\");\n    auto cache = fu->getFullPathCache();\n    for( const auto &item : cache) {\n        mydprintf(fd, \"%s -> %s\\n\", item.first.c_str(), item.second.c_str());\n    }\n}\n\n\n#if defined(__MINGW32__)\nstatic const char* inet_ntop(int af, const void* src, char* dst, int cnt)\n{\n    struct sockaddr_in srcaddr;\n\n    memset(&srcaddr, 0, sizeof(struct sockaddr_in));\n    memcpy(&(srcaddr.sin_addr), src, sizeof(srcaddr.sin_addr));\n\n    srcaddr.sin_family = af;\n    if (WSAAddressToString((struct sockaddr*) &srcaddr, sizeof(struct sockaddr_in), 0, dst, (LPDWORD) &cnt) != 0)\n    {\n        return nullptr;\n    }\n    return dst;\n}\n#endif\n\n\n//\n// Free functions to log\n//\n\nstatic void _log(const char *format, va_list args)\n{\n    char buf[MAX_LOG_LENGTH];\n\n    vsnprintf(buf, MAX_LOG_LENGTH-3, format, args);\n    strcat(buf, \"\\n\");\n\n#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID\n    __android_log_print(ANDROID_LOG_DEBUG, \"cocos2d-x debug info\",  \"%s\", buf);\n\n#elif CC_TARGET_PLATFORM ==  CC_PLATFORM_WIN32\n    WCHAR wszBuf[MAX_LOG_LENGTH] = {0};\n    MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf));\n    OutputDebugStringW(wszBuf);\n    OutputDebugStringA(\"\\n\");\n\n    WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE);\n    printf(\"%s\\n\", buf);\n\n#else\n    // Linux, Mac, iOS, etc\n    fprintf(stdout, \"cocos2d: %s\", buf);\n    fflush(stdout);\n#endif\n\n    Director::getInstance()->getConsole()->log(buf);\n}\n\n// XXX: Deprecated\nvoid CCLog(const char * format, ...)\n{\n    va_list args;\n    va_start(args, format);\n    _log(format, args);\n    va_end(args);\n}\n\nvoid log(const char * format, ...)\n{\n    va_list args;\n    va_start(args, format);\n    _log(format, args);\n    va_end(args);\n}\n\n//\n// Console code\n//\n\nConsole::Console()\n: _listenfd(-1)\n, _running(false)\n, _endThread(false)\n, _userCommands(nullptr)\n, _maxUserCommands(0)\n, _sendDebugStrings(false)\n{\n    // VS2012 doesn't support initializer list, so we create a new array and assign its elements to '_command'.\n\tCommand commands[] = {     \n        { \"config\", std::bind(&Console::commandConfig, this, std::placeholders::_1, std::placeholders::_2) },\n        { \"debug msg on\", [&](int fd, const char* command) {\n            _sendDebugStrings = true;\n        } },\n        { \"debug msg off\", [&](int fd, const char* command) {\n            _sendDebugStrings = false;\n        } },\n        { \"exit\", std::bind(&Console::commandExit, this, std::placeholders::_1, std::placeholders::_2) },\n        { \"fileutils dump\", std::bind(&Console::commandFileUtilsDump, this, std::placeholders::_1, std::placeholders::_2) },\n        { \"fps on\", [](int fd, const char* command) {\n            Director *dir = Director::getInstance();\n            Scheduler *sched = dir->getScheduler();\n            sched->performFunctionInCocosThread( std::bind(&Director::setDisplayStats, dir, true));\n        } },\n        { \"fps off\", [](int fd, const char* command) {\n            Director *dir = Director::getInstance();\n            Scheduler *sched = dir->getScheduler();\n            sched->performFunctionInCocosThread( std::bind(&Director::setDisplayStats, dir, false));\n        } },\n        { \"help\", std::bind(&Console::commandHelp, this, std::placeholders::_1, std::placeholders::_2) },\n        { \"scene graph\", std::bind(&Console::commandSceneGraph, this, std::placeholders::_1, std::placeholders::_2) },\n        { \"textures\", std::bind(&Console::commandTextures, this, std::placeholders::_1, std::placeholders::_2) },\n    };\n\n    _maxCommands = sizeof(commands)/sizeof(commands[0]);\n\tfor (int i = 0; i < _maxCommands; ++i)\n\t{\n\t\t_commands[i] = commands[i];\n\t}\n}\n\nConsole::~Console()\n{\n    stop();\n}\n\nbool Console::listenOnTCP(int port)\n{\n    int listenfd, n;\n    const int on = 1;\n    struct addrinfo hints, *res, *ressave;\n    char serv[30];\n\n    snprintf(serv, sizeof(serv)-1, \"%d\", port );\n    serv[sizeof(serv)-1]=0;\n\n    bzero(&hints, sizeof(struct addrinfo));\n    hints.ai_flags = AI_PASSIVE;\n    hints.ai_family = AF_INET; // AF_UNSPEC: Do we need IPv6 ?\n    hints.ai_socktype = SOCK_STREAM;\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n    WSADATA wsaData;\n    n = WSAStartup(MAKEWORD(2, 2),&wsaData);\n#endif\n\n    if ( (n = getaddrinfo(NULL, serv, &hints, &res)) != 0) {\n        fprintf(stderr,\"net_listen error for %s: %s\", serv, gai_strerror(n));\n        return false;\n    }\n\n    ressave = res;\n\n    do {\n        listenfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);\n        if (listenfd < 0)\n            continue;       /* error, try next one */\n\n        setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (const char*)&on, sizeof(on));\n        if (bind(listenfd, res->ai_addr, res->ai_addrlen) == 0)\n            break;          /* success */\n\n        close(listenfd);    /* bind error, close and try next one */\n    } while ( (res = res->ai_next) != NULL);\n    \n    if (res == NULL) {\n        perror(\"net_listen:\");\n        freeaddrinfo(ressave);\n        return false;\n    }\n\n    listen(listenfd, 50);\n\n    if (res->ai_family == AF_INET) {\n        char buf[INET_ADDRSTRLEN] = \"\";\n        struct sockaddr_in *sin = (struct sockaddr_in*) res->ai_addr;\n        if( inet_ntop(res->ai_family, &sin->sin_addr, buf, sizeof(buf)) != NULL )\n            cocos2d::log(\"Console: listening on  %s : %d\", buf, ntohs(sin->sin_port));\n        else\n            perror(\"inet_ntop\");\n    } else if (res->ai_family == AF_INET6) {\n        char buf[INET6_ADDRSTRLEN] = \"\";\n        struct sockaddr_in6 *sin = (struct sockaddr_in6*) res->ai_addr;\n        if( inet_ntop(res->ai_family, &sin->sin6_addr, buf, sizeof(buf)) != NULL )\n            cocos2d::log(\"Console: listening on  %s : %d\", buf, ntohs(sin->sin6_port));\n        else\n            perror(\"inet_ntop\");\n    }\n\n\n    freeaddrinfo(ressave);\n\n    return listenOnFileDescriptor(listenfd);\n}\n\nbool Console::listenOnFileDescriptor(int fd)\n{\n    if(_running) {\n        cocos2d::log(\"Console already started. 'stop' it before calling 'listen' again\");\n        return false;\n    }\n\n    _listenfd = fd;\n    _thread = std::thread( std::bind( &Console::loop, this) );\n\n    return true;\n}\n\nvoid Console::stop()\n{\n    if( _running ) {\n        _endThread = true;\n        _thread.join();\n    }\n}\n\nvoid Console::setUserCommands(Command *commands, int numberOfCommands)\n{\n    _userCommands = commands;\n    _maxUserCommands = numberOfCommands;\n}\n\n\n//\n// commands\n//\n\nvoid Console::commandHelp(int fd, const char* command)\n{\n    const char help[] = \"\\nAvailable commands:\\n\";\n    write(fd, help, sizeof(help));\n    for(int i=0; i<_maxCommands; ++i) {\n        write(fd,\"\\t\",1);\n        write(fd, _commands[i].name, strlen(_commands[i].name));\n        write(fd,\"\\n\",1);\n    }\n\n    // User commands\n    for(int i=0; i<_maxUserCommands; ++i) {\n        write(fd,\"\\t\",1);\n        write(fd, _userCommands[i].name, strlen(_userCommands[i].name));\n        write(fd,\"\\n\",1);\n    }\n\n}\n\nvoid Console::commandExit(int fd, const char *command)\n{\n    FD_CLR(fd, &_read_set);\n    _fds.erase(std::remove(_fds.begin(), _fds.end(), fd), _fds.end());\n    close(fd);\n}\n\nvoid Console::commandSceneGraph(int fd, const char *command)\n{\n    Scheduler *sched = Director::getInstance()->getScheduler();\n    sched->performFunctionInCocosThread( std::bind(&printSceneGraphBoot, fd) );\n}\n\nvoid Console::commandFileUtilsDump(int fd, const char *command)\n{\n    Scheduler *sched = Director::getInstance()->getScheduler();\n    sched->performFunctionInCocosThread( std::bind(&printFileUtils, fd) );\n}\n\nvoid Console::commandConfig(int fd, const char *command)\n{\n    Scheduler *sched = Director::getInstance()->getScheduler();\n    sched->performFunctionInCocosThread( [&](){\n        mydprintf(fd, \"%s\", Configuration::getInstance()->getInfo().c_str());\n    }\n                                        );\n}\n\nvoid Console::commandTextures(int fd, const char *command)\n{\n    Scheduler *sched = Director::getInstance()->getScheduler();\n    sched->performFunctionInCocosThread( [&](){\n        mydprintf(fd, \"%s\", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str());\n    }\n                                        );\n}\n\n\nbool Console::parseCommand(int fd)\n{\n    auto r = readline(fd);\n    if(r < 1)\n        return false;\n\n    bool found=false;\n    for(int i=0; i < _maxCommands; ++i) {\n        if( strncmp(_buffer, _commands[i].name,strlen(_commands[i].name)) == 0 ) {\n            // XXX TODO FIXME\n            // Ideally this loop should execute the function in the cocos2d according to a variable\n            // But clang crashes in runtime when doing that (bug in clang, not in the code).\n            // So, unfortunately, the only way to fix it was to move that logic to the callback itself\n            _commands[i].callback(fd, _buffer);\n            found = true;\n            break;\n        }\n    }\n\n    // user commands\n    for(int i=0; i < _maxUserCommands && !found; ++i) {\n        if( strncmp(_buffer, _userCommands[i].name,strlen(_userCommands[i].name)) == 0 ) {\n            _userCommands[i].callback(fd, _buffer);\n            found = true;\n            break;\n        }\n    }\n\n    if(!found && strcmp(_buffer, \"\\r\\n\")!=0) {\n        const char err[] = \"Unknown command. Type 'help' for options\\n\";\n        write(fd, err, sizeof(err));\n    }\n\n    sendPrompt(fd);\n\n    return true;\n}\n\n//\n// Helpers\n//\nvoid Console::sendPrompt(int fd)\n{\n    const char prompt[] = \"\\n> \";\n    write(fd, prompt, sizeof(prompt));\n}\n\nssize_t Console::readline(int fd)\n{\n    int maxlen = sizeof(_buffer)-1;\n    ssize_t n, rc;\n    char c, *ptr;\n\n    ptr = _buffer;\n\n    for( n=1; n<maxlen; n++ ) {\n        if( (rc = read(fd, &c, 1 )) ==1 ) {\n            *ptr++ = c;\n            if( c=='\\n' )\n                break;\n        } else if( rc == 0 ) {\n            return 0;\n        } else if( errno == EINTR ) {\n            continue;\n        } else {\n            return -1;\n        }\n    }\n\n    *ptr = 0;\n    return n;\n}\n\nvoid Console::addClient()\n{\n    struct sockaddr client;\n    socklen_t client_len;\n\n    /* new client */\n    client_len = sizeof( client );\n    int fd = accept(_listenfd, (struct sockaddr *)&client, &client_len );\n\n    // add fd to list of FD\n    if( fd != -1 ) {\n        FD_SET(fd, &_read_set);\n        _fds.push_back(fd);\n        _maxfd = std::max(_maxfd,fd);\n\n        sendPrompt(fd);\n    }\n}\n\nvoid Console::log(const char* buf)\n{\n    if( _sendDebugStrings ) {\n        _DebugStringsMutex.lock();\n        _DebugStrings.push_back(buf);\n        _DebugStringsMutex.unlock();\n    }\n}\n\n//\n// Main Loop\n//\n\nvoid Console::loop()\n{\n    fd_set copy_set;\n    struct timeval timeout, timeout_copy;\n\n    _running = true;\n\n    FD_ZERO(&_read_set);\n    FD_SET(_listenfd, &_read_set);\n    _maxfd = _listenfd;\n\n    timeout.tv_sec = 0;\n\n    /* 0.016 seconds. Wake up once per frame at 60PFS */\n    timeout.tv_usec = 016000;\n\n    while(!_endThread) {\n\n        copy_set = _read_set;\n        timeout_copy = timeout;\n        int nready = select(_maxfd+1, &copy_set, NULL, NULL, &timeout_copy);\n\n        if( nready == -1 )\n        {\n            /* error */\n            if(errno != EINTR)\n                log(\"Abnormal error in select()\\n\");\n            continue;\n        }\n        else if( nready == 0 )\n        {\n            /* timeout. do somethig ? */\n        }\n        else\n        {\n            /* new client */\n            if(FD_ISSET(_listenfd, &copy_set)) {\n                addClient();\n                if(--nready <= 0)\n                    continue;\n            }\n\n            /* data from client */\n            std::vector<int> to_remove;\n            for(const auto &fd: _fds) {\n                if(FD_ISSET(fd,&copy_set)) {\n                    if( ! parseCommand(fd) ) {\n                        to_remove.push_back(fd);\n                    }\n                    if(--nready <= 0)\n                        break;\n                }\n            }\n\n            /* remove closed conections */\n            for(int fd: to_remove) {\n                FD_CLR(fd, &_read_set);\n                _fds.erase(std::remove(_fds.begin(), _fds.end(), fd), _fds.end());\n            }\n        }\n\n        /* Any message for the remote console ? send it! */\n        if( !_DebugStrings.empty() ) {\n            _DebugStringsMutex.lock();\n            for(const auto &str : _DebugStrings) {\n                for(const auto &fd : _fds) {\n                    write(fd, str.c_str(), str.length());\n                }\n            }\n            _DebugStrings.clear();\n            _DebugStringsMutex.unlock();\n        }\n    }\n\n    // clean up: ignore stdin, stdout and stderr\n    for(const auto &fd: _fds )\n        close(fd);\n    close(_listenfd);\n\n    _running = false;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCConsole.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef __CCCONSOLE_H__\n#define __CCCONSOLE_H__\n\n#if defined(_MSC_VER) || defined(__MINGW32__)\n#include <BaseTsd.h>\n#include <WinSock2.h>\n//typedef SSIZE_T ssize_t;\n// ssize_t was redefined as int in libwebsockets.h.\n// Therefore, to avoid conflict, we needs the same definition.\ntypedef int ssize_t;\n#else\n#include <sys/select.h>\n#endif\n\n#include <thread>\n#include <vector>\n#include <functional>\n#include <string>\n#include <mutex>\n\n#include <stdarg.h>\n\n#include \"ccMacros.h\"\n#include \"CCPlatformMacros.h\"\n\n\nNS_CC_BEGIN\n\n/// The max length of CCLog message.\nstatic const int MAX_LOG_LENGTH = 16*1024;\n\n/**\n @brief Output Debug message.\n */\nvoid CC_DLL log(const char * format, ...) CC_FORMAT_PRINTF(1, 2);\n\n/** Console is helper class that lets the developer control the game from TCP connection.\n Console will spawn a new thread that will listen to a specified TCP port.\n Console has a basic token parser. Each token is associated with an std::function<void(int)>.\n If the std::function<> needs to use the cocos2d API, it needs to call\n \n ```\n scheduler->performFunctionInCocosThread( ... );\n ```\n */\nclass CC_DLL Console\n{\npublic:\n    struct Command {\n        const char *name;\n        std::function<void(int, const char*)> callback;\n    };\n\n    /** Constructor */\n    Console();\n\n    /** Destructor */\n    virtual ~Console();\n\n    /** starts listening to specifed TCP port */\n    bool listenOnTCP(int port);\n\n    /** starts listening to specifed file descriptor */\n    bool listenOnFileDescriptor(int fd);\n\n    /** stops the Console. 'stop' will be called at destruction time as well */\n    void stop();\n\n    /** sets user tokens */\n    void setUserCommands( Command* commands, int numberOfCommands);\n\n    /** log something in the console */\n    void log(const char *buf);\n\nprotected:\n    void loop();\n    ssize_t readline(int fd);\n    bool parseCommand(int fd);\n    void sendPrompt(int fd);\n    void addClient();\n\n    // Add commands here\n    void commandHelp(int fd, const char *command);\n    void commandExit(int fd, const char *command);\n    void commandSceneGraph(int fd, const char *command);\n    void commandFileUtilsDump(int fd, const char *command);\n    void commandConfig(int fd, const char *command);\n    void commandTextures(int fd, const char *command);\n\n    // file descriptor: socket, console, etc.\n    int _listenfd;\n    int _maxfd;\n    std::vector<int> _fds;\n    std::thread _thread;\n\n    fd_set _read_set;\n\n    bool _running;\n    bool _endThread;\n\n    char _buffer[512];\n\n    struct Command _commands[64];\n    int _maxCommands;\n    struct Command *_userCommands;\n    int _maxUserCommands;\n\n\n    // strings generated by cocos2d sent to the remote console\n    bool _sendDebugStrings;\n    std::mutex _DebugStringsMutex;\n    std::vector<std::string> _DebugStrings;\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Console);\n};\n\n\nNS_CC_END\n\n#endif /* defined(__CCCONSOLE_H__) */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCData.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCData.h\"\n#include \"platform/CCCommon.h\"\n#include \"ccMacros.h\"\n\n#include <string>\n\nNS_CC_BEGIN\n\nconst Data Data::Null;\n\nData::Data() :\n_bytes(nullptr),\n_size(0)\n{\n    CCLOGINFO(\"In the empty constructor of Data.\");\n}\n\nData::Data(Data&& other) :\n_bytes(nullptr),\n_size(0)\n{\n    CCLOGINFO(\"In the move constructor of Data.\");\n    move(other);\n}\n\nData::Data(const Data& other) :\n_bytes(nullptr),\n_size(0)\n{\n    CCLOGINFO(\"In the copy constructor of Data.\");\n    copy(other._bytes, other._size);\n}\n\nData::~Data()\n{\n    CCLOGINFO(\"deallocing Data: %p\", this);\n    clear();\n}\n\nData& Data::operator= (const Data& other)\n{\n    CCLOGINFO(\"In the copy assignment of Data.\");\n    copy(other._bytes, other._size);\n    return *this;\n}\n\nData& Data::operator= (Data&& other)\n{\n    CCLOGINFO(\"In the move assignment of Data.\");\n    move(other);\n    return *this;\n}\n\nvoid Data::move(Data& other)\n{\n    _bytes = other._bytes;\n    _size = other._size;\n    \n    other._bytes = nullptr;\n    other._size = 0;\n}\n\nbool Data::isNull() const\n{\n    return (_bytes == nullptr || _size == 0);\n}\n\nunsigned char* Data::getBytes() const\n{\n    return _bytes;\n}\n\nssize_t Data::getSize() const\n{\n    return _size;\n}\n\nvoid Data::copy(unsigned char* bytes, const ssize_t size)\n{\n    clear();\n    \n    if (size > 0)\n    {\n        _size = size;\n        _bytes = (unsigned char*)malloc(sizeof(unsigned char) * _size);\n        memcpy(_bytes, bytes, _size);\n    }\n}\n\nvoid Data::fastSet(unsigned char* bytes, const ssize_t size)\n{\n    _bytes = bytes;\n    _size = size;\n}\n\nvoid Data::clear()\n{\n    free(_bytes);\n    _bytes = nullptr;\n    _size = 0;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCData.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCDATA_H__\n#define __CCDATA_H__\n\n#include \"CCPlatformMacros.h\"\n#include <stdint.h> // for ssize_t on android\n#include <string>   // for ssize_t on linux\n#include \"CCStdC.h\" // for ssize_t on window\n\nNS_CC_BEGIN\n\nclass CC_DLL Data\n{\npublic:\n    static const Data Null;\n    \n    Data();\n    Data(const Data& other);\n    Data(Data&& other);\n    ~Data();\n    \n    // Assignment operator\n    Data& operator= (const Data& other);\n    Data& operator= (Data&& other);\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    unsigned char* getBytes() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ssize_t getSize() const;\n    \n    /** Copies the buffer pointer and its size.\n     *  @note This method will copy the whole buffer.\n     *        Developer should free the pointer after invoking this method.\n     *  @see Data::fastSet\n     */\n    void copy(unsigned char* bytes, const ssize_t size);\n    \n    /** Fast set the buffer pointer and its size. Please use it carefully.\n     *  @param bytes The buffer pointer, note that it have to be allocated by 'malloc' or 'calloc',\n     *         since in the destructor of Data, the buffer will be deleted by 'free'.\n     *  @note 1. This method will move the ownship of 'bytes'pointer to Data,\n     *        2. The pointer should not be used outside after it was passed to this method.\n     *  @see Data::copy\n     */\n    void fastSet(unsigned char* bytes, const ssize_t size);\n    \n    /** Clears data, free buffer and reset data size */\n    void clear();\n    \n    /** Check whether the data is null. */\n    bool isNull() const;\n    \nprivate:\n    void move(Data& other);\n    \nprivate:\n    unsigned char* _bytes;\n    ssize_t _size;\n};\n\nNS_CC_END\n\n#endif // __CCDATA_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCDataVisitor.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCObject.h\"\n#include \"CCBool.h\"\n#include \"CCInteger.h\"\n#include \"CCFloat.h\"\n#include \"CCDouble.h\"\n#include \"CCString.h\"\n#include \"CCArray.h\"\n#include \"CCDictionary.h\"\n#include \"CCSet.h\"\n\nNS_CC_BEGIN\n\nvoid DataVisitor::visit(const __Bool *value)\n{\n    visitObject(value);\n}\n\nvoid DataVisitor::visit(const __Integer *value)\n{\n    visitObject(value);\n}\n\nvoid DataVisitor::visit(const __Float *value)\n{\n    visitObject(value);\n}\n\nvoid DataVisitor::visit(const __Double *value)\n{\n    visitObject(value);\n}\n\nvoid DataVisitor::visit(const __String *value)\n{\n    visitObject(value);\n}\n\nvoid DataVisitor::visit(const __Array *value)\n{\n    visitObject(value);\n}\n\nvoid DataVisitor::visit(const __Dictionary *value)\n{\n    visitObject(value);\n}\n\nvoid DataVisitor::visit(const __Set *value)\n{\n    visitObject(value);\n}\n\n// PrettyPrinter\nPrettyPrinter::PrettyPrinter(int indentLevel/* = 0 */)\n{\n    setIndentLevel(indentLevel);\n}\n\nvoid PrettyPrinter::clear()\n{\n    _result.clear();\n}\n\nstd::string PrettyPrinter::getResult()\n{\n    return _result;\n}\n\nvoid PrettyPrinter::visitObject(const Object *p)\n{\n    char buf[50] = {0};\n    sprintf(buf, \"%p\", p);\n    _result += buf;\n}\n\nvoid PrettyPrinter::visit(const __Bool * p)\n{\n    char buf[50] = {0};\n    sprintf(buf, \"%s\", p->getValue() ? \"true\" : \"false\");\n   _result += buf;\n}\n\nvoid PrettyPrinter::visit(const __Integer *p)\n{\n    char buf[50] = {0};\n    sprintf(buf, \"%d\", p->getValue());\n    _result += buf;\n}\n\nvoid PrettyPrinter::visit(const __Float *p)\n{\n    char buf[50] = {0};\n    sprintf(buf, \"%f\", p->getValue());\n    _result += buf;\n}\n\nvoid PrettyPrinter::visit(const __Double *p)\n{\n    char buf[50] = {0};\n    sprintf(buf, \"%lf\", p->getValue());\n    _result += buf;\n}\n\nvoid PrettyPrinter::visit(const __String *p)\n{\n    _result += p->getCString();\n}\n\nvoid PrettyPrinter::visit(const __Array *p)\n{\n    _result += \"\\n\";\n    _result += _indentStr;\n    _result += \"<array>\\n\";\n\n    setIndentLevel(_indentLevel+1);\n    Object* obj;\n    int i = 0;\n    char buf[50] = {0};\n    CCARRAY_FOREACH(p, obj)\n    {\n        if (i > 0) {\n            _result += \"\\n\";\n        }\n        sprintf(buf, \"%s%02d: \", _indentStr.c_str(), i);\n        _result += buf;\n        PrettyPrinter v(_indentLevel);\n        obj->acceptVisitor(v);\n        _result += v.getResult();\n        i++;\n    }\n    setIndentLevel(_indentLevel-1);\n    \n    _result += \"\\n\";\n    _result += _indentStr;\n    _result += \"</array>\";\n}\n\nvoid PrettyPrinter::visit(const __Dictionary *p)\n{\n    _result += \"\\n\";\n    _result += _indentStr;\n    _result += \"<dict>\\n\";\n    \n    setIndentLevel(_indentLevel+1);\n    DictElement* element;\n    bool bFirstElement = true;\n    char buf[1000] = {0};\n    CCDICT_FOREACH(p, element)\n    {\n        if (!bFirstElement) {\n            _result += \"\\n\";\n        }\n        sprintf(buf, \"%s%s: \", _indentStr.c_str(),element->getStrKey());\n        _result += buf;\n        PrettyPrinter v(_indentLevel);\n        element->getObject()->acceptVisitor(v);\n        _result += v.getResult();\n        bFirstElement = false;\n    }\n    setIndentLevel(_indentLevel-1);\n    \n    _result += \"\\n\";\n    _result += _indentStr;\n    _result += \"</dict>\";\n}\n\nvoid PrettyPrinter::visit(const __Set *p)\n{\n    _result += \"\\n\";\n    _result += _indentStr;\n    _result += \"<set>\\n\";\n    \n    setIndentLevel(_indentLevel+1);\n\n    int i = 0;\n    __Set* tmp = const_cast<__Set*>(p);\n    __SetIterator it = tmp->begin();\n\n    for (; it != tmp->end(); ++it, ++i) {\n        if (i > 0) {\n            _result += \"\\n\";\n        }\n        _result += _indentStr.c_str();\n        PrettyPrinter v(_indentLevel);\n        (*it)->acceptVisitor(v);\n        _result += v.getResult();\n    }\n    setIndentLevel(_indentLevel-1);\n    \n    _result += \"\\n\";\n    _result += _indentStr;\n    _result += \"</set>\\n\";\n}\n\nvoid PrettyPrinter::setIndentLevel(int indentLevel)\n{\n    _indentLevel = indentLevel;\n    _indentStr.clear();\n    for (int i = 0; i < _indentLevel; ++i) {\n        _indentStr += \"\\t\";\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCDataVisitor.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCDATAVISITOR_H__\n#define __CCDATAVISITOR_H__\n\n#include \"CCPlatformMacros.h\"\n#include <string>\n\nNS_CC_BEGIN\n\nclass Object;\nclass __Bool;\nclass __Integer;\nclass __Float;\nclass __Double;\nclass __String;\nclass __Array;\nclass __Dictionary;\nclass __Set;\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\n/**\n * Visitor that helps to perform action that depends on polymorphic object type\n *\n * Use cases:\n *  - data serialization,\n *  - pretty printing of Object *\n *  - safe value reading from Array, __Dictionary, Set\n *\n * Usage:\n *  1. subclass DataVisitor\n *  2. overload visit() methods for object that you need to handle\n *  3. handle other objects in visitObject()\n *  4. pass your visitor to Object::acceptVisitor()\n */\nclass CC_DLL DataVisitor\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~DataVisitor() {}\n\n    /** default method, called from non-overloaded methods and for unrecognized objects */\n    virtual void visitObject(const Object *p) = 0;\n\n    virtual void visit(const __Bool *p);\n    virtual void visit(const __Integer *p);\n    virtual void visit(const __Float *p);\n    virtual void visit(const __Double *p);\n    virtual void visit(const __String *p);\n    virtual void visit(const __Array *p);\n    virtual void visit(const __Dictionary *p);\n    virtual void visit(const __Set *p);\n};\n\n\nclass CC_DLL PrettyPrinter : public DataVisitor\n{\npublic:\n    PrettyPrinter(int indentLevel = 0);\n    \n    virtual void clear();\n    virtual std::string getResult();\n    \n    virtual void visitObject(const Object *p);\n    virtual void visit(const __Bool * p);\n    virtual void visit(const __Integer *p);\n    virtual void visit(const __Float *p);\n    virtual void visit(const __Double *p);\n    virtual void visit(const __String *p);\n    virtual void visit(const __Array *p);\n    virtual void visit(const __Dictionary *p);\n    virtual void visit(const __Set *p);\nprivate:\n    void setIndentLevel(int indentLevel);\n    int _indentLevel;\n    std::string _indentStr;\n    std::string _result;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif // __CCDATAVISITOR_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCDictionary.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2012      cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCDictionary.h\"\n#include \"CCString.h\"\n#include \"CCInteger.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCString.h\"\n#include \"CCBool.h\"\n#include \"CCInteger.h\"\n#include \"CCFloat.h\"\n#include \"CCDouble.h\"\n#include \"CCArray.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n// -----------------------------------------------------------------------\n// DictElement\n\nDictElement::DictElement(const char* pszKey, Object* pObject)\n{\n    CCASSERT(pszKey && strlen(pszKey) > 0, \"Invalid key value.\");\n    _intKey = 0;\n    const char* pStart = pszKey;\n    \n    size_t len = strlen(pszKey);\n    if (len > MAX_KEY_LEN )\n    {\n        char* pEnd = (char*)&pszKey[len-1];\n        pStart = pEnd - (MAX_KEY_LEN-1);\n    }\n    \n    strcpy(_strKey, pStart);\n    \n    _object = pObject;\n    memset(&hh, 0, sizeof(hh));\n}\n\nDictElement::DictElement(intptr_t iKey, Object* pObject)\n{\n    _strKey[0] = '\\0';\n    _intKey = iKey;\n    _object = pObject;\n    memset(&hh, 0, sizeof(hh));\n}\n\nDictElement::~DictElement()\n{\n    CCLOGINFO(\"deallocing DictElement: %p\", this);\n}\n\n// -----------------------------------------------------------------------\n// __Dictionary\n\n__Dictionary::__Dictionary()\n: _elements(NULL)\n, _dictType(kDictUnknown)\n{\n\n}\n\n__Dictionary::~__Dictionary()\n{\n    CCLOGINFO(\"deallocing __Dictionary: %p\", this);\n    removeAllObjects();\n}\n\nunsigned int __Dictionary::count()\n{\n    return HASH_COUNT(_elements);\n}\n\n__Array* __Dictionary::allKeys()\n{\n    int iKeyCount = this->count();\n    if (iKeyCount <= 0) return NULL;\n\n    __Array* array = __Array::createWithCapacity(iKeyCount);\n\n    DictElement *pElement, *tmp;\n    if (_dictType == kDictStr)\n    {\n        HASH_ITER(hh, _elements, pElement, tmp) \n        {\n            __String* pOneKey = new __String(pElement->_strKey);\n            array->addObject(pOneKey);\n            CC_SAFE_RELEASE(pOneKey);\n        }\n    }\n    else if (_dictType == kDictInt)\n    {\n        HASH_ITER(hh, _elements, pElement, tmp) \n        {\n            __Integer* pOneKey = new __Integer(static_cast<int>(pElement->_intKey));\n            array->addObject(pOneKey);\n            CC_SAFE_RELEASE(pOneKey);\n        }\n    }\n    \n    return array;\n}\n\n__Array* __Dictionary::allKeysForObject(Object* object)\n{\n    int iKeyCount = this->count();\n    if (iKeyCount <= 0) return NULL;\n    __Array* array = __Array::create();\n\n    DictElement *pElement, *tmp;\n\n    if (_dictType == kDictStr)\n    {\n        HASH_ITER(hh, _elements, pElement, tmp) \n        {\n            if (object == pElement->_object)\n            {\n                __String* pOneKey = new __String(pElement->_strKey);\n                array->addObject(pOneKey);\n                CC_SAFE_RELEASE(pOneKey);\n            }\n        }\n    }\n    else if (_dictType == kDictInt)\n    {\n        HASH_ITER(hh, _elements, pElement, tmp) \n        {\n            if (object == pElement->_object)\n            {\n                __Integer* pOneKey = new __Integer(static_cast<int>(pElement->_intKey));\n                array->addObject(pOneKey);\n                CC_SAFE_RELEASE(pOneKey);\n            }\n        }\n    }\n    return array;\n}\n\nObject* __Dictionary::objectForKey(const std::string& key)\n{\n    // if dictionary wasn't initialized, return NULL directly.\n    if (_dictType == kDictUnknown) return NULL;\n    // __Dictionary only supports one kind of key, string or integer.\n    // This method uses string as key, therefore we should make sure that the key type of this __Dictionary is string.\n    CCASSERT(_dictType == kDictStr, \"this dictionary does not use string as key.\");\n\n    Object* pRetObject = NULL;\n    DictElement *pElement = NULL;\n    HASH_FIND_STR(_elements, key.c_str(), pElement);\n    if (pElement != NULL)\n    {\n        pRetObject = pElement->_object;\n    }\n    return pRetObject;\n}\n\nObject* __Dictionary::objectForKey(intptr_t key)\n{\n    // if dictionary wasn't initialized, return NULL directly.\n    if (_dictType == kDictUnknown) return NULL;\n    // __Dictionary only supports one kind of key, string or integer.\n    // This method uses integer as key, therefore we should make sure that the key type of this __Dictionary is integer.\n    CCASSERT(_dictType == kDictInt, \"this dictionary does not use integer as key.\");\n\n    Object* pRetObject = NULL;\n    DictElement *pElement = NULL;\n    HASH_FIND_PTR(_elements, &key, pElement);\n    if (pElement != NULL)\n    {\n        pRetObject = pElement->_object;\n    }\n    return pRetObject;\n}\n\nconst __String* __Dictionary::valueForKey(const std::string& key)\n{\n    __String* pStr = dynamic_cast<__String*>(objectForKey(key));\n    if (pStr == NULL)\n    {\n        pStr = __String::create(\"\");\n    }\n    return pStr;\n}\n\nconst __String* __Dictionary::valueForKey(intptr_t key)\n{\n    __String* pStr = dynamic_cast<__String*>(objectForKey(key));\n    if (pStr == NULL)\n    {\n        pStr = __String::create(\"\");\n    }\n    return pStr;\n}\n\nvoid __Dictionary::setObject(Object* pObject, const std::string& key)\n{\n    CCASSERT(key.length() > 0 && pObject != NULL, \"Invalid Argument!\");\n    if (_dictType == kDictUnknown)\n    {\n        _dictType = kDictStr;\n    }\n\n    CCASSERT(_dictType == kDictStr, \"this dictionary doesn't use string as key.\");\n\n    DictElement *pElement = NULL;\n    HASH_FIND_STR(_elements, key.c_str(), pElement);\n    if (pElement == NULL)\n    {\n        setObjectUnSafe(pObject, key);\n    }\n    else if (pElement->_object != pObject)\n    {\n        Object* pTmpObj = pElement->_object;\n        pTmpObj->retain();\n        removeObjectForElememt(pElement);\n        setObjectUnSafe(pObject, key);\n        pTmpObj->release();\n    }\n}\n\nvoid __Dictionary::setObject(Object* pObject, intptr_t key)\n{\n    CCASSERT(pObject != NULL, \"Invalid Argument!\");\n    if (_dictType == kDictUnknown)\n    {\n        _dictType = kDictInt;\n    }\n\n    CCASSERT(_dictType == kDictInt, \"this dictionary doesn't use integer as key.\");\n\n    DictElement *pElement = NULL;\n    HASH_FIND_PTR(_elements, &key, pElement);\n    if (pElement == NULL)\n    {\n        setObjectUnSafe(pObject, key);\n    }\n    else if (pElement->_object != pObject)\n    {\n        Object* pTmpObj = pElement->_object;\n        pTmpObj->retain();\n        removeObjectForElememt(pElement);\n        setObjectUnSafe(pObject, key);\n        pTmpObj->release();\n    }\n\n}\n\nvoid __Dictionary::removeObjectForKey(const std::string& key)\n{\n    if (_dictType == kDictUnknown)\n    {\n        return;\n    }\n    \n    CCASSERT(_dictType == kDictStr, \"this dictionary doesn't use string as its key\");\n    CCASSERT(key.length() > 0, \"Invalid Argument!\");\n    DictElement *pElement = NULL;\n    HASH_FIND_STR(_elements, key.c_str(), pElement);\n    removeObjectForElememt(pElement);\n}\n\nvoid __Dictionary::removeObjectForKey(intptr_t key)\n{\n    if (_dictType == kDictUnknown)\n    {\n        return;\n    }\n    \n    CCASSERT(_dictType == kDictInt, \"this dictionary doesn't use integer as its key\");\n    DictElement *pElement = NULL;\n    HASH_FIND_PTR(_elements, &key, pElement);\n    removeObjectForElememt(pElement);\n}\n\nvoid __Dictionary::setObjectUnSafe(Object* pObject, const std::string& key)\n{\n    pObject->retain();\n    DictElement* pElement = new DictElement(key.c_str(), pObject);\n    HASH_ADD_STR(_elements, _strKey, pElement);\n}\n\nvoid __Dictionary::setObjectUnSafe(Object* pObject, const intptr_t key)\n{\n    pObject->retain();\n    DictElement* pElement = new DictElement(key, pObject);\n    HASH_ADD_PTR(_elements, _intKey, pElement);\n}\n\nvoid __Dictionary::removeObjectsForKeys(__Array* pKey__Array)\n{\n    Object* pObj = NULL;\n    CCARRAY_FOREACH(pKey__Array, pObj)\n    {\n        __String* pStr = static_cast<__String*>(pObj);\n        removeObjectForKey(pStr->getCString());\n    }\n}\n\nvoid __Dictionary::removeObjectForElememt(DictElement* pElement)\n{\n    if (pElement != NULL)\n    {\n        HASH_DEL(_elements, pElement);\n        pElement->_object->release();\n        CC_SAFE_DELETE(pElement);\n    }\n}\n\nvoid __Dictionary::removeAllObjects()\n{\n    DictElement *pElement, *tmp;\n    HASH_ITER(hh, _elements, pElement, tmp) \n    {\n        HASH_DEL(_elements, pElement);\n        pElement->_object->release();\n        CC_SAFE_DELETE(pElement);\n\n    }\n}\n\nObject* __Dictionary::randomObject()\n{\n    if (_dictType == kDictUnknown)\n    {\n        return NULL;\n    }\n    \n    Object* key = allKeys()->getRandomObject();\n    \n    if (_dictType == kDictInt)\n    {\n        return objectForKey( static_cast<__Integer*>(key)->getValue());\n    }\n    else if (_dictType == kDictStr)\n    {\n        return objectForKey( static_cast<__String*>(key)->getCString());\n    }\n    else\n    {\n        return NULL;\n    }\n}\n\n__Dictionary* __Dictionary::create()\n{\n    __Dictionary* ret = new __Dictionary();\n    if (ret && ret->init() )\n    {\n        ret->autorelease();\n    }\n    return ret;\n}\n\nbool __Dictionary::init()\n{\n    return true;\n}\n\n__Dictionary* __Dictionary::createWithDictionary(__Dictionary* srcDict)\n{\n    return srcDict->clone();\n}\n\nstatic __Array* visitArray(const ValueVector& array);\n\nstatic __Dictionary* visitDict(const ValueMap& dict)\n{\n    __Dictionary* ret = new __Dictionary();\n    ret->init();\n    \n    for (auto iter = dict.begin(); iter != dict.end(); ++iter)\n    {\n        if (iter->second.getType() == Value::Type::MAP)\n        {\n            const ValueMap& subDict = iter->second.asValueMap();\n            auto sub = visitDict(subDict);\n            ret->setObject(sub, iter->first);\n            sub->release();\n        }\n        else if (iter->second.getType() == Value::Type::VECTOR)\n        {\n            const ValueVector& arr = iter->second.asValueVector();\n            auto sub = visitArray(arr);\n            ret->setObject(sub, iter->first);\n            sub->release();\n        }\n        else\n        {\n            auto str = new __String(iter->second.asString());\n            ret->setObject(str, iter->first);\n            str->release();\n        }\n    }\n    return ret;\n}\n\nstatic __Array* visitArray(const ValueVector& array)\n{\n    __Array* ret = new __Array();\n    ret->init();\n\n    for(const auto &value : array) {\n        if (value.getType() == Value::Type::MAP)\n        {\n            const ValueMap& subDict = value.asValueMap();\n            auto sub = visitDict(subDict);\n            ret->addObject(sub);\n            sub->release();\n        }\n        else if (value.getType() == Value::Type::VECTOR)\n        {\n            const ValueVector& arr = value.asValueVector();\n            auto sub = visitArray(arr);\n            ret->addObject(sub);\n            sub->release();\n        }\n        else\n        {\n            auto str = new __String(value.asString());\n            ret->addObject(str);\n            str->release();\n        }\n    }\n    \n    return ret;\n}\n\n__Dictionary* __Dictionary::createWithContentsOfFileThreadSafe(const char *pFileName)\n{\n    return visitDict(FileUtils::getInstance()->getValueMapFromFile(pFileName));\n}\n\nvoid __Dictionary::acceptVisitor(DataVisitor &visitor)\n{\n    return visitor.visit(this);\n}\n\n__Dictionary* __Dictionary::createWithContentsOfFile(const char *pFileName)\n{\n    auto ret = createWithContentsOfFileThreadSafe(pFileName);\n    if (ret != nullptr)\n    {\n        ret->autorelease();\n    }\n    return ret;\n}\n\nstatic ValueMap ccdictionary_to_valuemap(__Dictionary* dict);\n\nstatic ValueVector ccarray_to_valuevector(__Array* arr)\n{\n    ValueVector ret;\n    \n    Object* obj;\n    CCARRAY_FOREACH(arr, obj)\n    {\n        Value arrElement;\n\n        __String* strVal = nullptr;\n        __Dictionary* dictVal = nullptr;\n        __Array* arrVal = nullptr;\n        __Double* doubleVal = nullptr;\n        __Bool* boolVal = nullptr;\n        __Float* floatVal = nullptr;\n        __Integer* intVal = nullptr;\n        \n        if ((strVal = dynamic_cast<__String *>(obj))) {\n            arrElement = Value(strVal->getCString());\n        } else if ((dictVal = dynamic_cast<__Dictionary*>(obj))) {\n            arrElement = ccdictionary_to_valuemap(dictVal);\n        } else if ((arrVal = dynamic_cast<__Array*>(obj))) {\n            arrElement = ccarray_to_valuevector(arrVal);\n        } else if ((doubleVal = dynamic_cast<__Double*>(obj))) {\n            arrElement = Value(doubleVal->getValue());\n        } else if ((floatVal = dynamic_cast<__Float*>(obj))) {\n            arrElement = Value(floatVal->getValue());\n        } else if ((intVal = dynamic_cast<__Integer*>(obj))) {\n            arrElement = Value(intVal->getValue());\n        }  else if ((boolVal = dynamic_cast<__Bool*>(obj))) {\n            arrElement = boolVal->getValue() ? Value(true) : Value(false);\n        } else {\n            CCASSERT(false, \"the type isn't suppored.\");\n        }\n\n        ret.push_back(arrElement);\n    }\n    return ret;\n}\n\nstatic ValueMap ccdictionary_to_valuemap(__Dictionary* dict)\n{\n    ValueMap ret;\n    DictElement* pElement = nullptr;\n    CCDICT_FOREACH(dict, pElement)\n    {\n        Object* obj = pElement->getObject();\n        \n        __String* strVal = nullptr;\n        __Dictionary* dictVal = nullptr;\n        __Array* arrVal = nullptr;\n        __Double* doubleVal = nullptr;\n        __Bool* boolVal = nullptr;\n        __Float* floatVal = nullptr;\n        __Integer* intVal = nullptr;\n        \n        Value dictElement;\n        \n        if ((strVal = dynamic_cast<__String *>(obj))) {\n            dictElement = Value(strVal->getCString());\n        } else if ((dictVal = dynamic_cast<__Dictionary*>(obj))) {\n            dictElement = ccdictionary_to_valuemap(dictVal);\n        } else if ((arrVal = dynamic_cast<__Array*>(obj))) {\n            dictElement = ccarray_to_valuevector(arrVal);\n        } else if ((doubleVal = dynamic_cast<__Double*>(obj))) {\n            dictElement = Value(doubleVal->getValue());\n        } else if ((floatVal = dynamic_cast<__Float*>(obj))) {\n            dictElement = Value(floatVal->getValue());\n        } else if ((intVal = dynamic_cast<__Integer*>(obj))) {\n            dictElement = Value(intVal->getValue());\n        } else if ((boolVal = dynamic_cast<__Bool*>(obj))) {\n            dictElement = boolVal->getValue() ? Value(true) : Value(false);\n        } else {\n            CCASSERT(false, \"the type isn't suppored.\");\n        }\n\n        const char* key = pElement->getStrKey();\n        if (key && strlen(key) > 0)\n        {\n            ret[key] = dictElement;\n        }\n    }\n    return ret;\n}\n\n\nbool __Dictionary::writeToFile(const char *fullPath)\n{\n    ValueMap dict = ccdictionary_to_valuemap(this);\n    return FileUtils::getInstance()->writeToFile(dict, fullPath);\n}\n\n__Dictionary* __Dictionary::clone() const\n{\n    __Dictionary* newDict = __Dictionary::create();\n    \n    DictElement* element = NULL;\n    Object* tmpObj = NULL;\n    Clonable* obj = NULL;\n    if (_dictType == kDictInt)\n    {\n        CCDICT_FOREACH(this, element)\n        {\n            obj = dynamic_cast<Clonable*>(element->getObject());\n            if (obj)\n            {\n                tmpObj = dynamic_cast<Object*>(obj->clone());\n                if (tmpObj)\n                {\n                    newDict->setObject(tmpObj, element->getIntKey());\n                }\n            }\n            else\n            {\n                CCLOGWARN(\"%s isn't clonable.\", typeid(*element->getObject()).name());\n            }\n        }\n    }\n    else if (_dictType == kDictStr)\n    {\n        CCDICT_FOREACH(this, element)\n        {\n            obj = dynamic_cast<Clonable*>(element->getObject());\n            if (obj)\n            {\n                tmpObj = dynamic_cast<Object*>(obj->clone());\n                if (tmpObj)\n                {\n                    newDict->setObject(tmpObj, element->getStrKey());\n                }\n            }\n            else\n            {\n                CCLOGWARN(\"%s isn't clonable.\", typeid(*element->getObject()).name());\n            }\n        }\n    }\n    \n    return newDict;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCDictionary.h",
    "content": "/****************************************************************************\nCopyright (c) 2012      cocos2d-x.org\n opyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDICTIONARY_H__\n#define __CCDICTIONARY_H__\n\n#include \"uthash.h\"\n#include \"CCObject.h\"\n#include \"CCArray.h\"\n#include \"CCString.h\"\n\nNS_CC_BEGIN\n\nclass __Dictionary;\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\n\n/**\n *  DictElement is used for traversing Dictionary.\n *\n *  A DictElement is one element of Dictionary, it contains two properties, key and object.\n *  Its key has two different type (integer and string).\n *\n *  @note The key type is unique, all the elements in Dictionary has the same key type(integer or string).\n *  @code\n *  DictElement* pElement;\n *  CCDICT_FOREACH(dict, pElement)\n *  {\n *      const char*key = pElement->getStrKey();\n *      // You certainly know the type of value, so we assume that it's a Sprite.\n *      Sprite* pSprite = static_cast<Sprite*>(pElement->getObject());\n *      // ......\n *  }\n *  @endcode\n *\n */\nclass CC_DLL DictElement\n{\nprivate:\n    /**\n     *  Constructor of DictElement. It's only for internal usage. Dictionary is its friend class.\n     *  \n     *  @param  pszKey    The string key of this element.\n     *  @param  pObject   The object of this element.\n     */\n    DictElement(const char* pszKey, Object* pObject);\n\n    /**\n     *  Constructor of DictElement. It's only for internal usage. Dictionary is its friend class.\n     *\n     *  @param  iKey    The integer key of this element.\n     *  @param  pObject   The object of this element.\n     */\n    DictElement(intptr_t iKey, Object* pObject);\n    \npublic:\n    /**\n     *  The destructor of DictElement.\n     * @js NA\n     * @lua NA\n     */\n    ~DictElement();\n\n    // Inline functions need to be implemented in header file on Android.\n    \n    /**\n     * Get the string key of this element.\n     * @note    This method assumes you know the key type in the element. \n     *          If the element's key type is integer, invoking this method will cause an assert.\n     *\n     * @return  The string key of this element.\n     */\n    inline const char* getStrKey() const\n    {\n        CCASSERT(_strKey[0] != '\\0', \"Should not call this function for integer dictionary\");\n        return _strKey;\n    }\n\n    /**\n     * Get the integer key of this element.\n     * @note    This method assumes you know the key type in the element.\n     *          If the element's key type is string, invoking this method will cause an assert.\n     *\n     * @return  The integer key of this element.\n     */\n    inline intptr_t getIntKey() const\n    {\n        CCASSERT(_strKey[0] == '\\0', \"Should not call this function for string dictionary\");\n        return _intKey;\n    }\n    \n    /**\n     * Get the object of this element.\n     *\n     * @return  The object of this element.\n     */\n    inline Object* getObject() const { return _object; }\n\nprivate:\n    // The max length of string key.\n    #define   MAX_KEY_LEN   256\n    // char array is needed for HASH_ADD_STR in UT_HASH.\n    // So it's a pain that all elements will allocate 256 bytes for this array.\n    char      _strKey[MAX_KEY_LEN];     // hash key of string type\n    intptr_t  _intKey;       // hash key of integer type\n    Object* _object;    // hash value\npublic:\n    UT_hash_handle hh;      // makes this class hashable\n    friend class __Dictionary; // declare Dictionary as friend class\n};\n\n/** The macro for traversing dictionary\n *  \n *  @note It's faster than getting all keys and traversing keys to get objects by objectForKey.\n *        It's also safe to remove elements while traversing.\n */\n#define CCDICT_FOREACH(__dict__, __el__) \\\n    DictElement* pTmp##__dict__##__el__ = nullptr; \\\n    if (__dict__) \\\n    HASH_ITER(hh, (__dict__)->_elements, __el__, pTmp##__dict__##__el__)\n\n\n\n/**\n *  Dictionary is a class like NSDictionary in Obj-C .\n *\n *  @note Only the pointer of Object or its subclass can be inserted to Dictionary.\n *  @code\n *  // Create a dictionary, return an autorelease object.\n *  Dictionary* pDict = Dictionary::create();\n *\n *  // Insert objects to dictionary\n *  String* pValue1 = String::create(\"100\");\n *  String* pValue2 = String::create(\"120\");\n *  Integer* pValue3 = Integer::create(200);\n *  pDict->setObject(pValue1, \"key1\");\n *  pDict->setObject(pValue2, \"key2\");\n *  pDict->setObject(pValue3, \"key3\");\n *\n *  // Get the object for key\n *  String* pStr1 = static_cast<String*>(pDict->objectForKey(\"key1\"));\n *  log(\"{ key1: %s }\", pStr1->getCString());\n *  Integer* pInteger = static_cast<Integer*>(pDict->objectForKey(\"key3\"));\n *  log(\"{ key3: %d }\", pInteger->getValue());\n *  @endcode\n *\n */\n\nclass CC_DLL __Dictionary : public Object, public Clonable\n{\npublic:\n    /**\n     * The constructor of Dictionary.\n     * @js NA\n     * @lua NA\n     */\n    __Dictionary();\n\n    /**\n     * The destructor of Dictionary\n     * @js NA\n     * @lua NA\n     */\n    ~__Dictionary();\n\n    /** Initializes the dictionary. It returns true if the initializations was successful. \n     * @js NA\n     * @lua NA\n     */\n    bool init();\n    /**\n     *  Get the count of elements in Dictionary.\n     *\n     *  @return  The count of elements.\n     * @js NA\n     */\n    unsigned int count();\n\n    /**\n     *  Return all keys of elements.\n     *\n     *  @return  The array contains all keys of elements. It's an autorelease object yet.\n     * @js NA\n     */\n    __Array* allKeys();\n\n    /** \n     *  Get all keys according to the specified object.\n     *  @warning  We use '==' to compare two objects\n     *  @return   The array contains all keys for the specified object. It's an autorelease object yet.\n     * @js NA\n     */\n    __Array* allKeysForObject(Object* object);\n\n    /**\n     *  Get the object according to the specified string key.\n     *\n     *  @note The dictionary needs to use string as key. If integer is passed, an assert will appear.\n     *  @param key  The string key for searching.\n     *  @return The object matches the key. You need to force convert it to the type you know.\n     *  @code\n     *     // Assume that the elements are String* pointers. Convert it by following code.\n     *     String* pStr = static_cast<String*>(pDict->objectForKey(\"key1\"));\n     *     // Do something about pStr.\n     *     // If you don't know the object type, properly you need to use dynamic_cast<SomeType*> to check it.\n     *     String* pStr2 = dynamic_cast<String*>(pDict->objectForKey(\"key1\"));\n     *     if (pStr2 != NULL) {\n     *          // Do something about pStr2\n     *     }\n     *  @endcode\n     *  @see objectForKey(intptr_t)\n     * @js NA\n     */\n    Object* objectForKey(const std::string& key);\n    \n    /**\n     *  Get the object according to the specified integer key.\n     *\n     *  @note The dictionary needs to use integer as key. If string is passed, an assert will appear.\n     *  @param key  The integer key for searching.\n     *  @return The object matches the key.\n     *  @see objectForKey(const std::string&)\n     * @js NA\n     */\n    Object* objectForKey(intptr_t key);\n    \n    /** Get the value according to the specified string key.\n     *\n     *  @note Be careful to use this function since it assumes the objects in the dictionary are __String pointer.\n     *  @param key  The string key for searching\n     *  @return An instance of String.\n     *          It will return an empty string if the objects aren't __String pointer or the key wasn't found.\n     *  @see valueForKey(intptr_t)\n     *  @js NA\n     */\n    const __String* valueForKey(const std::string& key);\n    \n    /** Get the value according to the specified integer key.\n     *\n     *  @note Be careful to use this function since it assumes the objects in the dictionary are __String pointer.\n     *  @param key  The string key for searching.\n     *  @return An instance of String.\n     *          It will return an empty string if the objects aren't __String pointer or the key wasn't found.\n     *  @see valueForKey(intptr_t)\n     *  @js NA\n     */\n    const __String* valueForKey(intptr_t key);\n\n    /** Insert an object to dictionary, and match it with the specified string key.\n     *\n     *  @note Whe the first time this method is invoked, the key type will be set to string.\n     *        After that you can't setObject with an integer key.\n     *        If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary.\n     *        Then the new object will be inserted after that.\n     *\n     *  @param pObject  The Object to be inserted.\n     *  @param key      The string key for searching.\n     *  @see setObject(Object*, intptr_t)\n     * @js NA\n     */\n    void setObject(Object* pObject, const std::string& key);\n    \n    /** Insert an object to dictionary, and match it with the specified string key.\n     *\n     *  @note Then the first time this method is invoked, the key type will be set to string.\n     *        After that you can't setObject with an integer key.\n     *        If the dictionary contains the key you passed, the object matching the key will be released and removed from dictionary.\n     *        Then the new object will be inserted after that.\n     *  @param pObject  The Object to be inserted.\n     *  @param key      The string key for searching.\n     *  @see setObject(Object*, const std::string&)\n     *  @js NA\n     */\n    void setObject(Object* pObject, intptr_t key);\n\n    /** \n     *  Remove an object by the specified string key.\n     *\n     *  @param key  The string key for searching.\n     *  @see removeObjectForKey(intptr_t), removeObjectsForKeys(__Array*),\n     *       removeObjectForElememt(DictElement*), removeAllObjects().\n     *  @js NA\n     */\n    void removeObjectForKey(const std::string& key);\n    \n    /**\n     *  Remove an object by the specified integer key.\n     *\n     *  @param key  The integer key for searching.\n     *  @see removeObjectForKey(const std::string&), removeObjectsForKeys(__Array*),\n     *       removeObjectForElememt(DictElement*), removeAllObjects().\n     *  @js NA\n     */\n    void removeObjectForKey(intptr_t key);\n    \n    /**\n     *  Remove objects by an array of keys.\n     *\n     *  @param pKeyArray  The array contains keys to be removed.\n     *  @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t),\n     *       removeObjectForElememt(DictElement*), removeAllObjects().\n     *  @js NA\n     */\n    void removeObjectsForKeys(__Array* pKey__Array);\n    \n    /**\n     *  Remove an object by an element.\n     *\n     *  @param pElement  The element need to be removed.\n     *  @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t),\n     *       removeObjectsForKeys(__Array*), removeAllObjects().\n     * @js NA\n     * @lua NA\n     */\n    void removeObjectForElememt(DictElement* pElement);\n    \n    /**\n     *  Remove all objects in the dictionary.\n     *\n     *  @see removeObjectForKey(const std::string&), removeObjectForKey(intptr_t),\n     *       removeObjectsForKeys(__Array*), removeObjectForElememt(DictElement*).\n     * @js NA\n     */\n    void removeAllObjects();\n    \n    /**\n     *  Return a random object in the dictionary.\n     *\n     *  @return The random object. \n     *  @see objectForKey(intptr_t), objectForKey(const std::string&)\n     *  @js NA\n     *  @lua NA\n     */\n    Object* randomObject();\n    \n    /**\n     *  Create a dictionary.\n     *  @return A dictionary which is an autorelease object.\n     *  @see createWithDictionary(Dictionary*), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*).\n     *  @js NA\n     */\n    static __Dictionary* create();\n\n    /**\n     *  Create a dictionary with an existing dictionary.\n     *\n     *  @param srcDict The exist dictionary.\n     *  @return A dictionary which is an autorelease object.\n     *  @see create(), createWithContentsOfFile(const char*), createWithContentsOfFileThreadSafe(const char*).\n     *  @js NA\n     */\n    static __Dictionary* createWithDictionary(__Dictionary* srcDict);\n    \n    /**\n     *  Create a dictionary with a plist file.\n     *  @param  pFileName  The name of the plist file.\n     *  @return A dictionary which is an autorelease object.\n     *  @see create(), createWithDictionary(Dictionary*), createWithContentsOfFileThreadSafe(const char*).\n     *  @js NA\n     */\n    static __Dictionary* createWithContentsOfFile(const char *pFileName);\n    \n    /**\n     *  Write a dictionary to a plist file.\n     *  @param fullPath The full path of the plist file. You can get writeable path by getWritablePath()\n     *  @return true if successed, false if failed\n     *  @js NA\n     *  @lua NA\n     */\n    bool writeToFile(const char *fullPath);\n     \n    /**\n     *  Create a dictionary with a plist file.\n     *  \n     *  @note the return object isn't an autorelease object.\n     *        This can make sure not using autorelease pool in a new thread.\n     *        Therefore, you need to manage the lifecycle of the return object.\n     *        It means that when you don't need it, CC_SAFE_RELEASE needs to be invoked.\n     *\n     *  @param  pFileName  The name of the plist file.\n     *  @return A dictionary which isn't an autorelease object.\n     *  @js NA\n     *  @lua NA\n     */\n    static __Dictionary* createWithContentsOfFileThreadSafe(const char *pFileName);\n\n    /* override functions \n     *  @js NA\n     *  @lua NA\n     */\n    virtual void acceptVisitor(DataVisitor &visitor);\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual __Dictionary* clone() const;\n    \nprivate:\n    /** \n     *  For internal usage, invoked by setObject.\n     */\n    void setObjectUnSafe(Object* pObject, const std::string& key);\n    void setObjectUnSafe(Object* pObject, const intptr_t key);\n    \npublic:\n    /**\n     *  All the elements in dictionary.\n     * \n     *  @note For internal usage, we need to declare this member variable as public since it's used in UT_HASH.\n     */\n    DictElement* _elements;\nprivate:\n    \n    /** The support type of dictionary, it's confirmed when setObject is invoked. */\n    enum DictType\n    {\n        kDictUnknown = 0,\n        kDictStr,\n        kDictInt\n    };\n    \n    /** \n     *  The type of dictionary, it's assigned to kDictUnknown by default.\n     */\n    DictType _dictType;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCDICTIONARY_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCDouble.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCDOUBLE_H__\n#define __CCDOUBLE_H__\n\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\nclass CC_DLL __Double : public Object, public Clonable\n{\npublic:\n    __Double(double v)\n        : _value(v) {}\n    double getValue() const {return _value;}\n\n    static __Double* create(double v)\n    {\n        __Double* pRet = new __Double(v);\n        if (pRet)\n        {\n            pRet->autorelease();\n        }\n        return pRet;\n    }\n\n    /* override functions */\n    virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); }\n    \n    __Double* clone() const\n    {\n        return __Double::create(_value);\n    }\nprivate:\n    double _value;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCDOUBLE_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCFloat.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCFLOAT_H__\n#define __CCFLOAT_H__\n\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\nclass CC_DLL __Float : public Object, public Clonable\n{\npublic:\n    __Float(float v)\n        : _value(v) {}\n    float getValue() const {return _value;}\n\n    static __Float* create(float v)\n    {\n        __Float* pRet = new __Float(v);\n        if (pRet)\n        {\n            pRet->autorelease();\n        }\n        return pRet;\n    }\n\n    /* override functions */\n    virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); }\n    \n    __Float* clone() const\n    {\n        return __Float::create(_value);\n    }\n    \nprivate:\n    float _value;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCFLOAT_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCGeometry.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCGeometry.h\"\n#include \"ccMacros.h\"\n#include <algorithm>\n\n// implementation of Point\nNS_CC_BEGIN\n\nPoint::Point(void) : x(0), y(0)\n{\n}\n\nPoint::Point(float xx, float yy) : x(xx), y(yy)\n{\n}\n\nPoint::Point(const Point& other) : x(other.x), y(other.y)\n{\n}\n\nPoint::Point(const Size& size) : x(size.width), y(size.height)\n{\n}\n\nPoint& Point::operator= (const Point& other)\n{\n    setPoint(other.x, other.y);\n    return *this;\n}\n\nPoint& Point::operator= (const Size& size)\n{\n    setPoint(size.width, size.height);\n    return *this;\n}\n\nPoint Point::operator+(const Point& right) const\n{\n    return Point(this->x + right.x, this->y + right.y);\n}\n\nPoint& Point::operator+=(const Point& right)\n{\n    this->x += right.x;\n    this->y += right.y;\n    return *this;\n}\n\nPoint Point::operator-(const Point& right) const\n{\n    return Point(this->x - right.x, this->y - right.y);\n}\n\nPoint& Point::operator-=(const Point& right)\n{\n    this->x -= right.x;\n    this->y -= right.y;\n    return *this;\n}\n\nPoint Point::operator-() const\n{\n\treturn Point(-x, -y);\n}\n\nbool Point::operator==(const Point& right)\n{\n    return this->x == right.x && this->y == right.y;\n}\n\nbool Point::operator!=(const Point& right)\n{\n    return this->x != right.x || this->y != right.y;\n}\n\nbool Point::operator==(const Point& right) const\n{\n    return this->x == right.x && this->y == right.y;\n}\n\nbool Point::operator!=(const Point& right) const\n{\n    return this->x != right.x || this->y != right.y;\n}\n\nPoint Point::operator*(float a) const\n{\n    return Point(this->x * a, this->y * a);\n}\n\nPoint Point::operator/(float a) const\n{\n\tCCASSERT(a!=0, \"CCPoint division by 0.\");\n    return Point(this->x / a, this->y / a);\n}\n\nvoid Point::setPoint(float xx, float yy)\n{\n    this->x = xx;\n    this->y = yy;\n}\n\nbool Point::equals(const Point& target) const\n{\n    return (fabs(this->x - target.x) < FLT_EPSILON)\n        && (fabs(this->y - target.y) < FLT_EPSILON);\n}\n\nbool Point::fuzzyEquals(const Point& b, float var) const\n{\n    if(x - var <= b.x && b.x <= x + var)\n        if(y - var <= b.y && b.y <= y + var)\n            return true;\n    return false;\n}\n\nfloat Point::getAngle(const Point& other) const\n{\n    Point a2 = normalize();\n    Point b2 = other.normalize();\n    float angle = atan2f(a2.cross(b2), a2.dot(b2));\n    if( fabs(angle) < FLT_EPSILON ) return 0.f;\n    return angle;\n}\n\nPoint Point::rotateByAngle(const Point& pivot, float angle) const\n{\n    return pivot + (*this - pivot).rotate(Point::forAngle(angle));\n}\n\nbool Point::isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float *E)\n{\n    float ABmin = MIN(A, B);\n    float ABmax = MAX(A, B);\n    float CDmin = MIN(C, D);\n    float CDmax = MAX(C, D);\n    \n    if (ABmax < CDmin || CDmax < ABmin)\n    {\n        // ABmin->ABmax->CDmin->CDmax or CDmin->CDmax->ABmin->ABmax\n        return false;\n    }\n    else\n    {\n        if (ABmin >= CDmin && ABmin <= CDmax)\n        {\n            // CDmin->ABmin->CDmax->ABmax or CDmin->ABmin->ABmax->CDmax\n            if (S != nullptr) *S = ABmin;\n            if (E != nullptr) *E = CDmax < ABmax ? CDmax : ABmax;\n        }\n        else if (ABmax >= CDmin && ABmax <= CDmax)\n        {\n            // ABmin->CDmin->ABmax->CDmax\n            if (S != nullptr) *S = CDmin;\n            if (E != nullptr) *E = ABmax;\n        }\n        else\n        {\n            // ABmin->CDmin->CDmax->ABmax\n            if (S != nullptr) *S = CDmin;\n            if (E != nullptr) *E = CDmax;\n        }\n        return true;\n    }\n}\n\nbool Point::isLineIntersect(const Point& A, const Point& B,\n                            const Point& C, const Point& D,\n                            float *S, float *T)\n{\n    // FAIL: Line undefined\n    if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) )\n    {\n        return false;\n    }\n    \n    const float denom = crossProduct2Vector(A, B, C, D);\n    \n    if (denom == 0)\n    {\n        // Lines parallel or overlap\n        return false;\n    }\n    \n    if (S != nullptr) *S = crossProduct2Vector(C, D, C, A) / denom;\n    if (T != nullptr) *T = crossProduct2Vector(A, B, C, A) / denom;\n    \n    return true;\n}\n\nbool Point::isLineParallel(const Point& A, const Point& B,\n                           const Point& C, const Point& D)\n{\n    // FAIL: Line undefined\n    if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) )\n    {\n        return false;\n    }\n    \n    if (crossProduct2Vector(A, B, C, D) == 0)\n    {\n        // line overlap\n        if (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0)\n        {\n            return false;\n        }\n        \n        return true;\n    }\n    \n    return false;\n}\n\nbool Point::isLineOverlap(const Point& A, const Point& B,\n                            const Point& C, const Point& D)\n{\n    // FAIL: Line undefined\n    if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) )\n    {\n        return false;\n    }\n    \n    if (crossProduct2Vector(A, B, C, D) == 0 &&\n        (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nbool Point::isSegmentOverlap(const Point& A, const Point& B, const Point& C, const Point& D, Point* S, Point* E)\n{\n    \n    if (isLineOverlap(A, B, C, D))\n    {\n        return isOneDemensionSegmentOverlap(A.x, B.x, C.x, D.x, &S->x, &E->x) &&\n        isOneDemensionSegmentOverlap(A.y, B.y, C.y, D.y, &S->y, &E->y);\n    }  \n    \n    return false;\n}\n\nbool Point::isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D)\n{\n    float S, T;\n    \n    if (isLineIntersect(A, B, C, D, &S, &T )&&\n        (S >= 0.0f && S <= 1.0f && T >= 0.0f && T <= 1.0f))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nPoint Point::getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D)\n{\n    float S, T;\n    \n    if (isLineIntersect(A, B, C, D, &S, &T))\n    {\n        // Point of intersection\n        Point P;\n        P.x = A.x + S * (B.x - A.x);\n        P.y = A.y + S * (B.y - A.y);\n        return P;\n    }\n    \n    return Point::ZERO;\n}\n\nconst Point Point::ZERO = Point(0.0f, 0.0f);\nconst Point Point::ANCHOR_MIDDLE = Point(0.5f, 0.5f);\nconst Point Point::ANCHOR_BOTTOM_LEFT = Point(0.0f, 0.0f);\nconst Point Point::ANCHOR_TOP_LEFT = Point(0.0f, 1.0f);\nconst Point Point::ANCHOR_BOTTOM_RIGHT = Point(1.0f, 0.0f);\nconst Point Point::ANCHOR_TOP_RIGHT = Point(1.0f, 1.0f);\nconst Point Point::ANCHOR_MIDDLE_RIGHT = Point(1.0f, 0.5f);\nconst Point Point::ANCHOR_MIDDLE_LEFT = Point(0.0f, 0.5f);\nconst Point Point::ANCHOR_MIDDLE_TOP = Point(0.5f, 1.0f);\nconst Point Point::ANCHOR_MIDDLE_BOTTOM = Point(0.5f, 0.0f);\n\n// implementation of Size\n\nSize::Size(void) : width(0), height(0)\n{\n}\n\nSize::Size(float w, float h) : width(w), height(h)\n{\n}\n\nSize::Size(const Size& other) : width(other.width), height(other.height)\n{\n}\n\nSize::Size(const Point& point) : width(point.x), height(point.y)\n{\n}\n\nSize& Size::operator= (const Size& other)\n{\n    setSize(other.width, other.height);\n    return *this;\n}\n\nSize& Size::operator= (const Point& point)\n{\n    setSize(point.x, point.y);\n    return *this;\n}\n\nSize Size::operator+(const Size& right) const\n{\n    return Size(this->width + right.width, this->height + right.height);\n}\n\nSize Size::operator-(const Size& right) const\n{\n    return Size(this->width - right.width, this->height - right.height);\n}\n\nSize Size::operator*(float a) const\n{\n    return Size(this->width * a, this->height * a);\n}\n\nSize Size::operator/(float a) const\n{\n\tCCASSERT(a!=0, \"CCSize division by 0.\");\n    return Size(this->width / a, this->height / a);\n}\n\nvoid Size::setSize(float w, float h)\n{\n    this->width = w;\n    this->height = h;\n}\n\nbool Size::equals(const Size& target) const\n{\n    return (fabs(this->width  - target.width)  < FLT_EPSILON)\n        && (fabs(this->height - target.height) < FLT_EPSILON);\n}\n\nconst Size Size::ZERO = Size(0, 0);\n\n// implementation of Rect\n\nRect::Rect(void)\n{\n    setRect(0.0f, 0.0f, 0.0f, 0.0f);\n}\n\nRect::Rect(float x, float y, float width, float height)\n{\n    setRect(x, y, width, height);\n}\n\nRect::Rect(const Rect& other)\n{\n    setRect(other.origin.x, other.origin.y, other.size.width, other.size.height);\n}\n\nRect& Rect::operator= (const Rect& other)\n{\n    setRect(other.origin.x, other.origin.y, other.size.width, other.size.height);\n    return *this;\n}\n\nvoid Rect::setRect(float x, float y, float width, float height)\n{\n    // CGRect can support width<0 or height<0\n    // CCASSERT(width >= 0.0f && height >= 0.0f, \"width and height of Rect must not less than 0.\");\n\n    origin.x = x;\n    origin.y = y;\n\n    size.width = width;\n    size.height = height;\n}\n\nbool Rect::equals(const Rect& rect) const\n{\n    return (origin.equals(rect.origin) && \n            size.equals(rect.size));\n}\n\nfloat Rect::getMaxX() const\n{\n    return origin.x + size.width;\n}\n\nfloat Rect::getMidX() const\n{\n    return origin.x + size.width / 2.0f;\n}\n\nfloat Rect::getMinX() const\n{\n    return origin.x;\n}\n\nfloat Rect::getMaxY() const\n{\n    return origin.y + size.height;\n}\n\nfloat Rect::getMidY() const\n{\n    return origin.y + size.height / 2.0f;\n}\n\nfloat Rect::getMinY() const\n{\n    return origin.y;\n}\n\nbool Rect::containsPoint(const Point& point) const\n{\n    bool bRet = false;\n\n    if (point.x >= getMinX() && point.x <= getMaxX()\n        && point.y >= getMinY() && point.y <= getMaxY())\n    {\n        bRet = true;\n    }\n\n    return bRet;\n}\n\nbool Rect::intersectsRect(const Rect& rect) const\n{\n    return !(     getMaxX() < rect.getMinX() ||\n             rect.getMaxX() <      getMinX() ||\n                  getMaxY() < rect.getMinY() ||\n             rect.getMaxY() <      getMinY());\n}\n\nRect Rect::unionWithRect(const Rect & rect) const\n{\n    float thisLeftX = origin.x;\n    float thisRightX = origin.x + size.width;\n    float thisTopY = origin.y + size.height;\n    float thisBottomY = origin.y;\n    \n    if (thisRightX < thisLeftX)\n    {\n        std::swap(thisRightX, thisLeftX);   // This rect has negative width\n    }\n    \n    if (thisTopY < thisBottomY)\n    {\n        std::swap(thisTopY, thisBottomY);   // This rect has negative height\n    }\n    \n    float otherLeftX = rect.origin.x;\n    float otherRightX = rect.origin.x + rect.size.width;\n    float otherTopY = rect.origin.y + rect.size.height;\n    float otherBottomY = rect.origin.y;\n    \n    if (otherRightX < otherLeftX)\n    {\n        std::swap(otherRightX, otherLeftX);   // Other rect has negative width\n    }\n    \n    if (otherTopY < otherBottomY)\n    {\n        std::swap(otherTopY, otherBottomY);   // Other rect has negative height\n    }\n    \n    float combinedLeftX = std::min(thisLeftX, otherLeftX);\n    float combinedRightX = std::max(thisRightX, otherRightX);\n    float combinedTopY = std::max(thisTopY, otherTopY);\n    float combinedBottomY = std::min(thisBottomY, otherBottomY);\n    \n    return Rect(combinedLeftX, combinedBottomY, combinedRightX - combinedLeftX, combinedTopY - combinedBottomY);\n}\n\nconst Rect Rect::ZERO = Rect(0, 0, 0, 0);\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCGeometry.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCGEMETRY_H__\n#define __CCGEMETRY_H__\n\n#include <math.h>\n#include <functional>\n\n#include \"CCPlatformMacros.h\"\n#include \"CCObject.h\"\n#include \"ccMacros.h\"\n\nNS_CC_BEGIN\n\n/** Clamp a value between from and to.\n @since v0.99.1\n */\ninline float clampf(float value, float min_inclusive, float max_inclusive)\n{\n    if (min_inclusive > max_inclusive) {\n        CC_SWAP(min_inclusive, max_inclusive, float);\n    }\n    return value < min_inclusive ? min_inclusive : value < max_inclusive? value : max_inclusive;\n}\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\n// for Point assignement operator and copy constructor\nclass CC_DLL Size;\n\nclass CC_DLL Point\n{\npublic:\n    float x;\n    float y;\n\npublic:\n    /**\n     * @js NA\n     */\n    Point();\n    /**\n     * @js NA\n     */\n    Point(float x, float y);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point(const Point& other);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    explicit Point(const Size& size);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point& operator= (const Point& other);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point& operator= (const Size& size);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point operator+(const Point& right) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point& operator+=(const Point& right);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point operator-(const Point& right) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point& operator-=(const Point& right);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point operator-() const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool operator==(const Point& right);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool operator!=(const Point& right);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool operator==(const Point& right) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool operator!=(const Point& right) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point operator*(float a) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Point operator/(float a) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setPoint(float x, float y);\n    /**\n     * @js NA\n     */\n    bool equals(const Point& target) const;\n    \n    /** @returns if points have fuzzy equality which means equal with some degree of variance.\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    bool fuzzyEquals(const Point& target, float variance) const;\n\n    /** Calculates distance between point an origin\n     @return float\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline float getLength() const {\n        return sqrtf(x*x + y*y);\n    };\n\n    /** Calculates the square length of a Point (not calling sqrt() )\n     @return float\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline float getLengthSq() const {\n        return dot(*this); //x*x + y*y;\n    };\n\n    /** Calculates the square distance between two points (not calling sqrt() )\n     @return float\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline float getDistanceSq(const Point& other) const {\n        return (*this - other).getLengthSq();\n    };\n\n    /** Calculates the distance between two points\n     @return float\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline float getDistance(const Point& other) const {\n        return (*this - other).getLength();\n    };\n\n    /** @returns the angle in radians between this vector and the x axis\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline float getAngle() const {\n        return atan2f(y, x);\n    };\n\n    /** @returns the angle in radians between two vector directions\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    float getAngle(const Point& other) const;\n\n    /** Calculates dot product of two points.\n     @return float\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline float dot(const Point& other) const {\n        return x*other.x + y*other.y;\n    };\n\n    /** Calculates cross product of two points.\n     @return float\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline float cross(const Point& other) const {\n        return x*other.y - y*other.x;\n    };\n\n    /** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0\n     @return Point\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline Point getPerp() const {\n        return Point(-y, x);\n    };\n    \n    /** Calculates midpoint between two points.\n     @return Point\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    inline Point getMidpoint(const Point& other) const\n    {\n        return Point((x + other.x) / 2.0f, (y + other.y) / 2.0f);\n    }\n    \n    /** Clamp a point between from and to.\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    inline Point getClampPoint(const Point& min_inclusive, const Point& max_inclusive) const\n    {\n        return Point(clampf(x,min_inclusive.x,max_inclusive.x), clampf(y, min_inclusive.y, max_inclusive.y));\n    }\n    \n    /** Run a math operation function on each point component\n     * absf, fllorf, ceilf, roundf\n     * any function that has the signature: float func(float);\n     * For example: let's try to take the floor of x,y\n     * p.compOp(floorf);\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    inline Point compOp(std::function<float(float)> function) const\n    {\n        return Point(function(x), function(y));\n    }\n\n    /** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0\n     @return Point\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline Point getRPerp() const {\n        return Point(y, -x);\n    };\n\n    /** Calculates the projection of this over other.\n     @return Point\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline Point project(const Point& other) const {\n        return other * (dot(other)/other.dot(other));\n    };\n\n    /** Complex multiplication of two points (\"rotates\" two points).\n     @return Point vector with an angle of this.getAngle() + other.getAngle(),\n     and a length of this.getLength() * other.getLength().\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline Point rotate(const Point& other) const {\n        return Point(x*other.x - y*other.y, x*other.y + y*other.x);\n    };\n\n    /** Unrotates two points.\n     @return Point vector with an angle of this.getAngle() - other.getAngle(),\n     and a length of this.getLength() * other.getLength().\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline Point unrotate(const Point& other) const {\n        return Point(x*other.x + y*other.y, y*other.x - x*other.y);\n    };\n\n    /** Returns point multiplied to a length of 1.\n     * If the point is 0, it returns (1, 0)\n     @return Point\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline Point normalize() const {\n        float length = getLength();\n        if(length == 0.) return Point(1.f, 0);\n        return *this / getLength();\n    };\n\n    /** Linear Interpolation between two points a and b\n     @returns\n        alpha == 0 ? a\n        alpha == 1 ? b\n        otherwise a value between a..b\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    inline Point lerp(const Point& other, float alpha) const {\n        return *this * (1.f - alpha) + other * alpha;\n    };\n\n    /** Rotates a point counter clockwise by the angle around a pivot\n     @param pivot is the pivot, naturally\n     @param angle is the angle of rotation ccw in radians\n     @returns the rotated point\n     @since v2.1.4\n     * @js NA\n     * @lua NA\n     */\n    Point rotateByAngle(const Point& pivot, float angle) const;\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static inline Point forAngle(const float a)\n    {\n    \treturn Point(cosf(a), sinf(a));\n    }\n    \n    /** A general line-line intersection test\n     @param A   the startpoint for the first line L1 = (A - B)\n     @param B   the endpoint for the first line L1 = (A - B)\n     @param C   the startpoint for the second line L2 = (C - D)\n     @param D   the endpoint for the second line L2 = (C - D)\n     @param S   the range for a hitpoint in L1 (p = A + S*(B - A))\n     @param T   the range for a hitpoint in L2 (p = C + T*(D - C))\n     @returns   whether these two lines interects.\n\n     Note that to truly test intersection for segments we have to make\n     sure that S & T lie within [0..1] and for rays, make sure S & T > 0\n     the hit point is        C + T * (D - C);\n     the hit point also is   A + S * (B - A);\n     @since 3.0\n     * @js NA\n     * @lua NA\n     */\n    static bool isLineIntersect(const Point& A, const Point& B,\n                                 const Point& C, const Point& D,\n                                 float *S = nullptr, float *T = nullptr);\n    \n    /**\n     returns true if Line A-B overlap with segment C-D\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    static bool isLineOverlap(const Point& A, const Point& B,\n                                const Point& C, const Point& D);\n    \n    /**\n     returns true if Line A-B parallel with segment C-D\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    static bool isLineParallel(const Point& A, const Point& B,\n                   const Point& C, const Point& D);\n    \n    /**\n     returns true if Segment A-B overlap with segment C-D\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    static bool isSegmentOverlap(const Point& A, const Point& B,\n                                 const Point& C, const Point& D,\n                                 Point* S = nullptr, Point* E = nullptr);\n    \n    /**\n     returns true if Segment A-B intersects with segment C-D\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    static bool isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D);\n    \n    /**\n     returns the intersection point of line A-B, C-D\n     @since v3.0\n     * @js NA\n     * @lua NA\n     */\n    static Point getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D);\n    \n    /** equals to Point(0,0) */\n    static const Point ZERO;\n    /** equals to Point(0.5, 0.5) */\n    static const Point ANCHOR_MIDDLE;\n    /** equals to Point(0, 0) */\n    static const Point ANCHOR_BOTTOM_LEFT;\n    /** equals to Point(0, 1) */\n    static const Point ANCHOR_TOP_LEFT;\n    /** equals to Point(1, 0) */\n    static const Point ANCHOR_BOTTOM_RIGHT;\n    /** equals to Point(1, 1) */\n    static const Point ANCHOR_TOP_RIGHT;\n    /** equals to Point(1, 0.5) */\n    static const Point ANCHOR_MIDDLE_RIGHT;\n    /** equals to Point(0, 0.5) */\n    static const Point ANCHOR_MIDDLE_LEFT;\n    /** equals to Point(0.5, 1) */\n    static const Point ANCHOR_MIDDLE_TOP;\n    /** equals to Point(0.5, 0) */\n    static const Point ANCHOR_MIDDLE_BOTTOM;\n    \nprivate:\n    // returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part\n    static bool isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E);\n    \n    // cross procuct of 2 vector. A->B X C->D\n    static float crossProduct2Vector(const Point& A, const Point& B, const Point& C, const Point& D) { return (D.y - C.y) * (B.x - A.x) - (D.x - C.x) * (B.y - A.y); }\n};\n\nclass CC_DLL Size\n{\npublic:\n    float width;\n    float height;\n\npublic:\n    /**\n     * @js NA\n     */\n    Size();\n    /**\n     * @js NA\n     */\n    Size(float width, float height);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Size(const Size& other);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    explicit Size(const Point& point);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Size& operator= (const Size& other);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Size& operator= (const Point& point);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Size operator+(const Size& right) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Size operator-(const Size& right) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Size operator*(float a) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Size operator/(float a) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setSize(float width, float height);\n    /**\n     * @js NA\n     */\n    bool equals(const Size& target) const;\n    \n    static const Size ZERO;\n};\n\nclass CC_DLL Rect\n{\npublic:\n    Point origin;\n    Size  size;\n\npublic:\n    /**\n     * @js NA\n     */\n    Rect();\n    /**\n     * @js NA\n     */\n    Rect(float x, float y, float width, float height);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Rect(const Rect& other);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Rect& operator= (const Rect& other);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setRect(float x, float y, float width, float height);\n    /**\n     * @js NA\n     */\n    float getMinX() const; /// return the leftmost x-value of current rect\n    /**\n     * @js NA\n     */\n    float getMidX() const; /// return the midpoint x-value of current rect\n    /**\n     * @js NA\n     */\n    float getMaxX() const; /// return the rightmost x-value of current rect\n    /**\n     * @js NA\n     */\n    float getMinY() const; /// return the bottommost y-value of current rect\n    /**\n     * @js NA\n     */\n    float getMidY() const; /// return the midpoint y-value of current rect\n    /**\n     * @js NA\n     */\n    float getMaxY() const; /// return the topmost y-value of current rect\n    /**\n     * @js NA\n     */\n    bool equals(const Rect& rect) const;\n    /**\n     * @js NA\n     */\n    bool containsPoint(const Point& point) const;\n    /**\n     * @js NA\n     */\n    bool intersectsRect(const Rect& rect) const;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Rect unionWithRect(const Rect & rect) const;\n    \n    static const Rect ZERO;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif // __CCGEMETRY_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCInteger.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCINTEGER_H__\n#define __CCINTEGER_H__\n\n#include \"CCObject.h\"\n#include \"platform/CCCommon.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\nclass CC_DLL __Integer : public Object, public Clonable\n{\npublic:\n    static __Integer* create(int v)\n    {\n        __Integer* pRet = new __Integer(v);\n        pRet->autorelease();\n        return pRet;\n    }\n    /**\n     * @js NA\n     */\n    __Integer(int v)\n        : _value(v) {}\n    int getValue() const {return _value;}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~__Integer() {\n        CCLOGINFO(\"deallocing ~__Integer: %p\", this);\n    }\n\n    /* override functions */\n    virtual void acceptVisitor(DataVisitor &visitor) { visitor.visit(this); }\n\n    // overrides\n    virtual __Integer* clone() const override\n    {\n        return __Integer::create(_value);\n    }\n    \nprivate:\n    int _value;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCINTEGER_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCMap.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCMAP_H__\n#define __CCMAP_H__\n\n#define USE_STD_UNORDERED_MAP 1\n\n#include \"ccMacros.h\"\n#include \"CCObject.h\"\n#include <vector>\n\n#if USE_STD_UNORDERED_MAP\n#include <unordered_map>\n#else\n#include <map>\n#endif\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\ntemplate <class K, class V>\nclass CC_DLL Map\n{\npublic:\n    // ------------------------------------------\n    // Iterators\n    // ------------------------------------------\n#if USE_STD_UNORDERED_MAP\n    typedef std::unordered_map<K, V> RefMap;\n#else\n    typedef std::map<K, V> RefMap;\n#endif\n    \n    typedef typename RefMap::iterator iterator;\n    typedef typename RefMap::const_iterator const_iterator;\n    \n    iterator begin() { return _data.begin(); }\n    const_iterator begin() const { return _data.begin(); }\n    \n    iterator end() { return _data.end(); }\n    const_iterator end() const { return _data.end(); }\n    \n    const_iterator cbegin() const { return _data.cbegin(); }\n    const_iterator cend() const { return _data.cend(); }\n    \n    /** Default constructor */\n    Map<K, V>()\n    : _data()\n    {\n        static_assert(std::is_convertible<V, Object*>::value, \"Invalid Type for cocos2d::Map<K, V>!\");\n        CCLOGINFO(\"In the default constructor of Map!\");\n    }\n    \n    /** Contructor with capacity */\n    explicit Map<K, V>(ssize_t capacity)\n    : _data()\n    {\n        static_assert(std::is_convertible<V, Object*>::value, \"Invalid Type for cocos2d::Map<K, V>!\");\n        CCLOGINFO(\"In the constructor with capacity of Map!\");\n        _data.reserve(capacity);\n    }\n    \n    /** Copy constructor */\n    Map<K, V>(const Map<K, V>& other)\n    {\n        static_assert(std::is_convertible<V, Object*>::value, \"Invalid Type for cocos2d::Map<K, V>!\");\n        CCLOGINFO(\"In the copy constructor of Map!\");\n        _data = other._data;\n        addRefForAllObjects();\n    }\n    \n    /** Move constructor */\n    Map<K, V>(Map<K, V>&& other)\n    {\n        static_assert(std::is_convertible<V, Object*>::value, \"Invalid Type for cocos2d::Map<K, V>!\");\n        CCLOGINFO(\"In the move constructor of Map!\");\n        _data = std::move(other._data);\n    }\n    \n    /** Destructor\n     *  It will release all objects in map.\n     */\n    ~Map<K, V>()\n    {\n        CCLOGINFO(\"In the destructor of Map!\");\n        clear();\n    }\n    \n    /** Sets capacity of the map */\n    void reserve(ssize_t capacity)\n    {\n#if USE_STD_UNORDERED_MAP\n        _data.reserve(capacity);\n#endif\n    }\n    \n    /** Returns the number of buckets in the Map container. */\n    ssize_t bucketCount() const\n    {\n#if USE_STD_UNORDERED_MAP\n        return _data.bucket_count();\n#else\n        return 0;\n#endif\n    }\n    \n    /** Returns the number of elements in bucket n. */\n    ssize_t bucketSize(ssize_t n) const\n    {\n#if USE_STD_UNORDERED_MAP\n        return _data.bucket_size(n);\n#else\n        return 0;\n#endif\n    }\n    \n    /** Returns the bucket number where the element with key k is located. */\n    ssize_t bucket(const K& k) const\n    {\n#if USE_STD_UNORDERED_MAP\n        return _data.bucket(k);\n#else\n        return 0;\n#endif\n    }\n    \n    /** The number of elements in the map. */\n    ssize_t size() const\n    {\n        return _data.size();\n    }\n    \n    /** Returns a bool value indicating whether the map container is empty, i.e. whether its size is 0.\n     *  @note This function does not modify the content of the container in any way.\n     *        To clear the content of an array object, member function unordered_map::clear exists.\n     */\n    bool empty() const\n    {\n        return _data.empty();\n    }\n    \n    /** Returns all keys in the map */\n    std::vector<K> keys() const\n    {\n        std::vector<K> keys;\n\n        if (!_data.empty())\n        {\n            keys.reserve(_data.size());\n            \n            for (auto iter = _data.cbegin(); iter != _data.cend(); ++iter)\n            {\n                keys.push_back(iter->first);\n            }\n        }\n        return keys;\n    }\n    \n    /** Returns all keys that matches the object */\n    std::vector<K> keys(V object) const\n    {\n        std::vector<K> keys;\n        \n        if (!_data.empty())\n        {\n            keys.reserve(_data.size() / 10);\n            \n            for (auto iter = _data.cbegin(); iter != _data.cend(); ++iter)\n            {\n                if (iter->second == object)\n                {\n                    keys.push_back(iter->first);\n                }\n            }\n        }\n        \n        keys.shrink_to_fit();\n        \n        return keys;\n    }\n    \n    /** @brief Returns a reference to the mapped value of the element with key k in the map.\n     *  @note If key does not match the key of any element in the container, the function return nullptr.\n     *  @param key Key value of the element whose mapped value is accessed.\n     *       Member type K is the keys for the elements in the container. defined in Map<K, V> as an alias of its first template parameter (Key).\n     */\n    const V at(const K& key) const\n    {\n        auto iter = _data.find(key);\n        if (iter != _data.end())\n            return iter->second;\n        return nullptr;\n    }\n    \n    V at(const K& key)\n    {\n        auto iter = _data.find(key);\n        if (iter != _data.end())\n            return iter->second;\n        return nullptr;\n    }\n    \n    /** @brief Searches the container for an element with 'key' as key and returns an iterator to it if found,\n     *         otherwise it returns an iterator to Map<K, V>::end (the element past the end of the container).\n     *  @param key Key to be searched for.\n     *         Member type 'K' is the type of the keys for the elements in the container,\n     *         defined in Map<K, V> as an alias of its first template parameter (Key).\n     *\n     */\n    const_iterator find(const K& key) const\n    {\n        return _data.find(key);\n    }\n    \n    iterator find(const K& key)\n    {\n        return _data.find(key);\n    }\n    \n    /** @brief Inserts new elements in the map.\n     *  @note If the container has already contained the key, this function will erase the old pair(key, object)  and insert the new pair.\n     *  @param key The key to be inserted.\n     *  @param object The object to be inserted.\n     */\n    void insert(const K& key, V object)\n    {\n        CCASSERT(object != nullptr, \"Object is nullptr!\");\n        erase(key);\n        _data.insert(std::make_pair(key, object));\n        object->retain();\n    }\n    \n    /** @brief Removes an element with an iterator from the Map<K, V> container.\n     *  @param position Iterator pointing to a single element to be removed from the Map<K, V>.\n     *         Member type const_iterator is a forward iterator type.\n     */\n    iterator erase(const_iterator position)\n    {\n        CCASSERT(position != _data.cend(), \"Invalid iterator!\");\n        position->second->release();\n        return _data.erase(position);\n    }\n    \n    /** @brief Removes an element with an iterator from the Map<K, V> container.\n     *  @param k Key of the element to be erased.\n     *         Member type 'K' is the type of the keys for the elements in the container,\n     *         defined in Map<K, V> as an alias of its first template parameter (Key).\n     */\n    size_t erase(const K& k)\n    {\n        auto iter = _data.find(k);\n        if (iter != _data.end())\n        {\n            iter->second->release();\n            _data.erase(iter);\n            return 1;\n        }\n        \n        return 0;\n    }\n    \n    /** @brief Removes some elements with a vector which contains keys in the map.\n     *  @param keys Keys of elements to be erased.\n     */\n    void erase(const std::vector<K>& keys)\n    {\n        for(const auto &key : keys) {\n            this->erase(key);\n        }\n    }\n    \n    /** All the elements in the Map<K,V> container are dropped:\n     *  their reference count will be decreased, and they are removed from the container,\n     *  leaving it with a size of 0.\n     */\n    void clear()\n    {\n        for (auto iter = _data.cbegin(); iter != _data.cend(); ++iter)\n        {\n            iter->second->release();\n        }\n        \n        _data.clear();\n    }\n    \n    /** @brief Gets a random object in the map\n     *  @return Returns the random object if the map isn't empty, otherwise it returns nullptr.\n     */\n    V getRandomObject() const\n    {\n        if (!_data.empty())\n        {\n            ssize_t randIdx = rand() % _data.size();\n            const_iterator randIter = _data.begin();\n            std::advance(randIter , randIdx);\n            return randIter->second;\n        }\n        return nullptr;\n    }\n    \n    // Don't uses operator since we could not decide whether it needs 'retain'/'release'.\n    //    V& operator[] ( const K& key )\n    //    {\n    //        CCLOG(\"copy: [] ref\");\n    //        return _data[key];\n    //    }\n    //\n    //    V& operator[] ( K&& key )\n    //    {\n    //        CCLOG(\"move [] ref\");\n    //        return _data[key];\n    //    }\n    \n    //    const V& operator[] ( const K& key ) const\n    //    {\n    //        CCLOG(\"const copy []\");\n    //        return _data.at(key);\n    //    }\n    //\n    //    const V& operator[] ( K&& key ) const\n    //    {\n    //        CCLOG(\"const move []\");\n    //        return _data.at(key);\n    //    }\n    \n    /** Copy assignment operator */\n    Map<K, V>& operator= ( const Map<K, V>& other )\n    {\n        if (this != &other) {\n            CCLOGINFO(\"In the copy assignment operator of Map!\");\n            clear();\n            _data = other._data;\n            addRefForAllObjects();\n        }\n        return *this;\n    }\n    \n    /** Move assignment operator */\n    Map<K, V>& operator= ( Map<K, V>&& other )\n    {\n        if (this != &other) {\n            CCLOGINFO(\"In the move assignment operator of Map!\");\n            clear();\n            _data = std::move(other._data);\n        }\n        return *this;\n    }\n    \nprotected:\n    \n    /** Retains all the objects in the map */\n    void addRefForAllObjects()\n    {\n        for (auto iter = _data.begin(); iter != _data.end(); ++iter)\n        {\n            iter->second->retain();\n        }\n    }\n    \n    RefMap _data;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif /* __CCMAP_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCNS.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"CCNS.h\"\n#include <string>\n#include <vector>\n#include <string.h>\n#include <stdlib.h>\n\nusing namespace std;\n\nNS_CC_BEGIN\n\ntypedef std::vector<std::string> strArray;\n\n// string toolkit\nstatic inline void split(const std::string& src, const std::string& token, strArray& vect)\n{\n    size_t nend = 0;\n    size_t nbegin = 0;\n    size_t tokenSize = token.size();\n    while(nend != std::string::npos)\n    {\n        nend = src.find(token, nbegin);\n        if(nend == std::string::npos)\n            vect.push_back(src.substr(nbegin, src.length()-nbegin));\n        else\n            vect.push_back(src.substr(nbegin, nend-nbegin));\n        nbegin = nend + tokenSize;\n    }\n}\n\n// first, judge whether the form of the string like this: {x,y}\n// if the form is right,the string will be split into the parameter strs;\n// or the parameter strs will be empty.\n// if the form is right return true,else return false.\nstatic bool splitWithForm(const std::string& str, strArray& strs)\n{\n    bool bRet = false;\n\n    do \n    {\n        CC_BREAK_IF(str.empty());\n\n        // string is empty\n        std::string content = str;\n        CC_BREAK_IF(content.length() == 0);\n\n        size_t nPosLeft  = content.find('{');\n        size_t nPosRight = content.find('}');\n\n        // don't have '{' and '}'\n        CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos);\n        // '}' is before '{'\n        CC_BREAK_IF(nPosLeft > nPosRight);\n\n        std::string pointStr = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1);\n        // nothing between '{' and '}'\n        CC_BREAK_IF(pointStr.length() == 0);\n\n        size_t nPos1 = pointStr.find('{');\n        size_t nPos2 = pointStr.find('}');\n        // contain '{' or '}' \n        CC_BREAK_IF(nPos1 != std::string::npos || nPos2 != std::string::npos);\n\n        split(pointStr, \",\", strs);\n        if (strs.size() != 2 || strs[0].length() == 0 || strs[1].length() == 0)\n        {\n            strs.clear();\n            break;\n        }\n\n        bRet = true;\n    } while (0);\n\n    return bRet;\n}\n\n// implement the functions\n\nRect RectFromString(const std::string& str)\n{\n    Rect result = Rect::ZERO;\n\n    do \n    {\n        CC_BREAK_IF(str.empty());\n        std::string content = str;\n\n        // find the first '{' and the third '}'\n        size_t nPosLeft  = content.find('{');\n        size_t nPosRight = content.find('}');\n        for (int i = 1; i < 3; ++i)\n        {\n            if (nPosRight == std::string::npos)\n            {\n                break;\n            }\n            nPosRight = content.find('}', nPosRight + 1);\n        }\n        CC_BREAK_IF(nPosLeft == std::string::npos || nPosRight == std::string::npos);\n\n        content = content.substr(nPosLeft + 1, nPosRight - nPosLeft - 1);\n        size_t nPointEnd = content.find('}');\n        CC_BREAK_IF(nPointEnd == std::string::npos);\n        nPointEnd = content.find(',', nPointEnd);\n        CC_BREAK_IF(nPointEnd == std::string::npos);\n\n        // get the point string and size string\n        std::string pointStr = content.substr(0, nPointEnd);\n        std::string sizeStr  = content.substr(nPointEnd + 1, content.length() - nPointEnd);\n\n        // split the string with ','\n        strArray pointInfo;\n        CC_BREAK_IF(!splitWithForm(pointStr.c_str(), pointInfo));\n        strArray sizeInfo;\n        CC_BREAK_IF(!splitWithForm(sizeStr.c_str(), sizeInfo));\n\n        float x = (float) atof(pointInfo[0].c_str());\n        float y = (float) atof(pointInfo[1].c_str());\n        float width  = (float) atof(sizeInfo[0].c_str());\n        float height = (float) atof(sizeInfo[1].c_str());\n\n        result = Rect(x, y, width, height);\n    } while (0);\n\n    return result;\n}\n\nPoint PointFromString(const std::string& str)\n{\n    Point ret = Point::ZERO;\n\n    do \n    {\n        strArray strs;\n        CC_BREAK_IF(!splitWithForm(str, strs));\n\n        float x = (float) atof(strs[0].c_str());\n        float y = (float) atof(strs[1].c_str());\n\n        ret = Point(x, y);\n    } while (0);\n\n    return ret;\n}\n\nSize SizeFromString(const std::string& pszContent)\n{\n    Size ret = Size::ZERO;\n\n    do \n    {\n        strArray strs;\n        CC_BREAK_IF(!splitWithForm(pszContent, strs));\n\n        float width  = (float) atof(strs[0].c_str());\n        float height = (float) atof(strs[1].c_str());\n\n        ret = Size(width, height);\n    } while (0);\n\n    return ret;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCNS.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __PLATFOMR_CCNS_H__\n#define __PLATFOMR_CCNS_H__\n\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\n/**\n@brief Returns a Core Graphics rectangle structure corresponding to the data in a given string.\n@param pszContent   A string object whose contents are of the form \"{{x,y},{w, h}}\",\n                    where x is the x coordinate, y is the y coordinate, w is the width, and h is the height.\n                    These components can represent integer or float values.\n                    An example of a valid string is \"{{3,2},{4,5}}\".\n                    The string is not localized, so items are always separated with a comma.\n@return A Core Graphics structure that represents a rectangle.\n        If the string is not well-formed, the function returns Rect::ZERO.\n*/\nRect CC_DLL RectFromString(const std::string& str);\n\n/**\n@brief Returns a Core Graphics point structure corresponding to the data in a given string.\n@param pszContent   A string object whose contents are of the form \"{x,y}\",\n                    where x is the x coordinate and y is the y coordinate.\n                    The x and y values can represent integer or float values.\n                    An example of a valid string is \"{3.0,2.5}\".\n                    The string is not localized, so items are always separated with a comma.\n@return A Core Graphics structure that represents a point.\n        If the string is not well-formed, the function returns Point::ZERO.\n*/\nPoint CC_DLL PointFromString(const std::string& str);\n\n/**\n@brief Returns a Core Graphics size structure corresponding to the data in a given string.\n@param pszContent   A string object whose contents are of the form \"{w, h}\",\n                    where w is the width and h is the height.\n                    The w and h values can be integer or float values.\n                    An example of a valid string is \"{3.0,2.5}\".\n                    The string is not localized, so items are always separated with a comma.\n@return A Core Graphics structure that represents a size.\n        If the string is not well-formed, the function returns Size::ZERO.\n*/\nSize CC_DLL SizeFromString(const std::string& str);\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif // __PLATFOMR_CCNS_H__\n\n\n"
  },
  {
    "path": "cocos2d/cocos/base/CCObject.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#include \"CCObject.h\"\n#include \"CCAutoreleasePool.h\"\n#include \"ccMacros.h\"\n#include \"CCScriptSupport.h\"\n\nNS_CC_BEGIN\n\nObject::Object()\n: _luaID(0)\n, _referenceCount(1) // when the object is created, the reference count of it is 1\n{\n    static unsigned int uObjectCount = 0;\n\n    _ID = ++uObjectCount;\n}\n\nObject::~Object()\n{\n    // if the object is referenced by Lua engine, remove it\n    if (_luaID)\n    {\n        ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptObjectByObject(this);\n    }\n    else\n    {\n        ScriptEngineProtocol* pEngine = ScriptEngineManager::getInstance()->getScriptEngine();\n        if (pEngine != NULL && pEngine->getScriptType() == kScriptTypeJavascript)\n        {\n            pEngine->removeScriptObjectByObject(this);\n        }\n    }\n}\n\nObject* Object::autorelease()\n{\n    PoolManager::getInstance()->getCurrentPool()->addObject(this);\n    return this;\n}\n\n\n\nvoid Object::release()\n{\n    CCASSERT(_referenceCount > 0, \"reference count should greater than 0\");\n    --_referenceCount;\n    \n    if (_referenceCount == 0)\n    {\n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n        auto poolManager = PoolManager::getInstance();\n        if (!poolManager->getCurrentPool()->isClearing() && poolManager->isObjectInPools(this))\n        {\n            // Trigger an assert if the reference count is 0 but the object is still in autorelease pool.\n            // This happens when 'autorelease/release' were not used in pairs with 'new/retain'.\n            //\n            // Wrong usage (1):\n            //\n            // auto obj = Node::create();   // Ref = 1, but it's an autorelease object which means it was in the autorelease pool.\n            // obj->autorelease();   // Wrong: If you wish to invoke autorelease several times, you should retain `obj` first.\n            //\n            // Wrong usage (2):\n            //\n            // auto obj = Node::create();\n            // obj->release();   // Wrong: obj is an autorelease object, it will be released when clearing current pool.\n            //\n            // Correct usage (1):\n            //\n            // auto obj = Node::create();\n            //                     |-   new Node();     // `new` is the pair of the `autorelease` of next line\n            //                     |-   autorelease();  // The pair of `new Node`.\n            //\n            // obj->retain();\n            // obj->autorelease();  // This `autorelease` is the pair of `retain` of previous line.\n            //\n            // Correct usage (2):\n            //\n            // auto obj = Node::create();\n            // obj->retain();\n            // obj->release();   // This `release` is the pair of `retain` of previous line.\n            CCASSERT(false, \"The reference shouldn't be 0 because it is still in autorelease pool.\");\n        }\n#endif\n        delete this;\n    }\n}\n\nbool Object::isSingleReference() const\n{\n    return _referenceCount == 1;\n}\n\nunsigned int Object::getReferenceCount() const\n{\n    return _referenceCount;\n}\n\nbool Object::isEqual(const Object *object)\n{\n    return this == object;\n}\n\nvoid Object::acceptVisitor(DataVisitor &visitor)\n{\n    visitor.visitObject(this);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCObject.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCOBJECT_H__\n#define __CCOBJECT_H__\n\n#include \"CCDataVisitor.h\"\n#include \"ccMacros.h\"\n#include \"CCConsole.h\"\n\n#ifdef EMSCRIPTEN\n#include <GLES2/gl2.h>\n#endif // EMSCRIPTEN\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup base_nodes\n * @{\n */\n\nclass Object;\nclass Node;\n\n/** Interface that defines how to clone an object */\nclass CC_DLL Clonable\n{\npublic:\n\t/** returns a copy of the object */\n    virtual Clonable* clone() const = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n\tvirtual ~Clonable() {};\n\n    /** returns a copy of the object.\n     @deprecated Use clone() instead\n     */\n    CC_DEPRECATED_ATTRIBUTE Object* copy() const\n    {\n        // use \"clone\" instead\n        CC_ASSERT(false);\n        return nullptr;\n    }\n};\n\nclass CC_DLL Object\n{\npublic:\n    /// object id, ScriptSupport need public _ID\n    unsigned int _ID;\n    /// Lua reference id\n    int _luaID;\nprotected:\n    /// count of references\n    unsigned int _referenceCount;\npublic:\n    /**\n     * Constructor\n     *\n     * The object's reference count is 1 after construction.\n     * @js NA\n     */\n    Object();\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Object();\n    \n    /**\n     * Release the ownership immediately.\n     *\n     * This decrements the object's reference count.\n     *\n     * If the reference count reaches 0 after the descrement, this object is\n     * destructed.\n     *\n     * @see retain, autorelease\n     * @js NA\n     */\n    void release();\n\n    /**\n     * Retains the ownership.\n     *\n     * This increases the object's reference count.\n     *\n     * @see release, autorelease\n     * @js NA\n     */\n    inline void retain()\n    {\n        CCASSERT(_referenceCount > 0, \"reference count should greater than 0\");\n        ++_referenceCount;\n    }\n\n    /**\n     * Release the ownership sometime soon automatically.\n     *\n     * This descrements the object's reference count at the end of current\n     * autorelease pool block.\n     *\n     * If the reference count reaches 0 after the descrement, this object is\n     * destructed.\n     *\n     * @returns The object itself.\n     *\n     * @see AutoreleasePool, retain, release\n     * @js NA\n     * @lua NA\n     */\n    Object* autorelease();\n\n    /**\n     * Returns a boolean value that indicates whether there is only one\n     * reference to the object. That is, whether the reference count is 1.\n     *\n     * @returns Whether the object's reference count is 1.\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE bool isSingleReference() const;\n\n    /**\n     * Returns the object's current reference count.\n     *\n     * @returns The object's reference count.\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE unsigned int retainCount() const { return getReferenceCount(); };\n    unsigned int getReferenceCount() const;\n\n    /**\n     * Returns a boolean value that indicates whether this object and a given\n     * object are equal.\n     *\n     * @param object    The object to be compared to this object.\n     *\n     * @returns True if this object and @p object are equal, otherwise false.\n     * @js NA\n     * @lua NA\n     */\n    virtual bool isEqual(const Object* object);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void acceptVisitor(DataVisitor &visitor);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void update(float dt) {CC_UNUSED_PARAM(dt);};\n    \n    friend class AutoreleasePool;\n};\n\n\ntypedef void (Object::*SEL_SCHEDULE)(float);\ntypedef void (Object::*SEL_CallFunc)();\ntypedef void (Object::*SEL_CallFuncN)(Node*);\ntypedef void (Object::*SEL_CallFuncND)(Node*, void*);\ntypedef void (Object::*SEL_CallFuncO)(Object*);\ntypedef void (Object::*SEL_MenuHandler)(Object*);\ntypedef int (Object::*SEL_Compare)(Object*);\n\n#define schedule_selector(_SELECTOR) static_cast<cocos2d::SEL_SCHEDULE>(&_SELECTOR)\n#define callfunc_selector(_SELECTOR) static_cast<cocos2d::SEL_CallFunc>(&_SELECTOR)\n#define callfuncN_selector(_SELECTOR) static_cast<cocos2d::SEL_CallFuncN>(&_SELECTOR)\n#define callfuncND_selector(_SELECTOR) static_cast<cocos2d::SEL_CallFuncND>(&_SELECTOR)\n#define callfuncO_selector(_SELECTOR) static_cast<cocos2d::SEL_CallFuncO>(&_SELECTOR)\n#define menu_selector(_SELECTOR) static_cast<cocos2d::SEL_MenuHandler>(&_SELECTOR)\n#define event_selector(_SELECTOR) static_cast<cocos2d::SEL_EventHandler>(&_SELECTOR)\n#define compare_selector(_SELECTOR) static_cast<cocos2d::SEL_Compare>(&_SELECTOR)\n\n// new callbacks based on C++11\n#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__)\n#define CC_CALLBACK_1(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, ##__VA_ARGS__)\n#define CC_CALLBACK_2(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, ##__VA_ARGS__)\n#define CC_CALLBACK_3(__selector__,__target__, ...) std::bind(&__selector__,__target__, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3 ##__VA_ARGS__)\n\n// end of base_nodes group\n/// @}\n\nNS_CC_END\n\n#endif // __CCOBJECT_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCPlatformConfig.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_PLATFORM_CONFIG_H__\n#define __CC_PLATFORM_CONFIG_H__\n\n/**\nConfig of cocos2d-x project, per target platform.\n*/\n\n//////////////////////////////////////////////////////////////////////////\n// pre configure\n//////////////////////////////////////////////////////////////////////////\n\n// define supported target platform macro which CC uses.\n#define CC_PLATFORM_UNKNOWN            0\n#define CC_PLATFORM_IOS                1\n#define CC_PLATFORM_ANDROID            2\n#define CC_PLATFORM_WIN32              3\n#define CC_PLATFORM_MARMALADE          4\n#define CC_PLATFORM_LINUX              5\n#define CC_PLATFORM_BADA               6\n#define CC_PLATFORM_BLACKBERRY         7\n#define CC_PLATFORM_MAC                8\n#define CC_PLATFORM_NACL               9\n#define CC_PLATFORM_EMSCRIPTEN        10\n#define CC_PLATFORM_TIZEN             11\n#define CC_PLATFORM_QT5               12\n\n// Determine target platform by compile environment macro.\n#define CC_TARGET_PLATFORM             CC_PLATFORM_UNKNOWN\n\n// mac\n#if defined(CC_TARGET_OS_MAC)\n#undef  CC_TARGET_PLATFORM\n#define CC_TARGET_PLATFORM         CC_PLATFORM_MAC\n#endif\n\n// iphone\n#if defined(CC_TARGET_OS_IPHONE)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM         CC_PLATFORM_IOS\n#endif\n\n// android\n#if defined(ANDROID)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM         CC_PLATFORM_ANDROID\n#endif\n\n// win32\n#if defined(WIN32) && defined(_WINDOWS)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM         CC_PLATFORM_WIN32\n#endif\n\n// linux\n#if defined(LINUX)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM         CC_PLATFORM_LINUX\n#endif\n\n// marmalade\n#if defined(MARMALADE)\n#undef  CC_TARGET_PLATFORM\n#define CC_TARGET_PLATFORM         CC_PLATFORM_MARMALADE\n#endif\n\n// bada\n#if defined(SHP)\n#undef  CC_TARGET_PLATFORM\n#define CC_TARGET_PLATFORM         CC_PLATFORM_BADA\n#endif\n\n// qnx\n#if defined(__QNX__)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM     CC_PLATFORM_BLACKBERRY\n#endif\n\n// native client\n#if defined(__native_client__)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM     CC_PLATFORM_NACL\n#endif\n\n// Emscripten\n#if defined(EMSCRIPTEN)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM     CC_PLATFORM_EMSCRIPTEN\n#endif\n\n// tizen\n#if defined(TIZEN)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM     CC_PLATFORM_TIZEN\n#endif\n\n// qt5\n#if defined(CC_TARGET_QT5)\n    #undef  CC_TARGET_PLATFORM\n    #define CC_TARGET_PLATFORM     CC_PLATFORM_QT5\n#endif\n\n//////////////////////////////////////////////////////////////////////////\n// post configure\n//////////////////////////////////////////////////////////////////////////\n\n// check user set platform\n#if ! CC_TARGET_PLATFORM\n    #error  \"Cannot recognize the target platform; are you targeting an unsupported platform?\"\n#endif \n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n#ifndef __MINGW32__\n#pragma warning (disable:4127) \n#endif \n#endif  // CC_PLATFORM_WIN32\n\n#endif  // __CC_PLATFORM_CONFIG_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/base/CCPlatformMacros.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __CC_PLATFORM_MACROS_H__\n#define __CC_PLATFORM_MACROS_H__\n\n/**\n * define some platform specific macros\n */\n#include \"ccConfig.h\"\n#include \"CCPlatformConfig.h\"\n#include \"CCPlatformDefine.h\"\n\n/**\n * define a create function for a specific type, such as Layer\n * @param \\__TYPE__  class type to add create(), such as Layer\n */\n#define CREATE_FUNC(__TYPE__) \\\nstatic __TYPE__* create() \\\n{ \\\n    __TYPE__ *pRet = new __TYPE__(); \\\n    if (pRet && pRet->init()) \\\n    { \\\n        pRet->autorelease(); \\\n        return pRet; \\\n    } \\\n    else \\\n    { \\\n        delete pRet; \\\n        pRet = NULL; \\\n        return NULL; \\\n    } \\\n}\n\n/**\n * define a node function for a specific type, such as Layer\n * @param \\__TYPE__  class type to add node(), such as Layer\n * @deprecated  This interface will be deprecated sooner or later.\n */\n#define NODE_FUNC(__TYPE__) \\\nCC_DEPRECATED_ATTRIBUTE static __TYPE__* node() \\\n{ \\\n    __TYPE__ *pRet = new __TYPE__(); \\\n    if (pRet && pRet->init()) \\\n    { \\\n        pRet->autorelease(); \\\n        return pRet; \\\n    } \\\n    else \\\n    { \\\n        delete pRet; \\\n        pRet = NULL; \\\n        return NULL; \\\n    } \\\n}\n\n/** @def CC_ENABLE_CACHE_TEXTURE_DATA\nEnable it if you want to cache the texture data.\nNot enabling for Emscripten any more -- doesn't seem necessary and don't want\nto be different from other platforms unless there's a good reason.\n\nIt's new in cocos2d-x since v0.99.5\n*/\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n    #define CC_ENABLE_CACHE_TEXTURE_DATA       1\n#else\n    #define CC_ENABLE_CACHE_TEXTURE_DATA       0\n#endif\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)\n    /* Application will crash in glDrawElements function on some win32 computers and some android devices.\n       Indices should be bound again while drawing to avoid this bug.\n     */\n    #define CC_REBIND_INDICES_BUFFER  1\n#else\n    #define CC_REBIND_INDICES_BUFFER  0\n#endif\n\n// generic macros\n\n// namespace cocos2d {}\n#ifdef __cplusplus\n    #define NS_CC_BEGIN                     namespace cocos2d {\n    #define NS_CC_END                       }\n    #define USING_NS_CC                     using namespace cocos2d\n#else\n    #define NS_CC_BEGIN \n    #define NS_CC_END \n    #define USING_NS_CC \n#endif \n\n/** CC_PROPERTY_READONLY is used to declare a protected variable.\n We can use getter to read the variable.\n @param varType     the type of variable.\n @param varName     variable name.\n @param funName     \"get + funName\" will be the name of the getter.\n @warning   The getter is a public virtual function, you should rewrite it first.\n            The variables and methods declared after CC_PROPERTY_READONLY are all public.\n            If you need protected or private, please declare.\n */\n#define CC_PROPERTY_READONLY(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual varType get##funName(void) const;\n\n#define CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual const varType& get##funName(void) const;\n\n/** CC_PROPERTY is used to declare a protected variable.\n We can use getter to read the variable, and use the setter to change the variable.\n @param varType     the type of variable.\n @param varName     variable name.\n @param funName     \"get + funName\" will be the name of the getter.\n                    \"set + funName\" will be the name of the setter.\n @warning   The getter and setter are public virtual functions, you should rewrite them first.\n            The variables and methods declared after CC_PROPERTY are all public.\n            If you need protected or private, please declare.\n */\n#define CC_PROPERTY(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual varType get##funName(void);\\\npublic: virtual void set##funName(varType var);\n\n#define CC_PROPERTY_PASS_BY_REF(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual const varType& get##funName(void) const;\\\npublic: virtual void set##funName(const varType& var);\n\n/** CC_SYNTHESIZE_READONLY is used to declare a protected variable.\n We can use getter to read the variable.\n @param varType     the type of variable.\n @param varName     variable name.\n @param funName     \"get + funName\" will be the name of the getter.\n @warning   The getter is a public inline function.\n            The variables and methods declared after CC_SYNTHESIZE_READONLY are all public.\n            If you need protected or private, please declare.\n */\n#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual varType get##funName(void) const { return varName; }\n\n#define CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual const varType& get##funName(void) const { return varName; }\n\n/** CC_SYNTHESIZE is used to declare a protected variable.\n We can use getter to read the variable, and use the setter to change the variable.\n @param varType     the type of variable.\n @param varName     variable name.\n @param funName     \"get + funName\" will be the name of the getter.\n                    \"set + funName\" will be the name of the setter.\n @warning   The getter and setter are public inline functions.\n            The variables and methods declared after CC_SYNTHESIZE are all public.\n            If you need protected or private, please declare.\n */\n#define CC_SYNTHESIZE(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual varType get##funName(void) const { return varName; }\\\npublic: virtual void set##funName(varType var){ varName = var; }\n\n#define CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\\\nprotected: varType varName;\\\npublic: virtual const varType& get##funName(void) const { return varName; }\\\npublic: virtual void set##funName(const varType& var){ varName = var; }\n\n#define CC_SYNTHESIZE_RETAIN(varType, varName, funName)    \\\nprivate: varType varName; \\\npublic: virtual varType get##funName(void) const { return varName; } \\\npublic: virtual void set##funName(varType var)   \\\n{ \\\n    if (varName != var) \\\n    { \\\n        CC_SAFE_RETAIN(var); \\\n        CC_SAFE_RELEASE(varName); \\\n        varName = var; \\\n    } \\\n} \n\n#define CC_SAFE_DELETE(p)           do { delete (p); (p) = nullptr; } while(0)\n#define CC_SAFE_DELETE_ARRAY(p)     do { if(p) { delete[] (p); (p) = nullptr; } } while(0)\n#define CC_SAFE_FREE(p)             do { if(p) { free(p); (p) = nullptr; } } while(0)\n#define CC_SAFE_RELEASE(p)          do { if(p) { (p)->release(); } } while(0)\n#define CC_SAFE_RELEASE_NULL(p)     do { if(p) { (p)->release(); (p) = nullptr; } } while(0)\n#define CC_SAFE_RETAIN(p)           do { if(p) { (p)->retain(); } } while(0)\n#define CC_BREAK_IF(cond)           if(cond) break\n\n#define __CCLOGWITHFUNCTION(s, ...) \\\n    log(\"%s : %s\",__FUNCTION__, StringUtils::format(s, ##__VA_ARGS__).c_str())\n\n// cocos2d debug\n#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0\n#define CCLOG(...)       do {} while (0)\n#define CCLOGINFO(...)   do {} while (0)\n#define CCLOGERROR(...)  do {} while (0)\n#define CCLOGWARN(...)   do {} while (0)\n\n#elif COCOS2D_DEBUG == 1\n#define CCLOG(format, ...)      cocos2d::log(format, ##__VA_ARGS__)\n#define CCLOGERROR(format,...)  cocos2d::log(format, ##__VA_ARGS__)\n#define CCLOGINFO(format,...)   do {} while (0)\n#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__)\n\n#elif COCOS2D_DEBUG > 1\n#define CCLOG(format, ...)      cocos2d::log(format, ##__VA_ARGS__)\n#define CCLOGERROR(format,...)  cocos2d::log(format, ##__VA_ARGS__)\n#define CCLOGINFO(format,...)   cocos2d::log(format, ##__VA_ARGS__)\n#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__)\n#endif // COCOS2D_DEBUG\n\n// Lua engine debug\n#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 || CC_LUA_ENGINE_DEBUG == 0\n#define LUALOG(...)\n#else\n#define LUALOG(format, ...)     cocos2d::log(format, ##__VA_ARGS__)\n#endif // Lua engine debug\n\n// A macro to disallow the copy constructor and operator= functions\n// This should be used in the private: declarations for a class\n#if defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUG__ == 4) && (__GNUC_MINOR__ >= 4))) \\\n\t|| (defined(__clang__) && (__clang_major__ >= 3)) || (_MSC_VER >= 1800)\n#define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \\\n    TypeName(const TypeName &) = delete; \\\n    TypeName &operator =(const TypeName &) = delete;\n#else\n#define CC_DISALLOW_COPY_AND_ASSIGN(TypeName) \\\n    TypeName(const TypeName &); \\\n    TypeName &operator =(const TypeName &);\n#endif\n\n// A macro to disallow all the implicit constructors, namely the\n// default constructor, copy constructor and operator= functions.\n//\n// This should be used in the private: declarations for a class\n// that wants to prevent anyone from instantiating it. This is\n// especially useful for classes containing only static methods.\n#define CC_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)    \\\n    TypeName();                                        \\\n    CC_DISALLOW_COPY_AND_ASSIGN(TypeName)\n\n/*\n * only certain compilers support __attribute__((deprecated))\n */\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n    #define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated))\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n    #define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated) \n#else\n    #define CC_DEPRECATED_ATTRIBUTE\n#endif \n\n/*\n * only certain compiler support __attribute__((format))\n * formatPos - 1-based position of format string argument\n * argPos - 1-based position of first format-dependent argument\n */\n#if defined(__GNUC__) && (__GNUC__ >= 4)\n#define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos)))\n#elif defined(__has_attribute)\n  #if __has_attribute(format)\n  #define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos)))\n  #endif // __has_attribute(format)\n#else\n#define CC_FORMAT_PRINTF(formatPos, argPos)\n#endif\n\n#if defined(_MSC_VER)\n#define CC_FORMAT_PRINTF_SIZE_T \"%08lX\"\n#else\n#define CC_FORMAT_PRINTF_SIZE_T \"%08zX\"\n#endif\n\n#ifdef __GNUC__\n#define CC_UNUSED __attribute__ ((unused))\n#else\n#define CC_UNUSED\n#endif\n\n//\n// CC_REQUIRES_NULL_TERMINATION\n//\n#if !defined(CC_REQUIRES_NULL_TERMINATION)\n    #if defined(__APPLE_CC__) && (__APPLE_CC__ >= 5549)\n        #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel(0,1)))\n    #elif defined(__GNUC__)\n        #define CC_REQUIRES_NULL_TERMINATION __attribute__((sentinel))\n    #else\n        #define CC_REQUIRES_NULL_TERMINATION\n    #endif\n#endif\n\n#endif // __CC_PLATFORM_MACROS_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCSet.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCSet.h\"\n\nusing namespace std;\n\nNS_CC_BEGIN\n\n__Set::__Set(void)\n{\n    _set = new set<Object *>;\n}\n\n__Set::__Set(const __Set &r__SetObject)\n{\n    _set = new set<Object *>(*r__SetObject._set);\n\n    // call retain of members\n    __SetIterator iter;\n    for (iter = _set->begin(); iter != _set->end(); ++iter)\n    {\n        if (! (*iter))\n        {\n            break;\n        }\n\n        (*iter)->retain();\n    }\n}\n\n__Set::~__Set(void)\n{\n    removeAllObjects();\n    CC_SAFE_DELETE(_set);\n}\n\nvoid __Set::acceptVisitor(DataVisitor &visitor)\n{\n    visitor.visit(this);\n}\n\n__Set * __Set::create()\n{\n    __Set * pRet = new __Set();\n    \n    if (pRet != NULL)\n    {\n        pRet->autorelease();\n    }\n    \n    return pRet;\n}\n\n__Set* __Set::copy(void)\n{\n    __Set *p__Set = new __Set(*this);\n\n    return p__Set;\n}\n\n__Set* __Set::mutableCopy(void)\n{\n    return copy();\n}\n\nint __Set::count(void)\n{\n    return (int)_set->size();\n}\n\nvoid __Set::addObject(Object *pObject)\n{\n    if (_set->count(pObject) == 0)\n    {\n        CC_SAFE_RETAIN(pObject);\n        _set->insert(pObject);\n    }\n}\n\nvoid __Set::removeObject(Object *pObject)\n{\n    if (_set->erase(pObject) > 0)\n    {\n        CC_SAFE_RELEASE(pObject);\n    }\n}\n\nvoid __Set::removeAllObjects()\n{\n    __SetIterator it = _set->begin();\n    __SetIterator tmp;\n\n    while (it != _set->end())\n    {\n        if (!(*it))\n        {\n            break;\n        }\n        \n        tmp = it;\n        ++tmp;\n        Object * obj = *it;\n        _set->erase(it);\n        CC_SAFE_RELEASE(obj);\n        it = tmp;\n    }\n}\n\nbool __Set::containsObject(Object *pObject)\n{\n    return _set->find(pObject) != _set->end();\n}\n\n__SetIterator __Set::begin(void)\n{\n    return _set->begin();\n}\n\n__SetIterator __Set::end(void)\n{\n    return _set->end();\n}\n\nObject* __Set::anyObject()\n{\n    if (!_set || _set->empty())\n    {\n        return 0;\n    }\n    \n    __SetIterator it;\n\n    for( it = _set->begin(); it != _set->end(); ++it)\n    {\n        if (*it)\n        {\n            return (*it);\n        }\n    }\n\n    return 0;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCSet.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_SET_H__\n#define __CC_SET_H__\n\n#include <set>\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\ntypedef std::set<Object *>::iterator __SetIterator;\n\nclass CC_DLL __Set : public Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    __Set(void);\n    __Set(const __Set &rSetObject);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~__Set(void);\n\n    /**\n    * @brief Create and return a new empty set.\n    */\n    static __Set * create();\n\n    /**\n    *@brief Return a copy of the Set, it will copy all the elements.\n    */\n    __Set* copy();\n    /**\n    *@brief It is the same as copy().\n    */\n    __Set* mutableCopy();\n    /**\n    *@brief Return the number of elements the Set contains.\n    */\n    int count();\n    /**\n    *@brief Add a element into Set, it will retain the element.\n    */\n    void addObject(Object *pObject);\n    /**\n    *@brief Remove the given element, nothing todo if no element equals pObject.\n    */\n    void removeObject(Object *pObject);\n    /**\n     *@brief Remove all elements of the set\n     */\n    void removeAllObjects();\n    /**\n    *@brief Check if Set contains a element equals pObject.\n    */\n    bool containsObject(Object *pObject);\n    /**\n    *@brief Return the iterator that points to the first element.\n    * @js NA\n    * @lua NA\n    */\n    __SetIterator begin();\n    /**\n    *@brief Return the iterator that points to the position after the last element.\n    * @js NA\n    * @lua NA\n    */\n    __SetIterator end();\n    /**\n    *@brief Return the first element if it contains elements, or null if it doesn't contain any element.\n    */\n    Object* anyObject();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void acceptVisitor(DataVisitor &visitor);\n\nprivate:\n    std::set<Object *> *_set;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif // __CC_SET_H__\n\n"
  },
  {
    "path": "cocos2d/cocos/base/CCString.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCString.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"ccMacros.h\"\n#include <stdlib.h>\n#include <stdio.h>\n#include \"CCArray.h\"\n\nNS_CC_BEGIN\n\n#define kMaxStringLen (1024*100)\n\n__String::__String()\n    :_string(\"\")\n{}\n\n__String::__String(const char * str)\n    :_string(str)\n{}\n\n__String::__String(const std::string& str)\n    :_string(str)\n{}\n\n__String::__String(const __String& str)\n    :_string(str.getCString())\n{}\n\n__String::~__String()\n{\n    CCLOGINFO(\"deallocing __String: %p\", this);\n\n    _string.clear();\n}\n\n__String& __String::operator= (const __String& other)\n{\n    if (this != &other) {\n        _string = other._string;\n    }\n    return *this;\n}\n\nbool __String::initWithFormatAndValist(const char* format, va_list ap)\n{\n    bool bRet = false;\n    char* pBuf = (char*)malloc(kMaxStringLen);\n    if (pBuf != NULL)\n    {\n        vsnprintf(pBuf, kMaxStringLen, format, ap);\n        _string = pBuf;\n        free(pBuf);\n        bRet = true;\n    }\n    return bRet;\n}\n\nbool __String::initWithFormat(const char* format, ...)\n{\n    bool bRet = false;\n    _string.clear();\n\n    va_list ap;\n    va_start(ap, format);\n\n    bRet = initWithFormatAndValist(format, ap);\n\n    va_end(ap);\n\n    return bRet;\n}\n\nint __String::intValue() const\n{\n    if (length() == 0)\n    {\n        return 0;\n    }\n    return atoi(_string.c_str());\n}\n\nunsigned int __String::uintValue() const\n{\n    if (length() == 0)\n    {\n        return 0;\n    }\n    return (unsigned int)atoi(_string.c_str());\n}\n\nfloat __String::floatValue() const\n{\n    if (length() == 0)\n    {\n        return 0.0f;\n    }\n    return (float)atof(_string.c_str());\n}\n\ndouble __String::doubleValue() const\n{\n    if (length() == 0)\n    {\n        return 0.0;\n    }\n    return atof(_string.c_str());\n}\n\nbool __String::boolValue() const\n{\n    if (length() == 0)\n    {\n        return false;\n    }\n\n    if (0 == strcmp(_string.c_str(), \"0\") || 0 == strcmp(_string.c_str(), \"false\"))\n    {\n        return false;\n    }\n    return true;\n}\n\nconst char* __String::getCString() const\n{\n    return _string.c_str();\n}\n\nint __String::length() const\n{\n    return static_cast<int>(_string.length());\n}\n\nint __String::compare(const char * pStr) const\n{\n    return strcmp(getCString(), pStr);\n}\n\nvoid __String::append(const std::string& str)\n{\n    _string.append(str);\n}\n\nvoid __String::appendWithFormat(const char* format, ...)\n{\n    va_list ap;\n    va_start(ap, format);\n    \n    char* pBuf = (char*)malloc(kMaxStringLen);\n    if (pBuf != NULL)\n    {\n        vsnprintf(pBuf, kMaxStringLen, format, ap);\n        _string.append(pBuf);\n        free(pBuf);\n    }\n    \n    va_end(ap);\n    \n}\n\n__Array* __String::componentsSeparatedByString(const char *delimiter)\n{\n    __Array* result = __Array::create();\n    std::string strTmp = _string;\n    size_t cutAt;\n    while( (cutAt = strTmp.find_first_of(delimiter)) != strTmp.npos )\n    {\n        if(cutAt > 0)\n        {\n            result->addObject(__String::create(strTmp.substr(0, cutAt)));\n        }\n        strTmp = strTmp.substr(cutAt + 1);\n    }\n    \n    if(strTmp.length() > 0)\n    {\n        result->addObject(__String::create(strTmp));\n    }\n    \n    return result;\n}\n\nbool __String::isEqual(const Object* pObject)\n{\n    bool bRet = false;\n    const __String* pStr = dynamic_cast<const __String*>(pObject);\n    if (pStr != NULL)\n    {\n        if (0 == _string.compare(pStr->_string))\n        {\n            bRet = true;\n        }\n    }\n    return bRet;\n}\n\n__String* __String::create(const std::string& str)\n{\n    __String* ret = new __String(str);\n    ret->autorelease();\n    return ret;\n}\n\n__String* __String::createWithData(const unsigned char* data, int nLen)\n{\n    __String* ret = NULL;\n    if (data != NULL)\n    {\n        char* pStr = (char*)malloc(nLen+1);\n        if (pStr != NULL)\n        {\n            pStr[nLen] = '\\0';\n            if (nLen > 0)\n            {\n                memcpy(pStr, data, nLen);\n            }\n            \n            ret = __String::create(pStr);\n            free(pStr);\n        }\n    }\n    return ret;\n}\n\n__String* __String::createWithFormat(const char* format, ...)\n{\n    __String* ret = __String::create(\"\");\n    va_list ap;\n    va_start(ap, format);\n    ret->initWithFormatAndValist(format, ap);\n    va_end(ap);\n\n    return ret;\n}\n\n__String* __String::createWithContentsOfFile(const char* filename)\n{\n    std::string str = FileUtils::getInstance()->getStringFromFile(filename);\n    return __String::create(std::move(str));\n}\n\nvoid __String::acceptVisitor(DataVisitor &visitor)\n{\n    visitor.visit(this);\n}\n\n__String* __String::clone() const\n{\n    return __String::create(_string);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCString.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCSTRING_H__\n#define __CCSTRING_H__\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)\n#include <string.h>\n#endif\n\n#include <stdarg.h>\n#include <string>\n#include <functional>\n#include <sstream>\n\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup data_structures\n * @{\n */\n\nclass CC_DLL __String : public Object, public Clonable\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    __String();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    __String(const char* str);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    __String(const std::string& str);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    __String(const __String& str);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~__String();\n    \n    /* override assignment operator \n     * @js NA\n     * @lua NA\n     */\n    __String& operator= (const __String& other);\n\n    /** init a string with format, it's similar with the c function 'sprintf' \n     * @js NA\n     * @lua NA\n     */\n    bool initWithFormat(const char* format, ...) CC_FORMAT_PRINTF(2, 3);\n\n    /** convert to int value \n     * @js NA\n     */\n    int intValue() const;\n\n    /** convert to unsigned int value \n     * @js NA\n     */\n    unsigned int uintValue() const;\n\n    /** convert to float value \n     * @js NA\n     */\n    float floatValue() const;\n\n    /** convert to double value \n     * @js NA\n     */\n    double doubleValue() const;\n\n    /** convert to bool value \n     * @js NA\n     */\n    bool boolValue() const;\n\n    /** get the C string \n     * @js NA\n     */\n    const char* getCString() const;\n\n    /** get the length of string \n     * @js NA\n     */\n    int length() const;\n\n    /** compare to a c string \n     * @js NA\n     */\n    int compare(const char *) const;\n\n    /** append additional characters at the end of its current value \n     * @js NA\n     * @lua NA\n     */\n    void append(const std::string& str);\n\n    /** append(w/ format) additional characters at the end of its current value \n     * @js NA\n     * @lua NA\n     */\n    void appendWithFormat(const char* format, ...);\n\n    /** split a string \n     * @js NA\n     * @lua NA\n     */\n    __Array* componentsSeparatedByString(const char *delimiter);\n    \n    /* override functions \n     * @js NA\n     */\n    virtual bool isEqual(const Object* pObject);\n\n    /** create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer. \n     *  @return A String pointer which is an autorelease object pointer,\n     *          it means that you needn't do a release operation unless you retain it.\n     * @js NA\n     */\n    static __String* create(const std::string& str);\n\n    /** create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes,\n     *  if you want to change it, you should modify the kMax__StringLen macro in __String.cpp file.\n     *  @return A String pointer which is an autorelease object pointer,\n     *          it means that you needn't do a release operation unless you retain it.\n     * @js NA\n     */\n    static __String* createWithFormat(const char* format, ...) CC_FORMAT_PRINTF(1, 2);\n\n    /** create a string with binary data \n     *  @return A String pointer which is an autorelease object pointer,\n     *          it means that you needn't do a release operation unless you retain it.\n     * @js NA\n     */\n    static __String* createWithData(const unsigned char* pData, int nLen);\n\n    /** create a string with a file, \n     *  @return A String pointer which is an autorelease object pointer,\n     *          it means that you needn't do a release operation unless you retain it.\n     * @js NA\n     */\n    static __String* createWithContentsOfFile(const char* filename);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void acceptVisitor(DataVisitor &visitor);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual __String* clone() const;\n    \nprivate:\n\n    /** only for internal use */\n    bool initWithFormatAndValist(const char* format, va_list ap);\n\npublic:\n    std::string _string;\n};\n\nstruct StringCompare : public std::binary_function<__String *, __String *, bool> {\n    public:\n        bool operator() (__String * a, __String * b) const {\n            return strcmp(a->getCString(), b->getCString()) < 0;\n        }\n};\n\n#define StringMake(str) String::create(str)\n#define ccs             StringMake\n\nclass StringUtils\n{\npublic:\n    \n    template<typename T>\n    static std::string toString(T arg)\n    {\n        std::stringstream ss;\n        ss << arg;\n        return ss.str();\n    }\n    \n    static std::string format(const char* format, ...) CC_FORMAT_PRINTF(1, 2)\n    {\n        #define CC_MAX_STRING_LENGTH (1024*100)\n        \n        std::string ret;\n        \n        va_list ap;\n        va_start(ap, format);\n        \n        char* buf = (char*)malloc(CC_MAX_STRING_LENGTH);\n        if (buf != nullptr)\n        {\n            vsnprintf(buf, CC_MAX_STRING_LENGTH, format, ap);\n            ret = buf;\n            free(buf);\n        }\n        va_end(ap);\n        \n        return ret;\n    }\n    \n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif //__CCSTRING_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CCValue.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCValue.h\"\n#include <sstream>\n\nNS_CC_BEGIN\n\nconst Value Value::Null;\n\nValue::Value()\n: _vectorData(new ValueVector())\n, _mapData(new ValueMap())\n, _intKeyMapData(new ValueMapIntKey())\n, _type(Type::NONE)\n{\n    \n}\n\nValue::Value(unsigned char v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::BYTE)\n{\n    _baseData.byteVal = v;\n}\n\nValue::Value(int v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::INTEGER)\n{\n    _baseData.intVal = v;\n}\n\nValue::Value(float v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::FLOAT)\n{\n    _baseData.floatVal = v;\n}\n\nValue::Value(double v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::DOUBLE)\n{\n    _baseData.doubleVal = v;\n}\n\nValue::Value(bool v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::BOOLEAN)\n{\n    _baseData.boolVal = v;\n}\n\nValue::Value(const char* v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::STRING)\n{\n    _strData = v;\n}\n\nValue::Value(const std::string& v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::STRING)\n{\n    _strData = v;\n}\n\nValue::Value(const ValueVector& v)\n: _vectorData(new ValueVector())\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::VECTOR)\n{\n    *_vectorData = v;\n}\n\nValue::Value(ValueVector&& v)\n: _vectorData(new ValueVector())\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n, _type(Type::VECTOR)\n{\n    *_vectorData = std::move(v);\n}\n\nValue::Value(const ValueMap& v)\n: _vectorData(nullptr)\n, _mapData(new ValueMap())\n, _intKeyMapData(nullptr)\n, _type(Type::MAP)\n{\n    *_mapData = v;\n}\n\nValue::Value(ValueMap&& v)\n: _vectorData(nullptr)\n, _mapData(new ValueMap())\n, _intKeyMapData(nullptr)\n, _type(Type::MAP)\n{\n    *_mapData = std::move(v);\n}\n\nValue::Value(const ValueMapIntKey& v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(new ValueMapIntKey())\n, _type(Type::INT_KEY_MAP)\n{\n    *_intKeyMapData = v;\n}\n\nValue::Value(ValueMapIntKey&& v)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(new ValueMapIntKey())\n, _type(Type::INT_KEY_MAP)\n{\n    *_intKeyMapData = std::move(v);\n}\n\nValue::Value(const Value& other)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n{\n    *this = other;\n}\n\nValue::Value(Value&& other)\n: _vectorData(nullptr)\n, _mapData(nullptr)\n, _intKeyMapData(nullptr)\n{\n    *this = std::move(other);\n}\n\nValue::~Value()\n{\n    clear();\n}\n\nValue& Value::operator= (const Value& other)\n{\n    if (this != &other) {\n        switch (other._type) {\n            case Type::BYTE:\n                _baseData.byteVal = other._baseData.byteVal;\n                break;\n            case Type::INTEGER:\n                _baseData.intVal = other._baseData.intVal;\n                break;\n            case Type::FLOAT:\n                _baseData.floatVal = other._baseData.floatVal;\n                break;\n            case Type::DOUBLE:\n                _baseData.doubleVal = other._baseData.doubleVal;\n                break;\n            case Type::BOOLEAN:\n                _baseData.boolVal = other._baseData.boolVal;\n                break;\n            case Type::STRING:\n                _strData = other._strData;\n                break;\n            case Type::VECTOR:\n                if (_vectorData == nullptr)\n                    _vectorData = new ValueVector();\n                *_vectorData = *other._vectorData;\n                break;\n            case Type::MAP:\n                if (_mapData == nullptr)\n                    _mapData = new ValueMap();\n                *_mapData = *other._mapData;\n                break;\n            case Type::INT_KEY_MAP:\n                if (_intKeyMapData == nullptr)\n                    _intKeyMapData = new ValueMapIntKey();\n                *_intKeyMapData = *other._intKeyMapData;\n                break;\n            default:\n                break;\n        }\n        _type = other._type;\n    }\n    return *this;\n}\n\nValue& Value::operator= (Value&& other)\n{\n    if (this != &other) {\n        switch (other._type) {\n            case Type::BYTE:\n                _baseData.byteVal = other._baseData.byteVal;\n                break;\n            case Type::INTEGER:\n                _baseData.intVal = other._baseData.intVal;\n                break;\n            case Type::FLOAT:\n                _baseData.floatVal = other._baseData.floatVal;\n                break;\n            case Type::DOUBLE:\n                _baseData.doubleVal = other._baseData.doubleVal;\n                break;\n            case Type::BOOLEAN:\n                _baseData.boolVal = other._baseData.boolVal;\n                break;\n            case Type::STRING:\n                _strData = other._strData;\n                break;\n            case Type::VECTOR:\n                CC_SAFE_DELETE(_vectorData);\n                _vectorData = other._vectorData;\n                break;\n            case Type::MAP:\n                CC_SAFE_DELETE(_mapData);\n                _mapData = other._mapData;\n                break;\n            case Type::INT_KEY_MAP:\n                CC_SAFE_DELETE(_intKeyMapData);\n                _intKeyMapData = other._intKeyMapData;\n                break;\n            default:\n                break;\n        }\n        _type = other._type;\n        \n        other._vectorData = nullptr;\n        other._mapData = nullptr;\n        other._intKeyMapData = nullptr;\n        other._type = Type::NONE;\n    }\n    \n    return *this;\n}\n\nValue& Value::operator= (unsigned char v)\n{\n    clear();\n    _type = Type::BYTE;\n    _baseData.byteVal = v;\n    return *this;\n}\n\nValue& Value::operator= (int v)\n{\n    clear();\n    _type = Type::INTEGER;\n    _baseData.intVal = v;\n    return *this;\n}\n\nValue& Value::operator= (float v)\n{\n    clear();\n    _type = Type::FLOAT;\n    _baseData.floatVal = v;\n    return *this;\n}\n\nValue& Value::operator= (double v)\n{\n    clear();\n    _type = Type::DOUBLE;\n    _baseData.doubleVal = v;\n    return *this;\n}\n\nValue& Value::operator= (bool v)\n{\n    clear();\n    _type = Type::BOOLEAN;\n    _baseData.boolVal = v;\n    return *this;\n}\n\nValue& Value::operator= (const char* v)\n{\n    clear();\n    _type = Type::STRING;\n    _strData = v ? v : \"\";\n    return *this;\n}\n\nValue& Value::operator= (const std::string& v)\n{\n    clear();\n    _type = Type::STRING;\n    _strData = v;\n    return *this;\n}\n\nValue& Value::operator= (const ValueVector& v)\n{\n    clear();\n    _type = Type::VECTOR;\n    _vectorData = new ValueVector();\n    *_vectorData = v;\n    return *this;\n}\n\nValue& Value::operator= (ValueVector&& v)\n{\n    clear();\n    _type = Type::VECTOR;\n    _vectorData = new ValueVector();\n    *_vectorData = std::move(v);\n    return *this;\n}\n\nValue& Value::operator= (const ValueMap& v)\n{\n    clear();\n    _type = Type::MAP;\n    _mapData = new ValueMap();\n    *_mapData = v;\n    return *this;\n}\n\nValue& Value::operator= (ValueMap&& v)\n{\n    clear();\n    _type = Type::MAP;\n    _mapData = new ValueMap();\n    *_mapData = std::move(v);\n    return *this;\n}\n\nValue& Value::operator= (const ValueMapIntKey& v)\n{\n    clear();\n    _type = Type::INT_KEY_MAP;\n    _intKeyMapData = new ValueMapIntKey();\n    *_intKeyMapData = v;\n    return *this;\n}\n\nValue& Value::operator= (ValueMapIntKey&& v)\n{\n    clear();\n    _type = Type::INT_KEY_MAP;\n    _intKeyMapData = new ValueMapIntKey();\n    *_intKeyMapData = std::move(v);\n    return *this;\n}\n\n///\nunsigned char Value::asByte() const\n{\n    CCASSERT(_type != Type::VECTOR && _type != Type::MAP, \"\");\n    \n    if (_type == Type::BYTE)\n    {\n        return _baseData.byteVal;\n    }\n    \n    if (_type == Type::INTEGER)\n    {\n        return static_cast<unsigned char>(_baseData.intVal);\n    }\n    \n    if (_type == Type::STRING)\n    {\n        return static_cast<unsigned char>(atoi(_strData.c_str()));\n    }\n    \n    if (_type == Type::FLOAT)\n    {\n        return static_cast<unsigned char>(_baseData.floatVal);\n    }\n    \n    if (_type == Type::DOUBLE)\n    {\n        return static_cast<unsigned char>(_baseData.doubleVal);\n    }\n    \n    if (_type == Type::BOOLEAN)\n    {\n        return _baseData.boolVal ? 1 : 0;\n    }\n    \n    return 0;\n}\n\nint Value::asInt() const\n{\n    CCASSERT(_type != Type::VECTOR && _type != Type::MAP, \"\");\n    if (_type == Type::INTEGER)\n    {\n        return _baseData.intVal;\n    }\n    \n    if (_type == Type::BYTE)\n    {\n        return _baseData.byteVal;\n    }\n    \n    if (_type == Type::STRING)\n    {\n        return atoi(_strData.c_str());\n    }\n    \n    if (_type == Type::FLOAT)\n    {\n        return static_cast<int>(_baseData.floatVal);\n    }\n    \n    if (_type == Type::DOUBLE)\n    {\n        return static_cast<int>(_baseData.doubleVal);\n    }\n    \n    if (_type == Type::BOOLEAN)\n    {\n        return _baseData.boolVal ? 1 : 0;\n    }\n    \n    return 0;\n}\n\nfloat Value::asFloat() const\n{\n    CCASSERT(_type != Type::VECTOR && _type != Type::MAP, \"\");\n    if (_type == Type::FLOAT)\n    {\n        return _baseData.floatVal;\n    }\n    \n    if (_type == Type::BYTE)\n    {\n        return static_cast<float>(_baseData.byteVal);\n    }\n    \n    if (_type == Type::STRING)\n    {\n        return atof(_strData.c_str());\n    }\n    \n    if (_type == Type::INTEGER)\n    {\n        return static_cast<float>(_baseData.intVal);\n    }\n    \n    if (_type == Type::DOUBLE)\n    {\n        return static_cast<float>(_baseData.doubleVal);\n    }\n    \n    if (_type == Type::BOOLEAN)\n    {\n        return _baseData.boolVal ? 1.0f : 0.0f;\n    }\n    \n    return 0.0f;\n}\n\ndouble Value::asDouble() const\n{\n    CCASSERT(_type != Type::VECTOR && _type != Type::MAP, \"\");\n    if (_type == Type::DOUBLE)\n    {\n        return _baseData.doubleVal;\n    }\n    \n    if (_type == Type::BYTE)\n    {\n        return static_cast<double>(_baseData.byteVal);\n    }\n    \n    if (_type == Type::STRING)\n    {\n        return static_cast<double>(atof(_strData.c_str()));\n    }\n    \n    if (_type == Type::INTEGER)\n    {\n        return static_cast<double>(_baseData.intVal);\n    }\n    \n    if (_type == Type::FLOAT)\n    {\n        return static_cast<double>(_baseData.floatVal);\n    }\n    \n    if (_type == Type::BOOLEAN)\n    {\n        return _baseData.boolVal ? 1.0 : 0.0;\n    }\n    \n    return 0.0;\n}\n\nbool Value::asBool() const\n{\n    CCASSERT(_type != Type::VECTOR && _type != Type::MAP, \"\");\n    if (_type == Type::BOOLEAN)\n    {\n        return _baseData.boolVal;\n    }\n    \n    if (_type == Type::BYTE)\n    {\n        return _baseData.byteVal == 0 ? false : true;\n    }\n    \n    if (_type == Type::STRING)\n    {\n        return (_strData == \"0\" || _strData == \"false\") ? false : true;\n    }\n    \n    if (_type == Type::INTEGER)\n    {\n        return _baseData.intVal == 0 ? false : true;\n    }\n    \n    if (_type == Type::FLOAT)\n    {\n        return _baseData.floatVal == 0.0f ? false : true;\n    }\n    \n    if (_type == Type::DOUBLE)\n    {\n        return _baseData.doubleVal == 0.0 ? false : true;\n    }\n    \n    return true;\n}\n\nstd::string Value::asString() const\n{\n    CCASSERT(_type != Type::VECTOR && _type != Type::MAP, \"\");\n    \n    if (_type == Type::STRING)\n    {\n        return _strData;\n    }\n    \n    std::stringstream ret;\n    \n    switch (_type) {\n        case Type::BYTE:\n            ret << _baseData.byteVal;\n            break;\n        case Type::INTEGER:\n            ret << _baseData.intVal;\n            break;\n        case Type::FLOAT:\n            ret << _baseData.floatVal;\n            break;\n        case Type::DOUBLE:\n            ret << _baseData.doubleVal;\n            break;\n        case Type::BOOLEAN:\n            ret << (_baseData.boolVal ? \"true\" : \"false\");\n            break;\n        default:\n            break;\n    }\n    return ret.str();\n}\n\nValueVector& Value::asValueVector()\n{\n\tif (nullptr == _vectorData)\n\t\t_vectorData = new ValueVector();\n\treturn *_vectorData;\n}\n\nconst ValueVector& Value::asValueVector() const\n{\n\tstatic const ValueVector EMPTY_VALUEVECTOR;\n\tif (nullptr == _vectorData)\n\t\treturn EMPTY_VALUEVECTOR;\n\treturn *_vectorData; \n}\n\nValueMap& Value::asValueMap()\n{\n\tif (nullptr == _mapData)\n\t\t_mapData = new ValueMap();\n\treturn *_mapData;\n}\n\nconst ValueMap& Value::asValueMap() const\n{\n\tstatic const ValueMap EMPTY_VALUEMAP;\n\tif (nullptr == _mapData)\n\t\treturn EMPTY_VALUEMAP;\n\treturn *_mapData;\n}\n\nValueMapIntKey& Value::asIntKeyMap()\n{\n\tif (nullptr == _intKeyMapData)\n\t\t_intKeyMapData = new ValueMapIntKey();\n\treturn *_intKeyMapData;\n}\n\nconst ValueMapIntKey& Value::asIntKeyMap() const\n{\n\tstatic const ValueMapIntKey EMPTY_VALUEMAP_INT_KEY;\n\tif (nullptr == _intKeyMapData)\n\t\treturn EMPTY_VALUEMAP_INT_KEY;\n\treturn *_intKeyMapData;\n}\n\nstatic std::string getTabs(int depth)\n{\n    std::string tabWidth;\n    \n    for (int i = 0; i < depth; ++i)\n    {\n        tabWidth += \"\\t\";\n    }\n    \n    return tabWidth;\n}\n\nstatic std::string visit(const Value& v, int depth);\n\nstatic std::string visitVector(const ValueVector& v, int depth)\n{\n    std::stringstream ret;\n    \n    if (depth > 0)\n        ret << \"\\n\";\n    \n    ret << getTabs(depth) << \"[\\n\";\n    \n    int i = 0;\n    for (const auto& child : v)\n    {\n        ret << getTabs(depth+1) << i << \": \" << visit(child, depth + 1);\n        ++i;\n    }\n    \n    ret << getTabs(depth) << \"]\\n\";\n    \n    return ret.str();\n}\n\ntemplate <class T>\nstatic std::string visitMap(const T& v, int depth)\n{\n    std::stringstream ret;\n    \n    if (depth > 0)\n        ret << \"\\n\";\n    \n    ret << getTabs(depth) << \"{\\n\";\n    \n    for (auto iter = v.begin(); iter != v.end(); ++iter)\n    {\n        ret << getTabs(depth + 1) << iter->first << \": \";\n        ret << visit(iter->second, depth + 1);\n    }\n    \n    ret << getTabs(depth) << \"}\\n\";\n    \n    return ret.str();\n}\n\nstatic std::string visit(const Value& v, int depth)\n{\n    std::stringstream ret;\n\n    switch (v.getType())\n    {\n        case Value::Type::NONE:\n        case Value::Type::BYTE:\n        case Value::Type::INTEGER:\n        case Value::Type::FLOAT:\n        case Value::Type::DOUBLE:\n        case Value::Type::BOOLEAN:\n        case Value::Type::STRING:\n            ret << v.asString() << \"\\n\";\n            break;\n        case Value::Type::VECTOR:\n            ret << visitVector(v.asValueVector(), depth);\n            break;\n        case Value::Type::MAP:\n            ret << visitMap(v.asValueMap(), depth);\n            break;\n        case Value::Type::INT_KEY_MAP:\n            ret << visitMap(v.asIntKeyMap(), depth);\n            break;\n        default:\n            CCASSERT(false, \"Invalid type!\");\n            break;\n    }\n    \n    return ret.str();\n}\n\nstd::string Value::getDescription()\n{\n    std::string ret(\"\\n\");\n    ret += visit(*this, 0);\n    return ret;\n}\n\nvoid Value::clear()\n{\n    _type = Type::NONE;\n    _baseData.doubleVal = 0.0;\n    _strData.clear();\n    CC_SAFE_DELETE(_vectorData);\n    CC_SAFE_DELETE(_mapData);\n    CC_SAFE_DELETE(_intKeyMapData);\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/base/CCValue.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __cocos2d_libs__CCValue__\n#define __cocos2d_libs__CCValue__\n\n#include \"CCPlatformMacros.h\"\n#include \"ccMacros.h\"\n#include <string>\n#include <vector>\n#include <unordered_map>\n\nNS_CC_BEGIN\n\nclass Value;\n\ntypedef std::vector<Value> ValueVector;\ntypedef std::unordered_map<std::string, Value> ValueMap;\ntypedef std::unordered_map<int, Value> ValueMapIntKey;\n\nclass Value\n{\npublic:\n    static const Value Null;\n    \n    Value();\n    explicit Value(unsigned char v);\n    explicit Value(int v);\n    explicit Value(float v);\n    explicit Value(double v);\n    explicit Value(bool v);\n    explicit Value(const char* v);\n    explicit Value(const std::string& v);\n    \n    explicit Value(const ValueVector& v);\n    explicit Value(ValueVector&& v);\n    \n    explicit Value(const ValueMap& v);\n\texplicit Value(ValueMap&& v);\n    \n    explicit Value(const ValueMapIntKey& v);\n    explicit Value(ValueMapIntKey&& v);\n    \n    Value(const Value& other);\n    Value(Value&& other);\n    ~Value();\n    \n    // assignment operator\n    Value& operator= (const Value& other);\n    Value& operator= (Value&& other);\n    \n    Value& operator= (unsigned char v);\n    Value& operator= (int v);\n    Value& operator= (float v);\n    Value& operator= (double v);\n    Value& operator= (bool v);\n    Value& operator= (const char* v);\n    Value& operator= (const std::string& v);\n    \n    Value& operator= (const ValueVector& v);\n    Value& operator= (ValueVector&& v);\n    \n    Value& operator= (const ValueMap& v);\n\tValue& operator= (ValueMap&& v);\n    \n    Value& operator= (const ValueMapIntKey& v);\n    Value& operator= (ValueMapIntKey&& v);\n    \n    unsigned char asByte() const;\n    int asInt() const;\n    float asFloat() const;\n    double asDouble() const;\n    bool asBool() const;\n    std::string asString() const;\n    \n    ValueVector& asValueVector();\n    const ValueVector& asValueVector() const;\n    \n    ValueMap& asValueMap();\n    const ValueMap& asValueMap() const;\n    \n    ValueMapIntKey& asIntKeyMap();\n    const ValueMapIntKey& asIntKeyMap() const;\n\n    inline bool isNull() const { return _type == Type::NONE; }\n    \n    enum class Type\n    {\n        NONE,\n        BYTE,\n        INTEGER,\n        FLOAT,\n        DOUBLE,\n        BOOLEAN,\n        STRING,\n        VECTOR,\n        MAP,\n        INT_KEY_MAP\n    };\n\n    inline Type getType() const { return _type; };\n    \n    std::string getDescription();\n    \nprivate:\n    void clear();\n    \n    union\n    {\n        unsigned char byteVal;\n        int intVal;\n        float floatVal;\n        double doubleVal;\n        bool boolVal;\n    }_baseData;\n    \n    std::string _strData;\n    ValueVector* _vectorData;\n    ValueMap* _mapData;\n    ValueMapIntKey* _intKeyMapData;\n\n    Type _type;\n};\n\nNS_CC_END\n\n\n#endif /* defined(__cocos2d_libs__CCValue__) */\n"
  },
  {
    "path": "cocos2d/cocos/base/CCVector.h",
    "content": "/****************************************************************************\nCopyright (c) 2010 ForzeField Studios S.L. http://forzefield.com\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCVECTOR_H__\n#define __CCVECTOR_H__\n\n#include \"ccMacros.h\"\n#include \"CCObject.h\"\n#include <vector>\n#include <functional>\n#include <algorithm> // for std::find\n\nNS_CC_BEGIN\n\ntemplate<class T>\nclass CC_DLL Vector\n{\npublic:\n    // ------------------------------------------\n    // Iterators\n    // ------------------------------------------\n    typedef typename std::vector<T>::iterator iterator;\n    typedef typename std::vector<T>::const_iterator const_iterator;\n    \n    typedef typename std::vector<T>::reverse_iterator reverse_iterator;\n    typedef typename std::vector<T>::const_reverse_iterator const_reverse_iterator;\n    \n    iterator begin() { return _data.begin(); }\n    const_iterator begin() const { return _data.begin(); }\n    \n    iterator end() { return _data.end(); }\n    const_iterator end() const { return _data.end(); }\n    \n    const_iterator cbegin() const { return _data.cbegin(); }\n    const_iterator cend() const { return _data.cend(); }\n    \n    reverse_iterator rbegin() { return _data.rbegin(); }\n    const_reverse_iterator rbegin() const { return _data.rbegin(); }\n    \n    reverse_iterator rend() { return _data.rend(); }\n    const_reverse_iterator rend() const { return _data.rend(); }\n    \n    const_reverse_iterator crbegin() const { return _data.crbegin(); }\n    const_reverse_iterator crend() const { return _data.crend(); }\n    \n    /** Constructor */\n    Vector<T>()\n    : _data()\n    {\n        static_assert(std::is_convertible<T, Object*>::value, \"Invalid Type for cocos2d::Vector<T>!\");\n    }\n    \n    /** Constructor with a capacity */\n    explicit Vector<T>(ssize_t capacity)\n    : _data()\n    {\n        static_assert(std::is_convertible<T, Object*>::value, \"Invalid Type for cocos2d::Vector<T>!\");\n        CCLOGINFO(\"In the default constructor with capacity of Vector.\");\n        reserve(capacity);\n    }\n\n    /** Destructor */\n    ~Vector<T>()\n    {\n        CCLOGINFO(\"In the destructor of Vector.\");\n        clear();\n    }\n\n    /** Copy constructor */\n    Vector<T>(const Vector<T>& other)\n    {\n        static_assert(std::is_convertible<T, Object*>::value, \"Invalid Type for cocos2d::Vector<T>!\");\n        CCLOGINFO(\"In the copy constructor!\");\n        _data = other._data;\n        addRefForAllObjects();\n    }\n    \n    /** Move constructor */\n    Vector<T>(Vector<T>&& other)\n    {\n        static_assert(std::is_convertible<T, Object*>::value, \"Invalid Type for cocos2d::Vector<T>!\");\n        CCLOGINFO(\"In the move constructor of Vector!\");\n        _data = std::move(other._data);\n    }\n    \n    /** Copy assignment operator */\n    Vector<T>& operator=(const Vector<T>& other)\n    {\n        if (this != &other) {\n            CCLOGINFO(\"In the copy assignment operator!\");\n            clear();\n            _data = other._data;\n            addRefForAllObjects();\n        }\n        return *this;\n    }\n    \n    /** Move assignment operator */\n    Vector<T>& operator=(Vector<T>&& other)\n    {\n        if (this != &other) {\n            CCLOGINFO(\"In the move assignment operator!\");\n            clear();\n            _data = std::move(other._data);\n        }\n        return *this;\n    }\n    \n// Don't uses operator since we could not decide whether it needs 'retain'/'release'.\n//    T& operator[](int index)\n//    {\n//        return _data[index];\n//    }\n//    \n//    const T& operator[](int index) const\n//    {\n//        return _data[index];\n//    }\n    \n    /** @brief Request a change in capacity \n     *  @param capacity Minimum capacity for the vector.\n     *         If n is greater than the current vector capacity, \n     *         the function causes the container to reallocate its storage increasing its capacity to n (or greater).\n     */\n    void reserve(ssize_t n)\n    {\n        _data.reserve(n);\n    }\n    \n    /** @brief Returns the size of the storage space currently allocated for the vector, expressed in terms of elements.\n     *  @note This capacity is not necessarily equal to the vector size. \n     *        It can be equal or greater, with the extra space allowing to accommodate for growth without the need to reallocate on each insertion.\n     *  @return The size of the currently allocated storage capacity in the vector, measured in terms of the number elements it can hold.\n     */\n    ssize_t capacity() const\n    {\n        return _data.capacity();\n    }\n    \n    /** @brief Returns the number of elements in the vector.\n     *  @note This is the number of actual objects held in the vector, which is not necessarily equal to its storage capacity.\n     *  @return The number of elements in the container.\n     */\n    ssize_t size() const\n    {\n        return  _data.size();\n    }\n    \n    /** @brief Returns whether the vector is empty (i.e. whether its size is 0).\n     *  @note This function does not modify the container in any way. To clear the content of a vector, see Vector<T>::clear.\n     */\n    bool empty() const\n    {\n        return _data.empty();\n    }\n    \n    /** Returns the maximum number of elements that the vector can hold. */\n    ssize_t max_size() const\n    {\n        return _data.max_size();\n    }\n    \n    /** Returns index of a certain object, return UINT_MAX if doesn't contain the object */\n    ssize_t getIndex(T object) const\n    {\n        auto iter = std::find(_data.begin(), _data.end(), object);\n        if (iter != _data.end())\n            return iter - _data.begin();\n\n        return -1;\n    }\n\n    /** @brief Find the object in the vector.\n     *  @return Returns an iterator to the first element in the range [first,last) that compares equal to val. \n     *          If no such element is found, the function returns last.\n     */\n    const_iterator find(T object) const\n    {\n        return std::find(_data.begin(), _data.end(), object);\n    }\n    \n    iterator find(T object)\n    {\n        return std::find(_data.begin(), _data.end(), object);\n    }\n    \n    /** Returns the element at position 'index' in the vector. */\n    T at(ssize_t index) const\n    {\n        CCASSERT( index >= 0 && index < size(), \"index out of range in getObjectAtIndex()\");\n        return _data[index];\n    }\n\n    /** Returns the first element in the vector. */\n    T front() const\n    {\n        return _data.front();\n    }\n    \n    /** Returns the last element of the vector. */\n    T back() const\n    {\n        return _data.back();\n    }\n\n    /** Returns a random element of the vector. */\n    T getRandomObject() const\n    {\n        if (!_data.empty())\n        {\n            ssize_t randIdx = rand() % _data.size();\n            return *(_data.begin() + randIdx);\n        }\n        return nullptr;\n    }\n\n    /** Returns a Boolean value that indicates whether object is present in vector. */\n    bool contains(T object) const\n    {\n        return( std::find(_data.begin(), _data.end(), object) != _data.end() );\n    }\n\n    /** Returns true if the two vectors are equal */\n    bool equals(const Vector<T> &other)\n    {\n        ssize_t s = this->size();\n        if (s != other.size())\n            return false;\n        \n        for (ssize_t i = 0; i < s; i++)\n        {\n            if (!this->at(i)->isEqual(other.at(i)))\n            {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    // Adds objects\n    \n    /** @brief Adds a new element at the end of the vector, after its current last element.\n     *  @note This effectively increases the container size by one,\n     *        which causes an automatic reallocation of the allocated storage space \n     *        if -and only if- the new vector size surpasses the current vector capacity.\n     */\n    void pushBack(T object)\n    {\n        CCASSERT(object != nullptr, \"The object should not be nullptr\");\n        _data.push_back( object );\n        object->retain();\n    }\n    \n    /** Push all elements of an existing vector to the end of current vector. */\n    void pushBack(const Vector<T>& other)\n    {\n        for(const auto &obj : other) {\n            _data.push_back(obj);\n            obj->retain();\n        }\n    }\n\n    /** @brief Insert a certain object at a certain index \n     *  @note The vector is extended by inserting new elements before the element at the specified 'index',\n     *        effectively increasing the container size by the number of elements inserted.\n     *        This causes an automatic reallocation of the allocated storage space \n     *        if -and only if- the new vector size surpasses the current vector capacity.\n     */\n    void insert(ssize_t index, T object)\n    {\n        CCASSERT(index >= 0 && index <= size(), \"Invalid index!\");\n        CCASSERT(object != nullptr, \"The object should not be nullptr\");\n        _data.insert((std::begin(_data) + index), object);\n        object->retain();\n    }\n    \n    // Removes Objects\n\n    /** Removes the last element in the vector, \n     *  effectively reducing the container size by one, decrease the referece count of the deleted object.\n     */\n    void popBack()\n    {\n        CCASSERT(!_data.empty(), \"no objects added\");\n        auto last = _data.back();\n        _data.pop_back();\n        last->release();\n    }\n    \n    /** @brief Remove a certain object.\n     *  @param object The object to be removed.\n     *  @param toRelease Whether to decrease the referece count of the deleted object.\n     */\n    void eraseObject(T object, bool toRelease = true)\n    {\n        CCASSERT(object != nullptr, \"The object should not be nullptr\");\n        auto iter = std::find(_data.begin(), _data.end(), object);\n        if (iter != _data.end())\n            _data.erase(iter);\n        if (toRelease)\n            object->release();\n    }\n\n    /** @brief Removes from the vector with an iterator. \n     *  @param position Iterator pointing to a single element to be removed from the vector.\n     *  @return An iterator pointing to the new location of the element that followed the last element erased by the function call.\n     *          This is the container end if the operation erased the last element in the sequence.\n     */\n    iterator erase(iterator position)\n    {\n        CCASSERT(position >= _data.begin() && position < _data.end(), \"Invalid position!\");\n        (*position)->release();\n        return _data.erase(position);\n    }\n    \n    /** @brief Removes from the vector with a range of elements (  [first, last)  ).\n     *  @param first The beginning of the range\n     *  @param last The end of the range, the 'last' will not used, it's only for indicating the end of range.\n     *  @return An iterator pointing to the new location of the element that followed the last element erased by the function call.\n     *          This is the container end if the operation erased the last element in the sequence.\n     */\n    iterator erase(iterator first, iterator last)\n    {\n        for (auto iter = first; iter != last; ++iter)\n        {\n            (*iter)->release();\n        }\n        \n        return _data.erase(first, last);\n    }\n    \n    /** @brief Removes from the vector with an index.\n     *  @param index The index of the element to be removed from the vector.\n     *  @return An iterator pointing to the new location of the element that followed the last element erased by the function call.\n     *          This is the container end if the operation erased the last element in the sequence.\n     */\n    iterator erase(ssize_t index)\n    {\n        CCASSERT(!_data.empty() && index >=0 && index < size(), \"Invalid index!\");\n        auto it = std::next( begin(), index );\n        (*it)->release();\n        return _data.erase(it);\n    }\n\n    /** @brief Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.\n     *  @note All the elements in the vector will be released (referece count will be decreased).\n     */\n    void clear()\n    {\n        for( auto it = std::begin(_data); it != std::end(_data); ++it ) {\n            (*it)->release();\n        }\n        _data.clear();\n    }\n\n    // Rearranging Content\n\n    /** Swap two elements */\n    void swap(T object1, T object2)\n    {\n        ssize_t idx1 = getIndex(object1);\n        ssize_t idx2 = getIndex(object2);\n\n        CCASSERT(idx1>=0 && idx2>=0, \"invalid object index\");\n\n        std::swap( _data[idx1], _data[idx2] );\n    }\n    \n    /** Swap two elements with certain indexes */\n    void swap(ssize_t index1, ssize_t index2)\n    {\n        CCASSERT(index1 >=0 && index1 < size() && index2 >= 0 && index2 < size(), \"Invalid indices\");\n\n        std::swap( _data[index1], _data[index2] );\n    }\n\n    /** Replace object at index with another object. */\n    void replace(ssize_t index, T object)\n    {\n        CCASSERT(index >= 0 && index < size(), \"Invalid index!\");\n        CCASSERT(object != nullptr, \"The object should not be nullptr\");\n        \n        _data[index]->release();\n        _data[index] = object;\n        object->retain();\n    }\n\n    /** reverses the vector */\n    void reverse()\n    {\n        std::reverse( std::begin(_data), std::end(_data) );\n    }\n    \n    /** Shrinks the vector so the memory footprint corresponds with the number of items */\n    void shrinkToFit()\n    {\n        _data.shrink_to_fit();\n    }\n    \nprotected:\n    \n    /** Retains all the objects in the vector */\n    void addRefForAllObjects()\n    {\n        for(const auto &obj : _data) {\n            obj->retain();\n        }\n    }\n    \n    std::vector<T> _data;\n};\n\n// end of data_structure group\n/// @}\n\nNS_CC_END\n\n#endif // __CCVECTOR_H__\n"
  },
  {
    "path": "cocos2d/cocos/base/CMakeLists.txt",
    "content": "set(COCOS_BASE_SRC\n  CCAffineTransform.cpp\n  CCAutoreleasePool.cpp\n  CCGeometry.cpp\n  CCNS.cpp\n  CCObject.cpp\n  CCSet.cpp\n  CCArray.cpp\n  CCDictionary.cpp\n  CCString.cpp\n  CCDataVisitor.cpp\n  CCData.cpp\n  CCValue.cpp\n  etc1.cpp\n  s3tc.cpp\n  atitc.cpp\n  CCConsole.cpp\n)\n\nadd_library(cocosbase STATIC\n  ${COCOS_BASE_SRC}\n)\n\nif(WIN32)\ntarget_link_libraries(cocosbase\n  Ws2_32\n)\nendif()\n\nset_target_properties(cocosbase\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/cocos/base/atitc.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"atitc.h\"\n\n//Decode ATITC encode block to 4x4 RGB32 pixels\nstatic void atitc_decode_block(uint8_t **blockData,\n                              uint32_t *decodeBlockData,\n                              unsigned int stride,\n                              bool oneBitAlphaFlag,\n                              uint64_t alpha,\n                              ATITCDecodeFlag decodeFlag)\n{\n    unsigned int colorValue0 = 0 , colorValue1 = 0, initAlpha = (!oneBitAlphaFlag * 255u) << 24;\n    unsigned int rb0 = 0, rb1 = 0, rb2 = 0, rb3 = 0, g0 = 0, g1 = 0, g2 = 0, g3 = 0;\n    bool msb = 0;\n    \n    uint32_t colors[4], pixelsIndex = 0;\n    \n    /* load the two color values*/\n    memcpy((void *)&colorValue0, *blockData, 2);\n    (*blockData) += 2;\n    \n    memcpy((void *)&colorValue1, *blockData, 2);\n    (*blockData) += 2;\n    \n    //extract the msb flag\n    msb = (colorValue0 & 0x8000) != 0;\n    \n    /* the channel is r5g6b5 , 16 bits */\n    rb0  = (colorValue0 << 3 | colorValue0 << 9) & 0xf800f8;\n    rb1  = (colorValue1 << 3 | colorValue1 << 8) & 0xf800f8;\n    g0   = (colorValue0 << 6) & 0x00fc00;\n    g1   = (colorValue1 << 5) & 0x00fc00;\n    g0  += (g0 >> 6) & 0x000300;\n    g1  += (g1 >> 6) & 0x000300;\n    \n    /* interpolate the other two color values */\n    if (!msb)\n    {\n        colors[0] = rb0 + g0 + initAlpha;\n        colors[3] = rb1 + g1 + initAlpha;\n        \n        rb2 = (((2*rb0 + rb1) * 21) >> 6) & 0xff00ff;\n        rb3 = (((2*rb1 + rb0) * 21) >> 6) & 0xff00ff;\n        g2  = (((2*g0 + g1 ) * 21) >> 6) & 0x00ff00;\n        g3  = (((2*g1 + g0 ) * 21) >> 6) & 0x00ff00;\n        \n        colors[2] = rb3 + g3 + initAlpha;\n        colors[1] = rb2 + g2 + initAlpha;\n    }\n    else\n    {\n        colors[2] = rb0 + g0 + initAlpha;\n        colors[3] = rb1 + g1 + initAlpha;\n        \n        rb2 = (rb0 - (rb1 >> 2)) & 0xff00ff;\n        g2  = (g0 - (g1 >> 2)) & 0x00ff00;\n        colors[0] = 0 ;\n        \n         colors[1] = rb2 + g2 + initAlpha;\n    }\n   \n    /*read the pixelsIndex , 2bits per pixel, 4 bytes */\n    memcpy((void*)&pixelsIndex, *blockData, 4);\n    (*blockData) += 4;\n    \n    if (ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA == decodeFlag)\n    {\n        // atitc_interpolated_alpha use interpolate alpha\n        // 8-Alpha block: derive the other six alphas.\n        // Bit code 000 = alpha0, 001 = alpha1, other are interpolated.\n        \n        unsigned int alphaArray[8];\n        \n        alphaArray[0] = (alpha ) & 0xff ;\n        alphaArray[1] = (alpha >> 8) & 0xff ;\n        \n        if (alphaArray[0] >= alphaArray[1])\n        {\n            alphaArray[2] = (alphaArray[0]*6 + alphaArray[1]*1) / 7;\n            alphaArray[3] = (alphaArray[0]*5 + alphaArray[1]*2) / 7;\n            alphaArray[4] = (alphaArray[0]*4 + alphaArray[1]*3) / 7;\n            alphaArray[5] = (alphaArray[0]*3 + alphaArray[1]*4) / 7;\n            alphaArray[6] = (alphaArray[0]*2 + alphaArray[1]*5) / 7;\n            alphaArray[7] = (alphaArray[0]*1 + alphaArray[1]*6) / 7;\n        }\n        else if (alphaArray[0] < alphaArray[1])\n        {\n            alphaArray[2] = (alphaArray[0]*4 + alphaArray[1]*1) / 5;\n            alphaArray[3] = (alphaArray[0]*3 + alphaArray[1]*2) / 5;\n            alphaArray[4] = (alphaArray[0]*2 + alphaArray[1]*3) / 5;\n            alphaArray[5] = (alphaArray[0]*1 + alphaArray[1]*4) / 5;\n            alphaArray[6] = 0;\n            alphaArray[7] = 255;\n        }\n        \n        // read the flowing 48bit indices (16*3)\n        alpha >>= 16;\n        \n        for (int y = 0; y < 4; ++y)\n        {\n            for (int x = 0; x < 4; ++x)\n            {\n                decodeBlockData[x] = (alphaArray[alpha & 5] << 24) + colors[pixelsIndex & 3];\n                pixelsIndex >>= 2;\n                alpha >>= 3;\n            }\n            decodeBlockData += stride;\n        }\n    } //if (atc_interpolated_alpha == comFlag)\n    else\n    {\n        /* atc_rgb atc_explicit_alpha use explicit alpha */\n        \n        for (int y = 0; y < 4; ++y)\n        {\n            for (int x = 0; x < 4; ++x)\n           {\n                initAlpha   = (static_cast<int>(alpha) & 0x0f) << 28;\n                initAlpha   += initAlpha >> 4;\n                decodeBlockData[x] = initAlpha + colors[pixelsIndex & 3];\n                pixelsIndex >>= 2;\n                alpha       >>= 4;\n            }\n            decodeBlockData += stride;\n        }\n    }\n}\n\n//Decode ATITC encode data to RGB32\nvoid atitc_decode(uint8_t *encodeData,             //in_data\n                 uint8_t *decodeData,              //out_data\n                 const int pixelsWidth,\n                 const int pixelsHeight,\n                 ATITCDecodeFlag decodeFlag)\n{\n    uint32_t *decodeBlockData = (uint32_t *)decodeData;\n    \n    for (int block_y = 0; block_y < pixelsHeight / 4; ++block_y, decodeBlockData += 3 * pixelsWidth)   //stride = 3*width\n    {\n        for (int block_x = 0; block_x < pixelsWidth / 4; ++block_x, decodeBlockData += 4)            //skip 4 pixels\n        {\n            uint64_t blockAlpha = 0;\n            \n            switch (decodeFlag)\n            {\n                case ATITCDecodeFlag::ATC_RGB:\n                {\n                    atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 0, 0LL, ATITCDecodeFlag::ATC_RGB);\n                }\n                    break;\n                case ATITCDecodeFlag::ATC_EXPLICIT_ALPHA:\n                {\n                    memcpy((void *)&blockAlpha, encodeData, 8);\n                    encodeData += 8;\n                    atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, ATITCDecodeFlag::ATC_EXPLICIT_ALPHA);\n                }\n                    break;\n                case ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA:\n                {\n                    memcpy((void *)&blockAlpha, encodeData, 8);\n                    encodeData += 8;\n                    atitc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, ATITCDecodeFlag::ATC_INTERPOLATED_ALPHA);\n                }\n                    break;\n                default:\n                    break;\n            }//switch\n        }//for block_x\n    }//for block_y\n}\n\n\n"
  },
  {
    "path": "cocos2d/cocos/base/atitc.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef COCOS2DX_PLATFORM_THIRDPARTY_ATITC_\n#define COCOS2DX_PLATFORM_THIRDPARTY_ATITC_\n\n#include \"CCStdC.h\"\n\nenum class ATITCDecodeFlag\n{\n    ATC_RGB = 1,\n    ATC_EXPLICIT_ALPHA = 3,\n    ATC_INTERPOLATED_ALPHA = 5,\n};\n\n//Decode ATITC encode data to RGB32\nvoid atitc_decode(uint8_t *encode_data,\n                  uint8_t *decode_data,\n                  const int pixelsWidth,\n                  const int pixelsHeight,\n                  ATITCDecodeFlag decodeFlag\n                  );\n\n\n#endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_ATITC_) */\n\n"
  },
  {
    "path": "cocos2d/cocos/base/etc1.cpp",
    "content": "// Copyright 2009 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"etc1.h\"\n\n#include <string.h>\n\n/* From http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt\n\n The number of bits that represent a 4x4 texel block is 64 bits if\n <internalformat> is given by ETC1_RGB8_OES.\n\n The data for a block is a number of bytes,\n\n {q0, q1, q2, q3, q4, q5, q6, q7}\n\n where byte q0 is located at the lowest memory address and q7 at\n the highest. The 64 bits specifying the block is then represented\n by the following 64 bit integer:\n\n int64bit = 256*(256*(256*(256*(256*(256*(256*q0+q1)+q2)+q3)+q4)+q5)+q6)+q7;\n\n ETC1_RGB8_OES:\n\n a) bit layout in bits 63 through 32 if diffbit = 0\n\n 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48\n -----------------------------------------------\n | base col1 | base col2 | base col1 | base col2 |\n | R1 (4bits)| R2 (4bits)| G1 (4bits)| G2 (4bits)|\n -----------------------------------------------\n\n 47 46 45 44 43 42 41 40 39 38 37 36 35 34  33  32\n ---------------------------------------------------\n | base col1 | base col2 | table  | table  |diff|flip|\n | B1 (4bits)| B2 (4bits)| cw 1   | cw 2   |bit |bit |\n ---------------------------------------------------\n\n\n b) bit layout in bits 63 through 32 if diffbit = 1\n\n 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48\n -----------------------------------------------\n | base col1    | dcol 2 | base col1    | dcol 2 |\n | R1' (5 bits) | dR2    | G1' (5 bits) | dG2    |\n -----------------------------------------------\n\n 47 46 45 44 43 42 41 40 39 38 37 36 35 34  33  32\n ---------------------------------------------------\n | base col 1   | dcol 2 | table  | table  |diff|flip|\n | B1' (5 bits) | dB2    | cw 1   | cw 2   |bit |bit |\n ---------------------------------------------------\n\n\n c) bit layout in bits 31 through 0 (in both cases)\n\n 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16\n -----------------------------------------------\n |       most significant pixel index bits       |\n | p| o| n| m| l| k| j| i| h| g| f| e| d| c| b| a|\n -----------------------------------------------\n\n 15 14 13 12 11 10  9  8  7  6  5  4  3   2   1  0\n --------------------------------------------------\n |         least significant pixel index bits       |\n | p| o| n| m| l| k| j| i| h| g| f| e| d| c | b | a |\n --------------------------------------------------\n\n\n Add table 3.17.2: Intensity modifier sets for ETC1 compressed textures:\n\n table codeword                modifier table\n ------------------        ----------------------\n 0                     -8  -2  2   8\n 1                    -17  -5  5  17\n 2                    -29  -9  9  29\n 3                    -42 -13 13  42\n 4                    -60 -18 18  60\n 5                    -80 -24 24  80\n 6                   -106 -33 33 106\n 7                   -183 -47 47 183\n\n\n Add table 3.17.3 Mapping from pixel index values to modifier values for\n ETC1 compressed textures:\n\n pixel index value\n ---------------\n msb     lsb           resulting modifier value\n -----   -----          -------------------------\n 1       1            -b (large negative value)\n 1       0            -a (small negative value)\n 0       0             a (small positive value)\n 0       1             b (large positive value)\n\n\n */\n\nstatic const int kModifierTable[] = {\n/* 0 */2, 8, -2, -8,\n/* 1 */5, 17, -5, -17,\n/* 2 */9, 29, -9, -29,\n/* 3 */13, 42, -13, -42,\n/* 4 */18, 60, -18, -60,\n/* 5 */24, 80, -24, -80,\n/* 6 */33, 106, -33, -106,\n/* 7 */47, 183, -47, -183 };\n\nstatic const int kLookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 };\n\nstatic inline etc1_byte clamp(int x) {\n    return (etc1_byte) (x >= 0 ? (x < 255 ? x : 255) : 0);\n}\n\nstatic\ninline int convert4To8(int b) {\n    int c = b & 0xf;\n    return (c << 4) | c;\n}\n\nstatic\ninline int convert5To8(int b) {\n    int c = b & 0x1f;\n    return (c << 3) | (c >> 2);\n}\n\nstatic\ninline int convert6To8(int b) {\n    int c = b & 0x3f;\n    return (c << 2) | (c >> 4);\n}\n\nstatic\ninline int divideBy255(int d) {\n    return (d + 128 + (d >> 8)) >> 8;\n}\n\nstatic\ninline int convert8To4(int b) {\n    int c = b & 0xff;\n    return divideBy255(c * 15);\n}\n\nstatic\ninline int convert8To5(int b) {\n    int c = b & 0xff;\n    return divideBy255(c * 31);\n}\n\nstatic\ninline int convertDiff(int base, int diff) {\n    return convert5To8((0x1f & base) + kLookup[0x7 & diff]);\n}\n\nstatic\nvoid decode_subblock(etc1_byte* pOut, int r, int g, int b, const int* table,\n        etc1_uint32 low, bool second, bool flipped) {\n    int baseX = 0;\n    int baseY = 0;\n    if (second) {\n        if (flipped) {\n            baseY = 2;\n        } else {\n            baseX = 2;\n        }\n    }\n    for (int i = 0; i < 8; i++) {\n        int x, y;\n        if (flipped) {\n            x = baseX + (i >> 1);\n            y = baseY + (i & 1);\n        } else {\n            x = baseX + (i >> 2);\n            y = baseY + (i & 3);\n        }\n        int k = y + (x * 4);\n        int offset = ((low >> k) & 1) | ((low >> (k + 15)) & 2);\n        int delta = table[offset];\n        etc1_byte* q = pOut + 3 * (x + 4 * y);\n        *q++ = clamp(r + delta);\n        *q++ = clamp(g + delta);\n        *q++ = clamp(b + delta);\n    }\n}\n\n// Input is an ETC1 compressed version of the data.\n// Output is a 4 x 4 square of 3-byte pixels in form R, G, B\n\nvoid etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut) {\n    etc1_uint32 high = (pIn[0] << 24) | (pIn[1] << 16) | (pIn[2] << 8) | pIn[3];\n    etc1_uint32 low = (pIn[4] << 24) | (pIn[5] << 16) | (pIn[6] << 8) | pIn[7];\n    int r1, r2, g1, g2, b1, b2;\n    if (high & 2) {\n        // differential\n        int rBase = high >> 27;\n        int gBase = high >> 19;\n        int bBase = high >> 11;\n        r1 = convert5To8(rBase);\n        r2 = convertDiff(rBase, high >> 24);\n        g1 = convert5To8(gBase);\n        g2 = convertDiff(gBase, high >> 16);\n        b1 = convert5To8(bBase);\n        b2 = convertDiff(bBase, high >> 8);\n    } else {\n        // not differential\n        r1 = convert4To8(high >> 28);\n        r2 = convert4To8(high >> 24);\n        g1 = convert4To8(high >> 20);\n        g2 = convert4To8(high >> 16);\n        b1 = convert4To8(high >> 12);\n        b2 = convert4To8(high >> 8);\n    }\n    int tableIndexA = 7 & (high >> 5);\n    int tableIndexB = 7 & (high >> 2);\n    const int* tableA = kModifierTable + tableIndexA * 4;\n    const int* tableB = kModifierTable + tableIndexB * 4;\n    bool flipped = (high & 1) != 0;\n    decode_subblock(pOut, r1, g1, b1, tableA, low, false, flipped);\n    decode_subblock(pOut, r2, g2, b2, tableB, low, true, flipped);\n}\n\ntypedef struct {\n    etc1_uint32 high;\n    etc1_uint32 low;\n    etc1_uint32 score; // Lower is more accurate\n} etc_compressed;\n\nstatic\ninline void take_best(etc_compressed* a, const etc_compressed* b) {\n    if (a->score > b->score) {\n        *a = *b;\n    }\n}\n\nstatic\nvoid etc_average_colors_subblock(const etc1_byte* pIn, etc1_uint32 inMask,\n        etc1_byte* pColors, bool flipped, bool second) {\n    int r = 0;\n    int g = 0;\n    int b = 0;\n\n    if (flipped) {\n        int by = 0;\n        if (second) {\n            by = 2;\n        }\n        for (int y = 0; y < 2; y++) {\n            int yy = by + y;\n            for (int x = 0; x < 4; x++) {\n                int i = x + 4 * yy;\n                if (inMask & (1 << i)) {\n                    const etc1_byte* p = pIn + i * 3;\n                    r += *(p++);\n                    g += *(p++);\n                    b += *(p++);\n                }\n            }\n        }\n    } else {\n        int bx = 0;\n        if (second) {\n            bx = 2;\n        }\n        for (int y = 0; y < 4; y++) {\n            for (int x = 0; x < 2; x++) {\n                int xx = bx + x;\n                int i = xx + 4 * y;\n                if (inMask & (1 << i)) {\n                    const etc1_byte* p = pIn + i * 3;\n                    r += *(p++);\n                    g += *(p++);\n                    b += *(p++);\n                }\n            }\n        }\n    }\n    pColors[0] = (etc1_byte)((r + 4) >> 3);\n    pColors[1] = (etc1_byte)((g + 4) >> 3);\n    pColors[2] = (etc1_byte)((b + 4) >> 3);\n}\n\nstatic\ninline int square(int x) {\n    return x * x;\n}\n\nstatic etc1_uint32 chooseModifier(const etc1_byte* pBaseColors,\n        const etc1_byte* pIn, etc1_uint32 *pLow, int bitIndex,\n        const int* pModifierTable) {\n    etc1_uint32 bestScore = ~0;\n    int bestIndex = 0;\n    int pixelR = pIn[0];\n    int pixelG = pIn[1];\n    int pixelB = pIn[2];\n    int r = pBaseColors[0];\n    int g = pBaseColors[1];\n    int b = pBaseColors[2];\n    for (int i = 0; i < 4; i++) {\n        int modifier = pModifierTable[i];\n        int decodedG = clamp(g + modifier);\n        etc1_uint32 score = (etc1_uint32) (6 * square(decodedG - pixelG));\n        if (score >= bestScore) {\n            continue;\n        }\n        int decodedR = clamp(r + modifier);\n        score += (etc1_uint32) (3 * square(decodedR - pixelR));\n        if (score >= bestScore) {\n            continue;\n        }\n        int decodedB = clamp(b + modifier);\n        score += (etc1_uint32) square(decodedB - pixelB);\n        if (score < bestScore) {\n            bestScore = score;\n            bestIndex = i;\n        }\n    }\n    etc1_uint32 lowMask = (((bestIndex >> 1) << 16) | (bestIndex & 1))\n            << bitIndex;\n    *pLow |= lowMask;\n    return bestScore;\n}\n\nstatic\nvoid etc_encode_subblock_helper(const etc1_byte* pIn, etc1_uint32 inMask,\n        etc_compressed* pCompressed, bool flipped, bool second,\n        const etc1_byte* pBaseColors, const int* pModifierTable) {\n    int score = pCompressed->score;\n    if (flipped) {\n        int by = 0;\n        if (second) {\n            by = 2;\n        }\n        for (int y = 0; y < 2; y++) {\n            int yy = by + y;\n            for (int x = 0; x < 4; x++) {\n                int i = x + 4 * yy;\n                if (inMask & (1 << i)) {\n                    score += chooseModifier(pBaseColors, pIn + i * 3,\n                            &pCompressed->low, yy + x * 4, pModifierTable);\n                }\n            }\n        }\n    } else {\n        int bx = 0;\n        if (second) {\n            bx = 2;\n        }\n        for (int y = 0; y < 4; y++) {\n            for (int x = 0; x < 2; x++) {\n                int xx = bx + x;\n                int i = xx + 4 * y;\n                if (inMask & (1 << i)) {\n                    score += chooseModifier(pBaseColors, pIn + i * 3,\n                            &pCompressed->low, y + xx * 4, pModifierTable);\n                }\n            }\n        }\n    }\n    pCompressed->score = score;\n}\n\nstatic bool inRange4bitSigned(int color) {\n    return color >= -4 && color <= 3;\n}\n\nstatic void etc_encodeBaseColors(etc1_byte* pBaseColors,\n        const etc1_byte* pColors, etc_compressed* pCompressed) {\n    int r1, g1, b1, r2, g2, b2; // 8 bit base colors for sub-blocks\n    bool differential;\n    {\n        int r51 = convert8To5(pColors[0]);\n        int g51 = convert8To5(pColors[1]);\n        int b51 = convert8To5(pColors[2]);\n        int r52 = convert8To5(pColors[3]);\n        int g52 = convert8To5(pColors[4]);\n        int b52 = convert8To5(pColors[5]);\n\n        r1 = convert5To8(r51);\n        g1 = convert5To8(g51);\n        b1 = convert5To8(b51);\n\n        int dr = r52 - r51;\n        int dg = g52 - g51;\n        int db = b52 - b51;\n\n        differential = inRange4bitSigned(dr) && inRange4bitSigned(dg)\n                && inRange4bitSigned(db);\n        if (differential) {\n            r2 = convert5To8(r51 + dr);\n            g2 = convert5To8(g51 + dg);\n            b2 = convert5To8(b51 + db);\n            pCompressed->high |= (r51 << 27) | ((7 & dr) << 24) | (g51 << 19)\n                    | ((7 & dg) << 16) | (b51 << 11) | ((7 & db) << 8) | 2;\n        }\n    }\n\n    if (!differential) {\n        int r41 = convert8To4(pColors[0]);\n        int g41 = convert8To4(pColors[1]);\n        int b41 = convert8To4(pColors[2]);\n        int r42 = convert8To4(pColors[3]);\n        int g42 = convert8To4(pColors[4]);\n        int b42 = convert8To4(pColors[5]);\n        r1 = convert4To8(r41);\n        g1 = convert4To8(g41);\n        b1 = convert4To8(b41);\n        r2 = convert4To8(r42);\n        g2 = convert4To8(g42);\n        b2 = convert4To8(b42);\n        pCompressed->high |= (r41 << 28) | (r42 << 24) | (g41 << 20) | (g42\n                << 16) | (b41 << 12) | (b42 << 8);\n    }\n    pBaseColors[0] = r1;\n    pBaseColors[1] = g1;\n    pBaseColors[2] = b1;\n    pBaseColors[3] = r2;\n    pBaseColors[4] = g2;\n    pBaseColors[5] = b2;\n}\n\nstatic\nvoid etc_encode_block_helper(const etc1_byte* pIn, etc1_uint32 inMask,\n        const etc1_byte* pColors, etc_compressed* pCompressed, bool flipped) {\n    pCompressed->score = ~0;\n    pCompressed->high = (flipped ? 1 : 0);\n    pCompressed->low = 0;\n\n    etc1_byte pBaseColors[6];\n\n    etc_encodeBaseColors(pBaseColors, pColors, pCompressed);\n\n    int originalHigh = pCompressed->high;\n\n    const int* pModifierTable = kModifierTable;\n    for (int i = 0; i < 8; i++, pModifierTable += 4) {\n        etc_compressed temp;\n        temp.score = 0;\n        temp.high = originalHigh | (i << 5);\n        temp.low = 0;\n        etc_encode_subblock_helper(pIn, inMask, &temp, flipped, false,\n                pBaseColors, pModifierTable);\n        take_best(pCompressed, &temp);\n    }\n    pModifierTable = kModifierTable;\n    etc_compressed firstHalf = *pCompressed;\n    for (int i = 0; i < 8; i++, pModifierTable += 4) {\n        etc_compressed temp;\n        temp.score = firstHalf.score;\n        temp.high = firstHalf.high | (i << 2);\n        temp.low = firstHalf.low;\n        etc_encode_subblock_helper(pIn, inMask, &temp, flipped, true,\n                pBaseColors + 3, pModifierTable);\n        if (i == 0) {\n            *pCompressed = temp;\n        } else {\n            take_best(pCompressed, &temp);\n        }\n    }\n}\n\nstatic void writeBigEndian(etc1_byte* pOut, etc1_uint32 d) {\n    pOut[0] = (etc1_byte)(d >> 24);\n    pOut[1] = (etc1_byte)(d >> 16);\n    pOut[2] = (etc1_byte)(d >> 8);\n    pOut[3] = (etc1_byte) d;\n}\n\n// Input is a 4 x 4 square of 3-byte pixels in form R, G, B\n// inmask is a 16-bit mask where bit (1 << (x + y * 4)) tells whether the corresponding (x,y)\n// pixel is valid or not. Invalid pixel color values are ignored when compressing.\n// Output is an ETC1 compressed version of the data.\n\nvoid etc1_encode_block(const etc1_byte* pIn, etc1_uint32 inMask,\n        etc1_byte* pOut) {\n    etc1_byte colors[6];\n    etc1_byte flippedColors[6];\n    etc_average_colors_subblock(pIn, inMask, colors, false, false);\n    etc_average_colors_subblock(pIn, inMask, colors + 3, false, true);\n    etc_average_colors_subblock(pIn, inMask, flippedColors, true, false);\n    etc_average_colors_subblock(pIn, inMask, flippedColors + 3, true, true);\n\n    etc_compressed a, b;\n    etc_encode_block_helper(pIn, inMask, colors, &a, false);\n    etc_encode_block_helper(pIn, inMask, flippedColors, &b, true);\n    take_best(&a, &b);\n    writeBigEndian(pOut, a.high);\n    writeBigEndian(pOut + 4, a.low);\n}\n\n// Return the size of the encoded image data (does not include size of PKM header).\n\netc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height) {\n    return (((width + 3) & ~3) * ((height + 3) & ~3)) >> 1;\n}\n\n// Encode an entire image.\n// pIn - pointer to the image data. Formatted such that the Red component of\n//       pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset;\n// pOut - pointer to encoded data. Must be large enough to store entire encoded image.\n\nint etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,\n        etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut) {\n    if (pixelSize < 2 || pixelSize > 3) {\n        return -1;\n    }\n    static const unsigned short kYMask[] = { 0x0, 0xf, 0xff, 0xfff, 0xffff };\n    static const unsigned short kXMask[] = { 0x0, 0x1111, 0x3333, 0x7777,\n            0xffff };\n    etc1_byte block[ETC1_DECODED_BLOCK_SIZE];\n    etc1_byte encoded[ETC1_ENCODED_BLOCK_SIZE];\n\n    etc1_uint32 encodedWidth = (width + 3) & ~3;\n    etc1_uint32 encodedHeight = (height + 3) & ~3;\n\n    for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {\n        etc1_uint32 yEnd = height - y;\n        if (yEnd > 4) {\n            yEnd = 4;\n        }\n        int ymask = kYMask[yEnd];\n        for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {\n            etc1_uint32 xEnd = width - x;\n            if (xEnd > 4) {\n                xEnd = 4;\n            }\n            int mask = ymask & kXMask[xEnd];\n            for (etc1_uint32 cy = 0; cy < yEnd; cy++) {\n                etc1_byte* q = block + (cy * 4) * 3;\n                const etc1_byte* p = pIn + pixelSize * x + stride * (y + cy);\n                if (pixelSize == 3) {\n                    memcpy(q, p, xEnd * 3);\n                } else {\n                    for (etc1_uint32 cx = 0; cx < xEnd; cx++) {\n                        int pixel = (p[1] << 8) | p[0];\n                        *q++ = convert5To8(pixel >> 11);\n                        *q++ = convert6To8(pixel >> 5);\n                        *q++ = convert5To8(pixel);\n                        p += pixelSize;\n                    }\n                }\n            }\n            etc1_encode_block(block, mask, encoded);\n            memcpy(pOut, encoded, sizeof(encoded));\n            pOut += sizeof(encoded);\n        }\n    }\n    return 0;\n}\n\n// Decode an entire image.\n// pIn - pointer to encoded data.\n// pOut - pointer to the image data. Will be written such that the Red component of\n//       pixel (x,y) is at pIn + pixelSize * x + stride * y + redOffset. Must be\n//        large enough to store entire image.\n\n\nint etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut,\n        etc1_uint32 width, etc1_uint32 height,\n        etc1_uint32 pixelSize, etc1_uint32 stride) {\n    if (pixelSize < 2 || pixelSize > 3) {\n        return -1;\n    }\n    etc1_byte block[ETC1_DECODED_BLOCK_SIZE];\n\n    etc1_uint32 encodedWidth = (width + 3) & ~3;\n    etc1_uint32 encodedHeight = (height + 3) & ~3;\n\n    for (etc1_uint32 y = 0; y < encodedHeight; y += 4) {\n        etc1_uint32 yEnd = height - y;\n        if (yEnd > 4) {\n            yEnd = 4;\n        }\n        for (etc1_uint32 x = 0; x < encodedWidth; x += 4) {\n            etc1_uint32 xEnd = width - x;\n            if (xEnd > 4) {\n                xEnd = 4;\n            }\n            etc1_decode_block(pIn, block);\n            pIn += ETC1_ENCODED_BLOCK_SIZE;\n            for (etc1_uint32 cy = 0; cy < yEnd; cy++) {\n                const etc1_byte* q = block + (cy * 4) * 3;\n                etc1_byte* p = pOut + pixelSize * x + stride * (y + cy);\n                if (pixelSize == 3) {\n                    memcpy(p, q, xEnd * 3);\n                } else {\n                    for (etc1_uint32 cx = 0; cx < xEnd; cx++) {\n                        etc1_byte r = *q++;\n                        etc1_byte g = *q++;\n                        etc1_byte b = *q++;\n                        etc1_uint32 pixel = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);\n                        *p++ = (etc1_byte) pixel;\n                        *p++ = (etc1_byte) (pixel >> 8);\n                    }\n                }\n            }\n        }\n    }\n    return 0;\n}\n\nstatic const char kMagic[] = { 'P', 'K', 'M', ' ', '1', '0' };\n\nstatic const etc1_uint32 ETC1_PKM_FORMAT_OFFSET = 6;\nstatic const etc1_uint32 ETC1_PKM_ENCODED_WIDTH_OFFSET = 8;\nstatic const etc1_uint32 ETC1_PKM_ENCODED_HEIGHT_OFFSET = 10;\nstatic const etc1_uint32 ETC1_PKM_WIDTH_OFFSET = 12;\nstatic const etc1_uint32 ETC1_PKM_HEIGHT_OFFSET = 14;\n\nstatic const etc1_uint32 ETC1_RGB_NO_MIPMAPS = 0;\n\nstatic void writeBEUint16(etc1_byte* pOut, etc1_uint32 data) {\n    pOut[0] = (etc1_byte) (data >> 8);\n    pOut[1] = (etc1_byte) data;\n}\n\nstatic etc1_uint32 readBEUint16(const etc1_byte* pIn) {\n    return (pIn[0] << 8) | pIn[1];\n}\n\n// Format a PKM header\n\nvoid etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height) {\n    memcpy(pHeader, kMagic, sizeof(kMagic));\n    etc1_uint32 encodedWidth = (width + 3) & ~3;\n    etc1_uint32 encodedHeight = (height + 3) & ~3;\n    writeBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET, ETC1_RGB_NO_MIPMAPS);\n    writeBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET, encodedWidth);\n    writeBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET, encodedHeight);\n    writeBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET, width);\n    writeBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET, height);\n}\n\n// Check if a PKM header is correctly formatted.\n\netc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader) {\n    if (memcmp(pHeader, kMagic, sizeof(kMagic))) {\n        return false;\n    }\n    etc1_uint32 format = readBEUint16(pHeader + ETC1_PKM_FORMAT_OFFSET);\n    etc1_uint32 encodedWidth = readBEUint16(pHeader + ETC1_PKM_ENCODED_WIDTH_OFFSET);\n    etc1_uint32 encodedHeight = readBEUint16(pHeader + ETC1_PKM_ENCODED_HEIGHT_OFFSET);\n    etc1_uint32 width = readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);\n    etc1_uint32 height = readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);\n    return format == ETC1_RGB_NO_MIPMAPS &&\n            encodedWidth >= width && encodedWidth - width < 4 &&\n            encodedHeight >= height && encodedHeight - height < 4;\n}\n\n// Read the image width from a PKM header\n\netc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader) {\n    return readBEUint16(pHeader + ETC1_PKM_WIDTH_OFFSET);\n}\n\n// Read the image height from a PKM header\n\netc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader){\n    return readBEUint16(pHeader + ETC1_PKM_HEIGHT_OFFSET);\n}\n"
  },
  {
    "path": "cocos2d/cocos/base/etc1.h",
    "content": "// Copyright 2009 Google Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef __etc1_h__\n#define __etc1_h__\n\n#define ETC1_ENCODED_BLOCK_SIZE 8\n#define ETC1_DECODED_BLOCK_SIZE 48\n\n#ifndef ETC1_RGB8_OES\n#define ETC1_RGB8_OES 0x8D64\n#endif\n\ntypedef unsigned char etc1_byte;\ntypedef int etc1_bool;\ntypedef unsigned int etc1_uint32;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Encode a block of pixels.\n//\n// pIn is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a\n// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R\n// value of pixel (x, y).\n//\n// validPixelMask is a 16-bit mask where bit (1 << (x + y * 4)) indicates whether\n// the corresponding (x,y) pixel is valid. Invalid pixel color values are ignored when compressing.\n//\n// pOut is an ETC1 compressed version of the data.\n\nvoid etc1_encode_block(const etc1_byte* pIn, etc1_uint32 validPixelMask, etc1_byte* pOut);\n\n// Decode a block of pixels.\n//\n// pIn is an ETC1 compressed version of the data.\n//\n// pOut is a pointer to a ETC_DECODED_BLOCK_SIZE array of bytes that represent a\n// 4 x 4 square of 3-byte pixels in form R, G, B. Byte (3 * (x + 4 * y) is the R\n// value of pixel (x, y).\n\nvoid etc1_decode_block(const etc1_byte* pIn, etc1_byte* pOut);\n\n// Return the size of the encoded image data (does not include size of PKM header).\n\netc1_uint32 etc1_get_encoded_data_size(etc1_uint32 width, etc1_uint32 height);\n\n// Encode an entire image.\n// pIn - pointer to the image data. Formatted such that\n//       pixel (x,y) is at pIn + pixelSize * x + stride * y;\n// pOut - pointer to encoded data. Must be large enough to store entire encoded image.\n// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.\n// returns non-zero if there is an error.\n\nint etc1_encode_image(const etc1_byte* pIn, etc1_uint32 width, etc1_uint32 height,\n        etc1_uint32 pixelSize, etc1_uint32 stride, etc1_byte* pOut);\n\n// Decode an entire image.\n// pIn - pointer to encoded data.\n// pOut - pointer to the image data. Will be written such that\n//        pixel (x,y) is at pIn + pixelSize * x + stride * y. Must be\n//        large enough to store entire image.\n// pixelSize can be 2 or 3. 2 is an GL_UNSIGNED_SHORT_5_6_5 image, 3 is a GL_BYTE RGB image.\n// returns non-zero if there is an error.\n\nint etc1_decode_image(const etc1_byte* pIn, etc1_byte* pOut,\n        etc1_uint32 width, etc1_uint32 height,\n        etc1_uint32 pixelSize, etc1_uint32 stride);\n\n// Size of a PKM header, in bytes.\n\n#define ETC_PKM_HEADER_SIZE 16\n\n// Format a PKM header\n\nvoid etc1_pkm_format_header(etc1_byte* pHeader, etc1_uint32 width, etc1_uint32 height);\n\n// Check if a PKM header is correctly formatted.\n\netc1_bool etc1_pkm_is_valid(const etc1_byte* pHeader);\n\n// Read the image width from a PKM header\n\netc1_uint32 etc1_pkm_get_width(const etc1_byte* pHeader);\n\n// Read the image height from a PKM header\n\netc1_uint32 etc1_pkm_get_height(const etc1_byte* pHeader);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/base/s3tc.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"s3tc.h\"\n\n//Decode S3TC encode block to 4x4 RGB32 pixels\nstatic void s3tc_decode_block(uint8_t **blockData,\n                       uint32_t *decodeBlockData,\n                       unsigned int stride,\n                       bool oneBitAlphaFlag,\n                       uint64_t alpha,\n                       S3TCDecodeFlag decodeFlag)\n{\n    unsigned int colorValue0 = 0 , colorValue1 = 0, initAlpha = (!oneBitAlphaFlag * 255u) << 24;\n    unsigned int rb0 = 0, rb1 = 0, rb2 = 0, rb3 = 0, g0 = 0, g1 = 0, g2 = 0, g3 = 0;\n    \n    uint32_t colors[4], pixelsIndex = 0;\n    \n    /* load the two color values*/\n    memcpy((void *)&colorValue0, *blockData, 2);\n    (*blockData) += 2;\n    \n    memcpy((void *)&colorValue1, *blockData, 2);\n    (*blockData) += 2;\n    \n    /* the channel is r5g6b5 , 16 bits */\n    rb0  = (colorValue0 << 19 | colorValue0 >> 8) & 0xf800f8;\n    rb1  = (colorValue1 << 19 | colorValue1 >> 8) & 0xf800f8;\n    g0   = (colorValue0 << 5) & 0x00fc00;\n    g1   = (colorValue1 << 5) & 0x00fc00;\n    g0  += (g0 >> 6) & 0x000300;\n    g1  += (g1 >> 6) & 0x000300;\n    \n    colors[0] = rb0 + g0 + initAlpha;\n    colors[1] = rb1 + g1 + initAlpha;\n    \n    /* interpolate the other two color values */\n    if (colorValue0 > colorValue1 || oneBitAlphaFlag)\n    {\n        rb2 = (((2*rb0 + rb1) * 21) >> 6) & 0xff00ff;\n        rb3 = (((2*rb1 + rb0) * 21) >> 6) & 0xff00ff;\n        g2  = (((2*g0 + g1 ) * 21) >> 6) & 0x00ff00;\n        g3  = (((2*g1 + g0 ) * 21) >> 6) & 0x00ff00;\n        colors[3] = rb3 + g3 + initAlpha;\n    }\n    else\n    {\n        rb2 = ((rb0+rb1) >> 1) & 0xff00ff;\n        g2  = ((g0 +g1 ) >> 1) & 0x00ff00;\n        colors[3] = 0 ;\n    }\n    colors[2] = rb2 + g2 + initAlpha;\n    \n    /*read the pixelsIndex , 2bits per pixel, 4 bytes */\n    memcpy((void*)&pixelsIndex, *blockData, 4);\n    (*blockData) += 4;\n    \n    if (S3TCDecodeFlag::DXT5 == decodeFlag)\n    {\n        //dxt5 use interpolate alpha\n        // 8-Alpha block: derive the other six alphas.\n        // Bit code 000 = alpha0, 001 = alpha1, other are interpolated.\n        \n        unsigned int alphaArray[8];\n        \n        alphaArray[0] = (alpha ) & 0xff ;\n        alphaArray[1] = (alpha >> 8) & 0xff ;\n        \n        if (alphaArray[0] >= alphaArray[1])\n        {\n            alphaArray[2] = (alphaArray[0]*6 + alphaArray[1]*1) / 7;\n            alphaArray[3] = (alphaArray[0]*5 + alphaArray[1]*2) / 7;\n            alphaArray[4] = (alphaArray[0]*4 + alphaArray[1]*3) / 7;\n            alphaArray[5] = (alphaArray[0]*3 + alphaArray[1]*4) / 7;\n            alphaArray[6] = (alphaArray[0]*2 + alphaArray[1]*5) / 7;\n            alphaArray[7] = (alphaArray[0]*1 + alphaArray[1]*6) / 7;\n        }\n        else if (alphaArray[0] < alphaArray[1])\n        {\n            alphaArray[2] = (alphaArray[0]*4 + alphaArray[1]*1) / 5;\n            alphaArray[3] = (alphaArray[0]*3 + alphaArray[1]*2) / 5;\n            alphaArray[4] = (alphaArray[0]*2 + alphaArray[1]*3) / 5;\n            alphaArray[5] = (alphaArray[0]*1 + alphaArray[1]*4) / 5;\n            alphaArray[6] = 0;\n            alphaArray[7] = 255;\n        }\n        \n        // read the flowing 48bit indices (16*3)\n        alpha >>= 16;\n        \n        for (int y = 0; y < 4; ++y)\n        {\n            for (int x = 0; x < 4; ++x)\n            {\n                decodeBlockData[x] = (alphaArray[alpha & 5] << 24) + colors[pixelsIndex & 3];\n                pixelsIndex >>= 2;\n                alpha >>= 3;\n            }\n            decodeBlockData += stride;\n        }\n    } //if (dxt5 == comFlag)\n    else\n    { //dxt1 dxt3 use explicit alpha\n        for (int y = 0; y < 4; ++y)\n        {\n            for (int x = 0; x < 4; ++x)\n            {\n                initAlpha   = (static_cast<int>(alpha) & 0x0f) << 28;\n                initAlpha   += initAlpha >> 4;\n                decodeBlockData[x] = initAlpha + colors[pixelsIndex & 3];\n                pixelsIndex >>= 2;\n                alpha       >>= 4;\n            }\n            decodeBlockData += stride;\n        }\n    }\n}\n\n//Decode S3TC encode data to RGB32\nvoid s3tc_decode(uint8_t *encodeData,             //in_data\n                 uint8_t *decodeData,             //out_data\n                 const int pixelsWidth,\n                 const int pixelsHeight,\n                 S3TCDecodeFlag decodeFlag)\n{\n    uint32_t *decodeBlockData = (uint32_t *)decodeData;\n    for (int block_y = 0; block_y < pixelsHeight / 4; ++block_y, decodeBlockData += 3 * pixelsWidth)   //stride = 3*width\n    {\n        for(int block_x = 0; block_x < pixelsWidth / 4; ++block_x, decodeBlockData += 4)            //skip 4 pixels\n        {\n            uint64_t blockAlpha = 0;\n            \n            switch (decodeFlag)\n            {\n                case S3TCDecodeFlag::DXT1:\n                {\n                    s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 0, 0LL, S3TCDecodeFlag::DXT1);\n                }\n                    break;\n                case S3TCDecodeFlag::DXT3:\n                {\n                    memcpy((void *)&blockAlpha, encodeData, 8);\n                    encodeData += 8;\n                    s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, S3TCDecodeFlag::DXT3);\n                }\n                    break;\n                case S3TCDecodeFlag::DXT5:\n                {\n                    memcpy((void *)&blockAlpha, encodeData, 8);\n                    encodeData += 8;\n                    s3tc_decode_block(&encodeData, decodeBlockData, pixelsWidth, 1, blockAlpha, S3TCDecodeFlag::DXT5);\n                }\n                    break;\n                default:\n                    break;\n            }//switch\n        }//for block_x\n    }//for block_y\n}\n\n\n"
  },
  {
    "path": "cocos2d/cocos/base/s3tc.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n#ifndef COCOS2DX_PLATFORM_THIRDPARTY_S3TC_\n#define COCOS2DX_PLATFORM_THIRDPARTY_S3TC_\n\n#include \"CCStdC.h\"\n\nenum class S3TCDecodeFlag\n{\n    DXT1 = 1,\n    DXT3 = 3,\n    DXT5 = 5,\n};\n\n//Decode S3TC encode data to RGB32\n void s3tc_decode(uint8_t *encode_data,\n                 uint8_t *decode_data,\n                 const int pixelsWidth,\n                 const int pixelsHeight,\n                 S3TCDecodeFlag decodeFlag\n                 );\n\n\n#endif /* defined(COCOS2DX_PLATFORM_THIRDPARTY_S3TC_) */\n\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocosbuilder_static\n\nLOCAL_MODULE_FILENAME := libcocosbuilder\n\nLOCAL_SRC_FILES := CCBAnimationManager.cpp \\\nCCBFileLoader.cpp \\\nCCBKeyframe.cpp \\\nCCBReader.cpp \\\nCCBSequence.cpp \\\nCCBSequenceProperty.cpp \\\nCCControlButtonLoader.cpp \\\nCCControlLoader.cpp \\\nCCLabelBMFontLoader.cpp \\\nCCLabelTTFLoader.cpp \\\nCCLayerColorLoader.cpp \\\nCCLayerGradientLoader.cpp \\\nCCLayerLoader.cpp \\\nCCMenuItemImageLoader.cpp \\\nCCMenuItemLoader.cpp \\\nCCNode+CCBRelativePositioning.cpp \\\nCCNodeLoader.cpp \\\nCCNodeLoaderLibrary.cpp \\\nCCParticleSystemQuadLoader.cpp \\\nCCScale9SpriteLoader.cpp \\\nCCScrollViewLoader.cpp \\\nCCSpriteLoader.cpp\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \\\n$(LOCAL_PATH)/../../..\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \\\n$(LOCAL_PATH) \\\n$(LOCAL_PATH)/../../.. \n\nLOCAL_CFLAGS += -Wno-psabi\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos_extension_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,extensions)\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp",
    "content": "#include \"CCBAnimationManager.h\"\n#include \"CCBSequence.h\"\n#include \"CCBSequenceProperty.h\"\n#include \"CCBReader.h\"\n#include \"CCBKeyframe.h\"\n#include \"CCNode+CCBRelativePositioning.h\"\n#include <string>\n#include <set>\n#include \"SimpleAudioEngine.h\"\n#include \"CCBSelectorResolver.h\"\n\nusing namespace cocos2d;\nusing namespace std;\nusing namespace cocos2d::extension;\n\nnamespace cocosbuilder {\n\n// Implementation of CCBAinmationManager\n\nCCBAnimationManager::CCBAnimationManager()\n: _jsControlled(false)\n, _owner(nullptr)\n, _autoPlaySequenceId(0)\n, _rootNode(nullptr)\n, _rootContainerSize(Size::ZERO)\n, _delegate(nullptr)\n, _runningSequence(nullptr)\n{\n    init();\n}\n\nbool CCBAnimationManager::init()\n{\n    _target = nullptr;\n    _animationCompleteCallbackFunc = nullptr;\n    \n    return true;\n}\n\nCCBAnimationManager::~CCBAnimationManager()\n{\n//     DictElement *pElement = nullptr;\n//     CCDICT_FOREACH(_nodeSequences, pElement)\n//     {\n//         Node *node = (Node*)pElement->getIntKey();\n//         node->release();\n//     }\n//     \n//     CCDICT_FOREACH(_baseValues, pElement)\n//     {\n//         Node *node = (Node*)pElement->getIntKey();\n//         node->release();\n//     }\n    if (_rootNode)\n    {\n        _rootNode->stopAllActions();\n    }\n    \n    setRootNode(nullptr);\n    setDelegate(nullptr);\n    \n    for (auto iter = _objects.begin(); iter != _objects.end(); ++iter)\n    {\n        for (auto iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2)\n        {\n            iter2->second->release();\n        }\n    }\n    \n    CC_SAFE_RELEASE(_target);\n}\n\nVector<CCBSequence*>& CCBAnimationManager::getSequences()\n{\n    return _sequences;\n}\n\nvoid CCBAnimationManager::setSequences(const Vector<CCBSequence*>& seq)\n{\n    _sequences = seq;\n}\n\nint CCBAnimationManager::getAutoPlaySequenceId()\n{\n    return _autoPlaySequenceId;\n}\n\nvoid CCBAnimationManager::setAutoPlaySequenceId(int autoPlaySequenceId)\n{\n    _autoPlaySequenceId = autoPlaySequenceId;\n}\n\nNode* CCBAnimationManager::getRootNode()\n{\n    return _rootNode;\n}\n\nvoid CCBAnimationManager::setRootNode(Node *pRootNode)\n{\n    _rootNode = pRootNode;\n}\n\nvoid CCBAnimationManager::setDocumentControllerName(const std::string &name)\n{\n    _documentControllerName = name;\n}\n\n\nstd::string CCBAnimationManager::getDocumentControllerName()\n{\n    return _documentControllerName;\n}\n\nvoid CCBAnimationManager::addDocumentCallbackNode(Node *node)\n{\n    _documentCallbackNodes.pushBack(node);\n}\n\nvoid CCBAnimationManager::addDocumentCallbackName(std::string name)\n{\n    _documentCallbackNames.push_back(Value(name));\n}\n\nvoid CCBAnimationManager::addDocumentCallbackControlEvents(Control::EventType eventType)\n{\n    _documentCallbackControlEvents.push_back(Value(static_cast<int>(eventType)));\n}\n\nValueVector& CCBAnimationManager::getDocumentCallbackNames()\n{\n    return _documentCallbackNames;\n}\n\nVector<Node*>& CCBAnimationManager::getDocumentCallbackNodes()\n{\n    return _documentCallbackNodes;\n}\n\nValueVector& CCBAnimationManager::getDocumentCallbackControlEvents()\n{\n    return _documentCallbackControlEvents;\n}\n\nvoid CCBAnimationManager::addDocumentOutletNode(Node *node)\n{\n    _documentOutletNodes.pushBack(node);\n}\n\nvoid CCBAnimationManager::addDocumentOutletName(std::string name)\n{\n    _documentOutletNames.push_back(Value(name));\n}\n\nValueVector& CCBAnimationManager::getDocumentOutletNames()\n{\n    return _documentOutletNames;\n}\n\nVector<Node*>& CCBAnimationManager::getDocumentOutletNodes()\n{\n    return _documentOutletNodes;\n}\n\nstd::string CCBAnimationManager::getLastCompletedSequenceName()\n{\n    return _lastCompletedSequenceName;\n}\n\nValueVector& CCBAnimationManager::getKeyframeCallbacks()\n{\n    return _keyframeCallbacks;\n}\n\nconst Size& CCBAnimationManager::getRootContainerSize()\n{\n    return _rootContainerSize;\n}\n\nvoid CCBAnimationManager::setRootContainerSize(const Size &rootContainerSize)\n{\n    _rootContainerSize.setSize(rootContainerSize.width, rootContainerSize.height);\n}\n\nCCBAnimationManagerDelegate* CCBAnimationManager::getDelegate()\n{\n    return _delegate;\n}\n\nvoid CCBAnimationManager::setDelegate(CCBAnimationManagerDelegate *pDelegate)\n{\n    CC_SAFE_RELEASE(dynamic_cast<Object*>(_delegate));\n    _delegate = pDelegate;\n    CC_SAFE_RETAIN(dynamic_cast<Object*>(_delegate));\n}\n\nconst char* CCBAnimationManager::getRunningSequenceName()\n{\n    if (_runningSequence)\n    {\n        return _runningSequence->getName();\n    }\n    return nullptr;\n}\n\nconst Size& CCBAnimationManager::getContainerSize(Node *pNode)\n{\n    if (pNode)\n    {\n        return pNode->getContentSize();\n    }\n    else \n    {\n        return _rootContainerSize;\n    }\n}\n\n// refer to CCBReader::readNodeGraph() for data structure of pSeq\nvoid CCBAnimationManager::addNode(Node *pNode, const std::unordered_map<int, Map<std::string, CCBSequenceProperty*>>& seq)\n{\n    // pNode->retain();\n    \n    _nodeSequences[pNode] = seq;\n}\n\nvoid CCBAnimationManager::setBaseValue(const Value& value, Node *pNode, const std::string& propName)\n{\n    auto& props = _baseValues[pNode];\n    props[propName] = value;\n}\n\nconst Value& CCBAnimationManager::getBaseValue(Node *pNode, const std::string& propName)\n{\n    auto& props = _baseValues[pNode];\n    return props[propName];\n}\n    \nvoid CCBAnimationManager::setObject(Object* obj, Node *pNode, const std::string& propName)\n{\n    auto& props = _objects[pNode];\n    auto iter = props.find(propName);\n    if (iter != props.end())\n        iter->second->release();\n        \n    props[propName] = obj;\n    obj->retain();\n}\n\nObject* CCBAnimationManager::getObject(Node *pNode, const std::string& propName)\n{\n    auto& props = _objects[pNode];\n    auto iter = props.find(propName);\n    if (iter != props.end())\n        return iter->second;\n    \n    return nullptr;\n}\n\nint CCBAnimationManager::getSequenceId(const char* pSequenceName)\n{\n    string seqName(pSequenceName);\n    for (auto& seq : _sequences)\n    {\n        if (seqName.compare(seq->getName()) == 0)\n        {\n            return seq->getSequenceId();\n        }\n    }\n    return -1;\n}\n\nCCBSequence* CCBAnimationManager::getSequence(int nSequenceId)\n{\n    for (auto& seq : _sequences)\n    {\n        if (seq->getSequenceId() == nSequenceId)\n        {\n            return seq;\n        }\n    }\n    return nullptr;\n}\n\nfloat CCBAnimationManager::getSequenceDuration(const char *pSequenceName)\n{\n    int id = getSequenceId(pSequenceName);\n    if (id != -1)\n        return getSequence(id)->getDuration();\n    return 0;\n}\n\n\nvoid CCBAnimationManager::moveAnimationsFromNode(Node* fromNode, Node* toNode)\n{\n    // Move base values\n    auto baseValueIter = _baseValues.find(fromNode);\n    if(baseValueIter != _baseValues.end())\n    {\n        _baseValues.erase(baseValueIter);\n        _baseValues[toNode] = baseValueIter->second;\n//         fromNode->release();\n//         toNode->retain();\n    }\n    \n    auto objIter = _objects.find(fromNode);\n    if (objIter != _objects.end())\n    {\n        _objects.erase(objIter);\n        _objects[toNode] = objIter->second;\n    }\n    \n    \n    // Move seqs\n    auto seqsIter = _nodeSequences.find(fromNode);\n    if (seqsIter != _nodeSequences.end())\n    {\n        _nodeSequences.erase(seqsIter);\n        _nodeSequences[toNode] = seqsIter->second;\n\n//         fromNode->release();\n//         toNode->retain();\n    }\n}\n\n// Refer to CCBReader::readKeyframe() for the real type of value\nActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const std::string& propName, Node *pNode)\n{\n    float duration = pKeyframe1->getTime() - (pKeyframe0 ? pKeyframe0->getTime() : 0);\n    \n    if (propName == \"rotationX\")\n    {\n        return CCBRotateXTo::create(duration, pKeyframe1->getValue().asFloat());\n    }\n    else if (propName == \"rotationY\")\n    {\n        return CCBRotateYTo::create(duration, pKeyframe1->getValue().asFloat());\n    }\n    else if (propName == \"rotation\")\n    {\n        return CCBRotateTo::create(duration, pKeyframe1->getValue().asFloat());\n    } \n    else if (propName == \"opacity\")\n    {\n        return FadeTo::create(duration, pKeyframe1->getValue().asByte());\n    }\n    else if (propName == \"color\")\n    {\n        auto c = pKeyframe1->getValue().asValueMap();\n        unsigned char r = c[\"r\"].asByte();\n        unsigned char g = c[\"g\"].asByte();\n        unsigned char b = c[\"b\"].asByte();\n        return TintTo::create(duration, r, g, b);\n    }\n    else if (propName == \"visible\")\n    {\n        if (pKeyframe1->getValue().asBool())\n        {\n            return Sequence::createWithTwoActions(DelayTime::create(duration), Show::create());\n        }\n        else \n        {\n            return Sequence::createWithTwoActions(DelayTime::create(duration), Hide::create());\n        }\n    }\n    else if (propName == \"displayFrame\")\n    {\n        return Sequence::createWithTwoActions(DelayTime::create(duration),\n                    CCBSetSpriteFrame::create(static_cast<SpriteFrame*>(pKeyframe1->getObject())));\n    }\n    else if (propName == \"position\")\n    {\n        // Get position type\n        auto& array = getBaseValue(pNode, propName).asValueVector();\n        CCBReader::PositionType type = (CCBReader::PositionType)array[2].asInt();\n        \n        // Get relative position\n        auto value = pKeyframe1->getValue().asValueVector();\n        float x = value[0].asFloat();\n        float y = value[1].asFloat();\n        \n        Size containerSize = getContainerSize(pNode->getParent());\n        \n        Point absPos = getAbsolutePosition(Point(x,y), type, containerSize, propName);\n        \n        return MoveTo::create(duration, absPos);\n    }\n    else if (propName == \"scale\")\n    {\n        // Get position type\n        auto& array = getBaseValue(pNode, propName).asValueVector();\n        CCBReader::ScaleType type = (CCBReader::ScaleType)array[2].asInt();\n        \n        // Get relative scale\n        auto value = pKeyframe1->getValue().asValueVector();\n        float x = value[0].asFloat();\n        float y = value[1].asFloat();\n        \n        if (type == CCBReader::ScaleType::MULTIPLY_RESOLUTION)\n        {\n            float resolutionScale = CCBReader::getResolutionScale();\n            x *= resolutionScale;\n            y *= resolutionScale;\n        }\n        \n        return ScaleTo::create(duration, x, y);\n    }\n    else if (propName == \"skew\")\n    {\n        // Get relative skew\n        auto& value = pKeyframe1->getValue().asValueVector();\n        float x = value[0].asFloat();\n        float y = value[1].asFloat();\n        \n        return SkewTo::create(duration, x, y);\n    }\n    else \n    {\n        log(\"CCBReader: Failed to create animation for property: %s\", propName.c_str());\n    }\n    \n    return nullptr;\n}\n\nvoid CCBAnimationManager::setAnimatedProperty(const std::string& propName, Node *pNode, const Value& value, Object* obj, float fTweenDuration)\n{\n    if (fTweenDuration > 0)\n    {\n        // Create a fake keyframe to generate the action from\n        CCBKeyframe *kf1 = new CCBKeyframe();\n        kf1->autorelease();\n        \n        kf1->setObject(obj);\n        kf1->setValue(value);\n        kf1->setTime(fTweenDuration);\n        kf1->setEasingType(CCBKeyframe::EasingType::LINEAR);\n        \n        // Animate\n        ActionInterval *tweenAction = getAction(nullptr, kf1, propName, pNode);\n        pNode->runAction(tweenAction);\n    }\n    else \n    {\n        // Just set the value\n        \n        if (propName == \"position\")\n        {\n            // Get position type\n            auto& array = getBaseValue(pNode, propName).asValueVector();\n            CCBReader::PositionType type = (CCBReader::PositionType)array[2].asInt();\n            // Get relative position\n            auto& valueVector = value.asValueVector();\n            float x = valueVector[0].asFloat();\n            float y = valueVector[1].asFloat();\n            \n            pNode->setPosition(getAbsolutePosition(Point(x,y), type, getContainerSize(pNode->getParent()), propName));\n        }\n        else if (propName == \"scale\")\n        {\n            // Get scale type\n            auto& array = getBaseValue(pNode, propName).asValueVector();\n            CCBReader::ScaleType type = (CCBReader::ScaleType)array[2].asInt();\n            \n            // Get relative scale\n            auto& valueVector = value.asValueVector();\n            float x = valueVector[0].asFloat();\n            float y = valueVector[1].asFloat();\n            \n            setRelativeScale(pNode, x, y, type, propName);\n        }\n        else if(propName == \"skew\")\n        {\n            // Get relative scale\n            auto& valueVector = value.asValueVector();\n            float x = valueVector[0].asFloat();\n            float y = valueVector[1].asFloat();\n\n            pNode->setSkewX(x);\n            pNode->setSkewY(y);\n        }\n        else \n        {\n            // [node setValue:value forKey:name];\n\n            // TODO only handle rotation, opacity, displayFrame, color\n            if (propName == \"rotation\")\n            {\n                float rotate = value.asFloat();\n                pNode->setRotation(rotate);\n            } else if(propName == \"rotationX\")\n            {\n                float rotate = value.asFloat();\n                pNode->setRotationX(rotate);\n            }else if(propName == \"rotationY\")\n            {\n                float rotate = value.asFloat();\n                pNode->setRotationY(rotate);\n            }\n            else if (propName == \"opacity\")\n            {\n                unsigned char opacity = value.asByte();\n                pNode->setOpacity(opacity);\n            }\n            else if (propName == \"displayFrame\")\n            {\n                static_cast<Sprite*>(pNode)->setSpriteFrame(static_cast<SpriteFrame*>(obj));\n            }\n            else if (propName == \"color\")\n            {\n                auto c = value.asValueMap();\n                unsigned char r = c[\"r\"].asByte();\n                unsigned char g = c[\"g\"].asByte();\n                unsigned char b = c[\"b\"].asByte();\n                pNode->setColor(Color3B(r, g, b));\n            }\n            else if (propName == \"visible\")\n            {\n                bool visible = value.asBool();\n                pNode->setVisible(visible);\n            }\n            else\n            {\n                log(\"unsupported property name is %s\", propName.c_str());\n                CCASSERT(false, \"unsupported property now\");\n            }\n        }\n    }\n}\n\nvoid CCBAnimationManager::setFirstFrame(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration)\n{\n    auto& keyframes = pSeqProp->getKeyframes();\n    \n    if (keyframes.empty())\n    {\n        // Use base value (no animation)\n        auto& baseValue = getBaseValue(pNode, pSeqProp->getName());\n        auto obj = getObject(pNode, pSeqProp->getName());\n        CCASSERT(!baseValue.isNull(), \"No baseValue found for property\");\n        setAnimatedProperty(pSeqProp->getName(), pNode, baseValue, obj, fTweenDuration);\n    }\n    else \n    {\n        // Use first keyframe\n        CCBKeyframe *keyframe = keyframes.at(0);\n        setAnimatedProperty(pSeqProp->getName(), pNode, keyframe->getValue(), keyframe->getObject(), fTweenDuration);\n    }\n}\n\nActionInterval* CCBAnimationManager::getEaseAction(ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt)\n{\n    if (dynamic_cast<Sequence*>(pAction))\n    {\n        return pAction;\n    }\n    \n    if (easingType == CCBKeyframe::EasingType::LINEAR)\n    {\n        return pAction;\n    }\n    else if (easingType == CCBKeyframe::EasingType::INSTANT)\n    {\n        return CCBEaseInstant::create(pAction);\n    }\n    else if (easingType == CCBKeyframe::EasingType::CUBIC_IN)\n    {\n        return EaseIn::create(pAction, fEasingOpt);\n    }\n    else if (easingType == CCBKeyframe::EasingType::CUBIC_OUT)\n    {\n        return EaseOut::create(pAction, fEasingOpt);\n    }\n    else if (easingType == CCBKeyframe::EasingType::CUBIC_INOUT)\n    {\n        return EaseInOut::create(pAction, fEasingOpt);\n    }\n    else if (easingType == CCBKeyframe::EasingType::BACK_IN)\n    {\n        return EaseBackIn::create(pAction);\n    }\n    else if (easingType == CCBKeyframe::EasingType::BACK_OUT)\n    {\n        return EaseBackOut::create(pAction);\n    }\n    else if (easingType == CCBKeyframe::EasingType::BACK_INOUT)\n    {\n        return EaseBackInOut::create(pAction);\n    }\n    else if (easingType == CCBKeyframe::EasingType::BOUNCE_IN)\n    {\n        return EaseBounceIn::create(pAction);\n    }\n    else if (easingType == CCBKeyframe::EasingType::BOUNCE_OUT)\n    {\n        return EaseBounceOut::create(pAction);\n    }\n    else if (easingType == CCBKeyframe::EasingType::BOUNCE_INOUT)\n    {\n        return EaseBounceInOut::create(pAction);\n    }\n    else if (easingType == CCBKeyframe::EasingType::ELASTIC_IN)\n    {\n        return EaseElasticIn::create(pAction, fEasingOpt);\n    }\n    else if (easingType == CCBKeyframe::EasingType::ELASTIC_OUT)\n    {\n        return EaseElasticOut::create(pAction, fEasingOpt);\n    }\n    else if (easingType == CCBKeyframe::EasingType::ELASTIC_INOUT)\n    {\n        return EaseElasticInOut::create(pAction, fEasingOpt);\n    }\n    else\n    {\n        log(\"CCBReader: Unkown easing type %d\", easingType);\n        return pAction;\n    }\n}\n\nObject* CCBAnimationManager::actionForCallbackChannel(CCBSequenceProperty* channel) {\n  \n    float lastKeyframeTime = 0;\n    \n    Vector<FiniteTimeAction*> actions;\n    auto& keyframes = channel->getKeyframes();\n    ssize_t numKeyframes = keyframes.size();\n\n    for (long i = 0; i < numKeyframes; ++i)\n    {\n\n        CCBKeyframe *keyframe = keyframes.at(i);\n        float timeSinceLastKeyframe = keyframe->getTime() - lastKeyframeTime;\n        lastKeyframeTime = keyframe->getTime();\n        if(timeSinceLastKeyframe > 0) {\n            actions.pushBack(DelayTime::create(timeSinceLastKeyframe));\n        }\n\t\n        auto& keyVal = keyframe->getValue().asValueVector();\n        std::string selectorName = keyVal[0].asString();\n        CCBReader::TargetType selectorTarget = (CCBReader::TargetType)keyVal[1].asInt();\n\t\n        if(_jsControlled) {\n            std::stringstream callbackName;\n            callbackName << static_cast<int>(selectorTarget);\n            callbackName << \":\" + selectorName;\n            \n            auto callback = _keyframeCallFuncs.at(callbackName.str());\n            if (nullptr != callback)\n            {\n                CallFunc* callbackClone = callback->clone();\n    \n                if (callbackClone != nullptr)\n                {\n                    actions.pushBack(callbackClone);\n                }\n            }\n        }\n        else\n        {\n            Object* target = nullptr;\n            \n            if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT)\n                target = _rootNode;\n            else if (selectorTarget == CCBReader::TargetType::OWNER)\n                target = _owner;\n            \n            if(target != nullptr)\n            {\n                if(selectorName.length() > 0)\n                {\n                    SEL_CallFuncN selCallFunc = 0;\n                    \n                    CCBSelectorResolver* targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);\n\n                    if(targetAsCCBSelectorResolver != nullptr)\n                    {\n                        selCallFunc = targetAsCCBSelectorResolver->onResolveCCBCCCallFuncSelector(target, selectorName.c_str    ());\n                    }\n                    \n                    if(selCallFunc == 0)\n                    {\n                        CCLOG(\"Skipping selector '%s' since no CCBSelectorResolver is present.\", selectorName.c_str());\n                    }\n                    else\n                    {\n                        auto savedTarget = std::make_shared<Vector<Object*>>();\n                        savedTarget->pushBack(target);\n                        \n                        auto callback = CallFuncN::create([savedTarget, selCallFunc](Node* sender){\n                            auto t = savedTarget->at(0);\n                            (t->*selCallFunc)(sender);\n                        });\n\n                        actions.pushBack(callback);\n                    }\n                }\n                else\n                {\n                    CCLOG(\"Unexpected empty selector.\");\n                }\n            }\n        }\n    }\n    if(actions.size() < 1) return nullptr;\n    \n    return (Object *) Sequence::create(actions);\n}\n\nObject* CCBAnimationManager::actionForSoundChannel(CCBSequenceProperty* channel) {\n    \n    float lastKeyframeTime = 0;\n    \n    Vector<FiniteTimeAction*> actions;\n    auto& keyframes = channel->getKeyframes();\n    ssize_t numKeyframes = keyframes.size();\n\n    for (int i = 0; i < numKeyframes; ++i)\n    {\n        CCBKeyframe *keyframe = keyframes.at(i);\n        float timeSinceLastKeyframe = keyframe->getTime() - lastKeyframeTime;\n        lastKeyframeTime = keyframe->getTime();\n        if(timeSinceLastKeyframe > 0) {\n            actions.pushBack(DelayTime::create(timeSinceLastKeyframe));\n        }\n\t\n        stringstream ss (stringstream::in | stringstream::out);\n        auto& keyVal = keyframe->getValue().asValueVector();\n        std::string soundFile = keyVal[0].asString();\n    \n        float pitch, pan, gain;\n        ss << keyVal[1].asString();\n        ss >> pitch;\n        ss.flush();\n    \n        ss << keyVal[2].asString();\n        ss >> pan;\n        ss.flush();\n        \n        ss << keyVal[3].asString();\n        ss >> gain;\n        ss.flush();\n        \n        actions.pushBack(CCBSoundEffect::actionWithSoundFile(soundFile, pitch, pan, gain));\n    }\n\n    if(actions.size() < 1) return nullptr;\n    \n    return Sequence::create(actions);\n}\n\n\n\nvoid CCBAnimationManager::runAction(Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration)\n{\n    auto& keyframes = pSeqProp->getKeyframes();\n    ssize_t numKeyframes = keyframes.size();\n    \n    if (numKeyframes > 1)\n    {\n        // Make an animation!\n        Vector<FiniteTimeAction*> actions;\n        \n        CCBKeyframe *keyframeFirst = keyframes.at(0);\n        float timeFirst = keyframeFirst->getTime() + fTweenDuration;\n        \n        if (timeFirst > 0)\n        {\n            actions.pushBack(DelayTime::create(timeFirst));\n        }\n        \n        for (ssize_t i = 0; i < numKeyframes - 1; ++i)\n        {\n            CCBKeyframe *kf0 = keyframes.at(i);\n            CCBKeyframe *kf1 = keyframes.at(i+1);\n            \n            ActionInterval *action = getAction(kf0, kf1, pSeqProp->getName(), pNode);\n            if (action)\n            {\n                // Apply easing\n                action = getEaseAction(action, kf0->getEasingType(), kf0->getEasingOpt());\n                \n                actions.pushBack(action);\n            }\n        }\n        \n        auto seq = Sequence::create(actions);\n        pNode->runAction(seq);\n    }\n}\n\nvoid CCBAnimationManager::runAnimations(const char *pName, float fTweenDuration)\n{\n    runAnimationsForSequenceNamedTweenDuration(pName, fTweenDuration);\n}\n\nvoid CCBAnimationManager::runAnimations(const char *pName)\n{\n    runAnimationsForSequenceNamed(pName);\n}\n    \nvoid CCBAnimationManager::runAnimations(int nSeqId, float fTweenDuraiton)\n{\n    runAnimationsForSequenceIdTweenDuration(nSeqId, fTweenDuraiton);\n}\n\nvoid CCBAnimationManager::runAnimationsForSequenceIdTweenDuration(int nSeqId, float fTweenDuration)\n{\n    CCASSERT(nSeqId != -1, \"Sequence id couldn't be found\");\n    \n    _rootNode->stopAllActions();\n    \n    for (auto nodeSeqIter = _nodeSequences.begin(); nodeSeqIter != _nodeSequences.end(); ++nodeSeqIter)\n    {\n        Node *node = nodeSeqIter->first;\n        node->stopAllActions();\n        \n        // Refer to CCBReader::readKeyframe() for the real type of value\n        auto seqs = nodeSeqIter->second;\n        auto seqNodeProps = seqs[nSeqId];\n        \n        std::set<std::string> seqNodePropNames;\n        \n        if (!seqNodeProps.empty())\n        {\n            // Reset nodes that have sequence node properties, and run actions on them\n            for (auto iter = seqNodeProps.begin(); iter != seqNodeProps.end(); ++iter)\n            {\n                const std::string propName = iter->first;\n                CCBSequenceProperty *seqProp = iter->second;\n                seqNodePropNames.insert(propName);\n                \n                setFirstFrame(node, seqProp, fTweenDuration);\n                runAction(node, seqProp, fTweenDuration);\n            }\n        }\n        \n        // Reset the nodes that may have been changed by other timelines\n        auto& nodeBaseValues = _baseValues[node];\n        \n        if (!nodeBaseValues.empty())\n        {\n            for (auto iter = nodeBaseValues.begin(); iter != nodeBaseValues.end(); ++iter)\n            {\n                if (seqNodePropNames.find(iter->first) == seqNodePropNames.end())\n                {\n                    setAnimatedProperty(iter->first, node, iter->second, nullptr, fTweenDuration);\n                }\n            }\n        }\n        \n        auto& nodeObject = _objects[node];\n        \n        if (!nodeObject.empty())\n        {\n            for (auto iter = nodeObject.begin(); iter != nodeObject.end(); ++iter)\n            {\n                if (seqNodePropNames.find(iter->first) == seqNodePropNames.end())\n                {\n                    setAnimatedProperty(iter->first, node, Value(), iter->second, fTweenDuration);\n                }\n            }\n        }\n    }\n    \n    // Make callback at end of sequence\n    CCBSequence *seq = getSequence(nSeqId);\n    Action *completeAction = Sequence::createWithTwoActions(DelayTime::create(seq->getDuration() + fTweenDuration),\n                                                                CallFunc::create( CC_CALLBACK_0(CCBAnimationManager::sequenceCompleted,this)));\n    _rootNode->runAction(completeAction);\n    \n    // Set the running scene\n\n    if(seq->getCallbackChannel() != nullptr) {\n        Action* action = (Action *)actionForCallbackChannel(seq->getCallbackChannel());\n        if(action != nullptr) {\n            _rootNode->runAction(action);\n        }\n    } \n\n    if(seq->getSoundChannel() != nullptr) {\n        Action* action = (Action *)actionForSoundChannel(seq->getSoundChannel());\n        if(action != nullptr) {\n            _rootNode->runAction(action);\n        }\n    }\n\n    _runningSequence = getSequence(nSeqId);\n}\n\nvoid CCBAnimationManager::runAnimationsForSequenceNamedTweenDuration(const char *pName, float fTweenDuration)\n{\n    int seqId = getSequenceId(pName);\n    runAnimationsForSequenceIdTweenDuration(seqId, fTweenDuration);\n}\n\nvoid CCBAnimationManager::runAnimationsForSequenceNamed(const char *pName)\n{\n    runAnimationsForSequenceNamedTweenDuration(pName, 0);\n}\n\nvoid CCBAnimationManager::debug()\n{\n    \n}\n\nvoid CCBAnimationManager::setAnimationCompletedCallback(Object *target, SEL_CallFunc callbackFunc) {\n    if (target)\n    {\n        target->retain();\n    }\n    \n    if (_target)\n    {\n        _target->release();\n    }\n    \n    _target = target;\n    _animationCompleteCallbackFunc = callbackFunc;\n}\n\nvoid CCBAnimationManager::setCallFunc(CallFunc* callFunc, const std::string &callbackNamed)\n{\n    _keyframeCallFuncs.insert(callbackNamed, callFunc);\n}\n\nvoid CCBAnimationManager::sequenceCompleted()\n{\n    const char *runningSequenceName = _runningSequence->getName();\n    int nextSeqId = _runningSequence->getChainedSequenceId();\n    _runningSequence = nullptr;\n    \n    if(_lastCompletedSequenceName != runningSequenceName) {\n        _lastCompletedSequenceName = runningSequenceName;\n    }\n    \n    if (nextSeqId != -1)\n    {\n        runAnimationsForSequenceIdTweenDuration(nextSeqId, 0);\n    }\n    \n    if (_delegate)\n    {\n        // There may be another runAnimation() call in this delegate method\n        // which will assign _runningSequence\n        _delegate->completedAnimationSequenceNamed(runningSequenceName);\n    }\n    \n    if (_target && _animationCompleteCallbackFunc) {\n        (_target->*_animationCompleteCallbackFunc)();\n    }\n}\n\n// Custom actions\n\n/************************************************************\n CCBSetSpriteFrame\n ************************************************************/\n\nCCBSetSpriteFrame* CCBSetSpriteFrame::create(SpriteFrame *pSpriteFrame)\n{\n    CCBSetSpriteFrame *ret = new CCBSetSpriteFrame();\n    if (ret)\n    {\n        if (ret->initWithSpriteFrame(pSpriteFrame))\n        {\n            ret->autorelease();\n        }\n        else \n        {\n            CC_SAFE_DELETE(ret);\n        }\n    }\n    \n    return ret;\n}\n\nbool CCBSetSpriteFrame::initWithSpriteFrame(SpriteFrame *pSpriteFrame)\n{\n    _spriteFrame = pSpriteFrame;\n    CC_SAFE_RETAIN(_spriteFrame);\n    \n    return true;\n}\n\nCCBSetSpriteFrame::~CCBSetSpriteFrame()\n{\n    CC_SAFE_RELEASE_NULL(_spriteFrame);\n}\n\nCCBSetSpriteFrame* CCBSetSpriteFrame::clone() const\n{\n\t// no copy constructor\n\tauto a = new CCBSetSpriteFrame();\n    a->initWithSpriteFrame(_spriteFrame);\n\ta->autorelease();\n\treturn a;\n}\n\nCCBSetSpriteFrame* CCBSetSpriteFrame::reverse() const\n{\n\t// returns a copy of itself\n\treturn this->clone();\n}\n\nvoid CCBSetSpriteFrame::update(float time)\n{\n    static_cast<Sprite*>(_target)->setSpriteFrame(_spriteFrame);\n}\n\n\n/************************************************************\n CCBSoundEffect\n ************************************************************/\n\nCCBSoundEffect* CCBSoundEffect::actionWithSoundFile(const std::string &filename, float pitch, float pan, float gain) {\n  CCBSoundEffect* pRet = new CCBSoundEffect();\n  if (pRet != nullptr && pRet->initWithSoundFile(filename, pitch, pan, gain))\n    {\n      pRet->autorelease();\n    }\n  else\n    {\n      CC_SAFE_DELETE(pRet);\n    }\n  return pRet;\n}\n\n\nCCBSoundEffect::~CCBSoundEffect()\n{\n}\n\nbool CCBSoundEffect::initWithSoundFile(const std::string &filename, float pitch, float pan, float gain) {\n    _soundFile = filename;\n    _pitch = pitch;\n    _pan = pan;\n    _gain = gain;\n    return true;\n}\n\nCCBSoundEffect* CCBSoundEffect::clone() const\n{\n\t// no copy constructor\n\tauto a = new CCBSoundEffect();\n    a->initWithSoundFile(_soundFile, _pitch, _pan, _gain);\n\ta->autorelease();\n\treturn a;\n}\n\nCCBSoundEffect* CCBSoundEffect::reverse() const\n{\n\t// returns a copy of itself\n\treturn this->clone();\n}\n\nvoid CCBSoundEffect::update(float time)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(_soundFile.c_str());\n}\n\n\n/************************************************************\n CCBRotateTo\n ************************************************************/\n\nCCBRotateTo* CCBRotateTo::create(float fDuration, float fAngle)\n{\n    CCBRotateTo *ret = new CCBRotateTo();\n    if (ret)\n    {\n        if (ret->initWithDuration(fDuration, fAngle))\n        {\n            ret->autorelease();\n        }\n        else \n        {\n            CC_SAFE_DELETE(ret);\n        }\n    }\n    \n    return ret;\n}\n\nbool CCBRotateTo::initWithDuration(float fDuration, float fAngle)\n{\n    if (ActionInterval::initWithDuration(fDuration))\n    {\n        _dstAngle = fAngle;\n        \n        return true;\n    }\n    else \n    {\n        return false;\n    }\n}\n\nCCBRotateTo* CCBRotateTo::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new CCBRotateTo();\n    a->initWithDuration(_duration, _dstAngle);\n\ta->autorelease();\n\treturn a;\n}\n\nCCBRotateTo* CCBRotateTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() is not supported in CCBRotateTo\");\n\treturn nullptr;\n}\n\nvoid CCBRotateTo::startWithTarget(Node *pNode)\n{\n    ActionInterval::startWithTarget(pNode);\n    _startAngle = _target->getRotation();\n    _diffAngle = _dstAngle - _startAngle;\n}\n\nvoid CCBRotateTo::update(float time)\n{\n    _target->setRotation(_startAngle + (_diffAngle * time))\n    ;\n}\n\n\n\n\n/************************************************************\n CCBRotateXTO\n ************************************************************/\n\n\nCCBRotateXTo* CCBRotateXTo::create(float fDuration, float fAngle)\n{\n    CCBRotateXTo *ret = new CCBRotateXTo();\n    if (ret)\n    {\n        if (ret->initWithDuration(fDuration, fAngle))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(ret);\n        }\n    }\n    \n    return ret;\n}\n\nbool CCBRotateXTo::initWithDuration(float fDuration, float fAngle)\n{\n    if (ActionInterval::initWithDuration(fDuration))\n    {\n        _dstAngle = fAngle;\n        \n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\n\nvoid CCBRotateXTo::startWithTarget(Node *pNode)\n{\n    //CCActionInterval::startWithTarget(pNode);\n    _originalTarget = pNode;\n    _target = pNode;\n    _elapsed = 0.0f;\n    _firstTick = true;\n    _startAngle = _target->getRotationX();\n    _diffAngle = _dstAngle - _startAngle;\n}\n\nCCBRotateXTo* CCBRotateXTo::clone() const\n{\n\t// no copy constructor\n\tauto a = new CCBRotateXTo();\n    a->initWithDuration(_duration, _dstAngle);\n\ta->autorelease();\n\treturn a;\n}\n\nCCBRotateXTo* CCBRotateXTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() is not supported in CCBRotateXTo\");\n\treturn nullptr;\n}\n\nvoid CCBRotateXTo::update(float time)\n{\n    _target->setRotationX(_startAngle + (_diffAngle * time))\n    ;\n}\n\n\n\n/************************************************************\n CCBRotateYTO\n ************************************************************/\n\n\n\nCCBRotateYTo* CCBRotateYTo::create(float fDuration, float fAngle)\n{\n    CCBRotateYTo *ret = new CCBRotateYTo();\n    if (ret)\n    {\n        if (ret->initWithDuration(fDuration, fAngle))\n        {\n            ret->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(ret);\n        }\n    }\n    \n    return ret;\n}\n\nbool CCBRotateYTo::initWithDuration(float fDuration, float fAngle)\n{\n    if (ActionInterval::initWithDuration(fDuration))\n    {\n        _dstAngle = fAngle;\n        \n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\nCCBRotateYTo* CCBRotateYTo::clone() const\n{\n\t// no copy constructor\n\tauto a = new CCBRotateYTo();\n    a->initWithDuration(_duration, _dstAngle);\n\ta->autorelease();\n\treturn a;\n}\n\nCCBRotateYTo* CCBRotateYTo::reverse() const\n{\n\tCCASSERT(false, \"reverse() is not supported in CCBRotateXTo\");\n\treturn nullptr;\n}\n\n\nvoid CCBRotateYTo::startWithTarget(Node *pNode)\n{\n //   ActionInterval::startWithTarget(pNode);\n    _originalTarget = pNode;\n    _target = pNode;\n    _elapsed = 0.0f;\n    _firstTick = true;\n    _startAngle = _target->getRotationY();\n    _diffAngle = _dstAngle - _startAngle;\n}\n\nvoid CCBRotateYTo::update(float time)\n{\n    _target->setRotationY(_startAngle + (_diffAngle * time))\n    ;\n}\n\n\n\n/************************************************************\n CCBEaseInstant\n ************************************************************/\nCCBEaseInstant* CCBEaseInstant::create(ActionInterval *pAction)\n{\n    CCBEaseInstant *pRet = new CCBEaseInstant();\n    if (pRet && pRet->initWithAction(pAction))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_RELEASE_NULL(pRet);\n    }\n    \n    return pRet;\n}\n\nCCBEaseInstant* CCBEaseInstant::clone() const\n{\n\t// no copy constructor\t\n\tauto a = new CCBEaseInstant();\n    a->initWithAction(_inner);\n\ta->autorelease();\n\treturn a;\n}\n\nCCBEaseInstant* CCBEaseInstant::reverse() const\n{\n\treturn CCBEaseInstant::create(_inner->reverse());\n}\n\nvoid CCBEaseInstant::update(float dt)\n{\n    if (dt < 0)\n    {\n        _inner->update(0);\n    }\n    else\n    {\n        _inner->update(1);\n    }\n}\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBAnimationManager.h",
    "content": "#ifndef __CCB_CCBANIMATION_MANAGER_H__\n#define __CCB_CCBANIMATION_MANAGER_H__\n\n#include \"CCMap.h\"\n#include \"CCActionInterval.h\"\n#include \"CCActionInstant.h\"\n#include \"CCActionEase.h\"\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCBSequence.h\"\n#include \"CCBSequenceProperty.h\"\n#include \"extensions/GUI/CCControlExtension/CCControl.h\"\n\nnamespace cocosbuilder {\n\nclass CCBAnimationManagerDelegate\n{\npublic:\n    virtual ~CCBAnimationManagerDelegate() {}\n    virtual void completedAnimationSequenceNamed(const char *name) = 0;\n};\n\nclass CCBAnimationManager : public cocos2d::Object\n{\npublic:\n    bool _jsControlled;\n    /**\n     * @js ctor\n     */\n    CCBAnimationManager();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~CCBAnimationManager();\n\n\n    cocos2d::Object *_owner;\n    \n    virtual bool init();\n    \n    cocos2d::Vector<CCBSequence*>& getSequences();\n    void setSequences(const cocos2d::Vector<CCBSequence*>& seq);\n\n    \n    int getAutoPlaySequenceId();\n    void setAutoPlaySequenceId(int autoPlaySequenceId);\n    \n    cocos2d::Node* getRootNode();\n    void setRootNode(cocos2d::Node* pRootNode); // weak reference    \n    \n\n    void addDocumentCallbackNode(cocos2d::Node *node);\n    void addDocumentCallbackName(std::string name);\n    void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType);\n    \n    void addDocumentOutletNode(cocos2d::Node *node);\n    void addDocumentOutletName(std::string name);\n\n    void setDocumentControllerName(const std::string &name);\n    \n    std::string getDocumentControllerName();\n    cocos2d::ValueVector& getDocumentCallbackNames();\n    cocos2d::Vector<cocos2d::Node*>& getDocumentCallbackNodes();\n    cocos2d::ValueVector& getDocumentCallbackControlEvents();\n    \n    cocos2d::ValueVector& getDocumentOutletNames();\n    cocos2d::Vector<cocos2d::Node*>& getDocumentOutletNodes();\n    std::string getLastCompletedSequenceName();\n    \n    cocos2d::ValueVector& getKeyframeCallbacks();\n    \n    const cocos2d::Size& getRootContainerSize();\n    void setRootContainerSize(const cocos2d::Size &rootContainerSize);\n    \n    CCBAnimationManagerDelegate* getDelegate();\n    void setDelegate(CCBAnimationManagerDelegate* pDelegate); // retain\n    \n    const char* getRunningSequenceName();\n    \n    const cocos2d::Size& getContainerSize(cocos2d::Node* pNode);\n    \n    void addNode(cocos2d::Node *pNode, const std::unordered_map<int, cocos2d::Map<std::string, CCBSequenceProperty*>>& seq);\n    void setBaseValue(const cocos2d::Value& value, cocos2d::Node *pNode, const std::string& propName);\n    void setObject(cocos2d::Object* obj, cocos2d::Node *pNode, const std::string& propName);\n    \n    void moveAnimationsFromNode(cocos2d::Node* fromNode, cocos2d::Node* toNode);\n\n    /** @deprecated This interface will be deprecated sooner or later.*/\n    CC_DEPRECATED_ATTRIBUTE void runAnimations(const char *pName, float fTweenDuration);\n    /** @deprecated This interface will be deprecated sooner or later.*/\n    CC_DEPRECATED_ATTRIBUTE void runAnimations(const char *pName);\n    /** @deprecated This interface will be deprecated sooner or later.*/\n    CC_DEPRECATED_ATTRIBUTE void runAnimations(int nSeqId, float fTweenDuraiton);\n\n    void runAnimationsForSequenceNamedTweenDuration(const char *pName, float fTweenDuration);\n    void runAnimationsForSequenceNamed(const char *pName);\n    void runAnimationsForSequenceIdTweenDuration(int nSeqId, float fTweenDuraiton);\n    /**\n     * when this function bound to js ,the second param are callfunc_selector\n     * @lua NA\n     */\n    void setAnimationCompletedCallback(cocos2d::Object *target, cocos2d::SEL_CallFunc callbackFunc);\n\n    void debug();\n    /**\n     * @js setCallFuncForJSCallbackNamed\n     */\n    void setCallFunc(cocos2d::CallFunc *callFunc, const std::string &callbackNamed);\n\n    cocos2d::Object* actionForCallbackChannel(CCBSequenceProperty* channel);\n    cocos2d::Object* actionForSoundChannel(CCBSequenceProperty* channel);\n\n\t// return -1 if timeline not exsit\n    int getSequenceId(const char* pSequenceName);\n    \n    // get timeline duration\n    float getSequenceDuration(const char* pSequenceName);\n    \nprivate:\n    const cocos2d::Value& getBaseValue(cocos2d::Node *pNode, const std::string& propName);\n    Object* getObject(cocos2d::Node *pNode, const std::string& propName);\n    \n    CCBSequence* getSequence(int nSequenceId);\n    cocos2d::ActionInterval* getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const std::string& propName, cocos2d::Node *pNode);\n    void setAnimatedProperty(const std::string& propName,cocos2d::Node *pNode, const cocos2d::Value& value, Object* obj, float fTweenDuraion);\n    void setFirstFrame(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);\n    cocos2d::ActionInterval* getEaseAction(cocos2d::ActionInterval *pAction, CCBKeyframe::EasingType easingType, float fEasingOpt);\n    void runAction(cocos2d::Node *pNode, CCBSequenceProperty *pSeqProp, float fTweenDuration);\n    void sequenceCompleted();\n    \nprivate:\n    cocos2d::Vector<CCBSequence*> _sequences;\n    std::unordered_map<cocos2d::Node*, std::unordered_map<int, cocos2d::Map<std::string, CCBSequenceProperty*>>> _nodeSequences;\n    std::unordered_map<cocos2d::Node*, std::unordered_map<std::string, cocos2d::Value>> _baseValues;\n    std::unordered_map<cocos2d::Node*, std::unordered_map<std::string, cocos2d::Object*>> _objects;\n    \n    int _autoPlaySequenceId;\n    \n    cocos2d::Node *_rootNode;\n    \n    cocos2d::Size _rootContainerSize;\n    \n    CCBAnimationManagerDelegate *_delegate;\n    CCBSequence *_runningSequence;\n    \n    cocos2d::ValueVector _documentOutletNames;\n    cocos2d::Vector<cocos2d::Node*> _documentOutletNodes;\n    cocos2d::ValueVector _documentCallbackNames;\n    cocos2d::Vector<cocos2d::Node*> _documentCallbackNodes;\n    cocos2d::ValueVector _documentCallbackControlEvents;\n    cocos2d::ValueVector _keyframeCallbacks;\n    cocos2d::Map<std::string, cocos2d::CallFunc*> _keyframeCallFuncs;\n    \n    std::string _documentControllerName;\n    std::string _lastCompletedSequenceName;\n    \n    cocos2d::SEL_CallFunc _animationCompleteCallbackFunc;\n    cocos2d::Object *_target;\n};\n\nclass CCBSetSpriteFrame : public cocos2d::ActionInstant\n{\npublic:\n    /** creates a Place action with a position */\n    static CCBSetSpriteFrame* create(cocos2d::SpriteFrame *pSpriteFrame);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~CCBSetSpriteFrame();\n    \n    bool initWithSpriteFrame(cocos2d::SpriteFrame *pSpriteFrame);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual CCBSetSpriteFrame* clone() const override;\n\tvirtual CCBSetSpriteFrame* reverse() const override;\n\nprivate:\n    cocos2d::SpriteFrame *_spriteFrame;\n};\n\n\nclass CCBSoundEffect : public cocos2d::ActionInstant\n{\npublic:\n    static CCBSoundEffect* actionWithSoundFile(const std::string &file, float pitch, float pan, float gain);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~CCBSoundEffect();\n    bool initWithSoundFile(const std::string &file, float pitch, float pan, float gain);\n\n    // Overrides\n    virtual void update(float time) override;\n\tvirtual CCBSoundEffect* clone() const override;\n\tvirtual CCBSoundEffect* reverse() const override;\n\nprivate:\n    std::string _soundFile;\n    float _pitch, _pan, _gain;\n};\n\n\nclass CCBRotateTo : public cocos2d::ActionInterval\n{\npublic:\n    static CCBRotateTo* create(float fDuration, float fAngle);\n    bool initWithDuration(float fDuration, float fAngle);\n\n    // Override\n    virtual void update(float time) override;\n\tvirtual CCBRotateTo* clone() const override;\n\tvirtual CCBRotateTo* reverse() const override;\n    virtual void startWithTarget(cocos2d::Node *pNode) override;\n\nprivate:\n    float _startAngle;\n    float _dstAngle;\n    float _diffAngle;\n};\n\n\nclass CCBRotateXTo: public cocos2d::ActionInterval\n{\npublic:\n    static CCBRotateXTo* create(float fDuration, float fAngle);\n    bool initWithDuration(float fDuration, float fAngle);\n\n    // Overrides\n    virtual void startWithTarget(cocos2d::Node *pNode) override;\n\tvirtual CCBRotateXTo* clone() const override;\n\tvirtual CCBRotateXTo* reverse() const override;\n    virtual void update(float time) override;\n\nprivate:\n    float _startAngle;\n    float _dstAngle;\n    float _diffAngle;\n};\n\n\nclass CCBRotateYTo: public cocos2d::ActionInterval\n{\npublic:\n    static CCBRotateYTo* create(float fDuration, float fAngle);\n    bool initWithDuration(float fDuration, float fAngle);\n\n    // Override\n    virtual void startWithTarget(cocos2d::Node *pNode) override;\n\tvirtual CCBRotateYTo* clone() const override;\n\tvirtual CCBRotateYTo* reverse() const override;\n    virtual void update(float time) override;\n\nprivate:\n    float _startAngle;\n    float _dstAngle;\n    float _diffAngle;\n};\n\n\nclass CCBEaseInstant : public cocos2d::ActionEase\n{\npublic:\n    static CCBEaseInstant* create(cocos2d::ActionInterval *pAction);\n\n\tvirtual CCBEaseInstant* clone() const override;\n\tvirtual CCBEaseInstant* reverse() const override;\n    virtual void update(float dt) override;\n};\n\n\n}\n\n#endif // __CCB_CCBANIMATION_MANAGER_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBFileLoader.cpp",
    "content": "#include \"CCBFileLoader.h\"\n\nusing namespace cocos2d;\n\n\nnamespace cocosbuilder {\n\n#define PROPERTY_CCBFILE \"ccbFile\"\n\nvoid CCBFileLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_CCBFILE) == 0) {\n        ((CCBFile*)pNode)->setCCBFileNode(pCCBFileNode);\n    } else {\n        NodeLoader::onHandlePropTypeCCBFile(pNode, pParent, pPropertyName, pCCBFileNode, ccbReader);\n    }\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBFileLoader.h",
    "content": "#ifndef _CCB_CCBFILELOADER_H_\n#define _CCB_CCBFILELOADER_H_\n\n#include \"CCNodeLoader.h\"\n#include \"CCBReader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass CCBFileLoader : public NodeLoader {\n    public:\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual ~CCBFileLoader() {};\n        /**\n         * @js NA\n         * @lua NA\n         */\n        CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCBFileLoader, loader);\n\n    protected:\n        CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBFile);\n\n        virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBKeyframe.cpp",
    "content": "#include \"CCBKeyframe.h\"\n\nusing namespace cocos2d;\n\nnamespace cocosbuilder {\n\nCCBKeyframe::CCBKeyframe()\n: _time(0.0f)\n, _easingType(EasingType::INSTANT)\n, _easingOpt(0.0f)\n, _object(nullptr)\n{}\n\nCCBKeyframe::~CCBKeyframe()\n{\n    CC_SAFE_RELEASE(_object);\n}\n\nconst Value& CCBKeyframe::getValue() const\n{\n    return _value;\n}\n\nvoid CCBKeyframe::setValue(const Value& value)\n{\n    _value = value;\n}\n    \nObject* CCBKeyframe::getObject() const\n{\n    return _object;\n}\n\nvoid CCBKeyframe::setObject(Object* obj)\n{\n    CC_SAFE_RETAIN(obj);\n    CC_SAFE_RELEASE(_object);\n    _object = obj;\n}\n\nfloat CCBKeyframe::getTime()\n{\n    return _time;\n}\n\nvoid CCBKeyframe::setTime(float fTime)\n{\n    _time = fTime;\n}\n\nCCBKeyframe::EasingType CCBKeyframe::getEasingType()\n{\n    return _easingType;\n}\n\nvoid CCBKeyframe::setEasingType(CCBKeyframe::EasingType easingType)\n{\n    _easingType = easingType;\n}\n\nfloat CCBKeyframe::getEasingOpt()\n{\n    return _easingOpt;\n}\n\nvoid CCBKeyframe::setEasingOpt(float fEasingOpt)\n{\n    _easingOpt = fEasingOpt;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBKeyframe.h",
    "content": "#ifndef __CCB_KEYFRAME_H__\n#define __CCB_KEYFRAME_H__\n\n#include \"CCObject.h\"\n#include \"CCValue.h\"\n\n\nnamespace cocosbuilder {\n\nclass CCBKeyframe : public cocos2d::Object\n{\npublic:\n    enum class EasingType\n    {\n        INSTANT,\n        \n        LINEAR,\n        \n        CUBIC_IN,\n        CUBIC_OUT,\n        CUBIC_INOUT,\n        \n        ELASTIC_IN,\n        ELASTIC_OUT,\n        ELASTIC_INOUT,\n        \n        BOUNCE_IN,\n        BOUNCE_OUT,\n        BOUNCE_INOUT,\n        \n        BACK_IN,\n        BACK_OUT,\n        BACK_INOUT,\n    };\n    /**\n     * @js ctor\n     */\n    CCBKeyframe();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~CCBKeyframe();\n    \n    const cocos2d::Value& getValue() const;\n    void setValue(const cocos2d::Value& value);\n    \n    cocos2d::Object* getObject() const;\n    void setObject(cocos2d::Object* obj);\n    \n    float getTime();\n    void setTime(float fTime);\n    \n    EasingType getEasingType();\n    void setEasingType(EasingType easingType);\n    \n    float getEasingOpt();\n    void setEasingOpt(float fEasingOpt);\n    \nprivate:\n    cocos2d::Value _value;\n    cocos2d::Object* _object;\n    float _time;\n    EasingType _easingType;\n    float _easingOpt;\n};\n\n}\n\n#endif // __CCB_KEYFRAME_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h",
    "content": "#ifndef _CCB_CCBMEMBERVARIABLEASSIGNER_H_\n#define _CCB_CCBMEMBERVARIABLEASSIGNER_H_\n\n\nnamespace cocosbuilder {\n\n#define CCB_MEMBERVARIABLEASSIGNER_GLUE(TARGET, MEMBERVARIABLENAME, MEMBERVARIABLETYPE, MEMBERVARIABLE) \\\n    if (pTarget == TARGET && 0 == strcmp(pMemberVariableName, (MEMBERVARIABLENAME))) { \\\n        MEMBERVARIABLETYPE pOldVar = MEMBERVARIABLE; \\\n        MEMBERVARIABLE = dynamic_cast<MEMBERVARIABLETYPE>(pNode); \\\n        CC_ASSERT(MEMBERVARIABLE); \\\n        if (pOldVar != MEMBERVARIABLE) { \\\n            CC_SAFE_RELEASE(pOldVar); \\\n            MEMBERVARIABLE->retain(); \\\n        } \\\n        return true; \\\n    }\n\n#define CCB_MEMBERVARIABLEASSIGNER_GLUE_WEAK(TARGET, MEMBERVARIABLENAME, MEMBERVARIABLETYPE, MEMBERVARIABLE) \\\n    if (pTarget == TARGET && 0 == strcmp(pMemberVariableName, MEMBERVARIABLENAME)) { \\\n        MEMBERVARIABLE = dynamic_cast<MEMBERVARIABLETYPE>(pNode); \\\n        CC_ASSERT(MEMBERVARIABLE); \\\n        return true; \\\n    }\n\nclass CCBMemberVariableAssigner {\n    public:\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual ~CCBMemberVariableAssigner() {};\n\n        /**\n         *  The callback function of assigning member variable.\n         *  @note The member variable must be Node or its subclass.\n         *  @param target               The custom class.\n         *  @param memberVariableName   The name of the member variable.\n         *  @param node                 The member variable.\n         *  @return Whether the assignment was successful.\n         */\n        virtual bool onAssignCCBMemberVariable(cocos2d::Object* target, const char* memberVariableName, cocos2d::Node* node) = 0;\n\n        /**\n         *  The callback function of assigning custom properties.\n         *  @note The member variable must be Integer, Float, Boolean or String.\n         *  @param target               The custom class.\n         *  @param memberVariableName   The name of the member variable.\n         *  @param value                The value of the property.\n         *  @return Whether the assignment was successful.\n         */\n        virtual bool onAssignCCBCustomProperty(cocos2d::Object* target, const char* memberVariableName, const cocos2d::Value& value) { return false; };\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBReader.cpp",
    "content": "#include <ctype.h>\n#include <algorithm>\n\n#include \"CCDirector.h\"\n#include \"platform/CCFileUtils.h\"\n#include \"CCScene.h\"\n#include \"CCTextureCache.h\"\n#include \"CCSpriteFrameCache.h\"\n\n#include \"CCBReader.h\"\n#include \"CCNodeLoader.h\"\n#include \"CCNodeLoaderLibrary.h\"\n#include \"CCNodeLoaderListener.h\"\n#include \"CCBMemberVariableAssigner.h\"\n#include \"CCBSelectorResolver.h\"\n#include \"CCBAnimationManager.h\"\n#include \"CCBSequenceProperty.h\"\n#include \"CCBKeyframe.h\"\n\n\n\nusing namespace std;\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\nnamespace cocosbuilder {;\n\n/*************************************************************************\n Implementation of CCBFile\n *************************************************************************/\n\nCCBFile::CCBFile():_CCBFileNode(nullptr) {}\n\nCCBFile* CCBFile::create()\n{\n    CCBFile *ret = new CCBFile();\n    \n    if (ret)\n    {\n        ret->autorelease();\n    }\n    \n    return ret;\n}\n\nNode* CCBFile::getCCBFileNode()\n{\n    return _CCBFileNode;\n}\n\nvoid CCBFile::setCCBFileNode(Node *pNode)\n{\n    CC_SAFE_RELEASE(_CCBFileNode);\n    _CCBFileNode = pNode;\n    CC_SAFE_RETAIN(_CCBFileNode);\n}\n\n/*************************************************************************\n Implementation of CCBReader\n *************************************************************************/\n\nCCBReader::CCBReader(NodeLoaderLibrary * pNodeLoaderLibrary, CCBMemberVariableAssigner * pCCBMemberVariableAssigner, CCBSelectorResolver * pCCBSelectorResolver, NodeLoaderListener * pNodeLoaderListener) \n: _data(nullptr)\n, _bytes(nullptr)\n, _currentByte(-1)\n, _currentBit(-1)\n, _owner(nullptr)\n, _animationManager(nullptr)\n, _animatedProps(nullptr)\n{\n    this->_nodeLoaderLibrary = pNodeLoaderLibrary;\n    this->_nodeLoaderLibrary->retain();\n    this->_CCBMemberVariableAssigner = pCCBMemberVariableAssigner;\n    this->_CCBSelectorResolver = pCCBSelectorResolver;\n    this->_nodeLoaderListener = pNodeLoaderListener;\n    init();\n}\n\nCCBReader::CCBReader(CCBReader * ccbReader) \n: _data(nullptr)\n, _bytes(nullptr)\n, _currentByte(-1)\n, _currentBit(-1)\n, _owner(nullptr)\n, _animationManager(nullptr)\n, _animatedProps(nullptr)\n{\n    this->_loadedSpriteSheets = ccbReader->_loadedSpriteSheets;\n    this->_nodeLoaderLibrary = ccbReader->_nodeLoaderLibrary;\n    this->_nodeLoaderLibrary->retain();\n\n    this->_CCBMemberVariableAssigner = ccbReader->_CCBMemberVariableAssigner;\n    this->_CCBSelectorResolver = ccbReader->_CCBSelectorResolver;\n    this->_nodeLoaderListener = ccbReader->_nodeLoaderListener;\n    \n    this->_CCBRootPath = ccbReader->getCCBRootPath();\n    \n    init();\n}\n\nCCBReader::CCBReader()\n: _data(nullptr)\n, _bytes(nullptr)\n, _currentByte(-1)\n, _currentBit(-1)\n, _owner(nullptr)\n, _animationManager(nullptr)\n, _nodeLoaderLibrary(nullptr)\n, _nodeLoaderListener(nullptr)\n, _CCBMemberVariableAssigner(nullptr)\n, _CCBSelectorResolver(nullptr)\n{\n    init();\n}\n\nCCBReader::~CCBReader()\n{\n    CC_SAFE_RELEASE_NULL(_owner);\n\n    this->_nodeLoaderLibrary->release();\n\n    _ownerOutletNames.clear();\n    _ownerCallbackNames.clear();\n    \n    // Clear string cache.\n    this->_stringCache.clear();\n\n    setAnimationManager(nullptr);\n}\n\nvoid CCBReader::setCCBRootPath(const char* ccbRootPath)\n{\n    CCASSERT(ccbRootPath != nullptr, \"\");\n    _CCBRootPath = ccbRootPath;\n}\n\nconst std::string& CCBReader::getCCBRootPath() const\n{\n    return _CCBRootPath;\n}\n\nbool CCBReader::init()\n{\n    // Setup action manager\n    CCBAnimationManager *pActionManager = new CCBAnimationManager();\n    setAnimationManager(pActionManager);\n    pActionManager->release();\n    \n    // Setup resolution scale and container size\n    _animationManager->setRootContainerSize(Director::getInstance()->getWinSize());\n    \n    return true;\n}\n\nCCBAnimationManager* CCBReader::getAnimationManager()\n{\n    return _animationManager;\n}\n\nvoid CCBReader::setAnimationManager(CCBAnimationManager *pAnimationManager)\n{\n    CC_SAFE_RELEASE(_animationManager);\n    _animationManager = pAnimationManager;\n    CC_SAFE_RETAIN(_animationManager);\n}\n\nCCBReader::CCBAnimationManagerMapPtr CCBReader::getAnimationManagers()\n{\n    return _animationManagers;\n}\n\nvoid CCBReader::setAnimationManagers(CCBAnimationManagerMapPtr x)\n{\n    _animationManagers = x;\n}\n\nCCBMemberVariableAssigner * CCBReader::getCCBMemberVariableAssigner() {\n    return this->_CCBMemberVariableAssigner;\n}\n\nCCBSelectorResolver * CCBReader::getCCBSelectorResolver() {\n    return this->_CCBSelectorResolver;\n}\n\nset<string>* CCBReader::getAnimatedProperties()\n{\n    return _animatedProps;\n}\n\nset<string>& CCBReader::getLoadedSpriteSheet()\n{\n    return _loadedSpriteSheets;\n}\n\nObject* CCBReader::getOwner()\n{\n    return _owner;\n}\n\nNode* CCBReader::readNodeGraphFromFile(const char *pCCBFileName)\n{\n    return this->readNodeGraphFromFile(pCCBFileName, nullptr);\n}\n\nNode* CCBReader::readNodeGraphFromFile(const char* pCCBFileName, Object* pOwner) \n{\n    return this->readNodeGraphFromFile(pCCBFileName, pOwner, Director::getInstance()->getWinSize());\n}\n\nNode* CCBReader::readNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize)\n{\n    if (nullptr == pCCBFileName || strlen(pCCBFileName) == 0)\n    {\n        return nullptr;\n    }\n\n    std::string strCCBFileName(pCCBFileName);\n    std::string strSuffix(\".ccbi\");\n    // Add ccbi suffix\n    if (!CCBReader::endsWith(strCCBFileName.c_str(), strSuffix.c_str()))\n    {\n        strCCBFileName += strSuffix;\n    }\n\n    std::string strPath = FileUtils::getInstance()->fullPathForFilename(strCCBFileName.c_str());\n\n    auto dataPtr = std::make_shared<Data>(FileUtils::getInstance()->getDataFromFile(strPath));\n    \n    Node *ret =  this->readNodeGraphFromData(dataPtr, pOwner, parentSize);\n    \n    return ret;\n}\n\nNode* CCBReader::readNodeGraphFromData(std::shared_ptr<cocos2d::Data> data, Object *pOwner, const Size &parentSize)\n{\n    _data = data;\n    _bytes =_data->getBytes();\n    _currentByte = 0;\n    _currentBit = 0;\n    _owner = pOwner;\n    CC_SAFE_RETAIN(_owner);\n\n    _animationManager->setRootContainerSize(parentSize);\n    _animationManager->_owner = _owner;\n    \n    Node *pNodeGraph = readFileWithCleanUp(true, std::make_shared<CCBAnimationManagerMap>());\n    \n    if (pNodeGraph && _animationManager->getAutoPlaySequenceId() != -1)\n    {\n        // Auto play animations\n        _animationManager->runAnimationsForSequenceIdTweenDuration(_animationManager->getAutoPlaySequenceId(), 0);\n    }\n    \n    // Assign actionManagers to userObject\n    for (auto iter = _animationManagers->begin(); iter != _animationManagers->end(); ++iter)\n    {\n        Node* pNode = iter->first;\n        CCBAnimationManager* manager = iter->second;\n        \n        pNode->setUserObject(manager);\n\n        if (_jsControlled)\n        {\n            _nodesWithAnimationManagers.pushBack(pNode);\n            _animationManagersForNodes.pushBack(manager);\n        }\n    }\n    \n    return pNodeGraph;\n}\n\nScene* CCBReader::createSceneWithNodeGraphFromFile(const char *pCCBFileName)\n{\n    return createSceneWithNodeGraphFromFile(pCCBFileName, nullptr);\n}\n\nScene* CCBReader::createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner)\n{\n    return createSceneWithNodeGraphFromFile(pCCBFileName, pOwner, Director::getInstance()->getWinSize());\n}\n\nScene* CCBReader::createSceneWithNodeGraphFromFile(const char *pCCBFileName, Object *pOwner, const Size &parentSize)\n{\n    Node *pNode = readNodeGraphFromFile(pCCBFileName, pOwner, parentSize);\n    Scene *pScene = Scene::create();\n    pScene->addChild(pNode);\n    \n    return pScene;\n}\n\nvoid CCBReader::cleanUpNodeGraph(Node *node)\n{\n    node->setUserObject(nullptr);\n    \n    auto& children = node->getChildren();\n    for(const auto &obj : children) {\n        cleanUpNodeGraph(obj);\n    }\n}\n\nNode* CCBReader::readFileWithCleanUp(bool bCleanUp, CCBAnimationManagerMapPtr am)\n{\n    if (! readHeader())\n    {\n        return nullptr;\n    }\n    \n    if (! readStringCache())\n    {\n        return nullptr;\n    }\n    \n    if (! readSequences())\n    {\n        return nullptr;\n    }\n    \n    setAnimationManagers(am);\n\n    Node *pNode = readNodeGraph(nullptr);\n\n    _animationManagers->insert(pNode, _animationManager);\n\n    if (bCleanUp)\n    {\n        cleanUpNodeGraph(pNode);\n    }\n    \n    return pNode;\n}\n\nbool CCBReader::readStringCache() {\n    int numStrings = this->readInt(false);\n\n    for(int i = 0; i < numStrings; i++) {\n        this->_stringCache.push_back(this->readUTF8());\n    }\n\n    return true;\n}\n\nbool CCBReader::readHeader()\n{\n    /* If no bytes loaded, don't crash about it. */\n    if(this->_bytes == nullptr) {\n        return false;\n    }\n\n    /* Read magic bytes */\n    int magicBytes = *((int*)(this->_bytes + this->_currentByte));\n    this->_currentByte += 4;\n\n    if(CC_SWAP_INT32_BIG_TO_HOST(magicBytes) != (*reinterpret_cast<const int*>(\"ccbi\"))) {\n        return false; \n    }\n\n    /* Read version. */\n    int version = this->readInt(false);\n    if(version != CCB_VERSION) {\n        log(\"WARNING! Incompatible ccbi file version (file: %d reader: %d)\", version, CCB_VERSION);\n        return false;\n    }\n\n    // Read JS check\n    _jsControlled = this->readBool();\n    _animationManager->_jsControlled = _jsControlled;\n\n    return true;\n}\n\nunsigned char CCBReader::readByte()\n{\n    unsigned char byte = this->_bytes[this->_currentByte];\n    this->_currentByte++;\n    return byte;\n}\n\nbool CCBReader::readBool()\n{\n    return 0 == this->readByte() ? false : true;\n}\n\nstd::string CCBReader::readUTF8()\n{\n    std::string ret;\n\n    int b0 = this->readByte();\n    int b1 = this->readByte();\n\n    int numBytes = b0 << 8 | b1;\n\n    char* pStr = (char*)malloc(numBytes+1);\n    memcpy(pStr, _bytes+_currentByte, numBytes);\n    pStr[numBytes] = '\\0';\n    ret = pStr;\n    free(pStr);\n\n    _currentByte += numBytes;\n\n    return ret;\n}\n\nbool CCBReader::getBit() {\n    bool bit;\n    unsigned char byte = *(this->_bytes + this->_currentByte);\n    if(byte & (1 << this->_currentBit)) {\n        bit = true;\n    } else {\n        bit = false;\n    }\n\n    this->_currentBit++;\n\n    if(this->_currentBit >= 8) {\n        this->_currentBit = 0;\n        this->_currentByte++;\n    }\n\n    return bit;\n}\n\nvoid CCBReader::alignBits() {\n    if(this->_currentBit) {\n        this->_currentBit = 0;\n        this->_currentByte++;\n    }\n}\n\nint CCBReader::readInt(bool pSigned) {\n    // Read encoded int\n    int numBits = 0;\n    while(!this->getBit()) {\n        numBits++;\n    }\n    \n    long long current = 0;\n    for(int a = numBits - 1; a >= 0; a--) {\n        if(this->getBit()) {\n            current |= 1LL << a;\n        }\n    }\n    current |= 1LL << numBits;\n    \n    int num;\n    if(pSigned) {\n        int s = current % 2;\n        if(s) {\n            num = static_cast<int>(current / 2);\n        } else {\n            num = static_cast<int>(-current / 2);\n        }\n    } else {\n        num = static_cast<int>(current - 1);\n    }\n    \n    this->alignBits();\n    \n    return num;\n}\n\n\nfloat CCBReader::readFloat()\n{\n    FloatType type = static_cast<FloatType>(this->readByte());\n    \n    switch (type)\n    {\n        case FloatType::_0:\n            return 0;    \n        case FloatType::_1:\n            return 1;\n        case FloatType::MINUS1:\n            return -1;\n        case FloatType::_05:\n            return 0.5f;\n        case FloatType::INTEGER:\n            return (float)this->readInt(true);\n        default:\n            {\n                /* using a memcpy since the compiler isn't\n                 * doing the float ptr math correctly on device.\n                 * TODO still applies in C++ ? */\n                unsigned char* pF = (this->_bytes + this->_currentByte);\n                float f = 0;\n                \n                // N.B - in order to avoid an unaligned memory access crash on 'memcpy()' the the (void*) casts of the source and\n                // destination pointers are EXTREMELY important for the ARM compiler.\n                //\n                // Without a (void*) cast, the ARM compiler makes the assumption that the float* pointer is naturally aligned\n                // according to it's type size (aligned along 4 byte boundaries) and thus tries to call a more optimized\n                // version of memcpy() which makes this alignment assumption also. When reading back from a file of course our pointers\n                // may not be aligned, hence we need to avoid the compiler making this assumption. The (void*) cast serves this purpose,\n                // and causes the ARM compiler to choose the slower, more generalized (unaligned) version of memcpy()\n                //\n                // For more about this compiler behavior, see:\n                // http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3934.html\n                memcpy((void*) &f, (const void*) pF, sizeof(float));\n                \n                this->_currentByte += sizeof(float);\n                return f;\n            }\n    }\n}\n\nstd::string CCBReader::readCachedString()\n{\n    int n = this->readInt(false);\n    return this->_stringCache[n];\n}\n\nNode * CCBReader::readNodeGraph(Node * pParent)\n{\n    /* Read class name. */\n    std::string className = this->readCachedString();\n\n    std::string _jsControlledName;\n    \n    if(_jsControlled) {\n        _jsControlledName = this->readCachedString();\n    }\n    \n    // Read assignment type and name\n    TargetType memberVarAssignmentType = static_cast<TargetType>(this->readInt(false));\n    std::string memberVarAssignmentName;\n    if(memberVarAssignmentType != TargetType::NONE)\n    {\n        memberVarAssignmentName = this->readCachedString();\n    }\n    \n    NodeLoader *ccNodeLoader = this->_nodeLoaderLibrary->getNodeLoader(className.c_str());\n     \n    if (! ccNodeLoader)\n    {\n        log(\"no corresponding node loader for %s\", className.c_str());\n        return nullptr;\n    }\n\n    Node *node = ccNodeLoader->loadNode(pParent, this);\n\n    // Set root node\n    if (! _animationManager->getRootNode())\n    {\n        _animationManager->setRootNode(node);\n    }\n    \n    // Assign controller\n    if(_jsControlled && node == _animationManager->getRootNode())\n    {\n        _animationManager->setDocumentControllerName(_jsControlledName);\n    }\n\n    // Read animated properties\n    std::unordered_map<int, Map<std::string, CCBSequenceProperty*>> seqs;\n    _animatedProps = new set<string>();\n    \n    int numSequence = readInt(false);\n    for (int i = 0; i < numSequence; ++i)\n    {\n        int seqId = readInt(false);\n        Map<std::string, CCBSequenceProperty*> seqNodeProps;\n        \n        int numProps = readInt(false);\n        \n        for (int j = 0; j < numProps; ++j)\n        {\n            CCBSequenceProperty *seqProp = new CCBSequenceProperty();\n            seqProp->autorelease();\n            \n            seqProp->setName(readCachedString().c_str());\n            seqProp->setType(readInt(false));\n            _animatedProps->insert(seqProp->getName());\n            \n            int numKeyframes = readInt(false);\n            \n            for (int k = 0; k < numKeyframes; ++k)\n            {\n                CCBKeyframe *keyframe = readKeyframe(static_cast<PropertyType>(seqProp->getType()));\n                \n                seqProp->getKeyframes().pushBack(keyframe);\n            }\n            \n            seqNodeProps.insert(seqProp->getName(), seqProp);\n        }\n        \n        seqs[seqId] = seqNodeProps;\n    }\n    \n    if (!seqs.empty())\n    {\n        _animationManager->addNode(node, seqs);\n    }\n    \n    // Read properties\n    ccNodeLoader->parseProperties(node, pParent, this);\n    \n    bool isCCBFileNode = (nullptr == dynamic_cast<CCBFile*>(node)) ? false : true;\n    // Handle sub ccb files (remove middle node)\n    if (isCCBFileNode)\n    {\n        CCBFile *ccbFileNode = (CCBFile*)node;\n        \n        Node *embeddedNode = ccbFileNode->getCCBFileNode();\n        embeddedNode->setPosition(ccbFileNode->getPosition());\n        embeddedNode->setRotation(ccbFileNode->getRotation());\n        embeddedNode->setScaleX(ccbFileNode->getScaleX());\n        embeddedNode->setScaleY(ccbFileNode->getScaleY());\n        embeddedNode->setTag(ccbFileNode->getTag());\n        embeddedNode->setVisible(true);\n        //embeddedNode->ignoreAnchorPointForPosition(ccbFileNode->isIgnoreAnchorPointForPosition());\n        \n        _animationManager->moveAnimationsFromNode(ccbFileNode, embeddedNode);\n\n        ccbFileNode->setCCBFileNode(nullptr);\n        \n        node = embeddedNode;\n    }\n\n#ifdef CCB_ENABLE_JAVASCRIPT\n    /*\n     if (memberVarAssignmentType && memberVarAssignmentName && ![memberVarAssignmentName isEqualToString:@\"\"])\n     {\n     [[JSCocoa sharedController] setObject:node withName:memberVarAssignmentName];\n     }*/\n#else\n    if (memberVarAssignmentType != TargetType::NONE)\n    {\n        if(!_jsControlled)\n        {\n            Object * target = nullptr;\n            if(memberVarAssignmentType == TargetType::DOCUMENT_ROOT)\n            {\n                target = _animationManager->getRootNode();\n            } \n            else if(memberVarAssignmentType == TargetType::OWNER)\n            {\n                target = this->_owner;\n            }\n            \n            if(target != nullptr)\n            {\n                CCBMemberVariableAssigner * targetAsCCBMemberVariableAssigner = dynamic_cast<CCBMemberVariableAssigner *>(target);\n                \n                bool assigned = false;\n                if (memberVarAssignmentType != TargetType::NONE)\n                {\n                    if(targetAsCCBMemberVariableAssigner != nullptr)\n                    {\n                        assigned = targetAsCCBMemberVariableAssigner->onAssignCCBMemberVariable(target, memberVarAssignmentName.c_str(), node);\n                    }\n                    \n                    if(!assigned && this->_CCBMemberVariableAssigner != nullptr)\n                    {\n                        assigned = this->_CCBMemberVariableAssigner->onAssignCCBMemberVariable(target, memberVarAssignmentName.c_str(), node);\n                    }\n                }\n            }\n        }\n        else\n        {\n            if(memberVarAssignmentType == TargetType::DOCUMENT_ROOT)\n            {\n                _animationManager->addDocumentOutletName(memberVarAssignmentName);\n                _animationManager->addDocumentOutletNode(node);\n            }\n            else\n            {\n                _ownerOutletNames.push_back(memberVarAssignmentName);\n                _ownerOutletNodes.pushBack(node);\n            }\n        }\n    }\n    \n    // Assign custom properties.\n    if (!ccNodeLoader->getCustomProperties().empty())\n    {\n        bool customAssigned = false;\n        \n        if(!_jsControlled)\n        {\n            Object * target = node;\n            if(target != nullptr)\n            {\n                CCBMemberVariableAssigner * targetAsCCBMemberVariableAssigner = dynamic_cast<CCBMemberVariableAssigner *>(target);\n                if(targetAsCCBMemberVariableAssigner != nullptr)\n                {\n                    auto& customPropeties = ccNodeLoader->getCustomProperties();\n                    \n                    for (auto iter = customPropeties.begin(); iter != customPropeties.end(); ++iter)\n                    {\n                        customAssigned = targetAsCCBMemberVariableAssigner->onAssignCCBCustomProperty(target, iter->first.c_str(), iter->second);\n\n                        if(!customAssigned && this->_CCBMemberVariableAssigner != nullptr)\n                        {\n                            customAssigned = this->_CCBMemberVariableAssigner->onAssignCCBCustomProperty(target, iter->first.c_str(), iter->second);\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n#endif // CCB_ENABLE_JAVASCRIPT\n    \n    delete _animatedProps;\n    _animatedProps = nullptr;\n\n    /* Read and add children. */\n    int numChildren = this->readInt(false);\n    for(int i = 0; i < numChildren; i++)\n    {\n        Node * child = this->readNodeGraph(node);\n        node->addChild(child);\n    }\n\n    // FIX ISSUE #1860: \"onNodeLoaded will be called twice if ccb was added as a CCBFile\".\n    // If it's a sub-ccb node, skip notification to NodeLoaderListener since it will be\n    // notified at LINE #734: Node * child = this->readNodeGraph(node);\n    if (!isCCBFileNode)\n    {\n        // Call onNodeLoaded\n        NodeLoaderListener * nodeAsNodeLoaderListener = dynamic_cast<NodeLoaderListener *>(node);\n        if(nodeAsNodeLoaderListener != nullptr)\n        {\n            nodeAsNodeLoaderListener->onNodeLoaded(node, ccNodeLoader);\n        }\n        else if(this->_nodeLoaderListener != nullptr)\n        {\n            this->_nodeLoaderListener->onNodeLoaded(node, ccNodeLoader);\n        }\n    }\n    return node;\n}\n\nCCBKeyframe* CCBReader::readKeyframe(PropertyType type)\n{\n    CCBKeyframe *keyframe = new CCBKeyframe();\n    keyframe->autorelease();\n    \n    keyframe->setTime(readFloat());\n    \n    CCBKeyframe::EasingType easingType = static_cast<CCBKeyframe::EasingType>(readInt(false));\n    float easingOpt = 0;\n    Value value;\n    \n    if (easingType == CCBKeyframe::EasingType::CUBIC_IN\n        || easingType == CCBKeyframe::EasingType::CUBIC_OUT\n        || easingType == CCBKeyframe::EasingType::CUBIC_INOUT\n        || easingType == CCBKeyframe::EasingType::ELASTIC_IN\n        || easingType == CCBKeyframe::EasingType::ELASTIC_OUT\n        || easingType == CCBKeyframe::EasingType::ELASTIC_INOUT)\n    {\n        easingOpt = readFloat();\n    }\n    keyframe->setEasingType(easingType);\n    keyframe->setEasingOpt(easingOpt);\n    \n    if (type == PropertyType::CHECK)\n    {\n        value = readBool();\n    }\n    else if (type == PropertyType::BYTE)\n    {\n        value = readByte();\n    }\n    else if (type == PropertyType::COLOR3)\n    {\n        unsigned char r = readByte();\n        unsigned char g = readByte();\n        unsigned char b = readByte();\n        \n        ValueMap colorMap;\n        colorMap[\"r\"] = r;\n        colorMap[\"g\"] = g;\n        colorMap[\"b\"] = b;\n        \n        value = colorMap;\n    }\n    else if (type == PropertyType::DEGREES)\n    {\n        value = readFloat();\n    }\n    else if (type == PropertyType::SCALE_LOCK || type == PropertyType::POSITION\n\t     || type == PropertyType::FLOAT_XY)\n    {\n        float a = readFloat();\n        float b = readFloat();\n        \n        ValueVector ab;\n        ab.push_back(Value(a));\n        ab.push_back(Value(b));\n        \n        value = ab;\n    }\n    else if (type == PropertyType::SPRITEFRAME)\n    {\n        std::string spriteSheet = readCachedString();\n        std::string spriteFile = readCachedString();\n        \n        SpriteFrame* spriteFrame;\n\n        if (spriteSheet.length() == 0)\n        {\n            spriteFile = _CCBRootPath + spriteFile;\n\n            Texture2D *texture = Director::getInstance()->getTextureCache()->addImage(spriteFile.c_str());\n            Rect bounds = Rect(0, 0, texture->getContentSize().width, texture->getContentSize().height);\n            \n            spriteFrame = SpriteFrame::createWithTexture(texture, bounds);\n        }\n        else\n        {\n            spriteSheet = _CCBRootPath + spriteSheet;\n            SpriteFrameCache* frameCache = SpriteFrameCache::getInstance();\n            \n            // Load the sprite sheet only if it is not loaded            \n            if (_loadedSpriteSheets.find(spriteSheet) == _loadedSpriteSheets.end())\n            {\n                frameCache->addSpriteFramesWithFile(spriteSheet.c_str());\n                _loadedSpriteSheets.insert(spriteSheet);\n            }\n            \n            spriteFrame = frameCache->getSpriteFrameByName(spriteFile.c_str());\n        }\n        \n        keyframe->setObject(spriteFrame);\n    }\n    \n    if (!value.isNull())\n        keyframe->setValue(value);\n    \n    return  keyframe;\n}\n\n\nbool CCBReader::readCallbackKeyframesForSeq(CCBSequence* seq)\n{\n    int numKeyframes = readInt(false);\n    if(!numKeyframes) return true;\n    \n    CCBSequenceProperty* channel = new CCBSequenceProperty();\n    channel->autorelease();\n\n    for(int i = 0; i < numKeyframes; ++i) {\n      \n        float time = readFloat();\n        std::string callbackName = readCachedString();\n      \n        int callbackType = readInt(false);\n      \n        ValueVector valueVector;\n        valueVector.push_back(Value(callbackName));\n        valueVector.push_back(Value(callbackType));\n        \n        CCBKeyframe* keyframe = new CCBKeyframe();\n        keyframe->autorelease();\n        \n        keyframe->setTime(time);\n        keyframe->setValue(Value(valueVector));\n        \n        if(_jsControlled) {\n            std::stringstream callbackIdentifier;\n            callbackIdentifier << callbackType;\n            callbackIdentifier << \":\" + callbackName;\n            _animationManager->getKeyframeCallbacks().push_back(Value(callbackIdentifier.str()));\n        }\n    \n        channel->getKeyframes().pushBack(keyframe);\n    }\n    \n    seq->setCallbackChannel(channel);\n    \n    return true;\n}\n\nbool CCBReader::readSoundKeyframesForSeq(CCBSequence* seq) {\n    int numKeyframes = readInt(false);\n    if(!numKeyframes) return true;\n    \n    CCBSequenceProperty* channel = new CCBSequenceProperty();\n    channel->autorelease();\n\n    for(int i = 0; i < numKeyframes; ++i) {\n        \n        float time = readFloat();\n        std::string soundFile = readCachedString();\n        float pitch = readFloat();\n        float pan = readFloat();\n        float gain = readFloat();\n        \n        ValueVector vec;\n        vec.push_back(Value(soundFile));\n        vec.push_back(Value(pitch));\n        vec.push_back(Value(pan));\n        vec.push_back(Value(gain));\n        \n        CCBKeyframe* keyframe = new CCBKeyframe();\n        keyframe->setTime(time);\n        keyframe->setValue(Value(vec));\n        channel->getKeyframes().pushBack(keyframe);\n        keyframe->release();\n    }\n    \n    seq->setSoundChannel(channel);\n    \n    return true;\n}\n\n\nNode * CCBReader::readNodeGraph() {\n    return this->readNodeGraph(nullptr);\n}\n\nbool CCBReader::readSequences()\n{\n    auto& sequences = _animationManager->getSequences();\n    \n    int numSeqs = readInt(false);\n    \n    for (int i = 0; i < numSeqs; i++)\n    {\n        CCBSequence *seq = new CCBSequence();\n        seq->autorelease();\n        \n        seq->setDuration(readFloat());\n        seq->setName(readCachedString().c_str());\n        seq->setSequenceId(readInt(false));\n        seq->setChainedSequenceId(readInt(true));\n        \n        if(!readCallbackKeyframesForSeq(seq)) return false;\n        if(!readSoundKeyframesForSeq(seq)) return false;\n        \n        sequences.pushBack(seq);\n    }\n    \n    _animationManager->setAutoPlaySequenceId(readInt(true));\n    return true;\n}\n\nstd::string CCBReader::lastPathComponent(const char* pPath) {\n    std::string path(pPath);\n    size_t slashPos = path.find_last_of(\"/\");\n    if(slashPos != std::string::npos) {\n        return path.substr(slashPos + 1, path.length() - slashPos);\n    }\n    return path;\n}\n\nstd::string CCBReader::deletePathExtension(const char* pPath) {\n    std::string path(pPath);\n    size_t dotPos = path.find_last_of(\".\");\n    if(dotPos != std::string::npos) {\n        return path.substr(0, dotPos);\n    }\n    return path;\n}\n\nstd::string CCBReader::toLowerCase(const char* pString) {\n    std::string copy(pString);\n    std::transform(copy.begin(), copy.end(), copy.begin(), ::tolower);\n    return copy;\n}\n\nbool CCBReader::endsWith(const char* pString, const char* pEnding) {\n    std::string string(pString);\n    std::string ending(pEnding);\n    if(string.length() >= ending.length()) {\n        return (string.compare(string.length() - ending.length(), ending.length(), ending) == 0);\n    } else {\n        return false;\n    }\n}\n\nbool CCBReader::isJSControlled()\n{\n    return _jsControlled;\n}\n\nvoid CCBReader::addOwnerCallbackName(const std::string& name)\n{\n    _ownerCallbackNames.push_back(name);\n}\n\nvoid CCBReader::addOwnerCallbackNode(Node *node)\n{\n    _ownerCallbackNodes.pushBack(node);\n}\n\nvoid CCBReader::addOwnerCallbackControlEvents(Control::EventType type)\n{\n    _ownerOwnerCallbackControlEvents.push_back(Value((int)type));\n}\n\nvoid CCBReader::addDocumentCallbackName(const std::string& name)\n{\n    _animationManager->addDocumentCallbackName(name);\n}\n\nvoid CCBReader::addDocumentCallbackNode(Node *node)\n{\n    _animationManager->addDocumentCallbackNode(node);\n}\n\nvoid CCBReader::addDocumentCallbackControlEvents(Control::EventType eventType)\n{\n    _animationManager->addDocumentCallbackControlEvents(eventType);\n}\n\nValueVector CCBReader::getOwnerCallbackNames()\n{\n    ValueVector ret;\n    ret.reserve(_ownerCallbackNames.size());\n    \n    std::vector<std::string>::iterator it = _ownerCallbackNames.begin();\n    for (; it != _ownerCallbackNames.end(); ++it)\n    {\n        ret.push_back(Value(*it));\n    }\n    \n    return ret;\n}\n\nVector<Node*>& CCBReader::getOwnerCallbackNodes()\n{\n    return _ownerCallbackNodes;\n}\n\nValueVector& CCBReader::getOwnerCallbackControlEvents()\n{\n    return _ownerOwnerCallbackControlEvents;\n}\n\nValueVector CCBReader::getOwnerOutletNames()\n{\n    ValueVector ret;\n    ret.reserve(_ownerOutletNames.size());\n    std::vector<std::string>::iterator it = _ownerOutletNames.begin();\n    for (; it != _ownerOutletNames.end(); ++it)\n    {\n        ret.push_back(Value(*it));\n    }\n    return ret;\n}\n\nVector<Node*>& CCBReader::getOwnerOutletNodes()\n{\n    return _ownerOutletNodes;\n}\n\nVector<Node*>& CCBReader::getNodesWithAnimationManagers()\n{\n    return _nodesWithAnimationManagers;\n}\n\nVector<CCBAnimationManager*>& CCBReader::getAnimationManagersForNodes()\n{\n    return _animationManagersForNodes;\n}\n\nvoid CCBReader::addOwnerOutletName(std::string name)\n{\n    _ownerOutletNames.push_back(name);\n}\n\nvoid CCBReader::addOwnerOutletNode(Node *node)\n{\n    if (nullptr == node)\n        return;\n    \n    _ownerOutletNodes.pushBack(node);\n}\n\n/************************************************************************\n Static functions\n ************************************************************************/\n\nstatic float __ccbResolutionScale = 1.0f;\n\nfloat CCBReader::getResolutionScale()\n{\n    return __ccbResolutionScale;\n}\n\nvoid CCBReader::setResolutionScale(float scale)\n{\n    __ccbResolutionScale = scale;\n}\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBReader.h",
    "content": "#ifndef _CCB_CCBREADER_H_\n#define _CCB_CCBREADER_H_\n\n#include <string>\n#include <vector>\n#include \"CCNode.h\"\n#include \"CCData.h\"\n#include \"CCMap.h\"\n\n#include \"CCBSequence.h\"\n#include \"extensions/GUI/CCControlExtension/CCControl.h\"\n\n#define CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(T, METHOD) static T * METHOD() { \\\n    T * ptr = new T(); \\\n    if(ptr != NULL) { \\\n        ptr->autorelease(); \\\n        return ptr; \\\n    } \\\n    CC_SAFE_DELETE(ptr); \\\n    return NULL; \\\n}\n\n#define CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(T, METHOD) static T * METHOD() { \\\n    T * ptr = new T(); \\\n    if(ptr != NULL && ptr->init()) { \\\n        ptr->autorelease(); \\\n        return ptr; \\\n    } \\\n    CC_SAFE_DELETE(ptr); \\\n    return NULL; \\\n}\n\n#define CCB_VERSION 5\n\nnamespace cocosbuilder {\n\n/**\n * @addtogroup cocosbuilder\n * @{\n */\n\nclass CCBFile : public cocos2d::Node\n{\nprivate:\n    cocos2d::Node *_CCBFileNode;\n    \npublic:\n    CCBFile();\n    \n    static CCBFile* create();\n    \n    cocos2d::Node* getCCBFileNode();\n    void setCCBFileNode(Node *pNode); // retain\n};\n\n/* Forward declaration. */\nclass NodeLoader;\nclass NodeLoaderLibrary;\nclass NodeLoaderListener;\nclass CCBMemberVariableAssigner;\nclass CCBSelectorResolver;\nclass CCBAnimationManager;\nclass CCBKeyframe;\n\n/**\n * @brief Parse CCBI file which is generated by CocosBuilder\n */\nclass CCBReader : public cocos2d::Object \n{\npublic:\n    enum class PropertyType {\n        POSITION = 0,\n        SIZE,\n        POINT,\n        POINT_LOCK,\n        SCALE_LOCK,\n        DEGREES,\n        INTEGER,\n        FLOAT,\n        FLOAT_VAR,\n        CHECK,\n        SPRITEFRAME,\n        TEXTURE,\n        BYTE,\n        COLOR3,\n        COLOR4F_VAR,\n        FLIP,\n        BLEND_MODE,\n        FNT_FILE,\n        TEXT,\n        FONT_TTF,\n        INTEGER_LABELED,\n        BLOCK,\n        ANIMATION,\n        CCB_FILE,\n        STRING,\n        BLOCK_CONTROL,\n        FLOAT_SCALE,\n        FLOAT_XY\n    };\n    \n    enum class FloatType {\n        _0 = 0,\n        _1,\n        MINUS1,\n        _05,\n        INTEGER,\n        FULL\n    };\n    \n    enum class PlatformType {\n        ALL = 0,\n        IOS,\n        MAC\n    };\n    \n    enum class TargetType {\n        NONE = 0,\n        DOCUMENT_ROOT = 1,\n        OWNER = 2,\n    };\n    \n    enum class PositionType\n    {\n        RELATIVE_BOTTOM_LEFT,\n        RELATIVE_TOP_LEFT,\n        RELATIVE_TOP_RIGHT,\n        RELATIVE_BOTTOM_RIGHT,\n        PERCENT,\n        MULTIPLY_RESOLUTION,\n    };\n    \n    enum class SizeType\n    {\n        ABSOLUTE,\n        PERCENT,\n        RELATIVE_CONTAINER,\n        HORIZONTAL_PERCENT,\n        VERTICAL_PERCENT,\n        MULTIPLY_RESOLUTION,\n    };\n    \n    enum class ScaleType\n    {\n        ABSOLUTE,\n        MULTIPLY_RESOLUTION\n    };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCBReader(NodeLoaderLibrary *pNodeLoaderLibrary, CCBMemberVariableAssigner *pCCBMemberVariableAssigner = NULL, CCBSelectorResolver *pCCBSelectorResolver = NULL, NodeLoaderListener *pNodeLoaderListener = NULL);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCBReader(CCBReader *ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~CCBReader();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCBReader();\n   \n    void setCCBRootPath(const char* ccbRootPath);\n    const std::string& getCCBRootPath() const;\n\n    cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName);\n    cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner);\n    cocos2d::Node* readNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    cocos2d::Node* readNodeGraphFromData(std::shared_ptr<cocos2d::Data> data, cocos2d::Object *pOwner, const cocos2d::Size &parentSize);\n   \n    /**\n     @lua NA\n     */\n    cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName);\n    /**\n     @lua NA\n     */\n    cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner);\n    /**\n     @lua NA\n     */\n    cocos2d::Scene* createSceneWithNodeGraphFromFile(const char *pCCBFileName, cocos2d::Object *pOwner, const cocos2d::Size &parentSize);\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCBMemberVariableAssigner* getCCBMemberVariableAssigner();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCBSelectorResolver* getCCBSelectorResolver();\n    \n    /**\n     * @js getActionManager\n     * @lua getActionManager\n     */\n    CCBAnimationManager* getAnimationManager();\n    /**\n     * @js setActionManager\n     * @lua setActionManager\n     */\n    void setAnimationManager(CCBAnimationManager *pAnimationManager);\n    \n    /**  Used in NodeLoader::parseProperties()\n     * @js NA\n     * @lua NA\n     */\n    std::set<std::string>* getAnimatedProperties();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    std::set<std::string>& getLoadedSpriteSheet();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    cocos2d::Object* getOwner();\n\n    /* Utility methods. \n     * @js NA\n     * @lua NA\n     */\n    static std::string lastPathComponent(const char* pString);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static std::string deletePathExtension(const char* pString);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static std::string toLowerCase(const char* pString);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static bool endsWith(const char* pString, const char* pEnding);\n\n    /* Parse methods. \n     * @js NA\n     * @lua NA\n     */\n    int readInt(bool pSigned);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    unsigned char readByte();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool readBool();\n    std::string readUTF8();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    float readFloat();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    std::string readCachedString();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool isJSControlled();\n    \n    bool readCallbackKeyframesForSeq(CCBSequence* seq);\n    bool readSoundKeyframesForSeq(CCBSequence* seq);\n    \n    cocos2d::ValueVector getOwnerCallbackNames();\n    cocos2d::Vector<cocos2d::Node*>& getOwnerCallbackNodes();\n    cocos2d::ValueVector& getOwnerCallbackControlEvents();\n    \n    cocos2d::ValueVector getOwnerOutletNames();\n    cocos2d::Vector<cocos2d::Node*>& getOwnerOutletNodes();\n    cocos2d::Vector<cocos2d::Node*>& getNodesWithAnimationManagers();\n    cocos2d::Vector<CCBAnimationManager*>& getAnimationManagersForNodes();\n    \n    typedef cocos2d::Map<cocos2d::Node*, CCBAnimationManager*> CCBAnimationManagerMap;\n    typedef std::shared_ptr<CCBAnimationManagerMap> CCBAnimationManagerMapPtr;\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCBAnimationManagerMapPtr getAnimationManagers();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setAnimationManagers(CCBAnimationManagerMapPtr x);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void addOwnerCallbackName(const std::string& name);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void addOwnerCallbackNode(cocos2d::Node *node);\n    void addOwnerCallbackControlEvents(cocos2d::extension::Control::EventType type);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void addDocumentCallbackName(const std::string& name);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void addDocumentCallbackNode(cocos2d::Node *node);\n    void addDocumentCallbackControlEvents(cocos2d::extension::Control::EventType eventType);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static float getResolutionScale();\n    static void setResolutionScale(float scale);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    cocos2d::Node* readFileWithCleanUp(bool bCleanUp, CCBAnimationManagerMapPtr am);\n    \n    void addOwnerOutletName(std::string name);\n    void addOwnerOutletNode(cocos2d::Node *node);\n\nprivate:\n    void cleanUpNodeGraph(cocos2d::Node *pNode);\n    bool readSequences();\n    CCBKeyframe* readKeyframe(PropertyType type);\n    \n    bool readHeader();\n    bool readStringCache();\n    //void readStringCacheEntry();\n    cocos2d::Node* readNodeGraph();\n    cocos2d::Node* readNodeGraph(cocos2d::Node * pParent);\n\n    bool getBit();\n    void alignBits();\n\n    bool init();\n    \n    friend class NodeLoader;\n\nprivate:\n    std::shared_ptr<cocos2d::Data> _data;\n    unsigned char *_bytes;\n    int _currentByte;\n    int _currentBit;\n    \n    std::vector<std::string> _stringCache;\n    std::set<std::string> _loadedSpriteSheets;\n    \n    cocos2d::Object *_owner;\n    \n    CCBAnimationManager* _animationManager; //retain\n    CCBAnimationManagerMapPtr _animationManagers;\n    \n    std::set<std::string> *_animatedProps;\n    \n    NodeLoaderLibrary *_nodeLoaderLibrary;\n    NodeLoaderListener *_nodeLoaderListener;\n    CCBMemberVariableAssigner *_CCBMemberVariableAssigner;\n    CCBSelectorResolver *_CCBSelectorResolver;\n    \n    std::vector<std::string> _ownerOutletNames;\n    cocos2d::Vector<cocos2d::Node*> _ownerOutletNodes;\n    cocos2d::Vector<cocos2d::Node*> _nodesWithAnimationManagers;\n    cocos2d::Vector<CCBAnimationManager*> _animationManagersForNodes;\n    \n    std::vector<std::string> _ownerCallbackNames;\n    cocos2d::Vector<cocos2d::Node*> _ownerCallbackNodes;\n    cocos2d::ValueVector _ownerOwnerCallbackControlEvents;\n    std::string _CCBRootPath;\n    \n    bool _jsControlled;\n};\n\n// end of effects group\n/// @}\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBSelectorResolver.h",
    "content": "#ifndef _CCB_CCBSELECTORRESOLVER_H_\n#define _CCB_CCBSELECTORRESOLVER_H_\n\n#include \"extensions//GUI/CCControlExtension/CCInvocation.h\"\n\n\nnamespace cocosbuilder {\n\n#define CCB_SELECTORRESOLVER_CCMENUITEM_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \\\n    return menu_selector(METHOD); \\\n}\n\n#define CCB_SELECTORRESOLVER_CCCONTROL_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \\\n    return cccontrol_selector(METHOD); \\\n}\n\n#define CCB_SELECTORRESOLVER_CALLFUNC_GLUE(TARGET, SELECTORNAME, METHOD) if(pTarget == TARGET && strcmp(pSelectorName, SELECTORNAME) == 0) { \\\n    return callfuncN_selector(METHOD); \\\n}\n\nclass CCBSelectorResolver {\n    public:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~CCBSelectorResolver() {};\n    virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0;\n    virtual cocos2d::SEL_CallFuncN onResolveCCBCCCallFuncSelector(cocos2d::Object * pTarget, const char* pSelectorName) { return NULL; };\n    virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget, const char* pSelectorName) = 0;\n};\n\n\nclass CCBScriptOwnerProtocol {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~CCBScriptOwnerProtocol() {};\n    virtual CCBSelectorResolver * createNew() = 0;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBSequence.cpp",
    "content": "#include \"CCBSequence.h\"\n\nusing namespace cocos2d;\nusing namespace std;\n\n\nnamespace cocosbuilder {\n\nCCBSequence::CCBSequence()\n: _duration(0.0f)\n, _name(\"\")\n, mSequenceId(0)\n, mChainedSequenceId(0)\n, mCallbackChannel(NULL)\n, mSoundChannel(NULL)\n{}\n\nCCBSequence::~CCBSequence() {\n    CC_SAFE_RELEASE(mCallbackChannel);\n    CC_SAFE_RELEASE(mSoundChannel);\n}\n\nfloat CCBSequence::getDuration()\n{\n    return _duration;\n}\n\nvoid CCBSequence::setDuration(float fDuration)\n{\n    _duration = fDuration;\n}\n\nconst char* CCBSequence::getName()\n{\n    return _name.c_str();\n}\n\nvoid CCBSequence::setName(const char *pName)\n{\n    _name = pName;\n}\n\nint CCBSequence::getSequenceId()\n{\n    return mSequenceId;\n}\n\nvoid CCBSequence::setSequenceId(int nSequenceId)\n{\n    mSequenceId = nSequenceId;\n}\n\nCCBSequenceProperty* CCBSequence::getCallbackChannel()\n{\n    return mCallbackChannel;\n}\n\nvoid CCBSequence::setCallbackChannel(CCBSequenceProperty* callbackChannel)\n{\n    CC_SAFE_RELEASE(mCallbackChannel);\n    mCallbackChannel = callbackChannel;\n    CC_SAFE_RETAIN(mCallbackChannel);\n}\n\n\nCCBSequenceProperty* CCBSequence::getSoundChannel()\n{\n    return mSoundChannel;\n}\n\nvoid CCBSequence::setSoundChannel(CCBSequenceProperty* soundChannel)\n{\n    CC_SAFE_RELEASE(mSoundChannel);\n    mSoundChannel = soundChannel;\n    CC_SAFE_RETAIN(mSoundChannel);\n}\n\n\nint CCBSequence::getChainedSequenceId()\n{\n    return mChainedSequenceId;\n}\n\nvoid CCBSequence::setChainedSequenceId(int nChainedSequenceId)\n{\n    mChainedSequenceId = nChainedSequenceId;\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBSequence.h",
    "content": "#ifndef __CCB_CCSEQUENCE_H__\n#define __CCB_CCSEQUENCE_H__\n\n#include <string>\n\n#include \"CCObject.h\"\n#include \"CCBSequenceProperty.h\"\n\nnamespace cocosbuilder {\n\nclass CCBSequence : public cocos2d::Object\n{\npublic:\n    CCBSequence();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~CCBSequence();\n    float getDuration();\n    void setDuration(float fDuration);\n    \n    CCBSequenceProperty* getCallbackChannel();\n    void setCallbackChannel(CCBSequenceProperty* callbackChannel);\n\n    CCBSequenceProperty* getSoundChannel();\n    void setSoundChannel(CCBSequenceProperty* soundChannel);\n    \n    const char* getName();\n    void setName(const char *pName);\n    \n    int getSequenceId();\n    void setSequenceId(int nSequenceId);\n    \n    int getChainedSequenceId();\n    void setChainedSequenceId(int nChainedSequenceId);\n    \nprivate:\n    float _duration;\n    std::string _name;\n    int mSequenceId;\n    int mChainedSequenceId;\n    CCBSequenceProperty* mCallbackChannel;\n    CCBSequenceProperty* mSoundChannel;\n};\n\n\n}\n\n\n#endif // __CCB_CCSEQUENCE_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp",
    "content": "#include \"CCBSequenceProperty.h\"\n\nusing namespace cocos2d;\nusing namespace std;\n\nnamespace cocosbuilder {\n\nCCBSequenceProperty::CCBSequenceProperty()\n: _name(\"\")\n, _type(0)\n{\n    init();\n}\n\nbool CCBSequenceProperty::init()\n{\n    return true;\n}\n\nCCBSequenceProperty::~CCBSequenceProperty()\n{\n}\n\nconst char* CCBSequenceProperty::getName()\n{\n    return _name.c_str();\n}\n\nvoid CCBSequenceProperty::setName(const char *pName)\n{\n    _name = pName;\n}\n\nint CCBSequenceProperty::getType()\n{\n    return _type;\n}\n\nvoid CCBSequenceProperty::setType(int type)\n{\n    _type = type;\n}\n\ncocos2d::Vector<CCBKeyframe*>& CCBSequenceProperty::getKeyframes()\n{\n    return _keyframes;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCBSequenceProperty.h",
    "content": "#ifndef __CCB_SEQUENCE_PROPERTY_H__\n#define __CCB_SEQUENCE_PROPERTY_H__\n\n#include \"CCObject.h\"\n#include \"CCVector.h\"\n#include \"CCBKeyframe.h\"\n\nnamespace cocosbuilder {\n\nclass CCBSequenceProperty : public cocos2d::Object\n{\npublic:\n    /**\n     * @js ctor\n     */\n    CCBSequenceProperty();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~CCBSequenceProperty();\n    \n    virtual bool init();\n    \n    const char* getName();\n    void setName(const char* pName);\n    \n    int getType();\n    void setType(int type);\n    \n    cocos2d::Vector<CCBKeyframe*>& getKeyframes();\n\nprivate:\n    std::string _name;\n    int _type;\n    cocos2d::Vector<CCBKeyframe*> _keyframes;\n};\n\n}\n\n#endif // __CCB_SEQUENCE_PROPERTY_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp",
    "content": "#include \"CCControlButtonLoader.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\nnamespace cocosbuilder {;\n\n#define PROPERTY_ZOOMONTOUCHDOWN \"zoomOnTouchDown\"\n#define PROPERTY_TITLE_NORMAL \"title|1\"\n#define PROPERTY_TITLE_HIGHLIGHTED \"title|2\"\n#define PROPERTY_TITLE_DISABLED \"title|3\"\n#define PROPERTY_TITLECOLOR_NORMAL \"titleColor|1\"\n#define PROPERTY_TITLECOLOR_HIGHLIGHTED \"titleColor|2\"\n#define PROPERTY_TITLECOLOR_DISABLED \"titleColor|3\"\n#define PROPERTY_TITLETTF_NORMAL \"titleTTF|1\"\n#define PROPERTY_TITLETTF_HIGHLIGHTED \"titleTTF|2\"\n#define PROPERTY_TITLETTF_DISABLED \"titleTTF|3\"\n#define PROPERTY_TITLETTFSIZE_NORMAL \"titleTTFSize|1\"\n#define PROPERTY_TITLETTFSIZE_HIGHLIGHTED \"titleTTFSize|2\"\n#define PROPERTY_TITLETTFSIZE_DISABLED \"titleTTFSize|3\"\n#define PROPERTY_LABELANCHORPOINT \"labelAnchorPoint\"\n#define PROPERTY_PREFEREDSIZE \"preferedSize\" // TODO Should be \"preferredSize\". This is a typo in cocos2d-iphone, cocos2d-x and CocosBuilder!\n#define PROPERTY_BACKGROUNDSPRITEFRAME_NORMAL \"backgroundSpriteFrame|1\"\n#define PROPERTY_BACKGROUNDSPRITEFRAME_HIGHLIGHTED \"backgroundSpriteFrame|2\"\n#define PROPERTY_BACKGROUNDSPRITEFRAME_DISABLED \"backgroundSpriteFrame|3\"\n\nvoid ControlButtonLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_ZOOMONTOUCHDOWN) == 0) {\n        ((ControlButton *)pNode)->setZoomOnTouchDown(pCheck);\n    } else {\n        ControlLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, ccbReader);\n    }\n}\n\nvoid ControlButtonLoader::onHandlePropTypeString(Node * pNode, Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TITLE_NORMAL) == 0) {\n        ((ControlButton *)pNode)->setTitleForState(pString, Control::State::NORMAL);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLE_HIGHLIGHTED) == 0) {\n        ((ControlButton *)pNode)->setTitleForState(pString, Control::State::HIGH_LIGHTED);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLE_DISABLED) == 0) {\n        ((ControlButton *)pNode)->setTitleForState(pString, Control::State::DISABLED);\n    } else {\n        ControlLoader::onHandlePropTypeString(pNode, pParent, pPropertyName, pString, ccbReader);\n    }\n}\n\nvoid ControlButtonLoader::onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TITLETTF_NORMAL) == 0) {\n        ((ControlButton *)pNode)->setTitleTTFForState(pFontTTF, Control::State::NORMAL);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLETTF_HIGHLIGHTED) == 0) {\n        ((ControlButton *)pNode)->setTitleTTFForState(pFontTTF, Control::State::HIGH_LIGHTED);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLETTF_DISABLED) == 0) {\n        ((ControlButton *)pNode)->setTitleTTFForState(pFontTTF, Control::State::DISABLED);\n    } else {\n        ControlLoader::onHandlePropTypeFontTTF(pNode, pParent, pPropertyName, pFontTTF, ccbReader);\n    }\n}\n\nvoid ControlButtonLoader::onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TITLETTFSIZE_NORMAL) == 0) {\n        ((ControlButton *)pNode)->setTitleTTFSizeForState(pFloatScale, Control::State::NORMAL);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLETTFSIZE_HIGHLIGHTED) == 0) {\n        ((ControlButton *)pNode)->setTitleTTFSizeForState(pFloatScale, Control::State::HIGH_LIGHTED);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLETTFSIZE_DISABLED) == 0) {\n        ((ControlButton *)pNode)->setTitleTTFSizeForState(pFloatScale, Control::State::DISABLED);\n    } else {\n        ControlLoader::onHandlePropTypeFloatScale(pNode, pParent, pPropertyName, pFloatScale, ccbReader);\n    }\n}\n\nvoid ControlButtonLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_LABELANCHORPOINT) == 0) {\n        ((ControlButton *)pNode)->setLabelAnchorPoint(pPoint);\n    } else {\n        ControlLoader::onHandlePropTypePoint(pNode, pParent, pPropertyName, pPoint, ccbReader);\n    }\n}\n\nvoid ControlButtonLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_PREFEREDSIZE) == 0) {\n        ((ControlButton *)pNode)->setPreferredSize(pSize);\n    } else {\n        ControlLoader::onHandlePropTypeSize(pNode, pParent, pPropertyName, pSize, ccbReader);\n    }\n}\n\nvoid ControlButtonLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_NORMAL) == 0) {\n        if(pSpriteFrame != NULL) {\n            ((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::NORMAL);\n        }\n    } else if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_HIGHLIGHTED) == 0) {\n        if(pSpriteFrame != NULL) {\n            ((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::HIGH_LIGHTED);\n        }\n    } else if(strcmp(pPropertyName, PROPERTY_BACKGROUNDSPRITEFRAME_DISABLED) == 0) {\n        if(pSpriteFrame != NULL) {\n            ((ControlButton *)pNode)->setBackgroundSpriteFrameForState(pSpriteFrame, Control::State::DISABLED);\n        }\n    } else {\n        ControlLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pSpriteFrame, ccbReader);\n    }\n}\n\nvoid ControlButtonLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TITLECOLOR_NORMAL) == 0) {\n        ((ControlButton *)pNode)->setTitleColorForState(pColor3B, Control::State::NORMAL);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLECOLOR_HIGHLIGHTED) == 0) {\n        ((ControlButton *)pNode)->setTitleColorForState(pColor3B, Control::State::HIGH_LIGHTED);\n    } else if(strcmp(pPropertyName, PROPERTY_TITLECOLOR_DISABLED) == 0) {\n        ((ControlButton *)pNode)->setTitleColorForState(pColor3B, Control::State::DISABLED);\n    } else {\n        ControlLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader);\n    }\n}\n\n};"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCControlButtonLoader.h",
    "content": "#ifndef _CCB_CCCONTROLBUTTONLOADER_H_\n#define _CCB_CCCONTROLBUTTONLOADER_H_\n\n#include \"CCControlLoader.h\"\n#include \"extensions//GUI/CCControlExtension/CCControlButton.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass ControlButtonLoader : public ControlLoader {\n    public:\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual ~ControlButtonLoader() {};\n        /**\n         * @js NA\n         * @lua NA\n         */\n        CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ControlButtonLoader, loader);\n\n    protected:\n        CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ControlButton);\n\n        virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);\n        virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pString, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader);\n        virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);\n        virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);\n        virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);\n        virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCControlLoader.cpp",
    "content": "#include \"CCControlLoader.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\nnamespace cocosbuilder {\n\n#define PROPERTY_ENABLED \"enabled\"\n#define PROPERTY_SELECTED \"selected\"\n#define PROPERTY_CCCONTROL \"ccControl\"\n\nvoid ControlLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_ENABLED) == 0) {\n        ((Control *)pNode)->setEnabled(pCheck);\n    } else if(strcmp(pPropertyName, PROPERTY_SELECTED) == 0) {\n        ((Control *)pNode)->setSelected(pCheck);\n    } else {\n        NodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, ccbReader);\n    }\n}\n\nvoid ControlLoader::onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_CCCONTROL) == 0) {\n        ((Control *)pNode)->addTargetWithActionForControlEvents(pBlockControlData->_target, pBlockControlData->mSELControlHandler, pBlockControlData->mControlEvents);\n    } else {\n        NodeLoader::onHandlePropTypeBlockControl(pNode, pParent, pPropertyName, pBlockControlData, ccbReader);\n    }\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCControlLoader.h",
    "content": "#ifndef _CCB_CCCONTROLLOADER_H_\n#define _CCB_CCCONTROLLOADER_H_\n\n#include \"CCNodeLoader.h\"\n#include \"extensions/GUI/CCControlExtension/CCControl.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass ControlLoader : public NodeLoader {\npublic:\n    /**\n    * @js NA\n    * @lua NA\n    */\n    virtual ~ControlLoader() {};\n\nprotected:\n    CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::Control);\n\n    virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader);\n    virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp",
    "content": "#include \"CCLabelBMFontLoader.h\"\n\nusing namespace cocos2d;\n\nnamespace cocosbuilder {\n\n#define PROPERTY_COLOR \"color\"\n#define PROPERTY_OPACITY \"opacity\"\n#define PROPERTY_BLENDFUNC \"blendFunc\"\n#define PROPERTY_FNTFILE \"fntFile\"\n#define PROPERTY_STRING \"string\"\n\nvoid LabelBMFontLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) {\n        ((LabelBMFont *)pNode)->setColor(pColor3B);\n    } else {\n        NodeLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader);\n    }\n}\n\nvoid LabelBMFontLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_OPACITY) == 0) {\n        ((LabelBMFont *)pNode)->setOpacity(pByte);\n    } else {\n        NodeLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, ccbReader);\n    }\n}\n\nvoid LabelBMFontLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {\n        ((LabelBMFont *)pNode)->setBlendFunc(pBlendFunc);\n    } else {\n        NodeLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pBlendFunc, ccbReader);\n    }\n}\n\nvoid LabelBMFontLoader::onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_FNTFILE) == 0) {\n        ((LabelBMFont *)pNode)->setFntFile(pFntFile);\n    } else {\n        NodeLoader::onHandlePropTypeFntFile(pNode, pParent, pPropertyName, pFntFile, ccbReader);\n    }\n}\n\nvoid LabelBMFontLoader::onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_STRING) == 0) {\n        ((LabelBMFont *)pNode)->setString(pText);\n    } else {\n        NodeLoader::onHandlePropTypeText(pNode, pParent, pPropertyName, pText, ccbReader);\n    }\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h",
    "content": "#ifndef _CCB_CCLABELBMFONTLOADER_H_\n#define _CCB_CCLABELBMFONTLOADER_H_\n\n#include \"CCObject.h\"\n#include \"CCLabelBMFont.h\"\n\n#include \"CCNodeLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass LabelBMFontLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LabelBMFontLoader() {};\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelBMFontLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelBMFont);\n\n    virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n    virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);\n    virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);\n    virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pFntFile, CCBReader * ccbReader);\n    virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char* pText, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp",
    "content": "#include \"CCLabelTTFLoader.h\"\n\nusing namespace cocos2d;\n\n#define PROPERTY_COLOR \"color\"\n#define PROPERTY_OPACITY \"opacity\"\n#define PROPERTY_BLENDFUNC \"blendFunc\"\n#define PROPERTY_FONTNAME \"fontName\"\n#define PROPERTY_FONTSIZE \"fontSize\"\n#define PROPERTY_HORIZONTALALIGNMENT \"horizontalAlignment\"\n#define PROPERTY_VERTICALALIGNMENT \"verticalAlignment\"\n#define PROPERTY_STRING \"string\"\n#define PROPERTY_DIMENSIONS \"dimensions\"\n\nnamespace cocosbuilder {\n\nvoid LabelTTFLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) {\n        ((LabelTTF *)pNode)->setColor(pColor3B);\n    } else {\n        NodeLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader);\n    }\n}\n\nvoid LabelTTFLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_OPACITY) == 0) {\n        ((LabelTTF *)pNode)->setOpacity(pByte);\n    } else {\n        NodeLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, ccbReader);\n    }\n}\n\nvoid LabelTTFLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {\n        ((LabelTTF *)pNode)->setBlendFunc(pBlendFunc);\n    } else {\n        NodeLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pBlendFunc, ccbReader);\n    }\n}\n\nvoid LabelTTFLoader::onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_FONTNAME) == 0) {\n        ((LabelTTF *)pNode)->setFontName(pFontTTF);\n    } else {\n        NodeLoader::onHandlePropTypeFontTTF(pNode, pParent, pPropertyName, pFontTTF, ccbReader);\n    }\n}\n\nvoid LabelTTFLoader::onHandlePropTypeText(Node * pNode, Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_STRING) == 0) {\n        ((LabelTTF *)pNode)->setString(pText);\n    } else {\n        NodeLoader::onHandlePropTypeText(pNode, pParent, pPropertyName, pText, ccbReader);\n    }\n}\n\nvoid LabelTTFLoader::onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_FONTSIZE) == 0) {\n        ((LabelTTF *)pNode)->setFontSize(pFloatScale);\n    } else {\n        NodeLoader::onHandlePropTypeFloatScale(pNode, pParent, pPropertyName, pFloatScale, ccbReader);\n    }\n}\n\nvoid LabelTTFLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_HORIZONTALALIGNMENT) == 0) {\n        ((LabelTTF *)pNode)->setHorizontalAlignment(TextHAlignment(pIntegerLabeled));\n    } else if(strcmp(pPropertyName, PROPERTY_VERTICALALIGNMENT) == 0) {\n        ((LabelTTF *)pNode)->setVerticalAlignment(TextVAlignment(pIntegerLabeled));\n    } else {\n        NodeLoader::onHandlePropTypeFloatScale(pNode, pParent, pPropertyName, pIntegerLabeled, ccbReader);\n    }\n}\n\nvoid LabelTTFLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_DIMENSIONS) == 0) {\n        ((LabelTTF *)pNode)->setDimensions(pSize);\n    } else {\n        NodeLoader::onHandlePropTypeSize(pNode, pParent, pPropertyName, pSize, ccbReader);\n    }\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h",
    "content": "#ifndef _CCB_CCLABELTTFLOADER_H_\n#define _CCB_CCLABELTTFLOADER_H_\n\n#include \"CCObject.h\"\n#include \"CCLabelTTF.h\"\n\n#include \"CCNodeLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass LabelTTFLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LabelTTFLoader() {};\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LabelTTFLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LabelTTF);\n\n    virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n    virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);\n    virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);\n    virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pFontTTF, CCBReader * ccbReader);\n    virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, const char * pText, CCBReader * ccbReader);\n    virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloatScale, CCBReader * ccbReader);\n    virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);\n    virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp",
    "content": "#include \"CCLayerColorLoader.h\"\n\nusing namespace cocos2d;\n\nnamespace cocosbuilder {\n\n#define PROPERTY_COLOR \"color\"\n#define PROPERTY_OPACITY \"opacity\"\n#define PROPERTY_BLENDFUNC \"blendFunc\"\n\nvoid LayerColorLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) {\n        ((LayerColor *)pNode)->setColor(pColor3B);\n    } else {\n        LayerLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader);\n    }\n}\n\nvoid LayerColorLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_OPACITY) == 0) {\n        ((LayerColor *)pNode)->setOpacity(pByte);\n    } else {\n        LayerLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, ccbReader);\n    }\n}\n\nvoid LayerColorLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {\n        ((LayerColor *)pNode)->setBlendFunc(pBlendFunc);\n    } else {\n        LayerLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pBlendFunc, ccbReader);\n    }\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLayerColorLoader.h",
    "content": "#ifndef _CCB_CCLAYERCOLORLOADER_H_\n#define _CCB_CCLAYERCOLORLOADER_H_\n\n#include \"CCLayerLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass LayerColorLoader : public LayerLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LayerColorLoader() {};\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerColorLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerColor);\n\n    virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n    virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);\n    virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp",
    "content": "#include \"CCLayerGradientLoader.h\"\n\nusing namespace cocos2d;\n\n#define PROPERTY_STARTCOLOR \"startColor\"\n#define PROPERTY_ENDCOLOR \"endColor\"\n#define PROPERTY_STARTOPACITY \"startOpacity\"\n#define PROPERTY_ENDOPACITY \"endOpacity\"\n#define PROPERTY_VECTOR \"vector\"\n#define PROPERTY_BLENDFUNC \"blendFunc\"\n\nnamespace cocosbuilder {\n\nvoid LayerGradientLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_STARTCOLOR) == 0) {\n        ((LayerGradient *)pNode)->setStartColor(pColor3B);\n    } else if(strcmp(pPropertyName, PROPERTY_ENDCOLOR) == 0) {\n        ((LayerGradient *)pNode)->setEndColor(pColor3B);\n    } else {\n        LayerLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader);\n    }\n}\n\nvoid LayerGradientLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_STARTOPACITY) == 0) {\n        ((LayerGradient *)pNode)->setStartOpacity(pByte);\n    } else if(strcmp(pPropertyName, PROPERTY_ENDOPACITY) == 0) {\n        ((LayerGradient *)pNode)->setEndOpacity(pByte);\n    } else {\n        LayerLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, ccbReader);\n    }\n}\n\nvoid LayerGradientLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {\n        ((LayerGradient *)pNode)->setBlendFunc(pBlendFunc);\n    } else {\n        LayerLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pBlendFunc, ccbReader);\n    }\n}\n\n\nvoid LayerGradientLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_VECTOR) == 0) {\n        ((LayerGradient *)pNode)->setVector(pPoint);\n\n        // TODO Not passed along the ccbi file.\n        // ((LayerGradient *)pNode)->setCompressedInterpolation(true);\n    } else {\n        LayerLoader::onHandlePropTypePoint(pNode, pParent, pPropertyName, pPoint, ccbReader);\n    }\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h",
    "content": "#ifndef _CCB_CCLAYERGRADIENTLOADER_H_\n#define _CCB_CCLAYERGRADIENTLOADER_H_\n\n#include \"CCLayerLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass LayerGradientLoader : public LayerLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LayerGradientLoader() {};\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerGradientLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::LayerGradient);\n\n    virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n    virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);\n    virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);\n    virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLayerLoader.cpp",
    "content": "#include \"CCLayerLoader.h\"\n\n\nusing namespace cocos2d;\n\n#define PROPERTY_TOUCH_ENABLED \"isTouchEnabled\"\n#define PROPERTY_ACCELEROMETER_ENABLED \"isAccelerometerEnabled\"\n#define PROPERTY_MOUSE_ENABLED \"isMouseEnabled\"\n#define PROPERTY_KEYBOARD_ENABLED \"isKeyboardEnabled\"\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (push)\n#pragma warning (disable: 4996)\n#endif\n\nusing namespace cocos2d;\n\nnamespace cocosbuilder {\n  \nvoid LayerLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TOUCH_ENABLED) == 0) {\n        ((Layer *)pNode)->setTouchEnabled(pCheck);\n    } else if(strcmp(pPropertyName, PROPERTY_ACCELEROMETER_ENABLED) == 0) {\n        ((Layer *)pNode)->setAccelerometerEnabled(pCheck);\n    } else if(strcmp(pPropertyName, PROPERTY_MOUSE_ENABLED) == 0) {\n        // TODO XXX\n        CCLOG(\"The property '%s' is not supported!\", PROPERTY_MOUSE_ENABLED);\n    } else if(strcmp(pPropertyName, PROPERTY_KEYBOARD_ENABLED) == 0) {\n        // TODO XXX\n        CCLOG(\"The property '%s' is not supported!\", PROPERTY_KEYBOARD_ENABLED);\n        // This comes closest: ((Layer *)pNode)->setKeypadEnabled(pCheck);\n    } else {\n        NodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, ccbReader);\n    }\n}\n\n}\n\n#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#pragma GCC diagnostic warning \"-Wdeprecated-declarations\"\n#elif _MSC_VER >= 1400 //vs 2005 or higher\n#pragma warning (pop)\n#endif"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCLayerLoader.h",
    "content": "#ifndef _CCB_CCLAYERLOADER_H_\n#define _CCB_CCLAYERLOADER_H_\n\n#include \"CCNodeLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass LayerLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~LayerLoader() {};\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(LayerLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Layer);\n\n    virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp",
    "content": "#include \"CCMenuItemImageLoader.h\"\n\nusing namespace cocos2d;\n\n#define PROPERTY_NORMALDISPLAYFRAME \"normalSpriteFrame\"\n#define PROPERTY_SELECTEDDISPLAYFRAME \"selectedSpriteFrame\"\n#define PROPERTY_DISABLEDDISPLAYFRAME \"disabledSpriteFrame\"\n\nnamespace cocosbuilder {\n\nvoid MenuItemImageLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_NORMALDISPLAYFRAME) == 0) {\n        if(pSpriteFrame != NULL) {\n            ((MenuItemImage *)pNode)->setNormalSpriteFrame(pSpriteFrame);\n        }\n    } else if(strcmp(pPropertyName, PROPERTY_SELECTEDDISPLAYFRAME) == 0) {\n        if(pSpriteFrame != NULL) {\n            ((MenuItemImage *)pNode)->setSelectedSpriteFrame(pSpriteFrame);\n        }\n    } else if(strcmp(pPropertyName, PROPERTY_DISABLEDDISPLAYFRAME) == 0) {\n        if(pSpriteFrame != NULL) {\n            ((MenuItemImage *)pNode)->setDisabledSpriteFrame(pSpriteFrame);\n        }\n    } else {\n        MenuItemLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pSpriteFrame, ccbReader);\n    }\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h",
    "content": "#ifndef _CCB_CCMENUITEMIMAGELOADER_H_\n#define _CCB_CCMENUITEMIMAGELOADER_H_\n\n#include \"CCMenuItemLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass MenuItemImageLoader : public MenuItemLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItemImageLoader() {};\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(MenuItemImageLoader, loader);\n\nprotected:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItemImage);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp",
    "content": "#include \"CCMenuItemLoader.h\"\n\nusing namespace cocos2d;\n\n#define PROPERTY_BLOCK \"block\"\n#define PROPERTY_ISENABLED \"isEnabled\"\n\nnamespace cocosbuilder {\n\nvoid MenuItemLoader::onHandlePropTypeBlock(Node * pNode, Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLOCK) == 0) {\n        if (NULL != pBlockData) // Add this condition to allow MenuItemImage without target/selector predefined \n        {\n            ((MenuItem *)pNode)->setCallback( std::bind( pBlockData->mSELMenuHandler, pBlockData->_target, std::placeholders::_1) );\n//            ((MenuItem *)pNode)->setTarget(pBlockData->_target, pBlockData->mSELMenuHandler);\n        }\n    } else {\n        NodeLoader::onHandlePropTypeBlock(pNode, pParent, pPropertyName, pBlockData, ccbReader);\n    }\n}\n\nvoid MenuItemLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_ISENABLED) == 0) {\n        ((MenuItem *)pNode)->setEnabled(pCheck);\n    } else {\n        NodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, ccbReader);\n    }\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCMenuItemLoader.h",
    "content": "#ifndef _CCB_CCMENUITEMLOADER_H_\n#define _CCB_CCMENUITEMLOADER_H_\n\n#include \"CCObject.h\"\n#include \"CCMenuItem.h\"\n\n#include \"CCLayerLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass MenuItemLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuItemLoader() {};\n\nprotected:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::MenuItem);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, BlockData * pBlockData, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeCheck(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCMenuLoader.h",
    "content": "#ifndef _CCB_CCMENULOADER_H_\n#define _CCB_CCMENULOADER_H_\n\n#include \"CCLayerLoader.h\"\n#include \"CCObject.h\"\n#include \"CCMenu.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass MenuLoader : public LayerLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~MenuLoader() {};\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(MenuLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Menu);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp",
    "content": "#include \"CCNode+CCBRelativePositioning.h\"\n#include \"CCBReader.h\"\n\nusing namespace cocos2d;\n\nnamespace cocosbuilder {\n\nPoint getAbsolutePosition(const Point &pt, CCBReader::PositionType type, const Size &containerSize, const std::string& propName)\n{\n    Point absPt = Point(0,0);\n    if (type == CCBReader::PositionType::RELATIVE_BOTTOM_LEFT)\n    {\n        absPt = pt;\n    }\n    else if (type == CCBReader::PositionType::RELATIVE_TOP_LEFT)\n    {\n        absPt.x = pt.x;\n        absPt.y = containerSize.height - pt.y;\n    }\n    else if (type == CCBReader::PositionType::RELATIVE_TOP_RIGHT)\n    {\n        absPt.x = containerSize.width - pt.x;\n        absPt.y = containerSize.height - pt.y;\n    }\n    else if (type == CCBReader::PositionType::RELATIVE_BOTTOM_RIGHT)\n    {\n        absPt.x = containerSize.width - pt.x;\n        absPt.y = pt.y;\n    }\n    else if (type == CCBReader::PositionType::PERCENT)\n    {\n        absPt.x = (int)(containerSize.width * pt.x / 100.0f);\n        absPt.y = (int)(containerSize.height * pt.y / 100.0f);\n    }\n    else if (type == CCBReader::PositionType::MULTIPLY_RESOLUTION)\n    {\n        float resolutionScale = CCBReader::getResolutionScale();\n        \n        absPt.x = pt.x * resolutionScale;\n        absPt.y = pt.y * resolutionScale;\n    }\n    \n    return absPt;\n}\n\nvoid setRelativeScale(Node *pNode, float scaleX, float scaleY, CCBReader::ScaleType type, const std::string& propName)\n{\n    CCASSERT(pNode, \"pNode should not be null\");\n    \n    if (type == CCBReader::ScaleType::MULTIPLY_RESOLUTION)\n    {\n        float resolutionScale = CCBReader::getResolutionScale();\n        \n        scaleX *= resolutionScale;\n        scaleY *= resolutionScale;\n    }\n    \n    pNode->setScaleX(scaleX);\n    pNode->setScaleY(scaleY);\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h",
    "content": "#ifndef __CCB_CCNODE_RELATIVEPOSITIONING_H__\n#define __CCB_CCNODE_RELATIVEPOSITIONING_H__\n\n#include \"CCBReader.h\"\n\nnamespace cocosbuilder {\n\nextern cocos2d::Point getAbsolutePosition(const cocos2d::Point &pt, CCBReader::PositionType type, const cocos2d::Size &containerSize, const std::string&propName);\n\nextern void setRelativeScale(cocos2d::Node *node, float scaleX, float scaleY, CCBReader::ScaleType type, const std::string& propName);\n\n}\n\n#endif // __CCB_CCNODE_RELATIVEPOSITIONING_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCNodeLoader.cpp",
    "content": "#include \"cocos2d.h\"\n\n#include \"CCNodeLoader.h\"\n#include \"CCBSelectorResolver.h\"\n#include \"CCBMemberVariableAssigner.h\"\n#include \"CCBAnimationManager.h\"\n#include \"CCNode+CCBRelativePositioning.h\"\n\n\nusing namespace std;\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\nnamespace cocosbuilder {\n\nNodeLoader::NodeLoader()\n{\n}\n\nNodeLoader::~NodeLoader()\n{\n}\n\nValueMap& NodeLoader::getCustomProperties()\n{\n    return _customProperties;\n}\n\nNode * NodeLoader::loadNode(Node * pParent, CCBReader * ccbReader)\n{\n    Node * ccNode = this->createNode(pParent, ccbReader);\n\n    //clear _customProperties, ready for load next node.\n    _customProperties.clear();\n\n    return ccNode;\n}\n\nvoid NodeLoader::parseProperties(Node * pNode, Node * pParent, CCBReader * ccbReader)\n{\n    int numRegularProps = ccbReader->readInt(false);\n    int numExturaProps = ccbReader->readInt(false);\n    int propertyCount = numRegularProps + numExturaProps;\n\n    for(int i = 0; i < propertyCount; i++) {\n        bool isExtraProp = (i >= numRegularProps);\n        CCBReader::PropertyType type = (CCBReader::PropertyType)ccbReader->readInt(false);\n        std::string propertyName = ccbReader->readCachedString();\n\n        // Check if the property can be set for this platform\n        bool setProp = false;\n        \n        CCBReader::PlatformType platform = (CCBReader::PlatformType)ccbReader->readByte();\n        if(platform == CCBReader::PlatformType::ALL)\n        {\n            setProp = true;\n        }\n        // Cocos2d-x is using touch event callback for all platforms,\n        // it's different from cocos2d-iphone which uses mouse event for Mac port.\n        // So we just need to touch event by using CCBReader::PlatformType::IOS.\n//#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n        if(platform == CCBReader::PlatformType::IOS)\n        {\n            setProp = true;\n        }\n// #elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n//         if(platform == CCBReader::PlatformType::MAC)\n//         {\n//             setProp = true;\n//         }\n// #endif\n        \n        // Forward properties for sub ccb files\n        if (dynamic_cast<CCBFile*>(pNode) != NULL)\n        {\n            CCBFile *ccbNode = (CCBFile*)pNode;\n            if (ccbNode->getCCBFileNode() && isExtraProp)\n            {\n                pNode = ccbNode->getCCBFileNode();\n                \n                // Skip properties that doesn't have a value to override\n                Array *extraPropsNames = (Array*)pNode->getUserObject();\n                Object* pObj = NULL;\n                bool bFound = false;\n                CCARRAY_FOREACH(extraPropsNames, pObj)\n                {\n                    String* pStr = static_cast<String*>(pObj);\n                    if (0 == pStr->compare(propertyName.c_str()))\n                    {\n                        bFound = true;\n                        break;\n                    }\n                }\n                setProp &= bFound;\n            }\n        }\n        else if (isExtraProp && pNode == ccbReader->getAnimationManager()->getRootNode())\n        {\n            Array *extraPropsNames = static_cast<Array*>(pNode->getUserObject());\n            if (! extraPropsNames)\n            {\n                extraPropsNames = Array::create();\n                pNode->setUserObject(extraPropsNames);\n            }\n            \n            extraPropsNames->addObject(String::create(propertyName));\n        }\n\n        switch(type) \n        {\n            case CCBReader::PropertyType::POSITION:\n            {\n                Point position = this->parsePropTypePosition(pNode, pParent, ccbReader, propertyName.c_str());\n                if (setProp) \n                {\n                    this->onHandlePropTypePosition(pNode, pParent, propertyName.c_str(), position, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::POINT:\n            {\n                Point point = this->parsePropTypePoint(pNode, pParent, ccbReader);\n                if (setProp) \n                {\n                    this->onHandlePropTypePoint(pNode, pParent, propertyName.c_str(), point, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::POINT_LOCK:\n            {\n                Point pointLock = this->parsePropTypePointLock(pNode, pParent, ccbReader);\n                if (setProp) \n                {\n                    this->onHandlePropTypePointLock(pNode, pParent, propertyName.c_str(), pointLock, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::SIZE:\n            {\n                Size size = this->parsePropTypeSize(pNode, pParent, ccbReader);\n                if(setProp) {\n                    this->onHandlePropTypeSize(pNode, pParent, propertyName.c_str(), size, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::SCALE_LOCK:\n            {\n                float * scaleLock = this->parsePropTypeScaleLock(pNode, pParent, ccbReader, propertyName.c_str());\n                if(setProp) \n                {\n                    this->onHandlePropTypeScaleLock(pNode, pParent, propertyName.c_str(), scaleLock, ccbReader);\n                }\n                CC_SAFE_DELETE_ARRAY(scaleLock);\n                break;\n            }\n            case CCBReader::PropertyType::FLOAT:\n            {\n                float f = this->parsePropTypeFloat(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeFloat(pNode, pParent, propertyName.c_str(), f, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::FLOAT_XY:\n            {\n                float * xy =  this->parsePropTypeFloatXY(pNode, pParent, ccbReader);\n                if(setProp)\n                {\n                    this->onHandlePropTypeFloatXY(pNode, pParent, propertyName.c_str(), xy, ccbReader);\n                }\n                CC_SAFE_DELETE_ARRAY(xy);\n                break;\n            }\n\n            case CCBReader::PropertyType::DEGREES:\n            {\n                float degrees = this->parsePropTypeDegrees(pNode, pParent, ccbReader, propertyName.c_str());\n                if(setProp) \n                {\n                    this->onHandlePropTypeDegrees(pNode, pParent, propertyName.c_str(), degrees, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::FLOAT_SCALE:\n            {\n                float floatScale = this->parsePropTypeFloatScale(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeFloatScale(pNode, pParent, propertyName.c_str(), floatScale, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::INTEGER:\n            {\n                int integer = this->parsePropTypeInteger(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeInteger(pNode, pParent, propertyName.c_str(), integer, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::INTEGER_LABELED:\n            {\n                int integerLabeled = this->parsePropTypeIntegerLabeled(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeIntegerLabeled(pNode, pParent, propertyName.c_str(), integerLabeled, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::FLOAT_VAR:\n            {\n                float * floatVar = this->parsePropTypeFloatVar(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeFloatVar(pNode, pParent, propertyName.c_str(), floatVar, ccbReader);\n                }\n                CC_SAFE_DELETE_ARRAY(floatVar);\n                break;\n            }\n            case CCBReader::PropertyType::CHECK:\n            {\n                bool check = this->parsePropTypeCheck(pNode, pParent, ccbReader, propertyName.c_str());\n                if(setProp) \n                {\n                    this->onHandlePropTypeCheck(pNode, pParent, propertyName.c_str(), check, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::SPRITEFRAME:\n            {\n                SpriteFrame * ccSpriteFrame = this->parsePropTypeSpriteFrame(pNode, pParent, ccbReader, propertyName.c_str());\n                if(setProp) \n                {\n                    this->onHandlePropTypeSpriteFrame(pNode, pParent, propertyName.c_str(), ccSpriteFrame, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::ANIMATION:\n            {\n                Animation * ccAnimation = this->parsePropTypeAnimation(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeAnimation(pNode, pParent, propertyName.c_str(), ccAnimation, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::TEXTURE:\n            {\n                Texture2D * ccTexture2D = this->parsePropTypeTexture(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeTexture(pNode, pParent, propertyName.c_str(), ccTexture2D, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::BYTE:\n            {\n                unsigned char byte = this->parsePropTypeByte(pNode, pParent, ccbReader, propertyName.c_str());\n                if(setProp) \n                {\n                    this->onHandlePropTypeByte(pNode, pParent, propertyName.c_str(), byte, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::COLOR3:\n            {\n                Color3B color3B = this->parsePropTypeColor3(pNode, pParent, ccbReader, propertyName.c_str());\n                if(setProp) \n                {\n                    this->onHandlePropTypeColor3(pNode, pParent, propertyName.c_str(), color3B, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::COLOR4F_VAR:\n            {\n                Color4F * color4FVar = this->parsePropTypeColor4FVar(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeColor4FVar(pNode, pParent, propertyName.c_str(), color4FVar, ccbReader);\n                }\n                CC_SAFE_DELETE_ARRAY(color4FVar);\n                break;\n            }\n            case CCBReader::PropertyType::FLIP:\n            {\n                bool * flip = this->parsePropTypeFlip(pNode, pParent, ccbReader);\n                if(setProp) {\n                    this->onHandlePropTypeFlip(pNode, pParent, propertyName.c_str(), flip, ccbReader);\n                }\n                CC_SAFE_DELETE_ARRAY(flip);\n                break;\n            }\n            case CCBReader::PropertyType::BLEND_MODE:\n            {\n                BlendFunc blendFunc = this->parsePropTypeBlendFunc(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeBlendFunc(pNode, pParent, propertyName.c_str(), blendFunc, ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::FNT_FILE:\n            {\n                std::string fntFile = ccbReader->getCCBRootPath() + this->parsePropTypeFntFile(pNode, pParent, ccbReader);\n                if(setProp) \n                {\n                    this->onHandlePropTypeFntFile(pNode, pParent, propertyName.c_str(), fntFile.c_str(), ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::FONT_TTF:\n            {\n                std::string fontTTF = this->parsePropTypeFontTTF(pNode, pParent, ccbReader);\n                if(setProp) {\n                    this->onHandlePropTypeFontTTF(pNode, pParent, propertyName.c_str(), fontTTF.c_str(), ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::STRING:\n            {\n                std::string string = this->parsePropTypeString(pNode, pParent, ccbReader);\n                if(setProp) {\n                    this->onHandlePropTypeString(pNode, pParent, propertyName.c_str(), string.c_str(), ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::TEXT:\n            {\n                std::string text = this->parsePropTypeText(pNode, pParent, ccbReader);\n                if(setProp) {\n                    this->onHandlePropTypeText(pNode, pParent, propertyName.c_str(), text.c_str(), ccbReader);\n                }\n                break;\n            }\n            case CCBReader::PropertyType::BLOCK:\n            {\n                BlockData * blockData = this->parsePropTypeBlock(pNode, pParent, ccbReader);\n                if(setProp) {\n                    this->onHandlePropTypeBlock(pNode, pParent, propertyName.c_str(), blockData, ccbReader);\n                }\n                CC_SAFE_DELETE(blockData);\n                break;\n            }\n            case CCBReader::PropertyType::BLOCK_CONTROL:\n            {\n                BlockControlData * blockControlData = this->parsePropTypeBlockControl(pNode, pParent, ccbReader);\n                if(setProp && blockControlData != NULL) {\n                    this->onHandlePropTypeBlockControl(pNode, pParent, propertyName.c_str(), blockControlData, ccbReader);\n                }\n                CC_SAFE_DELETE(blockControlData);\n                break;\n            }\n            case CCBReader::PropertyType::CCB_FILE:\n            {\n                Node * ccbFileNode = this->parsePropTypeCCBFile(pNode, pParent, ccbReader);\n                if(setProp) {\n                    this->onHandlePropTypeCCBFile(pNode, pParent, propertyName.c_str(), ccbFileNode, ccbReader);\n                }\n                break;\n            }\n            default:\n                ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(type);\n                break;\n        }\n    }\n}\n\nPoint NodeLoader::parsePropTypePosition(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName)\n{\n    float x = ccbReader->readFloat();\n    float y = ccbReader->readFloat();\n    \n    CCBReader::PositionType type = static_cast<CCBReader::PositionType>(ccbReader->readInt(false));\n    \n    Size containerSize = ccbReader->getAnimationManager()->getContainerSize(pParent);\n    \n    Point pt = getAbsolutePosition(Point(x,y), type, containerSize, pPropertyName);\n    pNode->setPosition(pt);\n    \n    if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end())\n    {\n        ValueVector vec;\n        vec.push_back(Value(x));\n        vec.push_back(Value(y));\n        vec.push_back(Value((int)type));\n        \n        ccbReader->getAnimationManager()->setBaseValue(Value(vec), pNode, pPropertyName);\n    }\n\n    return pt;\n}\n\nPoint NodeLoader::parsePropTypePoint(Node * pNode, Node * pParent, CCBReader * ccbReader) \n{\n    float x = ccbReader->readFloat();\n    float y = ccbReader->readFloat();\n\n    return Point(x, y);\n}\n\nPoint NodeLoader::parsePropTypePointLock(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    float x = ccbReader->readFloat();\n    float y = ccbReader->readFloat();\n\n    return Point(x, y);\n}\n\nSize NodeLoader::parsePropTypeSize(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    float width = ccbReader->readFloat();\n    float height = ccbReader->readFloat();\n\n    CCBReader::SizeType type = static_cast<CCBReader::SizeType>(ccbReader->readInt(false));\n\n    Size containerSize = ccbReader->getAnimationManager()->getContainerSize(pParent);\n\n    switch (type) \n    {\n        case CCBReader::SizeType::ABSOLUTE:\n        {\n            /* Nothing. */\n            break;\n        }\n        case CCBReader::SizeType::RELATIVE_CONTAINER:\n        {\n            width = containerSize.width - width;\n            height = containerSize.height - height;\n            break;\n        }\n        case CCBReader::SizeType::PERCENT:\n        {\n            width = (int)(containerSize.width * width / 100.0f);\n            height = (int)(containerSize.height * height / 100.0f);\n            break;\n        }\n        case CCBReader::SizeType::HORIZONTAL_PERCENT:\n        {\n            width = (int)(containerSize.width * width / 100.0f);\n            break;\n        }\n        case CCBReader::SizeType::VERTICAL_PERCENT:\n        {\n            height = (int)(containerSize.height * height / 100.0f);\n            break;\n        }\n        case CCBReader::SizeType::MULTIPLY_RESOLUTION:\n        {\n            float resolutionScale = CCBReader::getResolutionScale();\n            \n            width *= resolutionScale;\n            height *= resolutionScale;\n            break;\n        }\n        default:\n        {\n            log(\"Unknown CCB type.\");\n        }\n            break;\n    }\n    \n    return Size(width, height);\n}\n\n\n\nfloat * NodeLoader::parsePropTypeFloatXY(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    float x = ccbReader->readFloat();\n    float y = ccbReader->readFloat();\n\n    float * floatXY = new float[2];\n    floatXY[0] = x;\n    floatXY[1] = y;\n\n    return floatXY;\n}\n\nfloat * NodeLoader::parsePropTypeScaleLock(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) {\n    float x = ccbReader->readFloat();\n    float y = ccbReader->readFloat();\n    \n    CCBReader::ScaleType type = static_cast<CCBReader::ScaleType>(ccbReader->readInt(false));\n    \n    setRelativeScale(pNode, x, y, type, pPropertyName);\n    \n    if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end())\n    {\n        ValueVector baseValue;\n        baseValue.push_back(Value(x));\n        baseValue.push_back(Value(y));\n        baseValue.push_back(Value((int)type));\n        \n        ccbReader->getAnimationManager()->setBaseValue(Value(baseValue), pNode, pPropertyName);\n    }\n    \n    if (type == CCBReader::ScaleType::MULTIPLY_RESOLUTION) \n    {\n        x *= ccbReader->getResolutionScale();\n        y *= ccbReader->getResolutionScale();\n    }\n    \n    float * scaleLock = new float[2];\n    scaleLock[0] = x;\n    scaleLock[1] = y;\n\n    return scaleLock;\n}\n\nfloat NodeLoader::parsePropTypeFloat(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    return ccbReader->readFloat();\n}\n\nfloat NodeLoader::parsePropTypeDegrees(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) {\n    float ret = ccbReader->readFloat();\n    if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end())\n    {\n        ccbReader->getAnimationManager()->setBaseValue(Value(ret), pNode, pPropertyName);\n    }\n    \n    return ret;\n}\n\nfloat NodeLoader::parsePropTypeFloatScale(Node * pNode, Node * pParent, CCBReader * ccbReader) \n{\n    float f = ccbReader->readFloat();\n\n    CCBReader::ScaleType type = static_cast<CCBReader::ScaleType>(ccbReader->readInt(false));\n    \n    if(type == CCBReader::ScaleType::MULTIPLY_RESOLUTION) \n    {\n        f *= ccbReader->getResolutionScale();\n    }\n\n    return f;\n}\n\nint NodeLoader::parsePropTypeInteger(Node * pNode, Node * pParent, CCBReader * ccbReader) \n{\n    return ccbReader->readInt(true);\n}\n\nint NodeLoader::parsePropTypeIntegerLabeled(Node * pNode, Node * pParent, CCBReader * ccbReader) \n{\n    return ccbReader->readInt(true);\n}\n\nfloat * NodeLoader::parsePropTypeFloatVar(Node * pNode, Node * pParent, CCBReader * ccbReader) \n{\n    float f = ccbReader->readFloat();\n    float fVar = ccbReader->readFloat();\n    \n    float * arr = new float[2];\n    arr[0] = f;\n    arr[1] = fVar;\n    \n    return arr;\n}\n\nbool NodeLoader::parsePropTypeCheck(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) \n{\n    bool ret = ccbReader->readBool();\n    \n    if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end())\n    {\n        ccbReader->getAnimationManager()->setBaseValue(Value(ret), pNode, pPropertyName);\n    }\n    \n    return ret;\n}\n\n\nSpriteFrame * NodeLoader::parsePropTypeSpriteFrame(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) \n{\n    std::string spriteSheet = ccbReader->readCachedString();\n    std::string spriteFile = ccbReader->readCachedString();\n    \n    SpriteFrame *spriteFrame = NULL;\n    if (spriteFile.length() != 0)\n    {\n        if (spriteSheet.length() == 0)\n        {\n            spriteFile = ccbReader->getCCBRootPath() + spriteFile;\n            Texture2D * texture = Director::getInstance()->getTextureCache()->addImage(spriteFile.c_str());\n            if(texture != NULL) {\n                Rect bounds = Rect(0, 0, texture->getContentSize().width, texture->getContentSize().height);\n                spriteFrame = SpriteFrame::createWithTexture(texture, bounds);\n            }\n        }\n        else \n        {\n            SpriteFrameCache * frameCache = SpriteFrameCache::getInstance();\n            spriteSheet = ccbReader->getCCBRootPath() + spriteSheet;   \n            // Load the sprite sheet only if it is not loaded\n            if (ccbReader->getLoadedSpriteSheet().find(spriteSheet) == ccbReader->getLoadedSpriteSheet().end())\n            {\n                frameCache->addSpriteFramesWithFile(spriteSheet.c_str());\n                ccbReader->getLoadedSpriteSheet().insert(spriteSheet);\n            }\n            \n            spriteFrame = frameCache->getSpriteFrameByName(spriteFile.c_str());\n        }\n        \n        if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end())\n        {\n            ccbReader->getAnimationManager()->setObject(spriteFrame, pNode, pPropertyName);\n        }\n    }\n    \n    return spriteFrame;\n}\n\nAnimation * NodeLoader::parsePropTypeAnimation(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    std::string animationFile = ccbReader->getCCBRootPath() + ccbReader->readCachedString();\n    std::string animation = ccbReader->readCachedString();\n    \n    Animation * ccAnimation = NULL;\n    \n    // Support for stripping relative file paths, since ios doesn't currently\n    // know what to do with them, since its pulling from bundle.\n    // Eventually this should be handled by a client side asset manager\n    // interface which figured out what resources to load.\n    // TODO Does this problem exist in C++?\n    animation = CCBReader::lastPathComponent(animation.c_str());\n    animationFile = CCBReader::lastPathComponent(animationFile.c_str());\n    \n    if (animation.length() > 0) \n    {\n        AnimationCache * animationCache = AnimationCache::getInstance();\n        animationCache->addAnimationsWithFile(animationFile.c_str());\n        \n        ccAnimation = animationCache->getAnimation(animation.c_str());\n    }\n    return ccAnimation;\n}\n\nTexture2D * NodeLoader::parsePropTypeTexture(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    std::string spriteFile = ccbReader->getCCBRootPath() + ccbReader->readCachedString();\n    \n    if (spriteFile.length() > 0)\n    {\n        return Director::getInstance()->getTextureCache()->addImage(spriteFile.c_str());\n    }\n    else \n    {\n        return NULL;\n    }\n}\n\nunsigned char NodeLoader::parsePropTypeByte(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) \n{\n    unsigned char ret = ccbReader->readByte();\n    \n    if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end())\n    {\n        ccbReader->getAnimationManager()->setBaseValue(Value(ret), pNode, pPropertyName);\n    }\n    \n    return ret;\n}\n\nColor3B NodeLoader::parsePropTypeColor3(Node * pNode, Node * pParent, CCBReader * ccbReader, const char *pPropertyName) {\n    unsigned char r = ccbReader->readByte();\n    unsigned char g = ccbReader->readByte();\n    unsigned char b = ccbReader->readByte();\n    \n    Color3B color(r, g, b);\n    \n    ValueMap colorMap;\n    colorMap[\"r\"] = r;\n    colorMap[\"g\"] = g;\n    colorMap[\"b\"] = b;\n\n    if (ccbReader->getAnimatedProperties()->find(pPropertyName) != ccbReader->getAnimatedProperties()->end())\n    {\n        ccbReader->getAnimationManager()->setBaseValue(Value(colorMap), pNode, pPropertyName);\n    }\n    return color;\n}\n\nColor4F * NodeLoader::parsePropTypeColor4FVar(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    float red = ccbReader->readFloat();\n    float green = ccbReader->readFloat();\n    float blue = ccbReader->readFloat();\n    float alpha = ccbReader->readFloat();\n    float redVar = ccbReader->readFloat();\n    float greenVar = ccbReader->readFloat();\n    float blueVar = ccbReader->readFloat();\n    float alphaVar = ccbReader->readFloat();\n    \n    Color4F * colors = new Color4F[2];\n    colors[0].r = red;\n    colors[0].g = green;\n    colors[0].b = blue;\n    colors[0].a = alpha;\n    \n    colors[1].r = redVar;\n    colors[1].g = greenVar;\n    colors[1].b = blueVar;\n    colors[1].a = alphaVar;\n    \n    return colors;\n}\n\nbool * NodeLoader::parsePropTypeFlip(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    bool flipX = ccbReader->readBool();\n    bool flipY = ccbReader->readBool();\n\n    bool * arr = new bool[2];\n    arr[0] = flipX;\n    arr[1] = flipY;\n\n    return arr;\n}\n\nBlendFunc NodeLoader::parsePropTypeBlendFunc(Node * pNode, Node * pParent, CCBReader * ccbReader) \n{\n    int source = ccbReader->readInt(false);\n    int destination = ccbReader->readInt(false);\n    \n    BlendFunc blendFunc;\n    blendFunc.src = source;\n    blendFunc.dst = destination;\n    \n    return blendFunc;\n}\n\nstd::string NodeLoader::parsePropTypeFntFile(Node * pNode, Node * pParent, CCBReader * ccbReader) \n{\n    return ccbReader->readCachedString();\n}\n\nstd::string NodeLoader::parsePropTypeString(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    return ccbReader->readCachedString();\n}\n\nstd::string NodeLoader::parsePropTypeText(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    return ccbReader->readCachedString();\n}\n\nstd::string NodeLoader::parsePropTypeFontTTF(Node * pNode, Node * pParent, CCBReader * ccbReader) {\n    std::string fontTTF = ccbReader->readCachedString();\n\n    // String * ttfEnding = String::create(\".ttf\");\n\n    // TODO Fix me if it is wrong\n    /* If the fontTTF comes with the \".ttf\" extension, prepend the absolute path. \n     * System fonts come without the \".ttf\" extension and do not need the path prepended. */\n    /*\n    if(CCBReader::endsWith(CCBReader::toLowerCase(fontTTF), ttfEnding)){\n        fontTTF = CCBReader::concat(ccbReader->getCCBRootPath(), fontTTF);\n    }\n     */\n\n    return fontTTF;\n}\n\nBlockData * NodeLoader::parsePropTypeBlock(Node * pNode, Node * pParent, CCBReader * ccbReader)\n{\n    std::string selectorName = ccbReader->readCachedString();\n    CCBReader::TargetType selectorTarget = static_cast<CCBReader::TargetType>(ccbReader->readInt(false));\n\n    if(selectorTarget != CCBReader::TargetType::NONE)\n    {\n        Object * target = NULL;\n        if(!ccbReader->isJSControlled())\n        {\n            if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT)\n            {\n                target = ccbReader->getAnimationManager()->getRootNode();\n            }\n            else if(selectorTarget == CCBReader::TargetType::OWNER)\n            {\n                target = ccbReader->getOwner();\n            }\n            \n            if(target != NULL)\n            {\n                if(selectorName.length() > 0)\n                {\n                    SEL_MenuHandler selMenuHandler = 0;\n                    \n                    CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);\n                    \n                    if(targetAsCCBSelectorResolver != NULL)\n                    {\n                        selMenuHandler = targetAsCCBSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str());\n                    }\n                    \n                    if(selMenuHandler == 0)\n                    {\n                        CCBSelectorResolver * ccbSelectorResolver = ccbReader->getCCBSelectorResolver();\n                        if(ccbSelectorResolver != NULL)\n                        {\n                            selMenuHandler = ccbSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName.c_str());\n                        }\n                    }\n                    \n                    if(selMenuHandler == 0) {\n                        CCLOG(\"Skipping selector '%s' since no CCBSelectorResolver is present.\", selectorName.c_str());\n                    } else {\n                        BlockData * blockData = new BlockData();\n                        blockData->mSELMenuHandler = selMenuHandler;\n                        \n                        blockData->_target = target;\n                        \n                        return blockData;\n                    }\n                } else {\n                    CCLOG(\"Unexpected empty selector.\");\n                }\n            } else {\n                CCLOG(\"Unexpected NULL target for selector.\");\n            }\n        }\n        else\n        {\n            if (selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT)\n            {\n                ccbReader->addDocumentCallbackNode(pNode);\n                ccbReader->addDocumentCallbackName(selectorName);\n                // Since there isn't a Control::EventType::NONE, add a TOUCH_DOWN type as a placeholder.\n                ccbReader->addDocumentCallbackControlEvents(Control::EventType::TOUCH_DOWN);\n            }\n            else if (selectorTarget == CCBReader::TargetType::OWNER)\n            {\n                ccbReader->addOwnerCallbackNode(pNode);\n                ccbReader->addOwnerCallbackName(selectorName);\n                // Since there isn't a Control::EventType::NONE, add a TOUCH_DOWN type as a placeholder.\n                ccbReader->addOwnerCallbackControlEvents(Control::EventType::TOUCH_DOWN);\n            }\n        }\n    }\n\n    return NULL;\n}\n\nBlockControlData * NodeLoader::parsePropTypeBlockControl(Node * pNode, Node * pParent, CCBReader * ccbReader)\n{\n    std::string selectorName = ccbReader->readCachedString();\n    CCBReader::TargetType selectorTarget = static_cast<CCBReader::TargetType>(ccbReader->readInt(false));\n    int controlEvents = ccbReader->readInt(false);\n\n    if(selectorTarget != CCBReader::TargetType::NONE)\n    {\n        if(!ccbReader->isJSControlled())\n        {\n            Object * target = NULL;\n            if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT)\n            {\n                target = ccbReader->getAnimationManager()->getRootNode();\n            }\n            else if(selectorTarget == CCBReader::TargetType::OWNER)\n            {\n                target = ccbReader->getOwner();\n            }\n            \n            if(target != NULL)\n            {\n                if(selectorName.length() > 0)\n                {\n                    Control::Handler selControlHandler = 0;\n                    \n                    CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);\n                    \n                    if(targetAsCCBSelectorResolver != NULL)\n                    {\n                        selControlHandler = targetAsCCBSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str());\n                    }\n\n                    if(selControlHandler == 0)\n                    {\n                        CCBSelectorResolver * ccbSelectorResolver = ccbReader->getCCBSelectorResolver();\n                        if(ccbSelectorResolver != NULL)\n                        {\n                            selControlHandler = ccbSelectorResolver->onResolveCCBCCControlSelector(target, selectorName.c_str());\n                        }\n                    }\n                    \n                    if(selControlHandler == 0)\n                    {\n                        CCLOG(\"Skipping selector '%s' since no CCBSelectorResolver is present.\", selectorName.c_str());\n                    }\n                    else\n                    {\n                        BlockControlData * blockControlData = new BlockControlData();\n                        blockControlData->mSELControlHandler = selControlHandler;\n                        \n                        blockControlData->_target = target;\n                        blockControlData->mControlEvents = (Control::EventType)controlEvents;\n                        \n                        return blockControlData;\n                    }\n                } else {\n                    CCLOG(\"Unexpected empty selector.\");\n                }\n            } else {\n                CCLOG(\"Unexpected NULL target for selector.\");\n            }\n        }\n        else\n        {\n            if(selectorTarget == CCBReader::TargetType::DOCUMENT_ROOT)\n            {\n                ccbReader->addDocumentCallbackNode(pNode);\n                ccbReader->addDocumentCallbackName(selectorName);\n                ccbReader->addDocumentCallbackControlEvents((Control::EventType)controlEvents);\n            }\n            else\n            {\n                ccbReader->addOwnerCallbackNode(pNode);\n                ccbReader->addOwnerCallbackName(selectorName);\n                ccbReader->addOwnerCallbackControlEvents((Control::EventType)controlEvents);\n            }\n        }\n    }\n\n    return NULL;\n}\n\nNode * NodeLoader::parsePropTypeCCBFile(Node * pNode, Node * pParent, CCBReader * pCCBReader) {\n    std::string ccbFileName = pCCBReader->getCCBRootPath() + pCCBReader->readCachedString();\n\n    /* Change path extension to .ccbi. */\n    std::string ccbFileWithoutPathExtension = CCBReader::deletePathExtension(ccbFileName.c_str());\n    ccbFileName = ccbFileWithoutPathExtension + \".ccbi\";\n    \n    // Load sub file\n    std::string path = FileUtils::getInstance()->fullPathForFilename(ccbFileName.c_str());\n\n    auto dataPtr = std::make_shared<Data>(FileUtils::getInstance()->getDataFromFile(path));\n    \n    CCBReader * reader = new CCBReader(pCCBReader);\n    reader->autorelease();\n    reader->getAnimationManager()->setRootContainerSize(pParent->getContentSize());\n    \n    \n    reader->_data = dataPtr;\n    reader->_bytes = dataPtr->getBytes();\n    reader->_currentByte = 0;\n    reader->_currentBit = 0;\n    CC_SAFE_RETAIN(pCCBReader->_owner);\n    reader->_owner = pCCBReader->_owner;\n    \n    reader->getAnimationManager()->_owner = reader->_owner;\n\n    // The assignments below are done in the CCBReader constructor.\n//     reader->_ownerOutletNames = pCCBReader->_ownerOutletNames;\n//     reader->_ownerOutletNodes = pCCBReader->_ownerOutletNodes;\n//     reader->_ownerOutletNodes->retain();\n//     reader->_ownerCallbackNames = pCCBReader->_ownerCallbackNames;\n//     reader->_ownerCallbackNodes = pCCBReader->_ownerCallbackNodes;\n//     reader->_ownerCallbackNodes->retain();\n\n    \n    Node * ccbFileNode = reader->readFileWithCleanUp(false, pCCBReader->getAnimationManagers());\n    \n    if (ccbFileNode && reader->getAnimationManager()->getAutoPlaySequenceId() != -1)\n    {\n        // Auto play animations\n        reader->getAnimationManager()->runAnimationsForSequenceIdTweenDuration(reader->getAnimationManager()->getAutoPlaySequenceId(), 0);\n    }\n    \n    if (reader->isJSControlled() && pCCBReader->isJSControlled() && NULL == reader->_owner)\n    {\n        //set variables and callback to owner\n        //set callback\n        auto ownerCallbackNames = reader->getOwnerCallbackNames();\n        auto& ownerCallbackNodes = reader->getOwnerCallbackNodes();\n        if (!ownerCallbackNames.empty() && !ownerCallbackNodes.empty())\n        {\n            CCASSERT(ownerCallbackNames.size() == ownerCallbackNodes.size(), \"\");\n            ssize_t nCount = ownerCallbackNames.size();\n            \n            for (ssize_t i = 0 ; i < nCount; i++)\n            {\n                pCCBReader->addOwnerCallbackName(ownerCallbackNames[i].asString());\n                pCCBReader->addOwnerCallbackNode(ownerCallbackNodes.at(i));\n            }\n        }\n        //set variables\n        auto ownerOutletNames = reader->getOwnerOutletNames();\n        auto ownerOutletNodes = reader->getOwnerOutletNodes();\n        if (!ownerOutletNames.empty() && !ownerOutletNodes.empty())\n        {\n            CCASSERT(ownerOutletNames.size() == ownerOutletNodes.size(), \"\");\n            ssize_t nCount = ownerOutletNames.size();\n            \n            for (ssize_t i = 0 ; i < nCount; i++)\n            {\n                pCCBReader->addOwnerOutletName(ownerOutletNames.at(i).asString());\n                pCCBReader->addOwnerOutletNode(ownerOutletNodes.at(i));\n            }\n        }\n    }\n    return ccbFileNode;\n}\n\n\n\nvoid NodeLoader::onHandlePropTypePosition(Node * pNode, Node * pParent, const char* pPropertyName, Point pPosition, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_POSITION) == 0) {\n        pNode->setPosition(pPosition);\n    } else {\n        ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    }\n}\n\nvoid NodeLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char* pPropertyName, Point pPoint, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_ANCHORPOINT) == 0) {\n        pNode->setAnchorPoint(pPoint);\n    } else {\n        ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    }\n}\n\nvoid NodeLoader::onHandlePropTypePointLock(Node * pNode, Node * pParent, const char* pPropertyName, Point pPointLock, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char* pPropertyName, Size pSize, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_CONTENTSIZE) == 0) {\n        pNode->setContentSize(pSize);\n    } else {\n        ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    }\n}\n\nvoid NodeLoader::onHandlePropTypeFloatXY(Node * pNode, Node * pParent, const char* pPropertyName, float * pFloat, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_SKEW) == 0) {\n        pNode->setSkewX(pFloat[0]);\n        pNode->setSkewY(pFloat[1]);\n    } else {\n        ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    }\n}\n\n\nvoid NodeLoader::onHandlePropTypeScaleLock(Node * pNode, Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_SCALE) == 0) {\n        pNode->setScaleX(pScaleLock[0]);\n        pNode->setScaleY(pScaleLock[1]);\n    } else {\n        ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    }\n}\n\nvoid NodeLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader) {\n//    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    // It may be a custom property, add it to custom property dictionary.\n    _customProperties[pPropertyName] = Value(pFloat);\n}\n\n\nvoid NodeLoader::onHandlePropTypeDegrees(Node * pNode, Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_ROTATION) == 0) {\n        pNode->setRotation(pDegrees);\n    } else if(strcmp(pPropertyName, PROPERTY_ROTATIONX) == 0) {\n        pNode->setRotationX(pDegrees);\n    } else if(strcmp(pPropertyName, PROPERTY_ROTATIONY) == 0) {\n        pNode->setRotationY(pDegrees);\n    }\n    else {\n        ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    }\n}\n\nvoid NodeLoader::onHandlePropTypeFloatScale(Node * pNode, Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeInteger(Node * pNode, Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TAG) == 0) {\n        pNode->setTag(pInteger);\n    } else {\n //       ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n        // It may be a custom property, add it to custom property dictionary.\n        _customProperties[pPropertyName] = Value(pInteger);\n    }\n}\n\nvoid NodeLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char* pPropertyName, float * pFloatVar, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_VISIBLE) == 0) {\n        pNode->setVisible(pCheck);\n    } else if(strcmp(pPropertyName, PROPERTY_IGNOREANCHORPOINTFORPOSITION) == 0) {\n        pNode->ignoreAnchorPointForPosition(pCheck);\n    } else {\n        //ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n        // It may be a custom property, add it to custom property dictionary.\n        _customProperties[pPropertyName] = Value(pCheck);\n    }\n}\n\nvoid NodeLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char* pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeAnimation(Node * pNode, Node * pParent, const char* pPropertyName, Animation * pAnimation, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeTexture(Node * pNode, Node * pParent, const char* pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char* pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char* pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeFlip(Node * pNode, Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char* pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeFntFile(Node * pNode, Node * pParent, const char* pPropertyName, const char* pFntFile, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeString(Node * pNode, Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader) {\n//    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n    // It may be a custom property, add it to custom property dictionary.\n    _customProperties[pPropertyName] = Value(pString);\n}\n\nvoid NodeLoader::onHandlePropTypeText(Node * pNode, Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeFontTTF(Node * pNode, Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeBlock(Node * pNode, Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeBlockControl(Node * pNode, Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\nvoid NodeLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char* pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader) {\n    ASSERT_FAIL_UNEXPECTED_PROPERTY(pPropertyName);\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCNodeLoader.h",
    "content": "#ifndef _CCB_CCNODELOADER_H_\n#define _CCB_CCNODELOADER_H_\n\n#include \"extensions/GUI/CCControlExtension/CCInvocation.h\"\n#include \"CCBReader.h\"\n#include \"extensions/GUI/CCControlExtension/CCControl.h\"\n\nnamespace cocosbuilder {\n\n#define PROPERTY_POSITION \"position\"\n#define PROPERTY_CONTENTSIZE \"contentSize\"\n#define PROPERTY_SKEW \"skew\"\n#define PROPERTY_ANCHORPOINT \"anchorPoint\"\n#define PROPERTY_SCALE \"scale\"\n#define PROPERTY_ROTATION \"rotation\"\n#define PROPERTY_ROTATIONX \"rotationX\"\n#define PROPERTY_ROTATIONY \"rotationY\"\n#define PROPERTY_TAG \"tag\"\n#define PROPERTY_IGNOREANCHORPOINTFORPOSITION \"ignoreAnchorPointForPosition\"\n#define PROPERTY_VISIBLE \"visible\"\n\n#define ASSERT_FAIL_UNEXPECTED_PROPERTY(PROPERTY) cocos2d::log(\"Unexpected property: '%s'!\\n\", PROPERTY); assert(false)\n#define ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(PROPERTYTYPE) cocos2d::log(\"Unexpected property type: '%d'!\\n\", PROPERTYTYPE); assert(false)\n\n#define CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { \\\n    return T::create(); \\\n}\n\n#define CCB_PURE_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(T) virtual T * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) = 0\n\nstruct BlockData {\n    cocos2d::SEL_MenuHandler mSELMenuHandler;\n    cocos2d::Object * _target;\n};\n\nstruct BlockControlData {\n    cocos2d::extension::Control::Handler mSELControlHandler;\n    cocos2d::Object * _target;\n    cocos2d::extension::Control::EventType mControlEvents;\n};\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass NodeLoader : public cocos2d::Object {\n    public:\n        /**\n         * @js NA\n         * @lua NA\n         */\n        NodeLoader();\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual ~NodeLoader();\n        /**\n         * @js NA\n         * @lua NA\n         */\n        CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(NodeLoader, loader);\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual cocos2d::Node * loadNode(cocos2d::Node *, CCBReader * ccbReader);\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual void parseProperties(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual cocos2d::ValueMap& getCustomProperties();\n    \n    protected:\n        CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Node);\n\n        virtual cocos2d::Point parsePropTypePosition(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);\n        virtual cocos2d::Point parsePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual cocos2d::Point parsePropTypePointLock(cocos2d::Node * pNode,cocos2d:: Node * pParent, CCBReader * ccbReader);\n        virtual cocos2d::Size parsePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual float * parsePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);\n        virtual float parsePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual float parsePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);\n        virtual float parsePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual int parsePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual int parsePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual float * parsePropTypeFloatVar(cocos2d::Node * pNode,cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual bool parsePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);\n        virtual cocos2d::SpriteFrame * parsePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);\n        virtual cocos2d::Animation * parsePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual cocos2d::Texture2D * parsePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual unsigned char parsePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);\n        virtual cocos2d::Color3B parsePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader, const char *pPropertyName);\n        virtual cocos2d::Color4F * parsePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual bool * parsePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual cocos2d::BlendFunc parsePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual std::string parsePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual std::string parsePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual std::string parsePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual std::string parsePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual BlockData * parsePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual BlockControlData * parsePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual cocos2d::Node * parsePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n        virtual float * parsePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, CCBReader * ccbReader);\n\n\n        virtual void onHandlePropTypePosition(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char* pPropertyName, cocos2d::Point pPosition, CCBReader * ccbReader);\n        virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);\n        virtual void onHandlePropTypePointLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Point pPointLock, CCBReader * ccbReader);\n        virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);\n        virtual void onHandlePropTypeScaleLock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pScaleLock, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloat, CCBReader * ccbReader);\n        virtual void onHandlePropTypeDegrees(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pDegrees, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFloatScale(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float pFloatScale, CCBReader * ccbReader);\n        virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pInteger, CCBReader * ccbReader);\n        virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFloatXY(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, float * pFoatVar, CCBReader * ccbReader);\n\n        virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool pCheck, CCBReader * ccbReader);\n        virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);\n        virtual void onHandlePropTypeAnimation(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Animation * pAnimation, CCBReader * ccbReader);\n        virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader);\n        virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, unsigned char pByte, CCBReader * ccbReader);\n        virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n        virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, bool * pFlip, CCBReader * ccbReader);\n        virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFntFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFntFile, CCBReader * ccbReader);\n        virtual void onHandlePropTypeString(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pString, CCBReader * ccbReader);\n        virtual void onHandlePropTypeText(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pText, CCBReader * ccbReader);\n        virtual void onHandlePropTypeFontTTF(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, const char * pFontTTF, CCBReader * ccbReader);\n        virtual void onHandlePropTypeBlock(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockData * pBlockData, CCBReader * ccbReader);\n        virtual void onHandlePropTypeBlockControl(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, BlockControlData * pBlockControlData, CCBReader * ccbReader);\n        virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char* pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader);\n\nprotected:\n        cocos2d::ValueMap _customProperties;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp",
    "content": "#include \"CCNodeLoaderLibrary.h\"\n\n#include \"CCLayerLoader.h\"\n#include \"CCLayerColorLoader.h\"\n#include \"CCLayerGradientLoader.h\"\n#include \"CCLabelBMFontLoader.h\"\n#include \"CCLabelTTFLoader.h\"\n#include \"CCSpriteLoader.h\"\n#include \"CCScale9SpriteLoader.h\"\n#include \"CCBFileLoader.h\"\n#include \"CCMenuLoader.h\"\n#include \"CCMenuItemLoader.h\"\n#include \"CCMenuItemImageLoader.h\"\n#include \"CCControlButtonLoader.h\"\n#include \"CCParticleSystemQuadLoader.h\"\n#include \"CCScrollViewLoader.h\"\n\nusing namespace cocos2d;\n\nnamespace cocosbuilder {\n\nNodeLoaderLibrary::NodeLoaderLibrary() {\n\n}\n\nNodeLoaderLibrary::~NodeLoaderLibrary() {\n    this->purge(true);\n}\n\nvoid NodeLoaderLibrary::registerDefaultNodeLoaders() {\n    this->registerNodeLoader(\"CCNode\", NodeLoader::loader());\n    this->registerNodeLoader(\"CCLayer\", LayerLoader::loader());\n    this->registerNodeLoader(\"CCLayerColor\", LayerColorLoader::loader());\n    this->registerNodeLoader(\"CCLayerGradient\", LayerGradientLoader::loader());\n    this->registerNodeLoader(\"CCSprite\", SpriteLoader::loader());\n    this->registerNodeLoader(\"CCLabelBMFont\", LabelBMFontLoader::loader());\n    this->registerNodeLoader(\"CCLabelTTF\", LabelTTFLoader::loader());\n    this->registerNodeLoader(\"CCScale9Sprite\", Scale9SpriteLoader::loader());\n    this->registerNodeLoader(\"CCScrollView\", ScrollViewLoader::loader());\n    this->registerNodeLoader(\"CCBFile\", CCBFileLoader::loader());\n    this->registerNodeLoader(\"CCMenu\", MenuLoader::loader());\n    this->registerNodeLoader(\"CCMenuItemImage\", MenuItemImageLoader::loader());\n    this->registerNodeLoader(\"CCControlButton\", ControlButtonLoader::loader());\n    this->registerNodeLoader(\"CCParticleSystemQuad\", ParticleSystemQuadLoader::loader());\n}\n\nvoid NodeLoaderLibrary::registerNodeLoader(const char * pClassName, NodeLoader * pNodeLoader) {\n    pNodeLoader->retain();\n    this->_nodeLoaders.insert(NodeLoaderMapEntry(pClassName, pNodeLoader));\n}\n\nvoid NodeLoaderLibrary::unregisterNodeLoader(const char * pClassName) {\n    NodeLoaderMap::iterator ccNodeLoadersIterator = this->_nodeLoaders.find(pClassName);\n    if (ccNodeLoadersIterator != this->_nodeLoaders.end())\n    {\n        ccNodeLoadersIterator->second->release();\n        _nodeLoaders.erase(ccNodeLoadersIterator);\n    }\n    else\n    {\n        CCLOG(\"The loader (%s) doesn't exist\", pClassName);\n    }\n}\n\nNodeLoader * NodeLoaderLibrary::getNodeLoader(const char* pClassName) {\n    NodeLoaderMap::iterator ccNodeLoadersIterator = this->_nodeLoaders.find(pClassName);\n    assert(ccNodeLoadersIterator != this->_nodeLoaders.end());\n    return ccNodeLoadersIterator->second;\n}\n\nvoid NodeLoaderLibrary::purge(bool pReleaseNodeLoaders) {\n    if(pReleaseNodeLoaders) {\n        for(NodeLoaderMap::iterator it = this->_nodeLoaders.begin(); it != this->_nodeLoaders.end(); it++) {\n            it->second->release();\n        }\n    }\n    this->_nodeLoaders.clear();\n}\n\n\n\nstatic NodeLoaderLibrary * sSharedNodeLoaderLibrary = NULL;\n\nNodeLoaderLibrary * NodeLoaderLibrary::getInstance() {\n    if(sSharedNodeLoaderLibrary == NULL) {\n        sSharedNodeLoaderLibrary = new NodeLoaderLibrary();\n\n        sSharedNodeLoaderLibrary->registerDefaultNodeLoaders();\n    }\n    return sSharedNodeLoaderLibrary;\n}\n\nvoid NodeLoaderLibrary::destroyInstance() {\n    CC_SAFE_DELETE(sSharedNodeLoaderLibrary);\n}\n\nNodeLoaderLibrary * NodeLoaderLibrary::newDefaultNodeLoaderLibrary() {\n    NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::library();\n    \n    ccNodeLoaderLibrary->registerDefaultNodeLoaders();\n\n    return ccNodeLoaderLibrary;\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h",
    "content": "#ifndef _CCB_CCNODELOADERLIBRARY_H_\n#define _CCB_CCNODELOADERLIBRARY_H_\n\n#include \"CCBReader.h\"\n\nnamespace cocosbuilder {\n\nclass NodeLoader;\n\ntypedef std::map<std::string, NodeLoader *> NodeLoaderMap;\ntypedef std::pair<std::string, NodeLoader *> NodeLoaderMapEntry;\n\nclass NodeLoaderLibrary : public cocos2d::Object\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(NodeLoaderLibrary, library);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    NodeLoaderLibrary();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~NodeLoaderLibrary();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void registerDefaultNodeLoaders();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void registerNodeLoader(const char * pClassName, NodeLoader * pNodeLoader);\n    //void registerNodeLoader(String * pClassName, NodeLoader * pNodeLoader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void unregisterNodeLoader(const char * pClassName);\n    //void unregisterNodeLoader(String * pClassName);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    NodeLoader * getNodeLoader(const char * pClassName);\n    //CCNodeLoader * getNodeLoader(String * pClassName);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void purge(bool pDelete);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE void registerDefaultCCNodeLoaders() { registerDefaultNodeLoaders(); }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE void registerCCNodeLoader(const char * pClassName, NodeLoader * pNodeLoader) { registerNodeLoader(pClassName, pNodeLoader); };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE void unregisterCCNodeLoader(const char * pClassName) { unregisterNodeLoader(pClassName); };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE NodeLoader * getCCNodeLoader(const char * pClassName) { return getNodeLoader(pClassName); };\n    \npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static NodeLoaderLibrary * getInstance();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static void destroyInstance();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static NodeLoaderLibrary * newDefaultNodeLoaderLibrary();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static NodeLoaderLibrary * sharedNodeLoaderLibrary() { return NodeLoaderLibrary::getInstance(); };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static void purgeSharedNodeLoaderLibrary() { NodeLoaderLibrary::destroyInstance(); };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE static NodeLoaderLibrary * newDefaultCCNodeLoaderLibrary() { return NodeLoaderLibrary::newDefaultNodeLoaderLibrary(); };\n    \nprivate:\n    NodeLoaderMap _nodeLoaders;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h",
    "content": "#ifndef _CCB_CCNODELOADERLISTENER_H_\n#define _CCB_CCNODELOADERLISTENER_H_\n\n\nnamespace cocosbuilder {\n\nclass NodeLoaderListener {\n    public:\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual ~NodeLoaderListener() {};\n        /**\n         * @js NA\n         * @lua NA\n         */\n        virtual void onNodeLoaded(cocos2d::Node * pNode, NodeLoader * pNodeLoader) = 0;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp",
    "content": "#include \"CCParticleSystemQuadLoader.h\"\n\nusing namespace cocos2d;\n\n#define PROPERTY_EMITERMODE \"emitterMode\"\n#define PROPERTY_POSVAR \"posVar\"\n#define PROPERTY_EMISSIONRATE \"emissionRate\"\n#define PROPERTY_DURATION \"duration\"\n#define PROPERTY_TOTALPARTICLES \"totalParticles\"\n#define PROPERTY_LIFE \"life\"\n#define PROPERTY_STARTSIZE \"startSize\"\n#define PROPERTY_ENDSIZE \"endSize\"\n#define PROPERTY_STARTSPIN \"startSpin\"\n#define PROPERTY_ENDSPIN \"endSpin\"\n#define PROPERTY_ANGLE \"angle\"\n#define PROPERTY_STARTCOLOR \"startColor\"\n#define PROPERTY_ENDCOLOR \"endColor\"\n#define PROPERTY_BLENDFUNC \"blendFunc\"\n#define PROPERTY_GRAVITY \"gravity\"\n#define PROPERTY_SPEED \"speed\"\n#define PROPERTY_TANGENTIALACCEL \"tangentialAccel\"\n#define PROPERTY_RADIALACCEL \"radialAccel\"\n#define PROPERTY_TEXTURE \"texture\"\n#define PROPERTY_STARTRADIUS \"startRadius\"\n#define PROPERTY_ENDRADIUS \"endRadius\"\n#define PROPERTY_ROTATEPERSECOND \"rotatePerSecond\"\n\nnamespace cocosbuilder {\n\nvoid ParticleSystemQuadLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_EMITERMODE) == 0) {\n        ((ParticleSystemQuad *)pNode)->setEmitterMode((ParticleSystem::Mode)pIntegerLabeled);\n    } else {\n        NodeLoader::onHandlePropTypeIntegerLabeled(pNode, pParent, pPropertyName, pIntegerLabeled, ccbReader);\n    }\n}\n\nvoid ParticleSystemQuadLoader::onHandlePropTypePoint(Node * pNode, Node * pParent, const char * pPropertyName, Point pPoint, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_POSVAR) == 0) {\n        ((ParticleSystemQuad *)pNode)->setPosVar(pPoint);\n    } else if(strcmp(pPropertyName, PROPERTY_GRAVITY) == 0) {\n        ((ParticleSystemQuad *)pNode)->setGravity(pPoint);\n    } else {\n        NodeLoader::onHandlePropTypePoint(pNode, pParent, pPropertyName, pPoint, ccbReader);\n    }\n}\n\nvoid ParticleSystemQuadLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_EMISSIONRATE) == 0) {\n        ((ParticleSystemQuad *)pNode)->setEmissionRate(pFloat);\n    } else if(strcmp(pPropertyName, PROPERTY_DURATION) == 0) {\n        ((ParticleSystemQuad *)pNode)->setDuration(pFloat);\n    } else {\n        NodeLoader::onHandlePropTypeFloat(pNode, pParent, pPropertyName, pFloat, ccbReader);\n    }\n}\n\nvoid ParticleSystemQuadLoader::onHandlePropTypeInteger(Node * pNode, Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TOTALPARTICLES) == 0) {\n        ((ParticleSystemQuad *)pNode)->setTotalParticles(pInteger);\n    } else {\n        NodeLoader::onHandlePropTypeInteger(pNode, pParent, pPropertyName, pInteger, ccbReader);\n    }\n}\n\nvoid ParticleSystemQuadLoader::onHandlePropTypeFloatVar(Node * pNode, Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_LIFE) == 0) {\n        ((ParticleSystemQuad *)pNode)->setLife(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setLifeVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_STARTSIZE) == 0) {\n        ((ParticleSystemQuad *)pNode)->setStartSize(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setStartSizeVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_ENDSIZE) == 0) {\n        ((ParticleSystemQuad *)pNode)->setEndSize(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setEndSizeVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_STARTSPIN) == 0) {\n        ((ParticleSystemQuad *)pNode)->setStartSpin(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setStartSpinVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_ENDSPIN) == 0) {\n        ((ParticleSystemQuad *)pNode)->setEndSpin(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setEndSpinVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_ANGLE) == 0) {\n        ((ParticleSystemQuad *)pNode)->setAngle(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setAngleVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_SPEED) == 0) {\n        ((ParticleSystemQuad *)pNode)->setSpeed(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setSpeedVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_TANGENTIALACCEL) == 0) {\n        ((ParticleSystemQuad *)pNode)->setTangentialAccel(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setTangentialAccelVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_RADIALACCEL) == 0) {\n        ((ParticleSystemQuad *)pNode)->setRadialAccel(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setRadialAccelVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_STARTRADIUS) == 0) {\n        ((ParticleSystemQuad *)pNode)->setStartRadius(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setStartRadiusVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_ENDRADIUS) == 0) {\n        ((ParticleSystemQuad *)pNode)->setEndRadius(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setEndRadiusVar(pFloatVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_ROTATEPERSECOND) == 0) {\n        ((ParticleSystemQuad *)pNode)->setRotatePerSecond(pFloatVar[0]);\n        ((ParticleSystemQuad *)pNode)->setRotatePerSecondVar(pFloatVar[1]);\n    } else {\n        NodeLoader::onHandlePropTypeFloatVar(pNode, pParent, pPropertyName, pFloatVar, ccbReader);\n    }\n}\n\nvoid ParticleSystemQuadLoader::onHandlePropTypeColor4FVar(Node * pNode, Node * pParent, const char * pPropertyName, Color4F * pColor4FVar, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_STARTCOLOR) == 0) {\n        ((ParticleSystemQuad *)pNode)->setStartColor(pColor4FVar[0]);\n        ((ParticleSystemQuad *)pNode)->setStartColorVar(pColor4FVar[1]);\n    } else if(strcmp(pPropertyName, PROPERTY_ENDCOLOR) == 0) {\n        ((ParticleSystemQuad *)pNode)->setEndColor(pColor4FVar[0]);\n        ((ParticleSystemQuad *)pNode)->setEndColorVar(pColor4FVar[1]);\n    } else {\n        NodeLoader::onHandlePropTypeColor4FVar(pNode, pParent, pPropertyName, pColor4FVar, ccbReader);\n    }\n}\n\nvoid ParticleSystemQuadLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {\n        ((ParticleSystemQuad *)pNode)->setBlendFunc(pBlendFunc);\n    } else {\n        NodeLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pBlendFunc, ccbReader);\n    }\n}\n\nvoid ParticleSystemQuadLoader::onHandlePropTypeTexture(Node * pNode, Node * pParent, const char * pPropertyName, Texture2D * pTexture2D, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_TEXTURE) == 0) {\n        static_cast<ParticleSystemQuad*>(pNode)->setTexture(pTexture2D);\n        if(pTexture2D)\n        {\n            static_cast<ParticleSystemQuad*>(pNode)->setBlendAdditive(true);\n        }\n    } else {\n        NodeLoader::onHandlePropTypeTexture(pNode, pParent, pPropertyName, pTexture2D, ccbReader);\n    }\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h",
    "content": "#ifndef _CCB_CCPARTICLESYSTEMQUADLOADER_H_\n#define _CCB_CCPARTICLESYSTEMQUADLOADER_H_\n\n#include \"CCObject.h\"\n#include \"CCParticleSystemQuad.h\"\n\n#include \"CCNodeLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass ParticleSystemQuadLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleSystemQuadLoader() {};\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(cocosbuilder::ParticleSystemQuadLoader, loader);\n\nprotected:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::ParticleSystemQuad);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypePoint(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Point pPoint, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeInteger(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pInteger, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeFloatVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float * pFloatVar, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeColor4FVar(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color4F * pColor4FVar, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeTexture(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Texture2D * pTexture2D, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp",
    "content": "#include \"CCScale9SpriteLoader.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\n#define PROPERTY_CONTENTSIZE \"contentSize\"\n#define PROPERTY_SPRITEFRAME \"spriteFrame\"\n#define PROPERTY_COLOR \"color\"\n#define PROPERTY_OPACITY \"opacity\"\n#define PROPERTY_BLENDFUNC \"blendFunc\"\n#define PROPERTY_PREFEREDSIZE \"preferedSize\" // TODO Should be \"preferredSize\". This is a typo in cocos2d-iphone, cocos2d-x and CocosBuilder!\n#define PROPERTY_INSETLEFT \"insetLeft\"\n#define PROPERTY_INSETTOP \"insetTop\"\n#define PROPERTY_INSETRIGHT \"insetRight\"\n#define PROPERTY_INSETBOTTOM \"insetBottom\"\n\nnamespace cocosbuilder {\n\nvoid Scale9SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_SPRITEFRAME) == 0) {\n        ((Scale9Sprite *)pNode)->setSpriteFrame(pSpriteFrame);\n    } else {\n        NodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pSpriteFrame, ccbReader);\n    }\n}\n\nvoid Scale9SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) {\n        ((Scale9Sprite *)pNode)->setColor(pColor3B);\n    } else {\n        NodeLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader);\n    }\n}\n\nvoid Scale9SpriteLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_OPACITY) == 0) {\n        ((Scale9Sprite *)pNode)->setOpacity(pByte);\n    } else {\n        NodeLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, ccbReader);\n    }\n}\n\nvoid Scale9SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {\n        // TODO Not exported by CocosBuilder yet!\n        // ((Scale9Sprite *)pNode)->setBlendFunc(pBlendFunc);\n    } else {\n        NodeLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pBlendFunc, ccbReader);\n    }\n}\n\nvoid Scale9SpriteLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_CONTENTSIZE) == 0) {\n        //((Scale9Sprite *)pNode)->setContentSize(pSize);\n    } else if(strcmp(pPropertyName, PROPERTY_PREFEREDSIZE) == 0) {\n        ((Scale9Sprite *)pNode)->setPreferredSize(pSize);\n    } else {\n        NodeLoader::onHandlePropTypeSize(pNode, pParent, pPropertyName, pSize, ccbReader);\n    }\n}\n\nvoid Scale9SpriteLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_INSETLEFT) == 0) {\n        ((Scale9Sprite *)pNode)->setInsetLeft(pFloat);\n    } else if(strcmp(pPropertyName, PROPERTY_INSETTOP) == 0) {\n        ((Scale9Sprite *)pNode)->setInsetTop(pFloat);\n    } else if(strcmp(pPropertyName, PROPERTY_INSETRIGHT) == 0) {\n        ((Scale9Sprite *)pNode)->setInsetRight(pFloat);\n    } else if(strcmp(pPropertyName, PROPERTY_INSETBOTTOM) == 0) {\n        ((Scale9Sprite *)pNode)->setInsetBottom(pFloat);\n    } else {\n        NodeLoader::onHandlePropTypeFloat(pNode, pParent, pPropertyName, pFloat, ccbReader);\n    }\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h",
    "content": "#ifndef _CCB_CCSCALE9SPRITELOADER_H_\n#define _CCB_CCSCALE9SPRITELOADER_H_\n\n#include \"CCNodeLoader.h\"\n#include \"CCScale9SpriteLoader.h\"\n#include \"extensions/GUI/CCControlExtension/CCScale9Sprite.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass Scale9SpriteLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Scale9SpriteLoader() {};\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(Scale9SpriteLoader, loader);\n\nprotected:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual cocos2d::extension::Scale9Sprite * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) {\n        cocos2d::extension::Scale9Sprite* pNode = cocos2d::extension::Scale9Sprite::create();\n        \n        pNode->setAnchorPoint(cocos2d::Point(0,0));\n        \n        return pNode;\n    };\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pBlendFunc, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp",
    "content": "#include \"CCScrollViewLoader.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\n#define PROPERTY_CONTAINER \"container\"\n#define PROPERTY_DIRECTION \"direction\"\n#define PROPERTY_CLIPSTOBOUNDS \"clipsToBounds\"\n#define PROPERTY_BOUNCES \"bounces\"\n#define PROPERTY_SCALE \"scale\"\n\nnamespace cocosbuilder {\n\nvoid ScrollViewLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, const char * pPropertyName, Size pSize, CCBReader * ccbReader) {\n\tif(strcmp(pPropertyName, PROPERTY_CONTENTSIZE) == 0) {\n\t\t((ScrollView *)pNode)->setViewSize(pSize);\n\t} else {\n\t\tNodeLoader::onHandlePropTypeSize(pNode, pParent, pPropertyName, pSize, ccbReader);\n\t}\n}\n\nvoid ScrollViewLoader::onHandlePropTypeCheck(Node * pNode, Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_CLIPSTOBOUNDS) == 0) {\n        ((ScrollView *)pNode)->setClippingToBounds(pCheck);\n    } else if(strcmp(pPropertyName, PROPERTY_BOUNCES) == 0) {\n        ((ScrollView *)pNode)->setBounceable(pCheck);\n    } else {\n        NodeLoader::onHandlePropTypeCheck(pNode, pParent, pPropertyName, pCheck, ccbReader);\n    }\n}\n\nvoid ScrollViewLoader::onHandlePropTypeCCBFile(Node * pNode, Node * pParent, const char * pPropertyName, Node * pCCBFileNode, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_CONTAINER) == 0) {\n        ((ScrollView *)pNode)->setContainer(pCCBFileNode);\n\t\t((ScrollView *)pNode)->updateInset();\n    } else {\n        NodeLoader::onHandlePropTypeCCBFile(pNode, pParent, pPropertyName, pCCBFileNode, ccbReader);\n    }\n}\n\nvoid ScrollViewLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_SCALE) == 0) {\n        ((ScrollView *)pNode)->setScale(pFloat);\n    } else {\n        NodeLoader::onHandlePropTypeFloat(pNode, pParent, pPropertyName, pFloat, ccbReader);\n    }\n}\n\nvoid ScrollViewLoader::onHandlePropTypeIntegerLabeled(Node * pNode, Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_DIRECTION) == 0) {\n        ((ScrollView *)pNode)->setDirection(ScrollView::Direction(pIntegerLabeled));\n    } else {\n        NodeLoader::onHandlePropTypeFloatScale(pNode, pParent, pPropertyName, pIntegerLabeled, ccbReader);\n    }\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCScrollViewLoader.h",
    "content": "#ifndef _CCB_CCSCROLLVIEWLOADER_H_\n#define _CCB_CCSCROLLVIEWLOADER_H_\n\n#include \"CCNodeLoader.h\"\n#include \"extensions/GUI/CCScrollView/CCScrollView.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass ScrollViewLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ScrollViewLoader() {};\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(ScrollViewLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::extension::ScrollView);\n    virtual void onHandlePropTypeSize(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Size pSize, CCBReader * ccbReader);\n    virtual void onHandlePropTypeCCBFile(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Node * pCCBFileNode, CCBReader * ccbReader);\n    virtual void onHandlePropTypeCheck(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool pCheck, CCBReader * ccbReader);\n    virtual void onHandlePropTypeFloat(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader);\n    virtual void onHandlePropTypeIntegerLabeled(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, int pIntegerLabeled, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp",
    "content": "#include \"CCSpriteLoader.h\"\n\nusing namespace cocos2d;\n\n#define PROPERTY_FLIP \"flip\"\n#define PROPERTY_DISPLAYFRAME \"displayFrame\"\n#define PROPERTY_COLOR \"color\"\n#define PROPERTY_OPACITY \"opacity\"\n#define PROPERTY_BLENDFUNC \"blendFunc\"\n\nnamespace cocosbuilder {\n\nvoid SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_DISPLAYFRAME) == 0) {\n        if(pSpriteFrame != NULL) {\n            ((Sprite *)pNode)->setSpriteFrame(pSpriteFrame);\n        } else {\n            CCLOG(\"ERROR: SpriteFrame NULL\");\n        }\n    } else {\n        NodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pSpriteFrame, ccbReader);\n    }\n}\n\nvoid SpriteLoader::onHandlePropTypeFlip(Node * pNode, Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_FLIP) == 0) {\n        ((Sprite *)pNode)->setFlippedX(pFlip[0]);\n        ((Sprite *)pNode)->setFlippedY(pFlip[1]);\n    } else {\n        NodeLoader::onHandlePropTypeFlip(pNode, pParent, pPropertyName, pFlip, ccbReader);\n    }\n}\n\nvoid SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) {\n        ((Sprite *)pNode)->setColor(pColor3B);\n    } else {\n        NodeLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader);\n    }\n}\n\nvoid SpriteLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_OPACITY) == 0) {\n        ((Sprite *)pNode)->setOpacity(pByte);\n    } else {\n        NodeLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, ccbReader);\n    }\n}\n\nvoid SpriteLoader::onHandlePropTypeBlendFunc(Node * pNode, Node * pParent, const char * pPropertyName, BlendFunc pBlendFunc, CCBReader * ccbReader) {\n    if(strcmp(pPropertyName, PROPERTY_BLENDFUNC) == 0) {\n        ((Sprite *)pNode)->setBlendFunc(pBlendFunc);\n    } else {\n        NodeLoader::onHandlePropTypeBlendFunc(pNode, pParent, pPropertyName, pBlendFunc, ccbReader);\n    }\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CCSpriteLoader.h",
    "content": "#ifndef _CCB_CCSPRITELOADER_H_\n#define _CCB_CCSPRITELOADER_H_\n\n#include \"CCNodeLoader.h\"\n\nnamespace cocosbuilder {\n\n/* Forward declaration. */\nclass CCBReader;\n\nclass SpriteLoader : public NodeLoader {\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~SpriteLoader() {};\n    /**\n     * @js NA\n     * @lua NA\n     */\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(SpriteLoader, loader);\n\nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(cocos2d::Sprite);\n\n    virtual void onHandlePropTypeColor3(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::Color3B pColor3B, CCBReader * ccbReader);\n    virtual void onHandlePropTypeByte(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader);\n    virtual void onHandlePropTypeBlendFunc(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::BlendFunc pCCBBlendFunc, CCBReader * ccbReader);\n    virtual void onHandlePropTypeSpriteFrame(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, cocos2d::SpriteFrame * pSpriteFrame, CCBReader * ccbReader);\n    virtual void onHandlePropTypeFlip(cocos2d::Node * pNode, cocos2d::Node * pParent, const char * pPropertyName, bool * pFlip, CCBReader * ccbReader);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CMakeLists.txt",
    "content": "set(CCB_SRC\n  CCBFileLoader.cpp\n  CCMenuItemImageLoader.cpp\n  CCBReader.cpp\n  CCMenuItemLoader.cpp\n  CCControlButtonLoader.cpp\n  CCNodeLoader.cpp\n  CCControlLoader.cpp\n  CCNodeLoaderLibrary.cpp\n  CCLabelBMFontLoader.cpp\n  CCParticleSystemQuadLoader.cpp\n  CCLabelTTFLoader.cpp\n  CCScale9SpriteLoader.cpp\n  CCLayerColorLoader.cpp\n  CCScrollViewLoader.cpp\n  CCLayerGradientLoader.cpp\n  CCSpriteLoader.cpp\n  CCLayerLoader.cpp\n  CCBAnimationManager.cpp\n  CCBKeyframe.cpp\n  CCBSequence.cpp\n  CCBSequenceProperty.cpp\n  CCNode+CCBRelativePositioning.cpp\n)\n\ninclude_directories(\n  ..\n)\n\nadd_library(cocosbuilder STATIC\n  ${CCB_SRC}\n)\n\nset_target_properties(cocosbuilder\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/CocosBuilder.h",
    "content": "#ifndef __EDITOR_SUPPORT_COCOSBUILDER_H__\n#define __EDITOR_SUPPORT_COCOSBUILDER_H__\n\n#include \"cocosbuilder/CCBAnimationManager.h\"\n#include \"cocosbuilder/CCBFileLoader.h\"\n#include \"cocosbuilder/CCBKeyframe.h\"\n#include \"cocosbuilder/CCBMemberVariableAssigner.h\"\n#include \"cocosbuilder/CCBReader.h\"\n#include \"cocosbuilder/CCBSelectorResolver.h\"\n#include \"cocosbuilder/CCBSequence.h\"\n#include \"cocosbuilder/CCBSequenceProperty.h\"\n#include \"cocosbuilder/CCControlButtonLoader.h\"\n#include \"cocosbuilder/CCControlLoader.h\"\n#include \"cocosbuilder/CCLabelBMFontLoader.h\"\n#include \"cocosbuilder/CCLabelTTFLoader.h\"\n#include \"cocosbuilder/CCLayerColorLoader.h\"\n#include \"cocosbuilder/CCLayerGradientLoader.h\"\n#include \"cocosbuilder/CCLayerLoader.h\"\n#include \"cocosbuilder/CCMenuItemImageLoader.h\"\n#include \"cocosbuilder/CCMenuItemLoader.h\"\n#include \"cocosbuilder/CCMenuLoader.h\"\n#include \"cocosbuilder/CCNode+CCBRelativePositioning.h\"\n#include \"cocosbuilder/CCNodeLoader.h\"\n#include \"cocosbuilder/CCNodeLoaderLibrary.h\"\n#include \"cocosbuilder/CCNodeLoaderListener.h\"\n#include \"cocosbuilder/CCParticleSystemQuadLoader.h\"\n#include \"cocosbuilder/CCScale9SpriteLoader.h\"\n#include \"cocosbuilder/CCScrollViewLoader.h\"\n#include \"cocosbuilder/CCSpriteLoader.h\"\n\n#endif // __EDITOR_SUPPORT_COCOSBUILDER_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}</ProjectGuid>\n    <RootNamespace>libCocosBuilder</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>\n      </SDLCheck>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\\audio\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MinimalRebuild>false</MinimalRebuild>\n      <DebugInformationFormat>OldStyle</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>\n      </SDLCheck>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)extensions;$(EngineRoot)cocos\\audio\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\CCBAnimationManager.cpp\" />\n    <ClCompile Include=\"..\\CCBFileLoader.cpp\" />\n    <ClCompile Include=\"..\\CCBKeyframe.cpp\" />\n    <ClCompile Include=\"..\\CCBReader.cpp\" />\n    <ClCompile Include=\"..\\CCBSequence.cpp\" />\n    <ClCompile Include=\"..\\CCBSequenceProperty.cpp\" />\n    <ClCompile Include=\"..\\CCControlButtonLoader.cpp\" />\n    <ClCompile Include=\"..\\CCControlLoader.cpp\" />\n    <ClCompile Include=\"..\\CCLabelBMFontLoader.cpp\" />\n    <ClCompile Include=\"..\\CCLabelTTFLoader.cpp\" />\n    <ClCompile Include=\"..\\CCLayerColorLoader.cpp\" />\n    <ClCompile Include=\"..\\CCLayerGradientLoader.cpp\" />\n    <ClCompile Include=\"..\\CCLayerLoader.cpp\" />\n    <ClCompile Include=\"..\\CCMenuItemImageLoader.cpp\" />\n    <ClCompile Include=\"..\\CCMenuItemLoader.cpp\" />\n    <ClCompile Include=\"..\\CCNode+CCBRelativePositioning.cpp\" />\n    <ClCompile Include=\"..\\CCNodeLoader.cpp\" />\n    <ClCompile Include=\"..\\CCNodeLoaderLibrary.cpp\" />\n    <ClCompile Include=\"..\\CCParticleSystemQuadLoader.cpp\" />\n    <ClCompile Include=\"..\\CCScale9SpriteLoader.cpp\" />\n    <ClCompile Include=\"..\\CCScrollViewLoader.cpp\" />\n    <ClCompile Include=\"..\\CCSpriteLoader.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\CCBAnimationManager.h\" />\n    <ClInclude Include=\"..\\CCBFileLoader.h\" />\n    <ClInclude Include=\"..\\CCBKeyframe.h\" />\n    <ClInclude Include=\"..\\CCBMemberVariableAssigner.h\" />\n    <ClInclude Include=\"..\\CCBReader.h\" />\n    <ClInclude Include=\"..\\CCBSelectorResolver.h\" />\n    <ClInclude Include=\"..\\CCBSequence.h\" />\n    <ClInclude Include=\"..\\CCBSequenceProperty.h\" />\n    <ClInclude Include=\"..\\CCControlButtonLoader.h\" />\n    <ClInclude Include=\"..\\CCControlLoader.h\" />\n    <ClInclude Include=\"..\\CCLabelBMFontLoader.h\" />\n    <ClInclude Include=\"..\\CCLabelTTFLoader.h\" />\n    <ClInclude Include=\"..\\CCLayerColorLoader.h\" />\n    <ClInclude Include=\"..\\CCLayerGradientLoader.h\" />\n    <ClInclude Include=\"..\\CCLayerLoader.h\" />\n    <ClInclude Include=\"..\\CCMenuItemImageLoader.h\" />\n    <ClInclude Include=\"..\\CCMenuItemLoader.h\" />\n    <ClInclude Include=\"..\\CCMenuLoader.h\" />\n    <ClInclude Include=\"..\\CCNode+CCBRelativePositioning.h\" />\n    <ClInclude Include=\"..\\CCNodeLoader.h\" />\n    <ClInclude Include=\"..\\CCNodeLoaderLibrary.h\" />\n    <ClInclude Include=\"..\\CCNodeLoaderListener.h\" />\n    <ClInclude Include=\"..\\CCParticleSystemQuadLoader.h\" />\n    <ClInclude Include=\"..\\CCScale9SpriteLoader.h\" />\n    <ClInclude Include=\"..\\CCScrollViewLoader.h\" />\n    <ClInclude Include=\"..\\CCSpriteLoader.h\" />\n    <ClInclude Include=\"..\\CocosBuilder.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\CCBSequenceProperty.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCControlButtonLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCControlLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCLabelBMFontLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCLabelTTFLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCLayerColorLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCLayerGradientLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCLayerLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCMenuItemImageLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCMenuItemLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCNode+CCBRelativePositioning.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCNodeLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCNodeLoaderLibrary.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCParticleSystemQuadLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCScale9SpriteLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCScrollViewLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCSpriteLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCBAnimationManager.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCBFileLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCBKeyframe.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCBReader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCBSequence.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\CCParticleSystemQuadLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCScale9SpriteLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCScrollViewLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCSpriteLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CocosBuilder.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBAnimationManager.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBFileLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBKeyframe.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBMemberVariableAssigner.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBReader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBSelectorResolver.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBSequence.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBSequenceProperty.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCControlButtonLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCControlLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCLabelBMFontLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCLabelTTFLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCLayerColorLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCLayerGradientLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCLayerLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCMenuItemImageLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCMenuItemLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCMenuLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCNode+CCBRelativePositioning.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCNodeLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCNodeLoaderLibrary.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCNodeLoaderListener.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocostudio_static\n\nLOCAL_MODULE_FILENAME := libcocostudio\n\nLOCAL_SRC_FILES := CCActionFrame.cpp \\\nCCActionEaseEx.cpp \\\nCCActionFrameEasing.cpp \\\nCCActionManagerEx.cpp \\\nCCActionNode.cpp \\\nCCActionObject.cpp \\\nCCArmature.cpp \\\nCCBone.cpp \\\nCCArmatureAnimation.cpp \\\nCCProcessBase.cpp \\\nCCTween.cpp \\\nCCDatas.cpp \\\nCCBatchNode.cpp \\\nCCDecorativeDisplay.cpp \\\nCCDisplayFactory.cpp \\\nCCDisplayManager.cpp \\\nCCSkin.cpp \\\nCCColliderDetector.cpp \\\nCCArmatureDataManager.cpp \\\nCCArmatureDefine.cpp \\\nCCDataReaderHelper.cpp \\\nCCSpriteFrameCacheHelper.cpp \\\nCCTransformHelp.cpp \\\nCCTweenFunction.cpp \\\nCCUtilMath.cpp \\\nCCComAttribute.cpp \\\nCCComAudio.cpp \\\nCCComController.cpp \\\nCCComRender.cpp \\\nCCInputDelegate.cpp \\\nDictionaryHelper.cpp \\\nCCSGUIReader.cpp \\\nCCSSceneReader.cpp \\\nObjectFactory.cpp \\\nTriggerBase.cpp \\\nTriggerMng.cpp \\\nTriggerObj.cpp\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \\\n$(LOCAL_PATH)/../../../external\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \\\n$(LOCAL_PATH)/../../../external \\\n$(LOCAL_PATH)/.. \\\n$(LOCAL_PATH)/../..\n\nLOCAL_CFLAGS += -Wno-psabi -fexceptions\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,2d)\n$(call import-module,audio/android)\n$(call import-module,gui)\n\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionEaseEx.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCActionEaseEx.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nstatic inline float bezieratFunction( float a, float b, float c, float d, float t )\n{\n\treturn (powf(1-t,3) * a + 3*t*(powf(1-t,2))*b + 3*powf(t,2)*(1-t)*c + powf(t,3)*d );\n}\n\nEaseBezierAction* EaseBezierAction::create(cocos2d::ActionInterval* action)\n{\n\tEaseBezierAction *ret = new EaseBezierAction();\n\tif (ret)\n\t{  \n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nvoid EaseBezierAction::setBezierParamer( float p0, float p1, float p2, float p3)\n{\n\t_p0 = p0;\n\t_p1 = p1;\n\t_p2 = p2;\n\t_p3 = p3;\n}\n\nEaseBezierAction* EaseBezierAction::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseBezierAction();\n\ta->initWithAction(_inner->clone());\n\ta->setBezierParamer(_p0,_p1,_p2,_p3);\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseBezierAction::update(float time)\n{\n\t_inner->update(bezieratFunction(_p0,_p1,_p2,_p3,time));\n}\n\nEaseBezierAction* EaseBezierAction::reverse() const\n{\n\tEaseBezierAction* reverseAction = EaseBezierAction::create(_inner->reverse());\n\treverseAction->setBezierParamer(_p3,_p2,_p1,_p0);\n\treturn reverseAction;\n}\n\n//\n// EaseQuadraticActionIn\n//\n\nEaseQuadraticActionIn* EaseQuadraticActionIn::create(ActionInterval* action)\n{\n\tEaseQuadraticActionIn *ret = new EaseQuadraticActionIn();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuadraticActionIn* EaseQuadraticActionIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuadraticActionIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\nvoid EaseQuadraticActionIn::update(float time)\n{\n\t_inner->update(powf(time,2));\n}\n\nEaseQuadraticActionIn* EaseQuadraticActionIn::reverse() const\n{\n\treturn EaseQuadraticActionIn::create(_inner->reverse());\n}\n\n//\n// EaseQuadraticActionOut\n//\n\nEaseQuadraticActionOut* EaseQuadraticActionOut::create(ActionInterval* action)\n{\n\tEaseQuadraticActionOut *ret = new EaseQuadraticActionOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuadraticActionOut* EaseQuadraticActionOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuadraticActionOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuadraticActionOut::update(float time)\n{\t\n\t_inner->update(-time*(time-2));\n}\n\nEaseQuadraticActionOut* EaseQuadraticActionOut::reverse() const\n{\n\treturn EaseQuadraticActionOut::create(_inner->reverse());\n}\n\n//\n// EaseQuadraticActionInOut\n//\n\nEaseQuadraticActionInOut* EaseQuadraticActionInOut::create(ActionInterval* action)\n{\n\tEaseQuadraticActionInOut *ret = new EaseQuadraticActionInOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuadraticActionInOut* EaseQuadraticActionInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuadraticActionInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuadraticActionInOut::update(float time)\n{\n\tfloat resultTime = time;\n\ttime = time*2;\n\tif (time < 1)\n\t{\n\t\tresultTime = time * time * 0.5f;\n\t}\n\telse\n\t{\n\t\t--time;\n\t\tresultTime = -0.5f * (time * (time - 2) - 1);\n\t}\n\n\t_inner->update(resultTime);\n}\n\nEaseQuadraticActionInOut* EaseQuadraticActionInOut::reverse() const\n{\n\treturn EaseQuadraticActionInOut::create(_inner->reverse());\n}\n\n//\n// EaseQuarticActionIn\n//\n\nEaseQuarticActionIn* EaseQuarticActionIn::create(ActionInterval* action)\n{\n\tEaseQuarticActionIn *ret = new EaseQuarticActionIn();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuarticActionIn* EaseQuarticActionIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuarticActionIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuarticActionIn::update(float time)\n{\n\t_inner->update(powf(time,4.0f));\n}\n\nEaseQuarticActionIn* EaseQuarticActionIn::reverse() const\n{\n\treturn EaseQuarticActionIn::create(_inner->reverse());\n}\n\n//\n// EaseQuarticActionOut\n//\n\nEaseQuarticActionOut* EaseQuarticActionOut::create(ActionInterval* action)\n{\n\tEaseQuarticActionOut *ret = new EaseQuarticActionOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuarticActionOut* EaseQuarticActionOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuarticActionOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuarticActionOut::update(float time)\n{\n\tfloat tempTime = time -1;\t\n\t_inner->update(1- powf(tempTime,4.0f));\n}\n\nEaseQuarticActionOut* EaseQuarticActionOut::reverse() const\n{\n\treturn EaseQuarticActionOut::create(_inner->reverse());\n}\n\n//\n// EaseQuarticActionInOut\n//\n\nEaseQuarticActionInOut* EaseQuarticActionInOut::create(ActionInterval* action)\n{\n\tEaseQuarticActionInOut *ret = new EaseQuarticActionInOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuarticActionInOut* EaseQuarticActionInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuarticActionInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuarticActionInOut::update(float time)\n{\n\tfloat tempTime = time * 2;\n\tif (tempTime < 1)\n\t\ttempTime =  powf(tempTime,4.0f) * 0.5f;\n\telse\n\t{\n\t\ttempTime -= 2;\n\t\ttempTime = 1 - powf(tempTime,4.0f)* 0.5f;\n\t}\n\n\t_inner->update(tempTime);\n}\n\nEaseQuarticActionInOut* EaseQuarticActionInOut::reverse() const\n{\n\treturn EaseQuarticActionInOut::create(_inner->reverse());\n}\n\n//\n// EaseQuinticActionIn\n//\n\nEaseQuinticActionIn* EaseQuinticActionIn::create(ActionInterval* action)\n{\n\tEaseQuinticActionIn *ret = new EaseQuinticActionIn();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuinticActionIn* EaseQuinticActionIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuinticActionIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuinticActionIn::update(float time)\n{\n\t_inner->update(powf(time,5.0f));\n}\n\nEaseQuinticActionIn* EaseQuinticActionIn::reverse() const\n{\n\treturn EaseQuinticActionIn::create(_inner->reverse());\n}\n\n//\n// EaseQuinticActionOut\n//\n\nEaseQuinticActionOut* EaseQuinticActionOut::create(ActionInterval* action)\n{\n\tEaseQuinticActionOut *ret = new EaseQuinticActionOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuinticActionOut* EaseQuinticActionOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuinticActionOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuinticActionOut::update(float time)\n{\n\tfloat tempTime = time -1;\t\n\t_inner->update(1 + powf(tempTime,5.0f));\n}\n\nEaseQuinticActionOut* EaseQuinticActionOut::reverse() const\n{\n\treturn EaseQuinticActionOut::create(_inner->reverse());\n}\n\n//\n// EaseQuinticActionInOut\n//\n\nEaseQuinticActionInOut* EaseQuinticActionInOut::create(ActionInterval* action)\n{\n\tEaseQuinticActionInOut *ret = new EaseQuinticActionInOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseQuinticActionInOut* EaseQuinticActionInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseQuinticActionInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseQuinticActionInOut::update(float time)\n{\n\tfloat tempTime = time * 2;\n\tif (tempTime < 1)\n\t\ttempTime =  powf(tempTime,5.0f) * 0.5f;\n\telse\n\t{\n\t\ttempTime -= 2;\n\t\ttempTime = 1 + powf(tempTime,5.0f)* 0.5f;\n\t}\n\n\t_inner->update(tempTime);\n}\n\nEaseQuinticActionInOut* EaseQuinticActionInOut::reverse() const\n{\n\treturn EaseQuinticActionInOut::create(_inner->reverse());\n}\n\n//\n// EaseCircleActionIn\n//\n\nEaseCircleActionIn* EaseCircleActionIn::create(ActionInterval* action)\n{\n\tEaseCircleActionIn *ret = new EaseCircleActionIn();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseCircleActionIn* EaseCircleActionIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseCircleActionIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseCircleActionIn::update(float time)\n{\n\t_inner->update(1-sqrt(1-powf(time,2.0f)));\n}\n\nEaseCircleActionIn* EaseCircleActionIn::reverse() const\n{\n\treturn EaseCircleActionIn::create(_inner->reverse());\n}\n\n//\n// EaseCircleActionOut\n//\n\nEaseCircleActionOut* EaseCircleActionOut::create(ActionInterval* action)\n{\n\tEaseCircleActionOut *ret = new EaseCircleActionOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseCircleActionOut* EaseCircleActionOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseCircleActionOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseCircleActionOut::update(float time)\n{\n\tfloat tempTime = time - 1;\n\t_inner->update(sqrt(1-powf(tempTime,2.0f)));\n}\n\nEaseCircleActionOut* EaseCircleActionOut::reverse() const\n{\n\treturn EaseCircleActionOut::create(_inner->reverse());\n}\n\n//\n// EaseCircleActionInOut\n//\n\nEaseCircleActionInOut* EaseCircleActionInOut::create(ActionInterval* action)\n{\n\tEaseCircleActionInOut *ret = new EaseCircleActionInOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseCircleActionInOut* EaseCircleActionInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseCircleActionInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseCircleActionInOut::update(float time)\n{\n\tfloat tempTime = time * 2;\n\tif (tempTime < 1)\n\t\ttempTime =  (1- sqrt(1 - powf(tempTime,2.0f))) * 0.5f;\n\telse\n\t{\n\t\ttempTime -= 2;\n\t\ttempTime = (1+ sqrt(1 - powf(tempTime,2.0f))) * 0.5f;\n\t}\n\n\t_inner->update(time);\n}\n\nEaseCircleActionInOut* EaseCircleActionInOut::reverse() const\n{\n\treturn EaseCircleActionInOut::create(_inner->reverse());\n}\n\n//\n// EaseCubicActionIn\n//\n\nEaseCubicActionIn* EaseCubicActionIn::create(ActionInterval* action)\n{\n\tEaseCubicActionIn *ret = new EaseCubicActionIn();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseCubicActionIn* EaseCubicActionIn::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseCubicActionIn();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseCubicActionIn::update(float time)\n{\n\t_inner->update(powf(time,3.0f));\n}\n\nEaseCubicActionIn* EaseCubicActionIn::reverse() const\n{\n\treturn EaseCubicActionIn::create(_inner->reverse());\n}\n\n//\n// EaseCubicActionOut\n//\n\nEaseCubicActionOut* EaseCubicActionOut::create(ActionInterval* action)\n{\n\tEaseCubicActionOut *ret = new EaseCubicActionOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseCubicActionOut* EaseCubicActionOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseCubicActionOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseCubicActionOut::update(float time)\n{\n\ttime -= 1;\n\t_inner->update(1+powf(time,3.0f));\n}\n\nEaseCubicActionOut* EaseCubicActionOut::reverse() const\n{\n\treturn EaseCubicActionOut::create(_inner->reverse());\n}\n\n//\n// EaseCubicActionInOut\n//\n\nEaseCubicActionInOut* EaseCubicActionInOut::create(ActionInterval* action)\n{\n\tEaseCubicActionInOut *ret = new EaseCubicActionInOut();\n\tif (ret)\n\t{\n\t\tif (ret->initWithAction(action))\n\t\t{\n\t\t\tret->autorelease();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_SAFE_RELEASE_NULL(ret);\n\t\t}\n\t}\n\n\treturn ret; \n}\n\nEaseCubicActionInOut* EaseCubicActionInOut::clone() const\n{\n\t// no copy constructor\n\tauto a = new EaseCubicActionInOut();\n\ta->initWithAction(_inner->clone());\n\ta->autorelease();\n\treturn a;\n}\n\nvoid EaseCubicActionInOut::update(float time)\n{\n\tfloat tempTime = time * 2;\n\tif (tempTime < 1)\n\t\ttempTime =  powf(tempTime,3.0f) * 0.5f;\n\telse\n\t{\n\t\ttempTime -= 2;\n\t\ttempTime = 1 + powf(tempTime,3.0f)* 0.5f;\n\t}\n\t_inner->update(time);\n}\n\nEaseCubicActionInOut* EaseCubicActionInOut::reverse() const\n{\n\treturn EaseCubicActionInOut::create(_inner->reverse());\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionEaseEx.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ActionEaseEx_H__\n#define __ActionEaseEx_H__\n\n#include \"cocostudio/CocoStudio.h\"\n\nnamespace cocostudio {\n\n/** \n@brief Ease Bezier\n@ingroup Actions\n*/\nclass EaseBezierAction : public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseBezierAction* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseBezierAction* clone() const override;\n\tvirtual EaseBezierAction* reverse() const override;\n\n\tvirtual void setBezierParamer( float p0, float p1, float p2, float p3);\n\nprotected:\n\tEaseBezierAction() {}\n\tvirtual ~EaseBezierAction() {}\n\n\tfloat _p0;\n\tfloat _p1;\n\tfloat _p2;\n\tfloat _p3;\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseBezierAction);\n};\n\n/** \n@brief Ease Quadratic In\n@ingroup Actions\n*/\nclass EaseQuadraticActionIn:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuadraticActionIn* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuadraticActionIn* clone() const override;\n\tvirtual EaseQuadraticActionIn* reverse() const override;\n\nprotected:\n\tEaseQuadraticActionIn() {}\n\tvirtual ~EaseQuadraticActionIn() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionIn);\n\n};\n\n/** \n@brief Ease Quadratic Out\n@ingroup Actions\n*/\nclass EaseQuadraticActionOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuadraticActionOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuadraticActionOut* clone() const override;\n\tvirtual EaseQuadraticActionOut* reverse() const override;\n\nprotected:\n\tEaseQuadraticActionOut() {}\n\tvirtual ~EaseQuadraticActionOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionOut);\n\n};\n\n/** \n@brief Ease Quadratic InOut\n@ingroup Actions\n*/\nclass EaseQuadraticActionInOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuadraticActionInOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuadraticActionInOut* clone() const override;\n\tvirtual EaseQuadraticActionInOut* reverse() const override;\n\nprotected:\n\tEaseQuadraticActionInOut() {}\n\tvirtual ~EaseQuadraticActionInOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuadraticActionInOut);\n};\n\n/** \n@brief Ease Quartic In\n@ingroup Actions\n*/\nclass EaseQuarticActionIn:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuarticActionIn* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuarticActionIn* clone() const override;\n\tvirtual EaseQuarticActionIn* reverse() const override;\n\nprotected:\n\tEaseQuarticActionIn() {}\n\tvirtual ~EaseQuarticActionIn() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionIn);\n};\n\n/** \n@brief Ease Quartic Out\n@ingroup Actions\n*/\nclass EaseQuarticActionOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuarticActionOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuarticActionOut* clone() const override;\n\tvirtual EaseQuarticActionOut* reverse() const override;\n\nprotected:\n\tEaseQuarticActionOut() {}\n\tvirtual ~EaseQuarticActionOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionOut);\n};\n\n/** \n@brief Ease Quartic InOut\n@ingroup Actions\n*/\nclass EaseQuarticActionInOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuarticActionInOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuarticActionInOut* clone() const override;\n\tvirtual EaseQuarticActionInOut* reverse() const override;\n\nprotected:\n\tEaseQuarticActionInOut() {}\n\tvirtual ~EaseQuarticActionInOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuarticActionInOut);\n};\n\n\n/** \n@brief Ease Quintic In\n@ingroup Actions\n*/\nclass EaseQuinticActionIn:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuinticActionIn* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuinticActionIn* clone() const override;\n\tvirtual EaseQuinticActionIn* reverse() const override;\n\nprotected:\n\tEaseQuinticActionIn() {}\n\tvirtual ~EaseQuinticActionIn() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionIn);\n};\n\n/** \n@brief Ease Quintic Out\n@ingroup Actions\n*/\nclass EaseQuinticActionOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuinticActionOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuinticActionOut* clone() const override;\n\tvirtual EaseQuinticActionOut* reverse() const override;\n\nprotected:\n\tEaseQuinticActionOut() {}\n\tvirtual ~EaseQuinticActionOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionOut);\n};\n\n/** \n@brief Ease Quintic InOut\n@ingroup Actions\n*/\nclass EaseQuinticActionInOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseQuinticActionInOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseQuinticActionInOut* clone() const override;\n\tvirtual EaseQuinticActionInOut* reverse() const override;\n\nprotected:\n\tEaseQuinticActionInOut() {}\n\tvirtual ~EaseQuinticActionInOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseQuinticActionInOut);\n};\n\n/** \n@brief Ease Circle In\n@ingroup Actions\n*/\nclass EaseCircleActionIn:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseCircleActionIn* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseCircleActionIn* clone() const override;\n\tvirtual EaseCircleActionIn* reverse() const override;\n\nprotected:\n\tEaseCircleActionIn() {}\n\tvirtual ~EaseCircleActionIn() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionIn);\n};\n\n/** \n@brief Ease Circle Out\n@ingroup Actions\n*/\nclass EaseCircleActionOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseCircleActionOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseCircleActionOut* clone() const override;\n\tvirtual EaseCircleActionOut* reverse() const override;\n\nprotected:\n\tEaseCircleActionOut() {}\n\tvirtual ~EaseCircleActionOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionOut);\n};\n\n/** \n@brief Ease Circle InOut\n@ingroup Actions\n*/\nclass EaseCircleActionInOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseCircleActionInOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseCircleActionInOut* clone() const override;\n\tvirtual EaseCircleActionInOut* reverse() const override;\n\nprotected:\n\tEaseCircleActionInOut() {}\n\tvirtual ~EaseCircleActionInOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseCircleActionInOut);\n};\n\n/** \n@brief Ease Cubic In\n@ingroup Actions\n*/\nclass EaseCubicActionIn:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseCubicActionIn* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseCubicActionIn* clone() const override;\n\tvirtual EaseCubicActionIn* reverse() const override;\n\nprotected:\n\tEaseCubicActionIn() {}\n\tvirtual ~EaseCubicActionIn() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionIn);\n};\n\n/** \n@brief Ease Cubic Out\n@ingroup Actions\n*/\nclass EaseCubicActionOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseCubicActionOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseCubicActionOut* clone() const override;\n\tvirtual EaseCubicActionOut* reverse() const override;\n\nprotected:\n\tEaseCubicActionOut() {}\n\tvirtual ~EaseCubicActionOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionOut);\n};\n\n/** \n@brief Ease Cubic InOut\n@ingroup Actions\n*/\nclass EaseCubicActionInOut:public cocos2d::ActionEase\n{\npublic:\n\t/** creates the action */\n\tstatic EaseCubicActionInOut* create(cocos2d::ActionInterval* action);\n\n\tvirtual void update(float time) override;\n\tvirtual EaseCubicActionInOut* clone() const override;\n\tvirtual EaseCubicActionInOut* reverse() const override;\n\nprotected:\n\tEaseCubicActionInOut() {}\n\tvirtual ~EaseCubicActionInOut() {}\n\nprivate:\n\tCC_DISALLOW_COPY_AND_ASSIGN(EaseCubicActionInOut);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionFrame.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCActionFrame.h\"\n#include \"CCActionEaseEx.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nActionFrame::ActionFrame()\n: _frameType(0)\n, _frameIndex(0)\n, _fTime(0.0f)\n, _easingType(FrameEaseType::LINERAR)\n{\n\n}\nActionFrame::~ActionFrame()\n{\n\n}\n\nvoid ActionFrame::setFrameIndex(int index)\n{\n\t_frameIndex = index;\n}\nint ActionFrame::getFrameIndex()\n{\n\treturn _frameIndex;\n}\n\nvoid ActionFrame::setFrameTime(float fTime)\n{\n\t_fTime = fTime;\n}\nfloat ActionFrame::getFrameTime()\n{\n\treturn _fTime;\n}\n\nvoid ActionFrame::setFrameType(int frameType)\n{\n\t_frameType = frameType;\n}\nint ActionFrame::getFrameType()\n{\n\treturn _frameType;\n}\n\nvoid ActionFrame::setEasingType(int easingType)\n{\n\t_easingType = (FrameEaseType)easingType;\n}\nint ActionFrame::getEasingType()\n{\n\treturn (int)_easingType;\n}\n\nActionInterval* ActionFrame::getAction(float fDuration)\n{\n\tlog(\"Need a definition of <getAction> for ActionFrame\");\n\treturn nullptr;\n}\nActionInterval* ActionFrame::getAction(float fDuration,ActionFrame* srcFrame)\n{\n\treturn this->getAction(fDuration);\n}\n\nvoid ActionFrame::setEasingParameter(std::vector<float>& parameter)\n{\n\t_Parameter.clear();\n\n\tfor (size_t i = 0; i<parameter.size(); i++)\n\t{\n\t\t_Parameter.push_back(parameter[i]);\n\t}\n}\n\nActionInterval* ActionFrame::getEasingAction(ActionInterval* action)\n{\n\tif (action == nullptr)\n\t{\n\t\treturn nullptr;\n\t}\n\n\tswitch (_easingType)\n\t{\n\tcase FrameEaseType::Custom:\n\t\t{\n\t\t\tEaseBezierAction* cAction = EaseBezierAction::create(action);\n\t\t\tcAction->setBezierParamer(_Parameter[0],_Parameter[1],_Parameter[2],_Parameter[3]);\n\t\t\treturn cAction;\n\t\t}\n\t\tbreak;\n\tcase FrameEaseType::LINERAR:\n\t\treturn action;\n\t\tbreak;\n\tcase FrameEaseType::SINE_EASEIN:\n\t\treturn EaseSineIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::SINE_EASEOUT:\n\t\treturn EaseSineOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::SINE_EASEINOUT:\n\t\treturn EaseSineInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUAD_EASEIN:\n\t\treturn EaseQuadraticActionIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUAD_EASEOUT:\n\t\treturn EaseQuadraticActionOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUAD_EASEINOUT:\n\t\treturn EaseQuadraticActionInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::CUBIC_EASEIN:\n\t\treturn EaseCubicActionIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::CUBIC_EASEOUT:\n\t\treturn EaseCubicActionOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::CUBIC_EASEINOUT:\n\t\treturn EaseCubicActionInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUART_EASEIN:\n\t\treturn EaseQuarticActionIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUART_EASEOUT:\n\t\treturn EaseQuadraticActionOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUART_EASEINOUT:\n\t\treturn EaseQuarticActionInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUINT_EASEIN:\n\t\treturn EaseQuinticActionIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUINT_EASEOUT:\n\t\treturn EaseQuinticActionOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::QUINT_EASEINOUT:\n\t\treturn EaseQuinticActionInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::EXPO_EASEIN:\n\t\treturn EaseExponentialIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::EXPO_EASEOUT:\n\t\treturn EaseExponentialOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::EXPO_EASEINOUT:\n\t\treturn EaseExponentialInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::CIRC_EASEIN:\n\t\treturn EaseCircleActionIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::CIRC_EASEOUT:\n\t\treturn EaseCircleActionOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::CIRC_EASEINOUT:\n\t\treturn EaseCircleActionInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::ELASTIC_EASEIN:\n\t\t{\n\t\t\treturn EaseElasticIn::create(action);\n\t\t}\n\t\tbreak;\n\tcase FrameEaseType::ELASTIC_EASEOUT:\n\t\t{\n\t\t\treturn EaseElasticOut::create(action);\n\t\t}\n\t\tbreak;\n\tcase FrameEaseType::ELASTIC_EASEINOUT:\n\t\t{\n\t\t\treturn EaseElasticInOut::create(action);\n\t\t}\n\t\tbreak;\n\tcase FrameEaseType::BACK_EASEIN:\n\t\treturn EaseBackIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::BACK_EASEOUT:\n\t\treturn EaseBackOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::BACK_EASEINOUT:\n\t\treturn EaseBackInOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::BOUNCE_EASEIN:\n\t\treturn EaseBounceIn::create(action);\n\t\tbreak;\n\tcase FrameEaseType::BOUNCE_EASEOUT:\n\t\treturn EaseBounceOut::create(action);\n\t\tbreak;\n\tcase FrameEaseType::BOUNCE_EASEINOUT:\n\t\treturn EaseBounceInOut::create(action);\n\t\tbreak;\n\tdefault:\n\t\treturn action;\n\t\tbreak;\n\t}\n}\n//////////////////////////////////////////////////////////////////////////\n\nActionMoveFrame::ActionMoveFrame()\n\t: _position(Point(0.0f,0.0f))\n{\n\t_frameType = (int)kKeyframeMove;\n}\nActionMoveFrame::~ActionMoveFrame()\n{\n\n}\nvoid ActionMoveFrame::setPosition(Point pos)\n{\n\t_position = pos;\n}\nPoint ActionMoveFrame::getPosition()\n{\n\treturn _position;\n}\nActionInterval* ActionMoveFrame::getAction(float fDuration)\n{\n\treturn this->getEasingAction(CCMoveTo::create(fDuration,_position));\n}\n//////////////////////////////////////////////////////////////////////////\n\nActionScaleFrame::ActionScaleFrame()\n\t: _scaleX(1.0f)\n\t, _scaleY(1.0f)\n{\n\t_frameType = (int)kKeyframeScale;\n}\n\nActionScaleFrame::~ActionScaleFrame()\n{\n\n}\n\nvoid ActionScaleFrame::setScaleX(float scaleX)\n{\n\t_scaleX = scaleX;\n}\n\nfloat ActionScaleFrame::getScaleX()\n{\n\treturn _scaleX;\n}\n\nvoid ActionScaleFrame::setScaleY(float scaleY)\n{\n\t_scaleY = scaleY;\n}\n\nfloat ActionScaleFrame::getScaleY()\n{\n\treturn _scaleY;\n}\n\nActionInterval* ActionScaleFrame::getAction(float fDuration)\n{\n\treturn this->getEasingAction(CCScaleTo::create(fDuration,_scaleX,_scaleY));\n}\n\nActionRotationFrame::ActionRotationFrame()\n\t: _rotation(0.0f)\n{\n\t_frameType = (int)kKeyframeRotate;\n}\n\nActionRotationFrame::~ActionRotationFrame()\n{\n\n}\n\nvoid ActionRotationFrame::setRotation(float rotation)\n{\n\t_rotation = rotation;\n}\n\nfloat ActionRotationFrame::getRotation()\n{\n\treturn _rotation;\n}\n\nActionInterval* ActionRotationFrame::getAction(float fDuration)\n{\n\treturn this->getEasingAction(CCRotateTo::create(fDuration,_rotation));\n}\nActionInterval* ActionRotationFrame::getAction(float fDuration,ActionFrame* srcFrame)\n{\n\tActionRotationFrame* srcRotationFrame = static_cast<ActionRotationFrame*>(srcFrame);\n\tif (srcRotationFrame == nullptr)\n\t{\n\t\treturn this->getAction(fDuration);\n\t}\n\telse\n\t{\n\t\tfloat diffRotation = _rotation - srcRotationFrame->_rotation;\n\t\treturn this->getEasingAction(CCRotateBy::create(fDuration,diffRotation));\n\t}\n}\n\nActionFadeFrame::ActionFadeFrame()\n\t: _opacity(255)\n{\n\t_frameType = (int)kKeyframeFade;\n}\n\nActionFadeFrame::~ActionFadeFrame()\n{\n\n}\n\nvoid ActionFadeFrame::setOpacity(int opacity)\n{\n\t_opacity = opacity;\n}\n\nint ActionFadeFrame::getOpacity()\n{\n\treturn _opacity;\n}\n\nActionInterval* ActionFadeFrame::getAction(float fDuration)\n{\n\treturn this->getEasingAction(CCFadeTo::create(fDuration,_opacity));\n}\n\n\nActionTintFrame::ActionTintFrame()\n\t: _color(Color3B(255,255,255))\n{\n\t_frameType = (int)kKeyframeTint;\n}\n\nActionTintFrame::~ActionTintFrame()\n{\n\n}\n\nvoid ActionTintFrame::setColor(Color3B ccolor)\n{\n\t_color = ccolor;\n}\n\nColor3B ActionTintFrame::getColor()\n{\n\treturn _color;\n}\n\nActionInterval* ActionTintFrame::getAction(float fDuration)\n{\n\treturn this->getEasingAction(CCTintTo::create(fDuration,_color.r,_color.g,_color.b));\n}\n\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionFrame.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ActionFRAME_H__\n#define __ActionFRAME_H__\n\n#include \"CCGeometry.h\"\n#include \"CCActionInterval.h\"\n\nnamespace cocostudio {\n\nenum FrameType\n{\n\tkKeyframeMove = 0,\n\tkKeyframeScale,\n\tkKeyframeRotate,\n\tkKeyframeTint,\n\tkKeyframeFade,\n\tkKeyframeMax\n};\n\nenum class FrameEaseType\n{\n\tCustom = -1,\n\n\tLINERAR = 0,\n\n    SINE_EASEIN,\n\tSINE_EASEOUT,\n\tSINE_EASEINOUT,\n\n    QUAD_EASEIN,\n\tQUAD_EASEOUT,\n    QUAD_EASEINOUT,\n\n    CUBIC_EASEIN,\n    CUBIC_EASEOUT,\n    CUBIC_EASEINOUT,\n\n    QUART_EASEIN,\n    QUART_EASEOUT,\n    QUART_EASEINOUT,\n\n    QUINT_EASEIN,\n\tQUINT_EASEOUT,\n    QUINT_EASEINOUT,\n\n    EXPO_EASEIN,\n    EXPO_EASEOUT,\n    EXPO_EASEINOUT,\n\n    CIRC_EASEIN,\n    CIRC_EASEOUT,\n    CIRC_EASEINOUT,\n\n    ELASTIC_EASEIN,\n    ELASTIC_EASEOUT,\n    ELASTIC_EASEINOUT,\n\n    BACK_EASEIN,\n    BACK_EASEOUT,\n    BACK_EASEINOUT,\n\n    BOUNCE_EASEIN,\n    BOUNCE_EASEOUT,\n    BOUNCE_EASEINOUT,\n\n\tTWEEN_EASING_MAX = 10000\n};\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionFrame:public cocos2d::Object\n{\n\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionFrame();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionFrame();\n\n\t/**\n\t* Changes the index of action frame\n\t*\n\t* @param index   the index of action frame\n\t*/\n\tvoid setFrameIndex(int index);\n\n\t/**\n\t* Gets the index of action frame\n\t*\n\t* @return the index of action frame\n\t*/\n\tint getFrameIndex();\n\n\t/**\n\t* Changes the time of action frame\n\t*\n\t* @param fTime  the time of action frame\n\t*/\n\tvoid setFrameTime(float fTime);\n\n\t/**\n\t* Gets the time of action frame\n\t*\n\t* @return fTime  the time of action frame\n\t*/\n\tfloat getFrameTime();\n\n\t/**\n\t* Changes the type of action frame\n\t*\n\t* @param frameType   the type of action frame\n\t*/\n\tvoid setFrameType(int frameType);\n\n\t/**\n\t* Gets the type of action frame\n\t*\n\t* @return the type of action frame\n\t*/\n\tint getFrameType();\n\n\t/**\n\t* Changes the easing type.\n\t*\n\t* @param easingType the easing type.\n\t*/\n\tvoid setEasingType(int easingType);\n\n\t/**\n\t* Gets the easing type.\n\t*\n\t* @return the easing type.\n\t*/\n\tint getEasingType();\n\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration);\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @parame duration   the source ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration,ActionFrame* srcFrame);\n\n\t/**\n\t*Set the ActionInterval easing parameter.\n\t*\n\t*@parame parameter   the parameter for frame ease\n\t*\n\t*/\n\tvirtual void setEasingParameter(std::vector<float>& parameter);\nprotected:\n\t/**\n\t* Gets the Easing Action of ActionFrame.\n\t*\n\t* @parame action   the duration time of ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getEasingAction(cocos2d::ActionInterval* action);\nprotected:\n\tint _frameType;\t\n\tint _frameIndex;\n\tfloat _fTime;\n\tFrameEaseType _easingType;\n\tstd::vector<float> _Parameter;\n};\n\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionMoveFrame:public ActionFrame\n{\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionMoveFrame();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionMoveFrame();\n\n\t/**\n\t* Changes the move action position.\n\t*\n\t* @param the move action position.\n\t*/\n\tvoid setPosition(cocos2d::Point pos);\n\n\t/**\n\t* Gets the move action position.\n\t*\n\t* @return the move action position.\n\t*/\n\tcocos2d::Point getPosition();\n\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration);\nprotected:\n\tcocos2d::Point _position;\n};\n\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionScaleFrame:public ActionFrame\n{\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionScaleFrame();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionScaleFrame();\n\n\t/**\n\t* Changes the scale action scaleX.\n\t*\n\t* @param the scale action scaleX.\n\t*/\n\tvoid setScaleX(float scaleX);\n\n\t/**\n\t* Gets the scale action scaleX.\n\t*\n\t* @return the scale action scaleX.\n\t*/\n\tfloat getScaleX();\n\n\t/**\n\t* Changes the scale action scaleY.\n\t*\n\t* @param rotation the scale action scaleY.\n\t*/\n\tvoid setScaleY(float scaleY);\n\n\t/**\n\t* Gets the scale action scaleY.\n\t*\n\t* @return the the scale action scaleY.\n\t*/\n\tfloat getScaleY();\n\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration);\nprotected:\n\tfloat _scaleX;\n\tfloat _scaleY;\n};\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionRotationFrame:public ActionFrame\n{\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionRotationFrame();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionRotationFrame();\n\n\t/**\n\t* Changes rotate action rotation.\n\t*\n\t* @param rotation rotate action rotation.\n\t*/\n\tvoid setRotation(float rotation);\n\n\t/**\n\t* Gets the rotate action rotation.\n\t*\n\t* @return the rotate action rotation.\n\t*/\n\tfloat getRotation();\n\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration);\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @parame duration   the source ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration,ActionFrame* srcFrame);\npublic:\n\tfloat _rotation;\n};\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionFadeFrame:public ActionFrame\n{\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionFadeFrame();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionFadeFrame();\n\n\t/**\n\t* Changes the fade action opacity.\n\t*\n\t* @param opacity the fade action opacity\n\t*/\n\tvoid setOpacity(int opacity);\n\n\t/**\n\t* Gets the fade action opacity.\n\t*\n\t* @return the fade action opacity.\n\t*/\n\tint getOpacity();\n\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration);\nprotected:\n\tfloat _opacity;\n};\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionTintFrame:public ActionFrame\n{\n\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionTintFrame();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionTintFrame();\n\n\t/**\n\t* Changes the tint action color.\n\t*\n\t* @param ccolor the tint action color\n\t*/\n\tvoid setColor(cocos2d::Color3B ccolor);\n\n\t/**\n\t* Gets the tint action color.\n\t*\n\t* @return the tint action color.\n\t*/\n\tcocos2d::Color3B getColor();\n\n\t/**\n\t* Gets the ActionInterval of ActionFrame.\n\t*\n\t* @parame duration   the duration time of ActionFrame\n\t*\n\t* @return ActionInterval\n\t*/\n\tvirtual cocos2d::ActionInterval* getAction(float duration);\nprotected:\n\tcocos2d::Color3B _color;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionFrameEasing.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include <math.h>\n#include \"cocostudio/CCActionFrameEasing.h\"\n#include \"cocostudio/DictionaryHelper.h\"\nnamespace cocostudio {\n\n#ifndef M_PI_X_2\n#define M_PI_X_2 (float)M_PI * 2.0f\n#endif\n\nActionFrameEasing::ActionFrameEasing()\n{\n\n}\nActionFrameEasing::~ActionFrameEasing()\n{\n\n}\n\nfloat ActionFrameEasing::bounceTime(float t)\n{\n\tif (t < 1 / 2.75) {\n\t\treturn 7.5625f * t * t;\n\t}\n\telse if (t < 2 / 2.75) {\n\t\tt -= 1.5f / 2.75f;\n\t\treturn 7.5625f * t * t + 0.75f;\n\t}\n\telse if (t < 2.5 / 2.75) {\n\t\tt -= 2.25f / 2.75f;\n\t\treturn 7.5625f * t * t + 0.9375f;\n\t}\n\n\tt -= 2.625f / 2.75f;\n\treturn 7.5625f * t * t + 0.984375f;\n}\n\nfloat ActionFrameEasing::easeValue(float t)\n{\n\tif (_type == FrameEasingType::kframeEasingInstant)\n\t{\n\t\tif (t < 1) return 0;\n\t\telse return 1;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingLinear)\n\t{\n\t\treturn t;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingCubicIn)\n\t{\n\t\tfloat rate = _fValue;\n\t\treturn powf(t,rate);\n\t}\n\telse if (_type == FrameEasingType::kframeEasingCubicOut)\n\t{\n\t\tfloat rate = _fValue;\n\t\treturn powf(t,1/rate);\n\t}\n\telse if (_type == FrameEasingType::kframeEasingCubicInOut)\n\t{\n\t\tfloat rate = _fValue;\n\t\tt *= 2;\n\t\tif (t < 1)\n\t\t{\n\t\t\treturn 0.5f * powf (t, rate);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 1.0f - 0.5f * powf(2-t, rate);\n\t\t}\n\t}\n\telse if (_type == FrameEasingType::kframeEasingElasticIn)\n\t{\n\t\tfloat period = _fValue;\n\t\tfloat newT = 0;\n\t\tif (t == 0 || t == 1)\n\t\t\tnewT = t;\n\n\t\telse {\n\t\t\tfloat s = period / 4;\n\t\t\tt = t - 1;\n\t\t\tnewT = -powf(2, 10 * t) * sinf( (t-s) * M_PI_X_2 / period);\n\t\t}\n\t\treturn newT;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingElasticOut)\n\t{\n\t\tfloat period = _fValue;\n\t\tfloat newT = 0;\n\t\tif (t == 0 || t == 1) {\n\t\t\tnewT = t;\n\n\t\t} else {\n\t\t\tfloat s = period / 4;\n\t\t\tnewT = powf(2, -10 * t) * sinf( (t-s) *M_PI_X_2 / period) + 1;\n\t\t}\n\t\treturn newT;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingElasticInOut)\n\t{\n\t\tfloat period = _fValue;\n\t\tfloat newT = 0;\n\t\tif( t == 0 || t == 1 )\n\t\t\tnewT = t;\n\t\telse {\n\t\t\tt = t * 2;\n\t\t\tif(! period )\n\t\t\t\tperiod = 0.3f * 1.5f;\n\t\t\tfloat s = period / 4;\n\n\t\t\tt = t -1;\n\t\t\tif( t < 0 )\n\t\t\t\tnewT = -0.5f * powf(2, 10 * t) * sinf((t - s) * M_PI_X_2 / period);\n\t\t\telse\n\t\t\t\tnewT = powf(2, -10 * t) * sinf((t - s) * M_PI_X_2 / period) * 0.5f + 1;\n\t\t}\n\t\treturn newT;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingBounceIn)\n\t{\n\t\tfloat newT = 1 - bounceTime(1-t);\n\t\treturn newT;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingBounceOut)\n\t{\n\t\tfloat newT = bounceTime(t);\n\t\treturn newT;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingBounceInOut)\n\t{\n\t\tfloat newT = 0;\n\t\tif (t < 0.5) {\n\t\t\tt = t * 2;\n\t\t\tnewT = (1 - bounceTime(1-t) ) * 0.5f;\n\t\t} else\n\t\t\tnewT = bounceTime(t * 2 - 1) * 0.5f + 0.5f;\n\t\treturn newT;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingBackIn)\n\t{\n\t\tfloat overshoot = 1.70158f;\n\t\treturn t * t * ((overshoot + 1) * t - overshoot);\n\t}\n\telse if (_type == FrameEasingType::kframeEasingBackOut)\n\t{\n\t\tfloat overshoot = 1.70158f;\n\t\tt = t - 1;\n\t\treturn t * t * ((overshoot + 1) * t + overshoot) + 1;\n\t}\n\telse if (_type == FrameEasingType::kframeEasingBackInOut)\n\t{\n\t\tfloat overshoot = 1.70158f * 1.525f;\n\n\t\tt = t * 2;\n\t\tif (t < 1)\n\t\t\treturn (t * t * ((overshoot + 1) * t - overshoot)) / 2;\n\t\telse {\n\t\t\tt = t - 2;\n\t\t\treturn (t * t * ((overshoot + 1) * t + overshoot)) / 2 + 1;\n\t\t}\n\t}\n\n\treturn 0;\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionFrameEasing.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ActionFrameEasing_H__\n#define __ActionFrameEasing_H__\n\n#include \"CCObject.h\"\n\nnamespace cocostudio {\n\nenum FrameEasingType\n{\n\tkframeEasingInstant,\n\n\tkframeEasingLinear,\n\n\tkframeEasingCubicIn,\n\tkframeEasingCubicOut,\n\tkframeEasingCubicInOut,\n\n\tkframeEasingElasticIn,\n\tkframeEasingElasticOut,\n\tkframeEasingElasticInOut,\n\n\tkframeEasingBounceIn,\n\tkframeEasingBounceOut,\n\tkframeEasingBounceInOut,\n\n\tkframeEasingBackIn,\n\tkframeEasingBackOut,\n\tkframeEasingBackInOut,\n};\n\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionFrameEasing:public cocos2d::Object\n{\nprotected:\n\tFrameEasingType _type;\n\tfloat _fValue;\npublic:\n\tActionFrameEasing();\n\tvirtual ~ActionFrameEasing();\n\n\tfloat bounceTime(float t);\n\n\tfloat easeValue(float t);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionManagerEx.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCActionManagerEx.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nstatic ActionManagerEx* sharedActionManager = nullptr;\n\nActionManagerEx* ActionManagerEx::getInstance()\n{\n\tif (!sharedActionManager) {\n\t\tsharedActionManager = new ActionManagerEx();\n\t}\n\treturn sharedActionManager;\n}\n\nvoid ActionManagerEx::destroyInstance()\n{\n\tCC_SAFE_DELETE(sharedActionManager);\n}\n\nActionManagerEx::ActionManagerEx()\n{\n}\n\nActionManagerEx::~ActionManagerEx()\n{\n\t_actionDic.clear();\n}\n\nvoid ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::Value &dic,Object* root)\n{\n\tstd::string path = jsonName;\n\tssize_t pos = path.find_last_of(\"/\");\n\tstd::string fileName = path.substr(pos+1,path.length());\n\tCCLOG(\"filename == %s\",fileName.c_str());\n\tcocos2d::Vector<ActionObject*> actionList;\n\tint actionCount = DICTOOL->getArrayCount_json(dic, \"actionlist\");\n\tfor (int i=0; i<actionCount; i++) {\n\t\tActionObject* action = new ActionObject();\n\t\taction->autorelease();\n\t\tconst rapidjson::Value &actionDic = DICTOOL->getDictionaryFromArray_json(dic, \"actionlist\", i);\n\t\taction->initWithDictionary(actionDic,root);\n\t\tactionList.pushBack(action);\n\t}\n\t_actionDic.insert(std::pair<std::string, cocos2d::Vector<ActionObject*>>(fileName, actionList));\n}\n\n\nActionObject* ActionManagerEx::getActionByName(const char* jsonName,const char* actionName)\n{\n\tauto iterator = _actionDic.find(jsonName);\n\tif (iterator == _actionDic.end())\n\t{\n\t\treturn nullptr;\n\t}\n\tauto actionList = iterator->second;\n\tfor (int i = 0; i < actionList.size(); i++)\n\t{\n\t\tActionObject* action = actionList.at(i);\n\t\tif (strcmp(actionName, action->getName()) == 0)\n\t\t{\n\t\t\treturn action;\n\t\t}\n\t}\n\treturn nullptr;\n}\n\nActionObject* ActionManagerEx::playActionByName(const char* jsonName,const char* actionName)\n{\n\tActionObject* action = getActionByName(jsonName,actionName);\n\tif (action)\n\t{\n\t\taction->play();\n\t}\n\treturn action;\n}\n\nActionObject* ActionManagerEx::playActionByName(const char* jsonName,const char* actionName, CallFunc* func)\n{\n\tActionObject* action = getActionByName(jsonName,actionName);\n\tif (action)\n\t{\n\t\taction->play(func);\n\t}\n\treturn action;\n}\n\nvoid ActionManagerEx::releaseActions()\n{\n\t_actionDic.clear();\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionManagerEx.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ActionMANAGER_H__\n#define __ActionMANAGER_H__\n\n#include \"cocostudio/CCActionObject.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\nnamespace cocostudio {\n\nclass ActionManagerEx:public cocos2d::Object\n{\npublic:\n\n\t/**\n\t* Default constructor\n\t* @js ctor\n\t*/\n\tActionManagerEx();\n\n\t/**\n\t* Default destructor\n\t* @js NA\n\t* @lua NA\n\t*/\n\tvirtual ~ActionManagerEx();\n\n\t/**\n\t* Gets the static instance of ActionManager.\n\t* @js getInstance\n\t* @lua getInstance\n\t*/\n\tstatic ActionManagerEx* getInstance();\n\n\t/**\n\t* Purges ActionManager point.\n\t* @js purge\n\t* @lua destroyActionManager\n\t*/\n\tstatic void destroyInstance();\n\n\t/**\n\t* Gets an ActionObject with a name.\n\t*\n\t* @param jsonName  UI file name\n\t*\n\t* @param actionName  action name in the UI file.\n\t*\n\t* @return  ActionObject which named as the param name\n\t*/\n\tActionObject* getActionByName(const char* jsonName,const char* actionName);\n\n\t/**\n\t* Play an Action with a name.\n\t*\n\t* @param jsonName  UI file name\n\t*\n\t* @param actionName  action name in teh UIfile.\n\t*\n\t* @return  ActionObject which named as the param name\n\t*/\n\tActionObject* playActionByName(const char* jsonName,const char* actionName);\n\n\t/**\n\t* Play an Action with a name.\n\t*\n\t* @param jsonName  UI file name\n\t*\n\t* @param actionName  action name in teh UIfile.\n\t*\n\t* @param func ui action call back\n\t*/\n\tActionObject* playActionByName(const char* jsonName,const char* actionName, cocos2d::CallFunc* func);\n\n\t/*init properties with json dictionay*/\n\tvoid initWithDictionary(const char* jsonName,const rapidjson::Value &dic, Object* root);\n\t/**\n\t* Release all actions.\n\t*\n\t*/\n\tvoid releaseActions();\n\nprotected:\n\tstd::unordered_map<std::string, cocos2d::Vector<ActionObject*>> _actionDic;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionNode.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCActionNode.h\"\n#include \"cocostudio/CCActionFrameEasing.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n#include \"gui/UIWidget.h\"\n#include \"gui/UIHelper.h\"\n\nusing namespace cocos2d;\nusing namespace gui;\n\nnamespace cocostudio {\n\nActionNode::ActionNode()\n: _currentFrameIndex(0)\n, _destFrameIndex(0)\n, _fUnitTime(0.1f)\n, _actionTag(0)\n, _actionSpawn(nullptr)\n, _action(nullptr)\n, _object(nullptr)\n, _frameArrayNum(0)\n{\n\t_frameArrayNum = (int)kKeyframeMax;\n\tfor(int i = 0; i < _frameArrayNum; i++)\n\t{\n\t\t_frameArray.push_back( new cocos2d::Vector<ActionFrame*>());\n\t}\n}\n\nActionNode::~ActionNode()\n{\n\tif (_action == nullptr)\n\t{\n\t\tCC_SAFE_RELEASE_NULL(_actionSpawn);\n\t}\n\telse\n\t{\n\t\tCC_SAFE_RELEASE_NULL(_action);\n\t}\n\n    for (auto object : _frameArray)\n    {\n        object->clear();\n        CC_SAFE_DELETE(object);\n    }\n\t_frameArray.clear();\n}\n\nvoid ActionNode::initWithDictionary(const rapidjson::Value& dic,Object* root)\n{\n\tsetActionTag(DICTOOL->getIntValue_json(dic, \"ActionTag\"));\n\tint actionFrameCount = DICTOOL->getArrayCount_json(dic, \"actionframelist\");\n\tfor (int i=0; i<actionFrameCount; i++) {\n\n\t\tconst rapidjson::Value& actionFrameDic = DICTOOL->getDictionaryFromArray_json(dic, \"actionframelist\", i);\n\t\tint frameInex = DICTOOL->getIntValue_json(actionFrameDic,\"frameid\");\n\n\t\tbool existPosition = DICTOOL->checkObjectExist_json(actionFrameDic,\"positionx\");\n\t\tif (existPosition)\n\t\t{\n\t\t\tfloat positionX = DICTOOL->getFloatValue_json(actionFrameDic, \"positionx\");\n\t\t\tfloat positionY = DICTOOL->getFloatValue_json(actionFrameDic, \"positiony\");\n\t\t\tActionMoveFrame* actionFrame = new ActionMoveFrame();\n            actionFrame->autorelease();\n\t\t\tactionFrame->setFrameIndex(frameInex);\n\t\t\tactionFrame->setPosition(Point(positionX, positionY));\n\t\t\tauto cActionArray = _frameArray.at((int)kKeyframeMove);\n\t\t\tcActionArray->pushBack(actionFrame);\n\t\t}\n\n\t\tbool existScale = DICTOOL->checkObjectExist_json(actionFrameDic,\"scalex\");\n\t\tif (existScale)\n\t\t{\n\t\t\tfloat scaleX = DICTOOL->getFloatValue_json(actionFrameDic, \"scalex\");\n\t\t\tfloat scaleY = DICTOOL->getFloatValue_json(actionFrameDic, \"scaley\");\n\t\t\tActionScaleFrame* actionFrame = new ActionScaleFrame();\n            actionFrame->autorelease();\n\t\t\tactionFrame->setFrameIndex(frameInex);\n\t\t\tactionFrame->setScaleX(scaleX);\n\t\t\tactionFrame->setScaleY(scaleY);\n\t\t\tauto cActionArray = _frameArray.at((int)kKeyframeScale);\n\t\t\tcActionArray->pushBack(actionFrame);\n\t\t}\n\n\t\tbool existRotation = DICTOOL->checkObjectExist_json(actionFrameDic,\"rotation\");\n\t\tif (existRotation)\n\t\t{\n\t\t\tfloat rotation = DICTOOL->getFloatValue_json(actionFrameDic, \"rotation\");\n\t\t\tActionRotationFrame* actionFrame = new ActionRotationFrame();\n            actionFrame->autorelease();\n\t\t\tactionFrame->setFrameIndex(frameInex);\n\t\t\tactionFrame->setRotation(rotation);\n\t\t\tauto cActionArray = _frameArray.at((int)kKeyframeRotate);\n\t\t\tcActionArray->pushBack(actionFrame);\n\t\t}\n\n\t\tbool existOpacity = DICTOOL->checkObjectExist_json(actionFrameDic,\"opacity\");\n\t\tif (existOpacity)\n\t\t{\n\t\t\tint opacity = DICTOOL->getIntValue_json(actionFrameDic, \"opacity\");\n\t\t\tActionFadeFrame* actionFrame = new ActionFadeFrame();\n            actionFrame->autorelease();\n\t\t\tactionFrame->setFrameIndex(frameInex);\n\t\t\tactionFrame->setOpacity(opacity);\n\t\t\tauto cActionArray = _frameArray.at((int)kKeyframeTint);\n\t\t\tcActionArray->pushBack(actionFrame);\n\t\t}\n\n\t\tbool existColor = DICTOOL->checkObjectExist_json(actionFrameDic,\"colorr\");\n\t\tif (existColor)\n\t\t{\n\t\t\tint colorR = DICTOOL->getIntValue_json(actionFrameDic, \"colorr\");\n\t\t\tint colorG = DICTOOL->getIntValue_json(actionFrameDic, \"colorg\");\n\t\t\tint colorB = DICTOOL->getIntValue_json(actionFrameDic, \"colorb\");\n\t\t\tActionTintFrame* actionFrame = new ActionTintFrame();\n            actionFrame->autorelease();\n\t\t\tactionFrame->setFrameIndex(frameInex);\n\t\t\tactionFrame->setColor(Color3B(colorR,colorG,colorB));\n\t\t\tauto cActionArray = _frameArray.at((int)kKeyframeFade);\n\t\t\tcActionArray->pushBack(actionFrame);\n\t\t}\n\t}\n\tinitActionNodeFromRoot(root);\n}\n\nvoid ActionNode::initActionNodeFromRoot(Object* root)\n{\t\n\tNode* rootNode = dynamic_cast<Node*>(root);\n\tif (rootNode != nullptr)\n\t{\n\t\tWidget* rootWidget = dynamic_cast<Widget*>(root);\n\t\tif (rootWidget != nullptr)\n\t\t{\n\t\t\tWidget* widget = Helper::seekActionWidgetByActionTag(rootWidget, getActionTag());\n\t\t\tif (widget != nullptr)\n\t\t\t{\n\t\t\t\tsetObject(widget);\n\t\t\t}\n\t\t}\n    }\n}\n\nvoid ActionNode::setUnitTime(float fTime)\n{\n\t_fUnitTime = fTime;\n\tthis->refreshActionProperty();\n}\n\nfloat ActionNode::getUnitTime()\n{\n\treturn _fUnitTime;\n}\n\nvoid ActionNode::setActionTag(int tag)\n{\n\t_actionTag = tag;\n}\n\nint ActionNode::getActionTag()\n{\n\treturn _actionTag;\n}\n\nvoid ActionNode::setObject(Object* node)\n{\n\t_object = node;\n}\n\nObject* ActionNode::getObject()\n{\n\treturn _object;\n}\n\nNode* ActionNode::getActionNode()\n{\n\tNode* cNode = dynamic_cast<Node*>(_object);\n\tif (cNode != nullptr)\n\t{\n\t\treturn cNode;\n\t}\n\telse\n\t{\n\t\tWidget* rootWidget = dynamic_cast<Widget*>(_object);\n\t\tif (rootWidget != nullptr)\n\t\t{\n\t\t\treturn rootWidget;\n\t\t}\n\t}\n\treturn nullptr;\n}\n\nvoid ActionNode::insertFrame(int index, ActionFrame* frame)\n{\n\tif (frame == nullptr)\n\t{\n\t\treturn;\n\t}\n\tint frameType = frame->getFrameType();\n\tif(frameType < _frameArray.size())\n\t{\n\t\tauto cArray = _frameArray.at(frameType);\n\t\tcArray->insert(index, frame);\n\t}\n}\n\nvoid ActionNode::addFrame(ActionFrame* frame)\n{\n\tif (frame == nullptr)\n\t{\n\t\treturn;\n\t}\n\tint frameType = frame->getFrameType();\n\n\tif(frameType < _frameArray.size())\n\t{\n\t\tauto cArray = _frameArray.at(frameType);\n\t\tcArray->pushBack(frame);\n\t}\n}\n\nvoid ActionNode::deleteFrame(ActionFrame* frame)\n{\n\tif (frame == nullptr)\n\t{\n\t\treturn;\n\t}\n\tint frameType = frame->getFrameType();\n\tif(frameType < _frameArray.size())\n\t{\n\t\tauto cArray = _frameArray.at(frameType);\n\t\tcArray->eraseObject(frame);\n\t}\n}\n\nvoid ActionNode::clearAllFrame()\n{\n\tfor(auto array : _frameArray)\n\t{\n\t\tarray->clear();\n\t}\n}\n\nSpawn * ActionNode::refreshActionProperty()\n{\n\tif ( _object == nullptr )\n\t{\n\t\treturn nullptr;\n\t}\n\tVector<FiniteTimeAction*> cSpawnArray;\n\n\tfor (int n = 0; n < _frameArrayNum; n++)\n\t{\n\t\tauto cArray = _frameArray.at(n);\n\t\tif (cArray->size() <= 0)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tVector<FiniteTimeAction*> cSequenceArray;\n\t\tauto frameCount = cArray->size();\n\t\tfor (int i = 0; i < frameCount; i++)\n\t\t{\n\t\t\tauto frame = cArray->at(i);\n\t\t\tif (i == 0)\n\t\t\t{\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tauto srcFrame = cArray->at(i-1);\n\t\t\t\tfloat duration = (frame->getFrameIndex() - srcFrame->getFrameIndex()) * getUnitTime();\n\t\t\t\tAction* cAction = frame->getAction(duration);\n\t\t\t\tif(cAction != nullptr)\n\t\t\t\t\tcSequenceArray.pushBack(static_cast<FiniteTimeAction*>(cAction));\n\t\t\t}\n\t\t}\n\t\tSequence* cSequence = Sequence::create(cSequenceArray);\n\t\tif (cSequence != nullptr)\n\t\t{\n\t\t\tcSpawnArray.pushBack(cSequence);\n\t\t}\n\t}\n\n\tif (_action == nullptr)\n\t{\n\t\tCC_SAFE_RELEASE_NULL(_actionSpawn);\n\t}\n\telse\n\t{\n\t\tCC_SAFE_RELEASE_NULL(_action);\n\t}\n\n\t_actionSpawn = Spawn::create(cSpawnArray);\n\tCC_SAFE_RETAIN(_actionSpawn);\n\treturn _actionSpawn;\n}\n\nvoid ActionNode::playAction()\n{\n\tif ( _object == nullptr || _actionSpawn == nullptr)\n\t{\n\t\treturn;\n\t}\n\n\tif (_action!=nullptr)\n\t{\n\t\t_action->release();\n\t}\n\n\t_action = Sequence::create(_actionSpawn, nullptr);\n\t_action->retain();\n\n\tthis->runAction();\n\n}\n\nvoid ActionNode::runAction()\n{\n\tNode* cNode = this->getActionNode();\n\tif (cNode != nullptr && _action != nullptr)\n\t{\n\t\tcNode->runAction(_action);\n\t}\n}\n\nvoid ActionNode::stopAction()\n{\n\tNode* cNode = this->getActionNode();\n\tif (cNode != nullptr && _action != nullptr)\n\t{\n\t\tcNode->stopAction(_action);\n\t}\n}\n\nint ActionNode::getFirstFrameIndex()\n{\n\tint frameindex = 99999;\n\tbool bFindFrame = false;\n\tfor (int n = 0; n < _frameArrayNum; n++)\n\t{\n\t\tauto cArray = _frameArray.at(n);\n\t\tif (cArray->empty())\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tbFindFrame = true;\n\t\tauto frame = cArray->at(0);\n\t\tint iFrameIndex = frame->getFrameIndex();\n\n\t\tif (frameindex > iFrameIndex)\n\t\t{\n\t\t\tframeindex = iFrameIndex;\n\t\t}\n\t}\n\tif (!bFindFrame)\n\t{\n\t\tframeindex = 0;\n\t}\n\treturn frameindex;\n}\n\nint ActionNode::getLastFrameIndex()\n{\n\tint frameindex = -1;\n\tbool bFindFrame = false;\n\tfor (int n = 0; n < _frameArrayNum; n++)\n\t{\n\t\tauto cArray = _frameArray.at(n);\n\t\tif (cArray->empty())\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tbFindFrame = true;\n\t\tssize_t lastInex = cArray->size() - 1;\n\t\tauto frame = cArray->at(lastInex);\n\t\tint iFrameIndex = frame->getFrameIndex();\n\n\t\tif (frameindex < iFrameIndex)\n\t\t{\n\t\t\tframeindex = iFrameIndex;\n\t\t}\n\t}\n\tif (!bFindFrame)\n\t{\n\t\tframeindex = 0;\n\t}\n\treturn frameindex;\n}\nbool ActionNode::updateActionToTimeLine(float fTime)\n{\n\tbool bFindFrame = false;\n\n\tActionFrame* srcFrame = nullptr;\n\t//\tActionFrame* destFrame = nullptr;\n\n\tfor (int n = 0; n < _frameArrayNum; n++)\n\t{\n\t\tauto cArray = _frameArray.at(n);\n\t\tif (cArray->empty())\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tssize_t frameCount = cArray->size();\n\t\tfor (int i = 0; i < frameCount; i++)\n\t\t{\n\t\t\tauto frame = cArray->at(i);\n\n\t\t\tif (frame->getFrameIndex()*getUnitTime() == fTime)\n\t\t\t{\n\t\t\t\tthis->easingToFrame(1.0f,1.0f,nullptr,frame);\n\t\t\t\tbFindFrame = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (frame->getFrameIndex()*getUnitTime() > fTime)\n\t\t\t{\n\t\t\t\tif (i == 0)\n\t\t\t\t{\n\t\t\t\t\tthis->easingToFrame(1.0f,1.0f,nullptr,frame);\n\t\t\t\t\tbFindFrame = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsrcFrame = cArray->at(i-1);\n\t\t\t\t\tfloat duration = (frame->getFrameIndex() - srcFrame->getFrameIndex())*getUnitTime();\n\t\t\t\t\tfloat delaytime = fTime - srcFrame->getFrameIndex()*getUnitTime();\n\t\t\t\t\tthis->easingToFrame(duration,1.0f,nullptr,srcFrame);\n\t\t\t\t\t//float easingTime = ActionFrameEasing::bounceTime(delaytime);\n\t\t\t\t\tthis->easingToFrame(duration,delaytime/duration,srcFrame,frame);\n\t\t\t\t\tbFindFrame = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn bFindFrame;\n}\n\nvoid ActionNode::easingToFrame(float duration,float delayTime,ActionFrame* srcFrame,ActionFrame* destFrame)\n{\n\tAction* cAction = destFrame->getAction(duration,srcFrame);\n\tNode* cNode = this->getActionNode();\n\tif (cAction == nullptr || cNode == nullptr)\n\t{\n\t\treturn;\n\t}\t\n\tcAction->startWithTarget(cNode);\n\tcAction->update(delayTime);\n}\n\n\nbool ActionNode::isActionDoneOnce()\n{\n\tif (_action == nullptr)\n\t{\n\t\treturn true;\n\t}\n\treturn _action->isDone();\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionNode.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ActionNODE_H__\n#define __ActionNODE_H__\n\n#include \"cocostudio/CCActionFrame.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\nnamespace cocostudio {\n\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionNode:public cocos2d::Object\n{\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionNode();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionNode();\n\t/**\n\t* Sets the time interval of frame.\n\t*\n\t* @param fTime   the time interval of frame\n\t*/\n\tvoid setUnitTime(float fTime);\n\n\t/**\n\t* Gets the time interval of frame.\n\t*\n\t* @return fTime   the time interval of frame\n\t*/\n\tfloat getUnitTime();\n\t/**\n\t* Sets tag for ActionNode\n\t*\n\t* @param tag    tag of ActionNode\n\t*/\n\tvoid setActionTag(int tag);\n\n\t/**\n\t* Gets tag for ActionNode\n\t*\n\t* @return tag    tag of ActionNode\n\t*/\n\tint getActionTag();\n\n\t/**\n\t* Sets node which will run a action.\n\t*\n\t* @param  node which will run a action\n\t*/\n\tvoid setObject(cocos2d::Object* node);\n\n\t/**\n\t* Gets node which will run a action.\n\t*\n\t* @return  node which will run a action\n\t*/\n\tcocos2d::Object* getObject();\n\n\t/**\n\t* Insets a ActionFrame to ActionNode.\n\t*\n\t* @param index  the index of ActionFrame\n\t*\n\t* @param frame  the ActionFrame which will be inserted\n\t*/\n\tvoid insertFrame(int index, ActionFrame* frame);\n\n\t/**\n\t* Pushs back a ActionFrame to ActionNode.\n\t*\n\t* @param frame  the ActionFrame which will be added\n\t*/\n\tvoid addFrame(ActionFrame* frame);\n\n\t/**\n\t* Remove a ActionFrame from ActionNode.\n\t*\n\t* @param frame  the ActionFrame which will be removed\n\t*/\n\tvoid deleteFrame(ActionFrame* frame );\n\n\t/**\n\t* Remove all ActionFrames from ActionNode.\n\t*/\n\tvoid clearAllFrame();\n\n\t/**\n\t* Gets index of first ActionFrame.\n\t*\n\t* @return  index of first ActionFrame\n\t*/\n\tint getFirstFrameIndex();\n\n\t/**\n\t* Gets index of last ActionFrame.\n\t*\n\t* @return  index of last ActionFrame\n\t*/\n\tint getLastFrameIndex();\n\n\t/**\n\t* Updates action states to some time.\n\t*\n\t* @param fTime   the time when need to update\n\t*/\n\tvirtual bool updateActionToTimeLine(float fTime);\n\n\t/**\n\t* Play the action.\n\t*/\n\tvirtual void playAction();\n\n\t/**\n\t* Stop the action.\n\t*/\n\tvirtual void stopAction();\n\n\t/*init properties with a json dictionary*/\n\tvirtual void initWithDictionary(const rapidjson::Value& dic,Object* root);\n\n\t/**\n\t* Gets if the action is done once time.\n\t*\n\t* @return   that if the action is done once time\n\t*/\n\tvirtual bool isActionDoneOnce();\nprotected:\n\tint _currentFrameIndex;\n\tint _destFrameIndex;\n\n\tfloat _fUnitTime;\n\n\tint _actionTag;\n\tcocos2d::Spawn * _actionSpawn;\n\tcocos2d::Action* _action;\n\tcocos2d::Object* _object;\n\n\tstd::vector<cocos2d::Vector<ActionFrame*>*> _frameArray;\n\tint _frameArrayNum;\n\nprotected:\n\tvirtual cocos2d::Node* getActionNode();\n\tvirtual cocos2d::Spawn * refreshActionProperty();\n\tvirtual void runAction();\n\tvirtual void initActionNodeFromRoot(cocos2d::Object* root);\n\tvirtual void easingToFrame(float duration,float delayTime,ActionFrame* srcFrame,ActionFrame* destFrame);\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionObject.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCActionObject.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n#include \"CCActionInstant.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nActionObject::ActionObject()\n: _name(\"\")\n, _loop(false)\n, _bPause(false)\n, _bPlaying(false)\n, _fUnitTime(0.1f)\n, _currentTime(0.0f)\n, _pScheduler(nullptr)\n, _CallBack(nullptr)\n, _fTotalTime(0.0f)\n{\n\t_pScheduler = Director::getInstance()->getScheduler();\n\tCC_SAFE_RETAIN(_pScheduler);\n}\n\nActionObject::~ActionObject()\n{\n\t_actionNodeList.clear();\n\tCC_SAFE_RELEASE(_pScheduler);\n}\n\nvoid ActionObject::setName(const char* name)\n{\n\t_name.assign(name);\n}\nconst char* ActionObject::getName()\n{\n\treturn _name.c_str();\n}\n\nvoid ActionObject::setLoop(bool bLoop)\n{\n\t_loop = bLoop;\n}\nbool ActionObject::getLoop()\n{\n\treturn _loop;\n}\n\nvoid ActionObject::setUnitTime(float fTime)\n{\n\t_fUnitTime = fTime;\n    for(const auto &e : _actionNodeList)\n\t{\n        e->setUnitTime(_fUnitTime);\n\t}\n}\nfloat ActionObject::getUnitTime()\n{\n\treturn _fUnitTime;\n}\n\nfloat ActionObject::getCurrentTime()\n{\n\treturn _currentTime;\n}\n\nvoid ActionObject::setCurrentTime(float fTime)\n{\n\t_currentTime = fTime;\n}\n\nfloat ActionObject::getTotalTime()\n{\n\treturn _fTotalTime;\n}\nbool ActionObject::isPlaying()\n{\n\treturn _bPlaying;\n}\n\nvoid ActionObject::initWithDictionary(const rapidjson::Value& dic, Object* root)\n{\n\tsetName(DICTOOL->getStringValue_json(dic, \"name\"));\n\tsetLoop(DICTOOL->getBooleanValue_json(dic, \"loop\"));\n\tsetUnitTime(DICTOOL->getFloatValue_json(dic, \"unittime\"));\n\tint actionNodeCount = DICTOOL->getArrayCount_json(dic, \"actionnodelist\");\n\tint maxLength = 0;\n\tfor (int i=0; i<actionNodeCount; i++) {\n\t\tActionNode* actionNode = new ActionNode();\n\t\tactionNode->autorelease();\n\t\tconst rapidjson::Value& actionNodeDic = DICTOOL->getDictionaryFromArray_json(dic, \"actionnodelist\", i);\n\t\tactionNode->initWithDictionary(actionNodeDic,root);\n\t\tactionNode->setUnitTime(getUnitTime());\n\t\t_actionNodeList.pushBack(actionNode);\n\n\t\tint length = actionNode->getLastFrameIndex() - actionNode->getFirstFrameIndex();\n\t\tif(length > maxLength)\n\t\t\tmaxLength = length;\n\t}\n\t_fTotalTime = maxLength*_fTotalTime;\n}\n\nvoid ActionObject::addActionNode(ActionNode* node)\n{\n\tif (node == nullptr)\n\t{\n\t\treturn;\n\t}\n\t_actionNodeList.pushBack(node);\n\tnode->setUnitTime(_fUnitTime);\n}\nvoid ActionObject::removeActionNode(ActionNode* node)\n{\n\tif (node == nullptr)\n\t{\n\t\treturn;\n\t}\n\t_actionNodeList.eraseObject(node);\n}\n\nvoid ActionObject::play()\n{\n\tstop();\n\tthis->updateToFrameByTime(0.0f);\n    for(const auto &e : _actionNodeList)\n\t{\n\t\te->playAction();\n\t}\n\tif (_loop)\n\t{\n\t\t_pScheduler->scheduleSelector(schedule_selector(ActionObject::simulationActionUpdate), this, 0.0f , kRepeatForever, 0.0f, false);\n\t}\n\telse\n\t{\n\t\t_pScheduler->scheduleSelector(schedule_selector(ActionObject::simulationActionUpdate), this, 0.0f, false);\n\t}\n}\n\nvoid ActionObject::play(CallFunc* func)\n{\n\tthis->play();\n\tthis->_CallBack = func;\n}\nvoid ActionObject::pause()\n{\n\t_bPause = true;\n}\n\nvoid ActionObject::stop()\n{\n    for(const auto &e : _actionNodeList)\n\t{\n\t\te->stopAction();\n\t}\n\t_pScheduler->unscheduleSelector(schedule_selector(ActionObject::simulationActionUpdate), this);\n\t_bPause = false;\n}\n\nvoid ActionObject::updateToFrameByTime(float fTime)\n{\n\t_currentTime = fTime;\n    for(const auto &e : _actionNodeList)\n\t{\n\t\te->updateActionToTimeLine(fTime);\n\t}\n}\n\nvoid ActionObject::simulationActionUpdate(float dt)\n{\n\tbool isEnd = true;\n    \n    for(const auto &e : _actionNodeList)\n\t{\n\t\tif (!e->isActionDoneOnce())\n\t\t{\n\t\t\tisEnd = false;\n\t\t\tbreak;\n\t\t}\n\t}\n    \n\tif (isEnd)\n\t{\n\t\tif (_CallBack != nullptr)\n\t\t{\n\t\t\t_CallBack->execute();\n\t\t}\n\t\tif (_loop)\n\t\t{\n\t\t\tthis->play();\n\t\t}\n\t}\n}\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCActionObject.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __ActionObject_H__\n#define __ActionObject_H__\n\n#include \"CCActionNode.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\nnamespace cocostudio {\n\n/**\n*  @js NA\n*  @lua NA\n*/\nclass ActionObject:public cocos2d::Object\n{\npublic:\n\n\t/**\n\t* Default constructor\n\t*/\n\tActionObject();\n\n\t/**\n\t* Default destructor\n\t*/\n\tvirtual ~ActionObject();\n\n\t/**\n\t* Sets name for object\n\t*\n\t* @param name    name of object\n\t*/\n\tvoid setName(const char* name);\n\n\t/**\n\t* Sets name for object\n\t*\n\t* @return name of object\n\t*/\n\tconst char* getName();\n\n\t/**\n\t* Sets if the action will loop play.\n\t*\n\t* @param bLoop     that if the action will loop play\n\t*/\n\tvoid setLoop(bool bLoop);\n\n\t/**\n\t* Gets if the action will loop play.\n\t*\n\t* @return   that if the action will loop play\n\t*/\n\tbool getLoop();\n\n\t/**\n\t* Sets the time interval of frame.\n\t*\n\t* @param fTime   the time interval of frame\n\t*/\n\tvoid setUnitTime(float fTime);\n\n\t/**\n\t* Gets the time interval of frame.\n\t*\n\t* @return fTime   the time interval of frame\n\t*/\n\tfloat getUnitTime();\n\n\t/**\n\t* Sets the current time of frame.\n\t*\n\t* @param fTime   the current time of frame\n\t*/\n\tvoid setCurrentTime(float fTime);\n\n\t/**\n\t* Gets the current time of frame.\n\t*\n\t* @return fTime   the current time of frame\n\t*/\n\tfloat getCurrentTime();\n\n\t/**\n\t* Gets the total time of frame.\n\t*\n\t* @return fTime   the current time of frame\n\t*/\n\tfloat getTotalTime();\n\n\t/**\n\t* Return if the action is playing.\n\t*\n\t* @return true if the action is playing, false the otherwise\n\t*/\n\tbool isPlaying();\n\n\t/**\n\t* Play the action.\n\t*/\n\tvoid play();\n\n\t/**\n\t* Play the action.\n\t*\n\t* @ Action Call Back\n\t*/\n\tvoid play(cocos2d::CallFunc* func);\n\n\t/** \n\t* Pause the action.\n\t*/\n\tvoid pause();\n\n\t/**\n\t* Stop the action.\n\t*/\n\tvoid stop();\n\n\t/**\n\t* Adds a ActionNode to play the action.\n\t*\n\t* @node    the ActionNode which will play the action\n\t*/\n\tvoid addActionNode(ActionNode* node);\n\n\t/**\n\t* Removes a ActionNode which play the action.\n\t*\n\t* @node    the ActionNode which play the action\n\t*/\n\tvoid removeActionNode(ActionNode* node);\n\n\t/*update frame method*/\n\tvoid updateToFrameByTime(float fTime);\n\n\t/*init properties with a json dictionary*/\n\tvoid initWithDictionary(const rapidjson::Value& dic,Object* root);\n\n\t/*scheduler update function*/\n\tvoid simulationActionUpdate(float dt);\nprotected:\n\tcocos2d::Vector<ActionNode*> _actionNodeList;/*actionnode*/\n\tstd::string _name;\n\tbool _loop;\n\tbool _bPause;\n\tbool _bPlaying;\n\tfloat _fUnitTime;\n\tfloat _currentTime;\n\tcocos2d::Scheduler *_pScheduler;\n\tcocos2d::CallFunc *_CallBack;\n\tfloat _fTotalTime;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmature.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCArmatureDataManager.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDataReaderHelper.h\"\n#include \"cocostudio/CCDatas.h\"\n#include \"cocostudio/CCSkin.h\"\n\n#include \"renderer/CCQuadCommand.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"CCShaderCache.h\"\n#include \"CCDrawingPrimitives.h\"\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n#include \"Box2D/Box2D.h\"\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n#include \"chipmunk.h\"\n#endif\n\nusing namespace cocos2d;\n\n\nnamespace cocostudio {\n\nArmature *Armature::create()\n{\n    Armature *armature = new Armature();\n    if (armature && armature->init())\n    {\n        armature->autorelease();\n        return armature;\n    }\n    CC_SAFE_DELETE(armature);\n    return nullptr;\n}\n\n\nArmature *Armature::create(const std::string& name)\n{\n    Armature *armature = new Armature();\n    if (armature && armature->init(name))\n    {\n        armature->autorelease();\n        return armature;\n    }\n    CC_SAFE_DELETE(armature);\n    return nullptr;\n}\n\nArmature *Armature::create(const std::string& name, Bone *parentBone)\n{\n    Armature *armature = new Armature();\n    if (armature && armature->init(name, parentBone))\n    {\n        armature->autorelease();\n        return armature;\n    }\n    CC_SAFE_DELETE(armature);\n    return nullptr;\n}\n\nArmature::Armature()\n    : _armatureData(nullptr)\n    , _batchNode(nullptr)\n    , _parentBone(nullptr)\n    , _armatureTransformDirty(true)\n    , _animation(nullptr)\n{\n}\n\n\nArmature::~Armature(void)\n{\n    _boneDic.clear();\n    _topBoneList.clear();\n\n    CC_SAFE_DELETE(_animation);\n}\n\n\nbool Armature::init()\n{\n    return init(\"\");\n}\n\n\nbool Armature::init(const std::string& name)\n{\n    bool bRet = false;\n    do\n    {\n        removeAllChildren();\n\n        CC_SAFE_DELETE(_animation);\n        _animation = new ArmatureAnimation();\n        _animation->init(this);\n\n        _boneDic.clear();\n        _topBoneList.clear();\n\n        _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n\n        _name = name;\n\n        ArmatureDataManager *armatureDataManager = ArmatureDataManager::getInstance();\n\n        if(!_name.empty())\n        {\n            AnimationData *animationData = armatureDataManager->getAnimationData(name);\n            CCASSERT(animationData, \"AnimationData not exist! \");\n\n            _animation->setAnimationData(animationData);\n\n\n            ArmatureData *armatureData = armatureDataManager->getArmatureData(name);\n            CCASSERT(armatureData, \"\");\n\n            _armatureData = armatureData;\n\n            for (auto& element : armatureData->boneDataDic)\n            {\n                Bone *bone = createBone(element.first.c_str());\n\n                //! init bone's  Tween to 1st movement's 1st frame\n                do\n                {\n                    MovementData *movData = animationData->getMovement(animationData->movementNames.at(0).c_str());\n                    CC_BREAK_IF(!movData);\n\n                    MovementBoneData *movBoneData = movData->getMovementBoneData(bone->getName().c_str());\n                    CC_BREAK_IF(!movBoneData || movBoneData->frameList.size() <= 0);\n\n                    FrameData *frameData = movBoneData->getFrameData(0);\n                    CC_BREAK_IF(!frameData);\n\n                    bone->getTweenData()->copy(frameData);\n                    bone->changeDisplayWithIndex(frameData->displayIndex, false);\n                }\n                while (0);\n            }\n\n            update(0);\n            updateOffsetPoint();\n        }\n        else\n        {\n            _name = \"new_armature\";\n            _armatureData = ArmatureData::create();\n            _armatureData->name = _name;\n\n            AnimationData *animationData = AnimationData::create();\n            animationData->name = _name;\n\n            armatureDataManager->addArmatureData(_name.c_str(), _armatureData);\n            armatureDataManager->addAnimationData(_name.c_str(), animationData);\n\n            _animation->setAnimationData(animationData);\n\n        }\n\n        setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n\n        setCascadeOpacityEnabled(true);\n        setCascadeColorEnabled(true);\n\n        bRet = true;\n    }\n    while (0);\n\n    return bRet;\n}\n\nbool Armature::init(const std::string& name, Bone *parentBone)\n{\n    _parentBone = parentBone;\n    return init(name);\n}\n\n\nBone *Armature::createBone(const std::string& boneName)\n{\n    Bone *existedBone = getBone(boneName);\n    if(existedBone != nullptr)\n        return existedBone;\n\n    BoneData *boneData = (BoneData *)_armatureData->getBoneData(boneName);\n    std::string parentName = boneData->parentName;\n\n    Bone *bone = nullptr;\n\n    if( parentName.length() != 0 )\n    {\n        createBone(parentName.c_str());\n        bone = Bone::create(boneName);\n        addBone(bone, parentName.c_str());\n    }\n    else\n    {\n        bone = Bone::create(boneName);\n        addBone(bone, \"\");\n    }\n\n    bone->setBoneData(boneData);\n    bone->getDisplayManager()->changeDisplayWithIndex(-1, false);\n\n    return bone;\n}\n\n\nvoid Armature::addBone(Bone *bone, const std::string& parentName)\n{\n    CCASSERT( bone != nullptr, \"Argument must be non-nil\");\n    CCASSERT(_boneDic.at(bone->getName()) == nullptr, \"bone already added. It can't be added again\");\n\n    if (!parentName.empty())\n    {\n        Bone *boneParent = _boneDic.at(parentName);\n        if (boneParent)\n        {\n            boneParent->addChildBone(bone);\n        }\n        else\n        {\n            _topBoneList.pushBack(bone);\n        }\n    }\n    else\n    {\n        _topBoneList.pushBack(bone);\n    }\n\n    bone->setArmature(this);\n\n    _boneDic.insert(bone->getName(), bone);\n    addChild(bone);\n}\n\n\nvoid Armature::removeBone(Bone *bone, bool recursion)\n{\n    CCASSERT(bone != nullptr, \"bone must be added to the bone dictionary!\");\n\n    bone->setArmature(nullptr);\n    bone->removeFromParent(recursion);\n\n    if (_topBoneList.contains(bone))\n    {\n        _topBoneList.eraseObject(bone);\n    }\n    _boneDic.erase(bone->getName());\n    removeChild(bone, true);\n}\n\n\nBone *Armature::getBone(const std::string& name) const\n{\n    return _boneDic.at(name);\n}\n\n\nvoid Armature::changeBoneParent(Bone *bone, const std::string& parentName)\n{\n    CCASSERT(bone != nullptr, \"bone must be added to the bone dictionary!\");\n\n    if(bone->getParentBone())\n    {\n        bone->getParentBone()->getChildren().eraseObject(bone);\n        bone->setParentBone(nullptr);\n    }\n\n    if (!parentName.empty())\n    {\n        Bone *boneParent = _boneDic.at(parentName);\n\n        if (boneParent)\n        {\n            boneParent->addChildBone(bone);\n            if (_topBoneList.contains(bone))\n            {\n                _topBoneList.eraseObject(bone);\n            }\n        }\n        else\n        {\n            _topBoneList.pushBack(bone);\n        }\n    }\n}\n\nconst cocos2d::Map<std::string, Bone*>& Armature::getBoneDic() const\n{\n    return _boneDic;\n}\n\nconst kmMat4& Armature::getNodeToParentTransform() const\n{\n    if (_transformDirty)\n        _armatureTransformDirty = true;\n\n    return Node::getNodeToParentTransform();\n}\n\nvoid Armature::updateOffsetPoint()\n{\n    // Set contentsize and Calculate anchor point.\n    Rect rect = getBoundingBox();\n    setContentSize(rect.size);\n    _offsetPoint = Point(-rect.origin.x,  -rect.origin.y);\n    if (rect.size.width != 0 && rect.size.height != 0)\n    {\n        setAnchorPoint(Point(_offsetPoint.x / rect.size.width, _offsetPoint.y / rect.size.height));\n    }\n}\n\nvoid Armature::setAnchorPoint(const Point& point)\n{\n    if( ! point.equals(_anchorPoint))\n    {\n        _anchorPoint = point;\n        _anchorPointInPoints = Point(_contentSize.width * _anchorPoint.x - _offsetPoint.x, _contentSize.height * _anchorPoint.y - _offsetPoint.y);\n        _realAnchorPointInPoints = Point(_contentSize.width * _anchorPoint.x, _contentSize.height * _anchorPoint.y);\n        _transformDirty = _inverseDirty = true;\n    }\n}\n\nconst Point& Armature::getAnchorPointInPoints() const\n{\n    return _realAnchorPointInPoints;\n}\n\nvoid Armature::setAnimation(ArmatureAnimation *animation)\n{\n    _animation = animation;\n}\n\nArmatureAnimation *Armature::getAnimation() const \n{\n    return _animation;\n}\n\nbool Armature::getArmatureTransformDirty() const \n{\n    return _armatureTransformDirty;\n}\n\nvoid Armature::update(float dt)\n{\n    _animation->update(dt);\n\n    for(const auto &bone : _topBoneList) {\n        bone->update(dt);\n    }\n\n    _armatureTransformDirty = false;\n}\n\nvoid Armature::draw()\n{\n    if (_parentBone == nullptr && _batchNode == nullptr)\n    {\n        CC_NODE_DRAW_SETUP();\n    }\n\n\n    for (auto& object : _children)\n    {\n        if (Bone *bone = dynamic_cast<Bone *>(object))\n        {\n            Node *node = bone->getDisplayRenderNode();\n\n            if (nullptr == node)\n                continue;\n\n            switch (bone->getDisplayRenderNodeType())\n            {\n            case CS_DISPLAY_SPRITE:\n            {\n                Skin *skin = static_cast<Skin *>(node);\n                skin->updateTransform();\n                \n                bool blendDirty = bone->isBlendDirty();\n                \n                if (blendDirty)\n                {\n                    skin->setBlendFunc(bone->getBlendFunc());\n                }\n                skin->draw();\n            }\n            break;\n            case CS_DISPLAY_ARMATURE:\n            {\n                node->draw();\n            }\n            break;\n            default:\n            {\n                node->visit();\n                CC_NODE_DRAW_SETUP();\n            }\n            break;\n            }\n        }\n        else if(Node *node = dynamic_cast<Node *>(object))\n        {\n            node->visit();\n            CC_NODE_DRAW_SETUP();\n        }\n    }\n}\n\nvoid Armature::onEnter()\n{\n    Node::onEnter();\n    scheduleUpdate();\n}\n\nvoid Armature::onExit()\n{\n    Node::onExit();\n    unscheduleUpdate();\n}\n\n\nvoid Armature::visit()\n{\n    // quick return if not visible. children won't be drawn.\n    if (!_visible)\n    {\n        return;\n    }\n    kmGLPushMatrix();\n\n    transform();\n    sortAllChildren();\n    draw();\n\n    // reset for next frame\n    _orderOfArrival = 0;\n\n    kmGLPopMatrix();\n}\n\nRect Armature::getBoundingBox() const\n{\n    float minx, miny, maxx, maxy = 0;\n\n    bool first = true;\n\n    Rect boundingBox = Rect(0, 0, 0, 0);\n\n    for (const auto& object : _children)\n    {\n        if (Bone *bone = dynamic_cast<Bone *>(object))\n        {\n            Rect r = bone->getDisplayManager()->getBoundingBox();\n\n            if(first)\n            {\n                minx = r.getMinX();\n                miny = r.getMinY();\n                maxx = r.getMaxX();\n                maxy = r.getMaxY();\n\n                first = false;\n            }\n            else\n            {\n                minx = r.getMinX() < boundingBox.getMinX() ? r.getMinX() : boundingBox.getMinX();\n                miny = r.getMinY() < boundingBox.getMinY() ? r.getMinY() : boundingBox.getMinY();\n                maxx = r.getMaxX() > boundingBox.getMaxX() ? r.getMaxX() : boundingBox.getMaxX();\n                maxy = r.getMaxY() > boundingBox.getMaxY() ? r.getMaxY() : boundingBox.getMaxY();\n            }\n\n            boundingBox.setRect(minx, miny, maxx - minx, maxy - miny);\n        }\n\n    }\n\n    return RectApplyTransform(boundingBox, getNodeToParentTransform());\n}\n\nBone *Armature::getBoneAtPoint(float x, float y) const \n{\n    long length = _children.size();\n    Bone *bs;\n\n    for(long i = length - 1; i >= 0; i--)\n    {\n        bs = static_cast<Bone*>( _children.at(i) );\n        if(bs->getDisplayManager()->containPoint(x, y))\n        {\n            return bs;\n        }\n    }\n    return nullptr;\n}\n\n\nvoid Armature::setParentBone(Bone *parentBone)\n{\n    _parentBone = parentBone;\n\n    for (auto& element : _boneDic)\n    {\n        element.second->setArmature(this);\n    }\n}\n\nBone *Armature::getParentBone() const\n{\n    return _parentBone;\n}\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n\nvoid CCArmature::setColliderFilter(ColliderFilter *filter)\n{\n    for (auto& element : _boneDic)\n    {\n        element.second->setColliderFilter(filter);\n    }\n}\n#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n\nvoid CCArmature::drawContour()\n{\n    for(auto& element : _boneDic)\n    {\n        Bone *bone = element.second;\n        ColliderDetector *detector = bone->getColliderDetector();\n\n        if (!detector)\n            continue;\n\n        const cocos2d::Vector<ColliderBody*>& bodyList = detector->getColliderBodyList();\n\n        for (auto& object : bodyList)\n        {\n            ColliderBody *body = static_cast<ColliderBody*>(object);\n            const std::vector<Point> &vertexList = body->getCalculatedVertexList();\n\n            unsigned long length = vertexList.size();\n            Point *points = new Point[length];\n            for (unsigned long i = 0; i<length; i++)\n            {\n                Point p = vertexList.at(i);\n                points[i].x = p.x;\n                points[i].y = p.y;\n            }\n            DrawPrimitives::drawPoly( points, (unsigned int)length, true );\n\n            delete []points;\n        }\n    }\n}\n\n#endif\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\nb2Body *Armature::getBody() const\n{\n    return _body;\n}\n\nvoid Armature::setBody(b2Body *body)\n{\n    if (_body == body)\n    {\n        return;\n    }\n\n    _body = body;\n    _body->SetUserData(this);\n\n    for(auto& object : _children)\n    {\n        if (Bone *bone = dynamic_cast<Bone *>(object))\n        {\n            auto displayList = bone->getDisplayManager()->getDecorativeDisplayList();\n\n            for(auto displayObject : displayList)\n            {\n                ColliderDetector *detector = static_cast<DecorativeDisplay *>(displayObject)->getColliderDetector();\n                if (detector != nullptr)\n                {\n                    detector->setBody(_body);\n                }\n            }\n        }\n    }\n}\n\nb2Fixture *Armature::getShapeList()\n{\n    if (_body)\n    {\n        return _body->GetFixtureList();\n    }\n    else\n    {\n        return nullptr;\n    }\n}\n\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\ncpBody *Armature::getBody() const\n{\n    return _body;\n}\n\nvoid Armature::setBody(cpBody *body)\n{\n    if (_body == body)\n    {\n        return;\n    }\n\n    _body = body;\n    _body->data = this;\n\n    for (const auto& object : _children)\n    {\n        if (Bone *bone = dynamic_cast<Bone *>(object))\n        {\n            auto displayList = bone->getDisplayManager()->getDecorativeDisplayList();\n\n            for (const auto& displayObject : displayList)\n            {\n                auto detector = displayObject->getColliderDetector();\n                if (detector != nullptr)\n                {\n                    detector->setBody(body);\n                }\n            });\n        }\n    }\n}\n\ncpShape *Armature::getShapeList()\n{\n    if (_body)\n    {\n        return _body->shapeList_private;\n    }\n    else\n    {\n        return nullptr;\n    }\n}\n#endif\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmature.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCARMATURE_H__\n#define __CCARMATURE_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCBatchNode.h\"\n#include \"cocostudio/CCArmatureAnimation.h\"\n#include \"cocostudio/CCSpriteFrameCacheHelper.h\"\n#include \"cocostudio/CCArmatureDataManager.h\"\n\nclass b2Body;\nstruct cpBody;\n\nnamespace cocostudio {\n\nCC_DEPRECATED_ATTRIBUTE typedef ProcessBase CCProcessBase;\nCC_DEPRECATED_ATTRIBUTE typedef BaseData CCBaseData;\nCC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData;\nCC_DEPRECATED_ATTRIBUTE typedef SpriteDisplayData CCSpriteDisplayData;\nCC_DEPRECATED_ATTRIBUTE typedef ArmatureDisplayData CCArmatureDisplayData;\nCC_DEPRECATED_ATTRIBUTE typedef ParticleDisplayData CCParticleDisplayData;\nCC_DEPRECATED_ATTRIBUTE typedef BoneData CCBoneData;\nCC_DEPRECATED_ATTRIBUTE typedef FrameData CCFrameData;\nCC_DEPRECATED_ATTRIBUTE typedef MovementBoneData CCMovementBoneData;\nCC_DEPRECATED_ATTRIBUTE typedef MovementData CCMovementData;\nCC_DEPRECATED_ATTRIBUTE typedef AnimationData CCAnimationData;\nCC_DEPRECATED_ATTRIBUTE typedef ContourData CCContourData;\nCC_DEPRECATED_ATTRIBUTE typedef TextureData CCTextureData;\nCC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay;\nCC_DEPRECATED_ATTRIBUTE typedef DisplayData CCDisplayData;\nCC_DEPRECATED_ATTRIBUTE typedef DisplayFactory CCDisplayFactory;\nCC_DEPRECATED_ATTRIBUTE typedef BatchNode CCBatchNode;\nCC_DEPRECATED_ATTRIBUTE typedef DecorativeDisplay CCDecorativeDisplay;\nCC_DEPRECATED_ATTRIBUTE typedef DisplayManager CCDisplayManager;\nCC_DEPRECATED_ATTRIBUTE typedef ColliderBody CCColliderBody;\nCC_DEPRECATED_ATTRIBUTE typedef ColliderDetector CCColliderDetector;\nCC_DEPRECATED_ATTRIBUTE typedef SpriteFrameCacheHelper CCSpriteFrameCacheHelper;\nCC_DEPRECATED_ATTRIBUTE typedef TweenFunction CCTweenFunction;\nCC_DEPRECATED_ATTRIBUTE typedef ArmatureData CCArmatureData;\nCC_DEPRECATED_ATTRIBUTE typedef Bone CCBone;\nCC_DEPRECATED_ATTRIBUTE typedef ArmatureAnimation CCArmatureAnimation;\nCC_DEPRECATED_ATTRIBUTE typedef Armature CCArmature;\nCC_DEPRECATED_ATTRIBUTE typedef ArmatureDataManager CCArmatureDataManager;\nCC_DEPRECATED_ATTRIBUTE typedef TweenType CCTweenType;\n\nclass  Armature : public cocos2d::Node, public cocos2d::BlendProtocol\n{\n\npublic:\n\n    /**\n    * Allocates and initializes an armature.\n    * @return An initialized armature which is marked as \"autorelease\".\n    */\n    static Armature *create();\n\n    /**\n    * Allocates an armature, and use the ArmatureData named name in ArmatureDataManager to initializes the armature.\n    *\n    * @param  name Armature will use the name to find the ArmatureData to initializes it.\n    * @return A initialized armature which is marked as \"autorelease\".\n    */\n    static Armature *create(const std::string& name);\n\n    static Armature *create(const std::string& name, Bone *parentBone);\n\npublic:\n    /**\n     *  @js ctor\n     */\n    Armature();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Armature(void);\n\n    /**\n     * Init the empty armature\n     */\n    virtual bool init() override;\n\n    /**\n     * Init an armature with specified name\n     * @param name Armature name\n     */\n    virtual bool init(const std::string& name);\n\n    virtual bool init(const std::string& name, Bone *parentBone);\n    /**\n     * Add a Bone to this Armature,\n     *\n     * @param bone  The Bone you want to add to Armature\n     * @param parentName   The parent Bone's name you want to add to . If it's  nullptr, then set Armature to its parent\n     */\n    virtual void addBone(Bone *bone, const std::string& parentName);\n    /**\n     * Get a bone with the specified name\n     *\n     * @param name The bone's name you want to get\n     */\n    virtual Bone *getBone(const std::string& name) const;\n    /**\n     * Change a bone's parent with the specified parent name.\n     *\n     * @param bone The bone you want to change parent\n     * @param parentName The new parent's name.\n     */\n    virtual void changeBoneParent(Bone *bone, const std::string& parentName);\n    /**\n     * Remove a bone with the specified name. If recursion it will also remove child Bone recursionly.\n     *\n     * @param bone The bone you want to remove\n     * @param recursion Determine whether remove the bone's child  recursion.\n     */\n    virtual void removeBone(Bone *bone, bool recursion);\n\n    /**\n     * Get Armature's bone dictionary\n     * @return Armature's bone dictionary\n     */\n    const cocos2d::Map<std::string, Bone*>& getBoneDic() const;\n\n    /**\n     * This boundingBox will calculate all bones' boundingBox every time\n     */\n    virtual cocos2d::Rect getBoundingBox() const override;\n\n    Bone *getBoneAtPoint(float x, float y) const;\n\n    // overrides\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit() override;\n    virtual void update(float dt) override;\n    virtual void draw() override;\n\n    virtual void onEnter() override;\n    virtual void onExit() override; \n\n    virtual const kmMat4& getNodeToParentTransform() const override;\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    inline void setBlendFunc(const cocos2d::BlendFunc &blendFunc) override { _blendFunc = blendFunc; }\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    inline const cocos2d::BlendFunc &getBlendFunc(void) const override{ return _blendFunc; }\n\t\n\n    /**\n     * Set contentsize and Calculate anchor point.\n     */\n    virtual void updateOffsetPoint();\n    virtual void setAnchorPoint(const cocos2d::Point& point) override;\n    virtual const cocos2d::Point& getAnchorPointInPoints() const override;\n\n    virtual void setAnimation(ArmatureAnimation *animation);\n    virtual ArmatureAnimation *getAnimation() const;\n    \n    virtual bool getArmatureTransformDirty() const;\n\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n    virtual void setColliderFilter(ColliderFilter *filter);\n#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    virtual void drawContour();\n#endif\n\n\n    virtual void setArmatureData(ArmatureData *armatureData) { _armatureData = armatureData; }\n    virtual ArmatureData *getArmatureData() const { return _armatureData; }\n\n    virtual void setName(const std::string &name) { _name = name; }\n    virtual const std::string &getName() const { return _name; } \n\n\n    virtual void setParentBone(Bone *parentBone);\n    virtual Bone *getParentBone() const;\n\n    virtual void setVersion(float version) { _version = version; }\n    virtual float getVersion() const { return _version; }\n\n    virtual void setBatchNode(BatchNode *batchNode) { _batchNode = batchNode; }\n    virtual BatchNode *getBatchNode() const { return _batchNode; }\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n    virtual b2Fixture *getShapeList();\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual void setBody(b2Body *body);\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual b2Body *getBody() const;\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual cpShape *getShapeList();\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual void setBody(cpBody *body);\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual cpBody *getBody() const;\n#endif\n\nprotected:\n\n    /*\n     * Used to create Bone internal\n     * @js NA\n     * @lua NA\n     */\n    Bone *createBone(const std::string& boneName );\n\nprotected:\n    ArmatureData *_armatureData;\n\n    BatchNode *_batchNode;\n\n    std::string _name;\n    Bone *_parentBone;\n    float _version;\n\n    mutable bool _armatureTransformDirty;\n\n    cocos2d::Map<std::string, Bone*> _boneDic;                    //! The dictionary of the bones, include all bones in the armature, no matter it is the direct bone or the indirect bone. It is different from m_pChindren.\n\n    cocos2d::Vector<Bone*> _topBoneList;\n\n    cocos2d::BlendFunc _blendFunc;                    //! It's required for CCTextureProtocol inheritance\n\n    cocos2d::Point _offsetPoint;\n    cocos2d::Point _realAnchorPointInPoints;\n\n    ArmatureAnimation *_animation;\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n    b2Body *_body;\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n    cpBody *_body;\n#endif\n};\n\n}\n\n#endif /*__CCARMATURE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmatureAnimation.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCArmatureAnimation.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCUtilMath.h\"\n#include \"cocostudio/CCDatas.h\"\n\nusing namespace cocos2d;\n\n\nnamespace cocostudio {\n\nArmatureAnimation *ArmatureAnimation::create(Armature *armature)\n{\n    ArmatureAnimation *pArmatureAnimation = new ArmatureAnimation();\n    if (pArmatureAnimation && pArmatureAnimation->init(armature))\n    {\n        pArmatureAnimation->autorelease();\n        return pArmatureAnimation;\n    }\n    CC_SAFE_DELETE(pArmatureAnimation);\n    return nullptr;\n}\n\n\nArmatureAnimation::ArmatureAnimation()\n    : _animationData(nullptr)\n    , _speedScale(1)\n    , _movementData(nullptr)\n    , _armature(nullptr)\n    , _movementID(\"\")\n    , _toIndex(0)\n    , _ignoreFrameEvent(false)\n    , _onMovementList(false)\n    , _movementListLoop(false)\n    , _movementListDurationTo(-1)\n    , _userObject(nullptr)\n\n    , _movementEventCallFunc(nullptr)\n    , _frameEventCallFunc(nullptr)\n    , _movementEventTarget(nullptr)\n    , _frameEventTarget(nullptr)\n    \n    , _movementEventListener(nullptr)\n    , _frameEventListener(nullptr)\n{\n\n}\n\nArmatureAnimation::~ArmatureAnimation(void)\n{\n    CC_SAFE_RELEASE_NULL(_animationData);\n\n    CC_SAFE_RELEASE_NULL(_userObject);\n}\n\nbool ArmatureAnimation::init(Armature *armature)\n{\n    bool bRet = false;\n    do\n    {\n        _armature = armature;\n\n        _tweenList.clear();\n\n        bRet = true;\n    }\n    while (0);\n\n    return bRet;\n}\n\n\nvoid ArmatureAnimation::pause()\n{\n    for (const auto& tween : _tweenList)\n    {\n        tween->pause();\n    }\n    ProcessBase::pause();\n}\n\nvoid ArmatureAnimation::resume()\n{\n    for (const auto& tween : _tweenList)\n    {\n        tween->resume();\n    }\n    ProcessBase::resume();\n}\n\nvoid ArmatureAnimation::stop()\n{\n    for (const auto& tween : _tweenList)\n    {\n        tween->stop();\n    }\n    _tweenList.clear();\n    ProcessBase::stop();\n}\n\nvoid ArmatureAnimation::setAnimationScale(float animationScale )\n{\n    setSpeedScale(animationScale);\n}\n\nfloat ArmatureAnimation::getAnimationScale() const\n{\n    return getSpeedScale();\n}\n\n\nvoid ArmatureAnimation::setSpeedScale(float speedScale)\n{\n    if(speedScale == _speedScale)\n    {\n        return;\n    }\n\n    _speedScale = speedScale;\n\n    _processScale = !_movementData ? _speedScale : _speedScale * _movementData->scale;\n\n    const Map<std::string, Bone*>& map = _armature->getBoneDic();\n    for(auto& element : map)\n    {\n        Bone *bone = element.second;\n\n        bone->getTween()->setProcessScale(_processScale);\n        if (bone->getChildArmature())\n        {\n            bone->getChildArmature()->getAnimation()->setProcessScale(_processScale);\n        }\n    }\n}\n\nfloat ArmatureAnimation::getSpeedScale() const\n{\n    return _speedScale;\n}\n\n\nvoid ArmatureAnimation::play(const std::string& animationName, int durationTo,  int loop)\n{\n    CCASSERT(_animationData, \"_animationData can not be null\");\n\n    _movementData = _animationData->getMovement(animationName.c_str());\n    CCASSERT(_movementData, \"_movementData can not be null\");\n\n    //! Get key frame count\n    _rawDuration = _movementData->duration;\n\n    _movementID = animationName;\n\n    _processScale = _speedScale * _movementData->scale;\n\n    //! Further processing parameters\n    durationTo = (durationTo == -1) ? _movementData->durationTo : durationTo;\n\n    int durationTween = _movementData->durationTween == 0 ? _rawDuration : _movementData->durationTween;\n\n    TweenType tweenEasing = _movementData->tweenEasing;\n    loop = (loop < 0) ? _movementData->loop : loop;\n\n    _onMovementList = false;\n\n    ProcessBase::play(durationTo, durationTween, loop, tweenEasing);\n\n\n    if (_rawDuration == 0)\n    {\n        _loopType = SINGLE_FRAME;\n    }\n    else\n    {\n        if (loop)\n        {\n            _loopType = ANIMATION_TO_LOOP_FRONT;\n        }\n        else\n        {\n            _loopType = ANIMATION_NO_LOOP;\n        }\n        _durationTween = durationTween;\n    }\n\n    MovementBoneData *movementBoneData = nullptr;\n    _tweenList.clear();\n\n    const Map<std::string, Bone*>& map = _armature->getBoneDic();\n    for(auto& element : map)\n    {\n        Bone *bone = element.second;\n        movementBoneData = static_cast<MovementBoneData *>(_movementData->movBoneDataDic.at(bone->getName()));\n\n        Tween *tween = bone->getTween();\n        if(movementBoneData && movementBoneData->frameList.size() > 0)\n        {\n            _tweenList.pushBack(tween);\n            movementBoneData->duration = _movementData->duration;\n            tween->play(movementBoneData, durationTo, durationTween, loop, tweenEasing);\n\n            tween->setProcessScale(_processScale);\n\n            if (bone->getChildArmature())\n            {\n                bone->getChildArmature()->getAnimation()->setProcessScale(_processScale);\n            }\n        }\n        else\n        {\n            if(!bone->isIgnoreMovementBoneData())\n            {\n                //! this bone is not include in this movement, so hide it\n                bone->getDisplayManager()->changeDisplayWithIndex(-1, false);\n                tween->stop();\n            }\n\n        }\n    }\n\n    _armature->update(0);\n}\n\nvoid ArmatureAnimation::playByIndex(int animationIndex, int durationTo, int loop)\n{\n    playWithIndex(animationIndex, durationTo, loop);\n}\n\nvoid ArmatureAnimation::playWithIndex(int animationIndex, int durationTo, int loop)\n{\n    std::vector<std::string> &movName = _animationData->movementNames;\n    CC_ASSERT((animationIndex > -1) && ((unsigned int)animationIndex < movName.size()));\n\n    std::string animationName = movName.at(animationIndex);\n    play(animationName.c_str(), durationTo, loop);\n}\n\n\nvoid ArmatureAnimation::playWithNames(const std::vector<std::string>& movementNames, int durationTo, bool loop)\n{\n    _movementList.clear();\n    _movementListLoop = loop;\n    _movementListDurationTo = durationTo;\n    _onMovementList = true;\n    _movementIndex = 0;\n\n    _movementList = movementNames;\n\n    updateMovementList();\n}\n\nvoid ArmatureAnimation::playWithIndexes(const std::vector<int>& movementIndexes, int durationTo, bool loop)\n{\n    _movementList.clear();\n    _movementListLoop = loop;\n    _movementListDurationTo = durationTo;\n    _onMovementList = true;\n    _movementIndex = 0;\n\n    std::vector<std::string> &movName = _animationData->movementNames;\n\n    for(auto& index : movementIndexes)\n    {\n        std::string name = movName.at(index);\n        _movementList.push_back(name);\n    }\n\n    updateMovementList();\n}\n\nvoid ArmatureAnimation::gotoAndPlay(int frameIndex)\n{\n    if (!_movementData || frameIndex < 0 || frameIndex >= _movementData->duration)\n    {\n        CCLOG(\"Please ensure you have played a movement, and the frameIndex is in the range.\");\n        return;\n    }\n\n    bool ignoreFrameEvent = _ignoreFrameEvent;\n    _ignoreFrameEvent = true;\n\n    _isPlaying = true;\n    _isComplete = _isPause = false;\n\n    ProcessBase::gotoFrame(frameIndex);\n    _currentPercent = (float)_curFrameIndex / ((float)_movementData->duration-1);\n    _currentFrame = _nextFrameIndex * _currentPercent;\n\n    \n    for (const auto &tween : _tweenList)\n    {\n        tween->gotoAndPlay(frameIndex);\n    }\n\n    _armature->update(0);\n\n    _ignoreFrameEvent = ignoreFrameEvent;\n}\n\nvoid ArmatureAnimation::gotoAndPause(int frameIndex)\n{\n    gotoAndPlay(frameIndex);\n    pause();\n}\n\nssize_t ArmatureAnimation::getMovementCount() const\n{\n    return _animationData->getMovementCount();\n}\n\nvoid ArmatureAnimation::update(float dt)\n{\n    ProcessBase::update(dt);\n    \n    for (const auto &tween : _tweenList)\n    {\n        tween->update(dt);\n    }\n\n    while (_frameEventQueue.size() > 0)\n    {\n        FrameEvent *event = _frameEventQueue.front();\n        _frameEventQueue.pop();\n\n        _ignoreFrameEvent = true;\n        \n        if(_frameEventTarget)\n        {\n            (_frameEventTarget->*_frameEventCallFunc)(event->bone, event->frameEventName, event->originFrameIndex, event->currentFrameIndex);\n        }\n        \n        if (_frameEventListener)\n        {\n            _frameEventListener(event->bone, event->frameEventName, event->originFrameIndex, event->currentFrameIndex);\n        }\n        \n        \n        _ignoreFrameEvent = false;\n\n        CC_SAFE_DELETE(event);\n    }\n\n    while (_movementEventQueue.size() > 0)\n    {\n        MovementEvent *event = _movementEventQueue.front();\n        _movementEventQueue.pop();\n        \n        if(_movementEventTarget)\n        {\n            (_movementEventTarget->*_movementEventCallFunc)(event->armature, event->movementType, event->movementID);\n        }\n        \n        if (_movementEventListener)\n        {\n            _movementEventListener(event->armature, event->movementType, event->movementID);\n        }\n        \n        CC_SAFE_DELETE(event);\n    }\n}\n\nvoid ArmatureAnimation::updateHandler()\n{\n    if (_currentPercent >= 1)\n    {\n        switch(_loopType)\n        {\n        case ANIMATION_NO_LOOP:\n        {\n            _loopType = ANIMATION_MAX;\n            _currentFrame = (_currentPercent - 1) * _nextFrameIndex;\n            _currentPercent = _currentFrame / _durationTween;\n\n            if (_currentPercent >= 1.0f)\n            {\n            }\n            else\n            {\n                _nextFrameIndex = _durationTween;\n\n                movementEvent(_armature, START, _movementID.c_str());\n\n                break;\n            }\n        }\n        break;\n        case ANIMATION_MAX:\n        case SINGLE_FRAME:\n        {\n            _currentPercent = 1;\n            _isComplete = true;\n            _isPlaying = false;\n\n            movementEvent(_armature, COMPLETE, _movementID.c_str());\n\n            updateMovementList();\n        }\n        break;\n        case ANIMATION_TO_LOOP_FRONT:\n        {\n            _loopType = ANIMATION_LOOP_FRONT;\n            _currentPercent = fmodf(_currentPercent, 1);\n            _currentFrame = _nextFrameIndex == 0 ? 0 : fmodf(_currentFrame, _nextFrameIndex);\n            _nextFrameIndex = _durationTween > 0 ? _durationTween : 1;\n\n            movementEvent(_armature, START, _movementID.c_str());\n        }\n        break;\n        default:\n        {\n            //_currentPercent = fmodf(_currentPercent, 1);\n            _currentFrame = fmodf(_currentFrame, _nextFrameIndex);\n            _toIndex = 0;\n\n            movementEvent(_armature, LOOP_COMPLETE, _movementID.c_str());\n        }\n        break;\n        }\n    }\n}\n\nstd::string ArmatureAnimation::getCurrentMovementID() const\n{\n    if (_isComplete)\n    {\n        return \"\";\n    }\n    return _movementID;\n}\n\nvoid ArmatureAnimation::setMovementEventCallFunc(Object *target, SEL_MovementEventCallFunc callFunc)\n{\n    _movementEventTarget = target;\n    _movementEventCallFunc = callFunc;\n}\n\nvoid ArmatureAnimation::setFrameEventCallFunc(Object *target, SEL_FrameEventCallFunc callFunc)\n{\n    _frameEventTarget = target;\n    _frameEventCallFunc = callFunc;\n}\n\nvoid ArmatureAnimation::setMovementEventCallFunc(std::function<void(Armature *armature, MovementEventType movementType, const std::string& movementID)> listener)\n{\n    _movementEventListener = listener;\n}\nvoid ArmatureAnimation::setFrameEventCallFunc(std::function<void(Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex)> listener)\n{\n    _frameEventListener = listener;\n}\n\nvoid ArmatureAnimation::setUserObject(Object *pUserObject)\n{\n    CC_SAFE_RETAIN(pUserObject);\n    CC_SAFE_RELEASE(_userObject);\n    _userObject = pUserObject;\n}\n\nvoid ArmatureAnimation::frameEvent(Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex)\n{\n    if ((_frameEventTarget && _frameEventCallFunc) || _frameEventListener)\n    {\n        FrameEvent *frameEvent = new FrameEvent();\n        frameEvent->bone = bone;\n        frameEvent->frameEventName = frameEventName;\n        frameEvent->originFrameIndex = originFrameIndex;\n        frameEvent->currentFrameIndex = currentFrameIndex;\n\n        _frameEventQueue.push(frameEvent);\n    }\n}\n\n\nvoid ArmatureAnimation::movementEvent(Armature *armature, MovementEventType movementType, const std::string& movementID)\n{\n    if ((_movementEventTarget && _movementEventCallFunc) || _movementEventListener)\n    {\n        MovementEvent *movementEvent = new MovementEvent();\n        movementEvent->armature = armature;\n        movementEvent->movementType = movementType;\n        movementEvent->movementID = movementID;\n        _movementEventQueue.push(movementEvent);\n    }\n}\n\n\nvoid ArmatureAnimation::updateMovementList()\n{\n    if (_onMovementList)\n    {\n        if (_movementListLoop)\n        {\n            play(_movementList.at(_movementIndex).c_str(), _movementListDurationTo, 0);\n            _movementIndex++;\n\n            if (_movementIndex >= _movementList.size())\n             {\n                 _movementIndex = 0;\n            }\n        }\n        else\n        {\n            if (_movementIndex < _movementList.size())\n            {\n                play(_movementList.at(_movementIndex).c_str(), _movementListDurationTo, 0);\n                _movementIndex++;\n            }\n            else\n            {\n                _onMovementList = false;\n            }\n        }\n\n        _onMovementList = true;\n    }\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmatureAnimation.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#ifndef __CCANIMATION_H__\n#define __CCANIMATION_H__\n\n#include \"cocostudio/CCProcessBase.h\"\n#include \"cocostudio/CCTween.h\"\n#include <queue>\n\nnamespace cocostudio {\n\n\nenum MovementEventType\n{\n    START,\n    COMPLETE,\n    LOOP_COMPLETE\n};\n\n\nclass Armature;\nclass Bone;\n\ntypedef void (cocos2d::Object::*SEL_MovementEventCallFunc)(Armature *, MovementEventType, const std::string&);\ntypedef void (cocos2d::Object::*SEL_FrameEventCallFunc)(Bone *, const std::string&, int, int);\n\n#define movementEvent_selector(_SELECTOR) (cocostudio::SEL_MovementEventCallFunc)(&_SELECTOR)\n#define frameEvent_selector(_SELECTOR) (cocostudio::SEL_FrameEventCallFunc)(&_SELECTOR)\n\nstruct FrameEvent\n{\n    Bone *bone;\n    std::string frameEventName;\n    int originFrameIndex;\n    int currentFrameIndex;\n};\n\nstruct MovementEvent\n{\n    Armature *armature;\n    MovementEventType movementType;\n    std::string movementID;\n};\n\nclass  ArmatureAnimation : public ProcessBase\n{\npublic:\n    /**\n     * Create with a Armature\n     * @param armature The Armature ArmatureAnimation will bind to\n     */\n    static ArmatureAnimation *create(Armature *armature);\npublic:\n\t/**\n     * @js ctor\n     */\n    ArmatureAnimation();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ArmatureAnimation(void);\n\n    /**\n     * Init with a Armature\n     * @param armature The Armature ArmatureAnimation will bind to\n     */\n    virtual bool init(Armature *armature);\n\n    /**\n     * Scale animation play speed.\n     * This method is deprecated, please use setSpeedScale.\n     * @param animationScale Scale value\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void setAnimationScale(float animationScale);\n    CC_DEPRECATED_ATTRIBUTE virtual float getAnimationScale() const;\n\n    /**\n     * Scale animation play speed.\n     * @param animationScale Scale value\n     */\n    virtual void setSpeedScale(float speedScale);\n    virtual float getSpeedScale() const;\n\n    //! The animation update speed\n    CC_DEPRECATED_ATTRIBUTE virtual void setAnimationInternal(float animationInternal) {}\n\n    using ProcessBase::play;\n    /**\n     * Play animation by animation name.\n     *\n     * @param  animationName  The animation name you want to play\n     * @param  durationTo The frames between two animation changing-over.\n     *         It's meaning is changing to this animation need how many frames\n     *\n     *         -1 : use the value from MovementData get from flash design panel\n     * @param  loop   Whether the animation is loop\n     *\n     *         loop < 0 : use the value from MovementData get from flash design panel\n     *         loop = 0 : this animation is not loop\n     *         loop > 0 : this animation is loop\n     */\n    virtual void play(const std::string& animationName, int durationTo = -1,  int loop = -1);\n\n    /**\n     * Play animation by index, the other param is the same to play.\n     * @deprecated, please use playWithIndex\n     * @param  animationIndex  the animation index you want to play\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void playByIndex(int animationIndex,  int durationTo = -1, int loop = -1);\n    virtual void playWithIndex(int animationIndex,  int durationTo = -1, int loop = -1);\n\n    virtual void playWithNames(const std::vector<std::string>& movementNames, int durationTo = -1, bool loop = true);\n    virtual void playWithIndexes(const std::vector<int>& movementIndexes, int durationTo = -1, bool loop = true);\n\n    /**\n     * Go to specified frame and play current movement.\n     * You need first switch to the movement you want to play, then call this function.\n     * \n     * example : playByIndex(0);\n     *           gotoAndPlay(0);\n     *           playByIndex(1);\n     *           gotoAndPlay(0);\n     *           gotoAndPlay(15);\n     */\n    virtual void gotoAndPlay(int frameIndex);\n\n    /**\n     * Go to specified frame and pause current movement.\n     */\n    virtual void gotoAndPause(int frameIndex);\n\n    /**\n     * Pause the Process\n     */\n    virtual void pause();\n    /**\n     * Resume the Process\n     */\n    virtual void resume();\n    /**\n     * Stop the Process\n     */\n    virtual void stop();\n\n\n    /**\n     * Get movement count\n     */\n    ssize_t getMovementCount() const;\n\n    void update(float dt);\n\n    /**\n     * Get current movementID\n     * @return The name of current movement\n     */\n    std::string getCurrentMovementID() const;\n\n    /**\n     * Set armature's movement event callback function\n     * To disconnect this event, just setMovementEventCallFunc(nullptr, nullptr);\n     */\n    CC_DEPRECATED_ATTRIBUTE void setMovementEventCallFunc(cocos2d::Object *target, SEL_MovementEventCallFunc callFunc);\n\n    /**\n     * Set armature's frame event callback function\n     * To disconnect this event, just setFrameEventCallFunc(nullptr, nullptr);\n     */\n    CC_DEPRECATED_ATTRIBUTE void setFrameEventCallFunc(cocos2d::Object *target, SEL_FrameEventCallFunc callFunc);\n    \n    void setMovementEventCallFunc(std::function<void(Armature *armature, MovementEventType movementType, const std::string& movementID)> listener);\n    void setFrameEventCallFunc(std::function<void(Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex)> listener);\n\n    virtual void setAnimationData(AnimationData *data) \n    {\n        if (_animationData != data)\n        {\n            CC_SAFE_RETAIN(data);\n            CC_SAFE_RELEASE(_animationData);\n            _animationData = data; \n        }\n    }\n    virtual AnimationData *getAnimationData() const { return _animationData; }\n\n\n    /** \n     * Returns a user assigned Object\n     * \n     * Similar to userData, but instead of holding a void* it holds an object\n     *\n     * @return A user assigned Object\n     * @js NA\n     * @lua NA\n     */\n    virtual Object* getUserObject() { return _userObject; }\n    /** \n    * @js NA\n    * @lua NA\n    */\n    virtual const Object* getUserObject() const { return _userObject; }\n\n    /**\n     * Returns a user assigned Object\n     *\n     * Similar to UserData, but instead of holding a void* it holds an object.\n     * The UserObject will be retained once in this method,\n     * and the previous UserObject (if existed) will be relese.\n     * The UserObject will be released in Node's destructure.\n     *\n     * @param userObject    A user assigned Object\n     */\n    virtual void setUserObject(Object *userObject);\nprotected:\n\n    /**\n     * Update(float dt) will call this handler, you can handle your logic here\n     * @js NA\n     * @lua NA\n     */\n    void updateHandler();\n\n    /**\n     * Update current key frame, and process auto stop, pause\n     * @js NA\n     * @lua NA\n     */\n    void updateFrameData(float currentPercent);\n\n    /**\n     * Emit a frame event\n     * @js NA\n     * @lua NA\n     */\n    void frameEvent(Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex);\n\n    /**\n     * Emit a movement event\n     */\n    void movementEvent(Armature *armature, MovementEventType movementType, const std::string& movementID);\n\n    void updateMovementList();\n\n    bool isIgnoreFrameEvent() const { return _ignoreFrameEvent; }\n\n    friend class Tween;\nprotected:\n    //! AnimationData save all MovementDatas this animation used.\n    AnimationData *_animationData;\n\n    //! Scale the animation speed\n    float _speedScale;\n\n    MovementData *_movementData;\t\t\t\t//! MovementData save all MovementFrameDatas this animation used.\n\n    Armature *_armature;\t\t\t\t\t\t//! A weak reference of armature\n\n    std::string _movementID;\t\t\t\t//! Current movment's name\n\n    int _toIndex;\t\t\t\t\t\t\t\t//! The frame index in MovementData->m_pMovFrameDataArr, it's different from m_iFrameIndex.\n\n    cocos2d::Vector<Tween*> _tweenList;\n\n    bool _ignoreFrameEvent;\n    \n    std::queue<FrameEvent*> _frameEventQueue;\n    std::queue<MovementEvent*> _movementEventQueue;\n\n    std::vector<std::string> _movementList;\n    \n    bool _onMovementList;\n    bool _movementListLoop;\n    unsigned int _movementIndex;\n    int _movementListDurationTo;\n\n    cocos2d::Object *_userObject;\nprotected:\n    /**\n     * MovementEvent CallFunc.\n     * @param Armature* a Armature\n     * @param MovementEventType, Event Type, like START, COMPLETE.\n     * @param const char*, Movement ID, also called Movement Name\n     */\n    SEL_MovementEventCallFunc _movementEventCallFunc;\n\n    /**\n     * FrameEvent CallFunc.\n     * @param Bone*, a Bone\n     * @param const char*, the name of this frame event\n     * @param int, origin frame index\n     * @param int, current frame index, animation may be delayed\n     */\n    SEL_FrameEventCallFunc _frameEventCallFunc;\n\n\n    cocos2d::Object *_movementEventTarget;\n    cocos2d::Object *_frameEventTarget;\n    \n    \n    std::function<void(Armature *armature, MovementEventType movementType, const std::string& movementID)> _movementEventListener;\n    std::function<void(Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex)> _frameEventListener;\n};\n\n}\n\n#endif /*__CCANIMATION_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmatureDataManager.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCSpriteFrameCache.h\"\n\n#include \"cocostudio/CCArmatureDataManager.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n#include \"cocostudio/CCDataReaderHelper.h\"\n#include \"cocostudio/CCSpriteFrameCacheHelper.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nstatic ArmatureDataManager *s_sharedArmatureDataManager = nullptr;\n\nArmatureDataManager *ArmatureDataManager::getInstance()\n{\n    if (s_sharedArmatureDataManager == nullptr)\n    {\n        s_sharedArmatureDataManager = new ArmatureDataManager();\n        if (!s_sharedArmatureDataManager || !s_sharedArmatureDataManager->init())\n        {\n            CC_SAFE_DELETE(s_sharedArmatureDataManager);\n        }\n    }\n    return s_sharedArmatureDataManager;\n}\n\nvoid ArmatureDataManager::destroyInstance()\n{\n    SpriteFrameCacheHelper::purge();\n    DataReaderHelper::purge();\n    CC_SAFE_RELEASE_NULL(s_sharedArmatureDataManager);\n}\n\nArmatureDataManager::ArmatureDataManager(void)\n{\n    _armarureDatas.clear();\n    _animationDatas.clear();\n    _textureDatas.clear();\n    _autoLoadSpriteFile = false;\n}\n\n\nArmatureDataManager::~ArmatureDataManager(void)\n{\n    _animationDatas.clear();\n    _armarureDatas.clear();\n    _textureDatas.clear();\n\n    _relativeDatas.clear();\n}\n\n\nbool ArmatureDataManager::init()\n{\n    bool bRet = false;\n    do\n    {\n        _armarureDatas.clear();\n        _animationDatas.clear();\n        _textureDatas.clear();\n\n        bRet = true;\n    }\n    while (0);\n\n    return bRet;\n}\n\nvoid ArmatureDataManager::removeArmatureFileInfo(const std::string& configFilePath)\n{\n    if (RelativeData *data = getRelativeData(configFilePath))\n    {\n        for (std::string str : data->armatures)\n        {\n            removeArmatureData(str.c_str());\n        }\n\n        for (std::string str : data->animations)\n        {\n            removeAnimationData(str.c_str());\n        }\n\n        for (std::string str : data->textures)\n        {\n            removeTextureData(str.c_str());\n        }\n\n        for (std::string str : data->plistFiles)\n        {\n            SpriteFrameCache::getInstance()->removeSpriteFramesFromFile(str.c_str());\n        }\n\n        _relativeDatas.erase(configFilePath);\n        DataReaderHelper::getInstance()->removeConfigFile(configFilePath);\n    }\n}\n\n\nvoid ArmatureDataManager::addArmatureData(const std::string& id, ArmatureData *armatureData, const std::string& configFilePath)\n{\n    if (RelativeData *data = getRelativeData(configFilePath))\n    {\n        data->armatures.push_back(id);\n    }\n\n    _armarureDatas.insert(id, armatureData);\n}\n\nArmatureData *ArmatureDataManager::getArmatureData(const std::string& id)\n{\n    ArmatureData *armatureData = nullptr;\n    armatureData = (ArmatureData *)_armarureDatas.at(id);\n    return armatureData;\n}\n\nvoid ArmatureDataManager::removeArmatureData(const std::string& id)\n{\n    _armarureDatas.erase(id);\n}\n\nvoid ArmatureDataManager::addAnimationData(const std::string& id, AnimationData *animationData, const std::string& configFilePath)\n{\n    if (RelativeData *data = getRelativeData(configFilePath))\n    {\n        data->animations.push_back(id);\n    }\n\n    _animationDatas.insert(id, animationData);\n}\n\nAnimationData *ArmatureDataManager::getAnimationData(const std::string& id)\n{\n    AnimationData *animationData = nullptr;\n    animationData = (AnimationData *)_animationDatas.at(id);\n    return animationData;\n}\n\nvoid ArmatureDataManager::removeAnimationData(const std::string& id)\n{\n    _animationDatas.erase(id);\n}\n\nvoid ArmatureDataManager::addTextureData(const std::string& id, TextureData *textureData, const std::string& configFilePath)\n{\n    if (RelativeData *data = getRelativeData(configFilePath))\n    {\n        data->textures.push_back(id);\n    }\n\n    _textureDatas.insert(id, textureData);\n}\n\n\nTextureData *ArmatureDataManager::getTextureData(const std::string& id)\n{\n    TextureData *textureData = nullptr;\n    textureData = (TextureData *)_textureDatas.at(id);\n    return textureData;\n}\n\n\nvoid ArmatureDataManager::removeTextureData(const std::string& id)\n{\n    _textureDatas.erase(id);\n}\n\nvoid ArmatureDataManager::addArmatureFileInfo(const std::string& configFilePath)\n{\n    addRelativeData(configFilePath);\n\n    _autoLoadSpriteFile = true;\n    DataReaderHelper::getInstance()->addDataFromFile(configFilePath);\n}\n\nvoid ArmatureDataManager::addArmatureFileInfoAsync(const std::string& configFilePath, Object *target, SEL_SCHEDULE selector)\n{\n    addRelativeData(configFilePath);\n\n    _autoLoadSpriteFile = true;\n    DataReaderHelper::getInstance()->addDataFromFileAsync(\"\", \"\", configFilePath, target, selector);\n}\n\nvoid ArmatureDataManager::addArmatureFileInfo(const std::string& imagePath, const std::string& plistPath, const std::string& configFilePath)\n{\n    addRelativeData(configFilePath);\n\n    _autoLoadSpriteFile = false;\n    DataReaderHelper::getInstance()->addDataFromFile(configFilePath);\n    addSpriteFrameFromFile(plistPath, imagePath);\n}\n\nvoid ArmatureDataManager::addArmatureFileInfoAsync(const std::string& imagePath, const std::string& plistPath, const std::string& configFilePath, Object *target, SEL_SCHEDULE selector)\n{\n    addRelativeData(configFilePath);\n\n    _autoLoadSpriteFile = false;\n    DataReaderHelper::getInstance()->addDataFromFileAsync(imagePath, plistPath, configFilePath, target, selector);\n    addSpriteFrameFromFile(plistPath, imagePath);\n}\n\nvoid ArmatureDataManager::addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath, const std::string& configFilePath)\n{\n    if (RelativeData *data = getRelativeData(configFilePath))\n    {\n        data->plistFiles.push_back(plistPath);\n    }\n    SpriteFrameCacheHelper::getInstance()->addSpriteFrameFromFile(plistPath, imagePath);\n}\n\n\nbool ArmatureDataManager::isAutoLoadSpriteFile()\n{\n    return _autoLoadSpriteFile;\n}\n\nconst cocos2d::Map<std::string, ArmatureData*>& ArmatureDataManager::getArmatureDatas() const\n{\n    return _armarureDatas;\n}\nconst cocos2d::Map<std::string, AnimationData*>& ArmatureDataManager::getAnimationDatas() const\n{\n    return _animationDatas;\n}\nconst cocos2d::Map<std::string, TextureData*>& ArmatureDataManager::getTextureDatas() const\n{\n    return _textureDatas;\n}\n\nvoid CCArmatureDataManager::addRelativeData(const std::string& configFilePath)\n{\n    if (_relativeDatas.find(configFilePath) == _relativeDatas.end())\n    {\n        _relativeDatas[configFilePath] = RelativeData();\n    }\n}\n\nRelativeData *CCArmatureDataManager::getRelativeData(const std::string&  configFilePath)\n{\n    return &_relativeDatas[configFilePath];\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmatureDataManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCARMATUREDATAMANAGER_H__\n#define __CCARMATUREDATAMANAGER_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n\n\nnamespace cocostudio {\n\nstruct RelativeData\n{\n    std::vector<std::string> plistFiles;\n    std::vector<std::string> armatures;\n    std::vector<std::string> animations;\n    std::vector<std::string> textures;\n};\n\n/**\n *\t@brief\tformat and manage armature configuration and armature animation\n */\nclass  ArmatureDataManager : public cocos2d::Object\n{\npublic:\n\t/** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static ArmatureDataManager *sharedArmatureDataManager() { return ArmatureDataManager::getInstance(); }\n\n    /** @deprecated Use destoryInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destroyInstance(); };\n    \n    static ArmatureDataManager *getInstance();\n    static void destroyInstance();\n    \nprivate:\n\t/**\n     * @js ctor\n     */\n    ArmatureDataManager(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ArmatureDataManager(void);\n\npublic:\n\n    /**\n     * Init ArmatureDataManager\n     */\n    virtual bool init();\n\n    /**\n     * Add armature data\n     * @param id The id of the armature data\n     * @param armatureData ArmatureData *\n     */\n    void addArmatureData(const std::string& id, ArmatureData *armatureData, const std::string& configFilePath = \"\");\n\n    /**\n     *\t@brief\tget armature data\n     *\t@param\tid the id of the armature data you want to get\n     *  @return\tArmatureData *\n     */\n    ArmatureData *getArmatureData(const std::string& id);\n\n    /**\n     *\t@brief\tremove armature data\n     *\t@param\tid the id of the armature data you want to get\n     */\n    void removeArmatureData(const std::string& id);\n\n    /**\n     *\t@brief\tadd animation data\n     *\t@param \tid the id of the animation data\n     *  @return AnimationData *\n     */\n    void addAnimationData(const std::string& id, AnimationData *animationData, const std::string& configFilePath = \"\");\n\n    /**\n     *\t@brief\tget animation data from _animationDatas(Dictionary)\n     *\t@param \tid the id of the animation data you want to get\n     *  @return AnimationData *\n     */\n    AnimationData *getAnimationData(const std::string& id);\n\n    /**\n     *\t@brief\tremove animation data\n     *\t@param \tid the id of the animation data\n     */\n    void removeAnimationData(const std::string& id);\n\n    /**\n     *\t@brief\tadd texture data\n     *\t@param \tid the id of the texture data\n     *  @return TextureData *\n     */\n    void addTextureData(const std::string& id, TextureData *textureData, const std::string& configFilePath = \"\");\n\n    /**\n     *\t@brief\tget texture data\n     *\t@param \tid the id of the texture data you want to get\n     *  @return TextureData *\n     */\n    TextureData *getTextureData(const std::string& id);\n\n    /**\n     *\t@brief\tremove texture data\n     *\t@param \tid the id of the texture data you want to get\n     */\n    void removeTextureData(const std::string& id);\n\n    /**\n     *\t@brief\tAdd ArmatureFileInfo, it is managed by ArmatureDataManager.\n     */\n    void addArmatureFileInfo(const std::string& configFilePath);\n\n    /**\n     *\t@brief\tAdd ArmatureFileInfo, it is managed by ArmatureDataManager.\n     *\t\t\tIt will load data in a new thread\n     */\n    void addArmatureFileInfoAsync(const std::string& configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector);\n\n    /**\n     *\t@brief\tAdd ArmatureFileInfo, it is managed by ArmatureDataManager.\n     */\n    void addArmatureFileInfo(const std::string& imagePath, const std::string& plistPath, const std::string& configFilePath);\n\n    /**\n     *\t@brief\tAdd ArmatureFileInfo, it is managed by ArmatureDataManager.\n     *\t\t\tIt will load data in a new thread\n     */\n    void addArmatureFileInfoAsync(const std::string& imagePath, const std::string& plistPath, const std::string& configFilePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector);\n\n    /**\n     *\t@brief\tAdd sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name\n     */\n    void addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath, const std::string& configFilePath = \"\");\n\n    virtual void removeArmatureFileInfo(const std::string& configFilePath);\n\n\n    /**\n     *\t@brief\tJuge whether or not need auto load sprite file\n     */\n    bool isAutoLoadSpriteFile();\n\n\n    const cocos2d::Map<std::string, ArmatureData*>&     getArmatureDatas() const;\n    const cocos2d::Map<std::string, AnimationData*>&    getAnimationDatas() const;\n    const cocos2d::Map<std::string, TextureData*>&      getTextureDatas() const;\n\nprotected:\n    void addRelativeData(const std::string& configFilePath);\n    RelativeData *getRelativeData(const std::string& configFilePath);\nprivate:\n    /**\n     *\t@brief\tsave amature datas\n     *  @key\tstd::string\n     *  @value\tArmatureData *\n     */\n    cocos2d::Map<std::string, ArmatureData*> _armarureDatas;\n\n    /**\n     *\t@brief\tsave animation datas\n     *  @key\tstd::string\n     *  @value\tAnimationData *\n     */\n    cocos2d::Map<std::string, AnimationData*> _animationDatas;\n\n    /**\n     *\t@brief\tsave texture datas\n     *  @key\tstd::string\n     *  @value\tTextureData *\n     */\n    cocos2d::Map<std::string, TextureData*> _textureDatas;\n\n    bool _autoLoadSpriteFile;\n\n    std::unordered_map<std::string, RelativeData> _relativeDatas;\n};\n\n\n}\n\n#endif/*__CCARMATUREDATAMANAGER_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmatureDefine.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCArmatureDefine.h\"\n\nnamespace cocostudio {\n\nconst char *armatureVersion()\n{\n    return \"1.1.0.0\";\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCArmatureDefine.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCARMATUREDEFINE_H__\n#define __CCARMATUREDEFINE_H__\n\n\n#define VERSION_COMBINED 0.30f\n#define VERSION_CHANGE_ROTATION_RANGE 1.0f\n#define VERSION_COLOR_READING 1.1f\n\n#ifndef AUTO_ADD_SPRITE_FRAME_NAME_PREFIX\n#define AUTO_ADD_SPRITE_FRAME_NAME_PREFIX 0\n#endif // !AUTO_ADD_SPRITE_FRAME_NAME_PREFIX\n\n\n#ifndef ENABLE_PHYSICS_BOX2D_DETECT\n#define ENABLE_PHYSICS_BOX2D_DETECT 0\n#endif\n\n#ifndef ENABLE_PHYSICS_CHIPMUNK_DETECT\n#define ENABLE_PHYSICS_CHIPMUNK_DETECT 0\n#endif\n\n#ifndef ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX \n#define ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX 1\n#endif\n\n#define CS_RETURN_IF(cond) if (cond) return\n#define CS_RETURN_NULL_IF(cond) if (cond) return nullptr;\n\nnamespace cocostudio {\n\nconst char *armatureVersion();\n\n}\n\n#endif /*__CCARMATUREDEFINE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCBatchNode.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCBatchNode.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCSkin.h\"\n\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"CCShaderCache.h\"\n#include \"CCDirector.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nBatchNode *BatchNode::create()\n{\n    BatchNode *batchNode = new BatchNode();\n    if (batchNode && batchNode->init())\n    {\n        batchNode->autorelease();\n        return batchNode;\n    }\n    CC_SAFE_DELETE(batchNode);\n    return nullptr;\n}\n\nBatchNode::BatchNode()\n: _groupCommand(nullptr)\n{\n}\n\nBatchNode::~BatchNode()\n{\n    CC_SAFE_DELETE(_groupCommand);\n}\n\nbool BatchNode::init()\n{\n    bool ret = Node::init();\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n\n    return ret;\n}\n\nvoid BatchNode::addChild(Node *pChild)\n{\n    Node::addChild(pChild);\n}\n\nvoid BatchNode::addChild(Node *child, int zOrder)\n{\n    Node::addChild(child, zOrder);\n}\n\nvoid BatchNode::addChild(Node *child, int zOrder, int tag)\n{\n    Node::addChild(child, zOrder, tag);\n    Armature *armature = dynamic_cast<Armature *>(child);\n    if (armature != nullptr)\n    {\n        armature->setBatchNode(this);\n        if (_groupCommand == nullptr)\n        {\n            _groupCommand = new GroupCommand();\n        }\n    }\n}\n\nvoid BatchNode::removeChild(Node* child, bool cleanup)\n{\n    Armature *armature = dynamic_cast<Armature *>(child);\n    if (armature != nullptr)\n    {\n        armature->setBatchNode(nullptr);\n    }\n\n    Node::removeChild(child, cleanup);\n}\n\nvoid BatchNode::visit()\n{\n    // quick return if not visible. children won't be drawn.\n    if (!_visible)\n    {\n        return;\n    }\n    kmGLPushMatrix();\n\n    transform();\n    sortAllChildren();\n    draw();\n\n    // reset for next frame\n    _orderOfArrival = 0;\n\n    kmGLPopMatrix();\n}\n\nvoid BatchNode::draw()\n{\n    if (_children.empty())\n    {\n        return;\n    }\n\n    CC_NODE_DRAW_SETUP();\n\n    bool pushed = false;\n    for(auto object : _children)\n    {\n        Armature *armature = dynamic_cast<Armature *>(object);\n        if (armature)\n        {\n            if (!pushed)\n            {\n                generateGroupCommand();\n                pushed = true;\n            }\n        \n            armature->visit();\n        }\n        else\n        {\n            Director::getInstance()->getRenderer()->popGroup();\n            pushed = false;\n            \n            ((Node *)object)->visit();\n        }\n    }\n}\n\nvoid BatchNode::generateGroupCommand()\n{\n    Renderer* renderer = Director::getInstance()->getRenderer();\n    _groupCommand->init(_globalZOrder);\n    renderer->addCommand(_groupCommand);\n\n    renderer->pushGroup(_groupCommand->getRenderQueueID());\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCBatchNode.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCBATCHNODE_H__\n#define __CCBATCHNODE_H__\n\n#include \"CCNode.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n\nnamespace cocos2d {\n    class GroupCommand;\n}\n\nnamespace cocostudio {\n\nclass BatchNode : public cocos2d::Node\n{\npublic:\n    static BatchNode *create();\npublic:\n\t/**\n     * @js ctor\n     */\n    BatchNode();\n    /**\n     * @ js NA\n     * @ lua NA\n     */\n    ~BatchNode();\n    /**\n     *  @js NA\n     */\n    virtual bool init() override;\n    virtual void addChild(cocos2d::Node *pChild) override;\n    virtual void addChild(cocos2d::Node *pChild, int zOrder) override;\n    virtual void addChild(cocos2d::Node *pChild, int zOrder, int tag) override;\n    virtual void removeChild(cocos2d::Node* child, bool cleanup) override;\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual void visit() override;\n    /**\n     *  @js NA\n     */\n    void draw() override;\n    \nprotected:\n    void generateGroupCommand();\n\n    cocos2d::GroupCommand* _groupCommand;\n};\n\n}\n\n#endif /*__CCBATCHNODE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCBone.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCUtilMath.h\"\n#include \"cocostudio/CCArmatureDataManager.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n#include \"cocostudio/CCDisplayManager.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nBone *Bone::create()\n{\n\n    Bone *pBone = new Bone();\n    if (pBone && pBone->init())\n    {\n        pBone->autorelease();\n        return pBone;\n    }\n    CC_SAFE_DELETE(pBone);\n    return nullptr;\n\n}\n\nBone *Bone::create(const std::string& name)\n{\n\n    Bone *pBone = new Bone();\n    if (pBone && pBone->init(name))\n    {\n        pBone->autorelease();\n        return pBone;\n    }\n    CC_SAFE_DELETE(pBone);\n    return nullptr;\n}\n\nBone::Bone()\n{\n    _tweenData = nullptr;\n    _parentBone = nullptr;\n    _armature = nullptr;\n    _childArmature = nullptr;\n    _boneData = nullptr;\n    _tween = nullptr;\n    _tween = nullptr;\n    _displayManager = nullptr;\n    _ignoreMovementBoneData = false;\n//    _worldTransform = AffineTransformMake(1, 0, 0, 1, 0, 0);\n    kmMat4Identity(&_worldTransform);\n    _boneTransformDirty = true;\n    _blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n    _blendDirty = false;\n    _worldInfo = nullptr;\n\n    _armatureParentBone = nullptr;\n    _dataVersion = 0;\n}\n\n\nBone::~Bone(void)\n{\n    CC_SAFE_DELETE(_tweenData);\n    CC_SAFE_DELETE(_tween);\n    CC_SAFE_DELETE(_displayManager);\n    CC_SAFE_DELETE(_worldInfo);\n\n    CC_SAFE_RELEASE_NULL(_boneData);\n\n    CC_SAFE_RELEASE(_childArmature);\n}\n\nbool Bone::init()\n{\n    return Bone::init(nullptr);\n}\n\n\nbool Bone::init(const std::string& name)\n{\n    bool bRet = false;\n    do\n    {\n\n        _name = name;\n\n        CC_SAFE_DELETE(_tweenData);\n        _tweenData = new FrameData();\n\n        CC_SAFE_DELETE(_tween);\n        _tween = new Tween();\n        _tween->init(this);\n\n        CC_SAFE_DELETE(_displayManager);\n        _displayManager = new DisplayManager();\n        _displayManager->init(this);\n\n        CC_SAFE_DELETE(_worldInfo);\n        _worldInfo = new BaseData();\n\n        CC_SAFE_DELETE(_boneData);\n        _boneData  = new BoneData();\n\n        bRet = true;\n    }\n    while (0);\n\n    return bRet;\n}\n\nvoid Bone::setBoneData(BoneData *boneData)\n{\n    CCASSERT(nullptr != boneData, \"_boneData must not be nullptr\");\n\n    if (_boneData != boneData)\n    {\n        CC_SAFE_RETAIN(boneData);\n        CC_SAFE_RELEASE(_boneData);\n        _boneData = boneData;\n    }\n\n    _name = _boneData->name;\n    _localZOrder = _boneData->zOrder;\n\n    _displayManager->initDisplayList(boneData);\n}\n\nBoneData *Bone::getBoneData() const\n{\n    return _boneData;\n}\n\nvoid Bone::setArmature(Armature *armature)\n{\n    _armature = armature;\n    if (_armature)\n    {\n        _tween->setAnimation(_armature->getAnimation());\n        _dataVersion = _armature->getArmatureData()->dataVersion;\n        _armatureParentBone = _armature->getParentBone();\n    }\n    else\n    {\n        _armatureParentBone = nullptr;\n    }\n}\n\n\nArmature *Bone::getArmature() const\n{\n    return _armature;\n}\n\nvoid Bone::update(float delta)\n{\n    if (_parentBone)\n        _boneTransformDirty = _boneTransformDirty || _parentBone->isTransformDirty();\n\n    if (_armatureParentBone && !_boneTransformDirty)\n    {\n        _boneTransformDirty = _armatureParentBone->isTransformDirty();\n    }\n\n    if (_boneTransformDirty)\n    {\n        if (_dataVersion >= VERSION_COMBINED)\n        {\n            TransformHelp::nodeConcat(*_tweenData, *_boneData);\n            _tweenData->scaleX -= 1;\n            _tweenData->scaleY -= 1;\n        }\n\n        _worldInfo->copy(_tweenData);\n\n        _worldInfo->x = _tweenData->x + _position.x;\n        _worldInfo->y = _tweenData->y + _position.y;\n        _worldInfo->scaleX = _tweenData->scaleX * _scaleX;\n        _worldInfo->scaleY = _tweenData->scaleY * _scaleY;\n        _worldInfo->skewX = _tweenData->skewX + _skewX + _rotationX;\n        _worldInfo->skewY = _tweenData->skewY + _skewY - _rotationY;\n\n        if(_parentBone)\n        {\n            applyParentTransform(_parentBone);\n        }\n        else\n        {\n            if (_armatureParentBone)\n            {\n                applyParentTransform(_armatureParentBone);\n            }\n        }\n\n        TransformHelp::nodeToMatrix(*_worldInfo, _worldTransform);\n\n        if (_armatureParentBone)\n        {\n            _worldTransform = TransformConcat(_worldTransform, _armature->getNodeToParentTransform());\n        }\n    }\n\n    DisplayFactory::updateDisplay(this, delta, _boneTransformDirty || _armature->getArmatureTransformDirty());\n\n    for(const auto &obj: _children) {\n        Bone *childBone = static_cast<Bone*>(obj);\n        childBone->update(delta);\n    }\n\n    _boneTransformDirty = false;\n}\n\nvoid Bone::applyParentTransform(Bone *parent) \n{\n    float x = _worldInfo->x;\n    float y = _worldInfo->y;\n    _worldInfo->x = x * parent->_worldTransform.mat[0] + y * parent->_worldTransform.mat[4] + parent->_worldInfo->x;\n    _worldInfo->y = x * parent->_worldTransform.mat[1] + y * parent->_worldTransform.mat[5] + parent->_worldInfo->y;\n    _worldInfo->scaleX = _worldInfo->scaleX * parent->_worldInfo->scaleX;\n    _worldInfo->scaleY = _worldInfo->scaleY * parent->_worldInfo->scaleY;\n    _worldInfo->skewX = _worldInfo->skewX + parent->_worldInfo->skewX;\n    _worldInfo->skewY = _worldInfo->skewY + parent->_worldInfo->skewY;\n}\n\n\nvoid CCBone::setBlendFunc(const BlendFunc& blendFunc)\n{\n    if (_blendFunc.src != blendFunc.src && _blendFunc.dst != blendFunc.dst)\n    {\n        _blendFunc = blendFunc;\n        _blendDirty = true;\n    }\n}\n\nvoid Bone::updateDisplayedColor(const Color3B &parentColor)\n{\n    _realColor = Color3B(255, 255, 255);\n    Node::updateDisplayedColor(parentColor);\n}\n\nvoid Bone::updateDisplayedOpacity(GLubyte parentOpacity)\n{\n    _realOpacity = 255;\n    Node::updateDisplayedOpacity(parentOpacity);\n}\n\nvoid Bone::updateColor()\n{\n    Node *display = _displayManager->getDisplayRenderNode();\n    if(display != nullptr)\n    {\n        display->setColor(Color3B(_displayedColor.r * _tweenData->r / 255, _displayedColor.g * _tweenData->g / 255, _displayedColor.b * _tweenData->b / 255));\n        display->setOpacity(_displayedOpacity * _tweenData->a / 255);\n    }\n}\n\nvoid Bone::updateZOrder()\n{\n    if (_dataVersion >= VERSION_COMBINED)\n    {\n        int zorder = _tweenData->zOrder + _boneData->zOrder;\n        setLocalZOrder(zorder);\n    }\n    else\n    {\n        setLocalZOrder(_tweenData->zOrder);\n    }\n}\n\nvoid Bone::addChildBone(Bone *child)\n{\n    CCASSERT( nullptr != child, \"Argument must be non-nil\");\n    CCASSERT( nullptr == child->_parentBone, \"child already added. It can't be added again\");\n\n    if(_children.empty())\n    {\n        _children.reserve(4);\n    }\n\n    if (_children.getIndex(child) == CC_INVALID_INDEX)\n    {\n        _children.pushBack(child);\n        child->setParentBone(this);\n    }\n}\n\nvoid Bone::removeChildBone(Bone *bone, bool recursion)\n{\n    if (!_children.empty() && _children.getIndex(bone) != CC_INVALID_INDEX )\n    {\n        if(recursion)\n        {\n            auto ccbones = bone->_children;\n            \n            for(auto& object : ccbones)\n            {\n                Bone *ccBone = static_cast<Bone*>(object);\n                bone->removeChildBone(ccBone, recursion);\n            }\n        }\n\n        bone->setParentBone(nullptr);\n\n        bone->getDisplayManager()->setCurrentDecorativeDisplay(nullptr);\n\n        _children.eraseObject(bone);\n    }\n}\n\nvoid Bone::removeFromParent(bool recursion)\n{\n    if (nullptr != _parentBone)\n    {\n        _parentBone->removeChildBone(this, recursion);\n    }\n}\n\nvoid Bone::setParentBone(Bone *parent)\n{\n    _parentBone = parent;\n}\n\nBone *Bone::getParentBone()\n{\n    return _parentBone;\n}\n\nvoid Bone::setChildArmature(Armature *armature)\n{\n    if (_childArmature != armature)\n    {\n        if (armature == nullptr && _childArmature)\n        {\n            _childArmature->setParentBone(nullptr);\n        }\n\n        CC_SAFE_RETAIN(armature);\n        CC_SAFE_RELEASE(_childArmature);\n        _childArmature = armature;\n    }\n}\n\nArmature *Bone::getChildArmature() const\n{\n    return _childArmature;\n}\n\nTween *Bone::getTween()\n{\n    return _tween;\n}\n\nvoid Bone::setLocalZOrder(int zOrder)\n{\n    if (_localZOrder != zOrder)\n        Node::setLocalZOrder(zOrder);\n}\n\nkmMat4 Bone::getNodeToArmatureTransform() const\n{\n    return _worldTransform;\n}\n\nkmMat4 Bone::getNodeToWorldTransform() const\n{\n    return TransformConcat(_worldTransform, _armature->getNodeToWorldTransform());\n}\n\nNode *Bone::getDisplayRenderNode()\n{\n    return _displayManager->getDisplayRenderNode();\n}\n\nDisplayType Bone::getDisplayRenderNodeType()\n{\n    return _displayManager->getDisplayRenderNodeType();\n}\n\n\nvoid Bone::addDisplay(DisplayData *displayData, int index)\n{\n    _displayManager->addDisplay(displayData, index);\n}\n\nvoid Bone::addDisplay(Node *display, int index)\n{\n    _displayManager->addDisplay(display, index);\n}\n\nvoid Bone::removeDisplay(int index)\n{\n    _displayManager->removeDisplay(index);\n}\n\nvoid Bone::changeDisplayByIndex(int index, bool force)\n{\n    changeDisplayWithIndex(index, force);\n}\n\nvoid Bone::changeDisplayByName(const std::string &name, bool force)\n{\n    changeDisplayWithName(name, force);\n}\n\nvoid Bone::changeDisplayWithIndex(int index, bool force)\n{\n    _displayManager->changeDisplayWithIndex(index, force);\n}\n\nvoid Bone::changeDisplayWithName(const std::string& name, bool force)\n{\n    _displayManager->changeDisplayWithName(name, force);\n}\n\nColliderDetector* Bone::getColliderDetector() const\n{\n    if (DecorativeDisplay *decoDisplay = _displayManager->getCurrentDecorativeDisplay())\n    {\n        if (ColliderDetector *detector = decoDisplay->getColliderDetector())\n        {\n            return detector;\n        }\n    }\n    return nullptr;\n}\n\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\nvoid Bone::setColliderFilter(ColliderFilter *filter)\n{\n    auto array = _displayManager->getDecorativeDisplayList();\n\n    for(auto& object : array)\n    {\n        DecorativeDisplay *decoDisplay = static_cast<DecorativeDisplay *>(object);\n        if (ColliderDetector *detector = decoDisplay->getColliderDetector())\n        {\n            detector->setColliderFilter(filter);\n        }\n    }\n}\nColliderFilter *Bone::getColliderFilter()\n{\n    if (DecorativeDisplay *decoDisplay = _displayManager->getCurrentDecorativeDisplay())\n    {\n        if (ColliderDetector *detector = decoDisplay->getColliderDetector())\n        {\n            return detector->getColliderFilter();\n        }\n    }\n    return nullptr;\n}\n#endif\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCBone.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCBONE_H__\n#define __CCBONE_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n#include \"cocostudio/CCTween.h\"\n#include \"cocostudio/CCDecorativeDisplay.h\"\n#include \"cocostudio/CCDisplayManager.h\"\n\nnamespace cocostudio {\n\n\nclass Armature;\n\nclass Bone : public cocos2d::Node\n{\npublic:\n    /**\n     * Allocates and initializes a bone.\n     * @return A initialized bone which is marked as \"autorelease\".\n     */\n    static Bone *create();\n    /**\n     * Allocates and initializes a bone.\n     *\n     * @param  name If name is not null, then set name to the bone's name\n     * @return A initialized bone which is marked as \"autorelease\".\n     */\n    static Bone *create(const std::string& name);\n\npublic:\n    /**\n     *  @js ctor\n     */\n    Bone();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Bone(void);\n\n    /**\n     * Initializes an empty Bone with nothing init.\n     */\n    virtual bool init() override;\n\n    /**\n     * Initializes a Bone with the specified name\n     * @param name Bone's name.\n     */\n    virtual bool init(const std::string& name);\n\n    /**\n     * Add display and use displayData to init the display.\n     * If index already have a display, then replace it.\n     * If index is current display index, then also change display to _index\n     *\n     * @param displayData it include the display information, like DisplayType.\n     *          If you want to create a sprite display, then create a SpriteDisplayData param\n     *\n     * @param index the index of the display you want to replace or add to\n     *          -1 : append display from back\n     */\n    void addDisplay(DisplayData *displayData, int index);\n\n    void addDisplay(cocos2d::Node *display, int index);\n\n    void removeDisplay(int index);\n\n    CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force);\n    CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(const std::string& name, bool force);\n\n    void changeDisplayWithIndex(int index, bool force);\n    void changeDisplayWithName(const std::string& name, bool force);\n\n    /**\n     * Add a child to this bone, and it will let this child call setParent(Bone *parent) function to set self to it's parent\n     * @param \tchild  the child you want to add\n     */\n    void addChildBone(Bone *child);\n\n    /**\n     * Set parent bone.\n     * If parent is NUll, then also remove this bone from armature.\n     * It will not set the Armature, if you want to add the bone to a Armature, you should use Armature::addBone(Bone *bone, const char* parentName).\n     *\n     * @param parent  the parent bone.\n     *          nullptr : remove this bone from armature\n     */\n    void setParentBone(Bone *parent);\n\n    /**\n     * Get parent bone\n     * @return parent bone\n     */\n    Bone *getParentBone();\n\n    using Node::removeFromParent;\n    /**\n     * Remove itself from its parent.\n     * @param recursion    whether or not to remove childBone's display\n     */\n    void removeFromParent(bool recursion);\n\n    /**\n     * Removes a child Bone\n     * @param \tbone   the bone you want to remove\n     */\n    void removeChildBone(Bone *bone, bool recursion);\n\n    void update(float delta) override;\n\n    void updateDisplayedColor(const cocos2d::Color3B &parentColor) override;\n    void updateDisplayedOpacity(GLubyte parentOpacity) override;\n\n    //! Update color to render display\n    virtual void updateColor() override;\n\n    //! Update zorder\n    void updateZOrder();\n\n    virtual void setLocalZOrder(int zOrder) override;\n\n    Tween *getTween();\n\n    /*\n     * Whether or not the bone's transform property changed. if true, the bone will update the transform.\n     */\n    virtual void setTransformDirty(bool dirty) { _boneTransformDirty = dirty; }\n    virtual bool isTransformDirty() { return _boneTransformDirty; }\n\n    virtual kmMat4 getNodeToArmatureTransform() const;\n    virtual kmMat4 getNodeToWorldTransform() const override;\n\n    Node *getDisplayRenderNode();\n    DisplayType getDisplayRenderNodeType();\n\n    /*\n     * Get the ColliderBody list in this bone. The object in the Array is ColliderBody.\n     */\n    virtual ColliderDetector* getColliderDetector() const;\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n    virtual void setColliderFilter(ColliderFilter *filter);\n    virtual ColliderFilter *getColliderFilter();\n#endif\n\n    virtual void setBoneData(BoneData *boneData);\n    virtual BoneData *getBoneData() const;\n\n    virtual void setArmature(Armature *armature);\n    virtual Armature *getArmature() const;\n\n    virtual void setChildArmature(Armature *childArmature);\n    virtual Armature *getChildArmature() const;\n\n    virtual DisplayManager *getDisplayManager() const { return _displayManager; }\n    /**\n     *  @lua NA\n     */\n    virtual void setIgnoreMovementBoneData(bool ignore) { _ignoreMovementBoneData = ignore; }\n    virtual bool isIgnoreMovementBoneData() const { return _ignoreMovementBoneData; }\n\n    /*\n     * This function is deprecated, please use isIgnoreMovementBoneData()\n     * @lua NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual bool getIgnoreMovementBoneData() const { return isIgnoreMovementBoneData(); }\n\n    \n    /*\n     * Set blend function\n     */\n    virtual void setBlendFunc(const cocos2d::BlendFunc& blendFunc);\n    virtual cocos2d::BlendFunc getBlendFunc(void) { return _blendFunc; }\n\n    /*\n     * Set if blend function is dirty \n     */\n    virtual void setBlendDirty(bool dirty) { _blendDirty = dirty; }\n    virtual bool isBlendDirty(void) { return _blendDirty; }\n\n    virtual FrameData *getTweenData() const { return _tweenData; }\n\n    virtual void setName(const std::string &name) { _name = name; }\n    virtual const std::string getName() const { return _name; }\n\n    virtual BaseData *getWorldInfo() const { return _worldInfo; }\nprotected:\n    void applyParentTransform(Bone *parent);\n\n    /*\n     *  The origin state of the Bone. Display's state is effected by _boneData, m_pNode, _tweenData\n     *  when call setData function, it will copy from the BoneData.\n     */\n    BoneData *_boneData;\n\n    //! A weak reference to the Armature\n    Armature *_armature;\n\n    //! A weak reference to the child Armature\n    Armature *_childArmature;\n\n    DisplayManager *_displayManager;\n\n    /*\n     *\tWhen Armature play an animation, if there is not a MovementBoneData of this bone in this MovementData, this bone will be hidden.\n     *\tSet IgnoreMovementBoneData to true, then this bone will also be shown.\n     */\n    bool _ignoreMovementBoneData;\n\n    cocos2d::BlendFunc _blendFunc;\n    bool _blendDirty;\n\n    Tween *_tween;\t\t\t\t//! Calculate tween effect\n\n    //! Used for making tween effect in every frame\n    FrameData *_tweenData;\n\n    std::string _name;\n\n    Bone *_parentBone;\t               //! A weak reference to its parent\n    bool _boneTransformDirty;          //! Whether or not transform dirty\n\n    //! self Transform, use this to change display's state\n    kmMat4 _worldTransform;\n\n    BaseData *_worldInfo;\n    \n    //! Armature's parent bone\n    Bone *_armatureParentBone;\n    \n    //! Data version\n    float _dataVersion;\n};\n\n}\n\n#endif /*__CCBONE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCColliderDetector.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCColliderDetector.h\"\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n\n\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\nColliderFilter::ColliderFilter(uint16 categoryBits, uint16 maskBits, int16 groupIndex)\n    : _categoryBits(categoryBits)\n    , _maskBits(maskBits)\n    , _groupIndex(groupIndex)\n{\n}\n\nvoid ColliderFilter::updateShape(b2Fixture *fixture)\n{\n        b2Filter filter;\n        filter.categoryBits = _categoryBits;\n        filter.groupIndex = _groupIndex;\n        filter.maskBits = _maskBits;\n        \n        fixture->SetFilterData(filter);\n}\n\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\nColliderFilter::ColliderFilter(cpCollisionType collisionType, cpGroup group)\n    : _collisionType(collisionType)\n    , _group(group)\n{\n}\nvoid ColliderFilter::updateShape(cpShape *shape)\n{\n        shape->collision_type = _collisionType;\n        shape->group = _group;\n}\n#endif\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\nColliderBody::ColliderBody(ContourData *contourData)\n    : _fixture(nullptr)\n    , _contourData(contourData)\n{\n    CC_SAFE_RETAIN(_contourData);\n    _filter = new ColliderFilter();\n\n#if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    _calculatedVertexList = Array::create();\n    CC_SAFE_RETAIN(_calculatedVertexList);\n#endif\n}\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n\nColliderBody::ColliderBody(ContourData *contourData)\n    : _shape(nullptr)\n    , _contourData(contourData)\n{\n    CC_SAFE_RETAIN(_contourData);\n    _filter = new ColliderFilter();\n\n#if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    _calculatedVertexList = Array::create();\n    CC_SAFE_RETAIN(_calculatedVertexList);\n#endif\n}\n#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\nColliderBody::ColliderBody(ContourData *contourData)\n    : _contourData(contourData)\n{\n    CC_SAFE_RETAIN(_contourData);\n}\n#endif\n\nColliderBody::~ColliderBody()\n{\n    CC_SAFE_RELEASE(_contourData);\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n    CC_SAFE_DELETE(_filter);\n#endif\n}\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\nvoid ColliderBody::setColliderFilter(ColliderFilter *filter)\n{\n    *_filter = *filter;\n}\nColliderFilter *ColliderBody::getColliderFilter()\n{\n    return _filter;\n}\n#endif\n\n\n\nColliderDetector *ColliderDetector::create()\n{\n    ColliderDetector *pColliderDetector = new ColliderDetector();\n    if (pColliderDetector && pColliderDetector->init())\n    {\n        pColliderDetector->autorelease();\n        return pColliderDetector;\n    }\n    CC_SAFE_DELETE(pColliderDetector);\n    return nullptr;\n}\n\nColliderDetector *ColliderDetector::create(Bone *bone)\n{\n    ColliderDetector *pColliderDetector = new ColliderDetector();\n    if (pColliderDetector && pColliderDetector->init(bone))\n    {\n        pColliderDetector->autorelease();\n        return pColliderDetector;\n    }\n    CC_SAFE_DELETE(pColliderDetector);\n    return nullptr;\n}\n\nColliderDetector::ColliderDetector()\n    :  _active(false)\n{\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n    _body = nullptr;\n    _filter = nullptr;\n#endif\n}\n\nColliderDetector::~ColliderDetector()\n{\n    _colliderBodyList.clear();\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n    CC_SAFE_DELETE(_filter);\n#endif\n}\n\nbool ColliderDetector::init()\n{\n    _colliderBodyList.clear();\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n    _filter = new ColliderFilter();\n#endif\n\n    return true;\n}\n\nbool ColliderDetector::init(Bone *bone)\n{\n    init();\n    setBone(bone);\n\n    return true;\n}\n\nvoid ColliderDetector::addContourData(ContourData *contourData)\n{\n    ColliderBody *colliderBody = new ColliderBody(contourData);\n    _colliderBodyList.pushBack(colliderBody);\n    colliderBody->release();\n\n\n#if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    std::vector<Point> &calculatedVertexList = colliderBody->_calculatedVertexList;\n    \n    unsigned long num = contourData->vertexList.size();\n    for (unsigned long i = 0; i < num; i++)\n    {\n        calculatedVertexList.push_back(Point());\n    }\n#endif\n}\n\nvoid ColliderDetector::addContourDataList(cocos2d::Vector<ContourData*> &contourDataList)\n{\n    for (const auto &contourData : contourDataList)\n    {\n        this->addContourData(contourData);\n    }\n}\n\nvoid ColliderDetector::removeContourData(ContourData *contourData)\n{\n    std::vector<ColliderBody*> eraseList;\n    \n    for (const auto &body : _colliderBodyList)\n    {\n\t\tif (body && body->getContourData() == contourData)\n\t\t{\n            eraseList.push_back(body);\n\t\t}\n    }\n    \n    for (const auto &body : eraseList)\n    {\n        this->_colliderBodyList.eraseObject(body);\n    }\n}\n\nvoid ColliderDetector::removeAll()\n{\n    _colliderBodyList.clear();\n}\n\n\nvoid ColliderDetector::setActive(bool active)\n{\n    if (_active == active)\n    {\n        return;\n    }\n\n    _active = active;\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n    if (_body)\n    {\n        if (active)\n        {\n            setBody(_body);\n        }\n        else\n        {\n            for(auto& object : _colliderBodyList)\n            {\n                ColliderBody *colliderBody = (ColliderBody *)object;\n                b2Fixture *fixture = colliderBody->getB2Fixture();\n\n                _body->DestroyFixture(fixture);\n                colliderBody->setB2Fixture(nullptr);\n            }\n        }\n    }\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n    if (_body)\n    {\n        if (_active)\n        {\n            for(auto& object : _colliderBodyList)\n            {\n                ColliderBody *colliderBody = (ColliderBody *)object;\n                cpShape *shape = colliderBody->getShape();\n                if(shape->space_private == nullptr)\n                {\n                    cpSpaceAddShape(_body->space_private, shape);\n                }\n            }\n        }\n        else\n        {\n            for(auto& object : _colliderBodyList)\n            {\n                ColliderBody *colliderBody = (ColliderBody *)object;\n                cpShape *shape = colliderBody->getShape();\n                if (shape->space_private != nullptr)\n                {\n                    cpSpaceRemoveShape(_body->space_private, shape);\n                }\n            }\n        }\n    }\n#endif\n}\n\nbool ColliderDetector::getActive()\n{\n    return _active;\n}\n\nconst cocos2d::Vector<ColliderBody*>& ColliderDetector::getColliderBodyList()\n{\n    return _colliderBodyList;\n}\n\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\nvoid ColliderDetector::setColliderFilter(ColliderFilter *filter)\n{\n    *_filter = *filter;\n    \n    for(auto& object : _colliderBodyList)\n    {\n        ColliderBody *colliderBody = (ColliderBody *)object;\n        colliderBody->setColliderFilter(filter);\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n        if (colliderBody->getB2Fixture())\n        {\n            colliderBody->getColliderFilter()->updateShape(colliderBody->getB2Fixture());\n        }\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n        if (colliderBody->getShape())\n        {\n            colliderBody->getColliderFilter()->updateShape(colliderBody->getShape());\n        }\n#endif\n    }\n}\nColliderFilter *ColliderDetector::getColliderFilter()\n{\n    return _filter;\n}\n#endif\n\n\nPoint helpPoint;\n\nvoid ColliderDetector::updateTransform(kmMat4 &t)\n{\n    if (!_active)\n    {\n        return;\n    }\n\n    for(auto& object : _colliderBodyList)\n    {\n        ColliderBody *colliderBody = (ColliderBody *)object;\n        ContourData *contourData = colliderBody->getContourData();\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n        b2PolygonShape *shape = nullptr;\n        if (_body != nullptr)\n        {\n            shape = (b2PolygonShape *)colliderBody->getB2Fixture()->GetShape();\n        }\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n        cpPolyShape *shape = nullptr;\n        if (_body != nullptr)\n        {\n            shape = (cpPolyShape *)colliderBody->getShape();\n        }\n#endif\n\n        unsigned long num = contourData->vertexList.size();\n        std::vector<cocos2d::Point> &vs = contourData->vertexList;\n\n#if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n        std::vector<cocos2d::Point> &cvs = colliderBody->_calculatedVertexList;\n#endif\n\n        for (unsigned long i = 0; i < num; i++)\n        {\n            helpPoint.setPoint( vs.at(i).x,  vs.at(i).y);\n            helpPoint = PointApplyTransform(helpPoint, t);\n\n\n#if ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n            cvs.at(i).x = helpPoint.x;\n            cvs.at(i).y = helpPoint.y;\n#endif\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n            if (shape != nullptr)\n            {\n                b2Vec2 &bv = shape->m_vertices[i];\n                bv.Set(helpPoint.x / PT_RATIO, helpPoint.y / PT_RATIO);\n            }\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n            if (shape != nullptr)\n            {\n                cpVect v ;\n                v.x = helpPoint.x;\n                v.y = helpPoint.y;\n                shape->verts[i] = v;\n            }\n#endif\n        }\n\n#if ENABLE_PHYSICS_CHIPMUNK_DETECT\n        cpConvexHull((int)num, shape->verts, nullptr, nullptr, 0);\n        for (unsigned long i = 0; i < num; i++)\n        {\n            cpVect b = shape->verts[(i + 1) % shape->numVerts];\n            cpVect n = cpvnormalize(cpvperp(cpvsub(b, shape->verts[i])));\n\n            shape->planes[i].n = n;\n            shape->planes[i].d = cpvdot(n, shape->verts[i]);\n        }\n#endif\n    }\n}\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n\nvoid ColliderDetector::setBody(b2Body *pBody)\n{\n    _body = pBody;\n\n    for(auto& object : _colliderBodyList)\n    {\n        ColliderBody *colliderBody = (ColliderBody *)object;\n\n        ContourData *contourData = colliderBody->getContourData();\n        \n        b2Vec2 *b2bv = new b2Vec2[contourData->vertexList.size()];\n\n        int i = 0;\n        for(auto& v : contourData->vertexList)\n        {\n            b2bv[i].Set(v.x / PT_RATIO, v.y / PT_RATIO);\n            i++;\n        }\n\n        b2PolygonShape polygon;\n        polygon.Set(b2bv, (int)contourData->vertexList.size());\n\n        CC_SAFE_DELETE(b2bv);\n\n        b2FixtureDef fixtureDef;\n        fixtureDef.shape = &polygon;\n        fixtureDef.isSensor = true;\n\n        b2Fixture *fixture = _body->CreateFixture(&fixtureDef);\n        fixture->SetUserData(_bone);\n\n        if (colliderBody->getB2Fixture() != nullptr)\n        {\n            _body->DestroyFixture(colliderBody->getB2Fixture());\n        }\n        colliderBody->setB2Fixture(fixture);\n\n        colliderBody->getColliderFilter()->updateShape(fixture);\n    }\n}\n\nb2Body *ColliderDetector::getBody() const\n{\n    return _body;\n}\n\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\nvoid ColliderDetector::setBody(cpBody *pBody)\n{\n    _body = pBody;\n\n    for(auto& object : _colliderBodyList)\n    {\n        ColliderBody *colliderBody = (ColliderBody *)object;\n\n        ContourData *contourData = colliderBody->getContourData();\n\n        ssize_t num = contourData->vertexList.size();\n        auto vs = contourData->vertexList;\n        cpVect *verts = new cpVect[num];\n        for (int i = 0; i < num; i++)\n        {\n            verts[num - 1 - i].x = vs.at(i).x;\n            verts[num - 1 - i].y = vs.at(i).y;\n        }\n\n        cpShape *shape = cpPolyShapeNew(_body, (int)num, verts, cpvzero);\n\n        shape->sensor = true;\n        shape->data = _bone;\n\n        if (_active)\n        {\n            cpSpaceAddShape(_body->space_private, shape);\n        }\n\n        colliderBody->setShape(shape);\n        colliderBody->getColliderFilter()->updateShape(shape);\n\n        delete []verts;\n    }\n}\n\ncpBody *ColliderDetector::getBody() const\n{\n    return _body;\n}\n\n#endif\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCColliderDetector.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCCOLLIDERDETECTOR_H__\n#define __CCCOLLIDERDETECTOR_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n\n#ifndef PT_RATIO\n#define PT_RATIO 32\n#endif\n\n\n#if ENABLE_PHYSICS_CHIPMUNK_DETECT\n#include \"chipmunk.h\"\n#elif ENABLE_PHYSICS_BOX2D_DETECT\n#include \"Box2D/Box2D.h\"\n#endif\n\n\nnamespace cocostudio {\n\nclass Bone;\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass ColliderFilter\n{\npublic:\n    virtual ~ColliderFilter() { }\n#if ENABLE_PHYSICS_BOX2D_DETECT\npublic:\n    ColliderFilter(uint16 categoryBits = 0x0001, uint16 maskBits = 0xFFFF, int16 groupIndex = 0);\n    void updateShape(b2Fixture *fixture);\n\n    virtual void setCategoryBits(uint16 categoryBits) { _categoryBits = categoryBits; }\n    virtual uint16 getCategoryBits() const { return _categoryBits; }\n\n    virtual void setMaskBits(uint16 maskBits) { _maskBits = maskBits; }\n    virtual uint16 getMaskBits() const { return _maskBits; }\n\n    virtual void setGroupIndex(int16 groupIndex) { _groupIndex = groupIndex; }\n    virtual int16 getGroupIndex() const { return _groupIndex; }\nprotected:\n    uint16 _categoryBits;\n    uint16 _maskBits;\n    int16 _groupIndex;\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\npublic:\n    ColliderFilter(cpCollisionType collisionType = 0, cpGroup group = 0);\n    void updateShape(cpShape *shape);\n\n    virtual void setCollisionType(cpCollisionType collisionType) { _collisionType = collisionType; }\n    virtual cpCollisionType getCollisionType() const { return _collisionType; }\n\n    virtual void setGroup(cpGroup group) { _group = group; }\n    virtual cpGroup getGroup() const { return _group; }\nprotected:\n    cpCollisionType _collisionType;\n    cpGroup _group;\n#endif\n};\n\nclass ColliderBody : public cocos2d::Object\n{\npublic:\n    ColliderBody(ContourData *contourData);\n    ~ColliderBody();\n\n    inline ContourData *getContourData() { return _contourData; }\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT \n    void setColliderFilter(ColliderFilter *filter);\n    ColliderFilter *getColliderFilter();\n#endif\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n    virtual void setB2Fixture(b2Fixture *fixture) { _fixture = fixture; }\n    virtual b2Fixture *getB2Fixture() const { return _fixture; }\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n    virtual void setShape(cpShape *shape) { _shape = shape; }\n    virtual cpShape *getShape() const { return _shape; }\n#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    virtual const std::vector<cocos2d::Point> &getCalculatedVertexList() const { return _calculatedVertexList; }\n#endif\n\nprivate:\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n    b2Fixture *_fixture;\n    ColliderFilter *_filter;\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n    cpShape *_shape;\n    ColliderFilter *_filter;\n#elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    std::vector<cocos2d::Point> _calculatedVertexList;\n#endif\n\n    ContourData *_contourData;\n\n    friend class ColliderDetector;\n};\n\n/*\n *  @brief  ContourSprite used to draw the contour of the display\n *  @js NA\n *  @lua NA\n */\nclass ColliderDetector : public cocos2d::Object\n{\npublic:\n    static ColliderDetector *create();\n    static ColliderDetector *create(Bone *bone);\npublic:\n\t/**\n     * @js ctor\n     */\n    ColliderDetector();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ColliderDetector(void);\n\n    virtual bool init();\n    virtual bool init(Bone *bone);\n\n    void addContourData(ContourData *contourData);\n    void addContourDataList(cocos2d::Vector<ContourData*> &contourDataList);\n\n    void removeContourData(ContourData *contourData);\n    void removeAll();\n\n    void updateTransform(kmMat4 &t);\n\n    void setActive(bool active);\n    bool getActive();\n\n    const cocos2d::Vector<ColliderBody*>& getColliderBodyList();\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT \n    virtual void setColliderFilter(ColliderFilter *filter);\n    virtual ColliderFilter *getColliderFilter();\n#endif\n\n    virtual void setBone(Bone *bone) { _bone = bone; }\n    virtual Bone *getBone() const { return _bone; }\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n    virtual void setBody(b2Body *body);\n    virtual b2Body *getBody() const;\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n    virtual void setBody(cpBody *body);\n    virtual cpBody *getBody() const;\n#endif\n protected:\n    cocos2d::Vector<ColliderBody*> _colliderBodyList;\n\n    Bone *_bone;\n\n#if ENABLE_PHYSICS_BOX2D_DETECT\n    b2Body *_body;\n    ColliderFilter *_filter;\n#elif ENABLE_PHYSICS_CHIPMUNK_DETECT\n    cpBody *_body;\n    ColliderFilter *_filter;\n#endif\n\nprotected:\n    bool _active;\n};\n\n}\n\n#endif /*__CCCOLLIDERDETECTOR_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComAttribute.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCComAttribute.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nIMPLEMENT_CLASS_COMPONENT_INFO(ComAttribute)\nComAttribute::ComAttribute(void)\n{\n    _name = \"CCComAttribute\";\n}\n\nComAttribute::~ComAttribute(void)\n{\n    _dict.clear();\n}\n\nbool ComAttribute::init()\n{\n    return true;\n}\n\nvoid ComAttribute::setInt(const std::string& key, int value)\n{\n    _dict[key] = cocos2d::Value(value);\n}\n\nvoid ComAttribute::setFloat(const std::string& key, float value)\n{\n    _dict[key] = cocos2d::Value(value);\n}\n\nvoid ComAttribute::setBool(const std::string& key, bool value)\n{\n    _dict[key] = cocos2d::Value(value);\n}\n\nvoid ComAttribute::setString(const std::string& key, const std::string& value)\n{\n    _dict[key] = cocos2d::Value(value);\n}\n\nint ComAttribute::getInt(const std::string& key, int def) const\n{\n    if (_dict.find(key) != _dict.end())\n    {\n        const cocos2d::Value& v = _dict.at(key);\n        return v.asInt();\n    }\n   \n    if (!DICTOOL->checkObjectExist_json(_doc, key.c_str()))\n    {\n        return def;\n    }\n  \n    return DICTOOL->getIntValue_json(_doc, key.c_str());\n}\n\nfloat ComAttribute::getFloat(const std::string& key, float def) const\n{\n    if (_dict.find(key) != _dict.end())\n    {\n        const cocos2d::Value& v = _dict.at(key);\n        return v.asFloat();\n    }\n\n    if (!DICTOOL->checkObjectExist_json(_doc, key.c_str()))\n    {\n        return def;\n    }\n    return DICTOOL->getFloatValue_json(_doc, key.c_str());\n}\n\nbool ComAttribute::getBool(const std::string& key, bool def) const\n{\n    if (_dict.find(key) != _dict.end())\n    {\n        const cocos2d::Value& v = _dict.at(key);\n        return v.asBool();\n    }\n    \n    if (!DICTOOL->checkObjectExist_json(_doc, key.c_str()))\n    {\n        return def;\n    }\n  \n    return DICTOOL->getBooleanValue_json(_doc, key.c_str());\n}\n\nstd::string ComAttribute::getString(const std::string& key, const std::string& def) const\n{\n    if (_dict.find(key) != _dict.end())\n    {\n        const cocos2d::Value& v = _dict.at(key);\n        return v.asString();\n    }\n    \n    if (!DICTOOL->checkObjectExist_json(_doc, key.c_str()))\n    {\n        return def;\n    }\n  \n    return DICTOOL->getStringValue_json(_doc, key.c_str());\n}\n\nComAttribute* ComAttribute::create(void)\n{\n\tComAttribute * pRet = new ComAttribute();\n\tif (pRet && pRet->init())\n\t{\n\t\tpRet->autorelease();\n\t}\n\telse\n\t{\n\t\tCC_SAFE_DELETE(pRet);\n\t}\n\treturn pRet;\n}\n\nbool ComAttribute::serialize(void* r) \n{\n    bool bRet = false;\n\tdo \n\t{\n\t\tCC_BREAK_IF(r == nullptr);\n\t\trapidjson::Value *v = (rapidjson::Value *)r;\n\t\tconst char *className = DICTOOL->getStringValue_json(*v, \"classname\");\n\t\tCC_BREAK_IF(className == nullptr);\n\t\tconst char *comName = DICTOOL->getStringValue_json(*v, \"name\");\n\t\tif (comName != nullptr)\n\t\t{\n\t\t\tsetName(comName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsetName(className);\n\t\t}\n\t\tconst rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, \"fileData\");\n\t\tCC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData));\n\t\tconst char *file = DICTOOL->getStringValue_json(fileData, \"path\");\n\t\tCC_BREAK_IF(file == nullptr);\n\t\tstd::string filePath;\n\t\tif (file != nullptr)\n\t\t{\n\t\t\tfilePath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(file));\n\t\t}\n\t\tint resType = DICTOOL->getIntValue_json(fileData, \"resourceType\", -1);\n\t\tCC_BREAK_IF(resType != 0);\n        parse(filePath.c_str());\n\t\tbRet = true;\n\t} while (0);\n\n\treturn bRet;\n}\n\nbool ComAttribute::parse(const std::string &jsonFile)\n{\n    bool ret = false;\n    do {\n        std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonFile);\n        _doc.Parse<0>(contentStr.c_str());\n        CC_BREAK_IF(_doc.HasParseError());\n        ret = true;\n    } while (0);\n    return ret;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComAttribute.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EXTENTIONS_CCCOMATTRIBUTE_H__\n#define __CC_EXTENTIONS_CCCOMATTRIBUTE_H__\n\n#include \"CCComBase.h\"\n\nnamespace cocostudio {\n\nclass ComAttribute : public cocos2d::Component\n{\n    DECLARE_CLASS_COMPONENT_INFO\nprotected:\n    /**\n     * @js ctor\n     */\n    ComAttribute(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ComAttribute(void);\n    \npublic:\n    static ComAttribute* create(void);\n    virtual bool init() override;\n    virtual bool serialize(void* r) override;\n    \n    void setInt(const std::string& key, int value);\n    void setFloat(const std::string& key, float value);\n    void setBool(const std::string& key, bool value);\n    void setString(const std::string& key, const std::string& value);\n    int getInt(const std::string& key, int def = 0) const;\n    float getFloat(const std::string& key, float def = 0.0f) const;\n    bool getBool(const std::string& key, bool def = false) const;\n    std::string getString(const std::string& key, const std::string& def = \"\") const;\n    bool parse(const std::string &jsonFile);\nprivate:\n   cocos2d::ValueMap _dict;\n   rapidjson::Document _doc;\n};\n\n}\n\n#endif  // __FUNDATION__CCCOMPONENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComAudio.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCComAudio.h\"\n#include \"SimpleAudioEngine.h\"\n\nnamespace cocostudio {\n\nIMPLEMENT_CLASS_COMPONENT_INFO(ComAudio)\nComAudio::ComAudio(void)\n: _filePath(\"\")\n, _loop(false)\n{\n    _name = \"CCComAudio\";\n}\n\nComAudio::~ComAudio(void)\n{\n    \n}\n\nbool ComAudio::init()\n{\n    return true;\n}\n\nvoid ComAudio::onEnter()\n{\n}\n\nvoid ComAudio::onExit()\n{\n    stopBackgroundMusic(true);\n    stopAllEffects();\n}\n\nbool ComAudio::isEnabled() const\n{\n    return _enabled;\n}\n\nvoid ComAudio::setEnabled(bool b)\n{\n    _enabled = b;\n}\n\n\nbool ComAudio::serialize(void* r)\n{\n\tbool bRet = false;\n\tdo \n\t{\n\t\tCC_BREAK_IF(r == nullptr);\n\t\trapidjson::Value *v = (rapidjson::Value *)r;\n\t\tconst char *className = DICTOOL->getStringValue_json(*v, \"classname\");\n\t\tCC_BREAK_IF(className == nullptr);\n\t\tconst char *comName = DICTOOL->getStringValue_json(*v, \"name\");\n\t\tif (comName != nullptr)\n\t\t{\n\t\t\tsetName(comName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsetName(className);\n\t\t}\n\t\tconst rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, \"fileData\");\n\t\tCC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData));\n\t\tconst char *file = DICTOOL->getStringValue_json(fileData, \"path\");\n\t\tCC_BREAK_IF(file == nullptr);\n\t\tstd::string filePath;\n\t\tif (file != nullptr)\n\t\t{\n\t\t\tfilePath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(file));\n\t\t}\n\t\tint resType = DICTOOL->getIntValue_json(fileData, \"resourceType\", -1);\n\t\tCC_BREAK_IF(resType != 0);\n\t\tif (strcmp(className, \"CCBackgroundAudio\") == 0)\n\t\t{\n\t\t\tpreloadBackgroundMusic(filePath.c_str());\n\t\t\tbool loop = DICTOOL->getIntValue_json(*v, \"loop\") != 0? true:false;\n\t\t\tsetLoop(loop);\n            playBackgroundMusic(filePath.c_str(), loop);\n\t\t}\n\t\telse if(strcmp(className, \"CCComAudio\") == 0)\n\t\t{\n\t\t\tpreloadEffect(filePath.c_str());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_BREAK_IF(true);\n\t\t}\n\t\tbRet = true;\n\t} while (0);\n\n\treturn bRet;\n}\n\nComAudio* ComAudio::create(void)\n{\n    ComAudio * pRet = new ComAudio();\n    if (pRet && pRet->init())\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\treturn pRet;\n}\n\nvoid ComAudio::end()\n{\n   CocosDenshion::SimpleAudioEngine::end();\n}\n\nvoid ComAudio::preloadBackgroundMusic(const char* pszFilePath)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->preloadBackgroundMusic(pszFilePath);\n    setFile(pszFilePath);\n\tsetLoop(false);\n}\n\nvoid ComAudio::playBackgroundMusic(const char* pszFilePath, bool loop)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(pszFilePath, loop);\n    \n}\n\nvoid ComAudio::playBackgroundMusic(const char* pszFilePath)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(pszFilePath);\n}\n\nvoid ComAudio::playBackgroundMusic()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(_filePath.c_str(), _loop);\n}\n\nvoid ComAudio::stopBackgroundMusic(bool bReleaseData)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->stopBackgroundMusic(bReleaseData);\n}\n\nvoid ComAudio::stopBackgroundMusic()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->stopBackgroundMusic();\n}\n\nvoid ComAudio::pauseBackgroundMusic()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->pauseBackgroundMusic();\n}\n\nvoid ComAudio::resumeBackgroundMusic()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->resumeBackgroundMusic();\n}\n\nvoid ComAudio::rewindBackgroundMusic()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->rewindBackgroundMusic();\n}\n\nbool ComAudio::willPlayBackgroundMusic()\n{\n    return CocosDenshion::SimpleAudioEngine::getInstance()->willPlayBackgroundMusic();\n}\n\nbool ComAudio::isBackgroundMusicPlaying()\n{\n    return CocosDenshion::SimpleAudioEngine::getInstance()->isBackgroundMusicPlaying();\n}\n\nfloat ComAudio::getBackgroundMusicVolume()\n{\n    return CocosDenshion::SimpleAudioEngine::getInstance()->getBackgroundMusicVolume();\n}\n\nvoid ComAudio::setBackgroundMusicVolume(float volume)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->setBackgroundMusicVolume(volume);\n}\n\nfloat ComAudio::getEffectsVolume()\n{\n    return CocosDenshion::SimpleAudioEngine::getInstance()->getEffectsVolume();\n}\n\nvoid ComAudio::setEffectsVolume(float volume)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->setEffectsVolume(volume);\n}\n\nunsigned int ComAudio::playEffect(const char* pszFilePath, bool loop)\n{\n    return CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(pszFilePath, loop);\n}\n\nunsigned int ComAudio::playEffect(const char* pszFilePath)\n{\n    return CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(pszFilePath);\n}\n\nunsigned int ComAudio::playEffect()\n{\n\treturn CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(_filePath.c_str(), _loop);\n}\n\nvoid ComAudio::pauseEffect(unsigned int nSoundId)\n{\n    return CocosDenshion::SimpleAudioEngine::getInstance()->pauseEffect(nSoundId);\n}\n\nvoid ComAudio::pauseAllEffects()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->pauseAllEffects();\n}\n\nvoid ComAudio::resumeEffect(unsigned int nSoundId)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->resumeEffect(nSoundId);\n}\n\nvoid ComAudio::resumeAllEffects()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->resumeAllEffects();\n}\n\nvoid ComAudio::stopEffect(unsigned int nSoundId)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->stopEffect(nSoundId);\n}\n\nvoid ComAudio::stopAllEffects()\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->stopAllEffects();\n}\n\nvoid ComAudio::preloadEffect(const char* pszFilePath)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->preloadEffect(pszFilePath);\n    setFile(pszFilePath);\n    setLoop(false);\n}\n\nvoid ComAudio::unloadEffect(const char *pszFilePath)\n{\n    CocosDenshion::SimpleAudioEngine::getInstance()->unloadEffect(pszFilePath);\n}\n\nvoid ComAudio::setFile(const char* pszFilePath)\n{\n\t_filePath.assign(pszFilePath);\n}\n\nvoid ComAudio::setLoop(bool loop)\n{\n\t_loop = loop;\n}\n\nconst char* ComAudio::getFile()\n{\n\treturn _filePath.c_str();\n}\n\nbool ComAudio::isLoop()\n{\n\treturn _loop;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComAudio.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EXTENTIONS_CCCOMAUDIO_H__\n#define __CC_EXTENTIONS_CCCOMAUDIO_H__\n\n#include \"CCComBase.h\"\n\nnamespace cocostudio {\n\nclass ComAudio : public cocos2d::Component\n{\n\n    DECLARE_CLASS_COMPONENT_INFO\nprotected:\n    /**\n     * @js ctor\n     */\n    ComAudio(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ComAudio(void);\n    \npublic:\n    virtual bool init() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit() override;\n    virtual bool isEnabled() const override;\n    virtual void setEnabled(bool b) override;\n    virtual bool serialize(void* r) override;\n\n    static ComAudio* create(void);\n   \npublic:\n    void end();\n    void preloadBackgroundMusic(const char* pszFilePath);\n    void playBackgroundMusic(const char* pszFilePath, bool bLoop);\n    void playBackgroundMusic(const char* pszFilePath);\n    void playBackgroundMusic();\n    void stopBackgroundMusic(bool bReleaseData);\n    void stopBackgroundMusic();\n    void pauseBackgroundMusic();\n    void resumeBackgroundMusic();\n    void rewindBackgroundMusic();\n    bool willPlayBackgroundMusic();\n    bool isBackgroundMusicPlaying();\n    float getBackgroundMusicVolume();\n    void setBackgroundMusicVolume(float volume);\n    float getEffectsVolume();\n    void setEffectsVolume(float volume);\n    unsigned int playEffect(const char* pszFilePath, bool bLoop);\n    unsigned int playEffect(const char* pszFilePath);\n    unsigned int playEffect();\n    void pauseEffect(unsigned int nSoundId);\n    void pauseAllEffects();\n    void resumeEffect(unsigned int nSoundId);\n    void resumeAllEffects();\n    void stopEffect(unsigned int nSoundId);\n    void stopAllEffects();\n    void preloadEffect(const char* pszFilePath);\n    void unloadEffect(const char* pszFilePath);\n    void setFile(const char* pszFilePath);\n    const char* getFile();\n    void setLoop(bool bLoop);\n    bool isLoop();\nprivate:\n\tstd::string _filePath;\n\tbool _loop;\n};\n\n}\n\n#endif  // __FUNDATION__CCCOMPONENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComBase.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EXTENTIONS_CCCOMBASE_H__\n#define __CC_EXTENTIONS_CCCOMBASE_H__\n\n#include \"ObjectFactory.h\"\n#include \"DictionaryHelper.h\"\n#include <string>\n\n\n#define DECLARE_CLASS_COMPONENT_INFO \\\n    public: \\\n        static cocostudio::ObjectFactory::TInfo Type; \\\n        static cocos2d::Object* createInstance(void); \\\n        \n#define IMPLEMENT_CLASS_COMPONENT_INFO(className) \\\n        cocos2d::Object* className::createInstance(void) \\\n        { \\\n            return className::create(); \\\n        } \\\n        cocostudio::ObjectFactory::TInfo className::Type(#className, &className::createInstance); \\\n\n#define CREATE_CLASS_COMPONENT_INFO(className) \\\n        cocostudio::ObjectFactory::TInfo(#className, &className::createInstance)\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComController.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCComController.h\"\n\nnamespace cocostudio {\n\nIMPLEMENT_CLASS_COMPONENT_INFO(ComController)\nComController::ComController(void)\n{\n    _name = \"CCComController\";\n}\n\nComController::~ComController(void)\n{\n}\n\nbool ComController::init()\n{\n    return true;\n}\n\nvoid ComController::onEnter()\n{\n}\n\nvoid ComController::onExit()\n{\n}\n\nvoid ComController::update(float delta)\n{\n}\n\nbool ComController::isEnabled() const\n{\n    return _enabled;\n}\n\nvoid ComController::setEnabled(bool b)\n{\n    _enabled = b;\n}\n\nComController* ComController::create(void)\n{\n    ComController * pRet = new ComController();\n    if (pRet && pRet->init())\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\treturn pRet;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComController.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EXTENTIONS_CCCOMCONTROLLER_H__\n#define __CC_EXTENTIONS_CCCOMCONTROLLER_H__\n\n#include \"CCComBase.h\"\n#include \"cocostudio/CCInputDelegate.h\"\n\nnamespace cocostudio {\n\nclass ComController : public cocos2d::Component, public InputDelegate\n{\n\n    DECLARE_CLASS_COMPONENT_INFO\npublic:\n    /**\n     *  @js ctor\n     */\n    ComController(void);\n    \npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ComController(void);\n    virtual bool init() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit() override;\n    virtual void update(float delta) override;\n    virtual bool isEnabled() const override;\n    virtual void setEnabled(bool b) override;\n    \n    static ComController* create(void);\n};\n\n}\n\n#endif  // __FUNDATION__CCCOMPONENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComRender.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCComRender.h\"\n#include \"cocostudio/CocoStudio.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nIMPLEMENT_CLASS_COMPONENT_INFO(ComRender)\nComRender::ComRender(void)\n: _render(nullptr)\n{\n    _name = \"CCComRender\";\n}\n\n\nComRender::ComRender(cocos2d::Node *node, const char *comName)\n{\n    _render = node;\n    _name.assign(comName);\n}\n\nComRender::~ComRender(void)\n{\n    _render = nullptr;\n}\n\nvoid ComRender::onEnter()\n{\n    if (_owner != nullptr)\n    {\n        _owner->addChild(_render);\n    }\n}\n\nvoid ComRender::onExit()\n{\n    _render = nullptr;\n}\n\ncocos2d::Node* ComRender::getNode()\n{\n    return _render;\n}\n\nvoid ComRender::setNode(cocos2d::Node *node)\n{\n\t_render = node;\n}\n\n\nbool ComRender::serialize(void* r)\n{\n\tbool bRet = false;\n\tdo \n\t{\n\t\tCC_BREAK_IF(r == nullptr);\n\t\trapidjson::Value *v = (rapidjson::Value *)r;\n\t\tconst char *className = DICTOOL->getStringValue_json(*v, \"classname\");\n\t\tCC_BREAK_IF(className == nullptr);\n\t\tconst char *comName = DICTOOL->getStringValue_json(*v, \"name\");\n\t\tif (comName != nullptr)\n\t\t{\n\t\t\tsetName(comName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsetName(className);\n\t\t}\n\t\tconst rapidjson::Value &fileData = DICTOOL->getSubDictionary_json(*v, \"fileData\");\n\t\tCC_BREAK_IF(!DICTOOL->checkObjectExist_json(fileData));\n\t\tconst char *file = DICTOOL->getStringValue_json(fileData, \"path\");\n\t\tconst char *plist = DICTOOL->getStringValue_json(fileData, \"plistFile\");\n\t\tCC_BREAK_IF(file == nullptr && plist == nullptr);\n\t\tstd::string filePath;\n\t\tstd::string plistPath;\n\t\tif (file != nullptr)\n\t\t{\n\t\t\tfilePath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(file));\n\t\t}\n\t\tif (plist != nullptr)\n\t\t{\n\t\t\tplistPath.assign(cocos2d::CCFileUtils::getInstance()->fullPathForFilename(plist));\n\t\t}\n\t\tint resType = DICTOOL->getIntValue_json(fileData, \"resourceType\", -1);\n\t\tif (resType == 0)\n\t\t{\n\t\t\tif (strcmp(className, \"CCSprite\") == 0 && filePath.find(\".png\") != std::string::npos)\n\t\t\t{\n\t\t\t\t_render = Sprite::create(filePath.c_str());\n\t\t\t}\n\t\t\telse if(strcmp(className, \"CCTMXTiledMap\") == 0 && filePath.find(\".tmx\") != std::string::npos)\n\t\t\t{\n\t\t\t\t_render = TMXTiledMap::create(filePath.c_str());\n\t\t\t}\n\t\t\telse if(strcmp(className, \"CCParticleSystemQuad\") == 0 && filePath.find(\".plist\") != std::string::npos)\n\t\t\t{\n\t\t\t\t_render = ParticleSystemQuad::create(filePath.c_str());\n                _render->setPosition(Point(0.0f, 0.0f));\n\t\t\t}\n\t\t\telse if(strcmp(className, \"CCArmature\") == 0)\n\t\t\t{\n\t\t\t\tstd::string reDir = filePath;\n\t\t\t\tstd::string file_path = \"\";\n\t\t\t\tsize_t pos = reDir.find_last_of('/');\n\t\t\t\tif (pos != std::string::npos)\n\t\t\t\t{\n\t\t\t\t\tfile_path = reDir.substr(0, pos+1);\n\t\t\t\t}\n\t\t\t\trapidjson::Document doc;\n\t\t\t\tif(!readJson(filePath.c_str(), doc))\n\t\t\t\t{\n\t\t\t\t\tlog(\"read json file[%s] error!\\n\", filePath.c_str());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst rapidjson::Value &subData = DICTOOL->getDictionaryFromArray_json(doc, \"armature_data\", 0);\n\t\t\t\tconst char *name = DICTOOL->getStringValue_json(subData, \"name\");\n\t\t\t\tArmatureDataManager::getInstance()->addArmatureFileInfo(filePath.c_str());\n\t\t\t\tArmature *pAr = Armature::create(name);\n\t\t\t\t_render = pAr;\n\t\t\t\tconst char *actionName = DICTOOL->getStringValue_json(*v, \"selectedactionname\");\n\t\t\t\tif (actionName != nullptr && pAr->getAnimation() != nullptr)\n\t\t\t\t{\n\t\t\t\t\tpAr->getAnimation()->play(actionName);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(strcmp(className, \"GUIComponent\") == 0)\n\t\t\t{\n\t\t\t\tcocos2d::gui::Widget* widget = GUIReader::getInstance()->widgetFromJsonFile(filePath.c_str());\n                _render = widget;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tCC_BREAK_IF(true);\n\t\t\t}\n\t\t}\n\t\telse if (resType == 1)\n\t\t{\n\t\t\tif (strcmp(className, \"CCSprite\") == 0)\n\t\t\t{\n\t\t\t\tstd::string strPngFile = plistPath;\n\t\t\t\tstd::string::size_type pos = strPngFile.find(\".plist\");\n\t\t\t\tif (pos  == strPngFile.npos)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstrPngFile.replace(pos, strPngFile.length(), \".png\");\n\t\t\t\tSpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath.c_str(), strPngFile.c_str());\n\t\t\t\t_render = Sprite::createWithSpriteFrameName(filePath.c_str());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tCC_BREAK_IF(true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCC_BREAK_IF(true);\n\t\t}\n\t\tbRet = true;\n\t} while (0);\n\n\treturn bRet;\n}\n\nComRender* ComRender::create(void)\n{\n    ComRender * ret = new ComRender();\n    if (ret != nullptr && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n\treturn ret;\n}\n\nComRender* ComRender::create(cocos2d::Node *node, const char *comName)\n{\n    ComRender * ret = new ComRender(node, comName);\n    if (ret != nullptr && ret->init())\n    {\n        ret->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n    }\n        return ret;\n}\n\nbool ComRender::readJson(const std::string &fileName, rapidjson::Document &doc)\n{\n    bool ret = false;\n    do {\n        std::string contentStr = FileUtils::getInstance()->getStringFromFile(fileName);\n        doc.Parse<0>(contentStr.c_str());\n        CC_BREAK_IF(doc.HasParseError());\n        ret = true;\n    } while (0);\n    return ret;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCComRender.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EXTENTIONS_CCCOMRENDER_H__\n#define __CC_EXTENTIONS_CCCOMRENDER_H__\n\n#include \"CCComBase.h\"\n\nnamespace cocostudio {\n\nclass ComRender : public cocos2d::Component\n{\n    DECLARE_CLASS_COMPONENT_INFO\nprotected:\n    /**\n     *  @js ctor\n     */\n    ComRender(void);\n    ComRender(cocos2d::Node *node, const char *comName);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ComRender(void);\n    \npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter() override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit() override;\n    virtual bool serialize(void* r) override;\n    virtual cocos2d::Node* getNode();\n    virtual void setNode(cocos2d::Node *node);\n\n    static ComRender* create(void);\n    static ComRender* create(cocos2d::Node *node, const char *comName);\nprivate:\n    bool readJson(const std::string &fileName, rapidjson::Document &doc);\n\nprivate:\n    cocos2d::Node *_render;\n};\n\n}\n#endif  // __FUNDATION__CCCOMPONENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDataReaderHelper.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"platform/CCFileUtils.h\"\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n\n#include \"tinyxml2.h\"\n\n#include \"cocostudio/CCDataReaderHelper.h\"\n#include \"cocostudio/CCArmatureDataManager.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n#include \"cocostudio/CCUtilMath.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n\nusing namespace cocos2d;\n\n\nstatic const char *VERSION = \"version\";\nstatic const float VERSION_2_0 = 2.0f;\n\nstatic const char *ARMATURES = \"armatures\";\nstatic const char *ARMATURE = \"armature\";\nstatic const char *BONE = \"b\";\nstatic const char *DISPLAY = \"d\";\n\nstatic const char *ANIMATIONS = \"animations\";\nstatic const char *ANIMATION = \"animation\";\nstatic const char *MOVEMENT = \"mov\";\nstatic const char *FRAME = \"f\";\n\nstatic const char *TEXTURE_ATLAS = \"TextureAtlas\";\nstatic const char *SUB_TEXTURE = \"SubTexture\";\n\nstatic const char *A_NAME = \"name\";\nstatic const char *A_DURATION = \"dr\";\nstatic const char *A_FRAME_INDEX = \"fi\";\nstatic const char *A_DURATION_TO = \"to\";\nstatic const char *A_DURATION_TWEEN = \"drTW\";\nstatic const char *A_LOOP = \"lp\";\nstatic const char *A_MOVEMENT_SCALE = \"sc\";\nstatic const char *A_MOVEMENT_DELAY = \"dl\";\nstatic const char *A_DISPLAY_INDEX = \"dI\";\n\nstatic const char *A_PLIST = \"plist\";\n\nstatic const char *A_PARENT = \"parent\";\nstatic const char *A_SKEW_X = \"kX\";\nstatic const char *A_SKEW_Y = \"kY\";\nstatic const char *A_SCALE_X = \"cX\";\nstatic const char *A_SCALE_Y = \"cY\";\nstatic const char *A_Z = \"z\";\nstatic const char *A_EVENT = \"evt\";\nstatic const char *A_SOUND = \"sd\";\nstatic const char *A_SOUND_EFFECT = \"sdE\";\nstatic const char *A_TWEEN_EASING = \"twE\";\nstatic const char *A_EASING_PARAM = \"twEP\";\nstatic const char *A_TWEEN_ROTATE = \"twR\";\nstatic const char *A_IS_ARMATURE = \"isArmature\";\nstatic const char *A_DISPLAY_TYPE = \"displayType\";\nstatic const char *A_MOVEMENT = \"mov\";\n\nstatic const char *A_X = \"x\";\nstatic const char *A_Y = \"y\";\n\nstatic const char *A_COCOS2DX_X = \"cocos2d_x\";\nstatic const char *A_COCOS2DX_Y = \"cocos2d_y\";\n\nstatic const char *A_WIDTH = \"width\";\nstatic const char *A_HEIGHT = \"height\";\nstatic const char *A_PIVOT_X = \"pX\";\nstatic const char *A_PIVOT_Y = \"pY\";\n\nstatic const char *A_COCOS2D_PIVOT_X = \"cocos2d_pX\";\nstatic const char *A_COCOS2D_PIVOT_Y = \"cocos2d_pY\";\n\nstatic const char *A_BLEND_TYPE = \"bd\";\nstatic const char *A_BLEND_SRC = \"bd_src\";\nstatic const char *A_BLEND_DST = \"bd_dst\";\n\nstatic const char *A_ALPHA = \"a\";\nstatic const char *A_RED = \"r\";\nstatic const char *A_GREEN = \"g\";\nstatic const char *A_BLUE = \"b\";\nstatic const char *A_ALPHA_OFFSET = \"aM\";\nstatic const char *A_RED_OFFSET = \"rM\";\nstatic const char *A_GREEN_OFFSET = \"gM\";\nstatic const char *A_BLUE_OFFSET = \"bM\";\nstatic const char *A_COLOR_TRANSFORM = \"colorTransform\";\nstatic const char *A_TWEEN_FRAME = \"tweenFrame\";\n\n\n\nstatic const char *CONTOUR = \"con\";\nstatic const char *CONTOUR_VERTEX = \"con_vt\";\n\n\nstatic const char *FL_NAN = \"NaN\";\n\n\nstatic const char *FRAME_DATA = \"frame_data\";\nstatic const char *MOVEMENT_BONE_DATA = \"mov_bone_data\";\nstatic const char *MOVEMENT_DATA = \"mov_data\";\nstatic const char *ANIMATION_DATA = \"animation_data\";\nstatic const char *DISPLAY_DATA = \"display_data\";\nstatic const char *SKIN_DATA = \"skin_data\";\nstatic const char *BONE_DATA = \"bone_data\";\nstatic const char *ARMATURE_DATA = \"armature_data\";\nstatic const char *CONTOUR_DATA = \"contour_data\";\nstatic const char *TEXTURE_DATA = \"texture_data\";\nstatic const char *VERTEX_POINT = \"vertex\";\nstatic const char *COLOR_INFO = \"color\";\n\nstatic const char *CONFIG_FILE_PATH = \"config_file_path\";\nstatic const char *CONTENT_SCALE = \"content_scale\";\n\nnamespace cocostudio {\n\n\n\nfloat s_PositionReadScale = 1;\n\nstd::vector<std::string> DataReaderHelper::_configFileList;\n\nDataReaderHelper *DataReaderHelper::_dataReaderHelper = nullptr;\n\n\n\n//! Async load\nvoid DataReaderHelper::loadData()\n{\n    AsyncStruct *pAsyncStruct = nullptr;\n\n    while (true)\n    {\n        std::queue<AsyncStruct *> *pQueue = _asyncStructQueue;\n        _asyncStructQueueMutex.lock(); // get async struct from queue\n        if (pQueue->empty())\n        {\n            _asyncStructQueueMutex.unlock();\n            if (need_quit)\n            {\n                break;\n            }\n            else\n            {\n\t\t\t\tstd::unique_lock<std::mutex> lk(_sleepMutex);\n\t\t\t\t_sleepCondition.wait(lk);\n                continue;\n            }\n        }\n        else\n        {\n            pAsyncStruct = pQueue->front();\n            pQueue->pop();\n            _asyncStructQueueMutex.unlock();\n        }\n\n        // generate data info\n        DataInfo *pDataInfo = new DataInfo();\n        pDataInfo->asyncStruct = pAsyncStruct;\n        pDataInfo->filename = pAsyncStruct->filename;\n        pDataInfo->baseFilePath = pAsyncStruct->baseFilePath;\n\n        if (pAsyncStruct->configType == DragonBone_XML)\n        {\n            DataReaderHelper::addDataFromCache(pAsyncStruct->fileContent.c_str(), pDataInfo);\n        }\n        else if(pAsyncStruct->configType == CocoStudio_JSON)\n        {\n            DataReaderHelper::addDataFromJsonCache(pAsyncStruct->fileContent.c_str(), pDataInfo);\n        }\n\n        // put the image info into the queue\n        _dataInfoMutex.lock();\n        _dataQueue->push(pDataInfo);\n        _dataInfoMutex.unlock();\n    }\n\n    if( _asyncStructQueue != nullptr )\n    {\n        delete _asyncStructQueue;\n        _asyncStructQueue = nullptr;\n        delete _dataQueue;\n        _dataQueue = nullptr;\n    }\n}\n\n\nDataReaderHelper *DataReaderHelper::getInstance()\n{\n    if(!_dataReaderHelper)\n    {\n        _dataReaderHelper = new DataReaderHelper();\n    }\n\n    return _dataReaderHelper;\n}\n\nvoid DataReaderHelper::setPositionReadScale(float scale)\n{\n    s_PositionReadScale = scale;\n}\n\nfloat DataReaderHelper::getPositionReadScale()\n{\n    return s_PositionReadScale;\n}\n\n\nvoid DataReaderHelper::purge()\n{\n    _configFileList.clear();\n    CC_SAFE_RELEASE_NULL(_dataReaderHelper);\n}\n\n\nDataReaderHelper::DataReaderHelper()\n\t: _loadingThread(nullptr)\n\t, _asyncRefCount(0)\n\t, _asyncRefTotalCount(0)\n\t, need_quit(false)\n\t, _asyncStructQueue(nullptr)\n\t, _dataQueue(nullptr)\n{\n\n}\n\nDataReaderHelper::~DataReaderHelper()\n{\n    need_quit = true;\n\n\t_sleepCondition.notify_one();\n\tif (_loadingThread) _loadingThread->join();\n\n\tCC_SAFE_DELETE(_loadingThread);\n\t_dataReaderHelper = nullptr;\n}\n\nvoid DataReaderHelper::addDataFromFile(const std::string& filePath)\n{\n    /*\n    * Check if file is already added to ArmatureDataManager, if then return.\n    */\n    for(unsigned int i = 0; i < _configFileList.size(); i++)\n    {\n        if (_configFileList[i] == filePath)\n        {\n            return;\n        }\n    }\n    _configFileList.push_back(filePath);\n\n\n    //! find the base file path\n    std::string basefilePath = filePath;\n    size_t pos = basefilePath.find_last_of(\"/\");\n\n    if (pos != std::string::npos)\n    {\n        basefilePath = basefilePath.substr(0, pos + 1);\n    }\n    else\n    {\n        basefilePath = \"\";\n    }\n\n\n    std::string filePathStr =  filePath;\n    size_t startPos = filePathStr.find_last_of(\".\");\n    std::string str = &filePathStr[startPos];\n\n    // Read content from file\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath);\n    std::string contentStr = FileUtils::getInstance()->getStringFromFile(fullPath);\n\n    DataInfo dataInfo;\n    dataInfo.filename = filePathStr;\n    dataInfo.asyncStruct = nullptr;\n    dataInfo.baseFilePath = basefilePath;\n    if (str == \".xml\")\n    {\n        DataReaderHelper::addDataFromCache(contentStr, &dataInfo);\n    }\n    else if(str == \".json\" || str == \".ExportJson\")\n    {\n        DataReaderHelper::addDataFromJsonCache(contentStr, &dataInfo);\n    }\n}\n\nvoid DataReaderHelper::addDataFromFileAsync(const std::string& imagePath, const std::string& plistPath, const std::string& filePath, Object *target, SEL_SCHEDULE selector)\n{\n    /*\n    * Check if file is already added to ArmatureDataManager, if then return.\n    */\n    for(unsigned int i = 0; i < _configFileList.size(); i++)\n    {\n        if (_configFileList[i] == filePath)\n        {\n            if (target && selector)\n            {\n                if (_asyncRefTotalCount == 0 && _asyncRefCount == 0)\n                {\n                    (target->*selector)(1);\n                }\n                else\n                {\n                    (target->*selector)((_asyncRefTotalCount - _asyncRefCount) / (float)_asyncRefTotalCount);\n                }\n            }\n            return;\n        }\n    }\n    _configFileList.push_back(filePath);\n\n    //! find the base file path\n    std::string basefilePath = filePath;\n    size_t pos = basefilePath.find_last_of(\"/\");\n\n    if (pos != std::string::npos)\n    {\n        basefilePath = basefilePath.substr(0, pos + 1);\n    }\n    else\n    {\n        basefilePath = \"\";\n    }\n\n\n    // lazy init\n    if (_asyncStructQueue == nullptr)\n    {\n        _asyncStructQueue = new std::queue<AsyncStruct *>();\n        _dataQueue = new std::queue<DataInfo *>();\n\n\t\t// create a new thread to load images\n\t\t_loadingThread = new std::thread(&DataReaderHelper::loadData, this);\n\n        need_quit = false;\n    }\n\n    if (0 == _asyncRefCount)\n    {\n\t\tDirector::getInstance()->getScheduler()->scheduleSelector(schedule_selector(DataReaderHelper::addDataAsyncCallBack), this, 0, false);\n    }\n\n    ++_asyncRefCount;\n    ++_asyncRefTotalCount;\n\n    if (target)\n    {\n        target->retain();\n    }\n\n    // generate async struct\n    AsyncStruct *data = new AsyncStruct();\n    data->filename = filePath;\n    data->baseFilePath = basefilePath;\n    data->target = target;\n    data->selector = selector;\n    data->autoLoadSpriteFile = ArmatureDataManager::getInstance()->isAutoLoadSpriteFile();\n\n    data->imagePath = imagePath;\n    data->plistPath = plistPath;\n\n    std::string filePathStr =  filePath;\n    size_t startPos = filePathStr.find_last_of(\".\");\n    std::string str = &filePathStr[startPos];\n\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filePath);\n\n    // XXX fileContent is being leaked\n    data->fileContent = FileUtils::getInstance()->getStringFromFile(fullPath);\n\n    if (str == \".xml\")\n    {\n        data->configType = DragonBone_XML;\n    }\n    else if(str == \".json\" || str == \".ExportJson\")\n    {\n        data->configType = CocoStudio_JSON;\n    }\n\n\n    // add async struct into queue\n    _asyncStructQueueMutex.lock();\n    _asyncStructQueue->push(data);\n    _asyncStructQueueMutex.unlock();\n\n    _sleepCondition.notify_one();\n}\n\nvoid DataReaderHelper::addDataAsyncCallBack(float dt)\n{\n    // the data is generated in loading thread\n    std::queue<DataInfo *> *dataQueue = _dataQueue;\n\n    _dataInfoMutex.lock();\n    if (dataQueue->empty())\n    {\n        _dataInfoMutex.unlock();\n    }\n    else\n    {\n        DataInfo *pDataInfo = dataQueue->front();\n        dataQueue->pop();\n        _dataInfoMutex.unlock();\n\n        AsyncStruct *pAsyncStruct = pDataInfo->asyncStruct;\n\n\n        if (pAsyncStruct->imagePath != \"\" && pAsyncStruct->plistPath != \"\")\n        {\n            _getFileMutex.lock();\n            ArmatureDataManager::getInstance()->addSpriteFrameFromFile(pAsyncStruct->plistPath.c_str(), pAsyncStruct->imagePath.c_str());\n            _getFileMutex.unlock();\n        }\n\n        while (!pDataInfo->configFileQueue.empty())\n        {\n            std::string configPath = pDataInfo->configFileQueue.front();\n            _getFileMutex.lock();\n            ArmatureDataManager::getInstance()->addSpriteFrameFromFile((pAsyncStruct->baseFilePath + configPath + \".plist\").c_str(), (pAsyncStruct->baseFilePath + configPath + \".png\").c_str());\n            _getFileMutex.unlock();\n            pDataInfo->configFileQueue.pop();\n        }\n\n\n        Object *target = pAsyncStruct->target;\n        SEL_SCHEDULE selector = pAsyncStruct->selector;\n\n        --_asyncRefCount;\n\n        if (target && selector)\n        {\n            (target->*selector)((_asyncRefTotalCount - _asyncRefCount) / (float)_asyncRefTotalCount);\n            target->release();\n        }\n\n\n        delete pAsyncStruct;\n        delete pDataInfo;\n\n        if (0 == _asyncRefCount)\n        {\n            _asyncRefTotalCount = 0;\n            Director::getInstance()->getScheduler()->unscheduleSelector(schedule_selector(DataReaderHelper::addDataAsyncCallBack), this);\n        }\n    }\n}\n\n\nvoid DataReaderHelper::removeConfigFile(const std::string& configFile)\n{\n    std::vector<std::string>::iterator it = _configFileList.end();\n    for (std::vector<std::string>::iterator i = _configFileList.begin(); i != _configFileList.end(); i++)\n    {\n        if (*i == configFile)\n        {\n            it = i;\n        }\n    }\n\n    if (it != _configFileList.end())\n    {\n        _configFileList.erase(it);\n    }\n}\n\n\n\nvoid DataReaderHelper::addDataFromCache(const std::string& pFileContent, DataInfo *dataInfo)\n{\n    tinyxml2::XMLDocument document;\n    document.Parse(pFileContent.c_str());\n\n    tinyxml2::XMLElement *root = document.RootElement();\n    CCASSERT(root, \"XML error  or  XML is empty.\");\n\n    root->QueryFloatAttribute(VERSION, &dataInfo->flashToolVersion);\n\n\n    /*\n    * Begin decode armature data from xml\n    */\n    tinyxml2::XMLElement *armaturesXML = root->FirstChildElement(ARMATURES);\n    tinyxml2::XMLElement *armatureXML = armaturesXML->FirstChildElement(ARMATURE);\n    while(armatureXML)\n    {\n        ArmatureData *armatureData = DataReaderHelper::decodeArmature(armatureXML, dataInfo);\n\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.lock();\n        }\n        ArmatureDataManager::getInstance()->addArmatureData(armatureData->name.c_str(), armatureData, dataInfo->filename.c_str());\n        armatureData->release();\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.unlock();\n        }\n\n        armatureXML = armatureXML->NextSiblingElement(ARMATURE);\n    }\n\n\n    /*\n    * Begin decode animation data from xml\n    */\n    tinyxml2::XMLElement *animationsXML = root->FirstChildElement(ANIMATIONS);\n    tinyxml2::XMLElement *animationXML = animationsXML->FirstChildElement(ANIMATION);\n    while(animationXML)\n    {\n        AnimationData *animationData = DataReaderHelper::decodeAnimation(animationXML, dataInfo);\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.lock();\n        }\n        ArmatureDataManager::getInstance()->addAnimationData(animationData->name.c_str(), animationData, dataInfo->filename.c_str());\n        animationData->release();\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.unlock();\n        }\n        animationXML = animationXML->NextSiblingElement(ANIMATION);\n    }\n\n\n    /*\n    * Begin decode texture data from xml\n    */\n    tinyxml2::XMLElement *texturesXML = root->FirstChildElement(TEXTURE_ATLAS);\n    tinyxml2::XMLElement *textureXML = texturesXML->FirstChildElement(SUB_TEXTURE);\n    while(textureXML)\n    {\n        TextureData *textureData = DataReaderHelper::decodeTexture(textureXML, dataInfo);\n\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.lock();\n        }\n        ArmatureDataManager::getInstance()->addTextureData(textureData->name.c_str(), textureData, dataInfo->filename.c_str());\n        textureData->release();\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.unlock();\n        }\n        textureXML = textureXML->NextSiblingElement(SUB_TEXTURE);\n    }\n}\n\nArmatureData *DataReaderHelper::decodeArmature(tinyxml2::XMLElement *armatureXML, DataInfo *dataInfo)\n{\n    ArmatureData *armatureData = new ArmatureData();\n    armatureData->init();\n\n    armatureData->name = armatureXML->Attribute(A_NAME);\n\n\n    tinyxml2::XMLElement *boneXML = armatureXML->FirstChildElement(BONE);\n\n    while( boneXML )\n    {\n        /*\n        *  If this bone have parent, then get the parent bone xml\n        */\n        const char *parentName = boneXML->Attribute(A_PARENT);\n        tinyxml2::XMLElement *parentXML = nullptr;\n        if (parentName)\n        {\n            parentXML = armatureXML->FirstChildElement(BONE);\n            std::string parentNameStr = parentName;\n            while (parentXML)\n            {\n                if (parentNameStr == parentXML->Attribute(A_NAME))\n                {\n                    break;\n                }\n                parentXML = parentXML->NextSiblingElement(BONE);\n            }\n        }\n\n        BoneData *boneData = decodeBone(boneXML, parentXML, dataInfo);\n        armatureData->addBoneData(boneData);\n        boneData->release();\n\n        boneXML = boneXML->NextSiblingElement(BONE);\n    }\n\n    return armatureData;\n}\n\nBoneData *DataReaderHelper::decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXml, DataInfo *dataInfo)\n{\n    BoneData *boneData = new BoneData();\n    boneData->init();\n\n    std::string name = boneXML->Attribute(A_NAME);\n    boneData->name = name;\n\n    if( boneXML->Attribute(A_PARENT) != nullptr )\n    {\n        boneData->parentName = boneXML->Attribute(A_PARENT);\n    }\n\n    boneXML->QueryIntAttribute(A_Z, &boneData->zOrder);\n\n    tinyxml2::XMLElement *displayXML = boneXML->FirstChildElement(DISPLAY);\n    while(displayXML)\n    {\n        DisplayData *displayData = decodeBoneDisplay(displayXML, dataInfo);\n        boneData->addDisplayData(displayData);\n        displayData->release();\n\n        displayXML = displayXML->NextSiblingElement(DISPLAY);\n    }\n\n    return boneData;\n}\n\nDisplayData *DataReaderHelper::decodeBoneDisplay(tinyxml2::XMLElement *displayXML, DataInfo *dataInfo)\n{\n    int _isArmature = 0;\n\n    DisplayData *displayData;\n\n    if( displayXML->QueryIntAttribute(A_IS_ARMATURE, &(_isArmature)) == tinyxml2::XML_SUCCESS )\n    {\n        if(!_isArmature)\n        {\n            displayData = new SpriteDisplayData();\n            displayData->displayType  = CS_DISPLAY_SPRITE;\n        }\n        else\n        {\n            displayData = new ArmatureDisplayData();\n            displayData->displayType  = CS_DISPLAY_ARMATURE;\n        }\n\n    }\n    else\n    {\n        displayData = new SpriteDisplayData();\n        displayData->displayType  = CS_DISPLAY_SPRITE;\n    }\n\n\n    if(displayXML->Attribute(A_NAME) != nullptr )\n    {\n        if(!_isArmature)\n        {\n            ((SpriteDisplayData *)displayData)->displayName = displayXML->Attribute(A_NAME);\n        }\n        else\n        {\n            ((ArmatureDisplayData *)displayData)->displayName = displayXML->Attribute(A_NAME);\n        }\n\n    }\n\n    return displayData;\n}\n\nAnimationData *DataReaderHelper::decodeAnimation(tinyxml2::XMLElement *animationXML, DataInfo *dataInfo)\n{\n    AnimationData *aniData =  new AnimationData();\n\n    const char\t*name = animationXML->Attribute(A_NAME);\n\n    ArmatureData *armatureData = ArmatureDataManager::getInstance()->getArmatureData(name);\n\n    aniData->name = name;\n\n    tinyxml2::XMLElement *movementXML = animationXML->FirstChildElement(MOVEMENT);\n\n    while( movementXML )\n    {\n        MovementData *movementData = decodeMovement(movementXML, armatureData, dataInfo);\n        aniData->addMovement(movementData);\n        movementData->release();\n\n        movementXML = movementXML->NextSiblingElement(MOVEMENT);\n\n    }\n\n    return aniData;\n}\n\nMovementData *DataReaderHelper::decodeMovement(tinyxml2::XMLElement *movementXML, ArmatureData *armatureData, DataInfo *dataInfo)\n{\n    MovementData *movementData = new MovementData();\n\n    const char *movName = movementXML->Attribute(A_NAME);\n    movementData->name = movName;\n\n\n    int duration, durationTo, durationTween, loop, tweenEasing = 0;\n\n    if( movementXML->QueryIntAttribute(A_DURATION, &(duration)) == tinyxml2::XML_SUCCESS)\n    {\n        movementData->duration  = duration;\n    }\n    if( movementXML->QueryIntAttribute(A_DURATION_TO, &(durationTo)) == tinyxml2::XML_SUCCESS)\n    {\n        movementData->durationTo = durationTo;\n    }\n    if( movementXML->QueryIntAttribute(A_DURATION_TWEEN, &(durationTween)) == tinyxml2::XML_SUCCESS)\n    {\n        movementData->durationTween = durationTween;\n    }\n    if( movementXML->QueryIntAttribute(A_LOOP, &(loop)) == tinyxml2::XML_SUCCESS)\n    {\n        movementData->loop = (loop != 0);\n    }\n\n    const char *_easing = movementXML->Attribute(A_TWEEN_EASING);\n    if(_easing != nullptr)\n    {\n        std::string str = _easing;\n        if(str != FL_NAN)\n        {\n            if( movementXML->QueryIntAttribute(A_TWEEN_EASING, &(tweenEasing)) == tinyxml2::XML_SUCCESS)\n            {\n                movementData->tweenEasing = tweenEasing == 2 ? Sine_EaseInOut : (TweenType)tweenEasing;\n            }\n        }\n        else\n        {\n            movementData->tweenEasing  = Linear;\n        }\n    }\n\n    tinyxml2::XMLElement *movBoneXml = movementXML->FirstChildElement(BONE);\n    while(movBoneXml)\n    {\n        const char *boneName = movBoneXml->Attribute(A_NAME);\n\n        if (movementData->getMovementBoneData(boneName))\n        {\n            movBoneXml = movBoneXml->NextSiblingElement();\n            continue;\n        }\n\n\n        BoneData *boneData = (BoneData *)armatureData->getBoneData(boneName);\n\n        std::string parentName = boneData->parentName;\n\n\n        tinyxml2::XMLElement *parentXml = nullptr;\n        if (parentName.length() != 0)\n        {\n            parentXml = movementXML->FirstChildElement(BONE);\n\n            while (parentXml)\n            {\n                if (parentName == parentXml->Attribute(A_NAME))\n                {\n                    break;\n                }\n                parentXml = parentXml->NextSiblingElement(BONE);\n            }\n        }\n\n        MovementBoneData *moveBoneData = decodeMovementBone(movBoneXml, parentXml, boneData, dataInfo);\n        movementData->addMovementBoneData(moveBoneData);\n        moveBoneData->release();\n\n        movBoneXml = movBoneXml->NextSiblingElement(BONE);\n    }\n\n    return movementData;\n}\n\n\nMovementBoneData *DataReaderHelper::decodeMovementBone(tinyxml2::XMLElement *movBoneXml, tinyxml2::XMLElement *parentXml, BoneData *boneData, DataInfo *dataInfo)\n{\n    MovementBoneData *movBoneData = new MovementBoneData();\n    movBoneData->init();\n\n    float scale, delay;\n\n    if( movBoneXml )\n    {\n        if( movBoneXml->QueryFloatAttribute(A_MOVEMENT_SCALE, &scale) == tinyxml2::XML_SUCCESS )\n        {\n            movBoneData->scale = scale;\n        }\n        if( movBoneXml->QueryFloatAttribute(A_MOVEMENT_DELAY, &delay) == tinyxml2::XML_SUCCESS )\n        {\n            if(delay > 0)\n            {\n                delay -= 1;\n            }\n            movBoneData->delay = delay;\n        }\n    }\n\n    unsigned long length = 0;\n    unsigned long index = 0;\n    int parentTotalDuration = 0;\n    int currentDuration = 0;\n\n    tinyxml2::XMLElement *parentFrameXML = nullptr;\n\n    std::vector<tinyxml2::XMLElement *> parentXmlList;\n\n    /*\n    *  get the parent frame xml list, we need get the origin data\n    */\n    if( parentXml != nullptr )\n    {\n        parentFrameXML = parentXml->FirstChildElement(FRAME);\n        while (parentFrameXML)\n        {\n            parentXmlList.push_back(parentFrameXML);\n            parentFrameXML = parentFrameXML->NextSiblingElement(FRAME);\n        }\n\n        parentFrameXML = nullptr;\n\n        length = parentXmlList.size();\n    }\n\n\n    int totalDuration = 0;\n\n    std::string name = movBoneXml->Attribute(A_NAME);\n\n    movBoneData->name = name;\n\n    tinyxml2::XMLElement *frameXML = movBoneXml->FirstChildElement(FRAME);\n\n    while( frameXML )\n    {\n        if(parentXml)\n        {\n            /*\n            *  in this loop we get the corresponding parent frame xml\n            */\n            while(index < length && (parentFrameXML ? (totalDuration < parentTotalDuration || totalDuration >= parentTotalDuration + currentDuration) : true))\n            {\n                parentFrameXML = parentXmlList[index];\n                parentTotalDuration += currentDuration;\n                parentFrameXML->QueryIntAttribute(A_DURATION, &currentDuration);\n                index++;\n            }\n        }\n\n        FrameData *frameData = decodeFrame( frameXML, parentFrameXML, boneData, dataInfo);\n        movBoneData->addFrameData(frameData);\n        frameData->release();\n\n        frameData->frameID = totalDuration;\n        totalDuration += frameData->duration;\n        movBoneData->duration = totalDuration;\n\n        frameXML = frameXML->NextSiblingElement(FRAME);\n    }\n\n    \n\t//! Change rotation range from (-180 -- 180) to (-infinity -- infinity)\n\tauto frames = movBoneData->frameList;\n\tfor (long j = movBoneData->frameList.size() - 1; j >= 0; j--)\n\t{\n\t\tif (j > 0)\n\t\t{\n\t\t\tfloat difSkewX = frames.at(j)->skewX -  frames.at(j-1)->skewX;\n\t\t\tfloat difSkewY = frames.at(j)->skewY -  frames.at(j-1)->skewY;\n\n\t\t\tif (difSkewX < -M_PI || difSkewX > M_PI)\n\t\t\t{\n\t\t\t\tframes.at(j-1)->skewX = difSkewX < 0 ? frames.at(j-1)->skewX - 2 * M_PI : frames.at(j-1)->skewX + 2 * M_PI;\n\t\t\t}\n\n\t\t\tif (difSkewY < -M_PI || difSkewY > M_PI)\n\t\t\t{\n\t\t\t\tframes.at(j-1)->skewY = difSkewY < 0 ? frames.at(j-1)->skewY - 2 * M_PI : frames.at(j-1)->skewY + 2 * M_PI;\n\t\t\t}\n\t\t}\n\t}\n\n\n    //\n    FrameData *frameData = new FrameData();\n    frameData->copy((FrameData *)movBoneData->frameList.back());\n    frameData->frameID = movBoneData->duration;\n    movBoneData->addFrameData(frameData);\n    frameData->release();\n\n    return movBoneData;\n}\n\nFrameData *DataReaderHelper::decodeFrame(tinyxml2::XMLElement *frameXML,  tinyxml2::XMLElement *parentFrameXml, BoneData *boneData, DataInfo *dataInfo)\n{\n    float x = 0, y = 0, scale_x = 0, scale_y = 0, skew_x = 0, skew_y = 0, tweenRotate = 0;\n    int duration = 0, displayIndex = 0, zOrder = 0, tweenEasing = 0, blendType = 0;\n\n    FrameData *frameData = new FrameData();\n\n    if(frameXML->Attribute(A_MOVEMENT) != nullptr)\n    {\n        frameData->strMovement = frameXML->Attribute(A_MOVEMENT);\n    }\n    if(frameXML->Attribute(A_EVENT) != nullptr)\n    {\n        frameData->strEvent = frameXML->Attribute(A_EVENT);\n    }\n    if(frameXML->Attribute(A_SOUND) != nullptr)\n    {\n        frameData->strSound = frameXML->Attribute(A_SOUND);\n    }\n    if(frameXML->Attribute(A_SOUND_EFFECT) != nullptr)\n    {\n        frameData->strSoundEffect = frameXML->Attribute(A_SOUND_EFFECT);\n    }\n\n    bool tweenFrame = false;\n    if (frameXML->QueryBoolAttribute(A_TWEEN_FRAME, &tweenFrame) == tinyxml2::XML_SUCCESS)\n    {\n        frameData->isTween = tweenFrame;\n    }\n\n\n    if (dataInfo->flashToolVersion >= VERSION_2_0)\n    {\n        if(frameXML->QueryFloatAttribute(A_COCOS2DX_X, &x) == tinyxml2::XML_SUCCESS)\n        {\n            frameData->x = x;\n            frameData->x *= s_PositionReadScale;\n        }\n        if(frameXML->QueryFloatAttribute(A_COCOS2DX_Y, &y) == tinyxml2::XML_SUCCESS)\n        {\n            frameData->y = -y;\n            frameData->y *= s_PositionReadScale;\n        }\n    }\n    else\n    {\n        if(frameXML->QueryFloatAttribute(A_X, &x) == tinyxml2::XML_SUCCESS)\n        {\n            frameData->x = x;\n            frameData->x *= s_PositionReadScale;\n        }\n        if(frameXML->QueryFloatAttribute(A_Y, &y) == tinyxml2::XML_SUCCESS)\n        {\n            frameData->y = -y;\n            frameData->y *= s_PositionReadScale;\n        }\n    }\n\n    if( frameXML->QueryFloatAttribute(A_SCALE_X, &scale_x) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->scaleX = scale_x;\n    }\n    if( frameXML->QueryFloatAttribute(A_SCALE_Y, &scale_y) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->scaleY = scale_y;\n    }\n    if( frameXML->QueryFloatAttribute(A_SKEW_X, &skew_x) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->skewX = CC_DEGREES_TO_RADIANS(skew_x);\n    }\n    if( frameXML->QueryFloatAttribute(A_SKEW_Y, &skew_y) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->skewY = CC_DEGREES_TO_RADIANS(-skew_y);\n    }\n    if( frameXML->QueryIntAttribute(A_DURATION, &duration) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->duration = duration;\n    }\n    if(  frameXML->QueryIntAttribute(A_DISPLAY_INDEX, &displayIndex) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->displayIndex = displayIndex;\n    }\n    if(  frameXML->QueryIntAttribute(A_Z, &zOrder) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->zOrder = zOrder;\n    }\n    if(  frameXML->QueryFloatAttribute(A_TWEEN_ROTATE, &tweenRotate) == tinyxml2::XML_SUCCESS )\n    {\n        frameData->tweenRotate = tweenRotate;\n    }\n    if (  frameXML->QueryIntAttribute(A_BLEND_TYPE, &blendType) == tinyxml2::XML_SUCCESS )\n    {\n        switch (blendType)\n        {\n        case BLEND_NORMAL:\n            {\n                frameData->blendFunc = BlendFunc::ALPHA_NON_PREMULTIPLIED;\n            }\n            break;\n        case BLEND_ADD:\n            {\n                frameData->blendFunc.src = GL_SRC_ALPHA;\n                frameData->blendFunc.dst = GL_ONE;\n            }\n            break;\n        case BLEND_MULTIPLY:\n            {\n                frameData->blendFunc.src = GL_DST_COLOR;\n                frameData->blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;\n            }\n            break;\n        case BLEND_SCREEN:\n            {\n                frameData->blendFunc.src = GL_ONE;\n                frameData->blendFunc.dst = GL_ONE_MINUS_SRC_COLOR;\n            }\n            break;\n        default:\n            {\n                frameData->blendFunc.src = CC_BLEND_SRC;\n                frameData->blendFunc.dst = CC_BLEND_DST;\n            }\n            break;\n        }\n    }\n\n    tinyxml2::XMLElement *colorTransformXML = frameXML->FirstChildElement(A_COLOR_TRANSFORM);\n    if (colorTransformXML)\n    {\n        int alpha, red, green, blue = 100;\n        int alphaOffset, redOffset, greenOffset, blueOffset = 0;\n\n        colorTransformXML->QueryIntAttribute(A_ALPHA, &alpha);\n        colorTransformXML->QueryIntAttribute(A_RED, &red);\n        colorTransformXML->QueryIntAttribute(A_GREEN, &green);\n        colorTransformXML->QueryIntAttribute(A_BLUE, &blue) ;\n\n        colorTransformXML->QueryIntAttribute(A_ALPHA_OFFSET, &alphaOffset);\n        colorTransformXML->QueryIntAttribute(A_RED_OFFSET, &redOffset);\n        colorTransformXML->QueryIntAttribute(A_GREEN_OFFSET, &greenOffset);\n        colorTransformXML->QueryIntAttribute(A_BLUE_OFFSET, &blueOffset) ;\n\n        frameData->a = 2.55 * alphaOffset + alpha;\n        frameData->r = 2.55 * redOffset + red;\n        frameData->g = 2.55 * greenOffset + green;\n        frameData->b = 2.55 * blueOffset + blue;\n\n        frameData->isUseColorInfo = true;\n    }\n\n\n    const char *_easing = frameXML->Attribute(A_TWEEN_EASING);\n    if(_easing != nullptr)\n    {\n        std::string str = _easing;\n        if(str != FL_NAN)\n        {\n            if( frameXML->QueryIntAttribute(A_TWEEN_EASING, &(tweenEasing)) == tinyxml2::XML_SUCCESS)\n            {\n                frameData->tweenEasing = tweenEasing == 2 ? Sine_EaseInOut : (TweenType)tweenEasing;\n            }\n        }\n        else\n        {\n            frameData->tweenEasing  = Linear;\n        }\n    }\n\n    if(parentFrameXml)\n    {\n        /*\n        *  recalculate frame data from parent frame data, use for translate matrix\n        */\n        BaseData helpNode;\n        if (dataInfo->flashToolVersion >= VERSION_2_0)\n        {\n            parentFrameXml->QueryFloatAttribute(A_COCOS2DX_X, &helpNode.x);\n            parentFrameXml->QueryFloatAttribute(A_COCOS2DX_Y, &helpNode.y);\n        }\n        else\n        {\n            parentFrameXml->QueryFloatAttribute(A_X, &helpNode.x);\n            parentFrameXml->QueryFloatAttribute(A_Y, &helpNode.y);\n        }\n\n\n        parentFrameXml->QueryFloatAttribute(A_SKEW_X, &helpNode.skewX);\n        parentFrameXml->QueryFloatAttribute(A_SKEW_Y, &helpNode.skewY);\n\n        helpNode.y = -helpNode.y;\n        helpNode.skewX = CC_DEGREES_TO_RADIANS(helpNode.skewX);\n        helpNode.skewY = CC_DEGREES_TO_RADIANS(-helpNode.skewY);\n\n        TransformHelp::transformFromParent(*frameData, helpNode);\n    }\n    return frameData;\n}\n\nTextureData *DataReaderHelper::decodeTexture(tinyxml2::XMLElement *textureXML, DataInfo *dataInfo)\n{\n    TextureData *textureData = new TextureData();\n    textureData->init();\n\n    if( textureXML->Attribute(A_NAME) != nullptr)\n    {\n        textureData->name = textureXML->Attribute(A_NAME);\n    }\n\n    float px, py, width, height = 0;\n\n    if(dataInfo->flashToolVersion >= VERSION_2_0)\n    {\n        textureXML->QueryFloatAttribute(A_COCOS2D_PIVOT_X, &px);\n        textureXML->QueryFloatAttribute(A_COCOS2D_PIVOT_Y, &py);\n    }\n    else\n    {\n        textureXML->QueryFloatAttribute(A_PIVOT_X, &px);\n        textureXML->QueryFloatAttribute(A_PIVOT_Y, &py);\n    }\n\n    textureXML->QueryFloatAttribute(A_WIDTH, &width);\n    textureXML->QueryFloatAttribute(A_HEIGHT, &height);\n\n    float anchorPointX = px / width;\n    float anchorPointY = (height - py) / height;\n\n    textureData->pivotX = anchorPointX;\n    textureData->pivotY = anchorPointY;\n\n    tinyxml2::XMLElement *contourXML = textureXML->FirstChildElement(CONTOUR);\n\n    while (contourXML)\n    {\n        ContourData *contourData = decodeContour(contourXML, dataInfo);\n        textureData->addContourData(contourData);\n        contourData->release();\n\n        contourXML = contourXML->NextSiblingElement(CONTOUR);\n    }\n\n    return textureData;\n}\n\nContourData *DataReaderHelper::decodeContour(tinyxml2::XMLElement *contourXML, DataInfo *dataInfo)\n{\n    ContourData *contourData = new ContourData();\n    contourData->init();\n\n    tinyxml2::XMLElement *vertexDataXML = contourXML->FirstChildElement(CONTOUR_VERTEX);\n\n    while (vertexDataXML)\n    {\n        Point vertex;\n\n        vertexDataXML->QueryFloatAttribute(A_X, &vertex.x);\n        vertexDataXML->QueryFloatAttribute(A_Y, &vertex.y);\n\n        vertex.y = -vertex.y;\n        contourData->vertexList.push_back(vertex);\n\n        vertexDataXML = vertexDataXML->NextSiblingElement(CONTOUR_VERTEX);\n    }\n\n    return contourData;\n}\n\n\n\nvoid DataReaderHelper::addDataFromJsonCache(const std::string& fileContent, DataInfo *dataInfo)\n{\n\trapidjson::Document json;\n\t\n\tjson.Parse<0>(fileContent.c_str());\n    if (json.HasParseError()) {\n        CCLOG(\"GetParseError %s\\n\",json.GetParseError());\n    }\n\t\n\tdataInfo->contentScale = DICTOOL->getFloatValue_json(json, CONTENT_SCALE, 1.0f);\n\t\n    // Decode armatures\n\tint length = DICTOOL->getArrayCount_json(json, ARMATURE_DATA);\n\tfor (int i = 0; i < length; i++)\n    {\n\t\tconst rapidjson::Value &armatureDic = DICTOOL->getSubDictionary_json(json, ARMATURE_DATA, i); \n        ArmatureData *armatureData = decodeArmature(armatureDic, dataInfo);\n\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.lock();\n        }\n        ArmatureDataManager::getInstance()->addArmatureData(armatureData->name.c_str(), armatureData);\n        armatureData->release();\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.unlock();\n        }\n    }\n\n    // Decode animations\n\tlength = DICTOOL->getArrayCount_json(json, ANIMATION_DATA); //json[ANIMATION_DATA].IsNull() ? 0 : json[ANIMATION_DATA].Size();\n    for (int i = 0; i < length; i++)\n    {\n\t\tconst rapidjson::Value &animationDic = DICTOOL->getSubDictionary_json(json, ANIMATION_DATA, i);\n        AnimationData *animationData = decodeAnimation(animationDic, dataInfo);\n\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.lock();\n        }\n        ArmatureDataManager::getInstance()->addAnimationData(animationData->name.c_str(), animationData);\n        animationData->release();\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.unlock();\n        }\n    }\n\n    // Decode textures\n    length = DICTOOL->getArrayCount_json(json, TEXTURE_DATA); \n    for (int i = 0; i < length; i++)\n    {\n        const rapidjson::Value &textureDic =  DICTOOL->getSubDictionary_json(json, TEXTURE_DATA, i);\n        TextureData *textureData = decodeTexture(textureDic);\n\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.lock();\n        }\n        ArmatureDataManager::getInstance()->addTextureData(textureData->name.c_str(), textureData);\n        textureData->release();\n        if (dataInfo->asyncStruct)\n        {\n            _dataReaderHelper->_addDataMutex.unlock();\n        }\n    }\n\n    // Auto load sprite file\n    bool autoLoad = dataInfo->asyncStruct == nullptr ? ArmatureDataManager::getInstance()->isAutoLoadSpriteFile() : dataInfo->asyncStruct->autoLoadSpriteFile;\n    if (autoLoad)\n    {\n        length =  DICTOOL->getArrayCount_json(json, CONFIG_FILE_PATH); // json[CONFIG_FILE_PATH].IsNull() ? 0 : json[CONFIG_FILE_PATH].Size();\n        for (int i = 0; i < length; i++)\n        {\n\t\t\tconst char *path = DICTOOL->getStringValueFromArray_json(json, CONFIG_FILE_PATH, i); // json[CONFIG_FILE_PATH][i].IsNull() ? NULL : json[CONFIG_FILE_PATH][i].GetString();\n            if (path == nullptr)\n            {\n                CCLOG(\"load CONFIG_FILE_PATH error.\");\n                return;\n            }\n\n            std::string filePath = path;\n            filePath = filePath.erase(filePath.find_last_of(\".\"));\n\n            if (dataInfo->asyncStruct)\n            {\n                dataInfo->configFileQueue.push(filePath);\n            }\n            else\n            {\n                std::string plistPath = filePath + \".plist\";\n                std::string pngPath =  filePath + \".png\";\n\n                ArmatureDataManager::getInstance()->addSpriteFrameFromFile((dataInfo->baseFilePath + plistPath).c_str(), (dataInfo->baseFilePath + pngPath).c_str());\n            }\n        }\n    }\n}\n\nArmatureData *DataReaderHelper::decodeArmature(const rapidjson::Value& json, DataInfo *dataInfo)\n{\n    ArmatureData *armatureData = new ArmatureData();\n    armatureData->init();\n\n\tconst char *name = DICTOOL->getStringValue_json(json, A_NAME);\n    if(name != nullptr)\n    {\n        armatureData->name = name;\n    }\n\n\tdataInfo->cocoStudioVersion = armatureData->dataVersion = DICTOOL->getFloatValue_json(json, VERSION, 0.1f);\n\n\tint length = DICTOOL->getArrayCount_json(json, BONE_DATA, 0); \n    for (int i = 0; i < length; i++)\n    {\n        const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, BONE_DATA, i); //json[BONE_DATA][i];\n        BoneData *boneData = decodeBone(dic, dataInfo);\n        armatureData->addBoneData(boneData);\n        boneData->release();\n\n    }\n\n    return armatureData;\n}\n\nBoneData *DataReaderHelper::decodeBone(const rapidjson::Value& json, DataInfo *dataInfo)\n{\n    BoneData *boneData = new BoneData();\n    boneData->init();\n\n    decodeNode(boneData, json, dataInfo);\n\n\tconst char *str = DICTOOL->getStringValue_json(json, A_NAME);\n    if(str != nullptr)\n    {\n        boneData->name = str;\n    }\n\n    str = DICTOOL->getStringValue_json(json, A_PARENT);\n    if(str != nullptr)\n    {\n        boneData->parentName = str;\n    }\n\n\tint length = DICTOOL->getArrayCount_json(json, DISPLAY_DATA);\n\n    for (int i = 0; i < length; i++)\n    {\n        const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, DISPLAY_DATA, i); \n        DisplayData *displayData = decodeBoneDisplay(dic, dataInfo);\n        boneData->addDisplayData(displayData);\n        displayData->release();\n\n    }\n\n    return boneData;\n}\n\nDisplayData *DataReaderHelper::decodeBoneDisplay(const rapidjson::Value& json, DataInfo *dataInfo)\n{\n\tDisplayType displayType =  (DisplayType)(DICTOOL->getIntValue_json(json, A_DISPLAY_TYPE, CS_DISPLAY_SPRITE));\n\n    DisplayData *displayData = nullptr;\n\n    switch (displayType)\n    {\n    case CS_DISPLAY_SPRITE:\n    {\n        displayData = new SpriteDisplayData();\n\n\t\tconst char *name =  DICTOOL->getStringValue_json(json, A_NAME);\n        if(name != NULL)\n        {\n            ((SpriteDisplayData *)displayData)->displayName = name;\n        }\n\t\tconst rapidjson::Value &dicArray = DICTOOL->getSubDictionary_json(json, SKIN_DATA);\n\t\tif(!dicArray.IsNull())\n\t\t{\n\t\t\trapidjson::SizeType index = 0;\n\t\t\tconst rapidjson::Value &dic = DICTOOL->getSubDictionary_json(dicArray, index);\n\t\t\tif (!dic.IsNull())\n\t\t\t{\n\t\t\t\tSpriteDisplayData *sdd = (SpriteDisplayData *)displayData;\n\t\t\t\tsdd->skinData.x = DICTOOL->getFloatValue_json(dic, A_X) * s_PositionReadScale;\n\t\t\t\tsdd->skinData.y = DICTOOL->getFloatValue_json(dic, A_Y) * s_PositionReadScale;\n\t\t\t\tsdd->skinData.scaleX = DICTOOL->getFloatValue_json(dic, A_SCALE_X, 1.0f);\n\t\t\t\tsdd->skinData.scaleY = DICTOOL->getFloatValue_json(dic, A_SCALE_Y, 1.0f);\n\t\t\t\tsdd->skinData.skewX = DICTOOL->getFloatValue_json(dic, A_SKEW_X, 1.0f);\n\t\t\t\tsdd->skinData.skewY = DICTOOL->getFloatValue_json(dic, A_SKEW_Y, 1.0f);\n\n                sdd->skinData.x *= dataInfo->contentScale;\n                sdd->skinData.y *= dataInfo->contentScale;\n\t\t\t}\n        }\n    }\n\n    break;\n    case CS_DISPLAY_ARMATURE:\n    {\n        displayData = new ArmatureDisplayData();\n\n        const char *name = DICTOOL->getStringValue_json(json, A_NAME);\n        if(name != nullptr)\n        {\n            ((ArmatureDisplayData *)displayData)->displayName = name;\n        }\n    }\n    break;\n    case CS_DISPLAY_PARTICLE:\n    {\n        displayData = new ParticleDisplayData();\n\n        const char *plist = DICTOOL->getStringValue_json(json, A_PLIST);\n        if(plist != nullptr)\n        {\n            if (dataInfo->asyncStruct)\n            {\n                static_cast<ParticleDisplayData *>(displayData)->displayName = dataInfo->asyncStruct->baseFilePath + plist;\n            }\n            else\n            {\n                static_cast<ParticleDisplayData *>(displayData)->displayName = dataInfo->baseFilePath + plist;\n            }\n        }\n    }\n    break;\n    default:\n        displayData = new SpriteDisplayData();\n\n        break;\n    }\n\n\n    displayData->displayType = displayType;\n\n    return displayData;\n}\n\nAnimationData *DataReaderHelper::decodeAnimation(const rapidjson::Value& json, DataInfo *dataInfo)\n{\n    AnimationData *aniData = new AnimationData();\n\n    const char *name = DICTOOL->getStringValue_json(json, A_NAME);\n    if(name != nullptr)\n    {\n        aniData->name = name;\n    }\n\n    int length =  DICTOOL->getArrayCount_json(json, MOVEMENT_DATA);\n\n    for (int i = 0; i < length; i++)\n    {\n        const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, MOVEMENT_DATA, i);\n        MovementData *movementData = decodeMovement(dic, dataInfo);\n        aniData->addMovement(movementData);\n        movementData->release();\n\n    }\n\n    return aniData;\n}\n\nMovementData *DataReaderHelper::decodeMovement(const rapidjson::Value& json, DataInfo *dataInfo)\n{\n    MovementData *movementData = new MovementData();\n\n\tmovementData->loop = DICTOOL->getBooleanValue_json(json, A_LOOP, true);\n\tmovementData->durationTween = DICTOOL->getIntValue_json(json, A_DURATION_TWEEN, 0);\n    movementData->durationTo = DICTOOL->getIntValue_json(json, A_DURATION_TO, 0);\n    movementData->duration = DICTOOL->getIntValue_json(json, A_DURATION, 0);\n    if (!DICTOOL->checkObjectExist_json(json, A_DURATION))\n    {\n        movementData->scale = 1.0f;\n    }\n    else\n    {\n        movementData->scale = DICTOOL->getFloatValue_json(json, A_MOVEMENT_SCALE, 1.0f);\n    }\n\tmovementData->tweenEasing =  (TweenType)(DICTOOL->getIntValue_json(json, A_TWEEN_EASING, Linear));\n\n    const char *name = DICTOOL->getStringValue_json(json, A_NAME);\n    if(name != nullptr)\n    {\n        movementData->name = name;\n    }\n\n\tint length = DICTOOL->getArrayCount_json(json, MOVEMENT_BONE_DATA);\n    for (int i = 0; i < length; i++)\n    {\n\t\tconst rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, MOVEMENT_BONE_DATA, i);\n        MovementBoneData *movementBoneData = decodeMovementBone(dic, dataInfo);\n        movementData->addMovementBoneData(movementBoneData);\n        movementBoneData->release();\n    }\n\n    return movementData;\n}\n\nMovementBoneData *DataReaderHelper::decodeMovementBone(const rapidjson::Value& json, DataInfo *dataInfo)\n{\n    MovementBoneData *movementBoneData = new MovementBoneData();\n    movementBoneData->init();\n\n\tmovementBoneData->delay = DICTOOL->getFloatValue_json(json, A_MOVEMENT_DELAY);\n\n    const char *name = DICTOOL->getStringValue_json(json, A_NAME);\n    if(name != nullptr)\n    {\n        movementBoneData->name = name;\n    }\n\n\trapidjson::SizeType length = DICTOOL->getArrayCount_json(json, FRAME_DATA);\n    for (rapidjson::SizeType i = 0; i < length; i++)\n    {\n        const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, FRAME_DATA, i);\n        FrameData *frameData = decodeFrame(dic, dataInfo);\n\n        movementBoneData->addFrameData(frameData);\n        frameData->release();\n\n        if (dataInfo->cocoStudioVersion < VERSION_COMBINED)\n        {\n            frameData->frameID = movementBoneData->duration;\n            movementBoneData->duration += frameData->duration;\n        }\n    }\n\n\n\tif (dataInfo->cocoStudioVersion < VERSION_CHANGE_ROTATION_RANGE)\n\t{\n\t\t//! Change rotation range from (-180 -- 180) to (-infinity -- infinity)\n\t\tauto frames = movementBoneData->frameList;\n\t\tfor (long i = frames.size() - 1; i >= 0; i--)\n\t\t{\n\t\t\tif (i > 0)\n\t\t\t{\n\t\t\t\tfloat difSkewX = frames.at(i)->skewX -  frames.at(i-1)->skewX;\n\t\t\t\tfloat difSkewY = frames.at(i)->skewY -  frames.at(i-1)->skewY;\n\n\t\t\t\tif (difSkewX < -M_PI || difSkewX > M_PI)\n\t\t\t\t{\n\t\t\t\t\tframes.at(i-1)->skewX = difSkewX < 0 ? frames.at(i-1)->skewX - 2 * M_PI : frames.at(i-1)->skewX + 2 * M_PI;\n\t\t\t\t}\n\n\t\t\t\tif (difSkewY < -M_PI || difSkewY > M_PI)\n\t\t\t\t{\n\t\t\t\t\tframes.at(i-1)->skewY = difSkewY < 0 ? frames.at(i-1)->skewY - 2 * M_PI : frames.at(i-1)->skewY + 2 * M_PI;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n    if (dataInfo->cocoStudioVersion < VERSION_COMBINED)\n    {\n        if (movementBoneData->frameList.size() > 0)\n        {\n            FrameData *frameData = new FrameData();\n            frameData->copy((FrameData *)movementBoneData->frameList.back());\n            movementBoneData->addFrameData(frameData);\n            frameData->release();\n\n            frameData->frameID = movementBoneData->duration;\n        }\n    }\n\n    return movementBoneData;\n}\n\nFrameData *DataReaderHelper::decodeFrame(const rapidjson::Value& json, DataInfo *dataInfo)\n{\n    FrameData *frameData = new FrameData();\n\n    decodeNode(frameData, json, dataInfo);\n\n\tframeData->tweenEasing = (TweenType)(DICTOOL->getIntValue_json(json, A_TWEEN_EASING, Linear));\n\tframeData->displayIndex = DICTOOL->getIntValue_json(json, A_DISPLAY_INDEX);\n\tframeData->blendFunc.src = (GLenum)(DICTOOL->getIntValue_json(json, A_BLEND_SRC, BlendFunc::ALPHA_NON_PREMULTIPLIED.src));\n\tframeData->blendFunc.dst = (GLenum)(DICTOOL->getIntValue_json(json, A_BLEND_DST, BlendFunc::ALPHA_NON_PREMULTIPLIED.dst));\n\tframeData->isTween = DICTOOL->getBooleanValue_json(json, A_TWEEN_FRAME, true);\n\n\tconst char *event =  DICTOOL->getStringValue_json(json, A_EVENT);\n    if (event != nullptr)\n    {\n        frameData->strEvent = event;\n    }\n\n    if (dataInfo->cocoStudioVersion < VERSION_COMBINED)\n    {\n\t\tframeData->duration = DICTOOL->getIntValue_json(json, A_DURATION, 1);\n    }\n    else\n    {\n        frameData->frameID = DICTOOL->getIntValue_json(json, A_FRAME_INDEX);\n    }\n\n\n    int length = DICTOOL->getArrayCount_json(json, A_EASING_PARAM);\n    if (length != 0)\n    {\n        frameData->easingParams = new float[length];\n        \n        for (int i = 0; i < length; i++)\n        {\n            frameData->easingParams[i] = DICTOOL->getFloatValueFromArray_json(json, A_EASING_PARAM, i);\n        }\n    }\n\n    return frameData;\n}\n\nTextureData *DataReaderHelper::decodeTexture(const rapidjson::Value& json)\n{\n    TextureData *textureData = new TextureData();\n    textureData->init();\n\n\tconst char *name = DICTOOL->getStringValue_json(json, A_NAME);\n    if(name != nullptr)\n    {\n        textureData->name = name;\n    }\n\n\ttextureData->width = DICTOOL->getFloatValue_json(json, A_WIDTH);\n    textureData->height = DICTOOL->getFloatValue_json(json, A_HEIGHT);\n    textureData->pivotX = DICTOOL->getFloatValue_json(json, A_PIVOT_X);\n    textureData->pivotY = DICTOOL->getFloatValue_json(json, A_PIVOT_Y);\n\n\tint length = DICTOOL->getArrayCount_json(json, CONTOUR_DATA);\n    for (int i = 0; i < length; i++)\n    {\n        const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, CONTOUR_DATA, i);\n        ContourData *contourData = decodeContour(dic);\n        textureData->contourDataList.pushBack(contourData);\n        contourData->release();\n    }\n\n    return textureData;\n}\n\nContourData *DataReaderHelper::decodeContour(const rapidjson::Value& json)\n{\n    ContourData *contourData = new ContourData();\n\tcontourData->init();\n\n\tint length = DICTOOL->getArrayCount_json(json, VERTEX_POINT);\n    for (int i = length - 1; i >= 0; i--)\n    {\n        const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, VERTEX_POINT, i);\n\n        Point vertex;\n\n        vertex.x = DICTOOL->getFloatValue_json(dic, A_X);\n        vertex.y = DICTOOL->getFloatValue_json(dic, A_Y);\n\n        contourData->vertexList.push_back(vertex);\n\n    }\n\n    return contourData;\n}\n\nvoid DataReaderHelper::decodeNode(BaseData *node, const rapidjson::Value& json, DataInfo *dataInfo)\n{\n    node->x = DICTOOL->getFloatValue_json(json, A_X) * s_PositionReadScale;\n    node->y = DICTOOL->getFloatValue_json(json, A_Y) * s_PositionReadScale;\n\n    node->x *= dataInfo->contentScale;\n    node->y *= dataInfo->contentScale;\n\n\tnode->zOrder = DICTOOL->getIntValue_json(json, A_Z);\n\n    node->skewX = DICTOOL->getFloatValue_json(json, A_SKEW_X);\n    node->skewY = DICTOOL->getFloatValue_json(json, A_SKEW_Y);\n    node->scaleX = DICTOOL->getFloatValue_json(json, A_SCALE_X, 1.0f);\n    node->scaleY = DICTOOL->getFloatValue_json(json, A_SCALE_Y, 1.0f);\n\n    if (dataInfo->cocoStudioVersion < VERSION_COLOR_READING)\n    {\n        if (DICTOOL->checkObjectExist_json(json, 0))\n        {\n            const rapidjson::Value &colorDic = DICTOOL->getSubDictionary_json(json, 0); \n            node->a = DICTOOL->getIntValue_json(colorDic, A_ALPHA, 255);   \n            node->r = DICTOOL->getIntValue_json(colorDic, A_RED, 255);  \n            node->g = DICTOOL->getIntValue_json(colorDic, A_GREEN, 255); \n            node->b = DICTOOL->getIntValue_json(colorDic, A_BLUE, 255); \n\n            node->isUseColorInfo = true;\n        }\n    }\n    else\n    {\n        if (DICTOOL->checkObjectExist_json(json, COLOR_INFO))\n        {\n            const rapidjson::Value &colorDic =  DICTOOL->getSubDictionary_json(json, COLOR_INFO); //json.getSubDictionary(COLOR_INFO);\n            node->a = DICTOOL->getIntValue_json(colorDic, A_ALPHA, 255);   \n            node->r = DICTOOL->getIntValue_json(colorDic, A_RED, 255);  \n            node->g = DICTOOL->getIntValue_json(colorDic, A_GREEN, 255); \n            node->b = DICTOOL->getIntValue_json(colorDic, A_BLUE, 255); \n\n            node->isUseColorInfo = true;\n        }\n    }\n\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDataReaderHelper.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDATAREADERHELPER_H__\n#define __CCDATAREADERHELPER_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\n#include <string>\n#include <queue>\n#include <list>\n#include <mutex>\n#include <thread>\n#include <condition_variable>\n\nnamespace tinyxml2\n{\n    class XMLElement;\n}\n\nnamespace cocostudio {\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  DataReaderHelper : cocos2d::Object\n{\nprotected:\n\n\tenum ConfigType\n\t{\n\t\tDragonBone_XML,\n\t\tCocoStudio_JSON\n\t};\n\n\ttypedef struct _AsyncStruct\n\t{\n\t\tstd::string    filename;\n\t\tstd::string    fileContent;\n\t\tConfigType     configType;\n\t\tstd::string    baseFilePath;\n\t\tcocos2d::Object       *target;\n\t\tcocos2d::SEL_SCHEDULE   selector;\n\t\tbool           autoLoadSpriteFile;\n\n        std::string    imagePath;\n        std::string    plistPath;\n\t} AsyncStruct;\n\n\ttypedef struct _DataInfo\n\t{\n\t\tAsyncStruct *asyncStruct;\n\t\tstd::queue<std::string>      configFileQueue;\n        float contentScale;\n        std::string    filename;\n        std::string    baseFilePath;\n        float flashToolVersion;\n        float cocoStudioVersion;\n\t} DataInfo;\n\npublic:\n\n\t/** @deprecated Use getInstance() instead */\n\tCC_DEPRECATED_ATTRIBUTE static DataReaderHelper *sharedDataReaderHelper() { return DataReaderHelper::getInstance(); }\n\n\tstatic DataReaderHelper *getInstance();\n\n    /**\n     * Scale the position data, used for multiresolution adapter\n     * It won't effect the data already read.\n     */\n    static void setPositionReadScale(float scale);\n    static float getPositionReadScale();\n\n    static void purge();\npublic:\n\t/**\n     * @js ctor\n     */\n\tDataReaderHelper();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~DataReaderHelper();\n\n    void addDataFromFile(const std::string& filePath);\n    void addDataFromFileAsync(const std::string& imagePath, const std::string& plistPath, const std::string& filePath, cocos2d::Object *target, cocos2d::SEL_SCHEDULE selector);\n\n    void addDataAsyncCallBack(float dt);\n\n    void removeConfigFile(const std::string& configFile);\npublic:\n\n    /**\n     * Translate XML export from Dragon Bone flash tool to datas, and save them.\n     * When you add a new xml, the data already saved will be keeped.\n     *\n     * @param xmlPath The cache of the xml\n     */\n    static void addDataFromCache(const std::string& pFileContent, DataInfo *dataInfo = nullptr);\n\n\n\n    /**\n     * Decode Armature Datas from xml export from Dragon Bone flash tool\n     */\n    static ArmatureData *decodeArmature(tinyxml2::XMLElement *armatureXML, DataInfo *dataInfo);\n    static BoneData *decodeBone(tinyxml2::XMLElement *boneXML, tinyxml2::XMLElement *parentXML, DataInfo *dataInfo);\n    static DisplayData *decodeBoneDisplay(tinyxml2::XMLElement *displayXML, DataInfo *dataInfo);\n\n\n    /**\n     * Decode ArmatureAnimation Datas from xml export from Dragon Bone flash tool\n     */\n    static AnimationData *decodeAnimation(tinyxml2::XMLElement *animationXML, DataInfo *dataInfo);\n    static MovementData *decodeMovement(tinyxml2::XMLElement *movementXML, ArmatureData *armatureData, DataInfo *dataInfo);\n    static MovementBoneData *decodeMovementBone(tinyxml2::XMLElement *movBoneXml, tinyxml2::XMLElement *parentXml, BoneData *boneData, DataInfo *dataInfo);\n    static FrameData *decodeFrame(tinyxml2::XMLElement *frameXML, tinyxml2::XMLElement *parentFrameXml, BoneData *boneData, DataInfo *dataInfo);\n\n\n    /**\n     * Decode Texture Datas from xml export from Dragon Bone flash tool\n     */\n    static TextureData *decodeTexture(tinyxml2::XMLElement *textureXML, DataInfo *dataInfo);\n\n    /**\n     * Decode Contour Datas from xml export from Dragon Bone flash tool\n     */\n    static ContourData *decodeContour(tinyxml2::XMLElement *contourXML, DataInfo *dataInfo);\n\npublic:\n    static void addDataFromJsonCache(const std::string& fileContent, DataInfo *dataInfo = nullptr);\n\n    static ArmatureData *decodeArmature(const rapidjson::Value& json, DataInfo *dataInfo);\n    static BoneData *decodeBone(const rapidjson::Value& json, DataInfo *dataInfo);\n    static DisplayData *decodeBoneDisplay(const rapidjson::Value& json, DataInfo *dataInfo);\n\n    static AnimationData *decodeAnimation(const rapidjson::Value& json, DataInfo *dataInfo);\n    static MovementData *decodeMovement(const rapidjson::Value& json, DataInfo *dataInfo);\n    static MovementBoneData *decodeMovementBone(const rapidjson::Value& json, DataInfo *dataInfo);\n    static FrameData *decodeFrame(const rapidjson::Value& json, DataInfo *dataInfo);\n\n    static TextureData *decodeTexture(const rapidjson::Value& json);\n\n    static ContourData *decodeContour(const rapidjson::Value& json);\n\n    static void decodeNode(BaseData *node, const rapidjson::Value& json, DataInfo *dataInfo);\n\nprotected:\n\tvoid loadData();\n\n\n\n\n\tstd::condition_variable\t\t_sleepCondition;\n\n\tstd::thread     *_loadingThread;\n\n\tstd::mutex      _sleepMutex;\n\n\tstd::mutex      _asyncStructQueueMutex;\n\tstd::mutex      _dataInfoMutex;\n\n\tstd::mutex      _addDataMutex;\n\n    std::mutex      _getFileMutex;\n\n\t  \n\tunsigned long _asyncRefCount;\n\tunsigned long _asyncRefTotalCount;\n\n\tbool need_quit;\n\n\tstd::queue<AsyncStruct *> *_asyncStructQueue;\n\tstd::queue<DataInfo *>   *_dataQueue;\n\n    static std::vector<std::string> _configFileList;\n\n    static DataReaderHelper *_dataReaderHelper;\n};\n\n}\n\n#endif /*__CCDATAREADERHELPER_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDatas.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCDatas.h\"\n#include \"cocostudio/CCUtilMath.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\n\nBaseData::BaseData()\n    : x(0.0f)\n    , y(0.0f)\n    , zOrder(0)\n\n    , skewX(0.0f)\n    , skewY(0.0f)\n    , scaleX(1.0f)\n    , scaleY(1.0f)\n\n    , tweenRotate(0.0f)\n\n    , isUseColorInfo(false)\n    , a(255)\n    , r(255)\n    , g(255)\n    , b(255)\n{\n}\n\nBaseData::~BaseData()\n{\n}\n\nvoid BaseData::copy(const BaseData *node )\n{\n    x = node->x;\n    y = node->y;\n    zOrder = node->zOrder;\n\n    scaleX = node->scaleX;\n    scaleY = node->scaleY;\n    skewX = node->skewX;\n    skewY = node->skewY;\n\n    tweenRotate = node->tweenRotate;\n\n    isUseColorInfo = node->isUseColorInfo;\n    r = node->r;\n    g = node->g;\n    b = node->b;\n    a = node->a;\n}\n\n\nvoid BaseData::subtract(BaseData *from, BaseData *to, bool limit)\n{\n    x = to->x - from->x;\n    y = to->y - from->y;\n    scaleX = to->scaleX - from->scaleX;\n    scaleY = to->scaleY - from->scaleY;\n    skewX = to->skewX - from->skewX;\n    skewY = to->skewY - from->skewY;\n\n    if(isUseColorInfo || from->isUseColorInfo || to->isUseColorInfo)\n    {\n        a = to->a - from->a;\n        r = to->r - from->r;\n        g = to->g - from->g;\n        b = to->b - from->b;\n\n        isUseColorInfo = true;\n    }\n    else\n    {\n        a = r = g = b = 0;\n        isUseColorInfo = false;\n    }\n\n\tif (limit)\n\t{\n        if (skewX > M_PI)\n        {\n            skewX -= (float)CC_DOUBLE_PI;\n        }\n        if (skewX < -M_PI)\n        {\n            skewX += (float)CC_DOUBLE_PI;\n        }\n\n        if (skewY > M_PI)\n        {\n            skewY -= (float)CC_DOUBLE_PI;\n        }\n        if (skewY < -M_PI)\n        {\n            skewY += (float)CC_DOUBLE_PI;\n        }\n    }\n\n    if (to->tweenRotate)\n    {\n        skewX += to->tweenRotate * M_PI * 2;\n        skewY -= to->tweenRotate * M_PI * 2;\n    }\n\t\n}\n\nvoid BaseData::setColor(const Color4B &color)\n{\n    r = color.r;\n    g = color.g;\n    b = color.b;\n    a = color.a;\n}\n\nColor4B BaseData::getColor()\n{\n    return Color4B(r, g, b, a);\n}\n\nconst std::string DisplayData::changeDisplayToTexture(const std::string& displayName)\n{\n    // remove .xxx\n    std::string textureName = displayName;\n    size_t startPos = textureName.find_last_of(\".\");\n\n    if(startPos != std::string::npos)\n    {\n        textureName = textureName.erase(startPos);\n    }\n\n    return textureName;\n}\n\nDisplayData::DisplayData(void)\n    : displayType(CS_DISPLAY_MAX)\n    , displayName(\"\")\n{\n}\n\nvoid DisplayData::copy(DisplayData *displayData)\n{\n    displayName = displayData->displayName;\n    displayType = displayData->displayType;\n}\n\nSpriteDisplayData::SpriteDisplayData(void)\n{\n    displayType = CS_DISPLAY_SPRITE;\n}\n\n\nvoid SpriteDisplayData::copy(DisplayData *displayData)\n{\n    DisplayData::copy(displayData);\n\n    if (SpriteDisplayData *sdd = dynamic_cast<SpriteDisplayData*>(displayData))\n    {\n        skinData = sdd->skinData;\n    }\n}\n\nArmatureDisplayData::ArmatureDisplayData(void)\n{\n    displayType = CS_DISPLAY_ARMATURE;\n}\n\nParticleDisplayData::ParticleDisplayData(void)\n{\n    displayType = CS_DISPLAY_PARTICLE;\n}\n\n\n\nBoneData::BoneData(void)\n    : name(\"\")\n    , parentName(\"\")\n{\n}\n\nBoneData::~BoneData(void)\n{\n}\n\nbool BoneData::init()\n{\n    return true;\n}\n\nvoid BoneData::addDisplayData(DisplayData *displayData)\n{\n    displayDataList.pushBack(displayData);\n}\n\nDisplayData *BoneData::getDisplayData(int index)\n{\n    return displayDataList.at(index);\n}\n\n\nArmatureData::ArmatureData()\n    : dataVersion(0.1f)\n{\n}\n\nArmatureData::~ArmatureData()\n{\n}\n\nbool ArmatureData::init()\n{\n    return true;\n}\n\nvoid ArmatureData::addBoneData(BoneData *boneData)\n{\n    boneDataDic.insert(boneData->name, boneData);\n}\n\nBoneData *ArmatureData::getBoneData(const std::string& boneName)\n{\n    return static_cast<BoneData*>(boneDataDic.at(boneName));\n}\n\nFrameData::FrameData(void)\n    : frameID(0)\n    , duration(1)\n    , tweenEasing(Linear)\n    , easingParamNumber(0)\n    , easingParams(NULL)\n    , isTween(true)\n    , displayIndex(0)\n    , blendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED)\n\n    , strEvent(\"\")\n    , strMovement(\"\")\n    , strSound(\"\")\n    , strSoundEffect(\"\")\n{\n}\n\nFrameData::~FrameData(void)\n{\n    CC_SAFE_DELETE(easingParams);\n}\n\nvoid FrameData::copy(const BaseData *baseData)\n{\n    BaseData::copy(baseData);\n    \n    if (const FrameData *frameData = dynamic_cast<const FrameData*>(baseData))\n    {\n        duration = frameData->duration;\n        displayIndex = frameData->displayIndex;\n        \n        tweenEasing = frameData->tweenEasing;\n        easingParamNumber = frameData->easingParamNumber;\n        \n        CC_SAFE_DELETE(easingParams);\n        if (easingParamNumber != 0)\n        {\n            easingParams = new float[easingParamNumber];\n            for (int i = 0; i<easingParamNumber; i++)\n            {\n                easingParams[i] = frameData->easingParams[i];\n            }\n        }\n\n        blendFunc = frameData->blendFunc;\n    }\n}\n\nMovementBoneData::MovementBoneData()\n    : delay(0.0f)\n    , scale(1.0f)\n    , duration(0)\n    , name(\"\")\n{\n}\n\nMovementBoneData::~MovementBoneData(void)\n{\n}\n\nbool MovementBoneData::init()\n{\n    return true;\n}\n\nvoid MovementBoneData::addFrameData(FrameData *frameData)\n{\n    frameList.pushBack(frameData);\n}\n\nFrameData *MovementBoneData::getFrameData(int index)\n{\n    return frameList.at(index);\n}\n\n\n\nMovementData::MovementData(void)\n    : name(\"\")\n    , duration(0)\n    , scale(1.0f)\n    , durationTo(0)\n    , durationTween(0)\n    , loop(true)\n    , tweenEasing(Linear)\n{\n}\n\nMovementData::~MovementData(void)\n{\n}\n\nvoid MovementData::addMovementBoneData(MovementBoneData *movBoneData)\n{\n    movBoneDataDic.insert(movBoneData->name, movBoneData);\n}\n\nMovementBoneData *MovementData::getMovementBoneData(const std::string& boneName)\n{\n    return movBoneDataDic.at(boneName);\n}\n\n\n\nAnimationData::AnimationData(void)\n{\n}\n\nAnimationData::~AnimationData(void)\n{\n}\n\nvoid AnimationData::addMovement(MovementData *movData)\n{\n    movementDataDic.insert(movData->name, movData);\n    movementNames.push_back(movData->name);\n}\n\nMovementData *AnimationData::getMovement(const std::string& movementName)\n{\n    return movementDataDic.at(movementName);\n}\n\nssize_t AnimationData::getMovementCount()\n{\n    return movementDataDic.size();\n}\n\n\n\nContourData::ContourData()\n{\n}\n\nContourData::~ContourData()\n{\n}\n\nbool ContourData::init()\n{\n    return true;\n}\n\nvoid ContourData::addVertex(Point &vertex)\n{\n    vertexList.push_back(vertex);\n}\n\nTextureData::TextureData()\n    : height(0.0f)\n    , width(0.0f)\n    , pivotX(0.5f)\n    , pivotY(0.5f)\n    , name(\"\")\n{\n}\n\nTextureData::~TextureData()\n{\n}\n\nbool TextureData::init()\n{\n    return true;\n}\n\nvoid TextureData::addContourData(ContourData *contourData)\n{\n    contourDataList.pushBack(contourData);\n}\n\nContourData *TextureData::getContourData(int index)\n{\n    return contourDataList.at(index);\n}\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDatas.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCARMATURE_DATAS_H__\n#define __CCARMATURE_DATAS_H__\n\n#include \"CCObject.h\"\n#include \"ccTypes.h\"\n#include \"CCVector.h\"\n#include \"CCMap.h\"\n#include \"CCAffineTransform.h\"\n#include \"CCNode.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCTweenFunction.h\"\n\n\n#define CC_CREATE_NO_PARAM_NO_INIT(varType)\\\npublic: \\\n\tstatic inline varType *create(void){ \\\n\tvarType *var = new varType();\\\n\tif (var)\\\n{\\\n\tvar->autorelease();\\\n\treturn var;\\\n}\\\n\tCC_SAFE_DELETE(var);\\\n\treturn nullptr;\\\n}\n\n#define CC_CREATE_NO_PARAM(varType)\\\npublic: \\\n\tstatic inline varType *create(void){ \\\n\tvarType *var = new varType();\\\n\tif (var && var->init())\\\n{\\\n\tvar->autorelease();\\\n\treturn var;\\\n}\\\n\tCC_SAFE_DELETE(var);\\\n\treturn nullptr;\\\n}\n\nnamespace cocostudio {\n\n/**\n * The base node include a lot of attributes.\n * @js NA\n * @lua NA\n */\nclass  BaseData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(BaseData)\npublic:\n\t/**\n     * @js ctor\n     */\n    BaseData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~BaseData(void);\n\n    /*\n    * Copy data from node\n    * @param  node A BaseData to copy data\n    */\n    virtual void copy(const BaseData *node);\n\n    /*\n    * Calculate two BaseData's between value(to - from) and set to self\n    *\n    * @param  from   from BaseData\n    * @param  to     to BaseData\n    */\n    virtual void subtract(BaseData *from, BaseData *to, bool limit);\n\n    virtual void setColor(const cocos2d::Color4B &color);\n    virtual cocos2d::Color4B getColor();\npublic:\n    float x;\t\t\t\t\t//! position x attribute\n    float y;\t\t\t\t\t//! position y attribute\n    int zOrder;\t\t\t//! zorder attribute, used to order the Bone's depth order\n\n    /**\n    * x y skewX skewY scaleX scaleY used to calculate transform matrix\n    * skewX, skewY can have rotation effect\n    * To get more matrix information, you can have a look at this pape : http://www.senocular.com/flash/tutorials/transformmatrix/\n    */\n    float skewX;\n    float skewY;\n    float scaleX;\n    float scaleY;\n\n    float tweenRotate;       //! SkewX, SkewY, and TweenRotate effect the rotation\n\n    bool isUseColorInfo;    //! Whether or not this frame have the color changed Info\n    int a, r, g, b;\n\n};\n\n\n/**\n* DisplayType distinguish which type your display is.\n*/\nenum DisplayType\n{\n    CS_DISPLAY_SPRITE,                //! display is a single Sprite\n    CS_DISPLAY_ARMATURE,         //! display is a Armature\n    CS_DISPLAY_PARTICLE,            //! display is a CCParticle.\n\n    CS_DISPLAY_MAX\n};\n/**\n *  @js NA\n *  @lua NA\n */\nclass  DisplayData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(DisplayData)\n\n    static const std::string changeDisplayToTexture(const std::string& displayName);\npublic:\n\t/**\n     * @js ctor\n     */\n    DisplayData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~DisplayData(void) {}\n\n    virtual void copy(DisplayData *displayData);\n\n    DisplayType displayType;\t//! mark which type your display is\n    std::string displayName;\n};\n\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  SpriteDisplayData : public DisplayData\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(SpriteDisplayData)\npublic:\n\t/**\n     * @js ctor\n     */\n    SpriteDisplayData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~SpriteDisplayData() {};\n\n    void copy(DisplayData *displayData);\npublic:\n    BaseData skinData;\n};\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  ArmatureDisplayData  : public DisplayData\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(ArmatureDisplayData)\npublic:\n\t/**\n     * @js ctor\n     */\n    ArmatureDisplayData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ArmatureDisplayData() {}\n};\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  ParticleDisplayData : public DisplayData\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(ParticleDisplayData)\npublic:\n\t/**\n     * @js ctor\n     */\n    ParticleDisplayData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ParticleDisplayData() {};\n};\n\n\n\n/**\n* BoneData used to init a Bone.\n* BoneData keeps a DisplayData list, a Bone can have many display to change.\n* The display information saved in the DisplayData\n* @js NA\n* @lua NA\n*/\nclass  BoneData : public BaseData\n{\npublic:\n    CC_CREATE_NO_PARAM(BoneData)\npublic:\n\t/**\n     * @js ctor\n     */\n    BoneData(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~BoneData(void);\n\n    virtual bool init();\n\n    void addDisplayData(DisplayData *displayData);\n    DisplayData *getDisplayData(int index);\npublic:\n    std::string name;                //! the bone's name\n    std::string parentName;     //! the bone parent's name\n    cocos2d::Vector<DisplayData*> displayDataList;    //! save DisplayData informations for the Bone\n    cocos2d::AffineTransform boneDataTransform;\n};\n\n\n/**\n* ArmatureData saved the Armature name and Bonedata needed for the CCBones in this Armature\n* When we create a Armature, we need to get each Bone's BoneData as it's init information.\n* So we can get a BoneData from the Dictionary saved in the ArmatureData.\n* @js NA\n* @lua NA\n*/\nclass  ArmatureData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM(ArmatureData)\npublic:\n\t/**\n     * @js ctor\n     */\n    ArmatureData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ArmatureData();\n\n    bool init();\n    void addBoneData(BoneData *boneData);\n    BoneData *getBoneData(const std::string& boneName);\npublic:\n    std::string name;\n    cocos2d::Map<std::string, BoneData*> boneDataDic;\n    float dataVersion;\n};\n\nenum BlendType\n{\n    BLEND_NORMAL,\n    BLEND_LAYER,\n    BLEND_DARKEN,\n    BLEND_MULTIPLY,\n    BLEND_LIGHTEN,\n    BLEND_SCREEN,\n    BLEND_OVERLAY,\n    BLEND_HARD_LIGHT,\n    BLEND_ADD,\n    BLEND_SUBSTRACT,\n    BLEND_DIFFERENCE,\n    BLEND_INVERT,\n    BLEND_ALPHA,\n    BLEND_ERASE\n};\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  FrameData : public BaseData\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(FrameData)\npublic:\n\t/**\n     * @js ctor\n     */\n    FrameData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~FrameData();\n\n    virtual void copy(const BaseData *baseData);\npublic:\n    int frameID;\n    int duration;                //! The frame will last duration frames\n\n    TweenType tweenEasing;     //! Every frame's tween easing effect\n    int easingParamNumber;\n    float *easingParams;\n\n    bool isTween;                //! Whether it's a tween key frame\n\n    /**\n    * The current display index when change to this frame.\n    * If value is -1, then display will not be shown.\n    */\n    int displayIndex;\n\n    cocos2d::BlendFunc blendFunc;\n\n    std::string strEvent;\n    /**\n    * strMovement, strEvent, strSound, strSoundEffect do not support yet\n    */\n    std::string strMovement;\n    std::string strSound;\n    std::string strSoundEffect;\n};\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  MovementBoneData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM(MovementBoneData)\npublic:\n\t/**\n     * @js ctor\n     */\n    MovementBoneData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~MovementBoneData(void);\n\n    virtual bool init();\n\n    void addFrameData(FrameData *frameData);\n    FrameData *getFrameData(int index);\npublic:\n    float delay;             //! movement delay percent, this value can produce a delay effect\n    float scale;             //! scale this movement\n    float duration;        //! this Bone in this movement will last m_iDuration frames\n    std::string name;    //! bone name\n\n    cocos2d::Vector<FrameData*> frameList;\n};\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  MovementData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(MovementData)\npublic:\n\t/**\n     * @js ctor\n     */\n    MovementData(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~MovementData(void);\n\n    void addMovementBoneData(MovementBoneData *movBoneData);\n    MovementBoneData *getMovementBoneData(const std::string& boneName);\npublic:\n    std::string name;\n    int duration;        //! the frames this movement will last\n    float scale;\t\t  //! scale this movement\n\n    /**\n    * Change to this movement will last durationTo frames. Use this effect can avoid too suddenly changing.\n    *\n    * Example : current movement is \"stand\", we want to change to \"run\", then we fill durationTo frames before\n    * change to \"run\" instead of changing to \"run\" directly.\n    */\n    int durationTo;\n\n    /*\n    * This is different from duration, durationTween contain tween effect.\n    * duration is the raw time that the animation will last, it's the same with the time you edit in the Action Editor.\n    * durationTween is the actual time you want this animation last.\n    * Example : If we edit 10 frames in the flash, then duration is 10. When we set durationTween to 50, the movement will last 50 frames, the extra 40 frames will auto filled with tween effect\n    */\n    int durationTween;\n\n    bool loop;           //! whether the movement was looped\n\n    /**\n    * Which tween easing effect the movement use\n    * TWEEN_EASING_MAX : use the value from MovementData get from flash design panel\n    */\n    TweenType tweenEasing;\n\n    /**\n    * @brief\tsave movment bone data\n    * @key\tconst std::string& \n    * @value\tMovementBoneData *\n    */\n    cocos2d::Map<std::string, MovementBoneData*> movBoneDataDic;\n};\n\n\n/**\n*  AnimationData include all movement infomation for the Armature\n*  The struct is AnimationData -> MovementData -> MovementBoneData -> FrameData\n*                                              -> MovementFrameData\n*  @js NA\n*  @lua NA\n*/\nclass  AnimationData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM_NO_INIT(AnimationData)\npublic:\n\t/**\n     * @js ctor\n     */\n    AnimationData(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~AnimationData(void);\n\n    void addMovement(MovementData *movData);\n    MovementData *getMovement(const std::string& movementName);\n    ssize_t getMovementCount();\npublic:\n    std::string name;\n    cocos2d::Map<std::string, MovementData*> movementDataDic;\n    std::vector<std::string> movementNames;\n};\n\n\n\n/*\n* ContourData include a contour vertex information\n* @js NA\n* @lua NA\n*/\nclass  ContourData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM(ContourData)\npublic:\n\t/**\n     * @js ctor\n     */\n    ContourData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~ContourData(void);\n\n    virtual bool init();\n    virtual void addVertex(cocos2d::Point &vertex);\npublic:\n    std::vector<cocos2d::Point> vertexList;\t//! Save contour vertex info, vertex saved in a Point\n};\n\n\n\n\n/*\n* TextureData include a texture's information\n* @js NA\n* @lua NA\n*/\nclass  TextureData : public cocos2d::Object\n{\npublic:\n    CC_CREATE_NO_PARAM(TextureData)\npublic:\n\t/**\n     * @js ctor\n     */\n    TextureData();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ~TextureData(void);\n\n    virtual bool init();\n\n    void addContourData(ContourData *contourData);\n    ContourData *getContourData(int index);\npublic:\n\n    float height;\t\t//! The texture's width, height\n    float width;\n\n    float pivotX;\t\t//! The texture's anchor point\n    float pivotY;\n\n    std::string name;\t//! The texture's name\n\n    cocos2d::Vector<ContourData*> contourDataList;\n};\n\n\n}\n\n#endif /*__CCARMATURE_DATAS_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCDecorativeDisplay.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nDecorativeDisplay *DecorativeDisplay::create()\n{\n    DecorativeDisplay *pDisplay = new DecorativeDisplay();\n    if (pDisplay && pDisplay->init())\n    {\n        pDisplay->autorelease();\n        return pDisplay;\n    }\n    CC_SAFE_DELETE(pDisplay);\n    return nullptr;\n}\n\nDecorativeDisplay::DecorativeDisplay()\n    : _display(nullptr)\n    , _displayData(nullptr)\n\n{\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    _colliderDetector = nullptr;\n#endif\n}\n\n\nDecorativeDisplay::~DecorativeDisplay(void)\n{\n    CC_SAFE_RELEASE_NULL(_displayData);\n    CC_SAFE_RELEASE_NULL(_display);\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    CC_SAFE_RELEASE_NULL(_colliderDetector);\n#endif\n}\n\nbool DecorativeDisplay::init()\n{\n    return true;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDecorativeDisplay.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDECORATIVEDISPLAY_H__\n#define __CCDECORATIVEDISPLAY_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDisplayFactory.h\"\n#include \"cocostudio/CCDatas.h\"\n\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n#include \"cocostudio/CCColliderDetector.h\"\n#endif\n\nnamespace cocostudio {\n/**\n *  @js NA\n *  @lua NA\n */\nclass  DecorativeDisplay: public cocos2d::Object\n{\npublic:\n    static DecorativeDisplay *create();\npublic:\n    DecorativeDisplay(void);\n    ~DecorativeDisplay(void);\n\n    virtual bool init();\n\n    virtual void setDisplay(cocos2d::Node *display) \n    { \n        if (_display != display)\n        {\n            CC_SAFE_RETAIN(display);\n            CC_SAFE_RELEASE(_display);\n            _display = display; \n        }\n    }\n    virtual cocos2d::Node *getDisplay() const { return _display; }\n\n    virtual void setDisplayData(DisplayData *data)\n    {\n        if (_displayData != data)\n        {\n            CC_SAFE_RETAIN(data);\n            CC_SAFE_RELEASE(_displayData);\n            _displayData = data; \n        }\n    }\n    virtual DisplayData *getDisplayData() const { return _displayData; }\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    virtual void setColliderDetector(ColliderDetector *detector)\n    {\n        if (_colliderDetector != detector)\n        {\n            CC_SAFE_RETAIN(detector);\n            CC_SAFE_RELEASE(_colliderDetector);\n            _colliderDetector = detector; \n        }\n    }\n    virtual ColliderDetector *getColliderDetector() const { return _colliderDetector; }\n#endif\nprotected:\n    cocos2d::Node *_display;\n    DisplayData *_displayData;\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    ColliderDetector *_colliderDetector;\n#endif\n};\n\n}\n\n#endif /*__CCDECORATIVEDISPLAY_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDisplayFactory.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCDisplayFactory.h\"\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCSkin.h\"\n#include \"cocostudio/CCSpriteFrameCacheHelper.h\"\n#include \"cocostudio/CCArmatureDataManager.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n\n#include \"CCParticleSystemQuad.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nvoid DisplayFactory::addDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData)\n{\n    switch(displayData->displayType)\n    {\n    case CS_DISPLAY_SPRITE:\n        addSpriteDisplay(bone, decoDisplay, displayData);\n        break;\n    case  CS_DISPLAY_PARTICLE:\n        addParticleDisplay(bone, decoDisplay, displayData);\n        break;\n    case  CS_DISPLAY_ARMATURE:\n        addArmatureDisplay(bone, decoDisplay, displayData);\n        break;\n    default:\n        break;\n    }\n}\n\nvoid DisplayFactory::createDisplay(Bone *bone, DecorativeDisplay *decoDisplay)\n{\n    switch(decoDisplay->getDisplayData()->displayType)\n    {\n    case CS_DISPLAY_SPRITE:\n        createSpriteDisplay(bone, decoDisplay);\n        break;\n    case CS_DISPLAY_PARTICLE:\n        createParticleDisplay(bone, decoDisplay);\n        break;\n    case CS_DISPLAY_ARMATURE:\n        createArmatureDisplay(bone, decoDisplay);\n        break;\n    default:\n        break;\n    }\n}\n\nvoid DisplayFactory::updateDisplay(Bone *bone, float dt, bool dirty)\n{\n    Node *display = bone->getDisplayRenderNode();\n    CS_RETURN_IF(!display);\n\n    switch(bone->getDisplayRenderNodeType())\n    {\n    case CS_DISPLAY_SPRITE:\n        if (dirty)\n        {\n            static_cast<Skin*>(display)->updateArmatureTransform();\n        }\n        break;\n    case CS_DISPLAY_PARTICLE:\n        updateParticleDisplay(bone, display, dt);\n        break;\n    case CS_DISPLAY_ARMATURE:\n        updateArmatureDisplay(bone, display, dt);\n        break;\n    default:\n    {\n        display->setAdditionalTransform(bone->getNodeToArmatureTransform());\n    }\n    break;\n    }\n\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    if (dirty)\n    {\n        DecorativeDisplay *decoDisplay = bone->getDisplayManager()->getCurrentDecorativeDisplay();\n        ColliderDetector *detector = decoDisplay->getColliderDetector();\n        if (detector)\n        {\n            do\n            {\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT\n                CC_BREAK_IF(!detector->getBody());\n#endif\n\n                kmMat4 displayTransform = display->getNodeToParentTransform();\n                Point anchorPoint =  display->getAnchorPointInPoints();\n                anchorPoint = PointApplyTransform(anchorPoint, displayTransform);\n                displayTransform.mat[12] = anchorPoint.x;\n                displayTransform.mat[13] = anchorPoint.y;\n                kmMat4 t = TransformConcat( bone->getArmature()->getNodeToParentTransform(),displayTransform);\n                detector->updateTransform(t);\n            }\n            while (0);\n        }\n    }\n#endif\n}\n\n\n\nvoid DisplayFactory::addSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData)\n{\n    SpriteDisplayData *sdp = SpriteDisplayData::create();\n    sdp->copy((SpriteDisplayData *)displayData);\n    decoDisplay->setDisplayData(sdp);\n    createSpriteDisplay(bone, decoDisplay);\n}\n\nvoid DisplayFactory::createSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay)\n{\n    Skin *skin = nullptr;\n\n    SpriteDisplayData *displayData = (SpriteDisplayData *)decoDisplay->getDisplayData();\n\n    std::string textureName = displayData->displayName;\n    size_t startPos = textureName.find_last_of(\".\");\n\n    if(startPos != std::string::npos)\n    {\n        textureName = textureName.erase(startPos);\n    }\n\n    //! create display\n    if(textureName.length() == 0)\n    {\n        skin = Skin::create();\n    }\n    else\n    {\n        skin = Skin::createWithSpriteFrameName((textureName + \".png\").c_str());\n    }\n\n    decoDisplay->setDisplay(skin);\n\n    if (skin == nullptr)\n    {\n        return;\n    }\n\n    skin->setBone(bone);\n\n    initSpriteDisplay(bone, decoDisplay, displayData->displayName.c_str(), skin);\n\n    Armature *armature = bone->getArmature();\n    if (armature)\n    {\n        if (armature->getArmatureData()->dataVersion >= VERSION_COMBINED)\n        {\n            skin->setSkinData(displayData->skinData);\n        }\n        else\n        {\n            skin->setSkinData(*bone->getBoneData());\n        }\n    }\n\n}\n\nvoid DisplayFactory::initSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, const char *displayName, Skin *skin)\n{\n    //! remove .xxx\n    std::string textureName = displayName;\n    size_t startPos = textureName.find_last_of(\".\");\n\n    if(startPos != std::string::npos)\n    {\n        textureName = textureName.erase(startPos);\n    }\n\n    TextureData *textureData = ArmatureDataManager::getInstance()->getTextureData(textureName.c_str());\n    if(textureData)\n    {\n        //! Init display anchorPoint, every Texture have a anchor point\n        skin->setAnchorPoint(Point( textureData->pivotX, textureData->pivotY));\n    }\n\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    if (textureData && textureData->contourDataList.size() > 0)\n    {\n\n        //! create ContourSprite\n        ColliderDetector *colliderDetector = ColliderDetector::create(bone);\n        colliderDetector->addContourDataList(textureData->contourDataList);\n\n        decoDisplay->setColliderDetector(colliderDetector);\n    }\n#endif\n}\n\n\n\nvoid DisplayFactory::addArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData)\n{\n    ArmatureDisplayData *adp = ArmatureDisplayData::create();\n    adp->copy((ArmatureDisplayData *)displayData);\n    decoDisplay->setDisplayData(adp);\n\n    createArmatureDisplay(bone, decoDisplay);\n}\nvoid DisplayFactory::createArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay)\n{\n    ArmatureDisplayData *displayData = (ArmatureDisplayData *)decoDisplay->getDisplayData();\n\n    Armature *armature = Armature::create(displayData->displayName.c_str(), bone);\n\n    decoDisplay->setDisplay(armature);\n}\nvoid DisplayFactory::updateArmatureDisplay(Bone *bone, Node *display, float dt)\n{\n    Armature *armature = (Armature *)display;\n    if(armature)\n    {\n        armature->sortAllChildren();\n        armature->update(dt);\n    }\n}\n\n\n\nvoid DisplayFactory::addParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData)\n{\n    ParticleDisplayData *adp = ParticleDisplayData::create();\n    adp->copy((ParticleDisplayData *)displayData);\n    decoDisplay->setDisplayData(adp);\n\n    createParticleDisplay(bone, decoDisplay);\n}\nvoid DisplayFactory::createParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay)\n{\n    ParticleDisplayData *displayData = (ParticleDisplayData *)decoDisplay->getDisplayData();\n    ParticleSystem *system = ParticleSystemQuad::create(displayData->displayName.c_str());\n\n    system->removeFromParent();\n    \n    Armature *armature = bone->getArmature();\n    if (armature)\n    {\n        system->setParent(armature);\n    }\n\n    decoDisplay->setDisplay(system);\n}\nvoid DisplayFactory::updateParticleDisplay(Bone *bone, Node *display, float dt)\n{\n    ParticleSystem *system = (ParticleSystem *)display;\n    BaseData node;\n    TransformHelp::matrixToNode(bone->getNodeToArmatureTransform(), node);\n    system->setPosition(node.x, node.y);\n    system->setScaleX(node.scaleX);\n    system->setScaleY(node.scaleY);\n    system->update(dt);\n}\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDisplayFactory.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDISPLAYFACTORY_H__\n#define __CCDISPLAYFACTORY_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n\nnamespace cocostudio {\n\nclass Skin;\nclass Bone;\nclass DecorativeDisplay;\nclass DisplayData;\n/**\n *  @js NA\n *  @lua NA\n */\nclass DisplayFactory\n{\npublic:\n    static void addDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData);\n    static void createDisplay(Bone *bone, DecorativeDisplay *decoDisplay);\n    static void updateDisplay(Bone *bone, float dt, bool dirty);\n\n    static void addSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData);\n    static void createSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay);\n    static void initSpriteDisplay(Bone *bone, DecorativeDisplay *decoDisplay, const char *displayName, Skin *skin);\n\n\n    static void addArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData);\n    static void createArmatureDisplay(Bone *bone, DecorativeDisplay *decoDisplay);\n    static void updateArmatureDisplay(Bone *bone, cocos2d::Node *display, float dt);\n\n    static void addParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay, DisplayData *displayData);\n    static void createParticleDisplay(Bone *bone, DecorativeDisplay *decoDisplay);\n    static void updateParticleDisplay(Bone *bone, cocos2d::Node *display, float dt);\n};\n\n\n}\n\n#endif /*__CCDISPLAYFACTORY_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDisplayManager.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCDisplayManager.h\"\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCUtilMath.h\"\n#include \"cocostudio/CCSkin.h\"\n\n#include \"CCParticleSystemQuad.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nDisplayManager *DisplayManager::create(Bone *bone)\n{\n    DisplayManager *pDisplayManager = new DisplayManager();\n    if (pDisplayManager && pDisplayManager->init(bone))\n    {\n        pDisplayManager->autorelease();\n        return pDisplayManager;\n    }\n    CC_SAFE_DELETE(pDisplayManager);\n    return nullptr;\n}\n\n\nDisplayManager::DisplayManager()\n    : _displayRenderNode(nullptr)\n    , _displayType(CS_DISPLAY_MAX)\n    , _currentDecoDisplay(nullptr)\n    , _displayIndex(-1)\n    , _forceChangeDisplay(false)\n    , _visible(true)\n    , _bone(nullptr)\n{\n}\n\nDisplayManager::~DisplayManager()\n{\n    _decoDisplayList.clear();\n\n    if( _displayRenderNode )\n    {\n        _displayRenderNode->removeFromParentAndCleanup(true);\n        if(_displayRenderNode->getReferenceCount() > 0)\n            CC_SAFE_RELEASE_NULL(_displayRenderNode);\n    }\n\n}\n\nbool DisplayManager::init(Bone *bone)\n{\n    bool ret = false;\n\n    do\n    {\n\n        _bone = bone;\n\n        initDisplayList(bone->getBoneData());\n\n        ret = true;\n    }\n    while (0);\n\n    return ret;\n}\n\n\nvoid DisplayManager::addDisplay(DisplayData *displayData, int index)\n{\n    DecorativeDisplay *decoDisplay = nullptr;\n\n    if( (index >= 0) && (index < _decoDisplayList.size()) )\n    {\n        decoDisplay = (DecorativeDisplay *)_decoDisplayList.at(index);\n    }\n    else\n    {\n        decoDisplay = DecorativeDisplay::create();\n        _decoDisplayList.pushBack(decoDisplay);\n    }\n\n    DisplayFactory::addDisplay(_bone, decoDisplay, displayData);\n\n    //! if changed display index is current display index, then change current display to the new display\n    if(index == _displayIndex)\n    {\n        _displayIndex = -1;\n        changeDisplayWithIndex(index, false);\n    }\n}\n\nvoid DisplayManager::addDisplay(Node *display, int index)\n{\n    DecorativeDisplay *decoDisplay = nullptr;\n\n    if( (index >= 0) && (index < _decoDisplayList.size()) )\n    {\n        decoDisplay = _decoDisplayList.at(index);\n    }\n    else\n    {\n        decoDisplay = DecorativeDisplay::create();\n        _decoDisplayList.pushBack(decoDisplay);\n    }\n\n    DisplayData *displayData = nullptr;\n    if (Skin *skin = dynamic_cast<Skin *>(display))\n    {\n        skin->setBone(_bone);\n        displayData = SpriteDisplayData::create();\n\n        DisplayFactory::initSpriteDisplay(_bone, decoDisplay, skin->getDisplayName().c_str(), skin);\n\n        if (SpriteDisplayData *spriteDisplayData = (SpriteDisplayData *)decoDisplay->getDisplayData())\n        {\n            skin->setSkinData(spriteDisplayData->skinData);\n            ((SpriteDisplayData *)displayData)->skinData = spriteDisplayData->skinData;\n        }\n        else\n        {\n            bool find = false;\n\n            for (long i = _decoDisplayList.size()-2; i>=0; i--)\n            {\n                DecorativeDisplay *dd = _decoDisplayList.at(i);\n                SpriteDisplayData *sdd = static_cast<SpriteDisplayData*>(dd->getDisplayData());\n                if (sdd)\n                {\n                    find = true;\n                    skin->setSkinData(sdd->skinData);\n                    static_cast<SpriteDisplayData*>(displayData)->skinData = sdd->skinData;\n                    break;\n                }\n            }\n\n            if (!find)\n            {\n                BaseData baseData;\n                skin->setSkinData(baseData);\n            }\n        }\n    }\n    else if (dynamic_cast<ParticleSystemQuad *>(display))\n    {\n        displayData = ParticleDisplayData::create();\n\n        display->removeFromParent();\n        \n        Armature *armature = _bone->getArmature();\n        if (armature)\n        {\n            display->setParent(armature);\n        }\n    }\n    else if(Armature *armature = dynamic_cast<Armature *>(display))\n    {\n        displayData = ArmatureDisplayData::create();\n        displayData->displayName = armature->getName();\n        armature->setParentBone(_bone);\n    }\n    else\n    {\n        displayData = DisplayData::create();\n    }\n\n    decoDisplay->setDisplay(display);\n    decoDisplay->setDisplayData(displayData);\n\n    //! if changed display index is current display index, then change current display to the new display\n    if(index == _displayIndex)\n    {\n        _displayIndex = -1;\n        changeDisplayWithIndex(index, false);\n    }\n}\n\nvoid DisplayManager::removeDisplay(int index)\n{\n    if(index == _displayIndex)\n    {\n        setCurrentDecorativeDisplay(nullptr);\n        _displayIndex = -1;\n    }\n\n    _decoDisplayList.erase(index);\n}\n\nconst cocos2d::Vector<DecorativeDisplay*>& DisplayManager::getDecorativeDisplayList() const\n{\n    return _decoDisplayList;\n}\n\nvoid DisplayManager::changeDisplayWithIndex(int index, bool force)\n{\n    CCASSERT( index < (int)_decoDisplayList.size(), \"the _index value is out of range\");\n\n    _forceChangeDisplay = force;\n\n    //! If index is equal to current display index,then do nothing\n    if ( _displayIndex == index)\n        return;\n\n\n    _displayIndex = index;\n\n    //! If displayIndex < 0, it means you want to hide you display\n    if (_displayIndex < 0)\n    {\n        if(_displayRenderNode)\n        {\n            _displayRenderNode->removeFromParentAndCleanup(true);\n            setCurrentDecorativeDisplay(nullptr);\n        }\n        return;\n    }\n\n\n    DecorativeDisplay *decoDisplay = (DecorativeDisplay *)_decoDisplayList.at(_displayIndex);\n\n    setCurrentDecorativeDisplay(decoDisplay);\n}\n\nvoid CCDisplayManager::changeDisplayWithName(const std::string& name, bool force)\n{\n    for (int i = 0; i<_decoDisplayList.size(); i++)\n    {\n        if (_decoDisplayList.at(i)->getDisplayData()->displayName == name)\n        {\n            changeDisplayWithIndex(i, force);\n            break;\n        }\n    }\n}\n\nvoid DisplayManager::setCurrentDecorativeDisplay(DecorativeDisplay *decoDisplay)\n{\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    if (_currentDecoDisplay && _currentDecoDisplay->getColliderDetector())\n    {\n        _currentDecoDisplay->getColliderDetector()->setActive(false);\n    }\n#endif\n\n    _currentDecoDisplay = decoDisplay;\n\n#if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT || ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX\n    if (_currentDecoDisplay && _currentDecoDisplay->getColliderDetector())\n    {\n        _currentDecoDisplay->getColliderDetector()->setActive(true);\n    }\n#endif\n\n    Node *displayRenderNode = _currentDecoDisplay == nullptr ? nullptr : _currentDecoDisplay->getDisplay();\n    if (_displayRenderNode)\n    {\n        if (dynamic_cast<Armature *>(_displayRenderNode) != nullptr)\n        {\n            _bone->setChildArmature(nullptr);\n        }\n        _displayRenderNode->removeFromParentAndCleanup(true);\n        _displayRenderNode->release();\n    }\n\n    _displayRenderNode = displayRenderNode;\n\n    if(_displayRenderNode)\n    {\n        if (Armature *armature = dynamic_cast<Armature *>(_displayRenderNode))\n        {\n            _bone->setChildArmature(armature);\n        }\n        else if (ParticleSystemQuad *particle = dynamic_cast<ParticleSystemQuad *>(_displayRenderNode))\n        {\n            particle->resetSystem();\n        }\n\n        _displayRenderNode->setColor(_bone->getDisplayedColor());\n        _displayRenderNode->setOpacity(_bone->getDisplayedOpacity());\n\n        _displayRenderNode->retain();\n        _displayRenderNode->setVisible(_visible);\n\n        _displayType = _currentDecoDisplay->getDisplayData()->displayType;\n    }\n    else\n    {\n        _displayType =  CS_DISPLAY_MAX;\n    }\n}\n\nNode *DisplayManager::getDisplayRenderNode() const\n{\n    return _displayRenderNode;\n}\n\n\nDisplayType DisplayManager::getDisplayRenderNodeType() const\n{\n    return _displayType;\n}\n\nint DisplayManager::getCurrentDisplayIndex() const\n{\n    return _displayIndex;\n}\n\nDecorativeDisplay *DisplayManager::getCurrentDecorativeDisplay() const\n{\n    return _currentDecoDisplay;\n}\n\nDecorativeDisplay *DisplayManager::getDecorativeDisplayByIndex( int index) const\n{\n    return _decoDisplayList.at(index);\n}\n\nvoid DisplayManager::initDisplayList(BoneData *boneData)\n{\n    _decoDisplayList.clear();\n\n    CS_RETURN_IF(!boneData);\n\n    for(auto& object : boneData->displayDataList)\n    {\n        DisplayData *displayData = static_cast<DisplayData *>(object);\n\n        DecorativeDisplay *decoDisplay = DecorativeDisplay::create();\n        decoDisplay->setDisplayData(displayData);\n\n        DisplayFactory::createDisplay(_bone, decoDisplay);\n\n        _decoDisplayList.pushBack(decoDisplay);\n    }\n}\n\n\nbool DisplayManager::containPoint(Point &point)\n{\n    if(!_visible || _displayIndex < 0)\n    {\n        return false;\n    }\n\n    bool ret = false;\n\n    switch (_currentDecoDisplay->getDisplayData()->displayType)\n    {\n    case CS_DISPLAY_SPRITE:\n    {\n        /*\n         *  First we first check if the point is in the sprite content rect. If false, then we continue to check\n         *  the contour point. If this step is also false, then we can say the bone not contain this point.\n         *\n         */\n\n        Point outPoint = Point(0, 0);\n\n        Sprite *sprite = (Sprite *)_currentDecoDisplay->getDisplay();\n        sprite = (Sprite *)sprite->getChildByTag(0);\n\n        ret = CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint);\n\n    }\n    break;\n\n    default:\n        break;\n    }\n    return ret;\n}\n\nbool DisplayManager::containPoint(float x, float y)\n{\n    Point p = Point(x, y);\n    return containPoint(p);\n}\n\n\nvoid DisplayManager::setVisible(bool visible)\n{\n    if(!_displayRenderNode)\n        return;\n\n    _visible = visible;\n    _displayRenderNode->setVisible(visible);\n}\n\nbool DisplayManager::isVisible() const\n{\n    return _visible;\n}\n\n\nSize DisplayManager::getContentSize() const\n{\n    CS_RETURN_IF(!_displayRenderNode) Size(0, 0);\n    return _displayRenderNode->getContentSize();\n}\n\nRect DisplayManager::getBoundingBox() const\n{\n    CS_RETURN_IF(!_displayRenderNode) Rect(0, 0, 0, 0);\n    return _displayRenderNode->getBoundingBox();\n}\n\n\nPoint DisplayManager::getAnchorPoint() const\n{\n    CS_RETURN_IF(!_displayRenderNode) Point(0, 0);\n    return _displayRenderNode->getAnchorPoint();\n}\n\nPoint DisplayManager::getAnchorPointInPoints() const\n{\n    CS_RETURN_IF(!_displayRenderNode) Point(0, 0);\n    return _displayRenderNode->getAnchorPointInPoints();\n}\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCDisplayManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDISPLAYMANAGER_H__\n#define __CCDISPLAYMANAGER_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDecorativeDisplay.h\"\n#include \"cocostudio/CCDatas.h\"\n\nnamespace cocostudio {\n\nclass Bone;\n\n/**! DisplayManager manages Bone's display\n *  @js NA\n *  @lua NA\n */\nclass  DisplayManager : public cocos2d::Object\n{\npublic:\n    static DisplayManager *create(Bone *bone);\n\npublic:\n    DisplayManager();\n    ~DisplayManager();\n\n    bool init(Bone *bone);\n\n    /**\n     * Use BoneData to init the display list.\n     * If display is a sprite, and it have texture info in the TexutreData, then use TexutreData to init the display's anchor point\n     * If the display is a Armature, then create a new Armature\n     */\n    virtual void initDisplayList(BoneData *boneData);\n\n    /**\n     * Add display and use  _DisplayData init the display.\n     * If index already have a display, then replace it.\n     * If index is current display index, then also change display to _index\n     *\n     *\t@param \tdisplayData it include the display information, like DisplayType.\n     *\t\t\t\t\tIf you want to create a sprite display, then create a SpriteDisplayData param\n     *\n     *\t@param \tindex the index of the display you want to replace or add to\n     *\t\t\t\t\t-1 : append display from back\n     */\n    void addDisplay(DisplayData *displayData, int index);\n\n    void addDisplay(cocos2d::Node *display, int index);\n\n    void removeDisplay(int index);\n\n    const cocos2d::Vector<DecorativeDisplay*>& getDecorativeDisplayList() const;\n\n    /*\n     * @deprecated, please use changeDisplayWithIndex and changeDisplayWithName\n     */\n    CC_DEPRECATED_ATTRIBUTE void changeDisplayByIndex(int index, bool force);\n    CC_DEPRECATED_ATTRIBUTE void changeDisplayByName(const std::string& name, bool force);\n    \n    /**\n     * Change display by index. You can just use this method to change display in the display list.\n     * The display list is just used for this bone, and it is the displays you may use in every frame.\n     *\n     * Note : if index is the same with prev index, the method will not effect\n     *\n     * @param index The index of the display you want to change\n     * @param force If true, then force change display to specified display, or current display will set to  display index edit in the flash every key frame.\n     */\n    void changeDisplayWithIndex(int index, bool force);\n    void changeDisplayWithName(const std::string& name, bool force);\n\n    cocos2d::Node *getDisplayRenderNode() const;\n    DisplayType getDisplayRenderNodeType() const;\n\n    int getCurrentDisplayIndex() const;\n\n    virtual void setCurrentDecorativeDisplay(DecorativeDisplay *decoDisplay);\n    virtual DecorativeDisplay *getCurrentDecorativeDisplay() const;\n    virtual DecorativeDisplay *getDecorativeDisplayByIndex( int index) const;\n\n    /**\n     * Sets whether the display is visible\n     * The default value is true, a node is default to visible\n     *\n     * @param visible   true if the node is visible, false if the node is hidden.\n     */\n    virtual void setVisible(bool visible);\n    /**\n     * Determines if the display is visible\n     *\n     * @see setVisible(bool)\n     * @return true if the node is visible, false if the node is hidden.\n     */\n    virtual bool isVisible() const;\n\n    cocos2d::Size getContentSize() const;\n    cocos2d::Rect getBoundingBox() const;\n\n    cocos2d::Point getAnchorPoint() const;\n    cocos2d::Point getAnchorPointInPoints() const;\n\n    /**\n     * Check if the position is inside the bone.\n     */\n    virtual bool containPoint(cocos2d::Point &_point);\n\n    /**\n     * Check if the position is inside the bone.\n     */\n    virtual bool containPoint(float x, float y);\n\n    virtual void setForceChangeDisplay(bool force) { _forceChangeDisplay = force; }\n    virtual bool isForceChangeDisplay() const { return _forceChangeDisplay; }\nprotected:\n    cocos2d::Vector<DecorativeDisplay*> _decoDisplayList;\n    //! Display render node.\n    cocos2d::Node *_displayRenderNode;\n    //! Display render node type\n    DisplayType _displayType;\n    //! Include current display information, like contour sprite, etc.\n    DecorativeDisplay *_currentDecoDisplay;\n    //! Current display index\n    int _displayIndex;\n\n    bool _forceChangeDisplay;\n\n    //! Whether of not the bone is visible. Default is true\n    bool _visible;\n\n    Bone *_bone;\n};\n\n}\n\n#endif /*__CCDISPLAYMANAGER_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCInputDelegate.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCInputDelegate.h\"\n#include \"CCDirector.h\"\n#include \"platform/CCDevice.h\"\n#include \"CCEventListenerTouch.h\"\n#include \"CCEventListenerAcceleration.h\"\n#include \"CCEventListenerKeyboard.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nInputDelegate::InputDelegate(void)\n: _touchEnabled(false)\n, _touchListener(nullptr)\n, _accelerometerEnabled(false)\n, _accelerometerListener(nullptr)\n, _keypadEnabled(false)\n, _keyboardListener(nullptr)\n, _touchPriority(-1)\n, _touchMode(Touch::DispatchMode::ALL_AT_ONCE)\n{\n\n}\n\nInputDelegate::~InputDelegate(void)\n{\n    auto dispatcher = Director::getInstance()->getEventDispatcher();\n    dispatcher->removeEventListener(_touchListener);\n    dispatcher->removeEventListener(_keyboardListener);\n    dispatcher->removeEventListener(_accelerometerListener);\n    Device::setAccelerometerEnabled(false);\n}\n\nbool InputDelegate::onTouchBegan(Touch *pTouch, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouch);\n    CC_UNUSED_PARAM(pEvent);\n    return true;\n}\n\nvoid InputDelegate::onTouchMoved(Touch *pTouch, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouch);\n    CC_UNUSED_PARAM(pEvent);\n}\n    \nvoid InputDelegate::onTouchEnded(Touch *pTouch, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouch);\n    CC_UNUSED_PARAM(pEvent);\n}\n\nvoid InputDelegate::onTouchCancelled(Touch *pTouch, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouch);\n    CC_UNUSED_PARAM(pEvent);\n}    \n\nvoid InputDelegate::onTouchesBegan(const std::vector<Touch*>& pTouches, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouches);\n    CC_UNUSED_PARAM(pEvent);\n}\n\nvoid InputDelegate::onTouchesMoved(const std::vector<Touch*>& pTouches, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouches);\n    CC_UNUSED_PARAM(pEvent);\n}\n\nvoid InputDelegate::onTouchesEnded(const std::vector<Touch*>& pTouches, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouches);\n    CC_UNUSED_PARAM(pEvent);\n}\n\nvoid InputDelegate::onTouchesCancelled(const std::vector<Touch*>& pTouches, Event *pEvent)\n{\n    CC_UNUSED_PARAM(pTouches);\n    CC_UNUSED_PARAM(pEvent);\n}\n\nbool InputDelegate::isTouchEnabled() const\n{\n    return _touchEnabled;\n}\n\nvoid InputDelegate::setTouchEnabled(bool enabled)\n{\n    if (_touchEnabled != enabled)\n    {\n        auto dispatcher = Director::getInstance()->getEventDispatcher();\n        _touchEnabled = enabled;\n        if (enabled)\n        {            \n            if( _touchMode == Touch::DispatchMode::ALL_AT_ONCE ) {\n                // Register Touch Event\n                auto listener = EventListenerTouchAllAtOnce::create();\n                \n                listener->onTouchesBegan = CC_CALLBACK_2(InputDelegate::onTouchesBegan, this);\n                listener->onTouchesMoved = CC_CALLBACK_2(InputDelegate::onTouchesMoved, this);\n                listener->onTouchesEnded = CC_CALLBACK_2(InputDelegate::onTouchesEnded, this);\n                listener->onTouchesCancelled = CC_CALLBACK_2(InputDelegate::onTouchesCancelled, this);\n                \n                dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority);\n                _touchListener = listener;\n            } else {\n                // Register Touch Event\n                auto listener = EventListenerTouchOneByOne::create();\n                listener->setSwallowTouches(true);\n                \n                listener->onTouchBegan = CC_CALLBACK_2(InputDelegate::onTouchBegan, this);\n                listener->onTouchMoved = CC_CALLBACK_2(InputDelegate::onTouchMoved, this);\n                listener->onTouchEnded = CC_CALLBACK_2(InputDelegate::onTouchEnded, this);\n                listener->onTouchCancelled = CC_CALLBACK_2(InputDelegate::onTouchCancelled, this);\n                \n                dispatcher->addEventListenerWithFixedPriority(listener, _touchPriority);\n                _touchListener = listener;\n            }\n        }\n        else\n        {\n            dispatcher->removeEventListener(_touchListener);\n        }\n    }\n}\n\nvoid InputDelegate::setTouchMode(Touch::DispatchMode mode)\n{\n    if(_touchMode != mode)\n    {\n        _touchMode = mode;\n        \n\t\tif( _touchEnabled)\n        {\n\t\t\tsetTouchEnabled(false);\n\t\t\tsetTouchEnabled(true);\n\t\t}\n    }\n}\n\nvoid InputDelegate::setTouchPriority(int priority)\n{\n    if (_touchPriority != priority)\n    {\n        _touchPriority = priority;\n        \n\t\tif( _touchEnabled)\n        {\n\t\t\tsetTouchEnabled(false);\n\t\t\tsetTouchEnabled(true);\n\t\t}\n    }\n}\n\nint InputDelegate::getTouchPriority() const\n{\n    return _touchPriority;\n}\n\nTouch::DispatchMode InputDelegate::getTouchMode() const\n{\n    return _touchMode;\n}\n\nbool InputDelegate::isAccelerometerEnabled() const\n{\n    return _accelerometerEnabled;\n}\n\nvoid InputDelegate::setAccelerometerEnabled(bool enabled)\n{\n    if (enabled != _accelerometerEnabled)\n    {\n        _accelerometerEnabled = enabled;\n\n        auto dispatcher = Director::getInstance()->getEventDispatcher();\n        dispatcher->removeEventListener(_accelerometerListener);\n        _accelerometerListener = nullptr;\n        \n        Device::setAccelerometerEnabled(enabled);\n        \n        if (enabled)\n        {\n            auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(InputDelegate::onAcceleration, this));\n            dispatcher->addEventListenerWithFixedPriority(listener, -1);\n            _accelerometerListener = listener;\n        }\n    }\n}\n\nbool InputDelegate::isKeypadEnabled() const\n{\n    return _keypadEnabled;\n}\n\nvoid InputDelegate::setKeypadEnabled(bool enabled)\n{\n    if (enabled != _keypadEnabled)\n    {\n        _keypadEnabled = enabled;\n\n        auto dispatcher = Director::getInstance()->getEventDispatcher();\n        dispatcher->removeEventListener(_keyboardListener);\n        \n        if (enabled)\n        {\n            auto listener = EventListenerKeyboard::create();\n            listener->onKeyPressed = CC_CALLBACK_2(InputDelegate::onKeyPressed, this);\n            listener->onKeyReleased = CC_CALLBACK_2(InputDelegate::onKeyReleased, this);\n            \n            dispatcher->addEventListenerWithFixedPriority(listener, -1);\n            _keyboardListener = listener;\n        }\n    }\n}\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCInputDelegate.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CC_EXTENTIONS_CCINPUTDELEGATE_H__\n#define __CC_EXTENTIONS_CCINPUTDELEGATE_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"CCTouch.h\"\n#include \"CCEvent.h\"\n#include \"ccTypes.h\"\n#include \"CCEventKeyboard.h\"\n#include \"CCEventListener.h\"\n\nnamespace cocostudio {\n\n/**\n *  @lua NA\n */\nclass InputDelegate\n{\nprotected:\n    /**\n     * @js ctor\n     */\n    InputDelegate(void);\n    /**\n     * @js NA\n     */\n    virtual ~InputDelegate(void);\n    \npublic:\n    virtual bool isTouchEnabled() const;\n    virtual void setTouchEnabled(bool value);\n    virtual bool isAccelerometerEnabled() const;\n    virtual void setAccelerometerEnabled(bool value);\n    virtual bool isKeypadEnabled() const;\n    virtual void setKeypadEnabled(bool value);\n    virtual void setTouchMode(cocos2d::Touch::DispatchMode mode);\n    virtual cocos2d::Touch::DispatchMode getTouchMode() const;\n    virtual void setTouchPriority(int priority);\n    virtual int  getTouchPriority() const;\n /** @deprecated Please override onAcceleration */\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void didAccelerate(cocos2d::Acceleration* accelerationValue) final { CC_UNUSED_PARAM(accelerationValue); };\n    // Deprecated touch callbacks.\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual bool ccTouchBegan(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent); return false;};\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchMoved(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchEnded(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchCancelled(cocos2d::Touch *pTouch, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouch); CC_UNUSED_PARAM(pEvent);}\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesBegan(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesMoved(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesEnded(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    /**\n     * @js NA\n     */\n    CC_DEPRECATED_ATTRIBUTE virtual void ccTouchesCancelled(cocos2d::__Set *pTouches, cocos2d::Event *pEvent) final {CC_UNUSED_PARAM(pTouches); CC_UNUSED_PARAM(pEvent);}\n    /**\n     * @js NA\n     */\n    virtual void onAcceleration(cocos2d::Acceleration* acc, cocos2d::Event* event) {};\n    /**\n     * @js NA\n     */\n    virtual void onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) {};\n    /**\n     * @js NA\n     */\n    virtual void onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) {};\n    /**\n     * @js NA\n     */\n    virtual bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event);\n    /**\n     * @js NA\n     */\n    virtual void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event);\n    /**\n     * @js NA\n     */\n    virtual void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event);\n    /**\n     * @js NA\n     */\n    virtual void onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *event);\n    /**\n     * @js NA\n     */\n    virtual void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n    /**\n     * @js NA\n     */\n    virtual void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n    /**\n     * @js NA\n     */\n    virtual void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n    /**\n     * @js NA\n     */\n    virtual void onTouchesCancelled(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n\nprotected:   \n    bool _touchEnabled;\n    cocos2d::EventListener* _touchListener;\n    bool _accelerometerEnabled;\n    cocos2d::EventListener*  _accelerometerListener;\n    bool _keypadEnabled;\n    cocos2d::EventListener*  _keyboardListener;\nprivate:\n     int _touchPriority;\n    cocos2d::Touch::DispatchMode _touchMode;\n};\n\n}\n\n#endif  // __FUNDATION__CCCOMPONENT_H__\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCProcessBase.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCProcessBase.h\"\n#include \"cocostudio/CCUtilMath.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nProcessBase::ProcessBase(void)\n    : _processScale(1)\n    , _isPause(true)\n    , _isComplete(true)\n    , _isPlaying(false)\n    , _currentPercent(0.0f)\n    , _rawDuration(0)\n    , _loopType(ANIMATION_LOOP_BACK)\n    , _tweenEasing(Linear)\n    , _animationInternal(1/60.0f)\n    , _durationTween(0)\n    , _currentFrame(0)\n    , _curFrameIndex(0)\n    , _isLoopBack(false)\n{\n}\n\n\nProcessBase::~ProcessBase(void)\n{\n}\n\n\nvoid ProcessBase::pause()\n{\n    _isPause = true;\n    _isPlaying = false;\n}\n\n\nvoid ProcessBase::resume()\n{\n    _isPause = false;\n    _isPlaying = true;\n}\n\nvoid ProcessBase::stop()\n{\n    _isComplete = true;\n    _isPlaying = false;\n}\n\nvoid ProcessBase::play(int durationTo, int durationTween,  int loop, int tweenEasing)\n{\n    _isComplete = false;\n    _isPause = false;\n    _isPlaying = true;\n    _currentFrame = 0;\n\n    /*\n     *  Set m_iTotalFrames to durationTo, it is used for change tween between two animation.\n     *  When changing end, m_iTotalFrames will be setted to _durationTween\n     */\n    _nextFrameIndex = durationTo;\n    _tweenEasing = (TweenType)tweenEasing;\n\n}\n\nvoid ProcessBase::update(float dt)\n{\n\n    if (_isComplete || _isPause)\n    {\n        return;\n    }\n\n    /*\n     *  Fileter the m_iDuration <=0 and dt >1\n     *  If dt>1, generally speaking  the reason is the device is stuck.\n     */\n    if(_rawDuration <= 0 || dt > 1)\n    {\n        return;\n    }\n\n    if (_nextFrameIndex <= 0)\n    {\n        _currentPercent = 1;\n        _currentFrame = 0;\n    }\n    else\n    {\n        /*\n        *  update _currentFrame, every update add the frame passed.\n        *  dt/_animationInternal determine it is not a frame animation. If frame speed changed, it will not make our\n        *  animation speed slower or quicker.\n        */\n        _currentFrame += _processScale * (dt / _animationInternal);\n\n\n        _currentPercent = _currentFrame / _nextFrameIndex;\n\n        /*\n        *\tif _currentFrame is bigger or equal than m_iTotalFrames, then reduce it util _currentFrame is\n        *  smaller than m_iTotalFrames\n        */\n        _currentFrame = fmodf(_currentFrame, _nextFrameIndex);\n    }\n\n    updateHandler();\n}\n\n\n\nvoid ProcessBase::gotoFrame(int frameIndex)\n{\n    if (_loopType == ANIMATION_NO_LOOP)\n    {\n        _loopType = ANIMATION_MAX;\n    }\n    else if (_loopType == ANIMATION_TO_LOOP_FRONT)\n    {\n        _loopType = ANIMATION_LOOP_FRONT;\n    }\n\n    _curFrameIndex = frameIndex;\n    \n    _nextFrameIndex = _durationTween;\n}\n\nint ProcessBase::getCurrentFrameIndex()\n{\n    _curFrameIndex = (_rawDuration-1) * _currentPercent;\n    return _curFrameIndex;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCProcessBase.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCPROCESSBASE_H__\n#define __CCPROCESSBASE_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n\nnamespace cocostudio {\n\nenum AnimationType\n{\n    SINGLE_FRAME = -4,          //! the animation just have one frame\n    ANIMATION_NO_LOOP,          //! the animation isn't loop\n\n    ANIMATION_TO_LOOP_FRONT,    //! the animation loop from front\n    ANIMATION_TO_LOOP_BACK,     //! the animation loop from back\n\n    ANIMATION_LOOP_FRONT,       //! the animation loop from front\n    ANIMATION_LOOP_BACK,        //! the animation loop from back\n\n    ANIMATION_MAX,\n\n};\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  ProcessBase : public cocos2d::Object\n{\npublic:\n    ProcessBase(void);\n    virtual ~ProcessBase(void);\n\n    /**\n     * Play animation by animation name.\n     *\n     * @param  durationTo The frames between two animation changing-over.\n     *         It's meaning is changing to this animation need how many frames\n     *\n     *         -1 : use the value from MovementData get from flash design panel\n     * @param  durationTween  The frame count you want to play in the game.\n     *         if  _durationTween is 80, then the animation will played 80 frames in a loop\n     *\n     *         -1 : use the value from MovementData get from flash design panel\n     *\n     * @param  loop   Whether the animation is loop\n     *\n     *         loop < 0 : use the value from MovementData get from flash design panel\n     *         loop = 0 : this animation is not loop\n     *         loop > 0 : this animation is loop\n     *\n     * @param  tweenEasing Tween easing is used for calculate easing effect\n     *\n     *         TWEEN_EASING_MAX : use the value from MovementData get from flash design panel\n     *         -1 : fade out\n     *         0  : line\n     *         1  : fade in\n     *         2  : fade in and out\n     *\n     */\n    virtual void play(int durationTo, int durationTween,  int loop, int tweenEasing);\n\n    /**\n     * Pause the Process\n     */\n    virtual void pause();\n    /**\n     * Resume the Process\n     */\n    virtual void resume();\n    /**\n     * Stop the Process\n     */\n    virtual void stop();\n\n\n    /**\n     * You should never call this function, unless you know what you do\n     * Update the Process, include current process, current frame and son on\n     *\n     * @param The duration since last update\n     */\n    virtual void update(float dt);\n\n    virtual int getCurrentFrameIndex();\n\n    virtual void setProcessScale(float processScale) { _processScale = processScale; }\n    virtual float getProcessScale() const { return _processScale; }\n\n    virtual void setIsPause(bool pause) { _isPause = pause; }\n    virtual bool isPause() const { return _isPause; }\n\n    virtual void setIsComplete(bool complete) { _isComplete = complete; }\n    virtual bool isComplete() const { return _isComplete; }\n\n    virtual void setIsPlaying(bool playing) { _isPlaying = playing; }\n    virtual bool isPlaying() const { return _isPlaying; }\n\n    virtual float getCurrentPercent() const { return _currentPercent; }\n    virtual int getRawDuration() const { return _rawDuration; }\n\nprotected:\n\n    virtual void gotoFrame(int frameIndex);\n\n    /**\n     * Update(float dt) will call this handler, you can handle your logic here\n     */\n    virtual void updateHandler() {};\n\nprotected:\n    //! Scale the process speed\n    float _processScale;\n\n    //! Set and get whether the aniamtion is pause\n    bool _isPause;\n\n    //! Set and get whether the aniamtion is complete\n    bool _isComplete;\n\n    //! Set and get whether the aniamtion is playing\n    bool _isPlaying;\n\n    //! Current percent this process arrived\n    float _currentPercent;\n\n    //! The raw duration\n    int _rawDuration;\n\n    //! The animation whether or not loop\n    AnimationType _loopType;\n\n    //! The tween easing effect\n    TweenType _tweenEasing;\n\n    //! The animation update speed\n    float _animationInternal;\n\n\nprotected:\n    //! The durantion frame count will run\n    int _durationTween;\n\n    //! Current frame this process arrived, this frame is tween frame\n    float _currentFrame;\n    //! Frame index it the time line\n    int _curFrameIndex;\n\n    //! Next frame this process need run to\n    int _nextFrameIndex;\n\n\n    bool _isLoopBack;\n};\n\n}\n\n#endif /*__CCPROCESSBASE_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSGUIReader.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"cocostudio/CCSGUIReader.h\"\n#include \"gui/CocosGUI.h\"\n#include \"cocostudio/CCActionManagerEx.h\"\n#include <fstream>\n#include <iostream>\n\nusing namespace cocos2d::gui;\nusing namespace cocos2d;\n\n\nnamespace cocostudio {\n    \nstatic GUIReader* sharedReader = nullptr;\n\nGUIReader::GUIReader():\nm_strFilePath(\"\")\n{\n}\n\nGUIReader::~GUIReader()\n{\n}\n\nGUIReader* GUIReader::getInstance()\n{\n    if (!sharedReader)\n    {\n        sharedReader = new GUIReader();\n    }\n    return sharedReader;\n}\n\nvoid GUIReader::destroyInstance()\n{\n    CC_SAFE_DELETE(sharedReader);\n}\n\nint GUIReader::getVersionInteger(const char *str)\n{\n    std::string strVersion = str;\n    size_t length = strVersion.length();\n    if (length < 7)\n    {\n        return 0;\n    }\n    size_t pos = strVersion.find_first_of(\".\");\n    std::string t = strVersion.substr(0,pos);\n    strVersion = strVersion.substr(pos+1,strVersion.length()-1);\n    \n    pos = strVersion.find_first_of(\".\");\n    std::string h = strVersion.substr(0,pos);\n    strVersion = strVersion.substr(pos+1,strVersion.length()-1);\n    \n    pos = strVersion.find_first_of(\".\");\n    std::string te = strVersion.substr(0,pos);\n    strVersion = strVersion.substr(pos+1,strVersion.length()-1);\n    \n    pos = strVersion.find_first_of(\".\");\n    std::string s = strVersion.substr(0,pos);\n    \n    int it = atoi(t.c_str());\n    int ih = atoi(h.c_str());\n    int ite = atoi(te.c_str());\n    int is = atoi(s.c_str());\n    \n    int iVersion = it*1000+ih*100+ite*10+is;\n    CCLOG(\"iversion %d\",iVersion);\n    return iVersion;\n    /************************/\n}\n\nvoid GUIReader::storeFileDesignSize(const char *fileName, const cocos2d::Size &size)\n{\n    std::string keyWidth = fileName;\n    keyWidth.append(\"width\");\n    std::string keyHeight = fileName;\n    keyHeight.append(\"height\");\n    _fileDesignSizes[keyWidth] = Value(size.width);\n    _fileDesignSizes[keyHeight] = Value(size.height);\n}\n\nconst cocos2d::Size GUIReader::getFileDesignSize(const char* fileName) const\n{\n    std::string keyWidth = fileName;\n    keyWidth.append(\"width\");\n    std::string keyHeight = fileName;\n    keyHeight.append(\"height\");\n    float w = _fileDesignSizes.at(keyWidth).asFloat();\n    float h = _fileDesignSizes.at(keyHeight).asFloat();\n    return Size(w, h);\n}\n\n\nWidget* GUIReader::widgetFromJsonFile(const char *fileName)\n{\n\tstd::string jsonpath;\n\trapidjson::Document jsonDict;\n    jsonpath = CCFileUtils::getInstance()->fullPathForFilename(fileName);\n    size_t pos = jsonpath.find_last_of('/');\n\tm_strFilePath = jsonpath.substr(0,pos+1);\n    std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath);\n\tjsonDict.Parse<0>(contentStr.c_str());\n    if (jsonDict.HasParseError())\n    {\n        CCLOG(\"GetParseError %s\\n\",jsonDict.GetParseError());\n    }\n    Widget* widget = nullptr;\n    const char* fileVersion = DICTOOL->getStringValue_json(jsonDict, \"version\");\n    WidgetPropertiesReader * pReader = nullptr;\n    if (fileVersion)\n    {\n        int versionInteger = getVersionInteger(fileVersion);\n        if (versionInteger < 250)\n        {\n            pReader = new WidgetPropertiesReader0250();\n            widget = pReader->createWidget(jsonDict, m_strFilePath.c_str(), fileName);\n        }\n        else\n        {\n            pReader = new WidgetPropertiesReader0300();\n            widget = pReader->createWidget(jsonDict, m_strFilePath.c_str(), fileName);\n        }\n    }\n    else\n    {\n        pReader = new WidgetPropertiesReader0250();\n        widget = pReader->createWidget(jsonDict, m_strFilePath.c_str(), fileName);\n    }\n    \n    CC_SAFE_DELETE(pReader);\n    return widget;\n}\n\n\n\nWidget* WidgetPropertiesReader0250::createWidget(const rapidjson::Value& data, const char* fullPath, const char* fileName)\n{\n    m_strFilePath = fullPath;\n    int texturesCount = DICTOOL->getArrayCount_json(data, \"textures\");\n    \n    for (int i=0; i<texturesCount; i++)\n    {\n        const char* file = DICTOOL->getStringValueFromArray_json(data, \"textures\", i);\n        std::string tp = fullPath;\n        tp.append(file);\n        CCSpriteFrameCache::getInstance()->addSpriteFramesWithFile(tp.c_str());\n    }\n    float fileDesignWidth = DICTOOL->getFloatValue_json(data, \"designWidth\");\n    float fileDesignHeight = DICTOOL->getFloatValue_json(data, \"designHeight\");\n    if (fileDesignWidth <= 0 || fileDesignHeight <= 0) {\n        CCLOGERROR(\"Read design size error!\\n\");\n        Size winSize = Director::getInstance()->getWinSize();\n        GUIReader::getInstance()->storeFileDesignSize(fileName, winSize);\n    }\n    else\n    {\n        GUIReader::getInstance()->storeFileDesignSize(fileName, Size(fileDesignWidth, fileDesignHeight));\n    }\n    const rapidjson::Value& widgetTree = DICTOOL->getSubDictionary_json(data, \"widgetTree\");\n    Widget* widget = widgetFromJsonDictionary(widgetTree);\n    \n    /* *********temp********* */\n    if (widget->getContentSize().equals(Size::ZERO))\n    {\n        Layout* rootWidget = dynamic_cast<Layout*>(widget);\n        rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight));\n    }\n    /* ********************** */\n    \n    //    widget->setFileDesignSize(Size(fileDesignWidth, fileDesignHeight));\n    const rapidjson::Value& actions = DICTOOL->getSubDictionary_json(data, \"animation\");\n    /* *********temp********* */\n    //    ActionManager::getInstance()->releaseActions();\n    /* ********************** */\n    CCLOG(\"file name == [%s]\",fileName);\n    Object* rootWidget = (Object*) widget;\n    ActionManagerEx::getInstance()->initWithDictionary(fileName,actions,rootWidget);\n    return widget;\n}\n\nWidget* WidgetPropertiesReader0250::widgetFromJsonDictionary(const rapidjson::Value&data)\n{\n    Widget* widget = nullptr;\n    const char* classname = DICTOOL->getStringValue_json(data, \"classname\");\n    const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, \"options\");\n    if (classname && strcmp(classname, \"Button\") == 0)\n    {\n        widget = cocos2d::gui::Button::create();\n        setPropsForButtonFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"CheckBox\") == 0)\n    {\n        widget = CheckBox::create();\n        setPropsForCheckBoxFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"Label\") == 0)\n    {\n        widget = cocos2d::gui::Text::create();\n        setPropsForLabelFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"LabelAtlas\") == 0)\n    {\n        widget = cocos2d::gui::TextAtlas::create();\n        setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"LoadingBar\") == 0)\n    {\n        widget = cocos2d::gui::LoadingBar::create();\n        setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);\n    }else if (classname && strcmp(classname, \"ScrollView\") == 0){\n        widget = cocos2d::gui::ScrollView::create();\n        setPropsForScrollViewFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"TextArea\") == 0)\n    {\n        widget = cocos2d::gui::Text::create();\n        setPropsForLabelFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"TextButton\") == 0)\n    {\n        widget = cocos2d::gui::Button::create();\n        setPropsForButtonFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"TextField\") == 0)\n    {\n        widget = cocos2d::gui::TextField::create();\n        setPropsForTextFieldFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"ImageView\") == 0)\n    {\n        widget = cocos2d::gui::ImageView::create();\n        setPropsForImageViewFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"Panel\") == 0)\n    {\n        widget = Layout::create();\n        setPropsForLayoutFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"Slider\") == 0)\n    {\n        widget = cocos2d::gui::Slider::create();\n        setPropsForSliderFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"LabelBMFont\") == 0)\n    {\n        widget = cocos2d::gui::TextBMFont::create();\n        setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"DragPanel\") == 0)\n    {\n        widget = cocos2d::gui::ScrollView::create();\n        setPropsForScrollViewFromJsonDictionary(widget, uiOptions);\n    }\n    \n    int childrenCount = DICTOOL->getArrayCount_json(data, \"children\");\n    for (int i=0;i<childrenCount;i++)\n    {\n        const rapidjson::Value& subData = DICTOOL->getDictionaryFromArray_json(data, \"children\", i);\n        Widget* child = widgetFromJsonDictionary(subData);\n        if (child)\n        {\n            widget->addChild(child);\n        }\n    }\n    \n    return widget;\n}\n\nvoid WidgetPropertiesReader0250::setPropsForWidgetFromJsonDictionary(Widget*widget,const rapidjson::Value&options)\n{\n    bool ignoreSizeExsit = DICTOOL->checkObjectExist_json(options, \"ignoreSize\");\n    if (ignoreSizeExsit)\n    {\n        widget->ignoreContentAdaptWithSize(DICTOOL->getBooleanValue_json(options, \"ignoreSize\"));\n    }\n    \n    float w = DICTOOL->getFloatValue_json(options, \"width\");\n    float h = DICTOOL->getFloatValue_json(options, \"height\");\n    widget->setSize(Size(w, h));\n    \n    widget->setTag(DICTOOL->getIntValue_json(options, \"tag\"));\n\twidget->setActionTag(DICTOOL->getIntValue_json(options, \"actiontag\"));\n    widget->setTouchEnabled(DICTOOL->getBooleanValue_json(options, \"touchAble\"));\n    const char* name = DICTOOL->getStringValue_json(options, \"name\");\n    const char* widgetName = name?name:\"default\";\n    widget->setName(widgetName);\n    float x = DICTOOL->getFloatValue_json(options, \"x\");\n    float y = DICTOOL->getFloatValue_json(options, \"y\");\n    widget->setPosition(Point(x,y));\n    bool sx = DICTOOL->checkObjectExist_json(options, \"scaleX\");\n    if (sx)\n    {\n        widget->setScaleX(DICTOOL->getFloatValue_json(options, \"scaleX\"));\n    }\n    bool sy = DICTOOL->checkObjectExist_json(options, \"scaleY\");\n    if (sy)\n    {\n        widget->setScaleY(DICTOOL->getFloatValue_json(options, \"scaleY\"));\n    }\n    bool rt = DICTOOL->checkObjectExist_json(options, \"rotation\");\n    if (rt)\n    {\n        widget->setRotation(DICTOOL->getFloatValue_json(options, \"rotation\"));\n    }\n    bool vb = DICTOOL->checkObjectExist_json(options, \"visible\");\n    if (vb)\n    {\n        widget->setVisible(DICTOOL->getBooleanValue_json(options, \"visible\"));\n    }\n    int z = DICTOOL->getIntValue_json(options, \"ZOrder\");\n    widget->setLocalZOrder(z);\n}\n\nvoid WidgetPropertiesReader0250::setColorPropsForWidgetFromJsonDictionary(Widget *widget, const rapidjson::Value&options)\n{\n    bool op = DICTOOL->checkObjectExist_json(options, \"opacity\");\n    if (op)\n    {\n        widget->setOpacity(DICTOOL->getIntValue_json(options, \"opacity\"));\n    }\n    bool cr = DICTOOL->checkObjectExist_json(options, \"colorR\");\n    bool cg = DICTOOL->checkObjectExist_json(options, \"colorG\");\n    bool cb = DICTOOL->checkObjectExist_json(options, \"colorB\");\n    int colorR = cr ? DICTOOL->getIntValue_json(options, \"colorR\") : 255;\n    int colorG = cg ? DICTOOL->getIntValue_json(options, \"colorG\") : 255;\n    int colorB = cb ? DICTOOL->getIntValue_json(options, \"colorB\") : 255;\n    widget->setColor(Color3B(colorR, colorG, colorB));\n    bool apx = DICTOOL->checkObjectExist_json(options, \"anchorPointX\");\n    float apxf = apx ? DICTOOL->getFloatValue_json(options, \"anchorPointX\") : ((widget->getWidgetType() == WidgetTypeWidget) ? 0.5f : 0.0f);\n    bool apy = DICTOOL->checkObjectExist_json(options, \"anchorPointY\");\n    float apyf = apy ? DICTOOL->getFloatValue_json(options, \"anchorPointY\") : ((widget->getWidgetType() == WidgetTypeWidget) ? 0.5f : 0.0f);\n    widget->setAnchorPoint(Point(apxf, apyf));\n    bool flipX = DICTOOL->getBooleanValue_json(options, \"flipX\");\n    bool flipY = DICTOOL->getBooleanValue_json(options, \"flipY\");\n    widget->setFlipX(flipX);\n    widget->setFlipY(flipY);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::Button* button = static_cast<Button*>(widget);\n    bool scale9Enable = DICTOOL->getBooleanValue_json(options, \"scale9Enable\");\n    button->setScale9Enabled(scale9Enable);\n    \n    std::string tp_n = m_strFilePath;\n    std::string tp_p = m_strFilePath;\n    std::string tp_d = m_strFilePath;\n    \n    const char* normalFileName = DICTOOL->getStringValue_json(options, \"normal\");\n    const char* pressedFileName = DICTOOL->getStringValue_json(options, \"pressed\");\n    const char* disabledFileName = DICTOOL->getStringValue_json(options, \"disabled\");\n    \n    const char* normalFileName_tp = (normalFileName && (strcmp(normalFileName, \"\") != 0))?tp_n.append(normalFileName).c_str():nullptr;\n    const char* pressedFileName_tp = (pressedFileName && (strcmp(pressedFileName, \"\") != 0))?tp_p.append(pressedFileName).c_str():nullptr;\n    const char* disabledFileName_tp =  (disabledFileName && (strcmp(disabledFileName, \"\") != 0))?tp_d.append(disabledFileName).c_str():nullptr;\n    bool useMergedTexture = DICTOOL->getBooleanValue_json(options, \"useMergedTexture\");\n    if (scale9Enable)\n    {\n        float cx = DICTOOL->getFloatValue_json(options, \"capInsetsX\");\n        float cy = DICTOOL->getFloatValue_json(options, \"capInsetsY\");\n        float cw = DICTOOL->getFloatValue_json(options, \"capInsetsWidth\");\n        float ch = DICTOOL->getFloatValue_json(options, \"capInsetsHeight\");\n        \n        if (useMergedTexture)\n        {\n            button->loadTextures(normalFileName, pressedFileName, disabledFileName,UI_TEX_TYPE_PLIST);\n        }\n        else\n        {\n            button->loadTextures(normalFileName_tp, pressedFileName_tp, disabledFileName_tp);\n        }\n        button->setCapInsets(Rect(cx, cy, cw, ch));\n        bool sw = DICTOOL->checkObjectExist_json(options, \"scale9Width\");\n        bool sh = DICTOOL->checkObjectExist_json(options, \"scale9Height\");\n        if (sw && sh)\n        {\n            float swf = DICTOOL->getFloatValue_json(options, \"scale9Width\");\n            float shf = DICTOOL->getFloatValue_json(options, \"scale9Height\");\n            button->setSize(Size(swf, shf));\n        }\n    }\n    else\n    {\n        if (useMergedTexture)\n        {\n            button->loadTextures(normalFileName, pressedFileName, disabledFileName,UI_TEX_TYPE_PLIST);\n        }\n        else\n        {\n            button->loadTextures(normalFileName_tp, pressedFileName_tp, disabledFileName_tp);\n        }\n    }\n    bool tt = DICTOOL->checkObjectExist_json(options, \"text\");\n    if (tt)\n    {\n        const char* text = DICTOOL->getStringValue_json(options, \"text\");\n        if (text)\n        {\n            button->setTitleText(text);\n        }\n    }\n    bool cr = DICTOOL->checkObjectExist_json(options, \"textColorR\");\n    bool cg = DICTOOL->checkObjectExist_json(options, \"textColorG\");\n    bool cb = DICTOOL->checkObjectExist_json(options, \"textColorB\");\n    int cri = cr?DICTOOL->getIntValue_json(options, \"textColorR\"):255;\n    int cgi = cg?DICTOOL->getIntValue_json(options, \"textColorG\"):255;\n    int cbi = cb?DICTOOL->getIntValue_json(options, \"textColorB\"):255;\n    button->setTitleColor(Color3B(cri,cgi,cbi));\n    bool fs = DICTOOL->checkObjectExist_json(options, \"fontSize\");\n    if (fs)\n    {\n        button->setTitleFontSize(DICTOOL->getIntValue_json(options, \"fontSize\"));\n    }\n    bool fn = DICTOOL->checkObjectExist_json(options, \"fontName\");\n    if (fn)\n    {\n        button->setTitleFontName(DICTOOL->getStringValue_json(options, \"fontName\"));\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForCheckBoxFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    CheckBox* checkBox = static_cast<CheckBox*>(widget);\n    const char* backGroundFileName = DICTOOL->getStringValue_json(options, \"backGroundBox\");\n    const char* backGroundSelectedFileName = DICTOOL->getStringValue_json(options, \"backGroundBoxSelected\");\n    const char* frontCrossFileName = DICTOOL->getStringValue_json(options, \"frontCross\");\n    const char* backGroundDisabledFileName = DICTOOL->getStringValue_json(options, \"backGroundBoxDisabled\");\n    const char* frontCrossDisabledFileName = DICTOOL->getStringValue_json(options, \"frontCrossDisabled\");\n    \n    std::string tp_b = m_strFilePath;\n    std::string tp_bs = m_strFilePath;\n    std::string tp_c = m_strFilePath;\n    std::string tp_bd = m_strFilePath;\n    std::string tp_cd = m_strFilePath;\n    \n    const char* backGroundFileName_tp = (backGroundFileName && (strcmp(backGroundFileName, \"\") != 0))?tp_b.append(backGroundFileName).c_str():nullptr;\n    const char* backGroundSelectedFileName_tp = (backGroundSelectedFileName && (strcmp(backGroundSelectedFileName, \"\") != 0))?tp_bs.append(backGroundSelectedFileName).c_str():nullptr;\n    const char* frontCrossFileName_tp = (frontCrossFileName && (strcmp(frontCrossFileName, \"\") != 0))?tp_c.append(frontCrossFileName).c_str():nullptr;\n    const char* backGroundDisabledFileName_tp = (backGroundDisabledFileName && (strcmp(backGroundDisabledFileName, \"\") != 0))?tp_bd.append(backGroundDisabledFileName).c_str():nullptr;\n    const char* frontCrossDisabledFileName_tp = (frontCrossDisabledFileName && (strcmp(frontCrossDisabledFileName, \"\") != 0))?tp_cd.append(frontCrossDisabledFileName).c_str():nullptr;\n    bool useMergedTexture = DICTOOL->getBooleanValue_json(options, \"useMergedTexture\");\n    \n    if (useMergedTexture)\n    {\n        checkBox->loadTextures(backGroundFileName, backGroundSelectedFileName, frontCrossFileName,backGroundDisabledFileName,frontCrossDisabledFileName,UI_TEX_TYPE_PLIST);\n    }\n    else\n    {\n        checkBox->loadTextures(backGroundFileName_tp, backGroundSelectedFileName_tp, frontCrossFileName_tp,backGroundDisabledFileName_tp,frontCrossDisabledFileName_tp);\n    }\n    \n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForImageViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::ImageView* imageView = static_cast<ImageView*>(widget);\n    const char* imageFileName = DICTOOL->getStringValue_json(options, \"fileName\");\n    bool scale9EnableExist = DICTOOL->checkObjectExist_json(options, \"scale9Enable\");\n    bool scale9Enable = false;\n    if (scale9EnableExist)\n    {\n        scale9Enable = DICTOOL->getBooleanValue_json(options, \"scale9Enable\");\n    }\n    imageView->setScale9Enabled(scale9Enable);\n    \n    std::string tp_i = m_strFilePath;\n    const char* imageFileName_tp = nullptr;\n    if (imageFileName && (strcmp(imageFileName, \"\") != 0))\n    {\n        imageFileName_tp = tp_i.append(imageFileName).c_str();\n    }\n    \n    bool useMergedTexture = DICTOOL->getBooleanValue_json(options, \"useMergedTexture\");\n    if (scale9Enable)\n    {\n        if (useMergedTexture)\n        {\n            imageView->loadTexture(imageFileName,UI_TEX_TYPE_PLIST);\n        }\n        else\n        {\n            imageView->loadTexture(imageFileName_tp);\n        }\n        \n        bool sw = DICTOOL->checkObjectExist_json(options, \"scale9Width\");\n        bool sh = DICTOOL->checkObjectExist_json(options, \"scale9Height\");\n        if (sw && sh)\n        {\n            float swf = DICTOOL->getFloatValue_json(options, \"scale9Width\");\n            float shf = DICTOOL->getFloatValue_json(options, \"scale9Height\");\n            imageView->setSize(Size(swf, shf));\n        }\n        \n        float cx = DICTOOL->getFloatValue_json(options, \"capInsetsX\");\n        float cy = DICTOOL->getFloatValue_json(options, \"capInsetsY\");\n        float cw = DICTOOL->getFloatValue_json(options, \"capInsetsWidth\");\n        float ch = DICTOOL->getFloatValue_json(options, \"capInsetsHeight\");\n        imageView->setCapInsets(Rect(cx, cy, cw, ch));\n        \n    }\n    else\n    {\n        if (useMergedTexture)\n        {\n            imageView->loadTexture(imageFileName,UI_TEX_TYPE_PLIST);\n        }\n        else\n        {\n            imageView->loadTexture(imageFileName_tp);\n        }\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::Text* label = static_cast<cocos2d::gui::Text*>(widget);\n    bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, \"touchScaleEnable\");\n    label->setTouchScaleChangeEnabled(touchScaleChangeAble);\n    const char* text = DICTOOL->getStringValue_json(options, \"text\");\n    label->setText(text);\n    bool fs = DICTOOL->checkObjectExist_json(options, \"fontSize\");\n    if (fs)\n    {\n        label->setFontSize(DICTOOL->getIntValue_json(options, \"fontSize\"));\n    }\n    bool fn = DICTOOL->checkObjectExist_json(options, \"fontName\");\n    if (fn)\n    {\n        label->setFontName(DICTOOL->getStringValue_json(options, \"fontName\"));\n    }\n    bool aw = DICTOOL->checkObjectExist_json(options, \"areaWidth\");\n    bool ah = DICTOOL->checkObjectExist_json(options, \"areaHeight\");\n    if (aw && ah)\n    {\n        Size size = Size(DICTOOL->getFloatValue_json(options, \"areaWidth\"),DICTOOL->getFloatValue_json(options,\"areaHeight\"));\n        label->setTextAreaSize(size);\n    }\n    bool ha = DICTOOL->checkObjectExist_json(options, \"hAlignment\");\n    if (ha)\n    {\n        label->setTextHorizontalAlignment((TextHAlignment)DICTOOL->getIntValue_json(options, \"hAlignment\"));\n    }\n    bool va = DICTOOL->checkObjectExist_json(options, \"vAlignment\");\n    if (va)\n    {\n        label->setTextVerticalAlignment((TextVAlignment)DICTOOL->getIntValue_json(options, \"vAlignment\"));\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::TextAtlas* labelAtlas = static_cast<cocos2d::gui::TextAtlas*>(widget);\n    bool sv = DICTOOL->checkObjectExist_json(options, \"stringValue\");\n    bool cmf = DICTOOL->checkObjectExist_json(options, \"charMapFile\");\n    bool iw = DICTOOL->checkObjectExist_json(options, \"itemWidth\");\n    bool ih = DICTOOL->checkObjectExist_json(options, \"itemHeight\");\n    bool scm = DICTOOL->checkObjectExist_json(options, \"startCharMap\");\n    if (sv && cmf && iw && ih && scm && (strcmp(DICTOOL->getStringValue_json(options, \"charMapFile\"), \"\") != 0))\n    {\n        std::string tp_c = m_strFilePath;\n        const char* cmf_tp = nullptr;\n        const char* cmft = DICTOOL->getStringValue_json(options, \"charMapFile\");\n        cmf_tp = tp_c.append(cmft).c_str();\n        \n        labelAtlas->setProperty(DICTOOL->getStringValue_json(options, \"stringValue\"),cmf_tp,DICTOOL->getIntValue_json(options, \"itemWidth\"),DICTOOL->getIntValue_json(options,\"itemHeight\"),DICTOOL->getStringValue_json(options, \"startCharMap\"));\n        labelAtlas->setProperty(DICTOOL->getStringValue_json(options, \"stringValue\"),cmf_tp,DICTOOL->getIntValue_json(options, \"itemWidth\") / CC_CONTENT_SCALE_FACTOR() ,DICTOOL->getIntValue_json(options,\"itemHeight\") / CC_CONTENT_SCALE_FACTOR(), DICTOOL->getStringValue_json(options, \"startCharMap\"));\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForLayoutFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    Layout* containerWidget = static_cast<Layout*>(widget);\n    if (!dynamic_cast<cocos2d::gui::ScrollView*>(containerWidget)\n        && !dynamic_cast<cocos2d::gui::ListView*>(containerWidget))\n    {\n        containerWidget->setClippingEnabled(DICTOOL->getBooleanValue_json(options, \"clipAble\"));\n    }\n    Layout* panel = (Layout*)widget;\n    bool backGroundScale9Enable = DICTOOL->getBooleanValue_json(options, \"backGroundScale9Enable\");\n    panel->setBackGroundImageScale9Enabled(backGroundScale9Enable);\n    int cr = DICTOOL->getIntValue_json(options, \"bgColorR\");\n    int cg = DICTOOL->getIntValue_json(options, \"bgColorG\");\n    int cb = DICTOOL->getIntValue_json(options, \"bgColorB\");\n    \n    int scr = DICTOOL->getIntValue_json(options, \"bgStartColorR\");\n    int scg = DICTOOL->getIntValue_json(options, \"bgStartColorG\");\n    int scb = DICTOOL->getIntValue_json(options, \"bgStartColorB\");\n    \n    int ecr = DICTOOL->getIntValue_json(options, \"bgEndColorR\");\n    int ecg = DICTOOL->getIntValue_json(options, \"bgEndColorG\");\n    int ecb = DICTOOL->getIntValue_json(options, \"bgEndColorB\");\n    \n    float bgcv1 = DICTOOL->getFloatValue_json(options, \"vectorX\");\n    float bgcv2 = DICTOOL->getFloatValue_json(options, \"vectorY\");\n    panel->setBackGroundColorVector(Point(bgcv1, bgcv2));\n    \n    int co = DICTOOL->getIntValue_json(options, \"bgColorOpacity\");\n    \n    int colorType = DICTOOL->getIntValue_json(options, \"colorType\");\n    panel->setBackGroundColorType(LayoutBackGroundColorType(colorType));\n    panel->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));\n    panel->setBackGroundColor(Color3B(cr, cg, cb));\n    panel->setBackGroundColorOpacity(co);\n    \n    std::string tp_b = m_strFilePath;\n    const char* imageFileName = DICTOOL->getStringValue_json(options, \"backGroundImage\");\n    const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n    bool useMergedTexture = DICTOOL->getBooleanValue_json(options, \"useMergedTexture\");\n    if (backGroundScale9Enable)\n    {\n        float cx = DICTOOL->getFloatValue_json(options, \"capInsetsX\");\n        float cy = DICTOOL->getFloatValue_json(options, \"capInsetsY\");\n        float cw = DICTOOL->getFloatValue_json(options, \"capInsetsWidth\");\n        float ch = DICTOOL->getFloatValue_json(options, \"capInsetsHeight\");\n        if (useMergedTexture)\n        {\n            panel->setBackGroundImage(imageFileName,UI_TEX_TYPE_PLIST);\n        }\n        else\n        {\n            panel->setBackGroundImage(imageFileName_tp);\n        }\n        panel->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));\n    }\n    else\n    {\n        \n        if (useMergedTexture)\n        {\n            panel->setBackGroundImage(imageFileName,UI_TEX_TYPE_PLIST);\n        }\n        else\n        {\n            panel->setBackGroundImage(imageFileName_tp);\n        }\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForScrollViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForLayoutFromJsonDictionary(widget, options);\n    cocos2d::gui::ScrollView* scrollView = static_cast<cocos2d::gui::ScrollView*>(widget);\n    float innerWidth = DICTOOL->getFloatValue_json(options, \"innerWidth\");\n    float innerHeight = DICTOOL->getFloatValue_json(options, \"innerHeight\");\n    scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));\n\tint direction = DICTOOL->getFloatValue_json(options, \"direction\");\n    scrollView->setDirection((SCROLLVIEW_DIR)direction);\n    scrollView->setBounceEnabled(DICTOOL->getBooleanValue_json(options, \"bounceEnable\"));\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::Slider* slider = static_cast<cocos2d::gui::Slider*>(widget);\n    \n    bool barTextureScale9Enable = DICTOOL->getBooleanValue_json(options, \"barTextureScale9Enable\");\n    slider->setScale9Enabled(barTextureScale9Enable);\n    bool bt = DICTOOL->checkObjectExist_json(options, \"barFileName\");\n    float barLength = DICTOOL->getFloatValue_json(options, \"length\");\n    bool useMergedTexture = DICTOOL->getBooleanValue_json(options, \"useMergedTexture\");\n    if (bt)\n    {\n        if (barTextureScale9Enable)\n        {\n            std::string tp_b = m_strFilePath;\n            const char* imageFileName = DICTOOL->getStringValue_json(options, \"barFileName\");\n            const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n            if (useMergedTexture)\n            {\n                slider->loadBarTexture(imageFileName,UI_TEX_TYPE_PLIST);\n            }\n            else\n            {\n                slider->loadBarTexture(imageFileName_tp);\n            }\n            slider->setSize(Size(barLength, slider->getContentSize().height));\n        }\n        else\n        {\n            std::string tp_b = m_strFilePath;\n            const char* imageFileName = DICTOOL->getStringValue_json(options, \"barFileName\");\n            const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n            if (useMergedTexture)\n            {\n                slider->loadBarTexture(imageFileName,UI_TEX_TYPE_PLIST);\n            }\n            else\n            {\n                slider->loadBarTexture(imageFileName_tp);\n            }\n        }\n    }\n    std::string tp_n = m_strFilePath;\n    std::string tp_p = m_strFilePath;\n    std::string tp_d = m_strFilePath;\n    \n    const char* normalFileName = DICTOOL->getStringValue_json(options, \"ballNormal\");\n    const char* pressedFileName = DICTOOL->getStringValue_json(options, \"ballPressed\");\n    const char* disabledFileName = DICTOOL->getStringValue_json(options, \"ballDisabled\");\n    \n    const char* normalFileName_tp = (normalFileName && (strcmp(normalFileName, \"\") != 0))?tp_n.append(normalFileName).c_str():nullptr;\n    const char* pressedFileName_tp = (pressedFileName && (strcmp(pressedFileName, \"\") != 0))?tp_p.append(pressedFileName).c_str():nullptr;\n    const char* disabledFileName_tp =  (disabledFileName && (strcmp(disabledFileName, \"\") != 0))?tp_d.append(disabledFileName).c_str():nullptr;\n    if (useMergedTexture)\n    {\n        slider->loadSlidBallTextures(normalFileName,pressedFileName,disabledFileName,UI_TEX_TYPE_PLIST);\n    }\n    else\n    {\n        slider->loadSlidBallTextures(normalFileName_tp,pressedFileName_tp,disabledFileName_tp);\n    }\n    slider->setPercent(DICTOOL->getIntValue_json(options, \"percent\"));\n    \n    std::string tp_b = m_strFilePath;\n    const char* imageFileName = DICTOOL->getStringValue_json(options, \"progressBarFileName\");\n    const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n    if (useMergedTexture)\n    {\n        slider->loadProgressBarTexture(imageFileName, UI_TEX_TYPE_PLIST);\n    }\n    else\n    {\n        slider->loadProgressBarTexture(imageFileName_tp);\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::TextField* textField = static_cast<cocos2d::gui::TextField*>(widget);\n    bool ph = DICTOOL->checkObjectExist_json(options, \"placeHolder\");\n    if (ph)\n    {\n        textField->setPlaceHolder(DICTOOL->getStringValue_json(options, \"placeHolder\"));\n    }\n    textField->setText(DICTOOL->getStringValue_json(options, \"text\"));\n    bool fs = DICTOOL->checkObjectExist_json(options, \"fontSize\");\n    if (fs)\n    {\n        textField->setFontSize(DICTOOL->getIntValue_json(options, \"fontSize\"));\n    }\n    bool fn = DICTOOL->checkObjectExist_json(options, \"fontName\");\n    if (fn)\n    {\n        textField->setFontName(DICTOOL->getStringValue_json(options, \"fontName\"));\n    }\n    bool tsw = DICTOOL->checkObjectExist_json(options, \"touchSizeWidth\");\n    bool tsh = DICTOOL->checkObjectExist_json(options, \"touchSizeHeight\");\n    if (tsw && tsh)\n    {\n        textField->setTouchSize(Size(DICTOOL->getFloatValue_json(options, \"touchSizeWidth\"), DICTOOL->getFloatValue_json(options,\"touchSizeHeight\")));\n    }\n    \n    float dw = DICTOOL->getFloatValue_json(options, \"width\");\n    float dh = DICTOOL->getFloatValue_json(options, \"height\");\n    if (dw > 0.0f || dh > 0.0f)\n    {\n        //textField->setSize(Size(dw, dh));\n    }\n    bool maxLengthEnable = DICTOOL->getBooleanValue_json(options, \"maxLengthEnable\");\n    textField->setMaxLengthEnabled(maxLengthEnable);\n    \n    if (maxLengthEnable)\n    {\n        int maxLength = DICTOOL->getIntValue_json(options, \"maxLength\");\n        textField->setMaxLength(maxLength);\n    }\n    bool passwordEnable = DICTOOL->getBooleanValue_json(options, \"passwordEnable\");\n    textField->setPasswordEnabled(passwordEnable);\n    if (passwordEnable)\n    {\n        textField->setPasswordStyleText(DICTOOL->getStringValue_json(options, \"passwordStyleText\"));\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::LoadingBar* loadingBar = static_cast<cocos2d::gui::LoadingBar*>(widget);\n    bool useMergedTexture = DICTOOL->getBooleanValue_json(options, \"useMergedTexture\");\n    std::string tp_b = m_strFilePath;\n    const char*imageFileName =  DICTOOL->getStringValue_json(options, \"texture\");\n    const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n    if (useMergedTexture)\n    {\n        loadingBar->loadTexture(imageFileName,UI_TEX_TYPE_PLIST);\n    }\n    else\n    {\n        loadingBar->loadTexture(imageFileName_tp);\n    }\n    loadingBar->setDirection(LoadingBarType(DICTOOL->getIntValue_json(options, \"direction\")));\n    loadingBar->setPercent(DICTOOL->getIntValue_json(options, \"percent\"));\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0250::setPropsForLabelBMFontFromJsonDictionary(Widget *widget, const rapidjson::Value&options)\n{\n    \n    setPropsForWidgetFromJsonDictionary(widget, options);\n    \n    cocos2d::gui::TextBMFont* labelBMFont = static_cast<cocos2d::gui::TextBMFont*>(widget);\n    \n    std::string tp_c = m_strFilePath;\n    const char* cmf_tp = nullptr;\n    const char* cmft = DICTOOL->getStringValue_json(options, \"fileName\");\n    cmf_tp = tp_c.append(cmft).c_str();\n    \n    labelBMFont->setFntFile(cmf_tp);\n    \n    const char* text = DICTOOL->getStringValue_json(options, \"text\");\n    labelBMFont->setText(text);\n    \n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\n\n/*0.3.0.0~1.0.0.0*/\nWidget* WidgetPropertiesReader0300::createWidget(const rapidjson::Value& data, const char* fullPath, const char* fileName)\n{\n    m_strFilePath = fullPath;\n\n    int texturesCount = DICTOOL->getArrayCount_json(data, \"textures\");\n    \n    for (int i=0; i<texturesCount; i++)\n    {\n        const char* file = DICTOOL->getStringValueFromArray_json(data, \"textures\", i);\n        std::string tp = fullPath;\n        tp.append(file);\n        SpriteFrameCache::getInstance()->addSpriteFramesWithFile(tp.c_str());\n    }\n    float fileDesignWidth = DICTOOL->getFloatValue_json(data, \"designWidth\");\n    float fileDesignHeight = DICTOOL->getFloatValue_json(data, \"designHeight\");\n    if (fileDesignWidth <= 0 || fileDesignHeight <= 0) {\n        CCLOGERROR(\"Read design size error!\\n\");\n        Size winSize = Director::getInstance()->getWinSize();\n        GUIReader::getInstance()->storeFileDesignSize(fileName, winSize);\n    }\n    else\n    {\n        GUIReader::getInstance()->storeFileDesignSize(fileName, Size(fileDesignWidth, fileDesignHeight));\n    }\n    const rapidjson::Value& widgetTree = DICTOOL->getSubDictionary_json(data, \"widgetTree\");\n    Widget* widget = widgetFromJsonDictionary(widgetTree);\n    \n    /* *********temp********* */\n    if (widget->getContentSize().equals(Size::ZERO))\n    {\n        Layout* rootWidget = dynamic_cast<Layout*>(widget);\n        rootWidget->setSize(Size(fileDesignWidth, fileDesignHeight));\n    }\n    /* ********************** */\n    \n    //    widget->setFileDesignSize(Size(fileDesignWidth, fileDesignHeight));\n    const rapidjson::Value& actions = DICTOOL->getSubDictionary_json(data, \"animation\");\n    /* *********temp********* */\n    //    ActionManager::getInstance()->releaseActions();\n    /* ********************** */\n    CCLOG(\"file name == [%s]\",fileName);\n    Object* rootWidget = (Object*) widget;\n    ActionManagerEx::getInstance()->initWithDictionary(fileName,actions,rootWidget);\n    return widget;\n}\n\nWidget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Value&data)\n{\n    Widget* widget = nullptr;\n    const char* classname = DICTOOL->getStringValue_json(data, \"classname\");\n    const rapidjson::Value& uiOptions = DICTOOL->getSubDictionary_json(data, \"options\");\n    if (classname && strcmp(classname, \"Button\") == 0)\n    {\n        widget = cocos2d::gui::Button::create();\n        setPropsForButtonFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"CheckBox\") == 0)\n    {\n        widget = CheckBox::create();\n        setPropsForCheckBoxFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"Label\") == 0)\n    {\n        widget = cocos2d::gui::Text::create();\n        setPropsForLabelFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"LabelAtlas\") == 0)\n    {\n        widget = cocos2d::gui::TextAtlas::create();\n        setPropsForLabelAtlasFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"LoadingBar\") == 0)\n    {\n        widget = cocos2d::gui::LoadingBar::create();\n        setPropsForLoadingBarFromJsonDictionary(widget, uiOptions);\n    }else if (classname && strcmp(classname, \"ScrollView\") == 0){\n        widget = cocos2d::gui::ScrollView::create();\n        setPropsForScrollViewFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"TextArea\") == 0)\n    {\n        widget = cocos2d::gui::Text::create();\n        setPropsForLabelFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"TextButton\") == 0)\n    {\n        widget = cocos2d::gui::Button::create();\n        setPropsForButtonFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"TextField\") == 0)\n    {\n        widget = cocos2d::gui::TextField::create();\n        setPropsForTextFieldFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"ImageView\") == 0)\n    {\n        widget = cocos2d::gui::ImageView::create();\n        setPropsForImageViewFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"Panel\") == 0)\n    {\n        widget = Layout::create();\n        setPropsForLayoutFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"Slider\") == 0)\n    {\n        widget = cocos2d::gui::Slider::create();\n        setPropsForSliderFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"LabelBMFont\") == 0)\n    {\n        widget = cocos2d::gui::TextBMFont::create();\n        setPropsForLabelBMFontFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"DragPanel\") == 0)\n    {\n        widget = cocos2d::gui::ScrollView::create();\n        setPropsForScrollViewFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"ListView\") == 0)\n    {\n        widget = cocos2d::gui::ListView::create();\n        setPropsForListViewFromJsonDictionary(widget, uiOptions);\n    }\n    else if (classname && strcmp(classname, \"PageView\") == 0)\n    {\n        widget = cocos2d::gui::PageView::create();\n        setPropsForPageViewFromJsonDictionary(widget, uiOptions);\n    }\n    \n    int childrenCount = DICTOOL->getArrayCount_json(data, \"children\");\n    for (int i=0;i<childrenCount;i++)\n    {\n        const rapidjson::Value& subData = DICTOOL->getDictionaryFromArray_json(data, \"children\", i);\n        Widget* child = widgetFromJsonDictionary(subData);\n        if (child)\n        {\n            PageView* pageView = dynamic_cast<PageView*>(widget);\n            if (pageView)\n            {\n                pageView->addPage(static_cast<Layout*>(child));\n            }\n            else\n            {\n                ListView* listView = dynamic_cast<ListView*>(widget);\n                if (listView)\n                {\n                    listView->pushBackCustomItem(child);\n                }\n                else\n                {\n                    widget->addChild(child);\n                }\n            }\n        }\n    }\n\n    return widget;\n}\n\nvoid WidgetPropertiesReader0300::setPropsForWidgetFromJsonDictionary(Widget*widget,const rapidjson::Value&options)\n{\n    bool ignoreSizeExsit = DICTOOL->checkObjectExist_json(options, \"ignoreSize\");\n    if (ignoreSizeExsit)\n    {\n        widget->ignoreContentAdaptWithSize(DICTOOL->getBooleanValue_json(options, \"ignoreSize\"));\n    }\n    \n    widget->setSizeType((SizeType)DICTOOL->getIntValue_json(options, \"sizeType\"));\n    widget->setPositionType((PositionType)DICTOOL->getIntValue_json(options, \"positionType\"));\n    \n    widget->setSizePercent(Point(DICTOOL->getFloatValue_json(options, \"sizePercentX\"), DICTOOL->getFloatValue_json(options, \"sizePercentY\")));\n    widget->setPositionPercent(Point(DICTOOL->getFloatValue_json(options, \"positionPercentX\"), DICTOOL->getFloatValue_json(options, \"positionPercentY\")));\n    \n    float w = DICTOOL->getFloatValue_json(options, \"width\");\n    float h = DICTOOL->getFloatValue_json(options, \"height\");\n    widget->setSize(Size(w, h));\n    \n    widget->setTag(DICTOOL->getIntValue_json(options, \"tag\"));\n\twidget->setActionTag(DICTOOL->getIntValue_json(options, \"actiontag\"));\n    widget->setTouchEnabled(DICTOOL->getBooleanValue_json(options, \"touchAble\"));\n    const char* name = DICTOOL->getStringValue_json(options, \"name\");\n    const char* widgetName = name?name:\"default\";\n    widget->setName(widgetName);\n    float x = DICTOOL->getFloatValue_json(options, \"x\");\n    float y = DICTOOL->getFloatValue_json(options, \"y\");\n    widget->setPosition(Point(x,y));\n    bool sx = DICTOOL->checkObjectExist_json(options, \"scaleX\");\n    if (sx)\n    {\n        widget->setScaleX(DICTOOL->getFloatValue_json(options, \"scaleX\"));\n    }\n    bool sy = DICTOOL->checkObjectExist_json(options, \"scaleY\");\n    if (sy)\n    {\n        widget->setScaleY(DICTOOL->getFloatValue_json(options, \"scaleY\"));\n    }\n    bool rt = DICTOOL->checkObjectExist_json(options, \"rotation\");\n    if (rt)\n    {\n        widget->setRotation(DICTOOL->getFloatValue_json(options, \"rotation\"));\n    }\n    bool vb = DICTOOL->checkObjectExist_json(options, \"visible\");\n    if (vb)\n    {\n        widget->setVisible(DICTOOL->getBooleanValue_json(options, \"visible\"));\n    }\n    int z = DICTOOL->getIntValue_json(options, \"ZOrder\");\n    widget->setLocalZOrder(z);\n\n\tbool layout = DICTOOL->checkObjectExist_json(options, \"layoutParameter\");\n\tif (layout)\n\t{\n\t\tconst rapidjson::Value& layoutParameterDic = DICTOOL->getSubDictionary_json(options, \"layoutParameter\");\n\t\tint paramType = DICTOOL->getIntValue_json(layoutParameterDic, \"type\");\n        LayoutParameter* parameter = nullptr;\n        switch (paramType)\n        {\n            case 0:\n                break;\n            case 1:\n            {\n                parameter = LinearLayoutParameter::create();\n\t\t\t\tint gravity = DICTOOL->getIntValue_json(layoutParameterDic, \"gravity\");\n                ((LinearLayoutParameter*)parameter)->setGravity((LinearGravity)gravity);\n                break;\n            }\n            case 2:\n            {\n                parameter = RelativeLayoutParameter::create();\n                RelativeLayoutParameter* rParameter = (RelativeLayoutParameter*)parameter;\n\t\t\t\tconst char* relativeName = DICTOOL->getStringValue_json(layoutParameterDic, \"relativeName\");\n                rParameter->setRelativeName(relativeName);\n\t\t\t\tconst char* relativeToName = DICTOOL->getStringValue_json(layoutParameterDic, \"relativeToName\");\n                rParameter->setRelativeToWidgetName(relativeToName);\n\t\t\t\tint align = DICTOOL->getIntValue_json(layoutParameterDic, \"align\");\n                rParameter->setAlign((RelativeAlign)align);\n                break;\n            }\n            default:\n                break;\n        }\n        if (parameter)\n        {\n\t\t\tfloat mgl = DICTOOL->getFloatValue_json(layoutParameterDic, \"marginLeft\");\n\t\t\tfloat mgt = DICTOOL->getFloatValue_json(layoutParameterDic, \"marginTop\");\n\t\t\tfloat mgr = DICTOOL->getFloatValue_json(layoutParameterDic, \"marginRight\");\n\t\t\tfloat mgb = DICTOOL->getFloatValue_json(layoutParameterDic, \"marginDown\");\n            parameter->setMargin(Margin(mgl, mgt, mgr, mgb));\n            widget->setLayoutParameter(parameter);\n        }\n    }\n}\n\nvoid WidgetPropertiesReader0300::setColorPropsForWidgetFromJsonDictionary(Widget *widget, const rapidjson::Value&options)\n{\n    bool op = DICTOOL->checkObjectExist_json(options, \"opacity\");\n    if (op)\n    {\n        widget->setOpacity(DICTOOL->getIntValue_json(options, \"opacity\"));\n    }\n    bool cr = DICTOOL->checkObjectExist_json(options, \"colorR\");\n    bool cg = DICTOOL->checkObjectExist_json(options, \"colorG\");\n    bool cb = DICTOOL->checkObjectExist_json(options, \"colorB\");\n    int colorR = cr ? DICTOOL->getIntValue_json(options, \"colorR\") : 255;\n    int colorG = cg ? DICTOOL->getIntValue_json(options, \"colorG\") : 255;\n    int colorB = cb ? DICTOOL->getIntValue_json(options, \"colorB\") : 255;\n    widget->setColor(Color3B(colorR, colorG, colorB));\n    bool apx = DICTOOL->checkObjectExist_json(options, \"anchorPointX\");\n    float apxf = apx ? DICTOOL->getFloatValue_json(options, \"anchorPointX\") : ((widget->getWidgetType() == WidgetTypeWidget) ? 0.5f : 0.0f);\n    bool apy = DICTOOL->checkObjectExist_json(options, \"anchorPointY\");\n    float apyf = apy ? DICTOOL->getFloatValue_json(options, \"anchorPointY\") : ((widget->getWidgetType() == WidgetTypeWidget) ? 0.5f : 0.0f);\n    widget->setAnchorPoint(Point(apxf, apyf));\n    bool flipX = DICTOOL->getBooleanValue_json(options, \"flipX\");\n    bool flipY = DICTOOL->getBooleanValue_json(options, \"flipY\");\n    widget->setFlipX(flipX);\n    widget->setFlipY(flipY);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForButtonFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::Button* button = static_cast<cocos2d::gui::Button*>(widget);\n    bool scale9Enable = DICTOOL->getBooleanValue_json(options, \"scale9Enable\");\n    button->setScale9Enabled(scale9Enable);\n    \n    const rapidjson::Value& normalDic = DICTOOL->getSubDictionary_json(options, \"normalData\");\n    int normalType = DICTOOL->getIntValue_json(normalDic, \"resourceType\");\n    switch (normalType)\n    {\n        case 0:\n        {\n            std::string tp_n = m_strFilePath;\n            const char* normalFileName = DICTOOL->getStringValue_json(normalDic, \"path\");\n            const char* normalFileName_tp = (normalFileName && (strcmp(normalFileName, \"\") != 0))?tp_n.append(normalFileName).c_str():nullptr;\n            button->loadTextureNormal(normalFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* normalFileName = DICTOOL->getStringValue_json(normalDic, \"path\");\n            button->loadTextureNormal(normalFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    const rapidjson::Value& pressedDic = DICTOOL->getSubDictionary_json(options, \"pressedData\");\n    int pressedType = DICTOOL->getIntValue_json(pressedDic, \"resourceType\");\n    switch (pressedType)\n    {\n        case 0:\n        {\n            std::string tp_p = m_strFilePath;\n            const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, \"path\");\n            const char* pressedFileName_tp = (pressedFileName && (strcmp(pressedFileName, \"\") != 0))?tp_p.append(pressedFileName).c_str():nullptr;\n            button->loadTexturePressed(pressedFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, \"path\");\n            button->loadTexturePressed(pressedFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    const rapidjson::Value& disabledDic = DICTOOL->getSubDictionary_json(options, \"disabledData\");\n    int disabledType = DICTOOL->getIntValue_json(disabledDic, \"resourceType\");\n    switch (disabledType)\n    {\n        case 0:\n        {\n            std::string tp_d = m_strFilePath;\n            const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, \"path\");\n            const char* disabledFileName_tp = (disabledFileName && (strcmp(disabledFileName, \"\") != 0))?tp_d.append(disabledFileName).c_str():nullptr;\n            button->loadTextureDisabled(disabledFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, \"path\");\n            button->loadTextureDisabled(disabledFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    if (scale9Enable)\n    {\n        float cx = DICTOOL->getFloatValue_json(options, \"capInsetsX\");\n        float cy = DICTOOL->getFloatValue_json(options, \"capInsetsY\");\n        float cw = DICTOOL->getFloatValue_json(options, \"capInsetsWidth\");\n        float ch = DICTOOL->getFloatValue_json(options, \"capInsetsHeight\");\n        \n        button->setCapInsets(Rect(cx, cy, cw, ch));\n        bool sw = DICTOOL->checkObjectExist_json(options, \"scale9Width\");\n        bool sh = DICTOOL->checkObjectExist_json(options, \"scale9Height\");\n        if (sw && sh)\n        {\n            float swf = DICTOOL->getFloatValue_json(options, \"scale9Width\");\n            float shf = DICTOOL->getFloatValue_json(options, \"scale9Height\");\n            button->setSize(Size(swf, shf));\n        }\n    }\n    bool tt = DICTOOL->checkObjectExist_json(options, \"text\");\n    if (tt)\n    {\n        const char* text = DICTOOL->getStringValue_json(options, \"text\");\n        if (text)\n        {\n            button->setTitleText(text);\n        }\n    }\n    \n    bool cr = DICTOOL->checkObjectExist_json(options, \"textColorR\");\n    bool cg = DICTOOL->checkObjectExist_json(options, \"textColorG\");\n    bool cb = DICTOOL->checkObjectExist_json(options, \"textColorB\");\n    int cri = cr?DICTOOL->getIntValue_json(options, \"textColorR\"):255;\n    int cgi = cg?DICTOOL->getIntValue_json(options, \"textColorG\"):255;\n    int cbi = cb?DICTOOL->getIntValue_json(options, \"textColorB\"):255;\n    button->setTitleColor(Color3B(cri,cgi,cbi));\n    bool fs = DICTOOL->checkObjectExist_json(options, \"fontSize\");\n    if (fs)\n    {\n        button->setTitleFontSize(DICTOOL->getIntValue_json(options, \"fontSize\"));\n    }\n    bool fn = DICTOOL->checkObjectExist_json(options, \"fontName\");\n    if (fn)\n    {\n        button->setTitleFontName(DICTOOL->getStringValue_json(options, \"fontName\"));\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForCheckBoxFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    CheckBox* checkBox = static_cast<cocos2d::gui::CheckBox*>(widget);\n    \n    const rapidjson::Value& backGroundDic = DICTOOL->getSubDictionary_json(options, \"backGroundBoxData\");\n    int backGroundType = DICTOOL->getIntValue_json(backGroundDic, \"resourceType\");\n    switch (backGroundType)\n    {\n        case 0:\n        {\n            std::string tp_b = m_strFilePath;\n            const char* backGroundFileName = DICTOOL->getStringValue_json(backGroundDic, \"path\");\n            const char* backGroundFileName_tp = (backGroundFileName && (strcmp(backGroundFileName, \"\") != 0))?tp_b.append(backGroundFileName).c_str():nullptr;\n            checkBox->loadTextureBackGround(backGroundFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* backGroundFileName = DICTOOL->getStringValue_json(backGroundDic, \"path\");\n            checkBox->loadTextureBackGround(backGroundFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    const rapidjson::Value& backGroundSelectedDic = DICTOOL->getSubDictionary_json(options, \"backGroundBoxSelectedData\");\n    int backGroundSelectedType = DICTOOL->getIntValue_json(backGroundSelectedDic, \"resourceType\");\n    switch (backGroundSelectedType)\n    {\n        case 0:\n        {\n            std::string tp_bs = m_strFilePath;\n            const char* backGroundSelectedFileName = DICTOOL->getStringValue_json(backGroundSelectedDic, \"path\");\n            const char* backGroundSelectedFileName_tp = (backGroundSelectedFileName && (strcmp(backGroundSelectedFileName, \"\") != 0))?tp_bs.append(backGroundSelectedFileName).c_str():nullptr;\n            checkBox->loadTextureBackGroundSelected(backGroundSelectedFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* backGroundSelectedFileName = DICTOOL->getStringValue_json(backGroundSelectedDic, \"path\");\n            checkBox->loadTextureBackGroundSelected(backGroundSelectedFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    const rapidjson::Value& frontCrossDic = DICTOOL->getSubDictionary_json(options, \"frontCrossData\");\n    int frontCrossType = DICTOOL->getIntValue_json(frontCrossDic, \"resourceType\");\n    switch (frontCrossType)\n    {\n        case 0:\n        {\n            std::string tp_c = m_strFilePath;\n            const char* frontCrossFileName = DICTOOL->getStringValue_json(frontCrossDic, \"path\");\n            const char* frontCrossFileName_tp = (frontCrossFileName && (strcmp(frontCrossFileName, \"\") != 0))?tp_c.append(frontCrossFileName).c_str():nullptr;\n            checkBox->loadTextureFrontCross(frontCrossFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* frontCrossFileName = DICTOOL->getStringValue_json(frontCrossDic, \"path\");\n            checkBox->loadTextureFrontCross(frontCrossFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    const rapidjson::Value& backGroundDisabledDic = DICTOOL->getSubDictionary_json(options, \"backGroundBoxDisabledData\");\n    int backGroundDisabledType = DICTOOL->getIntValue_json(backGroundDisabledDic, \"resourceType\");\n    switch (backGroundDisabledType)\n    {\n        case 0:\n        {\n            std::string tp_bd = m_strFilePath;\n            const char* backGroundDisabledFileName = DICTOOL->getStringValue_json(backGroundDisabledDic, \"path\");\n            const char* backGroundDisabledFileName_tp = (backGroundDisabledFileName && (strcmp(backGroundDisabledFileName, \"\") != 0))?tp_bd.append(backGroundDisabledFileName).c_str():nullptr;\n            checkBox->loadTextureBackGroundDisabled(backGroundDisabledFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* backGroundDisabledFileName = DICTOOL->getStringValue_json(backGroundDisabledDic, \"path\");\n            checkBox->loadTextureBackGroundDisabled(backGroundDisabledFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    const rapidjson::Value& frontCrossDisabledDic = DICTOOL->getSubDictionary_json(options, \"frontCrossDisabledData\");\n    int frontCrossDisabledType = DICTOOL->getIntValue_json(frontCrossDisabledDic, \"resourceType\");\n    switch (frontCrossDisabledType)\n    {\n        case 0:\n        {\n            std::string tp_cd = m_strFilePath;\n            const char* frontCrossDisabledFileName = DICTOOL->getStringValue_json(options, \"path\");\n            const char* frontCrossDisabledFileName_tp = (frontCrossDisabledFileName && (strcmp(frontCrossDisabledFileName, \"\") != 0))?tp_cd.append(frontCrossDisabledFileName).c_str():nullptr;\n            checkBox->loadTextureFrontCrossDisabled(frontCrossDisabledFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* frontCrossDisabledFileName = DICTOOL->getStringValue_json(options, \"path\");\n            checkBox->loadTextureFrontCrossDisabled(frontCrossDisabledFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForImageViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    \n    cocos2d::gui::ImageView* imageView = static_cast<cocos2d::gui::ImageView*>(widget);\n    \n    const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, \"fileNameData\");\n    int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, \"resourceType\");\n    switch (imageFileNameType)\n    {\n        case 0:\n        {\n            std::string tp_i = m_strFilePath;\n            const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n            const char* imageFileName_tp = nullptr;\n            if (imageFileName && (strcmp(imageFileName, \"\") != 0))\n            {\n                imageFileName_tp = tp_i.append(imageFileName).c_str();\n                imageView->loadTexture(imageFileName_tp);\n            }\n            break;\n        }\n        case 1:\n        {\n            const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n            imageView->loadTexture(imageFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    bool scale9EnableExist = DICTOOL->checkObjectExist_json(options, \"scale9Enable\");\n    bool scale9Enable = false;\n    if (scale9EnableExist)\n    {\n        scale9Enable = DICTOOL->getBooleanValue_json(options, \"scale9Enable\");\n    }\n    imageView->setScale9Enabled(scale9Enable);\n    \n    \n    if (scale9Enable)\n    {\n        bool sw = DICTOOL->checkObjectExist_json(options, \"scale9Width\");\n        bool sh = DICTOOL->checkObjectExist_json(options, \"scale9Height\");\n        if (sw && sh)\n        {\n            float swf = DICTOOL->getFloatValue_json(options, \"scale9Width\");\n            float shf = DICTOOL->getFloatValue_json(options, \"scale9Height\");\n            imageView->setSize(Size(swf, shf));\n        }\n        \n        float cx = DICTOOL->getFloatValue_json(options, \"capInsetsX\");\n        float cy = DICTOOL->getFloatValue_json(options, \"capInsetsY\");\n        float cw = DICTOOL->getFloatValue_json(options, \"capInsetsWidth\");\n        float ch = DICTOOL->getFloatValue_json(options, \"capInsetsHeight\");\n        \n        imageView->setCapInsets(Rect(cx, cy, cw, ch));\n        \n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForLabelFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::Text* label = static_cast<cocos2d::gui::Text*>(widget);\n    bool touchScaleChangeAble = DICTOOL->getBooleanValue_json(options, \"touchScaleEnable\");\n    label->setTouchScaleChangeEnabled(touchScaleChangeAble);\n    const char* text = DICTOOL->getStringValue_json(options, \"text\");\n    label->setText(text);\n    bool fs = DICTOOL->checkObjectExist_json(options, \"fontSize\");\n    if (fs)\n    {\n        label->setFontSize(DICTOOL->getIntValue_json(options, \"fontSize\"));\n    }\n    bool fn = DICTOOL->checkObjectExist_json(options, \"fontName\");\n    if (fn)\n    {\n        label->setFontName(DICTOOL->getStringValue_json(options, \"fontName\"));\n    }\n    bool aw = DICTOOL->checkObjectExist_json(options, \"areaWidth\");\n    bool ah = DICTOOL->checkObjectExist_json(options, \"areaHeight\");\n    if (aw && ah)\n    {\n        Size size = Size(DICTOOL->getFloatValue_json(options, \"areaWidth\"),DICTOOL->getFloatValue_json(options,\"areaHeight\"));\n        label->setTextAreaSize(size);\n    }\n    bool ha = DICTOOL->checkObjectExist_json(options, \"hAlignment\");\n    if (ha)\n    {\n        label->setTextHorizontalAlignment((TextHAlignment)DICTOOL->getIntValue_json(options, \"hAlignment\"));\n    }\n    bool va = DICTOOL->checkObjectExist_json(options, \"vAlignment\");\n    if (va)\n    {\n        label->setTextVerticalAlignment((TextVAlignment)DICTOOL->getIntValue_json(options, \"vAlignment\"));\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForLabelAtlasFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::TextAtlas* labelAtlas = static_cast<cocos2d::gui::TextAtlas*>(widget);\n    bool sv = DICTOOL->checkObjectExist_json(options, \"stringValue\");\n    bool cmf = DICTOOL->checkObjectExist_json(options, \"charMapFile\");\n    bool iw = DICTOOL->checkObjectExist_json(options, \"itemWidth\");\n    bool ih = DICTOOL->checkObjectExist_json(options, \"itemHeight\");\n    bool scm = DICTOOL->checkObjectExist_json(options, \"startCharMap\");\n    if (sv && cmf && iw && ih && scm)\n    {\n        const rapidjson::Value& cmftDic = DICTOOL->getSubDictionary_json(options, \"charMapFileData\");\n        int cmfType = DICTOOL->getIntValue_json(cmftDic, \"resourceType\");\n        switch (cmfType)\n        {\n            case 0:\n            {\n                std::string tp_c = m_strFilePath;\n                const char* cmfPath = DICTOOL->getStringValue_json(cmftDic, \"path\");\n                const char* cmf_tp = tp_c.append(cmfPath).c_str();\n                labelAtlas->setProperty(DICTOOL->getStringValue_json(options, \"stringValue\"),cmf_tp,DICTOOL->getIntValue_json(options, \"itemWidth\") / CC_CONTENT_SCALE_FACTOR(),DICTOOL->getIntValue_json(options,\"itemHeight\") / CC_CONTENT_SCALE_FACTOR(), DICTOOL->getStringValue_json(options, \"startCharMap\"));\n                break;\n            }\n            case 1:\n                CCLOG(\"Wrong res type of LabelAtlas!\");\n                break;\n            default:\n                break;\n        }\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForLayoutFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    Layout* panel = static_cast<cocos2d::gui::Layout*>(widget);\n    if (!dynamic_cast<cocos2d::gui::ScrollView*>(widget)\n        && !dynamic_cast<cocos2d::gui::ListView*>(widget))\n    {\n        panel->setClippingEnabled(DICTOOL->getBooleanValue_json(options, \"clipAble\"));\n    }\n    bool backGroundScale9Enable = DICTOOL->getBooleanValue_json(options, \"backGroundScale9Enable\");\n    panel->setBackGroundImageScale9Enabled(backGroundScale9Enable);\n    int cr = DICTOOL->getIntValue_json(options, \"bgColorR\");\n    int cg = DICTOOL->getIntValue_json(options, \"bgColorG\");\n    int cb = DICTOOL->getIntValue_json(options, \"bgColorB\");\n    \n    int scr = DICTOOL->getIntValue_json(options, \"bgStartColorR\");\n    int scg = DICTOOL->getIntValue_json(options, \"bgStartColorG\");\n    int scb = DICTOOL->getIntValue_json(options, \"bgStartColorB\");\n    \n    int ecr = DICTOOL->getIntValue_json(options, \"bgEndColorR\");\n    int ecg = DICTOOL->getIntValue_json(options, \"bgEndColorG\");\n    int ecb = DICTOOL->getIntValue_json(options, \"bgEndColorB\");\n    \n    float bgcv1 = DICTOOL->getFloatValue_json(options, \"vectorX\");\n    float bgcv2 = DICTOOL->getFloatValue_json(options, \"vectorY\");\n    panel->setBackGroundColorVector(Point(bgcv1, bgcv2));\n    \n    int co = DICTOOL->getIntValue_json(options, \"bgColorOpacity\");\n    \n    int colorType = DICTOOL->getIntValue_json(options, \"colorType\");\n    panel->setBackGroundColorType(LayoutBackGroundColorType(colorType));\n    panel->setBackGroundColor(Color3B(scr, scg, scb),Color3B(ecr, ecg, ecb));\n    panel->setBackGroundColor(Color3B(cr, cg, cb));\n    panel->setBackGroundColorOpacity(co);\n    \n    \n    const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, \"backGroundImageData\");\n    int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, \"resourceType\");\n    switch (imageFileNameType)\n    {\n        case 0:\n        {\n            std::string tp_b = m_strFilePath;\n            const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n            const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n            panel->setBackGroundImage(imageFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n            panel->setBackGroundImage(imageFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    if (backGroundScale9Enable)\n    {\n        float cx = DICTOOL->getFloatValue_json(options, \"capInsetsX\");\n        float cy = DICTOOL->getFloatValue_json(options, \"capInsetsY\");\n        float cw = DICTOOL->getFloatValue_json(options, \"capInsetsWidth\");\n        float ch = DICTOOL->getFloatValue_json(options, \"capInsetsHeight\");\n        panel->setBackGroundImageCapInsets(Rect(cx, cy, cw, ch));\n    }\n    panel->setLayoutType((LayoutType)DICTOOL->getIntValue_json(options, \"layoutType\"));\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForScrollViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForLayoutFromJsonDictionary(widget, options);\n    cocos2d::gui::ScrollView* scrollView = static_cast<cocos2d::gui::ScrollView*>(widget);\n    float innerWidth = DICTOOL->getFloatValue_json(options, \"innerWidth\");\n    float innerHeight = DICTOOL->getFloatValue_json(options, \"innerHeight\");\n    scrollView->setInnerContainerSize(Size(innerWidth, innerHeight));\n\tint direction = DICTOOL->getFloatValue_json(options, \"direction\");\n    scrollView->setDirection((SCROLLVIEW_DIR)direction);\n    scrollView->setBounceEnabled(DICTOOL->getBooleanValue_json(options, \"bounceEnable\"));\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::Slider* slider = static_cast<cocos2d::gui::Slider*>(widget);\n    \n    bool barTextureScale9Enable = DICTOOL->getBooleanValue_json(options, \"barTextureScale9Enable\");\n    slider->setScale9Enabled(barTextureScale9Enable);\n    bool bt = DICTOOL->checkObjectExist_json(options, \"barFileName\");\n    float barLength = DICTOOL->getFloatValue_json(options, \"length\");\n    if (bt)\n    {\n        if (barTextureScale9Enable)\n        {\n            \n            const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, \"barFileNameData\");\n            int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, \"resourceType\");\n            switch (imageFileType)\n            {\n                case 0:\n                {\n                    std::string tp_b = m_strFilePath;\n                    const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n                    const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n                    slider->loadBarTexture(imageFileName_tp);\n                    break;\n                }\n                case 1:\n                {\n                    const char* imageFileName =  DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n                    slider->loadBarTexture(imageFileName,UI_TEX_TYPE_PLIST);\n                    break;\n                }\n                default:\n                    break;\n            }\n            \n            slider->setSize(Size(barLength, slider->getContentSize().height));\n        }\n        else\n        {\n            const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, \"barFileNameData\");\n            int imageFileType = DICTOOL->getIntValue_json(imageFileNameDic, \"resourceType\");\n            switch (imageFileType)\n            {\n                case 0:\n                {\n                    std::string tp_b = m_strFilePath;\n                    const char*imageFileName =  DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n                    const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n                    slider->loadBarTexture(imageFileName_tp);\n                    break;\n                }\n                case 1:\n                {\n                    const char*imageFileName =  DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n                    slider->loadBarTexture(imageFileName,UI_TEX_TYPE_PLIST);\n                    break;\n                }\n                default:\n                    break;\n            }\n        }\n    }\n    \n    const rapidjson::Value& normalDic = DICTOOL->getSubDictionary_json(options, \"ballNormalData\");\n    int normalType = DICTOOL->getIntValue_json(normalDic, \"resourceType\");\n    switch (normalType)\n    {\n        case 0:\n        {\n            std::string tp_n = m_strFilePath;\n            const char* normalFileName = DICTOOL->getStringValue_json(normalDic, \"path\");\n            const char* normalFileName_tp = (normalFileName && (strcmp(normalFileName, \"\") != 0))?tp_n.append(normalFileName).c_str():nullptr;\n            slider->loadSlidBallTextureNormal(normalFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* normalFileName = DICTOOL->getStringValue_json(normalDic, \"path\");\n            slider->loadSlidBallTextureNormal(normalFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    const rapidjson::Value& pressedDic = DICTOOL->getSubDictionary_json(options, \"ballPressedData\");\n    int pressedType = DICTOOL->getIntValue_json(pressedDic, \"resourceType\");\n    switch (pressedType)\n    {\n        case 0:\n        {\n            std::string tp_p = m_strFilePath;\n            const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, \"path\");\n            const char* pressedFileName_tp = (pressedFileName && (strcmp(pressedFileName, \"\") != 0))?tp_p.append(pressedFileName).c_str():nullptr;\n            slider->loadSlidBallTexturePressed(pressedFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* pressedFileName = DICTOOL->getStringValue_json(pressedDic, \"path\");\n            slider->loadSlidBallTexturePressed(pressedFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    const rapidjson::Value& disabledDic = DICTOOL->getSubDictionary_json(options, \"ballDisabledData\");\n    int disabledType = DICTOOL->getIntValue_json(disabledDic, \"resourceType\");\n    switch (disabledType)\n    {\n        case 0:\n        {\n            std::string tp_d = m_strFilePath;\n            const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, \"path\");\n            const char* disabledFileName_tp = (disabledFileName && (strcmp(disabledFileName, \"\") != 0))?tp_d.append(disabledFileName).c_str():nullptr;\n            slider->loadSlidBallTextureDisabled(disabledFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* disabledFileName = DICTOOL->getStringValue_json(disabledDic, \"path\");\n            slider->loadSlidBallTextureDisabled(disabledFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    slider->setPercent(DICTOOL->getIntValue_json(options, \"percent\"));\n    \n    const rapidjson::Value& progressBarDic = DICTOOL->getSubDictionary_json(options, \"progressBarData\");\n    int progressBarType = DICTOOL->getIntValue_json(progressBarDic, \"resourceType\");\n    switch (progressBarType)\n    {\n        case 0:\n        {\n            std::string tp_b = m_strFilePath;\n            const char* imageFileName = DICTOOL->getStringValue_json(progressBarDic, \"path\");\n            const char* imageFileName_tp = (imageFileName && (strcmp(imageFileName, \"\") != 0))?tp_b.append(imageFileName).c_str():nullptr;\n            slider->loadProgressBarTexture(imageFileName_tp);\n            break;\n        }\n        case 1:\n        {\n            const char* imageFileName = DICTOOL->getStringValue_json(progressBarDic, \"path\");\n            slider->loadProgressBarTexture(imageFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForTextFieldFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::TextField* textField = static_cast<cocos2d::gui::TextField*>(widget);\n    bool ph = DICTOOL->checkObjectExist_json(options, \"placeHolder\");\n    if (ph)\n    {\n        textField->setPlaceHolder(DICTOOL->getStringValue_json(options, \"placeHolder\"));\n    }\n    textField->setText(DICTOOL->getStringValue_json(options, \"text\"));\n    bool fs = DICTOOL->checkObjectExist_json(options, \"fontSize\");\n    if (fs)\n    {\n        textField->setFontSize(DICTOOL->getIntValue_json(options, \"fontSize\"));\n    }\n    bool fn = DICTOOL->checkObjectExist_json(options, \"fontName\");\n    if (fn)\n    {\n        textField->setFontName(DICTOOL->getStringValue_json(options, \"fontName\"));\n    }\n    bool tsw = DICTOOL->checkObjectExist_json(options, \"touchSizeWidth\");\n    bool tsh = DICTOOL->checkObjectExist_json(options, \"touchSizeHeight\");\n    if (tsw && tsh)\n    {\n        textField->setTouchSize(Size(DICTOOL->getFloatValue_json(options, \"touchSizeWidth\"), DICTOOL->getFloatValue_json(options,\"touchSizeHeight\")));\n    }\n    \n    float dw = DICTOOL->getFloatValue_json(options, \"width\");\n    float dh = DICTOOL->getFloatValue_json(options, \"height\");\n    if (dw > 0.0f || dh > 0.0f)\n    {\n        //textField->setSize(Size(dw, dh));\n    }\n\tbool maxLengthEnable = DICTOOL->getBooleanValue_json(options, \"maxLengthEnable\");\n    textField->setMaxLengthEnabled(maxLengthEnable);\n    \n    if (maxLengthEnable)\n    {\n\t\tint maxLength = DICTOOL->getIntValue_json(options, \"maxLength\");\n        textField->setMaxLength(maxLength);\n    }\n    bool passwordEnable = DICTOOL->getBooleanValue_json(options, \"passwordEnable\");\n    textField->setPasswordEnabled(passwordEnable);\n    if (passwordEnable)\n    {\n        textField->setPasswordStyleText(DICTOOL->getStringValue_json(options, \"passwordStyleText\"));\n    }\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForLoadingBarFromJsonDictionary(Widget *widget, const rapidjson::Value&options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    cocos2d::gui::LoadingBar* loadingBar = static_cast<cocos2d::gui::LoadingBar*>(widget);\n    \n    const rapidjson::Value& imageFileNameDic = DICTOOL->getSubDictionary_json(options, \"textureData\");\n    int imageFileNameType = DICTOOL->getIntValue_json(imageFileNameDic, \"resourceType\");\n    switch (imageFileNameType)\n    {\n        case 0:\n        {\n            std::string tp_i = m_strFilePath;\n            const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n            const char* imageFileName_tp = nullptr;\n            if (imageFileName && (strcmp(imageFileName, \"\") != 0))\n            {\n                imageFileName_tp = tp_i.append(imageFileName).c_str();\n                loadingBar->loadTexture(imageFileName_tp);\n            }\n            break;\n        }\n        case 1:\n        {\n            const char* imageFileName = DICTOOL->getStringValue_json(imageFileNameDic, \"path\");\n            loadingBar->loadTexture(imageFileName,UI_TEX_TYPE_PLIST);\n            break;\n        }\n        default:\n            break;\n    }\n    \n    /* gui mark add load bar scale9 parse */\n    bool scale9Enable = DICTOOL->getBooleanValue_json(options, \"scale9Enable\");\n    loadingBar->setScale9Enabled(scale9Enable);\n    \n    if (scale9Enable)\n    {\n        float cx = DICTOOL->getFloatValue_json(options, \"capInsetsX\");\n        float cy = DICTOOL->getFloatValue_json(options, \"capInsetsY\");\n        float cw = DICTOOL->getFloatValue_json(options, \"capInsetsWidth\");\n        float ch = DICTOOL->getFloatValue_json(options, \"capInsetsHeight\");\n        \n        loadingBar->setCapInsets(Rect(cx, cy, cw, ch));\n        \n        float width = DICTOOL->getFloatValue_json(options, \"width\");\n        float height = DICTOOL->getFloatValue_json(options, \"height\");\n        loadingBar->setSize(Size(width, height));\n    }\n    /**/\n    \n    loadingBar->setDirection(LoadingBarType(DICTOOL->getIntValue_json(options, \"direction\")));\n    loadingBar->setPercent(DICTOOL->getIntValue_json(options, \"percent\"));\n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForLabelBMFontFromJsonDictionary(Widget *widget, const rapidjson::Value&options)\n{\n    setPropsForWidgetFromJsonDictionary(widget, options);\n    \n    cocos2d::gui::TextBMFont* labelBMFont = static_cast<cocos2d::gui::TextBMFont*>(widget);\n    \n    const rapidjson::Value& cmftDic = DICTOOL->getSubDictionary_json(options, \"fileNameData\");\n    int cmfType = DICTOOL->getIntValue_json(cmftDic, \"resourceType\");\n    switch (cmfType)\n    {\n        case 0:\n        {\n            std::string tp_c = m_strFilePath;\n            const char* cmfPath = DICTOOL->getStringValue_json(cmftDic, \"path\");\n            const char* cmf_tp = tp_c.append(cmfPath).c_str();\n            labelBMFont->setFntFile(cmf_tp);\n            break;\n        }\n        case 1:\n            CCLOG(\"Wrong res type of LabelAtlas!\");\n            break;\n        default:\n            break;\n    }\n    \n    const char* text = DICTOOL->getStringValue_json(options, \"text\");\n    labelBMFont->setText(text);\n    \n    setColorPropsForWidgetFromJsonDictionary(widget,options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForPageViewFromJsonDictionary(Widget*widget,const rapidjson::Value& options)\n{\n     setPropsForLayoutFromJsonDictionary(widget, options);\n}\n\nvoid WidgetPropertiesReader0300::setPropsForListViewFromJsonDictionary(Widget* widget, const rapidjson::Value& options)\n{\n    setPropsForLayoutFromJsonDictionary(widget, options);\n    \n    ListView* listView = static_cast<ListView*>(widget);\n    \n    float innerWidth = DICTOOL->getFloatValue_json(options, \"innerWidth\");\n    float innerHeight = DICTOOL->getFloatValue_json(options, \"innerHeight\");\n    listView->setInnerContainerSize(Size(innerWidth, innerHeight));\n\tint direction = DICTOOL->getFloatValue_json(options, \"direction\");\n\tlistView->setDirection((SCROLLVIEW_DIR)direction);\n    \n    ListViewGravity gravity = (ListViewGravity)DICTOOL->getIntValue_json(options, \"gravity\");\n    listView->setGravity(gravity);\n    \n    float itemMargin = DICTOOL->getFloatValue_json(options, \"itemMargin\");\n    listView->setItemsMargin(itemMargin);\n}\n    \n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSGUIReader.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCSGUIREADER_H__\n#define __CCSGUIREADER_H__\n\n#include \"gui/UIWidget.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\nnamespace cocostudio {\n\n#define kCCSVersion 1.0\n\nclass GUIReader : public cocos2d::Object\n{\npublic:\n    CC_DEPRECATED_ATTRIBUTE static GUIReader* shareReader() { return GUIReader::getInstance(); };\n    CC_DEPRECATED_ATTRIBUTE static void purgeGUIReader() { GUIReader::destroyInstance(); };\n    \n    static GUIReader* getInstance();\n    static void destroyInstance();\n    \n    cocos2d::gui::Widget* widgetFromJsonFile(const char* fileName);\n    int getVersionInteger(const char* str);\n    /**\n     *  @js NA\n     */\n    void storeFileDesignSize(const char* fileName, const cocos2d::Size &size);\n    /**\n     *  @js NA\n     */\n    const cocos2d::Size getFileDesignSize(const char* fileName) const;\n    \nprotected:\n    GUIReader();\n    ~GUIReader();\n    \n    std::string m_strFilePath;\n    cocos2d::ValueMap _fileDesignSizes;\n    \n};\n\nclass WidgetPropertiesReader : public cocos2d::Object\n{\npublic:\n    virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName)=0;\n    virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& data) = 0;\nprotected:\n    std::string m_strFilePath;\n};\n\n\nclass WidgetPropertiesReader0250 : public WidgetPropertiesReader\n{\n    \n    \npublic:\n    WidgetPropertiesReader0250(){};\n    virtual ~WidgetPropertiesReader0250(){};\n    \n    virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);\n    virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);\n    virtual void setPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    \n    virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForButtonFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForImageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLabelFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForSliderFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    \n    virtual void setPropsForLayoutFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n};\n\nclass WidgetPropertiesReader0300 : public WidgetPropertiesReader\n{\n    \n    \npublic:\n    WidgetPropertiesReader0300(){};\n    virtual ~WidgetPropertiesReader0300(){};\n    \n    virtual cocos2d::gui::Widget* createWidget(const rapidjson::Value& dic, const char* fullPath, const char* fileName);\n    virtual cocos2d::gui::Widget* widgetFromJsonDictionary(const rapidjson::Value& dic);\n    virtual void setPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget*,const rapidjson::Value& options);\n    \n    virtual void setColorPropsForWidgetFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForButtonFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForCheckBoxFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForImageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLabelFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLabelAtlasFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLabelBMFontFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForLoadingBarFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForSliderFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForTextFieldFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    \n    virtual void setPropsForLayoutFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForPageViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForScrollViewFromJsonDictionary(cocos2d::gui::Widget* widget,const rapidjson::Value& options);\n    virtual void setPropsForListViewFromJsonDictionary(cocos2d::gui::Widget* widget, const rapidjson::Value& options);\n};\n\n\n}\n\n\n#endif /* defined(__CCSGUIReader__) */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSSceneReader.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CocoStudio.h\"\n#include \"gui/CocosGUI.h\"\n#include \"SimpleAudioEngine.h\"\n#include \"ObjectFactory.h\"\n\nusing namespace cocos2d;\nusing namespace gui;\n\nnamespace cocostudio {\n\nSceneReader* SceneReader::s_sharedReader = nullptr;\n\nSceneReader::SceneReader()\n: _fnSelector(nullptr)\n, _node(nullptr)\n{\n    ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComAttribute));\n    ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComRender));\n    ObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComAudio));\n\tObjectFactory::getInstance()->registerType(CREATE_CLASS_COMPONENT_INFO(ComController));\n}\n\nSceneReader::~SceneReader()\n{\n}\n\nconst char* SceneReader::sceneReaderVersion()\n{\n    return \"1.0.0.0\";\n}\n\ncocos2d::Node* SceneReader::createNodeWithSceneFile(const std::string &fileName)\n{\n    rapidjson::Document jsonDict;\n    do {\n          CC_BREAK_IF(!readJson(fileName, jsonDict));\n          _node = createObject(jsonDict, nullptr);\n          TriggerMng::getInstance()->parse(jsonDict);\n    } while (0);\n    \n    return _node;\n}\n\nbool SceneReader::readJson(const std::string &fileName, rapidjson::Document &doc)\n{\n    bool bRet = false;\n    do {\n        std::string jsonpath = FileUtils::getInstance()->fullPathForFilename(fileName);\n        std::string contentStr = FileUtils::getInstance()->getStringFromFile(jsonpath);\n        doc.Parse<0>(contentStr.c_str());\n        CC_BREAK_IF(doc.HasParseError());\n        bRet = true;\n    } while (0);\n    return bRet;\n}\n\nNode* SceneReader::nodeByTag(Node *parent, int tag)\n{\t\t\n    if (parent == nullptr)\n    {\n        return nullptr;\n    }\n    Node *_retNode = nullptr;\n    Vector<Node*>& Children = parent->getChildren();\n    Vector<Node*>::iterator iter = Children.begin();\n    while (iter != Children.end())\n    {\n        Node* pNode = *iter;\n        if(pNode != nullptr && pNode->getTag() == tag)\n        {\n            _retNode =  pNode;\n            break;\n        }\n        else\n        {\n            _retNode = nodeByTag(pNode, tag);\n            if (_retNode != nullptr)\n            {\n                break;\n            }\n\n        }\n        ++iter;\n    }\n    return _retNode;\n}\n\n\nNode* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* parent)\n{\n    const char *className = DICTOOL->getStringValue_json(dict, \"classname\");\n    if(strcmp(className, \"CCNode\") == 0)\n    {\n        Node* gb = nullptr;\n        if(nullptr == parent)\n        {\n            gb = Node::create();\n        }\n        else\n        {\n            gb = Node::create();\n            parent->addChild(gb);\n        }\n        \n        setPropertyFromJsonDict(dict, gb);\n\n        int count = DICTOOL->getArrayCount_json(dict, \"components\");\n        for (int i = 0; i < count; i++)\n        {\n            const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(dict, \"components\", i);\n            if (!DICTOOL->checkObjectExist_json(subDict))\n            {\n                break;\n            }\n            const char *comName = DICTOOL->getStringValue_json(subDict, \"classname\");\n            Component *com = ObjectFactory::getInstance()->createComponent(comName);\n\t\t\tif (com != NULL)\n\t\t\t{\n\t\t\t\tif (com->serialize((void*)(&subDict)))\n\t\t\t\t{\n\t\t\t\t\tgb->addComponent(com);\n\t\t\t\t}\n                else\n                {\n                    com = nullptr;\n                }\n\t\t\t}\n            if(_fnSelector != nullptr)\n            {\n                _fnSelector(com, (void*)(&subDict));\n            }\n        }\n\n        int length = DICTOOL->getArrayCount_json(dict, \"gameobjects\");\n        for (int i = 0; i < length; ++i)\n        {\n            const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(dict, \"gameobjects\", i);\n            if (!DICTOOL->checkObjectExist_json(subDict))\n            {\n                break;\n            }\n            createObject(subDict, gb);\n        }\n        \n        return gb;\n    }\n    \n    return nullptr;\n}\n\nvoid SceneReader::setTarget(const std::function<void(cocos2d::Object* obj, void* doc)>& selector)\n{\n    _fnSelector = selector;\n}\n\nNode* SceneReader::getNodeByTag(int nTag)\n{\n    if (_node == nullptr)\n    {\n        return nullptr;\n    }\n    if (_node->getTag() == nTag)\n    {\n        return _node;\n    }\n    return nodeByTag(_node, nTag);\n}\n\nvoid SceneReader::setPropertyFromJsonDict(const rapidjson::Value &root, cocos2d::Node *node)\n{\n    float x = DICTOOL->getFloatValue_json(root, \"x\");\n    float y = DICTOOL->getFloatValue_json(root, \"y\");\n    node->setPosition(Point(x, y));\n    \n    const bool bVisible = (DICTOOL->getIntValue_json(root, \"visible\", 1) != 0);\n    node->setVisible(bVisible);\n    \n    int nTag = DICTOOL->getIntValue_json(root, \"objecttag\", -1);\n    node->setTag(nTag);\n    \n    int nZorder = DICTOOL->getIntValue_json(root, \"zorder\");\n    node->setLocalZOrder(nZorder);\n    \n    float fScaleX = DICTOOL->getFloatValue_json(root, \"scalex\", 1.0);\n    float fScaleY = DICTOOL->getFloatValue_json(root, \"scaley\", 1.0);\n    node->setScaleX(fScaleX);\n    node->setScaleY(fScaleY);\n    \n    float fRotationZ = DICTOOL->getFloatValue_json(root, \"rotation\"); \n    node->setRotation(fRotationZ);\n}\n\nSceneReader* SceneReader::getInstance()\n{\n    if (s_sharedReader == nullptr)\n    {\n        s_sharedReader = new SceneReader();\n    }\n    return s_sharedReader;\n}\n\nvoid SceneReader::destroyInstance()\n{\n    DictionaryHelper::destroyInstance();\n    TriggerMng::destroyInstance();\n    CocosDenshion::SimpleAudioEngine::end();\n    CC_SAFE_DELETE(s_sharedReader);\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSSceneReader.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCSSCENEREADER_H__\n#define __CCSSCENEREADER_H__\n\n#include \"cocostudio/DictionaryHelper.h\"\n\n\nnamespace cocostudio {\n\nclass SceneReader\n{\npublic:\n    static SceneReader* getInstance();\n    /**\n     *  @js purge\n     *  @lua destroySceneReader\n     */\n    static void destroyInstance();\n    static const char* sceneReaderVersion();\n    cocos2d::Node* createNodeWithSceneFile(const std::string &fileName);\n\tvoid setTarget(const std::function<void(cocos2d::Object* obj, void* doc)>& selector);\n\tcocos2d::Node* getNodeByTag(int nTag);\n    \nprivate:\n    SceneReader(void);\n    virtual ~SceneReader(void);\n    \n    cocos2d::Node* createObject(const rapidjson::Value& dict, cocos2d::Node* parent);\n    void setPropertyFromJsonDict(const rapidjson::Value& dict, cocos2d::Node *node);\n    bool readJson(const std::string &fileName, rapidjson::Document& doc);\n\tcocos2d::Node* nodeByTag(cocos2d::Node *parent, int tag);\nprivate:\n    static SceneReader* s_sharedReader;\n    std::function<void(cocos2d::Object* obj, void* doc)> _fnSelector;\n\tcocos2d::Node*      _node;\n};\n\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSkin.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCSpriteFrame.h\"\n#include \"CCSpriteFrameCache.h\"\n#include \"CCDirector.h\"\n#include \"renderer/CCRenderer.h\"\n\n#include \"cocostudio/CCSkin.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n#include \"cocostudio/CCSpriteFrameCacheHelper.h\"\n#include \"cocostudio/CCArmature.h\"\n\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\n#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL\n#define RENDER_IN_SUBPIXEL\n#else\n#define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__))\n#endif\n\n#define SET_VERTEX3F(_v_, _x_, _y_, _z_) (_v_).x = (_x_); (_v_).y = (_y_); (_v_).z = (_z_);\n\nSkin *Skin::create()\n{\n    Skin *skin = new Skin();\n    if(skin && skin->init())\n    {\n        skin->autorelease();\n        return skin;\n    }\n    CC_SAFE_DELETE(skin);\n    return nullptr;\n}\n\nSkin *Skin::createWithSpriteFrameName(const std::string& pszSpriteFrameName)\n{\n    Skin *skin = new Skin();\n    if(skin && skin->initWithSpriteFrameName(pszSpriteFrameName))\n    {\n        skin->autorelease();\n        return skin;\n    }\n    CC_SAFE_DELETE(skin);\n    return nullptr;\n}\n\nSkin *Skin::create(const std::string& pszFileName)\n{\n    Skin *skin = new Skin();\n    if(skin && skin->initWithFile(pszFileName))\n    {\n        skin->autorelease();\n        return skin;\n    }\n    CC_SAFE_DELETE(skin);\n    return nullptr;\n}\n\nSkin::Skin()\n    : _bone(nullptr)\n    , _armature(nullptr)\n    , _displayName(\"\")\n{\n    kmMat4Identity(&_skinTransform);\n}\n\nbool Skin::initWithSpriteFrameName(const std::string& spriteFrameName)\n{\n    CCAssert(spriteFrameName != \"\", \"\");\n\n    SpriteFrame *pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);\n    bool ret = true;\n\n    if (pFrame != nullptr)\n    {\n        ret = initWithSpriteFrame(pFrame);\n    }\n    else\n    {\n        CCLOG(\"Cann't find CCSpriteFrame with %s. Please check your .plist file\", spriteFrameName.c_str());\n        ret = false;\n    }\n\n    _displayName = spriteFrameName;\n\n    return ret;\n}\n\nbool Skin::initWithFile(const std::string& filename)\n{\n    bool ret = Sprite::initWithFile(filename);\n\n    _displayName = filename;\n\n    return ret;\n}\n\nvoid Skin::setSkinData(const BaseData &var)\n{\n    _skinData = var;\n\n    setScaleX(_skinData.scaleX);\n    setScaleY(_skinData.scaleY);\n    setRotationX(CC_RADIANS_TO_DEGREES(_skinData.skewX));\n    setRotationY(CC_RADIANS_TO_DEGREES(-_skinData.skewY));\n    setPosition(Point(_skinData.x, _skinData.y));\n\n    _skinTransform = getNodeToParentTransform();\n    updateArmatureTransform();\n}\n\nconst BaseData &Skin::getSkinData() const\n{\n    return _skinData;\n}\n\nvoid Skin::updateArmatureTransform()\n{\n    _transform = TransformConcat(_bone->getNodeToArmatureTransform(), _skinTransform);\n//    if(_armature && _armature->getBatchNode())\n//    {\n//        _transform = TransformConcat(_transform, _armature->getNodeToParentTransform());\n//    }\n}\n\nvoid Skin::updateTransform()\n{\n    // If it is not visible, or one of its ancestors is not visible, then do nothing:\n    if( !_visible)\n    {\n        _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = Vertex3F(0, 0, 0);\n    }\n    else\n    {\n        //\n        // calculate the Quad based on the Affine Matrix\n        //\n\n        Size &size = _rect.size;\n\n        float x1 = _offsetPosition.x;\n        float y1 = _offsetPosition.y;\n\n        float x2 = x1 + size.width;\n        float y2 = y1 + size.height;\n\n        float x = _transform.mat[12];\n        float y = _transform.mat[13];\n\n        float cr = _transform.mat[0];\n        float sr = _transform.mat[1];\n        float cr2 = _transform.mat[5];\n        float sr2 = -_transform.mat[4];\n        float ax = x1 * cr - y1 * sr2 + x;\n        float ay = x1 * sr + y1 * cr2 + y;\n\n        float bx = x2 * cr - y1 * sr2 + x;\n        float by = x2 * sr + y1 * cr2 + y;\n\n        float cx = x2 * cr - y2 * sr2 + x;\n        float cy = x2 * sr + y2 * cr2 + y;\n\n        float dx = x1 * cr - y2 * sr2 + x;\n        float dy = x1 * sr + y2 * cr2 + y;\n\n        SET_VERTEX3F( _quad.bl.vertices, RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _vertexZ );\n        SET_VERTEX3F( _quad.br.vertices, RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _vertexZ );\n        SET_VERTEX3F( _quad.tl.vertices, RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _vertexZ );\n        SET_VERTEX3F( _quad.tr.vertices, RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _vertexZ );\n    }\n\n    // MARMALADE CHANGE: ADDED CHECK FOR nullptr, TO PERMIT SPRITES WITH NO BATCH NODE / TEXTURE ATLAS\n    if (_textureAtlas)\n    {\n        _textureAtlas->updateQuad(&_quad, _textureAtlas->getTotalQuads());\n    }\n}\n\nkmMat4 Skin::getNodeToWorldTransform() const\n{\n    return TransformConcat( _bone->getArmature()->getNodeToWorldTransform(), _transform);\n}\n\nkmMat4 Skin::getNodeToWorldTransformAR() const\n{\n    kmMat4 displayTransform = _transform;\n    Point anchorPoint =  _anchorPointInPoints;\n\n    anchorPoint = PointApplyTransform(anchorPoint, displayTransform);\n\n    displayTransform.mat[12] = anchorPoint.x;\n    displayTransform.mat[13] = anchorPoint.y;\n\n    return TransformConcat( _bone->getArmature()->getNodeToWorldTransform(),displayTransform);\n}\n\nvoid Skin::draw()\n{\n    kmMat4 mv;\n    kmGLGetMatrix(KM_GL_MODELVIEW, &mv);\n\n    //TODO implement z order\n    _quadCommand.init(_globalZOrder, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv);\n    Director::getInstance()->getRenderer()->addCommand(&_quadCommand);\n}\n\nvoid Skin::setBone(Bone *bone)\n{\n    _bone = bone;\n    if(Armature *armature = _bone->getArmature())\n    {\n        _armature = armature;\n    }\n}\n\nBone *Skin::getBone() const\n{\n    return _bone;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSkin.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCSKIN_H__\n#define __CCSKIN_H__\n\n#include \"CCSprite.h\"\n#include \"renderer/CCQuadCommand.h\"\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCBone.h\"\n\nnamespace cocostudio {\n\nclass Skin : public cocos2d::Sprite\n{\npublic:\n    static Skin *create();\n    static Skin *createWithSpriteFrameName(const std::string& pszSpriteFrameName);\n    static Skin *create(const std::string& pszFileName);\npublic:\n    /**\n     *  @js ctor\n     */\n    Skin();\n\n    virtual bool initWithSpriteFrameName(const std::string& spriteFrameName) override;\n    virtual bool initWithFile(const std::string& filename) override;\n\n    void updateArmatureTransform();\n    void updateTransform() override;\n\n    kmMat4 getNodeToWorldTransform() const override;\n    kmMat4 getNodeToWorldTransformAR() const;\n    \n    virtual void draw() override;\n    \n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual void setSkinData(const BaseData &data);\n    /**\n     *  @js NA\n     *  @lua NA\n     */\n    virtual const BaseData &getSkinData() const;\n\n    virtual void setBone(Bone *bone);\n    virtual Bone *getBone() const;\n\n    virtual const std::string &getDisplayName() const { return _displayName; }\nprotected:\n    BaseData _skinData;\n    Bone *_bone;\n    Armature *_armature;\n    kmMat4 _skinTransform;\n    std::string _displayName;\n    cocos2d::QuadCommand _quadCommand;     // quad command\n};\n\n}\n\n#endif /*__CCSKIN_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCSpriteFrameCacheHelper.h\"\n\n#include \"CCSpriteFrameCache.h\"\n\nusing namespace cocos2d;\n\n\nnamespace cocostudio {\n\nSpriteFrameCacheHelper *SpriteFrameCacheHelper::_spriteFrameCacheHelper = nullptr;\n\nSpriteFrameCacheHelper *SpriteFrameCacheHelper::getInstance()\n{\n    if(!_spriteFrameCacheHelper)\n    {\n        _spriteFrameCacheHelper = new SpriteFrameCacheHelper();\n    }\n\n    return _spriteFrameCacheHelper;\n}\n\nvoid SpriteFrameCacheHelper::purge()\n{\n    delete _spriteFrameCacheHelper;\n    _spriteFrameCacheHelper = nullptr;\n}\n\nvoid SpriteFrameCacheHelper::addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath)\n{\n    SpriteFrameCache::getInstance()->addSpriteFramesWithFile(plistPath, imagePath);\n}\n\nSpriteFrameCacheHelper::SpriteFrameCacheHelper()\n{\n}\n\nSpriteFrameCacheHelper::~SpriteFrameCacheHelper()\n{\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCSPRITEFRAMECACHEHELPER_H__\n#define __CCSPRITEFRAMECACHEHELPER_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include <stack>\n#include <string>\n\nnamespace cocostudio {\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  SpriteFrameCacheHelper\n{\npublic:\n\t/** @deprecated Use getInstance() instead */\n    CC_DEPRECATED_ATTRIBUTE static SpriteFrameCacheHelper *sharedSpriteFrameCacheHelper(){ return SpriteFrameCacheHelper::getInstance(); }\n\n    static SpriteFrameCacheHelper *getInstance();\n\n    static void purge();\npublic:\n\n    /**\n     *\t@brief\tAdd sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name\n     */\n    void addSpriteFrameFromFile(const std::string& plistPath, const std::string& imagePath);\n\nprivate:\n    SpriteFrameCacheHelper();\n    ~SpriteFrameCacheHelper();\n\n    static SpriteFrameCacheHelper *_spriteFrameCacheHelper;\n};\n\n}\n\n#endif /*__CCSPRITEFRAMECACHEHELPER_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCTransformHelp.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCTransformHelp.h\"\n#include \"cocostudio/CCUtilMath.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nAffineTransform TransformHelp::helpMatrix1;\nAffineTransform TransformHelp::helpMatrix2;\n\nPoint TransformHelp::helpPoint1;\nPoint TransformHelp::helpPoint2;\n\nBaseData helpParentNode;\n\nTransformHelp::TransformHelp()\n{\n}\n\nvoid TransformHelp::transformFromParent(BaseData &node, const BaseData &parentNode)\n{\n    nodeToMatrix(node, helpMatrix1);\n    nodeToMatrix(parentNode, helpMatrix2);\n\n    helpMatrix2 = AffineTransformInvert(helpMatrix2);\n    helpMatrix1 = AffineTransformConcat(helpMatrix1, helpMatrix2);\n\n    matrixToNode(helpMatrix1, node);\n}\n\nvoid TransformHelp::transformToParent(BaseData &node, const BaseData &parentNode)\n{\n\n    nodeToMatrix(node, helpMatrix1);\n    nodeToMatrix(parentNode, helpMatrix2);\n\n    helpMatrix1 = AffineTransformConcat(helpMatrix1, helpMatrix2);\n\n    matrixToNode(helpMatrix1, node);\n}\n\nvoid TransformHelp::transformFromParentWithoutScale(BaseData &node, const BaseData &parentNode)\n{\n\n    helpParentNode.copy(&parentNode);\n    helpParentNode.scaleX = 1;\n    helpParentNode.scaleY = 1;\n\n    nodeToMatrix(node, helpMatrix1);\n    nodeToMatrix(helpParentNode, helpMatrix2);\n\n    helpMatrix2 = AffineTransformInvert(helpMatrix2);\n    helpMatrix1 = AffineTransformConcat(helpMatrix1, helpMatrix2);\n\n    matrixToNode(helpMatrix1, node);\n}\n\nvoid TransformHelp::transformToParentWithoutScale(BaseData &node, const BaseData &parentNode)\n{\n\n    helpParentNode.copy(&parentNode);\n    helpParentNode.scaleX = 1;\n    helpParentNode.scaleY = 1;\n\n    nodeToMatrix(node, helpMatrix1);\n    nodeToMatrix(helpParentNode, helpMatrix2);\n\n    helpMatrix1 = AffineTransformConcat(helpMatrix1, helpMatrix2);\n\n    matrixToNode(helpMatrix1, node);\n}\n\nvoid TransformHelp::nodeToMatrix(const BaseData &node, AffineTransform &matrix)\n{\n    if (node.skewX == -node.skewY)\n    {\n        double sine   = sin(node.skewX);\n        double cosine = cos(node.skewX);\n        \n        matrix.a = node.scaleX * cosine;\n        matrix.b = node.scaleX * -sine;\n        matrix.c = node.scaleY * sine;\n        matrix.d = node.scaleY * cosine;\n    }\n    else\n    {\n        matrix.a = node.scaleX * cos(node.skewY);\n        matrix.b = node.scaleX * sin(node.skewY);\n        matrix.c = node.scaleY * sin(node.skewX);\n        matrix.d = node.scaleY * cos(node.skewX);\n    }\n\n    matrix.tx = node.x;\n    matrix.ty = node.y;\n}\n\nvoid TransformHelp::nodeToMatrix(const BaseData &node, kmMat4 &matrix)\n{\n    kmMat4Identity(&matrix);\n\n    if (node.skewX == -node.skewY)\n    {\n        double sine   = sin(node.skewX);\n        double cosine = cos(node.skewX);\n\n        matrix.mat[0] = node.scaleX * cosine;\n        matrix.mat[1] = node.scaleX * -sine;\n        matrix.mat[4] = node.scaleY * sine;\n        matrix.mat[5] = node.scaleY * cosine;\n    }\n    else\n    {\n        matrix.mat[0] = node.scaleX * cos(node.skewY);\n        matrix.mat[1] = node.scaleX * sin(node.skewY);\n        matrix.mat[4] = node.scaleY * sin(node.skewX);\n        matrix.mat[5] = node.scaleY * cos(node.skewX);\n    }\n    \n    matrix.mat[12] = node.x;\n    matrix.mat[13] = node.y;\n}\n\n\nvoid TransformHelp::matrixToNode(const AffineTransform &matrix, BaseData &node)\n{\n    /*\n     *  In as3 language, there is a function called \"deltaTransformPoint\", it calculate a point used give Transform\n     *  but not used the tx, ty value. we simulate the function here\n     */\n    helpPoint1.x = 0;\n    helpPoint1.y = 1;\n    helpPoint1 = PointApplyAffineTransform(helpPoint1, matrix);\n    helpPoint1.x -= matrix.tx;\n    helpPoint1.y -= matrix.ty;\n\n    helpPoint2.x = 1;\n    helpPoint2.y = 0;\n    helpPoint2 = PointApplyAffineTransform(helpPoint2, matrix);\n    helpPoint2.x -= matrix.tx;\n    helpPoint2.y -= matrix.ty;\n\n    node.skewX = -(atan2f(helpPoint1.y, helpPoint1.x) - 1.5707964f);\n    node.skewY = atan2f(helpPoint2.y, helpPoint2.x);\n    node.scaleX = sqrt(matrix.a * matrix.a + matrix.b * matrix.b);\n    node.scaleY = sqrt(matrix.c * matrix.c + matrix.d * matrix.d);\n    node.x = matrix.tx;\n    node.y = matrix.ty;\n}\n\nvoid TransformHelp::matrixToNode(const kmMat4 &matrix, BaseData &node)\n{\n    /*\n     *  In as3 language, there is a function called \"deltaTransformPoint\", it calculate a point used give Transform\n     *  but not used the tx, ty value. we simulate the function here\n     */\n    helpPoint1.x = 0;\n    helpPoint1.y = 1;\n    helpPoint1 = PointApplyTransform(helpPoint1, matrix);\n    helpPoint1.x -= matrix.mat[12];\n    helpPoint1.y -= matrix.mat[13];\n\n    helpPoint2.x = 1;\n    helpPoint2.y = 0;\n    helpPoint2 = PointApplyTransform(helpPoint2, matrix);\n    helpPoint2.x -= matrix.mat[12];\n    helpPoint2.y -= matrix.mat[13];\n\n    node.skewX = -(atan2f(helpPoint1.y, helpPoint1.x) - 1.5707964f);\n    node.skewY = atan2f(helpPoint2.y, helpPoint2.x);\n    node.scaleX = sqrt(matrix.mat[0] * matrix.mat[0] + matrix.mat[1] * matrix.mat[1]);\n    node.scaleY = sqrt(matrix.mat[4] * matrix.mat[4] + matrix.mat[5] * matrix.mat[5]);\n    node.x = matrix.mat[12];\n    node.y = matrix.mat[13];\n}\n\n\nvoid TransformHelp::nodeConcat(BaseData &target, BaseData &source)\n{\n    target.x += source.x;\n    target.y += source.y;\n    target.skewX += source.skewX;\n    target.skewY += source.skewY;\n    target.scaleX += source.scaleX;\n    target.scaleY += source.scaleY;\n}\n\nvoid TransformHelp::nodeSub(BaseData &target, BaseData &source)\n{\n    target.x -= source.x;\n    target.y -= source.y;\n    target.skewX -= source.skewX;\n    target.skewY -= source.skewY;\n    target.scaleX -= source.scaleX;\n    target.scaleY -= source.scaleY;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCTransformHelp.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTRANSFORMHELP_H__\n#define __CCTRANSFORMHELP_H__\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDatas.h\"\n\nnamespace cocostudio {\n\n/*\n * use to calculate the matrix of node from parent node\n * @js NA\n * @lua NA\n */\nclass  TransformHelp\n{\npublic:\n    TransformHelp();\n\n    static void transformFromParent(BaseData &node, const BaseData &parentNode);\n    static void transformToParent(BaseData &node, const BaseData &parentNode);\n\n    static void transformFromParentWithoutScale(BaseData &node, const BaseData &parentNode);\n    static void transformToParentWithoutScale(BaseData &node, const BaseData &parentNode);\n\n    static void nodeToMatrix(const BaseData &_node, cocos2d::AffineTransform &_matrix);\n    static void nodeToMatrix(const BaseData &node, kmMat4 &matrix);\n    static void matrixToNode(const cocos2d::AffineTransform &_matrix, BaseData &_node);\n    static void matrixToNode(const kmMat4 &_matrix, BaseData &_node);\n\n    static void nodeConcat(BaseData &target, BaseData &source);\n    static void nodeSub(BaseData &target, BaseData &source);\npublic:\n    static cocos2d::AffineTransform helpMatrix1;\n    static cocos2d::AffineTransform helpMatrix2;\n\n    static cocos2d::Point helpPoint1;\n    static cocos2d::Point helpPoint2;\n};\n\n}\n\n#endif /*__CCTRANSFORMHELP_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCTween.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#include \"cocostudio/CCTween.h\"\n#include \"cocostudio/CCArmatureAnimation.h\"\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCUtilMath.h\"\n#include \"cocostudio/CCTweenFunction.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n\n\nnamespace cocostudio {\n\nTween *Tween::create(Bone *bone)\n{\n    Tween *pTween = new Tween();\n    if (pTween && pTween->init(bone))\n    {\n        pTween->autorelease();\n        return pTween;\n    }\n    CC_SAFE_DELETE(pTween);\n    return nullptr;\n\n}\n\n\n\nTween::Tween()\n    : _movementBoneData(nullptr)\n    , _tweenData(nullptr)\n    , _from(nullptr)\n    , _to(nullptr)\n    , _between(nullptr)\n    , _bone(nullptr)\n\n    , _frameTweenEasing(Linear)\n    , _fromIndex(0)\n    , _toIndex(0)\n    , _animation(nullptr)\n    , _passLastFrame(false)\n{\n\n}\n\n\nTween::~Tween(void)\n{\n    CC_SAFE_DELETE( _from );\n    CC_SAFE_DELETE( _between );\n}\n\n\nbool Tween::init(Bone *bone)\n{\n    bool bRet = false;\n    do\n    {\n        _from = new FrameData();\n        _between = new FrameData();\n\n        _bone = bone;\n        _tweenData = _bone->getTweenData();\n        _tweenData->displayIndex = -1;\n\n        _animation = _bone->getArmature() != nullptr ? _bone->getArmature()->getAnimation() : nullptr;\n\n        bRet = true;\n    }\n    while (0);\n\n    return bRet;\n}\n\n\nvoid Tween::play(MovementBoneData *movementBoneData, int durationTo, int durationTween,  int loop, int tweenEasing)\n{\n    ProcessBase::play(durationTo, durationTween, loop, tweenEasing);\n\n    if (loop)\n    {\n        _loopType = ANIMATION_TO_LOOP_FRONT;\n    }\n    else\n    {\n        _loopType = ANIMATION_NO_LOOP;\n    }\n\n    _totalDuration = 0;\n    _betweenDuration = 0;\n    _fromIndex = _toIndex = 0;\n\n    bool difMovement = movementBoneData != _movementBoneData;\n\n    setMovementBoneData(movementBoneData);\n    _rawDuration = _movementBoneData->duration;\n\n    FrameData *nextKeyFrame = _movementBoneData->getFrameData(0);\n    _tweenData->displayIndex = nextKeyFrame->displayIndex;\n\n    if (_bone->getArmature()->getArmatureData()->dataVersion >= VERSION_COMBINED)\n    {\n        TransformHelp::nodeSub(*_tweenData, *_bone->getBoneData());\n        _tweenData->scaleX += 1;\n        _tweenData->scaleY += 1;\n    }\n\n    if (_rawDuration == 0 )\n    {\n        _loopType = SINGLE_FRAME;\n        if(durationTo == 0)\n        {\n            setBetween(nextKeyFrame, nextKeyFrame);\n        }\n        else\n        {\n            setBetween(_tweenData, nextKeyFrame);\n        }\n        _frameTweenEasing = Linear;\n    }\n    else if (_movementBoneData->frameList.size() > 1)\n    {\n        _durationTween = durationTween * _movementBoneData->scale;\n\n        if (loop && _movementBoneData->delay != 0)\n        {\n            setBetween(_tweenData, tweenNodeTo(updateFrameData(1 - _movementBoneData->delay), _between));\n        }\n        else\n        {\n            if (!difMovement || durationTo == 0)\n            {\n                setBetween(nextKeyFrame, nextKeyFrame);\n            }\n            else\n            {\n                setBetween(_tweenData, nextKeyFrame);\n            }\n        }\n    }\n\n    tweenNodeTo(0);\n}\n\nvoid Tween::gotoAndPlay(int frameIndex)\n{\n    ProcessBase::gotoFrame(frameIndex);\n\n    _totalDuration = 0;\n    _betweenDuration = 0;\n    _fromIndex = _toIndex = 0;\n\n    _isPlaying = true;\n    _isComplete = _isPause = false;\n\n    _currentPercent = (float)_curFrameIndex / ((float)_rawDuration-1);\n    _currentFrame = _nextFrameIndex * _currentPercent;\n}\n\nvoid Tween::gotoAndPause(int frameIndex)\n{\n    gotoAndPlay(frameIndex);\n    pause();\n}\n\nvoid Tween::updateHandler()\n{\n    if (_currentPercent >= 1)\n    {\n        switch(_loopType)\n        {\n        case SINGLE_FRAME:\n        {\n            _currentPercent = 1;\n            _isComplete = true;\n            _isPlaying = false;\n        }\n        break;\n        case ANIMATION_NO_LOOP:\n        {\n            _loopType = ANIMATION_MAX;\n\n\n            if (_durationTween <= 0)\n            {\n                _currentPercent = 1;\n            }\n            else\n            {\n                _currentPercent = (_currentPercent - 1) * _nextFrameIndex / _durationTween;\n            }\n\n            if (_currentPercent >= 1)\n            {\n                _currentPercent = 1;\n                _isComplete = true;\n                _isPlaying = false;\n                break;\n            }\n            else\n            {\n                _nextFrameIndex = _durationTween;\n                _currentFrame = _currentPercent * _nextFrameIndex;\n                _totalDuration = 0;\n                _betweenDuration = 0;\n                _fromIndex = _toIndex = 0;\n                break;\n            }\n        }\n        break;\n        case ANIMATION_TO_LOOP_FRONT:\n        {\n            _loopType = ANIMATION_LOOP_FRONT;\n\n            _nextFrameIndex = _durationTween > 0 ? _durationTween : 1;\n\n            if (_movementBoneData->delay != 0)\n            {\n                //\n                _currentFrame = (1 - _movementBoneData->delay) * (float)_nextFrameIndex;\n                _currentPercent = _currentFrame / _nextFrameIndex;\n            }\n            else\n            {\n                _currentPercent = 0;\n                _currentFrame = 0;\n            }\n\n            _totalDuration = 0;\n            _betweenDuration = 0;\n            _fromIndex = _toIndex = 0;\n        }\n        break;\n        case ANIMATION_MAX:\n        {\n            _currentPercent = 1;\n            _isComplete = true;\n            _isPlaying = false;\n        }\n        break;\n        default:\n        {\n            _currentFrame = fmodf(_currentFrame, _nextFrameIndex);\n        }\n        break;\n        }\n    }\n\n    if (_currentPercent < 1 && _loopType <= ANIMATION_TO_LOOP_BACK)\n    {\n        _currentPercent = sin(_currentPercent * CC_HALF_PI);\n    }\n\n    float percent  = _currentPercent;\n\n    if (_loopType > ANIMATION_TO_LOOP_BACK)\n    {\n        percent = updateFrameData(percent);\n    }\n\n    if(_frameTweenEasing != TWEEN_EASING_MAX)\n    {\n        tweenNodeTo(percent);\n    }\n}\n\nvoid Tween::setBetween(FrameData *from, FrameData *to, bool limit)\n{\n    do\n    {\n        if(from->displayIndex < 0 && to->displayIndex >= 0)\n        {\n            _from->copy(to);\n            _between->subtract(to, to, limit);\n            break;\n        }\n        else if(to->displayIndex < 0 && from->displayIndex >= 0)\n        {\n            _from->copy(from);\n            _between->subtract(to, to, limit);\n            break;\n        }\n\n        _from->copy(from);\n        _between->subtract(from, to, limit);\n    }\n    while (0);\n\n    if (!from->isTween)\n    {\n        _tweenData->copy(from);\n        _tweenData->isTween = true;\n    }\n\n    arriveKeyFrame(from);\n}\n\n\nvoid Tween::arriveKeyFrame(FrameData *keyFrameData)\n{\n    if(keyFrameData)\n    {\n        DisplayManager *displayManager = _bone->getDisplayManager();\n\n        //! Change bone's display\n        int displayIndex = keyFrameData->displayIndex;\n\n        if (!displayManager->isForceChangeDisplay())\n        {\n            displayManager->changeDisplayWithIndex(displayIndex, false);\n        }\n\n        //! Update bone zorder, bone's zorder is determined by frame zorder and bone zorder\n        _tweenData->zOrder = keyFrameData->zOrder;\n        _bone->updateZOrder();\n\n        //! Update blend type\n        _bone->setBlendFunc(keyFrameData->blendFunc);\n\n        //! Update child armature's movement\n        Armature *childAramture = _bone->getChildArmature();\n        if(childAramture)\n        {\n            if(keyFrameData->strMovement.length() != 0)\n            {\n                childAramture->getAnimation()->play(keyFrameData->strMovement.c_str());\n            }\n        }\n    }\n}\n\nFrameData *Tween::tweenNodeTo(float percent, FrameData *node)\n{\n    node = node == nullptr ? _tweenData : node;\n\n    if (!_from->isTween)\n    {\n        percent = 0;\n    }\n\n    node->x = _from->x + percent * _between->x;\n    node->y = _from->y + percent * _between->y;\n    node->scaleX = _from->scaleX + percent * _between->scaleX;\n    node->scaleY = _from->scaleY + percent * _between->scaleY;\n    node->skewX = _from->skewX + percent * _between->skewX;\n    node->skewY = _from->skewY + percent * _between->skewY;\n\n    _bone->setTransformDirty(true);\n\n    if (node && _between->isUseColorInfo)\n    {\n        tweenColorTo(percent, node);\n    }\n\n    return node;\n}\n\nvoid Tween::tweenColorTo(float percent, FrameData *node)\n{\n    node->a = _from->a + percent * _between->a;\n    node->r = _from->r + percent * _between->r;\n    node->g = _from->g + percent * _between->g;\n    node->b = _from->b + percent * _between->b;\n    _bone->updateColor();\n}\n\nfloat Tween::updateFrameData(float currentPercent)\n{\n    if (currentPercent > 1 && _movementBoneData->delay != 0)\n    {\n        currentPercent = fmodf(currentPercent, 1);\n    }\n\n    float playedTime = ((float)_rawDuration-1) * currentPercent;\n\n\n    //! If play to current frame's front or back, then find current frame again\n    if (playedTime < _totalDuration || playedTime >= _totalDuration + _betweenDuration)\n    {\n        /*\n         *  Get frame length, if _toIndex >= _length, then set _toIndex to 0, start anew.\n         *  _toIndex is next index will play\n         */\n        long length = _movementBoneData->frameList.size();\n        cocos2d::Vector<FrameData *> &frames = _movementBoneData->frameList;\n\n        FrameData *from = nullptr;\n        FrameData *to = nullptr;\n\n        if (playedTime < frames.at(0)->frameID)\n        {\n            from = to = frames.at(0);\n            setBetween(from, to);\n            return _currentPercent;\n        }\n        \n        if(playedTime >= frames.at(length - 1)->frameID)\n        {\n            // If _passLastFrame is true and playedTime >= frames[length - 1]->frameID, then do not need to go on. \n            if (_passLastFrame)\n            {\n                from = to = frames.at(length - 1);\n                setBetween(from, to);\n                return _currentPercent;\n            }\n            _passLastFrame = true;\n        }\n        else\n        {\n            _passLastFrame = false;\n        }\n\n\n        do\n        {\n            _fromIndex = _toIndex;\n            from = frames.at(_fromIndex);\n            _totalDuration  = from->frameID;\n\n            _toIndex = _fromIndex + 1;\n            if (_toIndex >= length)\n            {\n                _toIndex = 0;\n            }\n\n            to = frames.at(_toIndex);\n\n            //! Guaranteed to trigger frame event\n            if(from->strEvent.length() != 0 && !_animation->isIgnoreFrameEvent())\n            {\n                _animation->frameEvent(_bone, from->strEvent.c_str(), from->frameID, playedTime);\n            }\n\n            if (playedTime == from->frameID || (_passLastFrame && _fromIndex == length-1))\n            {\n                break;\n            }\n        }\n        while (playedTime < from->frameID || playedTime >= to->frameID);\n\n        _betweenDuration = to->frameID - from->frameID;\n\n        _frameTweenEasing = from->tweenEasing;\n\n        setBetween(from, to, false);\n\n    }\n    currentPercent = _betweenDuration == 0 ? 0 : (playedTime - _totalDuration) / (float)_betweenDuration;\n\n\n    /*\n     *  If frame tween easing equal to TWEEN_EASING_MAX, then it will not do tween.\n     */\n    TweenType tweenType = (_frameTweenEasing != Linear) ? _frameTweenEasing : _tweenEasing;\n    if (tweenType != TWEEN_EASING_MAX && tweenType != Linear && !_passLastFrame)\n    {\n        currentPercent = TweenFunction::tweenTo(currentPercent, tweenType, _from->easingParams);\n    }\n\n    return currentPercent;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCTween.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#ifndef __CCTWEEN_H__\n#define __CCTWEEN_H__\n\n#include \"cocostudio/CCProcessBase.h\"\n#include \"cocostudio/CCTweenFunction.h\"\n\nnamespace cocostudio {\n\nclass Bone;\nclass ArmatureAnimation;\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass  Tween : public ProcessBase\n{\npublic:\n    /**\n     * Create with a Bone\n     * @param bone the Bone Tween will bind to\n     */\n    static Tween *create(Bone *bone);\npublic:\n    Tween(void);\n    virtual ~Tween(void);\n\n    /**\n     * Init with a Bone\n     * @param bone the Bone Tween will bind to\n     */\n    virtual bool init(Bone *bone);\n\n    using ProcessBase::play;\n    /**\n     * Start the Process\n     *\n     * @param  movementBoneData  the MovementBoneData include all FrameData\n     * @param  durationTo the number of frames changing to this animation needs.\n     * @param  durationTween  the number of frames this animation actual last.\n     *\n     * @param  loop   whether the animation is loop\n     *\n     *         loop < 0 : use the value from MovementData get from Action Editor\n     *         loop = 0 : this animation is not loop\n     *         loop > 0 : this animation is loop\n     *\n     * @param  tweenEasing    tween easing is used for calculate easing effect\n     *\n     *         TWEEN_EASING_MAX : use the value from MovementData get from Action Editor\n     *         -1 : fade out\n     *         0  : line\n     *         1  : fade in\n     *         2  : fade in and out\n     *\n     */\n    virtual void play(MovementBoneData *movementBoneData, int durationTo, int durationTween,  int loop, int tweenEasing);\n\n    inline void setAnimation(ArmatureAnimation *animation) { _animation = animation; }\n    inline ArmatureAnimation *getAnimation() const { return _animation; }\n\n    virtual void gotoAndPlay(int frameIndex);\n    virtual void gotoAndPause(int frameIndex);\n\n    virtual void setMovementBoneData(MovementBoneData *data) { _movementBoneData = data; }\n    virtual const MovementBoneData *getMovementBoneData() const { return _movementBoneData; }\nprotected:\n\n    /**\n     * Update(float dt) will call this handler, you can handle your logic here\n     */\n    virtual void updateHandler();\n\n    /**\n     * Calculate which frame arrived, and if current frame have event, then call the event listener\n     */\n    virtual float updateFrameData(float currentPercent);\n\n    /**\n     * Calculate the between value of _from and _to, and give it to between frame data\n     */\n    virtual void setBetween(FrameData *from, FrameData *to, bool limit = true);\n\n    /**\n     * According to the percent to calculate current FrameData with tween effect\n     */\n    virtual FrameData *tweenNodeTo(float percent, FrameData *node = nullptr);\n\n    /**\n     * According to the percent to calculate current color with tween effect\n     */\n    virtual void tweenColorTo(float percent, FrameData *node);\n\n    /**\n     * Update display index and process the key frame event when arrived a key frame\n     */\n    virtual void arriveKeyFrame(FrameData *keyFrameData);\nprotected:\n    //! A weak reference to the current MovementBoneData. The data is in the data pool\n    MovementBoneData *_movementBoneData;\n\n    FrameData *_tweenData;          //! The computational tween frame data, //! A weak reference to the Bone's tweenData\n    FrameData *_from;               //! From frame data, used for calculate between value\n    FrameData *_to;                 //! To frame data, used for calculate between value\n    FrameData *_between;            //! Between frame data, used for calculate current FrameData(m_pNode) value\n\n\n    Bone *_bone;                    //! A weak reference to the Bone\n\n    TweenType _frameTweenEasing;  //! Dedermine which tween effect current frame use\n\n    int _betweenDuration;           //! Current key frame will last _betweenDuration frames\n    int _totalDuration;\n\n\n    int _fromIndex;\t\t\t\t    //! The current frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex\n    int _toIndex;                   //! The next frame index in FrameList of MovementBoneData, it's different from m_iFrameIndex\n\n    ArmatureAnimation *_animation;\n\n    bool _passLastFrame;            //! If current frame index is more than the last frame's index\n};\n\n}\n\n#endif /*__CCTWEEN_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCTweenFunction.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCTweenFunction.h\"\n#include \"cocostudio/CCUtilMath.h\"\n\n#ifndef M_PI_X_2\n#define M_PI_X_2 (float)M_PI * 2.0f\n#endif\n\nnamespace cocostudio {\n\nfloat TweenFunction::tweenTo(float time, TweenType type, float *easingParam)\n{\n    float delta = 0;\n\n    switch (type)\n    {\n    case CUSTOM_EASING:\n        delta = customEase(time, easingParam);\n        break;\n\n    case Linear:\n        delta = linear(time);\n        break;\n\n    case Sine_EaseIn:\n        delta = sineEaseIn(time);\n        break;\n    case Sine_EaseOut:\n        delta = sineEaseOut(time);\n        break;\n    case Sine_EaseInOut:\n        delta = sineEaseInOut(time);\n        break;\n\n    case Quad_EaseIn:\n        delta = quadEaseIn(time);\n        break;\n    case Quad_EaseOut:\n        delta = quadEaseOut(time);\n        break;\n    case Quad_EaseInOut:\n        delta = quadEaseInOut(time);\n        break;\n\n    case Cubic_EaseIn:\n        delta = cubicEaseIn(time);\n        break;\n    case Cubic_EaseOut:\n        delta = cubicEaseOut(time);\n        break;\n    case Cubic_EaseInOut:\n        delta = cubicEaseInOut(time);\n        break;\n\n    case Quart_EaseIn:\n        delta = quartEaseIn(time);\n        break;\n    case Quart_EaseOut:\n        delta = quartEaseOut(time);\n        break;\n    case Quart_EaseInOut:\n        delta = quartEaseInOut(time);\n        break;\n\n    case Quint_EaseIn:\n        delta = quintEaseIn(time);\n        break;\n    case Quint_EaseOut:\n        delta = quintEaseOut(time);\n        break;\n    case Quint_EaseInOut:\n        delta = quintEaseInOut(time);\n        break;\n\n    case Expo_EaseIn:\n        delta = expoEaseIn(time);\n        break;\n    case Expo_EaseOut:\n        delta = expoEaseOut(time);\n        break;\n    case Expo_EaseInOut:\n        delta = expoEaseInOut(time);\n        break;\n\n    case Circ_EaseIn:\n        delta = circEaseIn(time);\n        break;\n    case Circ_EaseOut:\n        delta = circEaseOut(time);\n        break;\n    case Circ_EaseInOut:\n        delta = circEaseInOut(time);\n        break;\n\n    case Elastic_EaseIn:\n        delta = elasticEaseIn(time, easingParam);\n        break;\n    case Elastic_EaseOut:\n        delta = elasticEaseOut(time, easingParam);\n        break;\n    case Elastic_EaseInOut:\n        delta = elasticEaseInOut(time, easingParam);\n        break;\n\n\n    case Back_EaseIn:\n        delta = backEaseIn(time);\n        break;\n    case Back_EaseOut:\n        delta = backEaseOut(time);\n        break;\n    case Back_EaseInOut:\n        delta = backEaseInOut(time);\n        break;\n\n    case Bounce_EaseIn:\n        delta = bounceEaseIn(time);\n        break;\n    case Bounce_EaseOut:\n        delta = bounceEaseOut(time);\n        break;\n    case Bounce_EaseInOut:\n        delta = bounceEaseInOut(time);\n        break;\n\n    default:\n        delta = sineEaseInOut(time);\n        break;\n    }\n\n    return delta;\n}\n\n// Linear\nfloat TweenFunction::linear(float time)\n{\n    return time;\n}\n\n\n// Sine Ease\nfloat TweenFunction::sineEaseIn(float time)\n{\n    return -1 * cosf(time * (float)M_PI_2) + 1;\n}\nfloat TweenFunction::sineEaseOut(float time)\n{\n    return sinf(time * (float)M_PI_2);\n}\nfloat TweenFunction::sineEaseInOut(float time)\n{\n    return -0.5f * (cosf((float)M_PI * time) - 1);\n}\n\n\n// Quad Ease\nfloat TweenFunction::quadEaseIn(float time)\n{\n    return time * time;\n}\nfloat TweenFunction::quadEaseOut(float time)\n{\n    return -1 * time * (time - 2);\n}\nfloat TweenFunction::quadEaseInOut(float time)\n{\n    time = time*2;\n    if (time < 1)\n        return 0.5f * time * time;\n    --time;\n    return -0.5f * (time * (time - 2) - 1);\n}\n\n\n\n// Cubic Ease\nfloat TweenFunction::cubicEaseIn(float time)\n{\n    return time * time * time;\n}\nfloat TweenFunction::cubicEaseOut(float time)\n{\n    time -= 1;\n    return (time * time * time + 1);\n}\nfloat TweenFunction::cubicEaseInOut(float time)\n{\n    time = time*2;\n    if (time < 1)\n        return 0.5f * time * time * time;\n    time -= 2;\n    return 0.5f * (time * time * time + 2);\n}\n\n\n// Quart Ease\nfloat TweenFunction::quartEaseIn(float time)\n{\n    return time * time * time * time;\n}\nfloat TweenFunction::quartEaseOut(float time)\n{\n    time -= 1;\n    return -(time * time * time * time - 1);\n}\nfloat TweenFunction::quartEaseInOut(float time)\n{\n    time = time*2;\n    if (time < 1)\n        return 0.5f * time * time * time * time;\n    time -= 2;\n    return -0.5f * (time * time * time * time - 2);\n}\n\n\n// Quint Ease\nfloat TweenFunction::quintEaseIn(float time)\n{\n    return time * time * time * time * time;\n}\nfloat TweenFunction::quintEaseOut(float time)\n{\n    time -=1;\n    return (time * time * time * time * time + 1);\n}\nfloat TweenFunction::quintEaseInOut(float time)\n{\n    time = time*2;\n    if (time < 1)\n        return 0.5f * time * time * time * time * time;\n    time -= 2;\n    return 0.5f * (time * time * time * time * time + 2);\n}\n\n\n// Expo Ease\nfloat TweenFunction::expoEaseIn(float time)\n{\n    return time == 0 ? 0 : powf(2, 10 * (time/1 - 1)) - 1 * 0.001f;\n}\nfloat TweenFunction::expoEaseOut(float time)\n{\n    return time == 1 ? 1 : (-powf(2, -10 * time / 1) + 1);\n}\nfloat TweenFunction::expoEaseInOut(float time)\n{\n    time /= 0.5f;\n    if (time < 1)\n    {\n        time = 0.5f * powf(2, 10 * (time - 1));\n    }\n    else\n    {\n        time = 0.5f * (-powf(2, -10 * (time - 1)) + 2);\n    }\n\n    return time;\n}\n\n\n// Circ Ease\nfloat TweenFunction::circEaseIn(float time)\n{\n    return -1 * (sqrt(1 - time * time) - 1);\n}\nfloat TweenFunction::circEaseOut(float time)\n{\n    time = time - 1;\n    return sqrt(1 - time * time);\n}\nfloat TweenFunction::circEaseInOut(float time)\n{\n    time = time * 2;\n    if (time < 1)\n        return -0.5f * (sqrt(1 - time * time) - 1);\n    time -= 2;\n    return 0.5f * (sqrt(1 - time * time) + 1);\n}\n\n\n// Elastic Ease\nfloat TweenFunction::elasticEaseIn(float time, float *easingParam)\n{\n    float period = 0.3f;\n\n    if (easingParam != NULL)\n    {\n        period = easingParam[0];\n    }\n\n    float newT = 0;\n    if (time == 0 || time == 1)\n    {\n        newT = time;\n    }\n    else\n    {\n        float s = period / 4;\n        time = time - 1;\n        newT = -powf(2, 10 * time) * sinf((time - s) * M_PI_X_2 / period);\n    }\n\n    return newT;\n}\nfloat TweenFunction::elasticEaseOut(float time, float *easingParam)\n{\n    float period = 0.3f;\n\n    if (easingParam != NULL)\n    {\n        period = easingParam[0];\n    }\n\n    float newT = 0;\n    if (time == 0 || time == 1)\n    {\n        newT = time;\n    }\n    else\n    {\n        float s = period / 4;\n        newT = powf(2, -10 * time) * sinf((time - s) * M_PI_X_2 / period) + 1;\n    }\n\n    return newT;\n}\nfloat TweenFunction::elasticEaseInOut(float time, float *easingParam)\n{\n    float period = 0.3f;\n\n    if (easingParam != NULL)\n    {\n        period = easingParam[0];\n    }\n\n    float newT = 0;\n    if (time == 0 || time == 1)\n    {\n        newT = time;\n    }\n    else\n    {\n        time = time * 2;\n        if (! period)\n        {\n            period = 0.3f * 1.5f;\n        }\n\n        float s = period / 4;\n\n        time = time - 1;\n        if (time < 0)\n        {\n            newT = -0.5f * powf(2, 10 * time) * sinf((time -s) * M_PI_X_2 / period);\n        }\n        else\n        {\n            newT = powf(2, -10 * time) * sinf((time - s) * M_PI_X_2 / period) * 0.5f + 1;\n        }\n    }\n    return newT;\n}\n\n\n// Back Ease\nfloat TweenFunction::backEaseIn(float time)\n{\n    float overshoot = 1.70158f;\n    return time * time * ((overshoot + 1) * time - overshoot);\n}\nfloat TweenFunction::backEaseOut(float time)\n{\n    float overshoot = 1.70158f;\n\n    time = time - 1;\n    return time * time * ((overshoot + 1) * time + overshoot) + 1;\n}\nfloat TweenFunction::backEaseInOut(float time)\n{\n    float overshoot = 1.70158f * 1.525f;\n\n    time = time * 2;\n    if (time < 1)\n    {\n        return (time * time * ((overshoot + 1) * time - overshoot)) / 2;\n    }\n    else\n    {\n        time = time - 2;\n        return (time * time * ((overshoot + 1) * time + overshoot)) / 2 + 1;\n    }\n}\n\n\n\n// Bounce Ease\nfloat bounceTime(float time)\n{\n    if (time < 1 / 2.75)\n    {\n        return 7.5625f * time * time;\n    } else \n        if (time < 2 / 2.75)\n        {\n            time -= 1.5f / 2.75f;\n            return 7.5625f * time * time + 0.75f;\n        } else\n            if(time < 2.5 / 2.75)\n            {\n                time -= 2.25f / 2.75f;\n                return 7.5625f * time * time + 0.9375f;\n            }\n\n            time -= 2.625f / 2.75f;\n            return 7.5625f * time * time + 0.984375f;\n}\nfloat TweenFunction::bounceEaseIn(float time)\n{\n    return 1 - bounceTime(1 - time);\n}\n\nfloat TweenFunction::bounceEaseOut(float time)\n{\n    return bounceTime(time);\n}\n\nfloat TweenFunction::bounceEaseInOut(float time)\n{\n    float newT = 0;\n    if (time < 0.5f)\n    {\n        time = time * 2;\n        newT = (1 - bounceTime(1 - time)) * 0.5f;\n    }\n    else\n    {\n        newT = bounceTime(time * 2 - 1) * 0.5f + 0.5f;\n    }\n\n    return newT;\n}\n\n\n// Custom Ease\nfloat TweenFunction::customEase(float time, float *easingParam)\n{\n    if (easingParam)\n    {\n        float tt = 1-time;\n        return easingParam[1]*tt*tt*tt + 3*easingParam[3]*time*tt*tt + 3*easingParam[5]*time*time*tt + easingParam[7]*time*time*time;\n    }\n    return time;\n}\n\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCTweenFunction.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCTWEENFUNCTION_H__\n#define __CCTWEENFUNCTION_H__\n\n\n#include \"cocostudio/CCArmatureDefine.h\"\n#include <math.h>\n\nnamespace cocostudio {\n\nenum TweenType\n{\n    CUSTOM_EASING = -1,\n\n    Linear,\n\n    Sine_EaseIn,\n    Sine_EaseOut,\n    Sine_EaseInOut,\n\n\n    Quad_EaseIn,\n    Quad_EaseOut,\n    Quad_EaseInOut,\n\n    Cubic_EaseIn,\n    Cubic_EaseOut,\n    Cubic_EaseInOut,\n\n    Quart_EaseIn,\n    Quart_EaseOut,\n    Quart_EaseInOut,\n\n    Quint_EaseIn,\n    Quint_EaseOut,\n    Quint_EaseInOut,\n\n    Expo_EaseIn,\n    Expo_EaseOut,\n    Expo_EaseInOut,\n\n    Circ_EaseIn,\n    Circ_EaseOut,\n    Circ_EaseInOut,\n\n    Elastic_EaseIn,\n    Elastic_EaseOut,\n    Elastic_EaseInOut,\n\n    Back_EaseIn,\n    Back_EaseOut,\n    Back_EaseInOut,\n\n    Bounce_EaseIn,\n    Bounce_EaseOut,\n    Bounce_EaseInOut,\n\n    TWEEN_EASING_MAX = 10000\n};\n/**\n*   @js NA\n*   @lua NA\n*/\nclass  TweenFunction\n{\npublic:\n\n    static float tweenTo(float time, TweenType type, float *easingParam);\n\n    static float linear(float time);\n\n    static float sineEaseIn(float time);\n    static float sineEaseOut(float time);\n    static float sineEaseInOut(float time);\n\n    static float quadEaseIn(float time);\n    static float quadEaseOut(float time);\n    static float quadEaseInOut(float time);\n\n    static float cubicEaseIn(float time);\n    static float cubicEaseOut(float time);\n    static float cubicEaseInOut(float time);\n\n    static float quartEaseIn(float time);\n    static float quartEaseOut(float time);\n    static float quartEaseInOut(float time);\n\n    static float quintEaseIn(float time);\n    static float quintEaseOut(float time);\n    static float quintEaseInOut(float time);\n\n    static float expoEaseIn(float time);\n    static float expoEaseOut(float time);\n    static float expoEaseInOut(float time);\n\n    static float circEaseIn(float time);\n    static float circEaseOut(float time);\n    static float circEaseInOut(float time);\n\n    static float elasticEaseIn(float time, float *easingParam);\n    static float elasticEaseOut(float time, float *easingParam);\n    static float elasticEaseInOut(float time, float *easingParam);\n\n    static float backEaseIn(float time);\n    static float backEaseOut(float time);\n    static float backEaseInOut(float time);\n\n    static float bounceEaseIn(float time);\n    static float bounceEaseOut(float time);\n    static float bounceEaseInOut(float time);\n\n    static float customEase(float time, float *easingParam);\n};\n\n\n}\n\n#endif /*__CCTWEENFUNCTION_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCUtilMath.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"cocostudio/CCUtilMath.h\"\n\nusing namespace cocos2d;\n\n\nnamespace cocostudio {\n\nbool isSpriteContainPoint(Sprite *sprite, Point point, Point &outPoint)\n{\n    outPoint = sprite->convertToNodeSpace(point);\n\n    Size s  = sprite->getContentSize();\n    Rect r(0, 0, s.width, s.height);\n\n    return r.containsPoint(outPoint);\n}\n\nbool isSpriteContainPoint(Sprite *sprite, Point point)\n{\n    Point p = Point(0, 0);\n    return isSpriteContainPoint(sprite, point, p);\n}\n\n\nPoint bezierTo(float t, Point &point1, Point &point2, Point &point3)\n{\n\n    Point p;\n\n    p.x = pow((1 - t), 2) * point1.x + 2 * t * (1 - t) * point2.x + pow(t, 2) * point3.x;\n    p.y = pow((1 - t), 2) * point1.y + 2 * t * (1 - t) * point2.y + pow(t, 2) * point3.y;\n\n    return p;\n}\n\nPoint bezierTo(float t, Point &point1, Point &point2, Point &point3, Point &point4)\n{\n    Point p;\n\n    p.x = point1.x * pow((1 - t), 3) + 3 * t * point2.x * pow((1 - t), 2) + 3 * point3.x * pow(t, 2) * (1 - t) + point4.x * pow(t, 3);\n    p.y = point1.y * pow((1 - t), 3) + 3 * t * point2.y * pow((1 - t), 2) + 3 * point3.y * pow(t, 2) * (1 - t) + point4.y * pow(t, 3);\n\n    return p;\n}\n\nPoint circleTo(float t, Point &center, float radius, float fromRadian, float radianDif)\n{\n    Point p;\n\n    p.x = center.x + radius * cos(fromRadian + radianDif * t);\n    p.y = center.y + radius * sin(fromRadian + radianDif * t);\n\n    return p;\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CCUtilMath.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCUTILMATH_H__\n#define __CCUTILMATH_H__\n\n#include \"CCSprite.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include <math.h>\n\nnamespace cocostudio {\n\n#define CC_DOUBLE_PI (M_PI*2)\n\n#define CC_HALF_PI  (M_PI * 0.5f)\n\n\n//! hit test function\nbool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Point point);\nbool isSpriteContainPoint(cocos2d::Sprite *sprite, cocos2d::Point point, cocos2d::Point &outPoint);\n\n#define CC_SPRITE_CONTAIN_POINT(sprite, point) isSpriteContainPoint((sprite), (point))\n#define CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint) isSpriteContainPoint((sprite), (point), outPoint)\n\n\n//! motion curve function\ncocos2d::Point bezierTo(float t, cocos2d::Point &point1, cocos2d::Point &point2, cocos2d::Point &point3);\ncocos2d::Point bezierTo(float t, cocos2d::Point &point1, cocos2d::Point &point2, cocos2d::Point &point3, cocos2d::Point &point4);\n\ncocos2d::Point circleTo(float t, cocos2d::Point &center, float radius, float fromRadian, float radianDif);\n\n\n}\n\n#endif /*__CCUTILMATH_H__*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CMakeLists.txt",
    "content": "set(CS_SRC\n  CCActionEaseEx.cpp\n  CCActionFrame.cpp\n  CCActionFrameEasing.cpp\n  CCActionManagerEx.cpp\n  CCActionNode.cpp\n  CCActionObject.cpp\n  CCArmature.cpp\n  CCBone.cpp\n  CCArmatureAnimation.cpp\n  CCProcessBase.cpp\n  CCTween.cpp\n  CCDatas.cpp\n  CCBatchNode.cpp\n  CCDecorativeDisplay.cpp\n  CCDisplayFactory.cpp\n  CCDisplayManager.cpp\n  CCSkin.cpp\n  CCColliderDetector.cpp\n  CCArmatureDataManager.cpp\n  CCArmatureDefine.cpp\n  CCDataReaderHelper.cpp\n  CCSpriteFrameCacheHelper.cpp\n  CCTransformHelp.cpp\n  CCTweenFunction.cpp\n  CCUtilMath.cpp\n  CCComAttribute.cpp\n  CCComAudio.cpp\n  CCComController.cpp\n  CCComRender.cpp\n  CCInputDelegate.cpp\n  DictionaryHelper.cpp\n  CCSGUIReader.cpp\n  CCSSceneReader.cpp\n  ObjectFactory.cpp\n  TriggerBase.cpp\n  TriggerMng.cpp\n  TriggerObj.cpp\n)\n\ninclude_directories(\n  ..\n)\n\nadd_library(cocostudio STATIC\n  ${CS_SRC}\n)\n\ntarget_link_libraries(cocostudio\n)\n\nset_target_properties(cocostudio\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/CocoStudio.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __EDITOR_SUPPORT_COCOSTUDIO_H__\n#define __EDITOR_SUPPORT_COCOSTUDIO_H__\n\n#include \"cocostudio/CCActionFrame.h\"\n#include \"cocostudio/CCActionFrameEasing.h\"\n#include \"cocostudio/CCActionManagerEx.h\"\n#include \"cocostudio/CCActionNode.h\"\n#include \"cocostudio/CCActionObject.h\"\n#include \"cocostudio/CCArmature.h\"\n#include \"cocostudio/CCBone.h\"\n#include \"cocostudio/CCArmatureAnimation.h\"\n#include \"cocostudio/CCProcessBase.h\"\n#include \"cocostudio/CCTween.h\"\n#include \"cocostudio/CCDatas.h\"\n#include \"cocostudio/CCBatchNode.h\"\n#include \"cocostudio/CCDecorativeDisplay.h\"\n#include \"cocostudio/CCDisplayFactory.h\"\n#include \"cocostudio/CCDisplayManager.h\"\n#include \"cocostudio/CCSkin.h\"\n#include \"cocostudio/CCColliderDetector.h\"\n#include \"cocostudio/CCArmatureDataManager.h\"\n#include \"cocostudio/CCArmatureDefine.h\"\n#include \"cocostudio/CCDataReaderHelper.h\"\n#include \"cocostudio/CCSpriteFrameCacheHelper.h\"\n#include \"cocostudio/CCTransformHelp.h\"\n#include \"cocostudio/CCTweenFunction.h\"\n#include \"cocostudio/CCUtilMath.h\"\n#include \"cocostudio/CCComBase.h\"\n#include \"cocostudio/CCComAttribute.h\"\n#include \"cocostudio/CCComAudio.h\"\n#include \"cocostudio/CCComController.h\"\n#include \"cocostudio/CCComRender.h\"\n#include \"cocostudio/CCInputDelegate.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n#include \"cocostudio/CCSGUIReader.h\"\n#include \"cocostudio/CCSSceneReader.h\"\n#include \"cocostudio/TriggerBase.h\"\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/DictionaryHelper.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCPlatformMacros.h\"\n#include \"cocostudio/DictionaryHelper.h\"\n\nnamespace cocostudio {\n    \nstatic DictionaryHelper* sharedHelper = nullptr;\n\nDictionaryHelper::DictionaryHelper()\n{\n    \n}\n\nDictionaryHelper::~DictionaryHelper()\n{\n    \n}\n\nDictionaryHelper* DictionaryHelper::getInstance()\n{\n    if (!sharedHelper) {\n        sharedHelper = new DictionaryHelper();\n    }\n    return sharedHelper;\n}\n\nvoid DictionaryHelper::destroyInstance()\n{\n\t CC_SAFE_DELETE(sharedHelper);\n}\n\nconst rapidjson::Value& DictionaryHelper::getSubDictionary_json(const rapidjson::Value &root, const char* key)\n{\n\treturn root[key];\n}\n\nconst rapidjson::Value& DictionaryHelper::getSubDictionary_json(const rapidjson::Value &root, const char* key, int idx)\n{\n    return root[key][idx];\n}\n\nconst rapidjson::Value& DictionaryHelper::getSubDictionary_json(const rapidjson::Value &root, int idx)\n{\n    return root[idx];\n}\n\nint DictionaryHelper::getIntValue_json(const rapidjson::Value& root, const char* key, int def)\n{\n    int nRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[key].IsNull());\n        nRet = root[key].GetInt();\n    } while (0);\n    \n    return nRet;\n}\n\n\nfloat DictionaryHelper::getFloatValue_json(const rapidjson::Value& root,const char* key, float def)\n{\n\tfloat fRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[key].IsNull());\n        fRet = (float)root[key].GetDouble();\n    } while (0);\n    \n    return fRet;\n}\n\nbool DictionaryHelper::getBooleanValue_json(const rapidjson::Value& root,const char* key, bool def)\n{\n    bool bRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[key].IsNull());\n        bRet = root[key].GetBool();\n    } while (0);\n    \n    return bRet;\n}\n\nconst char* DictionaryHelper::getStringValue_json(const rapidjson::Value& root,const char* key, const char *def)\n{\n    const char* sRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[key].IsNull());\n        sRet = root[key].GetString();\n    } while (0);\n    \n    return sRet;\n}\n\n\n\nint DictionaryHelper::getArrayCount_json(const rapidjson::Value& root, const char* key, int def)\n{\n    int nRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[key].IsNull());\n        nRet = (int)(root[key].Size());\n    } while (0);\n    \n    return nRet;\n}\n\n\nint DictionaryHelper::getIntValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, int def)\n{\n    int nRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[arrayKey].IsNull());\n        CC_BREAK_IF(root[arrayKey][idx].IsNull());\n        nRet = root[arrayKey][idx].GetInt();\n    } while (0);\n    \n    return nRet;\n}\n\n\nfloat DictionaryHelper::getFloatValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, float def)\n{\n    float fRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[arrayKey].IsNull());\n        CC_BREAK_IF(root[arrayKey][idx].IsNull());\n        fRet = (float)root[arrayKey][idx].GetDouble();\n    } while (0);\n    \n    return fRet;\n}\n\nbool DictionaryHelper::getBoolValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, bool def)\n{\n\tbool bRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[arrayKey].IsNull());\n        CC_BREAK_IF(root[arrayKey][idx].IsNull());\n        bRet = root[arrayKey][idx].GetBool();\n    } while (0);\n    \n    return bRet;\n}\n\nconst char* DictionaryHelper::getStringValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, const char *def)\n{\n    const char *sRet = def;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(root[arrayKey].IsNull());\n        CC_BREAK_IF(root[arrayKey][idx].IsNull());\n        sRet = root[arrayKey][idx].GetString();\n    } while (0);\n    \n    return sRet;\n}\n\nconst rapidjson::Value &DictionaryHelper::getDictionaryFromArray_json(const rapidjson::Value &root, const char* key,int idx)\n{\n\treturn root[key][idx];\n}\n\nbool DictionaryHelper::checkObjectExist_json(const rapidjson::Value &root)\n{\n    bool bRet = false;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        bRet = true;\n    } while (0);\n    \n    return bRet;\n}\n\nbool DictionaryHelper::checkObjectExist_json(const rapidjson::Value &root,const char* key)\n{\n    bool bRet = false;\n    do {\n        CC_BREAK_IF(root.IsNull());\n        bRet = root.HasMember(key);\n    } while (0);\n    \n    return bRet;\n}\n\nbool DictionaryHelper::checkObjectExist_json(const rapidjson::Value &root, int index)\n{\n    bool bRet = false;\n    do {   \n        CC_BREAK_IF(root.IsNull());\n        CC_BREAK_IF(!root.IsArray());\n        CC_BREAK_IF(index < 0 || root.Size() <= (unsigned int )index);\n        bRet = true;\n    } while (0);\n\n    return bRet;\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/DictionaryHelper.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __DICTIONARYHELPER_H__\n#define __DICTIONARYHELPER_H__\n\n#include \"json/document.h\"\n\n#define DICTOOL DictionaryHelper::getInstance()\n\nnamespace cocostudio {\n/**\n *  @js NA\n *  @lua NA\n */\nclass DictionaryHelper\n{\npublic:\n    DictionaryHelper();\n    ~DictionaryHelper();\n    static DictionaryHelper* getInstance();\n\tstatic void destroyInstance();\n    \n\tconst rapidjson::Value& getSubDictionary_json(const rapidjson::Value &root, const char* key);\n    const rapidjson::Value& getSubDictionary_json(const rapidjson::Value &root, const char* key, int idx);\n    const rapidjson::Value& getSubDictionary_json(const rapidjson::Value &root, int idx);\n    \n\tint   getIntValue_json(const rapidjson::Value& root, const char* key, int def = 0);\n\tfloat getFloatValue_json(const rapidjson::Value& root,const char* key, float def = 0.0f);\n    bool  getBooleanValue_json(const rapidjson::Value& root,const char* key, bool def = false);\n    const char* getStringValue_json(const rapidjson::Value& root,const char* key, const char *def = NULL);\n    int   getArrayCount_json(const rapidjson::Value& root,const char* key, int def = 0);\n\t\n    int   getIntValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, int def = 0);\n\tfloat getFloatValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, float def = 0.0f);\n\tbool  getBoolValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, bool def = false);\n\tconst char* getStringValueFromArray_json(const rapidjson::Value& root,const char* arrayKey,int idx, const char *def = NULL);\n\tconst rapidjson::Value &getDictionaryFromArray_json(const rapidjson::Value &root, const char* key,int idx);\n\tbool checkObjectExist_json(const rapidjson::Value &root);\n    bool checkObjectExist_json(const rapidjson::Value &root, const char* key);\n    bool checkObjectExist_json(const rapidjson::Value &root, int index);\n};\n\n}\n\n#endif /* defined(__CocoGUI__DictionaryHelper__) */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/ObjectFactory.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"ObjectFactory.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n\nObjectFactory::TInfo::TInfo(void)\n:_class(\"\")\n,_fun(nullptr)\n{\n}\n\nObjectFactory::TInfo::TInfo(const std::string& type, Instance ins)\n:_class(type)\n,_fun(ins)\n{\n    ObjectFactory::getInstance()->registerType(*this);\n}\n\nObjectFactory::TInfo::TInfo(const TInfo &t)\n{\n    _class = t._class;\n    _fun = t._fun;\n}\n\nObjectFactory::TInfo::~TInfo(void)\n{\n   _class = \"\";\n   _fun = nullptr;\n}\n\nObjectFactory::TInfo& ObjectFactory::TInfo::operator= (const TInfo &t)\n{\n    _class = t._class;\n    _fun = t._fun;\n    return *this;\n}\n\n\nObjectFactory* ObjectFactory::_sharedFactory = nullptr;\n\nObjectFactory::ObjectFactory(void)\n{\n\n}\n\nObjectFactory::~ObjectFactory(void)\n{\n    _typeMap.clear();\n}\n\nObjectFactory* ObjectFactory::getInstance()\n{\n    if ( nullptr == _sharedFactory)\n    {\n        _sharedFactory = new ObjectFactory();\n    }\n    return _sharedFactory;\n}\n\nvoid ObjectFactory::destroyInstance()\n{\n    CC_SAFE_DELETE(_sharedFactory);\n}\n\nObject* ObjectFactory::createObject(const std::string &name)\n{\n\tObject *o = nullptr;\n\tdo \n\t{\n\t\tconst TInfo t = _typeMap[name];\n\t\tCC_BREAK_IF(t._fun == nullptr);\n\t\to = t._fun();\n\t} while (0);\n   \n    return o;\n}\n\nComponent* ObjectFactory::createComponent(const std::string &name)\n{\n    std::string comName;\n\tif (name == \"CCSprite\" || name == \"CCTMXTiledMap\" || name == \"CCParticleSystemQuad\" || name == \"CCArmature\" || name == \"GUIComponent\")\n\t{\n\t\tcomName = \"ComRender\";\n\t}\n\telse if (name == \"CCComAudio\" || name == \"CCBackgroundAudio\")\n\t{\n\t\tcomName = \"ComAudio\";\n\t}\n    else if (name == \"CCComController\")\n    {\n        comName = \"ComController\";\n    }\n    else if (name == \"CCComAttribute\")\n    {\n        comName = \"ComAttribute\";\n    }\n    else if (name == \"CCScene\")\n    {\n        comName = \"Scene\";\n    }\n    else\n    {\n        CCASSERT(false, \"Unregistered Component!\");\n    }\n\tObject *o = NULL;\n\tdo \n\t{\n\t\tconst TInfo t = _typeMap[comName];\n\t\tCC_BREAK_IF(t._fun == NULL);\n\t\to = t._fun();\n\t} while (0);\n\n\treturn (Component*)o;\n\n}\n\nvoid ObjectFactory::registerType(const TInfo &t)\n{\n    _typeMap.insert(std::make_pair(t._class, t));\n}\n\n}"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/ObjectFactory.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __TRIGGERFACTORY_H__\n#define __TRIGGERFACTORY_H__\n\n#include \"cocos2d.h\"\n#include <string>\n#include <unordered_map>\n\nnamespace cocostudio {\n\nclass ObjectFactory\n{\npublic:\n    typedef cocos2d::Object* (*Instance)(void);\n    struct TInfo\n    {\n        TInfo(void);\n        TInfo(const std::string& type, Instance ins = NULL);\n        TInfo(const TInfo &t);\n        ~TInfo(void);\n        TInfo& operator= (const TInfo &t);\n        std::string _class;\n        Instance _fun;\n    };\n    typedef std::unordered_map<std::string, TInfo>  FactoryMap;\n\n    static ObjectFactory* getInstance();\n    static void destroyInstance();\n    cocos2d::Object* createObject(const std::string &name);\n    cocos2d::Component* createComponent(const std::string &name);\n    void registerType(const TInfo &t);\n    void removeAll();\n\nprotected:\n    ObjectFactory(void);\n    virtual ~ObjectFactory(void);\nprivate:\n    static ObjectFactory *_sharedFactory;\n    FactoryMap _typeMap;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/TriggerBase.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"TriggerBase.h\"\n\nusing namespace cocos2d;\nusing namespace cocostudio;\n\nvoid sendEvent(unsigned int event)\n{\n    cocos2d::Vector<TriggerObj*> *array = TriggerMng::getInstance()->get(event);\n    do {\n        CC_BREAK_IF(array == nullptr);\n        for (const auto& object : *array)\n        {\n            if(object != nullptr && object->detect())\n            {\n                object->done();\n            }\n        }\n    } while (0);\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/TriggerBase.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __TRIGGEREVENT_H__\n#define __TRIGGEREVENT_H__\n\n#include \"cocos2d.h\"\n#include \"cocostudio/CocoStudio.h\"\n#include \"ObjectFactory.h\"\n#include \"TriggerObj.h\"\n#include \"TriggerMng.h\"\n\n\n#define DECLARE_CLASS_INFO \\\n    public: \\\n        static cocostudio::ObjectFactory::TInfo Type; \\\n        static cocos2d::Object* createInstance(void); \\\n        \n#define IMPLEMENT_CLASS_INFO(className) \\\n        cocos2d::Object* className::createInstance(void) \\\n        { \\\n            return new className; \\\n        } \\\n        cocostudio::ObjectFactory::TInfo className::Type(#className, &className::createInstance); \\\n\n\nvoid sendEvent(unsigned int event);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/TriggerMng.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"TriggerMng.h\"\n#include \"json/filestream.h\"\n#include \"json/prettywriter.h\"\n#include \"json/stringbuffer.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n    \nTriggerMng* TriggerMng::_sharedTriggerMng = nullptr;\n\nTriggerMng::TriggerMng(void)\n: _movementDispatches(new std::unordered_map<Armature*, ArmatureMovementDispatcher*>)\n{\n}\n\nTriggerMng::~TriggerMng(void)\n{\n    removeAll();\n    _eventTriggers.clear();\n\t_triggerObjs.clear();\n\n\tremoveAllArmatureMovementCallBack();\n\tCC_SAFE_DELETE(_movementDispatches);\n}\n\nconst char* TriggerMng::triggerMngVersion()\n{\n    return \"1.0.0.0\";\n}\n\nTriggerMng* TriggerMng::getInstance()\n{\n    if (nullptr == _sharedTriggerMng)\n    {\n        _sharedTriggerMng = new TriggerMng();\n    }\n    return _sharedTriggerMng;\n}\n\nvoid TriggerMng::destroyInstance()\n{\n    CC_SAFE_DELETE(_sharedTriggerMng);\n}\n\nvoid TriggerMng::parse(const rapidjson::Value &root)\n{\n    CCLOG(\"%s\", triggerMngVersion());\n    int count = DICTOOL->getArrayCount_json(root, \"Triggers\");\n    ScriptEngineProtocol* engine = ScriptEngineManager::getInstance()->getScriptEngine();\n    bool useBindings = engine != nullptr;\n\n    if (useBindings)\n    {\n        if (count > 0)\n        {\n            const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(root, \"Triggers\");\n            rapidjson::StringBuffer buffer;\n            rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);\n            subDict.Accept(writer);\n            \n            engine->parseConfig(ScriptEngineProtocol::ConfigType::COCOSTUDIO, buffer.GetString());\n        }\n    }\n    else\n    {\n        for (int i = 0; i < count; ++i)\n        {\n            const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(root, \"Triggers\", i);\n            TriggerObj *obj = TriggerObj::create();\n            obj->serialize(subDict);\n            auto &vInt = obj->getEvents();\n            for (const auto& e : vInt)\n            {\n                add((unsigned int)e, obj);\n            }\n            \n            _triggerObjs.insert(std::pair<unsigned int, TriggerObj*>(obj->getId(), obj));\n        }\n    }\n}\n\ncocos2d::Vector<TriggerObj*>* TriggerMng::get(unsigned int event) const\n{\n    CCAssert(event >= 0, \"Argument must be larger than 0\");\n    \n    auto iter = _eventTriggers.find(event);\n    if (iter == _eventTriggers.end())\n    {\n        return nullptr;\n    }\n    return iter->second;\n}\n\nTriggerObj* TriggerMng::getTriggerObj(unsigned int id) const\n{\n    auto iter = _triggerObjs.find(id);\n    if (iter == _triggerObjs.end())\n    {\n        return nullptr;\n    }\n    return iter->second;\n}\n\nbool TriggerMng::add(unsigned int event, TriggerObj *obj)\n{\n    bool ret = false;\n    CCAssert(obj != nullptr, \"Argument must be non-nil\");\n    do\n    {\n        auto iterator = _eventTriggers.find(event);\n        if (iterator == _eventTriggers.end())\n        {\n            auto array = new cocos2d::Vector<TriggerObj*>();\n            array->pushBack(obj);\n            _eventTriggers.insert(std::make_pair(event, array));\n        }\n        else\n        {\n            Vector<TriggerObj*>* temp = iterator->second;\n            if(temp->find(obj) == temp->end())\n            {\n                temp->pushBack(obj);\n            }\n        }\n        ret = true;\n    } while(0);\n    return ret;\n}\n\nvoid TriggerMng::removeAll(void)\n{\n    auto etIter = _eventTriggers.begin();\n    for (;etIter != _eventTriggers.end(); ++etIter)\n    {\n        for (auto toIter = etIter->second->begin(); toIter != etIter->second->end(); ++toIter)\n        {\n            (*toIter)->removeAll();\n        }\n        etIter->second->clear();\n        CC_SAFE_DELETE(etIter->second);\n    }\n    _eventTriggers.clear();\n}\n\nbool TriggerMng::remove(unsigned int event)\n{\n    bool bRet = false;\n    CCAssert(event >= 0, \"event must be larger than 0\");\n    do \n    {\n        auto iterator = _eventTriggers.find(event);\n        if(iterator != _eventTriggers.end())\n        {\n            for(auto &obj : *iterator->second)\n            {\n                obj->removeAll();\n            }\n            iterator->second->clear();\n            CC_SAFE_DELETE(iterator->second);\n        }\n        \n        _eventTriggers.erase(event);\n        \n        bRet = true;\n    } while(0);\n    return bRet;\n}\n\nbool TriggerMng::remove(unsigned int event, TriggerObj *Obj)\n{\n\tbool bRet = false;\n\tCCAssert(event >= 0, \"event must be larger than 0\");\n\tCCAssert(Obj != 0, \"TriggerObj must be not 0\");\n\tdo \n\t{\n        auto iterator = _eventTriggers.find(event);\n        if(iterator != _eventTriggers.end())\n        {\n            for(auto &triobj : *iterator->second)\n            {\n                if (triobj != nullptr && triobj == Obj)\n                {\n                    triobj->removeAll();\n                    break;\n                }\n            }\n            \n            iterator->second->eraseObject(Obj);\n        }\n        \n\t\tbRet = true;\n\t} while(0);\n\treturn bRet;\n}\n\nbool TriggerMng::removeTriggerObj(unsigned int id)\n{\n\tTriggerObj *obj = getTriggerObj(id);\n\tif (obj == nullptr)\n\t{\n\t\treturn false;\n\t}\n\tauto &_vInt = obj->getEvents();\n\tfor (auto iter = _vInt.begin(); iter != _vInt.end(); ++iter)\n\t{\n\t\tremove(*iter, obj);\n\t}\n\treturn true;\n}\n\nbool TriggerMng::isEmpty(void) const\n{\n    return _eventTriggers.empty();\n}\n\nvoid TriggerMng::addArmatureMovementCallBack(Armature *pAr, Object *pTarget, SEL_MovementEventCallFunc mecf)\n{\n\tif (pAr == nullptr || _movementDispatches == nullptr || pTarget == nullptr || mecf == nullptr)\n\t{\n\t\treturn;\n\t}\n\n\tauto iter = _movementDispatches->find(pAr);\n\tArmatureMovementDispatcher *amd = nullptr;\n\tif (iter == _movementDispatches->end())\n\t{\n\t\tamd = new ArmatureMovementDispatcher();\n        pAr->getAnimation()->setMovementEventCallFunc(CC_CALLBACK_0(ArmatureMovementDispatcher::animationEvent, amd, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));\n        amd->addAnimationEventCallBack(pTarget, mecf);\n\t\t_movementDispatches->insert(std::make_pair(pAr, amd));\n\n\t}\n\telse\n\t{\n\t\tamd = iter->second;\n\t\tamd->addAnimationEventCallBack(pTarget, mecf);\n\t}\n}\n\nvoid TriggerMng::removeArmatureMovementCallBack(Armature *pAr, Object *pTarget, SEL_MovementEventCallFunc mecf)\n{\n\tif (pAr == nullptr || _movementDispatches == nullptr || pTarget == nullptr || mecf == nullptr)\n\t{\n\t\treturn;\n\t}\n    \n    auto iter =_movementDispatches->find(pAr);\n\tArmatureMovementDispatcher *amd = nullptr;\n\tif (iter == _movementDispatches->end())\n\t{\n\t\treturn;\n\t}\n\telse\n\t{\n\t\tamd = iter->second;\n\t\tamd->removeAnnimationEventCallBack(pTarget, mecf);\n\t}\n}\n\nvoid TriggerMng::removeArmatureAllMovementCallBack(Armature *pAr)\n{\n\tif (pAr == nullptr)\n\t{\n\t\treturn;\n\t}\n\n\tauto iter = _movementDispatches->find(pAr);\n\tif (iter == _movementDispatches->end())\n\t{\n\t\treturn;\n\t}\n\telse\n\t{\n\t\tCC_SAFE_DELETE(iter->second);\n\t\t_movementDispatches->erase(iter);\n\t}\n}\n\nvoid TriggerMng::removeAllArmatureMovementCallBack()\n{\n\tauto iter = _movementDispatches->begin();\n\twhile (iter != _movementDispatches->end())\n\t{\n\t\tremoveArmatureAllMovementCallBack(iter->first);\n\t}\n\t_movementDispatches->clear();\n}\n\nArmatureMovementDispatcher::ArmatureMovementDispatcher(void)\n: _mapEventAnimation(nullptr)\n{\n\t_mapEventAnimation = new std::unordered_map<Object*, SEL_MovementEventCallFunc> ;\n}\n\nArmatureMovementDispatcher::~ArmatureMovementDispatcher(void)\n{\n\t_mapEventAnimation->clear();\n\tCC_SAFE_DELETE(_mapEventAnimation);\n}\n\n void ArmatureMovementDispatcher::animationEvent(Armature *armature, MovementEventType movementType, const std::string& movementID)\n {\n\t for (auto iter = _mapEventAnimation->begin(); iter != _mapEventAnimation->end(); ++iter)\n\t {\n\t\t   (iter->first->*iter->second)(armature, movementType, movementID);\n\t }\n }\n\n  void ArmatureMovementDispatcher::addAnimationEventCallBack(Object *pTarget, SEL_MovementEventCallFunc mecf)\n  {\n\t  _mapEventAnimation->insert(std::make_pair(pTarget, mecf));\n  }\n\n  void ArmatureMovementDispatcher::removeAnnimationEventCallBack(Object *pTarget, SEL_MovementEventCallFunc mecf)\n  {\n\t  _mapEventAnimation->erase(pTarget);\n  }\n  \n}\n\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/TriggerMng.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TRIGGERMNG_H__\n#define __TRIGGERMNG_H__\n\n#include \"cocos2d.h\"\n#include \"CocoStudio.h\"\n\nnamespace cocostudio {\n\nclass TriggerObj;\n\nclass ArmatureMovementDispatcher : public cocos2d::Object\n{\npublic:\n\tArmatureMovementDispatcher(void);\n\t~ArmatureMovementDispatcher(void);\npublic:\n\tvoid addAnimationEventCallBack(cocos2d::Object*pTarget, SEL_MovementEventCallFunc mecf);\n\tvoid removeAnnimationEventCallBack(cocos2d::Object*pTarget, SEL_MovementEventCallFunc mecf);\n\tvoid animationEvent(Armature *armature, MovementEventType movementType, const std::string& movementID);\n    \nprivate:\n\tstd::unordered_map<Object*, SEL_MovementEventCallFunc> *_mapEventAnimation;\n\n};\n\nclass TriggerMng\n{\npublic:\n\tTriggerMng(void);\n\tvirtual ~TriggerMng(void);\n\t\npublic:\n    static TriggerMng* getInstance();\n    static void destroyInstance();\n    static const char* triggerMngVersion();\n    \npublic:\n\tvoid parse(const rapidjson::Value &root);\n\tvoid removeAll(void);\n\tcocos2d::Vector<TriggerObj*>* get(unsigned int event) const;\n\tTriggerObj* getTriggerObj(unsigned int id) const;\n    bool add(unsigned int event, TriggerObj *pObj);\n    bool remove(unsigned int event);\n\tbool remove(unsigned int event, TriggerObj *pObj);\n\tbool removeTriggerObj(unsigned int id);\n    bool isEmpty(void) const;\n    void addArmatureMovementCallBack(Armature *pAr, cocos2d::Object *pTarget, SEL_MovementEventCallFunc mecf);\n\tvoid removeArmatureMovementCallBack(Armature *pAr, cocos2d::Object *pTarget, SEL_MovementEventCallFunc mecf);\n\tvoid removeArmatureAllMovementCallBack(Armature *pAr);\n\tvoid removeAllArmatureMovementCallBack();\n\nprivate:\n    std::unordered_map<unsigned int, cocos2d::Vector<TriggerObj*>*> _eventTriggers;\n    static TriggerMng *_sharedTriggerMng;\n\tstd::unordered_map<unsigned int, TriggerObj*> _triggerObjs;\n\tstd::unordered_map<Armature*, ArmatureMovementDispatcher*> *_movementDispatches;\n};\n\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/TriggerObj.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TriggerObj.h\"\n\nusing namespace cocos2d;\n\nnamespace cocostudio {\n    \nBaseTriggerCondition::BaseTriggerCondition(void)\n{\n}\n\nBaseTriggerCondition::~BaseTriggerCondition(void)\n{\n}\n\nbool BaseTriggerCondition::init()\n{\n    return true;\n}\n\nbool BaseTriggerCondition::detect()\n{\n    return true;\n}\n\nvoid BaseTriggerCondition::serialize(const rapidjson::Value &val)\n{\n}\n\nvoid BaseTriggerCondition::removeAll()\n{\n}\n\nBaseTriggerAction::BaseTriggerAction(void)\n{\n}\n\nBaseTriggerAction::~BaseTriggerAction(void)\n{\n}\n\nbool BaseTriggerAction::init()\n{\n    return true;\n}\n\nvoid BaseTriggerAction::done()\n{\n\n}\n\nvoid BaseTriggerAction::serialize(const rapidjson::Value &val)\n{\n}\n\nvoid BaseTriggerAction::removeAll()\n{\n}\n\nTriggerObj::TriggerObj(void)\n:_id(UINT_MAX)\n,_enabled(true)\n{\n\t_vInt.clear();\n}\n\nTriggerObj::~TriggerObj(void)\n{\n\t_vInt.clear();\n}\n\nbool TriggerObj::init()\n{\n    return true;\n}\n\nTriggerObj* TriggerObj::create()\n{\n    TriggerObj * pRet = new TriggerObj();\n    if (pRet && pRet->init())\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    return pRet;\n}\n\nbool TriggerObj::detect()\n{\n\tif (!_enabled || _cons.empty())\n\t{\n\t\treturn true;\n\t}\n    \n    bool ret = true;\n\n    for (const auto& con : _cons)\n    {\n        ret = ret && con->detect();\n    }\n\n    return ret;\n}\n\nvoid TriggerObj::done()\n{\n\tif (!_enabled || _acts.empty())\n\t{\n\t\treturn;\n\t}\n\n    for (const auto& act : _acts)\n    {\n        act->done();\n    }\n}\n\nvoid TriggerObj::removeAll()\n{\n    for (const auto& con : _cons)\n    {\n        con->removeAll();\n    }\n    \n    for (const auto& act : _acts)\n    {\n        act->removeAll();\n    }\n    \n    _cons.clear();\n    _acts.clear();\n}\n\nvoid TriggerObj::serialize(const rapidjson::Value &val)\n{\n\t_id = (unsigned int)(DICTOOL->getIntValue_json(val, \"id\"));\n    int count = DICTOOL->getArrayCount_json(val, \"conditions\");\n    for (int i = 0; i < count; ++i)\n    {\n        const rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(val, \"conditions\", i);\n        const char *classname = DICTOOL->getStringValue_json(subDict, \"classname\");\n        if (classname == nullptr)\n        {\n            continue;\n        }\n        BaseTriggerCondition *con = dynamic_cast<BaseTriggerCondition*>(ObjectFactory::getInstance()->createObject(classname));\n        if(con == nullptr)\n        {\n            CCLOG(\"class %s can not be implemented!\", classname);\n            CCASSERT(con != nullptr, \"\");\n        }\n        \n        CCASSERT(con != nullptr, \"\");\n        con->serialize(subDict);\n\t\tcon->init();\n        _cons.pushBack(con);\n    }\n    \n\tcount = DICTOOL->getArrayCount_json(val, \"actions\");\n\tfor (int i = 0; i < count; ++i)\n\t{\n\t\tconst rapidjson::Value &subDict = DICTOOL->getSubDictionary_json(val, \"actions\", i);\n\t\tconst char *classname = DICTOOL->getStringValue_json(subDict, \"classname\");\n\t\tif (classname == nullptr)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tBaseTriggerAction *act = dynamic_cast<BaseTriggerAction*>(ObjectFactory::getInstance()->createObject(classname));\n\t\tif(act == nullptr)\n        {\n            CCLOG(\"class %s can not be implemented!\", classname);\n            CCASSERT(act != nullptr, \"\");\n        }\n\t\tact->serialize(subDict);\n\t\tact->init();\n\t\t_acts.pushBack(act);\n\t}\n\n\tint length = DICTOOL->getArrayCount_json(val, \"events\");\n\tfor (int i = 0; i < length; ++i)\n\t{\n\t\tconst rapidjson::Value &sub = DICTOOL->getSubDictionary_json(val, \"events\", i);\n\t\tint event = DICTOOL->getIntValue_json(sub, \"id\");\n\t\tif (event < 0)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t_vInt.push_back(event);\n\t}  \n}\n\nunsigned int TriggerObj::getId()\n{\n\treturn _id;\n}\n\nvoid TriggerObj::setEnabled(bool enabled)\n{\n\t_enabled = enabled;\n}\n\nstd::vector<int>& TriggerObj::getEvents()\n{\n\treturn _vInt;\n}\n  \n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/TriggerObj.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __TRIGGEROBJ_H__\n#define __TRIGGEROBJ_H__\n\n#include \"cocos2d.h\"\n#include \"CocoStudio.h\"\n#include <vector>\n\nnamespace cocostudio {\n\n\nclass BaseTriggerCondition : public cocos2d::Object\n{\nprotected:\n    BaseTriggerCondition(void);\npublic:\n\tvirtual ~BaseTriggerCondition(void);\n    virtual bool init();\n    virtual bool detect();\n\tvirtual void serialize(const rapidjson::Value &val);\n    virtual void removeAll();\n};\n\nclass BaseTriggerAction : public cocos2d::Object\n{\nprotected:\n    BaseTriggerAction(void);\npublic:\n\tvirtual ~BaseTriggerAction(void);\n    virtual bool init();\n    virtual void done();\n\tvirtual void serialize(const rapidjson::Value &val);\n    virtual void removeAll();\n};\n\n\nclass TriggerObj : public cocos2d::Object\n{\npublic:\n    TriggerObj(void);\n    virtual ~TriggerObj(void);\n    virtual bool init();\n    static TriggerObj* create(void);\n    \n    virtual bool detect();\n    virtual void done();\n    virtual void removeAll();\n    virtual void serialize(const rapidjson::Value &val);\n\tunsigned int getId();\n\tvoid setEnabled(bool enabled);\n\tstd::vector<int>& getEvents();\n  \nprivate:\n    cocos2d::Vector<BaseTriggerCondition*> _cons;\n    cocos2d::Vector<BaseTriggerAction*> _acts;\n\tunsigned int _id;\n\tbool _enabled;\n\tstd::vector<int> _vInt;\n};\n\n}\n\n#endif\n\n\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\CCActionEaseEx.cpp\" />\n    <ClCompile Include=\"..\\CCActionFrame.cpp\" />\n    <ClCompile Include=\"..\\CCActionFrameEasing.cpp\" />\n    <ClCompile Include=\"..\\CCActionManagerEx.cpp\" />\n    <ClCompile Include=\"..\\CCActionNode.cpp\" />\n    <ClCompile Include=\"..\\CCActionObject.cpp\" />\n    <ClCompile Include=\"..\\CCArmature.cpp\" />\n    <ClCompile Include=\"..\\CCArmatureAnimation.cpp\" />\n    <ClCompile Include=\"..\\CCArmatureDataManager.cpp\" />\n    <ClCompile Include=\"..\\CCArmatureDefine.cpp\" />\n    <ClCompile Include=\"..\\CCBatchNode.cpp\" />\n    <ClCompile Include=\"..\\CCBone.cpp\" />\n    <ClCompile Include=\"..\\CCColliderDetector.cpp\" />\n    <ClCompile Include=\"..\\CCComAttribute.cpp\" />\n    <ClCompile Include=\"..\\CCComAudio.cpp\" />\n    <ClCompile Include=\"..\\CCComController.cpp\" />\n    <ClCompile Include=\"..\\CCComRender.cpp\" />\n    <ClCompile Include=\"..\\CCDataReaderHelper.cpp\" />\n    <ClCompile Include=\"..\\CCDatas.cpp\" />\n    <ClCompile Include=\"..\\CCDecorativeDisplay.cpp\" />\n    <ClCompile Include=\"..\\CCDisplayFactory.cpp\" />\n    <ClCompile Include=\"..\\CCDisplayManager.cpp\" />\n    <ClCompile Include=\"..\\CCInputDelegate.cpp\" />\n    <ClCompile Include=\"..\\CCProcessBase.cpp\" />\n    <ClCompile Include=\"..\\CCSGUIReader.cpp\" />\n    <ClCompile Include=\"..\\CCSkin.cpp\" />\n    <ClCompile Include=\"..\\CCSpriteFrameCacheHelper.cpp\" />\n    <ClCompile Include=\"..\\CCSSceneReader.cpp\" />\n    <ClCompile Include=\"..\\CCTransformHelp.cpp\" />\n    <ClCompile Include=\"..\\CCTween.cpp\" />\n    <ClCompile Include=\"..\\CCTweenFunction.cpp\" />\n    <ClCompile Include=\"..\\CCUtilMath.cpp\" />\n    <ClCompile Include=\"..\\DictionaryHelper.cpp\" />\n    <ClCompile Include=\"..\\ObjectFactory.cpp\" />\n    <ClCompile Include=\"..\\TriggerBase.cpp\" />\n    <ClCompile Include=\"..\\TriggerMng.cpp\" />\n    <ClCompile Include=\"..\\TriggerObj.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\document.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\filestream.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\internal\\pow10.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\internal\\stack.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\internal\\strfunc.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\prettywriter.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\rapidjson.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\reader.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\stringbuffer.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\writer.h\" />\n    <ClInclude Include=\"..\\CCActionEaseEx.h\" />\n    <ClInclude Include=\"..\\CCActionFrame.h\" />\n    <ClInclude Include=\"..\\CCActionFrameEasing.h\" />\n    <ClInclude Include=\"..\\CCActionManagerEx.h\" />\n    <ClInclude Include=\"..\\CCActionNode.h\" />\n    <ClInclude Include=\"..\\CCActionObject.h\" />\n    <ClInclude Include=\"..\\CCArmature.h\" />\n    <ClInclude Include=\"..\\CCArmatureAnimation.h\" />\n    <ClInclude Include=\"..\\CCArmatureDataManager.h\" />\n    <ClInclude Include=\"..\\CCArmatureDefine.h\" />\n    <ClInclude Include=\"..\\CCBatchNode.h\" />\n    <ClInclude Include=\"..\\CCBone.h\" />\n    <ClInclude Include=\"..\\CCColliderDetector.h\" />\n    <ClInclude Include=\"..\\CCComAttribute.h\" />\n    <ClInclude Include=\"..\\CCComAudio.h\" />\n    <ClInclude Include=\"..\\CCComBase.h\" />\n    <ClInclude Include=\"..\\CCComController.h\" />\n    <ClInclude Include=\"..\\CCComRender.h\" />\n    <ClInclude Include=\"..\\CCDataReaderHelper.h\" />\n    <ClInclude Include=\"..\\CCDatas.h\" />\n    <ClInclude Include=\"..\\CCDecorativeDisplay.h\" />\n    <ClInclude Include=\"..\\CCDisplayFactory.h\" />\n    <ClInclude Include=\"..\\CCDisplayManager.h\" />\n    <ClInclude Include=\"..\\CCInputDelegate.h\" />\n    <ClInclude Include=\"..\\CCProcessBase.h\" />\n    <ClInclude Include=\"..\\CCSGUIReader.h\" />\n    <ClInclude Include=\"..\\CCSkin.h\" />\n    <ClInclude Include=\"..\\CCSpriteFrameCacheHelper.h\" />\n    <ClInclude Include=\"..\\CCSSceneReader.h\" />\n    <ClInclude Include=\"..\\CCTransformHelp.h\" />\n    <ClInclude Include=\"..\\CCTween.h\" />\n    <ClInclude Include=\"..\\CCTweenFunction.h\" />\n    <ClInclude Include=\"..\\CCUtilMath.h\" />\n    <ClInclude Include=\"..\\DictionaryHelper.h\" />\n    <ClInclude Include=\"..\\ObjectFactory.h\" />\n    <ClInclude Include=\"..\\TriggerBase.h\" />\n    <ClInclude Include=\"..\\TriggerMng.h\" />\n    <ClInclude Include=\"..\\TriggerObj.h\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{B57CF53F-2E49-4031-9822-047CC0E6BDE2}</ProjectGuid>\n    <RootNamespace>libCocosStudio</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>\n      </SDLCheck>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\editor-support;$(EngineRoot)external;$(EngineRoot)external\\tinyxml2;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MinimalRebuild>false</MinimalRebuild>\n      <DebugInformationFormat>OldStyle</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>\n      </SDLCheck>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\editor-support;$(EngineRoot)external;$(EngineRoot)external\\tinyxml2;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"action\">\n      <UniqueIdentifier>{d793b86c-0905-4c9b-b6bc-161e351c9eb2}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"armature\">\n      <UniqueIdentifier>{855f2366-3429-4f77-a080-a41a39c99270}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"components\">\n      <UniqueIdentifier>{1a8c6b14-fb28-4485-8417-9b6838fbc4ef}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"json\">\n      <UniqueIdentifier>{42f1ce3f-46ab-4a16-a96e-9eb076c873f7}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"reader\">\n      <UniqueIdentifier>{f8271f80-1663-4425-91c8-7365ec3af017}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"armature\\animation\">\n      <UniqueIdentifier>{48f28446-ffe4-4aa1-a34c-8968c3367ae6}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"armature\\datas\">\n      <UniqueIdentifier>{ad9b4fd1-dc17-4704-9c60-7709eb916f13}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"armature\\display\">\n      <UniqueIdentifier>{55c682b3-7a48-4fab-ad5a-eb979f3c305e}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"armature\\physics\">\n      <UniqueIdentifier>{c6464479-e0ab-4afc-96fc-1ffc73e40232}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"armature\\utils\">\n      <UniqueIdentifier>{023e3440-1259-4981-ba54-24390d1df447}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"json\\rapidjson\">\n      <UniqueIdentifier>{f1f20817-9232-4967-a4dd-77550e84e39b}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"json\\rapidjson\\internal\">\n      <UniqueIdentifier>{5149f922-cf29-4a4b-b604-f15c6e8856b0}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"trigger\">\n      <UniqueIdentifier>{59eee6d9-bbfd-4193-be1d-6c18fc38f896}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\CCComAttribute.cpp\">\n      <Filter>components</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCComAudio.cpp\">\n      <Filter>components</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCComController.cpp\">\n      <Filter>components</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCComRender.cpp\">\n      <Filter>components</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCInputDelegate.cpp\">\n      <Filter>components</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\DictionaryHelper.cpp\">\n      <Filter>json</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCSSceneReader.cpp\">\n      <Filter>reader</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCSGUIReader.cpp\">\n      <Filter>reader</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCTween.cpp\">\n      <Filter>armature\\animation</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCProcessBase.cpp\">\n      <Filter>armature\\animation</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCArmatureAnimation.cpp\">\n      <Filter>armature\\animation</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCDatas.cpp\">\n      <Filter>armature\\datas</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCBatchNode.cpp\">\n      <Filter>armature\\display</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCDecorativeDisplay.cpp\">\n      <Filter>armature\\display</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCDisplayFactory.cpp\">\n      <Filter>armature\\display</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCDisplayManager.cpp\">\n      <Filter>armature\\display</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCSkin.cpp\">\n      <Filter>armature\\display</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCArmatureDataManager.cpp\">\n      <Filter>armature\\utils</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCArmatureDefine.cpp\">\n      <Filter>armature\\utils</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCDataReaderHelper.cpp\">\n      <Filter>armature\\utils</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCSpriteFrameCacheHelper.cpp\">\n      <Filter>armature\\utils</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCTransformHelp.cpp\">\n      <Filter>armature\\utils</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCTweenFunction.cpp\">\n      <Filter>armature\\utils</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCUtilMath.cpp\">\n      <Filter>armature\\utils</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCColliderDetector.cpp\">\n      <Filter>armature\\physics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCArmature.cpp\">\n      <Filter>armature</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCBone.cpp\">\n      <Filter>armature</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCActionEaseEx.cpp\">\n      <Filter>action</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCActionFrame.cpp\">\n      <Filter>action</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCActionFrameEasing.cpp\">\n      <Filter>action</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCActionManagerEx.cpp\">\n      <Filter>action</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCActionNode.cpp\">\n      <Filter>action</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCActionObject.cpp\">\n      <Filter>action</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\ObjectFactory.cpp\">\n      <Filter>trigger</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\TriggerBase.cpp\">\n      <Filter>trigger</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\TriggerMng.cpp\">\n      <Filter>trigger</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\TriggerObj.cpp\">\n      <Filter>trigger</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\CCComAttribute.h\">\n      <Filter>components</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCComAudio.h\">\n      <Filter>components</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCComController.h\">\n      <Filter>components</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCComRender.h\">\n      <Filter>components</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCInputDelegate.h\">\n      <Filter>components</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\DictionaryHelper.h\">\n      <Filter>json</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCSSceneReader.h\">\n      <Filter>reader</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCSGUIReader.h\">\n      <Filter>reader</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCTween.h\">\n      <Filter>armature\\animation</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCProcessBase.h\">\n      <Filter>armature\\animation</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCArmatureAnimation.h\">\n      <Filter>armature\\animation</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCDatas.h\">\n      <Filter>armature\\datas</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBatchNode.h\">\n      <Filter>armature\\display</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCDecorativeDisplay.h\">\n      <Filter>armature\\display</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCDisplayFactory.h\">\n      <Filter>armature\\display</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCDisplayManager.h\">\n      <Filter>armature\\display</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCSkin.h\">\n      <Filter>armature\\display</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCArmatureDataManager.h\">\n      <Filter>armature\\utils</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCArmatureDefine.h\">\n      <Filter>armature\\utils</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCDataReaderHelper.h\">\n      <Filter>armature\\utils</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCSpriteFrameCacheHelper.h\">\n      <Filter>armature\\utils</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCTransformHelp.h\">\n      <Filter>armature\\utils</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCTweenFunction.h\">\n      <Filter>armature\\utils</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCUtilMath.h\">\n      <Filter>armature\\utils</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCColliderDetector.h\">\n      <Filter>armature\\physics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCArmature.h\">\n      <Filter>armature</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCBone.h\">\n      <Filter>armature</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\document.h\">\n      <Filter>json\\rapidjson</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\filestream.h\">\n      <Filter>json\\rapidjson</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\prettywriter.h\">\n      <Filter>json\\rapidjson</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\rapidjson.h\">\n      <Filter>json\\rapidjson</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\reader.h\">\n      <Filter>json\\rapidjson</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\stringbuffer.h\">\n      <Filter>json\\rapidjson</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\writer.h\">\n      <Filter>json\\rapidjson</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\internal\\pow10.h\">\n      <Filter>json\\rapidjson\\internal</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\internal\\stack.h\">\n      <Filter>json\\rapidjson\\internal</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\json\\internal\\strfunc.h\">\n      <Filter>json\\rapidjson\\internal</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCActionEaseEx.h\">\n      <Filter>action</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCActionFrame.h\">\n      <Filter>action</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCActionFrameEasing.h\">\n      <Filter>action</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCActionManagerEx.h\">\n      <Filter>action</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCActionNode.h\">\n      <Filter>action</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCActionObject.h\">\n      <Filter>action</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\ObjectFactory.h\">\n      <Filter>trigger</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\TriggerBase.h\">\n      <Filter>trigger</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\TriggerMng.h\">\n      <Filter>trigger</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\TriggerObj.h\">\n      <Filter>trigger</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCComBase.h\">\n      <Filter>components</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := spine_static\n\nLOCAL_MODULE_FILENAME := libspine\n\nLOCAL_SRC_FILES := Animation.cpp \\\nAnimationState.cpp \\\nAnimationStateData.cpp \\\nAtlas.cpp \\\nAtlasAttachmentLoader.cpp \\\nAttachment.cpp \\\nAttachmentLoader.cpp \\\nBone.cpp \\\nBoneData.cpp \\\nCCSkeleton.cpp \\\nCCSkeletonAnimation.cpp \\\nJson.cpp \\\nRegionAttachment.cpp \\\nSkeleton.cpp \\\nSkeletonData.cpp \\\nSkeletonJson.cpp \\\nSkin.cpp \\\nSlot.cpp \\\nSlotData.cpp \\\nBoundingBoxAttachment.cpp \\\nEvent.cpp \\\nEventData.cpp \\\nSkeletonBounds.cpp \\\nextension.cpp \\\nspine-cocos2dx.cpp\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \\\n$(LOCAL_PATH)/..\n\nLOCAL_CFLAGS += -Wno-psabi\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,2d)\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Animation.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Animation.h>\n#include <limits.h>\n#include <spine/extension.h>\n\nspAnimation* spAnimation_create (const char* name, int timelineCount) {\n\tspAnimation* self = NEW(spAnimation);\n\tMALLOC_STR(self->name, name);\n\tself->timelineCount = timelineCount;\n\tself->timelines = MALLOC(spTimeline*, timelineCount);\n\treturn self;\n}\n\nvoid spAnimation_dispose (spAnimation* self) {\n\tint i;\n\tfor (i = 0; i < self->timelineCount; ++i)\n\t\tspTimeline_dispose(self->timelines[i]);\n\tFREE(self->timelines);\n\tFREE(self->name);\n\tFREE(self);\n}\n\nvoid spAnimation_apply (const spAnimation* self, spSkeleton* skeleton, float lastTime, float time, int loop, spEvent** events,\n\t\tint* eventCount) {\n\tint i, n = self->timelineCount;\n\n\tif (loop && self->duration) {\n\t\ttime = FMOD(time, self->duration);\n\t\tlastTime = FMOD(lastTime, self->duration);\n\t}\n\n\tfor (i = 0; i < n; ++i)\n\t\tspTimeline_apply(self->timelines[i], skeleton, lastTime, time, events, eventCount, 1);\n}\n\nvoid spAnimation_mix (const spAnimation* self, spSkeleton* skeleton, float lastTime, float time, int loop, spEvent** events,\n\t\tint* eventCount, float alpha) {\n\tint i, n = self->timelineCount;\n\n\tif (loop && self->duration) {\n\t\ttime = FMOD(time, self->duration);\n\t\tlastTime = FMOD(lastTime, self->duration);\n\t}\n\n\tfor (i = 0; i < n; ++i)\n\t\tspTimeline_apply(self->timelines[i], skeleton, lastTime, time, events, eventCount, alpha);\n}\n\n/**/\n\ntypedef struct _spTimelineVtable {\n\tvoid (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\t\tint* eventCount, float alpha);\n\tvoid (*dispose) (spTimeline* self);\n} _spTimelineVtable;\n\nvoid _spTimeline_init (spTimeline* self, spTimelineType type, /**/\nvoid (*dispose) (spTimeline* self), /**/\n\t\tvoid (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\t\t\tint* eventCount, float alpha)) {\n\tCONST_CAST(spTimelineType, self->type) = type;\n\tCONST_CAST(_spTimelineVtable*, self->vtable) = NEW(_spTimelineVtable);\n\tVTABLE(spTimeline, self)->dispose = dispose;\n\tVTABLE(spTimeline, self)->apply = apply;\n}\n\nvoid _spTimeline_deinit (spTimeline* self) {\n\tFREE(self->vtable);\n}\n\nvoid spTimeline_dispose (spTimeline* self) {\n\tVTABLE(spTimeline, self)->dispose(self);\n}\n\nvoid spTimeline_apply (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\tint* eventCount, float alpha) {\n\tVTABLE(spTimeline, self)->apply(self, skeleton, lastTime, time, firedEvents, eventCount, alpha);\n}\n\n/**/\n\nstatic const float CURVE_LINEAR = 0;\nstatic const float CURVE_STEPPED = -1;\nstatic const int CURVE_SEGMENTS = 10;\n\nvoid _spCurveTimeline_init (spCurveTimeline* self, spTimelineType type, int frameCount, /**/\nvoid (*dispose) (spTimeline* self), /**/\n\t\tvoid (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\t\t\tint* eventCount, float alpha)) {\n\t_spTimeline_init(SUPER(self), type, dispose, apply);\n\tself->curves = CALLOC(float, (frameCount - 1) * 6);\n}\n\nvoid _spCurveTimeline_deinit (spCurveTimeline* self) {\n\t_spTimeline_deinit(SUPER(self));\n\tFREE(self->curves);\n}\n\nvoid spCurveTimeline_setLinear (spCurveTimeline* self, int frameIndex) {\n\tself->curves[frameIndex * 6] = CURVE_LINEAR;\n}\n\nvoid spCurveTimeline_setStepped (spCurveTimeline* self, int frameIndex) {\n\tself->curves[frameIndex * 6] = CURVE_STEPPED;\n}\n\nvoid spCurveTimeline_setCurve (spCurveTimeline* self, int frameIndex, float cx1, float cy1, float cx2, float cy2) {\n\tfloat subdiv_step = 1.0f / CURVE_SEGMENTS;\n\tfloat subdiv_step2 = subdiv_step * subdiv_step;\n\tfloat subdiv_step3 = subdiv_step2 * subdiv_step;\n\tfloat pre1 = 3 * subdiv_step;\n\tfloat pre2 = 3 * subdiv_step2;\n\tfloat pre4 = 6 * subdiv_step2;\n\tfloat pre5 = 6 * subdiv_step3;\n\tfloat tmp1x = -cx1 * 2 + cx2;\n\tfloat tmp1y = -cy1 * 2 + cy2;\n\tfloat tmp2x = (cx1 - cx2) * 3 + 1;\n\tfloat tmp2y = (cy1 - cy2) * 3 + 1;\n\tint i = frameIndex * 6;\n\tself->curves[i] = cx1 * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\n\tself->curves[i + 1] = cy1 * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\n\tself->curves[i + 2] = tmp1x * pre4 + tmp2x * pre5;\n\tself->curves[i + 3] = tmp1y * pre4 + tmp2y * pre5;\n\tself->curves[i + 4] = tmp2x * pre5;\n\tself->curves[i + 5] = tmp2y * pre5;\n}\n\nfloat spCurveTimeline_getCurvePercent (const spCurveTimeline* self, int frameIndex, float percent) {\n\tfloat dfy;\n\tfloat ddfx;\n\tfloat ddfy;\n\tfloat dddfx;\n\tfloat dddfy;\n\tfloat x, y;\n\tint i;\n\tint curveIndex = frameIndex * 6;\n\tfloat dfx = self->curves[curveIndex];\n\tif (dfx == CURVE_LINEAR) return percent;\n\tif (dfx == CURVE_STEPPED) return 0;\n\tdfy = self->curves[curveIndex + 1];\n\tddfx = self->curves[curveIndex + 2];\n\tddfy = self->curves[curveIndex + 3];\n\tdddfx = self->curves[curveIndex + 4];\n\tdddfy = self->curves[curveIndex + 5];\n\tx = dfx, y = dfy;\n\ti = CURVE_SEGMENTS - 2;\n\twhile (1) {\n\t\tif (x >= percent) {\n\t\t\tfloat lastX = x - dfx;\n\t\t\tfloat lastY = y - dfy;\n\t\t\treturn lastY + (y - lastY) * (percent - lastX) / (x - lastX);\n\t\t}\n\t\tif (i == 0) break;\n\t\ti--;\n\t\tdfx += ddfx;\n\t\tdfy += ddfy;\n\t\tddfx += dddfx;\n\t\tddfy += dddfy;\n\t\tx += dfx;\n\t\ty += dfy;\n\t}\n\treturn y + (1 - y) * (percent - x) / (1 - x); /* Last point is 1,1. */\n}\n\n/* @param target After the first and before the last entry. */\nstatic int binarySearch (float *values, int valuesLength, float target, int step) {\n\tint low = 0, current;\n\tint high = valuesLength / step - 2;\n\tif (high == 0) return step;\n\tcurrent = high >> 1;\n\twhile (1) {\n\t\tif (values[(current + 1) * step] <= target)\n\t\t\tlow = current + 1;\n\t\telse\n\t\t\thigh = current;\n\t\tif (low == high) return (low + 1) * step;\n\t\tcurrent = (low + high) >> 1;\n\t}\n\treturn 0;\n}\n\n/*static int linearSearch (float *values, int valuesLength, float target, int step) {\n int i, last = valuesLength - step;\n for (i = 0; i <= last; i += step) {\n if (values[i] <= target) continue;\n return i;\n }\n return -1;\n }*/\n\n/**/\n\nvoid _spBaseTimeline_dispose (spTimeline* timeline) {\n\tstruct spBaseTimeline* self = SUB_CAST(struct spBaseTimeline, timeline);\n\t_spCurveTimeline_deinit(SUPER(self));\n\tFREE(self->frames);\n\tFREE(self);\n}\n\n/* Many timelines have structure identical to struct spBaseTimeline and extend spCurveTimeline. **/\nstruct spBaseTimeline* _spBaseTimeline_create (int frameCount, spTimelineType type, int frameSize, /**/\n\t\tvoid (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\t\t\tint* eventCount, float alpha)) {\n\tstruct spBaseTimeline* self = NEW(struct spBaseTimeline);\n\t_spCurveTimeline_init(SUPER(self), type, frameCount, _spBaseTimeline_dispose, apply);\n\n\tCONST_CAST(int, self->framesLength) = frameCount * frameSize;\n\tCONST_CAST(float*, self->frames) = CALLOC(float, self->framesLength);\n\n\treturn self;\n}\n\n/**/\n\nstatic const int ROTATE_LAST_FRAME_TIME = -2;\nstatic const int ROTATE_FRAME_VALUE = 1;\n\nvoid _spRotateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\tint* eventCount, float alpha) {\n\tspBone *bone;\n\tint frameIndex;\n\tfloat lastFrameValue, frameTime, percent, amount;\n\n\tspRotateTimeline* self = SUB_CAST(spRotateTimeline, timeline);\n\n\tif (time < self->frames[0]) return; /* Time is before first frame. */\n\n\tbone = skeleton->bones[self->boneIndex];\n\n\tif (time >= self->frames[self->framesLength - 2]) { /* Time is after last frame. */\n\t\tamount = bone->data->rotation + self->frames[self->framesLength - 1] - bone->rotation;\n\t\twhile (amount > 180)\n\t\t\tamount -= 360;\n\t\twhile (amount < -180)\n\t\t\tamount += 360;\n\t\tbone->rotation += amount * alpha;\n\t\treturn;\n\t}\n\n\t/* Interpolate between the last frame and the current frame. */\n\tframeIndex = binarySearch(self->frames, self->framesLength, time, 2);\n\tlastFrameValue = self->frames[frameIndex - 1];\n\tframeTime = self->frames[frameIndex];\n\tpercent = 1 - (time - frameTime) / (self->frames[frameIndex + ROTATE_LAST_FRAME_TIME] - frameTime);\n\tpercent = spCurveTimeline_getCurvePercent(SUPER(self), frameIndex / 2 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));\n\n\tamount = self->frames[frameIndex + ROTATE_FRAME_VALUE] - lastFrameValue;\n\twhile (amount > 180)\n\t\tamount -= 360;\n\twhile (amount < -180)\n\t\tamount += 360;\n\tamount = bone->data->rotation + (lastFrameValue + amount * percent) - bone->rotation;\n\twhile (amount > 180)\n\t\tamount -= 360;\n\twhile (amount < -180)\n\t\tamount += 360;\n\tbone->rotation += amount * alpha;\n}\n\nspRotateTimeline* spRotateTimeline_create (int frameCount) {\n\treturn _spBaseTimeline_create(frameCount, TIMELINE_ROTATE, 2, _spRotateTimeline_apply);\n}\n\nvoid spRotateTimeline_setFrame (spRotateTimeline* self, int frameIndex, float time, float angle) {\n\tframeIndex *= 2;\n\tself->frames[frameIndex] = time;\n\tself->frames[frameIndex + 1] = angle;\n}\n\n/**/\n\nstatic const int TRANSLATE_LAST_FRAME_TIME = -3;\nstatic const int TRANSLATE_FRAME_X = 1;\nstatic const int TRANSLATE_FRAME_Y = 2;\n\nvoid _spTranslateTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,\n\t\tspEvent** firedEvents, int* eventCount, float alpha) {\n\tspBone *bone;\n\tint frameIndex;\n\tfloat lastFrameX, lastFrameY, frameTime, percent;\n\n\tspTranslateTimeline* self = SUB_CAST(spTranslateTimeline, timeline);\n\n\tif (time < self->frames[0]) return; /* Time is before first frame. */\n\n\tbone = skeleton->bones[self->boneIndex];\n\n\tif (time >= self->frames[self->framesLength - 3]) { /* Time is after last frame. */\n\t\tbone->x += (bone->data->x + self->frames[self->framesLength - 2] - bone->x) * alpha;\n\t\tbone->y += (bone->data->y + self->frames[self->framesLength - 1] - bone->y) * alpha;\n\t\treturn;\n\t}\n\n\t/* Interpolate between the last frame and the current frame. */\n\tframeIndex = binarySearch(self->frames, self->framesLength, time, 3);\n\tlastFrameX = self->frames[frameIndex - 2];\n\tlastFrameY = self->frames[frameIndex - 1];\n\tframeTime = self->frames[frameIndex];\n\tpercent = 1 - (time - frameTime) / (self->frames[frameIndex + TRANSLATE_LAST_FRAME_TIME] - frameTime);\n\tpercent = spCurveTimeline_getCurvePercent(SUPER(self), frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));\n\n\tbone->x += (bone->data->x + lastFrameX + (self->frames[frameIndex + TRANSLATE_FRAME_X] - lastFrameX) * percent - bone->x)\n\t\t\t* alpha;\n\tbone->y += (bone->data->y + lastFrameY + (self->frames[frameIndex + TRANSLATE_FRAME_Y] - lastFrameY) * percent - bone->y)\n\t\t\t* alpha;\n}\n\nspTranslateTimeline* spTranslateTimeline_create (int frameCount) {\n\treturn _spBaseTimeline_create(frameCount, TIMELINE_TRANLATE, 3, _spTranslateTimeline_apply);\n}\n\nvoid spTranslateTimeline_setFrame (spTranslateTimeline* self, int frameIndex, float time, float x, float y) {\n\tframeIndex *= 3;\n\tself->frames[frameIndex] = time;\n\tself->frames[frameIndex + 1] = x;\n\tself->frames[frameIndex + 2] = y;\n}\n\n/**/\n\nvoid _spScaleTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\tint* eventCount, float alpha) {\n\tspBone *bone;\n\tint frameIndex;\n\tfloat lastFrameX, lastFrameY, frameTime, percent;\n\n\tspScaleTimeline* self = SUB_CAST(spScaleTimeline, timeline);\n\n\tif (time < self->frames[0]) return; /* Time is before first frame. */\n\n\tbone = skeleton->bones[self->boneIndex];\n\tif (time >= self->frames[self->framesLength - 3]) { /* Time is after last frame. */\n\t\tbone->scaleX += (bone->data->scaleX - 1 + self->frames[self->framesLength - 2] - bone->scaleX) * alpha;\n\t\tbone->scaleY += (bone->data->scaleY - 1 + self->frames[self->framesLength - 1] - bone->scaleY) * alpha;\n\t\treturn;\n\t}\n\n\t/* Interpolate between the last frame and the current frame. */\n\tframeIndex = binarySearch(self->frames, self->framesLength, time, 3);\n\tlastFrameX = self->frames[frameIndex - 2];\n\tlastFrameY = self->frames[frameIndex - 1];\n\tframeTime = self->frames[frameIndex];\n\tpercent = 1 - (time - frameTime) / (self->frames[frameIndex + TRANSLATE_LAST_FRAME_TIME] - frameTime);\n\tpercent = spCurveTimeline_getCurvePercent(SUPER(self), frameIndex / 3 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));\n\n\tbone->scaleX += (bone->data->scaleX - 1 + lastFrameX + (self->frames[frameIndex + TRANSLATE_FRAME_X] - lastFrameX) * percent\n\t\t\t- bone->scaleX) * alpha;\n\tbone->scaleY += (bone->data->scaleY - 1 + lastFrameY + (self->frames[frameIndex + TRANSLATE_FRAME_Y] - lastFrameY) * percent\n\t\t\t- bone->scaleY) * alpha;\n}\n\nspScaleTimeline* spScaleTimeline_create (int frameCount) {\n\treturn _spBaseTimeline_create(frameCount, TIMELINE_SCALE, 3, _spScaleTimeline_apply);\n}\n\nvoid spScaleTimeline_setFrame (spScaleTimeline* self, int frameIndex, float time, float x, float y) {\n\tspTranslateTimeline_setFrame(self, frameIndex, time, x, y);\n}\n\n/**/\n\nstatic const int COLOR_LAST_FRAME_TIME = -5;\nstatic const int COLOR_FRAME_R = 1;\nstatic const int COLOR_FRAME_G = 2;\nstatic const int COLOR_FRAME_B = 3;\nstatic const int COLOR_FRAME_A = 4;\n\nvoid _spColorTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\tint* eventCount, float alpha) {\n\tspSlot *slot;\n\tint frameIndex;\n\tfloat lastFrameR, lastFrameG, lastFrameB, lastFrameA, percent, frameTime;\n\tfloat r, g, b, a;\n\tspColorTimeline* self = (spColorTimeline*)timeline;\n\n\tif (time < self->frames[0]) return; /* Time is before first frame. */\n\n\tslot = skeleton->slots[self->slotIndex];\n\n\tif (time >= self->frames[self->framesLength - 5]) { /* Time is after last frame. */\n\t\tint i = self->framesLength - 1;\n\t\tslot->r = self->frames[i - 3];\n\t\tslot->g = self->frames[i - 2];\n\t\tslot->b = self->frames[i - 1];\n\t\tslot->a = self->frames[i];\n\t\treturn;\n\t}\n\n\t/* Interpolate between the last frame and the current frame. */\n\tframeIndex = binarySearch(self->frames, self->framesLength, time, 5);\n\tlastFrameR = self->frames[frameIndex - 4];\n\tlastFrameG = self->frames[frameIndex - 3];\n\tlastFrameB = self->frames[frameIndex - 2];\n\tlastFrameA = self->frames[frameIndex - 1];\n\tframeTime = self->frames[frameIndex];\n\tpercent = 1 - (time - frameTime) / (self->frames[frameIndex + COLOR_LAST_FRAME_TIME] - frameTime);\n\tpercent = spCurveTimeline_getCurvePercent(SUPER(self), frameIndex / 5 - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent));\n\n\tr = lastFrameR + (self->frames[frameIndex + COLOR_FRAME_R] - lastFrameR) * percent;\n\tg = lastFrameG + (self->frames[frameIndex + COLOR_FRAME_G] - lastFrameG) * percent;\n\tb = lastFrameB + (self->frames[frameIndex + COLOR_FRAME_B] - lastFrameB) * percent;\n\ta = lastFrameA + (self->frames[frameIndex + COLOR_FRAME_A] - lastFrameA) * percent;\n\tif (alpha < 1) {\n\t\tslot->r += (r - slot->r) * alpha;\n\t\tslot->g += (g - slot->g) * alpha;\n\t\tslot->b += (b - slot->b) * alpha;\n\t\tslot->a += (a - slot->a) * alpha;\n\t} else {\n\t\tslot->r = r;\n\t\tslot->g = g;\n\t\tslot->b = b;\n\t\tslot->a = a;\n\t}\n}\n\nspColorTimeline* spColorTimeline_create (int frameCount) {\n\treturn (spColorTimeline*)_spBaseTimeline_create(frameCount, TIMELINE_COLOR, 5, _spColorTimeline_apply);\n}\n\nvoid spColorTimeline_setFrame (spColorTimeline* self, int frameIndex, float time, float r, float g, float b, float a) {\n\tframeIndex *= 5;\n\tself->frames[frameIndex] = time;\n\tself->frames[frameIndex + 1] = r;\n\tself->frames[frameIndex + 2] = g;\n\tself->frames[frameIndex + 3] = b;\n\tself->frames[frameIndex + 4] = a;\n}\n\n/**/\n\nvoid _spAttachmentTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,\n\t\tspEvent** firedEvents, int* eventCount, float alpha) {\n\tint frameIndex;\n\tconst char* attachmentName;\n\tspAttachmentTimeline* self = (spAttachmentTimeline*)timeline;\n\n\tif (time < self->frames[0]) return; /* Time is before first frame. */\n\n\tif (time >= self->frames[self->framesLength - 1]) /* Time is after last frame. */\n\t\tframeIndex = self->framesLength - 1;\n\telse\n\t\tframeIndex = binarySearch(self->frames, self->framesLength, time, 1) - 1;\n\n\tattachmentName = self->attachmentNames[frameIndex];\n\tspSlot_setAttachment(skeleton->slots[self->slotIndex],\n\t\t\tattachmentName ? spSkeleton_getAttachmentForSlotIndex(skeleton, self->slotIndex, attachmentName) : 0);\n}\n\nvoid _spAttachmentTimeline_dispose (spTimeline* timeline) {\n\tspAttachmentTimeline* self = SUB_CAST(spAttachmentTimeline, timeline);\n\tint i;\n\n\t_spTimeline_deinit(timeline);\n\n\tfor (i = 0; i < self->framesLength; ++i)\n\t\tFREE(self->attachmentNames[i]);\n\tFREE(self->attachmentNames);\n\tFREE(self->frames);\n\tFREE(self);\n}\n\nspAttachmentTimeline* spAttachmentTimeline_create (int frameCount) {\n\tspAttachmentTimeline* self = NEW(spAttachmentTimeline);\n\t_spTimeline_init(SUPER(self), TIMELINE_ATTACHMENT, _spAttachmentTimeline_dispose, _spAttachmentTimeline_apply);\n\n\tCONST_CAST(int, self->framesLength) = frameCount;\n\tCONST_CAST(float*, self->frames) = CALLOC(float, frameCount);\n\tCONST_CAST(char**, self->attachmentNames) = CALLOC(char*, frameCount);\n\n\treturn self;\n}\n\nvoid spAttachmentTimeline_setFrame (spAttachmentTimeline* self, int frameIndex, float time, const char* attachmentName) {\n\tself->frames[frameIndex] = time;\n\n\tFREE(self->attachmentNames[frameIndex]);\n\tif (attachmentName)\n\t\tMALLOC_STR(self->attachmentNames[frameIndex], attachmentName);\n\telse\n\t\tself->attachmentNames[frameIndex] = 0;\n}\n\n/**/\n\n/** Fires events for frames > lastTime and <= time. */\nvoid _spEventTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\tint* eventCount, float alpha) {\n\tspEventTimeline* self = (spEventTimeline*)timeline;\n\tint frameIndex;\n\tif (!firedEvents) return;\n\n\tif (lastTime > time) { /* Fire events after last time for looped animations. */\n\t\t_spEventTimeline_apply(timeline, skeleton, lastTime, (float)INT_MAX, firedEvents, eventCount, alpha);\n\t\tlastTime = -1;\n\t} else if (lastTime >= self->frames[self->framesLength - 1]) /* Last time is after last frame. */\n\t\treturn;\n\tif (time < self->frames[0]) return; /* Time is before first frame. */\n\n\tif (lastTime < self->frames[0])\n\t\tframeIndex = 0;\n\telse {\n\t\tfloat frame;\n\t\tframeIndex = binarySearch(self->frames, self->framesLength, lastTime, 1);\n\t\tframe = self->frames[frameIndex];\n\t\twhile (frameIndex > 0) { /* Fire multiple events with the same frame. */\n\t\t\tif (self->frames[frameIndex - 1] != frame) break;\n\t\t\tframeIndex--;\n\t\t}\n\t}\n\tfor (; frameIndex < self->framesLength && time >= self->frames[frameIndex]; frameIndex++) {\n\t\tfiredEvents[*eventCount] = self->events[frameIndex];\n\t\t(*eventCount)++;\n\t}\n}\n\nvoid _spEventTimeline_dispose (spTimeline* timeline) {\n\tspEventTimeline* self = SUB_CAST(spEventTimeline, timeline);\n\tint i;\n\n\t_spTimeline_deinit(timeline);\n\n\tfor (i = 0; i < self->framesLength; ++i)\n\t\tspEvent_dispose(self->events[i]);\n\tFREE(self->events);\n\tFREE(self->frames);\n\tFREE(self);\n}\n\nspEventTimeline* spEventTimeline_create (int frameCount) {\n\tspEventTimeline* self = NEW(spEventTimeline);\n\t_spTimeline_init(SUPER(self), TIMELINE_EVENT, _spEventTimeline_dispose, _spEventTimeline_apply);\n\n\tCONST_CAST(int, self->framesLength) = frameCount;\n\tCONST_CAST(float*, self->frames) = CALLOC(float, frameCount);\n\tCONST_CAST(spEvent**, self->events) = CALLOC(spEvent*, frameCount);\n\n\treturn self;\n}\n\nvoid spEventTimeline_setFrame (spEventTimeline* self, int frameIndex, float time, spEvent* event) {\n\tself->frames[frameIndex] = time;\n\n\tFREE(self->events[frameIndex]);\n\tself->events[frameIndex] = event;\n}\n\n/**/\n\nvoid _spDrawOrderTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,\n\t\tspEvent** firedEvents, int* eventCount, float alpha) {\n\tint i;\n\tint frameIndex;\n\tconst int* drawOrderToSetupIndex;\n\tspDrawOrderTimeline* self = (spDrawOrderTimeline*)timeline;\n\n\tif (time < self->frames[0]) return; /* Time is before first frame. */\n\n\tif (time >= self->frames[self->framesLength - 1]) /* Time is after last frame. */\n\t\tframeIndex = self->framesLength - 1;\n\telse\n\t\tframeIndex = binarySearch(self->frames, self->framesLength, time, 1) - 1;\n\n\tdrawOrderToSetupIndex = self->drawOrders[frameIndex];\n\tif (!drawOrderToSetupIndex)\n\t\tmemcpy(skeleton->drawOrder, skeleton->slots, self->slotCount * sizeof(int));\n\telse {\n\t\tfor (i = 0; i < self->slotCount; i++)\n\t\t\tskeleton->drawOrder[i] = skeleton->slots[drawOrderToSetupIndex[i]];\n\t}\n}\n\nvoid _spDrawOrderTimeline_dispose (spTimeline* timeline) {\n\tspDrawOrderTimeline* self = SUB_CAST(spDrawOrderTimeline, timeline);\n\tint i;\n\n\t_spTimeline_deinit(timeline);\n\n\tfor (i = 0; i < self->framesLength; ++i)\n\t\tFREE(self->drawOrders[i]);\n\tFREE(self->drawOrders);\n\tFREE(self->frames);\n\tFREE(self);\n}\n\nspDrawOrderTimeline* spDrawOrderTimeline_create (int frameCount, int slotCount) {\n\tspDrawOrderTimeline* self = NEW(spDrawOrderTimeline);\n\t_spTimeline_init(SUPER(self), TIMELINE_DRAWORDER, _spDrawOrderTimeline_dispose, _spDrawOrderTimeline_apply);\n\n\tCONST_CAST(int, self->framesLength) = frameCount;\n\tCONST_CAST(float*, self->frames) = CALLOC(float, frameCount);\n\tCONST_CAST(int**, self->drawOrders) = CALLOC(int*, frameCount);\n\tCONST_CAST(int, self->slotCount) = slotCount;\n\n\treturn self;\n}\n\nvoid spDrawOrderTimeline_setFrame (spDrawOrderTimeline* self, int frameIndex, float time, const int* drawOrder) {\n\tself->frames[frameIndex] = time;\n\n\tFREE(self->drawOrders[frameIndex]);\n\tif (!drawOrder)\n\t\tself->drawOrders[frameIndex] = 0;\n\telse {\n\t\tself->drawOrders[frameIndex] = MALLOC(int, self->slotCount);\n\t\tmemcpy(CONST_CAST(int*, self->drawOrders[frameIndex]), drawOrder, self->slotCount * sizeof(int));\n\t}\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Animation.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_ANIMATION_H_\n#define SPINE_ANIMATION_H_\n\n#include <spine/Event.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spTimeline spTimeline;\nstruct spSkeleton;\n\ntypedef struct {\n\tconst char* const name;\n\tfloat duration;\n\n\tint timelineCount;\n\tspTimeline** timelines;\n} spAnimation;\n\nspAnimation* spAnimation_create (const char* name, int timelineCount);\nvoid spAnimation_dispose (spAnimation* self);\n\n/** Poses the skeleton at the specified time for this animation.\n * @param lastTime The last time the animation was applied.\n * @param events Any triggered events are added. */\nvoid spAnimation_apply (const spAnimation* self, struct spSkeleton* skeleton, float lastTime, float time, int loop,\n\t\tspEvent** events, int* eventCount);\n\n/** Poses the skeleton at the specified time for this animation mixed with the current pose.\n * @param lastTime The last time the animation was applied.\n * @param events Any triggered events are added.\n * @param alpha The amount of this animation that affects the current pose. */\nvoid spAnimation_mix (const spAnimation* self, struct spSkeleton* skeleton, float lastTime, float time, int loop,\n\t\tspEvent** events, int* eventCount, float alpha);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAnimation Animation;\n#define Animation_create(...) spAnimation_create(__VA_ARGS__)\n#define Animation_dispose(...) spAnimation_dispose(__VA_ARGS__)\n#define Animation_apply(...) spAnimation_apply(__VA_ARGS__)\n#define Animation_mix(...) spAnimation_mix(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef enum {\n\tTIMELINE_SCALE, TIMELINE_ROTATE, TIMELINE_TRANLATE, TIMELINE_COLOR, TIMELINE_ATTACHMENT, TIMELINE_EVENT, TIMELINE_DRAWORDER\n} spTimelineType;\n\nstruct spTimeline {\n\tconst spTimelineType type;\n\n\tconst void* const vtable;\n};\n\nvoid spTimeline_dispose (spTimeline* self);\nvoid spTimeline_apply (const spTimeline* self, struct spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\tint* eventCount, float alpha);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spTimeline Timeline;\n#define Timeline_dispose(...) spTimeline_dispose(__VA_ARGS__)\n#define Timeline_apply(...) spTimeline_apply(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct {\n\tspTimeline super;\n\tfloat* curves; /* dfx, dfy, ddfx, ddfy, dddfx, dddfy, ... */\n} spCurveTimeline;\n\nvoid spCurveTimeline_setLinear (spCurveTimeline* self, int frameIndex);\nvoid spCurveTimeline_setStepped (spCurveTimeline* self, int frameIndex);\n\n/* Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.\n * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of\n * the difference between the keyframe's values. */\nvoid spCurveTimeline_setCurve (spCurveTimeline* self, int frameIndex, float cx1, float cy1, float cx2, float cy2);\nfloat spCurveTimeline_getCurvePercent (const spCurveTimeline* self, int frameIndex, float percent);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spCurveTimeline CurveTimeline;\n#define CurveTimeline_setLinear(...) spCurveTimeline_setLinear(__VA_ARGS__)\n#define CurveTimeline_setStepped(...) spCurveTimeline_setStepped(__VA_ARGS__)\n#define CurveTimeline_setCurve(...) spCurveTimeline_setCurve(__VA_ARGS__)\n#define CurveTimeline_getCurvePercent(...) spCurveTimeline_getCurvePercent(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct spBaseTimeline {\n\tspCurveTimeline super;\n\tint const framesLength;\n\tfloat* const frames; /* time, angle, ... for rotate. time, x, y, ... for translate and scale. */\n\tint boneIndex;\n} spRotateTimeline;\n\nspRotateTimeline* spRotateTimeline_create (int frameCount);\n\nvoid spRotateTimeline_setFrame (spRotateTimeline* self, int frameIndex, float time, float angle);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spRotateTimeline RotateTimeline;\n#define RotateTimeline_create(...) spRotateTimeline_create(__VA_ARGS__)\n#define RotateTimeline_setFrame(...) spRotateTimeline_setFrame(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct spBaseTimeline spTranslateTimeline;\n\nspTranslateTimeline* spTranslateTimeline_create (int frameCount);\n\nvoid spTranslateTimeline_setFrame (spTranslateTimeline* self, int frameIndex, float time, float x, float y);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spTranslateTimeline TranslateTimeline;\n#define TranslateTimeline_create(...) spTranslateTimeline_create(__VA_ARGS__)\n#define TranslateTimeline_setFrame(...) spTranslateTimeline_setFrame(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct spBaseTimeline spScaleTimeline;\n\nspScaleTimeline* spScaleTimeline_create (int frameCount);\n\nvoid spScaleTimeline_setFrame (spScaleTimeline* self, int frameIndex, float time, float x, float y);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spScaleTimeline ScaleTimeline;\n#define ScaleTimeline_create(...) spScaleTimeline_create(__VA_ARGS__)\n#define ScaleTimeline_setFrame(...) spScaleTimeline_setFrame(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct {\n\tspCurveTimeline super;\n\tint const framesLength;\n\tfloat* const frames; /* time, r, g, b, a, ... */\n\tint slotIndex;\n} spColorTimeline;\n\nspColorTimeline* spColorTimeline_create (int frameCount);\n\nvoid spColorTimeline_setFrame (spColorTimeline* self, int frameIndex, float time, float r, float g, float b, float a);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spColorTimeline ColorTimeline;\n#define ColorTimeline_create(...) spColorTimeline_create(__VA_ARGS__)\n#define ColorTimeline_setFrame(...) spColorTimeline_setFrame(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct {\n\tspTimeline super;\n\tint const framesLength;\n\tfloat* const frames; /* time, ... */\n\tint slotIndex;\n\tconst char** const attachmentNames;\n} spAttachmentTimeline;\n\nspAttachmentTimeline* spAttachmentTimeline_create (int frameCount);\n\n/* @param attachmentName May be 0. */\nvoid spAttachmentTimeline_setFrame (spAttachmentTimeline* self, int frameIndex, float time, const char* attachmentName);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAttachmentTimeline AttachmentTimeline;\n#define AttachmentTimeline_create(...) spAttachmentTimeline_create(__VA_ARGS__)\n#define AttachmentTimeline_setFrame(...) spAttachmentTimeline_setFrame(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct {\n\tspTimeline super;\n\tint const framesLength;\n\tfloat* const frames; /* time, ... */\n\tspEvent** const events;\n} spEventTimeline;\n\nspEventTimeline* spEventTimeline_create (int frameCount);\n\nvoid spEventTimeline_setFrame (spEventTimeline* self, int frameIndex, float time, spEvent* event);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spEventTimeline EventTimeline;\n#define EventTimeline_create(...) spEventTimeline_create(__VA_ARGS__)\n#define EventTimeline_setFrame(...) spEventTimeline_setFrame(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct {\n\tspTimeline super;\n\tint const framesLength;\n\tfloat* const frames; /* time, ... */\n\tconst int** const drawOrders;\n\tint const slotCount;\n} spDrawOrderTimeline;\n\nspDrawOrderTimeline* spDrawOrderTimeline_create (int frameCount, int slotCount);\n\nvoid spDrawOrderTimeline_setFrame (spDrawOrderTimeline* self, int frameIndex, float time, const int* drawOrder);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spDrawOrderTimeline DrawOrderTimeline;\n#define DrawOrderTimeline_create(...) spDrawOrderTimeline_create(__VA_ARGS__)\n#define DrawOrderTimeline_setFrame(...) spDrawOrderTimeline_setFrame(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_ANIMATION_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AnimationState.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Animation.h>\n#include <spine/AnimationState.h>\n#include <spine/AnimationStateData.h>\n#include <spine/Event.h>\n#include <spine/extension.h>\n#include <spine/Skeleton.h>\n#include <spine/SkeletonData.h>\n#include <string.h>\n\nspTrackEntry* _spTrackEntry_create () {\n\tspTrackEntry* entry = NEW(spTrackEntry);\n\tentry->timeScale = 1;\n\tentry->lastTime = -1;\n\treturn entry;\n}\n\nvoid _spTrackEntry_dispose (spTrackEntry* entry) {\n\tFREE(entry);\n}\n\nvoid _spTrackEntry_disposeAll (spTrackEntry* entry) {\n\twhile (entry) {\n\t\tspTrackEntry* next = entry->next;\n\t\t_spTrackEntry_dispose(entry);\n\t\tentry = next;\n\t}\n}\n\n/**/\n\ntypedef struct {\n\tspAnimationState super;\n\tspEvent** events;\n} _spAnimationState;\n\nvoid _spAnimationState_setCurrent (spAnimationState* self, int index, spTrackEntry* entry);\n\nspAnimationState* spAnimationState_create (spAnimationStateData* data) {\n\t_spAnimationState* internal = NEW(_spAnimationState);\n\tspAnimationState* self = SUPER(internal);\n\tinternal->events = MALLOC(spEvent*, 64);\n\tself->timeScale = 1;\n\tCONST_CAST(spAnimationStateData*, self->data) = data;\n\treturn self;\n}\n\nvoid spAnimationState_dispose (spAnimationState* self) {\n\tint i;\n\t_spAnimationState* internal = SUB_CAST(_spAnimationState, self);\n\tFREE(internal->events);\n\tfor (i = 0; i < self->trackCount; i++)\n\t\t_spTrackEntry_disposeAll(self->tracks[i]);\n\tFREE(self->tracks);\n\tFREE(self);\n}\n\nvoid spAnimationState_update (spAnimationState* self, float delta) {\n\tint i;\n\tfloat trackDelta;\n\tdelta *= self->timeScale;\n\tfor (i = 0; i < self->trackCount; i++) {\n\t\tspTrackEntry* current = self->tracks[i];\n\t\tif (!current) continue;\n\n\t\ttrackDelta = delta * current->timeScale;\n\t\tcurrent->time += trackDelta;\n\t\tif (current->previous) {\n\t\t\tcurrent->previous->time += trackDelta;\n\t\t\tcurrent->mixTime += trackDelta;\n\t\t}\n\n\t\tif (current->next) {\n\t\t\tif (current->lastTime >= current->next->delay) _spAnimationState_setCurrent(self, i, current->next);\n\t\t} else {\n\t\t\t/* End non-looping animation when it reaches its end time and there is no next entry. */\n\t\t\tif (!current->loop && current->lastTime >= current->endTime) spAnimationState_clearTrack(self, i);\n\t\t}\n\t}\n}\n\nvoid spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {\n\t_spAnimationState* internal = SUB_CAST(_spAnimationState, self);\n\n\tint i, ii;\n\tint eventCount;\n\tfloat time;\n\tspTrackEntry* previous;\n\tfor (i = 0; i < self->trackCount; i++) {\n\t\tspTrackEntry* current = self->tracks[i];\n\t\tif (!current) continue;\n\n\t\teventCount = 0;\n\n\t\ttime = current->time;\n\t\tif (!current->loop && time > current->endTime) time = current->endTime;\n\n\t\tprevious = current->previous;\n\t\tif (!previous) {\n\t\t\tspAnimation_apply(current->animation, skeleton, current->lastTime, time, current->loop, internal->events, &eventCount);\n\t\t} else {\n\t\t\tfloat alpha = current->mixTime / current->mixDuration;\n\n\t\t\tfloat previousTime = previous->time;\n\t\t\tif (!previous->loop && previousTime > previous->endTime) previousTime = previous->endTime;\n\t\t\tspAnimation_apply(previous->animation, skeleton, previousTime, previousTime, previous->loop, 0, 0);\n\n\t\t\tif (alpha >= 1) {\n\t\t\t\talpha = 1;\n\t\t\t\t_spTrackEntry_dispose(current->previous);\n\t\t\t\tcurrent->previous = 0;\n\t\t\t}\n\t\t\tspAnimation_mix(current->animation, skeleton, current->lastTime, time, current->loop, internal->events, &eventCount,\n\t\t\t\t\talpha);\n\t\t}\n\n\t\tfor (ii = 0; ii < eventCount; ii++) {\n\t\t\tspEvent* event = internal->events[ii];\n\t\t\tif (current->listener) current->listener(self, i, ANIMATION_EVENT, event, 0);\n\t\t\tif (self->listener) self->listener(self, i, ANIMATION_EVENT, event, 0);\n\t\t}\n\n\t\t/* Check if completed the animation or a loop iteration. */\n\t\tif (current->loop ? (FMOD(current->lastTime, current->endTime) > FMOD(time, current->endTime)) //\n\t\t\t\t: (current->lastTime < current->endTime && time >= current->endTime)) {\n\t\t\tint count = (int)(time / current->endTime);\n\t\t\tif (current->listener) current->listener(self, i, ANIMATION_COMPLETE, 0, count);\n\t\t\tif (self->listener) self->listener(self, i, ANIMATION_COMPLETE, 0, count);\n\t\t\tif (i >= self->trackCount || self->tracks[i] != current) continue;\n\t\t}\n\n\t\tif (i >= self->trackCount || self->tracks[i] != current) continue;\n\t\tcurrent->lastTime = current->time;\n\t}\n}\n\nvoid spAnimationState_clearTracks (spAnimationState* self) {\n\tint i;\n\tfor (i = 0; i < self->trackCount; i++)\n\t\tspAnimationState_clearTrack(self, i);\n\tself->trackCount = 0;\n}\n\nvoid spAnimationState_clearTrack (spAnimationState* self, int trackIndex) {\n\tspTrackEntry* current;\n\tif (trackIndex >= self->trackCount) return;\n\tcurrent = self->tracks[trackIndex];\n\tif (!current) return;\n\n\tif (current->listener) current->listener(self, trackIndex, ANIMATION_END, 0, 0);\n\tif (self->listener) self->listener(self, trackIndex, ANIMATION_END, 0, 0);\n\n\tself->tracks[trackIndex] = 0;\n\tif (current->previous) _spTrackEntry_dispose(current->previous);\n\t_spTrackEntry_disposeAll(current);\n}\n\nspTrackEntry* _spAnimationState_expandToIndex (spAnimationState* self, int index) {\n\tspTrackEntry** newTracks;\n\tif (index < self->trackCount) return self->tracks[index];\n\tnewTracks = CALLOC(spTrackEntry*, index + 1);\n\tmemcpy(newTracks, self->tracks, self->trackCount * sizeof(spTrackEntry*));\n\tFREE(self->tracks);\n\tself->tracks = newTracks;\n\tself->trackCount = index + 1;\n\treturn 0;\n}\n\nvoid _spAnimationState_setCurrent (spAnimationState* self, int index, spTrackEntry* entry) {\n\tspTrackEntry* current = _spAnimationState_expandToIndex(self, index);\n\tif (current) {\n\t\tif (current->previous) {\n\t\t\t_spTrackEntry_dispose(current->previous);\n\t\t\tcurrent->previous = 0;\n\t\t}\n\n\t\tif (current->listener) current->listener(self, index, ANIMATION_END, 0, 0);\n\t\tif (self->listener) self->listener(self, index, ANIMATION_END, 0, 0);\n\n\t\tentry->mixDuration = spAnimationStateData_getMix(self->data, current->animation, entry->animation);\n\t\tif (entry->mixDuration > 0) {\n\t\t\tentry->mixTime = 0;\n\t\t\tentry->previous = current;\n\t\t} else\n\t\t\t_spTrackEntry_dispose(current);\n\t}\n\n\tself->tracks[index] = entry;\n\n\tif (entry->listener) current->listener(self, index, ANIMATION_START, 0, 0);\n\tif (self->listener) self->listener(self, index, ANIMATION_START, 0, 0);\n}\n\nspTrackEntry* spAnimationState_setAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,\n\t\tint/*bool*/loop) {\n\tspAnimation* animation = spSkeletonData_findAnimation(self->data->skeletonData, animationName);\n\treturn spAnimationState_setAnimation(self, trackIndex, animation, loop);\n}\n\nspTrackEntry* spAnimationState_setAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop) {\n\tspTrackEntry* entry;\n\tspTrackEntry* current = _spAnimationState_expandToIndex(self, trackIndex);\n\tif (current) _spTrackEntry_disposeAll(current->next);\n\n\tentry = _spTrackEntry_create();\n\tentry->animation = animation;\n\tentry->loop = loop;\n\tentry->endTime = animation->duration;\n\t_spAnimationState_setCurrent(self, trackIndex, entry);\n\treturn entry;\n}\n\nspTrackEntry* spAnimationState_addAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,\n\t\tint/*bool*/loop, float delay) {\n\tspAnimation* animation = spSkeletonData_findAnimation(self->data->skeletonData, animationName);\n\treturn spAnimationState_addAnimation(self, trackIndex, animation, loop, delay);\n}\n\nspTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop,\n\t\tfloat delay) {\n\tspTrackEntry* last;\n\n\tspTrackEntry* entry = _spTrackEntry_create();\n\tentry->animation = animation;\n\tentry->loop = loop;\n\tentry->endTime = animation->duration;\n\n\tlast = _spAnimationState_expandToIndex(self, trackIndex);\n\tif (last) {\n\t\twhile (last->next)\n\t\t\tlast = last->next;\n\t\tlast->next = entry;\n\t} else\n\t\tself->tracks[trackIndex] = entry;\n\n\tif (delay <= 0) {\n\t\tif (last)\n\t\t\tdelay += last->endTime - spAnimationStateData_getMix(self->data, last->animation, animation);\n\t\telse\n\t\t\tdelay = 0;\n\t}\n\tentry->delay = delay;\n\n\treturn entry;\n}\n\nspTrackEntry* spAnimationState_getCurrent (spAnimationState* self, int trackIndex) {\n\tif (trackIndex >= self->trackCount) return 0;\n\treturn self->tracks[trackIndex];\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AnimationState.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_ANIMATIONSTATE_H_\n#define SPINE_ANIMATIONSTATE_H_\n\n#include <spine/Animation.h>\n#include <spine/AnimationStateData.h>\n#include <spine/Event.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef enum {\n\tANIMATION_START, ANIMATION_END, ANIMATION_COMPLETE, ANIMATION_EVENT\n} spEventType;\n\ntypedef struct spAnimationState spAnimationState;\n\ntypedef void (*spAnimationStateListener) (spAnimationState* state, int trackIndex, spEventType type, spEvent* event,\n\t\tint loopCount);\n\ntypedef struct spTrackEntry spTrackEntry;\nstruct spTrackEntry {\n\tspTrackEntry* next;\n\tspTrackEntry* previous;\n\tspAnimation* animation;\n\tint/*bool*/loop;\n\tfloat delay, time, lastTime, endTime, timeScale;\n\tspAnimationStateListener listener;\n\tfloat mixTime, mixDuration;\n};\n\nstruct spAnimationState {\n\tspAnimationStateData* const data;\n\tfloat timeScale;\n\tspAnimationStateListener listener;\n\tvoid* context;\n\n\tint trackCount;\n\tspTrackEntry** tracks;\n};\n\n/* @param data May be 0 for no mixing. */\nspAnimationState* spAnimationState_create (spAnimationStateData* data);\nvoid spAnimationState_dispose (spAnimationState* self);\n\nvoid spAnimationState_update (spAnimationState* self, float delta);\nvoid spAnimationState_apply (spAnimationState* self, struct spSkeleton* skeleton);\n\nvoid spAnimationState_clearTracks (spAnimationState* self);\nvoid spAnimationState_clearTrack (spAnimationState* self, int trackIndex);\n\n/** Set the current animation. Any queued animations are cleared. */\nspTrackEntry* spAnimationState_setAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,\n\t\tint/*bool*/loop);\nspTrackEntry* spAnimationState_setAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop);\n\n/** Adds an animation to be played delay seconds after the current or last queued animation, taking into account any mix\n * duration. */\nspTrackEntry* spAnimationState_addAnimationByName (spAnimationState* self, int trackIndex, const char* animationName,\n\t\tint/*bool*/loop, float delay);\nspTrackEntry* spAnimationState_addAnimation (spAnimationState* self, int trackIndex, spAnimation* animation, int/*bool*/loop,\n\t\tfloat delay);\n\nspTrackEntry* spAnimationState_getCurrent (spAnimationState* self, int trackIndex);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spEventType EventType;\ntypedef spAnimationStateListener AnimationStateListener;\ntypedef spTrackEntry TrackEntry;\ntypedef spAnimationState AnimationState;\n#define AnimationState_create(...) spAnimationState_create(__VA_ARGS__)\n#define AnimationState_dispose(...) spAnimationState_dispose(__VA_ARGS__)\n#define AnimationState_update(...) spAnimationState_update(__VA_ARGS__)\n#define AnimationState_apply(...) spAnimationState_apply(__VA_ARGS__)\n#define AnimationState_clearTracks(...) spAnimationState_clearTracks(__VA_ARGS__)\n#define AnimationState_clearTrack(...) spAnimationState_clearTrack(__VA_ARGS__)\n#define AnimationState_setAnimationByName(...) spAnimationState_setAnimationByName(__VA_ARGS__)\n#define AnimationState_setAnimation(...) spAnimationState_setAnimation(__VA_ARGS__)\n#define AnimationState_addAnimationByName(...) spAnimationState_addAnimationByName(__VA_ARGS__)\n#define AnimationState_addAnimation(...) spAnimationState_addAnimation(__VA_ARGS__)\n#define AnimationState_getCurrent(...) spAnimationState_getCurrent(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_ANIMATIONSTATE_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AnimationStateData.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/AnimationStateData.h>\n#include <spine/extension.h>\n\ntypedef struct _ToEntry _ToEntry;\nstruct _ToEntry {\n\tspAnimation* animation;\n\tfloat duration;\n\t_ToEntry* next;\n};\n\n_ToEntry* _ToEntry_create (spAnimation* to, float duration) {\n\t_ToEntry* self = NEW(_ToEntry);\n\tself->animation = to;\n\tself->duration = duration;\n\treturn self;\n}\n\nvoid _ToEntry_dispose (_ToEntry* self) {\n\tFREE(self);\n}\n\n/**/\n\ntypedef struct _FromEntry _FromEntry;\nstruct _FromEntry {\n\tspAnimation* animation;\n\t_ToEntry* toEntries;\n\t_FromEntry* next;\n};\n\n_FromEntry* _FromEntry_create (spAnimation* from) {\n\t_FromEntry* self = NEW(_FromEntry);\n\tself->animation = from;\n\treturn self;\n}\n\nvoid _FromEntry_dispose (_FromEntry* self) {\n\tFREE(self);\n}\n\n/**/\n\nspAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData) {\n\tspAnimationStateData* self = NEW(spAnimationStateData);\n\tCONST_CAST(spSkeletonData*, self->skeletonData) = skeletonData;\n\treturn self;\n}\n\nvoid spAnimationStateData_dispose (spAnimationStateData* self) {\n\t_ToEntry* toEntry;\n\t_ToEntry* nextToEntry;\n\t_FromEntry* nextFromEntry;\n\n\t_FromEntry* fromEntry = (_FromEntry*)self->entries;\n\twhile (fromEntry) {\n\t\ttoEntry = fromEntry->toEntries;\n\t\twhile (toEntry) {\n\t\t\tnextToEntry = toEntry->next;\n\t\t\t_ToEntry_dispose(toEntry);\n\t\t\ttoEntry = nextToEntry;\n\t\t}\n\t\tnextFromEntry = fromEntry->next;\n\t\t_FromEntry_dispose(fromEntry);\n\t\tfromEntry = nextFromEntry;\n\t}\n\n\tFREE(self);\n}\n\nvoid spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration) {\n\tspAnimation* to;\n\tspAnimation* from = spSkeletonData_findAnimation(self->skeletonData, fromName);\n\tif (!from) return;\n\tto = spSkeletonData_findAnimation(self->skeletonData, toName);\n\tif (!to) return;\n\tspAnimationStateData_setMix(self, from, to, duration);\n}\n\nvoid spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration) {\n\t/* Find existing FromEntry. */\n\t_ToEntry* toEntry;\n\t_FromEntry* fromEntry = (_FromEntry*)self->entries;\n\twhile (fromEntry) {\n\t\tif (fromEntry->animation == from) {\n\t\t\t/* Find existing ToEntry. */\n\t\t\ttoEntry = fromEntry->toEntries;\n\t\t\twhile (toEntry) {\n\t\t\t\tif (toEntry->animation == to) {\n\t\t\t\t\ttoEntry->duration = duration;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttoEntry = toEntry->next;\n\t\t\t}\n\t\t\tbreak; /* Add new ToEntry to the existing FromEntry. */\n\t\t}\n\t\tfromEntry = fromEntry->next;\n\t}\n\tif (!fromEntry) {\n\t\tfromEntry = _FromEntry_create(from);\n\t\tfromEntry->next = (_FromEntry*)self->entries;\n\t\tCONST_CAST(_FromEntry*, self->entries) = fromEntry;\n\t}\n\ttoEntry = _ToEntry_create(to, duration);\n\ttoEntry->next = fromEntry->toEntries;\n\tfromEntry->toEntries = toEntry;\n}\n\nfloat spAnimationStateData_getMix (spAnimationStateData* self, spAnimation* from, spAnimation* to) {\n\t_FromEntry* fromEntry = (_FromEntry*)self->entries;\n\twhile (fromEntry) {\n\t\tif (fromEntry->animation == from) {\n\t\t\t_ToEntry* toEntry = fromEntry->toEntries;\n\t\t\twhile (toEntry) {\n\t\t\t\tif (toEntry->animation == to) return toEntry->duration;\n\t\t\t\ttoEntry = toEntry->next;\n\t\t\t}\n\t\t}\n\t\tfromEntry = fromEntry->next;\n\t}\n\treturn self->defaultMix;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AnimationStateData.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_ANIMATIONSTATEDATA_H_\n#define SPINE_ANIMATIONSTATEDATA_H_\n\n#include <spine/Animation.h>\n#include <spine/SkeletonData.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n\tspSkeletonData* const skeletonData;\n\tfloat defaultMix;\n\tconst void* const entries;\n} spAnimationStateData;\n\nspAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData);\nvoid spAnimationStateData_dispose (spAnimationStateData* self);\n\nvoid spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration);\nvoid spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration);\n/* Returns 0 if there is no mixing between the animations. */\nfloat spAnimationStateData_getMix (spAnimationStateData* self, spAnimation* from, spAnimation* to);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAnimationStateData AnimationStateData;\n#define AnimationStateData_create(...) spAnimationStateData_create(__VA_ARGS__)\n#define AnimationStateData_dispose(...) spAnimationStateData_dispose(__VA_ARGS__)\n#define AnimationStateData_setMixByName(...) spAnimationStateData_setMixByName(__VA_ARGS__)\n#define AnimationStateData_setMix(...) spAnimationStateData_setMix(__VA_ARGS__)\n#define AnimationStateData_getMix(...) spAnimationStateData_getMix(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_ANIMATIONSTATEDATA_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Atlas.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Atlas.h>\n#include <ctype.h>\n#include <spine/extension.h>\n\nspAtlasPage* spAtlasPage_create (const char* name) {\n\tspAtlasPage* self = NEW(spAtlasPage);\n\tMALLOC_STR(self->name, name);\n\treturn self;\n}\n\nvoid spAtlasPage_dispose (spAtlasPage* self) {\n\t_spAtlasPage_disposeTexture(self);\n\tFREE(self->name);\n\tFREE(self);\n}\n\n/**/\n\nspAtlasRegion* spAtlasRegion_create () {\n\treturn NEW(spAtlasRegion) ;\n}\n\nvoid spAtlasRegion_dispose (spAtlasRegion* self) {\n\tFREE(self->name);\n\tFREE(self->splits);\n\tFREE(self->pads);\n\tFREE(self);\n}\n\n/**/\n\ntypedef struct {\n\tconst char* begin;\n\tconst char* end;\n} Str;\n\nstatic void trim (Str* str) {\n\twhile (isspace(*str->begin) && str->begin < str->end)\n\t\t(str->begin)++;\n\tif (str->begin == str->end) return;\n\tstr->end--;\n\twhile (isspace(*str->end) && str->end >= str->begin)\n\t\tstr->end--;\n\tstr->end++;\n}\n\n/* Tokenize string without modification. Returns 0 on failure. */\nstatic int readLine (const char* begin, const char* end, Str* str) {\n\tstatic const char* nextStart;\n\tif (begin) {\n\t\tnextStart = begin;\n\t\treturn 1;\n\t}\n\tif (nextStart == end) return 0;\n\tstr->begin = nextStart;\n\n\t/* Find next delimiter. */\n\twhile (nextStart != end && *nextStart != '\\n')\n\t\tnextStart++;\n\n\tstr->end = nextStart;\n\ttrim(str);\n\n\tif (nextStart != end) nextStart++;\n\treturn 1;\n}\n\n/* Moves str->begin past the first occurence of c. Returns 0 on failure. */\nstatic int beginPast (Str* str, char c) {\n\tconst char* begin = str->begin;\n\twhile (1) {\n\t\tchar lastSkippedChar = *begin;\n\t\tif (begin == str->end) return 0;\n\t\tbegin++;\n\t\tif (lastSkippedChar == c) break;\n\t}\n\tstr->begin = begin;\n\treturn 1;\n}\n\n/* Returns 0 on failure. */\nstatic int readValue (const char* end, Str* str) {\n\treadLine(0, end, str);\n\tif (!beginPast(str, ':')) return 0;\n\ttrim(str);\n\treturn 1;\n}\n\n/* Returns the number of tuple values read (2, 4, or 0 for failure). */\nstatic int readTuple (const char* end, Str tuple[]) {\n\tint i;\n\tStr str;\n\treadLine(0, end, &str);\n\tif (!beginPast(&str, ':')) return 0;\n\n\tfor (i = 0; i < 3; ++i) {\n\t\ttuple[i].begin = str.begin;\n\t\tif (!beginPast(&str, ',')) {\n\t\t\tif (i == 0) return 0;\n\t\t\tbreak;\n\t\t}\n\t\ttuple[i].end = str.begin - 2;\n\t\ttrim(&tuple[i]);\n\t}\n\ttuple[i].begin = str.begin;\n\ttuple[i].end = str.end;\n\ttrim(&tuple[i]);\n\treturn i + 1;\n}\n\nstatic char* mallocString (Str* str) {\n\tlong length = str->end - str->begin;\n\tchar* string = MALLOC(char, length + 1);\n\tmemcpy(string, str->begin, length);\n\tstring[length] = '\\0';\n\treturn string;\n}\n\nstatic int indexOf (const char** array, int count, Str* str) {\n\tlong length = str->end - str->begin;\n\tint i;\n\tfor (i = count - 1; i >= 0; i--)\n\t\tif (strncmp(array[i], str->begin, length) == 0) return i;\n\treturn -1;\n}\n\nstatic int equals (Str* str, const char* other) {\n\treturn strncmp(other, str->begin, str->end - str->begin) == 0;\n}\n\nstatic int toInt (Str* str) {\n\treturn static_cast<int>(strtol(str->begin, (char**)&str->end, 10));\n}\n\nstatic spAtlas* abortAtlas (spAtlas* self) {\n\tspAtlas_dispose(self);\n\treturn 0;\n}\n\nstatic const char* formatNames[] = {\"Alpha\", \"Intensity\", \"LuminanceAlpha\", \"RGB565\", \"RGBA4444\", \"RGB888\", \"RGBA8888\"};\nstatic const char* textureFilterNames[] = {\"Nearest\", \"Linear\", \"MipMap\", \"MipMapNearestNearest\", \"MipMapLinearNearest\",\n\t\t\"MipMapNearestLinear\", \"MipMapLinearLinear\"};\n\nspAtlas* spAtlas_readAtlas (const char* begin, int length, const char* dir) {\n\tint count;\n\tconst char* end = begin + length;\n\tsize_t dirLength = strlen(dir);\n\tint needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\\\';\n\n\tspAtlas* self = NEW(spAtlas);\n\n\tspAtlasPage *page = 0;\n\tspAtlasPage *lastPage = 0;\n\tspAtlasRegion *lastRegion = 0;\n\tStr str;\n\tStr tuple[4];\n\treadLine(begin, 0, 0);\n\twhile (readLine(0, end, &str)) {\n\t\tif (str.end - str.begin == 0) {\n\t\t\tpage = 0;\n\t\t} else if (!page) {\n\t\t\tchar* name = mallocString(&str);\n\t\t\tchar* path = MALLOC(char, dirLength + needsSlash + strlen(name) + 1);\n\t\t\tmemcpy(path, dir, dirLength);\n\t\t\tif (needsSlash) path[dirLength] = '/';\n\t\t\tstrcpy(path + dirLength + needsSlash, name);\n\n\t\t\tpage = spAtlasPage_create(name);\n\t\t\tFREE(name);\n\t\t\tif (lastPage)\n\t\t\t\tlastPage->next = page;\n\t\t\telse\n\t\t\t\tself->pages = page;\n\t\t\tlastPage = page;\n\n\t\t\tif (!readValue(end, &str)) return abortAtlas(self);\n\t\t\tpage->format = (spAtlasFormat)indexOf(formatNames, 7, &str);\n\n\t\t\tif (!readTuple(end, tuple)) return abortAtlas(self);\n\t\t\tpage->minFilter = (spAtlasFilter)indexOf(textureFilterNames, 7, tuple);\n\t\t\tpage->magFilter = (spAtlasFilter)indexOf(textureFilterNames, 7, tuple + 1);\n\n\t\t\tif (!readValue(end, &str)) return abortAtlas(self);\n\t\t\tif (!equals(&str, \"none\")) {\n\t\t\t\tpage->uWrap = *str.begin == 'x' ? ATLAS_REPEAT : (*str.begin == 'y' ? ATLAS_CLAMPTOEDGE : ATLAS_REPEAT);\n\t\t\t\tpage->vWrap = *str.begin == 'x' ? ATLAS_CLAMPTOEDGE : (*str.begin == 'y' ? ATLAS_REPEAT : ATLAS_REPEAT);\n\t\t\t}\n\n\t\t\t_spAtlasPage_createTexture(page, path);\n\t\t\tFREE(path);\n\t\t} else {\n\t\t\tspAtlasRegion *region = spAtlasRegion_create();\n\t\t\tif (lastRegion)\n\t\t\t\tlastRegion->next = region;\n\t\t\telse\n\t\t\t\tself->regions = region;\n\t\t\tlastRegion = region;\n\n\t\t\tregion->page = page;\n\t\t\tregion->name = mallocString(&str);\n\n\t\t\tif (!readValue(end, &str)) return abortAtlas(self);\n\t\t\tregion->rotate = equals(&str, \"true\");\n\n\t\t\tif (readTuple(end, tuple) != 2) return abortAtlas(self);\n\t\t\tregion->x = toInt(tuple);\n\t\t\tregion->y = toInt(tuple + 1);\n\n\t\t\tif (readTuple(end, tuple) != 2) return abortAtlas(self);\n\t\t\tregion->width = toInt(tuple);\n\t\t\tregion->height = toInt(tuple + 1);\n\n\t\t\tregion->u = region->x / (float)page->width;\n\t\t\tregion->v = region->y / (float)page->height;\n\t\t\tif (region->rotate) {\n\t\t\t\tregion->u2 = (region->x + region->height) / (float)page->width;\n\t\t\t\tregion->v2 = (region->y + region->width) / (float)page->height;\n\t\t\t} else {\n\t\t\t\tregion->u2 = (region->x + region->width) / (float)page->width;\n\t\t\t\tregion->v2 = (region->y + region->height) / (float)page->height;\n\t\t\t}\n\n\t\t\tif (!(count = readTuple(end, tuple))) return abortAtlas(self);\n\t\t\tif (count == 4) { /* split is optional */\n\t\t\t\tregion->splits = MALLOC(int, 4);\n\t\t\t\tregion->splits[0] = toInt(tuple);\n\t\t\t\tregion->splits[1] = toInt(tuple + 1);\n\t\t\t\tregion->splits[2] = toInt(tuple + 2);\n\t\t\t\tregion->splits[3] = toInt(tuple + 3);\n\n\t\t\t\tif (!(count = readTuple(end, tuple))) return abortAtlas(self);\n\t\t\t\tif (count == 4) { /* pad is optional, but only present with splits */\n\t\t\t\t\tregion->pads = MALLOC(int, 4);\n\t\t\t\t\tregion->pads[0] = toInt(tuple);\n\t\t\t\t\tregion->pads[1] = toInt(tuple + 1);\n\t\t\t\t\tregion->pads[2] = toInt(tuple + 2);\n\t\t\t\t\tregion->pads[3] = toInt(tuple + 3);\n\n\t\t\t\t\tif (!readTuple(end, tuple)) return abortAtlas(self);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tregion->originalWidth = toInt(tuple);\n\t\t\tregion->originalHeight = toInt(tuple + 1);\n\n\t\t\treadTuple(end, tuple);\n\t\t\tregion->offsetX = toInt(tuple);\n\t\t\tregion->offsetY = toInt(tuple + 1);\n\n\t\t\tif (!readValue(end, &str)) return abortAtlas(self);\n\t\t\tregion->index = toInt(&str);\n\t\t}\n\t}\n\n\treturn self;\n}\n\nspAtlas* spAtlas_readAtlasFile (const char* path) {\n\tlong dirLength;\n\tchar *dir;\n\tint length;\n\tconst char* data;\n\n\tspAtlas* atlas = 0;\n\n\t/* Get directory from atlas path. */\n\tconst char* lastForwardSlash = strrchr(path, '/');\n\tconst char* lastBackwardSlash = strrchr(path, '\\\\');\n\tconst char* lastSlash = lastForwardSlash > lastBackwardSlash ? lastForwardSlash : lastBackwardSlash;\n\tif (lastSlash == path) lastSlash++; /* Never drop starting slash. */\n\tdirLength = lastSlash ? lastSlash - path : 0;\n\tdir = MALLOC(char, dirLength + 1);\n\tmemcpy(dir, path, dirLength);\n\tdir[dirLength] = '\\0';\n\n\tdata = _spUtil_readFile(path, &length);\n\tif (data) atlas = spAtlas_readAtlas(data, length, dir);\n\n\tFREE(data);\n\tFREE(dir);\n\treturn atlas;\n}\n\nvoid spAtlas_dispose (spAtlas* self) {\n\tspAtlasRegion* region, *nextRegion;\n\tspAtlasPage* page = self->pages;\n\twhile (page) {\n\t\tspAtlasPage* nextPage = page->next;\n\t\tspAtlasPage_dispose(page);\n\t\tpage = nextPage;\n\t}\n\n\tregion = self->regions;\n\twhile (region) {\n\t\tnextRegion = region->next;\n\t\tspAtlasRegion_dispose(region);\n\t\tregion = nextRegion;\n\t}\n\n\tFREE(self);\n}\n\nspAtlasRegion* spAtlas_findRegion (const spAtlas* self, const char* name) {\n\tspAtlasRegion* region = self->regions;\n\twhile (region) {\n\t\tif (strcmp(region->name, name) == 0) return region;\n\t\tregion = region->next;\n\t}\n\treturn 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Atlas.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_ATLAS_H_\n#define SPINE_ATLAS_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef enum {\n\tATLAS_ALPHA, ATLAS_INTENSITY, ATLAS_LUMINANCE_ALPHA, ATLAS_RGB565, ATLAS_RGBA4444, ATLAS_RGB888, ATLAS_RGBA8888\n} spAtlasFormat;\n\ntypedef enum {\n\tATLAS_NEAREST,\n\tATLAS_LINEAR,\n\tATLAS_MIPMAP,\n\tATLAS_MIPMAP_NEAREST_NEAREST,\n\tATLAS_MIPMAP_LINEAR_NEAREST,\n\tATLAS_MIPMAP_NEAREST_LINEAR,\n\tATLAS_MIPMAP_LINEAR_LINEAR\n} spAtlasFilter;\n\ntypedef enum {\n\tATLAS_MIRROREDREPEAT, ATLAS_CLAMPTOEDGE, ATLAS_REPEAT\n} spAtlasWrap;\n\ntypedef struct spAtlasPage spAtlasPage;\nstruct spAtlasPage {\n\tconst char* name;\n\tspAtlasFormat format;\n\tspAtlasFilter minFilter, magFilter;\n\tspAtlasWrap uWrap, vWrap;\n\n\tvoid* rendererObject;\n\tint width, height;\n\n\tspAtlasPage* next;\n};\n\nspAtlasPage* spAtlasPage_create (const char* name);\nvoid spAtlasPage_dispose (spAtlasPage* self);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAtlasFormat AtlasFormat;\ntypedef spAtlasFilter AtlasFilter;\ntypedef spAtlasWrap AtlasWrap;\ntypedef spAtlasPage AtlasPage;\n#define AtlasPage_create(...) spAtlasPage_create(__VA_ARGS__)\n#define AtlasPage_dispose(...) spAtlasPage_dispose(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct spAtlasRegion spAtlasRegion;\nstruct spAtlasRegion {\n\tconst char* name;\n\tint x, y, width, height;\n\tfloat u, v, u2, v2;\n\tint offsetX, offsetY;\n\tint originalWidth, originalHeight;\n\tint index;\n\tint/*bool*/rotate;\n\tint/*bool*/flip;\n\tint* splits;\n\tint* pads;\n\n\tspAtlasPage* page;\n\n\tspAtlasRegion* next;\n};\n\nspAtlasRegion* spAtlasRegion_create ();\nvoid spAtlasRegion_dispose (spAtlasRegion* self);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAtlasRegion AtlasRegion;\n#define AtlasRegion_create(...) spAtlasRegion_create(__VA_ARGS__)\n#define AtlasRegion_dispose(...) spAtlasRegion_dispose(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct {\n\tspAtlasPage* pages;\n\tspAtlasRegion* regions;\n} spAtlas;\n\n/* Image files referenced in the atlas file will be prefixed with dir. */\nspAtlas* spAtlas_readAtlas (const char* data, int length, const char* dir);\n/* Image files referenced in the atlas file will be prefixed with the directory containing the atlas file. */\nspAtlas* spAtlas_readAtlasFile (const char* path);\nvoid spAtlas_dispose (spAtlas* atlas);\n\n/* Returns 0 if the region was not found. */\nspAtlasRegion* spAtlas_findRegion (const spAtlas* self, const char* name);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAtlas Atlas;\n#define Atlas_readAtlas(...) spAtlas_readAtlas(__VA_ARGS__)\n#define Atlas_readAtlasFile(...) spAtlas_readAtlasFile(__VA_ARGS__)\n#define Atlas_dispose(...) spAtlas_dispose(__VA_ARGS__)\n#define Atlas_findRegion(...) spAtlas_findRegion(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_ATLAS_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AtlasAttachmentLoader.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/AtlasAttachmentLoader.h>\n#include <spine/extension.h>\n\nspAttachment* _spAtlasAttachmentLoader_newAttachment (spAttachmentLoader* loader, spSkin* skin, spAttachmentType type,\n\t\tconst char* name) {\n\tspAtlasAttachmentLoader* self = SUB_CAST(spAtlasAttachmentLoader, loader);\n\tswitch (type) {\n\tcase ATTACHMENT_REGION: {\n\t\tspRegionAttachment* attachment;\n\t\tspAtlasRegion* region = spAtlas_findRegion(self->atlas, name);\n\t\tif (!region) {\n\t\t\t_spAttachmentLoader_setError(loader, \"Region not found: \", name);\n\t\t\treturn 0;\n\t\t}\n\t\tattachment = spRegionAttachment_create(name);\n\t\tattachment->rendererObject = region;\n\t\tspRegionAttachment_setUVs(attachment, region->u, region->v, region->u2, region->v2, region->rotate);\n\t\tattachment->regionOffsetX = region->offsetX;\n\t\tattachment->regionOffsetY = region->offsetY;\n\t\tattachment->regionWidth = region->width;\n\t\tattachment->regionHeight = region->height;\n\t\tattachment->regionOriginalWidth = region->originalWidth;\n\t\tattachment->regionOriginalHeight = region->originalHeight;\n\t\treturn SUPER(attachment);\n\t}\n\tcase ATTACHMENT_BOUNDING_BOX:\n\t\treturn SUPER(spBoundingBoxAttachment_create(name));\n\tdefault:\n\t\t_spAttachmentLoader_setUnknownTypeError(loader, type);\n\t\treturn 0;\n\t}\n}\n\nspAtlasAttachmentLoader* spAtlasAttachmentLoader_create (spAtlas* atlas) {\n\tspAtlasAttachmentLoader* self = NEW(spAtlasAttachmentLoader);\n\t_spAttachmentLoader_init(SUPER(self), _spAttachmentLoader_deinit, _spAtlasAttachmentLoader_newAttachment);\n\tself->atlas = atlas;\n\treturn self;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AtlasAttachmentLoader.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_ATLASATTACHMENTLOADER_H_\n#define SPINE_ATLASATTACHMENTLOADER_H_\n\n#include <spine/AttachmentLoader.h>\n#include <spine/Atlas.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n\tspAttachmentLoader super;\n\tspAtlas* atlas;\n} spAtlasAttachmentLoader;\n\nspAtlasAttachmentLoader* spAtlasAttachmentLoader_create (spAtlas* atlas);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAtlasAttachmentLoader AtlasAttachmentLoader;\n#define AtlasAttachmentLoader_create(...) spAtlasAttachmentLoader_create(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_ATLASATTACHMENTLOADER_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Attachment.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Attachment.h>\n#include <spine/extension.h>\n#include <spine/Slot.h>\n\ntypedef struct _spAttachmentVtable {\n\tvoid (*dispose) (spAttachment* self);\n} _spAttachmentVtable;\n\nvoid _spAttachment_init (spAttachment* self, const char* name, spAttachmentType type, /**/\n\t\tvoid (*dispose) (spAttachment* self)) {\n\n\tCONST_CAST(_spAttachmentVtable*, self->vtable) = NEW(_spAttachmentVtable);\n\tVTABLE(spAttachment, self) ->dispose = dispose;\n\n\tMALLOC_STR(self->name, name);\n\tself->type = type;\n}\n\nvoid _spAttachment_deinit (spAttachment* self) {\n\tFREE(self->vtable);\n\tFREE(self->name);\n}\n\nvoid spAttachment_dispose (spAttachment* self) {\n\tVTABLE(spAttachment, self) ->dispose(self);\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Attachment.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_ATTACHMENT_H_\n#define SPINE_ATTACHMENT_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct spSlot;\n\ntypedef enum {\n\tATTACHMENT_REGION, ATTACHMENT_REGION_SEQUENCE, ATTACHMENT_BOUNDING_BOX\n} spAttachmentType;\n\ntypedef struct spAttachment spAttachment;\nstruct spAttachment {\n\tconst char* const name;\n\tspAttachmentType type;\n\n\tconst void* const vtable;\n};\n\nvoid spAttachment_dispose (spAttachment* self);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAttachmentType AttachmentType;\ntypedef spAttachment Attachment;\n#define Attachment_dispose(...) spAttachment_dispose(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_ATTACHMENT_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AttachmentLoader.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/AttachmentLoader.h>\n#include <stdio.h>\n#include <spine/extension.h>\n\ntypedef struct _spAttachmentLoaderVtable {\n\tspAttachment* (*newAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name);\n\tvoid (*dispose) (spAttachmentLoader* self);\n} _spAttachmentLoaderVtable;\n\nvoid _spAttachmentLoader_init (spAttachmentLoader* self, /**/\nvoid (*dispose) (spAttachmentLoader* self), /**/\nspAttachment* (*newAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name)) {\n\tCONST_CAST(_spAttachmentLoaderVtable*, self->vtable) = NEW(_spAttachmentLoaderVtable);\n\tVTABLE(spAttachmentLoader, self)->dispose = dispose;\n\tVTABLE(spAttachmentLoader, self)->newAttachment = newAttachment;\n}\n\nvoid _spAttachmentLoader_deinit (spAttachmentLoader* self) {\n\tFREE(self->vtable);\n\tFREE(self->error1);\n\tFREE(self->error2);\n}\n\nvoid spAttachmentLoader_dispose (spAttachmentLoader* self) {\n\tVTABLE(spAttachmentLoader, self)->dispose(self);\n\tFREE(self);\n}\n\nspAttachment* spAttachmentLoader_newAttachment (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name) {\n\tFREE(self->error1);\n\tFREE(self->error2);\n\tself->error1 = 0;\n\tself->error2 = 0;\n\treturn VTABLE(spAttachmentLoader, self)->newAttachment(self, skin, type, name);\n}\n\nvoid _spAttachmentLoader_setError (spAttachmentLoader* self, const char* error1, const char* error2) {\n\tFREE(self->error1);\n\tFREE(self->error2);\n\tMALLOC_STR(self->error1, error1);\n\tMALLOC_STR(self->error2, error2);\n}\n\nvoid _spAttachmentLoader_setUnknownTypeError (spAttachmentLoader* self, spAttachmentType type) {\n\tchar buffer[16];\n\tsprintf(buffer, \"%d\", type);\n\t_spAttachmentLoader_setError(self, \"Unknown attachment type: \", buffer);\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/AttachmentLoader.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_ATTACHMENTLOADER_H_\n#define SPINE_ATTACHMENTLOADER_H_\n\n#include <spine/Attachment.h>\n#include <spine/Skin.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spAttachmentLoader spAttachmentLoader;\nstruct spAttachmentLoader {\n\tconst char* error1;\n\tconst char* error2;\n\n\tconst void* const vtable;\n#ifdef __cplusplus\n\tspAttachmentLoader () :\n\t\t\t\t\terror1(0),\n\t\t\t\t\terror2(0),\n\t\t\t\t\tvtable(0) {\n\t}\n#endif\n};\n\nvoid spAttachmentLoader_dispose (spAttachmentLoader* self);\n\n/* Returns 0 to not load an attachment. If 0 is returned and spAttachmentLoader.error1 is set, an error occurred. */\nspAttachment* spAttachmentLoader_newAttachment (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spAttachmentLoader AttachmentLoader;\n#define AttachmentLoader_dispose(...) spAttachmentLoader_dispose(__VA_ARGS__)\n#define AttachmentLoader_newAttachment(...) spAttachmentLoader_newAttachment(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_ATTACHMENTLOADER_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Bone.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Bone.h>\n#include <spine/extension.h>\n\nstatic int yDown;\n\nvoid spBone_setYDown (int value) {\n\tyDown = value;\n}\n\nspBone* spBone_create (spBoneData* data, spBone* parent) {\n\tspBone* self = NEW(spBone);\n\tCONST_CAST(spBoneData*, self->data) = data;\n\tCONST_CAST(spBone*, self->parent) = parent;\n\tspBone_setToSetupPose(self);\n\treturn self;\n}\n\nvoid spBone_dispose (spBone* self) {\n\tFREE(self);\n}\n\nvoid spBone_setToSetupPose (spBone* self) {\n\tself->x = self->data->x;\n\tself->y = self->data->y;\n\tself->rotation = self->data->rotation;\n\tself->scaleX = self->data->scaleX;\n\tself->scaleY = self->data->scaleY;\n}\n\nvoid spBone_updateWorldTransform (spBone* self, int flipX, int flipY) {\n\tfloat radians, cosine, sine;\n\tif (self->parent) {\n\t\tCONST_CAST(float, self->worldX) = self->x * self->parent->m00 + self->y * self->parent->m01 + self->parent->worldX;\n\t\tCONST_CAST(float, self->worldY) = self->x * self->parent->m10 + self->y * self->parent->m11 + self->parent->worldY;\n\t\tif (self->data->inheritScale) {\n\t\t\tCONST_CAST(float, self->worldScaleX) = self->parent->worldScaleX * self->scaleX;\n\t\t\tCONST_CAST(float, self->worldScaleY) = self->parent->worldScaleY * self->scaleY;\n\t\t} else {\n\t\t\tCONST_CAST(float, self->worldScaleX) = self->scaleX;\n\t\t\tCONST_CAST(float, self->worldScaleY) = self->scaleY;\n\t\t}\n\t\tCONST_CAST(float, self->worldRotation) =\n\t\t\t\tself->data->inheritRotation ? self->parent->worldRotation + self->rotation : self->rotation;\n\t} else {\n\t\tCONST_CAST(float, self->worldX) = flipX ? -self->x : self->x;\n\t\tCONST_CAST(float, self->worldY) = (flipY && flipY != yDown) ? -self->y : self->y;\n\t\tCONST_CAST(float, self->worldScaleX) = self->scaleX;\n\t\tCONST_CAST(float, self->worldScaleY) = self->scaleY;\n\t\tCONST_CAST(float, self->worldRotation) = self->rotation;\n\t}\n\tradians = (float)(self->worldRotation * 3.1415926535897932385 / 180);\n#ifdef __STDC_VERSION__\n\tcosine = cosf(radians);\n\tsine = sinf(radians);\n#else\n\tcosine = (float)cos(radians);\n\tsine = (float)sin(radians);\n#endif\n\tCONST_CAST(float, self->m00) = cosine * self->worldScaleX;\n\tCONST_CAST(float, self->m10) = sine * self->worldScaleX;\n\tCONST_CAST(float, self->m01) = -sine * self->worldScaleY;\n\tCONST_CAST(float, self->m11) = cosine * self->worldScaleY;\n\tif (flipX) {\n\t\tCONST_CAST(float, self->m00) = -self->m00;\n\t\tCONST_CAST(float, self->m01) = -self->m01;\n\t}\n\tif (flipY != yDown) {\n\t\tCONST_CAST(float, self->m10) = -self->m10;\n\t\tCONST_CAST(float, self->m11) = -self->m11;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Bone.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_BONE_H_\n#define SPINE_BONE_H_\n\n#include <spine/BoneData.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spBone spBone;\nstruct spBone {\n\tspBoneData* const data;\n\tspBone* const parent;\n\tfloat x, y;\n\tfloat rotation;\n\tfloat scaleX, scaleY;\n\n\tfloat const m00, m01, worldX; /* a b x */\n\tfloat const m10, m11, worldY; /* c d y */\n\tfloat const worldRotation;\n\tfloat const worldScaleX, worldScaleY;\n};\n\nvoid spBone_setYDown (int/*bool*/yDown);\n\n/* @param parent May be 0. */\nspBone* spBone_create (spBoneData* data, spBone* parent);\nvoid spBone_dispose (spBone* self);\n\nvoid spBone_setToSetupPose (spBone* self);\n\nvoid spBone_updateWorldTransform (spBone* self, int/*bool*/flipX, int/*bool*/flipY);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spBone Bone;\n#define Bone_setYDown(...) spBone_setYDown(__VA_ARGS__)\n#define Bone_create(...) spBone_create(__VA_ARGS__)\n#define Bone_dispose(...) spBone_dispose(__VA_ARGS__)\n#define Bone_setToSetupPose(...) spBone_setToSetupPose(__VA_ARGS__)\n#define Bone_updateWorldTransform(...) spBone_updateWorldTransform(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_BONE_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/BoneData.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/BoneData.h>\n#include <spine/extension.h>\n\nspBoneData* spBoneData_create (const char* name, spBoneData* parent) {\n\tspBoneData* self = NEW(spBoneData);\n\tMALLOC_STR(self->name, name);\n\tCONST_CAST(spBoneData*, self->parent) = parent;\n\tself->scaleX = 1;\n\tself->scaleY = 1;\n\tself->inheritScale = 1;\n\tself->inheritRotation = 1;\n\treturn self;\n}\n\nvoid spBoneData_dispose (spBoneData* self) {\n\tFREE(self->name);\n\tFREE(self);\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/BoneData.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_BONEDATA_H_\n#define SPINE_BONEDATA_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spBoneData spBoneData;\nstruct spBoneData {\n\tconst char* const name;\n\tspBoneData* const parent;\n\tfloat length;\n\tfloat x, y;\n\tfloat rotation;\n\tfloat scaleX, scaleY;\n\tint/*bool*/inheritScale, inheritRotation;\n};\n\nspBoneData* spBoneData_create (const char* name, spBoneData* parent);\nvoid spBoneData_dispose (spBoneData* self);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spBoneData BoneData;\n#define BoneData_create(...) spBoneData_create(__VA_ARGS__)\n#define BoneData_dispose(...) spBoneData_dispose(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_BONEDATA_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/BoundingBoxAttachment.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/BoundingBoxAttachment.h>\n#include <spine/extension.h>\n\nvoid _spBoundingBoxAttachment_dispose (spAttachment* attachment) {\n\tspBoundingBoxAttachment* self = SUB_CAST(spBoundingBoxAttachment, attachment);\n\n\t_spAttachment_deinit(attachment);\n\n\tFREE(self->vertices);\n\tFREE(self);\n}\n\nspBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name) {\n\tspBoundingBoxAttachment* self = NEW(spBoundingBoxAttachment);\n\t_spAttachment_init(SUPER(self), name, ATTACHMENT_BOUNDING_BOX, _spBoundingBoxAttachment_dispose);\n\treturn self;\n}\n\nvoid spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, float x, float y, spBone* bone, float* worldVertices) {\n\tint i;\n\tfloat px, py;\n\tfloat* vertices = self->vertices;\n\n\tx += bone->worldX;\n\ty += bone->worldY;\n\tfor (i = 0; i < self->verticesCount; i += 2) {\n\t\tpx = vertices[i];\n\t\tpy = vertices[i + 1];\n\t\tworldVertices[i] = px * bone->m00 + py * bone->m01 + x;\n\t\tworldVertices[i + 1] = px * bone->m10 + py * bone->m11 + y;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/BoundingBoxAttachment.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_BOUNDINGBOXATTACHMENT_H_\n#define SPINE_BOUNDINGBOXATTACHMENT_H_\n\n#include <spine/Attachment.h>\n#include <spine/Atlas.h>\n#include <spine/Slot.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spBoundingBoxAttachment spBoundingBoxAttachment;\nstruct spBoundingBoxAttachment {\n\tspAttachment super;\n\tint verticesCount;\n\tfloat* vertices;\n};\n\nspBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name);\nvoid spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, float x, float y, spBone* bone, float* vertices);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spBoundingBoxAttachment BoundingBoxAttachment;\n#define BoundingBoxAttachment_create(...) spBoundingBoxAttachment_create(__VA_ARGS__)\n#define BoundingBoxAttachment_computeWorldVertices(...) spBoundingBoxAttachment_computeWorldVertices(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_BOUNDINGBOXATTACHMENT_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/CCSkeleton.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/CCSkeleton.h>\n#include <spine/spine-cocos2dx.h>\n\nUSING_NS_CC;\nusing std::min;\nusing std::max;\n\nnamespace spine {\n\nSkeleton* Skeleton::createWithData (spSkeletonData* skeletonData, bool isOwnsSkeletonData) {\n\tSkeleton* node = new Skeleton(skeletonData, isOwnsSkeletonData);\n\tnode->autorelease();\n\treturn node;\n}\n\nSkeleton* Skeleton::createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale) {\n\tSkeleton* node = new Skeleton(skeletonDataFile, atlas, scale);\n\tnode->autorelease();\n\treturn node;\n}\n\nSkeleton* Skeleton::createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale) {\n\tSkeleton* node = new Skeleton(skeletonDataFile, atlasFile, scale);\n\tnode->autorelease();\n\treturn node;\n}\n\nvoid Skeleton::initialize () {\n\tatlas = 0;\n\tdebugSlots = false;\n\tdebugBones = false;\n\ttimeScale = 1;\n\n    blendFunc.src = BlendFunc::ALPHA_PREMULTIPLIED.src;\n    blendFunc.dst = BlendFunc::ALPHA_PREMULTIPLIED.dst;\n    \n\tsetOpacityModifyRGB(true);\n\n    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));\n\tscheduleUpdate();\n}\n\nvoid Skeleton::setSkeletonData (spSkeletonData *skeletonData, bool isOwnsSkeletonData) {\n\tskeleton = spSkeleton_create(skeletonData);\n\trootBone = skeleton->bones[0];\n\tthis->ownsSkeletonData = isOwnsSkeletonData;\n}\n\nSkeleton::Skeleton () {\n\tinitialize();\n}\n\nSkeleton::Skeleton (spSkeletonData *skeletonData, bool isOwnsSkeletonData) {\n\tinitialize();\n\n\tsetSkeletonData(skeletonData, isOwnsSkeletonData);\n}\n\nSkeleton::Skeleton (const char* skeletonDataFile, spAtlas* aAtlas, float scale) {\n\tinitialize();\n\n\tspSkeletonJson* json = spSkeletonJson_create(aAtlas);\n\tjson->scale = scale == 0 ? (1 / Director::getInstance()->getContentScaleFactor()) : scale;\n\tspSkeletonData* skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeletonDataFile);\n\tCCAssert(skeletonData, json->error ? json->error : \"Error reading skeleton data.\");\n\tspSkeletonJson_dispose(json);\n\n\tsetSkeletonData(skeletonData, true);\n}\n\nSkeleton::Skeleton (const char* skeletonDataFile, const char* atlasFile, float scale) {\n\tinitialize();\n\n\tatlas = spAtlas_readAtlasFile(atlasFile);\n\tCCAssert(atlas, \"Error reading atlas file.\");\n\n\tspSkeletonJson* json = spSkeletonJson_create(atlas);\n\tjson->scale = scale == 0 ? (1 / Director::getInstance()->getContentScaleFactor()) : scale;\n\tspSkeletonData* skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeletonDataFile);\n\tCCAssert(skeletonData, json->error ? json->error : \"Error reading skeleton data file.\");\n\tspSkeletonJson_dispose(json);\n\n\tsetSkeletonData(skeletonData, true);\n}\n\nSkeleton::~Skeleton () {\n\tif (ownsSkeletonData) spSkeletonData_dispose(skeleton->data);\n\tif (atlas) spAtlas_dispose(atlas);\n\tspSkeleton_dispose(skeleton);\n}\n\nvoid Skeleton::update (float deltaTime) {\n\tspSkeleton_update(skeleton, deltaTime * timeScale);\n}\n\nvoid Skeleton::draw()\n{\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLGetMatrix(KM_GL_MODELVIEW, &_oldTransMatrix);\n    \n    _customCommand.init(_globalZOrder);\n    _customCommand.func = CC_CALLBACK_0(Skeleton::onDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_customCommand);\n}\n    \nvoid Skeleton::onDraw ()\n{\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPushMatrix();\n    kmGLLoadMatrix(&_oldTransMatrix);\n    \n\tCC_NODE_DRAW_SETUP();\n\n    GL::blendFunc(blendFunc.src, blendFunc.dst);\n\tColor3B color = getColor();\n\tskeleton->r = color.r / (float)255;\n\tskeleton->g = color.g / (float)255;\n\tskeleton->b = color.b / (float)255;\n\tskeleton->a = getOpacity() / (float)255;\n\tif (premultipliedAlpha) {\n\t\tskeleton->r *= skeleton->a;\n\t\tskeleton->g *= skeleton->a;\n\t\tskeleton->b *= skeleton->a;\n\t}\n\n\tint additive = 0;\n\tTextureAtlas* textureAtlas = 0;\n\tV3F_C4B_T2F_Quad quad;\n\tquad.tl.vertices.z = 0;\n\tquad.tr.vertices.z = 0;\n\tquad.bl.vertices.z = 0;\n\tquad.br.vertices.z = 0;\n\tfor (int i = 0, n = skeleton->slotCount; i < n; i++) {\n\t\tspSlot* slot = skeleton->drawOrder[i];\n\t\tif (!slot->attachment || slot->attachment->type != ATTACHMENT_REGION) continue;\n\t\tspRegionAttachment* attachment = (spRegionAttachment*)slot->attachment;\n\t\tTextureAtlas* regionTextureAtlas = getTextureAtlas(attachment);\n\n\t\tif (slot->data->additiveBlending != additive) {\n\t\t\tif (textureAtlas) {\n\t\t\t\ttextureAtlas->drawQuads();\n\t\t\t\ttextureAtlas->removeAllQuads();\n\t\t\t}\n\t\t\tadditive = !additive;\n            GL::blendFunc(blendFunc.src, additive ? GL_ONE : blendFunc.dst);\n\t\t} else if (regionTextureAtlas != textureAtlas && textureAtlas) {\n\t\t\ttextureAtlas->drawQuads();\n\t\t\ttextureAtlas->removeAllQuads();\n\t\t}\n\t\ttextureAtlas = regionTextureAtlas;\n        setFittedBlendingFunc(textureAtlas);\n\n\t\tssize_t quadCount = textureAtlas->getTotalQuads();\n\t\tif (textureAtlas->getCapacity() == quadCount) {\n\t\t\ttextureAtlas->drawQuads();\n\t\t\ttextureAtlas->removeAllQuads();\n\t\t\tif (!textureAtlas->resizeCapacity(textureAtlas->getCapacity() * 2)) return;\n\t\t}\n\n\t\tspRegionAttachment_updateQuad(attachment, slot, &quad, premultipliedAlpha);\n\t\ttextureAtlas->updateQuad(&quad, quadCount);\n\t}\n\tif (textureAtlas) {\n\t\ttextureAtlas->drawQuads();\n\t\ttextureAtlas->removeAllQuads();\n\t}\n\n\tif (debugSlots) {\n\t\t// Slots.\n        DrawPrimitives::setDrawColor4B(0, 0, 255, 255);\n\t\tglLineWidth(1);\n\t\tPoint points[4];\n\t\tV3F_C4B_T2F_Quad tmpQuad;\n\t\tfor (int i = 0, n = skeleton->slotCount; i < n; i++) {\n\t\t\tspSlot* slot = skeleton->drawOrder[i];\n\t\t\tif (!slot->attachment || slot->attachment->type != ATTACHMENT_REGION) continue;\n\t\t\tspRegionAttachment* attachment = (spRegionAttachment*)slot->attachment;\n\t\t\tspRegionAttachment_updateQuad(attachment, slot, &tmpQuad);\n\t\t\tpoints[0] = Point(tmpQuad.bl.vertices.x, tmpQuad.bl.vertices.y);\n\t\t\tpoints[1] = Point(tmpQuad.br.vertices.x, tmpQuad.br.vertices.y);\n\t\t\tpoints[2] = Point(tmpQuad.tr.vertices.x, tmpQuad.tr.vertices.y);\n\t\t\tpoints[3] = Point(tmpQuad.tl.vertices.x, tmpQuad.tl.vertices.y);\n            DrawPrimitives::drawPoly(points, 4, true);\n\t\t}\n\t}\n\tif (debugBones) {\n\t\t// Bone lengths.\n\t\tglLineWidth(2);\n        DrawPrimitives::setDrawColor4B(255, 0, 0, 255);\n\t\tfor (int i = 0, n = skeleton->boneCount; i < n; i++) {\n\t\t\tspBone *bone = skeleton->bones[i];\n\t\t\tfloat x = bone->data->length * bone->m00 + bone->worldX;\n\t\t\tfloat y = bone->data->length * bone->m10 + bone->worldY;\n            DrawPrimitives::drawLine(Point(bone->worldX, bone->worldY), Point(x, y));\n\t\t}\n\t\t// Bone origins.\n        DrawPrimitives::setPointSize(4);\n        DrawPrimitives::setDrawColor4B(0, 0, 255, 255); // Root bone is blue.\n\t\tfor (int i = 0, n = skeleton->boneCount; i < n; i++) {\n\t\t\tspBone *bone = skeleton->bones[i];\n            DrawPrimitives::drawPoint(Point(bone->worldX, bone->worldY));\n\t\t\tif (i == 0) DrawPrimitives::setDrawColor4B(0, 255, 0, 255);\n\t\t}\n\t}\n    \n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPopMatrix();\n}\n\nTextureAtlas* Skeleton::getTextureAtlas (spRegionAttachment* regionAttachment) const {\n\treturn (TextureAtlas*)((spAtlasRegion*)regionAttachment->rendererObject)->page->rendererObject;\n}\n\nRect Skeleton::getBoundingBox () const {\n\tfloat minX = FLT_MAX, minY = FLT_MAX, maxX = FLT_MIN, maxY = FLT_MIN;\n\tfloat scaleX = getScaleX();\n\tfloat scaleY = getScaleY();\n\tfloat vertices[8];\n\tfor (int i = 0; i < skeleton->slotCount; ++i) {\n\t\tspSlot* slot = skeleton->slots[i];\n\t\tif (!slot->attachment || slot->attachment->type != ATTACHMENT_REGION) continue;\n\t\tspRegionAttachment* attachment = (spRegionAttachment*)slot->attachment;\n\t\tspRegionAttachment_computeWorldVertices(attachment, slot->skeleton->x, slot->skeleton->y, slot->bone, vertices);\n\t\tminX = min(minX, vertices[VERTEX_X1] * scaleX);\n\t\tminY = min(minY, vertices[VERTEX_Y1] * scaleY);\n\t\tmaxX = max(maxX, vertices[VERTEX_X1] * scaleX);\n\t\tmaxY = max(maxY, vertices[VERTEX_Y1] * scaleY);\n\t\tminX = min(minX, vertices[VERTEX_X4] * scaleX);\n\t\tminY = min(minY, vertices[VERTEX_Y4] * scaleY);\n\t\tmaxX = max(maxX, vertices[VERTEX_X4] * scaleX);\n\t\tmaxY = max(maxY, vertices[VERTEX_Y4] * scaleY);\n\t\tminX = min(minX, vertices[VERTEX_X2] * scaleX);\n\t\tminY = min(minY, vertices[VERTEX_Y2] * scaleY);\n\t\tmaxX = max(maxX, vertices[VERTEX_X2] * scaleX);\n\t\tmaxY = max(maxY, vertices[VERTEX_Y2] * scaleY);\n\t\tminX = min(minX, vertices[VERTEX_X3] * scaleX);\n\t\tminY = min(minY, vertices[VERTEX_Y3] * scaleY);\n\t\tmaxX = max(maxX, vertices[VERTEX_X3] * scaleX);\n\t\tmaxY = max(maxY, vertices[VERTEX_Y3] * scaleY);\n\t}\n\tPoint position = getPosition();\n\treturn Rect(position.x + minX, position.y + minY, maxX - minX, maxY - minY);\n}\n\n// --- Convenience methods for Skeleton_* functions.\n\nvoid Skeleton::updateWorldTransform () {\n\tspSkeleton_updateWorldTransform(skeleton);\n}\n\nvoid Skeleton::setToSetupPose () {\n\tspSkeleton_setToSetupPose(skeleton);\n}\nvoid Skeleton::setBonesToSetupPose () {\n\tspSkeleton_setBonesToSetupPose(skeleton);\n}\nvoid Skeleton::setSlotsToSetupPose () {\n\tspSkeleton_setSlotsToSetupPose(skeleton);\n}\n\nspBone* Skeleton::findBone (const char* boneName) const {\n\treturn spSkeleton_findBone(skeleton, boneName);\n}\n\nspSlot* Skeleton::findSlot (const char* slotName) const {\n\treturn spSkeleton_findSlot(skeleton, slotName);\n}\n\nbool Skeleton::setSkin (const char* skinName) {\n\treturn spSkeleton_setSkinByName(skeleton, skinName) ? true : false;\n}\n\nspAttachment* Skeleton::getAttachment (const char* slotName, const char* attachmentName) const {\n\treturn spSkeleton_getAttachmentForSlotName(skeleton, slotName, attachmentName);\n}\nbool Skeleton::setAttachment (const char* slotName, const char* attachmentName) {\n\treturn spSkeleton_setAttachment(skeleton, slotName, attachmentName) ? true : false;\n}\n\n// --- CCBlendProtocol\n\nconst cocos2d::BlendFunc& Skeleton::getBlendFunc () const {\n    return blendFunc;\n}\n\nvoid Skeleton::setBlendFunc (const cocos2d::BlendFunc& aBlendFunc) {\n    this->blendFunc = aBlendFunc;\n}\n    \nvoid Skeleton::setFittedBlendingFunc(cocos2d::TextureAtlas * nextRenderedTexture)\n{\n    if(nextRenderedTexture->getTexture() && nextRenderedTexture->getTexture()->hasPremultipliedAlpha())\n    {\n        GL::blendFunc(BlendFunc::ALPHA_PREMULTIPLIED.src, BlendFunc::ALPHA_PREMULTIPLIED.dst);\n    }\n    else\n    {\n        GL::blendFunc(BlendFunc::ALPHA_NON_PREMULTIPLIED.src, BlendFunc::ALPHA_NON_PREMULTIPLIED.dst);\n    }\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/CCSkeleton.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_CCSKELETON_H_\n#define SPINE_CCSKELETON_H_\n\n#include <spine/spine.h>\n\n#include \"CCNode.h\"\n#include \"CCProtocols.h\"\n#include \"CCTextureAtlas.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nnamespace spine {\n\n/**\nDraws a skeleton.\n*/\nclass Skeleton: public cocos2d::Node, public cocos2d::BlendProtocol {\npublic:\n\tspSkeleton* skeleton;\n\tspBone* rootBone;\n\tfloat timeScale;\n\tbool debugSlots;\n\tbool debugBones;\n\tbool premultipliedAlpha;\n    cocos2d::BlendFunc blendFunc;\n\n\tstatic Skeleton* createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false);\n\tstatic Skeleton* createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);\n\tstatic Skeleton* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 0);\n\n\tSkeleton (spSkeletonData* skeletonData, bool ownsSkeletonData = false);\n\tSkeleton (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);\n\tSkeleton (const char* skeletonDataFile, const char* atlasFile, float scale = 0);\n\n\tvirtual ~Skeleton ();\n\n\tvirtual void update (float deltaTime) override;\n\tvirtual void draw() override;\n    void onDraw();\n\tvirtual cocos2d::Rect getBoundingBox () const override;\n\n\t// --- Convenience methods for common Skeleton_* functions.\n\tvoid updateWorldTransform ();\n\n\tvoid setToSetupPose ();\n\tvoid setBonesToSetupPose ();\n\tvoid setSlotsToSetupPose ();\n\n\t/* Returns 0 if the bone was not found. */\n\tspBone* findBone (const char* boneName) const;\n\t/* Returns 0 if the slot was not found. */\n\tspSlot* findSlot (const char* slotName) const;\n\t\n\t/* Sets the skin used to look up attachments not found in the SkeletonData defaultSkin. Attachments from the new skin are\n\t * attached if the corresponding attachment from the old skin was attached. Returns false if the skin was not found.\n\t * @param skin May be 0.*/\n\tbool setSkin (const char* skinName);\n\t\n\t/* Returns 0 if the slot or attachment was not found. */\n\tspAttachment* getAttachment (const char* slotName, const char* attachmentName) const;\n\t/* Returns false if the slot or attachment was not found. */\n\tbool setAttachment (const char* slotName, const char* attachmentName);\n\n\t// --- CCBlendProtocol\n    virtual const cocos2d::BlendFunc& getBlendFunc() const override;\n    virtual void setBlendFunc(const cocos2d::BlendFunc& func) override;\n\nprotected:\n\tSkeleton ();\n\tvoid setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData);\n\tvirtual cocos2d::TextureAtlas* getTextureAtlas (spRegionAttachment* regionAttachment) const;\n\nprivate:\n\tbool ownsSkeletonData;\n\tspAtlas* atlas;\n\tvoid initialize ();\n    // Util function that setting blend-function by nextRenderedTexture's premultiplied flag\n    void setFittedBlendingFunc(cocos2d::TextureAtlas * nextRenderedTexture);\n    \n    cocos2d::CustomCommand _customCommand;\n    \n    kmMat4 _oldTransMatrix;\n};\n\n}\n\n#endif /* SPINE_CCSKELETON_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/CCSkeletonAnimation.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/CCSkeletonAnimation.h>\n#include <spine/extension.h>\n#include <spine/spine-cocos2dx.h>\n\nUSING_NS_CC;\nusing std::min;\nusing std::max;\nusing std::vector;\n\nnamespace spine {\n\nstatic void callback (spAnimationState* state, int trackIndex, spEventType type, spEvent* event, int loopCount) {\n\t((SkeletonAnimation*)state->context)->onAnimationStateEvent(trackIndex, type, event, loopCount);\n}\n\nSkeletonAnimation* SkeletonAnimation::createWithData (spSkeletonData* skeletonData) {\n\tSkeletonAnimation* node = new SkeletonAnimation(skeletonData);\n\tnode->autorelease();\n\treturn node;\n}\n\nSkeletonAnimation* SkeletonAnimation::createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale) {\n\tSkeletonAnimation* node = new SkeletonAnimation(skeletonDataFile, atlas, scale);\n\tnode->autorelease();\n\treturn node;\n}\n\nSkeletonAnimation* SkeletonAnimation::createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale) {\n\tSkeletonAnimation* node = new SkeletonAnimation(skeletonDataFile, atlasFile, scale);\n\tnode->autorelease();\n\treturn node;\n}\n\nvoid SkeletonAnimation::initialize () {\n\tlistenerInstance = 0;\n\tlistenerMethod = 0;\n\n\townsAnimationStateData = true;\n\tstate = spAnimationState_create(spAnimationStateData_create(skeleton->data));\n\tstate->context = this;\n\tstate->listener = callback;\n}\n\nSkeletonAnimation::SkeletonAnimation (spSkeletonData *skeletonData)\n\t\t: Skeleton(skeletonData) {\n\tinitialize();\n}\n\nSkeletonAnimation::SkeletonAnimation (const char* skeletonDataFile, spAtlas* atlas, float scale)\n\t\t: Skeleton(skeletonDataFile, atlas, scale) {\n\tinitialize();\n}\n\nSkeletonAnimation::SkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale)\n\t\t: Skeleton(skeletonDataFile, atlasFile, scale) {\n\tinitialize();\n}\n\nSkeletonAnimation::~SkeletonAnimation () {\n\tif (ownsAnimationStateData) spAnimationStateData_dispose(state->data);\n\tspAnimationState_dispose(state);\n}\n\nvoid SkeletonAnimation::update (float deltaTime) {\n\tsuper::update(deltaTime);\n\n\tdeltaTime *= timeScale;\n\tspAnimationState_update(state, deltaTime);\n\tspAnimationState_apply(state, skeleton);\n\tspSkeleton_updateWorldTransform(skeleton);\n}\n\nvoid SkeletonAnimation::setAnimationStateData (spAnimationStateData* stateData) {\n\tCCAssert(stateData, \"stateData cannot be null.\");\n\n\tif (ownsAnimationStateData) spAnimationStateData_dispose(state->data);\n\tspAnimationState_dispose(state);\n\n\townsAnimationStateData = false;\n\tstate = spAnimationState_create(stateData);\n\tstate->context = this;\n\tstate->listener = callback;\n}\n\nvoid SkeletonAnimation::setMix (const char* fromAnimation, const char* toAnimation, float duration) {\n\tspAnimationStateData_setMixByName(state->data, fromAnimation, toAnimation, duration);\n}\n\nvoid SkeletonAnimation::setAnimationListener (Object* instance, SEL_AnimationStateEvent method) {\n\tlistenerInstance = instance;\n\tlistenerMethod = method;\n}\n\nspTrackEntry* SkeletonAnimation::setAnimation (int trackIndex, const char* name, bool loop) {\n\tspAnimation* animation = spSkeletonData_findAnimation(skeleton->data, name);\n\tif (!animation) {\n\t\tlog(\"Spine: Animation not found: %s\", name);\n\t\treturn 0;\n\t}\n\treturn spAnimationState_setAnimation(state, trackIndex, animation, loop);\n}\n\nspTrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const char* name, bool loop, float delay) {\n\tspAnimation* animation = spSkeletonData_findAnimation(skeleton->data, name);\n\tif (!animation) {\n\t\tlog(\"Spine: Animation not found: %s\", name);\n\t\treturn 0;\n\t}\n\treturn spAnimationState_addAnimation(state, trackIndex, animation, loop, delay);\n}\n\nspTrackEntry* SkeletonAnimation::getCurrent (int trackIndex) { \n\treturn spAnimationState_getCurrent(state, trackIndex);\n}\n\nvoid SkeletonAnimation::clearTracks () {\n\tspAnimationState_clearTracks(state);\n}\n\nvoid SkeletonAnimation::clearTrack (int trackIndex) {\n\tspAnimationState_clearTrack(state, trackIndex);\n}\n\nvoid SkeletonAnimation::onAnimationStateEvent (int trackIndex, spEventType type, spEvent* event, int loopCount) {\n\tif (listenerInstance) (listenerInstance->*listenerMethod)(this, trackIndex, type, event, loopCount);\n}\n\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/CCSkeletonAnimation.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_CCSKELETONANIMATION_H_\n#define SPINE_CCSKELETONANIMATION_H_\n\n#include <spine/spine.h>\n#include <spine/CCSkeleton.h>\n\nnamespace spine {\n\nclass SkeletonAnimation;\ntypedef void (cocos2d::Object::*SEL_AnimationStateEvent)(spine::SkeletonAnimation* node, int trackIndex, spEventType type, spEvent* event, int loopCount);\n#define animationStateEvent_selector(_SELECTOR) (SEL_AnimationStateEvent)(&_SELECTOR)\n\n/** Draws an animated skeleton, providing an AnimationState for applying one or more animations and queuing animations to be\n  * played later. */\nclass SkeletonAnimation: public Skeleton {\npublic:\n\tspAnimationState* state;\n\n\tstatic SkeletonAnimation* createWithData (spSkeletonData* skeletonData);\n\tstatic SkeletonAnimation* createWithFile (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);\n\tstatic SkeletonAnimation* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 0);\n\n\tSkeletonAnimation (spSkeletonData* skeletonData);\n\tSkeletonAnimation (const char* skeletonDataFile, spAtlas* atlas, float scale = 0);\n\tSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale = 0);\n\n\tvirtual ~SkeletonAnimation ();\n\n\tvirtual void update (float deltaTime);\n\n\tvoid setAnimationStateData (spAnimationStateData* stateData);\n\tvoid setMix (const char* fromAnimation, const char* toAnimation, float duration);\n\n\tvoid setAnimationListener (cocos2d::Object* instance, SEL_AnimationStateEvent method);\n\tspTrackEntry* setAnimation (int trackIndex, const char* name, bool loop);\n\tspTrackEntry* addAnimation (int trackIndex, const char* name, bool loop, float delay = 0);\n\tspTrackEntry* getCurrent (int trackIndex = 0);\n\tvoid clearTracks ();\n\tvoid clearTrack (int trackIndex = 0);\n\n\tvirtual void onAnimationStateEvent (int trackIndex, spEventType type, spEvent* event, int loopCount);\n\nprotected:\n\tSkeletonAnimation ();\n\nprivate:\n\ttypedef Skeleton super;\n    cocos2d::Object* listenerInstance;\n\tSEL_AnimationStateEvent listenerMethod;\n\tbool ownsAnimationStateData;\n\n\tvoid initialize ();\n};\n\n}\n\n#endif /* SPINE_CCSKELETONANIMATION_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/CMakeLists.txt",
    "content": "set(SPINE_SRC\n  Animation.cpp\n  AnimationState.cpp\n  AnimationStateData.cpp\n  Atlas.cpp\n  AtlasAttachmentLoader.cpp\n  Attachment.cpp\n  AttachmentLoader.cpp\n  Bone.cpp\n  BoneData.cpp\n  BoundingBoxAttachment.cpp\n  Event.cpp\n  EventData.cpp\n  Json.cpp\n  RegionAttachment.cpp\n  Skeleton.cpp\n  SkeletonBounds.cpp\n  SkeletonData.cpp\n  SkeletonJson.cpp\n  Skin.cpp\n  Slot.cpp\n  SlotData.cpp\n  Slot.cpp\n  SlotData.cpp\n  extension.cpp\n  spine-cocos2dx.cpp\n  CCSkeleton.cpp\n  CCSkeletonAnimation.cpp\n  BoundingBoxAttachment.cpp\n  Event.cpp\n  EventData.cpp\n  SkeletonBounds.cpp\n)\n\ninclude_directories(\n  ..\n)\n\nadd_library(spine STATIC\n  ${SPINE_SRC}\n)\n\nset_target_properties(spine\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Event.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Event.h>\n#include <spine/extension.h>\n\nspEvent* spEvent_create (spEventData* data) {\n\tspEvent* self = NEW(spEvent);\n\tCONST_CAST(spEventData*, self->data) = data;\n\treturn self;\n}\n\nvoid spEvent_dispose (spEvent* self) {\n\tFREE(self->stringValue);\n\tFREE(self);\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Event.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_EVENT_H_\n#define SPINE_EVENT_H_\n\n#include <spine/EventData.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spEvent spEvent;\nstruct spEvent {\n\tspEventData* const data;\n\tint intValue;\n\tfloat floatValue;\n\tconst char* stringValue;\n};\n\nspEvent* spEvent_create (spEventData* data);\nvoid spEvent_dispose (spEvent* self);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spEvent Event;\n#define Event_create(...) spEvent_create(__VA_ARGS__)\n#define Event_dispose(...) spEvent_dispose(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_EVENT_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/EventData.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/EventData.h>\n#include <spine/extension.h>\n\nspEventData* spEventData_create (const char* name) {\n\tspEventData* self = NEW(spEventData);\n\tMALLOC_STR(self->name, name);\n\treturn self;\n}\n\nvoid spEventData_dispose (spEventData* self) {\n\tFREE(self->stringValue);\n\tFREE(self->name);\n\tFREE(self);\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/EventData.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_EVENTDATA_H_\n#define SPINE_EVENTDATA_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spEventData spEventData;\nstruct spEventData {\n\tconst char* const name;\n\tint intValue;\n\tfloat floatValue;\n\tconst char* stringValue;\n};\n\nspEventData* spEventData_create (const char* name);\nvoid spEventData_dispose (spEventData* self);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spEventData EventData;\n#define EventData_create(...) spEventData_create(__VA_ARGS__)\n#define EventData_dispose(...) spEventData_dispose(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_EVENTDATA_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Json.cpp",
    "content": "/*\n Copyright (c) 2009 Dave Gamble\n\n Permission is hereby granted, dispose of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n/* Json */\n/* JSON parser in C. */\n\n#include \"Json.h\"\n#include <stdio.h>\n#include <ctype.h>\n#include <spine/extension.h>\n\nstatic const char* ep;\n\nconst char* Json_getError (void) {\n\treturn ep;\n}\n\nstatic int Json_strcasecmp (const char* s1, const char* s2) {\n\tif (!s1) return (s1 == s2) ? 0 : 1;\n\tif (!s2) return 1;\n\tfor (; tolower(*s1) == tolower(*s2); ++s1, ++s2)\n\t\tif (*s1 == 0) return 0;\n\treturn tolower(*(const unsigned char*)s1) - tolower(*(const unsigned char*)s2);\n}\n\n/* Internal constructor. */\nstatic Json *Json_new (void) {\n\treturn (Json*)CALLOC(Json, 1);\n}\n\n/* Delete a Json structure. */\nvoid Json_dispose (Json *c) {\n\tJson *next;\n\twhile (c) {\n\t\tnext = c->next;\n\t\tif (c->child) Json_dispose(c->child);\n\t\tif (c->valueString) FREE(c->valueString);\n\t\tif (c->name) FREE(c->name);\n\t\tFREE(c);\n\t\tc = next;\n\t}\n}\n\n/* Parse the input text to generate a number, and populate the result into item. */\nstatic const char* parse_number (Json *item, const char* num) {\n\tfloat n = 0, sign = 1, scale = 0;\n\tint subscale = 0, signsubscale = 1;\n\n\t/* Could use sscanf for this? */\n\tif (*num == '-') sign = -1, num++; /* Has sign? */\n\tif (*num == '0') num++; /* is zero */\n\tif (*num >= '1' && *num <= '9') do\n\t\tn = (n * 10.0f) + (*num++ - '0');\n\twhile (*num >= '0' && *num <= '9'); /* Number? */\n\tif (*num == '.' && num[1] >= '0' && num[1] <= '9') {\n\t\tnum++;\n\t\tdo\n\t\t\tn = (n * 10.0f) + (*num++ - '0'), scale--;\n\t\twhile (*num >= '0' && *num <= '9');\n\t} /* Fractional part? */\n\tif (*num == 'e' || *num == 'E') /* Exponent? */\n\t{\n\t\tnum++;\n\t\tif (*num == '+')\n\t\t\tnum++;\n\t\telse if (*num == '-') signsubscale = -1, num++; /* With sign? */\n\t\twhile (*num >= '0' && *num <= '9')\n\t\t\tsubscale = (subscale * 10) + (*num++ - '0'); /* Number? */\n\t}\n\n\tn = sign * n * (float)pow(10.0f, (scale + subscale * signsubscale)); /* number = +/- number.fraction * 10^+/- exponent */\n\n\titem->valueFloat = n;\n\titem->valueInt = (int)n;\n\titem->type = Json_Number;\n\treturn num;\n}\n\n/* Parse the input text into an unescaped cstring, and populate item. */\nstatic const unsigned char firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC};\nstatic const char* parse_string (Json *item, const char* str) {\n\tconst char* ptr = str + 1;\n\tchar* ptr2;\n\tchar* out;\n\tint len = 0;\n\tunsigned uc, uc2;\n\tif (*str != '\\\"') {\n\t\tep = str;\n\t\treturn 0;\n\t} /* not a string! */\n\n\twhile (*ptr != '\\\"' && *ptr && ++len)\n\t\tif (*ptr++ == '\\\\') ptr++; /* Skip escaped quotes. */\n\n\tout = (char*)malloc(len + 1); /* This is how long we need for the string, roughly. */\n\tif (!out) return 0;\n\n\tptr = str + 1;\n\tptr2 = out;\n\twhile (*ptr != '\\\"' && *ptr) {\n\t\tif (*ptr != '\\\\')\n\t\t\t*ptr2++ = *ptr++;\n\t\telse {\n\t\t\tptr++;\n\t\t\tswitch (*ptr) {\n\t\t\tcase 'b':\n\t\t\t\t*ptr2++ = '\\b';\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\t\t*ptr2++ = '\\f';\n\t\t\t\tbreak;\n\t\t\tcase 'n':\n\t\t\t\t*ptr2++ = '\\n';\n\t\t\t\tbreak;\n\t\t\tcase 'r':\n\t\t\t\t*ptr2++ = '\\r';\n\t\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\t\t*ptr2++ = '\\t';\n\t\t\t\tbreak;\n\t\t\tcase 'u': /* transcode utf16 to utf8. */\n\t\t\t\tsscanf(ptr + 1, \"%4x\", &uc);\n\t\t\t\tptr += 4; /* get the unicode char. */\n\n\t\t\t\tif ((uc >= 0xDC00 && uc <= 0xDFFF) || uc == 0) break; /* check for invalid.\t*/\n\n\t\t\t\tif (uc >= 0xD800 && uc <= 0xDBFF) /* UTF16 surrogate pairs.\t*/\n\t\t\t\t{\n\t\t\t\t\tif (ptr[1] != '\\\\' || ptr[2] != 'u') break; /* missing second-half of surrogate.\t*/\n\t\t\t\t\tsscanf(ptr + 3, \"%4x\", &uc2);\n\t\t\t\t\tptr += 6;\n\t\t\t\t\tif (uc2 < 0xDC00 || uc2 > 0xDFFF) break; /* invalid second-half of surrogate.\t*/\n\t\t\t\t\tuc = 0x10000 + (((uc & 0x3FF) << 10) | (uc2 & 0x3FF));\n\t\t\t\t}\n\n\t\t\t\tlen = 4;\n\t\t\t\tif (uc < 0x80)\n\t\t\t\t\tlen = 1;\n\t\t\t\telse if (uc < 0x800)\n\t\t\t\t\tlen = 2;\n\t\t\t\telse if (uc < 0x10000) len = 3;\n\t\t\t\tptr2 += len;\n\n\t\t\t\tswitch (len) {\n\t\t\t\tcase 4:\n\t\t\t\t\t*--ptr2 = ((uc | 0x80) & 0xBF);\n\t\t\t\t\tuc >>= 6;\n\t\t\t\tcase 3:\n\t\t\t\t\t*--ptr2 = ((uc | 0x80) & 0xBF);\n\t\t\t\t\tuc >>= 6;\n\t\t\t\tcase 2:\n\t\t\t\t\t*--ptr2 = ((uc | 0x80) & 0xBF);\n\t\t\t\t\tuc >>= 6;\n\t\t\t\tcase 1:\n\t\t\t\t\t*--ptr2 = (uc | firstByteMark[len]);\n\t\t\t\t}\n\t\t\t\tptr2 += len;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t*ptr2++ = *ptr;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tptr++;\n\t\t}\n\t}\n\t*ptr2 = 0;\n\tif (*ptr == '\\\"') ptr++;\n\titem->valueString = out;\n\titem->type = Json_String;\n\treturn ptr;\n}\n\n/* Predeclare these prototypes. */\nstatic const char* parse_value (Json *item, const char* value);\nstatic const char* parse_array (Json *item, const char* value);\nstatic const char* parse_object (Json *item, const char* value);\n\n/* Utility to jump whitespace and cr/lf */\nstatic const char* skip (const char* in) {\n\twhile (in && *in && (unsigned char)*in <= 32)\n\t\tin++;\n\treturn in;\n}\n\n/* Parse an object - create a new root, and populate. */\nJson *Json_create (const char* value) {\n\tconst char* end = 0;\n\tJson *c = Json_new();\n\tep = 0;\n\tif (!c) return 0; /* memory fail */\n\n\tend = parse_value(c, skip(value));\n\tif (!end) {\n\t\tJson_dispose(c);\n\t\treturn 0;\n\t} /* parse failure. ep is set. */\n\n\treturn c;\n}\n\n/* Parser core - when encountering text, process appropriately. */\nstatic const char* parse_value (Json *item, const char* value) {\n\tif (!value) return 0; /* Fail on null. */\n\tif (!strncmp(value, \"null\", 4)) {\n\t\titem->type = Json_NULL;\n\t\treturn value + 4;\n\t}\n\tif (!strncmp(value, \"false\", 5)) {\n\t\titem->type = Json_False;\n\t\treturn value + 5;\n\t}\n\tif (!strncmp(value, \"true\", 4)) {\n\t\titem->type = Json_True;\n\t\titem->valueInt = 1;\n\t\treturn value + 4;\n\t}\n\tif (*value == '\\\"') {\n\t\treturn parse_string(item, value);\n\t}\n\tif (*value == '-' || (*value >= '0' && *value <= '9')) {\n\t\treturn parse_number(item, value);\n\t}\n\tif (*value == '[') {\n\t\treturn parse_array(item, value);\n\t}\n\tif (*value == '{') {\n\t\treturn parse_object(item, value);\n\t}\n\n\tep = value;\n\treturn 0; /* failure. */\n}\n\n/* Build an array from input text. */\nstatic const char* parse_array (Json *item, const char* value) {\n\tJson *child;\n\tif (*value != '[') {\n\t\tep = value;\n\t\treturn 0;\n\t} /* not an array! */\n\n\titem->type = Json_Array;\n\tvalue = skip(value + 1);\n\tif (*value == ']') return value + 1; /* empty array. */\n\n\titem->child = child = Json_new();\n\tif (!item->child) return 0; /* memory fail */\n\tvalue = skip(parse_value(child, skip(value))); /* skip any spacing, get the value. */\n\tif (!value) return 0;\n\titem->size = 1;\n\n\twhile (*value == ',') {\n\t\tJson *new_item;\n\t\tif (!(new_item = Json_new())) return 0; /* memory fail */\n\t\tchild->next = new_item;\n\t\tnew_item->prev = child;\n\t\tchild = new_item;\n\t\tvalue = skip(parse_value(child, skip(value + 1)));\n\t\tif (!value) return 0; /* memory fail */\n\t\titem->size++;\n\t}\n\n\tif (*value == ']') return value + 1; /* end of array */\n\tep = value;\n\treturn 0; /* malformed. */\n}\n\n/* Build an object from the text. */\nstatic const char* parse_object (Json *item, const char* value) {\n\tJson *child;\n\tif (*value != '{') {\n\t\tep = value;\n\t\treturn 0;\n\t} /* not an object! */\n\n\titem->type = Json_Object;\n\tvalue = skip(value + 1);\n\tif (*value == '}') return value + 1; /* empty array. */\n\n\titem->child = child = Json_new();\n\tif (!item->child) return 0;\n\tvalue = skip(parse_string(child, skip(value)));\n\tif (!value) return 0;\n\tchild->name = child->valueString;\n\tchild->valueString = 0;\n\tif (*value != ':') {\n\t\tep = value;\n\t\treturn 0;\n\t} /* fail! */\n\tvalue = skip(parse_value(child, skip(value + 1))); /* skip any spacing, get the value. */\n\tif (!value) return 0;\n\titem->size = 1;\n\n\twhile (*value == ',') {\n\t\tJson *new_item;\n\t\tif (!(new_item = Json_new())) return 0; /* memory fail */\n\t\tchild->next = new_item;\n\t\tnew_item->prev = child;\n\t\tchild = new_item;\n\t\tvalue = skip(parse_string(child, skip(value + 1)));\n\t\tif (!value) return 0;\n\t\tchild->name = child->valueString;\n\t\tchild->valueString = 0;\n\t\tif (*value != ':') {\n\t\t\tep = value;\n\t\t\treturn 0;\n\t\t} /* fail! */\n\t\tvalue = skip(parse_value(child, skip(value + 1))); /* skip any spacing, get the value. */\n\t\tif (!value) return 0;\n\t\titem->size++;\n\t}\n\n\tif (*value == '}') return value + 1; /* end of array */\n\tep = value;\n\treturn 0; /* malformed. */\n}\n\nJson *Json_getItem (Json *object, const char* string) {\n\tJson *c = object->child;\n\twhile (c && Json_strcasecmp(c->name, string))\n\t\tc = c->next;\n\treturn c;\n}\n\nconst char* Json_getString (Json* object, const char* name, const char* defaultValue) {\n\tobject = Json_getItem(object, name);\n\tif (object) return object->valueString;\n\treturn defaultValue;\n}\n\nfloat Json_getFloat (Json* value, const char* name, float defaultValue) {\n\tvalue = Json_getItem(value, name);\n\treturn value ? value->valueFloat : defaultValue;\n}\n\nint Json_getInt (Json* value, const char* name, int defaultValue) {\n\tvalue = Json_getItem(value, name);\n\treturn value ? value->valueInt : defaultValue;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Json.h",
    "content": "/*\n Copyright (c) 2009 Dave Gamble\n \n Permission is hereby granted, dispose of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n */\n\n/* Esoteric Software: Removed everything except parsing, shorter method names, more get methods, double to float, formatted. */\n\n#ifndef SPINE_JSON_H_\n#define SPINE_JSON_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* Json Types: */\n#define Json_False 0\n#define Json_True 1\n#define Json_NULL 2\n#define Json_Number 3\n#define Json_String 4\n#define Json_Array 5\n#define Json_Object 6\n\n/* The Json structure: */\ntypedef struct Json {\n\tstruct Json* next;\n\tstruct Json* prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */\n\tstruct Json* child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */\n\n\tint type; /* The type of the item, as above. */\n\tint size; /* The number of children. */\n\n\tconst char* valueString; /* The item's string, if type==Json_String */\n\tint valueInt; /* The item's number, if type==Json_Number */\n\tfloat valueFloat; /* The item's number, if type==Json_Number */\n\n\tconst char* name; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */\n} Json;\n\n/* Supply a block of JSON, and this returns a Json object you can interrogate. Call Json_dispose when finished. */\nJson* Json_create (const char* value);\n\n/* Delete a Json entity and all subentities. */\nvoid Json_dispose (Json* json);\n\n/* Get item \"string\" from object. Case insensitive. */\nJson* Json_getItem (Json* json, const char* string);\nconst char* Json_getString (Json* json, const char* name, const char* defaultValue);\nfloat Json_getFloat (Json* json, const char* name, float defaultValue);\nint Json_getInt (Json* json, const char* name, int defaultValue);\n\n/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */\nconst char* Json_getError (void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_JSON_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/RegionAttachment.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/RegionAttachment.h>\n#include <spine/extension.h>\n\nvoid _spRegionAttachment_dispose (spAttachment* attachment) {\n\tspRegionAttachment* self = SUB_CAST(spRegionAttachment, attachment);\n\n\t_spAttachment_deinit(attachment);\n\n\tFREE(self);\n}\n\nspRegionAttachment* spRegionAttachment_create (const char* name) {\n\tspRegionAttachment* self = NEW(spRegionAttachment);\n\tself->scaleX = 1;\n\tself->scaleY = 1;\n\t_spAttachment_init(SUPER(self), name, ATTACHMENT_REGION, _spRegionAttachment_dispose);\n\treturn self;\n}\n\nvoid spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate) {\n\tif (rotate) {\n\t\tself->uvs[VERTEX_X2] = u;\n\t\tself->uvs[VERTEX_Y2] = v2;\n\t\tself->uvs[VERTEX_X3] = u;\n\t\tself->uvs[VERTEX_Y3] = v;\n\t\tself->uvs[VERTEX_X4] = u2;\n\t\tself->uvs[VERTEX_Y4] = v;\n\t\tself->uvs[VERTEX_X1] = u2;\n\t\tself->uvs[VERTEX_Y1] = v2;\n\t} else {\n\t\tself->uvs[VERTEX_X1] = u;\n\t\tself->uvs[VERTEX_Y1] = v2;\n\t\tself->uvs[VERTEX_X2] = u;\n\t\tself->uvs[VERTEX_Y2] = v;\n\t\tself->uvs[VERTEX_X3] = u2;\n\t\tself->uvs[VERTEX_Y3] = v;\n\t\tself->uvs[VERTEX_X4] = u2;\n\t\tself->uvs[VERTEX_Y4] = v2;\n\t}\n}\n\nvoid spRegionAttachment_updateOffset (spRegionAttachment* self) {\n\tfloat regionScaleX = self->width / self->regionOriginalWidth * self->scaleX;\n\tfloat regionScaleY = self->height / self->regionOriginalHeight * self->scaleY;\n\tfloat localX = -self->width / 2 * self->scaleX + self->regionOffsetX * regionScaleX;\n\tfloat localY = -self->height / 2 * self->scaleY + self->regionOffsetY * regionScaleY;\n\tfloat localX2 = localX + self->regionWidth * regionScaleX;\n\tfloat localY2 = localY + self->regionHeight * regionScaleY;\n\tfloat radians = (float)(self->rotation * 3.1415926535897932385 / 180);\n#ifdef __STDC_VERSION__\n\tfloat cosine = cosf(radians);\n\tfloat sine = sinf(radians);\n#else\n\tfloat cosine = (float)cos(radians);\n\tfloat sine = (float)sin(radians);\n#endif\n\tfloat localXCos = localX * cosine + self->x;\n\tfloat localXSin = localX * sine;\n\tfloat localYCos = localY * cosine + self->y;\n\tfloat localYSin = localY * sine;\n\tfloat localX2Cos = localX2 * cosine + self->x;\n\tfloat localX2Sin = localX2 * sine;\n\tfloat localY2Cos = localY2 * cosine + self->y;\n\tfloat localY2Sin = localY2 * sine;\n\tself->offset[VERTEX_X1] = localXCos - localYSin;\n\tself->offset[VERTEX_Y1] = localYCos + localXSin;\n\tself->offset[VERTEX_X2] = localXCos - localY2Sin;\n\tself->offset[VERTEX_Y2] = localY2Cos + localXSin;\n\tself->offset[VERTEX_X3] = localX2Cos - localY2Sin;\n\tself->offset[VERTEX_Y3] = localY2Cos + localX2Sin;\n\tself->offset[VERTEX_X4] = localX2Cos - localYSin;\n\tself->offset[VERTEX_Y4] = localYCos + localX2Sin;\n}\n\nvoid spRegionAttachment_computeWorldVertices (spRegionAttachment* self, float x, float y, spBone* bone, float* vertices) {\n\tfloat* offset = self->offset;\n\tx += bone->worldX;\n\ty += bone->worldY;\n\tvertices[VERTEX_X1] = offset[VERTEX_X1] * bone->m00 + offset[VERTEX_Y1] * bone->m01 + x;\n\tvertices[VERTEX_Y1] = offset[VERTEX_X1] * bone->m10 + offset[VERTEX_Y1] * bone->m11 + y;\n\tvertices[VERTEX_X2] = offset[VERTEX_X2] * bone->m00 + offset[VERTEX_Y2] * bone->m01 + x;\n\tvertices[VERTEX_Y2] = offset[VERTEX_X2] * bone->m10 + offset[VERTEX_Y2] * bone->m11 + y;\n\tvertices[VERTEX_X3] = offset[VERTEX_X3] * bone->m00 + offset[VERTEX_Y3] * bone->m01 + x;\n\tvertices[VERTEX_Y3] = offset[VERTEX_X3] * bone->m10 + offset[VERTEX_Y3] * bone->m11 + y;\n\tvertices[VERTEX_X4] = offset[VERTEX_X4] * bone->m00 + offset[VERTEX_Y4] * bone->m01 + x;\n\tvertices[VERTEX_Y4] = offset[VERTEX_X4] * bone->m10 + offset[VERTEX_Y4] * bone->m11 + y;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/RegionAttachment.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_REGIONATTACHMENT_H_\n#define SPINE_REGIONATTACHMENT_H_\n\n#include <spine/Attachment.h>\n#include <spine/Atlas.h>\n#include <spine/Slot.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef enum {\n\tVERTEX_X1 = 0, VERTEX_Y1, VERTEX_X2, VERTEX_Y2, VERTEX_X3, VERTEX_Y3, VERTEX_X4, VERTEX_Y4\n} spVertexIndex;\n\ntypedef struct spRegionAttachment spRegionAttachment;\nstruct spRegionAttachment {\n\tspAttachment super;\n\tfloat x, y, scaleX, scaleY, rotation, width, height;\n\n\tvoid* rendererObject;\n\tint regionOffsetX, regionOffsetY; /* Pixels stripped from the bottom left, unrotated. */\n\tint regionWidth, regionHeight; /* Unrotated, stripped pixel size. */\n\tint regionOriginalWidth, regionOriginalHeight; /* Unrotated, unstripped pixel size. */\n\n\tfloat offset[8];\n\tfloat uvs[8];\n};\n\nspRegionAttachment* spRegionAttachment_create (const char* name);\nvoid spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate);\nvoid spRegionAttachment_updateOffset (spRegionAttachment* self);\nvoid spRegionAttachment_computeWorldVertices (spRegionAttachment* self, float x, float y, spBone* bone, float* vertices);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spVertexIndex VertexIndex;\ntypedef spRegionAttachment RegionAttachment;\n#define RegionAttachment_create(...) spRegionAttachment_create(__VA_ARGS__)\n#define RegionAttachment_setUVs(...) spRegionAttachment_setUVs(__VA_ARGS__)\n#define RegionAttachment_updateOffset(...) spRegionAttachment_updateOffset(__VA_ARGS__)\n#define RegionAttachment_computeWorldVertices(...) spRegionAttachment_computeWorldVertices(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_REGIONATTACHMENT_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Skeleton.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Skeleton.h>\n#include <string.h>\n#include <spine/extension.h>\n\nspSkeleton* spSkeleton_create (spSkeletonData* data) {\n\tint i, ii;\n\n\tspSkeleton* self = NEW(spSkeleton);\n\tCONST_CAST(spSkeletonData*, self->data) = data;\n\n\tself->boneCount = self->data->boneCount;\n\tself->bones = MALLOC(spBone*, self->boneCount);\n\n\tfor (i = 0; i < self->boneCount; ++i) {\n\t\tspBoneData* boneData = self->data->bones[i];\n\t\tspBone* parent = 0;\n\t\tif (boneData->parent) {\n\t\t\t/* Find parent bone. */\n\t\t\tfor (ii = 0; ii < self->boneCount; ++ii) {\n\t\t\t\tif (data->bones[ii] == boneData->parent) {\n\t\t\t\t\tparent = self->bones[ii];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tself->bones[i] = spBone_create(boneData, parent);\n\t}\n\tCONST_CAST(spBone*, self->root) = self->bones[0];\n\n\tself->slotCount = data->slotCount;\n\tself->slots = MALLOC(spSlot*, self->slotCount);\n\tfor (i = 0; i < self->slotCount; ++i) {\n\t\tspSlotData *slotData = data->slots[i];\n\n\t\t/* Find bone for the slotData's boneData. */\n\t\tspBone* bone = 0;\n\t\tfor (ii = 0; ii < self->boneCount; ++ii) {\n\t\t\tif (data->bones[ii] == slotData->boneData) {\n\t\t\t\tbone = self->bones[ii];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tself->slots[i] = spSlot_create(slotData, self, bone);\n\t}\n\n\tself->drawOrder = MALLOC(spSlot*, self->slotCount);\n\tmemcpy(self->drawOrder, self->slots, sizeof(spSlot*) * self->slotCount);\n\n\tself->r = 1;\n\tself->g = 1;\n\tself->b = 1;\n\tself->a = 1;\n\n\treturn self;\n}\n\nvoid spSkeleton_dispose (spSkeleton* self) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tspBone_dispose(self->bones[i]);\n\tFREE(self->bones);\n\n\tfor (i = 0; i < self->slotCount; ++i)\n\t\tspSlot_dispose(self->slots[i]);\n\tFREE(self->slots);\n\n\tFREE(self->drawOrder);\n\tFREE(self);\n}\n\nvoid spSkeleton_updateWorldTransform (const spSkeleton* self) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tspBone_updateWorldTransform(self->bones[i], self->flipX, self->flipY);\n}\n\nvoid spSkeleton_setToSetupPose (const spSkeleton* self) {\n\tspSkeleton_setBonesToSetupPose(self);\n\tspSkeleton_setSlotsToSetupPose(self);\n}\n\nvoid spSkeleton_setBonesToSetupPose (const spSkeleton* self) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tspBone_setToSetupPose(self->bones[i]);\n}\n\nvoid spSkeleton_setSlotsToSetupPose (const spSkeleton* self) {\n\tint i;\n\tmemcpy(self->drawOrder, self->slots, self->slotCount * sizeof(int));\n\tfor (i = 0; i < self->slotCount; ++i)\n\t\tspSlot_setToSetupPose(self->slots[i]);\n}\n\nspBone* spSkeleton_findBone (const spSkeleton* self, const char* boneName) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tif (strcmp(self->data->bones[i]->name, boneName) == 0) return self->bones[i];\n\treturn 0;\n}\n\nint spSkeleton_findBoneIndex (const spSkeleton* self, const char* boneName) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tif (strcmp(self->data->bones[i]->name, boneName) == 0) return i;\n\treturn -1;\n}\n\nspSlot* spSkeleton_findSlot (const spSkeleton* self, const char* slotName) {\n\tint i;\n\tfor (i = 0; i < self->slotCount; ++i)\n\t\tif (strcmp(self->data->slots[i]->name, slotName) == 0) return self->slots[i];\n\treturn 0;\n}\n\nint spSkeleton_findSlotIndex (const spSkeleton* self, const char* slotName) {\n\tint i;\n\tfor (i = 0; i < self->slotCount; ++i)\n\t\tif (strcmp(self->data->slots[i]->name, slotName) == 0) return i;\n\treturn -1;\n}\n\nint spSkeleton_setSkinByName (spSkeleton* self, const char* skinName) {\n\tspSkin *skin;\n\tif (!skinName) {\n\t\tspSkeleton_setSkin(self, 0);\n\t\treturn 1;\n\t}\n\tskin = spSkeletonData_findSkin(self->data, skinName);\n\tif (!skin) return 0;\n\tspSkeleton_setSkin(self, skin);\n\treturn 1;\n}\n\nvoid spSkeleton_setSkin (spSkeleton* self, spSkin* newSkin) {\n\tif (self->skin && newSkin) spSkin_attachAll(newSkin, self, self->skin);\n\tCONST_CAST(spSkin*, self->skin) = newSkin;\n}\n\nspAttachment* spSkeleton_getAttachmentForSlotName (const spSkeleton* self, const char* slotName, const char* attachmentName) {\n\tint slotIndex = spSkeletonData_findSlotIndex(self->data, slotName);\n\treturn spSkeleton_getAttachmentForSlotIndex(self, slotIndex, attachmentName);\n}\n\nspAttachment* spSkeleton_getAttachmentForSlotIndex (const spSkeleton* self, int slotIndex, const char* attachmentName) {\n\tif (slotIndex == -1) return 0;\n\tif (self->skin) {\n\t\tspAttachment *attachment = spSkin_getAttachment(self->skin, slotIndex, attachmentName);\n\t\tif (attachment) return attachment;\n\t}\n\tif (self->data->defaultSkin) {\n\t\tspAttachment *attachment = spSkin_getAttachment(self->data->defaultSkin, slotIndex, attachmentName);\n\t\tif (attachment) return attachment;\n\t}\n\treturn 0;\n}\n\nint spSkeleton_setAttachment (spSkeleton* self, const char* slotName, const char* attachmentName) {\n\tint i;\n\tfor (i = 0; i < self->slotCount; ++i) {\n\t\tspSlot *slot = self->slots[i];\n\t\tif (strcmp(slot->data->name, slotName) == 0) {\n\t\t\tif (!attachmentName)\n\t\t\t\tspSlot_setAttachment(slot, 0);\n\t\t\telse {\n\t\t\t\tspAttachment* attachment = spSkeleton_getAttachmentForSlotIndex(self, i, attachmentName);\n\t\t\t\tif (!attachment) return 0;\n\t\t\t\tspSlot_setAttachment(slot, attachment);\n\t\t\t}\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\n}\n\nvoid spSkeleton_update (spSkeleton* self, float deltaTime) {\n\tself->time += deltaTime;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Skeleton.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SKELETON_H_\n#define SPINE_SKELETON_H_\n\n#include <spine/SkeletonData.h>\n#include <spine/Slot.h>\n#include <spine/Skin.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct spSkeleton spSkeleton;\nstruct spSkeleton {\n\tspSkeletonData* const data;\n\n\tint boneCount;\n\tspBone** bones;\n\tspBone* const root;\n\n\tint slotCount;\n\tspSlot** slots;\n\tspSlot** drawOrder;\n\n\tspSkin* const skin;\n\tfloat r, g, b, a;\n\tfloat time;\n\tint/*bool*/flipX, flipY;\n\tfloat x, y;\n};\n\nspSkeleton* spSkeleton_create (spSkeletonData* data);\nvoid spSkeleton_dispose (spSkeleton* self);\n\nvoid spSkeleton_updateWorldTransform (const spSkeleton* self);\n\nvoid spSkeleton_setToSetupPose (const spSkeleton* self);\nvoid spSkeleton_setBonesToSetupPose (const spSkeleton* self);\nvoid spSkeleton_setSlotsToSetupPose (const spSkeleton* self);\n\n/* Returns 0 if the bone was not found. */\nspBone* spSkeleton_findBone (const spSkeleton* self, const char* boneName);\n/* Returns -1 if the bone was not found. */\nint spSkeleton_findBoneIndex (const spSkeleton* self, const char* boneName);\n\n/* Returns 0 if the slot was not found. */\nspSlot* spSkeleton_findSlot (const spSkeleton* self, const char* slotName);\n/* Returns -1 if the slot was not found. */\nint spSkeleton_findSlotIndex (const spSkeleton* self, const char* slotName);\n\n/* Sets the skin used to look up attachments not found in the SkeletonData defaultSkin. Attachments from the new skin are\n * attached if the corresponding attachment from the old skin was attached.\n * @param skin May be 0.*/\nvoid spSkeleton_setSkin (spSkeleton* self, spSkin* skin);\n/* Returns 0 if the skin was not found. See spSkeleton_setSkin.\n * @param skinName May be 0. */\nint spSkeleton_setSkinByName (spSkeleton* self, const char* skinName);\n\n/* Returns 0 if the slot or attachment was not found. */\nspAttachment* spSkeleton_getAttachmentForSlotName (const spSkeleton* self, const char* slotName, const char* attachmentName);\n/* Returns 0 if the slot or attachment was not found. */\nspAttachment* spSkeleton_getAttachmentForSlotIndex (const spSkeleton* self, int slotIndex, const char* attachmentName);\n/* Returns 0 if the slot or attachment was not found. */\nint spSkeleton_setAttachment (spSkeleton* self, const char* slotName, const char* attachmentName);\n\nvoid spSkeleton_update (spSkeleton* self, float deltaTime);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spSkeleton Skeleton;\n#define Skeleton_create(...) spSkeleton_create(__VA_ARGS__)\n#define Skeleton_dispose(...) spSkeleton_dispose(__VA_ARGS__)\n#define Skeleton_updateWorldTransform(...) spSkeleton_updateWorldTransform(__VA_ARGS__)\n#define Skeleton_setToSetupPose(...) spSkeleton_setToSetupPose(__VA_ARGS__)\n#define Skeleton_setBonesToSetupPose(...) spSkeleton_setBonesToSetupPose(__VA_ARGS__)\n#define Skeleton_setSlotsToSetupPose(...) spSkeleton_setSlotsToSetupPose(__VA_ARGS__)\n#define Skeleton_findBone(...) spSkeleton_findBone(__VA_ARGS__)\n#define Skeleton_findBoneIndex(...) spSkeleton_findBoneIndex(__VA_ARGS__)\n#define Skeleton_findSlot(...) spSkeleton_findSlot(__VA_ARGS__)\n#define Skeleton_findSlotIndex(...) spSkeleton_findSlotIndex(__VA_ARGS__)\n#define Skeleton_setSkin(...) spSkeleton_setSkin(__VA_ARGS__)\n#define Skeleton_setSkinByName(...) spSkeleton_setSkinByName(__VA_ARGS__)\n#define Skeleton_getAttachmentForSlotName(...) spSkeleton_getAttachmentForSlotName(__VA_ARGS__)\n#define Skeleton_getAttachmentForSlotIndex(...) spSkeleton_getAttachmentForSlotIndex(__VA_ARGS__)\n#define Skeleton_setAttachment(...) spSkeleton_setAttachment(__VA_ARGS__)\n#define Skeleton_update(...) spSkeleton_update(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_SKELETON_H_*/\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SkeletonBounds.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/SkeletonBounds.h>\n#include <limits.h>\n#include <spine/extension.h>\n\nspPolygon* spPolygon_create (int capacity) {\n\tspPolygon* self = NEW(spPolygon);\n\tself->capacity = capacity;\n\tCONST_CAST(float*, self->vertices) = MALLOC(float, capacity);\n\treturn self;\n}\n\nvoid spPolygon_dispose (spPolygon* self) {\n\tFREE(self->vertices);\n\tFREE(self);\n}\n\nint/*bool*/spPolygon_containsPoint (spPolygon* self, float x, float y) {\n\tint prevIndex = self->count - 2;\n\tint inside = 0;\n\tint i;\n\tfor (i = 0; i < self->count; i += 2) {\n\t\tfloat vertexY = self->vertices[i + 1];\n\t\tfloat prevY = self->vertices[prevIndex + 1];\n\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\n\t\t\tfloat vertexX = self->vertices[i];\n\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (self->vertices[prevIndex] - vertexX) < x) inside = !inside;\n\t\t}\n\t\tprevIndex = i;\n\t}\n\treturn inside;\n}\n\nint/*bool*/spPolygon_intersectsSegment (spPolygon* self, float x1, float y1, float x2, float y2) {\n\tfloat width12 = x1 - x2, height12 = y1 - y2;\n\tfloat det1 = x1 * y2 - y1 * x2;\n\tfloat x3 = self->vertices[self->count - 2], y3 = self->vertices[self->count - 1];\n\tint i;\n\tfor (i = 0; i < self->count; i += 2) {\n\t\tfloat x4 = self->vertices[i], y4 = self->vertices[i + 1];\n\t\tfloat det2 = x3 * y4 - y3 * x4;\n\t\tfloat width34 = x3 - x4, height34 = y3 - y4;\n\t\tfloat det3 = width12 * height34 - height12 * width34;\n\t\tfloat x = (det1 * width34 - width12 * det2) / det3;\n\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\n\t\t\tfloat y = (det1 * height34 - height12 * det2) / det3;\n\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return 1;\n\t\t}\n\t\tx3 = x4;\n\t\ty3 = y4;\n\t}\n\treturn 0;\n}\n\n/**/\n\ntypedef struct {\n\tspSkeletonBounds super;\n\tint capacity;\n} _spSkeletonBounds;\n\nspSkeletonBounds* spSkeletonBounds_create () {\n\treturn SUPER(NEW(_spSkeletonBounds));\n}\n\nvoid spSkeletonBounds_dispose (spSkeletonBounds* self) {\n\tint i;\n\tfor (i = 0; i < SUB_CAST(_spSkeletonBounds, self)->capacity; ++i)\n\t\tif (self->polygons[i]) spPolygon_dispose(self->polygons[i]);\n\tFREE(self->polygons);\n\tFREE(self->boundingBoxes);\n\tFREE(self);\n}\n\nvoid spSkeletonBounds_update (spSkeletonBounds* self, spSkeleton* skeleton, int/*bool*/updateAabb) {\n\tint i;\n\n\t_spSkeletonBounds* internal = SUB_CAST(_spSkeletonBounds, self);\n\tif (internal->capacity < skeleton->slotCount) {\n\t\tspPolygon** newPolygons;\n\n\t\tFREE(self->boundingBoxes);\n\t\tself->boundingBoxes = MALLOC(spBoundingBoxAttachment*, skeleton->slotCount);\n\n\t\tnewPolygons = CALLOC(spPolygon*, skeleton->slotCount);\n\t\tmemcpy(newPolygons, self->polygons, internal->capacity);\n\t\tFREE(self->polygons);\n\t\tself->polygons = newPolygons;\n\n\t\tinternal->capacity = skeleton->slotCount;\n\t}\n\n\tself->minX = (float)INT_MAX;\n\tself->minY = (float)INT_MAX;\n\tself->maxX = (float)INT_MIN;\n\tself->maxY = (float)INT_MIN;\n\n\tself->count = 0;\n\tfor (i = 0; i < skeleton->slotCount; ++i) {\n\t\tspPolygon* polygon;\n\t\tspBoundingBoxAttachment* boundingBox;\n\n\t\tspSlot* slot = skeleton->slots[i];\n\t\tspAttachment* attachment = slot->attachment;\n\t\tif (!attachment || attachment->type != ATTACHMENT_BOUNDING_BOX) continue;\n\t\tboundingBox = (spBoundingBoxAttachment*)attachment;\n\t\tself->boundingBoxes[self->count] = boundingBox;\n\n\t\tpolygon = self->polygons[self->count];\n\t\tif (!polygon || polygon->capacity < boundingBox->verticesCount) {\n\t\t\tif (polygon) spPolygon_dispose(polygon);\n\t\t\tself->polygons[self->count] = polygon = spPolygon_create(boundingBox->verticesCount);\n\t\t}\n\t\tpolygon->count = boundingBox->verticesCount;\n\t\tspBoundingBoxAttachment_computeWorldVertices(boundingBox, skeleton->x, skeleton->y, slot->bone, polygon->vertices);\n\n\t\tif (updateAabb) {\n\t\t\tint ii = 0;\n\t\t\tfor (; ii < polygon->count; ii += 2) {\n\t\t\t\tfloat x = polygon->vertices[ii];\n\t\t\t\tfloat y = polygon->vertices[ii + 1];\n\t\t\t\tif (x < self->minX) self->minX = x;\n\t\t\t\tif (y < self->minY) self->minY = y;\n\t\t\t\tif (x > self->maxX) self->maxX = x;\n\t\t\t\tif (y > self->maxY) self->maxY = y;\n\t\t\t}\n\t\t}\n\n\t\t++self->count;\n\t}\n}\n\nint/*bool*/spSkeletonBounds_aabbContainsPoint (spSkeletonBounds* self, float x, float y) {\n\treturn x >= self->minX && x <= self->maxX && y >= self->minY && y <= self->maxY;\n}\n\nint/*bool*/spSkeletonBounds_aabbIntersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2) {\n\tfloat m, x, y;\n\tif ((x1 <= self->minX && x2 <= self->minX) || (y1 <= self->minY && y2 <= self->minY) || (x1 >= self->maxX && x2 >= self->maxX)\n\t\t\t|| (y1 >= self->maxY && y2 >= self->maxY)) return 0;\n\tm = (y2 - y1) / (x2 - x1);\n\ty = m * (self->minX - x1) + y1;\n\tif (y > self->minY && y < self->maxY) return 1;\n\ty = m * (self->maxX - x1) + y1;\n\tif (y > self->minY && y < self->maxY) return 1;\n\tx = (self->minY - y1) / m + x1;\n\tif (x > self->minX && x < self->maxX) return 1;\n\tx = (self->maxY - y1) / m + x1;\n\tif (x > self->minX && x < self->maxX) return 1;\n\treturn 0;\n}\n\nint/*bool*/spSkeletonBounds_aabbIntersectsSkeleton (spSkeletonBounds* self, spSkeletonBounds* bounds) {\n\treturn self->minX < bounds->maxX && self->maxX > bounds->minX && self->minY < bounds->maxY && self->maxY > bounds->minY;\n}\n\nspBoundingBoxAttachment* spSkeletonBounds_containsPoint (spSkeletonBounds* self, float x, float y) {\n\tint i;\n\tfor (i = 0; i < self->count; ++i)\n\t\tif (spPolygon_containsPoint(self->polygons[i], x, y)) return self->boundingBoxes[i];\n\treturn 0;\n}\n\nspBoundingBoxAttachment* spSkeletonBounds_intersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2) {\n\tint i;\n\tfor (i = 0; i < self->count; ++i)\n\t\tif (spPolygon_intersectsSegment(self->polygons[i], x1, y1, x2, y2)) return self->boundingBoxes[i];\n\treturn 0;\n}\n\nspPolygon* spSkeletonBounds_getPolygon (spSkeletonBounds* self, spBoundingBoxAttachment* boundingBox) {\n\tint i;\n\tfor (i = 0; i < self->count; ++i)\n\t\tif (self->boundingBoxes[i] == boundingBox) return self->polygons[i];\n\treturn 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SkeletonBounds.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SKELETONBOUNDS_H_\n#define SPINE_SKELETONBOUNDS_H_\n\n#include <spine/BoundingBoxAttachment.h>\n#include <spine/Skeleton.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n\tfloat* const vertices;\n\tint count;\n\tint capacity;\n} spPolygon;\n\nspPolygon* spPolygon_create (int capacity);\nvoid spPolygon_dispose (spPolygon* self);\n\nint/*bool*/spPolygon_containsPoint (spPolygon* polygon, float x, float y);\nint/*bool*/spPolygon_intersectsSegment (spPolygon* polygon, float x1, float y1, float x2, float y2);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spPolygon Polygon;\n#define Polygon_create(...) spPolygon_create(__VA_ARGS__)\n#define Polygon_dispose(...) spPolygon_dispose(__VA_ARGS__)\n#define Polygon_containsPoint(...) spPolygon_containsPoint(__VA_ARGS__)\n#define Polygon_intersectsSegment(...) spPolygon_intersectsSegment(__VA_ARGS__)\n#endif\n\n/**/\n\ntypedef struct {\n\tint count;\n\tspBoundingBoxAttachment** boundingBoxes;\n\tspPolygon** polygons;\n\n\tfloat minX, minY, maxX, maxY;\n} spSkeletonBounds;\n\nspSkeletonBounds* spSkeletonBounds_create ();\nvoid spSkeletonBounds_dispose (spSkeletonBounds* self);\nvoid spSkeletonBounds_update (spSkeletonBounds* self, spSkeleton* skeleton, int/*bool*/updateAabb);\n\n/** Returns true if the axis aligned bounding box contains the point. */\nint/*bool*/spSkeletonBounds_aabbContainsPoint (spSkeletonBounds* self, float x, float y);\n\n/** Returns true if the axis aligned bounding box intersects the line segment. */\nint/*bool*/spSkeletonBounds_aabbIntersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2);\n\n/** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\nint/*bool*/spSkeletonBounds_aabbIntersectsSkeleton (spSkeletonBounds* self, spSkeletonBounds* bounds);\n\n/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\n * efficient to only call this method if spSkeletonBounds_aabbContainsPoint returns true. */\nspBoundingBoxAttachment* spSkeletonBounds_containsPoint (spSkeletonBounds* self, float x, float y);\n\n/** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually\n * more efficient to only call this method if spSkeletonBounds_aabbIntersectsSegment returns true. */\nspBoundingBoxAttachment* spSkeletonBounds_intersectsSegment (spSkeletonBounds* self, float x1, float y1, float x2, float y2);\n\n/** Returns the polygon for the specified bounding box, or null. */\nspPolygon* spSkeletonBounds_getPolygon (spSkeletonBounds* self, spBoundingBoxAttachment* boundingBox);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spSkeletonBounds SkeletonBounds;\n#define SkeletonBounds_create(...) spSkeletonBounds_create(__VA_ARGS__)\n#define SkeletonBounds_dispose(...) spSkeletonBounds_dispose(__VA_ARGS__)\n#define SkeletonBounds_update(...) spSkeletonBounds_update(__VA_ARGS__)\n#define SkeletonBounds_aabbContainsPoint(...) spSkeletonBounds_aabbContainsPoint(__VA_ARGS__)\n#define SkeletonBounds_aabbIntersectsSegment(...) spSkeletonBounds_aabbIntersectsSegment(__VA_ARGS__)\n#define SkeletonBounds_aabbIntersectsSkeleton(...) spSkeletonBounds_aabbIntersectsSkeleton(__VA_ARGS__)\n#define SkeletonBounds_containsPoint(...) spSkeletonBounds_containsPoint(__VA_ARGS__)\n#define SkeletonBounds_intersectsSegment(...) spSkeletonBounds_intersectsSegment(__VA_ARGS__)\n#define SkeletonBounds_getPolygon(...) spSkeletonBounds_getPolygon(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_SKELETONBOUNDS_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SkeletonData.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/SkeletonData.h>\n#include <string.h>\n#include <spine/extension.h>\n\nspSkeletonData* spSkeletonData_create () {\n\treturn NEW(spSkeletonData);\n}\n\nvoid spSkeletonData_dispose (spSkeletonData* self) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tspBoneData_dispose(self->bones[i]);\n\tFREE(self->bones);\n\n\tfor (i = 0; i < self->slotCount; ++i)\n\t\tspSlotData_dispose(self->slots[i]);\n\tFREE(self->slots);\n\n\tfor (i = 0; i < self->skinCount; ++i)\n\t\tspSkin_dispose(self->skins[i]);\n\tFREE(self->skins);\n\n\tfor (i = 0; i < self->animationCount; ++i)\n\t\tspAnimation_dispose(self->animations[i]);\n\tFREE(self->animations);\n\n\tfor (i = 0; i < self->eventCount; ++i)\n\t\tspEventData_dispose(self->events[i]);\n\tFREE(self->events);\n\n\tFREE(self);\n}\n\nspBoneData* spSkeletonData_findBone (const spSkeletonData* self, const char* boneName) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tif (strcmp(self->bones[i]->name, boneName) == 0) return self->bones[i];\n\treturn 0;\n}\n\nint spSkeletonData_findBoneIndex (const spSkeletonData* self, const char* boneName) {\n\tint i;\n\tfor (i = 0; i < self->boneCount; ++i)\n\t\tif (strcmp(self->bones[i]->name, boneName) == 0) return i;\n\treturn -1;\n}\n\nspSlotData* spSkeletonData_findSlot (const spSkeletonData* self, const char* slotName) {\n\tint i;\n\tfor (i = 0; i < self->slotCount; ++i)\n\t\tif (strcmp(self->slots[i]->name, slotName) == 0) return self->slots[i];\n\treturn 0;\n}\n\nint spSkeletonData_findSlotIndex (const spSkeletonData* self, const char* slotName) {\n\tint i;\n\tfor (i = 0; i < self->slotCount; ++i)\n\t\tif (strcmp(self->slots[i]->name, slotName) == 0) return i;\n\treturn -1;\n}\n\nspSkin* spSkeletonData_findSkin (const spSkeletonData* self, const char* skinName) {\n\tint i;\n\tfor (i = 0; i < self->skinCount; ++i)\n\t\tif (strcmp(self->skins[i]->name, skinName) == 0) return self->skins[i];\n\treturn 0;\n}\n\nspEventData* spSkeletonData_findEvent (const spSkeletonData* self, const char* eventName) {\n\tint i;\n\tfor (i = 0; i < self->eventCount; ++i)\n\t\tif (strcmp(self->events[i]->name, eventName) == 0) return self->events[i];\n\treturn 0;\n}\n\nspAnimation* spSkeletonData_findAnimation (const spSkeletonData* self, const char* animationName) {\n\tint i;\n\tfor (i = 0; i < self->animationCount; ++i)\n\t\tif (strcmp(self->animations[i]->name, animationName) == 0) return self->animations[i];\n\treturn 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SkeletonData.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SKELETONDATA_H_\n#define SPINE_SKELETONDATA_H_\n\n#include <spine/BoneData.h>\n#include <spine/SlotData.h>\n#include <spine/Skin.h>\n#include <spine/EventData.h>\n#include <spine/Animation.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n\tint boneCount;\n\tspBoneData** bones;\n\n\tint slotCount;\n\tspSlotData** slots;\n\n\tint skinCount;\n\tspSkin** skins;\n\tspSkin* defaultSkin;\n\n\tint eventCount;\n\tspEventData** events;\n\n\tint animationCount;\n\tspAnimation** animations;\n} spSkeletonData;\n\nspSkeletonData* spSkeletonData_create ();\nvoid spSkeletonData_dispose (spSkeletonData* self);\n\nspBoneData* spSkeletonData_findBone (const spSkeletonData* self, const char* boneName);\nint spSkeletonData_findBoneIndex (const spSkeletonData* self, const char* boneName);\n\nspSlotData* spSkeletonData_findSlot (const spSkeletonData* self, const char* slotName);\nint spSkeletonData_findSlotIndex (const spSkeletonData* self, const char* slotName);\n\nspSkin* spSkeletonData_findSkin (const spSkeletonData* self, const char* skinName);\n\nspEventData* spSkeletonData_findEvent (const spSkeletonData* self, const char* eventName);\n\nspAnimation* spSkeletonData_findAnimation (const spSkeletonData* self, const char* animationName);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spSkeletonData SkeletonData;\n#define SkeletonData_create(...) spSkeletonData_create(__VA_ARGS__)\n#define SkeletonData_dispose(...) spSkeletonData_dispose(__VA_ARGS__)\n#define SkeletonData_findBone(...) spSkeletonData_findBone(__VA_ARGS__)\n#define SkeletonData_findBoneIndex(...) spSkeletonData_findBoneIndex(__VA_ARGS__)\n#define SkeletonData_findSlot(...) spSkeletonData_findSlot(__VA_ARGS__)\n#define SkeletonData_findSlotIndex(...) spSkeletonData_findSlotIndex(__VA_ARGS__)\n#define SkeletonData_findSkin(...) spSkeletonData_findSkin(__VA_ARGS__)\n#define SkeletonData_findEvent(...) spSkeletonData_findEvent(__VA_ARGS__)\n#define SkeletonData_findAnimation(...) spSkeletonData_findAnimation(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_SKELETONDATA_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SkeletonJson.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/SkeletonJson.h>\n#include <stdio.h>\n#include \"Json.h\"\n#include <spine/extension.h>\n#include <spine/RegionAttachment.h>\n#include <spine/AtlasAttachmentLoader.h>\n\ntypedef struct {\n\tspSkeletonJson super;\n\tint ownsLoader;\n} _spSkeletonJson;\n\nspSkeletonJson* spSkeletonJson_createWithLoader (spAttachmentLoader* attachmentLoader) {\n\tspSkeletonJson* self = SUPER(NEW(_spSkeletonJson));\n\tself->scale = 1;\n\tself->attachmentLoader = attachmentLoader;\n\treturn self;\n}\n\nspSkeletonJson* spSkeletonJson_create (spAtlas* atlas) {\n\tspAtlasAttachmentLoader* attachmentLoader = spAtlasAttachmentLoader_create(atlas);\n\tspSkeletonJson* self = spSkeletonJson_createWithLoader(SUPER(attachmentLoader));\n\tSUB_CAST(_spSkeletonJson, self)->ownsLoader = 1;\n\treturn self;\n}\n\nvoid spSkeletonJson_dispose (spSkeletonJson* self) {\n\tif (SUB_CAST(_spSkeletonJson, self)->ownsLoader) spAttachmentLoader_dispose(self->attachmentLoader);\n\tFREE(self->error);\n\tFREE(self);\n}\n\nvoid _spSkeletonJson_setError (spSkeletonJson* self, Json* root, const char* value1, const char* value2) {\n\tchar message[256];\n\tsize_t length = 0;\n\tFREE(self->error);\n\tstrcpy(message, value1);\n\tlength = strlen(value1);\n\tif (value2) strncat(message + length, value2, 256 - length);\n\tMALLOC_STR(self->error, message);\n\tif (root) Json_dispose(root);\n}\n\nstatic float toColor (const char* value, int index) {\n\tchar digits[3];\n\tchar *error;\n\n\tif (strlen(value) != 8) return -1;\n\tvalue += index * 2;\n\n\tdigits[0] = *value;\n\tdigits[1] = *(value + 1);\n\tdigits[2] = '\\0';\n\tauto color = strtoul(digits, &error, 16);\n\tif (*error != 0) return -1;\n\treturn color / (float)255;\n}\n\nstatic void readCurve (spCurveTimeline* timeline, int frameIndex, Json* frame) {\n\tJson* curve = Json_getItem(frame, \"curve\");\n\tif (!curve) return;\n\tif (curve->type == Json_String && strcmp(curve->valueString, \"stepped\") == 0)\n\t\tspCurveTimeline_setStepped(timeline, frameIndex);\n\telse if (curve->type == Json_Array) {\n\t\tJson* child0 = curve->child;\n\t\tJson* child1 = child0->next;\n\t\tJson* child2 = child1->next;\n\t\tJson* child3 = child2->next;\n\t\tspCurveTimeline_setCurve(timeline, frameIndex, child0->valueFloat, child1->valueFloat, child2->valueFloat,\n\t\t\t\tchild3->valueFloat);\n\t}\n}\n\nstatic spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* root, spSkeletonData *skeletonData) {\n\tint i;\n\tspAnimation* animation;\n\n\tJson* bones = Json_getItem(root, \"bones\");\n\tJson* slots = Json_getItem(root, \"slots\");\n\tJson* drawOrder = Json_getItem(root, \"draworder\");\n\tJson* events = Json_getItem(root, \"events\");\n\tJson *boneMap, *slotMap;\n\n\tint timelineCount = 0;\n\tfor (boneMap = bones ? bones->child : 0; boneMap; boneMap = boneMap->next)\n\t\ttimelineCount += boneMap->size;\n\tfor (slotMap = slots ? slots->child : 0; slotMap; slotMap = slotMap->next)\n\t\ttimelineCount += slotMap->size;\n\tif (events) ++timelineCount;\n\tif (drawOrder) ++timelineCount;\n\n\tanimation = spAnimation_create(root->name, timelineCount);\n\tanimation->timelineCount = 0;\n\tskeletonData->animations[skeletonData->animationCount] = animation;\n\t++skeletonData->animationCount;\n\n\tfor (boneMap = bones ? bones->child : 0; boneMap; boneMap = boneMap->next) {\n\t\tJson *timelineArray;\n\n\t\tint boneIndex = spSkeletonData_findBoneIndex(skeletonData, boneMap->name);\n\t\tif (boneIndex == -1) {\n\t\t\tspAnimation_dispose(animation);\n\t\t\t_spSkeletonJson_setError(self, root, \"spBone not found: \", boneMap->name);\n\t\t\treturn 0;\n\t\t}\n\n\t\tfor (timelineArray = boneMap->child; timelineArray; timelineArray = timelineArray->next) {\n\t\t\tJson* frame;\n\t\t\tfloat duration;\n\n\t\t\tif (strcmp(timelineArray->name, \"rotate\") == 0) {\n\t\t\t\tspRotateTimeline *timeline = spRotateTimeline_create(timelineArray->size);\n\t\t\t\ttimeline->boneIndex = boneIndex;\n\t\t\t\tfor (frame = timelineArray->child, i = 0; frame; frame = frame->next, ++i) {\n\t\t\t\t\tspRotateTimeline_setFrame(timeline, i, Json_getFloat(frame, \"time\", 0), Json_getFloat(frame, \"angle\", 0));\n\t\t\t\t\treadCurve(SUPER(timeline), i, frame);\n\t\t\t\t}\n\t\t\t\tanimation->timelines[animation->timelineCount++] = (spTimeline*)timeline;\n\t\t\t\tduration = timeline->frames[timelineArray->size * 2 - 2];\n\t\t\t\tif (duration > animation->duration) animation->duration = duration;\n\n\t\t\t} else {\n\t\t\t\tint isScale = strcmp(timelineArray->name, \"scale\") == 0;\n\t\t\t\tif (isScale || strcmp(timelineArray->name, \"translate\") == 0) {\n\t\t\t\t\tfloat scale = isScale ? 1 : self->scale;\n\t\t\t\t\tspTranslateTimeline *timeline =\n\t\t\t\t\t\t\tisScale ? spScaleTimeline_create(timelineArray->size) : spTranslateTimeline_create(timelineArray->size);\n\t\t\t\t\ttimeline->boneIndex = boneIndex;\n\t\t\t\t\tfor (frame = timelineArray->child, i = 0; frame; frame = frame->next, ++i) {\n\t\t\t\t\t\tspTranslateTimeline_setFrame(timeline, i, Json_getFloat(frame, \"time\", 0), Json_getFloat(frame, \"x\", 0) * scale,\n\t\t\t\t\t\t\t\tJson_getFloat(frame, \"y\", 0) * scale);\n\t\t\t\t\t\treadCurve(SUPER(timeline), i, frame);\n\t\t\t\t\t}\n\t\t\t\t\tanimation->timelines[animation->timelineCount++] = (spTimeline*)timeline;\n\t\t\t\t\tduration = timeline->frames[timelineArray->size * 3 - 3];\n\t\t\t\t\tif (duration > animation->duration) animation->duration = duration;\n\t\t\t\t} else {\n\t\t\t\t\tspAnimation_dispose(animation);\n\t\t\t\t\t_spSkeletonJson_setError(self, 0, \"Invalid timeline type for a bone: \", timelineArray->name);\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (slotMap = slots ? slots->child : 0; slotMap; slotMap = slotMap->next) {\n\t\tJson *timelineArray;\n\n\t\tint slotIndex = spSkeletonData_findSlotIndex(skeletonData, slotMap->name);\n\t\tif (slotIndex == -1) {\n\t\t\tspAnimation_dispose(animation);\n\t\t\t_spSkeletonJson_setError(self, root, \"Slot not found: \", slotMap->name);\n\t\t\treturn 0;\n\t\t}\n\n\t\tfor (timelineArray = slotMap->child; timelineArray; timelineArray = timelineArray->next) {\n\t\t\tJson* frame;\n\t\t\tfloat duration;\n\n\t\t\tif (strcmp(timelineArray->name, \"color\") == 0) {\n\t\t\t\tspColorTimeline *timeline = spColorTimeline_create(timelineArray->size);\n\t\t\t\ttimeline->slotIndex = slotIndex;\n\t\t\t\tfor (frame = timelineArray->child, i = 0; frame; frame = frame->next, ++i) {\n\t\t\t\t\tconst char* s = Json_getString(frame, \"color\", 0);\n\t\t\t\t\tspColorTimeline_setFrame(timeline, i, Json_getFloat(frame, \"time\", 0), toColor(s, 0), toColor(s, 1), toColor(s, 2),\n\t\t\t\t\t\t\ttoColor(s, 3));\n\t\t\t\t\treadCurve(SUPER(timeline), i, frame);\n\t\t\t\t}\n\t\t\t\tanimation->timelines[animation->timelineCount++] = (spTimeline*)timeline;\n\t\t\t\tduration = timeline->frames[timelineArray->size * 5 - 5];\n\t\t\t\tif (duration > animation->duration) animation->duration = duration;\n\n\t\t\t} else if (strcmp(timelineArray->name, \"attachment\") == 0) {\n\t\t\t\tspAttachmentTimeline *timeline = spAttachmentTimeline_create(timelineArray->size);\n\t\t\t\ttimeline->slotIndex = slotIndex;\n\t\t\t\tfor (frame = timelineArray->child, i = 0; frame; frame = frame->next, ++i) {\n\t\t\t\t\tJson* name = Json_getItem(frame, \"name\");\n\t\t\t\t\tspAttachmentTimeline_setFrame(timeline, i, Json_getFloat(frame, \"time\", 0),\n\t\t\t\t\t\t\tname->type == Json_NULL ? 0 : name->valueString);\n\t\t\t\t}\n\t\t\t\tanimation->timelines[animation->timelineCount++] = (spTimeline*)timeline;\n\t\t\t\tduration = timeline->frames[timelineArray->size - 1];\n\t\t\t\tif (duration > animation->duration) animation->duration = duration;\n\n\t\t\t} else {\n\t\t\t\tspAnimation_dispose(animation);\n\t\t\t\t_spSkeletonJson_setError(self, 0, \"Invalid timeline type for a slot: \", timelineArray->name);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (events) {\n\t\tJson* frame;\n\t\tfloat duration;\n\n\t\tspEventTimeline* timeline = spEventTimeline_create(events->size);\n\t\tfor (frame = events->child, i = 0; frame; frame = frame->next, ++i) {\n\t\t\tspEvent* event;\n\t\t\tconst char* stringValue;\n\t\t\tspEventData* eventData = spSkeletonData_findEvent(skeletonData, Json_getString(frame, \"name\", 0));\n\t\t\tif (!eventData) {\n\t\t\t\tspAnimation_dispose(animation);\n\t\t\t\t_spSkeletonJson_setError(self, 0, \"Event not found: \", Json_getString(frame, \"name\", 0));\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tevent = spEvent_create(eventData);\n\t\t\tevent->intValue = Json_getInt(frame, \"int\", eventData->intValue);\n\t\t\tevent->floatValue = Json_getFloat(frame, \"float\", eventData->floatValue);\n\t\t\tstringValue = Json_getString(frame, \"string\", eventData->stringValue);\n\t\t\tif (stringValue) MALLOC_STR(event->stringValue, stringValue);\n\t\t\tspEventTimeline_setFrame(timeline, i, Json_getFloat(frame, \"time\", 0), event);\n\t\t}\n\t\tanimation->timelines[animation->timelineCount++] = (spTimeline*)timeline;\n\t\tduration = timeline->frames[events->size - 1];\n\t\tif (duration > animation->duration) animation->duration = duration;\n\t}\n\n\tif (drawOrder) {\n\t\tJson* frame;\n\t\tfloat duration;\n\n\t\tspDrawOrderTimeline* timeline = spDrawOrderTimeline_create(drawOrder->size, skeletonData->slotCount);\n\t\tfor (frame = drawOrder->child, i = 0; frame; frame = frame->next, ++i) {\n\t\t\tint ii;\n\t\t\tint* drawOrderArray = 0;\n\t\t\tJson* offsets = Json_getItem(frame, \"offsets\");\n\t\t\tif (offsets) {\n\t\t\t\tJson* offsetMap;\n\t\t\t\tint* unchanged = MALLOC(int, skeletonData->slotCount - offsets->size);\n\t\t\t\tint originalIndex = 0, unchangedIndex = 0;\n\n\t\t\t\tdrawOrderArray = MALLOC(int, skeletonData->slotCount);\n\t\t\t\tfor (ii = skeletonData->slotCount - 1; ii >= 0; --ii)\n\t\t\t\t\tdrawOrderArray[ii] = -1;\n\n\t\t\t\tfor (offsetMap = offsets->child; offsetMap; offsetMap = offsetMap->next) {\n\t\t\t\t\tint slotIndex = spSkeletonData_findSlotIndex(skeletonData, Json_getString(offsetMap, \"slot\", 0));\n\t\t\t\t\tif (slotIndex == -1) {\n\t\t\t\t\t\tspAnimation_dispose(animation);\n\t\t\t\t\t\t_spSkeletonJson_setError(self, 0, \"Slot not found: \", Json_getString(offsetMap, \"slot\", 0));\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\t/* Collect unchanged items. */\n\t\t\t\t\twhile (originalIndex != slotIndex)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t/* Set changed items. */\n\t\t\t\t\tdrawOrderArray[originalIndex + Json_getInt(offsetMap, \"offset\", 0)] = originalIndex;\n\t\t\t\t\t++originalIndex;\n\t\t\t\t}\n\t\t\t\t/* Collect remaining unchanged items. */\n\t\t\t\twhile (originalIndex < skeletonData->slotCount)\n\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t/* Fill in unchanged items. */\n\t\t\t\tfor (ii = skeletonData->slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tif (drawOrderArray[ii] == -1) drawOrderArray[ii] = unchanged[--unchangedIndex];\n\t\t\t\tFREE(unchanged);\n\t\t\t}\n\t\t\tspDrawOrderTimeline_setFrame(timeline, i, Json_getFloat(frame, \"time\", 0), drawOrderArray);\n\t\t\tFREE(drawOrderArray);\n\t\t}\n\t\tanimation->timelines[animation->timelineCount++] = (spTimeline*)timeline;\n\t\tduration = timeline->frames[drawOrder->size - 1];\n\t\tif (duration > animation->duration) animation->duration = duration;\n\t}\n\n\treturn animation;\n}\n\nspSkeletonData* spSkeletonJson_readSkeletonDataFile (spSkeletonJson* self, const char* path) {\n\tint length;\n\tspSkeletonData* skeletonData;\n\tconst char* json = _spUtil_readFile(path, &length);\n\tif (!json) {\n\t\t_spSkeletonJson_setError(self, 0, \"Unable to read skeleton file: \", path);\n\t\treturn 0;\n\t}\n\tskeletonData = spSkeletonJson_readSkeletonData(self, json);\n\tFREE(json);\n\treturn skeletonData;\n}\n\nspSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const char* json) {\n\tint i;\n\tspSkeletonData* skeletonData;\n\tJson *root, *bones, *boneMap, *slots, *skins, *animations, *events;\n\n\tFREE(self->error);\n\tCONST_CAST(char*, self->error) = 0;\n\n\troot = Json_create(json);\n\tif (!root) {\n\t\t_spSkeletonJson_setError(self, 0, \"Invalid skeleton JSON: \", Json_getError());\n\t\treturn 0;\n\t}\n\n\tskeletonData = spSkeletonData_create();\n\n\tbones = Json_getItem(root, \"bones\");\n\tskeletonData->bones = MALLOC(spBoneData*, bones->size);\n\tfor (boneMap = bones->child, i = 0; boneMap; boneMap = boneMap->next, ++i) {\n\t\tspBoneData* boneData;\n\n\t\tspBoneData* parent = 0;\n\t\tconst char* parentName = Json_getString(boneMap, \"parent\", 0);\n\t\tif (parentName) {\n\t\t\tparent = spSkeletonData_findBone(skeletonData, parentName);\n\t\t\tif (!parent) {\n\t\t\t\tspSkeletonData_dispose(skeletonData);\n\t\t\t\t_spSkeletonJson_setError(self, root, \"Parent bone not found: \", parentName);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tboneData = spBoneData_create(Json_getString(boneMap, \"name\", 0), parent);\n\t\tboneData->length = Json_getFloat(boneMap, \"length\", 0) * self->scale;\n\t\tboneData->x = Json_getFloat(boneMap, \"x\", 0) * self->scale;\n\t\tboneData->y = Json_getFloat(boneMap, \"y\", 0) * self->scale;\n\t\tboneData->rotation = Json_getFloat(boneMap, \"rotation\", 0);\n\t\tboneData->scaleX = Json_getFloat(boneMap, \"scaleX\", 1);\n\t\tboneData->scaleY = Json_getFloat(boneMap, \"scaleY\", 1);\n\t\tboneData->inheritScale = Json_getInt(boneMap, \"inheritScale\", 1);\n\t\tboneData->inheritRotation = Json_getInt(boneMap, \"inheritRotation\", 1);\n\n\t\tskeletonData->bones[i] = boneData;\n\t\t++skeletonData->boneCount;\n\t}\n\n\tslots = Json_getItem(root, \"slots\");\n\tif (slots) {\n\t\tJson *slotMap;\n\t\tskeletonData->slots = MALLOC(spSlotData*, slots->size);\n\t\tfor (slotMap = slots->child, i = 0; slotMap; slotMap = slotMap->next, ++i) {\n\t\t\tspSlotData* slotData;\n\t\t\tconst char* color;\n\t\t\tJson *attachmentItem;\n\n\t\t\tconst char* boneName = Json_getString(slotMap, \"bone\", 0);\n\t\t\tspBoneData* boneData = spSkeletonData_findBone(skeletonData, boneName);\n\t\t\tif (!boneData) {\n\t\t\t\tspSkeletonData_dispose(skeletonData);\n\t\t\t\t_spSkeletonJson_setError(self, root, \"spSlot bone not found: \", boneName);\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tslotData = spSlotData_create(Json_getString(slotMap, \"name\", 0), boneData);\n\n\t\t\tcolor = Json_getString(slotMap, \"color\", 0);\n\t\t\tif (color) {\n\t\t\t\tslotData->r = toColor(color, 0);\n\t\t\t\tslotData->g = toColor(color, 1);\n\t\t\t\tslotData->b = toColor(color, 2);\n\t\t\t\tslotData->a = toColor(color, 3);\n\t\t\t}\n\n\t\t\tattachmentItem = Json_getItem(slotMap, \"attachment\");\n\t\t\tif (attachmentItem) spSlotData_setAttachmentName(slotData, attachmentItem->valueString);\n\n\t\t\tslotData->additiveBlending = Json_getInt(slotMap, \"additive\", 0);\n\n\t\t\tskeletonData->slots[i] = slotData;\n\t\t\t++skeletonData->slotCount;\n\t\t}\n\t}\n\n\tskins = Json_getItem(root, \"skins\");\n\tif (skins) {\n\t\tJson *slotMap;\n\t\tskeletonData->skins = MALLOC(spSkin*, skins->size);\n\t\tfor (slotMap = skins->child, i = 0; slotMap; slotMap = slotMap->next, ++i) {\n\t\t\tJson *attachmentsMap;\n\t\t\tspSkin *skin = spSkin_create(slotMap->name);\n\n\t\t\tskeletonData->skins[i] = skin;\n\t\t\t++skeletonData->skinCount;\n\t\t\tif (strcmp(slotMap->name, \"default\") == 0) skeletonData->defaultSkin = skin;\n\n\t\t\tfor (attachmentsMap = slotMap->child; attachmentsMap; attachmentsMap = attachmentsMap->next) {\n\t\t\t\tint slotIndex = spSkeletonData_findSlotIndex(skeletonData, attachmentsMap->name);\n\t\t\t\tJson *attachmentMap;\n\n\t\t\t\tfor (attachmentMap = attachmentsMap->child; attachmentMap; attachmentMap = attachmentMap->next) {\n\t\t\t\t\tspAttachment* attachment;\n\t\t\t\t\tconst char* skinAttachmentName = attachmentMap->name;\n\t\t\t\t\tconst char* attachmentName = Json_getString(attachmentMap, \"name\", skinAttachmentName);\n\n\t\t\t\t\tconst char* typeString = Json_getString(attachmentMap, \"type\", \"region\");\n\t\t\t\t\tspAttachmentType type;\n\t\t\t\t\tif (strcmp(typeString, \"region\") == 0)\n\t\t\t\t\t\ttype = ATTACHMENT_REGION;\n\t\t\t\t\telse if (strcmp(typeString, \"boundingbox\") == 0)\n\t\t\t\t\t\ttype = ATTACHMENT_BOUNDING_BOX;\n\t\t\t\t\telse if (strcmp(typeString, \"regionsequence\") == 0)\n\t\t\t\t\t\ttype = ATTACHMENT_REGION_SEQUENCE;\n\t\t\t\t\telse {\n\t\t\t\t\t\tspSkeletonData_dispose(skeletonData);\n\t\t\t\t\t\t_spSkeletonJson_setError(self, root, \"Unknown attachment type: \", typeString);\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tattachment = spAttachmentLoader_newAttachment(self->attachmentLoader, skin, type, attachmentName);\n\t\t\t\t\tif (!attachment) {\n\t\t\t\t\t\tif (self->attachmentLoader->error1) {\n\t\t\t\t\t\t\tspSkeletonData_dispose(skeletonData);\n\t\t\t\t\t\t\t_spSkeletonJson_setError(self, root, self->attachmentLoader->error1, self->attachmentLoader->error2);\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (attachment->type) {\n\t\t\t\t\tcase ATTACHMENT_REGION:\n\t\t\t\t\tcase ATTACHMENT_REGION_SEQUENCE: {\n\t\t\t\t\t\tspRegionAttachment* regionAttachment = (spRegionAttachment*)attachment;\n\t\t\t\t\t\tregionAttachment->x = Json_getFloat(attachmentMap, \"x\", 0) * self->scale;\n\t\t\t\t\t\tregionAttachment->y = Json_getFloat(attachmentMap, \"y\", 0) * self->scale;\n\t\t\t\t\t\tregionAttachment->scaleX = Json_getFloat(attachmentMap, \"scaleX\", 1);\n\t\t\t\t\t\tregionAttachment->scaleY = Json_getFloat(attachmentMap, \"scaleY\", 1);\n\t\t\t\t\t\tregionAttachment->rotation = Json_getFloat(attachmentMap, \"rotation\", 0);\n\t\t\t\t\t\tregionAttachment->width = Json_getFloat(attachmentMap, \"width\", 32) * self->scale;\n\t\t\t\t\t\tregionAttachment->height = Json_getFloat(attachmentMap, \"height\", 32) * self->scale;\n\t\t\t\t\t\tspRegionAttachment_updateOffset(regionAttachment);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase ATTACHMENT_BOUNDING_BOX: {\n\t\t\t\t\t\tspBoundingBoxAttachment* box = (spBoundingBoxAttachment*)attachment;\n\t\t\t\t\t\tJson* verticesArray = Json_getItem(attachmentMap, \"vertices\");\n\t\t\t\t\t\tJson* vertex;\n\t\t\t\t\t\tint j = 0;\n\t\t\t\t\t\tbox->verticesCount = verticesArray->size;\n\t\t\t\t\t\tbox->vertices = MALLOC(float, verticesArray->size);\n\t\t\t\t\t\tfor (vertex = verticesArray->child, j = 0; vertex; vertex = vertex->next, ++j)\n\t\t\t\t\t\t\tbox->vertices[j] = vertex->valueFloat * self->scale;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tspSkin_addAttachment(skin, slotIndex, skinAttachmentName, attachment);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Events. */\n\tevents = Json_getItem(root, \"events\");\n\tif (events) {\n\t\tJson *eventMap;\n\t\tconst char* stringValue;\n\t\tskeletonData->events = MALLOC(spEventData*, events->size);\n\t\tfor (eventMap = events->child; eventMap; eventMap = eventMap->next) {\n\t\t\tspEventData* eventData = spEventData_create(eventMap->name);\n\t\t\teventData->intValue = Json_getInt(eventMap, \"int\", 0);\n\t\t\teventData->floatValue = Json_getFloat(eventMap, \"float\", 0);\n\t\t\tstringValue = Json_getString(eventMap, \"string\", 0);\n\t\t\tif (stringValue) MALLOC_STR(eventData->stringValue, stringValue);\n\t\t\tskeletonData->events[skeletonData->eventCount++] = eventData;\n\t\t}\n\t}\n\n\t/* Animations. */\n\tanimations = Json_getItem(root, \"animations\");\n\tif (animations) {\n\t\tJson *animationMap;\n\t\tskeletonData->animations = MALLOC(spAnimation*, animations->size);\n\t\tfor (animationMap = animations->child; animationMap; animationMap = animationMap->next)\n\t\t\t_spSkeletonJson_readAnimation(self, animationMap, skeletonData);\n\t}\n\n\tJson_dispose(root);\n\treturn skeletonData;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SkeletonJson.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SKELETONJSON_H_\n#define SPINE_SKELETONJSON_H_\n\n#include <spine/Attachment.h>\n#include <spine/AttachmentLoader.h>\n#include <spine/SkeletonData.h>\n#include <spine/Atlas.h>\n#include <spine/Animation.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n\tfloat scale;\n\tspAttachmentLoader* attachmentLoader;\n\tconst char* const error;\n} spSkeletonJson;\n\nspSkeletonJson* spSkeletonJson_createWithLoader (spAttachmentLoader* attachmentLoader);\nspSkeletonJson* spSkeletonJson_create (spAtlas* atlas);\nvoid spSkeletonJson_dispose (spSkeletonJson* self);\n\nspSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const char* json);\nspSkeletonData* spSkeletonJson_readSkeletonDataFile (spSkeletonJson* self, const char* path);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spSkeletonJson SkeletonJson;\n#define SkeletonJson_createWithLoader(...) spSkeletonJson_createWithLoader(__VA_ARGS__)\n#define SkeletonJson_create(...) spSkeletonJson_create(__VA_ARGS__)\n#define SkeletonJson_dispose(...) spSkeletonJson_dispose(__VA_ARGS__)\n#define SkeletonJson_readSkeletonData(...) spSkeletonJson_readSkeletonData(__VA_ARGS__)\n#define SkeletonJson_readSkeletonDataFile(...) spSkeletonJson_readSkeletonDataFile(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_SKELETONJSON_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Skin.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Skin.h>\n#include <spine/extension.h>\n\ntypedef struct _Entry _Entry;\nstruct _Entry {\n\tint slotIndex;\n\tconst char* name;\n\tspAttachment* attachment;\n\t_Entry* next;\n};\n\n_Entry* _Entry_create (int slotIndex, const char* name, spAttachment* attachment) {\n\t_Entry* self = NEW(_Entry);\n\tself->slotIndex = slotIndex;\n\tMALLOC_STR(self->name, name);\n\tself->attachment = attachment;\n\treturn self;\n}\n\nvoid _Entry_dispose (_Entry* self) {\n\tspAttachment_dispose(self->attachment);\n\tFREE(self->name);\n\tFREE(self);\n}\n\n/**/\n\ntypedef struct {\n\tspSkin super;\n\t_Entry* entries;\n} _spSkin;\n\nspSkin* spSkin_create (const char* name) {\n\tspSkin* self = SUPER(NEW(_spSkin));\n\tMALLOC_STR(self->name, name);\n\treturn self;\n}\n\nvoid spSkin_dispose (spSkin* self) {\n\t_Entry* entry = SUB_CAST(_spSkin, self)->entries;\n\twhile (entry) {\n\t\t_Entry* nextEntry = entry->next;\n\t\t_Entry_dispose(entry);\n\t\tentry = nextEntry;\n\t}\n\n\tFREE(self->name);\n\tFREE(self);\n}\n\nvoid spSkin_addAttachment (spSkin* self, int slotIndex, const char* name, spAttachment* attachment) {\n\t_Entry* newEntry = _Entry_create(slotIndex, name, attachment);\n\tnewEntry->next = SUB_CAST(_spSkin, self)->entries;\n\tSUB_CAST(_spSkin, self)->entries = newEntry;\n}\n\nspAttachment* spSkin_getAttachment (const spSkin* self, int slotIndex, const char* name) {\n\tconst _Entry* entry = SUB_CAST(_spSkin, self)->entries;\n\twhile (entry) {\n\t\tif (entry->slotIndex == slotIndex && strcmp(entry->name, name) == 0) return entry->attachment;\n\t\tentry = entry->next;\n\t}\n\treturn 0;\n}\n\nconst char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex) {\n\tconst _Entry* entry = SUB_CAST(_spSkin, self)->entries;\n\tint i = 0;\n\twhile (entry) {\n\t\tif (entry->slotIndex == slotIndex) {\n\t\t\tif (i == attachmentIndex) return entry->name;\n\t\t\ti++;\n\t\t}\n\t\tentry = entry->next;\n\t}\n\treturn 0;\n}\n\nvoid spSkin_attachAll (const spSkin* self, spSkeleton* skeleton, const spSkin* oldSkin) {\n\tconst _Entry *entry = SUB_CAST(_spSkin, oldSkin)->entries;\n\twhile (entry) {\n\t\tspSlot *slot = skeleton->slots[entry->slotIndex];\n\t\tif (slot->attachment == entry->attachment) {\n\t\t\tspAttachment *attachment = spSkin_getAttachment(self, entry->slotIndex, entry->name);\n\t\t\tif (attachment) spSlot_setAttachment(slot, attachment);\n\t\t}\n\t\tentry = entry->next;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Skin.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SKIN_H_\n#define SPINE_SKIN_H_\n\n#include <spine/Attachment.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct spSkeleton;\n\ntypedef struct {\n\tconst char* const name;\n} spSkin;\n\nspSkin* spSkin_create (const char* name);\nvoid spSkin_dispose (spSkin* self);\n\n/* The Skin owns the attachment. */\nvoid spSkin_addAttachment (spSkin* self, int slotIndex, const char* name, spAttachment* attachment);\n/* Returns 0 if the attachment was not found. */\nspAttachment* spSkin_getAttachment (const spSkin* self, int slotIndex, const char* name);\n\n/* Returns 0 if the slot or attachment was not found. */\nconst char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex);\n\n/** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */\nvoid spSkin_attachAll (const spSkin* self, struct spSkeleton* skeleton, const spSkin* oldspSkin);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spSkin Skin;\n#define Skin_create(...) spSkin_create(__VA_ARGS__)\n#define Skin_dispose(...) spSkin_dispose(__VA_ARGS__)\n#define Skin_addAttachment(...) spSkin_addAttachment(__VA_ARGS__)\n#define Skin_getAttachment(...) spSkin_getAttachment(__VA_ARGS__)\n#define Skin_getAttachmentName(...) spSkin_getAttachmentName(__VA_ARGS__)\n#define Skin_attachAll(...) spSkin_attachAll(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_SKIN_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Slot.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/Slot.h>\n#include <spine/extension.h>\n#include <spine/Skeleton.h>\n\ntypedef struct {\n\tspSlot super;\n\tfloat attachmentTime;\n} _spSlot;\n\nspSlot* spSlot_create (spSlotData* data, spSkeleton* skeleton, spBone* bone) {\n\tspSlot* self = SUPER(NEW(_spSlot));\n\tCONST_CAST(spSlotData*, self->data) = data;\n\tCONST_CAST(spSkeleton*, self->skeleton) = skeleton;\n\tCONST_CAST(spBone*, self->bone) = bone;\n\tspSlot_setToSetupPose(self);\n\treturn self;\n}\n\nvoid spSlot_dispose (spSlot* self) {\n\tFREE(self);\n}\n\nvoid spSlot_setAttachment (spSlot* self, spAttachment* attachment) {\n\tCONST_CAST(spAttachment*, self->attachment) = attachment;\n\tSUB_CAST(_spSlot, self) ->attachmentTime = self->skeleton->time;\n}\n\nvoid spSlot_setAttachmentTime (spSlot* self, float time) {\n\tSUB_CAST(_spSlot, self) ->attachmentTime = self->skeleton->time - time;\n}\n\nfloat spSlot_getAttachmentTime (const spSlot* self) {\n\treturn self->skeleton->time - SUB_CAST(_spSlot, self) ->attachmentTime;\n}\n\nvoid spSlot_setToSetupPose (spSlot* self) {\n\tspAttachment* attachment = 0;\n\tself->r = self->data->r;\n\tself->g = self->data->g;\n\tself->b = self->data->b;\n\tself->a = self->data->a;\n\n\tif (self->data->attachmentName) {\n\t\t/* Find slot index. */\n\t\tint i;\n\t\tfor (i = 0; i < self->skeleton->data->slotCount; ++i) {\n\t\t\tif (self->data == self->skeleton->data->slots[i]) {\n\t\t\t\tattachment = spSkeleton_getAttachmentForSlotIndex(self->skeleton, i, self->data->attachmentName);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tspSlot_setAttachment(self, attachment);\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/Slot.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SLOT_H_\n#define SPINE_SLOT_H_\n\n#include <spine/Bone.h>\n#include <spine/Attachment.h>\n#include <spine/SlotData.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct spSkeleton;\n\ntypedef struct spSlot {\n\tspSlotData* const data;\n\tstruct spSkeleton* const skeleton;\n\tspBone* const bone;\n\tfloat r, g, b, a;\n\tspAttachment* const attachment;\n} spSlot;\n\nspSlot* spSlot_create (spSlotData* data, struct spSkeleton* skeleton, spBone* bone);\nvoid spSlot_dispose (spSlot* self);\n\n/* @param attachment May be 0 to clear the attachment for the slot. */\nvoid spSlot_setAttachment (spSlot* self, spAttachment* attachment);\n\nvoid spSlot_setAttachmentTime (spSlot* self, float time);\nfloat spSlot_getAttachmentTime (const spSlot* self);\n\nvoid spSlot_setToSetupPose (spSlot* self);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spSlot Slot;\n#define Slot_create(...) spSlot_create(__VA_ARGS__)\n#define Slot_dispose(...) spSlot_dispose(__VA_ARGS__)\n#define Slot_setAttachment(...) spSlot_setAttachment(__VA_ARGS__)\n#define Slot_setAttachmentTime(...) spSlot_setAttachmentTime(__VA_ARGS__)\n#define Slot_getAttachmentTime(...) spSlot_getAttachmentTime(__VA_ARGS__)\n#define Slot_setToSetupPose(...) spSlot_setToSetupPose(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_SLOT_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SlotData.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/SlotData.h>\n#include <spine/extension.h>\n\nspSlotData* spSlotData_create (const char* name, spBoneData* boneData) {\n\tspSlotData* self = NEW(spSlotData);\n\tMALLOC_STR(self->name, name);\n\tCONST_CAST(spBoneData*, self->boneData) = boneData;\n\tself->r = 1;\n\tself->g = 1;\n\tself->b = 1;\n\tself->a = 1;\n\treturn self;\n}\n\nvoid spSlotData_dispose (spSlotData* self) {\n\tFREE(self->name);\n\tFREE(self->attachmentName);\n\tFREE(self);\n}\n\nvoid spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName) {\n\tFREE(self->attachmentName);\n\tif (attachmentName)\n\t\tMALLOC_STR(self->attachmentName, attachmentName);\n\telse\n\t\tCONST_CAST(char*, self->attachmentName) = 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/SlotData.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SLOTDATA_H_\n#define SPINE_SLOTDATA_H_\n\n#include <spine/BoneData.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n\tconst char* const name;\n\tconst spBoneData* const boneData;\n\tconst char* const attachmentName;\n\tfloat r, g, b, a;\n\tint/*bool*/additiveBlending;\n} spSlotData;\n\nspSlotData* spSlotData_create (const char* name, spBoneData* boneData);\nvoid spSlotData_dispose (spSlotData* self);\n\n/* @param attachmentName May be 0 for no setup pose attachment. */\nvoid spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName);\n\n#ifdef SPINE_SHORT_NAMES\ntypedef spSlotData SlotData;\n#define SlotData_create(...) spSlotData_create(__VA_ARGS__)\n#define SlotData_dispose(...) spSlotData_dispose(__VA_ARGS__)\n#define SlotData_setAttachmentName(...) spSlotData_setAttachmentName(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_SLOTDATA_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/extension.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/extension.h>\n#include <stdio.h>\n\nstatic void* (*mallocFunc) (size_t size) = malloc;\nstatic void (*freeFunc) (void* ptr) = free;\n\nvoid* _malloc (size_t size) {\n\treturn mallocFunc(size);\n}\nvoid* _calloc (size_t num, size_t size) {\n\tvoid* ptr = mallocFunc(num * size);\n\tif (ptr) memset(ptr, 0, num * size);\n\treturn ptr;\n}\nvoid _free (void* ptr) {\n\tfreeFunc(ptr);\n}\n\nvoid _setMalloc (void* (*malloc) (size_t size)) {\n\tmallocFunc = malloc;\n}\nvoid _setFree (void (*free) (void* ptr)) {\n\tfreeFunc = free;\n}\n\nchar* _readFile (const char* path, int* length) {\n\tchar *data;\n\tFILE *file = fopen(path, \"rb\");\n\tif (!file) return 0;\n\n\tfseek(file, 0, SEEK_END);\n\t*length = (int)ftell(file);\n\tfseek(file, 0, SEEK_SET);\n\n\tdata = MALLOC(char, *length);\n\tfread(data, 1, *length, file);\n\tfclose(file);\n\n\treturn data;\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/extension.h",
    "content": "/*\n Implementation notes:\n\n - An OOP style is used where each \"class\" is made up of a struct and a number of functions prefixed with the struct name.\n\n - struct fields that are const are readonly. Either they are set in a create function and can never be changed, or they can only\n be changed by calling a function.\n\n - Inheritance is done using a struct field named \"super\" as the first field, allowing the struct to be cast to its \"super class\".\n This works because a pointer to a struct is guaranteed to be a pointer to the first struct field.\n\n - Classes intended for inheritance provide init/deinit functions which subclasses must call in their create/dispose functions.\n\n - Polymorphism is done by a base class providing function pointers in its init function. The public API delegates to this\n function.\n\n - Subclasses do not provide a dispose function, instead the base class' dispose function should be used, which will delegate to\n a dispose function pointer.\n\n - Classes not designed for inheritance cannot be extended because they may use an internal subclass to hide private data and don't\n expose function pointers.\n\n - The public API hides implementation details, such as init/deinit functions. An internal API is exposed by extension.h to allow\n classes to be extended. Internal functions begin with underscore (_).\n\n - OOP in C tends to lose type safety. Macros for casting are provided in extension.h to give context for why a cast is being done.\n\n - If SPINE_SHORT_NAMES is defined, the \"sp\" prefix for all class names is optional.\n */\n\n#ifndef SPINE_EXTENSION_H_\n#define SPINE_EXTENSION_H_\n\n/* All allocation uses these. */\n#define MALLOC(TYPE,COUNT) ((TYPE*)_malloc(sizeof(TYPE) * COUNT))\n#define CALLOC(TYPE,COUNT) ((TYPE*)_calloc(COUNT, sizeof(TYPE)))\n#define NEW(TYPE) CALLOC(TYPE,1)\n\n/* Gets the direct super class. Type safe. */\n#define SUPER(VALUE) (&VALUE->super)\n\n/* Cast to a super class. Not type safe, use with care. Prefer SUPER() where possible. */\n#define SUPER_CAST(TYPE,VALUE) ((TYPE*)VALUE)\n\n/* Cast to a sub class. Not type safe, use with care. */\n#define SUB_CAST(TYPE,VALUE) ((TYPE*)VALUE)\n\n/* Casts away const. Can be used as an lvalue. Not type safe, use with care. */\n#define CONST_CAST(TYPE,VALUE) (*(TYPE*)&VALUE)\n\n/* Gets the vtable for the specified type. Not type safe, use with care. */\n#define VTABLE(TYPE,VALUE) ((_##TYPE##Vtable*)((TYPE*)VALUE)->vtable)\n\n/* Frees memory. Can be used on const types. */\n#define FREE(VALUE) _free((void*)VALUE)\n\n/* Allocates a new char[], assigns it to TO, and copies FROM to it. Can be used on const types. */\n#define MALLOC_STR(TO,FROM) strcpy(CONST_CAST(char*, TO) = (char*)malloc(strlen(FROM) + 1), FROM)\n\n#ifdef __STDC_VERSION__\n#define FMOD(A,B) fmodf(A, B)\n#else\n#define FMOD(A,B) (float)fmod(A, B)\n#endif\n\n#include <stdlib.h>\n#include <string.h>\n#include <math.h>\n#include <spine/Skeleton.h>\n#include <spine/RegionAttachment.h>\n#include <spine/BoundingBoxAttachment.h>\n#include <spine/Animation.h>\n#include <spine/Atlas.h>\n#include <spine/AttachmentLoader.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Functions that must be implemented:\n */\n\nvoid _spAtlasPage_createTexture (spAtlasPage* self, const char* path);\nvoid _spAtlasPage_disposeTexture (spAtlasPage* self);\nchar* _spUtil_readFile (const char* path, int* length);\n\n#ifdef SPINE_SHORT_NAMES\n#define _AtlasPage_createTexture(...) _spAtlasPage_createTexture(__VA_ARGS__)\n#define _AtlasPage_disposeTexture(...) _spAtlasPage_disposeTexture(__VA_ARGS__)\n#define _Util_readFile(...) _spUtil_readFile(__VA_ARGS__)\n#endif\n\n/*\n * Internal API available for extension:\n */\n\nvoid* _malloc (size_t size);\nvoid* _calloc (size_t num, size_t size);\nvoid _free (void* ptr);\n\nvoid _setMalloc (void* (*_malloc) (size_t size));\nvoid _setFree (void (*_free) (void* ptr));\n\nchar* _readFile (const char* path, int* length);\n\n/**/\n\nvoid _spAttachmentLoader_init (spAttachmentLoader* self, /**/\nvoid (*dispose) (spAttachmentLoader* self), /**/\nspAttachment* (*newAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name));\nvoid _spAttachmentLoader_deinit (spAttachmentLoader* self);\nvoid _spAttachmentLoader_setError (spAttachmentLoader* self, const char* error1, const char* error2);\nvoid _spAttachmentLoader_setUnknownTypeError (spAttachmentLoader* self, spAttachmentType type);\n\n#ifdef SPINE_SHORT_NAMES\n#define _AttachmentLoader_init(...) _spAttachmentLoader_init(__VA_ARGS__)\n#define _AttachmentLoader_deinit(...) _spAttachmentLoader_deinit(__VA_ARGS__)\n#define _AttachmentLoader_setError(...) _spAttachmentLoader_setError(__VA_ARGS__)\n#define _AttachmentLoader_setUnknownTypeError(...) _spAttachmentLoader_setUnknownTypeError(__VA_ARGS__)\n#endif\n\n/**/\n\nvoid _spAttachment_init (spAttachment* self, const char* name, spAttachmentType type, /**/\nvoid (*dispose) (spAttachment* self));\nvoid _spAttachment_deinit (spAttachment* self);\n\n#ifdef SPINE_SHORT_NAMES\n#define _Attachment_init(...) _spAttachment_init(__VA_ARGS__)\n#define _Attachment_deinit(...) _spAttachment_deinit(__VA_ARGS__)\n#endif\n\n/**/\n\nvoid _spTimeline_init (spTimeline* self, spTimelineType type, /**/\nvoid (*dispose) (spTimeline* self), /**/\n\t\tvoid (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\t\t\tint* eventCount, float alpha));\nvoid _spTimeline_deinit (spTimeline* self);\n\n#ifdef SPINE_SHORT_NAMES\n#define _Timeline_init(...) _spTimeline_init(__VA_ARGS__)\n#define _Timeline_deinit(...) _spTimeline_deinit(__VA_ARGS__)\n#endif\n\n/**/\n\nvoid _spCurveTimeline_init (spCurveTimeline* self, spTimelineType type, int frameCount, /**/\nvoid (*dispose) (spTimeline* self), /**/\n\t\tvoid (*apply) (const spTimeline* self, spSkeleton* skeleton, float lastTime, float time, spEvent** firedEvents,\n\t\t\t\tint* eventCount, float alpha));\nvoid _spCurveTimeline_deinit (spCurveTimeline* self);\n\n#ifdef SPINE_SHORT_NAMES\n#define _CurveTimeline_init(...) _spCurveTimeline_init(__VA_ARGS__)\n#define _CurveTimeline_deinit(...) _spCurveTimeline_deinit(__VA_ARGS__)\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SPINE_EXTENSION_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/proj.win32/libSpine.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\Animation.h\" />\n    <ClInclude Include=\"..\\AnimationState.h\" />\n    <ClInclude Include=\"..\\AnimationStateData.h\" />\n    <ClInclude Include=\"..\\Atlas.h\" />\n    <ClInclude Include=\"..\\AtlasAttachmentLoader.h\" />\n    <ClInclude Include=\"..\\Attachment.h\" />\n    <ClInclude Include=\"..\\AttachmentLoader.h\" />\n    <ClInclude Include=\"..\\Bone.h\" />\n    <ClInclude Include=\"..\\BoneData.h\" />\n    <ClInclude Include=\"..\\BoundingBoxAttachment.h\" />\n    <ClInclude Include=\"..\\CCSkeleton.h\" />\n    <ClInclude Include=\"..\\CCSkeletonAnimation.h\" />\n    <ClInclude Include=\"..\\extension.h\" />\n    <ClInclude Include=\"..\\Event.h\" />\n    <ClInclude Include=\"..\\EventData.h\" />\n    <ClInclude Include=\"..\\Json.h\" />\n    <ClInclude Include=\"..\\RegionAttachment.h\" />\n    <ClInclude Include=\"..\\Skeleton.h\" />\n    <ClInclude Include=\"..\\SkeletonBounds.h\" />\n    <ClInclude Include=\"..\\SkeletonData.h\" />\n    <ClInclude Include=\"..\\SkeletonJson.h\" />\n    <ClInclude Include=\"..\\Skin.h\" />\n    <ClInclude Include=\"..\\Slot.h\" />\n    <ClInclude Include=\"..\\SlotData.h\" />\n    <ClInclude Include=\"..\\spine-cocos2dx.h\" />\n    <ClInclude Include=\"..\\spine.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\Animation.cpp\" />\n    <ClCompile Include=\"..\\AnimationState.cpp\" />\n    <ClCompile Include=\"..\\AnimationStateData.cpp\" />\n    <ClCompile Include=\"..\\Atlas.cpp\" />\n    <ClCompile Include=\"..\\AtlasAttachmentLoader.cpp\" />\n    <ClCompile Include=\"..\\Attachment.cpp\" />\n    <ClCompile Include=\"..\\AttachmentLoader.cpp\" />\n    <ClCompile Include=\"..\\Bone.cpp\" />\n    <ClCompile Include=\"..\\BoneData.cpp\" />\n    <ClCompile Include=\"..\\BoundingBoxAttachment.cpp\" />\n    <ClCompile Include=\"..\\CCSkeleton.cpp\" />\n    <ClCompile Include=\"..\\CCSkeletonAnimation.cpp\" />\n    <ClCompile Include=\"..\\extension.cpp\" />\n    <ClCompile Include=\"..\\Event.cpp\" />\n    <ClCompile Include=\"..\\EventData.cpp\" />\n    <ClCompile Include=\"..\\Json.cpp\" />\n    <ClCompile Include=\"..\\RegionAttachment.cpp\" />\n    <ClCompile Include=\"..\\Skeleton.cpp\" />\n    <ClCompile Include=\"..\\SkeletonBounds.cpp\" />\n    <ClCompile Include=\"..\\SkeletonData.cpp\" />\n    <ClCompile Include=\"..\\SkeletonJson.cpp\" />\n    <ClCompile Include=\"..\\Skin.cpp\" />\n    <ClCompile Include=\"..\\Slot.cpp\" />\n    <ClCompile Include=\"..\\SlotData.cpp\" />\n    <ClCompile Include=\"..\\spine-cocos2dx.cpp\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}</ProjectGuid>\n    <RootNamespace>libSpine</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>\n      </SDLCheck>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>\n      </SDLCheck>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\editor-support;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/proj.win32/libSpine.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\SlotData.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\spine.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\spine-cocos2dx.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Animation.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\AnimationState.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\AnimationStateData.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Atlas.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\AtlasAttachmentLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Attachment.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\AttachmentLoader.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Bone.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\BoneData.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\BoundingBoxAttachment.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Event.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\EventData.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCSkeleton.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CCSkeletonAnimation.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\extension.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Json.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\RegionAttachment.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Skeleton.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\SkeletonData.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\SkeletonBounds.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\SkeletonJson.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Skin.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Slot.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\Skeleton.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\SkeletonBounds.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\SkeletonData.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\SkeletonJson.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Skin.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Slot.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\SlotData.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\spine-cocos2dx.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Animation.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\AnimationState.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\AnimationStateData.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Atlas.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\AtlasAttachmentLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Attachment.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\AttachmentLoader.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Bone.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\BoundingBoxAttachment.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Event.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\EventData.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCSkeleton.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CCSkeletonAnimation.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\extension.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Json.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\RegionAttachment.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/spine-cocos2dx.cpp",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#include <spine/spine-cocos2dx.h>\n#include <spine/extension.h>\n\nUSING_NS_CC;\n\nvoid _spAtlasPage_createTexture (spAtlasPage* self, const char* path) {\n    Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path);\n    TextureAtlas* textureAtlas = TextureAtlas::createWithTexture(texture, 4);\n    textureAtlas->retain();\n    self->rendererObject = textureAtlas;\n    // Using getContentSize to make it supports the strategy of loading resources in cocos2d-x.\n    // self->width = texture->getPixelsWide();\n    // self->height = texture->getPixelsHigh();\n    self->width = texture->getContentSize().width;\n    self->height = texture->getContentSize().height;\n}\n\nvoid _spAtlasPage_disposeTexture (spAtlasPage* self) {\n\t((TextureAtlas*)self->rendererObject)->release();\n}\n\nchar* _spUtil_readFile (const char* path, int* length)\n{\n    char* ret = nullptr;\n    int size = 0;\n    Data data = FileUtils::getInstance()->getDataFromFile(path);\n    \n    if (!data.isNull())\n    {\n        size = static_cast<int>(data.getSize());\n        *length = size;\n        // Allocates one more byte for string terminal, it will be safe when parsing JSON file in Spine runtime.\n        ret = (char*)malloc(size + 1);\n        ret[size] = '\\0';\n        memcpy(ret, data.getBytes(), size);\n    }\n    \n    return ret;\n}\n\n/**/\n\nvoid spRegionAttachment_updateQuad (spRegionAttachment* self, spSlot* slot, V3F_C4B_T2F_Quad* quad, bool premultipliedAlpha) {\n\tfloat vertices[8];\n\tspRegionAttachment_computeWorldVertices(self, slot->skeleton->x, slot->skeleton->y, slot->bone, vertices);\n\n\tGLubyte r = slot->skeleton->r * slot->r * 255;\n\tGLubyte g = slot->skeleton->g * slot->g * 255;\n\tGLubyte b = slot->skeleton->b * slot->b * 255;\n\tfloat normalizedAlpha = slot->skeleton->a * slot->a;\n\tif (premultipliedAlpha) {\n\t\tr *= normalizedAlpha;\n\t\tg *= normalizedAlpha;\n\t\tb *= normalizedAlpha;\n\t}\n\tGLubyte a = normalizedAlpha * 255;\n\tquad->bl.colors.r = r;\n\tquad->bl.colors.g = g;\n\tquad->bl.colors.b = b;\n\tquad->bl.colors.a = a;\n\tquad->tl.colors.r = r;\n\tquad->tl.colors.g = g;\n\tquad->tl.colors.b = b;\n\tquad->tl.colors.a = a;\n\tquad->tr.colors.r = r;\n\tquad->tr.colors.g = g;\n\tquad->tr.colors.b = b;\n\tquad->tr.colors.a = a;\n\tquad->br.colors.r = r;\n\tquad->br.colors.g = g;\n\tquad->br.colors.b = b;\n\tquad->br.colors.a = a;\n\n\tquad->bl.vertices.x = vertices[VERTEX_X1];\n\tquad->bl.vertices.y = vertices[VERTEX_Y1];\n\tquad->tl.vertices.x = vertices[VERTEX_X2];\n\tquad->tl.vertices.y = vertices[VERTEX_Y2];\n\tquad->tr.vertices.x = vertices[VERTEX_X3];\n\tquad->tr.vertices.y = vertices[VERTEX_Y3];\n\tquad->br.vertices.x = vertices[VERTEX_X4];\n\tquad->br.vertices.y = vertices[VERTEX_Y4];\n\n\tquad->bl.texCoords.u = self->uvs[VERTEX_X1];\n\tquad->bl.texCoords.v = self->uvs[VERTEX_Y1];\n\tquad->tl.texCoords.u = self->uvs[VERTEX_X2];\n\tquad->tl.texCoords.v = self->uvs[VERTEX_Y2];\n\tquad->tr.texCoords.u = self->uvs[VERTEX_X3];\n\tquad->tr.texCoords.v = self->uvs[VERTEX_Y3];\n\tquad->br.texCoords.u = self->uvs[VERTEX_X4];\n\tquad->br.texCoords.v = self->uvs[VERTEX_Y4];\n}\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/spine-cocos2dx.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_COCOS2DX_H_\n#define SPINE_COCOS2DX_H_\n\n#include <spine/spine.h>\n#include \"cocos2d.h\"\n#include <spine/CCSkeleton.h>\n#include <spine/CCSkeletonAnimation.h>\n\nvoid spRegionAttachment_updateQuad (spRegionAttachment* self, spSlot* slot, cocos2d::V3F_C4B_T2F_Quad* quad, bool premultiplied = false);\n\n#endif /* SPINE_COCOS2DX_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/editor-support/spine/spine.h",
    "content": "/******************************************************************************\n * Spine Runtime Software License - Version 1.1\n * \n * Copyright (c) 2013, Esoteric Software\n * All rights reserved.\n * \n * Redistribution and use in source and binary forms in whole or in part, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n * \n * 1. A Spine Essential, Professional, Enterprise, or Education License must\n *    be purchased from Esoteric Software and the license must remain valid:\n *    http://esotericsoftware.com/\n * 2. Redistributions of source code must retain this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer.\n * 3. Redistributions in binary form must reproduce this license, which is the\n *    above copyright notice, this declaration of conditions and the following\n *    disclaimer, in the documentation and/or other materials provided with the\n *    distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n#ifndef SPINE_SPINE_H_\n#define SPINE_SPINE_H_\n\n#include <spine/Animation.h>\n#include <spine/AnimationState.h>\n#include <spine/AnimationStateData.h>\n#include <spine/Atlas.h>\n#include <spine/AtlasAttachmentLoader.h>\n#include <spine/Attachment.h>\n#include <spine/AttachmentLoader.h>\n#include <spine/Bone.h>\n#include <spine/BoneData.h>\n#include <spine/RegionAttachment.h>\n#include <spine/BoundingBoxAttachment.h>\n#include <spine/Skeleton.h>\n#include <spine/SkeletonBounds.h>\n#include <spine/SkeletonData.h>\n#include <spine/SkeletonJson.h>\n#include <spine/Skin.h>\n#include <spine/Slot.h>\n#include <spine/SlotData.h>\n#include <spine/Event.h>\n#include <spine/EventData.h>\n\n#endif /* SPINE_SPINE_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/gui/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos_gui_static\n\nLOCAL_MODULE_FILENAME := libgui\n\nLOCAL_SRC_FILES := \\\nUIWidget.cpp \\\nUILayout.cpp \\\nUILayoutParameter.cpp \\\nUILayoutDefine.cpp \\\nCocosGUI.cpp \\\nUIHelper.cpp \\\nUIListView.cpp \\\nUIPageView.cpp \\\nUIScrollView.cpp \\\nUIButton.cpp \\\nUICheckBox.cpp \\\nUIImageView.cpp \\\nUIText.cpp \\\nUITextAtlas.cpp \\\nUITextBMFont.cpp \\\nUILoadingBar.cpp \\\nUISlider.cpp \\\nUITextField.cpp\n\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \\\n$(LOCAL_PATH)/../editor-support\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../2d \\\n$(LOCAL_PATH)/../../external \\\n$(LOCAL_PATH)/.. \\\n$(LOCAL_PATH)/../.. \\\n$(LOCAL_PATH)/../editor-support\n\nLOCAL_CFLAGS += -Wno-psabi\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,extensions)\n$(call import-module,2d)\n"
  },
  {
    "path": "cocos2d/cocos/gui/CMakeLists.txt",
    "content": "set(GUI_SRC\n  UIWidget.cpp\n  UILayout.cpp\n  UILayoutParameter.cpp\n  UILayoutDefine.cpp\n  CocosGUI.cpp\n  UIHelper.cpp\n  UIListView.cpp\n  UIPageView.cpp\n  UIScrollView.cpp\n  UIButton.cpp\n  UICheckBox.cpp\n  UIImageView.cpp\n  UIText.cpp\n  UITextAtlas.cpp\n  UITextBMFont.cpp\n  UILoadingBar.cpp\n  UISlider.cpp\n  UITextField.cpp\n)\n\nadd_library(gui STATIC\n  ${GUI_SRC}\n)\n\nset_target_properties(gui\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n"
  },
  {
    "path": "cocos2d/cocos/gui/CocosGUI.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/CocosGUI.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nconst char* CocosGUIVersion()\n{\n    return \"CocosGUI v1.0.0.0\";\n}\n\n}\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/gui/CocosGUI.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __COCOSGUI_H__\n#define __COCOSGUI_H__\n\n\n#include \"gui/UIWidget.h\"\n#include \"gui/UILayout.h\"\n#include \"gui/UIButton.h\"\n#include \"gui/UICheckBox.h\"\n#include \"gui/UIImageView.h\"\n#include \"gui/UIText.h\"\n#include \"gui/UITextAtlas.h\"\n#include \"gui/UILoadingBar.h\"\n#include \"gui/UIScrollView.h\"\n#include \"gui/UIListView.h\"\n#include \"gui/UISlider.h\"\n#include \"gui/UITextField.h\"\n#include \"gui/UITextBMFont.h\"\n#include \"gui/UIPageView.h\"\n#include \"gui/UIHelper.h\"\n\nNS_CC_BEGIN\nnamespace gui {\n\nconst char* CocosGUIVersion();\n\n}\nNS_CC_END\n\n#endif /* defined(__CocosGUITest__Cocos__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIButton.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UIButton.h\"\n#include \"extensions/GUI/CCControlExtension/CCScale9Sprite.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nstatic const int NORMAL_RENDERER_Z = (-2);\nstatic const int PRESSED_RENDERER_Z = (-2);\nstatic const int DISABLED_RENDERER_Z = (-2);\nstatic const int TITLE_RENDERER_Z = (-1);\n    \nButton::Button():\n_buttonNormalRenderer(nullptr),\n_buttonClickedRenderer(nullptr),\n_buttonDisableRenderer(nullptr),\n_titleRenderer(nullptr),\n_normalFileName(\"\"),\n_clickedFileName(\"\"),\n_disabledFileName(\"\"),\n_prevIgnoreSize(true),\n_scale9Enabled(false),\n_capInsetsNormal(Rect::ZERO),\n_capInsetsPressed(Rect::ZERO),\n_capInsetsDisabled(Rect::ZERO),\n_normalTexType(UI_TEX_TYPE_LOCAL),\n_pressedTexType(UI_TEX_TYPE_LOCAL),\n_disabledTexType(UI_TEX_TYPE_LOCAL),\n_normalTextureSize(_size),\n_pressedTextureSize(_size),\n_disabledTextureSize(_size),\n_pressedActionEnabled(false),\n_titleColor(Color3B::WHITE),\n_normalTextureScaleXInSize(1.0f),\n_normalTextureScaleYInSize(1.0f),\n_pressedTextureScaleXInSize(1.0f),\n_pressedTextureScaleYInSize(1.0f),\n_normalTextureLoaded(false),\n_pressedTextureLoaded(false),\n_disabledTextureLoaded(false)\n{\n    \n}\n\nButton::~Button()\n{\n}\n\nButton* Button::create()\n{\n    Button* widget = new Button();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nbool Button::init()\n{\n    if (Widget::init())\n    {\n        return true;\n    }\n    return false;\n}\n\nvoid Button::initRenderer()\n{\n    _buttonNormalRenderer = Sprite::create();\n    _buttonClickedRenderer = Sprite::create();\n    _buttonDisableRenderer = Sprite::create();\n    _titleRenderer = LabelTTF::create();\n    \n    Node::addChild(_buttonNormalRenderer, NORMAL_RENDERER_Z, -1);\n    Node::addChild(_buttonClickedRenderer, PRESSED_RENDERER_Z, -1);\n    Node::addChild(_buttonDisableRenderer, DISABLED_RENDERER_Z, -1);\n    Node::addChild(_titleRenderer, TITLE_RENDERER_Z, -1);\n}\n\nvoid Button::setScale9Enabled(bool able)\n{\n    if (_scale9Enabled == able)\n    {\n        return;\n    }\n    _brightStyle = BRIGHT_NONE;\n    _scale9Enabled = able;\n    Node::removeChild(_buttonNormalRenderer);\n    Node::removeChild(_buttonClickedRenderer);\n    Node::removeChild(_buttonDisableRenderer);\n    _buttonNormalRenderer = nullptr;\n    _buttonClickedRenderer = nullptr;\n    _buttonDisableRenderer = nullptr;\n    if (_scale9Enabled)\n    {\n        _buttonNormalRenderer = extension::Scale9Sprite::create();\n        _buttonClickedRenderer = extension::Scale9Sprite::create();\n        _buttonDisableRenderer = extension::Scale9Sprite::create();\n    }\n    else\n    {\n        _buttonNormalRenderer = Sprite::create();\n        _buttonClickedRenderer = Sprite::create();\n        _buttonDisableRenderer = Sprite::create();\n    }\n\n    loadTextureNormal(_normalFileName.c_str(), _normalTexType);\n    loadTexturePressed(_clickedFileName.c_str(), _pressedTexType);\n    loadTextureDisabled(_disabledFileName.c_str(), _disabledTexType);\n    Node::addChild(_buttonNormalRenderer, NORMAL_RENDERER_Z, -1);\n    Node::addChild(_buttonClickedRenderer, PRESSED_RENDERER_Z, -1);\n    Node::addChild(_buttonDisableRenderer, DISABLED_RENDERER_Z, -1);\n    if (_scale9Enabled)\n    {\n        bool ignoreBefore = _ignoreSize;\n        ignoreContentAdaptWithSize(false);\n        _prevIgnoreSize = ignoreBefore;\n    }\n    else\n    {\n        ignoreContentAdaptWithSize(_prevIgnoreSize);\n    }\n    setCapInsetsNormalRenderer(_capInsetsNormal);\n    setCapInsetsPressedRenderer(_capInsetsPressed);\n    setCapInsetsDisabledRenderer(_capInsetsDisabled);\n    setBright(_bright);\n}\n\nvoid Button::ignoreContentAdaptWithSize(bool ignore)\n{\n    if (!_scale9Enabled || (_scale9Enabled && !ignore))\n    {\n        Widget::ignoreContentAdaptWithSize(ignore);\n        _prevIgnoreSize = ignore;\n    }\n}\n\nvoid Button::loadTextures(const char* normal,const char* selected,const char* disabled,TextureResType texType)\n{\n    loadTextureNormal(normal,texType);\n    loadTexturePressed(selected,texType);\n    loadTextureDisabled(disabled,texType);\n}\n\nvoid Button::loadTextureNormal(const char* normal,TextureResType texType)\n{\n    if (!normal || strcmp(normal, \"\") == 0)\n    {\n        return;\n    }\n    _normalFileName = normal;\n    _normalTexType = texType;\n    if (_scale9Enabled)\n    {\n        extension::Scale9Sprite* normalRendererScale9 = static_cast<extension::Scale9Sprite*>(_buttonNormalRenderer);\n        switch (_normalTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                normalRendererScale9->initWithFile(normal);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                normalRendererScale9->initWithSpriteFrameName(normal);\n                break;\n            default:\n                break;\n        }\n        normalRendererScale9->setCapInsets(_capInsetsNormal);\n    }\n    else\n    {\n        Sprite* normalRenderer = static_cast<Sprite*>(_buttonNormalRenderer);\n        switch (_normalTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                normalRenderer->setTexture(normal);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                normalRenderer->setSpriteFrame(normal);\n                break;\n            default:\n                break;\n        }\n    }\n    _normalTextureSize = _buttonNormalRenderer->getContentSize();\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    normalTextureScaleChangedWithSize();\n    _normalTextureLoaded = true;\n}\n\nvoid Button::loadTexturePressed(const char* selected,TextureResType texType)\n{\n    if (!selected || strcmp(selected, \"\") == 0)\n    {\n        return;\n    }\n    _clickedFileName = selected;\n    _pressedTexType = texType;\n    if (_scale9Enabled)\n    {\n        extension::Scale9Sprite* clickedRendererScale9 = static_cast<extension::Scale9Sprite*>(_buttonClickedRenderer);\n        switch (_pressedTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                clickedRendererScale9->initWithFile(selected);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                clickedRendererScale9->initWithSpriteFrameName(selected);\n                break;\n            default:\n                break;\n        }\n        clickedRendererScale9->setCapInsets(_capInsetsPressed);\n    }\n    else\n    {\n        Sprite* clickedRenderer = static_cast<Sprite*>(_buttonClickedRenderer);\n        switch (_pressedTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                clickedRenderer->setTexture(selected);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                clickedRenderer->setSpriteFrame(selected);\n                break;\n            default:\n                break;\n        }\n    }\n    _pressedTextureSize = _buttonClickedRenderer->getContentSize();\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    pressedTextureScaleChangedWithSize();\n    _pressedTextureLoaded = true;\n}\n\nvoid Button::loadTextureDisabled(const char* disabled,TextureResType texType)\n{\n    if (!disabled || strcmp(disabled, \"\") == 0)\n    {\n        return;\n    }\n    _disabledFileName = disabled;\n    _disabledTexType = texType;\n    if (_scale9Enabled)\n    {\n        extension::Scale9Sprite* disabledScale9 = static_cast<extension::Scale9Sprite*>(_buttonDisableRenderer);\n        switch (_disabledTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                disabledScale9->initWithFile(disabled);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                disabledScale9->initWithSpriteFrameName(disabled);\n                break;\n            default:\n                break;\n        }\n        disabledScale9->setCapInsets(_capInsetsDisabled);\n    }\n    else\n    {\n        Sprite* disabledRenderer = static_cast<Sprite*>(_buttonDisableRenderer);\n        switch (_disabledTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                disabledRenderer->setTexture(disabled);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                disabledRenderer->setSpriteFrame(disabled);\n                break;\n            default:\n                break;\n        }\n    }\n    _disabledTextureSize = _buttonDisableRenderer->getContentSize();\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    disabledTextureScaleChangedWithSize();\n    _disabledTextureLoaded = true;\n}\n\nvoid Button::setCapInsets(const Rect &capInsets)\n{\n    setCapInsetsNormalRenderer(capInsets);\n    setCapInsetsPressedRenderer(capInsets);\n    setCapInsetsDisabledRenderer(capInsets);\n}\n\nvoid Button::setCapInsetsNormalRenderer(const Rect &capInsets)\n{\n    _capInsetsNormal = capInsets;\n    if (!_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<extension::Scale9Sprite*>(_buttonNormalRenderer)->setCapInsets(capInsets);\n}\n\nvoid Button::setCapInsetsPressedRenderer(const Rect &capInsets)\n{\n    _capInsetsPressed = capInsets;\n    if (!_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<extension::Scale9Sprite*>(_buttonClickedRenderer)->setCapInsets(capInsets);\n}\n\nvoid Button::setCapInsetsDisabledRenderer(const Rect &capInsets)\n{\n    _capInsetsDisabled = capInsets;\n    if (!_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<extension::Scale9Sprite*>(_buttonDisableRenderer)->setCapInsets(capInsets);\n}\n\nvoid Button::onPressStateChangedToNormal()\n{\n    _buttonNormalRenderer->setVisible(true);\n    _buttonClickedRenderer->setVisible(false);\n    _buttonDisableRenderer->setVisible(false);\n    if (_pressedTextureLoaded)\n    {\n        if (_pressedActionEnabled)\n        {\n            _buttonNormalRenderer->stopAllActions();\n            _buttonClickedRenderer->stopAllActions();\n            Action *zoomAction = ScaleTo::create(0.05f, _normalTextureScaleXInSize, _normalTextureScaleYInSize);\n            _buttonNormalRenderer->runAction(zoomAction);\n            _buttonClickedRenderer->setScale(_pressedTextureScaleXInSize, _pressedTextureScaleYInSize);\n        }\n    }\n    else\n    {\n        _buttonNormalRenderer->stopAllActions();\n        Action *zoomAction = ScaleTo::create(0.05f, _normalTextureScaleXInSize, _normalTextureScaleYInSize);\n        _buttonNormalRenderer->runAction(zoomAction);\n    }\n}\n\nvoid Button::onPressStateChangedToPressed()\n{\n    if (_pressedTextureLoaded)\n    {\n        _buttonNormalRenderer->setVisible(false);\n        _buttonClickedRenderer->setVisible(true);\n        _buttonDisableRenderer->setVisible(false);\n        if (_pressedActionEnabled)\n        {\n            _buttonNormalRenderer->stopAllActions();\n            _buttonClickedRenderer->stopAllActions();\n            Action *zoomAction = ScaleTo::create(0.05f, _pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f);\n            _buttonClickedRenderer->runAction(zoomAction);\n            _buttonNormalRenderer->setScale(_pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f);\n        }\n    }\n    else\n    {\n        _buttonNormalRenderer->setVisible(true);\n        _buttonClickedRenderer->setVisible(true);\n        _buttonDisableRenderer->setVisible(false);\n        _buttonNormalRenderer->stopAllActions();\n        Action *zoomAction = ScaleTo::create(0.05f, _pressedTextureScaleXInSize + 0.1f, _pressedTextureScaleYInSize + 0.1f);\n        _buttonNormalRenderer->runAction(zoomAction);\n    }\n}\n\nvoid Button::onPressStateChangedToDisabled()\n{\n    _buttonNormalRenderer->setVisible(false);\n    _buttonClickedRenderer->setVisible(false);\n    _buttonDisableRenderer->setVisible(true);\n    _buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize);\n    _buttonClickedRenderer->setScale(_pressedTextureScaleXInSize, _pressedTextureScaleYInSize);\n}\n\nvoid Button::setFlipX(bool flipX)\n{\n    _titleRenderer->setFlippedX(flipX);\n    if (_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<Sprite*>(_buttonNormalRenderer)->setFlippedX(flipX);\n    static_cast<Sprite*>(_buttonClickedRenderer)->setFlippedX(flipX);\n    static_cast<Sprite*>(_buttonDisableRenderer)->setFlippedX(flipX);\n}\n\nvoid Button::setFlipY(bool flipY)\n{\n    _titleRenderer->setFlippedY(flipY);\n    if (_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<Sprite*>(_buttonNormalRenderer)->setFlippedY(flipY);\n    static_cast<Sprite*>(_buttonClickedRenderer)->setFlippedY(flipY);\n    static_cast<Sprite*>(_buttonDisableRenderer)->setFlippedY(flipY);\n}\n\nbool Button::isFlipX()\n{\n    if (_scale9Enabled)\n    {\n        return false;\n    }\n    return static_cast<Sprite*>(_buttonNormalRenderer)->isFlippedX();\n}\n\nbool Button::isFlipY()\n{\n    if (_scale9Enabled)\n    {\n        return false;\n    }\n    return static_cast<Sprite*>(_buttonNormalRenderer)->isFlippedY();\n}\n\nvoid Button::setAnchorPoint(const Point &pt)\n{\n    Widget::setAnchorPoint(pt);\n    _buttonNormalRenderer->setAnchorPoint(pt);\n    _buttonClickedRenderer->setAnchorPoint(pt);\n    _buttonDisableRenderer->setAnchorPoint(pt);\n    _titleRenderer->setPosition(Point(_size.width*(0.5f-_anchorPoint.x), _size.height*(0.5f-_anchorPoint.y)));\n}\n\nvoid Button::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    normalTextureScaleChangedWithSize();\n    pressedTextureScaleChangedWithSize();\n    disabledTextureScaleChangedWithSize();\n}\n\nconst Size& Button::getContentSize() const\n{\n    return _normalTextureSize;\n}\n\nNode* Button::getVirtualRenderer()\n{\n    if (_bright)\n    {\n        switch (_brightStyle)\n        {\n            case BRIGHT_NORMAL:\n                return _buttonNormalRenderer;\n            case BRIGHT_HIGHLIGHT:\n                return _buttonClickedRenderer;\n            default:\n                return nullptr;\n        }\n    }\n    else\n    {\n        return _buttonDisableRenderer;\n    }\n}\n\nvoid Button::normalTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        if (!_scale9Enabled)\n        {\n            _buttonNormalRenderer->setScale(1.0f);\n            _normalTextureScaleXInSize = _normalTextureScaleYInSize = 1.0f;\n            _size = _normalTextureSize;\n        }\n    }\n    else\n    {\n        if (_scale9Enabled)\n        {\n            static_cast<extension::Scale9Sprite*>(_buttonNormalRenderer)->setPreferredSize(_size);\n            _normalTextureScaleXInSize = _normalTextureScaleYInSize = 1.0f;\n        }\n        else\n        {\n            Size textureSize = _normalTextureSize;\n            if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n            {\n                _buttonNormalRenderer->setScale(1.0f);\n                return;\n            }\n            float scaleX = _size.width / textureSize.width;\n            float scaleY = _size.height / textureSize.height;\n            _buttonNormalRenderer->setScaleX(scaleX);\n            _buttonNormalRenderer->setScaleY(scaleY);\n            _normalTextureScaleXInSize = scaleX;\n            _normalTextureScaleYInSize = scaleY;\n        }\n    }\n}\n\nvoid Button::pressedTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        if (!_scale9Enabled)\n        {\n            _buttonClickedRenderer->setScale(1.0f);\n            _pressedTextureScaleXInSize = _pressedTextureScaleYInSize = 1.0f;\n        }\n    }\n    else\n    {\n        if (_scale9Enabled)\n        {\n            static_cast<extension::Scale9Sprite*>(_buttonClickedRenderer)->setPreferredSize(_size);\n            _pressedTextureScaleXInSize = _pressedTextureScaleYInSize = 1.0f;\n        }\n        else\n        {\n            Size textureSize = _pressedTextureSize;\n            if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n            {\n                _buttonClickedRenderer->setScale(1.0f);\n                return;\n            }\n            float scaleX = _size.width / _pressedTextureSize.width;\n            float scaleY = _size.height / _pressedTextureSize.height;\n            _buttonClickedRenderer->setScaleX(scaleX);\n            _buttonClickedRenderer->setScaleY(scaleY);\n            _pressedTextureScaleXInSize = scaleX;\n            _pressedTextureScaleYInSize = scaleY;\n        }\n    }\n}\n\nvoid Button::disabledTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        if (!_scale9Enabled)\n        {\n            _buttonDisableRenderer->setScale(1.0f);\n        }\n    }\n    else\n    {\n        if (_scale9Enabled)\n        {\n            static_cast<extension::Scale9Sprite*>(_buttonDisableRenderer)->setPreferredSize(_size);\n        }\n        else\n        {\n            Size textureSize = _disabledTextureSize;\n            if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n            {\n                _buttonDisableRenderer->setScale(1.0f);\n                return;\n            }\n            float scaleX = _size.width / _disabledTextureSize.width;\n            float scaleY = _size.height / _disabledTextureSize.height;\n            _buttonDisableRenderer->setScaleX(scaleX);\n            _buttonDisableRenderer->setScaleY(scaleY);\n        }\n    }\n}\n\nvoid Button::setPressedActionEnabled(bool enabled)\n{\n    _pressedActionEnabled = enabled;\n}\n\nvoid Button::setTitleText(const std::string& text)\n{\n    _titleRenderer->setString(text);\n}\n\nconst std::string& Button::getTitleText() const\n{\n    return _titleRenderer->getString();\n}\n\nvoid Button::setTitleColor(const Color3B& color)\n{\n    _titleColor = color;\n    _titleRenderer->updateDisplayedColor(color);\n}\n\nconst Color3B& Button::getTitleColor() const\n{\n    return _titleRenderer->getColor();\n}\n\nvoid Button::setTitleFontSize(float size)\n{\n    _titleRenderer->setFontSize(size);\n}\n\nfloat Button::getTitleFontSize() const\n{\n    return _titleRenderer->getFontSize();\n}\n\nvoid Button::setTitleFontName(const char* fontName)\n{\n    _titleRenderer->setFontName(fontName);\n}\n\nconst char* Button::getTitleFontName() const\n{\n    return _titleRenderer->getFontName().c_str();\n}\n\nvoid Button::setColor(const Color3B &color)\n{\n    Widget::setColor(color);\n    setTitleColor(_titleColor);\n}\n\nstd::string Button::getDescription() const\n{\n    return \"Button\";\n}\n\nWidget* Button::createCloneInstance()\n{\n    return Button::create();\n}\n\nvoid Button::copySpecialProperties(Widget *widget)\n{\n    Button* button = dynamic_cast<Button*>(widget);\n    if (button)\n    {   \n        _prevIgnoreSize = button->_prevIgnoreSize;\n        setScale9Enabled(button->_scale9Enabled);\n        loadTextureNormal(button->_normalFileName.c_str(), button->_normalTexType);\n        loadTexturePressed(button->_clickedFileName.c_str(), button->_pressedTexType);\n        loadTextureDisabled(button->_disabledFileName.c_str(), button->_disabledTexType);\n        setCapInsetsNormalRenderer(button->_capInsetsNormal);\n        setCapInsetsPressedRenderer(button->_capInsetsPressed);\n        setCapInsetsDisabledRenderer(button->_capInsetsDisabled);\n        setTitleText(button->getTitleText());\n        setTitleFontName(button->getTitleFontName());\n        setTitleFontSize(button->getTitleFontSize());\n        setTitleColor(button->getTitleColor());\n        setPressedActionEnabled(button->_pressedActionEnabled);\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UIButton.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UIBUTTON_H__\n#define __UIBUTTON_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui{\n\n/**\n*   @js NA\n*   @lua NA\n*/\nclass Button : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    Button();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~Button();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static Button* create();\n    \n    /**\n     * Load textures for button.\n     *\n     * @param normal    normal state texture.\n     *\n     * @param selected    selected state texture.\n     *\n     * @param disabled    dark state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextures(const char* normal,const char* selected,const char* disabled,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load normal state texture for button.\n     *\n     * @param normal    normal state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextureNormal(const char* normal, TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load selected state texture for button.\n     *\n     * @param selected    selected state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTexturePressed(const char* selected, TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load dark state texture for button.\n     *\n     * @param disabled    dark state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextureDisabled(const char* disabled, TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Sets capinsets for button, if button is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for button\n     */\n    void setCapInsets(const Rect &capInsets);\n\n    /**\n     * Sets capinsets for button, if button is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for button\n     */\n    void setCapInsetsNormalRenderer(const Rect &capInsets);\n    \n    /**\n     * Sets capinsets for button, if button is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for button\n     */\n    void setCapInsetsPressedRenderer(const Rect &capInsets);\n    \n    /**\n     * Sets capinsets for button, if button is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for button\n     */\n    void setCapInsetsDisabledRenderer(const Rect &capInsets);\n    \n    //override \"setAnchorPoint\" of widget.\n    virtual void setAnchorPoint(const Point &pt) override;\n    \n    /**\n     * Sets if button is using scale9 renderer.\n     *\n     * @param true that using scale9 renderer, false otherwise.\n     */\n    virtual void setScale9Enabled(bool able);\n    \n    //override \"setFlipX\" of widget.\n    virtual void setFlipX(bool flipX) override;\n    \n    //override \"setFlipY\" of widget.\n    virtual void setFlipY(bool flipY) override;\n    \n    //override \"isFlipX\" of widget.\n    virtual bool isFlipX() override;\n    \n    //override \"isFlipY\" of widget.\n    virtual bool isFlipY() override;\n    \n    /**\n     * Changes if button can be clicked zoom effect.\n     *\n     * @param true that can be clicked zoom effect, false otherwise.\n     */\n    void setPressedActionEnabled(bool enabled);\n    \n    //override \"ignoreContentAdaptWithSize\" method of widget.\n    virtual void ignoreContentAdaptWithSize(bool ignore) override;\n    \n    //override \"getContentSize\" method of widget.\n    virtual const Size& getContentSize() const override;\n    \n    //override \"getVirtualRenderer\" method of widget.\n    virtual Node* getVirtualRenderer() override;\n    \n    /**\n     * Sets color to widget\n     *\n     * It default change the color of widget's children.\n     *\n     * @param color\n     */\n    virtual void setColor(const Color3B &color) override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n    \n    void setTitleText(const std::string& text);\n    const std::string& getTitleText() const;\n    void setTitleColor(const Color3B& color);\n    const Color3B& getTitleColor() const;\n    void setTitleFontSize(float size);\n    float getTitleFontSize() const;\n    void setTitleFontName(const char* fontName);\n    const char* getTitleFontName() const;\n\nprotected:\n    virtual bool init() override;\n    virtual void initRenderer() override;\n    virtual void onPressStateChangedToNormal() override;\n    virtual void onPressStateChangedToPressed() override;\n    virtual void onPressStateChangedToDisabled() override;\n    virtual void onSizeChanged() override;\n    \n    void normalTextureScaleChangedWithSize();\n    void pressedTextureScaleChangedWithSize();\n    void disabledTextureScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    Node* _buttonNormalRenderer;\n    Node* _buttonClickedRenderer;\n    Node* _buttonDisableRenderer;\n    LabelTTF* _titleRenderer;\n    std::string _normalFileName;\n    std::string _clickedFileName;\n    std::string _disabledFileName;\n    bool _prevIgnoreSize;\n    bool _scale9Enabled;\n    Rect _capInsetsNormal;\n    Rect _capInsetsPressed;\n    Rect _capInsetsDisabled;\n    TextureResType _normalTexType;\n    TextureResType _pressedTexType;\n    TextureResType _disabledTexType;\n    Size _normalTextureSize;\n    Size _pressedTextureSize;\n    Size _disabledTextureSize;\n    bool _pressedActionEnabled;\n    Color3B _titleColor;\n    float _normalTextureScaleXInSize;\n    float _normalTextureScaleYInSize;\n    float _pressedTextureScaleXInSize;\n    float _pressedTextureScaleYInSize;\n    bool _normalTextureLoaded;\n    bool _pressedTextureLoaded;\n    bool _disabledTextureLoaded;\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__CocoGUI__Button__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UICheckBox.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UICheckBox.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \nstatic const int BACKGROUNDBOX_RENDERER_Z = (-1);\nstatic const int BACKGROUNDSELECTEDBOX_RENDERER_Z = (-1);\nstatic const int FRONTCROSS_RENDERER_Z = (-1);\nstatic const int BACKGROUNDBOXDISABLED_RENDERER_Z = (-1);\nstatic const int FRONTCROSSDISABLED_RENDERER_Z = (-1);\n\nCheckBox::CheckBox():\n_backGroundBoxRenderer(nullptr),\n_backGroundSelectedBoxRenderer(nullptr),\n_frontCrossRenderer(nullptr),\n_backGroundBoxDisabledRenderer(nullptr),\n_frontCrossDisabledRenderer(nullptr),\n_isSelected(true),\n_checkBoxEventListener(nullptr),\n_checkBoxEventSelector(nullptr),\n_backGroundTexType(UI_TEX_TYPE_LOCAL),\n_backGroundSelectedTexType(UI_TEX_TYPE_LOCAL),\n_frontCrossTexType(UI_TEX_TYPE_LOCAL),\n_backGroundDisabledTexType(UI_TEX_TYPE_LOCAL),\n_frontCrossDisabledTexType(UI_TEX_TYPE_LOCAL),\n_backGroundFileName(\"\"),\n_backGroundSelectedFileName(\"\"),\n_frontCrossFileName(\"\"),\n_backGroundDisabledFileName(\"\"),\n_frontCrossDisabledFileName(\"\")\n{\n}\n\nCheckBox::~CheckBox()\n{\n    _checkBoxEventListener = nullptr;\n    _checkBoxEventSelector = nullptr;\n}\n\nCheckBox* CheckBox::create()\n{\n    CheckBox* widget = new CheckBox();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nbool CheckBox::init()\n{\n    if (Widget::init())\n    {\n        setSelectedState(false);\n        return true;\n    }\n    return false;\n}\n\nvoid CheckBox::initRenderer()\n{\n    _backGroundBoxRenderer = Sprite::create();\n    _backGroundSelectedBoxRenderer = Sprite::create();\n    _frontCrossRenderer = Sprite::create();\n    _backGroundBoxDisabledRenderer = Sprite::create();\n    _frontCrossDisabledRenderer = Sprite::create();\n        \n    Node::addChild(_backGroundBoxRenderer, BACKGROUNDBOX_RENDERER_Z, -1);\n    Node::addChild(_backGroundSelectedBoxRenderer, BACKGROUNDSELECTEDBOX_RENDERER_Z, -1);\n    Node::addChild(_frontCrossRenderer, FRONTCROSS_RENDERER_Z, -1);\n    Node::addChild(_backGroundBoxDisabledRenderer, BACKGROUNDBOXDISABLED_RENDERER_Z, -1);\n    Node::addChild(_frontCrossDisabledRenderer, FRONTCROSSDISABLED_RENDERER_Z, -1);\n}\n\nvoid CheckBox::loadTextures(const char *backGround, const char *backGroundSelected, const char *cross,const char* backGroundDisabled,const char* frontCrossDisabled,TextureResType texType)\n{\n    loadTextureBackGround(backGround,texType);\n    loadTextureBackGroundSelected(backGroundSelected,texType);\n    loadTextureFrontCross(cross,texType);\n    loadTextureBackGroundDisabled(backGroundDisabled,texType);\n    loadTextureFrontCrossDisabled(frontCrossDisabled,texType);\n}\n\nvoid CheckBox::loadTextureBackGround(const char *backGround,TextureResType texType)\n{\n    if (!backGround || strcmp(backGround, \"\") == 0)\n    {\n        return;\n    }\n    _backGroundFileName = backGround;\n    _backGroundTexType = texType;\n    switch (_backGroundTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _backGroundBoxRenderer->setTexture(backGround);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _backGroundBoxRenderer->setSpriteFrame(backGround);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    backGroundTextureScaleChangedWithSize();\n}\n\nvoid CheckBox::loadTextureBackGroundSelected(const char *backGroundSelected,TextureResType texType)\n{\n    if (!backGroundSelected || strcmp(backGroundSelected, \"\") == 0)\n    {\n        return;\n    }\n    _backGroundSelectedFileName = backGroundSelected;\n    _backGroundSelectedTexType = texType;\n    switch (_backGroundSelectedTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _backGroundSelectedBoxRenderer->setTexture(backGroundSelected);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _backGroundSelectedBoxRenderer->setSpriteFrame(backGroundSelected);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    backGroundSelectedTextureScaleChangedWithSize();\n}\n\nvoid CheckBox::loadTextureFrontCross(const char *cross,TextureResType texType)\n{\n    if (!cross || strcmp(cross, \"\") == 0)\n    {\n        return;\n    }\n    _frontCrossFileName = cross;\n    _frontCrossTexType = texType;\n    switch (_frontCrossTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _frontCrossRenderer->setTexture(cross);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _frontCrossRenderer->setSpriteFrame(cross);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    frontCrossTextureScaleChangedWithSize();\n}\n\nvoid CheckBox::loadTextureBackGroundDisabled(const char *backGroundDisabled,TextureResType texType)\n{\n    if (!backGroundDisabled || strcmp(backGroundDisabled, \"\") == 0)\n    {\n        return;\n    }\n    _backGroundDisabledFileName = backGroundDisabled;\n    _backGroundDisabledTexType = texType;\n    switch (_backGroundDisabledTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _backGroundBoxDisabledRenderer->setTexture(backGroundDisabled);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _backGroundBoxDisabledRenderer->setSpriteFrame(backGroundDisabled);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    backGroundDisabledTextureScaleChangedWithSize();\n}\n\nvoid CheckBox::loadTextureFrontCrossDisabled(const char *frontCrossDisabled,TextureResType texType)\n{\n    if (!frontCrossDisabled || strcmp(frontCrossDisabled, \"\") == 0)\n    {\n        return;\n    }\n    _frontCrossDisabledFileName = frontCrossDisabled;\n    _frontCrossDisabledTexType = texType;\n    switch (_frontCrossDisabledTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _frontCrossDisabledRenderer->setTexture(frontCrossDisabled);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _frontCrossDisabledRenderer->setSpriteFrame(frontCrossDisabled);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    frontCrossDisabledTextureScaleChangedWithSize();\n}\n\nvoid CheckBox::onTouchEnded(Touch *touch, Event *unusedEvent)\n{\n    _touchEndPos = touch->getLocation();\n    if (_focus)\n    {\n        releaseUpEvent();\n        if (_isSelected){\n            setSelectedState(false);\n            unSelectedEvent();\n        }\n        else\n        {\n            setSelectedState(true);\n            selectedEvent();\n        }\n    }\n    setFocused(false);\n    Widget* widgetParent = getWidgetParent();\n    if (widgetParent)\n    {\n        widgetParent->checkChildInfo(2,this,_touchEndPos);\n    }\n}\n\nvoid CheckBox::onPressStateChangedToNormal()\n{\n    _backGroundBoxRenderer->setVisible(true);\n    _backGroundSelectedBoxRenderer->setVisible(false);\n    _backGroundBoxDisabledRenderer->setVisible(false);\n    _frontCrossDisabledRenderer->setVisible(false);\n}\n\nvoid CheckBox::onPressStateChangedToPressed()\n{\n    _backGroundBoxRenderer->setVisible(false);\n    _backGroundSelectedBoxRenderer->setVisible(true);\n    _backGroundBoxDisabledRenderer->setVisible(false);\n    _frontCrossDisabledRenderer->setVisible(false);\n}\n\nvoid CheckBox::onPressStateChangedToDisabled()\n{\n    _backGroundBoxRenderer->setVisible(false);\n    _backGroundSelectedBoxRenderer->setVisible(false);\n    _backGroundBoxDisabledRenderer->setVisible(true);\n    _frontCrossRenderer->setVisible(false);\n    if (_isSelected)\n    {\n        _frontCrossDisabledRenderer->setVisible(true);\n    }\n}\n\nvoid CheckBox::setSelectedState(bool selected)\n{\n    if (selected == _isSelected)\n    {\n        return;\n    }\n    _isSelected = selected;\n    _frontCrossRenderer->setVisible(_isSelected);\n}\n\nbool CheckBox::getSelectedState()\n{\n    return _isSelected;\n}\n\nvoid CheckBox::selectedEvent()\n{\n    if (_checkBoxEventListener && _checkBoxEventSelector)\n    {\n        (_checkBoxEventListener->*_checkBoxEventSelector)(this,CHECKBOX_STATE_EVENT_SELECTED);\n    }\n}\n\nvoid CheckBox::unSelectedEvent()\n{\n    if (_checkBoxEventListener && _checkBoxEventSelector)\n    {\n        (_checkBoxEventListener->*_checkBoxEventSelector)(this,CHECKBOX_STATE_EVENT_UNSELECTED);\n    }\n}\n\nvoid CheckBox::addEventListenerCheckBox(Object *target, SEL_SelectedStateEvent selector)\n{\n    _checkBoxEventListener = target;\n    _checkBoxEventSelector = selector;\n}\n\nvoid CheckBox::setFlipX(bool flipX)\n{\n    _backGroundBoxRenderer->setFlippedX(flipX);\n    _backGroundSelectedBoxRenderer->setFlippedX(flipX);\n    _frontCrossRenderer->setFlippedX(flipX);\n    _backGroundBoxDisabledRenderer->setFlippedX(flipX);\n    _frontCrossDisabledRenderer->setFlippedX(flipX);\n}\n\nvoid CheckBox::setFlipY(bool flipY)\n{\n    _backGroundBoxRenderer->setFlippedY(flipY);\n    _backGroundSelectedBoxRenderer->setFlippedY(flipY);\n    _frontCrossRenderer->setFlippedY(flipY);\n    _backGroundBoxDisabledRenderer->setFlippedY(flipY);\n    _frontCrossDisabledRenderer->setFlippedY(flipY);\n}\n\nbool CheckBox::isFlipX()\n{\n    return _backGroundBoxRenderer->isFlippedX();\n}\n\nbool CheckBox::isFlipY()\n{\n    return _backGroundBoxRenderer->isFlippedY();\n}\n\nvoid CheckBox::setAnchorPoint(const Point &pt)\n{\n    Widget::setAnchorPoint(pt);\n    _backGroundBoxRenderer->setAnchorPoint(pt);\n    _backGroundSelectedBoxRenderer->setAnchorPoint(pt);\n    _backGroundBoxDisabledRenderer->setAnchorPoint(pt);\n    _frontCrossRenderer->setAnchorPoint(pt);\n    _frontCrossDisabledRenderer->setAnchorPoint(pt);\n}\n\nvoid CheckBox::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    backGroundTextureScaleChangedWithSize();\n    backGroundSelectedTextureScaleChangedWithSize();\n    frontCrossTextureScaleChangedWithSize();\n    backGroundDisabledTextureScaleChangedWithSize();\n    frontCrossDisabledTextureScaleChangedWithSize();\n}\n\nconst Size& CheckBox::getContentSize() const\n{\n    return _backGroundBoxRenderer->getContentSize();\n}\n\nNode* CheckBox::getVirtualRenderer()\n{\n    return _backGroundBoxRenderer;\n}\n\nvoid CheckBox::backGroundTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _backGroundBoxRenderer->setScale(1.0f);\n        _size = _backGroundBoxRenderer->getContentSize();\n    }\n    else\n    {\n        Size textureSize = _backGroundBoxRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _backGroundBoxRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _backGroundBoxRenderer->setScaleX(scaleX);\n        _backGroundBoxRenderer->setScaleY(scaleY);\n    }\n}\n\nvoid CheckBox::backGroundSelectedTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _backGroundSelectedBoxRenderer->setScale(1.0f);\n    }\n    else\n    {\n        Size textureSize = _backGroundSelectedBoxRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _backGroundSelectedBoxRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _backGroundSelectedBoxRenderer->setScaleX(scaleX);\n        _backGroundSelectedBoxRenderer->setScaleY(scaleY);\n    }\n}\n\nvoid CheckBox::frontCrossTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _frontCrossRenderer->setScale(1.0f);\n    }\n    else\n    {\n        Size textureSize = _frontCrossRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _frontCrossRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _frontCrossRenderer->setScaleX(scaleX);\n        _frontCrossRenderer->setScaleY(scaleY);\n    }\n}\n\nvoid CheckBox::backGroundDisabledTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _backGroundBoxDisabledRenderer->setScale(1.0f);\n    }\n    else\n    {\n        Size textureSize = _backGroundBoxDisabledRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _backGroundBoxDisabledRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _backGroundBoxDisabledRenderer->setScaleX(scaleX);\n        _backGroundBoxDisabledRenderer->setScaleY(scaleY);\n    }\n}\n\nvoid CheckBox::frontCrossDisabledTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _frontCrossDisabledRenderer->setScale(1.0f);\n    }\n    else\n    {\n        Size textureSize = _frontCrossDisabledRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _frontCrossDisabledRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _frontCrossDisabledRenderer->setScaleX(scaleX);\n        _frontCrossDisabledRenderer->setScaleY(scaleY);\n    }\n}\n\nstd::string CheckBox::getDescription() const\n{\n    return \"CheckBox\";\n}\n\nWidget* CheckBox::createCloneInstance()\n{\n    return CheckBox::create();\n}\n\nvoid CheckBox::copySpecialProperties(Widget *widget)\n{\n    CheckBox* checkBox = dynamic_cast<CheckBox*>(widget);\n    if (checkBox)\n    {\n        loadTextureBackGround(checkBox->_backGroundFileName.c_str(), checkBox->_backGroundTexType);\n        loadTextureBackGroundSelected(checkBox->_backGroundSelectedFileName.c_str(), checkBox->_backGroundSelectedTexType);\n        loadTextureFrontCross(checkBox->_frontCrossFileName.c_str(), checkBox->_frontCrossTexType);\n        loadTextureBackGroundDisabled(checkBox->_backGroundDisabledFileName.c_str(), checkBox->_backGroundDisabledTexType);\n        loadTextureFrontCrossDisabled(checkBox->_frontCrossDisabledFileName.c_str(), checkBox->_frontCrossDisabledTexType);\n        setSelectedState(checkBox->_isSelected);\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UICheckBox.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UICHECKBOX_H__\n#define __UICHECKBOX_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\ntypedef enum\n{\n    CHECKBOX_STATE_EVENT_SELECTED,\n    CHECKBOX_STATE_EVENT_UNSELECTED\n}CheckBoxEventType;\n\ntypedef void (Object::*SEL_SelectedStateEvent)(Object*,CheckBoxEventType);\n#define checkboxselectedeventselector(_SELECTOR) (SEL_SelectedStateEvent)(&_SELECTOR)\n\n/**\n*   @js NA\n*   @lua NA\n*/\nclass CheckBox : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    CheckBox();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~CheckBox();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static CheckBox* create();\n    \n    /**\n     * Load textures for checkbox.\n     *\n     * @param backGround    backGround texture.\n     *\n     * @param backGroundSelected    backGround selected state texture.\n     *\n     * @param cross    cross texture.\n     *\n     * @param frontCrossDisabled    cross dark state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextures(const char* backGround,const char* backGroundSelected,const char* cross,const char* backGroundDisabled,const char* frontCrossDisabled,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load backGround texture for checkbox.\n     *\n     * @param backGround    backGround texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextureBackGround(const char* backGround,TextureResType type = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load backGroundSelected texture for checkbox.\n     *\n     * @param backGroundSelected     backGround selected state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextureBackGroundSelected(const char* backGroundSelected,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load cross texture for checkbox.\n     *\n     * @param cross    cross texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextureFrontCross(const char* cross,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load backGroundDisabled texture for checkbox.\n     *\n     * @param backGroundDisabled    backGroundDisabled texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextureBackGroundDisabled(const char* backGroundDisabled,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load frontCrossDisabled texture for checkbox.\n     *\n     * @param frontCrossDisabled    frontCrossDisabled texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTextureFrontCrossDisabled(const char* frontCrossDisabled,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Sets selcted state for checkbox.\n     *\n     * @param selected    true that checkbox is selected, false otherwise.\n     */\n    void setSelectedState(bool selected);\n    \n    /**\n     * Gets selcted state of checkbox.\n     *\n     * @return selected    true that checkbox is selected, false otherwise.\n     */\n    bool getSelectedState();\n    \n    //override \"setAnchorPoint\" method of widget.\n    virtual void setAnchorPoint(const Point &pt) override;\n    \n    //add a call back function would called when checkbox is selected or unselected.\n    void addEventListenerCheckBox(Object* target,SEL_SelectedStateEvent selector);\n    \n    //override \"setFlipX\" method of widget.\n    virtual void setFlipX(bool flipX) override;\n    \n    //override \"setFlipY\" method of widget.\n    virtual void setFlipY(bool flipY) override;\n    \n    //override \"isFlipX\" method of widget.\n    virtual bool isFlipX() override;\n    \n    //override \"isFlipY\" method of widget.\n    virtual bool isFlipY() override;\n    \n    //override \"onTouchEnded\" method of widget.\n    virtual void onTouchEnded(Touch *touch, Event *unusedEvent);\n    \n    //override \"getContentSize\" method of widget.\n    virtual const Size& getContentSize() const override;\n    \n    //override \"getVirtualRenderer\" method of widget.\n    virtual Node* getVirtualRenderer() override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n\nprotected:\n    virtual bool init() override;\n    virtual void initRenderer() override;\n    virtual void onPressStateChangedToNormal() override;\n    virtual void onPressStateChangedToPressed() override;\n    virtual void onPressStateChangedToDisabled() override;\n    void selectedEvent();\n    void unSelectedEvent();\n    virtual void onSizeChanged() override;\n    void backGroundTextureScaleChangedWithSize();\n    void backGroundSelectedTextureScaleChangedWithSize();\n    void frontCrossTextureScaleChangedWithSize();\n    void backGroundDisabledTextureScaleChangedWithSize();\n    void frontCrossDisabledTextureScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    Sprite* _backGroundBoxRenderer;\n    Sprite* _backGroundSelectedBoxRenderer;\n    Sprite* _frontCrossRenderer;\n    Sprite* _backGroundBoxDisabledRenderer;\n    Sprite* _frontCrossDisabledRenderer;\n    bool _isSelected;\n\n    Object*       _checkBoxEventListener;\n    SEL_SelectedStateEvent    _checkBoxEventSelector;\n    \n    TextureResType _backGroundTexType;\n    TextureResType _backGroundSelectedTexType;\n    TextureResType _frontCrossTexType;\n    TextureResType _backGroundDisabledTexType;\n    TextureResType _frontCrossDisabledTexType;\n    \n    std::string _backGroundFileName;\n    std::string _backGroundSelectedFileName;\n    std::string _frontCrossFileName;\n    std::string _backGroundDisabledFileName;\n    std::string _frontCrossDisabledFileName;\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__CocoGUI__CheckBox__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIHelper.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CocosGUI.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nWidget* Helper::seekWidgetByTag(Widget* root, int tag)\n{\n    if (!root)\n    {\n        return nullptr;\n    }\n    if (root->getTag() == tag)\n    {\n        return root;\n    }\n    const auto& arrayRootChildren = root->getChildren();\n    ssize_t length = arrayRootChildren.size();\n    for (ssize_t i=0;i<length;i++)\n    {\n        Widget* child = static_cast<Widget*>(arrayRootChildren.at(i));\n        Widget* res = seekWidgetByTag(child,tag);\n        if (res != nullptr)\n        {\n            return res;\n        }\n    }\n    return nullptr;\n}\n\nWidget* Helper::seekWidgetByName(Widget* root, const char *name)\n{\n    if (!root)\n    {\n        return nullptr;\n    }\n    if (strcmp(root->getName(), name) == 0)\n    {\n        return root;\n    }\n    const auto& arrayRootChildren = root->getChildren();\n    for (auto& subWidget : arrayRootChildren)\n    {\n        Widget* child = static_cast<Widget*>(subWidget);\n        Widget* res = seekWidgetByName(child,name);\n        if (res != nullptr)\n        {\n            return res;\n        }\n    }\n    return nullptr;\n}\n\nWidget* Helper::seekWidgetByRelativeName(Widget *root, const char *name)\n{\n    if (!root)\n    {\n        return nullptr;\n    }\n    const auto& arrayRootChildren = root->getChildren();\n    for (auto& subWidget : arrayRootChildren)\n    {\n        Widget* child = static_cast<Widget*>(subWidget);\n        RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));\n        if (layoutParameter && strcmp(layoutParameter->getRelativeName(), name) == 0)\n        {\n            return child;\n        }\n    }\n    return nullptr;\n}\n\n/*temp action*/\nWidget* Helper::seekActionWidgetByActionTag(Widget* root, int tag)\n{\n\tif (!root)\n\t{\n\t\treturn nullptr;\n\t}\n\tif (root->getActionTag() == tag)\n\t{\n\t\treturn root;\n\t}\n    const auto& arrayRootChildren = root->getChildren();\n    for (auto& subWidget : arrayRootChildren)\n\t{\n\t\tWidget* child = static_cast<Widget*>(subWidget);\n\t\tWidget* res = seekActionWidgetByActionTag(child,tag);\n\t\tif (res != nullptr)\n\t\t{\n\t\t\treturn res;\n\t\t}\n\t}\n\treturn nullptr;\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UIHelper.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UIHELPER_H__\n#define __UIHELPER_H__\n\nNS_CC_BEGIN\n\nnamespace gui {\n\n/**\n*   @js NA\n*   @lua NA\n*/\nclass Helper\n{\npublic:\n    /**\n     * Finds a widget whose tag equals to param tag from root widget.\n     *\n     * @param root      widget which will be seeked.\n     *\n     * @tag             tag value.\n     *\n     * @return finded result.\n     */\n    static Widget* seekWidgetByTag(Widget* root, int tag);\n    \n    /**\n     * Finds a widget whose name equals to param name from root widget.\n     *\n     * @param root      widget which will be seeked.\n     *\n     * @name             name value.\n     *\n     * @return finded result.\n     */\n    static Widget* seekWidgetByName(Widget* root, const char* name);\n    \n    /**\n     * Finds a widget whose name equals to param name from root widget.\n     *\n     * RelativeLayout will call this method to find the widget witch is needed.\n     *\n     * @param root      widget which will be seeked.\n     *\n     * @name             name value.\n     *\n     * @return finded result.\n     */\n    static Widget* seekWidgetByRelativeName(Widget* root, const char* name);\n    \n    /*temp action*/\n    static Widget* seekActionWidgetByActionTag(Widget* root, int tag);\n};\n}\n\nNS_CC_END\n\n#endif /* defined(__CocoGUI__UISystem__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIImageView.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UIImageView.h\"\n#include \"extensions/GUI/CCControlExtension/CCScale9Sprite.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\n\n#define STATIC_CAST_CCSPRITE static_cast<Sprite*>(_imageRenderer)\n#define STATIC_CAST_SCALE9SPRITE static_cast<extension::Scale9Sprite*>(_imageRenderer)\n    \nstatic const int IMAGE_RENDERER_Z = (-1);\n\nImageView::ImageView():\n_scale9Enabled(false),\n_prevIgnoreSize(true),\n_capInsets(Rect::ZERO),\n_imageRenderer(nullptr),\n_textureFile(\"\"),\n_imageTexType(UI_TEX_TYPE_LOCAL),\n_imageTextureSize(_size)\n{\n\n}\n\nImageView::~ImageView()\n{\n    \n}\n\nImageView* ImageView::create()\n{\n    ImageView* widget = new ImageView();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nvoid ImageView::initRenderer()\n{\n    _imageRenderer = Sprite::create();\n    Node::addChild(_imageRenderer, IMAGE_RENDERER_Z, -1);\n}\n\nvoid ImageView::loadTexture(const char *fileName, TextureResType texType)\n{\n    if (!fileName || strcmp(fileName, \"\") == 0)\n    {\n        return;\n    }\n    _textureFile = fileName;\n    _imageTexType = texType;\n    switch (_imageTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            if (_scale9Enabled)\n            {\n                extension::Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE;\n                imageRendererScale9->initWithFile(fileName);\n                imageRendererScale9->setCapInsets(_capInsets);\n            }\n            else\n            {\n                Sprite* imageRenderer = STATIC_CAST_CCSPRITE;\n                imageRenderer->setTexture(fileName);\n            }\n            break;\n        case UI_TEX_TYPE_PLIST:\n            if (_scale9Enabled)\n            {\n                extension::Scale9Sprite* imageRendererScale9 = STATIC_CAST_SCALE9SPRITE;\n                imageRendererScale9->initWithSpriteFrameName(fileName);\n                imageRendererScale9->setCapInsets(_capInsets);\n            }\n            else\n            {\n                Sprite* imageRenderer = STATIC_CAST_CCSPRITE;\n                imageRenderer->setSpriteFrame(fileName);\n            }\n            break;\n        default:\n            break;\n    }\n    _imageTextureSize = _imageRenderer->getContentSize();\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    updateAnchorPoint();\n    imageTextureScaleChangedWithSize();\n}\n\nvoid ImageView::setTextureRect(const Rect &rect)\n{\n    if (_scale9Enabled)\n    {\n    }\n    else\n    {\n        STATIC_CAST_CCSPRITE->setTextureRect(rect);\n    }\n}\n\nvoid ImageView::setFlipX(bool flipX)\n{\n    if (_scale9Enabled)\n    {\n    }\n    else\n    {\n        STATIC_CAST_CCSPRITE->setFlippedX(flipX);\n    }\n}\n\nvoid ImageView::setFlipY(bool flipY)\n{\n    if (_scale9Enabled)\n    {\n    }\n    else\n    {\n        STATIC_CAST_CCSPRITE->setFlippedY(flipY);\n    }\n}\n\nbool ImageView::isFlipX()\n{\n    if (_scale9Enabled)\n    {\n        return false;\n    }\n    else\n    {\n        return STATIC_CAST_CCSPRITE->isFlippedX();\n    }\n}\n\nbool ImageView::isFlipY()\n{\n    if (_scale9Enabled)\n    {\n        return false;\n    }\n    else\n    {\n        return STATIC_CAST_CCSPRITE->isFlippedY();\n    }\n}\n\nvoid ImageView::setScale9Enabled(bool able)\n{\n    if (_scale9Enabled == able)\n    {\n        return;\n    }\n    \n    \n    _scale9Enabled = able;\n    Node::removeChild(_imageRenderer);\n    _imageRenderer = nullptr;\n    if (_scale9Enabled)\n    {\n        _imageRenderer = extension::Scale9Sprite::create();\n    }\n    else\n    {\n        _imageRenderer = Sprite::create();\n    }\n    loadTexture(_textureFile.c_str(),_imageTexType);\n    Node::addChild(_imageRenderer, IMAGE_RENDERER_Z, -1);\n    if (_scale9Enabled)\n    {\n        bool ignoreBefore = _ignoreSize;\n        ignoreContentAdaptWithSize(false);\n        _prevIgnoreSize = ignoreBefore;\n    }\n    else\n    {\n        ignoreContentAdaptWithSize(_prevIgnoreSize);\n    }\n    setCapInsets(_capInsets);\n}\n\nvoid ImageView::ignoreContentAdaptWithSize(bool ignore)\n{\n    if (!_scale9Enabled || (_scale9Enabled && !ignore))\n    {\n        Widget::ignoreContentAdaptWithSize(ignore);\n        _prevIgnoreSize = ignore;\n    }\n}\n\nvoid ImageView::setCapInsets(const Rect &capInsets)\n{\n    _capInsets = capInsets;\n    if (!_scale9Enabled)\n    {\n        return;\n    }\n    STATIC_CAST_SCALE9SPRITE->setCapInsets(capInsets);\n}\n\nvoid ImageView::setAnchorPoint(const Point &pt)\n{\n    Widget::setAnchorPoint(pt);\n    _imageRenderer->setAnchorPoint(pt);\n}\n\nvoid ImageView::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    imageTextureScaleChangedWithSize();\n}\n\nconst Size& ImageView::getContentSize() const\n{\n    return _imageTextureSize;\n}\n\nNode* ImageView::getVirtualRenderer()\n{\n    return _imageRenderer;\n}\n\nvoid ImageView::imageTextureScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        if (!_scale9Enabled)\n        {\n            _imageRenderer->setScale(1.0f);\n            _size = _imageTextureSize;\n        }\n    }\n    else\n    {\n        if (_scale9Enabled)\n        {\n            static_cast<extension::Scale9Sprite*>(_imageRenderer)->setPreferredSize(_size);\n        }\n        else\n        {\n            Size textureSize = _imageRenderer->getContentSize();\n            if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n            {\n                _imageRenderer->setScale(1.0f);\n                return;\n            }\n            float scaleX = _size.width / textureSize.width;\n            float scaleY = _size.height / textureSize.height;\n            _imageRenderer->setScaleX(scaleX);\n            _imageRenderer->setScaleY(scaleY);\n        }\n    }\n}\n\nstd::string ImageView::getDescription() const\n{\n    return \"ImageView\";\n}\n\nWidget* ImageView::createCloneInstance()\n{\n    return ImageView::create();\n}\n\nvoid ImageView::copySpecialProperties(Widget *widget)\n{\n    ImageView* imageView = dynamic_cast<ImageView*>(widget);\n    if (imageView)\n    {\n        _prevIgnoreSize = imageView->_prevIgnoreSize;\n        setScale9Enabled(imageView->_scale9Enabled);\n        loadTexture(imageView->_textureFile.c_str(), imageView->_imageTexType);\n        setCapInsets(imageView->_capInsets);\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UIImageView.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UIIMAGEVIEW_H__\n#define __UIIMAGEVIEW_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\n/**\n*   @js NA\n*   @lua NA\n*/\nclass ImageView : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    ImageView();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~ImageView();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static ImageView* create();\n    \n    /**\n     * Load texture for imageview.\n     *\n     * @param fileName   file name of texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTexture(const char* fileName,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Updates the texture rect of the ImageView in points.\n     * It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size.\n     */\n    void setTextureRect(const Rect& rect);\n    \n    /**\n     * Sets if imageview is using scale9 renderer.\n     *\n     * @param true that using scale9 renderer, false otherwise.\n     */\n    void setScale9Enabled(bool able);\n    \n    /**\n     * Sets capinsets for imageview, if imageview is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for imageview\n     */\n    void setCapInsets(const Rect &capInsets);\n    \n    //override \"setFlipX\" method of widget.\n    virtual void setFlipX(bool flipX) override;\n    \n    //override \"setFlipY\" method of widget.\n    virtual void setFlipY(bool flipY) override;\n    \n    //override \"isFlipX\" method of widget.\n    virtual bool isFlipX() override;\n    \n    //override \"isFlipY\" method of widget.\n    virtual bool isFlipY() override;\n    \n    //override \"setAnchorPoint\" method of widget.\n    virtual void setAnchorPoint(const Point &pt) override;\n    \n    //override \"ignoreContentAdaptWithSize\" method of widget.\n    virtual void ignoreContentAdaptWithSize(bool ignore) override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n    \n    virtual const Size& getContentSize() const override;\n    virtual Node* getVirtualRenderer() override;\nprotected:\n    virtual void initRenderer() override;\n    virtual void onSizeChanged() override;\n    void imageTextureScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    bool _scale9Enabled;\n    bool _prevIgnoreSize;\n    Rect _capInsets;\n    Node* _imageRenderer;\n    std::string _textureFile;\n    TextureResType _imageTexType;\n    Size _imageTextureSize;\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__CocoGUI__ImageView__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UILayout.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UILayout.h\"\n#include \"gui/UIHelper.h\"\n#include \"extensions/GUI/CCControlExtension/CCScale9Sprite.h\"\n#include \"kazmath/GL/matrix.h\"\n#include \"CCGLProgram.h\"\n#include \"CCShaderCache.h\"\n#include \"CCDirector.h\"\n#include \"CCDrawingPrimitives.h\"\n#include \"renderer/CCRenderer.h\"\n#include \"renderer/CCGroupCommand.h\"\n#include \"renderer/CCCustomCommand.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \nstatic const int BACKGROUNDIMAGE_Z = (-1);\nstatic const int BCAKGROUNDCOLORRENDERER_Z = (-2);\n\nstatic GLint g_sStencilBits = -1;\nstatic GLint s_layer = -1;\n\nLayout::Layout():\n_clippingEnabled(false),\n_backGroundScale9Enabled(false),\n_backGroundImage(nullptr),\n_backGroundImageFileName(\"\"),\n_backGroundImageCapInsets(Rect::ZERO),\n_colorType(LAYOUT_COLOR_NONE),\n_bgImageTexType(UI_TEX_TYPE_LOCAL),\n_colorRender(nullptr),\n_gradientRender(nullptr),\n_cColor(Color3B::WHITE),\n_gStartColor(Color3B::WHITE),\n_gEndColor(Color3B::WHITE),\n_alongVector(Point(0.0f, -1.0f)),\n_cOpacity(255),\n_backGroundImageTextureSize(Size::ZERO),\n_layoutType(LAYOUT_ABSOLUTE),\n_clippingType(LAYOUT_CLIPPING_STENCIL),\n_clippingStencil(nullptr),\n_scissorRectDirty(false),\n_clippingRect(Rect::ZERO),\n_clippingParent(nullptr),\n_doLayoutDirty(true),\n_currentStencilEnabled(GL_FALSE),\n_currentStencilWriteMask(~0),\n_currentStencilFunc(GL_ALWAYS),\n_currentStencilRef(0),\n_currentStencilValueMask(~0),\n_currentStencilFail(GL_KEEP),\n_currentStencilPassDepthFail(GL_KEEP),\n_currentStencilPassDepthPass(GL_KEEP),\n_currentDepthWriteMask(GL_TRUE),\n_currentAlphaTestEnabled(GL_FALSE),\n_currentAlphaTestFunc(GL_ALWAYS),\n_currentAlphaTestRef(1)\n{\n    _widgetType = WidgetTypeContainer;\n}\n\nLayout::~Layout()\n{\n    CC_SAFE_RELEASE(_clippingStencil);\n}\n    \nvoid Layout::onEnter()\n{\n    Widget::onEnter();\n    if (_clippingStencil)\n    {\n        _clippingStencil->onEnter();\n    }\n}\n    \nvoid Layout::onExit()\n{\n    Widget::onExit();\n    if (_clippingStencil)\n    {\n        _clippingStencil->onExit();\n    }\n}\n\nLayout* Layout::create()\n{\n    Layout* layout = new Layout();\n    if (layout && layout->init())\n    {\n        layout->autorelease();\n        return layout;\n    }\n    CC_SAFE_DELETE(layout);\n    return nullptr;\n}\n\nbool Layout::init()\n{\n    if (Node::init())\n    {\n        initRenderer();\n        setCascadeColorEnabled(true);\n        setCascadeOpacityEnabled(true);\n        setBright(true);\n        ignoreContentAdaptWithSize(false);\n        setSize(Size::ZERO);\n        setAnchorPoint(Point::ZERO);\n        return true;\n    }\n    return false;\n}\n    \nvoid Layout::addChild(Node *child)\n{\n    Widget::addChild(child);\n}\n\nvoid Layout::addChild(Node * child, int zOrder)\n{\n    Widget::addChild(child, zOrder);\n}\n\nvoid Layout::addChild(Node *child, int zOrder, int tag)\n{\n    supplyTheLayoutParameterLackToChild(static_cast<Widget*>(child));\n    Widget::addChild(child, zOrder, tag);\n    _doLayoutDirty = true;\n}\n\nbool Layout::isClippingEnabled()\n{\n    return _clippingEnabled;\n}\n    \nbool Layout::hitTest(const Point &pt)\n{\n    Point nsp = convertToNodeSpace(pt);\n    Rect bb = Rect(0.0f, 0.0f, _size.width, _size.height);\n    if (nsp.x >= bb.origin.x && nsp.x <= bb.origin.x + bb.size.width && nsp.y >= bb.origin.y && nsp.y <= bb.origin.y + bb.size.height)\n    {\n        return true;\n    }\n    return false;\n}\n    \nvoid Layout::visit()\n{\n    if (!_enabled)\n    {\n        return;\n    }\n    if (_clippingEnabled)\n    {\n        switch (_clippingType)\n        {\n            case LAYOUT_CLIPPING_STENCIL:\n                stencilClippingVisit();\n                break;\n            case LAYOUT_CLIPPING_SCISSOR:\n                scissorClippingVisit();\n                break;\n            default:\n                break;\n        }\n    }\n    else\n    {\n        Node::visit();\n    }\n}\n    \nvoid Layout::sortAllChildren()\n{\n    Widget::sortAllChildren();\n    doLayout();\n}\n    \nvoid Layout::stencilClippingVisit()\n{\n    if(!_visible)\n        return;\n    \n    kmGLPushMatrix();\n    transform();\n    //Add group command\n    \n    Renderer* renderer = Director::getInstance()->getRenderer();\n    \n    _groupCommand.init(_globalZOrder);\n    renderer->addCommand(&_groupCommand);\n    \n    renderer->pushGroup(_groupCommand.getRenderQueueID());\n    \n    _beforeVisitCmdStencil.init(_globalZOrder);\n    _beforeVisitCmdStencil.func = CC_CALLBACK_0(Layout::onBeforeVisitStencil, this);\n    renderer->addCommand(&_beforeVisitCmdStencil);\n    \n    _clippingStencil->visit();\n    \n    _afterDrawStencilCmd.init(_globalZOrder);\n    _afterDrawStencilCmd.func = CC_CALLBACK_0(Layout::onAfterDrawStencil, this);\n    renderer->addCommand(&_afterDrawStencilCmd);\n    \n    int i = 0;\n    \n    if(!_children.empty())\n    {\n        sortAllChildren();\n        // draw children zOrder < 0\n        for( ; i < _children.size(); i++ )\n        {\n            auto node = _children.at(i);\n            \n            if ( node && node->getLocalZOrder() < 0 )\n                node->visit();\n            else\n                break;\n        }\n        // self draw\n        this->draw();\n        \n        for(auto it=_children.cbegin()+i; it != _children.cend(); ++it)\n            (*it)->visit();\n    }\n    else\n    {\n        this->draw();\n    }\n    \n    _afterVisitCmdStencil.init(_globalZOrder);\n    _afterVisitCmdStencil.func = CC_CALLBACK_0(Layout::onAfterVisitStencil, this);\n    renderer->addCommand(&_afterVisitCmdStencil);\n    \n    renderer->popGroup();\n    \n    kmGLPopMatrix();\n}\n    \nvoid Layout::onBeforeVisitStencil()\n{\n    s_layer++;\n    GLint mask_layer = 0x1 << s_layer;\n    GLint mask_layer_l = mask_layer - 1;\n    _mask_layer_le = mask_layer | mask_layer_l;\n    _currentStencilEnabled = glIsEnabled(GL_STENCIL_TEST);\n    glGetIntegerv(GL_STENCIL_WRITEMASK, (GLint *)&_currentStencilWriteMask);\n    glGetIntegerv(GL_STENCIL_FUNC, (GLint *)&_currentStencilFunc);\n    glGetIntegerv(GL_STENCIL_REF, &_currentStencilRef);\n    glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)&_currentStencilValueMask);\n    glGetIntegerv(GL_STENCIL_FAIL, (GLint *)&_currentStencilFail);\n    glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, (GLint *)&_currentStencilPassDepthFail);\n    glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, (GLint *)&_currentStencilPassDepthPass);\n    \n    glEnable(GL_STENCIL_TEST);\n    CHECK_GL_ERROR_DEBUG();\n    glStencilMask(mask_layer);\n    glGetBooleanv(GL_DEPTH_WRITEMASK, &_currentDepthWriteMask);\n    glDepthMask(GL_FALSE);\n    glStencilFunc(GL_NEVER, mask_layer, mask_layer);\n    glStencilOp(GL_ZERO, GL_KEEP, GL_KEEP);\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPushMatrix();\n    kmGLLoadIdentity();\n    \n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLPushMatrix();\n    kmGLLoadIdentity();\n    \n    DrawPrimitives::drawSolidRect(Point(-1,-1), Point(1,1), Color4F(1, 1, 1, 1));\n    \n    kmGLMatrixMode(KM_GL_PROJECTION);\n    kmGLPopMatrix();\n    kmGLMatrixMode(KM_GL_MODELVIEW);\n    kmGLPopMatrix();\n    glStencilFunc(GL_NEVER, mask_layer, mask_layer);\n    glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);\n}\n\nvoid Layout::onAfterDrawStencil()\n{\n    glDepthMask(_currentDepthWriteMask);\n    glStencilFunc(GL_EQUAL, _mask_layer_le, _mask_layer_le);\n    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);\n}\n\n\nvoid Layout::onAfterVisitStencil()\n{\n    glStencilFunc(_currentStencilFunc, _currentStencilRef, _currentStencilValueMask);\n    glStencilOp(_currentStencilFail, _currentStencilPassDepthFail, _currentStencilPassDepthPass);\n    glStencilMask(_currentStencilWriteMask);\n    if (!_currentStencilEnabled)\n    {\n        glDisable(GL_STENCIL_TEST);\n    }\n    s_layer--;\n}\n    \nvoid Layout::onBeforeVisitScissor()\n{\n    Rect clippingRect = getClippingRect();\n    glEnable(GL_SCISSOR_TEST);\n    EGLView::getInstance()->setScissorInPoints(clippingRect.origin.x, clippingRect.origin.y, clippingRect.size.width, clippingRect.size.height);\n}\n\nvoid Layout::onAfterVisitScissor()\n{\n    glDisable(GL_SCISSOR_TEST);\n}\n    \nvoid Layout::scissorClippingVisit()\n{\n    Renderer* renderer = Director::getInstance()->getRenderer();\n\n    _beforeVisitCmdScissor.init(_globalZOrder);\n    _beforeVisitCmdScissor.func = CC_CALLBACK_0(Layout::onBeforeVisitScissor, this);\n    renderer->addCommand(&_beforeVisitCmdScissor);\n\n    Node::visit();\n    \n    _afterVisitCmdScissor.init(_globalZOrder);\n    _afterVisitCmdScissor.func = CC_CALLBACK_0(Layout::onAfterVisitScissor, this);\n    renderer->addCommand(&_afterVisitCmdScissor);\n}\n\nvoid Layout::setClippingEnabled(bool able)\n{\n    if (able == _clippingEnabled)\n    {\n        return;\n    }\n    _clippingEnabled = able;\n    switch (_clippingType)\n    {\n        case LAYOUT_CLIPPING_STENCIL:\n            if (able)\n            {\n                static bool once = true;\n                if (once)\n                {\n                    glGetIntegerv(GL_STENCIL_BITS, &g_sStencilBits);\n                    if (g_sStencilBits <= 0)\n                    {\n                        CCLOG(\"Stencil buffer is not enabled.\");\n                    }\n                    once = false;\n                }\n                _clippingStencil = DrawNode::create();\n                if (_running)\n                {\n                    _clippingStencil->onEnter();\n                }\n                _clippingStencil->retain();\n                setStencilClippingSize(_size);\n            }\n            else\n            {\n                if (_running)\n                {\n                    _clippingStencil->onExit();\n                }\n                _clippingStencil->release();\n                _clippingStencil = nullptr;\n            }\n            break;\n        default:\n            break;\n    }\n}\n    \nvoid Layout::setClippingType(LayoutClippingType type)\n{\n    if (type == _clippingType)\n    {\n        return;\n    }\n    bool clippingEnabled = isClippingEnabled();\n    setClippingEnabled(false);\n    _clippingType = type;\n    setClippingEnabled(clippingEnabled);\n}\n    \nvoid Layout::setStencilClippingSize(const Size &size)\n{\n    if (_clippingEnabled && _clippingType == LAYOUT_CLIPPING_STENCIL)\n    {\n        Point rect[4];\n        rect[0] = Point::ZERO;\n        rect[1] = Point(_size.width, 0);\n        rect[2] = Point(_size.width, _size.height);\n        rect[3] = Point(0, _size.height);\n        Color4F green(0, 1, 0, 1);\n        _clippingStencil->clear();\n        _clippingStencil->drawPolygon(rect, 4, green, 0, green);\n    }\n}\n    \nconst Rect& Layout::getClippingRect()\n{\n    Point worldPos = convertToWorldSpace(Point::ZERO);\n    AffineTransform t = getNodeToWorldAffineTransform();\n    float scissorWidth = _size.width*t.a;\n    float scissorHeight = _size.height*t.d;\n    Rect parentClippingRect;\n    Layout* parent = this;\n    bool firstClippingParentFounded = false;\n    while (parent)\n    {\n        parent = dynamic_cast<Layout*>(parent->getParent());\n        if(parent)\n        {\n            if (parent->isClippingEnabled())\n            {\n                if (!firstClippingParentFounded)\n                {\n                    _clippingParent = parent;\n                    firstClippingParentFounded = true;\n                    break;\n                }\n            }\n        }\n    }\n    \n    if (_clippingParent)\n    {\n        parentClippingRect = _clippingParent->getClippingRect();\n        float finalX = worldPos.x - (scissorWidth * _anchorPoint.x);\n        float finalY = worldPos.y - (scissorHeight * _anchorPoint.y);\n        float finalWidth = scissorWidth;\n        float finalHeight = scissorHeight;\n        \n        float leftOffset = worldPos.x - parentClippingRect.origin.x;\n        if (leftOffset < 0.0f)\n        {\n            finalX = parentClippingRect.origin.x;\n            finalWidth += leftOffset;\n        }\n        float rightOffset = (worldPos.x + scissorWidth) - (parentClippingRect.origin.x + parentClippingRect.size.width);\n        if (rightOffset > 0.0f)\n        {\n            finalWidth -= rightOffset;\n        }\n        float topOffset = (worldPos.y + scissorHeight) - (parentClippingRect.origin.y + parentClippingRect.size.height);\n        if (topOffset > 0.0f)\n        {\n            finalHeight -= topOffset;\n        }\n        float bottomOffset = worldPos.y - parentClippingRect.origin.y;\n        if (bottomOffset < 0.0f)\n        {\n            finalY = parentClippingRect.origin.x;\n            finalHeight += bottomOffset;\n        }\n        if (finalWidth < 0.0f)\n        {\n            finalWidth = 0.0f;\n        }\n        if (finalHeight < 0.0f)\n        {\n            finalHeight = 0.0f;\n        }\n        _clippingRect.origin.x = finalX;\n        _clippingRect.origin.y = finalY;\n        _clippingRect.size.width = finalWidth;\n        _clippingRect.size.height = finalHeight;\n    }\n    else\n    {\n        _clippingRect.origin.x = worldPos.x - (scissorWidth * _anchorPoint.x);\n        _clippingRect.origin.y = worldPos.y - (scissorHeight * _anchorPoint.y);\n        _clippingRect.size.width = scissorWidth;\n        _clippingRect.size.height = scissorHeight;\n    }\n    return _clippingRect;\n}\n\nvoid Layout::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    setContentSize(_size);\n    setStencilClippingSize(_size);\n    _doLayoutDirty = true;\n    if (_backGroundImage)\n    {\n        _backGroundImage->setPosition(Point(_size.width/2.0f, _size.height/2.0f));\n        if (_backGroundScale9Enabled && _backGroundImage)\n        {\n            static_cast<extension::Scale9Sprite*>(_backGroundImage)->setPreferredSize(_size);\n        }\n    }\n    if (_colorRender)\n    {\n        _colorRender->setContentSize(_size);\n    }\n    if (_gradientRender)\n    {\n        _gradientRender->setContentSize(_size);\n    }\n}\n\nvoid Layout::setBackGroundImageScale9Enabled(bool able)\n{\n    if (_backGroundScale9Enabled == able)\n    {\n        return;\n    }\n    Node::removeChild(_backGroundImage);\n    _backGroundImage = nullptr;\n    _backGroundScale9Enabled = able;\n    if (_backGroundScale9Enabled)\n    {\n        _backGroundImage = extension::Scale9Sprite::create();\n        Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1);\n    }\n    else\n    {\n        _backGroundImage = Sprite::create();\n        Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1);\n    }\n    setBackGroundImage(_backGroundImageFileName.c_str(),_bgImageTexType);\n    setBackGroundImageCapInsets(_backGroundImageCapInsets);\n}\n\nvoid Layout::setBackGroundImage(const char* fileName,TextureResType texType)\n{\n    if (!fileName || strcmp(fileName, \"\") == 0)\n    {\n        return;\n    }\n    if (_backGroundImage == nullptr)\n    {\n        addBackGroundImage();\n    }\n    _backGroundImageFileName = fileName;\n    _bgImageTexType = texType;\n    if (_backGroundScale9Enabled)\n    {\n        extension::Scale9Sprite* bgiScale9 = static_cast<extension::Scale9Sprite*>(_backGroundImage);\n        switch (_bgImageTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                bgiScale9->initWithFile(fileName);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                bgiScale9->initWithSpriteFrameName(fileName);\n                break;\n            default:\n                break;\n        }\n        bgiScale9->setPreferredSize(_size);\n    }\n    else\n    {\n        switch (_bgImageTexType)\n        {\n            case UI_TEX_TYPE_LOCAL:\n                static_cast<Sprite*>(_backGroundImage)->setTexture(fileName);\n                break;\n            case UI_TEX_TYPE_PLIST:\n                static_cast<Sprite*>(_backGroundImage)->setSpriteFrame(fileName);\n                break;\n            default:\n                break;\n        }\n    }\n    if (_backGroundScale9Enabled)\n    {\n        extension::Scale9Sprite* bgiScale9 = static_cast<extension::Scale9Sprite*>(_backGroundImage);\n        bgiScale9->setColor(getColor());\n        bgiScale9->setOpacity(getOpacity());\n    }\n    else\n    {\n        Sprite* bgiScale9 = static_cast<Sprite*>(_backGroundImage);\n        bgiScale9->setColor(getColor());\n        bgiScale9->setOpacity(getOpacity());\n    }\n    _backGroundImageTextureSize = _backGroundImage->getContentSize();\n    _backGroundImage->setPosition(Point(_size.width/2.0f, _size.height/2.0f));\n}\n\nvoid Layout::setBackGroundImageCapInsets(const Rect &capInsets)\n{\n    _backGroundImageCapInsets = capInsets;\n    if (_backGroundScale9Enabled && _backGroundImage)\n    {\n        static_cast<extension::Scale9Sprite*>(_backGroundImage)->setCapInsets(capInsets);\n    }\n}\n\nvoid Layout::supplyTheLayoutParameterLackToChild(Widget *child)\n{\n    if (!child)\n    {\n        return;\n    }\n    switch (_layoutType)\n    {\n        case LAYOUT_ABSOLUTE:\n            break;\n        case LAYOUT_LINEAR_HORIZONTAL:\n        case LAYOUT_LINEAR_VERTICAL:\n        {\n            LinearLayoutParameter* layoutParameter = dynamic_cast<LinearLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_LINEAR));\n            if (!layoutParameter)\n            {\n                child->setLayoutParameter(LinearLayoutParameter::create());\n            }\n            break;\n        }\n        case LAYOUT_RELATIVE:\n        {\n            RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));\n            if (!layoutParameter)\n            {\n                child->setLayoutParameter(RelativeLayoutParameter::create());\n            }\n            break;\n        }\n        default:\n            break;\n    }\n}\n\nvoid Layout::addBackGroundImage()\n{\n    if (_backGroundScale9Enabled)\n    {\n        _backGroundImage = extension::Scale9Sprite::create();\n        _backGroundImage->setLocalZOrder(-1);\n        Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1);\n        static_cast<extension::Scale9Sprite*>(_backGroundImage)->setPreferredSize(_size);\n    }\n    else\n    {\n        _backGroundImage = Sprite::create();\n        _backGroundImage->setLocalZOrder(-1);\n        Node::addChild(_backGroundImage, BACKGROUNDIMAGE_Z, -1);\n    }\n    _backGroundImage->setPosition(Point(_size.width/2.0f, _size.height/2.0f));\n}\n\nvoid Layout::removeBackGroundImage()\n{\n    if (!_backGroundImage)\n    {\n        return;\n    }\n    Node::removeChild(_backGroundImage);\n    _backGroundImage = nullptr;\n    _backGroundImageFileName = \"\";\n    _backGroundImageTextureSize = Size::ZERO;\n}\n\nvoid Layout::setBackGroundColorType(LayoutBackGroundColorType type)\n{\n    if (_colorType == type)\n    {\n        return;\n    }\n    switch (_colorType)\n    {\n        case LAYOUT_COLOR_NONE:\n            if (_colorRender)\n            {\n                Node::removeChild(_colorRender);\n                _colorRender = nullptr;\n            }\n            if (_gradientRender)\n            {\n                Node::removeChild(_gradientRender);\n                _gradientRender = nullptr;\n            }\n            break;\n        case LAYOUT_COLOR_SOLID:\n            if (_colorRender)\n            {\n                Node::removeChild(_colorRender);\n                _colorRender = nullptr;\n            }\n            break;\n        case LAYOUT_COLOR_GRADIENT:\n            if (_gradientRender)\n            {\n                Node::removeChild(_gradientRender);\n                _gradientRender = nullptr;\n            }\n            break;\n        default:\n            break;\n    }\n    _colorType = type;\n    switch (_colorType)\n    {\n        case LAYOUT_COLOR_NONE:\n            break;\n        case LAYOUT_COLOR_SOLID:\n            _colorRender = LayerColor::create();\n            _colorRender->setContentSize(_size);\n            _colorRender->setOpacity(_cOpacity);\n            _colorRender->setColor(_cColor);\n            Node::addChild(_colorRender, BCAKGROUNDCOLORRENDERER_Z, -1);\n            break;\n        case LAYOUT_COLOR_GRADIENT:\n            _gradientRender = LayerGradient::create();\n            _gradientRender->setContentSize(_size);\n            _gradientRender->setOpacity(_cOpacity);\n            _gradientRender->setStartColor(_gStartColor);\n            _gradientRender->setEndColor(_gEndColor);\n            _gradientRender->setVector(_alongVector);\n            Node::addChild(_gradientRender, BCAKGROUNDCOLORRENDERER_Z, -1);\n            break;\n        default:\n            break;\n    }\n}\n\nvoid Layout::setBackGroundColor(const Color3B &color)\n{\n    _cColor = color;\n    if (_colorRender)\n    {\n        _colorRender->setColor(color);\n    }\n}\n\nvoid Layout::setBackGroundColor(const Color3B &startColor, const Color3B &endColor)\n{\n    _gStartColor = startColor;\n    if (_gradientRender)\n    {\n        _gradientRender->setStartColor(startColor);\n    }\n    _gEndColor = endColor;\n    if (_gradientRender)\n    {\n        _gradientRender->setEndColor(endColor);\n    }\n}\n\nvoid Layout::setBackGroundColorOpacity(int opacity)\n{\n    _cOpacity = opacity;\n    switch (_colorType)\n    {\n        case LAYOUT_COLOR_NONE:\n            break;\n        case LAYOUT_COLOR_SOLID:\n            _colorRender->setOpacity(opacity);\n            break;\n        case LAYOUT_COLOR_GRADIENT:\n            _gradientRender->setOpacity(opacity);\n            break;\n        default:\n            break;\n    }\n}\n\nvoid Layout::setBackGroundColorVector(const Point &vector)\n{\n    _alongVector = vector;\n    if (_gradientRender)\n    {\n        _gradientRender->setVector(vector);\n    }\n}\n\nconst Size& Layout::getBackGroundImageTextureSize() const\n{\n    return _backGroundImageTextureSize;\n}\n\nvoid Layout::setLayoutType(LayoutType type)\n{\n    _layoutType = type;\n    for (auto& child : _widgetChildren)\n    {\n        if (child)\n        {\n            supplyTheLayoutParameterLackToChild(static_cast<Widget*>(child));\n        }\n    }\n    _doLayoutDirty = true;\n}\n\nLayoutType Layout::getLayoutType() const\n{\n    return _layoutType;\n}\n    \nvoid Layout::requestDoLayout()\n{\n    _doLayoutDirty = true;\n}\n\nvoid Layout::doLayout()\n{\n    if (!_doLayoutDirty)\n    {\n        return;\n    }\n    switch (_layoutType)\n    {\n        case LAYOUT_ABSOLUTE:\n            break;\n        case LAYOUT_LINEAR_VERTICAL:\n        {\n            Size layoutSize = getSize();\n            float topBoundary = layoutSize.height;\n            \n            for (auto& subWidget : _widgetChildren)\n            {\n                Widget* child = static_cast<Widget*>(subWidget);\n                LinearLayoutParameter* layoutParameter = dynamic_cast<LinearLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_LINEAR));\n                \n                if (layoutParameter)\n                {\n                    LinearGravity childGravity = layoutParameter->getGravity();\n                    Point ap = child->getAnchorPoint();\n                    Size cs = child->getSize();\n                    float finalPosX = ap.x * cs.width;\n                    float finalPosY = topBoundary - ((1.0f-ap.y) * cs.height);\n                    switch (childGravity)\n                    {\n                        case LINEAR_GRAVITY_NONE:\n                        case LINEAR_GRAVITY_LEFT:\n                            break;\n                        case LINEAR_GRAVITY_RIGHT:\n                            finalPosX = layoutSize.width - ((1.0f - ap.x) * cs.width);\n                            break;\n                        case LINEAR_GRAVITY_CENTER_HORIZONTAL:\n                            finalPosX = layoutSize.width / 2.0f - cs.width * (0.5f-ap.x);\n                            break;\n                        default:\n                            break;\n                    }\n                    Margin mg = layoutParameter->getMargin();\n                    finalPosX += mg.left;\n                    finalPosY -= mg.top;\n                    child->setPosition(Point(finalPosX, finalPosY));\n                    topBoundary = child->getBottomInParent() - mg.bottom;\n                }\n            }\n            break;\n        }\n        case LAYOUT_LINEAR_HORIZONTAL:\n        {\n            Size layoutSize = getSize();\n            float leftBoundary = 0.0f;\n            for (auto& subWidget : _widgetChildren)\n            {\n                Widget* child = static_cast<Widget*>(subWidget);\n                LinearLayoutParameter* layoutParameter = dynamic_cast<LinearLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_LINEAR));\n                \n                if (layoutParameter)\n                {\n                    LinearGravity childGravity = layoutParameter->getGravity();\n                    Point ap = child->getAnchorPoint();\n                    Size cs = child->getSize();\n                    float finalPosX = leftBoundary + (ap.x * cs.width);\n                    float finalPosY = layoutSize.height - (1.0f - ap.y) * cs.height;\n                    switch (childGravity)\n                    {\n                        case LINEAR_GRAVITY_NONE:\n                        case LINEAR_GRAVITY_TOP:\n                            break;\n                        case LINEAR_GRAVITY_BOTTOM:\n                            finalPosY = ap.y * cs.height;\n                            break;\n                        case LINEAR_GRAVITY_CENTER_VERTICAL:\n                            finalPosY = layoutSize.height / 2.0f - cs.height * (0.5f - ap.y);\n                            break;\n                        default:\n                            break;\n                    }\n                    Margin mg = layoutParameter->getMargin();\n                    finalPosX += mg.left;\n                    finalPosY -= mg.top;\n                    child->setPosition(Point(finalPosX, finalPosY));\n                    leftBoundary = child->getRightInParent() + mg.right;\n                }\n            }\n            break;\n        }\n        case LAYOUT_RELATIVE:\n        {\n            ssize_t unlayoutChildCount = _widgetChildren.size();\n            Size layoutSize = getSize();\n            for (auto& subWidget : _widgetChildren)\n            {\n                Widget* child = static_cast<Widget*>(subWidget);\n                RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));\n                layoutParameter->_put = false;\n            }\n            while (unlayoutChildCount > 0)\n            {\n                for (auto& subWidget : _widgetChildren)\n                {\n                    Widget* child = static_cast<Widget*>(subWidget);\n                    RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(child->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));\n                    \n                    if (layoutParameter)\n                    {\n                        if (layoutParameter->_put)\n                        {\n                            continue;\n                        }\n                        Point ap = child->getAnchorPoint();\n                        Size cs = child->getSize();\n                        RelativeAlign align = layoutParameter->getAlign();\n                        const char* relativeName = layoutParameter->getRelativeToWidgetName();\n                        Widget* relativeWidget = nullptr;\n                        RelativeLayoutParameter* relativeWidgetLP = nullptr;\n                        float finalPosX = 0.0f;\n                        float finalPosY = 0.0f;\n                        if (relativeName && strcmp(relativeName, \"\"))\n                        {\n                            relativeWidget = Helper::seekWidgetByRelativeName(this, relativeName);\n                            if (relativeWidget)\n                            {\n                                relativeWidgetLP = dynamic_cast<RelativeLayoutParameter*>(relativeWidget->getLayoutParameter(LAYOUT_PARAMETER_RELATIVE));\n                            }\n                        }\n                        switch (align)\n                        {\n                            case RELATIVE_ALIGN_NONE:\n                            case RELATIVE_ALIGN_PARENT_TOP_LEFT:\n                                finalPosX = ap.x * cs.width;\n                                finalPosY = layoutSize.height - ((1.0f - ap.y) * cs.height);\n                                break;\n                            case RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL:\n                                finalPosX = layoutSize.width * 0.5f - cs.width * (0.5f - ap.x);\n                                finalPosY = layoutSize.height - ((1.0f - ap.y) * cs.height);\n                                break;\n                            case RELATIVE_ALIGN_PARENT_TOP_RIGHT:\n                                finalPosX = layoutSize.width - ((1.0f - ap.x) * cs.width);\n                                finalPosY = layoutSize.height - ((1.0f - ap.y) * cs.height);\n                                break;\n                            case RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL:\n                                finalPosX = ap.x * cs.width;\n                                finalPosY = layoutSize.height * 0.5f - cs.height * (0.5f - ap.y);\n                                break;\n                            case RELATIVE_CENTER_IN_PARENT:\n                                finalPosX = layoutSize.width * 0.5f - cs.width * (0.5f - ap.x);\n                                finalPosY = layoutSize.height * 0.5f - cs.height * (0.5f - ap.y);\n                                break;\n                            case RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL:\n                                finalPosX = layoutSize.width - ((1.0f - ap.x) * cs.width);\n                                finalPosY = layoutSize.height * 0.5f - cs.height * (0.5f - ap.y);\n                                break;\n                            case RELATIVE_ALIGN_PARENT_LEFT_BOTTOM:\n                                finalPosX = ap.x * cs.width;\n                                finalPosY = ap.y * cs.height;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL:\n                                finalPosX = layoutSize.width * 0.5f - cs.width * (0.5f - ap.x);\n                                finalPosY = ap.y * cs.height;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM:\n                                finalPosX = layoutSize.width - ((1.0f - ap.x) * cs.width);\n                                finalPosY = ap.y * cs.height;\n                                break;\n                                \n                            case RELATIVE_LOCATION_ABOVE_LEFTALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationBottom = relativeWidget->getTopInParent();\n                                    float locationLeft = relativeWidget->getLeftInParent();\n                                    finalPosY = locationBottom + ap.y * cs.height;\n                                    finalPosX = locationLeft + ap.x * cs.width;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_ABOVE_CENTER:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    Size rbs = relativeWidget->getSize();\n                                    float locationBottom = relativeWidget->getTopInParent();\n                                    \n                                    finalPosY = locationBottom + ap.y * cs.height;\n                                    finalPosX = relativeWidget->getLeftInParent() + rbs.width * 0.5f + ap.x * cs.width - cs.width * 0.5f;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_ABOVE_RIGHTALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationBottom = relativeWidget->getTopInParent();\n                                    float locationRight = relativeWidget->getRightInParent();\n                                    finalPosY = locationBottom + ap.y * cs.height;\n                                    finalPosX = locationRight - (1.0f - ap.x) * cs.width;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_LEFT_OF_TOPALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationTop = relativeWidget->getTopInParent();\n                                    float locationRight = relativeWidget->getLeftInParent();\n                                    finalPosY = locationTop - (1.0f - ap.y) * cs.height;\n                                    finalPosX = locationRight - (1.0f - ap.x) * cs.width;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_LEFT_OF_CENTER:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    Size rbs = relativeWidget->getSize();\n                                    float locationRight = relativeWidget->getLeftInParent();\n                                    finalPosX = locationRight - (1.0f - ap.x) * cs.width;\n                                    \n                                    finalPosY = relativeWidget->getBottomInParent() + rbs.height * 0.5f + ap.y * cs.height - cs.height * 0.5f;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_LEFT_OF_BOTTOMALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationBottom = relativeWidget->getBottomInParent();\n                                    float locationRight = relativeWidget->getLeftInParent();\n                                    finalPosY = locationBottom + ap.y * cs.height;\n                                    finalPosX = locationRight - (1.0f - ap.x) * cs.width;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_RIGHT_OF_TOPALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationTop = relativeWidget->getTopInParent();\n                                    float locationLeft = relativeWidget->getRightInParent();\n                                    finalPosY = locationTop - (1.0f - ap.y) * cs.height;\n                                    finalPosX = locationLeft + ap.x * cs.width;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_RIGHT_OF_CENTER:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    Size rbs = relativeWidget->getSize();\n                                    float locationLeft = relativeWidget->getRightInParent();\n                                    finalPosX = locationLeft + ap.x * cs.width;\n                                    \n                                    finalPosY = relativeWidget->getBottomInParent() + rbs.height * 0.5f + ap.y * cs.height - cs.height * 0.5f;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_RIGHT_OF_BOTTOMALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationBottom = relativeWidget->getBottomInParent();\n                                    float locationLeft = relativeWidget->getRightInParent();\n                                    finalPosY = locationBottom + ap.y * cs.height;\n                                    finalPosX = locationLeft + ap.x * cs.width;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_BELOW_LEFTALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationTop = relativeWidget->getBottomInParent();\n                                    float locationLeft = relativeWidget->getLeftInParent();\n                                    finalPosY = locationTop - (1.0f - ap.y) * cs.height;\n                                    finalPosX = locationLeft + ap.x * cs.width;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_BELOW_CENTER:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    Size rbs = relativeWidget->getSize();\n                                    float locationTop = relativeWidget->getBottomInParent();\n                                    \n                                    finalPosY = locationTop - (1.0f - ap.y) * cs.height;\n                                    finalPosX = relativeWidget->getLeftInParent() + rbs.width * 0.5f + ap.x * cs.width - cs.width * 0.5f;\n                                }\n                                break;\n                            case RELATIVE_LOCATION_BELOW_RIGHTALIGN:\n                                if (relativeWidget)\n                                {\n                                    if (relativeWidgetLP && !relativeWidgetLP->_put)\n                                    {\n                                        continue;\n                                    }\n                                    float locationTop = relativeWidget->getBottomInParent();\n                                    float locationRight = relativeWidget->getRightInParent();\n                                    finalPosY = locationTop - (1.0f - ap.y) * cs.height;\n                                    finalPosX = locationRight - (1.0f - ap.x) * cs.width;\n                                }\n                                break;\n                            default:\n                                break;\n                        }\n                        Margin relativeWidgetMargin;\n                        Margin mg = layoutParameter->getMargin();\n                        if (relativeWidgetLP)\n                        {\n                            relativeWidgetMargin = relativeWidgetLP->getMargin();\n                        }\n                        //handle margin\n                        switch (align)\n                        {\n                            case RELATIVE_ALIGN_NONE:\n                            case RELATIVE_ALIGN_PARENT_TOP_LEFT:\n                                finalPosX += mg.left;\n                                finalPosY -= mg.top;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL:\n                                finalPosY -= mg.top;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_TOP_RIGHT:\n                                finalPosX -= mg.right;\n                                finalPosY -= mg.top;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL:\n                                finalPosX += mg.left;\n                                break;\n                            case RELATIVE_CENTER_IN_PARENT:\n                                break;\n                            case RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL:\n                                finalPosX -= mg.right;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_LEFT_BOTTOM:\n                                finalPosX += mg.left;\n                                finalPosY += mg.bottom;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL:\n                                finalPosY += mg.bottom;\n                                break;\n                            case RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM:\n                                finalPosX -= mg.right;\n                                finalPosY += mg.bottom;\n                                break;\n                                \n                            case RELATIVE_LOCATION_ABOVE_LEFTALIGN:\n                                finalPosY += mg.bottom;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT)\n                                {\n                                    finalPosY += relativeWidgetMargin.top;\n                                }\n                                finalPosX += mg.left;\n                                break;\n                            case RELATIVE_LOCATION_ABOVE_RIGHTALIGN:\n                                finalPosY += mg.bottom;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT)\n                                {\n                                    finalPosY += relativeWidgetMargin.top;\n                                }\n                                finalPosX -= mg.right;\n                                break;\n                            case RELATIVE_LOCATION_ABOVE_CENTER:\n                                finalPosY += mg.bottom;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT)\n                                {\n                                    finalPosY += relativeWidgetMargin.top;\n                                }\n                                break;\n                                \n                            case RELATIVE_LOCATION_LEFT_OF_TOPALIGN:\n                                finalPosX -= mg.right;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL)\n                                {\n                                    finalPosX -= relativeWidgetMargin.left;\n                                }\n                                finalPosY -= mg.top;\n                                break;\n                            case RELATIVE_LOCATION_LEFT_OF_BOTTOMALIGN:\n                                finalPosX -= mg.right;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL)\n                                {\n                                    finalPosX -= relativeWidgetMargin.left;\n                                }\n                                finalPosY += mg.bottom;\n                                break;\n                            case RELATIVE_LOCATION_LEFT_OF_CENTER:\n                                finalPosX -= mg.right;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_LEFT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_NONE\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL)\n                                {\n                                    finalPosX -= relativeWidgetMargin.left;\n                                }\n                                break;\n                                \n                            case RELATIVE_LOCATION_RIGHT_OF_TOPALIGN:\n                                finalPosX += mg.left;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL)\n                                {\n                                    finalPosX += relativeWidgetMargin.right;\n                                }\n                                finalPosY -= mg.top;\n                                break;\n                            case RELATIVE_LOCATION_RIGHT_OF_BOTTOMALIGN:\n                                finalPosX += mg.left;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL)\n                                {\n                                    finalPosX += relativeWidgetMargin.right;\n                                }\n                                finalPosY += mg.bottom;\n                                break;\n                            case RELATIVE_LOCATION_RIGHT_OF_CENTER:\n                                finalPosX += mg.left;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_TOP_RIGHT\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL)\n                                {\n                                    finalPosX += relativeWidgetMargin.right;\n                                }\n                                break;\n                                \n                            case RELATIVE_LOCATION_BELOW_LEFTALIGN:\n                                finalPosY -= mg.top;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL)\n                                {\n                                    finalPosY -= relativeWidgetMargin.bottom;\n                                }\n                                finalPosX += mg.left;\n                                break;\n                            case RELATIVE_LOCATION_BELOW_RIGHTALIGN:\n                                finalPosY -= mg.top;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL)\n                                {\n                                    finalPosY -= relativeWidgetMargin.bottom;\n                                }\n                                finalPosX -= mg.right;\n                                break;\n                            case RELATIVE_LOCATION_BELOW_CENTER:\n                                finalPosY -= mg.top;\n                                if (relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_LEFT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM\n                                    && relativeWidgetLP->getAlign() != RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL)\n                                {\n                                    finalPosY -= relativeWidgetMargin.bottom;\n                                }\n                                break;\n                            default:\n                                break;\n                        }\n                        child->setPosition(Point(finalPosX, finalPosY));\n                        layoutParameter->_put = true;\n                        unlayoutChildCount--;\n                    }\n                }\n            }\n            break;\n        }\n        default:\n            break;\n    }\n    _doLayoutDirty = false;\n}\n\nstd::string Layout::getDescription() const\n{\n    return \"Layout\";\n}\n\nWidget* Layout::createCloneInstance()\n{\n    return Layout::create();\n}\n\nvoid Layout::copyClonedWidgetChildren(Widget* model)\n{\n    Widget::copyClonedWidgetChildren(model);\n}\n\nvoid Layout::copySpecialProperties(Widget *widget)\n{\n    Layout* layout = dynamic_cast<Layout*>(widget);\n    if (layout)\n    {\n        setBackGroundImageScale9Enabled(layout->_backGroundScale9Enabled);\n        setBackGroundImage(layout->_backGroundImageFileName.c_str(),layout->_bgImageTexType);\n        setBackGroundImageCapInsets(layout->_backGroundImageCapInsets);\n        setBackGroundColorType(layout->_colorType);\n        setBackGroundColor(layout->_cColor);\n        setBackGroundColor(layout->_gStartColor, layout->_gEndColor);\n        setBackGroundColorOpacity(layout->_cOpacity);\n        setBackGroundColorVector(layout->_alongVector);\n        setLayoutType(layout->_layoutType);\n        setClippingEnabled(layout->_clippingEnabled);\n        setClippingType(layout->_clippingType);\n    }\n}\n}\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UILayout.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __LAYOUT_H__\n#define __LAYOUT_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\ntypedef enum\n{\n    LAYOUT_COLOR_NONE,\n    LAYOUT_COLOR_SOLID,\n    LAYOUT_COLOR_GRADIENT\n}LayoutBackGroundColorType;\n\ntypedef enum\n{\n    LAYOUT_ABSOLUTE,\n    LAYOUT_LINEAR_VERTICAL,\n    LAYOUT_LINEAR_HORIZONTAL,\n    LAYOUT_RELATIVE\n}LayoutType;\n\ntypedef enum {\n    LAYOUT_CLIPPING_STENCIL,\n    LAYOUT_CLIPPING_SCISSOR\n}LayoutClippingType;\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass Layout : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    Layout();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~Layout();\n    \n    /**\n     * Allocates and initializes a layout.\n     */\n    static Layout* create();\n        \n    //background\n    /**\n     * Sets a background image for layout\n     *\n     * @param fileName image file path.\n     *\n     * @param texType @see TextureResType. UI_TEX_TYPE_LOCAL means local file, UI_TEX_TYPE_PLIST means sprite frame.\n     */\n    void setBackGroundImage(const char* fileName,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Sets a background image capinsets for layout, if the background image is a scale9 render.\n     *\n     * @param capinsets of background image.\n     *\n     */\n    void setBackGroundImageCapInsets(const Rect& capInsets);\n    \n    /**\n     * Sets Color Type for layout.\n     *\n     * @param type   @see LayoutBackGroundColorType.\n     */\n    void setBackGroundColorType(LayoutBackGroundColorType type);\n    \n    /**\n     * Sets background iamge use scale9 renderer.\n     *\n     * @param enabled   true that use scale9 renderer, false otherwise.\n     */\n    void setBackGroundImageScale9Enabled(bool enabled);\n    \n    /**\n     * Sets background color for layout, if color type is LAYOUT_COLOR_SOLID\n     *\n     * @param color\n     */\n    void setBackGroundColor(const Color3B &color);\n    \n    /**\n     * Sets background color for layout, if color type is LAYOUT_COLOR_GRADIENT\n     *\n     * @param start color\n     *\n     * @param end color\n     */\n    void setBackGroundColor(const Color3B &startColor, const Color3B &endColor);\n    \n    /**\n     * Sets background opacity layout.\n     *\n     * @param opacity\n     */\n    void setBackGroundColorOpacity(int opacity);\n    \n    /**\n     * Sets background color vector for layout, if color type is LAYOUT_COLOR_GRADIENT\n     *\n     * @param vector\n     */\n    void setBackGroundColorVector(const Point &vector);\n    \n    /**\n     * Remove the background image of layout.\n     */\n    void removeBackGroundImage();\n    \n    /**\n     * Gets background image texture size.\n     *\n     * @return background image texture size.\n     */\n    const Size& getBackGroundImageTextureSize() const;\n    \n    /**\n     * Changes if layout can clip it's content and child.\n     *\n     * If you really need this, please enable it. But it would reduce the rendering efficiency. \n     *\n     * @param clipping enabled.\n     */\n    virtual void setClippingEnabled(bool enabled);\n    \n    void setClippingType(LayoutClippingType type);\n    \n    /**\n     * Gets if layout is clipping enabled.\n     *\n     * @return if layout is clipping enabled.\n     */\n    virtual bool isClippingEnabled();\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n    \n    /**\n     * Sets LayoutType.\n     *\n     * @see LayoutType\n     *\n     * @param LayoutType\n     */\n    virtual void setLayoutType(LayoutType type);\n    \n    /**\n     * Gets LayoutType.\n     *\n     * @see LayoutType\n     *\n     * @return LayoutType\n     */\n    virtual LayoutType getLayoutType() const;\n\n    virtual void addChild(Node * child) override;\n    /**\n     * Adds a child to the container with a z-order\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to setLocalZOrder(int)\n     */\n    virtual void addChild(Node * child, int zOrder) override;\n    /**\n     * Adds a child to the container with z order and tag\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to setLocalZOrder(int)\n     * @param tag       A interger to identify the node easily. Please refer to setTag(int)\n     */\n    virtual void addChild(Node* child, int zOrder, int tag) override;\n    \n    virtual void visit();\n    \n    virtual void sortAllChildren() override;\n    \n    void requestDoLayout();\n    \n    virtual void onEnter() override;\n    virtual void onExit() override;\n    \n    virtual bool hitTest(const Point &pt);\nprotected:\n    //override \"init\" method of widget.\n    virtual bool init() override;\n        \n    //override \"onSizeChanged\" method of widget.\n    virtual void onSizeChanged() override;\n    \n    //init background image renderer.\n    void addBackGroundImage();\n    \n    void supplyTheLayoutParameterLackToChild(Widget* child);\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\n    virtual void copyClonedWidgetChildren(Widget* model) override;\n    \n    void stencilClippingVisit();\n    void scissorClippingVisit();\n    \n    void setStencilClippingSize(const Size& size);\n    const Rect& getClippingRect();\n    virtual void doLayout();\n    \n    //clipping\n    void onBeforeVisitStencil();\n    void onAfterDrawStencil();\n    void onAfterVisitStencil();\n    \n    void onBeforeVisitScissor();\n    void onAfterVisitScissor();\nprotected:\n    bool _clippingEnabled;\n    \n    //background\n    bool _backGroundScale9Enabled;\n    Node* _backGroundImage;\n    std::string _backGroundImageFileName;\n    Rect _backGroundImageCapInsets;\n    LayoutBackGroundColorType _colorType;\n    TextureResType _bgImageTexType;\n    LayerColor* _colorRender;\n    LayerGradient* _gradientRender;\n    Color3B _cColor;\n    Color3B _gStartColor;\n    Color3B _gEndColor;\n    Point _alongVector;\n    int _cOpacity;\n    Size _backGroundImageTextureSize;\n    LayoutType _layoutType;\n    LayoutClippingType _clippingType;\n    DrawNode* _clippingStencil;\n    bool _scissorRectDirty;\n    Rect _clippingRect;\n    Layout* _clippingParent;\n    bool _doLayoutDirty;\n    \n    //clipping\n\n    GLboolean _currentStencilEnabled;\n    GLuint _currentStencilWriteMask;\n    GLenum _currentStencilFunc;\n    GLint _currentStencilRef;\n    GLuint _currentStencilValueMask;\n    GLenum _currentStencilFail;\n    GLenum _currentStencilPassDepthFail;\n    GLenum _currentStencilPassDepthPass;\n    GLboolean _currentDepthWriteMask;\n    \n    GLboolean _currentAlphaTestEnabled;\n    GLenum _currentAlphaTestFunc;\n    GLclampf _currentAlphaTestRef;\n    \n    GLint _mask_layer_le;\n    \n    GroupCommand _groupCommand;\n    CustomCommand _beforeVisitCmdStencil;\n    CustomCommand _afterDrawStencilCmd;\n    CustomCommand _afterVisitCmdStencil;\n    CustomCommand _beforeVisitCmdScissor;\n    CustomCommand _afterVisitCmdScissor;\n};\n    \n}\nNS_CC_END\n#endif /* defined(__Layout__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UILayoutDefine.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"UILayoutDefine.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\n\nMargin::Margin(void) : left(0), top(0), right(0), bottom(0)\n{\n}\n\nMargin::Margin(float l, float t, float r, float b) : left(l), top(t), right(r), bottom(b)\n{\n}\n\nMargin::Margin(const Margin& other) : left(other.left), top(other.top), right(other.right), bottom(other.bottom)\n{\n}\n\nMargin& Margin::operator= (const Margin& other)\n{\n    setMargin(other.left, other.top, other.right, other.bottom);\n    return *this;\n}\n\nvoid Margin::setMargin(float l, float t, float r, float b)\n{\n    left = l;\n    top = t;\n    right = r;\n    bottom = b;\n}\n\nbool Margin::equals(const Margin &target) const\n{\n    return (left == target.left && top == target.top && right == target.right && bottom == target.bottom);\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UILayoutDefine.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UILAYOUTDEFINE_H__\n#define __UILAYOUTDEFINE_H__\n\n#include \"cocos2d.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n/**\n*   @js NA\n*   @lua NA\n*/\nclass Margin\n{\npublic:\n    float left;\n    float top;\n    float right;\n    float bottom;\n    \npublic:\n    Margin();\n    Margin(float l, float t, float r, float b);\n    Margin(const Margin& other);\n    Margin& operator= (const Margin& other);\n    void setMargin(float l, float t, float r, float b);\n    bool equals(const Margin& target) const;\n};\n\nconst Margin MarginZero = Margin();\n\ntypedef enum\n{\n    LINEAR_GRAVITY_NONE,\n    LINEAR_GRAVITY_LEFT,\n    LINEAR_GRAVITY_TOP,\n    LINEAR_GRAVITY_RIGHT,\n    LINEAR_GRAVITY_BOTTOM,\n    LINEAR_GRAVITY_CENTER_VERTICAL,\n    LINEAR_GRAVITY_CENTER_HORIZONTAL\n}LinearGravity;\n\ntypedef enum\n{\n    RELATIVE_ALIGN_NONE,\n    RELATIVE_ALIGN_PARENT_TOP_LEFT,\n    RELATIVE_ALIGN_PARENT_TOP_CENTER_HORIZONTAL,\n    RELATIVE_ALIGN_PARENT_TOP_RIGHT,\n    RELATIVE_ALIGN_PARENT_LEFT_CENTER_VERTICAL,\n    RELATIVE_CENTER_IN_PARENT,\n    RELATIVE_ALIGN_PARENT_RIGHT_CENTER_VERTICAL,\n    RELATIVE_ALIGN_PARENT_LEFT_BOTTOM,\n    RELATIVE_ALIGN_PARENT_BOTTOM_CENTER_HORIZONTAL,\n    RELATIVE_ALIGN_PARENT_RIGHT_BOTTOM,\n    \n    RELATIVE_LOCATION_ABOVE_LEFTALIGN,\n    RELATIVE_LOCATION_ABOVE_CENTER,\n    RELATIVE_LOCATION_ABOVE_RIGHTALIGN,\n    RELATIVE_LOCATION_LEFT_OF_TOPALIGN,\n    RELATIVE_LOCATION_LEFT_OF_CENTER,\n    RELATIVE_LOCATION_LEFT_OF_BOTTOMALIGN,\n    RELATIVE_LOCATION_RIGHT_OF_TOPALIGN,\n    RELATIVE_LOCATION_RIGHT_OF_CENTER,\n    RELATIVE_LOCATION_RIGHT_OF_BOTTOMALIGN,\n    RELATIVE_LOCATION_BELOW_LEFTALIGN,\n    RELATIVE_LOCATION_BELOW_CENTER,\n    RELATIVE_LOCATION_BELOW_RIGHTALIGN\n}RelativeAlign;\n\n}\nNS_CC_END\n#endif /* defined(__UILayoutDefine__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UILayoutParameter.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UILayoutParameter.h\"\n#include \"gui/UILayout.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\n\nLayoutParameter* LayoutParameter::create()\n{\n    LayoutParameter* parameter = new LayoutParameter();\n    if (parameter)\n    {\n        parameter->autorelease();\n        return parameter;\n    }\n    CC_SAFE_DELETE(parameter);\n    return nullptr;\n}\n\nvoid LayoutParameter::setMargin(const Margin &margin)\n{\n    _margin = margin;\n}\n\nconst Margin& LayoutParameter::getMargin() const\n{\n    return _margin;\n}\n\nLayoutParameterType LayoutParameter::getLayoutType() const\n{\n    return _layoutParameterType;\n}\n\nLinearLayoutParameter* LinearLayoutParameter::create()\n{\n    LinearLayoutParameter* parameter = new LinearLayoutParameter();\n    if (parameter)\n    {\n        parameter->autorelease();\n        return parameter;\n    }\n    CC_SAFE_DELETE(parameter);\n    return nullptr;\n}\n\nvoid LinearLayoutParameter::setGravity(LinearGravity gravity)\n{\n    _linearGravity = gravity;\n}\n\nLinearGravity LinearLayoutParameter::getGravity() const\n{\n    return _linearGravity;\n}\n\nRelativeLayoutParameter* RelativeLayoutParameter::create()\n{\n    RelativeLayoutParameter* parameter = new RelativeLayoutParameter();\n    if (parameter)\n    {\n        parameter->autorelease();\n        return parameter;\n    }\n    CC_SAFE_DELETE(parameter);\n    return nullptr;\n}\n\nvoid RelativeLayoutParameter::setAlign(RelativeAlign align)\n{\n    _relativeAlign = align;\n}\n\nRelativeAlign RelativeLayoutParameter::getAlign() const\n{\n    return _relativeAlign;\n}\n\nvoid RelativeLayoutParameter::setRelativeToWidgetName(const char *name)\n{\n    _relativeWidgetName = name;\n}\n\nconst char* RelativeLayoutParameter::getRelativeToWidgetName() const\n{\n    return _relativeWidgetName.c_str();\n}\n\nvoid RelativeLayoutParameter::setRelativeName(const char* name)\n{\n    _relativeLayoutName = name;\n}\n\nconst char* RelativeLayoutParameter::getRelativeName() const\n{\n    return _relativeLayoutName.c_str();\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UILayoutParameter.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __LAYOUTPARMETER_H__\n#define __LAYOUTPARMETER_H__\n\n#include \"gui/UILayoutDefine.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\ntypedef enum\n{\n    LAYOUT_PARAMETER_NONE,\n    LAYOUT_PARAMETER_LINEAR,\n    LAYOUT_PARAMETER_RELATIVE\n}LayoutParameterType;\n/**\n*   @js NA\n*   @lua NA\n*/\nclass LayoutParameter : public Object\n{\npublic:\n    /**\n     * Default constructor\n     */\n    LayoutParameter() : _margin(Margin()){_layoutParameterType = LAYOUT_PARAMETER_NONE;};\n    \n    /**\n     * Default destructor\n     */\n    virtual ~LayoutParameter(){};\n    \n    /**\n     * Allocates and initializes.\n     * @return A initialized LayoutParameter which is marked as \"autorelease\".\n     */\n    static LayoutParameter* create();\n    \n    /**\n     * Sets Margin parameter for LayoutParameter.\n     * \n     * @see Margin\n     *\n     * @param margin\n     */\n    void setMargin(const Margin& margin);\n    \n    /**\n     * Gets Margin parameter of LayoutParameter.\n     *\n     * @see Margin\n     *\n     * @return const Margin&\n     */\n    const Margin& getMargin() const;\n    \n    /**\n     * Gets LayoutParameterType of LayoutParameter.\n     *\n     * @see LayoutParameterType\n     *\n     * @return LayoutParameterType\n     */\n    LayoutParameterType getLayoutType() const;\nprotected:\n    Margin _margin;\n    LayoutParameterType _layoutParameterType;\n};\n/**\n*   @js NA\n*   @lua NA\n*/\nclass LinearLayoutParameter : public LayoutParameter\n{\npublic:\n    /**\n     * Default constructor\n     */\n    LinearLayoutParameter() : _linearGravity(LINEAR_GRAVITY_NONE){_layoutParameterType = LAYOUT_PARAMETER_LINEAR;};\n    \n    /**\n     * Default destructor\n     */\n    virtual ~LinearLayoutParameter(){};\n    \n    /**\n     * Allocates and initializes.\n     * @return A initialized LayoutParameter which is marked as \"autorelease\".\n     */\n    static LinearLayoutParameter* create();\n    \n    /**\n     * Sets LinearGravity parameter for LayoutParameter.\n     *\n     * @see LinearGravity\n     *\n     * @param LinearGravity\n     */\n    void setGravity(LinearGravity gravity);\n    \n    /**\n     * Gets LinearGravity parameter for LayoutParameter.\n     *\n     * @see LinearGravity\n     *\n     * @return LinearGravity\n     */\n    LinearGravity getGravity() const;\nprotected:\n    LinearGravity _linearGravity;\n};\n/**\n*   @js NA\n*   @lua NA\n*/\n\nclass RelativeLayoutParameter : public LayoutParameter\n{\npublic:\n    /**\n     * Default constructor\n     */\n    RelativeLayoutParameter() : _relativeAlign(RELATIVE_ALIGN_NONE),_relativeWidgetName(\"\"),_relativeLayoutName(\"\"),_put(false){_layoutParameterType = LAYOUT_PARAMETER_RELATIVE;};\n    \n    /**\n     * Default destructor\n     */\n    virtual ~RelativeLayoutParameter(){};\n    \n    /**\n     * Allocates and initializes.\n     * @return A initialized LayoutParameter which is marked as \"autorelease\".\n     */\n    static RelativeLayoutParameter* create();\n    \n    /**\n     * Sets RelativeAlign parameter for LayoutParameter.\n     *\n     * @see RelativeAlign\n     *\n     * @param RelativeAlign\n     */\n    void setAlign(RelativeAlign align);\n    \n    /**\n     * Gets RelativeAlign parameter for LayoutParameter.\n     *\n     * @see RelativeAlign\n     *\n     * @return RelativeAlign\n     */\n    RelativeAlign getAlign() const;\n    \n    /**\n     * Sets a key for LayoutParameter. Witch widget named this is relative to.\n     *\n     * @param name\n     */\n    void setRelativeToWidgetName(const char* name);\n    \n    /**\n     * Gets the key of LayoutParameter. Witch widget named this is relative to.\n     *\n     * @return name\n     */\n    const char* getRelativeToWidgetName() const;\n    \n    /**\n     * Sets a name in Relative Layout for LayoutParameter.\n     *\n     * @param name\n     */\n    void setRelativeName(const char* name);\n    \n    /**\n     * Gets a name in Relative Layout of LayoutParameter.\n     *\n     * @return name\n     */\n    const char* getRelativeName() const;\nprotected:\n    RelativeAlign _relativeAlign;\n    std::string _relativeWidgetName;\n    std::string _relativeLayoutName;\n    bool _put;\n    friend class Layout;\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__LayoutParameter__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIListView.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UIListView.h\"\n#include \"gui/UIHelper.h\"\n#include \"extensions/GUI/CCControlExtension/CCScale9Sprite.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nListView::ListView():\n_model(nullptr),\n_gravity(LISTVIEW_GRAVITY_CENTER_HORIZONTAL),\n_itemsMargin(0.0f),\n_listViewEventListener(nullptr),\n_listViewEventSelector(nullptr),\n_curSelectedIndex(0),\n_refreshViewDirty(true)\n{\n    \n}\n\nListView::~ListView()\n{\n    _listViewEventListener = nullptr;\n    _listViewEventSelector = nullptr;\n    _items.clear();\n}\n\nListView* ListView::create()\n{\n    ListView* widget = new ListView();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nbool ListView::init()\n{\n    if (ScrollView::init())\n    {\n        setLayoutType(LAYOUT_LINEAR_VERTICAL);\n        return true;\n    }\n    return false;\n}\n\nvoid ListView::setItemModel(Widget *model)\n{\n    if (!model)\n    {\n        return;\n    }\n    CC_SAFE_RELEASE_NULL(_model);\n    _model = model;\n    CC_SAFE_RETAIN(_model);\n}\n\nvoid ListView::updateInnerContainerSize()\n{\n    switch (_direction)\n    {\n        case SCROLLVIEW_DIR_VERTICAL:\n        {\n            size_t length = _items.size();\n            float totalHeight = (length - 1) * _itemsMargin;\n            for (auto& item : _items)\n            {\n                totalHeight += item->getSize().height;\n            }\n            float finalWidth = _size.width;\n            float finalHeight = totalHeight;\n            setInnerContainerSize(Size(finalWidth, finalHeight));\n            break;\n        }\n        case SCROLLVIEW_DIR_HORIZONTAL:\n        {\n            size_t length = _items.size();\n            float totalWidth = (length - 1) * _itemsMargin;\n            for (auto& item : _items)\n            {\n                totalWidth += item->getSize().width;\n            }\n            float finalWidth = totalWidth;\n            float finalHeight = _size.height;\n            setInnerContainerSize(Size(finalWidth, finalHeight));\n            break;\n        }\n        default:\n            break;\n    }\n}\n\nvoid ListView::remedyLayoutParameter(Widget *item)\n{\n    if (!item)\n    {\n        return;\n    }\n    switch (_direction) {\n        case SCROLLVIEW_DIR_VERTICAL:\n        {\n            LinearLayoutParameter* llp = (LinearLayoutParameter*)(item->getLayoutParameter(LAYOUT_PARAMETER_LINEAR));\n            if (!llp)\n            {\n                LinearLayoutParameter* defaultLp = LinearLayoutParameter::create();\n                switch (_gravity) {\n                    case LISTVIEW_GRAVITY_LEFT:\n                        defaultLp->setGravity(LINEAR_GRAVITY_LEFT);\n                        break;\n                    case LISTVIEW_GRAVITY_RIGHT:\n                        defaultLp->setGravity(LINEAR_GRAVITY_RIGHT);\n                        break;\n                    case LISTVIEW_GRAVITY_CENTER_HORIZONTAL:\n                        defaultLp->setGravity(LINEAR_GRAVITY_CENTER_HORIZONTAL);\n                        break;\n                    default:\n                        break;\n                }\n                if (getIndex(item) == 0)\n                {\n                    defaultLp->setMargin(MarginZero);\n                }\n                else\n                {\n                    defaultLp->setMargin(Margin(0.0f, _itemsMargin, 0.0f, 0.0f));\n                }\n                item->setLayoutParameter(defaultLp);\n            }\n            else\n            {\n                if (getIndex(item) == 0)\n                {\n                    llp->setMargin(MarginZero);\n                }\n                else\n                {\n                    llp->setMargin(Margin(0.0f, _itemsMargin, 0.0f, 0.0f));\n                }\n                switch (_gravity) {\n                    case LISTVIEW_GRAVITY_LEFT:\n                        llp->setGravity(LINEAR_GRAVITY_LEFT);\n                        break;\n                    case LISTVIEW_GRAVITY_RIGHT:\n                        llp->setGravity(LINEAR_GRAVITY_RIGHT);\n                        break;\n                    case LISTVIEW_GRAVITY_CENTER_HORIZONTAL:\n                        llp->setGravity(LINEAR_GRAVITY_CENTER_HORIZONTAL);\n                        break;\n                    default:\n                        break;\n                }\n            }\n            break;\n        }\n        case SCROLLVIEW_DIR_HORIZONTAL:\n        {\n            LinearLayoutParameter* llp = (LinearLayoutParameter*)(item->getLayoutParameter(LAYOUT_PARAMETER_LINEAR));\n            if (!llp)\n            {\n                LinearLayoutParameter* defaultLp = LinearLayoutParameter::create();\n                switch (_gravity) {\n                    case LISTVIEW_GRAVITY_TOP:\n                        defaultLp->setGravity(LINEAR_GRAVITY_TOP);\n                        break;\n                    case LISTVIEW_GRAVITY_BOTTOM:\n                        defaultLp->setGravity(LINEAR_GRAVITY_BOTTOM);\n                        break;\n                    case LISTVIEW_GRAVITY_CENTER_VERTICAL:\n                        defaultLp->setGravity(LINEAR_GRAVITY_CENTER_VERTICAL);\n                        break;\n                    default:\n                        break;\n                }\n                if (getIndex(item) == 0)\n                {\n                    defaultLp->setMargin(MarginZero);\n                }\n                else\n                {\n                    defaultLp->setMargin(Margin(_itemsMargin, 0.0f, 0.0f, 0.0f));\n                }\n                item->setLayoutParameter(defaultLp);\n            }\n            else\n            {\n                if (getIndex(item) == 0)\n                {\n                    llp->setMargin(MarginZero);\n                }\n                else\n                {\n                    llp->setMargin(Margin(_itemsMargin, 0.0f, 0.0f, 0.0f));\n                }\n                switch (_gravity) {\n                    case LISTVIEW_GRAVITY_TOP:\n                        llp->setGravity(LINEAR_GRAVITY_TOP);\n                        break;\n                    case LISTVIEW_GRAVITY_BOTTOM:\n                        llp->setGravity(LINEAR_GRAVITY_BOTTOM);\n                        break;\n                    case LISTVIEW_GRAVITY_CENTER_VERTICAL:\n                        llp->setGravity(LINEAR_GRAVITY_CENTER_VERTICAL);\n                        break;\n                    default:\n                        break;\n                }\n            }\n            break;\n        }\n        default:\n            break;\n    }\n    \n}\n\nvoid ListView::pushBackDefaultItem()\n{\n    if (!_model)\n    {\n        return;\n    }\n    Widget* newItem = _model->clone();\n    _items.pushBack(newItem);\n    remedyLayoutParameter(newItem);\n    addChild(newItem);\n    _refreshViewDirty = true;\n}\n\nvoid ListView::insertDefaultItem(ssize_t index)\n{\n    if (!_model)\n    {\n        return;\n    }\n    Widget* newItem = _model->clone();\n    _items.insert(index, newItem);\n    remedyLayoutParameter(newItem);\n    addChild(newItem);\n    _refreshViewDirty = true;\n}\n\nvoid ListView::pushBackCustomItem(Widget* item)\n{\n    _items.pushBack(item);\n    remedyLayoutParameter(item);\n    addChild(item);\n    _refreshViewDirty = true;\n}\n\nvoid ListView::insertCustomItem(Widget* item, ssize_t index)\n{\n    _items.insert(index, item);\n    remedyLayoutParameter(item);\n    addChild(item);\n    _refreshViewDirty = true;\n}\n\nvoid ListView::removeItem(ssize_t index)\n{\n    Widget* item = getItem(index);\n    if (!item)\n    {\n        return;\n    }\n    _items.eraseObject(item);\n    removeChild(item);\n    _refreshViewDirty = true;\n}\n\nvoid ListView::removeLastItem()\n{\n    removeItem(_items.size() -1);\n}\n    \nvoid ListView::removeAllItems()\n{\n    _items.clear();\n    removeAllChildren();\n}\n\nWidget* ListView::getItem(ssize_t index)\n{\n    if (index < 0 || index >= _items.size())\n    {\n        return nullptr;\n    }\n    return _items.at(index);\n}\n\nVector<Widget*>& ListView::getItems()\n{\n    return _items;\n}\n\nssize_t ListView::getIndex(Widget *item) const\n{\n    if (!item)\n    {\n        return -1;\n    }\n    return _items.getIndex(item);\n}\n\nvoid ListView::setGravity(ListViewGravity gravity)\n{\n    if (_gravity == gravity)\n    {\n        return;\n    }\n    _gravity = gravity;\n    _refreshViewDirty = true;\n}\n\nvoid ListView::setItemsMargin(float margin)\n{\n    if (_itemsMargin == margin)\n    {\n        return;\n    }\n    _itemsMargin = margin;\n    _refreshViewDirty = true;\n}\n\nvoid ListView::setDirection(SCROLLVIEW_DIR dir)\n{\n    switch (dir)\n    {\n        case SCROLLVIEW_DIR_VERTICAL:\n            setLayoutType(LAYOUT_LINEAR_VERTICAL);\n            break;\n        case SCROLLVIEW_DIR_HORIZONTAL:\n            setLayoutType(LAYOUT_LINEAR_HORIZONTAL);\n            break;\n        case SCROLLVIEW_DIR_BOTH:\n            return;\n        default:\n            return;\n            break;\n    }\n    ScrollView::setDirection(dir);\n}\n    \nvoid ListView::requestRefreshView()\n{\n    _refreshViewDirty = true;\n}\n\nvoid ListView::refreshView()\n{\n    ssize_t length = _items.size();\n    for (int i=0; i<length; i++)\n    {\n        Widget* item = _items.at(i);\n        item->setLocalZOrder(i);\n        remedyLayoutParameter(item);\n    }\n    updateInnerContainerSize();\n}\n    \nvoid ListView::sortAllChildren()\n{\n    ScrollView::sortAllChildren();\n    if (_refreshViewDirty)\n    {\n        refreshView();\n        _refreshViewDirty = false;\n    }\n}\n    \nvoid ListView::addEventListenerListView(Object *target, SEL_ListViewEvent selector)\n{\n    _listViewEventListener = target;\n    _listViewEventSelector = selector;\n}\n    \nvoid ListView::selectedItemEvent()\n{\n    if (_listViewEventListener && _listViewEventSelector)\n    {\n        (_listViewEventListener->*_listViewEventSelector)(this, LISTVIEW_ONSELECTEDITEM);\n    }\n}\n    \nvoid ListView::interceptTouchEvent(int handleState, Widget *sender, const Point &touchPoint)\n{\n    ScrollView::interceptTouchEvent(handleState, sender, touchPoint);\n    if (handleState != 1)\n    {\n        Widget* parent = sender;\n        while (parent)\n        {\n            if (parent && parent->getParent() == _innerContainer)\n            {\n                _curSelectedIndex = getIndex(parent);\n                break;\n            }\n            parent = dynamic_cast<Widget*>(parent->getParent());\n        }\n        selectedItemEvent();\n    }\n}\n    \nssize_t ListView::getCurSelectedIndex() const\n{\n    return _curSelectedIndex;\n}\n\nvoid ListView::onSizeChanged()\n{\n    ScrollView::onSizeChanged();\n    _refreshViewDirty = true;\n}\n\nstd::string ListView::getDescription() const\n{\n    return \"ListView\";\n}\n\nWidget* ListView::createCloneInstance()\n{\n    return ListView::create();\n}\n\nvoid ListView::copyClonedWidgetChildren(Widget* model)\n{\n    auto& arrayItems = static_cast<ListView*>(model)->getItems();\n    for (auto& item : arrayItems)\n    {\n        pushBackCustomItem(item->clone());\n    }\n}\n\nvoid ListView::copySpecialProperties(Widget *widget)\n{\n    ListView* listViewEx = dynamic_cast<ListView*>(widget);\n    if (listViewEx)\n    {\n        ScrollView::copySpecialProperties(widget);\n        setItemModel(listViewEx->_model);\n        setItemsMargin(listViewEx->_itemsMargin);\n        setGravity(listViewEx->_gravity);\n    }\n}\n\n}\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UIListView.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n\n#ifndef __UILISTVIEW_H__\n#define __UILISTVIEW_H__\n\n#include \"gui/UIScrollView.h\"\n\nNS_CC_BEGIN\n\nnamespace gui{\n\ntypedef enum\n{\n    LISTVIEW_GRAVITY_LEFT,\n    LISTVIEW_GRAVITY_RIGHT,\n    LISTVIEW_GRAVITY_CENTER_HORIZONTAL,\n    \n    LISTVIEW_GRAVITY_TOP,\n    LISTVIEW_GRAVITY_BOTTOM,\n    LISTVIEW_GRAVITY_CENTER_VERTICAL,\n}ListViewGravity;\n    \ntypedef enum\n{\n    LISTVIEW_ONSELECTEDITEM\n}ListViewEventType;\n\ntypedef void (Object::*SEL_ListViewEvent)(Object*,ListViewEventType);\n#define listvieweventselector(_SELECTOR) (SEL_ListViewEvent)(&_SELECTOR)\n\nclass ListView : public ScrollView\n{\n    \npublic:\n    \n    /**\n     * Default constructor\n     */\n    ListView();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~ListView();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static ListView* create();\n    \n    /**\n     * Sets a item model for listview\n     *\n     * A model will be cloned for adding default item.\n     *\n     * @param model  item model for listview\n     */\n    void setItemModel(Widget* model);\n    \n    /**\n     * Push back a default item(create by a cloned model) into listview.\n     */\n    void pushBackDefaultItem();\n    \n    /**\n     * Insert a default item(create by a cloned model) into listview.\n     */\n    void insertDefaultItem(ssize_t index);\n    \n    /**\n     * Push back custom item into listview.\n     */\n    void pushBackCustomItem(Widget* item);\n    \n    /**\n     * Insert custom item into listview.\n     */\n    void insertCustomItem(Widget* item, ssize_t index);\n    \n    /**\n     *  Removes the last item of listview.\n     */\n    void removeLastItem();\n    \n    /**\n     * Removes a item whose index is same as the parameter.\n     *\n     * @param index of item.\n     */\n    void removeItem(ssize_t index);\n    \n    void removeAllItems();\n    \n    /**\n     * Returns a item whose index is same as the parameter.\n     *\n     * @param index of item.\n     *\n     * @return the item widget.\n     */\n    Widget* getItem(ssize_t index);\n    \n    /**\n     * Returns the item container.\n     */\n    Vector<Widget*>& getItems();\n    \n    /**\n     * Returns the index of item.\n     *\n     * @param item  the item which need to be checked.\n     *\n     * @return the index of item.\n     */\n    ssize_t getIndex(Widget* item) const;\n    \n    /**\n     * Changes the gravity of listview.\n     * @see ListViewGravity\n     */\n    void setGravity(ListViewGravity gravity);\n    \n    /**\n     * Changes the margin between each item.\n     *\n     * @param margin\n     */\n    void setItemsMargin(float margin);\n    \n    virtual void sortAllChildren() override;\n    \n    ssize_t getCurSelectedIndex() const;\n    \n    void addEventListenerListView(Object* target, SEL_ListViewEvent selector);\n    \n    /**\n     * Changes scroll direction of scrollview.\n     *\n     * @see SCROLLVIEW_DIR      SCROLLVIEW_DIR_VERTICAL means vertical scroll, SCROLLVIEW_DIR_HORIZONTAL means horizontal scroll\n     *\n     * @param SCROLLVIEW_DIR\n     */\n    virtual void setDirection(SCROLLVIEW_DIR dir) override;\n    \n    virtual std::string getDescription() const override;\n    \n    void requestRefreshView();\n    \nprotected:\n    virtual void addChild(Node* child) override{ScrollView::addChild(child);};\n    virtual void addChild(Node * child, int zOrder) override{ScrollView::addChild(child, zOrder);};\n    virtual void addChild(Node* child, int zOrder, int tag) override{ScrollView::addChild(child, zOrder, tag);};\n    virtual void removeChild(Node* widget, bool cleanup = true) override{ScrollView::removeChild(widget, cleanup);};\n    \n    virtual void removeAllChildren() override{removeAllChildrenWithCleanup(true);};\n    virtual void removeAllChildrenWithCleanup(bool cleanup) override {ScrollView::removeAllChildrenWithCleanup(cleanup);};\n    virtual Vector<Node*>& getChildren() override{return ScrollView::getChildren();};\n    virtual const Vector<Node*>& getChildren() const override{return ScrollView::getChildren();};\n    virtual ssize_t getChildrenCount() const override {return ScrollView::getChildrenCount();};\n    virtual Node * getChildByTag(int tag) override {return ScrollView::getChildByTag(tag);};\n    virtual Widget* getChildByName(const char* name) override {return ScrollView::getChildByName(name);};\n    virtual bool init() override;\n    void updateInnerContainerSize();\n    void remedyLayoutParameter(Widget* item);\n    virtual void onSizeChanged() override;\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\n    virtual void copyClonedWidgetChildren(Widget* model) override;\n    void selectedItemEvent();\n    virtual void interceptTouchEvent(int handleState,Widget* sender,const Point &touchPoint) override;\n    void refreshView();\nprotected:\n    \n    Widget* _model;\n    Vector<Widget*> _items;\n    ListViewGravity _gravity;\n    float _itemsMargin;\n    Object*       _listViewEventListener;\n    SEL_ListViewEvent    _listViewEventSelector;\n    ssize_t _curSelectedIndex;\n    bool _refreshViewDirty;\n};\n\n}\nNS_CC_END\n\n#endif /* defined(__ListView__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UILoadingBar.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UILoadingBar.h\"\n#include \"extensions/GUI/CCControlExtension/CCScale9Sprite.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \nstatic const int BAR_RENDERER_Z = (-1);\n    \nLoadingBar::LoadingBar():\n_barType(LoadingBarTypeLeft),\n_percent(100),\n_totalLength(0),\n_barRenderer(nullptr),\n_renderBarTexType(UI_TEX_TYPE_LOCAL),\n_barRendererTextureSize(Size::ZERO),\n_scale9Enabled(false),\n_prevIgnoreSize(true),\n_capInsets(Rect::ZERO),\n_textureFile(\"\")\n{\n}\n\nLoadingBar::~LoadingBar()\n{\n    \n}\n\nLoadingBar* LoadingBar::create()\n{\n    LoadingBar* widget = new LoadingBar();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nvoid LoadingBar::initRenderer()\n{\n    _barRenderer = Sprite::create();\n    Node::addChild(_barRenderer, BAR_RENDERER_Z, -1);\n    _barRenderer->setAnchorPoint(Point(0.0,0.5));\n}\n\nvoid LoadingBar::setDirection(LoadingBarType dir)\n{\n    if (_barType == dir)\n    {\n        return;\n    }\n    _barType = dir;\n\n    switch (_barType)\n    {\n        case LoadingBarTypeLeft:\n            _barRenderer->setAnchorPoint(Point(0.0f,0.5f));\n            _barRenderer->setPosition(Point(-_totalLength*0.5f,0.0f));\n            if (!_scale9Enabled)\n            {\n                static_cast<Sprite*>(_barRenderer)->setFlippedX(false);\n            }\n            break;\n        case LoadingBarTypeRight:\n            _barRenderer->setAnchorPoint(Point(1.0f,0.5f));\n            _barRenderer->setPosition(Point(_totalLength*0.5f,0.0f));\n            if (!_scale9Enabled)\n            {\n                static_cast<Sprite*>(_barRenderer)->setFlippedX(true);\n            }\n            break;\n    }\n}\n\nint LoadingBar::getDirection()\n{\n    return _barType;\n}\n\nvoid LoadingBar::loadTexture(const char* texture,TextureResType texType)\n{\n    if (!texture || strcmp(texture, \"\") == 0)\n    {\n        return;\n    }\n    _renderBarTexType = texType;\n    _textureFile = texture;\n    switch (_renderBarTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            if (_scale9Enabled)\n            {\n                extension::Scale9Sprite* barRendererScale9 = static_cast<extension::Scale9Sprite*>(_barRenderer);\n                barRendererScale9->initWithFile(texture);\n                barRendererScale9->setCapInsets(_capInsets);\n            }\n            else\n            {\n                static_cast<Sprite*>(_barRenderer)->setTexture(texture);\n            }\n            break;\n        case UI_TEX_TYPE_PLIST:\n            if (_scale9Enabled)\n            {\n                extension::Scale9Sprite* barRendererScale9 = static_cast<extension::Scale9Sprite*>(_barRenderer);\n                barRendererScale9->initWithSpriteFrameName(texture);\n                barRendererScale9->setCapInsets(_capInsets);\n            }\n            else\n            {\n                static_cast<Sprite*>(_barRenderer)->setSpriteFrame(texture);\n            }\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    _barRendererTextureSize = _barRenderer->getContentSize();\n    \n    switch (_barType)\n    {\n    case LoadingBarTypeLeft:\n        _barRenderer->setAnchorPoint(Point(0.0f,0.5f));\n        if (!_scale9Enabled)\n        {\n            static_cast<Sprite*>(_barRenderer)->setFlippedX(false);\n        }\n        break;\n    case LoadingBarTypeRight:\n        _barRenderer->setAnchorPoint(Point(1.0f,0.5f));\n        if (!_scale9Enabled)\n        {\n            static_cast<Sprite*>(_barRenderer)->setFlippedX(true);\n        }\n        break;\n    }\n    barRendererScaleChangedWithSize();\n}\n\nvoid LoadingBar::setScale9Enabled(bool enabled)\n{\n    if (_scale9Enabled == enabled)\n    {\n        return;\n    }\n    _scale9Enabled = enabled;\n    Node::removeChild(_barRenderer);\n    _barRenderer = nullptr;\n    if (_scale9Enabled)\n    {\n        _barRenderer = extension::Scale9Sprite::create();\n    }\n    else\n    {\n        _barRenderer = Sprite::create();\n    }\n    loadTexture(_textureFile.c_str(),_renderBarTexType);\n    Node::addChild(_barRenderer, BAR_RENDERER_Z, -1);\n    if (_scale9Enabled)\n    {\n        bool ignoreBefore = _ignoreSize;\n        ignoreContentAdaptWithSize(false);\n        _prevIgnoreSize = ignoreBefore;\n    }\n    else\n    {\n        ignoreContentAdaptWithSize(_prevIgnoreSize);\n    }\n    setCapInsets(_capInsets);\n}\n\nvoid LoadingBar::setCapInsets(const Rect &capInsets)\n{\n    _capInsets = capInsets;\n    if (!_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<extension::Scale9Sprite*>(_barRenderer)->setCapInsets(capInsets);\n}\n\nvoid LoadingBar::setPercent(int percent)\n{\n    if ( percent < 0 || percent > 100)\n    {\n        return;\n    }\n    if (_totalLength <= 0)\n    {\n        return;\n    }\n    _percent = percent;\n    float res = _percent / 100.0f;\n    \n    if (_scale9Enabled)\n    {\n        setScale9Scale();\n    }\n    else\n    {\n        Sprite* spriteRenderer = static_cast<Sprite*>(_barRenderer);\n        Rect rect = spriteRenderer->getTextureRect();\n        rect.size.width = _barRendererTextureSize.width * res;\n        spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size);\n    }\n}\n\nint LoadingBar::getPercent()\n{\n    return _percent;\n}\n\nvoid LoadingBar::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    barRendererScaleChangedWithSize();\n}\n\nvoid LoadingBar::ignoreContentAdaptWithSize(bool ignore)\n{\n    if (!_scale9Enabled || (_scale9Enabled && !ignore))\n    {\n        Widget::ignoreContentAdaptWithSize(ignore);\n        _prevIgnoreSize = ignore;\n    }\n}\n\nconst Size& LoadingBar::getContentSize() const\n{\n    return _barRendererTextureSize;\n}\n\nNode* LoadingBar::getVirtualRenderer()\n{\n    return _barRenderer;\n}\n\nvoid LoadingBar::barRendererScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        if (!_scale9Enabled)\n        {\n            _totalLength = _barRendererTextureSize.width;\n            _barRenderer->setScale(1.0f);\n            _size = _barRendererTextureSize;\n        }\n    }\n    else\n    {\n        _totalLength = _size.width;\n        if (_scale9Enabled)\n        {\n            setScale9Scale();\n        }\n        else\n        {\n            \n            Size textureSize = _barRendererTextureSize;\n            if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n            {\n                _barRenderer->setScale(1.0f);\n                return;\n            }\n            float scaleX = _size.width / textureSize.width;\n            float scaleY = _size.height / textureSize.height;\n            _barRenderer->setScaleX(scaleX);\n            _barRenderer->setScaleY(scaleY);\n        }\n    }\n    switch (_barType)\n    {\n        case LoadingBarTypeLeft:\n            _barRenderer->setPosition(Point(-_totalLength * 0.5f, 0.0f));\n            break;\n        case LoadingBarTypeRight:\n            _barRenderer->setPosition(Point(_totalLength * 0.5f, 0.0f));\n            break;\n        default:\n            break;\n    }\n}\n\nvoid LoadingBar::setScale9Scale()\n{\n    float width = (float)(_percent) / 100.0f * _totalLength;\n    static_cast<extension::Scale9Sprite*>(_barRenderer)->setPreferredSize(Size(width, _size.height));\n}\n\nstd::string LoadingBar::getDescription() const\n{\n    return \"LoadingBar\";\n}\n\nWidget* LoadingBar::createCloneInstance()\n{\n    return LoadingBar::create();\n}\n\nvoid LoadingBar::copySpecialProperties(Widget *widget)\n{\n    LoadingBar* loadingBar = dynamic_cast<LoadingBar*>(widget);\n    if (loadingBar)\n    {\n        _prevIgnoreSize = loadingBar->_prevIgnoreSize;\n        setScale9Enabled(loadingBar->_scale9Enabled);\n        loadTexture(loadingBar->_textureFile.c_str(), loadingBar->_renderBarTexType);\n        setCapInsets(loadingBar->_capInsets);\n        setPercent(loadingBar->_percent);\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UILoadingBar.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UILOADINGBAR_H__\n#define __UILOADINGBAR_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\ntypedef enum\n{\n    LoadingBarTypeLeft,\n    LoadingBarTypeRight\n}LoadingBarType;\n/**\n*   @js NA\n*   @lua NA\n*/\nclass LoadingBar : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    LoadingBar();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~LoadingBar();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static LoadingBar* create();\n    \n    /**\n     * Changes the progress direction of loadingbar.\n     *\n     * @see LoadingBarType  LoadingBarTypeLeft means progress left to right, LoadingBarTypeRight otherwise.\n     *\n     * @param LoadingBarType\n     */\n    void setDirection(LoadingBarType dir);\n    \n    /**\n     * Gets the progress direction of loadingbar.\n     *\n     * @see LoadingBarType  LoadingBarTypeLeft means progress left to right, LoadingBarTypeRight otherwise.\n     *\n     * @param LoadingBarType\n     */\n    int getDirection();\n    \n    /**\n     * Load texture for loadingbar.\n     *\n     * @param fileName   file name of texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadTexture(const char* texture,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Changes the progress direction of loadingbar.\n     *\n     * @param percent    percent value from 1 to 100.\n     */\n    void setPercent(int percent);\n    \n    /**\n     * Gets the progress direction of loadingbar.\n     *\n     * @return percent    percent value from 1 to 100.\n     */\n    int getPercent();\n    \n    /**\n     * Sets if loadingbar is using scale9 renderer.\n     *\n     * @param true that using scale9 renderer, false otherwise.\n     */\n    void setScale9Enabled(bool enabled);\n    \n    /**\n     * Sets capinsets for loadingbar, if loadingbar is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for loadingbar\n     */\n    void setCapInsets(const Rect &capInsets);\n    \n    //override \"ignoreContentAdaptWithSize\" method of widget.\n    virtual void ignoreContentAdaptWithSize(bool ignore) override;\n    \n    //override \"getContentSize\" method of widget.\n    virtual const Size& getContentSize() const override;\n    \n    //override \"getVirtualRenderer\" method of widget.\n    virtual Node* getVirtualRenderer() override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\nprotected:\n    virtual void initRenderer() override;\n    virtual void onSizeChanged() override;\n    void setScale9Scale();\n    void barRendererScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    LoadingBarType _barType;\n    int _percent;\n    float _totalLength;\n    Node* _barRenderer;\n    TextureResType _renderBarTexType;\n    Size _barRendererTextureSize;\n    bool _scale9Enabled;\n    bool _prevIgnoreSize;\n    Rect _capInsets;\n    std::string _textureFile;\n};\n\n}\nNS_CC_END\n#endif /* defined(__CocoGUI__LoadingBar__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIPageView.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UIPageView.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nPageView::PageView():\n_curPageIdx(0),\n_touchMoveDir(PAGEVIEW_TOUCHLEFT),\n_touchStartLocation(0.0f),\n_touchMoveStartLocation(0.0f),\n_movePagePoint(Point::ZERO),\n_leftChild(nullptr),\n_rightChild(nullptr),\n_leftBoundary(0.0f),\n_rightBoundary(0.0f),\n_isAutoScrolling(false),\n_autoScrollDistance(0.0f),\n_autoScrollSpeed(0.0f),\n_autoScrollDir(0),\n_childFocusCancelOffset(5.0f),\n_pageViewEventListener(nullptr),\n_pageViewEventSelector(nullptr)\n{\n}\n\nPageView::~PageView()\n{\n    _pages.clear();\n    _pageViewEventListener = nullptr;\n    _pageViewEventSelector = nullptr;\n}\n\nPageView* PageView::create()\n{\n    PageView* widget = new PageView();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n    \nvoid PageView::onEnter()\n{\n    Layout::onEnter();\n    scheduleUpdate();\n}\n\nbool PageView::init()\n{\n    if (Layout::init())\n    {\n        setClippingEnabled(true);\n        setTouchEnabled(true);\n        return true;\n    }\n    return false;\n}\n\nvoid PageView::addWidgetToPage(Widget *widget, ssize_t pageIdx, bool forceCreate)\n{\n    if (!widget)\n    {\n        return;\n    }\n    if (pageIdx < 0)\n    {\n        return;\n    }\n    ssize_t pageCount = _pages.size();\n    if (pageIdx < 0 || pageIdx >= pageCount)\n    {\n        if (forceCreate)\n        {\n            if (pageIdx > pageCount)\n            {\n                CCLOG(\"pageIdx is %d, it will be added as page id [%d]\",static_cast<int>(pageIdx),static_cast<int>(pageCount));\n            }\n            Layout* newPage = createPage();\n            newPage->addChild(widget);\n            addPage(newPage);\n        }\n    }\n    else\n    {\n        Layout * page = _pages.at(pageIdx);\n        page->addChild(widget);\n    }\n}\n\nLayout* PageView::createPage()\n{\n    Layout* newPage = Layout::create();\n    newPage->setSize(getSize());\n    return newPage;\n}\n\nvoid PageView::addPage(Layout* page)\n{\n    if (!page)\n    {\n        return;\n    }\n    if (page->getWidgetType() != WidgetTypeContainer)\n    {\n        return;\n    }\n    if (_pages.contains(page))\n    {\n        return;\n    }\n    Size pSize = page->getSize();\n    Size pvSize = getSize();\n    if (!pSize.equals(pvSize))\n    {\n        CCLOG(\"page size does not match pageview size, it will be force sized!\");\n        page->setSize(pvSize);\n    }\n    page->setPosition(Point(getPositionXByIndex(_pages.size()), 0));\n    _pages.pushBack(page);\n    addChild(page);\n    updateBoundaryPages();\n}\n\nvoid PageView::insertPage(Layout* page, int idx)\n{\n    if (idx < 0)\n    {\n        return;\n    }\n    if (!page)\n    {\n        return;\n    }\n    if (page->getWidgetType() != WidgetTypeContainer)\n    {\n        return;\n    }\n    if (_pages.contains(page))\n    {\n        return;\n    }\n    \n    ssize_t pageCount = _pages.size();\n    if (idx >= pageCount)\n    {\n        addPage(page);\n    }\n    else\n    {\n        _pages.insert(idx, page);\n        page->setPosition(Point(getPositionXByIndex(idx), 0));\n        addChild(page);\n        Size pSize = page->getSize();\n        Size pvSize = getSize();\n        if (!pSize.equals(pvSize))\n        {\n            CCLOG(\"page size does not match pageview size, it will be force sized!\");\n            page->setSize(pvSize);\n        }\n        ssize_t length = _pages.size();\n        for (ssize_t i=(idx+1); i<length; i++){\n            Widget* behindPage = _pages.at(i);\n            Point formerPos = behindPage->getPosition();\n            behindPage->setPosition(Point(formerPos.x+getSize().width, 0));\n        }\n        updateBoundaryPages();\n    }\n}\n\nvoid PageView::removePage(Layout* page)\n{\n    if (!page)\n    {\n        return;\n    }\n    removeChild(page);\n    updateChildrenPosition();\n    updateBoundaryPages();\n}\n\nvoid PageView::removePageAtIndex(ssize_t index)\n{\n    if (index < 0 || index >= _pages.size())\n    {\n        return;\n    }\n    Layout* page = _pages.at(index);\n    removePage(page);\n}\n    \nvoid PageView::removeAllPages()\n{\n    removeAllChildren();\n}\n\nvoid PageView::updateBoundaryPages()\n{\n    if (_pages.size() <= 0)\n    {\n        _leftChild = nullptr;\n        _rightChild = nullptr;\n        return;\n    }\n    _leftChild = _pages.at(0);\n    _rightChild = _pages.at(_pages.size()-1);\n}\n\nfloat PageView::getPositionXByIndex(ssize_t idx)\n{\n    return (getSize().width*(idx-_curPageIdx));\n}\n    \nvoid PageView::addChild(Node *child)\n{\n    Layout::addChild(child);\n}\n\nvoid PageView::addChild(Node * child, int zOrder)\n{\n    Layout::addChild(child, zOrder);\n}\n\nvoid PageView::addChild(Node *child, int zOrder, int tag)\n{\n    Layout::addChild(child, zOrder, tag);\n}\n\nvoid PageView::removeChild(Node *child, bool cleanup)\n{\n    if (_pages.contains(static_cast<Layout*>(child)))\n    {\n        _pages.eraseObject(static_cast<Layout*>(child));\n    }\n    Layout::removeChild(child, cleanup);\n}\n\nvoid PageView::onSizeChanged()\n{\n    Layout::onSizeChanged();\n    _rightBoundary = getSize().width;\n    updateChildrenSize();\n    updateChildrenPosition();\n}\n\nvoid PageView::updateChildrenSize()\n{\n    Size selfSize = getSize();\n    for (auto& page : _pages)\n    {\n        page->setSize(selfSize);\n    }\n}\n\nvoid PageView::updateChildrenPosition()\n{\n    ssize_t pageCount = _pages.size();\n    if (pageCount <= 0)\n    {\n        _curPageIdx = 0;\n        return;\n    }\n    if (_curPageIdx >= pageCount)\n    {\n        _curPageIdx = pageCount-1;\n    }\n    float pageWidth = getSize().width;\n    for (int i=0; i<pageCount; i++)\n    {\n        Layout* page = _pages.at(i);\n        page->setPosition(Point((i-_curPageIdx)*pageWidth, 0));\n    }\n}\n\nvoid PageView::removeAllChildren()\n{\n    removeAllChildrenWithCleanup(true);\n}\n    \nvoid PageView::removeAllChildrenWithCleanup(bool cleanup)\n{\n    _pages.clear();\n    Layout::removeAllChildrenWithCleanup(cleanup);\n}\n\nvoid PageView::scrollToPage(ssize_t idx)\n{\n    if (idx < 0 || idx >= _pages.size())\n    {\n        return;\n    }\n    _curPageIdx = idx;\n    Widget* curPage = _pages.at(idx);\n    _autoScrollDistance = -(curPage->getPosition().x);\n    _autoScrollSpeed = fabs(_autoScrollDistance)/0.2f;\n    _autoScrollDir = _autoScrollDistance > 0 ? 1 : 0;\n    _isAutoScrolling = true;\n}\n\nvoid PageView::update(float dt)\n{\n    if (_isAutoScrolling)\n    {\n        switch (_autoScrollDir)\n        {\n            case 0:\n            {\n                float step = _autoScrollSpeed*dt;\n                if (_autoScrollDistance + step >= 0.0f)\n                {\n                    step = -_autoScrollDistance;\n                    _autoScrollDistance = 0.0f;\n                    _isAutoScrolling = false;\n                }\n                else\n                {\n                    _autoScrollDistance += step;\n                }\n                scrollPages(-step);\n                if (!_isAutoScrolling)\n                {\n                    pageTurningEvent();\n                }\n                break;\n            }\n                break;\n            case 1:\n            {\n                float step = _autoScrollSpeed*dt;\n                if (_autoScrollDistance - step <= 0.0f)\n                {\n                    step = _autoScrollDistance;\n                    _autoScrollDistance = 0.0f;\n                    _isAutoScrolling = false;\n                }\n                else\n                {\n                    _autoScrollDistance -= step;\n                }\n                scrollPages(step);\n                if (!_isAutoScrolling)\n                {\n                    pageTurningEvent();\n                }\n                break;\n            }\n            default:\n                break;\n        }\n    }\n}\n\nbool PageView::onTouchBegan(Touch *touch, Event *unusedEvent)\n{\n    bool pass = Layout::onTouchBegan(touch, unusedEvent);\n    if (_hitted)\n    {\n        handlePressLogic(touch->getLocation());\n    }\n    return pass;\n}\n\nvoid PageView::onTouchMoved(Touch *touch, Event *unusedEvent)\n{\n    _touchMovePos = touch->getLocation();\n    handleMoveLogic(_touchMovePos);\n    Widget* widgetParent = getWidgetParent();\n    if (widgetParent)\n    {\n        widgetParent->checkChildInfo(1,this,_touchMovePos);\n    }\n    moveEvent();\n}\n\nvoid PageView::onTouchEnded(Touch *touch, Event *unusedEvent)\n{\n    Layout::onTouchEnded(touch, unusedEvent);\n    handleReleaseLogic(_touchEndPos);\n}\n    \nvoid PageView::onTouchCancelled(Touch *touch, Event *unusedEvent)\n{\n    Layout::onTouchCancelled(touch, unusedEvent);\n    handleReleaseLogic(touch->getLocation());\n}\n\nvoid PageView::movePages(float offset)\n{\n    for (auto& page : _pages)\n    {\n        _movePagePoint.x = page->getPosition().x + offset;\n        _movePagePoint.y = page->getPosition().y;\n        page->setPosition(_movePagePoint);\n    }\n}\n\nbool PageView::scrollPages(float touchOffset)\n{\n    if (_pages.size() <= 0)\n    {\n        return false;\n    }\n    \n    if (!_leftChild || !_rightChild)\n    {\n        return false;\n    }\n    \n    float realOffset = touchOffset;\n    \n    switch (_touchMoveDir)\n    {\n        case PAGEVIEW_TOUCHLEFT: // left\n            if (_rightChild->getRightInParent() + touchOffset <= _rightBoundary)\n            {\n                realOffset = _rightBoundary - _rightChild->getRightInParent();\n                movePages(realOffset);\n                return false;\n            }\n            break;\n            \n        case PAGEVIEW_TOUCHRIGHT: // right\n            if (_leftChild->getLeftInParent() + touchOffset >= _leftBoundary)\n            {\n                realOffset = _leftBoundary - _leftChild->getLeftInParent();\n                movePages(realOffset);\n                return false;\n            }\n            break;\n        default:\n            break;\n    }\n    \n    movePages(realOffset);\n    return true;\n}\n\nvoid PageView::handlePressLogic(const Point &touchPoint)\n{\n    Point nsp = convertToNodeSpace(touchPoint);\n    _touchMoveStartLocation = nsp.x;\n    _touchStartLocation = nsp.x;\n}\n\nvoid PageView::handleMoveLogic(const Point &touchPoint)\n{\n    Point nsp = convertToNodeSpace(touchPoint);\n    float offset = 0.0;\n    float moveX = nsp.x;\n    offset = moveX - _touchMoveStartLocation;\n    _touchMoveStartLocation = moveX;\n    if (offset < 0)\n    {\n        _touchMoveDir = PAGEVIEW_TOUCHLEFT;\n    }\n    else if (offset > 0)\n    {\n        _touchMoveDir = PAGEVIEW_TOUCHRIGHT;\n    }\n    scrollPages(offset);\n}\n\nvoid PageView::handleReleaseLogic(const Point &touchPoint)\n{\n    if (_pages.size() <= 0)\n    {\n        return;\n    }\n    Widget* curPage = _pages.at(_curPageIdx);\n    if (curPage)\n    {\n        Point curPagePos = curPage->getPosition();\n        ssize_t pageCount = _pages.size();\n        float curPageLocation = curPagePos.x;\n        float pageWidth = getSize().width;\n        float boundary = pageWidth/2.0f;\n        if (curPageLocation <= -boundary)\n        {\n            if (_curPageIdx >= pageCount-1)\n            {\n                scrollPages(-curPageLocation);\n            }\n            else\n            {\n                scrollToPage(_curPageIdx+1);\n            }\n        }\n        else if (curPageLocation >= boundary)\n        {\n            if (_curPageIdx <= 0)\n            {\n                scrollPages(-curPageLocation);\n            }\n            else\n            {\n                scrollToPage(_curPageIdx-1);\n            }\n        }\n        else\n        {\n            scrollToPage(_curPageIdx);\n        }\n    }\n}\n\nvoid PageView::checkChildInfo(int handleState,Widget* sender, const Point &touchPoint)\n{\n    interceptTouchEvent(handleState, sender, touchPoint);\n}\n\nvoid PageView::interceptTouchEvent(int handleState, Widget *sender, const Point &touchPoint)\n{\n    switch (handleState)\n    {\n        case 0:\n            handlePressLogic(touchPoint);\n            break;\n        case 1:\n        {\n            float offset = 0;\n            offset = fabs(sender->getTouchStartPos().x - touchPoint.x);\n            if (offset > _childFocusCancelOffset)\n            {\n                sender->setFocused(false);\n                handleMoveLogic(touchPoint);\n            }\n        }\n            break;\n        case 2:\n            handleReleaseLogic(touchPoint);\n            break;\n            \n        case 3:\n            handleReleaseLogic(touchPoint);\n            break;\n    }\n}\n\nvoid PageView::pageTurningEvent()\n{\n    if (_pageViewEventListener && _pageViewEventSelector)\n    {\n        (_pageViewEventListener->*_pageViewEventSelector)(this, PAGEVIEW_EVENT_TURNING);\n    }\n}\n\nvoid PageView::addEventListenerPageView(Object *target, SEL_PageViewEvent selector)\n{\n    _pageViewEventListener = target;\n    _pageViewEventSelector = selector;\n}\n\nssize_t PageView::getCurPageIndex() const\n{\n    return _curPageIdx;\n}\n\nVector<Layout*>& PageView::getPages()\n{\n    return _pages;\n}\n    \nLayout* PageView::getPage(ssize_t index)\n{\n    if (index < 0 || index >= _pages.size())\n    {\n        return nullptr;\n    }\n    return _pages.at(index);\n}\n\nstd::string PageView::getDescription() const\n{\n    return \"PageView\";\n}\n\nWidget* PageView::createCloneInstance()\n{\n    return PageView::create();\n}\n\nvoid PageView::copyClonedWidgetChildren(Widget* model)\n{\n    auto& modelPages = static_cast<PageView*>(model)->getPages();\n    for (auto& page : modelPages)\n    {\n        addPage(dynamic_cast<Layout*>(page->clone()));\n    }\n}\n\nvoid PageView::copySpecialProperties(Widget *widget)\n{\n    PageView* pageView = dynamic_cast<PageView*>(widget);\n    if (pageView)\n    {\n        Layout::copySpecialProperties(widget);\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UIPageView.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UIPAGEVIEW_H__\n#define __UIPAGEVIEW_H__\n\n#include \"gui/UILayout.h\"\n#include \"gui/UIScrollInterface.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\ntypedef enum\n{\n    PAGEVIEW_EVENT_TURNING,\n}PageViewEventType;\n\ntypedef void (Object::*SEL_PageViewEvent)(Object*, PageViewEventType);\n#define pagevieweventselector(_SELECTOR)(SEL_PageViewEvent)(&_SELECTOR)\n\ntypedef enum {\n    PAGEVIEW_TOUCHLEFT,\n    PAGEVIEW_TOUCHRIGHT\n}PVTouchDir;\n\nclass PageView : public Layout , public UIScrollInterface\n{\n    \npublic:\n    /**\n     * Default constructor\n     */\n    PageView();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~PageView();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static PageView* create();\n    \n    /**\n     * Add a widget to a page of pageview.\n     *\n     * @param widget    widget to be added to pageview.\n     *\n     * @param pageIdx   index of page.\n     *\n     * @param forceCreate   if force create and there is no page exsit, pageview would create a default page for adding widget.\n     */\n    void addWidgetToPage(Widget* widget, ssize_t pageIdx, bool forceCreate);\n    \n    /**\n     * Push back a page to pageview.\n     *\n     * @param page    page to be added to pageview.\n     */\n    void addPage(Layout* page);\n    \n    /**\n     * Inert a page to pageview.\n     *\n     * @param page    page to be added to pageview.\n     */\n    void insertPage(Layout* page, int idx);\n    \n    /**\n     * Remove a page of pageview.\n     *\n     * @param page    page which will be removed.\n     */\n    void removePage(Layout* page);\n\n    /**\n     * Remove a page at index of pageview.\n     *\n     * @param index    index of page.\n     */\n    void removePageAtIndex(ssize_t index);\n    \n    void removeAllPages();\n    \n    /**\n     * scroll pageview to index.\n     *\n     * @param idx    index of page.\n     */\n    void scrollToPage(ssize_t idx);\n    \n    /**\n     * Gets current page index.\n     *\n     * @return current page index.\n     */\n    ssize_t getCurPageIndex() const;\n    \n    Vector<Layout*>& getPages();\n    \n    Layout* getPage(ssize_t index);\n    \n    // event\n    void addEventListenerPageView(Object *target, SEL_PageViewEvent selector);\n\n    \n\n    \n    virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchMoved(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchEnded(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchCancelled(Touch *touch, Event *unusedEvent) override;\n    \n    //override \"update\" method of widget.\n    virtual void update(float dt) override;\n    /**\n     * Sets LayoutType.\n     *\n     * @see LayoutType\n     *\n     * @param LayoutType\n     */\n    virtual void setLayoutType(LayoutType type) override{};\n    \n    /**\n     * Gets LayoutType.\n     *\n     * @see LayoutType\n     *\n     * @return LayoutType\n     */\n    virtual LayoutType getLayoutType() const override{return LAYOUT_ABSOLUTE;};\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n\n    virtual void onEnter() override;\n\nprotected:\n    virtual void addChild(Node * child) override;\n    virtual void addChild(Node * child, int zOrder) override;\n    virtual void addChild(Node* child, int zOrder, int tag) override;\n    virtual void removeChild(Node* widget, bool cleanup = true) override;\n    virtual void removeAllChildren() override;\n    virtual void removeAllChildrenWithCleanup(bool cleanup) override;\n    virtual Vector<Node*>& getChildren() override{return Widget::getChildren();};\n    virtual const Vector<Node*>& getChildren() const override{return Widget::getChildren();};\n    virtual ssize_t getChildrenCount() const override {return Widget::getChildrenCount();};\n    virtual Node * getChildByTag(int tag) override {return Widget::getChildByTag(tag);};\n    virtual Widget* getChildByName(const char* name) override {return Widget::getChildByName(name);};\n    virtual bool init() override;\n    Layout* createPage();\n    float getPositionXByIndex(ssize_t idx);\n    void updateBoundaryPages();\n    virtual void handlePressLogic(const Point &touchPoint) override;\n    virtual void handleMoveLogic(const Point &touchPoint) override;\n    virtual void handleReleaseLogic(const Point &touchPoint) override;\n    virtual void interceptTouchEvent(int handleState, Widget* sender, const Point &touchPoint) override;\n    virtual void checkChildInfo(int handleState, Widget* sender, const Point &touchPoint) override;\n    virtual bool scrollPages(float touchOffset);\n    void movePages(float offset);\n    void pageTurningEvent();\n    void updateChildrenSize();\n    void updateChildrenPosition();\n    virtual void onSizeChanged() override;\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\n    virtual void copyClonedWidgetChildren(Widget* model) override;\n    virtual void setClippingEnabled(bool enabled) override {Layout::setClippingEnabled(enabled);};\n    virtual void doLayout() override{if (!_doLayoutDirty){return;} _doLayoutDirty = false;};\nprotected:\n    ssize_t _curPageIdx;\n    Vector<Layout*> _pages;\n    PVTouchDir _touchMoveDir;\n    float _touchStartLocation;\n    float _touchMoveStartLocation;\n    Point _movePagePoint;\n    Widget* _leftChild;\n    Widget* _rightChild;\n    float _leftBoundary;\n    float _rightBoundary;\n    bool _isAutoScrolling;\n    float _autoScrollDistance;\n    float _autoScrollSpeed;\n    int _autoScrollDir;\n    float _childFocusCancelOffset;\n    Object* _pageViewEventListener;\n    SEL_PageViewEvent _pageViewEventSelector;\n\n};\n\n}\nNS_CC_END\n\n#endif /* defined(__PageView__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIScrollInterface.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UISCROLLDELEGATE_H__\n#define __UISCROLLDELEGATE_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nclass UIScrollInterface\n{\npublic:\n    virtual ~UIScrollInterface() {}\n\nprotected:\n    virtual void handlePressLogic(const Point &touchPoint) = 0;\n    virtual void handleMoveLogic(const Point &touchPoint) = 0;\n    virtual void handleReleaseLogic(const Point &touchPoint) = 0;\n    virtual void interceptTouchEvent(int handleState, Widget* sender, const Point &touchPoint) = 0;\n};\n\n}\nNS_CC_END\n\n#endif /* defined(__UIScrollDelegate__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIScrollView.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UIScrollView.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nstatic const float AUTOSCROLLMAXSPEED = 1000.0f;\n\nconst Point SCROLLDIR_UP = Point(0.0f, 1.0f);\nconst Point SCROLLDIR_DOWN = Point(0.0f, -1.0f);\nconst Point SCROLLDIR_LEFT = Point(-1.0f, 0.0f);\nconst Point SCROLLDIR_RIGHT = Point(1.0f, 0.0f);\n\nScrollView::ScrollView():\n_innerContainer(nullptr),\n_direction(SCROLLVIEW_DIR_VERTICAL),\n_touchBeganPoint(Point::ZERO),\n_touchMovedPoint(Point::ZERO),\n_touchEndedPoint(Point::ZERO),\n_touchMovingPoint(Point::ZERO),\n_autoScrollDir(Point::ZERO),\n_topBoundary(0.0f),\n_bottomBoundary(0.0f),\n_leftBoundary(0.0f),\n_rightBoundary(0.0f),\n_bounceTopBoundary(0.0f),\n_bounceBottomBoundary(0.0f),\n_bounceLeftBoundary(0.0f),\n_bounceRightBoundary(0.0f),\n_autoScroll(false),\n_autoScrollAddUpTime(0.0f),\n_autoScrollOriginalSpeed(0.0f),\n_autoScrollAcceleration(-1000.0f),\n_isAutoScrollSpeedAttenuated(false),\n_needCheckAutoScrollDestination(false),\n_autoScrollDestination(Point::ZERO),\n_bePressed(false),\n_slidTime(0.0f),\n_moveChildPoint(Point::ZERO),\n_childFocusCancelOffset(5.0f),\n_leftBounceNeeded(false),\n_topBounceNeeded(false),\n_rightBounceNeeded(false),\n_bottomBounceNeeded(false),\n_bounceEnabled(false),\n_bouncing(false),\n_bounceDir(Point::ZERO),\n_bounceOriginalSpeed(0.0f),\n_inertiaScrollEnabled(true),\n_scrollViewEventListener(nullptr),\n_scrollViewEventSelector(nullptr)\n{\n}\n\nScrollView::~ScrollView()\n{\n    _scrollViewEventListener = nullptr;\n    _scrollViewEventSelector = nullptr;\n}\n\nScrollView* ScrollView::create()\n{\n    ScrollView* widget = new ScrollView();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n    \nvoid ScrollView::onEnter()\n{\n    Layout::onEnter();\n    scheduleUpdate();\n}\n\nbool ScrollView::init()\n{\n    if (Layout::init())\n    {\n        setTouchEnabled(true);\n        setClippingEnabled(true);\n        _innerContainer->setTouchEnabled(false);\n        return true;\n    }\n    return false;\n}\n\nvoid ScrollView::initRenderer()\n{\n    Layout::initRenderer();\n    _innerContainer = Layout::create();\n    Layout::addChild(_innerContainer,1,1);\n}\n\nvoid ScrollView::onSizeChanged()\n{\n    Layout::onSizeChanged();\n    _topBoundary = _size.height;\n    _rightBoundary = _size.width;\n    float bounceBoundaryParameterX = _size.width / 3.0f;\n    float bounceBoundaryParameterY = _size.height / 3.0f;\n    _bounceTopBoundary = _size.height - bounceBoundaryParameterY;\n    _bounceBottomBoundary = bounceBoundaryParameterY;\n    _bounceLeftBoundary = bounceBoundaryParameterX;\n    _bounceRightBoundary = _size.width - bounceBoundaryParameterX;\n    Size innerSize = _innerContainer->getSize();\n    float orginInnerSizeWidth = innerSize.width;\n    float orginInnerSizeHeight = innerSize.height;\n    float innerSizeWidth = MAX(orginInnerSizeWidth, _size.width);\n    float innerSizeHeight = MAX(orginInnerSizeHeight, _size.height);\n    _innerContainer->setSize(Size(innerSizeWidth, innerSizeHeight));\n    _innerContainer->setPosition(Point(0, _size.height - _innerContainer->getSize().height));\n}\n\nvoid ScrollView::setInnerContainerSize(const Size &size)\n{\n    float innerSizeWidth = _size.width;\n    float innerSizeHeight = _size.height;\n    Size originalInnerSize = _innerContainer->getSize();\n    if (size.width < _size.width)\n    {\n        CCLOG(\"Inner width <= scrollview width, it will be force sized!\");\n    }\n    else\n    {\n        innerSizeWidth = size.width;\n    }\n    if (size.height < _size.height)\n    {\n        CCLOG(\"Inner height <= scrollview height, it will be force sized!\");\n    }\n    else\n    {\n        innerSizeHeight = size.height;\n    }\n    _innerContainer->setSize(Size(innerSizeWidth, innerSizeHeight));\n\n    switch (_direction)\n    {\n        case SCROLLVIEW_DIR_VERTICAL:\n        {\n            Size newInnerSize = _innerContainer->getSize();\n            float offset = originalInnerSize.height - newInnerSize.height;\n            scrollChildren(0.0f, offset);\n            break;\n        }\n        case SCROLLVIEW_DIR_HORIZONTAL:\n        {\n            if (_innerContainer->getRightInParent() <= _size.width)\n            {\n                Size newInnerSize = _innerContainer->getSize();\n                float offset = originalInnerSize.width - newInnerSize.width;\n                scrollChildren(offset, 0.0f);\n            }\n            break;\n        }\n        case SCROLLVIEW_DIR_BOTH:\n        {\n            Size newInnerSize = _innerContainer->getSize();\n            float offsetY = originalInnerSize.height - newInnerSize.height;\n            float offsetX = 0.0f;\n            if (_innerContainer->getRightInParent() <= _size.width)\n            {\n                offsetX = originalInnerSize.width - newInnerSize.width;\n            }\n            scrollChildren(offsetX, offsetY);\n            break;\n        }\n        default:\n            break;\n    }\n    if (_innerContainer->getLeftInParent() > 0.0f)\n    {\n        _innerContainer->setPosition(Point(_innerContainer->getAnchorPoint().x * _innerContainer->getSize().width, _innerContainer->getPosition().y));\n    }\n    if (_innerContainer->getRightInParent() < _size.width)\n    {\n         _innerContainer->setPosition(Point(_size.width - ((1.0f - _innerContainer->getAnchorPoint().x) * _innerContainer->getSize().width), _innerContainer->getPosition().y));\n    }\n    if (_innerContainer->getPosition().y > 0.0f)\n    {\n        _innerContainer->setPosition(Point(_innerContainer->getPosition().x, _innerContainer->getAnchorPoint().y * _innerContainer->getSize().height));\n    }\n    if (_innerContainer->getTopInParent() < _size.height)\n    {\n        _innerContainer->setPosition(Point(_innerContainer->getPosition().x, _size.height - (1.0f - _innerContainer->getAnchorPoint().y) * _innerContainer->getSize().height));\n    }\n}\n\nconst Size& ScrollView::getInnerContainerSize() const\n{\n\treturn _innerContainer->getSize();\n}\n    \nvoid ScrollView::addChild(Node *child)\n{\n    Layout::addChild(child);\n}\n\nvoid ScrollView::addChild(Node * child, int zOrder)\n{\n    Layout::addChild(child, zOrder);\n}\n\nvoid ScrollView::addChild(Node *child, int zOrder, int tag)\n{\n    return _innerContainer->addChild(child, zOrder, tag);\n}\n\nvoid ScrollView::removeAllChildren()\n{\n    removeAllChildrenWithCleanup(true);\n}\n    \nvoid ScrollView::removeAllChildrenWithCleanup(bool cleanup)\n{\n    _innerContainer->removeAllChildrenWithCleanup(cleanup);\n}\n\nvoid ScrollView::removeChild(Node* child, bool cleanup)\n{\n\treturn _innerContainer->removeChild(child, cleanup);\n}\n\nVector<Node*>& ScrollView::getChildren()\n{\n    return _innerContainer->getChildren();\n}\n\nconst Vector<Node*>& ScrollView::getChildren() const\n{\n    return _innerContainer->getChildren();\n}\n\nssize_t ScrollView::getChildrenCount() const\n{\n    return _innerContainer->getChildrenCount();\n}\n    \nNode* ScrollView::getChildByTag(int tag)\n{\n    return _innerContainer->getChildByTag(tag);\n}\n    \nWidget* ScrollView::getChildByName(const char *name)\n{\n    return _innerContainer->getChildByName(name);\n}\n\nvoid ScrollView::moveChildren(float offsetX, float offsetY)\n{\n    _moveChildPoint = _innerContainer->getPosition() + Point(offsetX, offsetY);\n    _innerContainer->setPosition(_moveChildPoint);\n}\n\nvoid ScrollView::autoScrollChildren(float dt)\n{\n    float lastTime = _autoScrollAddUpTime;\n    _autoScrollAddUpTime += dt;\n    if (_isAutoScrollSpeedAttenuated)\n    {\n        float nowSpeed = _autoScrollOriginalSpeed + _autoScrollAcceleration * _autoScrollAddUpTime;\n        if (nowSpeed <= 0.0f)\n        {\n            stopAutoScrollChildren();\n            checkNeedBounce();\n        }\n        else\n        {\n            float timeParam = lastTime * 2 + dt;\n            float offset = (_autoScrollOriginalSpeed + _autoScrollAcceleration * timeParam * 0.5f) * dt;\n            float offsetX = offset * _autoScrollDir.x;\n            float offsetY = offset * _autoScrollDir.y;\n            if (!scrollChildren(offsetX, offsetY))\n            {\n                stopAutoScrollChildren();\n                checkNeedBounce();\n            }\n        }\n    }\n    else\n    {\n        if (_needCheckAutoScrollDestination)\n        {\n            float xOffset = _autoScrollDir.x * dt * _autoScrollOriginalSpeed;\n            float yOffset = _autoScrollDir.y * dt * _autoScrollOriginalSpeed;\n            bool notDone = checkCustomScrollDestination(&xOffset, &yOffset);\n            bool scrollCheck = scrollChildren(xOffset, yOffset);\n            if (!notDone || !scrollCheck)\n            {\n                stopAutoScrollChildren();\n                checkNeedBounce();\n            }\n        }\n        else\n        {\n            if (!scrollChildren(_autoScrollDir.x * dt * _autoScrollOriginalSpeed, _autoScrollDir.y * dt * _autoScrollOriginalSpeed))\n            {\n                stopAutoScrollChildren();\n                checkNeedBounce();\n            }\n        }\n    }\n}\n\nvoid ScrollView::bounceChildren(float dt)\n{\n    if (_bounceOriginalSpeed <= 0.0f)\n    {\n        stopBounceChildren();\n    }\n    if (!bounceScrollChildren(_bounceDir.x * dt * _bounceOriginalSpeed, _bounceDir.y * dt * _bounceOriginalSpeed))\n    {\n        stopBounceChildren();\n    }\n}\n\nbool ScrollView::checkNeedBounce()\n{\n    if (!_bounceEnabled)\n    {\n        return false;\n    }\n    checkBounceBoundary();\n    if (_topBounceNeeded || _bottomBounceNeeded || _leftBounceNeeded || _rightBounceNeeded)\n    {\n        if (_topBounceNeeded && _leftBounceNeeded)\n        {\n            Point scrollVector = Point(0.0f, _size.height) - Point(_innerContainer->getLeftInParent(), _innerContainer->getTopInParent());\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        else if (_topBounceNeeded && _rightBounceNeeded)\n        {\n            Point scrollVector = Point(_size.width, _size.height) - Point(_innerContainer->getRightInParent(), _innerContainer->getTopInParent());\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        else if (_bottomBounceNeeded && _leftBounceNeeded)\n        {\n            Point scrollVector = Point::ZERO - Point(_innerContainer->getLeftInParent(), _innerContainer->getBottomInParent());\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        else if (_bottomBounceNeeded && _rightBounceNeeded)\n        {\n            Point scrollVector = Point(_size.width, 0.0f) - Point(_innerContainer->getRightInParent(), _innerContainer->getBottomInParent());\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        else if (_topBounceNeeded)\n        {\n            Point scrollVector = Point(0.0f, _size.height) - Point(0.0f, _innerContainer->getTopInParent());\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        else if (_bottomBounceNeeded)\n        {\n            Point scrollVector = Point::ZERO - Point(0.0f, _innerContainer->getBottomInParent());\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        else if (_leftBounceNeeded)\n        {\n            Point scrollVector = Point::ZERO - Point(_innerContainer->getLeftInParent(), 0.0f);\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        else if (_rightBounceNeeded)\n        {\n            Point scrollVector = Point(_size.width, 0.0f) - Point(_innerContainer->getRightInParent(), 0.0f);\n            float orSpeed = scrollVector.getLength()/(0.2f);\n            _bounceDir = scrollVector.normalize();\n            startBounceChildren(orSpeed);\n        }\n        return true;\n    }\n    return false;\n}\n\nvoid ScrollView::checkBounceBoundary()\n{\n    float icBottomPos = _innerContainer->getBottomInParent();\n    if (icBottomPos > _bottomBoundary)\n    {\n        scrollToBottomEvent();\n        _bottomBounceNeeded = true;\n    }\n    else\n    {\n        _bottomBounceNeeded = false;\n    }\n    float icTopPos = _innerContainer->getTopInParent();\n    if (icTopPos < _topBoundary)\n    {\n        scrollToTopEvent();\n        _topBounceNeeded = true;\n    }\n    else\n    {\n        _topBounceNeeded = false;\n    }\n    float icRightPos = _innerContainer->getRightInParent();\n    if (icRightPos < _rightBoundary)\n    {\n        scrollToRightEvent();\n        _rightBounceNeeded = true;\n    }\n    else\n    {\n        _rightBounceNeeded = false;\n    }\n    float icLeftPos = _innerContainer->getLeftInParent();\n    if (icLeftPos > _leftBoundary)\n    {\n        scrollToLeftEvent();\n        _leftBounceNeeded = true;\n    }\n    else\n    {\n        _leftBounceNeeded = false;\n    }\n}\n\nvoid ScrollView::startBounceChildren(float v)\n{\n    _bounceOriginalSpeed = v;\n    _bouncing = true;\n}\n\nvoid ScrollView::stopBounceChildren()\n{\n    _bouncing = false;\n    _bounceOriginalSpeed = 0.0f;\n    _leftBounceNeeded = false;\n    _rightBounceNeeded = false;\n    _topBounceNeeded = false;\n    _bottomBounceNeeded = false;\n}\n\nvoid ScrollView::startAutoScrollChildrenWithOriginalSpeed(const Point& dir, float v, bool attenuated, float acceleration)\n{\n    stopAutoScrollChildren();\n    _autoScrollDir = dir;\n    _isAutoScrollSpeedAttenuated = attenuated;\n    _autoScrollOriginalSpeed = v;\n    _autoScroll = true;\n    _autoScrollAcceleration = acceleration;\n}\n\nvoid ScrollView::startAutoScrollChildrenWithDestination(const Point& des, float time, bool attenuated)\n{\n    _needCheckAutoScrollDestination = false;\n    _autoScrollDestination = des;\n    Point dis = des - _innerContainer->getPosition();\n    Point dir = dis.normalize();\n    float orSpeed = 0.0f;\n    float acceleration = -1000.0f;\n    if (attenuated)\n    {\n        acceleration = (-(2 * dis.getLength())) / (time * time);\n        orSpeed =  2 * dis.getLength() / time;\n    }\n    else\n    {\n        _needCheckAutoScrollDestination = true;\n        orSpeed = dis.getLength() / time;\n    }\n    startAutoScrollChildrenWithOriginalSpeed(dir, orSpeed, attenuated, acceleration);\n}\n\nvoid ScrollView::jumpToDestination(const Point &des)\n{\n    float finalOffsetX = des.x;\n    float finalOffsetY = des.y;\n    switch (_direction)\n    {\n        case SCROLLVIEW_DIR_VERTICAL:\n            if (des.y <= 0)\n            {\n                finalOffsetY = MAX(des.y, _size.height - _innerContainer->getSize().height);\n            }\n            break;\n        case SCROLLVIEW_DIR_HORIZONTAL:\n            if (des.x <= 0)\n            {\n                finalOffsetX = MAX(des.x, _size.width - _innerContainer->getSize().width);\n            }\n            break;\n        case SCROLLVIEW_DIR_BOTH:\n            if (des.y <= 0)\n            {\n                finalOffsetY = MAX(des.y, _size.height - _innerContainer->getSize().height);\n            }\n            if (des.x <= 0)\n            {\n                finalOffsetX = MAX(des.x, _size.width - _innerContainer->getSize().width);\n            }\n            break;\n        default:\n            break;\n    }\n    _innerContainer->setPosition(Point(finalOffsetX, finalOffsetY));\n}\n\nvoid ScrollView::stopAutoScrollChildren()\n{\n    _autoScroll = false;\n    _autoScrollOriginalSpeed = 0.0f;\n    _autoScrollAddUpTime = 0.0f;\n}\n\nbool ScrollView::bounceScrollChildren(float touchOffsetX, float touchOffsetY)\n{\n    bool scrollenabled = true;\n    if (touchOffsetX > 0.0f && touchOffsetY > 0.0f) //first quadrant //bounce to top-right\n    {\n        float realOffsetX = touchOffsetX;\n        float realOffsetY = touchOffsetY;\n        float icRightPos = _innerContainer->getRightInParent();\n        if (icRightPos + realOffsetX >= _rightBoundary)\n        {\n            realOffsetX = _rightBoundary - icRightPos;\n            bounceRightEvent();\n            scrollenabled = false;\n        }\n        float icTopPos = _innerContainer->getTopInParent();\n        if (icTopPos + touchOffsetY >= _topBoundary)\n        {\n            realOffsetY = _topBoundary - icTopPos;\n            bounceTopEvent();\n            scrollenabled = false;\n        }\n        moveChildren(realOffsetX, realOffsetY);\n    }\n    else if(touchOffsetX < 0.0f && touchOffsetY > 0.0f) //second quadrant //bounce to top-left\n    {\n        float realOffsetX = touchOffsetX;\n        float realOffsetY = touchOffsetY;\n        float icLefrPos = _innerContainer->getLeftInParent();\n        if (icLefrPos + realOffsetX <= _leftBoundary)\n        {\n            realOffsetX = _leftBoundary - icLefrPos;\n            bounceLeftEvent();\n            scrollenabled = false;\n        }\n        float icTopPos = _innerContainer->getTopInParent();\n        if (icTopPos + touchOffsetY >= _topBoundary)\n        {\n            realOffsetY = _topBoundary - icTopPos;\n            bounceTopEvent();\n            scrollenabled = false;\n        }\n        moveChildren(realOffsetX, realOffsetY);\n    }\n    else if (touchOffsetX < 0.0f && touchOffsetY < 0.0f) //third quadrant //bounce to bottom-left\n    {\n        float realOffsetX = touchOffsetX;\n        float realOffsetY = touchOffsetY;\n        float icLefrPos = _innerContainer->getLeftInParent();\n        if (icLefrPos + realOffsetX <= _leftBoundary)\n        {\n            realOffsetX = _leftBoundary - icLefrPos;\n            bounceLeftEvent();\n            scrollenabled = false;\n        }\n        float icBottomPos = _innerContainer->getBottomInParent();\n        if (icBottomPos + touchOffsetY <= _bottomBoundary)\n        {\n            realOffsetY = _bottomBoundary - icBottomPos;\n            bounceBottomEvent();\n            scrollenabled = false;\n        }\n        moveChildren(realOffsetX, realOffsetY);\n    }\n    else if (touchOffsetX > 0.0f && touchOffsetY < 0.0f) //forth quadrant //bounce to bottom-right\n    {\n        float realOffsetX = touchOffsetX;\n        float realOffsetY = touchOffsetY;\n        float icRightPos = _innerContainer->getRightInParent();\n        if (icRightPos + realOffsetX >= _rightBoundary)\n        {\n            realOffsetX = _rightBoundary - icRightPos;\n            bounceRightEvent();\n            scrollenabled = false;\n        }\n        float icBottomPos = _innerContainer->getBottomInParent();\n        if (icBottomPos + touchOffsetY <= _bottomBoundary)\n        {\n            realOffsetY = _bottomBoundary - icBottomPos;\n            bounceBottomEvent();\n            scrollenabled = false;\n        }\n        moveChildren(realOffsetX, realOffsetY);\n    }\n    else if (touchOffsetX == 0.0f && touchOffsetY > 0.0f) // bounce to top\n    {\n        float realOffsetY = touchOffsetY;\n        float icTopPos = _innerContainer->getTopInParent();\n        if (icTopPos + touchOffsetY >= _topBoundary)\n        {\n            realOffsetY = _topBoundary - icTopPos;\n            bounceTopEvent();\n            scrollenabled = false;\n        }\n        moveChildren(0.0f, realOffsetY);\n    }\n    else if (touchOffsetX == 0.0f && touchOffsetY < 0.0f) //bounce to bottom\n    {\n        float realOffsetY = touchOffsetY;\n        float icBottomPos = _innerContainer->getBottomInParent();\n        if (icBottomPos + touchOffsetY <= _bottomBoundary)\n        {\n            realOffsetY = _bottomBoundary - icBottomPos;\n            bounceBottomEvent();\n            scrollenabled = false;\n        }\n        moveChildren(0.0f, realOffsetY);\n    }\n    else if (touchOffsetX > 0.0f && touchOffsetY == 0.0f) //bounce to right\n    {\n        float realOffsetX = touchOffsetX;\n        float icRightPos = _innerContainer->getRightInParent();\n        if (icRightPos + realOffsetX >= _rightBoundary)\n        {\n            realOffsetX = _rightBoundary - icRightPos;\n            bounceRightEvent();\n            scrollenabled = false;\n        }\n        moveChildren(realOffsetX, 0.0f);\n    }\n    else if (touchOffsetX < 0.0f && touchOffsetY == 0.0f) //bounce to left\n    {\n        float realOffsetX = touchOffsetX;\n        float icLeftPos = _innerContainer->getLeftInParent();\n        if (icLeftPos + realOffsetX <= _leftBoundary)\n        {\n            realOffsetX = _leftBoundary - icLeftPos;\n            bounceLeftEvent();\n            scrollenabled = false;\n        }\n        moveChildren(realOffsetX, 0.0f);\n    }\n    return scrollenabled;\n}\n\nbool ScrollView::checkCustomScrollDestination(float* touchOffsetX, float* touchOffsetY)\n{\n    bool scrollenabled = true;\n    switch (_direction)\n    {\n        case SCROLLVIEW_DIR_VERTICAL: // vertical\n        {\n            if (_autoScrollDir.y > 0)\n            {\n                float icBottomPos = _innerContainer->getBottomInParent();\n                if (icBottomPos + *touchOffsetY >= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icBottomPos;\n                    scrollenabled = false;\n                }\n            }\n            else\n            {\n                float icBottomPos = _innerContainer->getBottomInParent();\n                if (icBottomPos + *touchOffsetY <= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icBottomPos;\n                    scrollenabled = false;\n                }\n            }\n            break;\n        }\n        case SCROLLVIEW_DIR_HORIZONTAL: // horizontal\n        {\n            if (_autoScrollDir.x > 0)\n            {\n                float icLeftPos = _innerContainer->getLeftInParent();\n                if (icLeftPos + *touchOffsetX >= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icLeftPos;\n                    scrollenabled = false;\n                }\n            }\n            else\n            {\n                float icLeftPos = _innerContainer->getLeftInParent();\n                if (icLeftPos + *touchOffsetX <= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icLeftPos;\n                    scrollenabled = false;\n                }\n            }\n            break;\n        }\n        case SCROLLVIEW_DIR_BOTH:\n        {\n            if (*touchOffsetX > 0.0f && *touchOffsetY > 0.0f) // up right\n            {\n                float icLeftPos = _innerContainer->getLeftInParent();\n                if (icLeftPos + *touchOffsetX >= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icLeftPos;\n                    scrollenabled = false;\n                }\n                float icBottomPos = _innerContainer->getBottomInParent();\n                if (icBottomPos + *touchOffsetY >= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icBottomPos;\n                    scrollenabled = false;\n                }\n            }\n            else if (*touchOffsetX < 0.0f && *touchOffsetY > 0.0f) // up left\n            {\n                float icRightPos = _innerContainer->getRightInParent();\n                if (icRightPos + *touchOffsetX <= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icRightPos;\n                    scrollenabled = false;\n                }\n                float icBottomPos = _innerContainer->getBottomInParent();\n                if (icBottomPos + *touchOffsetY >= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icBottomPos;\n                    scrollenabled = false;\n                }\n            }\n            else if (*touchOffsetX < 0.0f && *touchOffsetY < 0.0f) // down left\n            {\n                float icRightPos = _innerContainer->getRightInParent();\n                if (icRightPos + *touchOffsetX <= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icRightPos;\n                    scrollenabled = false;\n                }\n                float icTopPos = _innerContainer->getTopInParent();\n                if (icTopPos + *touchOffsetY <= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icTopPos;\n                    scrollenabled = false;\n                }\n            }\n            else if (*touchOffsetX > 0.0f && *touchOffsetY < 0.0f) // down right\n            {\n                float icLeftPos = _innerContainer->getLeftInParent();\n                if (icLeftPos + *touchOffsetX >= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icLeftPos;\n                    scrollenabled = false;\n                }\n                float icTopPos = _innerContainer->getTopInParent();\n                if (icTopPos + *touchOffsetY <= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icTopPos;\n                    scrollenabled = false;\n                }\n            }\n            else if (*touchOffsetX == 0.0f && *touchOffsetY > 0.0f) // up\n            {\n                float icBottomPos = _innerContainer->getBottomInParent();\n                if (icBottomPos + *touchOffsetY >= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icBottomPos;\n                    scrollenabled = false;\n                }\n            }\n            else if (*touchOffsetX < 0.0f && *touchOffsetY == 0.0f) // left\n            {\n                float icRightPos = _innerContainer->getRightInParent();\n                if (icRightPos + *touchOffsetX <= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icRightPos;\n                    scrollenabled = false;\n                }\n            }\n            else if (*touchOffsetX == 0.0f && *touchOffsetY < 0.0f) // down\n            {\n                float icTopPos = _innerContainer->getTopInParent();\n                if (icTopPos + *touchOffsetY <= _autoScrollDestination.y)\n                {\n                    *touchOffsetY = _autoScrollDestination.y - icTopPos;\n                    scrollenabled = false;\n                }\n            }\n            else if (*touchOffsetX > 0.0f && *touchOffsetY == 0.0f) // right\n            {\n                float icLeftPos = _innerContainer->getLeftInParent();\n                if (icLeftPos + *touchOffsetX >= _autoScrollDestination.x)\n                {\n                    *touchOffsetX = _autoScrollDestination.x - icLeftPos;\n                    scrollenabled = false;\n                }\n            }\n            break;\n        }\n        default:\n            break;\n    }\n    return scrollenabled;\n}\n\nbool ScrollView::scrollChildren(float touchOffsetX, float touchOffsetY)\n{\n    bool scrollenabled = true;\n    scrollingEvent();\n    switch (_direction)\n    {\n        case SCROLLVIEW_DIR_VERTICAL: // vertical\n        {\n            float realOffset = touchOffsetY;\n            if (_bounceEnabled)\n            {\n                float icBottomPos = _innerContainer->getBottomInParent();\n                if (icBottomPos + touchOffsetY >= _bounceBottomBoundary)\n                {\n                    realOffset = _bounceBottomBoundary - icBottomPos;\n                    scrollToBottomEvent();\n                    scrollenabled = false;\n                }\n                float icTopPos = _innerContainer->getTopInParent();\n                if (icTopPos + touchOffsetY <= _bounceTopBoundary)\n                {\n                    realOffset = _bounceTopBoundary - icTopPos;\n                    scrollToTopEvent();\n                    scrollenabled = false;\n                }\n            }\n            else\n            {\n                float icBottomPos = _innerContainer->getBottomInParent();\n                if (icBottomPos + touchOffsetY >= _bottomBoundary)\n                {\n                    realOffset = _bottomBoundary - icBottomPos;\n                    scrollToBottomEvent();\n                    scrollenabled = false;\n                }\n                float icTopPos = _innerContainer->getTopInParent();\n                if (icTopPos + touchOffsetY <= _topBoundary)\n                {\n                    realOffset = _topBoundary - icTopPos;\n                    scrollToTopEvent();\n                    scrollenabled = false;\n                }\n            }\n            moveChildren(0.0f, realOffset);\n            break;\n        }\n        case SCROLLVIEW_DIR_HORIZONTAL: // horizontal\n        {\n            float realOffset = touchOffsetX;\n            if (_bounceEnabled)\n            {\n                float icRightPos = _innerContainer->getRightInParent();\n                if (icRightPos + touchOffsetX <= _bounceRightBoundary)\n                {\n                    realOffset = _bounceRightBoundary - icRightPos;\n                    scrollToRightEvent();\n                    scrollenabled = false;\n                }\n                float icLeftPos = _innerContainer->getLeftInParent();\n                if (icLeftPos + touchOffsetX >= _bounceLeftBoundary)\n                {\n                    realOffset = _bounceLeftBoundary - icLeftPos;\n                    scrollToLeftEvent();\n                    scrollenabled = false;\n                }\n            }\n            else\n            {\n                float icRightPos = _innerContainer->getRightInParent();\n                if (icRightPos + touchOffsetX <= _rightBoundary)\n                {\n                    realOffset = _rightBoundary - icRightPos;\n                    scrollToRightEvent();\n                    scrollenabled = false;\n                }\n                float icLeftPos = _innerContainer->getLeftInParent();\n                if (icLeftPos + touchOffsetX >= _leftBoundary)\n                {\n                    realOffset = _leftBoundary - icLeftPos;\n                    scrollToLeftEvent();\n                    scrollenabled = false;\n                }\n            }\n            moveChildren(realOffset, 0.0f);\n            break;\n        }\n        case SCROLLVIEW_DIR_BOTH:\n        {\n            float realOffsetX = touchOffsetX;\n            float realOffsetY = touchOffsetY;\n            if (_bounceEnabled)\n            {\n                if (touchOffsetX > 0.0f && touchOffsetY > 0.0f) // up right\n                {\n                    float icLeftPos = _innerContainer->getLeftInParent();\n                    if (icLeftPos + touchOffsetX >= _bounceLeftBoundary)\n                    {\n                        realOffsetX = _bounceLeftBoundary - icLeftPos;\n                        scrollToLeftEvent();\n                        scrollenabled = false;\n                    }\n                    float icBottomPos = _innerContainer->getBottomInParent();\n                    if (icBottomPos + touchOffsetY >= _bounceBottomBoundary)\n                    {\n                        realOffsetY = _bounceBottomBoundary - icBottomPos;\n                        scrollToBottomEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX < 0.0f && touchOffsetY > 0.0f) // up left\n                {\n                    float icRightPos = _innerContainer->getRightInParent();\n                    if (icRightPos + touchOffsetX <= _bounceRightBoundary)\n                    {\n                        realOffsetX = _bounceRightBoundary - icRightPos;\n                        scrollToRightEvent();\n                        scrollenabled = false;\n                    }\n                    float icBottomPos = _innerContainer->getBottomInParent();\n                    if (icBottomPos + touchOffsetY >= _bounceBottomBoundary)\n                    {\n                        realOffsetY = _bounceBottomBoundary - icBottomPos;\n                        scrollToBottomEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX < 0.0f && touchOffsetY < 0.0f) // down left\n                {\n                    float icRightPos = _innerContainer->getRightInParent();\n                    if (icRightPos + touchOffsetX <= _bounceRightBoundary)\n                    {\n                        realOffsetX = _bounceRightBoundary - icRightPos;\n                        scrollToRightEvent();\n                        scrollenabled = false;\n                    }\n                    float icTopPos = _innerContainer->getTopInParent();\n                    if (icTopPos + touchOffsetY <= _bounceTopBoundary)\n                    {\n                        realOffsetY = _bounceTopBoundary - icTopPos;\n                        scrollToTopEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX > 0.0f && touchOffsetY < 0.0f) // down right\n                {\n                    float icLeftPos = _innerContainer->getLeftInParent();\n                    if (icLeftPos + touchOffsetX >= _bounceLeftBoundary)\n                    {\n                        realOffsetX = _bounceLeftBoundary - icLeftPos;\n                        scrollToLeftEvent();\n                        scrollenabled = false;\n                    }\n                    float icTopPos = _innerContainer->getTopInParent();\n                    if (icTopPos + touchOffsetY <= _bounceTopBoundary)\n                    {\n                        realOffsetY = _bounceTopBoundary - icTopPos;\n                        scrollToTopEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX == 0.0f && touchOffsetY > 0.0f) // up\n                {\n                    float icBottomPos = _innerContainer->getBottomInParent();\n                    if (icBottomPos + touchOffsetY >= _bounceBottomBoundary)\n                    {\n                        realOffsetY = _bounceBottomBoundary - icBottomPos;\n                        scrollToBottomEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX < 0.0f && touchOffsetY == 0.0f) // left\n                {\n                    float icRightPos = _innerContainer->getRightInParent();\n                    if (icRightPos + touchOffsetX <= _bounceRightBoundary)\n                    {\n                        realOffsetX = _bounceRightBoundary - icRightPos;\n                        scrollToRightEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX == 0.0f && touchOffsetY < 0.0f) // down\n                {\n                    float icTopPos = _innerContainer->getTopInParent();\n                    if (icTopPos + touchOffsetY <= _bounceTopBoundary)\n                    {\n                        realOffsetY = _bounceTopBoundary - icTopPos;\n                        scrollToTopEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX > 0.0f && touchOffsetY == 0.0f) // right\n                {\n                    float icLeftPos = _innerContainer->getLeftInParent();\n                    if (icLeftPos + touchOffsetX >= _bounceLeftBoundary)\n                    {\n                        realOffsetX = _bounceLeftBoundary - icLeftPos;\n                        scrollToLeftEvent();\n                        scrollenabled = false;\n                    }\n                }\n            }\n            else\n            {\n                if (touchOffsetX > 0.0f && touchOffsetY > 0.0f) // up right\n                {\n                    float icLeftPos = _innerContainer->getLeftInParent();\n                    if (icLeftPos + touchOffsetX >= _leftBoundary)\n                    {\n                        realOffsetX = _leftBoundary - icLeftPos;\n                        scrollToLeftEvent();\n                        scrollenabled = false;\n                    }\n                    float icBottomPos = _innerContainer->getBottomInParent();\n                    if (icBottomPos + touchOffsetY >= _bottomBoundary)\n                    {\n                        realOffsetY = _bottomBoundary - icBottomPos;\n                        scrollToBottomEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX < 0.0f && touchOffsetY > 0.0f) // up left\n                {\n                    float icRightPos = _innerContainer->getRightInParent();\n                    if (icRightPos + touchOffsetX <= _rightBoundary)\n                    {\n                        realOffsetX = _rightBoundary - icRightPos;\n                        scrollToRightEvent();\n                        scrollenabled = false;\n                    }\n                    float icBottomPos = _innerContainer->getBottomInParent();\n                    if (icBottomPos + touchOffsetY >= _bottomBoundary)\n                    {\n                        realOffsetY = _bottomBoundary - icBottomPos;\n                        scrollToBottomEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX < 0.0f && touchOffsetY < 0.0f) // down left\n                {\n                    float icRightPos = _innerContainer->getRightInParent();\n                    if (icRightPos + touchOffsetX <= _rightBoundary)\n                    {\n                        realOffsetX = _rightBoundary - icRightPos;\n                        scrollToRightEvent();\n                        scrollenabled = false;\n                    }\n                    float icTopPos = _innerContainer->getTopInParent();\n                    if (icTopPos + touchOffsetY <= _topBoundary)\n                    {\n                        realOffsetY = _topBoundary - icTopPos;\n                        scrollToTopEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX > 0.0f && touchOffsetY < 0.0f) // down right\n                {\n                    float icLeftPos = _innerContainer->getLeftInParent();\n                    if (icLeftPos + touchOffsetX >= _leftBoundary)\n                    {\n                        realOffsetX = _leftBoundary - icLeftPos;\n                        scrollToLeftEvent();\n                        scrollenabled = false;\n                    }\n                    float icTopPos = _innerContainer->getTopInParent();\n                    if (icTopPos + touchOffsetY <= _topBoundary)\n                    {\n                        realOffsetY = _topBoundary - icTopPos;\n                        scrollToTopEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX == 0.0f && touchOffsetY > 0.0f) // up\n                {\n                    float icBottomPos = _innerContainer->getBottomInParent();\n                    if (icBottomPos + touchOffsetY >= _bottomBoundary)\n                    {\n                        realOffsetY = _bottomBoundary - icBottomPos;\n                        scrollToBottomEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX < 0.0f && touchOffsetY == 0.0f) // left\n                {\n                    float icRightPos = _innerContainer->getRightInParent();\n                    if (icRightPos + touchOffsetX <= _rightBoundary)\n                    {\n                        realOffsetX = _rightBoundary - icRightPos;\n                        scrollToRightEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX == 0.0f && touchOffsetY < 0.0f) // down\n                {\n                    float icTopPos = _innerContainer->getTopInParent();\n                    if (icTopPos + touchOffsetY <= _topBoundary)\n                    {\n                        realOffsetY = _topBoundary - icTopPos;\n                        scrollToTopEvent();\n                        scrollenabled = false;\n                    }\n                }\n                else if (touchOffsetX > 0.0f && touchOffsetY == 0.0f) // right\n                {\n                    float icLeftPos = _innerContainer->getLeftInParent();\n                    if (icLeftPos + touchOffsetX >= _leftBoundary)\n                    {\n                        realOffsetX = _leftBoundary - icLeftPos;\n                        scrollToLeftEvent();\n                        scrollenabled = false;\n                    }\n                }\n            }\n            moveChildren(realOffsetX, realOffsetY);\n            break;\n        }\n        default:\n            break;\n    }\n    return scrollenabled;\n}\n\nvoid ScrollView::scrollToBottom(float time, bool attenuated)\n{\n    startAutoScrollChildrenWithDestination(Point(_innerContainer->getPosition().x, 0.0f), time, attenuated);\n}\n\nvoid ScrollView::scrollToTop(float time, bool attenuated)\n{\n    startAutoScrollChildrenWithDestination(Point(_innerContainer->getPosition().x, _size.height - _innerContainer->getSize().height), time, attenuated);\n}\n\nvoid ScrollView::scrollToLeft(float time, bool attenuated)\n{\n    startAutoScrollChildrenWithDestination(Point(0.0f, _innerContainer->getPosition().y), time, attenuated);\n}\n\nvoid ScrollView::scrollToRight(float time, bool attenuated)\n{\n    startAutoScrollChildrenWithDestination(Point(_size.width - _innerContainer->getSize().width, _innerContainer->getPosition().y), time, attenuated);\n}\n\nvoid ScrollView::scrollToTopLeft(float time, bool attenuated)\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    startAutoScrollChildrenWithDestination(Point(0.0f, _size.height - _innerContainer->getSize().height), time, attenuated);\n}\n\nvoid ScrollView::scrollToTopRight(float time, bool attenuated)\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    startAutoScrollChildrenWithDestination(Point(_size.width - _innerContainer->getSize().width, _size.height - _innerContainer->getSize().height), time, attenuated);\n}\n\nvoid ScrollView::scrollToBottomLeft(float time, bool attenuated)\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    startAutoScrollChildrenWithDestination(Point::ZERO, time, attenuated);\n}\n\nvoid ScrollView::scrollToBottomRight(float time, bool attenuated)\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    startAutoScrollChildrenWithDestination(Point(_size.width - _innerContainer->getSize().width, 0.0f), time, attenuated);\n}\n\nvoid ScrollView::scrollToPercentVertical(float percent, float time, bool attenuated)\n{\n    float minY = _size.height - _innerContainer->getSize().height;\n    float h = - minY;\n    startAutoScrollChildrenWithDestination(Point(_innerContainer->getPosition().x, minY + percent * h / 100.0f), time, attenuated);\n}\n\nvoid ScrollView::scrollToPercentHorizontal(float percent, float time, bool attenuated)\n{\n    float w = _innerContainer->getSize().width - _size.width;\n    startAutoScrollChildrenWithDestination(Point(-(percent * w / 100.0f), _innerContainer->getPosition().y), time, attenuated);\n}\n\nvoid ScrollView::scrollToPercentBothDirection(const Point& percent, float time, bool attenuated)\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        return;\n    }\n    float minY = _size.height - _innerContainer->getSize().height;\n    float h = - minY;\n    float w = _innerContainer->getSize().width - _size.width;\n    startAutoScrollChildrenWithDestination(Point(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f), time, attenuated);\n}\n\nvoid ScrollView::jumpToBottom()\n{\n    jumpToDestination(Point(_innerContainer->getPosition().x, 0.0f));\n}\n\nvoid ScrollView::jumpToTop()\n{\n    jumpToDestination(Point(_innerContainer->getPosition().x, _size.height - _innerContainer->getSize().height));\n}\n\nvoid ScrollView::jumpToLeft()\n{\n    jumpToDestination(Point(0.0f, _innerContainer->getPosition().y));\n}\n\nvoid ScrollView::jumpToRight()\n{\n    jumpToDestination(Point(_size.width - _innerContainer->getSize().width, _innerContainer->getPosition().y));\n}\n\nvoid ScrollView::jumpToTopLeft()\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    jumpToDestination(Point(0.0f, _size.height - _innerContainer->getSize().height));\n}\n\nvoid ScrollView::jumpToTopRight()\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    jumpToDestination(Point(_size.width - _innerContainer->getSize().width, _size.height - _innerContainer->getSize().height));\n}\n\nvoid ScrollView::jumpToBottomLeft()\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    jumpToDestination(Point::ZERO);\n}\n\nvoid ScrollView::jumpToBottomRight()\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        CCLOG(\"Scroll diretion is not both!\");\n        return;\n    }\n    jumpToDestination(Point(_size.width - _innerContainer->getSize().width, 0.0f));\n}\n\nvoid ScrollView::jumpToPercentVertical(float percent)\n{\n    float minY = _size.height - _innerContainer->getSize().height;\n    float h = - minY;\n    jumpToDestination(Point(_innerContainer->getPosition().x, minY + percent * h / 100.0f));\n}\n\nvoid ScrollView::jumpToPercentHorizontal(float percent)\n{\n    float w = _innerContainer->getSize().width - _size.width;\n    jumpToDestination(Point(-(percent * w / 100.0f), _innerContainer->getPosition().y));\n}\n\nvoid ScrollView::jumpToPercentBothDirection(const Point& percent)\n{\n    if (_direction != SCROLLVIEW_DIR_BOTH)\n    {\n        return;\n    }\n    float minY = _size.height - _innerContainer->getSize().height;\n    float h = - minY;\n    float w = _innerContainer->getSize().width - _size.width;\n    jumpToDestination(Point(-(percent.x * w / 100.0f), minY + percent.y * h / 100.0f));\n}\n\nvoid ScrollView::startRecordSlidAction()\n{\n    if (_autoScroll)\n    {\n        stopAutoScrollChildren();\n    }\n    if (_bouncing)\n    {\n        stopBounceChildren();\n    }\n    _slidTime = 0.0f;\n}\n\nvoid ScrollView::endRecordSlidAction()\n{\n    if (!checkNeedBounce() && _inertiaScrollEnabled)\n    {\n        if (_slidTime <= 0.016f)\n        {\n            return;\n        }\n        float totalDis = 0.0f;\n        Point dir;\n        switch (_direction)\n        {\n            case SCROLLVIEW_DIR_VERTICAL:\n                totalDis = _touchEndedPoint.y - _touchBeganPoint.y;\n                if (totalDis < 0.0f)\n                {\n                    dir = SCROLLDIR_DOWN;\n                }\n                else\n                {\n                    dir = SCROLLDIR_UP;\n                }\n                break;\n            case SCROLLVIEW_DIR_HORIZONTAL:\n                totalDis = _touchEndedPoint.x - _touchBeganPoint.x;\n                if (totalDis < 0.0f)\n                {\n                    dir = SCROLLDIR_LEFT;\n                }\n                else\n                {\n                    dir = SCROLLDIR_RIGHT;\n                }\n                break;\n            case SCROLLVIEW_DIR_BOTH:\n            {\n                Point subVector = _touchEndedPoint - _touchBeganPoint;\n                totalDis = subVector.getLength();\n                dir = subVector.normalize();\n                break;\n            }\n            default:\n                break;\n        }\n        float orSpeed = MIN(fabs(totalDis)/(_slidTime), AUTOSCROLLMAXSPEED);\n        startAutoScrollChildrenWithOriginalSpeed(dir, orSpeed, true, -1000);\n        _slidTime = 0.0f;\n    }\n}\n\nvoid ScrollView::handlePressLogic(const Point &touchPoint)\n{        \n    _touchBeganPoint = convertToNodeSpace(touchPoint);\n    _touchMovingPoint = _touchBeganPoint;    \n    startRecordSlidAction();\n    _bePressed = true;\n}\n\nvoid ScrollView::handleMoveLogic(const Point &touchPoint)\n{\n    _touchMovedPoint = convertToNodeSpace(touchPoint);\n    Point delta = _touchMovedPoint - _touchMovingPoint;\n    _touchMovingPoint = _touchMovedPoint;\n    switch (_direction)\n    {\n        case SCROLLVIEW_DIR_VERTICAL: // vertical\n        {\n            scrollChildren(0.0f, delta.y);\n            break;\n        }\n        case SCROLLVIEW_DIR_HORIZONTAL: // horizontal\n        {\n            scrollChildren(delta.x, 0.0f);\n            break;\n        }\n        case SCROLLVIEW_DIR_BOTH: // both\n        {\n            scrollChildren(delta.x, delta.y);\n            break;\n        }\n        default:\n            break;\n    }\n}\n\nvoid ScrollView::handleReleaseLogic(const Point &touchPoint)\n{\n    _touchEndedPoint = convertToNodeSpace(touchPoint);\n    endRecordSlidAction();\n    _bePressed = false;\n}    \n\nbool ScrollView::onTouchBegan(Touch *touch, Event *unusedEvent)\n{\n    bool pass = Layout::onTouchBegan(touch, unusedEvent);\n    if (_hitted)\n    {\n        handlePressLogic(_touchStartPos);\n    }\n    return pass;\n}\n\nvoid ScrollView::onTouchMoved(Touch *touch, Event *unusedEvent)\n{\n    Layout::onTouchMoved(touch, unusedEvent);\n    handleMoveLogic(_touchMovePos);\n}\n\nvoid ScrollView::onTouchEnded(Touch *touch, Event *unusedEvent)\n{\n    Layout::onTouchEnded(touch, unusedEvent);\n    handleReleaseLogic(_touchEndPos);\n}\n\nvoid ScrollView::onTouchCancelled(Touch *touch, Event *unusedEvent)\n{\n    Layout::onTouchCancelled(touch, unusedEvent);\n    handleReleaseLogic(touch->getLocation());\n}\n\nvoid ScrollView::update(float dt)\n{\n    if (_autoScroll)\n    {\n        autoScrollChildren(dt);\n    }\n    if (_bouncing)\n    {\n        bounceChildren(dt);\n    }\n    recordSlidTime(dt);\n}\n\nvoid ScrollView::recordSlidTime(float dt)\n{\n    if (_bePressed)\n    {\n        _slidTime += dt;\n    }\n}\n\nvoid ScrollView::interceptTouchEvent(int handleState, Widget *sender, const Point &touchPoint)\n{\n    switch (handleState)\n    {\n        case 0:\n            handlePressLogic(touchPoint);\n            break;\n            \n        case 1:\n        {\n            float offset = (sender->getTouchStartPos() - touchPoint).getLength();\n            if (offset > _childFocusCancelOffset)\n            {\n                sender->setFocused(false);\n                handleMoveLogic(touchPoint);\n            }\n        }\n            break;\n            \n        case 2:\n            handleReleaseLogic(touchPoint);\n            break;\n            \n        case 3:\n            handleReleaseLogic(touchPoint);\n            break;\n    }\n}\n\nvoid ScrollView::checkChildInfo(int handleState,Widget* sender,const Point &touchPoint)\n{\n    interceptTouchEvent(handleState, sender, touchPoint);\n}\n\nvoid ScrollView::scrollToTopEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_TOP);\n    }\n}\n\nvoid ScrollView::scrollToBottomEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM);\n    }\n}\n\nvoid ScrollView::scrollToLeftEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_LEFT);\n    }\n}\n\nvoid ScrollView::scrollToRightEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLL_TO_RIGHT);\n    }\n}\n\nvoid ScrollView::scrollingEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_SCROLLING);\n    }\n}\n\nvoid ScrollView::bounceTopEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_TOP);\n    }\n}\n\nvoid ScrollView::bounceBottomEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_BOTTOM);\n    }\n}\n\nvoid ScrollView::bounceLeftEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_LEFT);\n    }\n}\n\nvoid ScrollView::bounceRightEvent()\n{\n    if (_scrollViewEventListener && _scrollViewEventSelector)\n    {\n        (_scrollViewEventListener->*_scrollViewEventSelector)(this, SCROLLVIEW_EVENT_BOUNCE_RIGHT);\n    }\n}\n\nvoid ScrollView::addEventListenerScrollView(Object *target, SEL_ScrollViewEvent selector)\n{\n    _scrollViewEventListener = target;\n    _scrollViewEventSelector = selector;\n}\n\nvoid ScrollView::setDirection(SCROLLVIEW_DIR dir)\n{\n    _direction = dir;\n}\n\nSCROLLVIEW_DIR ScrollView::getDirection()\n{\n    return _direction;\n}\n\nvoid ScrollView::setBounceEnabled(bool enabled)\n{\n    _bounceEnabled = enabled;\n}\n\nbool ScrollView::isBounceEnabled() const\n{\n    return _bounceEnabled;\n}\n\nvoid ScrollView::setInertiaScrollEnabled(bool enabled)\n{\n    _inertiaScrollEnabled = enabled;\n}\n\nbool ScrollView::isInertiaScrollEnabled() const\n{\n    return _inertiaScrollEnabled;\n}\n\nLayout* ScrollView::getInnerContainer()\n{\n    return _innerContainer;\n}\n\nvoid ScrollView::setLayoutType(LayoutType type)\n{\n    _innerContainer->setLayoutType(type);\n}\n\nLayoutType ScrollView::getLayoutType() const\n{\n    return _innerContainer->getLayoutType();\n}\n\nvoid ScrollView::doLayout()\n{\n    if (!_doLayoutDirty)\n    {\n        return;\n    }\n    _doLayoutDirty = false;\n}\n\nstd::string ScrollView::getDescription() const\n{\n    return \"ScrollView\";\n}\n\nWidget* ScrollView::createCloneInstance()\n{\n    return ScrollView::create();\n}\n\nvoid ScrollView::copyClonedWidgetChildren(Widget* model)\n{\n    Layout::copyClonedWidgetChildren(model);\n}\n\nvoid ScrollView::copySpecialProperties(Widget *widget)\n{\n    ScrollView* scrollView = dynamic_cast<ScrollView*>(widget);\n    if (scrollView)\n    {\n        Layout::copySpecialProperties(widget);\n        setInnerContainerSize(scrollView->getInnerContainerSize());\n        setDirection(scrollView->_direction);\n        setBounceEnabled(scrollView->_bounceEnabled);\n        setInertiaScrollEnabled(scrollView->_inertiaScrollEnabled);\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UIScrollView.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UISCROLLVIEW_H__\n#define __UISCROLLVIEW_H__\n\n#include \"gui/UILayout.h\"\n#include \"gui/UIScrollInterface.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nenum SCROLLVIEW_DIR\n{\n    SCROLLVIEW_DIR_NONE,\n    SCROLLVIEW_DIR_VERTICAL,\n    SCROLLVIEW_DIR_HORIZONTAL,\n    SCROLLVIEW_DIR_BOTH\n};\n\ntypedef enum\n{\n    SCROLLVIEW_EVENT_SCROLL_TO_TOP,\n    SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM,\n    SCROLLVIEW_EVENT_SCROLL_TO_LEFT,\n    SCROLLVIEW_EVENT_SCROLL_TO_RIGHT,\n    SCROLLVIEW_EVENT_SCROLLING,\n    SCROLLVIEW_EVENT_BOUNCE_TOP,\n    SCROLLVIEW_EVENT_BOUNCE_BOTTOM,\n    SCROLLVIEW_EVENT_BOUNCE_LEFT,\n    SCROLLVIEW_EVENT_BOUNCE_RIGHT\n}ScrollviewEventType;\n\ntypedef void (Object::*SEL_ScrollViewEvent)(Object*, ScrollviewEventType);\n#define scrollvieweventselector(_SELECTOR) (SEL_ScrollViewEvent)(&_SELECTOR)\n\n\nclass ScrollView : public Layout , public UIScrollInterface\n{\npublic:\n    /**\n     * Default constructor\n     */\n    ScrollView();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~ScrollView();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static ScrollView* create();\n    \n    /**\n     * Changes scroll direction of scrollview.\n     *\n     * @see SCROLLVIEW_DIR      SCROLLVIEW_DIR_VERTICAL means vertical scroll, SCROLLVIEW_DIR_HORIZONTAL means horizontal scroll\n     *\n     * @param SCROLLVIEW_DIR\n     */\n    virtual void setDirection(SCROLLVIEW_DIR dir);\n    \n    /**\n     * Gets scroll direction of scrollview.\n     *\n     * @see SCROLLVIEW_DIR      SCROLLVIEW_DIR_VERTICAL means vertical scroll, SCROLLVIEW_DIR_HORIZONTAL means horizontal scroll\n     *\n     * @return SCROLLVIEW_DIR\n     */\n    SCROLLVIEW_DIR getDirection();\n    \n    /**\n     * Gets inner container of scrollview.\n     *\n     * Inner container is the container of scrollview's children.\n     *\n     * @return inner container.\n     */\n    Layout* getInnerContainer();\n    \n    /**\n     * Scroll inner container to bottom boundary of scrollview.\n     */\n    void scrollToBottom(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to top boundary of scrollview.\n     */\n    void scrollToTop(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to left boundary of scrollview.\n     */\n    void scrollToLeft(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to right boundary of scrollview.\n     */\n    void scrollToRight(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to top and left boundary of scrollview.\n     */\n    void scrollToTopLeft(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to top and right boundary of scrollview.\n     */\n    void scrollToTopRight(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to bottom and left boundary of scrollview.\n     */\n    void scrollToBottomLeft(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to bottom and right boundary of scrollview.\n     */\n    void scrollToBottomRight(float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to vertical percent position of scrollview.\n     */\n    void scrollToPercentVertical(float percent, float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to horizontal percent position of scrollview.\n     */\n    void scrollToPercentHorizontal(float percent, float time, bool attenuated);\n    \n    /**\n     * Scroll inner container to both direction percent position of scrollview.\n     */\n    void scrollToPercentBothDirection(const Point& percent, float time, bool attenuated);\n    \n    /**\n     * Move inner container to bottom boundary of scrollview.\n     */\n    void jumpToBottom();\n    \n    /**\n     * Move inner container to top boundary of scrollview.\n     */\n    void jumpToTop();\n    \n    /**\n     * Move inner container to left boundary of scrollview.\n     */\n    void jumpToLeft();\n    \n    /**\n     * Move inner container to right boundary of scrollview.\n     */\n    void jumpToRight();\n    \n    /**\n     * Move inner container to top and left boundary of scrollview.\n     */\n    void jumpToTopLeft();\n    \n    /**\n     * Move inner container to top and right boundary of scrollview.\n     */\n    void jumpToTopRight();\n    \n    /**\n     * Move inner container to bottom and left boundary of scrollview.\n     */\n    void jumpToBottomLeft();\n    \n    /**\n     * Move inner container to bottom and right boundary of scrollview.\n     */\n    void jumpToBottomRight();\n    \n    /**\n     * Move inner container to vertical percent position of scrollview.\n     */\n    void jumpToPercentVertical(float percent);\n    \n    /**\n     * Move inner container to horizontal percent position of scrollview.\n     */\n    void jumpToPercentHorizontal(float percent);\n    \n    /**\n     * Move inner container to both direction percent position of scrollview.\n     */\n    void jumpToPercentBothDirection(const Point& percent);\n    \n    /**\n     * Changes inner container size of scrollview.\n     *\n     * Inner container size must be larger than or equal scrollview's size.\n     *\n     * @param inner container size.\n     */\n    void setInnerContainerSize(const Size &size);\n    \n    /**\n     * Gets inner container size of scrollview.\n     *\n     * Inner container size must be larger than or equal scrollview's size.\n     *\n     * @return inner container size.\n     */\n\tconst Size& getInnerContainerSize() const;\n    \n    /**\n     * Add call back function called scrollview event triggered\n     */\n    void addEventListenerScrollView(Object* target, SEL_ScrollViewEvent selector);\n        \n    virtual void addChild(Node * child) override;\n    /**\n     * Adds a child to the container with a z-order\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to setLocalZOrder(int)\n     */\n    virtual void addChild(Node * child, int zOrder) override;\n    /**\n     * Adds a child to the container with z order and tag\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to setLocalZOrder(int)\n     * @param tag       A interger to identify the node easily. Please refer to setTag(int)\n     */\n    virtual void addChild(Node* child, int zOrder, int tag) override;\n    \n    //override \"removeAllChildrenAndCleanUp\" method of widget.\n    virtual void removeAllChildren() override;\n    \n    virtual void removeAllChildrenWithCleanup(bool cleanup) override;\n    \n    //override \"removeChild\" method of widget.\n\tvirtual void removeChild(Node* child, bool cleaup = true) override;\n    \n    //override \"getChildren\" method of widget.\n    virtual Vector<Node*>& getChildren() override;\n    virtual const Vector<Node*>& getChildren() const override;\n    \n    virtual ssize_t getChildrenCount() const override;\n    \n    virtual Node * getChildByTag(int tag) override;\n    \n    virtual Widget* getChildByName(const char* name) override;\n    \n    virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchMoved(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchEnded(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchCancelled(Touch *touch, Event *unusedEvent) override;\n    \n    virtual void update(float dt) override;\n    \n    void setBounceEnabled(bool enabled);\n    \n    bool isBounceEnabled() const;\n    \n    void setInertiaScrollEnabled(bool enabled);\n    \n    bool isInertiaScrollEnabled() const;\n    \n    /**\n     * Sets LayoutType.\n     *\n     * @see LayoutType\n     *\n     * @param LayoutType\n     */\n    virtual void setLayoutType(LayoutType type) override;\n    \n    /**\n     * Gets LayoutType.\n     *\n     * @see LayoutType\n     *\n     * @return LayoutType\n     */\n    virtual LayoutType getLayoutType() const override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n    \n    virtual void onEnter() override;\nprotected:\n    virtual bool init() override;\n    virtual void initRenderer() override;\n    void moveChildren(float offsetX, float offsetY);\n    void autoScrollChildren(float dt);\n    void bounceChildren(float dt);\n    void checkBounceBoundary();\n    bool checkNeedBounce();\n    void startAutoScrollChildrenWithOriginalSpeed(const Point& dir, float v, bool attenuated, float acceleration);\n    void startAutoScrollChildrenWithDestination(const Point& des, float time, bool attenuated);\n    void jumpToDestination(const Point& des);\n    void stopAutoScrollChildren();\n    void startBounceChildren(float v);\n    void stopBounceChildren();\n    bool checkCustomScrollDestination(float* touchOffsetX, float* touchOffsetY);\n    virtual bool scrollChildren(float touchOffsetX, float touchOffsetY);\n    bool bounceScrollChildren(float touchOffsetX, float touchOffsetY);\n    void startRecordSlidAction();\n    virtual void endRecordSlidAction();\n    virtual void handlePressLogic(const Point &touchPoint) override;\n    virtual void handleMoveLogic(const Point &touchPoint) override;\n    virtual void handleReleaseLogic(const Point &touchPoint) override;\n    virtual void interceptTouchEvent(int handleState,Widget* sender,const Point &touchPoint) override;\n    virtual void checkChildInfo(int handleState,Widget* sender,const Point &touchPoint) override;\n    void recordSlidTime(float dt);\n    void scrollToTopEvent();\n    void scrollToBottomEvent();\n    void scrollToLeftEvent();\n    void scrollToRightEvent();\n    void scrollingEvent();\n    void bounceTopEvent();\n    void bounceBottomEvent();\n    void bounceLeftEvent();\n    void bounceRightEvent();\n    virtual void onSizeChanged() override;\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\n    virtual void copyClonedWidgetChildren(Widget* model) override;\n    virtual void setClippingEnabled(bool able) override{Layout::setClippingEnabled(able);};\n    virtual void doLayout() override;\nprotected:\n    Layout* _innerContainer;\n    \n    SCROLLVIEW_DIR _direction;\n\n    Point _touchBeganPoint;\n    Point _touchMovedPoint;\n    Point _touchEndedPoint;\n    Point _touchMovingPoint;\n    Point _autoScrollDir;\n    \n    float _topBoundary;\n    float _bottomBoundary;\n    float _leftBoundary;\n    float _rightBoundary;\n    \n    float _bounceTopBoundary;\n    float _bounceBottomBoundary;\n    float _bounceLeftBoundary;\n    float _bounceRightBoundary;\n\n    \n    bool _autoScroll;\n    float _autoScrollAddUpTime;\n    \n    float _autoScrollOriginalSpeed;\n    float _autoScrollAcceleration;\n    bool _isAutoScrollSpeedAttenuated;\n    bool _needCheckAutoScrollDestination;\n    Point _autoScrollDestination;\n    \n    bool _bePressed;\n    float _slidTime;\n    Point _moveChildPoint;\n    float _childFocusCancelOffset;\n    \n    bool _leftBounceNeeded;\n    bool _topBounceNeeded;\n    bool _rightBounceNeeded;\n    bool _bottomBounceNeeded;\n    \n    bool _bounceEnabled;\n    bool _bouncing;\n    Point _bounceDir;\n    float _bounceOriginalSpeed;\n    bool _inertiaScrollEnabled;\n\n\n    \n    Object* _scrollViewEventListener;\n    SEL_ScrollViewEvent _scrollViewEventSelector;\n};\n\n}\nNS_CC_END\n#endif /* defined(__CocoGUI__ScrollView__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UISlider.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UISlider.h\"\n#include \"extensions/GUI/CCControlExtension/CCScale9Sprite.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \nstatic const int BASEBAR_RENDERER_Z = (-2);\nstatic const int PROGRESSBAR_RENDERER_Z = (-2);\nstatic const int SLIDBALL_RENDERER_Z = (-1);\n    \nSlider::Slider():\n_barRenderer(nullptr),\n_progressBarRenderer(nullptr),\n_progressBarTextureSize(Size::ZERO),\n_slidBallNormalRenderer(nullptr),\n_slidBallPressedRenderer(nullptr),\n_slidBallDisabledRenderer(nullptr),\n_slidBallRenderer(nullptr),\n_barLength(0.0),\n_percent(0),\n_scale9Enabled(false),\n_prevIgnoreSize(true),\n_textureFile(\"\"),\n_progressBarTextureFile(\"\"),\n_slidBallNormalTextureFile(\"\"),\n_slidBallPressedTextureFile(\"\"),\n_slidBallDisabledTextureFile(\"\"),\n_capInsetsBarRenderer(Rect::ZERO),\n_capInsetsProgressBarRenderer(Rect::ZERO),\n_sliderEventListener(nullptr),\n_sliderEventSelector(nullptr),\n_barTexType(UI_TEX_TYPE_LOCAL),\n_progressBarTexType(UI_TEX_TYPE_LOCAL),\n_ballNTexType(UI_TEX_TYPE_LOCAL),\n_ballPTexType(UI_TEX_TYPE_LOCAL),\n_ballDTexType(UI_TEX_TYPE_LOCAL)\n{\n}\n\nSlider::~Slider()\n{\n    _sliderEventListener = nullptr;\n    _sliderEventSelector = nullptr;\n}\n\nSlider* Slider::create()\n{\n    Slider* widget = new Slider();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nvoid Slider::initRenderer()\n{\n    _barRenderer = Sprite::create();\n    _progressBarRenderer = Sprite::create();\n    _progressBarRenderer->setAnchorPoint(Point(0.0f, 0.5f));\n    Node::addChild(_barRenderer, BASEBAR_RENDERER_Z, -1);\n    Node::addChild(_progressBarRenderer, PROGRESSBAR_RENDERER_Z, -1);\n    _slidBallNormalRenderer = Sprite::create();\n    _slidBallPressedRenderer = Sprite::create();\n    _slidBallPressedRenderer->setVisible(false);\n    _slidBallDisabledRenderer = Sprite::create();\n    _slidBallDisabledRenderer->setVisible(false);\n    _slidBallRenderer = Node::create();\n    _slidBallRenderer->addChild(_slidBallNormalRenderer);\n    _slidBallRenderer->addChild(_slidBallPressedRenderer);\n    _slidBallRenderer->addChild(_slidBallDisabledRenderer);\n    Node::addChild(_slidBallRenderer, SLIDBALL_RENDERER_Z, -1);\n}\n\nvoid Slider::loadBarTexture(const char* fileName, TextureResType texType)\n{\n    if (!fileName || strcmp(fileName, \"\") == 0)\n    {\n        return;\n    }\n    _textureFile = fileName;\n    _barTexType = texType;\n    switch (_barTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            if (_scale9Enabled)\n            {\n                static_cast<extension::Scale9Sprite*>(_barRenderer)->initWithFile(fileName);\n            }\n            else\n            {\n                static_cast<Sprite*>(_barRenderer)->setTexture(fileName);\n            }\n            break;\n        case UI_TEX_TYPE_PLIST:\n            if (_scale9Enabled)\n            {\n                static_cast<extension::Scale9Sprite*>(_barRenderer)->initWithSpriteFrameName(fileName);\n            }\n            else\n            {\n                static_cast<Sprite*>(_barRenderer)->setSpriteFrame(fileName);\n            }\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    barRendererScaleChangedWithSize();\n}\n\nvoid Slider::loadProgressBarTexture(const char *fileName, TextureResType texType)\n{\n    if (!fileName || strcmp(fileName, \"\") == 0)\n    {\n        return;\n    }\n    _progressBarTextureFile = fileName;\n    _progressBarTexType = texType;\n    switch (_progressBarTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            if (_scale9Enabled)\n            {\n                static_cast<extension::Scale9Sprite*>(_progressBarRenderer)->initWithFile(fileName);\n            }\n            else\n            {\n                static_cast<Sprite*>(_progressBarRenderer)->setTexture(fileName);\n            }\n            break;\n        case UI_TEX_TYPE_PLIST:\n            if (_scale9Enabled)\n            {\n                static_cast<extension::Scale9Sprite*>(_progressBarRenderer)->initWithSpriteFrameName(fileName);\n            }\n            else\n            {\n                static_cast<Sprite*>(_progressBarRenderer)->setSpriteFrame(fileName);\n            }\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n    _progressBarRenderer->setAnchorPoint(Point(0.0f, 0.5f));\n    _progressBarTextureSize = _progressBarRenderer->getContentSize();\n    progressBarRendererScaleChangedWithSize();\n}\n\nvoid Slider::setScale9Enabled(bool able)\n{\n    if (_scale9Enabled == able)\n    {\n        return;\n    }\n    \n    _scale9Enabled = able;\n    Node::removeChild(_barRenderer);\n    Node::removeChild(_progressBarRenderer);\n    _barRenderer = nullptr;\n    _progressBarRenderer = nullptr;\n    if (_scale9Enabled)\n    {\n        _barRenderer = extension::Scale9Sprite::create();\n        _progressBarRenderer = extension::Scale9Sprite::create();\n    }\n    else\n    {\n        _barRenderer = Sprite::create();\n        _progressBarRenderer = Sprite::create();\n    }\n    loadBarTexture(_textureFile.c_str(), _barTexType);\n    loadProgressBarTexture(_progressBarTextureFile.c_str(), _progressBarTexType);\n    Node::addChild(_barRenderer, BASEBAR_RENDERER_Z, -1);\n    Node::addChild(_progressBarRenderer, PROGRESSBAR_RENDERER_Z, -1);\n    if (_scale9Enabled)\n    {\n        bool ignoreBefore = _ignoreSize;\n        ignoreContentAdaptWithSize(false);\n        _prevIgnoreSize = ignoreBefore;\n    }\n    else\n    {\n        ignoreContentAdaptWithSize(_prevIgnoreSize);\n    }\n    setCapInsetsBarRenderer(_capInsetsBarRenderer);\n    setCapInsetProgressBarRebderer(_capInsetsProgressBarRenderer);\n}\n\nvoid Slider::ignoreContentAdaptWithSize(bool ignore)\n{\n    if (!_scale9Enabled || (_scale9Enabled && !ignore))\n    {\n        Widget::ignoreContentAdaptWithSize(ignore);\n        _prevIgnoreSize = ignore;\n    }\n}\n\nvoid Slider::setCapInsets(const Rect &capInsets)\n{\n    setCapInsetsBarRenderer(capInsets);\n    setCapInsetProgressBarRebderer(capInsets);\n}\n\nvoid Slider::setCapInsetsBarRenderer(const Rect &capInsets)\n{\n    _capInsetsBarRenderer = capInsets;\n    if (!_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<extension::Scale9Sprite*>(_barRenderer)->setCapInsets(capInsets);\n}\n\nvoid Slider::setCapInsetProgressBarRebderer(const Rect &capInsets)\n{\n    _capInsetsProgressBarRenderer = capInsets;\n    if (!_scale9Enabled)\n    {\n        return;\n    }\n    static_cast<extension::Scale9Sprite*>(_progressBarRenderer)->setCapInsets(capInsets);\n}\n\nvoid Slider::loadSlidBallTextures(const char* normal,const char* pressed,const char* disabled,TextureResType texType)\n{\n    loadSlidBallTextureNormal(normal, texType);\n    loadSlidBallTexturePressed(pressed,texType);\n    loadSlidBallTextureDisabled(disabled,texType);\n}\n\nvoid Slider::loadSlidBallTextureNormal(const char* normal,TextureResType texType)\n{\n    if (!normal || strcmp(normal, \"\") == 0)\n    {\n        return;\n    }\n    _slidBallNormalTextureFile = normal;\n    _ballNTexType = texType;\n    switch (_ballNTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _slidBallNormalRenderer->setTexture(normal);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _slidBallNormalRenderer->setSpriteFrame(normal);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n}\n\nvoid Slider::loadSlidBallTexturePressed(const char* pressed,TextureResType texType)\n{\n    if (!pressed || strcmp(pressed, \"\") == 0)\n    {\n        return;\n    }\n    _slidBallPressedTextureFile = pressed;\n    _ballPTexType = texType;\n    switch (_ballPTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _slidBallPressedRenderer->setTexture(pressed);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _slidBallPressedRenderer->setSpriteFrame(pressed);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n}\n\nvoid Slider::loadSlidBallTextureDisabled(const char* disabled,TextureResType texType)\n{\n    if (!disabled || strcmp(disabled, \"\") == 0)\n    {\n        return;\n    }\n    _slidBallDisabledTextureFile = disabled;\n    _ballDTexType = texType;\n    switch (_ballDTexType)\n    {\n        case UI_TEX_TYPE_LOCAL:\n            _slidBallDisabledRenderer->setTexture(disabled);\n            break;\n        case UI_TEX_TYPE_PLIST:\n            _slidBallDisabledRenderer->setSpriteFrame(disabled);\n            break;\n        default:\n            break;\n    }\n    updateDisplayedColor(getColor());\n    updateDisplayedOpacity(getOpacity());\n}\n\nvoid Slider::setPercent(int percent)\n{\n    if (percent > 100)\n    {\n        percent = 100;\n    }\n    if (percent < 0)\n    {\n        percent = 0;\n    }\n    _percent = percent;\n    float res = percent / 100.0f;\n    float dis = _barLength * res;\n    _slidBallRenderer->setPosition(Point(-_barLength/2.0f + dis, 0.0f));\n    if (_scale9Enabled)\n    {\n        static_cast<extension::Scale9Sprite*>(_progressBarRenderer)->setPreferredSize(Size(dis,_progressBarTextureSize.height));\n    }\n    else\n    {\n        Sprite* spriteRenderer = static_cast<Sprite*>(_progressBarRenderer);\n        Rect rect = spriteRenderer->getTextureRect();\n        rect.size.width = _progressBarTextureSize.width * res;\n        spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size);\n    }\n}\n\nbool Slider::onTouchBegan(Touch *touch, Event *unusedEvent)\n{\n    bool pass = Widget::onTouchBegan(touch, unusedEvent);\n    if (_hitted)\n    {\n        Point nsp = convertToNodeSpace(_touchStartPos);\n        setPercent(getPercentWithBallPos(nsp.x));\n        percentChangedEvent();\n    }\n    return pass;\n}\n\nvoid Slider::onTouchMoved(Touch *touch, Event *unusedEvent)\n{\n    _touchMovePos = touch->getLocation();\n    Point nsp = convertToNodeSpace(_touchMovePos);\n    _slidBallRenderer->setPosition(Point(nsp.x,0));\n    setPercent(getPercentWithBallPos(nsp.x));\n    percentChangedEvent();\n}\n\nvoid Slider::onTouchEnded(Touch *touch, Event *unusedEvent)\n{\n    Widget::onTouchEnded(touch, unusedEvent);\n}\n\nvoid Slider::onTouchCancelled(Touch *touch, Event *unusedEvent)\n{\n    Widget::onTouchCancelled(touch, unusedEvent);\n}\n\nfloat Slider::getPercentWithBallPos(float px)\n{\n    return (((px-(-_barLength/2.0f))/_barLength)*100.0f);\n}\n\nvoid Slider::addEventListenerSlider(Object *target, SEL_SlidPercentChangedEvent selector)\n{\n    _sliderEventListener = target;\n    _sliderEventSelector = selector;\n}\n\nvoid Slider::percentChangedEvent()\n{\n    if (_sliderEventListener && _sliderEventSelector)\n    {\n        (_sliderEventListener->*_sliderEventSelector)(this,SLIDER_PERCENTCHANGED);\n    }\n}\n\nint Slider::getPercent()\n{\n    return _percent;\n}\n\nvoid Slider::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    barRendererScaleChangedWithSize();\n    progressBarRendererScaleChangedWithSize();\n}\n\nconst Size& Slider::getContentSize() const\n{\n    return _barRenderer->getContentSize();\n}\n\nNode* Slider::getVirtualRenderer()\n{\n    return _barRenderer;\n}\n\nvoid Slider::barRendererScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        \n        _barRenderer->setScale(1.0f);\n        _size = _barRenderer->getContentSize();\n        _barLength = _size.width;\n    }\n    else\n    {\n        _barLength = _size.width;\n        if (_scale9Enabled)\n        {\n            static_cast<extension::Scale9Sprite*>(_barRenderer)->setPreferredSize(_size);\n        }\n        else\n        {\n            Size btextureSize = _barRenderer->getContentSize();\n            if (btextureSize.width <= 0.0f || btextureSize.height <= 0.0f)\n            {\n                _barRenderer->setScale(1.0f);\n                return;\n            }\n            float bscaleX = _size.width / btextureSize.width;\n            float bscaleY = _size.height / btextureSize.height;\n            _barRenderer->setScaleX(bscaleX);\n            _barRenderer->setScaleY(bscaleY);\n        }\n    }\n    setPercent(_percent);\n}\n\nvoid Slider::progressBarRendererScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        if (!_scale9Enabled)\n        {\n            Size ptextureSize = _progressBarTextureSize;\n            float pscaleX = _size.width / ptextureSize.width;\n            float pscaleY = _size.height / ptextureSize.height;\n            _progressBarRenderer->setScaleX(pscaleX);\n            _progressBarRenderer->setScaleY(pscaleY);\n        }\n    }\n    else\n    {\n        if (_scale9Enabled)\n        {\n            static_cast<extension::Scale9Sprite*>(_progressBarRenderer)->setPreferredSize(_size);\n        }\n        else\n        {\n            Size ptextureSize = _progressBarTextureSize;\n            if (ptextureSize.width <= 0.0f || ptextureSize.height <= 0.0f)\n            {\n                _progressBarRenderer->setScale(1.0f);\n                return;\n            }\n            float pscaleX = _size.width / ptextureSize.width;\n            float pscaleY = _size.height / ptextureSize.height;\n            _progressBarRenderer->setScaleX(pscaleX);\n            _progressBarRenderer->setScaleY(pscaleY);\n        }\n    }\n    _progressBarRenderer->setPosition(Point(-_barLength * 0.5f, 0.0f));\n    setPercent(_percent);\n}\n\nvoid Slider::onPressStateChangedToNormal()\n{\n    _slidBallNormalRenderer->setVisible(true);\n    _slidBallPressedRenderer->setVisible(false);\n    _slidBallDisabledRenderer->setVisible(false);\n}\n\nvoid Slider::onPressStateChangedToPressed()\n{\n    _slidBallNormalRenderer->setVisible(false);\n    _slidBallPressedRenderer->setVisible(true);\n    _slidBallDisabledRenderer->setVisible(false);\n}\n\nvoid Slider::onPressStateChangedToDisabled()\n{\n    _slidBallNormalRenderer->setVisible(false);\n    _slidBallPressedRenderer->setVisible(false);\n    _slidBallDisabledRenderer->setVisible(true);\n}\n\nstd::string Slider::getDescription() const\n{\n    return \"Slider\";\n}\n\nWidget* Slider::createCloneInstance()\n{\n    return Slider::create();\n}\n\nvoid Slider::copySpecialProperties(Widget *widget)\n{\n    Slider* slider = dynamic_cast<Slider*>(widget);\n    if (slider)\n    {\n        _prevIgnoreSize = slider->_prevIgnoreSize;\n        setScale9Enabled(slider->_scale9Enabled);\n        loadBarTexture(slider->_textureFile.c_str(), slider->_barTexType);\n        loadProgressBarTexture(slider->_progressBarTextureFile.c_str(), slider->_progressBarTexType);\n        loadSlidBallTextureNormal(slider->_slidBallNormalTextureFile.c_str(), slider->_ballNTexType);\n        loadSlidBallTexturePressed(slider->_slidBallPressedTextureFile.c_str(), slider->_ballPTexType);\n        loadSlidBallTextureDisabled(slider->_slidBallDisabledTextureFile.c_str(), slider->_ballDTexType);\n        setPercent(slider->getPercent());\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UISlider.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UISLIDER_H__\n#define __UISLIDER_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\ntypedef enum\n{\n    SLIDER_PERCENTCHANGED\n}SliderEventType;\n\ntypedef void (Object::*SEL_SlidPercentChangedEvent)(Object*,SliderEventType);\n#define sliderpercentchangedselector(_SELECTOR) (SEL_SlidPercentChangedEvent)(&_SELECTOR)\n\n/**\n*   @js NA\n*   @lua NA\n*/\nclass Slider : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    Slider();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~Slider();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static Slider* create();\n    \n    /**\n     * Load texture for slider bar.\n     *\n     * @param fileName   file name of texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadBarTexture(const char* fileName,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Sets if slider is using scale9 renderer.\n     *\n     * @param true that using scale9 renderer, false otherwise.\n     */\n    void setScale9Enabled(bool able);\n    \n    /**\n     * Sets capinsets for slider, if slider is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for slider\n     */\n    void setCapInsets(const Rect &capInsets);\n    \n    /**\n     * Sets capinsets for slider, if slider is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for slider\n     */\n    void setCapInsetsBarRenderer(const Rect &capInsets);\n    \n    /**\n     * Sets capinsets for slider, if slider is using scale9 renderer.\n     *\n     * @param capInsets    capinsets for slider\n     */\n    void setCapInsetProgressBarRebderer(const Rect &capInsets);\n    \n    /**\n     * Load textures for slider ball.\n     *\n     * @param slider ball normal    normal state texture.\n     *\n     * @param slider ball selected    selected state texture.\n     *\n     * @param slider ball disabled    dark state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadSlidBallTextures(const char* normal,const char* pressed,const char* disabled,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load normal state texture for slider ball.\n     *\n     * @param normal    normal state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadSlidBallTextureNormal(const char* normal,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load selected state texture for slider ball.\n     *\n     * @param selected    selected state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadSlidBallTexturePressed(const char* pressed,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load dark state texture for slider ball.\n     *\n     * @param disabled    dark state texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadSlidBallTextureDisabled(const char* disabled,TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Load dark state texture for slider progress bar.\n     *\n     * @param fileName    file path of texture.\n     *\n     * @param texType    @see UI_TEX_TYPE_LOCAL\n     */\n    void loadProgressBarTexture(const char* fileName, TextureResType texType = UI_TEX_TYPE_LOCAL);\n    \n    /**\n     * Changes the progress direction of slider.\n     *\n     * @param percent    percent value from 1 to 100.\n     */\n    void setPercent(int percent);\n    \n    /**\n     * Gets the progress direction of slider.\n     *\n     * @return percent    percent value from 1 to 100.\n     */\n    int getPercent();\n    \n    /**\n     * Add call back function called when slider's percent has changed to slider.\n     */\n    void addEventListenerSlider(Object* target,SEL_SlidPercentChangedEvent selector);\n    \n    virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchMoved(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchEnded(Touch *touch, Event *unusedEvent) override;\n    virtual void onTouchCancelled(Touch *touch, Event *unusedEvent) override;\n    \n    //override \"getContentSize\" method of widget.\n    virtual const Size& getContentSize() const override;\n    \n    //override \"getVirtualRenderer\" method of widget.\n    virtual Node* getVirtualRenderer() override;\n    \n    //override \"ignoreContentAdaptWithSize\" method of widget.\n    virtual void ignoreContentAdaptWithSize(bool ignore) override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n\nprotected:\n    virtual void initRenderer() override;\n    float getPercentWithBallPos(float location);\n    void percentChangedEvent();\n    virtual void onPressStateChangedToNormal() override;\n    virtual void onPressStateChangedToPressed() override;\n    virtual void onPressStateChangedToDisabled() override;\n    virtual void onSizeChanged() override;\n    void barRendererScaleChangedWithSize();\n    void progressBarRendererScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    Node*  _barRenderer;\n    Node* _progressBarRenderer;\n    Size _progressBarTextureSize;\n    \n    Sprite* _slidBallNormalRenderer;\n    Sprite* _slidBallPressedRenderer;\n    Sprite* _slidBallDisabledRenderer;\n    Node* _slidBallRenderer;\n    \n    float _barLength;\n    int _percent;\n    \n    bool _scale9Enabled;\n    bool _prevIgnoreSize;\n    std::string _textureFile;\n    std::string _progressBarTextureFile;\n    std::string _slidBallNormalTextureFile;\n    std::string _slidBallPressedTextureFile;\n    std::string _slidBallDisabledTextureFile;\n\n    Rect _capInsetsBarRenderer;\n    Rect _capInsetsProgressBarRenderer;\n\n    Object*       _sliderEventListener;\n    SEL_SlidPercentChangedEvent    _sliderEventSelector;\n    TextureResType _barTexType;\n    TextureResType _progressBarTexType;\n    TextureResType _ballNTexType;\n    TextureResType _ballPTexType;\n    TextureResType _ballDTexType;\n};\n\n}\nNS_CC_END\n\n#endif /* defined(__CocoGUI__Slider__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIText.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UIText.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nstatic const int LABEL_RENDERER_Z = (-1);\n\nText::Text():\n_touchScaleChangeEnabled(false),\n_normalScaleValueX(1.0f),\n_normalScaleValueY(1.0f),\n_fontName(\"Thonburi\"),\n_fontSize(10),\n_onSelectedScaleOffset(0.5),\n_labelRenderer(nullptr)\n{\n}\n\nText::~Text()\n{\n    \n}\n\nText* Text::create()\n{\n    Text* widget = new Text();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nbool Text::init()\n{\n    if (Widget::init())\n    {\n        return true;\n    }\n    return false;\n}\n\nvoid Text::initRenderer()\n{\n    _labelRenderer = LabelTTF::create();\n    Node::addChild(_labelRenderer, LABEL_RENDERER_Z, -1);\n}\n\nvoid Text::setText(const std::string& text)\n{\n\tif (text.size()==0)\n\t\treturn;\n\n    _labelRenderer->setString(text);\n    labelScaleChangedWithSize();\n}\n\nconst std::string& Text::getStringValue()\n{\n    return _labelRenderer->getString();\n}\n\nssize_t Text::getStringLength()\n{\n    return _labelRenderer->getString().size();\n}\n\nvoid Text::setFontSize(int size)\n{\n    _fontSize = size;\n    _labelRenderer->setFontSize(size);\n    labelScaleChangedWithSize();\n}\n\nvoid Text::setFontName(const std::string& name)\n{\n    _fontName = name;\n    _labelRenderer->setFontName(name);\n    labelScaleChangedWithSize();\n}\n\nvoid Text::setTextAreaSize(const Size &size)\n{\n    _labelRenderer->setDimensions(size);\n    labelScaleChangedWithSize();\n}\n\nvoid Text::setTextHorizontalAlignment(TextHAlignment alignment)\n{\n    _labelRenderer->setHorizontalAlignment(alignment);\n    labelScaleChangedWithSize();\n}\n\nvoid Text::setTextVerticalAlignment(TextVAlignment alignment)\n{\n    _labelRenderer->setVerticalAlignment(alignment);\n    labelScaleChangedWithSize();\n}\n\nvoid Text::setTouchScaleChangeEnabled(bool enable)\n{\n    _touchScaleChangeEnabled = enable;\n    _normalScaleValueX = getScaleX();\n    _normalScaleValueY = getScaleY();\n}\n    \nvoid Text::setScale(float fScale)\n{\n    Widget::setScale(fScale);\n    _normalScaleValueX = _normalScaleValueY = fScale;\n}\n    \nvoid Text::setScaleX(float fScaleX)\n{\n    Widget::setScaleX(fScaleX);\n}\n    \nvoid Text::setScaleY(float fScaleY)\n{\n    Widget::setScaleY(fScaleY);\n}\n\nbool Text::isTouchScaleChangeEnabled()\n{\n    return _touchScaleChangeEnabled;\n}\n\nvoid Text::onPressStateChangedToNormal()\n{\n    if (!_touchScaleChangeEnabled)\n    {\n        return;\n    }\n    clickScale(_normalScaleValueX, _normalScaleValueY);\n}\n\nvoid Text::onPressStateChangedToPressed()\n{\n    if (!_touchScaleChangeEnabled)\n    {\n        return;\n    }\n    _normalScaleValueX = getScaleX();\n    _normalScaleValueY = getScaleY();\n    clickScale(_normalScaleValueX + _onSelectedScaleOffset, _normalScaleValueY + _onSelectedScaleOffset);\n}\n\nvoid Text::onPressStateChangedToDisabled()\n{\n    \n}\n\nvoid Text::clickScale(float scaleX, float scaleY)\n{\n    setScaleX(scaleX);\n    setScaleY(scaleY);\n}\n\nvoid Text::setFlipX(bool flipX)\n{\n    _labelRenderer->setFlippedX(flipX);\n}\n\nvoid Text::setFlipY(bool flipY)\n{\n    _labelRenderer->setFlippedY(flipY);\n}\n\nbool Text::isFlipX()\n{\n    return _labelRenderer->isFlippedX();\n}\n\nbool Text::isFlipY()\n{\n    return _labelRenderer->isFlippedY();\n}\n\nvoid Text::setAnchorPoint(const Point &pt)\n{\n    Widget::setAnchorPoint(pt);\n    _labelRenderer->setAnchorPoint(pt);\n}\n\nvoid Text::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    labelScaleChangedWithSize();\n}\n\nconst Size& Text::getContentSize() const\n{\n    return _labelRenderer->getContentSize();\n}\n\nNode* Text::getVirtualRenderer()\n{\n    return _labelRenderer;\n}\n\nvoid Text::labelScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _labelRenderer->setScale(1.0f);\n        _size = _labelRenderer->getContentSize();\n    }\n    else\n    {\n        Size textureSize = _labelRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _labelRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _labelRenderer->setScaleX(scaleX);\n        _labelRenderer->setScaleY(scaleY);\n    }\n    \n}\n\nstd::string Text::getDescription() const\n{\n    return \"Label\";\n}\n\nWidget* Text::createCloneInstance()\n{\n    return Text::create();\n}\n\nvoid Text::copySpecialProperties(Widget *widget)\n{\n    Text* label = dynamic_cast<Text*>(widget);\n    if (label)\n    {\n        setFontName(label->_fontName.c_str());\n        setFontSize(label->_labelRenderer->getFontSize());\n        setText(label->getStringValue());\n        setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled);\n        setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment());\n        setTextVerticalAlignment(label->_labelRenderer->getVerticalAlignment());\n        setTextAreaSize(label->_labelRenderer->getDimensions());\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UIText.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UILABEL_H__\n#define __UILABEL_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\n/**\n*   @js NA\n*   @lua NA\n*/\nclass Text : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    Text();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~Text();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static Text* create();\n    \n    /**\n     * Changes the string value of label.\n     *\n     * @param text  string value.\n     */\n    void setText(const std::string& text);\n    \n    /**\n     * Gets the string value of label.\n     *\n     * @return text  string value.\n     */\n    const std::string& getStringValue();\n    \n    /**\n     * Gets the string length of label.\n     *\n     * @return  string length.\n     */\n    ssize_t getStringLength();\n    \n    /**\n     * Sets the font size of label.\n     *\n     * @param  font size.\n     */\n    void setFontSize(int size);\n    \n    /**\n     * Sets the font name of label.\n     *\n     * @param  font name.\n     */\n    void setFontName(const std::string& name);\n    \n    /**\n     * Sets the touch scale enabled of label.\n     *\n     * @param  touch scale enabled of label.\n     */\n    void setTouchScaleChangeEnabled(bool enabled);\n    \n    /**\n     * Gets the touch scale enabled of label.\n     *\n     * @return  touch scale enabled of label.\n     */\n    bool isTouchScaleChangeEnabled();\n    \n    /**\n     * Changes both X and Y scale factor of the widget.\n     *\n     * 1.0 is the default scale factor. It modifies the X and Y scale at the same time.\n     *\n     * @param scale     The scale factor for both X and Y axis.\n     */\n    virtual void setScale(float fScale) override;\n    \n    /**\n     * Changes the scale factor on X axis of this widget\n     *\n     * The deafult value is 1.0 if you haven't changed it before\n     *\n     * @param fScaleX   The scale factor on X axis.\n     */\n    virtual void setScaleX(float fScaleX) override;\n    \n    /**\n     * Changes the scale factor on Y axis of this widget\n     *\n     * The Default value is 1.0 if you haven't changed it before.\n     *\n     * @param fScaleY   The scale factor on Y axis.\n     */\n    virtual void setScaleY(float fScaleY) override;\n    \n\n    //override \"setFlipX\" method of widget.\n    virtual void setFlipX(bool flipX) override;\n    \n    //override \"setFlipY\" method of widget.\n    virtual void setFlipY(bool flipY) override;\n    \n    //override \"isFlipX\" method of widget.\n    virtual bool isFlipX() override;\n    \n    //override \"isFlipY\" method of widget.\n    virtual bool isFlipY() override;\n    \n    //override \"setAnchorPoint\" method of widget.\n    virtual void setAnchorPoint(const Point &pt) override;\n    \n    //override \"getContentSize\" method of widget.\n    virtual const Size& getContentSize() const override;\n    \n    //override \"getVirtualRenderer\" method of widget.\n    virtual Node* getVirtualRenderer() override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n    \n    void setTextAreaSize(const Size &size);\n    void setTextHorizontalAlignment(TextHAlignment alignment);\n    void setTextVerticalAlignment(TextVAlignment alignment);    \nprotected:\n    virtual bool init() override;\n    virtual void initRenderer() override;\n    virtual void onPressStateChangedToNormal() override;\n    virtual void onPressStateChangedToPressed() override;\n    virtual void onPressStateChangedToDisabled() override;\n    virtual void onSizeChanged() override;\n    void clickScale(float scaleX, float scaleY);\n    void labelScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    bool _touchScaleChangeEnabled;\n    float _normalScaleValueX;\n    float _normalScaleValueY;\n    std::string _fontName;\n    int _fontSize;\n    float _onSelectedScaleOffset;\n    LabelTTF* _labelRenderer;\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__CocoGUI__Label__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UITextAtlas.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UITextAtlas.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \nstatic const int LABELATLAS_RENDERER_Z = (-1);\n\nTextAtlas::TextAtlas():\n_labelAtlasRenderer(nullptr),\n_stringValue(\"\"),\n_charMapFileName(\"\"),\n_itemWidth(0),\n_itemHeight(0),\n_startCharMap(\"\")\n{\n}\n\nTextAtlas::~TextAtlas()\n{\n    \n}\n\nTextAtlas* TextAtlas::create()\n{\n    TextAtlas* widget = new TextAtlas();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nvoid TextAtlas::initRenderer()\n{\n    _labelAtlasRenderer = LabelAtlas::create();\n    Node::addChild(_labelAtlasRenderer, LABELATLAS_RENDERER_Z, -1);\n}\n\nvoid TextAtlas::setProperty(const std::string& stringValue, const std::string& charMapFile, int itemWidth, int itemHeight, const std::string& startCharMap)\n{\n    _stringValue = stringValue;\n    _charMapFileName = charMapFile;\n    _itemWidth = itemWidth;\n    _itemHeight = itemHeight;\n    _startCharMap = startCharMap;\n    _labelAtlasRenderer->initWithString(stringValue, charMapFile, itemWidth, itemHeight, (int)(startCharMap[0]));\n    updateAnchorPoint();\n    labelAtlasScaleChangedWithSize();\n}\n\nvoid TextAtlas::setStringValue(const std::string& value)\n{\n    _stringValue = value;\n    _labelAtlasRenderer->setString(value);\n    labelAtlasScaleChangedWithSize();\n}\n\nconst std::string& TextAtlas::getStringValue() const\n{\n    return _labelAtlasRenderer->getString();\n}\n\nvoid TextAtlas::setAnchorPoint(const Point &pt)\n{\n    Widget::setAnchorPoint(pt);\n    _labelAtlasRenderer->setAnchorPoint(Point(pt.x, pt.y));\n}\n\nvoid TextAtlas::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    labelAtlasScaleChangedWithSize();\n}\n\nconst Size& TextAtlas::getContentSize() const\n{\n    return _labelAtlasRenderer->getContentSize();\n}\n\nNode* TextAtlas::getVirtualRenderer()\n{\n    return _labelAtlasRenderer;\n}\n\nvoid TextAtlas::labelAtlasScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _labelAtlasRenderer->setScale(1.0f);\n        _size = _labelAtlasRenderer->getContentSize();\n    }\n    else\n    {\n        Size textureSize = _labelAtlasRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _labelAtlasRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _labelAtlasRenderer->setScaleX(scaleX);\n        _labelAtlasRenderer->setScaleY(scaleY);\n    }\n}\n\nstd::string TextAtlas::getDescription() const\n{\n    return \"TextAtlas\";\n}\n\nWidget* TextAtlas::createCloneInstance()\n{\n    return TextAtlas::create();\n}\n\nvoid TextAtlas::copySpecialProperties(Widget *widget)\n{\n    TextAtlas* labelAtlas = dynamic_cast<TextAtlas*>(widget);\n    if (labelAtlas)\n    {\n        setProperty(labelAtlas->_stringValue, labelAtlas->_charMapFileName, labelAtlas->_itemWidth, labelAtlas->_itemHeight, labelAtlas->_startCharMap);\n    }\n}\n    \n}\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UITextAtlas.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UILABELATLAS_H__\n#define __UILABELATLAS_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \n/**\n *   @js NA\n *   @lua NA\n */\nclass TextAtlas : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    TextAtlas();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~TextAtlas();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static TextAtlas* create();\n    \n    /** initializes the LabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */\n    void setProperty(const std::string& stringValue,const std::string& charMapFile, int itemWidth, int itemHeight, const std::string& startCharMap);\n    \n    //set string value for labelatlas.\n    void setStringValue(const std::string& value);\n    \n    //get string value for labelatlas.\n    const std::string& getStringValue() const;\n    \n    //override \"setAnchorPoint\" method of widget.\n    virtual void setAnchorPoint(const Point &pt) override;\n    \n    //override \"getContentSize\" method of widget.\n    virtual const Size& getContentSize() const override;\n    \n    //override \"getVirtualRenderer\" method of widget.\n    virtual Node* getVirtualRenderer() override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n    \nprotected:\n    virtual void initRenderer() override;\n    virtual void onSizeChanged() override;\n    void labelAtlasScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    LabelAtlas* _labelAtlasRenderer;\n    std::string _stringValue;\n    std::string _charMapFileName;\n    int _itemWidth;\n    int _itemHeight;\n    std::string _startCharMap;\n};\n\n}\nNS_CC_END\n\n#endif /* defined(__CocoGUI__LabelAtlas__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UITextBMFont.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UITextBMFont.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \nstatic const int LABELBMFONT_RENDERER_Z = (-1);\n    \nTextBMFont::TextBMFont():\n_labelBMFontRenderer(nullptr),\n_fntFileHasInit(false),\n_fntFileName(\"\"),\n_stringValue(\"\")\n{\n}\n\nTextBMFont::~TextBMFont()\n{\n    \n}\n\nTextBMFont* TextBMFont::create()\n{\n    TextBMFont* widget = new TextBMFont();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nvoid TextBMFont::initRenderer()\n{\n    _labelBMFontRenderer = cocos2d::LabelBMFont::create();\n    Node::addChild(_labelBMFontRenderer, LABELBMFONT_RENDERER_Z, -1);\n}\n\nvoid TextBMFont::setFntFile(const char *fileName)\n{\n    if (!fileName || strcmp(fileName, \"\") == 0)\n    {\n        return;\n    }\n    _fntFileName = fileName;\n    _labelBMFontRenderer->initWithString(\"\", fileName);\n    updateAnchorPoint();\n    labelBMFontScaleChangedWithSize();\n    _fntFileHasInit = true;\n    setText(_stringValue.c_str());\n}\n\nvoid TextBMFont::setText(const char* value)\n{\n    if (!value)\n\t{\n\t\treturn;\n\t}\n    _stringValue = value;\n    if (!_fntFileHasInit)\n    {\n        return;\n    }\n    _labelBMFontRenderer->setString(value);\n    labelBMFontScaleChangedWithSize();\n}\n\nconst char* TextBMFont::getStringValue()\n{\n    return _stringValue.c_str();\n}\n\nvoid TextBMFont::setAnchorPoint(const Point &pt)\n{\n    Widget::setAnchorPoint(pt);\n    _labelBMFontRenderer->setAnchorPoint(pt);\n}\n\nvoid TextBMFont::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    labelBMFontScaleChangedWithSize();\n}\n\nconst Size& TextBMFont::getContentSize() const\n{\n    return _labelBMFontRenderer->getContentSize();\n}\n\nNode* TextBMFont::getVirtualRenderer()\n{\n    return _labelBMFontRenderer;\n}\n\nvoid TextBMFont::labelBMFontScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _labelBMFontRenderer->setScale(1.0f);\n        _size = _labelBMFontRenderer->getContentSize();\n    }\n    else\n    {\n        Size textureSize = _labelBMFontRenderer->getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _labelBMFontRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _labelBMFontRenderer->setScaleX(scaleX);\n        _labelBMFontRenderer->setScaleY(scaleY);\n    }\n}\n\nstd::string TextBMFont::getDescription() const\n{\n    return \"TextBMFont\";\n}\n\nWidget* TextBMFont::createCloneInstance()\n{\n    return TextBMFont::create();\n}\n\nvoid TextBMFont::copySpecialProperties(Widget *widget)\n{\n    TextBMFont* labelBMFont = dynamic_cast<TextBMFont*>(widget);\n    if (labelBMFont)\n    {\n        setFntFile(labelBMFont->_fntFileName.c_str());\n        setText(labelBMFont->_stringValue.c_str());\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UITextBMFont.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UILABELBMFONT_H__\n#define __UILABELBMFONT_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \n/**\n*   @js NA\n*   @lua NA\n*/    \nclass TextBMFont : public Widget\n{\npublic:\n    /**\n     * Default constructor\n     */\n    TextBMFont();\n    \n    /**\n     * Default destructor\n     */\n    virtual ~TextBMFont();\n    \n    /**\n     * Allocates and initializes.\n     */\n    static TextBMFont* create();\n    \n    /** init a bitmap font atlas with an initial string and the FNT file */\n    void setFntFile(const char* fileName);\n    \n    /** set string value for labelbmfont*/\n    void setText(const char* value);\n    \n    /** get string value for labelbmfont*/\n    const char* getStringValue();\n    virtual void setAnchorPoint(const Point &pt) override;\n    virtual const Size& getContentSize() const override;\n    virtual Node* getVirtualRenderer() override;\n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\nprotected:\n    virtual void initRenderer() override;\n    virtual void onSizeChanged() override;\n    void labelBMFontScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    cocos2d::LabelBMFont* _labelBMFontRenderer;\n    bool _fntFileHasInit;\n    std::string _fntFileName;\n    std::string _stringValue;\n};\n    \n}\nNS_CC_END\n\n#endif /* defined(__LabelBMFont__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UITextField.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UITextField.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\nUICCTextField::UICCTextField()\n: _maxLengthEnabled(false)\n, _maxLength(0)\n, _passwordEnabled(false)\n, _passwordStyleText(\"*\")\n, _attachWithIME(false)\n, _detachWithIME(false)\n, _insertText(false)\n, _deleteBackward(false)\n{\n}\n\nUICCTextField::~UICCTextField()\n{\n}\n\nUICCTextField * UICCTextField::create(const char *placeholder, const char *fontName, float fontSize)\n{\n    UICCTextField *pRet = new UICCTextField();\n    \n    if(pRet && pRet->initWithString(\"\", fontName, fontSize))\n    {\n        pRet->autorelease();\n        if (placeholder)\n        {\n            pRet->setPlaceHolder(placeholder);\n        }\n        return pRet;\n    }\n    CC_SAFE_DELETE(pRet);\n    \n    return nullptr;\n}\n\nvoid UICCTextField::onEnter()\n{\n    TextFieldTTF::setDelegate(this);\n}\n\n\nbool UICCTextField::onTextFieldAttachWithIME(TextFieldTTF *pSender)\n{\n    setAttachWithIME(true);\n    return false;\n}\n\nbool UICCTextField::onTextFieldInsertText(TextFieldTTF *pSender, const char *text, int nLen)\n{\n    if (nLen == 1 && strcmp(text, \"\\n\") == 0)\n    {\n        return false;\n    }\n    setInsertText(true);\n    if (_maxLengthEnabled)\n    {\n        if (TextFieldTTF::getCharCount() >= _maxLength)\n        {\n            return true;\n        }\n    }\n    \n    return false;\n}\n\nbool UICCTextField::onTextFieldDeleteBackward(TextFieldTTF *pSender, const char *delText, int nLen)\n{\n    setDeleteBackward(true);\n    return false;\n}\n\nbool UICCTextField::onTextFieldDetachWithIME(TextFieldTTF *pSender)\n{\n    setDetachWithIME(true);\n    return false;\n}\n\nvoid UICCTextField::insertText(const char * text, int len)\n{\n    std::string str_text = text;\n    ssize_t str_len = TextFieldTTF::getString().size();\n    \n    if (strcmp(text, \"\\n\") != 0)\n    {\n        if (_maxLengthEnabled)\n        {\n            int multiple = 1;\n            char value = text[0];\n            if (value < 0 || value > 127)\n            {\n                multiple = 3;\n            }\n            \n            if (str_len + len > _maxLength * multiple)\n            {\n                str_text = str_text.substr(0, _maxLength * multiple);\n                len = _maxLength * multiple;\n                /*\n                 int mod = str_len % 3;\n                 int offset = (mod == 0) ? 0 : (3 - mod);\n                 int amount = str_len + offset;\n                 str_text = str_text.substr(0, _maxLength - amount);\n                 //                CCLOG(\"str_test = %s\", str_text.c_str());\n                 */\n            }\n        }\n    }\n    TextFieldTTF::insertText(str_text.c_str(), len);\n    \n    // password\n    if (_passwordEnabled)\n    {\n        if (TextFieldTTF::getCharCount() > 0)\n        {\n            setPasswordText(_inputText.c_str());\n        }\n    }\n}\n\nvoid UICCTextField::deleteBackward()\n{\n    TextFieldTTF::deleteBackward();\n    \n    if (TextFieldTTF::getCharCount() > 0)\n    {\n        // password\n        if (_passwordEnabled)\n        {\n            setPasswordText(_inputText.c_str());\n        }\n    }\n}\n\nvoid UICCTextField::openIME()\n{\n    TextFieldTTF::attachWithIME();\n}\n\nvoid UICCTextField::closeIME()\n{\n    TextFieldTTF::detachWithIME();\n}\n\nvoid UICCTextField::setMaxLengthEnabled(bool enable)\n{\n    _maxLengthEnabled = enable;\n}\n\nbool UICCTextField::isMaxLengthEnabled()\n{\n    return _maxLengthEnabled;\n}\n\nvoid UICCTextField::setMaxLength(int length)\n{\n    _maxLength = length;\n}\n\nint UICCTextField::getMaxLength()\n{\n    return _maxLength;\n}\n\nint UICCTextField::getCharCount()\n{\n    return TextFieldTTF::getCharCount();\n}\n\nvoid UICCTextField::setPasswordEnabled(bool enable)\n{\n    _passwordEnabled = enable;\n}\n\nbool UICCTextField::isPasswordEnabled()\n{\n    return _passwordEnabled;\n}\n\nvoid UICCTextField::setPasswordStyleText(const char* styleText)\n{\n    if (strlen(styleText) > 1)\n    {\n        return;\n    }\n    char value = styleText[0];\n    if (value < 33 || value > 126)\n    {\n        return;\n    }\n    _passwordStyleText = styleText;\n}\n\nvoid UICCTextField::setPasswordText(const char *text)\n{\n    std::string tempStr;\n    for (size_t i = 0; i < strlen(text); ++i)\n    {\n        tempStr.append(_passwordStyleText);\n    }\n    LabelTTF::setString(tempStr.c_str());\n}\n\nvoid UICCTextField::setAttachWithIME(bool attach)\n{\n    _attachWithIME = attach;\n}\n\nbool UICCTextField::getAttachWithIME()\n{\n    return _attachWithIME;\n}\n\nvoid UICCTextField::setDetachWithIME(bool detach)\n{\n    _detachWithIME = detach;\n}\n\nbool UICCTextField::getDetachWithIME()\n{\n    return _detachWithIME;\n}\n\nvoid UICCTextField::setInsertText(bool insert)\n{\n    _insertText = insert;\n}\n\nbool UICCTextField::getInsertText()\n{\n    return _insertText;\n}\n\nvoid UICCTextField::setDeleteBackward(bool deleteBackward)\n{\n    _deleteBackward = deleteBackward;\n}\n\nbool UICCTextField::getDeleteBackward()\n{\n    return _deleteBackward;\n}\n\nstatic const int TEXTFIELD_RENDERER_Z = (-1);\n\n    \nTextField::TextField():\n_textFieldRenderer(nullptr),\n_touchWidth(0.0f),\n_touchHeight(0.0f),\n_useTouchArea(false),\n_textFieldEventListener(nullptr),\n_textFieldEventSelector(nullptr),\n_passwordStyleText(\"\")\n{\n}\n\nTextField::~TextField()\n{\n    _textFieldEventListener = nullptr;\n    _textFieldEventSelector = nullptr;\n}\n\nTextField* TextField::create()\n{\n    TextField* widget = new TextField();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n    \nvoid TextField::onEnter()\n{\n    Widget::onEnter();\n    scheduleUpdate();\n}\n\nvoid TextField::initRenderer()\n{\n    _textFieldRenderer = UICCTextField::create(\"input words here\", \"Thonburi\", 20);\n    Node::addChild(_textFieldRenderer, TEXTFIELD_RENDERER_Z, -1);\n}\n\nvoid TextField::setTouchSize(const Size &size)\n{\n    _useTouchArea = true;\n    _touchWidth = size.width;\n    _touchHeight = size.height;\n}\n\nvoid TextField::setText(const std::string& text)\n{\n    std::string strText(text);\n    if (isMaxLengthEnabled())\n    {\n        strText = strText.substr(0, getMaxLength());\n    }\n    const char* content = strText.c_str();\n    if (isPasswordEnabled())\n    {\n        _textFieldRenderer->setPasswordText(content);\n        _textFieldRenderer->insertText(content, static_cast<int>(strlen(content)));\n    }\n    else\n    {\n        _textFieldRenderer->setString(content);\n    }\n    textfieldRendererScaleChangedWithSize();\n}\n\nvoid TextField::setPlaceHolder(const std::string& value)\n{\n    _textFieldRenderer->setPlaceHolder(value);\n    textfieldRendererScaleChangedWithSize();\n}\n\nvoid TextField::setFontSize(int size)\n{\n    _textFieldRenderer->setFontSize(size);\n    textfieldRendererScaleChangedWithSize();\n}\n\nvoid TextField::setFontName(const std::string& name)\n{\n    _textFieldRenderer->setFontName(name);\n    textfieldRendererScaleChangedWithSize();\n}\n\nvoid TextField::didNotSelectSelf()\n{\n    _textFieldRenderer->detachWithIME();\n}\n\nconst std::string& TextField::getStringValue()\n{\n    return _textFieldRenderer->getString();\n}\n\nbool TextField::onTouchBegan(Touch *touch, Event *unusedEvent)\n{\n    bool pass = Widget::onTouchBegan(touch, unusedEvent);\n    if (_hitted)\n    {\n        _textFieldRenderer->attachWithIME();\n    }\n    return pass;\n}\n\nvoid TextField::setMaxLengthEnabled(bool enable)\n{\n    _textFieldRenderer->setMaxLengthEnabled(enable);\n}\n\nbool TextField::isMaxLengthEnabled()\n{\n    return _textFieldRenderer->isMaxLengthEnabled();\n}\n\nvoid TextField::setMaxLength(int length)\n{\n    _textFieldRenderer->setMaxLength(length);\n}\n\nint TextField::getMaxLength()\n{\n    return _textFieldRenderer->getMaxLength();\n}\n\nvoid TextField::setPasswordEnabled(bool enable)\n{\n    _textFieldRenderer->setPasswordEnabled(enable);\n}\n\nbool TextField::isPasswordEnabled()\n{\n    return _textFieldRenderer->isPasswordEnabled();\n}\n\nvoid TextField::setPasswordStyleText(const char *styleText)\n{\n    _textFieldRenderer->setPasswordStyleText(styleText);\n    \n    _passwordStyleText = styleText;\n}\n\nvoid TextField::update(float dt)\n{\n    if (getAttachWithIME())\n    {\n        attachWithIMEEvent();\n        setAttachWithIME(false);\n    }\n    if (getDetachWithIME())\n    {\n        detachWithIMEEvent();\n        setDetachWithIME(false);\n    }\n    if (getInsertText())\n    {\n        insertTextEvent();\n        setInsertText(false);\n        \n        textfieldRendererScaleChangedWithSize();\n    }\n    if (getDeleteBackward())\n    {\n        deleteBackwardEvent();\n        setDeleteBackward(false);\n    }\n}\n\nbool TextField::getAttachWithIME()\n{\n    return _textFieldRenderer->getAttachWithIME();\n}\n\nvoid TextField::setAttachWithIME(bool attach)\n{\n    _textFieldRenderer->setAttachWithIME(attach);\n}\n\nbool TextField::getDetachWithIME()\n{\n    return _textFieldRenderer->getDetachWithIME();\n}\n\nvoid TextField::setDetachWithIME(bool detach)\n{\n    _textFieldRenderer->setDetachWithIME(detach);\n}\n\nbool TextField::getInsertText()\n{\n    return _textFieldRenderer->getInsertText();\n}\n\nvoid TextField::setInsertText(bool insertText)\n{\n    _textFieldRenderer->setInsertText(insertText);\n}\n\nbool TextField::getDeleteBackward()\n{\n    return _textFieldRenderer->getDeleteBackward();\n}\n\nvoid TextField::setDeleteBackward(bool deleteBackward)\n{\n    _textFieldRenderer->setDeleteBackward(deleteBackward);\n}\n\nvoid TextField::attachWithIMEEvent()\n{\n    if (_textFieldEventListener && _textFieldEventSelector)\n    {\n        (_textFieldEventListener->*_textFieldEventSelector)(this, TEXTFIELD_EVENT_ATTACH_WITH_IME);\n    }\n}\n\nvoid TextField::detachWithIMEEvent()\n{\n    if (_textFieldEventListener && _textFieldEventSelector)\n    {\n        (_textFieldEventListener->*_textFieldEventSelector)(this, TEXTFIELD_EVENT_DETACH_WITH_IME);\n    }\n}\n\nvoid TextField::insertTextEvent()\n{\n    if (_textFieldEventListener && _textFieldEventSelector)\n    {\n        (_textFieldEventListener->*_textFieldEventSelector)(this, TEXTFIELD_EVENT_INSERT_TEXT);\n    }\n}\n\nvoid TextField::deleteBackwardEvent()\n{\n    if (_textFieldEventListener && _textFieldEventSelector)\n    {\n        (_textFieldEventListener->*_textFieldEventSelector)(this, TEXTFIELD_EVENT_DELETE_BACKWARD);\n    }\n}\n\nvoid TextField::addEventListenerTextField(Object *target, SEL_TextFieldEvent selecor)\n{\n    _textFieldEventListener = target;\n    _textFieldEventSelector = selecor;\n}\n\nvoid TextField::setAnchorPoint(const Point &pt)\n{\n    Widget::setAnchorPoint(pt);\n    _textFieldRenderer->setAnchorPoint(pt);\n}\n\nvoid TextField::onSizeChanged()\n{\n    Widget::onSizeChanged();\n    textfieldRendererScaleChangedWithSize();\n}\n\nvoid TextField::textfieldRendererScaleChangedWithSize()\n{\n    if (_ignoreSize)\n    {\n        _textFieldRenderer->setScale(1.0f);\n        _size = getContentSize();\n    }\n    else\n    {\n        Size textureSize = getContentSize();\n        if (textureSize.width <= 0.0f || textureSize.height <= 0.0f)\n        {\n            _textFieldRenderer->setScale(1.0f);\n            return;\n        }\n        float scaleX = _size.width / textureSize.width;\n        float scaleY = _size.height / textureSize.height;\n        _textFieldRenderer->setScaleX(scaleX);\n        _textFieldRenderer->setScaleY(scaleY);\n    }\n}\n\nconst Size& TextField::getContentSize() const\n{\n    return _textFieldRenderer->getContentSize();\n}\n\nNode* TextField::getVirtualRenderer()\n{\n    return _textFieldRenderer;\n}\n\nstd::string TextField::getDescription() const\n{\n    return \"TextField\";\n}\n\nvoid TextField::attachWithIME()\n{\n    _textFieldRenderer->attachWithIME();\n}\n\nWidget* TextField::createCloneInstance()\n{\n    return TextField::create();\n}\n\nvoid TextField::copySpecialProperties(Widget *widget)\n{\n    TextField* textField = dynamic_cast<TextField*>(widget);\n    if (textField)\n    {\n        setText(textField->_textFieldRenderer->getString());\n        setPlaceHolder(textField->getStringValue());\n        setFontSize(textField->_textFieldRenderer->getFontSize());\n        setFontName(textField->_textFieldRenderer->getFontName().c_str());\n        setMaxLengthEnabled(textField->isMaxLengthEnabled());\n        setMaxLength(textField->getMaxLength());\n        setPasswordEnabled(textField->isPasswordEnabled());\n        setPasswordStyleText(textField->_passwordStyleText.c_str());\n        setAttachWithIME(textField->getAttachWithIME());\n        setDetachWithIME(textField->getDetachWithIME());\n        setInsertText(textField->getInsertText());\n        setDeleteBackward(textField->getDeleteBackward());\n    }\n}\n\n}\n\nNS_CC_END"
  },
  {
    "path": "cocos2d/cocos/gui/UITextField.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UITEXTFIELD_H__\n#define __UITEXTFIELD_H__\n\n#include \"gui/UIWidget.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\n/**\n *  @js NA\n *  @lua NA\n */\nclass UICCTextField: public TextFieldTTF, public TextFieldDelegate\n{\npublic:\n    UICCTextField();\n    ~UICCTextField();\n    \n    virtual void onEnter();\n    \n    // static\n    static UICCTextField* create(const char *placeholder, const char *fontName, float fontSize);\n    \n    // CCTextFieldDelegate\n    virtual bool onTextFieldAttachWithIME(TextFieldTTF *pSender) override;\n    virtual bool onTextFieldDetachWithIME(TextFieldTTF * pSender) override;\n    virtual bool onTextFieldInsertText(TextFieldTTF * pSender, const char * text, int nLen) override;\n    virtual bool onTextFieldDeleteBackward(TextFieldTTF * pSender, const char * delText, int nLen) override;\n    \n    void insertText(const char* text, int len);\n    void deleteBackward();\n    \n    void openIME();\n    void closeIME();\n    \n    void setMaxLengthEnabled(bool enable);\n    bool isMaxLengthEnabled();\n    void setMaxLength(int length);\n    int getMaxLength();\n    int getCharCount();\n    void setPasswordEnabled(bool enable);\n    bool isPasswordEnabled();\n    void setPasswordStyleText(const char* styleText);\n    void setPasswordText(const char* text);\n    void setAttachWithIME(bool attach);\n    bool getAttachWithIME();\n    void setDetachWithIME(bool detach);\n    bool getDetachWithIME();\n    void setInsertText(bool insert);\n    bool getInsertText();\n    void setDeleteBackward(bool deleteBackward);\n    bool getDeleteBackward();\nprotected:\n    bool _maxLengthEnabled;\n    int _maxLength;\n    bool _passwordEnabled;\n    std::string _passwordStyleText;\n    bool _attachWithIME;\n    bool _detachWithIME;\n    bool _insertText;\n    bool _deleteBackward;\n};\n\ntypedef enum\n{\n    TEXTFIELD_EVENT_ATTACH_WITH_IME,\n    TEXTFIELD_EVENT_DETACH_WITH_IME,\n    TEXTFIELD_EVENT_INSERT_TEXT,\n    TEXTFIELD_EVENT_DELETE_BACKWARD,\n}TextFiledEventType;\n\ntypedef void (Object::*SEL_TextFieldEvent)(Object*, TextFiledEventType);\n#define textfieldeventselector(_SELECTOR) (SEL_TextFieldEvent)(&_SELECTOR)\n\n/** class UITextField : public Widget\n*   @js NA\n*   @lua NA\n*/\nclass TextField : public Widget\n{\npublic:\n    TextField();\n    virtual ~TextField();\n    static TextField* create();\n    void setTouchSize(const Size &size);\n    void setText(const std::string& text);\n    void setPlaceHolder(const std::string& value);\n    void setFontSize(int size);\n    void setFontName(const std::string& name);\n    virtual void didNotSelectSelf();\n    const std::string& getStringValue();\n    virtual bool onTouchBegan(Touch *touch, Event *unusedEvent) override;\n    void setMaxLengthEnabled(bool enable);\n    bool isMaxLengthEnabled();\n    void setMaxLength(int length);\n    int getMaxLength();\n    void setPasswordEnabled(bool enable);\n    bool isPasswordEnabled();\n    void setPasswordStyleText(const char* styleText);\n    virtual void update(float dt) override;\n    bool getAttachWithIME();\n    void setAttachWithIME(bool attach);\n    bool getDetachWithIME();\n    void setDetachWithIME(bool detach);\n    bool getInsertText();\n    void setInsertText(bool insertText);\n    bool getDeleteBackward();\n    void setDeleteBackward(bool deleteBackward);\n    void addEventListenerTextField(Object* target, SEL_TextFieldEvent selecor);\n\n    virtual void setAnchorPoint(const Point &pt) override;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n\n    virtual const Size& getContentSize() const override;\n    virtual Node* getVirtualRenderer() override;\n    void attachWithIME();\n    virtual void onEnter() override;\nprotected:\n    // event\n    virtual void initRenderer() override;\n    void attachWithIMEEvent();\n    void detachWithIMEEvent();\n    void insertTextEvent();\n    void deleteBackwardEvent();\n    virtual void onSizeChanged() override;\n    void textfieldRendererScaleChangedWithSize();\n    virtual Widget* createCloneInstance() override;\n    virtual void copySpecialProperties(Widget* model) override;\nprotected:\n    UICCTextField* _textFieldRenderer;\n\n    float _touchWidth;\n    float _touchHeight;\n    bool _useTouchArea;\n    \n    Object* _textFieldEventListener;\n    SEL_TextFieldEvent _textFieldEventSelector;\n    \n    std::string _passwordStyleText;\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__TextField__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIWidget.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"gui/UIWidget.h\"\n#include \"gui/UILayout.h\"\n#include \"gui/UIHelper.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n    \nWidget::Widget():\n_enabled(true),\n_bright(true),\n_touchEnabled(false),\n_touchPassedEnabled(false),\n_focus(false),\n_brightStyle(BRIGHT_NONE),\n_touchStartPos(Point::ZERO),\n_touchMovePos(Point::ZERO),\n_touchEndPos(Point::ZERO),\n_touchEventListener(nullptr),\n_touchEventSelector(nullptr),\n_name(\"default\"),\n_widgetType(WidgetTypeWidget),\n_actionTag(0),\n_size(Size::ZERO),\n_customSize(Size::ZERO),\n_ignoreSize(false),\n_affectByClipping(false),\n_sizeType(SIZE_ABSOLUTE),\n_sizePercent(Point::ZERO),\n_positionType(POSITION_ABSOLUTE),\n_positionPercent(Point::ZERO),\n_reorderWidgetChildDirty(true),\n_hitted(false),\n_touchListener(nullptr)\n{\n    \n}\n\nWidget::~Widget()\n{\n    _touchEventListener = nullptr;\n    _touchEventSelector = nullptr;\n    _widgetChildren.clear();\n    setTouchEnabled(false);\n    _nodes.clear();\n}\n\nWidget* Widget::create()\n{\n    Widget* widget = new Widget();\n    if (widget && widget->init())\n    {\n        widget->autorelease();\n        return widget;\n    }\n    CC_SAFE_DELETE(widget);\n    return nullptr;\n}\n\nbool Widget::init()\n{\n    if (Node::init())\n    {\n        initRenderer();\n        setCascadeColorEnabled(true);\n        setCascadeOpacityEnabled(true);\n        setBright(true);\n        ignoreContentAdaptWithSize(true);\n        setAnchorPoint(Point(0.5f, 0.5f));\n        return true;\n    }\n    return false;\n}\n\nvoid Widget::onEnter()\n{\n    updateSizeAndPosition();\n    Node::onEnter();\n}\n\nvoid Widget::onExit()\n{\n    unscheduleUpdate();\n    Node::onExit();\n}\n    \nvoid Widget::visit()\n{\n    if (_enabled)\n    {\n        Node::visit();\n    }    \n}\n\nvoid Widget::addChild(Node *child)\n{\n    Node::addChild(child);\n}\n\nvoid Widget::addChild(Node * child, int zOrder)\n{\n    Node::addChild(child, zOrder);\n}\n    \nvoid Widget::addChild(Node* child, int zOrder, int tag)\n{\n    CCASSERT(dynamic_cast<Widget*>(child) != nullptr, \"Widget only supports Widgets as children\");\n    Node::addChild(child, zOrder, tag);\n    _widgetChildren.pushBack(child);\n}\n    \nvoid Widget::sortAllChildren()\n{\n    _reorderWidgetChildDirty = _reorderChildDirty;\n    Node::sortAllChildren();\n    if( _reorderWidgetChildDirty )\n    {\n        std::sort( std::begin(_widgetChildren), std::end(_widgetChildren), nodeComparisonLess );\n        _reorderWidgetChildDirty = false;\n    }\n}\n    \nNode* Widget::getChildByTag(int aTag)\n{\n    CCASSERT( aTag != Node::INVALID_TAG, \"Invalid tag\");\n    \n    for (auto& child : _widgetChildren)\n    {\n        if(child && child->getTag() == aTag)\n            return child;\n    }\n    return nullptr;\n}\n\nVector<Node*>& Widget::getChildren()\n{\n    return _widgetChildren;\n}\n    \nconst Vector<Node*>& Widget::getChildren() const\n{\n    return _widgetChildren;\n}\n    \nssize_t Widget::getChildrenCount() const\n{\n    return _widgetChildren.size();\n}\n\nWidget* Widget::getWidgetParent()\n{\n    return dynamic_cast<Widget*>(getParent());\n}\n    \nvoid Widget::removeFromParent()\n{\n    removeFromParentAndCleanup(true);\n}\n\nvoid Widget::removeFromParentAndCleanup(bool cleanup)\n{\n    Node::removeFromParentAndCleanup(cleanup);\n}\n\nvoid Widget::removeChild(Node *child, bool cleanup)\n{\n    Node::removeChild(child, cleanup);\n    _widgetChildren.eraseObject(child);\n}\n\nvoid Widget::removeChildByTag(int tag, bool cleanup)\n{\n    CCASSERT( tag != Node::INVALID_TAG, \"Invalid tag\");\n    \n    Node *child = getChildByTag(tag);\n    \n    if (child == nullptr)\n    {\n        CCLOG(\"cocos2d: removeChildByTag(tag = %d): child not found!\", tag);\n    }\n    else\n    {\n        removeChild(child, cleanup);\n    }\n}\n\nvoid Widget::removeAllChildren()\n{\n    removeAllChildrenWithCleanup(true);\n}\n    \nvoid Widget::removeAllChildrenWithCleanup(bool cleanup)\n{\n    for (auto& child : _widgetChildren)\n    {\n        if (child)\n        {\n            Node::removeChild(child);\n        }\n    }\n    _widgetChildren.clear();\n}\n\nvoid Widget::setEnabled(bool enabled)\n{\n    _enabled = enabled;\n    for (auto& child : _widgetChildren)\n    {\n        if (child)\n        {\n            static_cast<Widget*>(child)->setEnabled(enabled);\n        }\n    }\n}\n\nWidget* Widget::getChildByName(const char *name)\n{\n    for (auto& child : _widgetChildren)\n    {\n        if (child)\n        {\n            Widget* widgetChild = static_cast<Widget*>(child);\n            if (strcmp(widgetChild->getName(), name) == 0)\n            {\n                return widgetChild;\n            }\n        }\n    }\n    return nullptr;\n}\n    \nvoid Widget::addNode(Node* node)\n{\n    addNode(node, node->getLocalZOrder(), node->getTag());\n}\n\nvoid Widget::addNode(Node * node, int zOrder)\n{\n    addNode(node, zOrder, node->getTag());\n}\n\nvoid Widget::addNode(Node* node, int zOrder, int tag)\n{\n    CCAssert(dynamic_cast<Widget*>(node) == nullptr, \"Widget only supports Nodes as renderer\");\n    Node::addChild(node, zOrder, tag);\n    _nodes.pushBack(node);\n}\n\nNode* Widget::getNodeByTag(int tag)\n{\n    CCAssert( tag != Node::INVALID_TAG, \"Invalid tag\");\n    \n    for (auto& node : _nodes)\n    {\n        if(node && node->getTag() == tag)\n            return node;\n    }\n    return nullptr;\n}\n\nVector<Node*>& Widget::getNodes()\n{\n    return _nodes;\n}\n\nvoid Widget::removeNode(Node* node)\n{\n    Node::removeChild(node);\n    _nodes.eraseObject(node);\n}\n\nvoid Widget::removeNodeByTag(int tag)\n{\n    CCAssert( tag != Node::INVALID_TAG, \"Invalid tag\");\n    \n    Node *node = this->getNodeByTag(tag);\n    \n    if (node == nullptr)\n    {\n        CCLOG(\"cocos2d: removeNodeByTag(tag = %d): child not found!\", tag);\n    }\n    else\n    {\n        this->removeNode(node);\n    }\n}\n\nvoid Widget::removeAllNodes()\n{\n    for (auto& node : _nodes)\n    {\n        if (node)\n        {\n            Node::removeChild(node);\n        }\n    }\n    _nodes.clear();\n}\n\n\nvoid Widget::initRenderer()\n{\n}\n\nvoid Widget::setSize(const Size &size)\n{\n    _customSize = size;\n    if (_ignoreSize)\n    {\n        _size = getContentSize();\n    }\n    else\n    {\n        _size = size;\n    }\n    if (_running)\n    {\n        Widget* widgetParent = getWidgetParent();\n        Size pSize;\n        if (widgetParent)\n        {\n            pSize = widgetParent->getSize();\n        }\n        else\n        {\n            pSize = _parent->getContentSize();\n        }\n        float spx = 0.0f;\n        float spy = 0.0f;\n        if (pSize.width > 0.0f)\n        {\n            spx = _customSize.width / pSize.width;\n        }\n        if (pSize.height > 0.0f)\n        {\n            spy = _customSize.height / pSize.height;\n        }\n        _sizePercent = Point(spx, spy);\n    }\n    onSizeChanged();\n}\n\nvoid Widget::setSizePercent(const Point &percent)\n{\n    _sizePercent = percent;\n    Size cSize = _customSize;\n    if (_running)\n    {\n        Widget* widgetParent = getWidgetParent();\n        if (widgetParent)\n        {\n            cSize = Size(widgetParent->getSize().width * percent.x , widgetParent->getSize().height * percent.y);\n        }\n        else\n        {\n            cSize = Size(_parent->getContentSize().width * percent.x , _parent->getContentSize().height * percent.y);\n        }\n    }\n    if (_ignoreSize)\n    {\n        _size = getContentSize();\n    }\n    else\n    {\n        _size = cSize;\n    }\n    _customSize = cSize;\n    onSizeChanged();\n}\n\nvoid Widget::updateSizeAndPosition()\n{\n    switch (_sizeType)\n    {\n        case SIZE_ABSOLUTE:\n        {\n            if (_ignoreSize)\n            {\n                _size = getContentSize();\n            }\n            else\n            {\n                _size = _customSize;\n            }\n            Widget* widgetParent = getWidgetParent();\n            if (widgetParent)\n            {\n                Size pSize = widgetParent->getSize();\n                float spx = 0.0f;\n                float spy = 0.0f;\n                if (pSize.width > 0.0f)\n                {\n                    spx = _customSize.width / pSize.width;\n                }\n                if (pSize.height > 0.0f)\n                {\n                    spy = _customSize.height / pSize.height;\n                }\n                _sizePercent = Point(spx, spy);\n            }\n            else\n            {\n                Size pSize = _parent->getContentSize();\n                float spx = 0.0f;\n                float spy = 0.0f;\n                if (pSize.width > 0.0f)\n                {\n                    spx = _customSize.width / pSize.width;\n                }\n                if (pSize.height > 0.0f)\n                {\n                    spy = _customSize.height / pSize.height;\n                }\n                _sizePercent = Point(spx, spy);\n            }\n            break;\n        }\n        case SIZE_PERCENT:\n        {\n            Widget* widgetParent = getWidgetParent();\n            if (widgetParent)\n            {\n                Size cSize = Size(widgetParent->getSize().width * _sizePercent.x , widgetParent->getSize().height * _sizePercent.y);\n                if (_ignoreSize)\n                {\n                    _size = getContentSize();\n                }\n                else\n                {\n                    _size = cSize;\n                }\n                _customSize = cSize;\n            }\n            else\n            {\n                Size cSize = Size(_parent->getContentSize().width * _sizePercent.x , _parent->getContentSize().height * _sizePercent.y);\n                if (_ignoreSize)\n                {\n                    _size = getContentSize();\n                }\n                else\n                {\n                    _size = cSize;\n                }\n                _customSize = cSize;\n            }\n        }\n            break;\n        default:\n            break;\n    }\n    onSizeChanged();\n    Point absPos = getPosition();\n    switch (_positionType)\n    {\n        case POSITION_ABSOLUTE:\n        {\n            Widget* widgetParent = getWidgetParent();\n            if (widgetParent)\n            {\n                Size pSize = widgetParent->getSize();\n                if (pSize.width <= 0.0f || pSize.height <= 0.0f)\n                {\n                    _positionPercent = Point::ZERO;\n                }\n                else\n                {\n                    _positionPercent = Point(absPos.x / pSize.width, absPos.y / pSize.height);\n                }\n            }\n            else\n            {\n                Size pSize = _parent->getContentSize();\n                if (pSize.width <= 0.0f || pSize.height <= 0.0f)\n                {\n                    _positionPercent = Point::ZERO;\n                }\n                else\n                {\n                    _positionPercent = Point(absPos.x / pSize.width, absPos.y / pSize.height);\n                }\n            }\n            break;\n        }\n        case POSITION_PERCENT:\n        {\n            Widget* widgetParent = getWidgetParent();\n            if (widgetParent)\n            {\n                Size parentSize = widgetParent->getSize();\n                absPos = Point(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y);\n            }\n            else\n            {\n                Size parentSize = _parent->getContentSize();\n                absPos = Point(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y);\n            }\n            break;\n        }\n        default:\n            break;\n    }\n    setPosition(absPos);\n}\n\nvoid Widget::setSizeType(SizeType type)\n{\n    _sizeType = type;\n}\n\nSizeType Widget::getSizeType() const\n{\n    return _sizeType;\n}\n\nvoid Widget::ignoreContentAdaptWithSize(bool ignore)\n{\n    _ignoreSize = ignore;\n    if (_ignoreSize)\n    {\n        Size s = getContentSize();\n        _size = s;\n    }\n    else\n    {\n        _size = _customSize;\n    }\n    onSizeChanged();\n}\n\nbool Widget::isIgnoreContentAdaptWithSize() const\n{\n    return _ignoreSize;\n}\n\nconst Size& Widget::getSize() const\n{\n    return _size;\n}\n\nconst Point& Widget::getSizePercent() const\n{\n    return _sizePercent;\n}\n\nPoint Widget::getWorldPosition()\n{\n    return convertToWorldSpace(Point::ZERO);\n}\n\nNode* Widget::getVirtualRenderer()\n{\n    return this;\n}\n\nvoid Widget::onSizeChanged()\n{\n    for (auto& child : getChildren())\n    {\n        if (child)\n        {\n            static_cast<Widget*>(child)->updateSizeAndPosition();\n        }\n    }\n}\n\nconst Size& Widget::getContentSize() const\n{\n    return _size;\n}\n\nvoid Widget::setTouchEnabled(bool enable)\n{\n    if (enable == _touchEnabled)\n    {\n        return;\n    }\n    _touchEnabled = enable;\n    if (_touchEnabled)\n    {\n        _touchListener = EventListenerTouchOneByOne::create();\n        CC_SAFE_RETAIN(_touchListener);\n        _touchListener->setSwallowTouches(true);\n        _touchListener->onTouchBegan = CC_CALLBACK_2(Widget::onTouchBegan, this);\n        _touchListener->onTouchMoved = CC_CALLBACK_2(Widget::onTouchMoved, this);\n        _touchListener->onTouchEnded = CC_CALLBACK_2(Widget::onTouchEnded, this);\n        _touchListener->onTouchCancelled = CC_CALLBACK_2(Widget::onTouchCancelled, this);\n        _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this);\n    }\n    else\n    {\n        _eventDispatcher->removeEventListener(_touchListener);\n        CC_SAFE_RELEASE_NULL(_touchListener);\n    }\n}\n\nbool Widget::isTouchEnabled() const\n{\n    return _touchEnabled;\n}\n\nbool Widget::isFocused() const\n{\n    return _focus;\n}\n\nvoid Widget::setFocused(bool fucos)\n{\n    if (fucos == _focus)\n    {\n        return;\n    }\n    _focus = fucos;\n    if (_bright)\n    {\n        if (_focus)\n        {\n            setBrightStyle(BRIGHT_HIGHLIGHT);\n        }\n        else\n        {\n            setBrightStyle(BRIGHT_NORMAL);\n        }\n    }\n    else\n    {\n        onPressStateChangedToDisabled();\n    }\n}\n\nvoid Widget::setBright(bool bright)\n{\n    _bright = bright;\n    if (_bright)\n    {\n        _brightStyle = BRIGHT_NONE;\n        setBrightStyle(BRIGHT_NORMAL);\n    }\n    else\n    {\n        onPressStateChangedToDisabled();\n    }\n}\n\nvoid Widget::setBrightStyle(BrightStyle style)\n{\n    if (_brightStyle == style)\n    {\n        return;\n    }\n    _brightStyle = style;\n    switch (_brightStyle)\n    {\n        case BRIGHT_NORMAL:\n            onPressStateChangedToNormal();\n            break;\n        case BRIGHT_HIGHLIGHT:\n            onPressStateChangedToPressed();\n            break;\n        default:\n            break;\n    }\n}\n\nvoid Widget::onPressStateChangedToNormal()\n{\n    \n}\n\nvoid Widget::onPressStateChangedToPressed()\n{\n    \n}\n\nvoid Widget::onPressStateChangedToDisabled()\n{\n    \n}\n\nvoid Widget::didNotSelectSelf()\n{\n    \n}\n\nbool Widget::onTouchBegan(Touch *touch, Event *unusedEvent)\n{\n    _hitted = false;\n    if (isEnabled() && isTouchEnabled())\n    {\n        _touchStartPos = touch->getLocation();\n        if(hitTest(_touchStartPos) && clippingParentAreaContainPoint(_touchStartPos))\n        {\n            _hitted = true;\n        }\n    }\n    if (!_hitted)\n    {\n        return false;\n    }\n    setFocused(true);\n    Widget* widgetParent = getWidgetParent();\n    if (widgetParent)\n    {\n        widgetParent->checkChildInfo(0,this,_touchStartPos);\n    }\n    pushDownEvent();\n    return !_touchPassedEnabled;\n}\n\nvoid Widget::onTouchMoved(Touch *touch, Event *unusedEvent)\n{\n    _touchMovePos = touch->getLocation();\n    setFocused(hitTest(_touchMovePos));\n    Widget* widgetParent = getWidgetParent();\n    if (widgetParent)\n    {\n        widgetParent->checkChildInfo(1,this,_touchMovePos);\n    }\n    moveEvent();\n}\n\nvoid Widget::onTouchEnded(Touch *touch, Event *unusedEvent)\n{\n    _touchEndPos = touch->getLocation();\n    bool focus = _focus;\n    setFocused(false);\n    Widget* widgetParent = getWidgetParent();\n    if (widgetParent)\n    {\n        widgetParent->checkChildInfo(2,this,_touchEndPos);\n    }\n    if (focus)\n    {\n        releaseUpEvent();\n    }\n    else\n    {\n        cancelUpEvent();\n    }\n}\n\nvoid Widget::onTouchCancelled(Touch *touch, Event *unusedEvent)\n{\n    setFocused(false);\n    cancelUpEvent();\n}\n\nvoid Widget::pushDownEvent()\n{\n    if (_touchEventListener && _touchEventSelector)\n    {\n        (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_BEGAN);\n    }\n}\n\nvoid Widget::moveEvent()\n{\n    if (_touchEventListener && _touchEventSelector)\n    {\n        (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_MOVED);\n    }\n}\n\nvoid Widget::releaseUpEvent()\n{\n    if (_touchEventListener && _touchEventSelector)\n    {\n        (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_ENDED);\n    }\n}\n\nvoid Widget::cancelUpEvent()\n{\n    if (_touchEventListener && _touchEventSelector)\n    {\n        (_touchEventListener->*_touchEventSelector)(this,TOUCH_EVENT_CANCELED);\n    }\n}\n\nvoid Widget::addTouchEventListener(Object *target, SEL_TouchEvent selector)\n{\n    _touchEventListener = target;\n    _touchEventSelector = selector;\n}\n\nbool Widget::hitTest(const Point &pt)\n{\n    Point nsp = convertToNodeSpace(pt);\n    Rect bb = Rect(-_size.width * _anchorPoint.x, -_size.height * _anchorPoint.y, _size.width, _size.height);\n    if (nsp.x >= bb.origin.x && nsp.x <= bb.origin.x + bb.size.width && nsp.y >= bb.origin.y && nsp.y <= bb.origin.y + bb.size.height)\n    {\n        return true;\n    }\n    return false;\n}\n\nbool Widget::clippingParentAreaContainPoint(const Point &pt)\n{\n    _affectByClipping = false;\n    Widget* parent = getWidgetParent();\n    Widget* clippingParent = nullptr;\n    while (parent)\n    {\n        Layout* layoutParent = dynamic_cast<Layout*>(parent);\n        if (layoutParent)\n        {\n            if (layoutParent->isClippingEnabled())\n            {\n                _affectByClipping = true;\n                clippingParent = layoutParent;\n                break;\n            }\n        }\n        parent = parent->getWidgetParent();\n    }\n    \n    if (!_affectByClipping)\n    {\n        return true;\n    }\n    \n    \n    if (clippingParent)\n    {\n        bool bRet = false;\n        if (clippingParent->hitTest(pt))\n        {\n            bRet = true;\n        }\n        if (bRet)\n        {\n            return clippingParent->clippingParentAreaContainPoint(pt);\n        }\n        return false;\n    }\n    return true;\n}\n\nvoid Widget::checkChildInfo(int handleState, Widget *sender, const Point &touchPoint)\n{\n    Widget* widgetParent = getWidgetParent();\n    if (widgetParent)\n    {\n        widgetParent->checkChildInfo(handleState,sender,touchPoint);\n    }\n}\n\nvoid Widget::setPosition(const Point &pos)\n{\n    if (_running)\n    {\n        Widget* widgetParent = getWidgetParent();\n        if (widgetParent)\n        {\n            Size pSize = widgetParent->getSize();\n            if (pSize.width <= 0.0f || pSize.height <= 0.0f)\n            {\n                _positionPercent = Point::ZERO;\n            }\n            else\n            {\n                _positionPercent = Point(pos.x / pSize.width, pos.y / pSize.height);\n            }\n        }\n    }\n    Node::setPosition(pos);\n}\n\nvoid Widget::setPositionPercent(const Point &percent)\n{\n    _positionPercent = percent;\n    if (_running)\n    {\n        Widget* widgetParent = getWidgetParent();\n        if (widgetParent)\n        {\n            Size parentSize = widgetParent->getSize();\n            Point absPos = Point(parentSize.width * _positionPercent.x, parentSize.height * _positionPercent.y);\n            setPosition(absPos);\n        }\n    }\n}\n\nvoid Widget::updateAnchorPoint()\n{\n    setAnchorPoint(getAnchorPoint());\n}\n\nconst Point& Widget::getPositionPercent()\n{\n    return _positionPercent;\n}\n\nvoid Widget::setPositionType(PositionType type)\n{\n    _positionType = type;\n}\n\nPositionType Widget::getPositionType() const\n{\n    return _positionType;\n}\n\nbool Widget::isBright() const\n{\n    return _bright;\n}\n\nbool Widget::isEnabled() const\n{\n    return _enabled;\n}\n\nfloat Widget::getLeftInParent()\n{\n    return getPosition().x - getAnchorPoint().x * _size.width;;\n}\n\nfloat Widget::getBottomInParent()\n{\n    return getPosition().y - getAnchorPoint().y * _size.height;;\n}\n\nfloat Widget::getRightInParent()\n{\n    return getLeftInParent() + _size.width;\n}\n\nfloat Widget::getTopInParent()\n{\n    return getBottomInParent() + _size.height;\n}\n\nconst Point& Widget::getTouchStartPos()\n{\n    return _touchStartPos;\n}\n\nconst Point& Widget::getTouchMovePos()\n{\n    return _touchMovePos;\n}\n\nconst Point& Widget::getTouchEndPos()\n{\n    return _touchEndPos;\n}\n\nvoid Widget::setName(const char* name)\n{\n    _name = name;\n}\n\nconst char* Widget::getName() const\n{\n    return _name.c_str();\n}\n\nWidgetType Widget::getWidgetType() const\n{\n    return _widgetType;\n}\n\nvoid Widget::setLayoutParameter(LayoutParameter *parameter)\n{\n    if (!parameter)\n    {\n        return;\n    }\n    _layoutParameterDictionary.insert(parameter->getLayoutType(), parameter);\n}\n\nLayoutParameter* Widget::getLayoutParameter(LayoutParameterType type)\n{\n    return dynamic_cast<LayoutParameter*>(_layoutParameterDictionary.at(type));\n}\n\nstd::string Widget::getDescription() const\n{\n    return \"Widget\";\n}\n\nWidget* Widget::clone()\n{\n    Widget* clonedWidget = createCloneInstance();\n    clonedWidget->copyProperties(this);\n    clonedWidget->copyClonedWidgetChildren(this);\n    return clonedWidget;\n}\n\nWidget* Widget::createCloneInstance()\n{\n    return Widget::create();\n}\n\nvoid Widget::copyClonedWidgetChildren(Widget* model)\n{\n    auto& modelChildren = model->getChildren();\n    \n    for (auto& subWidget : modelChildren)\n    {\n        Widget* child = static_cast<Widget*>(subWidget);\n        addChild(child->clone());\n    }\n}\n\nvoid Widget::copySpecialProperties(Widget* model)\n{\n    \n}\n\nvoid Widget::copyProperties(Widget *widget)\n{\n    setEnabled(widget->isEnabled());\n    setVisible(widget->isVisible());\n    setBright(widget->isBright());\n    setTouchEnabled(widget->isTouchEnabled());\n    _touchPassedEnabled = false;\n    setLocalZOrder(widget->getLocalZOrder());\n    setTag(widget->getTag());\n    setName(widget->getName());\n    setActionTag(widget->getActionTag());\n    _ignoreSize = widget->_ignoreSize;\n    _size = widget->_size;\n    _customSize = widget->_customSize;\n    copySpecialProperties(widget);\n    _sizeType = widget->getSizeType();\n    _sizePercent = widget->_sizePercent;\n    _positionType = widget->_positionType;\n    _positionPercent = widget->_positionPercent;\n    setPosition(widget->getPosition());\n    setAnchorPoint(widget->getAnchorPoint());\n    setScaleX(widget->getScaleX());\n    setScaleY(widget->getScaleY());\n    setRotation(widget->getRotation());\n    setRotationX(widget->getRotationX());\n    setRotationY(widget->getRotationY());\n    setFlipX(widget->isFlipX());\n    setFlipY(widget->isFlipY());\n    setColor(widget->getColor());\n    setOpacity(widget->getOpacity());\n    setCascadeOpacityEnabled(widget->isCascadeOpacityEnabled());\n    setCascadeColorEnabled(widget->isCascadeColorEnabled());\n    onSizeChanged();\n}\n\n/*temp action*/\nvoid Widget::setActionTag(int tag)\n{\n\t_actionTag = tag;\n}\n\nint Widget::getActionTag()\n{\n\treturn _actionTag;\n}\n    \n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/gui/UIWidget.h",
    "content": "/****************************************************************************\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __UIWIDGET_H__\n#define __UIWIDGET_H__\n\n#include \"cocos2d.h\"\n#include \"gui/UILayoutDefine.h\"\n#include \"gui/UILayoutParameter.h\"\n\nNS_CC_BEGIN\n\nnamespace gui {\n\ntypedef enum\n{\n    BRIGHT_NONE = -1,\n    BRIGHT_NORMAL,\n    BRIGHT_HIGHLIGHT\n}BrightStyle;\n\ntypedef enum\n{\n    WidgetTypeWidget, //control\n    WidgetTypeContainer //container\n}WidgetType;\n\ntypedef enum\n{\n    UI_TEX_TYPE_LOCAL,\n    UI_TEX_TYPE_PLIST\n}TextureResType;\n\ntypedef enum\n{\n    TOUCH_EVENT_BEGAN,\n    TOUCH_EVENT_MOVED,\n    TOUCH_EVENT_ENDED,\n    TOUCH_EVENT_CANCELED\n}TouchEventType;\n\ntypedef enum\n{\n    SIZE_ABSOLUTE,\n    SIZE_PERCENT\n}SizeType;\n\ntypedef enum\n{\n    POSITION_ABSOLUTE,\n    POSITION_PERCENT\n}PositionType;\n\ntypedef void (Object::*SEL_TouchEvent)(Object*,TouchEventType);\n#define toucheventselector(_SELECTOR) (SEL_TouchEvent)(&_SELECTOR)\n/**\n*   @js NA\n*   @lua NA\n*/\nclass Widget : public Node\n{\npublic:    \n    /**\n     * Default constructor\n     */\n    Widget(void);\n    \n    /**\n     * Default destructor\n     */\n    virtual ~Widget();\n    \n    /**\n     * Allocates and initializes a widget.\n     */\n    static Widget* create();\n    \n    /**\n     * Sets whether the widget is enabled\n     *\n     * Highest control of widget.\n     * The default value is true, a widget is default to enabled\n     *\n     * @param enabled   true if the widget is enabled, widget may be touched and visible, false if the widget is disabled, widget cannot be touched and hidden.\n     */\n    virtual void setEnabled(bool enabled);\n    \n    /**\n     * Determines if the widget is enabled\n     *\n     * @return true if the widget is enabled, false if the widget is disabled.\n     */\n    bool isEnabled() const;\n    \n    /**\n     * Sets whether the widget is bright\n     *\n     * The default value is true, a widget is default to bright\n     *\n     * @param visible   true if the widget is bright, false if the widget is dark.\n     */\n    void setBright(bool bright);\n    \n    /**\n     * Determines if the widget is bright\n     *\n     * @return true if the widget is bright, false if the widget is dark.\n     */\n    bool isBright() const;\n    \n    /**\n     * Sets whether the widget is touch enabled\n     *\n     * The default value is false, a widget is default to touch disabled\n     *\n     * @param visible   true if the widget is touch enabled, false if the widget is touch disabled.\n     */\n    virtual void setTouchEnabled(bool enabled);\n    \n    /**\n     * To set the bright style of widget.\n     *\n     * @see BrightStyle\n     *\n     * @param style   BRIGHT_NORMAL the widget is normal state, BRIGHT_HIGHLIGHT the widget is height light state.\n     */\n    void setBrightStyle(BrightStyle style);\n    \n    /**\n     * Determines if the widget is touch enabled\n     *\n     * @return true if the widget is touch enabled, false if the widget is touch disabled.\n     */\n    bool isTouchEnabled() const;\n    \n    /**\n     * Determines if the widget is on focused\n     *\n     * @return true if the widget is on focused, false if the widget is not on focused.\n     */\n    bool isFocused() const;\n\n    /**\n     * Sets whether the widget is on focused\n     *\n     * The default value is false, a widget is default to not on focused\n     *\n     * @param fucosed   true if the widget is on focused, false if the widget is not on focused.\n     */\n    void setFocused(bool fucosed);\n    \n    /**\n     * Gets the left boundary position of this widget.\n     *\n     * @return The left boundary position of this widget.\n     */\n    float getLeftInParent();\n    \n    /**\n     * Gets the bottom boundary position of this widget.\n     *\n     * @return The bottom boundary position of this widget.\n     */\n    float getBottomInParent();\n    \n    /**\n     * Gets the right boundary position of this widget.\n     *\n     * @return The right boundary position of this widget.\n     */\n    float getRightInParent();\n    \n    /**\n     * Gets the top boundary position of this widget.\n     *\n     * @return The top boundary position of this widget.\n     */\n    float getTopInParent();\n\n    /**\n     * Adds a child to the container with z-order as 0.\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child A child node\n     */\n    virtual void addChild(Node * child) override;\n    /**\n     * Adds a child to the container with a z-order\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to setLocalZOrder(int)\n     */\n    virtual void addChild(Node * child, int zOrder) override;\n    /**\n     * Adds a child to the container with z order and tag\n     *\n     * If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.\n     *\n     * @param child     A child node\n     * @param zOrder    Z order for drawing priority. Please refer to setLocalZOrder(int)\n     * @param tag       A interger to identify the node easily. Please refer to setTag(int)\n     */\n    virtual void addChild(Node* child, int zOrder, int tag) override;\n    /**\n     * Gets a child from the container with its tag\n     *\n     * @param tag   An identifier to find the child node.\n     *\n     * @return a Node object whose tag equals to the input parameter\n     */\n    virtual Node * getChildByTag(int tag) override;\n    \n    virtual void sortAllChildren() override;\n    /**\n     * Return an array of children\n     *\n     * Composing a \"tree\" structure is a very important feature of Node\n     * Here's a sample code of traversing children array:\n     @code\n     Node* node = NULL;\n     CCARRAY_FOREACH(parent->getChildren(), node)\n     {\n     node->setPosition(0,0);\n     }\n     @endcode\n     * This sample code traverses all children nodes, and set their position to (0,0)\n     *\n     * @return An array of children\n     */\n    virtual Vector<Node*>& getChildren() override;\n    virtual const Vector<Node*>& getChildren() const override;\n    \n    /**\n     * Get the amount of children.\n     *\n     * @return The amount of children.\n     */\n    virtual ssize_t getChildrenCount() const override;\n    \n    /**\n     * Removes this node itself from its parent node with a cleanup.\n     * If the node orphan, then nothing happens.\n     * @see `removeFromParentAndCleanup(bool)`\n     */\n    virtual void removeFromParent() override;\n    /**\n     * Removes this node itself from its parent node.\n     * If the node orphan, then nothing happens.\n     * @param cleanup   true if all actions and callbacks on this node should be removed, false otherwise.\n     * @js removeFromParent\n     * @lua removeFromParent\n     */\n    virtual void removeFromParentAndCleanup(bool cleanup) override;\n    \n    /**\n     * Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter.\n     *\n     * @param child     The child node which will be removed.\n     * @param cleanup   true if all running actions and callbacks on the child node will be cleanup, false otherwise.\n     */\n    virtual void removeChild(Node* child, bool cleanup = true) override;\n    \n    /**\n     * Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter\n     *\n     * @param tag       An interger number that identifies a child node\n     * @param cleanup   true if all running actions and callbacks on the child node will be cleanup, false otherwise.\n     */\n    virtual void removeChildByTag(int tag, bool cleanup = true) override;\n    /**\n     * Removes all children from the container with a cleanup.\n     *\n     * @see `removeAllChildrenWithCleanup(bool)`\n     */\n    virtual void removeAllChildren() override;\n    /**\n     * Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.\n     *\n     * @param cleanup   true if all running actions on all children nodes should be cleanup, false oterwise.\n     * @js removeAllChildren\n     * @lua removeAllChildren\n     */\n    virtual void removeAllChildrenWithCleanup(bool cleanup) override;\n    \n    /**\n     * Gets a child from the container with its name\n     *\n     * @param name   An key to find the child widget.\n     *\n     * @return a Widget object whose name equals to the input parameter\n     */\n    virtual Widget* getChildByName(const char* name);\n    \n    virtual void addNode(Node* node);\n    \n    virtual void addNode(Node * node, int zOrder);\n    \n    virtual void addNode(Node* node, int zOrder, int tag);\n    \n    virtual Node * getNodeByTag(int tag);\n    \n    virtual Vector<Node*>& getNodes();\n    \n    virtual void removeNode(Node* node);\n    \n    virtual void removeNodeByTag(int tag);\n    \n    virtual void removeAllNodes();\n    \n    virtual void visit() override;\n    \n    /**\n     * Sets the touch event target/selector of the menu item\n     */\n    void addTouchEventListener(Object* target,SEL_TouchEvent selector);\n    \n    \n    //cocos2d property\n    \n    /**\n     * Changes the position (x,y) of the widget in OpenGL coordinates\n     *\n     * Usually we use p(x,y) to compose Point object.\n     * The original point (0,0) is at the left-bottom corner of screen.\n     *\n     * @param position  The position (x,y) of the widget in OpenGL coordinates\n     */\n    virtual void setPosition(const Point &pos) override;\n    \n    /**\n     * Changes the position (x,y) of the widget in OpenGL coordinates\n     *\n     * Usually we use p(x,y) to compose Point object.\n     * The original point (0,0) is at the left-bottom corner of screen.\n     *\n     * @param percent  The percent (x,y) of the widget in OpenGL coordinates\n     */\n    void setPositionPercent(const Point &percent);\n        \n    /**\n     * Gets the percent (x,y) of the widget in OpenGL coordinates\n     *\n     * @see setPosition(const Point&)\n     *\n     * @return The percent (x,y) of the widget in OpenGL coordinates\n     */\n    const Point& getPositionPercent();\n    \n    /**\n     * Changes the position type of the widget\n     *\n     * @see PositionType\n     *\n     * @param type  the position type of widget\n     */\n    void setPositionType(PositionType type);\n\n    /**\n     * Gets the position type of the widget\n     *\n     * @see PositionType\n     *\n     * @return type  the position type of widget\n     */\n    PositionType getPositionType() const;\n    \n    /**\n     * Sets whether the widget should be flipped horizontally or not.\n     *\n     * @param bFlipX true if the widget should be flipped horizaontally, false otherwise.\n     */\n    virtual void setFlipX(bool flipX){};\n    \n    /**\n     * Returns the flag which indicates whether the widget is flipped horizontally or not.\n     *\n     * It only flips the texture of the widget, and not the texture of the widget's children.\n     * Also, flipping the texture doesn't alter the anchorPoint.\n     * If you want to flip the anchorPoint too, and/or to flip the children too use:\n     * widget->setScaleX(sprite->getScaleX() * -1);\n     *\n     * @return true if the widget is flipped horizaontally, false otherwise.\n     */\n    virtual bool isFlipX(){return false;};\n    \n    /**\n     * Sets whether the widget should be flipped vertically or not.\n     *\n     * @param bFlipY true if the widget should be flipped vertically, flase otherwise.\n     */\n    virtual void setFlipY(bool flipY){};\n    \n    /**\n     * Return the flag which indicates whether the widget is flipped vertically or not.\n     *\n     * It only flips the texture of the widget, and not the texture of the widget's children.\n     * Also, flipping the texture doesn't alter the anchorPoint.\n     * If you want to flip the anchorPoint too, and/or to flip the children too use:\n     * widget->setScaleY(widget->getScaleY() * -1);\n     *\n     * @return true if the widget is flipped vertically, flase otherwise.\n     */\n    virtual bool isFlipY(){return false;};\n    \n    /**\n     * A call back function when widget lost of focus.\n     */\n    void didNotSelectSelf();\n    \n    /*\n     * Checks a point if in parent's area.\n     *\n     * @param point\n     *\n     * @return true if the point is in parent's area, flase otherwise.\n     */\n    bool clippingParentAreaContainPoint(const Point &pt);\n    \n    /*\n     * Sends the touch event to widget's parent\n     */\n    virtual void checkChildInfo(int handleState,Widget* sender,const Point &touchPoint);\n    \n    /*\n     * Gets the touch began point of widget when widget is selected.\n     *\n     * @return the touch began point.\n     */\n    const Point& getTouchStartPos();\n    \n    /*\n     * Gets the touch move point of widget when widget is selected.\n     *\n     * @return the touch move point.\n     */\n    const Point& getTouchMovePos();\n    \n    /*\n     * Gets the touch end point of widget when widget is selected.\n     *\n     * @return the touch end point.\n     */\n    const Point& getTouchEndPos();\n    \n    /**\n     * Changes the name that is used to identify the widget easily.\n     *\n     * @param A const char* that indentifies the widget.\n     */\n    void setName(const char* name);\n    \n    /**\n     * Returns a name that is used to identify the widget easily.\n     *\n     * You can set tags to widget then identify them easily.\n     *\n     * @return A const char* that identifies the widget.\n     */\n    const char* getName() const;\n    \n    /**\n     * Returns a type that is widget's type\n     *\n     * @see WidgetType\n     *\n     * @return A WidgetType\n     */\n    WidgetType getWidgetType() const;\n    \n    /**\n     * Changes the size that is widget's size\n     *\n     * @param size that is widget's size\n     */\n    virtual void setSize(const Size &size);\n    \n    /**\n     * Changes the percent that is widget's percent size\n     *\n     * @param percent that is widget's percent size\n     */\n    virtual void setSizePercent(const Point &percent);\n    \n    /**\n     * Changes the size type of widget.\n     *\n     * @see SizeType\n     *\n     * @param type that is widget's size type\n     */\n    void setSizeType(SizeType type);\n\n    /**\n     * Gets the size type of widget.\n     *\n     * @see SizeType\n     *\n     * @param type that is widget's size type\n     */\n    SizeType getSizeType() const;\n    \n    /**\n     * Returns size of widget\n     *\n     * @return size\n     */\n    const Size& getSize() const;\n    \n    /**\n     * Returns size percent of widget\n     *\n     * @return size percent\n     */\n    const Point& getSizePercent() const;\n    \n    /**\n     * Checks a point if is in widget's space\n     *\n     * @param point\n     *\n     * @return true if the point is in widget's space, flase otherwise.\n     */\n    virtual bool hitTest(const Point &pt);\n    \n    virtual bool onTouchBegan(Touch *touch, Event *unusedEvent);\n    virtual void onTouchMoved(Touch *touch, Event *unusedEvent);\n    virtual void onTouchEnded(Touch *touch, Event *unusedEvent);\n    virtual void onTouchCancelled(Touch *touch, Event *unusedEvent);\n        \n    /**\n     * Sets a LayoutParameter to widget. \n     *\n     * @see LayoutParameter\n     *\n     * @param LayoutParameter pointer\n     *\n     * @param type  Relative or Linear\n     */\n    void setLayoutParameter(LayoutParameter* parameter);\n    \n    /**\n     * Gets LayoutParameter of widget.\n     *\n     * @see LayoutParameter\n     *\n     * @param type  Relative or Linear\n     *\n     * @return LayoutParameter\n     */\n    LayoutParameter* getLayoutParameter(LayoutParameterType type);\n    \n    /**\n     * Ignore the widget size\n     *\n     * @param ignore, true that widget will ignore it's size, use texture size, false otherwise. Default value is true.\n     */\n    virtual void ignoreContentAdaptWithSize(bool ignore);\n    \n    /**\n     * Gets the widget if is ignore it's size.\n     *\n     * @param ignore, true that widget will ignore it's size, use texture size, false otherwise. Default value is true.\n     */\n    bool isIgnoreContentAdaptWithSize() const;\n    \n    /**\n     * Gets world position of widget.\n     *\n     * @return world position of widget.\n     */\n    Point getWorldPosition();\n\n    /**\n     * Gets the Virtual Renderer of widget.\n     *\n     * For example, a button's Virtual Renderer is it's texture renderer.\n     *\n     * @return Node pointer.\n     */\n    virtual Node* getVirtualRenderer();\n    \n    /**\n     * Gets the content size of widget.\n     *\n     * Content size is widget's texture size.\n     */\n    virtual const Size& getContentSize() const;\n    \n    /**\n     * Returns the \"class name\" of widget.\n     */\n    virtual std::string getDescription() const override;\n    \n    Widget* clone();\n\n    virtual void onEnter() override;\n    virtual void onExit() override;\n    \n    void updateSizeAndPosition();\n    \n    /*temp action*/\n    void setActionTag(int tag);\n\tint getActionTag();\nprotected:\n    //call back function called when size changed.\n    virtual void onSizeChanged();\n    \n    //initializes state of widget.\n    virtual bool init();\n    \n    //initializes renderer of widget.\n    virtual void initRenderer();\n    \n    //call back function called widget's state changed to normal.\n    virtual void onPressStateChangedToNormal();\n    \n    //call back function called widget's state changed to selected.\n    virtual void onPressStateChangedToPressed();\n    \n    //call back function called widget's state changed to dark.\n    virtual void onPressStateChangedToDisabled();\n    void pushDownEvent();\n    void moveEvent();\n    void releaseUpEvent();\n    void cancelUpEvent();\n    void updateAnchorPoint();\n    void copyProperties(Widget* model);\n    virtual Widget* createCloneInstance();\n    virtual void copySpecialProperties(Widget* model);\n    virtual void copyClonedWidgetChildren(Widget* model);\n    Widget* getWidgetParent();\nprotected:\n    bool _enabled;            ///< Highest control of widget\n    bool _bright;             ///< is this widget bright\n    bool _touchEnabled;       ///< is this widget touch endabled\n    bool _touchPassedEnabled; ///< is the touch event should be passed\n    bool _focus;              ///< is the widget on focus\n    BrightStyle _brightStyle; ///< bright style\n    Point _touchStartPos;    ///< touch began point\n    Point _touchMovePos;     ///< touch moved point\n    Point _touchEndPos;      ///< touch ended point\n    Object*       _touchEventListener;\n    SEL_TouchEvent    _touchEventSelector;\n    std::string _name;\n    WidgetType _widgetType;\n\tint _actionTag;\n    Size _size;\n    Size _customSize;\n    bool _ignoreSize;\n    bool _affectByClipping;\n    SizeType _sizeType;\n    Point _sizePercent;\n    PositionType _positionType;\n    Point _positionPercent;\n    bool _reorderWidgetChildDirty;\n    bool _hitted;\n    EventListenerTouchOneByOne* _touchListener;\n    Map<int, LayoutParameter*> _layoutParameterDictionary;\n    Vector<Node*> _widgetChildren;\n    Vector<Node*> _nodes;\n};\n}\n\nNS_CC_END\n\n#endif /* defined(__Widget__) */\n"
  },
  {
    "path": "cocos2d/cocos/gui/proj.win32/libGUI.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\CocosGUI.h\" />\n    <ClInclude Include=\"..\\UIButton.h\" />\n    <ClInclude Include=\"..\\UICheckBox.h\" />\n    <ClInclude Include=\"..\\UIHelper.h\" />\n    <ClInclude Include=\"..\\UIImageView.h\" />\n    <ClInclude Include=\"..\\UILayout.h\" />\n    <ClInclude Include=\"..\\UILayoutDefine.h\" />\n    <ClInclude Include=\"..\\UILayoutParameter.h\" />\n    <ClInclude Include=\"..\\UIListView.h\" />\n    <ClInclude Include=\"..\\UILoadingBar.h\" />\n    <ClInclude Include=\"..\\UIPageView.h\" />\n    <ClInclude Include=\"..\\UIScrollInterface.h\" />\n    <ClInclude Include=\"..\\UIScrollView.h\" />\n    <ClInclude Include=\"..\\UISlider.h\" />\n    <ClInclude Include=\"..\\UIText.h\" />\n    <ClInclude Include=\"..\\UITextAtlas.h\" />\n    <ClInclude Include=\"..\\UITextBMFont.h\" />\n    <ClInclude Include=\"..\\UITextField.h\" />\n    <ClInclude Include=\"..\\UIWidget.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\CocosGUI.cpp\" />\n    <ClCompile Include=\"..\\UIButton.cpp\" />\n    <ClCompile Include=\"..\\UICheckBox.cpp\" />\n    <ClCompile Include=\"..\\UIHelper.cpp\" />\n    <ClCompile Include=\"..\\UIImageView.cpp\" />\n    <ClCompile Include=\"..\\UILayout.cpp\" />\n    <ClCompile Include=\"..\\UILayoutDefine.cpp\" />\n    <ClCompile Include=\"..\\UILayoutParameter.cpp\" />\n    <ClCompile Include=\"..\\UIListView.cpp\" />\n    <ClCompile Include=\"..\\UILoadingBar.cpp\" />\n    <ClCompile Include=\"..\\UIPageView.cpp\" />\n    <ClCompile Include=\"..\\UIScrollView.cpp\" />\n    <ClCompile Include=\"..\\UISlider.cpp\" />\n    <ClCompile Include=\"..\\UIText.cpp\" />\n    <ClCompile Include=\"..\\UITextAtlas.cpp\" />\n    <ClCompile Include=\"..\\UITextBMFont.cpp\" />\n    <ClCompile Include=\"..\\UITextField.cpp\" />\n    <ClCompile Include=\"..\\UIWidget.cpp\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{7E06E92C-537A-442B-9E4A-4761C84F8A1A}</ProjectGuid>\n    <RootNamespace>libGUI</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>\n      </SDLCheck>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\editor-support;$(EngineRoot)external;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MinimalRebuild>false</MinimalRebuild>\n      <DebugInformationFormat>OldStyle</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>\n      </SDLCheck>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\editor-support;$(EngineRoot)external;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/gui/proj.win32/libGUI.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"BaseClasses\">\n      <UniqueIdentifier>{e31ab7d3-b8b2-467f-9e08-fd5fe168b491}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Layouts\">\n      <UniqueIdentifier>{f9d13563-9e5e-4b35-b0e7-d41f587efa42}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"System\">\n      <UniqueIdentifier>{ed8a2ae0-5690-4d0d-829b-7c07164c0597}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"UIWidgets\">\n      <UniqueIdentifier>{5f6e9e52-fbe7-4073-ac71-98632f9e6781}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"UIWidgets\\ScrollWidget\">\n      <UniqueIdentifier>{b59b178a-b7e0-4826-ba07-44c46cd29a10}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\UIScrollInterface.h\">\n      <Filter>UIWidgets\\ScrollWidget</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIScrollView.h\">\n      <Filter>UIWidgets\\ScrollWidget</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIListView.h\">\n      <Filter>UIWidgets\\ScrollWidget</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIPageView.h\">\n      <Filter>UIWidgets\\ScrollWidget</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIButton.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UICheckBox.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIImageView.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UISlider.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UITextField.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UILoadingBar.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIHelper.h\">\n      <Filter>System</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\CocosGUI.h\">\n      <Filter>System</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UILayoutDefine.h\">\n      <Filter>Layouts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIWidget.h\">\n      <Filter>BaseClasses</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UILayout.h\">\n      <Filter>Layouts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UILayoutParameter.h\">\n      <Filter>Layouts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UITextBMFont.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UIText.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\UITextAtlas.h\">\n      <Filter>UIWidgets</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\UIScrollView.cpp\">\n      <Filter>UIWidgets\\ScrollWidget</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UIListView.cpp\">\n      <Filter>UIWidgets\\ScrollWidget</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UIPageView.cpp\">\n      <Filter>UIWidgets\\ScrollWidget</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UIButton.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UICheckBox.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UIImageView.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UISlider.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UITextField.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UILoadingBar.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UIHelper.cpp\">\n      <Filter>System</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\CocosGUI.cpp\">\n      <Filter>System</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UILayoutDefine.cpp\">\n      <Filter>Layouts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UIWidget.cpp\">\n      <Filter>BaseClasses</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UILayout.cpp\">\n      <Filter>Layouts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UILayoutParameter.cpp\">\n      <Filter>Layouts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UITextBMFont.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UIText.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\UITextAtlas.cpp\">\n      <Filter>UIWidgets</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/CMakeLists.txt",
    "content": "\nSET(KAZMATH_SOURCES\n  mat4.c\n  mat3.c\n  plane.c\n  vec4.c\n  quaternion.c\n  vec2.c\n  vec3.c\n  utility.c\n  aabb.c\n  ray2.c\n  GL/mat4stack.c\n  GL/matrix.c\n  )\n\nADD_SUBDIRECTORY(src)\n\nset_target_properties(kazmath\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/GL/mat4stack.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef C_STACK_H_INCLUDED\n#define C_STACK_H_INCLUDED\n\n#include \"../mat4.h\"\n\ntypedef struct km_mat4_stack {\n    int capacity; //The total item capacity\n    int item_count; //The number of items\n    kmMat4* top;\n    kmMat4* stack;\n} km_mat4_stack;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid km_mat4_stack_initialize(km_mat4_stack* stack);\nvoid km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item);\nvoid km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut);\nvoid km_mat4_stack_release(km_mat4_stack* stack);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // C_STACK_H_INCLUDED\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/GL/matrix.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef KM_GL_MATRIX_H_INCLUDED\n#define KM_GL_MATRIX_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n\n#define KM_GL_MODELVIEW 0x1700\n#define KM_GL_PROJECTION 0x1701\n#define KM_GL_TEXTURE 0x1702\n\ntypedef unsigned int kmGLEnum;\n\n#include \"../mat4.h\"\n#include \"../vec3.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid CC_DLL kmGLFreeAll(void);\nvoid CC_DLL kmGLPushMatrix(void);\nvoid CC_DLL kmGLPopMatrix(void);\nvoid CC_DLL kmGLMatrixMode(kmGLEnum mode);\nvoid CC_DLL kmGLLoadIdentity(void);\nvoid CC_DLL kmGLLoadMatrix(const kmMat4* pIn);\nvoid CC_DLL kmGLMultMatrix(const kmMat4* pIn);\nvoid CC_DLL kmGLTranslatef(float x, float y, float z);\nvoid CC_DLL kmGLRotatef(float angle, float x, float y, float z);\nvoid CC_DLL kmGLScalef(float x, float y, float z);\nvoid CC_DLL kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // MATRIX_H_INCLUDED\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/aabb.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef KAZMATH_AABB_H_INCLUDED\n#define KAZMATH_AABB_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n#include \"vec3.h\"\n#include \"utility.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * A structure that represents an axis-aligned\n * bounding box.\n */\ntypedef struct kmAABB {\n    kmVec3 min; /** The max corner of the box */\n    kmVec3 max; /** The min corner of the box */\n} kmAABB;\n\nCC_DLL const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox);\nCC_DLL kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn);\nCC_DLL kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/kazmath.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef KAZMATH_H_INCLUDED\n#define KAZMATH_H_INCLUDED\n\n#include \"vec2.h\"\n#include \"vec3.h\"\n#include \"mat3.h\"\n#include \"mat4.h\"\n#include \"utility.h\"\n#include \"quaternion.h\"\n#include \"plane.h\"\n#include \"aabb.h\"\n#include \"ray2.h\"\n\n#endif // KAZMATH_H_INCLUDED\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/mat3.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\n#ifndef MAT3_H_INCLUDED\n#define MAT3_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n#include \"utility.h\"\n\nstruct kmVec3;\nstruct kmQuaternion;\n\ntypedef struct kmMat3{\n    kmScalar mat[9];\n} kmMat3;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nCC_DLL kmMat3* const kmMat3Fill(kmMat3* pOut, const kmScalar* pMat);\nCC_DLL kmMat3* const kmMat3Adjugate(kmMat3* pOut, const kmMat3* pIn);\nCC_DLL kmMat3* const kmMat3Identity(kmMat3* pOut);\nCC_DLL kmMat3* const kmMat3Inverse(kmMat3* pOut, const kmScalar pDeterminate, const kmMat3* pM);\nCC_DLL const int  kmMat3IsIdentity(const kmMat3* pIn);\nCC_DLL kmMat3* const kmMat3Transpose(kmMat3* pOut, const kmMat3* pIn);\nCC_DLL const kmScalar kmMat3Determinant(const kmMat3* pIn);\nCC_DLL kmMat3* const kmMat3Multiply(kmMat3* pOut, const kmMat3* pM1, const kmMat3* pM2);\nCC_DLL kmMat3* const kmMat3ScalarMultiply(kmMat3* pOut, const kmMat3* pM, const kmScalar pFactor);\n\nCC_DLL kmMat3* const kmMat3RotationAxisAngle(kmMat3* pOut, const struct kmVec3* axis, kmScalar radians);\nCC_DLL struct kmVec3* const kmMat3RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat3* pIn);\n\nCC_DLL kmMat3* const kmMat3Assign(kmMat3* pOut, const kmMat3* pIn);\nCC_DLL const int  kmMat3AreEqual(const kmMat3* pM1, const kmMat3* pM2);\n\nCC_DLL kmMat3* const kmMat3RotationX(kmMat3* pOut, const kmScalar radians);\nCC_DLL kmMat3* const kmMat3RotationY(kmMat3* pOut, const kmScalar radians);\nCC_DLL kmMat3* const kmMat3RotationZ(kmMat3* pOut, const kmScalar radians);\n\nCC_DLL kmMat3* const kmMat3Rotation(kmMat3* pOut, const kmScalar radians);\nCC_DLL kmMat3* const kmMat3Scaling(kmMat3* pOut, const kmScalar x, const kmScalar y);\nCC_DLL kmMat3* const kmMat3Translation(kmMat3* pOut, const kmScalar x, const kmScalar y);\n\nCC_DLL kmMat3* const kmMat3RotationQuaternion(kmMat3* pOut, const struct kmQuaternion* pIn);\nCC_DLL kmMat3* const kmMat3RotationAxisAngle(kmMat3* pOut, const struct kmVec3* axis, kmScalar radians);\nCC_DLL struct kmVec3* const kmMat3RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat3* pIn);\n\n#ifdef __cplusplus\n}\n#endif\n#endif // MAT3_H_INCLUDED\n\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/mat4.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef MAT4_H_INCLUDED\n#define MAT4_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n#include \"utility.h\"\n\nstruct kmVec3;\nstruct kmMat3;\nstruct kmQuaternion;\nstruct kmPlane;\n\n/*\nA 4x4 matrix\n\n        | 0   4   8  12 |\nmat =   | 1   5   9  13 |\n        | 2   6  10  14 |\n        | 3   7  11  15 |\n*/\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct kmMat4 {\n    kmScalar mat[16];\n} kmMat4;\n\nCC_DLL kmMat4* const kmMat4Fill(kmMat4* pOut, const kmScalar* pMat);\n\n\nCC_DLL kmMat4* const kmMat4Identity(kmMat4* pOut);\n\nCC_DLL kmMat4* const kmMat4Inverse(kmMat4* pOut, const kmMat4* pM);\n\n\nCC_DLL const int kmMat4IsIdentity(const kmMat4* pIn);\n\nCC_DLL kmMat4* const kmMat4Transpose(kmMat4* pOut, const kmMat4* pIn);\nCC_DLL kmMat4* const kmMat4Multiply(kmMat4* pOut, const kmMat4* pM1, const kmMat4* pM2);\n\nCC_DLL kmMat4* const kmMat4Assign(kmMat4* pOut, const kmMat4* pIn);\nCC_DLL const int kmMat4AreEqual(const kmMat4* pM1, const kmMat4* pM2);\n\nCC_DLL kmMat4* const kmMat4RotationX(kmMat4* pOut, const kmScalar radians);\nCC_DLL kmMat4* const kmMat4RotationY(kmMat4* pOut, const kmScalar radians);\nCC_DLL kmMat4* const kmMat4RotationZ(kmMat4* pOut, const kmScalar radians);\nCC_DLL kmMat4* const kmMat4RotationPitchYawRoll(kmMat4* pOut, const kmScalar pitch, const kmScalar yaw, const kmScalar roll);\nCC_DLL kmMat4* const kmMat4RotationQuaternion(kmMat4* pOut, const struct kmQuaternion* pQ);\nCC_DLL kmMat4* const kmMat4RotationTranslation(kmMat4* pOut, const struct kmMat3* rotation, const struct kmVec3* translation);\nCC_DLL kmMat4* const kmMat4Scaling(kmMat4* pOut, const kmScalar x, const kmScalar y, const kmScalar z);\nCC_DLL kmMat4* const kmMat4Translation(kmMat4* pOut, const kmScalar x, const kmScalar y, const kmScalar z);\n\nCC_DLL struct kmVec3* const kmMat4GetUpVec3(struct kmVec3* pOut, const kmMat4* pIn);\nCC_DLL struct kmVec3* const kmMat4GetRightVec3(struct kmVec3* pOut, const kmMat4* pIn);\nCC_DLL struct kmVec3* const kmMat4GetForwardVec3(struct kmVec3* pOut, const kmMat4* pIn);\n\nCC_DLL kmMat4* const kmMat4PerspectiveProjection(kmMat4* pOut, kmScalar fovY, kmScalar aspect, kmScalar zNear, kmScalar zFar);\nCC_DLL kmMat4* const kmMat4OrthographicProjection(kmMat4* pOut, kmScalar left, kmScalar right, kmScalar bottom, kmScalar top, kmScalar nearVal, kmScalar farVal);\nCC_DLL kmMat4* const kmMat4LookAt(kmMat4* pOut, const struct kmVec3* pEye, const struct kmVec3* pCenter, const struct kmVec3* pUp);\n\nCC_DLL kmMat4* const kmMat4RotationAxisAngle(kmMat4* pOut, const struct kmVec3* axis, kmScalar radians);\nCC_DLL struct kmMat3* const kmMat4ExtractRotation(struct kmMat3* pOut, const kmMat4* pIn);\nCC_DLL struct kmPlane* const kmMat4ExtractPlane(struct kmPlane* pOut, const kmMat4* pIn, const kmEnum plane);\nCC_DLL struct kmVec3* const kmMat4RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat4* pIn);\n#ifdef __cplusplus\n}\n#endif\n#endif /* MAT4_H_INCLUDED */\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/neon_matrix_impl.h",
    "content": "/*\n NEON math library for the iPhone / iPod touch\n\n Copyright (c) 2009 Justin Saunders\n\n This software is provided 'as-is', without any express or implied warranty.\n In no event will the authors be held liable for any damages arising\n from the use of this software.\n Permission is granted to anyone to use this software for any purpose,\n including commercial applications, and to alter it and redistribute it freely,\n subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must\n not claim that you wrote the original software. If you use this\n software in a product, an acknowledgment in the product documentation\n would be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must\n not be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef __NEON_MATRIX_IMPL_H__\n#define __NEON_MATRIX_IMPL_H__\n\n#ifdef __arm__\n#if defined(__QNX__) || defined(CC_TARGET_QT5)|| defined(ANDROID) || defined(I3D_ARCH_ARM) || defined(__native_client__) || defined(TIZEN) // MARMALADE CHANGE: Added for Marmalade support\n// blackberry and android don't have arm/arch.h but it defines __arm__\n#else\n#include \"arm/arch.h\"\n#endif \n#endif // __arm__\n\n// Matrices are assumed to be stored in column major format according to OpenGL\n// specification.\n\n// Multiplies two 4x4 matrices (a,b) outputting a 4x4 matrix (output)\nvoid NEON_Matrix4Mul(const float* a, const float* b, float* output );\n\n// Multiplies a 4x4 matrix (m) with a vector 4 (v), outputting a vector 4\nvoid NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output);\n\n\n#endif // __NEON_MATRIX_IMPL_H__\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/plane.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef PLANE_H_INCLUDED\n#define PLANE_H_INCLUDED\n\n#define KM_PLANE_LEFT 0\n#define KM_PLANE_RIGHT 1\n#define KM_PLANE_BOTTOM 2\n#define KM_PLANE_TOP 3\n#define KM_PLANE_NEAR 4\n#define KM_PLANE_FAR 5\n\n#include \"CCPlatformMacros.h\"\n#include \"utility.h\"\n\nstruct kmVec3;\nstruct kmVec4;\nstruct kmMat4;\n\ntypedef struct kmPlane {\n    kmScalar     a, b, c, d;\n} kmPlane;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef enum POINT_CLASSIFICATION {\n    POINT_INFRONT_OF_PLANE = 0,\n    POINT_BEHIND_PLANE,\n    POINT_ON_PLANE,\n} POINT_CLASSIFICATION;\n\nCC_DLL const kmScalar kmPlaneDot(const kmPlane* pP, const struct kmVec4* pV);\nCC_DLL const kmScalar kmPlaneDotCoord(const kmPlane* pP, const struct kmVec3* pV);\nCC_DLL const kmScalar kmPlaneDotNormal(const kmPlane* pP, const struct kmVec3* pV);\nCC_DLL kmPlane* const kmPlaneFromPointNormal(kmPlane* pOut, const struct kmVec3* pPoint, const struct kmVec3* pNormal);\nCC_DLL kmPlane* const kmPlaneFromPoints(kmPlane* pOut, const struct kmVec3* p1, const struct kmVec3* p2, const struct kmVec3* p3);\nCC_DLL kmVec3*  const kmPlaneIntersectLine(struct kmVec3* pOut, const kmPlane* pP, const struct kmVec3* pV1, const struct kmVec3* pV2);\nCC_DLL kmPlane* const kmPlaneNormalize(kmPlane* pOut, const kmPlane* pP);\nCC_DLL kmPlane* const kmPlaneScale(kmPlane* pOut, const kmPlane* pP, kmScalar s);\nCC_DLL const POINT_CLASSIFICATION kmPlaneClassifyPoint(const kmPlane* pIn, const kmVec3* pP); /** Classifies a point against a plane */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // PLANE_H_INCLUDED\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/quaternion.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef QUATERNION_H_INCLUDED\n#define QUATERNION_H_INCLUDED\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"CCPlatformMacros.h\"\n#include \"utility.h\"\n\nstruct kmMat4;\nstruct kmMat3;\nstruct kmVec3;\n\ntypedef struct kmQuaternion {\n    kmScalar x;\n    kmScalar y;\n    kmScalar z;\n    kmScalar w;\n} kmQuaternion;\n\nCC_DLL kmQuaternion* const kmQuaternionConjugate(kmQuaternion* pOut, const kmQuaternion* pIn); ///< Returns pOut, sets pOut to the conjugate of pIn\n\nCC_DLL const kmScalar     kmQuaternionDot(const kmQuaternion* q1, const kmQuaternion* q2); ///< Returns the dot product of the 2 quaternions\n\nCC_DLL kmQuaternion* kmQuaternionExp(kmQuaternion* pOut, const kmQuaternion* pIn); ///< Returns the exponential of the quaternion\n\n///< Makes the passed quaternion an identity quaternion\n\nCC_DLL kmQuaternion* kmQuaternionIdentity(kmQuaternion* pOut);\n\n///< Returns the inverse of the passed Quaternion\n\nCC_DLL kmQuaternion* kmQuaternionInverse(kmQuaternion* pOut,\n                                            const kmQuaternion* pIn);\n\n///< Returns true if the quaternion is an identity quaternion\n\nCC_DLL int kmQuaternionIsIdentity(const kmQuaternion* pIn);\n\n///< Returns the length of the quaternion\n\nCC_DLL kmScalar kmQuaternionLength(const kmQuaternion* pIn);\n\n///< Returns the length of the quaternion squared (prevents a sqrt)\n\nCC_DLL kmScalar kmQuaternionLengthSq(const kmQuaternion* pIn);\n\n///< Returns the natural logarithm\n\nCC_DLL kmQuaternion* kmQuaternionLn(kmQuaternion* pOut, const kmQuaternion* pIn);\n\n///< Multiplies 2 quaternions together\n\nCC_DLL kmQuaternion* kmQuaternionMultiply(kmQuaternion* pOut, const kmQuaternion* q1, const kmQuaternion* q2);\n\n///< Normalizes a quaternion\n\nCC_DLL kmQuaternion* kmQuaternionNormalize(kmQuaternion* pOut, const kmQuaternion* pIn);\n\n///< Rotates a quaternion around an axis\n\nCC_DLL kmQuaternion* kmQuaternionRotationAxis(kmQuaternion* pOut, const struct kmVec3* pV, kmScalar angle);\n\n///< Creates a quaternion from a rotation matrix\n\nCC_DLL kmQuaternion* kmQuaternionRotationMatrix(kmQuaternion* pOut, const struct kmMat3* pIn);\n\n///< Create a quaternion from yaw, pitch and roll\n\nCC_DLL kmQuaternion* kmQuaternionRotationYawPitchRoll(kmQuaternion* pOut, kmScalar yaw, kmScalar pitch, kmScalar roll);\n///< Interpolate between 2 quaternions\nCC_DLL kmQuaternion* kmQuaternionSlerp(kmQuaternion* pOut, const kmQuaternion* q1, const kmQuaternion* q2, kmScalar t);\n\n///< Get the axis and angle of rotation from a quaternion\nCC_DLL void kmQuaternionToAxisAngle(const kmQuaternion* pIn, struct kmVec3* pVector, kmScalar* pAngle);\n\n///< Scale a quaternion\nCC_DLL kmQuaternion* kmQuaternionScale(kmQuaternion* pOut, const kmQuaternion* pIn, kmScalar s);\nCC_DLL kmQuaternion* kmQuaternionAssign(kmQuaternion* pOut, const kmQuaternion* pIn);\nCC_DLL kmQuaternion* kmQuaternionAdd(kmQuaternion* pOut, const kmQuaternion* pQ1, const kmQuaternion* pQ2);\nCC_DLL kmQuaternion* kmQuaternionRotationBetweenVec3(kmQuaternion* pOut, const struct kmVec3* vec1, const struct kmVec3* vec2, const struct kmVec3* fallback);\nCC_DLL struct kmVec3* kmQuaternionMultiplyVec3(struct kmVec3* pOut, const kmQuaternion* q, const struct kmVec3* v);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/ray2.h",
    "content": "/*\nCopyright (c) 2011, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef RAY_2_H\n#define RAY_2_H\n\n#include \"CCPlatformMacros.h\"\n#include \"utility.h\"\n#include \"vec2.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct kmRay2 {\n    kmVec2 start;\n    kmVec2 dir;\n} kmRay2;\n\nCC_DLL void kmRay2Fill(kmRay2* ray, kmScalar px, kmScalar py, kmScalar vx, kmScalar vy);\nCC_DLL kmBool kmRay2IntersectLineSegment(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, kmVec2* intersection);\nCC_DLL kmBool kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out);\nCC_DLL kmBool kmRay2IntersectCircle(const kmRay2* ray, const kmVec2 centre, const kmScalar radius, kmVec2* intersection);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/utility.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef UTILITY_H_INCLUDED\n#define UTILITY_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n#include <math.h>\n\n#ifndef kmScalar\n#define kmScalar float\n#endif\n\n#ifndef kmBool\n#define kmBool unsigned char\n#endif\n\n#ifndef kmEnum\n#define kmEnum unsigned int\n#endif\n\n#ifndef KM_FALSE\n#define KM_FALSE 0\n#endif\n\n#ifndef KM_TRUE\n#define KM_TRUE 1\n#endif\n\n#define kmPI 3.141592f\n#define kmPIOver180 0.017453f //  PI / 180\n#define kmPIUnder180 57.295779f // 180 / PI\n#define kmEpsilon 1.0 / 64.0\n\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nCC_DLL kmScalar kmSQR(kmScalar s);\nCC_DLL kmScalar kmDegreesToRadians(kmScalar degrees);\nCC_DLL kmScalar kmRadiansToDegrees(kmScalar radians);\n\nCC_DLL kmScalar kmMin(kmScalar lhs, kmScalar rhs);\nCC_DLL kmScalar kmMax(kmScalar lhs, kmScalar rhs);\nCC_DLL kmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* UTILITY_H_INCLUDED */\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/vec2.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef VEC2_H_INCLUDED\n#define VEC2_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n\nstruct kmMat3;\n\n#ifndef kmScalar\n#define kmScalar float\n#endif\n\n#pragma pack(push)  /* push current alignment to stack */\n#pragma pack(1)     /* set alignment to 1 byte boundary */\ntypedef struct kmVec2 {\n    kmScalar x;\n    kmScalar y;\n} kmVec2;\n\n#pragma pack(pop)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nCC_DLL kmVec2* kmVec2Fill(kmVec2* pOut, kmScalar x, kmScalar y);\nCC_DLL kmScalar kmVec2Length(const kmVec2* pIn); ///< Returns the length of the vector\nCC_DLL kmScalar kmVec2LengthSq(const kmVec2* pIn); ///< Returns the square of the length of the vector\nCC_DLL kmVec2* kmVec2Normalize(kmVec2* pOut, const kmVec2* pIn); ///< Returns the vector passed in set to unit length\nCC_DLL kmVec2* kmVec2Add(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2); ///< Adds 2 vectors and returns the result\nCC_DLL kmScalar kmVec2Dot(const kmVec2* pV1, const kmVec2* pV2); /** Returns the Dot product which is the cosine of the angle between the two vectors multiplied by their lengths */\nCC_DLL kmVec2* kmVec2Subtract(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2); ///< Subtracts 2 vectors and returns the result\nCC_DLL kmVec2* kmVec2Transform(kmVec2* pOut, const kmVec2* pV1, const struct kmMat3* pM); /** Transform the Vector */\nCC_DLL kmVec2* kmVec2TransformCoord(kmVec2* pOut, const kmVec2* pV, const struct kmMat3* pM); ///<Transforms a 2D vector by a given matrix, projecting the result back into w = 1.\nCC_DLL kmVec2* kmVec2Scale(kmVec2* pOut, const kmVec2* pIn, const kmScalar s); ///< Scales a vector to length s\nCC_DLL int kmVec2AreEqual(const kmVec2* p1, const kmVec2* p2); ///< Returns 1 if both vectors are equal\n\n#ifdef __cplusplus\n}\n#endif\n\n\n#endif // VEC2_H_INCLUDED\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/vec3.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef VEC3_H_INCLUDED\n#define VEC3_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n#include <assert.h>\n\n#ifndef kmScalar\n#define kmScalar float\n#endif\n\nstruct kmMat4;\n\ntypedef struct kmVec3 {\n    kmScalar x;\n    kmScalar y;\n    kmScalar z;\n} kmVec3;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nCC_DLL kmVec3* kmVec3Fill(kmVec3* pOut, kmScalar x, kmScalar y, kmScalar z);\nCC_DLL kmScalar kmVec3Length(const kmVec3* pIn); /** Returns the length of the vector */\nCC_DLL kmScalar kmVec3LengthSq(const kmVec3* pIn); /** Returns the square of the length of the vector */\nCC_DLL kmVec3* kmVec3Normalize(kmVec3* pOut, const kmVec3* pIn); /** Returns the vector passed in set to unit length */\nCC_DLL kmVec3* kmVec3Cross(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2); /** Returns a vector perpendicular to 2 other vectors */\nCC_DLL kmScalar kmVec3Dot(const kmVec3* pV1, const kmVec3* pV2); /** Returns the cosine of the angle between 2 vectors */\nCC_DLL kmVec3* kmVec3Add(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2); /** Adds 2 vectors and returns the result */\nCC_DLL kmVec3* kmVec3Subtract(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2); /** Subtracts 2 vectors and returns the result */\nCC_DLL kmVec3* kmVec3Transform(kmVec3* pOut, const kmVec3* pV1, const struct kmMat4* pM); /** Transforms a vector (assuming w=1) by a given matrix */\nCC_DLL kmVec3* kmVec3TransformNormal(kmVec3* pOut, const kmVec3* pV, const struct kmMat4* pM);/**Transforms a 3D normal by a given matrix */\nCC_DLL kmVec3* kmVec3TransformCoord(kmVec3* pOut, const kmVec3* pV, const struct kmMat4* pM); /**Transforms a 3D vector by a given matrix, projecting the result back into w = 1. */\nCC_DLL kmVec3* kmVec3Scale(kmVec3* pOut, const kmVec3* pIn, const kmScalar s); /** Scales a vector to length s */\nCC_DLL int kmVec3AreEqual(const kmVec3* p1, const kmVec3* p2);\nCC_DLL kmVec3* kmVec3InverseTransform(kmVec3* pOut, const kmVec3* pV, const struct kmMat4* pM);\nCC_DLL kmVec3* kmVec3InverseTransformNormal(kmVec3* pOut, const kmVec3* pVect, const struct kmMat4* pM);\nCC_DLL kmVec3* kmVec3Assign(kmVec3* pOut, const kmVec3* pIn);\nCC_DLL kmVec3* kmVec3Zero(kmVec3* pOut);\n\n#ifdef __cplusplus\n}\n#endif\n#endif /* VEC3_H_INCLUDED */\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/include/kazmath/vec4.h",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef VEC4_H_INCLUDED\n#define VEC4_H_INCLUDED\n\n#include \"CCPlatformMacros.h\"\n#include \"utility.h\"\n\nstruct kmMat4;\n\n#pragma pack(push)  /* push current alignment to stack */\n#pragma pack(1)     /* set alignment to 1 byte boundary */\n\ntypedef struct kmVec4 {\n    kmScalar x;\n    kmScalar y;\n    kmScalar z;\n    kmScalar w;\n} kmVec4;\n\n#pragma pack(pop)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nCC_DLL kmVec4* kmVec4Fill(kmVec4* pOut, kmScalar x, kmScalar y, kmScalar z, kmScalar w);\nCC_DLL kmVec4* kmVec4Add(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2);\nCC_DLL kmScalar kmVec4Dot(const kmVec4* pV1, const kmVec4* pV2);\nCC_DLL kmScalar kmVec4Length(const kmVec4* pIn);\nCC_DLL kmScalar kmVec4LengthSq(const kmVec4* pIn);\nCC_DLL kmVec4* kmVec4Lerp(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2, kmScalar t);\nCC_DLL kmVec4* kmVec4Normalize(kmVec4* pOut, const kmVec4* pIn);\nCC_DLL kmVec4* kmVec4Scale(kmVec4* pOut, const kmVec4* pIn, const kmScalar s); ///< Scales a vector to length s\nCC_DLL kmVec4* kmVec4Subtract(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2);\nCC_DLL kmVec4* kmVec4Transform(kmVec4* pOut, const kmVec4* pV, const struct kmMat4* pM);\nCC_DLL kmVec4* kmVec4TransformArray(kmVec4* pOut, unsigned int outStride,\n            const kmVec4* pV, unsigned int vStride, const struct kmMat4* pM, unsigned int count);\nCC_DLL int     kmVec4AreEqual(const kmVec4* p1, const kmVec4* p2);\nCC_DLL kmVec4* kmVec4Assign(kmVec4* pOut, const kmVec4* pIn);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // VEC4_H_INCLUDED\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/CMakeLists.txt",
    "content": "\n#ADD_LIBRARY(Kazmath STATIC ${KAZMATH_SRCS})\n#INSTALL(TARGETS Kazmath ARCHIVE DESTINATION lib)\n\nINCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include )\n\nADD_LIBRARY(kazmath STATIC ${KAZMATH_SOURCES})\nINSTALL(TARGETS kazmath ARCHIVE DESTINATION lib)\n\n#ADD_LIBRARY(KazmathGL STATIC ${GL_UTILS_SRCS})\n#INSTALL(TARGETS KazmathGL ARCHIVE DESTINATION lib)\n\nINSTALL(FILES ${KAZMATH_HEADERS} DESTINATION include/kazmath)\nINSTALL(FILES ${GL_UTILS_HEADERS} DESTINATION include/kazmath/GL)\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/ChangeLog",
    "content": "------------------------------------------------------------\nrevno: 111\ncommitter: Kazade <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Thu 2010-08-19 12:07:29 +0100\nmessage:\n  Fix #620352. Fix a reference to kmMat4RotationAxisAngle\n------------------------------------------------------------\nrevno: 110\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Wed 2010-04-21 12:55:39 +0200\nmessage:\n  applied the change to the header files as well\n------------------------------------------------------------\nrevno: 109\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Wed 2010-04-21 12:54:06 +0200\nmessage:\n  fixed kmMat4RotationAxis\n------------------------------------------------------------\nrevno: 108 [merge]\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Wed 2010-04-21 12:27:53 +0200\nmessage:\n  fixed CMake in kazmathxx due to missing utility.h\n------------------------------------------------------------\nrevno: 107\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Wed 2010-04-21 12:22:40 +0200\nmessage:\n  fixed mat4 rotation axis by normalizing the axis first\n------------------------------------------------------------\nrevno: 106\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2010-01-09 16:56:04 +0000\nmessage:\n  Add cmake module\n------------------------------------------------------------\nrevno: 105\ncommitter: Luke Benstead <luke@Hydrogen>\nbranch nick: kazmath\ntimestamp: Sat 2010-01-09 16:23:31 +0000\nmessage:\n  Remove kazmodel - it really should belong in its own repo\n------------------------------------------------------------\nrevno: 104\ncommitter: Luke Benstead <luke@Hydrogen>\nbranch nick: kazmath\ntimestamp: Fri 2010-01-08 23:03:13 +0000\nmessage:\n  Reorganize the headers so that the tests can compile in place\n------------------------------------------------------------\nrevno: 103\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-08-31 11:21:42 +0200\nmessage:\n  Operators now inline, constructors fixed\n------------------------------------------------------------\nrevno: 102\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-29 11:42:59 +0200\nmessage:\n  fixed some compilation errors - still how do we define operators in headers correctly??\n------------------------------------------------------------\nrevno: 101\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Wed 2009-08-26 10:37:52 +0100\nmessage:\n  Added the header defines\n------------------------------------------------------------\nrevno: 100\ncommitter: Luke Benstead <luke@sidney>\nbranch nick: kazmath\ntimestamp: Wed 2009-08-26 09:38:47 +0100\nmessage:\n  Added a V2 for kazmathxx\n------------------------------------------------------------\nrevno: 99\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-08-02 08:08:26 +0100\nmessage:\n  Added missing header file to one of the tests\n------------------------------------------------------------\nrevno: 98\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 12:05:25 +0200\nmessage:\n  No longer doing self assignment in kmMat4Inverse\n------------------------------------------------------------\nrevno: 97\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 11:15:36 +0200\nmessage:\n  Fixed kmMat4Inverse\n------------------------------------------------------------\nrevno: 96\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 09:20:33 +0100\nmessage:\n  Fixed some whitespace issues in plane.c\n------------------------------------------------------------\nrevno: 95\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 09:17:01 +0100\nmessage:\n  Rename kmAABBPointInBox to kmAABBContainsPoint\n------------------------------------------------------------\nrevno: 94\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 09:16:28 +0100\nmessage:\n  Implement kmAABBPointInBox\n------------------------------------------------------------\nrevno: 93\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 09:14:00 +0100\nmessage:\n  Implement kmAABBAssign\n------------------------------------------------------------\nrevno: 92\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 09:10:36 +0100\nmessage:\n  Fixed some whitespace and added some comments\n------------------------------------------------------------\nrevno: 91\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-08-01 08:56:13 +0100\nmessage:\n  Implemented (untested) kmMat4RotationTranslation to construct a 4x4 matrix from a 3x3 + vec3\n------------------------------------------------------------\nrevno: 90\ncommitter: Luke Benstead <luke@hydrogen>\nbranch nick: kazmath\ntimestamp: Sun 2009-07-05 07:55:45 +0100\nmessage:\n  Added kmMat3RotationX, kmMat3RotationY and kmMat3RotationZ\n------------------------------------------------------------\nrevno: 89\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-06-27 09:38:20 +0200\nmessage:\n  Fixed a crash?\n------------------------------------------------------------\nrevno: 88\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Tue 2009-04-28 09:52:57 +0100\nmessage:\n  Added a test for kmMat4Transpose\n------------------------------------------------------------\nrevno: 87\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Tue 2009-04-28 08:49:59 +0100\nmessage:\n  Added a commented test for kmMat4Inverse, however kmMat4Adjugate and kmMat4Determinate need implementing\n------------------------------------------------------------\nrevno: 86\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Tue 2009-04-28 08:46:03 +0100\nmessage:\n  Fixed bug in kmQuaternionRotationMatrix\n------------------------------------------------------------\nrevno: 85\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Tue 2009-04-28 08:41:27 +0100\nmessage:\n  Added missing include to test_mat3.cpp\n------------------------------------------------------------\nrevno: 84\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 22:59:08 +0200\nmessage:\n  fixed CMakeLists.txt for the tests\n------------------------------------------------------------\nrevno: 83\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 21:34:20 +0100\nmessage:\n  Added a test for kmMat3Translation\n------------------------------------------------------------\nrevno: 82\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 21:32:19 +0100\nmessage:\n  Fixed bugs in kmMat3Scaling and kmMat3Translation, added test for kmMat3Scaling\n------------------------------------------------------------\nrevno: 81 [merge]\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 19:04:56 +0100\nmessage:\n  Merge from upstream. Fixed mismatching prototype in quaternion.c\n------------------------------------------------------------\nrevno: 80\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 19:01:35 +0100\nmessage:\n  Added a test for kmMat3AreEqual. Fixed a bug in kmMat3AreEqual\n------------------------------------------------------------\nrevno: 79\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 18:57:28 +0100\nmessage:\n  Added a test for kmMat3IsIdentity\n------------------------------------------------------------\nrevno: 78\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 18:54:48 +0100\nmessage:\n  Added a test for kmMat3Identity\n------------------------------------------------------------\nrevno: 77\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 18:52:14 +0100\nmessage:\n  Added a test for kmMat3Fill\n------------------------------------------------------------\nrevno: 76\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 18:46:30 +0100\nmessage:\n  Added some mat3 unit tests. Fixed a bug in kmMat3AreEqual\n------------------------------------------------------------\nrevno: 75\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 11:08:43 +0100\nmessage:\n  Added mat4 test stub\n------------------------------------------------------------\nrevno: 74\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 11:06:12 +0100\nmessage:\n  Enabled unit testing in cmake\n------------------------------------------------------------\nrevno: 73\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 10:44:37 +0100\nmessage:\n  Added cmakelists.txt to the tests subfolder\n------------------------------------------------------------\nrevno: 72\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 10:37:34 +0100\nmessage:\n  Added stub mat3 test file\n------------------------------------------------------------\nrevno: 71\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Mon 2009-04-27 10:35:48 +0100\nmessage:\n  Added tests folder for new boost::unit based tests\n------------------------------------------------------------\nrevno: 70\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 14:25:48 +0200\nmessage:\n  Fixed the new quaternion -> Matrix -> AngleAxis methods and added them to mat4\n------------------------------------------------------------\nrevno: 69\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 12:40:08 +0100\nmessage:\n  Added kazmodel to the kazlibs repo\n------------------------------------------------------------\nrevno: 68 [merge]\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 12:34:27 +0100\nmessage:\n  Merge from upstream\n------------------------------------------------------------\nrevno: 67\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 12:33:43 +0100\nmessage:\n  Reorganized bzr\n------------------------------------------------------------\nrevno: 66\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 10:00:18 +0100\nmessage:\n  Renamed kmMat3RotationAxis to kmMat3RotationAxisAngle to be more accurate\n------------------------------------------------------------\nrevno: 65\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 09:57:19 +0100\nmessage:\n  Fixed some compilation errors\n------------------------------------------------------------\nrevno: 64\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 09:54:12 +0100\nmessage:\n  Added untested implementation of kmMat3RotationToAxisAngle\n------------------------------------------------------------\nrevno: 63\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 09:49:17 +0100\nmessage:\n  Added stub for kmMat3RotationToAxisAngle()\n------------------------------------------------------------\nrevno: 62\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 09:45:58 +0100\nmessage:\n  Corrected a typo\n------------------------------------------------------------\nrevno: 61\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-26 09:44:39 +0100\nmessage:\n  Fixed broken Quaternion functions\n  Added (untested) kmMat3RotationAxis()\n------------------------------------------------------------\nrevno: 60\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-04-18 08:55:29 +0100\nmessage:\n  Fixed some errors in the quaternion header. \n  Changed kmQuaternionRotationMatrix to accept a kmMat3 instead of kmMat4\n------------------------------------------------------------\nrevno: 59\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: kazmath\ntimestamp: Sat 2009-04-18 08:42:38 +0100\nmessage:\n  Added kmMat3RotationQuaternion\n------------------------------------------------------------\nrevno: 58\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-05 11:58:29 +0200\nmessage:\n  Added mat3\n------------------------------------------------------------\nrevno: 57 [merge]\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-05 11:54:15 +0200\nmessage:\n  Implemented mat4 and vec4 for kazmathxx\n------------------------------------------------------------\nrevno: 56\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Sun 2009-04-05 11:53:07 +0200\nmessage:\n  Implemented mat4 and vec4 for kazmathxx\n------------------------------------------------------------\nrevno: 55\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Fri 2009-03-13 16:46:26 +0100\nmessage:\n  added km::vec3 to kazmathxx\n------------------------------------------------------------\nrevno: 54\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Fri 2009-03-13 16:14:51 +0100\nmessage:\n  Fixed: kmVec2 is no longer transformed by kmMat4\\nAdded km::vec2\n------------------------------------------------------------\nrevno: 53\ncommitter: Carsten Haubld <carstenhaubold@googlemail.com>\nbranch nick: kazmath\ntimestamp: Fri 2009-03-13 15:38:53 +0100\nmessage:\n  Added folder for kazmathxx\n------------------------------------------------------------\nrevno: 52 [merge]\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: trunk\ntimestamp: Fri 2009-03-13 14:04:32 +0000\nmessage:\n  Merge from upstream\n------------------------------------------------------------\nrevno: 51\ncommitter: Luke Benstead <kazade@gmail.com>\nbranch nick: trunk\ntimestamp: Fri 2009-03-13 14:00:14 +0000\nmessage:\n  Fixed for C89\n------------------------------------------------------------\nrevno: 50\ncommitter: Carsten Haubold <CarstenHaubold@googlemail.com>\ntimestamp: Tue 2008-12-30 12:45:23 +0100\nmessage:\n  fixed kmGLTranslate\n------------------------------------------------------------\nrevno: 49\ncommitter: Carsten Haubold <CarstenHaubold@googlemail.com>\ntimestamp: Tue 2008-12-30 12:15:27 +0100\nmessage:\n  fixed some stack memory leaks\n------------------------------------------------------------\nrevno: 48\ncommitter: Carsten Haubold <CarstenHaubold@googlemail.com>\ntimestamp: Tue 2008-12-30 11:01:35 +0100\nmessage:\n  The GL matrix stacks now work as expected - matrix multiplication was the wrong way round\n------------------------------------------------------------\nrevno: 47\ncommitter: Carsten Haubold <CarstenHaubold@googlemail.com>\ntimestamp: Tue 2008-12-30 10:52:28 +0100\nmessage:\n  Debug output\n------------------------------------------------------------\nrevno: 46\ncommitter: Carsten Haubold <CarstenHaubold@googlemail.com>\ntimestamp: Mon 2008-12-29 18:32:13 +0100\nmessage:\n  Fixed some compiler errors\n------------------------------------------------------------\nrevno: 45\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Wed 2008-11-19 08:36:47 +0000\nmessage:\n  Added kmGLTranslatef, kmGLScalef and kmGLRotatef\n------------------------------------------------------------\nrevno: 44\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-11-04 20:57:30 +0000\nmessage:\n  Fixed up kazmathxx\n------------------------------------------------------------\nrevno: 43\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Wed 2008-10-29 09:24:32 +0000\nmessage:\n  Started implementing C++ operators in kazmathxx.h\n------------------------------------------------------------\nrevno: 42\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 18:21:16 +0000\nmessage:\n  Added kazmathxx.h for C++ usage\n------------------------------------------------------------\nrevno: 41\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 11:00:41 +0000\nmessage:\n  Added Doxygen documentation\n------------------------------------------------------------\nrevno: 40\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 08:46:19 +0000\nmessage:\n  Began documenting the kmPlane functions.\n  Changed some assert(0)s to include a not implemented message\n------------------------------------------------------------\nrevno: 39\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 08:42:24 +0000\nmessage:\n  - Wrote stubs for the AABB functions which raise assertions if used.\n  - Documented the AABB functions\n  - Changed the definition of kmAABBPointInBox so that it actually makes sense\n------------------------------------------------------------\nrevno: 38\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 08:38:48 +0000\nmessage:\n  - Documented utility.c\n------------------------------------------------------------\nrevno: 37\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 08:36:30 +0000\nmessage:\n  - Documented vec3.c in detail.\n  - Fixed up a not-implemented assertion.\n  - Changed existing doc strings to C style -  /** */\n------------------------------------------------------------\nrevno: 36\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 08:30:00 +0000\nmessage:\n  Removed uneccessary files from git\n------------------------------------------------------------\nrevno: 35\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Tue 2008-10-28 08:28:49 +0000\nmessage:\n  - Documented all the functions in mat4.c\n  - Fixed up all asserts in mat4.c to include a message\n  - Tidied up the code. Mat4.c is now done.\n------------------------------------------------------------\nrevno: 34\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Mon 2008-10-27 21:52:33 +0000\nmessage:\n  Added potential 0.1 release binary\n------------------------------------------------------------\nrevno: 33\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Mon 2008-10-27 21:46:55 +0000\nmessage:\n  Changed the README to include the BSD license\n------------------------------------------------------------\nrevno: 32\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Mon 2008-10-27 21:45:51 +0000\nmessage:\n  Added the modified BSD license to all source files\n------------------------------------------------------------\nrevno: 31\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Mon 2008-10-27 21:11:51 +0000\nmessage:\n  Fixed the installation of header files in CMake\n------------------------------------------------------------\nrevno: 30\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Mon 2008-10-27 21:05:51 +0000\nmessage:\n  Added kazmath project files\n------------------------------------------------------------\nrevno: 29 [merge]\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Mon 2008-10-27 21:03:22 +0000\nmessage:\n  Merge branch 'master' of git@github.com:Kazade/kazmath\n------------------------------------------------------------\nrevno: 28\ncommitter: Luke <kazade@gmail.com>\ntimestamp: Mon 2008-10-27 21:02:04 +0000\nmessage:\n  Finally got kazmath compiling on VC++, man that compiler sucks! Have MS not heard of C99?\n------------------------------------------------------------\nrevno: 27\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Sun 2008-10-26 21:35:24 +0000\nmessage:\n  Changed the readme slightly, we need to change the license everywhere\n------------------------------------------------------------\nrevno: 26\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Sun 2008-10-26 21:21:47 +0000\nmessage:\n  Implemented the stacks test, fixed the undefined references I was getting\n------------------------------------------------------------\nrevno: 25\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Sun 2008-10-26 20:59:34 +0000\nmessage:\n  Removed the old matrix stack stuff\n------------------------------------------------------------\nrevno: 24\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Sun 2008-10-26 20:11:58 +0000\nmessage:\n  Started implementing the matrix stack tests\n------------------------------------------------------------\nrevno: 23\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Sun 2008-10-26 10:56:51 +0000\nmessage:\n  Started new implementation of the GL matrix stack\n------------------------------------------------------------\nrevno: 22\ncommitter: Carsten Haubold <CarstenHaubold@googlemail.com>\ntimestamp: Thu 2008-08-28 12:37:41 +0200\nmessage:\n  Added kmGLRotation\n------------------------------------------------------------\nrevno: 21\ncommitter: Luke Benstead <luke@helium.(none)>\ntimestamp: Thu 2008-08-28 09:24:00 +0100\nmessage:\n  We now have a working matrix stack\n------------------------------------------------------------\nrevno: 20\ncommitter: Luke Benstead <luke@helium.(none)>\ntimestamp: Wed 2008-08-27 13:34:49 +0100\nmessage:\n  Fixed the stack memory constants\n------------------------------------------------------------\nrevno: 19\ncommitter: Luke Benstead <luke@helium.(none)>\ntimestamp: Wed 2008-08-27 13:33:12 +0100\nmessage:\n  Added the initial gl_utils implementation for replacing the matrix functionality deprecated in OpenGL 3.0\n------------------------------------------------------------\nrevno: 18\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Mon 2008-08-25 12:46:16 +0200\nmessage:\n  Fixed a bug in kmMat4LookAt\n------------------------------------------------------------\nrevno: 17 [merge]\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Sun 2008-08-24 22:07:49 +0200\nmessage:\n  Merge branch 'master' of git@github.com:Kazade/kazmath\n------------------------------------------------------------\nrevno: 16\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Sun 2008-08-24 22:06:45 +0200\nmessage:\n  Added kmMat4LookAt\n------------------------------------------------------------\nrevno: 15\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Wed 2008-08-20 11:18:10 +0200\nmessage:\n  Added Fill methods for all Vec and Mat structs\n------------------------------------------------------------\nrevno: 14\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Tue 2008-08-19 22:31:55 +0200\nmessage:\n  Added UnitTests, changed bool to int and fixed some minor bugs\n------------------------------------------------------------\nrevno: 13\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Sun 2008-08-17 23:19:21 +0200\nmessage:\n  removed .svn entries which did not belong here\n------------------------------------------------------------\nrevno: 12\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Sun 2008-08-17 23:17:07 +0200\nmessage:\n  some tweaks on matrices and first test-app, PerspectiveProjection is correct !\n------------------------------------------------------------\nrevno: 11\ncommitter: Carsten Haubold <dumbo@dumbo-laptop.(none)>\ntimestamp: Sun 2008-08-17 16:04:09 +0200\nmessage:\n  Renamed cotangent to cotangens\n------------------------------------------------------------\nrevno: 10\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Sat 2008-08-16 21:51:22 +0100\nmessage:\n  Added kmMat4PerspectiveProjection and kmMat4OrthographicProjection\n------------------------------------------------------------\nrevno: 9\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 21:15:45 +0100\nmessage:\n  Added the aabb struct\n------------------------------------------------------------\nrevno: 8\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 17:57:43 +0100\nmessage:\n  Added the kmAABB structure\n------------------------------------------------------------\nrevno: 7\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 14:32:24 +0100\nmessage:\n  Fixed broken kmMat3Transpose\n------------------------------------------------------------\nrevno: 6\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 14:21:04 +0100\nmessage:\n  Fixed broken kmMat4Translation, w component was not set\n------------------------------------------------------------\nrevno: 5\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 14:01:47 +0100\nmessage:\n  Added mat3.c and mat3.h to the cmake file\n------------------------------------------------------------\nrevno: 4\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 13:56:26 +0100\nmessage:\n  Added the authors section to the readme\n------------------------------------------------------------\nrevno: 3\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 13:55:41 +0100\nmessage:\n  Updated the readme file\n------------------------------------------------------------\nrevno: 2\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 13:53:26 +0100\nmessage:\n  Added kazmath to git\n------------------------------------------------------------\nrevno: 1\ncommitter: Luke Benstead <kazade@gmail.com>\ntimestamp: Thu 2008-08-14 13:47:51 +0100\nmessage:\n  First commit\n------------------------------------------------------------\nUse --include-merges or -n0 to see merged revisions.\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/GL/mat4stack.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include <stdlib.h>\n#include <memory.h>\n#include <assert.h>\n#include <stdio.h>\n\n#define INITIAL_SIZE 30\n#define INCREMENT 50\n\n#include \"kazmath/GL/mat4stack.h\"\n\nvoid km_mat4_stack_initialize(km_mat4_stack* stack) {\n    stack->stack = (kmMat4*) malloc(sizeof(kmMat4) * INITIAL_SIZE); //allocate the memory\n    stack->capacity = INITIAL_SIZE; //Set the capacity to 10\n    stack->top = NULL; //Set the top to NULL\n    stack->item_count = 0;\n};\n\nvoid km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item)\n{\n    stack->top = &stack->stack[stack->item_count];\n    kmMat4Assign(stack->top, item);\n    stack->item_count++;\n\n    if(stack->item_count >= stack->capacity)\n    {\n        kmMat4* temp = NULL;\n        stack->capacity += INCREMENT;\n        temp = stack->stack;\n        stack->stack = (kmMat4*) malloc(stack->capacity*sizeof(kmMat4));\n        memcpy(stack->stack, temp, sizeof(kmMat4)*(stack->capacity - INCREMENT));\n        free(temp);\n        stack->top = &stack->stack[stack->item_count - 1];\n    }\n}\n\nvoid km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut)\n{\n    assert(stack->item_count && \"Cannot pop an empty stack\");\n\n    stack->item_count--;\n    stack->top = &stack->stack[stack->item_count - 1];\n}\n\nvoid km_mat4_stack_release(km_mat4_stack* stack)\n{\n    if (stack->stack)\n    {\n        free(stack->stack);\n        stack->stack = NULL;\n    }\n    \n    stack->top = NULL;\n    stack->item_count = 0;\n    stack->capacity = 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/GL/matrix.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include <stdlib.h>\n#include <assert.h>\n\n#include \"kazmath/GL/matrix.h\"\n#include \"kazmath/GL/mat4stack.h\"\n\nkm_mat4_stack modelview_matrix_stack;\nkm_mat4_stack projection_matrix_stack;\nkm_mat4_stack texture_matrix_stack;\n\nkm_mat4_stack* current_stack = NULL;\n\nstatic unsigned char initialized = 0;\n\nvoid lazyInitialize()\n{\n\n    if (!initialized) {\n        kmMat4 identity; //Temporary identity matrix\n\n        //Initialize all 3 stacks\n        //modelview_matrix_stack = (km_mat4_stack*) malloc(sizeof(km_mat4_stack));\n        km_mat4_stack_initialize(&modelview_matrix_stack);\n\n        //projection_matrix_stack = (km_mat4_stack*) malloc(sizeof(km_mat4_stack));\n        km_mat4_stack_initialize(&projection_matrix_stack);\n\n        //texture_matrix_stack = (km_mat4_stack*) malloc(sizeof(km_mat4_stack));\n        km_mat4_stack_initialize(&texture_matrix_stack);\n\n        current_stack = &modelview_matrix_stack;\n        initialized = 1;\n\n        kmMat4Identity(&identity);\n\n        //Make sure that each stack has the identity matrix\n        km_mat4_stack_push(&modelview_matrix_stack, &identity);\n        km_mat4_stack_push(&projection_matrix_stack, &identity);\n        km_mat4_stack_push(&texture_matrix_stack, &identity);\n    }\n}\n\nvoid kmGLMatrixMode(kmGLEnum mode)\n{\n    lazyInitialize();\n\n    switch(mode)\n    {\n        case KM_GL_MODELVIEW:\n            current_stack = &modelview_matrix_stack;\n        break;\n        case KM_GL_PROJECTION:\n            current_stack = &projection_matrix_stack;\n        break;\n        case KM_GL_TEXTURE:\n            current_stack = &texture_matrix_stack;\n        break;\n        default:\n            assert(0 && \"Invalid matrix mode specified\"); //TODO: Proper error handling\n        break;\n    }\n}\n\nvoid kmGLPushMatrix(void)\n{\n    kmMat4 top;\n\n    lazyInitialize(); //Initialize the stacks if they haven't been already\n\n    //Duplicate the top of the stack (i.e the current matrix)\n    kmMat4Assign(&top, current_stack->top);\n    km_mat4_stack_push(current_stack, &top);\n}\n\nvoid kmGLPopMatrix(void)\n{\n    assert(initialized && \"Cannot Pop empty matrix stack\");\n    //No need to lazy initialize, you shouldn't be popping first anyway!\n    km_mat4_stack_pop(current_stack, NULL);\n}\n\nvoid kmGLLoadIdentity()\n{\n    lazyInitialize();\n\n    kmMat4Identity(current_stack->top); //Replace the top matrix with the identity matrix\n}\n\nvoid kmGLFreeAll()\n{\n    //Clear the matrix stacks\n    km_mat4_stack_release(&modelview_matrix_stack);\n    km_mat4_stack_release(&projection_matrix_stack);\n    km_mat4_stack_release(&texture_matrix_stack);\n\n    //Delete the matrices\n    initialized = 0; //Set to uninitialized\n\n    current_stack = NULL; //Set the current stack to point nowhere\n}\n\nvoid kmGLMultMatrix(const kmMat4* pIn)\n{\n    lazyInitialize();\n    kmMat4Multiply(current_stack->top, current_stack->top, pIn);\n}\n\nvoid kmGLLoadMatrix(const kmMat4* pIn)\n{\n    lazyInitialize();\n    kmMat4Assign(current_stack->top, pIn);\n}\n\nvoid kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut)\n{\n    lazyInitialize();\n\n    switch(mode)\n    {\n        case KM_GL_MODELVIEW:\n            kmMat4Assign(pOut, modelview_matrix_stack.top);\n        break;\n        case KM_GL_PROJECTION:\n            kmMat4Assign(pOut, projection_matrix_stack.top);\n        break;\n        case KM_GL_TEXTURE:\n            kmMat4Assign(pOut, texture_matrix_stack.top);\n        break;\n        default:\n            assert(1 && \"Invalid matrix mode specified\"); //TODO: Proper error handling\n        break;\n    }\n}\n\nvoid kmGLTranslatef(float x, float y, float z)\n{\n    kmMat4 translation;\n\n    //Create a rotation matrix using the axis and the angle\n    kmMat4Translation(&translation,x,y,z);\n\n    //Multiply the rotation matrix by the current matrix\n    kmMat4Multiply(current_stack->top, current_stack->top, &translation);\n}\n\nvoid kmGLRotatef(float angle, float x, float y, float z)\n{\n    kmVec3 axis;\n    kmMat4 rotation;\n\n    //Create an axis vector\n    kmVec3Fill(&axis, x, y, z);\n\n    //Create a rotation matrix using the axis and the angle\n    kmMat4RotationAxisAngle(&rotation, &axis, kmDegreesToRadians(angle));\n\n    //Multiply the rotation matrix by the current matrix\n    kmMat4Multiply(current_stack->top, current_stack->top, &rotation);\n}\n\nvoid kmGLScalef(float x, float y, float z)\n{\n    kmMat4 scaling;\n    kmMat4Scaling(&scaling, x, y, z);\n    kmMat4Multiply(current_stack->top, current_stack->top, &scaling);\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/aabb.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include \"kazmath/aabb.h\"\n\n/**\n * Returns KM_TRUE if point is in the specified AABB, returns\n * KM_FALSE otherwise.\n */\nconst int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox)\n{\n    if(pPoint->x >= pBox->min.x && pPoint->x <= pBox->max.x &&\n       pPoint->y >= pBox->min.y && pPoint->y <= pBox->max.y &&\n       pPoint->z >= pBox->min.z && pPoint->z <= pBox->max.z) {\n        return KM_TRUE;\n    }\n\n    return KM_FALSE;\n}\n\n/**\n * Assigns pIn to pOut, returns pOut.\n */\nkmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn)\n{\n    kmVec3Assign(&pOut->min, &pIn->min);\n    kmVec3Assign(&pOut->max, &pIn->max);\n    return pOut;\n}\n\n/**\n * Scales pIn by s, stores the resulting AABB in pOut. Returns pOut\n */\nkmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s)\n{\n    assert(0 && \"Not implemented\");\n    return 0;\n}\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/mat3.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include <stdlib.h>\n#include <memory.h>\n#include <assert.h>\n\n#include \"kazmath/utility.h\"\n#include \"kazmath/vec3.h\"\n#include \"kazmath/mat3.h\"\n#include \"kazmath/quaternion.h\"\n\nkmMat3* const kmMat3Fill(kmMat3* pOut, const kmScalar* pMat)\n{\n    memcpy(pOut->mat, pMat, sizeof(kmScalar) * 9);\n    return pOut;\n}\n\n/** Sets pOut to an identity matrix returns pOut*/\nkmMat3* const kmMat3Identity(kmMat3* pOut)\n{\n    memset(pOut->mat, 0, sizeof(float) * 9);\n    pOut->mat[0] = pOut->mat[4] = pOut->mat[8] = 1.0f;\n    return pOut;\n}\n\nconst kmScalar kmMat3Determinant(const kmMat3* pIn)\n{\n    kmScalar output;\n    /*\n    calculating the determinant following the rule of sarus,\n        | 0  3  6 | 0  3 |\n    m = | 1  4  7 | 1  4 |\n        | 2  5  8 | 2  5 |\n    now sum up the products of the diagonals going to the right (i.e. 0,4,8)\n    and subtract the products of the other diagonals (i.e. 2,4,6)\n    */\n\n    output = pIn->mat[0] * pIn->mat[4] * pIn->mat[8] + pIn->mat[1] * pIn->mat[5] * pIn->mat[6] + pIn->mat[2] * pIn->mat[3] * pIn->mat[7];\n    output -= pIn->mat[2] * pIn->mat[4] * pIn->mat[6] + pIn->mat[0] * pIn->mat[5] * pIn->mat[7] + pIn->mat[1] * pIn->mat[3] * pIn->mat[8];\n\n    return output;\n}\n\n\nkmMat3* const kmMat3Adjugate(kmMat3* pOut, const kmMat3* pIn)\n{\n    pOut->mat[0] = pIn->mat[4] * pIn->mat[8] - pIn->mat[5] * pIn->mat[7];\n    pOut->mat[1] = pIn->mat[2] * pIn->mat[7] - pIn->mat[1] * pIn->mat[8];\n    pOut->mat[2] = pIn->mat[1] * pIn->mat[5] - pIn->mat[2] * pIn->mat[4];\n    pOut->mat[3] = pIn->mat[5] * pIn->mat[6] - pIn->mat[3] * pIn->mat[8];\n    pOut->mat[4] = pIn->mat[0] * pIn->mat[8] - pIn->mat[2] * pIn->mat[6];\n    pOut->mat[5] = pIn->mat[2] * pIn->mat[3] - pIn->mat[0] * pIn->mat[5];\n    pOut->mat[6] = pIn->mat[3] * pIn->mat[7] - pIn->mat[4] * pIn->mat[6];\n\n    // XXX: pIn->mat[9] is invalid!\n//    pOut->mat[7] = pIn->mat[1] * pIn->mat[6] - pIn->mat[9] * pIn->mat[7];\n    pOut->mat[8] = pIn->mat[0] * pIn->mat[4] - pIn->mat[1] * pIn->mat[3];\n\n    return pOut;\n}\n\nkmMat3* const kmMat3Inverse(kmMat3* pOut, const kmScalar pDeterminate, const kmMat3* pM)\n{\n    kmScalar detInv;\n    kmMat3 adjugate;\n\n    if(pDeterminate == 0.0)\n    {\n        return NULL;\n    }\n\n    detInv = 1.0f / pDeterminate;\n\n    kmMat3Adjugate(&adjugate, pM);\n    kmMat3ScalarMultiply(pOut, &adjugate, detInv);\n\n    return pOut;\n}\n\n/** Returns true if pIn is an identity matrix */\nconst int kmMat3IsIdentity(const kmMat3* pIn)\n{\n    static const float identity [] = {     1.0f, 0.0f, 0.0f,\n                                        0.0f, 1.0f, 0.0f,\n                                        0.0f, 0.0f, 1.0f};\n\n    return (memcmp(identity, pIn->mat, sizeof(float) * 9) == 0);\n}\n\n/** Sets pOut to the transpose of pIn, returns pOut */\nkmMat3* const kmMat3Transpose(kmMat3* pOut, const kmMat3* pIn)\n{\n    int z, x;\n    for (z = 0; z < 3; ++z) {\n        for (x = 0; x < 3; ++x) {\n            pOut->mat[(z * 3) + x] = pIn->mat[(x * 3) + z];\n        }\n    }\n\n    return pOut;\n}\n\n/* Multiplies pM1 with pM2, stores the result in pOut, returns pOut */\nkmMat3* const kmMat3Multiply(kmMat3* pOut, const kmMat3* pM1, const kmMat3* pM2)\n{\n    float mat[9];\n\n    const float *m1 = pM1->mat, *m2 = pM2->mat;\n\n    mat[0] = m1[0] * m2[0] + m1[3] * m2[1] + m1[6] * m2[2];\n    mat[1] = m1[1] * m2[0] + m1[4] * m2[1] + m1[7] * m2[2];\n    mat[2] = m1[2] * m2[0] + m1[5] * m2[1] + m1[8] * m2[2];\n\n    mat[3] = m1[0] * m2[3] + m1[3] * m2[4] + m1[6] * m2[5];\n    mat[4] = m1[1] * m2[3] + m1[4] * m2[4] + m1[7] * m2[5];\n    mat[5] = m1[2] * m2[3] + m1[5] * m2[4] + m1[8] * m2[5];\n\n    mat[6] = m1[0] * m2[6] + m1[3] * m2[7] + m1[6] * m2[8];\n    mat[7] = m1[1] * m2[6] + m1[4] * m2[7] + m1[7] * m2[8];\n    mat[8] = m1[2] * m2[6] + m1[5] * m2[7] + m1[8] * m2[8];\n\n    memcpy(pOut->mat, mat, sizeof(float)*9);\n\n    return pOut;\n}\n\nkmMat3* const kmMat3ScalarMultiply(kmMat3* pOut, const kmMat3* pM, const kmScalar pFactor)\n{\n    float mat[9];\n    int i;\n\n    for(i = 0; i < 9; i++)\n    {\n        mat[i] = pM->mat[i] * pFactor;\n    }\n\n    memcpy(pOut->mat, mat, sizeof(float)*9);\n\n    return pOut;\n}\n\n/** Assigns the value of pIn to pOut */\nkmMat3* const kmMat3Assign(kmMat3* pOut, const kmMat3* pIn)\n{\n    assert(pOut != pIn); //You have tried to self-assign!!\n\n    memcpy(pOut->mat, pIn->mat, sizeof(float)*9);\n\n    return pOut;\n}\n\n/** Returns true if the 2 matrices are equal (approximately) */\nconst int kmMat3AreEqual(const kmMat3* pMat1, const kmMat3* pMat2)\n{\n    int i;\n    if (pMat1 == pMat2) {\n        return KM_TRUE;\n    }\n\n    for (i = 0; i < 9; ++i) {\n        if (!(pMat1->mat[i] + kmEpsilon > pMat2->mat[i] &&\n            pMat1->mat[i] - kmEpsilon < pMat2->mat[i])) {\n            return KM_FALSE;\n        }\n    }\n\n    return KM_TRUE;\n}\n\n/* Rotation around the z axis so everything stays planar in XY */\nkmMat3* const kmMat3Rotation(kmMat3* pOut, const float radians)\n{\n    /*\n         |  cos(A)  -sin(A)   0  |\n     M = |  sin(A)   cos(A)   0  |\n         |  0        0        1  |\n    */\n\n    pOut->mat[0] = cosf(radians);\n    pOut->mat[1] = sinf(radians);\n    pOut->mat[2] = 0.0f;\n\n    pOut->mat[3] = -sinf(radians);;\n    pOut->mat[4] = cosf(radians);\n    pOut->mat[5] = 0.0f;\n\n    pOut->mat[6] = 0.0f;\n    pOut->mat[7] = 0.0f;\n    pOut->mat[8] = 1.0f;\n\n    return pOut;\n}\n\n/** Builds a scaling matrix */\nkmMat3* const kmMat3Scaling(kmMat3* pOut, const kmScalar x, const kmScalar y)\n{\n//    memset(pOut->mat, 0, sizeof(float) * 9);\n    kmMat3Identity(pOut);\n    pOut->mat[0] = x;\n    pOut->mat[4] = y;\n\n    return pOut;\n}\n\nkmMat3* const kmMat3Translation(kmMat3* pOut, const kmScalar x, const kmScalar y)\n{\n//    memset(pOut->mat, 0, sizeof(float) * 9);\n    kmMat3Identity(pOut);\n    pOut->mat[6] = x;\n    pOut->mat[7] = y;\n//    pOut->mat[8] = 1.0;\n\n    return pOut;\n}\n\n\nkmMat3* const kmMat3RotationQuaternion(kmMat3* pOut, const kmQuaternion* pIn)\n{\n    if (!pIn || !pOut) {\n    return NULL;\n    }\n\n    // First row\n    pOut->mat[0] = 1.0f - 2.0f * (pIn->y * pIn->y + pIn->z * pIn->z);\n    pOut->mat[1] = 2.0f * (pIn->x * pIn->y - pIn->w * pIn->z);\n    pOut->mat[2] = 2.0f * (pIn->x * pIn->z + pIn->w * pIn->y);\n\n    // Second row\n    pOut->mat[3] = 2.0f * (pIn->x * pIn->y + pIn->w * pIn->z);\n    pOut->mat[4] = 1.0f - 2.0f * (pIn->x * pIn->x + pIn->z * pIn->z);\n    pOut->mat[5] = 2.0f * (pIn->y * pIn->z - pIn->w * pIn->x);\n\n    // Third row\n    pOut->mat[6] = 2.0f * (pIn->x * pIn->z - pIn->w * pIn->y);\n    pOut->mat[7] = 2.0f * (pIn->y * pIn->z + pIn->w * pIn->x);\n    pOut->mat[8] = 1.0f - 2.0f * (pIn->x * pIn->x + pIn->y * pIn->y);\n\n    return pOut;\n}\n\nkmMat3* const kmMat3RotationAxisAngle(kmMat3* pOut, const struct kmVec3* axis, kmScalar radians)\n{\n    float rcos = cosf(radians);\n    float rsin = sinf(radians);\n\n    pOut->mat[0] = rcos + axis->x * axis->x * (1 - rcos);\n    pOut->mat[1] = axis->z * rsin + axis->y * axis->x * (1 - rcos);\n    pOut->mat[2] = -axis->y * rsin + axis->z * axis->x * (1 - rcos);\n\n    pOut->mat[3] = -axis->z * rsin + axis->x * axis->y * (1 - rcos);\n    pOut->mat[4] = rcos + axis->y * axis->y * (1 - rcos);\n    pOut->mat[5] = axis->x * rsin + axis->z * axis->y * (1 - rcos);\n\n    pOut->mat[6] = axis->y * rsin + axis->x * axis->z * (1 - rcos);\n    pOut->mat[7] = -axis->x * rsin + axis->y * axis->z * (1 - rcos);\n    pOut->mat[8] = rcos + axis->z * axis->z * (1 - rcos);\n\n    return pOut;\n}\n\nkmVec3* const kmMat3RotationToAxisAngle(kmVec3* pAxis, kmScalar* radians, const kmMat3* pIn)\n{\n    /*Surely not this easy?*/\n    kmQuaternion temp;\n    kmQuaternionRotationMatrix(&temp, pIn);\n    kmQuaternionToAxisAngle(&temp, pAxis, radians);\n    return pAxis;\n}\n\n/**\n * Builds an X-axis rotation matrix and stores it in pOut, returns pOut\n */\nkmMat3* const kmMat3RotationX(kmMat3* pOut, const float radians)\n{\n    /*\n         |  1  0       0      |\n     M = |  0  cos(A) -sin(A) |\n         |  0  sin(A)  cos(A) |\n\n    */\n\n    pOut->mat[0] = 1.0f;\n    pOut->mat[1] = 0.0f;\n    pOut->mat[2] = 0.0f;\n\n    pOut->mat[3] = 0.0f;\n    pOut->mat[4] = cosf(radians);\n    pOut->mat[5] = sinf(radians);\n\n    pOut->mat[6] = 0.0f;\n    pOut->mat[7] = -sinf(radians);\n    pOut->mat[8] = cosf(radians);\n\n    return pOut;\n}\n\n/**\n * Builds a rotation matrix using the rotation around the Y-axis\n * The result is stored in pOut, pOut is returned.\n */\nkmMat3* const kmMat3RotationY(kmMat3* pOut, const float radians)\n{\n    /*\n         |  cos(A)  0   sin(A) |\n     M = |  0       1   0      |\n         | -sin(A)  0   cos(A) |\n    */\n\n    pOut->mat[0] = cosf(radians);\n    pOut->mat[1] = 0.0f;\n    pOut->mat[2] = -sinf(radians);\n\n    pOut->mat[3] = 0.0f;\n    pOut->mat[4] = 1.0f;\n    pOut->mat[5] = 0.0f;\n\n    pOut->mat[6] = sinf(radians);\n    pOut->mat[7] = 0.0f;\n    pOut->mat[8] = cosf(radians);\n\n    return pOut;\n}\n\n/**\n * Builds a rotation matrix around the Z-axis. The resulting\n * matrix is stored in pOut. pOut is returned.\n */\nkmMat3* const kmMat3RotationZ(kmMat3* pOut, const float radians)\n{\n    /*\n         |  cos(A)  -sin(A)   0  |\n     M = |  sin(A)   cos(A)   0  |\n         |  0        0        1  |\n    */\n\n    pOut->mat[0] = cosf(radians);\n    pOut->mat[1] =-sinf(radians);\n    pOut->mat[2] = 0.0f;\n\n    pOut->mat[3] = sinf(radians);;\n    pOut->mat[4] = cosf(radians);\n    pOut->mat[5] = 0.0f;\n\n    pOut->mat[6] = 0.0f;\n    pOut->mat[7] = 0.0f;\n    pOut->mat[8] = 1.0f;\n\n    return pOut;\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/mat4.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/**\n * @file mat4.c\n */\n#include <memory.h>\n#include <assert.h>\n#include <stdlib.h>\n\n#include \"kazmath/utility.h\"\n#include \"kazmath/vec3.h\"\n#include \"kazmath/mat4.h\"\n#include \"kazmath/mat3.h\"\n#include \"kazmath/quaternion.h\"\n#include \"kazmath/plane.h\"\n\n#include \"kazmath/neon_matrix_impl.h\"\n\n/**\n * Fills a kmMat4 structure with the values from a 16\n * element array of floats\n * @Params pOut - A pointer to the destination matrix\n *            pMat - A 16 element array of floats\n * @Return Returns pOut so that the call can be nested\n */\nkmMat4* const kmMat4Fill(kmMat4* pOut, const kmScalar* pMat)\n{\n    memcpy(pOut->mat, pMat, sizeof(kmScalar) * 16);\n    return pOut;\n}\n\n/**\n * Sets pOut to an identity matrix returns pOut\n * @Params pOut - A pointer to the matrix to set to identity\n * @Return Returns pOut so that the call can be nested\n */\nkmMat4* const kmMat4Identity(kmMat4* pOut)\n{\n    memset(pOut->mat, 0, sizeof(float) * 16);\n    pOut->mat[0] = pOut->mat[5] = pOut->mat[10] = pOut->mat[15] = 1.0f;\n    return pOut;\n}\n\n\nfloat get(const kmMat4 * pIn, int row, int col)\n{\n    return pIn->mat[row + 4*col];\n}\n\nvoid set(kmMat4 * pIn, int row, int col, float value)\n{\n    pIn->mat[row + 4*col] = value;\n}\n\nvoid swap(kmMat4 * pIn, int r1, int c1, int r2, int c2)\n{\n    float tmp = get(pIn,r1,c1);\n    set(pIn,r1,c1,get(pIn,r2,c2));\n    set(pIn,r2,c2, tmp);\n}\n\n//Returns an upper and a lower triangular matrix which are L and R in the Gauss algorithm\nint gaussj(kmMat4 *a, kmMat4 *b)\n{\n    int i, icol = 0, irow = 0, j, k, l, ll, n = 4, m = 4;\n    float big, dum, pivinv;\n    int indxc[4] = {0};\n    int indxr[4] = {0};\n    int ipiv[4] = {0};\n\n    for (j = 0; j < n; j++) {\n        ipiv[j] = 0;\n    }\n\n    for (i = 0; i < n; i++) {\n        big = 0.0f;\n        for (j = 0; j < n; j++) {\n            if (ipiv[j] != 1) {\n                for (k = 0; k < n; k++) {\n                    if (ipiv[k] == 0) {\n                        if (abs(get(a,j, k)) >= big) {\n                            big = abs(get(a,j, k));\n                            irow = j;\n                            icol = k;\n                        }\n                    }\n                }\n            }\n        }\n        ++(ipiv[icol]);\n        if (irow != icol) {\n            for (l = 0; l < n; l++) {\n                swap(a,irow, l, icol, l);\n            }\n            for (l = 0; l < m; l++) {\n                swap(b,irow, l, icol, l);\n            }\n        }\n        indxr[i] = irow;\n        indxc[i] = icol;\n        if (get(a,icol, icol) == 0.0) {\n            return KM_FALSE;\n        }\n        pivinv = 1.0f / get(a,icol, icol);\n        set(a,icol, icol, 1.0f);\n        for (l = 0; l < n; l++) {\n            set(a,icol, l, get(a,icol, l) * pivinv);\n        }\n        for (l = 0; l < m; l++) {\n            set(b,icol, l, get(b,icol, l) * pivinv);\n        }\n\n        for (ll = 0; ll < n; ll++) {\n            if (ll != icol) {\n                dum = get(a,ll, icol);\n                set(a,ll, icol, 0.0f);\n                for (l = 0; l < n; l++) {\n                    set(a,ll, l, get(a,ll, l) - get(a,icol, l) * dum);\n                }\n                for (l = 0; l < m; l++) {\n                    set(b,ll, l, get(a,ll, l) - get(b,icol, l) * dum);\n                }\n            }\n        }\n    }\n//    This is the end of the main loop over columns of the reduction. It only remains to unscram-\n//    ble the solution in view of the column interchanges. We do this by interchanging pairs of\n//    columns in the reverse order that the permutation was built up.\n    for (l = n - 1; l >= 0; l--) {\n        if (indxr[l] != indxc[l]) {\n            for (k = 0; k < n; k++) {\n                swap(a,k, indxr[l], k, indxc[l]);\n            }\n        }\n    }\n    return KM_TRUE;\n}\n\n/**\n * Calculates the inverse of pM and stores the result in\n * pOut.\n * @Return Returns NULL if there is no inverse, else pOut\n */\nkmMat4* const kmMat4Inverse(kmMat4* pOut, const kmMat4* pM)\n{\n    kmMat4 inv;\n    kmMat4 tmp;\n\n    kmMat4Assign(&inv, pM);\n\n    kmMat4Identity(&tmp);\n\n    if(gaussj(&inv, &tmp) == KM_FALSE) {\n        return NULL;\n    }\n\n    kmMat4Assign(pOut, &inv);\n    return pOut;\n}\n/**\n * Returns KM_TRUE if pIn is an identity matrix\n * KM_FALSE otherwise\n */\nconst int  kmMat4IsIdentity(const kmMat4* pIn)\n{\n    static const float identity [] = {     1.0f, 0.0f, 0.0f, 0.0f,\n                                        0.0f, 1.0f, 0.0f, 0.0f,\n                                        0.0f, 0.0f, 1.0f, 0.0f,\n                                        0.0f, 0.0f, 0.0f, 1.0f\n                                     };\n\n    return (memcmp(identity, pIn->mat, sizeof(float) * 16) == 0);\n}\n\n/**\n * Sets pOut to the transpose of pIn, returns pOut\n */\nkmMat4* const kmMat4Transpose(kmMat4* pOut, const kmMat4* pIn)\n{\n    int x, z;\n\n    for (z = 0; z < 4; ++z) {\n        for (x = 0; x < 4; ++x) {\n        pOut->mat[(z * 4) + x] = pIn->mat[(x * 4) + z];\n        }\n    }\n\n    return pOut;\n}\n\n/**\n * Multiplies pM1 with pM2, stores the result in pOut, returns pOut\n */\nkmMat4* const kmMat4Multiply(kmMat4* pOut, const kmMat4* pM1, const kmMat4* pM2)\n{\n#if defined(__ARM_NEON__) && !defined(__arm64__)\n\n    // It is possible to skip the memcpy() since \"out\" does not overwrite p1 or p2.\n    // otherwise a temp must be needed.\n    float *mat = pOut->mat;\n\n    // Invert column-order with row-order\n    NEON_Matrix4Mul( &pM2->mat[0], &pM1->mat[0], &mat[0] );\n\n#else\n    float mat[16];\n\n    const float *m1 = pM1->mat, *m2 = pM2->mat;\n\n    mat[0] = m1[0] * m2[0] + m1[4] * m2[1] + m1[8] * m2[2] + m1[12] * m2[3];\n    mat[1] = m1[1] * m2[0] + m1[5] * m2[1] + m1[9] * m2[2] + m1[13] * m2[3];\n    mat[2] = m1[2] * m2[0] + m1[6] * m2[1] + m1[10] * m2[2] + m1[14] * m2[3];\n    mat[3] = m1[3] * m2[0] + m1[7] * m2[1] + m1[11] * m2[2] + m1[15] * m2[3];\n\n    mat[4] = m1[0] * m2[4] + m1[4] * m2[5] + m1[8] * m2[6] + m1[12] * m2[7];\n    mat[5] = m1[1] * m2[4] + m1[5] * m2[5] + m1[9] * m2[6] + m1[13] * m2[7];\n    mat[6] = m1[2] * m2[4] + m1[6] * m2[5] + m1[10] * m2[6] + m1[14] * m2[7];\n    mat[7] = m1[3] * m2[4] + m1[7] * m2[5] + m1[11] * m2[6] + m1[15] * m2[7];\n\n    mat[8] = m1[0] * m2[8] + m1[4] * m2[9] + m1[8] * m2[10] + m1[12] * m2[11];\n    mat[9] = m1[1] * m2[8] + m1[5] * m2[9] + m1[9] * m2[10] + m1[13] * m2[11];\n    mat[10] = m1[2] * m2[8] + m1[6] * m2[9] + m1[10] * m2[10] + m1[14] * m2[11];\n    mat[11] = m1[3] * m2[8] + m1[7] * m2[9] + m1[11] * m2[10] + m1[15] * m2[11];\n\n    mat[12] = m1[0] * m2[12] + m1[4] * m2[13] + m1[8] * m2[14] + m1[12] * m2[15];\n    mat[13] = m1[1] * m2[12] + m1[5] * m2[13] + m1[9] * m2[14] + m1[13] * m2[15];\n    mat[14] = m1[2] * m2[12] + m1[6] * m2[13] + m1[10] * m2[14] + m1[14] * m2[15];\n    mat[15] = m1[3] * m2[12] + m1[7] * m2[13] + m1[11] * m2[14] + m1[15] * m2[15];\n\n    memcpy(pOut->mat, mat, sizeof(pOut->mat));\n\n#endif\n\n    return pOut;\n}\n\n/**\n * Assigns the value of pIn to pOut\n */\nkmMat4* const kmMat4Assign(kmMat4* pOut, const kmMat4* pIn)\n{\n    assert(pOut != pIn && \"You have tried to self-assign!!\");\n\n    memcpy(pOut->mat, pIn->mat, sizeof(float)*16);\n\n    return pOut;\n}\n\n/**\n * Returns KM_TRUE if the 2 matrices are equal (approximately)\n */\nconst int kmMat4AreEqual(const kmMat4* pMat1, const kmMat4* pMat2)\n{\n    int i = 0;\n\n    assert(pMat1 != pMat2 && \"You are comparing the same thing!\");\n\n    for (i = 0; i < 16; ++i)\n    {\n        if (!(pMat1->mat[i] + kmEpsilon > pMat2->mat[i] &&\n            pMat1->mat[i] - kmEpsilon < pMat2->mat[i])) {\n            return KM_FALSE;\n        }\n    }\n\n    return KM_TRUE;\n}\n\n/**\n * Build a rotation matrix from an axis and an angle. Result is stored in pOut.\n * pOut is returned.\n */\nkmMat4* const kmMat4RotationAxisAngle(kmMat4* pOut, const kmVec3* axis, kmScalar radians)\n{\n    float rcos = cosf(radians);\n    float rsin = sinf(radians);\n\n    kmVec3 normalizedAxis;\n    kmVec3Normalize(&normalizedAxis, axis);\n\n    pOut->mat[0] = rcos + normalizedAxis.x * normalizedAxis.x * (1 - rcos);\n    pOut->mat[1] = normalizedAxis.z * rsin + normalizedAxis.y * normalizedAxis.x * (1 - rcos);\n    pOut->mat[2] = -normalizedAxis.y * rsin + normalizedAxis.z * normalizedAxis.x * (1 - rcos);\n    pOut->mat[3] = 0.0f;\n\n    pOut->mat[4] = -normalizedAxis.z * rsin + normalizedAxis.x * normalizedAxis.y * (1 - rcos);\n    pOut->mat[5] = rcos + normalizedAxis.y * normalizedAxis.y * (1 - rcos);\n    pOut->mat[6] = normalizedAxis.x * rsin + normalizedAxis.z * normalizedAxis.y * (1 - rcos);\n    pOut->mat[7] = 0.0f;\n\n    pOut->mat[8] = normalizedAxis.y * rsin + normalizedAxis.x * normalizedAxis.z * (1 - rcos);\n    pOut->mat[9] = -normalizedAxis.x * rsin + normalizedAxis.y * normalizedAxis.z * (1 - rcos);\n    pOut->mat[10] = rcos + normalizedAxis.z * normalizedAxis.z * (1 - rcos);\n    pOut->mat[11] = 0.0f;\n\n    pOut->mat[12] = 0.0f;\n    pOut->mat[13] = 0.0f;\n    pOut->mat[14] = 0.0f;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\n/**\n * Builds an X-axis rotation matrix and stores it in pOut, returns pOut\n */\nkmMat4* const kmMat4RotationX(kmMat4* pOut, const float radians)\n{\n    /*\n         |  1  0       0       0 |\n     M = |  0  cos(A) -sin(A)  0 |\n         |  0  sin(A)  cos(A)  0 |\n         |  0  0       0       1 |\n\n    */\n\n    pOut->mat[0] = 1.0f;\n    pOut->mat[1] = 0.0f;\n    pOut->mat[2] = 0.0f;\n    pOut->mat[3] = 0.0f;\n\n    pOut->mat[4] = 0.0f;\n    pOut->mat[5] = cosf(radians);\n    pOut->mat[6] = sinf(radians);\n    pOut->mat[7] = 0.0f;\n\n    pOut->mat[8] = 0.0f;\n    pOut->mat[9] = -sinf(radians);\n    pOut->mat[10] = cosf(radians);\n    pOut->mat[11] = 0.0f;\n\n    pOut->mat[12] = 0.0f;\n    pOut->mat[13] = 0.0f;\n    pOut->mat[14] = 0.0f;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\n/**\n * Builds a rotation matrix using the rotation around the Y-axis\n * The result is stored in pOut, pOut is returned.\n */\nkmMat4* const kmMat4RotationY(kmMat4* pOut, const float radians)\n{\n    /*\n         |  cos(A)  0   sin(A)  0 |\n     M = |  0       1   0       0 |\n         | -sin(A)  0   cos(A)  0 |\n         |  0       0   0       1 |\n    */\n\n    pOut->mat[0] = cosf(radians);\n    pOut->mat[1] = 0.0f;\n    pOut->mat[2] = -sinf(radians);\n    pOut->mat[3] = 0.0f;\n\n    pOut->mat[4] = 0.0f;\n    pOut->mat[5] = 1.0f;\n    pOut->mat[6] = 0.0f;\n    pOut->mat[7] = 0.0f;\n\n    pOut->mat[8] = sinf(radians);\n    pOut->mat[9] = 0.0f;\n    pOut->mat[10] = cosf(radians);\n    pOut->mat[11] = 0.0f;\n\n    pOut->mat[12] = 0.0f;\n    pOut->mat[13] = 0.0f;\n    pOut->mat[14] = 0.0f;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\n/**\n * Builds a rotation matrix around the Z-axis. The resulting\n * matrix is stored in pOut. pOut is returned.\n */\nkmMat4* const kmMat4RotationZ(kmMat4* pOut, const float radians)\n{\n    /*\n         |  cos(A)  -sin(A)   0   0 |\n     M = |  sin(A)   cos(A)   0   0 |\n         |  0        0        1   0 |\n         |  0        0        0   1 |\n    */\n\n    pOut->mat[0] = cosf(radians);\n    pOut->mat[1] = sinf(radians);\n    pOut->mat[2] = 0.0f;\n    pOut->mat[3] = 0.0f;\n\n    pOut->mat[4] = -sinf(radians);;\n    pOut->mat[5] = cosf(radians);\n    pOut->mat[6] = 0.0f;\n    pOut->mat[7] = 0.0f;\n\n    pOut->mat[8] = 0.0f;\n    pOut->mat[9] = 0.0f;\n    pOut->mat[10] = 1.0f;\n    pOut->mat[11] = 0.0f;\n\n    pOut->mat[12] = 0.0f;\n    pOut->mat[13] = 0.0f;\n    pOut->mat[14] = 0.0f;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\n/**\n * Builds a rotation matrix from pitch, yaw and roll. The resulting\n * matrix is stored in pOut and pOut is returned\n */\nkmMat4* const kmMat4RotationPitchYawRoll(kmMat4* pOut, const kmScalar pitch, const kmScalar yaw, const kmScalar roll)\n{\n    double cr = cos(pitch);\n    double sr = sin(pitch);\n    double cp = cos(yaw);\n    double sp = sin(yaw);\n    double cy = cos(roll);\n    double sy = sin(roll);\n    double srsp = sr * sp;\n    double crsp = cr * sp;\n\n    pOut->mat[0] = (kmScalar) cp * cy;\n    pOut->mat[4] = (kmScalar) cp * sy;\n    pOut->mat[8] = (kmScalar) - sp;\n\n    pOut->mat[1] = (kmScalar) srsp * cy - cr * sy;\n    pOut->mat[5] = (kmScalar) srsp * sy + cr * cy;\n    pOut->mat[9] = (kmScalar) sr * cp;\n\n    pOut->mat[2] = (kmScalar) crsp * cy + sr * sy;\n    pOut->mat[6] = (kmScalar) crsp * sy - sr * cy;\n    pOut->mat[10] = (kmScalar) cr * cp;\n\n    pOut->mat[3] = pOut->mat[7] = pOut->mat[11] = 0.0;\n    pOut->mat[15] = 1.0;\n\n    return pOut;\n}\n\n/** Converts a quaternion to a rotation matrix,\n * the result is stored in pOut, returns pOut\n */\nkmMat4* const kmMat4RotationQuaternion(kmMat4* pOut, const kmQuaternion* pQ)\n{\n    pOut->mat[0] = 1.0f - 2.0f * (pQ->y * pQ->y + pQ->z * pQ->z );\n    pOut->mat[1] = 2.0f * (pQ->x * pQ->y + pQ->z * pQ->w);\n    pOut->mat[2] = 2.0f * (pQ->x * pQ->z - pQ->y * pQ->w);\n    pOut->mat[3] = 0.0f;\n\n    // Second row\n    pOut->mat[4] = 2.0f * ( pQ->x * pQ->y - pQ->z * pQ->w );\n    pOut->mat[5] = 1.0f - 2.0f * ( pQ->x * pQ->x + pQ->z * pQ->z );\n    pOut->mat[6] = 2.0f * (pQ->z * pQ->y + pQ->x * pQ->w );\n    pOut->mat[7] = 0.0f;\n\n    // Third row\n    pOut->mat[8] = 2.0f * ( pQ->x * pQ->z + pQ->y * pQ->w );\n    pOut->mat[9] = 2.0f * ( pQ->y * pQ->z - pQ->x * pQ->w );\n    pOut->mat[10] = 1.0f - 2.0f * ( pQ->x * pQ->x + pQ->y * pQ->y );\n    pOut->mat[11] = 0.0f;\n\n    // Fourth row\n    pOut->mat[12] = 0;\n    pOut->mat[13] = 0;\n    pOut->mat[14] = 0;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\n/** Builds a scaling matrix */\nkmMat4* const kmMat4Scaling(kmMat4* pOut, const kmScalar x, const kmScalar y,\n                      const kmScalar z)\n{\n    memset(pOut->mat, 0, sizeof(float) * 16);\n    pOut->mat[0] = x;\n    pOut->mat[5] = y;\n    pOut->mat[10] = z;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\n/**\n * Builds a translation matrix. All other elements in the matrix\n * will be set to zero except for the diagonal which is set to 1.0\n */\nkmMat4* const kmMat4Translation(kmMat4* pOut, const kmScalar x,\n                          const kmScalar y, const kmScalar z)\n{\n    //FIXME: Write a test for this\n    memset(pOut->mat, 0, sizeof(float) * 16);\n\n    pOut->mat[0] = 1.0f;\n    pOut->mat[5] = 1.0f;\n    pOut->mat[10] = 1.0f;\n\n    pOut->mat[12] = x;\n    pOut->mat[13] = y;\n    pOut->mat[14] = z;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\n/**\n * Get the up vector from a matrix. pIn is the matrix you\n * wish to extract the vector from. pOut is a pointer to the\n * kmVec3 structure that should hold the resulting vector\n */\nkmVec3* const kmMat4GetUpVec3(kmVec3* pOut, const kmMat4* pIn)\n{\n    pOut->x = pIn->mat[4];\n    pOut->y = pIn->mat[5];\n    pOut->z = pIn->mat[6];\n\n    kmVec3Normalize(pOut, pOut);\n\n    return pOut;\n}\n\n/** Extract the right vector from a 4x4 matrix. The result is\n * stored in pOut. Returns pOut.\n */\nkmVec3* const kmMat4GetRightVec3(kmVec3* pOut, const kmMat4* pIn)\n{\n    pOut->x = pIn->mat[0];\n    pOut->y = pIn->mat[1];\n    pOut->z = pIn->mat[2];\n\n    kmVec3Normalize(pOut, pOut);\n\n    return pOut;\n}\n\n/**\n * Extract the forward vector from a 4x4 matrix. The result is\n * stored in pOut. Returns pOut.\n */\nkmVec3* const kmMat4GetForwardVec3(kmVec3* pOut, const kmMat4* pIn)\n{\n    pOut->x = pIn->mat[8];\n    pOut->y = pIn->mat[9];\n    pOut->z = pIn->mat[10];\n\n    kmVec3Normalize(pOut, pOut);\n\n    return pOut;\n}\n\n/**\n * Creates a perspective projection matrix in the\n * same way as gluPerspective\n */\nkmMat4* const kmMat4PerspectiveProjection(kmMat4* pOut, kmScalar fovY,\n                                    kmScalar aspect, kmScalar zNear,\n                                    kmScalar zFar)\n{\n    kmScalar r = kmDegreesToRadians(fovY / 2);\n    kmScalar deltaZ = zFar - zNear;\n    kmScalar s = sin(r);\n    kmScalar cotangent = 0;\n\n    if (deltaZ == 0 || s == 0 || aspect == 0) {\n        return NULL;\n    }\n\n    //cos(r) / sin(r) = cot(r)\n    cotangent = cos(r) / s;\n\n    kmMat4Identity(pOut);\n    pOut->mat[0] = cotangent / aspect;\n    pOut->mat[5] = cotangent;\n    pOut->mat[10] = -(zFar + zNear) / deltaZ;\n    pOut->mat[11] = -1;\n    pOut->mat[14] = -2 * zNear * zFar / deltaZ;\n    pOut->mat[15] = 0;\n\n    return pOut;\n}\n\n/** Creates an orthographic projection matrix like glOrtho */\nkmMat4* const kmMat4OrthographicProjection(kmMat4* pOut, kmScalar left,\n                                     kmScalar right, kmScalar bottom,\n                                     kmScalar top, kmScalar nearVal,\n                                     kmScalar farVal)\n{\n    kmScalar tx = -((right + left) / (right - left));\n    kmScalar ty = -((top + bottom) / (top - bottom));\n    kmScalar tz = -((farVal + nearVal) / (farVal - nearVal));\n\n    kmMat4Identity(pOut);\n    pOut->mat[0] = 2 / (right - left);\n    pOut->mat[5] = 2 / (top - bottom);\n    pOut->mat[10] = -2 / (farVal - nearVal);\n    pOut->mat[12] = tx;\n    pOut->mat[13] = ty;\n    pOut->mat[14] = tz;\n\n    return pOut;\n}\n\n/**\n * Builds a translation matrix in the same way as gluLookAt()\n * the resulting matrix is stored in pOut. pOut is returned.\n */\nkmMat4* const kmMat4LookAt(kmMat4* pOut, const kmVec3* pEye,\n                     const kmVec3* pCenter, const kmVec3* pUp)\n{\n    kmVec3 f, up, s, u;\n    kmMat4 translate;\n\n    kmVec3Subtract(&f, pCenter, pEye);\n    kmVec3Normalize(&f, &f);\n\n    kmVec3Assign(&up, pUp);\n    kmVec3Normalize(&up, &up);\n\n    kmVec3Cross(&s, &f, &up);\n    kmVec3Normalize(&s, &s);\n\n    kmVec3Cross(&u, &s, &f);\n    kmVec3Normalize(&s, &s);\n\n    kmMat4Identity(pOut);\n\n    pOut->mat[0] = s.x;\n    pOut->mat[4] = s.y;\n    pOut->mat[8] = s.z;\n\n    pOut->mat[1] = u.x;\n    pOut->mat[5] = u.y;\n    pOut->mat[9] = u.z;\n\n    pOut->mat[2] = -f.x;\n    pOut->mat[6] = -f.y;\n    pOut->mat[10] = -f.z;\n\n    kmMat4Translation(&translate, -pEye->x, -pEye->y, -pEye->z);\n    kmMat4Multiply(pOut, pOut, &translate);\n\n    return pOut;\n}\n\n/**\n * Extract a 3x3 rotation matrix from the input 4x4 transformation.\n * Stores the result in pOut, returns pOut\n */\nkmMat3* const kmMat4ExtractRotation(kmMat3* pOut, const kmMat4* pIn)\n{\n    pOut->mat[0] = pIn->mat[0];\n    pOut->mat[1] = pIn->mat[1];\n    pOut->mat[2] = pIn->mat[2];\n\n    pOut->mat[3] = pIn->mat[4];\n    pOut->mat[4] = pIn->mat[5];\n    pOut->mat[5] = pIn->mat[6];\n\n    pOut->mat[6] = pIn->mat[8];\n    pOut->mat[7] = pIn->mat[9];\n    pOut->mat[8] = pIn->mat[10];\n\n    return pOut;\n}\n\n/**\n * Take the rotation from a 4x4 transformation matrix, and return it as an axis and an angle (in radians)\n * returns the output axis.\n */\nkmVec3* const kmMat4RotationToAxisAngle(kmVec3* pAxis, kmScalar* radians, const kmMat4* pIn)\n{\n    /*Surely not this easy?*/\n    kmQuaternion temp;\n    kmMat3 rotation;\n    kmMat4ExtractRotation(&rotation, pIn);\n    kmQuaternionRotationMatrix(&temp, &rotation);\n    kmQuaternionToAxisAngle(&temp, pAxis, radians);\n    return pAxis;\n}\n\n/** Build a 4x4 OpenGL transformation matrix using a 3x3 rotation matrix,\n * and a 3d vector representing a translation. Assign the result to pOut,\n * pOut is also returned.\n */\nkmMat4* const kmMat4RotationTranslation(kmMat4* pOut, const kmMat3* rotation, const kmVec3* translation)\n{\n    pOut->mat[0] = rotation->mat[0];\n    pOut->mat[1] = rotation->mat[1];\n    pOut->mat[2] = rotation->mat[2];\n    pOut->mat[3] = 0.0f;\n\n    pOut->mat[4] = rotation->mat[3];\n    pOut->mat[5] = rotation->mat[4];\n    pOut->mat[6] = rotation->mat[5];\n    pOut->mat[7] = 0.0f;\n\n    pOut->mat[8] = rotation->mat[6];\n    pOut->mat[9] = rotation->mat[7];\n    pOut->mat[10] = rotation->mat[8];\n    pOut->mat[11] = 0.0f;\n\n    pOut->mat[12] = translation->x;\n    pOut->mat[13] = translation->y;\n    pOut->mat[14] = translation->z;\n    pOut->mat[15] = 1.0f;\n\n    return pOut;\n}\n\nkmPlane* const kmMat4ExtractPlane(kmPlane* pOut, const kmMat4* pIn, const kmEnum plane)\n{\n    float t = 1.0f;\n\n    switch(plane) {\n        case KM_PLANE_RIGHT:\n            pOut->a = pIn->mat[3] - pIn->mat[0];\n            pOut->b = pIn->mat[7] - pIn->mat[4];\n            pOut->c = pIn->mat[11] - pIn->mat[8];\n            pOut->d = pIn->mat[15] - pIn->mat[12];\n        break;\n        case KM_PLANE_LEFT:\n            pOut->a = pIn->mat[3] + pIn->mat[0];\n            pOut->b = pIn->mat[7] + pIn->mat[4];\n            pOut->c = pIn->mat[11] + pIn->mat[8];\n            pOut->d = pIn->mat[15] + pIn->mat[12];\n        break;\n        case KM_PLANE_BOTTOM:\n            pOut->a = pIn->mat[3] + pIn->mat[1];\n            pOut->b = pIn->mat[7] + pIn->mat[5];\n            pOut->c = pIn->mat[11] + pIn->mat[9];\n            pOut->d = pIn->mat[15] + pIn->mat[13];\n        break;\n        case KM_PLANE_TOP:\n            pOut->a = pIn->mat[3] - pIn->mat[1];\n            pOut->b = pIn->mat[7] - pIn->mat[5];\n            pOut->c = pIn->mat[11] - pIn->mat[9];\n            pOut->d = pIn->mat[15] - pIn->mat[13];\n        break;\n        case KM_PLANE_FAR:\n            pOut->a = pIn->mat[3] - pIn->mat[2];\n            pOut->b = pIn->mat[7] - pIn->mat[6];\n            pOut->c = pIn->mat[11] - pIn->mat[10];\n            pOut->d = pIn->mat[15] - pIn->mat[14];\n        break;\n        case KM_PLANE_NEAR:\n            pOut->a = pIn->mat[3] + pIn->mat[2];\n            pOut->b = pIn->mat[7] + pIn->mat[6];\n            pOut->c = pIn->mat[11] + pIn->mat[10];\n            pOut->d = pIn->mat[15] + pIn->mat[14];\n        break;\n        default:\n            assert(0 && \"Invalid plane index\");\n    }\n\n    t = sqrtf(pOut->a * pOut->a +\n                    pOut->b * pOut->b +\n                    pOut->c * pOut->c);\n    pOut->a /= t;\n    pOut->b /= t;\n    pOut->c /= t;\n    pOut->d /= t;\n\n    return pOut;\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/neon_matrix_impl.c",
    "content": "/*\n NEON math library for the iPhone / iPod touch\n\n Copyright (c) 2009 Justin Saunders\n\n This software is provided 'as-is', without any express or implied warranty.\n In no event will the authors be held liable for any damages arising\n from the use of this software.\n Permission is granted to anyone to use this software for any purpose,\n including commercial applications, and to alter it and redistribute it freely,\n subject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you must\n not claim that you wrote the original software. If you use this\n software in a product, an acknowledgment in the product documentation\n would be appreciated but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must\n not be misrepresented as being the original software.\n\n 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include \"kazmath/neon_matrix_impl.h\"\n\n#if defined(__ARM_NEON__) && !defined(__arm64__)\n\n\nvoid NEON_Matrix4Mul(const float* a, const float* b, float* output )\n{\n    __asm__ volatile\n    (\n     // Store A & B leaving room for q4-q7, which should be preserved\n     \"vldmia %1, { q0-q3 } \\n\\t\"\n     \"vldmia %2, { q8-q11 }\\n\\t\"\n\n     // result = first column of B x first row of A\n     \"vmul.f32 q12, q8, d0[0]\\n\\t\"\n     \"vmul.f32 q13, q8, d2[0]\\n\\t\"\n     \"vmul.f32 q14, q8, d4[0]\\n\\t\"\n     \"vmul.f32 q15, q8, d6[0]\\n\\t\"\n\n     // result += second column of B x second row of A\n     \"vmla.f32 q12, q9, d0[1]\\n\\t\"\n     \"vmla.f32 q13, q9, d2[1]\\n\\t\"\n     \"vmla.f32 q14, q9, d4[1]\\n\\t\"\n     \"vmla.f32 q15, q9, d6[1]\\n\\t\"\n\n     // result += third column of B x third row of A\n     \"vmla.f32 q12, q10, d1[0]\\n\\t\"\n     \"vmla.f32 q13, q10, d3[0]\\n\\t\"\n     \"vmla.f32 q14, q10, d5[0]\\n\\t\"\n     \"vmla.f32 q15, q10, d7[0]\\n\\t\"\n\n     // result += last column of B x last row of A\n     \"vmla.f32 q12, q11, d1[1]\\n\\t\"\n     \"vmla.f32 q13, q11, d3[1]\\n\\t\"\n     \"vmla.f32 q14, q11, d5[1]\\n\\t\"\n     \"vmla.f32 q15, q11, d7[1]\\n\\t\"\n\n     // output = result registers\n     \"vstmia %0, { q12-q15 }\"\n     : // no output\n     : \"r\" (output), \"r\" (a), \"r\" (b)     // input - note *value* of pointer doesn't change\n     : \"memory\", \"q0\", \"q1\", \"q2\", \"q3\", \"q8\", \"q9\", \"q10\", \"q11\", \"q12\", \"q13\", \"q14\", \"q15\" //clobber\n     );\n}\n\nvoid NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output)\n{\n    __asm__ volatile\n    (\n     // Store m & v - avoiding q4-q7 which need to be preserved - q0 = result\n     \"vldmia %1, { q8-q11 }    \\n\\t\"    // q8-q11 = m\n     \"vldmia %2, { q1 }        \\n\\t\"    // q1     = v\n\n     // result = first column of A x V.x\n     \"vmul.f32 q0, q8, d2[0]\\n\\t\"\n\n     // result += second column of A x V.y\n     \"vmla.f32 q0, q9, d2[1]\\n\\t\"\n\n     // result += third column of A x V.z\n     \"vmla.f32 q0, q10, d3[0]\\n\\t\"\n\n     // result += last column of A x V.w\n     \"vmla.f32 q0, q11, d3[1]\\n\\t\"\n\n     // output = result registers\n     \"vstmia %0, { q0 }\"\n\n     : // no output\n     : \"r\" (output), \"r\" (m), \"r\" (v)     // input - note *value* of pointer doesn't change\n     : \"memory\", \"q0\", \"q1\", \"q8\", \"q9\", \"q10\", \"q11\" //clobber\n     );\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/plane.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include <assert.h>\n#include <stdlib.h>\n\n#include \"kazmath/vec3.h\"\n#include \"kazmath/vec4.h\"\n#include \"kazmath/plane.h\"\n\nconst kmScalar kmPlaneDot(const kmPlane* pP, const kmVec4* pV)\n{\n    //a*x + b*y + c*z + d*w\n\n    return (pP->a * pV->x +\n        pP->b * pV->y +\n        pP->c * pV->z +\n        pP->d * pV->w);\n}\n\nconst kmScalar kmPlaneDotCoord(const kmPlane* pP, const kmVec3* pV)\n{\n    return (pP->a * pV->x +\n        pP->b * pV->y +\n        pP->c * pV->z + pP->d);\n}\n\nconst kmScalar kmPlaneDotNormal(const kmPlane* pP, const kmVec3* pV)\n{\n    return (pP->a * pV->x +\n        pP->b * pV->y +\n        pP->c * pV->z);\n}\n\nkmPlane* const kmPlaneFromPointNormal(kmPlane* pOut, const kmVec3* pPoint, const kmVec3* pNormal)\n{\n    /*\n    Planea = Nx\n    Planeb = Ny\n    Planec = Nz\n    Planed = −N⋅P\n    */\n\n\n    pOut->a = pNormal->x;\n    pOut->b = pNormal->y;\n    pOut->c = pNormal->z;\n    pOut->d = -kmVec3Dot(pNormal, pPoint);\n\n    return pOut;\n}\n\n/**\n * Creates a plane from 3 points. The result is stored in pOut.\n * pOut is returned.\n */\nkmPlane* const kmPlaneFromPoints(kmPlane* pOut, const kmVec3* p1, const kmVec3* p2, const kmVec3* p3)\n{\n    /*\n    v = (B − A) × (C − A)\n    n = 1⁄|v| v\n    Outa = nx\n    Outb = ny\n    Outc = nz\n    Outd = −n⋅A\n    */\n\n    kmVec3 n, v1, v2;\n    kmVec3Subtract(&v1, p2, p1); //Create the vectors for the 2 sides of the triangle\n    kmVec3Subtract(&v2, p3, p1);\n    kmVec3Cross(&n, &v1, &v2); //Use the cross product to get the normal\n\n    kmVec3Normalize(&n, &n); //Normalize it and assign to pOut->m_N\n\n    pOut->a = n.x;\n    pOut->b = n.y;\n    pOut->c = n.z;\n    pOut->d = kmVec3Dot(kmVec3Scale(&n, &n, -1.0), p1);\n\n    return pOut;\n}\n\nkmVec3* const kmPlaneIntersectLine(kmVec3* pOut, const kmPlane* pP, const kmVec3* pV1, const kmVec3* pV2)\n{\n    /*\n        n = (Planea, Planeb, Planec)\n        d = V − U\n        Out = U − d⋅(Pd + n⋅U)⁄(d⋅n) [iff d⋅n ≠ 0]\n    */\n    kmVec3 d;\n    assert(0 && \"Not implemented\");\n\n\n    kmVec3Subtract(&d, pV2, pV1); //Get the direction vector\n\n\n    //TODO: Continue here!\n    /*if (fabs(kmVec3Dot(&pP->m_N, &d)) > kmEpsilon)\n    {\n        //If we get here then the plane and line are parallel (i.e. no intersection)\n        pOut = nullptr; //Set to nullptr\n\n        return pOut;\n    } */\n\n    return NULL;\n}\n\nkmPlane* const kmPlaneNormalize(kmPlane* pOut, const kmPlane* pP)\n{\n    kmVec3 n;\n    kmScalar l = 0;\n\n    n.x = pP->a;\n    n.y = pP->b;\n    n.z = pP->c;\n\n    l = 1.0f / kmVec3Length(&n); //Get 1/length\n    kmVec3Normalize(&n, &n); //Normalize the vector and assign to pOut\n\n    pOut->a = n.x;\n    pOut->b = n.y;\n    pOut->c = n.z;\n\n    pOut->d = pP->d * l; //Scale the D value and assign to pOut\n\n    return pOut;\n}\n\nkmPlane* const kmPlaneScale(kmPlane* pOut, const kmPlane* pP, kmScalar s)\n{\n    assert(0 && \"Not implemented\");\n    return NULL;\n}\n\n/**\n * Returns POINT_INFRONT_OF_PLANE if pP is infront of pIn. Returns\n * POINT_BEHIND_PLANE if it is behind. Returns POINT_ON_PLANE otherwise\n */\nconst POINT_CLASSIFICATION kmPlaneClassifyPoint(const kmPlane* pIn, const kmVec3* pP)\n{\n   // This function will determine if a point is on, in front of, or behind\n   // the plane.  First we store the dot product of the plane and the point.\n   float distance = pIn->a * pP->x + pIn->b * pP->y + pIn->c * pP->z + pIn->d;\n\n   // Simply put if the dot product is greater than 0 then it is infront of it.\n   // If it is less than 0 then it is behind it.  And if it is 0 then it is on it.\n   if(distance > 0.001) return POINT_INFRONT_OF_PLANE;\n   if(distance < -0.001) return POINT_BEHIND_PLANE;\n\n   return POINT_ON_PLANE;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/quaternion.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\n#include <assert.h>\n#include <memory.h>\n\n#include \"kazmath/utility.h\"\n#include \"kazmath/mat3.h\"\n#include \"kazmath/vec3.h\"\n#include \"kazmath/quaternion.h\"\n\n#ifndef NULL\n#define NULL    ((void *)0)\n#endif\n\n///< Returns pOut, sets pOut to the conjugate of pIn\nkmQuaternion* const kmQuaternionConjugate(kmQuaternion* pOut, const kmQuaternion* pIn)\n{\n    pOut->x = -pIn->x;\n    pOut->y = -pIn->y;\n    pOut->z = -pIn->z;\n    pOut->w = pIn->w;\n\n    return pOut;\n}\n\n///< Returns the dot product of the 2 quaternions\nconst kmScalar kmQuaternionDot(const kmQuaternion* q1, const kmQuaternion* q2)\n{\n    // A dot B = B dot A = AtBt + AxBx + AyBy + AzBz\n\n    return (q1->w * q2->w +\n            q1->x * q2->x +\n            q1->y * q2->y +\n            q1->z * q2->z);\n}\n\n///< Returns the exponential of the quaternion\nkmQuaternion* kmQuaternionExp(kmQuaternion* pOut, const kmQuaternion* pIn)\n{\n    assert(0);\n\n    return pOut;\n}\n\n///< Makes the passed quaternion an identity quaternion\nkmQuaternion* kmQuaternionIdentity(kmQuaternion* pOut)\n{\n    pOut->x = 0.0;\n    pOut->y = 0.0;\n    pOut->z = 0.0;\n    pOut->w = 1.0;\n\n    return pOut;\n}\n\n///< Returns the inverse of the passed Quaternion\nkmQuaternion* kmQuaternionInverse(kmQuaternion* pOut,\n                                            const kmQuaternion* pIn)\n{\n    kmScalar l = kmQuaternionLength(pIn);\n    kmQuaternion tmp;\n\n    if (fabs(l) > kmEpsilon)\n    {\n        pOut->x = 0.0;\n        pOut->y = 0.0;\n        pOut->z = 0.0;\n        pOut->w = 0.0;\n\n        return pOut;\n    }\n\n\n\n    ///Get the conjugute and divide by the length\n    kmQuaternionScale(pOut,\n                kmQuaternionConjugate(&tmp, pIn), 1.0f / l);\n\n    return pOut;\n}\n\n///< Returns true if the quaternion is an identity quaternion\nint kmQuaternionIsIdentity(const kmQuaternion* pIn)\n{\n    return (pIn->x == 0.0 && pIn->y == 0.0 && pIn->z == 0.0 &&\n                pIn->w == 1.0);\n}\n\n///< Returns the length of the quaternion\nkmScalar kmQuaternionLength(const kmQuaternion* pIn)\n{\n    return sqrtf(kmQuaternionLengthSq(pIn));\n}\n\n///< Returns the length of the quaternion squared (prevents a sqrt)\nkmScalar kmQuaternionLengthSq(const kmQuaternion* pIn)\n{\n    return pIn->x * pIn->x + pIn->y * pIn->y +\n                        pIn->z * pIn->z + pIn->w * pIn->w;\n}\n\n///< Returns the natural logarithm\nkmQuaternion* kmQuaternionLn(kmQuaternion* pOut,\n                                        const kmQuaternion* pIn)\n{\n    /*\n        A unit quaternion, is defined by:\n        Q == (cos(theta), sin(theta) * v) where |v| = 1\n        The natural logarithm of Q is, ln(Q) = (0, theta * v)\n    */\n\n    assert(0);\n\n    return pOut;\n}\n\n///< Multiplies 2 quaternions together\nextern\nkmQuaternion* kmQuaternionMultiply(kmQuaternion* pOut,\n                                 const kmQuaternion* q1,\n                                 const kmQuaternion* q2)\n{\n    pOut->w = q1->w * q2->w - q1->x * q2->x - q1->y * q2->y - q1->z * q2->z;\n    pOut->x = q1->w * q2->x + q1->x * q2->w + q1->y * q2->z - q1->z * q2->y;\n    pOut->y = q1->w * q2->y + q1->y * q2->w + q1->z * q2->x - q1->x * q2->z;\n    pOut->z = q1->w * q2->z + q1->z * q2->w + q1->x * q2->y - q1->y * q2->x;\n\n    return pOut;\n}\n\n///< Normalizes a quaternion\nkmQuaternion* kmQuaternionNormalize(kmQuaternion* pOut,\n                                            const kmQuaternion* pIn)\n{\n    kmScalar length = kmQuaternionLength(pIn);\n    assert(fabs(length) > kmEpsilon);\n    kmQuaternionScale(pOut, pIn, 1.0f / length);\n\n    return pOut;\n}\n\n///< Rotates a quaternion around an axis\nkmQuaternion* kmQuaternionRotationAxis(kmQuaternion* pOut,\n                                    const kmVec3* pV,\n                                    kmScalar angle)\n{\n    kmScalar rad = angle * 0.5f;\n    kmScalar scale    = sinf(rad);\n\n    pOut->w = cosf(rad);\n    pOut->x = pV->x * scale;\n    pOut->y = pV->y * scale;\n    pOut->z = pV->z * scale;\n\n    return pOut;\n}\n\n///< Creates a quaternion from a rotation matrix\nkmQuaternion* kmQuaternionRotationMatrix(kmQuaternion* pOut,\n                                        const kmMat3* pIn)\n{\n/*\nNote: The OpenGL matrices are transposed from the description below\ntaken from the Matrix and Quaternion FAQ\n\n    if ( mat[0] > mat[5] && mat[0] > mat[10] )  {    // Column 0:\n        S  = sqrt( 1.0 + mat[0] - mat[5] - mat[10] ) * 2;\n        X = 0.25 * S;\n        Y = (mat[4] + mat[1] ) / S;\n        Z = (mat[2] + mat[8] ) / S;\n        W = (mat[9] - mat[6] ) / S;\n    } else if ( mat[5] > mat[10] ) {            // Column 1:\n        S  = sqrt( 1.0 + mat[5] - mat[0] - mat[10] ) * 2;\n        X = (mat[4] + mat[1] ) / S;\n        Y = 0.25 * S;\n        Z = (mat[9] + mat[6] ) / S;\n        W = (mat[2] - mat[8] ) / S;\n    } else {                        // Column 2:\n        S  = sqrt( 1.0 + mat[10] - mat[0] - mat[5] ) * 2;\n        X = (mat[2] + mat[8] ) / S;\n        Y = (mat[9] + mat[6] ) / S;\n        Z = 0.25 * S;\n        W = (mat[4] - mat[1] ) / S;\n    }\n*/\n\n    float x, y, z, w;\n    float *pMatrix = NULL;\n    float m4x4[16] = {0};\n    float scale = 0.0f;\n    float diagonal = 0.0f;\n\n    if(!pIn) {\n        return NULL;\n    }\n\n/*    0 3 6\n    1 4 7\n    2 5 8\n\n    0 1 2 3\n    4 5 6 7\n    8 9 10 11\n    12 13 14 15*/\n\n    m4x4[0]  = pIn->mat[0];\n    m4x4[1]  = pIn->mat[3];\n    m4x4[2]  = pIn->mat[6];\n    m4x4[4]  = pIn->mat[1];\n    m4x4[5]  = pIn->mat[4];\n    m4x4[6]  = pIn->mat[7];\n    m4x4[8]  = pIn->mat[2];\n    m4x4[9]  = pIn->mat[5];\n    m4x4[10] = pIn->mat[8];\n    m4x4[15] = 1;\n    pMatrix = &m4x4[0];\n\n    diagonal = pMatrix[0] + pMatrix[5] + pMatrix[10] + 1;\n\n    if(diagonal > kmEpsilon) {\n        // Calculate the scale of the diagonal\n        scale = (float)sqrt(diagonal ) * 2;\n\n        // Calculate the x, y, x and w of the quaternion through the respective equation\n        x = ( pMatrix[9] - pMatrix[6] ) / scale;\n        y = ( pMatrix[2] - pMatrix[8] ) / scale;\n        z = ( pMatrix[4] - pMatrix[1] ) / scale;\n        w = 0.25f * scale;\n    }\n    else\n    {\n        // If the first element of the diagonal is the greatest value\n        if ( pMatrix[0] > pMatrix[5] && pMatrix[0] > pMatrix[10] )\n        {\n            // Find the scale according to the first element, and double that value\n            scale = (float)sqrt( 1.0f + pMatrix[0] - pMatrix[5] - pMatrix[10] ) * 2.0f;\n\n            // Calculate the x, y, x and w of the quaternion through the respective equation\n            x = 0.25f * scale;\n            y = (pMatrix[4] + pMatrix[1] ) / scale;\n            z = (pMatrix[2] + pMatrix[8] ) / scale;\n            w = (pMatrix[9] - pMatrix[6] ) / scale;\n        }\n        // Else if the second element of the diagonal is the greatest value\n        else if (pMatrix[5] > pMatrix[10])\n        {\n            // Find the scale according to the second element, and double that value\n            scale = (float)sqrt( 1.0f + pMatrix[5] - pMatrix[0] - pMatrix[10] ) * 2.0f;\n\n            // Calculate the x, y, x and w of the quaternion through the respective equation\n            x = (pMatrix[4] + pMatrix[1] ) / scale;\n            y = 0.25f * scale;\n            z = (pMatrix[9] + pMatrix[6] ) / scale;\n            w = (pMatrix[2] - pMatrix[8] ) / scale;\n        }\n        // Else the third element of the diagonal is the greatest value\n        else\n        {\n            // Find the scale according to the third element, and double that value\n            scale  = (float)sqrt( 1.0f + pMatrix[10] - pMatrix[0] - pMatrix[5] ) * 2.0f;\n\n            // Calculate the x, y, x and w of the quaternion through the respective equation\n            x = (pMatrix[2] + pMatrix[8] ) / scale;\n            y = (pMatrix[9] + pMatrix[6] ) / scale;\n            z = 0.25f * scale;\n            w = (pMatrix[4] - pMatrix[1] ) / scale;\n        }\n    }\n\n    pOut->x = x;\n    pOut->y = y;\n    pOut->z = z;\n    pOut->w = w;\n\n    return pOut;\n\n#if 0\n    kmScalar T = pIn->mat[0] + pIn->mat[5] + pIn->mat[10];\n\n    if (T > kmEpsilon) {\n        //If the trace is greater than zero we always use this calculation:\n        /*  S = sqrt(T) * 2;\n          X = ( mat[9] - mat[6] ) / S;\n          Y = ( mat[2] - mat[8] ) / S;\n          Z = ( mat[4] - mat[1] ) / S;\n          W = 0.25 * S;*/\n\n/*        kmScalar s = sqrtf(T) * 2;\n        pOut->x = (pIn->mat[9] - pIn->mat[6]) / s;\n        pOut->y = (pIn->mat[8] - pIn->mat[2]) / s;\n        pOut->z = (pIn->mat[1] - pIn->mat[4]) / s;\n        pOut->w = 0.25f * s;\n\n        kmQuaternionNormalize(pOut, pOut);\n        return pOut;\n    }\n\n    //Otherwise the calculation depends on which major diagonal element has the greatest value.\n\n    if (pIn->mat[0] > pIn->mat[5] && pIn->mat[0] > pIn->mat[10]) {\n        kmScalar s = sqrtf(1 + pIn->mat[0] - pIn->mat[5] - pIn->mat[10]) * 2;\n        pOut->x = 0.25f * s;\n        pOut->y = (pIn->mat[1] + pIn->mat[4]) / s;\n        pOut->z = (pIn->mat[8] + pIn->mat[2]) / s;\n        pOut->w = (pIn->mat[9] - pIn->mat[6]) / s;\n    }\n    else if (pIn->mat[5] > pIn->mat[10]) {\n        kmScalar s = sqrtf(1 + pIn->mat[5] - pIn->mat[0] - pIn->mat[10]) * 2;\n        pOut->x = (pIn->mat[1] + pIn->mat[4]) / s;\n        pOut->y = 0.25f * s;\n        pOut->z = (pIn->mat[9] + pIn->mat[6]) / s;\n        pOut->w = (pIn->mat[8] - pIn->mat[2]) / s;\n    }\n    else {\n        kmScalar s = sqrt(1.0f + pIn->mat[10] - pIn->mat[0] - pIn->mat[5]) * 2.0f;\n        pOut->x = (pIn->mat[8] + pIn->mat[2] ) / s;\n        pOut->y = (pIn->mat[6] + pIn->mat[9] ) / s;\n        pOut->z = 0.25f * s;\n        pOut->w = (pIn->mat[1] - pIn->mat[4] ) / s;\n    }\n\n    kmQuaternionNormalize(pOut, pOut);\n    return pOut;*/\n#endif // 0\n}\n\n///< Create a quaternion from yaw, pitch and roll\nkmQuaternion* kmQuaternionRotationYawPitchRoll(kmQuaternion* pOut,\n                                                kmScalar yaw,\n                                                kmScalar pitch,\n                                                kmScalar roll)\n{\n    kmScalar    ex, ey, ez;        // temp half euler angles\n    kmScalar    cr, cp, cy, sr, sp, sy, cpcy, spsy;        // temp vars in roll,pitch yaw\n\n    ex = kmDegreesToRadians(pitch) / 2.0f;    // convert to rads and half them\n    ey = kmDegreesToRadians(yaw) / 2.0f;\n    ez = kmDegreesToRadians(roll) / 2.0f;\n\n    cr = cosf(ex);\n    cp = cosf(ey);\n    cy = cosf(ez);\n\n    sr = sinf(ex);\n    sp = sinf(ey);\n    sy = sinf(ez);\n\n    cpcy = cp * cy;\n    spsy = sp * sy;\n\n    pOut->w = cr * cpcy + sr * spsy;\n\n    pOut->x = sr * cpcy - cr * spsy;\n    pOut->y = cr * sp * cy + sr * cp * sy;\n    pOut->z = cr * cp * sy - sr * sp * cy;\n\n    kmQuaternionNormalize(pOut, pOut);\n\n    return pOut;\n}\n\n///< Interpolate between 2 quaternions\nkmQuaternion* kmQuaternionSlerp(kmQuaternion* pOut,\n                                const kmQuaternion* q1,\n                                const kmQuaternion* q2,\n                                kmScalar t)\n{\n\n /*float CosTheta = Q0.DotProd(Q1);\n  float Theta = acosf(CosTheta);\n  float SinTheta = sqrtf(1.0f-CosTheta*CosTheta);\n\n  float Sin_T_Theta = sinf(T*Theta)/SinTheta;\n  float Sin_OneMinusT_Theta = sinf((1.0f-T)*Theta)/SinTheta;\n\n  Quaternion Result = Q0*Sin_OneMinusT_Theta;\n  Result += (Q1*Sin_T_Theta);\n\n  return Result;*/\n\n    if (q1->x == q2->x &&\n        q1->y == q2->y &&\n        q1->z == q2->z &&\n        q1->w == q2->w) {\n\n        pOut->x = q1->x;\n        pOut->y = q1->y;\n        pOut->z = q1->z;\n        pOut->w = q1->w;\n\n        return pOut;\n    }\n    {\n        kmScalar ct = kmQuaternionDot(q1, q2);\n        kmScalar theta = acosf(ct);\n        kmScalar st = sqrtf(1.0 - kmSQR(ct));\n\n        kmScalar stt = sinf(t * theta) / st;\n        kmScalar somt = sinf((1.0 - t) * theta) / st;\n\n        kmQuaternion temp, temp2;\n        kmQuaternionScale(&temp, q1, somt);\n        kmQuaternionScale(&temp2, q2, stt);\n        kmQuaternionAdd(pOut, &temp, &temp2);\n    }\n    return pOut;\n}\n\n///< Get the axis and angle of rotation from a quaternion\nvoid kmQuaternionToAxisAngle(const kmQuaternion* pIn,\n                                kmVec3* pAxis,\n                                kmScalar* pAngle)\n{\n    kmScalar     tempAngle;        // temp angle\n    kmScalar    scale;            // temp vars\n\n    tempAngle = acosf(pIn->w);\n    scale = sqrtf(kmSQR(pIn->x) + kmSQR(pIn->y) + kmSQR(pIn->z));\n\n    if (((scale > -kmEpsilon) && scale < kmEpsilon)\n        || (scale < 2*kmPI + kmEpsilon && scale > 2*kmPI - kmEpsilon))        // angle is 0 or 360 so just simply set axis to 0,0,1 with angle 0\n    {\n        *pAngle = 0.0f;\n\n        pAxis->x = 0.0f;\n        pAxis->y = 0.0f;\n        pAxis->z = 1.0f;\n    }\n    else\n    {\n        *pAngle = tempAngle * 2.0f;        // angle in radians\n\n        pAxis->x = pIn->x / scale;\n        pAxis->y = pIn->y / scale;\n        pAxis->z = pIn->z / scale;\n        kmVec3Normalize(pAxis, pAxis);\n    }\n}\n\nkmQuaternion* kmQuaternionScale(kmQuaternion* pOut,\n                                        const kmQuaternion* pIn,\n                                        kmScalar s)\n{\n    pOut->x = pIn->x * s;\n    pOut->y = pIn->y * s;\n    pOut->z = pIn->z * s;\n    pOut->w = pIn->w * s;\n\n    return pOut;\n}\n\nkmQuaternion* kmQuaternionAssign(kmQuaternion* pOut, const kmQuaternion* pIn)\n{\n    memcpy(pOut, pIn, sizeof(float) * 4);\n\n    return pOut;\n}\n\nkmQuaternion* kmQuaternionAdd(kmQuaternion* pOut, const kmQuaternion* pQ1, const kmQuaternion* pQ2)\n{\n    pOut->x = pQ1->x + pQ2->x;\n    pOut->y = pQ1->y + pQ2->y;\n    pOut->z = pQ1->z + pQ2->z;\n    pOut->w = pQ1->w + pQ2->w;\n\n    return pOut;\n}\n\n/** Adapted from the OGRE engine!\n\n    Gets the shortest arc quaternion to rotate this vector to the destination\n    vector.\n@remarks\n    If you call this with a dest vector that is close to the inverse\n    of this vector, we will rotate 180 degrees around the 'fallbackAxis'\n    (if specified, or a generated axis if not) since in this case\n    ANY axis of rotation is valid.\n*/\n\nkmQuaternion* kmQuaternionRotationBetweenVec3(kmQuaternion* pOut, const kmVec3* vec1, const kmVec3* vec2, const kmVec3* fallback) {\n\n    kmVec3 v1, v2;\n    kmScalar a;\n\n    kmVec3Assign(&v1, vec1);\n    kmVec3Assign(&v2, vec2);\n\n    kmVec3Normalize(&v1, &v1);\n    kmVec3Normalize(&v2, &v2);\n\n    a = kmVec3Dot(&v1, &v2);\n\n    if (a >= 1.0) {\n        kmQuaternionIdentity(pOut);\n        return pOut;\n    }\n\n    if (a < (1e-6f - 1.0f))    {\n        if (fabs(kmVec3LengthSq(fallback)) < kmEpsilon) {\n            kmQuaternionRotationAxis(pOut, fallback, kmPI);\n        } else {\n            kmVec3 axis;\n            kmVec3 X;\n            X.x = 1.0;\n            X.y = 0.0;\n            X.z = 0.0;\n\n\n            kmVec3Cross(&axis, &X, vec1);\n\n            //If axis is zero\n            if (fabs(kmVec3LengthSq(&axis)) < kmEpsilon) {\n                kmVec3 Y;\n                Y.x = 0.0;\n                Y.y = 1.0;\n                Y.z = 0.0;\n\n                kmVec3Cross(&axis, &Y, vec1);\n            }\n\n            kmVec3Normalize(&axis, &axis);\n\n            kmQuaternionRotationAxis(pOut, &axis, kmPI);\n        }\n    } else {\n        kmScalar s = sqrtf((1+a) * 2);\n        kmScalar invs = 1 / s;\n\n        kmVec3 c;\n        kmVec3Cross(&c, &v1, &v2);\n\n        pOut->x = c.x * invs;\n        pOut->y = c.y * invs;\n        pOut->z = c.z * invs;\n        pOut->w = s * 0.5f;\n\n        kmQuaternionNormalize(pOut, pOut);\n    }\n\n    return pOut;\n\n}\n\nkmVec3* kmQuaternionMultiplyVec3(kmVec3* pOut, const kmQuaternion* q, const kmVec3* v) {\n    kmVec3 uv, uuv, qvec;\n\n    qvec.x = q->x;\n    qvec.y = q->y;\n    qvec.z = q->z;\n\n    kmVec3Cross(&uv, &qvec, v);\n    kmVec3Cross(&uuv, &qvec, &uv);\n\n    kmVec3Scale(&uv, &uv, (2.0f * q->w));\n    kmVec3Scale(&uuv, &uuv, 2.0f);\n\n    kmVec3Add(pOut, v, &uv);\n    kmVec3Add(pOut, pOut, &uuv);\n\n    return pOut;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/ray2.c",
    "content": "#include <assert.h>\n#include <stdio.h>\n#include \"kazmath/ray2.h\"\n\nvoid kmRay2Fill(kmRay2* ray, kmScalar px, kmScalar py, kmScalar vx, kmScalar vy) {\n    ray->start.x = px;\n    ray->start.y = py;\n    ray->dir.x = vx;\n    ray->dir.y = vy;\n}\n\nkmBool kmRay2IntersectLineSegment(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, kmVec2* intersection) {\n\n    float x1 = ray->start.x;\n    float y1 = ray->start.y;\n    float x2 = ray->start.x + ray->dir.x;\n    float y2 = ray->start.y + ray->dir.y;\n    float x3 = p1->x;\n    float y3 = p1->y;\n    float x4 = p2->x;\n    float y4 = p2->y;\n\n    float denom = (y4 -y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n    float ua, x, y;\n    //If denom is zero, the lines are parallel\n    if(denom > -kmEpsilon && denom < kmEpsilon) {\n        return KM_FALSE;\n    }\n\n    ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denom;\n//    float ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denom;\n\n    x = x1 + ua * (x2 - x1);\n    y = y1 + ua * (y2 - y1);\n\n    if(x < kmMin(p1->x, p2->x) - kmEpsilon ||\n       x > kmMax(p1->x, p2->x) + kmEpsilon ||\n       y < kmMin(p1->y, p2->y) - kmEpsilon ||\n       y > kmMax(p1->y, p2->y) + kmEpsilon) {\n        //Outside of line\n        //printf(\"Outside of line, %f %f (%f %f)(%f, %f)\\n\", x, y, p1->x, p1->y, p2->x, p2->y);\n        return KM_FALSE;\n    }\n\n    if(x < kmMin(x1, x2) - kmEpsilon ||\n       x > kmMax(x1, x2) + kmEpsilon ||\n       y < kmMin(y1, y2) - kmEpsilon ||\n       y > kmMax(y1, y2) + kmEpsilon) {\n        //printf(\"Outside of ray, %f %f (%f %f)(%f, %f)\\n\", x, y, x1, y1, x2, y2);\n        return KM_FALSE;\n    }\n\n    intersection->x = x;\n    intersection->y = y;\n\n    return KM_TRUE;\n\n\n/*\n    kmScalar A1, B1, C1;\n    kmScalar A2, B2, C2;\n\n    A1 = ray->dir.y;\n    B1 = ray->dir.x;\n    C1 = A1 * ray->start.x + B1 * ray->start.y;\n\n    A2 = p2->y - p1->y;\n    B2 = p2->x - p1->x;\n    C2 = A2 * p1->x + B2 * p1->y;\n\n    double det = (A1 * B2) - (A2 * B1);\n    if(det == 0) {\n        printf(\"Parallel\\n\");\n        return KM_FALSE;\n    }\n\n    double x = (B2*C1 - B1*C2) / det;\n    double y = (A1*C2 - A2*C1) / det;\n\n    if(x < min(p1->x, p2->x) - kmEpsilon ||\n       x > max(p1->x, p2->x) + kmEpsilon ||\n       y < min(p1->y, p2->y) - kmEpsilon ||\n       y > max(p1->y, p2->y) + kmEpsilon) {\n        //Outside of line\n        printf(\"Outside of line, %f %f (%f %f)(%f, %f)\\n\", x, y, p1->x, p1->y, p2->x, p2->y);\n        return KM_FALSE;\n    }\n\n    kmScalar x1 = ray->start.x;\n    kmScalar x2 = ray->start.x + ray->dir.x;\n\n    kmScalar y1 = ray->start.y;\n    kmScalar y2 = ray->start.y + ray->dir.y;\n\n    if(x < min(x1, x2) - kmEpsilon ||\n       x > max(x1, x2) + kmEpsilon ||\n       y < min(y1, y2) - kmEpsilon ||\n       y > max(y1, y2) + kmEpsilon) {\n        printf(\"Outside of ray, %f %f (%f %f)(%f, %f)\\n\", x, y, x1, y1, x2, y2);\n        return KM_FALSE;\n    }\n\n    intersection->x = x;\n    intersection->y = y;\n\n    return KM_TRUE;*/\n}\n\nvoid calculate_line_normal(kmVec2 p1, kmVec2 p2, kmVec2* normal_out) {\n    kmVec2 tmp;\n    kmVec2Subtract(&tmp, &p2, &p1); //Get direction vector\n\n    normal_out->x = -tmp.y;\n    normal_out->y = tmp.x;\n    kmVec2Normalize(normal_out, normal_out);\n\n    //TODO: should check that the normal is pointing out of the triangle\n}\n\nkmBool kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out) {\n    kmVec2 intersect;\n    kmVec2 final_intersect = {0., 0.}, normal = {0., 0.}; // Silencing LLVM SA.\n    kmScalar distance = 10000.0f;\n    kmBool intersected = KM_FALSE;\n\n    if(kmRay2IntersectLineSegment(ray, p1, p2, &intersect)) {\n        kmVec2 tmp;\n        kmScalar this_distance;\n\n        intersected = KM_TRUE;\n        this_distance = kmVec2Length(kmVec2Subtract(&tmp, &intersect, &ray->start));\n        if(this_distance < distance) {\n            final_intersect.x = intersect.x;\n            final_intersect.y = intersect.y;\n            distance = this_distance;\n\n            calculate_line_normal(*p1, *p2, &normal);\n        }\n    }\n\n    if(kmRay2IntersectLineSegment(ray, p2, p3, &intersect)) {\n        kmVec2 tmp;\n        kmScalar this_distance;\n        intersected = KM_TRUE;\n\n        this_distance = kmVec2Length(kmVec2Subtract(&tmp, &intersect, &ray->start));\n        if(this_distance < distance) {\n            final_intersect.x = intersect.x;\n            final_intersect.y = intersect.y;\n            distance = this_distance;\n\n            calculate_line_normal(*p2, *p3, &normal);\n        }\n    }\n\n    if(kmRay2IntersectLineSegment(ray, p3, p1, &intersect)) {\n        kmVec2 tmp;\n        kmScalar this_distance;\n        intersected = KM_TRUE;\n\n        this_distance = kmVec2Length(kmVec2Subtract(&tmp, &intersect, &ray->start));\n        if(this_distance < distance) {\n            final_intersect.x = intersect.x;\n            final_intersect.y = intersect.y;\n            //distance = this_distance;\n\n            calculate_line_normal(*p3, *p1, &normal);\n        }\n    }\n\n    if(intersected) {\n        intersection->x = final_intersect.x;\n        intersection->y = final_intersect.y;\n        if(normal_out) {\n            normal_out->x = normal.x;\n            normal_out->y = normal.y;\n        }\n    }\n\n    return intersected;\n}\n\nkmBool kmRay2IntersectCircle(const kmRay2* ray, const kmVec2 centre, const kmScalar radius, kmVec2* intersection) {\n    assert(0 && \"Not implemented\");\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/utility.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include \"kazmath/utility.h\"\n\n/**\n * Returns the square of s (e.g. s*s)\n */\nkmScalar kmSQR(kmScalar s) {\n    return s*s;\n}\n\n/**\n * Returns degrees as radians.\n */\nkmScalar kmDegreesToRadians(kmScalar degrees) {\n    return degrees * kmPIOver180;\n}\n\n/**\n * Returns radians as degrees\n */\nkmScalar kmRadiansToDegrees(kmScalar radians) {\n    return radians * kmPIUnder180;\n}\n\nkmScalar kmMin(kmScalar lhs, kmScalar rhs) {\n    return (lhs < rhs)? lhs : rhs;\n}\n\nkmScalar kmMax(kmScalar lhs, kmScalar rhs) {\n    return (lhs > rhs)? lhs : rhs;\n}\n\nkmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs) {\n    return (lhs + kmEpsilon > rhs && lhs - kmEpsilon < rhs);\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/vec2.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#include <assert.h>\n#include <stdlib.h>\n\n#include \"kazmath/mat3.h\"\n#include \"kazmath/vec2.h\"\n#include \"kazmath/utility.h\"\n\nkmVec2* kmVec2Fill(kmVec2* pOut, kmScalar x, kmScalar y)\n{\n    pOut->x = x;\n    pOut->y = y;\n    return pOut;\n}\n\nkmScalar kmVec2Length(const kmVec2* pIn)\n{\n    return sqrtf(kmSQR(pIn->x) + kmSQR(pIn->y));\n}\n\nkmScalar kmVec2LengthSq(const kmVec2* pIn)\n{\n    return kmSQR(pIn->x) + kmSQR(pIn->y);\n}\n\nkmVec2* kmVec2Normalize(kmVec2* pOut, const kmVec2* pIn)\n{\n    kmScalar l = 1.0f / kmVec2Length(pIn);\n\n    kmVec2 v;\n    v.x = pIn->x * l;\n    v.y = pIn->y * l;\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n\n    return pOut;\n}\n\nkmVec2* kmVec2Add(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2)\n{\n    pOut->x = pV1->x + pV2->x;\n    pOut->y = pV1->y + pV2->y;\n\n    return pOut;\n}\n\nkmScalar kmVec2Dot(const kmVec2* pV1, const kmVec2* pV2)\n{\n    return pV1->x * pV2->x + pV1->y * pV2->y;\n}\n\nkmVec2* kmVec2Subtract(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2)\n{\n    pOut->x = pV1->x - pV2->x;\n    pOut->y = pV1->y - pV2->y;\n\n    return pOut;\n}\n\nkmVec2* kmVec2Transform(kmVec2* pOut, const kmVec2* pV, const kmMat3* pM)\n{\n    kmVec2 v;\n\n    v.x = pV->x * pM->mat[0] + pV->y * pM->mat[3] + pM->mat[6];\n    v.y = pV->x * pM->mat[1] + pV->y * pM->mat[4] + pM->mat[7];\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n\n    return pOut;\n}\n\nkmVec2* kmVec2TransformCoord(kmVec2* pOut, const kmVec2* pV, const kmMat3* pM)\n{\n    assert(0);\n    return NULL;\n}\n\nkmVec2* kmVec2Scale(kmVec2* pOut, const kmVec2* pIn, const kmScalar s)\n{\n    pOut->x = pIn->x * s;\n    pOut->y = pIn->y * s;\n\n    return pOut;\n}\n\nint kmVec2AreEqual(const kmVec2* p1, const kmVec2* p2)\n{\n    return (\n                (p1->x < p2->x + kmEpsilon && p1->x > p2->x - kmEpsilon) &&\n                (p1->y < p2->y + kmEpsilon && p1->y > p2->y - kmEpsilon)\n            );\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/vec3.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/**\n * @file vec3.c\n */\n\n#include <assert.h>\n#include <memory.h>\n\n#include \"kazmath/utility.h\"\n#include \"kazmath/vec4.h\"\n#include \"kazmath/mat4.h\"\n#include \"kazmath/vec3.h\"\n\n/**\n * Fill a kmVec3 structure using 3 floating point values\n * The result is store in pOut, returns pOut\n */\nkmVec3* kmVec3Fill(kmVec3* pOut, kmScalar x, kmScalar y, kmScalar z)\n{\n    pOut->x = x;\n    pOut->y = y;\n    pOut->z = z;\n    return pOut;\n}\n\n\n/**\n * Returns the length of the vector\n */\nkmScalar kmVec3Length(const kmVec3* pIn)\n{\n    return sqrtf(kmSQR(pIn->x) + kmSQR(pIn->y) + kmSQR(pIn->z));\n}\n\n/**\n * Returns the square of the length of the vector\n */\nkmScalar kmVec3LengthSq(const kmVec3* pIn)\n{\n    return kmSQR(pIn->x) + kmSQR(pIn->y) + kmSQR(pIn->z);\n}\n\n /**\n  * Returns the vector passed in set to unit length\n  * the result is stored in pOut.\n  */\nkmVec3* kmVec3Normalize(kmVec3* pOut, const kmVec3* pIn)\n{\n    kmScalar l = 1.0f / kmVec3Length(pIn);\n\n    kmVec3 v;\n    v.x = pIn->x * l;\n    v.y = pIn->y * l;\n    v.z = pIn->z * l;\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n    pOut->z = v.z;\n\n    return pOut;\n}\n\n/**\n * Returns a vector perpendicular to 2 other vectors.\n * The result is stored in pOut.\n */\nkmVec3* kmVec3Cross(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2)\n{\n\n    kmVec3 v;\n\n    v.x = (pV1->y * pV2->z) - (pV1->z * pV2->y);\n    v.y = (pV1->z * pV2->x) - (pV1->x * pV2->z);\n    v.z = (pV1->x * pV2->y) - (pV1->y * pV2->x);\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n    pOut->z = v.z;\n\n    return pOut;\n}\n\n/**\n * Returns the cosine of the angle between 2 vectors\n */\nkmScalar kmVec3Dot(const kmVec3* pV1, const kmVec3* pV2)\n{\n    return (  pV1->x * pV2->x\n            + pV1->y * pV2->y\n            + pV1->z * pV2->z );\n}\n\n/**\n * Adds 2 vectors and returns the result. The resulting\n * vector is stored in pOut.\n */\nkmVec3* kmVec3Add(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2)\n{\n    kmVec3 v;\n\n    v.x = pV1->x + pV2->x;\n    v.y = pV1->y + pV2->y;\n    v.z = pV1->z + pV2->z;\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n    pOut->z = v.z;\n\n    return pOut;\n}\n\n /**\n  * Subtracts 2 vectors and returns the result. The result is stored in\n  * pOut.\n  */\nkmVec3* kmVec3Subtract(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2)\n{\n    kmVec3 v;\n\n    v.x = pV1->x - pV2->x;\n    v.y = pV1->y - pV2->y;\n    v.z = pV1->z - pV2->z;\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n    pOut->z = v.z;\n\n    return pOut;\n}\n\n /**\n  * Transforms vector (x, y, z, 1) by a given matrix. The result\n  * is stored in pOut. pOut is returned.\n  */\nkmVec3* kmVec3Transform(kmVec3* pOut, const kmVec3* pV, const kmMat4* pM)\n{\n    /*\n        a = (Vx, Vy, Vz, 1)\n        b = (a×M)T\n        Out = (bx, by, bz)\n    */\n\n    kmVec3 v;\n\n    v.x = pV->x * pM->mat[0] + pV->y * pM->mat[4] + pV->z * pM->mat[8] + pM->mat[12];\n    v.y = pV->x * pM->mat[1] + pV->y * pM->mat[5] + pV->z * pM->mat[9] + pM->mat[13];\n    v.z = pV->x * pM->mat[2] + pV->y * pM->mat[6] + pV->z * pM->mat[10] + pM->mat[14];\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n    pOut->z = v.z;\n\n    return pOut;\n}\n\nkmVec3* kmVec3InverseTransform(kmVec3* pOut, const kmVec3* pVect, const kmMat4* pM)\n{\n    kmVec3 v1, v2;\n\n    v1.x = pVect->x - pM->mat[12];\n    v1.y = pVect->y - pM->mat[13];\n    v1.z = pVect->z - pM->mat[14];\n\n    v2.x = v1.x * pM->mat[0] + v1.y * pM->mat[1] + v1.z * pM->mat[2];\n    v2.y = v1.x * pM->mat[4] + v1.y * pM->mat[5] + v1.z * pM->mat[6];\n    v2.z = v1.x * pM->mat[8] + v1.y * pM->mat[9] + v1.z * pM->mat[10];\n\n    pOut->x = v2.x;\n    pOut->y = v2.y;\n    pOut->z = v2.z;\n\n    return pOut;\n}\n\nkmVec3* kmVec3InverseTransformNormal(kmVec3* pOut, const kmVec3* pVect, const kmMat4* pM)\n{\n    kmVec3 v;\n\n    v.x = pVect->x * pM->mat[0] + pVect->y * pM->mat[1] + pVect->z * pM->mat[2];\n    v.y = pVect->x * pM->mat[4] + pVect->y * pM->mat[5] + pVect->z * pM->mat[6];\n    v.z = pVect->x * pM->mat[8] + pVect->y * pM->mat[9] + pVect->z * pM->mat[10];\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n    pOut->z = v.z;\n\n    return pOut;\n}\n\n\nkmVec3* kmVec3TransformCoord(kmVec3* pOut, const kmVec3* pV, const kmMat4* pM)\n{\n    /*\n        a = (Vx, Vy, Vz, 1)\n        b = (a×M)T\n        Out = 1⁄bw(bx, by, bz)\n    */\n\n    kmVec4 v;\n    kmVec4 inV;\n    kmVec4Fill(&inV, pV->x, pV->y, pV->z, 1.0);\n\n    kmVec4Transform(&v, &inV,pM);\n\n    pOut->x = v.x / v.w;\n    pOut->y = v.y / v.w;\n    pOut->z = v.z / v.w;\n\n    return pOut;\n}\n\nkmVec3* kmVec3TransformNormal(kmVec3* pOut, const kmVec3* pV, const kmMat4* pM)\n{\n/*\n    a = (Vx, Vy, Vz, 0)\n    b = (a×M)T\n    Out = (bx, by, bz)\n*/\n    //Omits the translation, only scaling + rotating\n    kmVec3 v;\n\n    v.x = pV->x * pM->mat[0] + pV->y * pM->mat[4] + pV->z * pM->mat[8];\n    v.y = pV->x * pM->mat[1] + pV->y * pM->mat[5] + pV->z * pM->mat[9];\n    v.z = pV->x * pM->mat[2] + pV->y * pM->mat[6] + pV->z * pM->mat[10];\n\n    pOut->x = v.x;\n    pOut->y = v.y;\n    pOut->z = v.z;\n\n    return pOut;\n\n}\n\n/**\n * Scales a vector to length s. Does not normalize first,\n * you should do that!\n */\nkmVec3* kmVec3Scale(kmVec3* pOut, const kmVec3* pIn, const kmScalar s)\n{\n    pOut->x = pIn->x * s;\n    pOut->y = pIn->y * s;\n    pOut->z = pIn->z * s;\n\n    return pOut;\n}\n\n/**\n * Returns KM_TRUE if the 2 vectors are approximately equal\n */\nint kmVec3AreEqual(const kmVec3* p1, const kmVec3* p2)\n{\n    if ((p1->x < (p2->x + kmEpsilon) && p1->x > (p2->x - kmEpsilon)) &&\n        (p1->y < (p2->y + kmEpsilon) && p1->y > (p2->y - kmEpsilon)) &&\n        (p1->z < (p2->z + kmEpsilon) && p1->z > (p2->z - kmEpsilon))) {\n        return 1;\n    }\n\n    return 0;\n}\n\n/**\n * Assigns pIn to pOut. Returns pOut. If pIn and pOut are the same\n * then nothing happens but pOut is still returned\n */\nkmVec3* kmVec3Assign(kmVec3* pOut, const kmVec3* pIn) {\n    if (pOut == pIn) {\n        return pOut;\n    }\n\n    pOut->x = pIn->x;\n    pOut->y = pIn->y;\n    pOut->z = pIn->z;\n\n    return pOut;\n}\n\n/**\n * Sets all the elements of pOut to zero. Returns pOut.\n */\nkmVec3* kmVec3Zero(kmVec3* pOut) {\n    pOut->x = 0.0f;\n    pOut->y = 0.0f;\n    pOut->z = 0.0f;\n\n    return pOut;\n}\n"
  },
  {
    "path": "cocos2d/cocos/math/kazmath/src/vec4.c",
    "content": "/*\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\n#include <memory.h>\n#include <assert.h>\n\n#include \"kazmath/utility.h\"\n#include \"kazmath/vec4.h\"\n#include \"kazmath/mat4.h\"\n\n\nkmVec4* kmVec4Fill(kmVec4* pOut, kmScalar x, kmScalar y, kmScalar z, kmScalar w)\n{\n    pOut->x = x;\n    pOut->y = y;\n    pOut->z = z;\n    pOut->w = w;\n    return pOut;\n}\n\n\n/// Adds 2 4D vectors together. The result is store in pOut, the function returns\n/// pOut so that it can be nested in another function.\nkmVec4* kmVec4Add(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2) {\n    pOut->x = pV1->x + pV2->x;\n    pOut->y = pV1->y + pV2->y;\n    pOut->z = pV1->z + pV2->z;\n    pOut->w = pV1->w + pV2->w;\n\n    return pOut;\n}\n\n/// Returns the dot product of 2 4D vectors\nkmScalar kmVec4Dot(const kmVec4* pV1, const kmVec4* pV2) {\n    return (  pV1->x * pV2->x\n            + pV1->y * pV2->y\n            + pV1->z * pV2->z\n            + pV1->w * pV2->w );\n}\n\n/// Returns the length of a 4D vector, this uses a sqrt so if the squared length will do use\n/// kmVec4LengthSq\nkmScalar kmVec4Length(const kmVec4* pIn) {\n    return sqrtf(kmSQR(pIn->x) + kmSQR(pIn->y) + kmSQR(pIn->z) + kmSQR(pIn->w));\n}\n\n/// Returns the length of the 4D vector squared.\nkmScalar kmVec4LengthSq(const kmVec4* pIn) {\n    return kmSQR(pIn->x) + kmSQR(pIn->y) + kmSQR(pIn->z) + kmSQR(pIn->w);\n}\n\n/// Returns the interpolation of 2 4D vectors based on t. Currently not implemented!\nkmVec4* kmVec4Lerp(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2, kmScalar t) {\n    assert(0);\n    return pOut;\n}\n\n/// Normalizes a 4D vector. The result is stored in pOut. pOut is returned\nkmVec4* kmVec4Normalize(kmVec4* pOut, const kmVec4* pIn) {\n    kmScalar l = 1.0f / kmVec4Length(pIn);\n\n    pOut->x *= l;\n    pOut->y *= l;\n    pOut->z *= l;\n    pOut->w *= l;\n\n    return pOut;\n}\n\n/// Scales a vector to the required length. This performs a Normalize before multiplying by S.\nkmVec4* kmVec4Scale(kmVec4* pOut, const kmVec4* pIn, const kmScalar s) {\n    kmVec4Normalize(pOut, pIn);\n\n    pOut->x *= s;\n    pOut->y *= s;\n    pOut->z *= s;\n    pOut->w *= s;\n    return pOut;\n}\n\n/// Subtracts one 4D pV2 from pV1. The result is stored in pOut. pOut is returned\nkmVec4* kmVec4Subtract(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2) {\n    pOut->x = pV1->x - pV2->x;\n    pOut->y = pV1->y - pV2->y;\n    pOut->z = pV1->z - pV2->z;\n    pOut->w = pV1->w - pV2->w;\n\n    return pOut;\n}\n\n/// Transforms a 4D vector by a matrix, the result is stored in pOut, and pOut is returned.\nkmVec4* kmVec4Transform(kmVec4* pOut, const kmVec4* pV, const kmMat4* pM) {\n    pOut->x = pV->x * pM->mat[0] + pV->y * pM->mat[4] + pV->z * pM->mat[8] + pV->w * pM->mat[12];\n    pOut->y = pV->x * pM->mat[1] + pV->y * pM->mat[5] + pV->z * pM->mat[9] + pV->w * pM->mat[13];\n    pOut->z = pV->x * pM->mat[2] + pV->y * pM->mat[6] + pV->z * pM->mat[10] + pV->w * pM->mat[14];\n    pOut->w = pV->x * pM->mat[3] + pV->y * pM->mat[7] + pV->z * pM->mat[11] + pV->w * pM->mat[15];\n    return pOut;\n}\n\n/// Loops through an input array transforming each vec4 by the matrix.\nkmVec4* kmVec4TransformArray(kmVec4* pOut, unsigned int outStride,\n            const kmVec4* pV, unsigned int vStride, const kmMat4* pM, unsigned int count) {\n    unsigned int i = 0;\n    //Go through all of the vectors\n    while (i < count) {\n        const kmVec4* in = pV + (i * vStride); //Get a pointer to the current input\n        kmVec4* out = pOut + (i * outStride); //and the current output\n        kmVec4Transform(out, in, pM); //Perform transform on it\n        ++i;\n    }\n\n    return pOut;\n}\n\nint kmVec4AreEqual(const kmVec4* p1, const kmVec4* p2) {\n    return (\n        (p1->x < p2->x + kmEpsilon && p1->x > p2->x - kmEpsilon) &&\n        (p1->y < p2->y + kmEpsilon && p1->y > p2->y - kmEpsilon) &&\n        (p1->z < p2->z + kmEpsilon && p1->z > p2->z - kmEpsilon) &&\n        (p1->w < p2->w + kmEpsilon && p1->w > p2->w - kmEpsilon)\n    );\n}\n\nkmVec4* kmVec4Assign(kmVec4* pOut, const kmVec4* pIn) {\n    assert(pOut != pIn);\n\n    memcpy(pOut, pIn, sizeof(float) * 4);\n\n    return pOut;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/network/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos_network_static\n\nLOCAL_MODULE_FILENAME := libnetwork\n\nLOCAL_SRC_FILES := HttpClient.cpp \\\nSocketIO.cpp \\\nWebSocket.cpp\n\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d \\\n$(LOCAL_PATH)/..\n\nLOCAL_CFLAGS += -Wno-psabi\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static\nLOCAL_WHOLE_STATIC_LIBRARIES += libwebsockets_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,2d)\n$(call import-module,curl/prebuilt/android)\n$(call import-module, websockets/prebuilt/android)\n"
  },
  {
    "path": "cocos2d/cocos/network/CMakeLists.txt",
    "content": "if(WIN32)\n  set(PLATFORM_SRC\n    WebSocket.cpp\n  )\n  set(PLATFORM_LINK\n    websockets\n  )\nendif()\n\nset(NETWORK_SRC\n  HttpClient.cpp\n  SocketIO.cpp\n  ${PLATFORM_SRC}\n)\n\nadd_library(network STATIC\n  ${NETWORK_SRC}\n)\n\ntarget_link_libraries(network\n  curl\n  ${PLATFORM_LINK}\n)\n\nset_target_properties(network\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/cocos/network/HttpClient.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2012      greathqy\n Copyright (c) 2012      cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"HttpClient.h\"\n\n#include <thread>\n#include <queue>\n#include <condition_variable>\n\n#include <errno.h>\n\n#include \"CCVector.h\"\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n\n#include \"curl/curl.h\"\n\n#include \"platform/CCFileUtils.h\"\n\nNS_CC_BEGIN\n\nnamespace network {\n\nstatic std::mutex       s_requestQueueMutex;\nstatic std::mutex       s_responseQueueMutex;\n\nstatic std::mutex\t\ts_SleepMutex;\nstatic std::condition_variable\t\ts_SleepCondition;\n\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\ntypedef int int32_t;\n#endif\n\nstatic bool s_need_quit = false;\n\nstatic Vector<HttpRequest*>*  s_requestQueue = nullptr;\nstatic Vector<HttpResponse*>* s_responseQueue = nullptr;\n\nstatic HttpClient *s_pHttpClient = nullptr; // pointer to singleton\n\nstatic char s_errorBuffer[CURL_ERROR_SIZE] = {0};\n\ntypedef size_t (*write_callback)(void *ptr, size_t size, size_t nmemb, void *stream);\n\nstatic std::string s_cookieFilename = \"\";\n\n// Callback function used by libcurl for collect response data\nstatic size_t writeData(void *ptr, size_t size, size_t nmemb, void *stream)\n{\n    std::vector<char> *recvBuffer = (std::vector<char>*)stream;\n    size_t sizes = size * nmemb;\n    \n    // add data to the end of recvBuffer\n    // write data maybe called more than once in a single request\n    recvBuffer->insert(recvBuffer->end(), (char*)ptr, (char*)ptr+sizes);\n    \n    return sizes;\n}\n\n// Callback function used by libcurl for collect header data\nstatic size_t writeHeaderData(void *ptr, size_t size, size_t nmemb, void *stream)\n{\n    std::vector<char> *recvBuffer = (std::vector<char>*)stream;\n    size_t sizes = size * nmemb;\n    \n    // add data to the end of recvBuffer\n    // write data maybe called more than once in a single request\n    recvBuffer->insert(recvBuffer->end(), (char*)ptr, (char*)ptr+sizes);\n    \n    return sizes;\n}\n\n\nstatic int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);\nstatic int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);\nstatic int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);\nstatic int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *errorCode, write_callback headerCallback, void *headerStream);\n// int processDownloadTask(HttpRequest *task, write_callback callback, void *stream, int32_t *errorCode);\n\n\n// Worker thread\nvoid HttpClient::networkThread()\n{    \n    HttpRequest *request = nullptr;\n    \n    auto scheduler = Director::getInstance()->getScheduler();\n    \n    while (true) \n    {\n        if (s_need_quit)\n        {\n            break;\n        }\n        \n        // step 1: send http request if the requestQueue isn't empty\n        request = nullptr;\n        \n        s_requestQueueMutex.lock();\n        \n        //Get request task from queue\n        \n        if (!s_requestQueue->empty())\n        {\n            request = s_requestQueue->at(0);\n            s_requestQueue->erase(0);\n        }\n        \n        s_requestQueueMutex.unlock();\n        \n        if (nullptr == request)\n        {\n            // Wait for http request tasks from main thread\n            std::unique_lock<std::mutex> lk(s_SleepMutex); \n            s_SleepCondition.wait(lk);\n            continue;\n        }\n        \n        // step 2: libcurl sync access\n        \n        // Create a HttpResponse object, the default setting is http access failed\n        HttpResponse *response = new HttpResponse(request);\n        \n        // request's refcount = 2 here, it's retained by HttpRespose constructor\n        request->release();\n        // ok, refcount = 1 now, only HttpResponse hold it.\n        \n        long responseCode = -1;\n        int retValue = 0;\n\n        // Process the request -> get response packet\n        switch (request->getRequestType())\n        {\n            case HttpRequest::Type::GET: // HTTP GET\n                retValue = processGetTask(request,\n                                          writeData, \n                                          response->getResponseData(), \n                                          &responseCode,\n                                          writeHeaderData,\n                                          response->getResponseHeader());\n                break;\n            \n            case HttpRequest::Type::POST: // HTTP POST\n                retValue = processPostTask(request,\n                                           writeData, \n                                           response->getResponseData(), \n                                           &responseCode,\n                                           writeHeaderData,\n                                           response->getResponseHeader());\n                break;\n\n            case HttpRequest::Type::PUT:\n                retValue = processPutTask(request,\n                                          writeData,\n                                          response->getResponseData(),\n                                          &responseCode,\n                                          writeHeaderData,\n                                          response->getResponseHeader());\n                break;\n\n            case HttpRequest::Type::DELETE:\n                retValue = processDeleteTask(request,\n                                             writeData,\n                                             response->getResponseData(),\n                                             &responseCode,\n                                             writeHeaderData,\n                                             response->getResponseHeader());\n                break;\n            \n            default:\n                CCASSERT(true, \"CCHttpClient: unkown request type, only GET and POSt are supported\");\n                break;\n        }\n                \n        // write data to HttpResponse\n        response->setResponseCode(responseCode);\n        \n        if (retValue != 0) \n        {\n            response->setSucceed(false);\n            response->setErrorBuffer(s_errorBuffer);\n        }\n        else\n        {\n            response->setSucceed(true);\n        }\n\n        \n        // add response packet into queue\n        s_responseQueueMutex.lock();\n        s_responseQueue->pushBack(response);\n        s_responseQueueMutex.unlock();\n        \n        scheduler->performFunctionInCocosThread(CC_CALLBACK_0(HttpClient::dispatchResponseCallbacks, this));\n    }\n    \n    // cleanup: if worker thread received quit signal, clean up un-completed request queue\n    s_requestQueueMutex.lock();\n    s_requestQueue->clear();\n    s_requestQueueMutex.unlock();\n    \n    \n    if (s_requestQueue != nullptr) {\n        delete s_requestQueue;\n        s_requestQueue = nullptr;\n        delete s_responseQueue;\n        s_responseQueue = nullptr;\n    }\n    \n}\n\n//Configure curl's timeout property\nstatic bool configureCURL(CURL *handle)\n{\n    if (!handle) {\n        return false;\n    }\n    \n    int32_t code;\n    code = curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, s_errorBuffer);\n    if (code != CURLE_OK) {\n        return false;\n    }\n    code = curl_easy_setopt(handle, CURLOPT_TIMEOUT, HttpClient::getInstance()->getTimeoutForRead());\n    if (code != CURLE_OK) {\n        return false;\n    }\n    code = curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, HttpClient::getInstance()->getTimeoutForConnect());\n    if (code != CURLE_OK) {\n        return false;\n    }\n    curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);\n    curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);\n    \n    // FIXED #3224: The subthread of CCHttpClient interrupts main thread if timeout comes.\n    // Document is here: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTNOSIGNAL \n    curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1L);\n\n    return true;\n}\n\nclass CURLRaii\n{\n    /// Instance of CURL\n    CURL *_curl;\n    /// Keeps custom header data\n    curl_slist *_headers;\npublic:\n    CURLRaii()\n        : _curl(curl_easy_init())\n        , _headers(nullptr)\n    {\n    }\n\n    ~CURLRaii()\n    {\n        if (_curl)\n            curl_easy_cleanup(_curl);\n        /* free the linked list for header data */\n        if (_headers)\n            curl_slist_free_all(_headers);\n    }\n\n    template <class T>\n    bool setOption(CURLoption option, T data)\n    {\n        return CURLE_OK == curl_easy_setopt(_curl, option, data);\n    }\n\n    /**\n     * @brief Inits CURL instance for common usage\n     * @param request Null not allowed\n     * @param callback Response write callback\n     * @param stream Response write stream\n     */\n    bool init(HttpRequest *request, write_callback callback, void *stream, write_callback headerCallback, void *headerStream)\n    {\n        if (!_curl)\n            return false;\n        if (!configureCURL(_curl))\n            return false;\n\n        /* get custom header data (if set) */\n       \tstd::vector<std::string> headers=request->getHeaders();\n        if(!headers.empty())\n        {\n            /* append custom headers one by one */\n            for (std::vector<std::string>::iterator it = headers.begin(); it != headers.end(); ++it)\n                _headers = curl_slist_append(_headers,it->c_str());\n            /* set custom headers for curl */\n            if (!setOption(CURLOPT_HTTPHEADER, _headers))\n                return false;\n        }\n        if (!s_cookieFilename.empty()) {\n            if (!setOption(CURLOPT_COOKIEFILE, s_cookieFilename.c_str())) {\n                return false;\n            }\n            if (!setOption(CURLOPT_COOKIEJAR, s_cookieFilename.c_str())) {\n                return false;\n            }\n        }\n\n        return setOption(CURLOPT_URL, request->getUrl())\n                && setOption(CURLOPT_WRITEFUNCTION, callback)\n                && setOption(CURLOPT_WRITEDATA, stream)\n                && setOption(CURLOPT_HEADERFUNCTION, headerCallback)\n                && setOption(CURLOPT_HEADERDATA, headerStream);\n        \n    }\n\n    /// @param responseCode Null not allowed\n    bool perform(long *responseCode)\n    {\n        if (CURLE_OK != curl_easy_perform(_curl))\n            return false;\n        CURLcode code = curl_easy_getinfo(_curl, CURLINFO_RESPONSE_CODE, responseCode);\n        if (code != CURLE_OK || *responseCode != 200) {\n            CCLOGERROR(\"Curl curl_easy_getinfo failed: %s\", curl_easy_strerror(code));\n            return false;\n        }\n        // Get some mor data.\n        \n        return true;\n    }\n};\n\n//Process Get Request\nstatic int processGetTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)\n{\n    CURLRaii curl;\n    bool ok = curl.init(request, callback, stream, headerCallback, headerStream)\n            && curl.setOption(CURLOPT_FOLLOWLOCATION, true)\n            && curl.perform(responseCode);\n    return ok ? 0 : 1;\n}\n\n//Process POST Request\nstatic int processPostTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)\n{\n    CURLRaii curl;\n    bool ok = curl.init(request, callback, stream, headerCallback, headerStream)\n            && curl.setOption(CURLOPT_POST, 1)\n            && curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData())\n            && curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize())\n            && curl.perform(responseCode);\n    return ok ? 0 : 1;\n}\n\n//Process PUT Request\nstatic int processPutTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)\n{\n    CURLRaii curl;\n    bool ok = curl.init(request, callback, stream, headerCallback, headerStream)\n            && curl.setOption(CURLOPT_CUSTOMREQUEST, \"PUT\")\n            && curl.setOption(CURLOPT_POSTFIELDS, request->getRequestData())\n            && curl.setOption(CURLOPT_POSTFIELDSIZE, request->getRequestDataSize())\n            && curl.perform(responseCode);\n    return ok ? 0 : 1;\n}\n\n//Process DELETE Request\nstatic int processDeleteTask(HttpRequest *request, write_callback callback, void *stream, long *responseCode, write_callback headerCallback, void *headerStream)\n{\n    CURLRaii curl;\n    bool ok = curl.init(request, callback, stream, headerCallback, headerStream)\n            && curl.setOption(CURLOPT_CUSTOMREQUEST, \"DELETE\")\n            && curl.setOption(CURLOPT_FOLLOWLOCATION, true)\n            && curl.perform(responseCode);\n    return ok ? 0 : 1;\n}\n\n// HttpClient implementation\nHttpClient* HttpClient::getInstance()\n{\n    if (s_pHttpClient == nullptr) {\n        s_pHttpClient = new HttpClient();\n    }\n    \n    return s_pHttpClient;\n}\n\nvoid HttpClient::destroyInstance()\n{\n    CC_SAFE_DELETE(s_pHttpClient);\n}\n\nvoid HttpClient::enableCookies(const char* cookieFile) {\n    if (cookieFile) {\n        s_cookieFilename = std::string(cookieFile);\n    }\n    else {\n        s_cookieFilename = (FileUtils::getInstance()->getWritablePath() + \"cookieFile.txt\");\n    }\n}\n\nHttpClient::HttpClient()\n: _timeoutForConnect(30)\n, _timeoutForRead(60)\n{\n}\n\nHttpClient::~HttpClient()\n{\n    s_need_quit = true;\n    \n    if (s_requestQueue != nullptr) {\n    \ts_SleepCondition.notify_one();\n    }\n    \n    s_pHttpClient = nullptr;\n}\n\n//Lazy create semaphore & mutex & thread\nbool HttpClient::lazyInitThreadSemphore()\n{\n    if (s_requestQueue != nullptr) {\n        return true;\n    } else {\n        \n        s_requestQueue = new Vector<HttpRequest*>();\n        s_responseQueue = new Vector<HttpResponse*>();\n        \n        auto t = std::thread(CC_CALLBACK_0(HttpClient::networkThread, this));\n        t.detach();\n        \n        s_need_quit = false;\n    }\n    \n    return true;\n}\n\n//Add a get task to queue\nvoid HttpClient::send(HttpRequest* request)\n{    \n    if (false == lazyInitThreadSemphore()) \n    {\n        return;\n    }\n    \n    if (!request)\n    {\n        return;\n    }\n        \n    request->retain();\n    \n    s_requestQueueMutex.lock();\n    s_requestQueue->pushBack(request);\n    s_requestQueueMutex.unlock();\n    \n    // Notify thread start to work\n    s_SleepCondition.notify_one();\n}\n\n// Poll and notify main thread if responses exists in queue\nvoid HttpClient::dispatchResponseCallbacks()\n{\n    // log(\"CCHttpClient::dispatchResponseCallbacks is running\");\n    \n    HttpResponse* response = nullptr;\n    \n    s_responseQueueMutex.lock();\n\n    if (!s_responseQueue->empty())\n    {\n        response = s_responseQueue->at(0);\n        s_responseQueue->erase(0);\n    }\n    \n    s_responseQueueMutex.unlock();\n    \n    if (response)\n    {\n        HttpRequest *request = response->getHttpRequest();\n        Object *pTarget = request->getTarget();\n        SEL_HttpResponse pSelector = request->getSelector();\n\n        if (pTarget && pSelector) \n        {\n            (pTarget->*pSelector)(this, response);\n        }\n        \n        response->release();\n    }\n}\n\n}\n\nNS_CC_END\n\n\n"
  },
  {
    "path": "cocos2d/cocos/network/HttpClient.h",
    "content": "/****************************************************************************\n Copyright (c) 2012      greathqy\n Copyright (c) 2012      cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCHTTPREQUEST_H__\n#define __CCHTTPREQUEST_H__\n\n#include \"network/HttpRequest.h\"\n#include \"network/HttpResponse.h\"\n#include \"network/HttpClient.h\"\n\nNS_CC_BEGIN\n\nnamespace network {\n\n/**\n * @addtogroup Network\n * @{\n */\n\n\n/** @brief Singleton that handles asynchrounous http requests\n * Once the request completed, a callback will issued in main thread when it provided during make request\n */\nclass HttpClient\n{\npublic:\n    /** Return the shared instance **/\n    static HttpClient *getInstance();\n    \n    /** Relase the shared instance **/\n    static void destroyInstance();\n\n    /** Enable cookie support. **/\n    void enableCookies(const char* cookieFile);\n        \n    /**\n     * Add a get request to task queue\n     * @param request a HttpRequest object, which includes url, response callback etc.\n                      please make sure request->_requestData is clear before calling \"send\" here.\n     */\n    void send(HttpRequest* request);\n  \n    \n    /**\n     * Change the connect timeout\n     * @param value The desired timeout.\n     */\n    inline void setTimeoutForConnect(int value) {_timeoutForConnect = value;};\n    \n    /**\n     * Get connect timeout\n     * @return int\n     */\n    inline int getTimeoutForConnect() {return _timeoutForConnect;}\n    \n    \n    /**\n     * Change the download timeout\n     * @param value\n     */\n    inline void setTimeoutForRead(int value) {_timeoutForRead = value;};\n    \n\n    /**\n     * Get download timeout\n     * @return int\n     */\n    inline int getTimeoutForRead() {return _timeoutForRead;};\n        \nprivate:\n    HttpClient();\n    virtual ~HttpClient();\n    bool init(void);\n    \n    /**\n     * Init pthread mutex, semaphore, and create new thread for http requests\n     * @return bool\n     */\n    bool lazyInitThreadSemphore();\n    void networkThread();\n    /** Poll function called from main thread to dispatch callbacks when http requests finished **/\n    void dispatchResponseCallbacks();\n    \nprivate:\n    int _timeoutForConnect;\n    int _timeoutForRead;\n};\n\n// end of Network group\n/// @}\n\n}\n\nNS_CC_END\n\n#endif //__CCHTTPREQUEST_H__\n"
  },
  {
    "path": "cocos2d/cocos/network/HttpRequest.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __HTTP_REQUEST_H__\n#define __HTTP_REQUEST_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\nnamespace network {\n\nclass HttpClient;\nclass HttpResponse;\ntypedef void (cocos2d::Object::*SEL_HttpResponse)(HttpClient* client, HttpResponse* response);\n#define httpresponse_selector(_SELECTOR) (cocos2d::network::SEL_HttpResponse)(&_SELECTOR)\n\n/** \n @brief defines the object which users must packed for HttpClient::send(HttpRequest*) method.\n Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample\n @since v2.0.2\n */\n\nclass HttpRequest : public cocos2d::Object\n{\npublic:\n    /** Use this enum type as param in setReqeustType(param) */\n    enum class Type\n    {\n        GET,\n        POST,\n        PUT,\n        DELETE,\n        UNKNOWN,\n    };\n    \n    /** Constructor\n        Because HttpRequest object will be used between UI thead and network thread,\n        requestObj->autorelease() is forbidden to avoid crashes in AutoreleasePool\n        new/retain/release still works, which means you need to release it manually\n        Please refer to HttpRequestTest.cpp to find its usage\n     */\n    HttpRequest()\n    {\n        _requestType = Type::UNKNOWN;\n        _url.clear();\n        _requestData.clear();\n        _tag.clear();\n        _pTarget = NULL;\n        _pSelector = NULL;\n        _pUserData = NULL;\n    };\n    \n    /** Destructor */\n    virtual ~HttpRequest()\n    {\n        if (_pTarget)\n        {\n            _pTarget->release();\n        }\n    };\n    \n    /** Override autorelease method to avoid developers to call it */\n    cocos2d::Object* autorelease(void)\n    {\n        CCASSERT(false, \"HttpResponse is used between network thread and ui thread \\\n                 therefore, autorelease is forbidden here\");\n        return NULL;\n    }\n            \n    // setter/getters for properties\n     \n    /** Required field for HttpRequest object before being sent.\n        kHttpGet & kHttpPost is currently supported\n     */\n    inline void setRequestType(Type type)\n    {\n        _requestType = type;\n    };\n    /** Get back the kHttpGet/Post/... enum value */\n    inline Type getRequestType()\n    {\n        return _requestType;\n    };\n    \n    /** Required field for HttpRequest object before being sent.\n     */\n    inline void setUrl(const char* url)\n    {\n        _url = url;\n    };\n    /** Get back the setted url */\n    inline const char* getUrl()\n    {\n        return _url.c_str();\n    };\n    \n    /** Option field. You can set your post data here\n     */\n    inline void setRequestData(const char* buffer, unsigned int len)\n    {\n        _requestData.assign(buffer, buffer + len);\n    };\n    /** Get the request data pointer back */\n    inline char* getRequestData()\n    {\n        if(_requestData.size() != 0)\n            return &(_requestData.front());\n\n        return nullptr;\n    }\n    /** Get the size of request data back */\n    inline ssize_t getRequestDataSize()\n    {\n        return _requestData.size();\n    }\n    \n    /** Option field. You can set a string tag to identify your request, this tag can be found in HttpResponse->getHttpRequest->getTag()\n     */\n    inline void setTag(const char* tag)\n    {\n        _tag = tag;\n    };\n    /** Get the string tag back to identify the request. \n        The best practice is to use it in your MyClass::onMyHttpRequestCompleted(sender, HttpResponse*) callback\n     */\n    inline const char* getTag()\n    {\n        return _tag.c_str();\n    };\n    \n    /** Option field. You can attach a customed data in each request, and get it back in response callback.\n        But you need to new/delete the data pointer manully\n     */\n    inline void setUserData(void* pUserData)\n    {\n        _pUserData = pUserData;\n    };\n    /** Get the pre-setted custom data pointer back.\n        Don't forget to delete it. HttpClient/HttpResponse/HttpRequest will do nothing with this pointer\n     */\n    inline void* getUserData()\n    {\n        return _pUserData;\n    };\n    \n    /** Required field. You should set the callback selector function at ack the http request completed\n     */\n    CC_DEPRECATED_ATTRIBUTE inline void setResponseCallback(cocos2d::Object* pTarget, cocos2d::SEL_CallFuncND pSelector)\n    {\n        setResponseCallback(pTarget, (SEL_HttpResponse) pSelector);\n    }\n\n    inline void setResponseCallback(cocos2d::Object* pTarget, SEL_HttpResponse pSelector)\n    {\n        _pTarget = pTarget;\n        _pSelector = pSelector;\n        \n        if (_pTarget)\n        {\n            _pTarget->retain();\n        }\n    }    \n    /** Get the target of callback selector funtion, mainly used by HttpClient */\n    inline cocos2d::Object* getTarget()\n    {\n        return _pTarget;\n    }\n\n    /* This sub class is just for migration SEL_CallFuncND to SEL_HttpResponse, \n       someday this way will be removed */\n    class _prxy\n    {\n    public:\n        _prxy( SEL_HttpResponse cb ) :_cb(cb) {}\n        ~_prxy(){};\n        operator SEL_HttpResponse() const { return _cb; }\n        CC_DEPRECATED_ATTRIBUTE operator cocos2d::SEL_CallFuncND()   const { return (cocos2d::SEL_CallFuncND) _cb; }\n    protected:\n        SEL_HttpResponse _cb;\n    };\n    \n    /** Get the selector function pointer, mainly used by HttpClient */\n    inline _prxy getSelector()\n    {\n        return _prxy(_pSelector);\n    }\n    \n    /** Set any custom headers **/\n    inline void setHeaders(std::vector<std::string> pHeaders)\n   \t{\n   \t\t_headers=pHeaders;\n   \t}\n   \n    /** Get custom headers **/\n   \tinline std::vector<std::string> getHeaders()\n   \t{\n   \t\treturn _headers;\n   \t}\n    \nprotected:\n    // properties\n    Type             _requestType;    /// kHttpRequestGet, kHttpRequestPost or other enums\n    std::string                 _url;            /// target url that this request is sent to\n    std::vector<char>           _requestData;    /// used for POST\n    std::string                 _tag;            /// user defined tag, to identify different requests in response callback\n    cocos2d::Object*          _pTarget;        /// callback target of pSelector function\n    SEL_HttpResponse            _pSelector;      /// callback function, e.g. MyLayer::onHttpResponse(HttpClient *sender, HttpResponse * response)\n    void*                       _pUserData;      /// You can add your customed data here \n    std::vector<std::string>    _headers;\t\t      /// custom http headers\n};\n\n}\n\nNS_CC_END\n\n#endif //__HTTP_REQUEST_H__\n"
  },
  {
    "path": "cocos2d/cocos/network/HttpResponse.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __HTTP_RESPONSE__\n#define __HTTP_RESPONSE__\n\n#include \"network/HttpRequest.h\"\n\nNS_CC_BEGIN\n\nnamespace network {\n\n/** \n @brief defines the object which users will receive at onHttpCompleted(sender, HttpResponse) callback\n Please refer to samples/TestCpp/Classes/ExtensionTest/NetworkTest/HttpClientTest.cpp as a sample\n @since v2.0.2\n */\nclass HttpResponse : public cocos2d::Object\n{\npublic:\n    /** Constructor, it's used by HttpClient internal, users don't need to create HttpResponse manually\n     @param request the corresponding HttpRequest which leads to this response \n     */\n    HttpResponse(HttpRequest* request)\n    {\n        _pHttpRequest = request;\n        if (_pHttpRequest)\n        {\n            _pHttpRequest->retain();\n        }\n        \n        _succeed = false;\n        _responseData.clear();\n        _errorBuffer.clear();\n    }\n    \n    /** Destructor, it will be called in HttpClient internal,\n     users don't need to desturct HttpResponse object manully \n     */\n    virtual ~HttpResponse()\n    {\n        if (_pHttpRequest)\n        {\n            _pHttpRequest->release();\n        }\n    }\n    \n    /** Override autorelease method to prevent developers from calling it */\n    cocos2d::Object* autorelease(void)\n    {\n        CCASSERT(false, \"HttpResponse is used between network thread and ui thread \\\n                        therefore, autorelease is forbidden here\");\n        return NULL;\n    }\n    \n    // getters, will be called by users\n    \n    /** Get the corresponding HttpRequest object which leads to this response \n        There's no paired setter for it, coz it's already setted in class constructor\n     */\n    inline HttpRequest* getHttpRequest()\n    {\n        return _pHttpRequest;\n    }\n        \n    /** To see if the http reqeust is returned successfully,\n        Althrough users can judge if (http return code = 200), we want an easier way\n        If this getter returns false, you can call getResponseCode and getErrorBuffer to find more details\n     */\n    inline bool isSucceed()\n    {\n        return _succeed;\n    };\n    \n    /** Get the http response raw data */\n    inline std::vector<char>* getResponseData()\n    {\n        return &_responseData;\n    }\n    \n    /** get the Rawheader **/\n    inline std::vector<char>* getResponseHeader()\n    {\n        return &_responseHeader;\n    }\n\n    /** Get the http response errorCode\n     *  I know that you want to see http 200 :)\n     */\n    inline long getResponseCode()\n    {\n        return _responseCode;\n    }\n\n    /** Get the rror buffer which will tell you more about the reason why http request failed\n     */\n    inline const char* getErrorBuffer()\n    {\n        return _errorBuffer.c_str();\n    }\n    \n    // setters, will be called by HttpClient\n    // users should avoid invoking these methods\n    \n    \n    /** Set if the http request is returned successfully,\n     Althrough users can judge if (http code == 200), we want a easier way\n     This setter is mainly used in HttpClient, users mustn't set it directly\n     */\n    inline void setSucceed(bool value)\n    {\n        _succeed = value;\n    };\n    \n    \n    /** Set the http response raw buffer, is used by HttpClient\n     */\n    inline void setResponseData(std::vector<char>* data)\n    {\n        _responseData = *data;\n    }\n    \n    /** Set the http response Header raw buffer, is used by HttpClient\n     */\n    inline void setResponseHeader(std::vector<char>* data)\n    {\n        _responseHeader = *data;\n    }\n    \n    \n    /** Set the http response errorCode\n     */\n    inline void setResponseCode(long value)\n    {\n        _responseCode = value;\n    }\n    \n    \n    /** Set the error buffer which will tell you more the reason why http request failed\n     */\n    inline void setErrorBuffer(const char* value)\n    {\n        _errorBuffer.clear();\n        _errorBuffer.assign(value);\n    };\n    \nprotected:\n    bool initWithRequest(HttpRequest* request);\n    \n    // properties\n    HttpRequest*        _pHttpRequest;  /// the corresponding HttpRequest pointer who leads to this response \n    bool                _succeed;       /// to indecate if the http reqeust is successful simply\n    std::vector<char>   _responseData;  /// the returned raw data. You can also dump it as a string\n    std::vector<char>   _responseHeader;  /// the returned raw header data. You can also dump it as a string\n    long                _responseCode;    /// the status code returned from libcurl, e.g. 200, 404\n    std::string         _errorBuffer;   /// if _responseCode != 200, please read _errorBuffer to find the reason \n    \n};\n\n}\n\nNS_CC_END\n\n#endif //__HTTP_RESPONSE_H__\n"
  },
  {
    "path": "cocos2d/cocos/network/SocketIO.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013      Chris Hannon\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n*based on the SocketIO library created by LearnBoost at http://socket.io\n*using spec version 1 found at https://github.com/LearnBoost/socket.io-spec\n\n ****************************************************************************/\n\n#include \"SocketIO.h\"\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n#include \"WebSocket.h\"\n#include \"HttpClient.h\"\n#include <algorithm>\n#include <sstream>\n\nNS_CC_BEGIN\n\nnamespace network {\n\n//class declarations\n\n/**\n *  @brief The implementation of the socket.io connection\n *\t\t   Clients/endpoints may share the same impl to accomplish multiplexing on the same websocket\n */\nclass SIOClientImpl : \n\tpublic cocos2d::Object, \n\tpublic WebSocket::Delegate\n{\nprivate: \n\tint _port, _heartbeat, _timeout;\n\tstd::string _host, _sid, _uri;\n\tbool _connected;\n\n\tWebSocket *_ws;\n\n\tMap<std::string, SIOClient*> _clients;\n\npublic:\n\tSIOClientImpl(const std::string& host, int port);\n\tvirtual ~SIOClientImpl(void);\n\n\tstatic SIOClientImpl* create(const std::string& host, int port);\n\t\n\tvirtual void onOpen(WebSocket* ws);\n    virtual void onMessage(WebSocket* ws, const WebSocket::Data& data);\n    virtual void onClose(WebSocket* ws);\n    virtual void onError(WebSocket* ws, const WebSocket::ErrorCode& error);\n\n\tvoid connect();\n\tvoid disconnect();\n\tbool init();\n\tvoid handshake();\n\tvoid handshakeResponse(HttpClient *sender, HttpResponse *response);\n\tvoid openSocket();\n\tvoid heartbeat(float dt);\n\n\tSIOClient* getClient(const std::string& endpoint);\n\tvoid addClient(const std::string& endpoint, SIOClient* client);\n\t\n\tvoid connectToEndpoint(const std::string& endpoint);\n\tvoid disconnectFromEndpoint(const std::string& endpoint);\n\n\tvoid send(std::string endpoint, std::string s);\n\tvoid emit(std::string endpoint, std::string eventname, std::string args);\n\n\n};\n\t\n\n//method implementations\n\n//begin SIOClientImpl methods\nSIOClientImpl::SIOClientImpl(const std::string& host, int port) :\n\t_port(port),\n\t_host(host),\n\t_connected(false)\n{\n\tstd::stringstream s;\n\ts << host << \":\" << port;\n\t_uri = s.str();\n\n\t_ws = nullptr;\n}\n\nSIOClientImpl::~SIOClientImpl()\n{\n\tif (_connected)\n        disconnect();\n\n\tCC_SAFE_DELETE(_ws);\n}\n\nvoid SIOClientImpl::handshake()\n{\n\tlog(\"SIOClientImpl::handshake() called\");\n\n\tstd::stringstream pre;\n\tpre << \"http://\" << _uri << \"/socket.io/1\";\n\n\tHttpRequest* request = new HttpRequest();\n\trequest->setUrl(pre.str().c_str());\n    request->setRequestType(HttpRequest::Type::GET);\n\n    request->setResponseCallback(this, httpresponse_selector(SIOClientImpl::handshakeResponse));\n    request->setTag(\"handshake\");\n\n\tlog(\"SIOClientImpl::handshake() waiting\");\n\n    HttpClient::getInstance()->send(request);\n\t    \n\trequest->release();\n\t\n\treturn;\n}\n\nvoid SIOClientImpl::handshakeResponse(HttpClient *sender, HttpResponse *response)\n{\n\tlog(\"SIOClientImpl::handshakeResponse() called\");\n\n\tif (0 != strlen(response->getHttpRequest()->getTag())) \n    {\n        log(\"%s completed\", response->getHttpRequest()->getTag());\n    }\n\n\tlong statusCode = response->getResponseCode();\n    char statusString[64] = {};\n    sprintf(statusString, \"HTTP Status Code: %ld, tag = %s\", statusCode, response->getHttpRequest()->getTag());\n\tlog(\"response code: %ld\", statusCode);\n\n\tif (!response->isSucceed()) \n    {\n        log(\"SIOClientImpl::handshake() failed\");\n        log(\"error buffer: %s\", response->getErrorBuffer());\n\n        for (auto iter = _clients.begin(); iter != _clients.end(); ++iter)\n        {\n            iter->second->getDelegate()->onError(iter->second, response->getErrorBuffer());\n        }\n\n        return;\n    }\n\n\tlog(\"SIOClientImpl::handshake() succeeded\");\n\n\tstd::vector<char> *buffer = response->getResponseData();\n\tstd::stringstream s;\n   \n\tfor (unsigned int i = 0; i < buffer->size(); i++)\n    {\n\t\ts << (*buffer)[i];\n    }\n    \n\tlog(\"SIOClientImpl::handshake() dump data: %s\", s.str().c_str());\n\n\tstd::string res = s.str();\n\tstd::string sid;\n\tsize_t pos = 0;\n\tint heartbeat = 0, timeout = 0;\n\n\tpos = res.find(\":\");\n\tif(pos != std::string::npos)\n    {\n\t\tsid = res.substr(0, pos);\n\t\tres.erase(0, pos+1);\n\t}\n\n\tpos = res.find(\":\");\n    if(pos != std::string::npos)\n    {\n        heartbeat = atoi(res.substr(pos+1, res.size()).c_str());\n    }\n\n\tpos = res.find(\":\");\n    if(pos != std::string::npos)\n    {\n        timeout = atoi(res.substr(pos+1, res.size()).c_str());\n    }\n\n\t_sid = sid;\n\t_heartbeat = heartbeat;\n\t_timeout = timeout;\n\t\n\topenSocket();\n\n\treturn;\n\n}\n\nvoid SIOClientImpl::openSocket()\n{\n\tlog(\"SIOClientImpl::openSocket() called\");\n\n\tstd::stringstream s;\n\ts << _uri << \"/socket.io/1/websocket/\" << _sid;\n\n\t_ws = new WebSocket();\n\tif (!_ws->init(*this, s.str())) \n\t{\n\t\tCC_SAFE_DELETE(_ws);\n\t}\n\t\n\treturn;\n}\n\nbool SIOClientImpl::init()\n{\n\tlog(\"SIOClientImpl::init() successful\");\n\treturn true;\n}\n\nvoid SIOClientImpl::connect()\n{\n\tthis->handshake();\n}\n\nvoid SIOClientImpl::disconnect()\n{\n\tif(_ws->getReadyState() == WebSocket::State::OPEN)\n    {\n\t\tstd::string s = \"0::\";\n\n\t\t_ws->send(s);\n\n\t\tlog(\"Disconnect sent\");\n\n\t\t_ws->close();\n\t}\n\n\tDirector::getInstance()->getScheduler()->unscheduleAllForTarget(this);\n\n\t_connected = false;\n\n\tSocketIO::getInstance()->removeSocket(_uri);\n}\n\nSIOClientImpl* SIOClientImpl::create(const std::string& host, int port)\n{\n\tSIOClientImpl *s = new SIOClientImpl(host, port);\n\n\tif (s && s->init())\n    {\n\t\treturn s;\n\t}\n\n\treturn nullptr;\n}\n\nSIOClient* SIOClientImpl::getClient(const std::string& endpoint)\n{\t\n\treturn _clients.at(endpoint);\n}\n\nvoid SIOClientImpl::addClient(const std::string& endpoint, SIOClient* client)\n{\n\t_clients.insert(endpoint, client);\n}\n\nvoid SIOClientImpl::connectToEndpoint(const std::string& endpoint)\n{\n\tstd::string path = endpoint == \"/\" ? \"\" : endpoint;\n\n\tstd::string s = \"1::\" + path;\n\n\t_ws->send(s);\n}\n\nvoid SIOClientImpl::disconnectFromEndpoint(const std::string& endpoint)\n{\n\t_clients.erase(endpoint);\n\n\tif (_clients.empty() || endpoint == \"/\")\n    {\n\t\tlog(\"SIOClientImpl::disconnectFromEndpoint out of endpoints, checking for disconnect\");\n\t\t\n\t\tif(_connected)\n            this->disconnect();\n\t}\n    else\n    {\n\t\tstd::string path = endpoint == \"/\" ? \"\" : endpoint;\n\n\t\tstd::string s = \"0::\" + path;\n\n\t\t_ws->send(s);\n\t}\n}\n\nvoid SIOClientImpl::heartbeat(float dt)\n{\n\tstd::string s = \"2::\";\n\n\t_ws->send(s);\n\n\tlog(\"Heartbeat sent\");\n}\n\n\nvoid SIOClientImpl::send(std::string endpoint, std::string s)\n{\n\tstd::stringstream pre;\n\n\tstd::string path = endpoint == \"/\" ? \"\" : endpoint;\n\t\n\tpre << \"3::\" << path << \":\" << s;\n\n\tstd::string msg = pre.str();\n\n\tlog(\"sending message: %s\", msg.c_str());\n\n\t_ws->send(msg);\n}\n\nvoid SIOClientImpl::emit(std::string endpoint, std::string eventname, std::string args)\n{\n\tstd::stringstream pre;\n\n\tstd::string path = endpoint == \"/\" ? \"\" : endpoint;\n\t\n\tpre << \"5::\" << path << \":{\\\"name\\\":\\\"\" << eventname << \"\\\",\\\"args\\\":\" << args << \"}\";\n\n\tstd::string msg = pre.str();\n\n\tlog(\"emitting event with data: %s\", msg.c_str());\n\n\t_ws->send(msg);\n}\n\nvoid SIOClientImpl::onOpen(WebSocket* ws)\n{\n\t_connected = true;\n\n\tSocketIO::getInstance()->addSocket(_uri, this);\n\n    for (auto iter = _clients.begin(); iter != _clients.end(); ++iter)\n    {\n        iter->second->onOpen();\n    }\n\n\tDirector::getInstance()->getScheduler()->scheduleSelector(schedule_selector(SIOClientImpl::heartbeat), this, (_heartbeat * .9f), false);\n\t\n\tlog(\"SIOClientImpl::onOpen socket connected!\");\n}\n\nvoid SIOClientImpl::onMessage(WebSocket* ws, const WebSocket::Data& data)\n{\n\tlog(\"SIOClientImpl::onMessage received: %s\", data.bytes);\n\n\tint control = atoi(&data.bytes[0]);\n\n\tstd::string payload, msgid, endpoint, s_data, eventname;\n\tpayload = data.bytes;\n\n\tsize_t pos, pos2;\n\n\tpos = payload.find(\":\");\n\tif(pos != std::string::npos ) {\n\t\tpayload.erase(0, pos+1);\n\t}\n\n\tpos = payload.find(\":\");\n\tif(pos != std::string::npos ) {\n\t\tmsgid = atoi(payload.substr(0, pos+1).c_str());\t\n\t}\n\tpayload.erase(0, pos+1);\n\n\tpos = payload.find(\":\");\n\tif(pos != std::string::npos)\n    {\n\t\tendpoint = payload.substr(0, pos);\n\t\tpayload.erase(0, pos+1);\n\t}\n    else\n    {\n\t\tendpoint = payload;\n\t}\n\n\tif (endpoint == \"\") endpoint = \"/\";\n\n\n\ts_data = payload;\n\tSIOClient *c = NULL;\n\tc = getClient(endpoint);\n\tif (c == NULL) log(\"SIOClientImpl::onMessage client lookup returned NULL\");\n\n\tswitch(control)\n    {\n\t\tcase 0: \n\t\t\tlog(\"Received Disconnect Signal for Endpoint: %s\\n\", endpoint.c_str());\n\t\t\tif(c) c->receivedDisconnect();\n\t\t\tdisconnectFromEndpoint(endpoint);\n\t\t\tbreak;\n\t\tcase 1: \n\t\t\tlog(\"Connected to endpoint: %s \\n\",endpoint.c_str());\n\t\t\tif(c) c->onConnect();\n\t\t\tbreak;\n\t\tcase 2: \n\t\t\tlog(\"Heartbeat received\\n\");\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tlog(\"Message received: %s \\n\", s_data.c_str());\n\t\t\tif(c) c->getDelegate()->onMessage(c, s_data);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tlog(\"JSON Message Received: %s \\n\", s_data.c_str());\n\t\t\tif(c) c->getDelegate()->onMessage(c, s_data);\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tlog(\"Event Received with data: %s \\n\", s_data.c_str());\n\n\t\t\tif(c)\n            {\n\t\t\t\teventname = \"\";\n\t\t\t\tpos = s_data.find(\":\");\n\t\t\t\tpos2 = s_data.find(\",\");\n\t\t\t\tif(pos2 > pos)\n                {\n\t\t\t\t\ts_data = s_data.substr(pos+1, pos2-pos-1);\n\t\t\t\t\tstd::remove_copy(s_data.begin(), s_data.end(),\n\t\t\t\t\t\t std::back_inserter(eventname), '\"');\n\t\t\t\t}\n\n\t\t\t\tc->fireEvent(eventname, payload);\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tlog(\"Message Ack\\n\");\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tlog(\"Error\\n\");\n\t\t\tif(c) c->getDelegate()->onError(c, s_data);\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tlog(\"Noop\\n\");\n\t\t\tbreak;\n\t}\n\n\treturn;\n}\n\nvoid SIOClientImpl::onClose(WebSocket* ws)\n{\n    if (!_clients.empty())\n    {\n        for (auto iter = _clients.begin(); iter != _clients.end(); ++iter)\n        {\n\t\t\titer->second->receivedDisconnect();\n        }\n    }\n\n\tthis->release();\n}\n\nvoid SIOClientImpl::onError(WebSocket* ws, const WebSocket::ErrorCode& error)\n{\n}\n\n//begin SIOClient methods\nSIOClient::SIOClient(const std::string& host, int port, const std::string& path, SIOClientImpl* impl, SocketIO::SIODelegate& delegate) \n\t: _port(port)\n\t, _host(host)\n\t, _path(path)\n    , _connected(false)\n\t, _socket(impl)\n\t, _delegate(&delegate)\n{\n\n}\n\nSIOClient::~SIOClient(void)\n{\n\tif (_connected)\n    {\n\t\t_socket->disconnectFromEndpoint(_path);\n\t}\n}\n\nvoid SIOClient::onOpen()\n{\n\tif (_path != \"/\")\n    {\n        _socket->connectToEndpoint(_path);\n\t}\n}\n\nvoid SIOClient::onConnect()\n{\n\t_connected = true;\n\t_delegate->onConnect(this);\n}\n\nvoid SIOClient::send(std::string s)\n{\n\tif (_connected)\n    {\n\t\t_socket->send(_path, s);\n\t}\n    else\n    {\n\t\t_delegate->onError(this, \"Client not yet connected\");\n\t}\n\n}\n\nvoid SIOClient::emit(std::string eventname, std::string args)\n{\n\tif(_connected)\n    {\n\t\t_socket->emit(_path, eventname, args);\n\t}\n    else\n    {\n\t\t_delegate->onError(this, \"Client not yet connected\");\n\t}\n\n}\n\nvoid SIOClient::disconnect()\n{\n\t_connected = false;\n\n\t_socket->disconnectFromEndpoint(_path);\n\n\t_delegate->onClose(this);\n\t\n\tthis->release();\n}\n\nvoid SIOClient::receivedDisconnect()\n{\n\t_connected = false;\n\n\t_delegate->onClose(this);\n\n\tthis->release();\n}\n\nvoid SIOClient::on(const std::string& eventName, SIOEvent e)\n{\n\t_eventRegistry[eventName] = e;\n}\n\nvoid SIOClient::fireEvent(const std::string& eventName, const std::string& data)\n{\n\tlog(\"SIOClient::fireEvent called with event name: %s and data: %s\", eventName.c_str(), data.c_str());\n\n\tif(_eventRegistry[eventName])\n    {\n\t\tSIOEvent e = _eventRegistry[eventName];\n\n\t\te(this, data);\n\n\t\treturn;\n\t}\n\n\tlog(\"SIOClient::fireEvent no event with name %s found\", eventName.c_str());\n}\n\n//begin SocketIO methods\nSocketIO *SocketIO::_inst = nullptr;\n\nSocketIO::SocketIO()\n{\n}\n\nSocketIO::~SocketIO(void)\n{\n}\n\nSocketIO* SocketIO::getInstance()\n{\n\tif (nullptr == _inst)\n        _inst = new SocketIO();\n\t\n\treturn _inst;\n}\n\nvoid SocketIO::destroyInstance()\n{\n    CC_SAFE_DELETE(_inst);\n}\n    \nSIOClient* SocketIO::connect(SocketIO::SIODelegate& delegate, const std::string& uri)\n{\n\tstd::string host = uri;\n\tint port = 0;\n    size_t pos = 0;\n\n\tpos = host.find(\"//\");\n\tif (pos != std::string::npos)\n    {\n\t\thost.erase(0, pos+2);\n\t}\n\n\tpos = host.find(\":\");\n    if (pos != std::string::npos)\n    {\n        port = atoi(host.substr(pos+1, host.size()).c_str());\n    }\n\n\tpos = host.find(\"/\", 0);\n    std::string path = \"/\";\n    if (pos != std::string::npos)\n    {\n        path += host.substr(pos + 1, host.size());\n    }\n\n\tpos = host.find(\":\");\n    if (pos != std::string::npos)\n    {\n        host.erase(pos, host.size());\n    }\n    else if ((pos = host.find(\"/\")) != std::string::npos)\n    {\n    \thost.erase(pos, host.size());\n    }\n\n\tstd::stringstream s;\n\ts << host << \":\" << port;\n\t\n\tSIOClientImpl* socket = nullptr;\n\tSIOClient *c = nullptr;\n\n\tsocket = SocketIO::getInstance()->getSocket(s.str());\n\n\tif(socket == nullptr)\n    {\n\t\t//create a new socket, new client, connect\n\t\tsocket = SIOClientImpl::create(host, port);\n\n\t\tc = new SIOClient(host, port, path, socket, delegate);\n\t\n\t\tsocket->addClient(path, c);\n\n\t\tsocket->connect();\n\t}\n    else\n    {\n\t\t//check if already connected to endpoint, handle\n\t\tc = socket->getClient(path);\n\n\t\tif(c == NULL)\n        {\n\t\t\tc = new SIOClient(host, port, path, socket, delegate);\n\t\n\t\t\tsocket->addClient(path, c);\n\n\t\t\tsocket->connectToEndpoint(path);\n\t\t}\n\t}\t\t\n\t\n\treturn c;\n}\n\nSIOClientImpl* SocketIO::getSocket(const std::string& uri)\n{\n\treturn _sockets.at(uri);\n}\n\nvoid SocketIO::addSocket(const std::string& uri, SIOClientImpl* socket)\n{\n\t_sockets.insert(uri, socket);\n}\n\nvoid SocketIO::removeSocket(const std::string& uri)\n{\n\t_sockets.erase(uri);\n}\n\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/network/SocketIO.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chris Hannon http://www.channon.us\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n*based on the SocketIO library created by LearnBoost at http://socket.io\n*using spec version 1 found at https://github.com/LearnBoost/socket.io-spec\n\nUsage is described below, a full working example can be found in TestCpp under ExtionsTest/NetworkTest/SocketIOTest\n\ncreating a new connection to a socket.io server running at localhost:3000\n\n\tSIOClient *client = SocketIO::connect(*delegate, \"ws://localhost:3000\");\n\nthe connection process will begin and if successful delegate::onOpen will be called\nif the connection process results in an error, delegate::onError will be called with the err msg\n\nsending a message to the server\n\n\tclient->send(\"Hello!\");\n\nemitting an event to be handled by the server, argument json formatting is up to you\n\n\tclient->emit(\"eventname\", \"[{\\\"arg\\\":\\\"value\\\"}]\");\n\nregistering an event callback, target should be a member function in a subclass of SIODelegate\nCC_CALLBACK_2 is used to wrap the callback with std::bind and store as an SIOEvent\n\n\tclient->on(\"eventname\", CC_CALLBACK_2(TargetClass::targetfunc, *targetclass_instance));\n\nevent target function should match this pattern, *this pointer will be made available\n\n\tvoid TargetClass::targetfunc(SIOClient *, const std::string&)\n\ndisconnect from the endpoint by calling disconnect(), onClose will be called on the delegate once complete\nin the onClose method the pointer should be set to NULL or used to connect to a new endpoint\n\n\tclient->disconnect();\n\n ****************************************************************************/\n\n#ifndef __CC_SOCKETIO_H__\n#define __CC_SOCKETIO_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"CCMap.h\"\n\n#include <string>\n\nNS_CC_BEGIN\n\nnamespace network {\n\n//forward declarations\nclass SIOClientImpl;\nclass SIOClient;\n\n/**\n *  @brief Singleton and wrapper class to provide static creation method as well as registry of all sockets\n */\nclass SocketIO\n{\npublic:\n\tstatic SocketIO* getInstance();\n    static void destroyInstance();\n\n\t/**\n     *  @brief The delegate class to process socket.io events\n     */\n\tclass SIODelegate\n    {\n    public:\n        virtual ~SIODelegate() {}\n\t\tvirtual void onConnect(SIOClient* client) = 0;\n        virtual void onMessage(SIOClient* client, const std::string& data) = 0;\n        virtual void onClose(SIOClient* client) = 0;\n        virtual void onError(SIOClient* client, const std::string& data) = 0;\n    };\n\n\t/**\n     *  @brief  Static client creation method, similar to socketio.connect(uri) in JS\n     *  @param  delegate The delegate which want to receive events from the socket.io client\n     *  @param  uri      The URI of the socket.io server\n     *  @return An initialized SIOClient if connected successfully, otherwise NULL\n     */\n\tstatic SIOClient* connect(SocketIO::SIODelegate& delegate, const std::string& uri);\n\t\nprivate:\n\n    SocketIO();\n\tvirtual ~SocketIO(void);\n    \n\tstatic SocketIO *_inst;\n\n\tcocos2d::Map<std::string, SIOClientImpl*> _sockets;\n\n\tSIOClientImpl* getSocket(const std::string& uri);\n\tvoid addSocket(const std::string& uri, SIOClientImpl* socket);\n\tvoid removeSocket(const std::string& uri);\n\n\tfriend class SIOClientImpl;\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(SocketIO)\n};\n\n//c++11 style callbacks entities will be created using CC_CALLBACK (which uses std::bind)\ntypedef std::function<void(SIOClient*, const std::string&)> SIOEvent;\n//c++11 map to callbacks\ntypedef std::unordered_map<std::string, SIOEvent> EventRegistry;\n\n/**\n     *  @brief A single connection to a socket.io endpoint\n     */\nclass SIOClient\n\t: public cocos2d::Object\n{\nprivate:\n\tint _port;\n\tstd::string _host, _path, _tag;\n\tbool _connected;\n\tSIOClientImpl* _socket;\n\n\tSocketIO::SIODelegate* _delegate;\n\n\tEventRegistry _eventRegistry;\n\n\tvoid fireEvent(const std::string& eventName, const std::string& data);\n\n\tvoid onOpen();\n\tvoid onConnect();\n\tvoid receivedDisconnect();\n\n\tfriend class SIOClientImpl;\n\npublic:\n\tSIOClient(const std::string& host, int port, const std::string& path, SIOClientImpl* impl, SocketIO::SIODelegate& delegate);\n\tvirtual ~SIOClient(void);\n\n\t/**\n     *  @brief Returns the delegate for the client\n     */\n\tSocketIO::SIODelegate* getDelegate() { return _delegate; };\n\n\t/**\n     *  @brief Disconnect from the endpoint, onClose will be called on the delegate when comlpete\n     */\n\tvoid disconnect();\n\t/**\n     *  @brief Send a message to the socket.io server\n     */\n\tvoid send(std::string s);\n\t/**\n     *  @brief The delegate class to process socket.io events\n     */\n\tvoid emit(std::string eventname, std::string args);\n\t/**\n     *  @brief Used to resgister a socket.io event callback\n\t *\t\t   Event argument should be passed using CC_CALLBACK2(&Base::function, this)\n     */\n\tvoid on(const std::string& eventName, SIOEvent e);\n\t\n\tinline void setTag(const char* tag)\n    {\n        _tag = tag;\n    };\n    \n\tinline const char* getTag()\n    {\n        return _tag.c_str();\n    };\n\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__CC_JSB_SOCKETIO_H__) */\n"
  },
  {
    "path": "cocos2d/cocos/network/WebSocket.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n\"[WebSocket module] is based in part on the work of the libwebsockets  project\n(http://libwebsockets.org)\"\n\n ****************************************************************************/\n\n#include \"WebSocket.h\"\n#include \"CCDirector.h\"\n#include \"CCScheduler.h\"\n\n#include <thread>\n#include <mutex>\n#include <queue>\n#include <signal.h>\n#include <errno.h>\n\n#include \"libwebsockets.h\"\n\n#define WS_WRITE_BUFFER_SIZE 2048\n\nNS_CC_BEGIN\n\nnamespace network {\n\nclass WsMessage\n{\npublic:\n    WsMessage() : what(0), obj(nullptr){}\n    unsigned int what; // message type\n    void* obj;\n};\n\n/**\n *  @brief Websocket thread helper, it's used for sending message between UI thread and websocket thread.\n */\nclass WsThreadHelper : public Object\n{\npublic:\n    WsThreadHelper();\n    ~WsThreadHelper();\n        \n    // Creates a new thread\n    bool createThread(const WebSocket& ws);\n    // Quits sub-thread (websocket thread).\n    void quitSubThread();\n    \n    // Schedule callback function\n    virtual void update(float dt);\n    \n    // Sends message to UI thread. It's needed to be invoked in sub-thread.\n    void sendMessageToUIThread(WsMessage *msg);\n    \n    // Sends message to sub-thread(websocket thread). It's needs to be invoked in UI thread.\n    void sendMessageToSubThread(WsMessage *msg);\n    \n    // Waits the sub-thread (websocket thread) to exit,\n    void joinSubThread();\n    \n    \nprotected:\n    void wsThreadEntryFunc();\n    \nprivate:\n    std::list<WsMessage*>* _UIWsMessageQueue;\n    std::list<WsMessage*>* _subThreadWsMessageQueue;\n    std::mutex   _UIWsMessageQueueMutex;\n    std::mutex   _subThreadWsMessageQueueMutex;\n    std::thread* _subThreadInstance;\n    WebSocket* _ws;\n    bool _needQuit;\n    friend class WebSocket;\n};\n\n// Wrapper for converting websocket callback from static function to member function of WebSocket class.\nclass WebSocketCallbackWrapper {\npublic:\n    \n    static int onSocketCallback(struct libwebsocket_context *ctx,\n                                struct libwebsocket *wsi,\n                                enum libwebsocket_callback_reasons reason,\n                                void *user, void *in, size_t len)\n    {\n        // Gets the user data from context. We know that it's a 'WebSocket' instance.\n        WebSocket* wsInstance = (WebSocket*)libwebsocket_context_user(ctx);\n        if (wsInstance)\n        {\n            return wsInstance->onSocketCallback(ctx, wsi, reason, user, in, len);\n        }\n        return 0;\n    }\n};\n\n// Implementation of WsThreadHelper\nWsThreadHelper::WsThreadHelper()\n: _subThreadInstance(nullptr)\n, _ws(nullptr)\n, _needQuit(false)\n{\n    _UIWsMessageQueue = new std::list<WsMessage*>();\n    _subThreadWsMessageQueue = new std::list<WsMessage*>();\n    \n    Director::getInstance()->getScheduler()->scheduleUpdateForTarget(this, 0, false);\n}\n\nWsThreadHelper::~WsThreadHelper()\n{\n    Director::getInstance()->getScheduler()->unscheduleAllForTarget(this);\n    joinSubThread();\n    CC_SAFE_DELETE(_subThreadInstance);\n    delete _UIWsMessageQueue;\n    delete _subThreadWsMessageQueue;\n}\n\nbool WsThreadHelper::createThread(const WebSocket& ws)\n{\n    _ws = const_cast<WebSocket*>(&ws);\n    \n    // Creates websocket thread\n    _subThreadInstance = new std::thread(&WsThreadHelper::wsThreadEntryFunc, this);\n    return true;\n}\n\nvoid WsThreadHelper::quitSubThread()\n{\n    _needQuit = true;\n}\n\nvoid WsThreadHelper::wsThreadEntryFunc()\n{\n    _ws->onSubThreadStarted();\n    \n    while (!_needQuit)\n    {\n        if (_ws->onSubThreadLoop())\n        {\n            break;\n        }\n    }\n    \n    _ws->onSubThreadEnded();\n}\n\nvoid WsThreadHelper::sendMessageToUIThread(WsMessage *msg)\n{\n    std::lock_guard<std::mutex> lk(_UIWsMessageQueueMutex);\n    _UIWsMessageQueue->push_back(msg);\n}\n\nvoid WsThreadHelper::sendMessageToSubThread(WsMessage *msg)\n{\n    std::lock_guard<std::mutex> lk(_subThreadWsMessageQueueMutex);\n    _subThreadWsMessageQueue->push_back(msg);\n}\n\nvoid WsThreadHelper::joinSubThread()\n{\n    if (_subThreadInstance->joinable())\n    {\n        _subThreadInstance->join();\n    }\n}\n\nvoid WsThreadHelper::update(float dt)\n{\n    WsMessage *msg = nullptr;\n\n    // Returns quickly if no message\n    std::lock_guard<std::mutex> lk(_UIWsMessageQueueMutex);\n\n    if (0 == _UIWsMessageQueue->size())\n    {\n        return;\n    }\n    \n    // Gets message\n    msg = *(_UIWsMessageQueue->begin());\n    _UIWsMessageQueue->pop_front();\n    \n    if (_ws)\n    {\n        _ws->onUIThreadReceiveMessage(msg);\n    }\n    \n    CC_SAFE_DELETE(msg);\n}\n\nenum WS_MSG {\n    WS_MSG_TO_SUBTRHEAD_SENDING_STRING = 0,\n    WS_MSG_TO_SUBTRHEAD_SENDING_BINARY,\n    WS_MSG_TO_UITHREAD_OPEN,\n    WS_MSG_TO_UITHREAD_MESSAGE,\n    WS_MSG_TO_UITHREAD_ERROR,\n    WS_MSG_TO_UITHREAD_CLOSE\n};\n\nWebSocket::WebSocket()\n: _readyState(State::CONNECTING)\n, _port(80)\n, _wsHelper(nullptr)\n, _wsInstance(nullptr)\n, _wsContext(nullptr)\n, _delegate(nullptr)\n, _SSLConnection(0)\n, _wsProtocols(nullptr)\n, _pendingFrameDataLen(0)\n, _currentDataLen(0)\n, _currentData(nullptr)\n{\n}\n\nWebSocket::~WebSocket()\n{\n    close();\n    CC_SAFE_RELEASE_NULL(_wsHelper);\n    \n    for (int i = 0; _wsProtocols[i].callback != nullptr; ++i)\n    {\n        CC_SAFE_DELETE_ARRAY(_wsProtocols[i].name);\n    }\n\tCC_SAFE_DELETE_ARRAY(_wsProtocols);\n}\n\nbool WebSocket::init(const Delegate& delegate,\n                     const std::string& url,\n                     const std::vector<std::string>* protocols/* = nullptr*/)\n{\n    bool ret = false;\n    bool useSSL = false;\n    std::string host = url;\n    size_t pos = 0;\n    int port = 80;\n    \n    _delegate = const_cast<Delegate*>(&delegate);\n    \n    //ws://\n    pos = host.find(\"ws://\");\n    if (pos == 0) host.erase(0,5);\n    \n    pos = host.find(\"wss://\");\n    if (pos == 0)\n    {\n        host.erase(0,6);\n        useSSL = true;\n    }\n    \n    pos = host.find(\":\");\n    if (pos != std::string::npos) port = atoi(host.substr(pos+1, host.size()).c_str());\n    \n    pos = host.find(\"/\", 0);\n    std::string path = \"/\";\n    if (pos != std::string::npos) path += host.substr(pos + 1, host.size());\n    \n    pos = host.find(\":\");\n    if(pos != std::string::npos){\n        host.erase(pos, host.size());\n    }else if((pos = host.find(\"/\")) != std::string::npos) {\n    \thost.erase(pos, host.size());\n    }\n    \n    _host = host;\n    _port = port;\n    _path = path;\n    _SSLConnection = useSSL ? 1 : 0;\n    \n    CCLOG(\"[WebSocket::init] _host: %s, _port: %d, _path: %s\", _host.c_str(), _port, _path.c_str());\n\n    size_t protocolCount = 0;\n    if (protocols && protocols->size() > 0)\n    {\n        protocolCount = protocols->size();\n    }\n    else\n    {\n        protocolCount = 1;\n    }\n    \n\t_wsProtocols = new libwebsocket_protocols[protocolCount+1];\n\tmemset(_wsProtocols, 0, sizeof(libwebsocket_protocols)*(protocolCount+1));\n\n    if (protocols && protocols->size() > 0)\n    {\n        int i = 0;\n        for (std::vector<std::string>::const_iterator iter = protocols->begin(); iter != protocols->end(); ++iter, ++i)\n        {\n            char* name = new char[(*iter).length()+1];\n            strcpy(name, (*iter).c_str());\n            _wsProtocols[i].name = name;\n            _wsProtocols[i].callback = WebSocketCallbackWrapper::onSocketCallback;\n        }\n    }\n    else\n    {\n        char* name = new char[20];\n        strcpy(name, \"default-protocol\");\n        _wsProtocols[0].name = name;\n        _wsProtocols[0].callback = WebSocketCallbackWrapper::onSocketCallback;\n    }\n    \n    // WebSocket thread needs to be invoked at the end of this method.\n    _wsHelper = new WsThreadHelper();\n    ret = _wsHelper->createThread(*this);\n    \n    return ret;\n}\n\nvoid WebSocket::send(const std::string& message)\n{\n    if (_readyState == State::OPEN)\n    {\n        // In main thread\n        WsMessage* msg = new WsMessage();\n        msg->what = WS_MSG_TO_SUBTRHEAD_SENDING_STRING;\n        Data* data = new Data();\n        data->bytes = new char[message.length()+1];\n        strcpy(data->bytes, message.c_str());\n        data->len = static_cast<ssize_t>(message.length());\n        msg->obj = data;\n        _wsHelper->sendMessageToSubThread(msg);\n    }\n}\n\nvoid WebSocket::send(const unsigned char* binaryMsg, unsigned int len)\n{\n    CCASSERT(binaryMsg != nullptr && len > 0, \"parameter invalid.\");\n\n    if (_readyState == State::OPEN)\n    {\n        // In main thread\n        WsMessage* msg = new WsMessage();\n        msg->what = WS_MSG_TO_SUBTRHEAD_SENDING_BINARY;\n        Data* data = new Data();\n        data->bytes = new char[len];\n        memcpy((void*)data->bytes, (void*)binaryMsg, len);\n        data->len = len;\n        msg->obj = data;\n        _wsHelper->sendMessageToSubThread(msg);\n    }\n}\n\nvoid WebSocket::close()\n{\n    Director::getInstance()->getScheduler()->unscheduleAllForTarget(_wsHelper);\n    \n    if (_readyState == State::CLOSING || _readyState == State::CLOSED)\n    {\n        return;\n    }\n    \n    CCLOG(\"websocket (%p) connection closed by client\", this);\n    _readyState = State::CLOSED;\n\n    _wsHelper->joinSubThread();\n    \n    // onClose callback needs to be invoked at the end of this method\n    // since websocket instance may be deleted in 'onClose'.\n    _delegate->onClose(this);\n}\n\nWebSocket::State WebSocket::getReadyState()\n{\n    return _readyState;\n}\n\nint WebSocket::onSubThreadLoop()\n{\n    if (_readyState == State::CLOSED || _readyState == State::CLOSING)\n    {\n        libwebsocket_context_destroy(_wsContext);\n        // return 1 to exit the loop.\n        return 1;\n    }\n    \n    if (_wsContext && _readyState != State::CLOSED && _readyState != State::CLOSING)\n    {\n        libwebsocket_service(_wsContext, 0);\n    }\n    \n    // Sleep 50 ms\n    std::this_thread::sleep_for(std::chrono::milliseconds(50));\n\n    // return 0 to continue the loop.\n    return 0;\n}\n\nvoid WebSocket::onSubThreadStarted()\n{\n\tstruct lws_context_creation_info info;\n\tmemset(&info, 0, sizeof info);\n    \n\t/*\n\t * create the websocket context.  This tracks open connections and\n\t * knows how to route any traffic and which protocol version to use,\n\t * and if each connection is client or server side.\n\t *\n\t * For this client-only demo, we tell it to not listen on any port.\n\t */\n    \n\tinfo.port = CONTEXT_PORT_NO_LISTEN;\n\tinfo.protocols = _wsProtocols;\n#ifndef LWS_NO_EXTENSIONS\n\tinfo.extensions = libwebsocket_get_internal_extensions();\n#endif\n\tinfo.gid = -1;\n\tinfo.uid = -1;\n    info.user = (void*)this;\n    \n\t_wsContext = libwebsocket_create_context(&info);\n    \n\tif(nullptr != _wsContext)\n    {\n        _readyState = State::CONNECTING;\n        std::string name;\n        for (int i = 0; _wsProtocols[i].callback != nullptr; ++i)\n        {\n            name += (_wsProtocols[i].name);\n            \n            if (_wsProtocols[i+1].callback != nullptr) name += \", \";\n        }\n        _wsInstance = libwebsocket_client_connect(_wsContext, _host.c_str(), _port, _SSLConnection,\n                                             _path.c_str(), _host.c_str(), _host.c_str(),\n                                             name.c_str(), -1);\n\t}\n}\n\nvoid WebSocket::onSubThreadEnded()\n{\n\n}\n\nint WebSocket::onSocketCallback(struct libwebsocket_context *ctx,\n                     struct libwebsocket *wsi,\n                     int reason,\n                     void *user, void *in, ssize_t len)\n{\n\t//CCLOG(\"socket callback for %d reason\", reason);\n    CCASSERT(_wsContext == nullptr || ctx == _wsContext, \"Invalid context.\");\n    CCASSERT(_wsInstance == nullptr || wsi == nullptr || wsi == _wsInstance, \"Invaild websocket instance.\");\n\n\tswitch (reason)\n    {\n        case LWS_CALLBACK_DEL_POLL_FD:\n        case LWS_CALLBACK_PROTOCOL_DESTROY:\n        case LWS_CALLBACK_CLIENT_CONNECTION_ERROR:\n            {\n                WsMessage* msg = nullptr;\n                if (reason == LWS_CALLBACK_CLIENT_CONNECTION_ERROR\n                    || (reason == LWS_CALLBACK_PROTOCOL_DESTROY && _readyState == State::CONNECTING)\n                    || (reason == LWS_CALLBACK_DEL_POLL_FD && _readyState == State::CONNECTING)\n                    )\n                {\n                    msg = new WsMessage();\n                    msg->what = WS_MSG_TO_UITHREAD_ERROR;\n                    _readyState = State::CLOSING;\n                }\n                else if (reason == LWS_CALLBACK_PROTOCOL_DESTROY && _readyState == State::CLOSING)\n                {\n                    msg = new WsMessage();\n                    msg->what = WS_MSG_TO_UITHREAD_CLOSE;\n                }\n\n                if (msg)\n                {\n                    _wsHelper->sendMessageToUIThread(msg);\n                }\n            }\n            break;\n        case LWS_CALLBACK_CLIENT_ESTABLISHED:\n            {\n                WsMessage* msg = new WsMessage();\n                msg->what = WS_MSG_TO_UITHREAD_OPEN;\n                _readyState = State::OPEN;\n                \n                /*\n                 * start the ball rolling,\n                 * LWS_CALLBACK_CLIENT_WRITEABLE will come next service\n                 */\n                libwebsocket_callback_on_writable(ctx, wsi);\n                _wsHelper->sendMessageToUIThread(msg);\n            }\n            break;\n            \n        case LWS_CALLBACK_CLIENT_WRITEABLE:\n            {\n\n                std::lock_guard<std::mutex> lk(_wsHelper->_subThreadWsMessageQueueMutex);\n                                               \n                std::list<WsMessage*>::iterator iter = _wsHelper->_subThreadWsMessageQueue->begin();\n                \n                int bytesWrite = 0;\n                for (; iter != _wsHelper->_subThreadWsMessageQueue->end();)\n                {\n                    WsMessage* subThreadMsg = *iter;\n                    \n                    if ( WS_MSG_TO_SUBTRHEAD_SENDING_STRING == subThreadMsg->what\n                      || WS_MSG_TO_SUBTRHEAD_SENDING_BINARY == subThreadMsg->what)\n                    {\n                        Data* data = (Data*)subThreadMsg->obj;\n\n                        const size_t c_bufferSize = WS_WRITE_BUFFER_SIZE;\n\n                        size_t remaining = data->len - data->issued;\n                        size_t n = std::min(remaining, c_bufferSize );\n                        CCLOG(\"[websocket:send] total: %d, sent: %d, remaining: %d, buffer size: %d\", static_cast<int>(data->len), static_cast<int>(data->issued), static_cast<int>(remaining), static_cast<int>(n));\n\n                        unsigned char* buf = new unsigned char[LWS_SEND_BUFFER_PRE_PADDING + n + LWS_SEND_BUFFER_POST_PADDING];\n\n                        memcpy((char*)&buf[LWS_SEND_BUFFER_PRE_PADDING], data->bytes + data->issued, n);\n                        \n                        int writeProtocol;\n                        \n                        if (data->issued == 0) {\n\t\t\t\t\t\t\tif (WS_MSG_TO_SUBTRHEAD_SENDING_STRING == subThreadMsg->what)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twriteProtocol = LWS_WRITE_TEXT;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twriteProtocol = LWS_WRITE_BINARY;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// If we have more than 1 fragment\n\t\t\t\t\t\t\tif (data->len > c_bufferSize)\n\t\t\t\t\t\t\t\twriteProtocol |= LWS_WRITE_NO_FIN;\n                        } else {\n                        \t// we are in the middle of fragments\n                        \twriteProtocol = LWS_WRITE_CONTINUATION;\n                        \t// and if not in the last fragment\n                        \tif (remaining != n)\n                        \t\twriteProtocol |= LWS_WRITE_NO_FIN;\n                        }\n\n                        bytesWrite = libwebsocket_write(wsi,  &buf[LWS_SEND_BUFFER_PRE_PADDING], n, (libwebsocket_write_protocol)writeProtocol);\n                        CCLOG(\"[websocket:send] bytesWrite => %d\", bytesWrite);\n\n                        // Buffer overrun?\n                        if (bytesWrite < 0)\n                        {\n                            break;\n                        }\n                        // Do we have another fragments to send?\n                        else if (remaining != n)\n                        {\n                            data->issued += n;\n                            break;\n                        }\n                        // Safely done!\n                        else\n                        {\n                            CC_SAFE_DELETE_ARRAY(data->bytes);\n                            CC_SAFE_DELETE(data);\n                            CC_SAFE_DELETE_ARRAY(buf);\n                            _wsHelper->_subThreadWsMessageQueue->erase(iter++);\n                            CC_SAFE_DELETE(subThreadMsg);\n                        }\n                    }\n                }\n                \n                /* get notified as soon as we can write again */\n                \n                libwebsocket_callback_on_writable(ctx, wsi);\n            }\n            break;\n            \n        case LWS_CALLBACK_CLOSED:\n            {\n                \n                CCLOG(\"%s\", \"connection closing..\");\n\n                _wsHelper->quitSubThread();\n                \n                if (_readyState != State::CLOSED)\n                {\n                    WsMessage* msg = new WsMessage();\n                    _readyState = State::CLOSED;\n                    msg->what = WS_MSG_TO_UITHREAD_CLOSE;\n                    _wsHelper->sendMessageToUIThread(msg);\n                }\n            }\n            break;\n            \n        case LWS_CALLBACK_CLIENT_RECEIVE:\n            {\n                if (in && len > 0)\n                {\n                    // Accumulate the data (increasing the buffer as we go)\n                    if (_currentDataLen == 0)\n                    {\n                        _currentData = new char[len];\n                        memcpy (_currentData, in, len);\n                        _currentDataLen = len;\n                    }\n                    else\n                    {\n                        char *new_data = new char [_currentDataLen + len];\n                        memcpy (new_data, _currentData, _currentDataLen);\n                        memcpy (new_data + _currentDataLen, in, len);\n                        CC_SAFE_DELETE_ARRAY(_currentData);\n                        _currentData = new_data;\n                        _currentDataLen = _currentDataLen + len;\n                    }\n\n                    _pendingFrameDataLen = libwebsockets_remaining_packet_payload (wsi);\n\n                    if (_pendingFrameDataLen > 0)\n                    {\n                        //CCLOG(\"%ld bytes of pending data to receive, consider increasing the libwebsocket rx_buffer_size value.\", _pendingFrameDataLen);\n                    }\n                    \n                    // If no more data pending, send it to the client thread\n                    if (_pendingFrameDataLen == 0)\n                    {\n\t\t\t\t\t\tWsMessage* msg = new WsMessage();\n\t\t\t\t\t\tmsg->what = WS_MSG_TO_UITHREAD_MESSAGE;\n\n\t\t\t\t\t\tchar* bytes = nullptr;\n\t\t\t\t\t\tData* data = new Data();\n\n\t\t\t\t\t\tif (lws_frame_is_binary(wsi))\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\tbytes = new char[_currentDataLen];\n\t\t\t\t\t\t\tdata->isBinary = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbytes = new char[_currentDataLen+1];\n\t\t\t\t\t\t\tbytes[_currentDataLen] = '\\0';\n\t\t\t\t\t\t\tdata->isBinary = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmemcpy(bytes, _currentData, _currentDataLen);\n\n\t\t\t\t\t\tdata->bytes = bytes;\n\t\t\t\t\t\tdata->len = _currentDataLen;\n\t\t\t\t\t\tmsg->obj = (void*)data;\n\n\t\t\t\t\t\tCC_SAFE_DELETE_ARRAY(_currentData);\n\t\t\t\t\t\t_currentData = nullptr;\n\t\t\t\t\t\t_currentDataLen = 0;\n\n\t\t\t\t\t\t_wsHelper->sendMessageToUIThread(msg);\n                    }\n                }\n            }\n            break;\n        default:\n            break;\n        \n\t}\n    \n\treturn 0;\n}\n\nvoid WebSocket::onUIThreadReceiveMessage(WsMessage* msg)\n{\n    switch (msg->what) {\n        case WS_MSG_TO_UITHREAD_OPEN:\n            {\n                _delegate->onOpen(this);\n            }\n            break;\n        case WS_MSG_TO_UITHREAD_MESSAGE:\n            {\n                Data* data = (Data*)msg->obj;\n                _delegate->onMessage(this, *data);\n                CC_SAFE_DELETE_ARRAY(data->bytes);\n                CC_SAFE_DELETE(data);\n            }\n            break;\n        case WS_MSG_TO_UITHREAD_CLOSE:\n            {\n                _delegate->onClose(this);\n            }\n            break;\n        case WS_MSG_TO_UITHREAD_ERROR:\n            {\n                // FIXME: The exact error needs to be checked.\n                WebSocket::ErrorCode err = ErrorCode::CONNECTION_FAILURE;\n                _delegate->onError(this, err);\n            }\n            break;\n        default:\n            break;\n    }\n}\n\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/network/WebSocket.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n\n\"[WebSocket module] is based in part on the work of the libwebsockets  project\n(http://libwebsockets.org)\"\n\n ****************************************************************************/\n\n#ifndef __CC_WEBSOCKET_H__\n#define __CC_WEBSOCKET_H__\n\n#include \"CCPlatformMacros.h\"\n#include \"CCStdC.h\"\n#include <list>\n#include <string>\n#include <vector>\n\nstruct libwebsocket;\nstruct libwebsocket_context;\nstruct libwebsocket_protocols;\n\nNS_CC_BEGIN\n\nnamespace network {\n\nclass WsThreadHelper;\nclass WsMessage;\n\nclass WebSocket\n{\npublic:\n    /**\n     * @js ctor\n     */\n    WebSocket();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~WebSocket();\n    \n    /**\n     *  @brief Data structure for message\n     */\n    struct Data\n    {\n        Data():bytes(nullptr), len(0), issued(0), isBinary(false){}\n        char* bytes;\n        ssize_t len, issued;\n        bool isBinary;\n    };\n    \n    /**\n     *  @brief Errors in websocket\n     */\n    enum class ErrorCode\n    {\n        TIME_OUT,\n        CONNECTION_FAILURE,\n        UNKNOWN,\n    };\n    \n    /**\n     *  Websocket state\n     */\n    enum class State\n    {\n        CONNECTING,\n        OPEN,\n        CLOSING,\n        CLOSED,\n    };\n\n    /**\n     *  @brief The delegate class to process websocket events.\n     */\n    class Delegate\n    {\n    public:\n        virtual ~Delegate() {}\n        virtual void onOpen(WebSocket* ws) = 0;\n        virtual void onMessage(WebSocket* ws, const Data& data) = 0;\n        virtual void onClose(WebSocket* ws) = 0;\n        virtual void onError(WebSocket* ws, const ErrorCode& error) = 0;\n    };\n    \n    \n    /**\n     *  @brief  The initialized method for websocket.\n     *          It needs to be invoked right after websocket instance is allocated.\n     *  @param  delegate The delegate which want to receive event from websocket.\n     *  @param  url      The URL of websocket server.\n     *  @return true: Success, false: Failure\n     */\n    bool init(const Delegate& delegate,\n              const std::string& url,\n              const std::vector<std::string>* protocols = nullptr);\n    \n    /**\n     *  @brief Sends string data to websocket server.\n     */\n    void send(const std::string& message);\n    \n    /**\n     *  @brief Sends binary data to websocket server.\n     */\n    void send(const unsigned char* binaryMsg, unsigned int len);\n    \n    /**\n     *  @brief Closes the connection to server.\n     */\n    void close();\n    \n    /**\n     *  @brief Gets current state of connection.\n     */\n    State getReadyState();\n    \nprivate:\n    virtual void onSubThreadStarted();\n    virtual int onSubThreadLoop();\n    virtual void onSubThreadEnded();\n    virtual void onUIThreadReceiveMessage(WsMessage* msg);\n    \n\n    friend class WebSocketCallbackWrapper;\n    int onSocketCallback(struct libwebsocket_context *ctx,\n                         struct libwebsocket *wsi,\n                         int reason,\n                         void *user, void *in, ssize_t len);\n    \nprivate:\n\tState        _readyState;\n    std::string  _host;\n    unsigned int _port;\n    std::string  _path;\n    \n    ssize_t _pendingFrameDataLen;\n    ssize_t _currentDataLen;\n    char *_currentData;\n\n    friend class WsThreadHelper;\n    WsThreadHelper* _wsHelper;\n    \n    struct libwebsocket*         _wsInstance;\n    struct libwebsocket_context* _wsContext;\n    Delegate* _delegate;\n    int _SSLConnection;\n    struct libwebsocket_protocols* _wsProtocols;\n};\n\n}\n\nNS_CC_END\n\n#endif /* defined(__CC_JSB_WEBSOCKET_H__) */\n"
  },
  {
    "path": "cocos2d/cocos/network/proj.win32/libNetwork.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\HttpClient.h\" />\n    <ClInclude Include=\"..\\HttpRequest.h\" />\n    <ClInclude Include=\"..\\HttpResponse.h\" />\n    <ClInclude Include=\"..\\SocketIO.h\" />\n    <ClInclude Include=\"..\\WebSocket.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\HttpClient.cpp\" />\n    <ClCompile Include=\"..\\SocketIO.cpp\" />\n    <ClCompile Include=\"..\\WebSocket.cpp\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libNetwork</ProjectName>\n    <ProjectGuid>{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}</ProjectGuid>\n    <RootNamespace>network.win32</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>NotSet</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(Configuration).win32\\</IntDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">false</LinkIncremental>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration).win32\\</IntDir>\n    <LinkIncremental Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">false</LinkIncremental>\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;..\\Include;$(EngineRoot)cocos;$(EngineRoot)external\\websockets\\include\\win32;$(EngineRoot)external\\curl\\include\\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>false</MinimalRebuild>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <DisableSpecificWarnings>4251</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <AdditionalDependencies>winmm.lib;libcocos2d.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>\n      <TargetMachine>MachineX86</TargetMachine>\n      <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;..\\Include;$(EngineRoot)cocos;$(EngineRoot)external\\websockets\\include\\win32;$(EngineRoot)external\\curl\\include\\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <DisableSpecificWarnings>4251</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <AdditionalDependencies>winmm.lib;libcocos2d.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <SubSystem>Windows</SubSystem>\n      <OptimizeReferences>true</OptimizeReferences>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>\n      <TargetMachine>MachineX86</TargetMachine>\n      <AdditionalLibraryDirectories>$(OutDir)</AdditionalLibraryDirectories>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/network/proj.win32/libNetwork.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>\n    </Filter>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\HttpClient.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\HttpRequest.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\HttpResponse.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\SocketIO.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\WebSocket.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\HttpClient.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\SocketIO.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\WebSocket.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsBody.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"CCPhysicsBody.h\"\n#if CC_USE_PHYSICS\n\n#include <climits>\n#include <algorithm>\n#include <cmath>\n\n#include \"chipmunk.h\"\n\n#include \"CCPhysicsShape.h\"\n#include \"CCPhysicsJoint.h\"\n#include \"CCPhysicsWorld.h\"\n\n#include \"chipmunk/CCPhysicsBodyInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsJointInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsWorldInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsShapeInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsHelper_chipmunk.h\"\n\nNS_CC_BEGIN\nextern const float PHYSICS_INFINITY;\n\nnamespace\n{\n    static const float MASS_DEFAULT = 1.0;\n    static const float MOMENT_DEFAULT = 200;\n}\n\nPhysicsBody::PhysicsBody()\n: _node(nullptr)\n, _world(nullptr)\n, _info(nullptr)\n, _dynamic(true)\n, _enable(true)\n, _rotationEnable(true)\n, _gravityEnable(true)\n, _massDefault(true)\n, _momentDefault(true)\n, _mass(MASS_DEFAULT)\n, _area(0.0f)\n, _density(0.0f)\n, _moment(MOMENT_DEFAULT)\n, _linearDamping(0.0f)\n, _angularDamping(0.0f)\n, _tag(0)\n, _categoryBitmask(UINT_MAX)\n, _collisionBitmask(UINT_MAX)\n, _contactTestBitmask(UINT_MAX)\n, _group(0)\n{\n}\n\nPhysicsBody::~PhysicsBody()\n{\n    for (auto it = _joints.begin(); it != _joints.end(); ++it)\n    {\n        PhysicsJoint* joint = *it;\n        \n        PhysicsBody* other = joint->getBodyA() == this ? joint->getBodyB() : joint->getBodyA();\n        other->removeJoint(joint);\n        delete joint;\n    }\n    \n    CC_SAFE_DELETE(_info);\n}\n\nPhysicsBody* PhysicsBody::create()\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::create(float mass)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body)\n    {\n        body->_mass = mass;\n        body->_massDefault = false;\n        if (body->init())\n        {\n            body->autorelease();\n            return body;\n        }\n    }\n    \n    CC_SAFE_DELETE(body);\n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::create(float mass, float moment)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body)\n    {\n        body->_mass = mass;\n        body->_massDefault = false;\n        body->_moment = moment;\n        body->_momentDefault = false;\n        if (body->init())\n        {\n            body->autorelease();\n            return body;\n        }\n    }\n    \n    CC_SAFE_DELETE(body);\n    return nullptr;\n    \n}\n\nPhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& material, const Point& offset)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->addShape(PhysicsShapeCircle::create(radius, material, offset));\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::createBox(const Size& size, const PhysicsMaterial& material, const Point& offset)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->addShape(PhysicsShapeBox::create(size, material, offset));\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::createPolygon(const Point* points, int count, const PhysicsMaterial& material, const Point& offset)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->addShape(PhysicsShapePolygon::create(points, count, material, offset));\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::createEdgeSegment(const Point& a, const Point& b, const PhysicsMaterial& material, float border/* = 1*/)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->addShape(PhysicsShapeEdgeSegment::create(a, b, material, border));\n        body->_dynamic = false;\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::createEdgeBox(const Size& size, const PhysicsMaterial& material, float border/* = 1*/, const Point& offset)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->addShape(PhysicsShapeEdgeBox::create(size, material, border, offset));\n        body->_dynamic = false;\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    \n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::createEdgePolygon(const Point* points, int count, const PhysicsMaterial& material, float border/* = 1*/)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->addShape(PhysicsShapeEdgePolygon::create(points, count, material, border));\n        body->_dynamic = false;\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    \n    return nullptr;\n}\n\nPhysicsBody* PhysicsBody::createEdgeChain(const Point* points, int count, const PhysicsMaterial& material, float border/* = 1*/)\n{\n    PhysicsBody* body = new PhysicsBody();\n    if (body && body->init())\n    {\n        body->addShape(PhysicsShapeEdgeChain::create(points, count, material, border));\n        body->_dynamic = false;\n        body->autorelease();\n        return body;\n    }\n    \n    CC_SAFE_DELETE(body);\n    \n    return nullptr;\n}\n\nbool PhysicsBody::init()\n{\n    do\n    {\n        _info = new PhysicsBodyInfo();\n        CC_BREAK_IF(_info == nullptr);\n        \n        _info->setBody(cpBodyNew(PhysicsHelper::float2cpfloat(_mass), PhysicsHelper::float2cpfloat(_moment)));\n        \n        CC_BREAK_IF(_info->getBody() == nullptr);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nvoid PhysicsBody::removeJoint(PhysicsJoint* joint)\n{\n    auto it = std::find(_joints.begin(), _joints.end(), joint);\n    \n    if (it != _joints.end())\n    {\n        _joints.erase(it);\n    }\n}\n\nvoid PhysicsBody::setDynamic(bool dynamic)\n{\n    if (dynamic != _dynamic)\n    {\n        _dynamic = dynamic;\n        if (dynamic)\n        {\n            cpBodySetMass(_info->getBody(), _mass);\n            cpBodySetMoment(_info->getBody(), _moment);\n            \n            if (_world != nullptr)\n            {\n                // reset the gravity enable\n                if (isGravityEnabled())\n                {\n                    _gravityEnable = false;\n                    setGravityEnable(true);\n                }\n                \n                cpSpaceAddBody(_world->_info->getSpace(), _info->getBody());\n            }\n        }\n        else\n        {\n            if (_world != nullptr)\n            {\n                cpSpaceRemoveBody(_world->_info->getSpace(), _info->getBody());\n            }\n            \n            // avoid incorrect collion simulation.\n            cpBodySetMass(_info->getBody(), PHYSICS_INFINITY);\n            cpBodySetMoment(_info->getBody(), PHYSICS_INFINITY);\n            cpBodySetVel(_info->getBody(), cpvzero);\n            cpBodySetAngVel(_info->getBody(), 0.0f);\n        }\n        \n    }\n}\n\nvoid PhysicsBody::setRotationEnable(bool enable)\n{\n    if (_rotationEnable != enable)\n    {\n        cpBodySetMoment(_info->getBody(), enable ? _moment : PHYSICS_INFINITY);\n        _rotationEnable = enable;\n    }\n}\n\nvoid PhysicsBody::setGravityEnable(bool enable)\n{\n    if (_gravityEnable != enable)\n    {\n        _gravityEnable = enable;\n        \n        if (_world != nullptr)\n        {\n            if (enable)\n            {\n                applyForce(_world->getGravity() * _mass);\n            }else\n            {\n                applyForce(-_world->getGravity() * _mass);\n            }\n        }\n    }\n}\n\nvoid PhysicsBody::setPosition(Point position)\n{\n    cpBodySetPos(_info->getBody(), PhysicsHelper::point2cpv(position));\n}\n\nvoid PhysicsBody::setRotation(float rotation)\n{\n    cpBodySetAngle(_info->getBody(), PhysicsHelper::float2cpfloat(rotation * M_PI / 180.0f));\n}\n\nPoint PhysicsBody::getPosition() const\n{\n    cpVect vec = cpBodyGetPos(_info->getBody());\n    return PhysicsHelper::cpv2point(vec);\n}\n\nfloat PhysicsBody::getRotation() const\n{\n    return -PhysicsHelper::cpfloat2float(cpBodyGetAngle(_info->getBody()) / M_PI * 180.0f);\n}\n\nPhysicsShape* PhysicsBody::addShape(PhysicsShape* shape, bool addMassAndMoment/* = true*/)\n{\n    if (shape == nullptr) return nullptr;\n    \n    // add shape to body\n    if (_shapes.getIndex(shape) == -1)\n    {\n        shape->setBody(this);\n        \n        // calculate the area, mass, and desity\n        // area must update before mass, because the density changes depend on it.\n        if (addMassAndMoment)\n        {\n            _area += shape->getArea();\n            addMass(shape->getMass());\n            addMoment(shape->getMoment());\n        }\n        \n        if (_world != nullptr)\n        {\n            _world->addShape(shape);\n        }\n        \n        _shapes.pushBack(shape);\n        \n        if (_group != CP_NO_GROUP && shape->getGroup() == CP_NO_GROUP)\n        {\n            shape->setGroup(_group);\n        }\n    }\n    \n    return shape;\n}\n\nvoid PhysicsBody::applyForce(const Vect& force)\n{\n    applyForce(force, Point::ZERO);\n}\n\nvoid PhysicsBody::applyForce(const Vect& force, const Point& offset)\n{\n    cpBodyApplyForce(_info->getBody(), PhysicsHelper::point2cpv(force), PhysicsHelper::point2cpv(offset));\n}\n\nvoid PhysicsBody::resetForces()\n{\n    cpBodyResetForces(_info->getBody());\n    \n    // if _gravityEnable is false, add a reverse of gravity force to body\n    if (_world != nullptr && !_gravityEnable)\n    {\n        applyForce(-_world->getGravity() * _mass);\n    }\n}\n\nvoid PhysicsBody::applyImpulse(const Vect& impulse)\n{\n    applyImpulse(impulse, Point());\n}\n\nvoid PhysicsBody::applyImpulse(const Vect& impulse, const Point& offset)\n{\n    cpBodyApplyImpulse(_info->getBody(), PhysicsHelper::point2cpv(impulse), PhysicsHelper::point2cpv(offset));\n}\n\nvoid PhysicsBody::applyTorque(float torque)\n{\n    cpBodySetTorque(_info->getBody(), PhysicsHelper::float2cpfloat(torque));\n}\n\nvoid PhysicsBody::setMass(float mass)\n{\n    if (mass <= 0)\n    {\n        return;\n    }\n    \n    _mass = mass;\n    _massDefault = false;\n    \n    // update density\n    if (_mass == PHYSICS_INFINITY)\n    {\n        _density = PHYSICS_INFINITY;\n    }\n    else\n    {\n        if (_area > 0)\n        {\n            _density = _mass / _area;\n        }else\n        {\n            _density = 0;\n        }\n    }\n    \n    // the static body's mass and moment is always infinity\n    if (_dynamic)\n    {\n        cpBodySetMass(_info->getBody(), PhysicsHelper::float2cpfloat(_mass));\n    }\n}\n\nvoid PhysicsBody::addMass(float mass)\n{\n    if (mass == PHYSICS_INFINITY)\n    {\n        _mass = PHYSICS_INFINITY;\n        _massDefault = false;\n        _density = PHYSICS_INFINITY;\n    }\n    else if (mass == -PHYSICS_INFINITY)\n    {\n        return;\n    }\n    else if (_mass != PHYSICS_INFINITY)\n    {\n        if (_massDefault)\n        {\n            _mass = 0;\n            _massDefault = false;\n        }\n        \n        if (_mass + mass > 0)\n        {\n            _mass +=  mass;\n        }else\n        {\n            _mass = MASS_DEFAULT;\n            _massDefault = true;\n        }\n        \n        if (_area > 0)\n        {\n            _density = _mass / _area;\n        }\n        else\n        {\n            _density = 0;\n        }\n    }\n    \n    // the static body's mass and moment is always infinity\n    if (_dynamic)\n    {\n        cpBodySetMass(_info->getBody(), PhysicsHelper::float2cpfloat(_mass));\n    }\n}\n\nvoid PhysicsBody::addMoment(float moment)\n{\n    if (moment == PHYSICS_INFINITY)\n    {\n        // if moment is PHYSICS_INFINITY, the moment of the body will become PHYSICS_INFINITY\n        _moment = PHYSICS_INFINITY;\n        _momentDefault = false;\n    }\n    else if (moment == -PHYSICS_INFINITY)\n    {\n        // if moment is -PHYSICS_INFINITY, it won't change\n        return;\n    }\n    else\n    {\n        // if moment of the body is PHYSICS_INFINITY is has no effect\n        if (_moment != PHYSICS_INFINITY)\n        {\n            if (_momentDefault)\n            {\n                _moment = 0;\n                _momentDefault = false;\n            }\n            \n            if (_moment + moment > 0)\n            {\n                _moment += moment;\n            }\n            else\n            {\n                _moment = MOMENT_DEFAULT;\n                _momentDefault = true;\n            }\n        }\n    }\n    \n    // the static body's mass and moment is always infinity\n    if (_rotationEnable && _dynamic)\n    {\n        cpBodySetMoment(_info->getBody(), PhysicsHelper::float2cpfloat(_moment));\n    }\n}\n\nvoid PhysicsBody::setVelocity(const Point& velocity)\n{\n    if (!_dynamic)\n    {\n        CCLOG(\"physics warning: your can't set velocity for a static body.\");\n        return;\n    }\n    \n    cpBodySetVel(_info->getBody(), PhysicsHelper::point2cpv(velocity));\n}\n\nPoint PhysicsBody::getVelocity()\n{\n    return PhysicsHelper::cpv2point(cpBodyGetVel(_info->getBody()));\n}\n\nPoint PhysicsBody::getVelocityAtLocalPoint(const Point& point)\n{\n    return PhysicsHelper::cpv2point(cpBodyGetVelAtLocalPoint(_info->getBody(), PhysicsHelper::point2cpv(point)));\n}\n\nPoint PhysicsBody::getVelocityAtWorldPoint(const Point& point)\n{\n    return PhysicsHelper::cpv2point(cpBodyGetVelAtWorldPoint(_info->getBody(), PhysicsHelper::point2cpv(point)));\n}\n\nvoid PhysicsBody::setAngularVelocity(float velocity)\n{\n    if (!_dynamic)\n    {\n        CCLOG(\"physics warning: your can't set angular velocity for a static body.\");\n        return;\n    }\n    \n    cpBodySetAngVel(_info->getBody(), PhysicsHelper::float2cpfloat(velocity));\n}\n\nfloat PhysicsBody::getAngularVelocity()\n{\n    return PhysicsHelper::cpfloat2float(cpBodyGetAngVel(_info->getBody()));\n}\n\nvoid PhysicsBody::setVelocityLimit(float limit)\n{\n    cpBodySetVelLimit(_info->getBody(), PhysicsHelper::float2cpfloat(limit));\n}\n\nfloat PhysicsBody::getVelocityLimit()\n{\n    return PhysicsHelper::cpfloat2float(cpBodyGetVelLimit(_info->getBody()));\n}\n\nvoid PhysicsBody::setAngularVelocityLimit(float limit)\n{\n    cpBodySetVelLimit(_info->getBody(), PhysicsHelper::float2cpfloat(limit));\n}\n\nfloat PhysicsBody::getAngularVelocityLimit()\n{\n    return PhysicsHelper::cpfloat2float(cpBodyGetAngVelLimit(_info->getBody()));\n}\n\nvoid PhysicsBody::setMoment(float moment)\n{\n    _moment = moment;\n    _momentDefault = false;\n    \n    // the static body's mass and moment is always infinity\n    if (_rotationEnable && _dynamic)\n    {\n        cpBodySetMoment(_info->getBody(), PhysicsHelper::float2cpfloat(_moment));\n    }\n}\n\nPhysicsShape* PhysicsBody::getShape(int tag) const\n{\n    for (auto& shape : _shapes)\n    {\n        if (shape->getTag() == tag)\n        {\n            return shape;\n        }\n    }\n    \n    return nullptr;\n}\n\nvoid PhysicsBody::removeShape(int tag, bool reduceMassAndMoment/* = true*/)\n{\n    for (auto& shape : _shapes)\n    {\n        if (shape->getTag() == tag)\n        {\n            removeShape(shape, reduceMassAndMoment);\n            return;\n        }\n    }\n}\n\nvoid PhysicsBody::removeShape(PhysicsShape* shape, bool reduceMassAndMoment/* = true*/)\n{\n    if (_shapes.getIndex(shape) != -1)\n    {\n        // deduce the area, mass and moment\n        // area must update before mass, because the density changes depend on it.\n        if (reduceMassAndMoment)\n        {\n            _area -= shape->getArea();\n            addMass(-shape->getMass());\n            addMoment(-shape->getMoment());\n        }\n        \n        //remove\n        if (_world)\n        {\n            _world->removeShape(shape);\n        }\n        \n        // set shape->_body = nullptr make the shape->setBody will not trigger the _body->removeShape function call.\n        shape->_body = nullptr;\n        shape->setBody(nullptr);\n        _shapes.eraseObject(shape);\n    }\n}\n\nvoid PhysicsBody::removeAllShapes(bool reduceMassAndMoment/* = true*/)\n{\n    for (auto& child : _shapes)\n    {\n        PhysicsShape* shape = dynamic_cast<PhysicsShape*>(child);\n        \n        // deduce the area, mass and moment\n        // area must update before mass, because the density changes depend on it.\n        if (reduceMassAndMoment)\n        {\n            _area -= shape->getArea();\n            addMass(-shape->getMass());\n            addMoment(-shape->getMoment());\n        }\n        \n        if (_world)\n        {\n            _world->removeShape(shape);\n        }\n        \n        // set shape->_body = nullptr make the shape->setBody will not trigger the _body->removeShape function call.\n        shape->_body = nullptr;\n        shape->setBody(nullptr);\n    }\n    \n    _shapes.clear();\n}\n\nvoid PhysicsBody::removeFromWorld()\n{\n    if (_world)\n    {\n        _world->removeBody(this);\n    }\n}\n\nvoid PhysicsBody::setEnable(bool enable)\n{\n    if (_enable != enable)\n    {\n        _enable = enable;\n        \n        if (_world)\n        {\n            if (enable)\n            {\n                _world->addBodyOrDelay(this);\n            }else\n            {\n                _world->removeBodyOrDelay(this);\n            }\n        }\n    }\n}\n\nbool PhysicsBody::isResting() const\n{\n    return cpBodyIsSleeping(_info->getBody()) == cpTrue;\n}\n\nvoid PhysicsBody::update(float delta)\n{\n    // damping compute\n    if (_dynamic && !isResting())\n    {\n        _info->getBody()->v.x *= cpfclamp(1.0f - delta * _linearDamping, 0.0f, 1.0f);\n        _info->getBody()->v.y *= cpfclamp(1.0f - delta * _linearDamping, 0.0f, 1.0f);\n        _info->getBody()->w *= cpfclamp(1.0f - delta * _angularDamping, 0.0f, 1.0f);\n    }\n}\n\nvoid PhysicsBody::setCategoryBitmask(int bitmask)\n{\n    _categoryBitmask = bitmask;\n    \n    for (auto& shape : _shapes)\n    {\n        shape->setCategoryBitmask(bitmask);\n    }\n}\n\nvoid PhysicsBody::setContactTestBitmask(int bitmask)\n{\n    _contactTestBitmask = bitmask;\n    \n    for (auto& shape : _shapes)\n    {\n        shape->setContactTestBitmask(bitmask);\n    }\n}\n\nvoid PhysicsBody::setCollisionBitmask(int bitmask)\n{\n    _collisionBitmask = bitmask;\n    \n    for (auto& shape : _shapes)\n    {\n        shape->setCollisionBitmask(bitmask);\n    }\n}\n\nvoid PhysicsBody::setGroup(int group)\n{\n    for (auto& shape : _shapes)\n    {\n        shape->setGroup(group);\n    }\n}\n\nPoint PhysicsBody::world2Local(const Point& point)\n{\n    return PhysicsHelper::cpv2point(cpBodyWorld2Local(_info->getBody(), PhysicsHelper::point2cpv(point)));\n}\n\nPoint PhysicsBody::local2World(const Point& point)\n{\n    return PhysicsHelper::cpv2point(cpBodyLocal2World(_info->getBody(), PhysicsHelper::point2cpv(point)));\n}\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsBody.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_BODY_H__\n#define __CCPHYSICS_BODY_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n#include \"CCPhysicsShape.h\"\n#include \"CCVector.h\"\n\nNS_CC_BEGIN\nclass Sprite;\nclass PhysicsWorld;\nclass PhysicsJoint;\nclass PhysicsBodyInfo;\n\ntypedef Point Vect;\n\n\nconst PhysicsMaterial PHYSICSBODY_MATERIAL_DEFAULT(0.1f, 0.5f, 0.5f);\n\n/**\n * A body affect by physics.\n * it can attach one or more shapes.\n * if you create body with createXXX, it will automatically compute mass and moment with density your specified(which is PHYSICSBODY_MATERIAL_DEFAULT by default, and the density value is 0.1f), and it based on the formular: mass = density * area.\n * if you create body with createEdgeXXX, the mass and moment will be PHYSICS_INFINITY by default. and it's a static body.\n * you can change mass and moment with setMass() and setMoment(). and you can change the body to be dynamic or static by use function setDynamic().\n */\nclass PhysicsBody : public Object\n{\npublic:\n    /** create a body with defult mass and moment. */\n    static PhysicsBody* create();\n    /** create a body with mass and defult moment. */\n    static PhysicsBody* create(float mass);\n    /** create a body with mass and moment. */\n    static PhysicsBody* create(float mass, float moment);\n    /** Create a body contains a circle shape. */\n    static PhysicsBody* createCircle(float radius, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    /** Create a body contains a box shape. */\n    static PhysicsBody* createBox(const Size& size, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    /**\n     * @brief Create a body contains a polygon shape.\n     * points is an array of Point structs defining a convex hull with a clockwise winding.\n     */\n    static PhysicsBody* createPolygon(const Point* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    \n    /** Create a body contains a EdgeSegment shape. */\n    static PhysicsBody* createEdgeSegment(const Point& a, const Point& b, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1);\n    /** Create a body contains a EdgeBox shape. */\n    static PhysicsBody* createEdgeBox(const Size& size, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1, const Point& offset = Point::ZERO);\n    /** Create a body contains a EdgePolygon shape. */\n    static PhysicsBody* createEdgePolygon(const Point* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1);\n    /** Create a body contains a EdgeChain shape. */\n    static PhysicsBody* createEdgeChain(const Point* points, int count, const PhysicsMaterial& material = PHYSICSBODY_MATERIAL_DEFAULT, float border = 1);\n    \n    /*\n     * @brief add a shape to body\n     * @param shape the shape to be added\n     * @param addMassAndMoment if this is true, the shape's mass and moment will be added to body. the default is true\n     */\n    virtual PhysicsShape* addShape(PhysicsShape* shape, bool addMassAndMoment = true);\n    /*\n     * @brief remove a shape from body\n     * @param shape the shape to be removed\n     * @param reduceMassAndMoment if this is true, the body mass and moment will be reduced by shape. the default is true\n     */\n    void removeShape(PhysicsShape* shape, bool reduceMassAndMoment = true);\n    /*\n     * @brief remove a shape from body\n     * @param tag the tag of the shape to be removed\n     * @param reduceMassAndMoment if this is true, the body mass and moment will be reduced by shape. the default is true\n     */\n    void removeShape(int tag, bool reduceMassAndMoment = true);\n    /* remove all shapes */\n    void removeAllShapes(bool reduceMassAndMoment = true);\n    /* get the body shapes. */\n    inline const Vector<PhysicsShape*>& getShapes() const { return _shapes; }\n    /* get the first shape of the body shapes. */\n    inline PhysicsShape* getFirstShape() const { return _shapes.size() >= 1 ? _shapes.at(0) : nullptr; }\n    /* get the shape of the body. */\n    PhysicsShape* getShape(int tag) const;\n    \n    /** Applies a immediate force to body. */\n    virtual void applyForce(const Vect& force);\n    /** Applies a immediate force to body. */\n    virtual void applyForce(const Vect& force, const Point& offset);\n    /** reset all the force applied to body. */\n    virtual void resetForces();\n    /** Applies a continuous force to body. */\n    virtual void applyImpulse(const Vect& impulse);\n    /** Applies a continuous force to body. */\n    virtual void applyImpulse(const Vect& impulse, const Point& offset);\n    /** Applies a torque force to body. */\n    virtual void applyTorque(float torque);\n    \n    /** set the velocity of a body */\n    virtual void setVelocity(const Vect& velocity);\n    /** get the velocity of a body */\n    virtual Point getVelocity();\n    /** set the angular velocity of a body */\n    virtual void setAngularVelocity(float velocity);\n    /** get the angular velocity of a body at a local point */\n    virtual Point getVelocityAtLocalPoint(const Point& point);\n    /** get the angular velocity of a body at a world point */\n    virtual Point getVelocityAtWorldPoint(const Point& point);\n    /** get the angular velocity of a body */\n    virtual float getAngularVelocity();\n    /** set the max of velocity */\n    virtual void setVelocityLimit(float limit);\n    /** get the max of velocity */\n    virtual float getVelocityLimit();\n    /** set the max of angular velocity */\n    virtual void setAngularVelocityLimit(float limit);\n    /** get the max of angular velocity */\n    virtual float getAngularVelocityLimit();\n    \n    /** remove the body from the world it added to */\n    void removeFromWorld();\n    \n    /** get the world body added to. */\n    inline PhysicsWorld* getWorld() const { return _world; }\n    /** get all joints the body have */\n    inline const std::vector<PhysicsJoint*>& getJoints() const { return _joints; }\n    \n    /** get the sprite the body set to. */\n    inline Node* getNode() const { return _node; }\n    \n    /**\n     * A mask that defines which categories this physics body belongs to.\n     * Every physics body in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. In conjunction with the collisionBitMask and contactTestBitMask properties, you define which physics bodies interact with each other and when your game is notified of these interactions.\n     * The default value is 0xFFFFFFFF (all bits set).\n     */\n    void setCategoryBitmask(int bitmask);\n    /** \n     * A mask that defines which categories of bodies cause intersection notifications with this physics body.\n     * When two bodies share the same space, each body’s category mask is tested against the other body’s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in.\n     * The default value is 0x00000000 (all bits cleared).\n     */\n    void setContactTestBitmask(int bitmask);\n    /**\n     * A mask that defines which categories of physics bodies can collide with this physics body.\n     * When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity.\n     * The default value is 0xFFFFFFFF (all bits set).\n     */\n    void setCollisionBitmask(int bitmask);\n    /** get the category bit mask */\n    inline int getCategoryBitmask() const { return _categoryBitmask; }\n    /** get the contact test bit mask */\n    inline int getContactTestBitmask() const { return _contactTestBitmask; }\n    /** get the collision bit mask */\n    inline int getCollisionBitmask() const { return _collisionBitmask; }\n    \n    /** \n     * set the group of body\n     * Collision groups let you specify an integral group index. You can have all fixtures with the same group index always collide (positive index) or never collide (negative index)\n     * it have high priority than bit masks\n     */\n    void setGroup(int group);\n    /** get the group of body */\n    inline int getGroup() const { return _group; }\n    \n    /** get the body position. */\n    Point getPosition() const;\n    /** get the body rotation. */\n    float getRotation() const;\n    \n    /**\n     * @brief test the body is dynamic or not.\n     * a dynamic body will effect with gravity.\n     */\n    inline bool isDynamic() const { return _dynamic; }\n    /**\n     * @brief set dynamic to body.\n     * a dynamic body will effect with gravity.\n     */\n    void setDynamic(bool dynamic);\n    \n    /**\n     * @brief set the body mass.\n     * @note if you need add/subtract mass to body, don't use setMass(getMass() +/- mass), because the mass of body may be equal to PHYSICS_INFINITY, it will cause some unexpected result, please use addMass() instead.\n     */\n    void setMass(float mass);\n    /** get the body mass. */\n    inline float getMass() const { return _mass; }\n    /**\n     * @brief add mass to body.\n     * if _mass(mass of the body) == PHYSICS_INFINITY, it remains.\n     * if mass == PHYSICS_INFINITY, _mass will be PHYSICS_INFINITY.\n     * if mass == -PHYSICS_INFINITY, _mass will not change.\n     * if mass + _mass <= 0, _mass will equal to MASS_DEFAULT(1.0)\n     * other wise, mass = mass + _mass;\n     */\n    void addMass(float mass);\n    \n    /**\n     * @brief set the body moment of inertia.\n     * @note if you need add/subtract moment to body, don't use setMoment(getMoment() +/- moment), because the moment of body may be equal to PHYSICS_INFINITY, it will cause some unexpected result, please use addMoment() instead.\n     */\n    void setMoment(float moment);\n    /** get the body moment of inertia. */\n    inline float getMoment(float moment) const { return _moment; }\n    /**\n     * @brief add moment of inertia to body.\n     * if _moment(moment of the body) == PHYSICS_INFINITY, it remains.\n     * if moment == PHYSICS_INFINITY, _moment will be PHYSICS_INFINITY.\n     * if moment == -PHYSICS_INFINITY, _moment will not change.\n     * if moment + _moment <= 0, _moment will equal to MASS_DEFAULT(1.0)\n     * other wise, moment = moment + _moment;\n     */\n    void addMoment(float moment);\n    /** get linear damping. */\n    inline float getLinearDamping() const { return _linearDamping; }\n    /** \n     * set linear damping.\n     * it is used to simulate fluid or air friction forces on the body. \n     * the value is 0.0f to 1.0f. \n     */\n    inline void setLinearDamping(float damping) { _linearDamping = damping; }\n    /** get angular damping. */\n    inline float getAngularDamping() const { return _angularDamping; }\n    /**\n     * set angular damping.\n     * it is used to simulate fluid or air friction forces on the body.\n     * the value is 0.0f to 1.0f.\n     */\n    inline void setAngularDamping(float damping) { _angularDamping = damping; }\n    \n    /** whether the body is at rest */\n    bool isResting() const;\n    /** \n     * whether the body is enabled\n     * if the body it isn't enabled, it will not has simulation by world\n     */\n    inline bool isEnabled() const { return _enable; }\n    /**\n     * set the enable value.\n     * if the body it isn't enabled, it will not has simulation by world\n     */\n    void setEnable(bool enable);\n    \n    /** whether the body can rotation */\n    inline bool isRotationEnabled() const { return _rotationEnable; }\n    /** set the body is allow rotation or not */\n    void setRotationEnable(bool enable);\n    \n    /** whether this physics body is affected by the physics world’s gravitational force. */\n    inline bool isGravityEnabled() const { return _gravityEnable; }\n    /** set the body is affected by the physics world's gravitational force or not. */\n    void setGravityEnable(bool enable);\n    \n    /** get the body's tag */\n    inline int getTag() const { return _tag; }\n    /** set the body's tag */\n    inline void setTag(int tag) { _tag = tag; }\n    \n    /** convert the world point to local */\n    Point world2Local(const Point& point);\n    /** convert the local point to world */\n    Point local2World(const Point& point);\n    \nprotected:\n    \n    bool init();\n    \n    virtual void setPosition(Point position);\n    virtual void setRotation(float rotation);\n    \n    virtual void update(float delta) override;\n    \n    void removeJoint(PhysicsJoint* joint);\n    \nprotected:\n    PhysicsBody();\n    virtual ~PhysicsBody();\n    \nprotected:\n    Node* _node;\n    std::vector<PhysicsJoint*> _joints;\n    Vector<PhysicsShape*> _shapes;\n    PhysicsWorld* _world;\n    PhysicsBodyInfo* _info;\n    bool _dynamic;\n    bool _enable;\n    bool _rotationEnable;\n    bool _gravityEnable;\n    bool _massDefault;\n    bool _momentDefault;\n    float _mass;\n    float _area;\n    float _density;\n    float _moment;\n    float _linearDamping;\n    float _angularDamping;\n    int _tag;\n    \n    int _categoryBitmask;\n    int _collisionBitmask;\n    int _contactTestBitmask;\n    int _group;\n    \n    friend class PhysicsWorld;\n    friend class PhysicsShape;\n    friend class PhysicsJoint;\n    friend class Node;\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_BODY_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsContact.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"CCPhysicsContact.h\"\n#if CC_USE_PHYSICS\n#include \"chipmunk.h\"\n\n#include \"CCPhysicsBody.h\"\n\n#include \"chipmunk/CCPhysicsContactInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsHelper_chipmunk.h\"\n\n#include \"CCEventCustom.h\"\n\nNS_CC_BEGIN\n\nconst char* PHYSICSCONTACT_EVENT_NAME = \"PhysicsContactEvent\";\n\nPhysicsContact::PhysicsContact()\n: Event(Event::Type::CUSTOM)\n, _world(nullptr)\n, _shapeA(nullptr)\n, _shapeB(nullptr)\n, _eventCode(EventCode::NONE)\n, _info(nullptr)\n, _notificationEnable(true)\n, _begin(false)\n, _result(true)\n, _data(nullptr)\n, _contactInfo(nullptr)\n, _contactData(nullptr)\n{\n    \n}\n\nPhysicsContact::~PhysicsContact()\n{\n    CC_SAFE_DELETE(_info);\n    CC_SAFE_DELETE(_contactData);\n}\n\nPhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b)\n{\n    PhysicsContact * contact = new PhysicsContact();\n    if(contact && contact->init(a, b))\n    {\n        return contact;\n    }\n    \n    CC_SAFE_DELETE(contact);\n    return nullptr;\n}\n\nbool PhysicsContact::init(PhysicsShape* a, PhysicsShape* b)\n{\n    do\n    {\n        CC_BREAK_IF(a == nullptr || b == nullptr);\n        \n        CC_BREAK_IF(!(_info = new PhysicsContactInfo(this)));\n        \n        _shapeA = a;\n        _shapeB = b;\n        \n        return true;\n    } while(false);\n    \n    return false;\n}\n\nvoid PhysicsContact::generateContactData()\n{\n    if (_contactInfo == nullptr)\n    {\n        return;\n    }\n    \n    cpArbiter* arb = static_cast<cpArbiter*>(_contactInfo);\n    _contactData = new PhysicsContactData();\n    _contactData->count = cpArbiterGetCount(arb);\n    for (int i=0; i<_contactData->count && i<PhysicsContactData::POINT_MAX; ++i)\n    {\n        _contactData->points[i] = PhysicsHelper::cpv2point(cpArbiterGetPoint(arb, i));\n    }\n    \n    _contactData->normal = _contactData->count > 0 ? PhysicsHelper::cpv2point(cpArbiterGetNormal(arb, 0)) : Point::ZERO;\n}\n\n// PhysicsContactPreSolve implementation\nPhysicsContactPreSolve::PhysicsContactPreSolve(PhysicsContactData* data, void* contactInfo)\n: _preContactData(data)\n, _contactInfo(contactInfo)\n{\n}\n\nPhysicsContactPreSolve::~PhysicsContactPreSolve()\n{\n    CC_SAFE_DELETE(_preContactData);\n}\n\nfloat PhysicsContactPreSolve::getElasticity() const\n{\n    return static_cast<cpArbiter*>(_contactInfo)->e;\n}\n\nfloat PhysicsContactPreSolve::getFriction() const\n{\n    return static_cast<cpArbiter*>(_contactInfo)->u;\n}\n\nPoint PhysicsContactPreSolve::getSurfaceVelocity() const\n{\n    return PhysicsHelper::cpv2point(static_cast<cpArbiter*>(_contactInfo)->surface_vr);\n}\n\nvoid PhysicsContactPreSolve::setElasticity(float elasticity)\n{\n    static_cast<cpArbiter*>(_contactInfo)->e = elasticity;\n}\n\nvoid PhysicsContactPreSolve::setFriction(float friction)\n{\n    static_cast<cpArbiter*>(_contactInfo)->u = friction;\n}\n\nvoid PhysicsContactPreSolve::setSurfaceVelocity(const Vect& velocity)\n{\n    static_cast<cpArbiter*>(_contactInfo)->surface_vr = PhysicsHelper::point2cpv(velocity);\n}\n\nvoid PhysicsContactPreSolve::ignore()\n{\n    cpArbiterIgnore(static_cast<cpArbiter*>(_contactInfo));\n}\n\n// PhysicsContactPostSolve implementation\nPhysicsContactPostSolve::PhysicsContactPostSolve(void* contactInfo)\n: _contactInfo(contactInfo)\n{\n    \n}\n\nPhysicsContactPostSolve::~PhysicsContactPostSolve()\n{\n    \n}\n\nfloat PhysicsContactPostSolve::getElasticity() const\n{\n    return static_cast<cpArbiter*>(_contactInfo)->e;\n}\n\nfloat PhysicsContactPostSolve::getFriction() const\n{\n    return static_cast<cpArbiter*>(_contactInfo)->u;\n}\n\nPoint PhysicsContactPostSolve::getSurfaceVelocity() const\n{\n    return PhysicsHelper::cpv2point(static_cast<cpArbiter*>(_contactInfo)->surface_vr);\n}\n\nEventListenerPhysicsContact::EventListenerPhysicsContact()\n: onContactBegin(nullptr)\n, onContactPreSolve(nullptr)\n, onContactPostSolve(nullptr)\n, onContactSeperate(nullptr)\n{\n}\n\nbool EventListenerPhysicsContact::init()\n{\n    auto func = [this](EventCustom* event) -> void\n    {\n        onEvent(event);\n    };\n    \n    return EventListenerCustom::init(PHYSICSCONTACT_EVENT_NAME, func);\n}\n\nvoid EventListenerPhysicsContact::onEvent(EventCustom* event)\n{\n    PhysicsContact& contact = *(PhysicsContact*)(event->getUserData());\n    \n    switch (contact.getEventCode())\n    {\n        case PhysicsContact::EventCode::BEGIN:\n        {\n            bool ret = true;\n            \n            if (onContactBegin != nullptr\n                && hitTest(contact.getShapeA(), contact.getShapeB()))\n            {\n                contact._begin = true;\n                contact.generateContactData();\n                \n                // the mask has high priority than _listener->onContactBegin.\n                // so if the mask test is false, the two bodies won't have collision.\n                if (ret)\n                {\n                    ret = onContactBegin(event, contact);\n                }else\n                {\n                    onContactBegin(event, contact);\n                }\n            }\n            \n            contact.setResult(ret);\n            break;\n        }\n        case PhysicsContact::EventCode::PRESOLVE:\n        {\n            bool ret = true;\n            \n            if (onContactPreSolve != nullptr\n                && hitTest(contact.getShapeA(), contact.getShapeB()))\n            {\n                PhysicsContactPreSolve solve(contact._begin ? nullptr : contact._contactData, contact._contactInfo);\n                contact._begin = false;\n                contact.generateContactData();\n                \n                ret = onContactPreSolve(event, contact, solve);\n            }\n            \n            contact.setResult(ret);\n            break;\n        }\n        case PhysicsContact::EventCode::POSTSOLVE:\n        {\n            if (onContactPostSolve != nullptr\n                && hitTest(contact.getShapeA(), contact.getShapeB()))\n            {\n                PhysicsContactPostSolve solve(contact._contactInfo);\n                onContactPostSolve(event, contact, solve);\n            }\n            break;\n        }\n        case PhysicsContact::EventCode::SEPERATE:\n        {\n            if (onContactSeperate != nullptr\n                && hitTest(contact.getShapeA(), contact.getShapeB()))\n            {\n                onContactSeperate(event, contact);\n            }\n            break;\n        }\n        default:\n            break;\n    }\n}\n\nEventListenerPhysicsContact::~EventListenerPhysicsContact()\n{\n    \n}\n\nEventListenerPhysicsContact* EventListenerPhysicsContact::create()\n{\n    EventListenerPhysicsContact* obj = new EventListenerPhysicsContact();\n    \n    if (obj != nullptr && obj->init())\n    {\n        obj->autorelease();\n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nbool EventListenerPhysicsContact::hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB)\n{\n    CC_UNUSED_PARAM(shapeA);\n    CC_UNUSED_PARAM(shapeB);\n    return true;\n}\n\nbool EventListenerPhysicsContact::checkAvailable()\n{\n    if (onContactBegin == nullptr && onContactPreSolve == nullptr\n        && onContactPostSolve == nullptr && onContactSeperate == nullptr)\n    {\n        CCASSERT(false, \"Invalid PhysicsContactListener.\");\n        return false;\n    }\n    \n    return true;\n}\n\nEventListenerPhysicsContact* EventListenerPhysicsContact::clone()\n{\n    EventListenerPhysicsContact* obj = EventListenerPhysicsContact::create();\n    \n    if (obj != nullptr)\n    {\n        obj->onContactBegin = onContactBegin;\n        obj->onContactPreSolve = onContactPreSolve;\n        obj->onContactPostSolve = onContactPostSolve;\n        obj->onContactSeperate = onContactSeperate;\n        \n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nEventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::create(PhysicsBody* bodyA, PhysicsBody* bodyB)\n{\n    EventListenerPhysicsContactWithBodies* obj = new EventListenerPhysicsContactWithBodies();\n    \n    if (obj != nullptr && obj->init())\n    {\n        obj->_a = bodyA;\n        obj->_b = bodyB;\n        obj->autorelease();\n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nEventListenerPhysicsContactWithBodies::EventListenerPhysicsContactWithBodies()\n: _a(nullptr)\n, _b(nullptr)\n{\n    \n}\n\nEventListenerPhysicsContactWithBodies::~EventListenerPhysicsContactWithBodies()\n{\n    \n}\n\n\nbool EventListenerPhysicsContactWithBodies::hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB)\n{\n    if ((shapeA->getBody() == _a && shapeB->getBody() == _b)\n        || (shapeA->getBody() == _b && shapeB->getBody() == _a))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nEventListenerPhysicsContactWithBodies* EventListenerPhysicsContactWithBodies::clone()\n{\n    EventListenerPhysicsContactWithBodies* obj = EventListenerPhysicsContactWithBodies::create(_a, _b);\n    \n    if (obj != nullptr)\n    {\n        obj->onContactBegin = onContactBegin;\n        obj->onContactPreSolve = onContactPreSolve;\n        obj->onContactPostSolve = onContactPostSolve;\n        obj->onContactSeperate = onContactSeperate;\n        \n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nEventListenerPhysicsContactWithShapes::EventListenerPhysicsContactWithShapes()\n: _a(nullptr)\n, _b(nullptr)\n{\n}\n\nEventListenerPhysicsContactWithShapes::~EventListenerPhysicsContactWithShapes()\n{\n}\n\nEventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::create(PhysicsShape* shapeA, PhysicsShape* shapeB)\n{\n    EventListenerPhysicsContactWithShapes* obj = new EventListenerPhysicsContactWithShapes();\n    \n    if (obj != nullptr && obj->init())\n    {\n        obj->_a = shapeA;\n        obj->_b = shapeB;\n        obj->autorelease();\n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nbool EventListenerPhysicsContactWithShapes::hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB)\n{\n    if ((shapeA == _a && shapeB == _b)\n        || (shapeA == _b && shapeB == _a))\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nEventListenerPhysicsContactWithShapes* EventListenerPhysicsContactWithShapes::clone()\n{\n    EventListenerPhysicsContactWithShapes* obj = EventListenerPhysicsContactWithShapes::create(_a, _b);\n    \n    if (obj != nullptr)\n    {\n        obj->onContactBegin = onContactBegin;\n        obj->onContactPreSolve = onContactPreSolve;\n        obj->onContactPostSolve = onContactPostSolve;\n        obj->onContactSeperate = onContactSeperate;\n        \n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nEventListenerPhysicsContactWithGroup::EventListenerPhysicsContactWithGroup()\n: _group(CP_NO_GROUP)\n{\n}\n\nEventListenerPhysicsContactWithGroup::~EventListenerPhysicsContactWithGroup()\n{\n}\n\nEventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::create(int group)\n{\n    EventListenerPhysicsContactWithGroup* obj = new EventListenerPhysicsContactWithGroup();\n    \n    if (obj != nullptr && obj->init())\n    {\n        obj->_group = group;\n        obj->autorelease();\n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nbool EventListenerPhysicsContactWithGroup::hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB)\n{\n    if (shapeA->getGroup() == _group || shapeB->getGroup() == _group)\n    {\n        return true;\n    }\n    \n    return false;\n}\n\nEventListenerPhysicsContactWithGroup* EventListenerPhysicsContactWithGroup::clone()\n{\n    EventListenerPhysicsContactWithGroup* obj = EventListenerPhysicsContactWithGroup::create(_group);\n    \n    if (obj != nullptr)\n    {\n        obj->onContactBegin = onContactBegin;\n        obj->onContactPreSolve = onContactPreSolve;\n        obj->onContactPostSolve = onContactPostSolve;\n        obj->onContactSeperate = onContactSeperate;\n        \n        return obj;\n    }\n    \n    CC_SAFE_DELETE(obj);\n    return nullptr;\n}\n\nNS_CC_END\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsContact.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_CONTACT_H__\n#define __CCPHYSICS_CONTACT_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n#include \"CCEventListenerCustom.h\"\n#include \"CCEvent.h\"\n\nNS_CC_BEGIN\n\nclass PhysicsShape;\nclass PhysicsBody;\nclass PhysicsWorld;\n\nclass PhysicsContactInfo;\n\ntypedef Point Vect;\n\ntypedef struct PhysicsContactData\n{\n    static const int POINT_MAX = 4;\n    Point points[POINT_MAX];\n    int   count;\n    Point normal;\n    \n    PhysicsContactData()\n    : count(0)\n    {}\n}PhysicsContactData;\n\n/**\n * @brief Contact infomation. it will created automatically when two shape contact with each other. and it will destoried automatically when two shape separated.\n */\nclass PhysicsContact : public Event\n{\npublic:\n    \n    enum class EventCode\n    {\n        NONE,\n        BEGIN,\n        PRESOLVE,\n        POSTSOLVE,\n        SEPERATE\n    };\n    \n    /** get contact shape A. */\n    inline PhysicsShape* getShapeA() const { return _shapeA; }\n    /** get contact shape B. */\n    inline PhysicsShape* getShapeB() const { return _shapeB; }\n    /** get contact data */\n    inline const PhysicsContactData* getContactData() const { return _contactData; }\n    /** get data. */\n    inline void* getData() const { return _data; }\n    /**\n     * @brief set data to contact. you must manage the memory yourself, Generally you can set data at contact begin, and distory it at contact seperate.\n     */\n    inline void setData(void* data) { _data = data; }\n    /** get the event code */\n    EventCode getEventCode() const { return _eventCode; };\n    \nprivate:\n    static PhysicsContact* construct(PhysicsShape* a, PhysicsShape* b);\n    bool init(PhysicsShape* a, PhysicsShape* b);\n    \n    void setEventCode(EventCode eventCode) { _eventCode = eventCode; };\n    inline bool isNotificationEnabled() const { return _notificationEnable; }\n    inline void setNotificationEnable(bool enable) { _notificationEnable = enable; }\n    inline PhysicsWorld* getWorld() const { return _world; }\n    inline void setWorld(PhysicsWorld* world) { _world = world; }\n    inline void setResult(bool result) { _result = result; }\n    inline bool resetResult() { bool ret = _result; _result = true; return ret; }\n    \n    void generateContactData();\n    \nprivate:\n    PhysicsContact();\n    ~PhysicsContact();\n    \nprivate:\n    PhysicsWorld* _world;\n    PhysicsShape* _shapeA;\n    PhysicsShape* _shapeB;\n    EventCode _eventCode;\n    PhysicsContactInfo* _info;\n    bool _notificationEnable;\n    bool _begin;\n    bool _result;\n    \n    void* _data;\n    void* _contactInfo;\n    PhysicsContactData* _contactData;\n    \n    friend class EventListenerPhysicsContact;\n    friend class PhysicsWorldCallback;\n    friend class PhysicsWorld;\n};\n\n/*\n * @brief presolve value generated when onContactPreSolve called.\n */\nclass PhysicsContactPreSolve\n{\npublic:\n    /** get elasticity between two bodies*/\n    float getElasticity() const;\n    /** get friction between two bodies*/\n    float getFriction() const;\n    /** get surface velocity between two bodies*/\n    Point getSurfaceVelocity() const;\n    /** set the elasticity*/\n    void setElasticity(float elasticity);\n    /** set the friction*/\n    void setFriction(float friction);\n    /** set the surface velocity*/\n    void setSurfaceVelocity(const Vect& velocity);\n    /** ignore the rest of the contact presolve and postsolve callbacks */\n    void ignore();\n    \nprivate:\n    PhysicsContactPreSolve(PhysicsContactData* data, void* contactInfo);\n    ~PhysicsContactPreSolve();\n    \nprivate:\n    float _elasticity;\n    float _friction;\n    Point _surfaceVelocity;\n    PhysicsContactData* _preContactData;\n    void* _contactInfo;\n    \n    friend class EventListenerPhysicsContact;\n};\n\n/*\n * @brief postsolve value generated when onContactPostSolve called.\n */\nclass PhysicsContactPostSolve\n{\npublic:\n    /** get elasticity between two bodies*/\n    float getElasticity() const;\n    /** get friction between two bodies*/\n    float getFriction() const;\n    /** get surface velocity between two bodies*/\n    Point getSurfaceVelocity() const;\n    \nprivate:\n    PhysicsContactPostSolve(void* contactInfo);\n    ~PhysicsContactPostSolve();\n    \nprivate:\n    void* _contactInfo;\n    \n    friend class EventListenerPhysicsContact;\n};\n\n/* contact listener. it will recive all the contact callbacks. */\nclass EventListenerPhysicsContact : public EventListenerCustom\n{\npublic:\n    /** create the listener */\n    static EventListenerPhysicsContact* create();\n    virtual bool checkAvailable() override;\n    virtual EventListenerPhysicsContact* clone() override;\n    \nprotected:\n    /**\n     * it will be call when two body have contact.\n     * if return false, it will not invoke callbacks\n     */\n    virtual bool hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB);\n    \npublic:\n    /*\n     * @brief it will called at two shapes start to contact, and only call it once.\n     */\n    std::function<bool(EventCustom* event, const PhysicsContact& contact)> onContactBegin;\n    /*\n     * @brief Two shapes are touching during this step. Return false from the callback to make world ignore the collision this step or true to process it normally. Additionally, you may override collision values, elasticity, or surface velocity values.\n     */\n    std::function<bool(EventCustom* event, const PhysicsContact& contact, const PhysicsContactPreSolve& solve)> onContactPreSolve;\n    /*\n     * @brief Two shapes are touching and their collision response has been processed. You can retrieve the collision impulse or kinetic energy at this time if you want to use it to calculate sound volumes or damage amounts. See cpArbiter for more info\n     */\n    std::function<void(EventCustom* event, const PhysicsContact& contact, const PhysicsContactPostSolve& solve)> onContactPostSolve;\n    /*\n     * @brief it will called at two shapes separated, and only call it once.\n     * onContactBegin and onContactSeperate will called in pairs.\n     */\n    std::function<void(EventCustom* event, const PhysicsContact& contact)> onContactSeperate;\n    \nprotected:\n    bool init();\n    void onEvent(EventCustom* event);\n    \nprotected:\n    EventListenerPhysicsContact();\n    virtual ~EventListenerPhysicsContact();\n    \n    friend class PhysicsWorld;\n};\n\n/** this event listener only be called when bodyA and bodyB have contacts */\nclass EventListenerPhysicsContactWithBodies : public EventListenerPhysicsContact\n{\npublic:\n    static EventListenerPhysicsContactWithBodies* create(PhysicsBody* bodyA, PhysicsBody* bodyB);\n    \n    virtual bool hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB) override;\n    virtual EventListenerPhysicsContactWithBodies* clone() override;\n    \nprotected:\n    PhysicsBody* _a;\n    PhysicsBody* _b;\n    \nprotected:\n    EventListenerPhysicsContactWithBodies();\n    virtual ~EventListenerPhysicsContactWithBodies();\n};\n\n/** this event listener only be called when shapeA and shapeB have contacts */\nclass EventListenerPhysicsContactWithShapes : public EventListenerPhysicsContact\n{\npublic:\n    static EventListenerPhysicsContactWithShapes* create(PhysicsShape* shapeA, PhysicsShape* shapeB);\n    \n    virtual bool hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB) override;\n    virtual EventListenerPhysicsContactWithShapes* clone() override;\n    \nprotected:\n    PhysicsShape* _a;\n    PhysicsShape* _b;\n    \nprotected:\n    EventListenerPhysicsContactWithShapes();\n    virtual ~EventListenerPhysicsContactWithShapes();\n};\n\n/** this event listener only be called when shapeA or shapeB is in the group your specified */\nclass EventListenerPhysicsContactWithGroup : public EventListenerPhysicsContact\n{\npublic:\n    static EventListenerPhysicsContactWithGroup* create(int group);\n    \n    virtual bool hitTest(PhysicsShape* shapeA, PhysicsShape* shapeB) override;\n    virtual EventListenerPhysicsContactWithGroup* clone() override;\n    \nprotected:\n    int _group;\n    \nprotected:\n    EventListenerPhysicsContactWithGroup();\n    virtual ~EventListenerPhysicsContactWithGroup();\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif //__CCPHYSICS_CONTACT_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsJoint.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsJoint.h\"\n#if CC_USE_PHYSICS\n#include \"chipmunk.h\"\n\n#include \"CCPhysicsBody.h\"\n#include \"CCPhysicsWorld.h\"\n\n#include \"chipmunk/CCPhysicsJointInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsBodyInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsShapeInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsHelper_chipmunk.h\"\n#include \"CCNode.h\"\n\nNS_CC_BEGIN\n\nPhysicsJoint::PhysicsJoint()\n: _bodyA(nullptr)\n, _bodyB(nullptr)\n, _world(nullptr)\n, _info(nullptr)\n, _enable(false)\n, _collisionEnable(true)\n, _destoryMark(false)\n, _tag(0)\n{\n    \n}\n\nPhysicsJoint::~PhysicsJoint()\n{\n    // reset the shapes collision group\n    setCollisionEnable(true);\n    \n    CC_SAFE_DELETE(_info);\n}\n\nbool PhysicsJoint::init(cocos2d::PhysicsBody *a, cocos2d::PhysicsBody *b)\n{\n    do\n    {\n        CCASSERT(a != nullptr && b != nullptr, \"the body passed in is nil\");\n        CCASSERT(a != b, \"the two bodies are equal\");\n        \n        CC_BREAK_IF(!(_info = new PhysicsJointInfo(this)));\n        \n        _bodyA = a;\n        _bodyA->_joints.push_back(this);\n        _bodyB = b;\n        _bodyB->_joints.push_back(this);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nvoid PhysicsJoint::setEnable(bool enable)\n{\n    if (_enable != enable)\n    {\n        _enable = enable;\n        \n        if (_world != nullptr)\n        {\n            if (enable)\n            {\n                _world->addJointOrDelay(this);\n            }else\n            {\n                _world->removeJointOrDelay(this);\n            }\n        }\n    }\n}\n\nPhysicsBodyInfo* PhysicsJoint::getBodyInfo(PhysicsBody* body) const\n{\n    return body->_info;\n}\n\nNode* PhysicsJoint::getBodyNode(PhysicsBody* body) const\n{\n    return body->_node;\n}\n\nvoid PhysicsJoint::setCollisionEnable(bool enable)\n{\n    if (_collisionEnable != enable)\n    {\n        _collisionEnable = enable;\n    }\n}\n\nvoid PhysicsJoint::removeFormWorld()\n{\n    if (_world)\n    {\n        _world->removeJoint(this, false);\n    }\n}\n\nvoid PhysicsJoint::destroy(PhysicsJoint* joint)\n{\n    if (joint!= nullptr)\n    {\n        // remove the joint and delete it.\n        if (joint->_world != nullptr)\n        {\n            joint->_world->removeJoint(joint, true);\n        }\n        else\n        {\n            if (joint->_bodyA != nullptr)\n            {\n                joint->_bodyA->removeJoint(joint);\n            }\n            \n            if (joint->_bodyB != nullptr)\n            {\n                joint->_bodyB->removeJoint(joint);\n            }\n            \n            delete joint;\n        }\n    }\n}\n\nvoid PhysicsJoint::setMaxForce(float force)\n{\n    for (cpConstraint* joint : _info->getJoints())\n    {\n        joint->maxForce = PhysicsHelper::float2cpfloat(force);\n    }\n}\n\nfloat PhysicsJoint::getMaxForce() const\n{\n    return PhysicsHelper::cpfloat2float(_info->getJoints().front()->maxForce);\n}\n\nPhysicsJointFixed* PhysicsJointFixed::construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr)\n{\n    PhysicsJointFixed* joint = new PhysicsJointFixed();\n    \n    if (joint && joint->init(a, b, anchr))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointFixed::init(PhysicsBody* a, PhysicsBody* b, const Point& anchr)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        getBodyNode(a)->setPosition(anchr);\n        getBodyNode(b)->setPosition(anchr);\n        \n        // add a pivot joint to fixed two body together\n        cpConstraint* joint = cpPivotJointNew(getBodyInfo(a)->getBody(), getBodyInfo(b)->getBody(),\n                                        PhysicsHelper::point2cpv(anchr));\n        CC_BREAK_IF(joint == nullptr);\n        _info->add(joint);\n        \n        // add a gear joint to make two body have the same rotation.\n        joint = cpGearJointNew(getBodyInfo(a)->getBody(), getBodyInfo(b)->getBody(), 0, 1);\n        CC_BREAK_IF(joint == nullptr);\n        _info->add(joint);\n        \n        setCollisionEnable(false);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nPhysicsJointPin* PhysicsJointPin::construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr)\n{\n    PhysicsJointPin* joint = new PhysicsJointPin();\n    \n    if (joint && joint->init(a, b, anchr))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointPin::init(PhysicsBody *a, PhysicsBody *b, const Point& anchr)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        cpConstraint* joint = cpPivotJointNew(getBodyInfo(a)->getBody(), getBodyInfo(b)->getBody(),\n                                       PhysicsHelper::point2cpv(anchr));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nPhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float min, float max)\n{\n    PhysicsJointLimit* joint = new PhysicsJointLimit();\n    \n    if (joint && joint->init(a, b, anchr1, anchr2, min, max))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nPhysicsJointLimit* PhysicsJointLimit::construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2)\n{\n    return construct(a, b, anchr1, anchr2, 0, b->local2World(anchr1).getDistance(a->local2World(anchr2)));\n}\n\nbool PhysicsJointLimit::init(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float min, float max)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpSlideJointNew(getBodyInfo(a)->getBody(), getBodyInfo(b)->getBody(),\n                                       PhysicsHelper::point2cpv(anchr1),\n                                       PhysicsHelper::point2cpv(anchr2),\n                                       PhysicsHelper::float2cpfloat(min),\n                                       PhysicsHelper::float2cpfloat(max));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsJointLimit::getMin() const\n{\n    return PhysicsHelper::cpfloat2float(cpSlideJointGetMin(_info->getJoints().front()));\n}\n\nvoid PhysicsJointLimit::setMin(float min)\n{\n    cpSlideJointSetMin(_info->getJoints().front(), PhysicsHelper::float2cpfloat(min));\n}\n\nfloat PhysicsJointLimit::getMax() const\n{\n    return PhysicsHelper::cpfloat2float(cpSlideJointGetMax(_info->getJoints().front()));\n}\n\nvoid PhysicsJointLimit::setMax(float max)\n{\n    cpSlideJointSetMax(_info->getJoints().front(), PhysicsHelper::float2cpfloat(max));\n}\n\nPoint PhysicsJointLimit::getAnchr1() const\n{\n    return PhysicsHelper::cpv2point(cpSlideJointGetAnchr1(_info->getJoints().front()));\n}\n\nvoid PhysicsJointLimit::setAnchr1(const Point& anchr)\n{\n    cpSlideJointSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr));\n}\n\nPoint PhysicsJointLimit::getAnchr2() const\n{\n    return PhysicsHelper::cpv2point(cpSlideJointGetAnchr2(_info->getJoints().front()));\n}\n\nvoid PhysicsJointLimit::setAnchr2(const Point& anchr)\n{\n    cpSlideJointSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr));\n}\n\nPhysicsJointDistance* PhysicsJointDistance::construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2)\n{\n    PhysicsJointDistance* joint = new PhysicsJointDistance();\n    \n    if (joint && joint->init(a, b, anchr1, anchr2))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointDistance::init(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpPinJointNew(getBodyInfo(a)->getBody(),\n                                            getBodyInfo(b)->getBody(),\n                                            PhysicsHelper::point2cpv(anchr1),\n                                            PhysicsHelper::point2cpv(anchr2));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsJointDistance::getDistance() const\n{\n    return PhysicsHelper::cpfloat2float(cpPinJointGetDist(_info->getJoints().front()));\n}\n\nvoid PhysicsJointDistance::setDistance(float distance)\n{\n    cpPinJointSetDist(_info->getJoints().front(), PhysicsHelper::float2cpfloat(distance));\n}\n\nPhysicsJointSpring* PhysicsJointSpring::construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float stiffness, float damping)\n{\n    PhysicsJointSpring* joint = new PhysicsJointSpring();\n    \n    if (joint && joint->init(a, b, anchr1, anchr2, stiffness, damping))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointSpring::init(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float stiffness, float damping)\n{\n    do {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpDampedSpringNew(getBodyInfo(a)->getBody(),\n                                                getBodyInfo(b)->getBody(),\n                                                PhysicsHelper::point2cpv(anchr1),\n                                                PhysicsHelper::point2cpv(anchr2),\n                                                PhysicsHelper::float2cpfloat(_bodyB->local2World(anchr1).getDistance(_bodyA->local2World(anchr2))),\n                                                PhysicsHelper::float2cpfloat(stiffness),\n                                                PhysicsHelper::float2cpfloat(damping));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nPoint PhysicsJointSpring::getAnchr1() const\n{\n    return PhysicsHelper::cpv2point(cpDampedSpringGetAnchr1(_info->getJoints().front()));\n}\n\nvoid PhysicsJointSpring::setAnchr1(const Point& anchr)\n{\n    cpDampedSpringSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr));\n}\n\nPoint PhysicsJointSpring::getAnchr2() const\n{\n    return PhysicsHelper::cpv2point(cpDampedSpringGetAnchr2(_info->getJoints().front()));\n}\n\nvoid PhysicsJointSpring::setAnchr2(const Point& anchr)\n{\n    cpDampedSpringSetAnchr1(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr));\n}\n\nfloat PhysicsJointSpring::getRestLength() const\n{\n    return PhysicsHelper::cpfloat2float(cpDampedSpringGetRestLength(_info->getJoints().front()));\n}\n\nvoid PhysicsJointSpring::setRestLength(float restLength)\n{\n    cpDampedSpringSetRestLength(_info->getJoints().front(), PhysicsHelper::float2cpfloat(restLength));\n}\n\nfloat PhysicsJointSpring::getStiffness() const\n{\n    return PhysicsHelper::cpfloat2float(cpDampedSpringGetStiffness(_info->getJoints().front()));\n}\n\nvoid PhysicsJointSpring::setStiffness(float stiffness)\n{\n    cpDampedSpringSetStiffness(_info->getJoints().front(), PhysicsHelper::float2cpfloat(stiffness));\n}\n\nfloat PhysicsJointSpring::getDamping() const\n{\n    return PhysicsHelper::cpfloat2float(cpDampedSpringGetDamping(_info->getJoints().front()));\n}\n\nvoid PhysicsJointSpring::setDamping(float damping)\n{\n    cpDampedSpringSetDamping(_info->getJoints().front(), PhysicsHelper::float2cpfloat(damping));\n}\n\nPhysicsJointGroove* PhysicsJointGroove::construct(PhysicsBody* a, PhysicsBody* b, const Point& grooveA, const Point& grooveB, const Point& anchr2)\n{\n    PhysicsJointGroove* joint = new PhysicsJointGroove();\n    \n    if (joint && joint->init(a, b, grooveA, grooveB, anchr2))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointGroove::init(PhysicsBody* a, PhysicsBody* b, const Point& grooveA, const Point& grooveB, const Point& anchr2)\n{\n    do {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpGrooveJointNew(getBodyInfo(a)->getBody(),\n                                               getBodyInfo(b)->getBody(),\n                                               PhysicsHelper::point2cpv(grooveA),\n                                               PhysicsHelper::point2cpv(grooveB),\n                                               PhysicsHelper::point2cpv(anchr2));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nPoint PhysicsJointGroove::getGrooveA() const\n{\n    return PhysicsHelper::cpv2point(cpGrooveJointGetGrooveA(_info->getJoints().front()));\n}\n\nvoid PhysicsJointGroove::setGrooveA(const Point& grooveA)\n{\n    cpGrooveJointSetGrooveA(_info->getJoints().front(), PhysicsHelper::point2cpv(grooveA));\n}\n\nPoint PhysicsJointGroove::getGrooveB() const\n{\n    return PhysicsHelper::cpv2point(cpGrooveJointGetGrooveB(_info->getJoints().front()));\n}\n\nvoid PhysicsJointGroove::setGrooveB(const Point& grooveB)\n{\n    cpGrooveJointSetGrooveB(_info->getJoints().front(), PhysicsHelper::point2cpv(grooveB));\n}\n\nPoint PhysicsJointGroove::getAnchr2() const\n{\n    return PhysicsHelper::cpv2point(cpGrooveJointGetAnchr2(_info->getJoints().front()));\n}\n\nvoid PhysicsJointGroove::setAnchr2(const Point& anchr2)\n{\n    cpGrooveJointSetAnchr2(_info->getJoints().front(), PhysicsHelper::point2cpv(anchr2));\n}\n\nPhysicsJointRotarySpring* PhysicsJointRotarySpring::construct(PhysicsBody* a, PhysicsBody* b, float stiffness, float damping)\n{\n    PhysicsJointRotarySpring* joint = new PhysicsJointRotarySpring();\n    \n    if (joint && joint->init(a, b, stiffness, damping))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointRotarySpring::init(PhysicsBody* a, PhysicsBody* b, float stiffness, float damping)\n{\n    do {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpDampedRotarySpringNew(getBodyInfo(a)->getBody(),\n                                                      getBodyInfo(b)->getBody(),\n                                                      PhysicsHelper::float2cpfloat(_bodyB->getRotation() - _bodyA->getRotation()),\n                                                      PhysicsHelper::float2cpfloat(stiffness),\n                                                      PhysicsHelper::float2cpfloat(damping));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsJointRotarySpring::getRestAngle() const\n{\n    return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetRestAngle(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRotarySpring::setRestAngle(float restAngle)\n{\n    cpDampedRotarySpringSetRestAngle(_info->getJoints().front(), PhysicsHelper::float2cpfloat(restAngle));\n}\n\nfloat PhysicsJointRotarySpring::getStiffness() const\n{\n    return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetStiffness(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRotarySpring::setStiffness(float stiffness)\n{\n    cpDampedRotarySpringSetStiffness(_info->getJoints().front(), PhysicsHelper::float2cpfloat(stiffness));\n}\n\nfloat PhysicsJointRotarySpring::getDamping() const\n{\n    return PhysicsHelper::cpfloat2float(cpDampedRotarySpringGetDamping(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRotarySpring::setDamping(float damping)\n{\n    cpDampedRotarySpringSetDamping(_info->getJoints().front(), PhysicsHelper::float2cpfloat(damping));\n}\n\nPhysicsJointRotaryLimit* PhysicsJointRotaryLimit::construct(PhysicsBody* a, PhysicsBody* b, float min, float max)\n{\n    PhysicsJointRotaryLimit* joint = new PhysicsJointRotaryLimit();\n    \n    if (joint && joint->init(a, b, min, max))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nPhysicsJointRotaryLimit* PhysicsJointRotaryLimit::construct(PhysicsBody* a, PhysicsBody* b)\n{\n    return construct(a, b, 0.0f, 0.0f);\n}\n\nbool PhysicsJointRotaryLimit::init(PhysicsBody* a, PhysicsBody* b, float min, float max)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpRotaryLimitJointNew(getBodyInfo(a)->getBody(),\n                                                    getBodyInfo(b)->getBody(),\n                                                    PhysicsHelper::float2cpfloat(min),\n                                                    PhysicsHelper::float2cpfloat(max));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsJointRotaryLimit::getMin() const\n{\n    return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMin(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRotaryLimit::setMin(float min)\n{\n    cpRotaryLimitJointSetMin(_info->getJoints().front(), PhysicsHelper::float2cpfloat(min));\n}\n\nfloat PhysicsJointRotaryLimit::getMax() const\n{\n    return PhysicsHelper::cpfloat2float(cpRotaryLimitJointGetMax(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRotaryLimit::setMax(float max)\n{\n    cpRotaryLimitJointSetMax(_info->getJoints().front(), PhysicsHelper::float2cpfloat(max));\n}\n\nPhysicsJointRatchet* PhysicsJointRatchet::construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet)\n{\n    PhysicsJointRatchet* joint = new PhysicsJointRatchet();\n    \n    if (joint && joint->init(a, b, phase, ratchet))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointRatchet::init(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpRatchetJointNew(getBodyInfo(a)->getBody(),\n                                                getBodyInfo(b)->getBody(),\n                                                PhysicsHelper::float2cpfloat(phase),\n                                                PhysicsHelper::cpfloat2float(ratchet));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsJointRatchet::getAngle() const\n{\n    return PhysicsHelper::cpfloat2float(cpRatchetJointGetAngle(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRatchet::setAngle(float angle)\n{\n    cpRatchetJointSetAngle(_info->getJoints().front(), PhysicsHelper::float2cpfloat(angle));\n}\n\nfloat PhysicsJointRatchet::getPhase() const\n{\n    return PhysicsHelper::cpfloat2float(cpRatchetJointGetPhase(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRatchet::setPhase(float phase)\n{\n    cpRatchetJointSetPhase(_info->getJoints().front(), PhysicsHelper::float2cpfloat(phase));\n}\n\nfloat PhysicsJointRatchet::getRatchet() const\n{\n    return PhysicsHelper::cpfloat2float(cpRatchetJointGetRatchet(_info->getJoints().front()));\n}\n\nvoid PhysicsJointRatchet::setRatchet(float ratchet)\n{\n    cpRatchetJointSetRatchet(_info->getJoints().front(), PhysicsHelper::float2cpfloat(ratchet));\n}\n\nPhysicsJointGear* PhysicsJointGear::construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet)\n{\n    PhysicsJointGear* joint = new PhysicsJointGear();\n    \n    if (joint && joint->init(a, b, phase, ratchet))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointGear::init(PhysicsBody* a, PhysicsBody* b, float phase, float ratio)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpGearJointNew(getBodyInfo(a)->getBody(),\n                                             getBodyInfo(b)->getBody(),\n                                             PhysicsHelper::float2cpfloat(phase),\n                                             PhysicsHelper::float2cpfloat(ratio));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsJointGear::getPhase() const\n{\n    return PhysicsHelper::cpfloat2float(cpGearJointGetPhase(_info->getJoints().front()));\n}\n\nvoid PhysicsJointGear::setPhase(float phase)\n{\n    cpGearJointSetPhase(_info->getJoints().front(), PhysicsHelper::float2cpfloat(phase));\n}\n\nfloat PhysicsJointGear::getRatio() const\n{\n    return PhysicsHelper::cpfloat2float(cpGearJointGetRatio(_info->getJoints().front()));\n}\n\nvoid PhysicsJointGear::setRatio(float ratio)\n{\n    cpGearJointSetRatio(_info->getJoints().front(), PhysicsHelper::float2cpfloat(ratio));\n}\n\nPhysicsJointMotor* PhysicsJointMotor::construct(PhysicsBody* a, PhysicsBody* b, float rate)\n{\n    PhysicsJointMotor* joint = new PhysicsJointMotor();\n    \n    if (joint && joint->init(a, b, rate))\n    {\n        return joint;\n    }\n    \n    CC_SAFE_DELETE(joint);\n    return nullptr;\n}\n\nbool PhysicsJointMotor::init(PhysicsBody* a, PhysicsBody* b, float rate)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsJoint::init(a, b));\n        \n        cpConstraint* joint = cpSimpleMotorNew(getBodyInfo(a)->getBody(),\n                                             getBodyInfo(b)->getBody(),\n                                             PhysicsHelper::float2cpfloat(rate));\n        \n        CC_BREAK_IF(joint == nullptr);\n        \n        _info->add(joint);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsJointMotor::getRate() const\n{\n    return PhysicsHelper::cpfloat2float(cpSimpleMotorGetRate(_info->getJoints().front()));\n}\n\nvoid PhysicsJointMotor::setRate(float rate)\n{\n    cpSimpleMotorSetRate(_info->getJoints().front(), PhysicsHelper::float2cpfloat(rate));\n}\n\nNS_CC_END\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsJoint.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_JOINT_H__\n#define __CCPHYSICS_JOINT_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN\n\nclass PhysicsBody;\nclass PhysicsWorld;\nclass PhysicsJointInfo;\nclass PhysicsBodyInfo;\n\n/*\n * @brief An PhysicsJoint object connects two physics bodies together.\n */\nclass PhysicsJoint\n{\nprotected:\n    PhysicsJoint();\n    virtual ~PhysicsJoint() = 0;\n\npublic:\n    inline PhysicsBody* getBodyA() const { return _bodyA; }\n    inline PhysicsBody* getBodyB() const { return _bodyB; }\n    inline PhysicsWorld* getWorld() const { return _world; }\n    inline int getTag() const { return _tag; }\n    inline void setTag(int tag) { _tag = tag; }\n    inline bool isEnabled() const { return _enable; }\n    /** Enable/Disable the joint */\n    void setEnable(bool enable);\n    inline bool isCollisionEnabled() const { return _collisionEnable; }\n    /** Enable/disable the collision between two bodies */\n    void setCollisionEnable(bool enable);\n    /** Remove the joint from the world */\n    void removeFormWorld();\n    /** Distory the joint*/\n    static void destroy(PhysicsJoint* joint);\n    \n    /** Set the max force between two bodies */\n    void setMaxForce(float force);\n    /** Get the max force setting */\n    float getMaxForce() const;\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b);\n    \n    /**\n     * PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. so this method is use for subclasses to catch the bodyInfo from PhysicsBody.\n     */\n    PhysicsBodyInfo* getBodyInfo(PhysicsBody* body) const;\n    Node* getBodyNode(PhysicsBody* body) const;\n    \nprotected:\n    PhysicsBody* _bodyA;\n    PhysicsBody* _bodyB;\n    PhysicsWorld* _world;\n    PhysicsJointInfo* _info;\n    bool _enable;\n    bool _collisionEnable;\n    bool _destoryMark;\n    int _tag;\n    \n    friend class PhysicsBody;\n    friend class PhysicsWorld;\n    friend class PhysicsDebugDraw;\n};\n\n/*\n * @brief A fixed joint fuses the two bodies together at a reference point. Fixed joints are useful for creating complex shapes that can be broken apart later.\n */\nclass PhysicsJointFixed : public PhysicsJoint\n{\npublic:\n    static PhysicsJointFixed* construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, const Point& anchr);\n    \nprotected:\n    PhysicsJointFixed() {}\n    virtual ~PhysicsJointFixed() {}\n};\n\n/*\n * @brief A limit joint imposes a maximum distance between the two bodies, as if they were connected by a rope.\n */\nclass PhysicsJointLimit : public PhysicsJoint\n{\npublic:\n    static PhysicsJointLimit* construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2);\n    static PhysicsJointLimit* construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float min, float max);\n    \n    Point getAnchr1() const;\n    void setAnchr1(const Point& anchr1);\n    Point getAnchr2() const;\n    void setAnchr2(const Point& anchr2);\n    float getMin() const;\n    void setMin(float min);\n    float getMax() const;\n    void setMax(float max);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float min, float max);\n    \nprotected:\n    PhysicsJointLimit() {}\n    virtual ~PhysicsJointLimit() {}\n};\n\n/*\n * @brief A pin joint allows the two bodies to independently rotate around the anchor point as if pinned together.\n */\nclass PhysicsJointPin : public PhysicsJoint\n{\npublic:\n    static PhysicsJointPin* construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, const Point& anchr);\n    \nprotected:\n    PhysicsJointPin() {}\n    virtual ~PhysicsJointPin() {}\n};\n\n/** Set the fixed distance with two bodies */\nclass PhysicsJointDistance : public PhysicsJoint\n{\npublic:\n    static PhysicsJointDistance* construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2);\n    \n    float getDistance() const;\n    void setDistance(float distance);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2);\n    \nprotected:\n    PhysicsJointDistance() {}\n    virtual ~PhysicsJointDistance() {}\n};\n\n/** Connecting two physics bodies together with a spring. */\nclass PhysicsJointSpring : public PhysicsJoint\n{\npublic:\n    static PhysicsJointSpring* construct(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float stiffness, float damping);\n    Point getAnchr1() const;\n    void setAnchr1(const Point& anchr1);\n    Point getAnchr2() const;\n    void setAnchr2(const Point& anchr2);\n    float getRestLength() const;\n    void setRestLength(float restLength);\n    float getStiffness() const;\n    void setStiffness(float stiffness);\n    float getDamping() const;\n    void setDamping(float damping);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, const Point& anchr1, const Point& anchr2, float stiffness, float damping);\n    \nprotected:\n    PhysicsJointSpring() {}\n    virtual ~PhysicsJointSpring() {}\n};\n\n/** Attach body a to a line, and attach body b to a dot */\nclass PhysicsJointGroove : public PhysicsJoint\n{\npublic:\n    static PhysicsJointGroove* construct(PhysicsBody* a, PhysicsBody* b, const Point& grooveA, const Point& grooveB, const Point& anchr2);\n    \n    Point getGrooveA() const;\n    void setGrooveA(const Point& grooveA);\n    Point getGrooveB() const;\n    void setGrooveB(const Point& grooveB);\n    Point getAnchr2() const;\n    void setAnchr2(const Point& anchr2);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, const Point& grooveA, const Point& grooveB, const Point& anchr);\n    \nprotected:\n    PhysicsJointGroove() {}\n    virtual ~PhysicsJointGroove() {}\n};\n\n/** Likes a spring joint, but works with rotary */\nclass PhysicsJointRotarySpring : public PhysicsJoint\n{\npublic:\n    static PhysicsJointRotarySpring* construct(PhysicsBody* a, PhysicsBody* b, float stiffness, float damping);\n    \n    float getRestAngle() const;\n    void setRestAngle(float restAngle);\n    float getStiffness() const;\n    void setStiffness(float stiffness);\n    float getDamping() const;\n    void setDamping(float damping);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, float stiffness, float damping);\n    \nprotected:\n    PhysicsJointRotarySpring() {}\n    virtual ~PhysicsJointRotarySpring() {}\n};\n\n/** Likes a limit joint, but works with rotary */\nclass PhysicsJointRotaryLimit : public PhysicsJoint\n{\npublic:\n    static PhysicsJointRotaryLimit* construct(PhysicsBody* a, PhysicsBody* b, float min, float max);\n    static PhysicsJointRotaryLimit* construct(PhysicsBody* a, PhysicsBody* b);\n    \n    float getMin() const;\n    void setMin(float min);\n    float getMax() const;\n    void setMax(float max);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, float min, float max);\n    \nprotected:\n    PhysicsJointRotaryLimit() {}\n    virtual ~PhysicsJointRotaryLimit() {}\n};\n\n/** Works like a socket wrench. */\nclass PhysicsJointRatchet : public PhysicsJoint\n{\npublic:\n    static PhysicsJointRatchet* construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet);\n    \n    float getAngle() const;\n    void setAngle(float angle);\n    float getPhase() const;\n    void setPhase(float phase);\n    float getRatchet() const;\n    void setRatchet(float ratchet);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, float phase, float ratchet);\n    \nprotected:\n    PhysicsJointRatchet() {}\n    virtual ~PhysicsJointRatchet() {}\n};\n\n/** Keeps the angular velocity ratio of a pair of bodies constant. */\nclass PhysicsJointGear : public PhysicsJoint\n{\npublic:\n    static PhysicsJointGear* construct(PhysicsBody* a, PhysicsBody* b, float phase, float ratio);\n    \n    float getPhase() const;\n    void setPhase(float phase);\n    float getRatio() const;\n    void setRatio(float ratchet);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, float phase, float ratio);\n    \nprotected:\n    PhysicsJointGear() {}\n    virtual ~PhysicsJointGear() {}\n};\n\n/** Keeps the relative angular velocity of a pair of bodies constant */\nclass PhysicsJointMotor : public PhysicsJoint\n{\npublic:\n    static PhysicsJointMotor* construct(PhysicsBody* a, PhysicsBody* b, float rate);\n    \n    float getRate() const;\n    void setRate(float rate);\n    \nprotected:\n    bool init(PhysicsBody* a, PhysicsBody* b, float rate);\n    \nprotected:\n    PhysicsJointMotor() {}\n    virtual ~PhysicsJointMotor() {}\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_JOINT_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsShape.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsShape.h\"\n#if CC_USE_PHYSICS\n\n#include <climits>\n\n#include \"chipmunk.h\"\n\n#include \"CCPhysicsBody.h\"\n#include \"CCPhysicsWorld.h\"\n\n#include \"chipmunk/CCPhysicsBodyInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsShapeInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsHelper_chipmunk.h\"\n\nNS_CC_BEGIN\nextern const float PHYSICS_INFINITY;\n\nPhysicsShape::PhysicsShape()\n: _body(nullptr)\n, _info(nullptr)\n, _type(Type::UNKNOWN)\n, _area(0)\n, _mass(0)\n, _moment(0)\n, _tag(0)\n, _categoryBitmask(UINT_MAX)\n, _collisionBitmask(UINT_MAX)\n, _contactTestBitmask(UINT_MAX)\n, _group(0)\n{\n    \n}\n\nPhysicsShape::~PhysicsShape()\n{\n    CC_SAFE_DELETE(_info);\n}\n\nbool PhysicsShape::init(Type type)\n{\n    _info = new PhysicsShapeInfo(this);\n    if (_info == nullptr) return false;\n    \n    _type = type;\n    \n    return true;\n}\n\nvoid PhysicsShape::setMass(float mass)\n{\n    if (mass < 0)\n    {\n        return;\n    }\n    \n    if (_body)\n    {\n        _body->addMass(-_mass);\n        _body->addMass(mass);\n    };\n    \n    _mass = mass;\n}\n\nvoid PhysicsShape::setMoment(float moment)\n{\n    if (moment < 0)\n    {\n        return;\n    }\n    \n    if (_body)\n    {\n        _body->addMoment(-_moment);\n        _body->addMoment(moment);\n    };\n    \n    _moment = moment;\n}\n\nvoid PhysicsShape::setMaterial(const PhysicsMaterial& material)\n{\n    setDensity(material.density);\n    setRestitution(material.restitution);\n    setFriction(material.friction);\n}\n\nPhysicsBodyInfo* PhysicsShape::bodyInfo() const\n{\n    if (_body != nullptr)\n    {\n        return _body->_info;\n    }else\n    {\n        return nullptr;\n    }\n}\n\nPhysicsShapeCircle::PhysicsShapeCircle()\n{\n    \n}\n\nPhysicsShapeCircle::~PhysicsShapeCircle()\n{\n    \n}\n\nPhysicsShapeBox::PhysicsShapeBox()\n{\n    \n}\n\nPhysicsShapeBox::~PhysicsShapeBox()\n{\n    \n}\n\nPhysicsShapePolygon::PhysicsShapePolygon()\n{\n    \n}\n\nPhysicsShapePolygon::~PhysicsShapePolygon()\n{\n    \n}\n\nPhysicsShapeEdgeBox::PhysicsShapeEdgeBox()\n{\n    \n}\n\nPhysicsShapeEdgeBox::~PhysicsShapeEdgeBox()\n{\n    \n}\n\nPhysicsShapeEdgeChain::PhysicsShapeEdgeChain()\n{\n    \n}\n\nPhysicsShapeEdgeChain::~PhysicsShapeEdgeChain()\n{\n    \n}\n\nPhysicsShapeEdgePolygon::PhysicsShapeEdgePolygon()\n{\n    \n}\n\nPhysicsShapeEdgePolygon::~PhysicsShapeEdgePolygon()\n{\n    \n}\n\nPhysicsShapeEdgeSegment::PhysicsShapeEdgeSegment()\n{\n    \n}\n\nPhysicsShapeEdgeSegment::~PhysicsShapeEdgeSegment()\n{\n    \n}\n\nvoid PhysicsShape::setDensity(float density)\n{\n    if (density < 0)\n    {\n        return;\n    }\n    \n    _material.density = density;\n    \n    if (_material.density == PHYSICS_INFINITY)\n    {\n        setMass(PHYSICS_INFINITY);\n    }else if (_area > 0)\n    {\n        setMass(PhysicsHelper::float2cpfloat(_material.density * _area));\n    }\n}\n\nvoid PhysicsShape::setRestitution(float restitution)\n{\n    _material.restitution = restitution;\n    \n    for (cpShape* shape : _info->getShapes())\n    {\n        cpShapeSetElasticity(shape, PhysicsHelper::float2cpfloat(restitution));\n    }\n}\n\nvoid PhysicsShape::setFriction(float friction)\n{\n    _material.friction = friction;\n    \n    for (cpShape* shape : _info->getShapes())\n    {\n        cpShapeSetFriction(shape, PhysicsHelper::float2cpfloat(friction));\n    }\n}\n\n\nvoid PhysicsShape::recenterPoints(Point* points, int count, const Point& center)\n{\n    cpVect* cpvs = new cpVect[count];\n    cpRecenterPoly(count, PhysicsHelper::points2cpvs(points, cpvs, count));\n    PhysicsHelper::cpvs2points(cpvs, points, count);\n    delete[] cpvs;\n    \n    if (center != Point::ZERO)\n    {\n        for (int i = 0; i < count; ++i)\n        {\n            points[i] += center;\n        }\n    }\n}\n\nPoint PhysicsShape::getPolyonCenter(const Point* points, int count)\n{\n    cpVect* cpvs = new cpVect[count];\n    cpVect center = cpCentroidForPoly(count, PhysicsHelper::points2cpvs(points, cpvs, count));\n    delete[] cpvs;\n    \n    return PhysicsHelper::cpv2point(center);\n}\n\nvoid PhysicsShape::setBody(PhysicsBody *body)\n{\n    // already added\n    if (body != nullptr && _body == body)\n    {\n        return;\n    }\n    \n    if (_body != nullptr)\n    {\n        _body->removeShape(this);\n    }\n    \n    if (body == nullptr)\n    {\n        _info->setBody(nullptr);\n        _body = nullptr;\n    }else\n    {\n        _info->setBody(body->_info->getBody());\n        _body = body;\n    }\n}\n\n// PhysicsShapeCircle\nPhysicsShapeCircle* PhysicsShapeCircle::create(float radius, const PhysicsMaterial& material/* = MaterialDefault*/, const Point& offset/* = Point(0, 0)*/)\n{\n    PhysicsShapeCircle* shape = new PhysicsShapeCircle();\n    if (shape && shape->init(radius, material, offset))\n    {\n        shape->autorelease();\n        return shape;\n    }\n    \n    CC_SAFE_DELETE(shape);\n    return nullptr;\n}\n\nbool PhysicsShapeCircle::init(float radius, const PhysicsMaterial& material/* = MaterialDefault*/, const Point& offset /*= Point(0, 0)*/)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsShape::init(Type::CIRCLE));\n        \n        cpShape* shape = cpCircleShapeNew(_info->getSharedBody(), radius, PhysicsHelper::point2cpv(offset));\n        \n        CC_BREAK_IF(shape == nullptr);\n        \n        _info->add(shape);\n        \n        _area = calculateArea();\n        _mass = material.density == PHYSICS_INFINITY ? PHYSICS_INFINITY : material.density * _area;\n        _moment = calculateDefaultMoment();\n        \n        setMaterial(material);\n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsShapeCircle::calculateArea(float radius)\n{\n    return PhysicsHelper::cpfloat2float(cpAreaForCircle(0, radius));\n}\n\nfloat PhysicsShapeCircle::calculateMoment(float mass, float radius, const Point& offset)\n{\n    return mass == PHYSICS_INFINITY ? PHYSICS_INFINITY\n    : PhysicsHelper::cpfloat2float(cpMomentForCircle(PhysicsHelper::float2cpfloat(mass),\n                                                     0,\n                                                     PhysicsHelper::float2cpfloat(radius),\n                                                     PhysicsHelper::point2cpv(offset)));\n}\n\nfloat PhysicsShapeCircle::calculateArea()\n{\n    return PhysicsHelper::cpfloat2float(cpAreaForCircle(0, cpCircleShapeGetRadius(_info->getShapes().front())));\n}\n\nfloat PhysicsShapeCircle::calculateDefaultMoment()\n{\n    cpShape* shape = _info->getShapes().front();\n    \n    return _mass == PHYSICS_INFINITY ? PHYSICS_INFINITY\n    : PhysicsHelper::cpfloat2float(cpMomentForCircle(PhysicsHelper::float2cpfloat(_mass),\n                                                     0,\n                                                     cpCircleShapeGetRadius(shape),\n                                                     cpCircleShapeGetOffset(shape)));\n}\n\nfloat PhysicsShapeCircle::getRadius() const\n{\n    return PhysicsHelper::cpfloat2float(cpCircleShapeGetRadius(_info->getShapes().front()));\n}\n\nPoint PhysicsShapeCircle::getOffset()\n{\n    return PhysicsHelper::cpv2point(cpCircleShapeGetOffset(_info->getShapes().front()));\n}\n\n// PhysicsShapeEdgeSegment\nPhysicsShapeEdgeSegment* PhysicsShapeEdgeSegment::create(const Point& a, const Point& b, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/)\n{\n    PhysicsShapeEdgeSegment* shape = new PhysicsShapeEdgeSegment();\n    if (shape && shape->init(a, b, material, border))\n    {\n        shape->autorelease();\n        return shape;\n    }\n    \n    CC_SAFE_DELETE(shape);\n    return nullptr;\n}\n\nbool PhysicsShapeEdgeSegment::init(const Point& a, const Point& b, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsShape::init(Type::EDGESEGMENT));\n        \n        cpShape* shape = cpSegmentShapeNew(_info->getSharedBody(),\n                                           PhysicsHelper::point2cpv(a),\n                                           PhysicsHelper::point2cpv(b),\n                                           PhysicsHelper::float2cpfloat(border));\n        \n        CC_BREAK_IF(shape == nullptr);\n        \n        _info->add(shape);\n        \n        _mass = PHYSICS_INFINITY;\n        _moment = PHYSICS_INFINITY;\n        _center = a.getMidpoint(b);\n        \n        \n        setMaterial(material);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nPoint PhysicsShapeEdgeSegment::getPointA() const\n{\n    return PhysicsHelper::cpv2point(((cpSegmentShape*)(_info->getShapes().front()))->ta);\n}\n\nPoint PhysicsShapeEdgeSegment::getPointB() const\n{\n    return PhysicsHelper::cpv2point(((cpSegmentShape*)(_info->getShapes().front()))->tb);\n}\n\nPoint PhysicsShapeEdgeSegment::getCenter()\n{\n    return _center;\n}\n\n// PhysicsShapeBox\nPhysicsShapeBox* PhysicsShapeBox::create(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, const Point& offset/* = Point(0, 0)*/)\n{\n    PhysicsShapeBox* shape = new PhysicsShapeBox();\n    if (shape && shape->init(size, material, offset))\n    {\n        shape->autorelease();\n        return shape;\n    }\n    \n    CC_SAFE_DELETE(shape);\n    return nullptr;\n}\n\nbool PhysicsShapeBox::init(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, const Point& offset /*= Point(0, 0)*/)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsShape::init(Type::BOX));\n        \n        cpVect wh = PhysicsHelper::size2cpv(size);\n        cpVect vec[4] =\n        {\n            {-wh.x/2.0f, -wh.y/2.0f}, {-wh.x/2.0f, wh.y/2.0f}, {wh.x/2.0f, wh.y/2.0f}, {wh.x/2.0f, -wh.y/2.0f}\n        };\n        \n        cpShape* shape = cpPolyShapeNew(_info->getSharedBody(), 4, vec, PhysicsHelper::point2cpv(offset));\n        \n        CC_BREAK_IF(shape == nullptr);\n        \n        _info->add(shape);\n        \n        _offset = offset;\n        _area = calculateArea();\n        _mass = material.density == PHYSICS_INFINITY ? PHYSICS_INFINITY : material.density * _area;\n        _moment = calculateDefaultMoment();\n        \n        setMaterial(material);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsShapeBox::calculateArea(const Size& size)\n{\n    cpVect wh = PhysicsHelper::size2cpv(size);\n    cpVect vec[4] =\n    {\n        {-wh.x/2.0f, -wh.y/2.0f}, {-wh.x/2.0f, wh.y/2.0f}, {wh.x/2.0f, wh.y/2.0f}, {wh.x/2.0f, -wh.y/2.0f}\n    };\n    return PhysicsHelper::cpfloat2float(cpAreaForPoly(4, vec));\n}\n\nfloat PhysicsShapeBox::calculateMoment(float mass, const Size& size, const Point& offset)\n{\n    cpVect wh = PhysicsHelper::size2cpv(size);\n    cpVect vec[4] =\n    {\n        {-wh.x/2.0f, -wh.y/2.0f}, {-wh.x/2.0f, wh.y/2.0f}, {wh.x/2.0f, wh.y/2.0f}, {wh.x/2.0f, -wh.y/2.0f}\n    };\n    \n    return mass == PHYSICS_INFINITY ? PHYSICS_INFINITY\n    : PhysicsHelper::cpfloat2float(cpMomentForPoly(PhysicsHelper::float2cpfloat(mass),\n                                                   4,\n                                                   vec,\n                                                   PhysicsHelper::point2cpv(offset)));\n}\n\nfloat PhysicsShapeBox::calculateArea()\n{\n    cpShape* shape = _info->getShapes().front();\n    return PhysicsHelper::cpfloat2float(cpAreaForPoly(((cpPolyShape*)shape)->numVerts, ((cpPolyShape*)shape)->verts));\n}\n\nfloat PhysicsShapeBox::calculateDefaultMoment()\n{\n    cpShape* shape = _info->getShapes().front();\n    return _mass == PHYSICS_INFINITY ? PHYSICS_INFINITY\n    : PhysicsHelper::cpfloat2float(cpMomentForPoly(_mass, ((cpPolyShape*)shape)->numVerts, ((cpPolyShape*)shape)->verts, cpvzero));\n}\n\nvoid PhysicsShapeBox::getPoints(Point* points) const\n{\n    cpShape* shape = _info->getShapes().front();\n    PhysicsHelper::cpvs2points(((cpPolyShape*)shape)->verts, points, ((cpPolyShape*)shape)->numVerts);\n}\n\nSize PhysicsShapeBox::getSize() const\n{\n    cpShape* shape = _info->getShapes().front();\n    return PhysicsHelper::cpv2size(cpv(cpvdist(cpPolyShapeGetVert(shape, 0), cpPolyShapeGetVert(shape, 1)),\n                                       cpvdist(cpPolyShapeGetVert(shape, 1), cpPolyShapeGetVert(shape, 2))));\n}\n\n// PhysicsShapePolygon\nPhysicsShapePolygon* PhysicsShapePolygon::create(const Point* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, const Point& offset/* = Point(0, 0)*/)\n{\n    PhysicsShapePolygon* shape = new PhysicsShapePolygon();\n    if (shape && shape->init(points, count, material, offset))\n    {\n        shape->autorelease();\n        return shape;\n    }\n    \n    CC_SAFE_DELETE(shape);\n    return nullptr;\n}\n\nbool PhysicsShapePolygon::init(const Point* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, const Point& offset/* = Point(0, 0)*/)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsShape::init(Type::POLYGEN));\n        \n        cpVect* vecs = new cpVect[count];\n        PhysicsHelper::points2cpvs(points, vecs, count);\n        cpShape* shape = cpPolyShapeNew(_info->getSharedBody(), count, vecs, PhysicsHelper::point2cpv(offset));\n        CC_SAFE_DELETE_ARRAY(vecs);\n        \n        CC_BREAK_IF(shape == nullptr);\n        \n        _info->add(shape);\n        \n        _area = calculateArea();\n        _mass = material.density == PHYSICS_INFINITY ? PHYSICS_INFINITY : material.density * _area;\n        _moment = calculateDefaultMoment();\n        _center = PhysicsHelper::cpv2point(cpCentroidForPoly(((cpPolyShape*)shape)->numVerts, ((cpPolyShape*)shape)->verts));\n        \n        setMaterial(material);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nfloat PhysicsShapePolygon::calculateArea(const Point* points, int count)\n{\n    cpVect* vecs = new cpVect[count];\n    PhysicsHelper::points2cpvs(points, vecs, count);\n    float area = PhysicsHelper::cpfloat2float(cpAreaForPoly(count, vecs));\n    CC_SAFE_DELETE_ARRAY(vecs);\n    \n    return area;\n}\n\nfloat PhysicsShapePolygon::calculateMoment(float mass, const Point* points, int count, const Point& offset)\n{\n    cpVect* vecs = new cpVect[count];\n    PhysicsHelper::points2cpvs(points, vecs, count);\n    float moment = mass == PHYSICS_INFINITY ? PHYSICS_INFINITY\n    : PhysicsHelper::cpfloat2float(cpMomentForPoly(mass, count, vecs, PhysicsHelper::point2cpv(offset)));\n    CC_SAFE_DELETE_ARRAY(vecs);\n    \n    return moment;\n}\n\nfloat PhysicsShapePolygon::calculateArea()\n{\n    cpShape* shape = _info->getShapes().front();\n    return PhysicsHelper::cpfloat2float(cpAreaForPoly(((cpPolyShape*)shape)->numVerts, ((cpPolyShape*)shape)->verts));\n}\n\nfloat PhysicsShapePolygon::calculateDefaultMoment()\n{\n    cpShape* shape = _info->getShapes().front();\n    return _mass == PHYSICS_INFINITY ? PHYSICS_INFINITY\n    : PhysicsHelper::cpfloat2float(cpMomentForPoly(_mass, ((cpPolyShape*)shape)->numVerts, ((cpPolyShape*)shape)->verts, cpvzero));\n}\n\nPoint PhysicsShapePolygon::getPoint(int i) const\n{\n    return PhysicsHelper::cpv2point(cpPolyShapeGetVert(_info->getShapes().front(), i));\n}\n\nvoid PhysicsShapePolygon::getPoints(Point* outPoints) const\n{\n    cpShape* shape = _info->getShapes().front();\n    PhysicsHelper::cpvs2points(((cpPolyShape*)shape)->verts, outPoints, ((cpPolyShape*)shape)->numVerts);\n}\n\nint PhysicsShapePolygon::getPointsCount() const\n{\n    return ((cpPolyShape*)_info->getShapes().front())->numVerts;\n}\n\nPoint PhysicsShapePolygon::getCenter()\n{\n    return _center;\n}\n\n// PhysicsShapeEdgeBox\nPhysicsShapeEdgeBox* PhysicsShapeEdgeBox::create(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/, const Point& offset/* = Point(0, 0)*/)\n{\n    PhysicsShapeEdgeBox* shape = new PhysicsShapeEdgeBox();\n    if (shape && shape->init(size, material, border, offset))\n    {\n        shape->autorelease();\n        return shape;\n    }\n    \n    CC_SAFE_DELETE(shape);\n    return nullptr;\n}\n\nbool PhysicsShapeEdgeBox::init(const Size& size, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/, const Point& offset/*= Point(0, 0)*/)\n{\n    do\n    {\n        CC_BREAK_IF(!PhysicsShape::init(Type::EDGEBOX));\n        \n        cpVect vec[4] = {};\n        vec[0] = PhysicsHelper::point2cpv(Point(-size.width/2+offset.x, -size.height/2+offset.y));\n        vec[1] = PhysicsHelper::point2cpv(Point(+size.width/2+offset.x, -size.height/2+offset.y));\n        vec[2] = PhysicsHelper::point2cpv(Point(+size.width/2+offset.x, +size.height/2+offset.y));\n        vec[3] = PhysicsHelper::point2cpv(Point(-size.width/2+offset.x, +size.height/2+offset.y));\n        \n        int i = 0;\n        for (; i < 4; ++i)\n        {\n            cpShape* shape = cpSegmentShapeNew(_info->getSharedBody(), vec[i], vec[(i+1)%4],\n                                               PhysicsHelper::float2cpfloat(border));\n            CC_BREAK_IF(shape == nullptr);\n            _info->add(shape);\n        }\n        CC_BREAK_IF(i < 4);\n        \n        _offset = offset;\n        _mass = PHYSICS_INFINITY;\n        _moment = PHYSICS_INFINITY;\n        \n        setMaterial(material);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nvoid PhysicsShapeEdgeBox::getPoints(cocos2d::Point *outPoints) const\n{\n    int i = 0;\n    for(auto shape : _info->getShapes())\n    {\n        outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)shape)->a);\n    }\n}\n\n// PhysicsShapeEdgeBox\nPhysicsShapeEdgePolygon* PhysicsShapeEdgePolygon::create(const Point* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/)\n{\n    PhysicsShapeEdgePolygon* shape = new PhysicsShapeEdgePolygon();\n    if (shape && shape->init(points, count, material, border))\n    {\n        shape->autorelease();\n        return shape;\n    }\n    \n    CC_SAFE_DELETE(shape);\n    return nullptr;\n}\n\nbool PhysicsShapeEdgePolygon::init(const Point* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/)\n{\n    cpVect* vec = nullptr;\n    do\n    {\n        CC_BREAK_IF(!PhysicsShape::init(Type::EDGEPOLYGEN));\n        \n        vec = new cpVect[count];\n        PhysicsHelper::points2cpvs(points, vec, count);\n        _center = PhysicsHelper::cpv2point(cpCentroidForPoly(count, vec));\n        \n        int i = 0;\n        for (; i < count; ++i)\n        {\n            cpShape* shape = cpSegmentShapeNew(_info->getSharedBody(), vec[i], vec[(i+1)%count],\n                                               PhysicsHelper::float2cpfloat(border));\n            CC_BREAK_IF(shape == nullptr);\n\t\t\tcpShapeSetElasticity(shape, 1.0f);\n\t\t\tcpShapeSetFriction(shape, 1.0f);\n            _info->add(shape);\n        }\n        CC_SAFE_DELETE_ARRAY(vec);\n        \n        CC_BREAK_IF(i < count);\n        \n        _mass = PHYSICS_INFINITY;\n        _moment = PHYSICS_INFINITY;\n        \n        setMaterial(material);\n        \n        return true;\n    } while (false);\n    \n    CC_SAFE_DELETE_ARRAY(vec);\n    \n    return false;\n}\n\nPoint PhysicsShapeEdgePolygon::getCenter()\n{\n    return _center;\n}\n\nvoid PhysicsShapeEdgePolygon::getPoints(cocos2d::Point *outPoints) const\n{\n    int i = 0;\n    for(auto shape : _info->getShapes())\n    {\n        outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)shape)->a);\n    }\n}\n\nint PhysicsShapeEdgePolygon::getPointsCount() const\n{\n    return static_cast<int>(_info->getShapes().size() + 1);\n}\n\n// PhysicsShapeEdgeChain\nPhysicsShapeEdgeChain* PhysicsShapeEdgeChain::create(const Point* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/)\n{\n    PhysicsShapeEdgeChain* shape = new PhysicsShapeEdgeChain();\n    if (shape && shape->init(points, count, material, border))\n    {\n        shape->autorelease();\n        return shape;\n    }\n    \n    CC_SAFE_DELETE(shape);\n    return nullptr;\n}\n\nbool PhysicsShapeEdgeChain::init(const Point* points, int count, const PhysicsMaterial& material/* = MaterialDefault*/, float border/* = 1*/)\n{\n    cpVect* vec = nullptr;\n    do\n    {\n        CC_BREAK_IF(!PhysicsShape::init(Type::EDGECHAIN));\n        \n        vec = new cpVect[count];\n        PhysicsHelper::points2cpvs(points, vec, count);\n        _center = PhysicsHelper::cpv2point(cpCentroidForPoly(count, vec));\n        \n        int i = 0;\n        for (; i < count - 1; ++i)\n        {\n            cpShape* shape = cpSegmentShapeNew(_info->getSharedBody(), vec[i], vec[i+1],\n                                               PhysicsHelper::float2cpfloat(border));\n            CC_BREAK_IF(shape == nullptr);\n\t\t\tcpShapeSetElasticity(shape, 1.0f);\n\t\t\tcpShapeSetFriction(shape, 1.0f);\n            _info->add(shape);\n        }\n        CC_SAFE_DELETE_ARRAY(vec);\n        CC_BREAK_IF(i < count);\n        \n        _mass = PHYSICS_INFINITY;\n        _moment = PHYSICS_INFINITY;\n        \n        setMaterial(material);\n        \n        return true;\n    } while (false);\n    \n    CC_SAFE_DELETE_ARRAY(vec);\n    \n    return false;\n}\n\nPoint PhysicsShapeEdgeChain::getCenter()\n{\n    return _center;\n}\n\nvoid PhysicsShapeEdgeChain::getPoints(Point* outPoints) const\n{\n    int i = 0;\n    for(auto shape : _info->getShapes())\n    {\n        outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)shape)->a);\n    }\n    \n    outPoints[i++] = PhysicsHelper::cpv2point(((cpSegmentShape*)_info->getShapes().back())->a);\n}\n\nint PhysicsShapeEdgeChain::getPointsCount() const\n{\n    return static_cast<int>(_info->getShapes().size() + 1);\n}\n\nvoid PhysicsShape::setGroup(int group)\n{\n    if (group < 0)\n    {\n        for (auto shape : _info->getShapes())\n        {\n            cpShapeSetGroup(shape, (cpGroup)group);\n        }\n    }\n    \n    _group = group;\n}\n\nbool PhysicsShape::containsPoint(const Point& point) const\n{\n    for (auto shape : _info->getShapes())\n    {\n        if (cpShapePointQuery(shape, PhysicsHelper::point2cpv(point)))\n        {\n            return true;\n        }\n    }\n    \n    return false;\n}\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsShape.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_SHAPE_H__\n#define __CCPHYSICS_SHAPE_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN\n\nclass PhysicsShapeInfo;\nclass PhysicsBody;\nclass PhysicsBodyInfo;\n\n\ntypedef struct PhysicsMaterial\n{\n    float density;          ///< The density of the object.\n    float restitution;      ///< The bounciness of the physics body.\n    float friction;         ///< The roughness of the surface of a shape.\n    \n    PhysicsMaterial()\n    : density(0.0f)\n    , restitution(0.0f)\n    , friction(0.0f)\n    {}\n    \n    PhysicsMaterial(float aDensity, float aRestitution, float aFriction)\n    : density(aDensity)\n    , restitution(aRestitution)\n    , friction(aFriction)\n    {}\n}PhysicsMaterial;\n\nconst PhysicsMaterial PHYSICSSHAPE_MATERIAL_DEFAULT(0.0f, 0.5f, 0.5f);\n\n/**\n * @brief A shape for body. You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see how to create it.\n */\nclass PhysicsShape : public Object\n{\npublic:\n    enum class Type\n    {\n        UNKNOWN,\n        CIRCLE,\n        BOX,\n        POLYGEN,\n        EDGESEGMENT,\n        EDGEBOX,\n        EDGEPOLYGEN,\n        EDGECHAIN,\n    };\n    \npublic:\n    /** Get the body that this shape attaches */\n    inline PhysicsBody* getBody() const { return _body; }\n    /** Return the type of this shape */\n    inline Type getType() const { return _type; }\n    /** return the area of this shape */\n    inline float getArea() const { return _area; }\n    /** get moment */\n    inline float getMoment() const { return _moment; }\n    /** Set moment, it will change the body's moment this shape attaches */\n    void setMoment(float moment);\n    inline void setTag(int tag) { _tag = tag; }\n    inline int getTag() const { return _tag; }\n    \n    /** get mass */\n    inline float getMass() const { return _mass; }\n    /** Set mass, it will change the body's mass this shape attaches */\n    void setMass(float mass);\n    inline float getDensity() const { return _material.density; }\n    void setDensity(float density);\n    inline float getRestitution() const { return _material.restitution; }\n    void setRestitution(float restitution);\n    inline float getFriction() const { return _material.friction; }\n    void setFriction(float friction);\n    const PhysicsMaterial& getMaterial() const { return _material; }\n    void setMaterial(const PhysicsMaterial& material);\n    \n    /** Calculate the default moment value */\n    virtual float calculateDefaultMoment() { return 0.0f; }\n    /** Get offset */\n    virtual Point getOffset() { return Point::ZERO; }\n    /** Get center of this shape */\n    virtual Point getCenter() { return getOffset(); }\n    /** Test point is in shape or not */\n    bool containsPoint(const Point& point) const;\n    \n    /** move the points to the center */\n    static void recenterPoints(Point* points, int count, const Point& center = Point::ZERO);\n    /** get center of the polyon points */\n    static Point getPolyonCenter(const Point* points, int count);\n    \n    /**\n     * A mask that defines which categories this physics body belongs to.\n     * Every physics body in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. In conjunction with the collisionBitMask and contactTestBitMask properties, you define which physics bodies interact with each other and when your game is notified of these interactions.\n     * The default value is 0xFFFFFFFF (all bits set).\n     */\n    inline void setCategoryBitmask(int bitmask) { _categoryBitmask = bitmask; }\n    inline int getCategoryBitmask() const { return _categoryBitmask; }\n    /**\n     * A mask that defines which categories of bodies cause intersection notifications with this physics body.\n     * When two bodies share the same space, each body’s category mask is tested against the other body’s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in.\n     * The default value is 0x00000000 (all bits cleared).\n     */\n    inline void setContactTestBitmask(int bitmask) { _contactTestBitmask = bitmask; }\n    inline int getContactTestBitmask() const { return _contactTestBitmask; }\n    /**\n     * A mask that defines which categories of physics bodies can collide with this physics body.\n     * When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity.\n     * The default value is 0xFFFFFFFF (all bits set).\n     */\n    inline void setCollisionBitmask(int bitmask) { _collisionBitmask = bitmask; }\n    inline int getCollisionBitmask() const { return _collisionBitmask; }\n    \n    void setGroup(int group);\n    inline int getGroup() { return _group; }\n    \nprotected:\n    bool init(Type type);\n    \n    /**\n     * @brief PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. so this method is use for subclasses to catch the bodyInfo from PhysicsBody.\n     */\n    PhysicsBodyInfo* bodyInfo() const;\n    \n    void setBody(PhysicsBody* body);\n    \n    /** calculate the area of this shape */\n    virtual float calculateArea() { return 0.0f; }\n    \nprotected:\n    PhysicsShape();\n    virtual ~PhysicsShape() = 0;\n    \nprotected:\n    PhysicsBody* _body;\n    PhysicsShapeInfo* _info;\n    Type _type;\n    float _area;\n    float _mass;\n    float _moment;\n    PhysicsMaterial _material;\n    int _tag;\n    int    _categoryBitmask;\n    int    _collisionBitmask;\n    int    _contactTestBitmask;\n    int    _group;\n    \n    friend class PhysicsWorld;\n    friend class PhysicsBody;\n    friend class PhysicsJoint;\n    friend class PhysicsDebugDraw;\n};\n\n/** A circle shape */\nclass PhysicsShapeCircle : public PhysicsShape\n{\npublic:\n    static PhysicsShapeCircle* create(float radius, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Point& offset = Point(0, 0));\n    static float calculateArea(float radius);\n    static float calculateMoment(float mass, float radius, const Point& offset = Point::ZERO);\n    \n    virtual float calculateDefaultMoment() override;\n    \n    float getRadius() const;\n    virtual Point getOffset() override;\nprotected:\n    bool init(float radius, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    virtual float calculateArea() override;\n    \nprotected:\n    PhysicsShapeCircle();\n    virtual ~PhysicsShapeCircle();\n};\n\n/** A box shape */\nclass PhysicsShapeBox : public PhysicsShape\n{\npublic:\n    static PhysicsShapeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    static float calculateArea(const Size& size);\n    static float calculateMoment(float mass, const Size& size, const Point& offset = Point::ZERO);\n    \n    virtual float calculateDefaultMoment() override;\n    \n    void getPoints(Point* outPoints) const;\n    int getPointsCount() const { return 4; }\n    Size getSize() const;\n    virtual Point getOffset() override { return _offset; }\n    \nprotected:\n    bool init(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    virtual float calculateArea() override;\n    \nprotected:\n    PhysicsShapeBox();\n    virtual ~PhysicsShapeBox();\n    \nprotected:\n    Point _offset;\n};\n\n/** A polygon shape */\nclass PhysicsShapePolygon : public PhysicsShape\n{\npublic:\n    static PhysicsShapePolygon* create(const Point* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    static float calculateArea(const Point* points, int count);\n    static float calculateMoment(float mass, const Point* points, int count, const Point& offset = Point::ZERO);\n    \n    float calculateDefaultMoment() override;\n    \n    Point getPoint(int i) const;\n    void getPoints(Point* outPoints) const;\n    int getPointsCount() const;\n    virtual Point getCenter() override;\nprotected:\n    bool init(const Point* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, const Point& offset = Point::ZERO);\n    float calculateArea() override;\n    \nprotected:\n    PhysicsShapePolygon();\n    virtual ~PhysicsShapePolygon();\n    \nprotected:\n    Point _center;\n};\n\n/** A segment shape */\nclass PhysicsShapeEdgeSegment : public PhysicsShape\n{\npublic:\n    static PhysicsShapeEdgeSegment* create(const Point& a, const Point& b, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1);\n    \n    Point getPointA() const;\n    Point getPointB() const;\n    virtual Point getCenter() override;\n    \nprotected:\n    bool init(const Point& a, const Point& b, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1);\n    \nprotected:\n    PhysicsShapeEdgeSegment();\n    virtual ~PhysicsShapeEdgeSegment();\n    \nprotected:\n    Point _center;\n    \n    friend class PhysicsBody;\n};\n\n/** An edge box shape */\nclass PhysicsShapeEdgeBox : public PhysicsShape\n{\npublic:\n    static PhysicsShapeEdgeBox* create(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 0, const Point& offset = Point::ZERO);\n    virtual Point getOffset() override { return _offset; }\n    void getPoints(Point* outPoints) const;\n    int getPointsCount() const { return 4; }\n    \nprotected:\n    bool init(const Size& size, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1, const Point& offset = Point::ZERO);\n    \nprotected:\n    PhysicsShapeEdgeBox();\n    virtual ~PhysicsShapeEdgeBox();\n    \nprotected:\n    Point _offset;\n    \n    friend class PhysicsBody;\n};\n\n/** An edge polygon shape */\nclass PhysicsShapeEdgePolygon : public PhysicsShape\n{\npublic:\n    static PhysicsShapeEdgePolygon* create(const Point* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1);\n    virtual Point getCenter() override;\n    void getPoints(Point* outPoints) const;\n    int getPointsCount() const;\n    \nprotected:\n    bool init(const Point* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1);\n    \nprotected:\n    PhysicsShapeEdgePolygon();\n    virtual ~PhysicsShapeEdgePolygon();\n    \n    friend class PhysicsBody;\n    \nprotected:\n    Point _center;\n};\n\n/** a chain shape */\nclass PhysicsShapeEdgeChain : public PhysicsShape\n{\npublic:\n    static PhysicsShapeEdgeChain* create(const Point* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1);\n    virtual Point getCenter() override;\n    void getPoints(Point* outPoints) const;\n    int getPointsCount() const;\n    \nprotected:\n    bool init(const Point* points, int count, const PhysicsMaterial& material = PHYSICSSHAPE_MATERIAL_DEFAULT, float border = 1);\n    \nprotected:\n    PhysicsShapeEdgeChain();\n    virtual ~PhysicsShapeEdgeChain();\n    \nprotected:\n    Point _center;\n    \n    friend class PhysicsBody;\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_FIXTURE_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsWorld.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsWorld.h\"\n#if CC_USE_PHYSICS\n\n#include <climits>\n\n#include \"chipmunk.h\"\n\n#include \"CCPhysicsBody.h\"\n#include \"CCPhysicsShape.h\"\n#include \"CCPhysicsContact.h\"\n#include \"CCPhysicsJoint.h\"\n#include \"CCPhysicsContact.h\"\n\n#include \"chipmunk/CCPhysicsWorldInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsBodyInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsShapeInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsContactInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsJointInfo_chipmunk.h\"\n#include \"chipmunk/CCPhysicsHelper_chipmunk.h\"\n\n#include \"CCDrawNode.h\"\n#include \"CCArray.h\"\n#include \"CCScene.h\"\n#include \"CCDirector.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventCustom.h\"\n\n#include <algorithm>\n\nNS_CC_BEGIN\nconst float PHYSICS_INFINITY = INFINITY;\nextern const char* PHYSICSCONTACT_EVENT_NAME;\n\nconst int PhysicsWorld::DEBUGDRAW_NONE = 0x00;\nconst int PhysicsWorld::DEBUGDRAW_SHAPE = 0x01;\nconst int PhysicsWorld::DEBUGDRAW_JOINT = 0x02;\nconst int PhysicsWorld::DEBUGDRAW_CONTACT = 0x04;\nconst int PhysicsWorld::DEBUGDRAW_ALL = DEBUGDRAW_SHAPE | DEBUGDRAW_JOINT | DEBUGDRAW_CONTACT;\n\nnamespace\n{\n    typedef struct RayCastCallbackInfo\n    {\n        PhysicsWorld* world;\n        PhysicsRayCastCallbackFunc func;\n        Point p1;\n        Point p2;\n        void* data;\n    }RayCastCallbackInfo;\n    \n    typedef struct RectQueryCallbackInfo\n    {\n        PhysicsWorld* world;\n        PhysicsQueryRectCallbackFunc func;\n        void* data;\n    }RectQueryCallbackInfo;\n    \n    typedef struct PointQueryCallbackInfo\n    {\n        PhysicsWorld* world;\n        PhysicsQueryPointCallbackFunc func;\n        void* data;\n    }PointQueryCallbackInfo;\n}\n\nclass PhysicsWorldCallback\n{\npublic:\n    static int collisionBeginCallbackFunc(cpArbiter *arb, struct cpSpace *space, PhysicsWorld *world);\n    static int collisionPreSolveCallbackFunc(cpArbiter *arb, cpSpace *space, PhysicsWorld *world);\n    static void collisionPostSolveCallbackFunc(cpArbiter *arb, cpSpace *space, PhysicsWorld *world);\n    static void collisionSeparateCallbackFunc(cpArbiter *arb, cpSpace *space, PhysicsWorld *world);\n    static void rayCastCallbackFunc(cpShape *shape, cpFloat t, cpVect n, RayCastCallbackInfo *info);\n    static void queryRectCallbackFunc(cpShape *shape, RectQueryCallbackInfo *info);\n    static void queryPointFunc(cpShape *shape, cpFloat distance, cpVect point, PointQueryCallbackInfo *info);\n    static void getShapesAtPointFunc(cpShape *shape, cpFloat distance, cpVect point, Vector<PhysicsShape*>* arr);\n    \npublic:\n    static bool continues;\n};\n\nbool PhysicsWorldCallback::continues = true;\n\nint PhysicsWorldCallback::collisionBeginCallbackFunc(cpArbiter *arb, struct cpSpace *space, PhysicsWorld *world)\n{\n    CP_ARBITER_GET_SHAPES(arb, a, b);\n    \n    auto ita = PhysicsShapeInfo::getMap().find(a);\n    auto itb = PhysicsShapeInfo::getMap().find(b);\n    CC_ASSERT(ita != PhysicsShapeInfo::getMap().end() && itb != PhysicsShapeInfo::getMap().end());\n    \n    PhysicsContact* contact = PhysicsContact::construct(ita->second->getShape(), itb->second->getShape());\n    arb->data = contact;\n    contact->_contactInfo = arb;\n    \n    return world->collisionBeginCallback(*contact);\n}\n\nint PhysicsWorldCallback::collisionPreSolveCallbackFunc(cpArbiter *arb, cpSpace *space, PhysicsWorld *world)\n{\n    return world->collisionPreSolveCallback(*static_cast<PhysicsContact*>(arb->data));\n}\n\nvoid PhysicsWorldCallback::collisionPostSolveCallbackFunc(cpArbiter *arb, cpSpace *space, PhysicsWorld *world)\n{\n    world->collisionPostSolveCallback(*static_cast<PhysicsContact*>(arb->data));\n}\n\nvoid PhysicsWorldCallback::collisionSeparateCallbackFunc(cpArbiter *arb, cpSpace *space, PhysicsWorld *world)\n{\n    PhysicsContact* contact = static_cast<PhysicsContact*>(arb->data);\n    \n    world->collisionSeparateCallback(*contact);\n    \n    delete contact;\n}\n\nvoid PhysicsWorldCallback::rayCastCallbackFunc(cpShape *shape, cpFloat t, cpVect n, RayCastCallbackInfo *info)\n{\n    if (!PhysicsWorldCallback::continues)\n    {\n        return;\n    }\n    \n    auto it = PhysicsShapeInfo::getMap().find(shape);\n    CC_ASSERT(it != PhysicsShapeInfo::getMap().end());\n    \n    PhysicsRayCastInfo callbackInfo =\n    {\n        it->second->getShape(),\n        info->p1,\n        info->p2,\n        Point(info->p1.x+(info->p2.x-info->p1.x)*t, info->p1.y+(info->p2.y-info->p1.y)*t),\n        Point(n.x, n.y),\n        (float)t,\n    };\n    \n    PhysicsWorldCallback::continues = info->func(*info->world, callbackInfo, info->data);\n}\n\nvoid PhysicsWorldCallback::queryRectCallbackFunc(cpShape *shape, RectQueryCallbackInfo *info)\n{\n    auto it = PhysicsShapeInfo::getMap().find(shape);\n    \n    CC_ASSERT(it != PhysicsShapeInfo::getMap().end());\n    \n    if (!PhysicsWorldCallback::continues)\n    {\n        return;\n    }\n    \n    PhysicsWorldCallback::continues = info->func(*info->world, *it->second->getShape(), info->data);\n}\n\nvoid PhysicsWorldCallback::getShapesAtPointFunc(cpShape *shape, cpFloat distance, cpVect point, Vector<PhysicsShape*>* arr)\n{\n    auto it = PhysicsShapeInfo::getMap().find(shape);\n    \n    CC_ASSERT(it != PhysicsShapeInfo::getMap().end());\n    \n    arr->pushBack(it->second->getShape());\n}\n\nvoid PhysicsWorldCallback::queryPointFunc(cpShape *shape, cpFloat distance, cpVect point, PointQueryCallbackInfo *info)\n{\n    auto it = PhysicsShapeInfo::getMap().find(shape);\n    \n    CC_ASSERT(it != PhysicsShapeInfo::getMap().end());\n    \n    PhysicsWorldCallback::continues = info->func(*info->world, *it->second->getShape(), info->data);\n}\n\nvoid PhysicsWorld::debugDraw()\n{\n    if (_debugDraw == nullptr)\n    {\n        _debugDraw = new PhysicsDebugDraw(*this);\n    }\n    \n    if (_debugDraw && !_bodies.empty())\n    {\n        if (_debugDraw->begin())\n        {\n            if (_debugDrawMask & DEBUGDRAW_SHAPE)\n            {\n                for (Object* obj : _bodies)\n                {\n                    PhysicsBody* body = dynamic_cast<PhysicsBody*>(obj);\n                    \n                    for (auto& shape : body->getShapes())\n                    {\n                        _debugDraw->drawShape(*dynamic_cast<PhysicsShape*>(shape));\n                    }\n                }\n            }\n            \n            if (_debugDrawMask & DEBUGDRAW_JOINT)\n            {\n                for (auto joint : _joints)\n                {\n                    _debugDraw->drawJoint(*joint);\n                }\n            }\n            \n            _debugDraw->end();\n        }\n    }\n}\n\nint PhysicsWorld::collisionBeginCallback(PhysicsContact& contact)\n{\n    bool ret = true;\n    \n    PhysicsShape* shapeA = contact.getShapeA();\n    PhysicsShape* shapeB = contact.getShapeB();\n    PhysicsBody* bodyA = shapeA->getBody();\n    PhysicsBody* bodyB = shapeB->getBody();\n    std::vector<PhysicsJoint*> jointsA = bodyA->getJoints();\n    \n    // check the joint is collision enable or not\n    for (PhysicsJoint* joint : jointsA)\n    {\n        if (std::find(_joints.begin(), _joints.end(), joint) == _joints.end())\n        {\n            continue;\n        }\n        \n        if (!joint->isCollisionEnabled())\n        {\n            PhysicsBody* body = joint->getBodyA() == bodyA ? joint->getBodyB() : joint->getBodyA();\n            \n            if (body == bodyB)\n            {\n                contact.setNotificationEnable(false);\n                return false;\n            }\n        }\n    }\n    \n    // bitmask check\n    if ((shapeA->getCategoryBitmask() & shapeB->getContactTestBitmask()) == 0\n        || (shapeB->getContactTestBitmask() & shapeA->getCategoryBitmask()) == 0)\n    {\n        contact.setNotificationEnable(false);\n    }\n    \n    if (shapeA->getGroup() != 0 && shapeA->getGroup() == shapeB->getGroup())\n    {\n        ret = shapeA->getGroup() > 0;\n    }\n    else\n    {\n        if ((shapeA->getCategoryBitmask() & shapeB->getCollisionBitmask()) == 0\n            || (shapeB->getCategoryBitmask() & shapeA->getCollisionBitmask()) == 0)\n        {\n            ret = false;\n        }\n    }\n    \n    contact.setEventCode(PhysicsContact::EventCode::BEGIN);\n    contact.setWorld(this);\n    EventCustom event(PHYSICSCONTACT_EVENT_NAME);\n    event.setUserData(&contact);\n    _scene->getEventDispatcher()->dispatchEvent(&event);\n    \n    return ret ? contact.resetResult() : false;\n}\n\nint PhysicsWorld::collisionPreSolveCallback(PhysicsContact& contact)\n{\n    if (!contact.isNotificationEnabled())\n    {\n        cpArbiterIgnore(static_cast<cpArbiter*>(contact._contactInfo));\n        return true;\n    }\n    \n    contact.setEventCode(PhysicsContact::EventCode::PRESOLVE);\n    contact.setWorld(this);\n    EventCustom event(PHYSICSCONTACT_EVENT_NAME);\n    event.setUserData(&contact);\n    _scene->getEventDispatcher()->dispatchEvent(&event);\n    \n    return contact.resetResult();\n}\n\nvoid PhysicsWorld::collisionPostSolveCallback(PhysicsContact& contact)\n{\n    if (!contact.isNotificationEnabled())\n    {\n        return;\n    }\n    \n    contact.setEventCode(PhysicsContact::EventCode::POSTSOLVE);\n    contact.setWorld(this);\n    EventCustom event(PHYSICSCONTACT_EVENT_NAME);\n    event.setUserData(&contact);\n    _scene->getEventDispatcher()->dispatchEvent(&event);\n}\n\nvoid PhysicsWorld::collisionSeparateCallback(PhysicsContact& contact)\n{\n    if (!contact.isNotificationEnabled())\n    {\n        return;\n    }\n    \n    contact.setEventCode(PhysicsContact::EventCode::SEPERATE);\n    contact.setWorld(this);\n    EventCustom event(PHYSICSCONTACT_EVENT_NAME);\n    event.setUserData(&contact);\n    _scene->getEventDispatcher()->dispatchEvent(&event);\n}\n\nvoid PhysicsWorld::rayCast(PhysicsRayCastCallbackFunc func, const Point& point1, const Point& point2, void* data)\n{\n    CCASSERT(func != nullptr, \"func shouldn't be nullptr\");\n    \n    if (func != nullptr)\n    {\n        RayCastCallbackInfo info = { this, func, point1, point2, data };\n        \n        PhysicsWorldCallback::continues = true;\n        cpSpaceSegmentQuery(this->_info->getSpace(),\n                            PhysicsHelper::point2cpv(point1),\n                            PhysicsHelper::point2cpv(point2),\n                            CP_ALL_LAYERS,\n                            CP_NO_GROUP,\n                            (cpSpaceSegmentQueryFunc)PhysicsWorldCallback::rayCastCallbackFunc,\n                            &info);\n    }\n}\n\n\nvoid PhysicsWorld::queryRect(PhysicsQueryRectCallbackFunc func, const Rect& rect, void* data)\n{\n    CCASSERT(func != nullptr, \"func shouldn't be nullptr\");\n    \n    if (func != nullptr)\n    {\n        RectQueryCallbackInfo info = {this, func, data};\n        \n        PhysicsWorldCallback::continues = true;\n        cpSpaceBBQuery(this->_info->getSpace(),\n                       PhysicsHelper::rect2cpbb(rect),\n                       CP_ALL_LAYERS,\n                       CP_NO_GROUP,\n                       (cpSpaceBBQueryFunc)PhysicsWorldCallback::queryRectCallbackFunc,\n                       &info);\n    }\n}\n\nvoid PhysicsWorld::queryPoint(PhysicsQueryPointCallbackFunc func, const Point& point, void* data)\n{\n    CCASSERT(func != nullptr, \"func shouldn't be nullptr\");\n    \n    if (func != nullptr)\n    {\n        PointQueryCallbackInfo info = {this, func, data};\n        \n        PhysicsWorldCallback::continues = true;\n        cpSpaceNearestPointQuery(this->_info->getSpace(),\n                                 PhysicsHelper::point2cpv(point),\n                                 0,\n                                 CP_ALL_LAYERS,\n                                 CP_NO_GROUP,\n                                 (cpSpaceNearestPointQueryFunc)PhysicsWorldCallback::queryPointFunc,\n                                 &info);\n    }\n}\n\nVector<PhysicsShape*> PhysicsWorld::getShapes(const Point& point) const\n{\n    Vector<PhysicsShape*> arr;\n    cpSpaceNearestPointQuery(this->_info->getSpace(),\n                             PhysicsHelper::point2cpv(point),\n                             0,\n                             CP_ALL_LAYERS,\n                             CP_NO_GROUP,\n                             (cpSpaceNearestPointQueryFunc)PhysicsWorldCallback::getShapesAtPointFunc,\n                             &arr);\n    \n    return arr;\n}\n\nPhysicsShape* PhysicsWorld::getShape(const Point& point) const\n{\n    cpShape* shape = cpSpaceNearestPointQueryNearest(this->_info->getSpace(),\n                                    PhysicsHelper::point2cpv(point),\n                                    0,\n                                    CP_ALL_LAYERS,\n                                    CP_NO_GROUP,\n                                    nullptr);\n    \n    return shape == nullptr ? nullptr : PhysicsShapeInfo::getMap().find(shape)->second->getShape();\n}\n\nvoid PhysicsDebugDraw::drawShape(PhysicsShape& shape)\n{\n    for (auto it = shape._info->getShapes().begin(); it != shape._info->getShapes().end(); ++it)\n    {\n        cpShape *subShape = *it;\n        \n        switch ((*it)->klass_private->type)\n        {\n            case CP_CIRCLE_SHAPE:\n            {\n                float radius = PhysicsHelper::cpfloat2float(cpCircleShapeGetRadius(subShape));\n                Point centre = PhysicsHelper::cpv2point(cpBodyGetPos(cpShapeGetBody(subShape)))\n                + PhysicsHelper::cpv2point(cpCircleShapeGetOffset(subShape));\n                \n                static const int CIRCLE_SEG_NUM = 12;\n                Point seg[CIRCLE_SEG_NUM] = {};\n                \n                for (int i = 0; i < CIRCLE_SEG_NUM; ++i)\n                {\n                    float angle = (float)i * M_PI / (float)CIRCLE_SEG_NUM * 2.0f;\n                    Point d(radius * cosf(angle), radius * sinf(angle));\n                    seg[i] = centre + d;\n                }\n                _drawNode->drawPolygon(seg, CIRCLE_SEG_NUM, Color4F(1.0f, 0.0f, 0.0f, 0.3f), 1, Color4F(1, 0, 0, 1));\n                break;\n            }\n            case CP_SEGMENT_SHAPE:\n            {\n                cpSegmentShape *seg = (cpSegmentShape *)subShape;\n                _drawNode->drawSegment(PhysicsHelper::cpv2point(seg->ta),\n                                       PhysicsHelper::cpv2point(seg->tb),\n                                       PhysicsHelper::cpfloat2float(seg->r==0 ? 1 : seg->r), Color4F(1, 0, 0, 1));\n                break;\n            }\n            case CP_POLY_SHAPE:\n            {\n                cpPolyShape* poly = (cpPolyShape*)subShape;\n                int num = poly->numVerts;\n                Point* seg = new Point[num];\n                \n                PhysicsHelper::cpvs2points(poly->tVerts, seg, num);\n                \n                _drawNode->drawPolygon(seg, num, Color4F(1.0f, 0.0f, 0.0f, 0.3f), 1.0f, Color4F(1.0f, 0.0f, 0.0f, 1.0f));\n                \n                delete[] seg;\n                break;\n            }\n            default:\n                break;\n        }\n    }\n}\n\nvoid PhysicsDebugDraw::drawJoint(PhysicsJoint& joint)\n{\n    for (auto it = joint._info->getJoints().begin(); it != joint._info->getJoints().end(); ++it)\n    {\n        cpConstraint *constraint = *it;\n        \n        \n        cpBody *body_a = constraint->a;\n        cpBody *body_b = constraint->b;\n        \n        const cpConstraintClass *klass = constraint->klass_private;\n        if(klass == cpPinJointGetClass())\n        {\n            cpPinJoint *subJoint = (cpPinJoint *)constraint;\n            \n            cpVect a = cpvadd(body_a->p, cpvrotate(subJoint->anchr1, body_a->rot));\n            cpVect b = cpvadd(body_b->p, cpvrotate(subJoint->anchr2, body_b->rot));\n            \n            _drawNode->drawSegment(PhysicsHelper::cpv2point(a), PhysicsHelper::cpv2point(b), 1, Color4F(0.0f, 0.0f, 1.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(a), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(b), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n        }\n        else if(klass == cpSlideJointGetClass())\n        {\n            cpSlideJoint *subJoint = (cpSlideJoint *)constraint;\n            \n            cpVect a = cpvadd(body_a->p, cpvrotate(subJoint->anchr1, body_a->rot));\n            cpVect b = cpvadd(body_b->p, cpvrotate(subJoint->anchr2, body_b->rot));\n            \n            _drawNode->drawSegment(PhysicsHelper::cpv2point(a), PhysicsHelper::cpv2point(b), 1, Color4F(0.0f, 0.0f, 1.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(a), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(b), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n        }\n        else if(klass == cpPivotJointGetClass())\n        {\n            cpPivotJoint *subJoint = (cpPivotJoint *)constraint;\n            \n            cpVect a = cpvadd(body_a->p, cpvrotate(subJoint->anchr1, body_a->rot));\n            cpVect b = cpvadd(body_b->p, cpvrotate(subJoint->anchr2, body_b->rot));\n            \n            _drawNode->drawDot(PhysicsHelper::cpv2point(a), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(b), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n        }\n        else if(klass == cpGrooveJointGetClass())\n        {\n            cpGrooveJoint *subJoint = (cpGrooveJoint *)constraint;\n            \n            cpVect a = cpvadd(body_a->p, cpvrotate(subJoint->grv_a, body_a->rot));\n            cpVect b = cpvadd(body_a->p, cpvrotate(subJoint->grv_b, body_a->rot));\n            cpVect c = cpvadd(body_b->p, cpvrotate(subJoint->anchr2, body_b->rot));\n            \n            _drawNode->drawSegment(PhysicsHelper::cpv2point(a), PhysicsHelper::cpv2point(b), 1, Color4F(0.0f, 0.0f, 1.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(c), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n        }\n        else if(klass == cpDampedSpringGetClass())\n        {\n            cpDampedSpring *subJoint = (cpDampedSpring *)constraint;\n            \n            cpVect a = cpvadd(body_a->p, cpvrotate(subJoint->anchr1, body_a->rot));\n            cpVect b = cpvadd(body_b->p, cpvrotate(subJoint->anchr2, body_b->rot));\n            \n            _drawNode->drawSegment(PhysicsHelper::cpv2point(a), PhysicsHelper::cpv2point(b), 1, Color4F(0.0f, 0.0f, 1.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(a), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n            _drawNode->drawDot(PhysicsHelper::cpv2point(b), 2, Color4F(0.0f, 1.0f, 0.0f, 1.0f));\n            \n            \n        }\n    }\n}\n\nvoid PhysicsDebugDraw::drawContact()\n{\n    \n}\n\nPhysicsWorld* PhysicsWorld::construct(Scene& scene)\n{\n    PhysicsWorld * world = new PhysicsWorld();\n    if(world && world->init(scene))\n    {\n        return world;\n    }\n    \n    CC_SAFE_DELETE(world);\n    return nullptr;\n}\n\nbool PhysicsWorld::init(Scene& scene)\n{\n    do\n    {\n        _info = new PhysicsWorldInfo();\n        CC_BREAK_IF(_info == nullptr);\n        \n        _scene = &scene;\n        \n        _info->setGravity(_gravity);\n        \n        cpSpaceSetDefaultCollisionHandler(_info->getSpace(),\n                                          (cpCollisionBeginFunc)PhysicsWorldCallback::collisionBeginCallbackFunc,\n                                          (cpCollisionPreSolveFunc)PhysicsWorldCallback::collisionPreSolveCallbackFunc,\n                                          (cpCollisionPostSolveFunc)PhysicsWorldCallback::collisionPostSolveCallbackFunc,\n                                          (cpCollisionSeparateFunc)PhysicsWorldCallback::collisionSeparateCallbackFunc,\n                                          this);\n        \n        return true;\n    } while (false);\n    \n    return false;\n}\n\nvoid PhysicsWorld::addBody(PhysicsBody* body)\n{\n    CCASSERT(body != nullptr, \"the body can not be nullptr\");\n    \n    if (body->getWorld() == this)\n    {\n        return;\n    }\n    \n    if (body->getWorld() != nullptr)\n    {\n        body->removeFromWorld();\n    }\n    \n    addBodyOrDelay(body);\n    _bodies.pushBack(body);\n    body->_world = this;\n}\n\nvoid PhysicsWorld::doAddBody(PhysicsBody* body)\n{\n    if (body->isEnabled())\n    {\n        //is gravity enable\n        if (!body->isGravityEnabled())\n        {\n            body->applyForce(-_gravity);\n        }\n        \n        // add body to space\n        if (body->isDynamic())\n        {\n            _info->addBody(*body->_info);\n        }\n        \n        // add shapes to space\n        for (auto& shape : body->getShapes())\n        {\n            addShape(dynamic_cast<PhysicsShape*>(shape));\n        }\n    }\n}\n\n\nvoid PhysicsWorld::addBodyOrDelay(PhysicsBody* body)\n{\n    auto removeBodyIter = _delayRemoveBodies.find(body);\n    if (removeBodyIter != _delayRemoveBodies.end())\n    {\n        _delayRemoveBodies.erase(removeBodyIter);\n        return;\n    }\n    \n    if (_info->isLocked())\n    {\n        if (_delayAddBodies.find(body) == _delayAddBodies.end())\n        {\n            _delayAddBodies.pushBack(body);\n            _delayDirty = true;\n        }\n    }\n    else\n    {\n        doAddBody(body);\n    }\n}\n\nvoid PhysicsWorld::updateBodies()\n{\n    if (_info->isLocked())\n    {\n        return;\n    }\n    \n    for (auto& body : _delayAddBodies)\n    {\n        doAddBody(body);\n    }\n    \n    for (auto& body : _delayRemoveBodies)\n    {\n        doRemoveBody(body);\n    }\n    \n    _delayAddBodies.clear();\n    _delayRemoveBodies.clear();\n}\n\nvoid PhysicsWorld::removeBody(int tag)\n{\n    for (auto& body : _bodies)\n    {\n        if (body->getTag() == tag)\n        {\n            removeBody(body);\n            return;\n        }\n    }\n}\n\nvoid PhysicsWorld::removeBody(PhysicsBody* body)\n{\n    \n    if (body->getWorld() != this)\n    {\n        CCLOG(\"Physics Warnning: this body doesn't belong to this world\");\n        return;\n    }\n    \n    // destory the body's joints\n    for (auto joint : body->_joints)\n    {\n        // set destroy param to false to keep the iterator available\n        removeJoint(joint, false);\n        \n        PhysicsBody* other = (joint->getBodyA() == body ? joint->getBodyB() : body);\n        other->removeJoint(joint);\n        \n        // test the distraction is delaied or not\n        if (_delayRemoveJoints.size() > 0 && _delayRemoveJoints.back() == joint)\n        {\n            joint->_destoryMark = true;\n        }\n        else\n        {\n            delete joint;\n        }\n    }\n    \n    body->_joints.clear();\n    \n    removeBodyOrDelay(body);\n    _bodies.eraseObject(body);\n    body->_world = nullptr;\n}\n\n\nvoid PhysicsWorld::removeBodyOrDelay(PhysicsBody* body)\n{\n    if (_delayAddBodies.getIndex(body) != CC_INVALID_INDEX)\n    {\n        _delayAddBodies.eraseObject(body);\n        return;\n    }\n    \n    if (_info->isLocked())\n    {\n        if (_delayRemoveBodies.getIndex(body) == CC_INVALID_INDEX)\n        {\n            _delayRemoveBodies.pushBack(body);\n            _delayDirty = true;\n        }\n    }else\n    {\n        doRemoveBody(body);\n    }\n}\n\nvoid PhysicsWorld::doAddJoint(PhysicsJoint *joint)\n{\n    if (joint == nullptr || joint->_info == nullptr)\n    {\n        return;\n    }\n    \n    _info->addJoint(*joint->_info);\n}\n\nvoid PhysicsWorld::removeJoint(PhysicsJoint* joint, bool destroy)\n{\n    if (joint->getWorld() != this)\n    {\n        if (destroy)\n        {\n            CCLOG(\"physics warnning: the joint is not in this world, it won't be destoried utill the body it conntect is destoried\");\n        }\n        return;\n    }\n    \n    removeJointOrDelay(joint);\n    \n    _joints.remove(joint);\n    joint->_world = nullptr;\n    \n    // clean the connection to this joint\n    if (destroy)\n    {\n        if (joint->getBodyA() != nullptr)\n        {\n            joint->getBodyA()->removeJoint(joint);\n        }\n        \n        if (joint->getBodyB() != nullptr)\n        {\n            joint->getBodyB()->removeJoint(joint);\n        }\n        \n        // test the distraction is delaied or not\n        if (_delayRemoveJoints.size() > 0 && _delayRemoveJoints.back() == joint)\n        {\n            joint->_destoryMark = true;\n        }\n        else\n        {\n            delete joint;\n        }\n    }\n}\n\nvoid PhysicsWorld::updateJoints()\n{\n    if (_info->isLocked())\n    {\n        return;\n    }\n    \n    for (auto joint : _delayAddJoints)\n    {\n        doAddJoint(joint);\n    }\n    \n    for (auto joint : _delayRemoveJoints)\n    {\n        doRemoveJoint(joint);\n        \n        if (joint->_destoryMark)\n        {\n            delete joint;\n        }\n    }\n    \n    _delayAddJoints.clear();\n    _delayRemoveJoints.clear();\n}\n\nvoid PhysicsWorld::removeShape(PhysicsShape* shape)\n{\n    if (shape != nullptr)\n    {\n        _info->removeShape(*shape->_info);\n    }\n}\n\nvoid PhysicsWorld::addJointOrDelay(PhysicsJoint* joint)\n{\n    auto it = std::find(_delayRemoveJoints.begin(), _delayRemoveJoints.end(), joint);\n    if (it != _delayRemoveJoints.end())\n    {\n        _delayRemoveJoints.erase(it);\n        return;\n    }\n    \n    if (_info->isLocked())\n    {\n        if (std::find(_delayAddJoints.begin(), _delayAddJoints.end(), joint) == _delayAddJoints.end())\n        {\n            _delayAddJoints.push_back(joint);\n            _delayDirty = true;\n        }\n    }else\n    {\n        doAddJoint(joint);\n    }\n}\n\nvoid PhysicsWorld::removeJointOrDelay(PhysicsJoint* joint)\n{\n    auto it = std::find(_delayAddJoints.begin(), _delayAddJoints.end(), joint);\n    if (it != _delayAddJoints.end())\n    {\n        _delayAddJoints.erase(it);\n        return;\n    }\n    \n    if (_info->isLocked())\n    {\n        if (std::find(_delayRemoveJoints.begin(), _delayRemoveJoints.end(), joint) == _delayRemoveJoints.end())\n        {\n            _delayRemoveJoints.push_back(joint);\n            _delayDirty = true;\n        }\n    }else\n    {\n        doRemoveJoint(joint);\n    }\n}\n\nvoid PhysicsWorld::addJoint(PhysicsJoint* joint)\n{\n    if (joint->getWorld() != nullptr && joint->getWorld() != this)\n    {\n        joint->removeFormWorld();\n    }\n    \n    addJointOrDelay(joint);\n    _joints.push_back(joint);\n    joint->_world = this;\n}\n\nvoid PhysicsWorld::removeAllJoints(bool destroy)\n{\n    for (auto joint : _joints)\n    {\n        removeJointOrDelay(joint);\n        joint->_world = nullptr;\n        \n        // clean the connection to this joint\n        if (destroy)\n        {\n            if (joint->getBodyA() != nullptr)\n            {\n                joint->getBodyA()->removeJoint(joint);\n            }\n            \n            if (joint->getBodyB() != nullptr)\n            {\n                joint->getBodyB()->removeJoint(joint);\n            }\n            \n            // test the distraction is delaied or not\n            if (_delayRemoveJoints.size() > 0 && _delayRemoveJoints.back() == joint)\n            {\n                joint->_destoryMark = true;\n            }\n            else\n            {\n                delete joint;\n            }\n        }\n    }\n    \n    _joints.clear();\n}\n\nvoid PhysicsWorld::addShape(PhysicsShape* shape)\n{\n    if (shape != nullptr)\n    {\n        _info->addShape(*shape->_info);\n    }\n}\n\nvoid PhysicsWorld::doRemoveBody(PhysicsBody* body)\n{\n    CCASSERT(body != nullptr, \"the body can not be nullptr\");\n    \n    // reset the gravity\n    if (!body->isGravityEnabled())\n    {\n        body->applyForce(-_gravity);\n    }\n    \n    // remove shaps\n    for (auto& shape : body->getShapes())\n    {\n        removeShape(shape);\n    }\n    \n    // remove body\n    _info->removeBody(*body->_info);\n}\n\nvoid PhysicsWorld::doRemoveJoint(PhysicsJoint* joint)\n{\n    _info->removeJoint(*joint->_info);\n}\n\nvoid PhysicsWorld::removeAllBodies()\n{\n    for (auto& child : _bodies)\n    {\n        removeBodyOrDelay(child);\n        child->_world = nullptr;\n    }\n    \n    _bodies.clear();\n}\n\nvoid PhysicsWorld::setDebugDrawMask(int mask)\n{\n    if (mask == DEBUGDRAW_NONE)\n    {\n        CC_SAFE_DELETE(_debugDraw);\n    }\n    \n    _debugDrawMask = mask;\n}\n\nconst Vector<PhysicsBody*>& PhysicsWorld::getAllBodies() const\n{\n    return _bodies;\n}\n\nPhysicsBody* PhysicsWorld::getBody(int tag) const\n{\n    for (auto& body : _bodies)\n    {\n        if (body->getTag() == tag)\n        {\n            return body;\n        }\n    }\n    \n    return nullptr;\n}\n\nvoid PhysicsWorld::setGravity(const Vect& gravity)\n{\n    if (!_bodies.empty())\n    {\n        for (auto& body : _bodies)\n        {\n            // reset gravity for body\n            if (!body->isGravityEnabled())\n            {\n                body->applyForce(-_gravity);\n                body->applyForce(gravity);\n            }\n        }\n    }\n    \n    _gravity = gravity;\n    _info->setGravity(gravity);\n}\n\nvoid PhysicsWorld::update(float delta)\n{\n    if (_delayDirty)\n    {\n        // the updateJoints must run before the updateBodies.\n        updateJoints();\n        updateBodies();\n        _delayDirty = !(_delayAddBodies.size() == 0 && _delayRemoveBodies.size() == 0 && _delayAddJoints.size() == 0 && _delayRemoveJoints.size() == 0);\n    }\n    \n    for (auto& body : _bodies)\n    {\n        body->update(delta);\n    }\n    \n    _updateTime += delta;\n    if (++_updateRateCount >= _updateRate)\n    {\n        _info->step(_updateTime * _speed);\n        _updateRateCount = 0;\n        _updateTime = 0.0f;\n    }\n    \n    if (_debugDrawMask != DEBUGDRAW_NONE)\n    {\n        debugDraw();\n    }\n}\n\nPhysicsWorld::PhysicsWorld()\n: _gravity(Point(0.0f, -98.0f))\n, _speed(1.0f)\n, _updateRate(1)\n, _updateRateCount(0)\n, _updateTime(0.0f)\n, _info(nullptr)\n, _scene(nullptr)\n, _delayDirty(false)\n, _debugDraw(nullptr)\n, _debugDrawMask(DEBUGDRAW_NONE)\n{\n    \n}\n\nPhysicsWorld::~PhysicsWorld()\n{\n    removeAllJoints(true);\n    removeAllBodies();\n    CC_SAFE_DELETE(_info);\n    CC_SAFE_DELETE(_debugDraw);\n}\n\nPhysicsDebugDraw::PhysicsDebugDraw(PhysicsWorld& world)\n: _drawNode(nullptr)\n, _world(world)\n{\n}\n\nPhysicsDebugDraw::~PhysicsDebugDraw()\n{\n    if (_drawNode != nullptr)\n    {\n        _drawNode->removeFromParent();\n        _drawNode = nullptr;\n    }\n}\n\nbool PhysicsDebugDraw::begin()\n{\n    if (_drawNode != nullptr)\n    {\n        _drawNode->removeFromParent();\n        _drawNode = nullptr;\n    }\n    \n    _drawNode = DrawNode::create();\n    \n    if (_drawNode == nullptr)\n    {\n        return false;\n    }\n    \n    _world.getScene().addChild(_drawNode);\n    \n    return true;\n}\n\nvoid PhysicsDebugDraw::end()\n{\n}\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/CCPhysicsWorld.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_WORLD_H__\n#define __CCPHYSICS_WORLD_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"CCVector.h\"\n#include \"CCObject.h\"\n#include \"CCGeometry.h\"\n\n#include <list>\n\nNS_CC_BEGIN\n\nclass PhysicsBody;\nclass PhysicsJoint;\nclass PhysicsWorldInfo;\nclass PhysicsShape;\nclass PhysicsContact;\n\ntypedef Point Vect;\n\nclass Sprite;\nclass Scene;\nclass DrawNode;\nclass PhysicsDebugDraw;\n\nclass PhysicsWorld;\n\ntypedef struct PhysicsRayCastInfo\n{\n    PhysicsShape* shape;\n    Point start;\n    Point end;              //< in lua, it's name is \"ended\"\n    Point contact;\n    Vect normal;\n    float fraction;\n    void* data;\n}PhysicsRayCastInfo;\n\n/**\n * @brief Called for each fixture found in the query. You control how the ray cast\n * proceeds by returning a float:\n * return true: continue\n * return false: terminate the ray cast\n * @param fixture the fixture hit by the ray\n * @param point the point of initial intersection\n * @param normal the normal vector at the point of intersection\n * @return true to continue, false to terminate\n */\ntypedef std::function<bool(PhysicsWorld& world, const PhysicsRayCastInfo& info, void* data)> PhysicsRayCastCallbackFunc;\ntypedef std::function<bool(PhysicsWorld&, PhysicsShape&, void*)> PhysicsQueryRectCallbackFunc;\ntypedef PhysicsQueryRectCallbackFunc PhysicsQueryPointCallbackFunc;\n\n/**\n * @brief An PhysicsWorld object simulates collisions and other physical properties. You do not create PhysicsWorld objects directly; instead, you can get it from an Scene object.\n */\nclass PhysicsWorld\n{\npublic:\n    static const int DEBUGDRAW_NONE;        ///< draw nothing\n    static const int DEBUGDRAW_SHAPE;       ///< draw shapes\n    static const int DEBUGDRAW_JOINT;       ///< draw joints\n    static const int DEBUGDRAW_CONTACT;     ///< draw contact\n    static const int DEBUGDRAW_ALL;         ///< draw all\n    \npublic:\n    /** Adds a joint to the physics world.*/\n    virtual void addJoint(PhysicsJoint* joint);\n    /** Remove a joint from physics world.*/\n    virtual void removeJoint(PhysicsJoint* joint, bool destroy);\n    /** Remove all joints from physics world.*/\n    virtual void removeAllJoints(bool destroy);\n    \n    /** Remove a body from physics world. */\n    virtual void removeBody(PhysicsBody* body);\n    /** Remove body by tag. */\n    virtual void removeBody(int tag);\n    /** Remove all bodies from physics world. */\n    virtual void removeAllBodies();\n    \n    /** Searches for physics shapes that intersects the ray. */\n    void rayCast(PhysicsRayCastCallbackFunc func, const Point& start, const Point& end, void* data);\n    /** Searches for physics shapes that contains in the rect. */\n    void queryRect(PhysicsQueryRectCallbackFunc func, const Rect& rect, void* data);\n    /** Searches for physics shapes that contains the point. */\n    void queryPoint(PhysicsQueryPointCallbackFunc func, const Point& point, void* data);\n    /** Get phsyics shapes that contains the point. */\n    Vector<PhysicsShape*> getShapes(const Point& point) const;\n    /** return physics shape that contains the point. */\n    PhysicsShape* getShape(const Point& point) const;\n    /** Get all the bodys that in the physics world. */\n    const Vector<PhysicsBody*>& getAllBodies() const;\n    /** Get body by tag */\n    PhysicsBody* getBody(int tag) const;\n    \n    /** Get scene contain this physics world */\n    inline Scene& getScene() const { return *_scene; }\n    /** get the gravity value */\n    inline Vect getGravity() const { return _gravity; }\n    /** set the gravity value */\n    void setGravity(const Vect& gravity);\n    /** Set the speed of physics world, speed is the rate at which the simulation executes. default value is 1.0 */\n    inline void setSpeed(float speed) { if(speed >= 0.0f) { _speed = speed; } }\n    /** get the speed of physics world */\n    inline float getSpeed() { return _speed; }\n    /** \n     * set the update rate of physics world, update rate is the value of EngineUpdateTimes/PhysicsWorldUpdateTimes.\n     * set it higher can improve performance, set it lower can improve accuracy of physics world simulation.\n     * default value is 1.0\n     */\n    inline void setUpdateRate(int rate) { if(rate > 0) { _updateRate = rate; } }\n    /** get the update rate */\n    inline int getUpdateRate() { return _updateRate; }\n    \n    /** set the debug draw mask */\n    void setDebugDrawMask(int mask);\n    /** get the bebug draw mask */\n    inline int getDebugDrawMask() { return _debugDrawMask; }\n    \nprotected:\n    static PhysicsWorld* construct(Scene& scene);\n    bool init(Scene& scene);\n    \n    virtual void addBody(PhysicsBody* body);\n    virtual void addShape(PhysicsShape* shape);\n    virtual void removeShape(PhysicsShape* shape);\n    virtual void update(float delta);\n    \n    virtual void debugDraw();\n    \n    virtual int collisionBeginCallback(PhysicsContact& contact);\n    virtual int collisionPreSolveCallback(PhysicsContact& contact);\n    virtual void collisionPostSolveCallback(PhysicsContact& contact);\n    virtual void collisionSeparateCallback(PhysicsContact& contact);\n    \n    virtual void doAddBody(PhysicsBody* body);\n    virtual void doRemoveBody(PhysicsBody* body);\n    virtual void doAddJoint(PhysicsJoint* joint);\n    virtual void doRemoveJoint(PhysicsJoint* joint);\n    virtual void addBodyOrDelay(PhysicsBody* body);\n    virtual void removeBodyOrDelay(PhysicsBody* body);\n    virtual void addJointOrDelay(PhysicsJoint* joint);\n    virtual void removeJointOrDelay(PhysicsJoint* joint);\n    virtual void updateBodies();\n    virtual void updateJoints();\n    \nprotected:\n    Vect _gravity;\n    float _speed;\n    int _updateRate;\n    int _updateRateCount;\n    float _updateTime;\n    PhysicsWorldInfo* _info;\n    \n    Vector<PhysicsBody*> _bodies;\n    std::list<PhysicsJoint*> _joints;\n    Scene* _scene;\n    \n    bool _delayDirty;\n    PhysicsDebugDraw* _debugDraw;\n    int _debugDrawMask;\n    \n    \n    Vector<PhysicsBody*> _delayAddBodies;\n    Vector<PhysicsBody*> _delayRemoveBodies;\n    std::vector<PhysicsJoint*> _delayAddJoints;\n    std::vector<PhysicsJoint*> _delayRemoveJoints;\n    \nprotected:\n    PhysicsWorld();\n    virtual ~PhysicsWorld();\n    \n    friend class Sprite;\n    friend class Scene;\n    friend class PhysicsBody;\n    friend class PhysicsShape;\n    friend class PhysicsJoint;\n    friend class PhysicsWorldCallback;\n    friend class PhysicsDebugDraw;\n};\n\n\nclass PhysicsDebugDraw\n{\nprotected:\n    virtual bool begin();\n    virtual void end();\n    virtual void drawShape(PhysicsShape& shape);\n    virtual void drawJoint(PhysicsJoint& joint);\n    virtual void drawContact();\n    \nprotected:\n    PhysicsDebugDraw(PhysicsWorld& world);\n    virtual ~PhysicsDebugDraw();\n    \nprotected:\n    DrawNode* _drawNode;\n    PhysicsWorld& _world;\n    \n    friend class PhysicsWorld;\n};\nextern const float PHYSICS_INFINITY;\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_WORLD_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/CMakeLists.txt",
    "content": "set(COCOS_PHYSICS_SRC\n  ../physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp\n  ../physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp\n  ../physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp\n  ../physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp\n  ../physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp\n  ../physics/CCPhysicsBody.cpp\n  ../physics/CCPhysicsContact.cpp\n  ../physics/CCPhysicsShape.cpp\n  ../physics/CCPhysicsJoint.cpp\n  ../physics/CCPhysicsWorld.cpp\n)\n\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsBodyInfo_chipmunk.h\"\n#if CC_USE_PHYSICS\nNS_CC_BEGIN\n\nPhysicsBodyInfo::PhysicsBodyInfo()\n: _body(nullptr)\n{\n}\n\nPhysicsBodyInfo::~PhysicsBodyInfo()\n{\n    if (_body) cpBodyFree(_body);\n}\n\nNS_CC_END\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_BODY_INFO_CHIPMUNK_H__\n#define __CCPHYSICS_BODY_INFO_CHIPMUNK_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"chipmunk.h\"\n#include \"CCPlatformMacros.h\"\n#include \"CCObject.h\"\n\nNS_CC_BEGIN\n\nclass PhysicsBodyInfo\n{\npublic:\n    inline cpBody* getBody() const { return _body; }\n    inline void setBody(cpBody* body) { _body = body; }\n    \nprivate:\n    PhysicsBodyInfo();\n    ~PhysicsBodyInfo();\n    \nprivate:\n    cpBody* _body;\n    \n    friend class PhysicsBody;\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_BODY_INFO_CHIPMUNK_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsContactInfo_chipmunk.h\"\n#if CC_USE_PHYSICS\nNS_CC_BEGIN\n\nPhysicsContactInfo::PhysicsContactInfo(PhysicsContact* contact)\n: _contact(contact)\n{\n}\n\nPhysicsContactInfo::~PhysicsContactInfo()\n{\n}\n\nNS_CC_END\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_CONTACT_INFO_CHIPMUNK_H__\n#define __CCPHYSICS_CONTACT_INFO_CHIPMUNK_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"chipmunk.h\"\n#include \"CCPlatformMacros.h\"\nNS_CC_BEGIN\n\nclass PhysicsContact;\nclass PhysicsContactInfo\n{\npublic:\n    inline PhysicsContact* getContact() const { return _contact; }\n    \nprivate:\n    PhysicsContactInfo(PhysicsContact* contact);\n    ~PhysicsContactInfo();\n    \nprivate:\n    PhysicsContact* _contact;\n    \n    friend class PhysicsContact;\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_CONTACT_INFO_CHIPMUNK_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsHelper_chipmunk.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_HELPER_CHIPMUNK_H__\n#define __CCPHYSICS_HELPER_CHIPMUNK_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"chipmunk.h\"\n#include \"CCPlatformMacros.h\"\n#include \"CCGeometry.h\"\n\nNS_CC_BEGIN\n\nclass PhysicsHelper\n{\npublic:\n    static Point cpv2point(const cpVect& vec) { return Point(vec.x, vec.y); }\n    static cpVect point2cpv(const Point& point) { return cpv(point.x, point.y); }\n    static Size cpv2size(const cpVect& vec) { return Size(vec.x, vec.y); }\n    static cpVect size2cpv(const Size& size) { return cpv(size.width, size.height); }\n    static float cpfloat2float(cpFloat f) { return f; }\n    static cpFloat float2cpfloat(float f) { return f; }\n    static cpBB rect2cpbb(const Rect& rect) { return cpBBNew(rect.origin.x, rect.origin.y, rect.origin.x + rect.size.width, rect.origin.y + rect.size.height); }\n    static Rect cpbb2rect(const cpBB& bb) { return Rect(bb.l, bb.b, bb.r -  bb.l, bb.t - bb.b); }\n    \n    static Point* cpvs2points(const cpVect* cpvs, Point* out, int count)\n    {\n        for (int i = 0; i < count; ++i)\n        {\n            out[i] = cpv2point(cpvs[i]);\n        }\n        \n        return out;\n    }\n    \n    static cpVect* points2cpvs(const Point* points, cpVect* out, int count)\n    {\n        for (int i = 0; i < count; ++i)\n        {\n            out[i] = point2cpv(points[i]);\n        }\n        \n        return out;\n    }\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_HELPER_CHIPMUNK_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsJointInfo_chipmunk.h\"\n#if CC_USE_PHYSICS\n#include <algorithm>\n#include <unordered_map>\n\nNS_CC_BEGIN\n\nstd::unordered_map<cpConstraint*, PhysicsJointInfo*> PhysicsJointInfo::_map;\n\nPhysicsJointInfo::PhysicsJointInfo(PhysicsJoint* joint)\n: _joint(joint)\n{\n}\n\nPhysicsJointInfo::~PhysicsJointInfo()\n{\n    for (cpConstraint* joint : _joints)\n    {\n        cpConstraintFree(joint);\n    }\n}\n\nvoid PhysicsJointInfo::add(cpConstraint* joint)\n{\n    if (joint == nullptr) return;\n\n    _joints.push_back(joint);\n    _map.insert(std::pair<cpConstraint*, PhysicsJointInfo*>(joint, this));\n}\n\nvoid PhysicsJointInfo::remove(cpConstraint* joint)\n{\n    if (joint == nullptr) return;\n    \n    auto it = std::find(_joints.begin(), _joints.end(), joint);\n    if (it != _joints.end())\n    {\n        _joints.erase(it);\n        \n        auto mit = _map.find(joint);\n        if (mit != _map.end()) _map.erase(mit);\n        \n        cpConstraintFree(joint);\n    }\n}\n\nvoid PhysicsJointInfo::removeAll()\n{\n    for (cpConstraint* joint : _joints)\n    {\n        auto mit = _map.find(joint);\n        if (mit != _map.end()) _map.erase(mit);\n        cpConstraintFree(joint);\n    }\n    \n    _joints.clear();\n}\n\nNS_CC_END\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_JOINT_INFO_CHIPMUNK_H__\n#define __CCPHYSICS_JOINT_INFO_CHIPMUNK_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include \"chipmunk.h\"\n#include \"CCPlatformMacros.h\"\n#include <vector>\n#include <unordered_map>\nNS_CC_BEGIN\n\nclass PhysicsJoint;\n\nclass PhysicsJointInfo\n{\npublic:\n    void add(cpConstraint* shape);\n    void remove(cpConstraint* shape);\n    void removeAll();\n    \n    PhysicsJoint* getJoint() const { return _joint; }\n    std::vector<cpConstraint*>& getJoints() { return _joints; }\n    static std::unordered_map<cpConstraint*, PhysicsJointInfo*>& getMap() { return _map; }\n    \nprotected:\n    PhysicsJointInfo(PhysicsJoint* joint);\n    ~PhysicsJointInfo();\n    \n    std::vector<cpConstraint*> _joints;\n    PhysicsJoint* _joint;\n    static std::unordered_map<cpConstraint*, PhysicsJointInfo*> _map;\n    \n    friend class PhysicsJoint;\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_JOINT_INFO_CHIPMUNK_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsShapeInfo_chipmunk.h\"\n#if CC_USE_PHYSICS\n#include <algorithm>\n#include <unordered_map>\n\nNS_CC_BEGIN\n\nstd::unordered_map<cpShape*, PhysicsShapeInfo*> PhysicsShapeInfo::_map;\ncpBody* PhysicsShapeInfo::_sharedBody = nullptr;\n\nPhysicsShapeInfo::PhysicsShapeInfo(PhysicsShape* shape)\n: _shape(shape)\n, _group(CP_NO_GROUP)\n{\n    if (_sharedBody == nullptr)\n    {\n        _sharedBody = cpBodyNewStatic();\n    }\n    \n    _body = _sharedBody;\n}\n\nPhysicsShapeInfo::~PhysicsShapeInfo()\n{\n    for (auto shape : _shapes)\n    {\n        auto it = _map.find(shape);\n        if (it != _map.end()) _map.erase(shape);\n        \n        cpShapeFree(shape);\n    }\n}\n\nvoid PhysicsShapeInfo::setGroup(cpGroup group)\n{\n    this->_group = group;\n    \n    for (cpShape* shape : _shapes)\n    {\n        cpShapeSetGroup(shape, group);\n    }\n}\n\nvoid PhysicsShapeInfo::setBody(cpBody* body)\n{\n    if (this->_body != body)\n    {\n        this->_body = body;\n        for (cpShape* shape : _shapes)\n        {\n            cpShapeSetBody(shape, body == nullptr ? _sharedBody : body);\n        }\n    }\n}\n\nvoid PhysicsShapeInfo::add(cpShape* shape)\n{\n    if (shape == nullptr) return;\n    \n    cpShapeSetGroup(shape, _group);\n    _shapes.push_back(shape);\n    _map.insert(std::pair<cpShape*, PhysicsShapeInfo*>(shape, this));\n}\n\nvoid PhysicsShapeInfo::remove(cpShape* shape)\n{\n    if (shape == nullptr) return;\n    \n    auto it = std::find(_shapes.begin(), _shapes.end(), shape);\n    if (it != _shapes.end())\n    {\n        _shapes.erase(it);\n        \n        auto mit = _map.find(shape);\n        if (mit != _map.end()) _map.erase(mit);\n        \n        cpShapeFree(shape);\n    }\n}\n\nvoid PhysicsShapeInfo::removeAll()\n{\n    for (cpShape* shape : _shapes)\n    {\n        auto mit = _map.find(shape);\n        if (mit != _map.end()) _map.erase(mit);\n        cpShapeFree(shape);\n    }\n    \n    _shapes.clear();\n}\n\nNS_CC_END\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_SHAPE_INFO_CHIPMUNK_H__\n#define __CCPHYSICS_SHAPE_INFO_CHIPMUNK_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include <vector>\n#include <unordered_map>\n#include \"chipmunk.h\"\n#include \"CCPlatformMacros.h\"\n\nNS_CC_BEGIN\n\nclass PhysicsShape;\n\nclass PhysicsShapeInfo\n{\npublic:\n    void add(cpShape* shape);\n    void remove(cpShape* shape);\n    void removeAll();\n    void setGroup(cpGroup group);\n    void setBody(cpBody* body);\n\n    PhysicsShape* getShape() const { return _shape; }\n    std::vector<cpShape*>& getShapes() { return _shapes; }\n    cpBody* getBody() const { return _body; }\n    cpGroup getGourp() const { return _group; }\n    static std::unordered_map<cpShape*, PhysicsShapeInfo*>& getMap() { return _map; }\n    static cpBody* getSharedBody() { return _sharedBody; }\n    \nprotected:\n    PhysicsShapeInfo(PhysicsShape* shape);\n    ~PhysicsShapeInfo();\n    \n    std::vector<cpShape*> _shapes;\n    PhysicsShape* _shape;\n    cpBody* _body;\n    cpGroup _group;\n    static std::unordered_map<cpShape*, PhysicsShapeInfo*> _map;\n    static cpBody* _sharedBody;\n    \n    friend class PhysicsShape;\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_SHAPE_INFO_CHIPMUNK_H__\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCPhysicsWorldInfo_chipmunk.h\"\n#if CC_USE_PHYSICS\n#include \"CCPhysicsHelper_chipmunk.h\"\n#include \"CCPhysicsBodyInfo_chipmunk.h\"\n#include \"CCPhysicsShapeInfo_chipmunk.h\"\n#include \"CCPhysicsJointInfo_chipmunk.h\"\nNS_CC_BEGIN\n\nPhysicsWorldInfo::PhysicsWorldInfo()\n{\n    _space = cpSpaceNew();\n}\n\nPhysicsWorldInfo::~PhysicsWorldInfo()\n{\n    cpSpaceFree(_space);\n}\n\nvoid PhysicsWorldInfo::setGravity(const Vect& gravity)\n{\n    cpSpaceSetGravity(_space, PhysicsHelper::point2cpv(gravity));\n}\n\nvoid PhysicsWorldInfo::addBody(PhysicsBodyInfo& body)\n{\n    if (!cpSpaceContainsBody(_space, body.getBody()))\n    {\n        cpSpaceAddBody(_space, body.getBody());\n    }\n}\n\nvoid PhysicsWorldInfo::removeBody(PhysicsBodyInfo& body)\n{\n    if (cpSpaceContainsBody(_space, body.getBody()))\n    {\n        cpSpaceRemoveBody(_space, body.getBody());\n    }\n}\n\nvoid PhysicsWorldInfo::addShape(PhysicsShapeInfo& shape)\n{\n    for (auto cps : shape.getShapes())\n    {\n        cpSpaceAddShape(_space, cps);\n    }\n}\n\nvoid PhysicsWorldInfo::removeShape(PhysicsShapeInfo& shape)\n{\n    for (auto cps : shape.getShapes())\n    {\n        if (cpSpaceContainsShape(_space, cps))\n        {\n            cpSpaceRemoveShape(_space, cps);\n        }\n    }\n}\n\nvoid PhysicsWorldInfo::addJoint(PhysicsJointInfo& joint)\n{\n    for (auto subjoint : joint.getJoints())\n    {\n        cpSpaceAddConstraint(_space, subjoint);\n    }\n}\n\nvoid PhysicsWorldInfo::removeJoint(PhysicsJointInfo& joint)\n{\n    for (auto subjoint : joint.getJoints())\n    {\n        cpSpaceRemoveConstraint(_space, subjoint);\n    }\n}\n\nNS_CC_END\n#endif // CC_USE_PHYSICS\n"
  },
  {
    "path": "cocos2d/cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCPHYSICS_WORLD_INFO_CHIPMUNK_H__\n#define __CCPHYSICS_WORLD_INFO_CHIPMUNK_H__\n\n#include \"ccConfig.h\"\n#if CC_USE_PHYSICS\n\n#include <vector>\n#include \"chipmunk.h\"\n#include \"CCPlatformMacros.h\"\n#include \"CCGeometry.h\"\nNS_CC_BEGIN\ntypedef Point Vect;\nclass PhysicsBodyInfo;\nclass PhysicsJointInfo;\nclass PhysicsShapeInfo;\n\nclass PhysicsWorldInfo\n{\npublic:\n    cpSpace* getSpace() const { return _space; }\n    void addShape(PhysicsShapeInfo& shape);\n    void removeShape(PhysicsShapeInfo& shape);\n    void addBody(PhysicsBodyInfo& body);\n    void removeBody(PhysicsBodyInfo& body);\n    void addJoint(PhysicsJointInfo& joint);\n    void removeJoint(PhysicsJointInfo& joint);\n    void setGravity(const Vect& gravity);\n    inline bool isLocked() { return 0 == _space->locked_private ? false : true; }\n    inline void step(float delta) { cpSpaceStep(_space, delta); }\n    \nprivate:\n    PhysicsWorldInfo();\n    ~PhysicsWorldInfo();\n    \nprivate:\n    cpSpace* _space;\n    \n    friend class PhysicsWorld;\n};\n\nNS_CC_END\n\n#endif // CC_USE_PHYSICS\n#endif // __CCPHYSICS_WORLD_INFO_CHIPMUNK_H__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/CMakeLists.txt",
    "content": "set(LUABINDING_SRC\n  auto-generated/lua-bindings/lua_cocos2dx_auto.cpp\n  auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp\n  auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp\n  auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp\n  auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp\n  auto-generated/lua-bindings/lua_cocos2dx_physics_auto.cpp\n  lua/bindings/tolua_fix.c\n  lua/bindings/CCLuaBridge.cpp\n  lua/bindings/CCLuaEngine.cpp\n  lua/bindings/CCLuaStack.cpp\n  lua/bindings/CCLuaValue.cpp\n  lua/bindings/Cocos2dxLuaLoader.cpp\n  lua/bindings/CCBProxy.cpp\n  lua/bindings/LuaOpengl.cpp\n  lua/bindings/LuaScriptHandlerMgr.cpp\n  lua/bindings/LuaBasicConversions.cpp\n  lua/bindings/lua_cocos2dx_manual.cpp\n  lua/bindings/lua_cocos2dx_extension_manual.cpp\n  lua/bindings/lua_cocos2dx_coco_studio_manual.cpp\n  lua/bindings/lua_cocos2dx_gui_manual.cpp\n  lua/bindings/lua_cocos2dx_spine_manual.cpp\n  lua/bindings/lua_cocos2dx_physics_manual.cpp\n  lua/bindings/lua_cocos2dx_deprecated.cpp\n  lua/bindings/lua_xml_http_request.cpp\n  lua/bindings/LuaSkeletonAnimation.cpp\n)\n\ninclude_directories(\n  auto-generated/lua-bindings\n  lua/bindings\n  ../../cocos/editor-support/cocosbuilder\n  ../../cocos/editor-support/cocostudio\n  ../../cocos/editor-support/spine\n  ../../cocos/gui\n  ../../external/lua/lua\n  ../../external/lua/tolua\n)\n\n\nadd_library(luabinding STATIC\n  ${LUABINDING_SRC}\n)\n\ntarget_link_libraries(luabinding\n  tolua\n  lua\n  spine\n)\n\nset_target_properties(luabinding\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/README.md",
    "content": "bindings-auto-generated\n=======================\n\nAutomatically generate javascript binding and lua binding codes for cocos2d-x\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_auto.cpp",
    "content": "#include \"jsb_cocos2dx_auto.hpp\"\n#include \"cocos2d_specifics.hpp\"\n#include \"cocos2d.h\"\n#include \"SimpleAudioEngine.h\"\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n    JSObject* global = ScriptingCore::getInstance()->getGlobalObject();\n\tisNewValid = JS_GetProperty(cx, global, \"initializing\", &initializing) && JSVAL_TO_BOOLEAN(initializing);\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n    JS_ReportError(cx, \"Don't use `new cc.XXX`, please use `cc.XXX.create` instead! \");\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_is_native_obj(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n\tvp.set(BOOLEAN_TO_JSVAL(JS_TRUE));\n\treturn JS_TRUE;\t\n}\nJSClass  *jsb_cocos2d_Action_class;\nJSObject *jsb_cocos2d_Action_prototype;\n\nJSBool js_cocos2dx_Action_startWithTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_startWithTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Action_startWithTarget : Error processing arguments\");\n\t\tcobj->startWithTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_startWithTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_setOriginalTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_setOriginalTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Action_setOriginalTarget : Error processing arguments\");\n\t\tcobj->setOriginalTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_setOriginalTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_clone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_clone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Action* ret = cobj->clone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Action>(cx, (cocos2d::Action*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_clone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_getOriginalTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_getOriginalTarget : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getOriginalTarget();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_getOriginalTarget : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_stop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_stop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stop();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_stop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_update : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Action_update : Error processing arguments\");\n\t\tcobj->update(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_update : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_getTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_getTarget : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getTarget();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_getTarget : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_step(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_step : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Action_step : Error processing arguments\");\n\t\tcobj->step(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_step : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_setTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_setTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Action_setTag : Error processing arguments\");\n\t\tcobj->setTag(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_setTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_getTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_getTag : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getTag();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_getTag : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_setTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_setTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Action_setTarget : Error processing arguments\");\n\t\tcobj->setTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_setTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_isDone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_isDone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isDone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_isDone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Action_reverse(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Action* cobj = (cocos2d::Action *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Action_reverse : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Action* ret = cobj->reverse();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Action>(cx, (cocos2d::Action*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Action_reverse : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_Action_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Action)\", obj);\n}\n\nvoid js_register_cocos2dx_Action(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Action_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Action_class->name = \"Action\";\n\tjsb_cocos2d_Action_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Action_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Action_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Action_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Action_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Action_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Action_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Action_class->finalize = js_cocos2d_Action_finalize;\n\tjsb_cocos2d_Action_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"startWithTarget\", js_cocos2dx_Action_startWithTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOriginalTarget\", js_cocos2dx_Action_setOriginalTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clone\", js_cocos2dx_Action_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOriginalTarget\", js_cocos2dx_Action_getOriginalTarget, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stop\", js_cocos2dx_Action_stop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_Action_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTarget\", js_cocos2dx_Action_getTarget, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"step\", js_cocos2dx_Action_step, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTag\", js_cocos2dx_Action_setTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTag\", js_cocos2dx_Action_getTag, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTarget\", js_cocos2dx_Action_setTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isDone\", js_cocos2dx_Action_isDone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reverse\", js_cocos2dx_Action_reverse, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Action_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Action_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Action\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Action> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Action_class;\n\t\tp->proto = jsb_cocos2d_Action_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FiniteTimeAction_class;\nJSObject *jsb_cocos2d_FiniteTimeAction_prototype;\n\nJSBool js_cocos2dx_FiniteTimeAction_setDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FiniteTimeAction* cobj = (cocos2d::FiniteTimeAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FiniteTimeAction_setDuration : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FiniteTimeAction_setDuration : Error processing arguments\");\n\t\tcobj->setDuration(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FiniteTimeAction_setDuration : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FiniteTimeAction_getDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FiniteTimeAction* cobj = (cocos2d::FiniteTimeAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FiniteTimeAction_getDuration : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getDuration();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FiniteTimeAction_getDuration : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_Action_prototype;\n\nvoid js_cocos2d_FiniteTimeAction_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FiniteTimeAction)\", obj);\n}\n\nvoid js_register_cocos2dx_FiniteTimeAction(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FiniteTimeAction_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FiniteTimeAction_class->name = \"FiniteTimeAction\";\n\tjsb_cocos2d_FiniteTimeAction_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FiniteTimeAction_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FiniteTimeAction_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FiniteTimeAction_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FiniteTimeAction_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FiniteTimeAction_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FiniteTimeAction_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FiniteTimeAction_class->finalize = js_cocos2d_FiniteTimeAction_finalize;\n\tjsb_cocos2d_FiniteTimeAction_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setDuration\", js_cocos2dx_FiniteTimeAction_setDuration, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDuration\", js_cocos2dx_FiniteTimeAction_getDuration, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_FiniteTimeAction_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Action_prototype,\n\t\tjsb_cocos2d_FiniteTimeAction_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FiniteTimeAction\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FiniteTimeAction> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FiniteTimeAction_class;\n\t\tp->proto = jsb_cocos2d_FiniteTimeAction_prototype;\n\t\tp->parentProto = jsb_cocos2d_Action_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Speed_class;\nJSObject *jsb_cocos2d_Speed_prototype;\n\nJSBool js_cocos2dx_Speed_setInnerAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Speed* cobj = (cocos2d::Speed *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Speed_setInnerAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Speed_setInnerAction : Error processing arguments\");\n\t\tcobj->setInnerAction(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Speed_setInnerAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Speed_setSpeed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Speed* cobj = (cocos2d::Speed *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Speed_setSpeed : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Speed_setSpeed : Error processing arguments\");\n\t\tcobj->setSpeed(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Speed_setSpeed : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Speed_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Speed* cobj = (cocos2d::Speed *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Speed_getInnerAction : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->getInnerAction();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Speed_getInnerAction : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Speed_getSpeed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Speed* cobj = (cocos2d::Speed *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Speed_getSpeed : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSpeed();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Speed_getSpeed : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Speed_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdouble arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Speed_create : Error processing arguments\");\n\t\tcocos2d::Speed* ret = cocos2d::Speed::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Speed>(cx, (cocos2d::Speed*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Speed_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Action_prototype;\n\nvoid js_cocos2d_Speed_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Speed)\", obj);\n}\n\nvoid js_register_cocos2dx_Speed(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Speed_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Speed_class->name = \"Speed\";\n\tjsb_cocos2d_Speed_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Speed_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Speed_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Speed_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Speed_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Speed_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Speed_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Speed_class->finalize = js_cocos2d_Speed_finalize;\n\tjsb_cocos2d_Speed_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setInnerAction\", js_cocos2dx_Speed_setInnerAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSpeed\", js_cocos2dx_Speed_setSpeed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInnerAction\", js_cocos2dx_Speed_getInnerAction, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpeed\", js_cocos2dx_Speed_getSpeed, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Speed_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Speed_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Action_prototype,\n\t\tjsb_cocos2d_Speed_class,\n\t\tdummy_constructor<cocos2d::Speed>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Speed\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Speed> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Speed_class;\n\t\tp->proto = jsb_cocos2d_Speed_prototype;\n\t\tp->parentProto = jsb_cocos2d_Action_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Follow_class;\nJSObject *jsb_cocos2d_Follow_prototype;\n\nJSBool js_cocos2dx_Follow_setBoudarySet(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Follow* cobj = (cocos2d::Follow *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Follow_setBoudarySet : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Follow_setBoudarySet : Error processing arguments\");\n\t\tcobj->setBoudarySet(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Follow_setBoudarySet : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Follow_isBoundarySet(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Follow* cobj = (cocos2d::Follow *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Follow_isBoundarySet : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBoundarySet();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Follow_isBoundarySet : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Follow_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Follow_create : Error processing arguments\");\n\t\tcocos2d::Follow* ret = cocos2d::Follow::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Follow>(cx, (cocos2d::Follow*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::Rect arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Follow_create : Error processing arguments\");\n\t\tcocos2d::Follow* ret = cocos2d::Follow::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Follow>(cx, (cocos2d::Follow*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Follow_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Action_prototype;\n\nvoid js_cocos2d_Follow_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Follow)\", obj);\n}\n\nvoid js_register_cocos2dx_Follow(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Follow_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Follow_class->name = \"Follow\";\n\tjsb_cocos2d_Follow_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Follow_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Follow_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Follow_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Follow_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Follow_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Follow_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Follow_class->finalize = js_cocos2d_Follow_finalize;\n\tjsb_cocos2d_Follow_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setBoudarySet\", js_cocos2dx_Follow_setBoudarySet, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isBoundarySet\", js_cocos2dx_Follow_isBoundarySet, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Follow_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Follow_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Action_prototype,\n\t\tjsb_cocos2d_Follow_class,\n\t\tdummy_constructor<cocos2d::Follow>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Follow\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Follow> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Follow_class;\n\t\tp->proto = jsb_cocos2d_Follow_prototype;\n\t\tp->parentProto = jsb_cocos2d_Action_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_GLProgram_class;\nJSObject *jsb_cocos2d_GLProgram_prototype;\n\nJSBool js_cocos2dx_GLProgram_getFragmentShaderLog(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_getFragmentShaderLog : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getFragmentShaderLog();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_getFragmentShaderLog : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_addAttribute(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_addAttribute : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tunsigned int arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_uint32(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_addAttribute : Error processing arguments\");\n\t\tcobj->addAttribute(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_addAttribute : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tconst float* arg1;\n\t\tunsigned int arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv : Error processing arguments\");\n\t\tcobj->setUniformLocationWithMatrix4fv(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_getUniformLocationForName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_getUniformLocationForName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_getUniformLocationForName : Error processing arguments\");\n\t\tint ret = cobj->getUniformLocationForName(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_getUniformLocationForName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_use(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_use : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->use();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_use : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_getVertexShaderLog(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_getVertexShaderLog : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getVertexShaderLog();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_getVertexShaderLog : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_initWithVertexShaderByteArray(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_initWithVertexShaderByteArray : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_initWithVertexShaderByteArray : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithVertexShaderByteArray(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_initWithVertexShaderByteArray : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_initWithVertexShaderFilename(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_initWithVertexShaderFilename : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_initWithVertexShaderFilename : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithVertexShaderFilename(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_initWithVertexShaderFilename : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformsForBuiltins(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::GLProgram* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformsForBuiltins : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tkmMat4 arg0;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR kmMat4;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setUniformsForBuiltins(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcobj->setUniformsForBuiltins();\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformsForBuiltins : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith3i(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith3i : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tint arg0;\n\t\tint arg1;\n\t\tint arg2;\n\t\tint arg3;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith3i : Error processing arguments\");\n\t\tcobj->setUniformLocationWith3i(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWith3i : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith3iv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith3iv : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tint* arg1;\n\t\tunsigned int arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR int*;\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith3iv : Error processing arguments\");\n\t\tcobj->setUniformLocationWith3iv(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWith3iv : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_updateUniforms(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_updateUniforms : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateUniforms();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_updateUniforms : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith4iv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith4iv : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tint* arg1;\n\t\tunsigned int arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR int*;\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith4iv : Error processing arguments\");\n\t\tcobj->setUniformLocationWith4iv(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWith4iv : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tconst float* arg1;\n\t\tunsigned int arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv : Error processing arguments\");\n\t\tcobj->setUniformLocationWithMatrix2fv(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_link(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_link : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->link();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_link : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith2iv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith2iv : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tint* arg1;\n\t\tunsigned int arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR int*;\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith2iv : Error processing arguments\");\n\t\tcobj->setUniformLocationWith2iv(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWith2iv : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tconst float* arg1;\n\t\tunsigned int arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv : Error processing arguments\");\n\t\tcobj->setUniformLocationWithMatrix3fv(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_reset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_reset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->reset();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_reset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith4i(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith4i : Invalid Native Object\");\n\tif (argc == 5) {\n\t\tint arg0;\n\t\tint arg1;\n\t\tint arg2;\n\t\tint arg3;\n\t\tint arg4;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith4i : Error processing arguments\");\n\t\tcobj->setUniformLocationWith4i(arg0, arg1, arg2, arg3, arg4);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWith4i : wrong number of arguments: %d, was expecting %d\", argc, 5);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith1i(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith1i : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith1i : Error processing arguments\");\n\t\tcobj->setUniformLocationWith1i(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWith1i : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith2i(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith2i : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tint arg1;\n\t\tint arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GLProgram_setUniformLocationWith2i : Error processing arguments\");\n\t\tcobj->setUniformLocationWith2i(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_setUniformLocationWith2i : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GLProgram_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::GLProgram* cobj = new cocos2d::GLProgram();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::GLProgram> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::GLProgram\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GLProgram_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_GLProgram_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (GLProgram)\", obj);\n}\n\nvoid js_register_cocos2dx_GLProgram(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_GLProgram_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_GLProgram_class->name = \"GLProgram\";\n\tjsb_cocos2d_GLProgram_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_GLProgram_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_GLProgram_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_GLProgram_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_GLProgram_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_GLProgram_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_GLProgram_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_GLProgram_class->finalize = js_cocos2d_GLProgram_finalize;\n\tjsb_cocos2d_GLProgram_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getFragmentShaderLog\", js_cocos2dx_GLProgram_getFragmentShaderLog, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addAttribute\", js_cocos2dx_GLProgram_addAttribute, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWithMatrix4fv\", js_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getUniformLocationForName\", js_cocos2dx_GLProgram_getUniformLocationForName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"use\", js_cocos2dx_GLProgram_use, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVertexShaderLog\", js_cocos2dx_GLProgram_getVertexShaderLog, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithString\", js_cocos2dx_GLProgram_initWithVertexShaderByteArray, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_GLProgram_initWithVertexShaderFilename, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformsForBuiltins\", js_cocos2dx_GLProgram_setUniformsForBuiltins, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWith3i\", js_cocos2dx_GLProgram_setUniformLocationWith3i, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWith3iv\", js_cocos2dx_GLProgram_setUniformLocationWith3iv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateUniforms\", js_cocos2dx_GLProgram_updateUniforms, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWith4iv\", js_cocos2dx_GLProgram_setUniformLocationWith4iv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWithMatrix2fv\", js_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"link\", js_cocos2dx_GLProgram_link, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWith2iv\", js_cocos2dx_GLProgram_setUniformLocationWith2iv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWithMatrix3fv\", js_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reset\", js_cocos2dx_GLProgram_reset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWith4i\", js_cocos2dx_GLProgram_setUniformLocationWith4i, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationI32\", js_cocos2dx_GLProgram_setUniformLocationWith1i, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUniformLocationWith2i\", js_cocos2dx_GLProgram_setUniformLocationWith2i, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_GLProgram_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_GLProgram_class,\n\t\tjs_cocos2dx_GLProgram_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"GLProgram\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::GLProgram> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_GLProgram_class;\n\t\tp->proto = jsb_cocos2d_GLProgram_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Touch_class;\nJSObject *jsb_cocos2d_Touch_prototype;\n\nJSBool js_cocos2dx_Touch_getPreviousLocationInView(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getPreviousLocationInView : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getPreviousLocationInView();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getPreviousLocationInView : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_getLocation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getLocation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getLocation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getLocation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_getDelta(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getDelta : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getDelta();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getDelta : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_getStartLocationInView(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getStartLocationInView : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getStartLocationInView();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getStartLocationInView : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_getStartLocation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getStartLocation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getStartLocation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getStartLocation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_getID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getID : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getID();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getID : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_setTouchInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_setTouchInfo : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Touch_setTouchInfo : Error processing arguments\");\n\t\tcobj->setTouchInfo(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_setTouchInfo : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_getLocationInView(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getLocationInView : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getLocationInView();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getLocationInView : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_getPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Touch* cobj = (cocos2d::Touch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Touch_getPreviousLocation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getPreviousLocation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_getPreviousLocation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Touch_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Touch* cobj = new cocos2d::Touch();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Touch> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Touch\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Touch_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Touch_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Touch)\", obj);\n}\n\nvoid js_register_cocos2dx_Touch(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Touch_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Touch_class->name = \"Touch\";\n\tjsb_cocos2d_Touch_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Touch_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Touch_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Touch_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Touch_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Touch_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Touch_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Touch_class->finalize = js_cocos2d_Touch_finalize;\n\tjsb_cocos2d_Touch_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getPreviousLocationInView\", js_cocos2dx_Touch_getPreviousLocationInView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLocation\", js_cocos2dx_Touch_getLocation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDelta\", js_cocos2dx_Touch_getDelta, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartLocationInView\", js_cocos2dx_Touch_getStartLocationInView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartLocation\", js_cocos2dx_Touch_getStartLocation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getId\", js_cocos2dx_Touch_getID, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchInfo\", js_cocos2dx_Touch_setTouchInfo, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLocationInView\", js_cocos2dx_Touch_getLocationInView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPreviousLocation\", js_cocos2dx_Touch_getPreviousLocation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Touch_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Touch_class,\n\t\tjs_cocos2dx_Touch_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Touch\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Touch> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Touch_class;\n\t\tp->proto = jsb_cocos2d_Touch_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Texture2D_class;\nJSObject *jsb_cocos2d_Texture2D_prototype;\n\nJSBool js_cocos2dx_Texture2D_getShaderProgram(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getShaderProgram : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::GLProgram* ret = cobj->getShaderProgram();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GLProgram>(cx, (cocos2d::GLProgram*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getShaderProgram : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getMaxT(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getMaxT : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMaxT();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getMaxT : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getStringForFormat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getStringForFormat : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getStringForFormat();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getStringForFormat : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_initWithImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Texture2D* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_initWithImage : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Image* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Image*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D::PixelFormat arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithImage(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Image* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Image*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithImage(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_initWithImage : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_setShaderProgram(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setShaderProgram : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::GLProgram* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::GLProgram*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setShaderProgram : Error processing arguments\");\n\t\tcobj->setShaderProgram(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_setShaderProgram : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getMaxS(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getMaxS : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMaxS();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getMaxS : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_hasPremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_hasPremultipliedAlpha : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->hasPremultipliedAlpha();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_hasPremultipliedAlpha : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_initWithMipmaps(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_initWithMipmaps : Invalid Native Object\");\n\tif (argc == 5) {\n\t\tcocos2d::_MipmapInfo* arg0;\n\t\tint arg1;\n\t\tcocos2d::Texture2D::PixelFormat arg2;\n\t\tint arg3;\n\t\tint arg4;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR _MipmapInfo*;\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_initWithMipmaps : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithMipmaps(arg0, arg1, arg2, arg3, arg4);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_initWithMipmaps : wrong number of arguments: %d, was expecting %d\", argc, 5);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getPixelsHigh(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getPixelsHigh : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getPixelsHigh();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getPixelsHigh : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getBitsPerPixelForFormat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Texture2D* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getBitsPerPixelForFormat : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Texture2D::PixelFormat arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tunsigned int ret = cobj->getBitsPerPixelForFormat(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = uint32_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tunsigned int ret = cobj->getBitsPerPixelForFormat();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = uint32_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getBitsPerPixelForFormat : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned int ret = cobj->getName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_initWithString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Texture2D* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_initWithString : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::FontDefinition arg1;\n\t\t\tok &= jsval_to_FontDefinition(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg3;\n\t\t\tok &= jsval_to_ccsize(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg3;\n\t\t\tok &= jsval_to_ccsize(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 6) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg3;\n\t\t\tok &= jsval_to_ccsize(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextVAlignment arg5;\n\t\t\tok &= jsval_to_int32(cx, argv[5], (int32_t *)&arg5);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_initWithString : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_setMaxT(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setMaxT : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setMaxT : Error processing arguments\");\n\t\tcobj->setMaxT(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_setMaxT : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_drawInRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_drawInRect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_drawInRect : Error processing arguments\");\n\t\tcobj->drawInRect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_drawInRect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getContentSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getContentSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getContentSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getContentSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_setAliasTexParameters(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setAliasTexParameters : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setAliasTexParameters();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_setAliasTexParameters : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_setAntiAliasTexParameters(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setAntiAliasTexParameters : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setAntiAliasTexParameters();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_setAntiAliasTexParameters : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_generateMipmap(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_generateMipmap : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->generateMipmap();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_generateMipmap : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getDescription(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getDescription : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getDescription();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getDescription : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getPixelFormat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getPixelFormat : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getPixelFormat();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getPixelFormat : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getContentSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getContentSizeInPixels : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getContentSizeInPixels();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getContentSizeInPixels : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_getPixelsWide(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_getPixelsWide : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getPixelsWide();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getPixelsWide : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_drawAtPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_drawAtPoint : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_drawAtPoint : Error processing arguments\");\n\t\tcobj->drawAtPoint(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_drawAtPoint : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_hasMipmaps(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_hasMipmaps : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->hasMipmaps();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_hasMipmaps : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_setMaxS(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Texture2D* cobj = (cocos2d::Texture2D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setMaxS : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setMaxS : Error processing arguments\");\n\t\tcobj->setMaxS(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_setMaxS : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Texture2D_setDefaultAlphaPixelFormat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D::PixelFormat arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_setDefaultAlphaPixelFormat : Error processing arguments\");\n\t\tcocos2d::Texture2D::setDefaultAlphaPixelFormat(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_setDefaultAlphaPixelFormat : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Texture2D_getDefaultAlphaPixelFormat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tint ret = (int)cocos2d::Texture2D::getDefaultAlphaPixelFormat();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_getDefaultAlphaPixelFormat : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha : Error processing arguments\");\n\t\tcocos2d::Texture2D::PVRImagesHavePremultipliedAlpha(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Texture2D_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* cobj = new cocos2d::Texture2D();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Texture2D> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Texture2D\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Texture2D_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Texture2D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Texture2D)\", obj);\n}\n\nvoid js_register_cocos2dx_Texture2D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Texture2D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Texture2D_class->name = \"Texture2D\";\n\tjsb_cocos2d_Texture2D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Texture2D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Texture2D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Texture2D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Texture2D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Texture2D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Texture2D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Texture2D_class->finalize = js_cocos2d_Texture2D_finalize;\n\tjsb_cocos2d_Texture2D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getShaderProgram\", js_cocos2dx_Texture2D_getShaderProgram, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaxT\", js_cocos2dx_Texture2D_getMaxT, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringForFormat\", js_cocos2dx_Texture2D_getStringForFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithImage\", js_cocos2dx_Texture2D_initWithImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setShaderProgram\", js_cocos2dx_Texture2D_setShaderProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaxS\", js_cocos2dx_Texture2D_getMaxS, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hasPremultipliedAlpha\", js_cocos2dx_Texture2D_hasPremultipliedAlpha, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithMipmaps\", js_cocos2dx_Texture2D_initWithMipmaps, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPixelsHigh\", js_cocos2dx_Texture2D_getPixelsHigh, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBitsPerPixelForFormat\", js_cocos2dx_Texture2D_getBitsPerPixelForFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getName\", js_cocos2dx_Texture2D_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithString\", js_cocos2dx_Texture2D_initWithString, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaxT\", js_cocos2dx_Texture2D_setMaxT, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawInRect\", js_cocos2dx_Texture2D_drawInRect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContentSize\", js_cocos2dx_Texture2D_getContentSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAliasTexParameters\", js_cocos2dx_Texture2D_setAliasTexParameters, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAntiAliasTexParameters\", js_cocos2dx_Texture2D_setAntiAliasTexParameters, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"generateMipmap\", js_cocos2dx_Texture2D_generateMipmap, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDescription\", js_cocos2dx_Texture2D_getDescription, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPixelFormat\", js_cocos2dx_Texture2D_getPixelFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContentSizeInPixels\", js_cocos2dx_Texture2D_getContentSizeInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPixelsWide\", js_cocos2dx_Texture2D_getPixelsWide, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawAtPoint\", js_cocos2dx_Texture2D_drawAtPoint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hasMipmaps\", js_cocos2dx_Texture2D_hasMipmaps, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaxS\", js_cocos2dx_Texture2D_setMaxS, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"setDefaultAlphaPixelFormat\", js_cocos2dx_Texture2D_setDefaultAlphaPixelFormat, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDefaultAlphaPixelFormat\", js_cocos2dx_Texture2D_getDefaultAlphaPixelFormat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"PVRImagesHavePremultipliedAlpha\", js_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Texture2D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Texture2D_class,\n\t\tjs_cocos2dx_Texture2D_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Texture2D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Texture2D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Texture2D_class;\n\t\tp->proto = jsb_cocos2d_Texture2D_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Node_class;\nJSObject *jsb_cocos2d_Node_prototype;\n\nJSBool js_cocos2dx_Node_addChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_addChild : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addChild(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addChild(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addChild(arg0, arg1, arg2);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_addChild : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_removeComponent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_removeComponent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_removeComponent : Error processing arguments\");\n\t\tJSBool ret = cobj->removeComponent(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_removeComponent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setPhysicsBody(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setPhysicsBody : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::PhysicsBody* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::PhysicsBody*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setPhysicsBody : Error processing arguments\");\n\t\tcobj->setPhysicsBody(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setPhysicsBody : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getShaderProgram(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getShaderProgram : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::GLProgram* ret = cobj->getShaderProgram();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GLProgram>(cx, (cocos2d::GLProgram*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::GLProgram* ret = cobj->getShaderProgram();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GLProgram>(cx, (cocos2d::GLProgram*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getShaderProgram : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getDescription(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getDescription : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getDescription();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getDescription : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setOpacityModifyRGB : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setOpacityModifyRGB : Error processing arguments\");\n\t\tcobj->setOpacityModifyRGB(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setOpacityModifyRGB : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setCascadeOpacityEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setCascadeOpacityEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setCascadeOpacityEnabled : Error processing arguments\");\n\t\tcobj->setCascadeOpacityEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setCascadeOpacityEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getChildren(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getChildren : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Vector<cocos2d::Node *>& ret = cobj->getChildren();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Vector<cocos2d::Node *>& ret = cobj->getChildren();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getChildren : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_pause(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_pause : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pause();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_pause : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_convertToWorldSpaceAR(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_convertToWorldSpaceAR : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_convertToWorldSpaceAR : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertToWorldSpaceAR(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_convertToWorldSpaceAR : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_isIgnoreAnchorPointForPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_isIgnoreAnchorPointForPosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isIgnoreAnchorPointForPosition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_isIgnoreAnchorPointForPosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_updateDisplayedOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_updateDisplayedOpacity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tuint16_t arg0;\n\t\tok &= jsval_to_uint16(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_updateDisplayedOpacity : Error processing arguments\");\n\t\tcobj->updateDisplayedOpacity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_updateDisplayedOpacity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setRotation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setRotation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setRotation : Error processing arguments\");\n\t\tcobj->setRotation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setRotation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setLocalZOrder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setLocalZOrder : Error processing arguments\");\n\t\tcobj->setLocalZOrder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setLocalZOrder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setScaleY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setScaleY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setScaleY : Error processing arguments\");\n\t\tcobj->setScaleY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setScaleY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setScaleX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setScaleX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setScaleX : Error processing arguments\");\n\t\tcobj->setScaleX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setScaleX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_removeAllComponents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_removeAllComponents : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeAllComponents();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_removeAllComponents : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node__setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node__setLocalZOrder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node__setLocalZOrder : Error processing arguments\");\n\t\tcobj->_setLocalZOrder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node__setLocalZOrder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getTag : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getTag();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getTag : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getNodeToWorldAffineTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getNodeToWorldAffineTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::AffineTransform ret = cobj->getNodeToWorldAffineTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccaffinetransform_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getNodeToWorldAffineTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getNodeToWorldTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getNodeToWorldTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tkmMat4 ret = cobj->getNodeToWorldTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getNodeToWorldTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_removeChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_removeChild : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_removeChild : Error processing arguments\");\n\t\tcobj->removeChild(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tJSBool arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_removeChild : Error processing arguments\");\n\t\tcobj->removeChild(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_removeChild : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_convertToWorldSpace(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_convertToWorldSpace : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_convertToWorldSpace : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertToWorldSpace(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_convertToWorldSpace : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getScene : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Scene* ret = cobj->getScene();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, (cocos2d::Scene*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getScene : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getEventDispatcher : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::EventDispatcher* ret = cobj->getEventDispatcher();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EventDispatcher>(cx, (cocos2d::EventDispatcher*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getEventDispatcher : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setSkewX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setSkewX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setSkewX : Error processing arguments\");\n\t\tcobj->setSkewX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setSkewX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setSkewY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setSkewY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setSkewY : Error processing arguments\");\n\t\tcobj->setSkewY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setSkewY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getOpacity : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tuint16_t ret = cobj->getOpacity();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getOpacity : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_convertTouchToNodeSpace(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_convertTouchToNodeSpace : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Touch*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_convertTouchToNodeSpace : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertTouchToNodeSpace(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_convertTouchToNodeSpace : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_removeAllChildrenWithCleanup : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tJSBool arg0;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->removeAllChildrenWithCleanup(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcobj->removeAllChildren();\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_removeAllChildrenWithCleanup : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getRotationX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getRotationX : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRotationX();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getRotationX : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getRotationY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getRotationY : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRotationY();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getRotationY : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getNodeToParentAffineTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getNodeToParentAffineTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccaffinetransform_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getNodeToParentAffineTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_isCascadeOpacityEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_isCascadeOpacityEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isCascadeOpacityEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_isCascadeOpacityEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setParent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setParent : Error processing arguments\");\n\t\tcobj->setParent(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setParent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getNodeToParentTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getNodeToParentTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst kmMat4& ret = cobj->getNodeToParentTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getNodeToParentTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_resume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_resume : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resume();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_resume : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getPhysicsBody(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getPhysicsBody : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::PhysicsBody* ret = cobj->getPhysicsBody();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::PhysicsBody>(cx, (cocos2d::PhysicsBody*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getPhysicsBody : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_stopActionByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_stopActionByTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_stopActionByTag : Error processing arguments\");\n\t\tcobj->stopActionByTag(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_stopActionByTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_reorderChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_reorderChild : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tint arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_reorderChild : Error processing arguments\");\n\t\tcobj->reorderChild(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_reorderChild : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_ignoreAnchorPointForPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_ignoreAnchorPointForPosition : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_ignoreAnchorPointForPosition : Error processing arguments\");\n\t\tcobj->ignoreAnchorPointForPosition(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_ignoreAnchorPointForPosition : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setColor : Error processing arguments\");\n\t\tcobj->setColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setPositionY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setPositionY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setPositionY : Error processing arguments\");\n\t\tcobj->setPositionY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setPositionY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setPositionX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setPositionX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setPositionX : Error processing arguments\");\n\t\tcobj->setPositionX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setPositionX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setNodeToParentTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setNodeToParentTransform : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tkmMat4 arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR kmMat4;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setNodeToParentTransform : Error processing arguments\");\n\t\tcobj->setNodeToParentTransform(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setNodeToParentTransform : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getAnchorPoint : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getAnchorPoint();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getAnchorPoint : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getNumberOfRunningActions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getNumberOfRunningActions : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getNumberOfRunningActions();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getNumberOfRunningActions : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_updateTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_updateTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateTransform();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_updateTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_isVisible(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_isVisible : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isVisible();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_isVisible : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getChildrenCount(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getChildrenCount : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getChildrenCount();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getChildrenCount : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_convertToNodeSpaceAR(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_convertToNodeSpaceAR : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_convertToNodeSpaceAR : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertToNodeSpaceAR(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_convertToNodeSpaceAR : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_addComponent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_addComponent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Component* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Component*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_addComponent : Error processing arguments\");\n\t\tJSBool ret = cobj->addComponent(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_addComponent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_visit(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_visit : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->visit();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_visit : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setShaderProgram(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setShaderProgram : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::GLProgram* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::GLProgram*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setShaderProgram : Error processing arguments\");\n\t\tcobj->setShaderProgram(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setShaderProgram : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getRotation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getRotation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRotation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getRotation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getLocalZOrder : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getLocalZOrder();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getLocalZOrder : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getAnchorPointInPoints(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getAnchorPointInPoints : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getAnchorPointInPoints();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getAnchorPointInPoints : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_runAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_runAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Action* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Action*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_runAction : Error processing arguments\");\n\t\tcocos2d::Action* ret = cobj->runAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Action>(cx, (cocos2d::Action*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_runAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_transform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_transform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->transform();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_transform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setVertexZ(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setVertexZ : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setVertexZ : Error processing arguments\");\n\t\tcobj->setVertexZ(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setVertexZ : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setScheduler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setScheduler : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Scheduler* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Scheduler*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setScheduler : Error processing arguments\");\n\t\tcobj->setScheduler(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setScheduler : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_stopAllActions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_stopAllActions : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopAllActions();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_stopAllActions : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getSkewX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getSkewX : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSkewX();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getSkewX : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getSkewY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getSkewY : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSkewY();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getSkewY : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getDisplayedColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getDisplayedColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getDisplayedColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getDisplayedColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getActionByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getActionByTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_getActionByTag : Error processing arguments\");\n\t\tcocos2d::Action* ret = cobj->getActionByTag(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Action>(cx, (cocos2d::Action*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getActionByTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setRotationX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setRotationX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setRotationX : Error processing arguments\");\n\t\tcobj->setRotationX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setRotationX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setRotationY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setRotationY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setRotationY : Error processing arguments\");\n\t\tcobj->setRotationY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setRotationY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setAdditionalTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setAdditionalTransform : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tkmMat4 arg0;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR kmMat4;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setAdditionalTransform(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::AffineTransform arg0;\n\t\t\tok &= jsval_to_ccaffinetransform(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setAdditionalTransform(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setAdditionalTransform : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getDisplayedOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getDisplayedOpacity : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tuint16_t ret = cobj->getDisplayedOpacity();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getDisplayedOpacity : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getScheduler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getScheduler : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Scheduler* ret = cobj->getScheduler();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scheduler>(cx, (cocos2d::Scheduler*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Scheduler* ret = cobj->getScheduler();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scheduler>(cx, (cocos2d::Scheduler*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getScheduler : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getParentToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getParentToNodeAffineTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::AffineTransform ret = cobj->getParentToNodeAffineTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccaffinetransform_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getParentToNodeAffineTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getOrderOfArrival : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getOrderOfArrival();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getOrderOfArrival : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setActionManager(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setActionManager : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionManager* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionManager*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setActionManager : Error processing arguments\");\n\t\tcobj->setActionManager(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setActionManager : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getPosition : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tfloat* arg0;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tfloat* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->getPosition(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Point& ret = cobj->getPosition();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getPosition : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_isRunning(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_isRunning : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isRunning();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_isRunning : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getParent : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Node* ret = cobj->getParent();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Node* ret = cobj->getParent();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getParent : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getPositionY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getPositionY : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getPositionY();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getPositionY : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getPositionX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getPositionX : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getPositionX();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getPositionX : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_removeChildByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_removeChildByTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_removeChildByTag : Error processing arguments\");\n\t\tcobj->removeChildByTag(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_removeChildByTag : Error processing arguments\");\n\t\tcobj->removeChildByTag(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_removeChildByTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_updateDisplayedColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_updateDisplayedColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_updateDisplayedColor : Error processing arguments\");\n\t\tcobj->updateDisplayedColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_updateDisplayedColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setVisible(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setVisible : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setVisible : Error processing arguments\");\n\t\tcobj->setVisible(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setVisible : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getParentToNodeTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getParentToNodeTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst kmMat4& ret = cobj->getParentToNodeTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getParentToNodeTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getVertexZ(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getVertexZ : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getVertexZ();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getVertexZ : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setGlobalZOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setGlobalZOrder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setGlobalZOrder : Error processing arguments\");\n\t\tcobj->setGlobalZOrder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setGlobalZOrder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setScale : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setScale(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setScale(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setScale : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getChildByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getChildByTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_getChildByTag : Error processing arguments\");\n\t\tcocos2d::Node* ret = cobj->getChildByTag(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getChildByTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setOrderOfArrival : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setOrderOfArrival : Error processing arguments\");\n\t\tcobj->setOrderOfArrival(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setOrderOfArrival : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getScaleY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getScaleY : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getScaleY();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getScaleY : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getScaleX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getScaleX : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getScaleX();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getScaleX : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getWorldToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getWorldToNodeAffineTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::AffineTransform ret = cobj->getWorldToNodeAffineTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccaffinetransform_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getWorldToNodeAffineTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setCascadeColorEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setCascadeColorEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setCascadeColorEnabled : Error processing arguments\");\n\t\tcobj->setCascadeColorEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setCascadeColorEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setOpacity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tuint16_t arg0;\n\t\tok &= jsval_to_uint16(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setOpacity : Error processing arguments\");\n\t\tcobj->setOpacity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setOpacity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_cleanup(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_cleanup : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->cleanup();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_cleanup : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getComponent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getComponent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_getComponent : Error processing arguments\");\n\t\tcocos2d::Component* ret = cobj->getComponent(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Component>(cx, (cocos2d::Component*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getComponent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getContentSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getContentSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getContentSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getContentSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getBoundingBox(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getBoundingBox : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Rect ret = cobj->getBoundingBox();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getBoundingBox : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_updatePhysicsTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_updatePhysicsTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->updatePhysicsTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_updatePhysicsTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setEventDispatcher : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::EventDispatcher* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::EventDispatcher*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setEventDispatcher : Error processing arguments\");\n\t\tcobj->setEventDispatcher(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setEventDispatcher : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getGlobalZOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getGlobalZOrder : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getGlobalZOrder();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getGlobalZOrder : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_draw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_draw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->draw();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_draw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_transformAncestors(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_transformAncestors : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->transformAncestors();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_transformAncestors : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setUserObject(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setUserObject : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Object* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setUserObject : Error processing arguments\");\n\t\tcobj->setUserObject(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setUserObject : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_removeFromParentAndCleanup(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_removeFromParentAndCleanup : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tJSBool arg0;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->removeFromParentAndCleanup(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcobj->removeFromParent();\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_removeFromParentAndCleanup : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_convertTouchToNodeSpaceAR(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_convertTouchToNodeSpaceAR : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Touch*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_convertTouchToNodeSpaceAR : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertTouchToNodeSpaceAR(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_convertTouchToNodeSpaceAR : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_update : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_update : Error processing arguments\");\n\t\tcobj->update(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_update : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_sortAllChildren(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_sortAllChildren : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->sortAllChildren();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_sortAllChildren : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getWorldToNodeTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getWorldToNodeTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tkmMat4 ret = cobj->getWorldToNodeTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getWorldToNodeTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getScale : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getScale();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getScale : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_convertToNodeSpace(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_convertToNodeSpace : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_convertToNodeSpace : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertToNodeSpace(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_convertToNodeSpace : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_setTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_setTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_setTag : Error processing arguments\");\n\t\tcobj->setTag(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_setTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_isCascadeColorEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_isCascadeColorEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isCascadeColorEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_isCascadeColorEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_isOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_isOpacityModifyRGB : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isOpacityModifyRGB();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_isOpacityModifyRGB : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_stopAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_stopAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Action* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Action*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Node_stopAction : Error processing arguments\");\n\t\tcobj->stopAction(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_stopAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_getActionManager(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Node* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Node_getActionManager : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::ActionManager* ret = cobj->getActionManager();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionManager>(cx, (cocos2d::ActionManager*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ActionManager* ret = cobj->getActionManager();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionManager>(cx, (cocos2d::ActionManager*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Node_getActionManager : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Node_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cocos2d::Node::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Node_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Node_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Node)\", obj);\n}\n\nstatic JSBool js_cocos2d_Node_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::Node *nobj = cocos2d::Node::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Node\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_Node(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Node_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Node_class->name = \"Node\";\n\tjsb_cocos2d_Node_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Node_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Node_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Node_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Node_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Node_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Node_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Node_class->finalize = js_cocos2d_Node_finalize;\n\tjsb_cocos2d_Node_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"addChild\", js_cocos2dx_Node_addChild, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeComponent\", js_cocos2dx_Node_removeComponent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPhysicsBody\", js_cocos2dx_Node_setPhysicsBody, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getShaderProgram\", js_cocos2dx_Node_getShaderProgram, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDescription\", js_cocos2dx_Node_getDescription, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOpacityModifyRGB\", js_cocos2dx_Node_setOpacityModifyRGB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCascadeOpacityEnabled\", js_cocos2dx_Node_setCascadeOpacityEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getChildren\", js_cocos2dx_Node_getChildren, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pause\", js_cocos2dx_Node_pause, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertToWorldSpaceAR\", js_cocos2dx_Node_convertToWorldSpaceAR, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isIgnoreAnchorPointForPosition\", js_cocos2dx_Node_isIgnoreAnchorPointForPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateDisplayedOpacity\", js_cocos2dx_Node_updateDisplayedOpacity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotation\", js_cocos2dx_Node_setRotation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setZOrder\", js_cocos2dx_Node_setLocalZOrder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScaleY\", js_cocos2dx_Node_setScaleY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScaleX\", js_cocos2dx_Node_setScaleX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getColor\", js_cocos2dx_Node_getColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllComponents\", js_cocos2dx_Node_removeAllComponents, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"_setLocalZOrder\", js_cocos2dx_Node__setLocalZOrder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTag\", js_cocos2dx_Node_getTag, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeToWorldAffineTransform\", js_cocos2dx_Node_getNodeToWorldAffineTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeToWorldTransform\", js_cocos2dx_Node_getNodeToWorldTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeChild\", js_cocos2dx_Node_removeChild, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertToWorldSpace\", js_cocos2dx_Node_convertToWorldSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScene\", js_cocos2dx_Node_getScene, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEventDispatcher\", js_cocos2dx_Node_getEventDispatcher, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSkewX\", js_cocos2dx_Node_setSkewX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSkewY\", js_cocos2dx_Node_setSkewY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOpacity\", js_cocos2dx_Node_getOpacity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertTouchToNodeSpace\", js_cocos2dx_Node_convertTouchToNodeSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllChildren\", js_cocos2dx_Node_removeAllChildrenWithCleanup, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRotationX\", js_cocos2dx_Node_getRotationX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRotationY\", js_cocos2dx_Node_getRotationY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeToParentAffineTransform\", js_cocos2dx_Node_getNodeToParentAffineTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isCascadeOpacityEnabled\", js_cocos2dx_Node_isCascadeOpacityEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setParent\", js_cocos2dx_Node_setParent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeToParentTransform\", js_cocos2dx_Node_getNodeToParentTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resume\", js_cocos2dx_Node_resume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPhysicsBody\", js_cocos2dx_Node_getPhysicsBody, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopActionByTag\", js_cocos2dx_Node_stopActionByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reorderChild\", js_cocos2dx_Node_reorderChild, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"ignoreAnchorPointForPosition\", js_cocos2dx_Node_ignoreAnchorPointForPosition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setColor\", js_cocos2dx_Node_setColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPositionY\", js_cocos2dx_Node_setPositionY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPositionX\", js_cocos2dx_Node_setPositionX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setNodeToParentTransform\", js_cocos2dx_Node_setNodeToParentTransform, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchorPoint\", js_cocos2dx_Node_getAnchorPoint, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNumberOfRunningActions\", js_cocos2dx_Node_getNumberOfRunningActions, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateTransform\", js_cocos2dx_Node_updateTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isVisible\", js_cocos2dx_Node_isVisible, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getChildrenCount\", js_cocos2dx_Node_getChildrenCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertToNodeSpaceAR\", js_cocos2dx_Node_convertToNodeSpaceAR, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addComponent\", js_cocos2dx_Node_addComponent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"visit\", js_cocos2dx_Node_visit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setShaderProgram\", js_cocos2dx_Node_setShaderProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRotation\", js_cocos2dx_Node_getRotation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getZOrder\", js_cocos2dx_Node_getLocalZOrder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchorPointInPoints\", js_cocos2dx_Node_getAnchorPointInPoints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"runAction\", js_cocos2dx_Node_runAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"transform\", js_cocos2dx_Node_transform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVertexZ\", js_cocos2dx_Node_setVertexZ, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScheduler\", js_cocos2dx_Node_setScheduler, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopAllActions\", js_cocos2dx_Node_stopAllActions, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSkewX\", js_cocos2dx_Node_getSkewX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSkewY\", js_cocos2dx_Node_getSkewY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisplayedColor\", js_cocos2dx_Node_getDisplayedColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getActionByTag\", js_cocos2dx_Node_getActionByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotationX\", js_cocos2dx_Node_setRotationX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotationY\", js_cocos2dx_Node_setRotationY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAdditionalTransform\", js_cocos2dx_Node_setAdditionalTransform, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisplayedOpacity\", js_cocos2dx_Node_getDisplayedOpacity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScheduler\", js_cocos2dx_Node_getScheduler, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParentToNodeAffineTransform\", js_cocos2dx_Node_getParentToNodeAffineTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOrderOfArrival\", js_cocos2dx_Node_getOrderOfArrival, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setActionManager\", js_cocos2dx_Node_setActionManager, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPosition\", js_cocos2dx_Node_getPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isRunning\", js_cocos2dx_Node_isRunning, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParent\", js_cocos2dx_Node_getParent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPositionY\", js_cocos2dx_Node_getPositionY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPositionX\", js_cocos2dx_Node_getPositionX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeChildByTag\", js_cocos2dx_Node_removeChildByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateDisplayedColor\", js_cocos2dx_Node_updateDisplayedColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVisible\", js_cocos2dx_Node_setVisible, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParentToNodeTransform\", js_cocos2dx_Node_getParentToNodeTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVertexZ\", js_cocos2dx_Node_getVertexZ, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGlobalZOrder\", js_cocos2dx_Node_setGlobalZOrder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScale\", js_cocos2dx_Node_setScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getChildByTag\", js_cocos2dx_Node_getChildByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOrderOfArrival\", js_cocos2dx_Node_setOrderOfArrival, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScaleY\", js_cocos2dx_Node_getScaleY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScaleX\", js_cocos2dx_Node_getScaleX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getWorldToNodeAffineTransform\", js_cocos2dx_Node_getWorldToNodeAffineTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCascadeColorEnabled\", js_cocos2dx_Node_setCascadeColorEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOpacity\", js_cocos2dx_Node_setOpacity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"cleanup\", js_cocos2dx_Node_cleanup, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getComponent\", js_cocos2dx_Node_getComponent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContentSize\", js_cocos2dx_Node_getContentSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBoundingBox\", js_cocos2dx_Node_getBoundingBox, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updatePhysicsTransform\", js_cocos2dx_Node_updatePhysicsTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEventDispatcher\", js_cocos2dx_Node_setEventDispatcher, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGlobalZOrder\", js_cocos2dx_Node_getGlobalZOrder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"draw\", js_cocos2dx_Node_draw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"transformAncestors\", js_cocos2dx_Node_transformAncestors, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUserObject\", js_cocos2dx_Node_setUserObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeFromParent\", js_cocos2dx_Node_removeFromParentAndCleanup, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertTouchToNodeSpaceAR\", js_cocos2dx_Node_convertTouchToNodeSpaceAR, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_Node_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"sortAllChildren\", js_cocos2dx_Node_sortAllChildren, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getWorldToNodeTransform\", js_cocos2dx_Node_getWorldToNodeTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScale\", js_cocos2dx_Node_getScale, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertToNodeSpace\", js_cocos2dx_Node_convertToNodeSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTag\", js_cocos2dx_Node_setTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isCascadeColorEnabled\", js_cocos2dx_Node_isCascadeColorEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isOpacityModifyRGB\", js_cocos2dx_Node_isOpacityModifyRGB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopAction\", js_cocos2dx_Node_stopAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getActionManager\", js_cocos2dx_Node_getActionManager, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_Node_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Node_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Node_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Node_class,\n\t\tdummy_constructor<cocos2d::Node>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Node\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Node> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Node_class;\n\t\tp->proto = jsb_cocos2d_Node_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d___NodeRGBA_class;\nJSObject *jsb_cocos2d___NodeRGBA_prototype;\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d___NodeRGBA_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (__NodeRGBA)\", obj);\n}\n\nvoid js_register_cocos2dx___NodeRGBA(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d___NodeRGBA_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d___NodeRGBA_class->name = \"NodeRGBA\";\n\tjsb_cocos2d___NodeRGBA_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d___NodeRGBA_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d___NodeRGBA_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d___NodeRGBA_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d___NodeRGBA_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d___NodeRGBA_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d___NodeRGBA_class->convert = JS_ConvertStub;\n\tjsb_cocos2d___NodeRGBA_class->finalize = js_cocos2d___NodeRGBA_finalize;\n\tjsb_cocos2d___NodeRGBA_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d___NodeRGBA_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d___NodeRGBA_class,\n\t\tdummy_constructor<cocos2d::__NodeRGBA>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"NodeRGBA\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::__NodeRGBA> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d___NodeRGBA_class;\n\t\tp->proto = jsb_cocos2d___NodeRGBA_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SpriteFrame_class;\nJSObject *jsb_cocos2d_SpriteFrame_prototype;\n\nJSBool js_cocos2dx_SpriteFrame_clone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_clone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::SpriteFrame* ret = cobj->clone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_clone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setRotated(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setRotated : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setRotated : Error processing arguments\");\n\t\tcobj->setRotated(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setRotated : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setTexture : Error processing arguments\");\n\t\tcobj->setTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::SpriteFrame* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_initWithTexture : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg3;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg4;\n\t\t\tok &= jsval_to_ccsize(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithTexture(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithTexture(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_initWithTexture : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setRectInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setRectInPixels : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setRectInPixels : Error processing arguments\");\n\t\tcobj->setRectInPixels(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setRectInPixels : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_getTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_getTexture : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* ret = cobj->getTexture();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_getTexture : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_getRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_getRect : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Rect& ret = cobj->getRect();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_getRect : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOffsetInPixels : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOffsetInPixels : Error processing arguments\");\n\t\tcobj->setOffsetInPixels(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setOffsetInPixels : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_getRectInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_getRectInPixels : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Rect& ret = cobj->getRectInPixels();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_getRectInPixels : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setOriginalSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOriginalSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOriginalSize : Error processing arguments\");\n\t\tcobj->setOriginalSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setOriginalSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_getOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_getOriginalSizeInPixels : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getOriginalSizeInPixels();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_getOriginalSizeInPixels : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : Error processing arguments\");\n\t\tcobj->setOriginalSizeInPixels(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setOriginalSizeInPixels : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOffset : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setOffset : Error processing arguments\");\n\t\tcobj->setOffset(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setOffset : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_getOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_getOffset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getOffset();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_getOffset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_isRotated(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_isRotated : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isRotated();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_isRotated : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_initWithTextureFilename(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::SpriteFrame* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_initWithTextureFilename : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg3;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg4;\n\t\t\tok &= jsval_to_ccsize(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithTextureFilename(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithTextureFilename(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_initWithTextureFilename : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_setRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setRect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_setRect : Error processing arguments\");\n\t\tcobj->setRect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_setRect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_getOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_getOffsetInPixels : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getOffsetInPixels();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_getOffsetInPixels : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_getOriginalSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrame* cobj = (cocos2d::SpriteFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrame_getOriginalSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getOriginalSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_getOriginalSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg3;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg4;\n\t\t\tok &= jsval_to_ccsize(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::create(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrame_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg3;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg4;\n\t\t\tok &= jsval_to_ccsize(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::createWithTexture(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::createWithTexture(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrame_createWithTexture : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_SpriteFrame_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SpriteFrame)\", obj);\n}\n\nvoid js_register_cocos2dx_SpriteFrame(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SpriteFrame_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SpriteFrame_class->name = \"SpriteFrame\";\n\tjsb_cocos2d_SpriteFrame_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SpriteFrame_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SpriteFrame_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SpriteFrame_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SpriteFrame_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SpriteFrame_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SpriteFrame_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SpriteFrame_class->finalize = js_cocos2d_SpriteFrame_finalize;\n\tjsb_cocos2d_SpriteFrame_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"clone\", js_cocos2dx_SpriteFrame_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotated\", js_cocos2dx_SpriteFrame_setRotated, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTexture\", js_cocos2dx_SpriteFrame_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTexture\", js_cocos2dx_SpriteFrame_initWithTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRectInPixels\", js_cocos2dx_SpriteFrame_setRectInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTexture\", js_cocos2dx_SpriteFrame_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRect\", js_cocos2dx_SpriteFrame_getRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOffsetInPixels\", js_cocos2dx_SpriteFrame_setOffsetInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRectInPixels\", js_cocos2dx_SpriteFrame_getRectInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOriginalSize\", js_cocos2dx_SpriteFrame_setOriginalSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOriginalSizeInPixels\", js_cocos2dx_SpriteFrame_getOriginalSizeInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOriginalSizeInPixels\", js_cocos2dx_SpriteFrame_setOriginalSizeInPixels, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOffset\", js_cocos2dx_SpriteFrame_setOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOffset\", js_cocos2dx_SpriteFrame_getOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isRotated\", js_cocos2dx_SpriteFrame_isRotated, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTextureFilename\", js_cocos2dx_SpriteFrame_initWithTextureFilename, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRect\", js_cocos2dx_SpriteFrame_setRect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOffsetInPixels\", js_cocos2dx_SpriteFrame_getOffsetInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOriginalSize\", js_cocos2dx_SpriteFrame_getOriginalSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_SpriteFrame_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTexture\", js_cocos2dx_SpriteFrame_createWithTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_SpriteFrame_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_SpriteFrame_class,\n\t\tdummy_constructor<cocos2d::SpriteFrame>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SpriteFrame\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SpriteFrame> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SpriteFrame_class;\n\t\tp->proto = jsb_cocos2d_SpriteFrame_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_AnimationFrame_class;\nJSObject *jsb_cocos2d_AnimationFrame_prototype;\n\nJSBool js_cocos2dx_AnimationFrame_setSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationFrame* cobj = (cocos2d::AnimationFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_setSpriteFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_setSpriteFrame : Error processing arguments\");\n\t\tcobj->setSpriteFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_setSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationFrame_getUserInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::AnimationFrame* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::AnimationFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_getUserInfo : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ValueMap& ret = cobj->getUserInfo();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::ValueMap& ret = cobj->getUserInfo();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_getUserInfo : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationFrame_setDelayUnits(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationFrame* cobj = (cocos2d::AnimationFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_setDelayUnits : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_setDelayUnits : Error processing arguments\");\n\t\tcobj->setDelayUnits(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_setDelayUnits : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationFrame_clone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationFrame* cobj = (cocos2d::AnimationFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_clone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::AnimationFrame* ret = cobj->clone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::AnimationFrame>(cx, (cocos2d::AnimationFrame*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_clone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationFrame_getSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationFrame* cobj = (cocos2d::AnimationFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_getSpriteFrame : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::SpriteFrame* ret = cobj->getSpriteFrame();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_getSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationFrame_getDelayUnits(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationFrame* cobj = (cocos2d::AnimationFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_getDelayUnits : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getDelayUnits();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_getDelayUnits : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationFrame_setUserInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationFrame* cobj = (cocos2d::AnimationFrame *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_setUserInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMap arg0;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_setUserInfo : Error processing arguments\");\n\t\tcobj->setUserInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_setUserInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationFrame_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdouble arg1;\n\t\tcocos2d::ValueMap arg2;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccvaluemap(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationFrame_create : Error processing arguments\");\n\t\tcocos2d::AnimationFrame* ret = cocos2d::AnimationFrame::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::AnimationFrame>(cx, (cocos2d::AnimationFrame*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationFrame_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_AnimationFrame_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (AnimationFrame)\", obj);\n}\n\nvoid js_register_cocos2dx_AnimationFrame(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_AnimationFrame_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_AnimationFrame_class->name = \"AnimationFrame\";\n\tjsb_cocos2d_AnimationFrame_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_AnimationFrame_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_AnimationFrame_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_AnimationFrame_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_AnimationFrame_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_AnimationFrame_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_AnimationFrame_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_AnimationFrame_class->finalize = js_cocos2d_AnimationFrame_finalize;\n\tjsb_cocos2d_AnimationFrame_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setSpriteFrame\", js_cocos2dx_AnimationFrame_setSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getUserInfo\", js_cocos2dx_AnimationFrame_getUserInfo, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDelayUnits\", js_cocos2dx_AnimationFrame_setDelayUnits, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clone\", js_cocos2dx_AnimationFrame_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpriteFrame\", js_cocos2dx_AnimationFrame_getSpriteFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDelayUnits\", js_cocos2dx_AnimationFrame_getDelayUnits, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUserInfo\", js_cocos2dx_AnimationFrame_setUserInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_AnimationFrame_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_AnimationFrame_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_AnimationFrame_class,\n\t\tdummy_constructor<cocos2d::AnimationFrame>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"AnimationFrame\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::AnimationFrame> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_AnimationFrame_class;\n\t\tp->proto = jsb_cocos2d_AnimationFrame_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Animation_class;\nJSObject *jsb_cocos2d_Animation_prototype;\n\nJSBool js_cocos2dx_Animation_getLoops(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_getLoops : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned int ret = cobj->getLoops();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_getLoops : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_addSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_addSpriteFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animation_addSpriteFrame : Error processing arguments\");\n\t\tcobj->addSpriteFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_addSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_setRestoreOriginalFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_setRestoreOriginalFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animation_setRestoreOriginalFrame : Error processing arguments\");\n\t\tcobj->setRestoreOriginalFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_setRestoreOriginalFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_clone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_clone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Animation* ret = cobj->clone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Animation>(cx, (cocos2d::Animation*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_clone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_getDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_getDuration : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getDuration();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_getDuration : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_setFrames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_setFrames : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocos2d::AnimationFrame *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animation_setFrames : Error processing arguments\");\n\t\tcobj->setFrames(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_setFrames : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_getFrames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_getFrames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Vector<cocos2d::AnimationFrame *>& ret = cobj->getFrames();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_getFrames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_setLoops(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_setLoops : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animation_setLoops : Error processing arguments\");\n\t\tcobj->setLoops(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_setLoops : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_setDelayPerUnit(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_setDelayPerUnit : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animation_setDelayPerUnit : Error processing arguments\");\n\t\tcobj->setDelayPerUnit(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_setDelayPerUnit : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_addSpriteFrameWithFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_addSpriteFrameWithFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animation_addSpriteFrameWithFile : Error processing arguments\");\n\t\tcobj->addSpriteFrameWithFile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_addSpriteFrameWithFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_getTotalDelayUnits(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_getTotalDelayUnits : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getTotalDelayUnits();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_getTotalDelayUnits : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_getDelayPerUnit(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_getDelayPerUnit : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getDelayPerUnit();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_getDelayPerUnit : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_getRestoreOriginalFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_getRestoreOriginalFrame : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getRestoreOriginalFrame();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_getRestoreOriginalFrame : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animation_addSpriteFrameWithTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animation* cobj = (cocos2d::Animation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animation_addSpriteFrameWithTexture : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tcocos2d::Rect arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animation_addSpriteFrameWithTexture : Error processing arguments\");\n\t\tcobj->addSpriteFrameWithTexture(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animation_addSpriteFrameWithTexture : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_Animation_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Animation)\", obj);\n}\n\nvoid js_register_cocos2dx_Animation(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Animation_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Animation_class->name = \"Animation\";\n\tjsb_cocos2d_Animation_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Animation_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Animation_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Animation_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Animation_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Animation_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Animation_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Animation_class->finalize = js_cocos2d_Animation_finalize;\n\tjsb_cocos2d_Animation_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getLoops\", js_cocos2dx_Animation_getLoops, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSpriteFrame\", js_cocos2dx_Animation_addSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRestoreOriginalFrame\", js_cocos2dx_Animation_setRestoreOriginalFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clone\", js_cocos2dx_Animation_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDuration\", js_cocos2dx_Animation_getDuration, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFrames\", js_cocos2dx_Animation_setFrames, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFrames\", js_cocos2dx_Animation_getFrames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLoops\", js_cocos2dx_Animation_setLoops, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDelayPerUnit\", js_cocos2dx_Animation_setDelayPerUnit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSpriteFrameWithFile\", js_cocos2dx_Animation_addSpriteFrameWithFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTotalDelayUnits\", js_cocos2dx_Animation_getTotalDelayUnits, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDelayPerUnit\", js_cocos2dx_Animation_getDelayPerUnit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRestoreOriginalFrame\", js_cocos2dx_Animation_getRestoreOriginalFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSpriteFrameWithTexture\", js_cocos2dx_Animation_addSpriteFrameWithTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Animation_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Animation_class,\n\t\tdummy_constructor<cocos2d::Animation>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Animation\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Animation> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Animation_class;\n\t\tp->proto = jsb_cocos2d_Animation_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ActionInterval_class;\nJSObject *jsb_cocos2d_ActionInterval_prototype;\n\nJSBool js_cocos2dx_ActionInterval_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionInterval* cobj = (cocos2d::ActionInterval *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionInterval_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionInterval_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionInterval_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionInterval* cobj = (cocos2d::ActionInterval *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionInterval_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionInterval_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionInterval_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionInterval_getElapsed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionInterval* cobj = (cocos2d::ActionInterval *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionInterval_getElapsed : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getElapsed();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionInterval_getElapsed : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_FiniteTimeAction_prototype;\n\nvoid js_cocos2d_ActionInterval_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionInterval)\", obj);\n}\n\nvoid js_register_cocos2dx_ActionInterval(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ActionInterval_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ActionInterval_class->name = \"ActionInterval\";\n\tjsb_cocos2d_ActionInterval_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionInterval_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ActionInterval_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionInterval_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ActionInterval_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ActionInterval_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ActionInterval_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ActionInterval_class->finalize = js_cocos2d_ActionInterval_finalize;\n\tjsb_cocos2d_ActionInterval_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_ActionInterval_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_ActionInterval_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getElapsed\", js_cocos2dx_ActionInterval_getElapsed, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_ActionInterval_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_FiniteTimeAction_prototype,\n\t\tjsb_cocos2d_ActionInterval_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionInterval\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ActionInterval> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ActionInterval_class;\n\t\tp->proto = jsb_cocos2d_ActionInterval_prototype;\n\t\tp->parentProto = jsb_cocos2d_FiniteTimeAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Sequence_class;\nJSObject *jsb_cocos2d_Sequence_prototype;\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_Sequence_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Sequence)\", obj);\n}\n\nvoid js_register_cocos2dx_Sequence(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Sequence_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Sequence_class->name = \"Sequence\";\n\tjsb_cocos2d_Sequence_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Sequence_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Sequence_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Sequence_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Sequence_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Sequence_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Sequence_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Sequence_class->finalize = js_cocos2d_Sequence_finalize;\n\tjsb_cocos2d_Sequence_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Sequence_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_Sequence_class,\n\t\tdummy_constructor<cocos2d::Sequence>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Sequence\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Sequence> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Sequence_class;\n\t\tp->proto = jsb_cocos2d_Sequence_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Repeat_class;\nJSObject *jsb_cocos2d_Repeat_prototype;\n\nJSBool js_cocos2dx_Repeat_setInnerAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Repeat* cobj = (cocos2d::Repeat *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Repeat_setInnerAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::FiniteTimeAction* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::FiniteTimeAction*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Repeat_setInnerAction : Error processing arguments\");\n\t\tcobj->setInnerAction(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Repeat_setInnerAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Repeat_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Repeat* cobj = (cocos2d::Repeat *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Repeat_getInnerAction : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::FiniteTimeAction* ret = cobj->getInnerAction();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FiniteTimeAction>(cx, (cocos2d::FiniteTimeAction*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Repeat_getInnerAction : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Repeat_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::FiniteTimeAction* arg0;\n\t\tunsigned int arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::FiniteTimeAction*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_uint32(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Repeat_create : Error processing arguments\");\n\t\tcocos2d::Repeat* ret = cocos2d::Repeat::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Repeat>(cx, (cocos2d::Repeat*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Repeat_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_Repeat_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Repeat)\", obj);\n}\n\nvoid js_register_cocos2dx_Repeat(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Repeat_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Repeat_class->name = \"Repeat\";\n\tjsb_cocos2d_Repeat_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Repeat_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Repeat_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Repeat_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Repeat_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Repeat_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Repeat_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Repeat_class->finalize = js_cocos2d_Repeat_finalize;\n\tjsb_cocos2d_Repeat_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setInnerAction\", js_cocos2dx_Repeat_setInnerAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInnerAction\", js_cocos2dx_Repeat_getInnerAction, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Repeat_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Repeat_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_Repeat_class,\n\t\tdummy_constructor<cocos2d::Repeat>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Repeat\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Repeat> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Repeat_class;\n\t\tp->proto = jsb_cocos2d_Repeat_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_RepeatForever_class;\nJSObject *jsb_cocos2d_RepeatForever_prototype;\n\nJSBool js_cocos2dx_RepeatForever_setInnerAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RepeatForever* cobj = (cocos2d::RepeatForever *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RepeatForever_setInnerAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RepeatForever_setInnerAction : Error processing arguments\");\n\t\tcobj->setInnerAction(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RepeatForever_setInnerAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RepeatForever_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RepeatForever* cobj = (cocos2d::RepeatForever *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RepeatForever_getInnerAction : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->getInnerAction();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RepeatForever_getInnerAction : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RepeatForever_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RepeatForever_create : Error processing arguments\");\n\t\tcocos2d::RepeatForever* ret = cocos2d::RepeatForever::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RepeatForever>(cx, (cocos2d::RepeatForever*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_RepeatForever_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_RepeatForever_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (RepeatForever)\", obj);\n}\n\nvoid js_register_cocos2dx_RepeatForever(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_RepeatForever_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_RepeatForever_class->name = \"RepeatForever\";\n\tjsb_cocos2d_RepeatForever_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_RepeatForever_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_RepeatForever_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_RepeatForever_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_RepeatForever_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_RepeatForever_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_RepeatForever_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_RepeatForever_class->finalize = js_cocos2d_RepeatForever_finalize;\n\tjsb_cocos2d_RepeatForever_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setInnerAction\", js_cocos2dx_RepeatForever_setInnerAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInnerAction\", js_cocos2dx_RepeatForever_getInnerAction, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_RepeatForever_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_RepeatForever_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_RepeatForever_class,\n\t\tdummy_constructor<cocos2d::RepeatForever>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"RepeatForever\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::RepeatForever> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_RepeatForever_class;\n\t\tp->proto = jsb_cocos2d_RepeatForever_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Spawn_class;\nJSObject *jsb_cocos2d_Spawn_prototype;\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_Spawn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Spawn)\", obj);\n}\n\nvoid js_register_cocos2dx_Spawn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Spawn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Spawn_class->name = \"Spawn\";\n\tjsb_cocos2d_Spawn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Spawn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Spawn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Spawn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Spawn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Spawn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Spawn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Spawn_class->finalize = js_cocos2d_Spawn_finalize;\n\tjsb_cocos2d_Spawn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Spawn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_Spawn_class,\n\t\tdummy_constructor<cocos2d::Spawn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Spawn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Spawn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Spawn_class;\n\t\tp->proto = jsb_cocos2d_Spawn_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_RotateTo_class;\nJSObject *jsb_cocos2d_RotateTo_prototype;\n\nJSBool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RotateTo>(cx, (cocos2d::RotateTo*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RotateTo>(cx, (cocos2d::RotateTo*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_RotateTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_RotateTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (RotateTo)\", obj);\n}\n\nvoid js_register_cocos2dx_RotateTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_RotateTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_RotateTo_class->name = \"RotateTo\";\n\tjsb_cocos2d_RotateTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_RotateTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_RotateTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_RotateTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_RotateTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_RotateTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_RotateTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_RotateTo_class->finalize = js_cocos2d_RotateTo_finalize;\n\tjsb_cocos2d_RotateTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_RotateTo_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_RotateTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_RotateTo_class,\n\t\tdummy_constructor<cocos2d::RotateTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"RotateTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::RotateTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_RotateTo_class;\n\t\tp->proto = jsb_cocos2d_RotateTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_RotateBy_class;\nJSObject *jsb_cocos2d_RotateBy_prototype;\n\nJSBool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RotateBy>(cx, (cocos2d::RotateBy*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RotateBy>(cx, (cocos2d::RotateBy*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_RotateBy_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_RotateBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (RotateBy)\", obj);\n}\n\nvoid js_register_cocos2dx_RotateBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_RotateBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_RotateBy_class->name = \"RotateBy\";\n\tjsb_cocos2d_RotateBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_RotateBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_RotateBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_RotateBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_RotateBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_RotateBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_RotateBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_RotateBy_class->finalize = js_cocos2d_RotateBy_finalize;\n\tjsb_cocos2d_RotateBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_RotateBy_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_RotateBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_RotateBy_class,\n\t\tdummy_constructor<cocos2d::RotateBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"RotateBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::RotateBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_RotateBy_class;\n\t\tp->proto = jsb_cocos2d_RotateBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MoveBy_class;\nJSObject *jsb_cocos2d_MoveBy_prototype;\n\nJSBool js_cocos2dx_MoveBy_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Point arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MoveBy_create : Error processing arguments\");\n\t\tcocos2d::MoveBy* ret = cocos2d::MoveBy::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::MoveBy>(cx, (cocos2d::MoveBy*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_MoveBy_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_MoveBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MoveBy)\", obj);\n}\n\nvoid js_register_cocos2dx_MoveBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MoveBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MoveBy_class->name = \"MoveBy\";\n\tjsb_cocos2d_MoveBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MoveBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MoveBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MoveBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MoveBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MoveBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MoveBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MoveBy_class->finalize = js_cocos2d_MoveBy_finalize;\n\tjsb_cocos2d_MoveBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_MoveBy_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_MoveBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_MoveBy_class,\n\t\tdummy_constructor<cocos2d::MoveBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MoveBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MoveBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MoveBy_class;\n\t\tp->proto = jsb_cocos2d_MoveBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MoveTo_class;\nJSObject *jsb_cocos2d_MoveTo_prototype;\n\nJSBool js_cocos2dx_MoveTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Point arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MoveTo_create : Error processing arguments\");\n\t\tcocos2d::MoveTo* ret = cocos2d::MoveTo::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::MoveTo>(cx, (cocos2d::MoveTo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_MoveTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_MoveBy_prototype;\n\nvoid js_cocos2d_MoveTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MoveTo)\", obj);\n}\n\nvoid js_register_cocos2dx_MoveTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MoveTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MoveTo_class->name = \"MoveTo\";\n\tjsb_cocos2d_MoveTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MoveTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MoveTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MoveTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MoveTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MoveTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MoveTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MoveTo_class->finalize = js_cocos2d_MoveTo_finalize;\n\tjsb_cocos2d_MoveTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_MoveTo_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_MoveTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_MoveBy_prototype,\n\t\tjsb_cocos2d_MoveTo_class,\n\t\tdummy_constructor<cocos2d::MoveTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MoveTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MoveTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MoveTo_class;\n\t\tp->proto = jsb_cocos2d_MoveTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_MoveBy_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SkewTo_class;\nJSObject *jsb_cocos2d_SkewTo_prototype;\n\nJSBool js_cocos2dx_SkewTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SkewTo_create : Error processing arguments\");\n\t\tcocos2d::SkewTo* ret = cocos2d::SkewTo::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SkewTo>(cx, (cocos2d::SkewTo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SkewTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_SkewTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SkewTo)\", obj);\n}\n\nvoid js_register_cocos2dx_SkewTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SkewTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SkewTo_class->name = \"SkewTo\";\n\tjsb_cocos2d_SkewTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SkewTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SkewTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SkewTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SkewTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SkewTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SkewTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SkewTo_class->finalize = js_cocos2d_SkewTo_finalize;\n\tjsb_cocos2d_SkewTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_SkewTo_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_SkewTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_SkewTo_class,\n\t\tdummy_constructor<cocos2d::SkewTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SkewTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SkewTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SkewTo_class;\n\t\tp->proto = jsb_cocos2d_SkewTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SkewBy_class;\nJSObject *jsb_cocos2d_SkewBy_prototype;\n\nJSBool js_cocos2dx_SkewBy_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SkewBy_create : Error processing arguments\");\n\t\tcocos2d::SkewBy* ret = cocos2d::SkewBy::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SkewBy>(cx, (cocos2d::SkewBy*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SkewBy_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_SkewTo_prototype;\n\nvoid js_cocos2d_SkewBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SkewBy)\", obj);\n}\n\nvoid js_register_cocos2dx_SkewBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SkewBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SkewBy_class->name = \"SkewBy\";\n\tjsb_cocos2d_SkewBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SkewBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SkewBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SkewBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SkewBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SkewBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SkewBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SkewBy_class->finalize = js_cocos2d_SkewBy_finalize;\n\tjsb_cocos2d_SkewBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_SkewBy_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_SkewBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_SkewTo_prototype,\n\t\tjsb_cocos2d_SkewBy_class,\n\t\tdummy_constructor<cocos2d::SkewBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SkewBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SkewBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SkewBy_class;\n\t\tp->proto = jsb_cocos2d_SkewBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_SkewTo_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_JumpBy_class;\nJSObject *jsb_cocos2d_JumpBy_prototype;\n\nJSBool js_cocos2dx_JumpBy_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Point arg1;\n\t\tdouble arg2;\n\t\tint arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_JumpBy_create : Error processing arguments\");\n\t\tcocos2d::JumpBy* ret = cocos2d::JumpBy::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::JumpBy>(cx, (cocos2d::JumpBy*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_JumpBy_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_JumpBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (JumpBy)\", obj);\n}\n\nvoid js_register_cocos2dx_JumpBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_JumpBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_JumpBy_class->name = \"JumpBy\";\n\tjsb_cocos2d_JumpBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_JumpBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_JumpBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_JumpBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_JumpBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_JumpBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_JumpBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_JumpBy_class->finalize = js_cocos2d_JumpBy_finalize;\n\tjsb_cocos2d_JumpBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_JumpBy_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_JumpBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_JumpBy_class,\n\t\tdummy_constructor<cocos2d::JumpBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"JumpBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::JumpBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_JumpBy_class;\n\t\tp->proto = jsb_cocos2d_JumpBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_JumpTo_class;\nJSObject *jsb_cocos2d_JumpTo_prototype;\n\nJSBool js_cocos2dx_JumpTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Point arg1;\n\t\tdouble arg2;\n\t\tint arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_JumpTo_create : Error processing arguments\");\n\t\tcocos2d::JumpTo* ret = cocos2d::JumpTo::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::JumpTo>(cx, (cocos2d::JumpTo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_JumpTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_JumpBy_prototype;\n\nvoid js_cocos2d_JumpTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (JumpTo)\", obj);\n}\n\nvoid js_register_cocos2dx_JumpTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_JumpTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_JumpTo_class->name = \"JumpTo\";\n\tjsb_cocos2d_JumpTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_JumpTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_JumpTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_JumpTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_JumpTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_JumpTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_JumpTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_JumpTo_class->finalize = js_cocos2d_JumpTo_finalize;\n\tjsb_cocos2d_JumpTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_JumpTo_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_JumpTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_JumpBy_prototype,\n\t\tjsb_cocos2d_JumpTo_class,\n\t\tdummy_constructor<cocos2d::JumpTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"JumpTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::JumpTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_JumpTo_class;\n\t\tp->proto = jsb_cocos2d_JumpTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_JumpBy_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_BezierBy_class;\nJSObject *jsb_cocos2d_BezierBy_prototype;\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_BezierBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (BezierBy)\", obj);\n}\n\nvoid js_register_cocos2dx_BezierBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_BezierBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_BezierBy_class->name = \"BezierBy\";\n\tjsb_cocos2d_BezierBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_BezierBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_BezierBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_BezierBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_BezierBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_BezierBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_BezierBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_BezierBy_class->finalize = js_cocos2d_BezierBy_finalize;\n\tjsb_cocos2d_BezierBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_BezierBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_BezierBy_class,\n\t\tdummy_constructor<cocos2d::BezierBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"BezierBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::BezierBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_BezierBy_class;\n\t\tp->proto = jsb_cocos2d_BezierBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_BezierTo_class;\nJSObject *jsb_cocos2d_BezierTo_prototype;\n\n\nextern JSObject *jsb_cocos2d_BezierBy_prototype;\n\nvoid js_cocos2d_BezierTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (BezierTo)\", obj);\n}\n\nvoid js_register_cocos2dx_BezierTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_BezierTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_BezierTo_class->name = \"BezierTo\";\n\tjsb_cocos2d_BezierTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_BezierTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_BezierTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_BezierTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_BezierTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_BezierTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_BezierTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_BezierTo_class->finalize = js_cocos2d_BezierTo_finalize;\n\tjsb_cocos2d_BezierTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_BezierTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_BezierBy_prototype,\n\t\tjsb_cocos2d_BezierTo_class,\n\t\tdummy_constructor<cocos2d::BezierTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"BezierTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::BezierTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_BezierTo_class;\n\t\tp->proto = jsb_cocos2d_BezierTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_BezierBy_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ScaleTo_class;\nJSObject *jsb_cocos2d_ScaleTo_prototype;\n\nJSBool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ScaleTo>(cx, (cocos2d::ScaleTo*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ScaleTo>(cx, (cocos2d::ScaleTo*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_ScaleTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_ScaleTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ScaleTo)\", obj);\n}\n\nvoid js_register_cocos2dx_ScaleTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ScaleTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ScaleTo_class->name = \"ScaleTo\";\n\tjsb_cocos2d_ScaleTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ScaleTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ScaleTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ScaleTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ScaleTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ScaleTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ScaleTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ScaleTo_class->finalize = js_cocos2d_ScaleTo_finalize;\n\tjsb_cocos2d_ScaleTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ScaleTo_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ScaleTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_ScaleTo_class,\n\t\tdummy_constructor<cocos2d::ScaleTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ScaleTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ScaleTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ScaleTo_class;\n\t\tp->proto = jsb_cocos2d_ScaleTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ScaleBy_class;\nJSObject *jsb_cocos2d_ScaleBy_prototype;\n\nJSBool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ScaleBy>(cx, (cocos2d::ScaleBy*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ScaleBy>(cx, (cocos2d::ScaleBy*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_ScaleBy_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ScaleTo_prototype;\n\nvoid js_cocos2d_ScaleBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ScaleBy)\", obj);\n}\n\nvoid js_register_cocos2dx_ScaleBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ScaleBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ScaleBy_class->name = \"ScaleBy\";\n\tjsb_cocos2d_ScaleBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ScaleBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ScaleBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ScaleBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ScaleBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ScaleBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ScaleBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ScaleBy_class->finalize = js_cocos2d_ScaleBy_finalize;\n\tjsb_cocos2d_ScaleBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ScaleBy_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ScaleBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ScaleTo_prototype,\n\t\tjsb_cocos2d_ScaleBy_class,\n\t\tdummy_constructor<cocos2d::ScaleBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ScaleBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ScaleBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ScaleBy_class;\n\t\tp->proto = jsb_cocos2d_ScaleBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_ScaleTo_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Blink_class;\nJSObject *jsb_cocos2d_Blink_prototype;\n\nJSBool js_cocos2dx_Blink_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tint arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Blink_create : Error processing arguments\");\n\t\tcocos2d::Blink* ret = cocos2d::Blink::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Blink>(cx, (cocos2d::Blink*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Blink_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_Blink_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Blink)\", obj);\n}\n\nvoid js_register_cocos2dx_Blink(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Blink_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Blink_class->name = \"Blink\";\n\tjsb_cocos2d_Blink_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Blink_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Blink_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Blink_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Blink_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Blink_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Blink_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Blink_class->finalize = js_cocos2d_Blink_finalize;\n\tjsb_cocos2d_Blink_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Blink_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Blink_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_Blink_class,\n\t\tdummy_constructor<cocos2d::Blink>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Blink\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Blink> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Blink_class;\n\t\tp->proto = jsb_cocos2d_Blink_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FadeIn_class;\nJSObject *jsb_cocos2d_FadeIn_prototype;\n\nJSBool js_cocos2dx_FadeIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeIn_create : Error processing arguments\");\n\t\tcocos2d::FadeIn* ret = cocos2d::FadeIn::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FadeIn>(cx, (cocos2d::FadeIn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FadeIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_FadeIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FadeIn)\", obj);\n}\n\nvoid js_register_cocos2dx_FadeIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FadeIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FadeIn_class->name = \"FadeIn\";\n\tjsb_cocos2d_FadeIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FadeIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FadeIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FadeIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FadeIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FadeIn_class->finalize = js_cocos2d_FadeIn_finalize;\n\tjsb_cocos2d_FadeIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FadeIn_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FadeIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_FadeIn_class,\n\t\tdummy_constructor<cocos2d::FadeIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FadeIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FadeIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FadeIn_class;\n\t\tp->proto = jsb_cocos2d_FadeIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FadeOut_class;\nJSObject *jsb_cocos2d_FadeOut_prototype;\n\nJSBool js_cocos2dx_FadeOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOut_create : Error processing arguments\");\n\t\tcocos2d::FadeOut* ret = cocos2d::FadeOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FadeOut>(cx, (cocos2d::FadeOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_FadeOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FadeOut)\", obj);\n}\n\nvoid js_register_cocos2dx_FadeOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FadeOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FadeOut_class->name = \"FadeOut\";\n\tjsb_cocos2d_FadeOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FadeOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FadeOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FadeOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FadeOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FadeOut_class->finalize = js_cocos2d_FadeOut_finalize;\n\tjsb_cocos2d_FadeOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FadeOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FadeOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_FadeOut_class,\n\t\tdummy_constructor<cocos2d::FadeOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FadeOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FadeOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FadeOut_class;\n\t\tp->proto = jsb_cocos2d_FadeOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FadeTo_class;\nJSObject *jsb_cocos2d_FadeTo_prototype;\n\nJSBool js_cocos2dx_FadeTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tuint16_t arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_uint16(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeTo_create : Error processing arguments\");\n\t\tcocos2d::FadeTo* ret = cocos2d::FadeTo::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FadeTo>(cx, (cocos2d::FadeTo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FadeTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_FadeTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FadeTo)\", obj);\n}\n\nvoid js_register_cocos2dx_FadeTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FadeTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FadeTo_class->name = \"FadeTo\";\n\tjsb_cocos2d_FadeTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FadeTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FadeTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FadeTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FadeTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FadeTo_class->finalize = js_cocos2d_FadeTo_finalize;\n\tjsb_cocos2d_FadeTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FadeTo_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FadeTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_FadeTo_class,\n\t\tdummy_constructor<cocos2d::FadeTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FadeTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FadeTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FadeTo_class;\n\t\tp->proto = jsb_cocos2d_FadeTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TintTo_class;\nJSObject *jsb_cocos2d_TintTo_prototype;\n\nJSBool js_cocos2dx_TintTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tuint16_t arg1;\n\t\tuint16_t arg2;\n\t\tuint16_t arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_uint16(cx, argv[1], &arg1);\n\t\tok &= jsval_to_uint16(cx, argv[2], &arg2);\n\t\tok &= jsval_to_uint16(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TintTo_create : Error processing arguments\");\n\t\tcocos2d::TintTo* ret = cocos2d::TintTo::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TintTo>(cx, (cocos2d::TintTo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TintTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_TintTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TintTo)\", obj);\n}\n\nvoid js_register_cocos2dx_TintTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TintTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TintTo_class->name = \"TintTo\";\n\tjsb_cocos2d_TintTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TintTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TintTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TintTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TintTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TintTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TintTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TintTo_class->finalize = js_cocos2d_TintTo_finalize;\n\tjsb_cocos2d_TintTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TintTo_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TintTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_TintTo_class,\n\t\tdummy_constructor<cocos2d::TintTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TintTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TintTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TintTo_class;\n\t\tp->proto = jsb_cocos2d_TintTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TintBy_class;\nJSObject *jsb_cocos2d_TintBy_prototype;\n\nJSBool js_cocos2dx_TintBy_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tint32_t arg1;\n\t\tint32_t arg2;\n\t\tint32_t arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], &arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TintBy_create : Error processing arguments\");\n\t\tcocos2d::TintBy* ret = cocos2d::TintBy::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TintBy>(cx, (cocos2d::TintBy*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TintBy_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_TintBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TintBy)\", obj);\n}\n\nvoid js_register_cocos2dx_TintBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TintBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TintBy_class->name = \"TintBy\";\n\tjsb_cocos2d_TintBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TintBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TintBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TintBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TintBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TintBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TintBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TintBy_class->finalize = js_cocos2d_TintBy_finalize;\n\tjsb_cocos2d_TintBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TintBy_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TintBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_TintBy_class,\n\t\tdummy_constructor<cocos2d::TintBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TintBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TintBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TintBy_class;\n\t\tp->proto = jsb_cocos2d_TintBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_DelayTime_class;\nJSObject *jsb_cocos2d_DelayTime_prototype;\n\nJSBool js_cocos2dx_DelayTime_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_DelayTime_create : Error processing arguments\");\n\t\tcocos2d::DelayTime* ret = cocos2d::DelayTime::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::DelayTime>(cx, (cocos2d::DelayTime*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_DelayTime_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_DelayTime_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (DelayTime)\", obj);\n}\n\nvoid js_register_cocos2dx_DelayTime(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_DelayTime_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_DelayTime_class->name = \"DelayTime\";\n\tjsb_cocos2d_DelayTime_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_DelayTime_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_DelayTime_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_DelayTime_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_DelayTime_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_DelayTime_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_DelayTime_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_DelayTime_class->finalize = js_cocos2d_DelayTime_finalize;\n\tjsb_cocos2d_DelayTime_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_DelayTime_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_DelayTime_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_DelayTime_class,\n\t\tdummy_constructor<cocos2d::DelayTime>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"DelayTime\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::DelayTime> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_DelayTime_class;\n\t\tp->proto = jsb_cocos2d_DelayTime_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Animate_class;\nJSObject *jsb_cocos2d_Animate_prototype;\n\nJSBool js_cocos2dx_Animate_getAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Animate* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Animate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animate_getAnimation : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Animation* ret = cobj->getAnimation();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Animation>(cx, (cocos2d::Animation*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Animation* ret = cobj->getAnimation();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Animation>(cx, (cocos2d::Animation*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animate_getAnimation : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animate_setAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Animate* cobj = (cocos2d::Animate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Animate_setAnimation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Animation* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Animation*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animate_setAnimation : Error processing arguments\");\n\t\tcobj->setAnimation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Animate_setAnimation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Animate_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Animation* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Animation*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Animate_create : Error processing arguments\");\n\t\tcocos2d::Animate* ret = cocos2d::Animate::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Animate>(cx, (cocos2d::Animate*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Animate_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_Animate_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Animate)\", obj);\n}\n\nvoid js_register_cocos2dx_Animate(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Animate_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Animate_class->name = \"Animate\";\n\tjsb_cocos2d_Animate_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Animate_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Animate_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Animate_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Animate_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Animate_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Animate_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Animate_class->finalize = js_cocos2d_Animate_finalize;\n\tjsb_cocos2d_Animate_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnimation\", js_cocos2dx_Animate_getAnimation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimation\", js_cocos2dx_Animate_setAnimation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Animate_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Animate_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_Animate_class,\n\t\tdummy_constructor<cocos2d::Animate>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Animate\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Animate> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Animate_class;\n\t\tp->proto = jsb_cocos2d_Animate_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TargetedAction_class;\nJSObject *jsb_cocos2d_TargetedAction_prototype;\n\nJSBool js_cocos2dx_TargetedAction_getForcedTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TargetedAction* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TargetedAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TargetedAction_getForcedTarget : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Node* ret = cobj->getForcedTarget();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Node* ret = cobj->getForcedTarget();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TargetedAction_getForcedTarget : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TargetedAction_setForcedTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TargetedAction* cobj = (cocos2d::TargetedAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TargetedAction_setForcedTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TargetedAction_setForcedTarget : Error processing arguments\");\n\t\tcobj->setForcedTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TargetedAction_setForcedTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TargetedAction_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::FiniteTimeAction* arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::FiniteTimeAction*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TargetedAction_create : Error processing arguments\");\n\t\tcocos2d::TargetedAction* ret = cocos2d::TargetedAction::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TargetedAction>(cx, (cocos2d::TargetedAction*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TargetedAction_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_TargetedAction_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TargetedAction)\", obj);\n}\n\nvoid js_register_cocos2dx_TargetedAction(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TargetedAction_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TargetedAction_class->name = \"TargetedAction\";\n\tjsb_cocos2d_TargetedAction_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TargetedAction_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TargetedAction_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TargetedAction_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TargetedAction_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TargetedAction_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TargetedAction_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TargetedAction_class->finalize = js_cocos2d_TargetedAction_finalize;\n\tjsb_cocos2d_TargetedAction_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getForcedTarget\", js_cocos2dx_TargetedAction_getForcedTarget, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setForcedTarget\", js_cocos2dx_TargetedAction_setForcedTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TargetedAction_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TargetedAction_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_TargetedAction_class,\n\t\tdummy_constructor<cocos2d::TargetedAction>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TargetedAction\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TargetedAction> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TargetedAction_class;\n\t\tp->proto = jsb_cocos2d_TargetedAction_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ActionCamera_class;\nJSObject *jsb_cocos2d_ActionCamera_prototype;\n\nJSBool js_cocos2dx_ActionCamera_setEye(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::ActionCamera* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::ActionCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_setEye : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setEye(arg0, arg1, arg2);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tkmVec3 arg0;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR kmVec3;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setEye(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionCamera_setEye : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionCamera_getEye(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionCamera* cobj = (cocos2d::ActionCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_getEye : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst kmVec3& ret = cobj->getEye();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmVec3;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionCamera_getEye : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionCamera_setUp(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionCamera* cobj = (cocos2d::ActionCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_setUp : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tkmVec3 arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR kmVec3;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_setUp : Error processing arguments\");\n\t\tcobj->setUp(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionCamera_setUp : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionCamera_getCenter(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionCamera* cobj = (cocos2d::ActionCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_getCenter : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst kmVec3& ret = cobj->getCenter();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmVec3;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionCamera_getCenter : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionCamera_setCenter(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionCamera* cobj = (cocos2d::ActionCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_setCenter : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tkmVec3 arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR kmVec3;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_setCenter : Error processing arguments\");\n\t\tcobj->setCenter(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionCamera_setCenter : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionCamera_getUp(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionCamera* cobj = (cocos2d::ActionCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionCamera_getUp : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst kmVec3& ret = cobj->getUp();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmVec3;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionCamera_getUp : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionCamera_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ActionCamera* cobj = new cocos2d::ActionCamera();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::ActionCamera> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::ActionCamera\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionCamera_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_ActionCamera_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionCamera)\", obj);\n}\n\nvoid js_register_cocos2dx_ActionCamera(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ActionCamera_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ActionCamera_class->name = \"ActionCamera\";\n\tjsb_cocos2d_ActionCamera_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionCamera_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ActionCamera_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionCamera_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ActionCamera_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ActionCamera_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ActionCamera_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ActionCamera_class->finalize = js_cocos2d_ActionCamera_finalize;\n\tjsb_cocos2d_ActionCamera_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEye\", js_cocos2dx_ActionCamera_setEye, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEye\", js_cocos2dx_ActionCamera_getEye, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUp\", js_cocos2dx_ActionCamera_setUp, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCenter\", js_cocos2dx_ActionCamera_getCenter, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCenter\", js_cocos2dx_ActionCamera_setCenter, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getUp\", js_cocos2dx_ActionCamera_getUp, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_ActionCamera_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_ActionCamera_class,\n\t\tjs_cocos2dx_ActionCamera_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionCamera\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ActionCamera> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ActionCamera_class;\n\t\tp->proto = jsb_cocos2d_ActionCamera_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_OrbitCamera_class;\nJSObject *jsb_cocos2d_OrbitCamera_prototype;\n\nJSBool js_cocos2dx_OrbitCamera_sphericalRadius(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::OrbitCamera* cobj = (cocos2d::OrbitCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_OrbitCamera_sphericalRadius : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tfloat* arg0;\n\t\tfloat* arg1;\n\t\tfloat* arg2;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR float*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_OrbitCamera_sphericalRadius : Error processing arguments\");\n\t\tcobj->sphericalRadius(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_OrbitCamera_sphericalRadius : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_OrbitCamera_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::OrbitCamera* cobj = (cocos2d::OrbitCamera *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_OrbitCamera_initWithDuration : Invalid Native Object\");\n\tif (argc == 7) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tdouble arg3;\n\t\tdouble arg4;\n\t\tdouble arg5;\n\t\tdouble arg6;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\tok &= JS_ValueToNumber(cx, argv[5], &arg5);\n\t\tok &= JS_ValueToNumber(cx, argv[6], &arg6);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_OrbitCamera_initWithDuration : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3, arg4, arg5, arg6);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_OrbitCamera_initWithDuration : wrong number of arguments: %d, was expecting %d\", argc, 7);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_OrbitCamera_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 7) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tdouble arg3;\n\t\tdouble arg4;\n\t\tdouble arg5;\n\t\tdouble arg6;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\tok &= JS_ValueToNumber(cx, argv[5], &arg5);\n\t\tok &= JS_ValueToNumber(cx, argv[6], &arg6);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_OrbitCamera_create : Error processing arguments\");\n\t\tcocos2d::OrbitCamera* ret = cocos2d::OrbitCamera::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::OrbitCamera>(cx, (cocos2d::OrbitCamera*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_OrbitCamera_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_OrbitCamera_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::OrbitCamera* cobj = new cocos2d::OrbitCamera();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::OrbitCamera> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::OrbitCamera\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_OrbitCamera_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionCamera_prototype;\n\nvoid js_cocos2d_OrbitCamera_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (OrbitCamera)\", obj);\n}\n\nvoid js_register_cocos2dx_OrbitCamera(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_OrbitCamera_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_OrbitCamera_class->name = \"OrbitCamera\";\n\tjsb_cocos2d_OrbitCamera_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_OrbitCamera_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_OrbitCamera_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_OrbitCamera_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_OrbitCamera_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_OrbitCamera_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_OrbitCamera_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_OrbitCamera_class->finalize = js_cocos2d_OrbitCamera_finalize;\n\tjsb_cocos2d_OrbitCamera_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"sphericalRadius\", js_cocos2dx_OrbitCamera_sphericalRadius, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithDuration\", js_cocos2dx_OrbitCamera_initWithDuration, 7, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_OrbitCamera_create, 7, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_OrbitCamera_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionCamera_prototype,\n\t\tjsb_cocos2d_OrbitCamera_class,\n\t\tjs_cocos2dx_OrbitCamera_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"OrbitCamera\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::OrbitCamera> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_OrbitCamera_class;\n\t\tp->proto = jsb_cocos2d_OrbitCamera_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionCamera_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ActionManager_class;\nJSObject *jsb_cocos2d_ActionManager_prototype;\n\nJSBool js_cocos2dx_ActionManager_getActionByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_getActionByTag : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tconst cocos2d::Node* arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (const cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_getActionByTag : Error processing arguments\");\n\t\tcocos2d::Action* ret = cobj->getActionByTag(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Action>(cx, (cocos2d::Action*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_getActionByTag : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_removeActionByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_removeActionByTag : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tcocos2d::Node* arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_removeActionByTag : Error processing arguments\");\n\t\tcobj->removeActionByTag(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_removeActionByTag : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_removeAllActions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_removeAllActions : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeAllActions();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_removeAllActions : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_addAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_addAction : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Action* arg0;\n\t\tcocos2d::Node* arg1;\n\t\tJSBool arg2;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Action*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_addAction : Error processing arguments\");\n\t\tcobj->addAction(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_addAction : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_resumeTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_resumeTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_resumeTarget : Error processing arguments\");\n\t\tcobj->resumeTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_resumeTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst cocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (const cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget : Error processing arguments\");\n\t\tssize_t ret = cobj->getNumberOfRunningActionsInTarget(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_removeAllActionsFromTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_removeAllActionsFromTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_removeAllActionsFromTarget : Error processing arguments\");\n\t\tcobj->removeAllActionsFromTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_removeAllActionsFromTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_resumeTargets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_resumeTargets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocos2d::Node *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_resumeTargets : Error processing arguments\");\n\t\tcobj->resumeTargets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_resumeTargets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_removeAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_removeAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Action* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Action*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_removeAction : Error processing arguments\");\n\t\tcobj->removeAction(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_removeAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_pauseTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_pauseTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionManager_pauseTarget : Error processing arguments\");\n\t\tcobj->pauseTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_pauseTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_pauseAllRunningActions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionManager* cobj = (cocos2d::ActionManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionManager_pauseAllRunningActions : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::Node *> ret = cobj->pauseAllRunningActions();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_pauseAllRunningActions : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionManager_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ActionManager* cobj = new cocos2d::ActionManager();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::ActionManager> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::ActionManager\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionManager_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_ActionManager_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionManager)\", obj);\n}\n\nvoid js_register_cocos2dx_ActionManager(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ActionManager_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ActionManager_class->name = \"ActionManager\";\n\tjsb_cocos2d_ActionManager_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionManager_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ActionManager_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionManager_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ActionManager_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ActionManager_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ActionManager_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ActionManager_class->finalize = js_cocos2d_ActionManager_finalize;\n\tjsb_cocos2d_ActionManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getActionByTag\", js_cocos2dx_ActionManager_getActionByTag, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeActionByTag\", js_cocos2dx_ActionManager_removeActionByTag, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllActions\", js_cocos2dx_ActionManager_removeAllActions, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addAction\", js_cocos2dx_ActionManager_addAction, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeTarget\", js_cocos2dx_ActionManager_resumeTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNumberOfRunningActionsInTarget\", js_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllActionsFromTarget\", js_cocos2dx_ActionManager_removeAllActionsFromTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeTargets\", js_cocos2dx_ActionManager_resumeTargets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAction\", js_cocos2dx_ActionManager_removeAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseTarget\", js_cocos2dx_ActionManager_pauseTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseAllRunningActions\", js_cocos2dx_ActionManager_pauseAllRunningActions, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_ActionManager_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_ActionManager_class,\n\t\tjs_cocos2dx_ActionManager_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionManager\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ActionManager> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ActionManager_class;\n\t\tp->proto = jsb_cocos2d_ActionManager_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ActionEase_class;\nJSObject *jsb_cocos2d_ActionEase_prototype;\n\nJSBool js_cocos2dx_ActionEase_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionEase* cobj = (cocos2d::ActionEase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionEase_getInnerAction : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->getInnerAction();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionEase_getInnerAction : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_ActionEase_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionEase)\", obj);\n}\n\nvoid js_register_cocos2dx_ActionEase(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ActionEase_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ActionEase_class->name = \"ActionEase\";\n\tjsb_cocos2d_ActionEase_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionEase_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ActionEase_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionEase_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ActionEase_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ActionEase_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ActionEase_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ActionEase_class->finalize = js_cocos2d_ActionEase_finalize;\n\tjsb_cocos2d_ActionEase_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getInnerAction\", js_cocos2dx_ActionEase_getInnerAction, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_ActionEase_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_ActionEase_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionEase\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ActionEase> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ActionEase_class;\n\t\tp->proto = jsb_cocos2d_ActionEase_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseRateAction_class;\nJSObject *jsb_cocos2d_EaseRateAction_prototype;\n\nJSBool js_cocos2dx_EaseRateAction_setRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EaseRateAction* cobj = (cocos2d::EaseRateAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EaseRateAction_setRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseRateAction_setRate : Error processing arguments\");\n\t\tcobj->setRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EaseRateAction_setRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_EaseRateAction_getRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EaseRateAction* cobj = (cocos2d::EaseRateAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EaseRateAction_getRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EaseRateAction_getRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseRateAction_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseRateAction)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseRateAction(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseRateAction_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseRateAction_class->name = \"EaseRateAction\";\n\tjsb_cocos2d_EaseRateAction_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseRateAction_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseRateAction_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseRateAction_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseRateAction_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseRateAction_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseRateAction_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseRateAction_class->finalize = js_cocos2d_EaseRateAction_finalize;\n\tjsb_cocos2d_EaseRateAction_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setRate\", js_cocos2dx_EaseRateAction_setRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRate\", js_cocos2dx_EaseRateAction_getRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_EaseRateAction_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseRateAction_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseRateAction\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseRateAction> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseRateAction_class;\n\t\tp->proto = jsb_cocos2d_EaseRateAction_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseIn_class;\nJSObject *jsb_cocos2d_EaseIn_prototype;\n\nJSBool js_cocos2dx_EaseIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdouble arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseIn_create : Error processing arguments\");\n\t\tcocos2d::EaseIn* ret = cocos2d::EaseIn::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseIn>(cx, (cocos2d::EaseIn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_EaseRateAction_prototype;\n\nvoid js_cocos2d_EaseIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseIn)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseIn_class->name = \"EaseIn\";\n\tjsb_cocos2d_EaseIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseIn_class->finalize = js_cocos2d_EaseIn_finalize;\n\tjsb_cocos2d_EaseIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseIn_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseRateAction_prototype,\n\t\tjsb_cocos2d_EaseIn_class,\n\t\tdummy_constructor<cocos2d::EaseIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseIn_class;\n\t\tp->proto = jsb_cocos2d_EaseIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseRateAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseOut_class;\nJSObject *jsb_cocos2d_EaseOut_prototype;\n\nJSBool js_cocos2dx_EaseOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdouble arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseOut_create : Error processing arguments\");\n\t\tcocos2d::EaseOut* ret = cocos2d::EaseOut::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseOut>(cx, (cocos2d::EaseOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_EaseRateAction_prototype;\n\nvoid js_cocos2d_EaseOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseOut_class->name = \"EaseOut\";\n\tjsb_cocos2d_EaseOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseOut_class->finalize = js_cocos2d_EaseOut_finalize;\n\tjsb_cocos2d_EaseOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseOut_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseRateAction_prototype,\n\t\tjsb_cocos2d_EaseOut_class,\n\t\tdummy_constructor<cocos2d::EaseOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseOut_class;\n\t\tp->proto = jsb_cocos2d_EaseOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseRateAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseInOut_class;\nJSObject *jsb_cocos2d_EaseInOut_prototype;\n\nJSBool js_cocos2dx_EaseInOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdouble arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseInOut_create : Error processing arguments\");\n\t\tcocos2d::EaseInOut* ret = cocos2d::EaseInOut::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseInOut>(cx, (cocos2d::EaseInOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseInOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_EaseRateAction_prototype;\n\nvoid js_cocos2d_EaseInOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseInOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseInOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseInOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseInOut_class->name = \"EaseInOut\";\n\tjsb_cocos2d_EaseInOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseInOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseInOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseInOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseInOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseInOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseInOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseInOut_class->finalize = js_cocos2d_EaseInOut_finalize;\n\tjsb_cocos2d_EaseInOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseInOut_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseInOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseRateAction_prototype,\n\t\tjsb_cocos2d_EaseInOut_class,\n\t\tdummy_constructor<cocos2d::EaseInOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseInOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseInOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseInOut_class;\n\t\tp->proto = jsb_cocos2d_EaseInOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseRateAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseExponentialIn_class;\nJSObject *jsb_cocos2d_EaseExponentialIn_prototype;\n\nJSBool js_cocos2dx_EaseExponentialIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseExponentialIn_create : Error processing arguments\");\n\t\tcocos2d::EaseExponentialIn* ret = cocos2d::EaseExponentialIn::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseExponentialIn>(cx, (cocos2d::EaseExponentialIn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseExponentialIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseExponentialIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseExponentialIn)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseExponentialIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseExponentialIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseExponentialIn_class->name = \"EaseExponentialIn\";\n\tjsb_cocos2d_EaseExponentialIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseExponentialIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseExponentialIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseExponentialIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseExponentialIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseExponentialIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseExponentialIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseExponentialIn_class->finalize = js_cocos2d_EaseExponentialIn_finalize;\n\tjsb_cocos2d_EaseExponentialIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseExponentialIn_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseExponentialIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseExponentialIn_class,\n\t\tdummy_constructor<cocos2d::EaseExponentialIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseExponentialIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseExponentialIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseExponentialIn_class;\n\t\tp->proto = jsb_cocos2d_EaseExponentialIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseExponentialOut_class;\nJSObject *jsb_cocos2d_EaseExponentialOut_prototype;\n\nJSBool js_cocos2dx_EaseExponentialOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseExponentialOut_create : Error processing arguments\");\n\t\tcocos2d::EaseExponentialOut* ret = cocos2d::EaseExponentialOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseExponentialOut>(cx, (cocos2d::EaseExponentialOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseExponentialOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseExponentialOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseExponentialOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseExponentialOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseExponentialOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseExponentialOut_class->name = \"EaseExponentialOut\";\n\tjsb_cocos2d_EaseExponentialOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseExponentialOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseExponentialOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseExponentialOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseExponentialOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseExponentialOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseExponentialOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseExponentialOut_class->finalize = js_cocos2d_EaseExponentialOut_finalize;\n\tjsb_cocos2d_EaseExponentialOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseExponentialOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseExponentialOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseExponentialOut_class,\n\t\tdummy_constructor<cocos2d::EaseExponentialOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseExponentialOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseExponentialOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseExponentialOut_class;\n\t\tp->proto = jsb_cocos2d_EaseExponentialOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseExponentialInOut_class;\nJSObject *jsb_cocos2d_EaseExponentialInOut_prototype;\n\nJSBool js_cocos2dx_EaseExponentialInOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseExponentialInOut_create : Error processing arguments\");\n\t\tcocos2d::EaseExponentialInOut* ret = cocos2d::EaseExponentialInOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseExponentialInOut>(cx, (cocos2d::EaseExponentialInOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseExponentialInOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseExponentialInOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseExponentialInOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseExponentialInOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseExponentialInOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseExponentialInOut_class->name = \"EaseExponentialInOut\";\n\tjsb_cocos2d_EaseExponentialInOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseExponentialInOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseExponentialInOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseExponentialInOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseExponentialInOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseExponentialInOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseExponentialInOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseExponentialInOut_class->finalize = js_cocos2d_EaseExponentialInOut_finalize;\n\tjsb_cocos2d_EaseExponentialInOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseExponentialInOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseExponentialInOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseExponentialInOut_class,\n\t\tdummy_constructor<cocos2d::EaseExponentialInOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseExponentialInOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseExponentialInOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseExponentialInOut_class;\n\t\tp->proto = jsb_cocos2d_EaseExponentialInOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseSineIn_class;\nJSObject *jsb_cocos2d_EaseSineIn_prototype;\n\nJSBool js_cocos2dx_EaseSineIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseSineIn_create : Error processing arguments\");\n\t\tcocos2d::EaseSineIn* ret = cocos2d::EaseSineIn::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseSineIn>(cx, (cocos2d::EaseSineIn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseSineIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseSineIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseSineIn)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseSineIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseSineIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseSineIn_class->name = \"EaseSineIn\";\n\tjsb_cocos2d_EaseSineIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseSineIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseSineIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseSineIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseSineIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseSineIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseSineIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseSineIn_class->finalize = js_cocos2d_EaseSineIn_finalize;\n\tjsb_cocos2d_EaseSineIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseSineIn_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseSineIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseSineIn_class,\n\t\tdummy_constructor<cocos2d::EaseSineIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseSineIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseSineIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseSineIn_class;\n\t\tp->proto = jsb_cocos2d_EaseSineIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseSineOut_class;\nJSObject *jsb_cocos2d_EaseSineOut_prototype;\n\nJSBool js_cocos2dx_EaseSineOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseSineOut_create : Error processing arguments\");\n\t\tcocos2d::EaseSineOut* ret = cocos2d::EaseSineOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseSineOut>(cx, (cocos2d::EaseSineOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseSineOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseSineOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseSineOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseSineOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseSineOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseSineOut_class->name = \"EaseSineOut\";\n\tjsb_cocos2d_EaseSineOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseSineOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseSineOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseSineOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseSineOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseSineOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseSineOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseSineOut_class->finalize = js_cocos2d_EaseSineOut_finalize;\n\tjsb_cocos2d_EaseSineOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseSineOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseSineOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseSineOut_class,\n\t\tdummy_constructor<cocos2d::EaseSineOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseSineOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseSineOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseSineOut_class;\n\t\tp->proto = jsb_cocos2d_EaseSineOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseSineInOut_class;\nJSObject *jsb_cocos2d_EaseSineInOut_prototype;\n\nJSBool js_cocos2dx_EaseSineInOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseSineInOut_create : Error processing arguments\");\n\t\tcocos2d::EaseSineInOut* ret = cocos2d::EaseSineInOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseSineInOut>(cx, (cocos2d::EaseSineInOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseSineInOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseSineInOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseSineInOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseSineInOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseSineInOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseSineInOut_class->name = \"EaseSineInOut\";\n\tjsb_cocos2d_EaseSineInOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseSineInOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseSineInOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseSineInOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseSineInOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseSineInOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseSineInOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseSineInOut_class->finalize = js_cocos2d_EaseSineInOut_finalize;\n\tjsb_cocos2d_EaseSineInOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseSineInOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseSineInOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseSineInOut_class,\n\t\tdummy_constructor<cocos2d::EaseSineInOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseSineInOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseSineInOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseSineInOut_class;\n\t\tp->proto = jsb_cocos2d_EaseSineInOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseElastic_class;\nJSObject *jsb_cocos2d_EaseElastic_prototype;\n\nJSBool js_cocos2dx_EaseElastic_setPeriod(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EaseElastic* cobj = (cocos2d::EaseElastic *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EaseElastic_setPeriod : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseElastic_setPeriod : Error processing arguments\");\n\t\tcobj->setPeriod(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EaseElastic_setPeriod : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_EaseElastic_getPeriod(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EaseElastic* cobj = (cocos2d::EaseElastic *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EaseElastic_getPeriod : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getPeriod();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EaseElastic_getPeriod : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseElastic_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseElastic)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseElastic(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseElastic_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseElastic_class->name = \"EaseElastic\";\n\tjsb_cocos2d_EaseElastic_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElastic_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseElastic_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElastic_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseElastic_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseElastic_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseElastic_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseElastic_class->finalize = js_cocos2d_EaseElastic_finalize;\n\tjsb_cocos2d_EaseElastic_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setPeriod\", js_cocos2dx_EaseElastic_setPeriod, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPeriod\", js_cocos2dx_EaseElastic_getPeriod, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_EaseElastic_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseElastic_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseElastic\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseElastic> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseElastic_class;\n\t\tp->proto = jsb_cocos2d_EaseElastic_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseElasticIn_class;\nJSObject *jsb_cocos2d_EaseElasticIn_prototype;\n\nJSBool js_cocos2dx_EaseElasticIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::ActionInterval* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseElasticIn>(cx, (cocos2d::EaseElasticIn*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::ActionInterval* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseElasticIn>(cx, (cocos2d::EaseElasticIn*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_EaseElasticIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_EaseElastic_prototype;\n\nvoid js_cocos2d_EaseElasticIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseElasticIn)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseElasticIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseElasticIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseElasticIn_class->name = \"EaseElasticIn\";\n\tjsb_cocos2d_EaseElasticIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElasticIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseElasticIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElasticIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseElasticIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseElasticIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseElasticIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseElasticIn_class->finalize = js_cocos2d_EaseElasticIn_finalize;\n\tjsb_cocos2d_EaseElasticIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseElasticIn_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseElasticIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseElastic_prototype,\n\t\tjsb_cocos2d_EaseElasticIn_class,\n\t\tdummy_constructor<cocos2d::EaseElasticIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseElasticIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseElasticIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseElasticIn_class;\n\t\tp->proto = jsb_cocos2d_EaseElasticIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseElastic_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseElasticOut_class;\nJSObject *jsb_cocos2d_EaseElasticOut_prototype;\n\nJSBool js_cocos2dx_EaseElasticOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::ActionInterval* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseElasticOut>(cx, (cocos2d::EaseElasticOut*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::ActionInterval* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseElasticOut>(cx, (cocos2d::EaseElasticOut*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_EaseElasticOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_EaseElastic_prototype;\n\nvoid js_cocos2d_EaseElasticOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseElasticOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseElasticOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseElasticOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseElasticOut_class->name = \"EaseElasticOut\";\n\tjsb_cocos2d_EaseElasticOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElasticOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseElasticOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElasticOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseElasticOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseElasticOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseElasticOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseElasticOut_class->finalize = js_cocos2d_EaseElasticOut_finalize;\n\tjsb_cocos2d_EaseElasticOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseElasticOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseElasticOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseElastic_prototype,\n\t\tjsb_cocos2d_EaseElasticOut_class,\n\t\tdummy_constructor<cocos2d::EaseElasticOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseElasticOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseElasticOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseElasticOut_class;\n\t\tp->proto = jsb_cocos2d_EaseElasticOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseElastic_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseElasticInOut_class;\nJSObject *jsb_cocos2d_EaseElasticInOut_prototype;\n\nJSBool js_cocos2dx_EaseElasticInOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::ActionInterval* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseElasticInOut>(cx, (cocos2d::EaseElasticInOut*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::ActionInterval* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseElasticInOut>(cx, (cocos2d::EaseElasticInOut*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_EaseElasticInOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_EaseElastic_prototype;\n\nvoid js_cocos2d_EaseElasticInOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseElasticInOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseElasticInOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseElasticInOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseElasticInOut_class->name = \"EaseElasticInOut\";\n\tjsb_cocos2d_EaseElasticInOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElasticInOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseElasticInOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseElasticInOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseElasticInOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseElasticInOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseElasticInOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseElasticInOut_class->finalize = js_cocos2d_EaseElasticInOut_finalize;\n\tjsb_cocos2d_EaseElasticInOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseElasticInOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseElasticInOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseElastic_prototype,\n\t\tjsb_cocos2d_EaseElasticInOut_class,\n\t\tdummy_constructor<cocos2d::EaseElasticInOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseElasticInOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseElasticInOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseElasticInOut_class;\n\t\tp->proto = jsb_cocos2d_EaseElasticInOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseElastic_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseBounce_class;\nJSObject *jsb_cocos2d_EaseBounce_prototype;\n\nJSBool js_cocos2dx_EaseBounce_bounceTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EaseBounce* cobj = (cocos2d::EaseBounce *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EaseBounce_bounceTime : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseBounce_bounceTime : Error processing arguments\");\n\t\tdouble ret = cobj->bounceTime(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EaseBounce_bounceTime : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseBounce_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseBounce)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseBounce(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseBounce_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseBounce_class->name = \"EaseBounce\";\n\tjsb_cocos2d_EaseBounce_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounce_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseBounce_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounce_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseBounce_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseBounce_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseBounce_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseBounce_class->finalize = js_cocos2d_EaseBounce_finalize;\n\tjsb_cocos2d_EaseBounce_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"bounceTime\", js_cocos2dx_EaseBounce_bounceTime, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_EaseBounce_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseBounce_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseBounce\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseBounce> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseBounce_class;\n\t\tp->proto = jsb_cocos2d_EaseBounce_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseBounceIn_class;\nJSObject *jsb_cocos2d_EaseBounceIn_prototype;\n\nJSBool js_cocos2dx_EaseBounceIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseBounceIn_create : Error processing arguments\");\n\t\tcocos2d::EaseBounceIn* ret = cocos2d::EaseBounceIn::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseBounceIn>(cx, (cocos2d::EaseBounceIn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseBounceIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_EaseBounce_prototype;\n\nvoid js_cocos2d_EaseBounceIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseBounceIn)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseBounceIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseBounceIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseBounceIn_class->name = \"EaseBounceIn\";\n\tjsb_cocos2d_EaseBounceIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounceIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseBounceIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounceIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseBounceIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseBounceIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseBounceIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseBounceIn_class->finalize = js_cocos2d_EaseBounceIn_finalize;\n\tjsb_cocos2d_EaseBounceIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseBounceIn_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseBounceIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseBounce_prototype,\n\t\tjsb_cocos2d_EaseBounceIn_class,\n\t\tdummy_constructor<cocos2d::EaseBounceIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseBounceIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseBounceIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseBounceIn_class;\n\t\tp->proto = jsb_cocos2d_EaseBounceIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseBounce_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseBounceOut_class;\nJSObject *jsb_cocos2d_EaseBounceOut_prototype;\n\nJSBool js_cocos2dx_EaseBounceOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseBounceOut_create : Error processing arguments\");\n\t\tcocos2d::EaseBounceOut* ret = cocos2d::EaseBounceOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseBounceOut>(cx, (cocos2d::EaseBounceOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseBounceOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_EaseBounce_prototype;\n\nvoid js_cocos2d_EaseBounceOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseBounceOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseBounceOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseBounceOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseBounceOut_class->name = \"EaseBounceOut\";\n\tjsb_cocos2d_EaseBounceOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounceOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseBounceOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounceOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseBounceOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseBounceOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseBounceOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseBounceOut_class->finalize = js_cocos2d_EaseBounceOut_finalize;\n\tjsb_cocos2d_EaseBounceOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseBounceOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseBounceOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseBounce_prototype,\n\t\tjsb_cocos2d_EaseBounceOut_class,\n\t\tdummy_constructor<cocos2d::EaseBounceOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseBounceOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseBounceOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseBounceOut_class;\n\t\tp->proto = jsb_cocos2d_EaseBounceOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseBounce_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseBounceInOut_class;\nJSObject *jsb_cocos2d_EaseBounceInOut_prototype;\n\nJSBool js_cocos2dx_EaseBounceInOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseBounceInOut_create : Error processing arguments\");\n\t\tcocos2d::EaseBounceInOut* ret = cocos2d::EaseBounceInOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseBounceInOut>(cx, (cocos2d::EaseBounceInOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseBounceInOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_EaseBounce_prototype;\n\nvoid js_cocos2d_EaseBounceInOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseBounceInOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseBounceInOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseBounceInOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseBounceInOut_class->name = \"EaseBounceInOut\";\n\tjsb_cocos2d_EaseBounceInOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounceInOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseBounceInOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBounceInOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseBounceInOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseBounceInOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseBounceInOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseBounceInOut_class->finalize = js_cocos2d_EaseBounceInOut_finalize;\n\tjsb_cocos2d_EaseBounceInOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseBounceInOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseBounceInOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EaseBounce_prototype,\n\t\tjsb_cocos2d_EaseBounceInOut_class,\n\t\tdummy_constructor<cocos2d::EaseBounceInOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseBounceInOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseBounceInOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseBounceInOut_class;\n\t\tp->proto = jsb_cocos2d_EaseBounceInOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_EaseBounce_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseBackIn_class;\nJSObject *jsb_cocos2d_EaseBackIn_prototype;\n\nJSBool js_cocos2dx_EaseBackIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseBackIn_create : Error processing arguments\");\n\t\tcocos2d::EaseBackIn* ret = cocos2d::EaseBackIn::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseBackIn>(cx, (cocos2d::EaseBackIn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseBackIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseBackIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseBackIn)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseBackIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseBackIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseBackIn_class->name = \"EaseBackIn\";\n\tjsb_cocos2d_EaseBackIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBackIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseBackIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBackIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseBackIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseBackIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseBackIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseBackIn_class->finalize = js_cocos2d_EaseBackIn_finalize;\n\tjsb_cocos2d_EaseBackIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseBackIn_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseBackIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseBackIn_class,\n\t\tdummy_constructor<cocos2d::EaseBackIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseBackIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseBackIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseBackIn_class;\n\t\tp->proto = jsb_cocos2d_EaseBackIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseBackOut_class;\nJSObject *jsb_cocos2d_EaseBackOut_prototype;\n\nJSBool js_cocos2dx_EaseBackOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseBackOut_create : Error processing arguments\");\n\t\tcocos2d::EaseBackOut* ret = cocos2d::EaseBackOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseBackOut>(cx, (cocos2d::EaseBackOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseBackOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseBackOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseBackOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseBackOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseBackOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseBackOut_class->name = \"EaseBackOut\";\n\tjsb_cocos2d_EaseBackOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBackOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseBackOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBackOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseBackOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseBackOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseBackOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseBackOut_class->finalize = js_cocos2d_EaseBackOut_finalize;\n\tjsb_cocos2d_EaseBackOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseBackOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseBackOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseBackOut_class,\n\t\tdummy_constructor<cocos2d::EaseBackOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseBackOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseBackOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseBackOut_class;\n\t\tp->proto = jsb_cocos2d_EaseBackOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EaseBackInOut_class;\nJSObject *jsb_cocos2d_EaseBackInOut_prototype;\n\nJSBool js_cocos2dx_EaseBackInOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EaseBackInOut_create : Error processing arguments\");\n\t\tcocos2d::EaseBackInOut* ret = cocos2d::EaseBackInOut::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EaseBackInOut>(cx, (cocos2d::EaseBackInOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EaseBackInOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nvoid js_cocos2d_EaseBackInOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EaseBackInOut)\", obj);\n}\n\nvoid js_register_cocos2dx_EaseBackInOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EaseBackInOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EaseBackInOut_class->name = \"EaseBackInOut\";\n\tjsb_cocos2d_EaseBackInOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBackInOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EaseBackInOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EaseBackInOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EaseBackInOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EaseBackInOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EaseBackInOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EaseBackInOut_class->finalize = js_cocos2d_EaseBackInOut_finalize;\n\tjsb_cocos2d_EaseBackInOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_EaseBackInOut_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EaseBackInOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionEase_prototype,\n\t\tjsb_cocos2d_EaseBackInOut_class,\n\t\tdummy_constructor<cocos2d::EaseBackInOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EaseBackInOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EaseBackInOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EaseBackInOut_class;\n\t\tp->proto = jsb_cocos2d_EaseBackInOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionEase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ActionInstant_class;\nJSObject *jsb_cocos2d_ActionInstant_prototype;\n\n\nextern JSObject *jsb_cocos2d_FiniteTimeAction_prototype;\n\nvoid js_cocos2d_ActionInstant_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionInstant)\", obj);\n}\n\nvoid js_register_cocos2dx_ActionInstant(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ActionInstant_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ActionInstant_class->name = \"ActionInstant\";\n\tjsb_cocos2d_ActionInstant_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionInstant_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ActionInstant_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionInstant_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ActionInstant_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ActionInstant_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ActionInstant_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ActionInstant_class->finalize = js_cocos2d_ActionInstant_finalize;\n\tjsb_cocos2d_ActionInstant_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_ActionInstant_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_FiniteTimeAction_prototype,\n\t\tjsb_cocos2d_ActionInstant_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionInstant\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ActionInstant> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ActionInstant_class;\n\t\tp->proto = jsb_cocos2d_ActionInstant_prototype;\n\t\tp->parentProto = jsb_cocos2d_FiniteTimeAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Show_class;\nJSObject *jsb_cocos2d_Show_prototype;\n\nJSBool js_cocos2dx_Show_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Show* ret = cocos2d::Show::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Show>(cx, (cocos2d::Show*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Show_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_Show_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Show)\", obj);\n}\n\nvoid js_register_cocos2dx_Show(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Show_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Show_class->name = \"Show\";\n\tjsb_cocos2d_Show_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Show_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Show_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Show_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Show_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Show_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Show_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Show_class->finalize = js_cocos2d_Show_finalize;\n\tjsb_cocos2d_Show_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Show_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Show_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_Show_class,\n\t\tdummy_constructor<cocos2d::Show>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Show\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Show> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Show_class;\n\t\tp->proto = jsb_cocos2d_Show_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Hide_class;\nJSObject *jsb_cocos2d_Hide_prototype;\n\nJSBool js_cocos2dx_Hide_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Hide* ret = cocos2d::Hide::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Hide>(cx, (cocos2d::Hide*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Hide_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_Hide_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Hide)\", obj);\n}\n\nvoid js_register_cocos2dx_Hide(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Hide_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Hide_class->name = \"Hide\";\n\tjsb_cocos2d_Hide_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Hide_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Hide_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Hide_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Hide_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Hide_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Hide_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Hide_class->finalize = js_cocos2d_Hide_finalize;\n\tjsb_cocos2d_Hide_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Hide_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Hide_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_Hide_class,\n\t\tdummy_constructor<cocos2d::Hide>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Hide\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Hide> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Hide_class;\n\t\tp->proto = jsb_cocos2d_Hide_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ToggleVisibility_class;\nJSObject *jsb_cocos2d_ToggleVisibility_prototype;\n\nJSBool js_cocos2dx_ToggleVisibility_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ToggleVisibility* ret = cocos2d::ToggleVisibility::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ToggleVisibility>(cx, (cocos2d::ToggleVisibility*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ToggleVisibility_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_ToggleVisibility_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ToggleVisibility)\", obj);\n}\n\nvoid js_register_cocos2dx_ToggleVisibility(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ToggleVisibility_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ToggleVisibility_class->name = \"ToggleVisibility\";\n\tjsb_cocos2d_ToggleVisibility_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ToggleVisibility_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ToggleVisibility_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ToggleVisibility_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ToggleVisibility_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ToggleVisibility_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ToggleVisibility_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ToggleVisibility_class->finalize = js_cocos2d_ToggleVisibility_finalize;\n\tjsb_cocos2d_ToggleVisibility_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ToggleVisibility_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ToggleVisibility_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_ToggleVisibility_class,\n\t\tdummy_constructor<cocos2d::ToggleVisibility>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ToggleVisibility\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ToggleVisibility> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ToggleVisibility_class;\n\t\tp->proto = jsb_cocos2d_ToggleVisibility_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_RemoveSelf_class;\nJSObject *jsb_cocos2d_RemoveSelf_prototype;\n\nJSBool js_cocos2dx_RemoveSelf_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 0) {\n\t\tcocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RemoveSelf>(cx, (cocos2d::RemoveSelf*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RemoveSelf_create : Error processing arguments\");\n\t\tcocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RemoveSelf>(cx, (cocos2d::RemoveSelf*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_RemoveSelf_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_RemoveSelf_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (RemoveSelf)\", obj);\n}\n\nvoid js_register_cocos2dx_RemoveSelf(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_RemoveSelf_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_RemoveSelf_class->name = \"RemoveSelf\";\n\tjsb_cocos2d_RemoveSelf_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_RemoveSelf_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_RemoveSelf_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_RemoveSelf_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_RemoveSelf_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_RemoveSelf_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_RemoveSelf_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_RemoveSelf_class->finalize = js_cocos2d_RemoveSelf_finalize;\n\tjsb_cocos2d_RemoveSelf_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_RemoveSelf_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_RemoveSelf_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_RemoveSelf_class,\n\t\tdummy_constructor<cocos2d::RemoveSelf>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"RemoveSelf\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::RemoveSelf> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_RemoveSelf_class;\n\t\tp->proto = jsb_cocos2d_RemoveSelf_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FlipX_class;\nJSObject *jsb_cocos2d_FlipX_prototype;\n\nJSBool js_cocos2dx_FlipX_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FlipX_create : Error processing arguments\");\n\t\tcocos2d::FlipX* ret = cocos2d::FlipX::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FlipX>(cx, (cocos2d::FlipX*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FlipX_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_FlipX_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FlipX)\", obj);\n}\n\nvoid js_register_cocos2dx_FlipX(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FlipX_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FlipX_class->name = \"FlipX\";\n\tjsb_cocos2d_FlipX_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipX_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FlipX_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipX_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FlipX_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FlipX_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FlipX_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FlipX_class->finalize = js_cocos2d_FlipX_finalize;\n\tjsb_cocos2d_FlipX_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FlipX_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FlipX_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_FlipX_class,\n\t\tdummy_constructor<cocos2d::FlipX>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FlipX\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FlipX> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FlipX_class;\n\t\tp->proto = jsb_cocos2d_FlipX_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FlipY_class;\nJSObject *jsb_cocos2d_FlipY_prototype;\n\nJSBool js_cocos2dx_FlipY_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FlipY_create : Error processing arguments\");\n\t\tcocos2d::FlipY* ret = cocos2d::FlipY::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FlipY>(cx, (cocos2d::FlipY*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FlipY_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_FlipY_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FlipY)\", obj);\n}\n\nvoid js_register_cocos2dx_FlipY(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FlipY_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FlipY_class->name = \"FlipY\";\n\tjsb_cocos2d_FlipY_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipY_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FlipY_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipY_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FlipY_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FlipY_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FlipY_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FlipY_class->finalize = js_cocos2d_FlipY_finalize;\n\tjsb_cocos2d_FlipY_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FlipY_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FlipY_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_FlipY_class,\n\t\tdummy_constructor<cocos2d::FlipY>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FlipY\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FlipY> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FlipY_class;\n\t\tp->proto = jsb_cocos2d_FlipY_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Place_class;\nJSObject *jsb_cocos2d_Place_prototype;\n\nJSBool js_cocos2dx_Place_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Place_create : Error processing arguments\");\n\t\tcocos2d::Place* ret = cocos2d::Place::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Place>(cx, (cocos2d::Place*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Place_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_Place_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Place)\", obj);\n}\n\nvoid js_register_cocos2dx_Place(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Place_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Place_class->name = \"Place\";\n\tjsb_cocos2d_Place_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Place_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Place_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Place_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Place_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Place_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Place_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Place_class->finalize = js_cocos2d_Place_finalize;\n\tjsb_cocos2d_Place_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Place_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Place_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_Place_class,\n\t\tdummy_constructor<cocos2d::Place>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Place\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Place> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Place_class;\n\t\tp->proto = jsb_cocos2d_Place_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_CallFunc_class;\nJSObject *jsb_cocos2d_CallFunc_prototype;\n\nJSBool js_cocos2dx_CallFunc_execute(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CallFunc* cobj = (cocos2d::CallFunc *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CallFunc_execute : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->execute();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CallFunc_execute : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_CallFunc_getTargetCallback(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CallFunc* cobj = (cocos2d::CallFunc *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CallFunc_getTargetCallback : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Object* ret = cobj->getTargetCallback();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Object>(cx, (cocos2d::Object*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CallFunc_getTargetCallback : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_CallFunc_setTargetCallback(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CallFunc* cobj = (cocos2d::CallFunc *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CallFunc_setTargetCallback : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Object* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_CallFunc_setTargetCallback : Error processing arguments\");\n\t\tcobj->setTargetCallback(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CallFunc_setTargetCallback : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_CallFunc_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CallFunc)\", obj);\n}\n\nvoid js_register_cocos2dx_CallFunc(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_CallFunc_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_CallFunc_class->name = \"CallFunc\";\n\tjsb_cocos2d_CallFunc_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_CallFunc_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_CallFunc_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_CallFunc_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_CallFunc_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_CallFunc_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_CallFunc_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_CallFunc_class->finalize = js_cocos2d_CallFunc_finalize;\n\tjsb_cocos2d_CallFunc_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"execute\", js_cocos2dx_CallFunc_execute, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTargetCallback\", js_cocos2dx_CallFunc_getTargetCallback, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTargetCallback\", js_cocos2dx_CallFunc_setTargetCallback, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_CallFunc_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_CallFunc_class,\n\t\tdummy_constructor<cocos2d::CallFunc>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"CallFunc\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::CallFunc> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_CallFunc_class;\n\t\tp->proto = jsb_cocos2d_CallFunc_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_GridAction_class;\nJSObject *jsb_cocos2d_GridAction_prototype;\n\nJSBool js_cocos2dx_GridAction_getGrid(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridAction* cobj = (cocos2d::GridAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridAction_getGrid : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::GridBase* ret = cobj->getGrid();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GridBase>(cx, (cocos2d::GridBase*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridAction_getGrid : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_GridAction_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (GridAction)\", obj);\n}\n\nvoid js_register_cocos2dx_GridAction(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_GridAction_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_GridAction_class->name = \"GridAction\";\n\tjsb_cocos2d_GridAction_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_GridAction_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_GridAction_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_GridAction_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_GridAction_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_GridAction_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_GridAction_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_GridAction_class->finalize = js_cocos2d_GridAction_finalize;\n\tjsb_cocos2d_GridAction_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getGrid\", js_cocos2dx_GridAction_getGrid, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_GridAction_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_GridAction_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"GridAction\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::GridAction> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_GridAction_class;\n\t\tp->proto = jsb_cocos2d_GridAction_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Grid3DAction_class;\nJSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nJSBool js_cocos2dx_Grid3DAction_getGrid(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Grid3DAction* cobj = (cocos2d::Grid3DAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Grid3DAction_getGrid : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::GridBase* ret = cobj->getGrid();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GridBase>(cx, (cocos2d::GridBase*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Grid3DAction_getGrid : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_GridAction_prototype;\n\nvoid js_cocos2d_Grid3DAction_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Grid3DAction)\", obj);\n}\n\nvoid js_register_cocos2dx_Grid3DAction(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Grid3DAction_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Grid3DAction_class->name = \"Grid3DAction\";\n\tjsb_cocos2d_Grid3DAction_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Grid3DAction_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Grid3DAction_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Grid3DAction_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Grid3DAction_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Grid3DAction_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Grid3DAction_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Grid3DAction_class->finalize = js_cocos2d_Grid3DAction_finalize;\n\tjsb_cocos2d_Grid3DAction_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getGrid\", js_cocos2dx_Grid3DAction_getGrid, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Grid3DAction_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_GridAction_prototype,\n\t\tjsb_cocos2d_Grid3DAction_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Grid3DAction\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Grid3DAction> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Grid3DAction_class;\n\t\tp->proto = jsb_cocos2d_Grid3DAction_prototype;\n\t\tp->parentProto = jsb_cocos2d_GridAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TiledGrid3DAction_class;\nJSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nJSBool js_cocos2dx_TiledGrid3DAction_getGrid(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TiledGrid3DAction* cobj = (cocos2d::TiledGrid3DAction *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TiledGrid3DAction_getGrid : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::GridBase* ret = cobj->getGrid();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GridBase>(cx, (cocos2d::GridBase*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TiledGrid3DAction_getGrid : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_GridAction_prototype;\n\nvoid js_cocos2d_TiledGrid3DAction_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TiledGrid3DAction)\", obj);\n}\n\nvoid js_register_cocos2dx_TiledGrid3DAction(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TiledGrid3DAction_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TiledGrid3DAction_class->name = \"TiledGrid3DAction\";\n\tjsb_cocos2d_TiledGrid3DAction_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TiledGrid3DAction_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TiledGrid3DAction_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TiledGrid3DAction_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TiledGrid3DAction_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TiledGrid3DAction_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TiledGrid3DAction_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TiledGrid3DAction_class->finalize = js_cocos2d_TiledGrid3DAction_finalize;\n\tjsb_cocos2d_TiledGrid3DAction_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getGrid\", js_cocos2dx_TiledGrid3DAction_getGrid, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_TiledGrid3DAction_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_GridAction_prototype,\n\t\tjsb_cocos2d_TiledGrid3DAction_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TiledGrid3DAction\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TiledGrid3DAction> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TiledGrid3DAction_class;\n\t\tp->proto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\tp->parentProto = jsb_cocos2d_GridAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_StopGrid_class;\nJSObject *jsb_cocos2d_StopGrid_prototype;\n\nJSBool js_cocos2dx_StopGrid_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::StopGrid* ret = cocos2d::StopGrid::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::StopGrid>(cx, (cocos2d::StopGrid*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_StopGrid_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_StopGrid_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (StopGrid)\", obj);\n}\n\nvoid js_register_cocos2dx_StopGrid(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_StopGrid_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_StopGrid_class->name = \"StopGrid\";\n\tjsb_cocos2d_StopGrid_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_StopGrid_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_StopGrid_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_StopGrid_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_StopGrid_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_StopGrid_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_StopGrid_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_StopGrid_class->finalize = js_cocos2d_StopGrid_finalize;\n\tjsb_cocos2d_StopGrid_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_StopGrid_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_StopGrid_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_StopGrid_class,\n\t\tdummy_constructor<cocos2d::StopGrid>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"StopGrid\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::StopGrid> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_StopGrid_class;\n\t\tp->proto = jsb_cocos2d_StopGrid_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ReuseGrid_class;\nJSObject *jsb_cocos2d_ReuseGrid_prototype;\n\nJSBool js_cocos2dx_ReuseGrid_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ReuseGrid_create : Error processing arguments\");\n\t\tcocos2d::ReuseGrid* ret = cocos2d::ReuseGrid::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ReuseGrid>(cx, (cocos2d::ReuseGrid*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ReuseGrid_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nvoid js_cocos2d_ReuseGrid_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ReuseGrid)\", obj);\n}\n\nvoid js_register_cocos2dx_ReuseGrid(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ReuseGrid_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ReuseGrid_class->name = \"ReuseGrid\";\n\tjsb_cocos2d_ReuseGrid_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ReuseGrid_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ReuseGrid_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ReuseGrid_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ReuseGrid_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ReuseGrid_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ReuseGrid_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ReuseGrid_class->finalize = js_cocos2d_ReuseGrid_finalize;\n\tjsb_cocos2d_ReuseGrid_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ReuseGrid_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ReuseGrid_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInstant_prototype,\n\t\tjsb_cocos2d_ReuseGrid_class,\n\t\tdummy_constructor<cocos2d::ReuseGrid>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ReuseGrid\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ReuseGrid> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ReuseGrid_class;\n\t\tp->proto = jsb_cocos2d_ReuseGrid_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInstant_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Waves3D_class;\nJSObject *jsb_cocos2d_Waves3D_prototype;\n\nJSBool js_cocos2dx_Waves3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves3D* cobj = (cocos2d::Waves3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves3D_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves3D_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves3D* cobj = (cocos2d::Waves3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves3D_setAmplitude : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Waves3D_setAmplitude : Error processing arguments\");\n\t\tcobj->setAmplitude(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves3D_setAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves3D* cobj = (cocos2d::Waves3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves3D_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Waves3D_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves3D_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves3D* cobj = (cocos2d::Waves3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves3D_getAmplitude : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitude();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves3D_getAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tunsigned int arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Waves3D_create : Error processing arguments\");\n\t\tcocos2d::Waves3D* ret = cocos2d::Waves3D::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Waves3D>(cx, (cocos2d::Waves3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Waves3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_Waves3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Waves3D)\", obj);\n}\n\nvoid js_register_cocos2dx_Waves3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Waves3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Waves3D_class->name = \"Waves3D\";\n\tjsb_cocos2d_Waves3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Waves3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Waves3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Waves3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Waves3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Waves3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Waves3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Waves3D_class->finalize = js_cocos2d_Waves3D_finalize;\n\tjsb_cocos2d_Waves3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_Waves3D_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitude\", js_cocos2dx_Waves3D_setAmplitude, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_Waves3D_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitude\", js_cocos2dx_Waves3D_getAmplitude, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Waves3D_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Waves3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_Waves3D_class,\n\t\tdummy_constructor<cocos2d::Waves3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Waves3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Waves3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Waves3D_class;\n\t\tp->proto = jsb_cocos2d_Waves3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FlipX3D_class;\nJSObject *jsb_cocos2d_FlipX3D_prototype;\n\nJSBool js_cocos2dx_FlipX3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FlipX3D_create : Error processing arguments\");\n\t\tcocos2d::FlipX3D* ret = cocos2d::FlipX3D::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FlipX3D>(cx, (cocos2d::FlipX3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FlipX3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_FlipX3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FlipX3D)\", obj);\n}\n\nvoid js_register_cocos2dx_FlipX3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FlipX3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FlipX3D_class->name = \"FlipX3D\";\n\tjsb_cocos2d_FlipX3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipX3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FlipX3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipX3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FlipX3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FlipX3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FlipX3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FlipX3D_class->finalize = js_cocos2d_FlipX3D_finalize;\n\tjsb_cocos2d_FlipX3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FlipX3D_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FlipX3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_FlipX3D_class,\n\t\tdummy_constructor<cocos2d::FlipX3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FlipX3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FlipX3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FlipX3D_class;\n\t\tp->proto = jsb_cocos2d_FlipX3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FlipY3D_class;\nJSObject *jsb_cocos2d_FlipY3D_prototype;\n\nJSBool js_cocos2dx_FlipY3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FlipY3D_create : Error processing arguments\");\n\t\tcocos2d::FlipY3D* ret = cocos2d::FlipY3D::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FlipY3D>(cx, (cocos2d::FlipY3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FlipY3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_FlipY3D_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::FlipY3D* cobj = new cocos2d::FlipY3D();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::FlipY3D> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::FlipY3D\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FlipY3D_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_FlipX3D_prototype;\n\nvoid js_cocos2d_FlipY3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FlipY3D)\", obj);\n}\n\nvoid js_register_cocos2dx_FlipY3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FlipY3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FlipY3D_class->name = \"FlipY3D\";\n\tjsb_cocos2d_FlipY3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipY3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FlipY3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FlipY3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FlipY3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FlipY3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FlipY3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FlipY3D_class->finalize = js_cocos2d_FlipY3D_finalize;\n\tjsb_cocos2d_FlipY3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FlipY3D_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FlipY3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_FlipX3D_prototype,\n\t\tjsb_cocos2d_FlipY3D_class,\n\t\tjs_cocos2dx_FlipY3D_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FlipY3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FlipY3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FlipY3D_class;\n\t\tp->proto = jsb_cocos2d_FlipY3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_FlipX3D_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Lens3D_class;\nJSObject *jsb_cocos2d_Lens3D_prototype;\n\nJSBool js_cocos2dx_Lens3D_setPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Lens3D* cobj = (cocos2d::Lens3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Lens3D_setPosition : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Lens3D_setPosition : Error processing arguments\");\n\t\tcobj->setPosition(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Lens3D_setPosition : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Lens3D_setConcave(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Lens3D* cobj = (cocos2d::Lens3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Lens3D_setConcave : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Lens3D_setConcave : Error processing arguments\");\n\t\tcobj->setConcave(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Lens3D_setConcave : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Lens3D_setLensEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Lens3D* cobj = (cocos2d::Lens3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Lens3D_setLensEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Lens3D_setLensEffect : Error processing arguments\");\n\t\tcobj->setLensEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Lens3D_setLensEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Lens3D_getPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Lens3D* cobj = (cocos2d::Lens3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Lens3D_getPosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getPosition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Lens3D_getPosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Lens3D_getLensEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Lens3D* cobj = (cocos2d::Lens3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Lens3D_getLensEffect : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getLensEffect();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Lens3D_getLensEffect : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Lens3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tcocos2d::Point arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Lens3D_create : Error processing arguments\");\n\t\tcocos2d::Lens3D* ret = cocos2d::Lens3D::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Lens3D>(cx, (cocos2d::Lens3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Lens3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_Lens3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Lens3D)\", obj);\n}\n\nvoid js_register_cocos2dx_Lens3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Lens3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Lens3D_class->name = \"Lens3D\";\n\tjsb_cocos2d_Lens3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Lens3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Lens3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Lens3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Lens3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Lens3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Lens3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Lens3D_class->finalize = js_cocos2d_Lens3D_finalize;\n\tjsb_cocos2d_Lens3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setPosition\", js_cocos2dx_Lens3D_setPosition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setConcave\", js_cocos2dx_Lens3D_setConcave, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLensEffect\", js_cocos2dx_Lens3D_setLensEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPosition\", js_cocos2dx_Lens3D_getPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLensEffect\", js_cocos2dx_Lens3D_getLensEffect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Lens3D_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Lens3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_Lens3D_class,\n\t\tdummy_constructor<cocos2d::Lens3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Lens3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Lens3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Lens3D_class;\n\t\tp->proto = jsb_cocos2d_Lens3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Ripple3D_class;\nJSObject *jsb_cocos2d_Ripple3D_prototype;\n\nJSBool js_cocos2dx_Ripple3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Ripple3D* cobj = (cocos2d::Ripple3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Ripple3D_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Ripple3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Ripple3D* cobj = (cocos2d::Ripple3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Ripple3D_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Ripple3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Ripple3D* cobj = (cocos2d::Ripple3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_setAmplitude : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_setAmplitude : Error processing arguments\");\n\t\tcobj->setAmplitude(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Ripple3D_setAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Ripple3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Ripple3D* cobj = (cocos2d::Ripple3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_getAmplitude : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitude();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Ripple3D_getAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Ripple3D_setPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Ripple3D* cobj = (cocos2d::Ripple3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_setPosition : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_setPosition : Error processing arguments\");\n\t\tcobj->setPosition(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Ripple3D_setPosition : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Ripple3D_getPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Ripple3D* cobj = (cocos2d::Ripple3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_getPosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getPosition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Ripple3D_getPosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Ripple3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 6) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tcocos2d::Point arg2;\n\t\tdouble arg3;\n\t\tunsigned int arg4;\n\t\tdouble arg5;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tok &= jsval_to_uint32(cx, argv[4], &arg4);\n\t\tok &= JS_ValueToNumber(cx, argv[5], &arg5);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Ripple3D_create : Error processing arguments\");\n\t\tcocos2d::Ripple3D* ret = cocos2d::Ripple3D::create(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Ripple3D>(cx, (cocos2d::Ripple3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Ripple3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_Ripple3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Ripple3D)\", obj);\n}\n\nvoid js_register_cocos2dx_Ripple3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Ripple3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Ripple3D_class->name = \"Ripple3D\";\n\tjsb_cocos2d_Ripple3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Ripple3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Ripple3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Ripple3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Ripple3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Ripple3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Ripple3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Ripple3D_class->finalize = js_cocos2d_Ripple3D_finalize;\n\tjsb_cocos2d_Ripple3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_Ripple3D_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_Ripple3D_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitude\", js_cocos2dx_Ripple3D_setAmplitude, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitude\", js_cocos2dx_Ripple3D_getAmplitude, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPosition\", js_cocos2dx_Ripple3D_setPosition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPosition\", js_cocos2dx_Ripple3D_getPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Ripple3D_create, 6, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Ripple3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_Ripple3D_class,\n\t\tdummy_constructor<cocos2d::Ripple3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Ripple3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Ripple3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Ripple3D_class;\n\t\tp->proto = jsb_cocos2d_Ripple3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Shaky3D_class;\nJSObject *jsb_cocos2d_Shaky3D_prototype;\n\nJSBool js_cocos2dx_Shaky3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tint arg2;\n\t\tJSBool arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= JS_ValueToBoolean(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Shaky3D_create : Error processing arguments\");\n\t\tcocos2d::Shaky3D* ret = cocos2d::Shaky3D::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Shaky3D>(cx, (cocos2d::Shaky3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Shaky3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Shaky3D_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Shaky3D* cobj = new cocos2d::Shaky3D();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Shaky3D> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Shaky3D\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Shaky3D_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_Shaky3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Shaky3D)\", obj);\n}\n\nvoid js_register_cocos2dx_Shaky3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Shaky3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Shaky3D_class->name = \"Shaky3D\";\n\tjsb_cocos2d_Shaky3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Shaky3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Shaky3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Shaky3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Shaky3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Shaky3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Shaky3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Shaky3D_class->finalize = js_cocos2d_Shaky3D_finalize;\n\tjsb_cocos2d_Shaky3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Shaky3D_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Shaky3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_Shaky3D_class,\n\t\tjs_cocos2dx_Shaky3D_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Shaky3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Shaky3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Shaky3D_class;\n\t\tp->proto = jsb_cocos2d_Shaky3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Liquid_class;\nJSObject *jsb_cocos2d_Liquid_prototype;\n\nJSBool js_cocos2dx_Liquid_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Liquid* cobj = (cocos2d::Liquid *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Liquid_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Liquid_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Liquid_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Liquid* cobj = (cocos2d::Liquid *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Liquid_setAmplitude : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Liquid_setAmplitude : Error processing arguments\");\n\t\tcobj->setAmplitude(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Liquid_setAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Liquid_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Liquid* cobj = (cocos2d::Liquid *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Liquid_getAmplitude : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitude();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Liquid_getAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Liquid_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Liquid* cobj = (cocos2d::Liquid *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Liquid_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Liquid_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Liquid_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Liquid_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tunsigned int arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Liquid_create : Error processing arguments\");\n\t\tcocos2d::Liquid* ret = cocos2d::Liquid::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Liquid>(cx, (cocos2d::Liquid*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Liquid_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Liquid_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Liquid* cobj = new cocos2d::Liquid();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Liquid> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Liquid\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Liquid_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_Liquid_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Liquid)\", obj);\n}\n\nvoid js_register_cocos2dx_Liquid(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Liquid_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Liquid_class->name = \"Liquid\";\n\tjsb_cocos2d_Liquid_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Liquid_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Liquid_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Liquid_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Liquid_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Liquid_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Liquid_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Liquid_class->finalize = js_cocos2d_Liquid_finalize;\n\tjsb_cocos2d_Liquid_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_Liquid_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitude\", js_cocos2dx_Liquid_setAmplitude, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitude\", js_cocos2dx_Liquid_getAmplitude, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_Liquid_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Liquid_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Liquid_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_Liquid_class,\n\t\tjs_cocos2dx_Liquid_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Liquid\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Liquid> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Liquid_class;\n\t\tp->proto = jsb_cocos2d_Liquid_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Waves_class;\nJSObject *jsb_cocos2d_Waves_prototype;\n\nJSBool js_cocos2dx_Waves_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves* cobj = (cocos2d::Waves *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves* cobj = (cocos2d::Waves *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves_setAmplitude : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Waves_setAmplitude : Error processing arguments\");\n\t\tcobj->setAmplitude(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves_setAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves* cobj = (cocos2d::Waves *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves_getAmplitude : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitude();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves_getAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Waves* cobj = (cocos2d::Waves *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Waves_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Waves_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Waves_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 6) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tunsigned int arg2;\n\t\tdouble arg3;\n\t\tJSBool arg4;\n\t\tJSBool arg5;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tok &= JS_ValueToBoolean(cx, argv[4], &arg4);\n\t\tok &= JS_ValueToBoolean(cx, argv[5], &arg5);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Waves_create : Error processing arguments\");\n\t\tcocos2d::Waves* ret = cocos2d::Waves::create(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Waves>(cx, (cocos2d::Waves*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Waves_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Waves_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Waves* cobj = new cocos2d::Waves();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Waves> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Waves\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Waves_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_Waves_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Waves)\", obj);\n}\n\nvoid js_register_cocos2dx_Waves(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Waves_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Waves_class->name = \"Waves\";\n\tjsb_cocos2d_Waves_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Waves_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Waves_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Waves_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Waves_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Waves_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Waves_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Waves_class->finalize = js_cocos2d_Waves_finalize;\n\tjsb_cocos2d_Waves_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_Waves_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitude\", js_cocos2dx_Waves_setAmplitude, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitude\", js_cocos2dx_Waves_getAmplitude, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_Waves_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Waves_create, 6, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Waves_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_Waves_class,\n\t\tjs_cocos2dx_Waves_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Waves\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Waves> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Waves_class;\n\t\tp->proto = jsb_cocos2d_Waves_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Twirl_class;\nJSObject *jsb_cocos2d_Twirl_prototype;\n\nJSBool js_cocos2dx_Twirl_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Twirl* cobj = (cocos2d::Twirl *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Twirl_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Twirl_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Twirl_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Twirl* cobj = (cocos2d::Twirl *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Twirl_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Twirl_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Twirl* cobj = (cocos2d::Twirl *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Twirl_setAmplitude : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Twirl_setAmplitude : Error processing arguments\");\n\t\tcobj->setAmplitude(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_setAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Twirl_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Twirl* cobj = (cocos2d::Twirl *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Twirl_getAmplitude : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitude();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_getAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Twirl_setPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Twirl* cobj = (cocos2d::Twirl *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Twirl_setPosition : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Twirl_setPosition : Error processing arguments\");\n\t\tcobj->setPosition(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_setPosition : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Twirl_getPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Twirl* cobj = (cocos2d::Twirl *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Twirl_getPosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getPosition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_getPosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Twirl_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 5) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tcocos2d::Point arg2;\n\t\tunsigned int arg3;\n\t\tdouble arg4;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= jsval_to_uint32(cx, argv[3], &arg3);\n\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Twirl_create : Error processing arguments\");\n\t\tcocos2d::Twirl* ret = cocos2d::Twirl::create(arg0, arg1, arg2, arg3, arg4);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Twirl>(cx, (cocos2d::Twirl*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Twirl_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Twirl* cobj = new cocos2d::Twirl();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Twirl> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Twirl\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Twirl_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_Twirl_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Twirl)\", obj);\n}\n\nvoid js_register_cocos2dx_Twirl(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Twirl_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Twirl_class->name = \"Twirl\";\n\tjsb_cocos2d_Twirl_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Twirl_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Twirl_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Twirl_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Twirl_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Twirl_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Twirl_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Twirl_class->finalize = js_cocos2d_Twirl_finalize;\n\tjsb_cocos2d_Twirl_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_Twirl_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_Twirl_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitude\", js_cocos2dx_Twirl_setAmplitude, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitude\", js_cocos2dx_Twirl_getAmplitude, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPosition\", js_cocos2dx_Twirl_setPosition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPosition\", js_cocos2dx_Twirl_getPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Twirl_create, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Twirl_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_Twirl_class,\n\t\tjs_cocos2dx_Twirl_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Twirl\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Twirl> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Twirl_class;\n\t\tp->proto = jsb_cocos2d_Twirl_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_PageTurn3D_class;\nJSObject *jsb_cocos2d_PageTurn3D_prototype;\n\nJSBool js_cocos2dx_PageTurn3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_PageTurn3D_create : Error processing arguments\");\n\t\tcocos2d::PageTurn3D* ret = cocos2d::PageTurn3D::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::PageTurn3D>(cx, (cocos2d::PageTurn3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_PageTurn3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nvoid js_cocos2d_PageTurn3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (PageTurn3D)\", obj);\n}\n\nvoid js_register_cocos2dx_PageTurn3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_PageTurn3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_PageTurn3D_class->name = \"PageTurn3D\";\n\tjsb_cocos2d_PageTurn3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_PageTurn3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_PageTurn3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_PageTurn3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_PageTurn3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_PageTurn3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_PageTurn3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_PageTurn3D_class->finalize = js_cocos2d_PageTurn3D_finalize;\n\tjsb_cocos2d_PageTurn3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_PageTurn3D_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_PageTurn3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Grid3DAction_prototype,\n\t\tjsb_cocos2d_PageTurn3D_class,\n\t\tdummy_constructor<cocos2d::PageTurn3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"PageTurn3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::PageTurn3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_PageTurn3D_class;\n\t\tp->proto = jsb_cocos2d_PageTurn3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_Grid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ProgressTo_class;\nJSObject *jsb_cocos2d_ProgressTo_prototype;\n\nJSBool js_cocos2dx_ProgressTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressTo_create : Error processing arguments\");\n\t\tcocos2d::ProgressTo* ret = cocos2d::ProgressTo::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ProgressTo>(cx, (cocos2d::ProgressTo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_ProgressTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProgressTo)\", obj);\n}\n\nvoid js_register_cocos2dx_ProgressTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ProgressTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ProgressTo_class->name = \"ProgressTo\";\n\tjsb_cocos2d_ProgressTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ProgressTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ProgressTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ProgressTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ProgressTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ProgressTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ProgressTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ProgressTo_class->finalize = js_cocos2d_ProgressTo_finalize;\n\tjsb_cocos2d_ProgressTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ProgressTo_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ProgressTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_ProgressTo_class,\n\t\tdummy_constructor<cocos2d::ProgressTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProgressTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ProgressTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ProgressTo_class;\n\t\tp->proto = jsb_cocos2d_ProgressTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ProgressFromTo_class;\nJSObject *jsb_cocos2d_ProgressFromTo_prototype;\n\nJSBool js_cocos2dx_ProgressFromTo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressFromTo_create : Error processing arguments\");\n\t\tcocos2d::ProgressFromTo* ret = cocos2d::ProgressFromTo::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ProgressFromTo>(cx, (cocos2d::ProgressFromTo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressFromTo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_ProgressFromTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProgressFromTo)\", obj);\n}\n\nvoid js_register_cocos2dx_ProgressFromTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ProgressFromTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ProgressFromTo_class->name = \"ProgressFromTo\";\n\tjsb_cocos2d_ProgressFromTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ProgressFromTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ProgressFromTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ProgressFromTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ProgressFromTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ProgressFromTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ProgressFromTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ProgressFromTo_class->finalize = js_cocos2d_ProgressFromTo_finalize;\n\tjsb_cocos2d_ProgressFromTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ProgressFromTo_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ProgressFromTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_ProgressFromTo_class,\n\t\tdummy_constructor<cocos2d::ProgressFromTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProgressFromTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ProgressFromTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ProgressFromTo_class;\n\t\tp->proto = jsb_cocos2d_ProgressFromTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ShakyTiles3D_class;\nJSObject *jsb_cocos2d_ShakyTiles3D_prototype;\n\nJSBool js_cocos2dx_ShakyTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tint arg2;\n\t\tJSBool arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= JS_ValueToBoolean(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShakyTiles3D_create : Error processing arguments\");\n\t\tcocos2d::ShakyTiles3D* ret = cocos2d::ShakyTiles3D::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ShakyTiles3D>(cx, (cocos2d::ShakyTiles3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ShakyTiles3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_ShakyTiles3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ShakyTiles3D)\", obj);\n}\n\nvoid js_register_cocos2dx_ShakyTiles3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ShakyTiles3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ShakyTiles3D_class->name = \"ShakyTiles3D\";\n\tjsb_cocos2d_ShakyTiles3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShakyTiles3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ShakyTiles3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShakyTiles3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ShakyTiles3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ShakyTiles3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ShakyTiles3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ShakyTiles3D_class->finalize = js_cocos2d_ShakyTiles3D_finalize;\n\tjsb_cocos2d_ShakyTiles3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ShakyTiles3D_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ShakyTiles3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_ShakyTiles3D_class,\n\t\tdummy_constructor<cocos2d::ShakyTiles3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ShakyTiles3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ShakyTiles3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ShakyTiles3D_class;\n\t\tp->proto = jsb_cocos2d_ShakyTiles3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ShatteredTiles3D_class;\nJSObject *jsb_cocos2d_ShatteredTiles3D_prototype;\n\nJSBool js_cocos2dx_ShatteredTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tint arg2;\n\t\tJSBool arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= JS_ValueToBoolean(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShatteredTiles3D_create : Error processing arguments\");\n\t\tcocos2d::ShatteredTiles3D* ret = cocos2d::ShatteredTiles3D::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ShatteredTiles3D>(cx, (cocos2d::ShatteredTiles3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ShatteredTiles3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_ShatteredTiles3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ShatteredTiles3D)\", obj);\n}\n\nvoid js_register_cocos2dx_ShatteredTiles3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ShatteredTiles3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ShatteredTiles3D_class->name = \"ShatteredTiles3D\";\n\tjsb_cocos2d_ShatteredTiles3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShatteredTiles3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ShatteredTiles3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShatteredTiles3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ShatteredTiles3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ShatteredTiles3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ShatteredTiles3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ShatteredTiles3D_class->finalize = js_cocos2d_ShatteredTiles3D_finalize;\n\tjsb_cocos2d_ShatteredTiles3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ShatteredTiles3D_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ShatteredTiles3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_ShatteredTiles3D_class,\n\t\tdummy_constructor<cocos2d::ShatteredTiles3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ShatteredTiles3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ShatteredTiles3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ShatteredTiles3D_class;\n\t\tp->proto = jsb_cocos2d_ShatteredTiles3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ShuffleTiles_class;\nJSObject *jsb_cocos2d_ShuffleTiles_prototype;\n\nJSBool js_cocos2dx_ShuffleTiles_placeTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ShuffleTiles* cobj = (cocos2d::ShuffleTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ShuffleTiles_placeTile : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::Tile* arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR Tile*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShuffleTiles_placeTile : Error processing arguments\");\n\t\tcobj->placeTile(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShuffleTiles_placeTile : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ShuffleTiles_shuffle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ShuffleTiles* cobj = (cocos2d::ShuffleTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ShuffleTiles_shuffle : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tunsigned int* arg0;\n\t\tunsigned int arg1;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR unsigned int*;\n\t\tok &= jsval_to_uint32(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShuffleTiles_shuffle : Error processing arguments\");\n\t\tcobj->shuffle(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShuffleTiles_shuffle : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ShuffleTiles_getDelta(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ShuffleTiles* cobj = (cocos2d::ShuffleTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ShuffleTiles_getDelta : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShuffleTiles_getDelta : Error processing arguments\");\n\t\tcocos2d::Size ret = cobj->getDelta(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShuffleTiles_getDelta : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ShuffleTiles_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tunsigned int arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShuffleTiles_create : Error processing arguments\");\n\t\tcocos2d::ShuffleTiles* ret = cocos2d::ShuffleTiles::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ShuffleTiles>(cx, (cocos2d::ShuffleTiles*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ShuffleTiles_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_ShuffleTiles_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ShuffleTiles)\", obj);\n}\n\nvoid js_register_cocos2dx_ShuffleTiles(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ShuffleTiles_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ShuffleTiles_class->name = \"ShuffleTiles\";\n\tjsb_cocos2d_ShuffleTiles_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShuffleTiles_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ShuffleTiles_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShuffleTiles_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ShuffleTiles_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ShuffleTiles_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ShuffleTiles_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ShuffleTiles_class->finalize = js_cocos2d_ShuffleTiles_finalize;\n\tjsb_cocos2d_ShuffleTiles_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"placeTile\", js_cocos2dx_ShuffleTiles_placeTile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"shuffle\", js_cocos2dx_ShuffleTiles_shuffle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDelta\", js_cocos2dx_ShuffleTiles_getDelta, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ShuffleTiles_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ShuffleTiles_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_ShuffleTiles_class,\n\t\tdummy_constructor<cocos2d::ShuffleTiles>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ShuffleTiles\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ShuffleTiles> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ShuffleTiles_class;\n\t\tp->proto = jsb_cocos2d_ShuffleTiles_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FadeOutTRTiles_class;\nJSObject *jsb_cocos2d_FadeOutTRTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutTRTiles_turnOnTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FadeOutTRTiles* cobj = (cocos2d::FadeOutTRTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_turnOnTile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_turnOnTile : Error processing arguments\");\n\t\tcobj->turnOnTile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutTRTiles_turnOnTile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FadeOutTRTiles_turnOffTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FadeOutTRTiles* cobj = (cocos2d::FadeOutTRTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_turnOffTile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_turnOffTile : Error processing arguments\");\n\t\tcobj->turnOffTile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutTRTiles_turnOffTile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FadeOutTRTiles_transformTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FadeOutTRTiles* cobj = (cocos2d::FadeOutTRTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_transformTile : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_transformTile : Error processing arguments\");\n\t\tcobj->transformTile(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutTRTiles_transformTile : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FadeOutTRTiles_testFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FadeOutTRTiles* cobj = (cocos2d::FadeOutTRTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_testFunc : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Size arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_testFunc : Error processing arguments\");\n\t\tdouble ret = cobj->testFunc(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutTRTiles_testFunc : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FadeOutTRTiles_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutTRTiles_create : Error processing arguments\");\n\t\tcocos2d::FadeOutTRTiles* ret = cocos2d::FadeOutTRTiles::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FadeOutTRTiles>(cx, (cocos2d::FadeOutTRTiles*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutTRTiles_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_FadeOutTRTiles_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FadeOutTRTiles)\", obj);\n}\n\nvoid js_register_cocos2dx_FadeOutTRTiles(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FadeOutTRTiles_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FadeOutTRTiles_class->name = \"FadeOutTRTiles\";\n\tjsb_cocos2d_FadeOutTRTiles_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutTRTiles_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FadeOutTRTiles_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutTRTiles_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FadeOutTRTiles_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FadeOutTRTiles_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FadeOutTRTiles_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FadeOutTRTiles_class->finalize = js_cocos2d_FadeOutTRTiles_finalize;\n\tjsb_cocos2d_FadeOutTRTiles_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"turnOnTile\", js_cocos2dx_FadeOutTRTiles_turnOnTile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"turnOffTile\", js_cocos2dx_FadeOutTRTiles_turnOffTile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"transformTile\", js_cocos2dx_FadeOutTRTiles_transformTile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"testFunc\", js_cocos2dx_FadeOutTRTiles_testFunc, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FadeOutTRTiles_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FadeOutTRTiles_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_FadeOutTRTiles_class,\n\t\tdummy_constructor<cocos2d::FadeOutTRTiles>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FadeOutTRTiles\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FadeOutTRTiles> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FadeOutTRTiles_class;\n\t\tp->proto = jsb_cocos2d_FadeOutTRTiles_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FadeOutBLTiles_class;\nJSObject *jsb_cocos2d_FadeOutBLTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutBLTiles_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutBLTiles_create : Error processing arguments\");\n\t\tcocos2d::FadeOutBLTiles* ret = cocos2d::FadeOutBLTiles::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FadeOutBLTiles>(cx, (cocos2d::FadeOutBLTiles*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutBLTiles_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_FadeOutTRTiles_prototype;\n\nvoid js_cocos2d_FadeOutBLTiles_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FadeOutBLTiles)\", obj);\n}\n\nvoid js_register_cocos2dx_FadeOutBLTiles(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FadeOutBLTiles_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FadeOutBLTiles_class->name = \"FadeOutBLTiles\";\n\tjsb_cocos2d_FadeOutBLTiles_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutBLTiles_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FadeOutBLTiles_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutBLTiles_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FadeOutBLTiles_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FadeOutBLTiles_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FadeOutBLTiles_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FadeOutBLTiles_class->finalize = js_cocos2d_FadeOutBLTiles_finalize;\n\tjsb_cocos2d_FadeOutBLTiles_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FadeOutBLTiles_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FadeOutBLTiles_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_FadeOutTRTiles_prototype,\n\t\tjsb_cocos2d_FadeOutBLTiles_class,\n\t\tdummy_constructor<cocos2d::FadeOutBLTiles>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FadeOutBLTiles\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FadeOutBLTiles> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FadeOutBLTiles_class;\n\t\tp->proto = jsb_cocos2d_FadeOutBLTiles_prototype;\n\t\tp->parentProto = jsb_cocos2d_FadeOutTRTiles_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FadeOutUpTiles_class;\nJSObject *jsb_cocos2d_FadeOutUpTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutUpTiles_transformTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FadeOutUpTiles* cobj = (cocos2d::FadeOutUpTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FadeOutUpTiles_transformTile : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutUpTiles_transformTile : Error processing arguments\");\n\t\tcobj->transformTile(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutUpTiles_transformTile : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FadeOutUpTiles_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutUpTiles_create : Error processing arguments\");\n\t\tcocos2d::FadeOutUpTiles* ret = cocos2d::FadeOutUpTiles::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FadeOutUpTiles>(cx, (cocos2d::FadeOutUpTiles*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutUpTiles_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_FadeOutTRTiles_prototype;\n\nvoid js_cocos2d_FadeOutUpTiles_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FadeOutUpTiles)\", obj);\n}\n\nvoid js_register_cocos2dx_FadeOutUpTiles(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FadeOutUpTiles_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FadeOutUpTiles_class->name = \"FadeOutUpTiles\";\n\tjsb_cocos2d_FadeOutUpTiles_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutUpTiles_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FadeOutUpTiles_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutUpTiles_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FadeOutUpTiles_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FadeOutUpTiles_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FadeOutUpTiles_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FadeOutUpTiles_class->finalize = js_cocos2d_FadeOutUpTiles_finalize;\n\tjsb_cocos2d_FadeOutUpTiles_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"transformTile\", js_cocos2dx_FadeOutUpTiles_transformTile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FadeOutUpTiles_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FadeOutUpTiles_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_FadeOutTRTiles_prototype,\n\t\tjsb_cocos2d_FadeOutUpTiles_class,\n\t\tdummy_constructor<cocos2d::FadeOutUpTiles>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FadeOutUpTiles\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FadeOutUpTiles> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FadeOutUpTiles_class;\n\t\tp->proto = jsb_cocos2d_FadeOutUpTiles_prototype;\n\t\tp->parentProto = jsb_cocos2d_FadeOutTRTiles_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FadeOutDownTiles_class;\nJSObject *jsb_cocos2d_FadeOutDownTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutDownTiles_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FadeOutDownTiles_create : Error processing arguments\");\n\t\tcocos2d::FadeOutDownTiles* ret = cocos2d::FadeOutDownTiles::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FadeOutDownTiles>(cx, (cocos2d::FadeOutDownTiles*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FadeOutDownTiles_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_FadeOutUpTiles_prototype;\n\nvoid js_cocos2d_FadeOutDownTiles_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FadeOutDownTiles)\", obj);\n}\n\nvoid js_register_cocos2dx_FadeOutDownTiles(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FadeOutDownTiles_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FadeOutDownTiles_class->name = \"FadeOutDownTiles\";\n\tjsb_cocos2d_FadeOutDownTiles_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutDownTiles_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FadeOutDownTiles_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FadeOutDownTiles_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FadeOutDownTiles_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FadeOutDownTiles_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FadeOutDownTiles_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FadeOutDownTiles_class->finalize = js_cocos2d_FadeOutDownTiles_finalize;\n\tjsb_cocos2d_FadeOutDownTiles_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_FadeOutDownTiles_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FadeOutDownTiles_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_FadeOutUpTiles_prototype,\n\t\tjsb_cocos2d_FadeOutDownTiles_class,\n\t\tdummy_constructor<cocos2d::FadeOutDownTiles>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FadeOutDownTiles\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FadeOutDownTiles> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FadeOutDownTiles_class;\n\t\tp->proto = jsb_cocos2d_FadeOutDownTiles_prototype;\n\t\tp->parentProto = jsb_cocos2d_FadeOutUpTiles_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TurnOffTiles_class;\nJSObject *jsb_cocos2d_TurnOffTiles_prototype;\n\nJSBool js_cocos2dx_TurnOffTiles_turnOnTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TurnOffTiles* cobj = (cocos2d::TurnOffTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TurnOffTiles_turnOnTile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TurnOffTiles_turnOnTile : Error processing arguments\");\n\t\tcobj->turnOnTile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TurnOffTiles_turnOnTile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TurnOffTiles_turnOffTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TurnOffTiles* cobj = (cocos2d::TurnOffTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TurnOffTiles_turnOffTile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TurnOffTiles_turnOffTile : Error processing arguments\");\n\t\tcobj->turnOffTile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TurnOffTiles_turnOffTile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TurnOffTiles_shuffle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TurnOffTiles* cobj = (cocos2d::TurnOffTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TurnOffTiles_shuffle : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tunsigned int* arg0;\n\t\tunsigned int arg1;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR unsigned int*;\n\t\tok &= jsval_to_uint32(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TurnOffTiles_shuffle : Error processing arguments\");\n\t\tcobj->shuffle(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TurnOffTiles_shuffle : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg1;\n\t\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tunsigned int arg2;\n\t\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TurnOffTiles* ret = cocos2d::TurnOffTiles::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TurnOffTiles>(cx, (cocos2d::TurnOffTiles*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg1;\n\t\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TurnOffTiles* ret = cocos2d::TurnOffTiles::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TurnOffTiles>(cx, (cocos2d::TurnOffTiles*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TurnOffTiles_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_TurnOffTiles_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TurnOffTiles)\", obj);\n}\n\nvoid js_register_cocos2dx_TurnOffTiles(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TurnOffTiles_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TurnOffTiles_class->name = \"TurnOffTiles\";\n\tjsb_cocos2d_TurnOffTiles_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TurnOffTiles_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TurnOffTiles_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TurnOffTiles_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TurnOffTiles_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TurnOffTiles_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TurnOffTiles_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TurnOffTiles_class->finalize = js_cocos2d_TurnOffTiles_finalize;\n\tjsb_cocos2d_TurnOffTiles_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"turnOnTile\", js_cocos2dx_TurnOffTiles_turnOnTile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"turnOffTile\", js_cocos2dx_TurnOffTiles_turnOffTile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"shuffle\", js_cocos2dx_TurnOffTiles_shuffle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TurnOffTiles_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TurnOffTiles_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_TurnOffTiles_class,\n\t\tdummy_constructor<cocos2d::TurnOffTiles>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TurnOffTiles\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TurnOffTiles> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TurnOffTiles_class;\n\t\tp->proto = jsb_cocos2d_TurnOffTiles_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_WavesTiles3D_class;\nJSObject *jsb_cocos2d_WavesTiles3D_prototype;\n\nJSBool js_cocos2dx_WavesTiles3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::WavesTiles3D* cobj = (cocos2d::WavesTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_WavesTiles3D_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_WavesTiles3D_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_WavesTiles3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::WavesTiles3D* cobj = (cocos2d::WavesTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_WavesTiles3D_setAmplitude : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_WavesTiles3D_setAmplitude : Error processing arguments\");\n\t\tcobj->setAmplitude(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_WavesTiles3D_setAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_WavesTiles3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::WavesTiles3D* cobj = (cocos2d::WavesTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_WavesTiles3D_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_WavesTiles3D_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_WavesTiles3D_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_WavesTiles3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::WavesTiles3D* cobj = (cocos2d::WavesTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_WavesTiles3D_getAmplitude : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitude();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_WavesTiles3D_getAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_WavesTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tunsigned int arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_WavesTiles3D_create : Error processing arguments\");\n\t\tcocos2d::WavesTiles3D* ret = cocos2d::WavesTiles3D::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::WavesTiles3D>(cx, (cocos2d::WavesTiles3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_WavesTiles3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_WavesTiles3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (WavesTiles3D)\", obj);\n}\n\nvoid js_register_cocos2dx_WavesTiles3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_WavesTiles3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_WavesTiles3D_class->name = \"WavesTiles3D\";\n\tjsb_cocos2d_WavesTiles3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_WavesTiles3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_WavesTiles3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_WavesTiles3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_WavesTiles3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_WavesTiles3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_WavesTiles3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_WavesTiles3D_class->finalize = js_cocos2d_WavesTiles3D_finalize;\n\tjsb_cocos2d_WavesTiles3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_WavesTiles3D_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitude\", js_cocos2dx_WavesTiles3D_setAmplitude, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_WavesTiles3D_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitude\", js_cocos2dx_WavesTiles3D_getAmplitude, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_WavesTiles3D_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_WavesTiles3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_WavesTiles3D_class,\n\t\tdummy_constructor<cocos2d::WavesTiles3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"WavesTiles3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::WavesTiles3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_WavesTiles3D_class;\n\t\tp->proto = jsb_cocos2d_WavesTiles3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_JumpTiles3D_class;\nJSObject *jsb_cocos2d_JumpTiles3D_prototype;\n\nJSBool js_cocos2dx_JumpTiles3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::JumpTiles3D* cobj = (cocos2d::JumpTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_JumpTiles3D_getAmplitudeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitudeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_JumpTiles3D_getAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_JumpTiles3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::JumpTiles3D* cobj = (cocos2d::JumpTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_JumpTiles3D_setAmplitude : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_JumpTiles3D_setAmplitude : Error processing arguments\");\n\t\tcobj->setAmplitude(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_JumpTiles3D_setAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_JumpTiles3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::JumpTiles3D* cobj = (cocos2d::JumpTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_JumpTiles3D_setAmplitudeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_JumpTiles3D_setAmplitudeRate : Error processing arguments\");\n\t\tcobj->setAmplitudeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_JumpTiles3D_setAmplitudeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_JumpTiles3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::JumpTiles3D* cobj = (cocos2d::JumpTiles3D *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_JumpTiles3D_getAmplitude : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAmplitude();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_JumpTiles3D_getAmplitude : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_JumpTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tcocos2d::Size arg1;\n\t\tunsigned int arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\tok &= jsval_to_uint32(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_JumpTiles3D_create : Error processing arguments\");\n\t\tcocos2d::JumpTiles3D* ret = cocos2d::JumpTiles3D::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::JumpTiles3D>(cx, (cocos2d::JumpTiles3D*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_JumpTiles3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_JumpTiles3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (JumpTiles3D)\", obj);\n}\n\nvoid js_register_cocos2dx_JumpTiles3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_JumpTiles3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_JumpTiles3D_class->name = \"JumpTiles3D\";\n\tjsb_cocos2d_JumpTiles3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_JumpTiles3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_JumpTiles3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_JumpTiles3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_JumpTiles3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_JumpTiles3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_JumpTiles3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_JumpTiles3D_class->finalize = js_cocos2d_JumpTiles3D_finalize;\n\tjsb_cocos2d_JumpTiles3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAmplitudeRate\", js_cocos2dx_JumpTiles3D_getAmplitudeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitude\", js_cocos2dx_JumpTiles3D_setAmplitude, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAmplitudeRate\", js_cocos2dx_JumpTiles3D_setAmplitudeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAmplitude\", js_cocos2dx_JumpTiles3D_getAmplitude, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_JumpTiles3D_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_JumpTiles3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_JumpTiles3D_class,\n\t\tdummy_constructor<cocos2d::JumpTiles3D>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"JumpTiles3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::JumpTiles3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_JumpTiles3D_class;\n\t\tp->proto = jsb_cocos2d_JumpTiles3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SplitRows_class;\nJSObject *jsb_cocos2d_SplitRows_prototype;\n\nJSBool js_cocos2dx_SplitRows_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tunsigned int arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_uint32(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SplitRows_create : Error processing arguments\");\n\t\tcocos2d::SplitRows* ret = cocos2d::SplitRows::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SplitRows>(cx, (cocos2d::SplitRows*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SplitRows_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_SplitRows_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SplitRows)\", obj);\n}\n\nvoid js_register_cocos2dx_SplitRows(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SplitRows_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SplitRows_class->name = \"SplitRows\";\n\tjsb_cocos2d_SplitRows_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SplitRows_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SplitRows_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SplitRows_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SplitRows_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SplitRows_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SplitRows_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SplitRows_class->finalize = js_cocos2d_SplitRows_finalize;\n\tjsb_cocos2d_SplitRows_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_SplitRows_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_SplitRows_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_SplitRows_class,\n\t\tdummy_constructor<cocos2d::SplitRows>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SplitRows\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SplitRows> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SplitRows_class;\n\t\tp->proto = jsb_cocos2d_SplitRows_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SplitCols_class;\nJSObject *jsb_cocos2d_SplitCols_prototype;\n\nJSBool js_cocos2dx_SplitCols_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tunsigned int arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_uint32(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SplitCols_create : Error processing arguments\");\n\t\tcocos2d::SplitCols* ret = cocos2d::SplitCols::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SplitCols>(cx, (cocos2d::SplitCols*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SplitCols_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nvoid js_cocos2d_SplitCols_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SplitCols)\", obj);\n}\n\nvoid js_register_cocos2dx_SplitCols(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SplitCols_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SplitCols_class->name = \"SplitCols\";\n\tjsb_cocos2d_SplitCols_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SplitCols_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SplitCols_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SplitCols_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SplitCols_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SplitCols_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SplitCols_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SplitCols_class->finalize = js_cocos2d_SplitCols_finalize;\n\tjsb_cocos2d_SplitCols_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_SplitCols_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_SplitCols_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TiledGrid3DAction_prototype,\n\t\tjsb_cocos2d_SplitCols_class,\n\t\tdummy_constructor<cocos2d::SplitCols>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SplitCols\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SplitCols> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SplitCols_class;\n\t\tp->proto = jsb_cocos2d_SplitCols_prototype;\n\t\tp->parentProto = jsb_cocos2d_TiledGrid3DAction_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ActionTween_class;\nJSObject *jsb_cocos2d_ActionTween_prototype;\n\nJSBool js_cocos2dx_ActionTween_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ActionTween* cobj = (cocos2d::ActionTween *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ActionTween_initWithDuration : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tstd::string arg1;\n\t\tdouble arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionTween_initWithDuration : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ActionTween_initWithDuration : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ActionTween_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tstd::string arg1;\n\t\tdouble arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ActionTween_create : Error processing arguments\");\n\t\tcocos2d::ActionTween* ret = cocos2d::ActionTween::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionTween>(cx, (cocos2d::ActionTween*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ActionTween_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_ActionTween_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionTween)\", obj);\n}\n\nvoid js_register_cocos2dx_ActionTween(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ActionTween_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ActionTween_class->name = \"ActionTween\";\n\tjsb_cocos2d_ActionTween_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionTween_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ActionTween_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ActionTween_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ActionTween_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ActionTween_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ActionTween_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ActionTween_class->finalize = js_cocos2d_ActionTween_finalize;\n\tjsb_cocos2d_ActionTween_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"initWithDuration\", js_cocos2dx_ActionTween_initWithDuration, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ActionTween_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ActionTween_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_ActionTween_class,\n\t\tdummy_constructor<cocos2d::ActionTween>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionTween\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ActionTween> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ActionTween_class;\n\t\tp->proto = jsb_cocos2d_ActionTween_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_CardinalSplineTo_class;\nJSObject *jsb_cocos2d_CardinalSplineTo_prototype;\n\nJSBool js_cocos2dx_CardinalSplineTo_getPoints(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CardinalSplineTo* cobj = (cocos2d::CardinalSplineTo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CardinalSplineTo_getPoints : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::PointArray* ret = cobj->getPoints();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::PointArray>(cx, (cocos2d::PointArray*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CardinalSplineTo_getPoints : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_CardinalSplineTo_updatePosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CardinalSplineTo* cobj = (cocos2d::CardinalSplineTo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CardinalSplineTo_updatePosition : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_CardinalSplineTo_updatePosition : Error processing arguments\");\n\t\tcobj->updatePosition(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CardinalSplineTo_updatePosition : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_CardinalSplineTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CardinalSplineTo* cobj = (cocos2d::CardinalSplineTo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CardinalSplineTo_initWithDuration : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tcocos2d::PointArray* arg1;\n\t\tdouble arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::PointArray*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_CardinalSplineTo_initWithDuration : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithDuration(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CardinalSplineTo_initWithDuration : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_CardinalSplineTo_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::CardinalSplineTo* cobj = new cocos2d::CardinalSplineTo();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::CardinalSplineTo> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::CardinalSplineTo\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CardinalSplineTo_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nvoid js_cocos2d_CardinalSplineTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CardinalSplineTo)\", obj);\n}\n\nvoid js_register_cocos2dx_CardinalSplineTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_CardinalSplineTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_CardinalSplineTo_class->name = \"CardinalSplineTo\";\n\tjsb_cocos2d_CardinalSplineTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_CardinalSplineTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_CardinalSplineTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_CardinalSplineTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_CardinalSplineTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_CardinalSplineTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_CardinalSplineTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_CardinalSplineTo_class->finalize = js_cocos2d_CardinalSplineTo_finalize;\n\tjsb_cocos2d_CardinalSplineTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getPoints\", js_cocos2dx_CardinalSplineTo_getPoints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updatePosition\", js_cocos2dx_CardinalSplineTo_updatePosition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithDuration\", js_cocos2dx_CardinalSplineTo_initWithDuration, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_CardinalSplineTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ActionInterval_prototype,\n\t\tjsb_cocos2d_CardinalSplineTo_class,\n\t\tjs_cocos2dx_CardinalSplineTo_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"CardinalSplineTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::CardinalSplineTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_CardinalSplineTo_class;\n\t\tp->proto = jsb_cocos2d_CardinalSplineTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_ActionInterval_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_CardinalSplineBy_class;\nJSObject *jsb_cocos2d_CardinalSplineBy_prototype;\n\nJSBool js_cocos2dx_CardinalSplineBy_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::CardinalSplineBy* cobj = new cocos2d::CardinalSplineBy();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::CardinalSplineBy> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::CardinalSplineBy\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CardinalSplineBy_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_CardinalSplineTo_prototype;\n\nvoid js_cocos2d_CardinalSplineBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CardinalSplineBy)\", obj);\n}\n\nvoid js_register_cocos2dx_CardinalSplineBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_CardinalSplineBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_CardinalSplineBy_class->name = \"CardinalSplineBy\";\n\tjsb_cocos2d_CardinalSplineBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_CardinalSplineBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_CardinalSplineBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_CardinalSplineBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_CardinalSplineBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_CardinalSplineBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_CardinalSplineBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_CardinalSplineBy_class->finalize = js_cocos2d_CardinalSplineBy_finalize;\n\tjsb_cocos2d_CardinalSplineBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_CardinalSplineBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_CardinalSplineTo_prototype,\n\t\tjsb_cocos2d_CardinalSplineBy_class,\n\t\tjs_cocos2dx_CardinalSplineBy_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"CardinalSplineBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::CardinalSplineBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_CardinalSplineBy_class;\n\t\tp->proto = jsb_cocos2d_CardinalSplineBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_CardinalSplineTo_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_CatmullRomTo_class;\nJSObject *jsb_cocos2d_CatmullRomTo_prototype;\n\nJSBool js_cocos2dx_CatmullRomTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CatmullRomTo* cobj = (cocos2d::CatmullRomTo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CatmullRomTo_initWithDuration : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::PointArray* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::PointArray*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_CatmullRomTo_initWithDuration : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithDuration(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CatmullRomTo_initWithDuration : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_CardinalSplineTo_prototype;\n\nvoid js_cocos2d_CatmullRomTo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CatmullRomTo)\", obj);\n}\n\nvoid js_register_cocos2dx_CatmullRomTo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_CatmullRomTo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_CatmullRomTo_class->name = \"CatmullRomTo\";\n\tjsb_cocos2d_CatmullRomTo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_CatmullRomTo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_CatmullRomTo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_CatmullRomTo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_CatmullRomTo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_CatmullRomTo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_CatmullRomTo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_CatmullRomTo_class->finalize = js_cocos2d_CatmullRomTo_finalize;\n\tjsb_cocos2d_CatmullRomTo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"initWithDuration\", js_cocos2dx_CatmullRomTo_initWithDuration, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_CatmullRomTo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_CardinalSplineTo_prototype,\n\t\tjsb_cocos2d_CatmullRomTo_class,\n\t\tdummy_constructor<cocos2d::CatmullRomTo>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"CatmullRomTo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::CatmullRomTo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_CatmullRomTo_class;\n\t\tp->proto = jsb_cocos2d_CatmullRomTo_prototype;\n\t\tp->parentProto = jsb_cocos2d_CardinalSplineTo_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_CatmullRomBy_class;\nJSObject *jsb_cocos2d_CatmullRomBy_prototype;\n\nJSBool js_cocos2dx_CatmullRomBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::CatmullRomBy* cobj = (cocos2d::CatmullRomBy *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_CatmullRomBy_initWithDuration : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::PointArray* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::PointArray*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_CatmullRomBy_initWithDuration : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithDuration(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_CatmullRomBy_initWithDuration : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_CardinalSplineBy_prototype;\n\nvoid js_cocos2d_CatmullRomBy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CatmullRomBy)\", obj);\n}\n\nvoid js_register_cocos2dx_CatmullRomBy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_CatmullRomBy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_CatmullRomBy_class->name = \"CatmullRomBy\";\n\tjsb_cocos2d_CatmullRomBy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_CatmullRomBy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_CatmullRomBy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_CatmullRomBy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_CatmullRomBy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_CatmullRomBy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_CatmullRomBy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_CatmullRomBy_class->finalize = js_cocos2d_CatmullRomBy_finalize;\n\tjsb_cocos2d_CatmullRomBy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"initWithDuration\", js_cocos2dx_CatmullRomBy_initWithDuration, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_CatmullRomBy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_CardinalSplineBy_prototype,\n\t\tjsb_cocos2d_CatmullRomBy_class,\n\t\tdummy_constructor<cocos2d::CatmullRomBy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"CatmullRomBy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::CatmullRomBy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_CatmullRomBy_class;\n\t\tp->proto = jsb_cocos2d_CatmullRomBy_prototype;\n\t\tp->parentProto = jsb_cocos2d_CardinalSplineBy_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_AtlasNode_class;\nJSObject *jsb_cocos2d_AtlasNode_prototype;\n\nJSBool js_cocos2dx_AtlasNode_updateAtlasValues(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AtlasNode* cobj = (cocos2d::AtlasNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_updateAtlasValues : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateAtlasValues();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_updateAtlasValues : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AtlasNode_getTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AtlasNode* cobj = (cocos2d::AtlasNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_getTexture : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* ret = cobj->getTexture();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_getTexture : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AtlasNode_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AtlasNode* cobj = (cocos2d::AtlasNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_setTextureAtlas : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextureAtlas* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TextureAtlas*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_setTextureAtlas : Error processing arguments\");\n\t\tcobj->setTextureAtlas(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_setTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AtlasNode_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AtlasNode* cobj = (cocos2d::AtlasNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_getTextureAtlas : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextureAtlas>(cx, (cocos2d::TextureAtlas*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_getTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AtlasNode_getQuadsToDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AtlasNode* cobj = (cocos2d::AtlasNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_getQuadsToDraw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getQuadsToDraw();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_getQuadsToDraw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AtlasNode_setTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AtlasNode* cobj = (cocos2d::AtlasNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_setTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_setTexture : Error processing arguments\");\n\t\tcobj->setTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_setTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AtlasNode_setQuadsToDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AtlasNode* cobj = (cocos2d::AtlasNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_setQuadsToDraw : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_setQuadsToDraw : Error processing arguments\");\n\t\tcobj->setQuadsToDraw(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_setQuadsToDraw : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AtlasNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tstd::string arg0;\n\t\tint arg1;\n\t\tint arg2;\n\t\tint arg3;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AtlasNode_create : Error processing arguments\");\n\t\tcocos2d::AtlasNode* ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::AtlasNode>(cx, (cocos2d::AtlasNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_AtlasNode_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_AtlasNode_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (AtlasNode)\", obj);\n}\n\nvoid js_register_cocos2dx_AtlasNode(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_AtlasNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_AtlasNode_class->name = \"AtlasNode\";\n\tjsb_cocos2d_AtlasNode_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_AtlasNode_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_AtlasNode_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_AtlasNode_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_AtlasNode_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_AtlasNode_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_AtlasNode_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_AtlasNode_class->finalize = js_cocos2d_AtlasNode_finalize;\n\tjsb_cocos2d_AtlasNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"updateAtlasValues\", js_cocos2dx_AtlasNode_updateAtlasValues, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTexture\", js_cocos2dx_AtlasNode_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextureAtlas\", js_cocos2dx_AtlasNode_setTextureAtlas, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureAtlas\", js_cocos2dx_AtlasNode_getTextureAtlas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getQuadsToDraw\", js_cocos2dx_AtlasNode_getQuadsToDraw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTexture\", js_cocos2dx_AtlasNode_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setQuadsToDraw\", js_cocos2dx_AtlasNode_setQuadsToDraw, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_AtlasNode_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_AtlasNode_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_AtlasNode_class,\n\t\tdummy_constructor<cocos2d::AtlasNode>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"AtlasNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::AtlasNode> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_AtlasNode_class;\n\t\tp->proto = jsb_cocos2d_AtlasNode_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_DrawNode_class;\nJSObject *jsb_cocos2d_DrawNode_prototype;\n\nJSBool js_cocos2dx_DrawNode_drawQuadraticBezier(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawQuadraticBezier : Invalid Native Object\");\n\tif (argc == 5) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::Point arg1;\n\t\tcocos2d::Point arg2;\n\t\tunsigned int arg3;\n\t\tcocos2d::Color4F arg4;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= jsval_to_uint32(cx, argv[3], &arg3);\n\t\tok &= jsval_to_cccolor4f(cx, argv[4], &arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawQuadraticBezier : Error processing arguments\");\n\t\tcobj->drawQuadraticBezier(arg0, arg1, arg2, arg3, arg4);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_drawQuadraticBezier : wrong number of arguments: %d, was expecting %d\", argc, 5);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_DrawNode_onDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_DrawNode_onDraw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->onDraw();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_onDraw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_DrawNode_clear(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_DrawNode_clear : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->clear();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_clear : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_DrawNode_drawTriangle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawTriangle : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::Point arg1;\n\t\tcocos2d::Point arg2;\n\t\tcocos2d::Color4F arg3;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= jsval_to_cccolor4f(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawTriangle : Error processing arguments\");\n\t\tcobj->drawTriangle(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_drawTriangle : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_DrawNode_drawDot(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawDot : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Point arg0;\n\t\tdouble arg1;\n\t\tcocos2d::Color4F arg2;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= jsval_to_cccolor4f(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawDot : Error processing arguments\");\n\t\tcobj->drawDot(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_drawDot : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_DrawNode_drawCubicBezier(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawCubicBezier : Invalid Native Object\");\n\tif (argc == 6) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::Point arg1;\n\t\tcocos2d::Point arg2;\n\t\tcocos2d::Point arg3;\n\t\tunsigned int arg4;\n\t\tcocos2d::Color4F arg5;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= jsval_to_ccpoint(cx, argv[3], &arg3);\n\t\tok &= jsval_to_uint32(cx, argv[4], &arg4);\n\t\tok &= jsval_to_cccolor4f(cx, argv[5], &arg5);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawCubicBezier : Error processing arguments\");\n\t\tcobj->drawCubicBezier(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_drawCubicBezier : wrong number of arguments: %d, was expecting %d\", argc, 6);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_DrawNode_drawSegment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::DrawNode* cobj = (cocos2d::DrawNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawSegment : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::Point arg1;\n\t\tdouble arg2;\n\t\tcocos2d::Color4F arg3;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= jsval_to_cccolor4f(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_DrawNode_drawSegment : Error processing arguments\");\n\t\tcobj->drawSegment(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_drawSegment : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_DrawNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::DrawNode* ret = cocos2d::DrawNode::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::DrawNode>(cx, (cocos2d::DrawNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_DrawNode_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_DrawNode_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (DrawNode)\", obj);\n}\n\nstatic JSBool js_cocos2d_DrawNode_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::DrawNode *nobj = cocos2d::DrawNode::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::DrawNode\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_DrawNode(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_DrawNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_DrawNode_class->name = \"DrawNode\";\n\tjsb_cocos2d_DrawNode_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_DrawNode_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_DrawNode_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_DrawNode_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_DrawNode_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_DrawNode_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_DrawNode_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_DrawNode_class->finalize = js_cocos2d_DrawNode_finalize;\n\tjsb_cocos2d_DrawNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"drawQuadraticBezier\", js_cocos2dx_DrawNode_drawQuadraticBezier, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"onDraw\", js_cocos2dx_DrawNode_onDraw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clear\", js_cocos2dx_DrawNode_clear, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawTriangle\", js_cocos2dx_DrawNode_drawTriangle, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawDot\", js_cocos2dx_DrawNode_drawDot, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawCubicBezier\", js_cocos2dx_DrawNode_drawCubicBezier, 6, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawSegment\", js_cocos2dx_DrawNode_drawSegment, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_DrawNode_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_DrawNode_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_DrawNode_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_DrawNode_class,\n\t\tdummy_constructor<cocos2d::DrawNode>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"DrawNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::DrawNode> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_DrawNode_class;\n\t\tp->proto = jsb_cocos2d_DrawNode_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_LabelAtlas_class;\nJSObject *jsb_cocos2d_LabelAtlas_prototype;\n\nJSBool js_cocos2dx_LabelAtlas_setString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelAtlas* cobj = (cocos2d::LabelAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelAtlas_setString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelAtlas_setString : Error processing arguments\");\n\t\tcobj->setString(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelAtlas_setString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelAtlas_initWithString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::LabelAtlas* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::LabelAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelAtlas_initWithString : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelAtlas_initWithString : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelAtlas_updateAtlasValues(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelAtlas* cobj = (cocos2d::LabelAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelAtlas_updateAtlasValues : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateAtlasValues();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelAtlas_updateAtlasValues : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelAtlas_getString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelAtlas* cobj = (cocos2d::LabelAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelAtlas_getString : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getString();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelAtlas_getString : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelAtlas_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelAtlas>(cx, (cocos2d::LabelAtlas*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelAtlas>(cx, (cocos2d::LabelAtlas*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelAtlas>(cx, (cocos2d::LabelAtlas*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_LabelAtlas_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_AtlasNode_prototype;\n\nvoid js_cocos2d_LabelAtlas_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LabelAtlas)\", obj);\n}\n\nvoid js_register_cocos2dx_LabelAtlas(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_LabelAtlas_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_LabelAtlas_class->name = \"LabelAtlas\";\n\tjsb_cocos2d_LabelAtlas_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_LabelAtlas_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_LabelAtlas_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_LabelAtlas_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_LabelAtlas_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_LabelAtlas_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_LabelAtlas_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_LabelAtlas_class->finalize = js_cocos2d_LabelAtlas_finalize;\n\tjsb_cocos2d_LabelAtlas_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setString\", js_cocos2dx_LabelAtlas_setString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithString\", js_cocos2dx_LabelAtlas_initWithString, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateAtlasValues\", js_cocos2dx_LabelAtlas_updateAtlasValues, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getString\", js_cocos2dx_LabelAtlas_getString, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"_create\", js_cocos2dx_LabelAtlas_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_LabelAtlas_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_AtlasNode_prototype,\n\t\tjsb_cocos2d_LabelAtlas_class,\n\t\tdummy_constructor<cocos2d::LabelAtlas>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LabelAtlas\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::LabelAtlas> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_LabelAtlas_class;\n\t\tp->proto = jsb_cocos2d_LabelAtlas_prototype;\n\t\tp->parentProto = jsb_cocos2d_AtlasNode_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Director_class;\nJSObject *jsb_cocos2d_Director_prototype;\n\nJSBool js_cocos2dx_Director_pause(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_pause : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pause();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_pause : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setContentScaleFactor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setContentScaleFactor : Error processing arguments\");\n\t\tcobj->setContentScaleFactor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setContentScaleFactor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getContentScaleFactor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getContentScaleFactor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getContentScaleFactor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getWinSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getWinSizeInPixels : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getWinSizeInPixels();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getWinSizeInPixels : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getDeltaTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getDeltaTime : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getDeltaTime();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getDeltaTime : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setGLDefaultValues(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setGLDefaultValues : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setGLDefaultValues();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setGLDefaultValues : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setActionManager(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setActionManager : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionManager* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionManager*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setActionManager : Error processing arguments\");\n\t\tcobj->setActionManager(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setActionManager : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setAlphaBlending(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setAlphaBlending : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setAlphaBlending : Error processing arguments\");\n\t\tcobj->setAlphaBlending(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setAlphaBlending : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_popToRootScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_popToRootScene : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->popToRootScene();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_popToRootScene : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getNotificationNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getNotificationNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getNotificationNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getNotificationNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getWinSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getWinSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getWinSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getWinSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_end(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_end : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->end();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_end : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getTextureCache(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getTextureCache : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::TextureCache* ret = cobj->getTextureCache();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextureCache>(cx, (cocos2d::TextureCache*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getTextureCache : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_isSendCleanupToScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_isSendCleanupToScene : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isSendCleanupToScene();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_isSendCleanupToScene : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getVisibleOrigin : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getVisibleOrigin();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getVisibleOrigin : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_mainLoop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_mainLoop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->mainLoop();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_mainLoop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setDepthTest(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setDepthTest : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setDepthTest : Error processing arguments\");\n\t\tcobj->setDepthTest(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setDepthTest : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getFrameRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getFrameRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getFrameRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getFrameRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getSecondsPerFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getSecondsPerFrame : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSecondsPerFrame();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getSecondsPerFrame : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_convertToUI(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_convertToUI : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_convertToUI : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertToUI(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_convertToUI : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setDefaultValues(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setDefaultValues : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setDefaultValues();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setDefaultValues : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setScheduler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setScheduler : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Scheduler* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Scheduler*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setScheduler : Error processing arguments\");\n\t\tcobj->setScheduler(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setScheduler : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_startAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_startAnimation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->startAnimation();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_startAnimation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getRunningScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getRunningScene : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Scene* ret = cobj->getRunningScene();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, (cocos2d::Scene*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getRunningScene : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setViewport(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setViewport : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setViewport();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setViewport : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_stopAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_stopAnimation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopAnimation();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_stopAnimation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_popToSceneStackLevel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_popToSceneStackLevel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_popToSceneStackLevel : Error processing arguments\");\n\t\tcobj->popToSceneStackLevel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_popToSceneStackLevel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_resume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_resume : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resume();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_resume : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_isNextDeltaTimeZero(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_isNextDeltaTimeZero : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isNextDeltaTimeZero();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_isNextDeltaTimeZero : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setOpenGLView(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setOpenGLView : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::EGLView* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::EGLView*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setOpenGLView : Error processing arguments\");\n\t\tcobj->setOpenGLView(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setOpenGLView : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_convertToGL(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_convertToGL : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_convertToGL : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->convertToGL(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_convertToGL : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_purgeCachedData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_purgeCachedData : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->purgeCachedData();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_purgeCachedData : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getTotalFrames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getTotalFrames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned int ret = cobj->getTotalFrames();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getTotalFrames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_runWithScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_runWithScene : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Scene* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_runWithScene : Error processing arguments\");\n\t\tcobj->runWithScene(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_runWithScene : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setNotificationNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setNotificationNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setNotificationNode : Error processing arguments\");\n\t\tcobj->setNotificationNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setNotificationNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_drawScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_drawScene : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->drawScene();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_drawScene : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_popScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_popScene : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->popScene();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_popScene : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_isDisplayStats(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_isDisplayStats : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isDisplayStats();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_isDisplayStats : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setProjection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setProjection : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Director::Projection arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setProjection : Error processing arguments\");\n\t\tcobj->setProjection(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setProjection : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getConsole(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getConsole : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Console* ret = cobj->getConsole();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Console>(cx, (cocos2d::Console*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getConsole : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getZEye(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getZEye : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getZEye();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getZEye : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setNextDeltaTimeZero(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setNextDeltaTimeZero : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setNextDeltaTimeZero : Error processing arguments\");\n\t\tcobj->setNextDeltaTimeZero(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setNextDeltaTimeZero : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getVisibleSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getVisibleSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getVisibleSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getVisibleSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getScheduler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getScheduler : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Scheduler* ret = cobj->getScheduler();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scheduler>(cx, (cocos2d::Scheduler*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getScheduler : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_pushScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_pushScene : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Scene* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_pushScene : Error processing arguments\");\n\t\tcobj->pushScene(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_pushScene : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getAnimationInterval : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAnimationInterval();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getAnimationInterval : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_isPaused(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_isPaused : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isPaused();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_isPaused : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setDisplayStats(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setDisplayStats : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setDisplayStats : Error processing arguments\");\n\t\tcobj->setDisplayStats(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setDisplayStats : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_replaceScene(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_replaceScene : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Scene* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_replaceScene : Error processing arguments\");\n\t\tcobj->replaceScene(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_replaceScene : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_setAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_setAnimationInterval : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Director_setAnimationInterval : Error processing arguments\");\n\t\tcobj->setAnimationInterval(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_setAnimationInterval : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getActionManager(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Director* cobj = (cocos2d::Director *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Director_getActionManager : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionManager* ret = cobj->getActionManager();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionManager>(cx, (cocos2d::ActionManager*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getActionManager : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Director_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Director* ret = cocos2d::Director::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Director>(cx, (cocos2d::Director*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Director_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Director_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Director)\", obj);\n}\n\nvoid js_register_cocos2dx_Director(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Director_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Director_class->name = \"Director\";\n\tjsb_cocos2d_Director_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Director_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Director_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Director_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Director_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Director_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Director_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Director_class->finalize = js_cocos2d_Director_finalize;\n\tjsb_cocos2d_Director_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"pause\", js_cocos2dx_Director_pause, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setContentScaleFactor\", js_cocos2dx_Director_setContentScaleFactor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContentScaleFactor\", js_cocos2dx_Director_getContentScaleFactor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getWinSizeInPixels\", js_cocos2dx_Director_getWinSizeInPixels, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDeltaTime\", js_cocos2dx_Director_getDeltaTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGLDefaultValues\", js_cocos2dx_Director_setGLDefaultValues, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setActionManager\", js_cocos2dx_Director_setActionManager, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAlphaBlending\", js_cocos2dx_Director_setAlphaBlending, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"popToRootScene\", js_cocos2dx_Director_popToRootScene, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNotificationNode\", js_cocos2dx_Director_getNotificationNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getWinSize\", js_cocos2dx_Director_getWinSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"end\", js_cocos2dx_Director_end, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureCache\", js_cocos2dx_Director_getTextureCache, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isSendCleanupToScene\", js_cocos2dx_Director_isSendCleanupToScene, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVisibleOrigin\", js_cocos2dx_Director_getVisibleOrigin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"mainLoop\", js_cocos2dx_Director_mainLoop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDepthTest\", js_cocos2dx_Director_setDepthTest, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFrameRate\", js_cocos2dx_Director_getFrameRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSecondsPerFrame\", js_cocos2dx_Director_getSecondsPerFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertToUI\", js_cocos2dx_Director_convertToUI, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDefaultValues\", js_cocos2dx_Director_setDefaultValues, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_Director_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScheduler\", js_cocos2dx_Director_setScheduler, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"startAnimation\", js_cocos2dx_Director_startAnimation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRunningScene\", js_cocos2dx_Director_getRunningScene, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setViewport\", js_cocos2dx_Director_setViewport, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopAnimation\", js_cocos2dx_Director_stopAnimation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"popToSceneStackLevel\", js_cocos2dx_Director_popToSceneStackLevel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resume\", js_cocos2dx_Director_resume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isNextDeltaTimeZero\", js_cocos2dx_Director_isNextDeltaTimeZero, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOpenGLView\", js_cocos2dx_Director_setOpenGLView, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"convertToGL\", js_cocos2dx_Director_convertToGL, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"purgeCachedData\", js_cocos2dx_Director_purgeCachedData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTotalFrames\", js_cocos2dx_Director_getTotalFrames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"runWithScene\", js_cocos2dx_Director_runWithScene, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setNotificationNode\", js_cocos2dx_Director_setNotificationNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawScene\", js_cocos2dx_Director_drawScene, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"popScene\", js_cocos2dx_Director_popScene, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isDisplayStats\", js_cocos2dx_Director_isDisplayStats, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setProjection\", js_cocos2dx_Director_setProjection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getConsole\", js_cocos2dx_Director_getConsole, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getZEye\", js_cocos2dx_Director_getZEye, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setNextDeltaTimeZero\", js_cocos2dx_Director_setNextDeltaTimeZero, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVisibleSize\", js_cocos2dx_Director_getVisibleSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScheduler\", js_cocos2dx_Director_getScheduler, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pushScene\", js_cocos2dx_Director_pushScene, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnimationInterval\", js_cocos2dx_Director_getAnimationInterval, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isPaused\", js_cocos2dx_Director_isPaused, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDisplayStats\", js_cocos2dx_Director_setDisplayStats, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"replaceScene\", js_cocos2dx_Director_replaceScene, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimationInterval\", js_cocos2dx_Director_setAnimationInterval, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getActionManager\", js_cocos2dx_Director_getActionManager, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"getInstance\", js_cocos2dx_Director_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Director_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Director_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Director\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Director> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Director_class;\n\t\tp->proto = jsb_cocos2d_Director_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_GridBase_class;\nJSObject *jsb_cocos2d_GridBase_prototype;\n\nJSBool js_cocos2dx_GridBase_setGridSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_setGridSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GridBase_setGridSize : Error processing arguments\");\n\t\tcobj->setGridSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_setGridSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_calculateVertexPoints(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_calculateVertexPoints : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->calculateVertexPoints();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_calculateVertexPoints : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_afterDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_afterDraw : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GridBase_afterDraw : Error processing arguments\");\n\t\tcobj->afterDraw(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_afterDraw : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_beforeDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_beforeDraw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->beforeDraw();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_beforeDraw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_isTextureFlipped(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_isTextureFlipped : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTextureFlipped();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_isTextureFlipped : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_getGridSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_getGridSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getGridSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_getGridSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_getStep(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_getStep : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getStep();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_getStep : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_set2DProjection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_set2DProjection : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->set2DProjection();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_set2DProjection : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_setStep(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_setStep : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GridBase_setStep : Error processing arguments\");\n\t\tcobj->setStep(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_setStep : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_setTextureFlipped(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_setTextureFlipped : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GridBase_setTextureFlipped : Error processing arguments\");\n\t\tcobj->setTextureFlipped(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_setTextureFlipped : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_blit(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_blit : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->blit();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_blit : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_setActive(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_setActive : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GridBase_setActive : Error processing arguments\");\n\t\tcobj->setActive(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_setActive : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_getReuseGrid(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_getReuseGrid : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getReuseGrid();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_getReuseGrid : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_initWithSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::GridBase* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_initWithSize : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSize(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSize(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_initWithSize : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_setReuseGrid(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_setReuseGrid : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_GridBase_setReuseGrid : Error processing arguments\");\n\t\tcobj->setReuseGrid(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_setReuseGrid : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_isActive(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_isActive : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isActive();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_isActive : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_reuse(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GridBase* cobj = (cocos2d::GridBase *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_GridBase_reuse : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->reuse();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_reuse : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_GridBase_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::GridBase* ret = cocos2d::GridBase::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GridBase>(cx, (cocos2d::GridBase*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::GridBase* ret = cocos2d::GridBase::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GridBase>(cx, (cocos2d::GridBase*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_GridBase_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_GridBase_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (GridBase)\", obj);\n}\n\nvoid js_register_cocos2dx_GridBase(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_GridBase_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_GridBase_class->name = \"GridBase\";\n\tjsb_cocos2d_GridBase_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_GridBase_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_GridBase_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_GridBase_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_GridBase_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_GridBase_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_GridBase_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_GridBase_class->finalize = js_cocos2d_GridBase_finalize;\n\tjsb_cocos2d_GridBase_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setGridSize\", js_cocos2dx_GridBase_setGridSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"calculateVertexPoints\", js_cocos2dx_GridBase_calculateVertexPoints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"afterDraw\", js_cocos2dx_GridBase_afterDraw, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"beforeDraw\", js_cocos2dx_GridBase_beforeDraw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTextureFlipped\", js_cocos2dx_GridBase_isTextureFlipped, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGridSize\", js_cocos2dx_GridBase_getGridSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStep\", js_cocos2dx_GridBase_getStep, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"set2DProjection\", js_cocos2dx_GridBase_set2DProjection, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStep\", js_cocos2dx_GridBase_setStep, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextureFlipped\", js_cocos2dx_GridBase_setTextureFlipped, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"blit\", js_cocos2dx_GridBase_blit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setActive\", js_cocos2dx_GridBase_setActive, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getReuseGrid\", js_cocos2dx_GridBase_getReuseGrid, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithSize\", js_cocos2dx_GridBase_initWithSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setReuseGrid\", js_cocos2dx_GridBase_setReuseGrid, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isActive\", js_cocos2dx_GridBase_isActive, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reuse\", js_cocos2dx_GridBase_reuse, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_GridBase_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_GridBase_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_GridBase_class,\n\t\tdummy_constructor<cocos2d::GridBase>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"GridBase\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::GridBase> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_GridBase_class;\n\t\tp->proto = jsb_cocos2d_GridBase_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Grid3D_class;\nJSObject *jsb_cocos2d_Grid3D_prototype;\n\nJSBool js_cocos2dx_Grid3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Grid3D>(cx, (cocos2d::Grid3D*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Grid3D>(cx, (cocos2d::Grid3D*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_Grid3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Grid3D_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Grid3D* cobj = new cocos2d::Grid3D();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Grid3D> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Grid3D\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Grid3D_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_GridBase_prototype;\n\nvoid js_cocos2d_Grid3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Grid3D)\", obj);\n}\n\nvoid js_register_cocos2dx_Grid3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Grid3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Grid3D_class->name = \"Grid3D\";\n\tjsb_cocos2d_Grid3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Grid3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Grid3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Grid3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Grid3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Grid3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Grid3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Grid3D_class->finalize = js_cocos2d_Grid3D_finalize;\n\tjsb_cocos2d_Grid3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Grid3D_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Grid3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_GridBase_prototype,\n\t\tjsb_cocos2d_Grid3D_class,\n\t\tjs_cocos2dx_Grid3D_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Grid3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Grid3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Grid3D_class;\n\t\tp->proto = jsb_cocos2d_Grid3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_GridBase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TiledGrid3D_class;\nJSObject *jsb_cocos2d_TiledGrid3D_prototype;\n\nJSBool js_cocos2dx_TiledGrid3D_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TiledGrid3D>(cx, (cocos2d::TiledGrid3D*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TiledGrid3D>(cx, (cocos2d::TiledGrid3D*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TiledGrid3D_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TiledGrid3D_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TiledGrid3D* cobj = new cocos2d::TiledGrid3D();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TiledGrid3D> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TiledGrid3D\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TiledGrid3D_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_GridBase_prototype;\n\nvoid js_cocos2d_TiledGrid3D_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TiledGrid3D)\", obj);\n}\n\nvoid js_register_cocos2dx_TiledGrid3D(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TiledGrid3D_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TiledGrid3D_class->name = \"TiledGrid3D\";\n\tjsb_cocos2d_TiledGrid3D_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TiledGrid3D_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TiledGrid3D_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TiledGrid3D_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TiledGrid3D_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TiledGrid3D_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TiledGrid3D_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TiledGrid3D_class->finalize = js_cocos2d_TiledGrid3D_finalize;\n\tjsb_cocos2d_TiledGrid3D_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TiledGrid3D_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TiledGrid3D_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_GridBase_prototype,\n\t\tjsb_cocos2d_TiledGrid3D_class,\n\t\tjs_cocos2dx_TiledGrid3D_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TiledGrid3D\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TiledGrid3D> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TiledGrid3D_class;\n\t\tp->proto = jsb_cocos2d_TiledGrid3D_prototype;\n\t\tp->parentProto = jsb_cocos2d_GridBase_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Sprite_class;\nJSObject *jsb_cocos2d_Sprite_prototype;\n\nJSBool js_cocos2dx_Sprite_setSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Sprite* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setSpriteFrame : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::SpriteFrame* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setSpriteFrame(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setSpriteFrame(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setSpriteFrame : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Sprite* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setTexture : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setTexture(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setTexture(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setTexture : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_getTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_getTexture : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* ret = cobj->getTexture();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_getTexture : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setFlippedY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setFlippedY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setFlippedY : Error processing arguments\");\n\t\tcobj->setFlippedY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setFlippedY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setFlippedX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setFlippedX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setFlippedX : Error processing arguments\");\n\t\tcobj->setFlippedX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setFlippedX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_getBatchNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::SpriteBatchNode* ret = cobj->getBatchNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteBatchNode>(cx, (cocos2d::SpriteBatchNode*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_getBatchNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_getOffsetPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_getOffsetPosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getOffsetPosition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_getOffsetPosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_removeAllChildrenWithCleanup : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_removeAllChildrenWithCleanup : Error processing arguments\");\n\t\tcobj->removeAllChildrenWithCleanup(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_removeAllChildrenWithCleanup : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_updateQuadVertices(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_updateQuadVertices : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateQuadVertices();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_updateQuadVertices : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_updateTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_updateTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateTransform();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_updateTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setTextureRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Sprite* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setTextureRect : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Rect arg0;\n\t\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg1;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg2;\n\t\t\tok &= jsval_to_ccsize(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setTextureRect(arg0, arg1, arg2);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Rect arg0;\n\t\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setTextureRect(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setTextureRect : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_isFrameDisplayed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_isFrameDisplayed : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_isFrameDisplayed : Error processing arguments\");\n\t\tJSBool ret = cobj->isFrameDisplayed(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_isFrameDisplayed : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_getAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_getAtlasIndex : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getAtlasIndex();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_getAtlasIndex : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setBatchNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteBatchNode* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteBatchNode*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setBatchNode : Error processing arguments\");\n\t\tcobj->setBatchNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setBatchNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setDisplayFrameWithAnimationName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setDisplayFrameWithAnimationName : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tssize_t arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setDisplayFrameWithAnimationName : Error processing arguments\");\n\t\tcobj->setDisplayFrameWithAnimationName(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setDisplayFrameWithAnimationName : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setTextureAtlas : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextureAtlas* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TextureAtlas*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setTextureAtlas : Error processing arguments\");\n\t\tcobj->setTextureAtlas(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_getSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_getSpriteFrame : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::SpriteFrame* ret = cobj->getSpriteFrame();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_getSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_isDirty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_isDirty : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isDirty();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_isDirty : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setAtlasIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setAtlasIndex : Error processing arguments\");\n\t\tcobj->setAtlasIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setAtlasIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setDirty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setDirty : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setDirty : Error processing arguments\");\n\t\tcobj->setDirty(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setDirty : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_isTextureRectRotated(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_isTextureRectRotated : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTextureRectRotated();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_isTextureRectRotated : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_getTextureRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_getTextureRect : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Rect& ret = cobj->getTextureRect();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_getTextureRect : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_getTextureAtlas : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextureAtlas>(cx, (cocos2d::TextureAtlas*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_getTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_isFlippedX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_isFlippedX : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isFlippedX();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_isFlippedX : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_isFlippedY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_isFlippedY : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isFlippedY();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_isFlippedY : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_setVertexRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Sprite* cobj = (cocos2d::Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Sprite_setVertexRect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_setVertexRect : Error processing arguments\");\n\t\tcobj->setVertexRect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_setVertexRect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* ret = cocos2d::Sprite::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Sprite* ret = cocos2d::Sprite::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* ret = cocos2d::Sprite::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_createWithTexture : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Sprite_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_createWithSpriteFrameName : Error processing arguments\");\n\t\tcocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_createWithSpriteFrameName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Sprite_createWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Sprite_createWithSpriteFrame : Error processing arguments\");\n\t\tcocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Sprite_createWithSpriteFrame : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_Sprite_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Sprite)\", obj);\n}\n\nstatic JSBool js_cocos2d_Sprite_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::Sprite *nobj = cocos2d::Sprite::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Sprite\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_Sprite(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Sprite_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Sprite_class->name = \"Sprite\";\n\tjsb_cocos2d_Sprite_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Sprite_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Sprite_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Sprite_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Sprite_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Sprite_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Sprite_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Sprite_class->finalize = js_cocos2d_Sprite_finalize;\n\tjsb_cocos2d_Sprite_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setSpriteFrame\", js_cocos2dx_Sprite_setSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTexture\", js_cocos2dx_Sprite_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTexture\", js_cocos2dx_Sprite_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFlippedY\", js_cocos2dx_Sprite_setFlippedY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFlippedX\", js_cocos2dx_Sprite_setFlippedX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBatchNode\", js_cocos2dx_Sprite_getBatchNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOffsetPosition\", js_cocos2dx_Sprite_getOffsetPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllChildrenWithCleanup\", js_cocos2dx_Sprite_removeAllChildrenWithCleanup, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateQuadVertices\", js_cocos2dx_Sprite_updateQuadVertices, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateTransform\", js_cocos2dx_Sprite_updateTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextureRect\", js_cocos2dx_Sprite_setTextureRect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFrameDisplayed\", js_cocos2dx_Sprite_isFrameDisplayed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAtlasIndex\", js_cocos2dx_Sprite_getAtlasIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBatchNode\", js_cocos2dx_Sprite_setBatchNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDisplayFrameWithAnimationName\", js_cocos2dx_Sprite_setDisplayFrameWithAnimationName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextureAtlas\", js_cocos2dx_Sprite_setTextureAtlas, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpriteFrame\", js_cocos2dx_Sprite_getSpriteFrame, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isDirty\", js_cocos2dx_Sprite_isDirty, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAtlasIndex\", js_cocos2dx_Sprite_setAtlasIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDirty\", js_cocos2dx_Sprite_setDirty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTextureRectRotated\", js_cocos2dx_Sprite_isTextureRectRotated, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureRect\", js_cocos2dx_Sprite_getTextureRect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureAtlas\", js_cocos2dx_Sprite_getTextureAtlas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFlippedX\", js_cocos2dx_Sprite_isFlippedX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFlippedY\", js_cocos2dx_Sprite_isFlippedY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVertexRect\", js_cocos2dx_Sprite_setVertexRect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_Sprite_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Sprite_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTexture\", js_cocos2dx_Sprite_createWithTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithSpriteFrameName\", js_cocos2dx_Sprite_createWithSpriteFrameName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithSpriteFrame\", js_cocos2dx_Sprite_createWithSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Sprite_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_Sprite_class,\n\t\tdummy_constructor<cocos2d::Sprite>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Sprite\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Sprite> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Sprite_class;\n\t\tp->proto = jsb_cocos2d_Sprite_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_LabelTTF_class;\nJSObject *jsb_cocos2d_LabelTTF_prototype;\n\nJSBool js_cocos2dx_LabelTTF_enableShadow(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_enableShadow : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Size arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_enableShadow : Error processing arguments\");\n\t\tcobj->enableShadow(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tcocos2d::Size arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tJSBool arg3;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToBoolean(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_enableShadow : Error processing arguments\");\n\t\tcobj->enableShadow(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_enableShadow : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setDimensions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setDimensions : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setDimensions : Error processing arguments\");\n\t\tcobj->setDimensions(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setDimensions : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_getFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_getFontSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getFontSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_getFontSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_getString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_getString : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getString();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_getString : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setTextDefinition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setTextDefinition : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::FontDefinition arg0;\n\t\tok &= jsval_to_FontDefinition(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setTextDefinition : Error processing arguments\");\n\t\tcobj->setTextDefinition(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setTextDefinition : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setFontName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setFontName : Error processing arguments\");\n\t\tcobj->setFontName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setFontName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_getHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_getHorizontalAlignment : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getHorizontalAlignment();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_getHorizontalAlignment : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_initWithStringAndTextDefinition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_initWithStringAndTextDefinition : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocos2d::FontDefinition arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_FontDefinition(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_initWithStringAndTextDefinition : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithStringAndTextDefinition(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_initWithStringAndTextDefinition : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setString : Error processing arguments\");\n\t\tcobj->setString(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_initWithString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::LabelTTF* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_initWithString : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg3;\n\t\t\tok &= jsval_to_ccsize(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 6) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg3;\n\t\t\tok &= jsval_to_ccsize(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextVAlignment arg5;\n\t\t\tok &= jsval_to_int32(cx, argv[5], (int32_t *)&arg5);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_initWithString : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setFontFillColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setFontFillColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setFontFillColor : Error processing arguments\");\n\t\tcobj->setFontFillColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Color3B arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setFontFillColor : Error processing arguments\");\n\t\tcobj->setFontFillColor(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setFontFillColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_enableStroke(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_enableStroke : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Color3B arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_enableStroke : Error processing arguments\");\n\t\tcobj->enableStroke(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tcocos2d::Color3B arg0;\n\t\tdouble arg1;\n\t\tJSBool arg2;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_enableStroke : Error processing arguments\");\n\t\tcobj->enableStroke(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_enableStroke : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_getDimensions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_getDimensions : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getDimensions();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_getDimensions : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setVerticalAlignment : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextVAlignment arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setVerticalAlignment : Error processing arguments\");\n\t\tcobj->setVerticalAlignment(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setVerticalAlignment : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setFontSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setFontSize : Error processing arguments\");\n\t\tcobj->setFontSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setFontSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_getVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_getVerticalAlignment : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getVerticalAlignment();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_getVerticalAlignment : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_getTextDefinition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_getTextDefinition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::FontDefinition ret = cobj->getTextDefinition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = FontDefinition_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_getTextDefinition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_getFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_getFontName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getFontName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_getFontName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_setHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setHorizontalAlignment : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextHAlignment arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_setHorizontalAlignment : Error processing arguments\");\n\t\tcobj->setHorizontalAlignment(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_setHorizontalAlignment : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_disableShadow(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_disableShadow : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->disableShadow();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_disableShadow : Error processing arguments\");\n\t\tcobj->disableShadow(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_disableShadow : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_disableStroke(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelTTF* cobj = (cocos2d::LabelTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_disableStroke : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->disableStroke();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_disableStroke : Error processing arguments\");\n\t\tcobj->disableStroke(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_disableStroke : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg3;\n\t\t\tok &= jsval_to_ccsize(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelTTF>(cx, (cocos2d::LabelTTF*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelTTF>(cx, (cocos2d::LabelTTF*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 6) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg3;\n\t\t\tok &= jsval_to_ccsize(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg4;\n\t\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextVAlignment arg5;\n\t\t\tok &= jsval_to_int32(cx, argv[5], (int32_t *)&arg5);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelTTF>(cx, (cocos2d::LabelTTF*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::LabelTTF* ret = cocos2d::LabelTTF::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelTTF>(cx, (cocos2d::LabelTTF*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelTTF_createWithFontDefinition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocos2d::FontDefinition arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_FontDefinition(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelTTF_createWithFontDefinition : Error processing arguments\");\n\t\tcocos2d::LabelTTF* ret = cocos2d::LabelTTF::createWithFontDefinition(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelTTF>(cx, (cocos2d::LabelTTF*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_createWithFontDefinition : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_LabelTTF_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::LabelTTF* cobj = new cocos2d::LabelTTF();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::LabelTTF> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::LabelTTF\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelTTF_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Sprite_prototype;\n\nvoid js_cocos2d_LabelTTF_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LabelTTF)\", obj);\n}\n\nvoid js_register_cocos2dx_LabelTTF(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_LabelTTF_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_LabelTTF_class->name = \"LabelTTF\";\n\tjsb_cocos2d_LabelTTF_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_LabelTTF_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_LabelTTF_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_LabelTTF_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_LabelTTF_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_LabelTTF_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_LabelTTF_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_LabelTTF_class->finalize = js_cocos2d_LabelTTF_finalize;\n\tjsb_cocos2d_LabelTTF_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"enableShadow\", js_cocos2dx_LabelTTF_enableShadow, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDimensions\", js_cocos2dx_LabelTTF_setDimensions, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFontSize\", js_cocos2dx_LabelTTF_getFontSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getString\", js_cocos2dx_LabelTTF_getString, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextDefinition\", js_cocos2dx_LabelTTF_setTextDefinition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontName\", js_cocos2dx_LabelTTF_setFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getHorizontalAlignment\", js_cocos2dx_LabelTTF_getHorizontalAlignment, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithStringAndTextDefinition\", js_cocos2dx_LabelTTF_initWithStringAndTextDefinition, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setString\", js_cocos2dx_LabelTTF_setString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithString\", js_cocos2dx_LabelTTF_initWithString, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_LabelTTF_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontFillColor\", js_cocos2dx_LabelTTF_setFontFillColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"enableStroke\", js_cocos2dx_LabelTTF_enableStroke, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDimensions\", js_cocos2dx_LabelTTF_getDimensions, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVerticalAlignment\", js_cocos2dx_LabelTTF_setVerticalAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontSize\", js_cocos2dx_LabelTTF_setFontSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVerticalAlignment\", js_cocos2dx_LabelTTF_getVerticalAlignment, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextDefinition\", js_cocos2dx_LabelTTF_getTextDefinition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFontName\", js_cocos2dx_LabelTTF_getFontName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setHorizontalAlignment\", js_cocos2dx_LabelTTF_setHorizontalAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"disableShadow\", js_cocos2dx_LabelTTF_disableShadow, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"disableStroke\", js_cocos2dx_LabelTTF_disableStroke, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_LabelTTF_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithFontDefinition\", js_cocos2dx_LabelTTF_createWithFontDefinition, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_LabelTTF_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Sprite_prototype,\n\t\tjsb_cocos2d_LabelTTF_class,\n\t\tjs_cocos2dx_LabelTTF_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LabelTTF\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::LabelTTF> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_LabelTTF_class;\n\t\tp->proto = jsb_cocos2d_LabelTTF_prototype;\n\t\tp->parentProto = jsb_cocos2d_Sprite_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SpriteBatchNode_class;\nJSObject *jsb_cocos2d_SpriteBatchNode_prototype;\n\nJSBool js_cocos2dx_SpriteBatchNode_appendChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_appendChild : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_appendChild : Error processing arguments\");\n\t\tcobj->appendChild(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_appendChild : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_reorderBatch(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_reorderBatch : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_reorderBatch : Error processing arguments\");\n\t\tcobj->reorderBatch(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_reorderBatch : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_initWithTexture : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tssize_t arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_initWithTexture : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithTexture(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_initWithTexture : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild : Error processing arguments\");\n\t\tssize_t ret = cobj->lowestAtlasIndexInChild(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_atlasIndexForChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_atlasIndexForChild : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Sprite* arg0;\n\t\tint arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_atlasIndexForChild : Error processing arguments\");\n\t\tssize_t ret = cobj->atlasIndexForChild(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_atlasIndexForChild : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_setTextureAtlas : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextureAtlas* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TextureAtlas*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_setTextureAtlas : Error processing arguments\");\n\t\tcobj->setTextureAtlas(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_setTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_rebuildIndexInOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_rebuildIndexInOrder : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Sprite* arg0;\n\t\tssize_t arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_rebuildIndexInOrder : Error processing arguments\");\n\t\tssize_t ret = cobj->rebuildIndexInOrder(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_rebuildIndexInOrder : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_increaseAtlasCapacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_increaseAtlasCapacity : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->increaseAtlasCapacity();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_increaseAtlasCapacity : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_getTextureAtlas : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextureAtlas>(cx, (cocos2d::TextureAtlas*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_getTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::SpriteBatchNode* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_init : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tJSBool ret = cobj->init();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tssize_t arg1;\n\t\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_init : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_setTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_setTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_setTexture : Error processing arguments\");\n\t\tcobj->setTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_setTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_getTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_getTexture : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* ret = cobj->getTexture();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_getTexture : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild : Error processing arguments\");\n\t\tssize_t ret = cobj->highestAtlasIndexInChild(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_removeChildAtIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_removeChildAtIndex : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tssize_t arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_removeChildAtIndex : Error processing arguments\");\n\t\tcobj->removeChildAtIndex(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_removeChildAtIndex : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas : Error processing arguments\");\n\t\tcobj->removeSpriteFromAtlas(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_create : Error processing arguments\");\n\t\tcocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteBatchNode>(cx, (cocos2d::SpriteBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tssize_t arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_create : Error processing arguments\");\n\t\tcocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteBatchNode>(cx, (cocos2d::SpriteBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_createWithTexture : Error processing arguments\");\n\t\tcocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteBatchNode>(cx, (cocos2d::SpriteBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tssize_t arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_createWithTexture : Error processing arguments\");\n\t\tcocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteBatchNode>(cx, (cocos2d::SpriteBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_createWithTexture : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_SpriteBatchNode_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::SpriteBatchNode* cobj = new cocos2d::SpriteBatchNode();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::SpriteBatchNode> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::SpriteBatchNode\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_SpriteBatchNode_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SpriteBatchNode)\", obj);\n}\n\nvoid js_register_cocos2dx_SpriteBatchNode(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SpriteBatchNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SpriteBatchNode_class->name = \"SpriteBatchNode\";\n\tjsb_cocos2d_SpriteBatchNode_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SpriteBatchNode_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SpriteBatchNode_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SpriteBatchNode_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SpriteBatchNode_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SpriteBatchNode_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SpriteBatchNode_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SpriteBatchNode_class->finalize = js_cocos2d_SpriteBatchNode_finalize;\n\tjsb_cocos2d_SpriteBatchNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"appendChild\", js_cocos2dx_SpriteBatchNode_appendChild, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reorderBatch\", js_cocos2dx_SpriteBatchNode_reorderBatch, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTexture\", js_cocos2dx_SpriteBatchNode_initWithTexture, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"lowestAtlasIndexInChild\", js_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"atlasIndexForChild\", js_cocos2dx_SpriteBatchNode_atlasIndexForChild, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextureAtlas\", js_cocos2dx_SpriteBatchNode_setTextureAtlas, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"rebuildIndexInOrder\", js_cocos2dx_SpriteBatchNode_rebuildIndexInOrder, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"increaseAtlasCapacity\", js_cocos2dx_SpriteBatchNode_increaseAtlasCapacity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureAtlas\", js_cocos2dx_SpriteBatchNode_getTextureAtlas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_SpriteBatchNode_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTexture\", js_cocos2dx_SpriteBatchNode_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTexture\", js_cocos2dx_SpriteBatchNode_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"highestAtlasIndexInChild\", js_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeChildAtIndex\", js_cocos2dx_SpriteBatchNode_removeChildAtIndex, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeSpriteFromAtlas\", js_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_SpriteBatchNode_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTexture\", js_cocos2dx_SpriteBatchNode_createWithTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_SpriteBatchNode_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_SpriteBatchNode_class,\n\t\tjs_cocos2dx_SpriteBatchNode_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SpriteBatchNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SpriteBatchNode> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SpriteBatchNode_class;\n\t\tp->proto = jsb_cocos2d_SpriteBatchNode_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_LabelBMFont_class;\nJSObject *jsb_cocos2d_LabelBMFont_prototype;\n\nJSBool js_cocos2dx_LabelBMFont_setLineBreakWithoutSpace(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setLineBreakWithoutSpace : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setLineBreakWithoutSpace : Error processing arguments\");\n\t\tcobj->setLineBreakWithoutSpace(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setLineBreakWithoutSpace : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setScaleY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setScaleY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setScaleY : Error processing arguments\");\n\t\tcobj->setScaleY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setScaleY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setScaleX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setScaleX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setScaleX : Error processing arguments\");\n\t\tcobj->setScaleX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setScaleX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_isOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_isOpacityModifyRGB : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isOpacityModifyRGB();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_isOpacityModifyRGB : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_createFontChars(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_createFontChars : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->createFontChars();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_createFontChars : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_getString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_getString : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getString();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_getString : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::LabelBMFont* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setString : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg1;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setString(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setString(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setString : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_initWithString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_initWithString : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_initWithString : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithString(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tdouble arg2;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_initWithString : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tdouble arg2;\n\t\tcocos2d::TextHAlignment arg3;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_initWithString : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 5) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tdouble arg2;\n\t\tcocos2d::TextHAlignment arg3;\n\t\tcocos2d::Point arg4;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tok &= jsval_to_ccpoint(cx, argv[4], &arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_initWithString : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_initWithString : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setCString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setCString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setCString : Error processing arguments\");\n\t\tcobj->setCString(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setCString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setScale : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setScale : Error processing arguments\");\n\t\tcobj->setScale(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setScale : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setOpacityModifyRGB : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setOpacityModifyRGB : Error processing arguments\");\n\t\tcobj->setOpacityModifyRGB(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setOpacityModifyRGB : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setFntFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setFntFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setFntFile : Error processing arguments\");\n\t\tcobj->setFntFile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setFntFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_getFntFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_getFntFile : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getFntFile();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_getFntFile : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_updateLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_updateLabel : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateLabel();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_updateLabel : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setAlignment : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextHAlignment arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setAlignment : Error processing arguments\");\n\t\tcobj->setAlignment(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setAlignment : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_setWidth(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LabelBMFont* cobj = (cocos2d::LabelBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setWidth : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LabelBMFont_setWidth : Error processing arguments\");\n\t\tcobj->setWidth(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_setWidth : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_purgeCachedData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::LabelBMFont::purgeCachedData();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_purgeCachedData : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelBMFont>(cx, (cocos2d::LabelBMFont*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg4;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelBMFont>(cx, (cocos2d::LabelBMFont*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelBMFont>(cx, (cocos2d::LabelBMFont*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelBMFont>(cx, (cocos2d::LabelBMFont*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelBMFont>(cx, (cocos2d::LabelBMFont*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LabelBMFont_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::LabelBMFont* cobj = new cocos2d::LabelBMFont();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::LabelBMFont> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::LabelBMFont\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LabelBMFont_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_SpriteBatchNode_prototype;\n\nvoid js_cocos2d_LabelBMFont_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LabelBMFont)\", obj);\n}\n\nvoid js_register_cocos2dx_LabelBMFont(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_LabelBMFont_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_LabelBMFont_class->name = \"LabelBMFont\";\n\tjsb_cocos2d_LabelBMFont_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_LabelBMFont_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_LabelBMFont_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_LabelBMFont_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_LabelBMFont_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_LabelBMFont_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_LabelBMFont_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_LabelBMFont_class->finalize = js_cocos2d_LabelBMFont_finalize;\n\tjsb_cocos2d_LabelBMFont_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setLineBreakWithoutSpace\", js_cocos2dx_LabelBMFont_setLineBreakWithoutSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScaleY\", js_cocos2dx_LabelBMFont_setScaleY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScaleX\", js_cocos2dx_LabelBMFont_setScaleX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isOpacityModifyRGB\", js_cocos2dx_LabelBMFont_isOpacityModifyRGB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createFontChars\", js_cocos2dx_LabelBMFont_createFontChars, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getString\", js_cocos2dx_LabelBMFont_getString, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setString\", js_cocos2dx_LabelBMFont_setString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithString\", js_cocos2dx_LabelBMFont_initWithString, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCString\", js_cocos2dx_LabelBMFont_setCString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScale\", js_cocos2dx_LabelBMFont_setScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOpacityModifyRGB\", js_cocos2dx_LabelBMFont_setOpacityModifyRGB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFntFile\", js_cocos2dx_LabelBMFont_setFntFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_LabelBMFont_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFntFile\", js_cocos2dx_LabelBMFont_getFntFile, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateLabel\", js_cocos2dx_LabelBMFont_updateLabel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAlignment\", js_cocos2dx_LabelBMFont_setAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setWidth\", js_cocos2dx_LabelBMFont_setWidth, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"purgeCachedData\", js_cocos2dx_LabelBMFont_purgeCachedData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"create\", js_cocos2dx_LabelBMFont_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_LabelBMFont_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_SpriteBatchNode_prototype,\n\t\tjsb_cocos2d_LabelBMFont_class,\n\t\tjs_cocos2dx_LabelBMFont_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LabelBMFont\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::LabelBMFont> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_LabelBMFont_class;\n\t\tp->proto = jsb_cocos2d_LabelBMFont_prototype;\n\t\tp->parentProto = jsb_cocos2d_SpriteBatchNode_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Label_class;\nJSObject *jsb_cocos2d_Label_prototype;\n\nJSBool js_cocos2dx_Label_getString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getString : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getString();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getString : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_assignNewUTF16String(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_assignNewUTF16String : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned short* arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR unsigned short*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_assignNewUTF16String : Error processing arguments\");\n\t\tcobj->assignNewUTF16String(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_assignNewUTF16String : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_setLabelEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setLabelEffect : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::LabelEffect arg0;\n\t\tcocos2d::Color3B arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_cccolor3b(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_setLabelEffect : Error processing arguments\");\n\t\tcobj->setLabelEffect(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_setLabelEffect : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getCommonLineHeight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getCommonLineHeight : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getCommonLineHeight();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getCommonLineHeight : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_breakLineWithoutSpace(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_breakLineWithoutSpace : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->breakLineWithoutSpace();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_breakLineWithoutSpace : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_setWidth(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setWidth : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_setWidth : Error processing arguments\");\n\t\tcobj->setWidth(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_setWidth : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getMaxLineWidth(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getMaxLineWidth : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMaxLineWidth();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getMaxLineWidth : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getScaleY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getScaleY : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getScaleY();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getScaleY : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getScaleX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getScaleX : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getScaleX();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getScaleX : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_setString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_setString : Error processing arguments\");\n\t\tcobj->setString(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_setString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getKernings(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getKernings : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint* ret = cobj->getKernings();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR int*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getKernings : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_setBMFontFilePath(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setBMFontFilePath : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_setBMFontFilePath : Error processing arguments\");\n\t\tJSBool ret = cobj->setBMFontFilePath(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_setBMFontFilePath : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_recordPlaceholderInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_recordPlaceholderInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_recordPlaceholderInfo : Error processing arguments\");\n\t\tJSBool ret = cobj->recordPlaceholderInfo(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_recordPlaceholderInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getFontAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getFontAtlas : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::FontAtlas* ret = cobj->getFontAtlas();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FontAtlas>(cx, (cocos2d::FontAtlas*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getFontAtlas : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_setLineBreakWithoutSpace(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setLineBreakWithoutSpace : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_setLineBreakWithoutSpace : Error processing arguments\");\n\t\tcobj->setLineBreakWithoutSpace(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_setLineBreakWithoutSpace : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getStringNumLines(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getStringNumLines : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getStringNumLines();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getStringNumLines : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getUTF16String(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getUTF16String : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned short* ret = cobj->getUTF16String();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR unsigned short*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getUTF16String : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getStringLenght(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getStringLenght : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getStringLenght();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getStringLenght : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_onDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_onDraw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->onDraw();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_onDraw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_setCharMap(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::Label* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setCharMap : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->setCharMap(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->setCharMap(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->setCharMap(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_setCharMap : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getLetter(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getLetter : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_getLetter : Error processing arguments\");\n\t\tcocos2d::Sprite* ret = cobj->getLetter(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getLetter : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_getTextAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_getTextAlignment : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getTextAlignment();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_getTextAlignment : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_setAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setAlignment : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextHAlignment arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_setAlignment : Error processing arguments\");\n\t\tcobj->setAlignment(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_setAlignment : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_recordLetterInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_recordLetterInfo : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Point arg0;\n\t\tunsigned short arg1;\n\t\tint arg2;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ushort(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_recordLetterInfo : Error processing arguments\");\n\t\tJSBool ret = cobj->recordLetterInfo(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Label_recordLetterInfo : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_createWithBMFont : Error processing arguments\");\n\t\tcocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tcocos2d::TextHAlignment arg2;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_createWithBMFont : Error processing arguments\");\n\t\tcocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tcocos2d::TextHAlignment arg2;\n\t\tint arg3;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_createWithBMFont : Error processing arguments\");\n\t\tcocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Label_createWithBMFont : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Label_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Label* ret = cocos2d::Label::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Label_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Label_createWithCharMap(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocos2d::Texture2D* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg3;\n\t\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_Label_createWithCharMap : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_SpriteBatchNode_prototype;\n\nvoid js_cocos2d_Label_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Label)\", obj);\n}\n\nvoid js_register_cocos2dx_Label(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Label_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Label_class->name = \"Label\";\n\tjsb_cocos2d_Label_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Label_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Label_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Label_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Label_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Label_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Label_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Label_class->finalize = js_cocos2d_Label_finalize;\n\tjsb_cocos2d_Label_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getString\", js_cocos2dx_Label_getString, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"assignNewUTF16String\", js_cocos2dx_Label_assignNewUTF16String, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLabelEffect\", js_cocos2dx_Label_setLabelEffect, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCommonLineHeight\", js_cocos2dx_Label_getCommonLineHeight, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"breakLineWithoutSpace\", js_cocos2dx_Label_breakLineWithoutSpace, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setWidth\", js_cocos2dx_Label_setWidth, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaxLineWidth\", js_cocos2dx_Label_getMaxLineWidth, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScaleY\", js_cocos2dx_Label_getScaleY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScaleX\", js_cocos2dx_Label_getScaleX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setString\", js_cocos2dx_Label_setString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getKernings\", js_cocos2dx_Label_getKernings, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBMFontFilePath\", js_cocos2dx_Label_setBMFontFilePath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"recordPlaceholderInfo\", js_cocos2dx_Label_recordPlaceholderInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFontAtlas\", js_cocos2dx_Label_getFontAtlas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLineBreakWithoutSpace\", js_cocos2dx_Label_setLineBreakWithoutSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringNumLines\", js_cocos2dx_Label_getStringNumLines, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getUTF16String\", js_cocos2dx_Label_getUTF16String, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringLenght\", js_cocos2dx_Label_getStringLenght, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"onDraw\", js_cocos2dx_Label_onDraw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCharMap\", js_cocos2dx_Label_setCharMap, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLetter\", js_cocos2dx_Label_getLetter, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextAlignment\", js_cocos2dx_Label_getTextAlignment, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAlignment\", js_cocos2dx_Label_setAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"recordLetterInfo\", js_cocos2dx_Label_recordLetterInfo, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"createWithBMFont\", js_cocos2dx_Label_createWithBMFont, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"create\", js_cocos2dx_Label_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithCharMap\", js_cocos2dx_Label_createWithCharMap, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Label_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_SpriteBatchNode_prototype,\n\t\tjsb_cocos2d_Label_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Label\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Label> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Label_class;\n\t\tp->proto = jsb_cocos2d_Label_prototype;\n\t\tp->parentProto = jsb_cocos2d_SpriteBatchNode_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Layer_class;\nJSObject *jsb_cocos2d_Layer_prototype;\n\nJSBool js_cocos2dx_Layer_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Layer* ret = cocos2d::Layer::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Layer>(cx, (cocos2d::Layer*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Layer_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_Layer_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Layer)\", obj);\n}\n\nstatic JSBool js_cocos2d_Layer_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::Layer *nobj = cocos2d::Layer::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Layer\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_Layer(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Layer_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Layer_class->name = \"Layer\";\n\tjsb_cocos2d_Layer_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Layer_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Layer_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Layer_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Layer_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Layer_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Layer_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Layer_class->finalize = js_cocos2d_Layer_finalize;\n\tjsb_cocos2d_Layer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FN(\"ctor\", js_cocos2d_Layer_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Layer_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Layer_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_Layer_class,\n\t\tdummy_constructor<cocos2d::Layer>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Layer\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Layer> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Layer_class;\n\t\tp->proto = jsb_cocos2d_Layer_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d___LayerRGBA_class;\nJSObject *jsb_cocos2d___LayerRGBA_prototype;\n\nJSBool js_cocos2dx___LayerRGBA_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::__LayerRGBA* ret = cocos2d::__LayerRGBA::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::__LayerRGBA>(cx, (cocos2d::__LayerRGBA*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx___LayerRGBA_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Layer_prototype;\n\nvoid js_cocos2d___LayerRGBA_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (__LayerRGBA)\", obj);\n}\n\nvoid js_register_cocos2dx___LayerRGBA(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d___LayerRGBA_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d___LayerRGBA_class->name = \"LayerRGBA\";\n\tjsb_cocos2d___LayerRGBA_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d___LayerRGBA_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d___LayerRGBA_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d___LayerRGBA_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d___LayerRGBA_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d___LayerRGBA_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d___LayerRGBA_class->convert = JS_ConvertStub;\n\tjsb_cocos2d___LayerRGBA_class->finalize = js_cocos2d___LayerRGBA_finalize;\n\tjsb_cocos2d___LayerRGBA_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx___LayerRGBA_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d___LayerRGBA_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Layer_prototype,\n\t\tjsb_cocos2d___LayerRGBA_class,\n\t\tdummy_constructor<cocos2d::__LayerRGBA>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LayerRGBA\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::__LayerRGBA> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d___LayerRGBA_class;\n\t\tp->proto = jsb_cocos2d___LayerRGBA_prototype;\n\t\tp->parentProto = jsb_cocos2d_Layer_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_LayerColor_class;\nJSObject *jsb_cocos2d_LayerColor_prototype;\n\nJSBool js_cocos2dx_LayerColor_changeWidthAndHeight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerColor* cobj = (cocos2d::LayerColor *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerColor_changeWidthAndHeight : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerColor_changeWidthAndHeight : Error processing arguments\");\n\t\tcobj->changeWidthAndHeight(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerColor_changeWidthAndHeight : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerColor_onDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerColor* cobj = (cocos2d::LayerColor *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerColor_onDraw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->onDraw();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerColor_onDraw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerColor_changeWidth(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerColor* cobj = (cocos2d::LayerColor *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerColor_changeWidth : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerColor_changeWidth : Error processing arguments\");\n\t\tcobj->changeWidth(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerColor_changeWidth : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerColor_changeHeight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerColor* cobj = (cocos2d::LayerColor *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerColor_changeHeight : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerColor_changeHeight : Error processing arguments\");\n\t\tcobj->changeHeight(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerColor_changeHeight : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerColor_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Color4B arg0;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LayerColor* ret = cocos2d::LayerColor::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LayerColor>(cx, (cocos2d::LayerColor*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::LayerColor* ret = cocos2d::LayerColor::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LayerColor>(cx, (cocos2d::LayerColor*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Color4B arg0;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LayerColor* ret = cocos2d::LayerColor::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LayerColor>(cx, (cocos2d::LayerColor*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_LayerColor_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_Layer_prototype;\n\nvoid js_cocos2d_LayerColor_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LayerColor)\", obj);\n}\n\nstatic JSBool js_cocos2d_LayerColor_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::LayerColor *nobj = cocos2d::LayerColor::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::LayerColor\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_LayerColor(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_LayerColor_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_LayerColor_class->name = \"LayerColor\";\n\tjsb_cocos2d_LayerColor_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_LayerColor_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_LayerColor_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_LayerColor_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_LayerColor_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_LayerColor_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_LayerColor_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_LayerColor_class->finalize = js_cocos2d_LayerColor_finalize;\n\tjsb_cocos2d_LayerColor_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"changeWidthAndHeight\", js_cocos2dx_LayerColor_changeWidthAndHeight, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"onDraw\", js_cocos2dx_LayerColor_onDraw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"changeWidth\", js_cocos2dx_LayerColor_changeWidth, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"changeHeight\", js_cocos2dx_LayerColor_changeHeight, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_LayerColor_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_LayerColor_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_LayerColor_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Layer_prototype,\n\t\tjsb_cocos2d_LayerColor_class,\n\t\tdummy_constructor<cocos2d::LayerColor>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LayerColor\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::LayerColor> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_LayerColor_class;\n\t\tp->proto = jsb_cocos2d_LayerColor_prototype;\n\t\tp->parentProto = jsb_cocos2d_Layer_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_LayerGradient_class;\nJSObject *jsb_cocos2d_LayerGradient_prototype;\n\nJSBool js_cocos2dx_LayerGradient_getStartColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_getStartColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getStartColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_getStartColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_isCompressedInterpolation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_isCompressedInterpolation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isCompressedInterpolation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_isCompressedInterpolation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_getStartOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_getStartOpacity : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tuint16_t ret = cobj->getStartOpacity();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_getStartOpacity : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_setVector(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setVector : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setVector : Error processing arguments\");\n\t\tcobj->setVector(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_setVector : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_setStartOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setStartOpacity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tuint16_t arg0;\n\t\tok &= jsval_to_uint16(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setStartOpacity : Error processing arguments\");\n\t\tcobj->setStartOpacity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_setStartOpacity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_setCompressedInterpolation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setCompressedInterpolation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setCompressedInterpolation : Error processing arguments\");\n\t\tcobj->setCompressedInterpolation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_setCompressedInterpolation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_setEndOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setEndOpacity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tuint16_t arg0;\n\t\tok &= jsval_to_uint16(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setEndOpacity : Error processing arguments\");\n\t\tcobj->setEndOpacity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_setEndOpacity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_getVector(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_getVector : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getVector();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_getVector : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_initWithColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::LayerGradient* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_initWithColor : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Color4B arg0;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color4B arg1;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithColor(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tJSBool ret = cobj->init();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Color4B arg0;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color4B arg1;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg2;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithColor(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_initWithColor : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_setEndColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setEndColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setEndColor : Error processing arguments\");\n\t\tcobj->setEndColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_setEndColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_getEndColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_getEndColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getEndColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_getEndColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_getEndOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_getEndOpacity : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tuint16_t ret = cobj->getEndOpacity();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_getEndOpacity : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_setStartColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerGradient* cobj = (cocos2d::LayerGradient *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setStartColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerGradient_setStartColor : Error processing arguments\");\n\t\tcobj->setStartColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_setStartColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerGradient_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Color4B arg0;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color4B arg1;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LayerGradient>(cx, (cocos2d::LayerGradient*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::LayerGradient* ret = cocos2d::LayerGradient::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LayerGradient>(cx, (cocos2d::LayerGradient*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Color4B arg0;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color4B arg1;\n\t\t\tok &= jsval_to_cccolor4b(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg2;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LayerGradient>(cx, (cocos2d::LayerGradient*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_LayerGradient_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_LayerColor_prototype;\n\nvoid js_cocos2d_LayerGradient_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LayerGradient)\", obj);\n}\n\nstatic JSBool js_cocos2d_LayerGradient_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::LayerGradient *nobj = cocos2d::LayerGradient::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::LayerGradient\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_LayerGradient(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_LayerGradient_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_LayerGradient_class->name = \"LayerGradient\";\n\tjsb_cocos2d_LayerGradient_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_LayerGradient_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_LayerGradient_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_LayerGradient_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_LayerGradient_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_LayerGradient_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_LayerGradient_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_LayerGradient_class->finalize = js_cocos2d_LayerGradient_finalize;\n\tjsb_cocos2d_LayerGradient_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getStartColor\", js_cocos2dx_LayerGradient_getStartColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isCompressedInterpolation\", js_cocos2dx_LayerGradient_isCompressedInterpolation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartOpacity\", js_cocos2dx_LayerGradient_getStartOpacity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVector\", js_cocos2dx_LayerGradient_setVector, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartOpacity\", js_cocos2dx_LayerGradient_setStartOpacity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCompressedInterpolation\", js_cocos2dx_LayerGradient_setCompressedInterpolation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndOpacity\", js_cocos2dx_LayerGradient_setEndOpacity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVector\", js_cocos2dx_LayerGradient_getVector, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_LayerGradient_initWithColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndColor\", js_cocos2dx_LayerGradient_setEndColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndColor\", js_cocos2dx_LayerGradient_getEndColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndOpacity\", js_cocos2dx_LayerGradient_getEndOpacity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartColor\", js_cocos2dx_LayerGradient_setStartColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_LayerGradient_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_LayerGradient_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_LayerGradient_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_LayerColor_prototype,\n\t\tjsb_cocos2d_LayerGradient_class,\n\t\tdummy_constructor<cocos2d::LayerGradient>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LayerGradient\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::LayerGradient> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_LayerGradient_class;\n\t\tp->proto = jsb_cocos2d_LayerGradient_prototype;\n\t\tp->parentProto = jsb_cocos2d_LayerColor_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_LayerMultiplex_class;\nJSObject *jsb_cocos2d_LayerMultiplex_prototype;\n\nJSBool js_cocos2dx_LayerMultiplex_switchToAndReleaseMe(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerMultiplex* cobj = (cocos2d::LayerMultiplex *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerMultiplex_switchToAndReleaseMe : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerMultiplex_switchToAndReleaseMe : Error processing arguments\");\n\t\tcobj->switchToAndReleaseMe(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerMultiplex_switchToAndReleaseMe : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerMultiplex_addLayer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerMultiplex* cobj = (cocos2d::LayerMultiplex *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerMultiplex_addLayer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Layer* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Layer*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerMultiplex_addLayer : Error processing arguments\");\n\t\tcobj->addLayer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerMultiplex_addLayer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_LayerMultiplex_switchTo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::LayerMultiplex* cobj = (cocos2d::LayerMultiplex *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_LayerMultiplex_switchTo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_LayerMultiplex_switchTo : Error processing arguments\");\n\t\tcobj->switchTo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_LayerMultiplex_switchTo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_Layer_prototype;\n\nvoid js_cocos2d_LayerMultiplex_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LayerMultiplex)\", obj);\n}\n\nstatic JSBool js_cocos2d_LayerMultiplex_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::LayerMultiplex *nobj = cocos2d::LayerMultiplex::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::LayerMultiplex\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_LayerMultiplex(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_LayerMultiplex_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_LayerMultiplex_class->name = \"LayerMultiplex\";\n\tjsb_cocos2d_LayerMultiplex_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_LayerMultiplex_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_LayerMultiplex_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_LayerMultiplex_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_LayerMultiplex_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_LayerMultiplex_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_LayerMultiplex_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_LayerMultiplex_class->finalize = js_cocos2d_LayerMultiplex_finalize;\n\tjsb_cocos2d_LayerMultiplex_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"switchToAndReleaseMe\", js_cocos2dx_LayerMultiplex_switchToAndReleaseMe, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addLayer\", js_cocos2dx_LayerMultiplex_addLayer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"switchTo\", js_cocos2dx_LayerMultiplex_switchTo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_LayerMultiplex_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_LayerMultiplex_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Layer_prototype,\n\t\tjsb_cocos2d_LayerMultiplex_class,\n\t\tdummy_constructor<cocos2d::LayerMultiplex>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LayerMultiplex\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::LayerMultiplex> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_LayerMultiplex_class;\n\t\tp->proto = jsb_cocos2d_LayerMultiplex_prototype;\n\t\tp->parentProto = jsb_cocos2d_Layer_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Scene_class;\nJSObject *jsb_cocos2d_Scene_prototype;\n\nJSBool js_cocos2dx_Scene_getPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scene* cobj = (cocos2d::Scene *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Scene_getPhysicsWorld : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::PhysicsWorld* ret = cobj->getPhysicsWorld();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::PhysicsWorld>(cx, (cocos2d::PhysicsWorld*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Scene_getPhysicsWorld : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Scene_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Scene* ret = cocos2d::Scene::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, (cocos2d::Scene*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Scene_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_Scene_createWithPhysics(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Scene* ret = cocos2d::Scene::createWithPhysics();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, (cocos2d::Scene*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Scene_createWithPhysics : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_Scene_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Scene)\", obj);\n}\n\nstatic JSBool js_cocos2d_Scene_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::Scene *nobj = cocos2d::Scene::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Scene\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_Scene(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Scene_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Scene_class->name = \"Scene\";\n\tjsb_cocos2d_Scene_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Scene_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Scene_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Scene_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Scene_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Scene_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Scene_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Scene_class->finalize = js_cocos2d_Scene_finalize;\n\tjsb_cocos2d_Scene_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getPhysicsWorld\", js_cocos2dx_Scene_getPhysicsWorld, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_Scene_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Scene_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithPhysics\", js_cocos2dx_Scene_createWithPhysics, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Scene_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_Scene_class,\n\t\tdummy_constructor<cocos2d::Scene>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Scene\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Scene> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Scene_class;\n\t\tp->proto = jsb_cocos2d_Scene_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionEaseScene_class;\nJSObject *jsb_cocos2d_TransitionEaseScene_prototype;\n\nJSBool js_cocos2dx_TransitionEaseScene_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionEaseScene* cobj = (cocos2d::TransitionEaseScene *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionEaseScene_easeActionWithAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionEaseScene_easeActionWithAction : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionEaseScene_easeActionWithAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_TransitionEaseScene_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionEaseScene)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionEaseScene(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionEaseScene_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionEaseScene_class->name = \"TransitionEaseScene\";\n\tjsb_cocos2d_TransitionEaseScene_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionEaseScene_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionEaseScene_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionEaseScene_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionEaseScene_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionEaseScene_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionEaseScene_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionEaseScene_class->finalize = js_cocos2d_TransitionEaseScene_finalize;\n\tjsb_cocos2d_TransitionEaseScene_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"easeActionWithAction\", js_cocos2dx_TransitionEaseScene_easeActionWithAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_TransitionEaseScene_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_TransitionEaseScene_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionEaseScene\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionEaseScene> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionEaseScene_class;\n\t\tp->proto = jsb_cocos2d_TransitionEaseScene_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionScene_class;\nJSObject *jsb_cocos2d_TransitionScene_prototype;\n\nJSBool js_cocos2dx_TransitionScene_finish(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionScene* cobj = (cocos2d::TransitionScene *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionScene_finish : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->finish();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionScene_finish : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionScene_hideOutShowIn(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionScene* cobj = (cocos2d::TransitionScene *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionScene_hideOutShowIn : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->hideOutShowIn();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionScene_hideOutShowIn : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionScene_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionScene_create : Error processing arguments\");\n\t\tcocos2d::TransitionScene* ret = cocos2d::TransitionScene::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionScene>(cx, (cocos2d::TransitionScene*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionScene_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Scene_prototype;\n\nvoid js_cocos2d_TransitionScene_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionScene)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionScene(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionScene_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionScene_class->name = \"TransitionScene\";\n\tjsb_cocos2d_TransitionScene_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionScene_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionScene_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionScene_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionScene_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionScene_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionScene_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionScene_class->finalize = js_cocos2d_TransitionScene_finalize;\n\tjsb_cocos2d_TransitionScene_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"finish\", js_cocos2dx_TransitionScene_finish, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hideOutShowIn\", js_cocos2dx_TransitionScene_hideOutShowIn, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionScene_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionScene_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Scene_prototype,\n\t\tjsb_cocos2d_TransitionScene_class,\n\t\tdummy_constructor<cocos2d::TransitionScene>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionScene\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionScene> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionScene_class;\n\t\tp->proto = jsb_cocos2d_TransitionScene_prototype;\n\t\tp->parentProto = jsb_cocos2d_Scene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionSceneOriented_class;\nJSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nJSBool js_cocos2dx_TransitionSceneOriented_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tcocos2d::TransitionScene::Orientation arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSceneOriented_create : Error processing arguments\");\n\t\tcocos2d::TransitionSceneOriented* ret = cocos2d::TransitionSceneOriented::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionSceneOriented>(cx, (cocos2d::TransitionSceneOriented*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSceneOriented_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionSceneOriented_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionSceneOriented)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionSceneOriented(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionSceneOriented_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionSceneOriented_class->name = \"TransitionSceneOriented\";\n\tjsb_cocos2d_TransitionSceneOriented_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSceneOriented_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionSceneOriented_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSceneOriented_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionSceneOriented_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionSceneOriented_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionSceneOriented_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionSceneOriented_class->finalize = js_cocos2d_TransitionSceneOriented_finalize;\n\tjsb_cocos2d_TransitionSceneOriented_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionSceneOriented_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionSceneOriented_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionSceneOriented_class,\n\t\tdummy_constructor<cocos2d::TransitionSceneOriented>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionSceneOriented\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionSceneOriented> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionSceneOriented_class;\n\t\tp->proto = jsb_cocos2d_TransitionSceneOriented_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionRotoZoom_class;\nJSObject *jsb_cocos2d_TransitionRotoZoom_prototype;\n\nJSBool js_cocos2dx_TransitionRotoZoom_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionRotoZoom_create : Error processing arguments\");\n\t\tcocos2d::TransitionRotoZoom* ret = cocos2d::TransitionRotoZoom::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionRotoZoom>(cx, (cocos2d::TransitionRotoZoom*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionRotoZoom_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionRotoZoom_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionRotoZoom)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionRotoZoom(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionRotoZoom_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionRotoZoom_class->name = \"TransitionRotoZoom\";\n\tjsb_cocos2d_TransitionRotoZoom_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionRotoZoom_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionRotoZoom_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionRotoZoom_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionRotoZoom_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionRotoZoom_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionRotoZoom_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionRotoZoom_class->finalize = js_cocos2d_TransitionRotoZoom_finalize;\n\tjsb_cocos2d_TransitionRotoZoom_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionRotoZoom_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionRotoZoom_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionRotoZoom_class,\n\t\tdummy_constructor<cocos2d::TransitionRotoZoom>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionRotoZoom\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionRotoZoom> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionRotoZoom_class;\n\t\tp->proto = jsb_cocos2d_TransitionRotoZoom_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionJumpZoom_class;\nJSObject *jsb_cocos2d_TransitionJumpZoom_prototype;\n\nJSBool js_cocos2dx_TransitionJumpZoom_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionJumpZoom_create : Error processing arguments\");\n\t\tcocos2d::TransitionJumpZoom* ret = cocos2d::TransitionJumpZoom::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionJumpZoom>(cx, (cocos2d::TransitionJumpZoom*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionJumpZoom_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionJumpZoom_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionJumpZoom)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionJumpZoom(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionJumpZoom_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionJumpZoom_class->name = \"TransitionJumpZoom\";\n\tjsb_cocos2d_TransitionJumpZoom_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionJumpZoom_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionJumpZoom_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionJumpZoom_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionJumpZoom_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionJumpZoom_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionJumpZoom_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionJumpZoom_class->finalize = js_cocos2d_TransitionJumpZoom_finalize;\n\tjsb_cocos2d_TransitionJumpZoom_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionJumpZoom_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionJumpZoom_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionJumpZoom_class,\n\t\tdummy_constructor<cocos2d::TransitionJumpZoom>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionJumpZoom\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionJumpZoom> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionJumpZoom_class;\n\t\tp->proto = jsb_cocos2d_TransitionJumpZoom_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionMoveInL_class;\nJSObject *jsb_cocos2d_TransitionMoveInL_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInL_action(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionMoveInL* cobj = (cocos2d::TransitionMoveInL *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionMoveInL_action : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->action();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionMoveInL_action : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionMoveInL_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionMoveInL* cobj = (cocos2d::TransitionMoveInL *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionMoveInL_easeActionWithAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionMoveInL_easeActionWithAction : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionMoveInL_easeActionWithAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionMoveInL_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionMoveInL_create : Error processing arguments\");\n\t\tcocos2d::TransitionMoveInL* ret = cocos2d::TransitionMoveInL::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionMoveInL>(cx, (cocos2d::TransitionMoveInL*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionMoveInL_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionMoveInL_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionMoveInL)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionMoveInL(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionMoveInL_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionMoveInL_class->name = \"TransitionMoveInL\";\n\tjsb_cocos2d_TransitionMoveInL_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInL_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionMoveInL_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInL_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionMoveInL_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionMoveInL_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionMoveInL_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionMoveInL_class->finalize = js_cocos2d_TransitionMoveInL_finalize;\n\tjsb_cocos2d_TransitionMoveInL_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"action\", js_cocos2dx_TransitionMoveInL_action, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"easeActionWithAction\", js_cocos2dx_TransitionMoveInL_easeActionWithAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionMoveInL_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionMoveInL_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionMoveInL_class,\n\t\tdummy_constructor<cocos2d::TransitionMoveInL>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionMoveInL\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionMoveInL> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionMoveInL_class;\n\t\tp->proto = jsb_cocos2d_TransitionMoveInL_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionMoveInR_class;\nJSObject *jsb_cocos2d_TransitionMoveInR_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInR_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionMoveInR_create : Error processing arguments\");\n\t\tcocos2d::TransitionMoveInR* ret = cocos2d::TransitionMoveInR::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionMoveInR>(cx, (cocos2d::TransitionMoveInR*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionMoveInR_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionMoveInL_prototype;\n\nvoid js_cocos2d_TransitionMoveInR_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionMoveInR)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionMoveInR(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionMoveInR_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionMoveInR_class->name = \"TransitionMoveInR\";\n\tjsb_cocos2d_TransitionMoveInR_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInR_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionMoveInR_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInR_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionMoveInR_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionMoveInR_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionMoveInR_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionMoveInR_class->finalize = js_cocos2d_TransitionMoveInR_finalize;\n\tjsb_cocos2d_TransitionMoveInR_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionMoveInR_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionMoveInR_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionMoveInL_prototype,\n\t\tjsb_cocos2d_TransitionMoveInR_class,\n\t\tdummy_constructor<cocos2d::TransitionMoveInR>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionMoveInR\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionMoveInR> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionMoveInR_class;\n\t\tp->proto = jsb_cocos2d_TransitionMoveInR_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionMoveInL_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionMoveInT_class;\nJSObject *jsb_cocos2d_TransitionMoveInT_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInT_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionMoveInT_create : Error processing arguments\");\n\t\tcocos2d::TransitionMoveInT* ret = cocos2d::TransitionMoveInT::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionMoveInT>(cx, (cocos2d::TransitionMoveInT*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionMoveInT_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionMoveInL_prototype;\n\nvoid js_cocos2d_TransitionMoveInT_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionMoveInT)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionMoveInT(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionMoveInT_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionMoveInT_class->name = \"TransitionMoveInT\";\n\tjsb_cocos2d_TransitionMoveInT_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInT_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionMoveInT_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInT_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionMoveInT_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionMoveInT_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionMoveInT_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionMoveInT_class->finalize = js_cocos2d_TransitionMoveInT_finalize;\n\tjsb_cocos2d_TransitionMoveInT_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionMoveInT_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionMoveInT_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionMoveInL_prototype,\n\t\tjsb_cocos2d_TransitionMoveInT_class,\n\t\tdummy_constructor<cocos2d::TransitionMoveInT>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionMoveInT\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionMoveInT> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionMoveInT_class;\n\t\tp->proto = jsb_cocos2d_TransitionMoveInT_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionMoveInL_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionMoveInB_class;\nJSObject *jsb_cocos2d_TransitionMoveInB_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInB_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionMoveInB_create : Error processing arguments\");\n\t\tcocos2d::TransitionMoveInB* ret = cocos2d::TransitionMoveInB::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionMoveInB>(cx, (cocos2d::TransitionMoveInB*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionMoveInB_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionMoveInL_prototype;\n\nvoid js_cocos2d_TransitionMoveInB_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionMoveInB)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionMoveInB(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionMoveInB_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionMoveInB_class->name = \"TransitionMoveInB\";\n\tjsb_cocos2d_TransitionMoveInB_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInB_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionMoveInB_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionMoveInB_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionMoveInB_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionMoveInB_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionMoveInB_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionMoveInB_class->finalize = js_cocos2d_TransitionMoveInB_finalize;\n\tjsb_cocos2d_TransitionMoveInB_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionMoveInB_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionMoveInB_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionMoveInL_prototype,\n\t\tjsb_cocos2d_TransitionMoveInB_class,\n\t\tdummy_constructor<cocos2d::TransitionMoveInB>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionMoveInB\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionMoveInB> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionMoveInB_class;\n\t\tp->proto = jsb_cocos2d_TransitionMoveInB_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionMoveInL_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionSlideInL_class;\nJSObject *jsb_cocos2d_TransitionSlideInL_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInL_action(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionSlideInL* cobj = (cocos2d::TransitionSlideInL *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInL_action : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->action();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInL_action : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionSlideInL_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionSlideInL* cobj = (cocos2d::TransitionSlideInL *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInL_easeActionWithAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInL_easeActionWithAction : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInL_easeActionWithAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionSlideInL_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInL_create : Error processing arguments\");\n\t\tcocos2d::TransitionSlideInL* ret = cocos2d::TransitionSlideInL::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionSlideInL>(cx, (cocos2d::TransitionSlideInL*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInL_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionSlideInL_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionSlideInL)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionSlideInL(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionSlideInL_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionSlideInL_class->name = \"TransitionSlideInL\";\n\tjsb_cocos2d_TransitionSlideInL_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInL_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionSlideInL_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInL_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionSlideInL_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionSlideInL_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionSlideInL_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionSlideInL_class->finalize = js_cocos2d_TransitionSlideInL_finalize;\n\tjsb_cocos2d_TransitionSlideInL_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"action\", js_cocos2dx_TransitionSlideInL_action, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"easeActionWithAction\", js_cocos2dx_TransitionSlideInL_easeActionWithAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionSlideInL_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionSlideInL_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionSlideInL_class,\n\t\tdummy_constructor<cocos2d::TransitionSlideInL>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionSlideInL\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionSlideInL> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionSlideInL_class;\n\t\tp->proto = jsb_cocos2d_TransitionSlideInL_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionSlideInR_class;\nJSObject *jsb_cocos2d_TransitionSlideInR_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInR_action(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionSlideInR* cobj = (cocos2d::TransitionSlideInR *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInR_action : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->action();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInR_action : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionSlideInR_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInR_create : Error processing arguments\");\n\t\tcocos2d::TransitionSlideInR* ret = cocos2d::TransitionSlideInR::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionSlideInR>(cx, (cocos2d::TransitionSlideInR*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInR_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionSlideInL_prototype;\n\nvoid js_cocos2d_TransitionSlideInR_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionSlideInR)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionSlideInR(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionSlideInR_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionSlideInR_class->name = \"TransitionSlideInR\";\n\tjsb_cocos2d_TransitionSlideInR_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInR_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionSlideInR_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInR_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionSlideInR_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionSlideInR_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionSlideInR_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionSlideInR_class->finalize = js_cocos2d_TransitionSlideInR_finalize;\n\tjsb_cocos2d_TransitionSlideInR_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"action\", js_cocos2dx_TransitionSlideInR_action, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionSlideInR_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionSlideInR_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSlideInL_prototype,\n\t\tjsb_cocos2d_TransitionSlideInR_class,\n\t\tdummy_constructor<cocos2d::TransitionSlideInR>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionSlideInR\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionSlideInR> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionSlideInR_class;\n\t\tp->proto = jsb_cocos2d_TransitionSlideInR_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSlideInL_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionSlideInB_class;\nJSObject *jsb_cocos2d_TransitionSlideInB_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInB_action(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionSlideInB* cobj = (cocos2d::TransitionSlideInB *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInB_action : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->action();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInB_action : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionSlideInB_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInB_create : Error processing arguments\");\n\t\tcocos2d::TransitionSlideInB* ret = cocos2d::TransitionSlideInB::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionSlideInB>(cx, (cocos2d::TransitionSlideInB*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInB_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionSlideInL_prototype;\n\nvoid js_cocos2d_TransitionSlideInB_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionSlideInB)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionSlideInB(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionSlideInB_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionSlideInB_class->name = \"TransitionSlideInB\";\n\tjsb_cocos2d_TransitionSlideInB_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInB_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionSlideInB_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInB_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionSlideInB_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionSlideInB_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionSlideInB_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionSlideInB_class->finalize = js_cocos2d_TransitionSlideInB_finalize;\n\tjsb_cocos2d_TransitionSlideInB_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"action\", js_cocos2dx_TransitionSlideInB_action, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionSlideInB_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionSlideInB_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSlideInL_prototype,\n\t\tjsb_cocos2d_TransitionSlideInB_class,\n\t\tdummy_constructor<cocos2d::TransitionSlideInB>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionSlideInB\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionSlideInB> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionSlideInB_class;\n\t\tp->proto = jsb_cocos2d_TransitionSlideInB_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSlideInL_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionSlideInT_class;\nJSObject *jsb_cocos2d_TransitionSlideInT_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInT_action(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionSlideInT* cobj = (cocos2d::TransitionSlideInT *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInT_action : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->action();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInT_action : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionSlideInT_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSlideInT_create : Error processing arguments\");\n\t\tcocos2d::TransitionSlideInT* ret = cocos2d::TransitionSlideInT::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionSlideInT>(cx, (cocos2d::TransitionSlideInT*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSlideInT_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionSlideInL_prototype;\n\nvoid js_cocos2d_TransitionSlideInT_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionSlideInT)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionSlideInT(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionSlideInT_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionSlideInT_class->name = \"TransitionSlideInT\";\n\tjsb_cocos2d_TransitionSlideInT_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInT_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionSlideInT_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSlideInT_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionSlideInT_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionSlideInT_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionSlideInT_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionSlideInT_class->finalize = js_cocos2d_TransitionSlideInT_finalize;\n\tjsb_cocos2d_TransitionSlideInT_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"action\", js_cocos2dx_TransitionSlideInT_action, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionSlideInT_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionSlideInT_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSlideInL_prototype,\n\t\tjsb_cocos2d_TransitionSlideInT_class,\n\t\tdummy_constructor<cocos2d::TransitionSlideInT>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionSlideInT\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionSlideInT> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionSlideInT_class;\n\t\tp->proto = jsb_cocos2d_TransitionSlideInT_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSlideInL_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionShrinkGrow_class;\nJSObject *jsb_cocos2d_TransitionShrinkGrow_prototype;\n\nJSBool js_cocos2dx_TransitionShrinkGrow_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionShrinkGrow* cobj = (cocos2d::TransitionShrinkGrow *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionShrinkGrow_easeActionWithAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionShrinkGrow_easeActionWithAction : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionShrinkGrow_easeActionWithAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionShrinkGrow_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionShrinkGrow_create : Error processing arguments\");\n\t\tcocos2d::TransitionShrinkGrow* ret = cocos2d::TransitionShrinkGrow::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionShrinkGrow>(cx, (cocos2d::TransitionShrinkGrow*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionShrinkGrow_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionShrinkGrow_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionShrinkGrow)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionShrinkGrow(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionShrinkGrow_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionShrinkGrow_class->name = \"TransitionShrinkGrow\";\n\tjsb_cocos2d_TransitionShrinkGrow_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionShrinkGrow_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionShrinkGrow_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionShrinkGrow_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionShrinkGrow_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionShrinkGrow_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionShrinkGrow_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionShrinkGrow_class->finalize = js_cocos2d_TransitionShrinkGrow_finalize;\n\tjsb_cocos2d_TransitionShrinkGrow_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"easeActionWithAction\", js_cocos2dx_TransitionShrinkGrow_easeActionWithAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionShrinkGrow_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionShrinkGrow_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionShrinkGrow_class,\n\t\tdummy_constructor<cocos2d::TransitionShrinkGrow>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionShrinkGrow\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionShrinkGrow> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionShrinkGrow_class;\n\t\tp->proto = jsb_cocos2d_TransitionShrinkGrow_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFlipX_class;\nJSObject *jsb_cocos2d_TransitionFlipX_prototype;\n\nJSBool js_cocos2dx_TransitionFlipX_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFlipX* ret = cocos2d::TransitionFlipX::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFlipX>(cx, (cocos2d::TransitionFlipX*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionScene::Orientation arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFlipX* ret = cocos2d::TransitionFlipX::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFlipX>(cx, (cocos2d::TransitionFlipX*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFlipX_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nvoid js_cocos2d_TransitionFlipX_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFlipX)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFlipX(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFlipX_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFlipX_class->name = \"TransitionFlipX\";\n\tjsb_cocos2d_TransitionFlipX_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFlipX_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFlipX_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFlipX_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFlipX_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFlipX_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFlipX_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFlipX_class->finalize = js_cocos2d_TransitionFlipX_finalize;\n\tjsb_cocos2d_TransitionFlipX_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFlipX_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFlipX_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSceneOriented_prototype,\n\t\tjsb_cocos2d_TransitionFlipX_class,\n\t\tdummy_constructor<cocos2d::TransitionFlipX>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFlipX\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFlipX> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFlipX_class;\n\t\tp->proto = jsb_cocos2d_TransitionFlipX_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSceneOriented_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFlipY_class;\nJSObject *jsb_cocos2d_TransitionFlipY_prototype;\n\nJSBool js_cocos2dx_TransitionFlipY_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFlipY* ret = cocos2d::TransitionFlipY::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFlipY>(cx, (cocos2d::TransitionFlipY*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionScene::Orientation arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFlipY* ret = cocos2d::TransitionFlipY::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFlipY>(cx, (cocos2d::TransitionFlipY*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFlipY_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nvoid js_cocos2d_TransitionFlipY_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFlipY)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFlipY(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFlipY_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFlipY_class->name = \"TransitionFlipY\";\n\tjsb_cocos2d_TransitionFlipY_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFlipY_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFlipY_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFlipY_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFlipY_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFlipY_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFlipY_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFlipY_class->finalize = js_cocos2d_TransitionFlipY_finalize;\n\tjsb_cocos2d_TransitionFlipY_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFlipY_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFlipY_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSceneOriented_prototype,\n\t\tjsb_cocos2d_TransitionFlipY_class,\n\t\tdummy_constructor<cocos2d::TransitionFlipY>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFlipY\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFlipY> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFlipY_class;\n\t\tp->proto = jsb_cocos2d_TransitionFlipY_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSceneOriented_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFlipAngular_class;\nJSObject *jsb_cocos2d_TransitionFlipAngular_prototype;\n\nJSBool js_cocos2dx_TransitionFlipAngular_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFlipAngular* ret = cocos2d::TransitionFlipAngular::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFlipAngular>(cx, (cocos2d::TransitionFlipAngular*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionScene::Orientation arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFlipAngular* ret = cocos2d::TransitionFlipAngular::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFlipAngular>(cx, (cocos2d::TransitionFlipAngular*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFlipAngular_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nvoid js_cocos2d_TransitionFlipAngular_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFlipAngular)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFlipAngular(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFlipAngular_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFlipAngular_class->name = \"TransitionFlipAngular\";\n\tjsb_cocos2d_TransitionFlipAngular_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFlipAngular_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFlipAngular_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFlipAngular_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFlipAngular_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFlipAngular_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFlipAngular_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFlipAngular_class->finalize = js_cocos2d_TransitionFlipAngular_finalize;\n\tjsb_cocos2d_TransitionFlipAngular_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFlipAngular_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFlipAngular_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSceneOriented_prototype,\n\t\tjsb_cocos2d_TransitionFlipAngular_class,\n\t\tdummy_constructor<cocos2d::TransitionFlipAngular>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFlipAngular\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFlipAngular> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFlipAngular_class;\n\t\tp->proto = jsb_cocos2d_TransitionFlipAngular_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSceneOriented_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionZoomFlipX_class;\nJSObject *jsb_cocos2d_TransitionZoomFlipX_prototype;\n\nJSBool js_cocos2dx_TransitionZoomFlipX_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionZoomFlipX* ret = cocos2d::TransitionZoomFlipX::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionZoomFlipX>(cx, (cocos2d::TransitionZoomFlipX*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionScene::Orientation arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionZoomFlipX* ret = cocos2d::TransitionZoomFlipX::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionZoomFlipX>(cx, (cocos2d::TransitionZoomFlipX*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionZoomFlipX_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nvoid js_cocos2d_TransitionZoomFlipX_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionZoomFlipX)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionZoomFlipX(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionZoomFlipX_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionZoomFlipX_class->name = \"TransitionZoomFlipX\";\n\tjsb_cocos2d_TransitionZoomFlipX_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipX_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipX_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipX_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipX_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionZoomFlipX_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionZoomFlipX_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionZoomFlipX_class->finalize = js_cocos2d_TransitionZoomFlipX_finalize;\n\tjsb_cocos2d_TransitionZoomFlipX_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionZoomFlipX_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionZoomFlipX_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSceneOriented_prototype,\n\t\tjsb_cocos2d_TransitionZoomFlipX_class,\n\t\tdummy_constructor<cocos2d::TransitionZoomFlipX>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionZoomFlipX\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionZoomFlipX> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionZoomFlipX_class;\n\t\tp->proto = jsb_cocos2d_TransitionZoomFlipX_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSceneOriented_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionZoomFlipY_class;\nJSObject *jsb_cocos2d_TransitionZoomFlipY_prototype;\n\nJSBool js_cocos2dx_TransitionZoomFlipY_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionZoomFlipY* ret = cocos2d::TransitionZoomFlipY::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionZoomFlipY>(cx, (cocos2d::TransitionZoomFlipY*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionScene::Orientation arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionZoomFlipY* ret = cocos2d::TransitionZoomFlipY::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionZoomFlipY>(cx, (cocos2d::TransitionZoomFlipY*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionZoomFlipY_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nvoid js_cocos2d_TransitionZoomFlipY_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionZoomFlipY)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionZoomFlipY(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionZoomFlipY_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionZoomFlipY_class->name = \"TransitionZoomFlipY\";\n\tjsb_cocos2d_TransitionZoomFlipY_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipY_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipY_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipY_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipY_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionZoomFlipY_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionZoomFlipY_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionZoomFlipY_class->finalize = js_cocos2d_TransitionZoomFlipY_finalize;\n\tjsb_cocos2d_TransitionZoomFlipY_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionZoomFlipY_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionZoomFlipY_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSceneOriented_prototype,\n\t\tjsb_cocos2d_TransitionZoomFlipY_class,\n\t\tdummy_constructor<cocos2d::TransitionZoomFlipY>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionZoomFlipY\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionZoomFlipY> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionZoomFlipY_class;\n\t\tp->proto = jsb_cocos2d_TransitionZoomFlipY_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSceneOriented_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionZoomFlipAngular_class;\nJSObject *jsb_cocos2d_TransitionZoomFlipAngular_prototype;\n\nJSBool js_cocos2dx_TransitionZoomFlipAngular_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionZoomFlipAngular* ret = cocos2d::TransitionZoomFlipAngular::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionZoomFlipAngular>(cx, (cocos2d::TransitionZoomFlipAngular*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionScene::Orientation arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionZoomFlipAngular* ret = cocos2d::TransitionZoomFlipAngular::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionZoomFlipAngular>(cx, (cocos2d::TransitionZoomFlipAngular*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionZoomFlipAngular_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nvoid js_cocos2d_TransitionZoomFlipAngular_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionZoomFlipAngular)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionZoomFlipAngular(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionZoomFlipAngular_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->name = \"TransitionZoomFlipAngular\";\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->finalize = js_cocos2d_TransitionZoomFlipAngular_finalize;\n\tjsb_cocos2d_TransitionZoomFlipAngular_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionZoomFlipAngular_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionZoomFlipAngular_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSceneOriented_prototype,\n\t\tjsb_cocos2d_TransitionZoomFlipAngular_class,\n\t\tdummy_constructor<cocos2d::TransitionZoomFlipAngular>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionZoomFlipAngular\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionZoomFlipAngular> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionZoomFlipAngular_class;\n\t\tp->proto = jsb_cocos2d_TransitionZoomFlipAngular_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSceneOriented_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFade_class;\nJSObject *jsb_cocos2d_TransitionFade_prototype;\n\nJSBool js_cocos2dx_TransitionFade_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFade* ret = cocos2d::TransitionFade::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFade>(cx, (cocos2d::TransitionFade*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Scene* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color3B arg2;\n\t\t\tok &= jsval_to_cccolor3b(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TransitionFade* ret = cocos2d::TransitionFade::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFade>(cx, (cocos2d::TransitionFade*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFade_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionFade_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFade)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFade(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFade_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFade_class->name = \"TransitionFade\";\n\tjsb_cocos2d_TransitionFade_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFade_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFade_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFade_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFade_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFade_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFade_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFade_class->finalize = js_cocos2d_TransitionFade_finalize;\n\tjsb_cocos2d_TransitionFade_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFade_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFade_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionFade_class,\n\t\tdummy_constructor<cocos2d::TransitionFade>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFade\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFade> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFade_class;\n\t\tp->proto = jsb_cocos2d_TransitionFade_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionCrossFade_class;\nJSObject *jsb_cocos2d_TransitionCrossFade_prototype;\n\nJSBool js_cocos2dx_TransitionCrossFade_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionCrossFade_create : Error processing arguments\");\n\t\tcocos2d::TransitionCrossFade* ret = cocos2d::TransitionCrossFade::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionCrossFade>(cx, (cocos2d::TransitionCrossFade*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionCrossFade_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionCrossFade_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionCrossFade)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionCrossFade(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionCrossFade_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionCrossFade_class->name = \"TransitionCrossFade\";\n\tjsb_cocos2d_TransitionCrossFade_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionCrossFade_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionCrossFade_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionCrossFade_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionCrossFade_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionCrossFade_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionCrossFade_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionCrossFade_class->finalize = js_cocos2d_TransitionCrossFade_finalize;\n\tjsb_cocos2d_TransitionCrossFade_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionCrossFade_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionCrossFade_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionCrossFade_class,\n\t\tdummy_constructor<cocos2d::TransitionCrossFade>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionCrossFade\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionCrossFade> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionCrossFade_class;\n\t\tp->proto = jsb_cocos2d_TransitionCrossFade_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionTurnOffTiles_class;\nJSObject *jsb_cocos2d_TransitionTurnOffTiles_prototype;\n\nJSBool js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionTurnOffTiles* cobj = (cocos2d::TransitionTurnOffTiles *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionTurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionTurnOffTiles_create : Error processing arguments\");\n\t\tcocos2d::TransitionTurnOffTiles* ret = cocos2d::TransitionTurnOffTiles::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionTurnOffTiles>(cx, (cocos2d::TransitionTurnOffTiles*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionTurnOffTiles_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionTurnOffTiles_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionTurnOffTiles)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionTurnOffTiles(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionTurnOffTiles_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionTurnOffTiles_class->name = \"TransitionTurnOffTiles\";\n\tjsb_cocos2d_TransitionTurnOffTiles_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->finalize = js_cocos2d_TransitionTurnOffTiles_finalize;\n\tjsb_cocos2d_TransitionTurnOffTiles_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"easeActionWithAction\", js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionTurnOffTiles_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionTurnOffTiles_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionTurnOffTiles_class,\n\t\tdummy_constructor<cocos2d::TransitionTurnOffTiles>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionTurnOffTiles\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionTurnOffTiles> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionTurnOffTiles_class;\n\t\tp->proto = jsb_cocos2d_TransitionTurnOffTiles_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionSplitCols_class;\nJSObject *jsb_cocos2d_TransitionSplitCols_prototype;\n\nJSBool js_cocos2dx_TransitionSplitCols_action(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionSplitCols* cobj = (cocos2d::TransitionSplitCols *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionSplitCols_action : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ActionInterval* ret = cobj->action();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSplitCols_action : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionSplitCols_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionSplitCols* cobj = (cocos2d::TransitionSplitCols *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionSplitCols_easeActionWithAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSplitCols_easeActionWithAction : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSplitCols_easeActionWithAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionSplitCols_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSplitCols_create : Error processing arguments\");\n\t\tcocos2d::TransitionSplitCols* ret = cocos2d::TransitionSplitCols::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionSplitCols>(cx, (cocos2d::TransitionSplitCols*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSplitCols_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionSplitCols_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionSplitCols)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionSplitCols(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionSplitCols_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionSplitCols_class->name = \"TransitionSplitCols\";\n\tjsb_cocos2d_TransitionSplitCols_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSplitCols_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionSplitCols_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSplitCols_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionSplitCols_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionSplitCols_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionSplitCols_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionSplitCols_class->finalize = js_cocos2d_TransitionSplitCols_finalize;\n\tjsb_cocos2d_TransitionSplitCols_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"action\", js_cocos2dx_TransitionSplitCols_action, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"easeActionWithAction\", js_cocos2dx_TransitionSplitCols_easeActionWithAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionSplitCols_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionSplitCols_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionSplitCols_class,\n\t\tdummy_constructor<cocos2d::TransitionSplitCols>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionSplitCols\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionSplitCols> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionSplitCols_class;\n\t\tp->proto = jsb_cocos2d_TransitionSplitCols_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionSplitRows_class;\nJSObject *jsb_cocos2d_TransitionSplitRows_prototype;\n\nJSBool js_cocos2dx_TransitionSplitRows_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionSplitRows_create : Error processing arguments\");\n\t\tcocos2d::TransitionSplitRows* ret = cocos2d::TransitionSplitRows::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionSplitRows>(cx, (cocos2d::TransitionSplitRows*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionSplitRows_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionSplitCols_prototype;\n\nvoid js_cocos2d_TransitionSplitRows_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionSplitRows)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionSplitRows(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionSplitRows_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionSplitRows_class->name = \"TransitionSplitRows\";\n\tjsb_cocos2d_TransitionSplitRows_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSplitRows_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionSplitRows_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionSplitRows_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionSplitRows_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionSplitRows_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionSplitRows_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionSplitRows_class->finalize = js_cocos2d_TransitionSplitRows_finalize;\n\tjsb_cocos2d_TransitionSplitRows_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionSplitRows_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionSplitRows_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionSplitCols_prototype,\n\t\tjsb_cocos2d_TransitionSplitRows_class,\n\t\tdummy_constructor<cocos2d::TransitionSplitRows>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionSplitRows\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionSplitRows> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionSplitRows_class;\n\t\tp->proto = jsb_cocos2d_TransitionSplitRows_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionSplitCols_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFadeTR_class;\nJSObject *jsb_cocos2d_TransitionFadeTR_prototype;\n\nJSBool js_cocos2dx_TransitionFadeTR_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionFadeTR* cobj = (cocos2d::TransitionFadeTR *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeTR_easeActionWithAction : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ActionInterval* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ActionInterval*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeTR_easeActionWithAction : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFadeTR_easeActionWithAction : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionFadeTR_actionWithSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionFadeTR* cobj = (cocos2d::TransitionFadeTR *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeTR_actionWithSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeTR_actionWithSize : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->actionWithSize(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFadeTR_actionWithSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionFadeTR_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeTR_create : Error processing arguments\");\n\t\tcocos2d::TransitionFadeTR* ret = cocos2d::TransitionFadeTR::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFadeTR>(cx, (cocos2d::TransitionFadeTR*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFadeTR_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionFadeTR_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFadeTR)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFadeTR(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFadeTR_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFadeTR_class->name = \"TransitionFadeTR\";\n\tjsb_cocos2d_TransitionFadeTR_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeTR_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFadeTR_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeTR_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFadeTR_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFadeTR_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFadeTR_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFadeTR_class->finalize = js_cocos2d_TransitionFadeTR_finalize;\n\tjsb_cocos2d_TransitionFadeTR_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"easeActionWithAction\", js_cocos2dx_TransitionFadeTR_easeActionWithAction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"actionWithSize\", js_cocos2dx_TransitionFadeTR_actionWithSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFadeTR_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFadeTR_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionFadeTR_class,\n\t\tdummy_constructor<cocos2d::TransitionFadeTR>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFadeTR\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFadeTR> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFadeTR_class;\n\t\tp->proto = jsb_cocos2d_TransitionFadeTR_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFadeBL_class;\nJSObject *jsb_cocos2d_TransitionFadeBL_prototype;\n\nJSBool js_cocos2dx_TransitionFadeBL_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeBL_create : Error processing arguments\");\n\t\tcocos2d::TransitionFadeBL* ret = cocos2d::TransitionFadeBL::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFadeBL>(cx, (cocos2d::TransitionFadeBL*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFadeBL_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionFadeTR_prototype;\n\nvoid js_cocos2d_TransitionFadeBL_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFadeBL)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFadeBL(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFadeBL_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFadeBL_class->name = \"TransitionFadeBL\";\n\tjsb_cocos2d_TransitionFadeBL_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeBL_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFadeBL_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeBL_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFadeBL_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFadeBL_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFadeBL_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFadeBL_class->finalize = js_cocos2d_TransitionFadeBL_finalize;\n\tjsb_cocos2d_TransitionFadeBL_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFadeBL_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFadeBL_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionFadeTR_prototype,\n\t\tjsb_cocos2d_TransitionFadeBL_class,\n\t\tdummy_constructor<cocos2d::TransitionFadeBL>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFadeBL\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFadeBL> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFadeBL_class;\n\t\tp->proto = jsb_cocos2d_TransitionFadeBL_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionFadeTR_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFadeUp_class;\nJSObject *jsb_cocos2d_TransitionFadeUp_prototype;\n\nJSBool js_cocos2dx_TransitionFadeUp_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeUp_create : Error processing arguments\");\n\t\tcocos2d::TransitionFadeUp* ret = cocos2d::TransitionFadeUp::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFadeUp>(cx, (cocos2d::TransitionFadeUp*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFadeUp_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionFadeTR_prototype;\n\nvoid js_cocos2d_TransitionFadeUp_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFadeUp)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFadeUp(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFadeUp_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFadeUp_class->name = \"TransitionFadeUp\";\n\tjsb_cocos2d_TransitionFadeUp_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeUp_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFadeUp_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeUp_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFadeUp_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFadeUp_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFadeUp_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFadeUp_class->finalize = js_cocos2d_TransitionFadeUp_finalize;\n\tjsb_cocos2d_TransitionFadeUp_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFadeUp_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFadeUp_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionFadeTR_prototype,\n\t\tjsb_cocos2d_TransitionFadeUp_class,\n\t\tdummy_constructor<cocos2d::TransitionFadeUp>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFadeUp\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFadeUp> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFadeUp_class;\n\t\tp->proto = jsb_cocos2d_TransitionFadeUp_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionFadeTR_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionFadeDown_class;\nJSObject *jsb_cocos2d_TransitionFadeDown_prototype;\n\nJSBool js_cocos2dx_TransitionFadeDown_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionFadeDown_create : Error processing arguments\");\n\t\tcocos2d::TransitionFadeDown* ret = cocos2d::TransitionFadeDown::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionFadeDown>(cx, (cocos2d::TransitionFadeDown*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionFadeDown_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionFadeTR_prototype;\n\nvoid js_cocos2d_TransitionFadeDown_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionFadeDown)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionFadeDown(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionFadeDown_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionFadeDown_class->name = \"TransitionFadeDown\";\n\tjsb_cocos2d_TransitionFadeDown_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeDown_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionFadeDown_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionFadeDown_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionFadeDown_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionFadeDown_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionFadeDown_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionFadeDown_class->finalize = js_cocos2d_TransitionFadeDown_finalize;\n\tjsb_cocos2d_TransitionFadeDown_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionFadeDown_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionFadeDown_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionFadeTR_prototype,\n\t\tjsb_cocos2d_TransitionFadeDown_class,\n\t\tdummy_constructor<cocos2d::TransitionFadeDown>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionFadeDown\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionFadeDown> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionFadeDown_class;\n\t\tp->proto = jsb_cocos2d_TransitionFadeDown_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionFadeTR_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionPageTurn_class;\nJSObject *jsb_cocos2d_TransitionPageTurn_prototype;\n\nJSBool js_cocos2dx_TransitionPageTurn_actionWithSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionPageTurn* cobj = (cocos2d::TransitionPageTurn *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionPageTurn_actionWithSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionPageTurn_actionWithSize : Error processing arguments\");\n\t\tcocos2d::ActionInterval* ret = cobj->actionWithSize(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ActionInterval>(cx, (cocos2d::ActionInterval*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionPageTurn_actionWithSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionPageTurn_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TransitionPageTurn* cobj = (cocos2d::TransitionPageTurn *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TransitionPageTurn_initWithDuration : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tJSBool arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionPageTurn_initWithDuration : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithDuration(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionPageTurn_initWithDuration : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TransitionPageTurn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tJSBool arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionPageTurn_create : Error processing arguments\");\n\t\tcocos2d::TransitionPageTurn* ret = cocos2d::TransitionPageTurn::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionPageTurn>(cx, (cocos2d::TransitionPageTurn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionPageTurn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_TransitionPageTurn_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TransitionPageTurn* cobj = new cocos2d::TransitionPageTurn();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TransitionPageTurn> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TransitionPageTurn\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionPageTurn_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionPageTurn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionPageTurn)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionPageTurn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionPageTurn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionPageTurn_class->name = \"TransitionPageTurn\";\n\tjsb_cocos2d_TransitionPageTurn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionPageTurn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionPageTurn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionPageTurn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionPageTurn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionPageTurn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionPageTurn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionPageTurn_class->finalize = js_cocos2d_TransitionPageTurn_finalize;\n\tjsb_cocos2d_TransitionPageTurn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"actionWithSize\", js_cocos2dx_TransitionPageTurn_actionWithSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithDuration\", js_cocos2dx_TransitionPageTurn_initWithDuration, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionPageTurn_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionPageTurn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionPageTurn_class,\n\t\tjs_cocos2dx_TransitionPageTurn_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionPageTurn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionPageTurn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionPageTurn_class;\n\t\tp->proto = jsb_cocos2d_TransitionPageTurn_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionProgress_class;\nJSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nJSBool js_cocos2dx_TransitionProgress_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionProgress_create : Error processing arguments\");\n\t\tcocos2d::TransitionProgress* ret = cocos2d::TransitionProgress::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionProgress>(cx, (cocos2d::TransitionProgress*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgress_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_TransitionProgress_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TransitionProgress* cobj = new cocos2d::TransitionProgress();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TransitionProgress> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TransitionProgress\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgress_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nvoid js_cocos2d_TransitionProgress_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionProgress)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionProgress(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionProgress_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionProgress_class->name = \"TransitionProgress\";\n\tjsb_cocos2d_TransitionProgress_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgress_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionProgress_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgress_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionProgress_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionProgress_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionProgress_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionProgress_class->finalize = js_cocos2d_TransitionProgress_finalize;\n\tjsb_cocos2d_TransitionProgress_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionProgress_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionProgress_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionScene_prototype,\n\t\tjsb_cocos2d_TransitionProgress_class,\n\t\tjs_cocos2dx_TransitionProgress_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionProgress\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionProgress> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionProgress_class;\n\t\tp->proto = jsb_cocos2d_TransitionProgress_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionScene_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionProgressRadialCCW_class;\nJSObject *jsb_cocos2d_TransitionProgressRadialCCW_prototype;\n\nJSBool js_cocos2dx_TransitionProgressRadialCCW_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionProgressRadialCCW_create : Error processing arguments\");\n\t\tcocos2d::TransitionProgressRadialCCW* ret = cocos2d::TransitionProgressRadialCCW::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionProgressRadialCCW>(cx, (cocos2d::TransitionProgressRadialCCW*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgressRadialCCW_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nvoid js_cocos2d_TransitionProgressRadialCCW_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionProgressRadialCCW)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionProgressRadialCCW(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionProgressRadialCCW_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->name = \"TransitionProgressRadialCCW\";\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->finalize = js_cocos2d_TransitionProgressRadialCCW_finalize;\n\tjsb_cocos2d_TransitionProgressRadialCCW_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionProgressRadialCCW_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionProgressRadialCCW_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionProgress_prototype,\n\t\tjsb_cocos2d_TransitionProgressRadialCCW_class,\n\t\tdummy_constructor<cocos2d::TransitionProgressRadialCCW>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionProgressRadialCCW\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionProgressRadialCCW> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionProgressRadialCCW_class;\n\t\tp->proto = jsb_cocos2d_TransitionProgressRadialCCW_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionProgress_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionProgressRadialCW_class;\nJSObject *jsb_cocos2d_TransitionProgressRadialCW_prototype;\n\nJSBool js_cocos2dx_TransitionProgressRadialCW_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionProgressRadialCW_create : Error processing arguments\");\n\t\tcocos2d::TransitionProgressRadialCW* ret = cocos2d::TransitionProgressRadialCW::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionProgressRadialCW>(cx, (cocos2d::TransitionProgressRadialCW*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgressRadialCW_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nvoid js_cocos2d_TransitionProgressRadialCW_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionProgressRadialCW)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionProgressRadialCW(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionProgressRadialCW_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionProgressRadialCW_class->name = \"TransitionProgressRadialCW\";\n\tjsb_cocos2d_TransitionProgressRadialCW_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->finalize = js_cocos2d_TransitionProgressRadialCW_finalize;\n\tjsb_cocos2d_TransitionProgressRadialCW_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionProgressRadialCW_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionProgressRadialCW_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionProgress_prototype,\n\t\tjsb_cocos2d_TransitionProgressRadialCW_class,\n\t\tdummy_constructor<cocos2d::TransitionProgressRadialCW>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionProgressRadialCW\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionProgressRadialCW> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionProgressRadialCW_class;\n\t\tp->proto = jsb_cocos2d_TransitionProgressRadialCW_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionProgress_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionProgressHorizontal_class;\nJSObject *jsb_cocos2d_TransitionProgressHorizontal_prototype;\n\nJSBool js_cocos2dx_TransitionProgressHorizontal_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionProgressHorizontal_create : Error processing arguments\");\n\t\tcocos2d::TransitionProgressHorizontal* ret = cocos2d::TransitionProgressHorizontal::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionProgressHorizontal>(cx, (cocos2d::TransitionProgressHorizontal*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgressHorizontal_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nvoid js_cocos2d_TransitionProgressHorizontal_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionProgressHorizontal)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionProgressHorizontal(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionProgressHorizontal_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionProgressHorizontal_class->name = \"TransitionProgressHorizontal\";\n\tjsb_cocos2d_TransitionProgressHorizontal_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->finalize = js_cocos2d_TransitionProgressHorizontal_finalize;\n\tjsb_cocos2d_TransitionProgressHorizontal_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionProgressHorizontal_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionProgressHorizontal_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionProgress_prototype,\n\t\tjsb_cocos2d_TransitionProgressHorizontal_class,\n\t\tdummy_constructor<cocos2d::TransitionProgressHorizontal>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionProgressHorizontal\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionProgressHorizontal> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionProgressHorizontal_class;\n\t\tp->proto = jsb_cocos2d_TransitionProgressHorizontal_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionProgress_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionProgressVertical_class;\nJSObject *jsb_cocos2d_TransitionProgressVertical_prototype;\n\nJSBool js_cocos2dx_TransitionProgressVertical_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionProgressVertical_create : Error processing arguments\");\n\t\tcocos2d::TransitionProgressVertical* ret = cocos2d::TransitionProgressVertical::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionProgressVertical>(cx, (cocos2d::TransitionProgressVertical*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgressVertical_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nvoid js_cocos2d_TransitionProgressVertical_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionProgressVertical)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionProgressVertical(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionProgressVertical_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionProgressVertical_class->name = \"TransitionProgressVertical\";\n\tjsb_cocos2d_TransitionProgressVertical_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressVertical_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionProgressVertical_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressVertical_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionProgressVertical_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionProgressVertical_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionProgressVertical_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionProgressVertical_class->finalize = js_cocos2d_TransitionProgressVertical_finalize;\n\tjsb_cocos2d_TransitionProgressVertical_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionProgressVertical_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionProgressVertical_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionProgress_prototype,\n\t\tjsb_cocos2d_TransitionProgressVertical_class,\n\t\tdummy_constructor<cocos2d::TransitionProgressVertical>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionProgressVertical\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionProgressVertical> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionProgressVertical_class;\n\t\tp->proto = jsb_cocos2d_TransitionProgressVertical_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionProgress_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionProgressInOut_class;\nJSObject *jsb_cocos2d_TransitionProgressInOut_prototype;\n\nJSBool js_cocos2dx_TransitionProgressInOut_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionProgressInOut_create : Error processing arguments\");\n\t\tcocos2d::TransitionProgressInOut* ret = cocos2d::TransitionProgressInOut::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionProgressInOut>(cx, (cocos2d::TransitionProgressInOut*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgressInOut_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nvoid js_cocos2d_TransitionProgressInOut_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionProgressInOut)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionProgressInOut(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionProgressInOut_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionProgressInOut_class->name = \"TransitionProgressInOut\";\n\tjsb_cocos2d_TransitionProgressInOut_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressInOut_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionProgressInOut_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressInOut_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionProgressInOut_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionProgressInOut_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionProgressInOut_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionProgressInOut_class->finalize = js_cocos2d_TransitionProgressInOut_finalize;\n\tjsb_cocos2d_TransitionProgressInOut_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionProgressInOut_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionProgressInOut_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionProgress_prototype,\n\t\tjsb_cocos2d_TransitionProgressInOut_class,\n\t\tdummy_constructor<cocos2d::TransitionProgressInOut>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionProgressInOut\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionProgressInOut> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionProgressInOut_class;\n\t\tp->proto = jsb_cocos2d_TransitionProgressInOut_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionProgress_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TransitionProgressOutIn_class;\nJSObject *jsb_cocos2d_TransitionProgressOutIn_prototype;\n\nJSBool js_cocos2dx_TransitionProgressOutIn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::Scene* arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Scene*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TransitionProgressOutIn_create : Error processing arguments\");\n\t\tcocos2d::TransitionProgressOutIn* ret = cocos2d::TransitionProgressOutIn::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TransitionProgressOutIn>(cx, (cocos2d::TransitionProgressOutIn*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TransitionProgressOutIn_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nvoid js_cocos2d_TransitionProgressOutIn_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TransitionProgressOutIn)\", obj);\n}\n\nvoid js_register_cocos2dx_TransitionProgressOutIn(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TransitionProgressOutIn_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TransitionProgressOutIn_class->name = \"TransitionProgressOutIn\";\n\tjsb_cocos2d_TransitionProgressOutIn_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressOutIn_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TransitionProgressOutIn_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TransitionProgressOutIn_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TransitionProgressOutIn_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TransitionProgressOutIn_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TransitionProgressOutIn_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TransitionProgressOutIn_class->finalize = js_cocos2d_TransitionProgressOutIn_finalize;\n\tjsb_cocos2d_TransitionProgressOutIn_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TransitionProgressOutIn_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TransitionProgressOutIn_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_TransitionProgress_prototype,\n\t\tjsb_cocos2d_TransitionProgressOutIn_class,\n\t\tdummy_constructor<cocos2d::TransitionProgressOutIn>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TransitionProgressOutIn\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TransitionProgressOutIn> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TransitionProgressOutIn_class;\n\t\tp->proto = jsb_cocos2d_TransitionProgressOutIn_prototype;\n\t\tp->parentProto = jsb_cocos2d_TransitionProgress_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MenuItem_class;\nJSObject *jsb_cocos2d_MenuItem_prototype;\n\nJSBool js_cocos2dx_MenuItem_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItem* cobj = (cocos2d::MenuItem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItem_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItem_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItem_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItem_activate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItem* cobj = (cocos2d::MenuItem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItem_activate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->activate();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItem_activate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItem_isEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItem* cobj = (cocos2d::MenuItem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItem_isEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItem_isEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItem_selected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItem* cobj = (cocos2d::MenuItem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItem_selected : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->selected();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItem_selected : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItem_isSelected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItem* cobj = (cocos2d::MenuItem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItem_isSelected : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isSelected();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItem_isSelected : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItem_unselected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItem* cobj = (cocos2d::MenuItem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItem_unselected : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->unselected();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItem_unselected : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItem_rect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItem* cobj = (cocos2d::MenuItem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItem_rect : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Rect ret = cobj->rect();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItem_rect : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_MenuItem_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MenuItem)\", obj);\n}\n\nvoid js_register_cocos2dx_MenuItem(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MenuItem_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MenuItem_class->name = \"MenuItem\";\n\tjsb_cocos2d_MenuItem_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItem_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MenuItem_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItem_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MenuItem_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MenuItem_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MenuItem_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MenuItem_class->finalize = js_cocos2d_MenuItem_finalize;\n\tjsb_cocos2d_MenuItem_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_MenuItem_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"activate\", js_cocos2dx_MenuItem_activate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isEnabled\", js_cocos2dx_MenuItem_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"selected\", js_cocos2dx_MenuItem_selected, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isSelected\", js_cocos2dx_MenuItem_isSelected, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"unselected\", js_cocos2dx_MenuItem_unselected, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"rect\", js_cocos2dx_MenuItem_rect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_MenuItem_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_MenuItem_class,\n\t\tdummy_constructor<cocos2d::MenuItem>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MenuItem\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MenuItem> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MenuItem_class;\n\t\tp->proto = jsb_cocos2d_MenuItem_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MenuItemLabel_class;\nJSObject *jsb_cocos2d_MenuItemLabel_prototype;\n\nJSBool js_cocos2dx_MenuItemLabel_getDisabledColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemLabel* cobj = (cocos2d::MenuItemLabel *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_getDisabledColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getDisabledColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemLabel_getDisabledColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemLabel_setString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemLabel* cobj = (cocos2d::MenuItemLabel *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_setString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_setString : Error processing arguments\");\n\t\tcobj->setString(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemLabel_setString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemLabel_setLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemLabel* cobj = (cocos2d::MenuItemLabel *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_setLabel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_setLabel : Error processing arguments\");\n\t\tcobj->setLabel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemLabel_setLabel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemLabel_setDisabledColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemLabel* cobj = (cocos2d::MenuItemLabel *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_setDisabledColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_setDisabledColor : Error processing arguments\");\n\t\tcobj->setDisabledColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemLabel_setDisabledColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemLabel_getLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemLabel* cobj = (cocos2d::MenuItemLabel *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemLabel_getLabel : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getLabel();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemLabel_getLabel : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_MenuItem_prototype;\n\nvoid js_cocos2d_MenuItemLabel_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MenuItemLabel)\", obj);\n}\n\nvoid js_register_cocos2dx_MenuItemLabel(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MenuItemLabel_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MenuItemLabel_class->name = \"MenuItemLabel\";\n\tjsb_cocos2d_MenuItemLabel_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemLabel_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MenuItemLabel_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemLabel_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MenuItemLabel_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MenuItemLabel_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MenuItemLabel_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MenuItemLabel_class->finalize = js_cocos2d_MenuItemLabel_finalize;\n\tjsb_cocos2d_MenuItemLabel_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getDisabledColor\", js_cocos2dx_MenuItemLabel_getDisabledColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setString\", js_cocos2dx_MenuItemLabel_setString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLabel\", js_cocos2dx_MenuItemLabel_setLabel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDisabledColor\", js_cocos2dx_MenuItemLabel_setDisabledColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLabel\", js_cocos2dx_MenuItemLabel_getLabel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_MenuItemLabel_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_MenuItem_prototype,\n\t\tjsb_cocos2d_MenuItemLabel_class,\n\t\tdummy_constructor<cocos2d::MenuItemLabel>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MenuItemLabel\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MenuItemLabel> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MenuItemLabel_class;\n\t\tp->proto = jsb_cocos2d_MenuItemLabel_prototype;\n\t\tp->parentProto = jsb_cocos2d_MenuItem_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MenuItemAtlasFont_class;\nJSObject *jsb_cocos2d_MenuItemAtlasFont_prototype;\n\n\nextern JSObject *jsb_cocos2d_MenuItemLabel_prototype;\n\nvoid js_cocos2d_MenuItemAtlasFont_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MenuItemAtlasFont)\", obj);\n}\n\nvoid js_register_cocos2dx_MenuItemAtlasFont(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MenuItemAtlasFont_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MenuItemAtlasFont_class->name = \"MenuItemAtlasFont\";\n\tjsb_cocos2d_MenuItemAtlasFont_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemAtlasFont_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MenuItemAtlasFont_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemAtlasFont_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MenuItemAtlasFont_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MenuItemAtlasFont_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MenuItemAtlasFont_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MenuItemAtlasFont_class->finalize = js_cocos2d_MenuItemAtlasFont_finalize;\n\tjsb_cocos2d_MenuItemAtlasFont_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_MenuItemAtlasFont_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_MenuItemLabel_prototype,\n\t\tjsb_cocos2d_MenuItemAtlasFont_class,\n\t\tdummy_constructor<cocos2d::MenuItemAtlasFont>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MenuItemAtlasFont\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MenuItemAtlasFont> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MenuItemAtlasFont_class;\n\t\tp->proto = jsb_cocos2d_MenuItemAtlasFont_prototype;\n\t\tp->parentProto = jsb_cocos2d_MenuItemLabel_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MenuItemFont_class;\nJSObject *jsb_cocos2d_MenuItemFont_prototype;\n\nJSBool js_cocos2dx_MenuItemFont_setFontNameObj(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemFont* cobj = (cocos2d::MenuItemFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_setFontNameObj : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_setFontNameObj : Error processing arguments\");\n\t\tcobj->setFontNameObj(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_setFontNameObj : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemFont_getFontSizeObj(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemFont* cobj = (cocos2d::MenuItemFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_getFontSizeObj : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getFontSizeObj();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_getFontSizeObj : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemFont_getFontNameObj(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemFont* cobj = (cocos2d::MenuItemFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_getFontNameObj : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getFontNameObj();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_getFontNameObj : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemFont_setFontSizeObj(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemFont* cobj = (cocos2d::MenuItemFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_setFontSizeObj : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_setFontSizeObj : Error processing arguments\");\n\t\tcobj->setFontSizeObj(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_setFontSizeObj : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemFont_setFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_setFontName : Error processing arguments\");\n\t\tcocos2d::MenuItemFont::setFontName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_setFontName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_MenuItemFont_getFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tint ret = cocos2d::MenuItemFont::getFontSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_getFontSize : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_MenuItemFont_getFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tconst std::string& ret = cocos2d::MenuItemFont::getFontName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_getFontName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_MenuItemFont_setFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemFont_setFontSize : Error processing arguments\");\n\t\tcocos2d::MenuItemFont::setFontSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemFont_setFontSize : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_MenuItemLabel_prototype;\n\nvoid js_cocos2d_MenuItemFont_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MenuItemFont)\", obj);\n}\n\nstatic JSBool js_cocos2d_MenuItemFont_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::MenuItemFont *nobj = cocos2d::MenuItemFont::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::MenuItemFont\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_MenuItemFont(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MenuItemFont_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MenuItemFont_class->name = \"MenuItemFont\";\n\tjsb_cocos2d_MenuItemFont_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemFont_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MenuItemFont_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemFont_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MenuItemFont_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MenuItemFont_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MenuItemFont_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MenuItemFont_class->finalize = js_cocos2d_MenuItemFont_finalize;\n\tjsb_cocos2d_MenuItemFont_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setFontName\", js_cocos2dx_MenuItemFont_setFontNameObj, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFontSize\", js_cocos2dx_MenuItemFont_getFontSizeObj, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFontName\", js_cocos2dx_MenuItemFont_getFontNameObj, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontSize\", js_cocos2dx_MenuItemFont_setFontSizeObj, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_MenuItemFont_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"setFontName\", js_cocos2dx_MenuItemFont_setFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFontSize\", js_cocos2dx_MenuItemFont_getFontSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFontName\", js_cocos2dx_MenuItemFont_getFontName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontSize\", js_cocos2dx_MenuItemFont_setFontSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_MenuItemFont_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_MenuItemLabel_prototype,\n\t\tjsb_cocos2d_MenuItemFont_class,\n\t\tdummy_constructor<cocos2d::MenuItemFont>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MenuItemFont\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MenuItemFont> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MenuItemFont_class;\n\t\tp->proto = jsb_cocos2d_MenuItemFont_prototype;\n\t\tp->parentProto = jsb_cocos2d_MenuItemLabel_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MenuItemSprite_class;\nJSObject *jsb_cocos2d_MenuItemSprite_prototype;\n\nJSBool js_cocos2dx_MenuItemSprite_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_selected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_selected : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->selected();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_selected : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_setNormalImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setNormalImage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setNormalImage : Error processing arguments\");\n\t\tcobj->setNormalImage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_setNormalImage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_setDisabledImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setDisabledImage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setDisabledImage : Error processing arguments\");\n\t\tcobj->setDisabledImage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_setDisabledImage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_setSelectedImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setSelectedImage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_setSelectedImage : Error processing arguments\");\n\t\tcobj->setSelectedImage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_setSelectedImage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_getDisabledImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_getDisabledImage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getDisabledImage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_getDisabledImage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_getSelectedImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_getSelectedImage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getSelectedImage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_getSelectedImage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_getNormalImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_getNormalImage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getNormalImage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_getNormalImage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemSprite_unselected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemSprite* cobj = (cocos2d::MenuItemSprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemSprite_unselected : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->unselected();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemSprite_unselected : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_MenuItem_prototype;\n\nvoid js_cocos2d_MenuItemSprite_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MenuItemSprite)\", obj);\n}\n\nvoid js_register_cocos2dx_MenuItemSprite(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MenuItemSprite_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MenuItemSprite_class->name = \"MenuItemSprite\";\n\tjsb_cocos2d_MenuItemSprite_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemSprite_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MenuItemSprite_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemSprite_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MenuItemSprite_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MenuItemSprite_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MenuItemSprite_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MenuItemSprite_class->finalize = js_cocos2d_MenuItemSprite_finalize;\n\tjsb_cocos2d_MenuItemSprite_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_MenuItemSprite_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"selected\", js_cocos2dx_MenuItemSprite_selected, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setNormalImage\", js_cocos2dx_MenuItemSprite_setNormalImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDisabledImage\", js_cocos2dx_MenuItemSprite_setDisabledImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSelectedImage\", js_cocos2dx_MenuItemSprite_setSelectedImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisabledImage\", js_cocos2dx_MenuItemSprite_getDisabledImage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSelectedImage\", js_cocos2dx_MenuItemSprite_getSelectedImage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNormalImage\", js_cocos2dx_MenuItemSprite_getNormalImage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"unselected\", js_cocos2dx_MenuItemSprite_unselected, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_MenuItemSprite_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_MenuItem_prototype,\n\t\tjsb_cocos2d_MenuItemSprite_class,\n\t\tdummy_constructor<cocos2d::MenuItemSprite>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MenuItemSprite\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MenuItemSprite> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MenuItemSprite_class;\n\t\tp->proto = jsb_cocos2d_MenuItemSprite_prototype;\n\t\tp->parentProto = jsb_cocos2d_MenuItem_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MenuItemImage_class;\nJSObject *jsb_cocos2d_MenuItemImage_prototype;\n\nJSBool js_cocos2dx_MenuItemImage_setDisabledSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemImage* cobj = (cocos2d::MenuItemImage *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemImage_setDisabledSpriteFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemImage_setDisabledSpriteFrame : Error processing arguments\");\n\t\tcobj->setDisabledSpriteFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemImage_setDisabledSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemImage_setSelectedSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemImage* cobj = (cocos2d::MenuItemImage *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemImage_setSelectedSpriteFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemImage_setSelectedSpriteFrame : Error processing arguments\");\n\t\tcobj->setSelectedSpriteFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemImage_setSelectedSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemImage_setNormalSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemImage* cobj = (cocos2d::MenuItemImage *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemImage_setNormalSpriteFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemImage_setNormalSpriteFrame : Error processing arguments\");\n\t\tcobj->setNormalSpriteFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemImage_setNormalSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_MenuItemSprite_prototype;\n\nvoid js_cocos2d_MenuItemImage_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MenuItemImage)\", obj);\n}\n\nvoid js_register_cocos2dx_MenuItemImage(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MenuItemImage_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MenuItemImage_class->name = \"MenuItemImage\";\n\tjsb_cocos2d_MenuItemImage_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemImage_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MenuItemImage_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemImage_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MenuItemImage_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MenuItemImage_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MenuItemImage_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MenuItemImage_class->finalize = js_cocos2d_MenuItemImage_finalize;\n\tjsb_cocos2d_MenuItemImage_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setDisabledSpriteFrame\", js_cocos2dx_MenuItemImage_setDisabledSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSelectedSpriteFrame\", js_cocos2dx_MenuItemImage_setSelectedSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setNormalSpriteFrame\", js_cocos2dx_MenuItemImage_setNormalSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_MenuItemImage_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_MenuItemSprite_prototype,\n\t\tjsb_cocos2d_MenuItemImage_class,\n\t\tdummy_constructor<cocos2d::MenuItemImage>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MenuItemImage\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MenuItemImage> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MenuItemImage_class;\n\t\tp->proto = jsb_cocos2d_MenuItemImage_prototype;\n\t\tp->parentProto = jsb_cocos2d_MenuItemSprite_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MenuItemToggle_class;\nJSObject *jsb_cocos2d_MenuItemToggle_prototype;\n\nJSBool js_cocos2dx_MenuItemToggle_setSubItems(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemToggle* cobj = (cocos2d::MenuItemToggle *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_setSubItems : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocos2d::MenuItem *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_setSubItems : Error processing arguments\");\n\t\tcobj->setSubItems(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemToggle_setSubItems : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemToggle_getSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemToggle* cobj = (cocos2d::MenuItemToggle *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_getSelectedIndex : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned int ret = cobj->getSelectedIndex();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemToggle_getSelectedIndex : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemToggle_addSubItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemToggle* cobj = (cocos2d::MenuItemToggle *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_addSubItem : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::MenuItem* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::MenuItem*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_addSubItem : Error processing arguments\");\n\t\tcobj->addSubItem(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemToggle_addSubItem : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemToggle_getSelectedItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemToggle* cobj = (cocos2d::MenuItemToggle *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_getSelectedItem : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::MenuItem* ret = cobj->getSelectedItem();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::MenuItem>(cx, (cocos2d::MenuItem*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemToggle_getSelectedItem : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MenuItemToggle_setSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MenuItemToggle* cobj = (cocos2d::MenuItemToggle *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_setSelectedIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MenuItemToggle_setSelectedIndex : Error processing arguments\");\n\t\tcobj->setSelectedIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MenuItemToggle_setSelectedIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_MenuItem_prototype;\n\nvoid js_cocos2d_MenuItemToggle_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MenuItemToggle)\", obj);\n}\n\nvoid js_register_cocos2dx_MenuItemToggle(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MenuItemToggle_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MenuItemToggle_class->name = \"MenuItemToggle\";\n\tjsb_cocos2d_MenuItemToggle_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemToggle_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MenuItemToggle_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MenuItemToggle_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MenuItemToggle_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MenuItemToggle_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MenuItemToggle_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MenuItemToggle_class->finalize = js_cocos2d_MenuItemToggle_finalize;\n\tjsb_cocos2d_MenuItemToggle_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setSubItems\", js_cocos2dx_MenuItemToggle_setSubItems, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSelectedIndex\", js_cocos2dx_MenuItemToggle_getSelectedIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSubItem\", js_cocos2dx_MenuItemToggle_addSubItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSelectedItem\", js_cocos2dx_MenuItemToggle_getSelectedItem, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSelectedIndex\", js_cocos2dx_MenuItemToggle_setSelectedIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_MenuItemToggle_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_MenuItem_prototype,\n\t\tjsb_cocos2d_MenuItemToggle_class,\n\t\tdummy_constructor<cocos2d::MenuItemToggle>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MenuItemToggle\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MenuItemToggle> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MenuItemToggle_class;\n\t\tp->proto = jsb_cocos2d_MenuItemToggle_prototype;\n\t\tp->parentProto = jsb_cocos2d_MenuItem_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Menu_class;\nJSObject *jsb_cocos2d_Menu_prototype;\n\nJSBool js_cocos2dx_Menu_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Menu* cobj = (cocos2d::Menu *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Menu_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Menu_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Menu_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Menu_alignItemsVertically(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Menu* cobj = (cocos2d::Menu *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Menu_alignItemsVertically : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->alignItemsVertically();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Menu_alignItemsVertically : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Menu_isEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Menu* cobj = (cocos2d::Menu *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Menu_isEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Menu_isEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Menu_alignItemsHorizontallyWithPadding(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Menu* cobj = (cocos2d::Menu *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Menu_alignItemsHorizontallyWithPadding : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Menu_alignItemsHorizontallyWithPadding : Error processing arguments\");\n\t\tcobj->alignItemsHorizontallyWithPadding(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Menu_alignItemsHorizontallyWithPadding : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Menu_alignItemsVerticallyWithPadding(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Menu* cobj = (cocos2d::Menu *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Menu_alignItemsVerticallyWithPadding : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Menu_alignItemsVerticallyWithPadding : Error processing arguments\");\n\t\tcobj->alignItemsVerticallyWithPadding(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Menu_alignItemsVerticallyWithPadding : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Menu_alignItemsHorizontally(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Menu* cobj = (cocos2d::Menu *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Menu_alignItemsHorizontally : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->alignItemsHorizontally();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Menu_alignItemsHorizontally : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_Layer_prototype;\n\nvoid js_cocos2d_Menu_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Menu)\", obj);\n}\n\nvoid js_register_cocos2dx_Menu(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Menu_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Menu_class->name = \"Menu\";\n\tjsb_cocos2d_Menu_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Menu_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Menu_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Menu_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Menu_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Menu_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Menu_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Menu_class->finalize = js_cocos2d_Menu_finalize;\n\tjsb_cocos2d_Menu_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_Menu_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"alignItemsVertically\", js_cocos2dx_Menu_alignItemsVertically, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isEnabled\", js_cocos2dx_Menu_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"alignItemsHorizontallyWithPadding\", js_cocos2dx_Menu_alignItemsHorizontallyWithPadding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"alignItemsVerticallyWithPadding\", js_cocos2dx_Menu_alignItemsVerticallyWithPadding, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"alignItemsHorizontally\", js_cocos2dx_Menu_alignItemsHorizontally, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Menu_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Layer_prototype,\n\t\tjsb_cocos2d_Menu_class,\n\t\tdummy_constructor<cocos2d::Menu>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Menu\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Menu> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Menu_class;\n\t\tp->proto = jsb_cocos2d_Menu_prototype;\n\t\tp->parentProto = jsb_cocos2d_Layer_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ClippingNode_class;\nJSObject *jsb_cocos2d_ClippingNode_prototype;\n\nJSBool js_cocos2dx_ClippingNode_isInverted(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ClippingNode* cobj = (cocos2d::ClippingNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_isInverted : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isInverted();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ClippingNode_isInverted : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ClippingNode_setInverted(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ClippingNode* cobj = (cocos2d::ClippingNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_setInverted : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_setInverted : Error processing arguments\");\n\t\tcobj->setInverted(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ClippingNode_setInverted : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ClippingNode_setStencil(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ClippingNode* cobj = (cocos2d::ClippingNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_setStencil : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_setStencil : Error processing arguments\");\n\t\tcobj->setStencil(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ClippingNode_setStencil : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ClippingNode_getAlphaThreshold(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ClippingNode* cobj = (cocos2d::ClippingNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_getAlphaThreshold : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAlphaThreshold();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ClippingNode_getAlphaThreshold : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ClippingNode_getStencil(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ClippingNode* cobj = (cocos2d::ClippingNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_getStencil : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getStencil();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ClippingNode_getStencil : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ClippingNode_setAlphaThreshold(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ClippingNode* cobj = (cocos2d::ClippingNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_setAlphaThreshold : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ClippingNode_setAlphaThreshold : Error processing arguments\");\n\t\tcobj->setAlphaThreshold(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ClippingNode_setAlphaThreshold : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ClippingNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::ClippingNode* ret = cocos2d::ClippingNode::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ClippingNode>(cx, (cocos2d::ClippingNode*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ClippingNode* ret = cocos2d::ClippingNode::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ClippingNode>(cx, (cocos2d::ClippingNode*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_ClippingNode_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_ClippingNode_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ClippingNode)\", obj);\n}\n\nvoid js_register_cocos2dx_ClippingNode(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ClippingNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ClippingNode_class->name = \"ClippingNode\";\n\tjsb_cocos2d_ClippingNode_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ClippingNode_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ClippingNode_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ClippingNode_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ClippingNode_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ClippingNode_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ClippingNode_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ClippingNode_class->finalize = js_cocos2d_ClippingNode_finalize;\n\tjsb_cocos2d_ClippingNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"isInverted\", js_cocos2dx_ClippingNode_isInverted, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInverted\", js_cocos2dx_ClippingNode_setInverted, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStencil\", js_cocos2dx_ClippingNode_setStencil, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAlphaThreshold\", js_cocos2dx_ClippingNode_getAlphaThreshold, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStencil\", js_cocos2dx_ClippingNode_getStencil, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAlphaThreshold\", js_cocos2dx_ClippingNode_setAlphaThreshold, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ClippingNode_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ClippingNode_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_ClippingNode_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ClippingNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ClippingNode> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ClippingNode_class;\n\t\tp->proto = jsb_cocos2d_ClippingNode_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_MotionStreak_class;\nJSObject *jsb_cocos2d_MotionStreak_prototype;\n\nJSBool js_cocos2dx_MotionStreak_reset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_reset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->reset();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_reset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_setTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_setTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_setTexture : Error processing arguments\");\n\t\tcobj->setTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_setTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_getTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_getTexture : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* ret = cobj->getTexture();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_getTexture : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_tintWithColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_tintWithColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_tintWithColor : Error processing arguments\");\n\t\tcobj->tintWithColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_tintWithColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_setStartingPositionInitialized(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_setStartingPositionInitialized : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_setStartingPositionInitialized : Error processing arguments\");\n\t\tcobj->setStartingPositionInitialized(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_setStartingPositionInitialized : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_isStartingPositionInitialized(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_isStartingPositionInitialized : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isStartingPositionInitialized();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_isStartingPositionInitialized : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_isFastMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_isFastMode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isFastMode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_isFastMode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_setFastMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::MotionStreak* cobj = (cocos2d::MotionStreak *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_setFastMode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_MotionStreak_setFastMode : Error processing arguments\");\n\t\tcobj->setFastMode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_setFastMode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_MotionStreak_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color3B arg3;\n\t\t\tok &= jsval_to_cccolor3b(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* arg4;\n\t\t\tdo {\n\t\t\t\tif (!argv[4].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[4]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ4 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg4, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::MotionStreak* ret = cocos2d::MotionStreak::create(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::MotionStreak>(cx, (cocos2d::MotionStreak*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color3B arg3;\n\t\t\tok &= jsval_to_cccolor3b(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg4;\n\t\t\tok &= jsval_to_std_string(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::MotionStreak* ret = cocos2d::MotionStreak::create(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::MotionStreak>(cx, (cocos2d::MotionStreak*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_MotionStreak_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_MotionStreak_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (MotionStreak)\", obj);\n}\n\nvoid js_register_cocos2dx_MotionStreak(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_MotionStreak_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_MotionStreak_class->name = \"MotionStreak\";\n\tjsb_cocos2d_MotionStreak_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_MotionStreak_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_MotionStreak_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_MotionStreak_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_MotionStreak_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_MotionStreak_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_MotionStreak_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_MotionStreak_class->finalize = js_cocos2d_MotionStreak_finalize;\n\tjsb_cocos2d_MotionStreak_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"reset\", js_cocos2dx_MotionStreak_reset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTexture\", js_cocos2dx_MotionStreak_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTexture\", js_cocos2dx_MotionStreak_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"tintWithColor\", js_cocos2dx_MotionStreak_tintWithColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartingPositionInitialized\", js_cocos2dx_MotionStreak_setStartingPositionInitialized, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isStartingPositionInitialized\", js_cocos2dx_MotionStreak_isStartingPositionInitialized, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFastMode\", js_cocos2dx_MotionStreak_isFastMode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFastMode\", js_cocos2dx_MotionStreak_setFastMode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_MotionStreak_create, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_MotionStreak_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_MotionStreak_class,\n\t\tdummy_constructor<cocos2d::MotionStreak>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"MotionStreak\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::MotionStreak> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_MotionStreak_class;\n\t\tp->proto = jsb_cocos2d_MotionStreak_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ProgressTimer_class;\nJSObject *jsb_cocos2d_ProgressTimer_prototype;\n\nJSBool js_cocos2dx_ProgressTimer_isReverseDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_isReverseDirection : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isReverseDirection();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_isReverseDirection : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_setBarChangeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setBarChangeRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setBarChangeRate : Error processing arguments\");\n\t\tcobj->setBarChangeRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_setBarChangeRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_getPercentage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_getPercentage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getPercentage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_getPercentage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_setSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setSprite : Error processing arguments\");\n\t\tcobj->setSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_setSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_getType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_getType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_getType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_getSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_getSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_getSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_setMidpoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setMidpoint : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setMidpoint : Error processing arguments\");\n\t\tcobj->setMidpoint(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_setMidpoint : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_getBarChangeRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_getBarChangeRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getBarChangeRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_getBarChangeRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_setReverseDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::ProgressTimer* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setReverseDirection : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tJSBool arg0;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setReverseDirection(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tJSBool arg0;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setReverseProgress(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_setReverseDirection : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_getMidpoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_getMidpoint : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getMidpoint();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_getMidpoint : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_setPercentage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setPercentage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setPercentage : Error processing arguments\");\n\t\tcobj->setPercentage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_setPercentage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_setType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ProgressTimer* cobj = (cocos2d::ProgressTimer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ProgressTimer::Type arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_setType : Error processing arguments\");\n\t\tcobj->setType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_setType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ProgressTimer_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ProgressTimer_create : Error processing arguments\");\n\t\tcocos2d::ProgressTimer* ret = cocos2d::ProgressTimer::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ProgressTimer>(cx, (cocos2d::ProgressTimer*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ProgressTimer_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_ProgressTimer_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProgressTimer)\", obj);\n}\n\nvoid js_register_cocos2dx_ProgressTimer(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ProgressTimer_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ProgressTimer_class->name = \"ProgressTimer\";\n\tjsb_cocos2d_ProgressTimer_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ProgressTimer_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ProgressTimer_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ProgressTimer_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ProgressTimer_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ProgressTimer_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ProgressTimer_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ProgressTimer_class->finalize = js_cocos2d_ProgressTimer_finalize;\n\tjsb_cocos2d_ProgressTimer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"isReverseDirection\", js_cocos2dx_ProgressTimer_isReverseDirection, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBarChangeRate\", js_cocos2dx_ProgressTimer_setBarChangeRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPercentage\", js_cocos2dx_ProgressTimer_getPercentage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSprite\", js_cocos2dx_ProgressTimer_setSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getType\", js_cocos2dx_ProgressTimer_getType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSprite\", js_cocos2dx_ProgressTimer_getSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMidpoint\", js_cocos2dx_ProgressTimer_setMidpoint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBarChangeRate\", js_cocos2dx_ProgressTimer_getBarChangeRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setReverseDirection\", js_cocos2dx_ProgressTimer_setReverseDirection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMidpoint\", js_cocos2dx_ProgressTimer_getMidpoint, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPercentage\", js_cocos2dx_ProgressTimer_setPercentage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setType\", js_cocos2dx_ProgressTimer_setType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ProgressTimer_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ProgressTimer_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_ProgressTimer_class,\n\t\tdummy_constructor<cocos2d::ProgressTimer>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProgressTimer\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ProgressTimer> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ProgressTimer_class;\n\t\tp->proto = jsb_cocos2d_ProgressTimer_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_RenderTexture_class;\nJSObject *jsb_cocos2d_RenderTexture_prototype;\n\nJSBool js_cocos2dx_RenderTexture_clearStencil(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_clearStencil : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_clearStencil : Error processing arguments\");\n\t\tcobj->clearStencil(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_clearStencil : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_getClearDepth(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_getClearDepth : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getClearDepth();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_getClearDepth : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_getClearStencil(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_getClearStencil : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getClearStencil();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_getClearStencil : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_end(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_end : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->end();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_end : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_setClearStencil(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearStencil : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearStencil : Error processing arguments\");\n\t\tcobj->setClearStencil(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_setClearStencil : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_setSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setSprite : Error processing arguments\");\n\t\tcobj->setSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_setSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_getSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_getSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_getSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_isAutoDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_isAutoDraw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isAutoDraw();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_isAutoDraw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_setClearFlags(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearFlags : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearFlags : Error processing arguments\");\n\t\tcobj->setClearFlags(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_setClearFlags : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_begin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_begin : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->begin();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_begin : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_saveToFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::RenderTexture* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_saveToFile : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Image::Format arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->saveToFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->saveToFile(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_saveToFile : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_setAutoDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setAutoDraw : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setAutoDraw : Error processing arguments\");\n\t\tcobj->setAutoDraw(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_setAutoDraw : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_setClearColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color4F arg0;\n\t\tok &= jsval_to_cccolor4f(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearColor : Error processing arguments\");\n\t\tcobj->setClearColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_setClearColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_endToLua(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_endToLua : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->endToLua();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_endToLua : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_beginWithClear(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::RenderTexture* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_beginWithClear : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg3;\n\t\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg4;\n\t\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->beginWithClear(arg0, arg1, arg2, arg3, arg4);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg3;\n\t\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->beginWithClear(arg0, arg1, arg2, arg3);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 6) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg3;\n\t\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg4;\n\t\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg5;\n\t\t\tok &= jsval_to_int32(cx, argv[5], (int32_t *)&arg5);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->beginWithClear(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_beginWithClear : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_clearDepth(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_clearDepth : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_clearDepth : Error processing arguments\");\n\t\tcobj->clearDepth(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_clearDepth : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_getClearColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_getClearColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color4F& ret = cobj->getClearColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor4f_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_getClearColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_clear(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_clear : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tdouble arg2;\n\t\tdouble arg3;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_clear : Error processing arguments\");\n\t\tcobj->clear(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_clear : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_getClearFlags(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_getClearFlags : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned int ret = cobj->getClearFlags();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_getClearFlags : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_newImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_newImage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Image* ret = cobj->newImage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Image>(cx, (cocos2d::Image*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_newImage : Error processing arguments\");\n\t\tcocos2d::Image* ret = cobj->newImage(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Image>(cx, (cocos2d::Image*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_newImage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_setClearDepth(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::RenderTexture* cobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearDepth : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_setClearDepth : Error processing arguments\");\n\t\tcobj->setClearDepth(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_setClearDepth : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_initWithWidthAndHeight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::RenderTexture* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::RenderTexture *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_RenderTexture_initWithWidthAndHeight : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tint arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D::PixelFormat arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tunsigned int arg3;\n\t\t\tok &= jsval_to_uint32(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithWidthAndHeight(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tint arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D::PixelFormat arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithWidthAndHeight(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_initWithWidthAndHeight : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tint arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D::PixelFormat arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RenderTexture>(cx, (cocos2d::RenderTexture*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tint arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D::PixelFormat arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tunsigned int arg3;\n\t\t\tok &= jsval_to_uint32(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RenderTexture>(cx, (cocos2d::RenderTexture*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tint arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::RenderTexture>(cx, (cocos2d::RenderTexture*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_RenderTexture_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::RenderTexture* cobj = new cocos2d::RenderTexture();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::RenderTexture> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::RenderTexture\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_RenderTexture_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_RenderTexture_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (RenderTexture)\", obj);\n}\n\nvoid js_register_cocos2dx_RenderTexture(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_RenderTexture_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_RenderTexture_class->name = \"RenderTexture\";\n\tjsb_cocos2d_RenderTexture_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_RenderTexture_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_RenderTexture_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_RenderTexture_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_RenderTexture_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_RenderTexture_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_RenderTexture_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_RenderTexture_class->finalize = js_cocos2d_RenderTexture_finalize;\n\tjsb_cocos2d_RenderTexture_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"clearStencil\", js_cocos2dx_RenderTexture_clearStencil, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getClearDepth\", js_cocos2dx_RenderTexture_getClearDepth, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getClearStencil\", js_cocos2dx_RenderTexture_getClearStencil, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"end\", js_cocos2dx_RenderTexture_end, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setClearStencil\", js_cocos2dx_RenderTexture_setClearStencil, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSprite\", js_cocos2dx_RenderTexture_setSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSprite\", js_cocos2dx_RenderTexture_getSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isAutoDraw\", js_cocos2dx_RenderTexture_isAutoDraw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setClearFlags\", js_cocos2dx_RenderTexture_setClearFlags, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"begin\", js_cocos2dx_RenderTexture_begin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"saveToFile\", js_cocos2dx_RenderTexture_saveToFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAutoDraw\", js_cocos2dx_RenderTexture_setAutoDraw, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setClearColor\", js_cocos2dx_RenderTexture_setClearColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"endToLua\", js_cocos2dx_RenderTexture_endToLua, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"beginWithClear\", js_cocos2dx_RenderTexture_beginWithClear, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clearDepth\", js_cocos2dx_RenderTexture_clearDepth, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getClearColor\", js_cocos2dx_RenderTexture_getClearColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clear\", js_cocos2dx_RenderTexture_clear, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getClearFlags\", js_cocos2dx_RenderTexture_getClearFlags, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"newImage\", js_cocos2dx_RenderTexture_newImage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setClearDepth\", js_cocos2dx_RenderTexture_setClearDepth, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithWidthAndHeight\", js_cocos2dx_RenderTexture_initWithWidthAndHeight, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_RenderTexture_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_RenderTexture_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_RenderTexture_class,\n\t\tjs_cocos2dx_RenderTexture_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"RenderTexture\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::RenderTexture> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_RenderTexture_class;\n\t\tp->proto = jsb_cocos2d_RenderTexture_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_NodeGrid_class;\nJSObject *jsb_cocos2d_NodeGrid_prototype;\n\nJSBool js_cocos2dx_NodeGrid_setTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::NodeGrid* cobj = (cocos2d::NodeGrid *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_NodeGrid_setTarget : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_NodeGrid_setTarget : Error processing arguments\");\n\t\tcobj->setTarget(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_NodeGrid_setTarget : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_NodeGrid_getGrid(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::NodeGrid* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::NodeGrid *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_NodeGrid_getGrid : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::GridBase* ret = cobj->getGrid();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GridBase>(cx, (cocos2d::GridBase*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::GridBase* ret = cobj->getGrid();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GridBase>(cx, (cocos2d::GridBase*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_NodeGrid_getGrid : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_NodeGrid_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::NodeGrid* ret = cocos2d::NodeGrid::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::NodeGrid>(cx, (cocos2d::NodeGrid*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_NodeGrid_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_NodeGrid_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (NodeGrid)\", obj);\n}\n\nvoid js_register_cocos2dx_NodeGrid(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_NodeGrid_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_NodeGrid_class->name = \"NodeGrid\";\n\tjsb_cocos2d_NodeGrid_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_NodeGrid_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_NodeGrid_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_NodeGrid_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_NodeGrid_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_NodeGrid_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_NodeGrid_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_NodeGrid_class->finalize = js_cocos2d_NodeGrid_finalize;\n\tjsb_cocos2d_NodeGrid_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setTarget\", js_cocos2dx_NodeGrid_setTarget, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGrid\", js_cocos2dx_NodeGrid_getGrid, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_NodeGrid_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_NodeGrid_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_NodeGrid_class,\n\t\tdummy_constructor<cocos2d::NodeGrid>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"NodeGrid\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::NodeGrid> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_NodeGrid_class;\n\t\tp->proto = jsb_cocos2d_NodeGrid_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleBatchNode_class;\nJSObject *jsb_cocos2d_ParticleBatchNode_prototype;\n\nJSBool js_cocos2dx_ParticleBatchNode_setTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_setTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_setTexture : Error processing arguments\");\n\t\tcobj->setTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_setTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_disableParticle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_disableParticle : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_disableParticle : Error processing arguments\");\n\t\tcobj->disableParticle(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_disableParticle : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_getTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_getTexture : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* ret = cobj->getTexture();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_getTexture : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_setTextureAtlas : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextureAtlas* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TextureAtlas*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_setTextureAtlas : Error processing arguments\");\n\t\tcobj->setTextureAtlas(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_setTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup : Error processing arguments\");\n\t\tcobj->removeAllChildrenWithCleanup(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_getTextureAtlas : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextureAtlas>(cx, (cocos2d::TextureAtlas*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_getTextureAtlas : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_insertChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_insertChild : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::ParticleSystem* arg0;\n\t\tint arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ParticleSystem*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_insertChild : Error processing arguments\");\n\t\tcobj->insertChild(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_insertChild : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_visit(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_visit : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->visit();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_visit : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_removeChildAtIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleBatchNode* cobj = (cocos2d::ParticleBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_removeChildAtIndex : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_removeChildAtIndex : Error processing arguments\");\n\t\tcobj->removeChildAtIndex(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_removeChildAtIndex : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_create : Error processing arguments\");\n\t\tcocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleBatchNode>(cx, (cocos2d::ParticleBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_create : Error processing arguments\");\n\t\tcocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleBatchNode>(cx, (cocos2d::ParticleBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_createWithTexture : Error processing arguments\");\n\t\tcocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleBatchNode>(cx, (cocos2d::ParticleBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tint arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleBatchNode_createWithTexture : Error processing arguments\");\n\t\tcocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleBatchNode>(cx, (cocos2d::ParticleBatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleBatchNode_createWithTexture : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_ParticleBatchNode_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleBatchNode)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleBatchNode(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleBatchNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleBatchNode_class->name = \"ParticleBatchNode\";\n\tjsb_cocos2d_ParticleBatchNode_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleBatchNode_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleBatchNode_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleBatchNode_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleBatchNode_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleBatchNode_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleBatchNode_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleBatchNode_class->finalize = js_cocos2d_ParticleBatchNode_finalize;\n\tjsb_cocos2d_ParticleBatchNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setTexture\", js_cocos2dx_ParticleBatchNode_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"disableParticle\", js_cocos2dx_ParticleBatchNode_disableParticle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTexture\", js_cocos2dx_ParticleBatchNode_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextureAtlas\", js_cocos2dx_ParticleBatchNode_setTextureAtlas, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllChildrenWithCleanup\", js_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureAtlas\", js_cocos2dx_ParticleBatchNode_getTextureAtlas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"insertChild\", js_cocos2dx_ParticleBatchNode_insertChild, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"visit\", js_cocos2dx_ParticleBatchNode_visit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeChildAtIndex\", js_cocos2dx_ParticleBatchNode_removeChildAtIndex, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleBatchNode_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTexture\", js_cocos2dx_ParticleBatchNode_createWithTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleBatchNode_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_ParticleBatchNode_class,\n\t\tdummy_constructor<cocos2d::ParticleBatchNode>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleBatchNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleBatchNode> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleBatchNode_class;\n\t\tp->proto = jsb_cocos2d_ParticleBatchNode_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleSystem_class;\nJSObject *jsb_cocos2d_ParticleSystem_prototype;\n\nJSBool js_cocos2dx_ParticleSystem_getStartSizeVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartSizeVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getStartSizeVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartSizeVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getTexture : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Texture2D* ret = cobj->getTexture();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getTexture : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_isFull(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_isFull : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isFull();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_isFull : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getBatchNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ParticleBatchNode* ret = cobj->getBatchNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleBatchNode>(cx, (cocos2d::ParticleBatchNode*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getBatchNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getStartColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color4F& ret = cobj->getStartColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor4f_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getPositionType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getPositionType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getPositionType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getPositionType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setPosVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setPosVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setPosVar : Error processing arguments\");\n\t\tcobj->setPosVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setPosVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndSpin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndSpin : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEndSpin();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndSpin : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setRotatePerSecondVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotatePerSecondVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotatePerSecondVar : Error processing arguments\");\n\t\tcobj->setRotatePerSecondVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setRotatePerSecondVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getStartSpinVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartSpinVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getStartSpinVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartSpinVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getRadialAccelVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getRadialAccelVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRadialAccelVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getRadialAccelVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndSizeVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndSizeVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEndSizeVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndSizeVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setRotation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotation : Error processing arguments\");\n\t\tcobj->setRotation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setRotation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setTangentialAccel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTangentialAccel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTangentialAccel : Error processing arguments\");\n\t\tcobj->setTangentialAccel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setTangentialAccel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setScaleY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setScaleY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setScaleY : Error processing arguments\");\n\t\tcobj->setScaleY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setScaleY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setScaleX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setScaleX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setScaleX : Error processing arguments\");\n\t\tcobj->setScaleX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setScaleX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getRadialAccel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getRadialAccel : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRadialAccel();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getRadialAccel : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartRadius(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartRadius : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartRadius : Error processing arguments\");\n\t\tcobj->setStartRadius(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartRadius : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setRotatePerSecond(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotatePerSecond : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotatePerSecond : Error processing arguments\");\n\t\tcobj->setRotatePerSecond(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setRotatePerSecond : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSize : Error processing arguments\");\n\t\tcobj->setEndSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getGravity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getGravity : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getGravity();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getGravity : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getTangentialAccel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getTangentialAccel : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getTangentialAccel();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getTangentialAccel : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndRadius(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndRadius : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndRadius : Error processing arguments\");\n\t\tcobj->setEndRadius(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndRadius : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getSpeed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getSpeed : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSpeed();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getSpeed : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getAngle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getAngle : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAngle();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getAngle : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color4F arg0;\n\t\tok &= jsval_to_cccolor4f(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndColor : Error processing arguments\");\n\t\tcobj->setEndColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartSpin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSpin : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSpin : Error processing arguments\");\n\t\tcobj->setStartSpin(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartSpin : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setDuration : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setDuration : Error processing arguments\");\n\t\tcobj->setDuration(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setDuration : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTexture : Error processing arguments\");\n\t\tcobj->setTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getPosVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getPosVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getPosVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getPosVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_updateWithNoTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_updateWithNoTime : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateWithNoTime();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_updateWithNoTime : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_isBlendAdditive(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_isBlendAdditive : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBlendAdditive();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_isBlendAdditive : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getSpeedVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getSpeedVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSpeedVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getSpeedVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setPositionType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setPositionType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ParticleSystem::PositionType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setPositionType : Error processing arguments\");\n\t\tcobj->setPositionType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setPositionType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_stopSystem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_stopSystem : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopSystem();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_stopSystem : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getSourcePosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getSourcePosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getSourcePosition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getSourcePosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setLifeVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setLifeVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setLifeVar : Error processing arguments\");\n\t\tcobj->setLifeVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setLifeVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTotalParticles : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTotalParticles : Error processing arguments\");\n\t\tcobj->setTotalParticles(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setTotalParticles : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndColorVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndColorVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color4F arg0;\n\t\tok &= jsval_to_cccolor4f(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndColorVar : Error processing arguments\");\n\t\tcobj->setEndColorVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndColorVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_updateQuadWithParticle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_updateQuadWithParticle : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::sParticle* arg0;\n\t\tcocos2d::Point arg1;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR sParticle*;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_updateQuadWithParticle : Error processing arguments\");\n\t\tcobj->updateQuadWithParticle(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_updateQuadWithParticle : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getAtlasIndex : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getAtlasIndex();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getAtlasIndex : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getStartSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getStartSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartSpinVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSpinVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSpinVar : Error processing arguments\");\n\t\tcobj->setStartSpinVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartSpinVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_resetSystem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_resetSystem : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resetSystem();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_resetSystem : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAtlasIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAtlasIndex : Error processing arguments\");\n\t\tcobj->setAtlasIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setAtlasIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setTangentialAccelVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTangentialAccelVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setTangentialAccelVar : Error processing arguments\");\n\t\tcobj->setTangentialAccelVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setTangentialAccelVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndRadiusVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndRadiusVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndRadiusVar : Error processing arguments\");\n\t\tcobj->setEndRadiusVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndRadiusVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndRadius(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndRadius : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEndRadius();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndRadius : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_isOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_isOpacityModifyRGB : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isOpacityModifyRGB();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_isOpacityModifyRGB : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_isActive(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_isActive : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isActive();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_isActive : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setRadialAccelVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRadialAccelVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRadialAccelVar : Error processing arguments\");\n\t\tcobj->setRadialAccelVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setRadialAccelVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSize : Error processing arguments\");\n\t\tcobj->setStartSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setSpeed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setSpeed : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setSpeed : Error processing arguments\");\n\t\tcobj->setSpeed(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setSpeed : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getStartSpin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartSpin : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getStartSpin();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartSpin : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getRotatePerSecond(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getRotatePerSecond : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRotatePerSecond();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getRotatePerSecond : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_initParticle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_initParticle : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::sParticle* arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR sParticle*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_initParticle : Error processing arguments\");\n\t\tcobj->initParticle(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_initParticle : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEmitterMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEmitterMode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ParticleSystem::Mode arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEmitterMode : Error processing arguments\");\n\t\tcobj->setEmitterMode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEmitterMode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getDuration : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getDuration();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getDuration : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setSourcePosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setSourcePosition : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setSourcePosition : Error processing arguments\");\n\t\tcobj->setSourcePosition(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setSourcePosition : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndSpinVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndSpinVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEndSpinVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndSpinVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setBlendAdditive(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setBlendAdditive : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setBlendAdditive : Error processing arguments\");\n\t\tcobj->setBlendAdditive(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setBlendAdditive : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setLife(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setLife : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setLife : Error processing arguments\");\n\t\tcobj->setLife(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setLife : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setAngleVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAngleVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAngleVar : Error processing arguments\");\n\t\tcobj->setAngleVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setAngleVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setRotationIsDir(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotationIsDir : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRotationIsDir : Error processing arguments\");\n\t\tcobj->setRotationIsDir(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setRotationIsDir : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndSizeVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSizeVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSizeVar : Error processing arguments\");\n\t\tcobj->setEndSizeVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndSizeVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setAngle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAngle : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAngle : Error processing arguments\");\n\t\tcobj->setAngle(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setAngle : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setBatchNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ParticleBatchNode* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ParticleBatchNode*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setBatchNode : Error processing arguments\");\n\t\tcobj->setBatchNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setBatchNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getTangentialAccelVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getTangentialAccelVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getTangentialAccelVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getTangentialAccelVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEmitterMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEmitterMode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getEmitterMode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEmitterMode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndSpinVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSpinVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSpinVar : Error processing arguments\");\n\t\tcobj->setEndSpinVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndSpinVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getAngleVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getAngleVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getAngleVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getAngleVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color4F arg0;\n\t\tok &= jsval_to_cccolor4f(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartColor : Error processing arguments\");\n\t\tcobj->setStartColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getRotatePerSecondVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getRotatePerSecondVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRotatePerSecondVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getRotatePerSecondVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEndSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getLife(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getLife : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getLife();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getLife : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setSpeedVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setSpeedVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setSpeedVar : Error processing arguments\");\n\t\tcobj->setSpeedVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setSpeedVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setAutoRemoveOnFinish(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAutoRemoveOnFinish : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setAutoRemoveOnFinish : Error processing arguments\");\n\t\tcobj->setAutoRemoveOnFinish(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setAutoRemoveOnFinish : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setGravity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setGravity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setGravity : Error processing arguments\");\n\t\tcobj->setGravity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setGravity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_postStep(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_postStep : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->postStep();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_postStep : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEmissionRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEmissionRate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEmissionRate : Error processing arguments\");\n\t\tcobj->setEmissionRate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEmissionRate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndColorVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndColorVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color4F& ret = cobj->getEndColorVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor4f_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndColorVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getRotationIsDir(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getRotationIsDir : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getRotationIsDir();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getRotationIsDir : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setScale : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setScale : Error processing arguments\");\n\t\tcobj->setScale(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setScale : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEmissionRate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEmissionRate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEmissionRate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEmissionRate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color4F& ret = cobj->getEndColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor4f_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getLifeVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getLifeVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getLifeVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getLifeVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartSizeVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSizeVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartSizeVar : Error processing arguments\");\n\t\tcobj->setStartSizeVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartSizeVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setOpacityModifyRGB : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setOpacityModifyRGB : Error processing arguments\");\n\t\tcobj->setOpacityModifyRGB(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setOpacityModifyRGB : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_addParticle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_addParticle : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->addParticle();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_addParticle : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getStartRadius(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartRadius : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getStartRadius();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartRadius : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getParticleCount(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getParticleCount : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned int ret = cobj->getParticleCount();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getParticleCount : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getStartRadiusVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartRadiusVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getStartRadiusVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartRadiusVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartColorVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartColorVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color4F arg0;\n\t\tok &= jsval_to_cccolor4f(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartColorVar : Error processing arguments\");\n\t\tcobj->setStartColorVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartColorVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setEndSpin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSpin : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setEndSpin : Error processing arguments\");\n\t\tcobj->setEndSpin(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setEndSpin : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setRadialAccel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRadialAccel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setRadialAccel : Error processing arguments\");\n\t\tcobj->setRadialAccel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setRadialAccel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_isAutoRemoveOnFinish(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_isAutoRemoveOnFinish : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isAutoRemoveOnFinish();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_isAutoRemoveOnFinish : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getTotalParticles : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getTotalParticles();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getTotalParticles : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_setStartRadiusVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartRadiusVar : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_setStartRadiusVar : Error processing arguments\");\n\t\tcobj->setStartRadiusVar(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_setStartRadiusVar : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getEndRadiusVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getEndRadiusVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEndRadiusVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getEndRadiusVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_getStartColorVar(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystem* cobj = (cocos2d::ParticleSystem *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_getStartColorVar : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color4F& ret = cobj->getStartColorVar();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor4f_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_getStartColorVar : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystem_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_create : Error processing arguments\");\n\t\tcocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSystem>(cx, (cocos2d::ParticleSystem*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleSystem_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystem_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSystem>(cx, (cocos2d::ParticleSystem*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystem_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_ParticleSystem_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleSystem)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleSystem(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleSystem_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleSystem_class->name = \"ParticleSystem\";\n\tjsb_cocos2d_ParticleSystem_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSystem_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleSystem_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSystem_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleSystem_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleSystem_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleSystem_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleSystem_class->finalize = js_cocos2d_ParticleSystem_finalize;\n\tjsb_cocos2d_ParticleSystem_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getStartSizeVar\", js_cocos2dx_ParticleSystem_getStartSizeVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTexture\", js_cocos2dx_ParticleSystem_getTexture, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFull\", js_cocos2dx_ParticleSystem_isFull, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBatchNode\", js_cocos2dx_ParticleSystem_getBatchNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartColor\", js_cocos2dx_ParticleSystem_getStartColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPositionType\", js_cocos2dx_ParticleSystem_getPositionType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPosVar\", js_cocos2dx_ParticleSystem_setPosVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndSpin\", js_cocos2dx_ParticleSystem_getEndSpin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotatePerSecondVar\", js_cocos2dx_ParticleSystem_setRotatePerSecondVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartSpinVar\", js_cocos2dx_ParticleSystem_getStartSpinVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRadialAccelVar\", js_cocos2dx_ParticleSystem_getRadialAccelVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndSizeVar\", js_cocos2dx_ParticleSystem_getEndSizeVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotation\", js_cocos2dx_ParticleSystem_setRotation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTangentialAccel\", js_cocos2dx_ParticleSystem_setTangentialAccel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScaleY\", js_cocos2dx_ParticleSystem_setScaleY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScaleX\", js_cocos2dx_ParticleSystem_setScaleX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRadialAccel\", js_cocos2dx_ParticleSystem_getRadialAccel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartRadius\", js_cocos2dx_ParticleSystem_setStartRadius, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotatePerSecond\", js_cocos2dx_ParticleSystem_setRotatePerSecond, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndSize\", js_cocos2dx_ParticleSystem_setEndSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGravity\", js_cocos2dx_ParticleSystem_getGravity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTangentialAccel\", js_cocos2dx_ParticleSystem_getTangentialAccel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndRadius\", js_cocos2dx_ParticleSystem_setEndRadius, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpeed\", js_cocos2dx_ParticleSystem_getSpeed, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAngle\", js_cocos2dx_ParticleSystem_getAngle, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndColor\", js_cocos2dx_ParticleSystem_setEndColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartSpin\", js_cocos2dx_ParticleSystem_setStartSpin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDuration\", js_cocos2dx_ParticleSystem_setDuration, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTexture\", js_cocos2dx_ParticleSystem_setTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPosVar\", js_cocos2dx_ParticleSystem_getPosVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateWithNoTime\", js_cocos2dx_ParticleSystem_updateWithNoTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isBlendAdditive\", js_cocos2dx_ParticleSystem_isBlendAdditive, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpeedVar\", js_cocos2dx_ParticleSystem_getSpeedVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPositionType\", js_cocos2dx_ParticleSystem_setPositionType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopSystem\", js_cocos2dx_ParticleSystem_stopSystem, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSourcePosition\", js_cocos2dx_ParticleSystem_getSourcePosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLifeVar\", js_cocos2dx_ParticleSystem_setLifeVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTotalParticles\", js_cocos2dx_ParticleSystem_setTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndColorVar\", js_cocos2dx_ParticleSystem_setEndColorVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateQuadWithParticle\", js_cocos2dx_ParticleSystem_updateQuadWithParticle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAtlasIndex\", js_cocos2dx_ParticleSystem_getAtlasIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartSize\", js_cocos2dx_ParticleSystem_getStartSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartSpinVar\", js_cocos2dx_ParticleSystem_setStartSpinVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resetSystem\", js_cocos2dx_ParticleSystem_resetSystem, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAtlasIndex\", js_cocos2dx_ParticleSystem_setAtlasIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTangentialAccelVar\", js_cocos2dx_ParticleSystem_setTangentialAccelVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndRadiusVar\", js_cocos2dx_ParticleSystem_setEndRadiusVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndRadius\", js_cocos2dx_ParticleSystem_getEndRadius, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isOpacityModifyRGB\", js_cocos2dx_ParticleSystem_isOpacityModifyRGB, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isActive\", js_cocos2dx_ParticleSystem_isActive, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRadialAccelVar\", js_cocos2dx_ParticleSystem_setRadialAccelVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartSize\", js_cocos2dx_ParticleSystem_setStartSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSpeed\", js_cocos2dx_ParticleSystem_setSpeed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartSpin\", js_cocos2dx_ParticleSystem_getStartSpin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRotatePerSecond\", js_cocos2dx_ParticleSystem_getRotatePerSecond, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initParticle\", js_cocos2dx_ParticleSystem_initParticle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEmitterMode\", js_cocos2dx_ParticleSystem_setEmitterMode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDuration\", js_cocos2dx_ParticleSystem_getDuration, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSourcePosition\", js_cocos2dx_ParticleSystem_setSourcePosition, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndSpinVar\", js_cocos2dx_ParticleSystem_getEndSpinVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBlendAdditive\", js_cocos2dx_ParticleSystem_setBlendAdditive, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLife\", js_cocos2dx_ParticleSystem_setLife, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAngleVar\", js_cocos2dx_ParticleSystem_setAngleVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRotationIsDir\", js_cocos2dx_ParticleSystem_setRotationIsDir, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndSizeVar\", js_cocos2dx_ParticleSystem_setEndSizeVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAngle\", js_cocos2dx_ParticleSystem_setAngle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBatchNode\", js_cocos2dx_ParticleSystem_setBatchNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTangentialAccelVar\", js_cocos2dx_ParticleSystem_getTangentialAccelVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEmitterMode\", js_cocos2dx_ParticleSystem_getEmitterMode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndSpinVar\", js_cocos2dx_ParticleSystem_setEndSpinVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAngleVar\", js_cocos2dx_ParticleSystem_getAngleVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartColor\", js_cocos2dx_ParticleSystem_setStartColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRotatePerSecondVar\", js_cocos2dx_ParticleSystem_getRotatePerSecondVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndSize\", js_cocos2dx_ParticleSystem_getEndSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLife\", js_cocos2dx_ParticleSystem_getLife, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSpeedVar\", js_cocos2dx_ParticleSystem_setSpeedVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAutoRemoveOnFinish\", js_cocos2dx_ParticleSystem_setAutoRemoveOnFinish, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGravity\", js_cocos2dx_ParticleSystem_setGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"postStep\", js_cocos2dx_ParticleSystem_postStep, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEmissionRate\", js_cocos2dx_ParticleSystem_setEmissionRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndColorVar\", js_cocos2dx_ParticleSystem_getEndColorVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRotationIsDir\", js_cocos2dx_ParticleSystem_getRotationIsDir, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScale\", js_cocos2dx_ParticleSystem_setScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEmissionRate\", js_cocos2dx_ParticleSystem_getEmissionRate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndColor\", js_cocos2dx_ParticleSystem_getEndColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLifeVar\", js_cocos2dx_ParticleSystem_getLifeVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartSizeVar\", js_cocos2dx_ParticleSystem_setStartSizeVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOpacityModifyRGB\", js_cocos2dx_ParticleSystem_setOpacityModifyRGB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addParticle\", js_cocos2dx_ParticleSystem_addParticle, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartRadius\", js_cocos2dx_ParticleSystem_getStartRadius, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParticleCount\", js_cocos2dx_ParticleSystem_getParticleCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartRadiusVar\", js_cocos2dx_ParticleSystem_getStartRadiusVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartColorVar\", js_cocos2dx_ParticleSystem_setStartColorVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEndSpin\", js_cocos2dx_ParticleSystem_setEndSpin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRadialAccel\", js_cocos2dx_ParticleSystem_setRadialAccel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isAutoRemoveOnFinish\", js_cocos2dx_ParticleSystem_isAutoRemoveOnFinish, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTotalParticles\", js_cocos2dx_ParticleSystem_getTotalParticles, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStartRadiusVar\", js_cocos2dx_ParticleSystem_setStartRadiusVar, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEndRadiusVar\", js_cocos2dx_ParticleSystem_getEndRadiusVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartColorVar\", js_cocos2dx_ParticleSystem_getStartColorVar, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleSystem_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleSystem_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleSystem_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_ParticleSystem_class,\n\t\tdummy_constructor<cocos2d::ParticleSystem>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleSystem\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleSystem> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleSystem_class;\n\t\tp->proto = jsb_cocos2d_ParticleSystem_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleSystemQuad_class;\nJSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nJSBool js_cocos2dx_ParticleSystemQuad_setDisplayFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystemQuad* cobj = (cocos2d::ParticleSystemQuad *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystemQuad_setDisplayFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystemQuad_setDisplayFrame : Error processing arguments\");\n\t\tcobj->setDisplayFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystemQuad_setDisplayFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystemQuad_setTextureWithRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParticleSystemQuad* cobj = (cocos2d::ParticleSystemQuad *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParticleSystemQuad_setTextureWithRect : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tcocos2d::Rect arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystemQuad_setTextureWithRect : Error processing arguments\");\n\t\tcobj->setTextureWithRect(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystemQuad_setTextureWithRect : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystemQuad_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSystemQuad>(cx, (cocos2d::ParticleSystemQuad*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSystemQuad>(cx, (cocos2d::ParticleSystemQuad*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystemQuad_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParticleSystemQuad_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSystemQuad_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSystemQuad>(cx, (cocos2d::ParticleSystemQuad*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSystemQuad_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystem_prototype;\n\nvoid js_cocos2d_ParticleSystemQuad_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleSystemQuad)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleSystemQuad(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleSystemQuad_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleSystemQuad_class->name = \"ParticleSystem\";\n\tjsb_cocos2d_ParticleSystemQuad_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSystemQuad_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleSystemQuad_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSystemQuad_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleSystemQuad_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleSystemQuad_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleSystemQuad_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleSystemQuad_class->finalize = js_cocos2d_ParticleSystemQuad_finalize;\n\tjsb_cocos2d_ParticleSystemQuad_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setDisplayFrame\", js_cocos2dx_ParticleSystemQuad_setDisplayFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextureWithRect\", js_cocos2dx_ParticleSystemQuad_setTextureWithRect, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleSystemQuad_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleSystemQuad_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleSystemQuad_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystem_prototype,\n\t\tjsb_cocos2d_ParticleSystemQuad_class,\n\t\tdummy_constructor<cocos2d::ParticleSystemQuad>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleSystem\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleSystemQuad> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleSystemQuad_class;\n\t\tp->proto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystem_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleFire_class;\nJSObject *jsb_cocos2d_ParticleFire_prototype;\n\nJSBool js_cocos2dx_ParticleFire_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleFire* ret = cocos2d::ParticleFire::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleFire>(cx, (cocos2d::ParticleFire*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleFire_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleFire_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleFire_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleFire* ret = cocos2d::ParticleFire::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleFire>(cx, (cocos2d::ParticleFire*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleFire_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleFire_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleFire)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleFire(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleFire_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleFire_class->name = \"ParticleFire\";\n\tjsb_cocos2d_ParticleFire_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleFire_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleFire_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleFire_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleFire_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleFire_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleFire_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleFire_class->finalize = js_cocos2d_ParticleFire_finalize;\n\tjsb_cocos2d_ParticleFire_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleFire_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleFire_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleFire_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleFire_class,\n\t\tdummy_constructor<cocos2d::ParticleFire>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleFire\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleFire> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleFire_class;\n\t\tp->proto = jsb_cocos2d_ParticleFire_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleFireworks_class;\nJSObject *jsb_cocos2d_ParticleFireworks_prototype;\n\nJSBool js_cocos2dx_ParticleFireworks_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleFireworks>(cx, (cocos2d::ParticleFireworks*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleFireworks_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleFireworks_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleFireworks_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleFireworks>(cx, (cocos2d::ParticleFireworks*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleFireworks_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleFireworks_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleFireworks)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleFireworks(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleFireworks_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleFireworks_class->name = \"ParticleFireworks\";\n\tjsb_cocos2d_ParticleFireworks_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleFireworks_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleFireworks_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleFireworks_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleFireworks_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleFireworks_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleFireworks_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleFireworks_class->finalize = js_cocos2d_ParticleFireworks_finalize;\n\tjsb_cocos2d_ParticleFireworks_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleFireworks_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleFireworks_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleFireworks_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleFireworks_class,\n\t\tdummy_constructor<cocos2d::ParticleFireworks>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleFireworks\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleFireworks> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleFireworks_class;\n\t\tp->proto = jsb_cocos2d_ParticleFireworks_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleSun_class;\nJSObject *jsb_cocos2d_ParticleSun_prototype;\n\nJSBool js_cocos2dx_ParticleSun_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleSun* ret = cocos2d::ParticleSun::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSun>(cx, (cocos2d::ParticleSun*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSun_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleSun_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSun_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleSun* ret = cocos2d::ParticleSun::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSun>(cx, (cocos2d::ParticleSun*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSun_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleSun_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleSun)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleSun(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleSun_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleSun_class->name = \"ParticleSun\";\n\tjsb_cocos2d_ParticleSun_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSun_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleSun_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSun_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleSun_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleSun_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleSun_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleSun_class->finalize = js_cocos2d_ParticleSun_finalize;\n\tjsb_cocos2d_ParticleSun_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleSun_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleSun_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleSun_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleSun_class,\n\t\tdummy_constructor<cocos2d::ParticleSun>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleSun\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleSun> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleSun_class;\n\t\tp->proto = jsb_cocos2d_ParticleSun_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleGalaxy_class;\nJSObject *jsb_cocos2d_ParticleGalaxy_prototype;\n\nJSBool js_cocos2dx_ParticleGalaxy_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleGalaxy>(cx, (cocos2d::ParticleGalaxy*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleGalaxy_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleGalaxy_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleGalaxy_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleGalaxy>(cx, (cocos2d::ParticleGalaxy*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleGalaxy_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleGalaxy_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleGalaxy)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleGalaxy(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleGalaxy_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleGalaxy_class->name = \"ParticleGalaxy\";\n\tjsb_cocos2d_ParticleGalaxy_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleGalaxy_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleGalaxy_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleGalaxy_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleGalaxy_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleGalaxy_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleGalaxy_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleGalaxy_class->finalize = js_cocos2d_ParticleGalaxy_finalize;\n\tjsb_cocos2d_ParticleGalaxy_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleGalaxy_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleGalaxy_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleGalaxy_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleGalaxy_class,\n\t\tdummy_constructor<cocos2d::ParticleGalaxy>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleGalaxy\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleGalaxy> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleGalaxy_class;\n\t\tp->proto = jsb_cocos2d_ParticleGalaxy_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleFlower_class;\nJSObject *jsb_cocos2d_ParticleFlower_prototype;\n\nJSBool js_cocos2dx_ParticleFlower_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleFlower>(cx, (cocos2d::ParticleFlower*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleFlower_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleFlower_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleFlower_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleFlower>(cx, (cocos2d::ParticleFlower*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleFlower_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleFlower_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleFlower)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleFlower(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleFlower_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleFlower_class->name = \"ParticleFlower\";\n\tjsb_cocos2d_ParticleFlower_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleFlower_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleFlower_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleFlower_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleFlower_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleFlower_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleFlower_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleFlower_class->finalize = js_cocos2d_ParticleFlower_finalize;\n\tjsb_cocos2d_ParticleFlower_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleFlower_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleFlower_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleFlower_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleFlower_class,\n\t\tdummy_constructor<cocos2d::ParticleFlower>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleFlower\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleFlower> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleFlower_class;\n\t\tp->proto = jsb_cocos2d_ParticleFlower_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleMeteor_class;\nJSObject *jsb_cocos2d_ParticleMeteor_prototype;\n\nJSBool js_cocos2dx_ParticleMeteor_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleMeteor>(cx, (cocos2d::ParticleMeteor*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleMeteor_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleMeteor_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleMeteor_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleMeteor>(cx, (cocos2d::ParticleMeteor*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleMeteor_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleMeteor_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleMeteor)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleMeteor(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleMeteor_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleMeteor_class->name = \"ParticleMeteor\";\n\tjsb_cocos2d_ParticleMeteor_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleMeteor_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleMeteor_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleMeteor_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleMeteor_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleMeteor_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleMeteor_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleMeteor_class->finalize = js_cocos2d_ParticleMeteor_finalize;\n\tjsb_cocos2d_ParticleMeteor_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleMeteor_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleMeteor_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleMeteor_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleMeteor_class,\n\t\tdummy_constructor<cocos2d::ParticleMeteor>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleMeteor\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleMeteor> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleMeteor_class;\n\t\tp->proto = jsb_cocos2d_ParticleMeteor_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleSpiral_class;\nJSObject *jsb_cocos2d_ParticleSpiral_prototype;\n\nJSBool js_cocos2dx_ParticleSpiral_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSpiral>(cx, (cocos2d::ParticleSpiral*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSpiral_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleSpiral_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSpiral_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSpiral>(cx, (cocos2d::ParticleSpiral*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSpiral_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleSpiral_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleSpiral)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleSpiral(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleSpiral_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleSpiral_class->name = \"ParticleSpiral\";\n\tjsb_cocos2d_ParticleSpiral_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSpiral_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleSpiral_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSpiral_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleSpiral_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleSpiral_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleSpiral_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleSpiral_class->finalize = js_cocos2d_ParticleSpiral_finalize;\n\tjsb_cocos2d_ParticleSpiral_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleSpiral_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleSpiral_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleSpiral_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleSpiral_class,\n\t\tdummy_constructor<cocos2d::ParticleSpiral>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleSpiral\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleSpiral> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleSpiral_class;\n\t\tp->proto = jsb_cocos2d_ParticleSpiral_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleExplosion_class;\nJSObject *jsb_cocos2d_ParticleExplosion_prototype;\n\nJSBool js_cocos2dx_ParticleExplosion_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleExplosion>(cx, (cocos2d::ParticleExplosion*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleExplosion_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleExplosion_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleExplosion_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleExplosion>(cx, (cocos2d::ParticleExplosion*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleExplosion_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleExplosion_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleExplosion)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleExplosion(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleExplosion_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleExplosion_class->name = \"ParticleExplosion\";\n\tjsb_cocos2d_ParticleExplosion_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleExplosion_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleExplosion_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleExplosion_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleExplosion_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleExplosion_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleExplosion_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleExplosion_class->finalize = js_cocos2d_ParticleExplosion_finalize;\n\tjsb_cocos2d_ParticleExplosion_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleExplosion_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleExplosion_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleExplosion_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleExplosion_class,\n\t\tdummy_constructor<cocos2d::ParticleExplosion>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleExplosion\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleExplosion> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleExplosion_class;\n\t\tp->proto = jsb_cocos2d_ParticleExplosion_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleSmoke_class;\nJSObject *jsb_cocos2d_ParticleSmoke_prototype;\n\nJSBool js_cocos2dx_ParticleSmoke_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSmoke>(cx, (cocos2d::ParticleSmoke*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSmoke_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleSmoke_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSmoke_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSmoke>(cx, (cocos2d::ParticleSmoke*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSmoke_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleSmoke_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleSmoke)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleSmoke(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleSmoke_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleSmoke_class->name = \"ParticleSmoke\";\n\tjsb_cocos2d_ParticleSmoke_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSmoke_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleSmoke_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSmoke_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleSmoke_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleSmoke_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleSmoke_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleSmoke_class->finalize = js_cocos2d_ParticleSmoke_finalize;\n\tjsb_cocos2d_ParticleSmoke_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleSmoke_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleSmoke_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleSmoke_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleSmoke_class,\n\t\tdummy_constructor<cocos2d::ParticleSmoke>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleSmoke\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleSmoke> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleSmoke_class;\n\t\tp->proto = jsb_cocos2d_ParticleSmoke_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleSnow_class;\nJSObject *jsb_cocos2d_ParticleSnow_prototype;\n\nJSBool js_cocos2dx_ParticleSnow_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSnow>(cx, (cocos2d::ParticleSnow*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSnow_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleSnow_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleSnow_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleSnow>(cx, (cocos2d::ParticleSnow*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleSnow_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleSnow_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleSnow)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleSnow(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleSnow_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleSnow_class->name = \"ParticleSnow\";\n\tjsb_cocos2d_ParticleSnow_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSnow_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleSnow_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleSnow_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleSnow_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleSnow_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleSnow_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleSnow_class->finalize = js_cocos2d_ParticleSnow_finalize;\n\tjsb_cocos2d_ParticleSnow_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleSnow_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleSnow_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleSnow_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleSnow_class,\n\t\tdummy_constructor<cocos2d::ParticleSnow>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleSnow\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleSnow> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleSnow_class;\n\t\tp->proto = jsb_cocos2d_ParticleSnow_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParticleRain_class;\nJSObject *jsb_cocos2d_ParticleRain_prototype;\n\nJSBool js_cocos2dx_ParticleRain_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParticleRain* ret = cocos2d::ParticleRain::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleRain>(cx, (cocos2d::ParticleRain*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleRain_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ParticleRain_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParticleRain_createWithTotalParticles : Error processing arguments\");\n\t\tcocos2d::ParticleRain* ret = cocos2d::ParticleRain::createWithTotalParticles(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParticleRain>(cx, (cocos2d::ParticleRain*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParticleRain_createWithTotalParticles : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nvoid js_cocos2d_ParticleRain_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParticleRain)\", obj);\n}\n\nvoid js_register_cocos2dx_ParticleRain(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParticleRain_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParticleRain_class->name = \"ParticleRain\";\n\tjsb_cocos2d_ParticleRain_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleRain_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParticleRain_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParticleRain_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParticleRain_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParticleRain_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParticleRain_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParticleRain_class->finalize = js_cocos2d_ParticleRain_finalize;\n\tjsb_cocos2d_ParticleRain_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParticleRain_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithTotalParticles\", js_cocos2dx_ParticleRain_createWithTotalParticles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParticleRain_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_ParticleSystemQuad_prototype,\n\t\tjsb_cocos2d_ParticleRain_class,\n\t\tdummy_constructor<cocos2d::ParticleRain>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParticleRain\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParticleRain> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParticleRain_class;\n\t\tp->proto = jsb_cocos2d_ParticleRain_prototype;\n\t\tp->parentProto = jsb_cocos2d_ParticleSystemQuad_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_FileUtils_class;\nJSObject *jsb_cocos2d_FileUtils_prototype;\n\nJSBool js_cocos2dx_FileUtils_fullPathForFilename(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_fullPathForFilename : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_fullPathForFilename : Error processing arguments\");\n\t\tstd::string ret = cobj->fullPathForFilename(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_fullPathForFilename : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_getStringFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_getStringFromFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_getStringFromFile : Error processing arguments\");\n\t\tstd::string ret = cobj->getStringFromFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_getStringFromFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_setFilenameLookupDictionary(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_setFilenameLookupDictionary : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMap arg0;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_setFilenameLookupDictionary : Error processing arguments\");\n\t\tcobj->setFilenameLookupDictionary(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_setFilenameLookupDictionary : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_isAbsolutePath(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_isAbsolutePath : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_isAbsolutePath : Error processing arguments\");\n\t\tJSBool ret = cobj->isAbsolutePath(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_isAbsolutePath : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile : Error processing arguments\");\n\t\tcobj->loadFilenameLookupDictionaryFromFile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_isPopupNotify(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_isPopupNotify : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isPopupNotify();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_isPopupNotify : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_getValueVectorFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_getValueVectorFromFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_getValueVectorFromFile : Error processing arguments\");\n\t\tcocos2d::ValueVector ret = cobj->getValueVectorFromFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_getValueVectorFromFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_writeToFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_writeToFile : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::ValueMap arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_writeToFile : Error processing arguments\");\n\t\tJSBool ret = cobj->writeToFile(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_writeToFile : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_getValueMapFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_getValueMapFromFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_getValueMapFromFile : Error processing arguments\");\n\t\tcocos2d::ValueMap ret = cobj->getValueMapFromFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_getValueMapFromFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_addSearchResolutionsOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_addSearchResolutionsOrder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_addSearchResolutionsOrder : Error processing arguments\");\n\t\tcobj->addSearchResolutionsOrder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_addSearchResolutionsOrder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_addSearchPath(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_addSearchPath : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_addSearchPath : Error processing arguments\");\n\t\tcobj->addSearchPath(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_addSearchPath : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_isFileExist(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_isFileExist : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_isFileExist : Error processing arguments\");\n\t\tJSBool ret = cobj->isFileExist(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_isFileExist : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_purgeCachedEntries(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_purgeCachedEntries : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->purgeCachedEntries();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_purgeCachedEntries : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_fullPathFromRelativeFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_FileUtils_fullPathFromRelativeFile : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_FileUtils_fullPathFromRelativeFile : Error processing arguments\");\n\t\tstd::string ret = cobj->fullPathFromRelativeFile(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_fullPathFromRelativeFile : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_FileUtils_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::FileUtils* ret = cocos2d::FileUtils::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FileUtils>(cx, (cocos2d::FileUtils*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_FileUtils_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_FileUtils_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (FileUtils)\", obj);\n}\n\nvoid js_register_cocos2dx_FileUtils(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_FileUtils_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_FileUtils_class->name = \"FileUtils\";\n\tjsb_cocos2d_FileUtils_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_FileUtils_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_FileUtils_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_FileUtils_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_FileUtils_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_FileUtils_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_FileUtils_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_FileUtils_class->finalize = js_cocos2d_FileUtils_finalize;\n\tjsb_cocos2d_FileUtils_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"fullPathForFilename\", js_cocos2dx_FileUtils_fullPathForFilename, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringFromFile\", js_cocos2dx_FileUtils_getStringFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFilenameLookupDictionary\", js_cocos2dx_FileUtils_setFilenameLookupDictionary, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isAbsolutePath\", js_cocos2dx_FileUtils_isAbsolutePath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadFilenameLookup\", js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isPopupNotify\", js_cocos2dx_FileUtils_isPopupNotify, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getValueVectorFromFile\", js_cocos2dx_FileUtils_getValueVectorFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"writeToFile\", js_cocos2dx_FileUtils_writeToFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getValueMapFromFile\", js_cocos2dx_FileUtils_getValueMapFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSearchResolutionsOrder\", js_cocos2dx_FileUtils_addSearchResolutionsOrder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSearchPath\", js_cocos2dx_FileUtils_addSearchPath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFileExist\", js_cocos2dx_FileUtils_isFileExist, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"purgeCachedEntries\", js_cocos2dx_FileUtils_purgeCachedEntries, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"fullPathFromRelativeFile\", js_cocos2dx_FileUtils_fullPathFromRelativeFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"getInstance\", js_cocos2dx_FileUtils_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_FileUtils_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_FileUtils_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"FileUtils\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::FileUtils> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_FileUtils_class;\n\t\tp->proto = jsb_cocos2d_FileUtils_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SAXParser_class;\nJSObject *jsb_cocos2d_SAXParser_prototype;\n\nJSBool js_cocos2dx_SAXParser_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SAXParser* cobj = (cocos2d::SAXParser *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SAXParser_init : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SAXParser_init : Error processing arguments\");\n\t\tJSBool ret = cobj->init(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SAXParser_init : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_SAXParser_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SAXParser)\", obj);\n}\n\nvoid js_register_cocos2dx_SAXParser(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SAXParser_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SAXParser_class->name = \"SAXParser\";\n\tjsb_cocos2d_SAXParser_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SAXParser_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SAXParser_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SAXParser_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SAXParser_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SAXParser_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SAXParser_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SAXParser_class->finalize = js_cocos2d_SAXParser_finalize;\n\tjsb_cocos2d_SAXParser_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"init\", js_cocos2dx_SAXParser_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_SAXParser_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_SAXParser_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SAXParser\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SAXParser> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SAXParser_class;\n\t\tp->proto = jsb_cocos2d_SAXParser_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Application_class;\nJSObject *jsb_cocos2d_Application_prototype;\n\nJSBool js_cocos2dx_Application_getTargetPlatform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Application_getTargetPlatform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getTargetPlatform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Application_getTargetPlatform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Application_setAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Application_setAnimationInterval : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Application_setAnimationInterval : Error processing arguments\");\n\t\tcobj->setAnimationInterval(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Application_setAnimationInterval : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Application_getCurrentLanguage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Application* cobj = (cocos2d::Application *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Application_getCurrentLanguage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getCurrentLanguage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Application_getCurrentLanguage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Application* ret = cocos2d::Application::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Application>(cx, (cocos2d::Application*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Application_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Application_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Application)\", obj);\n}\n\nvoid js_register_cocos2dx_Application(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Application_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Application_class->name = \"Application\";\n\tjsb_cocos2d_Application_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Application_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Application_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Application_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Application_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Application_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Application_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Application_class->finalize = js_cocos2d_Application_finalize;\n\tjsb_cocos2d_Application_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getTargetPlatform\", js_cocos2dx_Application_getTargetPlatform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimationInterval\", js_cocos2dx_Application_setAnimationInterval, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentLanguage\", js_cocos2dx_Application_getCurrentLanguage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"getInstance\", js_cocos2dx_Application_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Application_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Application_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Application\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Application> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Application_class;\n\t\tp->proto = jsb_cocos2d_Application_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EGLViewProtocol_class;\nJSObject *jsb_cocos2d_EGLViewProtocol_prototype;\n\nJSBool js_cocos2dx_EGLViewProtocol_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EGLViewProtocol* cobj = (cocos2d::EGLViewProtocol *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EGLViewProtocol_getVisibleOrigin : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getVisibleOrigin();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EGLViewProtocol_getVisibleOrigin : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_EGLViewProtocol_getVisibleSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EGLViewProtocol* cobj = (cocos2d::EGLViewProtocol *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EGLViewProtocol_getVisibleSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getVisibleSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EGLViewProtocol_getVisibleSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_EGLViewProtocol_setDesignResolutionSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EGLViewProtocol* cobj = (cocos2d::EGLViewProtocol *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EGLViewProtocol_setDesignResolutionSize : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tResolutionPolicy arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EGLViewProtocol_setDesignResolutionSize : Error processing arguments\");\n\t\tcobj->setDesignResolutionSize(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EGLViewProtocol_setDesignResolutionSize : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_EGLViewProtocol_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EGLViewProtocol)\", obj);\n}\n\nvoid js_register_cocos2dx_EGLViewProtocol(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EGLViewProtocol_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EGLViewProtocol_class->name = \"EGLViewProtocol\";\n\tjsb_cocos2d_EGLViewProtocol_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EGLViewProtocol_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EGLViewProtocol_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EGLViewProtocol_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EGLViewProtocol_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EGLViewProtocol_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EGLViewProtocol_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EGLViewProtocol_class->finalize = js_cocos2d_EGLViewProtocol_finalize;\n\tjsb_cocos2d_EGLViewProtocol_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getVisibleOrigin\", js_cocos2dx_EGLViewProtocol_getVisibleOrigin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVisibleSize\", js_cocos2dx_EGLViewProtocol_getVisibleSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDesignResolutionSize\", js_cocos2dx_EGLViewProtocol_setDesignResolutionSize, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_EGLViewProtocol_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_EGLViewProtocol_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EGLViewProtocol\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EGLViewProtocol> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EGLViewProtocol_class;\n\t\tp->proto = jsb_cocos2d_EGLViewProtocol_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_EGLView_class;\nJSObject *jsb_cocos2d_EGLView_prototype;\n\nJSBool js_cocos2dx_EGLView_setIMEKeyboardState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EGLView* cobj = (cocos2d::EGLView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EGLView_setIMEKeyboardState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_EGLView_setIMEKeyboardState : Error processing arguments\");\n\t\tcobj->setIMEKeyboardState(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EGLView_setIMEKeyboardState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_EGLView_isOpenGLReady(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::EGLView* cobj = (cocos2d::EGLView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_EGLView_isOpenGLReady : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isOpenGLReady();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_EGLView_isOpenGLReady : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_EGLView_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::EGLView* ret = cocos2d::EGLView::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::EGLView>(cx, (cocos2d::EGLView*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_EGLView_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_EGLViewProtocol_prototype;\n\nvoid js_cocos2d_EGLView_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EGLView)\", obj);\n}\n\nvoid js_register_cocos2dx_EGLView(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_EGLView_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_EGLView_class->name = \"EGLView\";\n\tjsb_cocos2d_EGLView_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_EGLView_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_EGLView_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_EGLView_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_EGLView_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_EGLView_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_EGLView_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_EGLView_class->finalize = js_cocos2d_EGLView_finalize;\n\tjsb_cocos2d_EGLView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setIMEKeyboardState\", js_cocos2dx_EGLView_setIMEKeyboardState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isOpenGLReady\", js_cocos2dx_EGLView_isOpenGLReady, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"getInstance\", js_cocos2dx_EGLView_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_EGLView_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_EGLViewProtocol_prototype,\n\t\tjsb_cocos2d_EGLView_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EGLView\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::EGLView> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_EGLView_class;\n\t\tp->proto = jsb_cocos2d_EGLView_prototype;\n\t\tp->parentProto = jsb_cocos2d_EGLViewProtocol_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ShaderCache_class;\nJSObject *jsb_cocos2d_ShaderCache_prototype;\n\nJSBool js_cocos2dx_ShaderCache_reloadDefaultShaders(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ShaderCache* cobj = (cocos2d::ShaderCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ShaderCache_reloadDefaultShaders : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->reloadDefaultShaders();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShaderCache_reloadDefaultShaders : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ShaderCache_addProgram(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ShaderCache* cobj = (cocos2d::ShaderCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ShaderCache_addProgram : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::GLProgram* arg0;\n\t\tstd::string arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::GLProgram*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShaderCache_addProgram : Error processing arguments\");\n\t\tcobj->addProgram(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShaderCache_addProgram : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ShaderCache_getProgram(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ShaderCache* cobj = (cocos2d::ShaderCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ShaderCache_getProgram : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ShaderCache_getProgram : Error processing arguments\");\n\t\tcocos2d::GLProgram* ret = cobj->getProgram(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GLProgram>(cx, (cocos2d::GLProgram*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShaderCache_getProgram : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ShaderCache_loadDefaultShaders(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ShaderCache* cobj = (cocos2d::ShaderCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ShaderCache_loadDefaultShaders : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->loadDefaultShaders();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShaderCache_loadDefaultShaders : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ShaderCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ShaderCache::destroyInstance();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ShaderCache_destroyInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ShaderCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ShaderCache* ret = cocos2d::ShaderCache::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ShaderCache>(cx, (cocos2d::ShaderCache*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ShaderCache_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ShaderCache_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ShaderCache* cobj = new cocos2d::ShaderCache();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::ShaderCache> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::ShaderCache\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ShaderCache_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_ShaderCache_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ShaderCache)\", obj);\n}\n\nvoid js_register_cocos2dx_ShaderCache(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ShaderCache_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ShaderCache_class->name = \"ShaderCache\";\n\tjsb_cocos2d_ShaderCache_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShaderCache_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ShaderCache_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ShaderCache_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ShaderCache_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ShaderCache_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ShaderCache_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ShaderCache_class->finalize = js_cocos2d_ShaderCache_finalize;\n\tjsb_cocos2d_ShaderCache_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"reloadDefaultShaders\", js_cocos2dx_ShaderCache_reloadDefaultShaders, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addProgram\", js_cocos2dx_ShaderCache_addProgram, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProgram\", js_cocos2dx_ShaderCache_getProgram, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadDefaultShaders\", js_cocos2dx_ShaderCache_loadDefaultShaders, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"destroyInstance\", js_cocos2dx_ShaderCache_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_ShaderCache_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ShaderCache_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_ShaderCache_class,\n\t\tjs_cocos2dx_ShaderCache_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ShaderCache\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ShaderCache> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ShaderCache_class;\n\t\tp->proto = jsb_cocos2d_ShaderCache_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_AnimationCache_class;\nJSObject *jsb_cocos2d_AnimationCache_prototype;\n\nJSBool js_cocos2dx_AnimationCache_getAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationCache* cobj = (cocos2d::AnimationCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_getAnimation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_getAnimation : Error processing arguments\");\n\t\tcocos2d::Animation* ret = cobj->getAnimation(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Animation>(cx, (cocos2d::Animation*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_getAnimation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationCache_addAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationCache* cobj = (cocos2d::AnimationCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_addAnimation : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Animation* arg0;\n\t\tstd::string arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Animation*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_addAnimation : Error processing arguments\");\n\t\tcobj->addAnimation(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_addAnimation : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationCache_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationCache* cobj = (cocos2d::AnimationCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationCache_addAnimationsWithDictionary(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationCache* cobj = (cocos2d::AnimationCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_addAnimationsWithDictionary : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::ValueMap arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_addAnimationsWithDictionary : Error processing arguments\");\n\t\tcobj->addAnimationsWithDictionary(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_addAnimationsWithDictionary : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationCache_removeAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationCache* cobj = (cocos2d::AnimationCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_removeAnimation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_removeAnimation : Error processing arguments\");\n\t\tcobj->removeAnimation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_removeAnimation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationCache_addAnimationsWithFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::AnimationCache* cobj = (cocos2d::AnimationCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_addAnimationsWithFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_AnimationCache_addAnimationsWithFile : Error processing arguments\");\n\t\tcobj->addAnimationsWithFile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_addAnimationsWithFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_AnimationCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::AnimationCache::destroyInstance();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_destroyInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_AnimationCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::AnimationCache* ret = cocos2d::AnimationCache::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::AnimationCache>(cx, (cocos2d::AnimationCache*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_AnimationCache_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::AnimationCache* cobj = new cocos2d::AnimationCache();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::AnimationCache> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::AnimationCache\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_AnimationCache_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_AnimationCache_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (AnimationCache)\", obj);\n}\n\nvoid js_register_cocos2dx_AnimationCache(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_AnimationCache_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_AnimationCache_class->name = \"AnimationCache\";\n\tjsb_cocos2d_AnimationCache_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_AnimationCache_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_AnimationCache_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_AnimationCache_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_AnimationCache_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_AnimationCache_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_AnimationCache_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_AnimationCache_class->finalize = js_cocos2d_AnimationCache_finalize;\n\tjsb_cocos2d_AnimationCache_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnimation\", js_cocos2dx_AnimationCache_getAnimation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addAnimation\", js_cocos2dx_AnimationCache_addAnimation, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_AnimationCache_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addAnimationsWithDictionary\", js_cocos2dx_AnimationCache_addAnimationsWithDictionary, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAnimation\", js_cocos2dx_AnimationCache_removeAnimation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addAnimations\", js_cocos2dx_AnimationCache_addAnimationsWithFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"destroyInstance\", js_cocos2dx_AnimationCache_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_AnimationCache_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_AnimationCache_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_AnimationCache_class,\n\t\tjs_cocos2dx_AnimationCache_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"AnimationCache\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::AnimationCache> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_AnimationCache_class;\n\t\tp->proto = jsb_cocos2d_AnimationCache_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_SpriteFrameCache_class;\nJSObject *jsb_cocos2d_SpriteFrameCache_prototype;\n\nJSBool js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::SpriteFrameCache* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addSpriteFramesWithFile(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addSpriteFramesWithFile(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addSpriteFramesWithFile(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_addSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_addSpriteFrame : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tstd::string arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_addSpriteFrame : Error processing arguments\");\n\t\tcobj->addSpriteFrame(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_addSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeUnusedSpriteFrames();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_getSpriteFrameByName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_getSpriteFrameByName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_getSpriteFrameByName : Error processing arguments\");\n\t\tcocos2d::SpriteFrame* ret = cobj->getSpriteFrameByName(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrame>(cx, (cocos2d::SpriteFrame*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_getSpriteFrameByName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile : Error processing arguments\");\n\t\tcobj->removeSpriteFramesFromFile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFrames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeSpriteFrames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeSpriteFrames();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_removeSpriteFrames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture : Error processing arguments\");\n\t\tcobj->removeSpriteFramesFromTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFrameByName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteFrameCache* cobj = (cocos2d::SpriteFrameCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeSpriteFrameByName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SpriteFrameCache_removeSpriteFrameByName : Error processing arguments\");\n\t\tcobj->removeSpriteFrameByName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_removeSpriteFrameByName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SpriteFrameCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::SpriteFrameCache::destroyInstance();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_destroyInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_SpriteFrameCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::SpriteFrameCache* ret = cocos2d::SpriteFrameCache::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::SpriteFrameCache>(cx, (cocos2d::SpriteFrameCache*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteFrameCache_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_SpriteFrameCache_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SpriteFrameCache)\", obj);\n}\n\nvoid js_register_cocos2dx_SpriteFrameCache(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_SpriteFrameCache_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_SpriteFrameCache_class->name = \"SpriteFrameCache\";\n\tjsb_cocos2d_SpriteFrameCache_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_SpriteFrameCache_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_SpriteFrameCache_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_SpriteFrameCache_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_SpriteFrameCache_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_SpriteFrameCache_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_SpriteFrameCache_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_SpriteFrameCache_class->finalize = js_cocos2d_SpriteFrameCache_finalize;\n\tjsb_cocos2d_SpriteFrameCache_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"addSpriteFrames\", js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSpriteFrame\", js_cocos2dx_SpriteFrameCache_addSpriteFrame, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeUnusedSpriteFrames\", js_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpriteFrame\", js_cocos2dx_SpriteFrameCache_getSpriteFrameByName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeSpriteFramesFromFile\", js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_SpriteFrameCache_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeSpriteFrames\", js_cocos2dx_SpriteFrameCache_removeSpriteFrames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeSpriteFramesFromTexture\", js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeSpriteFrameByName\", js_cocos2dx_SpriteFrameCache_removeSpriteFrameByName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"destroyInstance\", js_cocos2dx_SpriteFrameCache_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_SpriteFrameCache_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_SpriteFrameCache_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_SpriteFrameCache_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SpriteFrameCache\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::SpriteFrameCache> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_SpriteFrameCache_class;\n\t\tp->proto = jsb_cocos2d_SpriteFrameCache_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TextFieldTTF_class;\nJSObject *jsb_cocos2d_TextFieldTTF_prototype;\n\nJSBool js_cocos2dx_TextFieldTTF_getCharCount(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_getCharCount : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getCharCount();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_getCharCount : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_getDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_getDelegate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::TextFieldDelegate* ret = cobj->getDelegate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextFieldDelegate>(cx, (cocos2d::TextFieldDelegate*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_getDelegate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_setSecureTextEntry(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setSecureTextEntry : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setSecureTextEntry : Error processing arguments\");\n\t\tcobj->setSecureTextEntry(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_setSecureTextEntry : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_getColorSpaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_getColorSpaceHolder : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getColorSpaceHolder();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_getColorSpaceHolder : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_initWithPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TextFieldTTF* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_initWithPlaceHolder : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithPlaceHolder(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg1;\n\t\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg3;\n\t\t\tok &= jsval_to_std_string(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg4;\n\t\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithPlaceHolder(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_initWithPlaceHolder : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_setColorSpaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setColorSpaceHolder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setColorSpaceHolder : Error processing arguments\");\n\t\tcobj->setColorSpaceHolder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_setColorSpaceHolder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_detachWithIME(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_detachWithIME : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->detachWithIME();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_detachWithIME : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setDelegate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextFieldDelegate* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TextFieldDelegate*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setDelegate : Error processing arguments\");\n\t\tcobj->setDelegate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_setDelegate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_setPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setPlaceHolder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_setPlaceHolder : Error processing arguments\");\n\t\tcobj->setPlaceHolder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_setPlaceHolder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_isSecureTextEntry(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_isSecureTextEntry : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isSecureTextEntry();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_isSecureTextEntry : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_getPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_getPlaceHolder : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getPlaceHolder();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_getPlaceHolder : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_attachWithIME(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextFieldTTF* cobj = (cocos2d::TextFieldTTF *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextFieldTTF_attachWithIME : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->attachWithIME();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_attachWithIME : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextFieldTTF* ret = cocos2d::TextFieldTTF::textFieldWithPlaceHolder(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextFieldTTF>(cx, (cocos2d::TextFieldTTF*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 5) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Size arg1;\n\t\t\tok &= jsval_to_ccsize(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextHAlignment arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg3;\n\t\t\tok &= jsval_to_std_string(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg4;\n\t\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::TextFieldTTF* ret = cocos2d::TextFieldTTF::textFieldWithPlaceHolder(arg0, arg1, arg2, arg3, arg4);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TextFieldTTF>(cx, (cocos2d::TextFieldTTF*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextFieldTTF_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TextFieldTTF* cobj = new cocos2d::TextFieldTTF();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TextFieldTTF> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TextFieldTTF\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextFieldTTF_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_LabelTTF_prototype;\n\nvoid js_cocos2d_TextFieldTTF_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TextFieldTTF)\", obj);\n}\n\nvoid js_register_cocos2dx_TextFieldTTF(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TextFieldTTF_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TextFieldTTF_class->name = \"TextFieldTTF\";\n\tjsb_cocos2d_TextFieldTTF_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TextFieldTTF_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TextFieldTTF_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TextFieldTTF_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TextFieldTTF_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TextFieldTTF_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TextFieldTTF_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TextFieldTTF_class->finalize = js_cocos2d_TextFieldTTF_finalize;\n\tjsb_cocos2d_TextFieldTTF_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getCharCount\", js_cocos2dx_TextFieldTTF_getCharCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDelegate\", js_cocos2dx_TextFieldTTF_getDelegate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSecureTextEntry\", js_cocos2dx_TextFieldTTF_setSecureTextEntry, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getColorSpaceHolder\", js_cocos2dx_TextFieldTTF_getColorSpaceHolder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithPlaceHolder\", js_cocos2dx_TextFieldTTF_initWithPlaceHolder, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setColorSpaceHolder\", js_cocos2dx_TextFieldTTF_setColorSpaceHolder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"detachWithIME\", js_cocos2dx_TextFieldTTF_detachWithIME, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDelegate\", js_cocos2dx_TextFieldTTF_setDelegate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlaceHolder\", js_cocos2dx_TextFieldTTF_setPlaceHolder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isSecureTextEntry\", js_cocos2dx_TextFieldTTF_isSecureTextEntry, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPlaceHolder\", js_cocos2dx_TextFieldTTF_getPlaceHolder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"attachWithIME\", js_cocos2dx_TextFieldTTF_attachWithIME, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"textFieldWithPlaceHolder\", js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TextFieldTTF_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_LabelTTF_prototype,\n\t\tjsb_cocos2d_TextFieldTTF_class,\n\t\tjs_cocos2dx_TextFieldTTF_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TextFieldTTF\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TextFieldTTF> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TextFieldTTF_class;\n\t\tp->proto = jsb_cocos2d_TextFieldTTF_prototype;\n\t\tp->parentProto = jsb_cocos2d_LabelTTF_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TextureCache_class;\nJSObject *jsb_cocos2d_TextureCache_prototype;\n\nJSBool js_cocos2dx_TextureCache_removeTextureForKey(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_removeTextureForKey : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TextureCache_removeTextureForKey : Error processing arguments\");\n\t\tcobj->removeTextureForKey(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_removeTextureForKey : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_removeAllTextures(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_removeAllTextures : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeAllTextures();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_removeAllTextures : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_getDescription(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_getDescription : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getDescription();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_getDescription : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_getCachedTextureInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_getCachedTextureInfo : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getCachedTextureInfo();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_getCachedTextureInfo : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_addImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TextureCache* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_addImage : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Image* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Image*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* ret = cobj->addImage(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Texture2D* ret = cobj->addImage(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_addImage : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_getTextureForKey(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_getTextureForKey : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TextureCache_getTextureForKey : Error processing arguments\");\n\t\tcocos2d::Texture2D* ret = cobj->getTextureForKey(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Texture2D>(cx, (cocos2d::Texture2D*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_getTextureForKey : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_removeUnusedTextures(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_removeUnusedTextures : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeUnusedTextures();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_removeUnusedTextures : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_removeTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_removeTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Texture2D* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Texture2D*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TextureCache_removeTexture : Error processing arguments\");\n\t\tcobj->removeTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_removeTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_waitForQuit(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TextureCache* cobj = (cocos2d::TextureCache *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TextureCache_waitForQuit : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->waitForQuit();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_waitForQuit : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TextureCache_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TextureCache* cobj = new cocos2d::TextureCache();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TextureCache> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TextureCache\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TextureCache_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_TextureCache_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TextureCache)\", obj);\n}\n\nvoid js_register_cocos2dx_TextureCache(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TextureCache_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TextureCache_class->name = \"TextureCache\";\n\tjsb_cocos2d_TextureCache_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TextureCache_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TextureCache_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TextureCache_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TextureCache_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TextureCache_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TextureCache_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TextureCache_class->finalize = js_cocos2d_TextureCache_finalize;\n\tjsb_cocos2d_TextureCache_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"removeTextureForKey\", js_cocos2dx_TextureCache_removeTextureForKey, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllTextures\", js_cocos2dx_TextureCache_removeAllTextures, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDescription\", js_cocos2dx_TextureCache_getDescription, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCachedTextureInfo\", js_cocos2dx_TextureCache_getCachedTextureInfo, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addImage\", js_cocos2dx_TextureCache_addImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureForKey\", js_cocos2dx_TextureCache_getTextureForKey, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeUnusedTextures\", js_cocos2dx_TextureCache_removeUnusedTextures, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeTexture\", js_cocos2dx_TextureCache_removeTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"waitForQuit\", js_cocos2dx_TextureCache_waitForQuit, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_TextureCache_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_TextureCache_class,\n\t\tjs_cocos2dx_TextureCache_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TextureCache\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TextureCache> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TextureCache_class;\n\t\tp->proto = jsb_cocos2d_TextureCache_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_ParallaxNode_class;\nJSObject *jsb_cocos2d_ParallaxNode_prototype;\n\nJSBool js_cocos2dx_ParallaxNode_getParallaxArray(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::ParallaxNode* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::ParallaxNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParallaxNode_getParallaxArray : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::_ccArray* ret = cobj->getParallaxArray();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\t#pragma warning NO CONVERSION FROM NATIVE FOR _ccArray*;\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::_ccArray* ret = cobj->getParallaxArray();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\t#pragma warning NO CONVERSION FROM NATIVE FOR _ccArray*;\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParallaxNode_getParallaxArray : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParallaxNode_addChild(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParallaxNode* cobj = (cocos2d::ParallaxNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParallaxNode_addChild : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tcocos2d::Node* arg0;\n\t\tint arg1;\n\t\tcocos2d::Point arg2;\n\t\tcocos2d::Point arg3;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= jsval_to_ccpoint(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParallaxNode_addChild : Error processing arguments\");\n\t\tcobj->addChild(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParallaxNode_addChild : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParallaxNode* cobj = (cocos2d::ParallaxNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup : Error processing arguments\");\n\t\tcobj->removeAllChildrenWithCleanup(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParallaxNode_setParallaxArray(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::ParallaxNode* cobj = (cocos2d::ParallaxNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_ParallaxNode_setParallaxArray : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::_ccArray* arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR _ccArray*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_ParallaxNode_setParallaxArray : Error processing arguments\");\n\t\tcobj->setParallaxArray(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_ParallaxNode_setParallaxArray : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_ParallaxNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::ParallaxNode* ret = cocos2d::ParallaxNode::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ParallaxNode>(cx, (cocos2d::ParallaxNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_ParallaxNode_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_ParallaxNode_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ParallaxNode)\", obj);\n}\n\nvoid js_register_cocos2dx_ParallaxNode(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_ParallaxNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_ParallaxNode_class->name = \"ParallaxNode\";\n\tjsb_cocos2d_ParallaxNode_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParallaxNode_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_ParallaxNode_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_ParallaxNode_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_ParallaxNode_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_ParallaxNode_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_ParallaxNode_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_ParallaxNode_class->finalize = js_cocos2d_ParallaxNode_finalize;\n\tjsb_cocos2d_ParallaxNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getParallaxArray\", js_cocos2dx_ParallaxNode_getParallaxArray, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addChild\", js_cocos2dx_ParallaxNode_addChild, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllChildrenWithCleanup\", js_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setParallaxArray\", js_cocos2dx_ParallaxNode_setParallaxArray, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_ParallaxNode_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_ParallaxNode_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_ParallaxNode_class,\n\t\tdummy_constructor<cocos2d::ParallaxNode>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ParallaxNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::ParallaxNode> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_ParallaxNode_class;\n\t\tp->proto = jsb_cocos2d_ParallaxNode_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TMXObjectGroup_class;\nJSObject *jsb_cocos2d_TMXObjectGroup_prototype;\n\nJSBool js_cocos2dx_TMXObjectGroup_setPositionOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setPositionOffset : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setPositionOffset : Error processing arguments\");\n\t\tcobj->setPositionOffset(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_setPositionOffset : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_getProperty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getProperty : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getProperty : Error processing arguments\");\n\t\tcocos2d::Value ret = cobj->getProperty(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvalue_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_getProperty : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_getPositionOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getPositionOffset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getPositionOffset();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_getPositionOffset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_getObject(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getObject : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getObject : Error processing arguments\");\n\t\tcocos2d::ValueMap ret = cobj->getObject(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_getObject : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_getObjects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXObjectGroup* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getObjects : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ValueVector& ret = cobj->getObjects();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::ValueVector& ret = cobj->getObjects();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_getObjects : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_setGroupName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setGroupName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setGroupName : Error processing arguments\");\n\t\tcobj->setGroupName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_setGroupName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_getProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXObjectGroup* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getProperties : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ValueMap& ret = cobj->getProperties();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::ValueMap& ret = cobj->getProperties();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_getProperties : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_getGroupName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_getGroupName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getGroupName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_getGroupName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_setProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setProperties : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMap arg0;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setProperties : Error processing arguments\");\n\t\tcobj->setProperties(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_setProperties : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_setObjects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXObjectGroup* cobj = (cocos2d::TMXObjectGroup *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setObjects : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueVector arg0;\n\t\tok &= jsval_to_ccvaluevector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXObjectGroup_setObjects : Error processing arguments\");\n\t\tcobj->setObjects(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_setObjects : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXObjectGroup_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TMXObjectGroup* cobj = new cocos2d::TMXObjectGroup();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TMXObjectGroup> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TMXObjectGroup\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXObjectGroup_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_TMXObjectGroup_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TMXObjectGroup)\", obj);\n}\n\nvoid js_register_cocos2dx_TMXObjectGroup(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TMXObjectGroup_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TMXObjectGroup_class->name = \"TMXObjectGroup\";\n\tjsb_cocos2d_TMXObjectGroup_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXObjectGroup_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TMXObjectGroup_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXObjectGroup_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TMXObjectGroup_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TMXObjectGroup_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TMXObjectGroup_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TMXObjectGroup_class->finalize = js_cocos2d_TMXObjectGroup_finalize;\n\tjsb_cocos2d_TMXObjectGroup_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setPositionOffset\", js_cocos2dx_TMXObjectGroup_setPositionOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperty\", js_cocos2dx_TMXObjectGroup_getProperty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPositionOffset\", js_cocos2dx_TMXObjectGroup_getPositionOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getObject\", js_cocos2dx_TMXObjectGroup_getObject, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getObjects\", js_cocos2dx_TMXObjectGroup_getObjects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGroupName\", js_cocos2dx_TMXObjectGroup_setGroupName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperties\", js_cocos2dx_TMXObjectGroup_getProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGroupName\", js_cocos2dx_TMXObjectGroup_getGroupName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setProperties\", js_cocos2dx_TMXObjectGroup_setProperties, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setObjects\", js_cocos2dx_TMXObjectGroup_setObjects, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_TMXObjectGroup_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_TMXObjectGroup_class,\n\t\tjs_cocos2dx_TMXObjectGroup_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TMXObjectGroup\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TMXObjectGroup> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TMXObjectGroup_class;\n\t\tp->proto = jsb_cocos2d_TMXObjectGroup_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TMXLayerInfo_class;\nJSObject *jsb_cocos2d_TMXLayerInfo_prototype;\n\nJSBool js_cocos2dx_TMXLayerInfo_setProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayerInfo* cobj = (cocos2d::TMXLayerInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayerInfo_setProperties : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMap arg0;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayerInfo_setProperties : Error processing arguments\");\n\t\tcobj->setProperties(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayerInfo_setProperties : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayerInfo_getProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayerInfo* cobj = (cocos2d::TMXLayerInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayerInfo_getProperties : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueMap& ret = cobj->getProperties();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayerInfo_getProperties : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayerInfo_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TMXLayerInfo* cobj = new cocos2d::TMXLayerInfo();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TMXLayerInfo> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TMXLayerInfo\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayerInfo_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_TMXLayerInfo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TMXLayerInfo)\", obj);\n}\n\nvoid js_register_cocos2dx_TMXLayerInfo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TMXLayerInfo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TMXLayerInfo_class->name = \"TMXLayerInfo\";\n\tjsb_cocos2d_TMXLayerInfo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXLayerInfo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TMXLayerInfo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXLayerInfo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TMXLayerInfo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TMXLayerInfo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TMXLayerInfo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TMXLayerInfo_class->finalize = js_cocos2d_TMXLayerInfo_finalize;\n\tjsb_cocos2d_TMXLayerInfo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setProperties\", js_cocos2dx_TMXLayerInfo_setProperties, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperties\", js_cocos2dx_TMXLayerInfo_getProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_TMXLayerInfo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_TMXLayerInfo_class,\n\t\tjs_cocos2dx_TMXLayerInfo_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TMXLayerInfo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TMXLayerInfo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TMXLayerInfo_class;\n\t\tp->proto = jsb_cocos2d_TMXLayerInfo_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TMXTilesetInfo_class;\nJSObject *jsb_cocos2d_TMXTilesetInfo_prototype;\n\nJSBool js_cocos2dx_TMXTilesetInfo_rectForGID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTilesetInfo* cobj = (cocos2d::TMXTilesetInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTilesetInfo_rectForGID : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTilesetInfo_rectForGID : Error processing arguments\");\n\t\tcocos2d::Rect ret = cobj->rectForGID(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTilesetInfo_rectForGID : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTilesetInfo_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TMXTilesetInfo* cobj = new cocos2d::TMXTilesetInfo();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TMXTilesetInfo> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TMXTilesetInfo\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTilesetInfo_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_TMXTilesetInfo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TMXTilesetInfo)\", obj);\n}\n\nvoid js_register_cocos2dx_TMXTilesetInfo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TMXTilesetInfo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TMXTilesetInfo_class->name = \"TMXTilesetInfo\";\n\tjsb_cocos2d_TMXTilesetInfo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXTilesetInfo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TMXTilesetInfo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXTilesetInfo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TMXTilesetInfo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TMXTilesetInfo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TMXTilesetInfo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TMXTilesetInfo_class->finalize = js_cocos2d_TMXTilesetInfo_finalize;\n\tjsb_cocos2d_TMXTilesetInfo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"rectForGID\", js_cocos2dx_TMXTilesetInfo_rectForGID, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_TMXTilesetInfo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_TMXTilesetInfo_class,\n\t\tjs_cocos2dx_TMXTilesetInfo_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TMXTilesetInfo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TMXTilesetInfo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TMXTilesetInfo_class;\n\t\tp->proto = jsb_cocos2d_TMXTilesetInfo_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TMXMapInfo_class;\nJSObject *jsb_cocos2d_TMXMapInfo_prototype;\n\nJSBool js_cocos2dx_TMXMapInfo_setObjectGroups(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setObjectGroups : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocos2d::TMXObjectGroup *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setObjectGroups : Error processing arguments\");\n\t\tcobj->setObjectGroups(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setObjectGroups : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setTileSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTileSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTileSize : Error processing arguments\");\n\t\tcobj->setTileSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setTileSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_initWithTMXFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_initWithTMXFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_initWithTMXFile : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithTMXFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_initWithTMXFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getOrientation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getOrientation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getOrientation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getOrientation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_isStoringCharacters(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_isStoringCharacters : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isStoringCharacters();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_isStoringCharacters : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setLayers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setLayers : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocos2d::TMXLayerInfo *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setLayers : Error processing arguments\");\n\t\tcobj->setLayers(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setLayers : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_parseXMLFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_parseXMLFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_parseXMLFile : Error processing arguments\");\n\t\tJSBool ret = cobj->parseXMLFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_parseXMLFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getParentElement(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getParentElement : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getParentElement();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getParentElement : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setTMXFileName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTMXFileName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTMXFileName : Error processing arguments\");\n\t\tcobj->setTMXFileName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setTMXFileName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_parseXMLString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_parseXMLString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_parseXMLString : Error processing arguments\");\n\t\tJSBool ret = cobj->parseXMLString(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_parseXMLString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getLayers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXMapInfo* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getLayers : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Vector<cocos2d::TMXLayerInfo *>& ret = cobj->getLayers();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Vector<cocos2d::TMXLayerInfo *>& ret = cobj->getLayers();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getLayers : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getTilesets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXMapInfo* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getTilesets : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Vector<cocos2d::TMXTilesetInfo *>& ret = cobj->getTilesets();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Vector<cocos2d::TMXTilesetInfo *>& ret = cobj->getTilesets();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getTilesets : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getParentGID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getParentGID : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getParentGID();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getParentGID : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setParentElement(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setParentElement : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setParentElement : Error processing arguments\");\n\t\tcobj->setParentElement(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setParentElement : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_initWithXML(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_initWithXML : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_initWithXML : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithXML(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_initWithXML : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setParentGID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setParentGID : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setParentGID : Error processing arguments\");\n\t\tcobj->setParentGID(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setParentGID : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getLayerAttribs(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getLayerAttribs : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getLayerAttribs();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getLayerAttribs : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getTileSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getTileSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getTileSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getTileSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getTileProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getTileProperties : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueMapIntKey& ret = cobj->getTileProperties();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluemapintkey_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getTileProperties : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getObjectGroups(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXMapInfo* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getObjectGroups : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getObjectGroups : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getTMXFileName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getTMXFileName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getTMXFileName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getTMXFileName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setCurrentString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setCurrentString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setCurrentString : Error processing arguments\");\n\t\tcobj->setCurrentString(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setCurrentString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setProperties : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMap arg0;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setProperties : Error processing arguments\");\n\t\tcobj->setProperties(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setProperties : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setOrientation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setOrientation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setOrientation : Error processing arguments\");\n\t\tcobj->setOrientation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setOrientation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setTileProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTileProperties : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMapIntKey arg0;\n\t\tok &= jsval_to_ccvaluemapintkey(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTileProperties : Error processing arguments\");\n\t\tcobj->setTileProperties(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setTileProperties : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setMapSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setMapSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setMapSize : Error processing arguments\");\n\t\tcobj->setMapSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setMapSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setStoringCharacters(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setStoringCharacters : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setStoringCharacters : Error processing arguments\");\n\t\tcobj->setStoringCharacters(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setStoringCharacters : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getMapSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getMapSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getMapSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getMapSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setTilesets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTilesets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocos2d::TMXTilesetInfo *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setTilesets : Error processing arguments\");\n\t\tcobj->setTilesets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setTilesets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXMapInfo* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getProperties : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ValueMap& ret = cobj->getProperties();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::ValueMap& ret = cobj->getProperties();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getProperties : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_getCurrentString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_getCurrentString : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getCurrentString();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_getCurrentString : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_setLayerAttribs(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXMapInfo* cobj = (cocos2d::TMXMapInfo *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setLayerAttribs : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_setLayerAttribs : Error processing arguments\");\n\t\tcobj->setLayerAttribs(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_setLayerAttribs : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXMapInfo_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_create : Error processing arguments\");\n\t\tcocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXMapInfo>(cx, (cocos2d::TMXMapInfo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_TMXMapInfo_createWithXML(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXMapInfo_createWithXML : Error processing arguments\");\n\t\tcocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::createWithXML(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXMapInfo>(cx, (cocos2d::TMXMapInfo*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_createWithXML : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_TMXMapInfo_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TMXMapInfo* cobj = new cocos2d::TMXMapInfo();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TMXMapInfo> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TMXMapInfo\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXMapInfo_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_TMXMapInfo_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TMXMapInfo)\", obj);\n}\n\nvoid js_register_cocos2dx_TMXMapInfo(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TMXMapInfo_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TMXMapInfo_class->name = \"TMXMapInfo\";\n\tjsb_cocos2d_TMXMapInfo_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXMapInfo_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TMXMapInfo_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXMapInfo_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TMXMapInfo_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TMXMapInfo_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TMXMapInfo_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TMXMapInfo_class->finalize = js_cocos2d_TMXMapInfo_finalize;\n\tjsb_cocos2d_TMXMapInfo_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setObjectGroups\", js_cocos2dx_TMXMapInfo_setObjectGroups, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTileSize\", js_cocos2dx_TMXMapInfo_setTileSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTMXFile\", js_cocos2dx_TMXMapInfo_initWithTMXFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOrientation\", js_cocos2dx_TMXMapInfo_getOrientation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isStoringCharacters\", js_cocos2dx_TMXMapInfo_isStoringCharacters, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayers\", js_cocos2dx_TMXMapInfo_setLayers, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"parseXMLFile\", js_cocos2dx_TMXMapInfo_parseXMLFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParentElement\", js_cocos2dx_TMXMapInfo_getParentElement, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTMXFileName\", js_cocos2dx_TMXMapInfo_setTMXFileName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"parseXMLString\", js_cocos2dx_TMXMapInfo_parseXMLString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayers\", js_cocos2dx_TMXMapInfo_getLayers, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTilesets\", js_cocos2dx_TMXMapInfo_getTilesets, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParentGID\", js_cocos2dx_TMXMapInfo_getParentGID, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setParentElement\", js_cocos2dx_TMXMapInfo_setParentElement, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithXML\", js_cocos2dx_TMXMapInfo_initWithXML, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setParentGID\", js_cocos2dx_TMXMapInfo_setParentGID, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayerAttribs\", js_cocos2dx_TMXMapInfo_getLayerAttribs, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTileSize\", js_cocos2dx_TMXMapInfo_getTileSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTileProperties\", js_cocos2dx_TMXMapInfo_getTileProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getObjectGroups\", js_cocos2dx_TMXMapInfo_getObjectGroups, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTMXFileName\", js_cocos2dx_TMXMapInfo_getTMXFileName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCurrentString\", js_cocos2dx_TMXMapInfo_setCurrentString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setProperties\", js_cocos2dx_TMXMapInfo_setProperties, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOrientation\", js_cocos2dx_TMXMapInfo_setOrientation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTileProperties\", js_cocos2dx_TMXMapInfo_setTileProperties, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMapSize\", js_cocos2dx_TMXMapInfo_setMapSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStoringCharacters\", js_cocos2dx_TMXMapInfo_setStoringCharacters, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMapSize\", js_cocos2dx_TMXMapInfo_getMapSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTilesets\", js_cocos2dx_TMXMapInfo_setTilesets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperties\", js_cocos2dx_TMXMapInfo_getProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentString\", js_cocos2dx_TMXMapInfo_getCurrentString, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayerAttribs\", js_cocos2dx_TMXMapInfo_setLayerAttribs, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TMXMapInfo_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithXML\", js_cocos2dx_TMXMapInfo_createWithXML, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TMXMapInfo_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_TMXMapInfo_class,\n\t\tjs_cocos2dx_TMXMapInfo_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TMXMapInfo\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TMXMapInfo> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TMXMapInfo_class;\n\t\tp->proto = jsb_cocos2d_TMXMapInfo_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TMXLayer_class;\nJSObject *jsb_cocos2d_TMXLayer_prototype;\n\nJSBool js_cocos2dx_TMXLayer_getTileGIDAt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getTileGIDAt : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getTileGIDAt : Error processing arguments\");\n\t\tint ret = cobj->getTileGIDAt(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::ccTMXTileFlags_* arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR ccTMXTileFlags_*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getTileGIDAt : Error processing arguments\");\n\t\tint ret = cobj->getTileGIDAt(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getTileGIDAt : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getPositionAt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getPositionAt : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getPositionAt : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->getPositionAt(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getPositionAt : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setLayerOrientation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setLayerOrientation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setLayerOrientation : Error processing arguments\");\n\t\tcobj->setLayerOrientation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setLayerOrientation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_releaseMap(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_releaseMap : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->releaseMap();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_releaseMap : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setTiles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setTiles : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint* arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR int*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setTiles : Error processing arguments\");\n\t\tcobj->setTiles(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setTiles : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getLayerSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getLayerSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getLayerSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getLayerSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setMapTileSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setMapTileSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setMapTileSize : Error processing arguments\");\n\t\tcobj->setMapTileSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setMapTileSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getLayerOrientation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getLayerOrientation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getLayerOrientation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getLayerOrientation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setProperties : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMap arg0;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setProperties : Error processing arguments\");\n\t\tcobj->setProperties(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setProperties : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setLayerName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setLayerName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setLayerName : Error processing arguments\");\n\t\tcobj->setLayerName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setLayerName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_removeTileAt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_removeTileAt : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_removeTileAt : Error processing arguments\");\n\t\tcobj->removeTileAt(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_removeTileAt : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_initWithTilesetInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_initWithTilesetInfo : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::TMXTilesetInfo* arg0;\n\t\tcocos2d::TMXLayerInfo* arg1;\n\t\tcocos2d::TMXMapInfo* arg2;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TMXTilesetInfo*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::TMXLayerInfo*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ2 = (cocos2d::TMXMapInfo*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_initWithTilesetInfo : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithTilesetInfo(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_initWithTilesetInfo : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setupTiles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setupTiles : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setupTiles();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setupTiles : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setTileGID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXLayer* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setTileGID : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tint arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg1;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::ccTMXTileFlags_ arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setTileGID(arg0, arg1, arg2);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tint arg0;\n\t\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Point arg1;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setTileGID(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setTileGID : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getMapTileSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getMapTileSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getMapTileSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getMapTileSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getProperty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getProperty : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getProperty : Error processing arguments\");\n\t\tcocos2d::Value ret = cobj->getProperty(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvalue_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getProperty : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setLayerSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setLayerSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setLayerSize : Error processing arguments\");\n\t\tcobj->setLayerSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setLayerSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getLayerName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getLayerName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getLayerName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getLayerName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_setTileSet(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setTileSet : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TMXTilesetInfo* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TMXTilesetInfo*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_setTileSet : Error processing arguments\");\n\t\tcobj->setTileSet(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_setTileSet : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getTileSet(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getTileSet : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::TMXTilesetInfo* ret = cobj->getTileSet();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXTilesetInfo>(cx, (cocos2d::TMXTilesetInfo*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getTileSet : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXLayer* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getProperties : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::ValueMap& ret = cobj->getProperties();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::ValueMap& ret = cobj->getProperties();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getProperties : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_getTileAt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getTileAt : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_getTileAt : Error processing arguments\");\n\t\tcocos2d::Sprite* ret = cobj->getTileAt(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_getTileAt : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXLayer_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tcocos2d::TMXTilesetInfo* arg0;\n\t\tcocos2d::TMXLayerInfo* arg1;\n\t\tcocos2d::TMXMapInfo* arg2;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::TMXTilesetInfo*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::TMXLayerInfo*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ2 = (cocos2d::TMXMapInfo*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXLayer_create : Error processing arguments\");\n\t\tcocos2d::TMXLayer* ret = cocos2d::TMXLayer::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXLayer>(cx, (cocos2d::TMXLayer*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_TMXLayer_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TMXLayer* cobj = new cocos2d::TMXLayer();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TMXLayer> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TMXLayer\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXLayer_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_SpriteBatchNode_prototype;\n\nvoid js_cocos2d_TMXLayer_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TMXLayer)\", obj);\n}\n\nvoid js_register_cocos2dx_TMXLayer(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TMXLayer_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TMXLayer_class->name = \"TMXLayer\";\n\tjsb_cocos2d_TMXLayer_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXLayer_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TMXLayer_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXLayer_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TMXLayer_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TMXLayer_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TMXLayer_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TMXLayer_class->finalize = js_cocos2d_TMXLayer_finalize;\n\tjsb_cocos2d_TMXLayer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getTileGIDAt\", js_cocos2dx_TMXLayer_getTileGIDAt, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPositionAt\", js_cocos2dx_TMXLayer_getPositionAt, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayerOrientation\", js_cocos2dx_TMXLayer_setLayerOrientation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"releaseMap\", js_cocos2dx_TMXLayer_releaseMap, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTiles\", js_cocos2dx_TMXLayer_setTiles, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayerSize\", js_cocos2dx_TMXLayer_getLayerSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMapTileSize\", js_cocos2dx_TMXLayer_setMapTileSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayerOrientation\", js_cocos2dx_TMXLayer_getLayerOrientation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setProperties\", js_cocos2dx_TMXLayer_setProperties, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayerName\", js_cocos2dx_TMXLayer_setLayerName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeTileAt\", js_cocos2dx_TMXLayer_removeTileAt, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTilesetInfo\", js_cocos2dx_TMXLayer_initWithTilesetInfo, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setupTiles\", js_cocos2dx_TMXLayer_setupTiles, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTileGID\", js_cocos2dx_TMXLayer_setTileGID, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMapTileSize\", js_cocos2dx_TMXLayer_getMapTileSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperty\", js_cocos2dx_TMXLayer_getProperty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayerSize\", js_cocos2dx_TMXLayer_setLayerSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayerName\", js_cocos2dx_TMXLayer_getLayerName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTileSet\", js_cocos2dx_TMXLayer_setTileSet, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTileSet\", js_cocos2dx_TMXLayer_getTileSet, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperties\", js_cocos2dx_TMXLayer_getProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTileAt\", js_cocos2dx_TMXLayer_getTileAt, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TMXLayer_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TMXLayer_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_SpriteBatchNode_prototype,\n\t\tjsb_cocos2d_TMXLayer_class,\n\t\tjs_cocos2dx_TMXLayer_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TMXLayer\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TMXLayer> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TMXLayer_class;\n\t\tp->proto = jsb_cocos2d_TMXLayer_prototype;\n\t\tp->parentProto = jsb_cocos2d_SpriteBatchNode_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TMXTiledMap_class;\nJSObject *jsb_cocos2d_TMXTiledMap_prototype;\n\nJSBool js_cocos2dx_TMXTiledMap_setObjectGroups(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setObjectGroups : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocos2d::TMXObjectGroup *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setObjectGroups : Error processing arguments\");\n\t\tcobj->setObjectGroups(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_setObjectGroups : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getProperty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getProperty : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getProperty : Error processing arguments\");\n\t\tcocos2d::Value ret = cobj->getProperty(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvalue_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getProperty : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_setMapSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setMapSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setMapSize : Error processing arguments\");\n\t\tcobj->setMapSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_setMapSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getObjectGroup(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getObjectGroup : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getObjectGroup : Error processing arguments\");\n\t\tcocos2d::TMXObjectGroup* ret = cobj->getObjectGroup(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXObjectGroup>(cx, (cocos2d::TMXObjectGroup*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getObjectGroup : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getObjectGroups(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::TMXTiledMap* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getObjectGroups : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst cocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getObjectGroups : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getTileSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getTileSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getTileSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getTileSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getMapSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getMapSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getMapSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getMapSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getProperties : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueMap& ret = cobj->getProperties();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getProperties : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getPropertiesForGID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getPropertiesForGID : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getPropertiesForGID : Error processing arguments\");\n\t\tcocos2d::Value ret = cobj->getPropertiesForGID(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvalue_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getPropertiesForGID : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_setTileSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setTileSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setTileSize : Error processing arguments\");\n\t\tcobj->setTileSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_setTileSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_setProperties(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setProperties : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ValueMap arg0;\n\t\tok &= jsval_to_ccvaluemap(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setProperties : Error processing arguments\");\n\t\tcobj->setProperties(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_setProperties : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getLayer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getLayer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getLayer : Error processing arguments\");\n\t\tcocos2d::TMXLayer* ret = cobj->getLayer(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXLayer>(cx, (cocos2d::TMXLayer*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getLayer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_getMapOrientation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_getMapOrientation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getMapOrientation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_getMapOrientation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_setMapOrientation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXTiledMap* cobj = (cocos2d::TMXTiledMap *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setMapOrientation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_setMapOrientation : Error processing arguments\");\n\t\tcobj->setMapOrientation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_setMapOrientation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TMXTiledMap_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_create : Error processing arguments\");\n\t\tcocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXTiledMap>(cx, (cocos2d::TMXTiledMap*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_TMXTiledMap_createWithXML(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TMXTiledMap_createWithXML : Error processing arguments\");\n\t\tcocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::createWithXML(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TMXTiledMap>(cx, (cocos2d::TMXTiledMap*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TMXTiledMap_createWithXML : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_TMXTiledMap_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TMXTiledMap)\", obj);\n}\n\nvoid js_register_cocos2dx_TMXTiledMap(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TMXTiledMap_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TMXTiledMap_class->name = \"TMXTiledMap\";\n\tjsb_cocos2d_TMXTiledMap_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXTiledMap_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TMXTiledMap_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TMXTiledMap_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TMXTiledMap_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TMXTiledMap_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TMXTiledMap_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TMXTiledMap_class->finalize = js_cocos2d_TMXTiledMap_finalize;\n\tjsb_cocos2d_TMXTiledMap_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setObjectGroups\", js_cocos2dx_TMXTiledMap_setObjectGroups, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperty\", js_cocos2dx_TMXTiledMap_getProperty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMapSize\", js_cocos2dx_TMXTiledMap_setMapSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getObjectGroup\", js_cocos2dx_TMXTiledMap_getObjectGroup, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getObjectGroups\", js_cocos2dx_TMXTiledMap_getObjectGroups, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTileSize\", js_cocos2dx_TMXTiledMap_getTileSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMapSize\", js_cocos2dx_TMXTiledMap_getMapSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProperties\", js_cocos2dx_TMXTiledMap_getProperties, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPropertiesForGID\", js_cocos2dx_TMXTiledMap_getPropertiesForGID, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTileSize\", js_cocos2dx_TMXTiledMap_setTileSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setProperties\", js_cocos2dx_TMXTiledMap_setProperties, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayer\", js_cocos2dx_TMXTiledMap_getLayer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMapOrientation\", js_cocos2dx_TMXTiledMap_getMapOrientation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMapOrientation\", js_cocos2dx_TMXTiledMap_setMapOrientation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TMXTiledMap_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithXML\", js_cocos2dx_TMXTiledMap_createWithXML, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TMXTiledMap_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_TMXTiledMap_class,\n\t\tdummy_constructor<cocos2d::TMXTiledMap>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TMXTiledMap\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TMXTiledMap> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TMXTiledMap_class;\n\t\tp->proto = jsb_cocos2d_TMXTiledMap_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_TileMapAtlas_class;\nJSObject *jsb_cocos2d_TileMapAtlas_prototype;\n\nJSBool js_cocos2dx_TileMapAtlas_initWithTileFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TileMapAtlas* cobj = (cocos2d::TileMapAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_initWithTileFile : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tint arg2;\n\t\tint arg3;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_initWithTileFile : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithTileFile(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_initWithTileFile : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TileMapAtlas_releaseMap(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TileMapAtlas* cobj = (cocos2d::TileMapAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_releaseMap : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->releaseMap();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_releaseMap : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TileMapAtlas_getTGAInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TileMapAtlas* cobj = (cocos2d::TileMapAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_getTGAInfo : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::sImageTGA* ret = cobj->getTGAInfo();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR sImageTGA*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_getTGAInfo : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TileMapAtlas_getTileAt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TileMapAtlas* cobj = (cocos2d::TileMapAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_getTileAt : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_getTileAt : Error processing arguments\");\n\t\tcocos2d::Color3B ret = cobj->getTileAt(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_getTileAt : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TileMapAtlas_setTile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TileMapAtlas* cobj = (cocos2d::TileMapAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_setTile : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Color3B arg0;\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_setTile : Error processing arguments\");\n\t\tcobj->setTile(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_setTile : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TileMapAtlas_setTGAInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TileMapAtlas* cobj = (cocos2d::TileMapAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_setTGAInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::sImageTGA* arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR sImageTGA*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_setTGAInfo : Error processing arguments\");\n\t\tcobj->setTGAInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_setTGAInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_TileMapAtlas_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 4) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tint arg2;\n\t\tint arg3;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_TileMapAtlas_create : Error processing arguments\");\n\t\tcocos2d::TileMapAtlas* ret = cocos2d::TileMapAtlas::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::TileMapAtlas>(cx, (cocos2d::TileMapAtlas*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_TileMapAtlas_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::TileMapAtlas* cobj = new cocos2d::TileMapAtlas();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::TileMapAtlas> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::TileMapAtlas\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_TileMapAtlas_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_AtlasNode_prototype;\n\nvoid js_cocos2d_TileMapAtlas_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TileMapAtlas)\", obj);\n}\n\nvoid js_register_cocos2dx_TileMapAtlas(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_TileMapAtlas_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_TileMapAtlas_class->name = \"TileMapAtlas\";\n\tjsb_cocos2d_TileMapAtlas_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_TileMapAtlas_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_TileMapAtlas_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_TileMapAtlas_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_TileMapAtlas_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_TileMapAtlas_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_TileMapAtlas_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_TileMapAtlas_class->finalize = js_cocos2d_TileMapAtlas_finalize;\n\tjsb_cocos2d_TileMapAtlas_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"initWithTileFile\", js_cocos2dx_TileMapAtlas_initWithTileFile, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"releaseMap\", js_cocos2dx_TileMapAtlas_releaseMap, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTGAInfo\", js_cocos2dx_TileMapAtlas_getTGAInfo, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTileAt\", js_cocos2dx_TileMapAtlas_getTileAt, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTile\", js_cocos2dx_TileMapAtlas_setTile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTGAInfo\", js_cocos2dx_TileMapAtlas_setTGAInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_TileMapAtlas_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_TileMapAtlas_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_AtlasNode_prototype,\n\t\tjsb_cocos2d_TileMapAtlas_class,\n\t\tjs_cocos2dx_TileMapAtlas_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TileMapAtlas\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::TileMapAtlas> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_TileMapAtlas_class;\n\t\tp->proto = jsb_cocos2d_TileMapAtlas_prototype;\n\t\tp->parentProto = jsb_cocos2d_AtlasNode_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Timer_class;\nJSObject *jsb_cocos2d_Timer_prototype;\n\nJSBool js_cocos2dx_Timer_getInterval(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Timer* cobj = (cocos2d::Timer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Timer_getInterval : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getInterval();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Timer_getInterval : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Timer_setInterval(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Timer* cobj = (cocos2d::Timer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Timer_setInterval : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Timer_setInterval : Error processing arguments\");\n\t\tcobj->setInterval(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Timer_setInterval : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Timer_initWithScriptHandler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Timer* cobj = (cocos2d::Timer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Timer_initWithScriptHandler : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Timer_initWithScriptHandler : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithScriptHandler(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Timer_initWithScriptHandler : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Timer_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Timer* cobj = (cocos2d::Timer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Timer_update : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Timer_update : Error processing arguments\");\n\t\tcobj->update(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Timer_update : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Timer_getScriptHandler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Timer* cobj = (cocos2d::Timer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Timer_getScriptHandler : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getScriptHandler();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Timer_getScriptHandler : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Timer_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Timer* cobj = new cocos2d::Timer();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Timer> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Timer\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Timer_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Timer_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Timer)\", obj);\n}\n\nvoid js_register_cocos2dx_Timer(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Timer_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Timer_class->name = \"Timer\";\n\tjsb_cocos2d_Timer_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Timer_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Timer_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Timer_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Timer_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Timer_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Timer_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Timer_class->finalize = js_cocos2d_Timer_finalize;\n\tjsb_cocos2d_Timer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getInterval\", js_cocos2dx_Timer_getInterval, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInterval\", js_cocos2dx_Timer_setInterval, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithScriptHandler\", js_cocos2dx_Timer_initWithScriptHandler, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_Timer_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScriptHandler\", js_cocos2dx_Timer_getScriptHandler, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Timer_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Timer_class,\n\t\tjs_cocos2dx_Timer_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Timer\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Timer> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Timer_class;\n\t\tp->proto = jsb_cocos2d_Timer_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Scheduler_class;\nJSObject *jsb_cocos2d_Scheduler_prototype;\n\nJSBool js_cocos2dx_Scheduler_setTimeScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Scheduler_setTimeScale : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Scheduler_setTimeScale : Error processing arguments\");\n\t\tcobj->setTimeScale(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Scheduler_setTimeScale : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Scheduler_performFunctionInCocosThread(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Scheduler_performFunctionInCocosThread : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::function<void ()> arg0;\n\t\tdo {\n\t\t\tstd::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), argv[0]));\n\t\t\tauto lambda = [=]() -> void {\n\t\t\t\tjsval rval;\n\t\t\t\tJSBool ok = func->invoke(0, nullptr, rval);\n\t\t\t\tif (!ok && JS_IsExceptionPending(cx)) {\n\t\t\t\t\tJS_ReportPendingException(cx);\n\t\t\t\t}\n\t\t\t};\n\t\t\targ0 = lambda;\n\t\t} while(0)\n\t\t;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Scheduler_performFunctionInCocosThread : Error processing arguments\");\n\t\tcobj->performFunctionInCocosThread(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Scheduler_performFunctionInCocosThread : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Scheduler_getTimeScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Scheduler_getTimeScale : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getTimeScale();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Scheduler_getTimeScale : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Scheduler_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Scheduler* cobj = new cocos2d::Scheduler();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::Scheduler> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::Scheduler\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Scheduler_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Scheduler_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Scheduler)\", obj);\n}\n\nvoid js_register_cocos2dx_Scheduler(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Scheduler_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Scheduler_class->name = \"Scheduler\";\n\tjsb_cocos2d_Scheduler_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Scheduler_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Scheduler_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Scheduler_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Scheduler_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Scheduler_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Scheduler_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Scheduler_class->finalize = js_cocos2d_Scheduler_finalize;\n\tjsb_cocos2d_Scheduler_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setTimeScale\", js_cocos2dx_Scheduler_setTimeScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"performFunctionInCocosThread\", js_cocos2dx_Scheduler_performFunctionInCocosThread, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTimeScale\", js_cocos2dx_Scheduler_getTimeScale, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_Scheduler_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Scheduler_class,\n\t\tjs_cocos2dx_Scheduler_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Scheduler\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Scheduler> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Scheduler_class;\n\t\tp->proto = jsb_cocos2d_Scheduler_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_Component_class;\nJSObject *jsb_cocos2d_Component_prototype;\n\nJSBool js_cocos2dx_Component_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Component_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_setName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_setName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Component_setName : Error processing arguments\");\n\t\tcobj->setName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_setName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_isEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_isEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_isEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_serialize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_serialize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tvoid* arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR void*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Component_serialize : Error processing arguments\");\n\t\tJSBool ret = cobj->serialize(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_serialize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_update : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Component_update : Error processing arguments\");\n\t\tcobj->update(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_update : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_getOwner(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_getOwner : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getOwner();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_getOwner : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_setOwner(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_setOwner : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Component_setOwner : Error processing arguments\");\n\t\tcobj->setOwner(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_setOwner : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_getName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Component* cobj = (cocos2d::Component *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Component_getName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_Component_getName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_Component_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Component* ret = cocos2d::Component::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Component>(cx, (cocos2d::Component*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_Component_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_Component_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Component)\", obj);\n}\n\nvoid js_register_cocos2dx_Component(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_Component_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_Component_class->name = \"Component\";\n\tjsb_cocos2d_Component_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_Component_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_Component_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_Component_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_Component_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_Component_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_Component_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_Component_class->finalize = js_cocos2d_Component_finalize;\n\tjsb_cocos2d_Component_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_Component_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setName\", js_cocos2dx_Component_setName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isEnabled\", js_cocos2dx_Component_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"serialize\", js_cocos2dx_Component_serialize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_Component_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOwner\", js_cocos2dx_Component_getOwner, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_Component_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOwner\", js_cocos2dx_Component_setOwner, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getName\", js_cocos2dx_Component_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_Component_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_Component_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_Component_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Component\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::Component> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_Component_class;\n\t\tp->proto = jsb_cocos2d_Component_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_CocosDenshion_SimpleAudioEngine_class;\nJSObject *jsb_CocosDenshion_SimpleAudioEngine_prototype;\n\nJSBool js_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic : Error processing arguments\");\n\t\tcobj->preloadBackgroundMusic(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_stopBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_stopBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopBackgroundMusic();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_stopBackgroundMusic : Error processing arguments\");\n\t\tcobj->stopBackgroundMusic(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_stopBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_stopAllEffects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_stopAllEffects : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopAllEffects();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_stopAllEffects : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getBackgroundMusicVolume();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resumeBackgroundMusic();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume : Error processing arguments\");\n\t\tcobj->setBackgroundMusicVolume(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_preloadEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_preloadEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_preloadEffect : Error processing arguments\");\n\t\tcobj->preloadEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_preloadEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBackgroundMusicPlaying();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_getEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_getEffectsVolume : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEffectsVolume();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_getEffectsVolume : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->willPlayBackgroundMusic();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_pauseEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_pauseEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_pauseEffect : Error processing arguments\");\n\t\tcobj->pauseEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_pauseEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_playEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments\");\n\t\tunsigned int ret = cobj->playEffect(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tJSBool arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments\");\n\t\tunsigned int ret = cobj->playEffect(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tconst char* arg0;\n\t\tJSBool arg1;\n\t\tdouble arg2;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments\");\n\t\tunsigned int ret = cobj->playEffect(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tconst char* arg0;\n\t\tJSBool arg1;\n\t\tdouble arg2;\n\t\tdouble arg3;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments\");\n\t\tunsigned int ret = cobj->playEffect(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 5) {\n\t\tconst char* arg0;\n\t\tJSBool arg1;\n\t\tdouble arg2;\n\t\tdouble arg3;\n\t\tdouble arg4;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tok &= JS_ValueToNumber(cx, argv[4], &arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playEffect : Error processing arguments\");\n\t\tunsigned int ret = cobj->playEffect(arg0, arg1, arg2, arg3, arg4);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_playEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->rewindBackgroundMusic();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_playBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playBackgroundMusic : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playBackgroundMusic : Error processing arguments\");\n\t\tcobj->playBackgroundMusic(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tJSBool arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_playBackgroundMusic : Error processing arguments\");\n\t\tcobj->playBackgroundMusic(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_playBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_resumeAllEffects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_resumeAllEffects : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resumeAllEffects();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_resumeAllEffects : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_setEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_setEffectsVolume : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_setEffectsVolume : Error processing arguments\");\n\t\tcobj->setEffectsVolume(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_setEffectsVolume : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_stopEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_stopEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_stopEffect : Error processing arguments\");\n\t\tcobj->stopEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_stopEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pauseBackgroundMusic();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_pauseAllEffects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_pauseAllEffects : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pauseAllEffects();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_pauseAllEffects : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_unloadEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_unloadEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_unloadEffect : Error processing arguments\");\n\t\tcobj->unloadEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_unloadEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_resumeEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tCocosDenshion::SimpleAudioEngine* cobj = (CocosDenshion::SimpleAudioEngine *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_resumeEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_SimpleAudioEngine_resumeEffect : Error processing arguments\");\n\t\tcobj->resumeEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_resumeEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_SimpleAudioEngine_end(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tCocosDenshion::SimpleAudioEngine::end();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_end : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_SimpleAudioEngine_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tCocosDenshion::SimpleAudioEngine* ret = CocosDenshion::SimpleAudioEngine::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<CocosDenshion::SimpleAudioEngine>(cx, (CocosDenshion::SimpleAudioEngine*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_SimpleAudioEngine_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_CocosDenshion_SimpleAudioEngine_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SimpleAudioEngine)\", obj);\n}\n\nvoid js_register_cocos2dx_SimpleAudioEngine(JSContext *cx, JSObject *global) {\n\tjsb_CocosDenshion_SimpleAudioEngine_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_CocosDenshion_SimpleAudioEngine_class->name = \"AudioEngine\";\n\tjsb_CocosDenshion_SimpleAudioEngine_class->addProperty = JS_PropertyStub;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->delProperty = JS_DeletePropertyStub;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->getProperty = JS_PropertyStub;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->setProperty = JS_StrictPropertyStub;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->enumerate = JS_EnumerateStub;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->resolve = JS_ResolveStub;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->convert = JS_ConvertStub;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->finalize = js_CocosDenshion_SimpleAudioEngine_finalize;\n\tjsb_CocosDenshion_SimpleAudioEngine_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"preloadMusic\", js_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopMusic\", js_cocos2dx_SimpleAudioEngine_stopBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopAllEffects\", js_cocos2dx_SimpleAudioEngine_stopAllEffects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMusicVolume\", js_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeMusic\", js_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMusicVolume\", js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"preloadEffect\", js_cocos2dx_SimpleAudioEngine_preloadEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isMusicPlaying\", js_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEffectsVolume\", js_cocos2dx_SimpleAudioEngine_getEffectsVolume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"willPlayMusic\", js_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseEffect\", js_cocos2dx_SimpleAudioEngine_pauseEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"playEffect\", js_cocos2dx_SimpleAudioEngine_playEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"rewindMusic\", js_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"playMusic\", js_cocos2dx_SimpleAudioEngine_playBackgroundMusic, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeAllEffects\", js_cocos2dx_SimpleAudioEngine_resumeAllEffects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEffectsVolume\", js_cocos2dx_SimpleAudioEngine_setEffectsVolume, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopEffect\", js_cocos2dx_SimpleAudioEngine_stopEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseMusic\", js_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseAllEffects\", js_cocos2dx_SimpleAudioEngine_pauseAllEffects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"unloadEffect\", js_cocos2dx_SimpleAudioEngine_unloadEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeEffect\", js_cocos2dx_SimpleAudioEngine_resumeEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"end\", js_cocos2dx_SimpleAudioEngine_end, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_SimpleAudioEngine_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_CocosDenshion_SimpleAudioEngine_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_CocosDenshion_SimpleAudioEngine_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"AudioEngine\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<CocosDenshion::SimpleAudioEngine> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_CocosDenshion_SimpleAudioEngine_class;\n\t\tp->proto = jsb_CocosDenshion_SimpleAudioEngine_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj) {\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"cc\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"cc\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n\tjs_register_cocos2dx_Action(cx, obj);\n\tjs_register_cocos2dx_FiniteTimeAction(cx, obj);\n\tjs_register_cocos2dx_ActionInstant(cx, obj);\n\tjs_register_cocos2dx_Hide(cx, obj);\n\tjs_register_cocos2dx_Node(cx, obj);\n\tjs_register_cocos2dx_Scene(cx, obj);\n\tjs_register_cocos2dx_TransitionScene(cx, obj);\n\tjs_register_cocos2dx_TransitionEaseScene(cx, obj);\n\tjs_register_cocos2dx_TransitionMoveInL(cx, obj);\n\tjs_register_cocos2dx_TransitionMoveInB(cx, obj);\n\tjs_register_cocos2dx_Layer(cx, obj);\n\tjs_register_cocos2dx___LayerRGBA(cx, obj);\n\tjs_register_cocos2dx_AtlasNode(cx, obj);\n\tjs_register_cocos2dx_TileMapAtlas(cx, obj);\n\tjs_register_cocos2dx_TransitionMoveInT(cx, obj);\n\tjs_register_cocos2dx_TransitionMoveInR(cx, obj);\n\tjs_register_cocos2dx_ParticleSystem(cx, obj);\n\tjs_register_cocos2dx_ParticleSystemQuad(cx, obj);\n\tjs_register_cocos2dx_ParticleSnow(cx, obj);\n\tjs_register_cocos2dx_ActionInterval(cx, obj);\n\tjs_register_cocos2dx_ActionCamera(cx, obj);\n\tjs_register_cocos2dx_ProgressFromTo(cx, obj);\n\tjs_register_cocos2dx_MoveBy(cx, obj);\n\tjs_register_cocos2dx_MoveTo(cx, obj);\n\tjs_register_cocos2dx_JumpBy(cx, obj);\n\tjs_register_cocos2dx_ActionEase(cx, obj);\n\tjs_register_cocos2dx_EaseBounce(cx, obj);\n\tjs_register_cocos2dx_EaseBounceIn(cx, obj);\n\tjs_register_cocos2dx_TransitionRotoZoom(cx, obj);\n\tjs_register_cocos2dx_Director(cx, obj);\n\tjs_register_cocos2dx_Texture2D(cx, obj);\n\tjs_register_cocos2dx_EaseElastic(cx, obj);\n\tjs_register_cocos2dx_EaseElasticOut(cx, obj);\n\tjs_register_cocos2dx_EaseBackOut(cx, obj);\n\tjs_register_cocos2dx_TransitionSceneOriented(cx, obj);\n\tjs_register_cocos2dx_TransitionFlipX(cx, obj);\n\tjs_register_cocos2dx_Spawn(cx, obj);\n\tjs_register_cocos2dx_SimpleAudioEngine(cx, obj);\n\tjs_register_cocos2dx_SkewTo(cx, obj);\n\tjs_register_cocos2dx_SkewBy(cx, obj);\n\tjs_register_cocos2dx_TransitionProgress(cx, obj);\n\tjs_register_cocos2dx_TransitionProgressVertical(cx, obj);\n\tjs_register_cocos2dx_TMXTiledMap(cx, obj);\n\tjs_register_cocos2dx_GridAction(cx, obj);\n\tjs_register_cocos2dx_Grid3DAction(cx, obj);\n\tjs_register_cocos2dx_FadeIn(cx, obj);\n\tjs_register_cocos2dx_AnimationCache(cx, obj);\n\tjs_register_cocos2dx_FlipX3D(cx, obj);\n\tjs_register_cocos2dx_FlipY3D(cx, obj);\n\tjs_register_cocos2dx_EaseSineInOut(cx, obj);\n\tjs_register_cocos2dx_TransitionFlipAngular(cx, obj);\n\tjs_register_cocos2dx_EGLViewProtocol(cx, obj);\n\tjs_register_cocos2dx_EGLView(cx, obj);\n\tjs_register_cocos2dx_EaseElasticInOut(cx, obj);\n\tjs_register_cocos2dx_Show(cx, obj);\n\tjs_register_cocos2dx_FadeOut(cx, obj);\n\tjs_register_cocos2dx_CallFunc(cx, obj);\n\tjs_register_cocos2dx_Waves3D(cx, obj);\n\tjs_register_cocos2dx_ParticleFireworks(cx, obj);\n\tjs_register_cocos2dx_MenuItem(cx, obj);\n\tjs_register_cocos2dx_MenuItemSprite(cx, obj);\n\tjs_register_cocos2dx_MenuItemImage(cx, obj);\n\tjs_register_cocos2dx_ParticleFire(cx, obj);\n\tjs_register_cocos2dx_TransitionZoomFlipAngular(cx, obj);\n\tjs_register_cocos2dx_EaseRateAction(cx, obj);\n\tjs_register_cocos2dx_EaseIn(cx, obj);\n\tjs_register_cocos2dx_EaseExponentialInOut(cx, obj);\n\tjs_register_cocos2dx_EaseBackInOut(cx, obj);\n\tjs_register_cocos2dx_EaseExponentialOut(cx, obj);\n\tjs_register_cocos2dx_SpriteBatchNode(cx, obj);\n\tjs_register_cocos2dx_Label(cx, obj);\n\tjs_register_cocos2dx_Application(cx, obj);\n\tjs_register_cocos2dx_DelayTime(cx, obj);\n\tjs_register_cocos2dx_LabelAtlas(cx, obj);\n\tjs_register_cocos2dx_LabelBMFont(cx, obj);\n\tjs_register_cocos2dx_TransitionFadeTR(cx, obj);\n\tjs_register_cocos2dx_TransitionFadeBL(cx, obj);\n\tjs_register_cocos2dx_EaseElasticIn(cx, obj);\n\tjs_register_cocos2dx_ParticleSpiral(cx, obj);\n\tjs_register_cocos2dx_TiledGrid3DAction(cx, obj);\n\tjs_register_cocos2dx_FadeOutTRTiles(cx, obj);\n\tjs_register_cocos2dx_FadeOutUpTiles(cx, obj);\n\tjs_register_cocos2dx_FadeOutDownTiles(cx, obj);\n\tjs_register_cocos2dx_TextureCache(cx, obj);\n\tjs_register_cocos2dx_ActionTween(cx, obj);\n\tjs_register_cocos2dx_TransitionFadeDown(cx, obj);\n\tjs_register_cocos2dx_ParticleSun(cx, obj);\n\tjs_register_cocos2dx_TransitionProgressHorizontal(cx, obj);\n\tjs_register_cocos2dx_TMXObjectGroup(cx, obj);\n\tjs_register_cocos2dx_TMXLayer(cx, obj);\n\tjs_register_cocos2dx_FlipX(cx, obj);\n\tjs_register_cocos2dx_FlipY(cx, obj);\n\tjs_register_cocos2dx_TransitionSplitCols(cx, obj);\n\tjs_register_cocos2dx_Timer(cx, obj);\n\tjs_register_cocos2dx_FadeTo(cx, obj);\n\tjs_register_cocos2dx_Repeat(cx, obj);\n\tjs_register_cocos2dx_Place(cx, obj);\n\tjs_register_cocos2dx_GLProgram(cx, obj);\n\tjs_register_cocos2dx_EaseBounceOut(cx, obj);\n\tjs_register_cocos2dx_RenderTexture(cx, obj);\n\tjs_register_cocos2dx_TintBy(cx, obj);\n\tjs_register_cocos2dx_TransitionShrinkGrow(cx, obj);\n\tjs_register_cocos2dx_Sprite(cx, obj);\n\tjs_register_cocos2dx_LabelTTF(cx, obj);\n\tjs_register_cocos2dx_ClippingNode(cx, obj);\n\tjs_register_cocos2dx_ParticleFlower(cx, obj);\n\tjs_register_cocos2dx_ParticleSmoke(cx, obj);\n\tjs_register_cocos2dx_LayerMultiplex(cx, obj);\n\tjs_register_cocos2dx_Blink(cx, obj);\n\tjs_register_cocos2dx_ShaderCache(cx, obj);\n\tjs_register_cocos2dx_JumpTo(cx, obj);\n\tjs_register_cocos2dx_ParticleExplosion(cx, obj);\n\tjs_register_cocos2dx_TransitionJumpZoom(cx, obj);\n\tjs_register_cocos2dx_Touch(cx, obj);\n\tjs_register_cocos2dx_SAXParser(cx, obj);\n\tjs_register_cocos2dx_AnimationFrame(cx, obj);\n\tjs_register_cocos2dx_NodeGrid(cx, obj);\n\tjs_register_cocos2dx_TMXLayerInfo(cx, obj);\n\tjs_register_cocos2dx_TMXTilesetInfo(cx, obj);\n\tjs_register_cocos2dx_GridBase(cx, obj);\n\tjs_register_cocos2dx_TiledGrid3D(cx, obj);\n\tjs_register_cocos2dx_ParticleGalaxy(cx, obj);\n\tjs_register_cocos2dx_Twirl(cx, obj);\n\tjs_register_cocos2dx_MenuItemLabel(cx, obj);\n\tjs_register_cocos2dx_LayerColor(cx, obj);\n\tjs_register_cocos2dx_FadeOutBLTiles(cx, obj);\n\tjs_register_cocos2dx_LayerGradient(cx, obj);\n\tjs_register_cocos2dx_TargetedAction(cx, obj);\n\tjs_register_cocos2dx_RepeatForever(cx, obj);\n\tjs_register_cocos2dx_CardinalSplineTo(cx, obj);\n\tjs_register_cocos2dx_CardinalSplineBy(cx, obj);\n\tjs_register_cocos2dx_TransitionFlipY(cx, obj);\n\tjs_register_cocos2dx_TurnOffTiles(cx, obj);\n\tjs_register_cocos2dx_TintTo(cx, obj);\n\tjs_register_cocos2dx_CatmullRomTo(cx, obj);\n\tjs_register_cocos2dx_ToggleVisibility(cx, obj);\n\tjs_register_cocos2dx_DrawNode(cx, obj);\n\tjs_register_cocos2dx_TransitionTurnOffTiles(cx, obj);\n\tjs_register_cocos2dx_RotateTo(cx, obj);\n\tjs_register_cocos2dx_TransitionSplitRows(cx, obj);\n\tjs_register_cocos2dx_TransitionProgressRadialCCW(cx, obj);\n\tjs_register_cocos2dx_ScaleTo(cx, obj);\n\tjs_register_cocos2dx_TransitionPageTurn(cx, obj);\n\tjs_register_cocos2dx_BezierBy(cx, obj);\n\tjs_register_cocos2dx_BezierTo(cx, obj);\n\tjs_register_cocos2dx_Menu(cx, obj);\n\tjs_register_cocos2dx_SpriteFrame(cx, obj);\n\tjs_register_cocos2dx_ActionManager(cx, obj);\n\tjs_register_cocos2dx_TransitionFade(cx, obj);\n\tjs_register_cocos2dx_TransitionZoomFlipX(cx, obj);\n\tjs_register_cocos2dx_SpriteFrameCache(cx, obj);\n\tjs_register_cocos2dx_TransitionCrossFade(cx, obj);\n\tjs_register_cocos2dx_Ripple3D(cx, obj);\n\tjs_register_cocos2dx_TransitionSlideInL(cx, obj);\n\tjs_register_cocos2dx_TransitionSlideInT(cx, obj);\n\tjs_register_cocos2dx_StopGrid(cx, obj);\n\tjs_register_cocos2dx_ShakyTiles3D(cx, obj);\n\tjs_register_cocos2dx_PageTurn3D(cx, obj);\n\tjs_register_cocos2dx_Grid3D(cx, obj);\n\tjs_register_cocos2dx_TransitionProgressInOut(cx, obj);\n\tjs_register_cocos2dx_EaseBackIn(cx, obj);\n\tjs_register_cocos2dx_SplitRows(cx, obj);\n\tjs_register_cocos2dx_Follow(cx, obj);\n\tjs_register_cocos2dx_Animate(cx, obj);\n\tjs_register_cocos2dx_ShuffleTiles(cx, obj);\n\tjs_register_cocos2dx_ProgressTimer(cx, obj);\n\tjs_register_cocos2dx_ParticleMeteor(cx, obj);\n\tjs_register_cocos2dx_EaseInOut(cx, obj);\n\tjs_register_cocos2dx_TransitionZoomFlipY(cx, obj);\n\tjs_register_cocos2dx_ScaleBy(cx, obj);\n\tjs_register_cocos2dx_Lens3D(cx, obj);\n\tjs_register_cocos2dx_Animation(cx, obj);\n\tjs_register_cocos2dx_TMXMapInfo(cx, obj);\n\tjs_register_cocos2dx_EaseExponentialIn(cx, obj);\n\tjs_register_cocos2dx_ReuseGrid(cx, obj);\n\tjs_register_cocos2dx_MenuItemAtlasFont(cx, obj);\n\tjs_register_cocos2dx_Liquid(cx, obj);\n\tjs_register_cocos2dx_OrbitCamera(cx, obj);\n\tjs_register_cocos2dx_ParticleBatchNode(cx, obj);\n\tjs_register_cocos2dx_Component(cx, obj);\n\tjs_register_cocos2dx_TextFieldTTF(cx, obj);\n\tjs_register_cocos2dx_ParticleRain(cx, obj);\n\tjs_register_cocos2dx_Waves(cx, obj);\n\tjs_register_cocos2dx_EaseOut(cx, obj);\n\tjs_register_cocos2dx_MenuItemFont(cx, obj);\n\tjs_register_cocos2dx_TransitionFadeUp(cx, obj);\n\tjs_register_cocos2dx_EaseSineOut(cx, obj);\n\tjs_register_cocos2dx_JumpTiles3D(cx, obj);\n\tjs_register_cocos2dx_MenuItemToggle(cx, obj);\n\tjs_register_cocos2dx_RemoveSelf(cx, obj);\n\tjs_register_cocos2dx_SplitCols(cx, obj);\n\tjs_register_cocos2dx_MotionStreak(cx, obj);\n\tjs_register_cocos2dx_RotateBy(cx, obj);\n\tjs_register_cocos2dx_FileUtils(cx, obj);\n\tjs_register_cocos2dx_ProgressTo(cx, obj);\n\tjs_register_cocos2dx_TransitionProgressOutIn(cx, obj);\n\tjs_register_cocos2dx_CatmullRomBy(cx, obj);\n\tjs_register_cocos2dx_Sequence(cx, obj);\n\tjs_register_cocos2dx_Shaky3D(cx, obj);\n\tjs_register_cocos2dx_TransitionProgressRadialCW(cx, obj);\n\tjs_register_cocos2dx_EaseBounceInOut(cx, obj);\n\tjs_register_cocos2dx_TransitionSlideInR(cx, obj);\n\tjs_register_cocos2dx___NodeRGBA(cx, obj);\n\tjs_register_cocos2dx_ParallaxNode(cx, obj);\n\tjs_register_cocos2dx_Scheduler(cx, obj);\n\tjs_register_cocos2dx_EaseSineIn(cx, obj);\n\tjs_register_cocos2dx_WavesTiles3D(cx, obj);\n\tjs_register_cocos2dx_TransitionSlideInB(cx, obj);\n\tjs_register_cocos2dx_Speed(cx, obj);\n\tjs_register_cocos2dx_ShatteredTiles3D(cx, obj);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_auto.hpp",
    "content": "#ifndef __cocos2dx_h__\n#define __cocos2dx_h__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n\nextern JSClass  *jsb_cocos2d_Action_class;\nextern JSObject *jsb_cocos2d_Action_prototype;\n\nJSBool js_cocos2dx_Action_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Action_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Action(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Action_startWithTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_setOriginalTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_clone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_getOriginalTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_stop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_getTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_step(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_setTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_getTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_setTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_isDone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Action_reverse(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FiniteTimeAction_class;\nextern JSObject *jsb_cocos2d_FiniteTimeAction_prototype;\n\nJSBool js_cocos2dx_FiniteTimeAction_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FiniteTimeAction_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FiniteTimeAction(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FiniteTimeAction_setDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FiniteTimeAction_getDuration(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Speed_class;\nextern JSObject *jsb_cocos2d_Speed_prototype;\n\nJSBool js_cocos2dx_Speed_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Speed_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Speed(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Speed_setInnerAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Speed_setSpeed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Speed_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Speed_getSpeed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Speed_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Follow_class;\nextern JSObject *jsb_cocos2d_Follow_prototype;\n\nJSBool js_cocos2dx_Follow_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Follow_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Follow(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Follow_setBoudarySet(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Follow_isBoundarySet(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Follow_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_GLProgram_class;\nextern JSObject *jsb_cocos2d_GLProgram_prototype;\n\nJSBool js_cocos2dx_GLProgram_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_GLProgram_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_GLProgram(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_GLProgram_getFragmentShaderLog(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_addAttribute(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_getUniformLocationForName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_use(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_getVertexShaderLog(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_initWithVertexShaderByteArray(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_initWithVertexShaderFilename(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformsForBuiltins(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith3i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith3iv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_updateUniforms(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith4iv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_link(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith2iv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_reset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith4i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith1i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_setUniformLocationWith2i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GLProgram_GLProgram(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Touch_class;\nextern JSObject *jsb_cocos2d_Touch_prototype;\n\nJSBool js_cocos2dx_Touch_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Touch_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Touch(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Touch_getPreviousLocationInView(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_getLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_getDelta(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_getStartLocationInView(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_getStartLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_getID(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_setTouchInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_getLocationInView(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_getPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Touch_Touch(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Texture2D_class;\nextern JSObject *jsb_cocos2d_Texture2D_prototype;\n\nJSBool js_cocos2dx_Texture2D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Texture2D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Texture2D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Texture2D_getShaderProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getMaxT(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getStringForFormat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_initWithImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_setShaderProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getMaxS(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_hasPremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_initWithMipmaps(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getPixelsHigh(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getBitsPerPixelForFormat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_initWithString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_setMaxT(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_drawInRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getContentSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_setAliasTexParameters(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_setAntiAliasTexParameters(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_generateMipmap(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getDescription(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getPixelFormat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getContentSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getPixelsWide(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_drawAtPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_hasMipmaps(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_setMaxS(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_setDefaultAlphaPixelFormat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_getDefaultAlphaPixelFormat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Texture2D_Texture2D(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Node_class;\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nJSBool js_cocos2dx_Node_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Node_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Node(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Node_addChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_removeComponent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setPhysicsBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getShaderProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getDescription(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setCascadeOpacityEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getChildren(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_pause(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_convertToWorldSpaceAR(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_isIgnoreAnchorPointForPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_updateDisplayedOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setRotation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setScaleY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setScaleX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_removeAllComponents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node__setLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getNodeToWorldAffineTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getNodeToWorldTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_removeChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_convertToWorldSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setSkewX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setSkewY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_convertTouchToNodeSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getRotationX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getRotationY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getNodeToParentAffineTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_isCascadeOpacityEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getNodeToParentTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_resume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getPhysicsBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_stopActionByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_reorderChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_ignoreAnchorPointForPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setPositionY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setPositionX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setNodeToParentTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getNumberOfRunningActions(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_updateTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_isVisible(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getChildrenCount(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_convertToNodeSpaceAR(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_addComponent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_visit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setShaderProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getRotation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getLocalZOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getAnchorPointInPoints(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_runAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_transform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setVertexZ(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setScheduler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_stopAllActions(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getSkewX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getSkewY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getDisplayedColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getActionByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setRotationX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setRotationY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setAdditionalTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getDisplayedOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getScheduler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getParentToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setActionManager(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_isRunning(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getPositionY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getPositionX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_removeChildByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_updateDisplayedColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setVisible(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getParentToNodeTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getVertexZ(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setGlobalZOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getChildByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setOrderOfArrival(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getScaleY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getScaleX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getWorldToNodeAffineTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setCascadeColorEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_cleanup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getComponent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getContentSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getBoundingBox(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_updatePhysicsTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setEventDispatcher(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getGlobalZOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_draw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_transformAncestors(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setUserObject(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_removeFromParentAndCleanup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_convertTouchToNodeSpaceAR(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_sortAllChildren(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getWorldToNodeTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_convertToNodeSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_setTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_isCascadeColorEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_isOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_stopAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_getActionManager(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Node_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d___NodeRGBA_class;\nextern JSObject *jsb_cocos2d___NodeRGBA_prototype;\n\nJSBool js_cocos2dx___NodeRGBA_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx___NodeRGBA_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx___NodeRGBA(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocos2d_SpriteFrame_class;\nextern JSObject *jsb_cocos2d_SpriteFrame_prototype;\n\nJSBool js_cocos2dx_SpriteFrame_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SpriteFrame_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SpriteFrame(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SpriteFrame_clone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setRotated(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setRectInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_getTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_getRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_getRectInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setOriginalSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_getOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setOriginalSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_getOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_isRotated(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_initWithTextureFilename(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_setRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_getOffsetInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_getOriginalSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrame_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_AnimationFrame_class;\nextern JSObject *jsb_cocos2d_AnimationFrame_prototype;\n\nJSBool js_cocos2dx_AnimationFrame_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_AnimationFrame_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_AnimationFrame(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_AnimationFrame_setSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationFrame_getUserInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationFrame_setDelayUnits(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationFrame_clone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationFrame_getSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationFrame_getDelayUnits(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationFrame_setUserInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationFrame_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Animation_class;\nextern JSObject *jsb_cocos2d_Animation_prototype;\n\nJSBool js_cocos2dx_Animation_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Animation_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Animation(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Animation_getLoops(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_addSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_setRestoreOriginalFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_clone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_getDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_setFrames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_getFrames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_setLoops(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_setDelayPerUnit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_addSpriteFrameWithFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_getTotalDelayUnits(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_getDelayPerUnit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_getRestoreOriginalFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animation_addSpriteFrameWithTexture(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ActionInterval_class;\nextern JSObject *jsb_cocos2d_ActionInterval_prototype;\n\nJSBool js_cocos2dx_ActionInterval_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ActionInterval_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ActionInterval(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ActionInterval_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionInterval_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionInterval_getElapsed(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Sequence_class;\nextern JSObject *jsb_cocos2d_Sequence_prototype;\n\nJSBool js_cocos2dx_Sequence_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Sequence_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Sequence(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocos2d_Repeat_class;\nextern JSObject *jsb_cocos2d_Repeat_prototype;\n\nJSBool js_cocos2dx_Repeat_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Repeat_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Repeat(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Repeat_setInnerAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Repeat_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Repeat_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_RepeatForever_class;\nextern JSObject *jsb_cocos2d_RepeatForever_prototype;\n\nJSBool js_cocos2dx_RepeatForever_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_RepeatForever_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_RepeatForever(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_RepeatForever_setInnerAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RepeatForever_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RepeatForever_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Spawn_class;\nextern JSObject *jsb_cocos2d_Spawn_prototype;\n\nJSBool js_cocos2dx_Spawn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Spawn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Spawn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocos2d_RotateTo_class;\nextern JSObject *jsb_cocos2d_RotateTo_prototype;\n\nJSBool js_cocos2dx_RotateTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_RotateTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_RotateTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_RotateTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_RotateBy_class;\nextern JSObject *jsb_cocos2d_RotateBy_prototype;\n\nJSBool js_cocos2dx_RotateBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_RotateBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_RotateBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_RotateBy_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MoveBy_class;\nextern JSObject *jsb_cocos2d_MoveBy_prototype;\n\nJSBool js_cocos2dx_MoveBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MoveBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MoveBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MoveBy_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MoveTo_class;\nextern JSObject *jsb_cocos2d_MoveTo_prototype;\n\nJSBool js_cocos2dx_MoveTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MoveTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MoveTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MoveTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_SkewTo_class;\nextern JSObject *jsb_cocos2d_SkewTo_prototype;\n\nJSBool js_cocos2dx_SkewTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SkewTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SkewTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SkewTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_SkewBy_class;\nextern JSObject *jsb_cocos2d_SkewBy_prototype;\n\nJSBool js_cocos2dx_SkewBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SkewBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SkewBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SkewBy_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_JumpBy_class;\nextern JSObject *jsb_cocos2d_JumpBy_prototype;\n\nJSBool js_cocos2dx_JumpBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_JumpBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_JumpBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_JumpBy_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_JumpTo_class;\nextern JSObject *jsb_cocos2d_JumpTo_prototype;\n\nJSBool js_cocos2dx_JumpTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_JumpTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_JumpTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_JumpTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_BezierBy_class;\nextern JSObject *jsb_cocos2d_BezierBy_prototype;\n\nJSBool js_cocos2dx_BezierBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_BezierBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_BezierBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocos2d_BezierTo_class;\nextern JSObject *jsb_cocos2d_BezierTo_prototype;\n\nJSBool js_cocos2dx_BezierTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_BezierTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_BezierTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocos2d_ScaleTo_class;\nextern JSObject *jsb_cocos2d_ScaleTo_prototype;\n\nJSBool js_cocos2dx_ScaleTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ScaleTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ScaleTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ScaleTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ScaleBy_class;\nextern JSObject *jsb_cocos2d_ScaleBy_prototype;\n\nJSBool js_cocos2dx_ScaleBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ScaleBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ScaleBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ScaleBy_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Blink_class;\nextern JSObject *jsb_cocos2d_Blink_prototype;\n\nJSBool js_cocos2dx_Blink_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Blink_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Blink(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Blink_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FadeIn_class;\nextern JSObject *jsb_cocos2d_FadeIn_prototype;\n\nJSBool js_cocos2dx_FadeIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FadeIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FadeIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FadeIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FadeOut_class;\nextern JSObject *jsb_cocos2d_FadeOut_prototype;\n\nJSBool js_cocos2dx_FadeOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FadeOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FadeOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FadeOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FadeTo_class;\nextern JSObject *jsb_cocos2d_FadeTo_prototype;\n\nJSBool js_cocos2dx_FadeTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FadeTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FadeTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FadeTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TintTo_class;\nextern JSObject *jsb_cocos2d_TintTo_prototype;\n\nJSBool js_cocos2dx_TintTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TintTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TintTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TintTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TintBy_class;\nextern JSObject *jsb_cocos2d_TintBy_prototype;\n\nJSBool js_cocos2dx_TintBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TintBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TintBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TintBy_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_DelayTime_class;\nextern JSObject *jsb_cocos2d_DelayTime_prototype;\n\nJSBool js_cocos2dx_DelayTime_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_DelayTime_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_DelayTime(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_DelayTime_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Animate_class;\nextern JSObject *jsb_cocos2d_Animate_prototype;\n\nJSBool js_cocos2dx_Animate_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Animate_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Animate(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Animate_getAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animate_setAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Animate_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TargetedAction_class;\nextern JSObject *jsb_cocos2d_TargetedAction_prototype;\n\nJSBool js_cocos2dx_TargetedAction_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TargetedAction_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TargetedAction(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TargetedAction_getForcedTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TargetedAction_setForcedTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TargetedAction_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ActionCamera_class;\nextern JSObject *jsb_cocos2d_ActionCamera_prototype;\n\nJSBool js_cocos2dx_ActionCamera_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ActionCamera_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ActionCamera(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ActionCamera_setEye(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionCamera_getEye(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionCamera_setUp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionCamera_getCenter(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionCamera_setCenter(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionCamera_getUp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionCamera_ActionCamera(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_OrbitCamera_class;\nextern JSObject *jsb_cocos2d_OrbitCamera_prototype;\n\nJSBool js_cocos2dx_OrbitCamera_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_OrbitCamera_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_OrbitCamera(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_OrbitCamera_sphericalRadius(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_OrbitCamera_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_OrbitCamera_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_OrbitCamera_OrbitCamera(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ActionManager_class;\nextern JSObject *jsb_cocos2d_ActionManager_prototype;\n\nJSBool js_cocos2dx_ActionManager_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ActionManager_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ActionManager(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ActionManager_getActionByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_removeActionByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_removeAllActions(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_addAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_resumeTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_removeAllActionsFromTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_resumeTargets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_removeAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_pauseTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_pauseAllRunningActions(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionManager_ActionManager(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ActionEase_class;\nextern JSObject *jsb_cocos2d_ActionEase_prototype;\n\nJSBool js_cocos2dx_ActionEase_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ActionEase_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ActionEase(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ActionEase_getInnerAction(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseRateAction_class;\nextern JSObject *jsb_cocos2d_EaseRateAction_prototype;\n\nJSBool js_cocos2dx_EaseRateAction_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseRateAction_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseRateAction(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseRateAction_setRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_EaseRateAction_getRate(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseIn_class;\nextern JSObject *jsb_cocos2d_EaseIn_prototype;\n\nJSBool js_cocos2dx_EaseIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseOut_class;\nextern JSObject *jsb_cocos2d_EaseOut_prototype;\n\nJSBool js_cocos2dx_EaseOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseInOut_class;\nextern JSObject *jsb_cocos2d_EaseInOut_prototype;\n\nJSBool js_cocos2dx_EaseInOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseInOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseInOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseInOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseExponentialIn_class;\nextern JSObject *jsb_cocos2d_EaseExponentialIn_prototype;\n\nJSBool js_cocos2dx_EaseExponentialIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseExponentialIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseExponentialIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseExponentialIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseExponentialOut_class;\nextern JSObject *jsb_cocos2d_EaseExponentialOut_prototype;\n\nJSBool js_cocos2dx_EaseExponentialOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseExponentialOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseExponentialOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseExponentialOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseExponentialInOut_class;\nextern JSObject *jsb_cocos2d_EaseExponentialInOut_prototype;\n\nJSBool js_cocos2dx_EaseExponentialInOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseExponentialInOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseExponentialInOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseExponentialInOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseSineIn_class;\nextern JSObject *jsb_cocos2d_EaseSineIn_prototype;\n\nJSBool js_cocos2dx_EaseSineIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseSineIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseSineIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseSineIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseSineOut_class;\nextern JSObject *jsb_cocos2d_EaseSineOut_prototype;\n\nJSBool js_cocos2dx_EaseSineOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseSineOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseSineOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseSineOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseSineInOut_class;\nextern JSObject *jsb_cocos2d_EaseSineInOut_prototype;\n\nJSBool js_cocos2dx_EaseSineInOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseSineInOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseSineInOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseSineInOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseElastic_class;\nextern JSObject *jsb_cocos2d_EaseElastic_prototype;\n\nJSBool js_cocos2dx_EaseElastic_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseElastic_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseElastic(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseElastic_setPeriod(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_EaseElastic_getPeriod(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseElasticIn_class;\nextern JSObject *jsb_cocos2d_EaseElasticIn_prototype;\n\nJSBool js_cocos2dx_EaseElasticIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseElasticIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseElasticIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseElasticIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseElasticOut_class;\nextern JSObject *jsb_cocos2d_EaseElasticOut_prototype;\n\nJSBool js_cocos2dx_EaseElasticOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseElasticOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseElasticOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseElasticOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseElasticInOut_class;\nextern JSObject *jsb_cocos2d_EaseElasticInOut_prototype;\n\nJSBool js_cocos2dx_EaseElasticInOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseElasticInOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseElasticInOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseElasticInOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseBounce_class;\nextern JSObject *jsb_cocos2d_EaseBounce_prototype;\n\nJSBool js_cocos2dx_EaseBounce_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseBounce_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseBounce(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseBounce_bounceTime(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseBounceIn_class;\nextern JSObject *jsb_cocos2d_EaseBounceIn_prototype;\n\nJSBool js_cocos2dx_EaseBounceIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseBounceIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseBounceIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseBounceIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseBounceOut_class;\nextern JSObject *jsb_cocos2d_EaseBounceOut_prototype;\n\nJSBool js_cocos2dx_EaseBounceOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseBounceOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseBounceOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseBounceOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseBounceInOut_class;\nextern JSObject *jsb_cocos2d_EaseBounceInOut_prototype;\n\nJSBool js_cocos2dx_EaseBounceInOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseBounceInOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseBounceInOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseBounceInOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseBackIn_class;\nextern JSObject *jsb_cocos2d_EaseBackIn_prototype;\n\nJSBool js_cocos2dx_EaseBackIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseBackIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseBackIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseBackIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseBackOut_class;\nextern JSObject *jsb_cocos2d_EaseBackOut_prototype;\n\nJSBool js_cocos2dx_EaseBackOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseBackOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseBackOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseBackOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EaseBackInOut_class;\nextern JSObject *jsb_cocos2d_EaseBackInOut_prototype;\n\nJSBool js_cocos2dx_EaseBackInOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EaseBackInOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EaseBackInOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EaseBackInOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ActionInstant_class;\nextern JSObject *jsb_cocos2d_ActionInstant_prototype;\n\nJSBool js_cocos2dx_ActionInstant_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ActionInstant_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ActionInstant(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocos2d_Show_class;\nextern JSObject *jsb_cocos2d_Show_prototype;\n\nJSBool js_cocos2dx_Show_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Show_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Show(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Show_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Hide_class;\nextern JSObject *jsb_cocos2d_Hide_prototype;\n\nJSBool js_cocos2dx_Hide_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Hide_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Hide(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Hide_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ToggleVisibility_class;\nextern JSObject *jsb_cocos2d_ToggleVisibility_prototype;\n\nJSBool js_cocos2dx_ToggleVisibility_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ToggleVisibility_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ToggleVisibility(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ToggleVisibility_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_RemoveSelf_class;\nextern JSObject *jsb_cocos2d_RemoveSelf_prototype;\n\nJSBool js_cocos2dx_RemoveSelf_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_RemoveSelf_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_RemoveSelf(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_RemoveSelf_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FlipX_class;\nextern JSObject *jsb_cocos2d_FlipX_prototype;\n\nJSBool js_cocos2dx_FlipX_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FlipX_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FlipX(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FlipX_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FlipY_class;\nextern JSObject *jsb_cocos2d_FlipY_prototype;\n\nJSBool js_cocos2dx_FlipY_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FlipY_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FlipY(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FlipY_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Place_class;\nextern JSObject *jsb_cocos2d_Place_prototype;\n\nJSBool js_cocos2dx_Place_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Place_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Place(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Place_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_CallFunc_class;\nextern JSObject *jsb_cocos2d_CallFunc_prototype;\n\nJSBool js_cocos2dx_CallFunc_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_CallFunc_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_CallFunc(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_CallFunc_execute(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_CallFunc_getTargetCallback(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_CallFunc_setTargetCallback(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_GridAction_class;\nextern JSObject *jsb_cocos2d_GridAction_prototype;\n\nJSBool js_cocos2dx_GridAction_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_GridAction_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_GridAction(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_GridAction_getGrid(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Grid3DAction_class;\nextern JSObject *jsb_cocos2d_Grid3DAction_prototype;\n\nJSBool js_cocos2dx_Grid3DAction_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Grid3DAction_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Grid3DAction(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Grid3DAction_getGrid(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TiledGrid3DAction_class;\nextern JSObject *jsb_cocos2d_TiledGrid3DAction_prototype;\n\nJSBool js_cocos2dx_TiledGrid3DAction_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TiledGrid3DAction_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TiledGrid3DAction(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TiledGrid3DAction_getGrid(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_StopGrid_class;\nextern JSObject *jsb_cocos2d_StopGrid_prototype;\n\nJSBool js_cocos2dx_StopGrid_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_StopGrid_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_StopGrid(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_StopGrid_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ReuseGrid_class;\nextern JSObject *jsb_cocos2d_ReuseGrid_prototype;\n\nJSBool js_cocos2dx_ReuseGrid_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ReuseGrid_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ReuseGrid(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ReuseGrid_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Waves3D_class;\nextern JSObject *jsb_cocos2d_Waves3D_prototype;\n\nJSBool js_cocos2dx_Waves3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Waves3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Waves3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Waves3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FlipX3D_class;\nextern JSObject *jsb_cocos2d_FlipX3D_prototype;\n\nJSBool js_cocos2dx_FlipX3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FlipX3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FlipX3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FlipX3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FlipY3D_class;\nextern JSObject *jsb_cocos2d_FlipY3D_prototype;\n\nJSBool js_cocos2dx_FlipY3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FlipY3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FlipY3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FlipY3D_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FlipY3D_FlipY3D(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Lens3D_class;\nextern JSObject *jsb_cocos2d_Lens3D_prototype;\n\nJSBool js_cocos2dx_Lens3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Lens3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Lens3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Lens3D_setPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Lens3D_setConcave(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Lens3D_setLensEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Lens3D_getPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Lens3D_getLensEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Lens3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Ripple3D_class;\nextern JSObject *jsb_cocos2d_Ripple3D_prototype;\n\nJSBool js_cocos2dx_Ripple3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Ripple3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Ripple3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Ripple3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Ripple3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Ripple3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Ripple3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Ripple3D_setPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Ripple3D_getPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Ripple3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Shaky3D_class;\nextern JSObject *jsb_cocos2d_Shaky3D_prototype;\n\nJSBool js_cocos2dx_Shaky3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Shaky3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Shaky3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Shaky3D_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Shaky3D_Shaky3D(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Liquid_class;\nextern JSObject *jsb_cocos2d_Liquid_prototype;\n\nJSBool js_cocos2dx_Liquid_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Liquid_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Liquid(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Liquid_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Liquid_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Liquid_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Liquid_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Liquid_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Liquid_Liquid(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Waves_class;\nextern JSObject *jsb_cocos2d_Waves_prototype;\n\nJSBool js_cocos2dx_Waves_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Waves_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Waves(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Waves_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Waves_Waves(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Twirl_class;\nextern JSObject *jsb_cocos2d_Twirl_prototype;\n\nJSBool js_cocos2dx_Twirl_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Twirl_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Twirl(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Twirl_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Twirl_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Twirl_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Twirl_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Twirl_setPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Twirl_getPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Twirl_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Twirl_Twirl(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_PageTurn3D_class;\nextern JSObject *jsb_cocos2d_PageTurn3D_prototype;\n\nJSBool js_cocos2dx_PageTurn3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_PageTurn3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_PageTurn3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_PageTurn3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ProgressTo_class;\nextern JSObject *jsb_cocos2d_ProgressTo_prototype;\n\nJSBool js_cocos2dx_ProgressTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ProgressTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ProgressTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ProgressTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ProgressFromTo_class;\nextern JSObject *jsb_cocos2d_ProgressFromTo_prototype;\n\nJSBool js_cocos2dx_ProgressFromTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ProgressFromTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ProgressFromTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ProgressFromTo_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ShakyTiles3D_class;\nextern JSObject *jsb_cocos2d_ShakyTiles3D_prototype;\n\nJSBool js_cocos2dx_ShakyTiles3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ShakyTiles3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ShakyTiles3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ShakyTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ShatteredTiles3D_class;\nextern JSObject *jsb_cocos2d_ShatteredTiles3D_prototype;\n\nJSBool js_cocos2dx_ShatteredTiles3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ShatteredTiles3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ShatteredTiles3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ShatteredTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ShuffleTiles_class;\nextern JSObject *jsb_cocos2d_ShuffleTiles_prototype;\n\nJSBool js_cocos2dx_ShuffleTiles_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ShuffleTiles_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ShuffleTiles(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ShuffleTiles_placeTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShuffleTiles_shuffle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShuffleTiles_getDelta(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShuffleTiles_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FadeOutTRTiles_class;\nextern JSObject *jsb_cocos2d_FadeOutTRTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutTRTiles_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FadeOutTRTiles_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FadeOutTRTiles(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FadeOutTRTiles_turnOnTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FadeOutTRTiles_turnOffTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FadeOutTRTiles_transformTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FadeOutTRTiles_testFunc(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FadeOutTRTiles_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FadeOutBLTiles_class;\nextern JSObject *jsb_cocos2d_FadeOutBLTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutBLTiles_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FadeOutBLTiles_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FadeOutBLTiles(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FadeOutBLTiles_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FadeOutUpTiles_class;\nextern JSObject *jsb_cocos2d_FadeOutUpTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutUpTiles_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FadeOutUpTiles_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FadeOutUpTiles(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FadeOutUpTiles_transformTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FadeOutUpTiles_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FadeOutDownTiles_class;\nextern JSObject *jsb_cocos2d_FadeOutDownTiles_prototype;\n\nJSBool js_cocos2dx_FadeOutDownTiles_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FadeOutDownTiles_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FadeOutDownTiles(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FadeOutDownTiles_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TurnOffTiles_class;\nextern JSObject *jsb_cocos2d_TurnOffTiles_prototype;\n\nJSBool js_cocos2dx_TurnOffTiles_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TurnOffTiles_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TurnOffTiles(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TurnOffTiles_turnOnTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TurnOffTiles_turnOffTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TurnOffTiles_shuffle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_WavesTiles3D_class;\nextern JSObject *jsb_cocos2d_WavesTiles3D_prototype;\n\nJSBool js_cocos2dx_WavesTiles3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_WavesTiles3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_WavesTiles3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_WavesTiles3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_WavesTiles3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_WavesTiles3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_WavesTiles3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_WavesTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_JumpTiles3D_class;\nextern JSObject *jsb_cocos2d_JumpTiles3D_prototype;\n\nJSBool js_cocos2dx_JumpTiles3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_JumpTiles3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_JumpTiles3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_JumpTiles3D_getAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_JumpTiles3D_setAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_JumpTiles3D_setAmplitudeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_JumpTiles3D_getAmplitude(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_JumpTiles3D_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_SplitRows_class;\nextern JSObject *jsb_cocos2d_SplitRows_prototype;\n\nJSBool js_cocos2dx_SplitRows_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SplitRows_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SplitRows(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SplitRows_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_SplitCols_class;\nextern JSObject *jsb_cocos2d_SplitCols_prototype;\n\nJSBool js_cocos2dx_SplitCols_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SplitCols_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SplitCols(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SplitCols_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ActionTween_class;\nextern JSObject *jsb_cocos2d_ActionTween_prototype;\n\nJSBool js_cocos2dx_ActionTween_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ActionTween_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ActionTween(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ActionTween_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ActionTween_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_CardinalSplineTo_class;\nextern JSObject *jsb_cocos2d_CardinalSplineTo_prototype;\n\nJSBool js_cocos2dx_CardinalSplineTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_CardinalSplineTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_CardinalSplineTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_CardinalSplineTo_getPoints(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_CardinalSplineTo_updatePosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_CardinalSplineTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_CardinalSplineTo_CardinalSplineTo(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_CardinalSplineBy_class;\nextern JSObject *jsb_cocos2d_CardinalSplineBy_prototype;\n\nJSBool js_cocos2dx_CardinalSplineBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_CardinalSplineBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_CardinalSplineBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_CardinalSplineBy_CardinalSplineBy(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_CatmullRomTo_class;\nextern JSObject *jsb_cocos2d_CatmullRomTo_prototype;\n\nJSBool js_cocos2dx_CatmullRomTo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_CatmullRomTo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_CatmullRomTo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_CatmullRomTo_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_CatmullRomBy_class;\nextern JSObject *jsb_cocos2d_CatmullRomBy_prototype;\n\nJSBool js_cocos2dx_CatmullRomBy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_CatmullRomBy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_CatmullRomBy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_CatmullRomBy_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_AtlasNode_class;\nextern JSObject *jsb_cocos2d_AtlasNode_prototype;\n\nJSBool js_cocos2dx_AtlasNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_AtlasNode_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_AtlasNode(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_AtlasNode_updateAtlasValues(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AtlasNode_getTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AtlasNode_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AtlasNode_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AtlasNode_getQuadsToDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AtlasNode_setTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AtlasNode_setQuadsToDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AtlasNode_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_DrawNode_class;\nextern JSObject *jsb_cocos2d_DrawNode_prototype;\n\nJSBool js_cocos2dx_DrawNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_DrawNode_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_DrawNode(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_DrawNode_drawQuadraticBezier(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_DrawNode_onDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_DrawNode_clear(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_DrawNode_drawTriangle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_DrawNode_drawDot(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_DrawNode_drawCubicBezier(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_DrawNode_drawSegment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_DrawNode_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_LabelAtlas_class;\nextern JSObject *jsb_cocos2d_LabelAtlas_prototype;\n\nJSBool js_cocos2dx_LabelAtlas_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_LabelAtlas_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_LabelAtlas(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_LabelAtlas_setString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelAtlas_initWithString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelAtlas_updateAtlasValues(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelAtlas_getString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelAtlas_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Director_class;\nextern JSObject *jsb_cocos2d_Director_prototype;\n\nJSBool js_cocos2dx_Director_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Director_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Director(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Director_pause(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getContentScaleFactor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getWinSizeInPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getDeltaTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setGLDefaultValues(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setActionManager(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setAlphaBlending(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_popToRootScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getNotificationNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getWinSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_end(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getTextureCache(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_isSendCleanupToScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_mainLoop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setDepthTest(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getFrameRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getSecondsPerFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_convertToUI(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setDefaultValues(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setScheduler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_startAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getRunningScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setViewport(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_stopAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_popToSceneStackLevel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_resume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_isNextDeltaTimeZero(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setOpenGLView(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_convertToGL(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_purgeCachedData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getTotalFrames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_runWithScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setNotificationNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_drawScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_popScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_isDisplayStats(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setProjection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getConsole(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getZEye(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setNextDeltaTimeZero(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getVisibleSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getScheduler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_pushScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_isPaused(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setDisplayStats(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_replaceScene(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_setAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getActionManager(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Director_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_GridBase_class;\nextern JSObject *jsb_cocos2d_GridBase_prototype;\n\nJSBool js_cocos2dx_GridBase_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_GridBase_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_GridBase(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_GridBase_setGridSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_calculateVertexPoints(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_afterDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_beforeDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_isTextureFlipped(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_getGridSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_getStep(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_set2DProjection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_setStep(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_setTextureFlipped(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_blit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_setActive(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_getReuseGrid(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_initWithSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_setReuseGrid(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_isActive(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_reuse(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_GridBase_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Grid3D_class;\nextern JSObject *jsb_cocos2d_Grid3D_prototype;\n\nJSBool js_cocos2dx_Grid3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Grid3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Grid3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Grid3D_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Grid3D_Grid3D(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TiledGrid3D_class;\nextern JSObject *jsb_cocos2d_TiledGrid3D_prototype;\n\nJSBool js_cocos2dx_TiledGrid3D_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TiledGrid3D_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TiledGrid3D(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TiledGrid3D_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TiledGrid3D_TiledGrid3D(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Sprite_class;\nextern JSObject *jsb_cocos2d_Sprite_prototype;\n\nJSBool js_cocos2dx_Sprite_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Sprite_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Sprite(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Sprite_setSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_getTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setFlippedY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setFlippedX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_getOffsetPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_updateQuadVertices(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_updateTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setTextureRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_isFrameDisplayed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_getAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setDisplayFrameWithAnimationName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_getSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_isDirty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setDirty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_isTextureRectRotated(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_getTextureRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_isFlippedX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_isFlippedY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_setVertexRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Sprite_createWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_LabelTTF_class;\nextern JSObject *jsb_cocos2d_LabelTTF_prototype;\n\nJSBool js_cocos2dx_LabelTTF_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_LabelTTF_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_LabelTTF(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_LabelTTF_enableShadow(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setDimensions(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_getFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_getString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setTextDefinition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_getHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_initWithStringAndTextDefinition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_initWithString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setFontFillColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_enableStroke(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_getDimensions(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_getVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_getTextDefinition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_getFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_setHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_disableShadow(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_disableStroke(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_createWithFontDefinition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelTTF_LabelTTF(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_SpriteBatchNode_class;\nextern JSObject *jsb_cocos2d_SpriteBatchNode_prototype;\n\nJSBool js_cocos2dx_SpriteBatchNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SpriteBatchNode_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SpriteBatchNode(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SpriteBatchNode_appendChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_reorderBatch(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_initWithTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_atlasIndexForChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_rebuildIndexInOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_increaseAtlasCapacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_setTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_getTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_removeChildAtIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteBatchNode_SpriteBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_LabelBMFont_class;\nextern JSObject *jsb_cocos2d_LabelBMFont_prototype;\n\nJSBool js_cocos2dx_LabelBMFont_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_LabelBMFont_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_LabelBMFont(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_LabelBMFont_setLineBreakWithoutSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setScaleY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setScaleX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_isOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_createFontChars(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_getString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_initWithString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setCString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setFntFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_getFntFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_updateLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_setWidth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_purgeCachedData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LabelBMFont_LabelBMFont(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Label_class;\nextern JSObject *jsb_cocos2d_Label_prototype;\n\nJSBool js_cocos2dx_Label_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Label_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Label(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Label_getString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_assignNewUTF16String(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_setLabelEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getCommonLineHeight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_breakLineWithoutSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_setWidth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getMaxLineWidth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getScaleY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getScaleX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_setString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getKernings(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_setBMFontFilePath(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_recordPlaceholderInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getFontAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_setLineBreakWithoutSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getStringNumLines(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getUTF16String(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getStringLenght(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_onDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_setCharMap(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getLetter(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_getTextAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_setAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_recordLetterInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_createWithBMFont(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Label_createWithCharMap(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Layer_class;\nextern JSObject *jsb_cocos2d_Layer_prototype;\n\nJSBool js_cocos2dx_Layer_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Layer_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Layer(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Layer_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d___LayerRGBA_class;\nextern JSObject *jsb_cocos2d___LayerRGBA_prototype;\n\nJSBool js_cocos2dx___LayerRGBA_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx___LayerRGBA_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx___LayerRGBA(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx___LayerRGBA_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_LayerColor_class;\nextern JSObject *jsb_cocos2d_LayerColor_prototype;\n\nJSBool js_cocos2dx_LayerColor_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_LayerColor_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_LayerColor(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_LayerColor_changeWidthAndHeight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerColor_onDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerColor_changeWidth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerColor_changeHeight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerColor_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_LayerGradient_class;\nextern JSObject *jsb_cocos2d_LayerGradient_prototype;\n\nJSBool js_cocos2dx_LayerGradient_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_LayerGradient_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_LayerGradient(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_LayerGradient_getStartColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_isCompressedInterpolation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_getStartOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_setVector(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_setStartOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_setCompressedInterpolation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_setEndOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_getVector(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_initWithColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_setEndColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_getEndColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_getEndOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_setStartColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerGradient_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_LayerMultiplex_class;\nextern JSObject *jsb_cocos2d_LayerMultiplex_prototype;\n\nJSBool js_cocos2dx_LayerMultiplex_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_LayerMultiplex_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_LayerMultiplex(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_LayerMultiplex_switchToAndReleaseMe(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerMultiplex_addLayer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_LayerMultiplex_switchTo(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Scene_class;\nextern JSObject *jsb_cocos2d_Scene_prototype;\n\nJSBool js_cocos2dx_Scene_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Scene_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Scene(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Scene_getPhysicsWorld(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Scene_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Scene_createWithPhysics(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionEaseScene_class;\nextern JSObject *jsb_cocos2d_TransitionEaseScene_prototype;\n\nJSBool js_cocos2dx_TransitionEaseScene_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionEaseScene_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionEaseScene(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionEaseScene_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionScene_class;\nextern JSObject *jsb_cocos2d_TransitionScene_prototype;\n\nJSBool js_cocos2dx_TransitionScene_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionScene_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionScene(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionScene_finish(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionScene_hideOutShowIn(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionScene_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionSceneOriented_class;\nextern JSObject *jsb_cocos2d_TransitionSceneOriented_prototype;\n\nJSBool js_cocos2dx_TransitionSceneOriented_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionSceneOriented_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionSceneOriented(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionSceneOriented_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionRotoZoom_class;\nextern JSObject *jsb_cocos2d_TransitionRotoZoom_prototype;\n\nJSBool js_cocos2dx_TransitionRotoZoom_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionRotoZoom_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionRotoZoom(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionRotoZoom_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionJumpZoom_class;\nextern JSObject *jsb_cocos2d_TransitionJumpZoom_prototype;\n\nJSBool js_cocos2dx_TransitionJumpZoom_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionJumpZoom_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionJumpZoom(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionJumpZoom_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionMoveInL_class;\nextern JSObject *jsb_cocos2d_TransitionMoveInL_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInL_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionMoveInL_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionMoveInL(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionMoveInL_action(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionMoveInL_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionMoveInL_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionMoveInR_class;\nextern JSObject *jsb_cocos2d_TransitionMoveInR_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInR_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionMoveInR_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionMoveInR(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionMoveInR_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionMoveInT_class;\nextern JSObject *jsb_cocos2d_TransitionMoveInT_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInT_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionMoveInT_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionMoveInT(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionMoveInT_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionMoveInB_class;\nextern JSObject *jsb_cocos2d_TransitionMoveInB_prototype;\n\nJSBool js_cocos2dx_TransitionMoveInB_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionMoveInB_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionMoveInB(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionMoveInB_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionSlideInL_class;\nextern JSObject *jsb_cocos2d_TransitionSlideInL_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInL_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionSlideInL_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionSlideInL(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionSlideInL_action(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionSlideInL_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionSlideInL_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionSlideInR_class;\nextern JSObject *jsb_cocos2d_TransitionSlideInR_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInR_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionSlideInR_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionSlideInR(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionSlideInR_action(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionSlideInR_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionSlideInB_class;\nextern JSObject *jsb_cocos2d_TransitionSlideInB_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInB_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionSlideInB_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionSlideInB(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionSlideInB_action(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionSlideInB_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionSlideInT_class;\nextern JSObject *jsb_cocos2d_TransitionSlideInT_prototype;\n\nJSBool js_cocos2dx_TransitionSlideInT_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionSlideInT_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionSlideInT(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionSlideInT_action(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionSlideInT_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionShrinkGrow_class;\nextern JSObject *jsb_cocos2d_TransitionShrinkGrow_prototype;\n\nJSBool js_cocos2dx_TransitionShrinkGrow_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionShrinkGrow_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionShrinkGrow(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionShrinkGrow_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionShrinkGrow_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFlipX_class;\nextern JSObject *jsb_cocos2d_TransitionFlipX_prototype;\n\nJSBool js_cocos2dx_TransitionFlipX_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFlipX_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFlipX(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFlipX_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFlipY_class;\nextern JSObject *jsb_cocos2d_TransitionFlipY_prototype;\n\nJSBool js_cocos2dx_TransitionFlipY_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFlipY_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFlipY(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFlipY_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFlipAngular_class;\nextern JSObject *jsb_cocos2d_TransitionFlipAngular_prototype;\n\nJSBool js_cocos2dx_TransitionFlipAngular_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFlipAngular_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFlipAngular(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFlipAngular_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionZoomFlipX_class;\nextern JSObject *jsb_cocos2d_TransitionZoomFlipX_prototype;\n\nJSBool js_cocos2dx_TransitionZoomFlipX_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionZoomFlipX_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionZoomFlipX(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionZoomFlipX_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionZoomFlipY_class;\nextern JSObject *jsb_cocos2d_TransitionZoomFlipY_prototype;\n\nJSBool js_cocos2dx_TransitionZoomFlipY_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionZoomFlipY_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionZoomFlipY(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionZoomFlipY_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionZoomFlipAngular_class;\nextern JSObject *jsb_cocos2d_TransitionZoomFlipAngular_prototype;\n\nJSBool js_cocos2dx_TransitionZoomFlipAngular_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionZoomFlipAngular_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionZoomFlipAngular(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionZoomFlipAngular_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFade_class;\nextern JSObject *jsb_cocos2d_TransitionFade_prototype;\n\nJSBool js_cocos2dx_TransitionFade_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFade_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFade(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFade_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionCrossFade_class;\nextern JSObject *jsb_cocos2d_TransitionCrossFade_prototype;\n\nJSBool js_cocos2dx_TransitionCrossFade_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionCrossFade_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionCrossFade(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionCrossFade_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionTurnOffTiles_class;\nextern JSObject *jsb_cocos2d_TransitionTurnOffTiles_prototype;\n\nJSBool js_cocos2dx_TransitionTurnOffTiles_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionTurnOffTiles_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionTurnOffTiles(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionTurnOffTiles_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionTurnOffTiles_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionSplitCols_class;\nextern JSObject *jsb_cocos2d_TransitionSplitCols_prototype;\n\nJSBool js_cocos2dx_TransitionSplitCols_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionSplitCols_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionSplitCols(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionSplitCols_action(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionSplitCols_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionSplitCols_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionSplitRows_class;\nextern JSObject *jsb_cocos2d_TransitionSplitRows_prototype;\n\nJSBool js_cocos2dx_TransitionSplitRows_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionSplitRows_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionSplitRows(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionSplitRows_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFadeTR_class;\nextern JSObject *jsb_cocos2d_TransitionFadeTR_prototype;\n\nJSBool js_cocos2dx_TransitionFadeTR_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFadeTR_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFadeTR(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFadeTR_easeActionWithAction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionFadeTR_actionWithSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionFadeTR_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFadeBL_class;\nextern JSObject *jsb_cocos2d_TransitionFadeBL_prototype;\n\nJSBool js_cocos2dx_TransitionFadeBL_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFadeBL_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFadeBL(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFadeBL_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFadeUp_class;\nextern JSObject *jsb_cocos2d_TransitionFadeUp_prototype;\n\nJSBool js_cocos2dx_TransitionFadeUp_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFadeUp_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFadeUp(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFadeUp_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionFadeDown_class;\nextern JSObject *jsb_cocos2d_TransitionFadeDown_prototype;\n\nJSBool js_cocos2dx_TransitionFadeDown_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionFadeDown_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionFadeDown(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionFadeDown_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionPageTurn_class;\nextern JSObject *jsb_cocos2d_TransitionPageTurn_prototype;\n\nJSBool js_cocos2dx_TransitionPageTurn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionPageTurn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionPageTurn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionPageTurn_actionWithSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionPageTurn_initWithDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionPageTurn_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionPageTurn_TransitionPageTurn(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionProgress_class;\nextern JSObject *jsb_cocos2d_TransitionProgress_prototype;\n\nJSBool js_cocos2dx_TransitionProgress_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionProgress_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionProgress(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionProgress_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TransitionProgress_TransitionProgress(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionProgressRadialCCW_class;\nextern JSObject *jsb_cocos2d_TransitionProgressRadialCCW_prototype;\n\nJSBool js_cocos2dx_TransitionProgressRadialCCW_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionProgressRadialCCW_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionProgressRadialCCW(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionProgressRadialCCW_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionProgressRadialCW_class;\nextern JSObject *jsb_cocos2d_TransitionProgressRadialCW_prototype;\n\nJSBool js_cocos2dx_TransitionProgressRadialCW_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionProgressRadialCW_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionProgressRadialCW(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionProgressRadialCW_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionProgressHorizontal_class;\nextern JSObject *jsb_cocos2d_TransitionProgressHorizontal_prototype;\n\nJSBool js_cocos2dx_TransitionProgressHorizontal_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionProgressHorizontal_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionProgressHorizontal(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionProgressHorizontal_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionProgressVertical_class;\nextern JSObject *jsb_cocos2d_TransitionProgressVertical_prototype;\n\nJSBool js_cocos2dx_TransitionProgressVertical_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionProgressVertical_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionProgressVertical(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionProgressVertical_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionProgressInOut_class;\nextern JSObject *jsb_cocos2d_TransitionProgressInOut_prototype;\n\nJSBool js_cocos2dx_TransitionProgressInOut_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionProgressInOut_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionProgressInOut(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionProgressInOut_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TransitionProgressOutIn_class;\nextern JSObject *jsb_cocos2d_TransitionProgressOutIn_prototype;\n\nJSBool js_cocos2dx_TransitionProgressOutIn_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TransitionProgressOutIn_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TransitionProgressOutIn(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TransitionProgressOutIn_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MenuItem_class;\nextern JSObject *jsb_cocos2d_MenuItem_prototype;\n\nJSBool js_cocos2dx_MenuItem_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MenuItem_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MenuItem(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MenuItem_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItem_activate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItem_isEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItem_selected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItem_isSelected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItem_unselected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItem_rect(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MenuItemLabel_class;\nextern JSObject *jsb_cocos2d_MenuItemLabel_prototype;\n\nJSBool js_cocos2dx_MenuItemLabel_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MenuItemLabel_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MenuItemLabel(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MenuItemLabel_getDisabledColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemLabel_setString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemLabel_setLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemLabel_setDisabledColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemLabel_getLabel(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MenuItemAtlasFont_class;\nextern JSObject *jsb_cocos2d_MenuItemAtlasFont_prototype;\n\nJSBool js_cocos2dx_MenuItemAtlasFont_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MenuItemAtlasFont_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MenuItemAtlasFont(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocos2d_MenuItemFont_class;\nextern JSObject *jsb_cocos2d_MenuItemFont_prototype;\n\nJSBool js_cocos2dx_MenuItemFont_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MenuItemFont_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MenuItemFont(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MenuItemFont_setFontNameObj(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemFont_getFontSizeObj(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemFont_getFontNameObj(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemFont_setFontSizeObj(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemFont_setFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemFont_getFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemFont_getFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemFont_setFontSize(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MenuItemSprite_class;\nextern JSObject *jsb_cocos2d_MenuItemSprite_prototype;\n\nJSBool js_cocos2dx_MenuItemSprite_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MenuItemSprite_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MenuItemSprite(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MenuItemSprite_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_selected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_setNormalImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_setDisabledImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_setSelectedImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_getDisabledImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_getSelectedImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_getNormalImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemSprite_unselected(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MenuItemImage_class;\nextern JSObject *jsb_cocos2d_MenuItemImage_prototype;\n\nJSBool js_cocos2dx_MenuItemImage_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MenuItemImage_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MenuItemImage(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MenuItemImage_setDisabledSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemImage_setSelectedSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemImage_setNormalSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MenuItemToggle_class;\nextern JSObject *jsb_cocos2d_MenuItemToggle_prototype;\n\nJSBool js_cocos2dx_MenuItemToggle_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MenuItemToggle_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MenuItemToggle(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MenuItemToggle_setSubItems(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemToggle_getSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemToggle_addSubItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemToggle_getSelectedItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MenuItemToggle_setSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Menu_class;\nextern JSObject *jsb_cocos2d_Menu_prototype;\n\nJSBool js_cocos2dx_Menu_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Menu_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Menu(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Menu_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Menu_alignItemsVertically(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Menu_isEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Menu_alignItemsHorizontallyWithPadding(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Menu_alignItemsVerticallyWithPadding(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Menu_alignItemsHorizontally(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ClippingNode_class;\nextern JSObject *jsb_cocos2d_ClippingNode_prototype;\n\nJSBool js_cocos2dx_ClippingNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ClippingNode_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ClippingNode(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ClippingNode_isInverted(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ClippingNode_setInverted(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ClippingNode_setStencil(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ClippingNode_getAlphaThreshold(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ClippingNode_getStencil(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ClippingNode_setAlphaThreshold(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ClippingNode_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_MotionStreak_class;\nextern JSObject *jsb_cocos2d_MotionStreak_prototype;\n\nJSBool js_cocos2dx_MotionStreak_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_MotionStreak_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_MotionStreak(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_MotionStreak_reset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_setTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_getTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_tintWithColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_setStartingPositionInitialized(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_isStartingPositionInitialized(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_isFastMode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_setFastMode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_MotionStreak_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ProgressTimer_class;\nextern JSObject *jsb_cocos2d_ProgressTimer_prototype;\n\nJSBool js_cocos2dx_ProgressTimer_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ProgressTimer_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ProgressTimer(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ProgressTimer_isReverseDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_setBarChangeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_getPercentage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_setSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_getType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_getSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_setMidpoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_getBarChangeRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_setReverseDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_getMidpoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_setPercentage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_setType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ProgressTimer_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_RenderTexture_class;\nextern JSObject *jsb_cocos2d_RenderTexture_prototype;\n\nJSBool js_cocos2dx_RenderTexture_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_RenderTexture_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_RenderTexture(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_RenderTexture_clearStencil(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_getClearDepth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_getClearStencil(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_end(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_setClearStencil(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_setSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_getSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_isAutoDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_setClearFlags(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_begin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_saveToFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_setAutoDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_setClearColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_endToLua(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_beginWithClear(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_clearDepth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_getClearColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_clear(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_getClearFlags(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_newImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_setClearDepth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_initWithWidthAndHeight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_RenderTexture_RenderTexture(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_NodeGrid_class;\nextern JSObject *jsb_cocos2d_NodeGrid_prototype;\n\nJSBool js_cocos2dx_NodeGrid_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_NodeGrid_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_NodeGrid(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_NodeGrid_setTarget(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_NodeGrid_getGrid(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_NodeGrid_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleBatchNode_class;\nextern JSObject *jsb_cocos2d_ParticleBatchNode_prototype;\n\nJSBool js_cocos2dx_ParticleBatchNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleBatchNode_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleBatchNode(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleBatchNode_setTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_disableParticle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_getTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_setTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_getTextureAtlas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_insertChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_visit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_removeChildAtIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleBatchNode_createWithTexture(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleSystem_class;\nextern JSObject *jsb_cocos2d_ParticleSystem_prototype;\n\nJSBool js_cocos2dx_ParticleSystem_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleSystem_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleSystem(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleSystem_getStartSizeVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_isFull(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getStartColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getPositionType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setPosVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndSpin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setRotatePerSecondVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getStartSpinVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getRadialAccelVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndSizeVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setRotation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setTangentialAccel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setScaleY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setScaleX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getRadialAccel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartRadius(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setRotatePerSecond(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getGravity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getTangentialAccel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndRadius(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getSpeed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartSpin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getPosVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_updateWithNoTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_isBlendAdditive(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getSpeedVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setPositionType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_stopSystem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getSourcePosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setLifeVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndColorVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_updateQuadWithParticle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getStartSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartSpinVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_resetSystem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setAtlasIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setTangentialAccelVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndRadiusVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndRadius(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_isOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_isActive(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setRadialAccelVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setSpeed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getStartSpin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getRotatePerSecond(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_initParticle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEmitterMode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setSourcePosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndSpinVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setBlendAdditive(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setLife(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setAngleVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setRotationIsDir(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndSizeVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getTangentialAccelVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEmitterMode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndSpinVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getAngleVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getRotatePerSecondVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getLife(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setSpeedVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setAutoRemoveOnFinish(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setGravity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_postStep(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEmissionRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndColorVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getRotationIsDir(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEmissionRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getLifeVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartSizeVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setOpacityModifyRGB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_addParticle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getStartRadius(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getParticleCount(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getStartRadiusVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartColorVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setEndSpin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setRadialAccel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_isAutoRemoveOnFinish(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_setStartRadiusVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getEndRadiusVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_getStartColorVar(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystem_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleSystemQuad_class;\nextern JSObject *jsb_cocos2d_ParticleSystemQuad_prototype;\n\nJSBool js_cocos2dx_ParticleSystemQuad_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleSystemQuad_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleSystemQuad(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleSystemQuad_setDisplayFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystemQuad_setTextureWithRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystemQuad_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSystemQuad_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleFire_class;\nextern JSObject *jsb_cocos2d_ParticleFire_prototype;\n\nJSBool js_cocos2dx_ParticleFire_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleFire_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleFire(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleFire_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleFire_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleFireworks_class;\nextern JSObject *jsb_cocos2d_ParticleFireworks_prototype;\n\nJSBool js_cocos2dx_ParticleFireworks_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleFireworks_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleFireworks(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleFireworks_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleFireworks_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleSun_class;\nextern JSObject *jsb_cocos2d_ParticleSun_prototype;\n\nJSBool js_cocos2dx_ParticleSun_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleSun_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleSun(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleSun_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSun_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleGalaxy_class;\nextern JSObject *jsb_cocos2d_ParticleGalaxy_prototype;\n\nJSBool js_cocos2dx_ParticleGalaxy_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleGalaxy_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleGalaxy(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleGalaxy_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleGalaxy_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleFlower_class;\nextern JSObject *jsb_cocos2d_ParticleFlower_prototype;\n\nJSBool js_cocos2dx_ParticleFlower_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleFlower_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleFlower(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleFlower_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleFlower_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleMeteor_class;\nextern JSObject *jsb_cocos2d_ParticleMeteor_prototype;\n\nJSBool js_cocos2dx_ParticleMeteor_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleMeteor_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleMeteor(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleMeteor_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleMeteor_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleSpiral_class;\nextern JSObject *jsb_cocos2d_ParticleSpiral_prototype;\n\nJSBool js_cocos2dx_ParticleSpiral_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleSpiral_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleSpiral(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleSpiral_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSpiral_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleExplosion_class;\nextern JSObject *jsb_cocos2d_ParticleExplosion_prototype;\n\nJSBool js_cocos2dx_ParticleExplosion_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleExplosion_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleExplosion(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleExplosion_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleExplosion_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleSmoke_class;\nextern JSObject *jsb_cocos2d_ParticleSmoke_prototype;\n\nJSBool js_cocos2dx_ParticleSmoke_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleSmoke_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleSmoke(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleSmoke_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSmoke_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleSnow_class;\nextern JSObject *jsb_cocos2d_ParticleSnow_prototype;\n\nJSBool js_cocos2dx_ParticleSnow_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleSnow_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleSnow(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleSnow_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleSnow_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParticleRain_class;\nextern JSObject *jsb_cocos2d_ParticleRain_prototype;\n\nJSBool js_cocos2dx_ParticleRain_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParticleRain_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParticleRain(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParticleRain_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParticleRain_createWithTotalParticles(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_FileUtils_class;\nextern JSObject *jsb_cocos2d_FileUtils_prototype;\n\nJSBool js_cocos2dx_FileUtils_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_FileUtils_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_FileUtils(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_FileUtils_fullPathForFilename(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_getStringFromFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_setFilenameLookupDictionary(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_isAbsolutePath(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_isPopupNotify(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_getValueVectorFromFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_writeToFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_getValueMapFromFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_addSearchResolutionsOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_addSearchPath(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_isFileExist(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_purgeCachedEntries(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_fullPathFromRelativeFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_FileUtils_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_SAXParser_class;\nextern JSObject *jsb_cocos2d_SAXParser_prototype;\n\nJSBool js_cocos2dx_SAXParser_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SAXParser_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SAXParser(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SAXParser_init(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Application_class;\nextern JSObject *jsb_cocos2d_Application_prototype;\n\nJSBool js_cocos2dx_Application_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Application_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Application(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Application_getTargetPlatform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Application_setAnimationInterval(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Application_getCurrentLanguage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Application_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EGLViewProtocol_class;\nextern JSObject *jsb_cocos2d_EGLViewProtocol_prototype;\n\nJSBool js_cocos2dx_EGLViewProtocol_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EGLViewProtocol_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EGLViewProtocol(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EGLViewProtocol_getVisibleOrigin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_EGLViewProtocol_getVisibleSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_EGLViewProtocol_setDesignResolutionSize(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_EGLView_class;\nextern JSObject *jsb_cocos2d_EGLView_prototype;\n\nJSBool js_cocos2dx_EGLView_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_EGLView_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_EGLView(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_EGLView_setIMEKeyboardState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_EGLView_isOpenGLReady(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_EGLView_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ShaderCache_class;\nextern JSObject *jsb_cocos2d_ShaderCache_prototype;\n\nJSBool js_cocos2dx_ShaderCache_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ShaderCache_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ShaderCache(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ShaderCache_reloadDefaultShaders(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShaderCache_addProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShaderCache_getProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShaderCache_loadDefaultShaders(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShaderCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShaderCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ShaderCache_ShaderCache(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_AnimationCache_class;\nextern JSObject *jsb_cocos2d_AnimationCache_prototype;\n\nJSBool js_cocos2dx_AnimationCache_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_AnimationCache_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_AnimationCache(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_AnimationCache_getAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_addAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_addAnimationsWithDictionary(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_removeAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_addAnimationsWithFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_AnimationCache_AnimationCache(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_SpriteFrameCache_class;\nextern JSObject *jsb_cocos2d_SpriteFrameCache_prototype;\n\nJSBool js_cocos2dx_SpriteFrameCache_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SpriteFrameCache_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SpriteFrameCache(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_addSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_getSpriteFrameByName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFrames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_removeSpriteFrameByName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SpriteFrameCache_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TextFieldTTF_class;\nextern JSObject *jsb_cocos2d_TextFieldTTF_prototype;\n\nJSBool js_cocos2dx_TextFieldTTF_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TextFieldTTF_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TextFieldTTF(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TextFieldTTF_getCharCount(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_getDelegate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_setSecureTextEntry(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_getColorSpaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_initWithPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_setColorSpaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_detachWithIME(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_setDelegate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_setPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_isSecureTextEntry(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_getPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_attachWithIME(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_textFieldWithPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextFieldTTF_TextFieldTTF(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TextureCache_class;\nextern JSObject *jsb_cocos2d_TextureCache_prototype;\n\nJSBool js_cocos2dx_TextureCache_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TextureCache_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TextureCache(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TextureCache_removeTextureForKey(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_removeAllTextures(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_getDescription(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_getCachedTextureInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_addImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_getTextureForKey(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_removeUnusedTextures(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_removeTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_waitForQuit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TextureCache_TextureCache(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_ParallaxNode_class;\nextern JSObject *jsb_cocos2d_ParallaxNode_prototype;\n\nJSBool js_cocos2dx_ParallaxNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_ParallaxNode_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_ParallaxNode(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_ParallaxNode_getParallaxArray(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParallaxNode_addChild(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParallaxNode_setParallaxArray(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_ParallaxNode_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TMXObjectGroup_class;\nextern JSObject *jsb_cocos2d_TMXObjectGroup_prototype;\n\nJSBool js_cocos2dx_TMXObjectGroup_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TMXObjectGroup_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TMXObjectGroup(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TMXObjectGroup_setPositionOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_getProperty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_getPositionOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_getObject(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_getObjects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_setGroupName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_getProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_getGroupName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_setProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_setObjects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXObjectGroup_TMXObjectGroup(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TMXLayerInfo_class;\nextern JSObject *jsb_cocos2d_TMXLayerInfo_prototype;\n\nJSBool js_cocos2dx_TMXLayerInfo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TMXLayerInfo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TMXLayerInfo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TMXLayerInfo_setProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayerInfo_getProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayerInfo_TMXLayerInfo(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TMXTilesetInfo_class;\nextern JSObject *jsb_cocos2d_TMXTilesetInfo_prototype;\n\nJSBool js_cocos2dx_TMXTilesetInfo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TMXTilesetInfo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TMXTilesetInfo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TMXTilesetInfo_rectForGID(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTilesetInfo_TMXTilesetInfo(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TMXMapInfo_class;\nextern JSObject *jsb_cocos2d_TMXMapInfo_prototype;\n\nJSBool js_cocos2dx_TMXMapInfo_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TMXMapInfo_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TMXMapInfo(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TMXMapInfo_setObjectGroups(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setTileSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_initWithTMXFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getOrientation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_isStoringCharacters(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setLayers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_parseXMLFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getParentElement(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setTMXFileName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_parseXMLString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getLayers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getTilesets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getParentGID(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setParentElement(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_initWithXML(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setParentGID(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getLayerAttribs(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getTileSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getTileProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getObjectGroups(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getTMXFileName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setCurrentString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setOrientation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setTileProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setMapSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setStoringCharacters(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getMapSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setTilesets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_getCurrentString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_setLayerAttribs(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_createWithXML(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXMapInfo_TMXMapInfo(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TMXLayer_class;\nextern JSObject *jsb_cocos2d_TMXLayer_prototype;\n\nJSBool js_cocos2dx_TMXLayer_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TMXLayer_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TMXLayer(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TMXLayer_getTileGIDAt(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getPositionAt(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setLayerOrientation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_releaseMap(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setTiles(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getLayerSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setMapTileSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getLayerOrientation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setLayerName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_removeTileAt(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_initWithTilesetInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setupTiles(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setTileGID(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getMapTileSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getProperty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setLayerSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getLayerName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_setTileSet(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getTileSet(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_getTileAt(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXLayer_TMXLayer(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TMXTiledMap_class;\nextern JSObject *jsb_cocos2d_TMXTiledMap_prototype;\n\nJSBool js_cocos2dx_TMXTiledMap_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TMXTiledMap_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TMXTiledMap(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TMXTiledMap_setObjectGroups(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getProperty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_setMapSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getObjectGroup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getObjectGroups(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getTileSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getMapSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getPropertiesForGID(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_setTileSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_setProperties(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getLayer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_getMapOrientation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_setMapOrientation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TMXTiledMap_createWithXML(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_TileMapAtlas_class;\nextern JSObject *jsb_cocos2d_TileMapAtlas_prototype;\n\nJSBool js_cocos2dx_TileMapAtlas_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_TileMapAtlas_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_TileMapAtlas(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_TileMapAtlas_initWithTileFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TileMapAtlas_releaseMap(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TileMapAtlas_getTGAInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TileMapAtlas_getTileAt(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TileMapAtlas_setTile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TileMapAtlas_setTGAInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TileMapAtlas_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_TileMapAtlas_TileMapAtlas(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Timer_class;\nextern JSObject *jsb_cocos2d_Timer_prototype;\n\nJSBool js_cocos2dx_Timer_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Timer_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Timer(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Timer_getInterval(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Timer_setInterval(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Timer_initWithScriptHandler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Timer_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Timer_getScriptHandler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Timer_Timer(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Scheduler_class;\nextern JSObject *jsb_cocos2d_Scheduler_prototype;\n\nJSBool js_cocos2dx_Scheduler_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Scheduler_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Scheduler(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Scheduler_setTimeScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Scheduler_performFunctionInCocosThread(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Scheduler_getTimeScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Scheduler_Scheduler(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_Component_class;\nextern JSObject *jsb_cocos2d_Component_prototype;\n\nJSBool js_cocos2dx_Component_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_Component_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_Component(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_Component_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_setName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_isEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_serialize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_getOwner(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_setOwner(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_getName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_Component_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_CocosDenshion_SimpleAudioEngine_class;\nextern JSObject *jsb_CocosDenshion_SimpleAudioEngine_prototype;\n\nJSBool js_cocos2dx_SimpleAudioEngine_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_SimpleAudioEngine_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_SimpleAudioEngine(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_stopBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_stopAllEffects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_preloadEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_getEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_pauseEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_playEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_playBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_resumeAllEffects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_setEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_stopEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_pauseAllEffects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_unloadEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_resumeEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_end(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_SimpleAudioEngine_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n#endif\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_auto_api.js",
    "content": "/**\n * @module cocos2dx\n */\nvar cc = cc || {};\n\n/**\n * @class Action\n */\ncc.Action = {\n\n/**\n * @method startWithTarget\n * @param {cocos2d::Node*}\n */\nstartWithTarget : function () {},\n\n/**\n * @method setOriginalTarget\n * @param {cocos2d::Node*}\n */\nsetOriginalTarget : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n */\nclone : function () {},\n\n/**\n * @method getOriginalTarget\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetOriginalTarget : function () {},\n\n/**\n * @method stop\n */\nstop : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method getTarget\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetTarget : function () {},\n\n/**\n * @method step\n * @param {float}\n */\nstep : function () {},\n\n/**\n * @method setTag\n * @param {int}\n */\nsetTag : function () {},\n\n/**\n * @method getTag\n * @return A value converted from C/C++ \"int\"\n */\ngetTag : function () {},\n\n/**\n * @method setTarget\n * @param {cocos2d::Node*}\n */\nsetTarget : function () {},\n\n/**\n * @method isDone\n * @return A value converted from C/C++ \"bool\"\n */\nisDone : function () {},\n\n/**\n * @method reverse\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n */\nreverse : function () {},\n\n};\n\n/**\n * @class FiniteTimeAction\n */\ncc.FiniteTimeAction = {\n\n/**\n * @method setDuration\n * @param {float}\n */\nsetDuration : function () {},\n\n/**\n * @method getDuration\n * @return A value converted from C/C++ \"float\"\n */\ngetDuration : function () {},\n\n};\n\n/**\n * @class Speed\n */\ncc.Speed = {\n\n/**\n * @method setInnerAction\n * @param {cocos2d::ActionInterval*}\n */\nsetInnerAction : function () {},\n\n/**\n * @method setSpeed\n * @param {float}\n */\nsetSpeed : function () {},\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\ngetInnerAction : function () {},\n\n/**\n * @method getSpeed\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeed : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Speed*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Follow\n */\ncc.Follow = {\n\n/**\n * @method setBoudarySet\n * @param {bool}\n */\nsetBoudarySet : function () {},\n\n/**\n * @method isBoundarySet\n * @return A value converted from C/C++ \"bool\"\n */\nisBoundarySet : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Follow*\"\n * @param {cocos2d::Node*}\n * @param {const cocos2d::Rect&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class GLProgram\n */\ncc.GLProgram = {\n\n/**\n * @method getFragmentShaderLog\n * @return A value converted from C/C++ \"std::string\"\n */\ngetFragmentShaderLog : function () {},\n\n/**\n * @method addAttribute\n * @param {const char*}\n * @param {GLuint}\n */\naddAttribute : function () {},\n\n/**\n * @method setUniformLocationWithMatrix4fv\n * @param {GLint}\n * @param {const GLfloat*}\n * @param {unsigned int}\n */\nsetUniformLocationWithMatrix4fv : function () {},\n\n/**\n * @method getUniformLocationForName\n * @return A value converted from C/C++ \"GLint\"\n * @param {const char*}\n */\ngetUniformLocationForName : function () {},\n\n/**\n * @method use\n */\nuse : function () {},\n\n/**\n * @method getVertexShaderLog\n * @return A value converted from C/C++ \"std::string\"\n */\ngetVertexShaderLog : function () {},\n\n/**\n * @method initWithVertexShaderByteArray\n * @return A value converted from C/C++ \"bool\"\n * @param {const GLchar*}\n * @param {const GLchar*}\n */\ninitWithVertexShaderByteArray : function () {},\n\n/**\n * @method initWithVertexShaderFilename\n * @return A value converted from C/C++ \"bool\"\n * @param {const char*}\n * @param {const char*}\n */\ninitWithVertexShaderFilename : function () {},\n\n/**\n * @method setUniformLocationWith3i\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith3i : function () {},\n\n/**\n * @method setUniformLocationWith3iv\n * @param {GLint}\n * @param {GLint*}\n * @param {unsigned int}\n */\nsetUniformLocationWith3iv : function () {},\n\n/**\n * @method updateUniforms\n */\nupdateUniforms : function () {},\n\n/**\n * @method setUniformLocationWith4iv\n * @param {GLint}\n * @param {GLint*}\n * @param {unsigned int}\n */\nsetUniformLocationWith4iv : function () {},\n\n/**\n * @method setUniformLocationWithMatrix2fv\n * @param {GLint}\n * @param {const GLfloat*}\n * @param {unsigned int}\n */\nsetUniformLocationWithMatrix2fv : function () {},\n\n/**\n * @method link\n * @return A value converted from C/C++ \"bool\"\n */\nlink : function () {},\n\n/**\n * @method setUniformLocationWith2iv\n * @param {GLint}\n * @param {GLint*}\n * @param {unsigned int}\n */\nsetUniformLocationWith2iv : function () {},\n\n/**\n * @method setUniformLocationWithMatrix3fv\n * @param {GLint}\n * @param {const GLfloat*}\n * @param {unsigned int}\n */\nsetUniformLocationWithMatrix3fv : function () {},\n\n/**\n * @method reset\n */\nreset : function () {},\n\n/**\n * @method setUniformLocationWith4i\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith4i : function () {},\n\n/**\n * @method setUniformLocationWith1i\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith1i : function () {},\n\n/**\n * @method setUniformLocationWith2i\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith2i : function () {},\n\n/**\n * @method GLProgram\n * @constructor\n */\nGLProgram : function () {},\n\n};\n\n/**\n * @class Touch\n */\ncc.Touch = {\n\n/**\n * @method getPreviousLocationInView\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPreviousLocationInView : function () {},\n\n/**\n * @method getLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetLocation : function () {},\n\n/**\n * @method getDelta\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetDelta : function () {},\n\n/**\n * @method getStartLocationInView\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartLocationInView : function () {},\n\n/**\n * @method getStartLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartLocation : function () {},\n\n/**\n * @method getID\n * @return A value converted from C/C++ \"int\"\n */\ngetID : function () {},\n\n/**\n * @method setTouchInfo\n * @param {int}\n * @param {float}\n * @param {float}\n */\nsetTouchInfo : function () {},\n\n/**\n * @method getLocationInView\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetLocationInView : function () {},\n\n/**\n * @method getPreviousLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPreviousLocation : function () {},\n\n/**\n * @method Touch\n * @constructor\n */\nTouch : function () {},\n\n};\n\n/**\n * @class Texture2D\n */\ncc.Texture2D = {\n\n/**\n * @method getShaderProgram\n * @return A value converted from C/C++ \"cocos2d::GLProgram*\"\n */\ngetShaderProgram : function () {},\n\n/**\n * @method getMaxT\n * @return A value converted from C/C++ \"GLfloat\"\n */\ngetMaxT : function () {},\n\n/**\n * @method getStringForFormat\n * @return A value converted from C/C++ \"const char*\"\n */\ngetStringForFormat : function () {},\n\n/**\n * @method setShaderProgram\n * @param {cocos2d::GLProgram*}\n */\nsetShaderProgram : function () {},\n\n/**\n * @method getMaxS\n * @return A value converted from C/C++ \"GLfloat\"\n */\ngetMaxS : function () {},\n\n/**\n * @method hasPremultipliedAlpha\n * @return A value converted from C/C++ \"bool\"\n */\nhasPremultipliedAlpha : function () {},\n\n/**\n * @method initWithMipmaps\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::MipmapInfo*}\n * @param {int}\n * @param {cocos2d::Texture2D::PixelFormat}\n * @param {int}\n * @param {int}\n */\ninitWithMipmaps : function () {},\n\n/**\n * @method getPixelsHigh\n * @return A value converted from C/C++ \"int\"\n */\ngetPixelsHigh : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"GLuint\"\n */\ngetName : function () {},\n\n/**\n * @method setMaxT\n * @param {GLfloat}\n */\nsetMaxT : function () {},\n\n/**\n * @method drawInRect\n * @param {const cocos2d::Rect&}\n */\ndrawInRect : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetContentSize : function () {},\n\n/**\n * @method setAliasTexParameters\n */\nsetAliasTexParameters : function () {},\n\n/**\n * @method setAntiAliasTexParameters\n */\nsetAntiAliasTexParameters : function () {},\n\n/**\n * @method generateMipmap\n */\ngenerateMipmap : function () {},\n\n/**\n * @method getDescription\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDescription : function () {},\n\n/**\n * @method getPixelFormat\n * @return A value converted from C/C++ \"cocos2d::Texture2D::PixelFormat\"\n */\ngetPixelFormat : function () {},\n\n/**\n * @method getContentSizeInPixels\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetContentSizeInPixels : function () {},\n\n/**\n * @method getPixelsWide\n * @return A value converted from C/C++ \"int\"\n */\ngetPixelsWide : function () {},\n\n/**\n * @method drawAtPoint\n * @param {const cocos2d::Point&}\n */\ndrawAtPoint : function () {},\n\n/**\n * @method hasMipmaps\n * @return A value converted from C/C++ \"bool\"\n */\nhasMipmaps : function () {},\n\n/**\n * @method setMaxS\n * @param {GLfloat}\n */\nsetMaxS : function () {},\n\n/**\n * @method setDefaultAlphaPixelFormat\n * @param {cocos2d::Texture2D::PixelFormat}\n */\nsetDefaultAlphaPixelFormat : function () {},\n\n/**\n * @method getDefaultAlphaPixelFormat\n * @return A value converted from C/C++ \"cocos2d::Texture2D::PixelFormat\"\n */\ngetDefaultAlphaPixelFormat : function () {},\n\n/**\n * @method PVRImagesHavePremultipliedAlpha\n * @param {bool}\n */\nPVRImagesHavePremultipliedAlpha : function () {},\n\n/**\n * @method Texture2D\n * @constructor\n */\nTexture2D : function () {},\n\n};\n\n/**\n * @class Node\n */\ncc.Node = {\n\n/**\n * @method removeComponent\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nremoveComponent : function () {},\n\n/**\n * @method setPhysicsBody\n * @param {cocos2d::PhysicsBody*}\n */\nsetPhysicsBody : function () {},\n\n/**\n * @method getDescription\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDescription : function () {},\n\n/**\n * @method setOpacityModifyRGB\n * @param {bool}\n */\nsetOpacityModifyRGB : function () {},\n\n/**\n * @method setCascadeOpacityEnabled\n * @param {bool}\n */\nsetCascadeOpacityEnabled : function () {},\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method convertToWorldSpaceAR\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToWorldSpaceAR : function () {},\n\n/**\n * @method isIgnoreAnchorPointForPosition\n * @return A value converted from C/C++ \"bool\"\n */\nisIgnoreAnchorPointForPosition : function () {},\n\n/**\n * @method updateDisplayedOpacity\n * @param {GLubyte}\n */\nupdateDisplayedOpacity : function () {},\n\n/**\n * @method setRotation\n * @param {float}\n */\nsetRotation : function () {},\n\n/**\n * @method setLocalZOrder\n * @param {int}\n */\nsetLocalZOrder : function () {},\n\n/**\n * @method setScaleY\n * @param {float}\n */\nsetScaleY : function () {},\n\n/**\n * @method setScaleX\n * @param {float}\n */\nsetScaleX : function () {},\n\n/**\n * @method getColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetColor : function () {},\n\n/**\n * @method removeAllComponents\n */\nremoveAllComponents : function () {},\n\n/**\n * @method _setLocalZOrder\n * @param {int}\n */\n_setLocalZOrder : function () {},\n\n/**\n * @method getTag\n * @return A value converted from C/C++ \"int\"\n */\ngetTag : function () {},\n\n/**\n * @method getNodeToWorldAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetNodeToWorldAffineTransform : function () {},\n\n/**\n * @method getNodeToWorldTransform\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetNodeToWorldTransform : function () {},\n\n/**\n * @method removeChild\n * @param {cocos2d::Node*}\n * @param {bool}\n */\nremoveChild : function () {},\n\n/**\n * @method convertToWorldSpace\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToWorldSpace : function () {},\n\n/**\n * @method getScene\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ngetScene : function () {},\n\n/**\n * @method getEventDispatcher\n * @return A value converted from C/C++ \"cocos2d::EventDispatcher*\"\n */\ngetEventDispatcher : function () {},\n\n/**\n * @method setSkewX\n * @param {float}\n */\nsetSkewX : function () {},\n\n/**\n * @method setSkewY\n * @param {float}\n */\nsetSkewY : function () {},\n\n/**\n * @method getOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetOpacity : function () {},\n\n/**\n * @method convertTouchToNodeSpace\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nconvertTouchToNodeSpace : function () {},\n\n/**\n * @method getRotationX\n * @return A value converted from C/C++ \"float\"\n */\ngetRotationX : function () {},\n\n/**\n * @method getRotationY\n * @return A value converted from C/C++ \"float\"\n */\ngetRotationY : function () {},\n\n/**\n * @method getNodeToParentAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetNodeToParentAffineTransform : function () {},\n\n/**\n * @method isCascadeOpacityEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisCascadeOpacityEnabled : function () {},\n\n/**\n * @method setParent\n * @param {cocos2d::Node*}\n */\nsetParent : function () {},\n\n/**\n * @method getNodeToParentTransform\n * @return A value converted from C/C++ \"const kmMat4&\"\n */\ngetNodeToParentTransform : function () {},\n\n/**\n * @method resume\n */\nresume : function () {},\n\n/**\n * @method getPhysicsBody\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n */\ngetPhysicsBody : function () {},\n\n/**\n * @method stopActionByTag\n * @param {int}\n */\nstopActionByTag : function () {},\n\n/**\n * @method reorderChild\n * @param {cocos2d::Node*}\n * @param {int}\n */\nreorderChild : function () {},\n\n/**\n * @method ignoreAnchorPointForPosition\n * @param {bool}\n */\nignoreAnchorPointForPosition : function () {},\n\n/**\n * @method setColor\n * @param {const cocos2d::Color3B&}\n */\nsetColor : function () {},\n\n/**\n * @method setPositionY\n * @param {float}\n */\nsetPositionY : function () {},\n\n/**\n * @method setPositionX\n * @param {float}\n */\nsetPositionX : function () {},\n\n/**\n * @method setNodeToParentTransform\n * @param {const kmMat4&}\n */\nsetNodeToParentTransform : function () {},\n\n/**\n * @method getAnchorPoint\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetAnchorPoint : function () {},\n\n/**\n * @method getNumberOfRunningActions\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetNumberOfRunningActions : function () {},\n\n/**\n * @method updateTransform\n */\nupdateTransform : function () {},\n\n/**\n * @method isVisible\n * @return A value converted from C/C++ \"bool\"\n */\nisVisible : function () {},\n\n/**\n * @method getChildrenCount\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetChildrenCount : function () {},\n\n/**\n * @method convertToNodeSpaceAR\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToNodeSpaceAR : function () {},\n\n/**\n * @method addComponent\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Component*}\n */\naddComponent : function () {},\n\n/**\n * @method visit\n */\nvisit : function () {},\n\n/**\n * @method setShaderProgram\n * @param {cocos2d::GLProgram*}\n */\nsetShaderProgram : function () {},\n\n/**\n * @method getRotation\n * @return A value converted from C/C++ \"float\"\n */\ngetRotation : function () {},\n\n/**\n * @method getLocalZOrder\n * @return A value converted from C/C++ \"int\"\n */\ngetLocalZOrder : function () {},\n\n/**\n * @method getAnchorPointInPoints\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetAnchorPointInPoints : function () {},\n\n/**\n * @method runAction\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n * @param {cocos2d::Action*}\n */\nrunAction : function () {},\n\n/**\n * @method transform\n */\ntransform : function () {},\n\n/**\n * @method setVertexZ\n * @param {float}\n */\nsetVertexZ : function () {},\n\n/**\n * @method setScheduler\n * @param {cocos2d::Scheduler*}\n */\nsetScheduler : function () {},\n\n/**\n * @method stopAllActions\n */\nstopAllActions : function () {},\n\n/**\n * @method getSkewX\n * @return A value converted from C/C++ \"float\"\n */\ngetSkewX : function () {},\n\n/**\n * @method getSkewY\n * @return A value converted from C/C++ \"float\"\n */\ngetSkewY : function () {},\n\n/**\n * @method getDisplayedColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetDisplayedColor : function () {},\n\n/**\n * @method getActionByTag\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n * @param {int}\n */\ngetActionByTag : function () {},\n\n/**\n * @method setRotationX\n * @param {float}\n */\nsetRotationX : function () {},\n\n/**\n * @method setRotationY\n * @param {float}\n */\nsetRotationY : function () {},\n\n/**\n * @method getDisplayedOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetDisplayedOpacity : function () {},\n\n/**\n * @method getParentToNodeAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetParentToNodeAffineTransform : function () {},\n\n/**\n * @method getOrderOfArrival\n * @return A value converted from C/C++ \"int\"\n */\ngetOrderOfArrival : function () {},\n\n/**\n * @method setActionManager\n * @param {cocos2d::ActionManager*}\n */\nsetActionManager : function () {},\n\n/**\n * @method isRunning\n * @return A value converted from C/C++ \"bool\"\n */\nisRunning : function () {},\n\n/**\n * @method getPositionY\n * @return A value converted from C/C++ \"float\"\n */\ngetPositionY : function () {},\n\n/**\n * @method getPositionX\n * @return A value converted from C/C++ \"float\"\n */\ngetPositionX : function () {},\n\n/**\n * @method removeChildByTag\n * @param {int}\n * @param {bool}\n */\nremoveChildByTag : function () {},\n\n/**\n * @method updateDisplayedColor\n * @param {const cocos2d::Color3B&}\n */\nupdateDisplayedColor : function () {},\n\n/**\n * @method setVisible\n * @param {bool}\n */\nsetVisible : function () {},\n\n/**\n * @method getParentToNodeTransform\n * @return A value converted from C/C++ \"const kmMat4&\"\n */\ngetParentToNodeTransform : function () {},\n\n/**\n * @method getVertexZ\n * @return A value converted from C/C++ \"float\"\n */\ngetVertexZ : function () {},\n\n/**\n * @method setGlobalZOrder\n * @param {float}\n */\nsetGlobalZOrder : function () {},\n\n/**\n * @method getChildByTag\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {int}\n */\ngetChildByTag : function () {},\n\n/**\n * @method setOrderOfArrival\n * @param {int}\n */\nsetOrderOfArrival : function () {},\n\n/**\n * @method getScaleY\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleY : function () {},\n\n/**\n * @method getScaleX\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleX : function () {},\n\n/**\n * @method getWorldToNodeAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetWorldToNodeAffineTransform : function () {},\n\n/**\n * @method setCascadeColorEnabled\n * @param {bool}\n */\nsetCascadeColorEnabled : function () {},\n\n/**\n * @method setOpacity\n * @param {GLubyte}\n */\nsetOpacity : function () {},\n\n/**\n * @method cleanup\n */\ncleanup : function () {},\n\n/**\n * @method getComponent\n * @return A value converted from C/C++ \"cocos2d::Component*\"\n * @param {const std::string&}\n */\ngetComponent : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetContentSize : function () {},\n\n/**\n * @method getBoundingBox\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\ngetBoundingBox : function () {},\n\n/**\n * @method updatePhysicsTransform\n * @return A value converted from C/C++ \"bool\"\n */\nupdatePhysicsTransform : function () {},\n\n/**\n * @method setEventDispatcher\n * @param {cocos2d::EventDispatcher*}\n */\nsetEventDispatcher : function () {},\n\n/**\n * @method getGlobalZOrder\n * @return A value converted from C/C++ \"float\"\n */\ngetGlobalZOrder : function () {},\n\n/**\n * @method draw\n */\ndraw : function () {},\n\n/**\n * @method transformAncestors\n */\ntransformAncestors : function () {},\n\n/**\n * @method setUserObject\n * @param {cocos2d::Object*}\n */\nsetUserObject : function () {},\n\n/**\n * @method convertTouchToNodeSpaceAR\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nconvertTouchToNodeSpaceAR : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method sortAllChildren\n */\nsortAllChildren : function () {},\n\n/**\n * @method getWorldToNodeTransform\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetWorldToNodeTransform : function () {},\n\n/**\n * @method getScale\n * @return A value converted from C/C++ \"float\"\n */\ngetScale : function () {},\n\n/**\n * @method convertToNodeSpace\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToNodeSpace : function () {},\n\n/**\n * @method setTag\n * @param {int}\n */\nsetTag : function () {},\n\n/**\n * @method isCascadeColorEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisCascadeColorEnabled : function () {},\n\n/**\n * @method isOpacityModifyRGB\n * @return A value converted from C/C++ \"bool\"\n */\nisOpacityModifyRGB : function () {},\n\n/**\n * @method stopAction\n * @param {cocos2d::Action*}\n */\nstopAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class __NodeRGBA\n */\ncc.NodeRGBA = {\n\n};\n\n/**\n * @class SpriteFrame\n */\ncc.SpriteFrame = {\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n */\nclone : function () {},\n\n/**\n * @method setRotated\n * @param {bool}\n */\nsetRotated : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method setRectInPixels\n * @param {const cocos2d::Rect&}\n */\nsetRectInPixels : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method getRect\n * @return A value converted from C/C++ \"const cocos2d::Rect&\"\n */\ngetRect : function () {},\n\n/**\n * @method setOffsetInPixels\n * @param {const cocos2d::Point&}\n */\nsetOffsetInPixels : function () {},\n\n/**\n * @method getRectInPixels\n * @return A value converted from C/C++ \"const cocos2d::Rect&\"\n */\ngetRectInPixels : function () {},\n\n/**\n * @method setOriginalSize\n * @param {const cocos2d::Size&}\n */\nsetOriginalSize : function () {},\n\n/**\n * @method getOriginalSizeInPixels\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetOriginalSizeInPixels : function () {},\n\n/**\n * @method setOriginalSizeInPixels\n * @param {const cocos2d::Size&}\n */\nsetOriginalSizeInPixels : function () {},\n\n/**\n * @method setOffset\n * @param {const cocos2d::Point&}\n */\nsetOffset : function () {},\n\n/**\n * @method getOffset\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetOffset : function () {},\n\n/**\n * @method isRotated\n * @return A value converted from C/C++ \"bool\"\n */\nisRotated : function () {},\n\n/**\n * @method setRect\n * @param {const cocos2d::Rect&}\n */\nsetRect : function () {},\n\n/**\n * @method getOffsetInPixels\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetOffsetInPixels : function () {},\n\n/**\n * @method getOriginalSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetOriginalSize : function () {},\n\n};\n\n/**\n * @class AnimationFrame\n */\ncc.AnimationFrame = {\n\n/**\n * @method setSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetSpriteFrame : function () {},\n\n/**\n * @method setDelayUnits\n * @param {float}\n */\nsetDelayUnits : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::AnimationFrame*\"\n */\nclone : function () {},\n\n/**\n * @method getSpriteFrame\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n */\ngetSpriteFrame : function () {},\n\n/**\n * @method getDelayUnits\n * @return A value converted from C/C++ \"float\"\n */\ngetDelayUnits : function () {},\n\n/**\n * @method setUserInfo\n * @param {const cocos2d::ValueMap&}\n */\nsetUserInfo : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::AnimationFrame*\"\n * @param {cocos2d::SpriteFrame*}\n * @param {float}\n * @param {const cocos2d::ValueMap&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Animation\n */\ncc.Animation = {\n\n/**\n * @method getLoops\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetLoops : function () {},\n\n/**\n * @method addSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\naddSpriteFrame : function () {},\n\n/**\n * @method setRestoreOriginalFrame\n * @param {bool}\n */\nsetRestoreOriginalFrame : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::Animation*\"\n */\nclone : function () {},\n\n/**\n * @method getDuration\n * @return A value converted from C/C++ \"float\"\n */\ngetDuration : function () {},\n\n/**\n * @method setFrames\n * @param {const cocos2d::Vector<cocos2d::AnimationFrame *>&}\n */\nsetFrames : function () {},\n\n/**\n * @method getFrames\n * @return A value converted from C/C++ \"const cocos2d::Vector<cocos2d::AnimationFrame *>&\"\n */\ngetFrames : function () {},\n\n/**\n * @method setLoops\n * @param {unsigned int}\n */\nsetLoops : function () {},\n\n/**\n * @method setDelayPerUnit\n * @param {float}\n */\nsetDelayPerUnit : function () {},\n\n/**\n * @method addSpriteFrameWithFile\n * @param {const std::string&}\n */\naddSpriteFrameWithFile : function () {},\n\n/**\n * @method getTotalDelayUnits\n * @return A value converted from C/C++ \"float\"\n */\ngetTotalDelayUnits : function () {},\n\n/**\n * @method getDelayPerUnit\n * @return A value converted from C/C++ \"float\"\n */\ngetDelayPerUnit : function () {},\n\n/**\n * @method getRestoreOriginalFrame\n * @return A value converted from C/C++ \"bool\"\n */\ngetRestoreOriginalFrame : function () {},\n\n/**\n * @method addSpriteFrameWithTexture\n * @param {cocos2d::Texture2D*}\n * @param {const cocos2d::Rect&}\n */\naddSpriteFrameWithTexture : function () {},\n\n};\n\n/**\n * @class ActionInterval\n */\ncc.ActionInterval = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getElapsed\n * @return A value converted from C/C++ \"float\"\n */\ngetElapsed : function () {},\n\n};\n\n/**\n * @class Sequence\n */\ncc.Sequence = {\n\n};\n\n/**\n * @class Repeat\n */\ncc.Repeat = {\n\n/**\n * @method setInnerAction\n * @param {cocos2d::FiniteTimeAction*}\n */\nsetInnerAction : function () {},\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::FiniteTimeAction*\"\n */\ngetInnerAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Repeat*\"\n * @param {cocos2d::FiniteTimeAction*}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class RepeatForever\n */\ncc.RepeatForever = {\n\n/**\n * @method setInnerAction\n * @param {cocos2d::ActionInterval*}\n */\nsetInnerAction : function () {},\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\ngetInnerAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::RepeatForever*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Spawn\n */\ncc.Spawn = {\n\n};\n\n/**\n * @class RotateTo\n */\ncc.RotateTo = {\n\n};\n\n/**\n * @class RotateBy\n */\ncc.RotateBy = {\n\n};\n\n/**\n * @class MoveBy\n */\ncc.MoveBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::MoveBy*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class MoveTo\n */\ncc.MoveTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::MoveTo*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SkewTo\n */\ncc.SkewTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SkewTo*\"\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SkewBy\n */\ncc.SkewBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SkewBy*\"\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class JumpBy\n */\ncc.JumpBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::JumpBy*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class JumpTo\n */\ncc.JumpTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::JumpTo*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class BezierBy\n */\ncc.BezierBy = {\n\n};\n\n/**\n * @class BezierTo\n */\ncc.BezierTo = {\n\n};\n\n/**\n * @class ScaleTo\n */\ncc.ScaleTo = {\n\n};\n\n/**\n * @class ScaleBy\n */\ncc.ScaleBy = {\n\n};\n\n/**\n * @class Blink\n */\ncc.Blink = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Blink*\"\n * @param {float}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeIn\n */\ncc.FadeIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeIn*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOut\n */\ncc.FadeOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOut*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeTo\n */\ncc.FadeTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeTo*\"\n * @param {float}\n * @param {GLubyte}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TintTo\n */\ncc.TintTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TintTo*\"\n * @param {float}\n * @param {GLubyte}\n * @param {GLubyte}\n * @param {GLubyte}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TintBy\n */\ncc.TintBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TintBy*\"\n * @param {float}\n * @param {GLshort}\n * @param {GLshort}\n * @param {GLshort}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class DelayTime\n */\ncc.DelayTime = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::DelayTime*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Animate\n */\ncc.Animate = {\n\n/**\n * @method setAnimation\n * @param {cocos2d::Animation*}\n */\nsetAnimation : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Animate*\"\n * @param {cocos2d::Animation*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TargetedAction\n */\ncc.TargetedAction = {\n\n/**\n * @method setForcedTarget\n * @param {cocos2d::Node*}\n */\nsetForcedTarget : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TargetedAction*\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::FiniteTimeAction*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ActionCamera\n */\ncc.ActionCamera = {\n\n/**\n * @method getEye\n * @return A value converted from C/C++ \"const kmVec3&\"\n */\ngetEye : function () {},\n\n/**\n * @method setUp\n * @param {const kmVec3&}\n */\nsetUp : function () {},\n\n/**\n * @method getCenter\n * @return A value converted from C/C++ \"const kmVec3&\"\n */\ngetCenter : function () {},\n\n/**\n * @method setCenter\n * @param {const kmVec3&}\n */\nsetCenter : function () {},\n\n/**\n * @method getUp\n * @return A value converted from C/C++ \"const kmVec3&\"\n */\ngetUp : function () {},\n\n/**\n * @method ActionCamera\n * @constructor\n */\nActionCamera : function () {},\n\n};\n\n/**\n * @class OrbitCamera\n */\ncc.OrbitCamera = {\n\n/**\n * @method sphericalRadius\n * @param {float*}\n * @param {float*}\n * @param {float*}\n */\nsphericalRadius : function () {},\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\ninitWithDuration : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::OrbitCamera*\"\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method OrbitCamera\n * @constructor\n */\nOrbitCamera : function () {},\n\n};\n\n/**\n * @class ActionManager\n */\ncc.ActionManager = {\n\n/**\n * @method getActionByTag\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n * @param {int}\n * @param {const cocos2d::Node*}\n */\ngetActionByTag : function () {},\n\n/**\n * @method removeActionByTag\n * @param {int}\n * @param {cocos2d::Node*}\n */\nremoveActionByTag : function () {},\n\n/**\n * @method removeAllActions\n */\nremoveAllActions : function () {},\n\n/**\n * @method addAction\n * @param {cocos2d::Action*}\n * @param {cocos2d::Node*}\n * @param {bool}\n */\naddAction : function () {},\n\n/**\n * @method resumeTarget\n * @param {cocos2d::Node*}\n */\nresumeTarget : function () {},\n\n/**\n * @method getNumberOfRunningActionsInTarget\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {const cocos2d::Node*}\n */\ngetNumberOfRunningActionsInTarget : function () {},\n\n/**\n * @method removeAllActionsFromTarget\n * @param {cocos2d::Node*}\n */\nremoveAllActionsFromTarget : function () {},\n\n/**\n * @method resumeTargets\n * @param {const cocos2d::Vector<cocos2d::Node *>&}\n */\nresumeTargets : function () {},\n\n/**\n * @method removeAction\n * @param {cocos2d::Action*}\n */\nremoveAction : function () {},\n\n/**\n * @method pauseTarget\n * @param {cocos2d::Node*}\n */\npauseTarget : function () {},\n\n/**\n * @method pauseAllRunningActions\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>\"\n */\npauseAllRunningActions : function () {},\n\n/**\n * @method ActionManager\n * @constructor\n */\nActionManager : function () {},\n\n};\n\n/**\n * @class ActionEase\n */\ncc.ActionEase = {\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\ngetInnerAction : function () {},\n\n};\n\n/**\n * @class EaseRateAction\n */\ncc.EaseRateAction = {\n\n/**\n * @method setRate\n * @param {float}\n */\nsetRate : function () {},\n\n/**\n * @method getRate\n * @return A value converted from C/C++ \"float\"\n */\ngetRate : function () {},\n\n};\n\n/**\n * @class EaseIn\n */\ncc.EaseIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseIn*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseOut\n */\ncc.EaseOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseOut*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseInOut\n */\ncc.EaseInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseInOut*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseExponentialIn\n */\ncc.EaseExponentialIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseExponentialIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseExponentialOut\n */\ncc.EaseExponentialOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseExponentialOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseExponentialInOut\n */\ncc.EaseExponentialInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseExponentialInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseSineIn\n */\ncc.EaseSineIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseSineIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseSineOut\n */\ncc.EaseSineOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseSineOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseSineInOut\n */\ncc.EaseSineInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseSineInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseElastic\n */\ncc.EaseElastic = {\n\n/**\n * @method setPeriod\n * @param {float}\n */\nsetPeriod : function () {},\n\n/**\n * @method getPeriod\n * @return A value converted from C/C++ \"float\"\n */\ngetPeriod : function () {},\n\n};\n\n/**\n * @class EaseElasticIn\n */\ncc.EaseElasticIn = {\n\n};\n\n/**\n * @class EaseElasticOut\n */\ncc.EaseElasticOut = {\n\n};\n\n/**\n * @class EaseElasticInOut\n */\ncc.EaseElasticInOut = {\n\n};\n\n/**\n * @class EaseBounce\n */\ncc.EaseBounce = {\n\n/**\n * @method bounceTime\n * @return A value converted from C/C++ \"float\"\n * @param {float}\n */\nbounceTime : function () {},\n\n};\n\n/**\n * @class EaseBounceIn\n */\ncc.EaseBounceIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBounceIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBounceOut\n */\ncc.EaseBounceOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBounceOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBounceInOut\n */\ncc.EaseBounceInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBounceInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBackIn\n */\ncc.EaseBackIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBackIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBackOut\n */\ncc.EaseBackOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBackOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBackInOut\n */\ncc.EaseBackInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBackInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ActionInstant\n */\ncc.ActionInstant = {\n\n};\n\n/**\n * @class Show\n */\ncc.Show = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Show*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Hide\n */\ncc.Hide = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Hide*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ToggleVisibility\n */\ncc.ToggleVisibility = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ToggleVisibility*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class RemoveSelf\n */\ncc.RemoveSelf = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::RemoveSelf*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipX\n */\ncc.FlipX = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipX*\"\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipY\n */\ncc.FlipY = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipY*\"\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Place\n */\ncc.Place = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Place*\"\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class CallFunc\n */\ncc.CallFunc = {\n\n/**\n * @method execute\n */\nexecute : function () {},\n\n/**\n * @method getTargetCallback\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ngetTargetCallback : function () {},\n\n/**\n * @method setTargetCallback\n * @param {cocos2d::Object*}\n */\nsetTargetCallback : function () {},\n\n};\n\n/**\n * @class GridAction\n */\ncc.GridAction = {\n\n/**\n * @method getGrid\n * @return A value converted from C/C++ \"cocos2d::GridBase*\"\n */\ngetGrid : function () {},\n\n};\n\n/**\n * @class Grid3DAction\n */\ncc.Grid3DAction = {\n\n/**\n * @method getGrid\n * @return A value converted from C/C++ \"cocos2d::GridBase*\"\n */\ngetGrid : function () {},\n\n};\n\n/**\n * @class TiledGrid3DAction\n */\ncc.TiledGrid3DAction = {\n\n/**\n * @method getGrid\n * @return A value converted from C/C++ \"cocos2d::GridBase*\"\n */\ngetGrid : function () {},\n\n};\n\n/**\n * @class StopGrid\n */\ncc.StopGrid = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::StopGrid*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ReuseGrid\n */\ncc.ReuseGrid = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ReuseGrid*\"\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Waves3D\n */\ncc.Waves3D = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Waves3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipX3D\n */\ncc.FlipX3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipX3D*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipY3D\n */\ncc.FlipY3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipY3D*\"\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method FlipY3D\n * @constructor\n */\nFlipY3D : function () {},\n\n};\n\n/**\n * @class Lens3D\n */\ncc.Lens3D = {\n\n/**\n * @method setPosition\n * @param {const cocos2d::Point&}\n */\nsetPosition : function () {},\n\n/**\n * @method setConcave\n * @param {bool}\n */\nsetConcave : function () {},\n\n/**\n * @method setLensEffect\n * @param {float}\n */\nsetLensEffect : function () {},\n\n/**\n * @method getPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosition : function () {},\n\n/**\n * @method getLensEffect\n * @return A value converted from C/C++ \"float\"\n */\ngetLensEffect : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Lens3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::Point&}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Ripple3D\n */\ncc.Ripple3D = {\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setPosition\n * @param {const cocos2d::Point&}\n */\nsetPosition : function () {},\n\n/**\n * @method getPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosition : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Ripple3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Shaky3D\n */\ncc.Shaky3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Shaky3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {int}\n * @param {bool}\n */\ncreate : function () {},\n\n/**\n * @method Shaky3D\n * @constructor\n */\nShaky3D : function () {},\n\n};\n\n/**\n * @class Liquid\n */\ncc.Liquid = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Liquid*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method Liquid\n * @constructor\n */\nLiquid : function () {},\n\n};\n\n/**\n * @class Waves\n */\ncc.Waves = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Waves*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n * @param {bool}\n * @param {bool}\n */\ncreate : function () {},\n\n/**\n * @method Waves\n * @constructor\n */\nWaves : function () {},\n\n};\n\n/**\n * @class Twirl\n */\ncc.Twirl = {\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setPosition\n * @param {const cocos2d::Point&}\n */\nsetPosition : function () {},\n\n/**\n * @method getPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosition : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Twirl*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {cocos2d::Point}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method Twirl\n * @constructor\n */\nTwirl : function () {},\n\n};\n\n/**\n * @class PageTurn3D\n */\ncc.PageTurn3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PageTurn3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ProgressTo\n */\ncc.ProgressTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ProgressTo*\"\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ProgressFromTo\n */\ncc.ProgressFromTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ProgressFromTo*\"\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ShakyTiles3D\n */\ncc.ShakyTiles3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ShakyTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {int}\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ShatteredTiles3D\n */\ncc.ShatteredTiles3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ShatteredTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {int}\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ShuffleTiles\n */\ncc.ShuffleTiles = {\n\n/**\n * @method placeTile\n * @param {const cocos2d::Point&}\n * @param {cocos2d::Tile*}\n */\nplaceTile : function () {},\n\n/**\n * @method shuffle\n * @param {unsigned int*}\n * @param {unsigned int}\n */\nshuffle : function () {},\n\n/**\n * @method getDelta\n * @return A value converted from C/C++ \"cocos2d::Size\"\n * @param {const cocos2d::Size&}\n */\ngetDelta : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ShuffleTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutTRTiles\n */\ncc.FadeOutTRTiles = {\n\n/**\n * @method turnOnTile\n * @param {const cocos2d::Point&}\n */\nturnOnTile : function () {},\n\n/**\n * @method turnOffTile\n * @param {const cocos2d::Point&}\n */\nturnOffTile : function () {},\n\n/**\n * @method transformTile\n * @param {const cocos2d::Point&}\n * @param {float}\n */\ntransformTile : function () {},\n\n/**\n * @method testFunc\n * @return A value converted from C/C++ \"float\"\n * @param {const cocos2d::Size&}\n * @param {float}\n */\ntestFunc : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutTRTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutBLTiles\n */\ncc.FadeOutBLTiles = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutBLTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutUpTiles\n */\ncc.FadeOutUpTiles = {\n\n/**\n * @method transformTile\n * @param {const cocos2d::Point&}\n * @param {float}\n */\ntransformTile : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutUpTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutDownTiles\n */\ncc.FadeOutDownTiles = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutDownTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TurnOffTiles\n */\ncc.TurnOffTiles = {\n\n/**\n * @method turnOnTile\n * @param {const cocos2d::Point&}\n */\nturnOnTile : function () {},\n\n/**\n * @method turnOffTile\n * @param {const cocos2d::Point&}\n */\nturnOffTile : function () {},\n\n/**\n * @method shuffle\n * @param {unsigned int*}\n * @param {unsigned int}\n */\nshuffle : function () {},\n\n};\n\n/**\n * @class WavesTiles3D\n */\ncc.WavesTiles3D = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::WavesTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class JumpTiles3D\n */\ncc.JumpTiles3D = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::JumpTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SplitRows\n */\ncc.SplitRows = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SplitRows*\"\n * @param {float}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SplitCols\n */\ncc.SplitCols = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SplitCols*\"\n * @param {float}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ActionTween\n */\ncc.ActionTween = {\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {const std::string&}\n * @param {float}\n * @param {float}\n */\ninitWithDuration : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ActionTween*\"\n * @param {float}\n * @param {const std::string&}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class CardinalSplineTo\n */\ncc.CardinalSplineTo = {\n\n/**\n * @method getPoints\n * @return A value converted from C/C++ \"cocos2d::PointArray*\"\n */\ngetPoints : function () {},\n\n/**\n * @method updatePosition\n * @param {cocos2d::Point&}\n */\nupdatePosition : function () {},\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::PointArray*}\n * @param {float}\n */\ninitWithDuration : function () {},\n\n/**\n * @method CardinalSplineTo\n * @constructor\n */\nCardinalSplineTo : function () {},\n\n};\n\n/**\n * @class CardinalSplineBy\n */\ncc.CardinalSplineBy = {\n\n/**\n * @method CardinalSplineBy\n * @constructor\n */\nCardinalSplineBy : function () {},\n\n};\n\n/**\n * @class CatmullRomTo\n */\ncc.CatmullRomTo = {\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::PointArray*}\n */\ninitWithDuration : function () {},\n\n};\n\n/**\n * @class CatmullRomBy\n */\ncc.CatmullRomBy = {\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::PointArray*}\n */\ninitWithDuration : function () {},\n\n};\n\n/**\n * @class AtlasNode\n */\ncc.AtlasNode = {\n\n/**\n * @method updateAtlasValues\n */\nupdateAtlasValues : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method getQuadsToDraw\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetQuadsToDraw : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method setQuadsToDraw\n * @param {ssize_t}\n */\nsetQuadsToDraw : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::AtlasNode*\"\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class DrawNode\n */\ncc.DrawNode = {\n\n/**\n * @method drawQuadraticBezier\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {unsigned int}\n * @param {const cocos2d::Color4F&}\n */\ndrawQuadraticBezier : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method clear\n */\nclear : function () {},\n\n/**\n * @method drawTriangle\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Color4F&}\n */\ndrawTriangle : function () {},\n\n/**\n * @method drawDot\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {const cocos2d::Color4F&}\n */\ndrawDot : function () {},\n\n/**\n * @method drawCubicBezier\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {unsigned int}\n * @param {const cocos2d::Color4F&}\n */\ndrawCubicBezier : function () {},\n\n/**\n * @method drawSegment\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {const cocos2d::Color4F&}\n */\ndrawSegment : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::DrawNode*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class LabelAtlas\n */\ncc.LabelAtlas = {\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method updateAtlasValues\n */\nupdateAtlasValues : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n};\n\n/**\n * @class Director\n */\ncc.Director = {\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method setContentScaleFactor\n * @param {float}\n */\nsetContentScaleFactor : function () {},\n\n/**\n * @method getContentScaleFactor\n * @return A value converted from C/C++ \"float\"\n */\ngetContentScaleFactor : function () {},\n\n/**\n * @method getWinSizeInPixels\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetWinSizeInPixels : function () {},\n\n/**\n * @method getDeltaTime\n * @return A value converted from C/C++ \"float\"\n */\ngetDeltaTime : function () {},\n\n/**\n * @method setGLDefaultValues\n */\nsetGLDefaultValues : function () {},\n\n/**\n * @method setActionManager\n * @param {cocos2d::ActionManager*}\n */\nsetActionManager : function () {},\n\n/**\n * @method setAlphaBlending\n * @param {bool}\n */\nsetAlphaBlending : function () {},\n\n/**\n * @method popToRootScene\n */\npopToRootScene : function () {},\n\n/**\n * @method getNotificationNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetNotificationNode : function () {},\n\n/**\n * @method getWinSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetWinSize : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method getTextureCache\n * @return A value converted from C/C++ \"cocos2d::TextureCache*\"\n */\ngetTextureCache : function () {},\n\n/**\n * @method isSendCleanupToScene\n * @return A value converted from C/C++ \"bool\"\n */\nisSendCleanupToScene : function () {},\n\n/**\n * @method getVisibleOrigin\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetVisibleOrigin : function () {},\n\n/**\n * @method mainLoop\n */\nmainLoop : function () {},\n\n/**\n * @method setDepthTest\n * @param {bool}\n */\nsetDepthTest : function () {},\n\n/**\n * @method getFrameRate\n * @return A value converted from C/C++ \"float\"\n */\ngetFrameRate : function () {},\n\n/**\n * @method getSecondsPerFrame\n * @return A value converted from C/C++ \"float\"\n */\ngetSecondsPerFrame : function () {},\n\n/**\n * @method convertToUI\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToUI : function () {},\n\n/**\n * @method setDefaultValues\n */\nsetDefaultValues : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setScheduler\n * @param {cocos2d::Scheduler*}\n */\nsetScheduler : function () {},\n\n/**\n * @method startAnimation\n */\nstartAnimation : function () {},\n\n/**\n * @method getRunningScene\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ngetRunningScene : function () {},\n\n/**\n * @method setViewport\n */\nsetViewport : function () {},\n\n/**\n * @method stopAnimation\n */\nstopAnimation : function () {},\n\n/**\n * @method popToSceneStackLevel\n * @param {int}\n */\npopToSceneStackLevel : function () {},\n\n/**\n * @method resume\n */\nresume : function () {},\n\n/**\n * @method isNextDeltaTimeZero\n * @return A value converted from C/C++ \"bool\"\n */\nisNextDeltaTimeZero : function () {},\n\n/**\n * @method setOpenGLView\n * @param {cocos2d::EGLView*}\n */\nsetOpenGLView : function () {},\n\n/**\n * @method convertToGL\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToGL : function () {},\n\n/**\n * @method purgeCachedData\n */\npurgeCachedData : function () {},\n\n/**\n * @method getTotalFrames\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetTotalFrames : function () {},\n\n/**\n * @method runWithScene\n * @param {cocos2d::Scene*}\n */\nrunWithScene : function () {},\n\n/**\n * @method setNotificationNode\n * @param {cocos2d::Node*}\n */\nsetNotificationNode : function () {},\n\n/**\n * @method drawScene\n */\ndrawScene : function () {},\n\n/**\n * @method popScene\n */\npopScene : function () {},\n\n/**\n * @method isDisplayStats\n * @return A value converted from C/C++ \"bool\"\n */\nisDisplayStats : function () {},\n\n/**\n * @method setProjection\n * @param {cocos2d::Director::Projection}\n */\nsetProjection : function () {},\n\n/**\n * @method getConsole\n * @return A value converted from C/C++ \"cocos2d::Console*\"\n */\ngetConsole : function () {},\n\n/**\n * @method getZEye\n * @return A value converted from C/C++ \"float\"\n */\ngetZEye : function () {},\n\n/**\n * @method setNextDeltaTimeZero\n * @param {bool}\n */\nsetNextDeltaTimeZero : function () {},\n\n/**\n * @method getVisibleSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetVisibleSize : function () {},\n\n/**\n * @method getScheduler\n * @return A value converted from C/C++ \"cocos2d::Scheduler*\"\n */\ngetScheduler : function () {},\n\n/**\n * @method pushScene\n * @param {cocos2d::Scene*}\n */\npushScene : function () {},\n\n/**\n * @method getAnimationInterval\n * @return A value converted from C/C++ \"double\"\n */\ngetAnimationInterval : function () {},\n\n/**\n * @method isPaused\n * @return A value converted from C/C++ \"bool\"\n */\nisPaused : function () {},\n\n/**\n * @method setDisplayStats\n * @param {bool}\n */\nsetDisplayStats : function () {},\n\n/**\n * @method replaceScene\n * @param {cocos2d::Scene*}\n */\nreplaceScene : function () {},\n\n/**\n * @method setAnimationInterval\n * @param {double}\n */\nsetAnimationInterval : function () {},\n\n/**\n * @method getActionManager\n * @return A value converted from C/C++ \"cocos2d::ActionManager*\"\n */\ngetActionManager : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::Director*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class GridBase\n */\ncc.GridBase = {\n\n/**\n * @method setGridSize\n * @param {const cocos2d::Size&}\n */\nsetGridSize : function () {},\n\n/**\n * @method calculateVertexPoints\n */\ncalculateVertexPoints : function () {},\n\n/**\n * @method afterDraw\n * @param {cocos2d::Node*}\n */\nafterDraw : function () {},\n\n/**\n * @method beforeDraw\n */\nbeforeDraw : function () {},\n\n/**\n * @method isTextureFlipped\n * @return A value converted from C/C++ \"bool\"\n */\nisTextureFlipped : function () {},\n\n/**\n * @method getGridSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetGridSize : function () {},\n\n/**\n * @method getStep\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetStep : function () {},\n\n/**\n * @method set2DProjection\n */\nset2DProjection : function () {},\n\n/**\n * @method setStep\n * @param {const cocos2d::Point&}\n */\nsetStep : function () {},\n\n/**\n * @method setTextureFlipped\n * @param {bool}\n */\nsetTextureFlipped : function () {},\n\n/**\n * @method blit\n */\nblit : function () {},\n\n/**\n * @method setActive\n * @param {bool}\n */\nsetActive : function () {},\n\n/**\n * @method getReuseGrid\n * @return A value converted from C/C++ \"int\"\n */\ngetReuseGrid : function () {},\n\n/**\n * @method setReuseGrid\n * @param {int}\n */\nsetReuseGrid : function () {},\n\n/**\n * @method isActive\n * @return A value converted from C/C++ \"bool\"\n */\nisActive : function () {},\n\n/**\n * @method reuse\n */\nreuse : function () {},\n\n};\n\n/**\n * @class Grid3D\n */\ncc.Grid3D = {\n\n/**\n * @method Grid3D\n * @constructor\n */\nGrid3D : function () {},\n\n};\n\n/**\n * @class TiledGrid3D\n */\ncc.TiledGrid3D = {\n\n/**\n * @method TiledGrid3D\n * @constructor\n */\nTiledGrid3D : function () {},\n\n};\n\n/**\n * @class Sprite\n */\ncc.Sprite = {\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method setFlippedY\n * @param {bool}\n */\nsetFlippedY : function () {},\n\n/**\n * @method setFlippedX\n * @param {bool}\n */\nsetFlippedX : function () {},\n\n/**\n * @method getBatchNode\n * @return A value converted from C/C++ \"cocos2d::SpriteBatchNode*\"\n */\ngetBatchNode : function () {},\n\n/**\n * @method getOffsetPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetOffsetPosition : function () {},\n\n/**\n * @method removeAllChildrenWithCleanup\n * @param {bool}\n */\nremoveAllChildrenWithCleanup : function () {},\n\n/**\n * @method updateQuadVertices\n */\nupdateQuadVertices : function () {},\n\n/**\n * @method updateTransform\n */\nupdateTransform : function () {},\n\n/**\n * @method isFrameDisplayed\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::SpriteFrame*}\n */\nisFrameDisplayed : function () {},\n\n/**\n * @method getAtlasIndex\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetAtlasIndex : function () {},\n\n/**\n * @method setBatchNode\n * @param {cocos2d::SpriteBatchNode*}\n */\nsetBatchNode : function () {},\n\n/**\n * @method setDisplayFrameWithAnimationName\n * @param {const std::string&}\n * @param {ssize_t}\n */\nsetDisplayFrameWithAnimationName : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method getSpriteFrame\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n */\ngetSpriteFrame : function () {},\n\n/**\n * @method isDirty\n * @return A value converted from C/C++ \"bool\"\n */\nisDirty : function () {},\n\n/**\n * @method setAtlasIndex\n * @param {ssize_t}\n */\nsetAtlasIndex : function () {},\n\n/**\n * @method setDirty\n * @param {bool}\n */\nsetDirty : function () {},\n\n/**\n * @method isTextureRectRotated\n * @return A value converted from C/C++ \"bool\"\n */\nisTextureRectRotated : function () {},\n\n/**\n * @method getTextureRect\n * @return A value converted from C/C++ \"const cocos2d::Rect&\"\n */\ngetTextureRect : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method isFlippedX\n * @return A value converted from C/C++ \"bool\"\n */\nisFlippedX : function () {},\n\n/**\n * @method isFlippedY\n * @return A value converted from C/C++ \"bool\"\n */\nisFlippedY : function () {},\n\n/**\n * @method setVertexRect\n * @param {const cocos2d::Rect&}\n */\nsetVertexRect : function () {},\n\n/**\n * @method createWithSpriteFrameName\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {const std::string&}\n */\ncreateWithSpriteFrameName : function () {},\n\n/**\n * @method createWithSpriteFrame\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {cocos2d::SpriteFrame*}\n */\ncreateWithSpriteFrame : function () {},\n\n};\n\n/**\n * @class LabelTTF\n */\ncc.LabelTTF = {\n\n/**\n * @method enableShadow\n * @param {const cocos2d::Size&}\n * @param {float}\n * @param {float}\n * @param {bool}\n */\nenableShadow : function () {},\n\n/**\n * @method setDimensions\n * @param {const cocos2d::Size&}\n */\nsetDimensions : function () {},\n\n/**\n * @method getFontSize\n * @return A value converted from C/C++ \"float\"\n */\ngetFontSize : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n/**\n * @method setTextDefinition\n * @param {const cocos2d::FontDefinition&}\n */\nsetTextDefinition : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method getHorizontalAlignment\n * @return A value converted from C/C++ \"cocos2d::TextHAlignment\"\n */\ngetHorizontalAlignment : function () {},\n\n/**\n * @method initWithStringAndTextDefinition\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {cocos2d::FontDefinition&}\n */\ninitWithStringAndTextDefinition : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setFontFillColor\n * @param {const cocos2d::Color3B&}\n * @param {bool}\n */\nsetFontFillColor : function () {},\n\n/**\n * @method enableStroke\n * @param {const cocos2d::Color3B&}\n * @param {float}\n * @param {bool}\n */\nenableStroke : function () {},\n\n/**\n * @method getDimensions\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetDimensions : function () {},\n\n/**\n * @method setVerticalAlignment\n * @param {cocos2d::TextVAlignment}\n */\nsetVerticalAlignment : function () {},\n\n/**\n * @method setFontSize\n * @param {float}\n */\nsetFontSize : function () {},\n\n/**\n * @method getVerticalAlignment\n * @return A value converted from C/C++ \"cocos2d::TextVAlignment\"\n */\ngetVerticalAlignment : function () {},\n\n/**\n * @method getTextDefinition\n * @return A value converted from C/C++ \"cocos2d::FontDefinition\"\n */\ngetTextDefinition : function () {},\n\n/**\n * @method getFontName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFontName : function () {},\n\n/**\n * @method setHorizontalAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetHorizontalAlignment : function () {},\n\n/**\n * @method disableShadow\n */\ndisableShadow : function () {},\n\n/**\n * @method disableStroke\n */\ndisableStroke : function () {},\n\n/**\n * @method createWithFontDefinition\n * @return A value converted from C/C++ \"cocos2d::LabelTTF*\"\n * @param {const std::string&}\n * @param {cocos2d::FontDefinition&}\n */\ncreateWithFontDefinition : function () {},\n\n/**\n * @method LabelTTF\n * @constructor\n */\nLabelTTF : function () {},\n\n};\n\n/**\n * @class SpriteBatchNode\n */\ncc.SpriteBatchNode = {\n\n/**\n * @method appendChild\n * @param {cocos2d::Sprite*}\n */\nappendChild : function () {},\n\n/**\n * @method reorderBatch\n * @param {bool}\n */\nreorderBatch : function () {},\n\n/**\n * @method initWithTexture\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Texture2D*}\n * @param {ssize_t}\n */\ninitWithTexture : function () {},\n\n/**\n * @method lowestAtlasIndexInChild\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n */\nlowestAtlasIndexInChild : function () {},\n\n/**\n * @method atlasIndexForChild\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n * @param {int}\n */\natlasIndexForChild : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method rebuildIndexInOrder\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n * @param {ssize_t}\n */\nrebuildIndexInOrder : function () {},\n\n/**\n * @method increaseAtlasCapacity\n */\nincreaseAtlasCapacity : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method highestAtlasIndexInChild\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n */\nhighestAtlasIndexInChild : function () {},\n\n/**\n * @method removeChildAtIndex\n * @param {ssize_t}\n * @param {bool}\n */\nremoveChildAtIndex : function () {},\n\n/**\n * @method removeSpriteFromAtlas\n * @param {cocos2d::Sprite*}\n */\nremoveSpriteFromAtlas : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SpriteBatchNode*\"\n * @param {const std::string&}\n * @param {ssize_t}\n */\ncreate : function () {},\n\n/**\n * @method createWithTexture\n * @return A value converted from C/C++ \"cocos2d::SpriteBatchNode*\"\n * @param {cocos2d::Texture2D*}\n * @param {ssize_t}\n */\ncreateWithTexture : function () {},\n\n/**\n * @method SpriteBatchNode\n * @constructor\n */\nSpriteBatchNode : function () {},\n\n};\n\n/**\n * @class LabelBMFont\n */\ncc.LabelBMFont = {\n\n/**\n * @method setLineBreakWithoutSpace\n * @param {bool}\n */\nsetLineBreakWithoutSpace : function () {},\n\n/**\n * @method setScaleY\n * @param {float}\n */\nsetScaleY : function () {},\n\n/**\n * @method setScaleX\n * @param {float}\n */\nsetScaleX : function () {},\n\n/**\n * @method isOpacityModifyRGB\n * @return A value converted from C/C++ \"bool\"\n */\nisOpacityModifyRGB : function () {},\n\n/**\n * @method createFontChars\n */\ncreateFontChars : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n/**\n * @method initWithString\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {float}\n * @param {cocos2d::TextHAlignment}\n * @param {cocos2d::Point}\n */\ninitWithString : function () {},\n\n/**\n * @method setCString\n * @param {const char*}\n */\nsetCString : function () {},\n\n/**\n * @method setScale\n * @param {float}\n */\nsetScale : function () {},\n\n/**\n * @method setOpacityModifyRGB\n * @param {bool}\n */\nsetOpacityModifyRGB : function () {},\n\n/**\n * @method setFntFile\n * @param {const std::string&}\n */\nsetFntFile : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method getFntFile\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFntFile : function () {},\n\n/**\n * @method updateLabel\n */\nupdateLabel : function () {},\n\n/**\n * @method setAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetAlignment : function () {},\n\n/**\n * @method setWidth\n * @param {float}\n */\nsetWidth : function () {},\n\n/**\n * @method purgeCachedData\n */\npurgeCachedData : function () {},\n\n/**\n * @method LabelBMFont\n * @constructor\n */\nLabelBMFont : function () {},\n\n};\n\n/**\n * @class Label\n */\ncc.Label = {\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n/**\n * @method assignNewUTF16String\n * @param {unsigned short*}\n */\nassignNewUTF16String : function () {},\n\n/**\n * @method setLabelEffect\n * @param {cocos2d::LabelEffect}\n * @param {const cocos2d::Color3B&}\n */\nsetLabelEffect : function () {},\n\n/**\n * @method getCommonLineHeight\n * @return A value converted from C/C++ \"int\"\n */\ngetCommonLineHeight : function () {},\n\n/**\n * @method breakLineWithoutSpace\n * @return A value converted from C/C++ \"bool\"\n */\nbreakLineWithoutSpace : function () {},\n\n/**\n * @method setWidth\n * @param {float}\n */\nsetWidth : function () {},\n\n/**\n * @method getMaxLineWidth\n * @return A value converted from C/C++ \"float\"\n */\ngetMaxLineWidth : function () {},\n\n/**\n * @method getScaleY\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleY : function () {},\n\n/**\n * @method getScaleX\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleX : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method getKernings\n * @return A value converted from C/C++ \"int*\"\n */\ngetKernings : function () {},\n\n/**\n * @method setBMFontFilePath\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nsetBMFontFilePath : function () {},\n\n/**\n * @method recordPlaceholderInfo\n * @return A value converted from C/C++ \"bool\"\n * @param {int}\n */\nrecordPlaceholderInfo : function () {},\n\n/**\n * @method getFontAtlas\n * @return A value converted from C/C++ \"cocos2d::FontAtlas*\"\n */\ngetFontAtlas : function () {},\n\n/**\n * @method setLineBreakWithoutSpace\n * @param {bool}\n */\nsetLineBreakWithoutSpace : function () {},\n\n/**\n * @method getStringNumLines\n * @return A value converted from C/C++ \"int\"\n */\ngetStringNumLines : function () {},\n\n/**\n * @method getUTF16String\n * @return A value converted from C/C++ \"unsigned short*\"\n */\ngetUTF16String : function () {},\n\n/**\n * @method getStringLenght\n * @return A value converted from C/C++ \"int\"\n */\ngetStringLenght : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method getLetter\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {int}\n */\ngetLetter : function () {},\n\n/**\n * @method getTextAlignment\n * @return A value converted from C/C++ \"cocos2d::TextHAlignment\"\n */\ngetTextAlignment : function () {},\n\n/**\n * @method setAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetAlignment : function () {},\n\n/**\n * @method recordLetterInfo\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n * @param {unsigned short}\n * @param {int}\n */\nrecordLetterInfo : function () {},\n\n/**\n * @method createWithBMFont\n * @return A value converted from C/C++ \"cocos2d::Label*\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {const cocos2d::TextHAlignment&}\n * @param {int}\n */\ncreateWithBMFont : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Label*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Layer\n */\ncc.Layer = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Layer*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class __LayerRGBA\n */\ncc.LayerRGBA = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::__LayerRGBA*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class LayerColor\n */\ncc.LayerColor = {\n\n/**\n * @method changeWidthAndHeight\n * @param {GLfloat}\n * @param {GLfloat}\n */\nchangeWidthAndHeight : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method changeWidth\n * @param {GLfloat}\n */\nchangeWidth : function () {},\n\n/**\n * @method changeHeight\n * @param {GLfloat}\n */\nchangeHeight : function () {},\n\n};\n\n/**\n * @class LayerGradient\n */\ncc.LayerGradient = {\n\n/**\n * @method getStartColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetStartColor : function () {},\n\n/**\n * @method isCompressedInterpolation\n * @return A value converted from C/C++ \"bool\"\n */\nisCompressedInterpolation : function () {},\n\n/**\n * @method getStartOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetStartOpacity : function () {},\n\n/**\n * @method setVector\n * @param {const cocos2d::Point&}\n */\nsetVector : function () {},\n\n/**\n * @method setStartOpacity\n * @param {GLubyte}\n */\nsetStartOpacity : function () {},\n\n/**\n * @method setCompressedInterpolation\n * @param {bool}\n */\nsetCompressedInterpolation : function () {},\n\n/**\n * @method setEndOpacity\n * @param {GLubyte}\n */\nsetEndOpacity : function () {},\n\n/**\n * @method getVector\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetVector : function () {},\n\n/**\n * @method setEndColor\n * @param {const cocos2d::Color3B&}\n */\nsetEndColor : function () {},\n\n/**\n * @method getEndColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetEndColor : function () {},\n\n/**\n * @method getEndOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetEndOpacity : function () {},\n\n/**\n * @method setStartColor\n * @param {const cocos2d::Color3B&}\n */\nsetStartColor : function () {},\n\n};\n\n/**\n * @class LayerMultiplex\n */\ncc.LayerMultiplex = {\n\n/**\n * @method switchToAndReleaseMe\n * @param {int}\n */\nswitchToAndReleaseMe : function () {},\n\n/**\n * @method addLayer\n * @param {cocos2d::Layer*}\n */\naddLayer : function () {},\n\n/**\n * @method switchTo\n * @param {int}\n */\nswitchTo : function () {},\n\n};\n\n/**\n * @class Scene\n */\ncc.Scene = {\n\n/**\n * @method getPhysicsWorld\n * @return A value converted from C/C++ \"cocos2d::PhysicsWorld*\"\n */\ngetPhysicsWorld : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithPhysics\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ncreateWithPhysics : function () {},\n\n};\n\n/**\n * @class TransitionEaseScene\n */\ncc.TransitionEaseScene = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n};\n\n/**\n * @class TransitionScene\n */\ncc.TransitionScene = {\n\n/**\n * @method finish\n */\nfinish : function () {},\n\n/**\n * @method hideOutShowIn\n */\nhideOutShowIn : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionScene*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSceneOriented\n */\ncc.TransitionSceneOriented = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSceneOriented*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n * @param {cocos2d::TransitionScene::Orientation}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionRotoZoom\n */\ncc.TransitionRotoZoom = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionRotoZoom*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionJumpZoom\n */\ncc.TransitionJumpZoom = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionJumpZoom*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInL\n */\ncc.TransitionMoveInL = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInL*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInR\n */\ncc.TransitionMoveInR = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInR*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInT\n */\ncc.TransitionMoveInT = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInT*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInB\n */\ncc.TransitionMoveInB = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInB*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInL\n */\ncc.TransitionSlideInL = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInL*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInR\n */\ncc.TransitionSlideInR = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInR*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInB\n */\ncc.TransitionSlideInB = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInB*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInT\n */\ncc.TransitionSlideInT = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInT*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionShrinkGrow\n */\ncc.TransitionShrinkGrow = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionShrinkGrow*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFlipX\n */\ncc.TransitionFlipX = {\n\n};\n\n/**\n * @class TransitionFlipY\n */\ncc.TransitionFlipY = {\n\n};\n\n/**\n * @class TransitionFlipAngular\n */\ncc.TransitionFlipAngular = {\n\n};\n\n/**\n * @class TransitionZoomFlipX\n */\ncc.TransitionZoomFlipX = {\n\n};\n\n/**\n * @class TransitionZoomFlipY\n */\ncc.TransitionZoomFlipY = {\n\n};\n\n/**\n * @class TransitionZoomFlipAngular\n */\ncc.TransitionZoomFlipAngular = {\n\n};\n\n/**\n * @class TransitionFade\n */\ncc.TransitionFade = {\n\n};\n\n/**\n * @class TransitionCrossFade\n */\ncc.TransitionCrossFade = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionCrossFade*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionTurnOffTiles\n */\ncc.TransitionTurnOffTiles = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionTurnOffTiles*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSplitCols\n */\ncc.TransitionSplitCols = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSplitCols*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSplitRows\n */\ncc.TransitionSplitRows = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSplitRows*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeTR\n */\ncc.TransitionFadeTR = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method actionWithSize\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {const cocos2d::Size&}\n */\nactionWithSize : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeTR*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeBL\n */\ncc.TransitionFadeBL = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeBL*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeUp\n */\ncc.TransitionFadeUp = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeUp*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeDown\n */\ncc.TransitionFadeDown = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeDown*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionPageTurn\n */\ncc.TransitionPageTurn = {\n\n/**\n * @method actionWithSize\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {const cocos2d::Size&}\n */\nactionWithSize : function () {},\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::Scene*}\n * @param {bool}\n */\ninitWithDuration : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionPageTurn*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n * @param {bool}\n */\ncreate : function () {},\n\n/**\n * @method TransitionPageTurn\n * @constructor\n */\nTransitionPageTurn : function () {},\n\n};\n\n/**\n * @class TransitionProgress\n */\ncc.TransitionProgress = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgress*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n/**\n * @method TransitionProgress\n * @constructor\n */\nTransitionProgress : function () {},\n\n};\n\n/**\n * @class TransitionProgressRadialCCW\n */\ncc.TransitionProgressRadialCCW = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressRadialCCW*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressRadialCW\n */\ncc.TransitionProgressRadialCW = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressRadialCW*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressHorizontal\n */\ncc.TransitionProgressHorizontal = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressHorizontal*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressVertical\n */\ncc.TransitionProgressVertical = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressVertical*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressInOut\n */\ncc.TransitionProgressInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressInOut*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressOutIn\n */\ncc.TransitionProgressOutIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressOutIn*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class MenuItem\n */\ncc.MenuItem = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method activate\n */\nactivate : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method selected\n */\nselected : function () {},\n\n/**\n * @method isSelected\n * @return A value converted from C/C++ \"bool\"\n */\nisSelected : function () {},\n\n/**\n * @method unselected\n */\nunselected : function () {},\n\n/**\n * @method rect\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\nrect : function () {},\n\n};\n\n/**\n * @class MenuItemLabel\n */\ncc.MenuItemLabel = {\n\n/**\n * @method getDisabledColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetDisabledColor : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method setLabel\n * @param {cocos2d::Node*}\n */\nsetLabel : function () {},\n\n/**\n * @method setDisabledColor\n * @param {const cocos2d::Color3B&}\n */\nsetDisabledColor : function () {},\n\n/**\n * @method getLabel\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetLabel : function () {},\n\n};\n\n/**\n * @class MenuItemAtlasFont\n */\ncc.MenuItemAtlasFont = {\n\n};\n\n/**\n * @class MenuItemFont\n */\ncc.MenuItemFont = {\n\n/**\n * @method setFontNameObj\n * @param {const std::string&}\n */\nsetFontNameObj : function () {},\n\n/**\n * @method getFontSizeObj\n * @return A value converted from C/C++ \"int\"\n */\ngetFontSizeObj : function () {},\n\n/**\n * @method getFontNameObj\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFontNameObj : function () {},\n\n/**\n * @method setFontSizeObj\n * @param {int}\n */\nsetFontSizeObj : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method getFontSize\n * @return A value converted from C/C++ \"int\"\n */\ngetFontSize : function () {},\n\n/**\n * @method getFontName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFontName : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n};\n\n/**\n * @class MenuItemSprite\n */\ncc.MenuItemSprite = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method selected\n */\nselected : function () {},\n\n/**\n * @method setNormalImage\n * @param {cocos2d::Node*}\n */\nsetNormalImage : function () {},\n\n/**\n * @method setDisabledImage\n * @param {cocos2d::Node*}\n */\nsetDisabledImage : function () {},\n\n/**\n * @method setSelectedImage\n * @param {cocos2d::Node*}\n */\nsetSelectedImage : function () {},\n\n/**\n * @method getDisabledImage\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetDisabledImage : function () {},\n\n/**\n * @method getSelectedImage\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetSelectedImage : function () {},\n\n/**\n * @method getNormalImage\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetNormalImage : function () {},\n\n/**\n * @method unselected\n */\nunselected : function () {},\n\n};\n\n/**\n * @class MenuItemImage\n */\ncc.MenuItemImage = {\n\n/**\n * @method setDisabledSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetDisabledSpriteFrame : function () {},\n\n/**\n * @method setSelectedSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetSelectedSpriteFrame : function () {},\n\n/**\n * @method setNormalSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetNormalSpriteFrame : function () {},\n\n};\n\n/**\n * @class MenuItemToggle\n */\ncc.MenuItemToggle = {\n\n/**\n * @method setSubItems\n * @param {const cocos2d::Vector<cocos2d::MenuItem *>&}\n */\nsetSubItems : function () {},\n\n/**\n * @method getSelectedIndex\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetSelectedIndex : function () {},\n\n/**\n * @method addSubItem\n * @param {cocos2d::MenuItem*}\n */\naddSubItem : function () {},\n\n/**\n * @method getSelectedItem\n * @return A value converted from C/C++ \"cocos2d::MenuItem*\"\n */\ngetSelectedItem : function () {},\n\n/**\n * @method setSelectedIndex\n * @param {unsigned int}\n */\nsetSelectedIndex : function () {},\n\n};\n\n/**\n * @class Menu\n */\ncc.Menu = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method alignItemsVertically\n */\nalignItemsVertically : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method alignItemsHorizontallyWithPadding\n * @param {float}\n */\nalignItemsHorizontallyWithPadding : function () {},\n\n/**\n * @method alignItemsVerticallyWithPadding\n * @param {float}\n */\nalignItemsVerticallyWithPadding : function () {},\n\n/**\n * @method alignItemsHorizontally\n */\nalignItemsHorizontally : function () {},\n\n};\n\n/**\n * @class ClippingNode\n */\ncc.ClippingNode = {\n\n/**\n * @method isInverted\n * @return A value converted from C/C++ \"bool\"\n */\nisInverted : function () {},\n\n/**\n * @method setInverted\n * @param {bool}\n */\nsetInverted : function () {},\n\n/**\n * @method setStencil\n * @param {cocos2d::Node*}\n */\nsetStencil : function () {},\n\n/**\n * @method getAlphaThreshold\n * @return A value converted from C/C++ \"GLfloat\"\n */\ngetAlphaThreshold : function () {},\n\n/**\n * @method getStencil\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetStencil : function () {},\n\n/**\n * @method setAlphaThreshold\n * @param {GLfloat}\n */\nsetAlphaThreshold : function () {},\n\n};\n\n/**\n * @class MotionStreak\n */\ncc.MotionStreak = {\n\n/**\n * @method reset\n */\nreset : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method tintWithColor\n * @param {const cocos2d::Color3B&}\n */\ntintWithColor : function () {},\n\n/**\n * @method setStartingPositionInitialized\n * @param {bool}\n */\nsetStartingPositionInitialized : function () {},\n\n/**\n * @method isStartingPositionInitialized\n * @return A value converted from C/C++ \"bool\"\n */\nisStartingPositionInitialized : function () {},\n\n/**\n * @method isFastMode\n * @return A value converted from C/C++ \"bool\"\n */\nisFastMode : function () {},\n\n/**\n * @method setFastMode\n * @param {bool}\n */\nsetFastMode : function () {},\n\n};\n\n/**\n * @class ProgressTimer\n */\ncc.ProgressTimer = {\n\n/**\n * @method isReverseDirection\n * @return A value converted from C/C++ \"bool\"\n */\nisReverseDirection : function () {},\n\n/**\n * @method setBarChangeRate\n * @param {const cocos2d::Point&}\n */\nsetBarChangeRate : function () {},\n\n/**\n * @method getPercentage\n * @return A value converted from C/C++ \"float\"\n */\ngetPercentage : function () {},\n\n/**\n * @method setSprite\n * @param {cocos2d::Sprite*}\n */\nsetSprite : function () {},\n\n/**\n * @method getType\n * @return A value converted from C/C++ \"cocos2d::ProgressTimer::Type\"\n */\ngetType : function () {},\n\n/**\n * @method getSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSprite : function () {},\n\n/**\n * @method setMidpoint\n * @param {const cocos2d::Point&}\n */\nsetMidpoint : function () {},\n\n/**\n * @method getBarChangeRate\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetBarChangeRate : function () {},\n\n/**\n * @method getMidpoint\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetMidpoint : function () {},\n\n/**\n * @method setPercentage\n * @param {float}\n */\nsetPercentage : function () {},\n\n/**\n * @method setType\n * @param {cocos2d::ProgressTimer::Type}\n */\nsetType : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ProgressTimer*\"\n * @param {cocos2d::Sprite*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class RenderTexture\n */\ncc.RenderTexture = {\n\n/**\n * @method clearStencil\n * @param {int}\n */\nclearStencil : function () {},\n\n/**\n * @method getClearDepth\n * @return A value converted from C/C++ \"float\"\n */\ngetClearDepth : function () {},\n\n/**\n * @method getClearStencil\n * @return A value converted from C/C++ \"int\"\n */\ngetClearStencil : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method setClearStencil\n * @param {int}\n */\nsetClearStencil : function () {},\n\n/**\n * @method setSprite\n * @param {cocos2d::Sprite*}\n */\nsetSprite : function () {},\n\n/**\n * @method getSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSprite : function () {},\n\n/**\n * @method isAutoDraw\n * @return A value converted from C/C++ \"bool\"\n */\nisAutoDraw : function () {},\n\n/**\n * @method setClearFlags\n * @param {unsigned int}\n */\nsetClearFlags : function () {},\n\n/**\n * @method begin\n */\nbegin : function () {},\n\n/**\n * @method setAutoDraw\n * @param {bool}\n */\nsetAutoDraw : function () {},\n\n/**\n * @method setClearColor\n * @param {const cocos2d::Color4F&}\n */\nsetClearColor : function () {},\n\n/**\n * @method endToLua\n */\nendToLua : function () {},\n\n/**\n * @method clearDepth\n * @param {float}\n */\nclearDepth : function () {},\n\n/**\n * @method getClearColor\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetClearColor : function () {},\n\n/**\n * @method clear\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\nclear : function () {},\n\n/**\n * @method getClearFlags\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetClearFlags : function () {},\n\n/**\n * @method newImage\n * @return A value converted from C/C++ \"cocos2d::Image*\"\n */\nnewImage : function () {},\n\n/**\n * @method setClearDepth\n * @param {float}\n */\nsetClearDepth : function () {},\n\n/**\n * @method RenderTexture\n * @constructor\n */\nRenderTexture : function () {},\n\n};\n\n/**\n * @class NodeGrid\n */\ncc.NodeGrid = {\n\n/**\n * @method setTarget\n * @param {cocos2d::Node*}\n */\nsetTarget : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::NodeGrid*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ParticleBatchNode\n */\ncc.ParticleBatchNode = {\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method disableParticle\n * @param {int}\n */\ndisableParticle : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method removeAllChildrenWithCleanup\n * @param {bool}\n */\nremoveAllChildrenWithCleanup : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method insertChild\n * @param {cocos2d::ParticleSystem*}\n * @param {int}\n */\ninsertChild : function () {},\n\n/**\n * @method visit\n */\nvisit : function () {},\n\n/**\n * @method removeChildAtIndex\n * @param {int}\n * @param {bool}\n */\nremoveChildAtIndex : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleBatchNode*\"\n * @param {const std::string&}\n * @param {int}\n */\ncreate : function () {},\n\n/**\n * @method createWithTexture\n * @return A value converted from C/C++ \"cocos2d::ParticleBatchNode*\"\n * @param {cocos2d::Texture2D*}\n * @param {int}\n */\ncreateWithTexture : function () {},\n\n};\n\n/**\n * @class ParticleSystem\n */\ncc.ParticleSystem = {\n\n/**\n * @method getStartSizeVar\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSizeVar : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method isFull\n * @return A value converted from C/C++ \"bool\"\n */\nisFull : function () {},\n\n/**\n * @method getBatchNode\n * @return A value converted from C/C++ \"cocos2d::ParticleBatchNode*\"\n */\ngetBatchNode : function () {},\n\n/**\n * @method getStartColor\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetStartColor : function () {},\n\n/**\n * @method getPositionType\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem::PositionType\"\n */\ngetPositionType : function () {},\n\n/**\n * @method setPosVar\n * @param {const cocos2d::Point&}\n */\nsetPosVar : function () {},\n\n/**\n * @method getEndSpin\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSpin : function () {},\n\n/**\n * @method setRotatePerSecondVar\n * @param {float}\n */\nsetRotatePerSecondVar : function () {},\n\n/**\n * @method getStartSpinVar\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSpinVar : function () {},\n\n/**\n * @method getRadialAccelVar\n * @return A value converted from C/C++ \"float\"\n */\ngetRadialAccelVar : function () {},\n\n/**\n * @method getEndSizeVar\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSizeVar : function () {},\n\n/**\n * @method setRotation\n * @param {float}\n */\nsetRotation : function () {},\n\n/**\n * @method setTangentialAccel\n * @param {float}\n */\nsetTangentialAccel : function () {},\n\n/**\n * @method setScaleY\n * @param {float}\n */\nsetScaleY : function () {},\n\n/**\n * @method setScaleX\n * @param {float}\n */\nsetScaleX : function () {},\n\n/**\n * @method getRadialAccel\n * @return A value converted from C/C++ \"float\"\n */\ngetRadialAccel : function () {},\n\n/**\n * @method setStartRadius\n * @param {float}\n */\nsetStartRadius : function () {},\n\n/**\n * @method setRotatePerSecond\n * @param {float}\n */\nsetRotatePerSecond : function () {},\n\n/**\n * @method setEndSize\n * @param {float}\n */\nsetEndSize : function () {},\n\n/**\n * @method getGravity\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetGravity : function () {},\n\n/**\n * @method getTangentialAccel\n * @return A value converted from C/C++ \"float\"\n */\ngetTangentialAccel : function () {},\n\n/**\n * @method setEndRadius\n * @param {float}\n */\nsetEndRadius : function () {},\n\n/**\n * @method getSpeed\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeed : function () {},\n\n/**\n * @method getAngle\n * @return A value converted from C/C++ \"float\"\n */\ngetAngle : function () {},\n\n/**\n * @method setEndColor\n * @param {const cocos2d::Color4F&}\n */\nsetEndColor : function () {},\n\n/**\n * @method setStartSpin\n * @param {float}\n */\nsetStartSpin : function () {},\n\n/**\n * @method setDuration\n * @param {float}\n */\nsetDuration : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method getPosVar\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosVar : function () {},\n\n/**\n * @method updateWithNoTime\n */\nupdateWithNoTime : function () {},\n\n/**\n * @method isBlendAdditive\n * @return A value converted from C/C++ \"bool\"\n */\nisBlendAdditive : function () {},\n\n/**\n * @method getSpeedVar\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeedVar : function () {},\n\n/**\n * @method setPositionType\n * @param {cocos2d::ParticleSystem::PositionType}\n */\nsetPositionType : function () {},\n\n/**\n * @method stopSystem\n */\nstopSystem : function () {},\n\n/**\n * @method getSourcePosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetSourcePosition : function () {},\n\n/**\n * @method setLifeVar\n * @param {float}\n */\nsetLifeVar : function () {},\n\n/**\n * @method setTotalParticles\n * @param {int}\n */\nsetTotalParticles : function () {},\n\n/**\n * @method setEndColorVar\n * @param {const cocos2d::Color4F&}\n */\nsetEndColorVar : function () {},\n\n/**\n * @method updateQuadWithParticle\n * @param {cocos2d::tParticle*}\n * @param {const cocos2d::Point&}\n */\nupdateQuadWithParticle : function () {},\n\n/**\n * @method getAtlasIndex\n * @return A value converted from C/C++ \"int\"\n */\ngetAtlasIndex : function () {},\n\n/**\n * @method getStartSize\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSize : function () {},\n\n/**\n * @method setStartSpinVar\n * @param {float}\n */\nsetStartSpinVar : function () {},\n\n/**\n * @method resetSystem\n */\nresetSystem : function () {},\n\n/**\n * @method setAtlasIndex\n * @param {int}\n */\nsetAtlasIndex : function () {},\n\n/**\n * @method setTangentialAccelVar\n * @param {float}\n */\nsetTangentialAccelVar : function () {},\n\n/**\n * @method setEndRadiusVar\n * @param {float}\n */\nsetEndRadiusVar : function () {},\n\n/**\n * @method getEndRadius\n * @return A value converted from C/C++ \"float\"\n */\ngetEndRadius : function () {},\n\n/**\n * @method isOpacityModifyRGB\n * @return A value converted from C/C++ \"bool\"\n */\nisOpacityModifyRGB : function () {},\n\n/**\n * @method isActive\n * @return A value converted from C/C++ \"bool\"\n */\nisActive : function () {},\n\n/**\n * @method setRadialAccelVar\n * @param {float}\n */\nsetRadialAccelVar : function () {},\n\n/**\n * @method setStartSize\n * @param {float}\n */\nsetStartSize : function () {},\n\n/**\n * @method setSpeed\n * @param {float}\n */\nsetSpeed : function () {},\n\n/**\n * @method getStartSpin\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSpin : function () {},\n\n/**\n * @method getRotatePerSecond\n * @return A value converted from C/C++ \"float\"\n */\ngetRotatePerSecond : function () {},\n\n/**\n * @method initParticle\n * @param {cocos2d::tParticle*}\n */\ninitParticle : function () {},\n\n/**\n * @method setEmitterMode\n * @param {cocos2d::ParticleSystem::Mode}\n */\nsetEmitterMode : function () {},\n\n/**\n * @method getDuration\n * @return A value converted from C/C++ \"float\"\n */\ngetDuration : function () {},\n\n/**\n * @method setSourcePosition\n * @param {const cocos2d::Point&}\n */\nsetSourcePosition : function () {},\n\n/**\n * @method getEndSpinVar\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSpinVar : function () {},\n\n/**\n * @method setBlendAdditive\n * @param {bool}\n */\nsetBlendAdditive : function () {},\n\n/**\n * @method setLife\n * @param {float}\n */\nsetLife : function () {},\n\n/**\n * @method setAngleVar\n * @param {float}\n */\nsetAngleVar : function () {},\n\n/**\n * @method setRotationIsDir\n * @param {bool}\n */\nsetRotationIsDir : function () {},\n\n/**\n * @method setEndSizeVar\n * @param {float}\n */\nsetEndSizeVar : function () {},\n\n/**\n * @method setAngle\n * @param {float}\n */\nsetAngle : function () {},\n\n/**\n * @method setBatchNode\n * @param {cocos2d::ParticleBatchNode*}\n */\nsetBatchNode : function () {},\n\n/**\n * @method getTangentialAccelVar\n * @return A value converted from C/C++ \"float\"\n */\ngetTangentialAccelVar : function () {},\n\n/**\n * @method getEmitterMode\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem::Mode\"\n */\ngetEmitterMode : function () {},\n\n/**\n * @method setEndSpinVar\n * @param {float}\n */\nsetEndSpinVar : function () {},\n\n/**\n * @method getAngleVar\n * @return A value converted from C/C++ \"float\"\n */\ngetAngleVar : function () {},\n\n/**\n * @method setStartColor\n * @param {const cocos2d::Color4F&}\n */\nsetStartColor : function () {},\n\n/**\n * @method getRotatePerSecondVar\n * @return A value converted from C/C++ \"float\"\n */\ngetRotatePerSecondVar : function () {},\n\n/**\n * @method getEndSize\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSize : function () {},\n\n/**\n * @method getLife\n * @return A value converted from C/C++ \"float\"\n */\ngetLife : function () {},\n\n/**\n * @method setSpeedVar\n * @param {float}\n */\nsetSpeedVar : function () {},\n\n/**\n * @method setAutoRemoveOnFinish\n * @param {bool}\n */\nsetAutoRemoveOnFinish : function () {},\n\n/**\n * @method setGravity\n * @param {const cocos2d::Point&}\n */\nsetGravity : function () {},\n\n/**\n * @method postStep\n */\npostStep : function () {},\n\n/**\n * @method setEmissionRate\n * @param {float}\n */\nsetEmissionRate : function () {},\n\n/**\n * @method getEndColorVar\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetEndColorVar : function () {},\n\n/**\n * @method getRotationIsDir\n * @return A value converted from C/C++ \"bool\"\n */\ngetRotationIsDir : function () {},\n\n/**\n * @method setScale\n * @param {float}\n */\nsetScale : function () {},\n\n/**\n * @method getEmissionRate\n * @return A value converted from C/C++ \"float\"\n */\ngetEmissionRate : function () {},\n\n/**\n * @method getEndColor\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetEndColor : function () {},\n\n/**\n * @method getLifeVar\n * @return A value converted from C/C++ \"float\"\n */\ngetLifeVar : function () {},\n\n/**\n * @method setStartSizeVar\n * @param {float}\n */\nsetStartSizeVar : function () {},\n\n/**\n * @method setOpacityModifyRGB\n * @param {bool}\n */\nsetOpacityModifyRGB : function () {},\n\n/**\n * @method addParticle\n * @return A value converted from C/C++ \"bool\"\n */\naddParticle : function () {},\n\n/**\n * @method getStartRadius\n * @return A value converted from C/C++ \"float\"\n */\ngetStartRadius : function () {},\n\n/**\n * @method getParticleCount\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetParticleCount : function () {},\n\n/**\n * @method getStartRadiusVar\n * @return A value converted from C/C++ \"float\"\n */\ngetStartRadiusVar : function () {},\n\n/**\n * @method setStartColorVar\n * @param {const cocos2d::Color4F&}\n */\nsetStartColorVar : function () {},\n\n/**\n * @method setEndSpin\n * @param {float}\n */\nsetEndSpin : function () {},\n\n/**\n * @method setRadialAccel\n * @param {float}\n */\nsetRadialAccel : function () {},\n\n/**\n * @method isAutoRemoveOnFinish\n * @return A value converted from C/C++ \"bool\"\n */\nisAutoRemoveOnFinish : function () {},\n\n/**\n * @method getTotalParticles\n * @return A value converted from C/C++ \"int\"\n */\ngetTotalParticles : function () {},\n\n/**\n * @method setStartRadiusVar\n * @param {float}\n */\nsetStartRadiusVar : function () {},\n\n/**\n * @method getEndRadiusVar\n * @return A value converted from C/C++ \"float\"\n */\ngetEndRadiusVar : function () {},\n\n/**\n * @method getStartColorVar\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetStartColorVar : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem*\"\n * @param {const std::string&}\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSystemQuad\n */\ncc.ParticleSystem = {\n\n/**\n * @method setDisplayFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetDisplayFrame : function () {},\n\n/**\n * @method setTextureWithRect\n * @param {cocos2d::Texture2D*}\n * @param {const cocos2d::Rect&}\n */\nsetTextureWithRect : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSystemQuad*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleFire\n */\ncc.ParticleFire = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleFire*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleFire*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleFireworks\n */\ncc.ParticleFireworks = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleFireworks*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleFireworks*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSun\n */\ncc.ParticleSun = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSun*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSun*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleGalaxy\n */\ncc.ParticleGalaxy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleGalaxy*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleGalaxy*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleFlower\n */\ncc.ParticleFlower = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleFlower*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleFlower*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleMeteor\n */\ncc.ParticleMeteor = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleMeteor*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleMeteor*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSpiral\n */\ncc.ParticleSpiral = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSpiral*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSpiral*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleExplosion\n */\ncc.ParticleExplosion = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleExplosion*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleExplosion*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSmoke\n */\ncc.ParticleSmoke = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSmoke*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSmoke*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSnow\n */\ncc.ParticleSnow = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSnow*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSnow*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleRain\n */\ncc.ParticleRain = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleRain*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleRain*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class FileUtils\n */\ncc.FileUtils = {\n\n/**\n * @method fullPathForFilename\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n */\nfullPathForFilename : function () {},\n\n/**\n * @method getStringFromFile\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n */\ngetStringFromFile : function () {},\n\n/**\n * @method setFilenameLookupDictionary\n * @param {const cocos2d::ValueMap&}\n */\nsetFilenameLookupDictionary : function () {},\n\n/**\n * @method isAbsolutePath\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nisAbsolutePath : function () {},\n\n/**\n * @method loadFilenameLookupDictionaryFromFile\n * @param {const std::string&}\n */\nloadFilenameLookupDictionaryFromFile : function () {},\n\n/**\n * @method isPopupNotify\n * @return A value converted from C/C++ \"bool\"\n */\nisPopupNotify : function () {},\n\n/**\n * @method getValueVectorFromFile\n * @return A value converted from C/C++ \"cocos2d::ValueVector\"\n * @param {const std::string&}\n */\ngetValueVectorFromFile : function () {},\n\n/**\n * @method writeToFile\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::ValueMap&}\n * @param {const std::string&}\n */\nwriteToFile : function () {},\n\n/**\n * @method getValueMapFromFile\n * @return A value converted from C/C++ \"cocos2d::ValueMap\"\n * @param {const std::string&}\n */\ngetValueMapFromFile : function () {},\n\n/**\n * @method addSearchResolutionsOrder\n * @param {const std::string&}\n */\naddSearchResolutionsOrder : function () {},\n\n/**\n * @method addSearchPath\n * @param {const std::string&}\n */\naddSearchPath : function () {},\n\n/**\n * @method isFileExist\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nisFileExist : function () {},\n\n/**\n * @method purgeCachedEntries\n */\npurgeCachedEntries : function () {},\n\n/**\n * @method fullPathFromRelativeFile\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\nfullPathFromRelativeFile : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::FileUtils*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class SAXParser\n */\ncc.SAXParser = {\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n * @param {const char*}\n */\ninit : function () {},\n\n};\n\n/**\n * @class Application\n */\ncc.Application = {\n\n/**\n * @method getTargetPlatform\n * @return A value converted from C/C++ \"cocos2d::ApplicationProtocol::Platform\"\n */\ngetTargetPlatform : function () {},\n\n/**\n * @method setAnimationInterval\n * @param {double}\n */\nsetAnimationInterval : function () {},\n\n/**\n * @method getCurrentLanguage\n * @return A value converted from C/C++ \"cocos2d::LanguageType\"\n */\ngetCurrentLanguage : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::Application*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class EGLViewProtocol\n */\ncc.EGLViewProtocol = {\n\n/**\n * @method getVisibleOrigin\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetVisibleOrigin : function () {},\n\n/**\n * @method getVisibleSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetVisibleSize : function () {},\n\n/**\n * @method setDesignResolutionSize\n * @param {float}\n * @param {float}\n * @param {ResolutionPolicy}\n */\nsetDesignResolutionSize : function () {},\n\n};\n\n/**\n * @class EGLView\n */\ncc.EGLView = {\n\n/**\n * @method setIMEKeyboardState\n * @param {bool}\n */\nsetIMEKeyboardState : function () {},\n\n/**\n * @method isOpenGLReady\n * @return A value converted from C/C++ \"bool\"\n */\nisOpenGLReady : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::EGLView*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class ShaderCache\n */\ncc.ShaderCache = {\n\n/**\n * @method reloadDefaultShaders\n */\nreloadDefaultShaders : function () {},\n\n/**\n * @method addProgram\n * @param {cocos2d::GLProgram*}\n * @param {const std::string&}\n */\naddProgram : function () {},\n\n/**\n * @method getProgram\n * @return A value converted from C/C++ \"cocos2d::GLProgram*\"\n * @param {const std::string&}\n */\ngetProgram : function () {},\n\n/**\n * @method loadDefaultShaders\n */\nloadDefaultShaders : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::ShaderCache*\"\n */\ngetInstance : function () {},\n\n/**\n * @method ShaderCache\n * @constructor\n */\nShaderCache : function () {},\n\n};\n\n/**\n * @class AnimationCache\n */\ncc.AnimationCache = {\n\n/**\n * @method getAnimation\n * @return A value converted from C/C++ \"cocos2d::Animation*\"\n * @param {const std::string&}\n */\ngetAnimation : function () {},\n\n/**\n * @method addAnimation\n * @param {cocos2d::Animation*}\n * @param {const std::string&}\n */\naddAnimation : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method addAnimationsWithDictionary\n * @param {const cocos2d::ValueMap&}\n * @param {const std::string&}\n */\naddAnimationsWithDictionary : function () {},\n\n/**\n * @method removeAnimation\n * @param {const std::string&}\n */\nremoveAnimation : function () {},\n\n/**\n * @method addAnimationsWithFile\n * @param {const std::string&}\n */\naddAnimationsWithFile : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::AnimationCache*\"\n */\ngetInstance : function () {},\n\n/**\n * @method AnimationCache\n * @constructor\n */\nAnimationCache : function () {},\n\n};\n\n/**\n * @class SpriteFrameCache\n */\ncc.SpriteFrameCache = {\n\n/**\n * @method addSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n * @param {const std::string&}\n */\naddSpriteFrame : function () {},\n\n/**\n * @method removeUnusedSpriteFrames\n */\nremoveUnusedSpriteFrames : function () {},\n\n/**\n * @method getSpriteFrameByName\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n * @param {const std::string&}\n */\ngetSpriteFrameByName : function () {},\n\n/**\n * @method removeSpriteFramesFromFile\n * @param {const std::string&}\n */\nremoveSpriteFramesFromFile : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method removeSpriteFrames\n */\nremoveSpriteFrames : function () {},\n\n/**\n * @method removeSpriteFramesFromTexture\n * @param {cocos2d::Texture2D*}\n */\nremoveSpriteFramesFromTexture : function () {},\n\n/**\n * @method removeSpriteFrameByName\n * @param {const std::string&}\n */\nremoveSpriteFrameByName : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::SpriteFrameCache*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class TextFieldTTF\n */\ncc.TextFieldTTF = {\n\n/**\n * @method getCharCount\n * @return A value converted from C/C++ \"int\"\n */\ngetCharCount : function () {},\n\n/**\n * @method getDelegate\n * @return A value converted from C/C++ \"cocos2d::TextFieldDelegate*\"\n */\ngetDelegate : function () {},\n\n/**\n * @method setSecureTextEntry\n * @param {bool}\n */\nsetSecureTextEntry : function () {},\n\n/**\n * @method getColorSpaceHolder\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetColorSpaceHolder : function () {},\n\n/**\n * @method setColorSpaceHolder\n * @param {const cocos2d::Color3B&}\n */\nsetColorSpaceHolder : function () {},\n\n/**\n * @method detachWithIME\n * @return A value converted from C/C++ \"bool\"\n */\ndetachWithIME : function () {},\n\n/**\n * @method setDelegate\n * @param {cocos2d::TextFieldDelegate*}\n */\nsetDelegate : function () {},\n\n/**\n * @method setPlaceHolder\n * @param {const std::string&}\n */\nsetPlaceHolder : function () {},\n\n/**\n * @method isSecureTextEntry\n * @return A value converted from C/C++ \"bool\"\n */\nisSecureTextEntry : function () {},\n\n/**\n * @method getPlaceHolder\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetPlaceHolder : function () {},\n\n/**\n * @method attachWithIME\n * @return A value converted from C/C++ \"bool\"\n */\nattachWithIME : function () {},\n\n/**\n * @method TextFieldTTF\n * @constructor\n */\nTextFieldTTF : function () {},\n\n};\n\n/**\n * @class TextureCache\n */\ncc.TextureCache = {\n\n/**\n * @method removeTextureForKey\n * @param {const std::string&}\n */\nremoveTextureForKey : function () {},\n\n/**\n * @method removeAllTextures\n */\nremoveAllTextures : function () {},\n\n/**\n * @method getDescription\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDescription : function () {},\n\n/**\n * @method getCachedTextureInfo\n * @return A value converted from C/C++ \"std::string\"\n */\ngetCachedTextureInfo : function () {},\n\n/**\n * @method getTextureForKey\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n * @param {const std::string&}\n */\ngetTextureForKey : function () {},\n\n/**\n * @method removeUnusedTextures\n */\nremoveUnusedTextures : function () {},\n\n/**\n * @method removeTexture\n * @param {cocos2d::Texture2D*}\n */\nremoveTexture : function () {},\n\n/**\n * @method waitForQuit\n */\nwaitForQuit : function () {},\n\n/**\n * @method TextureCache\n * @constructor\n */\nTextureCache : function () {},\n\n};\n\n/**\n * @class ParallaxNode\n */\ncc.ParallaxNode = {\n\n/**\n * @method addChild\n * @param {cocos2d::Node*}\n * @param {int}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n */\naddChild : function () {},\n\n/**\n * @method removeAllChildrenWithCleanup\n * @param {bool}\n */\nremoveAllChildrenWithCleanup : function () {},\n\n/**\n * @method setParallaxArray\n * @param {cocos2d::_ccArray*}\n */\nsetParallaxArray : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParallaxNode*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TMXObjectGroup\n */\ncc.TMXObjectGroup = {\n\n/**\n * @method setPositionOffset\n * @param {const cocos2d::Point&}\n */\nsetPositionOffset : function () {},\n\n/**\n * @method getProperty\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {const std::string&}\n */\ngetProperty : function () {},\n\n/**\n * @method getPositionOffset\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPositionOffset : function () {},\n\n/**\n * @method getObject\n * @return A value converted from C/C++ \"cocos2d::ValueMap\"\n * @param {const std::string&}\n */\ngetObject : function () {},\n\n/**\n * @method setGroupName\n * @param {const std::string&}\n */\nsetGroupName : function () {},\n\n/**\n * @method getGroupName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetGroupName : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method setObjects\n * @param {const cocos2d::ValueVector&}\n */\nsetObjects : function () {},\n\n/**\n * @method TMXObjectGroup\n * @constructor\n */\nTMXObjectGroup : function () {},\n\n};\n\n/**\n * @class TMXLayerInfo\n */\ncc.TMXLayerInfo = {\n\n/**\n * @method setProperties\n * @param {cocos2d::ValueMap}\n */\nsetProperties : function () {},\n\n/**\n * @method getProperties\n * @return A value converted from C/C++ \"cocos2d::ValueMap&\"\n */\ngetProperties : function () {},\n\n/**\n * @method TMXLayerInfo\n * @constructor\n */\nTMXLayerInfo : function () {},\n\n};\n\n/**\n * @class TMXTilesetInfo\n */\ncc.TMXTilesetInfo = {\n\n/**\n * @method rectForGID\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n * @param {int}\n */\nrectForGID : function () {},\n\n/**\n * @method TMXTilesetInfo\n * @constructor\n */\nTMXTilesetInfo : function () {},\n\n};\n\n/**\n * @class TMXMapInfo\n */\ncc.TMXMapInfo = {\n\n/**\n * @method setObjectGroups\n * @param {const cocos2d::Vector<cocos2d::TMXObjectGroup *>&}\n */\nsetObjectGroups : function () {},\n\n/**\n * @method setTileSize\n * @param {const cocos2d::Size&}\n */\nsetTileSize : function () {},\n\n/**\n * @method initWithTMXFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\ninitWithTMXFile : function () {},\n\n/**\n * @method getOrientation\n * @return A value converted from C/C++ \"int\"\n */\ngetOrientation : function () {},\n\n/**\n * @method isStoringCharacters\n * @return A value converted from C/C++ \"bool\"\n */\nisStoringCharacters : function () {},\n\n/**\n * @method setLayers\n * @param {const cocos2d::Vector<cocos2d::TMXLayerInfo *>&}\n */\nsetLayers : function () {},\n\n/**\n * @method parseXMLFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nparseXMLFile : function () {},\n\n/**\n * @method getParentElement\n * @return A value converted from C/C++ \"int\"\n */\ngetParentElement : function () {},\n\n/**\n * @method setTMXFileName\n * @param {const std::string&}\n */\nsetTMXFileName : function () {},\n\n/**\n * @method parseXMLString\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nparseXMLString : function () {},\n\n/**\n * @method getParentGID\n * @return A value converted from C/C++ \"int\"\n */\ngetParentGID : function () {},\n\n/**\n * @method setParentElement\n * @param {int}\n */\nsetParentElement : function () {},\n\n/**\n * @method initWithXML\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ninitWithXML : function () {},\n\n/**\n * @method setParentGID\n * @param {int}\n */\nsetParentGID : function () {},\n\n/**\n * @method getLayerAttribs\n * @return A value converted from C/C++ \"int\"\n */\ngetLayerAttribs : function () {},\n\n/**\n * @method getTileSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetTileSize : function () {},\n\n/**\n * @method getTileProperties\n * @return A value converted from C/C++ \"cocos2d::ValueMapIntKey&\"\n */\ngetTileProperties : function () {},\n\n/**\n * @method getTMXFileName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetTMXFileName : function () {},\n\n/**\n * @method setCurrentString\n * @param {const std::string&}\n */\nsetCurrentString : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method setOrientation\n * @param {int}\n */\nsetOrientation : function () {},\n\n/**\n * @method setTileProperties\n * @param {const cocos2d::ValueMapIntKey&}\n */\nsetTileProperties : function () {},\n\n/**\n * @method setMapSize\n * @param {const cocos2d::Size&}\n */\nsetMapSize : function () {},\n\n/**\n * @method setStoringCharacters\n * @param {bool}\n */\nsetStoringCharacters : function () {},\n\n/**\n * @method getMapSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetMapSize : function () {},\n\n/**\n * @method setTilesets\n * @param {const cocos2d::Vector<cocos2d::TMXTilesetInfo *>&}\n */\nsetTilesets : function () {},\n\n/**\n * @method getCurrentString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetCurrentString : function () {},\n\n/**\n * @method setLayerAttribs\n * @param {int}\n */\nsetLayerAttribs : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TMXMapInfo*\"\n * @param {const std::string&}\n */\ncreate : function () {},\n\n/**\n * @method createWithXML\n * @return A value converted from C/C++ \"cocos2d::TMXMapInfo*\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ncreateWithXML : function () {},\n\n/**\n * @method TMXMapInfo\n * @constructor\n */\nTMXMapInfo : function () {},\n\n};\n\n/**\n * @class TMXLayer\n */\ncc.TMXLayer = {\n\n/**\n * @method getTileGIDAt\n * @return A value converted from C/C++ \"int\"\n * @param {const cocos2d::Point&}\n * @param {cocos2d::ccTMXTileFlags*}\n */\ngetTileGIDAt : function () {},\n\n/**\n * @method getPositionAt\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\ngetPositionAt : function () {},\n\n/**\n * @method setLayerOrientation\n * @param {int}\n */\nsetLayerOrientation : function () {},\n\n/**\n * @method releaseMap\n */\nreleaseMap : function () {},\n\n/**\n * @method setTiles\n * @param {int*}\n */\nsetTiles : function () {},\n\n/**\n * @method getLayerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetLayerSize : function () {},\n\n/**\n * @method setMapTileSize\n * @param {const cocos2d::Size&}\n */\nsetMapTileSize : function () {},\n\n/**\n * @method getLayerOrientation\n * @return A value converted from C/C++ \"int\"\n */\ngetLayerOrientation : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method setLayerName\n * @param {const std::string&}\n */\nsetLayerName : function () {},\n\n/**\n * @method removeTileAt\n * @param {const cocos2d::Point&}\n */\nremoveTileAt : function () {},\n\n/**\n * @method initWithTilesetInfo\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::TMXTilesetInfo*}\n * @param {cocos2d::TMXLayerInfo*}\n * @param {cocos2d::TMXMapInfo*}\n */\ninitWithTilesetInfo : function () {},\n\n/**\n * @method setupTiles\n */\nsetupTiles : function () {},\n\n/**\n * @method getMapTileSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetMapTileSize : function () {},\n\n/**\n * @method getProperty\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {const std::string&}\n */\ngetProperty : function () {},\n\n/**\n * @method setLayerSize\n * @param {const cocos2d::Size&}\n */\nsetLayerSize : function () {},\n\n/**\n * @method getLayerName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetLayerName : function () {},\n\n/**\n * @method setTileSet\n * @param {cocos2d::TMXTilesetInfo*}\n */\nsetTileSet : function () {},\n\n/**\n * @method getTileSet\n * @return A value converted from C/C++ \"cocos2d::TMXTilesetInfo*\"\n */\ngetTileSet : function () {},\n\n/**\n * @method getTileAt\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {const cocos2d::Point&}\n */\ngetTileAt : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TMXLayer*\"\n * @param {cocos2d::TMXTilesetInfo*}\n * @param {cocos2d::TMXLayerInfo*}\n * @param {cocos2d::TMXMapInfo*}\n */\ncreate : function () {},\n\n/**\n * @method TMXLayer\n * @constructor\n */\nTMXLayer : function () {},\n\n};\n\n/**\n * @class TMXTiledMap\n */\ncc.TMXTiledMap = {\n\n/**\n * @method setObjectGroups\n * @param {const cocos2d::Vector<cocos2d::TMXObjectGroup *>&}\n */\nsetObjectGroups : function () {},\n\n/**\n * @method getProperty\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {const std::string&}\n */\ngetProperty : function () {},\n\n/**\n * @method setMapSize\n * @param {const cocos2d::Size&}\n */\nsetMapSize : function () {},\n\n/**\n * @method getObjectGroup\n * @return A value converted from C/C++ \"cocos2d::TMXObjectGroup*\"\n * @param {const std::string&}\n */\ngetObjectGroup : function () {},\n\n/**\n * @method getTileSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetTileSize : function () {},\n\n/**\n * @method getMapSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetMapSize : function () {},\n\n/**\n * @method getProperties\n * @return A value converted from C/C++ \"cocos2d::ValueMap&\"\n */\ngetProperties : function () {},\n\n/**\n * @method getPropertiesForGID\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {int}\n */\ngetPropertiesForGID : function () {},\n\n/**\n * @method setTileSize\n * @param {const cocos2d::Size&}\n */\nsetTileSize : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method getLayer\n * @return A value converted from C/C++ \"cocos2d::TMXLayer*\"\n * @param {const std::string&}\n */\ngetLayer : function () {},\n\n/**\n * @method getMapOrientation\n * @return A value converted from C/C++ \"int\"\n */\ngetMapOrientation : function () {},\n\n/**\n * @method setMapOrientation\n * @param {int}\n */\nsetMapOrientation : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TMXTiledMap*\"\n * @param {const std::string&}\n */\ncreate : function () {},\n\n/**\n * @method createWithXML\n * @return A value converted from C/C++ \"cocos2d::TMXTiledMap*\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ncreateWithXML : function () {},\n\n};\n\n/**\n * @class TileMapAtlas\n */\ncc.TileMapAtlas = {\n\n/**\n * @method initWithTileFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n */\ninitWithTileFile : function () {},\n\n/**\n * @method releaseMap\n */\nreleaseMap : function () {},\n\n/**\n * @method getTGAInfo\n * @return A value converted from C/C++ \"cocos2d::sImageTGA*\"\n */\ngetTGAInfo : function () {},\n\n/**\n * @method getTileAt\n * @return A value converted from C/C++ \"cocos2d::Color3B\"\n * @param {const cocos2d::Point&}\n */\ngetTileAt : function () {},\n\n/**\n * @method setTile\n * @param {const cocos2d::Color3B&}\n * @param {const cocos2d::Point&}\n */\nsetTile : function () {},\n\n/**\n * @method setTGAInfo\n * @param {cocos2d::sImageTGA*}\n */\nsetTGAInfo : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TileMapAtlas*\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n */\ncreate : function () {},\n\n/**\n * @method TileMapAtlas\n * @constructor\n */\nTileMapAtlas : function () {},\n\n};\n\n/**\n * @class Timer\n */\ncc.Timer = {\n\n/**\n * @method getInterval\n * @return A value converted from C/C++ \"float\"\n */\ngetInterval : function () {},\n\n/**\n * @method setInterval\n * @param {float}\n */\nsetInterval : function () {},\n\n/**\n * @method initWithScriptHandler\n * @return A value converted from C/C++ \"bool\"\n * @param {int}\n * @param {float}\n */\ninitWithScriptHandler : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method getScriptHandler\n * @return A value converted from C/C++ \"int\"\n */\ngetScriptHandler : function () {},\n\n/**\n * @method Timer\n * @constructor\n */\nTimer : function () {},\n\n};\n\n/**\n * @class Scheduler\n */\ncc.Scheduler = {\n\n/**\n * @method setTimeScale\n * @param {float}\n */\nsetTimeScale : function () {},\n\n/**\n * @method performFunctionInCocosThread\n * @param {const std::function<void ()>&}\n */\nperformFunctionInCocosThread : function () {},\n\n/**\n * @method getTimeScale\n * @return A value converted from C/C++ \"float\"\n */\ngetTimeScale : function () {},\n\n/**\n * @method Scheduler\n * @constructor\n */\nScheduler : function () {},\n\n};\n\n/**\n * @class Component\n */\ncc.Component = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method setName\n * @param {const std::string&}\n */\nsetName : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method serialize\n * @return A value converted from C/C++ \"bool\"\n * @param {void*}\n */\nserialize : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method getOwner\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetOwner : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setOwner\n * @param {cocos2d::Node*}\n */\nsetOwner : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetName : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Component*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SimpleAudioEngine\n */\ncc.AudioEngine = {\n\n/**\n * @method preloadBackgroundMusic\n * @param {const char*}\n */\npreloadBackgroundMusic : function () {},\n\n/**\n * @method stopBackgroundMusic\n */\nstopBackgroundMusic : function () {},\n\n/**\n * @method stopAllEffects\n */\nstopAllEffects : function () {},\n\n/**\n * @method getBackgroundMusicVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetBackgroundMusicVolume : function () {},\n\n/**\n * @method resumeBackgroundMusic\n */\nresumeBackgroundMusic : function () {},\n\n/**\n * @method setBackgroundMusicVolume\n * @param {float}\n */\nsetBackgroundMusicVolume : function () {},\n\n/**\n * @method preloadEffect\n * @param {const char*}\n */\npreloadEffect : function () {},\n\n/**\n * @method isBackgroundMusicPlaying\n * @return A value converted from C/C++ \"bool\"\n */\nisBackgroundMusicPlaying : function () {},\n\n/**\n * @method getEffectsVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetEffectsVolume : function () {},\n\n/**\n * @method willPlayBackgroundMusic\n * @return A value converted from C/C++ \"bool\"\n */\nwillPlayBackgroundMusic : function () {},\n\n/**\n * @method pauseEffect\n * @param {unsigned int}\n */\npauseEffect : function () {},\n\n/**\n * @method playEffect\n * @return A value converted from C/C++ \"unsigned int\"\n * @param {const char*}\n * @param {bool}\n * @param {float}\n * @param {float}\n * @param {float}\n */\nplayEffect : function () {},\n\n/**\n * @method rewindBackgroundMusic\n */\nrewindBackgroundMusic : function () {},\n\n/**\n * @method playBackgroundMusic\n * @param {const char*}\n * @param {bool}\n */\nplayBackgroundMusic : function () {},\n\n/**\n * @method resumeAllEffects\n */\nresumeAllEffects : function () {},\n\n/**\n * @method setEffectsVolume\n * @param {float}\n */\nsetEffectsVolume : function () {},\n\n/**\n * @method stopEffect\n * @param {unsigned int}\n */\nstopEffect : function () {},\n\n/**\n * @method pauseBackgroundMusic\n */\npauseBackgroundMusic : function () {},\n\n/**\n * @method pauseAllEffects\n */\npauseAllEffects : function () {},\n\n/**\n * @method unloadEffect\n * @param {const char*}\n */\nunloadEffect : function () {},\n\n/**\n * @method resumeEffect\n * @param {unsigned int}\n */\nresumeEffect : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"CocosDenshion::SimpleAudioEngine*\"\n */\ngetInstance : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_builder_auto.cpp",
    "content": "#include \"jsb_cocos2dx_builder_auto.hpp\"\n#include \"cocos2d_specifics.hpp\"\n#include \"CocosBuilder.h\"\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n    JSObject* global = ScriptingCore::getInstance()->getGlobalObject();\n\tisNewValid = JS_GetProperty(cx, global, \"initializing\", &initializing) && JSVAL_TO_BOOLEAN(initializing);\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n    JS_ReportError(cx, \"Don't use `new cc.XXX`, please use `cc.XXX.create` instead! \");\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_is_native_obj(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n\tvp.set(BOOLEAN_TO_JSVAL(JS_TRUE));\n\treturn JS_TRUE;\t\n}\nJSClass  *jsb_cocosbuilder_CCBAnimationManager_class;\nJSObject *jsb_cocosbuilder_CCBAnimationManager_prototype;\n\nJSBool js_cocos2dx_builder_CCBAnimationManager_moveAnimationsFromNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_moveAnimationsFromNode : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::Node* arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_moveAnimationsFromNode : Error processing arguments\");\n\t\tcobj->moveAnimationsFromNode(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_moveAnimationsFromNode : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setAutoPlaySequenceId(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setAutoPlaySequenceId : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setAutoPlaySequenceId : Error processing arguments\");\n\t\tcobj->setAutoPlaySequenceId(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setAutoPlaySequenceId : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueVector& ret = cobj->getDocumentCallbackNames();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocosbuilder::CCBSequenceProperty* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocosbuilder::CCBSequenceProperty*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel : Error processing arguments\");\n\t\tcocos2d::Object* ret = cobj->actionForSoundChannel(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Object>(cx, (cocos2d::Object*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setBaseValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setBaseValue : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Value arg0;\n\t\tcocos2d::Node* arg1;\n\t\tstd::string arg2;\n\t\tok &= jsval_to_ccvalue(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setBaseValue : Error processing arguments\");\n\t\tcobj->setBaseValue(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setBaseValue : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNodes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNodes : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::Node *>& ret = cobj->getDocumentOutletNodes();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNodes : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getLastCompletedSequenceName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getLastCompletedSequenceName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getLastCompletedSequenceName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getLastCompletedSequenceName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setRootNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setRootNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setRootNode : Error processing arguments\");\n\t\tcobj->setRootNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setRootNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tdouble arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration : Error processing arguments\");\n\t\tcobj->runAnimationsForSequenceNamedTweenDuration(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletName : Error processing arguments\");\n\t\tcobj->addDocumentOutletName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getSequences(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getSequences : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocosbuilder::CCBSequence *>& ret = cobj->getSequences();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getSequences : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getRootContainerSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getRootContainerSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getRootContainerSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getRootContainerSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setDocumentControllerName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setDocumentControllerName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setDocumentControllerName : Error processing arguments\");\n\t\tcobj->setDocumentControllerName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setDocumentControllerName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setObject(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setObject : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Object* arg0;\n\t\tcocos2d::Node* arg1;\n\t\tstd::string arg2;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setObject : Error processing arguments\");\n\t\tcobj->setObject(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setObject : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getContainerSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getContainerSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getContainerSize : Error processing arguments\");\n\t\tconst cocos2d::Size& ret = cobj->getContainerSize(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getContainerSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocosbuilder::CCBSequenceProperty* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocosbuilder::CCBSequenceProperty*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel : Error processing arguments\");\n\t\tcocos2d::Object* ret = cobj->actionForCallbackChannel(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Object>(cx, (cocos2d::Object*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueVector& ret = cobj->getDocumentOutletNames();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackControlEvents : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::EventType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackControlEvents : Error processing arguments\");\n\t\tcobj->addDocumentCallbackControlEvents(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackControlEvents : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getKeyframeCallbacks(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getKeyframeCallbacks : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueVector& ret = cobj->getKeyframeCallbacks();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getKeyframeCallbacks : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackControlEvents : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueVector& ret = cobj->getDocumentCallbackControlEvents();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackControlEvents : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setRootContainerSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setRootContainerSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setRootContainerSize : Error processing arguments\");\n\t\tcobj->setRootContainerSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setRootContainerSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration : Error processing arguments\");\n\t\tcobj->runAnimationsForSequenceIdTweenDuration(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getRunningSequenceName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getRunningSequenceName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getRunningSequenceName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getRunningSequenceName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getAutoPlaySequenceId(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getAutoPlaySequenceId : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getAutoPlaySequenceId();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getAutoPlaySequenceId : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackName : Error processing arguments\");\n\t\tcobj->addDocumentCallbackName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getRootNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getRootNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getRootNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getRootNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletNode : Error processing arguments\");\n\t\tcobj->addDocumentOutletNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setDelegate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocosbuilder::CCBAnimationManagerDelegate* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocosbuilder::CCBAnimationManagerDelegate*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setDelegate : Error processing arguments\");\n\t\tcobj->setDelegate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setDelegate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getSequenceDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getSequenceDuration : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getSequenceDuration : Error processing arguments\");\n\t\tdouble ret = cobj->getSequenceDuration(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getSequenceDuration : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackNode : Error processing arguments\");\n\t\tcobj->addDocumentCallbackNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getDelegate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocosbuilder::CCBAnimationManagerDelegate* ret = cobj->getDelegate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocosbuilder::CCBAnimationManagerDelegate>(cx, (cocosbuilder::CCBAnimationManagerDelegate*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getDelegate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamed : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamed : Error processing arguments\");\n\t\tcobj->runAnimationsForSequenceNamed(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamed : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getSequenceId(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getSequenceId : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getSequenceId : Error processing arguments\");\n\t\tint ret = cobj->getSequenceId(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getSequenceId : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setCallFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setCallFunc : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::CallFunc* arg0;\n\t\tstd::string arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::CallFunc*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setCallFunc : Error processing arguments\");\n\t\tcobj->setCallFunc(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setCallFunc : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNodes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNodes : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::Node *>& ret = cobj->getDocumentCallbackNodes();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNodes : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_setSequences(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setSequences : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Vector<cocosbuilder::CCBSequence *> arg0;\n\t\tok &= jsval_to_ccvector(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_setSequences : Error processing arguments\");\n\t\tcobj->setSequences(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_setSequences : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_debug(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_debug : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->debug();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_debug : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentControllerName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBAnimationManager* cobj = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentControllerName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getDocumentControllerName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_getDocumentControllerName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBAnimationManager_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocosbuilder::CCBAnimationManager* cobj = new cocosbuilder::CCBAnimationManager();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocosbuilder::CCBAnimationManager> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocosbuilder::CCBAnimationManager\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBAnimationManager_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocosbuilder_CCBAnimationManager_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CCBAnimationManager)\", obj);\n}\n\nvoid js_register_cocos2dx_builder_CCBAnimationManager(JSContext *cx, JSObject *global) {\n\tjsb_cocosbuilder_CCBAnimationManager_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocosbuilder_CCBAnimationManager_class->name = \"BuilderAnimationManager\";\n\tjsb_cocosbuilder_CCBAnimationManager_class->addProperty = JS_PropertyStub;\n\tjsb_cocosbuilder_CCBAnimationManager_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocosbuilder_CCBAnimationManager_class->getProperty = JS_PropertyStub;\n\tjsb_cocosbuilder_CCBAnimationManager_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocosbuilder_CCBAnimationManager_class->enumerate = JS_EnumerateStub;\n\tjsb_cocosbuilder_CCBAnimationManager_class->resolve = JS_ResolveStub;\n\tjsb_cocosbuilder_CCBAnimationManager_class->convert = JS_ConvertStub;\n\tjsb_cocosbuilder_CCBAnimationManager_class->finalize = js_cocosbuilder_CCBAnimationManager_finalize;\n\tjsb_cocosbuilder_CCBAnimationManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"moveAnimationsFromNode\", js_cocos2dx_builder_CCBAnimationManager_moveAnimationsFromNode, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAutoPlaySequenceId\", js_cocos2dx_builder_CCBAnimationManager_setAutoPlaySequenceId, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDocumentCallbackNames\", js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"actionForSoundChannel\", js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBaseValue\", js_cocos2dx_builder_CCBAnimationManager_setBaseValue, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDocumentOutletNodes\", js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLastCompletedSequenceName\", js_cocos2dx_builder_CCBAnimationManager_getLastCompletedSequenceName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRootNode\", js_cocos2dx_builder_CCBAnimationManager_setRootNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"runAnimationsForSequenceNamedTweenDuration\", js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDocumentOutletName\", js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSequences\", js_cocos2dx_builder_CCBAnimationManager_getSequences, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRootContainerSize\", js_cocos2dx_builder_CCBAnimationManager_getRootContainerSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDocumentControllerName\", js_cocos2dx_builder_CCBAnimationManager_setDocumentControllerName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setObject\", js_cocos2dx_builder_CCBAnimationManager_setObject, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContainerSize\", js_cocos2dx_builder_CCBAnimationManager_getContainerSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"actionForCallbackChannel\", js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDocumentOutletNames\", js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDocumentCallbackControlEvents\", js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackControlEvents, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_builder_CCBAnimationManager_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getKeyframeCallbacks\", js_cocos2dx_builder_CCBAnimationManager_getKeyframeCallbacks, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDocumentCallbackControlEvents\", js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackControlEvents, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRootContainerSize\", js_cocos2dx_builder_CCBAnimationManager_setRootContainerSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"runAnimationsForSequenceIdTweenDuration\", js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRunningSequenceName\", js_cocos2dx_builder_CCBAnimationManager_getRunningSequenceName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAutoPlaySequenceId\", js_cocos2dx_builder_CCBAnimationManager_getAutoPlaySequenceId, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDocumentCallbackName\", js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRootNode\", js_cocos2dx_builder_CCBAnimationManager_getRootNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDocumentOutletNode\", js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDelegate\", js_cocos2dx_builder_CCBAnimationManager_setDelegate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSequenceDuration\", js_cocos2dx_builder_CCBAnimationManager_getSequenceDuration, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDocumentCallbackNode\", js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDelegate\", js_cocos2dx_builder_CCBAnimationManager_getDelegate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"runAnimationsForSequenceNamed\", js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSequenceId\", js_cocos2dx_builder_CCBAnimationManager_getSequenceId, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCallFunc\", js_cocos2dx_builder_CCBAnimationManager_setCallFunc, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDocumentCallbackNodes\", js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSequences\", js_cocos2dx_builder_CCBAnimationManager_setSequences, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"debug\", js_cocos2dx_builder_CCBAnimationManager_debug, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDocumentControllerName\", js_cocos2dx_builder_CCBAnimationManager_getDocumentControllerName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocosbuilder_CCBAnimationManager_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocosbuilder_CCBAnimationManager_class,\n\t\tjs_cocos2dx_builder_CCBAnimationManager_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"BuilderAnimationManager\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocosbuilder::CCBAnimationManager> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocosbuilder_CCBAnimationManager_class;\n\t\tp->proto = jsb_cocosbuilder_CCBAnimationManager_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocosbuilder_CCBReader_class;\nJSObject *jsb_cocosbuilder_CCBReader_prototype;\n\nJSBool js_cocos2dx_builder_CCBReader_getAnimationManager(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getAnimationManager : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocosbuilder::CCBAnimationManager* ret = cobj->getAnimationManager();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocosbuilder::CCBAnimationManager>(cx, (cocosbuilder::CCBAnimationManager*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getAnimationManager : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_setAnimationManager(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_setAnimationManager : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocosbuilder::CCBAnimationManager* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocosbuilder::CCBAnimationManager*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_setAnimationManager : Error processing arguments\");\n\t\tcobj->setAnimationManager(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_setAnimationManager : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_addOwnerOutletName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addOwnerOutletName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addOwnerOutletName : Error processing arguments\");\n\t\tcobj->addOwnerOutletName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_addOwnerOutletName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getOwnerCallbackNames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getOwnerCallbackNames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueVector ret = cobj->getOwnerCallbackNames();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getOwnerCallbackNames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_addDocumentCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addDocumentCallbackControlEvents : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::EventType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addDocumentCallbackControlEvents : Error processing arguments\");\n\t\tcobj->addDocumentCallbackControlEvents(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_addDocumentCallbackControlEvents : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_setCCBRootPath(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_setCCBRootPath : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_setCCBRootPath : Error processing arguments\");\n\t\tcobj->setCCBRootPath(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_setCCBRootPath : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_addOwnerOutletNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addOwnerOutletNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addOwnerOutletNode : Error processing arguments\");\n\t\tcobj->addOwnerOutletNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_addOwnerOutletNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getOwnerCallbackNodes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getOwnerCallbackNodes : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::Node *>& ret = cobj->getOwnerCallbackNodes();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getOwnerCallbackNodes : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_readSoundKeyframesForSeq(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_readSoundKeyframesForSeq : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocosbuilder::CCBSequence* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocosbuilder::CCBSequence*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_readSoundKeyframesForSeq : Error processing arguments\");\n\t\tJSBool ret = cobj->readSoundKeyframesForSeq(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_readSoundKeyframesForSeq : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getCCBRootPath(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getCCBRootPath : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getCCBRootPath();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getCCBRootPath : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getOwnerCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getOwnerCallbackControlEvents : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueVector& ret = cobj->getOwnerCallbackControlEvents();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getOwnerCallbackControlEvents : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getOwnerOutletNodes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getOwnerOutletNodes : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::Node *>& ret = cobj->getOwnerOutletNodes();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getOwnerOutletNodes : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_readUTF8(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_readUTF8 : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->readUTF8();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_readUTF8 : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_addOwnerCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addOwnerCallbackControlEvents : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::EventType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_addOwnerCallbackControlEvents : Error processing arguments\");\n\t\tcobj->addOwnerCallbackControlEvents(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_addOwnerCallbackControlEvents : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getOwnerOutletNames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getOwnerOutletNames : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ValueVector ret = cobj->getOwnerOutletNames();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvaluevector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getOwnerOutletNames : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_readCallbackKeyframesForSeq(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_readCallbackKeyframesForSeq : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocosbuilder::CCBSequence* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocosbuilder::CCBSequence*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_readCallbackKeyframesForSeq : Error processing arguments\");\n\t\tJSBool ret = cobj->readCallbackKeyframesForSeq(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_readCallbackKeyframesForSeq : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getAnimationManagersForNodes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getAnimationManagersForNodes : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocosbuilder::CCBAnimationManager *>& ret = cobj->getAnimationManagersForNodes();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getAnimationManagersForNodes : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_getNodesWithAnimationManagers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocosbuilder::CCBReader* cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_getNodesWithAnimationManagers : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::Node *>& ret = cobj->getNodesWithAnimationManagers();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_getNodesWithAnimationManagers : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_builder_CCBReader_setResolutionScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_builder_CCBReader_setResolutionScale : Error processing arguments\");\n\t\tcocosbuilder::CCBReader::setResolutionScale(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_setResolutionScale : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocosbuilder::CCBReader* cobj = NULL;\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocosbuilder::CCBReader* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocosbuilder::CCBReader*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new cocosbuilder::CCBReader(arg0);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<cocosbuilder::CCBReader> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"cocosbuilder::CCBReader\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocosbuilder::NodeLoaderLibrary* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new cocosbuilder::CCBReader(arg0);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<cocosbuilder::CCBReader> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"cocosbuilder::CCBReader\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocosbuilder::NodeLoaderLibrary* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocosbuilder::CCBMemberVariableAssigner* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocosbuilder::CCBMemberVariableAssigner*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new cocosbuilder::CCBReader(arg0, arg1);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<cocosbuilder::CCBReader> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"cocosbuilder::CCBReader\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocosbuilder::NodeLoaderLibrary* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocosbuilder::CCBMemberVariableAssigner* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocosbuilder::CCBMemberVariableAssigner*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocosbuilder::CCBSelectorResolver* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocosbuilder::CCBSelectorResolver*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new cocosbuilder::CCBReader(arg0, arg1, arg2);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<cocosbuilder::CCBReader> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"cocosbuilder::CCBReader\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocosbuilder::NodeLoaderLibrary* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocosbuilder::CCBMemberVariableAssigner* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocosbuilder::CCBMemberVariableAssigner*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocosbuilder::CCBSelectorResolver* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocosbuilder::CCBSelectorResolver*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocosbuilder::NodeLoaderListener* arg3;\n\t\t\tdo {\n\t\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ3 = (cocosbuilder::NodeLoaderListener*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new cocosbuilder::CCBReader(arg0, arg1, arg2, arg3);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<cocosbuilder::CCBReader> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"cocosbuilder::CCBReader\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcobj = new cocosbuilder::CCBReader();\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<cocosbuilder::CCBReader> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"cocosbuilder::CCBReader\");\n\t\t}\n\t} while(0);\n\n\tif (cobj) {\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_builder_CCBReader_constructor : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocosbuilder_CCBReader_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CCBReader)\", obj);\n}\n\nvoid js_register_cocos2dx_builder_CCBReader(JSContext *cx, JSObject *global) {\n\tjsb_cocosbuilder_CCBReader_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocosbuilder_CCBReader_class->name = \"_Reader\";\n\tjsb_cocosbuilder_CCBReader_class->addProperty = JS_PropertyStub;\n\tjsb_cocosbuilder_CCBReader_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocosbuilder_CCBReader_class->getProperty = JS_PropertyStub;\n\tjsb_cocosbuilder_CCBReader_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocosbuilder_CCBReader_class->enumerate = JS_EnumerateStub;\n\tjsb_cocosbuilder_CCBReader_class->resolve = JS_ResolveStub;\n\tjsb_cocosbuilder_CCBReader_class->convert = JS_ConvertStub;\n\tjsb_cocosbuilder_CCBReader_class->finalize = js_cocosbuilder_CCBReader_finalize;\n\tjsb_cocosbuilder_CCBReader_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnimationManager\", js_cocos2dx_builder_CCBReader_getAnimationManager, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimationManager\", js_cocos2dx_builder_CCBReader_setAnimationManager, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addOwnerOutletName\", js_cocos2dx_builder_CCBReader_addOwnerOutletName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOwnerCallbackNames\", js_cocos2dx_builder_CCBReader_getOwnerCallbackNames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDocumentCallbackControlEvents\", js_cocos2dx_builder_CCBReader_addDocumentCallbackControlEvents, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCCBRootPath\", js_cocos2dx_builder_CCBReader_setCCBRootPath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addOwnerOutletNode\", js_cocos2dx_builder_CCBReader_addOwnerOutletNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOwnerCallbackNodes\", js_cocos2dx_builder_CCBReader_getOwnerCallbackNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"readSoundKeyframesForSeq\", js_cocos2dx_builder_CCBReader_readSoundKeyframesForSeq, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCCBRootPath\", js_cocos2dx_builder_CCBReader_getCCBRootPath, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOwnerCallbackControlEvents\", js_cocos2dx_builder_CCBReader_getOwnerCallbackControlEvents, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOwnerOutletNodes\", js_cocos2dx_builder_CCBReader_getOwnerOutletNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"readUTF8\", js_cocos2dx_builder_CCBReader_readUTF8, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addOwnerCallbackControlEvents\", js_cocos2dx_builder_CCBReader_addOwnerCallbackControlEvents, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOwnerOutletNames\", js_cocos2dx_builder_CCBReader_getOwnerOutletNames, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"readCallbackKeyframesForSeq\", js_cocos2dx_builder_CCBReader_readCallbackKeyframesForSeq, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnimationManagersForNodes\", js_cocos2dx_builder_CCBReader_getAnimationManagersForNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodesWithAnimationManagers\", js_cocos2dx_builder_CCBReader_getNodesWithAnimationManagers, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"setResolutionScale\", js_cocos2dx_builder_CCBReader_setResolutionScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocosbuilder_CCBReader_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocosbuilder_CCBReader_class,\n\t\tjs_cocos2dx_builder_CCBReader_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"_Reader\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocosbuilder::CCBReader> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocosbuilder_CCBReader_class;\n\t\tp->proto = jsb_cocosbuilder_CCBReader_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nvoid register_all_cocos2dx_builder(JSContext* cx, JSObject* obj) {\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"cc\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"cc\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n\tjs_register_cocos2dx_builder_CCBAnimationManager(cx, obj);\n\tjs_register_cocos2dx_builder_CCBReader(cx, obj);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_builder_auto.hpp",
    "content": "#ifndef __cocos2dx_builder_h__\n#define __cocos2dx_builder_h__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n\nextern JSClass  *jsb_cocosbuilder_CCBAnimationManager_class;\nextern JSObject *jsb_cocosbuilder_CCBAnimationManager_prototype;\n\nJSBool js_cocos2dx_builder_CCBAnimationManager_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_builder_CCBAnimationManager_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_builder_CCBAnimationManager(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_builder(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_builder_CCBAnimationManager_moveAnimationsFromNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setAutoPlaySequenceId(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_actionForSoundChannel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setBaseValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNodes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getLastCompletedSequenceName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setRootNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getSequences(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getRootContainerSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setDocumentControllerName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setObject(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getContainerSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_actionForCallbackChannel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentOutletNames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getKeyframeCallbacks(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setRootContainerSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getRunningSequenceName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getAutoPlaySequenceId(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getRootNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentOutletNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setDelegate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getSequenceDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_addDocumentCallbackNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDelegate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_runAnimationsForSequenceNamed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getSequenceId(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setCallFunc(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentCallbackNodes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_setSequences(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_debug(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_getDocumentControllerName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBAnimationManager_CCBAnimationManager(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocosbuilder_CCBReader_class;\nextern JSObject *jsb_cocosbuilder_CCBReader_prototype;\n\nJSBool js_cocos2dx_builder_CCBReader_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_builder_CCBReader_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_builder_CCBReader(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_builder(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_builder_CCBReader_getAnimationManager(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_setAnimationManager(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_addOwnerOutletName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getOwnerCallbackNames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_addDocumentCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_setCCBRootPath(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_addOwnerOutletNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getOwnerCallbackNodes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_readSoundKeyframesForSeq(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getCCBRootPath(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getOwnerCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getOwnerOutletNodes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_readUTF8(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_addOwnerCallbackControlEvents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getOwnerOutletNames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_readCallbackKeyframesForSeq(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getAnimationManagersForNodes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_getNodesWithAnimationManagers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_setResolutionScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_builder_CCBReader_CCBReader(JSContext *cx, uint32_t argc, jsval *vp);\n#endif\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_builder_auto_api.js",
    "content": "/**\n * @module cocos2dx_builder\n */\nvar cc = cc || {};\n\n/**\n * @class CCBAnimationManager\n */\ncc.BuilderAnimationManager = {\n\n/**\n * @method moveAnimationsFromNode\n * @param {cocos2d::Node*}\n * @param {cocos2d::Node*}\n */\nmoveAnimationsFromNode : function () {},\n\n/**\n * @method setAutoPlaySequenceId\n * @param {int}\n */\nsetAutoPlaySequenceId : function () {},\n\n/**\n * @method getDocumentCallbackNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetDocumentCallbackNames : function () {},\n\n/**\n * @method actionForSoundChannel\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n * @param {cocosbuilder::CCBSequenceProperty*}\n */\nactionForSoundChannel : function () {},\n\n/**\n * @method setBaseValue\n * @param {const cocos2d::Value&}\n * @param {cocos2d::Node*}\n * @param {const std::string&}\n */\nsetBaseValue : function () {},\n\n/**\n * @method getDocumentOutletNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetDocumentOutletNodes : function () {},\n\n/**\n * @method getLastCompletedSequenceName\n * @return A value converted from C/C++ \"std::string\"\n */\ngetLastCompletedSequenceName : function () {},\n\n/**\n * @method setRootNode\n * @param {cocos2d::Node*}\n */\nsetRootNode : function () {},\n\n/**\n * @method runAnimationsForSequenceNamedTweenDuration\n * @param {const char*}\n * @param {float}\n */\nrunAnimationsForSequenceNamedTweenDuration : function () {},\n\n/**\n * @method addDocumentOutletName\n * @param {std::string}\n */\naddDocumentOutletName : function () {},\n\n/**\n * @method getSequences\n * @return A value converted from C/C++ \"cocos2d::Vector<cocosbuilder::CCBSequence *>&\"\n */\ngetSequences : function () {},\n\n/**\n * @method getRootContainerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetRootContainerSize : function () {},\n\n/**\n * @method setDocumentControllerName\n * @param {const std::string&}\n */\nsetDocumentControllerName : function () {},\n\n/**\n * @method setObject\n * @param {cocos2d::Object*}\n * @param {cocos2d::Node*}\n * @param {const std::string&}\n */\nsetObject : function () {},\n\n/**\n * @method getContainerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n * @param {cocos2d::Node*}\n */\ngetContainerSize : function () {},\n\n/**\n * @method actionForCallbackChannel\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n * @param {cocosbuilder::CCBSequenceProperty*}\n */\nactionForCallbackChannel : function () {},\n\n/**\n * @method getDocumentOutletNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetDocumentOutletNames : function () {},\n\n/**\n * @method addDocumentCallbackControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\naddDocumentCallbackControlEvents : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method getKeyframeCallbacks\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetKeyframeCallbacks : function () {},\n\n/**\n * @method getDocumentCallbackControlEvents\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetDocumentCallbackControlEvents : function () {},\n\n/**\n * @method setRootContainerSize\n * @param {const cocos2d::Size&}\n */\nsetRootContainerSize : function () {},\n\n/**\n * @method runAnimationsForSequenceIdTweenDuration\n * @param {int}\n * @param {float}\n */\nrunAnimationsForSequenceIdTweenDuration : function () {},\n\n/**\n * @method getRunningSequenceName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetRunningSequenceName : function () {},\n\n/**\n * @method getAutoPlaySequenceId\n * @return A value converted from C/C++ \"int\"\n */\ngetAutoPlaySequenceId : function () {},\n\n/**\n * @method addDocumentCallbackName\n * @param {std::string}\n */\naddDocumentCallbackName : function () {},\n\n/**\n * @method getRootNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetRootNode : function () {},\n\n/**\n * @method addDocumentOutletNode\n * @param {cocos2d::Node*}\n */\naddDocumentOutletNode : function () {},\n\n/**\n * @method setDelegate\n * @param {cocosbuilder::CCBAnimationManagerDelegate*}\n */\nsetDelegate : function () {},\n\n/**\n * @method getSequenceDuration\n * @return A value converted from C/C++ \"float\"\n * @param {const char*}\n */\ngetSequenceDuration : function () {},\n\n/**\n * @method addDocumentCallbackNode\n * @param {cocos2d::Node*}\n */\naddDocumentCallbackNode : function () {},\n\n/**\n * @method getDelegate\n * @return A value converted from C/C++ \"cocosbuilder::CCBAnimationManagerDelegate*\"\n */\ngetDelegate : function () {},\n\n/**\n * @method runAnimationsForSequenceNamed\n * @param {const char*}\n */\nrunAnimationsForSequenceNamed : function () {},\n\n/**\n * @method getSequenceId\n * @return A value converted from C/C++ \"int\"\n * @param {const char*}\n */\ngetSequenceId : function () {},\n\n/**\n * @method setCallFunc\n * @param {cocos2d::CallFunc*}\n * @param {const std::string&}\n */\nsetCallFunc : function () {},\n\n/**\n * @method getDocumentCallbackNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetDocumentCallbackNodes : function () {},\n\n/**\n * @method setSequences\n * @param {const cocos2d::Vector<cocosbuilder::CCBSequence *>&}\n */\nsetSequences : function () {},\n\n/**\n * @method debug\n */\ndebug : function () {},\n\n/**\n * @method getDocumentControllerName\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDocumentControllerName : function () {},\n\n/**\n * @method CCBAnimationManager\n * @constructor\n */\nCCBAnimationManager : function () {},\n\n};\n\n/**\n * @class CCBReader\n */\ncc._Reader = {\n\n/**\n * @method getAnimationManager\n * @return A value converted from C/C++ \"cocosbuilder::CCBAnimationManager*\"\n */\ngetAnimationManager : function () {},\n\n/**\n * @method setAnimationManager\n * @param {cocosbuilder::CCBAnimationManager*}\n */\nsetAnimationManager : function () {},\n\n/**\n * @method addOwnerOutletName\n * @param {std::string}\n */\naddOwnerOutletName : function () {},\n\n/**\n * @method getOwnerCallbackNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector\"\n */\ngetOwnerCallbackNames : function () {},\n\n/**\n * @method addDocumentCallbackControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\naddDocumentCallbackControlEvents : function () {},\n\n/**\n * @method setCCBRootPath\n * @param {const char*}\n */\nsetCCBRootPath : function () {},\n\n/**\n * @method addOwnerOutletNode\n * @param {cocos2d::Node*}\n */\naddOwnerOutletNode : function () {},\n\n/**\n * @method getOwnerCallbackNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetOwnerCallbackNodes : function () {},\n\n/**\n * @method readSoundKeyframesForSeq\n * @return A value converted from C/C++ \"bool\"\n * @param {cocosbuilder::CCBSequence*}\n */\nreadSoundKeyframesForSeq : function () {},\n\n/**\n * @method getCCBRootPath\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetCCBRootPath : function () {},\n\n/**\n * @method getOwnerCallbackControlEvents\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetOwnerCallbackControlEvents : function () {},\n\n/**\n * @method getOwnerOutletNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetOwnerOutletNodes : function () {},\n\n/**\n * @method readUTF8\n * @return A value converted from C/C++ \"std::string\"\n */\nreadUTF8 : function () {},\n\n/**\n * @method addOwnerCallbackControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\naddOwnerCallbackControlEvents : function () {},\n\n/**\n * @method getOwnerOutletNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector\"\n */\ngetOwnerOutletNames : function () {},\n\n/**\n * @method readCallbackKeyframesForSeq\n * @return A value converted from C/C++ \"bool\"\n * @param {cocosbuilder::CCBSequence*}\n */\nreadCallbackKeyframesForSeq : function () {},\n\n/**\n * @method getAnimationManagersForNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocosbuilder::CCBAnimationManager *>&\"\n */\ngetAnimationManagersForNodes : function () {},\n\n/**\n * @method getNodesWithAnimationManagers\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetNodesWithAnimationManagers : function () {},\n\n/**\n * @method setResolutionScale\n * @param {float}\n */\nsetResolutionScale : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_extension_auto.cpp",
    "content": "#include \"jsb_cocos2dx_extension_auto.hpp\"\n#include \"cocos2d_specifics.hpp\"\n#include \"cocos-ext.h\"\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n    JSObject* global = ScriptingCore::getInstance()->getGlobalObject();\n\tisNewValid = JS_GetProperty(cx, global, \"initializing\", &initializing) && JSVAL_TO_BOOLEAN(initializing);\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n    JS_ReportError(cx, \"Don't use `new cc.XXX`, please use `cc.XXX.create` instead! \");\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_is_native_obj(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n\tvp.set(BOOLEAN_TO_JSVAL(JS_TRUE));\n\treturn JS_TRUE;\t\n}\nJSClass  *jsb_cocos2d_extension_Scale9Sprite_class;\nJSObject *jsb_cocos2d_extension_Scale9Sprite_prototype;\n\nJSBool js_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets : Error processing arguments\");\n\t\tcocos2d::extension::Scale9Sprite* ret = cobj->resizableSpriteWithCapInsets(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetBottom(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetBottom : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetBottom : Error processing arguments\");\n\t\tcobj->setInsetBottom(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_setInsetBottom : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::Scale9Sprite* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSpriteFrameName(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSpriteFrameName(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetTop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetTop : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetTop : Error processing arguments\");\n\t\tcobj->setInsetTop(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_setInsetTop : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_setPreferredSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setPreferredSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setPreferredSize : Error processing arguments\");\n\t\tcobj->setPreferredSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_setPreferredSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_setSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setSpriteFrame : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setSpriteFrame : Error processing arguments\");\n\t\tcobj->setSpriteFrame(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_setSpriteFrame : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::Scale9Sprite* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_initWithBatchNode : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::SpriteBatchNode* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::SpriteBatchNode*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg2;\n\t\t\tok &= jsval_to_ccrect(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithBatchNode(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocos2d::SpriteBatchNode* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::SpriteBatchNode*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg2;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg3;\n\t\t\tok &= jsval_to_ccrect(cx, argv[3], &arg3);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithBatchNode(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_initWithBatchNode : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetBottom(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_getInsetBottom : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getInsetBottom();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_getInsetBottom : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_getCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_getCapInsets : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Rect ret = cobj->getCapInsets();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_getCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_updateWithBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_updateWithBatchNode : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tcocos2d::SpriteBatchNode* arg0;\n\t\tcocos2d::Rect arg1;\n\t\tJSBool arg2;\n\t\tcocos2d::Rect arg3;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteBatchNode*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tok &= jsval_to_ccrect(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_updateWithBatchNode : Error processing arguments\");\n\t\tJSBool ret = cobj->updateWithBatchNode(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_updateWithBatchNode : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_getInsetRight : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getInsetRight();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_getInsetRight : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_getOriginalSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_getOriginalSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getOriginalSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_getOriginalSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::Scale9Sprite* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_initWithFile : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg2;\n\t\t\tok &= jsval_to_ccrect(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithFile(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Rect arg0;\n\t\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithFile(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_initWithFile : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetTop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_getInsetTop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getInsetTop();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_getInsetTop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetLeft : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetLeft : Error processing arguments\");\n\t\tcobj->setInsetLeft(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_setInsetLeft : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::Scale9Sprite* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::SpriteFrame* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSpriteFrame(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::SpriteFrame* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSpriteFrame(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_getPreferredSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_getPreferredSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getPreferredSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_getPreferredSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setCapInsets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setCapInsets : Error processing arguments\");\n\t\tcobj->setCapInsets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_setCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_getInsetLeft : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getInsetLeft();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_getInsetLeft : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Scale9Sprite* cobj = (cocos2d::extension::Scale9Sprite *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetRight : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Scale9Sprite_setInsetRight : Error processing arguments\");\n\t\tcobj->setInsetRight(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_setInsetRight : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg2;\n\t\t\tok &= jsval_to_ccrect(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Rect arg0;\n\t\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrameName(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrameName(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::SpriteFrame* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Rect arg1;\n\t\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrame(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::SpriteFrame* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrame(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Scale9Sprite_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::Scale9Sprite* cobj = new cocos2d::extension::Scale9Sprite();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::Scale9Sprite> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::Scale9Sprite\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Scale9Sprite_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_extension_Scale9Sprite_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Scale9Sprite)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_Scale9Sprite(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_Scale9Sprite_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_Scale9Sprite_class->name = \"Scale9Sprite\";\n\tjsb_cocos2d_extension_Scale9Sprite_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_Scale9Sprite_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_Scale9Sprite_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_Scale9Sprite_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_Scale9Sprite_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_Scale9Sprite_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_Scale9Sprite_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_Scale9Sprite_class->finalize = js_cocos2d_extension_Scale9Sprite_finalize;\n\tjsb_cocos2d_extension_Scale9Sprite_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"resizableSpriteWithCapInsets\", js_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInsetBottom\", js_cocos2dx_extension_Scale9Sprite_setInsetBottom, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithSpriteFrameName\", js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInsetTop\", js_cocos2dx_extension_Scale9Sprite_setInsetTop, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_extension_Scale9Sprite_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPreferredSize\", js_cocos2dx_extension_Scale9Sprite_setPreferredSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSpriteFrame\", js_cocos2dx_extension_Scale9Sprite_setSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithBatchNode\", js_cocos2dx_extension_Scale9Sprite_initWithBatchNode, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInsetBottom\", js_cocos2dx_extension_Scale9Sprite_getInsetBottom, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCapInsets\", js_cocos2dx_extension_Scale9Sprite_getCapInsets, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateWithBatchNode\", js_cocos2dx_extension_Scale9Sprite_updateWithBatchNode, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInsetRight\", js_cocos2dx_extension_Scale9Sprite_getInsetRight, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOriginalSize\", js_cocos2dx_extension_Scale9Sprite_getOriginalSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithFile\", js_cocos2dx_extension_Scale9Sprite_initWithFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInsetTop\", js_cocos2dx_extension_Scale9Sprite_getInsetTop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInsetLeft\", js_cocos2dx_extension_Scale9Sprite_setInsetLeft, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithSpriteFrame\", js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPreferredSize\", js_cocos2dx_extension_Scale9Sprite_getPreferredSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsets\", js_cocos2dx_extension_Scale9Sprite_setCapInsets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInsetLeft\", js_cocos2dx_extension_Scale9Sprite_getInsetLeft, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInsetRight\", js_cocos2dx_extension_Scale9Sprite_setInsetRight, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_Scale9Sprite_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithSpriteFrameName\", js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithSpriteFrame\", js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_Scale9Sprite_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_extension_Scale9Sprite_class,\n\t\tjs_cocos2dx_extension_Scale9Sprite_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Scale9Sprite\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::Scale9Sprite> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_Scale9Sprite_class;\n\t\tp->proto = jsb_cocos2d_extension_Scale9Sprite_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_Control_class;\nJSObject *jsb_cocos2d_extension_Control_prototype;\n\nJSBool js_cocos2dx_extension_Control_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Control_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_getState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_getState : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getState();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_getState : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_sendActionsForControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_sendActionsForControlEvents : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::EventType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Control_sendActionsForControlEvents : Error processing arguments\");\n\t\tcobj->sendActionsForControlEvents(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_sendActionsForControlEvents : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_setSelected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_setSelected : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Control_setSelected : Error processing arguments\");\n\t\tcobj->setSelected(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_setSelected : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_isEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_isEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_isEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_needsLayout(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_needsLayout : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->needsLayout();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_needsLayout : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_hasVisibleParents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_hasVisibleParents : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->hasVisibleParents();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_hasVisibleParents : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_isSelected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_isSelected : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isSelected();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_isSelected : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_isTouchInside(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_isTouchInside : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Touch*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Control_isTouchInside : Error processing arguments\");\n\t\tJSBool ret = cobj->isTouchInside(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_isTouchInside : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_setHighlighted(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_setHighlighted : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Control_setHighlighted : Error processing arguments\");\n\t\tcobj->setHighlighted(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_setHighlighted : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_getTouchLocation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_getTouchLocation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Touch*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_Control_getTouchLocation : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->getTouchLocation(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_getTouchLocation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_isHighlighted(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_Control_isHighlighted : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isHighlighted();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_isHighlighted : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_Control_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::Control* ret = cocos2d::extension::Control::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Control>(cx, (cocos2d::extension::Control*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_Control_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Layer_prototype;\n\nvoid js_cocos2d_extension_Control_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Control)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_Control(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_Control_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_Control_class->name = \"Control\";\n\tjsb_cocos2d_extension_Control_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_Control_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_Control_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_Control_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_Control_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_Control_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_Control_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_Control_class->finalize = js_cocos2d_extension_Control_finalize;\n\tjsb_cocos2d_extension_Control_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_extension_Control_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getState\", js_cocos2dx_extension_Control_getState, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"sendActionsForControlEvents\", js_cocos2dx_extension_Control_sendActionsForControlEvents, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSelected\", js_cocos2dx_extension_Control_setSelected, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isEnabled\", js_cocos2dx_extension_Control_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"needsLayout\", js_cocos2dx_extension_Control_needsLayout, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hasVisibleParents\", js_cocos2dx_extension_Control_hasVisibleParents, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isSelected\", js_cocos2dx_extension_Control_isSelected, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTouchInside\", js_cocos2dx_extension_Control_isTouchInside, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setHighlighted\", js_cocos2dx_extension_Control_setHighlighted, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTouchLocation\", js_cocos2dx_extension_Control_getTouchLocation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isHighlighted\", js_cocos2dx_extension_Control_isHighlighted, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_Control_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_Control_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Layer_prototype,\n\t\tjsb_cocos2d_extension_Control_class,\n\t\tdummy_constructor<cocos2d::extension::Control>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Control\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::Control> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_Control_class;\n\t\tp->proto = jsb_cocos2d_extension_Control_prototype;\n\t\tp->parentProto = jsb_cocos2d_Layer_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlButton_class;\nJSObject *jsb_cocos2d_extension_ControlButton_prototype;\n\nJSBool js_cocos2dx_extension_ControlButton_isPushed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_isPushed : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isPushed();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_isPushed : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setSelected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setSelected : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setSelected : Error processing arguments\");\n\t\tcobj->setSelected(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setSelected : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setTitleLabelForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleLabelForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleLabelForState : Error processing arguments\");\n\t\tcobj->setTitleLabelForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setTitleLabelForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage : Error processing arguments\");\n\t\tcobj->setAdjustBackgroundImage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setHighlighted(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setHighlighted : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setHighlighted : Error processing arguments\");\n\t\tcobj->setHighlighted(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setHighlighted : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setZoomOnTouchDown(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setZoomOnTouchDown : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setZoomOnTouchDown : Error processing arguments\");\n\t\tcobj->setZoomOnTouchDown(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setZoomOnTouchDown : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setTitleForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleForState : Error processing arguments\");\n\t\tcobj->setTitleForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setTitleForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setLabelAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setLabelAnchorPoint : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setLabelAnchorPoint : Error processing arguments\");\n\t\tcobj->setLabelAnchorPoint(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setLabelAnchorPoint : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getLabelAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getLabelAnchorPoint : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getLabelAnchorPoint();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getLabelAnchorPoint : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::State arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState : Error processing arguments\");\n\t\tdouble ret = cobj->getTitleTTFSizeForState(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setTitleTTFForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleTTFForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleTTFForState : Error processing arguments\");\n\t\tcobj->setTitleTTFForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setTitleTTFForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState : Error processing arguments\");\n\t\tcobj->setTitleTTFSizeForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setTitleLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleLabel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleLabel : Error processing arguments\");\n\t\tcobj->setTitleLabel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setTitleLabel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setPreferredSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setPreferredSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setPreferredSize : Error processing arguments\");\n\t\tcobj->setPreferredSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setPreferredSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getCurrentTitleColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getCurrentTitleColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getCurrentTitleColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getCurrentTitleColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::State arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState : Error processing arguments\");\n\t\tcocos2d::extension::Scale9Sprite* ret = cobj->getBackgroundSpriteForState(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getHorizontalOrigin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getHorizontalOrigin : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getHorizontalOrigin();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getHorizontalOrigin : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_needsLayout(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_needsLayout : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->needsLayout();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_needsLayout : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getCurrentTitle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::ControlButton* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getCurrentTitle : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tstd::string ret = cobj->getCurrentTitle();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = std_string_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tconst std::string& ret = cobj->getCurrentTitle();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = std_string_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getCurrentTitle : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getScaleRatio(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getScaleRatio : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getScaleRatio();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getScaleRatio : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getTitleTTFForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleTTFForState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::State arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleTTFForState : Error processing arguments\");\n\t\tconst std::string& ret = cobj->getTitleTTFForState(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getTitleTTFForState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getBackgroundSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::extension::Scale9Sprite* ret = cobj->getBackgroundSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::Scale9Sprite>(cx, (cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getBackgroundSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getTitleColorForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleColorForState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::State arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleColorForState : Error processing arguments\");\n\t\tcocos2d::Color3B ret = cobj->getTitleColorForState(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getTitleColorForState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setTitleColorForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleColorForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Color3B arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleColorForState : Error processing arguments\");\n\t\tcobj->setTitleColorForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setTitleColorForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->doesAdjustBackgroundImage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::SpriteFrame* arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState : Error processing arguments\");\n\t\tcobj->setBackgroundSpriteFrameForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::extension::Scale9Sprite* arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState : Error processing arguments\");\n\t\tcobj->setBackgroundSpriteForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setScaleRatio(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setScaleRatio : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setScaleRatio : Error processing arguments\");\n\t\tcobj->setScaleRatio(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setScaleRatio : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setBackgroundSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Scale9Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setBackgroundSprite : Error processing arguments\");\n\t\tcobj->setBackgroundSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setBackgroundSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getTitleLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleLabel : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getTitleLabel();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getTitleLabel : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getPreferredSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getPreferredSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getPreferredSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getPreferredSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getVerticalMargin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getVerticalMargin : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getVerticalMargin();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getVerticalMargin : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getTitleLabelForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleLabelForState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::State arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleLabelForState : Error processing arguments\");\n\t\tcocos2d::Node* ret = cobj->getTitleLabelForState(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getTitleLabelForState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setMargins(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setMargins : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setMargins : Error processing arguments\");\n\t\tcobj->setMargins(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setMargins : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_setTitleBMFontForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleBMFontForState : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocos2d::extension::Control::State arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_setTitleBMFontForState : Error processing arguments\");\n\t\tcobj->setTitleBMFontForState(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_setTitleBMFontForState : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getTitleBMFontForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleBMFontForState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::State arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleBMFontForState : Error processing arguments\");\n\t\tconst std::string& ret = cobj->getTitleBMFontForState(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getTitleBMFontForState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getZoomOnTouchDown(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getZoomOnTouchDown : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getZoomOnTouchDown();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getZoomOnTouchDown : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_getTitleForState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlButton* cobj = (cocos2d::extension::ControlButton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleForState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::Control::State arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlButton_getTitleForState : Error processing arguments\");\n\t\tstd::string ret = cobj->getTitleForState(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_getTitleForState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::extension::Scale9Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlButton>(cx, (cocos2d::extension::ControlButton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlButton>(cx, (cocos2d::extension::ControlButton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::Scale9Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlButton>(cx, (cocos2d::extension::ControlButton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlButton>(cx, (cocos2d::extension::ControlButton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlButton_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlButton_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlButton)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlButton(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlButton_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlButton_class->name = \"ControlButton\";\n\tjsb_cocos2d_extension_ControlButton_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlButton_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlButton_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlButton_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlButton_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlButton_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlButton_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlButton_class->finalize = js_cocos2d_extension_ControlButton_finalize;\n\tjsb_cocos2d_extension_ControlButton_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"isPushed\", js_cocos2dx_extension_ControlButton_isPushed, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSelected\", js_cocos2dx_extension_ControlButton_setSelected, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleLabelForState\", js_cocos2dx_extension_ControlButton_setTitleLabelForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAdjustBackgroundImage\", js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setHighlighted\", js_cocos2dx_extension_ControlButton_setHighlighted, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setZoomOnTouchDown\", js_cocos2dx_extension_ControlButton_setZoomOnTouchDown, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleForState\", js_cocos2dx_extension_ControlButton_setTitleForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLabelAnchorPoint\", js_cocos2dx_extension_ControlButton_setLabelAnchorPoint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLabelAnchorPoint\", js_cocos2dx_extension_ControlButton_getLabelAnchorPoint, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleTTFSizeForState\", js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleTTFForState\", js_cocos2dx_extension_ControlButton_setTitleTTFForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleTTFSizeForState\", js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleLabel\", js_cocos2dx_extension_ControlButton_setTitleLabel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPreferredSize\", js_cocos2dx_extension_ControlButton_setPreferredSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentTitleColor\", js_cocos2dx_extension_ControlButton_getCurrentTitleColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_extension_ControlButton_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackgroundSpriteForState\", js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getHorizontalOrigin\", js_cocos2dx_extension_ControlButton_getHorizontalOrigin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"needsLayout\", js_cocos2dx_extension_ControlButton_needsLayout, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentTitle\", js_cocos2dx_extension_ControlButton_getCurrentTitle, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getScaleRatio\", js_cocos2dx_extension_ControlButton_getScaleRatio, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleTTFForState\", js_cocos2dx_extension_ControlButton_getTitleTTFForState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackgroundSprite\", js_cocos2dx_extension_ControlButton_getBackgroundSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleColorForState\", js_cocos2dx_extension_ControlButton_getTitleColorForState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleColorForState\", js_cocos2dx_extension_ControlButton_setTitleColorForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"doesAdjustBackgroundImage\", js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackgroundSpriteFrameForState\", js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackgroundSpriteForState\", js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScaleRatio\", js_cocos2dx_extension_ControlButton_setScaleRatio, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackgroundSprite\", js_cocos2dx_extension_ControlButton_setBackgroundSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleLabel\", js_cocos2dx_extension_ControlButton_getTitleLabel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPreferredSize\", js_cocos2dx_extension_ControlButton_getPreferredSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVerticalMargin\", js_cocos2dx_extension_ControlButton_getVerticalMargin, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleLabelForState\", js_cocos2dx_extension_ControlButton_getTitleLabelForState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMargins\", js_cocos2dx_extension_ControlButton_setMargins, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleBMFontForState\", js_cocos2dx_extension_ControlButton_setTitleBMFontForState, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleBMFontForState\", js_cocos2dx_extension_ControlButton_getTitleBMFontForState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getZoomOnTouchDown\", js_cocos2dx_extension_ControlButton_getZoomOnTouchDown, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleForState\", js_cocos2dx_extension_ControlButton_getTitleForState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlButton_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlButton_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlButton_class,\n\t\tdummy_constructor<cocos2d::extension::ControlButton>, 0, // no constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlButton\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlButton> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlButton_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlButton_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlHuePicker_class;\nJSObject *jsb_cocos2d_extension_ControlHuePicker_prototype;\n\nJSBool js_cocos2dx_extension_ControlHuePicker_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::Point arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithTargetAndPos(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_setHue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setHue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setHue : Error processing arguments\");\n\t\tcobj->setHue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_setHue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_getStartPos(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_getStartPos : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getStartPos();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_getStartPos : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_getHue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_getHue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getHue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_getHue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_getSlider(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_getSlider : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getSlider();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_getSlider : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_setBackground(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setBackground : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setBackground : Error processing arguments\");\n\t\tcobj->setBackground(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_setBackground : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_setHuePercentage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setHuePercentage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setHuePercentage : Error processing arguments\");\n\t\tcobj->setHuePercentage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_setHuePercentage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_getBackground : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getBackground();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_getBackground : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_getHuePercentage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_getHuePercentage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getHuePercentage();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_getHuePercentage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_setSlider(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlHuePicker* cobj = (cocos2d::extension::ControlHuePicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setSlider : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_setSlider : Error processing arguments\");\n\t\tcobj->setSlider(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_setSlider : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlHuePicker_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::Point arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlHuePicker_create : Error processing arguments\");\n\t\tcocos2d::extension::ControlHuePicker* ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlHuePicker>(cx, (cocos2d::extension::ControlHuePicker*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_ControlHuePicker_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlHuePicker* cobj = new cocos2d::extension::ControlHuePicker();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ControlHuePicker> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ControlHuePicker\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlHuePicker_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlHuePicker_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlHuePicker)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlHuePicker(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlHuePicker_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlHuePicker_class->name = \"ControlHuePicker\";\n\tjsb_cocos2d_extension_ControlHuePicker_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlHuePicker_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlHuePicker_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlHuePicker_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlHuePicker_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlHuePicker_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlHuePicker_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlHuePicker_class->finalize = js_cocos2d_extension_ControlHuePicker_finalize;\n\tjsb_cocos2d_extension_ControlHuePicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_extension_ControlHuePicker_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTargetAndPos\", js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setHue\", js_cocos2dx_extension_ControlHuePicker_setHue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartPos\", js_cocos2dx_extension_ControlHuePicker_getStartPos, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getHue\", js_cocos2dx_extension_ControlHuePicker_getHue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSlider\", js_cocos2dx_extension_ControlHuePicker_getSlider, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackground\", js_cocos2dx_extension_ControlHuePicker_setBackground, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setHuePercentage\", js_cocos2dx_extension_ControlHuePicker_setHuePercentage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackground\", js_cocos2dx_extension_ControlHuePicker_getBackground, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getHuePercentage\", js_cocos2dx_extension_ControlHuePicker_getHuePercentage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSlider\", js_cocos2dx_extension_ControlHuePicker_setSlider, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlHuePicker_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlHuePicker_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlHuePicker_class,\n\t\tjs_cocos2dx_extension_ControlHuePicker_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlHuePicker\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlHuePicker> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlHuePicker_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlHuePicker_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class;\nJSObject *jsb_cocos2d_extension_ControlSaturationBrightnessPicker_prototype;\n\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getShadow();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::Point arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithTargetAndPos(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getStartPos();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getOverlay();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getSlider();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getBackground();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSaturation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = (cocos2d::extension::ControlSaturationBrightnessPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getBrightness();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Node* arg0;\n\t\tcocos2d::Point arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_create : Error processing arguments\");\n\t\tcocos2d::extension::ControlSaturationBrightnessPicker* ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSaturationBrightnessPicker>(cx, (cocos2d::extension::ControlSaturationBrightnessPicker*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlSaturationBrightnessPicker* cobj = new cocos2d::extension::ControlSaturationBrightnessPicker();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ControlSaturationBrightnessPicker> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ControlSaturationBrightnessPicker\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlSaturationBrightnessPicker)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->name = \"ControlSaturationBrightnessPicker\";\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->finalize = js_cocos2d_extension_ControlSaturationBrightnessPicker_finalize;\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getShadow\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTargetAndPos\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStartPos\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getOverlay\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSlider\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackground\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSaturation\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBrightness\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlSaturationBrightnessPicker_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlSaturationBrightnessPicker_class,\n\t\tjs_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlSaturationBrightnessPicker\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlSaturationBrightnessPicker> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlSaturationBrightnessPicker_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlColourPicker_class;\nJSObject *jsb_cocos2d_extension_ControlColourPicker_prototype;\n\nJSBool js_cocos2dx_extension_ControlColourPicker_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_getHuePicker(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_getHuePicker : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlHuePicker* ret = cobj->getHuePicker();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlHuePicker>(cx, (cocos2d::extension::ControlHuePicker*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_getHuePicker : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_setColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setColor : Error processing arguments\");\n\t\tcobj->setColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_setColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Object* arg0;\n\t\tcocos2d::extension::Control::EventType arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged : Error processing arguments\");\n\t\tcobj->hueSliderValueChanged(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_getcolourPicker(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_getcolourPicker : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlSaturationBrightnessPicker* ret = cobj->getcolourPicker();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSaturationBrightnessPicker>(cx, (cocos2d::extension::ControlSaturationBrightnessPicker*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_getcolourPicker : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_setBackground(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setBackground : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setBackground : Error processing arguments\");\n\t\tcobj->setBackground(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_setBackground : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_setcolourPicker(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setcolourPicker : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::ControlSaturationBrightnessPicker* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::extension::ControlSaturationBrightnessPicker*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setcolourPicker : Error processing arguments\");\n\t\tcobj->setcolourPicker(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_setcolourPicker : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Object* arg0;\n\t\tcocos2d::extension::Control::EventType arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged : Error processing arguments\");\n\t\tcobj->colourSliderValueChanged(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_setHuePicker(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setHuePicker : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::ControlHuePicker* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::extension::ControlHuePicker*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_setHuePicker : Error processing arguments\");\n\t\tcobj->setHuePicker(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_setHuePicker : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlColourPicker* cobj = (cocos2d::extension::ControlColourPicker *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlColourPicker_getBackground : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getBackground();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_getBackground : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlColourPicker_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlColourPicker* ret = cocos2d::extension::ControlColourPicker::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlColourPicker>(cx, (cocos2d::extension::ControlColourPicker*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_ControlColourPicker_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlColourPicker* cobj = new cocos2d::extension::ControlColourPicker();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ControlColourPicker> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ControlColourPicker\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlColourPicker_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlColourPicker_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlColourPicker)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlColourPicker(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlColourPicker_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlColourPicker_class->name = \"ControlColourPicker\";\n\tjsb_cocos2d_extension_ControlColourPicker_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlColourPicker_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlColourPicker_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlColourPicker_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlColourPicker_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlColourPicker_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlColourPicker_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlColourPicker_class->finalize = js_cocos2d_extension_ControlColourPicker_finalize;\n\tjsb_cocos2d_extension_ControlColourPicker_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_extension_ControlColourPicker_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getHuePicker\", js_cocos2dx_extension_ControlColourPicker_getHuePicker, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setColor\", js_cocos2dx_extension_ControlColourPicker_setColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hueSliderValueChanged\", js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getcolourPicker\", js_cocos2dx_extension_ControlColourPicker_getcolourPicker, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackground\", js_cocos2dx_extension_ControlColourPicker_setBackground, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_extension_ControlColourPicker_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setcolourPicker\", js_cocos2dx_extension_ControlColourPicker_setcolourPicker, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"colourSliderValueChanged\", js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setHuePicker\", js_cocos2dx_extension_ControlColourPicker_setHuePicker, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackground\", js_cocos2dx_extension_ControlColourPicker_getBackground, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlColourPicker_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlColourPicker_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlColourPicker_class,\n\t\tjs_cocos2dx_extension_ControlColourPicker_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlColourPicker\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlColourPicker> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlColourPicker_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlColourPicker_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlPotentiometer_class;\nJSObject *jsb_cocos2d_extension_ControlPotentiometer_prototype;\n\nJSBool js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation : Error processing arguments\");\n\t\tcobj->setPreviousLocation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_setValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setValue : Error processing arguments\");\n\t\tcobj->setValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_setValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_getProgressTimer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_getProgressTimer : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::ProgressTimer* ret = cobj->getProgressTimer();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::ProgressTimer>(cx, (cocos2d::ProgressTimer*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_getProgressTimer : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_getMaximumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_getMaximumValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMaximumValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_getMaximumValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::Point arg1;\n\t\tcocos2d::Point arg2;\n\t\tcocos2d::Point arg3;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tok &= jsval_to_ccpoint(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : Error processing arguments\");\n\t\tdouble ret = cobj->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan : Error processing arguments\");\n\t\tcobj->potentiometerBegan(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setMaximumValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setMaximumValue : Error processing arguments\");\n\t\tcobj->setMaximumValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_setMaximumValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_getMinimumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_getMinimumValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMinimumValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_getMinimumValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_setThumbSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setThumbSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setThumbSprite : Error processing arguments\");\n\t\tcobj->setThumbSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_setThumbSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_getValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_getValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_getValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getPreviousLocation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint : Error processing arguments\");\n\t\tdouble ret = cobj->distanceBetweenPointAndPoint(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded : Error processing arguments\");\n\t\tcobj->potentiometerEnded(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_setProgressTimer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setProgressTimer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::ProgressTimer* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::ProgressTimer*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setProgressTimer : Error processing arguments\");\n\t\tcobj->setProgressTimer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_setProgressTimer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setMinimumValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_setMinimumValue : Error processing arguments\");\n\t\tcobj->setMinimumValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_setMinimumValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_getThumbSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_getThumbSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getThumbSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_getThumbSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Sprite* arg0;\n\t\tcocos2d::ProgressTimer* arg1;\n\t\tcocos2d::Sprite* arg2;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::ProgressTimer*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithTrackSprite_ProgressTimer_ThumbSprite(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlPotentiometer* cobj = (cocos2d::extension::ControlPotentiometer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved : Error processing arguments\");\n\t\tcobj->potentiometerMoved(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlPotentiometer_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlPotentiometer_create : Error processing arguments\");\n\t\tcocos2d::extension::ControlPotentiometer* ret = cocos2d::extension::ControlPotentiometer::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlPotentiometer>(cx, (cocos2d::extension::ControlPotentiometer*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_ControlPotentiometer_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlPotentiometer* cobj = new cocos2d::extension::ControlPotentiometer();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ControlPotentiometer> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ControlPotentiometer\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlPotentiometer_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlPotentiometer_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlPotentiometer)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlPotentiometer(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlPotentiometer_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlPotentiometer_class->name = \"ControlPotentiometer\";\n\tjsb_cocos2d_extension_ControlPotentiometer_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->finalize = js_cocos2d_extension_ControlPotentiometer_finalize;\n\tjsb_cocos2d_extension_ControlPotentiometer_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setPreviousLocation\", js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setValue\", js_cocos2dx_extension_ControlPotentiometer_setValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProgressTimer\", js_cocos2dx_extension_ControlPotentiometer_getProgressTimer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaximumValue\", js_cocos2dx_extension_ControlPotentiometer_getMaximumValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint\", js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"potentiometerBegan\", js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaximumValue\", js_cocos2dx_extension_ControlPotentiometer_setMaximumValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMinimumValue\", js_cocos2dx_extension_ControlPotentiometer_getMinimumValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setThumbSprite\", js_cocos2dx_extension_ControlPotentiometer_setThumbSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getValue\", js_cocos2dx_extension_ControlPotentiometer_getValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPreviousLocation\", js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"distanceBetweenPointAndPoint\", js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"potentiometerEnded\", js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setProgressTimer\", js_cocos2dx_extension_ControlPotentiometer_setProgressTimer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMinimumValue\", js_cocos2dx_extension_ControlPotentiometer_setMinimumValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getThumbSprite\", js_cocos2dx_extension_ControlPotentiometer_getThumbSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithTrackSprite_ProgressTimer_ThumbSprite\", js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"potentiometerMoved\", js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlPotentiometer_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlPotentiometer_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlPotentiometer_class,\n\t\tjs_cocos2dx_extension_ControlPotentiometer_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlPotentiometer\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlPotentiometer> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlPotentiometer_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlPotentiometer_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlSlider_class;\nJSObject *jsb_cocos2d_extension_ControlSlider_prototype;\n\nJSBool js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getSelectedThumbSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_locationFromTouch(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_locationFromTouch : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Touch*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_locationFromTouch : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->locationFromTouch(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_locationFromTouch : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite : Error processing arguments\");\n\t\tcobj->setSelectedThumbSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setProgressSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setProgressSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setProgressSprite : Error processing arguments\");\n\t\tcobj->setProgressSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setProgressSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMaximumAllowedValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMinimumAllowedValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getMinimumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getMinimumValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMinimumValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getMinimumValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setThumbSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setThumbSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setThumbSprite : Error processing arguments\");\n\t\tcobj->setThumbSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setThumbSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMinimumValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMinimumValue : Error processing arguments\");\n\t\tcobj->setMinimumValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setMinimumValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue : Error processing arguments\");\n\t\tcobj->setMinimumAllowedValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setValue : Error processing arguments\");\n\t\tcobj->setValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMaximumValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMaximumValue : Error processing arguments\");\n\t\tcobj->setMaximumValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setMaximumValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_needsLayout(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_needsLayout : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->needsLayout();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_needsLayout : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getBackgroundSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getBackgroundSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getBackgroundSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_initWithSprites(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::ControlSlider* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_initWithSprites : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg3;\n\t\t\tdo {\n\t\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ3 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSprites(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithSprites(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_initWithSprites : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getMaximumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getMaximumValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getMaximumValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getMaximumValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_isTouchInside(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_isTouchInside : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Touch*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_isTouchInside : Error processing arguments\");\n\t\tJSBool ret = cobj->isTouchInside(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_isTouchInside : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getThumbSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getThumbSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getThumbSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getThumbSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_getProgressSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_getProgressSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getProgressSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_getProgressSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setBackgroundSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setBackgroundSprite : Error processing arguments\");\n\t\tcobj->setBackgroundSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setBackgroundSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSlider* cobj = (cocos2d::extension::ControlSlider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue : Error processing arguments\");\n\t\tcobj->setMaximumAllowedValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSlider>(cx, (cocos2d::extension::ControlSlider*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg2;\n\t\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSlider>(cx, (cocos2d::extension::ControlSlider*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg2;\n\t\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg3;\n\t\t\tstd::string arg3_tmp; ok &= jsval_to_std_string(cx, argv[3], &arg3_tmp); arg3 = arg3_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSlider>(cx, (cocos2d::extension::ControlSlider*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg3;\n\t\t\tdo {\n\t\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ3 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSlider>(cx, (cocos2d::extension::ControlSlider*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSlider_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlSlider* cobj = new cocos2d::extension::ControlSlider();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ControlSlider> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ControlSlider\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSlider_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlSlider_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlSlider)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlSlider(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlSlider_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlSlider_class->name = \"ControlSlider\";\n\tjsb_cocos2d_extension_ControlSlider_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlSlider_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlSlider_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlSlider_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlSlider_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlSlider_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlSlider_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlSlider_class->finalize = js_cocos2d_extension_ControlSlider_finalize;\n\tjsb_cocos2d_extension_ControlSlider_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getSelectedThumbSprite\", js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"locationFromTouch\", js_cocos2dx_extension_ControlSlider_locationFromTouch, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSelectedThumbSprite\", js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setProgressSprite\", js_cocos2dx_extension_ControlSlider_setProgressSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaximumAllowedValue\", js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMinimumAllowedValue\", js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMinimumValue\", js_cocos2dx_extension_ControlSlider_getMinimumValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setThumbSprite\", js_cocos2dx_extension_ControlSlider_setThumbSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMinimumValue\", js_cocos2dx_extension_ControlSlider_setMinimumValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMinimumAllowedValue\", js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_extension_ControlSlider_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setValue\", js_cocos2dx_extension_ControlSlider_setValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaximumValue\", js_cocos2dx_extension_ControlSlider_setMaximumValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"needsLayout\", js_cocos2dx_extension_ControlSlider_needsLayout, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackgroundSprite\", js_cocos2dx_extension_ControlSlider_getBackgroundSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithSprites\", js_cocos2dx_extension_ControlSlider_initWithSprites, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaximumValue\", js_cocos2dx_extension_ControlSlider_getMaximumValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTouchInside\", js_cocos2dx_extension_ControlSlider_isTouchInside, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getValue\", js_cocos2dx_extension_ControlSlider_getValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getThumbSprite\", js_cocos2dx_extension_ControlSlider_getThumbSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getProgressSprite\", js_cocos2dx_extension_ControlSlider_getProgressSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackgroundSprite\", js_cocos2dx_extension_ControlSlider_setBackgroundSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaximumAllowedValue\", js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlSlider_create, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlSlider_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlSlider_class,\n\t\tjs_cocos2dx_extension_ControlSlider_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlSlider\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlSlider> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlSlider_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlSlider_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlStepper_class;\nJSObject *jsb_cocos2d_extension_ControlStepper_prototype;\n\nJSBool js_cocos2dx_extension_ControlStepper_setMinusSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMinusSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMinusSprite : Error processing arguments\");\n\t\tcobj->setMinusSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setMinusSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_getMinusLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_getMinusLabel : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::LabelTTF* ret = cobj->getMinusLabel();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelTTF>(cx, (cocos2d::LabelTTF*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_getMinusLabel : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setWraps(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setWraps : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setWraps : Error processing arguments\");\n\t\tcobj->setWraps(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setWraps : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_isContinuous(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_isContinuous : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isContinuous();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_isContinuous : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_getMinusSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_getMinusSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getMinusSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_getMinusSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation : Error processing arguments\");\n\t\tcobj->updateLayoutUsingTouchLocation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent : Error processing arguments\");\n\t\tcobj->setValueWithSendingEvent(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_getPlusLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_getPlusLabel : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::LabelTTF* ret = cobj->getPlusLabel();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LabelTTF>(cx, (cocos2d::LabelTTF*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_getPlusLabel : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_stopAutorepeat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_stopAutorepeat : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopAutorepeat();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_stopAutorepeat : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMinimumValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMinimumValue : Error processing arguments\");\n\t\tcobj->setMinimumValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setMinimumValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_getPlusSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_getPlusSprite : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Sprite* ret = cobj->getPlusSprite();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, (cocos2d::Sprite*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_getPlusSprite : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setPlusSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setPlusSprite : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Sprite* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setPlusSprite : Error processing arguments\");\n\t\tcobj->setPlusSprite(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setPlusSprite : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setMinusLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMinusLabel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::LabelTTF* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::LabelTTF*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMinusLabel : Error processing arguments\");\n\t\tcobj->setMinusLabel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setMinusLabel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setValue : Error processing arguments\");\n\t\tcobj->setValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setStepValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setStepValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setStepValue : Error processing arguments\");\n\t\tcobj->setStepValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setStepValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMaximumValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setMaximumValue : Error processing arguments\");\n\t\tcobj->setMaximumValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setMaximumValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_update : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_update : Error processing arguments\");\n\t\tcobj->update(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_update : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_startAutorepeat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_startAutorepeat : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->startAutorepeat();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_startAutorepeat : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Sprite* arg0;\n\t\tcocos2d::Sprite* arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithMinusSpriteAndPlusSprite(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_getValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_getValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_getValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_setPlusLabel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlStepper* cobj = (cocos2d::extension::ControlStepper *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setPlusLabel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::LabelTTF* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::LabelTTF*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_setPlusLabel : Error processing arguments\");\n\t\tcobj->setPlusLabel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_setPlusLabel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlStepper_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Sprite* arg0;\n\t\tcocos2d::Sprite* arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlStepper_create : Error processing arguments\");\n\t\tcocos2d::extension::ControlStepper* ret = cocos2d::extension::ControlStepper::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlStepper>(cx, (cocos2d::extension::ControlStepper*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_ControlStepper_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlStepper* cobj = new cocos2d::extension::ControlStepper();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ControlStepper> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ControlStepper\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlStepper_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlStepper_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlStepper)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlStepper(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlStepper_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlStepper_class->name = \"ControlStepper\";\n\tjsb_cocos2d_extension_ControlStepper_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlStepper_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlStepper_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlStepper_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlStepper_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlStepper_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlStepper_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlStepper_class->finalize = js_cocos2d_extension_ControlStepper_finalize;\n\tjsb_cocos2d_extension_ControlStepper_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setMinusSprite\", js_cocos2dx_extension_ControlStepper_setMinusSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMinusLabel\", js_cocos2dx_extension_ControlStepper_getMinusLabel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setWraps\", js_cocos2dx_extension_ControlStepper_setWraps, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isContinuous\", js_cocos2dx_extension_ControlStepper_isContinuous, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMinusSprite\", js_cocos2dx_extension_ControlStepper_getMinusSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateLayoutUsingTouchLocation\", js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setValueWithSendingEvent\", js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPlusLabel\", js_cocos2dx_extension_ControlStepper_getPlusLabel, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopAutorepeat\", js_cocos2dx_extension_ControlStepper_stopAutorepeat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMinimumValue\", js_cocos2dx_extension_ControlStepper_setMinimumValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPlusSprite\", js_cocos2dx_extension_ControlStepper_getPlusSprite, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlusSprite\", js_cocos2dx_extension_ControlStepper_setPlusSprite, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMinusLabel\", js_cocos2dx_extension_ControlStepper_setMinusLabel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setValue\", js_cocos2dx_extension_ControlStepper_setValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStepValue\", js_cocos2dx_extension_ControlStepper_setStepValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaximumValue\", js_cocos2dx_extension_ControlStepper_setMaximumValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_extension_ControlStepper_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"startAutorepeat\", js_cocos2dx_extension_ControlStepper_startAutorepeat, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithMinusSpriteAndPlusSprite\", js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getValue\", js_cocos2dx_extension_ControlStepper_getValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlusLabel\", js_cocos2dx_extension_ControlStepper_setPlusLabel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlStepper_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlStepper_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlStepper_class,\n\t\tjs_cocos2dx_extension_ControlStepper_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlStepper\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlStepper> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlStepper_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlStepper_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ControlSwitch_class;\nJSObject *jsb_cocos2d_extension_ControlSwitch_prototype;\n\nJSBool js_cocos2dx_extension_ControlSwitch_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSwitch_setOn(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::ControlSwitch* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::ControlSwitch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_setOn : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tJSBool arg0;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setOn(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tJSBool arg0;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg1;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setOn(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_setOn : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSwitch_isOn(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_isOn : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isOn();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_isOn : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSwitch_initWithMaskSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::ControlSwitch* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::ControlSwitch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_initWithMaskSprite : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 6) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg3;\n\t\t\tdo {\n\t\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ3 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelTTF* arg4;\n\t\t\tdo {\n\t\t\t\tif (!argv[4].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[4]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ4 = (cocos2d::LabelTTF*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg4, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelTTF* arg5;\n\t\t\tdo {\n\t\t\t\tif (!argv[5].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[5]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ5 = (cocos2d::LabelTTF*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg5, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg3;\n\t\t\tdo {\n\t\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ3 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_initWithMaskSprite : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSwitch_hasMoved(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_hasMoved : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->hasMoved();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_hasMoved : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSwitch_locationFromTouch(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ControlSwitch* cobj = (cocos2d::extension::ControlSwitch *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_locationFromTouch : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Touch*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ControlSwitch_locationFromTouch : Error processing arguments\");\n\t\tcocos2d::Point ret = cobj->locationFromTouch(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_locationFromTouch : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSwitch_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 4) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg3;\n\t\t\tdo {\n\t\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ3 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSwitch>(cx, (cocos2d::extension::ControlSwitch*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 6) {\n\t\t\tcocos2d::Sprite* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Sprite* arg3;\n\t\t\tdo {\n\t\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ3 = (cocos2d::Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelTTF* arg4;\n\t\t\tdo {\n\t\t\t\tif (!argv[4].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[4]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ4 = (cocos2d::LabelTTF*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg4, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::LabelTTF* arg5;\n\t\t\tdo {\n\t\t\t\tif (!argv[5].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[5]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ5 = (cocos2d::LabelTTF*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg5, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ControlSwitch>(cx, (cocos2d::extension::ControlSwitch*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ControlSwitch_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ControlSwitch* cobj = new cocos2d::extension::ControlSwitch();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ControlSwitch> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ControlSwitch\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ControlSwitch_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nvoid js_cocos2d_extension_ControlSwitch_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ControlSwitch)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_ControlSwitch(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ControlSwitch_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ControlSwitch_class->name = \"ControlSwitch\";\n\tjsb_cocos2d_extension_ControlSwitch_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlSwitch_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ControlSwitch_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ControlSwitch_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ControlSwitch_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ControlSwitch_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ControlSwitch_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ControlSwitch_class->finalize = js_cocos2d_extension_ControlSwitch_finalize;\n\tjsb_cocos2d_extension_ControlSwitch_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_extension_ControlSwitch_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setOn\", js_cocos2dx_extension_ControlSwitch_setOn, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isOn\", js_cocos2dx_extension_ControlSwitch_isOn, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithMaskSprite\", js_cocos2dx_extension_ControlSwitch_initWithMaskSprite, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hasMoved\", js_cocos2dx_extension_ControlSwitch_hasMoved, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"locationFromTouch\", js_cocos2dx_extension_ControlSwitch_locationFromTouch, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ControlSwitch_create, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ControlSwitch_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_Control_prototype,\n\t\tjsb_cocos2d_extension_ControlSwitch_class,\n\t\tjs_cocos2dx_extension_ControlSwitch_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ControlSwitch\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ControlSwitch> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ControlSwitch_class;\n\t\tp->proto = jsb_cocos2d_extension_ControlSwitch_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_Control_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_ScrollView_class;\nJSObject *jsb_cocos2d_extension_ScrollView_prototype;\n\nJSBool js_cocos2dx_extension_ScrollView_isClippingToBounds(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_isClippingToBounds : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isClippingToBounds();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_isClippingToBounds : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setContainer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setContainer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setContainer : Error processing arguments\");\n\t\tcobj->setContainer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setContainer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setContentOffsetInDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setContentOffsetInDuration : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setContentOffsetInDuration : Error processing arguments\");\n\t\tcobj->setContentOffsetInDuration(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setContentOffsetInDuration : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setZoomScaleInDuration(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setZoomScaleInDuration : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setZoomScaleInDuration : Error processing arguments\");\n\t\tcobj->setZoomScaleInDuration(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setZoomScaleInDuration : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setBounceable(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setBounceable : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setBounceable : Error processing arguments\");\n\t\tcobj->setBounceable(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setBounceable : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_getDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_getDirection : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getDirection();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_getDirection : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_getContainer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_getContainer : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getContainer();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_getContainer : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_getZoomScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_getZoomScale : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getZoomScale();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_getZoomScale : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_updateInset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_updateInset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateInset();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_updateInset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_initWithViewSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_initWithViewSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_initWithViewSize : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithViewSize(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Size arg0;\n\t\tcocos2d::Node* arg1;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_initWithViewSize : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithViewSize(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_initWithViewSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_pause(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_pause : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Object* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_pause : Error processing arguments\");\n\t\tcobj->pause(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_pause : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setDirection : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::ScrollView::Direction arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setDirection : Error processing arguments\");\n\t\tcobj->setDirection(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setDirection : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setContentOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setContentOffset : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setContentOffset : Error processing arguments\");\n\t\tcobj->setContentOffset(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setContentOffset : Error processing arguments\");\n\t\tcobj->setContentOffset(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setContentOffset : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_isDragging(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_isDragging : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isDragging();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_isDragging : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_isTouchEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTouchEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_isTouchEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_isBounceable(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_isBounceable : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBounceable();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_isBounceable : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setTouchEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setTouchEnabled : Error processing arguments\");\n\t\tcobj->setTouchEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setTouchEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_getContentOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_getContentOffset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getContentOffset();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_getContentOffset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_resume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_resume : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Object* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_resume : Error processing arguments\");\n\t\tcobj->resume(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_resume : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setClippingToBounds(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setClippingToBounds : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setClippingToBounds : Error processing arguments\");\n\t\tcobj->setClippingToBounds(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setClippingToBounds : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setViewSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setViewSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setViewSize : Error processing arguments\");\n\t\tcobj->setViewSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setViewSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_getViewSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_getViewSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getViewSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_getViewSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_maxContainerOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_maxContainerOffset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->maxContainerOffset();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_maxContainerOffset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_isTouchMoved(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_isTouchMoved : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTouchMoved();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_isTouchMoved : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_isNodeVisible(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_isNodeVisible : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_isNodeVisible : Error processing arguments\");\n\t\tJSBool ret = cobj->isNodeVisible(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_isNodeVisible : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_minContainerOffset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_minContainerOffset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->minContainerOffset();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_minContainerOffset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::extension::ScrollView* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_ScrollView_setZoomScale : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg1;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setZoomScale(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setZoomScale(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_setZoomScale : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ScrollView>(cx, (cocos2d::extension::ScrollView*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ScrollView>(cx, (cocos2d::extension::ScrollView*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Size arg0;\n\t\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Node* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::ScrollView>(cx, (cocos2d::extension::ScrollView*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_ScrollView_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::ScrollView* cobj = new cocos2d::extension::ScrollView();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::ScrollView> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ScrollView\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_ScrollView_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Layer_prototype;\n\nvoid js_cocos2d_extension_ScrollView_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ScrollView)\", obj);\n}\n\nstatic JSBool js_cocos2d_extension_ScrollView_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::extension::ScrollView *nobj = cocos2d::extension::ScrollView::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::ScrollView\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_extension_ScrollView(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_ScrollView_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_ScrollView_class->name = \"ScrollView\";\n\tjsb_cocos2d_extension_ScrollView_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ScrollView_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_ScrollView_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_ScrollView_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_ScrollView_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_ScrollView_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_ScrollView_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_ScrollView_class->finalize = js_cocos2d_extension_ScrollView_finalize;\n\tjsb_cocos2d_extension_ScrollView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"isClippingToBounds\", js_cocos2dx_extension_ScrollView_isClippingToBounds, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setContainer\", js_cocos2dx_extension_ScrollView_setContainer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setContentOffsetInDuration\", js_cocos2dx_extension_ScrollView_setContentOffsetInDuration, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setZoomScaleInDuration\", js_cocos2dx_extension_ScrollView_setZoomScaleInDuration, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBounceable\", js_cocos2dx_extension_ScrollView_setBounceable, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDirection\", js_cocos2dx_extension_ScrollView_getDirection, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContainer\", js_cocos2dx_extension_ScrollView_getContainer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getZoomScale\", js_cocos2dx_extension_ScrollView_getZoomScale, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateInset\", js_cocos2dx_extension_ScrollView_updateInset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithViewSize\", js_cocos2dx_extension_ScrollView_initWithViewSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pause\", js_cocos2dx_extension_ScrollView_pause, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDirection\", js_cocos2dx_extension_ScrollView_setDirection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_extension_ScrollView_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setContentOffset\", js_cocos2dx_extension_ScrollView_setContentOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isDragging\", js_cocos2dx_extension_ScrollView_isDragging, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTouchEnabled\", js_cocos2dx_extension_ScrollView_isTouchEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isBounceable\", js_cocos2dx_extension_ScrollView_isBounceable, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchEnabled\", js_cocos2dx_extension_ScrollView_setTouchEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContentOffset\", js_cocos2dx_extension_ScrollView_getContentOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resume\", js_cocos2dx_extension_ScrollView_resume, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setClippingToBounds\", js_cocos2dx_extension_ScrollView_setClippingToBounds, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setViewSize\", js_cocos2dx_extension_ScrollView_setViewSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getViewSize\", js_cocos2dx_extension_ScrollView_getViewSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"maxContainerOffset\", js_cocos2dx_extension_ScrollView_maxContainerOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTouchMoved\", js_cocos2dx_extension_ScrollView_isTouchMoved, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isNodeVisible\", js_cocos2dx_extension_ScrollView_isNodeVisible, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"minContainerOffset\", js_cocos2dx_extension_ScrollView_minContainerOffset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setZoomScale\", js_cocos2dx_extension_ScrollView_setZoomScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_extension_ScrollView_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_ScrollView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_ScrollView_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Layer_prototype,\n\t\tjsb_cocos2d_extension_ScrollView_class,\n\t\tjs_cocos2dx_extension_ScrollView_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ScrollView\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::ScrollView> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_ScrollView_class;\n\t\tp->proto = jsb_cocos2d_extension_ScrollView_prototype;\n\t\tp->parentProto = jsb_cocos2d_Layer_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_TableViewCell_class;\nJSObject *jsb_cocos2d_extension_TableViewCell_prototype;\n\nJSBool js_cocos2dx_extension_TableViewCell_reset(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableViewCell* cobj = (cocos2d::extension::TableViewCell *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableViewCell_reset : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->reset();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableViewCell_reset : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableViewCell_getIdx(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableViewCell* cobj = (cocos2d::extension::TableViewCell *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableViewCell_getIdx : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getIdx();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableViewCell_getIdx : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableViewCell_setIdx(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableViewCell* cobj = (cocos2d::extension::TableViewCell *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableViewCell_setIdx : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableViewCell_setIdx : Error processing arguments\");\n\t\tcobj->setIdx(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableViewCell_setIdx : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableViewCell_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::TableViewCell* ret = cocos2d::extension::TableViewCell::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::TableViewCell>(cx, (cocos2d::extension::TableViewCell*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableViewCell_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_TableViewCell_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::TableViewCell* cobj = new cocos2d::extension::TableViewCell();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::TableViewCell> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::TableViewCell\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableViewCell_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_extension_TableViewCell_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TableViewCell)\", obj);\n}\n\nstatic JSBool js_cocos2d_extension_TableViewCell_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::extension::TableViewCell *nobj = cocos2d::extension::TableViewCell::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::TableViewCell\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_extension_TableViewCell(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_TableViewCell_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_TableViewCell_class->name = \"TableViewCell\";\n\tjsb_cocos2d_extension_TableViewCell_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_TableViewCell_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_TableViewCell_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_TableViewCell_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_TableViewCell_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_TableViewCell_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_TableViewCell_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_TableViewCell_class->finalize = js_cocos2d_extension_TableViewCell_finalize;\n\tjsb_cocos2d_extension_TableViewCell_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"reset\", js_cocos2dx_extension_TableViewCell_reset, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getIdx\", js_cocos2dx_extension_TableViewCell_getIdx, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setIdx\", js_cocos2dx_extension_TableViewCell_setIdx, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_extension_TableViewCell_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_TableViewCell_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_TableViewCell_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_extension_TableViewCell_class,\n\t\tjs_cocos2dx_extension_TableViewCell_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TableViewCell\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::TableViewCell> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_TableViewCell_class;\n\t\tp->proto = jsb_cocos2d_extension_TableViewCell_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_TableView_class;\nJSObject *jsb_cocos2d_extension_TableView_prototype;\n\nJSBool js_cocos2dx_extension_TableView_updateCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_updateCellAtIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_updateCellAtIndex : Error processing arguments\");\n\t\tcobj->updateCellAtIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_updateCellAtIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_setVerticalFillOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_setVerticalFillOrder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::TableView::VerticalFillOrder arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_setVerticalFillOrder : Error processing arguments\");\n\t\tcobj->setVerticalFillOrder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_setVerticalFillOrder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_scrollViewDidZoom(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_scrollViewDidZoom : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::ScrollView* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::extension::ScrollView*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_scrollViewDidZoom : Error processing arguments\");\n\t\tcobj->scrollViewDidZoom(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_scrollViewDidZoom : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView__updateContentSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView__updateContentSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->_updateContentSize();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView__updateContentSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_getVerticalFillOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_getVerticalFillOrder : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getVerticalFillOrder();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_getVerticalFillOrder : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_removeCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_removeCellAtIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_removeCellAtIndex : Error processing arguments\");\n\t\tcobj->removeCellAtIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_removeCellAtIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_initWithViewSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_initWithViewSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_initWithViewSize : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithViewSize(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::Size arg0;\n\t\tcocos2d::Node* arg1;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_initWithViewSize : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithViewSize(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_initWithViewSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_scrollViewDidScroll(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_scrollViewDidScroll : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::ScrollView* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::extension::ScrollView*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_scrollViewDidScroll : Error processing arguments\");\n\t\tcobj->scrollViewDidScroll(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_scrollViewDidScroll : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_reloadData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_reloadData : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->reloadData();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_reloadData : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_insertCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_insertCellAtIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_insertCellAtIndex : Error processing arguments\");\n\t\tcobj->insertCellAtIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_insertCellAtIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_cellAtIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_cellAtIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_cellAtIndex : Error processing arguments\");\n\t\tcocos2d::extension::TableViewCell* ret = cobj->cellAtIndex(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::TableViewCell>(cx, (cocos2d::extension::TableViewCell*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_cellAtIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_dequeueCell(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_TableView_dequeueCell : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::extension::TableViewCell* ret = cobj->dequeueCell();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::TableViewCell>(cx, (cocos2d::extension::TableViewCell*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_dequeueCell : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_TableView_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::TableView* cobj = new cocos2d::extension::TableView();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::TableView> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::TableView\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_TableView_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_ScrollView_prototype;\n\nvoid js_cocos2d_extension_TableView_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TableView)\", obj);\n}\n\nstatic JSBool js_cocos2d_extension_TableView_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::extension::TableView *nobj = cocos2d::extension::TableView::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::TableView\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_extension_TableView(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_TableView_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_TableView_class->name = \"TableView\";\n\tjsb_cocos2d_extension_TableView_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_TableView_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_TableView_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_TableView_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_TableView_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_TableView_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_TableView_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_TableView_class->finalize = js_cocos2d_extension_TableView_finalize;\n\tjsb_cocos2d_extension_TableView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"updateCellAtIndex\", js_cocos2dx_extension_TableView_updateCellAtIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVerticalFillOrder\", js_cocos2dx_extension_TableView_setVerticalFillOrder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollViewDidZoom\", js_cocos2dx_extension_TableView_scrollViewDidZoom, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"_updateContentSize\", js_cocos2dx_extension_TableView__updateContentSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVerticalFillOrder\", js_cocos2dx_extension_TableView_getVerticalFillOrder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeCellAtIndex\", js_cocos2dx_extension_TableView_removeCellAtIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithViewSize\", js_cocos2dx_extension_TableView_initWithViewSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollViewDidScroll\", js_cocos2dx_extension_TableView_scrollViewDidScroll, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reloadData\", js_cocos2dx_extension_TableView_reloadData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"insertCellAtIndex\", js_cocos2dx_extension_TableView_insertCellAtIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"cellAtIndex\", js_cocos2dx_extension_TableView_cellAtIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"dequeueCell\", js_cocos2dx_extension_TableView_dequeueCell, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocos2d_extension_TableView_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_extension_TableView_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_ScrollView_prototype,\n\t\tjsb_cocos2d_extension_TableView_class,\n\t\tjs_cocos2dx_extension_TableView_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TableView\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::TableView> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_TableView_class;\n\t\tp->proto = jsb_cocos2d_extension_TableView_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_ScrollView_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_EditBox_class;\nJSObject *jsb_cocos2d_extension_EditBox_prototype;\n\nJSBool js_cocos2dx_extension_EditBox_getText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_getText : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getText();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_getText : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFontName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFontName : Error processing arguments\");\n\t\tcobj->setPlaceholderFontName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setPlaceholderFontName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_getPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_getPlaceHolder : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getPlaceHolder();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_getPlaceHolder : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFontName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFontName : Error processing arguments\");\n\t\tcobj->setFontName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setFontName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFontSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFontSize : Error processing arguments\");\n\t\tcobj->setPlaceholderFontSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setPlaceholderFontSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setInputMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setInputMode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::EditBox::InputMode arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setInputMode : Error processing arguments\");\n\t\tcobj->setInputMode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setInputMode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFontColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFontColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFontColor : Error processing arguments\");\n\t\tcobj->setPlaceholderFontColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setPlaceholderFontColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setFontColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFontColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFontColor : Error processing arguments\");\n\t\tcobj->setFontColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setFontColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFont(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFont : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tint arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceholderFont : Error processing arguments\");\n\t\tcobj->setPlaceholderFont(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setPlaceholderFont : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFontSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFontSize : Error processing arguments\");\n\t\tcobj->setFontSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setFontSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::Size arg0;\n\t\tcocos2d::extension::Scale9Sprite* arg1;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithSizeAndBackgroundSprite(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceHolder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setPlaceHolder : Error processing arguments\");\n\t\tcobj->setPlaceHolder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setPlaceHolder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setReturnType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setReturnType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::EditBox::KeyboardReturnType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setReturnType : Error processing arguments\");\n\t\tcobj->setReturnType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setReturnType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setInputFlag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setInputFlag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::extension::EditBox::InputFlag arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setInputFlag : Error processing arguments\");\n\t\tcobj->setInputFlag(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setInputFlag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_getMaxLength(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_getMaxLength : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getMaxLength();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_getMaxLength : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setText : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setText : Error processing arguments\");\n\t\tcobj->setText(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setText : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setMaxLength(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setMaxLength : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setMaxLength : Error processing arguments\");\n\t\tcobj->setMaxLength(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setMaxLength : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_setFont(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFont : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tint arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_setFont : Error processing arguments\");\n\t\tcobj->setFont(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_setFont : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_EditBox_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Size arg0;\n\t\tcocos2d::extension::Scale9Sprite* arg1;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_create : Error processing arguments\");\n\t\tcocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::EditBox>(cx, (cocos2d::extension::EditBox*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tcocos2d::Size arg0;\n\t\tcocos2d::extension::Scale9Sprite* arg1;\n\t\tcocos2d::extension::Scale9Sprite* arg2;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ2 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_create : Error processing arguments\");\n\t\tcocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::EditBox>(cx, (cocos2d::extension::EditBox*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tcocos2d::Size arg0;\n\t\tcocos2d::extension::Scale9Sprite* arg1;\n\t\tcocos2d::extension::Scale9Sprite* arg2;\n\t\tcocos2d::extension::Scale9Sprite* arg3;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ2 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tdo {\n\t\t\tif (!argv[3].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[3]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ3 = (cocos2d::extension::Scale9Sprite*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg3, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_EditBox_create : Error processing arguments\");\n\t\tcocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::EditBox>(cx, (cocos2d::extension::EditBox*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_EditBox_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::extension::EditBox* cobj = new cocos2d::extension::EditBox();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::EditBox> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::EditBox\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_EditBox_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_extension_ControlButton_prototype;\n\nvoid js_cocos2d_extension_EditBox_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (EditBox)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_EditBox(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_EditBox_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_EditBox_class->name = \"EditBox\";\n\tjsb_cocos2d_extension_EditBox_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_EditBox_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_EditBox_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_EditBox_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_EditBox_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_EditBox_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_EditBox_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_EditBox_class->finalize = js_cocos2d_extension_EditBox_finalize;\n\tjsb_cocos2d_extension_EditBox_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getText\", js_cocos2dx_extension_EditBox_getText, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlaceholderFontName\", js_cocos2dx_extension_EditBox_setPlaceholderFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPlaceHolder\", js_cocos2dx_extension_EditBox_getPlaceHolder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontName\", js_cocos2dx_extension_EditBox_setFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlaceholderFontSize\", js_cocos2dx_extension_EditBox_setPlaceholderFontSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInputMode\", js_cocos2dx_extension_EditBox_setInputMode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlaceholderFontColor\", js_cocos2dx_extension_EditBox_setPlaceholderFontColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontColor\", js_cocos2dx_extension_EditBox_setFontColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlaceholderFont\", js_cocos2dx_extension_EditBox_setPlaceholderFont, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontSize\", js_cocos2dx_extension_EditBox_setFontSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithSizeAndBackgroundSprite\", js_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlaceHolder\", js_cocos2dx_extension_EditBox_setPlaceHolder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setReturnType\", js_cocos2dx_extension_EditBox_setReturnType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInputFlag\", js_cocos2dx_extension_EditBox_setInputFlag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaxLength\", js_cocos2dx_extension_EditBox_getMaxLength, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setText\", js_cocos2dx_extension_EditBox_setText, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaxLength\", js_cocos2dx_extension_EditBox_setMaxLength, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFont\", js_cocos2dx_extension_EditBox_setFont, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_EditBox_create, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_EditBox_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_extension_ControlButton_prototype,\n\t\tjsb_cocos2d_extension_EditBox_class,\n\t\tjs_cocos2dx_extension_EditBox_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"EditBox\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::EditBox> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_EditBox_class;\n\t\tp->proto = jsb_cocos2d_extension_EditBox_prototype;\n\t\tp->parentProto = jsb_cocos2d_extension_ControlButton_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_extension_AssetsManager_class;\nJSObject *jsb_cocos2d_extension_AssetsManager_prototype;\n\nJSBool js_cocos2dx_extension_AssetsManager_setStoragePath(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setStoragePath : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setStoragePath : Error processing arguments\");\n\t\tcobj->setStoragePath(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_setStoragePath : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_setPackageUrl(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setPackageUrl : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setPackageUrl : Error processing arguments\");\n\t\tcobj->setPackageUrl(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_setPackageUrl : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_checkUpdate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_checkUpdate : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->checkUpdate();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_checkUpdate : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_getStoragePath(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_getStoragePath : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getStoragePath();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_getStoragePath : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_update : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->update();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_update : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_setConnectionTimeout(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setConnectionTimeout : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setConnectionTimeout : Error processing arguments\");\n\t\tcobj->setConnectionTimeout(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_setConnectionTimeout : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_setVersionFileUrl(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setVersionFileUrl : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_setVersionFileUrl : Error processing arguments\");\n\t\tcobj->setVersionFileUrl(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_setVersionFileUrl : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_getPackageUrl(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_getPackageUrl : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getPackageUrl();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_getPackageUrl : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_getConnectionTimeout(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_getConnectionTimeout : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tunsigned int ret = cobj->getConnectionTimeout();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = uint32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_getConnectionTimeout : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_getVersion(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_getVersion : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getVersion();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_getVersion : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_getVersionFileUrl(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_getVersionFileUrl : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getVersionFileUrl();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_getVersionFileUrl : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_deleteVersion(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::extension::AssetsManager* cobj = (cocos2d::extension::AssetsManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_deleteVersion : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->deleteVersion();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_deleteVersion : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_extension_AssetsManager_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 6) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tstd::function<void (int)> arg3;\n\t\tstd::function<void (int)> arg4;\n\t\tstd::function<void ()> arg5;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tdo {\n\t\t\tstd::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), argv[3]));\n\t\t\tauto lambda = [=](int larg0) -> void {\n\t\t\t\tjsval largv[1];\n\t\t\t\tlargv[0] = int32_to_jsval(cx, larg0);\n\t\t\t\tjsval rval;\n\t\t\t\tJSBool ok = func->invoke(1, &largv[0], rval);\n\t\t\t\tif (!ok && JS_IsExceptionPending(cx)) {\n\t\t\t\t\tJS_ReportPendingException(cx);\n\t\t\t\t}\n\t\t\t};\n\t\t\targ3 = lambda;\n\t\t} while(0)\n\t\t;\n\t\tdo {\n\t\t\tstd::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), argv[4]));\n\t\t\tauto lambda = [=](int larg0) -> void {\n\t\t\t\tjsval largv[1];\n\t\t\t\tlargv[0] = int32_to_jsval(cx, larg0);\n\t\t\t\tjsval rval;\n\t\t\t\tJSBool ok = func->invoke(1, &largv[0], rval);\n\t\t\t\tif (!ok && JS_IsExceptionPending(cx)) {\n\t\t\t\t\tJS_ReportPendingException(cx);\n\t\t\t\t}\n\t\t\t};\n\t\t\targ4 = lambda;\n\t\t} while(0)\n\t\t;\n\t\tdo {\n\t\t\tstd::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), argv[5]));\n\t\t\tauto lambda = [=]() -> void {\n\t\t\t\tjsval rval;\n\t\t\t\tJSBool ok = func->invoke(0, nullptr, rval);\n\t\t\t\tif (!ok && JS_IsExceptionPending(cx)) {\n\t\t\t\t\tJS_ReportPendingException(cx);\n\t\t\t\t}\n\t\t\t};\n\t\t\targ5 = lambda;\n\t\t} while(0)\n\t\t;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_create : Error processing arguments\");\n\t\tcocos2d::extension::AssetsManager* ret = cocos2d::extension::AssetsManager::create(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::AssetsManager>(cx, (cocos2d::extension::AssetsManager*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_AssetsManager_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 0) {\n\t\tcocos2d::extension::AssetsManager* cobj = new cocos2d::extension::AssetsManager();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::AssetsManager> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::AssetsManager\");\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_constructor : Error processing arguments\");\n\t\tcocos2d::extension::AssetsManager* cobj = new cocos2d::extension::AssetsManager(arg0);\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::AssetsManager> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::AssetsManager\");\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_constructor : Error processing arguments\");\n\t\tcocos2d::extension::AssetsManager* cobj = new cocos2d::extension::AssetsManager(arg0, arg1);\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::AssetsManager> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::AssetsManager\");\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_extension_AssetsManager_constructor : Error processing arguments\");\n\t\tcocos2d::extension::AssetsManager* cobj = new cocos2d::extension::AssetsManager(arg0, arg1, arg2);\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::extension::AssetsManager> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::extension::AssetsManager\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_extension_AssetsManager_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_extension_AssetsManager_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (AssetsManager)\", obj);\n}\n\nvoid js_register_cocos2dx_extension_AssetsManager(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_extension_AssetsManager_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_extension_AssetsManager_class->name = \"AssetsManager\";\n\tjsb_cocos2d_extension_AssetsManager_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_AssetsManager_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_extension_AssetsManager_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_extension_AssetsManager_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_extension_AssetsManager_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_extension_AssetsManager_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_extension_AssetsManager_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_extension_AssetsManager_class->finalize = js_cocos2d_extension_AssetsManager_finalize;\n\tjsb_cocos2d_extension_AssetsManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setStoragePath\", js_cocos2dx_extension_AssetsManager_setStoragePath, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPackageUrl\", js_cocos2dx_extension_AssetsManager_setPackageUrl, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"checkUpdate\", js_cocos2dx_extension_AssetsManager_checkUpdate, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStoragePath\", js_cocos2dx_extension_AssetsManager_getStoragePath, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_extension_AssetsManager_update, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setConnectionTimeout\", js_cocos2dx_extension_AssetsManager_setConnectionTimeout, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVersionFileUrl\", js_cocos2dx_extension_AssetsManager_setVersionFileUrl, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPackageUrl\", js_cocos2dx_extension_AssetsManager_getPackageUrl, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getConnectionTimeout\", js_cocos2dx_extension_AssetsManager_getConnectionTimeout, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVersion\", js_cocos2dx_extension_AssetsManager_getVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVersionFileUrl\", js_cocos2dx_extension_AssetsManager_getVersionFileUrl, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"deleteVersion\", js_cocos2dx_extension_AssetsManager_deleteVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_extension_AssetsManager_create, 6, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_extension_AssetsManager_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_extension_AssetsManager_class,\n\t\tjs_cocos2dx_extension_AssetsManager_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"AssetsManager\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::extension::AssetsManager> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_extension_AssetsManager_class;\n\t\tp->proto = jsb_cocos2d_extension_AssetsManager_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj) {\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"cc\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"cc\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n\tjs_register_cocos2dx_extension_Control(cx, obj);\n\tjs_register_cocos2dx_extension_TableViewCell(cx, obj);\n\tjs_register_cocos2dx_extension_Scale9Sprite(cx, obj);\n\tjs_register_cocos2dx_extension_ControlSwitch(cx, obj);\n\tjs_register_cocos2dx_extension_ScrollView(cx, obj);\n\tjs_register_cocos2dx_extension_TableView(cx, obj);\n\tjs_register_cocos2dx_extension_AssetsManager(cx, obj);\n\tjs_register_cocos2dx_extension_ControlButton(cx, obj);\n\tjs_register_cocos2dx_extension_EditBox(cx, obj);\n\tjs_register_cocos2dx_extension_ControlSlider(cx, obj);\n\tjs_register_cocos2dx_extension_ControlStepper(cx, obj);\n\tjs_register_cocos2dx_extension_ControlSaturationBrightnessPicker(cx, obj);\n\tjs_register_cocos2dx_extension_ControlColourPicker(cx, obj);\n\tjs_register_cocos2dx_extension_ControlPotentiometer(cx, obj);\n\tjs_register_cocos2dx_extension_ControlHuePicker(cx, obj);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_extension_auto.hpp",
    "content": "#ifndef __cocos2dx_extension_h__\n#define __cocos2dx_extension_h__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n\nextern JSClass  *jsb_cocos2d_extension_Scale9Sprite_class;\nextern JSObject *jsb_cocos2d_extension_Scale9Sprite_prototype;\n\nJSBool js_cocos2dx_extension_Scale9Sprite_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_Scale9Sprite_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_Scale9Sprite(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetBottom(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetTop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_setPreferredSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_setSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetBottom(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_getCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_updateWithBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_getOriginalSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetTop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_getPreferredSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_getInsetLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_setInsetRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Scale9Sprite_Scale9Sprite(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_Control_class;\nextern JSObject *jsb_cocos2d_extension_Control_prototype;\n\nJSBool js_cocos2dx_extension_Control_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_Control_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_Control(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_Control_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_getState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_sendActionsForControlEvents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_setSelected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_isEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_needsLayout(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_hasVisibleParents(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_isSelected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_isTouchInside(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_setHighlighted(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_getTouchLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_isHighlighted(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_Control_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlButton_class;\nextern JSObject *jsb_cocos2d_extension_ControlButton_prototype;\n\nJSBool js_cocos2dx_extension_ControlButton_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlButton_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlButton(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlButton_isPushed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setSelected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setTitleLabelForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setAdjustBackgroundImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setHighlighted(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setZoomOnTouchDown(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setTitleForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setLabelAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getLabelAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getTitleTTFSizeForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setTitleTTFForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setTitleTTFSizeForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setTitleLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setPreferredSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getCurrentTitleColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getBackgroundSpriteForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getHorizontalOrigin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_needsLayout(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getCurrentTitle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getScaleRatio(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getTitleTTFForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getTitleColorForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setTitleColorForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setBackgroundSpriteForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setScaleRatio(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getTitleLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getPreferredSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getVerticalMargin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getTitleLabelForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setMargins(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_setTitleBMFontForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getTitleBMFontForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getZoomOnTouchDown(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_getTitleForState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlButton_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlHuePicker_class;\nextern JSObject *jsb_cocos2d_extension_ControlHuePicker_prototype;\n\nJSBool js_cocos2dx_extension_ControlHuePicker_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlHuePicker_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlHuePicker(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlHuePicker_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_setHue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_getStartPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_getHue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_getSlider(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_setBackground(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_setHuePercentage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_getHuePercentage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_setSlider(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlHuePicker_ControlHuePicker(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlSaturationBrightnessPicker_class;\nextern JSObject *jsb_cocos2d_extension_ControlSaturationBrightnessPicker_prototype;\n\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlSaturationBrightnessPicker_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlSaturationBrightnessPicker(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSaturationBrightnessPicker_ControlSaturationBrightnessPicker(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlColourPicker_class;\nextern JSObject *jsb_cocos2d_extension_ControlColourPicker_prototype;\n\nJSBool js_cocos2dx_extension_ControlColourPicker_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlColourPicker_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlColourPicker(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlColourPicker_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_getHuePicker(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_setColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_getcolourPicker(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_setBackground(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_setcolourPicker(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_setHuePicker(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_getBackground(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlColourPicker_ControlColourPicker(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlPotentiometer_class;\nextern JSObject *jsb_cocos2d_extension_ControlPotentiometer_prototype;\n\nJSBool js_cocos2dx_extension_ControlPotentiometer_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlPotentiometer_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlPotentiometer(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_setValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_getProgressTimer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_getMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_getMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_setThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_getValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_setProgressTimer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_getThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlPotentiometer_ControlPotentiometer(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlSlider_class;\nextern JSObject *jsb_cocos2d_extension_ControlSlider_prototype;\n\nJSBool js_cocos2dx_extension_ControlSlider_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlSlider_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlSlider(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlSlider_getSelectedThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_locationFromTouch(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setSelectedThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setProgressSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getMaximumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getMinimumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setMinimumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_needsLayout(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_initWithSprites(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_isTouchInside(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getThumbSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_getProgressSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_setMaximumAllowedValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSlider_ControlSlider(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlStepper_class;\nextern JSObject *jsb_cocos2d_extension_ControlStepper_prototype;\n\nJSBool js_cocos2dx_extension_ControlStepper_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlStepper_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlStepper(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlStepper_setMinusSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_getMinusLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setWraps(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_isContinuous(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_getMinusSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setValueWithSendingEvent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_getPlusLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_stopAutorepeat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setMinimumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_getPlusSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setPlusSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setMinusLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setStepValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setMaximumValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_startAutorepeat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_getValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_setPlusLabel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlStepper_ControlStepper(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ControlSwitch_class;\nextern JSObject *jsb_cocos2d_extension_ControlSwitch_prototype;\n\nJSBool js_cocos2dx_extension_ControlSwitch_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ControlSwitch_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ControlSwitch(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ControlSwitch_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSwitch_setOn(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSwitch_isOn(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSwitch_initWithMaskSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSwitch_hasMoved(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSwitch_locationFromTouch(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSwitch_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ControlSwitch_ControlSwitch(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_ScrollView_class;\nextern JSObject *jsb_cocos2d_extension_ScrollView_prototype;\n\nJSBool js_cocos2dx_extension_ScrollView_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_ScrollView_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_ScrollView(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_ScrollView_isClippingToBounds(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setContainer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setContentOffsetInDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setZoomScaleInDuration(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setBounceable(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_getDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_getContainer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_getZoomScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_updateInset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_initWithViewSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_pause(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setContentOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_isDragging(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_isBounceable(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_getContentOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_resume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setClippingToBounds(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setViewSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_getViewSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_maxContainerOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_isTouchMoved(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_isNodeVisible(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_minContainerOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_setZoomScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_ScrollView_ScrollView(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_TableViewCell_class;\nextern JSObject *jsb_cocos2d_extension_TableViewCell_prototype;\n\nJSBool js_cocos2dx_extension_TableViewCell_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_TableViewCell_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_TableViewCell(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_TableViewCell_reset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableViewCell_getIdx(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableViewCell_setIdx(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableViewCell_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableViewCell_TableViewCell(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_TableView_class;\nextern JSObject *jsb_cocos2d_extension_TableView_prototype;\n\nJSBool js_cocos2dx_extension_TableView_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_TableView_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_TableView(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_TableView_updateCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_setVerticalFillOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_scrollViewDidZoom(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView__updateContentSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_getVerticalFillOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_removeCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_initWithViewSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_scrollViewDidScroll(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_reloadData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_insertCellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_cellAtIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_dequeueCell(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_TableView_TableView(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_EditBox_class;\nextern JSObject *jsb_cocos2d_extension_EditBox_prototype;\n\nJSBool js_cocos2dx_extension_EditBox_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_EditBox_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_EditBox(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_EditBox_getText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_getPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setInputMode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFontColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setFontColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setPlaceholderFont(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setReturnType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setInputFlag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_getMaxLength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setMaxLength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_setFont(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_EditBox_EditBox(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_extension_AssetsManager_class;\nextern JSObject *jsb_cocos2d_extension_AssetsManager_prototype;\n\nJSBool js_cocos2dx_extension_AssetsManager_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_extension_AssetsManager_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_extension_AssetsManager(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_extension(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_extension_AssetsManager_setStoragePath(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_setPackageUrl(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_checkUpdate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_getStoragePath(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_setConnectionTimeout(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_setVersionFileUrl(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_getPackageUrl(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_getConnectionTimeout(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_getVersion(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_getVersionFileUrl(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_deleteVersion(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_extension_AssetsManager_AssetsManager(JSContext *cx, uint32_t argc, jsval *vp);\n#endif\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_extension_auto_api.js",
    "content": "/**\n * @module cocos2dx_extension\n */\nvar cc = cc || {};\n\n/**\n * @class Scale9Sprite\n */\ncc.Scale9Sprite = {\n\n/**\n * @method resizableSpriteWithCapInsets\n * @return A value converted from C/C++ \"cocos2d::extension::Scale9Sprite*\"\n * @param {const cocos2d::Rect&}\n */\nresizableSpriteWithCapInsets : function () {},\n\n/**\n * @method setInsetBottom\n * @param {float}\n */\nsetInsetBottom : function () {},\n\n/**\n * @method setInsetTop\n * @param {float}\n */\nsetInsetTop : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setPreferredSize\n * @param {cocos2d::Size}\n */\nsetPreferredSize : function () {},\n\n/**\n * @method setSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetSpriteFrame : function () {},\n\n/**\n * @method getInsetBottom\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetBottom : function () {},\n\n/**\n * @method getCapInsets\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\ngetCapInsets : function () {},\n\n/**\n * @method updateWithBatchNode\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::SpriteBatchNode*}\n * @param {const cocos2d::Rect&}\n * @param {bool}\n * @param {const cocos2d::Rect&}\n */\nupdateWithBatchNode : function () {},\n\n/**\n * @method getInsetRight\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetRight : function () {},\n\n/**\n * @method getOriginalSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetOriginalSize : function () {},\n\n/**\n * @method getInsetTop\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetTop : function () {},\n\n/**\n * @method setInsetLeft\n * @param {float}\n */\nsetInsetLeft : function () {},\n\n/**\n * @method getPreferredSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetPreferredSize : function () {},\n\n/**\n * @method setCapInsets\n * @param {cocos2d::Rect}\n */\nsetCapInsets : function () {},\n\n/**\n * @method getInsetLeft\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetLeft : function () {},\n\n/**\n * @method setInsetRight\n * @param {float}\n */\nsetInsetRight : function () {},\n\n/**\n * @method Scale9Sprite\n * @constructor\n */\nScale9Sprite : function () {},\n\n};\n\n/**\n * @class Control\n */\ncc.Control = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method getState\n * @return A value converted from C/C++ \"cocos2d::extension::Control::State\"\n */\ngetState : function () {},\n\n/**\n * @method sendActionsForControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\nsendActionsForControlEvents : function () {},\n\n/**\n * @method setSelected\n * @param {bool}\n */\nsetSelected : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method needsLayout\n */\nneedsLayout : function () {},\n\n/**\n * @method hasVisibleParents\n * @return A value converted from C/C++ \"bool\"\n */\nhasVisibleParents : function () {},\n\n/**\n * @method isSelected\n * @return A value converted from C/C++ \"bool\"\n */\nisSelected : function () {},\n\n/**\n * @method isTouchInside\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Touch*}\n */\nisTouchInside : function () {},\n\n/**\n * @method setHighlighted\n * @param {bool}\n */\nsetHighlighted : function () {},\n\n/**\n * @method getTouchLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\ngetTouchLocation : function () {},\n\n/**\n * @method isHighlighted\n * @return A value converted from C/C++ \"bool\"\n */\nisHighlighted : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::Control*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ControlButton\n */\ncc.ControlButton = {\n\n/**\n * @method isPushed\n * @return A value converted from C/C++ \"bool\"\n */\nisPushed : function () {},\n\n/**\n * @method setSelected\n * @param {bool}\n */\nsetSelected : function () {},\n\n/**\n * @method setTitleLabelForState\n * @param {cocos2d::Node*}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleLabelForState : function () {},\n\n/**\n * @method setAdjustBackgroundImage\n * @param {bool}\n */\nsetAdjustBackgroundImage : function () {},\n\n/**\n * @method setHighlighted\n * @param {bool}\n */\nsetHighlighted : function () {},\n\n/**\n * @method setZoomOnTouchDown\n * @param {bool}\n */\nsetZoomOnTouchDown : function () {},\n\n/**\n * @method setTitleForState\n * @param {const std::string&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleForState : function () {},\n\n/**\n * @method setLabelAnchorPoint\n * @param {const cocos2d::Point&}\n */\nsetLabelAnchorPoint : function () {},\n\n/**\n * @method getLabelAnchorPoint\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetLabelAnchorPoint : function () {},\n\n/**\n * @method getTitleTTFSizeForState\n * @return A value converted from C/C++ \"float\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleTTFSizeForState : function () {},\n\n/**\n * @method setTitleTTFForState\n * @param {const std::string&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleTTFForState : function () {},\n\n/**\n * @method setTitleTTFSizeForState\n * @param {float}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleTTFSizeForState : function () {},\n\n/**\n * @method setTitleLabel\n * @param {cocos2d::Node*}\n */\nsetTitleLabel : function () {},\n\n/**\n * @method setPreferredSize\n * @param {const cocos2d::Size&}\n */\nsetPreferredSize : function () {},\n\n/**\n * @method getCurrentTitleColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetCurrentTitleColor : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method getBackgroundSpriteForState\n * @return A value converted from C/C++ \"cocos2d::extension::Scale9Sprite*\"\n * @param {cocos2d::extension::Control::State}\n */\ngetBackgroundSpriteForState : function () {},\n\n/**\n * @method getHorizontalOrigin\n * @return A value converted from C/C++ \"int\"\n */\ngetHorizontalOrigin : function () {},\n\n/**\n * @method needsLayout\n */\nneedsLayout : function () {},\n\n/**\n * @method getScaleRatio\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleRatio : function () {},\n\n/**\n * @method getTitleTTFForState\n * @return A value converted from C/C++ \"const std::string&\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleTTFForState : function () {},\n\n/**\n * @method getBackgroundSprite\n * @return A value converted from C/C++ \"cocos2d::extension::Scale9Sprite*\"\n */\ngetBackgroundSprite : function () {},\n\n/**\n * @method getTitleColorForState\n * @return A value converted from C/C++ \"cocos2d::Color3B\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleColorForState : function () {},\n\n/**\n * @method setTitleColorForState\n * @param {const cocos2d::Color3B&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleColorForState : function () {},\n\n/**\n * @method doesAdjustBackgroundImage\n * @return A value converted from C/C++ \"bool\"\n */\ndoesAdjustBackgroundImage : function () {},\n\n/**\n * @method setBackgroundSpriteFrameForState\n * @param {cocos2d::SpriteFrame*}\n * @param {cocos2d::extension::Control::State}\n */\nsetBackgroundSpriteFrameForState : function () {},\n\n/**\n * @method setBackgroundSpriteForState\n * @param {cocos2d::extension::Scale9Sprite*}\n * @param {cocos2d::extension::Control::State}\n */\nsetBackgroundSpriteForState : function () {},\n\n/**\n * @method setScaleRatio\n * @param {float}\n */\nsetScaleRatio : function () {},\n\n/**\n * @method setBackgroundSprite\n * @param {cocos2d::extension::Scale9Sprite*}\n */\nsetBackgroundSprite : function () {},\n\n/**\n * @method getTitleLabel\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetTitleLabel : function () {},\n\n/**\n * @method getPreferredSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetPreferredSize : function () {},\n\n/**\n * @method getVerticalMargin\n * @return A value converted from C/C++ \"int\"\n */\ngetVerticalMargin : function () {},\n\n/**\n * @method getTitleLabelForState\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleLabelForState : function () {},\n\n/**\n * @method setMargins\n * @param {int}\n * @param {int}\n */\nsetMargins : function () {},\n\n/**\n * @method setTitleBMFontForState\n * @param {const std::string&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleBMFontForState : function () {},\n\n/**\n * @method getTitleBMFontForState\n * @return A value converted from C/C++ \"const std::string&\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleBMFontForState : function () {},\n\n/**\n * @method getZoomOnTouchDown\n * @return A value converted from C/C++ \"bool\"\n */\ngetZoomOnTouchDown : function () {},\n\n/**\n * @method getTitleForState\n * @return A value converted from C/C++ \"std::string\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleForState : function () {},\n\n};\n\n/**\n * @class ControlHuePicker\n */\ncc.ControlHuePicker = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method initWithTargetAndPos\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ninitWithTargetAndPos : function () {},\n\n/**\n * @method setHue\n * @param {float}\n */\nsetHue : function () {},\n\n/**\n * @method getStartPos\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartPos : function () {},\n\n/**\n * @method getHue\n * @return A value converted from C/C++ \"float\"\n */\ngetHue : function () {},\n\n/**\n * @method getSlider\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSlider : function () {},\n\n/**\n * @method setBackground\n * @param {cocos2d::Sprite*}\n */\nsetBackground : function () {},\n\n/**\n * @method setHuePercentage\n * @param {float}\n */\nsetHuePercentage : function () {},\n\n/**\n * @method getBackground\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackground : function () {},\n\n/**\n * @method getHuePercentage\n * @return A value converted from C/C++ \"float\"\n */\ngetHuePercentage : function () {},\n\n/**\n * @method setSlider\n * @param {cocos2d::Sprite*}\n */\nsetSlider : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlHuePicker*\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ncreate : function () {},\n\n/**\n * @method ControlHuePicker\n * @constructor\n */\nControlHuePicker : function () {},\n\n};\n\n/**\n * @class ControlSaturationBrightnessPicker\n */\ncc.ControlSaturationBrightnessPicker = {\n\n/**\n * @method getShadow\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetShadow : function () {},\n\n/**\n * @method initWithTargetAndPos\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ninitWithTargetAndPos : function () {},\n\n/**\n * @method getStartPos\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartPos : function () {},\n\n/**\n * @method getOverlay\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetOverlay : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method getSlider\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSlider : function () {},\n\n/**\n * @method getBackground\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackground : function () {},\n\n/**\n * @method getSaturation\n * @return A value converted from C/C++ \"float\"\n */\ngetSaturation : function () {},\n\n/**\n * @method getBrightness\n * @return A value converted from C/C++ \"float\"\n */\ngetBrightness : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlSaturationBrightnessPicker*\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ncreate : function () {},\n\n/**\n * @method ControlSaturationBrightnessPicker\n * @constructor\n */\nControlSaturationBrightnessPicker : function () {},\n\n};\n\n/**\n * @class ControlColourPicker\n */\ncc.ControlColourPicker = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method getHuePicker\n * @return A value converted from C/C++ \"cocos2d::extension::ControlHuePicker*\"\n */\ngetHuePicker : function () {},\n\n/**\n * @method setColor\n * @param {const cocos2d::Color3B&}\n */\nsetColor : function () {},\n\n/**\n * @method hueSliderValueChanged\n * @param {cocos2d::Object*}\n * @param {cocos2d::extension::Control::EventType}\n */\nhueSliderValueChanged : function () {},\n\n/**\n * @method getcolourPicker\n * @return A value converted from C/C++ \"cocos2d::extension::ControlSaturationBrightnessPicker*\"\n */\ngetcolourPicker : function () {},\n\n/**\n * @method setBackground\n * @param {cocos2d::Sprite*}\n */\nsetBackground : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setcolourPicker\n * @param {cocos2d::extension::ControlSaturationBrightnessPicker*}\n */\nsetcolourPicker : function () {},\n\n/**\n * @method colourSliderValueChanged\n * @param {cocos2d::Object*}\n * @param {cocos2d::extension::Control::EventType}\n */\ncolourSliderValueChanged : function () {},\n\n/**\n * @method setHuePicker\n * @param {cocos2d::extension::ControlHuePicker*}\n */\nsetHuePicker : function () {},\n\n/**\n * @method getBackground\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackground : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlColourPicker*\"\n */\ncreate : function () {},\n\n/**\n * @method ControlColourPicker\n * @constructor\n */\nControlColourPicker : function () {},\n\n};\n\n/**\n * @class ControlPotentiometer\n */\ncc.ControlPotentiometer = {\n\n/**\n * @method setPreviousLocation\n * @param {cocos2d::Point}\n */\nsetPreviousLocation : function () {},\n\n/**\n * @method setValue\n * @param {float}\n */\nsetValue : function () {},\n\n/**\n * @method getProgressTimer\n * @return A value converted from C/C++ \"cocos2d::ProgressTimer*\"\n */\ngetProgressTimer : function () {},\n\n/**\n * @method getMaximumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMaximumValue : function () {},\n\n/**\n * @method angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint\n * @return A value converted from C/C++ \"float\"\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n */\nangleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : function () {},\n\n/**\n * @method potentiometerBegan\n * @param {cocos2d::Point}\n */\npotentiometerBegan : function () {},\n\n/**\n * @method setMaximumValue\n * @param {float}\n */\nsetMaximumValue : function () {},\n\n/**\n * @method getMinimumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMinimumValue : function () {},\n\n/**\n * @method setThumbSprite\n * @param {cocos2d::Sprite*}\n */\nsetThumbSprite : function () {},\n\n/**\n * @method getValue\n * @return A value converted from C/C++ \"float\"\n */\ngetValue : function () {},\n\n/**\n * @method getPreviousLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPreviousLocation : function () {},\n\n/**\n * @method distanceBetweenPointAndPoint\n * @return A value converted from C/C++ \"float\"\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n */\ndistanceBetweenPointAndPoint : function () {},\n\n/**\n * @method potentiometerEnded\n * @param {cocos2d::Point}\n */\npotentiometerEnded : function () {},\n\n/**\n * @method setProgressTimer\n * @param {cocos2d::ProgressTimer*}\n */\nsetProgressTimer : function () {},\n\n/**\n * @method setMinimumValue\n * @param {float}\n */\nsetMinimumValue : function () {},\n\n/**\n * @method getThumbSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetThumbSprite : function () {},\n\n/**\n * @method initWithTrackSprite_ProgressTimer_ThumbSprite\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Sprite*}\n * @param {cocos2d::ProgressTimer*}\n * @param {cocos2d::Sprite*}\n */\ninitWithTrackSprite_ProgressTimer_ThumbSprite : function () {},\n\n/**\n * @method potentiometerMoved\n * @param {cocos2d::Point}\n */\npotentiometerMoved : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlPotentiometer*\"\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n */\ncreate : function () {},\n\n/**\n * @method ControlPotentiometer\n * @constructor\n */\nControlPotentiometer : function () {},\n\n};\n\n/**\n * @class ControlSlider\n */\ncc.ControlSlider = {\n\n/**\n * @method getSelectedThumbSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSelectedThumbSprite : function () {},\n\n/**\n * @method locationFromTouch\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nlocationFromTouch : function () {},\n\n/**\n * @method setSelectedThumbSprite\n * @param {cocos2d::Sprite*}\n */\nsetSelectedThumbSprite : function () {},\n\n/**\n * @method setProgressSprite\n * @param {cocos2d::Sprite*}\n */\nsetProgressSprite : function () {},\n\n/**\n * @method getMaximumAllowedValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMaximumAllowedValue : function () {},\n\n/**\n * @method getMinimumAllowedValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMinimumAllowedValue : function () {},\n\n/**\n * @method getMinimumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMinimumValue : function () {},\n\n/**\n * @method setThumbSprite\n * @param {cocos2d::Sprite*}\n */\nsetThumbSprite : function () {},\n\n/**\n * @method setMinimumValue\n * @param {float}\n */\nsetMinimumValue : function () {},\n\n/**\n * @method setMinimumAllowedValue\n * @param {float}\n */\nsetMinimumAllowedValue : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method setValue\n * @param {float}\n */\nsetValue : function () {},\n\n/**\n * @method setMaximumValue\n * @param {float}\n */\nsetMaximumValue : function () {},\n\n/**\n * @method needsLayout\n */\nneedsLayout : function () {},\n\n/**\n * @method getBackgroundSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackgroundSprite : function () {},\n\n/**\n * @method getMaximumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMaximumValue : function () {},\n\n/**\n * @method isTouchInside\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Touch*}\n */\nisTouchInside : function () {},\n\n/**\n * @method getValue\n * @return A value converted from C/C++ \"float\"\n */\ngetValue : function () {},\n\n/**\n * @method getThumbSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetThumbSprite : function () {},\n\n/**\n * @method getProgressSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetProgressSprite : function () {},\n\n/**\n * @method setBackgroundSprite\n * @param {cocos2d::Sprite*}\n */\nsetBackgroundSprite : function () {},\n\n/**\n * @method setMaximumAllowedValue\n * @param {float}\n */\nsetMaximumAllowedValue : function () {},\n\n/**\n * @method ControlSlider\n * @constructor\n */\nControlSlider : function () {},\n\n};\n\n/**\n * @class ControlStepper\n */\ncc.ControlStepper = {\n\n/**\n * @method setMinusSprite\n * @param {cocos2d::Sprite*}\n */\nsetMinusSprite : function () {},\n\n/**\n * @method getMinusLabel\n * @return A value converted from C/C++ \"cocos2d::LabelTTF*\"\n */\ngetMinusLabel : function () {},\n\n/**\n * @method setWraps\n * @param {bool}\n */\nsetWraps : function () {},\n\n/**\n * @method isContinuous\n * @return A value converted from C/C++ \"bool\"\n */\nisContinuous : function () {},\n\n/**\n * @method getMinusSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetMinusSprite : function () {},\n\n/**\n * @method updateLayoutUsingTouchLocation\n * @param {cocos2d::Point}\n */\nupdateLayoutUsingTouchLocation : function () {},\n\n/**\n * @method setValueWithSendingEvent\n * @param {double}\n * @param {bool}\n */\nsetValueWithSendingEvent : function () {},\n\n/**\n * @method getPlusLabel\n * @return A value converted from C/C++ \"cocos2d::LabelTTF*\"\n */\ngetPlusLabel : function () {},\n\n/**\n * @method stopAutorepeat\n */\nstopAutorepeat : function () {},\n\n/**\n * @method setMinimumValue\n * @param {double}\n */\nsetMinimumValue : function () {},\n\n/**\n * @method getPlusSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetPlusSprite : function () {},\n\n/**\n * @method setPlusSprite\n * @param {cocos2d::Sprite*}\n */\nsetPlusSprite : function () {},\n\n/**\n * @method setMinusLabel\n * @param {cocos2d::LabelTTF*}\n */\nsetMinusLabel : function () {},\n\n/**\n * @method setValue\n * @param {double}\n */\nsetValue : function () {},\n\n/**\n * @method setStepValue\n * @param {double}\n */\nsetStepValue : function () {},\n\n/**\n * @method setMaximumValue\n * @param {double}\n */\nsetMaximumValue : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method startAutorepeat\n */\nstartAutorepeat : function () {},\n\n/**\n * @method initWithMinusSpriteAndPlusSprite\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Sprite*}\n * @param {cocos2d::Sprite*}\n */\ninitWithMinusSpriteAndPlusSprite : function () {},\n\n/**\n * @method getValue\n * @return A value converted from C/C++ \"double\"\n */\ngetValue : function () {},\n\n/**\n * @method setPlusLabel\n * @param {cocos2d::LabelTTF*}\n */\nsetPlusLabel : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlStepper*\"\n * @param {cocos2d::Sprite*}\n * @param {cocos2d::Sprite*}\n */\ncreate : function () {},\n\n/**\n * @method ControlStepper\n * @constructor\n */\nControlStepper : function () {},\n\n};\n\n/**\n * @class ControlSwitch\n */\ncc.ControlSwitch = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method isOn\n * @return A value converted from C/C++ \"bool\"\n */\nisOn : function () {},\n\n/**\n * @method hasMoved\n * @return A value converted from C/C++ \"bool\"\n */\nhasMoved : function () {},\n\n/**\n * @method locationFromTouch\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nlocationFromTouch : function () {},\n\n/**\n * @method ControlSwitch\n * @constructor\n */\nControlSwitch : function () {},\n\n};\n\n/**\n * @class ScrollView\n */\ncc.ScrollView = {\n\n/**\n * @method isClippingToBounds\n * @return A value converted from C/C++ \"bool\"\n */\nisClippingToBounds : function () {},\n\n/**\n * @method setContainer\n * @param {cocos2d::Node*}\n */\nsetContainer : function () {},\n\n/**\n * @method setContentOffsetInDuration\n * @param {cocos2d::Point}\n * @param {float}\n */\nsetContentOffsetInDuration : function () {},\n\n/**\n * @method setZoomScaleInDuration\n * @param {float}\n * @param {float}\n */\nsetZoomScaleInDuration : function () {},\n\n/**\n * @method setBounceable\n * @param {bool}\n */\nsetBounceable : function () {},\n\n/**\n * @method getDirection\n * @return A value converted from C/C++ \"cocos2d::extension::ScrollView::Direction\"\n */\ngetDirection : function () {},\n\n/**\n * @method getContainer\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetContainer : function () {},\n\n/**\n * @method getZoomScale\n * @return A value converted from C/C++ \"float\"\n */\ngetZoomScale : function () {},\n\n/**\n * @method updateInset\n */\nupdateInset : function () {},\n\n/**\n * @method initWithViewSize\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Size}\n * @param {cocos2d::Node*}\n */\ninitWithViewSize : function () {},\n\n/**\n * @method pause\n * @param {cocos2d::Object*}\n */\npause : function () {},\n\n/**\n * @method setDirection\n * @param {cocos2d::extension::ScrollView::Direction}\n */\nsetDirection : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setContentOffset\n * @param {cocos2d::Point}\n * @param {bool}\n */\nsetContentOffset : function () {},\n\n/**\n * @method isDragging\n * @return A value converted from C/C++ \"bool\"\n */\nisDragging : function () {},\n\n/**\n * @method isTouchEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchEnabled : function () {},\n\n/**\n * @method isBounceable\n * @return A value converted from C/C++ \"bool\"\n */\nisBounceable : function () {},\n\n/**\n * @method setTouchEnabled\n * @param {bool}\n */\nsetTouchEnabled : function () {},\n\n/**\n * @method getContentOffset\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetContentOffset : function () {},\n\n/**\n * @method resume\n * @param {cocos2d::Object*}\n */\nresume : function () {},\n\n/**\n * @method setClippingToBounds\n * @param {bool}\n */\nsetClippingToBounds : function () {},\n\n/**\n * @method setViewSize\n * @param {cocos2d::Size}\n */\nsetViewSize : function () {},\n\n/**\n * @method getViewSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetViewSize : function () {},\n\n/**\n * @method maxContainerOffset\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\nmaxContainerOffset : function () {},\n\n/**\n * @method isTouchMoved\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchMoved : function () {},\n\n/**\n * @method isNodeVisible\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Node*}\n */\nisNodeVisible : function () {},\n\n/**\n * @method minContainerOffset\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\nminContainerOffset : function () {},\n\n/**\n * @method ScrollView\n * @constructor\n */\nScrollView : function () {},\n\n};\n\n/**\n * @class TableViewCell\n */\ncc.TableViewCell = {\n\n/**\n * @method reset\n */\nreset : function () {},\n\n/**\n * @method getIdx\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetIdx : function () {},\n\n/**\n * @method setIdx\n * @param {ssize_t}\n */\nsetIdx : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::TableViewCell*\"\n */\ncreate : function () {},\n\n/**\n * @method TableViewCell\n * @constructor\n */\nTableViewCell : function () {},\n\n};\n\n/**\n * @class TableView\n */\ncc.TableView = {\n\n/**\n * @method updateCellAtIndex\n * @param {ssize_t}\n */\nupdateCellAtIndex : function () {},\n\n/**\n * @method setVerticalFillOrder\n * @param {cocos2d::extension::TableView::VerticalFillOrder}\n */\nsetVerticalFillOrder : function () {},\n\n/**\n * @method scrollViewDidZoom\n * @param {cocos2d::extension::ScrollView*}\n */\nscrollViewDidZoom : function () {},\n\n/**\n * @method _updateContentSize\n */\n_updateContentSize : function () {},\n\n/**\n * @method getVerticalFillOrder\n * @return A value converted from C/C++ \"cocos2d::extension::TableView::VerticalFillOrder\"\n */\ngetVerticalFillOrder : function () {},\n\n/**\n * @method removeCellAtIndex\n * @param {ssize_t}\n */\nremoveCellAtIndex : function () {},\n\n/**\n * @method initWithViewSize\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Size}\n * @param {cocos2d::Node*}\n */\ninitWithViewSize : function () {},\n\n/**\n * @method scrollViewDidScroll\n * @param {cocos2d::extension::ScrollView*}\n */\nscrollViewDidScroll : function () {},\n\n/**\n * @method reloadData\n */\nreloadData : function () {},\n\n/**\n * @method insertCellAtIndex\n * @param {ssize_t}\n */\ninsertCellAtIndex : function () {},\n\n/**\n * @method cellAtIndex\n * @return A value converted from C/C++ \"cocos2d::extension::TableViewCell*\"\n * @param {ssize_t}\n */\ncellAtIndex : function () {},\n\n/**\n * @method dequeueCell\n * @return A value converted from C/C++ \"cocos2d::extension::TableViewCell*\"\n */\ndequeueCell : function () {},\n\n/**\n * @method TableView\n * @constructor\n */\nTableView : function () {},\n\n};\n\n/**\n * @class EditBox\n */\ncc.EditBox = {\n\n/**\n * @method getText\n * @return A value converted from C/C++ \"const char*\"\n */\ngetText : function () {},\n\n/**\n * @method setPlaceholderFontName\n * @param {const char*}\n */\nsetPlaceholderFontName : function () {},\n\n/**\n * @method getPlaceHolder\n * @return A value converted from C/C++ \"const char*\"\n */\ngetPlaceHolder : function () {},\n\n/**\n * @method setFontName\n * @param {const char*}\n */\nsetFontName : function () {},\n\n/**\n * @method setPlaceholderFontSize\n * @param {int}\n */\nsetPlaceholderFontSize : function () {},\n\n/**\n * @method setInputMode\n * @param {cocos2d::extension::EditBox::InputMode}\n */\nsetInputMode : function () {},\n\n/**\n * @method setPlaceholderFontColor\n * @param {const cocos2d::Color3B&}\n */\nsetPlaceholderFontColor : function () {},\n\n/**\n * @method setFontColor\n * @param {const cocos2d::Color3B&}\n */\nsetFontColor : function () {},\n\n/**\n * @method setPlaceholderFont\n * @param {const char*}\n * @param {int}\n */\nsetPlaceholderFont : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n/**\n * @method initWithSizeAndBackgroundSprite\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Size&}\n * @param {cocos2d::extension::Scale9Sprite*}\n */\ninitWithSizeAndBackgroundSprite : function () {},\n\n/**\n * @method setPlaceHolder\n * @param {const char*}\n */\nsetPlaceHolder : function () {},\n\n/**\n * @method setReturnType\n * @param {cocos2d::extension::EditBox::KeyboardReturnType}\n */\nsetReturnType : function () {},\n\n/**\n * @method setInputFlag\n * @param {cocos2d::extension::EditBox::InputFlag}\n */\nsetInputFlag : function () {},\n\n/**\n * @method getMaxLength\n * @return A value converted from C/C++ \"int\"\n */\ngetMaxLength : function () {},\n\n/**\n * @method setText\n * @param {const char*}\n */\nsetText : function () {},\n\n/**\n * @method setMaxLength\n * @param {int}\n */\nsetMaxLength : function () {},\n\n/**\n * @method setFont\n * @param {const char*}\n * @param {int}\n */\nsetFont : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::EditBox*\"\n * @param {const cocos2d::Size&}\n * @param {cocos2d::extension::Scale9Sprite*}\n * @param {cocos2d::extension::Scale9Sprite*}\n * @param {cocos2d::extension::Scale9Sprite*}\n */\ncreate : function () {},\n\n/**\n * @method EditBox\n * @constructor\n */\nEditBox : function () {},\n\n};\n\n/**\n * @class AssetsManager\n */\ncc.AssetsManager = {\n\n/**\n * @method setStoragePath\n * @param {const char*}\n */\nsetStoragePath : function () {},\n\n/**\n * @method setPackageUrl\n * @param {const char*}\n */\nsetPackageUrl : function () {},\n\n/**\n * @method checkUpdate\n * @return A value converted from C/C++ \"bool\"\n */\ncheckUpdate : function () {},\n\n/**\n * @method getStoragePath\n * @return A value converted from C/C++ \"const char*\"\n */\ngetStoragePath : function () {},\n\n/**\n * @method update\n */\nupdate : function () {},\n\n/**\n * @method setConnectionTimeout\n * @param {unsigned int}\n */\nsetConnectionTimeout : function () {},\n\n/**\n * @method setVersionFileUrl\n * @param {const char*}\n */\nsetVersionFileUrl : function () {},\n\n/**\n * @method getPackageUrl\n * @return A value converted from C/C++ \"const char*\"\n */\ngetPackageUrl : function () {},\n\n/**\n * @method getConnectionTimeout\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetConnectionTimeout : function () {},\n\n/**\n * @method getVersion\n * @return A value converted from C/C++ \"std::string\"\n */\ngetVersion : function () {},\n\n/**\n * @method getVersionFileUrl\n * @return A value converted from C/C++ \"const char*\"\n */\ngetVersionFileUrl : function () {},\n\n/**\n * @method deleteVersion\n */\ndeleteVersion : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::AssetsManager*\"\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::extension::AssetsManager::ErrorCallback}\n * @param {cocos2d::extension::AssetsManager::ProgressCallback}\n * @param {cocos2d::extension::AssetsManager::SuccessCallback}\n */\ncreate : function () {},\n\n/**\n * @method AssetsManager\n * @constructor\n */\nAssetsManager : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_gui_auto.cpp",
    "content": "#include \"jsb_cocos2dx_gui_auto.hpp\"\n#include \"cocos2d_specifics.hpp\"\n#include \"CocosGUI.h\"\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n    JSObject* global = ScriptingCore::getInstance()->getGlobalObject();\n\tisNewValid = JS_GetProperty(cx, global, \"initializing\", &initializing) && JSVAL_TO_BOOLEAN(initializing);\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n    JS_ReportError(cx, \"Don't use `new cc.XXX`, please use `cc.XXX.create` instead! \");\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_is_native_obj(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n\tvp.set(BOOLEAN_TO_JSVAL(JS_TRUE));\n\treturn JS_TRUE;\t\n}\nJSClass  *jsb_cocos2d_gui_LayoutParameter_class;\nJSObject *jsb_cocos2d_gui_LayoutParameter_prototype;\n\nJSBool js_cocos2dx_gui_LayoutParameter_getLayoutType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LayoutParameter* cobj = (cocos2d::gui::LayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LayoutParameter_getLayoutType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getLayoutType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LayoutParameter_getLayoutType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LayoutParameter_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::LayoutParameter* ret = cocos2d::gui::LayoutParameter::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::LayoutParameter>(cx, (cocos2d::gui::LayoutParameter*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LayoutParameter_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_LayoutParameter_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::LayoutParameter* cobj = new cocos2d::gui::LayoutParameter();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::LayoutParameter> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::LayoutParameter\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LayoutParameter_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_gui_LayoutParameter_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LayoutParameter)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_LayoutParameter(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_LayoutParameter_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_LayoutParameter_class->name = \"LayoutParameter\";\n\tjsb_cocos2d_gui_LayoutParameter_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_LayoutParameter_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_LayoutParameter_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_LayoutParameter_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_LayoutParameter_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_LayoutParameter_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_LayoutParameter_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_LayoutParameter_class->finalize = js_cocos2d_gui_LayoutParameter_finalize;\n\tjsb_cocos2d_gui_LayoutParameter_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getLayoutType\", js_cocos2dx_gui_LayoutParameter_getLayoutType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_LayoutParameter_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_LayoutParameter_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_gui_LayoutParameter_class,\n\t\tjs_cocos2dx_gui_LayoutParameter_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LayoutParameter\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::LayoutParameter> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_LayoutParameter_class;\n\t\tp->proto = jsb_cocos2d_gui_LayoutParameter_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_LinearLayoutParameter_class;\nJSObject *jsb_cocos2d_gui_LinearLayoutParameter_prototype;\n\nJSBool js_cocos2dx_gui_LinearLayoutParameter_setGravity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LinearLayoutParameter* cobj = (cocos2d::gui::LinearLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LinearLayoutParameter_setGravity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::LinearGravity arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_LinearLayoutParameter_setGravity : Error processing arguments\");\n\t\tcobj->setGravity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LinearLayoutParameter_setGravity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LinearLayoutParameter_getGravity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LinearLayoutParameter* cobj = (cocos2d::gui::LinearLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LinearLayoutParameter_getGravity : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getGravity();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LinearLayoutParameter_getGravity : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LinearLayoutParameter_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::LinearLayoutParameter* ret = cocos2d::gui::LinearLayoutParameter::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::LinearLayoutParameter>(cx, (cocos2d::gui::LinearLayoutParameter*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LinearLayoutParameter_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_LinearLayoutParameter_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::LinearLayoutParameter* cobj = new cocos2d::gui::LinearLayoutParameter();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::LinearLayoutParameter> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::LinearLayoutParameter\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LinearLayoutParameter_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_LayoutParameter_prototype;\n\nvoid js_cocos2d_gui_LinearLayoutParameter_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LinearLayoutParameter)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_LinearLayoutParameter(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_LinearLayoutParameter_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->name = \"LinearLayoutParameter\";\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->finalize = js_cocos2d_gui_LinearLayoutParameter_finalize;\n\tjsb_cocos2d_gui_LinearLayoutParameter_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setGravity\", js_cocos2dx_gui_LinearLayoutParameter_setGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGravity\", js_cocos2dx_gui_LinearLayoutParameter_getGravity, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_LinearLayoutParameter_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_LinearLayoutParameter_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_LayoutParameter_prototype,\n\t\tjsb_cocos2d_gui_LinearLayoutParameter_class,\n\t\tjs_cocos2dx_gui_LinearLayoutParameter_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LinearLayoutParameter\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::LinearLayoutParameter> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_LinearLayoutParameter_class;\n\t\tp->proto = jsb_cocos2d_gui_LinearLayoutParameter_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_LayoutParameter_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_RelativeLayoutParameter_class;\nJSObject *jsb_cocos2d_gui_RelativeLayoutParameter_prototype;\n\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_setAlign(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::RelativeLayoutParameter* cobj = (cocos2d::gui::RelativeLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_setAlign : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::RelativeAlign arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_setAlign : Error processing arguments\");\n\t\tcobj->setAlign(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_setAlign : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::RelativeLayoutParameter* cobj = (cocos2d::gui::RelativeLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName : Error processing arguments\");\n\t\tcobj->setRelativeToWidgetName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_getRelativeName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::RelativeLayoutParameter* cobj = (cocos2d::gui::RelativeLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_getRelativeName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getRelativeName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_getRelativeName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::RelativeLayoutParameter* cobj = (cocos2d::gui::RelativeLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getRelativeToWidgetName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_setRelativeName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::RelativeLayoutParameter* cobj = (cocos2d::gui::RelativeLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_setRelativeName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_setRelativeName : Error processing arguments\");\n\t\tcobj->setRelativeName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_setRelativeName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_getAlign(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::RelativeLayoutParameter* cobj = (cocos2d::gui::RelativeLayoutParameter *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_RelativeLayoutParameter_getAlign : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getAlign();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_getAlign : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::RelativeLayoutParameter* ret = cocos2d::gui::RelativeLayoutParameter::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::RelativeLayoutParameter>(cx, (cocos2d::gui::RelativeLayoutParameter*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::RelativeLayoutParameter* cobj = new cocos2d::gui::RelativeLayoutParameter();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::RelativeLayoutParameter> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::RelativeLayoutParameter\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_RelativeLayoutParameter_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_LayoutParameter_prototype;\n\nvoid js_cocos2d_gui_RelativeLayoutParameter_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (RelativeLayoutParameter)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_RelativeLayoutParameter(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->name = \"RelativeLayoutParameter\";\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->finalize = js_cocos2d_gui_RelativeLayoutParameter_finalize;\n\tjsb_cocos2d_gui_RelativeLayoutParameter_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setAlign\", js_cocos2dx_gui_RelativeLayoutParameter_setAlign, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRelativeToWidgetName\", js_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRelativeName\", js_cocos2dx_gui_RelativeLayoutParameter_getRelativeName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRelativeToWidgetName\", js_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRelativeName\", js_cocos2dx_gui_RelativeLayoutParameter_setRelativeName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAlign\", js_cocos2dx_gui_RelativeLayoutParameter_getAlign, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_RelativeLayoutParameter_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_RelativeLayoutParameter_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_LayoutParameter_prototype,\n\t\tjsb_cocos2d_gui_RelativeLayoutParameter_class,\n\t\tjs_cocos2dx_gui_RelativeLayoutParameter_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"RelativeLayoutParameter\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::RelativeLayoutParameter> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_RelativeLayoutParameter_class;\n\t\tp->proto = jsb_cocos2d_gui_RelativeLayoutParameter_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_LayoutParameter_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_Widget_class;\nJSObject *jsb_cocos2d_gui_Widget_prototype;\n\nJSBool js_cocos2dx_gui_Widget_getVirtualRenderer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getVirtualRenderer : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getVirtualRenderer();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getVirtualRenderer : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setSizePercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setSizePercent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setSizePercent : Error processing arguments\");\n\t\tcobj->setSizePercent(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setSizePercent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setActionTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setActionTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setActionTag : Error processing arguments\");\n\t\tcobj->setActionTag(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setActionTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getNodeByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getNodeByTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getNodeByTag : Error processing arguments\");\n\t\tcocos2d::Node* ret = cobj->getNodeByTag(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getNodeByTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_isFlipY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_isFlipY : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isFlipY();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_isFlipY : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getTouchEndPos(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getTouchEndPos : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getTouchEndPos();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getTouchEndPos : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setPositionPercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setPositionPercent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setPositionPercent : Error processing arguments\");\n\t\tcobj->setPositionPercent(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setPositionPercent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getNodes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getNodes : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::Node *>& ret = cobj->getNodes();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getNodes : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setPositionType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setPositionType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::PositionType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setPositionType : Error processing arguments\");\n\t\tcobj->setPositionType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setPositionType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isIgnoreContentAdaptWithSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_updateSizeAndPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_updateSizeAndPosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateSizeAndPosition();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_updateSizeAndPosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getBottomInParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getBottomInParent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getBottomInParent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getBottomInParent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getActionTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getActionTag : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getActionTag();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getActionTag : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getLayoutParameter(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getLayoutParameter : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::LayoutParameterType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getLayoutParameter : Error processing arguments\");\n\t\tcocos2d::gui::LayoutParameter* ret = cobj->getLayoutParameter(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::LayoutParameter>(cx, (cocos2d::gui::LayoutParameter*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getLayoutParameter : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getPositionType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getPositionType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getPositionType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getPositionType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setName : Error processing arguments\");\n\t\tcobj->setName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getChildByName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getChildByName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getChildByName : Error processing arguments\");\n\t\tcocos2d::gui::Widget* ret = cobj->getChildByName(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getChildByName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_isEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_isEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_isEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_isFlipX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_isFlipX : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isFlipX();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_isFlipX : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_removeNodeByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_removeNodeByTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_removeNodeByTag : Error processing arguments\");\n\t\tcobj->removeNodeByTag(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_removeNodeByTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_isTouchEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTouchEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_isTouchEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getContentSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getContentSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getContentSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getContentSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getTouchStartPos(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getTouchStartPos : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getTouchStartPos();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getTouchStartPos : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_didNotSelectSelf(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_didNotSelectSelf : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->didNotSelectSelf();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_didNotSelectSelf : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setFocused(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setFocused : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setFocused : Error processing arguments\");\n\t\tcobj->setFocused(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setFocused : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setTouchEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setTouchEnabled : Error processing arguments\");\n\t\tcobj->setTouchEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setTouchEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_clone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_clone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::gui::Widget* ret = cobj->clone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_clone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getTouchMovePos(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getTouchMovePos : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getTouchMovePos();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getTouchMovePos : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setEnabled : Error processing arguments\");\n\t\tcobj->setEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setBrightStyle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setBrightStyle : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::BrightStyle arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setBrightStyle : Error processing arguments\");\n\t\tcobj->setBrightStyle(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setBrightStyle : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_addNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::gui::Widget* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_addNode : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addNode(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addNode(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg2;\n\t\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addNode(arg0, arg1, arg2);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_addNode : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setLayoutParameter(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setLayoutParameter : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::LayoutParameter* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::LayoutParameter*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setLayoutParameter : Error processing arguments\");\n\t\tcobj->setLayoutParameter(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setLayoutParameter : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setFlipY(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setFlipY : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setFlipY : Error processing arguments\");\n\t\tcobj->setFlipY(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setFlipY : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setFlipX(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setFlipX : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setFlipX : Error processing arguments\");\n\t\tcobj->setFlipX(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setFlipX : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getLeftInParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getLeftInParent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getLeftInParent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getLeftInParent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_ignoreContentAdaptWithSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_ignoreContentAdaptWithSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_ignoreContentAdaptWithSize : Error processing arguments\");\n\t\tcobj->ignoreContentAdaptWithSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_ignoreContentAdaptWithSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_isBright(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_isBright : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBright();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_isBright : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_clippingParentAreaContainPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_clippingParentAreaContainPoint : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_clippingParentAreaContainPoint : Error processing arguments\");\n\t\tJSBool ret = cobj->clippingParentAreaContainPoint(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_clippingParentAreaContainPoint : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getSizePercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getSizePercent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getSizePercent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getSizePercent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getTopInParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getTopInParent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getTopInParent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getTopInParent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getWidgetType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getWidgetType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getWidgetType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getWidgetType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getRightInParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getRightInParent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getRightInParent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getRightInParent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getSizeType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getSizeType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getSizeType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getSizeType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_removeNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_removeNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_removeNode : Error processing arguments\");\n\t\tcobj->removeNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_removeNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_removeAllNodes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_removeAllNodes : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeAllNodes();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_removeAllNodes : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getWorldPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getWorldPosition : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getWorldPosition();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getWorldPosition : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_getPositionPercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_getPositionPercent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Point& ret = cobj->getPositionPercent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_getPositionPercent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_hitTest(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_hitTest : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_hitTest : Error processing arguments\");\n\t\tJSBool ret = cobj->hitTest(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_hitTest : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_isFocused(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_isFocused : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isFocused();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_isFocused : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setSizeType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setSizeType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::SizeType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setSizeType : Error processing arguments\");\n\t\tcobj->setSizeType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setSizeType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_checkChildInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_checkChildInfo : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tcocos2d::gui::Widget* arg1;\n\t\tcocos2d::Point arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_checkChildInfo : Error processing arguments\");\n\t\tcobj->checkChildInfo(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_checkChildInfo : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setSize : Error processing arguments\");\n\t\tcobj->setSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_setBright(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Widget* cobj = (cocos2d::gui::Widget *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setBright : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Widget_setBright : Error processing arguments\");\n\t\tcobj->setBright(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_setBright : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Widget_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Widget* ret = cocos2d::gui::Widget::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Widget_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Widget* cobj = new cocos2d::gui::Widget();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::Widget> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::Widget\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Widget_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocos2d_gui_Widget_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Widget)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_Widget(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_Widget_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_Widget_class->name = \"Widget\";\n\tjsb_cocos2d_gui_Widget_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Widget_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_Widget_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Widget_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_Widget_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_Widget_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_Widget_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_Widget_class->finalize = js_cocos2d_gui_Widget_finalize;\n\tjsb_cocos2d_gui_Widget_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getVirtualRenderer\", js_cocos2dx_gui_Widget_getVirtualRenderer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSizePercent\", js_cocos2dx_gui_Widget_setSizePercent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setActionTag\", js_cocos2dx_gui_Widget_setActionTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeByTag\", js_cocos2dx_gui_Widget_getNodeByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFlipY\", js_cocos2dx_gui_Widget_isFlipY, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTouchEndPos\", js_cocos2dx_gui_Widget_getTouchEndPos, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPositionPercent\", js_cocos2dx_gui_Widget_setPositionPercent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodes\", js_cocos2dx_gui_Widget_getNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPositionType\", js_cocos2dx_gui_Widget_setPositionType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getName\", js_cocos2dx_gui_Widget_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isIgnoreContentAdaptWithSize\", js_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateSizeAndPosition\", js_cocos2dx_gui_Widget_updateSizeAndPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBottomInParent\", js_cocos2dx_gui_Widget_getBottomInParent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getActionTag\", js_cocos2dx_gui_Widget_getActionTag, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayoutParameter\", js_cocos2dx_gui_Widget_getLayoutParameter, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPositionType\", js_cocos2dx_gui_Widget_getPositionType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setName\", js_cocos2dx_gui_Widget_setName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getChildByName\", js_cocos2dx_gui_Widget_getChildByName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isEnabled\", js_cocos2dx_gui_Widget_isEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFlipX\", js_cocos2dx_gui_Widget_isFlipX, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeNodeByTag\", js_cocos2dx_gui_Widget_removeNodeByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTouchEnabled\", js_cocos2dx_gui_Widget_isTouchEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContentSize\", js_cocos2dx_gui_Widget_getContentSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTouchStartPos\", js_cocos2dx_gui_Widget_getTouchStartPos, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"didNotSelectSelf\", js_cocos2dx_gui_Widget_didNotSelectSelf, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFocused\", js_cocos2dx_gui_Widget_setFocused, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchEnabled\", js_cocos2dx_gui_Widget_setTouchEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clone\", js_cocos2dx_gui_Widget_clone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTouchMovePos\", js_cocos2dx_gui_Widget_getTouchMovePos, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEnabled\", js_cocos2dx_gui_Widget_setEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBrightStyle\", js_cocos2dx_gui_Widget_setBrightStyle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addNode\", js_cocos2dx_gui_Widget_addNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayoutParameter\", js_cocos2dx_gui_Widget_setLayoutParameter, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFlipY\", js_cocos2dx_gui_Widget_setFlipY, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFlipX\", js_cocos2dx_gui_Widget_setFlipX, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLeftInParent\", js_cocos2dx_gui_Widget_getLeftInParent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"ignoreContentAdaptWithSize\", js_cocos2dx_gui_Widget_ignoreContentAdaptWithSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isBright\", js_cocos2dx_gui_Widget_isBright, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clippingParentAreaContainPoint\", js_cocos2dx_gui_Widget_clippingParentAreaContainPoint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSizePercent\", js_cocos2dx_gui_Widget_getSizePercent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTopInParent\", js_cocos2dx_gui_Widget_getTopInParent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getWidgetType\", js_cocos2dx_gui_Widget_getWidgetType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSize\", js_cocos2dx_gui_Widget_getSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRightInParent\", js_cocos2dx_gui_Widget_getRightInParent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSizeType\", js_cocos2dx_gui_Widget_getSizeType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeNode\", js_cocos2dx_gui_Widget_removeNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllNodes\", js_cocos2dx_gui_Widget_removeAllNodes, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getWorldPosition\", js_cocos2dx_gui_Widget_getWorldPosition, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPositionPercent\", js_cocos2dx_gui_Widget_getPositionPercent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hitTest\", js_cocos2dx_gui_Widget_hitTest, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFocused\", js_cocos2dx_gui_Widget_isFocused, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSizeType\", js_cocos2dx_gui_Widget_setSizeType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"checkChildInfo\", js_cocos2dx_gui_Widget_checkChildInfo, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSize\", js_cocos2dx_gui_Widget_setSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBright\", js_cocos2dx_gui_Widget_setBright, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_Widget_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_Widget_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocos2d_gui_Widget_class,\n\t\tjs_cocos2dx_gui_Widget_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Widget\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::Widget> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_Widget_class;\n\t\tp->proto = jsb_cocos2d_gui_Widget_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_Layout_class;\nJSObject *jsb_cocos2d_gui_Layout_prototype;\n\nJSBool js_cocos2dx_gui_Layout_setBackGroundColorVector(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundColorVector : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundColorVector : Error processing arguments\");\n\t\tcobj->setBackGroundColorVector(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setBackGroundColorVector : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_hitTest(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_hitTest : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_hitTest : Error processing arguments\");\n\t\tJSBool ret = cobj->hitTest(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_hitTest : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_getBackGroundImageTextureSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_getBackGroundImageTextureSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getBackGroundImageTextureSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_getBackGroundImageTextureSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_getLayoutType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_getLayoutType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getLayoutType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_getLayoutType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setClippingType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setClippingType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::LayoutClippingType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setClippingType : Error processing arguments\");\n\t\tcobj->setClippingType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setClippingType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setBackGroundColorType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundColorType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::LayoutBackGroundColorType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundColorType : Error processing arguments\");\n\t\tcobj->setBackGroundColorType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setBackGroundColorType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setBackGroundImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundImage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundImage : Error processing arguments\");\n\t\tcobj->setBackGroundImage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundImage : Error processing arguments\");\n\t\tcobj->setBackGroundImage(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setBackGroundImage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setBackGroundColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::gui::Layout* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundColor : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Color3B arg0;\n\t\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::Color3B arg1;\n\t\t\tok &= jsval_to_cccolor3b(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setBackGroundColor(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Color3B arg0;\n\t\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->setBackGroundColor(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setBackGroundColor : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_requestDoLayout(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_requestDoLayout : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->requestDoLayout();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_requestDoLayout : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_isClippingEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_isClippingEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isClippingEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_isClippingEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setBackGroundColorOpacity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundColorOpacity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundColorOpacity : Error processing arguments\");\n\t\tcobj->setBackGroundColorOpacity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setBackGroundColorOpacity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setBackGroundImageCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundImageCapInsets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundImageCapInsets : Error processing arguments\");\n\t\tcobj->setBackGroundImageCapInsets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setBackGroundImageCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_removeBackGroundImage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_removeBackGroundImage : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeBackGroundImage();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_removeBackGroundImage : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled : Error processing arguments\");\n\t\tcobj->setBackGroundImageScale9Enabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setClippingEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setClippingEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setClippingEnabled : Error processing arguments\");\n\t\tcobj->setClippingEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setClippingEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_setLayoutType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Layout* cobj = (cocos2d::gui::Layout *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setLayoutType : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::LayoutType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Layout_setLayoutType : Error processing arguments\");\n\t\tcobj->setLayoutType(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_setLayoutType : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Layout_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Layout* ret = cocos2d::gui::Layout::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Layout>(cx, (cocos2d::gui::Layout*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Layout_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Layout* cobj = new cocos2d::gui::Layout();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::Layout> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::Layout\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Layout_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_Layout_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Layout)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_Layout(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_Layout_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_Layout_class->name = \"Layout\";\n\tjsb_cocos2d_gui_Layout_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Layout_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_Layout_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Layout_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_Layout_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_Layout_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_Layout_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_Layout_class->finalize = js_cocos2d_gui_Layout_finalize;\n\tjsb_cocos2d_gui_Layout_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setBackGroundColorVector\", js_cocos2dx_gui_Layout_setBackGroundColorVector, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hitTest\", js_cocos2dx_gui_Layout_hitTest, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackGroundImageTextureSize\", js_cocos2dx_gui_Layout_getBackGroundImageTextureSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayoutType\", js_cocos2dx_gui_Layout_getLayoutType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setClippingType\", js_cocos2dx_gui_Layout_setClippingType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackGroundColorType\", js_cocos2dx_gui_Layout_setBackGroundColorType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackGroundImage\", js_cocos2dx_gui_Layout_setBackGroundImage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackGroundColor\", js_cocos2dx_gui_Layout_setBackGroundColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"requestDoLayout\", js_cocos2dx_gui_Layout_requestDoLayout, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isClippingEnabled\", js_cocos2dx_gui_Layout_isClippingEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackGroundColorOpacity\", js_cocos2dx_gui_Layout_setBackGroundColorOpacity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackGroundImageCapInsets\", js_cocos2dx_gui_Layout_setBackGroundImageCapInsets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeBackGroundImage\", js_cocos2dx_gui_Layout_removeBackGroundImage, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackGroundImageScale9Enabled\", js_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setClippingEnabled\", js_cocos2dx_gui_Layout_setClippingEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayoutType\", js_cocos2dx_gui_Layout_setLayoutType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_Layout_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_Layout_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_Layout_class,\n\t\tjs_cocos2dx_gui_Layout_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Layout\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::Layout> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_Layout_class;\n\t\tp->proto = jsb_cocos2d_gui_Layout_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_Button_class;\nJSObject *jsb_cocos2d_gui_Button_prototype;\n\nJSBool js_cocos2dx_gui_Button_getTitleText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_getTitleText : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getTitleText();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_getTitleText : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_loadTextureNormal(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextureNormal : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextureNormal : Error processing arguments\");\n\t\tcobj->loadTextureNormal(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextureNormal : Error processing arguments\");\n\t\tcobj->loadTextureNormal(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_loadTextureNormal : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setCapInsetsNormalRenderer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsetsNormalRenderer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsetsNormalRenderer : Error processing arguments\");\n\t\tcobj->setCapInsetsNormalRenderer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setCapInsetsNormalRenderer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setCapInsetsPressedRenderer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsetsPressedRenderer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsetsPressedRenderer : Error processing arguments\");\n\t\tcobj->setCapInsetsPressedRenderer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setCapInsetsPressedRenderer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_loadTexturePressed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTexturePressed : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTexturePressed : Error processing arguments\");\n\t\tcobj->loadTexturePressed(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTexturePressed : Error processing arguments\");\n\t\tcobj->loadTexturePressed(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_loadTexturePressed : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setTitleFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleFontSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleFontSize : Error processing arguments\");\n\t\tcobj->setTitleFontSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setTitleFontSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setCapInsetsDisabledRenderer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsetsDisabledRenderer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsetsDisabledRenderer : Error processing arguments\");\n\t\tcobj->setCapInsetsDisabledRenderer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setCapInsetsDisabledRenderer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setTitleFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleFontName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleFontName : Error processing arguments\");\n\t\tcobj->setTitleFontName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setTitleFontName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_getTitleColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_getTitleColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Color3B& ret = cobj->getTitleColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor3b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_getTitleColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_loadTextureDisabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextureDisabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextureDisabled : Error processing arguments\");\n\t\tcobj->loadTextureDisabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextureDisabled : Error processing arguments\");\n\t\tcobj->loadTextureDisabled(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_loadTextureDisabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_getTitleFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_getTitleFontName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getTitleFontName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_getTitleFontName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setPressedActionEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setPressedActionEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setPressedActionEnabled : Error processing arguments\");\n\t\tcobj->setPressedActionEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setPressedActionEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setCapInsets : Error processing arguments\");\n\t\tcobj->setCapInsets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setScale9Enabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setScale9Enabled : Error processing arguments\");\n\t\tcobj->setScale9Enabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setScale9Enabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_loadTextures(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextures : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextures : Error processing arguments\");\n\t\tcobj->loadTextures(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tcocos2d::gui::TextureResType arg3;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_loadTextures : Error processing arguments\");\n\t\tcobj->loadTextures(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_loadTextures : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_getTitleFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_getTitleFontSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getTitleFontSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_getTitleFontSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setTitleText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleText : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleText : Error processing arguments\");\n\t\tcobj->setTitleText(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setTitleText : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_setTitleColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Button* cobj = (cocos2d::gui::Button *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color3B arg0;\n\t\tok &= jsval_to_cccolor3b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Button_setTitleColor : Error processing arguments\");\n\t\tcobj->setTitleColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_setTitleColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Button_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Button* ret = cocos2d::gui::Button::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Button>(cx, (cocos2d::gui::Button*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Button_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Button* cobj = new cocos2d::gui::Button();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::Button> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::Button\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Button_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_Button_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Button)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_Button(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_Button_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_Button_class->name = \"Button\";\n\tjsb_cocos2d_gui_Button_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Button_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_Button_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Button_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_Button_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_Button_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_Button_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_Button_class->finalize = js_cocos2d_gui_Button_finalize;\n\tjsb_cocos2d_gui_Button_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getTitleText\", js_cocos2dx_gui_Button_getTitleText, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextureNormal\", js_cocos2dx_gui_Button_loadTextureNormal, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsetsNormalRenderer\", js_cocos2dx_gui_Button_setCapInsetsNormalRenderer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsetsPressedRenderer\", js_cocos2dx_gui_Button_setCapInsetsPressedRenderer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTexturePressed\", js_cocos2dx_gui_Button_loadTexturePressed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleFontSize\", js_cocos2dx_gui_Button_setTitleFontSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsetsDisabledRenderer\", js_cocos2dx_gui_Button_setCapInsetsDisabledRenderer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleFontName\", js_cocos2dx_gui_Button_setTitleFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleColor\", js_cocos2dx_gui_Button_getTitleColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextureDisabled\", js_cocos2dx_gui_Button_loadTextureDisabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleFontName\", js_cocos2dx_gui_Button_getTitleFontName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPressedActionEnabled\", js_cocos2dx_gui_Button_setPressedActionEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsets\", js_cocos2dx_gui_Button_setCapInsets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScale9Enabled\", js_cocos2dx_gui_Button_setScale9Enabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextures\", js_cocos2dx_gui_Button_loadTextures, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTitleFontSize\", js_cocos2dx_gui_Button_getTitleFontSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleText\", js_cocos2dx_gui_Button_setTitleText, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTitleColor\", js_cocos2dx_gui_Button_setTitleColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_Button_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_Button_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_Button_class,\n\t\tjs_cocos2dx_gui_Button_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Button\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::Button> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_Button_class;\n\t\tp->proto = jsb_cocos2d_gui_Button_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_CheckBox_class;\nJSObject *jsb_cocos2d_gui_CheckBox_prototype;\n\nJSBool js_cocos2dx_gui_CheckBox_getSelectedState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_getSelectedState : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getSelectedState();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_getSelectedState : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected : Error processing arguments\");\n\t\tcobj->loadTextureBackGroundSelected(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected : Error processing arguments\");\n\t\tcobj->loadTextureBackGroundSelected(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled : Error processing arguments\");\n\t\tcobj->loadTextureBackGroundDisabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled : Error processing arguments\");\n\t\tcobj->loadTextureBackGroundDisabled(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_loadTextureFrontCross(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCross : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCross : Error processing arguments\");\n\t\tcobj->loadTextureFrontCross(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCross : Error processing arguments\");\n\t\tcobj->loadTextureFrontCross(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCross : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_loadTextures(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextures : Invalid Native Object\");\n\tif (argc == 5) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tconst char* arg3;\n\t\tconst char* arg4;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tstd::string arg3_tmp; ok &= jsval_to_std_string(cx, argv[3], &arg3_tmp); arg3 = arg3_tmp.c_str();\n\t\tstd::string arg4_tmp; ok &= jsval_to_std_string(cx, argv[4], &arg4_tmp); arg4 = arg4_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextures : Error processing arguments\");\n\t\tcobj->loadTextures(arg0, arg1, arg2, arg3, arg4);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 6) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tconst char* arg3;\n\t\tconst char* arg4;\n\t\tcocos2d::gui::TextureResType arg5;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tstd::string arg3_tmp; ok &= jsval_to_std_string(cx, argv[3], &arg3_tmp); arg3 = arg3_tmp.c_str();\n\t\tstd::string arg4_tmp; ok &= jsval_to_std_string(cx, argv[4], &arg4_tmp); arg4 = arg4_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[5], (int32_t *)&arg5);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextures : Error processing arguments\");\n\t\tcobj->loadTextures(arg0, arg1, arg2, arg3, arg4, arg5);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_loadTextures : wrong number of arguments: %d, was expecting %d\", argc, 5);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_loadTextureBackGround(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGround : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGround : Error processing arguments\");\n\t\tcobj->loadTextureBackGround(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureBackGround : Error processing arguments\");\n\t\tcobj->loadTextureBackGround(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_loadTextureBackGround : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_setSelectedState(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_setSelectedState : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_setSelectedState : Error processing arguments\");\n\t\tcobj->setSelectedState(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_setSelectedState : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::CheckBox* cobj = (cocos2d::gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled : Error processing arguments\");\n\t\tcobj->loadTextureFrontCrossDisabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled : Error processing arguments\");\n\t\tcobj->loadTextureFrontCrossDisabled(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::CheckBox* ret = cocos2d::gui::CheckBox::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::CheckBox>(cx, (cocos2d::gui::CheckBox*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_CheckBox_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::CheckBox* cobj = new cocos2d::gui::CheckBox();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::CheckBox> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::CheckBox\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_CheckBox_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_CheckBox_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (CheckBox)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_CheckBox(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_CheckBox_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_CheckBox_class->name = \"CheckBox\";\n\tjsb_cocos2d_gui_CheckBox_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_CheckBox_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_CheckBox_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_CheckBox_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_CheckBox_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_CheckBox_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_CheckBox_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_CheckBox_class->finalize = js_cocos2d_gui_CheckBox_finalize;\n\tjsb_cocos2d_gui_CheckBox_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getSelectedState\", js_cocos2dx_gui_CheckBox_getSelectedState, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextureBackGroundSelected\", js_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextureBackGroundDisabled\", js_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextureFrontCross\", js_cocos2dx_gui_CheckBox_loadTextureFrontCross, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextures\", js_cocos2dx_gui_CheckBox_loadTextures, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextureBackGround\", js_cocos2dx_gui_CheckBox_loadTextureBackGround, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSelectedState\", js_cocos2dx_gui_CheckBox_setSelectedState, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTextureFrontCrossDisabled\", js_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_CheckBox_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_CheckBox_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_CheckBox_class,\n\t\tjs_cocos2dx_gui_CheckBox_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"CheckBox\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::CheckBox> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_CheckBox_class;\n\t\tp->proto = jsb_cocos2d_gui_CheckBox_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_ImageView_class;\nJSObject *jsb_cocos2d_gui_ImageView_prototype;\n\nJSBool js_cocos2dx_gui_ImageView_setTextureRect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ImageView* cobj = (cocos2d::gui::ImageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_setTextureRect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_setTextureRect : Error processing arguments\");\n\t\tcobj->setTextureRect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ImageView_setTextureRect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ImageView_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ImageView* cobj = (cocos2d::gui::ImageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_setCapInsets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_setCapInsets : Error processing arguments\");\n\t\tcobj->setCapInsets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ImageView_setCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ImageView_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ImageView* cobj = (cocos2d::gui::ImageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_setScale9Enabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_setScale9Enabled : Error processing arguments\");\n\t\tcobj->setScale9Enabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ImageView_setScale9Enabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ImageView_loadTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ImageView* cobj = (cocos2d::gui::ImageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_loadTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_loadTexture : Error processing arguments\");\n\t\tcobj->loadTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ImageView_loadTexture : Error processing arguments\");\n\t\tcobj->loadTexture(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ImageView_loadTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::ImageView* ret = cocos2d::gui::ImageView::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::ImageView>(cx, (cocos2d::gui::ImageView*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ImageView_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_ImageView_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::ImageView* cobj = new cocos2d::gui::ImageView();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::ImageView> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::ImageView\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ImageView_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_ImageView_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ImageView)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_ImageView(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_ImageView_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_ImageView_class->name = \"ImageView\";\n\tjsb_cocos2d_gui_ImageView_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_ImageView_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_ImageView_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_ImageView_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_ImageView_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_ImageView_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_ImageView_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_ImageView_class->finalize = js_cocos2d_gui_ImageView_finalize;\n\tjsb_cocos2d_gui_ImageView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setTextureRect\", js_cocos2dx_gui_ImageView_setTextureRect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsets\", js_cocos2dx_gui_ImageView_setCapInsets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScale9Enabled\", js_cocos2dx_gui_ImageView_setScale9Enabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTexture\", js_cocos2dx_gui_ImageView_loadTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_ImageView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_ImageView_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_ImageView_class,\n\t\tjs_cocos2dx_gui_ImageView_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ImageView\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::ImageView> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_ImageView_class;\n\t\tp->proto = jsb_cocos2d_gui_ImageView_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_Text_class;\nJSObject *jsb_cocos2d_gui_Text_prototype;\n\nJSBool js_cocos2dx_gui_Text_getStringLength(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_getStringLength : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getStringLength();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_getStringLength : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_setFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setFontName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setFontName : Error processing arguments\");\n\t\tcobj->setFontName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_setFontName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_setTouchScaleChangeEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTouchScaleChangeEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTouchScaleChangeEnabled : Error processing arguments\");\n\t\tcobj->setTouchScaleChangeEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_setTouchScaleChangeEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_getStringValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_getStringValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getStringValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_getStringValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_setText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setText : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setText : Error processing arguments\");\n\t\tcobj->setText(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_setText : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_setTextVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTextVerticalAlignment : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextVAlignment arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTextVerticalAlignment : Error processing arguments\");\n\t\tcobj->setTextVerticalAlignment(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_setTextVerticalAlignment : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_setFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setFontSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setFontSize : Error processing arguments\");\n\t\tcobj->setFontSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_setFontSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_isTouchScaleChangeEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_isTouchScaleChangeEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTouchScaleChangeEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_isTouchScaleChangeEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_setTextHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTextHorizontalAlignment : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::TextHAlignment arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTextHorizontalAlignment : Error processing arguments\");\n\t\tcobj->setTextHorizontalAlignment(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_setTextHorizontalAlignment : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_setTextAreaSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Text* cobj = (cocos2d::gui::Text *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTextAreaSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Text_setTextAreaSize : Error processing arguments\");\n\t\tcobj->setTextAreaSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_setTextAreaSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Text_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Text* ret = cocos2d::gui::Text::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Text>(cx, (cocos2d::gui::Text*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Text_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Text* cobj = new cocos2d::gui::Text();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::Text> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::Text\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Text_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_Text_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Text)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_Text(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_Text_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_Text_class->name = \"Text\";\n\tjsb_cocos2d_gui_Text_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Text_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_Text_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Text_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_Text_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_Text_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_Text_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_Text_class->finalize = js_cocos2d_gui_Text_finalize;\n\tjsb_cocos2d_gui_Text_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getStringLength\", js_cocos2dx_gui_Text_getStringLength, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontName\", js_cocos2dx_gui_Text_setFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchScaleChangeEnabled\", js_cocos2dx_gui_Text_setTouchScaleChangeEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringValue\", js_cocos2dx_gui_Text_getStringValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setText\", js_cocos2dx_gui_Text_setText, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextVerticalAlignment\", js_cocos2dx_gui_Text_setTextVerticalAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontSize\", js_cocos2dx_gui_Text_setFontSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTouchScaleChangeEnabled\", js_cocos2dx_gui_Text_isTouchScaleChangeEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextHorizontalAlignment\", js_cocos2dx_gui_Text_setTextHorizontalAlignment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTextAreaSize\", js_cocos2dx_gui_Text_setTextAreaSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_Text_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_Text_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_Text_class,\n\t\tjs_cocos2dx_gui_Text_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Text\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::Text> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_Text_class;\n\t\tp->proto = jsb_cocos2d_gui_Text_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_TextAtlas_class;\nJSObject *jsb_cocos2d_gui_TextAtlas_prototype;\n\nJSBool js_cocos2dx_gui_TextAtlas_setProperty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextAtlas* cobj = (cocos2d::gui::TextAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextAtlas_setProperty : Invalid Native Object\");\n\tif (argc == 5) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tint arg2;\n\t\tint arg3;\n\t\tstd::string arg4;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tok &= jsval_to_std_string(cx, argv[4], &arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextAtlas_setProperty : Error processing arguments\");\n\t\tcobj->setProperty(arg0, arg1, arg2, arg3, arg4);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextAtlas_setProperty : wrong number of arguments: %d, was expecting %d\", argc, 5);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextAtlas_getStringValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextAtlas* cobj = (cocos2d::gui::TextAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextAtlas_getStringValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getStringValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextAtlas_getStringValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextAtlas_setStringValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextAtlas* cobj = (cocos2d::gui::TextAtlas *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextAtlas_setStringValue : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextAtlas_setStringValue : Error processing arguments\");\n\t\tcobj->setStringValue(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextAtlas_setStringValue : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextAtlas_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::TextAtlas* ret = cocos2d::gui::TextAtlas::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::TextAtlas>(cx, (cocos2d::gui::TextAtlas*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextAtlas_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_TextAtlas_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::TextAtlas* cobj = new cocos2d::gui::TextAtlas();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::TextAtlas> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::TextAtlas\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextAtlas_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_TextAtlas_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TextAtlas)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_TextAtlas(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_TextAtlas_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_TextAtlas_class->name = \"TextAtlas\";\n\tjsb_cocos2d_gui_TextAtlas_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_TextAtlas_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_TextAtlas_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_TextAtlas_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_TextAtlas_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_TextAtlas_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_TextAtlas_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_TextAtlas_class->finalize = js_cocos2d_gui_TextAtlas_finalize;\n\tjsb_cocos2d_gui_TextAtlas_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setProperty\", js_cocos2dx_gui_TextAtlas_setProperty, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringValue\", js_cocos2dx_gui_TextAtlas_getStringValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStringValue\", js_cocos2dx_gui_TextAtlas_setStringValue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_TextAtlas_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_TextAtlas_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_TextAtlas_class,\n\t\tjs_cocos2dx_gui_TextAtlas_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TextAtlas\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::TextAtlas> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_TextAtlas_class;\n\t\tp->proto = jsb_cocos2d_gui_TextAtlas_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_LoadingBar_class;\nJSObject *jsb_cocos2d_gui_LoadingBar_prototype;\n\nJSBool js_cocos2dx_gui_LoadingBar_setPercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LoadingBar* cobj = (cocos2d::gui::LoadingBar *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setPercent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setPercent : Error processing arguments\");\n\t\tcobj->setPercent(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_setPercent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LoadingBar_loadTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LoadingBar* cobj = (cocos2d::gui::LoadingBar *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_loadTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_loadTexture : Error processing arguments\");\n\t\tcobj->loadTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_loadTexture : Error processing arguments\");\n\t\tcobj->loadTexture(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_loadTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LoadingBar_setDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LoadingBar* cobj = (cocos2d::gui::LoadingBar *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setDirection : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::LoadingBarType arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setDirection : Error processing arguments\");\n\t\tcobj->setDirection(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_setDirection : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LoadingBar_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LoadingBar* cobj = (cocos2d::gui::LoadingBar *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setScale9Enabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setScale9Enabled : Error processing arguments\");\n\t\tcobj->setScale9Enabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_setScale9Enabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LoadingBar_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LoadingBar* cobj = (cocos2d::gui::LoadingBar *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setCapInsets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_setCapInsets : Error processing arguments\");\n\t\tcobj->setCapInsets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_setCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LoadingBar_getDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LoadingBar* cobj = (cocos2d::gui::LoadingBar *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_getDirection : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getDirection();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_getDirection : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LoadingBar_getPercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::LoadingBar* cobj = (cocos2d::gui::LoadingBar *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_LoadingBar_getPercent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getPercent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_getPercent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::LoadingBar* ret = cocos2d::gui::LoadingBar::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::LoadingBar>(cx, (cocos2d::gui::LoadingBar*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_LoadingBar_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::LoadingBar* cobj = new cocos2d::gui::LoadingBar();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::LoadingBar> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::LoadingBar\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_LoadingBar_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_LoadingBar_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (LoadingBar)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_LoadingBar(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_LoadingBar_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_LoadingBar_class->name = \"LoadingBar\";\n\tjsb_cocos2d_gui_LoadingBar_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_LoadingBar_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_LoadingBar_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_LoadingBar_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_LoadingBar_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_LoadingBar_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_LoadingBar_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_LoadingBar_class->finalize = js_cocos2d_gui_LoadingBar_finalize;\n\tjsb_cocos2d_gui_LoadingBar_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setPercent\", js_cocos2dx_gui_LoadingBar_setPercent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadTexture\", js_cocos2dx_gui_LoadingBar_loadTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDirection\", js_cocos2dx_gui_LoadingBar_setDirection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScale9Enabled\", js_cocos2dx_gui_LoadingBar_setScale9Enabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsets\", js_cocos2dx_gui_LoadingBar_setCapInsets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDirection\", js_cocos2dx_gui_LoadingBar_getDirection, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPercent\", js_cocos2dx_gui_LoadingBar_getPercent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_LoadingBar_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_LoadingBar_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_LoadingBar_class,\n\t\tjs_cocos2dx_gui_LoadingBar_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"LoadingBar\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::LoadingBar> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_LoadingBar_class;\n\t\tp->proto = jsb_cocos2d_gui_LoadingBar_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_ScrollView_class;\nJSObject *jsb_cocos2d_gui_ScrollView_prototype;\n\nJSBool js_cocos2dx_gui_ScrollView_scrollToTop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToTop : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToTop : Error processing arguments\");\n\t\tcobj->scrollToTop(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToTop : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToPercentHorizontal(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToPercentHorizontal : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tJSBool arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToPercentHorizontal : Error processing arguments\");\n\t\tcobj->scrollToPercentHorizontal(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToPercentHorizontal : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_isInertiaScrollEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_isInertiaScrollEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isInertiaScrollEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_isInertiaScrollEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToPercentBothDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToPercentBothDirection : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::Point arg0;\n\t\tdouble arg1;\n\t\tJSBool arg2;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToPercentBothDirection : Error processing arguments\");\n\t\tcobj->scrollToPercentBothDirection(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToPercentBothDirection : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_getDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_getDirection : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getDirection();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_getDirection : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToBottomLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToBottomLeft : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToBottomLeft : Error processing arguments\");\n\t\tcobj->scrollToBottomLeft(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToBottomLeft : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_getInnerContainer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_getInnerContainer : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::gui::Layout* ret = cobj->getInnerContainer();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Layout>(cx, (cocos2d::gui::Layout*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_getInnerContainer : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToBottom(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToBottom : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToBottom();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToBottom : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_setDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setDirection : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::SCROLLVIEW_DIR arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setDirection : Error processing arguments\");\n\t\tcobj->setDirection(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_setDirection : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToTopLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToTopLeft : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToTopLeft : Error processing arguments\");\n\t\tcobj->scrollToTopLeft(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToTopLeft : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToTopRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToTopRight : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToTopRight();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToTopRight : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToBottomLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToBottomLeft : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToBottomLeft();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToBottomLeft : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_setInnerContainerSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setInnerContainerSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setInnerContainerSize : Error processing arguments\");\n\t\tcobj->setInnerContainerSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_setInnerContainerSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_getInnerContainerSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_getInnerContainerSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Size& ret = cobj->getInnerContainerSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_getInnerContainerSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_isBounceEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_isBounceEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBounceEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_isBounceEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToPercentVertical(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToPercentVertical : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToPercentVertical : Error processing arguments\");\n\t\tcobj->jumpToPercentVertical(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToPercentVertical : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_setInertiaScrollEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setInertiaScrollEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setInertiaScrollEnabled : Error processing arguments\");\n\t\tcobj->setInertiaScrollEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_setInertiaScrollEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToTopLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToTopLeft : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToTopLeft();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToTopLeft : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToPercentHorizontal(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToPercentHorizontal : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToPercentHorizontal : Error processing arguments\");\n\t\tcobj->jumpToPercentHorizontal(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToPercentHorizontal : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToBottomRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToBottomRight : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToBottomRight();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToBottomRight : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_setBounceEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setBounceEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_setBounceEnabled : Error processing arguments\");\n\t\tcobj->setBounceEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_setBounceEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToTop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToTop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToTop();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToTop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToLeft : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToLeft : Error processing arguments\");\n\t\tcobj->scrollToLeft(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToLeft : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToPercentBothDirection(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToPercentBothDirection : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToPercentBothDirection : Error processing arguments\");\n\t\tcobj->jumpToPercentBothDirection(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToPercentBothDirection : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToPercentVertical(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToPercentVertical : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tJSBool arg2;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToPercentVertical : Error processing arguments\");\n\t\tcobj->scrollToPercentVertical(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToPercentVertical : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToBottom(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToBottom : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToBottom : Error processing arguments\");\n\t\tcobj->scrollToBottom(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToBottom : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToBottomRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToBottomRight : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToBottomRight : Error processing arguments\");\n\t\tcobj->scrollToBottomRight(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToBottomRight : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToLeft(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToLeft : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToLeft();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToLeft : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToRight : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToRight : Error processing arguments\");\n\t\tcobj->scrollToRight(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToRight : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_jumpToRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_jumpToRight : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->jumpToRight();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_jumpToRight : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_scrollToTopRight(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ScrollView* cobj = (cocos2d::gui::ScrollView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToTopRight : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tJSBool arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ScrollView_scrollToTopRight : Error processing arguments\");\n\t\tcobj->scrollToTopRight(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_scrollToTopRight : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::ScrollView* ret = cocos2d::gui::ScrollView::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::ScrollView>(cx, (cocos2d::gui::ScrollView*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_ScrollView_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::ScrollView* cobj = new cocos2d::gui::ScrollView();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::ScrollView> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::ScrollView\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ScrollView_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Layout_prototype;\n\nvoid js_cocos2d_gui_ScrollView_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ScrollView)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_ScrollView(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_ScrollView_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_ScrollView_class->name = \"ScrollView\";\n\tjsb_cocos2d_gui_ScrollView_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_ScrollView_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_ScrollView_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_ScrollView_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_ScrollView_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_ScrollView_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_ScrollView_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_ScrollView_class->finalize = js_cocos2d_gui_ScrollView_finalize;\n\tjsb_cocos2d_gui_ScrollView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"scrollToTop\", js_cocos2dx_gui_ScrollView_scrollToTop, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToPercentHorizontal\", js_cocos2dx_gui_ScrollView_scrollToPercentHorizontal, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isInertiaScrollEnabled\", js_cocos2dx_gui_ScrollView_isInertiaScrollEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToPercentBothDirection\", js_cocos2dx_gui_ScrollView_scrollToPercentBothDirection, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDirection\", js_cocos2dx_gui_ScrollView_getDirection, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToBottomLeft\", js_cocos2dx_gui_ScrollView_scrollToBottomLeft, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInnerContainer\", js_cocos2dx_gui_ScrollView_getInnerContainer, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToBottom\", js_cocos2dx_gui_ScrollView_jumpToBottom, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDirection\", js_cocos2dx_gui_ScrollView_setDirection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToTopLeft\", js_cocos2dx_gui_ScrollView_scrollToTopLeft, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToTopRight\", js_cocos2dx_gui_ScrollView_jumpToTopRight, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToBottomLeft\", js_cocos2dx_gui_ScrollView_jumpToBottomLeft, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInnerContainerSize\", js_cocos2dx_gui_ScrollView_setInnerContainerSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInnerContainerSize\", js_cocos2dx_gui_ScrollView_getInnerContainerSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isBounceEnabled\", js_cocos2dx_gui_ScrollView_isBounceEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToPercentVertical\", js_cocos2dx_gui_ScrollView_jumpToPercentVertical, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInertiaScrollEnabled\", js_cocos2dx_gui_ScrollView_setInertiaScrollEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToTopLeft\", js_cocos2dx_gui_ScrollView_jumpToTopLeft, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToPercentHorizontal\", js_cocos2dx_gui_ScrollView_jumpToPercentHorizontal, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToBottomRight\", js_cocos2dx_gui_ScrollView_jumpToBottomRight, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBounceEnabled\", js_cocos2dx_gui_ScrollView_setBounceEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToTop\", js_cocos2dx_gui_ScrollView_jumpToTop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToLeft\", js_cocos2dx_gui_ScrollView_scrollToLeft, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToPercentBothDirection\", js_cocos2dx_gui_ScrollView_jumpToPercentBothDirection, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToPercentVertical\", js_cocos2dx_gui_ScrollView_scrollToPercentVertical, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToBottom\", js_cocos2dx_gui_ScrollView_scrollToBottom, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToBottomRight\", js_cocos2dx_gui_ScrollView_scrollToBottomRight, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToLeft\", js_cocos2dx_gui_ScrollView_jumpToLeft, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToRight\", js_cocos2dx_gui_ScrollView_scrollToRight, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"jumpToRight\", js_cocos2dx_gui_ScrollView_jumpToRight, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToTopRight\", js_cocos2dx_gui_ScrollView_scrollToTopRight, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_ScrollView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_ScrollView_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Layout_prototype,\n\t\tjsb_cocos2d_gui_ScrollView_class,\n\t\tjs_cocos2dx_gui_ScrollView_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ScrollView\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::ScrollView> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_ScrollView_class;\n\t\tp->proto = jsb_cocos2d_gui_ScrollView_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Layout_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_ListView_class;\nJSObject *jsb_cocos2d_gui_ListView_prototype;\n\nJSBool js_cocos2dx_gui_ListView_getIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_getIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_getIndex : Error processing arguments\");\n\t\tssize_t ret = cobj->getIndex(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_getIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_removeAllItems(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_removeAllItems : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeAllItems();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_removeAllItems : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_setGravity(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_setGravity : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::ListViewGravity arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_setGravity : Error processing arguments\");\n\t\tcobj->setGravity(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_setGravity : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_pushBackCustomItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_pushBackCustomItem : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_pushBackCustomItem : Error processing arguments\");\n\t\tcobj->pushBackCustomItem(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_pushBackCustomItem : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_getItems(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_getItems : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::gui::Widget *>& ret = cobj->getItems();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_getItems : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_removeItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_removeItem : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_removeItem : Error processing arguments\");\n\t\tcobj->removeItem(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_removeItem : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_getCurSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_getCurSelectedIndex : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getCurSelectedIndex();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_getCurSelectedIndex : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_insertDefaultItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_insertDefaultItem : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_insertDefaultItem : Error processing arguments\");\n\t\tcobj->insertDefaultItem(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_insertDefaultItem : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_setItemsMargin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_setItemsMargin : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_setItemsMargin : Error processing arguments\");\n\t\tcobj->setItemsMargin(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_setItemsMargin : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_removeLastItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_removeLastItem : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeLastItem();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_removeLastItem : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_getItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_getItem : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_getItem : Error processing arguments\");\n\t\tcocos2d::gui::Widget* ret = cobj->getItem(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_getItem : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_setItemModel(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_setItemModel : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_setItemModel : Error processing arguments\");\n\t\tcobj->setItemModel(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_setItemModel : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_requestRefreshView(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_requestRefreshView : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->requestRefreshView();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_requestRefreshView : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_pushBackDefaultItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_pushBackDefaultItem : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pushBackDefaultItem();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_pushBackDefaultItem : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_insertCustomItem(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::ListView* cobj = (cocos2d::gui::ListView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_insertCustomItem : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tssize_t arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_ListView_insertCustomItem : Error processing arguments\");\n\t\tcobj->insertCustomItem(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_insertCustomItem : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_ListView_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::ListView* ret = cocos2d::gui::ListView::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::ListView>(cx, (cocos2d::gui::ListView*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_ListView_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::ListView* cobj = new cocos2d::gui::ListView();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::ListView> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::ListView\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_ListView_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_ScrollView_prototype;\n\nvoid js_cocos2d_gui_ListView_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ListView)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_ListView(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_ListView_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_ListView_class->name = \"ListView\";\n\tjsb_cocos2d_gui_ListView_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_ListView_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_ListView_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_ListView_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_ListView_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_ListView_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_ListView_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_ListView_class->finalize = js_cocos2d_gui_ListView_finalize;\n\tjsb_cocos2d_gui_ListView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getIndex\", js_cocos2dx_gui_ListView_getIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllItems\", js_cocos2dx_gui_ListView_removeAllItems, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGravity\", js_cocos2dx_gui_ListView_setGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pushBackCustomItem\", js_cocos2dx_gui_ListView_pushBackCustomItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getItems\", js_cocos2dx_gui_ListView_getItems, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeItem\", js_cocos2dx_gui_ListView_removeItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurSelectedIndex\", js_cocos2dx_gui_ListView_getCurSelectedIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"insertDefaultItem\", js_cocos2dx_gui_ListView_insertDefaultItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setItemsMargin\", js_cocos2dx_gui_ListView_setItemsMargin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeLastItem\", js_cocos2dx_gui_ListView_removeLastItem, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getItem\", js_cocos2dx_gui_ListView_getItem, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setItemModel\", js_cocos2dx_gui_ListView_setItemModel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"requestRefreshView\", js_cocos2dx_gui_ListView_requestRefreshView, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pushBackDefaultItem\", js_cocos2dx_gui_ListView_pushBackDefaultItem, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"insertCustomItem\", js_cocos2dx_gui_ListView_insertCustomItem, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_ListView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_ListView_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_ScrollView_prototype,\n\t\tjsb_cocos2d_gui_ListView_class,\n\t\tjs_cocos2dx_gui_ListView_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ListView\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::ListView> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_ListView_class;\n\t\tp->proto = jsb_cocos2d_gui_ListView_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_ScrollView_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_Slider_class;\nJSObject *jsb_cocos2d_gui_Slider_prototype;\n\nJSBool js_cocos2dx_gui_Slider_setPercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setPercent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setPercent : Error processing arguments\");\n\t\tcobj->setPercent(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_setPercent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTextureNormal(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextureNormal : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextureNormal : Error processing arguments\");\n\t\tcobj->loadSlidBallTextureNormal(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextureNormal : Error processing arguments\");\n\t\tcobj->loadSlidBallTextureNormal(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_loadSlidBallTextureNormal : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_loadBarTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadBarTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadBarTexture : Error processing arguments\");\n\t\tcobj->loadBarTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadBarTexture : Error processing arguments\");\n\t\tcobj->loadBarTexture(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_loadBarTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_loadProgressBarTexture(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadProgressBarTexture : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadProgressBarTexture : Error processing arguments\");\n\t\tcobj->loadProgressBarTexture(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadProgressBarTexture : Error processing arguments\");\n\t\tcobj->loadProgressBarTexture(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_loadProgressBarTexture : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTextures(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextures : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextures : Error processing arguments\");\n\t\tcobj->loadSlidBallTextures(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tconst char* arg2;\n\t\tcocos2d::gui::TextureResType arg3;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tstd::string arg2_tmp; ok &= jsval_to_std_string(cx, argv[2], &arg2_tmp); arg2 = arg2_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextures : Error processing arguments\");\n\t\tcobj->loadSlidBallTextures(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_loadSlidBallTextures : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer : Error processing arguments\");\n\t\tcobj->setCapInsetProgressBarRebderer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_setCapInsetsBarRenderer(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setCapInsetsBarRenderer : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setCapInsetsBarRenderer : Error processing arguments\");\n\t\tcobj->setCapInsetsBarRenderer(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_setCapInsetsBarRenderer : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setScale9Enabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setScale9Enabled : Error processing arguments\");\n\t\tcobj->setScale9Enabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_setScale9Enabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setCapInsets : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Rect arg0;\n\t\tok &= jsval_to_ccrect(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_setCapInsets : Error processing arguments\");\n\t\tcobj->setCapInsets(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_setCapInsets : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTexturePressed(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTexturePressed : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTexturePressed : Error processing arguments\");\n\t\tcobj->loadSlidBallTexturePressed(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTexturePressed : Error processing arguments\");\n\t\tcobj->loadSlidBallTexturePressed(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_loadSlidBallTexturePressed : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTextureDisabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextureDisabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextureDisabled : Error processing arguments\");\n\t\tcobj->loadSlidBallTextureDisabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::gui::TextureResType arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_loadSlidBallTextureDisabled : Error processing arguments\");\n\t\tcobj->loadSlidBallTextureDisabled(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_loadSlidBallTextureDisabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_getPercent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::Slider* cobj = (cocos2d::gui::Slider *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_Slider_getPercent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getPercent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_getPercent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Slider* ret = cocos2d::gui::Slider::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Slider>(cx, (cocos2d::gui::Slider*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Slider_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::Slider* cobj = new cocos2d::gui::Slider();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::Slider> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::Slider\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Slider_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_Slider_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Slider)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_Slider(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_Slider_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_Slider_class->name = \"Slider\";\n\tjsb_cocos2d_gui_Slider_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Slider_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_Slider_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Slider_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_Slider_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_Slider_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_Slider_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_Slider_class->finalize = js_cocos2d_gui_Slider_finalize;\n\tjsb_cocos2d_gui_Slider_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setPercent\", js_cocos2dx_gui_Slider_setPercent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadSlidBallTextureNormal\", js_cocos2dx_gui_Slider_loadSlidBallTextureNormal, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadBarTexture\", js_cocos2dx_gui_Slider_loadBarTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadProgressBarTexture\", js_cocos2dx_gui_Slider_loadProgressBarTexture, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadSlidBallTextures\", js_cocos2dx_gui_Slider_loadSlidBallTextures, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsetProgressBarRebderer\", js_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsetsBarRenderer\", js_cocos2dx_gui_Slider_setCapInsetsBarRenderer, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setScale9Enabled\", js_cocos2dx_gui_Slider_setScale9Enabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCapInsets\", js_cocos2dx_gui_Slider_setCapInsets, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadSlidBallTexturePressed\", js_cocos2dx_gui_Slider_loadSlidBallTexturePressed, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadSlidBallTextureDisabled\", js_cocos2dx_gui_Slider_loadSlidBallTextureDisabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPercent\", js_cocos2dx_gui_Slider_getPercent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_Slider_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_Slider_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_Slider_class,\n\t\tjs_cocos2dx_gui_Slider_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Slider\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::Slider> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_Slider_class;\n\t\tp->proto = jsb_cocos2d_gui_Slider_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_TextField_class;\nJSObject *jsb_cocos2d_gui_TextField_prototype;\n\nJSBool js_cocos2dx_gui_TextField_setAttachWithIME(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setAttachWithIME : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setAttachWithIME : Error processing arguments\");\n\t\tcobj->setAttachWithIME(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setAttachWithIME : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_getStringValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_getStringValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getStringValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_getStringValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setPasswordStyleText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setPasswordStyleText : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setPasswordStyleText : Error processing arguments\");\n\t\tcobj->setPasswordStyleText(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setPasswordStyleText : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_getAttachWithIME(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_getAttachWithIME : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getAttachWithIME();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_getAttachWithIME : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setFontName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setFontName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setFontName : Error processing arguments\");\n\t\tcobj->setFontName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setFontName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_getInsertText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_getInsertText : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getInsertText();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_getInsertText : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setInsertText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setInsertText : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setInsertText : Error processing arguments\");\n\t\tcobj->setInsertText(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setInsertText : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_getDetachWithIME(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_getDetachWithIME : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getDetachWithIME();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_getDetachWithIME : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_didNotSelectSelf(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_didNotSelectSelf : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->didNotSelectSelf();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_didNotSelectSelf : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_attachWithIME(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_attachWithIME : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->attachWithIME();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_attachWithIME : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setPasswordEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setPasswordEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setPasswordEnabled : Error processing arguments\");\n\t\tcobj->setPasswordEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setPasswordEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setMaxLengthEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setMaxLengthEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setMaxLengthEnabled : Error processing arguments\");\n\t\tcobj->setMaxLengthEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setMaxLengthEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_getDeleteBackward(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_getDeleteBackward : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getDeleteBackward();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_getDeleteBackward : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setFontSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setFontSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setFontSize : Error processing arguments\");\n\t\tcobj->setFontSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setFontSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setPlaceHolder : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setPlaceHolder : Error processing arguments\");\n\t\tcobj->setPlaceHolder(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setPlaceHolder : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_isPasswordEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_isPasswordEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isPasswordEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_isPasswordEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_getMaxLength(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_getMaxLength : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getMaxLength();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_getMaxLength : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_isMaxLengthEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_isMaxLengthEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isMaxLengthEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_isMaxLengthEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setDetachWithIME(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setDetachWithIME : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setDetachWithIME : Error processing arguments\");\n\t\tcobj->setDetachWithIME(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setDetachWithIME : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setText : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setText : Error processing arguments\");\n\t\tcobj->setText(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setText : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setMaxLength(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setMaxLength : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setMaxLength : Error processing arguments\");\n\t\tcobj->setMaxLength(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setMaxLength : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setTouchSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setTouchSize : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n\t\tok &= jsval_to_ccsize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setTouchSize : Error processing arguments\");\n\t\tcobj->setTouchSize(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setTouchSize : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_setDeleteBackward(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextField* cobj = (cocos2d::gui::TextField *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setDeleteBackward : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextField_setDeleteBackward : Error processing arguments\");\n\t\tcobj->setDeleteBackward(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_setDeleteBackward : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextField_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::TextField* ret = cocos2d::gui::TextField::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::TextField>(cx, (cocos2d::gui::TextField*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_TextField_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::TextField* cobj = new cocos2d::gui::TextField();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::TextField> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::TextField\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextField_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_TextField_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TextField)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_TextField(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_TextField_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_TextField_class->name = \"TextField\";\n\tjsb_cocos2d_gui_TextField_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_TextField_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_TextField_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_TextField_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_TextField_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_TextField_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_TextField_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_TextField_class->finalize = js_cocos2d_gui_TextField_finalize;\n\tjsb_cocos2d_gui_TextField_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setAttachWithIME\", js_cocos2dx_gui_TextField_setAttachWithIME, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringValue\", js_cocos2dx_gui_TextField_getStringValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPasswordStyleText\", js_cocos2dx_gui_TextField_setPasswordStyleText, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAttachWithIME\", js_cocos2dx_gui_TextField_getAttachWithIME, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontName\", js_cocos2dx_gui_TextField_setFontName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInsertText\", js_cocos2dx_gui_TextField_getInsertText, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInsertText\", js_cocos2dx_gui_TextField_setInsertText, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDetachWithIME\", js_cocos2dx_gui_TextField_getDetachWithIME, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"didNotSelectSelf\", js_cocos2dx_gui_TextField_didNotSelectSelf, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"attachWithIME\", js_cocos2dx_gui_TextField_attachWithIME, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPasswordEnabled\", js_cocos2dx_gui_TextField_setPasswordEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaxLengthEnabled\", js_cocos2dx_gui_TextField_setMaxLengthEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDeleteBackward\", js_cocos2dx_gui_TextField_getDeleteBackward, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFontSize\", js_cocos2dx_gui_TextField_setFontSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPlaceHolder\", js_cocos2dx_gui_TextField_setPlaceHolder, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isPasswordEnabled\", js_cocos2dx_gui_TextField_isPasswordEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaxLength\", js_cocos2dx_gui_TextField_getMaxLength, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isMaxLengthEnabled\", js_cocos2dx_gui_TextField_isMaxLengthEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDetachWithIME\", js_cocos2dx_gui_TextField_setDetachWithIME, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setText\", js_cocos2dx_gui_TextField_setText, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaxLength\", js_cocos2dx_gui_TextField_setMaxLength, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchSize\", js_cocos2dx_gui_TextField_setTouchSize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDeleteBackward\", js_cocos2dx_gui_TextField_setDeleteBackward, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_TextField_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_TextField_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_TextField_class,\n\t\tjs_cocos2dx_gui_TextField_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TextField\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::TextField> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_TextField_class;\n\t\tp->proto = jsb_cocos2d_gui_TextField_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_TextBMFont_class;\nJSObject *jsb_cocos2d_gui_TextBMFont_prototype;\n\nJSBool js_cocos2dx_gui_TextBMFont_setFntFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextBMFont* cobj = (cocos2d::gui::TextBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextBMFont_setFntFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextBMFont_setFntFile : Error processing arguments\");\n\t\tcobj->setFntFile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextBMFont_setFntFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextBMFont_getStringValue(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextBMFont* cobj = (cocos2d::gui::TextBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextBMFont_getStringValue : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getStringValue();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextBMFont_getStringValue : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextBMFont_setText(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::TextBMFont* cobj = (cocos2d::gui::TextBMFont *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_TextBMFont_setText : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_TextBMFont_setText : Error processing arguments\");\n\t\tcobj->setText(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextBMFont_setText : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_TextBMFont_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::TextBMFont* ret = cocos2d::gui::TextBMFont::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::TextBMFont>(cx, (cocos2d::gui::TextBMFont*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextBMFont_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_TextBMFont_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::TextBMFont* cobj = new cocos2d::gui::TextBMFont();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::TextBMFont> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::TextBMFont\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_TextBMFont_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nvoid js_cocos2d_gui_TextBMFont_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (TextBMFont)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_TextBMFont(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_TextBMFont_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_TextBMFont_class->name = \"TextBMFont\";\n\tjsb_cocos2d_gui_TextBMFont_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_TextBMFont_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_TextBMFont_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_TextBMFont_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_TextBMFont_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_TextBMFont_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_TextBMFont_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_TextBMFont_class->finalize = js_cocos2d_gui_TextBMFont_finalize;\n\tjsb_cocos2d_gui_TextBMFont_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setFntFile\", js_cocos2dx_gui_TextBMFont_setFntFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStringValue\", js_cocos2dx_gui_TextBMFont_getStringValue, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setText\", js_cocos2dx_gui_TextBMFont_setText, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_TextBMFont_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_TextBMFont_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Widget_prototype,\n\t\tjsb_cocos2d_gui_TextBMFont_class,\n\t\tjs_cocos2dx_gui_TextBMFont_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"TextBMFont\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::TextBMFont> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_TextBMFont_class;\n\t\tp->proto = jsb_cocos2d_gui_TextBMFont_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Widget_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_PageView_class;\nJSObject *jsb_cocos2d_gui_PageView_prototype;\n\nJSBool js_cocos2dx_gui_PageView_getCurPageIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_getCurPageIndex : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getCurPageIndex();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_getCurPageIndex : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_addWidgetToPage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_addWidgetToPage : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tssize_t arg1;\n\t\tJSBool arg2;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_ssize(cx, argv[1], &arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_addWidgetToPage : Error processing arguments\");\n\t\tcobj->addWidgetToPage(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_addWidgetToPage : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_getPage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_getPage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_getPage : Error processing arguments\");\n\t\tcocos2d::gui::Layout* ret = cobj->getPage(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Layout>(cx, (cocos2d::gui::Layout*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_getPage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_removePage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_removePage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::Layout* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Layout*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_removePage : Error processing arguments\");\n\t\tcobj->removePage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_removePage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_insertPage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_insertPage : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::gui::Layout* arg0;\n\t\tint arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Layout*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_insertPage : Error processing arguments\");\n\t\tcobj->insertPage(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_insertPage : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_scrollToPage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_scrollToPage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_scrollToPage : Error processing arguments\");\n\t\tcobj->scrollToPage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_scrollToPage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_removePageAtIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_removePageAtIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tssize_t arg0;\n\t\tok &= jsval_to_ssize(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_removePageAtIndex : Error processing arguments\");\n\t\tcobj->removePageAtIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_removePageAtIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_getPages(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_getPages : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Vector<cocos2d::gui::Layout *>& ret = cobj->getPages();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_getPages : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_removeAllPages : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeAllPages();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_removeAllPages : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_addPage(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::gui::PageView* cobj = (cocos2d::gui::PageView *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_addPage : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::gui::Layout* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Layout*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_PageView_addPage : Error processing arguments\");\n\t\tcobj->addPage(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_addPage : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_gui_PageView_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::PageView* ret = cocos2d::gui::PageView::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::PageView>(cx, (cocos2d::gui::PageView*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_PageView_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::gui::PageView* cobj = new cocos2d::gui::PageView();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocos2d::gui::PageView> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::gui::PageView\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_gui_PageView_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_gui_Layout_prototype;\n\nvoid js_cocos2d_gui_PageView_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (PageView)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_PageView(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_PageView_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_PageView_class->name = \"PageView\";\n\tjsb_cocos2d_gui_PageView_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_PageView_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_PageView_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_PageView_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_PageView_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_PageView_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_PageView_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_PageView_class->finalize = js_cocos2d_gui_PageView_finalize;\n\tjsb_cocos2d_gui_PageView_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getCurPageIndex\", js_cocos2dx_gui_PageView_getCurPageIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addWidgetToPage\", js_cocos2dx_gui_PageView_addWidgetToPage, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPage\", js_cocos2dx_gui_PageView_getPage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removePage\", js_cocos2dx_gui_PageView_removePage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"insertPage\", js_cocos2dx_gui_PageView_insertPage, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"scrollToPage\", js_cocos2dx_gui_PageView_scrollToPage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removePageAtIndex\", js_cocos2dx_gui_PageView_removePageAtIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPages\", js_cocos2dx_gui_PageView_getPages, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAllPages\", js_cocos2dx_gui_PageView_removeAllPages, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addPage\", js_cocos2dx_gui_PageView_addPage, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_gui_PageView_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_PageView_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_gui_Layout_prototype,\n\t\tjsb_cocos2d_gui_PageView_class,\n\t\tjs_cocos2dx_gui_PageView_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"PageView\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::PageView> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_PageView_class;\n\t\tp->proto = jsb_cocos2d_gui_PageView_prototype;\n\t\tp->parentProto = jsb_cocos2d_gui_Layout_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_gui_Helper_class;\nJSObject *jsb_cocos2d_gui_Helper_prototype;\n\nJSBool js_cocos2dx_gui_Helper_seekActionWidgetByActionTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tint arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Helper_seekActionWidgetByActionTag : Error processing arguments\");\n\t\tcocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekActionWidgetByActionTag(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Helper_seekActionWidgetByActionTag : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Helper_seekWidgetByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tint arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Helper_seekWidgetByTag : Error processing arguments\");\n\t\tcocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekWidgetByTag(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Helper_seekWidgetByTag : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Helper_seekWidgetByRelativeName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tconst char* arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Helper_seekWidgetByRelativeName : Error processing arguments\");\n\t\tcocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekWidgetByRelativeName(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Helper_seekWidgetByRelativeName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_gui_Helper_seekWidgetByName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::gui::Widget* arg0;\n\t\tconst char* arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::gui::Widget*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_gui_Helper_seekWidgetByName : Error processing arguments\");\n\t\tcocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekWidgetByName(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_gui_Helper_seekWidgetByName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_gui_Helper_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Helper)\", obj);\n}\n\nvoid js_register_cocos2dx_gui_Helper(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_gui_Helper_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_gui_Helper_class->name = \"Helper\";\n\tjsb_cocos2d_gui_Helper_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Helper_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_gui_Helper_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_gui_Helper_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_gui_Helper_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_gui_Helper_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_gui_Helper_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_gui_Helper_class->finalize = js_cocos2d_gui_Helper_finalize;\n\tjsb_cocos2d_gui_Helper_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"seekActionWidgetByActionTag\", js_cocos2dx_gui_Helper_seekActionWidgetByActionTag, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"seekWidgetByTag\", js_cocos2dx_gui_Helper_seekWidgetByTag, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"seekWidgetByRelativeName\", js_cocos2dx_gui_Helper_seekWidgetByRelativeName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"seekWidgetByName\", js_cocos2dx_gui_Helper_seekWidgetByName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_gui_Helper_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_gui_Helper_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Helper\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::gui::Helper> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_gui_Helper_class;\n\t\tp->proto = jsb_cocos2d_gui_Helper_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj) {\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"ccui\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"ccui\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n\tjs_register_cocos2dx_gui_Widget(cx, obj);\n\tjs_register_cocos2dx_gui_Layout(cx, obj);\n\tjs_register_cocos2dx_gui_PageView(cx, obj);\n\tjs_register_cocos2dx_gui_CheckBox(cx, obj);\n\tjs_register_cocos2dx_gui_Helper(cx, obj);\n\tjs_register_cocos2dx_gui_Text(cx, obj);\n\tjs_register_cocos2dx_gui_Button(cx, obj);\n\tjs_register_cocos2dx_gui_LayoutParameter(cx, obj);\n\tjs_register_cocos2dx_gui_LinearLayoutParameter(cx, obj);\n\tjs_register_cocos2dx_gui_TextBMFont(cx, obj);\n\tjs_register_cocos2dx_gui_ScrollView(cx, obj);\n\tjs_register_cocos2dx_gui_LoadingBar(cx, obj);\n\tjs_register_cocos2dx_gui_Slider(cx, obj);\n\tjs_register_cocos2dx_gui_RelativeLayoutParameter(cx, obj);\n\tjs_register_cocos2dx_gui_ImageView(cx, obj);\n\tjs_register_cocos2dx_gui_TextAtlas(cx, obj);\n\tjs_register_cocos2dx_gui_TextField(cx, obj);\n\tjs_register_cocos2dx_gui_ListView(cx, obj);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_gui_auto.hpp",
    "content": "#ifndef __cocos2dx_gui_h__\n#define __cocos2dx_gui_h__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n\nextern JSClass  *jsb_cocos2d_gui_LayoutParameter_class;\nextern JSObject *jsb_cocos2d_gui_LayoutParameter_prototype;\n\nJSBool js_cocos2dx_gui_LayoutParameter_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_LayoutParameter_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_LayoutParameter(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_LayoutParameter_getLayoutType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LayoutParameter_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LayoutParameter_LayoutParameter(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_LinearLayoutParameter_class;\nextern JSObject *jsb_cocos2d_gui_LinearLayoutParameter_prototype;\n\nJSBool js_cocos2dx_gui_LinearLayoutParameter_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_LinearLayoutParameter_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_LinearLayoutParameter(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_LinearLayoutParameter_setGravity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LinearLayoutParameter_getGravity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LinearLayoutParameter_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LinearLayoutParameter_LinearLayoutParameter(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_RelativeLayoutParameter_class;\nextern JSObject *jsb_cocos2d_gui_RelativeLayoutParameter_prototype;\n\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_RelativeLayoutParameter_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_RelativeLayoutParameter(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_setAlign(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_getRelativeName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_setRelativeName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_getAlign(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_RelativeLayoutParameter_RelativeLayoutParameter(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_Widget_class;\nextern JSObject *jsb_cocos2d_gui_Widget_prototype;\n\nJSBool js_cocos2dx_gui_Widget_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_Widget_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_Widget(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_Widget_getVirtualRenderer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setSizePercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setActionTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getNodeByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_isFlipY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getTouchEndPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setPositionPercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getNodes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setPositionType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_updateSizeAndPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getBottomInParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getActionTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getLayoutParameter(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getPositionType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getChildByName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_isEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_isFlipX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_removeNodeByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getContentSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getTouchStartPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_didNotSelectSelf(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setFocused(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_clone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getTouchMovePos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setBrightStyle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_addNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setLayoutParameter(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setFlipY(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setFlipX(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getLeftInParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_ignoreContentAdaptWithSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_isBright(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_clippingParentAreaContainPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getSizePercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getTopInParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getWidgetType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getRightInParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getSizeType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_removeNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_removeAllNodes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getWorldPosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_getPositionPercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_hitTest(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_isFocused(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setSizeType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_checkChildInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_setBright(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Widget_Widget(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_Layout_class;\nextern JSObject *jsb_cocos2d_gui_Layout_prototype;\n\nJSBool js_cocos2dx_gui_Layout_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_Layout_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_Layout(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_Layout_setBackGroundColorVector(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_hitTest(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_getBackGroundImageTextureSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_getLayoutType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setClippingType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setBackGroundColorType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setBackGroundImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setBackGroundColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_requestDoLayout(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_isClippingEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setBackGroundColorOpacity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setBackGroundImageCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_removeBackGroundImage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setClippingEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_setLayoutType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Layout_Layout(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_Button_class;\nextern JSObject *jsb_cocos2d_gui_Button_prototype;\n\nJSBool js_cocos2dx_gui_Button_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_Button_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_Button(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_Button_getTitleText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_loadTextureNormal(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setCapInsetsNormalRenderer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setCapInsetsPressedRenderer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_loadTexturePressed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setTitleFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setCapInsetsDisabledRenderer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setTitleFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_getTitleColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_loadTextureDisabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_getTitleFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setPressedActionEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_loadTextures(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_getTitleFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setTitleText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_setTitleColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Button_Button(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_CheckBox_class;\nextern JSObject *jsb_cocos2d_gui_CheckBox_prototype;\n\nJSBool js_cocos2dx_gui_CheckBox_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_CheckBox_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_CheckBox(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_CheckBox_getSelectedState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_loadTextureFrontCross(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_loadTextures(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_loadTextureBackGround(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_setSelectedState(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_CheckBox_CheckBox(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_ImageView_class;\nextern JSObject *jsb_cocos2d_gui_ImageView_prototype;\n\nJSBool js_cocos2dx_gui_ImageView_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_ImageView_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_ImageView(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_ImageView_setTextureRect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ImageView_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ImageView_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ImageView_loadTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ImageView_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ImageView_ImageView(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_Text_class;\nextern JSObject *jsb_cocos2d_gui_Text_prototype;\n\nJSBool js_cocos2dx_gui_Text_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_Text_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_Text(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_Text_getStringLength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_setFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_setTouchScaleChangeEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_getStringValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_setText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_setTextVerticalAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_setFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_isTouchScaleChangeEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_setTextHorizontalAlignment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_setTextAreaSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Text_Text(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_TextAtlas_class;\nextern JSObject *jsb_cocos2d_gui_TextAtlas_prototype;\n\nJSBool js_cocos2dx_gui_TextAtlas_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_TextAtlas_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_TextAtlas(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_TextAtlas_setProperty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextAtlas_getStringValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextAtlas_setStringValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextAtlas_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextAtlas_TextAtlas(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_LoadingBar_class;\nextern JSObject *jsb_cocos2d_gui_LoadingBar_prototype;\n\nJSBool js_cocos2dx_gui_LoadingBar_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_LoadingBar_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_LoadingBar(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_LoadingBar_setPercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_loadTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_setDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_getDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_getPercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_LoadingBar_LoadingBar(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_ScrollView_class;\nextern JSObject *jsb_cocos2d_gui_ScrollView_prototype;\n\nJSBool js_cocos2dx_gui_ScrollView_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_ScrollView_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_ScrollView(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_ScrollView_scrollToTop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToPercentHorizontal(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_isInertiaScrollEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToPercentBothDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_getDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToBottomLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_getInnerContainer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToBottom(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_setDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToTopLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToTopRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToBottomLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_setInnerContainerSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_getInnerContainerSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_isBounceEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToPercentVertical(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_setInertiaScrollEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToTopLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToPercentHorizontal(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToBottomRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_setBounceEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToTop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToPercentBothDirection(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToPercentVertical(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToBottom(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToBottomRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToLeft(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_jumpToRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_scrollToTopRight(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ScrollView_ScrollView(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_ListView_class;\nextern JSObject *jsb_cocos2d_gui_ListView_prototype;\n\nJSBool js_cocos2dx_gui_ListView_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_ListView_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_ListView(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_ListView_getIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_removeAllItems(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_setGravity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_pushBackCustomItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_getItems(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_removeItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_getCurSelectedIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_insertDefaultItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_setItemsMargin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_removeLastItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_getItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_setItemModel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_requestRefreshView(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_pushBackDefaultItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_insertCustomItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_ListView_ListView(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_Slider_class;\nextern JSObject *jsb_cocos2d_gui_Slider_prototype;\n\nJSBool js_cocos2dx_gui_Slider_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_Slider_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_Slider(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_Slider_setPercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTextureNormal(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_loadBarTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_loadProgressBarTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTextures(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_setCapInsetsBarRenderer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_setScale9Enabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_setCapInsets(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTexturePressed(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_loadSlidBallTextureDisabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_getPercent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Slider_Slider(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_TextField_class;\nextern JSObject *jsb_cocos2d_gui_TextField_prototype;\n\nJSBool js_cocos2dx_gui_TextField_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_TextField_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_TextField(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_TextField_setAttachWithIME(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_getStringValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setPasswordStyleText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_getAttachWithIME(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setFontName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_getInsertText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setInsertText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_getDetachWithIME(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_didNotSelectSelf(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_attachWithIME(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setPasswordEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setMaxLengthEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_getDeleteBackward(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setFontSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setPlaceHolder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_isPasswordEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_getMaxLength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_isMaxLengthEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setDetachWithIME(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setMaxLength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setTouchSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_setDeleteBackward(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextField_TextField(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_TextBMFont_class;\nextern JSObject *jsb_cocos2d_gui_TextBMFont_prototype;\n\nJSBool js_cocos2dx_gui_TextBMFont_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_TextBMFont_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_TextBMFont(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_TextBMFont_setFntFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextBMFont_getStringValue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextBMFont_setText(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextBMFont_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_TextBMFont_TextBMFont(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_PageView_class;\nextern JSObject *jsb_cocos2d_gui_PageView_prototype;\n\nJSBool js_cocos2dx_gui_PageView_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_PageView_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_PageView(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_PageView_getCurPageIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_addWidgetToPage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_getPage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_removePage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_insertPage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_scrollToPage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_removePageAtIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_getPages(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_removeAllPages(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_addPage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_PageView_PageView(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_gui_Helper_class;\nextern JSObject *jsb_cocos2d_gui_Helper_prototype;\n\nJSBool js_cocos2dx_gui_Helper_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_gui_Helper_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_gui_Helper(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_gui(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_gui_Helper_seekActionWidgetByActionTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Helper_seekWidgetByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Helper_seekWidgetByRelativeName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_gui_Helper_seekWidgetByName(JSContext *cx, uint32_t argc, jsval *vp);\n#endif\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_gui_auto_api.js",
    "content": "/**\n * @module cocos2dx_gui\n */\nvar ccui = ccui || {};\n\n/**\n * @class LayoutParameter\n */\nccui.LayoutParameter = {\n\n/**\n * @method getLayoutType\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutParameterType\"\n */\ngetLayoutType : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutParameter*\"\n */\ncreate : function () {},\n\n/**\n * @method LayoutParameter\n * @constructor\n */\nLayoutParameter : function () {},\n\n};\n\n/**\n * @class LinearLayoutParameter\n */\nccui.LinearLayoutParameter = {\n\n/**\n * @method setGravity\n * @param {cocos2d::gui::LinearGravity}\n */\nsetGravity : function () {},\n\n/**\n * @method getGravity\n * @return A value converted from C/C++ \"cocos2d::gui::LinearGravity\"\n */\ngetGravity : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::LinearLayoutParameter*\"\n */\ncreate : function () {},\n\n/**\n * @method LinearLayoutParameter\n * @constructor\n */\nLinearLayoutParameter : function () {},\n\n};\n\n/**\n * @class RelativeLayoutParameter\n */\nccui.RelativeLayoutParameter = {\n\n/**\n * @method setAlign\n * @param {cocos2d::gui::RelativeAlign}\n */\nsetAlign : function () {},\n\n/**\n * @method setRelativeToWidgetName\n * @param {const char*}\n */\nsetRelativeToWidgetName : function () {},\n\n/**\n * @method getRelativeName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetRelativeName : function () {},\n\n/**\n * @method getRelativeToWidgetName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetRelativeToWidgetName : function () {},\n\n/**\n * @method setRelativeName\n * @param {const char*}\n */\nsetRelativeName : function () {},\n\n/**\n * @method getAlign\n * @return A value converted from C/C++ \"cocos2d::gui::RelativeAlign\"\n */\ngetAlign : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::RelativeLayoutParameter*\"\n */\ncreate : function () {},\n\n/**\n * @method RelativeLayoutParameter\n * @constructor\n */\nRelativeLayoutParameter : function () {},\n\n};\n\n/**\n * @class Widget\n */\nccui.Widget = {\n\n/**\n * @method getVirtualRenderer\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetVirtualRenderer : function () {},\n\n/**\n * @method setSizePercent\n * @param {const cocos2d::Point&}\n */\nsetSizePercent : function () {},\n\n/**\n * @method setActionTag\n * @param {int}\n */\nsetActionTag : function () {},\n\n/**\n * @method getNodeByTag\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {int}\n */\ngetNodeByTag : function () {},\n\n/**\n * @method isFlipY\n * @return A value converted from C/C++ \"bool\"\n */\nisFlipY : function () {},\n\n/**\n * @method getTouchEndPos\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetTouchEndPos : function () {},\n\n/**\n * @method setPositionPercent\n * @param {const cocos2d::Point&}\n */\nsetPositionPercent : function () {},\n\n/**\n * @method getNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetNodes : function () {},\n\n/**\n * @method setPositionType\n * @param {cocos2d::gui::PositionType}\n */\nsetPositionType : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetName : function () {},\n\n/**\n * @method isIgnoreContentAdaptWithSize\n * @return A value converted from C/C++ \"bool\"\n */\nisIgnoreContentAdaptWithSize : function () {},\n\n/**\n * @method updateSizeAndPosition\n */\nupdateSizeAndPosition : function () {},\n\n/**\n * @method getBottomInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetBottomInParent : function () {},\n\n/**\n * @method getActionTag\n * @return A value converted from C/C++ \"int\"\n */\ngetActionTag : function () {},\n\n/**\n * @method getLayoutParameter\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutParameter*\"\n * @param {cocos2d::gui::LayoutParameterType}\n */\ngetLayoutParameter : function () {},\n\n/**\n * @method getPositionType\n * @return A value converted from C/C++ \"cocos2d::gui::PositionType\"\n */\ngetPositionType : function () {},\n\n/**\n * @method setName\n * @param {const char*}\n */\nsetName : function () {},\n\n/**\n * @method getChildByName\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {const char*}\n */\ngetChildByName : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method isFlipX\n * @return A value converted from C/C++ \"bool\"\n */\nisFlipX : function () {},\n\n/**\n * @method removeNodeByTag\n * @param {int}\n */\nremoveNodeByTag : function () {},\n\n/**\n * @method isTouchEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchEnabled : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetContentSize : function () {},\n\n/**\n * @method getTouchStartPos\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetTouchStartPos : function () {},\n\n/**\n * @method didNotSelectSelf\n */\ndidNotSelectSelf : function () {},\n\n/**\n * @method setFocused\n * @param {bool}\n */\nsetFocused : function () {},\n\n/**\n * @method setTouchEnabled\n * @param {bool}\n */\nsetTouchEnabled : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n */\nclone : function () {},\n\n/**\n * @method getTouchMovePos\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetTouchMovePos : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method setBrightStyle\n * @param {cocos2d::gui::BrightStyle}\n */\nsetBrightStyle : function () {},\n\n/**\n * @method setLayoutParameter\n * @param {cocos2d::gui::LayoutParameter*}\n */\nsetLayoutParameter : function () {},\n\n/**\n * @method setFlipY\n * @param {bool}\n */\nsetFlipY : function () {},\n\n/**\n * @method setFlipX\n * @param {bool}\n */\nsetFlipX : function () {},\n\n/**\n * @method getLeftInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetLeftInParent : function () {},\n\n/**\n * @method ignoreContentAdaptWithSize\n * @param {bool}\n */\nignoreContentAdaptWithSize : function () {},\n\n/**\n * @method isBright\n * @return A value converted from C/C++ \"bool\"\n */\nisBright : function () {},\n\n/**\n * @method clippingParentAreaContainPoint\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n */\nclippingParentAreaContainPoint : function () {},\n\n/**\n * @method getSizePercent\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetSizePercent : function () {},\n\n/**\n * @method getTopInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetTopInParent : function () {},\n\n/**\n * @method getWidgetType\n * @return A value converted from C/C++ \"cocos2d::gui::WidgetType\"\n */\ngetWidgetType : function () {},\n\n/**\n * @method getSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetSize : function () {},\n\n/**\n * @method getRightInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetRightInParent : function () {},\n\n/**\n * @method getSizeType\n * @return A value converted from C/C++ \"cocos2d::gui::SizeType\"\n */\ngetSizeType : function () {},\n\n/**\n * @method removeNode\n * @param {cocos2d::Node*}\n */\nremoveNode : function () {},\n\n/**\n * @method removeAllNodes\n */\nremoveAllNodes : function () {},\n\n/**\n * @method getWorldPosition\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetWorldPosition : function () {},\n\n/**\n * @method getPositionPercent\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPositionPercent : function () {},\n\n/**\n * @method hitTest\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n */\nhitTest : function () {},\n\n/**\n * @method isFocused\n * @return A value converted from C/C++ \"bool\"\n */\nisFocused : function () {},\n\n/**\n * @method setSizeType\n * @param {cocos2d::gui::SizeType}\n */\nsetSizeType : function () {},\n\n/**\n * @method checkChildInfo\n * @param {int}\n * @param {cocos2d::gui::Widget*}\n * @param {const cocos2d::Point&}\n */\ncheckChildInfo : function () {},\n\n/**\n * @method setSize\n * @param {const cocos2d::Size&}\n */\nsetSize : function () {},\n\n/**\n * @method setBright\n * @param {bool}\n */\nsetBright : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n */\ncreate : function () {},\n\n/**\n * @method Widget\n * @constructor\n */\nWidget : function () {},\n\n};\n\n/**\n * @class Layout\n */\nccui.Layout = {\n\n/**\n * @method setBackGroundColorVector\n * @param {const cocos2d::Point&}\n */\nsetBackGroundColorVector : function () {},\n\n/**\n * @method hitTest\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n */\nhitTest : function () {},\n\n/**\n * @method getBackGroundImageTextureSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetBackGroundImageTextureSize : function () {},\n\n/**\n * @method getLayoutType\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutType\"\n */\ngetLayoutType : function () {},\n\n/**\n * @method setClippingType\n * @param {cocos2d::gui::LayoutClippingType}\n */\nsetClippingType : function () {},\n\n/**\n * @method setBackGroundColorType\n * @param {cocos2d::gui::LayoutBackGroundColorType}\n */\nsetBackGroundColorType : function () {},\n\n/**\n * @method setBackGroundImage\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nsetBackGroundImage : function () {},\n\n/**\n * @method requestDoLayout\n */\nrequestDoLayout : function () {},\n\n/**\n * @method isClippingEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisClippingEnabled : function () {},\n\n/**\n * @method setBackGroundColorOpacity\n * @param {int}\n */\nsetBackGroundColorOpacity : function () {},\n\n/**\n * @method setBackGroundImageCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetBackGroundImageCapInsets : function () {},\n\n/**\n * @method removeBackGroundImage\n */\nremoveBackGroundImage : function () {},\n\n/**\n * @method setBackGroundImageScale9Enabled\n * @param {bool}\n */\nsetBackGroundImageScale9Enabled : function () {},\n\n/**\n * @method setClippingEnabled\n * @param {bool}\n */\nsetClippingEnabled : function () {},\n\n/**\n * @method setLayoutType\n * @param {cocos2d::gui::LayoutType}\n */\nsetLayoutType : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Layout*\"\n */\ncreate : function () {},\n\n/**\n * @method Layout\n * @constructor\n */\nLayout : function () {},\n\n};\n\n/**\n * @class Button\n */\nccui.Button = {\n\n/**\n * @method getTitleText\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetTitleText : function () {},\n\n/**\n * @method loadTextureNormal\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureNormal : function () {},\n\n/**\n * @method setCapInsetsNormalRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsNormalRenderer : function () {},\n\n/**\n * @method setCapInsetsPressedRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsPressedRenderer : function () {},\n\n/**\n * @method loadTexturePressed\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTexturePressed : function () {},\n\n/**\n * @method setTitleFontSize\n * @param {float}\n */\nsetTitleFontSize : function () {},\n\n/**\n * @method setCapInsetsDisabledRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsDisabledRenderer : function () {},\n\n/**\n * @method setTitleFontName\n * @param {const char*}\n */\nsetTitleFontName : function () {},\n\n/**\n * @method getTitleColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetTitleColor : function () {},\n\n/**\n * @method loadTextureDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureDisabled : function () {},\n\n/**\n * @method getTitleFontName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetTitleFontName : function () {},\n\n/**\n * @method setPressedActionEnabled\n * @param {bool}\n */\nsetPressedActionEnabled : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method loadTextures\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextures : function () {},\n\n/**\n * @method getTitleFontSize\n * @return A value converted from C/C++ \"float\"\n */\ngetTitleFontSize : function () {},\n\n/**\n * @method setTitleText\n * @param {const std::string&}\n */\nsetTitleText : function () {},\n\n/**\n * @method setTitleColor\n * @param {const cocos2d::Color3B&}\n */\nsetTitleColor : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Button*\"\n */\ncreate : function () {},\n\n/**\n * @method Button\n * @constructor\n */\nButton : function () {},\n\n};\n\n/**\n * @class CheckBox\n */\nccui.CheckBox = {\n\n/**\n * @method getSelectedState\n * @return A value converted from C/C++ \"bool\"\n */\ngetSelectedState : function () {},\n\n/**\n * @method loadTextureBackGroundSelected\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureBackGroundSelected : function () {},\n\n/**\n * @method loadTextureBackGroundDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureBackGroundDisabled : function () {},\n\n/**\n * @method loadTextureFrontCross\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureFrontCross : function () {},\n\n/**\n * @method loadTextures\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextures : function () {},\n\n/**\n * @method loadTextureBackGround\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureBackGround : function () {},\n\n/**\n * @method setSelectedState\n * @param {bool}\n */\nsetSelectedState : function () {},\n\n/**\n * @method loadTextureFrontCrossDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureFrontCrossDisabled : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::CheckBox*\"\n */\ncreate : function () {},\n\n/**\n * @method CheckBox\n * @constructor\n */\nCheckBox : function () {},\n\n};\n\n/**\n * @class ImageView\n */\nccui.ImageView = {\n\n/**\n * @method setTextureRect\n * @param {const cocos2d::Rect&}\n */\nsetTextureRect : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method loadTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTexture : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::ImageView*\"\n */\ncreate : function () {},\n\n/**\n * @method ImageView\n * @constructor\n */\nImageView : function () {},\n\n};\n\n/**\n * @class Text\n */\nccui.Text = {\n\n/**\n * @method getStringLength\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetStringLength : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method setTouchScaleChangeEnabled\n * @param {bool}\n */\nsetTouchScaleChangeEnabled : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setText\n * @param {const std::string&}\n */\nsetText : function () {},\n\n/**\n * @method setTextVerticalAlignment\n * @param {cocos2d::TextVAlignment}\n */\nsetTextVerticalAlignment : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n/**\n * @method isTouchScaleChangeEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchScaleChangeEnabled : function () {},\n\n/**\n * @method setTextHorizontalAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetTextHorizontalAlignment : function () {},\n\n/**\n * @method setTextAreaSize\n * @param {const cocos2d::Size&}\n */\nsetTextAreaSize : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Text*\"\n */\ncreate : function () {},\n\n/**\n * @method Text\n * @constructor\n */\nText : function () {},\n\n};\n\n/**\n * @class TextAtlas\n */\nccui.TextAtlas = {\n\n/**\n * @method setProperty\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n * @param {const std::string&}\n */\nsetProperty : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setStringValue\n * @param {const std::string&}\n */\nsetStringValue : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::TextAtlas*\"\n */\ncreate : function () {},\n\n/**\n * @method TextAtlas\n * @constructor\n */\nTextAtlas : function () {},\n\n};\n\n/**\n * @class LoadingBar\n */\nccui.LoadingBar = {\n\n/**\n * @method setPercent\n * @param {int}\n */\nsetPercent : function () {},\n\n/**\n * @method loadTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTexture : function () {},\n\n/**\n * @method setDirection\n * @param {cocos2d::gui::LoadingBarType}\n */\nsetDirection : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method getDirection\n * @return A value converted from C/C++ \"int\"\n */\ngetDirection : function () {},\n\n/**\n * @method getPercent\n * @return A value converted from C/C++ \"int\"\n */\ngetPercent : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::LoadingBar*\"\n */\ncreate : function () {},\n\n/**\n * @method LoadingBar\n * @constructor\n */\nLoadingBar : function () {},\n\n};\n\n/**\n * @class ScrollView\n */\nccui.ScrollView = {\n\n/**\n * @method scrollToTop\n * @param {float}\n * @param {bool}\n */\nscrollToTop : function () {},\n\n/**\n * @method scrollToPercentHorizontal\n * @param {float}\n * @param {float}\n * @param {bool}\n */\nscrollToPercentHorizontal : function () {},\n\n/**\n * @method isInertiaScrollEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisInertiaScrollEnabled : function () {},\n\n/**\n * @method scrollToPercentBothDirection\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {bool}\n */\nscrollToPercentBothDirection : function () {},\n\n/**\n * @method getDirection\n * @return A value converted from C/C++ \"cocos2d::gui::SCROLLVIEW_DIR\"\n */\ngetDirection : function () {},\n\n/**\n * @method scrollToBottomLeft\n * @param {float}\n * @param {bool}\n */\nscrollToBottomLeft : function () {},\n\n/**\n * @method getInnerContainer\n * @return A value converted from C/C++ \"cocos2d::gui::Layout*\"\n */\ngetInnerContainer : function () {},\n\n/**\n * @method jumpToBottom\n */\njumpToBottom : function () {},\n\n/**\n * @method setDirection\n * @param {cocos2d::gui::SCROLLVIEW_DIR}\n */\nsetDirection : function () {},\n\n/**\n * @method scrollToTopLeft\n * @param {float}\n * @param {bool}\n */\nscrollToTopLeft : function () {},\n\n/**\n * @method jumpToTopRight\n */\njumpToTopRight : function () {},\n\n/**\n * @method jumpToBottomLeft\n */\njumpToBottomLeft : function () {},\n\n/**\n * @method setInnerContainerSize\n * @param {const cocos2d::Size&}\n */\nsetInnerContainerSize : function () {},\n\n/**\n * @method getInnerContainerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetInnerContainerSize : function () {},\n\n/**\n * @method isBounceEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisBounceEnabled : function () {},\n\n/**\n * @method jumpToPercentVertical\n * @param {float}\n */\njumpToPercentVertical : function () {},\n\n/**\n * @method setInertiaScrollEnabled\n * @param {bool}\n */\nsetInertiaScrollEnabled : function () {},\n\n/**\n * @method jumpToTopLeft\n */\njumpToTopLeft : function () {},\n\n/**\n * @method jumpToPercentHorizontal\n * @param {float}\n */\njumpToPercentHorizontal : function () {},\n\n/**\n * @method jumpToBottomRight\n */\njumpToBottomRight : function () {},\n\n/**\n * @method setBounceEnabled\n * @param {bool}\n */\nsetBounceEnabled : function () {},\n\n/**\n * @method jumpToTop\n */\njumpToTop : function () {},\n\n/**\n * @method scrollToLeft\n * @param {float}\n * @param {bool}\n */\nscrollToLeft : function () {},\n\n/**\n * @method jumpToPercentBothDirection\n * @param {const cocos2d::Point&}\n */\njumpToPercentBothDirection : function () {},\n\n/**\n * @method scrollToPercentVertical\n * @param {float}\n * @param {float}\n * @param {bool}\n */\nscrollToPercentVertical : function () {},\n\n/**\n * @method scrollToBottom\n * @param {float}\n * @param {bool}\n */\nscrollToBottom : function () {},\n\n/**\n * @method scrollToBottomRight\n * @param {float}\n * @param {bool}\n */\nscrollToBottomRight : function () {},\n\n/**\n * @method jumpToLeft\n */\njumpToLeft : function () {},\n\n/**\n * @method scrollToRight\n * @param {float}\n * @param {bool}\n */\nscrollToRight : function () {},\n\n/**\n * @method jumpToRight\n */\njumpToRight : function () {},\n\n/**\n * @method scrollToTopRight\n * @param {float}\n * @param {bool}\n */\nscrollToTopRight : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::ScrollView*\"\n */\ncreate : function () {},\n\n/**\n * @method ScrollView\n * @constructor\n */\nScrollView : function () {},\n\n};\n\n/**\n * @class ListView\n */\nccui.ListView = {\n\n/**\n * @method getIndex\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::gui::Widget*}\n */\ngetIndex : function () {},\n\n/**\n * @method removeAllItems\n */\nremoveAllItems : function () {},\n\n/**\n * @method setGravity\n * @param {cocos2d::gui::ListViewGravity}\n */\nsetGravity : function () {},\n\n/**\n * @method pushBackCustomItem\n * @param {cocos2d::gui::Widget*}\n */\npushBackCustomItem : function () {},\n\n/**\n * @method getItems\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::gui::Widget *>&\"\n */\ngetItems : function () {},\n\n/**\n * @method removeItem\n * @param {ssize_t}\n */\nremoveItem : function () {},\n\n/**\n * @method getCurSelectedIndex\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetCurSelectedIndex : function () {},\n\n/**\n * @method insertDefaultItem\n * @param {ssize_t}\n */\ninsertDefaultItem : function () {},\n\n/**\n * @method setItemsMargin\n * @param {float}\n */\nsetItemsMargin : function () {},\n\n/**\n * @method removeLastItem\n */\nremoveLastItem : function () {},\n\n/**\n * @method getItem\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {ssize_t}\n */\ngetItem : function () {},\n\n/**\n * @method setItemModel\n * @param {cocos2d::gui::Widget*}\n */\nsetItemModel : function () {},\n\n/**\n * @method requestRefreshView\n */\nrequestRefreshView : function () {},\n\n/**\n * @method pushBackDefaultItem\n */\npushBackDefaultItem : function () {},\n\n/**\n * @method insertCustomItem\n * @param {cocos2d::gui::Widget*}\n * @param {ssize_t}\n */\ninsertCustomItem : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::ListView*\"\n */\ncreate : function () {},\n\n/**\n * @method ListView\n * @constructor\n */\nListView : function () {},\n\n};\n\n/**\n * @class Slider\n */\nccui.Slider = {\n\n/**\n * @method setPercent\n * @param {int}\n */\nsetPercent : function () {},\n\n/**\n * @method loadSlidBallTextureNormal\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTextureNormal : function () {},\n\n/**\n * @method loadBarTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadBarTexture : function () {},\n\n/**\n * @method loadProgressBarTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadProgressBarTexture : function () {},\n\n/**\n * @method loadSlidBallTextures\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTextures : function () {},\n\n/**\n * @method setCapInsetProgressBarRebderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetProgressBarRebderer : function () {},\n\n/**\n * @method setCapInsetsBarRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsBarRenderer : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method loadSlidBallTexturePressed\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTexturePressed : function () {},\n\n/**\n * @method loadSlidBallTextureDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTextureDisabled : function () {},\n\n/**\n * @method getPercent\n * @return A value converted from C/C++ \"int\"\n */\ngetPercent : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Slider*\"\n */\ncreate : function () {},\n\n/**\n * @method Slider\n * @constructor\n */\nSlider : function () {},\n\n};\n\n/**\n * @class TextField\n */\nccui.TextField = {\n\n/**\n * @method setAttachWithIME\n * @param {bool}\n */\nsetAttachWithIME : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setPasswordStyleText\n * @param {const char*}\n */\nsetPasswordStyleText : function () {},\n\n/**\n * @method getAttachWithIME\n * @return A value converted from C/C++ \"bool\"\n */\ngetAttachWithIME : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method getInsertText\n * @return A value converted from C/C++ \"bool\"\n */\ngetInsertText : function () {},\n\n/**\n * @method setInsertText\n * @param {bool}\n */\nsetInsertText : function () {},\n\n/**\n * @method getDetachWithIME\n * @return A value converted from C/C++ \"bool\"\n */\ngetDetachWithIME : function () {},\n\n/**\n * @method didNotSelectSelf\n */\ndidNotSelectSelf : function () {},\n\n/**\n * @method attachWithIME\n */\nattachWithIME : function () {},\n\n/**\n * @method setPasswordEnabled\n * @param {bool}\n */\nsetPasswordEnabled : function () {},\n\n/**\n * @method setMaxLengthEnabled\n * @param {bool}\n */\nsetMaxLengthEnabled : function () {},\n\n/**\n * @method getDeleteBackward\n * @return A value converted from C/C++ \"bool\"\n */\ngetDeleteBackward : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n/**\n * @method setPlaceHolder\n * @param {const std::string&}\n */\nsetPlaceHolder : function () {},\n\n/**\n * @method isPasswordEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisPasswordEnabled : function () {},\n\n/**\n * @method getMaxLength\n * @return A value converted from C/C++ \"int\"\n */\ngetMaxLength : function () {},\n\n/**\n * @method isMaxLengthEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisMaxLengthEnabled : function () {},\n\n/**\n * @method setDetachWithIME\n * @param {bool}\n */\nsetDetachWithIME : function () {},\n\n/**\n * @method setText\n * @param {const std::string&}\n */\nsetText : function () {},\n\n/**\n * @method setMaxLength\n * @param {int}\n */\nsetMaxLength : function () {},\n\n/**\n * @method setTouchSize\n * @param {const cocos2d::Size&}\n */\nsetTouchSize : function () {},\n\n/**\n * @method setDeleteBackward\n * @param {bool}\n */\nsetDeleteBackward : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::TextField*\"\n */\ncreate : function () {},\n\n/**\n * @method TextField\n * @constructor\n */\nTextField : function () {},\n\n};\n\n/**\n * @class TextBMFont\n */\nccui.TextBMFont = {\n\n/**\n * @method setFntFile\n * @param {const char*}\n */\nsetFntFile : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const char*\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setText\n * @param {const char*}\n */\nsetText : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::TextBMFont*\"\n */\ncreate : function () {},\n\n/**\n * @method TextBMFont\n * @constructor\n */\nTextBMFont : function () {},\n\n};\n\n/**\n * @class PageView\n */\nccui.PageView = {\n\n/**\n * @method getCurPageIndex\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetCurPageIndex : function () {},\n\n/**\n * @method addWidgetToPage\n * @param {cocos2d::gui::Widget*}\n * @param {ssize_t}\n * @param {bool}\n */\naddWidgetToPage : function () {},\n\n/**\n * @method getPage\n * @return A value converted from C/C++ \"cocos2d::gui::Layout*\"\n * @param {ssize_t}\n */\ngetPage : function () {},\n\n/**\n * @method removePage\n * @param {cocos2d::gui::Layout*}\n */\nremovePage : function () {},\n\n/**\n * @method insertPage\n * @param {cocos2d::gui::Layout*}\n * @param {int}\n */\ninsertPage : function () {},\n\n/**\n * @method scrollToPage\n * @param {ssize_t}\n */\nscrollToPage : function () {},\n\n/**\n * @method removePageAtIndex\n * @param {ssize_t}\n */\nremovePageAtIndex : function () {},\n\n/**\n * @method getPages\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::gui::Layout *>&\"\n */\ngetPages : function () {},\n\n/**\n * @method removeAllPages\n */\nremoveAllPages : function () {},\n\n/**\n * @method addPage\n * @param {cocos2d::gui::Layout*}\n */\naddPage : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::PageView*\"\n */\ncreate : function () {},\n\n/**\n * @method PageView\n * @constructor\n */\nPageView : function () {},\n\n};\n\n/**\n * @class Helper\n */\nccui.Helper = {\n\n/**\n * @method seekActionWidgetByActionTag\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {int}\n */\nseekActionWidgetByActionTag : function () {},\n\n/**\n * @method seekWidgetByTag\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {int}\n */\nseekWidgetByTag : function () {},\n\n/**\n * @method seekWidgetByRelativeName\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {const char*}\n */\nseekWidgetByRelativeName : function () {},\n\n/**\n * @method seekWidgetByName\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {const char*}\n */\nseekWidgetByName : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_spine_auto.cpp",
    "content": "#include \"jsb_cocos2dx_spine_auto.hpp\"\n#include \"cocos2d_specifics.hpp\"\n#include \"spine-cocos2dx.h\"\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n    JSObject* global = ScriptingCore::getInstance()->getGlobalObject();\n\tisNewValid = JS_GetProperty(cx, global, \"initializing\", &initializing) && JSVAL_TO_BOOLEAN(initializing);\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n    JS_ReportError(cx, \"Don't use `new cc.XXX`, please use `cc.XXX.create` instead! \");\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_is_native_obj(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n\tvp.set(BOOLEAN_TO_JSVAL(JS_TRUE));\n\treturn JS_TRUE;\t\n}\nJSClass  *jsb_spine_Skeleton_class;\nJSObject *jsb_spine_Skeleton_prototype;\n\nJSBool js_cocos2dx_spine_Skeleton_setToSetupPose(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setToSetupPose : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setToSetupPose();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_setToSetupPose : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setBlendFunc : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::BlendFunc arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR BlendFunc;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setBlendFunc : Error processing arguments\");\n\t\tcobj->setBlendFunc(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_setBlendFunc : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_onDraw(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_onDraw : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->onDraw();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_onDraw : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_setSlotsToSetupPose(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setSlotsToSetupPose : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setSlotsToSetupPose();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_setSlotsToSetupPose : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_getAttachment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_getAttachment : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_getAttachment : Error processing arguments\");\n\t\tspAttachment* ret = cobj->getAttachment(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spAttachment*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_getAttachment : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_setAttachment(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setAttachment : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setAttachment : Error processing arguments\");\n\t\tJSBool ret = cobj->setAttachment(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_setAttachment : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_getBlendFunc : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::BlendFunc& ret = cobj->getBlendFunc();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR BlendFunc;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_getBlendFunc : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_setSkin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setSkin : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setSkin : Error processing arguments\");\n\t\tJSBool ret = cobj->setSkin(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_setSkin : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_findSlot(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_findSlot : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_findSlot : Error processing arguments\");\n\t\tspSlot* ret = cobj->findSlot(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spSlot*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_findSlot : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_updateWorldTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_updateWorldTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateWorldTransform();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_updateWorldTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_setBonesToSetupPose(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_setBonesToSetupPose : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->setBonesToSetupPose();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_setBonesToSetupPose : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_findBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::Skeleton* cobj = (spine::Skeleton *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_findBone : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_Skeleton_findBone : Error processing arguments\");\n\t\tspBone* ret = cobj->findBone(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spBone*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_findBone : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_createWithFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::Skeleton* ret = spine::Skeleton::createWithFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::Skeleton>(cx, (spine::Skeleton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::Skeleton* ret = spine::Skeleton::createWithFile(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::Skeleton>(cx, (spine::Skeleton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::Skeleton* ret = spine::Skeleton::createWithFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::Skeleton>(cx, (spine::Skeleton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::Skeleton* ret = spine::Skeleton::createWithFile(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::Skeleton>(cx, (spine::Skeleton*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_createWithFile : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_Skeleton_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tspine::Skeleton* cobj = NULL;\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::Skeleton(arg0, arg1);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::Skeleton> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::Skeleton\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::Skeleton(arg0, arg1, arg2);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::Skeleton> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::Skeleton\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tspSkeletonData* arg0;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spSkeletonData*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::Skeleton(arg0);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::Skeleton> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::Skeleton\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tspSkeletonData* arg0;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spSkeletonData*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg1;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::Skeleton(arg0, arg1);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::Skeleton> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::Skeleton\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::Skeleton(arg0, arg1);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::Skeleton> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::Skeleton\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::Skeleton(arg0, arg1, arg2);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::Skeleton> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::Skeleton\");\n\t\t}\n\t} while(0);\n\n\tif (cobj) {\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_spine_Skeleton_constructor : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_spine_Skeleton_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Skeleton)\", obj);\n}\n\nvoid js_register_cocos2dx_spine_Skeleton(JSContext *cx, JSObject *global) {\n\tjsb_spine_Skeleton_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_spine_Skeleton_class->name = \"Skeleton\";\n\tjsb_spine_Skeleton_class->addProperty = JS_PropertyStub;\n\tjsb_spine_Skeleton_class->delProperty = JS_DeletePropertyStub;\n\tjsb_spine_Skeleton_class->getProperty = JS_PropertyStub;\n\tjsb_spine_Skeleton_class->setProperty = JS_StrictPropertyStub;\n\tjsb_spine_Skeleton_class->enumerate = JS_EnumerateStub;\n\tjsb_spine_Skeleton_class->resolve = JS_ResolveStub;\n\tjsb_spine_Skeleton_class->convert = JS_ConvertStub;\n\tjsb_spine_Skeleton_class->finalize = js_spine_Skeleton_finalize;\n\tjsb_spine_Skeleton_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setToSetupPose\", js_cocos2dx_spine_Skeleton_setToSetupPose, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBlendFunc\", js_cocos2dx_spine_Skeleton_setBlendFunc, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"onDraw\", js_cocos2dx_spine_Skeleton_onDraw, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSlotsToSetupPose\", js_cocos2dx_spine_Skeleton_setSlotsToSetupPose, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAttachment\", js_cocos2dx_spine_Skeleton_getAttachment, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAttachment\", js_cocos2dx_spine_Skeleton_setAttachment, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBlendFunc\", js_cocos2dx_spine_Skeleton_getBlendFunc, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSkin\", js_cocos2dx_spine_Skeleton_setSkin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"findSlot\", js_cocos2dx_spine_Skeleton_findSlot, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateWorldTransform\", js_cocos2dx_spine_Skeleton_updateWorldTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBonesToSetupPose\", js_cocos2dx_spine_Skeleton_setBonesToSetupPose, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"findBone\", js_cocos2dx_spine_Skeleton_findBone, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"createWithFile\", js_cocos2dx_spine_Skeleton_createWithFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_spine_Skeleton_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_spine_Skeleton_class,\n\t\tjs_cocos2dx_spine_Skeleton_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Skeleton\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<spine::Skeleton> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_spine_Skeleton_class;\n\t\tp->proto = jsb_spine_Skeleton_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_spine_SkeletonAnimation_class;\nJSObject *jsb_spine_SkeletonAnimation_prototype;\n\nJSBool js_cocos2dx_spine_SkeletonAnimation_addAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_addAnimation : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tconst char* arg1;\n\t\tJSBool arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_addAnimation : Error processing arguments\");\n\t\tspTrackEntry* ret = cobj->addAnimation(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 4) {\n\t\tint arg0;\n\t\tconst char* arg1;\n\t\tJSBool arg2;\n\t\tdouble arg3;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tok &= JS_ValueToNumber(cx, argv[3], &arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_addAnimation : Error processing arguments\");\n\t\tspTrackEntry* ret = cobj->addAnimation(arg0, arg1, arg2, arg3);\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_addAnimation : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_getCurrent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_getCurrent : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tspTrackEntry* ret = cobj->getCurrent();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_getCurrent : Error processing arguments\");\n\t\tspTrackEntry* ret = cobj->getCurrent(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_getCurrent : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_setAnimationStateData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_setAnimationStateData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tspAnimationStateData* arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAnimationStateData*;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_setAnimationStateData : Error processing arguments\");\n\t\tcobj->setAnimationStateData(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_setAnimationStateData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_update : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_update : Error processing arguments\");\n\t\tcobj->update(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_update : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_setMix(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_setMix : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tdouble arg2;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_setMix : Error processing arguments\");\n\t\tcobj->setMix(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_setMix : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_setAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_setAnimation : Invalid Native Object\");\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tconst char* arg1;\n\t\tJSBool arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_setAnimation : Error processing arguments\");\n\t\tspTrackEntry* ret = cobj->setAnimation(arg0, arg1, arg2);\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_setAnimation : wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_clearTracks(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_clearTracks : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->clearTracks();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_clearTracks : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_clearTrack(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_clearTrack : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->clearTrack();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_clearTrack : Error processing arguments\");\n\t\tcobj->clearTrack(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_clearTrack : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tspine::SkeletonAnimation* cobj = (spine::SkeletonAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent : Invalid Native Object\");\n\tif (argc == 4) {\n\t\tint arg0;\n\t\tspEventType arg1;\n\t\tspEvent* arg2;\n\t\tint arg3;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR spEvent*;\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent : Error processing arguments\");\n\t\tcobj->onAnimationStateEvent(arg0, arg1, arg2, arg3);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent : wrong number of arguments: %d, was expecting %d\", argc, 4);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::SkeletonAnimation>(cx, (spine::SkeletonAnimation*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::SkeletonAnimation>(cx, (spine::SkeletonAnimation*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::SkeletonAnimation>(cx, (spine::SkeletonAnimation*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspine::SkeletonAnimation* ret = spine::SkeletonAnimation::createWithFile(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<spine::SkeletonAnimation>(cx, (spine::SkeletonAnimation*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_createWithFile : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tspine::SkeletonAnimation* cobj = NULL;\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::SkeletonAnimation(arg0, arg1);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::SkeletonAnimation> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::SkeletonAnimation\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tspAtlas* arg1;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spAtlas*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::SkeletonAnimation(arg0, arg1, arg2);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::SkeletonAnimation> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::SkeletonAnimation\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tspSkeletonData* arg0;\n\t\t\t#pragma warning NO CONVERSION TO NATIVE FOR spSkeletonData*;\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::SkeletonAnimation(arg0);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::SkeletonAnimation> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::SkeletonAnimation\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::SkeletonAnimation(arg0, arg1);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::SkeletonAnimation> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::SkeletonAnimation\");\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg2;\n\t\t\tok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj = new spine::SkeletonAnimation(arg0, arg1, arg2);\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n\t\t\tTypeTest<spine::SkeletonAnimation> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"spine::SkeletonAnimation\");\n\t\t}\n\t} while(0);\n\n\tif (cobj) {\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_spine_SkeletonAnimation_constructor : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_spine_Skeleton_prototype;\n\nvoid js_spine_SkeletonAnimation_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SkeletonAnimation)\", obj);\n}\n\nvoid js_register_cocos2dx_spine_SkeletonAnimation(JSContext *cx, JSObject *global) {\n\tjsb_spine_SkeletonAnimation_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_spine_SkeletonAnimation_class->name = \"SkeletonAnimation\";\n\tjsb_spine_SkeletonAnimation_class->addProperty = JS_PropertyStub;\n\tjsb_spine_SkeletonAnimation_class->delProperty = JS_DeletePropertyStub;\n\tjsb_spine_SkeletonAnimation_class->getProperty = JS_PropertyStub;\n\tjsb_spine_SkeletonAnimation_class->setProperty = JS_StrictPropertyStub;\n\tjsb_spine_SkeletonAnimation_class->enumerate = JS_EnumerateStub;\n\tjsb_spine_SkeletonAnimation_class->resolve = JS_ResolveStub;\n\tjsb_spine_SkeletonAnimation_class->convert = JS_ConvertStub;\n\tjsb_spine_SkeletonAnimation_class->finalize = js_spine_SkeletonAnimation_finalize;\n\tjsb_spine_SkeletonAnimation_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"addAnimation\", js_cocos2dx_spine_SkeletonAnimation_addAnimation, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrent\", js_cocos2dx_spine_SkeletonAnimation_getCurrent, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimationStateData\", js_cocos2dx_spine_SkeletonAnimation_setAnimationStateData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_spine_SkeletonAnimation_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMix\", js_cocos2dx_spine_SkeletonAnimation_setMix, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimation\", js_cocos2dx_spine_SkeletonAnimation_setAnimation, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clearTracks\", js_cocos2dx_spine_SkeletonAnimation_clearTracks, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"clearTrack\", js_cocos2dx_spine_SkeletonAnimation_clearTrack, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"onAnimationStateEvent\", js_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"createWithFile\", js_cocos2dx_spine_SkeletonAnimation_createWithFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_spine_SkeletonAnimation_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_spine_Skeleton_prototype,\n\t\tjsb_spine_SkeletonAnimation_class,\n\t\tjs_cocos2dx_spine_SkeletonAnimation_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SkeletonAnimation\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<spine::SkeletonAnimation> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_spine_SkeletonAnimation_class;\n\t\tp->proto = jsb_spine_SkeletonAnimation_prototype;\n\t\tp->parentProto = jsb_spine_Skeleton_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nvoid register_all_cocos2dx_spine(JSContext* cx, JSObject* obj) {\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"sp\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"sp\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n\tjs_register_cocos2dx_spine_Skeleton(cx, obj);\n\tjs_register_cocos2dx_spine_SkeletonAnimation(cx, obj);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_spine_auto.hpp",
    "content": "#ifndef __cocos2dx_spine_h__\n#define __cocos2dx_spine_h__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n\nextern JSClass  *jsb_spine_Skeleton_class;\nextern JSObject *jsb_spine_Skeleton_prototype;\n\nJSBool js_cocos2dx_spine_Skeleton_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_spine_Skeleton_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_spine_Skeleton(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_spine(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_spine_Skeleton_setToSetupPose(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_onDraw(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_setSlotsToSetupPose(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_getAttachment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_setAttachment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_getBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_setSkin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_findSlot(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_updateWorldTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_setBonesToSetupPose(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_findBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_createWithFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_Skeleton_Skeleton(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_spine_SkeletonAnimation_class;\nextern JSObject *jsb_spine_SkeletonAnimation_prototype;\n\nJSBool js_cocos2dx_spine_SkeletonAnimation_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_spine_SkeletonAnimation_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_spine_SkeletonAnimation(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_spine(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_spine_SkeletonAnimation_addAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_getCurrent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_setAnimationStateData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_setMix(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_setAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_clearTracks(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_clearTrack(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_createWithFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_spine_SkeletonAnimation_SkeletonAnimation(JSContext *cx, uint32_t argc, jsval *vp);\n#endif\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_spine_auto_api.js",
    "content": "/**\n * @module cocos2dx_spine\n */\nvar sp = sp || {};\n\n/**\n * @class Skeleton\n */\nsp.Skeleton = {\n\n/**\n * @method setToSetupPose\n */\nsetToSetupPose : function () {},\n\n/**\n * @method setBlendFunc\n * @param {const cocos2d::BlendFunc&}\n */\nsetBlendFunc : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method setSlotsToSetupPose\n */\nsetSlotsToSetupPose : function () {},\n\n/**\n * @method getAttachment\n * @return A value converted from C/C++ \"spAttachment*\"\n * @param {const char*}\n * @param {const char*}\n */\ngetAttachment : function () {},\n\n/**\n * @method setAttachment\n * @return A value converted from C/C++ \"bool\"\n * @param {const char*}\n * @param {const char*}\n */\nsetAttachment : function () {},\n\n/**\n * @method getBlendFunc\n * @return A value converted from C/C++ \"const cocos2d::BlendFunc&\"\n */\ngetBlendFunc : function () {},\n\n/**\n * @method setSkin\n * @return A value converted from C/C++ \"bool\"\n * @param {const char*}\n */\nsetSkin : function () {},\n\n/**\n * @method findSlot\n * @return A value converted from C/C++ \"spSlot*\"\n * @param {const char*}\n */\nfindSlot : function () {},\n\n/**\n * @method updateWorldTransform\n */\nupdateWorldTransform : function () {},\n\n/**\n * @method setBonesToSetupPose\n */\nsetBonesToSetupPose : function () {},\n\n/**\n * @method findBone\n * @return A value converted from C/C++ \"spBone*\"\n * @param {const char*}\n */\nfindBone : function () {},\n\n};\n\n/**\n * @class SkeletonAnimation\n */\nsp.SkeletonAnimation = {\n\n/**\n * @method addAnimation\n * @return A value converted from C/C++ \"spTrackEntry*\"\n * @param {int}\n * @param {const char*}\n * @param {bool}\n * @param {float}\n */\naddAnimation : function () {},\n\n/**\n * @method getCurrent\n * @return A value converted from C/C++ \"spTrackEntry*\"\n */\ngetCurrent : function () {},\n\n/**\n * @method setAnimationStateData\n * @param {spAnimationStateData*}\n */\nsetAnimationStateData : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method setMix\n * @param {const char*}\n * @param {const char*}\n * @param {float}\n */\nsetMix : function () {},\n\n/**\n * @method setAnimation\n * @return A value converted from C/C++ \"spTrackEntry*\"\n * @param {int}\n * @param {const char*}\n * @param {bool}\n */\nsetAnimation : function () {},\n\n/**\n * @method clearTracks\n */\nclearTracks : function () {},\n\n/**\n * @method clearTrack\n */\nclearTrack : function () {},\n\n/**\n * @method onAnimationStateEvent\n * @param {int}\n * @param {spEventType}\n * @param {spEvent*}\n * @param {int}\n */\nonAnimationStateEvent : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_studio_auto.cpp",
    "content": "#include \"jsb_cocos2dx_studio_auto.hpp\"\n#include \"cocos2d_specifics.hpp\"\n#include \"CocoStudio.h\"\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n    JSObject* global = ScriptingCore::getInstance()->getGlobalObject();\n\tisNewValid = JS_GetProperty(cx, global, \"initializing\", &initializing) && JSVAL_TO_BOOLEAN(initializing);\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n    JS_ReportError(cx, \"Don't use `new cc.XXX`, please use `cc.XXX.create` instead! \");\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_is_native_obj(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n\tvp.set(BOOLEAN_TO_JSVAL(JS_TRUE));\n\treturn JS_TRUE;\t\n}\nJSClass  *jsb_cocostudio_ActionObject_class;\nJSObject *jsb_cocostudio_ActionObject_prototype;\n\nJSBool js_cocos2dx_studio_ActionObject_setCurrentTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setCurrentTime : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setCurrentTime : Error processing arguments\");\n\t\tcobj->setCurrentTime(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_setCurrentTime : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_pause(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_pause : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pause();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_pause : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_setName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setName : Error processing arguments\");\n\t\tcobj->setName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_setName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_setUnitTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setUnitTime : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setUnitTime : Error processing arguments\");\n\t\tcobj->setUnitTime(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_setUnitTime : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_getTotalTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_getTotalTime : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getTotalTime();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_getTotalTime : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_getName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_getName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_getName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_stop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_stop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stop();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_stop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_play(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::ActionObject* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_play : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::CallFunc* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::CallFunc*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->play(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcobj->play();\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_play : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_getCurrentTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_getCurrentTime : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getCurrentTime();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_getCurrentTime : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_removeActionNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_removeActionNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::ActionNode* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::ActionNode*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_removeActionNode : Error processing arguments\");\n\t\tcobj->removeActionNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_removeActionNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_getLoop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_getLoop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getLoop();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_getLoop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_addActionNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_addActionNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::ActionNode* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::ActionNode*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_addActionNode : Error processing arguments\");\n\t\tcobj->addActionNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_addActionNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_getUnitTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_getUnitTime : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getUnitTime();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_getUnitTime : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_isPlaying(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_isPlaying : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isPlaying();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_isPlaying : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_updateToFrameByTime(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_updateToFrameByTime : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_updateToFrameByTime : Error processing arguments\");\n\t\tcobj->updateToFrameByTime(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_updateToFrameByTime : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_setLoop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setLoop : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_setLoop : Error processing arguments\");\n\t\tcobj->setLoop(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_setLoop : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_simulationActionUpdate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionObject* cobj = (cocostudio::ActionObject *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_simulationActionUpdate : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionObject_simulationActionUpdate : Error processing arguments\");\n\t\tcobj->simulationActionUpdate(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_simulationActionUpdate : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionObject_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ActionObject* cobj = new cocostudio::ActionObject();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::ActionObject> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::ActionObject\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionObject_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_ActionObject_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionObject)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ActionObject(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ActionObject_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ActionObject_class->name = \"ActionObject\";\n\tjsb_cocostudio_ActionObject_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ActionObject_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ActionObject_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ActionObject_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ActionObject_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ActionObject_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ActionObject_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ActionObject_class->finalize = js_cocostudio_ActionObject_finalize;\n\tjsb_cocostudio_ActionObject_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setCurrentTime\", js_cocos2dx_studio_ActionObject_setCurrentTime, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pause\", js_cocos2dx_studio_ActionObject_pause, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setName\", js_cocos2dx_studio_ActionObject_setName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUnitTime\", js_cocos2dx_studio_ActionObject_setUnitTime, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTotalTime\", js_cocos2dx_studio_ActionObject_getTotalTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getName\", js_cocos2dx_studio_ActionObject_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stop\", js_cocos2dx_studio_ActionObject_stop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"play\", js_cocos2dx_studio_ActionObject_play, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentTime\", js_cocos2dx_studio_ActionObject_getCurrentTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeActionNode\", js_cocos2dx_studio_ActionObject_removeActionNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLoop\", js_cocos2dx_studio_ActionObject_getLoop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addActionNode\", js_cocos2dx_studio_ActionObject_addActionNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getUnitTime\", js_cocos2dx_studio_ActionObject_getUnitTime, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isPlaying\", js_cocos2dx_studio_ActionObject_isPlaying, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateToFrameByTime\", js_cocos2dx_studio_ActionObject_updateToFrameByTime, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLoop\", js_cocos2dx_studio_ActionObject_setLoop, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"simulationActionUpdate\", js_cocos2dx_studio_ActionObject_simulationActionUpdate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocostudio_ActionObject_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_ActionObject_class,\n\t\tjs_cocos2dx_studio_ActionObject_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionObject\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ActionObject> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ActionObject_class;\n\t\tp->proto = jsb_cocostudio_ActionObject_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ActionManagerEx_class;\nJSObject *jsb_cocostudio_ActionManagerEx_prototype;\n\nJSBool js_cocos2dx_studio_ActionManagerEx_playActionByName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::ActionManagerEx* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::ActionManagerEx *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionManagerEx_playActionByName : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocos2d::CallFunc* arg2;\n\t\t\tdo {\n\t\t\t\tif (!argv[2].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::CallFunc*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::ActionObject* ret = cobj->playActionByName(arg0, arg1, arg2);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ActionObject>(cx, (cocostudio::ActionObject*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::ActionObject* ret = cobj->playActionByName(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ActionObject>(cx, (cocostudio::ActionObject*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionManagerEx_playActionByName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionManagerEx_getActionByName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionManagerEx* cobj = (cocostudio::ActionManagerEx *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionManagerEx_getActionByName : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ActionManagerEx_getActionByName : Error processing arguments\");\n\t\tcocostudio::ActionObject* ret = cobj->getActionByName(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ActionObject>(cx, (cocostudio::ActionObject*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionManagerEx_getActionByName : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionManagerEx_releaseActions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ActionManagerEx* cobj = (cocostudio::ActionManagerEx *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ActionManagerEx_releaseActions : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->releaseActions();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionManagerEx_releaseActions : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ActionManagerEx_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ActionManagerEx::destroyInstance();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionManagerEx_destroyInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ActionManagerEx_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ActionManagerEx* ret = cocostudio::ActionManagerEx::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ActionManagerEx>(cx, (cocostudio::ActionManagerEx*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ActionManagerEx_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_ActionManagerEx_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ActionManagerEx)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ActionManagerEx(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ActionManagerEx_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ActionManagerEx_class->name = \"ActionManager\";\n\tjsb_cocostudio_ActionManagerEx_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ActionManagerEx_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ActionManagerEx_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ActionManagerEx_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ActionManagerEx_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ActionManagerEx_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ActionManagerEx_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ActionManagerEx_class->finalize = js_cocostudio_ActionManagerEx_finalize;\n\tjsb_cocostudio_ActionManagerEx_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"playActionByName\", js_cocos2dx_studio_ActionManagerEx_playActionByName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getActionByName\", js_cocos2dx_studio_ActionManagerEx_getActionByName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"releaseActions\", js_cocos2dx_studio_ActionManagerEx_releaseActions, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"destroyInstance\", js_cocos2dx_studio_ActionManagerEx_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_studio_ActionManagerEx_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ActionManagerEx_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_ActionManagerEx_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ActionManager\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ActionManagerEx> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ActionManagerEx_class;\n\t\tp->proto = jsb_cocostudio_ActionManagerEx_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_BaseData_class;\nJSObject *jsb_cocostudio_BaseData_prototype;\n\nJSBool js_cocos2dx_studio_BaseData_getColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::BaseData* cobj = (cocostudio::BaseData *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_BaseData_getColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Color4B ret = cobj->getColor();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = cccolor4b_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_BaseData_getColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_BaseData_setColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::BaseData* cobj = (cocostudio::BaseData *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_BaseData_setColor : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Color4B arg0;\n\t\tok &= jsval_to_cccolor4b(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_BaseData_setColor : Error processing arguments\");\n\t\tcobj->setColor(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_BaseData_setColor : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_BaseData_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::BaseData* ret = cocostudio::BaseData::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::BaseData>(cx, (cocostudio::BaseData*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_BaseData_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_BaseData_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::BaseData* cobj = new cocostudio::BaseData();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::BaseData> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::BaseData\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_BaseData_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_BaseData_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (BaseData)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_BaseData(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_BaseData_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_BaseData_class->name = \"BaseData\";\n\tjsb_cocostudio_BaseData_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_BaseData_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_BaseData_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_BaseData_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_BaseData_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_BaseData_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_BaseData_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_BaseData_class->finalize = js_cocostudio_BaseData_finalize;\n\tjsb_cocostudio_BaseData_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getColor\", js_cocos2dx_studio_BaseData_getColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setColor\", js_cocos2dx_studio_BaseData_setColor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_BaseData_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_BaseData_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_BaseData_class,\n\t\tjs_cocos2dx_studio_BaseData_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"BaseData\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::BaseData> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_BaseData_class;\n\t\tp->proto = jsb_cocostudio_BaseData_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_Tween_class;\nJSObject *jsb_cocostudio_Tween_prototype;\n\nJSBool js_cocos2dx_studio_Tween_getAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Tween* cobj = (cocostudio::Tween *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_getAnimation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::ArmatureAnimation* ret = cobj->getAnimation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ArmatureAnimation>(cx, (cocostudio::ArmatureAnimation*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_getAnimation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Tween_gotoAndPause(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Tween* cobj = (cocostudio::Tween *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_gotoAndPause : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_gotoAndPause : Error processing arguments\");\n\t\tcobj->gotoAndPause(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_gotoAndPause : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Tween_play(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Tween* cobj = (cocostudio::Tween *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_play : Invalid Native Object\");\n\tif (argc == 5) {\n\t\tcocostudio::MovementBoneData* arg0;\n\t\tint arg1;\n\t\tint arg2;\n\t\tint arg3;\n\t\tint arg4;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::MovementBoneData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n\t\tok &= jsval_to_int32(cx, argv[4], (int32_t *)&arg4);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_play : Error processing arguments\");\n\t\tcobj->play(arg0, arg1, arg2, arg3, arg4);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_play : wrong number of arguments: %d, was expecting %d\", argc, 5);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Tween_gotoAndPlay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Tween* cobj = (cocostudio::Tween *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_gotoAndPlay : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_gotoAndPlay : Error processing arguments\");\n\t\tcobj->gotoAndPlay(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_gotoAndPlay : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Tween_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Tween* cobj = (cocostudio::Tween *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_init : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_init : Error processing arguments\");\n\t\tJSBool ret = cobj->init(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_init : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Tween_setAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Tween* cobj = (cocostudio::Tween *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_setAnimation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::ArmatureAnimation* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::ArmatureAnimation*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_setAnimation : Error processing arguments\");\n\t\tcobj->setAnimation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_setAnimation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Tween_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Tween_create : Error processing arguments\");\n\t\tcocostudio::Tween* ret = cocostudio::Tween::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Tween>(cx, (cocostudio::Tween*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_Tween_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::Tween* cobj = new cocostudio::Tween();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::Tween> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::Tween\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Tween_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_Tween_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Tween)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_Tween(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_Tween_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_Tween_class->name = \"Tween\";\n\tjsb_cocostudio_Tween_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_Tween_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_Tween_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_Tween_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_Tween_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_Tween_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_Tween_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_Tween_class->finalize = js_cocostudio_Tween_finalize;\n\tjsb_cocostudio_Tween_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnimation\", js_cocos2dx_studio_Tween_getAnimation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"gotoAndPause\", js_cocos2dx_studio_Tween_gotoAndPause, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"play\", js_cocos2dx_studio_Tween_play, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"gotoAndPlay\", js_cocos2dx_studio_Tween_gotoAndPlay, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_studio_Tween_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimation\", js_cocos2dx_studio_Tween_setAnimation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_Tween_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_Tween_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_Tween_class,\n\t\tjs_cocos2dx_studio_Tween_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Tween\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::Tween> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_Tween_class;\n\t\tp->proto = jsb_cocostudio_Tween_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ColliderFilter_class;\nJSObject *jsb_cocostudio_ColliderFilter_prototype;\n\n\n\nvoid js_cocostudio_ColliderFilter_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ColliderFilter)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ColliderFilter(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ColliderFilter_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ColliderFilter_class->name = \"ColliderFilter\";\n\tjsb_cocostudio_ColliderFilter_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ColliderFilter_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ColliderFilter_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ColliderFilter_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ColliderFilter_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ColliderFilter_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ColliderFilter_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ColliderFilter_class->finalize = js_cocostudio_ColliderFilter_finalize;\n\tjsb_cocostudio_ColliderFilter_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocostudio_ColliderFilter_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_ColliderFilter_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ColliderFilter\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ColliderFilter> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ColliderFilter_class;\n\t\tp->proto = jsb_cocostudio_ColliderFilter_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ColliderBody_class;\nJSObject *jsb_cocostudio_ColliderBody_prototype;\n\n\n\nvoid js_cocostudio_ColliderBody_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ColliderBody)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ColliderBody(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ColliderBody_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ColliderBody_class->name = \"ColliderBody\";\n\tjsb_cocostudio_ColliderBody_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ColliderBody_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ColliderBody_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ColliderBody_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ColliderBody_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ColliderBody_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ColliderBody_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ColliderBody_class->finalize = js_cocostudio_ColliderBody_finalize;\n\tjsb_cocostudio_ColliderBody_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocostudio_ColliderBody_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_ColliderBody_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ColliderBody\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ColliderBody> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ColliderBody_class;\n\t\tp->proto = jsb_cocostudio_ColliderBody_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ColliderDetector_class;\nJSObject *jsb_cocostudio_ColliderDetector_prototype;\n\nJSBool js_cocos2dx_studio_ColliderDetector_getBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ColliderDetector* cobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_getBone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::Bone* ret = cobj->getBone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_getBone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_getActive(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ColliderDetector* cobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_getActive : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getActive();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_getActive : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_getColliderBodyList(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ColliderDetector* cobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_getColliderBodyList : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Vector<cocostudio::ColliderBody *>& ret = cobj->getColliderBodyList();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_getColliderBodyList : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_updateTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ColliderDetector* cobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_updateTransform : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tkmMat4 arg0;\n\t\t#pragma warning NO CONVERSION TO NATIVE FOR kmMat4;\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_updateTransform : Error processing arguments\");\n\t\tcobj->updateTransform(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_updateTransform : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_removeAll(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ColliderDetector* cobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_removeAll : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->removeAll();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_removeAll : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::ColliderDetector* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_init : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocostudio::Bone* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->init(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tJSBool ret = cobj->init();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_init : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_setActive(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ColliderDetector* cobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_setActive : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_setActive : Error processing arguments\");\n\t\tcobj->setActive(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_setActive : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_setBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ColliderDetector* cobj = (cocostudio::ColliderDetector *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_setBone : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ColliderDetector_setBone : Error processing arguments\");\n\t\tcobj->setBone(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_setBone : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ColliderDetector_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocostudio::Bone* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::ColliderDetector* ret = cocostudio::ColliderDetector::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ColliderDetector>(cx, (cocostudio::ColliderDetector*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocostudio::ColliderDetector* ret = cocostudio::ColliderDetector::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ColliderDetector>(cx, (cocostudio::ColliderDetector*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ColliderDetector_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocostudio_ColliderDetector_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ColliderDetector)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ColliderDetector(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ColliderDetector_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ColliderDetector_class->name = \"ColliderDetector\";\n\tjsb_cocostudio_ColliderDetector_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ColliderDetector_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ColliderDetector_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ColliderDetector_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ColliderDetector_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ColliderDetector_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ColliderDetector_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ColliderDetector_class->finalize = js_cocostudio_ColliderDetector_finalize;\n\tjsb_cocostudio_ColliderDetector_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getBone\", js_cocos2dx_studio_ColliderDetector_getBone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getActive\", js_cocos2dx_studio_ColliderDetector_getActive, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getColliderBodyList\", js_cocos2dx_studio_ColliderDetector_getColliderBodyList, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateTransform\", js_cocos2dx_studio_ColliderDetector_updateTransform, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAll\", js_cocos2dx_studio_ColliderDetector_removeAll, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_studio_ColliderDetector_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setActive\", js_cocos2dx_studio_ColliderDetector_setActive, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBone\", js_cocos2dx_studio_ColliderDetector_setBone, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_ColliderDetector_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ColliderDetector_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_ColliderDetector_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ColliderDetector\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ColliderDetector> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ColliderDetector_class;\n\t\tp->proto = jsb_cocostudio_ColliderDetector_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_DisplayManager_class;\nJSObject *jsb_cocostudio_DisplayManager_prototype;\n\nJSBool js_cocos2dx_studio_DisplayManager_getDisplayRenderNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getDisplayRenderNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getDisplayRenderNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getDisplayRenderNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_getAnchorPointInPoints(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getAnchorPointInPoints : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getAnchorPointInPoints();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getAnchorPointInPoints : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getDisplayRenderNodeType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_removeDisplay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_removeDisplay : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_removeDisplay : Error processing arguments\");\n\t\tcobj->removeDisplay(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_removeDisplay : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_setForceChangeDisplay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_setForceChangeDisplay : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_setForceChangeDisplay : Error processing arguments\");\n\t\tcobj->setForceChangeDisplay(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_setForceChangeDisplay : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_init : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_init : Error processing arguments\");\n\t\tJSBool ret = cobj->init(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_init : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_getContentSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getContentSize : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Size ret = cobj->getContentSize();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccsize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getContentSize : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_getBoundingBox(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getBoundingBox : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Rect ret = cobj->getBoundingBox();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccrect_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getBoundingBox : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_addDisplay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::DisplayManager* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_addDisplay : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addDisplay(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocostudio::DisplayData* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocostudio::DisplayData*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addDisplay(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_addDisplay : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_containPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::DisplayManager* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_containPoint : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tdouble arg0;\n\t\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tdouble arg1;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->containPoint(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tcocos2d::Point arg0;\n\t\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->containPoint(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_containPoint : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_changeDisplayWithIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_changeDisplayWithIndex : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_changeDisplayWithIndex : Error processing arguments\");\n\t\tcobj->changeDisplayWithIndex(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_changeDisplayWithIndex : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_changeDisplayWithName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_changeDisplayWithName : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_changeDisplayWithName : Error processing arguments\");\n\t\tcobj->changeDisplayWithName(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_changeDisplayWithName : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_isForceChangeDisplay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_isForceChangeDisplay : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isForceChangeDisplay();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_isForceChangeDisplay : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getCurrentDisplayIndex();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_getAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getAnchorPoint : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Point ret = cobj->getAnchorPoint();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getAnchorPoint : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_getDecorativeDisplayList(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_getDecorativeDisplayList : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Vector<cocostudio::DecorativeDisplay *>& ret = cobj->getDecorativeDisplayList();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccvector_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_getDecorativeDisplayList : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_isVisible(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_isVisible : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isVisible();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_isVisible : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_setVisible(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::DisplayManager* cobj = (cocostudio::DisplayManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_setVisible : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_setVisible : Error processing arguments\");\n\t\tcobj->setVisible(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_setVisible : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_DisplayManager_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_DisplayManager_create : Error processing arguments\");\n\t\tcocostudio::DisplayManager* ret = cocostudio::DisplayManager::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::DisplayManager>(cx, (cocostudio::DisplayManager*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_DisplayManager_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::DisplayManager* cobj = new cocostudio::DisplayManager();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::DisplayManager> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::DisplayManager\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_DisplayManager_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_DisplayManager_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (DisplayManager)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_DisplayManager(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_DisplayManager_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_DisplayManager_class->name = \"DisplayManager\";\n\tjsb_cocostudio_DisplayManager_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_DisplayManager_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_DisplayManager_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_DisplayManager_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_DisplayManager_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_DisplayManager_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_DisplayManager_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_DisplayManager_class->finalize = js_cocostudio_DisplayManager_finalize;\n\tjsb_cocostudio_DisplayManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getDisplayRenderNode\", js_cocos2dx_studio_DisplayManager_getDisplayRenderNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchorPointInPoints\", js_cocos2dx_studio_DisplayManager_getAnchorPointInPoints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisplayRenderNodeType\", js_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeDisplay\", js_cocos2dx_studio_DisplayManager_removeDisplay, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setForceChangeDisplay\", js_cocos2dx_studio_DisplayManager_setForceChangeDisplay, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_studio_DisplayManager_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getContentSize\", js_cocos2dx_studio_DisplayManager_getContentSize, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBoundingBox\", js_cocos2dx_studio_DisplayManager_getBoundingBox, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDisplay\", js_cocos2dx_studio_DisplayManager_addDisplay, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"containPoint\", js_cocos2dx_studio_DisplayManager_containPoint, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"changeDisplayWithIndex\", js_cocos2dx_studio_DisplayManager_changeDisplayWithIndex, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"changeDisplayWithName\", js_cocos2dx_studio_DisplayManager_changeDisplayWithName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isForceChangeDisplay\", js_cocos2dx_studio_DisplayManager_isForceChangeDisplay, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentDisplayIndex\", js_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchorPoint\", js_cocos2dx_studio_DisplayManager_getAnchorPoint, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDecorativeDisplayList\", js_cocos2dx_studio_DisplayManager_getDecorativeDisplayList, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isVisible\", js_cocos2dx_studio_DisplayManager_isVisible, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVisible\", js_cocos2dx_studio_DisplayManager_setVisible, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_DisplayManager_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_DisplayManager_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_DisplayManager_class,\n\t\tjs_cocos2dx_studio_DisplayManager_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"DisplayManager\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::DisplayManager> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_DisplayManager_class;\n\t\tp->proto = jsb_cocostudio_DisplayManager_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_Bone_class;\nJSObject *jsb_cocostudio_Bone_prototype;\n\nJSBool js_cocos2dx_studio_Bone_isTransformDirty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_isTransformDirty : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTransformDirty();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_isTransformDirty : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_isIgnoreMovementBoneData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_isIgnoreMovementBoneData : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isIgnoreMovementBoneData();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_isIgnoreMovementBoneData : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_updateZOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_updateZOrder : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateZOrder();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_updateZOrder : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getDisplayRenderNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getDisplayRenderNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getDisplayRenderNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getDisplayRenderNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_isBlendDirty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_isBlendDirty : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBlendDirty();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_isBlendDirty : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_addChildBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_addChildBone : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_addChildBone : Error processing arguments\");\n\t\tcobj->addChildBone(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_addChildBone : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getWorldInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getWorldInfo : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::BaseData* ret = cobj->getWorldInfo();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::BaseData>(cx, (cocostudio::BaseData*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getWorldInfo : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getTween(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getTween : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::Tween* ret = cobj->getTween();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Tween>(cx, (cocostudio::Tween*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getTween : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getParentBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getParentBone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::Bone* ret = cobj->getParentBone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getParentBone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_updateColor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_updateColor : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateColor();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_updateColor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string ret = cobj->getName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setTransformDirty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setTransformDirty : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setTransformDirty : Error processing arguments\");\n\t\tcobj->setTransformDirty(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setTransformDirty : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getDisplayRenderNodeType(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getDisplayRenderNodeType : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getDisplayRenderNodeType();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getDisplayRenderNodeType : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_removeDisplay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_removeDisplay : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_removeDisplay : Error processing arguments\");\n\t\tcobj->removeDisplay(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_removeDisplay : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setBoneData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setBoneData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::BoneData* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::BoneData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setBoneData : Error processing arguments\");\n\t\tcobj->setBoneData(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setBoneData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::Bone* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_init : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->init(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tJSBool ret = cobj->init();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_init : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setParentBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setParentBone : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setParentBone : Error processing arguments\");\n\t\tcobj->setParentBone(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setParentBone : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_addDisplay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::Bone* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_addDisplay : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addDisplay(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocostudio::DisplayData* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocostudio::DisplayData*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tint arg1;\n\t\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addDisplay(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_addDisplay : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setIgnoreMovementBoneData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setIgnoreMovementBoneData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setIgnoreMovementBoneData : Error processing arguments\");\n\t\tcobj->setIgnoreMovementBoneData(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setIgnoreMovementBoneData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setName : Error processing arguments\");\n\t\tcobj->setName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_removeFromParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_removeFromParent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_removeFromParent : Error processing arguments\");\n\t\tcobj->removeFromParent(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_removeFromParent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getColliderDetector(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getColliderDetector : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::ColliderDetector* ret = cobj->getColliderDetector();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ColliderDetector>(cx, (cocostudio::ColliderDetector*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getColliderDetector : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getChildArmature(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getChildArmature : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::Armature* ret = cobj->getChildArmature();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Armature>(cx, (cocostudio::Armature*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getChildArmature : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_changeDisplayWithIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_changeDisplayWithIndex : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_changeDisplayWithIndex : Error processing arguments\");\n\t\tcobj->changeDisplayWithIndex(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_changeDisplayWithIndex : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_changeDisplayWithName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_changeDisplayWithName : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_changeDisplayWithName : Error processing arguments\");\n\t\tcobj->changeDisplayWithName(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_changeDisplayWithName : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setArmature(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setArmature : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Armature* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Armature*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setArmature : Error processing arguments\");\n\t\tcobj->setArmature(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setArmature : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setBlendDirty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setBlendDirty : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setBlendDirty : Error processing arguments\");\n\t\tcobj->setBlendDirty(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setBlendDirty : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_removeChildBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_removeChildBone : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocostudio::Bone* arg0;\n\t\tJSBool arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_removeChildBone : Error processing arguments\");\n\t\tcobj->removeChildBone(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_removeChildBone : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_setChildArmature(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setChildArmature : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Armature* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Armature*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_setChildArmature : Error processing arguments\");\n\t\tcobj->setChildArmature(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_setChildArmature : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getNodeToArmatureTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getNodeToArmatureTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tkmMat4 ret = cobj->getNodeToArmatureTransform();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getNodeToArmatureTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getDisplayManager(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getDisplayManager : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::DisplayManager* ret = cobj->getDisplayManager();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::DisplayManager>(cx, (cocostudio::DisplayManager*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getDisplayManager : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_getArmature(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Bone* cobj = (cocostudio::Bone *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Bone_getArmature : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::Armature* ret = cobj->getArmature();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Armature>(cx, (cocostudio::Armature*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_getArmature : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::Bone* ret = cocostudio::Bone::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocostudio::Bone* ret = cocostudio::Bone::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Bone_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::Bone* cobj = new cocostudio::Bone();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::Bone> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::Bone\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Bone_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocostudio_Bone_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Bone)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_Bone(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_Bone_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_Bone_class->name = \"Bone\";\n\tjsb_cocostudio_Bone_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_Bone_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_Bone_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_Bone_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_Bone_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_Bone_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_Bone_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_Bone_class->finalize = js_cocostudio_Bone_finalize;\n\tjsb_cocostudio_Bone_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"isTransformDirty\", js_cocos2dx_studio_Bone_isTransformDirty, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isIgnoreMovementBoneData\", js_cocos2dx_studio_Bone_isIgnoreMovementBoneData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateZOrder\", js_cocos2dx_studio_Bone_updateZOrder, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisplayRenderNode\", js_cocos2dx_studio_Bone_getDisplayRenderNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isBlendDirty\", js_cocos2dx_studio_Bone_isBlendDirty, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addChildBone\", js_cocos2dx_studio_Bone_addChildBone, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getWorldInfo\", js_cocos2dx_studio_Bone_getWorldInfo, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTween\", js_cocos2dx_studio_Bone_getTween, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParentBone\", js_cocos2dx_studio_Bone_getParentBone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateColor\", js_cocos2dx_studio_Bone_updateColor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getName\", js_cocos2dx_studio_Bone_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTransformDirty\", js_cocos2dx_studio_Bone_setTransformDirty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisplayRenderNodeType\", js_cocos2dx_studio_Bone_getDisplayRenderNodeType, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeDisplay\", js_cocos2dx_studio_Bone_removeDisplay, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBoneData\", js_cocos2dx_studio_Bone_setBoneData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_studio_Bone_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setParentBone\", js_cocos2dx_studio_Bone_setParentBone, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addDisplay\", js_cocos2dx_studio_Bone_addDisplay, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setIgnoreMovementBoneData\", js_cocos2dx_studio_Bone_setIgnoreMovementBoneData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setName\", js_cocos2dx_studio_Bone_setName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeFromParent\", js_cocos2dx_studio_Bone_removeFromParent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getColliderDetector\", js_cocos2dx_studio_Bone_getColliderDetector, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getChildArmature\", js_cocos2dx_studio_Bone_getChildArmature, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"changeDisplayWithIndex\", js_cocos2dx_studio_Bone_changeDisplayWithIndex, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"changeDisplayWithName\", js_cocos2dx_studio_Bone_changeDisplayWithName, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setArmature\", js_cocos2dx_studio_Bone_setArmature, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBlendDirty\", js_cocos2dx_studio_Bone_setBlendDirty, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeChildBone\", js_cocos2dx_studio_Bone_removeChildBone, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setChildArmature\", js_cocos2dx_studio_Bone_setChildArmature, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeToArmatureTransform\", js_cocos2dx_studio_Bone_getNodeToArmatureTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisplayManager\", js_cocos2dx_studio_Bone_getDisplayManager, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getArmature\", js_cocos2dx_studio_Bone_getArmature, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_Bone_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_Bone_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocostudio_Bone_class,\n\t\tjs_cocos2dx_studio_Bone_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Bone\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::Bone> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_Bone_class;\n\t\tp->proto = jsb_cocostudio_Bone_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_BatchNode_class;\nJSObject *jsb_cocostudio_BatchNode_prototype;\n\nJSBool js_cocos2dx_studio_BatchNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::BatchNode* ret = cocostudio::BatchNode::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::BatchNode>(cx, (cocostudio::BatchNode*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_BatchNode_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocostudio_BatchNode_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (BatchNode)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_BatchNode(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_BatchNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_BatchNode_class->name = \"BatchNode\";\n\tjsb_cocostudio_BatchNode_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_BatchNode_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_BatchNode_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_BatchNode_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_BatchNode_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_BatchNode_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_BatchNode_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_BatchNode_class->finalize = js_cocostudio_BatchNode_finalize;\n\tjsb_cocostudio_BatchNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_BatchNode_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_BatchNode_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocostudio_BatchNode_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"BatchNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::BatchNode> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_BatchNode_class;\n\t\tp->proto = jsb_cocostudio_BatchNode_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ArmatureAnimation_class;\nJSObject *jsb_cocostudio_ArmatureAnimation_prototype;\n\nJSBool js_cocos2dx_studio_ArmatureAnimation_getSpeedScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_getSpeedScale : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getSpeedScale();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_getSpeedScale : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_pause(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_pause : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pause();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_pause : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_setSpeedScale(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_setSpeedScale : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_setSpeedScale : Error processing arguments\");\n\t\tcobj->setSpeedScale(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_setSpeedScale : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_init : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Armature* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Armature*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_init : Error processing arguments\");\n\t\tJSBool ret = cobj->init(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_init : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_playWithIndexes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndexes : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::vector<int> arg0;\n\t\tok &= jsval_to_std_vector_int(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndexes : Error processing arguments\");\n\t\tcobj->playWithIndexes(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::vector<int> arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_std_vector_int(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndexes : Error processing arguments\");\n\t\tcobj->playWithIndexes(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::vector<int> arg0;\n\t\tint arg1;\n\t\tJSBool arg2;\n\t\tok &= jsval_to_std_vector_int(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndexes : Error processing arguments\");\n\t\tcobj->playWithIndexes(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndexes : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_play(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_play : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_play : Error processing arguments\");\n\t\tcobj->play(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_play : Error processing arguments\");\n\t\tcobj->play(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::string arg0;\n\t\tint arg1;\n\t\tint arg2;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_play : Error processing arguments\");\n\t\tcobj->play(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_play : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_gotoAndPause(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_gotoAndPause : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_gotoAndPause : Error processing arguments\");\n\t\tcobj->gotoAndPause(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_gotoAndPause : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_resume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_resume : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resume();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_resume : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_stop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_stop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stop();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_stop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_update(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_update : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_update : Error processing arguments\");\n\t\tcobj->update(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_update : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_playWithIndex(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndex : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndex : Error processing arguments\");\n\t\tcobj->playWithIndex(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tint arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndex : Error processing arguments\");\n\t\tcobj->playWithIndex(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tint arg0;\n\t\tint arg1;\n\t\tint arg2;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndex : Error processing arguments\");\n\t\tcobj->playWithIndex(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_playWithIndex : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getCurrentMovementID();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_gotoAndPlay(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_gotoAndPlay : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_gotoAndPlay : Error processing arguments\");\n\t\tcobj->gotoAndPlay(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_gotoAndPlay : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_playWithNames(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithNames : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::vector<std::string> arg0;\n\t\tok &= jsval_to_std_vector_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithNames : Error processing arguments\");\n\t\tcobj->playWithNames(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::vector<std::string> arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_std_vector_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithNames : Error processing arguments\");\n\t\tcobj->playWithNames(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::vector<std::string> arg0;\n\t\tint arg1;\n\t\tJSBool arg2;\n\t\tok &= jsval_to_std_vector_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tok &= JS_ValueToBoolean(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_playWithNames : Error processing arguments\");\n\t\tcobj->playWithNames(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_playWithNames : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_getMovementCount(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_getMovementCount : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tssize_t ret = cobj->getMovementCount();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ssize_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_getMovementCount : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureAnimation_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocostudio::Armature* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Armature*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureAnimation_create : Error processing arguments\");\n\t\tcocostudio::ArmatureAnimation* ret = cocostudio::ArmatureAnimation::create(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ArmatureAnimation>(cx, (cocostudio::ArmatureAnimation*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ArmatureAnimation_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ArmatureAnimation* cobj = new cocostudio::ArmatureAnimation();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::ArmatureAnimation> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::ArmatureAnimation\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureAnimation_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_ArmatureAnimation_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ArmatureAnimation)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ArmatureAnimation(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ArmatureAnimation_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ArmatureAnimation_class->name = \"ArmatureAnimation\";\n\tjsb_cocostudio_ArmatureAnimation_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ArmatureAnimation_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ArmatureAnimation_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ArmatureAnimation_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ArmatureAnimation_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ArmatureAnimation_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ArmatureAnimation_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ArmatureAnimation_class->finalize = js_cocostudio_ArmatureAnimation_finalize;\n\tjsb_cocostudio_ArmatureAnimation_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getSpeedScale\", js_cocos2dx_studio_ArmatureAnimation_getSpeedScale, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pause\", js_cocos2dx_studio_ArmatureAnimation_pause, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSpeedScale\", js_cocos2dx_studio_ArmatureAnimation_setSpeedScale, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_studio_ArmatureAnimation_init, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"playWithIndexes\", js_cocos2dx_studio_ArmatureAnimation_playWithIndexes, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"play\", js_cocos2dx_studio_ArmatureAnimation_play, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"gotoAndPause\", js_cocos2dx_studio_ArmatureAnimation_gotoAndPause, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resume\", js_cocos2dx_studio_ArmatureAnimation_resume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stop\", js_cocos2dx_studio_ArmatureAnimation_stop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", js_cocos2dx_studio_ArmatureAnimation_update, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"playWithIndex\", js_cocos2dx_studio_ArmatureAnimation_playWithIndex, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentMovementID\", js_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"gotoAndPlay\", js_cocos2dx_studio_ArmatureAnimation_gotoAndPlay, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"playWithNames\", js_cocos2dx_studio_ArmatureAnimation_playWithNames, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMovementCount\", js_cocos2dx_studio_ArmatureAnimation_getMovementCount, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_ArmatureAnimation_create, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ArmatureAnimation_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_ArmatureAnimation_class,\n\t\tjs_cocos2dx_studio_ArmatureAnimation_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ArmatureAnimation\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ArmatureAnimation> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ArmatureAnimation_class;\n\t\tp->proto = jsb_cocostudio_ArmatureAnimation_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ArmatureDataManager_class;\nJSObject *jsb_cocostudio_ArmatureDataManager_prototype;\n\nJSBool js_cocos2dx_studio_ArmatureDataManager_getAnimationDatas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getAnimationDatas : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Map<std::string, cocostudio::AnimationData *>& ret = cobj->getAnimationDatas();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccmap_string_key_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_getAnimationDatas : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeAnimationData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeAnimationData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeAnimationData : Error processing arguments\");\n\t\tcobj->removeAnimationData(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_removeAnimationData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_addArmatureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addArmatureData : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocostudio::ArmatureData* arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocostudio::ArmatureData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addArmatureData : Error processing arguments\");\n\t\tcobj->addArmatureData(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::string arg0;\n\t\tcocostudio::ArmatureData* arg1;\n\t\tstd::string arg2;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocostudio::ArmatureData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addArmatureData : Error processing arguments\");\n\t\tcobj->addArmatureData(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_addArmatureData : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::ArmatureDataManager* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 3) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg1;\n\t\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tstd::string arg2;\n\t\t\tok &= jsval_to_std_string(cx, argv[2], &arg2);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addArmatureFileInfo(arg0, arg1, arg2);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->addArmatureFileInfo(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo : Error processing arguments\");\n\t\tcobj->removeArmatureFileInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_getTextureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getTextureData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getTextureData : Error processing arguments\");\n\t\tcocostudio::TextureData* ret = cobj->getTextureData(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::TextureData>(cx, (cocostudio::TextureData*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_getTextureData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_getArmatureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getArmatureData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getArmatureData : Error processing arguments\");\n\t\tcocostudio::ArmatureData* ret = cobj->getArmatureData(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ArmatureData>(cx, (cocostudio::ArmatureData*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_getArmatureData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_getAnimationData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getAnimationData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getAnimationData : Error processing arguments\");\n\t\tcocostudio::AnimationData* ret = cobj->getAnimationData(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::AnimationData>(cx, (cocostudio::AnimationData*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_getAnimationData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_addAnimationData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addAnimationData : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocostudio::AnimationData* arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocostudio::AnimationData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addAnimationData : Error processing arguments\");\n\t\tcobj->addAnimationData(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::string arg0;\n\t\tcocostudio::AnimationData* arg1;\n\t\tstd::string arg2;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocostudio::AnimationData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addAnimationData : Error processing arguments\");\n\t\tcobj->addAnimationData(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_addAnimationData : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_init : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->init();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_init : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeArmatureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeArmatureData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeArmatureData : Error processing arguments\");\n\t\tcobj->removeArmatureData(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_removeArmatureData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_getArmatureDatas(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_getArmatureDatas : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Map<std::string, cocostudio::ArmatureData *>& ret = cobj->getArmatureDatas();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccmap_string_key_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_getArmatureDatas : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeTextureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeTextureData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_removeTextureData : Error processing arguments\");\n\t\tcobj->removeTextureData(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_removeTextureData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_addTextureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addTextureData : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tcocostudio::TextureData* arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocostudio::TextureData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addTextureData : Error processing arguments\");\n\t\tcobj->addTextureData(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::string arg0;\n\t\tcocostudio::TextureData* arg1;\n\t\tstd::string arg2;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tdo {\n\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocostudio::TextureData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addTextureData : Error processing arguments\");\n\t\tcobj->addTextureData(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_addTextureData : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isAutoLoadSpriteFile();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile : Error processing arguments\");\n\t\tcobj->addSpriteFrameFromFile(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tstd::string arg2;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tok &= jsval_to_std_string(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile : Error processing arguments\");\n\t\tcobj->addSpriteFrameFromFile(arg0, arg1, arg2);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ArmatureDataManager_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ArmatureDataManager::destroyInstance();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_destroyInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ArmatureDataManager_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ArmatureDataManager* ret = cocostudio::ArmatureDataManager::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ArmatureDataManager>(cx, (cocostudio::ArmatureDataManager*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ArmatureDataManager_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_ArmatureDataManager_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ArmatureDataManager)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ArmatureDataManager(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ArmatureDataManager_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ArmatureDataManager_class->name = \"ArmatureDataManager\";\n\tjsb_cocostudio_ArmatureDataManager_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ArmatureDataManager_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ArmatureDataManager_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ArmatureDataManager_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ArmatureDataManager_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ArmatureDataManager_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ArmatureDataManager_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ArmatureDataManager_class->finalize = js_cocostudio_ArmatureDataManager_finalize;\n\tjsb_cocostudio_ArmatureDataManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnimationDatas\", js_cocos2dx_studio_ArmatureDataManager_getAnimationDatas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeAnimationData\", js_cocos2dx_studio_ArmatureDataManager_removeAnimationData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addArmatureData\", js_cocos2dx_studio_ArmatureDataManager_addArmatureData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addArmatureFileInfo\", js_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeArmatureFileInfo\", js_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTextureData\", js_cocos2dx_studio_ArmatureDataManager_getTextureData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getArmatureData\", js_cocos2dx_studio_ArmatureDataManager_getArmatureData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnimationData\", js_cocos2dx_studio_ArmatureDataManager_getAnimationData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addAnimationData\", js_cocos2dx_studio_ArmatureDataManager_addAnimationData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_studio_ArmatureDataManager_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeArmatureData\", js_cocos2dx_studio_ArmatureDataManager_removeArmatureData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getArmatureDatas\", js_cocos2dx_studio_ArmatureDataManager_getArmatureDatas, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeTextureData\", js_cocos2dx_studio_ArmatureDataManager_removeTextureData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addTextureData\", js_cocos2dx_studio_ArmatureDataManager_addTextureData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isAutoLoadSpriteFile\", js_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addSpriteFrameFromFile\", js_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"destroyInstance\", js_cocos2dx_studio_ArmatureDataManager_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_studio_ArmatureDataManager_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ArmatureDataManager_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_ArmatureDataManager_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ArmatureDataManager\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ArmatureDataManager> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ArmatureDataManager_class;\n\t\tp->proto = jsb_cocostudio_ArmatureDataManager_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_Armature_class;\nJSObject *jsb_cocostudio_Armature_prototype;\n\nJSBool js_cocos2dx_studio_Armature_getBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getBone : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getBone : Error processing arguments\");\n\t\tcocostudio::Bone* ret = cobj->getBone(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getBone : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_changeBoneParent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_changeBoneParent : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocostudio::Bone* arg0;\n\t\tstd::string arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_changeBoneParent : Error processing arguments\");\n\t\tcobj->changeBoneParent(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_changeBoneParent : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_setAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setAnimation : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::ArmatureAnimation* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::ArmatureAnimation*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setAnimation : Error processing arguments\");\n\t\tcobj->setAnimation(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_setAnimation : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getBoneAtPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getBoneAtPoint : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tdouble arg0;\n\t\tdouble arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getBoneAtPoint : Error processing arguments\");\n\t\tcocostudio::Bone* ret = cobj->getBoneAtPoint(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getBoneAtPoint : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getArmatureTransformDirty(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getArmatureTransformDirty : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->getArmatureTransformDirty();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getArmatureTransformDirty : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_setVersion(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setVersion : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setVersion : Error processing arguments\");\n\t\tcobj->setVersion(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_setVersion : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_updateOffsetPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_updateOffsetPoint : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateOffsetPoint();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_updateOffsetPoint : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getParentBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getParentBone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::Bone* ret = cobj->getParentBone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getParentBone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_setArmatureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setArmatureData : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::ArmatureData* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::ArmatureData*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setArmatureData : Error processing arguments\");\n\t\tcobj->setArmatureData(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_setArmatureData : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_removeBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_removeBone : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocostudio::Bone* arg0;\n\t\tJSBool arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_removeBone : Error processing arguments\");\n\t\tcobj->removeBone(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_removeBone : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getBatchNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::BatchNode* ret = cobj->getBatchNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::BatchNode>(cx, (cocostudio::BatchNode*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getBatchNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_init(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::Armature* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_init : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->init(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tJSBool ret = cobj->init();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::Bone* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool ret = cobj->init(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_init : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_setParentBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setParentBone : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setParentBone : Error processing arguments\");\n\t\tcobj->setParentBone(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_setParentBone : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_drawContour(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_drawContour : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->drawContour();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_drawContour : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_setBatchNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setBatchNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::BatchNode* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::BatchNode*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setBatchNode : Error processing arguments\");\n\t\tcobj->setBatchNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_setBatchNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_setName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_setName : Error processing arguments\");\n\t\tcobj->setName(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_setName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_addBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_addBone : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocostudio::Bone* arg0;\n\t\tstd::string arg1;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_addBone : Error processing arguments\");\n\t\tcobj->addBone(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_addBone : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getArmatureData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getArmatureData : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::ArmatureData* ret = cobj->getArmatureData();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ArmatureData>(cx, (cocostudio::ArmatureData*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getArmatureData : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getVersion(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getVersion : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getVersion();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getVersion : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getAnimation(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getAnimation : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::ArmatureAnimation* ret = cobj->getAnimation();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ArmatureAnimation>(cx, (cocostudio::ArmatureAnimation*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getAnimation : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_getBoneDic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Armature* cobj = (cocostudio::Armature *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Armature_getBoneDic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst cocos2d::Map<std::string, cocostudio::Bone *>& ret = cobj->getBoneDic();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = ccmap_string_key_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_getBoneDic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::Armature* ret = cocostudio::Armature::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Armature>(cx, (cocostudio::Armature*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocostudio::Armature* ret = cocostudio::Armature::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Armature>(cx, (cocostudio::Armature*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::Bone* arg1;\n\t\t\tdo {\n\t\t\t\tif (!argv[1].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ1 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg1, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::Armature* ret = cocostudio::Armature::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Armature>(cx, (cocostudio::Armature*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Armature_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::Armature* cobj = new cocostudio::Armature();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::Armature> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::Armature\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Armature_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Node_prototype;\n\nvoid js_cocostudio_Armature_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Armature)\", obj);\n}\n\nstatic JSBool js_cocostudio_Armature_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocostudio::Armature *nobj = cocostudio::Armature::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::Armature\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_studio_Armature(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_Armature_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_Armature_class->name = \"Armature\";\n\tjsb_cocostudio_Armature_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_Armature_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_Armature_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_Armature_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_Armature_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_Armature_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_Armature_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_Armature_class->finalize = js_cocostudio_Armature_finalize;\n\tjsb_cocostudio_Armature_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getBone\", js_cocos2dx_studio_Armature_getBone, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"changeBoneParent\", js_cocos2dx_studio_Armature_changeBoneParent, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnimation\", js_cocos2dx_studio_Armature_setAnimation, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBoneAtPoint\", js_cocos2dx_studio_Armature_getBoneAtPoint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getArmatureTransformDirty\", js_cocos2dx_studio_Armature_getArmatureTransformDirty, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVersion\", js_cocos2dx_studio_Armature_setVersion, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateOffsetPoint\", js_cocos2dx_studio_Armature_updateOffsetPoint, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getParentBone\", js_cocos2dx_studio_Armature_getParentBone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setArmatureData\", js_cocos2dx_studio_Armature_setArmatureData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeBone\", js_cocos2dx_studio_Armature_removeBone, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBatchNode\", js_cocos2dx_studio_Armature_getBatchNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getName\", js_cocos2dx_studio_Armature_getName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", js_cocos2dx_studio_Armature_init, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setParentBone\", js_cocos2dx_studio_Armature_setParentBone, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"drawContour\", js_cocos2dx_studio_Armature_drawContour, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBatchNode\", js_cocos2dx_studio_Armature_setBatchNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setName\", js_cocos2dx_studio_Armature_setName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addBone\", js_cocos2dx_studio_Armature_addBone, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getArmatureData\", js_cocos2dx_studio_Armature_getArmatureData, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVersion\", js_cocos2dx_studio_Armature_getVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnimation\", js_cocos2dx_studio_Armature_getAnimation, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBoneDic\", js_cocos2dx_studio_Armature_getBoneDic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FN(\"ctor\", js_cocostudio_Armature_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_Armature_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_Armature_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Node_prototype,\n\t\tjsb_cocostudio_Armature_class,\n\t\tjs_cocos2dx_studio_Armature_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Armature\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::Armature> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_Armature_class;\n\t\tp->proto = jsb_cocostudio_Armature_prototype;\n\t\tp->parentProto = jsb_cocos2d_Node_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_Skin_class;\nJSObject *jsb_cocostudio_Skin_prototype;\n\nJSBool js_cocos2dx_studio_Skin_getBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Skin* cobj = (cocostudio::Skin *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_getBone : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocostudio::Bone* ret = cobj->getBone();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Bone>(cx, (cocostudio::Bone*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_getBone : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_getNodeToWorldTransformAR(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Skin* cobj = (cocostudio::Skin *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_getNodeToWorldTransformAR : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tkmMat4 ret = cobj->getNodeToWorldTransformAR();\n\t\tjsval jsret = JSVAL_NULL;\n\t\t#pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_getNodeToWorldTransformAR : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_initWithFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Skin* cobj = (cocostudio::Skin *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_initWithFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_initWithFile : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_initWithFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_getDisplayName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Skin* cobj = (cocostudio::Skin *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_getDisplayName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst std::string& ret = cobj->getDisplayName();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_getDisplayName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_updateArmatureTransform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Skin* cobj = (cocostudio::Skin *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_updateArmatureTransform : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->updateArmatureTransform();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_updateArmatureTransform : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_initWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Skin* cobj = (cocostudio::Skin *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_initWithSpriteFrameName : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_initWithSpriteFrameName : Error processing arguments\");\n\t\tJSBool ret = cobj->initWithSpriteFrameName(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_initWithSpriteFrameName : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_setBone(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::Skin* cobj = (cocostudio::Skin *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_setBone : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocostudio::Bone* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocostudio::Bone*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_setBone : Error processing arguments\");\n\t\tcobj->setBone(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_setBone : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tstd::string arg0;\n\t\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::Skin* ret = cocostudio::Skin::create(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Skin>(cx, (cocostudio::Skin*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocostudio::Skin* ret = cocostudio::Skin::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Skin>(cx, (cocostudio::Skin*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_Skin_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_Skin_createWithSpriteFrameName : Error processing arguments\");\n\t\tcocostudio::Skin* ret = cocostudio::Skin::createWithSpriteFrameName(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::Skin>(cx, (cocostudio::Skin*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_createWithSpriteFrameName : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_Skin_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::Skin* cobj = new cocostudio::Skin();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::Skin> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::Skin\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_Skin_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Sprite_prototype;\n\nvoid js_cocostudio_Skin_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (Skin)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_Skin(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_Skin_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_Skin_class->name = \"Skin\";\n\tjsb_cocostudio_Skin_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_Skin_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_Skin_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_Skin_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_Skin_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_Skin_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_Skin_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_Skin_class->finalize = js_cocostudio_Skin_finalize;\n\tjsb_cocostudio_Skin_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getBone\", js_cocos2dx_studio_Skin_getBone, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeToWorldTransformAR\", js_cocos2dx_studio_Skin_getNodeToWorldTransformAR, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithFile\", js_cocos2dx_studio_Skin_initWithFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDisplayName\", js_cocos2dx_studio_Skin_getDisplayName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateArmatureTransform\", js_cocos2dx_studio_Skin_updateArmatureTransform, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initWithSpriteFrameName\", js_cocos2dx_studio_Skin_initWithSpriteFrameName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBone\", js_cocos2dx_studio_Skin_setBone, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_Skin_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithSpriteFrameName\", js_cocos2dx_studio_Skin_createWithSpriteFrameName, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_Skin_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Sprite_prototype,\n\t\tjsb_cocostudio_Skin_class,\n\t\tjs_cocos2dx_studio_Skin_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"Skin\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::Skin> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_Skin_class;\n\t\tp->proto = jsb_cocostudio_Skin_prototype;\n\t\tp->parentProto = jsb_cocos2d_Sprite_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ComAttribute_class;\nJSObject *jsb_cocostudio_ComAttribute_prototype;\n\nJSBool js_cocos2dx_studio_ComAttribute_getFloat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getFloat : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getFloat : Error processing arguments\");\n\t\tdouble ret = cobj->getFloat(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getFloat : Error processing arguments\");\n\t\tdouble ret = cobj->getFloat(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_getFloat : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_getString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getString : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getString : Error processing arguments\");\n\t\tstd::string ret = cobj->getString(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getString : Error processing arguments\");\n\t\tstd::string ret = cobj->getString(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_getString : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_setFloat(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setFloat : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tdouble arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setFloat : Error processing arguments\");\n\t\tcobj->setFloat(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_setFloat : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_setString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setString : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tstd::string arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_std_string(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setString : Error processing arguments\");\n\t\tcobj->setString(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_setString : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_getBool(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getBool : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getBool : Error processing arguments\");\n\t\tJSBool ret = cobj->getBool(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getBool : Error processing arguments\");\n\t\tJSBool ret = cobj->getBool(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_getBool : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_setInt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setInt : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setInt : Error processing arguments\");\n\t\tcobj->setInt(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_setInt : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_parse(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_parse : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_parse : Error processing arguments\");\n\t\tJSBool ret = cobj->parse(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_parse : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_getInt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getInt : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getInt : Error processing arguments\");\n\t\tint ret = cobj->getInt(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tint arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_getInt : Error processing arguments\");\n\t\tint ret = cobj->getInt(arg0, arg1);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_getInt : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_setBool(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAttribute* cobj = (cocostudio::ComAttribute *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setBool : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tstd::string arg0;\n\t\tJSBool arg1;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAttribute_setBool : Error processing arguments\");\n\t\tcobj->setBool(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_setBool : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAttribute_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ComAttribute* ret = cocostudio::ComAttribute::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ComAttribute>(cx, (cocostudio::ComAttribute*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ComAttribute_createInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Object* ret = cocostudio::ComAttribute::createInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Object>(cx, (cocos2d::Object*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAttribute_createInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Component_prototype;\n\nvoid js_cocostudio_ComAttribute_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ComAttribute)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ComAttribute(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ComAttribute_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ComAttribute_class->name = \"ComAttribute\";\n\tjsb_cocostudio_ComAttribute_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComAttribute_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ComAttribute_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComAttribute_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ComAttribute_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ComAttribute_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ComAttribute_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ComAttribute_class->finalize = js_cocostudio_ComAttribute_finalize;\n\tjsb_cocostudio_ComAttribute_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getFloat\", js_cocos2dx_studio_ComAttribute_getFloat, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getString\", js_cocos2dx_studio_ComAttribute_getString, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFloat\", js_cocos2dx_studio_ComAttribute_setFloat, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setString\", js_cocos2dx_studio_ComAttribute_setString, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBool\", js_cocos2dx_studio_ComAttribute_getBool, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setInt\", js_cocos2dx_studio_ComAttribute_setInt, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"parse\", js_cocos2dx_studio_ComAttribute_parse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInt\", js_cocos2dx_studio_ComAttribute_getInt, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBool\", js_cocos2dx_studio_ComAttribute_setBool, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_ComAttribute_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createInstance\", js_cocos2dx_studio_ComAttribute_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ComAttribute_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Component_prototype,\n\t\tjsb_cocostudio_ComAttribute_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ComAttribute\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ComAttribute> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ComAttribute_class;\n\t\tp->proto = jsb_cocostudio_ComAttribute_prototype;\n\t\tp->parentProto = jsb_cocos2d_Component_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ComAudio_class;\nJSObject *jsb_cocostudio_ComAudio_prototype;\n\nJSBool js_cocos2dx_studio_ComAudio_stopAllEffects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_stopAllEffects : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopAllEffects();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_stopAllEffects : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_getEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_getEffectsVolume : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getEffectsVolume();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_getEffectsVolume : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_stopEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_stopEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_stopEffect : Error processing arguments\");\n\t\tcobj->stopEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_stopEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_getBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_getBackgroundMusicVolume : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tdouble ret = cobj->getBackgroundMusicVolume();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_getBackgroundMusicVolume : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_willPlayBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_willPlayBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->willPlayBackgroundMusic();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_willPlayBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume : Error processing arguments\");\n\t\tcobj->setBackgroundMusicVolume(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_end(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_end : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->end();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_end : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_stopBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::ComAudio* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_stopBackgroundMusic : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcobj->stopBackgroundMusic();\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tJSBool arg0;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->stopBackgroundMusic(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_stopBackgroundMusic : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_pauseBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_pauseBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pauseBackgroundMusic();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_pauseBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isBackgroundMusicPlaying();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_isLoop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_isLoop : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isLoop();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_isLoop : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_resumeAllEffects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_resumeAllEffects : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resumeAllEffects();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_resumeAllEffects : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_pauseAllEffects(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_pauseAllEffects : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->pauseAllEffects();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_pauseAllEffects : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_preloadBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_preloadBackgroundMusic : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_preloadBackgroundMusic : Error processing arguments\");\n\t\tcobj->preloadBackgroundMusic(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_preloadBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_playBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::ComAudio* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_playBackgroundMusic : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->playBackgroundMusic(arg0);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg1;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcobj->playBackgroundMusic(arg0, arg1);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcobj->playBackgroundMusic();\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_playBackgroundMusic : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_playEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocostudio::ComAudio* cobj = NULL;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_playEffect : Invalid Native Object\");\n\tdo {\n\t\tif (argc == 1) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tunsigned int ret = cobj->playEffect(arg0);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = uint32_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tconst char* arg0;\n\t\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tJSBool arg1;\n\t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tunsigned int ret = cobj->playEffect(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = uint32_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tunsigned int ret = cobj->playEffect();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tjsret = uint32_to_jsval(cx, ret);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while(0);\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_playEffect : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_preloadEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_preloadEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_preloadEffect : Error processing arguments\");\n\t\tcobj->preloadEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_preloadEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_setLoop(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setLoop : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setLoop : Error processing arguments\");\n\t\tcobj->setLoop(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_setLoop : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_unloadEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_unloadEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_unloadEffect : Error processing arguments\");\n\t\tcobj->unloadEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_unloadEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_rewindBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_rewindBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->rewindBackgroundMusic();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_rewindBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_pauseEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_pauseEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_pauseEffect : Error processing arguments\");\n\t\tcobj->pauseEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_pauseEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_resumeBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_resumeBackgroundMusic : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->resumeBackgroundMusic();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_resumeBackgroundMusic : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_setFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setFile : Error processing arguments\");\n\t\tcobj->setFile(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_setFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_setEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setEffectsVolume : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tdouble arg0;\n\t\tok &= JS_ValueToNumber(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_setEffectsVolume : Error processing arguments\");\n\t\tcobj->setEffectsVolume(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_setEffectsVolume : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_getFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_getFile : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getFile();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_getFile : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_resumeEffect(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComAudio* cobj = (cocostudio::ComAudio *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_resumeEffect : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComAudio_resumeEffect : Error processing arguments\");\n\t\tcobj->resumeEffect(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_resumeEffect : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComAudio_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ComAudio* ret = cocostudio::ComAudio::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ComAudio>(cx, (cocostudio::ComAudio*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ComAudio_createInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Object* ret = cocostudio::ComAudio::createInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Object>(cx, (cocos2d::Object*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComAudio_createInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Component_prototype;\n\nvoid js_cocostudio_ComAudio_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ComAudio)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ComAudio(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ComAudio_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ComAudio_class->name = \"ComAudio\";\n\tjsb_cocostudio_ComAudio_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComAudio_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ComAudio_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComAudio_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ComAudio_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ComAudio_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ComAudio_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ComAudio_class->finalize = js_cocostudio_ComAudio_finalize;\n\tjsb_cocostudio_ComAudio_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"stopAllEffects\", js_cocos2dx_studio_ComAudio_stopAllEffects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEffectsVolume\", js_cocos2dx_studio_ComAudio_getEffectsVolume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopEffect\", js_cocos2dx_studio_ComAudio_stopEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBackgroundMusicVolume\", js_cocos2dx_studio_ComAudio_getBackgroundMusicVolume, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"willPlayBackgroundMusic\", js_cocos2dx_studio_ComAudio_willPlayBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBackgroundMusicVolume\", js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"end\", js_cocos2dx_studio_ComAudio_end, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopBackgroundMusic\", js_cocos2dx_studio_ComAudio_stopBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseBackgroundMusic\", js_cocos2dx_studio_ComAudio_pauseBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isBackgroundMusicPlaying\", js_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isLoop\", js_cocos2dx_studio_ComAudio_isLoop, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeAllEffects\", js_cocos2dx_studio_ComAudio_resumeAllEffects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseAllEffects\", js_cocos2dx_studio_ComAudio_pauseAllEffects, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"preloadBackgroundMusic\", js_cocos2dx_studio_ComAudio_preloadBackgroundMusic, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"playBackgroundMusic\", js_cocos2dx_studio_ComAudio_playBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"playEffect\", js_cocos2dx_studio_ComAudio_playEffect, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"preloadEffect\", js_cocos2dx_studio_ComAudio_preloadEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLoop\", js_cocos2dx_studio_ComAudio_setLoop, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"unloadEffect\", js_cocos2dx_studio_ComAudio_unloadEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"rewindBackgroundMusic\", js_cocos2dx_studio_ComAudio_rewindBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pauseEffect\", js_cocos2dx_studio_ComAudio_pauseEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeBackgroundMusic\", js_cocos2dx_studio_ComAudio_resumeBackgroundMusic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFile\", js_cocos2dx_studio_ComAudio_setFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEffectsVolume\", js_cocos2dx_studio_ComAudio_setEffectsVolume, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFile\", js_cocos2dx_studio_ComAudio_getFile, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resumeEffect\", js_cocos2dx_studio_ComAudio_resumeEffect, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_ComAudio_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createInstance\", js_cocos2dx_studio_ComAudio_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ComAudio_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Component_prototype,\n\t\tjsb_cocostudio_ComAudio_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ComAudio\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ComAudio> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ComAudio_class;\n\t\tp->proto = jsb_cocostudio_ComAudio_prototype;\n\t\tp->parentProto = jsb_cocos2d_Component_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_InputDelegate_class;\nJSObject *jsb_cocostudio_InputDelegate_prototype;\n\nJSBool js_cocos2dx_studio_InputDelegate_isAccelerometerEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_isAccelerometerEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isAccelerometerEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_isAccelerometerEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_setKeypadEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setKeypadEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setKeypadEnabled : Error processing arguments\");\n\t\tcobj->setKeypadEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_setKeypadEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_getTouchMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_getTouchMode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = (int)cobj->getTouchMode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_getTouchMode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_setAccelerometerEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setAccelerometerEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setAccelerometerEnabled : Error processing arguments\");\n\t\tcobj->setAccelerometerEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_setAccelerometerEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_isKeypadEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_isKeypadEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isKeypadEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_isKeypadEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_isTouchEnabled : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isTouchEnabled();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_isTouchEnabled : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_setTouchPriority(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setTouchPriority : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setTouchPriority : Error processing arguments\");\n\t\tcobj->setTouchPriority(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_setTouchPriority : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_getTouchPriority(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_getTouchPriority : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tint ret = cobj->getTouchPriority();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_getTouchPriority : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setTouchEnabled : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setTouchEnabled : Error processing arguments\");\n\t\tcobj->setTouchEnabled(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_setTouchEnabled : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_InputDelegate_setTouchMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::InputDelegate* cobj = (cocostudio::InputDelegate *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setTouchMode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Touch::DispatchMode arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_InputDelegate_setTouchMode : Error processing arguments\");\n\t\tcobj->setTouchMode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_InputDelegate_setTouchMode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocostudio_InputDelegate_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (InputDelegate)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_InputDelegate(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_InputDelegate_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_InputDelegate_class->name = \"InputDelegate\";\n\tjsb_cocostudio_InputDelegate_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_InputDelegate_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_InputDelegate_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_InputDelegate_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_InputDelegate_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_InputDelegate_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_InputDelegate_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_InputDelegate_class->finalize = js_cocostudio_InputDelegate_finalize;\n\tjsb_cocostudio_InputDelegate_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"isAccelerometerEnabled\", js_cocos2dx_studio_InputDelegate_isAccelerometerEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setKeypadEnabled\", js_cocos2dx_studio_InputDelegate_setKeypadEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTouchMode\", js_cocos2dx_studio_InputDelegate_getTouchMode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAccelerometerEnabled\", js_cocos2dx_studio_InputDelegate_setAccelerometerEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isKeypadEnabled\", js_cocos2dx_studio_InputDelegate_isKeypadEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isTouchEnabled\", js_cocos2dx_studio_InputDelegate_isTouchEnabled, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchPriority\", js_cocos2dx_studio_InputDelegate_setTouchPriority, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTouchPriority\", js_cocos2dx_studio_InputDelegate_getTouchPriority, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchEnabled\", js_cocos2dx_studio_InputDelegate_setTouchEnabled, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTouchMode\", js_cocos2dx_studio_InputDelegate_setTouchMode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocostudio_InputDelegate_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_InputDelegate_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"InputDelegate\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::InputDelegate> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_InputDelegate_class;\n\t\tp->proto = jsb_cocostudio_InputDelegate_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ComController_class;\nJSObject *jsb_cocostudio_ComController_prototype;\n\nJSBool js_cocos2dx_studio_ComController_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ComController* ret = cocostudio::ComController::create();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ComController>(cx, (cocostudio::ComController*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComController_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ComController_createInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Object* ret = cocostudio::ComController::createInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Object>(cx, (cocos2d::Object*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComController_createInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ComController_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::ComController* cobj = new cocostudio::ComController();\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n\t\tTypeTest<cocostudio::ComController> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::ComController\");\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComController_constructor : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Component_prototype;\n\nvoid js_cocostudio_ComController_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ComController)\", obj);\n}\n\nstatic JSBool js_cocostudio_ComController_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocostudio::ComController *nobj = cocostudio::ComController::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    JS_AddNamedObjectRoot(cx, &p->obj, \"cocostudio::ComController\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\nvoid js_register_cocos2dx_studio_ComController(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ComController_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ComController_class->name = \"ComController\";\n\tjsb_cocostudio_ComController_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComController_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ComController_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComController_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ComController_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ComController_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ComController_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ComController_class->finalize = js_cocostudio_ComController_finalize;\n\tjsb_cocostudio_ComController_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n        JS_FN(\"ctor\", js_cocostudio_ComController_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_ComController_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createInstance\", js_cocos2dx_studio_ComController_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ComController_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Component_prototype,\n\t\tjsb_cocostudio_ComController_class,\n\t\tjs_cocos2dx_studio_ComController_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ComController\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ComController> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ComController_class;\n\t\tp->proto = jsb_cocostudio_ComController_prototype;\n\t\tp->parentProto = jsb_cocos2d_Component_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_ComRender_class;\nJSObject *jsb_cocostudio_ComRender_prototype;\n\nJSBool js_cocos2dx_studio_ComRender_setNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComRender* cobj = (cocostudio::ComRender *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComRender_setNode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::Node* arg0;\n\t\tdo {\n\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t} while (0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_ComRender_setNode : Error processing arguments\");\n\t\tcobj->setNode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComRender_setNode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComRender_getNode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::ComRender* cobj = (cocostudio::ComRender *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_ComRender_getNode : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::Node* ret = cobj->getNode();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComRender_getNode : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComRender_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tdo {\n\t\tif (argc == 2) {\n\t\t\tcocos2d::Node* arg0;\n\t\t\tdo {\n\t\t\t\tif (!argv[0].isObject()) { ok = JS_FALSE; break; }\n\t\t\t\tjs_proxy_t *proxy;\n\t\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tJSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n\t\t\t} while (0);\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tconst char* arg1;\n\t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\tcocostudio::ComRender* ret = cocostudio::ComRender::create(arg0, arg1);\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ComRender>(cx, (cocostudio::ComRender*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\t\n\tdo {\n\t\tif (argc == 0) {\n\t\t\tcocostudio::ComRender* ret = cocostudio::ComRender::create();\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\tdo {\n\t\t\t\tif (ret) {\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::ComRender>(cx, (cocostudio::ComRender*)ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t} else {\n\t\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t\t}\n\t\t\t} while (0);\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\treturn JS_TRUE;\n\t\t}\n\t} while (0);\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComRender_create : wrong number of arguments\");\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_ComRender_createInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::Object* ret = cocostudio::ComRender::createInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Object>(cx, (cocos2d::Object*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_ComRender_createInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nextern JSObject *jsb_cocos2d_Component_prototype;\n\nvoid js_cocostudio_ComRender_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ComRender)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_ComRender(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_ComRender_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_ComRender_class->name = \"ComRender\";\n\tjsb_cocostudio_ComRender_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComRender_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_ComRender_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_ComRender_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_ComRender_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_ComRender_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_ComRender_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_ComRender_class->finalize = js_cocostudio_ComRender_finalize;\n\tjsb_cocostudio_ComRender_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"setNode\", js_cocos2dx_studio_ComRender_setNode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNode\", js_cocos2dx_studio_ComRender_getNode, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", js_cocos2dx_studio_ComRender_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createInstance\", js_cocos2dx_studio_ComRender_createInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_ComRender_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_Component_prototype,\n\t\tjsb_cocostudio_ComRender_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ComRender\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::ComRender> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_ComRender_class;\n\t\tp->proto = jsb_cocostudio_ComRender_prototype;\n\t\tp->parentProto = jsb_cocos2d_Component_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_GUIReader_class;\nJSObject *jsb_cocostudio_GUIReader_prototype;\n\nJSBool js_cocos2dx_studio_GUIReader_widgetFromJsonFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::GUIReader* cobj = (cocostudio::GUIReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_GUIReader_widgetFromJsonFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_GUIReader_widgetFromJsonFile : Error processing arguments\");\n\t\tcocos2d::gui::Widget* ret = cobj->widgetFromJsonFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::gui::Widget>(cx, (cocos2d::gui::Widget*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_GUIReader_widgetFromJsonFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_GUIReader_getVersionInteger(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::GUIReader* cobj = (cocostudio::GUIReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_GUIReader_getVersionInteger : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_GUIReader_getVersionInteger : Error processing arguments\");\n\t\tint ret = cobj->getVersionInteger(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_GUIReader_getVersionInteger : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_GUIReader_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::GUIReader::destroyInstance();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_GUIReader_destroyInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_GUIReader_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::GUIReader* ret = cocostudio::GUIReader::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::GUIReader>(cx, (cocostudio::GUIReader*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_GUIReader_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_GUIReader_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (GUIReader)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_GUIReader(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_GUIReader_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_GUIReader_class->name = \"GUIReader\";\n\tjsb_cocostudio_GUIReader_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_GUIReader_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_GUIReader_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_GUIReader_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_GUIReader_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_GUIReader_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_GUIReader_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_GUIReader_class->finalize = js_cocostudio_GUIReader_finalize;\n\tjsb_cocostudio_GUIReader_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"widgetFromJsonFile\", js_cocos2dx_studio_GUIReader_widgetFromJsonFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVersionInteger\", js_cocos2dx_studio_GUIReader_getVersionInteger, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"destroyInstance\", js_cocos2dx_studio_GUIReader_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_studio_GUIReader_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_GUIReader_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_GUIReader_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"GUIReader\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::GUIReader> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_GUIReader_class;\n\t\tp->proto = jsb_cocostudio_GUIReader_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocostudio_SceneReader_class;\nJSObject *jsb_cocostudio_SceneReader_prototype;\n\nJSBool js_cocos2dx_studio_SceneReader_createNodeWithSceneFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::SceneReader* cobj = (cocostudio::SceneReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_SceneReader_createNodeWithSceneFile : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_SceneReader_createNodeWithSceneFile : Error processing arguments\");\n\t\tcocos2d::Node* ret = cobj->createNodeWithSceneFile(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_SceneReader_createNodeWithSceneFile : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_SceneReader_getNodeByTag(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocostudio::SceneReader* cobj = (cocostudio::SceneReader *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_studio_SceneReader_getNodeByTag : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_studio_SceneReader_getNodeByTag : Error processing arguments\");\n\t\tcocos2d::Node* ret = cobj->getNodeByTag(arg0);\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, (cocos2d::Node*)ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_studio_SceneReader_getNodeByTag : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_cocos2dx_studio_SceneReader_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::SceneReader::destroyInstance();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_SceneReader_destroyInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_SceneReader_sceneReaderVersion(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tconst char* ret = cocostudio::SceneReader::sceneReaderVersion();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_SceneReader_sceneReaderVersion : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_SceneReader_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocostudio::SceneReader* ret = cocostudio::SceneReader::getInstance();\n\t\tjsval jsret = JSVAL_NULL;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocostudio::SceneReader>(cx, (cocostudio::SceneReader*)ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_cocos2dx_studio_SceneReader_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocostudio_SceneReader_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (SceneReader)\", obj);\n}\n\nvoid js_register_cocos2dx_studio_SceneReader(JSContext *cx, JSObject *global) {\n\tjsb_cocostudio_SceneReader_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocostudio_SceneReader_class->name = \"SceneReader\";\n\tjsb_cocostudio_SceneReader_class->addProperty = JS_PropertyStub;\n\tjsb_cocostudio_SceneReader_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocostudio_SceneReader_class->getProperty = JS_PropertyStub;\n\tjsb_cocostudio_SceneReader_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocostudio_SceneReader_class->enumerate = JS_EnumerateStub;\n\tjsb_cocostudio_SceneReader_class->resolve = JS_ResolveStub;\n\tjsb_cocostudio_SceneReader_class->convert = JS_ConvertStub;\n\tjsb_cocostudio_SceneReader_class->finalize = js_cocostudio_SceneReader_finalize;\n\tjsb_cocostudio_SceneReader_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"createNodeWithSceneFile\", js_cocos2dx_studio_SceneReader_createNodeWithSceneFile, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNodeByTag\", js_cocos2dx_studio_SceneReader_getNodeByTag, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"destroyInstance\", js_cocos2dx_studio_SceneReader_destroyInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"sceneReaderVersion\", js_cocos2dx_studio_SceneReader_sceneReaderVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_cocos2dx_studio_SceneReader_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocostudio_SceneReader_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocostudio_SceneReader_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"SceneReader\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocostudio::SceneReader> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocostudio_SceneReader_class;\n\t\tp->proto = jsb_cocostudio_SceneReader_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj) {\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"ccs\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"ccs\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n\tjs_register_cocos2dx_studio_ColliderBody(cx, obj);\n\tjs_register_cocos2dx_studio_Tween(cx, obj);\n\tjs_register_cocos2dx_studio_SceneReader(cx, obj);\n\tjs_register_cocos2dx_studio_ComAudio(cx, obj);\n\tjs_register_cocos2dx_studio_ArmatureDataManager(cx, obj);\n\tjs_register_cocos2dx_studio_InputDelegate(cx, obj);\n\tjs_register_cocos2dx_studio_ComController(cx, obj);\n\tjs_register_cocos2dx_studio_ColliderDetector(cx, obj);\n\tjs_register_cocos2dx_studio_BatchNode(cx, obj);\n\tjs_register_cocos2dx_studio_ActionObject(cx, obj);\n\tjs_register_cocos2dx_studio_ComRender(cx, obj);\n\tjs_register_cocos2dx_studio_DisplayManager(cx, obj);\n\tjs_register_cocos2dx_studio_GUIReader(cx, obj);\n\tjs_register_cocos2dx_studio_ArmatureAnimation(cx, obj);\n\tjs_register_cocos2dx_studio_Armature(cx, obj);\n\tjs_register_cocos2dx_studio_ActionManagerEx(cx, obj);\n\tjs_register_cocos2dx_studio_Bone(cx, obj);\n\tjs_register_cocos2dx_studio_ComAttribute(cx, obj);\n\tjs_register_cocos2dx_studio_ColliderFilter(cx, obj);\n\tjs_register_cocos2dx_studio_Skin(cx, obj);\n\tjs_register_cocos2dx_studio_BaseData(cx, obj);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_studio_auto.hpp",
    "content": "#ifndef __cocos2dx_studio_h__\n#define __cocos2dx_studio_h__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n\nextern JSClass  *jsb_cocostudio_ActionObject_class;\nextern JSObject *jsb_cocostudio_ActionObject_prototype;\n\nJSBool js_cocos2dx_studio_ActionObject_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ActionObject_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ActionObject(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ActionObject_setCurrentTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_pause(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_setName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_setUnitTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_getTotalTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_getName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_stop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_play(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_getCurrentTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_removeActionNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_getLoop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_addActionNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_getUnitTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_isPlaying(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_updateToFrameByTime(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_setLoop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_simulationActionUpdate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionObject_ActionObject(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ActionManagerEx_class;\nextern JSObject *jsb_cocostudio_ActionManagerEx_prototype;\n\nJSBool js_cocos2dx_studio_ActionManagerEx_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ActionManagerEx_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ActionManagerEx(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ActionManagerEx_playActionByName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionManagerEx_getActionByName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionManagerEx_releaseActions(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionManagerEx_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ActionManagerEx_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_BaseData_class;\nextern JSObject *jsb_cocostudio_BaseData_prototype;\n\nJSBool js_cocos2dx_studio_BaseData_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_BaseData_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_BaseData(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_BaseData_getColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_BaseData_setColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_BaseData_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_BaseData_BaseData(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_Tween_class;\nextern JSObject *jsb_cocostudio_Tween_prototype;\n\nJSBool js_cocos2dx_studio_Tween_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_Tween_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_Tween(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_Tween_getAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Tween_gotoAndPause(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Tween_play(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Tween_gotoAndPlay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Tween_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Tween_setAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Tween_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Tween_Tween(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ColliderFilter_class;\nextern JSObject *jsb_cocostudio_ColliderFilter_prototype;\n\nJSBool js_cocos2dx_studio_ColliderFilter_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ColliderFilter_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ColliderFilter(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocostudio_ColliderBody_class;\nextern JSObject *jsb_cocostudio_ColliderBody_prototype;\n\nJSBool js_cocos2dx_studio_ColliderBody_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ColliderBody_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ColliderBody(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\n\nextern JSClass  *jsb_cocostudio_ColliderDetector_class;\nextern JSObject *jsb_cocostudio_ColliderDetector_prototype;\n\nJSBool js_cocos2dx_studio_ColliderDetector_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ColliderDetector_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ColliderDetector(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ColliderDetector_getBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_getActive(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_getColliderBodyList(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_updateTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_removeAll(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_setActive(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_setBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ColliderDetector_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_DisplayManager_class;\nextern JSObject *jsb_cocostudio_DisplayManager_prototype;\n\nJSBool js_cocos2dx_studio_DisplayManager_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_DisplayManager_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_DisplayManager(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_DisplayManager_getDisplayRenderNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_getAnchorPointInPoints(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_removeDisplay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_setForceChangeDisplay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_getContentSize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_getBoundingBox(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_addDisplay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_containPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_changeDisplayWithIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_changeDisplayWithName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_isForceChangeDisplay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_getAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_getDecorativeDisplayList(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_isVisible(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_setVisible(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_DisplayManager_DisplayManager(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_Bone_class;\nextern JSObject *jsb_cocostudio_Bone_prototype;\n\nJSBool js_cocos2dx_studio_Bone_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_Bone_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_Bone(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_Bone_isTransformDirty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_isIgnoreMovementBoneData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_updateZOrder(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getDisplayRenderNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_isBlendDirty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_addChildBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getWorldInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getTween(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getParentBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_updateColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setTransformDirty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getDisplayRenderNodeType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_removeDisplay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setBoneData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setParentBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_addDisplay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setIgnoreMovementBoneData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_removeFromParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getColliderDetector(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getChildArmature(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_changeDisplayWithIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_changeDisplayWithName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setArmature(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setBlendDirty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_removeChildBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_setChildArmature(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getNodeToArmatureTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getDisplayManager(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_getArmature(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Bone_Bone(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_BatchNode_class;\nextern JSObject *jsb_cocostudio_BatchNode_prototype;\n\nJSBool js_cocos2dx_studio_BatchNode_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_BatchNode_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_BatchNode(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_BatchNode_create(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ArmatureAnimation_class;\nextern JSObject *jsb_cocostudio_ArmatureAnimation_prototype;\n\nJSBool js_cocos2dx_studio_ArmatureAnimation_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ArmatureAnimation_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ArmatureAnimation(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ArmatureAnimation_getSpeedScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_pause(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_setSpeedScale(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_playWithIndexes(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_play(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_gotoAndPause(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_resume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_stop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_update(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_playWithIndex(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_gotoAndPlay(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_playWithNames(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_getMovementCount(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureAnimation_ArmatureAnimation(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ArmatureDataManager_class;\nextern JSObject *jsb_cocostudio_ArmatureDataManager_prototype;\n\nJSBool js_cocos2dx_studio_ArmatureDataManager_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ArmatureDataManager_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ArmatureDataManager(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ArmatureDataManager_getAnimationDatas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeAnimationData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_addArmatureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_getTextureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_getArmatureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_getAnimationData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_addAnimationData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeArmatureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_getArmatureDatas(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_removeTextureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_addTextureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ArmatureDataManager_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_Armature_class;\nextern JSObject *jsb_cocostudio_Armature_prototype;\n\nJSBool js_cocos2dx_studio_Armature_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_Armature_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_Armature(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_Armature_getBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_changeBoneParent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_setAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getBoneAtPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getArmatureTransformDirty(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_setVersion(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_updateOffsetPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getParentBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_setArmatureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_removeBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_init(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_setParentBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_drawContour(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_setBatchNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_setName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_addBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getArmatureData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getVersion(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getAnimation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_getBoneDic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Armature_Armature(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_Skin_class;\nextern JSObject *jsb_cocostudio_Skin_prototype;\n\nJSBool js_cocos2dx_studio_Skin_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_Skin_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_Skin(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_Skin_getBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_getNodeToWorldTransformAR(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_initWithFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_getDisplayName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_updateArmatureTransform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_initWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_setBone(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_createWithSpriteFrameName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_Skin_Skin(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ComAttribute_class;\nextern JSObject *jsb_cocostudio_ComAttribute_prototype;\n\nJSBool js_cocos2dx_studio_ComAttribute_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ComAttribute_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ComAttribute(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ComAttribute_getFloat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_getString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_setFloat(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_setString(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_getBool(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_setInt(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_parse(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_getInt(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_setBool(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAttribute_createInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ComAudio_class;\nextern JSObject *jsb_cocostudio_ComAudio_prototype;\n\nJSBool js_cocos2dx_studio_ComAudio_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ComAudio_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ComAudio(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ComAudio_stopAllEffects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_getEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_stopEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_getBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_willPlayBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_setBackgroundMusicVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_end(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_stopBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_pauseBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_isLoop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_resumeAllEffects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_pauseAllEffects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_preloadBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_playBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_playEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_preloadEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_setLoop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_unloadEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_rewindBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_pauseEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_resumeBackgroundMusic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_setFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_setEffectsVolume(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_getFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_resumeEffect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComAudio_createInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_InputDelegate_class;\nextern JSObject *jsb_cocostudio_InputDelegate_prototype;\n\nJSBool js_cocos2dx_studio_InputDelegate_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_InputDelegate_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_InputDelegate(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_InputDelegate_isAccelerometerEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_setKeypadEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_getTouchMode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_setAccelerometerEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_isKeypadEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_setTouchPriority(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_getTouchPriority(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_InputDelegate_setTouchMode(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ComController_class;\nextern JSObject *jsb_cocostudio_ComController_prototype;\n\nJSBool js_cocos2dx_studio_ComController_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ComController_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ComController(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ComController_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComController_createInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComController_ComController(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_ComRender_class;\nextern JSObject *jsb_cocostudio_ComRender_prototype;\n\nJSBool js_cocos2dx_studio_ComRender_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_ComRender_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_ComRender(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_ComRender_setNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComRender_getNode(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComRender_create(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_ComRender_createInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_GUIReader_class;\nextern JSObject *jsb_cocostudio_GUIReader_prototype;\n\nJSBool js_cocos2dx_studio_GUIReader_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_GUIReader_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_GUIReader(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_GUIReader_widgetFromJsonFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_GUIReader_getVersionInteger(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_GUIReader_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_GUIReader_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocostudio_SceneReader_class;\nextern JSObject *jsb_cocostudio_SceneReader_prototype;\n\nJSBool js_cocos2dx_studio_SceneReader_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_cocos2dx_studio_SceneReader_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_cocos2dx_studio_SceneReader(JSContext *cx, JSObject *global);\nvoid register_all_cocos2dx_studio(JSContext* cx, JSObject* obj);\nJSBool js_cocos2dx_studio_SceneReader_createNodeWithSceneFile(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_SceneReader_getNodeByTag(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_SceneReader_destroyInstance(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_SceneReader_sceneReaderVersion(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_cocos2dx_studio_SceneReader_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n#endif\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_studio_auto_api.js",
    "content": "/**\n * @module cocos2dx_studio\n */\nvar ccs = ccs || {};\n\n/**\n * @class ActionObject\n */\nccs.ActionObject = {\n\n/**\n * @method setCurrentTime\n * @param {float}\n */\nsetCurrentTime : function () {},\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method setName\n * @param {const char*}\n */\nsetName : function () {},\n\n/**\n * @method setUnitTime\n * @param {float}\n */\nsetUnitTime : function () {},\n\n/**\n * @method getTotalTime\n * @return A value converted from C/C++ \"float\"\n */\ngetTotalTime : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetName : function () {},\n\n/**\n * @method stop\n */\nstop : function () {},\n\n/**\n * @method getCurrentTime\n * @return A value converted from C/C++ \"float\"\n */\ngetCurrentTime : function () {},\n\n/**\n * @method removeActionNode\n * @param {cocostudio::ActionNode*}\n */\nremoveActionNode : function () {},\n\n/**\n * @method getLoop\n * @return A value converted from C/C++ \"bool\"\n */\ngetLoop : function () {},\n\n/**\n * @method addActionNode\n * @param {cocostudio::ActionNode*}\n */\naddActionNode : function () {},\n\n/**\n * @method getUnitTime\n * @return A value converted from C/C++ \"float\"\n */\ngetUnitTime : function () {},\n\n/**\n * @method isPlaying\n * @return A value converted from C/C++ \"bool\"\n */\nisPlaying : function () {},\n\n/**\n * @method updateToFrameByTime\n * @param {float}\n */\nupdateToFrameByTime : function () {},\n\n/**\n * @method setLoop\n * @param {bool}\n */\nsetLoop : function () {},\n\n/**\n * @method simulationActionUpdate\n * @param {float}\n */\nsimulationActionUpdate : function () {},\n\n/**\n * @method ActionObject\n * @constructor\n */\nActionObject : function () {},\n\n};\n\n/**\n * @class ActionManagerEx\n */\nccs.ActionManager = {\n\n/**\n * @method getActionByName\n * @return A value converted from C/C++ \"cocostudio::ActionObject*\"\n * @param {const char*}\n * @param {const char*}\n */\ngetActionByName : function () {},\n\n/**\n * @method releaseActions\n */\nreleaseActions : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::ActionManagerEx*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class BaseData\n */\nccs.BaseData = {\n\n/**\n * @method getColor\n * @return A value converted from C/C++ \"cocos2d::Color4B\"\n */\ngetColor : function () {},\n\n/**\n * @method setColor\n * @param {const cocos2d::Color4B&}\n */\nsetColor : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::BaseData*\"\n */\ncreate : function () {},\n\n/**\n * @method BaseData\n * @constructor\n */\nBaseData : function () {},\n\n};\n\n/**\n * @class Tween\n */\nccs.Tween = {\n\n/**\n * @method getAnimation\n * @return A value converted from C/C++ \"cocostudio::ArmatureAnimation*\"\n */\ngetAnimation : function () {},\n\n/**\n * @method gotoAndPause\n * @param {int}\n */\ngotoAndPause : function () {},\n\n/**\n * @method play\n * @param {cocostudio::MovementBoneData*}\n * @param {int}\n * @param {int}\n * @param {int}\n * @param {int}\n */\nplay : function () {},\n\n/**\n * @method gotoAndPlay\n * @param {int}\n */\ngotoAndPlay : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n * @param {cocostudio::Bone*}\n */\ninit : function () {},\n\n/**\n * @method setAnimation\n * @param {cocostudio::ArmatureAnimation*}\n */\nsetAnimation : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::Tween*\"\n * @param {cocostudio::Bone*}\n */\ncreate : function () {},\n\n/**\n * @method Tween\n * @constructor\n */\nTween : function () {},\n\n};\n\n/**\n * @class ColliderFilter\n */\nccs.ColliderFilter = {\n\n};\n\n/**\n * @class ColliderBody\n */\nccs.ColliderBody = {\n\n};\n\n/**\n * @class ColliderDetector\n */\nccs.ColliderDetector = {\n\n/**\n * @method getBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n */\ngetBone : function () {},\n\n/**\n * @method getActive\n * @return A value converted from C/C++ \"bool\"\n */\ngetActive : function () {},\n\n/**\n * @method getColliderBodyList\n * @return A value converted from C/C++ \"const cocos2d::Vector<cocostudio::ColliderBody *>&\"\n */\ngetColliderBodyList : function () {},\n\n/**\n * @method updateTransform\n * @param {kmMat4&}\n */\nupdateTransform : function () {},\n\n/**\n * @method removeAll\n */\nremoveAll : function () {},\n\n/**\n * @method setActive\n * @param {bool}\n */\nsetActive : function () {},\n\n/**\n * @method setBone\n * @param {cocostudio::Bone*}\n */\nsetBone : function () {},\n\n};\n\n/**\n * @class DisplayManager\n */\nccs.DisplayManager = {\n\n/**\n * @method getDisplayRenderNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetDisplayRenderNode : function () {},\n\n/**\n * @method getAnchorPointInPoints\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchorPointInPoints : function () {},\n\n/**\n * @method getDisplayRenderNodeType\n * @return A value converted from C/C++ \"cocostudio::DisplayType\"\n */\ngetDisplayRenderNodeType : function () {},\n\n/**\n * @method removeDisplay\n * @param {int}\n */\nremoveDisplay : function () {},\n\n/**\n * @method setForceChangeDisplay\n * @param {bool}\n */\nsetForceChangeDisplay : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n * @param {cocostudio::Bone*}\n */\ninit : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetContentSize : function () {},\n\n/**\n * @method getBoundingBox\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\ngetBoundingBox : function () {},\n\n/**\n * @method changeDisplayWithIndex\n * @param {int}\n * @param {bool}\n */\nchangeDisplayWithIndex : function () {},\n\n/**\n * @method changeDisplayWithName\n * @param {const std::string&}\n * @param {bool}\n */\nchangeDisplayWithName : function () {},\n\n/**\n * @method isForceChangeDisplay\n * @return A value converted from C/C++ \"bool\"\n */\nisForceChangeDisplay : function () {},\n\n/**\n * @method getCurrentDisplayIndex\n * @return A value converted from C/C++ \"int\"\n */\ngetCurrentDisplayIndex : function () {},\n\n/**\n * @method getAnchorPoint\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchorPoint : function () {},\n\n/**\n * @method getDecorativeDisplayList\n * @return A value converted from C/C++ \"const cocos2d::Vector<cocostudio::DecorativeDisplay *>&\"\n */\ngetDecorativeDisplayList : function () {},\n\n/**\n * @method isVisible\n * @return A value converted from C/C++ \"bool\"\n */\nisVisible : function () {},\n\n/**\n * @method setVisible\n * @param {bool}\n */\nsetVisible : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::DisplayManager*\"\n * @param {cocostudio::Bone*}\n */\ncreate : function () {},\n\n/**\n * @method DisplayManager\n * @constructor\n */\nDisplayManager : function () {},\n\n};\n\n/**\n * @class Bone\n */\nccs.Bone = {\n\n/**\n * @method isTransformDirty\n * @return A value converted from C/C++ \"bool\"\n */\nisTransformDirty : function () {},\n\n/**\n * @method isIgnoreMovementBoneData\n * @return A value converted from C/C++ \"bool\"\n */\nisIgnoreMovementBoneData : function () {},\n\n/**\n * @method updateZOrder\n */\nupdateZOrder : function () {},\n\n/**\n * @method getDisplayRenderNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetDisplayRenderNode : function () {},\n\n/**\n * @method isBlendDirty\n * @return A value converted from C/C++ \"bool\"\n */\nisBlendDirty : function () {},\n\n/**\n * @method addChildBone\n * @param {cocostudio::Bone*}\n */\naddChildBone : function () {},\n\n/**\n * @method getWorldInfo\n * @return A value converted from C/C++ \"cocostudio::BaseData*\"\n */\ngetWorldInfo : function () {},\n\n/**\n * @method getTween\n * @return A value converted from C/C++ \"cocostudio::Tween*\"\n */\ngetTween : function () {},\n\n/**\n * @method getParentBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n */\ngetParentBone : function () {},\n\n/**\n * @method updateColor\n */\nupdateColor : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const std::string\"\n */\ngetName : function () {},\n\n/**\n * @method setTransformDirty\n * @param {bool}\n */\nsetTransformDirty : function () {},\n\n/**\n * @method getDisplayRenderNodeType\n * @return A value converted from C/C++ \"cocostudio::DisplayType\"\n */\ngetDisplayRenderNodeType : function () {},\n\n/**\n * @method removeDisplay\n * @param {int}\n */\nremoveDisplay : function () {},\n\n/**\n * @method setBoneData\n * @param {cocostudio::BoneData*}\n */\nsetBoneData : function () {},\n\n/**\n * @method setParentBone\n * @param {cocostudio::Bone*}\n */\nsetParentBone : function () {},\n\n/**\n * @method setIgnoreMovementBoneData\n * @param {bool}\n */\nsetIgnoreMovementBoneData : function () {},\n\n/**\n * @method setName\n * @param {const std::string&}\n */\nsetName : function () {},\n\n/**\n * @method removeFromParent\n * @param {bool}\n */\nremoveFromParent : function () {},\n\n/**\n * @method getColliderDetector\n * @return A value converted from C/C++ \"cocostudio::ColliderDetector*\"\n */\ngetColliderDetector : function () {},\n\n/**\n * @method getChildArmature\n * @return A value converted from C/C++ \"cocostudio::Armature*\"\n */\ngetChildArmature : function () {},\n\n/**\n * @method changeDisplayWithIndex\n * @param {int}\n * @param {bool}\n */\nchangeDisplayWithIndex : function () {},\n\n/**\n * @method changeDisplayWithName\n * @param {const std::string&}\n * @param {bool}\n */\nchangeDisplayWithName : function () {},\n\n/**\n * @method setArmature\n * @param {cocostudio::Armature*}\n */\nsetArmature : function () {},\n\n/**\n * @method setBlendDirty\n * @param {bool}\n */\nsetBlendDirty : function () {},\n\n/**\n * @method removeChildBone\n * @param {cocostudio::Bone*}\n * @param {bool}\n */\nremoveChildBone : function () {},\n\n/**\n * @method setChildArmature\n * @param {cocostudio::Armature*}\n */\nsetChildArmature : function () {},\n\n/**\n * @method getNodeToArmatureTransform\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetNodeToArmatureTransform : function () {},\n\n/**\n * @method getDisplayManager\n * @return A value converted from C/C++ \"cocostudio::DisplayManager*\"\n */\ngetDisplayManager : function () {},\n\n/**\n * @method getArmature\n * @return A value converted from C/C++ \"cocostudio::Armature*\"\n */\ngetArmature : function () {},\n\n/**\n * @method Bone\n * @constructor\n */\nBone : function () {},\n\n};\n\n/**\n * @class BatchNode\n */\nccs.BatchNode = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::BatchNode*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ArmatureAnimation\n */\nccs.ArmatureAnimation = {\n\n/**\n * @method getSpeedScale\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeedScale : function () {},\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method setSpeedScale\n * @param {float}\n */\nsetSpeedScale : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n * @param {cocostudio::Armature*}\n */\ninit : function () {},\n\n/**\n * @method playWithIndexes\n * @param {const std::vector<int, std::allocator<int> >&}\n * @param {int}\n * @param {bool}\n */\nplayWithIndexes : function () {},\n\n/**\n * @method play\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n */\nplay : function () {},\n\n/**\n * @method gotoAndPause\n * @param {int}\n */\ngotoAndPause : function () {},\n\n/**\n * @method resume\n */\nresume : function () {},\n\n/**\n * @method stop\n */\nstop : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method playWithIndex\n * @param {int}\n * @param {int}\n * @param {int}\n */\nplayWithIndex : function () {},\n\n/**\n * @method getCurrentMovementID\n * @return A value converted from C/C++ \"std::string\"\n */\ngetCurrentMovementID : function () {},\n\n/**\n * @method gotoAndPlay\n * @param {int}\n */\ngotoAndPlay : function () {},\n\n/**\n * @method playWithNames\n * @param {const std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > >&}\n * @param {int}\n * @param {bool}\n */\nplayWithNames : function () {},\n\n/**\n * @method getMovementCount\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetMovementCount : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ArmatureAnimation*\"\n * @param {cocostudio::Armature*}\n */\ncreate : function () {},\n\n/**\n * @method ArmatureAnimation\n * @constructor\n */\nArmatureAnimation : function () {},\n\n};\n\n/**\n * @class ArmatureDataManager\n */\nccs.ArmatureDataManager = {\n\n/**\n * @method getAnimationDatas\n * @return A value converted from C/C++ \"const cocos2d::Map<std::basic_string<char>, cocostudio::AnimationData *>&\"\n */\ngetAnimationDatas : function () {},\n\n/**\n * @method removeAnimationData\n * @param {const std::string&}\n */\nremoveAnimationData : function () {},\n\n/**\n * @method addArmatureData\n * @param {const std::string&}\n * @param {cocostudio::ArmatureData*}\n * @param {const std::string&}\n */\naddArmatureData : function () {},\n\n/**\n * @method removeArmatureFileInfo\n * @param {const std::string&}\n */\nremoveArmatureFileInfo : function () {},\n\n/**\n * @method getTextureData\n * @return A value converted from C/C++ \"cocostudio::TextureData*\"\n * @param {const std::string&}\n */\ngetTextureData : function () {},\n\n/**\n * @method getArmatureData\n * @return A value converted from C/C++ \"cocostudio::ArmatureData*\"\n * @param {const std::string&}\n */\ngetArmatureData : function () {},\n\n/**\n * @method getAnimationData\n * @return A value converted from C/C++ \"cocostudio::AnimationData*\"\n * @param {const std::string&}\n */\ngetAnimationData : function () {},\n\n/**\n * @method addAnimationData\n * @param {const std::string&}\n * @param {cocostudio::AnimationData*}\n * @param {const std::string&}\n */\naddAnimationData : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method removeArmatureData\n * @param {const std::string&}\n */\nremoveArmatureData : function () {},\n\n/**\n * @method getArmatureDatas\n * @return A value converted from C/C++ \"const cocos2d::Map<std::basic_string<char>, cocostudio::ArmatureData *>&\"\n */\ngetArmatureDatas : function () {},\n\n/**\n * @method removeTextureData\n * @param {const std::string&}\n */\nremoveTextureData : function () {},\n\n/**\n * @method addTextureData\n * @param {const std::string&}\n * @param {cocostudio::TextureData*}\n * @param {const std::string&}\n */\naddTextureData : function () {},\n\n/**\n * @method isAutoLoadSpriteFile\n * @return A value converted from C/C++ \"bool\"\n */\nisAutoLoadSpriteFile : function () {},\n\n/**\n * @method addSpriteFrameFromFile\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {const std::string&}\n */\naddSpriteFrameFromFile : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::ArmatureDataManager*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class Armature\n */\nccs.Armature = {\n\n/**\n * @method getBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n * @param {const std::string&}\n */\ngetBone : function () {},\n\n/**\n * @method changeBoneParent\n * @param {cocostudio::Bone*}\n * @param {const std::string&}\n */\nchangeBoneParent : function () {},\n\n/**\n * @method setAnimation\n * @param {cocostudio::ArmatureAnimation*}\n */\nsetAnimation : function () {},\n\n/**\n * @method getBoneAtPoint\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n * @param {float}\n * @param {float}\n */\ngetBoneAtPoint : function () {},\n\n/**\n * @method getArmatureTransformDirty\n * @return A value converted from C/C++ \"bool\"\n */\ngetArmatureTransformDirty : function () {},\n\n/**\n * @method setVersion\n * @param {float}\n */\nsetVersion : function () {},\n\n/**\n * @method updateOffsetPoint\n */\nupdateOffsetPoint : function () {},\n\n/**\n * @method getParentBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n */\ngetParentBone : function () {},\n\n/**\n * @method setArmatureData\n * @param {cocostudio::ArmatureData*}\n */\nsetArmatureData : function () {},\n\n/**\n * @method removeBone\n * @param {cocostudio::Bone*}\n * @param {bool}\n */\nremoveBone : function () {},\n\n/**\n * @method getBatchNode\n * @return A value converted from C/C++ \"cocostudio::BatchNode*\"\n */\ngetBatchNode : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetName : function () {},\n\n/**\n * @method setParentBone\n * @param {cocostudio::Bone*}\n */\nsetParentBone : function () {},\n\n/**\n * @method drawContour\n */\ndrawContour : function () {},\n\n/**\n * @method setBatchNode\n * @param {cocostudio::BatchNode*}\n */\nsetBatchNode : function () {},\n\n/**\n * @method setName\n * @param {const std::string&}\n */\nsetName : function () {},\n\n/**\n * @method addBone\n * @param {cocostudio::Bone*}\n * @param {const std::string&}\n */\naddBone : function () {},\n\n/**\n * @method getArmatureData\n * @return A value converted from C/C++ \"cocostudio::ArmatureData*\"\n */\ngetArmatureData : function () {},\n\n/**\n * @method getVersion\n * @return A value converted from C/C++ \"float\"\n */\ngetVersion : function () {},\n\n/**\n * @method getAnimation\n * @return A value converted from C/C++ \"cocostudio::ArmatureAnimation*\"\n */\ngetAnimation : function () {},\n\n/**\n * @method getBoneDic\n * @return A value converted from C/C++ \"const cocos2d::Map<std::basic_string<char>, cocostudio::Bone *>&\"\n */\ngetBoneDic : function () {},\n\n/**\n * @method Armature\n * @constructor\n */\nArmature : function () {},\n\n};\n\n/**\n * @class Skin\n */\nccs.Skin = {\n\n/**\n * @method getBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n */\ngetBone : function () {},\n\n/**\n * @method getNodeToWorldTransformAR\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetNodeToWorldTransformAR : function () {},\n\n/**\n * @method initWithFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\ninitWithFile : function () {},\n\n/**\n * @method getDisplayName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetDisplayName : function () {},\n\n/**\n * @method updateArmatureTransform\n */\nupdateArmatureTransform : function () {},\n\n/**\n * @method initWithSpriteFrameName\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\ninitWithSpriteFrameName : function () {},\n\n/**\n * @method setBone\n * @param {cocostudio::Bone*}\n */\nsetBone : function () {},\n\n/**\n * @method createWithSpriteFrameName\n * @return A value converted from C/C++ \"cocostudio::Skin*\"\n * @param {const std::string&}\n */\ncreateWithSpriteFrameName : function () {},\n\n/**\n * @method Skin\n * @constructor\n */\nSkin : function () {},\n\n};\n\n/**\n * @class ComAttribute\n */\nccs.ComAttribute = {\n\n/**\n * @method getFloat\n * @return A value converted from C/C++ \"float\"\n * @param {const std::string&}\n * @param {float}\n */\ngetFloat : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ngetString : function () {},\n\n/**\n * @method setFloat\n * @param {const std::string&}\n * @param {float}\n */\nsetFloat : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method getBool\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {bool}\n */\ngetBool : function () {},\n\n/**\n * @method setInt\n * @param {const std::string&}\n * @param {int}\n */\nsetInt : function () {},\n\n/**\n * @method parse\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nparse : function () {},\n\n/**\n * @method getInt\n * @return A value converted from C/C++ \"int\"\n * @param {const std::string&}\n * @param {int}\n */\ngetInt : function () {},\n\n/**\n * @method setBool\n * @param {const std::string&}\n * @param {bool}\n */\nsetBool : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ComAttribute*\"\n */\ncreate : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n};\n\n/**\n * @class ComAudio\n */\nccs.ComAudio = {\n\n/**\n * @method stopAllEffects\n */\nstopAllEffects : function () {},\n\n/**\n * @method getEffectsVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetEffectsVolume : function () {},\n\n/**\n * @method stopEffect\n * @param {unsigned int}\n */\nstopEffect : function () {},\n\n/**\n * @method getBackgroundMusicVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetBackgroundMusicVolume : function () {},\n\n/**\n * @method willPlayBackgroundMusic\n * @return A value converted from C/C++ \"bool\"\n */\nwillPlayBackgroundMusic : function () {},\n\n/**\n * @method setBackgroundMusicVolume\n * @param {float}\n */\nsetBackgroundMusicVolume : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method pauseBackgroundMusic\n */\npauseBackgroundMusic : function () {},\n\n/**\n * @method isBackgroundMusicPlaying\n * @return A value converted from C/C++ \"bool\"\n */\nisBackgroundMusicPlaying : function () {},\n\n/**\n * @method isLoop\n * @return A value converted from C/C++ \"bool\"\n */\nisLoop : function () {},\n\n/**\n * @method resumeAllEffects\n */\nresumeAllEffects : function () {},\n\n/**\n * @method pauseAllEffects\n */\npauseAllEffects : function () {},\n\n/**\n * @method preloadBackgroundMusic\n * @param {const char*}\n */\npreloadBackgroundMusic : function () {},\n\n/**\n * @method preloadEffect\n * @param {const char*}\n */\npreloadEffect : function () {},\n\n/**\n * @method setLoop\n * @param {bool}\n */\nsetLoop : function () {},\n\n/**\n * @method unloadEffect\n * @param {const char*}\n */\nunloadEffect : function () {},\n\n/**\n * @method rewindBackgroundMusic\n */\nrewindBackgroundMusic : function () {},\n\n/**\n * @method pauseEffect\n * @param {unsigned int}\n */\npauseEffect : function () {},\n\n/**\n * @method resumeBackgroundMusic\n */\nresumeBackgroundMusic : function () {},\n\n/**\n * @method setFile\n * @param {const char*}\n */\nsetFile : function () {},\n\n/**\n * @method setEffectsVolume\n * @param {float}\n */\nsetEffectsVolume : function () {},\n\n/**\n * @method getFile\n * @return A value converted from C/C++ \"const char*\"\n */\ngetFile : function () {},\n\n/**\n * @method resumeEffect\n * @param {unsigned int}\n */\nresumeEffect : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ComAudio*\"\n */\ncreate : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n};\n\n/**\n * @class InputDelegate\n */\nccs.InputDelegate = {\n\n/**\n * @method isAccelerometerEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisAccelerometerEnabled : function () {},\n\n/**\n * @method setKeypadEnabled\n * @param {bool}\n */\nsetKeypadEnabled : function () {},\n\n/**\n * @method getTouchMode\n * @return A value converted from C/C++ \"cocos2d::Touch::DispatchMode\"\n */\ngetTouchMode : function () {},\n\n/**\n * @method setAccelerometerEnabled\n * @param {bool}\n */\nsetAccelerometerEnabled : function () {},\n\n/**\n * @method isKeypadEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisKeypadEnabled : function () {},\n\n/**\n * @method isTouchEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchEnabled : function () {},\n\n/**\n * @method setTouchPriority\n * @param {int}\n */\nsetTouchPriority : function () {},\n\n/**\n * @method getTouchPriority\n * @return A value converted from C/C++ \"int\"\n */\ngetTouchPriority : function () {},\n\n/**\n * @method setTouchEnabled\n * @param {bool}\n */\nsetTouchEnabled : function () {},\n\n/**\n * @method setTouchMode\n * @param {cocos2d::Touch::DispatchMode}\n */\nsetTouchMode : function () {},\n\n};\n\n/**\n * @class ComController\n */\nccs.ComController = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ComController*\"\n */\ncreate : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n/**\n * @method ComController\n * @constructor\n */\nComController : function () {},\n\n};\n\n/**\n * @class ComRender\n */\nccs.ComRender = {\n\n/**\n * @method setNode\n * @param {cocos2d::Node*}\n */\nsetNode : function () {},\n\n/**\n * @method getNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetNode : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n};\n\n/**\n * @class GUIReader\n */\nccs.GUIReader = {\n\n/**\n * @method widgetFromJsonFile\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {const char*}\n */\nwidgetFromJsonFile : function () {},\n\n/**\n * @method getVersionInteger\n * @return A value converted from C/C++ \"int\"\n * @param {const char*}\n */\ngetVersionInteger : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::GUIReader*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class SceneReader\n */\nccs.SceneReader = {\n\n/**\n * @method createNodeWithSceneFile\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {const std::string&}\n */\ncreateNodeWithSceneFile : function () {},\n\n/**\n * @method getNodeByTag\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {int}\n */\ngetNodeByTag : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method sceneReaderVersion\n * @return A value converted from C/C++ \"const char*\"\n */\nsceneReaderVersion : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::SceneReader*\"\n */\ngetInstance : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_auto.cpp",
    "content": "#include \"lua_cocos2dx_auto.hpp\"\n#include \"cocos2d.h\"\n#include \"SimpleAudioEngine.h\"\n#include \"tolua_fix.h\"\n#include \"LuaBasicConversions.h\"\n\n\n\nint lua_cocos2dx_Object_getReferenceCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Object* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Object\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Object*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Object_getReferenceCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getReferenceCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getReferenceCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Object_getReferenceCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Object_release(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Object* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Object\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Object*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Object_release'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->release();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"release\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Object_release'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Object_retain(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Object* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Object\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Object*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Object_retain'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->retain();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"retain\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Object_retain'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Object_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Object* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Object();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Object\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Object\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Object\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Object_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Object_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Object)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Object(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Object\");\n    tolua_cclass(tolua_S,\"Object\",\"cc.Object\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Object\");\n        tolua_function(tolua_S,\"getReferenceCount\",lua_cocos2dx_Object_getReferenceCount);\n        tolua_function(tolua_S,\"release\",lua_cocos2dx_Object_release);\n        tolua_function(tolua_S,\"retain\",lua_cocos2dx_Object_retain);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Object_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Object).name();\n    g_luaType[typeName] = \"cc.Object\";\n    g_typeCast[\"Object\"] = \"cc.Object\";\n    return 1;\n}\n\nint lua_cocos2dx_Action_startWithTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_startWithTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->startWithTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"startWithTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_startWithTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_setOriginalTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_setOriginalTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setOriginalTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOriginalTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_setOriginalTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_clone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_clone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Action* ret = cobj->clone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Action\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Action*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_clone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_getOriginalTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_getOriginalTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getOriginalTarget();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOriginalTarget\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_getOriginalTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_stop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_stop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stop();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_stop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_update(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_update'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->update(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"update\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_update'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_getTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_getTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getTarget();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTarget\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_getTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_step(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_step'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->step(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"step\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_step'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_setTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_setTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_setTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_getTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_getTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getTag();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTag\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_getTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_setTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_setTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_setTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_isDone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_isDone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isDone();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isDone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_isDone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Action_reverse(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Action* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Action\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Action*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Action_reverse'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Action* ret = cobj->reverse();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Action\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Action*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reverse\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Action_reverse'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_Action_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Action)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Action(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Action\");\n    tolua_cclass(tolua_S,\"Action\",\"cc.Action\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Action\");\n        tolua_function(tolua_S,\"startWithTarget\",lua_cocos2dx_Action_startWithTarget);\n        tolua_function(tolua_S,\"setOriginalTarget\",lua_cocos2dx_Action_setOriginalTarget);\n        tolua_function(tolua_S,\"clone\",lua_cocos2dx_Action_clone);\n        tolua_function(tolua_S,\"getOriginalTarget\",lua_cocos2dx_Action_getOriginalTarget);\n        tolua_function(tolua_S,\"stop\",lua_cocos2dx_Action_stop);\n        tolua_function(tolua_S,\"update\",lua_cocos2dx_Action_update);\n        tolua_function(tolua_S,\"getTarget\",lua_cocos2dx_Action_getTarget);\n        tolua_function(tolua_S,\"step\",lua_cocos2dx_Action_step);\n        tolua_function(tolua_S,\"setTag\",lua_cocos2dx_Action_setTag);\n        tolua_function(tolua_S,\"getTag\",lua_cocos2dx_Action_getTag);\n        tolua_function(tolua_S,\"setTarget\",lua_cocos2dx_Action_setTarget);\n        tolua_function(tolua_S,\"isDone\",lua_cocos2dx_Action_isDone);\n        tolua_function(tolua_S,\"reverse\",lua_cocos2dx_Action_reverse);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Action).name();\n    g_luaType[typeName] = \"cc.Action\";\n    g_typeCast[\"Action\"] = \"cc.Action\";\n    return 1;\n}\n\nint lua_cocos2dx_FiniteTimeAction_setDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FiniteTimeAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FiniteTimeAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FiniteTimeAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FiniteTimeAction_setDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDuration(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDuration\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FiniteTimeAction_setDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FiniteTimeAction_getDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FiniteTimeAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FiniteTimeAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FiniteTimeAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FiniteTimeAction_getDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDuration();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDuration\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FiniteTimeAction_getDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_FiniteTimeAction_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FiniteTimeAction)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FiniteTimeAction(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FiniteTimeAction\");\n    tolua_cclass(tolua_S,\"FiniteTimeAction\",\"cc.FiniteTimeAction\",\"cc.Action\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FiniteTimeAction\");\n        tolua_function(tolua_S,\"setDuration\",lua_cocos2dx_FiniteTimeAction_setDuration);\n        tolua_function(tolua_S,\"getDuration\",lua_cocos2dx_FiniteTimeAction_getDuration);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FiniteTimeAction).name();\n    g_luaType[typeName] = \"cc.FiniteTimeAction\";\n    g_typeCast[\"FiniteTimeAction\"] = \"cc.FiniteTimeAction\";\n    return 1;\n}\n\nint lua_cocos2dx_Speed_setInnerAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Speed* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Speed\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Speed*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Speed_setInnerAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setInnerAction(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInnerAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Speed_setInnerAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Speed_setSpeed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Speed* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Speed\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Speed*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Speed_setSpeed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSpeed(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpeed\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Speed_setSpeed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Speed_getInnerAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Speed* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Speed\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Speed*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Speed_getInnerAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->getInnerAction();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInnerAction\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Speed_getInnerAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Speed_getSpeed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Speed* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Speed\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Speed*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Speed_getSpeed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSpeed();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpeed\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Speed_getSpeed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Speed_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Speed\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::ActionInterval* arg0;\n        double arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::Speed* ret = cocos2d::Speed::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Speed\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Speed*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Speed_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Speed_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Speed)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Speed(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Speed\");\n    tolua_cclass(tolua_S,\"Speed\",\"cc.Speed\",\"cc.Action\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Speed\");\n        tolua_function(tolua_S,\"setInnerAction\",lua_cocos2dx_Speed_setInnerAction);\n        tolua_function(tolua_S,\"setSpeed\",lua_cocos2dx_Speed_setSpeed);\n        tolua_function(tolua_S,\"getInnerAction\",lua_cocos2dx_Speed_getInnerAction);\n        tolua_function(tolua_S,\"getSpeed\",lua_cocos2dx_Speed_getSpeed);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Speed_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Speed).name();\n    g_luaType[typeName] = \"cc.Speed\";\n    g_typeCast[\"Speed\"] = \"cc.Speed\";\n    return 1;\n}\n\nint lua_cocos2dx_Follow_setBoudarySet(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Follow* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Follow\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Follow*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Follow_setBoudarySet'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBoudarySet(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBoudarySet\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Follow_setBoudarySet'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Follow_isBoundarySet(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Follow* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Follow\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Follow*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Follow_isBoundarySet'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBoundarySet();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBoundarySet\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Follow_isBoundarySet'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Follow_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Follow\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Node* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Follow* ret = cocos2d::Follow::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Follow\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Follow*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Node* arg0;\n        cocos2d::Rect arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_rect(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::Follow* ret = cocos2d::Follow::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Follow\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Follow*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Follow_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Follow_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Follow)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Follow(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Follow\");\n    tolua_cclass(tolua_S,\"Follow\",\"cc.Follow\",\"cc.Action\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Follow\");\n        tolua_function(tolua_S,\"setBoudarySet\",lua_cocos2dx_Follow_setBoudarySet);\n        tolua_function(tolua_S,\"isBoundarySet\",lua_cocos2dx_Follow_isBoundarySet);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Follow_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Follow).name();\n    g_luaType[typeName] = \"cc.Follow\";\n    g_typeCast[\"Follow\"] = \"cc.Follow\";\n    return 1;\n}\n\nint lua_cocos2dx_GLProgram_getFragmentShaderLog(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getFragmentShaderLog'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getFragmentShaderLog();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFragmentShaderLog\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_getFragmentShaderLog'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_addAttribute(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_addAttribute'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        unsigned int arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_uint32(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->addAttribute(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addAttribute\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_addAttribute'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        const float* arg1;\n        unsigned int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR float*;\n\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWithMatrix4fv(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWithMatrix4fv\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_getUniformLocationForName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getUniformLocationForName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        int ret = cobj->getUniformLocationForName(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getUniformLocationForName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_getUniformLocationForName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_use(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_use'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->use();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"use\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_use'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_getVertexShaderLog(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_getVertexShaderLog'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getVertexShaderLog();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVertexShaderLog\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_getVertexShaderLog'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_initWithVertexShaderByteArray(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_initWithVertexShaderByteArray'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        const char* arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithVertexShaderByteArray(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithVertexShaderByteArray\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_initWithVertexShaderByteArray'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_initWithVertexShaderFilename(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_initWithVertexShaderFilename'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        const char* arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithVertexShaderFilename(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithVertexShaderFilename\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_initWithVertexShaderFilename'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformsForBuiltins(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformsForBuiltins'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            kmMat4 arg0;\n            #pragma warning NO CONVERSION TO NATIVE FOR kmMat4;\n\n            if (!ok) { break; }\n            cobj->setUniformsForBuiltins(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cobj->setUniformsForBuiltins();\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformsForBuiltins\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformsForBuiltins'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWith3i(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith3i'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        int arg0;\n        int arg1;\n        int arg2;\n        int arg3;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWith3i(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWith3i\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith3i'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWith3iv(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith3iv'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        int* arg1;\n        unsigned int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR int*;\n\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWith3iv(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWith3iv\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith3iv'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_updateUniforms(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_updateUniforms'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateUniforms();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateUniforms\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_updateUniforms'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWith4iv(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith4iv'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        int* arg1;\n        unsigned int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR int*;\n\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWith4iv(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWith4iv\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith4iv'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        const float* arg1;\n        unsigned int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR float*;\n\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWithMatrix2fv(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWithMatrix2fv\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_link(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_link'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->link();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"link\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_link'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWith2iv(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith2iv'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        int* arg1;\n        unsigned int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR int*;\n\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWith2iv(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWith2iv\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith2iv'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        const float* arg1;\n        unsigned int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR float*;\n\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWithMatrix3fv(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWithMatrix3fv\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_reset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_reset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->reset();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_reset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWith4i(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith4i'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 5) \n    {\n        int arg0;\n        int arg1;\n        int arg2;\n        int arg3;\n        int arg4;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n        ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWith4i(arg0, arg1, arg2, arg3, arg4);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWith4i\",argc, 5);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith4i'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWith1i(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith1i'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        int arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWith1i(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWith1i\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith1i'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_setUniformLocationWith2i(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GLProgram_setUniformLocationWith2i'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        int arg1;\n        int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        cobj->setUniformLocationWith2i(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUniformLocationWith2i\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_setUniformLocationWith2i'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GLProgram_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GLProgram* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::GLProgram();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.GLProgram\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.GLProgram\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"GLProgram\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GLProgram_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_GLProgram_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (GLProgram)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_GLProgram(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.GLProgram\");\n    tolua_cclass(tolua_S,\"GLProgram\",\"cc.GLProgram\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"GLProgram\");\n        tolua_function(tolua_S,\"getFragmentShaderLog\",lua_cocos2dx_GLProgram_getFragmentShaderLog);\n        tolua_function(tolua_S,\"addAttribute\",lua_cocos2dx_GLProgram_addAttribute);\n        tolua_function(tolua_S,\"setUniformLocationWithMatrix4fv\",lua_cocos2dx_GLProgram_setUniformLocationWithMatrix4fv);\n        tolua_function(tolua_S,\"getUniformLocationForName\",lua_cocos2dx_GLProgram_getUniformLocationForName);\n        tolua_function(tolua_S,\"use\",lua_cocos2dx_GLProgram_use);\n        tolua_function(tolua_S,\"getVertexShaderLog\",lua_cocos2dx_GLProgram_getVertexShaderLog);\n        tolua_function(tolua_S,\"initWithString\",lua_cocos2dx_GLProgram_initWithVertexShaderByteArray);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_GLProgram_initWithVertexShaderFilename);\n        tolua_function(tolua_S,\"setUniformsForBuiltins\",lua_cocos2dx_GLProgram_setUniformsForBuiltins);\n        tolua_function(tolua_S,\"setUniformLocationWith3i\",lua_cocos2dx_GLProgram_setUniformLocationWith3i);\n        tolua_function(tolua_S,\"setUniformLocationWith3iv\",lua_cocos2dx_GLProgram_setUniformLocationWith3iv);\n        tolua_function(tolua_S,\"updateUniforms\",lua_cocos2dx_GLProgram_updateUniforms);\n        tolua_function(tolua_S,\"setUniformLocationWith4iv\",lua_cocos2dx_GLProgram_setUniformLocationWith4iv);\n        tolua_function(tolua_S,\"setUniformLocationWithMatrix2fv\",lua_cocos2dx_GLProgram_setUniformLocationWithMatrix2fv);\n        tolua_function(tolua_S,\"link\",lua_cocos2dx_GLProgram_link);\n        tolua_function(tolua_S,\"setUniformLocationWith2iv\",lua_cocos2dx_GLProgram_setUniformLocationWith2iv);\n        tolua_function(tolua_S,\"setUniformLocationWithMatrix3fv\",lua_cocos2dx_GLProgram_setUniformLocationWithMatrix3fv);\n        tolua_function(tolua_S,\"reset\",lua_cocos2dx_GLProgram_reset);\n        tolua_function(tolua_S,\"setUniformLocationWith4i\",lua_cocos2dx_GLProgram_setUniformLocationWith4i);\n        tolua_function(tolua_S,\"setUniformLocationI32\",lua_cocos2dx_GLProgram_setUniformLocationWith1i);\n        tolua_function(tolua_S,\"setUniformLocationWith2i\",lua_cocos2dx_GLProgram_setUniformLocationWith2i);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_GLProgram_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::GLProgram).name();\n    g_luaType[typeName] = \"cc.GLProgram\";\n    g_typeCast[\"GLProgram\"] = \"cc.GLProgram\";\n    return 1;\n}\n\nint lua_cocos2dx_Touch_getPreviousLocationInView(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getPreviousLocationInView'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPreviousLocationInView();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPreviousLocationInView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getPreviousLocationInView'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_getLocation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getLocation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getLocation();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLocation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getLocation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_getDelta(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getDelta'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getDelta();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDelta\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getDelta'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_getStartLocationInView(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getStartLocationInView'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getStartLocationInView();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartLocationInView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getStartLocationInView'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_getStartLocation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getStartLocation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getStartLocation();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartLocation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getStartLocation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_getID(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getID'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getID();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getID\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getID'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_setTouchInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_setTouchInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        double arg1;\n        double arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setTouchInfo(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTouchInfo\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_setTouchInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_getLocationInView(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getLocationInView'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getLocationInView();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLocationInView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getLocationInView'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_getPreviousLocation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Touch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Touch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Touch_getPreviousLocation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPreviousLocation();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPreviousLocation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_getPreviousLocation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Touch_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Touch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Touch();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Touch\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Touch\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Touch\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Touch_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Touch_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Touch)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Touch(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Touch\");\n    tolua_cclass(tolua_S,\"Touch\",\"cc.Touch\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Touch\");\n        tolua_function(tolua_S,\"getPreviousLocationInView\",lua_cocos2dx_Touch_getPreviousLocationInView);\n        tolua_function(tolua_S,\"getLocation\",lua_cocos2dx_Touch_getLocation);\n        tolua_function(tolua_S,\"getDelta\",lua_cocos2dx_Touch_getDelta);\n        tolua_function(tolua_S,\"getStartLocationInView\",lua_cocos2dx_Touch_getStartLocationInView);\n        tolua_function(tolua_S,\"getStartLocation\",lua_cocos2dx_Touch_getStartLocation);\n        tolua_function(tolua_S,\"getId\",lua_cocos2dx_Touch_getID);\n        tolua_function(tolua_S,\"setTouchInfo\",lua_cocos2dx_Touch_setTouchInfo);\n        tolua_function(tolua_S,\"getLocationInView\",lua_cocos2dx_Touch_getLocationInView);\n        tolua_function(tolua_S,\"getPreviousLocation\",lua_cocos2dx_Touch_getPreviousLocation);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Touch_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Touch).name();\n    g_luaType[typeName] = \"cc.Touch\";\n    g_typeCast[\"Touch\"] = \"cc.Touch\";\n    return 1;\n}\n\nint lua_cocos2dx_Event_isStopped(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Event* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Event\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Event*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Event_isStopped'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isStopped();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isStopped\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Event_isStopped'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Event_getType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Event* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Event\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Event*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Event_getType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Event_getType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Event_getCurrentTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Event* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Event\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Event*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Event_getCurrentTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getCurrentTarget();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentTarget\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Event_getCurrentTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Event_stopPropagation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Event* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Event\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Event*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Event_stopPropagation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopPropagation();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopPropagation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Event_stopPropagation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_Event_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Event)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Event(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Event\");\n    tolua_cclass(tolua_S,\"Event\",\"cc.Event\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Event\");\n        tolua_function(tolua_S,\"isStopped\",lua_cocos2dx_Event_isStopped);\n        tolua_function(tolua_S,\"getType\",lua_cocos2dx_Event_getType);\n        tolua_function(tolua_S,\"getCurrentTarget\",lua_cocos2dx_Event_getCurrentTarget);\n        tolua_function(tolua_S,\"stopPropagation\",lua_cocos2dx_Event_stopPropagation);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Event).name();\n    g_luaType[typeName] = \"cc.Event\";\n    g_typeCast[\"Event\"] = \"cc.Event\";\n    return 1;\n}\n\nint lua_cocos2dx_EventTouch_getEventCode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventTouch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventTouch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventTouch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventTouch_getEventCode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getEventCode();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEventCode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventTouch_getEventCode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventTouch_setEventCode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventTouch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventTouch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventTouch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventTouch_setEventCode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::EventTouch::EventCode arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEventCode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEventCode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventTouch_setEventCode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventTouch_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventTouch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::EventTouch();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.EventTouch\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.EventTouch\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"EventTouch\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventTouch_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_EventTouch_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventTouch)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventTouch(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventTouch\");\n    tolua_cclass(tolua_S,\"EventTouch\",\"cc.EventTouch\",\"cc.Event\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventTouch\");\n        tolua_function(tolua_S,\"getEventCode\",lua_cocos2dx_EventTouch_getEventCode);\n        tolua_function(tolua_S,\"setEventCode\",lua_cocos2dx_EventTouch_setEventCode);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_EventTouch_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventTouch).name();\n    g_luaType[typeName] = \"cc.EventTouch\";\n    g_typeCast[\"EventTouch\"] = \"cc.EventTouch\";\n    return 1;\n}\n\nint lua_cocos2dx_EventKeyboard_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventKeyboard* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::EventKeyboard::KeyCode arg0;\n        bool arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::EventKeyboard(arg0, arg1);\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.EventKeyboard\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.EventKeyboard\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"EventKeyboard\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventKeyboard_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_EventKeyboard_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventKeyboard)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventKeyboard(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventKeyboard\");\n    tolua_cclass(tolua_S,\"EventKeyboard\",\"cc.EventKeyboard\",\"cc.Event\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventKeyboard\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventKeyboard).name();\n    g_luaType[typeName] = \"cc.EventKeyboard\";\n    g_typeCast[\"EventKeyboard\"] = \"cc.EventKeyboard\";\n    return 1;\n}\n\nint lua_cocos2dx_Texture2D_getShaderProgram(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getShaderProgram'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::GLProgram* ret = cobj->getShaderProgram();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GLProgram\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GLProgram*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShaderProgram\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getShaderProgram'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getMaxT(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getMaxT'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMaxT();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaxT\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getMaxT'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getStringForFormat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getStringForFormat'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getStringForFormat();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringForFormat\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getStringForFormat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_initWithImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_initWithImage'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Image* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Image\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Image*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D::PixelFormat arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithImage(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Image* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Image\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Image*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithImage(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithImage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_initWithImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_setShaderProgram(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_setShaderProgram'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::GLProgram* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.GLProgram\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setShaderProgram(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setShaderProgram\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_setShaderProgram'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getMaxS(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getMaxS'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMaxS();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaxS\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getMaxS'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_hasPremultipliedAlpha(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_hasPremultipliedAlpha'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->hasPremultipliedAlpha();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hasPremultipliedAlpha\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_hasPremultipliedAlpha'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_initWithMipmaps(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_initWithMipmaps'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 5) \n    {\n        cocos2d::_MipmapInfo* arg0;\n        int arg1;\n        cocos2d::Texture2D::PixelFormat arg2;\n        int arg3;\n        int arg4;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR _MipmapInfo*;\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n        ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithMipmaps(arg0, arg1, arg2, arg3, arg4);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithMipmaps\",argc, 5);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_initWithMipmaps'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getPixelsHigh(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getPixelsHigh'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPixelsHigh();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPixelsHigh\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getPixelsHigh'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getBitsPerPixelForFormat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getBitsPerPixelForFormat'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            cocos2d::Texture2D::PixelFormat arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            unsigned int ret = cobj->getBitsPerPixelForFormat(arg0);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            unsigned int ret = cobj->getBitsPerPixelForFormat();\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBitsPerPixelForFormat\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getBitsPerPixelForFormat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getName();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_initWithString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_initWithString'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            cocos2d::FontDefinition arg1;\n            ok &= luaval_to_fontdefinition(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 4) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Size arg3;\n            ok &= luaval_to_size(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2, arg3);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 5) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Size arg3;\n            ok &= luaval_to_size(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 6) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Size arg3;\n            ok &= luaval_to_size(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n\n            if (!ok) { break; }\n            cocos2d::TextVAlignment arg5;\n            ok &= luaval_to_int32(tolua_S, 7,(int *)&arg5);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4, arg5);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithString\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_initWithString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_setMaxT(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_setMaxT'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaxT(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaxT\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_setMaxT'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_drawInRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_drawInRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->drawInRect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawInRect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_drawInRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getContentSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getContentSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getContentSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContentSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getContentSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_setAliasTexParameters(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_setAliasTexParameters'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setAliasTexParameters();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAliasTexParameters\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_setAliasTexParameters'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_setAntiAliasTexParameters(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_setAntiAliasTexParameters'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setAntiAliasTexParameters();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAntiAliasTexParameters\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_setAntiAliasTexParameters'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_generateMipmap(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_generateMipmap'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->generateMipmap();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"generateMipmap\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_generateMipmap'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getDescription(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getDescription'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getDescription();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDescription\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getDescription'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getPixelFormat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getPixelFormat'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getPixelFormat();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPixelFormat\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getPixelFormat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getContentSizeInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getContentSizeInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getContentSizeInPixels();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContentSizeInPixels\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getContentSizeInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getPixelsWide(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_getPixelsWide'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPixelsWide();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPixelsWide\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getPixelsWide'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_drawAtPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_drawAtPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->drawAtPoint(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawAtPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_drawAtPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_hasMipmaps(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_hasMipmaps'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->hasMipmaps();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hasMipmaps\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_hasMipmaps'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_setMaxS(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Texture2D_setMaxS'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaxS(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaxS\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_setMaxS'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Texture2D_setDefaultAlphaPixelFormat(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Texture2D::PixelFormat arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D::setDefaultAlphaPixelFormat(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"setDefaultAlphaPixelFormat\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_setDefaultAlphaPixelFormat'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cocos2d::Texture2D::getDefaultAlphaPixelFormat();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getDefaultAlphaPixelFormat\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        bool arg0;\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D::PVRImagesHavePremultipliedAlpha(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"PVRImagesHavePremultipliedAlpha\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Texture2D_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Texture2D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Texture2D();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Texture2D\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Texture2D\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Texture2D\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Texture2D_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Texture2D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Texture2D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Texture2D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Texture2D\");\n    tolua_cclass(tolua_S,\"Texture2D\",\"cc.Texture2D\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Texture2D\");\n        tolua_function(tolua_S,\"getShaderProgram\",lua_cocos2dx_Texture2D_getShaderProgram);\n        tolua_function(tolua_S,\"getMaxT\",lua_cocos2dx_Texture2D_getMaxT);\n        tolua_function(tolua_S,\"getStringForFormat\",lua_cocos2dx_Texture2D_getStringForFormat);\n        tolua_function(tolua_S,\"initWithImage\",lua_cocos2dx_Texture2D_initWithImage);\n        tolua_function(tolua_S,\"setShaderProgram\",lua_cocos2dx_Texture2D_setShaderProgram);\n        tolua_function(tolua_S,\"getMaxS\",lua_cocos2dx_Texture2D_getMaxS);\n        tolua_function(tolua_S,\"hasPremultipliedAlpha\",lua_cocos2dx_Texture2D_hasPremultipliedAlpha);\n        tolua_function(tolua_S,\"initWithMipmaps\",lua_cocos2dx_Texture2D_initWithMipmaps);\n        tolua_function(tolua_S,\"getPixelsHigh\",lua_cocos2dx_Texture2D_getPixelsHigh);\n        tolua_function(tolua_S,\"getBitsPerPixelForFormat\",lua_cocos2dx_Texture2D_getBitsPerPixelForFormat);\n        tolua_function(tolua_S,\"getName\",lua_cocos2dx_Texture2D_getName);\n        tolua_function(tolua_S,\"initWithString\",lua_cocos2dx_Texture2D_initWithString);\n        tolua_function(tolua_S,\"setMaxT\",lua_cocos2dx_Texture2D_setMaxT);\n        tolua_function(tolua_S,\"drawInRect\",lua_cocos2dx_Texture2D_drawInRect);\n        tolua_function(tolua_S,\"getContentSize\",lua_cocos2dx_Texture2D_getContentSize);\n        tolua_function(tolua_S,\"setAliasTexParameters\",lua_cocos2dx_Texture2D_setAliasTexParameters);\n        tolua_function(tolua_S,\"setAntiAliasTexParameters\",lua_cocos2dx_Texture2D_setAntiAliasTexParameters);\n        tolua_function(tolua_S,\"generateMipmap\",lua_cocos2dx_Texture2D_generateMipmap);\n        tolua_function(tolua_S,\"getDescription\",lua_cocos2dx_Texture2D_getDescription);\n        tolua_function(tolua_S,\"getPixelFormat\",lua_cocos2dx_Texture2D_getPixelFormat);\n        tolua_function(tolua_S,\"getContentSizeInPixels\",lua_cocos2dx_Texture2D_getContentSizeInPixels);\n        tolua_function(tolua_S,\"getPixelsWide\",lua_cocos2dx_Texture2D_getPixelsWide);\n        tolua_function(tolua_S,\"drawAtPoint\",lua_cocos2dx_Texture2D_drawAtPoint);\n        tolua_function(tolua_S,\"hasMipmaps\",lua_cocos2dx_Texture2D_hasMipmaps);\n        tolua_function(tolua_S,\"setMaxS\",lua_cocos2dx_Texture2D_setMaxS);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Texture2D_constructor);\n        tolua_function(tolua_S,\"setDefaultAlphaPixelFormat\", lua_cocos2dx_Texture2D_setDefaultAlphaPixelFormat);\n        tolua_function(tolua_S,\"getDefaultAlphaPixelFormat\", lua_cocos2dx_Texture2D_getDefaultAlphaPixelFormat);\n        tolua_function(tolua_S,\"PVRImagesHavePremultipliedAlpha\", lua_cocos2dx_Texture2D_PVRImagesHavePremultipliedAlpha);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Texture2D).name();\n    g_luaType[typeName] = \"cc.Texture2D\";\n    g_typeCast[\"Texture2D\"] = \"cc.Texture2D\";\n    return 1;\n}\n\nint lua_cocos2dx_EventListener_clone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventListener* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventListener\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventListener*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventListener_clone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::EventListener* ret = cobj->clone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EventListener\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EventListener*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventListener_clone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventListener_checkAvailable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventListener* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventListener\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventListener*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventListener_checkAvailable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->checkAvailable();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"checkAvailable\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventListener_checkAvailable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_EventListener_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListener)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventListener(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListener\");\n    tolua_cclass(tolua_S,\"EventListener\",\"cc.EventListener\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListener\");\n        tolua_function(tolua_S,\"clone\",lua_cocos2dx_EventListener_clone);\n        tolua_function(tolua_S,\"checkAvailable\",lua_cocos2dx_EventListener_checkAvailable);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListener).name();\n    g_luaType[typeName] = \"cc.EventListener\";\n    g_typeCast[\"EventListener\"] = \"cc.EventListener\";\n    return 1;\n}\n\nint lua_cocos2dx_EventDispatcher_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::EventListener* arg0;\n        cocos2d::Node* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.EventListener\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::EventListener*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addEventListenerWithSceneGraphPriority(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addEventListenerWithSceneGraphPriority\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::EventListener* arg0;\n        int arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.EventListener\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::EventListener*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->addEventListenerWithFixedPriority(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addEventListenerWithFixedPriority\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_removeEventListener(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_removeEventListener'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::EventListener* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.EventListener\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::EventListener*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeEventListener(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeEventListener\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_removeEventListener'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_removeEventListeners(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_removeEventListeners'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::EventListener::Type arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeEventListeners(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeEventListeners\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_removeEventListeners'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_dispatchCustomEvent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_dispatchCustomEvent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        void* arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR void*;\n        if(!ok)\n            return 0;\n        cobj->dispatchCustomEvent(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"dispatchCustomEvent\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_dispatchCustomEvent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_setPriority(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_setPriority'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::EventListener* arg0;\n        int arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.EventListener\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::EventListener*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setPriority(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPriority\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_setPriority'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_addCustomEventListener(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        std::function<void (cocos2d::EventCustom *)> arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t// Lambda binding for lua is not supported.\n\t\t\tassert(false);\n\t\t} while(0)\n\t\t;\n        if(!ok)\n            return 0;\n        cocos2d::EventListenerCustom* ret = cobj->addCustomEventListener(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EventListenerCustom\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EventListenerCustom*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addCustomEventListener\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_addCustomEventListener'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_dispatchEvent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_dispatchEvent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Event* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Event*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->dispatchEvent(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"dispatchEvent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_dispatchEvent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_removeAllEventListeners(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_removeAllEventListeners'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllEventListeners();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllEventListeners\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_removeAllEventListeners'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_removeCustomEventListeners(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_removeCustomEventListeners'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeCustomEventListeners(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeCustomEventListeners\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_removeCustomEventListeners'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventDispatcher\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventDispatcher_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventDispatcher_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventDispatcher* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::EventDispatcher();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.EventDispatcher\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.EventDispatcher\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"EventDispatcher\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventDispatcher_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_EventDispatcher_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventDispatcher)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventDispatcher(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventDispatcher\");\n    tolua_cclass(tolua_S,\"EventDispatcher\",\"cc.EventDispatcher\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventDispatcher\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_EventDispatcher_setEnabled);\n        tolua_function(tolua_S,\"addEventListenerWithSceneGraphPriority\",lua_cocos2dx_EventDispatcher_addEventListenerWithSceneGraphPriority);\n        tolua_function(tolua_S,\"addEventListenerWithFixedPriority\",lua_cocos2dx_EventDispatcher_addEventListenerWithFixedPriority);\n        tolua_function(tolua_S,\"removeEventListener\",lua_cocos2dx_EventDispatcher_removeEventListener);\n        tolua_function(tolua_S,\"removeEventListeners\",lua_cocos2dx_EventDispatcher_removeEventListeners);\n        tolua_function(tolua_S,\"dispatchCustomEvent\",lua_cocos2dx_EventDispatcher_dispatchCustomEvent);\n        tolua_function(tolua_S,\"setPriority\",lua_cocos2dx_EventDispatcher_setPriority);\n        tolua_function(tolua_S,\"addCustomEventListener\",lua_cocos2dx_EventDispatcher_addCustomEventListener);\n        tolua_function(tolua_S,\"dispatchEvent\",lua_cocos2dx_EventDispatcher_dispatchEvent);\n        tolua_function(tolua_S,\"removeAllEventListeners\",lua_cocos2dx_EventDispatcher_removeAllEventListeners);\n        tolua_function(tolua_S,\"removeCustomEventListeners\",lua_cocos2dx_EventDispatcher_removeCustomEventListeners);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_EventDispatcher_isEnabled);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_EventDispatcher_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventDispatcher).name();\n    g_luaType[typeName] = \"cc.EventDispatcher\";\n    g_typeCast[\"EventDispatcher\"] = \"cc.EventDispatcher\";\n    return 1;\n}\n\nint lua_cocos2dx_Node_addChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_addChild'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cobj->addChild(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->addChild(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            cobj->addChild(arg0, arg1, arg2);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addChild\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_addChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_removeComponent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_removeComponent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->removeComponent(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeComponent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_removeComponent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setPhysicsBody(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setPhysicsBody'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::PhysicsBody* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setPhysicsBody(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPhysicsBody\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setPhysicsBody'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getShaderProgram(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getShaderProgram'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::GLProgram* ret = cobj->getShaderProgram();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GLProgram\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GLProgram*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::GLProgram* ret = cobj->getShaderProgram();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GLProgram\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GLProgram*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShaderProgram\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getShaderProgram'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getDescription(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getDescription'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getDescription();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDescription\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getDescription'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setOpacityModifyRGB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setOpacityModifyRGB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setOpacityModifyRGB(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOpacityModifyRGB\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setOpacityModifyRGB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setCascadeOpacityEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setCascadeOpacityEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCascadeOpacityEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCascadeOpacityEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setCascadeOpacityEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getChildren(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getChildren'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::Vector<cocos2d::Node *>& ret = cobj->getChildren();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::Vector<cocos2d::Node *>& ret = cobj->getChildren();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getChildren\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getChildren'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_pause(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_pause'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pause();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pause\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_pause'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_convertToWorldSpaceAR(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_convertToWorldSpaceAR'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertToWorldSpaceAR(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertToWorldSpaceAR\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_convertToWorldSpaceAR'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_isIgnoreAnchorPointForPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_isIgnoreAnchorPointForPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isIgnoreAnchorPointForPosition();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isIgnoreAnchorPointForPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_isIgnoreAnchorPointForPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_updateDisplayedOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_updateDisplayedOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        uint16_t arg0;\n\n        ok &= luaval_to_uint16(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->updateDisplayedOpacity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateDisplayedOpacity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_updateDisplayedOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setRotation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setRotation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setRotation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setScaleY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setScaleY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScaleY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScaleY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setScaleY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setScaleX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setScaleX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScaleX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScaleX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setScaleX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color3B& ret = cobj->getColor();\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_removeAllComponents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_removeAllComponents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllComponents();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllComponents\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_removeAllComponents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node__setLocalZOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node__setLocalZOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->_setLocalZOrder(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"_setLocalZOrder\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node__setLocalZOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getTag();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTag\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getNodeToWorldAffineTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getNodeToWorldAffineTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::AffineTransform ret = cobj->getNodeToWorldAffineTransform();\n        affinetransform_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeToWorldAffineTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getNodeToWorldAffineTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getNodeToWorldTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getNodeToWorldTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        kmMat4 ret = cobj->getNodeToWorldTransform();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeToWorldTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getNodeToWorldTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_removeChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_removeChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeChild(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        cocos2d::Node* arg0;\n        bool arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->removeChild(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeChild\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_removeChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_convertToWorldSpace(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_convertToWorldSpace'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertToWorldSpace(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertToWorldSpace\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_convertToWorldSpace'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Scene* ret = cobj->getScene();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scene\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Scene*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScene\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getEventDispatcher(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getEventDispatcher'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::EventDispatcher* ret = cobj->getEventDispatcher();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EventDispatcher\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EventDispatcher*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEventDispatcher\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getEventDispatcher'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setSkewX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setSkewX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSkewX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSkewX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setSkewX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setSkewY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setSkewY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSkewY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSkewY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setSkewY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        uint16_t ret = cobj->getOpacity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOpacity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_convertTouchToNodeSpace(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_convertTouchToNodeSpace'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Touch* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertTouchToNodeSpace(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertTouchToNodeSpace\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_convertTouchToNodeSpace'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_removeAllChildrenWithCleanup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_removeAllChildrenWithCleanup'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            bool arg0;\n            ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->removeAllChildrenWithCleanup(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cobj->removeAllChildren();\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllChildren\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_removeAllChildrenWithCleanup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getRotationX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getRotationX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRotationX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRotationX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getRotationX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getRotationY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getRotationY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRotationY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRotationY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getRotationY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getNodeToParentAffineTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getNodeToParentAffineTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::AffineTransform ret = cobj->getNodeToParentAffineTransform();\n        affinetransform_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeToParentAffineTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getNodeToParentAffineTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_isCascadeOpacityEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_isCascadeOpacityEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isCascadeOpacityEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isCascadeOpacityEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_isCascadeOpacityEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setParent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setParent(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setParent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getNodeToParentTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getNodeToParentTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const kmMat4& ret = cobj->getNodeToParentTransform();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeToParentTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getNodeToParentTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_resume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_resume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resume();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resume\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_resume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getPhysicsBody(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getPhysicsBody'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cobj->getPhysicsBody();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPhysicsBody\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getPhysicsBody'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setPosition'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->setPosition(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Point arg0;\n            ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cobj->setPosition(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPosition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_stopActionByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_stopActionByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->stopActionByTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopActionByTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_stopActionByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_reorderChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_reorderChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Node* arg0;\n        int arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->reorderChild(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reorderChild\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_reorderChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_ignoreAnchorPointForPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_ignoreAnchorPointForPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->ignoreAnchorPointForPosition(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ignoreAnchorPointForPosition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_ignoreAnchorPointForPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setPositionY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setPositionY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPositionY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPositionY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setPositionY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setPositionX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setPositionX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPositionX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPositionX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setPositionX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setNodeToParentTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setNodeToParentTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        kmMat4 arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR kmMat4;\n        if(!ok)\n            return 0;\n        cobj->setNodeToParentTransform(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setNodeToParentTransform\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setNodeToParentTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getAnchorPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getAnchorPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getAnchorPoint();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchorPoint\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getAnchorPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getNumberOfRunningActions(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getNumberOfRunningActions'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getNumberOfRunningActions();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNumberOfRunningActions\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getNumberOfRunningActions'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_updateTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_updateTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateTransform();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_updateTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_isVisible(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_isVisible'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isVisible();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isVisible\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_isVisible'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getChildrenCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getChildrenCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getChildrenCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getChildrenCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getChildrenCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_convertToNodeSpaceAR(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_convertToNodeSpaceAR'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertToNodeSpaceAR(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertToNodeSpaceAR\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_convertToNodeSpaceAR'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_addComponent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_addComponent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Component* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Component\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Component*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->addComponent(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addComponent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_addComponent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_visit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_visit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->visit();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"visit\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_visit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setShaderProgram(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setShaderProgram'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::GLProgram* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.GLProgram\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setShaderProgram(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setShaderProgram\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setShaderProgram'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getRotation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getRotation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRotation();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRotation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getRotation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getAnchorPointInPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getAnchorPointInPoints'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getAnchorPointInPoints();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchorPointInPoints\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getAnchorPointInPoints'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_runAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_runAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Action* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Action\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Action*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Action* ret = cobj->runAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Action\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Action*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"runAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_runAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_transform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_transform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->transform();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"transform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_transform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setVertexZ(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setVertexZ'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setVertexZ(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVertexZ\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setVertexZ'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setScheduler(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setScheduler'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Scheduler* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scheduler\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Scheduler*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setScheduler(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScheduler\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setScheduler'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_stopAllActions(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_stopAllActions'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopAllActions();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopAllActions\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_stopAllActions'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getSkewX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getSkewX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSkewX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSkewX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getSkewX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getSkewY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getSkewY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSkewY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSkewY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getSkewY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getDisplayedColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getDisplayedColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color3B& ret = cobj->getDisplayedColor();\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayedColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getDisplayedColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getActionByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getActionByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Action* ret = cobj->getActionByTag(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Action\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Action*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getActionByTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getActionByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setRotationX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setRotationX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotationX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotationX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setRotationX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setRotationY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setRotationY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotationY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotationY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setRotationY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setAdditionalTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setAdditionalTransform'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            kmMat4 arg0;\n            #pragma warning NO CONVERSION TO NATIVE FOR kmMat4;\n\n            if (!ok) { break; }\n            cobj->setAdditionalTransform(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::AffineTransform arg0;\n            ok &= luaval_to_affinetransform(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cobj->setAdditionalTransform(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAdditionalTransform\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setAdditionalTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getDisplayedOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getDisplayedOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        uint16_t ret = cobj->getDisplayedOpacity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayedOpacity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getDisplayedOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getLocalZOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getLocalZOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getLocalZOrder();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLocalZOrder\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getLocalZOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getScheduler(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getScheduler'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::Scheduler* ret = cobj->getScheduler();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scheduler\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Scheduler*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::Scheduler* ret = cobj->getScheduler();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scheduler\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Scheduler*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScheduler\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getScheduler'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getParentToNodeAffineTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getParentToNodeAffineTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::AffineTransform ret = cobj->getParentToNodeAffineTransform();\n        affinetransform_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParentToNodeAffineTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getParentToNodeAffineTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getOrderOfArrival(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getOrderOfArrival'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getOrderOfArrival();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOrderOfArrival\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getOrderOfArrival'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setActionManager(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setActionManager'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionManager* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionManager\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setActionManager(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setActionManager\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setActionManager'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_isRunning(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_isRunning'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isRunning();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isRunning\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_isRunning'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getParent'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::Node* ret = cobj->getParent();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::Node* ret = cobj->getParent();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getPositionY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getPositionY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getPositionY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPositionY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getPositionY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getPositionX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getPositionX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getPositionX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPositionX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getPositionX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_removeChildByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_removeChildByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeChildByTag(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        int arg0;\n        bool arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->removeChildByTag(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeChildByTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_removeChildByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_updateDisplayedColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_updateDisplayedColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->updateDisplayedColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateDisplayedColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_updateDisplayedColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setVisible(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setVisible'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setVisible(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVisible\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setVisible'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getParentToNodeTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getParentToNodeTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const kmMat4& ret = cobj->getParentToNodeTransform();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParentToNodeTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getParentToNodeTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getVertexZ(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getVertexZ'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getVertexZ();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVertexZ\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getVertexZ'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setGlobalZOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setGlobalZOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setGlobalZOrder(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGlobalZOrder\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setGlobalZOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setScale'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->setScale(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setScale(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScale\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getChildByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getChildByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getChildByTag(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getChildByTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getChildByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setOrderOfArrival(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setOrderOfArrival'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setOrderOfArrival(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOrderOfArrival\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setOrderOfArrival'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getScaleY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getScaleY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScaleY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScaleY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getScaleY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getScaleX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getScaleX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScaleX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScaleX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getScaleX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setLocalZOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setLocalZOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLocalZOrder(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLocalZOrder\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setLocalZOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getWorldToNodeAffineTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getWorldToNodeAffineTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::AffineTransform ret = cobj->getWorldToNodeAffineTransform();\n        affinetransform_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWorldToNodeAffineTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getWorldToNodeAffineTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setCascadeColorEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setCascadeColorEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCascadeColorEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCascadeColorEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setCascadeColorEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        uint16_t arg0;\n\n        ok &= luaval_to_uint16(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setOpacity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOpacity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_cleanup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_cleanup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->cleanup();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"cleanup\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_cleanup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getComponent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getComponent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Component* ret = cobj->getComponent(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Component\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Component*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getComponent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getComponent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getContentSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getContentSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getContentSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContentSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getContentSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getBoundingBox(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getBoundingBox'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Rect ret = cobj->getBoundingBox();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBoundingBox\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getBoundingBox'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_updatePhysicsTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_updatePhysicsTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->updatePhysicsTransform();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updatePhysicsTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_updatePhysicsTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setEventDispatcher(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setEventDispatcher'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::EventDispatcher* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.EventDispatcher\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::EventDispatcher*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setEventDispatcher(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEventDispatcher\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setEventDispatcher'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getGlobalZOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getGlobalZOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getGlobalZOrder();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGlobalZOrder\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getGlobalZOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_draw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_draw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->draw();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"draw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_draw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_transformAncestors(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_transformAncestors'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->transformAncestors();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"transformAncestors\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_transformAncestors'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setUserObject(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setUserObject'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Object* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Object\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Object*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setUserObject(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUserObject\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setUserObject'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_removeFromParentAndCleanup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_removeFromParentAndCleanup'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            bool arg0;\n            ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->removeFromParentAndCleanup(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cobj->removeFromParent();\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeFromParent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_removeFromParentAndCleanup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_convertTouchToNodeSpaceAR(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_convertTouchToNodeSpaceAR'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Touch* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertTouchToNodeSpaceAR(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertTouchToNodeSpaceAR\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_convertTouchToNodeSpaceAR'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_update(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_update'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->update(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"update\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_update'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_sortAllChildren(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_sortAllChildren'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->sortAllChildren();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"sortAllChildren\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_sortAllChildren'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getWorldToNodeTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getWorldToNodeTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        kmMat4 ret = cobj->getWorldToNodeTransform();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWorldToNodeTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getWorldToNodeTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScale();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScale\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_convertToNodeSpace(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_convertToNodeSpace'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertToNodeSpace(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertToNodeSpace\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_convertToNodeSpace'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_setTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_isCascadeColorEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_isCascadeColorEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isCascadeColorEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isCascadeColorEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_isCascadeColorEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_isOpacityModifyRGB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_isOpacityModifyRGB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isOpacityModifyRGB();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isOpacityModifyRGB\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_isOpacityModifyRGB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_stopAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_stopAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Action* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Action\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Action*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->stopAction(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_stopAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_getActionManager(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_getActionManager'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::ActionManager* ret = cobj->getActionManager();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::ActionManager* ret = cobj->getActionManager();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getActionManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_getActionManager'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Node_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cocos2d::Node::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Node_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Node)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Node(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Node\");\n    tolua_cclass(tolua_S,\"Node\",\"cc.Node\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Node\");\n        tolua_function(tolua_S,\"addChild\",lua_cocos2dx_Node_addChild);\n        tolua_function(tolua_S,\"removeComponent\",lua_cocos2dx_Node_removeComponent);\n        tolua_function(tolua_S,\"setPhysicsBody\",lua_cocos2dx_Node_setPhysicsBody);\n        tolua_function(tolua_S,\"getShaderProgram\",lua_cocos2dx_Node_getShaderProgram);\n        tolua_function(tolua_S,\"getDescription\",lua_cocos2dx_Node_getDescription);\n        tolua_function(tolua_S,\"setOpacityModifyRGB\",lua_cocos2dx_Node_setOpacityModifyRGB);\n        tolua_function(tolua_S,\"setCascadeOpacityEnabled\",lua_cocos2dx_Node_setCascadeOpacityEnabled);\n        tolua_function(tolua_S,\"getChildren\",lua_cocos2dx_Node_getChildren);\n        tolua_function(tolua_S,\"pause\",lua_cocos2dx_Node_pause);\n        tolua_function(tolua_S,\"convertToWorldSpaceAR\",lua_cocos2dx_Node_convertToWorldSpaceAR);\n        tolua_function(tolua_S,\"isIgnoreAnchorPointForPosition\",lua_cocos2dx_Node_isIgnoreAnchorPointForPosition);\n        tolua_function(tolua_S,\"updateDisplayedOpacity\",lua_cocos2dx_Node_updateDisplayedOpacity);\n        tolua_function(tolua_S,\"setRotation\",lua_cocos2dx_Node_setRotation);\n        tolua_function(tolua_S,\"setScaleY\",lua_cocos2dx_Node_setScaleY);\n        tolua_function(tolua_S,\"setScaleX\",lua_cocos2dx_Node_setScaleX);\n        tolua_function(tolua_S,\"getColor\",lua_cocos2dx_Node_getColor);\n        tolua_function(tolua_S,\"removeAllComponents\",lua_cocos2dx_Node_removeAllComponents);\n        tolua_function(tolua_S,\"_setLocalZOrder\",lua_cocos2dx_Node__setLocalZOrder);\n        tolua_function(tolua_S,\"getTag\",lua_cocos2dx_Node_getTag);\n        tolua_function(tolua_S,\"getNodeToWorldAffineTransform\",lua_cocos2dx_Node_getNodeToWorldAffineTransform);\n        tolua_function(tolua_S,\"getNodeToWorldTransform\",lua_cocos2dx_Node_getNodeToWorldTransform);\n        tolua_function(tolua_S,\"removeChild\",lua_cocos2dx_Node_removeChild);\n        tolua_function(tolua_S,\"convertToWorldSpace\",lua_cocos2dx_Node_convertToWorldSpace);\n        tolua_function(tolua_S,\"getScene\",lua_cocos2dx_Node_getScene);\n        tolua_function(tolua_S,\"getEventDispatcher\",lua_cocos2dx_Node_getEventDispatcher);\n        tolua_function(tolua_S,\"setSkewX\",lua_cocos2dx_Node_setSkewX);\n        tolua_function(tolua_S,\"setSkewY\",lua_cocos2dx_Node_setSkewY);\n        tolua_function(tolua_S,\"getOpacity\",lua_cocos2dx_Node_getOpacity);\n        tolua_function(tolua_S,\"convertTouchToNodeSpace\",lua_cocos2dx_Node_convertTouchToNodeSpace);\n        tolua_function(tolua_S,\"removeAllChildren\",lua_cocos2dx_Node_removeAllChildrenWithCleanup);\n        tolua_function(tolua_S,\"getRotationX\",lua_cocos2dx_Node_getRotationX);\n        tolua_function(tolua_S,\"getRotationY\",lua_cocos2dx_Node_getRotationY);\n        tolua_function(tolua_S,\"getNodeToParentAffineTransform\",lua_cocos2dx_Node_getNodeToParentAffineTransform);\n        tolua_function(tolua_S,\"isCascadeOpacityEnabled\",lua_cocos2dx_Node_isCascadeOpacityEnabled);\n        tolua_function(tolua_S,\"setParent\",lua_cocos2dx_Node_setParent);\n        tolua_function(tolua_S,\"getNodeToParentTransform\",lua_cocos2dx_Node_getNodeToParentTransform);\n        tolua_function(tolua_S,\"resume\",lua_cocos2dx_Node_resume);\n        tolua_function(tolua_S,\"getPhysicsBody\",lua_cocos2dx_Node_getPhysicsBody);\n        tolua_function(tolua_S,\"setPosition\",lua_cocos2dx_Node_setPosition);\n        tolua_function(tolua_S,\"stopActionByTag\",lua_cocos2dx_Node_stopActionByTag);\n        tolua_function(tolua_S,\"reorderChild\",lua_cocos2dx_Node_reorderChild);\n        tolua_function(tolua_S,\"ignoreAnchorPointForPosition\",lua_cocos2dx_Node_ignoreAnchorPointForPosition);\n        tolua_function(tolua_S,\"setColor\",lua_cocos2dx_Node_setColor);\n        tolua_function(tolua_S,\"setPositionY\",lua_cocos2dx_Node_setPositionY);\n        tolua_function(tolua_S,\"setPositionX\",lua_cocos2dx_Node_setPositionX);\n        tolua_function(tolua_S,\"setNodeToParentTransform\",lua_cocos2dx_Node_setNodeToParentTransform);\n        tolua_function(tolua_S,\"getAnchorPoint\",lua_cocos2dx_Node_getAnchorPoint);\n        tolua_function(tolua_S,\"getNumberOfRunningActions\",lua_cocos2dx_Node_getNumberOfRunningActions);\n        tolua_function(tolua_S,\"updateTransform\",lua_cocos2dx_Node_updateTransform);\n        tolua_function(tolua_S,\"isVisible\",lua_cocos2dx_Node_isVisible);\n        tolua_function(tolua_S,\"getChildrenCount\",lua_cocos2dx_Node_getChildrenCount);\n        tolua_function(tolua_S,\"convertToNodeSpaceAR\",lua_cocos2dx_Node_convertToNodeSpaceAR);\n        tolua_function(tolua_S,\"addComponent\",lua_cocos2dx_Node_addComponent);\n        tolua_function(tolua_S,\"visit\",lua_cocos2dx_Node_visit);\n        tolua_function(tolua_S,\"setShaderProgram\",lua_cocos2dx_Node_setShaderProgram);\n        tolua_function(tolua_S,\"getRotation\",lua_cocos2dx_Node_getRotation);\n        tolua_function(tolua_S,\"getAnchorPointInPoints\",lua_cocos2dx_Node_getAnchorPointInPoints);\n        tolua_function(tolua_S,\"runAction\",lua_cocos2dx_Node_runAction);\n        tolua_function(tolua_S,\"transform\",lua_cocos2dx_Node_transform);\n        tolua_function(tolua_S,\"setVertexZ\",lua_cocos2dx_Node_setVertexZ);\n        tolua_function(tolua_S,\"setScheduler\",lua_cocos2dx_Node_setScheduler);\n        tolua_function(tolua_S,\"stopAllActions\",lua_cocos2dx_Node_stopAllActions);\n        tolua_function(tolua_S,\"getSkewX\",lua_cocos2dx_Node_getSkewX);\n        tolua_function(tolua_S,\"getSkewY\",lua_cocos2dx_Node_getSkewY);\n        tolua_function(tolua_S,\"getDisplayedColor\",lua_cocos2dx_Node_getDisplayedColor);\n        tolua_function(tolua_S,\"getActionByTag\",lua_cocos2dx_Node_getActionByTag);\n        tolua_function(tolua_S,\"setRotationX\",lua_cocos2dx_Node_setRotationX);\n        tolua_function(tolua_S,\"setRotationY\",lua_cocos2dx_Node_setRotationY);\n        tolua_function(tolua_S,\"setAdditionalTransform\",lua_cocos2dx_Node_setAdditionalTransform);\n        tolua_function(tolua_S,\"getDisplayedOpacity\",lua_cocos2dx_Node_getDisplayedOpacity);\n        tolua_function(tolua_S,\"getLocalZOrder\",lua_cocos2dx_Node_getLocalZOrder);\n        tolua_function(tolua_S,\"getScheduler\",lua_cocos2dx_Node_getScheduler);\n        tolua_function(tolua_S,\"getParentToNodeAffineTransform\",lua_cocos2dx_Node_getParentToNodeAffineTransform);\n        tolua_function(tolua_S,\"getOrderOfArrival\",lua_cocos2dx_Node_getOrderOfArrival);\n        tolua_function(tolua_S,\"setActionManager\",lua_cocos2dx_Node_setActionManager);\n        tolua_function(tolua_S,\"isRunning\",lua_cocos2dx_Node_isRunning);\n        tolua_function(tolua_S,\"getParent\",lua_cocos2dx_Node_getParent);\n        tolua_function(tolua_S,\"getPositionY\",lua_cocos2dx_Node_getPositionY);\n        tolua_function(tolua_S,\"getPositionX\",lua_cocos2dx_Node_getPositionX);\n        tolua_function(tolua_S,\"removeChildByTag\",lua_cocos2dx_Node_removeChildByTag);\n        tolua_function(tolua_S,\"updateDisplayedColor\",lua_cocos2dx_Node_updateDisplayedColor);\n        tolua_function(tolua_S,\"setVisible\",lua_cocos2dx_Node_setVisible);\n        tolua_function(tolua_S,\"getParentToNodeTransform\",lua_cocos2dx_Node_getParentToNodeTransform);\n        tolua_function(tolua_S,\"getVertexZ\",lua_cocos2dx_Node_getVertexZ);\n        tolua_function(tolua_S,\"setGlobalZOrder\",lua_cocos2dx_Node_setGlobalZOrder);\n        tolua_function(tolua_S,\"setScale\",lua_cocos2dx_Node_setScale);\n        tolua_function(tolua_S,\"getChildByTag\",lua_cocos2dx_Node_getChildByTag);\n        tolua_function(tolua_S,\"setOrderOfArrival\",lua_cocos2dx_Node_setOrderOfArrival);\n        tolua_function(tolua_S,\"getScaleY\",lua_cocos2dx_Node_getScaleY);\n        tolua_function(tolua_S,\"getScaleX\",lua_cocos2dx_Node_getScaleX);\n        tolua_function(tolua_S,\"setLocalZOrder\",lua_cocos2dx_Node_setLocalZOrder);\n        tolua_function(tolua_S,\"getWorldToNodeAffineTransform\",lua_cocos2dx_Node_getWorldToNodeAffineTransform);\n        tolua_function(tolua_S,\"setCascadeColorEnabled\",lua_cocos2dx_Node_setCascadeColorEnabled);\n        tolua_function(tolua_S,\"setOpacity\",lua_cocos2dx_Node_setOpacity);\n        tolua_function(tolua_S,\"cleanup\",lua_cocos2dx_Node_cleanup);\n        tolua_function(tolua_S,\"getComponent\",lua_cocos2dx_Node_getComponent);\n        tolua_function(tolua_S,\"getContentSize\",lua_cocos2dx_Node_getContentSize);\n        tolua_function(tolua_S,\"getBoundingBox\",lua_cocos2dx_Node_getBoundingBox);\n        tolua_function(tolua_S,\"updatePhysicsTransform\",lua_cocos2dx_Node_updatePhysicsTransform);\n        tolua_function(tolua_S,\"setEventDispatcher\",lua_cocos2dx_Node_setEventDispatcher);\n        tolua_function(tolua_S,\"getGlobalZOrder\",lua_cocos2dx_Node_getGlobalZOrder);\n        tolua_function(tolua_S,\"draw\",lua_cocos2dx_Node_draw);\n        tolua_function(tolua_S,\"transformAncestors\",lua_cocos2dx_Node_transformAncestors);\n        tolua_function(tolua_S,\"setUserObject\",lua_cocos2dx_Node_setUserObject);\n        tolua_function(tolua_S,\"removeFromParent\",lua_cocos2dx_Node_removeFromParentAndCleanup);\n        tolua_function(tolua_S,\"convertTouchToNodeSpaceAR\",lua_cocos2dx_Node_convertTouchToNodeSpaceAR);\n        tolua_function(tolua_S,\"update\",lua_cocos2dx_Node_update);\n        tolua_function(tolua_S,\"sortAllChildren\",lua_cocos2dx_Node_sortAllChildren);\n        tolua_function(tolua_S,\"getWorldToNodeTransform\",lua_cocos2dx_Node_getWorldToNodeTransform);\n        tolua_function(tolua_S,\"getScale\",lua_cocos2dx_Node_getScale);\n        tolua_function(tolua_S,\"convertToNodeSpace\",lua_cocos2dx_Node_convertToNodeSpace);\n        tolua_function(tolua_S,\"setTag\",lua_cocos2dx_Node_setTag);\n        tolua_function(tolua_S,\"isCascadeColorEnabled\",lua_cocos2dx_Node_isCascadeColorEnabled);\n        tolua_function(tolua_S,\"isOpacityModifyRGB\",lua_cocos2dx_Node_isOpacityModifyRGB);\n        tolua_function(tolua_S,\"stopAction\",lua_cocos2dx_Node_stopAction);\n        tolua_function(tolua_S,\"getActionManager\",lua_cocos2dx_Node_getActionManager);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Node_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Node).name();\n    g_luaType[typeName] = \"cc.Node\";\n    g_typeCast[\"Node\"] = \"cc.Node\";\n    return 1;\n}\n\nint lua_cocos2dx_SpriteFrame_clone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_clone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::SpriteFrame* ret = cobj->clone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_clone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setRotated(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setRotated'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotated(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotated\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setRotated'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_initWithTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_initWithTexture'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 5) {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Point arg3;\n            ok &= luaval_to_point(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            cocos2d::Size arg4;\n            ok &= luaval_to_size(tolua_S, 6, &arg4);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithTexture(arg0, arg1, arg2, arg3, arg4);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithTexture(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTexture\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_initWithTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setRectInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setRectInPixels(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRectInPixels\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setRectInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_getTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTexture();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_getTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_getRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Rect& ret = cobj->getRect();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRect\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_getRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setOffsetInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setOffsetInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setOffsetInPixels(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOffsetInPixels\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setOffsetInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_getRectInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getRectInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Rect& ret = cobj->getRectInPixels();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRectInPixels\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_getRectInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setOriginalSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setOriginalSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setOriginalSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOriginalSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setOriginalSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getOriginalSizeInPixels();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOriginalSizeInPixels\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setOriginalSizeInPixels(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOriginalSizeInPixels\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setOffset(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOffset\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_getOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getOffset();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOffset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_isRotated(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_isRotated'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isRotated();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isRotated\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_isRotated'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_initWithTextureFilename(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_initWithTextureFilename'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 5) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Point arg3;\n            ok &= luaval_to_point(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            cocos2d::Size arg4;\n            ok &= luaval_to_size(tolua_S, 6, &arg4);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithTextureFilename(arg0, arg1, arg2, arg3, arg4);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithTextureFilename(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTextureFilename\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_initWithTextureFilename'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_setRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_setRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setRect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_setRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_getOffsetInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOffsetInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getOffsetInPixels();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOffsetInPixels\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_getOffsetInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_getOriginalSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrame_getOriginalSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getOriginalSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOriginalSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_getOriginalSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 5)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Point arg3;\n            ok &= luaval_to_point(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            cocos2d::Size arg4;\n            ok &= luaval_to_size(tolua_S, 6, &arg4);\n            if (!ok) { break; }\n            cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::create(arg0, arg1, arg2, arg3, arg4);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_SpriteFrame_createWithTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SpriteFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 5)\n        {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Point arg3;\n            ok &= luaval_to_point(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            cocos2d::Size arg4;\n            ok &= luaval_to_size(tolua_S, 6, &arg4);\n            if (!ok) { break; }\n            cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::createWithTexture(arg0, arg1, arg2, arg3, arg4);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::SpriteFrame* ret = cocos2d::SpriteFrame::createWithTexture(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"createWithTexture\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrame_createWithTexture'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_SpriteFrame_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SpriteFrame)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SpriteFrame(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SpriteFrame\");\n    tolua_cclass(tolua_S,\"SpriteFrame\",\"cc.SpriteFrame\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SpriteFrame\");\n        tolua_function(tolua_S,\"clone\",lua_cocos2dx_SpriteFrame_clone);\n        tolua_function(tolua_S,\"setRotated\",lua_cocos2dx_SpriteFrame_setRotated);\n        tolua_function(tolua_S,\"setTexture\",lua_cocos2dx_SpriteFrame_setTexture);\n        tolua_function(tolua_S,\"initWithTexture\",lua_cocos2dx_SpriteFrame_initWithTexture);\n        tolua_function(tolua_S,\"setRectInPixels\",lua_cocos2dx_SpriteFrame_setRectInPixels);\n        tolua_function(tolua_S,\"getTexture\",lua_cocos2dx_SpriteFrame_getTexture);\n        tolua_function(tolua_S,\"getRect\",lua_cocos2dx_SpriteFrame_getRect);\n        tolua_function(tolua_S,\"setOffsetInPixels\",lua_cocos2dx_SpriteFrame_setOffsetInPixels);\n        tolua_function(tolua_S,\"getRectInPixels\",lua_cocos2dx_SpriteFrame_getRectInPixels);\n        tolua_function(tolua_S,\"setOriginalSize\",lua_cocos2dx_SpriteFrame_setOriginalSize);\n        tolua_function(tolua_S,\"getOriginalSizeInPixels\",lua_cocos2dx_SpriteFrame_getOriginalSizeInPixels);\n        tolua_function(tolua_S,\"setOriginalSizeInPixels\",lua_cocos2dx_SpriteFrame_setOriginalSizeInPixels);\n        tolua_function(tolua_S,\"setOffset\",lua_cocos2dx_SpriteFrame_setOffset);\n        tolua_function(tolua_S,\"getOffset\",lua_cocos2dx_SpriteFrame_getOffset);\n        tolua_function(tolua_S,\"isRotated\",lua_cocos2dx_SpriteFrame_isRotated);\n        tolua_function(tolua_S,\"initWithTextureFilename\",lua_cocos2dx_SpriteFrame_initWithTextureFilename);\n        tolua_function(tolua_S,\"setRect\",lua_cocos2dx_SpriteFrame_setRect);\n        tolua_function(tolua_S,\"getOffsetInPixels\",lua_cocos2dx_SpriteFrame_getOffsetInPixels);\n        tolua_function(tolua_S,\"getOriginalSize\",lua_cocos2dx_SpriteFrame_getOriginalSize);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_SpriteFrame_create);\n        tolua_function(tolua_S,\"createWithTexture\", lua_cocos2dx_SpriteFrame_createWithTexture);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::SpriteFrame).name();\n    g_luaType[typeName] = \"cc.SpriteFrame\";\n    g_typeCast[\"SpriteFrame\"] = \"cc.SpriteFrame\";\n    return 1;\n}\n\nint lua_cocos2dx_AnimationFrame_setSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationFrame_setSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSpriteFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpriteFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_setSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationFrame_getUserInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationFrame* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::AnimationFrame*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationFrame_getUserInfo'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::ValueMap& ret = cobj->getUserInfo();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::ValueMap& ret = cobj->getUserInfo();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getUserInfo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_getUserInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationFrame_setDelayUnits(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationFrame_setDelayUnits'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDelayUnits(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDelayUnits\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_setDelayUnits'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationFrame_clone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationFrame_clone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::AnimationFrame* ret = cobj->clone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.AnimationFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::AnimationFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_clone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationFrame_getSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationFrame_getSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::SpriteFrame* ret = cobj->getSpriteFrame();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpriteFrame\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_getSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationFrame_getDelayUnits(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationFrame_getDelayUnits'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDelayUnits();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDelayUnits\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_getDelayUnits'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationFrame_setUserInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationFrame* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationFrame*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationFrame_setUserInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMap arg0;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setUserInfo(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUserInfo\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_setUserInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationFrame_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.AnimationFrame\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        cocos2d::SpriteFrame* arg0;\n        double arg1;\n        cocos2d::ValueMap arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        ok &= luaval_to_ccvaluemap(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::AnimationFrame* ret = cocos2d::AnimationFrame::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.AnimationFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::AnimationFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationFrame_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_AnimationFrame_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (AnimationFrame)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_AnimationFrame(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.AnimationFrame\");\n    tolua_cclass(tolua_S,\"AnimationFrame\",\"cc.AnimationFrame\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"AnimationFrame\");\n        tolua_function(tolua_S,\"setSpriteFrame\",lua_cocos2dx_AnimationFrame_setSpriteFrame);\n        tolua_function(tolua_S,\"getUserInfo\",lua_cocos2dx_AnimationFrame_getUserInfo);\n        tolua_function(tolua_S,\"setDelayUnits\",lua_cocos2dx_AnimationFrame_setDelayUnits);\n        tolua_function(tolua_S,\"clone\",lua_cocos2dx_AnimationFrame_clone);\n        tolua_function(tolua_S,\"getSpriteFrame\",lua_cocos2dx_AnimationFrame_getSpriteFrame);\n        tolua_function(tolua_S,\"getDelayUnits\",lua_cocos2dx_AnimationFrame_getDelayUnits);\n        tolua_function(tolua_S,\"setUserInfo\",lua_cocos2dx_AnimationFrame_setUserInfo);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_AnimationFrame_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::AnimationFrame).name();\n    g_luaType[typeName] = \"cc.AnimationFrame\";\n    g_typeCast[\"AnimationFrame\"] = \"cc.AnimationFrame\";\n    return 1;\n}\n\nint lua_cocos2dx_Animation_getLoops(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_getLoops'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getLoops();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLoops\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_getLoops'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_addSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_addSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addSpriteFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSpriteFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_addSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_setRestoreOriginalFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_setRestoreOriginalFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRestoreOriginalFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRestoreOriginalFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_setRestoreOriginalFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_clone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_clone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Animation* ret = cobj->clone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_clone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_getDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_getDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDuration();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDuration\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_getDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_setFrames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_setFrames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocos2d::AnimationFrame *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setFrames(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFrames\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_setFrames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_getFrames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_getFrames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Vector<cocos2d::AnimationFrame *>& ret = cobj->getFrames();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFrames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_getFrames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_setLoops(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_setLoops'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLoops(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLoops\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_setLoops'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_setDelayPerUnit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_setDelayPerUnit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDelayPerUnit(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDelayPerUnit\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_setDelayPerUnit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_addSpriteFrameWithFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_addSpriteFrameWithFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addSpriteFrameWithFile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSpriteFrameWithFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_addSpriteFrameWithFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_getTotalDelayUnits(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_getTotalDelayUnits'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getTotalDelayUnits();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTotalDelayUnits\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_getTotalDelayUnits'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_getDelayPerUnit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_getDelayPerUnit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDelayPerUnit();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDelayPerUnit\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_getDelayPerUnit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_getRestoreOriginalFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_getRestoreOriginalFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getRestoreOriginalFrame();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRestoreOriginalFrame\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_getRestoreOriginalFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_addSpriteFrameWithTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animation_addSpriteFrameWithTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Texture2D* arg0;\n        cocos2d::Rect arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_rect(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->addSpriteFrameWithTexture(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSpriteFrameWithTexture\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_addSpriteFrameWithTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animation_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Vector<cocos2d::AnimationFrame *> arg0;\n            ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::Animation* ret = cocos2d::Animation::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Vector<cocos2d::AnimationFrame *> arg0;\n            ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            unsigned int arg2;\n            ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Animation* ret = cocos2d::Animation::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::Animation* ret = cocos2d::Animation::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Animation_createWithSpriteFrames(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Animation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Vector<cocos2d::SpriteFrame *> arg0;\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Vector<cocos2d::SpriteFrame *> arg0;\n        double arg1;\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::Animation* ret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithSpriteFrames\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animation_createWithSpriteFrames'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Animation_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Animation)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Animation(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Animation\");\n    tolua_cclass(tolua_S,\"Animation\",\"cc.Animation\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Animation\");\n        tolua_function(tolua_S,\"getLoops\",lua_cocos2dx_Animation_getLoops);\n        tolua_function(tolua_S,\"addSpriteFrame\",lua_cocos2dx_Animation_addSpriteFrame);\n        tolua_function(tolua_S,\"setRestoreOriginalFrame\",lua_cocos2dx_Animation_setRestoreOriginalFrame);\n        tolua_function(tolua_S,\"clone\",lua_cocos2dx_Animation_clone);\n        tolua_function(tolua_S,\"getDuration\",lua_cocos2dx_Animation_getDuration);\n        tolua_function(tolua_S,\"setFrames\",lua_cocos2dx_Animation_setFrames);\n        tolua_function(tolua_S,\"getFrames\",lua_cocos2dx_Animation_getFrames);\n        tolua_function(tolua_S,\"setLoops\",lua_cocos2dx_Animation_setLoops);\n        tolua_function(tolua_S,\"setDelayPerUnit\",lua_cocos2dx_Animation_setDelayPerUnit);\n        tolua_function(tolua_S,\"addSpriteFrameWithFile\",lua_cocos2dx_Animation_addSpriteFrameWithFile);\n        tolua_function(tolua_S,\"getTotalDelayUnits\",lua_cocos2dx_Animation_getTotalDelayUnits);\n        tolua_function(tolua_S,\"getDelayPerUnit\",lua_cocos2dx_Animation_getDelayPerUnit);\n        tolua_function(tolua_S,\"getRestoreOriginalFrame\",lua_cocos2dx_Animation_getRestoreOriginalFrame);\n        tolua_function(tolua_S,\"addSpriteFrameWithTexture\",lua_cocos2dx_Animation_addSpriteFrameWithTexture);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Animation_create);\n        tolua_function(tolua_S,\"createWithSpriteFrames\", lua_cocos2dx_Animation_createWithSpriteFrames);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Animation).name();\n    g_luaType[typeName] = \"cc.Animation\";\n    g_typeCast[\"Animation\"] = \"cc.Animation\";\n    return 1;\n}\n\nint lua_cocos2dx_ActionInterval_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionInterval* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionInterval\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionInterval_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionInterval_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionInterval_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionInterval* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionInterval\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionInterval_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionInterval_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionInterval_getElapsed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionInterval* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionInterval\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionInterval_getElapsed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getElapsed();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getElapsed\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionInterval_getElapsed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_ActionInterval_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionInterval)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ActionInterval(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ActionInterval\");\n    tolua_cclass(tolua_S,\"ActionInterval\",\"cc.ActionInterval\",\"cc.FiniteTimeAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionInterval\");\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_ActionInterval_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_ActionInterval_setAmplitudeRate);\n        tolua_function(tolua_S,\"getElapsed\",lua_cocos2dx_ActionInterval_getElapsed);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ActionInterval).name();\n    g_luaType[typeName] = \"cc.ActionInterval\";\n    g_typeCast[\"ActionInterval\"] = \"cc.ActionInterval\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_Sequence_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Sequence)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Sequence(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Sequence\");\n    tolua_cclass(tolua_S,\"Sequence\",\"cc.Sequence\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Sequence\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Sequence).name();\n    g_luaType[typeName] = \"cc.Sequence\";\n    g_typeCast[\"Sequence\"] = \"cc.Sequence\";\n    return 1;\n}\n\nint lua_cocos2dx_Repeat_setInnerAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Repeat* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Repeat\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Repeat*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Repeat_setInnerAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::FiniteTimeAction* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.FiniteTimeAction\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::FiniteTimeAction*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setInnerAction(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInnerAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Repeat_setInnerAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Repeat_getInnerAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Repeat* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Repeat\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Repeat*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Repeat_getInnerAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::FiniteTimeAction* ret = cobj->getInnerAction();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FiniteTimeAction\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FiniteTimeAction*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInnerAction\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Repeat_getInnerAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Repeat_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Repeat\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::FiniteTimeAction* arg0;\n        unsigned int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.FiniteTimeAction\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::FiniteTimeAction*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_uint32(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::Repeat* ret = cocos2d::Repeat::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Repeat\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Repeat*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Repeat_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Repeat_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Repeat)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Repeat(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Repeat\");\n    tolua_cclass(tolua_S,\"Repeat\",\"cc.Repeat\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Repeat\");\n        tolua_function(tolua_S,\"setInnerAction\",lua_cocos2dx_Repeat_setInnerAction);\n        tolua_function(tolua_S,\"getInnerAction\",lua_cocos2dx_Repeat_getInnerAction);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Repeat_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Repeat).name();\n    g_luaType[typeName] = \"cc.Repeat\";\n    g_typeCast[\"Repeat\"] = \"cc.Repeat\";\n    return 1;\n}\n\nint lua_cocos2dx_RepeatForever_setInnerAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RepeatForever* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RepeatForever\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RepeatForever*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RepeatForever_setInnerAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setInnerAction(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInnerAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RepeatForever_setInnerAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RepeatForever_getInnerAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RepeatForever* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RepeatForever\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RepeatForever*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RepeatForever_getInnerAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->getInnerAction();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInnerAction\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RepeatForever_getInnerAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RepeatForever_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.RepeatForever\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::RepeatForever* ret = cocos2d::RepeatForever::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RepeatForever\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RepeatForever*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RepeatForever_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_RepeatForever_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (RepeatForever)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_RepeatForever(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.RepeatForever\");\n    tolua_cclass(tolua_S,\"RepeatForever\",\"cc.RepeatForever\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"RepeatForever\");\n        tolua_function(tolua_S,\"setInnerAction\",lua_cocos2dx_RepeatForever_setInnerAction);\n        tolua_function(tolua_S,\"getInnerAction\",lua_cocos2dx_RepeatForever_getInnerAction);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_RepeatForever_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::RepeatForever).name();\n    g_luaType[typeName] = \"cc.RepeatForever\";\n    g_typeCast[\"RepeatForever\"] = \"cc.RepeatForever\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_Spawn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Spawn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Spawn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Spawn\");\n    tolua_cclass(tolua_S,\"Spawn\",\"cc.Spawn\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Spawn\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Spawn).name();\n    g_luaType[typeName] = \"cc.Spawn\";\n    g_typeCast[\"Spawn\"] = \"cc.Spawn\";\n    return 1;\n}\n\nint lua_cocos2dx_RotateTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.RotateTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RotateTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RotateTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::RotateTo* ret = cocos2d::RotateTo::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RotateTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RotateTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RotateTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_RotateTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (RotateTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_RotateTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.RotateTo\");\n    tolua_cclass(tolua_S,\"RotateTo\",\"cc.RotateTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"RotateTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_RotateTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::RotateTo).name();\n    g_luaType[typeName] = \"cc.RotateTo\";\n    g_typeCast[\"RotateTo\"] = \"cc.RotateTo\";\n    return 1;\n}\n\nint lua_cocos2dx_RotateBy_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.RotateBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RotateBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RotateBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::RotateBy* ret = cocos2d::RotateBy::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RotateBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RotateBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RotateBy_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_RotateBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (RotateBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_RotateBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.RotateBy\");\n    tolua_cclass(tolua_S,\"RotateBy\",\"cc.RotateBy\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"RotateBy\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_RotateBy_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::RotateBy).name();\n    g_luaType[typeName] = \"cc.RotateBy\";\n    g_typeCast[\"RotateBy\"] = \"cc.RotateBy\";\n    return 1;\n}\n\nint lua_cocos2dx_MoveBy_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.MoveBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Point arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::MoveBy* ret = cocos2d::MoveBy::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.MoveBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::MoveBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MoveBy_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_MoveBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MoveBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MoveBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MoveBy\");\n    tolua_cclass(tolua_S,\"MoveBy\",\"cc.MoveBy\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MoveBy\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_MoveBy_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MoveBy).name();\n    g_luaType[typeName] = \"cc.MoveBy\";\n    g_typeCast[\"MoveBy\"] = \"cc.MoveBy\";\n    return 1;\n}\n\nint lua_cocos2dx_MoveTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.MoveTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Point arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::MoveTo* ret = cocos2d::MoveTo::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.MoveTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::MoveTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MoveTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_MoveTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MoveTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MoveTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MoveTo\");\n    tolua_cclass(tolua_S,\"MoveTo\",\"cc.MoveTo\",\"cc.MoveBy\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MoveTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_MoveTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MoveTo).name();\n    g_luaType[typeName] = \"cc.MoveTo\";\n    g_typeCast[\"MoveTo\"] = \"cc.MoveTo\";\n    return 1;\n}\n\nint lua_cocos2dx_SkewTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SkewTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::SkewTo* ret = cocos2d::SkewTo::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SkewTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SkewTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SkewTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_SkewTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SkewTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SkewTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SkewTo\");\n    tolua_cclass(tolua_S,\"SkewTo\",\"cc.SkewTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SkewTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_SkewTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::SkewTo).name();\n    g_luaType[typeName] = \"cc.SkewTo\";\n    g_typeCast[\"SkewTo\"] = \"cc.SkewTo\";\n    return 1;\n}\n\nint lua_cocos2dx_SkewBy_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SkewBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::SkewBy* ret = cocos2d::SkewBy::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SkewBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SkewBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SkewBy_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_SkewBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SkewBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SkewBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SkewBy\");\n    tolua_cclass(tolua_S,\"SkewBy\",\"cc.SkewBy\",\"cc.SkewTo\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SkewBy\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_SkewBy_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::SkewBy).name();\n    g_luaType[typeName] = \"cc.SkewBy\";\n    g_typeCast[\"SkewBy\"] = \"cc.SkewBy\";\n    return 1;\n}\n\nint lua_cocos2dx_JumpBy_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.JumpBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Point arg1;\n        double arg2;\n        int arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::JumpBy* ret = cocos2d::JumpBy::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.JumpBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::JumpBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_JumpBy_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_JumpBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (JumpBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_JumpBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.JumpBy\");\n    tolua_cclass(tolua_S,\"JumpBy\",\"cc.JumpBy\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"JumpBy\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_JumpBy_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::JumpBy).name();\n    g_luaType[typeName] = \"cc.JumpBy\";\n    g_typeCast[\"JumpBy\"] = \"cc.JumpBy\";\n    return 1;\n}\n\nint lua_cocos2dx_JumpTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.JumpTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Point arg1;\n        double arg2;\n        int arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::JumpTo* ret = cocos2d::JumpTo::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.JumpTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::JumpTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_JumpTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_JumpTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (JumpTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_JumpTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.JumpTo\");\n    tolua_cclass(tolua_S,\"JumpTo\",\"cc.JumpTo\",\"cc.JumpBy\",NULL);\n\n    tolua_beginmodule(tolua_S,\"JumpTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_JumpTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::JumpTo).name();\n    g_luaType[typeName] = \"cc.JumpTo\";\n    g_typeCast[\"JumpTo\"] = \"cc.JumpTo\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_BezierBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (BezierBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_BezierBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.BezierBy\");\n    tolua_cclass(tolua_S,\"BezierBy\",\"cc.BezierBy\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"BezierBy\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::BezierBy).name();\n    g_luaType[typeName] = \"cc.BezierBy\";\n    g_typeCast[\"BezierBy\"] = \"cc.BezierBy\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_BezierTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (BezierTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_BezierTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.BezierTo\");\n    tolua_cclass(tolua_S,\"BezierTo\",\"cc.BezierTo\",\"cc.BezierBy\",NULL);\n\n    tolua_beginmodule(tolua_S,\"BezierTo\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::BezierTo).name();\n    g_luaType[typeName] = \"cc.BezierTo\";\n    g_typeCast[\"BezierTo\"] = \"cc.BezierTo\";\n    return 1;\n}\n\nint lua_cocos2dx_ScaleTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ScaleTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ScaleTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ScaleTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::ScaleTo* ret = cocos2d::ScaleTo::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ScaleTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ScaleTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ScaleTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ScaleTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ScaleTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ScaleTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ScaleTo\");\n    tolua_cclass(tolua_S,\"ScaleTo\",\"cc.ScaleTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ScaleTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ScaleTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ScaleTo).name();\n    g_luaType[typeName] = \"cc.ScaleTo\";\n    g_typeCast[\"ScaleTo\"] = \"cc.ScaleTo\";\n    return 1;\n}\n\nint lua_cocos2dx_ScaleBy_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ScaleBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ScaleBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ScaleBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::ScaleBy* ret = cocos2d::ScaleBy::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ScaleBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ScaleBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ScaleBy_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ScaleBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ScaleBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ScaleBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ScaleBy\");\n    tolua_cclass(tolua_S,\"ScaleBy\",\"cc.ScaleBy\",\"cc.ScaleTo\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ScaleBy\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ScaleBy_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ScaleBy).name();\n    g_luaType[typeName] = \"cc.ScaleBy\";\n    g_typeCast[\"ScaleBy\"] = \"cc.ScaleBy\";\n    return 1;\n}\n\nint lua_cocos2dx_Blink_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Blink\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        int arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::Blink* ret = cocos2d::Blink::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Blink\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Blink*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Blink_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Blink_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Blink)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Blink(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Blink\");\n    tolua_cclass(tolua_S,\"Blink\",\"cc.Blink\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Blink\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Blink_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Blink).name();\n    g_luaType[typeName] = \"cc.Blink\";\n    g_typeCast[\"Blink\"] = \"cc.Blink\";\n    return 1;\n}\n\nint lua_cocos2dx_FadeIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FadeIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::FadeIn* ret = cocos2d::FadeIn::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FadeIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FadeIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FadeIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FadeIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FadeIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FadeIn\");\n    tolua_cclass(tolua_S,\"FadeIn\",\"cc.FadeIn\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FadeIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FadeIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FadeIn).name();\n    g_luaType[typeName] = \"cc.FadeIn\";\n    g_typeCast[\"FadeIn\"] = \"cc.FadeIn\";\n    return 1;\n}\n\nint lua_cocos2dx_FadeOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FadeOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::FadeOut* ret = cocos2d::FadeOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FadeOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FadeOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FadeOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FadeOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FadeOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FadeOut\");\n    tolua_cclass(tolua_S,\"FadeOut\",\"cc.FadeOut\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FadeOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FadeOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FadeOut).name();\n    g_luaType[typeName] = \"cc.FadeOut\";\n    g_typeCast[\"FadeOut\"] = \"cc.FadeOut\";\n    return 1;\n}\n\nint lua_cocos2dx_FadeTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FadeTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        uint16_t arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_uint16(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::FadeTo* ret = cocos2d::FadeTo::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FadeTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FadeTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FadeTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FadeTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FadeTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FadeTo\");\n    tolua_cclass(tolua_S,\"FadeTo\",\"cc.FadeTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FadeTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FadeTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FadeTo).name();\n    g_luaType[typeName] = \"cc.FadeTo\";\n    g_typeCast[\"FadeTo\"] = \"cc.FadeTo\";\n    return 1;\n}\n\nint lua_cocos2dx_TintTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TintTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        uint16_t arg1;\n        uint16_t arg2;\n        uint16_t arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_uint16(tolua_S, 3,&arg1);\n        ok &= luaval_to_uint16(tolua_S, 4,&arg2);\n        ok &= luaval_to_uint16(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::TintTo* ret = cocos2d::TintTo::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TintTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TintTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TintTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TintTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TintTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TintTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TintTo\");\n    tolua_cclass(tolua_S,\"TintTo\",\"cc.TintTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TintTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TintTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TintTo).name();\n    g_luaType[typeName] = \"cc.TintTo\";\n    g_typeCast[\"TintTo\"] = \"cc.TintTo\";\n    return 1;\n}\n\nint lua_cocos2dx_TintBy_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TintBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        int32_t arg1;\n        int32_t arg2;\n        int32_t arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_int32(tolua_S, 3,&arg1);\n        ok &= luaval_to_int32(tolua_S, 4,&arg2);\n        ok &= luaval_to_int32(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::TintBy* ret = cocos2d::TintBy::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TintBy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TintBy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TintBy_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TintBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TintBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TintBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TintBy\");\n    tolua_cclass(tolua_S,\"TintBy\",\"cc.TintBy\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TintBy\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TintBy_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TintBy).name();\n    g_luaType[typeName] = \"cc.TintBy\";\n    g_typeCast[\"TintBy\"] = \"cc.TintBy\";\n    return 1;\n}\n\nint lua_cocos2dx_DelayTime_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.DelayTime\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::DelayTime* ret = cocos2d::DelayTime::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.DelayTime\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::DelayTime*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DelayTime_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_DelayTime_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (DelayTime)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_DelayTime(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.DelayTime\");\n    tolua_cclass(tolua_S,\"DelayTime\",\"cc.DelayTime\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"DelayTime\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_DelayTime_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::DelayTime).name();\n    g_luaType[typeName] = \"cc.DelayTime\";\n    g_typeCast[\"DelayTime\"] = \"cc.DelayTime\";\n    return 1;\n}\n\nint lua_cocos2dx_Animate_getAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animate* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animate\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Animate*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animate_getAnimation'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::Animation* ret = cobj->getAnimation();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::Animation* ret = cobj->getAnimation();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animate_getAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animate_setAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Animate* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Animate\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Animate*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Animate_setAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Animation* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Animation\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Animation*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setAnimation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animate_setAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Animate_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Animate\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Animation* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Animation\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Animation*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Animate* ret = cocos2d::Animate::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animate\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animate*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Animate_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Animate_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Animate)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Animate(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Animate\");\n    tolua_cclass(tolua_S,\"Animate\",\"cc.Animate\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Animate\");\n        tolua_function(tolua_S,\"getAnimation\",lua_cocos2dx_Animate_getAnimation);\n        tolua_function(tolua_S,\"setAnimation\",lua_cocos2dx_Animate_setAnimation);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Animate_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Animate).name();\n    g_luaType[typeName] = \"cc.Animate\";\n    g_typeCast[\"Animate\"] = \"cc.Animate\";\n    return 1;\n}\n\nint lua_cocos2dx_TargetedAction_getForcedTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TargetedAction* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TargetedAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TargetedAction*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TargetedAction_getForcedTarget'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::Node* ret = cobj->getForcedTarget();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::Node* ret = cobj->getForcedTarget();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getForcedTarget\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TargetedAction_getForcedTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TargetedAction_setForcedTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TargetedAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TargetedAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TargetedAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TargetedAction_setForcedTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setForcedTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setForcedTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TargetedAction_setForcedTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TargetedAction_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TargetedAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::Node* arg0;\n        cocos2d::FiniteTimeAction* arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.FiniteTimeAction\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::FiniteTimeAction*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TargetedAction* ret = cocos2d::TargetedAction::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TargetedAction\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TargetedAction*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TargetedAction_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TargetedAction_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TargetedAction)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TargetedAction(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TargetedAction\");\n    tolua_cclass(tolua_S,\"TargetedAction\",\"cc.TargetedAction\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TargetedAction\");\n        tolua_function(tolua_S,\"getForcedTarget\",lua_cocos2dx_TargetedAction_getForcedTarget);\n        tolua_function(tolua_S,\"setForcedTarget\",lua_cocos2dx_TargetedAction_setForcedTarget);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TargetedAction_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TargetedAction).name();\n    g_luaType[typeName] = \"cc.TargetedAction\";\n    g_typeCast[\"TargetedAction\"] = \"cc.TargetedAction\";\n    return 1;\n}\n\nint lua_cocos2dx_ActionCamera_setEye(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionCamera* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::ActionCamera*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionCamera_setEye'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 3) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cobj->setEye(arg0, arg1, arg2);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            kmVec3 arg0;\n            #pragma warning NO CONVERSION TO NATIVE FOR kmVec3;\n\n            if (!ok) { break; }\n            cobj->setEye(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEye\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionCamera_setEye'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionCamera_getEye(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionCamera*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionCamera_getEye'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const kmVec3& ret = cobj->getEye();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmVec3;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEye\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionCamera_getEye'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionCamera_setUp(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionCamera*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionCamera_setUp'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        kmVec3 arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR kmVec3;\n        if(!ok)\n            return 0;\n        cobj->setUp(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUp\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionCamera_setUp'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionCamera_getCenter(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionCamera*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionCamera_getCenter'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const kmVec3& ret = cobj->getCenter();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmVec3;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCenter\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionCamera_getCenter'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionCamera_setCenter(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionCamera*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionCamera_setCenter'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        kmVec3 arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR kmVec3;\n        if(!ok)\n            return 0;\n        cobj->setCenter(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCenter\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionCamera_setCenter'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionCamera_getUp(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionCamera*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionCamera_getUp'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const kmVec3& ret = cobj->getUp();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmVec3;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getUp\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionCamera_getUp'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionCamera_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::ActionCamera();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ActionCamera\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ActionCamera\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ActionCamera\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionCamera_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_ActionCamera_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionCamera)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ActionCamera(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ActionCamera\");\n    tolua_cclass(tolua_S,\"ActionCamera\",\"cc.ActionCamera\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionCamera\");\n        tolua_function(tolua_S,\"setEye\",lua_cocos2dx_ActionCamera_setEye);\n        tolua_function(tolua_S,\"getEye\",lua_cocos2dx_ActionCamera_getEye);\n        tolua_function(tolua_S,\"setUp\",lua_cocos2dx_ActionCamera_setUp);\n        tolua_function(tolua_S,\"getCenter\",lua_cocos2dx_ActionCamera_getCenter);\n        tolua_function(tolua_S,\"setCenter\",lua_cocos2dx_ActionCamera_setCenter);\n        tolua_function(tolua_S,\"getUp\",lua_cocos2dx_ActionCamera_getUp);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_ActionCamera_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ActionCamera).name();\n    g_luaType[typeName] = \"cc.ActionCamera\";\n    g_typeCast[\"ActionCamera\"] = \"cc.ActionCamera\";\n    return 1;\n}\n\nint lua_cocos2dx_OrbitCamera_sphericalRadius(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::OrbitCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.OrbitCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::OrbitCamera*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_OrbitCamera_sphericalRadius'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        float* arg0;\n        float* arg1;\n        float* arg2;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR float*;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR float*;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR float*;\n        if(!ok)\n            return 0;\n        cobj->sphericalRadius(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"sphericalRadius\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_OrbitCamera_sphericalRadius'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_OrbitCamera_initWithDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::OrbitCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.OrbitCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::OrbitCamera*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_OrbitCamera_initWithDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 7) \n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        double arg3;\n        double arg4;\n        double arg5;\n        double arg6;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n\n        ok &= luaval_to_number(tolua_S, 6,&arg4);\n\n        ok &= luaval_to_number(tolua_S, 7,&arg5);\n\n        ok &= luaval_to_number(tolua_S, 8,&arg6);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3, arg4, arg5, arg6);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithDuration\",argc, 7);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_OrbitCamera_initWithDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_OrbitCamera_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.OrbitCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 7)\n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        double arg3;\n        double arg4;\n        double arg5;\n        double arg6;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        ok &= luaval_to_number(tolua_S, 6,&arg4);\n        ok &= luaval_to_number(tolua_S, 7,&arg5);\n        ok &= luaval_to_number(tolua_S, 8,&arg6);\n        if(!ok)\n            return 0;\n        cocos2d::OrbitCamera* ret = cocos2d::OrbitCamera::create(arg0, arg1, arg2, arg3, arg4, arg5, arg6);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.OrbitCamera\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::OrbitCamera*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 7);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_OrbitCamera_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_OrbitCamera_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::OrbitCamera* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::OrbitCamera();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.OrbitCamera\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.OrbitCamera\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"OrbitCamera\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_OrbitCamera_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_OrbitCamera_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (OrbitCamera)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_OrbitCamera(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.OrbitCamera\");\n    tolua_cclass(tolua_S,\"OrbitCamera\",\"cc.OrbitCamera\",\"cc.ActionCamera\",NULL);\n\n    tolua_beginmodule(tolua_S,\"OrbitCamera\");\n        tolua_function(tolua_S,\"sphericalRadius\",lua_cocos2dx_OrbitCamera_sphericalRadius);\n        tolua_function(tolua_S,\"initWithDuration\",lua_cocos2dx_OrbitCamera_initWithDuration);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_OrbitCamera_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_OrbitCamera_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::OrbitCamera).name();\n    g_luaType[typeName] = \"cc.OrbitCamera\";\n    g_typeCast[\"OrbitCamera\"] = \"cc.OrbitCamera\";\n    return 1;\n}\n\nint lua_cocos2dx_ActionManager_getActionByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_getActionByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        const cocos2d::Node* arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (const cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Action* ret = cobj->getActionByTag(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Action\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Action*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getActionByTag\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_getActionByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_removeActionByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_removeActionByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        cocos2d::Node* arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeActionByTag(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeActionByTag\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_removeActionByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_removeAllActions(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_removeAllActions'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllActions();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllActions\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_removeAllActions'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_addAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_addAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Action* arg0;\n        cocos2d::Node* arg1;\n        bool arg2;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Action\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Action*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->addAction(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addAction\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_addAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_resumeTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_resumeTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->resumeTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_resumeTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getNumberOfRunningActionsInTarget(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNumberOfRunningActionsInTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_removeAllActionsFromTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_removeAllActionsFromTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeAllActionsFromTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllActionsFromTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_removeAllActionsFromTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_resumeTargets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_resumeTargets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocos2d::Node *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->resumeTargets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeTargets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_resumeTargets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_removeAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_removeAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Action* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Action\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Action*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeAction(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_removeAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_pauseTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_pauseTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->pauseTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_pauseTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_pauseAllRunningActions(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionManager_pauseAllRunningActions'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::Node *> ret = cobj->pauseAllRunningActions();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseAllRunningActions\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_pauseAllRunningActions'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionManager_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::ActionManager();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ActionManager\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ActionManager\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ActionManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionManager_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_ActionManager_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionManager)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ActionManager(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ActionManager\");\n    tolua_cclass(tolua_S,\"ActionManager\",\"cc.ActionManager\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionManager\");\n        tolua_function(tolua_S,\"getActionByTag\",lua_cocos2dx_ActionManager_getActionByTag);\n        tolua_function(tolua_S,\"removeActionByTag\",lua_cocos2dx_ActionManager_removeActionByTag);\n        tolua_function(tolua_S,\"removeAllActions\",lua_cocos2dx_ActionManager_removeAllActions);\n        tolua_function(tolua_S,\"addAction\",lua_cocos2dx_ActionManager_addAction);\n        tolua_function(tolua_S,\"resumeTarget\",lua_cocos2dx_ActionManager_resumeTarget);\n        tolua_function(tolua_S,\"getNumberOfRunningActionsInTarget\",lua_cocos2dx_ActionManager_getNumberOfRunningActionsInTarget);\n        tolua_function(tolua_S,\"removeAllActionsFromTarget\",lua_cocos2dx_ActionManager_removeAllActionsFromTarget);\n        tolua_function(tolua_S,\"resumeTargets\",lua_cocos2dx_ActionManager_resumeTargets);\n        tolua_function(tolua_S,\"removeAction\",lua_cocos2dx_ActionManager_removeAction);\n        tolua_function(tolua_S,\"pauseTarget\",lua_cocos2dx_ActionManager_pauseTarget);\n        tolua_function(tolua_S,\"pauseAllRunningActions\",lua_cocos2dx_ActionManager_pauseAllRunningActions);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_ActionManager_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ActionManager).name();\n    g_luaType[typeName] = \"cc.ActionManager\";\n    g_typeCast[\"ActionManager\"] = \"cc.ActionManager\";\n    return 1;\n}\n\nint lua_cocos2dx_ActionEase_getInnerAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionEase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionEase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionEase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionEase_getInnerAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->getInnerAction();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInnerAction\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionEase_getInnerAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_ActionEase_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionEase)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ActionEase(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ActionEase\");\n    tolua_cclass(tolua_S,\"ActionEase\",\"cc.ActionEase\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionEase\");\n        tolua_function(tolua_S,\"getInnerAction\",lua_cocos2dx_ActionEase_getInnerAction);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ActionEase).name();\n    g_luaType[typeName] = \"cc.ActionEase\";\n    g_typeCast[\"ActionEase\"] = \"cc.ActionEase\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseRateAction_setRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EaseRateAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EaseRateAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EaseRateAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EaseRateAction_setRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseRateAction_setRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EaseRateAction_getRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EaseRateAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EaseRateAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EaseRateAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EaseRateAction_getRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseRateAction_getRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_EaseRateAction_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseRateAction)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseRateAction(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseRateAction\");\n    tolua_cclass(tolua_S,\"EaseRateAction\",\"cc.EaseRateAction\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseRateAction\");\n        tolua_function(tolua_S,\"setRate\",lua_cocos2dx_EaseRateAction_setRate);\n        tolua_function(tolua_S,\"getRate\",lua_cocos2dx_EaseRateAction_getRate);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseRateAction).name();\n    g_luaType[typeName] = \"cc.EaseRateAction\";\n    g_typeCast[\"EaseRateAction\"] = \"cc.EaseRateAction\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::ActionInterval* arg0;\n        double arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::EaseIn* ret = cocos2d::EaseIn::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseIn\");\n    tolua_cclass(tolua_S,\"EaseIn\",\"cc.EaseIn\",\"cc.EaseRateAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseIn).name();\n    g_luaType[typeName] = \"cc.EaseIn\";\n    g_typeCast[\"EaseIn\"] = \"cc.EaseIn\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::ActionInterval* arg0;\n        double arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::EaseOut* ret = cocos2d::EaseOut::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseOut\");\n    tolua_cclass(tolua_S,\"EaseOut\",\"cc.EaseOut\",\"cc.EaseRateAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseOut).name();\n    g_luaType[typeName] = \"cc.EaseOut\";\n    g_typeCast[\"EaseOut\"] = \"cc.EaseOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseInOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseInOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::ActionInterval* arg0;\n        double arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::EaseInOut* ret = cocos2d::EaseInOut::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseInOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseInOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseInOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseInOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseInOut\");\n    tolua_cclass(tolua_S,\"EaseInOut\",\"cc.EaseInOut\",\"cc.EaseRateAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseInOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseInOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseInOut).name();\n    g_luaType[typeName] = \"cc.EaseInOut\";\n    g_typeCast[\"EaseInOut\"] = \"cc.EaseInOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseExponentialIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseExponentialIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseExponentialIn* ret = cocos2d::EaseExponentialIn::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseExponentialIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseExponentialIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseExponentialIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseExponentialIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseExponentialIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseExponentialIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseExponentialIn\");\n    tolua_cclass(tolua_S,\"EaseExponentialIn\",\"cc.EaseExponentialIn\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseExponentialIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseExponentialIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseExponentialIn).name();\n    g_luaType[typeName] = \"cc.EaseExponentialIn\";\n    g_typeCast[\"EaseExponentialIn\"] = \"cc.EaseExponentialIn\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseExponentialOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseExponentialOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseExponentialOut* ret = cocos2d::EaseExponentialOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseExponentialOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseExponentialOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseExponentialOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseExponentialOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseExponentialOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseExponentialOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseExponentialOut\");\n    tolua_cclass(tolua_S,\"EaseExponentialOut\",\"cc.EaseExponentialOut\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseExponentialOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseExponentialOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseExponentialOut).name();\n    g_luaType[typeName] = \"cc.EaseExponentialOut\";\n    g_typeCast[\"EaseExponentialOut\"] = \"cc.EaseExponentialOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseExponentialInOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseExponentialInOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseExponentialInOut* ret = cocos2d::EaseExponentialInOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseExponentialInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseExponentialInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseExponentialInOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseExponentialInOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseExponentialInOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseExponentialInOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseExponentialInOut\");\n    tolua_cclass(tolua_S,\"EaseExponentialInOut\",\"cc.EaseExponentialInOut\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseExponentialInOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseExponentialInOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseExponentialInOut).name();\n    g_luaType[typeName] = \"cc.EaseExponentialInOut\";\n    g_typeCast[\"EaseExponentialInOut\"] = \"cc.EaseExponentialInOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseSineIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseSineIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseSineIn* ret = cocos2d::EaseSineIn::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseSineIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseSineIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseSineIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseSineIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseSineIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseSineIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseSineIn\");\n    tolua_cclass(tolua_S,\"EaseSineIn\",\"cc.EaseSineIn\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseSineIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseSineIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseSineIn).name();\n    g_luaType[typeName] = \"cc.EaseSineIn\";\n    g_typeCast[\"EaseSineIn\"] = \"cc.EaseSineIn\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseSineOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseSineOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseSineOut* ret = cocos2d::EaseSineOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseSineOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseSineOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseSineOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseSineOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseSineOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseSineOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseSineOut\");\n    tolua_cclass(tolua_S,\"EaseSineOut\",\"cc.EaseSineOut\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseSineOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseSineOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseSineOut).name();\n    g_luaType[typeName] = \"cc.EaseSineOut\";\n    g_typeCast[\"EaseSineOut\"] = \"cc.EaseSineOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseSineInOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseSineInOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseSineInOut* ret = cocos2d::EaseSineInOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseSineInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseSineInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseSineInOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseSineInOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseSineInOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseSineInOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseSineInOut\");\n    tolua_cclass(tolua_S,\"EaseSineInOut\",\"cc.EaseSineInOut\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseSineInOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseSineInOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseSineInOut).name();\n    g_luaType[typeName] = \"cc.EaseSineInOut\";\n    g_typeCast[\"EaseSineInOut\"] = \"cc.EaseSineInOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseElastic_setPeriod(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EaseElastic* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EaseElastic\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EaseElastic*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EaseElastic_setPeriod'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPeriod(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPeriod\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseElastic_setPeriod'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EaseElastic_getPeriod(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EaseElastic* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EaseElastic\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EaseElastic*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EaseElastic_getPeriod'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getPeriod();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPeriod\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseElastic_getPeriod'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_EaseElastic_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseElastic)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseElastic(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseElastic\");\n    tolua_cclass(tolua_S,\"EaseElastic\",\"cc.EaseElastic\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseElastic\");\n        tolua_function(tolua_S,\"setPeriod\",lua_cocos2dx_EaseElastic_setPeriod);\n        tolua_function(tolua_S,\"getPeriod\",lua_cocos2dx_EaseElastic_getPeriod);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseElastic).name();\n    g_luaType[typeName] = \"cc.EaseElastic\";\n    g_typeCast[\"EaseElastic\"] = \"cc.EaseElastic\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseElasticIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseElasticIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::ActionInterval* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseElasticIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseElasticIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::ActionInterval* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::EaseElasticIn* ret = cocos2d::EaseElasticIn::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseElasticIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseElasticIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseElasticIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseElasticIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseElasticIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseElasticIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseElasticIn\");\n    tolua_cclass(tolua_S,\"EaseElasticIn\",\"cc.EaseElasticIn\",\"cc.EaseElastic\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseElasticIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseElasticIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseElasticIn).name();\n    g_luaType[typeName] = \"cc.EaseElasticIn\";\n    g_typeCast[\"EaseElasticIn\"] = \"cc.EaseElasticIn\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseElasticOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseElasticOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::ActionInterval* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseElasticOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseElasticOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::ActionInterval* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::EaseElasticOut* ret = cocos2d::EaseElasticOut::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseElasticOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseElasticOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseElasticOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseElasticOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseElasticOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseElasticOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseElasticOut\");\n    tolua_cclass(tolua_S,\"EaseElasticOut\",\"cc.EaseElasticOut\",\"cc.EaseElastic\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseElasticOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseElasticOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseElasticOut).name();\n    g_luaType[typeName] = \"cc.EaseElasticOut\";\n    g_typeCast[\"EaseElasticOut\"] = \"cc.EaseElasticOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseElasticInOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseElasticInOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::ActionInterval* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseElasticInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseElasticInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::ActionInterval* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::EaseElasticInOut* ret = cocos2d::EaseElasticInOut::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseElasticInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseElasticInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseElasticInOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseElasticInOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseElasticInOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseElasticInOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseElasticInOut\");\n    tolua_cclass(tolua_S,\"EaseElasticInOut\",\"cc.EaseElasticInOut\",\"cc.EaseElastic\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseElasticInOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseElasticInOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseElasticInOut).name();\n    g_luaType[typeName] = \"cc.EaseElasticInOut\";\n    g_typeCast[\"EaseElasticInOut\"] = \"cc.EaseElasticInOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseBounce_bounceTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EaseBounce* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EaseBounce\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EaseBounce*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EaseBounce_bounceTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        double ret = cobj->bounceTime(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"bounceTime\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseBounce_bounceTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_EaseBounce_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseBounce)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseBounce(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseBounce\");\n    tolua_cclass(tolua_S,\"EaseBounce\",\"cc.EaseBounce\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseBounce\");\n        tolua_function(tolua_S,\"bounceTime\",lua_cocos2dx_EaseBounce_bounceTime);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseBounce).name();\n    g_luaType[typeName] = \"cc.EaseBounce\";\n    g_typeCast[\"EaseBounce\"] = \"cc.EaseBounce\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseBounceIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseBounceIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseBounceIn* ret = cocos2d::EaseBounceIn::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseBounceIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseBounceIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseBounceIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseBounceIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseBounceIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseBounceIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseBounceIn\");\n    tolua_cclass(tolua_S,\"EaseBounceIn\",\"cc.EaseBounceIn\",\"cc.EaseBounce\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseBounceIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseBounceIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseBounceIn).name();\n    g_luaType[typeName] = \"cc.EaseBounceIn\";\n    g_typeCast[\"EaseBounceIn\"] = \"cc.EaseBounceIn\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseBounceOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseBounceOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseBounceOut* ret = cocos2d::EaseBounceOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseBounceOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseBounceOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseBounceOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseBounceOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseBounceOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseBounceOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseBounceOut\");\n    tolua_cclass(tolua_S,\"EaseBounceOut\",\"cc.EaseBounceOut\",\"cc.EaseBounce\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseBounceOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseBounceOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseBounceOut).name();\n    g_luaType[typeName] = \"cc.EaseBounceOut\";\n    g_typeCast[\"EaseBounceOut\"] = \"cc.EaseBounceOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseBounceInOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseBounceInOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseBounceInOut* ret = cocos2d::EaseBounceInOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseBounceInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseBounceInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseBounceInOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseBounceInOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseBounceInOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseBounceInOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseBounceInOut\");\n    tolua_cclass(tolua_S,\"EaseBounceInOut\",\"cc.EaseBounceInOut\",\"cc.EaseBounce\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseBounceInOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseBounceInOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseBounceInOut).name();\n    g_luaType[typeName] = \"cc.EaseBounceInOut\";\n    g_typeCast[\"EaseBounceInOut\"] = \"cc.EaseBounceInOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseBackIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseBackIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseBackIn* ret = cocos2d::EaseBackIn::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseBackIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseBackIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseBackIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseBackIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseBackIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseBackIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseBackIn\");\n    tolua_cclass(tolua_S,\"EaseBackIn\",\"cc.EaseBackIn\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseBackIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseBackIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseBackIn).name();\n    g_luaType[typeName] = \"cc.EaseBackIn\";\n    g_typeCast[\"EaseBackIn\"] = \"cc.EaseBackIn\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseBackOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseBackOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseBackOut* ret = cocos2d::EaseBackOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseBackOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseBackOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseBackOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseBackOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseBackOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseBackOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseBackOut\");\n    tolua_cclass(tolua_S,\"EaseBackOut\",\"cc.EaseBackOut\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseBackOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseBackOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseBackOut).name();\n    g_luaType[typeName] = \"cc.EaseBackOut\";\n    g_typeCast[\"EaseBackOut\"] = \"cc.EaseBackOut\";\n    return 1;\n}\n\nint lua_cocos2dx_EaseBackInOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EaseBackInOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::ActionInterval* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EaseBackInOut* ret = cocos2d::EaseBackInOut::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EaseBackInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EaseBackInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EaseBackInOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EaseBackInOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EaseBackInOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EaseBackInOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EaseBackInOut\");\n    tolua_cclass(tolua_S,\"EaseBackInOut\",\"cc.EaseBackInOut\",\"cc.ActionEase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EaseBackInOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_EaseBackInOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EaseBackInOut).name();\n    g_luaType[typeName] = \"cc.EaseBackInOut\";\n    g_typeCast[\"EaseBackInOut\"] = \"cc.EaseBackInOut\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_ActionInstant_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionInstant)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ActionInstant(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ActionInstant\");\n    tolua_cclass(tolua_S,\"ActionInstant\",\"cc.ActionInstant\",\"cc.FiniteTimeAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionInstant\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ActionInstant).name();\n    g_luaType[typeName] = \"cc.ActionInstant\";\n    g_typeCast[\"ActionInstant\"] = \"cc.ActionInstant\";\n    return 1;\n}\n\nint lua_cocos2dx_Show_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Show\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Show* ret = cocos2d::Show::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Show\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Show*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Show_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Show_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Show)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Show(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Show\");\n    tolua_cclass(tolua_S,\"Show\",\"cc.Show\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Show\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Show_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Show).name();\n    g_luaType[typeName] = \"cc.Show\";\n    g_typeCast[\"Show\"] = \"cc.Show\";\n    return 1;\n}\n\nint lua_cocos2dx_Hide_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Hide\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Hide* ret = cocos2d::Hide::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Hide\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Hide*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Hide_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Hide_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Hide)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Hide(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Hide\");\n    tolua_cclass(tolua_S,\"Hide\",\"cc.Hide\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Hide\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Hide_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Hide).name();\n    g_luaType[typeName] = \"cc.Hide\";\n    g_typeCast[\"Hide\"] = \"cc.Hide\";\n    return 1;\n}\n\nint lua_cocos2dx_ToggleVisibility_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ToggleVisibility\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ToggleVisibility* ret = cocos2d::ToggleVisibility::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ToggleVisibility\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ToggleVisibility*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ToggleVisibility_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ToggleVisibility_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ToggleVisibility)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ToggleVisibility(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ToggleVisibility\");\n    tolua_cclass(tolua_S,\"ToggleVisibility\",\"cc.ToggleVisibility\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ToggleVisibility\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ToggleVisibility_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ToggleVisibility).name();\n    g_luaType[typeName] = \"cc.ToggleVisibility\";\n    g_typeCast[\"ToggleVisibility\"] = \"cc.ToggleVisibility\";\n    return 1;\n}\n\nint lua_cocos2dx_RemoveSelf_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.RemoveSelf\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RemoveSelf\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RemoveSelf*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 1)\n    {\n        bool arg0;\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::RemoveSelf* ret = cocos2d::RemoveSelf::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RemoveSelf\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RemoveSelf*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RemoveSelf_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_RemoveSelf_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (RemoveSelf)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_RemoveSelf(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.RemoveSelf\");\n    tolua_cclass(tolua_S,\"RemoveSelf\",\"cc.RemoveSelf\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"RemoveSelf\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_RemoveSelf_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::RemoveSelf).name();\n    g_luaType[typeName] = \"cc.RemoveSelf\";\n    g_typeCast[\"RemoveSelf\"] = \"cc.RemoveSelf\";\n    return 1;\n}\n\nint lua_cocos2dx_FlipX_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FlipX\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        bool arg0;\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::FlipX* ret = cocos2d::FlipX::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FlipX\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FlipX*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FlipX_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FlipX_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FlipX)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FlipX(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FlipX\");\n    tolua_cclass(tolua_S,\"FlipX\",\"cc.FlipX\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FlipX\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FlipX_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FlipX).name();\n    g_luaType[typeName] = \"cc.FlipX\";\n    g_typeCast[\"FlipX\"] = \"cc.FlipX\";\n    return 1;\n}\n\nint lua_cocos2dx_FlipY_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FlipY\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        bool arg0;\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::FlipY* ret = cocos2d::FlipY::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FlipY\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FlipY*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FlipY_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FlipY_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FlipY)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FlipY(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FlipY\");\n    tolua_cclass(tolua_S,\"FlipY\",\"cc.FlipY\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FlipY\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FlipY_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FlipY).name();\n    g_luaType[typeName] = \"cc.FlipY\";\n    g_typeCast[\"FlipY\"] = \"cc.FlipY\";\n    return 1;\n}\n\nint lua_cocos2dx_Place_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Place\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Point arg0;\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Place* ret = cocos2d::Place::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Place\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Place*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Place_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Place_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Place)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Place(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Place\");\n    tolua_cclass(tolua_S,\"Place\",\"cc.Place\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Place\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Place_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Place).name();\n    g_luaType[typeName] = \"cc.Place\";\n    g_typeCast[\"Place\"] = \"cc.Place\";\n    return 1;\n}\n\nint lua_cocos2dx_CallFunc_execute(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CallFunc* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CallFunc\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CallFunc*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CallFunc_execute'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->execute();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"execute\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CallFunc_execute'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_CallFunc_getTargetCallback(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CallFunc* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CallFunc\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CallFunc*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CallFunc_getTargetCallback'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Object* ret = cobj->getTargetCallback();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Object\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Object*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTargetCallback\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CallFunc_getTargetCallback'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_CallFunc_setTargetCallback(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CallFunc* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CallFunc\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CallFunc*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CallFunc_setTargetCallback'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Object* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Object\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Object*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTargetCallback(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTargetCallback\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CallFunc_setTargetCallback'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_CallFunc_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CallFunc)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_CallFunc(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.CallFunc\");\n    tolua_cclass(tolua_S,\"CallFunc\",\"cc.CallFunc\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CallFunc\");\n        tolua_function(tolua_S,\"execute\",lua_cocos2dx_CallFunc_execute);\n        tolua_function(tolua_S,\"getTargetCallback\",lua_cocos2dx_CallFunc_getTargetCallback);\n        tolua_function(tolua_S,\"setTargetCallback\",lua_cocos2dx_CallFunc_setTargetCallback);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::CallFunc).name();\n    g_luaType[typeName] = \"cc.CallFunc\";\n    g_typeCast[\"CallFunc\"] = \"cc.CallFunc\";\n    return 1;\n}\n\nint lua_cocos2dx_GridAction_getGrid(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridAction_getGrid'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::GridBase* ret = cobj->getGrid();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GridBase\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GridBase*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGrid\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridAction_getGrid'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_GridAction_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (GridAction)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_GridAction(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.GridAction\");\n    tolua_cclass(tolua_S,\"GridAction\",\"cc.GridAction\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"GridAction\");\n        tolua_function(tolua_S,\"getGrid\",lua_cocos2dx_GridAction_getGrid);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::GridAction).name();\n    g_luaType[typeName] = \"cc.GridAction\";\n    g_typeCast[\"GridAction\"] = \"cc.GridAction\";\n    return 1;\n}\n\nint lua_cocos2dx_Grid3DAction_getGrid(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Grid3DAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Grid3DAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Grid3DAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Grid3DAction_getGrid'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::GridBase* ret = cobj->getGrid();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GridBase\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GridBase*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGrid\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Grid3DAction_getGrid'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_Grid3DAction_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Grid3DAction)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Grid3DAction(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Grid3DAction\");\n    tolua_cclass(tolua_S,\"Grid3DAction\",\"cc.Grid3DAction\",\"cc.GridAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Grid3DAction\");\n        tolua_function(tolua_S,\"getGrid\",lua_cocos2dx_Grid3DAction_getGrid);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Grid3DAction).name();\n    g_luaType[typeName] = \"cc.Grid3DAction\";\n    g_typeCast[\"Grid3DAction\"] = \"cc.Grid3DAction\";\n    return 1;\n}\n\nint lua_cocos2dx_TiledGrid3DAction_getGrid(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TiledGrid3DAction* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TiledGrid3DAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TiledGrid3DAction*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TiledGrid3DAction_getGrid'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::GridBase* ret = cobj->getGrid();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GridBase\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GridBase*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGrid\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TiledGrid3DAction_getGrid'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_TiledGrid3DAction_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TiledGrid3DAction)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TiledGrid3DAction(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TiledGrid3DAction\");\n    tolua_cclass(tolua_S,\"TiledGrid3DAction\",\"cc.TiledGrid3DAction\",\"cc.GridAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TiledGrid3DAction\");\n        tolua_function(tolua_S,\"getGrid\",lua_cocos2dx_TiledGrid3DAction_getGrid);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TiledGrid3DAction).name();\n    g_luaType[typeName] = \"cc.TiledGrid3DAction\";\n    g_typeCast[\"TiledGrid3DAction\"] = \"cc.TiledGrid3DAction\";\n    return 1;\n}\n\nint lua_cocos2dx_StopGrid_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.StopGrid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::StopGrid* ret = cocos2d::StopGrid::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.StopGrid\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::StopGrid*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_StopGrid_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_StopGrid_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (StopGrid)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_StopGrid(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.StopGrid\");\n    tolua_cclass(tolua_S,\"StopGrid\",\"cc.StopGrid\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"StopGrid\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_StopGrid_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::StopGrid).name();\n    g_luaType[typeName] = \"cc.StopGrid\";\n    g_typeCast[\"StopGrid\"] = \"cc.StopGrid\";\n    return 1;\n}\n\nint lua_cocos2dx_ReuseGrid_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ReuseGrid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ReuseGrid* ret = cocos2d::ReuseGrid::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ReuseGrid\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ReuseGrid*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ReuseGrid_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ReuseGrid_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ReuseGrid)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ReuseGrid(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ReuseGrid\");\n    tolua_cclass(tolua_S,\"ReuseGrid\",\"cc.ReuseGrid\",\"cc.ActionInstant\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ReuseGrid\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ReuseGrid_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ReuseGrid).name();\n    g_luaType[typeName] = \"cc.ReuseGrid\";\n    g_typeCast[\"ReuseGrid\"] = \"cc.ReuseGrid\";\n    return 1;\n}\n\nint lua_cocos2dx_Waves3D_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves3D_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves3D_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves3D_setAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves3D_setAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitude(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitude\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves3D_setAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves3D_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves3D_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves3D_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves3D_getAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves3D_getAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitude();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitude\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves3D_getAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Waves3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        unsigned int arg2;\n        double arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::Waves3D* ret = cocos2d::Waves3D::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Waves3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Waves3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Waves3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Waves3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Waves3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Waves3D\");\n    tolua_cclass(tolua_S,\"Waves3D\",\"cc.Waves3D\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Waves3D\");\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_Waves3D_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitude\",lua_cocos2dx_Waves3D_setAmplitude);\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_Waves3D_setAmplitudeRate);\n        tolua_function(tolua_S,\"getAmplitude\",lua_cocos2dx_Waves3D_getAmplitude);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Waves3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Waves3D).name();\n    g_luaType[typeName] = \"cc.Waves3D\";\n    g_typeCast[\"Waves3D\"] = \"cc.Waves3D\";\n    return 1;\n}\n\nint lua_cocos2dx_FlipX3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FlipX3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::FlipX3D* ret = cocos2d::FlipX3D::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FlipX3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FlipX3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FlipX3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FlipX3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FlipX3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FlipX3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FlipX3D\");\n    tolua_cclass(tolua_S,\"FlipX3D\",\"cc.FlipX3D\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FlipX3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FlipX3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FlipX3D).name();\n    g_luaType[typeName] = \"cc.FlipX3D\";\n    g_typeCast[\"FlipX3D\"] = \"cc.FlipX3D\";\n    return 1;\n}\n\nint lua_cocos2dx_FlipY3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FlipY3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::FlipY3D* ret = cocos2d::FlipY3D::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FlipY3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FlipY3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FlipY3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_FlipY3D_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FlipY3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::FlipY3D();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.FlipY3D\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.FlipY3D\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"FlipY3D\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FlipY3D_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_FlipY3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FlipY3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FlipY3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FlipY3D\");\n    tolua_cclass(tolua_S,\"FlipY3D\",\"cc.FlipY3D\",\"cc.FlipX3D\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FlipY3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FlipY3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FlipY3D).name();\n    g_luaType[typeName] = \"cc.FlipY3D\";\n    g_typeCast[\"FlipY3D\"] = \"cc.FlipY3D\";\n    return 1;\n}\n\nint lua_cocos2dx_Lens3D_setPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Lens3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Lens3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Lens3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Lens3D_setPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPosition(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPosition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Lens3D_setPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Lens3D_setConcave(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Lens3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Lens3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Lens3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Lens3D_setConcave'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setConcave(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setConcave\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Lens3D_setConcave'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Lens3D_setLensEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Lens3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Lens3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Lens3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Lens3D_setLensEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLensEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLensEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Lens3D_setLensEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Lens3D_getPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Lens3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Lens3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Lens3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Lens3D_getPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getPosition();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Lens3D_getPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Lens3D_getLensEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Lens3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Lens3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Lens3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Lens3D_getLensEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getLensEffect();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLensEffect\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Lens3D_getLensEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Lens3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Lens3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        cocos2d::Point arg2;\n        double arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::Lens3D* ret = cocos2d::Lens3D::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Lens3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Lens3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Lens3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Lens3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Lens3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Lens3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Lens3D\");\n    tolua_cclass(tolua_S,\"Lens3D\",\"cc.Lens3D\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Lens3D\");\n        tolua_function(tolua_S,\"setPosition\",lua_cocos2dx_Lens3D_setPosition);\n        tolua_function(tolua_S,\"setConcave\",lua_cocos2dx_Lens3D_setConcave);\n        tolua_function(tolua_S,\"setLensEffect\",lua_cocos2dx_Lens3D_setLensEffect);\n        tolua_function(tolua_S,\"getPosition\",lua_cocos2dx_Lens3D_getPosition);\n        tolua_function(tolua_S,\"getLensEffect\",lua_cocos2dx_Lens3D_getLensEffect);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Lens3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Lens3D).name();\n    g_luaType[typeName] = \"cc.Lens3D\";\n    g_typeCast[\"Lens3D\"] = \"cc.Lens3D\";\n    return 1;\n}\n\nint lua_cocos2dx_Ripple3D_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Ripple3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Ripple3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Ripple3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Ripple3D_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Ripple3D_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Ripple3D_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Ripple3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Ripple3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Ripple3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Ripple3D_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Ripple3D_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Ripple3D_setAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Ripple3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Ripple3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Ripple3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Ripple3D_setAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitude(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitude\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Ripple3D_setAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Ripple3D_getAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Ripple3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Ripple3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Ripple3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Ripple3D_getAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitude();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitude\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Ripple3D_getAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Ripple3D_setPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Ripple3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Ripple3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Ripple3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Ripple3D_setPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPosition(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPosition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Ripple3D_setPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Ripple3D_getPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Ripple3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Ripple3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Ripple3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Ripple3D_getPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getPosition();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Ripple3D_getPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Ripple3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Ripple3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 6)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        cocos2d::Point arg2;\n        double arg3;\n        unsigned int arg4;\n        double arg5;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        ok &= luaval_to_uint32(tolua_S, 6,&arg4);\n        ok &= luaval_to_number(tolua_S, 7,&arg5);\n        if(!ok)\n            return 0;\n        cocos2d::Ripple3D* ret = cocos2d::Ripple3D::create(arg0, arg1, arg2, arg3, arg4, arg5);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Ripple3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Ripple3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 6);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Ripple3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Ripple3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Ripple3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Ripple3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Ripple3D\");\n    tolua_cclass(tolua_S,\"Ripple3D\",\"cc.Ripple3D\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Ripple3D\");\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_Ripple3D_setAmplitudeRate);\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_Ripple3D_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitude\",lua_cocos2dx_Ripple3D_setAmplitude);\n        tolua_function(tolua_S,\"getAmplitude\",lua_cocos2dx_Ripple3D_getAmplitude);\n        tolua_function(tolua_S,\"setPosition\",lua_cocos2dx_Ripple3D_setPosition);\n        tolua_function(tolua_S,\"getPosition\",lua_cocos2dx_Ripple3D_getPosition);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Ripple3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Ripple3D).name();\n    g_luaType[typeName] = \"cc.Ripple3D\";\n    g_typeCast[\"Ripple3D\"] = \"cc.Ripple3D\";\n    return 1;\n}\n\nint lua_cocos2dx_Shaky3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Shaky3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        int arg2;\n        bool arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        ok &= luaval_to_boolean(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::Shaky3D* ret = cocos2d::Shaky3D::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Shaky3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Shaky3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Shaky3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Shaky3D_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Shaky3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Shaky3D();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Shaky3D\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Shaky3D\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Shaky3D\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Shaky3D_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Shaky3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Shaky3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Shaky3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Shaky3D\");\n    tolua_cclass(tolua_S,\"Shaky3D\",\"cc.Shaky3D\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Shaky3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Shaky3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Shaky3D).name();\n    g_luaType[typeName] = \"cc.Shaky3D\";\n    g_typeCast[\"Shaky3D\"] = \"cc.Shaky3D\";\n    return 1;\n}\n\nint lua_cocos2dx_Liquid_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Liquid* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Liquid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Liquid*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Liquid_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Liquid_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Liquid_setAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Liquid* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Liquid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Liquid*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Liquid_setAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitude(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitude\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Liquid_setAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Liquid_getAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Liquid* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Liquid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Liquid*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Liquid_getAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitude();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitude\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Liquid_getAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Liquid_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Liquid* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Liquid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Liquid*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Liquid_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Liquid_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Liquid_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Liquid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        unsigned int arg2;\n        double arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::Liquid* ret = cocos2d::Liquid::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Liquid\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Liquid*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Liquid_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Liquid_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Liquid* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Liquid();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Liquid\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Liquid\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Liquid\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Liquid_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Liquid_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Liquid)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Liquid(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Liquid\");\n    tolua_cclass(tolua_S,\"Liquid\",\"cc.Liquid\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Liquid\");\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_Liquid_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitude\",lua_cocos2dx_Liquid_setAmplitude);\n        tolua_function(tolua_S,\"getAmplitude\",lua_cocos2dx_Liquid_getAmplitude);\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_Liquid_setAmplitudeRate);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Liquid_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Liquid_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Liquid).name();\n    g_luaType[typeName] = \"cc.Liquid\";\n    g_typeCast[\"Liquid\"] = \"cc.Liquid\";\n    return 1;\n}\n\nint lua_cocos2dx_Waves_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves_setAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves_setAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitude(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitude\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves_setAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves_getAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves_getAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitude();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitude\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves_getAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Waves\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Waves*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Waves_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Waves_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Waves\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 6)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        unsigned int arg2;\n        double arg3;\n        bool arg4;\n        bool arg5;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        ok &= luaval_to_boolean(tolua_S, 6,&arg4);\n        ok &= luaval_to_boolean(tolua_S, 7,&arg5);\n        if(!ok)\n            return 0;\n        cocos2d::Waves* ret = cocos2d::Waves::create(arg0, arg1, arg2, arg3, arg4, arg5);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Waves\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Waves*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 6);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Waves_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Waves* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Waves();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Waves\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Waves\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Waves\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Waves_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Waves_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Waves)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Waves(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Waves\");\n    tolua_cclass(tolua_S,\"Waves\",\"cc.Waves\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Waves\");\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_Waves_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitude\",lua_cocos2dx_Waves_setAmplitude);\n        tolua_function(tolua_S,\"getAmplitude\",lua_cocos2dx_Waves_getAmplitude);\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_Waves_setAmplitudeRate);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Waves_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Waves_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Waves).name();\n    g_luaType[typeName] = \"cc.Waves\";\n    g_typeCast[\"Waves\"] = \"cc.Waves\";\n    return 1;\n}\n\nint lua_cocos2dx_Twirl_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Twirl* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Twirl\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Twirl*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Twirl_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Twirl_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Twirl* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Twirl\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Twirl*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Twirl_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Twirl_setAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Twirl* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Twirl\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Twirl*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Twirl_setAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitude(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitude\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_setAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Twirl_getAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Twirl* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Twirl\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Twirl*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Twirl_getAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitude();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitude\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_getAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Twirl_setPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Twirl* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Twirl\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Twirl*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Twirl_setPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPosition(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPosition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_setPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Twirl_getPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Twirl* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Twirl\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Twirl*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Twirl_getPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getPosition();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_getPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Twirl_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Twirl\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 5)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        cocos2d::Point arg2;\n        unsigned int arg3;\n        double arg4;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        ok &= luaval_to_uint32(tolua_S, 5,&arg3);\n        ok &= luaval_to_number(tolua_S, 6,&arg4);\n        if(!ok)\n            return 0;\n        cocos2d::Twirl* ret = cocos2d::Twirl::create(arg0, arg1, arg2, arg3, arg4);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Twirl\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Twirl*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 5);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Twirl_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Twirl* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Twirl();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Twirl\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Twirl\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Twirl\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Twirl_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Twirl_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Twirl)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Twirl(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Twirl\");\n    tolua_cclass(tolua_S,\"Twirl\",\"cc.Twirl\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Twirl\");\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_Twirl_setAmplitudeRate);\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_Twirl_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitude\",lua_cocos2dx_Twirl_setAmplitude);\n        tolua_function(tolua_S,\"getAmplitude\",lua_cocos2dx_Twirl_getAmplitude);\n        tolua_function(tolua_S,\"setPosition\",lua_cocos2dx_Twirl_setPosition);\n        tolua_function(tolua_S,\"getPosition\",lua_cocos2dx_Twirl_getPosition);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Twirl_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Twirl_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Twirl).name();\n    g_luaType[typeName] = \"cc.Twirl\";\n    g_typeCast[\"Twirl\"] = \"cc.Twirl\";\n    return 1;\n}\n\nint lua_cocos2dx_PageTurn3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PageTurn3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PageTurn3D* ret = cocos2d::PageTurn3D::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PageTurn3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PageTurn3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_PageTurn3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_PageTurn3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PageTurn3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_PageTurn3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PageTurn3D\");\n    tolua_cclass(tolua_S,\"PageTurn3D\",\"cc.PageTurn3D\",\"cc.Grid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PageTurn3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_PageTurn3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PageTurn3D).name();\n    g_luaType[typeName] = \"cc.PageTurn3D\";\n    g_typeCast[\"PageTurn3D\"] = \"cc.PageTurn3D\";\n    return 1;\n}\n\nint lua_cocos2dx_ProgressTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ProgressTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        double arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::ProgressTo* ret = cocos2d::ProgressTo::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ProgressTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ProgressTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ProgressTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ProgressTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ProgressTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ProgressTo\");\n    tolua_cclass(tolua_S,\"ProgressTo\",\"cc.ProgressTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ProgressTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ProgressTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ProgressTo).name();\n    g_luaType[typeName] = \"cc.ProgressTo\";\n    g_typeCast[\"ProgressTo\"] = \"cc.ProgressTo\";\n    return 1;\n}\n\nint lua_cocos2dx_ProgressFromTo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ProgressFromTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::ProgressFromTo* ret = cocos2d::ProgressFromTo::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ProgressFromTo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ProgressFromTo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressFromTo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ProgressFromTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ProgressFromTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ProgressFromTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ProgressFromTo\");\n    tolua_cclass(tolua_S,\"ProgressFromTo\",\"cc.ProgressFromTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ProgressFromTo\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ProgressFromTo_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ProgressFromTo).name();\n    g_luaType[typeName] = \"cc.ProgressFromTo\";\n    g_typeCast[\"ProgressFromTo\"] = \"cc.ProgressFromTo\";\n    return 1;\n}\n\nint lua_cocos2dx_ShakyTiles3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ShakyTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        int arg2;\n        bool arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        ok &= luaval_to_boolean(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::ShakyTiles3D* ret = cocos2d::ShakyTiles3D::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ShakyTiles3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ShakyTiles3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShakyTiles3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ShakyTiles3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ShakyTiles3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ShakyTiles3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ShakyTiles3D\");\n    tolua_cclass(tolua_S,\"ShakyTiles3D\",\"cc.ShakyTiles3D\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ShakyTiles3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ShakyTiles3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ShakyTiles3D).name();\n    g_luaType[typeName] = \"cc.ShakyTiles3D\";\n    g_typeCast[\"ShakyTiles3D\"] = \"cc.ShakyTiles3D\";\n    return 1;\n}\n\nint lua_cocos2dx_ShatteredTiles3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ShatteredTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        int arg2;\n        bool arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        ok &= luaval_to_boolean(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::ShatteredTiles3D* ret = cocos2d::ShatteredTiles3D::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ShatteredTiles3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ShatteredTiles3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShatteredTiles3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ShatteredTiles3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ShatteredTiles3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ShatteredTiles3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ShatteredTiles3D\");\n    tolua_cclass(tolua_S,\"ShatteredTiles3D\",\"cc.ShatteredTiles3D\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ShatteredTiles3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ShatteredTiles3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ShatteredTiles3D).name();\n    g_luaType[typeName] = \"cc.ShatteredTiles3D\";\n    g_typeCast[\"ShatteredTiles3D\"] = \"cc.ShatteredTiles3D\";\n    return 1;\n}\n\nint lua_cocos2dx_ShuffleTiles_placeTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShuffleTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ShuffleTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ShuffleTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ShuffleTiles_placeTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Point arg0;\n        cocos2d::Tile* arg1;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR Tile*;\n        if(!ok)\n            return 0;\n        cobj->placeTile(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"placeTile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShuffleTiles_placeTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ShuffleTiles_shuffle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShuffleTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ShuffleTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ShuffleTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ShuffleTiles_shuffle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        unsigned int* arg0;\n        unsigned int arg1;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR unsigned int*;\n\n        ok &= luaval_to_uint32(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->shuffle(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"shuffle\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShuffleTiles_shuffle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ShuffleTiles_getDelta(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShuffleTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ShuffleTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ShuffleTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ShuffleTiles_getDelta'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getDelta(arg0);\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDelta\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShuffleTiles_getDelta'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ShuffleTiles_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ShuffleTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        unsigned int arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::ShuffleTiles* ret = cocos2d::ShuffleTiles::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ShuffleTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ShuffleTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShuffleTiles_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ShuffleTiles_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ShuffleTiles)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ShuffleTiles(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ShuffleTiles\");\n    tolua_cclass(tolua_S,\"ShuffleTiles\",\"cc.ShuffleTiles\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ShuffleTiles\");\n        tolua_function(tolua_S,\"placeTile\",lua_cocos2dx_ShuffleTiles_placeTile);\n        tolua_function(tolua_S,\"shuffle\",lua_cocos2dx_ShuffleTiles_shuffle);\n        tolua_function(tolua_S,\"getDelta\",lua_cocos2dx_ShuffleTiles_getDelta);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ShuffleTiles_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ShuffleTiles).name();\n    g_luaType[typeName] = \"cc.ShuffleTiles\";\n    g_typeCast[\"ShuffleTiles\"] = \"cc.ShuffleTiles\";\n    return 1;\n}\n\nint lua_cocos2dx_FadeOutTRTiles_turnOnTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FadeOutTRTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FadeOutTRTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FadeOutTRTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FadeOutTRTiles_turnOnTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->turnOnTile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"turnOnTile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutTRTiles_turnOnTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FadeOutTRTiles_turnOffTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FadeOutTRTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FadeOutTRTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FadeOutTRTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FadeOutTRTiles_turnOffTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->turnOffTile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"turnOffTile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutTRTiles_turnOffTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FadeOutTRTiles_transformTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FadeOutTRTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FadeOutTRTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FadeOutTRTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FadeOutTRTiles_transformTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Point arg0;\n        double arg1;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->transformTile(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"transformTile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutTRTiles_transformTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FadeOutTRTiles_testFunc(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FadeOutTRTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FadeOutTRTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FadeOutTRTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FadeOutTRTiles_testFunc'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Size arg0;\n        double arg1;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        double ret = cobj->testFunc(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"testFunc\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutTRTiles_testFunc'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FadeOutTRTiles_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FadeOutTRTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::FadeOutTRTiles* ret = cocos2d::FadeOutTRTiles::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FadeOutTRTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FadeOutTRTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutTRTiles_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FadeOutTRTiles_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FadeOutTRTiles)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FadeOutTRTiles(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FadeOutTRTiles\");\n    tolua_cclass(tolua_S,\"FadeOutTRTiles\",\"cc.FadeOutTRTiles\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FadeOutTRTiles\");\n        tolua_function(tolua_S,\"turnOnTile\",lua_cocos2dx_FadeOutTRTiles_turnOnTile);\n        tolua_function(tolua_S,\"turnOffTile\",lua_cocos2dx_FadeOutTRTiles_turnOffTile);\n        tolua_function(tolua_S,\"transformTile\",lua_cocos2dx_FadeOutTRTiles_transformTile);\n        tolua_function(tolua_S,\"testFunc\",lua_cocos2dx_FadeOutTRTiles_testFunc);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FadeOutTRTiles_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FadeOutTRTiles).name();\n    g_luaType[typeName] = \"cc.FadeOutTRTiles\";\n    g_typeCast[\"FadeOutTRTiles\"] = \"cc.FadeOutTRTiles\";\n    return 1;\n}\n\nint lua_cocos2dx_FadeOutBLTiles_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FadeOutBLTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::FadeOutBLTiles* ret = cocos2d::FadeOutBLTiles::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FadeOutBLTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FadeOutBLTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutBLTiles_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FadeOutBLTiles_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FadeOutBLTiles)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FadeOutBLTiles(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FadeOutBLTiles\");\n    tolua_cclass(tolua_S,\"FadeOutBLTiles\",\"cc.FadeOutBLTiles\",\"cc.FadeOutTRTiles\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FadeOutBLTiles\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FadeOutBLTiles_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FadeOutBLTiles).name();\n    g_luaType[typeName] = \"cc.FadeOutBLTiles\";\n    g_typeCast[\"FadeOutBLTiles\"] = \"cc.FadeOutBLTiles\";\n    return 1;\n}\n\nint lua_cocos2dx_FadeOutUpTiles_transformTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FadeOutUpTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FadeOutUpTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FadeOutUpTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FadeOutUpTiles_transformTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Point arg0;\n        double arg1;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->transformTile(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"transformTile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutUpTiles_transformTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FadeOutUpTiles_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FadeOutUpTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::FadeOutUpTiles* ret = cocos2d::FadeOutUpTiles::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FadeOutUpTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FadeOutUpTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutUpTiles_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FadeOutUpTiles_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FadeOutUpTiles)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FadeOutUpTiles(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FadeOutUpTiles\");\n    tolua_cclass(tolua_S,\"FadeOutUpTiles\",\"cc.FadeOutUpTiles\",\"cc.FadeOutTRTiles\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FadeOutUpTiles\");\n        tolua_function(tolua_S,\"transformTile\",lua_cocos2dx_FadeOutUpTiles_transformTile);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FadeOutUpTiles_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FadeOutUpTiles).name();\n    g_luaType[typeName] = \"cc.FadeOutUpTiles\";\n    g_typeCast[\"FadeOutUpTiles\"] = \"cc.FadeOutUpTiles\";\n    return 1;\n}\n\nint lua_cocos2dx_FadeOutDownTiles_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FadeOutDownTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::FadeOutDownTiles* ret = cocos2d::FadeOutDownTiles::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FadeOutDownTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FadeOutDownTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FadeOutDownTiles_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FadeOutDownTiles_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FadeOutDownTiles)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FadeOutDownTiles(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FadeOutDownTiles\");\n    tolua_cclass(tolua_S,\"FadeOutDownTiles\",\"cc.FadeOutDownTiles\",\"cc.FadeOutUpTiles\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FadeOutDownTiles\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_FadeOutDownTiles_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FadeOutDownTiles).name();\n    g_luaType[typeName] = \"cc.FadeOutDownTiles\";\n    g_typeCast[\"FadeOutDownTiles\"] = \"cc.FadeOutDownTiles\";\n    return 1;\n}\n\nint lua_cocos2dx_TurnOffTiles_turnOnTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TurnOffTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TurnOffTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TurnOffTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TurnOffTiles_turnOnTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->turnOnTile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"turnOnTile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TurnOffTiles_turnOnTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TurnOffTiles_turnOffTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TurnOffTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TurnOffTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TurnOffTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TurnOffTiles_turnOffTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->turnOffTile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"turnOffTile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TurnOffTiles_turnOffTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TurnOffTiles_shuffle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TurnOffTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TurnOffTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TurnOffTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TurnOffTiles_shuffle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        unsigned int* arg0;\n        unsigned int arg1;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR unsigned int*;\n\n        ok &= luaval_to_uint32(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->shuffle(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"shuffle\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TurnOffTiles_shuffle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TurnOffTiles_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TurnOffTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Size arg1;\n            ok &= luaval_to_size(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            unsigned int arg2;\n            ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::TurnOffTiles* ret = cocos2d::TurnOffTiles::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TurnOffTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TurnOffTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Size arg1;\n            ok &= luaval_to_size(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::TurnOffTiles* ret = cocos2d::TurnOffTiles::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TurnOffTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TurnOffTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TurnOffTiles_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TurnOffTiles_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TurnOffTiles)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TurnOffTiles(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TurnOffTiles\");\n    tolua_cclass(tolua_S,\"TurnOffTiles\",\"cc.TurnOffTiles\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TurnOffTiles\");\n        tolua_function(tolua_S,\"turnOnTile\",lua_cocos2dx_TurnOffTiles_turnOnTile);\n        tolua_function(tolua_S,\"turnOffTile\",lua_cocos2dx_TurnOffTiles_turnOffTile);\n        tolua_function(tolua_S,\"shuffle\",lua_cocos2dx_TurnOffTiles_shuffle);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TurnOffTiles_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TurnOffTiles).name();\n    g_luaType[typeName] = \"cc.TurnOffTiles\";\n    g_typeCast[\"TurnOffTiles\"] = \"cc.TurnOffTiles\";\n    return 1;\n}\n\nint lua_cocos2dx_WavesTiles3D_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::WavesTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.WavesTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::WavesTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_WavesTiles3D_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_WavesTiles3D_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_WavesTiles3D_setAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::WavesTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.WavesTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::WavesTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_WavesTiles3D_setAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitude(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitude\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_WavesTiles3D_setAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_WavesTiles3D_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::WavesTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.WavesTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::WavesTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_WavesTiles3D_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_WavesTiles3D_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_WavesTiles3D_getAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::WavesTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.WavesTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::WavesTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_WavesTiles3D_getAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitude();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitude\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_WavesTiles3D_getAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_WavesTiles3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.WavesTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        unsigned int arg2;\n        double arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::WavesTiles3D* ret = cocos2d::WavesTiles3D::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.WavesTiles3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::WavesTiles3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_WavesTiles3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_WavesTiles3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (WavesTiles3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_WavesTiles3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.WavesTiles3D\");\n    tolua_cclass(tolua_S,\"WavesTiles3D\",\"cc.WavesTiles3D\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"WavesTiles3D\");\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_WavesTiles3D_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitude\",lua_cocos2dx_WavesTiles3D_setAmplitude);\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_WavesTiles3D_setAmplitudeRate);\n        tolua_function(tolua_S,\"getAmplitude\",lua_cocos2dx_WavesTiles3D_getAmplitude);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_WavesTiles3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::WavesTiles3D).name();\n    g_luaType[typeName] = \"cc.WavesTiles3D\";\n    g_typeCast[\"WavesTiles3D\"] = \"cc.WavesTiles3D\";\n    return 1;\n}\n\nint lua_cocos2dx_JumpTiles3D_getAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::JumpTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.JumpTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::JumpTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_JumpTiles3D_getAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitudeRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitudeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_JumpTiles3D_getAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_JumpTiles3D_setAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::JumpTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.JumpTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::JumpTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_JumpTiles3D_setAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitude(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitude\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_JumpTiles3D_setAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_JumpTiles3D_setAmplitudeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::JumpTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.JumpTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::JumpTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_JumpTiles3D_setAmplitudeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAmplitudeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAmplitudeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_JumpTiles3D_setAmplitudeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_JumpTiles3D_getAmplitude(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::JumpTiles3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.JumpTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::JumpTiles3D*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_JumpTiles3D_getAmplitude'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAmplitude();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAmplitude\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_JumpTiles3D_getAmplitude'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_JumpTiles3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.JumpTiles3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        unsigned int arg2;\n        double arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_uint32(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::JumpTiles3D* ret = cocos2d::JumpTiles3D::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.JumpTiles3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::JumpTiles3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_JumpTiles3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_JumpTiles3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (JumpTiles3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_JumpTiles3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.JumpTiles3D\");\n    tolua_cclass(tolua_S,\"JumpTiles3D\",\"cc.JumpTiles3D\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"JumpTiles3D\");\n        tolua_function(tolua_S,\"getAmplitudeRate\",lua_cocos2dx_JumpTiles3D_getAmplitudeRate);\n        tolua_function(tolua_S,\"setAmplitude\",lua_cocos2dx_JumpTiles3D_setAmplitude);\n        tolua_function(tolua_S,\"setAmplitudeRate\",lua_cocos2dx_JumpTiles3D_setAmplitudeRate);\n        tolua_function(tolua_S,\"getAmplitude\",lua_cocos2dx_JumpTiles3D_getAmplitude);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_JumpTiles3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::JumpTiles3D).name();\n    g_luaType[typeName] = \"cc.JumpTiles3D\";\n    g_typeCast[\"JumpTiles3D\"] = \"cc.JumpTiles3D\";\n    return 1;\n}\n\nint lua_cocos2dx_SplitRows_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SplitRows\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        unsigned int arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_uint32(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::SplitRows* ret = cocos2d::SplitRows::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SplitRows\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SplitRows*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SplitRows_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_SplitRows_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SplitRows)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SplitRows(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SplitRows\");\n    tolua_cclass(tolua_S,\"SplitRows\",\"cc.SplitRows\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SplitRows\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_SplitRows_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::SplitRows).name();\n    g_luaType[typeName] = \"cc.SplitRows\";\n    g_typeCast[\"SplitRows\"] = \"cc.SplitRows\";\n    return 1;\n}\n\nint lua_cocos2dx_SplitCols_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SplitCols\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        unsigned int arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_uint32(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::SplitCols* ret = cocos2d::SplitCols::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SplitCols\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SplitCols*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SplitCols_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_SplitCols_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SplitCols)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SplitCols(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SplitCols\");\n    tolua_cclass(tolua_S,\"SplitCols\",\"cc.SplitCols\",\"cc.TiledGrid3DAction\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SplitCols\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_SplitCols_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::SplitCols).name();\n    g_luaType[typeName] = \"cc.SplitCols\";\n    g_typeCast[\"SplitCols\"] = \"cc.SplitCols\";\n    return 1;\n}\n\nint lua_cocos2dx_ActionTween_initWithDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ActionTween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionTween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ActionTween*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ActionTween_initWithDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        double arg0;\n        std::string arg1;\n        double arg2;\n        double arg3;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithDuration(arg0, arg1, arg2, arg3);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithDuration\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionTween_initWithDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ActionTween_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ActionTween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        double arg0;\n        std::string arg1;\n        double arg2;\n        double arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::ActionTween* ret = cocos2d::ActionTween::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionTween\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionTween*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ActionTween_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ActionTween_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionTween)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ActionTween(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ActionTween\");\n    tolua_cclass(tolua_S,\"ActionTween\",\"cc.ActionTween\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionTween\");\n        tolua_function(tolua_S,\"initWithDuration\",lua_cocos2dx_ActionTween_initWithDuration);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ActionTween_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ActionTween).name();\n    g_luaType[typeName] = \"cc.ActionTween\";\n    g_typeCast[\"ActionTween\"] = \"cc.ActionTween\";\n    return 1;\n}\n\nint lua_cocos2dx_CardinalSplineTo_getPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CardinalSplineTo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CardinalSplineTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CardinalSplineTo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CardinalSplineTo_getPoints'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PointArray* ret = cobj->getPoints();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PointArray\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PointArray*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPoints\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CardinalSplineTo_getPoints'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_CardinalSplineTo_updatePosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CardinalSplineTo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CardinalSplineTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CardinalSplineTo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CardinalSplineTo_updatePosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->updatePosition(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updatePosition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CardinalSplineTo_updatePosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_CardinalSplineTo_initWithDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CardinalSplineTo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CardinalSplineTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CardinalSplineTo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CardinalSplineTo_initWithDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        double arg0;\n        cocos2d::PointArray* arg1;\n        double arg2;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PointArray\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PointArray*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithDuration(arg0, arg1, arg2);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithDuration\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CardinalSplineTo_initWithDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_CardinalSplineTo_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CardinalSplineTo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::CardinalSplineTo();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CardinalSplineTo\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CardinalSplineTo\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"CardinalSplineTo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CardinalSplineTo_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_CardinalSplineTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CardinalSplineTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_CardinalSplineTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.CardinalSplineTo\");\n    tolua_cclass(tolua_S,\"CardinalSplineTo\",\"cc.CardinalSplineTo\",\"cc.ActionInterval\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CardinalSplineTo\");\n        tolua_function(tolua_S,\"getPoints\",lua_cocos2dx_CardinalSplineTo_getPoints);\n        tolua_function(tolua_S,\"updatePosition\",lua_cocos2dx_CardinalSplineTo_updatePosition);\n        tolua_function(tolua_S,\"initWithDuration\",lua_cocos2dx_CardinalSplineTo_initWithDuration);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_CardinalSplineTo_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::CardinalSplineTo).name();\n    g_luaType[typeName] = \"cc.CardinalSplineTo\";\n    g_typeCast[\"CardinalSplineTo\"] = \"cc.CardinalSplineTo\";\n    return 1;\n}\n\nint lua_cocos2dx_CardinalSplineBy_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CardinalSplineBy* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::CardinalSplineBy();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CardinalSplineBy\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CardinalSplineBy\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"CardinalSplineBy\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CardinalSplineBy_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_CardinalSplineBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CardinalSplineBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_CardinalSplineBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.CardinalSplineBy\");\n    tolua_cclass(tolua_S,\"CardinalSplineBy\",\"cc.CardinalSplineBy\",\"cc.CardinalSplineTo\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CardinalSplineBy\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::CardinalSplineBy).name();\n    g_luaType[typeName] = \"cc.CardinalSplineBy\";\n    g_typeCast[\"CardinalSplineBy\"] = \"cc.CardinalSplineBy\";\n    return 1;\n}\n\nint lua_cocos2dx_CatmullRomTo_initWithDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CatmullRomTo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CatmullRomTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CatmullRomTo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CatmullRomTo_initWithDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        cocos2d::PointArray* arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PointArray\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PointArray*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithDuration(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithDuration\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CatmullRomTo_initWithDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_CatmullRomTo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CatmullRomTo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_CatmullRomTo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.CatmullRomTo\");\n    tolua_cclass(tolua_S,\"CatmullRomTo\",\"cc.CatmullRomTo\",\"cc.CardinalSplineTo\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CatmullRomTo\");\n        tolua_function(tolua_S,\"initWithDuration\",lua_cocos2dx_CatmullRomTo_initWithDuration);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::CatmullRomTo).name();\n    g_luaType[typeName] = \"cc.CatmullRomTo\";\n    g_typeCast[\"CatmullRomTo\"] = \"cc.CatmullRomTo\";\n    return 1;\n}\n\nint lua_cocos2dx_CatmullRomBy_initWithDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::CatmullRomBy* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CatmullRomBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::CatmullRomBy*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_CatmullRomBy_initWithDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        cocos2d::PointArray* arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PointArray\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PointArray*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithDuration(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithDuration\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_CatmullRomBy_initWithDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_CatmullRomBy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CatmullRomBy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_CatmullRomBy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.CatmullRomBy\");\n    tolua_cclass(tolua_S,\"CatmullRomBy\",\"cc.CatmullRomBy\",\"cc.CardinalSplineBy\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CatmullRomBy\");\n        tolua_function(tolua_S,\"initWithDuration\",lua_cocos2dx_CatmullRomBy_initWithDuration);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::CatmullRomBy).name();\n    g_luaType[typeName] = \"cc.CatmullRomBy\";\n    g_typeCast[\"CatmullRomBy\"] = \"cc.CatmullRomBy\";\n    return 1;\n}\n\nint lua_cocos2dx_AtlasNode_updateAtlasValues(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AtlasNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_updateAtlasValues'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateAtlasValues();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateAtlasValues\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_updateAtlasValues'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AtlasNode_getTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AtlasNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTexture();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_getTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AtlasNode_setTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AtlasNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextureAtlas* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.TextureAtlas\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::TextureAtlas*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTextureAtlas(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureAtlas\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_setTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AtlasNode_getTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AtlasNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TextureAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TextureAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureAtlas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_getTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AtlasNode_getQuadsToDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AtlasNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_getQuadsToDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getQuadsToDraw();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getQuadsToDraw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_getQuadsToDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AtlasNode_setTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AtlasNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_setTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AtlasNode_setQuadsToDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AtlasNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AtlasNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AtlasNode_setQuadsToDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setQuadsToDraw(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setQuadsToDraw\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_setQuadsToDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AtlasNode_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.AtlasNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        std::string arg0;\n        int arg1;\n        int arg2;\n        int arg3;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::AtlasNode* ret = cocos2d::AtlasNode::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.AtlasNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::AtlasNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AtlasNode_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_AtlasNode_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (AtlasNode)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_AtlasNode(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.AtlasNode\");\n    tolua_cclass(tolua_S,\"AtlasNode\",\"cc.AtlasNode\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"AtlasNode\");\n        tolua_function(tolua_S,\"updateAtlasValues\",lua_cocos2dx_AtlasNode_updateAtlasValues);\n        tolua_function(tolua_S,\"getTexture\",lua_cocos2dx_AtlasNode_getTexture);\n        tolua_function(tolua_S,\"setTextureAtlas\",lua_cocos2dx_AtlasNode_setTextureAtlas);\n        tolua_function(tolua_S,\"getTextureAtlas\",lua_cocos2dx_AtlasNode_getTextureAtlas);\n        tolua_function(tolua_S,\"getQuadsToDraw\",lua_cocos2dx_AtlasNode_getQuadsToDraw);\n        tolua_function(tolua_S,\"setTexture\",lua_cocos2dx_AtlasNode_setTexture);\n        tolua_function(tolua_S,\"setQuadsToDraw\",lua_cocos2dx_AtlasNode_setQuadsToDraw);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_AtlasNode_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::AtlasNode).name();\n    g_luaType[typeName] = \"cc.AtlasNode\";\n    g_typeCast[\"AtlasNode\"] = \"cc.AtlasNode\";\n    return 1;\n}\n\nint lua_cocos2dx_DrawNode_drawQuadraticBezier(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::DrawNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_drawQuadraticBezier'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 5) \n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::Point arg2;\n        unsigned int arg3;\n        cocos2d::Color4F arg4;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n\n        ok &= luaval_to_uint32(tolua_S, 5,&arg3);\n\n        ok &=luaval_to_color4f(tolua_S, 6, &arg4);\n        if(!ok)\n            return 0;\n        cobj->drawQuadraticBezier(arg0, arg1, arg2, arg3, arg4);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawQuadraticBezier\",argc, 5);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_drawQuadraticBezier'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_DrawNode_onDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::DrawNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_onDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->onDraw();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onDraw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_onDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_DrawNode_clear(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::DrawNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_clear'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->clear();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clear\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_clear'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_DrawNode_drawTriangle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::DrawNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_drawTriangle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::Point arg2;\n        cocos2d::Color4F arg3;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n\n        ok &=luaval_to_color4f(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        cobj->drawTriangle(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawTriangle\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_drawTriangle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_DrawNode_drawDot(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::DrawNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_drawDot'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Point arg0;\n        double arg1;\n        cocos2d::Color4F arg2;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &=luaval_to_color4f(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cobj->drawDot(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawDot\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_drawDot'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_DrawNode_drawCubicBezier(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::DrawNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_drawCubicBezier'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 6) \n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::Point arg2;\n        cocos2d::Point arg3;\n        unsigned int arg4;\n        cocos2d::Color4F arg5;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n\n        ok &= luaval_to_uint32(tolua_S, 6,&arg4);\n\n        ok &=luaval_to_color4f(tolua_S, 7, &arg5);\n        if(!ok)\n            return 0;\n        cobj->drawCubicBezier(arg0, arg1, arg2, arg3, arg4, arg5);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawCubicBezier\",argc, 6);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_drawCubicBezier'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_DrawNode_drawSegment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::DrawNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::DrawNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_DrawNode_drawSegment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        double arg2;\n        cocos2d::Color4F arg3;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &=luaval_to_color4f(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        cobj->drawSegment(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawSegment\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_drawSegment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_DrawNode_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::DrawNode* ret = cocos2d::DrawNode::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.DrawNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::DrawNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_DrawNode_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_DrawNode_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (DrawNode)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_DrawNode(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.DrawNode\");\n    tolua_cclass(tolua_S,\"DrawNode\",\"cc.DrawNode\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"DrawNode\");\n        tolua_function(tolua_S,\"drawQuadraticBezier\",lua_cocos2dx_DrawNode_drawQuadraticBezier);\n        tolua_function(tolua_S,\"onDraw\",lua_cocos2dx_DrawNode_onDraw);\n        tolua_function(tolua_S,\"clear\",lua_cocos2dx_DrawNode_clear);\n        tolua_function(tolua_S,\"drawTriangle\",lua_cocos2dx_DrawNode_drawTriangle);\n        tolua_function(tolua_S,\"drawDot\",lua_cocos2dx_DrawNode_drawDot);\n        tolua_function(tolua_S,\"drawCubicBezier\",lua_cocos2dx_DrawNode_drawCubicBezier);\n        tolua_function(tolua_S,\"drawSegment\",lua_cocos2dx_DrawNode_drawSegment);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_DrawNode_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::DrawNode).name();\n    g_luaType[typeName] = \"cc.DrawNode\";\n    g_typeCast[\"DrawNode\"] = \"cc.DrawNode\";\n    return 1;\n}\n\nint lua_cocos2dx_LabelAtlas_setString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_setString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setString(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelAtlas_setString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelAtlas_initWithString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelAtlas* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_initWithString'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 5) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            int arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n            if (!ok) { break; }\n            int arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 5) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            int arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n            if (!ok) { break; }\n            int arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithString\",argc, 5);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelAtlas_initWithString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelAtlas_updateAtlasValues(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_updateAtlasValues'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateAtlasValues();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateAtlasValues\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelAtlas_updateAtlasValues'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelAtlas_getString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelAtlas_getString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getString();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getString\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelAtlas_getString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelAtlas_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.LabelAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 5)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            int arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n            if (!ok) { break; }\n            int arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n            if (!ok) { break; }\n            cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1, arg2, arg3, arg4);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::LabelAtlas* ret = cocos2d::LabelAtlas::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelAtlas_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_LabelAtlas_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LabelAtlas)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_LabelAtlas(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.LabelAtlas\");\n    tolua_cclass(tolua_S,\"LabelAtlas\",\"cc.LabelAtlas\",\"cc.AtlasNode\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LabelAtlas\");\n        tolua_function(tolua_S,\"setString\",lua_cocos2dx_LabelAtlas_setString);\n        tolua_function(tolua_S,\"initWithString\",lua_cocos2dx_LabelAtlas_initWithString);\n        tolua_function(tolua_S,\"updateAtlasValues\",lua_cocos2dx_LabelAtlas_updateAtlasValues);\n        tolua_function(tolua_S,\"getString\",lua_cocos2dx_LabelAtlas_getString);\n        tolua_function(tolua_S,\"_create\", lua_cocos2dx_LabelAtlas_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::LabelAtlas).name();\n    g_luaType[typeName] = \"cc.LabelAtlas\";\n    g_typeCast[\"LabelAtlas\"] = \"cc.LabelAtlas\";\n    return 1;\n}\n\nint lua_cocos2dx_Director_pause(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_pause'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pause();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pause\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_pause'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setContentScaleFactor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setContentScaleFactor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setContentScaleFactor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setContentScaleFactor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setContentScaleFactor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getContentScaleFactor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getContentScaleFactor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getContentScaleFactor();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContentScaleFactor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getContentScaleFactor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getWinSizeInPixels(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getWinSizeInPixels'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getWinSizeInPixels();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWinSizeInPixels\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getWinSizeInPixels'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getDeltaTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getDeltaTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDeltaTime();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDeltaTime\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getDeltaTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setGLDefaultValues(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setGLDefaultValues'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setGLDefaultValues();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGLDefaultValues\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setGLDefaultValues'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setActionManager(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setActionManager'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionManager* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionManager\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionManager*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setActionManager(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setActionManager\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setActionManager'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setAlphaBlending(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setAlphaBlending'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAlphaBlending(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAlphaBlending\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setAlphaBlending'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_popToRootScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_popToRootScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->popToRootScene();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"popToRootScene\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_popToRootScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getNotificationNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getNotificationNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getNotificationNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNotificationNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getNotificationNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getWinSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getWinSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getWinSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWinSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getWinSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getTextureCache(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getTextureCache'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::TextureCache* ret = cobj->getTextureCache();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TextureCache\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TextureCache*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureCache\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getTextureCache'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_isSendCleanupToScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_isSendCleanupToScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isSendCleanupToScene();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isSendCleanupToScene\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_isSendCleanupToScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getVisibleOrigin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getVisibleOrigin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getVisibleOrigin();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVisibleOrigin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getVisibleOrigin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_mainLoop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_mainLoop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->mainLoop();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"mainLoop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_mainLoop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setDepthTest(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setDepthTest'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDepthTest(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDepthTest\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setDepthTest'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getFrameRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getFrameRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getFrameRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFrameRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getFrameRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getSecondsPerFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getSecondsPerFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSecondsPerFrame();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSecondsPerFrame\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getSecondsPerFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_convertToUI(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_convertToUI'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertToUI(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertToUI\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_convertToUI'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setDefaultValues(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setDefaultValues'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setDefaultValues();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDefaultValues\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setDefaultValues'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setScheduler(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setScheduler'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Scheduler* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scheduler\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Scheduler*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setScheduler(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScheduler\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setScheduler'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_startAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_startAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->startAnimation();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"startAnimation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_startAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getRunningScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getRunningScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Scene* ret = cobj->getRunningScene();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scene\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Scene*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRunningScene\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getRunningScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setViewport(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setViewport'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setViewport();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setViewport\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setViewport'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_stopAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_stopAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopAnimation();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopAnimation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_stopAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_popToSceneStackLevel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_popToSceneStackLevel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->popToSceneStackLevel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"popToSceneStackLevel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_popToSceneStackLevel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_resume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_resume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resume();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resume\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_resume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_isNextDeltaTimeZero(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_isNextDeltaTimeZero'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isNextDeltaTimeZero();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isNextDeltaTimeZero\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_isNextDeltaTimeZero'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_end(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_end'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->end();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"end\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_end'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setOpenGLView(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setOpenGLView'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::EGLView* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.EGLView\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::EGLView*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setOpenGLView(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOpenGLView\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setOpenGLView'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_convertToGL(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_convertToGL'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->convertToGL(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"convertToGL\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_convertToGL'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_purgeCachedData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_purgeCachedData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->purgeCachedData();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"purgeCachedData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_purgeCachedData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getTotalFrames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getTotalFrames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getTotalFrames();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTotalFrames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getTotalFrames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_runWithScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_runWithScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Scene* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Scene*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->runWithScene(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"runWithScene\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_runWithScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setNotificationNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setNotificationNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setNotificationNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setNotificationNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setNotificationNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_drawScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_drawScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->drawScene();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawScene\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_drawScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_popScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_popScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->popScene();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"popScene\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_popScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_isDisplayStats(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_isDisplayStats'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isDisplayStats();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isDisplayStats\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_isDisplayStats'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setProjection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setProjection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Director::Projection arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setProjection(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProjection\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setProjection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getConsole(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getConsole'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Console* ret = cobj->getConsole();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Console\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Console*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getConsole\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getConsole'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getZEye(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getZEye'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getZEye();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getZEye\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getZEye'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setNextDeltaTimeZero(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setNextDeltaTimeZero'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setNextDeltaTimeZero(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setNextDeltaTimeZero\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setNextDeltaTimeZero'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getVisibleSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getVisibleSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getVisibleSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVisibleSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getVisibleSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getScheduler(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getScheduler'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Scheduler* ret = cobj->getScheduler();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scheduler\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Scheduler*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScheduler\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getScheduler'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_pushScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_pushScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Scene* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Scene*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->pushScene(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pushScene\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_pushScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getAnimationInterval(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getAnimationInterval'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAnimationInterval();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimationInterval\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getAnimationInterval'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_isPaused(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_isPaused'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isPaused();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isPaused\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_isPaused'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setDisplayStats(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setDisplayStats'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDisplayStats(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDisplayStats\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setDisplayStats'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_replaceScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_replaceScene'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Scene* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Scene*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->replaceScene(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"replaceScene\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_replaceScene'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_setAnimationInterval(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_setAnimationInterval'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAnimationInterval(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimationInterval\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_setAnimationInterval'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getActionManager(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Director* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Director*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Director_getActionManager'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionManager* ret = cobj->getActionManager();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getActionManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getActionManager'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Director_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Director\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Director* ret = cocos2d::Director::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Director\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Director*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Director_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Director_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Director)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Director(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Director\");\n    tolua_cclass(tolua_S,\"Director\",\"cc.Director\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Director\");\n        tolua_function(tolua_S,\"pause\",lua_cocos2dx_Director_pause);\n        tolua_function(tolua_S,\"setContentScaleFactor\",lua_cocos2dx_Director_setContentScaleFactor);\n        tolua_function(tolua_S,\"getContentScaleFactor\",lua_cocos2dx_Director_getContentScaleFactor);\n        tolua_function(tolua_S,\"getWinSizeInPixels\",lua_cocos2dx_Director_getWinSizeInPixels);\n        tolua_function(tolua_S,\"getDeltaTime\",lua_cocos2dx_Director_getDeltaTime);\n        tolua_function(tolua_S,\"setGLDefaultValues\",lua_cocos2dx_Director_setGLDefaultValues);\n        tolua_function(tolua_S,\"setActionManager\",lua_cocos2dx_Director_setActionManager);\n        tolua_function(tolua_S,\"setAlphaBlending\",lua_cocos2dx_Director_setAlphaBlending);\n        tolua_function(tolua_S,\"popToRootScene\",lua_cocos2dx_Director_popToRootScene);\n        tolua_function(tolua_S,\"getNotificationNode\",lua_cocos2dx_Director_getNotificationNode);\n        tolua_function(tolua_S,\"getWinSize\",lua_cocos2dx_Director_getWinSize);\n        tolua_function(tolua_S,\"getTextureCache\",lua_cocos2dx_Director_getTextureCache);\n        tolua_function(tolua_S,\"isSendCleanupToScene\",lua_cocos2dx_Director_isSendCleanupToScene);\n        tolua_function(tolua_S,\"getVisibleOrigin\",lua_cocos2dx_Director_getVisibleOrigin);\n        tolua_function(tolua_S,\"mainLoop\",lua_cocos2dx_Director_mainLoop);\n        tolua_function(tolua_S,\"setDepthTest\",lua_cocos2dx_Director_setDepthTest);\n        tolua_function(tolua_S,\"getFrameRate\",lua_cocos2dx_Director_getFrameRate);\n        tolua_function(tolua_S,\"getSecondsPerFrame\",lua_cocos2dx_Director_getSecondsPerFrame);\n        tolua_function(tolua_S,\"convertToUI\",lua_cocos2dx_Director_convertToUI);\n        tolua_function(tolua_S,\"setDefaultValues\",lua_cocos2dx_Director_setDefaultValues);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_Director_init);\n        tolua_function(tolua_S,\"setScheduler\",lua_cocos2dx_Director_setScheduler);\n        tolua_function(tolua_S,\"startAnimation\",lua_cocos2dx_Director_startAnimation);\n        tolua_function(tolua_S,\"getRunningScene\",lua_cocos2dx_Director_getRunningScene);\n        tolua_function(tolua_S,\"setViewport\",lua_cocos2dx_Director_setViewport);\n        tolua_function(tolua_S,\"stopAnimation\",lua_cocos2dx_Director_stopAnimation);\n        tolua_function(tolua_S,\"popToSceneStackLevel\",lua_cocos2dx_Director_popToSceneStackLevel);\n        tolua_function(tolua_S,\"resume\",lua_cocos2dx_Director_resume);\n        tolua_function(tolua_S,\"isNextDeltaTimeZero\",lua_cocos2dx_Director_isNextDeltaTimeZero);\n        tolua_function(tolua_S,\"endToLua\",lua_cocos2dx_Director_end);\n        tolua_function(tolua_S,\"setOpenGLView\",lua_cocos2dx_Director_setOpenGLView);\n        tolua_function(tolua_S,\"convertToGL\",lua_cocos2dx_Director_convertToGL);\n        tolua_function(tolua_S,\"purgeCachedData\",lua_cocos2dx_Director_purgeCachedData);\n        tolua_function(tolua_S,\"getTotalFrames\",lua_cocos2dx_Director_getTotalFrames);\n        tolua_function(tolua_S,\"runWithScene\",lua_cocos2dx_Director_runWithScene);\n        tolua_function(tolua_S,\"setNotificationNode\",lua_cocos2dx_Director_setNotificationNode);\n        tolua_function(tolua_S,\"drawScene\",lua_cocos2dx_Director_drawScene);\n        tolua_function(tolua_S,\"popScene\",lua_cocos2dx_Director_popScene);\n        tolua_function(tolua_S,\"isDisplayStats\",lua_cocos2dx_Director_isDisplayStats);\n        tolua_function(tolua_S,\"setProjection\",lua_cocos2dx_Director_setProjection);\n        tolua_function(tolua_S,\"getConsole\",lua_cocos2dx_Director_getConsole);\n        tolua_function(tolua_S,\"getZEye\",lua_cocos2dx_Director_getZEye);\n        tolua_function(tolua_S,\"setNextDeltaTimeZero\",lua_cocos2dx_Director_setNextDeltaTimeZero);\n        tolua_function(tolua_S,\"getVisibleSize\",lua_cocos2dx_Director_getVisibleSize);\n        tolua_function(tolua_S,\"getScheduler\",lua_cocos2dx_Director_getScheduler);\n        tolua_function(tolua_S,\"pushScene\",lua_cocos2dx_Director_pushScene);\n        tolua_function(tolua_S,\"getAnimationInterval\",lua_cocos2dx_Director_getAnimationInterval);\n        tolua_function(tolua_S,\"isPaused\",lua_cocos2dx_Director_isPaused);\n        tolua_function(tolua_S,\"setDisplayStats\",lua_cocos2dx_Director_setDisplayStats);\n        tolua_function(tolua_S,\"replaceScene\",lua_cocos2dx_Director_replaceScene);\n        tolua_function(tolua_S,\"setAnimationInterval\",lua_cocos2dx_Director_setAnimationInterval);\n        tolua_function(tolua_S,\"getActionManager\",lua_cocos2dx_Director_getActionManager);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_Director_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Director).name();\n    g_luaType[typeName] = \"cc.Director\";\n    g_typeCast[\"Director\"] = \"cc.Director\";\n    return 1;\n}\n\nint lua_cocos2dx_GridBase_setGridSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_setGridSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setGridSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGridSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_setGridSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_calculateVertexPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_calculateVertexPoints'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->calculateVertexPoints();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"calculateVertexPoints\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_calculateVertexPoints'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_afterDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_afterDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->afterDraw(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"afterDraw\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_afterDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_beforeDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_beforeDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->beforeDraw();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"beforeDraw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_beforeDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_isTextureFlipped(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_isTextureFlipped'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTextureFlipped();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTextureFlipped\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_isTextureFlipped'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_getGridSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_getGridSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getGridSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGridSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_getGridSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_getStep(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_getStep'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getStep();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStep\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_getStep'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_set2DProjection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_set2DProjection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->set2DProjection();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"set2DProjection\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_set2DProjection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_setStep(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_setStep'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setStep(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStep\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_setStep'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_setTextureFlipped(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_setTextureFlipped'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTextureFlipped(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureFlipped\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_setTextureFlipped'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_blit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_blit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->blit();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"blit\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_blit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_setActive(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_setActive'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setActive(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setActive\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_setActive'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_getReuseGrid(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_getReuseGrid'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getReuseGrid();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getReuseGrid\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_getReuseGrid'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_initWithSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_initWithSize'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSize(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSize(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithSize\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_initWithSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_setReuseGrid(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_setReuseGrid'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setReuseGrid(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setReuseGrid\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_setReuseGrid'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_isActive(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_isActive'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isActive();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isActive\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_isActive'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_reuse(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::GridBase* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::GridBase*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_GridBase_reuse'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->reuse();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reuse\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_reuse'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_GridBase_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.GridBase\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::GridBase* ret = cocos2d::GridBase::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GridBase\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GridBase*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::Texture2D* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::GridBase* ret = cocos2d::GridBase::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GridBase\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GridBase*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_GridBase_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_GridBase_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (GridBase)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_GridBase(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.GridBase\");\n    tolua_cclass(tolua_S,\"GridBase\",\"cc.GridBase\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"GridBase\");\n        tolua_function(tolua_S,\"setGridSize\",lua_cocos2dx_GridBase_setGridSize);\n        tolua_function(tolua_S,\"calculateVertexPoints\",lua_cocos2dx_GridBase_calculateVertexPoints);\n        tolua_function(tolua_S,\"afterDraw\",lua_cocos2dx_GridBase_afterDraw);\n        tolua_function(tolua_S,\"beforeDraw\",lua_cocos2dx_GridBase_beforeDraw);\n        tolua_function(tolua_S,\"isTextureFlipped\",lua_cocos2dx_GridBase_isTextureFlipped);\n        tolua_function(tolua_S,\"getGridSize\",lua_cocos2dx_GridBase_getGridSize);\n        tolua_function(tolua_S,\"getStep\",lua_cocos2dx_GridBase_getStep);\n        tolua_function(tolua_S,\"set2DProjection\",lua_cocos2dx_GridBase_set2DProjection);\n        tolua_function(tolua_S,\"setStep\",lua_cocos2dx_GridBase_setStep);\n        tolua_function(tolua_S,\"setTextureFlipped\",lua_cocos2dx_GridBase_setTextureFlipped);\n        tolua_function(tolua_S,\"blit\",lua_cocos2dx_GridBase_blit);\n        tolua_function(tolua_S,\"setActive\",lua_cocos2dx_GridBase_setActive);\n        tolua_function(tolua_S,\"getReuseGrid\",lua_cocos2dx_GridBase_getReuseGrid);\n        tolua_function(tolua_S,\"initWithSize\",lua_cocos2dx_GridBase_initWithSize);\n        tolua_function(tolua_S,\"setReuseGrid\",lua_cocos2dx_GridBase_setReuseGrid);\n        tolua_function(tolua_S,\"isActive\",lua_cocos2dx_GridBase_isActive);\n        tolua_function(tolua_S,\"reuse\",lua_cocos2dx_GridBase_reuse);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_GridBase_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::GridBase).name();\n    g_luaType[typeName] = \"cc.GridBase\";\n    g_typeCast[\"GridBase\"] = \"cc.GridBase\";\n    return 1;\n}\n\nint lua_cocos2dx_Grid3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Grid3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Grid3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Grid3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::Texture2D* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Grid3D* ret = cocos2d::Grid3D::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Grid3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Grid3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Grid3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Grid3D_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Grid3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Grid3D();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Grid3D\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Grid3D\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Grid3D\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Grid3D_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Grid3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Grid3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Grid3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Grid3D\");\n    tolua_cclass(tolua_S,\"Grid3D\",\"cc.Grid3D\",\"cc.GridBase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Grid3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Grid3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Grid3D).name();\n    g_luaType[typeName] = \"cc.Grid3D\";\n    g_typeCast[\"Grid3D\"] = \"cc.Grid3D\";\n    return 1;\n}\n\nint lua_cocos2dx_TiledGrid3D_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TiledGrid3D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TiledGrid3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TiledGrid3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::Texture2D* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::TiledGrid3D* ret = cocos2d::TiledGrid3D::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TiledGrid3D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TiledGrid3D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TiledGrid3D_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TiledGrid3D_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TiledGrid3D* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TiledGrid3D();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TiledGrid3D\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TiledGrid3D\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TiledGrid3D\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TiledGrid3D_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TiledGrid3D_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TiledGrid3D)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TiledGrid3D(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TiledGrid3D\");\n    tolua_cclass(tolua_S,\"TiledGrid3D\",\"cc.TiledGrid3D\",\"cc.GridBase\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TiledGrid3D\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TiledGrid3D_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TiledGrid3D).name();\n    g_luaType[typeName] = \"cc.TiledGrid3D\";\n    g_typeCast[\"TiledGrid3D\"] = \"cc.TiledGrid3D\";\n    return 1;\n}\n\nint lua_cocos2dx_Sprite_setSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            cocos2d::SpriteFrame* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->setSpriteFrame(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setSpriteFrame(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpriteFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTexture'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->setTexture(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setTexture(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_getTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTexture();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_getTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setFlippedY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFlippedY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFlippedY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setFlippedY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setFlippedX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setFlippedX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFlippedX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFlippedX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setFlippedX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_getBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::SpriteBatchNode* ret = cobj->getBatchNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBatchNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_getBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_getOffsetPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getOffsetPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getOffsetPosition();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOffsetPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_getOffsetPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_removeAllChildrenWithCleanup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAllChildrenWithCleanup(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllChildrenWithCleanup\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_removeAllChildrenWithCleanup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_updateQuadVertices(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_updateQuadVertices'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateQuadVertices();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateQuadVertices\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_updateQuadVertices'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_updateTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_updateTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateTransform();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_updateTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setTextureRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureRect'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 3) {\n            cocos2d::Rect arg0;\n            ok &= luaval_to_rect(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cocos2d::Size arg2;\n            ok &= luaval_to_size(tolua_S, 4, &arg2);\n\n            if (!ok) { break; }\n            cobj->setTextureRect(arg0, arg1, arg2);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Rect arg0;\n            ok &= luaval_to_rect(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cobj->setTextureRect(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureRect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setTextureRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_isFrameDisplayed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFrameDisplayed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFrameDisplayed(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFrameDisplayed\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_isFrameDisplayed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_getAtlasIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getAtlasIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getAtlasIndex();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAtlasIndex\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_getAtlasIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteBatchNode* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteBatchNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBatchNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBatchNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        ssize_t arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->setDisplayFrameWithAnimationName(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDisplayFrameWithAnimationName\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextureAtlas* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.TextureAtlas\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::TextureAtlas*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTextureAtlas(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureAtlas\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_getSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::SpriteFrame* ret = cobj->getSpriteFrame();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpriteFrame\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_getSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_isDirty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isDirty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isDirty();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isDirty\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_isDirty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setAtlasIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setAtlasIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setAtlasIndex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAtlasIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setAtlasIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setDirty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setDirty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDirty(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDirty\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setDirty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_isTextureRectRotated(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isTextureRectRotated'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTextureRectRotated();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTextureRectRotated\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_isTextureRectRotated'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_getTextureRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Rect& ret = cobj->getTextureRect();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureRect\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_getTextureRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_getTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_getTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TextureAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TextureAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureAtlas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_getTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_isFlippedX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFlippedX();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFlippedX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_isFlippedX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_isFlippedY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_isFlippedY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFlippedY();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFlippedY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_isFlippedY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_setVertexRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Sprite_setVertexRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setVertexRect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVertexRect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_setVertexRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Sprite_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Sprite* ret = cocos2d::Sprite::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::Sprite* ret = cocos2d::Sprite::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::Sprite* ret = cocos2d::Sprite::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Sprite_createWithTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* ret = cocos2d::Sprite::createWithTexture(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"createWithTexture\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_createWithTexture'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Sprite_createWithSpriteFrameName(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrameName(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithSpriteFrameName\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrameName'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Sprite_createWithSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::SpriteFrame* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cocos2d::Sprite::createWithSpriteFrame(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithSpriteFrame\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Sprite_createWithSpriteFrame'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Sprite_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Sprite)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Sprite(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Sprite\");\n    tolua_cclass(tolua_S,\"Sprite\",\"cc.Sprite\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Sprite\");\n        tolua_function(tolua_S,\"setSpriteFrame\",lua_cocos2dx_Sprite_setSpriteFrame);\n        tolua_function(tolua_S,\"setTexture\",lua_cocos2dx_Sprite_setTexture);\n        tolua_function(tolua_S,\"getTexture\",lua_cocos2dx_Sprite_getTexture);\n        tolua_function(tolua_S,\"setFlippedY\",lua_cocos2dx_Sprite_setFlippedY);\n        tolua_function(tolua_S,\"setFlippedX\",lua_cocos2dx_Sprite_setFlippedX);\n        tolua_function(tolua_S,\"getBatchNode\",lua_cocos2dx_Sprite_getBatchNode);\n        tolua_function(tolua_S,\"getOffsetPosition\",lua_cocos2dx_Sprite_getOffsetPosition);\n        tolua_function(tolua_S,\"removeAllChildrenWithCleanup\",lua_cocos2dx_Sprite_removeAllChildrenWithCleanup);\n        tolua_function(tolua_S,\"updateQuadVertices\",lua_cocos2dx_Sprite_updateQuadVertices);\n        tolua_function(tolua_S,\"updateTransform\",lua_cocos2dx_Sprite_updateTransform);\n        tolua_function(tolua_S,\"setTextureRect\",lua_cocos2dx_Sprite_setTextureRect);\n        tolua_function(tolua_S,\"isFrameDisplayed\",lua_cocos2dx_Sprite_isFrameDisplayed);\n        tolua_function(tolua_S,\"getAtlasIndex\",lua_cocos2dx_Sprite_getAtlasIndex);\n        tolua_function(tolua_S,\"setBatchNode\",lua_cocos2dx_Sprite_setBatchNode);\n        tolua_function(tolua_S,\"setDisplayFrameWithAnimationName\",lua_cocos2dx_Sprite_setDisplayFrameWithAnimationName);\n        tolua_function(tolua_S,\"setTextureAtlas\",lua_cocos2dx_Sprite_setTextureAtlas);\n        tolua_function(tolua_S,\"getSpriteFrame\",lua_cocos2dx_Sprite_getSpriteFrame);\n        tolua_function(tolua_S,\"isDirty\",lua_cocos2dx_Sprite_isDirty);\n        tolua_function(tolua_S,\"setAtlasIndex\",lua_cocos2dx_Sprite_setAtlasIndex);\n        tolua_function(tolua_S,\"setDirty\",lua_cocos2dx_Sprite_setDirty);\n        tolua_function(tolua_S,\"isTextureRectRotated\",lua_cocos2dx_Sprite_isTextureRectRotated);\n        tolua_function(tolua_S,\"getTextureRect\",lua_cocos2dx_Sprite_getTextureRect);\n        tolua_function(tolua_S,\"getTextureAtlas\",lua_cocos2dx_Sprite_getTextureAtlas);\n        tolua_function(tolua_S,\"isFlippedX\",lua_cocos2dx_Sprite_isFlippedX);\n        tolua_function(tolua_S,\"isFlippedY\",lua_cocos2dx_Sprite_isFlippedY);\n        tolua_function(tolua_S,\"setVertexRect\",lua_cocos2dx_Sprite_setVertexRect);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Sprite_create);\n        tolua_function(tolua_S,\"createWithTexture\", lua_cocos2dx_Sprite_createWithTexture);\n        tolua_function(tolua_S,\"createWithSpriteFrameName\", lua_cocos2dx_Sprite_createWithSpriteFrameName);\n        tolua_function(tolua_S,\"createWithSpriteFrame\", lua_cocos2dx_Sprite_createWithSpriteFrame);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Sprite).name();\n    g_luaType[typeName] = \"cc.Sprite\";\n    g_typeCast[\"Sprite\"] = \"cc.Sprite\";\n    return 1;\n}\n\nint lua_cocos2dx_LabelTTF_enableShadow(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_enableShadow'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Size arg0;\n        double arg1;\n        double arg2;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->enableShadow(arg0, arg1, arg2);\n        return 0;\n    }\n    if (argc == 4) \n    {\n        cocos2d::Size arg0;\n        double arg1;\n        double arg2;\n        bool arg3;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_boolean(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cobj->enableShadow(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"enableShadow\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_enableShadow'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setDimensions(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setDimensions'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setDimensions(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDimensions\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setDimensions'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_getFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_getFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getFontSize();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFontSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_getFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_getString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_getString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getString();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getString\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_getString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setTextDefinition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setTextDefinition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::FontDefinition arg0;\n\n        ok &= luaval_to_fontdefinition(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTextDefinition(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextDefinition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setTextDefinition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_getHorizontalAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_getHorizontalAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getHorizontalAlignment();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getHorizontalAlignment\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_getHorizontalAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_initWithStringAndTextDefinition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_initWithStringAndTextDefinition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        cocos2d::FontDefinition arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_fontdefinition(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithStringAndTextDefinition(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithStringAndTextDefinition\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_initWithStringAndTextDefinition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setString(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_initWithString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_initWithString'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 5) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Size arg3;\n            ok &= luaval_to_size(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 6) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Size arg3;\n            ok &= luaval_to_size(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n\n            if (!ok) { break; }\n            cocos2d::TextVAlignment arg5;\n            ok &= luaval_to_int32(tolua_S, 7,(int *)&arg5);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4, arg5);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithString\",argc, 6);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_initWithString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setFontFillColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setFontFillColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontFillColor(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        cocos2d::Color3B arg0;\n        bool arg1;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setFontFillColor(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontFillColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setFontFillColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_enableStroke(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_enableStroke'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Color3B arg0;\n        double arg1;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->enableStroke(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        cocos2d::Color3B arg0;\n        double arg1;\n        bool arg2;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->enableStroke(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"enableStroke\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_enableStroke'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_getDimensions(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_getDimensions'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getDimensions();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDimensions\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_getDimensions'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setVerticalAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setVerticalAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextVAlignment arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setVerticalAlignment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVerticalAlignment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setVerticalAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_getVerticalAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_getVerticalAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getVerticalAlignment();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVerticalAlignment\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_getVerticalAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_getTextDefinition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_getTextDefinition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::FontDefinition ret = cobj->getTextDefinition();\n        fontdefinition_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextDefinition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_getTextDefinition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_getFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_getFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getFontName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFontName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_getFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_setHorizontalAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_setHorizontalAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextHAlignment arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setHorizontalAlignment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setHorizontalAlignment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_setHorizontalAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_disableShadow(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_disableShadow'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->disableShadow();\n        return 0;\n    }\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->disableShadow(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"disableShadow\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_disableShadow'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_disableStroke(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelTTF_disableStroke'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->disableStroke();\n        return 0;\n    }\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->disableStroke(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"disableStroke\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_disableStroke'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 5)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Size arg3;\n            ok &= luaval_to_size(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n            if (!ok) { break; }\n            cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2, arg3, arg4);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelTTF\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelTTF*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelTTF\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelTTF*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 6)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Size arg3;\n            ok &= luaval_to_size(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg4;\n            ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n            if (!ok) { break; }\n            cocos2d::TextVAlignment arg5;\n            ok &= luaval_to_int32(tolua_S, 7,(int *)&arg5);\n            if (!ok) { break; }\n            cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create(arg0, arg1, arg2, arg3, arg4, arg5);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelTTF\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelTTF*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::LabelTTF* ret = cocos2d::LabelTTF::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelTTF\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelTTF*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_createWithFontDefinition(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.LabelTTF\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        std::string arg0;\n        cocos2d::FontDefinition arg1;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_fontdefinition(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::LabelTTF* ret = cocos2d::LabelTTF::createWithFontDefinition(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelTTF\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelTTF*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithFontDefinition\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_createWithFontDefinition'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_LabelTTF_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelTTF* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::LabelTTF();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.LabelTTF\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.LabelTTF\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"LabelTTF\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelTTF_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_LabelTTF_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LabelTTF)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_LabelTTF(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.LabelTTF\");\n    tolua_cclass(tolua_S,\"LabelTTF\",\"cc.LabelTTF\",\"cc.Sprite\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LabelTTF\");\n        tolua_function(tolua_S,\"enableShadow\",lua_cocos2dx_LabelTTF_enableShadow);\n        tolua_function(tolua_S,\"setDimensions\",lua_cocos2dx_LabelTTF_setDimensions);\n        tolua_function(tolua_S,\"getFontSize\",lua_cocos2dx_LabelTTF_getFontSize);\n        tolua_function(tolua_S,\"getString\",lua_cocos2dx_LabelTTF_getString);\n        tolua_function(tolua_S,\"setTextDefinition\",lua_cocos2dx_LabelTTF_setTextDefinition);\n        tolua_function(tolua_S,\"setFontName\",lua_cocos2dx_LabelTTF_setFontName);\n        tolua_function(tolua_S,\"getHorizontalAlignment\",lua_cocos2dx_LabelTTF_getHorizontalAlignment);\n        tolua_function(tolua_S,\"initWithStringAndTextDefinition\",lua_cocos2dx_LabelTTF_initWithStringAndTextDefinition);\n        tolua_function(tolua_S,\"setString\",lua_cocos2dx_LabelTTF_setString);\n        tolua_function(tolua_S,\"initWithString\",lua_cocos2dx_LabelTTF_initWithString);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_LabelTTF_init);\n        tolua_function(tolua_S,\"setFontFillColor\",lua_cocos2dx_LabelTTF_setFontFillColor);\n        tolua_function(tolua_S,\"enableStroke\",lua_cocos2dx_LabelTTF_enableStroke);\n        tolua_function(tolua_S,\"getDimensions\",lua_cocos2dx_LabelTTF_getDimensions);\n        tolua_function(tolua_S,\"setVerticalAlignment\",lua_cocos2dx_LabelTTF_setVerticalAlignment);\n        tolua_function(tolua_S,\"setFontSize\",lua_cocos2dx_LabelTTF_setFontSize);\n        tolua_function(tolua_S,\"getVerticalAlignment\",lua_cocos2dx_LabelTTF_getVerticalAlignment);\n        tolua_function(tolua_S,\"getTextDefinition\",lua_cocos2dx_LabelTTF_getTextDefinition);\n        tolua_function(tolua_S,\"getFontName\",lua_cocos2dx_LabelTTF_getFontName);\n        tolua_function(tolua_S,\"setHorizontalAlignment\",lua_cocos2dx_LabelTTF_setHorizontalAlignment);\n        tolua_function(tolua_S,\"disableShadow\",lua_cocos2dx_LabelTTF_disableShadow);\n        tolua_function(tolua_S,\"disableStroke\",lua_cocos2dx_LabelTTF_disableStroke);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_LabelTTF_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_LabelTTF_create);\n        tolua_function(tolua_S,\"createWithFontDefinition\", lua_cocos2dx_LabelTTF_createWithFontDefinition);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::LabelTTF).name();\n    g_luaType[typeName] = \"cc.LabelTTF\";\n    g_typeCast[\"LabelTTF\"] = \"cc.LabelTTF\";\n    return 1;\n}\n\nint lua_cocos2dx_SpriteBatchNode_appendChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_appendChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->appendChild(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"appendChild\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_appendChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_reorderBatch(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_reorderBatch'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->reorderBatch(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reorderBatch\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_reorderBatch'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_initWithTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_initWithTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Texture2D* arg0;\n        ssize_t arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithTexture(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTexture\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_initWithTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->lowestAtlasIndexInChild(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"lowestAtlasIndexInChild\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_atlasIndexForChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_atlasIndexForChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Sprite* arg0;\n        int arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->atlasIndexForChild(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"atlasIndexForChild\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_atlasIndexForChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_setTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_setTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextureAtlas* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.TextureAtlas\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::TextureAtlas*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTextureAtlas(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureAtlas\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_setTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_rebuildIndexInOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_rebuildIndexInOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Sprite* arg0;\n        ssize_t arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->rebuildIndexInOrder(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"rebuildIndexInOrder\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_rebuildIndexInOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_increaseAtlasCapacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_increaseAtlasCapacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->increaseAtlasCapacity();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"increaseAtlasCapacity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_increaseAtlasCapacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_getTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_getTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TextureAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TextureAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureAtlas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_getTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_init'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            bool ret = cobj->init();\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            ssize_t arg1;\n            ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithFile(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithFile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_setTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_setTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_setTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_getTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_getTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTexture();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_getTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->highestAtlasIndexInChild(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"highestAtlasIndexInChild\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_removeChildAtIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_removeChildAtIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        ssize_t arg0;\n        bool arg1;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->removeChildAtIndex(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeChildAtIndex\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_removeChildAtIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_removeAllChildrenWithCleanup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_removeAllChildrenWithCleanup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAllChildrenWithCleanup(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllChildrenWithCleanup\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_removeAllChildrenWithCleanup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeSpriteFromAtlas(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeSpriteFromAtlas\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        std::string arg0;\n        ssize_t arg1;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_createWithTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Texture2D* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Texture2D* arg0;\n        ssize_t arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::SpriteBatchNode* ret = cocos2d::SpriteBatchNode::createWithTexture(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTexture\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_createWithTexture'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_SpriteBatchNode_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::SpriteBatchNode();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.SpriteBatchNode\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.SpriteBatchNode\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"SpriteBatchNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_SpriteBatchNode_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SpriteBatchNode)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SpriteBatchNode(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SpriteBatchNode\");\n    tolua_cclass(tolua_S,\"SpriteBatchNode\",\"cc.SpriteBatchNode\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SpriteBatchNode\");\n        tolua_function(tolua_S,\"appendChild\",lua_cocos2dx_SpriteBatchNode_appendChild);\n        tolua_function(tolua_S,\"reorderBatch\",lua_cocos2dx_SpriteBatchNode_reorderBatch);\n        tolua_function(tolua_S,\"initWithTexture\",lua_cocos2dx_SpriteBatchNode_initWithTexture);\n        tolua_function(tolua_S,\"lowestAtlasIndexInChild\",lua_cocos2dx_SpriteBatchNode_lowestAtlasIndexInChild);\n        tolua_function(tolua_S,\"atlasIndexForChild\",lua_cocos2dx_SpriteBatchNode_atlasIndexForChild);\n        tolua_function(tolua_S,\"setTextureAtlas\",lua_cocos2dx_SpriteBatchNode_setTextureAtlas);\n        tolua_function(tolua_S,\"rebuildIndexInOrder\",lua_cocos2dx_SpriteBatchNode_rebuildIndexInOrder);\n        tolua_function(tolua_S,\"increaseAtlasCapacity\",lua_cocos2dx_SpriteBatchNode_increaseAtlasCapacity);\n        tolua_function(tolua_S,\"getTextureAtlas\",lua_cocos2dx_SpriteBatchNode_getTextureAtlas);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_SpriteBatchNode_init);\n        tolua_function(tolua_S,\"setTexture\",lua_cocos2dx_SpriteBatchNode_setTexture);\n        tolua_function(tolua_S,\"getTexture\",lua_cocos2dx_SpriteBatchNode_getTexture);\n        tolua_function(tolua_S,\"highestAtlasIndexInChild\",lua_cocos2dx_SpriteBatchNode_highestAtlasIndexInChild);\n        tolua_function(tolua_S,\"removeChildAtIndex\",lua_cocos2dx_SpriteBatchNode_removeChildAtIndex);\n        tolua_function(tolua_S,\"removeAllChildrenWithCleanup\",lua_cocos2dx_SpriteBatchNode_removeAllChildrenWithCleanup);\n        tolua_function(tolua_S,\"removeSpriteFromAtlas\",lua_cocos2dx_SpriteBatchNode_removeSpriteFromAtlas);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_SpriteBatchNode_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_SpriteBatchNode_create);\n        tolua_function(tolua_S,\"createWithTexture\", lua_cocos2dx_SpriteBatchNode_createWithTexture);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::SpriteBatchNode).name();\n    g_luaType[typeName] = \"cc.SpriteBatchNode\";\n    g_typeCast[\"SpriteBatchNode\"] = \"cc.SpriteBatchNode\";\n    return 1;\n}\n\nint lua_cocos2dx_LabelBMFont_setLineBreakWithoutSpace(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setLineBreakWithoutSpace'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLineBreakWithoutSpace(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLineBreakWithoutSpace\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setLineBreakWithoutSpace'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setScaleY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setScaleY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScaleY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScaleY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setScaleY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setScaleX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setScaleX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScaleX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScaleX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setScaleX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_isOpacityModifyRGB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_isOpacityModifyRGB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isOpacityModifyRGB();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isOpacityModifyRGB\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_isOpacityModifyRGB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_createFontChars(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_createFontChars'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->createFontChars();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"createFontChars\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_createFontChars'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_getString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_getString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getString();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getString\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_getString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setString'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->setString(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setString(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_initWithString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_initWithString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        std::string arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithString(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    if (argc == 3) \n    {\n        std::string arg0;\n        std::string arg1;\n        double arg2;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithString(arg0, arg1, arg2);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    if (argc == 4) \n    {\n        std::string arg0;\n        std::string arg1;\n        double arg2;\n        cocos2d::TextHAlignment arg3;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithString(arg0, arg1, arg2, arg3);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    if (argc == 5) \n    {\n        std::string arg0;\n        std::string arg1;\n        double arg2;\n        cocos2d::TextHAlignment arg3;\n        cocos2d::Point arg4;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n        ok &= luaval_to_point(tolua_S, 6, &arg4);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithString(arg0, arg1, arg2, arg3, arg4);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithString\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_initWithString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setCString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setCString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setCString(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setCString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScale(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScale\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setOpacityModifyRGB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setOpacityModifyRGB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setOpacityModifyRGB(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOpacityModifyRGB\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setOpacityModifyRGB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setFntFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setFntFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFntFile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFntFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setFntFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_getFntFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_getFntFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getFntFile();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFntFile\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_getFntFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_updateLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_updateLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateLabel();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateLabel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_updateLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextHAlignment arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAlignment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAlignment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_setWidth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LabelBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LabelBMFont_setWidth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setWidth(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setWidth\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_setWidth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_purgeCachedData(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::LabelBMFont::purgeCachedData();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"purgeCachedData\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_purgeCachedData'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.LabelBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 4)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n            if (!ok) { break; }\n            cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelBMFont\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelBMFont*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 5)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::TextHAlignment arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n            if (!ok) { break; }\n            cocos2d::Point arg4;\n            ok &= luaval_to_point(tolua_S, 6, &arg4);\n            if (!ok) { break; }\n            cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2, arg3, arg4);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelBMFont\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelBMFont*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelBMFont\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelBMFont*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelBMFont\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelBMFont*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::LabelBMFont* ret = cocos2d::LabelBMFont::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelBMFont\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelBMFont*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_LabelBMFont_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LabelBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::LabelBMFont();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.LabelBMFont\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.LabelBMFont\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"LabelBMFont\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LabelBMFont_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_LabelBMFont_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LabelBMFont)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_LabelBMFont(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.LabelBMFont\");\n    tolua_cclass(tolua_S,\"LabelBMFont\",\"cc.LabelBMFont\",\"cc.SpriteBatchNode\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LabelBMFont\");\n        tolua_function(tolua_S,\"setLineBreakWithoutSpace\",lua_cocos2dx_LabelBMFont_setLineBreakWithoutSpace);\n        tolua_function(tolua_S,\"setScaleY\",lua_cocos2dx_LabelBMFont_setScaleY);\n        tolua_function(tolua_S,\"setScaleX\",lua_cocos2dx_LabelBMFont_setScaleX);\n        tolua_function(tolua_S,\"isOpacityModifyRGB\",lua_cocos2dx_LabelBMFont_isOpacityModifyRGB);\n        tolua_function(tolua_S,\"createFontChars\",lua_cocos2dx_LabelBMFont_createFontChars);\n        tolua_function(tolua_S,\"getString\",lua_cocos2dx_LabelBMFont_getString);\n        tolua_function(tolua_S,\"setString\",lua_cocos2dx_LabelBMFont_setString);\n        tolua_function(tolua_S,\"initWithString\",lua_cocos2dx_LabelBMFont_initWithString);\n        tolua_function(tolua_S,\"setCString\",lua_cocos2dx_LabelBMFont_setCString);\n        tolua_function(tolua_S,\"setScale\",lua_cocos2dx_LabelBMFont_setScale);\n        tolua_function(tolua_S,\"setOpacityModifyRGB\",lua_cocos2dx_LabelBMFont_setOpacityModifyRGB);\n        tolua_function(tolua_S,\"setFntFile\",lua_cocos2dx_LabelBMFont_setFntFile);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_LabelBMFont_init);\n        tolua_function(tolua_S,\"getFntFile\",lua_cocos2dx_LabelBMFont_getFntFile);\n        tolua_function(tolua_S,\"updateLabel\",lua_cocos2dx_LabelBMFont_updateLabel);\n        tolua_function(tolua_S,\"setAlignment\",lua_cocos2dx_LabelBMFont_setAlignment);\n        tolua_function(tolua_S,\"setWidth\",lua_cocos2dx_LabelBMFont_setWidth);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_LabelBMFont_constructor);\n        tolua_function(tolua_S,\"purgeCachedData\", lua_cocos2dx_LabelBMFont_purgeCachedData);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_LabelBMFont_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::LabelBMFont).name();\n    g_luaType[typeName] = \"cc.LabelBMFont\";\n    g_typeCast[\"LabelBMFont\"] = \"cc.LabelBMFont\";\n    return 1;\n}\n\nint lua_cocos2dx_Label_getString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getString();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getString\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_assignNewUTF16String(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_assignNewUTF16String'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned short* arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR unsigned short*;\n        if(!ok)\n            return 0;\n        cobj->assignNewUTF16String(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"assignNewUTF16String\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_assignNewUTF16String'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_setLabelEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_setLabelEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::LabelEffect arg0;\n        cocos2d::Color3B arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_color3b(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->setLabelEffect(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLabelEffect\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_setLabelEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getCommonLineHeight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getCommonLineHeight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getCommonLineHeight();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCommonLineHeight\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getCommonLineHeight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_breakLineWithoutSpace(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_breakLineWithoutSpace'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->breakLineWithoutSpace();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"breakLineWithoutSpace\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_breakLineWithoutSpace'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_setWidth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_setWidth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setWidth(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setWidth\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_setWidth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getMaxLineWidth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getMaxLineWidth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMaxLineWidth();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaxLineWidth\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getMaxLineWidth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getScaleY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getScaleY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScaleY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScaleY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getScaleY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getScaleX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getScaleX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScaleX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScaleX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getScaleX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_setString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_setString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setString(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_setString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getKernings(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getKernings'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int* ret = cobj->getKernings();\n        #pragma warning NO CONVERSION FROM NATIVE FOR int*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getKernings\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getKernings'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_setBMFontFilePath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_setBMFontFilePath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->setBMFontFilePath(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBMFontFilePath\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_setBMFontFilePath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_recordPlaceholderInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_recordPlaceholderInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->recordPlaceholderInfo(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"recordPlaceholderInfo\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_recordPlaceholderInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getFontAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getFontAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::FontAtlas* ret = cobj->getFontAtlas();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FontAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FontAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFontAtlas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getFontAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_setLineBreakWithoutSpace(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_setLineBreakWithoutSpace'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLineBreakWithoutSpace(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLineBreakWithoutSpace\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_setLineBreakWithoutSpace'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getStringNumLines(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getStringNumLines'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getStringNumLines();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringNumLines\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getStringNumLines'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getUTF16String(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getUTF16String'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned short* ret = cobj->getUTF16String();\n        #pragma warning NO CONVERSION FROM NATIVE FOR unsigned short*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getUTF16String\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getUTF16String'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getStringLenght(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getStringLenght'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getStringLenght();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringLenght\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getStringLenght'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_onDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_onDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->onDraw();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onDraw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_onDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_setCharMap(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_setCharMap'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 4) {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            int arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n            if (!ok) { break; }\n            bool ret = cobj->setCharMap(arg0, arg1, arg2, arg3);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 4) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            int arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n            if (!ok) { break; }\n            bool ret = cobj->setCharMap(arg0, arg1, arg2, arg3);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            bool ret = cobj->setCharMap(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCharMap\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_setCharMap'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getLetter(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getLetter'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getLetter(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLetter\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getLetter'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_getTextAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_getTextAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getTextAlignment();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextAlignment\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_getTextAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_setAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_setAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextHAlignment arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAlignment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAlignment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_setAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_recordLetterInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Label* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Label*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Label_recordLetterInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Point arg0;\n        unsigned short arg1;\n        int arg2;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_ushort(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        bool ret = cobj->recordLetterInfo(arg0, arg1, arg2);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"recordLetterInfo\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_recordLetterInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Label_createWithBMFont(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        std::string arg0;\n        std::string arg1;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Label\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Label*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        std::string arg0;\n        std::string arg1;\n        cocos2d::TextHAlignment arg2;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Label\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Label*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        std::string arg0;\n        std::string arg1;\n        cocos2d::TextHAlignment arg2;\n        int arg3;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::Label* ret = cocos2d::Label::createWithBMFont(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Label\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Label*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithBMFont\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_createWithBMFont'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Label_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Label* ret = cocos2d::Label::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Label\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Label*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Label_createWithCharMap(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 4)\n        {\n            cocos2d::Texture2D* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            int arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n            if (!ok) { break; }\n            cocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Label\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Label*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 4)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            int arg3;\n            ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n            if (!ok) { break; }\n            cocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Label\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Label*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 1)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Label* ret = cocos2d::Label::createWithCharMap(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Label\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Label*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"createWithCharMap\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Label_createWithCharMap'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Label_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Label)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Label(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Label\");\n    tolua_cclass(tolua_S,\"Label\",\"cc.Label\",\"cc.SpriteBatchNode\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Label\");\n        tolua_function(tolua_S,\"getString\",lua_cocos2dx_Label_getString);\n        tolua_function(tolua_S,\"assignNewUTF16String\",lua_cocos2dx_Label_assignNewUTF16String);\n        tolua_function(tolua_S,\"setLabelEffect\",lua_cocos2dx_Label_setLabelEffect);\n        tolua_function(tolua_S,\"getCommonLineHeight\",lua_cocos2dx_Label_getCommonLineHeight);\n        tolua_function(tolua_S,\"breakLineWithoutSpace\",lua_cocos2dx_Label_breakLineWithoutSpace);\n        tolua_function(tolua_S,\"setWidth\",lua_cocos2dx_Label_setWidth);\n        tolua_function(tolua_S,\"getMaxLineWidth\",lua_cocos2dx_Label_getMaxLineWidth);\n        tolua_function(tolua_S,\"getScaleY\",lua_cocos2dx_Label_getScaleY);\n        tolua_function(tolua_S,\"getScaleX\",lua_cocos2dx_Label_getScaleX);\n        tolua_function(tolua_S,\"setString\",lua_cocos2dx_Label_setString);\n        tolua_function(tolua_S,\"getKernings\",lua_cocos2dx_Label_getKernings);\n        tolua_function(tolua_S,\"setBMFontFilePath\",lua_cocos2dx_Label_setBMFontFilePath);\n        tolua_function(tolua_S,\"recordPlaceholderInfo\",lua_cocos2dx_Label_recordPlaceholderInfo);\n        tolua_function(tolua_S,\"getFontAtlas\",lua_cocos2dx_Label_getFontAtlas);\n        tolua_function(tolua_S,\"setLineBreakWithoutSpace\",lua_cocos2dx_Label_setLineBreakWithoutSpace);\n        tolua_function(tolua_S,\"getStringNumLines\",lua_cocos2dx_Label_getStringNumLines);\n        tolua_function(tolua_S,\"getUTF16String\",lua_cocos2dx_Label_getUTF16String);\n        tolua_function(tolua_S,\"getStringLenght\",lua_cocos2dx_Label_getStringLenght);\n        tolua_function(tolua_S,\"onDraw\",lua_cocos2dx_Label_onDraw);\n        tolua_function(tolua_S,\"setCharMap\",lua_cocos2dx_Label_setCharMap);\n        tolua_function(tolua_S,\"getLetter\",lua_cocos2dx_Label_getLetter);\n        tolua_function(tolua_S,\"getTextAlignment\",lua_cocos2dx_Label_getTextAlignment);\n        tolua_function(tolua_S,\"setAlignment\",lua_cocos2dx_Label_setAlignment);\n        tolua_function(tolua_S,\"recordLetterInfo\",lua_cocos2dx_Label_recordLetterInfo);\n        tolua_function(tolua_S,\"createWithBMFont\", lua_cocos2dx_Label_createWithBMFont);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Label_create);\n        tolua_function(tolua_S,\"createWithCharMap\", lua_cocos2dx_Label_createWithCharMap);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Label).name();\n    g_luaType[typeName] = \"cc.Label\";\n    g_typeCast[\"Label\"] = \"cc.Label\";\n    return 1;\n}\n\nint lua_cocos2dx_Layer_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Layer* ret = cocos2d::Layer::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Layer\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Layer*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Layer_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Layer_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Layer)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Layer(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Layer\");\n    tolua_cclass(tolua_S,\"Layer\",\"cc.Layer\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Layer\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Layer_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Layer).name();\n    g_luaType[typeName] = \"cc.Layer\";\n    g_typeCast[\"Layer\"] = \"cc.Layer\";\n    return 1;\n}\n\nint lua_cocos2dx_LayerColor_changeWidthAndHeight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerColor* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerColor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeWidthAndHeight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        double arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->changeWidthAndHeight(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeWidthAndHeight\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerColor_changeWidthAndHeight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerColor_onDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerColor* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerColor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_onDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->onDraw();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onDraw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerColor_onDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerColor_changeWidth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerColor* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerColor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeWidth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->changeWidth(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeWidth\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerColor_changeWidth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerColor_changeHeight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerColor* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerColor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerColor*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerColor_changeHeight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->changeHeight(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeHeight\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerColor_changeHeight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerColor_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.LayerColor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Color4B arg0;\n            ok &=luaval_to_color4b(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::LayerColor* ret = cocos2d::LayerColor::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LayerColor\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LayerColor*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::LayerColor* ret = cocos2d::LayerColor::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LayerColor\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LayerColor*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::Color4B arg0;\n            ok &=luaval_to_color4b(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::LayerColor* ret = cocos2d::LayerColor::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LayerColor\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LayerColor*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerColor_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_LayerColor_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LayerColor)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_LayerColor(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.LayerColor\");\n    tolua_cclass(tolua_S,\"LayerColor\",\"cc.LayerColor\",\"cc.Layer\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LayerColor\");\n        tolua_function(tolua_S,\"changeWidthAndHeight\",lua_cocos2dx_LayerColor_changeWidthAndHeight);\n        tolua_function(tolua_S,\"onDraw\",lua_cocos2dx_LayerColor_onDraw);\n        tolua_function(tolua_S,\"changeWidth\",lua_cocos2dx_LayerColor_changeWidth);\n        tolua_function(tolua_S,\"changeHeight\",lua_cocos2dx_LayerColor_changeHeight);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_LayerColor_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::LayerColor).name();\n    g_luaType[typeName] = \"cc.LayerColor\";\n    g_typeCast[\"LayerColor\"] = \"cc.LayerColor\";\n    return 1;\n}\n\nint lua_cocos2dx_LayerGradient_getStartColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_getStartColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color3B& ret = cobj->getStartColor();\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_getStartColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_isCompressedInterpolation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_isCompressedInterpolation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isCompressedInterpolation();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isCompressedInterpolation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_isCompressedInterpolation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_getStartOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_getStartOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        uint16_t ret = cobj->getStartOpacity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartOpacity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_getStartOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_setVector(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_setVector'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setVector(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVector\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_setVector'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_setStartOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_setStartOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        uint16_t arg0;\n\n        ok &= luaval_to_uint16(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartOpacity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartOpacity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_setStartOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_setCompressedInterpolation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_setCompressedInterpolation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCompressedInterpolation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCompressedInterpolation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_setCompressedInterpolation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_setEndOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_setEndOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        uint16_t arg0;\n\n        ok &= luaval_to_uint16(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndOpacity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndOpacity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_setEndOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_getVector(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_getVector'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getVector();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVector\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_getVector'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_initWithColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_initWithColor'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Color4B arg0;\n            ok &=luaval_to_color4b(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cocos2d::Color4B arg1;\n            ok &=luaval_to_color4b(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithColor(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            bool ret = cobj->init();\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            cocos2d::Color4B arg0;\n            ok &=luaval_to_color4b(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cocos2d::Color4B arg1;\n            ok &=luaval_to_color4b(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cocos2d::Point arg2;\n            ok &= luaval_to_point(tolua_S, 4, &arg2);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithColor(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithColor\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_initWithColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_setEndColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_setEndColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_setEndColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_getEndColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_getEndColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color3B& ret = cobj->getEndColor();\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_getEndColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_getEndOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_getEndOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        uint16_t ret = cobj->getEndOpacity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndOpacity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_getEndOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_setStartColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerGradient* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerGradient*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerGradient_setStartColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_setStartColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerGradient_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.LayerGradient\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Color4B arg0;\n            ok &=luaval_to_color4b(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::Color4B arg1;\n            ok &=luaval_to_color4b(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LayerGradient\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LayerGradient*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LayerGradient\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LayerGradient*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Color4B arg0;\n            ok &=luaval_to_color4b(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::Color4B arg1;\n            ok &=luaval_to_color4b(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::Point arg2;\n            ok &= luaval_to_point(tolua_S, 4, &arg2);\n            if (!ok) { break; }\n            cocos2d::LayerGradient* ret = cocos2d::LayerGradient::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LayerGradient\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LayerGradient*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerGradient_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_LayerGradient_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LayerGradient)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_LayerGradient(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.LayerGradient\");\n    tolua_cclass(tolua_S,\"LayerGradient\",\"cc.LayerGradient\",\"cc.LayerColor\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LayerGradient\");\n        tolua_function(tolua_S,\"getStartColor\",lua_cocos2dx_LayerGradient_getStartColor);\n        tolua_function(tolua_S,\"isCompressedInterpolation\",lua_cocos2dx_LayerGradient_isCompressedInterpolation);\n        tolua_function(tolua_S,\"getStartOpacity\",lua_cocos2dx_LayerGradient_getStartOpacity);\n        tolua_function(tolua_S,\"setVector\",lua_cocos2dx_LayerGradient_setVector);\n        tolua_function(tolua_S,\"setStartOpacity\",lua_cocos2dx_LayerGradient_setStartOpacity);\n        tolua_function(tolua_S,\"setCompressedInterpolation\",lua_cocos2dx_LayerGradient_setCompressedInterpolation);\n        tolua_function(tolua_S,\"setEndOpacity\",lua_cocos2dx_LayerGradient_setEndOpacity);\n        tolua_function(tolua_S,\"getVector\",lua_cocos2dx_LayerGradient_getVector);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_LayerGradient_initWithColor);\n        tolua_function(tolua_S,\"setEndColor\",lua_cocos2dx_LayerGradient_setEndColor);\n        tolua_function(tolua_S,\"getEndColor\",lua_cocos2dx_LayerGradient_getEndColor);\n        tolua_function(tolua_S,\"getEndOpacity\",lua_cocos2dx_LayerGradient_getEndOpacity);\n        tolua_function(tolua_S,\"setStartColor\",lua_cocos2dx_LayerGradient_setStartColor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_LayerGradient_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::LayerGradient).name();\n    g_luaType[typeName] = \"cc.LayerGradient\";\n    g_typeCast[\"LayerGradient\"] = \"cc.LayerGradient\";\n    return 1;\n}\n\nint lua_cocos2dx_LayerMultiplex_switchToAndReleaseMe(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerMultiplex* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerMultiplex\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerMultiplex*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerMultiplex_switchToAndReleaseMe'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->switchToAndReleaseMe(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"switchToAndReleaseMe\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerMultiplex_switchToAndReleaseMe'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerMultiplex_addLayer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerMultiplex* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerMultiplex\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerMultiplex*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerMultiplex_addLayer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Layer* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Layer\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Layer*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addLayer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addLayer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerMultiplex_addLayer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_LayerMultiplex_switchTo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::LayerMultiplex* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.LayerMultiplex\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::LayerMultiplex*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_LayerMultiplex_switchTo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->switchTo(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"switchTo\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_LayerMultiplex_switchTo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_LayerMultiplex_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LayerMultiplex)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_LayerMultiplex(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.LayerMultiplex\");\n    tolua_cclass(tolua_S,\"LayerMultiplex\",\"cc.LayerMultiplex\",\"cc.Layer\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LayerMultiplex\");\n        tolua_function(tolua_S,\"switchToAndReleaseMe\",lua_cocos2dx_LayerMultiplex_switchToAndReleaseMe);\n        tolua_function(tolua_S,\"addLayer\",lua_cocos2dx_LayerMultiplex_addLayer);\n        tolua_function(tolua_S,\"switchTo\",lua_cocos2dx_LayerMultiplex_switchTo);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::LayerMultiplex).name();\n    g_luaType[typeName] = \"cc.LayerMultiplex\";\n    g_typeCast[\"LayerMultiplex\"] = \"cc.LayerMultiplex\";\n    return 1;\n}\n\nint lua_cocos2dx_Scene_getPhysicsWorld(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Scene* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scene\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Scene*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Scene_getPhysicsWorld'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsWorld* ret = cobj->getPhysicsWorld();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsWorld\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsWorld*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPhysicsWorld\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Scene_getPhysicsWorld'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Scene_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Scene\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Scene* ret = cocos2d::Scene::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scene\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Scene*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Scene_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_Scene_createWithPhysics(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Scene\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Scene* ret = cocos2d::Scene::createWithPhysics();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scene\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Scene*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithPhysics\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Scene_createWithPhysics'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Scene_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Scene)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Scene(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Scene\");\n    tolua_cclass(tolua_S,\"Scene\",\"cc.Scene\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Scene\");\n        tolua_function(tolua_S,\"getPhysicsWorld\",lua_cocos2dx_Scene_getPhysicsWorld);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Scene_create);\n        tolua_function(tolua_S,\"createWithPhysics\", lua_cocos2dx_Scene_createWithPhysics);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Scene).name();\n    g_luaType[typeName] = \"cc.Scene\";\n    g_typeCast[\"Scene\"] = \"cc.Scene\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionEaseScene_easeActionWithAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionEaseScene* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionEaseScene\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionEaseScene*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionEaseScene_easeActionWithAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"easeActionWithAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionEaseScene_easeActionWithAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionEaseScene_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionEaseScene)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionEaseScene(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionEaseScene\");\n    tolua_cclass(tolua_S,\"TransitionEaseScene\",\"cc.TransitionEaseScene\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionEaseScene\");\n        tolua_function(tolua_S,\"easeActionWithAction\",lua_cocos2dx_TransitionEaseScene_easeActionWithAction);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionEaseScene).name();\n    g_luaType[typeName] = \"cc.TransitionEaseScene\";\n    g_typeCast[\"TransitionEaseScene\"] = \"cc.TransitionEaseScene\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionScene_finish(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionScene* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionScene\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionScene*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionScene_finish'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->finish();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"finish\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionScene_finish'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionScene_hideOutShowIn(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionScene* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionScene\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionScene*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionScene_hideOutShowIn'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->hideOutShowIn();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hideOutShowIn\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionScene_hideOutShowIn'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionScene_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionScene\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionScene* ret = cocos2d::TransitionScene::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionScene\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionScene*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionScene_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionScene_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionScene)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionScene(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionScene\");\n    tolua_cclass(tolua_S,\"TransitionScene\",\"cc.TransitionScene\",\"cc.Scene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionScene\");\n        tolua_function(tolua_S,\"finish\",lua_cocos2dx_TransitionScene_finish);\n        tolua_function(tolua_S,\"hideOutShowIn\",lua_cocos2dx_TransitionScene_hideOutShowIn);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionScene_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionScene).name();\n    g_luaType[typeName] = \"cc.TransitionScene\";\n    g_typeCast[\"TransitionScene\"] = \"cc.TransitionScene\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionSceneOriented_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionSceneOriented\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        cocos2d::TransitionScene::Orientation arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionSceneOriented* ret = cocos2d::TransitionSceneOriented::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionSceneOriented\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionSceneOriented*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSceneOriented_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionSceneOriented_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionSceneOriented)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionSceneOriented(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionSceneOriented\");\n    tolua_cclass(tolua_S,\"TransitionSceneOriented\",\"cc.TransitionSceneOriented\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionSceneOriented\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionSceneOriented_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionSceneOriented).name();\n    g_luaType[typeName] = \"cc.TransitionSceneOriented\";\n    g_typeCast[\"TransitionSceneOriented\"] = \"cc.TransitionSceneOriented\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionRotoZoom_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionRotoZoom\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionRotoZoom* ret = cocos2d::TransitionRotoZoom::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionRotoZoom\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionRotoZoom*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionRotoZoom_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionRotoZoom_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionRotoZoom)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionRotoZoom(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionRotoZoom\");\n    tolua_cclass(tolua_S,\"TransitionRotoZoom\",\"cc.TransitionRotoZoom\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionRotoZoom\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionRotoZoom_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionRotoZoom).name();\n    g_luaType[typeName] = \"cc.TransitionRotoZoom\";\n    g_typeCast[\"TransitionRotoZoom\"] = \"cc.TransitionRotoZoom\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionJumpZoom_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionJumpZoom\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionJumpZoom* ret = cocos2d::TransitionJumpZoom::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionJumpZoom\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionJumpZoom*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionJumpZoom_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionJumpZoom_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionJumpZoom)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionJumpZoom(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionJumpZoom\");\n    tolua_cclass(tolua_S,\"TransitionJumpZoom\",\"cc.TransitionJumpZoom\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionJumpZoom\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionJumpZoom_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionJumpZoom).name();\n    g_luaType[typeName] = \"cc.TransitionJumpZoom\";\n    g_typeCast[\"TransitionJumpZoom\"] = \"cc.TransitionJumpZoom\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionMoveInL_action(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionMoveInL* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionMoveInL\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionMoveInL*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionMoveInL_action'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->action();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"action\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionMoveInL_action'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionMoveInL_easeActionWithAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionMoveInL* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionMoveInL\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionMoveInL*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionMoveInL_easeActionWithAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"easeActionWithAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionMoveInL_easeActionWithAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionMoveInL_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionMoveInL\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionMoveInL* ret = cocos2d::TransitionMoveInL::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionMoveInL\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionMoveInL*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionMoveInL_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionMoveInL_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionMoveInL)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionMoveInL(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionMoveInL\");\n    tolua_cclass(tolua_S,\"TransitionMoveInL\",\"cc.TransitionMoveInL\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionMoveInL\");\n        tolua_function(tolua_S,\"action\",lua_cocos2dx_TransitionMoveInL_action);\n        tolua_function(tolua_S,\"easeActionWithAction\",lua_cocos2dx_TransitionMoveInL_easeActionWithAction);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionMoveInL_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionMoveInL).name();\n    g_luaType[typeName] = \"cc.TransitionMoveInL\";\n    g_typeCast[\"TransitionMoveInL\"] = \"cc.TransitionMoveInL\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionMoveInR_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionMoveInR\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionMoveInR* ret = cocos2d::TransitionMoveInR::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionMoveInR\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionMoveInR*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionMoveInR_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionMoveInR_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionMoveInR)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionMoveInR(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionMoveInR\");\n    tolua_cclass(tolua_S,\"TransitionMoveInR\",\"cc.TransitionMoveInR\",\"cc.TransitionMoveInL\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionMoveInR\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionMoveInR_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionMoveInR).name();\n    g_luaType[typeName] = \"cc.TransitionMoveInR\";\n    g_typeCast[\"TransitionMoveInR\"] = \"cc.TransitionMoveInR\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionMoveInT_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionMoveInT\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionMoveInT* ret = cocos2d::TransitionMoveInT::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionMoveInT\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionMoveInT*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionMoveInT_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionMoveInT_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionMoveInT)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionMoveInT(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionMoveInT\");\n    tolua_cclass(tolua_S,\"TransitionMoveInT\",\"cc.TransitionMoveInT\",\"cc.TransitionMoveInL\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionMoveInT\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionMoveInT_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionMoveInT).name();\n    g_luaType[typeName] = \"cc.TransitionMoveInT\";\n    g_typeCast[\"TransitionMoveInT\"] = \"cc.TransitionMoveInT\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionMoveInB_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionMoveInB\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionMoveInB* ret = cocos2d::TransitionMoveInB::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionMoveInB\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionMoveInB*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionMoveInB_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionMoveInB_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionMoveInB)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionMoveInB(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionMoveInB\");\n    tolua_cclass(tolua_S,\"TransitionMoveInB\",\"cc.TransitionMoveInB\",\"cc.TransitionMoveInL\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionMoveInB\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionMoveInB_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionMoveInB).name();\n    g_luaType[typeName] = \"cc.TransitionMoveInB\";\n    g_typeCast[\"TransitionMoveInB\"] = \"cc.TransitionMoveInB\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionSlideInL_action(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionSlideInL* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionSlideInL\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionSlideInL*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionSlideInL_action'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->action();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"action\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInL_action'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionSlideInL_easeActionWithAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionSlideInL* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionSlideInL\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionSlideInL*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionSlideInL_easeActionWithAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"easeActionWithAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInL_easeActionWithAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionSlideInL_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionSlideInL\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionSlideInL* ret = cocos2d::TransitionSlideInL::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionSlideInL\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionSlideInL*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInL_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionSlideInL_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionSlideInL)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionSlideInL(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionSlideInL\");\n    tolua_cclass(tolua_S,\"TransitionSlideInL\",\"cc.TransitionSlideInL\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionSlideInL\");\n        tolua_function(tolua_S,\"action\",lua_cocos2dx_TransitionSlideInL_action);\n        tolua_function(tolua_S,\"easeActionWithAction\",lua_cocos2dx_TransitionSlideInL_easeActionWithAction);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionSlideInL_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionSlideInL).name();\n    g_luaType[typeName] = \"cc.TransitionSlideInL\";\n    g_typeCast[\"TransitionSlideInL\"] = \"cc.TransitionSlideInL\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionSlideInR_action(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionSlideInR* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionSlideInR\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionSlideInR*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionSlideInR_action'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->action();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"action\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInR_action'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionSlideInR_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionSlideInR\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionSlideInR* ret = cocos2d::TransitionSlideInR::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionSlideInR\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionSlideInR*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInR_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionSlideInR_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionSlideInR)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionSlideInR(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionSlideInR\");\n    tolua_cclass(tolua_S,\"TransitionSlideInR\",\"cc.TransitionSlideInR\",\"cc.TransitionSlideInL\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionSlideInR\");\n        tolua_function(tolua_S,\"action\",lua_cocos2dx_TransitionSlideInR_action);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionSlideInR_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionSlideInR).name();\n    g_luaType[typeName] = \"cc.TransitionSlideInR\";\n    g_typeCast[\"TransitionSlideInR\"] = \"cc.TransitionSlideInR\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionSlideInB_action(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionSlideInB* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionSlideInB\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionSlideInB*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionSlideInB_action'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->action();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"action\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInB_action'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionSlideInB_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionSlideInB\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionSlideInB* ret = cocos2d::TransitionSlideInB::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionSlideInB\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionSlideInB*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInB_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionSlideInB_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionSlideInB)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionSlideInB(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionSlideInB\");\n    tolua_cclass(tolua_S,\"TransitionSlideInB\",\"cc.TransitionSlideInB\",\"cc.TransitionSlideInL\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionSlideInB\");\n        tolua_function(tolua_S,\"action\",lua_cocos2dx_TransitionSlideInB_action);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionSlideInB_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionSlideInB).name();\n    g_luaType[typeName] = \"cc.TransitionSlideInB\";\n    g_typeCast[\"TransitionSlideInB\"] = \"cc.TransitionSlideInB\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionSlideInT_action(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionSlideInT* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionSlideInT\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionSlideInT*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionSlideInT_action'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->action();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"action\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInT_action'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionSlideInT_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionSlideInT\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionSlideInT* ret = cocos2d::TransitionSlideInT::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionSlideInT\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionSlideInT*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSlideInT_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionSlideInT_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionSlideInT)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionSlideInT(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionSlideInT\");\n    tolua_cclass(tolua_S,\"TransitionSlideInT\",\"cc.TransitionSlideInT\",\"cc.TransitionSlideInL\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionSlideInT\");\n        tolua_function(tolua_S,\"action\",lua_cocos2dx_TransitionSlideInT_action);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionSlideInT_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionSlideInT).name();\n    g_luaType[typeName] = \"cc.TransitionSlideInT\";\n    g_typeCast[\"TransitionSlideInT\"] = \"cc.TransitionSlideInT\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionShrinkGrow_easeActionWithAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionShrinkGrow* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionShrinkGrow\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionShrinkGrow*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionShrinkGrow_easeActionWithAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"easeActionWithAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionShrinkGrow_easeActionWithAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionShrinkGrow_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionShrinkGrow\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionShrinkGrow* ret = cocos2d::TransitionShrinkGrow::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionShrinkGrow\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionShrinkGrow*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionShrinkGrow_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionShrinkGrow_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionShrinkGrow)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionShrinkGrow(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionShrinkGrow\");\n    tolua_cclass(tolua_S,\"TransitionShrinkGrow\",\"cc.TransitionShrinkGrow\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionShrinkGrow\");\n        tolua_function(tolua_S,\"easeActionWithAction\",lua_cocos2dx_TransitionShrinkGrow_easeActionWithAction);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionShrinkGrow_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionShrinkGrow).name();\n    g_luaType[typeName] = \"cc.TransitionShrinkGrow\";\n    g_typeCast[\"TransitionShrinkGrow\"] = \"cc.TransitionShrinkGrow\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFlipX_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFlipX\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionFlipX* ret = cocos2d::TransitionFlipX::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFlipX\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFlipX*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionScene::Orientation arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            cocos2d::TransitionFlipX* ret = cocos2d::TransitionFlipX::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFlipX\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFlipX*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFlipX_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFlipX_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFlipX)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFlipX(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFlipX\");\n    tolua_cclass(tolua_S,\"TransitionFlipX\",\"cc.TransitionFlipX\",\"cc.TransitionSceneOriented\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFlipX\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFlipX_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFlipX).name();\n    g_luaType[typeName] = \"cc.TransitionFlipX\";\n    g_typeCast[\"TransitionFlipX\"] = \"cc.TransitionFlipX\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFlipY_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFlipY\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionFlipY* ret = cocos2d::TransitionFlipY::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFlipY\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFlipY*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionScene::Orientation arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            cocos2d::TransitionFlipY* ret = cocos2d::TransitionFlipY::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFlipY\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFlipY*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFlipY_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFlipY_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFlipY)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFlipY(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFlipY\");\n    tolua_cclass(tolua_S,\"TransitionFlipY\",\"cc.TransitionFlipY\",\"cc.TransitionSceneOriented\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFlipY\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFlipY_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFlipY).name();\n    g_luaType[typeName] = \"cc.TransitionFlipY\";\n    g_typeCast[\"TransitionFlipY\"] = \"cc.TransitionFlipY\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFlipAngular_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFlipAngular\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionFlipAngular* ret = cocos2d::TransitionFlipAngular::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFlipAngular\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFlipAngular*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionScene::Orientation arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            cocos2d::TransitionFlipAngular* ret = cocos2d::TransitionFlipAngular::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFlipAngular\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFlipAngular*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFlipAngular_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFlipAngular_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFlipAngular)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFlipAngular(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFlipAngular\");\n    tolua_cclass(tolua_S,\"TransitionFlipAngular\",\"cc.TransitionFlipAngular\",\"cc.TransitionSceneOriented\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFlipAngular\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFlipAngular_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFlipAngular).name();\n    g_luaType[typeName] = \"cc.TransitionFlipAngular\";\n    g_typeCast[\"TransitionFlipAngular\"] = \"cc.TransitionFlipAngular\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionZoomFlipX_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionZoomFlipX\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionZoomFlipX* ret = cocos2d::TransitionZoomFlipX::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionZoomFlipX\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionZoomFlipX*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionScene::Orientation arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            cocos2d::TransitionZoomFlipX* ret = cocos2d::TransitionZoomFlipX::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionZoomFlipX\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionZoomFlipX*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionZoomFlipX_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionZoomFlipX_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionZoomFlipX)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionZoomFlipX(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionZoomFlipX\");\n    tolua_cclass(tolua_S,\"TransitionZoomFlipX\",\"cc.TransitionZoomFlipX\",\"cc.TransitionSceneOriented\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionZoomFlipX\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionZoomFlipX_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionZoomFlipX).name();\n    g_luaType[typeName] = \"cc.TransitionZoomFlipX\";\n    g_typeCast[\"TransitionZoomFlipX\"] = \"cc.TransitionZoomFlipX\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionZoomFlipY_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionZoomFlipY\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionZoomFlipY* ret = cocos2d::TransitionZoomFlipY::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionZoomFlipY\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionZoomFlipY*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionScene::Orientation arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            cocos2d::TransitionZoomFlipY* ret = cocos2d::TransitionZoomFlipY::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionZoomFlipY\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionZoomFlipY*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionZoomFlipY_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionZoomFlipY_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionZoomFlipY)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionZoomFlipY(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionZoomFlipY\");\n    tolua_cclass(tolua_S,\"TransitionZoomFlipY\",\"cc.TransitionZoomFlipY\",\"cc.TransitionSceneOriented\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionZoomFlipY\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionZoomFlipY_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionZoomFlipY).name();\n    g_luaType[typeName] = \"cc.TransitionZoomFlipY\";\n    g_typeCast[\"TransitionZoomFlipY\"] = \"cc.TransitionZoomFlipY\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionZoomFlipAngular_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionZoomFlipAngular\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionZoomFlipAngular* ret = cocos2d::TransitionZoomFlipAngular::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionZoomFlipAngular\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionZoomFlipAngular*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionScene::Orientation arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            cocos2d::TransitionZoomFlipAngular* ret = cocos2d::TransitionZoomFlipAngular::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionZoomFlipAngular\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionZoomFlipAngular*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionZoomFlipAngular_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionZoomFlipAngular_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionZoomFlipAngular)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionZoomFlipAngular(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionZoomFlipAngular\");\n    tolua_cclass(tolua_S,\"TransitionZoomFlipAngular\",\"cc.TransitionZoomFlipAngular\",\"cc.TransitionSceneOriented\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionZoomFlipAngular\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionZoomFlipAngular_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionZoomFlipAngular).name();\n    g_luaType[typeName] = \"cc.TransitionZoomFlipAngular\";\n    g_typeCast[\"TransitionZoomFlipAngular\"] = \"cc.TransitionZoomFlipAngular\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFade_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFade\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::TransitionFade* ret = cocos2d::TransitionFade::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFade\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFade*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::Scene* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Color3B arg2;\n            ok &= luaval_to_color3b(tolua_S, 4, &arg2);\n            if (!ok) { break; }\n            cocos2d::TransitionFade* ret = cocos2d::TransitionFade::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFade\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFade*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFade_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFade_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFade)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFade(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFade\");\n    tolua_cclass(tolua_S,\"TransitionFade\",\"cc.TransitionFade\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFade\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFade_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFade).name();\n    g_luaType[typeName] = \"cc.TransitionFade\";\n    g_typeCast[\"TransitionFade\"] = \"cc.TransitionFade\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionCrossFade_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionCrossFade\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionCrossFade* ret = cocos2d::TransitionCrossFade::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionCrossFade\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionCrossFade*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionCrossFade_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionCrossFade_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionCrossFade)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionCrossFade(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionCrossFade\");\n    tolua_cclass(tolua_S,\"TransitionCrossFade\",\"cc.TransitionCrossFade\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionCrossFade\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionCrossFade_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionCrossFade).name();\n    g_luaType[typeName] = \"cc.TransitionCrossFade\";\n    g_typeCast[\"TransitionCrossFade\"] = \"cc.TransitionCrossFade\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionTurnOffTiles_easeActionWithAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionTurnOffTiles* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionTurnOffTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionTurnOffTiles*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionTurnOffTiles_easeActionWithAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"easeActionWithAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionTurnOffTiles_easeActionWithAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionTurnOffTiles_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionTurnOffTiles\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionTurnOffTiles* ret = cocos2d::TransitionTurnOffTiles::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionTurnOffTiles\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionTurnOffTiles*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionTurnOffTiles_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionTurnOffTiles_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionTurnOffTiles)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionTurnOffTiles(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionTurnOffTiles\");\n    tolua_cclass(tolua_S,\"TransitionTurnOffTiles\",\"cc.TransitionTurnOffTiles\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionTurnOffTiles\");\n        tolua_function(tolua_S,\"easeActionWithAction\",lua_cocos2dx_TransitionTurnOffTiles_easeActionWithAction);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionTurnOffTiles_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionTurnOffTiles).name();\n    g_luaType[typeName] = \"cc.TransitionTurnOffTiles\";\n    g_typeCast[\"TransitionTurnOffTiles\"] = \"cc.TransitionTurnOffTiles\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionSplitCols_action(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionSplitCols* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionSplitCols\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionSplitCols*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionSplitCols_action'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->action();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"action\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSplitCols_action'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionSplitCols_easeActionWithAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionSplitCols* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionSplitCols\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionSplitCols*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionSplitCols_easeActionWithAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"easeActionWithAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSplitCols_easeActionWithAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionSplitCols_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionSplitCols\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionSplitCols* ret = cocos2d::TransitionSplitCols::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionSplitCols\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionSplitCols*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSplitCols_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionSplitCols_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionSplitCols)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionSplitCols(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionSplitCols\");\n    tolua_cclass(tolua_S,\"TransitionSplitCols\",\"cc.TransitionSplitCols\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionSplitCols\");\n        tolua_function(tolua_S,\"action\",lua_cocos2dx_TransitionSplitCols_action);\n        tolua_function(tolua_S,\"easeActionWithAction\",lua_cocos2dx_TransitionSplitCols_easeActionWithAction);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionSplitCols_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionSplitCols).name();\n    g_luaType[typeName] = \"cc.TransitionSplitCols\";\n    g_typeCast[\"TransitionSplitCols\"] = \"cc.TransitionSplitCols\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionSplitRows_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionSplitRows\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionSplitRows* ret = cocos2d::TransitionSplitRows::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionSplitRows\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionSplitRows*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionSplitRows_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionSplitRows_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionSplitRows)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionSplitRows(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionSplitRows\");\n    tolua_cclass(tolua_S,\"TransitionSplitRows\",\"cc.TransitionSplitRows\",\"cc.TransitionSplitCols\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionSplitRows\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionSplitRows_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionSplitRows).name();\n    g_luaType[typeName] = \"cc.TransitionSplitRows\";\n    g_typeCast[\"TransitionSplitRows\"] = \"cc.TransitionSplitRows\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFadeTR_easeActionWithAction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionFadeTR* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionFadeTR\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionFadeTR*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionFadeTR_easeActionWithAction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ActionInterval* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ActionInterval\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ActionInterval*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->easeActionWithAction(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"easeActionWithAction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFadeTR_easeActionWithAction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionFadeTR_actionWithSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionFadeTR* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionFadeTR\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionFadeTR*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionFadeTR_actionWithSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->actionWithSize(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"actionWithSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFadeTR_actionWithSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionFadeTR_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFadeTR\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionFadeTR* ret = cocos2d::TransitionFadeTR::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFadeTR\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFadeTR*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFadeTR_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFadeTR_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFadeTR)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFadeTR(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFadeTR\");\n    tolua_cclass(tolua_S,\"TransitionFadeTR\",\"cc.TransitionFadeTR\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFadeTR\");\n        tolua_function(tolua_S,\"easeActionWithAction\",lua_cocos2dx_TransitionFadeTR_easeActionWithAction);\n        tolua_function(tolua_S,\"actionWithSize\",lua_cocos2dx_TransitionFadeTR_actionWithSize);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFadeTR_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFadeTR).name();\n    g_luaType[typeName] = \"cc.TransitionFadeTR\";\n    g_typeCast[\"TransitionFadeTR\"] = \"cc.TransitionFadeTR\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFadeBL_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFadeBL\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionFadeBL* ret = cocos2d::TransitionFadeBL::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFadeBL\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFadeBL*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFadeBL_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFadeBL_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFadeBL)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFadeBL(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFadeBL\");\n    tolua_cclass(tolua_S,\"TransitionFadeBL\",\"cc.TransitionFadeBL\",\"cc.TransitionFadeTR\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFadeBL\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFadeBL_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFadeBL).name();\n    g_luaType[typeName] = \"cc.TransitionFadeBL\";\n    g_typeCast[\"TransitionFadeBL\"] = \"cc.TransitionFadeBL\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFadeUp_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFadeUp\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionFadeUp* ret = cocos2d::TransitionFadeUp::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFadeUp\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFadeUp*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFadeUp_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFadeUp_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFadeUp)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFadeUp(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFadeUp\");\n    tolua_cclass(tolua_S,\"TransitionFadeUp\",\"cc.TransitionFadeUp\",\"cc.TransitionFadeTR\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFadeUp\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFadeUp_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFadeUp).name();\n    g_luaType[typeName] = \"cc.TransitionFadeUp\";\n    g_typeCast[\"TransitionFadeUp\"] = \"cc.TransitionFadeUp\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionFadeDown_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionFadeDown\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionFadeDown* ret = cocos2d::TransitionFadeDown::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionFadeDown\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionFadeDown*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionFadeDown_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionFadeDown_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionFadeDown)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionFadeDown(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionFadeDown\");\n    tolua_cclass(tolua_S,\"TransitionFadeDown\",\"cc.TransitionFadeDown\",\"cc.TransitionFadeTR\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionFadeDown\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionFadeDown_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionFadeDown).name();\n    g_luaType[typeName] = \"cc.TransitionFadeDown\";\n    g_typeCast[\"TransitionFadeDown\"] = \"cc.TransitionFadeDown\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionPageTurn_actionWithSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionPageTurn* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionPageTurn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionPageTurn*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionPageTurn_actionWithSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ActionInterval* ret = cobj->actionWithSize(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ActionInterval\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ActionInterval*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"actionWithSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionPageTurn_actionWithSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionPageTurn_initWithDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionPageTurn* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TransitionPageTurn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TransitionPageTurn*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TransitionPageTurn_initWithDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        bool arg2;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithDuration(arg0, arg1, arg2);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithDuration\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionPageTurn_initWithDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TransitionPageTurn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionPageTurn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        bool arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionPageTurn* ret = cocos2d::TransitionPageTurn::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionPageTurn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionPageTurn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionPageTurn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TransitionPageTurn_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionPageTurn* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TransitionPageTurn();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TransitionPageTurn\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TransitionPageTurn\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TransitionPageTurn\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionPageTurn_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TransitionPageTurn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionPageTurn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionPageTurn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionPageTurn\");\n    tolua_cclass(tolua_S,\"TransitionPageTurn\",\"cc.TransitionPageTurn\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionPageTurn\");\n        tolua_function(tolua_S,\"actionWithSize\",lua_cocos2dx_TransitionPageTurn_actionWithSize);\n        tolua_function(tolua_S,\"initWithDuration\",lua_cocos2dx_TransitionPageTurn_initWithDuration);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TransitionPageTurn_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionPageTurn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionPageTurn).name();\n    g_luaType[typeName] = \"cc.TransitionPageTurn\";\n    g_typeCast[\"TransitionPageTurn\"] = \"cc.TransitionPageTurn\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionProgress_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionProgress\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionProgress* ret = cocos2d::TransitionProgress::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionProgress\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionProgress*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgress_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TransitionProgress_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TransitionProgress* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TransitionProgress();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TransitionProgress\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TransitionProgress\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TransitionProgress\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgress_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TransitionProgress_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionProgress)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionProgress(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionProgress\");\n    tolua_cclass(tolua_S,\"TransitionProgress\",\"cc.TransitionProgress\",\"cc.TransitionScene\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionProgress\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionProgress_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionProgress).name();\n    g_luaType[typeName] = \"cc.TransitionProgress\";\n    g_typeCast[\"TransitionProgress\"] = \"cc.TransitionProgress\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionProgressRadialCCW_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionProgressRadialCCW\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionProgressRadialCCW* ret = cocos2d::TransitionProgressRadialCCW::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionProgressRadialCCW\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionProgressRadialCCW*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgressRadialCCW_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionProgressRadialCCW_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionProgressRadialCCW)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionProgressRadialCCW(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionProgressRadialCCW\");\n    tolua_cclass(tolua_S,\"TransitionProgressRadialCCW\",\"cc.TransitionProgressRadialCCW\",\"cc.TransitionProgress\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionProgressRadialCCW\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionProgressRadialCCW_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionProgressRadialCCW).name();\n    g_luaType[typeName] = \"cc.TransitionProgressRadialCCW\";\n    g_typeCast[\"TransitionProgressRadialCCW\"] = \"cc.TransitionProgressRadialCCW\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionProgressRadialCW_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionProgressRadialCW\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionProgressRadialCW* ret = cocos2d::TransitionProgressRadialCW::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionProgressRadialCW\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionProgressRadialCW*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgressRadialCW_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionProgressRadialCW_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionProgressRadialCW)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionProgressRadialCW(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionProgressRadialCW\");\n    tolua_cclass(tolua_S,\"TransitionProgressRadialCW\",\"cc.TransitionProgressRadialCW\",\"cc.TransitionProgress\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionProgressRadialCW\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionProgressRadialCW_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionProgressRadialCW).name();\n    g_luaType[typeName] = \"cc.TransitionProgressRadialCW\";\n    g_typeCast[\"TransitionProgressRadialCW\"] = \"cc.TransitionProgressRadialCW\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionProgressHorizontal_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionProgressHorizontal\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionProgressHorizontal* ret = cocos2d::TransitionProgressHorizontal::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionProgressHorizontal\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionProgressHorizontal*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgressHorizontal_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionProgressHorizontal_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionProgressHorizontal)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionProgressHorizontal(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionProgressHorizontal\");\n    tolua_cclass(tolua_S,\"TransitionProgressHorizontal\",\"cc.TransitionProgressHorizontal\",\"cc.TransitionProgress\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionProgressHorizontal\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionProgressHorizontal_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionProgressHorizontal).name();\n    g_luaType[typeName] = \"cc.TransitionProgressHorizontal\";\n    g_typeCast[\"TransitionProgressHorizontal\"] = \"cc.TransitionProgressHorizontal\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionProgressVertical_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionProgressVertical\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionProgressVertical* ret = cocos2d::TransitionProgressVertical::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionProgressVertical\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionProgressVertical*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgressVertical_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionProgressVertical_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionProgressVertical)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionProgressVertical(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionProgressVertical\");\n    tolua_cclass(tolua_S,\"TransitionProgressVertical\",\"cc.TransitionProgressVertical\",\"cc.TransitionProgress\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionProgressVertical\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionProgressVertical_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionProgressVertical).name();\n    g_luaType[typeName] = \"cc.TransitionProgressVertical\";\n    g_typeCast[\"TransitionProgressVertical\"] = \"cc.TransitionProgressVertical\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionProgressInOut_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionProgressInOut\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionProgressInOut* ret = cocos2d::TransitionProgressInOut::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionProgressInOut\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionProgressInOut*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgressInOut_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionProgressInOut_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionProgressInOut)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionProgressInOut(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionProgressInOut\");\n    tolua_cclass(tolua_S,\"TransitionProgressInOut\",\"cc.TransitionProgressInOut\",\"cc.TransitionProgress\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionProgressInOut\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionProgressInOut_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionProgressInOut).name();\n    g_luaType[typeName] = \"cc.TransitionProgressInOut\";\n    g_typeCast[\"TransitionProgressInOut\"] = \"cc.TransitionProgressInOut\";\n    return 1;\n}\n\nint lua_cocos2dx_TransitionProgressOutIn_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TransitionProgressOutIn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Scene* arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scene\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Scene*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TransitionProgressOutIn* ret = cocos2d::TransitionProgressOutIn::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TransitionProgressOutIn\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TransitionProgressOutIn*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TransitionProgressOutIn_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TransitionProgressOutIn_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TransitionProgressOutIn)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TransitionProgressOutIn(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TransitionProgressOutIn\");\n    tolua_cclass(tolua_S,\"TransitionProgressOutIn\",\"cc.TransitionProgressOutIn\",\"cc.TransitionProgress\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TransitionProgressOutIn\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TransitionProgressOutIn_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TransitionProgressOutIn).name();\n    g_luaType[typeName] = \"cc.TransitionProgressOutIn\";\n    g_typeCast[\"TransitionProgressOutIn\"] = \"cc.TransitionProgressOutIn\";\n    return 1;\n}\n\nint lua_cocos2dx_MenuItem_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItem_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItem_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItem_activate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItem_activate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->activate();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"activate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItem_activate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItem_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItem_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItem_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItem_selected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItem_selected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->selected();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"selected\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItem_selected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItem_isSelected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItem_isSelected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isSelected();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isSelected\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItem_isSelected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItem_unselected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItem_unselected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->unselected();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"unselected\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItem_unselected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItem_rect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItem_rect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Rect ret = cobj->rect();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"rect\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItem_rect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_MenuItem_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MenuItem)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MenuItem(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MenuItem\");\n    tolua_cclass(tolua_S,\"MenuItem\",\"cc.MenuItem\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MenuItem\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_MenuItem_setEnabled);\n        tolua_function(tolua_S,\"activate\",lua_cocos2dx_MenuItem_activate);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_MenuItem_isEnabled);\n        tolua_function(tolua_S,\"selected\",lua_cocos2dx_MenuItem_selected);\n        tolua_function(tolua_S,\"isSelected\",lua_cocos2dx_MenuItem_isSelected);\n        tolua_function(tolua_S,\"unselected\",lua_cocos2dx_MenuItem_unselected);\n        tolua_function(tolua_S,\"rect\",lua_cocos2dx_MenuItem_rect);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MenuItem).name();\n    g_luaType[typeName] = \"cc.MenuItem\";\n    g_typeCast[\"MenuItem\"] = \"cc.MenuItem\";\n    return 1;\n}\n\nint lua_cocos2dx_MenuItemLabel_getDisabledColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemLabel* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemLabel\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemLabel*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemLabel_getDisabledColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color3B& ret = cobj->getDisabledColor();\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisabledColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemLabel_getDisabledColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemLabel_setString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemLabel* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemLabel\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemLabel*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemLabel_setString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setString(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemLabel_setString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemLabel_setLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemLabel* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemLabel\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemLabel*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemLabel_setLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setLabel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLabel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemLabel_setLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemLabel_setDisabledColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemLabel* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemLabel\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemLabel*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemLabel_setDisabledColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setDisabledColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDisabledColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemLabel_setDisabledColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemLabel_getLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemLabel* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemLabel\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemLabel*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemLabel_getLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getLabel();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLabel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemLabel_getLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_MenuItemLabel_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MenuItemLabel)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MenuItemLabel(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MenuItemLabel\");\n    tolua_cclass(tolua_S,\"MenuItemLabel\",\"cc.MenuItemLabel\",\"cc.MenuItem\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MenuItemLabel\");\n        tolua_function(tolua_S,\"getDisabledColor\",lua_cocos2dx_MenuItemLabel_getDisabledColor);\n        tolua_function(tolua_S,\"setString\",lua_cocos2dx_MenuItemLabel_setString);\n        tolua_function(tolua_S,\"setLabel\",lua_cocos2dx_MenuItemLabel_setLabel);\n        tolua_function(tolua_S,\"setDisabledColor\",lua_cocos2dx_MenuItemLabel_setDisabledColor);\n        tolua_function(tolua_S,\"getLabel\",lua_cocos2dx_MenuItemLabel_getLabel);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MenuItemLabel).name();\n    g_luaType[typeName] = \"cc.MenuItemLabel\";\n    g_typeCast[\"MenuItemLabel\"] = \"cc.MenuItemLabel\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_MenuItemAtlasFont_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MenuItemAtlasFont)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MenuItemAtlasFont(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MenuItemAtlasFont\");\n    tolua_cclass(tolua_S,\"MenuItemAtlasFont\",\"cc.MenuItemAtlasFont\",\"cc.MenuItemLabel\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MenuItemAtlasFont\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MenuItemAtlasFont).name();\n    g_luaType[typeName] = \"cc.MenuItemAtlasFont\";\n    g_typeCast[\"MenuItemAtlasFont\"] = \"cc.MenuItemAtlasFont\";\n    return 1;\n}\n\nint lua_cocos2dx_MenuItemFont_getFontSizeObj(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemFont_getFontSizeObj'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getFontSizeObj();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFontSizeObj\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_getFontSizeObj'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemFont_getFontNameObj(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemFont_getFontNameObj'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getFontNameObj();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFontNameObj\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_getFontNameObj'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemFont_setFontSizeObj(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemFont_setFontSizeObj'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontSizeObj(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontSizeObj\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_setFontSizeObj'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemFont_setFontNameObj(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemFont_setFontNameObj'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontNameObj(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontNameObj\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_setFontNameObj'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemFont_setFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::MenuItemFont::setFontName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"setFontName\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_setFontName'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_MenuItemFont_getFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        int ret = cocos2d::MenuItemFont::getFontSize();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getFontSize\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_getFontSize'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_MenuItemFont_getFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cocos2d::MenuItemFont::getFontName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getFontName\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_getFontName'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_MenuItemFont_setFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::MenuItemFont::setFontSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"setFontSize\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemFont_setFontSize'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_MenuItemFont_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MenuItemFont)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MenuItemFont(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MenuItemFont\");\n    tolua_cclass(tolua_S,\"MenuItemFont\",\"cc.MenuItemFont\",\"cc.MenuItemLabel\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MenuItemFont\");\n        tolua_function(tolua_S,\"getFontSizeObj\",lua_cocos2dx_MenuItemFont_getFontSizeObj);\n        tolua_function(tolua_S,\"getFontNameObj\",lua_cocos2dx_MenuItemFont_getFontNameObj);\n        tolua_function(tolua_S,\"setFontSizeObj\",lua_cocos2dx_MenuItemFont_setFontSizeObj);\n        tolua_function(tolua_S,\"setFontNameObj\",lua_cocos2dx_MenuItemFont_setFontNameObj);\n        tolua_function(tolua_S,\"setFontName\", lua_cocos2dx_MenuItemFont_setFontName);\n        tolua_function(tolua_S,\"getFontSize\", lua_cocos2dx_MenuItemFont_getFontSize);\n        tolua_function(tolua_S,\"getFontName\", lua_cocos2dx_MenuItemFont_getFontName);\n        tolua_function(tolua_S,\"setFontSize\", lua_cocos2dx_MenuItemFont_setFontSize);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MenuItemFont).name();\n    g_luaType[typeName] = \"cc.MenuItemFont\";\n    g_typeCast[\"MenuItemFont\"] = \"cc.MenuItemFont\";\n    return 1;\n}\n\nint lua_cocos2dx_MenuItemSprite_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_selected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_selected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->selected();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"selected\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_selected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_setNormalImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_setNormalImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setNormalImage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setNormalImage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_setNormalImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_setDisabledImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_setDisabledImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setDisabledImage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDisabledImage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_setDisabledImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_setSelectedImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_setSelectedImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSelectedImage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSelectedImage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_setSelectedImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_getDisabledImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_getDisabledImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getDisabledImage();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisabledImage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_getDisabledImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_getSelectedImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_getSelectedImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getSelectedImage();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSelectedImage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_getSelectedImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_getNormalImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_getNormalImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getNormalImage();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNormalImage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_getNormalImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemSprite_unselected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemSprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemSprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemSprite_unselected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->unselected();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"unselected\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemSprite_unselected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_MenuItemSprite_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MenuItemSprite)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MenuItemSprite(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MenuItemSprite\");\n    tolua_cclass(tolua_S,\"MenuItemSprite\",\"cc.MenuItemSprite\",\"cc.MenuItem\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MenuItemSprite\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_MenuItemSprite_setEnabled);\n        tolua_function(tolua_S,\"selected\",lua_cocos2dx_MenuItemSprite_selected);\n        tolua_function(tolua_S,\"setNormalImage\",lua_cocos2dx_MenuItemSprite_setNormalImage);\n        tolua_function(tolua_S,\"setDisabledImage\",lua_cocos2dx_MenuItemSprite_setDisabledImage);\n        tolua_function(tolua_S,\"setSelectedImage\",lua_cocos2dx_MenuItemSprite_setSelectedImage);\n        tolua_function(tolua_S,\"getDisabledImage\",lua_cocos2dx_MenuItemSprite_getDisabledImage);\n        tolua_function(tolua_S,\"getSelectedImage\",lua_cocos2dx_MenuItemSprite_getSelectedImage);\n        tolua_function(tolua_S,\"getNormalImage\",lua_cocos2dx_MenuItemSprite_getNormalImage);\n        tolua_function(tolua_S,\"unselected\",lua_cocos2dx_MenuItemSprite_unselected);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MenuItemSprite).name();\n    g_luaType[typeName] = \"cc.MenuItemSprite\";\n    g_typeCast[\"MenuItemSprite\"] = \"cc.MenuItemSprite\";\n    return 1;\n}\n\nint lua_cocos2dx_MenuItemImage_setDisabledSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemImage* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemImage\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemImage*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemImage_setDisabledSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setDisabledSpriteFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDisabledSpriteFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemImage_setDisabledSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemImage_setSelectedSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemImage* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemImage\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemImage*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemImage_setSelectedSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSelectedSpriteFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSelectedSpriteFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemImage_setSelectedSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemImage_setNormalSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemImage* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemImage\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemImage*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemImage_setNormalSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setNormalSpriteFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setNormalSpriteFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemImage_setNormalSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_MenuItemImage_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MenuItemImage)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MenuItemImage(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MenuItemImage\");\n    tolua_cclass(tolua_S,\"MenuItemImage\",\"cc.MenuItemImage\",\"cc.MenuItemSprite\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MenuItemImage\");\n        tolua_function(tolua_S,\"setDisabledSpriteFrame\",lua_cocos2dx_MenuItemImage_setDisabledSpriteFrame);\n        tolua_function(tolua_S,\"setSelectedSpriteFrame\",lua_cocos2dx_MenuItemImage_setSelectedSpriteFrame);\n        tolua_function(tolua_S,\"setNormalSpriteFrame\",lua_cocos2dx_MenuItemImage_setNormalSpriteFrame);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MenuItemImage).name();\n    g_luaType[typeName] = \"cc.MenuItemImage\";\n    g_typeCast[\"MenuItemImage\"] = \"cc.MenuItemImage\";\n    return 1;\n}\n\nint lua_cocos2dx_MenuItemToggle_setSubItems(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemToggle* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemToggle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemToggle*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemToggle_setSubItems'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocos2d::MenuItem *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setSubItems(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSubItems\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemToggle_setSubItems'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemToggle_getSelectedIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemToggle* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemToggle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemToggle*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemToggle_getSelectedIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getSelectedIndex();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSelectedIndex\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemToggle_getSelectedIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemToggle_addSubItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemToggle* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemToggle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemToggle*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemToggle_addSubItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::MenuItem* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.MenuItem\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::MenuItem*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addSubItem(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSubItem\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemToggle_addSubItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemToggle_getSelectedItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemToggle* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemToggle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemToggle*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemToggle_getSelectedItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::MenuItem* ret = cobj->getSelectedItem();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.MenuItem\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::MenuItem*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSelectedItem\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemToggle_getSelectedItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MenuItemToggle_setSelectedIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MenuItemToggle* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MenuItemToggle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MenuItemToggle*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MenuItemToggle_setSelectedIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSelectedIndex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSelectedIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MenuItemToggle_setSelectedIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_MenuItemToggle_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MenuItemToggle)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MenuItemToggle(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MenuItemToggle\");\n    tolua_cclass(tolua_S,\"MenuItemToggle\",\"cc.MenuItemToggle\",\"cc.MenuItem\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MenuItemToggle\");\n        tolua_function(tolua_S,\"setSubItems\",lua_cocos2dx_MenuItemToggle_setSubItems);\n        tolua_function(tolua_S,\"getSelectedIndex\",lua_cocos2dx_MenuItemToggle_getSelectedIndex);\n        tolua_function(tolua_S,\"addSubItem\",lua_cocos2dx_MenuItemToggle_addSubItem);\n        tolua_function(tolua_S,\"getSelectedItem\",lua_cocos2dx_MenuItemToggle_getSelectedItem);\n        tolua_function(tolua_S,\"setSelectedIndex\",lua_cocos2dx_MenuItemToggle_setSelectedIndex);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MenuItemToggle).name();\n    g_luaType[typeName] = \"cc.MenuItemToggle\";\n    g_typeCast[\"MenuItemToggle\"] = \"cc.MenuItemToggle\";\n    return 1;\n}\n\nint lua_cocos2dx_Menu_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Menu* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Menu*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Menu_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Menu_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Menu_alignItemsVertically(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Menu* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Menu*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Menu_alignItemsVertically'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->alignItemsVertically();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"alignItemsVertically\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Menu_alignItemsVertically'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Menu_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Menu* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Menu*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Menu_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Menu_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Menu_alignItemsHorizontallyWithPadding(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Menu* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Menu*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Menu_alignItemsHorizontallyWithPadding'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->alignItemsHorizontallyWithPadding(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"alignItemsHorizontallyWithPadding\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Menu_alignItemsHorizontallyWithPadding'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Menu_alignItemsVerticallyWithPadding(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Menu* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Menu*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Menu_alignItemsVerticallyWithPadding'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->alignItemsVerticallyWithPadding(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"alignItemsVerticallyWithPadding\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Menu_alignItemsVerticallyWithPadding'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Menu_alignItemsHorizontally(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Menu* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Menu*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Menu_alignItemsHorizontally'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->alignItemsHorizontally();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"alignItemsHorizontally\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Menu_alignItemsHorizontally'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_Menu_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Menu)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Menu(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Menu\");\n    tolua_cclass(tolua_S,\"Menu\",\"cc.Menu\",\"cc.Layer\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Menu\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_Menu_setEnabled);\n        tolua_function(tolua_S,\"alignItemsVertically\",lua_cocos2dx_Menu_alignItemsVertically);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_Menu_isEnabled);\n        tolua_function(tolua_S,\"alignItemsHorizontallyWithPadding\",lua_cocos2dx_Menu_alignItemsHorizontallyWithPadding);\n        tolua_function(tolua_S,\"alignItemsVerticallyWithPadding\",lua_cocos2dx_Menu_alignItemsVerticallyWithPadding);\n        tolua_function(tolua_S,\"alignItemsHorizontally\",lua_cocos2dx_Menu_alignItemsHorizontally);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Menu).name();\n    g_luaType[typeName] = \"cc.Menu\";\n    g_typeCast[\"Menu\"] = \"cc.Menu\";\n    return 1;\n}\n\nint lua_cocos2dx_ClippingNode_isInverted(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ClippingNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ClippingNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ClippingNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_isInverted'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isInverted();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isInverted\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ClippingNode_isInverted'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ClippingNode_setInverted(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ClippingNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ClippingNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ClippingNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_setInverted'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInverted(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInverted\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ClippingNode_setInverted'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ClippingNode_setStencil(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ClippingNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ClippingNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ClippingNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_setStencil'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setStencil(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStencil\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ClippingNode_setStencil'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ClippingNode_getAlphaThreshold(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ClippingNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ClippingNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ClippingNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_getAlphaThreshold'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAlphaThreshold();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAlphaThreshold\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ClippingNode_getAlphaThreshold'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ClippingNode_getStencil(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ClippingNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ClippingNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ClippingNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_getStencil'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getStencil();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStencil\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ClippingNode_getStencil'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ClippingNode_setAlphaThreshold(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ClippingNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ClippingNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ClippingNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ClippingNode_setAlphaThreshold'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAlphaThreshold(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAlphaThreshold\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ClippingNode_setAlphaThreshold'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ClippingNode_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ClippingNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::ClippingNode* ret = cocos2d::ClippingNode::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ClippingNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ClippingNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::ClippingNode* ret = cocos2d::ClippingNode::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ClippingNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ClippingNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ClippingNode_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ClippingNode_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ClippingNode)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ClippingNode(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ClippingNode\");\n    tolua_cclass(tolua_S,\"ClippingNode\",\"cc.ClippingNode\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ClippingNode\");\n        tolua_function(tolua_S,\"isInverted\",lua_cocos2dx_ClippingNode_isInverted);\n        tolua_function(tolua_S,\"setInverted\",lua_cocos2dx_ClippingNode_setInverted);\n        tolua_function(tolua_S,\"setStencil\",lua_cocos2dx_ClippingNode_setStencil);\n        tolua_function(tolua_S,\"getAlphaThreshold\",lua_cocos2dx_ClippingNode_getAlphaThreshold);\n        tolua_function(tolua_S,\"getStencil\",lua_cocos2dx_ClippingNode_getStencil);\n        tolua_function(tolua_S,\"setAlphaThreshold\",lua_cocos2dx_ClippingNode_setAlphaThreshold);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ClippingNode_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ClippingNode).name();\n    g_luaType[typeName] = \"cc.ClippingNode\";\n    g_typeCast[\"ClippingNode\"] = \"cc.ClippingNode\";\n    return 1;\n}\n\nint lua_cocos2dx_MotionStreak_reset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_reset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->reset();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_reset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_setTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_setTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_setTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_getTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_getTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTexture();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_getTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_tintWithColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_tintWithColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->tintWithColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"tintWithColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_tintWithColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_setStartingPositionInitialized(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_setStartingPositionInitialized'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartingPositionInitialized(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartingPositionInitialized\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_setStartingPositionInitialized'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_isStartingPositionInitialized(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_isStartingPositionInitialized'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isStartingPositionInitialized();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isStartingPositionInitialized\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_isStartingPositionInitialized'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_isFastMode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_isFastMode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFastMode();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFastMode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_isFastMode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_setFastMode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::MotionStreak* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::MotionStreak*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_MotionStreak_setFastMode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFastMode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFastMode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_setFastMode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_MotionStreak_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.MotionStreak\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 5)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Color3B arg3;\n            ok &= luaval_to_color3b(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            cocos2d::Texture2D* arg4;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,6,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ4 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,6,0);\n\t\t\t\t\tif (nullptr == arg4){\n\t\t\t\t\t\tLUA_PRECONDITION( arg4, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::MotionStreak* ret = cocos2d::MotionStreak::create(arg0, arg1, arg2, arg3, arg4);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.MotionStreak\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::MotionStreak*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 5)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::Color3B arg3;\n            ok &= luaval_to_color3b(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            std::string arg4;\n            ok &= luaval_to_std_string(tolua_S, 6,&arg4);\n            if (!ok) { break; }\n            cocos2d::MotionStreak* ret = cocos2d::MotionStreak::create(arg0, arg1, arg2, arg3, arg4);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.MotionStreak\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::MotionStreak*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 5);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_MotionStreak_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_MotionStreak_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MotionStreak)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_MotionStreak(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.MotionStreak\");\n    tolua_cclass(tolua_S,\"MotionStreak\",\"cc.MotionStreak\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MotionStreak\");\n        tolua_function(tolua_S,\"reset\",lua_cocos2dx_MotionStreak_reset);\n        tolua_function(tolua_S,\"setTexture\",lua_cocos2dx_MotionStreak_setTexture);\n        tolua_function(tolua_S,\"getTexture\",lua_cocos2dx_MotionStreak_getTexture);\n        tolua_function(tolua_S,\"tintWithColor\",lua_cocos2dx_MotionStreak_tintWithColor);\n        tolua_function(tolua_S,\"setStartingPositionInitialized\",lua_cocos2dx_MotionStreak_setStartingPositionInitialized);\n        tolua_function(tolua_S,\"isStartingPositionInitialized\",lua_cocos2dx_MotionStreak_isStartingPositionInitialized);\n        tolua_function(tolua_S,\"isFastMode\",lua_cocos2dx_MotionStreak_isFastMode);\n        tolua_function(tolua_S,\"setFastMode\",lua_cocos2dx_MotionStreak_setFastMode);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_MotionStreak_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::MotionStreak).name();\n    g_luaType[typeName] = \"cc.MotionStreak\";\n    g_typeCast[\"MotionStreak\"] = \"cc.MotionStreak\";\n    return 1;\n}\n\nint lua_cocos2dx_ProgressTimer_isReverseDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_isReverseDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isReverseDirection();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isReverseDirection\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_isReverseDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_setBarChangeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setBarChangeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setBarChangeRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBarChangeRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_setBarChangeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_getPercentage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getPercentage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getPercentage();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPercentage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_getPercentage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_setSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_setSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_getType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_getType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_getSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_getSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_setMidpoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setMidpoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setMidpoint(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMidpoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_setMidpoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_getBarChangeRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getBarChangeRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getBarChangeRate();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBarChangeRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_getBarChangeRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_setReverseDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setReverseDirection'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            bool arg0;\n            ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setReverseDirection(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            bool arg0;\n            ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setReverseProgress(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setReverseProgress\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_setReverseDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_getMidpoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_getMidpoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getMidpoint();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMidpoint\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_getMidpoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_setPercentage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setPercentage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPercentage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPercentage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_setPercentage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_setType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ProgressTimer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ProgressTimer_setType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ProgressTimer::Type arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_setType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ProgressTimer_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ProgressTimer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Sprite* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ProgressTimer* ret = cocos2d::ProgressTimer::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ProgressTimer\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ProgressTimer*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ProgressTimer_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ProgressTimer_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ProgressTimer)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ProgressTimer(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ProgressTimer\");\n    tolua_cclass(tolua_S,\"ProgressTimer\",\"cc.ProgressTimer\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ProgressTimer\");\n        tolua_function(tolua_S,\"isReverseDirection\",lua_cocos2dx_ProgressTimer_isReverseDirection);\n        tolua_function(tolua_S,\"setBarChangeRate\",lua_cocos2dx_ProgressTimer_setBarChangeRate);\n        tolua_function(tolua_S,\"getPercentage\",lua_cocos2dx_ProgressTimer_getPercentage);\n        tolua_function(tolua_S,\"setSprite\",lua_cocos2dx_ProgressTimer_setSprite);\n        tolua_function(tolua_S,\"getType\",lua_cocos2dx_ProgressTimer_getType);\n        tolua_function(tolua_S,\"getSprite\",lua_cocos2dx_ProgressTimer_getSprite);\n        tolua_function(tolua_S,\"setMidpoint\",lua_cocos2dx_ProgressTimer_setMidpoint);\n        tolua_function(tolua_S,\"getBarChangeRate\",lua_cocos2dx_ProgressTimer_getBarChangeRate);\n        tolua_function(tolua_S,\"setReverseDirection\",lua_cocos2dx_ProgressTimer_setReverseDirection);\n        tolua_function(tolua_S,\"getMidpoint\",lua_cocos2dx_ProgressTimer_getMidpoint);\n        tolua_function(tolua_S,\"setPercentage\",lua_cocos2dx_ProgressTimer_setPercentage);\n        tolua_function(tolua_S,\"setType\",lua_cocos2dx_ProgressTimer_setType);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ProgressTimer_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ProgressTimer).name();\n    g_luaType[typeName] = \"cc.ProgressTimer\";\n    g_typeCast[\"ProgressTimer\"] = \"cc.ProgressTimer\";\n    return 1;\n}\n\nint lua_cocos2dx_Image_hasPremultipliedAlpha(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_hasPremultipliedAlpha'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->hasPremultipliedAlpha();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hasPremultipliedAlpha\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_hasPremultipliedAlpha'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getDataLen(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getDataLen'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getDataLen();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDataLen\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getDataLen'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_isCompressed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_isCompressed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isCompressed();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isCompressed\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_isCompressed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getBitPerPixel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getBitPerPixel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getBitPerPixel();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBitPerPixel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getBitPerPixel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_hasAlpha(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_hasAlpha'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->hasAlpha();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hasAlpha\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_hasAlpha'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getHeight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getHeight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getHeight();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getHeight\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getHeight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_initWithImageFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_initWithImageFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithImageFile(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithImageFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_initWithImageFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getWidth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getWidth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getWidth();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWidth\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getWidth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_isPremultipliedAlpha(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_isPremultipliedAlpha'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isPremultipliedAlpha();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isPremultipliedAlpha\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_isPremultipliedAlpha'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getFileType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getFileType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getFileType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFileType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getFileType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_saveToFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_saveToFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->saveToFile(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        std::string arg0;\n        bool arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->saveToFile(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"saveToFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_saveToFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getNumberOfMipmaps(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getNumberOfMipmaps'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getNumberOfMipmaps();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNumberOfMipmaps\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getNumberOfMipmaps'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getRenderFormat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getRenderFormat'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getRenderFormat();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRenderFormat\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getRenderFormat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned char* ret = cobj->getData();\n        #pragma warning NO CONVERSION FROM NATIVE FOR unsigned char*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_getMipmaps(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Image\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Image_getMipmaps'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::_MipmapInfo* ret = cobj->getMipmaps();\n        #pragma warning NO CONVERSION FROM NATIVE FOR _MipmapInfo*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMipmaps\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_getMipmaps'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Image_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Image* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Image();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Image\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Image\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Image\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Image_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Image_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Image)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Image(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Image\");\n    tolua_cclass(tolua_S,\"Image\",\"cc.Image\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Image\");\n        tolua_function(tolua_S,\"hasPremultipliedAlpha\",lua_cocos2dx_Image_hasPremultipliedAlpha);\n        tolua_function(tolua_S,\"getDataLen\",lua_cocos2dx_Image_getDataLen);\n        tolua_function(tolua_S,\"isCompressed\",lua_cocos2dx_Image_isCompressed);\n        tolua_function(tolua_S,\"getBitPerPixel\",lua_cocos2dx_Image_getBitPerPixel);\n        tolua_function(tolua_S,\"hasAlpha\",lua_cocos2dx_Image_hasAlpha);\n        tolua_function(tolua_S,\"getHeight\",lua_cocos2dx_Image_getHeight);\n        tolua_function(tolua_S,\"initWithImageFile\",lua_cocos2dx_Image_initWithImageFile);\n        tolua_function(tolua_S,\"getWidth\",lua_cocos2dx_Image_getWidth);\n        tolua_function(tolua_S,\"isPremultipliedAlpha\",lua_cocos2dx_Image_isPremultipliedAlpha);\n        tolua_function(tolua_S,\"getFileType\",lua_cocos2dx_Image_getFileType);\n        tolua_function(tolua_S,\"saveToFile\",lua_cocos2dx_Image_saveToFile);\n        tolua_function(tolua_S,\"getNumberOfMipmaps\",lua_cocos2dx_Image_getNumberOfMipmaps);\n        tolua_function(tolua_S,\"getRenderFormat\",lua_cocos2dx_Image_getRenderFormat);\n        tolua_function(tolua_S,\"getData\",lua_cocos2dx_Image_getData);\n        tolua_function(tolua_S,\"getMipmaps\",lua_cocos2dx_Image_getMipmaps);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Image_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Image).name();\n    g_luaType[typeName] = \"cc.Image\";\n    g_typeCast[\"Image\"] = \"cc.Image\";\n    return 1;\n}\n\nint lua_cocos2dx_RenderTexture_clearStencil(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_clearStencil'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->clearStencil(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clearStencil\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_clearStencil'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_getClearDepth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_getClearDepth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getClearDepth();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getClearDepth\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_getClearDepth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_getClearStencil(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_getClearStencil'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getClearStencil();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getClearStencil\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_getClearStencil'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_end(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_end'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->end();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"end\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_end'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_setClearStencil(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_setClearStencil'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setClearStencil(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setClearStencil\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_setClearStencil'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_setSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_setSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_setSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_getSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_getSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_getSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_isAutoDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_isAutoDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isAutoDraw();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isAutoDraw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_isAutoDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_setClearFlags(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_setClearFlags'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setClearFlags(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setClearFlags\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_setClearFlags'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_begin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_begin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->begin();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"begin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_begin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_saveToFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_saveToFile'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Image::Format arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->saveToFile(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            bool ret = cobj->saveToFile(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"saveToFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_saveToFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_setAutoDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_setAutoDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAutoDraw(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAutoDraw\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_setAutoDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_setClearColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_setClearColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color4F arg0;\n\n        ok &=luaval_to_color4f(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setClearColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setClearColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_setClearColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_endToLua(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_endToLua'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->endToLua();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"endToLua\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_endToLua'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_beginWithClear(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_beginWithClear'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 5) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            double arg3;\n            ok &= luaval_to_number(tolua_S, 5,&arg3);\n\n            if (!ok) { break; }\n            double arg4;\n            ok &= luaval_to_number(tolua_S, 6,&arg4);\n\n            if (!ok) { break; }\n            cobj->beginWithClear(arg0, arg1, arg2, arg3, arg4);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 4) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            double arg3;\n            ok &= luaval_to_number(tolua_S, 5,&arg3);\n\n            if (!ok) { break; }\n            cobj->beginWithClear(arg0, arg1, arg2, arg3);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 6) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            double arg3;\n            ok &= luaval_to_number(tolua_S, 5,&arg3);\n\n            if (!ok) { break; }\n            double arg4;\n            ok &= luaval_to_number(tolua_S, 6,&arg4);\n\n            if (!ok) { break; }\n            int arg5;\n            ok &= luaval_to_int32(tolua_S, 7,(int *)&arg5);\n\n            if (!ok) { break; }\n            cobj->beginWithClear(arg0, arg1, arg2, arg3, arg4, arg5);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"beginWithClear\",argc, 6);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_beginWithClear'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_clearDepth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_clearDepth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->clearDepth(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clearDepth\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_clearDepth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_getClearColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_getClearColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color4F& ret = cobj->getClearColor();\n        color4f_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getClearColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_getClearColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_clear(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_clear'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        double arg3;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cobj->clear(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clear\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_clear'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_getClearFlags(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_getClearFlags'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getClearFlags();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getClearFlags\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_getClearFlags'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_newImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_newImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Image* ret = cobj->newImage();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Image\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Image*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Image* ret = cobj->newImage(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Image\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Image*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"newImage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_newImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_setClearDepth(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_setClearDepth'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setClearDepth(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setClearDepth\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_setClearDepth'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_initWithWidthAndHeight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_initWithWidthAndHeight'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 4) {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D::PixelFormat arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            unsigned int arg3;\n            ok &= luaval_to_uint32(tolua_S, 5,&arg3);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithWidthAndHeight(arg0, arg1, arg2, arg3);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D::PixelFormat arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithWidthAndHeight(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithWidthAndHeight\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_initWithWidthAndHeight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.RenderTexture\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n            if (!ok) { break; }\n            cocos2d::Texture2D::PixelFormat arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            cocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RenderTexture\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RenderTexture*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 4)\n        {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n            if (!ok) { break; }\n            cocos2d::Texture2D::PixelFormat arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n            if (!ok) { break; }\n            unsigned int arg3;\n            ok &= luaval_to_uint32(tolua_S, 5,&arg3);\n            if (!ok) { break; }\n            cocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RenderTexture\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RenderTexture*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n            if (!ok) { break; }\n            cocos2d::RenderTexture* ret = cocos2d::RenderTexture::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.RenderTexture\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::RenderTexture*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_RenderTexture_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::RenderTexture* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::RenderTexture();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.RenderTexture\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.RenderTexture\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"RenderTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_RenderTexture_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_RenderTexture_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (RenderTexture)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_RenderTexture(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.RenderTexture\");\n    tolua_cclass(tolua_S,\"RenderTexture\",\"cc.RenderTexture\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"RenderTexture\");\n        tolua_function(tolua_S,\"clearStencil\",lua_cocos2dx_RenderTexture_clearStencil);\n        tolua_function(tolua_S,\"getClearDepth\",lua_cocos2dx_RenderTexture_getClearDepth);\n        tolua_function(tolua_S,\"getClearStencil\",lua_cocos2dx_RenderTexture_getClearStencil);\n        tolua_function(tolua_S,\"end\",lua_cocos2dx_RenderTexture_end);\n        tolua_function(tolua_S,\"setClearStencil\",lua_cocos2dx_RenderTexture_setClearStencil);\n        tolua_function(tolua_S,\"setSprite\",lua_cocos2dx_RenderTexture_setSprite);\n        tolua_function(tolua_S,\"getSprite\",lua_cocos2dx_RenderTexture_getSprite);\n        tolua_function(tolua_S,\"isAutoDraw\",lua_cocos2dx_RenderTexture_isAutoDraw);\n        tolua_function(tolua_S,\"setClearFlags\",lua_cocos2dx_RenderTexture_setClearFlags);\n        tolua_function(tolua_S,\"begin\",lua_cocos2dx_RenderTexture_begin);\n        tolua_function(tolua_S,\"saveToFile\",lua_cocos2dx_RenderTexture_saveToFile);\n        tolua_function(tolua_S,\"setAutoDraw\",lua_cocos2dx_RenderTexture_setAutoDraw);\n        tolua_function(tolua_S,\"setClearColor\",lua_cocos2dx_RenderTexture_setClearColor);\n        tolua_function(tolua_S,\"endToLua\",lua_cocos2dx_RenderTexture_endToLua);\n        tolua_function(tolua_S,\"beginWithClear\",lua_cocos2dx_RenderTexture_beginWithClear);\n        tolua_function(tolua_S,\"clearDepth\",lua_cocos2dx_RenderTexture_clearDepth);\n        tolua_function(tolua_S,\"getClearColor\",lua_cocos2dx_RenderTexture_getClearColor);\n        tolua_function(tolua_S,\"clear\",lua_cocos2dx_RenderTexture_clear);\n        tolua_function(tolua_S,\"getClearFlags\",lua_cocos2dx_RenderTexture_getClearFlags);\n        tolua_function(tolua_S,\"newImage\",lua_cocos2dx_RenderTexture_newImage);\n        tolua_function(tolua_S,\"setClearDepth\",lua_cocos2dx_RenderTexture_setClearDepth);\n        tolua_function(tolua_S,\"initWithWidthAndHeight\",lua_cocos2dx_RenderTexture_initWithWidthAndHeight);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_RenderTexture_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_RenderTexture_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::RenderTexture).name();\n    g_luaType[typeName] = \"cc.RenderTexture\";\n    g_typeCast[\"RenderTexture\"] = \"cc.RenderTexture\";\n    return 1;\n}\n\nint lua_cocos2dx_NodeGrid_setTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::NodeGrid* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.NodeGrid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::NodeGrid*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_NodeGrid_setTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_NodeGrid_setTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_NodeGrid_getGrid(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::NodeGrid* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.NodeGrid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::NodeGrid*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_NodeGrid_getGrid'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::GridBase* ret = cobj->getGrid();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GridBase\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GridBase*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::GridBase* ret = cobj->getGrid();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GridBase\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GridBase*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGrid\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_NodeGrid_getGrid'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_NodeGrid_setGrid(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::NodeGrid* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.NodeGrid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::NodeGrid*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_NodeGrid_setGrid'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::GridBase* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.GridBase\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::GridBase*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setGrid(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGrid\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_NodeGrid_setGrid'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_NodeGrid_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.NodeGrid\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::NodeGrid* ret = cocos2d::NodeGrid::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.NodeGrid\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::NodeGrid*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_NodeGrid_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_NodeGrid_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (NodeGrid)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_NodeGrid(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.NodeGrid\");\n    tolua_cclass(tolua_S,\"NodeGrid\",\"cc.NodeGrid\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"NodeGrid\");\n        tolua_function(tolua_S,\"setTarget\",lua_cocos2dx_NodeGrid_setTarget);\n        tolua_function(tolua_S,\"getGrid\",lua_cocos2dx_NodeGrid_getGrid);\n        tolua_function(tolua_S,\"setGrid\",lua_cocos2dx_NodeGrid_setGrid);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_NodeGrid_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::NodeGrid).name();\n    g_luaType[typeName] = \"cc.NodeGrid\";\n    g_typeCast[\"NodeGrid\"] = \"cc.NodeGrid\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleBatchNode_setTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_setTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_setTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_disableParticle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_disableParticle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->disableParticle(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"disableParticle\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_disableParticle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_getTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_getTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTexture();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_getTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_setTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_setTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextureAtlas* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.TextureAtlas\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::TextureAtlas*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTextureAtlas(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureAtlas\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_setTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAllChildrenWithCleanup(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllChildrenWithCleanup\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_getTextureAtlas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_getTextureAtlas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::TextureAtlas* ret = cobj->getTextureAtlas();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TextureAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TextureAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureAtlas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_getTextureAtlas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_insertChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_insertChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::ParticleSystem* arg0;\n        int arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ParticleSystem\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->insertChild(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"insertChild\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_insertChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_visit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_visit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->visit();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"visit\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_visit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_removeChildAtIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleBatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleBatchNode_removeChildAtIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        bool arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->removeChildAtIndex(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeChildAtIndex\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_removeChildAtIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        std::string arg0;\n        int arg1;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleBatchNode_createWithTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Texture2D* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Texture2D* arg0;\n        int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleBatchNode* ret = cocos2d::ParticleBatchNode::createWithTexture(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTexture\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleBatchNode_createWithTexture'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleBatchNode_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleBatchNode)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleBatchNode(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleBatchNode\");\n    tolua_cclass(tolua_S,\"ParticleBatchNode\",\"cc.ParticleBatchNode\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleBatchNode\");\n        tolua_function(tolua_S,\"setTexture\",lua_cocos2dx_ParticleBatchNode_setTexture);\n        tolua_function(tolua_S,\"disableParticle\",lua_cocos2dx_ParticleBatchNode_disableParticle);\n        tolua_function(tolua_S,\"getTexture\",lua_cocos2dx_ParticleBatchNode_getTexture);\n        tolua_function(tolua_S,\"setTextureAtlas\",lua_cocos2dx_ParticleBatchNode_setTextureAtlas);\n        tolua_function(tolua_S,\"removeAllChildrenWithCleanup\",lua_cocos2dx_ParticleBatchNode_removeAllChildrenWithCleanup);\n        tolua_function(tolua_S,\"getTextureAtlas\",lua_cocos2dx_ParticleBatchNode_getTextureAtlas);\n        tolua_function(tolua_S,\"insertChild\",lua_cocos2dx_ParticleBatchNode_insertChild);\n        tolua_function(tolua_S,\"visit\",lua_cocos2dx_ParticleBatchNode_visit);\n        tolua_function(tolua_S,\"removeChildAtIndex\",lua_cocos2dx_ParticleBatchNode_removeChildAtIndex);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleBatchNode_create);\n        tolua_function(tolua_S,\"createWithTexture\", lua_cocos2dx_ParticleBatchNode_createWithTexture);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleBatchNode).name();\n    g_luaType[typeName] = \"cc.ParticleBatchNode\";\n    g_typeCast[\"ParticleBatchNode\"] = \"cc.ParticleBatchNode\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleSystem_getStartSizeVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartSizeVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStartSizeVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartSizeVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartSizeVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTexture();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTexture\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_isFull(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_isFull'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFull();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFull\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_isFull'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleBatchNode* ret = cobj->getBatchNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleBatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleBatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBatchNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getStartColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color4F& ret = cobj->getStartColor();\n        color4f_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getPositionType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getPositionType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getPositionType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPositionType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getPositionType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setPosVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setPosVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPosVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPosVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setPosVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndSpin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndSpin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEndSpin();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndSpin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndSpin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setRotatePerSecondVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setRotatePerSecondVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotatePerSecondVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotatePerSecondVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setRotatePerSecondVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getStartSpinVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartSpinVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStartSpinVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartSpinVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartSpinVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getRadialAccelVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getRadialAccelVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRadialAccelVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRadialAccelVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getRadialAccelVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndSizeVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndSizeVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEndSizeVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndSizeVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndSizeVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setRotation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setRotation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setRotation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setTangentialAccel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setTangentialAccel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTangentialAccel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTangentialAccel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setTangentialAccel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setScaleY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setScaleY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScaleY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScaleY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setScaleY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setScaleX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setScaleX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScaleX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScaleX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setScaleX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getRadialAccel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getRadialAccel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRadialAccel();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRadialAccel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getRadialAccel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartRadius(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartRadius'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartRadius(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartRadius\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartRadius'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setRotatePerSecond(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setRotatePerSecond'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotatePerSecond(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotatePerSecond\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setRotatePerSecond'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getGravity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getGravity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getGravity();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGravity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getGravity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getTangentialAccel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getTangentialAccel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getTangentialAccel();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTangentialAccel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getTangentialAccel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndRadius(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndRadius'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndRadius(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndRadius\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndRadius'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getSpeed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getSpeed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSpeed();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpeed\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getSpeed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getAngle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getAngle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAngle();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAngle\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getAngle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color4F arg0;\n\n        ok &=luaval_to_color4f(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartSpin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartSpin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartSpin(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartSpin\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartSpin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDuration(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDuration\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getPosVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getPosVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getPosVar();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPosVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getPosVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_updateWithNoTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_updateWithNoTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateWithNoTime();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateWithNoTime\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_updateWithNoTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_isBlendAdditive(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_isBlendAdditive'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBlendAdditive();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBlendAdditive\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_isBlendAdditive'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getSpeedVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getSpeedVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSpeedVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpeedVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getSpeedVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setPositionType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setPositionType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ParticleSystem::PositionType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPositionType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPositionType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setPositionType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_stopSystem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_stopSystem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopSystem();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopSystem\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_stopSystem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getSourcePosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getSourcePosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getSourcePosition();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSourcePosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getSourcePosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setLifeVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setLifeVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLifeVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLifeVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setLifeVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setTotalParticles'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTotalParticles(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTotalParticles\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setTotalParticles'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndColorVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndColorVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color4F arg0;\n\n        ok &=luaval_to_color4f(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndColorVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndColorVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndColorVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_updateQuadWithParticle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_updateQuadWithParticle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::sParticle* arg0;\n        cocos2d::Point arg1;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR sParticle*;\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->updateQuadWithParticle(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateQuadWithParticle\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_updateQuadWithParticle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getAtlasIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getAtlasIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getAtlasIndex();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAtlasIndex\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getAtlasIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getStartSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStartSize();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartSpinVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartSpinVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartSpinVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartSpinVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartSpinVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_resetSystem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_resetSystem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resetSystem();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resetSystem\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_resetSystem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setAtlasIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setAtlasIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAtlasIndex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAtlasIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setAtlasIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setTangentialAccelVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setTangentialAccelVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTangentialAccelVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTangentialAccelVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setTangentialAccelVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndRadiusVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndRadiusVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndRadiusVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndRadiusVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndRadiusVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndRadius(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndRadius'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEndRadius();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndRadius\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndRadius'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_isOpacityModifyRGB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_isOpacityModifyRGB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isOpacityModifyRGB();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isOpacityModifyRGB\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_isOpacityModifyRGB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_isActive(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_isActive'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isActive();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isActive\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_isActive'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setRadialAccelVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setRadialAccelVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRadialAccelVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRadialAccelVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setRadialAccelVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setSpeed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setSpeed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSpeed(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpeed\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setSpeed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getStartSpin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartSpin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStartSpin();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartSpin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartSpin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getRotatePerSecond(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getRotatePerSecond'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRotatePerSecond();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRotatePerSecond\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getRotatePerSecond'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_initParticle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_initParticle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::sParticle* arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR sParticle*;\n        if(!ok)\n            return 0;\n        cobj->initParticle(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initParticle\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_initParticle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEmitterMode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEmitterMode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ParticleSystem::Mode arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEmitterMode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEmitterMode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEmitterMode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDuration();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDuration\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setSourcePosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setSourcePosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setSourcePosition(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSourcePosition\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setSourcePosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndSpinVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndSpinVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEndSpinVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndSpinVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndSpinVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setBlendAdditive(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setBlendAdditive'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBlendAdditive(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBlendAdditive\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setBlendAdditive'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setLife(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setLife'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLife(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLife\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setLife'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setAngleVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setAngleVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAngleVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAngleVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setAngleVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setRotationIsDir(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setRotationIsDir'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotationIsDir(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotationIsDir\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setRotationIsDir'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndSizeVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndSizeVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndSizeVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndSizeVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndSizeVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setAngle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setAngle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAngle(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAngle\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setAngle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ParticleBatchNode* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ParticleBatchNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ParticleBatchNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBatchNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBatchNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getTangentialAccelVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getTangentialAccelVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getTangentialAccelVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTangentialAccelVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getTangentialAccelVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEmitterMode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEmitterMode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getEmitterMode();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEmitterMode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEmitterMode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndSpinVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndSpinVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndSpinVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndSpinVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndSpinVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getAngleVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getAngleVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAngleVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAngleVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getAngleVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color4F arg0;\n\n        ok &=luaval_to_color4f(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getRotatePerSecondVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getRotatePerSecondVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRotatePerSecondVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRotatePerSecondVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getRotatePerSecondVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEndSize();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getLife(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getLife'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getLife();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLife\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getLife'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setSpeedVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setSpeedVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSpeedVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpeedVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setSpeedVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setAutoRemoveOnFinish(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setAutoRemoveOnFinish'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAutoRemoveOnFinish(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAutoRemoveOnFinish\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setAutoRemoveOnFinish'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setGravity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setGravity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setGravity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGravity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setGravity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_postStep(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_postStep'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->postStep();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"postStep\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_postStep'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEmissionRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEmissionRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEmissionRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEmissionRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEmissionRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndColorVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndColorVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color4F& ret = cobj->getEndColorVar();\n        color4f_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndColorVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndColorVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getRotationIsDir(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getRotationIsDir'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getRotationIsDir();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRotationIsDir\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getRotationIsDir'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScale(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScale\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEmissionRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEmissionRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEmissionRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEmissionRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEmissionRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color4F& ret = cobj->getEndColor();\n        color4f_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getLifeVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getLifeVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getLifeVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLifeVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getLifeVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartSizeVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartSizeVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartSizeVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartSizeVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartSizeVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setOpacityModifyRGB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setOpacityModifyRGB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setOpacityModifyRGB(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOpacityModifyRGB\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setOpacityModifyRGB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_addParticle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_addParticle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->addParticle();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addParticle\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_addParticle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getStartRadius(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartRadius'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStartRadius();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartRadius\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartRadius'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getParticleCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getParticleCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getParticleCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParticleCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getParticleCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getStartRadiusVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartRadiusVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStartRadiusVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartRadiusVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartRadiusVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartColorVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartColorVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color4F arg0;\n\n        ok &=luaval_to_color4f(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartColorVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartColorVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartColorVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setEndSpin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setEndSpin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEndSpin(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEndSpin\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setEndSpin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setRadialAccel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setRadialAccel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRadialAccel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRadialAccel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setRadialAccel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_isAutoRemoveOnFinish(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_isAutoRemoveOnFinish'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isAutoRemoveOnFinish();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isAutoRemoveOnFinish\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_isAutoRemoveOnFinish'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getTotalParticles'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getTotalParticles();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTotalParticles\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getTotalParticles'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_setStartRadiusVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_setStartRadiusVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStartRadiusVar(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStartRadiusVar\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_setStartRadiusVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getEndRadiusVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getEndRadiusVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEndRadiusVar();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEndRadiusVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getEndRadiusVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_getStartColorVar(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystem* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystem*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystem_getStartColorVar'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color4F& ret = cobj->getStartColorVar();\n        color4f_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartColorVar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_getStartColorVar'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSystem\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSystem*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleSystem_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSystem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSystem* ret = cocos2d::ParticleSystem::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSystem\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSystem*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystem_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleSystem_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleSystem)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleSystem(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleSystem\");\n    tolua_cclass(tolua_S,\"ParticleSystem\",\"cc.ParticleSystem\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleSystem\");\n        tolua_function(tolua_S,\"getStartSizeVar\",lua_cocos2dx_ParticleSystem_getStartSizeVar);\n        tolua_function(tolua_S,\"getTexture\",lua_cocos2dx_ParticleSystem_getTexture);\n        tolua_function(tolua_S,\"isFull\",lua_cocos2dx_ParticleSystem_isFull);\n        tolua_function(tolua_S,\"getBatchNode\",lua_cocos2dx_ParticleSystem_getBatchNode);\n        tolua_function(tolua_S,\"getStartColor\",lua_cocos2dx_ParticleSystem_getStartColor);\n        tolua_function(tolua_S,\"getPositionType\",lua_cocos2dx_ParticleSystem_getPositionType);\n        tolua_function(tolua_S,\"setPosVar\",lua_cocos2dx_ParticleSystem_setPosVar);\n        tolua_function(tolua_S,\"getEndSpin\",lua_cocos2dx_ParticleSystem_getEndSpin);\n        tolua_function(tolua_S,\"setRotatePerSecondVar\",lua_cocos2dx_ParticleSystem_setRotatePerSecondVar);\n        tolua_function(tolua_S,\"getStartSpinVar\",lua_cocos2dx_ParticleSystem_getStartSpinVar);\n        tolua_function(tolua_S,\"getRadialAccelVar\",lua_cocos2dx_ParticleSystem_getRadialAccelVar);\n        tolua_function(tolua_S,\"getEndSizeVar\",lua_cocos2dx_ParticleSystem_getEndSizeVar);\n        tolua_function(tolua_S,\"setRotation\",lua_cocos2dx_ParticleSystem_setRotation);\n        tolua_function(tolua_S,\"setTangentialAccel\",lua_cocos2dx_ParticleSystem_setTangentialAccel);\n        tolua_function(tolua_S,\"setScaleY\",lua_cocos2dx_ParticleSystem_setScaleY);\n        tolua_function(tolua_S,\"setScaleX\",lua_cocos2dx_ParticleSystem_setScaleX);\n        tolua_function(tolua_S,\"getRadialAccel\",lua_cocos2dx_ParticleSystem_getRadialAccel);\n        tolua_function(tolua_S,\"setStartRadius\",lua_cocos2dx_ParticleSystem_setStartRadius);\n        tolua_function(tolua_S,\"setRotatePerSecond\",lua_cocos2dx_ParticleSystem_setRotatePerSecond);\n        tolua_function(tolua_S,\"setEndSize\",lua_cocos2dx_ParticleSystem_setEndSize);\n        tolua_function(tolua_S,\"getGravity\",lua_cocos2dx_ParticleSystem_getGravity);\n        tolua_function(tolua_S,\"getTangentialAccel\",lua_cocos2dx_ParticleSystem_getTangentialAccel);\n        tolua_function(tolua_S,\"setEndRadius\",lua_cocos2dx_ParticleSystem_setEndRadius);\n        tolua_function(tolua_S,\"getSpeed\",lua_cocos2dx_ParticleSystem_getSpeed);\n        tolua_function(tolua_S,\"getAngle\",lua_cocos2dx_ParticleSystem_getAngle);\n        tolua_function(tolua_S,\"setEndColor\",lua_cocos2dx_ParticleSystem_setEndColor);\n        tolua_function(tolua_S,\"setStartSpin\",lua_cocos2dx_ParticleSystem_setStartSpin);\n        tolua_function(tolua_S,\"setDuration\",lua_cocos2dx_ParticleSystem_setDuration);\n        tolua_function(tolua_S,\"setTexture\",lua_cocos2dx_ParticleSystem_setTexture);\n        tolua_function(tolua_S,\"getPosVar\",lua_cocos2dx_ParticleSystem_getPosVar);\n        tolua_function(tolua_S,\"updateWithNoTime\",lua_cocos2dx_ParticleSystem_updateWithNoTime);\n        tolua_function(tolua_S,\"isBlendAdditive\",lua_cocos2dx_ParticleSystem_isBlendAdditive);\n        tolua_function(tolua_S,\"getSpeedVar\",lua_cocos2dx_ParticleSystem_getSpeedVar);\n        tolua_function(tolua_S,\"setPositionType\",lua_cocos2dx_ParticleSystem_setPositionType);\n        tolua_function(tolua_S,\"stopSystem\",lua_cocos2dx_ParticleSystem_stopSystem);\n        tolua_function(tolua_S,\"getSourcePosition\",lua_cocos2dx_ParticleSystem_getSourcePosition);\n        tolua_function(tolua_S,\"setLifeVar\",lua_cocos2dx_ParticleSystem_setLifeVar);\n        tolua_function(tolua_S,\"setTotalParticles\",lua_cocos2dx_ParticleSystem_setTotalParticles);\n        tolua_function(tolua_S,\"setEndColorVar\",lua_cocos2dx_ParticleSystem_setEndColorVar);\n        tolua_function(tolua_S,\"updateQuadWithParticle\",lua_cocos2dx_ParticleSystem_updateQuadWithParticle);\n        tolua_function(tolua_S,\"getAtlasIndex\",lua_cocos2dx_ParticleSystem_getAtlasIndex);\n        tolua_function(tolua_S,\"getStartSize\",lua_cocos2dx_ParticleSystem_getStartSize);\n        tolua_function(tolua_S,\"setStartSpinVar\",lua_cocos2dx_ParticleSystem_setStartSpinVar);\n        tolua_function(tolua_S,\"resetSystem\",lua_cocos2dx_ParticleSystem_resetSystem);\n        tolua_function(tolua_S,\"setAtlasIndex\",lua_cocos2dx_ParticleSystem_setAtlasIndex);\n        tolua_function(tolua_S,\"setTangentialAccelVar\",lua_cocos2dx_ParticleSystem_setTangentialAccelVar);\n        tolua_function(tolua_S,\"setEndRadiusVar\",lua_cocos2dx_ParticleSystem_setEndRadiusVar);\n        tolua_function(tolua_S,\"getEndRadius\",lua_cocos2dx_ParticleSystem_getEndRadius);\n        tolua_function(tolua_S,\"isOpacityModifyRGB\",lua_cocos2dx_ParticleSystem_isOpacityModifyRGB);\n        tolua_function(tolua_S,\"isActive\",lua_cocos2dx_ParticleSystem_isActive);\n        tolua_function(tolua_S,\"setRadialAccelVar\",lua_cocos2dx_ParticleSystem_setRadialAccelVar);\n        tolua_function(tolua_S,\"setStartSize\",lua_cocos2dx_ParticleSystem_setStartSize);\n        tolua_function(tolua_S,\"setSpeed\",lua_cocos2dx_ParticleSystem_setSpeed);\n        tolua_function(tolua_S,\"getStartSpin\",lua_cocos2dx_ParticleSystem_getStartSpin);\n        tolua_function(tolua_S,\"getRotatePerSecond\",lua_cocos2dx_ParticleSystem_getRotatePerSecond);\n        tolua_function(tolua_S,\"initParticle\",lua_cocos2dx_ParticleSystem_initParticle);\n        tolua_function(tolua_S,\"setEmitterMode\",lua_cocos2dx_ParticleSystem_setEmitterMode);\n        tolua_function(tolua_S,\"getDuration\",lua_cocos2dx_ParticleSystem_getDuration);\n        tolua_function(tolua_S,\"setSourcePosition\",lua_cocos2dx_ParticleSystem_setSourcePosition);\n        tolua_function(tolua_S,\"getEndSpinVar\",lua_cocos2dx_ParticleSystem_getEndSpinVar);\n        tolua_function(tolua_S,\"setBlendAdditive\",lua_cocos2dx_ParticleSystem_setBlendAdditive);\n        tolua_function(tolua_S,\"setLife\",lua_cocos2dx_ParticleSystem_setLife);\n        tolua_function(tolua_S,\"setAngleVar\",lua_cocos2dx_ParticleSystem_setAngleVar);\n        tolua_function(tolua_S,\"setRotationIsDir\",lua_cocos2dx_ParticleSystem_setRotationIsDir);\n        tolua_function(tolua_S,\"setEndSizeVar\",lua_cocos2dx_ParticleSystem_setEndSizeVar);\n        tolua_function(tolua_S,\"setAngle\",lua_cocos2dx_ParticleSystem_setAngle);\n        tolua_function(tolua_S,\"setBatchNode\",lua_cocos2dx_ParticleSystem_setBatchNode);\n        tolua_function(tolua_S,\"getTangentialAccelVar\",lua_cocos2dx_ParticleSystem_getTangentialAccelVar);\n        tolua_function(tolua_S,\"getEmitterMode\",lua_cocos2dx_ParticleSystem_getEmitterMode);\n        tolua_function(tolua_S,\"setEndSpinVar\",lua_cocos2dx_ParticleSystem_setEndSpinVar);\n        tolua_function(tolua_S,\"getAngleVar\",lua_cocos2dx_ParticleSystem_getAngleVar);\n        tolua_function(tolua_S,\"setStartColor\",lua_cocos2dx_ParticleSystem_setStartColor);\n        tolua_function(tolua_S,\"getRotatePerSecondVar\",lua_cocos2dx_ParticleSystem_getRotatePerSecondVar);\n        tolua_function(tolua_S,\"getEndSize\",lua_cocos2dx_ParticleSystem_getEndSize);\n        tolua_function(tolua_S,\"getLife\",lua_cocos2dx_ParticleSystem_getLife);\n        tolua_function(tolua_S,\"setSpeedVar\",lua_cocos2dx_ParticleSystem_setSpeedVar);\n        tolua_function(tolua_S,\"setAutoRemoveOnFinish\",lua_cocos2dx_ParticleSystem_setAutoRemoveOnFinish);\n        tolua_function(tolua_S,\"setGravity\",lua_cocos2dx_ParticleSystem_setGravity);\n        tolua_function(tolua_S,\"postStep\",lua_cocos2dx_ParticleSystem_postStep);\n        tolua_function(tolua_S,\"setEmissionRate\",lua_cocos2dx_ParticleSystem_setEmissionRate);\n        tolua_function(tolua_S,\"getEndColorVar\",lua_cocos2dx_ParticleSystem_getEndColorVar);\n        tolua_function(tolua_S,\"getRotationIsDir\",lua_cocos2dx_ParticleSystem_getRotationIsDir);\n        tolua_function(tolua_S,\"setScale\",lua_cocos2dx_ParticleSystem_setScale);\n        tolua_function(tolua_S,\"getEmissionRate\",lua_cocos2dx_ParticleSystem_getEmissionRate);\n        tolua_function(tolua_S,\"getEndColor\",lua_cocos2dx_ParticleSystem_getEndColor);\n        tolua_function(tolua_S,\"getLifeVar\",lua_cocos2dx_ParticleSystem_getLifeVar);\n        tolua_function(tolua_S,\"setStartSizeVar\",lua_cocos2dx_ParticleSystem_setStartSizeVar);\n        tolua_function(tolua_S,\"setOpacityModifyRGB\",lua_cocos2dx_ParticleSystem_setOpacityModifyRGB);\n        tolua_function(tolua_S,\"addParticle\",lua_cocos2dx_ParticleSystem_addParticle);\n        tolua_function(tolua_S,\"getStartRadius\",lua_cocos2dx_ParticleSystem_getStartRadius);\n        tolua_function(tolua_S,\"getParticleCount\",lua_cocos2dx_ParticleSystem_getParticleCount);\n        tolua_function(tolua_S,\"getStartRadiusVar\",lua_cocos2dx_ParticleSystem_getStartRadiusVar);\n        tolua_function(tolua_S,\"setStartColorVar\",lua_cocos2dx_ParticleSystem_setStartColorVar);\n        tolua_function(tolua_S,\"setEndSpin\",lua_cocos2dx_ParticleSystem_setEndSpin);\n        tolua_function(tolua_S,\"setRadialAccel\",lua_cocos2dx_ParticleSystem_setRadialAccel);\n        tolua_function(tolua_S,\"isAutoRemoveOnFinish\",lua_cocos2dx_ParticleSystem_isAutoRemoveOnFinish);\n        tolua_function(tolua_S,\"getTotalParticles\",lua_cocos2dx_ParticleSystem_getTotalParticles);\n        tolua_function(tolua_S,\"setStartRadiusVar\",lua_cocos2dx_ParticleSystem_setStartRadiusVar);\n        tolua_function(tolua_S,\"getEndRadiusVar\",lua_cocos2dx_ParticleSystem_getEndRadiusVar);\n        tolua_function(tolua_S,\"getStartColorVar\",lua_cocos2dx_ParticleSystem_getStartColorVar);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleSystem_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleSystem_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleSystem).name();\n    g_luaType[typeName] = \"cc.ParticleSystem\";\n    g_typeCast[\"ParticleSystem\"] = \"cc.ParticleSystem\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleSystemQuad_setDisplayFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystemQuad* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystemQuad\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystemQuad*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystemQuad_setDisplayFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setDisplayFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDisplayFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystemQuad_setDisplayFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystemQuad_setTextureWithRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParticleSystemQuad* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParticleSystemQuad\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParticleSystemQuad*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParticleSystemQuad_setTextureWithRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Texture2D* arg0;\n        cocos2d::Rect arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_rect(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->setTextureWithRect(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureWithRect\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystemQuad_setTextureWithRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParticleSystemQuad_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSystemQuad\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSystemQuad\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSystemQuad*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSystemQuad\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSystemQuad*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystemQuad_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleSystemQuad_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSystemQuad\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSystemQuad* ret = cocos2d::ParticleSystemQuad::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSystemQuad\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSystemQuad*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSystemQuad_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleSystemQuad_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleSystemQuad)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleSystemQuad(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleSystemQuad\");\n    tolua_cclass(tolua_S,\"ParticleSystemQuad\",\"cc.ParticleSystemQuad\",\"cc.ParticleSystem\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleSystemQuad\");\n        tolua_function(tolua_S,\"setDisplayFrame\",lua_cocos2dx_ParticleSystemQuad_setDisplayFrame);\n        tolua_function(tolua_S,\"setTextureWithRect\",lua_cocos2dx_ParticleSystemQuad_setTextureWithRect);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleSystemQuad_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleSystemQuad_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleSystemQuad).name();\n    g_luaType[typeName] = \"cc.ParticleSystemQuad\";\n    g_typeCast[\"ParticleSystemQuad\"] = \"cc.ParticleSystemQuad\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleFire_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleFire\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleFire* ret = cocos2d::ParticleFire::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleFire\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleFire*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleFire_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleFire_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleFire\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleFire* ret = cocos2d::ParticleFire::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleFire\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleFire*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleFire_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleFire_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleFire)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleFire(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleFire\");\n    tolua_cclass(tolua_S,\"ParticleFire\",\"cc.ParticleFire\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleFire\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleFire_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleFire_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleFire).name();\n    g_luaType[typeName] = \"cc.ParticleFire\";\n    g_typeCast[\"ParticleFire\"] = \"cc.ParticleFire\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleFireworks_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleFireworks\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleFireworks\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleFireworks*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleFireworks_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleFireworks_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleFireworks\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleFireworks* ret = cocos2d::ParticleFireworks::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleFireworks\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleFireworks*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleFireworks_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleFireworks_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleFireworks)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleFireworks(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleFireworks\");\n    tolua_cclass(tolua_S,\"ParticleFireworks\",\"cc.ParticleFireworks\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleFireworks\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleFireworks_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleFireworks_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleFireworks).name();\n    g_luaType[typeName] = \"cc.ParticleFireworks\";\n    g_typeCast[\"ParticleFireworks\"] = \"cc.ParticleFireworks\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleSun_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSun\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSun* ret = cocos2d::ParticleSun::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSun\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSun*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSun_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleSun_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSun\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSun* ret = cocos2d::ParticleSun::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSun\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSun*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSun_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleSun_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleSun)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleSun(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleSun\");\n    tolua_cclass(tolua_S,\"ParticleSun\",\"cc.ParticleSun\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleSun\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleSun_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleSun_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleSun).name();\n    g_luaType[typeName] = \"cc.ParticleSun\";\n    g_typeCast[\"ParticleSun\"] = \"cc.ParticleSun\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleGalaxy_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleGalaxy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleGalaxy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleGalaxy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleGalaxy_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleGalaxy_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleGalaxy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleGalaxy* ret = cocos2d::ParticleGalaxy::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleGalaxy\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleGalaxy*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleGalaxy_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleGalaxy_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleGalaxy)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleGalaxy(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleGalaxy\");\n    tolua_cclass(tolua_S,\"ParticleGalaxy\",\"cc.ParticleGalaxy\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleGalaxy\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleGalaxy_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleGalaxy_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleGalaxy).name();\n    g_luaType[typeName] = \"cc.ParticleGalaxy\";\n    g_typeCast[\"ParticleGalaxy\"] = \"cc.ParticleGalaxy\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleFlower_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleFlower\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleFlower\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleFlower*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleFlower_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleFlower_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleFlower\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleFlower* ret = cocos2d::ParticleFlower::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleFlower\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleFlower*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleFlower_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleFlower_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleFlower)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleFlower(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleFlower\");\n    tolua_cclass(tolua_S,\"ParticleFlower\",\"cc.ParticleFlower\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleFlower\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleFlower_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleFlower_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleFlower).name();\n    g_luaType[typeName] = \"cc.ParticleFlower\";\n    g_typeCast[\"ParticleFlower\"] = \"cc.ParticleFlower\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleMeteor_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleMeteor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleMeteor\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleMeteor*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleMeteor_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleMeteor_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleMeteor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleMeteor* ret = cocos2d::ParticleMeteor::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleMeteor\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleMeteor*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleMeteor_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleMeteor_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleMeteor)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleMeteor(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleMeteor\");\n    tolua_cclass(tolua_S,\"ParticleMeteor\",\"cc.ParticleMeteor\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleMeteor\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleMeteor_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleMeteor_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleMeteor).name();\n    g_luaType[typeName] = \"cc.ParticleMeteor\";\n    g_typeCast[\"ParticleMeteor\"] = \"cc.ParticleMeteor\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleSpiral_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSpiral\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSpiral\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSpiral*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSpiral_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleSpiral_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSpiral\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSpiral* ret = cocos2d::ParticleSpiral::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSpiral\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSpiral*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSpiral_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleSpiral_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleSpiral)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleSpiral(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleSpiral\");\n    tolua_cclass(tolua_S,\"ParticleSpiral\",\"cc.ParticleSpiral\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleSpiral\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleSpiral_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleSpiral_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleSpiral).name();\n    g_luaType[typeName] = \"cc.ParticleSpiral\";\n    g_typeCast[\"ParticleSpiral\"] = \"cc.ParticleSpiral\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleExplosion_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleExplosion\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleExplosion\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleExplosion*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleExplosion_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleExplosion_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleExplosion\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleExplosion* ret = cocos2d::ParticleExplosion::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleExplosion\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleExplosion*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleExplosion_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleExplosion_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleExplosion)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleExplosion(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleExplosion\");\n    tolua_cclass(tolua_S,\"ParticleExplosion\",\"cc.ParticleExplosion\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleExplosion\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleExplosion_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleExplosion_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleExplosion).name();\n    g_luaType[typeName] = \"cc.ParticleExplosion\";\n    g_typeCast[\"ParticleExplosion\"] = \"cc.ParticleExplosion\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleSmoke_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSmoke\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSmoke\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSmoke*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSmoke_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleSmoke_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSmoke\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSmoke* ret = cocos2d::ParticleSmoke::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSmoke\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSmoke*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSmoke_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleSmoke_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleSmoke)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleSmoke(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleSmoke\");\n    tolua_cclass(tolua_S,\"ParticleSmoke\",\"cc.ParticleSmoke\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleSmoke\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleSmoke_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleSmoke_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleSmoke).name();\n    g_luaType[typeName] = \"cc.ParticleSmoke\";\n    g_typeCast[\"ParticleSmoke\"] = \"cc.ParticleSmoke\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleSnow_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSnow\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSnow\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSnow*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSnow_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleSnow_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleSnow\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleSnow* ret = cocos2d::ParticleSnow::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleSnow\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleSnow*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleSnow_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleSnow_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleSnow)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleSnow(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleSnow\");\n    tolua_cclass(tolua_S,\"ParticleSnow\",\"cc.ParticleSnow\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleSnow\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleSnow_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleSnow_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleSnow).name();\n    g_luaType[typeName] = \"cc.ParticleSnow\";\n    g_typeCast[\"ParticleSnow\"] = \"cc.ParticleSnow\";\n    return 1;\n}\n\nint lua_cocos2dx_ParticleRain_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleRain\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParticleRain* ret = cocos2d::ParticleRain::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleRain\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleRain*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleRain_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ParticleRain_createWithTotalParticles(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParticleRain\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ParticleRain* ret = cocos2d::ParticleRain::createWithTotalParticles(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParticleRain\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParticleRain*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithTotalParticles\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParticleRain_createWithTotalParticles'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParticleRain_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleRain)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParticleRain(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParticleRain\");\n    tolua_cclass(tolua_S,\"ParticleRain\",\"cc.ParticleRain\",\"cc.ParticleSystemQuad\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleRain\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParticleRain_create);\n        tolua_function(tolua_S,\"createWithTotalParticles\", lua_cocos2dx_ParticleRain_createWithTotalParticles);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParticleRain).name();\n    g_luaType[typeName] = \"cc.ParticleRain\";\n    g_typeCast[\"ParticleRain\"] = \"cc.ParticleRain\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_EventListenerCustom_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerCustom)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventListenerCustom(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerCustom\");\n    tolua_cclass(tolua_S,\"EventListenerCustom\",\"cc.EventListenerCustom\",\"cc.EventListener\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerCustom\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerCustom).name();\n    g_luaType[typeName] = \"cc.EventListenerCustom\";\n    g_typeCast[\"EventListenerCustom\"] = \"cc.EventListenerCustom\";\n    return 1;\n}\n\nint lua_cocos2dx_FileUtils_fullPathForFilename(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_fullPathForFilename'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        std::string ret = cobj->fullPathForFilename(arg0);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"fullPathForFilename\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_fullPathForFilename'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_getStringFromFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_getStringFromFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getStringFromFile(arg0);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringFromFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_getStringFromFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_setFilenameLookupDictionary(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_setFilenameLookupDictionary'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMap arg0;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setFilenameLookupDictionary(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFilenameLookupDictionary\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_setFilenameLookupDictionary'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_isAbsolutePath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_isAbsolutePath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->isAbsolutePath(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isAbsolutePath\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_isAbsolutePath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->loadFilenameLookupDictionaryFromFile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadFilenameLookupDictionaryFromFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_isPopupNotify(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_isPopupNotify'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isPopupNotify();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isPopupNotify\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_isPopupNotify'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_getValueVectorFromFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_getValueVectorFromFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector ret = cobj->getValueVectorFromFile(arg0);\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getValueVectorFromFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_getValueVectorFromFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_writeToFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_writeToFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::ValueMap arg0;\n        std::string arg1;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->writeToFile(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"writeToFile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_writeToFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_getValueMapFromFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_getValueMapFromFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ValueMap ret = cobj->getValueMapFromFile(arg0);\n        ccvaluemap_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getValueMapFromFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_getValueMapFromFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_addSearchResolutionsOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_addSearchResolutionsOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addSearchResolutionsOrder(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSearchResolutionsOrder\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_addSearchResolutionsOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_addSearchPath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_addSearchPath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addSearchPath(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSearchPath\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_addSearchPath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_isFileExist(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_isFileExist'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFileExist(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFileExist\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_isFileExist'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_purgeCachedEntries(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_purgeCachedEntries'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->purgeCachedEntries();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"purgeCachedEntries\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_purgeCachedEntries'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_fullPathFromRelativeFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_fullPathFromRelativeFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        std::string arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        std::string ret = cobj->fullPathFromRelativeFile(arg0, arg1);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"fullPathFromRelativeFile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_fullPathFromRelativeFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_setPopupNotify(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_setPopupNotify'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPopupNotify(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPopupNotify\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_setPopupNotify'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_getWritablePath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::FileUtils* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::FileUtils*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_FileUtils_getWritablePath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getWritablePath();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWritablePath\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_getWritablePath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_FileUtils_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::FileUtils::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_FileUtils_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::FileUtils* ret = cocos2d::FileUtils::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.FileUtils\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::FileUtils*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_FileUtils_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_FileUtils_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FileUtils)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_FileUtils(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.FileUtils\");\n    tolua_cclass(tolua_S,\"FileUtils\",\"cc.FileUtils\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FileUtils\");\n        tolua_function(tolua_S,\"fullPathForFilename\",lua_cocos2dx_FileUtils_fullPathForFilename);\n        tolua_function(tolua_S,\"getStringFromFile\",lua_cocos2dx_FileUtils_getStringFromFile);\n        tolua_function(tolua_S,\"setFilenameLookupDictionary\",lua_cocos2dx_FileUtils_setFilenameLookupDictionary);\n        tolua_function(tolua_S,\"isAbsolutePath\",lua_cocos2dx_FileUtils_isAbsolutePath);\n        tolua_function(tolua_S,\"loadFilenameLookup\",lua_cocos2dx_FileUtils_loadFilenameLookupDictionaryFromFile);\n        tolua_function(tolua_S,\"isPopupNotify\",lua_cocos2dx_FileUtils_isPopupNotify);\n        tolua_function(tolua_S,\"getValueVectorFromFile\",lua_cocos2dx_FileUtils_getValueVectorFromFile);\n        tolua_function(tolua_S,\"writeToFile\",lua_cocos2dx_FileUtils_writeToFile);\n        tolua_function(tolua_S,\"getValueMapFromFile\",lua_cocos2dx_FileUtils_getValueMapFromFile);\n        tolua_function(tolua_S,\"addSearchResolutionsOrder\",lua_cocos2dx_FileUtils_addSearchResolutionsOrder);\n        tolua_function(tolua_S,\"addSearchPath\",lua_cocos2dx_FileUtils_addSearchPath);\n        tolua_function(tolua_S,\"isFileExist\",lua_cocos2dx_FileUtils_isFileExist);\n        tolua_function(tolua_S,\"purgeCachedEntries\",lua_cocos2dx_FileUtils_purgeCachedEntries);\n        tolua_function(tolua_S,\"fullPathFromRelativeFile\",lua_cocos2dx_FileUtils_fullPathFromRelativeFile);\n        tolua_function(tolua_S,\"setPopupNotify\",lua_cocos2dx_FileUtils_setPopupNotify);\n        tolua_function(tolua_S,\"getWritablePath\",lua_cocos2dx_FileUtils_getWritablePath);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_FileUtils_destroyInstance);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_FileUtils_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::FileUtils).name();\n    g_luaType[typeName] = \"cc.FileUtils\";\n    g_typeCast[\"FileUtils\"] = \"cc.FileUtils\";\n    return 1;\n}\n\nint lua_cocos2dx_Application_getTargetPlatform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Application* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Application\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Application_getTargetPlatform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getTargetPlatform();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTargetPlatform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Application_getTargetPlatform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Application_setAnimationInterval(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Application* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Application\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Application_setAnimationInterval'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAnimationInterval(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimationInterval\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Application_setAnimationInterval'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Application_getCurrentLanguage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Application* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Application\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Application*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Application_getCurrentLanguage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getCurrentLanguage();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentLanguage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Application_getCurrentLanguage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Application_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Application\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Application* ret = cocos2d::Application::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Application\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Application*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Application_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Application_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Application)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Application(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Application\");\n    tolua_cclass(tolua_S,\"Application\",\"cc.Application\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Application\");\n        tolua_function(tolua_S,\"getTargetPlatform\",lua_cocos2dx_Application_getTargetPlatform);\n        tolua_function(tolua_S,\"setAnimationInterval\",lua_cocos2dx_Application_setAnimationInterval);\n        tolua_function(tolua_S,\"getCurrentLanguage\",lua_cocos2dx_Application_getCurrentLanguage);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_Application_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Application).name();\n    g_luaType[typeName] = \"cc.Application\";\n    g_typeCast[\"Application\"] = \"cc.Application\";\n    return 1;\n}\n\nint lua_cocos2dx_EGLViewProtocol_setFrameSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_setFrameSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        double arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setFrameSize(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFrameSize\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_setFrameSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_swapBuffers(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_swapBuffers'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->swapBuffers();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"swapBuffers\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_swapBuffers'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getViewPortRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getViewPortRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Rect& ret = cobj->getViewPortRect();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getViewPortRect\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getViewPortRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_end(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_end'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->end();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"end\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_end'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_setViewName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_setViewName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setViewName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setViewName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_setViewName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getScaleY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getScaleY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScaleY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScaleY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getScaleY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getScaleX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getScaleX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScaleX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScaleX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getScaleX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getVisibleOrigin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getVisibleOrigin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getVisibleOrigin();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVisibleOrigin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getVisibleOrigin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getViewName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getViewName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getViewName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getViewName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getViewName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getVisibleSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getVisibleSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getVisibleSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVisibleSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getVisibleSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_isScissorEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_isScissorEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isScissorEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isScissorEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_isScissorEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_setIMEKeyboardState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_setIMEKeyboardState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setIMEKeyboardState(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setIMEKeyboardState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_setIMEKeyboardState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_setDesignResolutionSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_setDesignResolutionSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        double arg0;\n        double arg1;\n        ResolutionPolicy arg2;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        cobj->setDesignResolutionSize(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDesignResolutionSize\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_setDesignResolutionSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getDesignResolutionSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getDesignResolutionSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getDesignResolutionSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDesignResolutionSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getDesignResolutionSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_setViewPortInPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_setViewPortInPoints'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        double arg3;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cobj->setViewPortInPoints(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setViewPortInPoints\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_setViewPortInPoints'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_setScissorInPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_setScissorInPoints'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        double arg0;\n        double arg1;\n        double arg2;\n        double arg3;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cobj->setScissorInPoints(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScissorInPoints\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_setScissorInPoints'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getFrameSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getFrameSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getFrameSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFrameSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getFrameSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_getScissorRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_getScissorRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Rect ret = cobj->getScissorRect();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScissorRect\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_getScissorRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_isOpenGLReady(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_isOpenGLReady'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isOpenGLReady();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isOpenGLReady\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_isOpenGLReady'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLViewProtocol_pollInputEvents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLViewProtocol* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLViewProtocol\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLViewProtocol*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLViewProtocol_pollInputEvents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pollInputEvents();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pollInputEvents\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLViewProtocol_pollInputEvents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_EGLViewProtocol_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EGLViewProtocol)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EGLViewProtocol(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EGLViewProtocol\");\n    tolua_cclass(tolua_S,\"EGLViewProtocol\",\"cc.EGLViewProtocol\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EGLViewProtocol\");\n        tolua_function(tolua_S,\"setFrameSize\",lua_cocos2dx_EGLViewProtocol_setFrameSize);\n        tolua_function(tolua_S,\"swapBuffers\",lua_cocos2dx_EGLViewProtocol_swapBuffers);\n        tolua_function(tolua_S,\"getViewPortRect\",lua_cocos2dx_EGLViewProtocol_getViewPortRect);\n        tolua_function(tolua_S,\"end\",lua_cocos2dx_EGLViewProtocol_end);\n        tolua_function(tolua_S,\"setViewName\",lua_cocos2dx_EGLViewProtocol_setViewName);\n        tolua_function(tolua_S,\"getScaleY\",lua_cocos2dx_EGLViewProtocol_getScaleY);\n        tolua_function(tolua_S,\"getScaleX\",lua_cocos2dx_EGLViewProtocol_getScaleX);\n        tolua_function(tolua_S,\"getVisibleOrigin\",lua_cocos2dx_EGLViewProtocol_getVisibleOrigin);\n        tolua_function(tolua_S,\"getViewName\",lua_cocos2dx_EGLViewProtocol_getViewName);\n        tolua_function(tolua_S,\"getVisibleSize\",lua_cocos2dx_EGLViewProtocol_getVisibleSize);\n        tolua_function(tolua_S,\"isScissorEnabled\",lua_cocos2dx_EGLViewProtocol_isScissorEnabled);\n        tolua_function(tolua_S,\"setIMEKeyboardState\",lua_cocos2dx_EGLViewProtocol_setIMEKeyboardState);\n        tolua_function(tolua_S,\"setDesignResolutionSize\",lua_cocos2dx_EGLViewProtocol_setDesignResolutionSize);\n        tolua_function(tolua_S,\"getDesignResolutionSize\",lua_cocos2dx_EGLViewProtocol_getDesignResolutionSize);\n        tolua_function(tolua_S,\"setViewPortInPoints\",lua_cocos2dx_EGLViewProtocol_setViewPortInPoints);\n        tolua_function(tolua_S,\"setScissorInPoints\",lua_cocos2dx_EGLViewProtocol_setScissorInPoints);\n        tolua_function(tolua_S,\"getFrameSize\",lua_cocos2dx_EGLViewProtocol_getFrameSize);\n        tolua_function(tolua_S,\"getScissorRect\",lua_cocos2dx_EGLViewProtocol_getScissorRect);\n        tolua_function(tolua_S,\"isOpenGLReady\",lua_cocos2dx_EGLViewProtocol_isOpenGLReady);\n        tolua_function(tolua_S,\"pollInputEvents\",lua_cocos2dx_EGLViewProtocol_pollInputEvents);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EGLViewProtocol).name();\n    g_luaType[typeName] = \"cc.EGLViewProtocol\";\n    g_typeCast[\"EGLViewProtocol\"] = \"cc.EGLViewProtocol\";\n    return 1;\n}\n\nint lua_cocos2dx_EGLView_setIMEKeyboardState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLView_setIMEKeyboardState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setIMEKeyboardState(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setIMEKeyboardState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLView_setIMEKeyboardState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLView_isOpenGLReady(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EGLView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EGLView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EGLView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EGLView_isOpenGLReady'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isOpenGLReady();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isOpenGLReady\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLView_isOpenGLReady'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EGLView_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EGLView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::EGLView* ret = cocos2d::EGLView::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EGLView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EGLView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EGLView_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_EGLView_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EGLView)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EGLView(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EGLView\");\n    tolua_cclass(tolua_S,\"EGLView\",\"cc.EGLView\",\"cc.EGLViewProtocol\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EGLView\");\n        tolua_function(tolua_S,\"setIMEKeyboardState\",lua_cocos2dx_EGLView_setIMEKeyboardState);\n        tolua_function(tolua_S,\"isOpenGLReady\",lua_cocos2dx_EGLView_isOpenGLReady);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_EGLView_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EGLView).name();\n    g_luaType[typeName] = \"cc.EGLView\";\n    g_typeCast[\"EGLView\"] = \"cc.EGLView\";\n    return 1;\n}\n\nint lua_cocos2dx_ShaderCache_reloadDefaultShaders(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShaderCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ShaderCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ShaderCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ShaderCache_reloadDefaultShaders'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->reloadDefaultShaders();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reloadDefaultShaders\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShaderCache_reloadDefaultShaders'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ShaderCache_addProgram(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShaderCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ShaderCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ShaderCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ShaderCache_addProgram'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::GLProgram* arg0;\n        std::string arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.GLProgram\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::GLProgram*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->addProgram(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addProgram\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShaderCache_addProgram'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ShaderCache_getProgram(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShaderCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ShaderCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ShaderCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ShaderCache_getProgram'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::GLProgram* ret = cobj->getProgram(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.GLProgram\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::GLProgram*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProgram\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShaderCache_getProgram'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ShaderCache_loadDefaultShaders(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShaderCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ShaderCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ShaderCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ShaderCache_loadDefaultShaders'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->loadDefaultShaders();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadDefaultShaders\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShaderCache_loadDefaultShaders'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ShaderCache_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ShaderCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ShaderCache::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShaderCache_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ShaderCache_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ShaderCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ShaderCache* ret = cocos2d::ShaderCache::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ShaderCache\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ShaderCache*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShaderCache_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_ShaderCache_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ShaderCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::ShaderCache();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ShaderCache\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ShaderCache\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ShaderCache\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ShaderCache_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_ShaderCache_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ShaderCache)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ShaderCache(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ShaderCache\");\n    tolua_cclass(tolua_S,\"ShaderCache\",\"cc.ShaderCache\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ShaderCache\");\n        tolua_function(tolua_S,\"reloadDefaultShaders\",lua_cocos2dx_ShaderCache_reloadDefaultShaders);\n        tolua_function(tolua_S,\"addProgram\",lua_cocos2dx_ShaderCache_addProgram);\n        tolua_function(tolua_S,\"getProgram\",lua_cocos2dx_ShaderCache_getProgram);\n        tolua_function(tolua_S,\"loadDefaultShaders\",lua_cocos2dx_ShaderCache_loadDefaultShaders);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_ShaderCache_constructor);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_ShaderCache_destroyInstance);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_ShaderCache_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ShaderCache).name();\n    g_luaType[typeName] = \"cc.ShaderCache\";\n    g_typeCast[\"ShaderCache\"] = \"cc.ShaderCache\";\n    return 1;\n}\n\nint lua_cocos2dx_AnimationCache_getAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationCache_getAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Animation* ret = cobj->getAnimation(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Animation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Animation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_getAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_addAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationCache_addAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Animation* arg0;\n        std::string arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Animation\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Animation*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->addAnimation(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addAnimation\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_addAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationCache_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_addAnimationsWithDictionary(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationCache_addAnimationsWithDictionary'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::ValueMap arg0;\n        std::string arg1;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->addAnimationsWithDictionary(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addAnimationsWithDictionary\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_addAnimationsWithDictionary'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_removeAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationCache_removeAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAnimation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAnimation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_removeAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_addAnimationsWithFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::AnimationCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_AnimationCache_addAnimationsWithFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addAnimationsWithFile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addAnimationsWithFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_addAnimationsWithFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::AnimationCache::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.AnimationCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::AnimationCache* ret = cocos2d::AnimationCache::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.AnimationCache\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::AnimationCache*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_AnimationCache_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::AnimationCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::AnimationCache();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.AnimationCache\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.AnimationCache\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"AnimationCache\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_AnimationCache_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_AnimationCache_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (AnimationCache)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_AnimationCache(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.AnimationCache\");\n    tolua_cclass(tolua_S,\"AnimationCache\",\"cc.AnimationCache\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"AnimationCache\");\n        tolua_function(tolua_S,\"getAnimation\",lua_cocos2dx_AnimationCache_getAnimation);\n        tolua_function(tolua_S,\"addAnimation\",lua_cocos2dx_AnimationCache_addAnimation);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_AnimationCache_init);\n        tolua_function(tolua_S,\"addAnimationsWithDictionary\",lua_cocos2dx_AnimationCache_addAnimationsWithDictionary);\n        tolua_function(tolua_S,\"removeAnimation\",lua_cocos2dx_AnimationCache_removeAnimation);\n        tolua_function(tolua_S,\"addAnimations\",lua_cocos2dx_AnimationCache_addAnimationsWithFile);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_AnimationCache_constructor);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_AnimationCache_destroyInstance);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_AnimationCache_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::AnimationCache).name();\n    g_luaType[typeName] = \"cc.AnimationCache\";\n    g_typeCast[\"AnimationCache\"] = \"cc.AnimationCache\";\n    return 1;\n}\n\nint lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->addSpriteFramesWithFile(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->addSpriteFramesWithFile(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->addSpriteFramesWithFile(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSpriteFramesWithFile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_addSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::SpriteFrame* arg0;\n        std::string arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->addSpriteFrame(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSpriteFrame\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeUnusedSpriteFrames();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeUnusedSpriteFrames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::SpriteFrame* ret = cobj->getSpriteFrameByName(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrame\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrame*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpriteFrameByName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeSpriteFramesFromFile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeSpriteFramesFromFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_removeSpriteFrames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFrames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeSpriteFrames();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeSpriteFrames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFrames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeSpriteFramesFromTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeSpriteFramesFromTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_removeSpriteFrameByName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::SpriteFrameCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFrameByName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeSpriteFrameByName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeSpriteFrameByName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_removeSpriteFrameByName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::SpriteFrameCache::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_SpriteFrameCache_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SpriteFrameCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::SpriteFrameCache* ret = cocos2d::SpriteFrameCache::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SpriteFrameCache\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::SpriteFrameCache*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteFrameCache_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_SpriteFrameCache_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SpriteFrameCache)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SpriteFrameCache(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SpriteFrameCache\");\n    tolua_cclass(tolua_S,\"SpriteFrameCache\",\"cc.SpriteFrameCache\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SpriteFrameCache\");\n        tolua_function(tolua_S,\"addSpriteFrames\",lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile);\n        tolua_function(tolua_S,\"addSpriteFrame\",lua_cocos2dx_SpriteFrameCache_addSpriteFrame);\n        tolua_function(tolua_S,\"removeUnusedSpriteFrames\",lua_cocos2dx_SpriteFrameCache_removeUnusedSpriteFrames);\n        tolua_function(tolua_S,\"getSpriteFrame\",lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName);\n        tolua_function(tolua_S,\"removeSpriteFramesFromFile\",lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromFile);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_SpriteFrameCache_init);\n        tolua_function(tolua_S,\"removeSpriteFrames\",lua_cocos2dx_SpriteFrameCache_removeSpriteFrames);\n        tolua_function(tolua_S,\"removeSpriteFramesFromTexture\",lua_cocos2dx_SpriteFrameCache_removeSpriteFramesFromTexture);\n        tolua_function(tolua_S,\"removeSpriteFrameByName\",lua_cocos2dx_SpriteFrameCache_removeSpriteFrameByName);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_SpriteFrameCache_destroyInstance);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_SpriteFrameCache_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::SpriteFrameCache).name();\n    g_luaType[typeName] = \"cc.SpriteFrameCache\";\n    g_typeCast[\"SpriteFrameCache\"] = \"cc.SpriteFrameCache\";\n    return 1;\n}\n\nint lua_cocos2dx_UserDefault_setIntegerForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_setIntegerForKey'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        int arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setIntegerForKey(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setIntegerForKey\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_setIntegerForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_getFloatForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_getFloatForKey'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double ret = cobj->getFloatForKey(arg0, arg1);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            double ret = cobj->getFloatForKey(arg0);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFloatForKey\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_getFloatForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_getBoolForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_getBoolForKey'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->getBoolForKey(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            bool ret = cobj->getBoolForKey(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBoolForKey\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_getBoolForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_setDoubleForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_setDoubleForKey'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        double arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setDoubleForKey(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDoubleForKey\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_setDoubleForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_setFloatForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_setFloatForKey'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        double arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setFloatForKey(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFloatForKey\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_setFloatForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_getStringForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_getStringForKey'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            std::string ret = cobj->getStringForKey(arg0, arg1);\n            tolua_pushcppstring(tolua_S,ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            std::string ret = cobj->getStringForKey(arg0);\n            tolua_pushcppstring(tolua_S,ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringForKey\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_getStringForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_setStringForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_setStringForKey'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        std::string arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setStringForKey(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStringForKey\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_setStringForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_flush(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_flush'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->flush();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"flush\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_flush'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_getIntegerForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_getIntegerForKey'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            int ret = cobj->getIntegerForKey(arg0, arg1);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            int ret = cobj->getIntegerForKey(arg0);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getIntegerForKey\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_getIntegerForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_getDoubleForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_getDoubleForKey'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            double ret = cobj->getDoubleForKey(arg0, arg1);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            double ret = cobj->getDoubleForKey(arg0);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDoubleForKey\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_getDoubleForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_setBoolForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::UserDefault* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::UserDefault*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_UserDefault_setBoolForKey'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        bool arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setBoolForKey(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBoolForKey\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_setBoolForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_UserDefault_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::UserDefault::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_UserDefault_getXMLFilePath(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cocos2d::UserDefault::getXMLFilePath();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getXMLFilePath\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_getXMLFilePath'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_UserDefault_isXMLFileExist(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        bool ret = cocos2d::UserDefault::isXMLFileExist();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"isXMLFileExist\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_UserDefault_isXMLFileExist'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_UserDefault_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (UserDefault)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_UserDefault(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.UserDefault\");\n    tolua_cclass(tolua_S,\"UserDefault\",\"cc.UserDefault\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"UserDefault\");\n        tolua_function(tolua_S,\"setIntegerForKey\",lua_cocos2dx_UserDefault_setIntegerForKey);\n        tolua_function(tolua_S,\"getFloatForKey\",lua_cocos2dx_UserDefault_getFloatForKey);\n        tolua_function(tolua_S,\"getBoolForKey\",lua_cocos2dx_UserDefault_getBoolForKey);\n        tolua_function(tolua_S,\"setDoubleForKey\",lua_cocos2dx_UserDefault_setDoubleForKey);\n        tolua_function(tolua_S,\"setFloatForKey\",lua_cocos2dx_UserDefault_setFloatForKey);\n        tolua_function(tolua_S,\"getStringForKey\",lua_cocos2dx_UserDefault_getStringForKey);\n        tolua_function(tolua_S,\"setStringForKey\",lua_cocos2dx_UserDefault_setStringForKey);\n        tolua_function(tolua_S,\"flush\",lua_cocos2dx_UserDefault_flush);\n        tolua_function(tolua_S,\"getIntegerForKey\",lua_cocos2dx_UserDefault_getIntegerForKey);\n        tolua_function(tolua_S,\"getDoubleForKey\",lua_cocos2dx_UserDefault_getDoubleForKey);\n        tolua_function(tolua_S,\"setBoolForKey\",lua_cocos2dx_UserDefault_setBoolForKey);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_UserDefault_destroyInstance);\n        tolua_function(tolua_S,\"getXMLFilePath\", lua_cocos2dx_UserDefault_getXMLFilePath);\n        tolua_function(tolua_S,\"isXMLFileExist\", lua_cocos2dx_UserDefault_isXMLFileExist);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::UserDefault).name();\n    g_luaType[typeName] = \"cc.UserDefault\";\n    g_typeCast[\"UserDefault\"] = \"cc.UserDefault\";\n    return 1;\n}\n\nint lua_cocos2dx_TextureCache_removeTextureForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_removeTextureForKey'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeTextureForKey(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeTextureForKey\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_removeTextureForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_removeAllTextures(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_removeAllTextures'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllTextures();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllTextures\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_removeAllTextures'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_getDescription(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_getDescription'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getDescription();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDescription\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_getDescription'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_getCachedTextureInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_getCachedTextureInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getCachedTextureInfo();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCachedTextureInfo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_getCachedTextureInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_addImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_addImage'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Image* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Image\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Image*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D* ret = cobj->addImage(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Texture2D* ret = cobj->addImage(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addImage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_addImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_getTextureForKey(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_getTextureForKey'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Texture2D* ret = cobj->getTextureForKey(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Texture2D\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Texture2D*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureForKey\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_getTextureForKey'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_removeUnusedTextures(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_removeUnusedTextures'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeUnusedTextures();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeUnusedTextures\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_removeUnusedTextures'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_removeTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_removeTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Texture2D* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Texture2D\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Texture2D*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeTexture(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_removeTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_waitForQuit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TextureCache\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TextureCache*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_waitForQuit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->waitForQuit();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"waitForQuit\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_waitForQuit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TextureCache_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TextureCache* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TextureCache();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TextureCache\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TextureCache\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TextureCache\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TextureCache_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TextureCache_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TextureCache)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TextureCache(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TextureCache\");\n    tolua_cclass(tolua_S,\"TextureCache\",\"cc.TextureCache\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TextureCache\");\n        tolua_function(tolua_S,\"removeTextureForKey\",lua_cocos2dx_TextureCache_removeTextureForKey);\n        tolua_function(tolua_S,\"removeAllTextures\",lua_cocos2dx_TextureCache_removeAllTextures);\n        tolua_function(tolua_S,\"getDescription\",lua_cocos2dx_TextureCache_getDescription);\n        tolua_function(tolua_S,\"getCachedTextureInfo\",lua_cocos2dx_TextureCache_getCachedTextureInfo);\n        tolua_function(tolua_S,\"addImage\",lua_cocos2dx_TextureCache_addImage);\n        tolua_function(tolua_S,\"getTextureForKey\",lua_cocos2dx_TextureCache_getTextureForKey);\n        tolua_function(tolua_S,\"removeUnusedTextures\",lua_cocos2dx_TextureCache_removeUnusedTextures);\n        tolua_function(tolua_S,\"removeTexture\",lua_cocos2dx_TextureCache_removeTexture);\n        tolua_function(tolua_S,\"waitForQuit\",lua_cocos2dx_TextureCache_waitForQuit);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TextureCache_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TextureCache).name();\n    g_luaType[typeName] = \"cc.TextureCache\";\n    g_typeCast[\"TextureCache\"] = \"cc.TextureCache\";\n    return 1;\n}\n\nint lua_cocos2dx_ParallaxNode_getParallaxArray(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParallaxNode* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParallaxNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::ParallaxNode*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParallaxNode_getParallaxArray'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            const cocos2d::_ccArray* ret = cobj->getParallaxArray();\n            #pragma warning NO CONVERSION FROM NATIVE FOR _ccArray*;\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cocos2d::_ccArray* ret = cobj->getParallaxArray();\n            #pragma warning NO CONVERSION FROM NATIVE FOR _ccArray*;\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParallaxArray\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParallaxNode_getParallaxArray'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParallaxNode_addChild(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParallaxNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParallaxNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParallaxNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParallaxNode_addChild'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        cocos2d::Node* arg0;\n        int arg1;\n        cocos2d::Point arg2;\n        cocos2d::Point arg3;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        cobj->addChild(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addChild\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParallaxNode_addChild'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParallaxNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParallaxNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParallaxNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAllChildrenWithCleanup(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllChildrenWithCleanup\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParallaxNode_setParallaxArray(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::ParallaxNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ParallaxNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::ParallaxNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_ParallaxNode_setParallaxArray'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::_ccArray* arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR _ccArray*;\n        if(!ok)\n            return 0;\n        cobj->setParallaxArray(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setParallaxArray\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParallaxNode_setParallaxArray'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_ParallaxNode_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ParallaxNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::ParallaxNode* ret = cocos2d::ParallaxNode::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ParallaxNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ParallaxNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_ParallaxNode_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_ParallaxNode_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParallaxNode)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_ParallaxNode(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ParallaxNode\");\n    tolua_cclass(tolua_S,\"ParallaxNode\",\"cc.ParallaxNode\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParallaxNode\");\n        tolua_function(tolua_S,\"getParallaxArray\",lua_cocos2dx_ParallaxNode_getParallaxArray);\n        tolua_function(tolua_S,\"addChild\",lua_cocos2dx_ParallaxNode_addChild);\n        tolua_function(tolua_S,\"removeAllChildrenWithCleanup\",lua_cocos2dx_ParallaxNode_removeAllChildrenWithCleanup);\n        tolua_function(tolua_S,\"setParallaxArray\",lua_cocos2dx_ParallaxNode_setParallaxArray);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_ParallaxNode_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::ParallaxNode).name();\n    g_luaType[typeName] = \"cc.ParallaxNode\";\n    g_typeCast[\"ParallaxNode\"] = \"cc.ParallaxNode\";\n    return 1;\n}\n\nint lua_cocos2dx_TMXObjectGroup_setPositionOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_setPositionOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPositionOffset(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPositionOffset\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_setPositionOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_getProperty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_getProperty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Value ret = cobj->getProperty(arg0);\n        ccvalue_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperty\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_getProperty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_getPositionOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_getPositionOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getPositionOffset();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPositionOffset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_getPositionOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_getObject(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_getObject'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::ValueMap ret = cobj->getObject(arg0);\n        ccvaluemap_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getObject\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_getObject'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_getObjects(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_getObjects'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::ValueVector& ret = cobj->getObjects();\n            ccvaluevector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::ValueVector& ret = cobj->getObjects();\n            ccvaluevector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getObjects\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_getObjects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_setGroupName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_setGroupName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setGroupName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGroupName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_setGroupName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_getProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_getProperties'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::ValueMap& ret = cobj->getProperties();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::ValueMap& ret = cobj->getProperties();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperties\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_getProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_getGroupName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_getGroupName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getGroupName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGroupName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_getGroupName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_setProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_setProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMap arg0;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setProperties(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProperties\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_setProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_setObjects(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXObjectGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXObjectGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXObjectGroup_setObjects'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueVector arg0;\n\n        ok &= luaval_to_ccvaluevector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setObjects(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setObjects\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_setObjects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXObjectGroup_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXObjectGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TMXObjectGroup();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TMXObjectGroup\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TMXObjectGroup\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TMXObjectGroup\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXObjectGroup_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TMXObjectGroup_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TMXObjectGroup)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TMXObjectGroup(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TMXObjectGroup\");\n    tolua_cclass(tolua_S,\"TMXObjectGroup\",\"cc.TMXObjectGroup\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TMXObjectGroup\");\n        tolua_function(tolua_S,\"setPositionOffset\",lua_cocos2dx_TMXObjectGroup_setPositionOffset);\n        tolua_function(tolua_S,\"getProperty\",lua_cocos2dx_TMXObjectGroup_getProperty);\n        tolua_function(tolua_S,\"getPositionOffset\",lua_cocos2dx_TMXObjectGroup_getPositionOffset);\n        tolua_function(tolua_S,\"getObject\",lua_cocos2dx_TMXObjectGroup_getObject);\n        tolua_function(tolua_S,\"getObjects\",lua_cocos2dx_TMXObjectGroup_getObjects);\n        tolua_function(tolua_S,\"setGroupName\",lua_cocos2dx_TMXObjectGroup_setGroupName);\n        tolua_function(tolua_S,\"getProperties\",lua_cocos2dx_TMXObjectGroup_getProperties);\n        tolua_function(tolua_S,\"getGroupName\",lua_cocos2dx_TMXObjectGroup_getGroupName);\n        tolua_function(tolua_S,\"setProperties\",lua_cocos2dx_TMXObjectGroup_setProperties);\n        tolua_function(tolua_S,\"setObjects\",lua_cocos2dx_TMXObjectGroup_setObjects);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TMXObjectGroup_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TMXObjectGroup).name();\n    g_luaType[typeName] = \"cc.TMXObjectGroup\";\n    g_typeCast[\"TMXObjectGroup\"] = \"cc.TMXObjectGroup\";\n    return 1;\n}\n\nint lua_cocos2dx_TMXLayerInfo_setProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayerInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayerInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayerInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayerInfo_setProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMap arg0;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setProperties(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProperties\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayerInfo_setProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayerInfo_getProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayerInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayerInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayerInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayerInfo_getProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueMap& ret = cobj->getProperties();\n        ccvaluemap_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperties\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayerInfo_getProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayerInfo_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayerInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TMXLayerInfo();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TMXLayerInfo\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TMXLayerInfo\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TMXLayerInfo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayerInfo_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TMXLayerInfo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TMXLayerInfo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TMXLayerInfo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TMXLayerInfo\");\n    tolua_cclass(tolua_S,\"TMXLayerInfo\",\"cc.TMXLayerInfo\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TMXLayerInfo\");\n        tolua_function(tolua_S,\"setProperties\",lua_cocos2dx_TMXLayerInfo_setProperties);\n        tolua_function(tolua_S,\"getProperties\",lua_cocos2dx_TMXLayerInfo_getProperties);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TMXLayerInfo_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TMXLayerInfo).name();\n    g_luaType[typeName] = \"cc.TMXLayerInfo\";\n    g_typeCast[\"TMXLayerInfo\"] = \"cc.TMXLayerInfo\";\n    return 1;\n}\n\nint lua_cocos2dx_TMXTilesetInfo_rectForGID(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTilesetInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTilesetInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTilesetInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTilesetInfo_rectForGID'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Rect ret = cobj->rectForGID(arg0);\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"rectForGID\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTilesetInfo_rectForGID'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTilesetInfo_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTilesetInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TMXTilesetInfo();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TMXTilesetInfo\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TMXTilesetInfo\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TMXTilesetInfo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTilesetInfo_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TMXTilesetInfo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TMXTilesetInfo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TMXTilesetInfo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TMXTilesetInfo\");\n    tolua_cclass(tolua_S,\"TMXTilesetInfo\",\"cc.TMXTilesetInfo\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TMXTilesetInfo\");\n        tolua_function(tolua_S,\"rectForGID\",lua_cocos2dx_TMXTilesetInfo_rectForGID);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TMXTilesetInfo_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TMXTilesetInfo).name();\n    g_luaType[typeName] = \"cc.TMXTilesetInfo\";\n    g_typeCast[\"TMXTilesetInfo\"] = \"cc.TMXTilesetInfo\";\n    return 1;\n}\n\nint lua_cocos2dx_TMXMapInfo_setObjectGroups(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setObjectGroups'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocos2d::TMXObjectGroup *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setObjectGroups(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setObjectGroups\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setObjectGroups'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setTileSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setTileSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTileSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTileSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setTileSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_initWithTMXFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_initWithTMXFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithTMXFile(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTMXFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_initWithTMXFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getOrientation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getOrientation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getOrientation();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOrientation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getOrientation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_isStoringCharacters(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_isStoringCharacters'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isStoringCharacters();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isStoringCharacters\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_isStoringCharacters'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setLayers(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setLayers'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocos2d::TMXLayerInfo *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setLayers(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLayers\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setLayers'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_parseXMLFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_parseXMLFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->parseXMLFile(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"parseXMLFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_parseXMLFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getParentElement(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getParentElement'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getParentElement();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParentElement\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getParentElement'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setTMXFileName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setTMXFileName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTMXFileName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTMXFileName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setTMXFileName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_parseXMLString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_parseXMLString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->parseXMLString(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"parseXMLString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_parseXMLString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getLayers(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getLayers'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::Vector<cocos2d::TMXLayerInfo *>& ret = cobj->getLayers();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::Vector<cocos2d::TMXLayerInfo *>& ret = cobj->getLayers();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayers\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getLayers'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getTilesets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getTilesets'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::Vector<cocos2d::TMXTilesetInfo *>& ret = cobj->getTilesets();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::Vector<cocos2d::TMXTilesetInfo *>& ret = cobj->getTilesets();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTilesets\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getTilesets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getParentGID(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getParentGID'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getParentGID();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParentGID\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getParentGID'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setParentElement(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setParentElement'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setParentElement(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setParentElement\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setParentElement'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_initWithXML(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_initWithXML'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        std::string arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithXML(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithXML\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_initWithXML'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setParentGID(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setParentGID'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setParentGID(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setParentGID\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setParentGID'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getLayerAttribs(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getLayerAttribs'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getLayerAttribs();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayerAttribs\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getLayerAttribs'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getTileSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getTileSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getTileSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTileSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getTileSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getTileProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getTileProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueMapIntKey& ret = cobj->getTileProperties();\n        ccvaluemapintkey_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTileProperties\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getTileProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getObjectGroups(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getObjectGroups'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getObjectGroups\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getObjectGroups'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getTMXFileName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getTMXFileName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getTMXFileName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTMXFileName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getTMXFileName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setCurrentString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setCurrentString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCurrentString(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCurrentString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setCurrentString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMap arg0;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setProperties(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProperties\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setOrientation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setOrientation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setOrientation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOrientation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setOrientation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setTileProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setTileProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMapIntKey arg0;\n\n        ok &= luaval_to_ccvaluemapintkey(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTileProperties(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTileProperties\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setTileProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setMapSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setMapSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setMapSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMapSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setMapSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setStoringCharacters(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setStoringCharacters'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStoringCharacters(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStoringCharacters\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setStoringCharacters'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getMapSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getMapSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getMapSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMapSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getMapSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setTilesets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setTilesets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocos2d::TMXTilesetInfo *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTilesets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTilesets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setTilesets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getProperties'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::ValueMap& ret = cobj->getProperties();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::ValueMap& ret = cobj->getProperties();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperties\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_getCurrentString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getCurrentString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getCurrentString();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentString\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_getCurrentString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_setLayerAttribs(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_setLayerAttribs'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLayerAttribs(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLayerAttribs\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_setLayerAttribs'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXMapInfo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXMapInfo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_createWithXML(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TMXMapInfo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        std::string arg0;\n        std::string arg1;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::TMXMapInfo* ret = cocos2d::TMXMapInfo::createWithXML(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXMapInfo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXMapInfo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithXML\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_createWithXML'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TMXMapInfo_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXMapInfo* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TMXMapInfo();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TMXMapInfo\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TMXMapInfo\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TMXMapInfo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXMapInfo_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TMXMapInfo_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TMXMapInfo)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TMXMapInfo(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TMXMapInfo\");\n    tolua_cclass(tolua_S,\"TMXMapInfo\",\"cc.TMXMapInfo\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TMXMapInfo\");\n        tolua_function(tolua_S,\"setObjectGroups\",lua_cocos2dx_TMXMapInfo_setObjectGroups);\n        tolua_function(tolua_S,\"setTileSize\",lua_cocos2dx_TMXMapInfo_setTileSize);\n        tolua_function(tolua_S,\"initWithTMXFile\",lua_cocos2dx_TMXMapInfo_initWithTMXFile);\n        tolua_function(tolua_S,\"getOrientation\",lua_cocos2dx_TMXMapInfo_getOrientation);\n        tolua_function(tolua_S,\"isStoringCharacters\",lua_cocos2dx_TMXMapInfo_isStoringCharacters);\n        tolua_function(tolua_S,\"setLayers\",lua_cocos2dx_TMXMapInfo_setLayers);\n        tolua_function(tolua_S,\"parseXMLFile\",lua_cocos2dx_TMXMapInfo_parseXMLFile);\n        tolua_function(tolua_S,\"getParentElement\",lua_cocos2dx_TMXMapInfo_getParentElement);\n        tolua_function(tolua_S,\"setTMXFileName\",lua_cocos2dx_TMXMapInfo_setTMXFileName);\n        tolua_function(tolua_S,\"parseXMLString\",lua_cocos2dx_TMXMapInfo_parseXMLString);\n        tolua_function(tolua_S,\"getLayers\",lua_cocos2dx_TMXMapInfo_getLayers);\n        tolua_function(tolua_S,\"getTilesets\",lua_cocos2dx_TMXMapInfo_getTilesets);\n        tolua_function(tolua_S,\"getParentGID\",lua_cocos2dx_TMXMapInfo_getParentGID);\n        tolua_function(tolua_S,\"setParentElement\",lua_cocos2dx_TMXMapInfo_setParentElement);\n        tolua_function(tolua_S,\"initWithXML\",lua_cocos2dx_TMXMapInfo_initWithXML);\n        tolua_function(tolua_S,\"setParentGID\",lua_cocos2dx_TMXMapInfo_setParentGID);\n        tolua_function(tolua_S,\"getLayerAttribs\",lua_cocos2dx_TMXMapInfo_getLayerAttribs);\n        tolua_function(tolua_S,\"getTileSize\",lua_cocos2dx_TMXMapInfo_getTileSize);\n        tolua_function(tolua_S,\"getTileProperties\",lua_cocos2dx_TMXMapInfo_getTileProperties);\n        tolua_function(tolua_S,\"getObjectGroups\",lua_cocos2dx_TMXMapInfo_getObjectGroups);\n        tolua_function(tolua_S,\"getTMXFileName\",lua_cocos2dx_TMXMapInfo_getTMXFileName);\n        tolua_function(tolua_S,\"setCurrentString\",lua_cocos2dx_TMXMapInfo_setCurrentString);\n        tolua_function(tolua_S,\"setProperties\",lua_cocos2dx_TMXMapInfo_setProperties);\n        tolua_function(tolua_S,\"setOrientation\",lua_cocos2dx_TMXMapInfo_setOrientation);\n        tolua_function(tolua_S,\"setTileProperties\",lua_cocos2dx_TMXMapInfo_setTileProperties);\n        tolua_function(tolua_S,\"setMapSize\",lua_cocos2dx_TMXMapInfo_setMapSize);\n        tolua_function(tolua_S,\"setStoringCharacters\",lua_cocos2dx_TMXMapInfo_setStoringCharacters);\n        tolua_function(tolua_S,\"getMapSize\",lua_cocos2dx_TMXMapInfo_getMapSize);\n        tolua_function(tolua_S,\"setTilesets\",lua_cocos2dx_TMXMapInfo_setTilesets);\n        tolua_function(tolua_S,\"getProperties\",lua_cocos2dx_TMXMapInfo_getProperties);\n        tolua_function(tolua_S,\"getCurrentString\",lua_cocos2dx_TMXMapInfo_getCurrentString);\n        tolua_function(tolua_S,\"setLayerAttribs\",lua_cocos2dx_TMXMapInfo_setLayerAttribs);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TMXMapInfo_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TMXMapInfo_create);\n        tolua_function(tolua_S,\"createWithXML\", lua_cocos2dx_TMXMapInfo_createWithXML);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TMXMapInfo).name();\n    g_luaType[typeName] = \"cc.TMXMapInfo\";\n    g_typeCast[\"TMXMapInfo\"] = \"cc.TMXMapInfo\";\n    return 1;\n}\n\nint lua_cocos2dx_TMXLayer_getTileGIDAt(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getTileGIDAt'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        int ret = cobj->getTileGIDAt(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        cocos2d::Point arg0;\n        cocos2d::ccTMXTileFlags_* arg1;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR ccTMXTileFlags_*;\n        if(!ok)\n            return 0;\n        int ret = cobj->getTileGIDAt(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTileGIDAt\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getTileGIDAt'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getPositionAt(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getPositionAt'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPositionAt(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPositionAt\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getPositionAt'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setLayerOrientation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setLayerOrientation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLayerOrientation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLayerOrientation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setLayerOrientation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_releaseMap(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_releaseMap'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->releaseMap();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"releaseMap\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_releaseMap'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setTiles(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setTiles'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int* arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR int*;\n        if(!ok)\n            return 0;\n        cobj->setTiles(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTiles\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setTiles'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getLayerSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getLayerSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getLayerSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayerSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getLayerSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setMapTileSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setMapTileSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setMapTileSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMapTileSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setMapTileSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getLayerOrientation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getLayerOrientation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getLayerOrientation();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayerOrientation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getLayerOrientation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMap arg0;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setProperties(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProperties\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setLayerName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setLayerName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLayerName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLayerName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setLayerName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_removeTileAt(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_removeTileAt'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->removeTileAt(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeTileAt\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_removeTileAt'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_initWithTilesetInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_initWithTilesetInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::TMXTilesetInfo* arg0;\n        cocos2d::TMXLayerInfo* arg1;\n        cocos2d::TMXMapInfo* arg2;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.TMXTilesetInfo\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::TMXTilesetInfo*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.TMXLayerInfo\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::TMXLayerInfo*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.TMXMapInfo\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithTilesetInfo(arg0, arg1, arg2);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTilesetInfo\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_initWithTilesetInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setupTiles(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setupTiles'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setupTiles();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setupTiles\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setupTiles'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setTileGID(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setTileGID'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 3) {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Point arg1;\n            ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cocos2d::ccTMXTileFlags_ arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            cobj->setTileGID(arg0, arg1, arg2);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            cocos2d::Point arg1;\n            ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cobj->setTileGID(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTileGID\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setTileGID'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getMapTileSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getMapTileSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getMapTileSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMapTileSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getMapTileSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getProperty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getProperty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Value ret = cobj->getProperty(arg0);\n        ccvalue_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperty\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getProperty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setLayerSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setLayerSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setLayerSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLayerSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setLayerSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getLayerName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getLayerName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getLayerName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayerName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getLayerName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_setTileSet(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setTileSet'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TMXTilesetInfo* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.TMXTilesetInfo\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::TMXTilesetInfo*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTileSet(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTileSet\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_setTileSet'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getTileSet(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getTileSet'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::TMXTilesetInfo* ret = cobj->getTileSet();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXTilesetInfo\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXTilesetInfo*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTileSet\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getTileSet'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getProperties'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::ValueMap& ret = cobj->getProperties();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::ValueMap& ret = cobj->getProperties();\n            ccvaluemap_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperties\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_getTileAt(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getTileAt'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getTileAt(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTileAt\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_getTileAt'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TMXLayer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        cocos2d::TMXTilesetInfo* arg0;\n        cocos2d::TMXLayerInfo* arg1;\n        cocos2d::TMXMapInfo* arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.TMXTilesetInfo\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::TMXTilesetInfo*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.TMXLayerInfo\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::TMXLayerInfo*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.TMXMapInfo\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::TMXLayer* ret = cocos2d::TMXLayer::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXLayer\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXLayer*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TMXLayer_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXLayer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TMXLayer();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TMXLayer\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TMXLayer\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TMXLayer\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXLayer_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TMXLayer_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TMXLayer)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TMXLayer(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TMXLayer\");\n    tolua_cclass(tolua_S,\"TMXLayer\",\"cc.TMXLayer\",\"cc.SpriteBatchNode\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TMXLayer\");\n        tolua_function(tolua_S,\"getTileGIDAt\",lua_cocos2dx_TMXLayer_getTileGIDAt);\n        tolua_function(tolua_S,\"getPositionAt\",lua_cocos2dx_TMXLayer_getPositionAt);\n        tolua_function(tolua_S,\"setLayerOrientation\",lua_cocos2dx_TMXLayer_setLayerOrientation);\n        tolua_function(tolua_S,\"releaseMap\",lua_cocos2dx_TMXLayer_releaseMap);\n        tolua_function(tolua_S,\"setTiles\",lua_cocos2dx_TMXLayer_setTiles);\n        tolua_function(tolua_S,\"getLayerSize\",lua_cocos2dx_TMXLayer_getLayerSize);\n        tolua_function(tolua_S,\"setMapTileSize\",lua_cocos2dx_TMXLayer_setMapTileSize);\n        tolua_function(tolua_S,\"getLayerOrientation\",lua_cocos2dx_TMXLayer_getLayerOrientation);\n        tolua_function(tolua_S,\"setProperties\",lua_cocos2dx_TMXLayer_setProperties);\n        tolua_function(tolua_S,\"setLayerName\",lua_cocos2dx_TMXLayer_setLayerName);\n        tolua_function(tolua_S,\"removeTileAt\",lua_cocos2dx_TMXLayer_removeTileAt);\n        tolua_function(tolua_S,\"initWithTilesetInfo\",lua_cocos2dx_TMXLayer_initWithTilesetInfo);\n        tolua_function(tolua_S,\"setupTiles\",lua_cocos2dx_TMXLayer_setupTiles);\n        tolua_function(tolua_S,\"setTileGID\",lua_cocos2dx_TMXLayer_setTileGID);\n        tolua_function(tolua_S,\"getMapTileSize\",lua_cocos2dx_TMXLayer_getMapTileSize);\n        tolua_function(tolua_S,\"getProperty\",lua_cocos2dx_TMXLayer_getProperty);\n        tolua_function(tolua_S,\"setLayerSize\",lua_cocos2dx_TMXLayer_setLayerSize);\n        tolua_function(tolua_S,\"getLayerName\",lua_cocos2dx_TMXLayer_getLayerName);\n        tolua_function(tolua_S,\"setTileSet\",lua_cocos2dx_TMXLayer_setTileSet);\n        tolua_function(tolua_S,\"getTileSet\",lua_cocos2dx_TMXLayer_getTileSet);\n        tolua_function(tolua_S,\"getProperties\",lua_cocos2dx_TMXLayer_getProperties);\n        tolua_function(tolua_S,\"getTileAt\",lua_cocos2dx_TMXLayer_getTileAt);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TMXLayer_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TMXLayer_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TMXLayer).name();\n    g_luaType[typeName] = \"cc.TMXLayer\";\n    g_typeCast[\"TMXLayer\"] = \"cc.TMXLayer\";\n    return 1;\n}\n\nint lua_cocos2dx_TMXTiledMap_setObjectGroups(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_setObjectGroups'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocos2d::TMXObjectGroup *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setObjectGroups(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setObjectGroups\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_setObjectGroups'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getProperty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getProperty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Value ret = cobj->getProperty(arg0);\n        ccvalue_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperty\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getProperty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_setMapSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_setMapSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setMapSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMapSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_setMapSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getObjectGroup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getObjectGroup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::TMXObjectGroup* ret = cobj->getObjectGroup(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXObjectGroup\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXObjectGroup*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getObjectGroup\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getObjectGroup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getObjectGroups(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getObjectGroups'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const cocos2d::Vector<cocos2d::TMXObjectGroup *>& ret = cobj->getObjectGroups();\n            ccvector_to_luaval(tolua_S, ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getObjectGroups\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getObjectGroups'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getTileSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getTileSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getTileSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTileSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getTileSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getMapSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getMapSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getMapSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMapSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getMapSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueMap& ret = cobj->getProperties();\n        ccvaluemap_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProperties\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getPropertiesForGID(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getPropertiesForGID'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Value ret = cobj->getPropertiesForGID(arg0);\n        ccvalue_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPropertiesForGID\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getPropertiesForGID'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_setTileSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_setTileSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTileSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTileSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_setTileSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_setProperties(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_setProperties'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ValueMap arg0;\n\n        ok &= luaval_to_ccvaluemap(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setProperties(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProperties\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_setProperties'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getLayer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getLayer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::TMXLayer* ret = cobj->getLayer(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXLayer\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXLayer*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getLayer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_getMapOrientation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_getMapOrientation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getMapOrientation();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMapOrientation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_getMapOrientation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_setMapOrientation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TMXTiledMap* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TMXTiledMap*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TMXTiledMap_setMapOrientation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMapOrientation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMapOrientation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_setMapOrientation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXTiledMap\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXTiledMap*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TMXTiledMap_createWithXML(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TMXTiledMap\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        std::string arg0;\n        std::string arg1;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::TMXTiledMap* ret = cocos2d::TMXTiledMap::createWithXML(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TMXTiledMap\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TMXTiledMap*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithXML\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TMXTiledMap_createWithXML'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_TMXTiledMap_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TMXTiledMap)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TMXTiledMap(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TMXTiledMap\");\n    tolua_cclass(tolua_S,\"TMXTiledMap\",\"cc.TMXTiledMap\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TMXTiledMap\");\n        tolua_function(tolua_S,\"setObjectGroups\",lua_cocos2dx_TMXTiledMap_setObjectGroups);\n        tolua_function(tolua_S,\"getProperty\",lua_cocos2dx_TMXTiledMap_getProperty);\n        tolua_function(tolua_S,\"setMapSize\",lua_cocos2dx_TMXTiledMap_setMapSize);\n        tolua_function(tolua_S,\"getObjectGroup\",lua_cocos2dx_TMXTiledMap_getObjectGroup);\n        tolua_function(tolua_S,\"getObjectGroups\",lua_cocos2dx_TMXTiledMap_getObjectGroups);\n        tolua_function(tolua_S,\"getTileSize\",lua_cocos2dx_TMXTiledMap_getTileSize);\n        tolua_function(tolua_S,\"getMapSize\",lua_cocos2dx_TMXTiledMap_getMapSize);\n        tolua_function(tolua_S,\"getProperties\",lua_cocos2dx_TMXTiledMap_getProperties);\n        tolua_function(tolua_S,\"getPropertiesForGID\",lua_cocos2dx_TMXTiledMap_getPropertiesForGID);\n        tolua_function(tolua_S,\"setTileSize\",lua_cocos2dx_TMXTiledMap_setTileSize);\n        tolua_function(tolua_S,\"setProperties\",lua_cocos2dx_TMXTiledMap_setProperties);\n        tolua_function(tolua_S,\"getLayer\",lua_cocos2dx_TMXTiledMap_getLayer);\n        tolua_function(tolua_S,\"getMapOrientation\",lua_cocos2dx_TMXTiledMap_getMapOrientation);\n        tolua_function(tolua_S,\"setMapOrientation\",lua_cocos2dx_TMXTiledMap_setMapOrientation);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TMXTiledMap_create);\n        tolua_function(tolua_S,\"createWithXML\", lua_cocos2dx_TMXTiledMap_createWithXML);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TMXTiledMap).name();\n    g_luaType[typeName] = \"cc.TMXTiledMap\";\n    g_typeCast[\"TMXTiledMap\"] = \"cc.TMXTiledMap\";\n    return 1;\n}\n\nint lua_cocos2dx_TileMapAtlas_initWithTileFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TileMapAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TileMapAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_initWithTileFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        std::string arg0;\n        std::string arg1;\n        int arg2;\n        int arg3;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithTileFile(arg0, arg1, arg2, arg3);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTileFile\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_initWithTileFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TileMapAtlas_releaseMap(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TileMapAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TileMapAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_releaseMap'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->releaseMap();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"releaseMap\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_releaseMap'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TileMapAtlas_getTGAInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TileMapAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TileMapAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_getTGAInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::sImageTGA* ret = cobj->getTGAInfo();\n        #pragma warning NO CONVERSION FROM NATIVE FOR sImageTGA*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTGAInfo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_getTGAInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TileMapAtlas_getTileAt(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TileMapAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TileMapAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_getTileAt'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Color3B ret = cobj->getTileAt(arg0);\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTileAt\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_getTileAt'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TileMapAtlas_setTile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TileMapAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TileMapAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_setTile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Color3B arg0;\n        cocos2d::Point arg1;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->setTile(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_setTile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TileMapAtlas_setTGAInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TileMapAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TileMapAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::TileMapAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_TileMapAtlas_setTGAInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::sImageTGA* arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR sImageTGA*;\n        if(!ok)\n            return 0;\n        cobj->setTGAInfo(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTGAInfo\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_setTGAInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_TileMapAtlas_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TileMapAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        std::string arg0;\n        std::string arg1;\n        int arg2;\n        int arg3;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::TileMapAtlas* ret = cocos2d::TileMapAtlas::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TileMapAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::TileMapAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_TileMapAtlas_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::TileMapAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::TileMapAtlas();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TileMapAtlas\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TileMapAtlas\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TileMapAtlas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_TileMapAtlas_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_TileMapAtlas_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TileMapAtlas)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_TileMapAtlas(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TileMapAtlas\");\n    tolua_cclass(tolua_S,\"TileMapAtlas\",\"cc.TileMapAtlas\",\"cc.AtlasNode\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TileMapAtlas\");\n        tolua_function(tolua_S,\"initWithTileFile\",lua_cocos2dx_TileMapAtlas_initWithTileFile);\n        tolua_function(tolua_S,\"releaseMap\",lua_cocos2dx_TileMapAtlas_releaseMap);\n        tolua_function(tolua_S,\"getTGAInfo\",lua_cocos2dx_TileMapAtlas_getTGAInfo);\n        tolua_function(tolua_S,\"getTileAt\",lua_cocos2dx_TileMapAtlas_getTileAt);\n        tolua_function(tolua_S,\"setTile\",lua_cocos2dx_TileMapAtlas_setTile);\n        tolua_function(tolua_S,\"setTGAInfo\",lua_cocos2dx_TileMapAtlas_setTGAInfo);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_TileMapAtlas_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_TileMapAtlas_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::TileMapAtlas).name();\n    g_luaType[typeName] = \"cc.TileMapAtlas\";\n    g_typeCast[\"TileMapAtlas\"] = \"cc.TileMapAtlas\";\n    return 1;\n}\n\nint lua_cocos2dx_EventListenerTouchOneByOne_setSwallowTouches(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventListenerTouchOneByOne* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventListenerTouchOneByOne\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventListenerTouchOneByOne*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventListenerTouchOneByOne_setSwallowTouches'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSwallowTouches(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSwallowTouches\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventListenerTouchOneByOne_setSwallowTouches'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_EventListenerTouchOneByOne_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerTouchOneByOne)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventListenerTouchOneByOne(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerTouchOneByOne\");\n    tolua_cclass(tolua_S,\"EventListenerTouchOneByOne\",\"cc.EventListenerTouchOneByOne\",\"cc.EventListener\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerTouchOneByOne\");\n        tolua_function(tolua_S,\"setSwallowTouches\",lua_cocos2dx_EventListenerTouchOneByOne_setSwallowTouches);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerTouchOneByOne).name();\n    g_luaType[typeName] = \"cc.EventListenerTouchOneByOne\";\n    g_typeCast[\"EventListenerTouchOneByOne\"] = \"cc.EventListenerTouchOneByOne\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_EventListenerTouchAllAtOnce_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerTouchAllAtOnce)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventListenerTouchAllAtOnce(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerTouchAllAtOnce\");\n    tolua_cclass(tolua_S,\"EventListenerTouchAllAtOnce\",\"cc.EventListenerTouchAllAtOnce\",\"cc.EventListener\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerTouchAllAtOnce\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerTouchAllAtOnce).name();\n    g_luaType[typeName] = \"cc.EventListenerTouchAllAtOnce\";\n    g_typeCast[\"EventListenerTouchAllAtOnce\"] = \"cc.EventListenerTouchAllAtOnce\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_EventListenerKeyboard_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerKeyboard)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventListenerKeyboard(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerKeyboard\");\n    tolua_cclass(tolua_S,\"EventListenerKeyboard\",\"cc.EventListenerKeyboard\",\"cc.EventListener\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerKeyboard\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerKeyboard).name();\n    g_luaType[typeName] = \"cc.EventListenerKeyboard\";\n    g_typeCast[\"EventListenerKeyboard\"] = \"cc.EventListenerKeyboard\";\n    return 1;\n}\n\nint lua_cocos2dx_EventMouse_getMouseButton(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getMouseButton'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getMouseButton();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMouseButton\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_getMouseButton'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_setScrollData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_setScrollData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        double arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setScrollData(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScrollData\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_setScrollData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_setMouseButton(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_setMouseButton'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMouseButton(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMouseButton\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_setMouseButton'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_getScrollY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getScrollY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScrollY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScrollY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_getScrollY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_getScrollX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getScrollX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScrollX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScrollX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_getScrollX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_getCursorX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getCursorX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getCursorX();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCursorX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_getCursorX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_getCursorY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getCursorY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getCursorY();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCursorY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_getCursorY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_setCursorPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventMouse\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_setCursorPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        double arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setCursorPosition(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCursorPosition\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_setCursorPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventMouse_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventMouse* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::EventMouse::MouseEventType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::EventMouse(arg0);\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.EventMouse\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.EventMouse\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"EventMouse\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventMouse_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_EventMouse_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventMouse)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventMouse(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventMouse\");\n    tolua_cclass(tolua_S,\"EventMouse\",\"cc.EventMouse\",\"cc.Event\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventMouse\");\n        tolua_function(tolua_S,\"getMouseButton\",lua_cocos2dx_EventMouse_getMouseButton);\n        tolua_function(tolua_S,\"setScrollData\",lua_cocos2dx_EventMouse_setScrollData);\n        tolua_function(tolua_S,\"setMouseButton\",lua_cocos2dx_EventMouse_setMouseButton);\n        tolua_function(tolua_S,\"getScrollY\",lua_cocos2dx_EventMouse_getScrollY);\n        tolua_function(tolua_S,\"getScrollX\",lua_cocos2dx_EventMouse_getScrollX);\n        tolua_function(tolua_S,\"getCursorX\",lua_cocos2dx_EventMouse_getCursorX);\n        tolua_function(tolua_S,\"getCursorY\",lua_cocos2dx_EventMouse_getCursorY);\n        tolua_function(tolua_S,\"setCursorPosition\",lua_cocos2dx_EventMouse_setCursorPosition);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_EventMouse_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventMouse).name();\n    g_luaType[typeName] = \"cc.EventMouse\";\n    g_typeCast[\"EventMouse\"] = \"cc.EventMouse\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_EventListenerMouse_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerMouse)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventListenerMouse(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerMouse\");\n    tolua_cclass(tolua_S,\"EventListenerMouse\",\"cc.EventListenerMouse\",\"cc.EventListener\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerMouse\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerMouse).name();\n    g_luaType[typeName] = \"cc.EventListenerMouse\";\n    g_typeCast[\"EventListenerMouse\"] = \"cc.EventListenerMouse\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_EventAcceleration_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventAcceleration)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventAcceleration(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventAcceleration\");\n    tolua_cclass(tolua_S,\"EventAcceleration\",\"cc.EventAcceleration\",\"cc.Event\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventAcceleration\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventAcceleration).name();\n    g_luaType[typeName] = \"cc.EventAcceleration\";\n    g_typeCast[\"EventAcceleration\"] = \"cc.EventAcceleration\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_EventListenerAcceleration_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerAcceleration)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventListenerAcceleration(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerAcceleration\");\n    tolua_cclass(tolua_S,\"EventListenerAcceleration\",\"cc.EventListenerAcceleration\",\"cc.EventListener\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerAcceleration\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerAcceleration).name();\n    g_luaType[typeName] = \"cc.EventListenerAcceleration\";\n    g_typeCast[\"EventListenerAcceleration\"] = \"cc.EventListenerAcceleration\";\n    return 1;\n}\n\nint lua_cocos2dx_EventCustom_getEventName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventCustom* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventCustom\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventCustom*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventCustom_getEventName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getEventName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEventName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventCustom_getEventName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventCustom_setUserData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventCustom* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventCustom\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventCustom*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventCustom_setUserData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        void* arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR void*;\n        if(!ok)\n            return 0;\n        cobj->setUserData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUserData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventCustom_setUserData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventCustom_getUserData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventCustom* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventCustom\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventCustom*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_EventCustom_getUserData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        void* ret = cobj->getUserData();\n        #pragma warning NO CONVERSION FROM NATIVE FOR void*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getUserData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventCustom_getUserData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_EventCustom_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventCustom* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::EventCustom(arg0);\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.EventCustom\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.EventCustom\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"EventCustom\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_EventCustom_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_EventCustom_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventCustom)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_EventCustom(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventCustom\");\n    tolua_cclass(tolua_S,\"EventCustom\",\"cc.EventCustom\",\"cc.Event\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventCustom\");\n        tolua_function(tolua_S,\"getEventName\",lua_cocos2dx_EventCustom_getEventName);\n        tolua_function(tolua_S,\"setUserData\",lua_cocos2dx_EventCustom_setUserData);\n        tolua_function(tolua_S,\"getUserData\",lua_cocos2dx_EventCustom_getUserData);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_EventCustom_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventCustom).name();\n    g_luaType[typeName] = \"cc.EventCustom\";\n    g_typeCast[\"EventCustom\"] = \"cc.EventCustom\";\n    return 1;\n}\n\nint lua_cocos2dx_Timer_getInterval(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Timer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Timer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Timer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Timer_getInterval'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getInterval();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInterval\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Timer_getInterval'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Timer_setInterval(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Timer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Timer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Timer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Timer_setInterval'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInterval(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInterval\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Timer_setInterval'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Timer_initWithScriptHandler(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Timer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Timer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Timer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Timer_initWithScriptHandler'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        double arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithScriptHandler(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithScriptHandler\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Timer_initWithScriptHandler'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Timer_update(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Timer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Timer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Timer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Timer_update'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->update(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"update\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Timer_update'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Timer_getScriptHandler(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Timer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Timer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Timer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Timer_getScriptHandler'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getScriptHandler();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScriptHandler\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Timer_getScriptHandler'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Timer_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Timer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Timer();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Timer\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Timer\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Timer\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Timer_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Timer_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Timer)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Timer(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Timer\");\n    tolua_cclass(tolua_S,\"Timer\",\"cc.Timer\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Timer\");\n        tolua_function(tolua_S,\"getInterval\",lua_cocos2dx_Timer_getInterval);\n        tolua_function(tolua_S,\"setInterval\",lua_cocos2dx_Timer_setInterval);\n        tolua_function(tolua_S,\"initWithScriptHandler\",lua_cocos2dx_Timer_initWithScriptHandler);\n        tolua_function(tolua_S,\"update\",lua_cocos2dx_Timer_update);\n        tolua_function(tolua_S,\"getScriptHandler\",lua_cocos2dx_Timer_getScriptHandler);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Timer_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Timer).name();\n    g_luaType[typeName] = \"cc.Timer\";\n    g_typeCast[\"Timer\"] = \"cc.Timer\";\n    return 1;\n}\n\nint lua_cocos2dx_Scheduler_setTimeScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Scheduler* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scheduler\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Scheduler*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Scheduler_setTimeScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTimeScale(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTimeScale\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Scheduler_setTimeScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Scheduler_performFunctionInCocosThread(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Scheduler* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scheduler\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Scheduler*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Scheduler_performFunctionInCocosThread'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::function<void ()> arg0;\n\n        do {\n\t\t\t// Lambda binding for lua is not supported.\n\t\t\tassert(false);\n\t\t} while(0)\n\t\t;\n        if(!ok)\n            return 0;\n        cobj->performFunctionInCocosThread(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"performFunctionInCocosThread\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Scheduler_performFunctionInCocosThread'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Scheduler_getTimeScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Scheduler* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scheduler\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Scheduler*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Scheduler_getTimeScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getTimeScale();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTimeScale\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Scheduler_getTimeScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Scheduler_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Scheduler* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::Scheduler();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Scheduler\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Scheduler\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Scheduler\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Scheduler_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_Scheduler_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Scheduler)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Scheduler(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Scheduler\");\n    tolua_cclass(tolua_S,\"Scheduler\",\"cc.Scheduler\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Scheduler\");\n        tolua_function(tolua_S,\"setTimeScale\",lua_cocos2dx_Scheduler_setTimeScale);\n        tolua_function(tolua_S,\"performFunctionInCocosThread\",lua_cocos2dx_Scheduler_performFunctionInCocosThread);\n        tolua_function(tolua_S,\"getTimeScale\",lua_cocos2dx_Scheduler_getTimeScale);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_Scheduler_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Scheduler).name();\n    g_luaType[typeName] = \"cc.Scheduler\";\n    g_typeCast[\"Scheduler\"] = \"cc.Scheduler\";\n    return 1;\n}\n\nint lua_cocos2dx_Component_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_setName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_setName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_setName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_serialize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_serialize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        void* arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR void*;\n        if(!ok)\n            return 0;\n        bool ret = cobj->serialize(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"serialize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_serialize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_update(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_update'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->update(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"update\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_update'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_getOwner(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_getOwner'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getOwner();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOwner\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_getOwner'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_setOwner(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_setOwner'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setOwner(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOwner\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_setOwner'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_getName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Component* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::Component*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Component_getName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_getName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_Component_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Component\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Component* ret = cocos2d::Component::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Component\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Component*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Component_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_Component_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Component)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_Component(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Component\");\n    tolua_cclass(tolua_S,\"Component\",\"cc.Component\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Component\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_Component_setEnabled);\n        tolua_function(tolua_S,\"setName\",lua_cocos2dx_Component_setName);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_Component_isEnabled);\n        tolua_function(tolua_S,\"serialize\",lua_cocos2dx_Component_serialize);\n        tolua_function(tolua_S,\"update\",lua_cocos2dx_Component_update);\n        tolua_function(tolua_S,\"getOwner\",lua_cocos2dx_Component_getOwner);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_Component_init);\n        tolua_function(tolua_S,\"setOwner\",lua_cocos2dx_Component_setOwner);\n        tolua_function(tolua_S,\"getName\",lua_cocos2dx_Component_getName);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_Component_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::Component).name();\n    g_luaType[typeName] = \"cc.Component\";\n    g_typeCast[\"Component\"] = \"cc.Component\";\n    return 1;\n}\n\nint lua_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->preloadBackgroundMusic(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"preloadBackgroundMusic\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_stopBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_stopBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopBackgroundMusic();\n        return 0;\n    }\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->stopBackgroundMusic(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_stopBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_stopAllEffects(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_stopAllEffects'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopAllEffects();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopAllEffects\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_stopAllEffects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getBackgroundMusicVolume();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackgroundMusicVolume\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resumeBackgroundMusic();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBackgroundMusicVolume(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackgroundMusicVolume\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_preloadEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_preloadEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->preloadEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"preloadEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_preloadEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBackgroundMusicPlaying();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBackgroundMusicPlaying\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_getEffectsVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_getEffectsVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEffectsVolume();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEffectsVolume\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_getEffectsVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->willPlayBackgroundMusic();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"willPlayBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_pauseEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_pauseEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->pauseEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_pauseEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_playEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_playEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->playEffect(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        bool arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->playEffect(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 3) \n    {\n        const char* arg0;\n        bool arg1;\n        double arg2;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->playEffect(arg0, arg1, arg2);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 4) \n    {\n        const char* arg0;\n        bool arg1;\n        double arg2;\n        double arg3;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->playEffect(arg0, arg1, arg2, arg3);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 5) \n    {\n        const char* arg0;\n        bool arg1;\n        double arg2;\n        double arg3;\n        double arg4;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n\n        ok &= luaval_to_number(tolua_S, 6,&arg4);\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->playEffect(arg0, arg1, arg2, arg3, arg4);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_playEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->rewindBackgroundMusic();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"rewindBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_playBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_playBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->playBackgroundMusic(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        bool arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->playBackgroundMusic(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playBackgroundMusic\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_playBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_resumeAllEffects(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_resumeAllEffects'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resumeAllEffects();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeAllEffects\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_resumeAllEffects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_setEffectsVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_setEffectsVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEffectsVolume(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEffectsVolume\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_setEffectsVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_stopEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_stopEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->stopEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_stopEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pauseBackgroundMusic();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_pauseAllEffects(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_pauseAllEffects'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pauseAllEffects();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseAllEffects\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_pauseAllEffects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_unloadEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_unloadEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->unloadEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"unloadEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_unloadEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_resumeEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    CocosDenshion::SimpleAudioEngine* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (CocosDenshion::SimpleAudioEngine*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_SimpleAudioEngine_resumeEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->resumeEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_resumeEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_end(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        CocosDenshion::SimpleAudioEngine::end();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"end\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_end'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_SimpleAudioEngine_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.SimpleAudioEngine\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        CocosDenshion::SimpleAudioEngine* ret = CocosDenshion::SimpleAudioEngine::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.SimpleAudioEngine\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((CocosDenshion::SimpleAudioEngine*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SimpleAudioEngine_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_SimpleAudioEngine_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SimpleAudioEngine)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_SimpleAudioEngine(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.SimpleAudioEngine\");\n    tolua_cclass(tolua_S,\"SimpleAudioEngine\",\"cc.SimpleAudioEngine\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SimpleAudioEngine\");\n        tolua_function(tolua_S,\"preloadMusic\",lua_cocos2dx_SimpleAudioEngine_preloadBackgroundMusic);\n        tolua_function(tolua_S,\"stopMusic\",lua_cocos2dx_SimpleAudioEngine_stopBackgroundMusic);\n        tolua_function(tolua_S,\"stopAllEffects\",lua_cocos2dx_SimpleAudioEngine_stopAllEffects);\n        tolua_function(tolua_S,\"getMusicVolume\",lua_cocos2dx_SimpleAudioEngine_getBackgroundMusicVolume);\n        tolua_function(tolua_S,\"resumeMusic\",lua_cocos2dx_SimpleAudioEngine_resumeBackgroundMusic);\n        tolua_function(tolua_S,\"setMusicVolume\",lua_cocos2dx_SimpleAudioEngine_setBackgroundMusicVolume);\n        tolua_function(tolua_S,\"preloadEffect\",lua_cocos2dx_SimpleAudioEngine_preloadEffect);\n        tolua_function(tolua_S,\"isMusicPlaying\",lua_cocos2dx_SimpleAudioEngine_isBackgroundMusicPlaying);\n        tolua_function(tolua_S,\"getEffectsVolume\",lua_cocos2dx_SimpleAudioEngine_getEffectsVolume);\n        tolua_function(tolua_S,\"willPlayMusic\",lua_cocos2dx_SimpleAudioEngine_willPlayBackgroundMusic);\n        tolua_function(tolua_S,\"pauseEffect\",lua_cocos2dx_SimpleAudioEngine_pauseEffect);\n        tolua_function(tolua_S,\"playEffect\",lua_cocos2dx_SimpleAudioEngine_playEffect);\n        tolua_function(tolua_S,\"rewindMusic\",lua_cocos2dx_SimpleAudioEngine_rewindBackgroundMusic);\n        tolua_function(tolua_S,\"playMusic\",lua_cocos2dx_SimpleAudioEngine_playBackgroundMusic);\n        tolua_function(tolua_S,\"resumeAllEffects\",lua_cocos2dx_SimpleAudioEngine_resumeAllEffects);\n        tolua_function(tolua_S,\"setEffectsVolume\",lua_cocos2dx_SimpleAudioEngine_setEffectsVolume);\n        tolua_function(tolua_S,\"stopEffect\",lua_cocos2dx_SimpleAudioEngine_stopEffect);\n        tolua_function(tolua_S,\"pauseMusic\",lua_cocos2dx_SimpleAudioEngine_pauseBackgroundMusic);\n        tolua_function(tolua_S,\"pauseAllEffects\",lua_cocos2dx_SimpleAudioEngine_pauseAllEffects);\n        tolua_function(tolua_S,\"unloadEffect\",lua_cocos2dx_SimpleAudioEngine_unloadEffect);\n        tolua_function(tolua_S,\"resumeEffect\",lua_cocos2dx_SimpleAudioEngine_resumeEffect);\n        tolua_function(tolua_S,\"end\", lua_cocos2dx_SimpleAudioEngine_end);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_SimpleAudioEngine_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(CocosDenshion::SimpleAudioEngine).name();\n    g_luaType[typeName] = \"cc.SimpleAudioEngine\";\n    g_typeCast[\"SimpleAudioEngine\"] = \"cc.SimpleAudioEngine\";\n    return 1;\n}\nTOLUA_API int register_all_cocos2dx(lua_State* tolua_S)\n{\n\ttolua_open(tolua_S);\n\t\n\ttolua_module(tolua_S,\"cc\",0);\n\ttolua_beginmodule(tolua_S,\"cc\");\n\n\tlua_register_cocos2dx_Object(tolua_S);\n\tlua_register_cocos2dx_Action(tolua_S);\n\tlua_register_cocos2dx_FiniteTimeAction(tolua_S);\n\tlua_register_cocos2dx_ActionInstant(tolua_S);\n\tlua_register_cocos2dx_Hide(tolua_S);\n\tlua_register_cocos2dx_Node(tolua_S);\n\tlua_register_cocos2dx_Scene(tolua_S);\n\tlua_register_cocos2dx_TransitionScene(tolua_S);\n\tlua_register_cocos2dx_TransitionEaseScene(tolua_S);\n\tlua_register_cocos2dx_TransitionMoveInL(tolua_S);\n\tlua_register_cocos2dx_TransitionMoveInB(tolua_S);\n\tlua_register_cocos2dx_AtlasNode(tolua_S);\n\tlua_register_cocos2dx_TileMapAtlas(tolua_S);\n\tlua_register_cocos2dx_TransitionMoveInT(tolua_S);\n\tlua_register_cocos2dx_TMXTilesetInfo(tolua_S);\n\tlua_register_cocos2dx_TransitionMoveInR(tolua_S);\n\tlua_register_cocos2dx_ParticleSystem(tolua_S);\n\tlua_register_cocos2dx_ParticleSystemQuad(tolua_S);\n\tlua_register_cocos2dx_ParticleSnow(tolua_S);\n\tlua_register_cocos2dx_AnimationCache(tolua_S);\n\tlua_register_cocos2dx_ActionInterval(tolua_S);\n\tlua_register_cocos2dx_ActionCamera(tolua_S);\n\tlua_register_cocos2dx_ProgressFromTo(tolua_S);\n\tlua_register_cocos2dx_EventListener(tolua_S);\n\tlua_register_cocos2dx_EventListenerMouse(tolua_S);\n\tlua_register_cocos2dx_MoveBy(tolua_S);\n\tlua_register_cocos2dx_MoveTo(tolua_S);\n\tlua_register_cocos2dx_JumpBy(tolua_S);\n\tlua_register_cocos2dx_EventListenerKeyboard(tolua_S);\n\tlua_register_cocos2dx_TransitionRotoZoom(tolua_S);\n\tlua_register_cocos2dx_Director(tolua_S);\n\tlua_register_cocos2dx_Texture2D(tolua_S);\n\tlua_register_cocos2dx_ActionEase(tolua_S);\n\tlua_register_cocos2dx_EaseElastic(tolua_S);\n\tlua_register_cocos2dx_EaseElasticOut(tolua_S);\n\tlua_register_cocos2dx_EaseBackOut(tolua_S);\n\tlua_register_cocos2dx_TransitionSceneOriented(tolua_S);\n\tlua_register_cocos2dx_TransitionFlipX(tolua_S);\n\tlua_register_cocos2dx_Event(tolua_S);\n\tlua_register_cocos2dx_EventAcceleration(tolua_S);\n\tlua_register_cocos2dx_Spawn(tolua_S);\n\tlua_register_cocos2dx_ParticleBatchNode(tolua_S);\n\tlua_register_cocos2dx_SimpleAudioEngine(tolua_S);\n\tlua_register_cocos2dx_SkewTo(tolua_S);\n\tlua_register_cocos2dx_SkewBy(tolua_S);\n\tlua_register_cocos2dx_TransitionProgress(tolua_S);\n\tlua_register_cocos2dx_TransitionProgressVertical(tolua_S);\n\tlua_register_cocos2dx_Layer(tolua_S);\n\tlua_register_cocos2dx_TMXTiledMap(tolua_S);\n\tlua_register_cocos2dx_GridAction(tolua_S);\n\tlua_register_cocos2dx_Grid3DAction(tolua_S);\n\tlua_register_cocos2dx_FadeIn(tolua_S);\n\tlua_register_cocos2dx_EventListenerCustom(tolua_S);\n\tlua_register_cocos2dx_FlipX3D(tolua_S);\n\tlua_register_cocos2dx_FlipY3D(tolua_S);\n\tlua_register_cocos2dx_EaseSineInOut(tolua_S);\n\tlua_register_cocos2dx_TransitionFlipAngular(tolua_S);\n\tlua_register_cocos2dx_EGLViewProtocol(tolua_S);\n\tlua_register_cocos2dx_EGLView(tolua_S);\n\tlua_register_cocos2dx_EaseElasticInOut(tolua_S);\n\tlua_register_cocos2dx_EaseBounce(tolua_S);\n\tlua_register_cocos2dx_Show(tolua_S);\n\tlua_register_cocos2dx_FadeOut(tolua_S);\n\tlua_register_cocos2dx_CallFunc(tolua_S);\n\tlua_register_cocos2dx_EventMouse(tolua_S);\n\tlua_register_cocos2dx_Waves3D(tolua_S);\n\tlua_register_cocos2dx_ParticleFireworks(tolua_S);\n\tlua_register_cocos2dx_MenuItem(tolua_S);\n\tlua_register_cocos2dx_MenuItemSprite(tolua_S);\n\tlua_register_cocos2dx_MenuItemImage(tolua_S);\n\tlua_register_cocos2dx_ParticleFire(tolua_S);\n\tlua_register_cocos2dx_TransitionZoomFlipAngular(tolua_S);\n\tlua_register_cocos2dx_EaseRateAction(tolua_S);\n\tlua_register_cocos2dx_EaseIn(tolua_S);\n\tlua_register_cocos2dx_EaseExponentialInOut(tolua_S);\n\tlua_register_cocos2dx_EaseBackInOut(tolua_S);\n\tlua_register_cocos2dx_EaseExponentialOut(tolua_S);\n\tlua_register_cocos2dx_SpriteBatchNode(tolua_S);\n\tlua_register_cocos2dx_Label(tolua_S);\n\tlua_register_cocos2dx_Application(tolua_S);\n\tlua_register_cocos2dx_DelayTime(tolua_S);\n\tlua_register_cocos2dx_LabelAtlas(tolua_S);\n\tlua_register_cocos2dx_LabelBMFont(tolua_S);\n\tlua_register_cocos2dx_TransitionFadeTR(tolua_S);\n\tlua_register_cocos2dx_TransitionFadeBL(tolua_S);\n\tlua_register_cocos2dx_EaseElasticIn(tolua_S);\n\tlua_register_cocos2dx_ParticleSpiral(tolua_S);\n\tlua_register_cocos2dx_TiledGrid3DAction(tolua_S);\n\tlua_register_cocos2dx_FadeOutTRTiles(tolua_S);\n\tlua_register_cocos2dx_FadeOutUpTiles(tolua_S);\n\tlua_register_cocos2dx_FadeOutDownTiles(tolua_S);\n\tlua_register_cocos2dx_TextureCache(tolua_S);\n\tlua_register_cocos2dx_ActionTween(tolua_S);\n\tlua_register_cocos2dx_TransitionFadeDown(tolua_S);\n\tlua_register_cocos2dx_ParticleSun(tolua_S);\n\tlua_register_cocos2dx_TransitionProgressHorizontal(tolua_S);\n\tlua_register_cocos2dx_TMXObjectGroup(tolua_S);\n\tlua_register_cocos2dx_TMXLayer(tolua_S);\n\tlua_register_cocos2dx_FlipX(tolua_S);\n\tlua_register_cocos2dx_FlipY(tolua_S);\n\tlua_register_cocos2dx_EventKeyboard(tolua_S);\n\tlua_register_cocos2dx_TransitionSplitCols(tolua_S);\n\tlua_register_cocos2dx_Timer(tolua_S);\n\tlua_register_cocos2dx_FadeTo(tolua_S);\n\tlua_register_cocos2dx_Repeat(tolua_S);\n\tlua_register_cocos2dx_Place(tolua_S);\n\tlua_register_cocos2dx_EventListenerAcceleration(tolua_S);\n\tlua_register_cocos2dx_GLProgram(tolua_S);\n\tlua_register_cocos2dx_EaseBounceOut(tolua_S);\n\tlua_register_cocos2dx_RenderTexture(tolua_S);\n\tlua_register_cocos2dx_TintBy(tolua_S);\n\tlua_register_cocos2dx_TransitionShrinkGrow(tolua_S);\n\tlua_register_cocos2dx_Sprite(tolua_S);\n\tlua_register_cocos2dx_LabelTTF(tolua_S);\n\tlua_register_cocos2dx_ClippingNode(tolua_S);\n\tlua_register_cocos2dx_ParticleFlower(tolua_S);\n\tlua_register_cocos2dx_ParticleSmoke(tolua_S);\n\tlua_register_cocos2dx_Image(tolua_S);\n\tlua_register_cocos2dx_LayerMultiplex(tolua_S);\n\tlua_register_cocos2dx_Blink(tolua_S);\n\tlua_register_cocos2dx_ShaderCache(tolua_S);\n\tlua_register_cocos2dx_JumpTo(tolua_S);\n\tlua_register_cocos2dx_ParticleExplosion(tolua_S);\n\tlua_register_cocos2dx_TransitionJumpZoom(tolua_S);\n\tlua_register_cocos2dx_Touch(tolua_S);\n\tlua_register_cocos2dx_AnimationFrame(tolua_S);\n\tlua_register_cocos2dx_NodeGrid(tolua_S);\n\tlua_register_cocos2dx_TMXLayerInfo(tolua_S);\n\tlua_register_cocos2dx_EaseBounceIn(tolua_S);\n\tlua_register_cocos2dx_GridBase(tolua_S);\n\tlua_register_cocos2dx_TiledGrid3D(tolua_S);\n\tlua_register_cocos2dx_ParticleGalaxy(tolua_S);\n\tlua_register_cocos2dx_Twirl(tolua_S);\n\tlua_register_cocos2dx_MenuItemLabel(tolua_S);\n\tlua_register_cocos2dx_LayerColor(tolua_S);\n\tlua_register_cocos2dx_FadeOutBLTiles(tolua_S);\n\tlua_register_cocos2dx_LayerGradient(tolua_S);\n\tlua_register_cocos2dx_TargetedAction(tolua_S);\n\tlua_register_cocos2dx_RepeatForever(tolua_S);\n\tlua_register_cocos2dx_CardinalSplineTo(tolua_S);\n\tlua_register_cocos2dx_CardinalSplineBy(tolua_S);\n\tlua_register_cocos2dx_TransitionFlipY(tolua_S);\n\tlua_register_cocos2dx_TurnOffTiles(tolua_S);\n\tlua_register_cocos2dx_TintTo(tolua_S);\n\tlua_register_cocos2dx_CatmullRomTo(tolua_S);\n\tlua_register_cocos2dx_ToggleVisibility(tolua_S);\n\tlua_register_cocos2dx_DrawNode(tolua_S);\n\tlua_register_cocos2dx_TransitionTurnOffTiles(tolua_S);\n\tlua_register_cocos2dx_RotateTo(tolua_S);\n\tlua_register_cocos2dx_TransitionSplitRows(tolua_S);\n\tlua_register_cocos2dx_TransitionProgressRadialCCW(tolua_S);\n\tlua_register_cocos2dx_ScaleTo(tolua_S);\n\tlua_register_cocos2dx_TransitionPageTurn(tolua_S);\n\tlua_register_cocos2dx_BezierBy(tolua_S);\n\tlua_register_cocos2dx_BezierTo(tolua_S);\n\tlua_register_cocos2dx_Menu(tolua_S);\n\tlua_register_cocos2dx_SpriteFrame(tolua_S);\n\tlua_register_cocos2dx_ActionManager(tolua_S);\n\tlua_register_cocos2dx_TransitionFade(tolua_S);\n\tlua_register_cocos2dx_TransitionZoomFlipX(tolua_S);\n\tlua_register_cocos2dx_EventListenerTouchAllAtOnce(tolua_S);\n\tlua_register_cocos2dx_SpriteFrameCache(tolua_S);\n\tlua_register_cocos2dx_TransitionCrossFade(tolua_S);\n\tlua_register_cocos2dx_Ripple3D(tolua_S);\n\tlua_register_cocos2dx_Lens3D(tolua_S);\n\tlua_register_cocos2dx_TransitionSlideInL(tolua_S);\n\tlua_register_cocos2dx_TransitionSlideInT(tolua_S);\n\tlua_register_cocos2dx_StopGrid(tolua_S);\n\tlua_register_cocos2dx_ShakyTiles3D(tolua_S);\n\tlua_register_cocos2dx_PageTurn3D(tolua_S);\n\tlua_register_cocos2dx_Grid3D(tolua_S);\n\tlua_register_cocos2dx_TransitionProgressInOut(tolua_S);\n\tlua_register_cocos2dx_EaseBackIn(tolua_S);\n\tlua_register_cocos2dx_SplitRows(tolua_S);\n\tlua_register_cocos2dx_Follow(tolua_S);\n\tlua_register_cocos2dx_Animate(tolua_S);\n\tlua_register_cocos2dx_ShuffleTiles(tolua_S);\n\tlua_register_cocos2dx_ProgressTimer(tolua_S);\n\tlua_register_cocos2dx_ParticleMeteor(tolua_S);\n\tlua_register_cocos2dx_EaseInOut(tolua_S);\n\tlua_register_cocos2dx_TransitionZoomFlipY(tolua_S);\n\tlua_register_cocos2dx_ScaleBy(tolua_S);\n\tlua_register_cocos2dx_EventTouch(tolua_S);\n\tlua_register_cocos2dx_Animation(tolua_S);\n\tlua_register_cocos2dx_TMXMapInfo(tolua_S);\n\tlua_register_cocos2dx_EaseExponentialIn(tolua_S);\n\tlua_register_cocos2dx_ReuseGrid(tolua_S);\n\tlua_register_cocos2dx_EventDispatcher(tolua_S);\n\tlua_register_cocos2dx_MenuItemAtlasFont(tolua_S);\n\tlua_register_cocos2dx_Liquid(tolua_S);\n\tlua_register_cocos2dx_OrbitCamera(tolua_S);\n\tlua_register_cocos2dx_EventCustom(tolua_S);\n\tlua_register_cocos2dx_Component(tolua_S);\n\tlua_register_cocos2dx_EventListenerTouchOneByOne(tolua_S);\n\tlua_register_cocos2dx_ParticleRain(tolua_S);\n\tlua_register_cocos2dx_Waves(tolua_S);\n\tlua_register_cocos2dx_EaseOut(tolua_S);\n\tlua_register_cocos2dx_MenuItemFont(tolua_S);\n\tlua_register_cocos2dx_TransitionFadeUp(tolua_S);\n\tlua_register_cocos2dx_EaseSineOut(tolua_S);\n\tlua_register_cocos2dx_JumpTiles3D(tolua_S);\n\tlua_register_cocos2dx_MenuItemToggle(tolua_S);\n\tlua_register_cocos2dx_RemoveSelf(tolua_S);\n\tlua_register_cocos2dx_SplitCols(tolua_S);\n\tlua_register_cocos2dx_MotionStreak(tolua_S);\n\tlua_register_cocos2dx_RotateBy(tolua_S);\n\tlua_register_cocos2dx_FileUtils(tolua_S);\n\tlua_register_cocos2dx_ProgressTo(tolua_S);\n\tlua_register_cocos2dx_TransitionProgressOutIn(tolua_S);\n\tlua_register_cocos2dx_CatmullRomBy(tolua_S);\n\tlua_register_cocos2dx_Sequence(tolua_S);\n\tlua_register_cocos2dx_Shaky3D(tolua_S);\n\tlua_register_cocos2dx_TransitionProgressRadialCW(tolua_S);\n\tlua_register_cocos2dx_EaseBounceInOut(tolua_S);\n\tlua_register_cocos2dx_TransitionSlideInR(tolua_S);\n\tlua_register_cocos2dx_ParallaxNode(tolua_S);\n\tlua_register_cocos2dx_Scheduler(tolua_S);\n\tlua_register_cocos2dx_UserDefault(tolua_S);\n\tlua_register_cocos2dx_EaseSineIn(tolua_S);\n\tlua_register_cocos2dx_WavesTiles3D(tolua_S);\n\tlua_register_cocos2dx_TransitionSlideInB(tolua_S);\n\tlua_register_cocos2dx_Speed(tolua_S);\n\tlua_register_cocos2dx_ShatteredTiles3D(tolua_S);\n\n\ttolua_endmodule(tolua_S);\n\treturn 1;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_auto.hpp",
    "content": "#ifndef __cocos2dx_h__\n#define __cocos2dx_h__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\nint register_all_cocos2dx(lua_State* tolua_S);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#endif // __cocos2dx_h__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_auto_api.js",
    "content": "/**\n * @module cocos2dx\n */\nvar cc = cc || {};\n\n/**\n * @class Object\n */\ncc.Object = {\n\n/**\n * @method getReferenceCount\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetReferenceCount : function () {},\n\n/**\n * @method release\n */\nrelease : function () {},\n\n/**\n * @method retain\n */\nretain : function () {},\n\n/**\n * @method Object\n * @constructor\n */\nObject : function () {},\n\n};\n\n/**\n * @class Action\n */\ncc.Action = {\n\n/**\n * @method startWithTarget\n * @param {cocos2d::Node*}\n */\nstartWithTarget : function () {},\n\n/**\n * @method setOriginalTarget\n * @param {cocos2d::Node*}\n */\nsetOriginalTarget : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n */\nclone : function () {},\n\n/**\n * @method getOriginalTarget\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetOriginalTarget : function () {},\n\n/**\n * @method stop\n */\nstop : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method getTarget\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetTarget : function () {},\n\n/**\n * @method step\n * @param {float}\n */\nstep : function () {},\n\n/**\n * @method setTag\n * @param {int}\n */\nsetTag : function () {},\n\n/**\n * @method getTag\n * @return A value converted from C/C++ \"int\"\n */\ngetTag : function () {},\n\n/**\n * @method setTarget\n * @param {cocos2d::Node*}\n */\nsetTarget : function () {},\n\n/**\n * @method isDone\n * @return A value converted from C/C++ \"bool\"\n */\nisDone : function () {},\n\n/**\n * @method reverse\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n */\nreverse : function () {},\n\n};\n\n/**\n * @class FiniteTimeAction\n */\ncc.FiniteTimeAction = {\n\n/**\n * @method setDuration\n * @param {float}\n */\nsetDuration : function () {},\n\n/**\n * @method getDuration\n * @return A value converted from C/C++ \"float\"\n */\ngetDuration : function () {},\n\n};\n\n/**\n * @class Speed\n */\ncc.Speed = {\n\n/**\n * @method setInnerAction\n * @param {cocos2d::ActionInterval*}\n */\nsetInnerAction : function () {},\n\n/**\n * @method setSpeed\n * @param {float}\n */\nsetSpeed : function () {},\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\ngetInnerAction : function () {},\n\n/**\n * @method getSpeed\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeed : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Speed*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Follow\n */\ncc.Follow = {\n\n/**\n * @method setBoudarySet\n * @param {bool}\n */\nsetBoudarySet : function () {},\n\n/**\n * @method isBoundarySet\n * @return A value converted from C/C++ \"bool\"\n */\nisBoundarySet : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Follow*\"\n * @param {cocos2d::Node*}\n * @param {const cocos2d::Rect&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class GLProgram\n */\ncc.GLProgram = {\n\n/**\n * @method getFragmentShaderLog\n * @return A value converted from C/C++ \"std::string\"\n */\ngetFragmentShaderLog : function () {},\n\n/**\n * @method addAttribute\n * @param {const char*}\n * @param {GLuint}\n */\naddAttribute : function () {},\n\n/**\n * @method setUniformLocationWithMatrix4fv\n * @param {GLint}\n * @param {const GLfloat*}\n * @param {unsigned int}\n */\nsetUniformLocationWithMatrix4fv : function () {},\n\n/**\n * @method getUniformLocationForName\n * @return A value converted from C/C++ \"GLint\"\n * @param {const char*}\n */\ngetUniformLocationForName : function () {},\n\n/**\n * @method use\n */\nuse : function () {},\n\n/**\n * @method getVertexShaderLog\n * @return A value converted from C/C++ \"std::string\"\n */\ngetVertexShaderLog : function () {},\n\n/**\n * @method initWithVertexShaderByteArray\n * @return A value converted from C/C++ \"bool\"\n * @param {const GLchar*}\n * @param {const GLchar*}\n */\ninitWithVertexShaderByteArray : function () {},\n\n/**\n * @method initWithVertexShaderFilename\n * @return A value converted from C/C++ \"bool\"\n * @param {const char*}\n * @param {const char*}\n */\ninitWithVertexShaderFilename : function () {},\n\n/**\n * @method setUniformLocationWith3i\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith3i : function () {},\n\n/**\n * @method setUniformLocationWith3iv\n * @param {GLint}\n * @param {GLint*}\n * @param {unsigned int}\n */\nsetUniformLocationWith3iv : function () {},\n\n/**\n * @method updateUniforms\n */\nupdateUniforms : function () {},\n\n/**\n * @method setUniformLocationWith4iv\n * @param {GLint}\n * @param {GLint*}\n * @param {unsigned int}\n */\nsetUniformLocationWith4iv : function () {},\n\n/**\n * @method setUniformLocationWithMatrix2fv\n * @param {GLint}\n * @param {const GLfloat*}\n * @param {unsigned int}\n */\nsetUniformLocationWithMatrix2fv : function () {},\n\n/**\n * @method link\n * @return A value converted from C/C++ \"bool\"\n */\nlink : function () {},\n\n/**\n * @method setUniformLocationWith2iv\n * @param {GLint}\n * @param {GLint*}\n * @param {unsigned int}\n */\nsetUniformLocationWith2iv : function () {},\n\n/**\n * @method setUniformLocationWithMatrix3fv\n * @param {GLint}\n * @param {const GLfloat*}\n * @param {unsigned int}\n */\nsetUniformLocationWithMatrix3fv : function () {},\n\n/**\n * @method reset\n */\nreset : function () {},\n\n/**\n * @method setUniformLocationWith4i\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith4i : function () {},\n\n/**\n * @method setUniformLocationWith1i\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith1i : function () {},\n\n/**\n * @method setUniformLocationWith2i\n * @param {GLint}\n * @param {GLint}\n * @param {GLint}\n */\nsetUniformLocationWith2i : function () {},\n\n/**\n * @method GLProgram\n * @constructor\n */\nGLProgram : function () {},\n\n};\n\n/**\n * @class Touch\n */\ncc.Touch = {\n\n/**\n * @method getPreviousLocationInView\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPreviousLocationInView : function () {},\n\n/**\n * @method getLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetLocation : function () {},\n\n/**\n * @method getDelta\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetDelta : function () {},\n\n/**\n * @method getStartLocationInView\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartLocationInView : function () {},\n\n/**\n * @method getStartLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartLocation : function () {},\n\n/**\n * @method getID\n * @return A value converted from C/C++ \"int\"\n */\ngetID : function () {},\n\n/**\n * @method setTouchInfo\n * @param {int}\n * @param {float}\n * @param {float}\n */\nsetTouchInfo : function () {},\n\n/**\n * @method getLocationInView\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetLocationInView : function () {},\n\n/**\n * @method getPreviousLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPreviousLocation : function () {},\n\n/**\n * @method Touch\n * @constructor\n */\nTouch : function () {},\n\n};\n\n/**\n * @class Event\n */\ncc.Event = {\n\n/**\n * @method isStopped\n * @return A value converted from C/C++ \"bool\"\n */\nisStopped : function () {},\n\n/**\n * @method getType\n * @return A value converted from C/C++ \"cocos2d::Event::Type\"\n */\ngetType : function () {},\n\n/**\n * @method getCurrentTarget\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetCurrentTarget : function () {},\n\n/**\n * @method stopPropagation\n */\nstopPropagation : function () {},\n\n};\n\n/**\n * @class EventTouch\n */\ncc.EventTouch = {\n\n/**\n * @method getEventCode\n * @return A value converted from C/C++ \"cocos2d::EventTouch::EventCode\"\n */\ngetEventCode : function () {},\n\n/**\n * @method setEventCode\n * @param {cocos2d::EventTouch::EventCode}\n */\nsetEventCode : function () {},\n\n/**\n * @method EventTouch\n * @constructor\n */\nEventTouch : function () {},\n\n};\n\n/**\n * @class EventKeyboard\n */\ncc.EventKeyboard = {\n\n/**\n * @method EventKeyboard\n * @constructor\n * @param {cocos2d::EventKeyboard::KeyCode}\n * @param {bool}\n */\nEventKeyboard : function () {},\n\n};\n\n/**\n * @class Texture2D\n */\ncc.Texture2D = {\n\n/**\n * @method getShaderProgram\n * @return A value converted from C/C++ \"cocos2d::GLProgram*\"\n */\ngetShaderProgram : function () {},\n\n/**\n * @method getMaxT\n * @return A value converted from C/C++ \"GLfloat\"\n */\ngetMaxT : function () {},\n\n/**\n * @method getStringForFormat\n * @return A value converted from C/C++ \"const char*\"\n */\ngetStringForFormat : function () {},\n\n/**\n * @method setShaderProgram\n * @param {cocos2d::GLProgram*}\n */\nsetShaderProgram : function () {},\n\n/**\n * @method getMaxS\n * @return A value converted from C/C++ \"GLfloat\"\n */\ngetMaxS : function () {},\n\n/**\n * @method hasPremultipliedAlpha\n * @return A value converted from C/C++ \"bool\"\n */\nhasPremultipliedAlpha : function () {},\n\n/**\n * @method initWithMipmaps\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::MipmapInfo*}\n * @param {int}\n * @param {cocos2d::Texture2D::PixelFormat}\n * @param {int}\n * @param {int}\n */\ninitWithMipmaps : function () {},\n\n/**\n * @method getPixelsHigh\n * @return A value converted from C/C++ \"int\"\n */\ngetPixelsHigh : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"GLuint\"\n */\ngetName : function () {},\n\n/**\n * @method setMaxT\n * @param {GLfloat}\n */\nsetMaxT : function () {},\n\n/**\n * @method drawInRect\n * @param {const cocos2d::Rect&}\n */\ndrawInRect : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetContentSize : function () {},\n\n/**\n * @method setAliasTexParameters\n */\nsetAliasTexParameters : function () {},\n\n/**\n * @method setAntiAliasTexParameters\n */\nsetAntiAliasTexParameters : function () {},\n\n/**\n * @method generateMipmap\n */\ngenerateMipmap : function () {},\n\n/**\n * @method getDescription\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDescription : function () {},\n\n/**\n * @method getPixelFormat\n * @return A value converted from C/C++ \"cocos2d::Texture2D::PixelFormat\"\n */\ngetPixelFormat : function () {},\n\n/**\n * @method getContentSizeInPixels\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetContentSizeInPixels : function () {},\n\n/**\n * @method getPixelsWide\n * @return A value converted from C/C++ \"int\"\n */\ngetPixelsWide : function () {},\n\n/**\n * @method drawAtPoint\n * @param {const cocos2d::Point&}\n */\ndrawAtPoint : function () {},\n\n/**\n * @method hasMipmaps\n * @return A value converted from C/C++ \"bool\"\n */\nhasMipmaps : function () {},\n\n/**\n * @method setMaxS\n * @param {GLfloat}\n */\nsetMaxS : function () {},\n\n/**\n * @method setDefaultAlphaPixelFormat\n * @param {cocos2d::Texture2D::PixelFormat}\n */\nsetDefaultAlphaPixelFormat : function () {},\n\n/**\n * @method getDefaultAlphaPixelFormat\n * @return A value converted from C/C++ \"cocos2d::Texture2D::PixelFormat\"\n */\ngetDefaultAlphaPixelFormat : function () {},\n\n/**\n * @method PVRImagesHavePremultipliedAlpha\n * @param {bool}\n */\nPVRImagesHavePremultipliedAlpha : function () {},\n\n/**\n * @method Texture2D\n * @constructor\n */\nTexture2D : function () {},\n\n};\n\n/**\n * @class EventListener\n */\ncc.EventListener = {\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::EventListener*\"\n */\nclone : function () {},\n\n/**\n * @method checkAvailable\n * @return A value converted from C/C++ \"bool\"\n */\ncheckAvailable : function () {},\n\n};\n\n/**\n * @class EventDispatcher\n */\ncc.EventDispatcher = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method addEventListenerWithSceneGraphPriority\n * @param {cocos2d::EventListener*}\n * @param {cocos2d::Node*}\n */\naddEventListenerWithSceneGraphPriority : function () {},\n\n/**\n * @method addEventListenerWithFixedPriority\n * @param {cocos2d::EventListener*}\n * @param {int}\n */\naddEventListenerWithFixedPriority : function () {},\n\n/**\n * @method removeEventListener\n * @param {cocos2d::EventListener*}\n */\nremoveEventListener : function () {},\n\n/**\n * @method removeEventListeners\n * @param {cocos2d::EventListener::Type}\n */\nremoveEventListeners : function () {},\n\n/**\n * @method dispatchCustomEvent\n * @param {const std::string&}\n * @param {void*}\n */\ndispatchCustomEvent : function () {},\n\n/**\n * @method setPriority\n * @param {cocos2d::EventListener*}\n * @param {int}\n */\nsetPriority : function () {},\n\n/**\n * @method addCustomEventListener\n * @return A value converted from C/C++ \"cocos2d::EventListenerCustom*\"\n * @param {const std::string&}\n * @param {std::function<void (cocos2d::EventCustom *)>}\n */\naddCustomEventListener : function () {},\n\n/**\n * @method dispatchEvent\n * @param {cocos2d::Event*}\n */\ndispatchEvent : function () {},\n\n/**\n * @method removeAllEventListeners\n */\nremoveAllEventListeners : function () {},\n\n/**\n * @method removeCustomEventListeners\n * @param {const std::string&}\n */\nremoveCustomEventListeners : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method EventDispatcher\n * @constructor\n */\nEventDispatcher : function () {},\n\n};\n\n/**\n * @class Node\n */\ncc.Node = {\n\n/**\n * @method removeComponent\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nremoveComponent : function () {},\n\n/**\n * @method setPhysicsBody\n * @param {cocos2d::PhysicsBody*}\n */\nsetPhysicsBody : function () {},\n\n/**\n * @method getDescription\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDescription : function () {},\n\n/**\n * @method setOpacityModifyRGB\n * @param {bool}\n */\nsetOpacityModifyRGB : function () {},\n\n/**\n * @method setCascadeOpacityEnabled\n * @param {bool}\n */\nsetCascadeOpacityEnabled : function () {},\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method convertToWorldSpaceAR\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToWorldSpaceAR : function () {},\n\n/**\n * @method isIgnoreAnchorPointForPosition\n * @return A value converted from C/C++ \"bool\"\n */\nisIgnoreAnchorPointForPosition : function () {},\n\n/**\n * @method updateDisplayedOpacity\n * @param {GLubyte}\n */\nupdateDisplayedOpacity : function () {},\n\n/**\n * @method setRotation\n * @param {float}\n */\nsetRotation : function () {},\n\n/**\n * @method setScaleY\n * @param {float}\n */\nsetScaleY : function () {},\n\n/**\n * @method setScaleX\n * @param {float}\n */\nsetScaleX : function () {},\n\n/**\n * @method getColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetColor : function () {},\n\n/**\n * @method removeAllComponents\n */\nremoveAllComponents : function () {},\n\n/**\n * @method _setLocalZOrder\n * @param {int}\n */\n_setLocalZOrder : function () {},\n\n/**\n * @method getTag\n * @return A value converted from C/C++ \"int\"\n */\ngetTag : function () {},\n\n/**\n * @method getNodeToWorldAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetNodeToWorldAffineTransform : function () {},\n\n/**\n * @method getNodeToWorldTransform\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetNodeToWorldTransform : function () {},\n\n/**\n * @method removeChild\n * @param {cocos2d::Node*}\n * @param {bool}\n */\nremoveChild : function () {},\n\n/**\n * @method convertToWorldSpace\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToWorldSpace : function () {},\n\n/**\n * @method getScene\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ngetScene : function () {},\n\n/**\n * @method getEventDispatcher\n * @return A value converted from C/C++ \"cocos2d::EventDispatcher*\"\n */\ngetEventDispatcher : function () {},\n\n/**\n * @method setSkewX\n * @param {float}\n */\nsetSkewX : function () {},\n\n/**\n * @method setSkewY\n * @param {float}\n */\nsetSkewY : function () {},\n\n/**\n * @method getOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetOpacity : function () {},\n\n/**\n * @method convertTouchToNodeSpace\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nconvertTouchToNodeSpace : function () {},\n\n/**\n * @method getRotationX\n * @return A value converted from C/C++ \"float\"\n */\ngetRotationX : function () {},\n\n/**\n * @method getRotationY\n * @return A value converted from C/C++ \"float\"\n */\ngetRotationY : function () {},\n\n/**\n * @method getNodeToParentAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetNodeToParentAffineTransform : function () {},\n\n/**\n * @method isCascadeOpacityEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisCascadeOpacityEnabled : function () {},\n\n/**\n * @method setParent\n * @param {cocos2d::Node*}\n */\nsetParent : function () {},\n\n/**\n * @method getNodeToParentTransform\n * @return A value converted from C/C++ \"const kmMat4&\"\n */\ngetNodeToParentTransform : function () {},\n\n/**\n * @method resume\n */\nresume : function () {},\n\n/**\n * @method getPhysicsBody\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n */\ngetPhysicsBody : function () {},\n\n/**\n * @method stopActionByTag\n * @param {int}\n */\nstopActionByTag : function () {},\n\n/**\n * @method reorderChild\n * @param {cocos2d::Node*}\n * @param {int}\n */\nreorderChild : function () {},\n\n/**\n * @method ignoreAnchorPointForPosition\n * @param {bool}\n */\nignoreAnchorPointForPosition : function () {},\n\n/**\n * @method setColor\n * @param {const cocos2d::Color3B&}\n */\nsetColor : function () {},\n\n/**\n * @method setPositionY\n * @param {float}\n */\nsetPositionY : function () {},\n\n/**\n * @method setPositionX\n * @param {float}\n */\nsetPositionX : function () {},\n\n/**\n * @method setNodeToParentTransform\n * @param {const kmMat4&}\n */\nsetNodeToParentTransform : function () {},\n\n/**\n * @method getAnchorPoint\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetAnchorPoint : function () {},\n\n/**\n * @method getNumberOfRunningActions\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetNumberOfRunningActions : function () {},\n\n/**\n * @method updateTransform\n */\nupdateTransform : function () {},\n\n/**\n * @method isVisible\n * @return A value converted from C/C++ \"bool\"\n */\nisVisible : function () {},\n\n/**\n * @method getChildrenCount\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetChildrenCount : function () {},\n\n/**\n * @method convertToNodeSpaceAR\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToNodeSpaceAR : function () {},\n\n/**\n * @method addComponent\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Component*}\n */\naddComponent : function () {},\n\n/**\n * @method visit\n */\nvisit : function () {},\n\n/**\n * @method setShaderProgram\n * @param {cocos2d::GLProgram*}\n */\nsetShaderProgram : function () {},\n\n/**\n * @method getRotation\n * @return A value converted from C/C++ \"float\"\n */\ngetRotation : function () {},\n\n/**\n * @method getAnchorPointInPoints\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetAnchorPointInPoints : function () {},\n\n/**\n * @method runAction\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n * @param {cocos2d::Action*}\n */\nrunAction : function () {},\n\n/**\n * @method transform\n */\ntransform : function () {},\n\n/**\n * @method setVertexZ\n * @param {float}\n */\nsetVertexZ : function () {},\n\n/**\n * @method setScheduler\n * @param {cocos2d::Scheduler*}\n */\nsetScheduler : function () {},\n\n/**\n * @method stopAllActions\n */\nstopAllActions : function () {},\n\n/**\n * @method getSkewX\n * @return A value converted from C/C++ \"float\"\n */\ngetSkewX : function () {},\n\n/**\n * @method getSkewY\n * @return A value converted from C/C++ \"float\"\n */\ngetSkewY : function () {},\n\n/**\n * @method getDisplayedColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetDisplayedColor : function () {},\n\n/**\n * @method getActionByTag\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n * @param {int}\n */\ngetActionByTag : function () {},\n\n/**\n * @method setRotationX\n * @param {float}\n */\nsetRotationX : function () {},\n\n/**\n * @method setRotationY\n * @param {float}\n */\nsetRotationY : function () {},\n\n/**\n * @method getDisplayedOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetDisplayedOpacity : function () {},\n\n/**\n * @method getLocalZOrder\n * @return A value converted from C/C++ \"int\"\n */\ngetLocalZOrder : function () {},\n\n/**\n * @method getParentToNodeAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetParentToNodeAffineTransform : function () {},\n\n/**\n * @method getOrderOfArrival\n * @return A value converted from C/C++ \"int\"\n */\ngetOrderOfArrival : function () {},\n\n/**\n * @method setActionManager\n * @param {cocos2d::ActionManager*}\n */\nsetActionManager : function () {},\n\n/**\n * @method isRunning\n * @return A value converted from C/C++ \"bool\"\n */\nisRunning : function () {},\n\n/**\n * @method getPositionY\n * @return A value converted from C/C++ \"float\"\n */\ngetPositionY : function () {},\n\n/**\n * @method getPositionX\n * @return A value converted from C/C++ \"float\"\n */\ngetPositionX : function () {},\n\n/**\n * @method removeChildByTag\n * @param {int}\n * @param {bool}\n */\nremoveChildByTag : function () {},\n\n/**\n * @method updateDisplayedColor\n * @param {const cocos2d::Color3B&}\n */\nupdateDisplayedColor : function () {},\n\n/**\n * @method setVisible\n * @param {bool}\n */\nsetVisible : function () {},\n\n/**\n * @method getParentToNodeTransform\n * @return A value converted from C/C++ \"const kmMat4&\"\n */\ngetParentToNodeTransform : function () {},\n\n/**\n * @method getVertexZ\n * @return A value converted from C/C++ \"float\"\n */\ngetVertexZ : function () {},\n\n/**\n * @method setGlobalZOrder\n * @param {float}\n */\nsetGlobalZOrder : function () {},\n\n/**\n * @method getChildByTag\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {int}\n */\ngetChildByTag : function () {},\n\n/**\n * @method setOrderOfArrival\n * @param {int}\n */\nsetOrderOfArrival : function () {},\n\n/**\n * @method getScaleY\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleY : function () {},\n\n/**\n * @method getScaleX\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleX : function () {},\n\n/**\n * @method setLocalZOrder\n * @param {int}\n */\nsetLocalZOrder : function () {},\n\n/**\n * @method getWorldToNodeAffineTransform\n * @return A value converted from C/C++ \"cocos2d::AffineTransform\"\n */\ngetWorldToNodeAffineTransform : function () {},\n\n/**\n * @method setCascadeColorEnabled\n * @param {bool}\n */\nsetCascadeColorEnabled : function () {},\n\n/**\n * @method setOpacity\n * @param {GLubyte}\n */\nsetOpacity : function () {},\n\n/**\n * @method cleanup\n */\ncleanup : function () {},\n\n/**\n * @method getComponent\n * @return A value converted from C/C++ \"cocos2d::Component*\"\n * @param {const std::string&}\n */\ngetComponent : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetContentSize : function () {},\n\n/**\n * @method getBoundingBox\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\ngetBoundingBox : function () {},\n\n/**\n * @method updatePhysicsTransform\n * @return A value converted from C/C++ \"bool\"\n */\nupdatePhysicsTransform : function () {},\n\n/**\n * @method setEventDispatcher\n * @param {cocos2d::EventDispatcher*}\n */\nsetEventDispatcher : function () {},\n\n/**\n * @method getGlobalZOrder\n * @return A value converted from C/C++ \"float\"\n */\ngetGlobalZOrder : function () {},\n\n/**\n * @method draw\n */\ndraw : function () {},\n\n/**\n * @method transformAncestors\n */\ntransformAncestors : function () {},\n\n/**\n * @method setUserObject\n * @param {cocos2d::Object*}\n */\nsetUserObject : function () {},\n\n/**\n * @method convertTouchToNodeSpaceAR\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nconvertTouchToNodeSpaceAR : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method sortAllChildren\n */\nsortAllChildren : function () {},\n\n/**\n * @method getWorldToNodeTransform\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetWorldToNodeTransform : function () {},\n\n/**\n * @method getScale\n * @return A value converted from C/C++ \"float\"\n */\ngetScale : function () {},\n\n/**\n * @method convertToNodeSpace\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToNodeSpace : function () {},\n\n/**\n * @method setTag\n * @param {int}\n */\nsetTag : function () {},\n\n/**\n * @method isCascadeColorEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisCascadeColorEnabled : function () {},\n\n/**\n * @method isOpacityModifyRGB\n * @return A value converted from C/C++ \"bool\"\n */\nisOpacityModifyRGB : function () {},\n\n/**\n * @method stopAction\n * @param {cocos2d::Action*}\n */\nstopAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SpriteFrame\n */\ncc.SpriteFrame = {\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n */\nclone : function () {},\n\n/**\n * @method setRotated\n * @param {bool}\n */\nsetRotated : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method setRectInPixels\n * @param {const cocos2d::Rect&}\n */\nsetRectInPixels : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method getRect\n * @return A value converted from C/C++ \"const cocos2d::Rect&\"\n */\ngetRect : function () {},\n\n/**\n * @method setOffsetInPixels\n * @param {const cocos2d::Point&}\n */\nsetOffsetInPixels : function () {},\n\n/**\n * @method getRectInPixels\n * @return A value converted from C/C++ \"const cocos2d::Rect&\"\n */\ngetRectInPixels : function () {},\n\n/**\n * @method setOriginalSize\n * @param {const cocos2d::Size&}\n */\nsetOriginalSize : function () {},\n\n/**\n * @method getOriginalSizeInPixels\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetOriginalSizeInPixels : function () {},\n\n/**\n * @method setOriginalSizeInPixels\n * @param {const cocos2d::Size&}\n */\nsetOriginalSizeInPixels : function () {},\n\n/**\n * @method setOffset\n * @param {const cocos2d::Point&}\n */\nsetOffset : function () {},\n\n/**\n * @method getOffset\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetOffset : function () {},\n\n/**\n * @method isRotated\n * @return A value converted from C/C++ \"bool\"\n */\nisRotated : function () {},\n\n/**\n * @method setRect\n * @param {const cocos2d::Rect&}\n */\nsetRect : function () {},\n\n/**\n * @method getOffsetInPixels\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetOffsetInPixels : function () {},\n\n/**\n * @method getOriginalSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetOriginalSize : function () {},\n\n};\n\n/**\n * @class AnimationFrame\n */\ncc.AnimationFrame = {\n\n/**\n * @method setSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetSpriteFrame : function () {},\n\n/**\n * @method setDelayUnits\n * @param {float}\n */\nsetDelayUnits : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::AnimationFrame*\"\n */\nclone : function () {},\n\n/**\n * @method getSpriteFrame\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n */\ngetSpriteFrame : function () {},\n\n/**\n * @method getDelayUnits\n * @return A value converted from C/C++ \"float\"\n */\ngetDelayUnits : function () {},\n\n/**\n * @method setUserInfo\n * @param {const cocos2d::ValueMap&}\n */\nsetUserInfo : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::AnimationFrame*\"\n * @param {cocos2d::SpriteFrame*}\n * @param {float}\n * @param {const cocos2d::ValueMap&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Animation\n */\ncc.Animation = {\n\n/**\n * @method getLoops\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetLoops : function () {},\n\n/**\n * @method addSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\naddSpriteFrame : function () {},\n\n/**\n * @method setRestoreOriginalFrame\n * @param {bool}\n */\nsetRestoreOriginalFrame : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::Animation*\"\n */\nclone : function () {},\n\n/**\n * @method getDuration\n * @return A value converted from C/C++ \"float\"\n */\ngetDuration : function () {},\n\n/**\n * @method setFrames\n * @param {const cocos2d::Vector<cocos2d::AnimationFrame *>&}\n */\nsetFrames : function () {},\n\n/**\n * @method getFrames\n * @return A value converted from C/C++ \"const cocos2d::Vector<cocos2d::AnimationFrame *>&\"\n */\ngetFrames : function () {},\n\n/**\n * @method setLoops\n * @param {unsigned int}\n */\nsetLoops : function () {},\n\n/**\n * @method setDelayPerUnit\n * @param {float}\n */\nsetDelayPerUnit : function () {},\n\n/**\n * @method addSpriteFrameWithFile\n * @param {const std::string&}\n */\naddSpriteFrameWithFile : function () {},\n\n/**\n * @method getTotalDelayUnits\n * @return A value converted from C/C++ \"float\"\n */\ngetTotalDelayUnits : function () {},\n\n/**\n * @method getDelayPerUnit\n * @return A value converted from C/C++ \"float\"\n */\ngetDelayPerUnit : function () {},\n\n/**\n * @method getRestoreOriginalFrame\n * @return A value converted from C/C++ \"bool\"\n */\ngetRestoreOriginalFrame : function () {},\n\n/**\n * @method addSpriteFrameWithTexture\n * @param {cocos2d::Texture2D*}\n * @param {const cocos2d::Rect&}\n */\naddSpriteFrameWithTexture : function () {},\n\n/**\n * @method createWithSpriteFrames\n * @return A value converted from C/C++ \"cocos2d::Animation*\"\n * @param {const cocos2d::Vector<cocos2d::SpriteFrame *>&}\n * @param {float}\n */\ncreateWithSpriteFrames : function () {},\n\n};\n\n/**\n * @class ActionInterval\n */\ncc.ActionInterval = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getElapsed\n * @return A value converted from C/C++ \"float\"\n */\ngetElapsed : function () {},\n\n};\n\n/**\n * @class Sequence\n */\ncc.Sequence = {\n\n};\n\n/**\n * @class Repeat\n */\ncc.Repeat = {\n\n/**\n * @method setInnerAction\n * @param {cocos2d::FiniteTimeAction*}\n */\nsetInnerAction : function () {},\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::FiniteTimeAction*\"\n */\ngetInnerAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Repeat*\"\n * @param {cocos2d::FiniteTimeAction*}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class RepeatForever\n */\ncc.RepeatForever = {\n\n/**\n * @method setInnerAction\n * @param {cocos2d::ActionInterval*}\n */\nsetInnerAction : function () {},\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\ngetInnerAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::RepeatForever*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Spawn\n */\ncc.Spawn = {\n\n};\n\n/**\n * @class RotateTo\n */\ncc.RotateTo = {\n\n};\n\n/**\n * @class RotateBy\n */\ncc.RotateBy = {\n\n};\n\n/**\n * @class MoveBy\n */\ncc.MoveBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::MoveBy*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class MoveTo\n */\ncc.MoveTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::MoveTo*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SkewTo\n */\ncc.SkewTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SkewTo*\"\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SkewBy\n */\ncc.SkewBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SkewBy*\"\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class JumpBy\n */\ncc.JumpBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::JumpBy*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class JumpTo\n */\ncc.JumpTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::JumpTo*\"\n * @param {float}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class BezierBy\n */\ncc.BezierBy = {\n\n};\n\n/**\n * @class BezierTo\n */\ncc.BezierTo = {\n\n};\n\n/**\n * @class ScaleTo\n */\ncc.ScaleTo = {\n\n};\n\n/**\n * @class ScaleBy\n */\ncc.ScaleBy = {\n\n};\n\n/**\n * @class Blink\n */\ncc.Blink = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Blink*\"\n * @param {float}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeIn\n */\ncc.FadeIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeIn*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOut\n */\ncc.FadeOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOut*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeTo\n */\ncc.FadeTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeTo*\"\n * @param {float}\n * @param {GLubyte}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TintTo\n */\ncc.TintTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TintTo*\"\n * @param {float}\n * @param {GLubyte}\n * @param {GLubyte}\n * @param {GLubyte}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TintBy\n */\ncc.TintBy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TintBy*\"\n * @param {float}\n * @param {GLshort}\n * @param {GLshort}\n * @param {GLshort}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class DelayTime\n */\ncc.DelayTime = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::DelayTime*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Animate\n */\ncc.Animate = {\n\n/**\n * @method setAnimation\n * @param {cocos2d::Animation*}\n */\nsetAnimation : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Animate*\"\n * @param {cocos2d::Animation*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TargetedAction\n */\ncc.TargetedAction = {\n\n/**\n * @method setForcedTarget\n * @param {cocos2d::Node*}\n */\nsetForcedTarget : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TargetedAction*\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::FiniteTimeAction*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ActionCamera\n */\ncc.ActionCamera = {\n\n/**\n * @method getEye\n * @return A value converted from C/C++ \"const kmVec3&\"\n */\ngetEye : function () {},\n\n/**\n * @method setUp\n * @param {const kmVec3&}\n */\nsetUp : function () {},\n\n/**\n * @method getCenter\n * @return A value converted from C/C++ \"const kmVec3&\"\n */\ngetCenter : function () {},\n\n/**\n * @method setCenter\n * @param {const kmVec3&}\n */\nsetCenter : function () {},\n\n/**\n * @method getUp\n * @return A value converted from C/C++ \"const kmVec3&\"\n */\ngetUp : function () {},\n\n/**\n * @method ActionCamera\n * @constructor\n */\nActionCamera : function () {},\n\n};\n\n/**\n * @class OrbitCamera\n */\ncc.OrbitCamera = {\n\n/**\n * @method sphericalRadius\n * @param {float*}\n * @param {float*}\n * @param {float*}\n */\nsphericalRadius : function () {},\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\ninitWithDuration : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::OrbitCamera*\"\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method OrbitCamera\n * @constructor\n */\nOrbitCamera : function () {},\n\n};\n\n/**\n * @class ActionManager\n */\ncc.ActionManager = {\n\n/**\n * @method getActionByTag\n * @return A value converted from C/C++ \"cocos2d::Action*\"\n * @param {int}\n * @param {const cocos2d::Node*}\n */\ngetActionByTag : function () {},\n\n/**\n * @method removeActionByTag\n * @param {int}\n * @param {cocos2d::Node*}\n */\nremoveActionByTag : function () {},\n\n/**\n * @method removeAllActions\n */\nremoveAllActions : function () {},\n\n/**\n * @method addAction\n * @param {cocos2d::Action*}\n * @param {cocos2d::Node*}\n * @param {bool}\n */\naddAction : function () {},\n\n/**\n * @method resumeTarget\n * @param {cocos2d::Node*}\n */\nresumeTarget : function () {},\n\n/**\n * @method getNumberOfRunningActionsInTarget\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {const cocos2d::Node*}\n */\ngetNumberOfRunningActionsInTarget : function () {},\n\n/**\n * @method removeAllActionsFromTarget\n * @param {cocos2d::Node*}\n */\nremoveAllActionsFromTarget : function () {},\n\n/**\n * @method resumeTargets\n * @param {const cocos2d::Vector<cocos2d::Node *>&}\n */\nresumeTargets : function () {},\n\n/**\n * @method removeAction\n * @param {cocos2d::Action*}\n */\nremoveAction : function () {},\n\n/**\n * @method pauseTarget\n * @param {cocos2d::Node*}\n */\npauseTarget : function () {},\n\n/**\n * @method pauseAllRunningActions\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>\"\n */\npauseAllRunningActions : function () {},\n\n/**\n * @method ActionManager\n * @constructor\n */\nActionManager : function () {},\n\n};\n\n/**\n * @class ActionEase\n */\ncc.ActionEase = {\n\n/**\n * @method getInnerAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\ngetInnerAction : function () {},\n\n};\n\n/**\n * @class EaseRateAction\n */\ncc.EaseRateAction = {\n\n/**\n * @method setRate\n * @param {float}\n */\nsetRate : function () {},\n\n/**\n * @method getRate\n * @return A value converted from C/C++ \"float\"\n */\ngetRate : function () {},\n\n};\n\n/**\n * @class EaseIn\n */\ncc.EaseIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseIn*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseOut\n */\ncc.EaseOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseOut*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseInOut\n */\ncc.EaseInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseInOut*\"\n * @param {cocos2d::ActionInterval*}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseExponentialIn\n */\ncc.EaseExponentialIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseExponentialIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseExponentialOut\n */\ncc.EaseExponentialOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseExponentialOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseExponentialInOut\n */\ncc.EaseExponentialInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseExponentialInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseSineIn\n */\ncc.EaseSineIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseSineIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseSineOut\n */\ncc.EaseSineOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseSineOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseSineInOut\n */\ncc.EaseSineInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseSineInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseElastic\n */\ncc.EaseElastic = {\n\n/**\n * @method setPeriod\n * @param {float}\n */\nsetPeriod : function () {},\n\n/**\n * @method getPeriod\n * @return A value converted from C/C++ \"float\"\n */\ngetPeriod : function () {},\n\n};\n\n/**\n * @class EaseElasticIn\n */\ncc.EaseElasticIn = {\n\n};\n\n/**\n * @class EaseElasticOut\n */\ncc.EaseElasticOut = {\n\n};\n\n/**\n * @class EaseElasticInOut\n */\ncc.EaseElasticInOut = {\n\n};\n\n/**\n * @class EaseBounce\n */\ncc.EaseBounce = {\n\n/**\n * @method bounceTime\n * @return A value converted from C/C++ \"float\"\n * @param {float}\n */\nbounceTime : function () {},\n\n};\n\n/**\n * @class EaseBounceIn\n */\ncc.EaseBounceIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBounceIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBounceOut\n */\ncc.EaseBounceOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBounceOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBounceInOut\n */\ncc.EaseBounceInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBounceInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBackIn\n */\ncc.EaseBackIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBackIn*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBackOut\n */\ncc.EaseBackOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBackOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EaseBackInOut\n */\ncc.EaseBackInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EaseBackInOut*\"\n * @param {cocos2d::ActionInterval*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ActionInstant\n */\ncc.ActionInstant = {\n\n};\n\n/**\n * @class Show\n */\ncc.Show = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Show*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Hide\n */\ncc.Hide = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Hide*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ToggleVisibility\n */\ncc.ToggleVisibility = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ToggleVisibility*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class RemoveSelf\n */\ncc.RemoveSelf = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::RemoveSelf*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipX\n */\ncc.FlipX = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipX*\"\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipY\n */\ncc.FlipY = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipY*\"\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Place\n */\ncc.Place = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Place*\"\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class CallFunc\n */\ncc.CallFunc = {\n\n/**\n * @method execute\n */\nexecute : function () {},\n\n/**\n * @method getTargetCallback\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ngetTargetCallback : function () {},\n\n/**\n * @method setTargetCallback\n * @param {cocos2d::Object*}\n */\nsetTargetCallback : function () {},\n\n};\n\n/**\n * @class GridAction\n */\ncc.GridAction = {\n\n/**\n * @method getGrid\n * @return A value converted from C/C++ \"cocos2d::GridBase*\"\n */\ngetGrid : function () {},\n\n};\n\n/**\n * @class Grid3DAction\n */\ncc.Grid3DAction = {\n\n/**\n * @method getGrid\n * @return A value converted from C/C++ \"cocos2d::GridBase*\"\n */\ngetGrid : function () {},\n\n};\n\n/**\n * @class TiledGrid3DAction\n */\ncc.TiledGrid3DAction = {\n\n/**\n * @method getGrid\n * @return A value converted from C/C++ \"cocos2d::GridBase*\"\n */\ngetGrid : function () {},\n\n};\n\n/**\n * @class StopGrid\n */\ncc.StopGrid = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::StopGrid*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ReuseGrid\n */\ncc.ReuseGrid = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ReuseGrid*\"\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Waves3D\n */\ncc.Waves3D = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Waves3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipX3D\n */\ncc.FlipX3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipX3D*\"\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FlipY3D\n */\ncc.FlipY3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FlipY3D*\"\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method FlipY3D\n * @constructor\n */\nFlipY3D : function () {},\n\n};\n\n/**\n * @class Lens3D\n */\ncc.Lens3D = {\n\n/**\n * @method setPosition\n * @param {const cocos2d::Point&}\n */\nsetPosition : function () {},\n\n/**\n * @method setConcave\n * @param {bool}\n */\nsetConcave : function () {},\n\n/**\n * @method setLensEffect\n * @param {float}\n */\nsetLensEffect : function () {},\n\n/**\n * @method getPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosition : function () {},\n\n/**\n * @method getLensEffect\n * @return A value converted from C/C++ \"float\"\n */\ngetLensEffect : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Lens3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::Point&}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Ripple3D\n */\ncc.Ripple3D = {\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setPosition\n * @param {const cocos2d::Point&}\n */\nsetPosition : function () {},\n\n/**\n * @method getPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosition : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Ripple3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Shaky3D\n */\ncc.Shaky3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Shaky3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {int}\n * @param {bool}\n */\ncreate : function () {},\n\n/**\n * @method Shaky3D\n * @constructor\n */\nShaky3D : function () {},\n\n};\n\n/**\n * @class Liquid\n */\ncc.Liquid = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Liquid*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method Liquid\n * @constructor\n */\nLiquid : function () {},\n\n};\n\n/**\n * @class Waves\n */\ncc.Waves = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Waves*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n * @param {bool}\n * @param {bool}\n */\ncreate : function () {},\n\n/**\n * @method Waves\n * @constructor\n */\nWaves : function () {},\n\n};\n\n/**\n * @class Twirl\n */\ncc.Twirl = {\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method setPosition\n * @param {const cocos2d::Point&}\n */\nsetPosition : function () {},\n\n/**\n * @method getPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosition : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Twirl*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {cocos2d::Point}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n/**\n * @method Twirl\n * @constructor\n */\nTwirl : function () {},\n\n};\n\n/**\n * @class PageTurn3D\n */\ncc.PageTurn3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PageTurn3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ProgressTo\n */\ncc.ProgressTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ProgressTo*\"\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ProgressFromTo\n */\ncc.ProgressFromTo = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ProgressFromTo*\"\n * @param {float}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ShakyTiles3D\n */\ncc.ShakyTiles3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ShakyTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {int}\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ShatteredTiles3D\n */\ncc.ShatteredTiles3D = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ShatteredTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {int}\n * @param {bool}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ShuffleTiles\n */\ncc.ShuffleTiles = {\n\n/**\n * @method placeTile\n * @param {const cocos2d::Point&}\n * @param {cocos2d::Tile*}\n */\nplaceTile : function () {},\n\n/**\n * @method shuffle\n * @param {unsigned int*}\n * @param {unsigned int}\n */\nshuffle : function () {},\n\n/**\n * @method getDelta\n * @return A value converted from C/C++ \"cocos2d::Size\"\n * @param {const cocos2d::Size&}\n */\ngetDelta : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ShuffleTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutTRTiles\n */\ncc.FadeOutTRTiles = {\n\n/**\n * @method turnOnTile\n * @param {const cocos2d::Point&}\n */\nturnOnTile : function () {},\n\n/**\n * @method turnOffTile\n * @param {const cocos2d::Point&}\n */\nturnOffTile : function () {},\n\n/**\n * @method transformTile\n * @param {const cocos2d::Point&}\n * @param {float}\n */\ntransformTile : function () {},\n\n/**\n * @method testFunc\n * @return A value converted from C/C++ \"float\"\n * @param {const cocos2d::Size&}\n * @param {float}\n */\ntestFunc : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutTRTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutBLTiles\n */\ncc.FadeOutBLTiles = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutBLTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutUpTiles\n */\ncc.FadeOutUpTiles = {\n\n/**\n * @method transformTile\n * @param {const cocos2d::Point&}\n * @param {float}\n */\ntransformTile : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutUpTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class FadeOutDownTiles\n */\ncc.FadeOutDownTiles = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::FadeOutDownTiles*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TurnOffTiles\n */\ncc.TurnOffTiles = {\n\n/**\n * @method turnOnTile\n * @param {const cocos2d::Point&}\n */\nturnOnTile : function () {},\n\n/**\n * @method turnOffTile\n * @param {const cocos2d::Point&}\n */\nturnOffTile : function () {},\n\n/**\n * @method shuffle\n * @param {unsigned int*}\n * @param {unsigned int}\n */\nshuffle : function () {},\n\n};\n\n/**\n * @class WavesTiles3D\n */\ncc.WavesTiles3D = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::WavesTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class JumpTiles3D\n */\ncc.JumpTiles3D = {\n\n/**\n * @method getAmplitudeRate\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitudeRate : function () {},\n\n/**\n * @method setAmplitude\n * @param {float}\n */\nsetAmplitude : function () {},\n\n/**\n * @method setAmplitudeRate\n * @param {float}\n */\nsetAmplitudeRate : function () {},\n\n/**\n * @method getAmplitude\n * @return A value converted from C/C++ \"float\"\n */\ngetAmplitude : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::JumpTiles3D*\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {unsigned int}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SplitRows\n */\ncc.SplitRows = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SplitRows*\"\n * @param {float}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SplitCols\n */\ncc.SplitCols = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SplitCols*\"\n * @param {float}\n * @param {unsigned int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ActionTween\n */\ncc.ActionTween = {\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {const std::string&}\n * @param {float}\n * @param {float}\n */\ninitWithDuration : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ActionTween*\"\n * @param {float}\n * @param {const std::string&}\n * @param {float}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class CardinalSplineTo\n */\ncc.CardinalSplineTo = {\n\n/**\n * @method getPoints\n * @return A value converted from C/C++ \"cocos2d::PointArray*\"\n */\ngetPoints : function () {},\n\n/**\n * @method updatePosition\n * @param {cocos2d::Point&}\n */\nupdatePosition : function () {},\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::PointArray*}\n * @param {float}\n */\ninitWithDuration : function () {},\n\n/**\n * @method CardinalSplineTo\n * @constructor\n */\nCardinalSplineTo : function () {},\n\n};\n\n/**\n * @class CardinalSplineBy\n */\ncc.CardinalSplineBy = {\n\n/**\n * @method CardinalSplineBy\n * @constructor\n */\nCardinalSplineBy : function () {},\n\n};\n\n/**\n * @class CatmullRomTo\n */\ncc.CatmullRomTo = {\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::PointArray*}\n */\ninitWithDuration : function () {},\n\n};\n\n/**\n * @class CatmullRomBy\n */\ncc.CatmullRomBy = {\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::PointArray*}\n */\ninitWithDuration : function () {},\n\n};\n\n/**\n * @class AtlasNode\n */\ncc.AtlasNode = {\n\n/**\n * @method updateAtlasValues\n */\nupdateAtlasValues : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method getQuadsToDraw\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetQuadsToDraw : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method setQuadsToDraw\n * @param {ssize_t}\n */\nsetQuadsToDraw : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::AtlasNode*\"\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class DrawNode\n */\ncc.DrawNode = {\n\n/**\n * @method drawQuadraticBezier\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {unsigned int}\n * @param {const cocos2d::Color4F&}\n */\ndrawQuadraticBezier : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method clear\n */\nclear : function () {},\n\n/**\n * @method drawTriangle\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Color4F&}\n */\ndrawTriangle : function () {},\n\n/**\n * @method drawDot\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {const cocos2d::Color4F&}\n */\ndrawDot : function () {},\n\n/**\n * @method drawCubicBezier\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {unsigned int}\n * @param {const cocos2d::Color4F&}\n */\ndrawCubicBezier : function () {},\n\n/**\n * @method drawSegment\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {const cocos2d::Color4F&}\n */\ndrawSegment : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::DrawNode*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class LabelAtlas\n */\ncc.LabelAtlas = {\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method updateAtlasValues\n */\nupdateAtlasValues : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n};\n\n/**\n * @class Director\n */\ncc.Director = {\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method setContentScaleFactor\n * @param {float}\n */\nsetContentScaleFactor : function () {},\n\n/**\n * @method getContentScaleFactor\n * @return A value converted from C/C++ \"float\"\n */\ngetContentScaleFactor : function () {},\n\n/**\n * @method getWinSizeInPixels\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetWinSizeInPixels : function () {},\n\n/**\n * @method getDeltaTime\n * @return A value converted from C/C++ \"float\"\n */\ngetDeltaTime : function () {},\n\n/**\n * @method setGLDefaultValues\n */\nsetGLDefaultValues : function () {},\n\n/**\n * @method setActionManager\n * @param {cocos2d::ActionManager*}\n */\nsetActionManager : function () {},\n\n/**\n * @method setAlphaBlending\n * @param {bool}\n */\nsetAlphaBlending : function () {},\n\n/**\n * @method popToRootScene\n */\npopToRootScene : function () {},\n\n/**\n * @method getNotificationNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetNotificationNode : function () {},\n\n/**\n * @method getWinSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetWinSize : function () {},\n\n/**\n * @method getTextureCache\n * @return A value converted from C/C++ \"cocos2d::TextureCache*\"\n */\ngetTextureCache : function () {},\n\n/**\n * @method isSendCleanupToScene\n * @return A value converted from C/C++ \"bool\"\n */\nisSendCleanupToScene : function () {},\n\n/**\n * @method getVisibleOrigin\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetVisibleOrigin : function () {},\n\n/**\n * @method mainLoop\n */\nmainLoop : function () {},\n\n/**\n * @method setDepthTest\n * @param {bool}\n */\nsetDepthTest : function () {},\n\n/**\n * @method getFrameRate\n * @return A value converted from C/C++ \"float\"\n */\ngetFrameRate : function () {},\n\n/**\n * @method getSecondsPerFrame\n * @return A value converted from C/C++ \"float\"\n */\ngetSecondsPerFrame : function () {},\n\n/**\n * @method convertToUI\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToUI : function () {},\n\n/**\n * @method setDefaultValues\n */\nsetDefaultValues : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setScheduler\n * @param {cocos2d::Scheduler*}\n */\nsetScheduler : function () {},\n\n/**\n * @method startAnimation\n */\nstartAnimation : function () {},\n\n/**\n * @method getRunningScene\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ngetRunningScene : function () {},\n\n/**\n * @method setViewport\n */\nsetViewport : function () {},\n\n/**\n * @method stopAnimation\n */\nstopAnimation : function () {},\n\n/**\n * @method popToSceneStackLevel\n * @param {int}\n */\npopToSceneStackLevel : function () {},\n\n/**\n * @method resume\n */\nresume : function () {},\n\n/**\n * @method isNextDeltaTimeZero\n * @return A value converted from C/C++ \"bool\"\n */\nisNextDeltaTimeZero : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method setOpenGLView\n * @param {cocos2d::EGLView*}\n */\nsetOpenGLView : function () {},\n\n/**\n * @method convertToGL\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nconvertToGL : function () {},\n\n/**\n * @method purgeCachedData\n */\npurgeCachedData : function () {},\n\n/**\n * @method getTotalFrames\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetTotalFrames : function () {},\n\n/**\n * @method runWithScene\n * @param {cocos2d::Scene*}\n */\nrunWithScene : function () {},\n\n/**\n * @method setNotificationNode\n * @param {cocos2d::Node*}\n */\nsetNotificationNode : function () {},\n\n/**\n * @method drawScene\n */\ndrawScene : function () {},\n\n/**\n * @method popScene\n */\npopScene : function () {},\n\n/**\n * @method isDisplayStats\n * @return A value converted from C/C++ \"bool\"\n */\nisDisplayStats : function () {},\n\n/**\n * @method setProjection\n * @param {cocos2d::Director::Projection}\n */\nsetProjection : function () {},\n\n/**\n * @method getConsole\n * @return A value converted from C/C++ \"cocos2d::Console*\"\n */\ngetConsole : function () {},\n\n/**\n * @method getZEye\n * @return A value converted from C/C++ \"float\"\n */\ngetZEye : function () {},\n\n/**\n * @method setNextDeltaTimeZero\n * @param {bool}\n */\nsetNextDeltaTimeZero : function () {},\n\n/**\n * @method getVisibleSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetVisibleSize : function () {},\n\n/**\n * @method getScheduler\n * @return A value converted from C/C++ \"cocos2d::Scheduler*\"\n */\ngetScheduler : function () {},\n\n/**\n * @method pushScene\n * @param {cocos2d::Scene*}\n */\npushScene : function () {},\n\n/**\n * @method getAnimationInterval\n * @return A value converted from C/C++ \"double\"\n */\ngetAnimationInterval : function () {},\n\n/**\n * @method isPaused\n * @return A value converted from C/C++ \"bool\"\n */\nisPaused : function () {},\n\n/**\n * @method setDisplayStats\n * @param {bool}\n */\nsetDisplayStats : function () {},\n\n/**\n * @method replaceScene\n * @param {cocos2d::Scene*}\n */\nreplaceScene : function () {},\n\n/**\n * @method setAnimationInterval\n * @param {double}\n */\nsetAnimationInterval : function () {},\n\n/**\n * @method getActionManager\n * @return A value converted from C/C++ \"cocos2d::ActionManager*\"\n */\ngetActionManager : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::Director*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class GridBase\n */\ncc.GridBase = {\n\n/**\n * @method setGridSize\n * @param {const cocos2d::Size&}\n */\nsetGridSize : function () {},\n\n/**\n * @method calculateVertexPoints\n */\ncalculateVertexPoints : function () {},\n\n/**\n * @method afterDraw\n * @param {cocos2d::Node*}\n */\nafterDraw : function () {},\n\n/**\n * @method beforeDraw\n */\nbeforeDraw : function () {},\n\n/**\n * @method isTextureFlipped\n * @return A value converted from C/C++ \"bool\"\n */\nisTextureFlipped : function () {},\n\n/**\n * @method getGridSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetGridSize : function () {},\n\n/**\n * @method getStep\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetStep : function () {},\n\n/**\n * @method set2DProjection\n */\nset2DProjection : function () {},\n\n/**\n * @method setStep\n * @param {const cocos2d::Point&}\n */\nsetStep : function () {},\n\n/**\n * @method setTextureFlipped\n * @param {bool}\n */\nsetTextureFlipped : function () {},\n\n/**\n * @method blit\n */\nblit : function () {},\n\n/**\n * @method setActive\n * @param {bool}\n */\nsetActive : function () {},\n\n/**\n * @method getReuseGrid\n * @return A value converted from C/C++ \"int\"\n */\ngetReuseGrid : function () {},\n\n/**\n * @method setReuseGrid\n * @param {int}\n */\nsetReuseGrid : function () {},\n\n/**\n * @method isActive\n * @return A value converted from C/C++ \"bool\"\n */\nisActive : function () {},\n\n/**\n * @method reuse\n */\nreuse : function () {},\n\n};\n\n/**\n * @class Grid3D\n */\ncc.Grid3D = {\n\n/**\n * @method Grid3D\n * @constructor\n */\nGrid3D : function () {},\n\n};\n\n/**\n * @class TiledGrid3D\n */\ncc.TiledGrid3D = {\n\n/**\n * @method TiledGrid3D\n * @constructor\n */\nTiledGrid3D : function () {},\n\n};\n\n/**\n * @class Sprite\n */\ncc.Sprite = {\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method setFlippedY\n * @param {bool}\n */\nsetFlippedY : function () {},\n\n/**\n * @method setFlippedX\n * @param {bool}\n */\nsetFlippedX : function () {},\n\n/**\n * @method getBatchNode\n * @return A value converted from C/C++ \"cocos2d::SpriteBatchNode*\"\n */\ngetBatchNode : function () {},\n\n/**\n * @method getOffsetPosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetOffsetPosition : function () {},\n\n/**\n * @method removeAllChildrenWithCleanup\n * @param {bool}\n */\nremoveAllChildrenWithCleanup : function () {},\n\n/**\n * @method updateQuadVertices\n */\nupdateQuadVertices : function () {},\n\n/**\n * @method updateTransform\n */\nupdateTransform : function () {},\n\n/**\n * @method isFrameDisplayed\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::SpriteFrame*}\n */\nisFrameDisplayed : function () {},\n\n/**\n * @method getAtlasIndex\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetAtlasIndex : function () {},\n\n/**\n * @method setBatchNode\n * @param {cocos2d::SpriteBatchNode*}\n */\nsetBatchNode : function () {},\n\n/**\n * @method setDisplayFrameWithAnimationName\n * @param {const std::string&}\n * @param {ssize_t}\n */\nsetDisplayFrameWithAnimationName : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method getSpriteFrame\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n */\ngetSpriteFrame : function () {},\n\n/**\n * @method isDirty\n * @return A value converted from C/C++ \"bool\"\n */\nisDirty : function () {},\n\n/**\n * @method setAtlasIndex\n * @param {ssize_t}\n */\nsetAtlasIndex : function () {},\n\n/**\n * @method setDirty\n * @param {bool}\n */\nsetDirty : function () {},\n\n/**\n * @method isTextureRectRotated\n * @return A value converted from C/C++ \"bool\"\n */\nisTextureRectRotated : function () {},\n\n/**\n * @method getTextureRect\n * @return A value converted from C/C++ \"const cocos2d::Rect&\"\n */\ngetTextureRect : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method isFlippedX\n * @return A value converted from C/C++ \"bool\"\n */\nisFlippedX : function () {},\n\n/**\n * @method isFlippedY\n * @return A value converted from C/C++ \"bool\"\n */\nisFlippedY : function () {},\n\n/**\n * @method setVertexRect\n * @param {const cocos2d::Rect&}\n */\nsetVertexRect : function () {},\n\n/**\n * @method createWithSpriteFrameName\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {const std::string&}\n */\ncreateWithSpriteFrameName : function () {},\n\n/**\n * @method createWithSpriteFrame\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {cocos2d::SpriteFrame*}\n */\ncreateWithSpriteFrame : function () {},\n\n};\n\n/**\n * @class LabelTTF\n */\ncc.LabelTTF = {\n\n/**\n * @method enableShadow\n * @param {const cocos2d::Size&}\n * @param {float}\n * @param {float}\n * @param {bool}\n */\nenableShadow : function () {},\n\n/**\n * @method setDimensions\n * @param {const cocos2d::Size&}\n */\nsetDimensions : function () {},\n\n/**\n * @method getFontSize\n * @return A value converted from C/C++ \"float\"\n */\ngetFontSize : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n/**\n * @method setTextDefinition\n * @param {const cocos2d::FontDefinition&}\n */\nsetTextDefinition : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method getHorizontalAlignment\n * @return A value converted from C/C++ \"cocos2d::TextHAlignment\"\n */\ngetHorizontalAlignment : function () {},\n\n/**\n * @method initWithStringAndTextDefinition\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {cocos2d::FontDefinition&}\n */\ninitWithStringAndTextDefinition : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setFontFillColor\n * @param {const cocos2d::Color3B&}\n * @param {bool}\n */\nsetFontFillColor : function () {},\n\n/**\n * @method enableStroke\n * @param {const cocos2d::Color3B&}\n * @param {float}\n * @param {bool}\n */\nenableStroke : function () {},\n\n/**\n * @method getDimensions\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetDimensions : function () {},\n\n/**\n * @method setVerticalAlignment\n * @param {cocos2d::TextVAlignment}\n */\nsetVerticalAlignment : function () {},\n\n/**\n * @method setFontSize\n * @param {float}\n */\nsetFontSize : function () {},\n\n/**\n * @method getVerticalAlignment\n * @return A value converted from C/C++ \"cocos2d::TextVAlignment\"\n */\ngetVerticalAlignment : function () {},\n\n/**\n * @method getTextDefinition\n * @return A value converted from C/C++ \"cocos2d::FontDefinition\"\n */\ngetTextDefinition : function () {},\n\n/**\n * @method getFontName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFontName : function () {},\n\n/**\n * @method setHorizontalAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetHorizontalAlignment : function () {},\n\n/**\n * @method disableShadow\n */\ndisableShadow : function () {},\n\n/**\n * @method disableStroke\n */\ndisableStroke : function () {},\n\n/**\n * @method createWithFontDefinition\n * @return A value converted from C/C++ \"cocos2d::LabelTTF*\"\n * @param {const std::string&}\n * @param {cocos2d::FontDefinition&}\n */\ncreateWithFontDefinition : function () {},\n\n/**\n * @method LabelTTF\n * @constructor\n */\nLabelTTF : function () {},\n\n};\n\n/**\n * @class SpriteBatchNode\n */\ncc.SpriteBatchNode = {\n\n/**\n * @method appendChild\n * @param {cocos2d::Sprite*}\n */\nappendChild : function () {},\n\n/**\n * @method reorderBatch\n * @param {bool}\n */\nreorderBatch : function () {},\n\n/**\n * @method initWithTexture\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Texture2D*}\n * @param {ssize_t}\n */\ninitWithTexture : function () {},\n\n/**\n * @method lowestAtlasIndexInChild\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n */\nlowestAtlasIndexInChild : function () {},\n\n/**\n * @method atlasIndexForChild\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n * @param {int}\n */\natlasIndexForChild : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method rebuildIndexInOrder\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n * @param {ssize_t}\n */\nrebuildIndexInOrder : function () {},\n\n/**\n * @method increaseAtlasCapacity\n */\nincreaseAtlasCapacity : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method highestAtlasIndexInChild\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::Sprite*}\n */\nhighestAtlasIndexInChild : function () {},\n\n/**\n * @method removeChildAtIndex\n * @param {ssize_t}\n * @param {bool}\n */\nremoveChildAtIndex : function () {},\n\n/**\n * @method removeAllChildrenWithCleanup\n * @param {bool}\n */\nremoveAllChildrenWithCleanup : function () {},\n\n/**\n * @method removeSpriteFromAtlas\n * @param {cocos2d::Sprite*}\n */\nremoveSpriteFromAtlas : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::SpriteBatchNode*\"\n * @param {const std::string&}\n * @param {ssize_t}\n */\ncreate : function () {},\n\n/**\n * @method createWithTexture\n * @return A value converted from C/C++ \"cocos2d::SpriteBatchNode*\"\n * @param {cocos2d::Texture2D*}\n * @param {ssize_t}\n */\ncreateWithTexture : function () {},\n\n/**\n * @method SpriteBatchNode\n * @constructor\n */\nSpriteBatchNode : function () {},\n\n};\n\n/**\n * @class LabelBMFont\n */\ncc.LabelBMFont = {\n\n/**\n * @method setLineBreakWithoutSpace\n * @param {bool}\n */\nsetLineBreakWithoutSpace : function () {},\n\n/**\n * @method setScaleY\n * @param {float}\n */\nsetScaleY : function () {},\n\n/**\n * @method setScaleX\n * @param {float}\n */\nsetScaleX : function () {},\n\n/**\n * @method isOpacityModifyRGB\n * @return A value converted from C/C++ \"bool\"\n */\nisOpacityModifyRGB : function () {},\n\n/**\n * @method createFontChars\n */\ncreateFontChars : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n/**\n * @method initWithString\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {float}\n * @param {cocos2d::TextHAlignment}\n * @param {cocos2d::Point}\n */\ninitWithString : function () {},\n\n/**\n * @method setCString\n * @param {const char*}\n */\nsetCString : function () {},\n\n/**\n * @method setScale\n * @param {float}\n */\nsetScale : function () {},\n\n/**\n * @method setOpacityModifyRGB\n * @param {bool}\n */\nsetOpacityModifyRGB : function () {},\n\n/**\n * @method setFntFile\n * @param {const std::string&}\n */\nsetFntFile : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method getFntFile\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFntFile : function () {},\n\n/**\n * @method updateLabel\n */\nupdateLabel : function () {},\n\n/**\n * @method setAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetAlignment : function () {},\n\n/**\n * @method setWidth\n * @param {float}\n */\nsetWidth : function () {},\n\n/**\n * @method purgeCachedData\n */\npurgeCachedData : function () {},\n\n/**\n * @method LabelBMFont\n * @constructor\n */\nLabelBMFont : function () {},\n\n};\n\n/**\n * @class Label\n */\ncc.Label = {\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetString : function () {},\n\n/**\n * @method assignNewUTF16String\n * @param {unsigned short*}\n */\nassignNewUTF16String : function () {},\n\n/**\n * @method setLabelEffect\n * @param {cocos2d::LabelEffect}\n * @param {const cocos2d::Color3B&}\n */\nsetLabelEffect : function () {},\n\n/**\n * @method getCommonLineHeight\n * @return A value converted from C/C++ \"int\"\n */\ngetCommonLineHeight : function () {},\n\n/**\n * @method breakLineWithoutSpace\n * @return A value converted from C/C++ \"bool\"\n */\nbreakLineWithoutSpace : function () {},\n\n/**\n * @method setWidth\n * @param {float}\n */\nsetWidth : function () {},\n\n/**\n * @method getMaxLineWidth\n * @return A value converted from C/C++ \"float\"\n */\ngetMaxLineWidth : function () {},\n\n/**\n * @method getScaleY\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleY : function () {},\n\n/**\n * @method getScaleX\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleX : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method getKernings\n * @return A value converted from C/C++ \"int*\"\n */\ngetKernings : function () {},\n\n/**\n * @method setBMFontFilePath\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nsetBMFontFilePath : function () {},\n\n/**\n * @method recordPlaceholderInfo\n * @return A value converted from C/C++ \"bool\"\n * @param {int}\n */\nrecordPlaceholderInfo : function () {},\n\n/**\n * @method getFontAtlas\n * @return A value converted from C/C++ \"cocos2d::FontAtlas*\"\n */\ngetFontAtlas : function () {},\n\n/**\n * @method setLineBreakWithoutSpace\n * @param {bool}\n */\nsetLineBreakWithoutSpace : function () {},\n\n/**\n * @method getStringNumLines\n * @return A value converted from C/C++ \"int\"\n */\ngetStringNumLines : function () {},\n\n/**\n * @method getUTF16String\n * @return A value converted from C/C++ \"unsigned short*\"\n */\ngetUTF16String : function () {},\n\n/**\n * @method getStringLenght\n * @return A value converted from C/C++ \"int\"\n */\ngetStringLenght : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method getLetter\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {int}\n */\ngetLetter : function () {},\n\n/**\n * @method getTextAlignment\n * @return A value converted from C/C++ \"cocos2d::TextHAlignment\"\n */\ngetTextAlignment : function () {},\n\n/**\n * @method setAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetAlignment : function () {},\n\n/**\n * @method recordLetterInfo\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n * @param {unsigned short}\n * @param {int}\n */\nrecordLetterInfo : function () {},\n\n/**\n * @method createWithBMFont\n * @return A value converted from C/C++ \"cocos2d::Label*\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {const cocos2d::TextHAlignment&}\n * @param {int}\n */\ncreateWithBMFont : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Label*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Layer\n */\ncc.Layer = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Layer*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class LayerColor\n */\ncc.LayerColor = {\n\n/**\n * @method changeWidthAndHeight\n * @param {GLfloat}\n * @param {GLfloat}\n */\nchangeWidthAndHeight : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method changeWidth\n * @param {GLfloat}\n */\nchangeWidth : function () {},\n\n/**\n * @method changeHeight\n * @param {GLfloat}\n */\nchangeHeight : function () {},\n\n};\n\n/**\n * @class LayerGradient\n */\ncc.LayerGradient = {\n\n/**\n * @method getStartColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetStartColor : function () {},\n\n/**\n * @method isCompressedInterpolation\n * @return A value converted from C/C++ \"bool\"\n */\nisCompressedInterpolation : function () {},\n\n/**\n * @method getStartOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetStartOpacity : function () {},\n\n/**\n * @method setVector\n * @param {const cocos2d::Point&}\n */\nsetVector : function () {},\n\n/**\n * @method setStartOpacity\n * @param {GLubyte}\n */\nsetStartOpacity : function () {},\n\n/**\n * @method setCompressedInterpolation\n * @param {bool}\n */\nsetCompressedInterpolation : function () {},\n\n/**\n * @method setEndOpacity\n * @param {GLubyte}\n */\nsetEndOpacity : function () {},\n\n/**\n * @method getVector\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetVector : function () {},\n\n/**\n * @method setEndColor\n * @param {const cocos2d::Color3B&}\n */\nsetEndColor : function () {},\n\n/**\n * @method getEndColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetEndColor : function () {},\n\n/**\n * @method getEndOpacity\n * @return A value converted from C/C++ \"GLubyte\"\n */\ngetEndOpacity : function () {},\n\n/**\n * @method setStartColor\n * @param {const cocos2d::Color3B&}\n */\nsetStartColor : function () {},\n\n};\n\n/**\n * @class LayerMultiplex\n */\ncc.LayerMultiplex = {\n\n/**\n * @method switchToAndReleaseMe\n * @param {int}\n */\nswitchToAndReleaseMe : function () {},\n\n/**\n * @method addLayer\n * @param {cocos2d::Layer*}\n */\naddLayer : function () {},\n\n/**\n * @method switchTo\n * @param {int}\n */\nswitchTo : function () {},\n\n};\n\n/**\n * @class Scene\n */\ncc.Scene = {\n\n/**\n * @method getPhysicsWorld\n * @return A value converted from C/C++ \"cocos2d::PhysicsWorld*\"\n */\ngetPhysicsWorld : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithPhysics\n * @return A value converted from C/C++ \"cocos2d::Scene*\"\n */\ncreateWithPhysics : function () {},\n\n};\n\n/**\n * @class TransitionEaseScene\n */\ncc.TransitionEaseScene = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n};\n\n/**\n * @class TransitionScene\n */\ncc.TransitionScene = {\n\n/**\n * @method finish\n */\nfinish : function () {},\n\n/**\n * @method hideOutShowIn\n */\nhideOutShowIn : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionScene*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSceneOriented\n */\ncc.TransitionSceneOriented = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSceneOriented*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n * @param {cocos2d::TransitionScene::Orientation}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionRotoZoom\n */\ncc.TransitionRotoZoom = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionRotoZoom*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionJumpZoom\n */\ncc.TransitionJumpZoom = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionJumpZoom*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInL\n */\ncc.TransitionMoveInL = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInL*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInR\n */\ncc.TransitionMoveInR = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInR*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInT\n */\ncc.TransitionMoveInT = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInT*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionMoveInB\n */\ncc.TransitionMoveInB = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionMoveInB*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInL\n */\ncc.TransitionSlideInL = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInL*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInR\n */\ncc.TransitionSlideInR = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInR*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInB\n */\ncc.TransitionSlideInB = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInB*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSlideInT\n */\ncc.TransitionSlideInT = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSlideInT*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionShrinkGrow\n */\ncc.TransitionShrinkGrow = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionShrinkGrow*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFlipX\n */\ncc.TransitionFlipX = {\n\n};\n\n/**\n * @class TransitionFlipY\n */\ncc.TransitionFlipY = {\n\n};\n\n/**\n * @class TransitionFlipAngular\n */\ncc.TransitionFlipAngular = {\n\n};\n\n/**\n * @class TransitionZoomFlipX\n */\ncc.TransitionZoomFlipX = {\n\n};\n\n/**\n * @class TransitionZoomFlipY\n */\ncc.TransitionZoomFlipY = {\n\n};\n\n/**\n * @class TransitionZoomFlipAngular\n */\ncc.TransitionZoomFlipAngular = {\n\n};\n\n/**\n * @class TransitionFade\n */\ncc.TransitionFade = {\n\n};\n\n/**\n * @class TransitionCrossFade\n */\ncc.TransitionCrossFade = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionCrossFade*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionTurnOffTiles\n */\ncc.TransitionTurnOffTiles = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionTurnOffTiles*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSplitCols\n */\ncc.TransitionSplitCols = {\n\n/**\n * @method action\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n */\naction : function () {},\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSplitCols*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionSplitRows\n */\ncc.TransitionSplitRows = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionSplitRows*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeTR\n */\ncc.TransitionFadeTR = {\n\n/**\n * @method easeActionWithAction\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {cocos2d::ActionInterval*}\n */\neaseActionWithAction : function () {},\n\n/**\n * @method actionWithSize\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {const cocos2d::Size&}\n */\nactionWithSize : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeTR*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeBL\n */\ncc.TransitionFadeBL = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeBL*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeUp\n */\ncc.TransitionFadeUp = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeUp*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionFadeDown\n */\ncc.TransitionFadeDown = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionFadeDown*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionPageTurn\n */\ncc.TransitionPageTurn = {\n\n/**\n * @method actionWithSize\n * @return A value converted from C/C++ \"cocos2d::ActionInterval*\"\n * @param {const cocos2d::Size&}\n */\nactionWithSize : function () {},\n\n/**\n * @method initWithDuration\n * @return A value converted from C/C++ \"bool\"\n * @param {float}\n * @param {cocos2d::Scene*}\n * @param {bool}\n */\ninitWithDuration : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionPageTurn*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n * @param {bool}\n */\ncreate : function () {},\n\n/**\n * @method TransitionPageTurn\n * @constructor\n */\nTransitionPageTurn : function () {},\n\n};\n\n/**\n * @class TransitionProgress\n */\ncc.TransitionProgress = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgress*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n/**\n * @method TransitionProgress\n * @constructor\n */\nTransitionProgress : function () {},\n\n};\n\n/**\n * @class TransitionProgressRadialCCW\n */\ncc.TransitionProgressRadialCCW = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressRadialCCW*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressRadialCW\n */\ncc.TransitionProgressRadialCW = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressRadialCW*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressHorizontal\n */\ncc.TransitionProgressHorizontal = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressHorizontal*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressVertical\n */\ncc.TransitionProgressVertical = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressVertical*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressInOut\n */\ncc.TransitionProgressInOut = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressInOut*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TransitionProgressOutIn\n */\ncc.TransitionProgressOutIn = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TransitionProgressOutIn*\"\n * @param {float}\n * @param {cocos2d::Scene*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class MenuItem\n */\ncc.MenuItem = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method activate\n */\nactivate : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method selected\n */\nselected : function () {},\n\n/**\n * @method isSelected\n * @return A value converted from C/C++ \"bool\"\n */\nisSelected : function () {},\n\n/**\n * @method unselected\n */\nunselected : function () {},\n\n/**\n * @method rect\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\nrect : function () {},\n\n};\n\n/**\n * @class MenuItemLabel\n */\ncc.MenuItemLabel = {\n\n/**\n * @method getDisabledColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetDisabledColor : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method setLabel\n * @param {cocos2d::Node*}\n */\nsetLabel : function () {},\n\n/**\n * @method setDisabledColor\n * @param {const cocos2d::Color3B&}\n */\nsetDisabledColor : function () {},\n\n/**\n * @method getLabel\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetLabel : function () {},\n\n};\n\n/**\n * @class MenuItemAtlasFont\n */\ncc.MenuItemAtlasFont = {\n\n};\n\n/**\n * @class MenuItemFont\n */\ncc.MenuItemFont = {\n\n/**\n * @method getFontSizeObj\n * @return A value converted from C/C++ \"int\"\n */\ngetFontSizeObj : function () {},\n\n/**\n * @method getFontNameObj\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFontNameObj : function () {},\n\n/**\n * @method setFontSizeObj\n * @param {int}\n */\nsetFontSizeObj : function () {},\n\n/**\n * @method setFontNameObj\n * @param {const std::string&}\n */\nsetFontNameObj : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method getFontSize\n * @return A value converted from C/C++ \"int\"\n */\ngetFontSize : function () {},\n\n/**\n * @method getFontName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetFontName : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n};\n\n/**\n * @class MenuItemSprite\n */\ncc.MenuItemSprite = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method selected\n */\nselected : function () {},\n\n/**\n * @method setNormalImage\n * @param {cocos2d::Node*}\n */\nsetNormalImage : function () {},\n\n/**\n * @method setDisabledImage\n * @param {cocos2d::Node*}\n */\nsetDisabledImage : function () {},\n\n/**\n * @method setSelectedImage\n * @param {cocos2d::Node*}\n */\nsetSelectedImage : function () {},\n\n/**\n * @method getDisabledImage\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetDisabledImage : function () {},\n\n/**\n * @method getSelectedImage\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetSelectedImage : function () {},\n\n/**\n * @method getNormalImage\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetNormalImage : function () {},\n\n/**\n * @method unselected\n */\nunselected : function () {},\n\n};\n\n/**\n * @class MenuItemImage\n */\ncc.MenuItemImage = {\n\n/**\n * @method setDisabledSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetDisabledSpriteFrame : function () {},\n\n/**\n * @method setSelectedSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetSelectedSpriteFrame : function () {},\n\n/**\n * @method setNormalSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetNormalSpriteFrame : function () {},\n\n};\n\n/**\n * @class MenuItemToggle\n */\ncc.MenuItemToggle = {\n\n/**\n * @method setSubItems\n * @param {const cocos2d::Vector<cocos2d::MenuItem *>&}\n */\nsetSubItems : function () {},\n\n/**\n * @method getSelectedIndex\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetSelectedIndex : function () {},\n\n/**\n * @method addSubItem\n * @param {cocos2d::MenuItem*}\n */\naddSubItem : function () {},\n\n/**\n * @method getSelectedItem\n * @return A value converted from C/C++ \"cocos2d::MenuItem*\"\n */\ngetSelectedItem : function () {},\n\n/**\n * @method setSelectedIndex\n * @param {unsigned int}\n */\nsetSelectedIndex : function () {},\n\n};\n\n/**\n * @class Menu\n */\ncc.Menu = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method alignItemsVertically\n */\nalignItemsVertically : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method alignItemsHorizontallyWithPadding\n * @param {float}\n */\nalignItemsHorizontallyWithPadding : function () {},\n\n/**\n * @method alignItemsVerticallyWithPadding\n * @param {float}\n */\nalignItemsVerticallyWithPadding : function () {},\n\n/**\n * @method alignItemsHorizontally\n */\nalignItemsHorizontally : function () {},\n\n};\n\n/**\n * @class ClippingNode\n */\ncc.ClippingNode = {\n\n/**\n * @method isInverted\n * @return A value converted from C/C++ \"bool\"\n */\nisInverted : function () {},\n\n/**\n * @method setInverted\n * @param {bool}\n */\nsetInverted : function () {},\n\n/**\n * @method setStencil\n * @param {cocos2d::Node*}\n */\nsetStencil : function () {},\n\n/**\n * @method getAlphaThreshold\n * @return A value converted from C/C++ \"GLfloat\"\n */\ngetAlphaThreshold : function () {},\n\n/**\n * @method getStencil\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetStencil : function () {},\n\n/**\n * @method setAlphaThreshold\n * @param {GLfloat}\n */\nsetAlphaThreshold : function () {},\n\n};\n\n/**\n * @class MotionStreak\n */\ncc.MotionStreak = {\n\n/**\n * @method reset\n */\nreset : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method tintWithColor\n * @param {const cocos2d::Color3B&}\n */\ntintWithColor : function () {},\n\n/**\n * @method setStartingPositionInitialized\n * @param {bool}\n */\nsetStartingPositionInitialized : function () {},\n\n/**\n * @method isStartingPositionInitialized\n * @return A value converted from C/C++ \"bool\"\n */\nisStartingPositionInitialized : function () {},\n\n/**\n * @method isFastMode\n * @return A value converted from C/C++ \"bool\"\n */\nisFastMode : function () {},\n\n/**\n * @method setFastMode\n * @param {bool}\n */\nsetFastMode : function () {},\n\n};\n\n/**\n * @class ProgressTimer\n */\ncc.ProgressTimer = {\n\n/**\n * @method isReverseDirection\n * @return A value converted from C/C++ \"bool\"\n */\nisReverseDirection : function () {},\n\n/**\n * @method setBarChangeRate\n * @param {const cocos2d::Point&}\n */\nsetBarChangeRate : function () {},\n\n/**\n * @method getPercentage\n * @return A value converted from C/C++ \"float\"\n */\ngetPercentage : function () {},\n\n/**\n * @method setSprite\n * @param {cocos2d::Sprite*}\n */\nsetSprite : function () {},\n\n/**\n * @method getType\n * @return A value converted from C/C++ \"cocos2d::ProgressTimer::Type\"\n */\ngetType : function () {},\n\n/**\n * @method getSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSprite : function () {},\n\n/**\n * @method setMidpoint\n * @param {const cocos2d::Point&}\n */\nsetMidpoint : function () {},\n\n/**\n * @method getBarChangeRate\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetBarChangeRate : function () {},\n\n/**\n * @method getMidpoint\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetMidpoint : function () {},\n\n/**\n * @method setPercentage\n * @param {float}\n */\nsetPercentage : function () {},\n\n/**\n * @method setType\n * @param {cocos2d::ProgressTimer::Type}\n */\nsetType : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ProgressTimer*\"\n * @param {cocos2d::Sprite*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class Image\n */\ncc.Image = {\n\n/**\n * @method hasPremultipliedAlpha\n * @return A value converted from C/C++ \"bool\"\n */\nhasPremultipliedAlpha : function () {},\n\n/**\n * @method getDataLen\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetDataLen : function () {},\n\n/**\n * @method isCompressed\n * @return A value converted from C/C++ \"bool\"\n */\nisCompressed : function () {},\n\n/**\n * @method getBitPerPixel\n * @return A value converted from C/C++ \"int\"\n */\ngetBitPerPixel : function () {},\n\n/**\n * @method hasAlpha\n * @return A value converted from C/C++ \"bool\"\n */\nhasAlpha : function () {},\n\n/**\n * @method getHeight\n * @return A value converted from C/C++ \"int\"\n */\ngetHeight : function () {},\n\n/**\n * @method initWithImageFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\ninitWithImageFile : function () {},\n\n/**\n * @method getWidth\n * @return A value converted from C/C++ \"int\"\n */\ngetWidth : function () {},\n\n/**\n * @method isPremultipliedAlpha\n * @return A value converted from C/C++ \"bool\"\n */\nisPremultipliedAlpha : function () {},\n\n/**\n * @method getFileType\n * @return A value converted from C/C++ \"cocos2d::Image::Format\"\n */\ngetFileType : function () {},\n\n/**\n * @method saveToFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {bool}\n */\nsaveToFile : function () {},\n\n/**\n * @method getNumberOfMipmaps\n * @return A value converted from C/C++ \"int\"\n */\ngetNumberOfMipmaps : function () {},\n\n/**\n * @method getRenderFormat\n * @return A value converted from C/C++ \"cocos2d::Texture2D::PixelFormat\"\n */\ngetRenderFormat : function () {},\n\n/**\n * @method getData\n * @return A value converted from C/C++ \"unsigned char*\"\n */\ngetData : function () {},\n\n/**\n * @method getMipmaps\n * @return A value converted from C/C++ \"cocos2d::MipmapInfo*\"\n */\ngetMipmaps : function () {},\n\n/**\n * @method Image\n * @constructor\n */\nImage : function () {},\n\n};\n\n/**\n * @class RenderTexture\n */\ncc.RenderTexture = {\n\n/**\n * @method clearStencil\n * @param {int}\n */\nclearStencil : function () {},\n\n/**\n * @method getClearDepth\n * @return A value converted from C/C++ \"float\"\n */\ngetClearDepth : function () {},\n\n/**\n * @method getClearStencil\n * @return A value converted from C/C++ \"int\"\n */\ngetClearStencil : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method setClearStencil\n * @param {int}\n */\nsetClearStencil : function () {},\n\n/**\n * @method setSprite\n * @param {cocos2d::Sprite*}\n */\nsetSprite : function () {},\n\n/**\n * @method getSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSprite : function () {},\n\n/**\n * @method isAutoDraw\n * @return A value converted from C/C++ \"bool\"\n */\nisAutoDraw : function () {},\n\n/**\n * @method setClearFlags\n * @param {unsigned int}\n */\nsetClearFlags : function () {},\n\n/**\n * @method begin\n */\nbegin : function () {},\n\n/**\n * @method setAutoDraw\n * @param {bool}\n */\nsetAutoDraw : function () {},\n\n/**\n * @method setClearColor\n * @param {const cocos2d::Color4F&}\n */\nsetClearColor : function () {},\n\n/**\n * @method endToLua\n */\nendToLua : function () {},\n\n/**\n * @method clearDepth\n * @param {float}\n */\nclearDepth : function () {},\n\n/**\n * @method getClearColor\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetClearColor : function () {},\n\n/**\n * @method clear\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\nclear : function () {},\n\n/**\n * @method getClearFlags\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetClearFlags : function () {},\n\n/**\n * @method newImage\n * @return A value converted from C/C++ \"cocos2d::Image*\"\n */\nnewImage : function () {},\n\n/**\n * @method setClearDepth\n * @param {float}\n */\nsetClearDepth : function () {},\n\n/**\n * @method RenderTexture\n * @constructor\n */\nRenderTexture : function () {},\n\n};\n\n/**\n * @class NodeGrid\n */\ncc.NodeGrid = {\n\n/**\n * @method setTarget\n * @param {cocos2d::Node*}\n */\nsetTarget : function () {},\n\n/**\n * @method setGrid\n * @param {cocos2d::GridBase*}\n */\nsetGrid : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::NodeGrid*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ParticleBatchNode\n */\ncc.ParticleBatchNode = {\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method disableParticle\n * @param {int}\n */\ndisableParticle : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method setTextureAtlas\n * @param {cocos2d::TextureAtlas*}\n */\nsetTextureAtlas : function () {},\n\n/**\n * @method removeAllChildrenWithCleanup\n * @param {bool}\n */\nremoveAllChildrenWithCleanup : function () {},\n\n/**\n * @method getTextureAtlas\n * @return A value converted from C/C++ \"cocos2d::TextureAtlas*\"\n */\ngetTextureAtlas : function () {},\n\n/**\n * @method insertChild\n * @param {cocos2d::ParticleSystem*}\n * @param {int}\n */\ninsertChild : function () {},\n\n/**\n * @method visit\n */\nvisit : function () {},\n\n/**\n * @method removeChildAtIndex\n * @param {int}\n * @param {bool}\n */\nremoveChildAtIndex : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleBatchNode*\"\n * @param {const std::string&}\n * @param {int}\n */\ncreate : function () {},\n\n/**\n * @method createWithTexture\n * @return A value converted from C/C++ \"cocos2d::ParticleBatchNode*\"\n * @param {cocos2d::Texture2D*}\n * @param {int}\n */\ncreateWithTexture : function () {},\n\n};\n\n/**\n * @class ParticleSystem\n */\ncc.ParticleSystem = {\n\n/**\n * @method getStartSizeVar\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSizeVar : function () {},\n\n/**\n * @method getTexture\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n */\ngetTexture : function () {},\n\n/**\n * @method isFull\n * @return A value converted from C/C++ \"bool\"\n */\nisFull : function () {},\n\n/**\n * @method getBatchNode\n * @return A value converted from C/C++ \"cocos2d::ParticleBatchNode*\"\n */\ngetBatchNode : function () {},\n\n/**\n * @method getStartColor\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetStartColor : function () {},\n\n/**\n * @method getPositionType\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem::PositionType\"\n */\ngetPositionType : function () {},\n\n/**\n * @method setPosVar\n * @param {const cocos2d::Point&}\n */\nsetPosVar : function () {},\n\n/**\n * @method getEndSpin\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSpin : function () {},\n\n/**\n * @method setRotatePerSecondVar\n * @param {float}\n */\nsetRotatePerSecondVar : function () {},\n\n/**\n * @method getStartSpinVar\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSpinVar : function () {},\n\n/**\n * @method getRadialAccelVar\n * @return A value converted from C/C++ \"float\"\n */\ngetRadialAccelVar : function () {},\n\n/**\n * @method getEndSizeVar\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSizeVar : function () {},\n\n/**\n * @method setRotation\n * @param {float}\n */\nsetRotation : function () {},\n\n/**\n * @method setTangentialAccel\n * @param {float}\n */\nsetTangentialAccel : function () {},\n\n/**\n * @method setScaleY\n * @param {float}\n */\nsetScaleY : function () {},\n\n/**\n * @method setScaleX\n * @param {float}\n */\nsetScaleX : function () {},\n\n/**\n * @method getRadialAccel\n * @return A value converted from C/C++ \"float\"\n */\ngetRadialAccel : function () {},\n\n/**\n * @method setStartRadius\n * @param {float}\n */\nsetStartRadius : function () {},\n\n/**\n * @method setRotatePerSecond\n * @param {float}\n */\nsetRotatePerSecond : function () {},\n\n/**\n * @method setEndSize\n * @param {float}\n */\nsetEndSize : function () {},\n\n/**\n * @method getGravity\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetGravity : function () {},\n\n/**\n * @method getTangentialAccel\n * @return A value converted from C/C++ \"float\"\n */\ngetTangentialAccel : function () {},\n\n/**\n * @method setEndRadius\n * @param {float}\n */\nsetEndRadius : function () {},\n\n/**\n * @method getSpeed\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeed : function () {},\n\n/**\n * @method getAngle\n * @return A value converted from C/C++ \"float\"\n */\ngetAngle : function () {},\n\n/**\n * @method setEndColor\n * @param {const cocos2d::Color4F&}\n */\nsetEndColor : function () {},\n\n/**\n * @method setStartSpin\n * @param {float}\n */\nsetStartSpin : function () {},\n\n/**\n * @method setDuration\n * @param {float}\n */\nsetDuration : function () {},\n\n/**\n * @method setTexture\n * @param {cocos2d::Texture2D*}\n */\nsetTexture : function () {},\n\n/**\n * @method getPosVar\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPosVar : function () {},\n\n/**\n * @method updateWithNoTime\n */\nupdateWithNoTime : function () {},\n\n/**\n * @method isBlendAdditive\n * @return A value converted from C/C++ \"bool\"\n */\nisBlendAdditive : function () {},\n\n/**\n * @method getSpeedVar\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeedVar : function () {},\n\n/**\n * @method setPositionType\n * @param {cocos2d::ParticleSystem::PositionType}\n */\nsetPositionType : function () {},\n\n/**\n * @method stopSystem\n */\nstopSystem : function () {},\n\n/**\n * @method getSourcePosition\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetSourcePosition : function () {},\n\n/**\n * @method setLifeVar\n * @param {float}\n */\nsetLifeVar : function () {},\n\n/**\n * @method setTotalParticles\n * @param {int}\n */\nsetTotalParticles : function () {},\n\n/**\n * @method setEndColorVar\n * @param {const cocos2d::Color4F&}\n */\nsetEndColorVar : function () {},\n\n/**\n * @method updateQuadWithParticle\n * @param {cocos2d::tParticle*}\n * @param {const cocos2d::Point&}\n */\nupdateQuadWithParticle : function () {},\n\n/**\n * @method getAtlasIndex\n * @return A value converted from C/C++ \"int\"\n */\ngetAtlasIndex : function () {},\n\n/**\n * @method getStartSize\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSize : function () {},\n\n/**\n * @method setStartSpinVar\n * @param {float}\n */\nsetStartSpinVar : function () {},\n\n/**\n * @method resetSystem\n */\nresetSystem : function () {},\n\n/**\n * @method setAtlasIndex\n * @param {int}\n */\nsetAtlasIndex : function () {},\n\n/**\n * @method setTangentialAccelVar\n * @param {float}\n */\nsetTangentialAccelVar : function () {},\n\n/**\n * @method setEndRadiusVar\n * @param {float}\n */\nsetEndRadiusVar : function () {},\n\n/**\n * @method getEndRadius\n * @return A value converted from C/C++ \"float\"\n */\ngetEndRadius : function () {},\n\n/**\n * @method isOpacityModifyRGB\n * @return A value converted from C/C++ \"bool\"\n */\nisOpacityModifyRGB : function () {},\n\n/**\n * @method isActive\n * @return A value converted from C/C++ \"bool\"\n */\nisActive : function () {},\n\n/**\n * @method setRadialAccelVar\n * @param {float}\n */\nsetRadialAccelVar : function () {},\n\n/**\n * @method setStartSize\n * @param {float}\n */\nsetStartSize : function () {},\n\n/**\n * @method setSpeed\n * @param {float}\n */\nsetSpeed : function () {},\n\n/**\n * @method getStartSpin\n * @return A value converted from C/C++ \"float\"\n */\ngetStartSpin : function () {},\n\n/**\n * @method getRotatePerSecond\n * @return A value converted from C/C++ \"float\"\n */\ngetRotatePerSecond : function () {},\n\n/**\n * @method initParticle\n * @param {cocos2d::tParticle*}\n */\ninitParticle : function () {},\n\n/**\n * @method setEmitterMode\n * @param {cocos2d::ParticleSystem::Mode}\n */\nsetEmitterMode : function () {},\n\n/**\n * @method getDuration\n * @return A value converted from C/C++ \"float\"\n */\ngetDuration : function () {},\n\n/**\n * @method setSourcePosition\n * @param {const cocos2d::Point&}\n */\nsetSourcePosition : function () {},\n\n/**\n * @method getEndSpinVar\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSpinVar : function () {},\n\n/**\n * @method setBlendAdditive\n * @param {bool}\n */\nsetBlendAdditive : function () {},\n\n/**\n * @method setLife\n * @param {float}\n */\nsetLife : function () {},\n\n/**\n * @method setAngleVar\n * @param {float}\n */\nsetAngleVar : function () {},\n\n/**\n * @method setRotationIsDir\n * @param {bool}\n */\nsetRotationIsDir : function () {},\n\n/**\n * @method setEndSizeVar\n * @param {float}\n */\nsetEndSizeVar : function () {},\n\n/**\n * @method setAngle\n * @param {float}\n */\nsetAngle : function () {},\n\n/**\n * @method setBatchNode\n * @param {cocos2d::ParticleBatchNode*}\n */\nsetBatchNode : function () {},\n\n/**\n * @method getTangentialAccelVar\n * @return A value converted from C/C++ \"float\"\n */\ngetTangentialAccelVar : function () {},\n\n/**\n * @method getEmitterMode\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem::Mode\"\n */\ngetEmitterMode : function () {},\n\n/**\n * @method setEndSpinVar\n * @param {float}\n */\nsetEndSpinVar : function () {},\n\n/**\n * @method getAngleVar\n * @return A value converted from C/C++ \"float\"\n */\ngetAngleVar : function () {},\n\n/**\n * @method setStartColor\n * @param {const cocos2d::Color4F&}\n */\nsetStartColor : function () {},\n\n/**\n * @method getRotatePerSecondVar\n * @return A value converted from C/C++ \"float\"\n */\ngetRotatePerSecondVar : function () {},\n\n/**\n * @method getEndSize\n * @return A value converted from C/C++ \"float\"\n */\ngetEndSize : function () {},\n\n/**\n * @method getLife\n * @return A value converted from C/C++ \"float\"\n */\ngetLife : function () {},\n\n/**\n * @method setSpeedVar\n * @param {float}\n */\nsetSpeedVar : function () {},\n\n/**\n * @method setAutoRemoveOnFinish\n * @param {bool}\n */\nsetAutoRemoveOnFinish : function () {},\n\n/**\n * @method setGravity\n * @param {const cocos2d::Point&}\n */\nsetGravity : function () {},\n\n/**\n * @method postStep\n */\npostStep : function () {},\n\n/**\n * @method setEmissionRate\n * @param {float}\n */\nsetEmissionRate : function () {},\n\n/**\n * @method getEndColorVar\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetEndColorVar : function () {},\n\n/**\n * @method getRotationIsDir\n * @return A value converted from C/C++ \"bool\"\n */\ngetRotationIsDir : function () {},\n\n/**\n * @method setScale\n * @param {float}\n */\nsetScale : function () {},\n\n/**\n * @method getEmissionRate\n * @return A value converted from C/C++ \"float\"\n */\ngetEmissionRate : function () {},\n\n/**\n * @method getEndColor\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetEndColor : function () {},\n\n/**\n * @method getLifeVar\n * @return A value converted from C/C++ \"float\"\n */\ngetLifeVar : function () {},\n\n/**\n * @method setStartSizeVar\n * @param {float}\n */\nsetStartSizeVar : function () {},\n\n/**\n * @method setOpacityModifyRGB\n * @param {bool}\n */\nsetOpacityModifyRGB : function () {},\n\n/**\n * @method addParticle\n * @return A value converted from C/C++ \"bool\"\n */\naddParticle : function () {},\n\n/**\n * @method getStartRadius\n * @return A value converted from C/C++ \"float\"\n */\ngetStartRadius : function () {},\n\n/**\n * @method getParticleCount\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetParticleCount : function () {},\n\n/**\n * @method getStartRadiusVar\n * @return A value converted from C/C++ \"float\"\n */\ngetStartRadiusVar : function () {},\n\n/**\n * @method setStartColorVar\n * @param {const cocos2d::Color4F&}\n */\nsetStartColorVar : function () {},\n\n/**\n * @method setEndSpin\n * @param {float}\n */\nsetEndSpin : function () {},\n\n/**\n * @method setRadialAccel\n * @param {float}\n */\nsetRadialAccel : function () {},\n\n/**\n * @method isAutoRemoveOnFinish\n * @return A value converted from C/C++ \"bool\"\n */\nisAutoRemoveOnFinish : function () {},\n\n/**\n * @method getTotalParticles\n * @return A value converted from C/C++ \"int\"\n */\ngetTotalParticles : function () {},\n\n/**\n * @method setStartRadiusVar\n * @param {float}\n */\nsetStartRadiusVar : function () {},\n\n/**\n * @method getEndRadiusVar\n * @return A value converted from C/C++ \"float\"\n */\ngetEndRadiusVar : function () {},\n\n/**\n * @method getStartColorVar\n * @return A value converted from C/C++ \"const cocos2d::Color4F&\"\n */\ngetStartColorVar : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem*\"\n * @param {const std::string&}\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSystem*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSystemQuad\n */\ncc.ParticleSystem = {\n\n/**\n * @method setDisplayFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetDisplayFrame : function () {},\n\n/**\n * @method setTextureWithRect\n * @param {cocos2d::Texture2D*}\n * @param {const cocos2d::Rect&}\n */\nsetTextureWithRect : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSystemQuad*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleFire\n */\ncc.ParticleFire = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleFire*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleFire*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleFireworks\n */\ncc.ParticleFireworks = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleFireworks*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleFireworks*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSun\n */\ncc.ParticleSun = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSun*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSun*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleGalaxy\n */\ncc.ParticleGalaxy = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleGalaxy*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleGalaxy*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleFlower\n */\ncc.ParticleFlower = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleFlower*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleFlower*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleMeteor\n */\ncc.ParticleMeteor = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleMeteor*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleMeteor*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSpiral\n */\ncc.ParticleSpiral = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSpiral*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSpiral*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleExplosion\n */\ncc.ParticleExplosion = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleExplosion*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleExplosion*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSmoke\n */\ncc.ParticleSmoke = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSmoke*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSmoke*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleSnow\n */\ncc.ParticleSnow = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleSnow*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleSnow*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class ParticleRain\n */\ncc.ParticleRain = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParticleRain*\"\n */\ncreate : function () {},\n\n/**\n * @method createWithTotalParticles\n * @return A value converted from C/C++ \"cocos2d::ParticleRain*\"\n * @param {int}\n */\ncreateWithTotalParticles : function () {},\n\n};\n\n/**\n * @class EventListenerCustom\n */\ncc.EventListenerCustom = {\n\n};\n\n/**\n * @class FileUtils\n */\ncc.FileUtils = {\n\n/**\n * @method fullPathForFilename\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n */\nfullPathForFilename : function () {},\n\n/**\n * @method getStringFromFile\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n */\ngetStringFromFile : function () {},\n\n/**\n * @method setFilenameLookupDictionary\n * @param {const cocos2d::ValueMap&}\n */\nsetFilenameLookupDictionary : function () {},\n\n/**\n * @method isAbsolutePath\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nisAbsolutePath : function () {},\n\n/**\n * @method loadFilenameLookupDictionaryFromFile\n * @param {const std::string&}\n */\nloadFilenameLookupDictionaryFromFile : function () {},\n\n/**\n * @method isPopupNotify\n * @return A value converted from C/C++ \"bool\"\n */\nisPopupNotify : function () {},\n\n/**\n * @method getValueVectorFromFile\n * @return A value converted from C/C++ \"cocos2d::ValueVector\"\n * @param {const std::string&}\n */\ngetValueVectorFromFile : function () {},\n\n/**\n * @method writeToFile\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::ValueMap&}\n * @param {const std::string&}\n */\nwriteToFile : function () {},\n\n/**\n * @method getValueMapFromFile\n * @return A value converted from C/C++ \"cocos2d::ValueMap\"\n * @param {const std::string&}\n */\ngetValueMapFromFile : function () {},\n\n/**\n * @method addSearchResolutionsOrder\n * @param {const std::string&}\n */\naddSearchResolutionsOrder : function () {},\n\n/**\n * @method addSearchPath\n * @param {const std::string&}\n */\naddSearchPath : function () {},\n\n/**\n * @method isFileExist\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nisFileExist : function () {},\n\n/**\n * @method purgeCachedEntries\n */\npurgeCachedEntries : function () {},\n\n/**\n * @method fullPathFromRelativeFile\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\nfullPathFromRelativeFile : function () {},\n\n/**\n * @method setPopupNotify\n * @param {bool}\n */\nsetPopupNotify : function () {},\n\n/**\n * @method getWritablePath\n * @return A value converted from C/C++ \"std::string\"\n */\ngetWritablePath : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::FileUtils*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class Application\n */\ncc.Application = {\n\n/**\n * @method getTargetPlatform\n * @return A value converted from C/C++ \"cocos2d::ApplicationProtocol::Platform\"\n */\ngetTargetPlatform : function () {},\n\n/**\n * @method setAnimationInterval\n * @param {double}\n */\nsetAnimationInterval : function () {},\n\n/**\n * @method getCurrentLanguage\n * @return A value converted from C/C++ \"cocos2d::LanguageType\"\n */\ngetCurrentLanguage : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::Application*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class EGLViewProtocol\n */\ncc.EGLViewProtocol = {\n\n/**\n * @method setFrameSize\n * @param {float}\n * @param {float}\n */\nsetFrameSize : function () {},\n\n/**\n * @method swapBuffers\n */\nswapBuffers : function () {},\n\n/**\n * @method getViewPortRect\n * @return A value converted from C/C++ \"const cocos2d::Rect&\"\n */\ngetViewPortRect : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method setViewName\n * @param {const std::string&}\n */\nsetViewName : function () {},\n\n/**\n * @method getScaleY\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleY : function () {},\n\n/**\n * @method getScaleX\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleX : function () {},\n\n/**\n * @method getVisibleOrigin\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetVisibleOrigin : function () {},\n\n/**\n * @method getViewName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetViewName : function () {},\n\n/**\n * @method getVisibleSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetVisibleSize : function () {},\n\n/**\n * @method isScissorEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisScissorEnabled : function () {},\n\n/**\n * @method setIMEKeyboardState\n * @param {bool}\n */\nsetIMEKeyboardState : function () {},\n\n/**\n * @method setDesignResolutionSize\n * @param {float}\n * @param {float}\n * @param {ResolutionPolicy}\n */\nsetDesignResolutionSize : function () {},\n\n/**\n * @method getDesignResolutionSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetDesignResolutionSize : function () {},\n\n/**\n * @method setViewPortInPoints\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\nsetViewPortInPoints : function () {},\n\n/**\n * @method setScissorInPoints\n * @param {float}\n * @param {float}\n * @param {float}\n * @param {float}\n */\nsetScissorInPoints : function () {},\n\n/**\n * @method getFrameSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetFrameSize : function () {},\n\n/**\n * @method getScissorRect\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\ngetScissorRect : function () {},\n\n/**\n * @method isOpenGLReady\n * @return A value converted from C/C++ \"bool\"\n */\nisOpenGLReady : function () {},\n\n/**\n * @method pollInputEvents\n */\npollInputEvents : function () {},\n\n};\n\n/**\n * @class EGLView\n */\ncc.EGLView = {\n\n/**\n * @method setIMEKeyboardState\n * @param {bool}\n */\nsetIMEKeyboardState : function () {},\n\n/**\n * @method isOpenGLReady\n * @return A value converted from C/C++ \"bool\"\n */\nisOpenGLReady : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::EGLView*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class ShaderCache\n */\ncc.ShaderCache = {\n\n/**\n * @method reloadDefaultShaders\n */\nreloadDefaultShaders : function () {},\n\n/**\n * @method addProgram\n * @param {cocos2d::GLProgram*}\n * @param {const std::string&}\n */\naddProgram : function () {},\n\n/**\n * @method getProgram\n * @return A value converted from C/C++ \"cocos2d::GLProgram*\"\n * @param {const std::string&}\n */\ngetProgram : function () {},\n\n/**\n * @method loadDefaultShaders\n */\nloadDefaultShaders : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::ShaderCache*\"\n */\ngetInstance : function () {},\n\n/**\n * @method ShaderCache\n * @constructor\n */\nShaderCache : function () {},\n\n};\n\n/**\n * @class AnimationCache\n */\ncc.AnimationCache = {\n\n/**\n * @method getAnimation\n * @return A value converted from C/C++ \"cocos2d::Animation*\"\n * @param {const std::string&}\n */\ngetAnimation : function () {},\n\n/**\n * @method addAnimation\n * @param {cocos2d::Animation*}\n * @param {const std::string&}\n */\naddAnimation : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method addAnimationsWithDictionary\n * @param {const cocos2d::ValueMap&}\n * @param {const std::string&}\n */\naddAnimationsWithDictionary : function () {},\n\n/**\n * @method removeAnimation\n * @param {const std::string&}\n */\nremoveAnimation : function () {},\n\n/**\n * @method addAnimationsWithFile\n * @param {const std::string&}\n */\naddAnimationsWithFile : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::AnimationCache*\"\n */\ngetInstance : function () {},\n\n/**\n * @method AnimationCache\n * @constructor\n */\nAnimationCache : function () {},\n\n};\n\n/**\n * @class SpriteFrameCache\n */\ncc.SpriteFrameCache = {\n\n/**\n * @method addSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n * @param {const std::string&}\n */\naddSpriteFrame : function () {},\n\n/**\n * @method removeUnusedSpriteFrames\n */\nremoveUnusedSpriteFrames : function () {},\n\n/**\n * @method getSpriteFrameByName\n * @return A value converted from C/C++ \"cocos2d::SpriteFrame*\"\n * @param {const std::string&}\n */\ngetSpriteFrameByName : function () {},\n\n/**\n * @method removeSpriteFramesFromFile\n * @param {const std::string&}\n */\nremoveSpriteFramesFromFile : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method removeSpriteFrames\n */\nremoveSpriteFrames : function () {},\n\n/**\n * @method removeSpriteFramesFromTexture\n * @param {cocos2d::Texture2D*}\n */\nremoveSpriteFramesFromTexture : function () {},\n\n/**\n * @method removeSpriteFrameByName\n * @param {const std::string&}\n */\nremoveSpriteFrameByName : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::SpriteFrameCache*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class UserDefault\n */\ncc.UserDefault = {\n\n/**\n * @method setIntegerForKey\n * @param {const char*}\n * @param {int}\n */\nsetIntegerForKey : function () {},\n\n/**\n * @method setDoubleForKey\n * @param {const char*}\n * @param {double}\n */\nsetDoubleForKey : function () {},\n\n/**\n * @method setFloatForKey\n * @param {const char*}\n * @param {float}\n */\nsetFloatForKey : function () {},\n\n/**\n * @method setStringForKey\n * @param {const char*}\n * @param {const std::string&}\n */\nsetStringForKey : function () {},\n\n/**\n * @method flush\n */\nflush : function () {},\n\n/**\n * @method setBoolForKey\n * @param {const char*}\n * @param {bool}\n */\nsetBoolForKey : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getXMLFilePath\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetXMLFilePath : function () {},\n\n/**\n * @method isXMLFileExist\n * @return A value converted from C/C++ \"bool\"\n */\nisXMLFileExist : function () {},\n\n};\n\n/**\n * @class TextureCache\n */\ncc.TextureCache = {\n\n/**\n * @method removeTextureForKey\n * @param {const std::string&}\n */\nremoveTextureForKey : function () {},\n\n/**\n * @method removeAllTextures\n */\nremoveAllTextures : function () {},\n\n/**\n * @method getDescription\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDescription : function () {},\n\n/**\n * @method getCachedTextureInfo\n * @return A value converted from C/C++ \"std::string\"\n */\ngetCachedTextureInfo : function () {},\n\n/**\n * @method getTextureForKey\n * @return A value converted from C/C++ \"cocos2d::Texture2D*\"\n * @param {const std::string&}\n */\ngetTextureForKey : function () {},\n\n/**\n * @method removeUnusedTextures\n */\nremoveUnusedTextures : function () {},\n\n/**\n * @method removeTexture\n * @param {cocos2d::Texture2D*}\n */\nremoveTexture : function () {},\n\n/**\n * @method waitForQuit\n */\nwaitForQuit : function () {},\n\n/**\n * @method TextureCache\n * @constructor\n */\nTextureCache : function () {},\n\n};\n\n/**\n * @class ParallaxNode\n */\ncc.ParallaxNode = {\n\n/**\n * @method addChild\n * @param {cocos2d::Node*}\n * @param {int}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n */\naddChild : function () {},\n\n/**\n * @method removeAllChildrenWithCleanup\n * @param {bool}\n */\nremoveAllChildrenWithCleanup : function () {},\n\n/**\n * @method setParallaxArray\n * @param {cocos2d::_ccArray*}\n */\nsetParallaxArray : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::ParallaxNode*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class TMXObjectGroup\n */\ncc.TMXObjectGroup = {\n\n/**\n * @method setPositionOffset\n * @param {const cocos2d::Point&}\n */\nsetPositionOffset : function () {},\n\n/**\n * @method getProperty\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {const std::string&}\n */\ngetProperty : function () {},\n\n/**\n * @method getPositionOffset\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPositionOffset : function () {},\n\n/**\n * @method getObject\n * @return A value converted from C/C++ \"cocos2d::ValueMap\"\n * @param {const std::string&}\n */\ngetObject : function () {},\n\n/**\n * @method setGroupName\n * @param {const std::string&}\n */\nsetGroupName : function () {},\n\n/**\n * @method getGroupName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetGroupName : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method setObjects\n * @param {const cocos2d::ValueVector&}\n */\nsetObjects : function () {},\n\n/**\n * @method TMXObjectGroup\n * @constructor\n */\nTMXObjectGroup : function () {},\n\n};\n\n/**\n * @class TMXLayerInfo\n */\ncc.TMXLayerInfo = {\n\n/**\n * @method setProperties\n * @param {cocos2d::ValueMap}\n */\nsetProperties : function () {},\n\n/**\n * @method getProperties\n * @return A value converted from C/C++ \"cocos2d::ValueMap&\"\n */\ngetProperties : function () {},\n\n/**\n * @method TMXLayerInfo\n * @constructor\n */\nTMXLayerInfo : function () {},\n\n};\n\n/**\n * @class TMXTilesetInfo\n */\ncc.TMXTilesetInfo = {\n\n/**\n * @method rectForGID\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n * @param {int}\n */\nrectForGID : function () {},\n\n/**\n * @method TMXTilesetInfo\n * @constructor\n */\nTMXTilesetInfo : function () {},\n\n};\n\n/**\n * @class TMXMapInfo\n */\ncc.TMXMapInfo = {\n\n/**\n * @method setObjectGroups\n * @param {const cocos2d::Vector<cocos2d::TMXObjectGroup *>&}\n */\nsetObjectGroups : function () {},\n\n/**\n * @method setTileSize\n * @param {const cocos2d::Size&}\n */\nsetTileSize : function () {},\n\n/**\n * @method initWithTMXFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\ninitWithTMXFile : function () {},\n\n/**\n * @method getOrientation\n * @return A value converted from C/C++ \"int\"\n */\ngetOrientation : function () {},\n\n/**\n * @method isStoringCharacters\n * @return A value converted from C/C++ \"bool\"\n */\nisStoringCharacters : function () {},\n\n/**\n * @method setLayers\n * @param {const cocos2d::Vector<cocos2d::TMXLayerInfo *>&}\n */\nsetLayers : function () {},\n\n/**\n * @method parseXMLFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nparseXMLFile : function () {},\n\n/**\n * @method getParentElement\n * @return A value converted from C/C++ \"int\"\n */\ngetParentElement : function () {},\n\n/**\n * @method setTMXFileName\n * @param {const std::string&}\n */\nsetTMXFileName : function () {},\n\n/**\n * @method parseXMLString\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nparseXMLString : function () {},\n\n/**\n * @method getParentGID\n * @return A value converted from C/C++ \"int\"\n */\ngetParentGID : function () {},\n\n/**\n * @method setParentElement\n * @param {int}\n */\nsetParentElement : function () {},\n\n/**\n * @method initWithXML\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ninitWithXML : function () {},\n\n/**\n * @method setParentGID\n * @param {int}\n */\nsetParentGID : function () {},\n\n/**\n * @method getLayerAttribs\n * @return A value converted from C/C++ \"int\"\n */\ngetLayerAttribs : function () {},\n\n/**\n * @method getTileSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetTileSize : function () {},\n\n/**\n * @method getTileProperties\n * @return A value converted from C/C++ \"cocos2d::ValueMapIntKey&\"\n */\ngetTileProperties : function () {},\n\n/**\n * @method getTMXFileName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetTMXFileName : function () {},\n\n/**\n * @method setCurrentString\n * @param {const std::string&}\n */\nsetCurrentString : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method setOrientation\n * @param {int}\n */\nsetOrientation : function () {},\n\n/**\n * @method setTileProperties\n * @param {const cocos2d::ValueMapIntKey&}\n */\nsetTileProperties : function () {},\n\n/**\n * @method setMapSize\n * @param {const cocos2d::Size&}\n */\nsetMapSize : function () {},\n\n/**\n * @method setStoringCharacters\n * @param {bool}\n */\nsetStoringCharacters : function () {},\n\n/**\n * @method getMapSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetMapSize : function () {},\n\n/**\n * @method setTilesets\n * @param {const cocos2d::Vector<cocos2d::TMXTilesetInfo *>&}\n */\nsetTilesets : function () {},\n\n/**\n * @method getCurrentString\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetCurrentString : function () {},\n\n/**\n * @method setLayerAttribs\n * @param {int}\n */\nsetLayerAttribs : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TMXMapInfo*\"\n * @param {const std::string&}\n */\ncreate : function () {},\n\n/**\n * @method createWithXML\n * @return A value converted from C/C++ \"cocos2d::TMXMapInfo*\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ncreateWithXML : function () {},\n\n/**\n * @method TMXMapInfo\n * @constructor\n */\nTMXMapInfo : function () {},\n\n};\n\n/**\n * @class TMXLayer\n */\ncc.TMXLayer = {\n\n/**\n * @method getTileGIDAt\n * @return A value converted from C/C++ \"int\"\n * @param {const cocos2d::Point&}\n * @param {cocos2d::ccTMXTileFlags*}\n */\ngetTileGIDAt : function () {},\n\n/**\n * @method getPositionAt\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\ngetPositionAt : function () {},\n\n/**\n * @method setLayerOrientation\n * @param {int}\n */\nsetLayerOrientation : function () {},\n\n/**\n * @method releaseMap\n */\nreleaseMap : function () {},\n\n/**\n * @method setTiles\n * @param {int*}\n */\nsetTiles : function () {},\n\n/**\n * @method getLayerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetLayerSize : function () {},\n\n/**\n * @method setMapTileSize\n * @param {const cocos2d::Size&}\n */\nsetMapTileSize : function () {},\n\n/**\n * @method getLayerOrientation\n * @return A value converted from C/C++ \"int\"\n */\ngetLayerOrientation : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method setLayerName\n * @param {const std::string&}\n */\nsetLayerName : function () {},\n\n/**\n * @method removeTileAt\n * @param {const cocos2d::Point&}\n */\nremoveTileAt : function () {},\n\n/**\n * @method initWithTilesetInfo\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::TMXTilesetInfo*}\n * @param {cocos2d::TMXLayerInfo*}\n * @param {cocos2d::TMXMapInfo*}\n */\ninitWithTilesetInfo : function () {},\n\n/**\n * @method setupTiles\n */\nsetupTiles : function () {},\n\n/**\n * @method getMapTileSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetMapTileSize : function () {},\n\n/**\n * @method getProperty\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {const std::string&}\n */\ngetProperty : function () {},\n\n/**\n * @method setLayerSize\n * @param {const cocos2d::Size&}\n */\nsetLayerSize : function () {},\n\n/**\n * @method getLayerName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetLayerName : function () {},\n\n/**\n * @method setTileSet\n * @param {cocos2d::TMXTilesetInfo*}\n */\nsetTileSet : function () {},\n\n/**\n * @method getTileSet\n * @return A value converted from C/C++ \"cocos2d::TMXTilesetInfo*\"\n */\ngetTileSet : function () {},\n\n/**\n * @method getTileAt\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n * @param {const cocos2d::Point&}\n */\ngetTileAt : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TMXLayer*\"\n * @param {cocos2d::TMXTilesetInfo*}\n * @param {cocos2d::TMXLayerInfo*}\n * @param {cocos2d::TMXMapInfo*}\n */\ncreate : function () {},\n\n/**\n * @method TMXLayer\n * @constructor\n */\nTMXLayer : function () {},\n\n};\n\n/**\n * @class TMXTiledMap\n */\ncc.TMXTiledMap = {\n\n/**\n * @method setObjectGroups\n * @param {const cocos2d::Vector<cocos2d::TMXObjectGroup *>&}\n */\nsetObjectGroups : function () {},\n\n/**\n * @method getProperty\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {const std::string&}\n */\ngetProperty : function () {},\n\n/**\n * @method setMapSize\n * @param {const cocos2d::Size&}\n */\nsetMapSize : function () {},\n\n/**\n * @method getObjectGroup\n * @return A value converted from C/C++ \"cocos2d::TMXObjectGroup*\"\n * @param {const std::string&}\n */\ngetObjectGroup : function () {},\n\n/**\n * @method getTileSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetTileSize : function () {},\n\n/**\n * @method getMapSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetMapSize : function () {},\n\n/**\n * @method getProperties\n * @return A value converted from C/C++ \"cocos2d::ValueMap&\"\n */\ngetProperties : function () {},\n\n/**\n * @method getPropertiesForGID\n * @return A value converted from C/C++ \"cocos2d::Value\"\n * @param {int}\n */\ngetPropertiesForGID : function () {},\n\n/**\n * @method setTileSize\n * @param {const cocos2d::Size&}\n */\nsetTileSize : function () {},\n\n/**\n * @method setProperties\n * @param {const cocos2d::ValueMap&}\n */\nsetProperties : function () {},\n\n/**\n * @method getLayer\n * @return A value converted from C/C++ \"cocos2d::TMXLayer*\"\n * @param {const std::string&}\n */\ngetLayer : function () {},\n\n/**\n * @method getMapOrientation\n * @return A value converted from C/C++ \"int\"\n */\ngetMapOrientation : function () {},\n\n/**\n * @method setMapOrientation\n * @param {int}\n */\nsetMapOrientation : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TMXTiledMap*\"\n * @param {const std::string&}\n */\ncreate : function () {},\n\n/**\n * @method createWithXML\n * @return A value converted from C/C++ \"cocos2d::TMXTiledMap*\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ncreateWithXML : function () {},\n\n};\n\n/**\n * @class TileMapAtlas\n */\ncc.TileMapAtlas = {\n\n/**\n * @method initWithTileFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n */\ninitWithTileFile : function () {},\n\n/**\n * @method releaseMap\n */\nreleaseMap : function () {},\n\n/**\n * @method getTGAInfo\n * @return A value converted from C/C++ \"cocos2d::sImageTGA*\"\n */\ngetTGAInfo : function () {},\n\n/**\n * @method getTileAt\n * @return A value converted from C/C++ \"cocos2d::Color3B\"\n * @param {const cocos2d::Point&}\n */\ngetTileAt : function () {},\n\n/**\n * @method setTile\n * @param {const cocos2d::Color3B&}\n * @param {const cocos2d::Point&}\n */\nsetTile : function () {},\n\n/**\n * @method setTGAInfo\n * @param {cocos2d::sImageTGA*}\n */\nsetTGAInfo : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::TileMapAtlas*\"\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n */\ncreate : function () {},\n\n/**\n * @method TileMapAtlas\n * @constructor\n */\nTileMapAtlas : function () {},\n\n};\n\n/**\n * @class EventListenerTouchOneByOne\n */\ncc.EventListenerTouchOneByOne = {\n\n/**\n * @method setSwallowTouches\n * @param {bool}\n */\nsetSwallowTouches : function () {},\n\n};\n\n/**\n * @class EventListenerTouchAllAtOnce\n */\ncc.EventListenerTouchAllAtOnce = {\n\n};\n\n/**\n * @class EventListenerKeyboard\n */\ncc.EventListenerKeyboard = {\n\n};\n\n/**\n * @class EventMouse\n */\ncc.EventMouse = {\n\n/**\n * @method getMouseButton\n * @return A value converted from C/C++ \"int\"\n */\ngetMouseButton : function () {},\n\n/**\n * @method setScrollData\n * @param {float}\n * @param {float}\n */\nsetScrollData : function () {},\n\n/**\n * @method setMouseButton\n * @param {int}\n */\nsetMouseButton : function () {},\n\n/**\n * @method getScrollY\n * @return A value converted from C/C++ \"float\"\n */\ngetScrollY : function () {},\n\n/**\n * @method getScrollX\n * @return A value converted from C/C++ \"float\"\n */\ngetScrollX : function () {},\n\n/**\n * @method getCursorX\n * @return A value converted from C/C++ \"float\"\n */\ngetCursorX : function () {},\n\n/**\n * @method getCursorY\n * @return A value converted from C/C++ \"float\"\n */\ngetCursorY : function () {},\n\n/**\n * @method setCursorPosition\n * @param {float}\n * @param {float}\n */\nsetCursorPosition : function () {},\n\n/**\n * @method EventMouse\n * @constructor\n * @param {cocos2d::EventMouse::MouseEventType}\n */\nEventMouse : function () {},\n\n};\n\n/**\n * @class EventListenerMouse\n */\ncc.EventListenerMouse = {\n\n};\n\n/**\n * @class EventAcceleration\n */\ncc.EventAcceleration = {\n\n};\n\n/**\n * @class EventListenerAcceleration\n */\ncc.EventListenerAcceleration = {\n\n};\n\n/**\n * @class EventCustom\n */\ncc.EventCustom = {\n\n/**\n * @method getEventName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetEventName : function () {},\n\n/**\n * @method setUserData\n * @param {void*}\n */\nsetUserData : function () {},\n\n/**\n * @method getUserData\n * @return A value converted from C/C++ \"void*\"\n */\ngetUserData : function () {},\n\n/**\n * @method EventCustom\n * @constructor\n * @param {const std::string&}\n */\nEventCustom : function () {},\n\n};\n\n/**\n * @class Timer\n */\ncc.Timer = {\n\n/**\n * @method getInterval\n * @return A value converted from C/C++ \"float\"\n */\ngetInterval : function () {},\n\n/**\n * @method setInterval\n * @param {float}\n */\nsetInterval : function () {},\n\n/**\n * @method initWithScriptHandler\n * @return A value converted from C/C++ \"bool\"\n * @param {int}\n * @param {float}\n */\ninitWithScriptHandler : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method getScriptHandler\n * @return A value converted from C/C++ \"int\"\n */\ngetScriptHandler : function () {},\n\n/**\n * @method Timer\n * @constructor\n */\nTimer : function () {},\n\n};\n\n/**\n * @class Scheduler\n */\ncc.Scheduler = {\n\n/**\n * @method setTimeScale\n * @param {float}\n */\nsetTimeScale : function () {},\n\n/**\n * @method performFunctionInCocosThread\n * @param {const std::function<void ()>&}\n */\nperformFunctionInCocosThread : function () {},\n\n/**\n * @method getTimeScale\n * @return A value converted from C/C++ \"float\"\n */\ngetTimeScale : function () {},\n\n/**\n * @method Scheduler\n * @constructor\n */\nScheduler : function () {},\n\n};\n\n/**\n * @class Component\n */\ncc.Component = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method setName\n * @param {const std::string&}\n */\nsetName : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method serialize\n * @return A value converted from C/C++ \"bool\"\n * @param {void*}\n */\nserialize : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method getOwner\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetOwner : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setOwner\n * @param {cocos2d::Node*}\n */\nsetOwner : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetName : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::Component*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class SimpleAudioEngine\n */\ncc.AudioEngine = {\n\n/**\n * @method preloadBackgroundMusic\n * @param {const char*}\n */\npreloadBackgroundMusic : function () {},\n\n/**\n * @method stopBackgroundMusic\n */\nstopBackgroundMusic : function () {},\n\n/**\n * @method stopAllEffects\n */\nstopAllEffects : function () {},\n\n/**\n * @method getBackgroundMusicVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetBackgroundMusicVolume : function () {},\n\n/**\n * @method resumeBackgroundMusic\n */\nresumeBackgroundMusic : function () {},\n\n/**\n * @method setBackgroundMusicVolume\n * @param {float}\n */\nsetBackgroundMusicVolume : function () {},\n\n/**\n * @method preloadEffect\n * @param {const char*}\n */\npreloadEffect : function () {},\n\n/**\n * @method isBackgroundMusicPlaying\n * @return A value converted from C/C++ \"bool\"\n */\nisBackgroundMusicPlaying : function () {},\n\n/**\n * @method getEffectsVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetEffectsVolume : function () {},\n\n/**\n * @method willPlayBackgroundMusic\n * @return A value converted from C/C++ \"bool\"\n */\nwillPlayBackgroundMusic : function () {},\n\n/**\n * @method pauseEffect\n * @param {unsigned int}\n */\npauseEffect : function () {},\n\n/**\n * @method playEffect\n * @return A value converted from C/C++ \"unsigned int\"\n * @param {const char*}\n * @param {bool}\n * @param {float}\n * @param {float}\n * @param {float}\n */\nplayEffect : function () {},\n\n/**\n * @method rewindBackgroundMusic\n */\nrewindBackgroundMusic : function () {},\n\n/**\n * @method playBackgroundMusic\n * @param {const char*}\n * @param {bool}\n */\nplayBackgroundMusic : function () {},\n\n/**\n * @method resumeAllEffects\n */\nresumeAllEffects : function () {},\n\n/**\n * @method setEffectsVolume\n * @param {float}\n */\nsetEffectsVolume : function () {},\n\n/**\n * @method stopEffect\n * @param {unsigned int}\n */\nstopEffect : function () {},\n\n/**\n * @method pauseBackgroundMusic\n */\npauseBackgroundMusic : function () {},\n\n/**\n * @method pauseAllEffects\n */\npauseAllEffects : function () {},\n\n/**\n * @method unloadEffect\n * @param {const char*}\n */\nunloadEffect : function () {},\n\n/**\n * @method resumeEffect\n * @param {unsigned int}\n */\nresumeEffect : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"CocosDenshion::SimpleAudioEngine*\"\n */\ngetInstance : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp",
    "content": "#include \"lua_cocos2dx_extension_auto.hpp\"\n#include \"cocos-ext.h\"\n#include \"CocosBuilder.h\"\n#include \"tolua_fix.h\"\n#include \"LuaBasicConversions.h\"\n\n\n\nint lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::extension::Scale9Sprite* ret = cobj->resizableSpriteWithCapInsets(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resizableSpriteWithCapInsets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_setInsetBottom(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetBottom'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInsetBottom(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInsetBottom\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetBottom'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSpriteFrameName(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSpriteFrameName(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithSpriteFrameName\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_setInsetTop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetTop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInsetTop(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInsetTop\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetTop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_setPreferredSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setPreferredSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPreferredSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPreferredSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setPreferredSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::SpriteFrame* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSpriteFrame(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpriteFrame\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 3) {\n            cocos2d::SpriteBatchNode* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteBatchNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg2;\n            ok &= luaval_to_rect(tolua_S, 4, &arg2);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithBatchNode(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 4) {\n            cocos2d::SpriteBatchNode* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteBatchNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool arg2;\n            ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg3;\n            ok &= luaval_to_rect(tolua_S, 5, &arg3);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithBatchNode(arg0, arg1, arg2, arg3);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithBatchNode\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_getInsetBottom(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetBottom'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getInsetBottom();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInsetBottom\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetBottom'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_getCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Rect ret = cobj->getCapInsets();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCapInsets\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        cocos2d::SpriteBatchNode* arg0;\n        cocos2d::Rect arg1;\n        bool arg2;\n        cocos2d::Rect arg3;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteBatchNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_rect(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        bool ret = cobj->updateWithBatchNode(arg0, arg1, arg2, arg3);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateWithBatchNode\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_getInsetRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getInsetRight();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInsetRight\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_getOriginalSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getOriginalSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getOriginalSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOriginalSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getOriginalSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_initWithFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithFile'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithFile(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg2;\n            ok &= luaval_to_rect(tolua_S, 4, &arg2);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithFile(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            cocos2d::Rect arg0;\n            ok &= luaval_to_rect(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithFile(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithFile(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_getInsetTop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetTop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getInsetTop();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInsetTop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetTop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_setInsetLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInsetLeft(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInsetLeft\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            cocos2d::SpriteFrame* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSpriteFrame(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            cocos2d::SpriteFrame* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSpriteFrame(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithSpriteFrame\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_getPreferredSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getPreferredSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getPreferredSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPreferredSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getPreferredSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_setCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_getInsetLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getInsetLeft();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInsetLeft\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_setInsetRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInsetRight(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInsetRight\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::Rect arg2;\n            ok &= luaval_to_rect(tolua_S, 4, &arg2);\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Rect arg0;\n            ok &= luaval_to_rect(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 1)\n        {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrameName(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 1)\n        {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrameName(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"createWithSpriteFrameName\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Scale9Sprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::SpriteFrame* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Rect arg1;\n            ok &= luaval_to_rect(tolua_S, 3, &arg1);\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrame(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::SpriteFrame* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrame(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"createWithSpriteFrame\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_Scale9Sprite_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Scale9Sprite* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::Scale9Sprite();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.Scale9Sprite\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.Scale9Sprite\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Scale9Sprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_Scale9Sprite_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Scale9Sprite)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_Scale9Sprite(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Scale9Sprite\");\n    tolua_cclass(tolua_S,\"Scale9Sprite\",\"cc.Scale9Sprite\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Scale9Sprite\");\n        tolua_function(tolua_S,\"resizableSpriteWithCapInsets\",lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets);\n        tolua_function(tolua_S,\"setInsetBottom\",lua_cocos2dx_extension_Scale9Sprite_setInsetBottom);\n        tolua_function(tolua_S,\"initWithSpriteFrameName\",lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName);\n        tolua_function(tolua_S,\"setInsetTop\",lua_cocos2dx_extension_Scale9Sprite_setInsetTop);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_extension_Scale9Sprite_init);\n        tolua_function(tolua_S,\"setPreferredSize\",lua_cocos2dx_extension_Scale9Sprite_setPreferredSize);\n        tolua_function(tolua_S,\"setSpriteFrame\",lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame);\n        tolua_function(tolua_S,\"initWithBatchNode\",lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode);\n        tolua_function(tolua_S,\"getInsetBottom\",lua_cocos2dx_extension_Scale9Sprite_getInsetBottom);\n        tolua_function(tolua_S,\"getCapInsets\",lua_cocos2dx_extension_Scale9Sprite_getCapInsets);\n        tolua_function(tolua_S,\"updateWithBatchNode\",lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode);\n        tolua_function(tolua_S,\"getInsetRight\",lua_cocos2dx_extension_Scale9Sprite_getInsetRight);\n        tolua_function(tolua_S,\"getOriginalSize\",lua_cocos2dx_extension_Scale9Sprite_getOriginalSize);\n        tolua_function(tolua_S,\"initWithFile\",lua_cocos2dx_extension_Scale9Sprite_initWithFile);\n        tolua_function(tolua_S,\"getInsetTop\",lua_cocos2dx_extension_Scale9Sprite_getInsetTop);\n        tolua_function(tolua_S,\"setInsetLeft\",lua_cocos2dx_extension_Scale9Sprite_setInsetLeft);\n        tolua_function(tolua_S,\"initWithSpriteFrame\",lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame);\n        tolua_function(tolua_S,\"getPreferredSize\",lua_cocos2dx_extension_Scale9Sprite_getPreferredSize);\n        tolua_function(tolua_S,\"setCapInsets\",lua_cocos2dx_extension_Scale9Sprite_setCapInsets);\n        tolua_function(tolua_S,\"getInsetLeft\",lua_cocos2dx_extension_Scale9Sprite_getInsetLeft);\n        tolua_function(tolua_S,\"setInsetRight\",lua_cocos2dx_extension_Scale9Sprite_setInsetRight);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_Scale9Sprite_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_Scale9Sprite_create);\n        tolua_function(tolua_S,\"createWithSpriteFrameName\", lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName);\n        tolua_function(tolua_S,\"createWithSpriteFrame\", lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::Scale9Sprite).name();\n    g_luaType[typeName] = \"cc.Scale9Sprite\";\n    g_typeCast[\"Scale9Sprite\"] = \"cc.Scale9Sprite\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_Control_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_onTouchMoved(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_onTouchMoved'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->onTouchMoved(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchMoved\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_onTouchMoved'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_getState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_getState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getState();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getState\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_getState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_onTouchEnded(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_onTouchEnded'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->onTouchEnded(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchEnded\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_onTouchEnded'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_sendActionsForControlEvents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_sendActionsForControlEvents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::EventType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->sendActionsForControlEvents(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"sendActionsForControlEvents\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_sendActionsForControlEvents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_setSelected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_setSelected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSelected(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSelected\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_setSelected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_onTouchCancelled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_onTouchCancelled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->onTouchCancelled(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchCancelled\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_onTouchCancelled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_needsLayout(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_needsLayout'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->needsLayout();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"needsLayout\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_needsLayout'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_onTouchBegan(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_onTouchBegan'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->onTouchBegan(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchBegan\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_onTouchBegan'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_hasVisibleParents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_hasVisibleParents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->hasVisibleParents();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hasVisibleParents\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_hasVisibleParents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_isSelected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_isSelected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isSelected();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isSelected\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_isSelected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_isTouchInside(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_isTouchInside'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Touch* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTouchInside(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTouchInside\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_isTouchInside'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_setHighlighted(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_setHighlighted'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setHighlighted(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setHighlighted\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_setHighlighted'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_getTouchLocation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_getTouchLocation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Touch* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getTouchLocation(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTouchLocation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_getTouchLocation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_isHighlighted(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::Control* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::Control*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_Control_isHighlighted'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isHighlighted();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isHighlighted\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_isHighlighted'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_Control_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::extension::Control* ret = cocos2d::extension::Control::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Control\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Control*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_Control_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_extension_Control_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Control)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_Control(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.Control\");\n    tolua_cclass(tolua_S,\"Control\",\"cc.Control\",\"cc.Layer\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Control\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_extension_Control_setEnabled);\n        tolua_function(tolua_S,\"onTouchMoved\",lua_cocos2dx_extension_Control_onTouchMoved);\n        tolua_function(tolua_S,\"getState\",lua_cocos2dx_extension_Control_getState);\n        tolua_function(tolua_S,\"onTouchEnded\",lua_cocos2dx_extension_Control_onTouchEnded);\n        tolua_function(tolua_S,\"sendActionsForControlEvents\",lua_cocos2dx_extension_Control_sendActionsForControlEvents);\n        tolua_function(tolua_S,\"setSelected\",lua_cocos2dx_extension_Control_setSelected);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_extension_Control_isEnabled);\n        tolua_function(tolua_S,\"onTouchCancelled\",lua_cocos2dx_extension_Control_onTouchCancelled);\n        tolua_function(tolua_S,\"needsLayout\",lua_cocos2dx_extension_Control_needsLayout);\n        tolua_function(tolua_S,\"onTouchBegan\",lua_cocos2dx_extension_Control_onTouchBegan);\n        tolua_function(tolua_S,\"hasVisibleParents\",lua_cocos2dx_extension_Control_hasVisibleParents);\n        tolua_function(tolua_S,\"isSelected\",lua_cocos2dx_extension_Control_isSelected);\n        tolua_function(tolua_S,\"isTouchInside\",lua_cocos2dx_extension_Control_isTouchInside);\n        tolua_function(tolua_S,\"setHighlighted\",lua_cocos2dx_extension_Control_setHighlighted);\n        tolua_function(tolua_S,\"getTouchLocation\",lua_cocos2dx_extension_Control_getTouchLocation);\n        tolua_function(tolua_S,\"isHighlighted\",lua_cocos2dx_extension_Control_isHighlighted);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_Control_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::Control).name();\n    g_luaType[typeName] = \"cc.Control\";\n    g_typeCast[\"Control\"] = \"cc.Control\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlButton_isPushed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_isPushed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isPushed();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isPushed\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_isPushed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setSelected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setSelected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSelected(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSelected\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setSelected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setTitleLabelForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setTitleLabelForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Node* arg0;\n        cocos2d::extension::Control::State arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setTitleLabelForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleLabelForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setTitleLabelForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setAdjustBackgroundImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setAdjustBackgroundImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAdjustBackgroundImage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAdjustBackgroundImage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setAdjustBackgroundImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setHighlighted(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setHighlighted'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setHighlighted(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setHighlighted\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setHighlighted'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setZoomOnTouchDown(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setZoomOnTouchDown'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setZoomOnTouchDown(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setZoomOnTouchDown\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setZoomOnTouchDown'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setTitleForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setTitleForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        cocos2d::extension::Control::State arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setTitleForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setTitleForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setLabelAnchorPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setLabelAnchorPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setLabelAnchorPoint(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLabelAnchorPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setLabelAnchorPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getLabelAnchorPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getLabelAnchorPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getLabelAnchorPoint();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLabelAnchorPoint\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getLabelAnchorPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getTitleTTFSizeForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getTitleTTFSizeForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::State arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        double ret = cobj->getTitleTTFSizeForState(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleTTFSizeForState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getTitleTTFSizeForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setTitleTTFForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setTitleTTFForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        cocos2d::extension::Control::State arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setTitleTTFForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleTTFForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setTitleTTFForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setTitleTTFSizeForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setTitleTTFSizeForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        cocos2d::extension::Control::State arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setTitleTTFSizeForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleTTFSizeForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setTitleTTFSizeForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setTitleLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setTitleLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setTitleLabel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleLabel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setTitleLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setPreferredSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setPreferredSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPreferredSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPreferredSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setPreferredSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getCurrentTitleColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getCurrentTitleColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color3B& ret = cobj->getCurrentTitleColor();\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentTitleColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getCurrentTitleColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getBackgroundSpriteForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getBackgroundSpriteForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::State arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::extension::Scale9Sprite* ret = cobj->getBackgroundSpriteForState(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackgroundSpriteForState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getBackgroundSpriteForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getHorizontalOrigin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getHorizontalOrigin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getHorizontalOrigin();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getHorizontalOrigin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getHorizontalOrigin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_needsLayout(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_needsLayout'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->needsLayout();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"needsLayout\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_needsLayout'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getCurrentTitle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getCurrentTitle'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            std::string ret = cobj->getCurrentTitle();\n            tolua_pushcppstring(tolua_S,ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            const std::string& ret = cobj->getCurrentTitle();\n            tolua_pushcppstring(tolua_S,ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentTitle\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getCurrentTitle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getScaleRatio(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getScaleRatio'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getScaleRatio();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScaleRatio\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getScaleRatio'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getTitleTTFForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getTitleTTFForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::State arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getTitleTTFForState(arg0);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleTTFForState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getTitleTTFForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getBackgroundSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getBackgroundSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::extension::Scale9Sprite* ret = cobj->getBackgroundSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Scale9Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::Scale9Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackgroundSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getBackgroundSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getTitleColorForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getTitleColorForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::State arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Color3B ret = cobj->getTitleColorForState(arg0);\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleColorForState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getTitleColorForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setTitleColorForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setTitleColorForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Color3B arg0;\n        cocos2d::extension::Control::State arg1;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setTitleColorForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleColorForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setTitleColorForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->doesAdjustBackgroundImage();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"doesAdjustBackgroundImage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::SpriteFrame* arg0;\n        cocos2d::extension::Control::State arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.SpriteFrame\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::SpriteFrame*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setBackgroundSpriteFrameForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackgroundSpriteFrameForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setBackgroundSpriteForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setBackgroundSpriteForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::extension::Scale9Sprite* arg0;\n        cocos2d::extension::Control::State arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setBackgroundSpriteForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackgroundSpriteForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setBackgroundSpriteForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setScaleRatio(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setScaleRatio'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScaleRatio(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScaleRatio\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setScaleRatio'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setBackgroundSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setBackgroundSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Scale9Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBackgroundSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackgroundSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setBackgroundSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getTitleLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getTitleLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getTitleLabel();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleLabel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getTitleLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getPreferredSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getPreferredSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getPreferredSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPreferredSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getPreferredSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getVerticalMargin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getVerticalMargin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getVerticalMargin();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVerticalMargin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getVerticalMargin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getTitleLabelForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getTitleLabelForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::State arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getTitleLabelForState(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleLabelForState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getTitleLabelForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setMargins(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setMargins'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        int arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setMargins(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMargins\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setMargins'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_setTitleBMFontForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_setTitleBMFontForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        cocos2d::extension::Control::State arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setTitleBMFontForState(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleBMFontForState\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_setTitleBMFontForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getTitleBMFontForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getTitleBMFontForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::State arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getTitleBMFontForState(arg0);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleBMFontForState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getTitleBMFontForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getZoomOnTouchDown(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getZoomOnTouchDown'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getZoomOnTouchDown();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getZoomOnTouchDown\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getZoomOnTouchDown'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_getTitleForState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlButton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlButton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlButton_getTitleForState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::State arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getTitleForState(arg0);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleForState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_getTitleForState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlButton_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlButton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::extension::Scale9Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlButton\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlButton*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlButton\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlButton*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::Scale9Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlButton\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlButton*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlButton\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlButton*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlButton_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_extension_ControlButton_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlButton)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlButton(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlButton\");\n    tolua_cclass(tolua_S,\"ControlButton\",\"cc.ControlButton\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlButton\");\n        tolua_function(tolua_S,\"isPushed\",lua_cocos2dx_extension_ControlButton_isPushed);\n        tolua_function(tolua_S,\"setSelected\",lua_cocos2dx_extension_ControlButton_setSelected);\n        tolua_function(tolua_S,\"setTitleLabelForState\",lua_cocos2dx_extension_ControlButton_setTitleLabelForState);\n        tolua_function(tolua_S,\"setAdjustBackgroundImage\",lua_cocos2dx_extension_ControlButton_setAdjustBackgroundImage);\n        tolua_function(tolua_S,\"setHighlighted\",lua_cocos2dx_extension_ControlButton_setHighlighted);\n        tolua_function(tolua_S,\"setZoomOnTouchDown\",lua_cocos2dx_extension_ControlButton_setZoomOnTouchDown);\n        tolua_function(tolua_S,\"setTitleForState\",lua_cocos2dx_extension_ControlButton_setTitleForState);\n        tolua_function(tolua_S,\"setLabelAnchorPoint\",lua_cocos2dx_extension_ControlButton_setLabelAnchorPoint);\n        tolua_function(tolua_S,\"getLabelAnchorPoint\",lua_cocos2dx_extension_ControlButton_getLabelAnchorPoint);\n        tolua_function(tolua_S,\"getTitleTTFSizeForState\",lua_cocos2dx_extension_ControlButton_getTitleTTFSizeForState);\n        tolua_function(tolua_S,\"setTitleTTFForState\",lua_cocos2dx_extension_ControlButton_setTitleTTFForState);\n        tolua_function(tolua_S,\"setTitleTTFSizeForState\",lua_cocos2dx_extension_ControlButton_setTitleTTFSizeForState);\n        tolua_function(tolua_S,\"setTitleLabel\",lua_cocos2dx_extension_ControlButton_setTitleLabel);\n        tolua_function(tolua_S,\"setPreferredSize\",lua_cocos2dx_extension_ControlButton_setPreferredSize);\n        tolua_function(tolua_S,\"getCurrentTitleColor\",lua_cocos2dx_extension_ControlButton_getCurrentTitleColor);\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_extension_ControlButton_setEnabled);\n        tolua_function(tolua_S,\"getBackgroundSpriteForState\",lua_cocos2dx_extension_ControlButton_getBackgroundSpriteForState);\n        tolua_function(tolua_S,\"getHorizontalOrigin\",lua_cocos2dx_extension_ControlButton_getHorizontalOrigin);\n        tolua_function(tolua_S,\"needsLayout\",lua_cocos2dx_extension_ControlButton_needsLayout);\n        tolua_function(tolua_S,\"getCurrentTitle\",lua_cocos2dx_extension_ControlButton_getCurrentTitle);\n        tolua_function(tolua_S,\"getScaleRatio\",lua_cocos2dx_extension_ControlButton_getScaleRatio);\n        tolua_function(tolua_S,\"getTitleTTFForState\",lua_cocos2dx_extension_ControlButton_getTitleTTFForState);\n        tolua_function(tolua_S,\"getBackgroundSprite\",lua_cocos2dx_extension_ControlButton_getBackgroundSprite);\n        tolua_function(tolua_S,\"getTitleColorForState\",lua_cocos2dx_extension_ControlButton_getTitleColorForState);\n        tolua_function(tolua_S,\"setTitleColorForState\",lua_cocos2dx_extension_ControlButton_setTitleColorForState);\n        tolua_function(tolua_S,\"doesAdjustBackgroundImage\",lua_cocos2dx_extension_ControlButton_doesAdjustBackgroundImage);\n        tolua_function(tolua_S,\"setBackgroundSpriteFrameForState\",lua_cocos2dx_extension_ControlButton_setBackgroundSpriteFrameForState);\n        tolua_function(tolua_S,\"setBackgroundSpriteForState\",lua_cocos2dx_extension_ControlButton_setBackgroundSpriteForState);\n        tolua_function(tolua_S,\"setScaleRatio\",lua_cocos2dx_extension_ControlButton_setScaleRatio);\n        tolua_function(tolua_S,\"setBackgroundSprite\",lua_cocos2dx_extension_ControlButton_setBackgroundSprite);\n        tolua_function(tolua_S,\"getTitleLabel\",lua_cocos2dx_extension_ControlButton_getTitleLabel);\n        tolua_function(tolua_S,\"getPreferredSize\",lua_cocos2dx_extension_ControlButton_getPreferredSize);\n        tolua_function(tolua_S,\"getVerticalMargin\",lua_cocos2dx_extension_ControlButton_getVerticalMargin);\n        tolua_function(tolua_S,\"getTitleLabelForState\",lua_cocos2dx_extension_ControlButton_getTitleLabelForState);\n        tolua_function(tolua_S,\"setMargins\",lua_cocos2dx_extension_ControlButton_setMargins);\n        tolua_function(tolua_S,\"setTitleBMFontForState\",lua_cocos2dx_extension_ControlButton_setTitleBMFontForState);\n        tolua_function(tolua_S,\"getTitleBMFontForState\",lua_cocos2dx_extension_ControlButton_getTitleBMFontForState);\n        tolua_function(tolua_S,\"getZoomOnTouchDown\",lua_cocos2dx_extension_ControlButton_getZoomOnTouchDown);\n        tolua_function(tolua_S,\"getTitleForState\",lua_cocos2dx_extension_ControlButton_getTitleForState);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlButton_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlButton).name();\n    g_luaType[typeName] = \"cc.ControlButton\";\n    g_typeCast[\"ControlButton\"] = \"cc.ControlButton\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlHuePicker_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Node* arg0;\n        cocos2d::Point arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithTargetAndPos(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTargetAndPos\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_setHue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_setHue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setHue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setHue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_setHue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_getStartPos(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_getStartPos'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getStartPos();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartPos\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_getStartPos'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_getHue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_getHue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getHue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getHue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_getHue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_getSlider(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_getSlider'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getSlider();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSlider\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_getSlider'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_setBackground(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_setBackground'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBackground(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackground\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_setBackground'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_setHuePercentage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_setHuePercentage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setHuePercentage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setHuePercentage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_setHuePercentage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_getBackground(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_getBackground'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getBackground();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackground\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_getBackground'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_getHuePercentage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_getHuePercentage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getHuePercentage();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getHuePercentage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_getHuePercentage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_setSlider(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlHuePicker_setSlider'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSlider(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSlider\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_setSlider'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlHuePicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::Node* arg0;\n        cocos2d::Point arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::extension::ControlHuePicker* ret = cocos2d::extension::ControlHuePicker::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlHuePicker\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlHuePicker*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ControlHuePicker_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlHuePicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ControlHuePicker();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ControlHuePicker\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ControlHuePicker\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ControlHuePicker\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlHuePicker_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ControlHuePicker_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlHuePicker)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlHuePicker(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlHuePicker\");\n    tolua_cclass(tolua_S,\"ControlHuePicker\",\"cc.ControlHuePicker\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlHuePicker\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_extension_ControlHuePicker_setEnabled);\n        tolua_function(tolua_S,\"initWithTargetAndPos\",lua_cocos2dx_extension_ControlHuePicker_initWithTargetAndPos);\n        tolua_function(tolua_S,\"setHue\",lua_cocos2dx_extension_ControlHuePicker_setHue);\n        tolua_function(tolua_S,\"getStartPos\",lua_cocos2dx_extension_ControlHuePicker_getStartPos);\n        tolua_function(tolua_S,\"getHue\",lua_cocos2dx_extension_ControlHuePicker_getHue);\n        tolua_function(tolua_S,\"getSlider\",lua_cocos2dx_extension_ControlHuePicker_getSlider);\n        tolua_function(tolua_S,\"setBackground\",lua_cocos2dx_extension_ControlHuePicker_setBackground);\n        tolua_function(tolua_S,\"setHuePercentage\",lua_cocos2dx_extension_ControlHuePicker_setHuePercentage);\n        tolua_function(tolua_S,\"getBackground\",lua_cocos2dx_extension_ControlHuePicker_getBackground);\n        tolua_function(tolua_S,\"getHuePercentage\",lua_cocos2dx_extension_ControlHuePicker_getHuePercentage);\n        tolua_function(tolua_S,\"setSlider\",lua_cocos2dx_extension_ControlHuePicker_setSlider);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ControlHuePicker_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlHuePicker_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlHuePicker).name();\n    g_luaType[typeName] = \"cc.ControlHuePicker\";\n    g_typeCast[\"ControlHuePicker\"] = \"cc.ControlHuePicker\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getShadow();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShadow\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Node* arg0;\n        cocos2d::Point arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithTargetAndPos(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTargetAndPos\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getStartPos();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStartPos\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getOverlay();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOverlay\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getSlider();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSlider\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getBackground();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackground\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSaturation();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSaturation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getBrightness();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBrightness\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlSaturationBrightnessPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::Node* arg0;\n        cocos2d::Point arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::extension::ControlSaturationBrightnessPicker* ret = cocos2d::extension::ControlSaturationBrightnessPicker::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSaturationBrightnessPicker\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSaturationBrightnessPicker*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSaturationBrightnessPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ControlSaturationBrightnessPicker();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ControlSaturationBrightnessPicker\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ControlSaturationBrightnessPicker\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ControlSaturationBrightnessPicker\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ControlSaturationBrightnessPicker_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlSaturationBrightnessPicker)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlSaturationBrightnessPicker(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlSaturationBrightnessPicker\");\n    tolua_cclass(tolua_S,\"ControlSaturationBrightnessPicker\",\"cc.ControlSaturationBrightnessPicker\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlSaturationBrightnessPicker\");\n        tolua_function(tolua_S,\"getShadow\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getShadow);\n        tolua_function(tolua_S,\"initWithTargetAndPos\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_initWithTargetAndPos);\n        tolua_function(tolua_S,\"getStartPos\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getStartPos);\n        tolua_function(tolua_S,\"getOverlay\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getOverlay);\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_setEnabled);\n        tolua_function(tolua_S,\"getSlider\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSlider);\n        tolua_function(tolua_S,\"getBackground\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBackground);\n        tolua_function(tolua_S,\"getSaturation\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getSaturation);\n        tolua_function(tolua_S,\"getBrightness\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_getBrightness);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ControlSaturationBrightnessPicker_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlSaturationBrightnessPicker_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlSaturationBrightnessPicker).name();\n    g_luaType[typeName] = \"cc.ControlSaturationBrightnessPicker\";\n    g_typeCast[\"ControlSaturationBrightnessPicker\"] = \"cc.ControlSaturationBrightnessPicker\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlColourPicker_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_getHuePicker(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_getHuePicker'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::extension::ControlHuePicker* ret = cobj->getHuePicker();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlHuePicker\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlHuePicker*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getHuePicker\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_getHuePicker'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_setColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_setColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_setColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Object* arg0;\n        cocos2d::extension::Control::EventType arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Object\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Object*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->hueSliderValueChanged(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hueSliderValueChanged\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_getcolourPicker(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_getcolourPicker'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::extension::ControlSaturationBrightnessPicker* ret = cobj->getcolourPicker();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSaturationBrightnessPicker\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSaturationBrightnessPicker*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getcolourPicker\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_getcolourPicker'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_setBackground(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_setBackground'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBackground(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackground\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_setBackground'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_setcolourPicker(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_setcolourPicker'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::ControlSaturationBrightnessPicker* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ControlSaturationBrightnessPicker\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::extension::ControlSaturationBrightnessPicker*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setcolourPicker(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setcolourPicker\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_setcolourPicker'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Object* arg0;\n        cocos2d::extension::Control::EventType arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Object\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Object*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->colourSliderValueChanged(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"colourSliderValueChanged\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_setHuePicker(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_setHuePicker'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::ControlHuePicker* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ControlHuePicker\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::extension::ControlHuePicker*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setHuePicker(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setHuePicker\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_setHuePicker'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_getBackground(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlColourPicker*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlColourPicker_getBackground'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getBackground();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackground\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_getBackground'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlColourPicker\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::extension::ControlColourPicker* ret = cocos2d::extension::ControlColourPicker::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlColourPicker\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlColourPicker*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ControlColourPicker_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlColourPicker* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ControlColourPicker();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ControlColourPicker\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ControlColourPicker\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ControlColourPicker\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlColourPicker_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ControlColourPicker_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlColourPicker)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlColourPicker(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlColourPicker\");\n    tolua_cclass(tolua_S,\"ControlColourPicker\",\"cc.ControlColourPicker\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlColourPicker\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_extension_ControlColourPicker_setEnabled);\n        tolua_function(tolua_S,\"getHuePicker\",lua_cocos2dx_extension_ControlColourPicker_getHuePicker);\n        tolua_function(tolua_S,\"setColor\",lua_cocos2dx_extension_ControlColourPicker_setColor);\n        tolua_function(tolua_S,\"hueSliderValueChanged\",lua_cocos2dx_extension_ControlColourPicker_hueSliderValueChanged);\n        tolua_function(tolua_S,\"getcolourPicker\",lua_cocos2dx_extension_ControlColourPicker_getcolourPicker);\n        tolua_function(tolua_S,\"setBackground\",lua_cocos2dx_extension_ControlColourPicker_setBackground);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_extension_ControlColourPicker_init);\n        tolua_function(tolua_S,\"setcolourPicker\",lua_cocos2dx_extension_ControlColourPicker_setcolourPicker);\n        tolua_function(tolua_S,\"colourSliderValueChanged\",lua_cocos2dx_extension_ControlColourPicker_colourSliderValueChanged);\n        tolua_function(tolua_S,\"setHuePicker\",lua_cocos2dx_extension_ControlColourPicker_setHuePicker);\n        tolua_function(tolua_S,\"getBackground\",lua_cocos2dx_extension_ControlColourPicker_getBackground);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ControlColourPicker_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlColourPicker_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlColourPicker).name();\n    g_luaType[typeName] = \"cc.ControlColourPicker\";\n    g_typeCast[\"ControlColourPicker\"] = \"cc.ControlColourPicker\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlPotentiometer_setPreviousLocation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_setPreviousLocation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPreviousLocation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPreviousLocation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_setPreviousLocation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_setValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_setValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_setValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_getProgressTimer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_getProgressTimer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ProgressTimer* ret = cobj->getProgressTimer();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ProgressTimer\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::ProgressTimer*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProgressTimer\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_getProgressTimer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_getMaximumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_getMaximumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMaximumValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaximumValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_getMaximumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::Point arg2;\n        cocos2d::Point arg3;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        double ret = cobj->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(arg0, arg1, arg2, arg3);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_potentiometerBegan(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_potentiometerBegan'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->potentiometerBegan(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"potentiometerBegan\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_potentiometerBegan'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_setMaximumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_setMaximumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaximumValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaximumValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_setMaximumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_getMinimumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_getMinimumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMinimumValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMinimumValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_getMinimumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_setThumbSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_setThumbSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setThumbSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setThumbSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_setThumbSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_getValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_getValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_getValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_getPreviousLocation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_getPreviousLocation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPreviousLocation();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPreviousLocation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_getPreviousLocation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        double ret = cobj->distanceBetweenPointAndPoint(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"distanceBetweenPointAndPoint\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_potentiometerEnded(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_potentiometerEnded'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->potentiometerEnded(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"potentiometerEnded\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_potentiometerEnded'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_setProgressTimer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_setProgressTimer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::ProgressTimer* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ProgressTimer\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setProgressTimer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProgressTimer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_setProgressTimer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_setMinimumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_setMinimumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMinimumValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMinimumValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_setMinimumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_getThumbSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_getThumbSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getThumbSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getThumbSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_getThumbSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Sprite* arg0;\n        cocos2d::ProgressTimer* arg1;\n        cocos2d::Sprite* arg2;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.ProgressTimer\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::ProgressTimer*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithTrackSprite_ProgressTimer_ThumbSprite(arg0, arg1, arg2);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithTrackSprite_ProgressTimer_ThumbSprite\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_potentiometerMoved(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlPotentiometer*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlPotentiometer_potentiometerMoved'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->potentiometerMoved(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"potentiometerMoved\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_potentiometerMoved'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlPotentiometer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n        if(!ok)\n            return 0;\n        cocos2d::extension::ControlPotentiometer* ret = cocos2d::extension::ControlPotentiometer::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlPotentiometer\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlPotentiometer*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ControlPotentiometer_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlPotentiometer* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ControlPotentiometer();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ControlPotentiometer\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ControlPotentiometer\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ControlPotentiometer\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlPotentiometer_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ControlPotentiometer_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlPotentiometer)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlPotentiometer(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlPotentiometer\");\n    tolua_cclass(tolua_S,\"ControlPotentiometer\",\"cc.ControlPotentiometer\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlPotentiometer\");\n        tolua_function(tolua_S,\"setPreviousLocation\",lua_cocos2dx_extension_ControlPotentiometer_setPreviousLocation);\n        tolua_function(tolua_S,\"setValue\",lua_cocos2dx_extension_ControlPotentiometer_setValue);\n        tolua_function(tolua_S,\"getProgressTimer\",lua_cocos2dx_extension_ControlPotentiometer_getProgressTimer);\n        tolua_function(tolua_S,\"getMaximumValue\",lua_cocos2dx_extension_ControlPotentiometer_getMaximumValue);\n        tolua_function(tolua_S,\"angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint\",lua_cocos2dx_extension_ControlPotentiometer_angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint);\n        tolua_function(tolua_S,\"potentiometerBegan\",lua_cocos2dx_extension_ControlPotentiometer_potentiometerBegan);\n        tolua_function(tolua_S,\"setMaximumValue\",lua_cocos2dx_extension_ControlPotentiometer_setMaximumValue);\n        tolua_function(tolua_S,\"getMinimumValue\",lua_cocos2dx_extension_ControlPotentiometer_getMinimumValue);\n        tolua_function(tolua_S,\"setThumbSprite\",lua_cocos2dx_extension_ControlPotentiometer_setThumbSprite);\n        tolua_function(tolua_S,\"getValue\",lua_cocos2dx_extension_ControlPotentiometer_getValue);\n        tolua_function(tolua_S,\"getPreviousLocation\",lua_cocos2dx_extension_ControlPotentiometer_getPreviousLocation);\n        tolua_function(tolua_S,\"distanceBetweenPointAndPoint\",lua_cocos2dx_extension_ControlPotentiometer_distanceBetweenPointAndPoint);\n        tolua_function(tolua_S,\"potentiometerEnded\",lua_cocos2dx_extension_ControlPotentiometer_potentiometerEnded);\n        tolua_function(tolua_S,\"setProgressTimer\",lua_cocos2dx_extension_ControlPotentiometer_setProgressTimer);\n        tolua_function(tolua_S,\"setMinimumValue\",lua_cocos2dx_extension_ControlPotentiometer_setMinimumValue);\n        tolua_function(tolua_S,\"getThumbSprite\",lua_cocos2dx_extension_ControlPotentiometer_getThumbSprite);\n        tolua_function(tolua_S,\"initWithTrackSprite_ProgressTimer_ThumbSprite\",lua_cocos2dx_extension_ControlPotentiometer_initWithTrackSprite_ProgressTimer_ThumbSprite);\n        tolua_function(tolua_S,\"potentiometerMoved\",lua_cocos2dx_extension_ControlPotentiometer_potentiometerMoved);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ControlPotentiometer_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlPotentiometer_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlPotentiometer).name();\n    g_luaType[typeName] = \"cc.ControlPotentiometer\";\n    g_typeCast[\"ControlPotentiometer\"] = \"cc.ControlPotentiometer\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlSlider_getSelectedThumbSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getSelectedThumbSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getSelectedThumbSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSelectedThumbSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getSelectedThumbSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_locationFromTouch(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_locationFromTouch'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Touch* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->locationFromTouch(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"locationFromTouch\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_locationFromTouch'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setSelectedThumbSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setSelectedThumbSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setSelectedThumbSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSelectedThumbSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setSelectedThumbSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setProgressSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setProgressSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setProgressSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProgressSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setProgressSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getMaximumAllowedValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getMaximumAllowedValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMaximumAllowedValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaximumAllowedValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getMaximumAllowedValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getMinimumAllowedValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getMinimumAllowedValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMinimumAllowedValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMinimumAllowedValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getMinimumAllowedValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getMinimumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getMinimumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMinimumValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMinimumValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getMinimumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setThumbSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setThumbSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setThumbSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setThumbSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setThumbSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setMinimumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setMinimumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMinimumValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMinimumValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setMinimumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setMinimumAllowedValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setMinimumAllowedValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMinimumAllowedValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMinimumAllowedValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setMinimumAllowedValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setMaximumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setMaximumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaximumValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaximumValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setMaximumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_needsLayout(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_needsLayout'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->needsLayout();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"needsLayout\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_needsLayout'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getBackgroundSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getBackgroundSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getBackgroundSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackgroundSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getBackgroundSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_initWithSprites(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_initWithSprites'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 4) {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg3;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSprites(arg0, arg1, arg2, arg3);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithSprites(arg0, arg1, arg2);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithSprites\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_initWithSprites'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getMaximumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getMaximumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMaximumValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaximumValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getMaximumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_isTouchInside(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_isTouchInside'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Touch* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTouchInside(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTouchInside\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_isTouchInside'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getThumbSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getThumbSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getThumbSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getThumbSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getThumbSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_getProgressSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_getProgressSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getProgressSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getProgressSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_getProgressSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setBackgroundSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setBackgroundSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBackgroundSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackgroundSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setBackgroundSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_setMaximumAllowedValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSlider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSlider_setMaximumAllowedValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaximumAllowedValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaximumAllowedValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_setMaximumAllowedValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlSlider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 3)\n        {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSlider\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSlider*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 3)\n        {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n            if (!ok) { break; }\n            const char* arg2;\n            std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSlider\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSlider*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 4)\n        {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n            if (!ok) { break; }\n            const char* arg2;\n            std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n            if (!ok) { break; }\n            const char* arg3;\n            std::string arg3_tmp; ok &= luaval_to_std_string(tolua_S, 5, &arg3_tmp); arg3 = arg3_tmp.c_str();\n            if (!ok) { break; }\n            cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSlider\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSlider*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 4)\n        {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg3;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::ControlSlider* ret = cocos2d::extension::ControlSlider::create(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSlider\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSlider*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSlider_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSlider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ControlSlider();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ControlSlider\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ControlSlider\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ControlSlider\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSlider_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ControlSlider_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlSlider)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlSlider(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlSlider\");\n    tolua_cclass(tolua_S,\"ControlSlider\",\"cc.ControlSlider\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlSlider\");\n        tolua_function(tolua_S,\"getSelectedThumbSprite\",lua_cocos2dx_extension_ControlSlider_getSelectedThumbSprite);\n        tolua_function(tolua_S,\"locationFromTouch\",lua_cocos2dx_extension_ControlSlider_locationFromTouch);\n        tolua_function(tolua_S,\"setSelectedThumbSprite\",lua_cocos2dx_extension_ControlSlider_setSelectedThumbSprite);\n        tolua_function(tolua_S,\"setProgressSprite\",lua_cocos2dx_extension_ControlSlider_setProgressSprite);\n        tolua_function(tolua_S,\"getMaximumAllowedValue\",lua_cocos2dx_extension_ControlSlider_getMaximumAllowedValue);\n        tolua_function(tolua_S,\"getMinimumAllowedValue\",lua_cocos2dx_extension_ControlSlider_getMinimumAllowedValue);\n        tolua_function(tolua_S,\"getMinimumValue\",lua_cocos2dx_extension_ControlSlider_getMinimumValue);\n        tolua_function(tolua_S,\"setThumbSprite\",lua_cocos2dx_extension_ControlSlider_setThumbSprite);\n        tolua_function(tolua_S,\"setMinimumValue\",lua_cocos2dx_extension_ControlSlider_setMinimumValue);\n        tolua_function(tolua_S,\"setMinimumAllowedValue\",lua_cocos2dx_extension_ControlSlider_setMinimumAllowedValue);\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_extension_ControlSlider_setEnabled);\n        tolua_function(tolua_S,\"setValue\",lua_cocos2dx_extension_ControlSlider_setValue);\n        tolua_function(tolua_S,\"setMaximumValue\",lua_cocos2dx_extension_ControlSlider_setMaximumValue);\n        tolua_function(tolua_S,\"needsLayout\",lua_cocos2dx_extension_ControlSlider_needsLayout);\n        tolua_function(tolua_S,\"getBackgroundSprite\",lua_cocos2dx_extension_ControlSlider_getBackgroundSprite);\n        tolua_function(tolua_S,\"initWithSprites\",lua_cocos2dx_extension_ControlSlider_initWithSprites);\n        tolua_function(tolua_S,\"getMaximumValue\",lua_cocos2dx_extension_ControlSlider_getMaximumValue);\n        tolua_function(tolua_S,\"isTouchInside\",lua_cocos2dx_extension_ControlSlider_isTouchInside);\n        tolua_function(tolua_S,\"getValue\",lua_cocos2dx_extension_ControlSlider_getValue);\n        tolua_function(tolua_S,\"getThumbSprite\",lua_cocos2dx_extension_ControlSlider_getThumbSprite);\n        tolua_function(tolua_S,\"getProgressSprite\",lua_cocos2dx_extension_ControlSlider_getProgressSprite);\n        tolua_function(tolua_S,\"setBackgroundSprite\",lua_cocos2dx_extension_ControlSlider_setBackgroundSprite);\n        tolua_function(tolua_S,\"setMaximumAllowedValue\",lua_cocos2dx_extension_ControlSlider_setMaximumAllowedValue);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ControlSlider_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlSlider_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlSlider).name();\n    g_luaType[typeName] = \"cc.ControlSlider\";\n    g_typeCast[\"ControlSlider\"] = \"cc.ControlSlider\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlStepper_setMinusSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setMinusSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setMinusSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMinusSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setMinusSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_getMinusLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_getMinusLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::LabelTTF* ret = cobj->getMinusLabel();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelTTF\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelTTF*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMinusLabel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_getMinusLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setWraps(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setWraps'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setWraps(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setWraps\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setWraps'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_isContinuous(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_isContinuous'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isContinuous();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isContinuous\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_isContinuous'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_getMinusSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_getMinusSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getMinusSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMinusSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_getMinusSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->updateLayoutUsingTouchLocation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateLayoutUsingTouchLocation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setValueWithSendingEvent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setValueWithSendingEvent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setValueWithSendingEvent(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setValueWithSendingEvent\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setValueWithSendingEvent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_getPlusLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_getPlusLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::LabelTTF* ret = cobj->getPlusLabel();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.LabelTTF\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::LabelTTF*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPlusLabel\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_getPlusLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_stopAutorepeat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_stopAutorepeat'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopAutorepeat();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopAutorepeat\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_stopAutorepeat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setMinimumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setMinimumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMinimumValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMinimumValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setMinimumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_getPlusSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_getPlusSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Sprite* ret = cobj->getPlusSprite();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Sprite\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Sprite*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPlusSprite\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_getPlusSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setPlusSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setPlusSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Sprite* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setPlusSprite(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlusSprite\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setPlusSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setMinusLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setMinusLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::LabelTTF* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.LabelTTF\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setMinusLabel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMinusLabel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setMinusLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setStepValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setStepValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStepValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStepValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setStepValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setMaximumValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setMaximumValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaximumValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaximumValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setMaximumValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_update(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_update'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->update(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"update\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_update'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_startAutorepeat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_startAutorepeat'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->startAutorepeat();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"startAutorepeat\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_startAutorepeat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Sprite* arg0;\n        cocos2d::Sprite* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithMinusSpriteAndPlusSprite(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithMinusSpriteAndPlusSprite\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_getValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_getValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getValue();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_getValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_setPlusLabel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlStepper*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlStepper_setPlusLabel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::LabelTTF* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.LabelTTF\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setPlusLabel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlusLabel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_setPlusLabel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlStepper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::Sprite* arg0;\n        cocos2d::Sprite* arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::extension::ControlStepper* ret = cocos2d::extension::ControlStepper::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlStepper\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlStepper*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ControlStepper_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlStepper* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ControlStepper();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ControlStepper\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ControlStepper\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ControlStepper\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlStepper_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ControlStepper_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlStepper)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlStepper(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlStepper\");\n    tolua_cclass(tolua_S,\"ControlStepper\",\"cc.ControlStepper\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlStepper\");\n        tolua_function(tolua_S,\"setMinusSprite\",lua_cocos2dx_extension_ControlStepper_setMinusSprite);\n        tolua_function(tolua_S,\"getMinusLabel\",lua_cocos2dx_extension_ControlStepper_getMinusLabel);\n        tolua_function(tolua_S,\"setWraps\",lua_cocos2dx_extension_ControlStepper_setWraps);\n        tolua_function(tolua_S,\"isContinuous\",lua_cocos2dx_extension_ControlStepper_isContinuous);\n        tolua_function(tolua_S,\"getMinusSprite\",lua_cocos2dx_extension_ControlStepper_getMinusSprite);\n        tolua_function(tolua_S,\"updateLayoutUsingTouchLocation\",lua_cocos2dx_extension_ControlStepper_updateLayoutUsingTouchLocation);\n        tolua_function(tolua_S,\"setValueWithSendingEvent\",lua_cocos2dx_extension_ControlStepper_setValueWithSendingEvent);\n        tolua_function(tolua_S,\"getPlusLabel\",lua_cocos2dx_extension_ControlStepper_getPlusLabel);\n        tolua_function(tolua_S,\"stopAutorepeat\",lua_cocos2dx_extension_ControlStepper_stopAutorepeat);\n        tolua_function(tolua_S,\"setMinimumValue\",lua_cocos2dx_extension_ControlStepper_setMinimumValue);\n        tolua_function(tolua_S,\"getPlusSprite\",lua_cocos2dx_extension_ControlStepper_getPlusSprite);\n        tolua_function(tolua_S,\"setPlusSprite\",lua_cocos2dx_extension_ControlStepper_setPlusSprite);\n        tolua_function(tolua_S,\"setMinusLabel\",lua_cocos2dx_extension_ControlStepper_setMinusLabel);\n        tolua_function(tolua_S,\"setValue\",lua_cocos2dx_extension_ControlStepper_setValue);\n        tolua_function(tolua_S,\"setStepValue\",lua_cocos2dx_extension_ControlStepper_setStepValue);\n        tolua_function(tolua_S,\"setMaximumValue\",lua_cocos2dx_extension_ControlStepper_setMaximumValue);\n        tolua_function(tolua_S,\"update\",lua_cocos2dx_extension_ControlStepper_update);\n        tolua_function(tolua_S,\"startAutorepeat\",lua_cocos2dx_extension_ControlStepper_startAutorepeat);\n        tolua_function(tolua_S,\"initWithMinusSpriteAndPlusSprite\",lua_cocos2dx_extension_ControlStepper_initWithMinusSpriteAndPlusSprite);\n        tolua_function(tolua_S,\"getValue\",lua_cocos2dx_extension_ControlStepper_getValue);\n        tolua_function(tolua_S,\"setPlusLabel\",lua_cocos2dx_extension_ControlStepper_setPlusLabel);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ControlStepper_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlStepper_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlStepper).name();\n    g_luaType[typeName] = \"cc.ControlStepper\";\n    g_typeCast[\"ControlStepper\"] = \"cc.ControlStepper\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ControlSwitch_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSwitch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSwitch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSwitch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSwitch_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSwitch_setOn(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSwitch* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSwitch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::ControlSwitch*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSwitch_setOn'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            bool arg0;\n            ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setOn(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            bool arg0;\n            ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->setOn(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setOn\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_setOn'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSwitch_isOn(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSwitch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSwitch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSwitch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSwitch_isOn'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isOn();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isOn\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_isOn'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSwitch_initWithMaskSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSwitch* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSwitch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::ControlSwitch*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSwitch_initWithMaskSprite'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 6) {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg3;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::LabelTTF* arg4;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,6,\"cc.LabelTTF\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ4 = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,6,0);\n\t\t\t\t\tif (nullptr == arg4){\n\t\t\t\t\t\tLUA_PRECONDITION( arg4, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::LabelTTF* arg5;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,7,\"cc.LabelTTF\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ5 = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,7,0);\n\t\t\t\t\tif (nullptr == arg5){\n\t\t\t\t\t\tLUA_PRECONDITION( arg5, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3, arg4, arg5);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 4) {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocos2d::Sprite* arg3;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool ret = cobj->initWithMaskSprite(arg0, arg1, arg2, arg3);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithMaskSprite\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_initWithMaskSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSwitch_hasMoved(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSwitch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSwitch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSwitch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSwitch_hasMoved'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->hasMoved();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hasMoved\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_hasMoved'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSwitch_locationFromTouch(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSwitch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ControlSwitch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ControlSwitch*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ControlSwitch_locationFromTouch'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Touch* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->locationFromTouch(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"locationFromTouch\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_locationFromTouch'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSwitch_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ControlSwitch\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 4)\n        {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg3;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSwitch\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSwitch*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 6)\n        {\n            cocos2d::Sprite* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Sprite* arg3;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocos2d::Sprite*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::LabelTTF* arg4;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,6,\"cc.LabelTTF\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ4 = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,6,0);\n\t\t\t\t\tif (nullptr == arg4){\n\t\t\t\t\t\tLUA_PRECONDITION( arg4, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::LabelTTF* arg5;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,7,\"cc.LabelTTF\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ5 = (cocos2d::LabelTTF*)tolua_tousertype(tolua_S,7,0);\n\t\t\t\t\tif (nullptr == arg5){\n\t\t\t\t\t\tLUA_PRECONDITION( arg5, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::ControlSwitch* ret = cocos2d::extension::ControlSwitch::create(arg0, arg1, arg2, arg3, arg4, arg5);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ControlSwitch\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ControlSwitch*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 6);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ControlSwitch_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ControlSwitch* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ControlSwitch();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ControlSwitch\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ControlSwitch\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ControlSwitch\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ControlSwitch_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ControlSwitch_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ControlSwitch)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ControlSwitch(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ControlSwitch\");\n    tolua_cclass(tolua_S,\"ControlSwitch\",\"cc.ControlSwitch\",\"cc.Control\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ControlSwitch\");\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_extension_ControlSwitch_setEnabled);\n        tolua_function(tolua_S,\"setOn\",lua_cocos2dx_extension_ControlSwitch_setOn);\n        tolua_function(tolua_S,\"isOn\",lua_cocos2dx_extension_ControlSwitch_isOn);\n        tolua_function(tolua_S,\"initWithMaskSprite\",lua_cocos2dx_extension_ControlSwitch_initWithMaskSprite);\n        tolua_function(tolua_S,\"hasMoved\",lua_cocos2dx_extension_ControlSwitch_hasMoved);\n        tolua_function(tolua_S,\"locationFromTouch\",lua_cocos2dx_extension_ControlSwitch_locationFromTouch);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ControlSwitch_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ControlSwitch_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ControlSwitch).name();\n    g_luaType[typeName] = \"cc.ControlSwitch\";\n    g_typeCast[\"ControlSwitch\"] = \"cc.ControlSwitch\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_ScrollView_isClippingToBounds(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_isClippingToBounds'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isClippingToBounds();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isClippingToBounds\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_isClippingToBounds'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setContainer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setContainer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setContainer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setContainer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setContainer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_onTouchEnded(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_onTouchEnded'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->onTouchEnded(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchEnded\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_onTouchEnded'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setContentOffsetInDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setContentOffsetInDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Point arg0;\n        double arg1;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setContentOffsetInDuration(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setContentOffsetInDuration\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setContentOffsetInDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setZoomScaleInDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setZoomScaleInDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        double arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setZoomScaleInDuration(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setZoomScaleInDuration\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setZoomScaleInDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setBounceable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setBounceable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBounceable(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBounceable\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setBounceable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_getDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_getDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getDirection();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDirection\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_getDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_getContainer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_getContainer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getContainer();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContainer\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_getContainer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_getZoomScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_getZoomScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getZoomScale();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getZoomScale\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_getZoomScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_updateInset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_updateInset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateInset();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateInset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_updateInset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_initWithViewSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_initWithViewSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithViewSize(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        cocos2d::Size arg0;\n        cocos2d::Node* arg1;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithViewSize(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithViewSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_initWithViewSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_pause(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_pause'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Object* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Object\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Object*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->pause(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pause\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_pause'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::ScrollView::Direction arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDirection(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDirection\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setContentOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setContentOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setContentOffset(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        cocos2d::Point arg0;\n        bool arg1;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setContentOffset(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setContentOffset\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setContentOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_isDragging(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_isDragging'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isDragging();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isDragging\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_isDragging'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_isTouchEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_isTouchEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTouchEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTouchEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_isTouchEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_isBounceable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_isBounceable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBounceable();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBounceable\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_isBounceable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setTouchEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setTouchEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTouchEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTouchEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setTouchEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_onTouchMoved(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_onTouchMoved'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->onTouchMoved(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchMoved\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_onTouchMoved'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_getContentOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_getContentOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getContentOffset();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContentOffset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_getContentOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_resume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_resume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Object* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Object\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Object*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->resume(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resume\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_resume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setClippingToBounds(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setClippingToBounds'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setClippingToBounds(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setClippingToBounds\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setClippingToBounds'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setViewSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setViewSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setViewSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setViewSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setViewSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_onTouchCancelled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_onTouchCancelled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->onTouchCancelled(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchCancelled\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_onTouchCancelled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_getViewSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_getViewSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getViewSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getViewSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_getViewSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_maxContainerOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_maxContainerOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->maxContainerOffset();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"maxContainerOffset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_maxContainerOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_onTouchBegan(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_onTouchBegan'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Touch* arg0;\n        cocos2d::Event* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Touch\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Touch*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Event\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Event*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->onTouchBegan(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onTouchBegan\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_onTouchBegan'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_isTouchMoved(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_isTouchMoved'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTouchMoved();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTouchMoved\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_isTouchMoved'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_isNodeVisible(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_isNodeVisible'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->isNodeVisible(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isNodeVisible\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_isNodeVisible'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_minContainerOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_minContainerOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->minContainerOffset();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"minContainerOffset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_minContainerOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_setZoomScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_ScrollView_setZoomScale'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->setZoomScale(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->setZoomScale(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setZoomScale\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_setZoomScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ScrollView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ScrollView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 1)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ScrollView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ScrollView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Size arg0;\n            ok &= luaval_to_size(tolua_S, 2, &arg0);\n            if (!ok) { break; }\n            cocos2d::Node* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::extension::ScrollView* ret = cocos2d::extension::ScrollView::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.ScrollView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::ScrollView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_ScrollView_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::ScrollView();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.ScrollView\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.ScrollView\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ScrollView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_ScrollView_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_ScrollView_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ScrollView)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_ScrollView(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.ScrollView\");\n    tolua_cclass(tolua_S,\"ScrollView\",\"cc.ScrollView\",\"cc.Layer\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ScrollView\");\n        tolua_function(tolua_S,\"isClippingToBounds\",lua_cocos2dx_extension_ScrollView_isClippingToBounds);\n        tolua_function(tolua_S,\"setContainer\",lua_cocos2dx_extension_ScrollView_setContainer);\n        tolua_function(tolua_S,\"onTouchEnded\",lua_cocos2dx_extension_ScrollView_onTouchEnded);\n        tolua_function(tolua_S,\"setContentOffsetInDuration\",lua_cocos2dx_extension_ScrollView_setContentOffsetInDuration);\n        tolua_function(tolua_S,\"setZoomScaleInDuration\",lua_cocos2dx_extension_ScrollView_setZoomScaleInDuration);\n        tolua_function(tolua_S,\"setBounceable\",lua_cocos2dx_extension_ScrollView_setBounceable);\n        tolua_function(tolua_S,\"getDirection\",lua_cocos2dx_extension_ScrollView_getDirection);\n        tolua_function(tolua_S,\"getContainer\",lua_cocos2dx_extension_ScrollView_getContainer);\n        tolua_function(tolua_S,\"getZoomScale\",lua_cocos2dx_extension_ScrollView_getZoomScale);\n        tolua_function(tolua_S,\"updateInset\",lua_cocos2dx_extension_ScrollView_updateInset);\n        tolua_function(tolua_S,\"initWithViewSize\",lua_cocos2dx_extension_ScrollView_initWithViewSize);\n        tolua_function(tolua_S,\"pause\",lua_cocos2dx_extension_ScrollView_pause);\n        tolua_function(tolua_S,\"setDirection\",lua_cocos2dx_extension_ScrollView_setDirection);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_extension_ScrollView_init);\n        tolua_function(tolua_S,\"setContentOffset\",lua_cocos2dx_extension_ScrollView_setContentOffset);\n        tolua_function(tolua_S,\"isDragging\",lua_cocos2dx_extension_ScrollView_isDragging);\n        tolua_function(tolua_S,\"isTouchEnabled\",lua_cocos2dx_extension_ScrollView_isTouchEnabled);\n        tolua_function(tolua_S,\"isBounceable\",lua_cocos2dx_extension_ScrollView_isBounceable);\n        tolua_function(tolua_S,\"setTouchEnabled\",lua_cocos2dx_extension_ScrollView_setTouchEnabled);\n        tolua_function(tolua_S,\"onTouchMoved\",lua_cocos2dx_extension_ScrollView_onTouchMoved);\n        tolua_function(tolua_S,\"getContentOffset\",lua_cocos2dx_extension_ScrollView_getContentOffset);\n        tolua_function(tolua_S,\"resume\",lua_cocos2dx_extension_ScrollView_resume);\n        tolua_function(tolua_S,\"setClippingToBounds\",lua_cocos2dx_extension_ScrollView_setClippingToBounds);\n        tolua_function(tolua_S,\"setViewSize\",lua_cocos2dx_extension_ScrollView_setViewSize);\n        tolua_function(tolua_S,\"onTouchCancelled\",lua_cocos2dx_extension_ScrollView_onTouchCancelled);\n        tolua_function(tolua_S,\"getViewSize\",lua_cocos2dx_extension_ScrollView_getViewSize);\n        tolua_function(tolua_S,\"maxContainerOffset\",lua_cocos2dx_extension_ScrollView_maxContainerOffset);\n        tolua_function(tolua_S,\"onTouchBegan\",lua_cocos2dx_extension_ScrollView_onTouchBegan);\n        tolua_function(tolua_S,\"isTouchMoved\",lua_cocos2dx_extension_ScrollView_isTouchMoved);\n        tolua_function(tolua_S,\"isNodeVisible\",lua_cocos2dx_extension_ScrollView_isNodeVisible);\n        tolua_function(tolua_S,\"minContainerOffset\",lua_cocos2dx_extension_ScrollView_minContainerOffset);\n        tolua_function(tolua_S,\"setZoomScale\",lua_cocos2dx_extension_ScrollView_setZoomScale);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_ScrollView_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_ScrollView_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::ScrollView).name();\n    g_luaType[typeName] = \"cc.ScrollView\";\n    g_typeCast[\"ScrollView\"] = \"cc.ScrollView\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_TableViewCell_reset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableViewCell* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableViewCell\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableViewCell*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableViewCell_reset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->reset();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableViewCell_reset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableViewCell_getIdx(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableViewCell* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableViewCell\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableViewCell*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableViewCell_getIdx'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getIdx();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getIdx\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableViewCell_getIdx'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableViewCell_setIdx(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableViewCell* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableViewCell\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableViewCell*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableViewCell_setIdx'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setIdx(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setIdx\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableViewCell_setIdx'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableViewCell_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.TableViewCell\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::extension::TableViewCell* ret = cocos2d::extension::TableViewCell::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TableViewCell\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::TableViewCell*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableViewCell_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_TableViewCell_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableViewCell* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::TableViewCell();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TableViewCell\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TableViewCell\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TableViewCell\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableViewCell_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_TableViewCell_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TableViewCell)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_TableViewCell(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TableViewCell\");\n    tolua_cclass(tolua_S,\"TableViewCell\",\"cc.TableViewCell\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TableViewCell\");\n        tolua_function(tolua_S,\"reset\",lua_cocos2dx_extension_TableViewCell_reset);\n        tolua_function(tolua_S,\"getIdx\",lua_cocos2dx_extension_TableViewCell_getIdx);\n        tolua_function(tolua_S,\"setIdx\",lua_cocos2dx_extension_TableViewCell_setIdx);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_TableViewCell_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_TableViewCell_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::TableViewCell).name();\n    g_luaType[typeName] = \"cc.TableViewCell\";\n    g_typeCast[\"TableViewCell\"] = \"cc.TableViewCell\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_TableView_updateCellAtIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_updateCellAtIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->updateCellAtIndex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateCellAtIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_updateCellAtIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_setVerticalFillOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_setVerticalFillOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::TableView::VerticalFillOrder arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setVerticalFillOrder(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVerticalFillOrder\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_setVerticalFillOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_scrollViewDidZoom(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_scrollViewDidZoom'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::ScrollView* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ScrollView\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->scrollViewDidZoom(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollViewDidZoom\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_scrollViewDidZoom'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView__updateContentSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView__updateContentSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->_updateContentSize();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"_updateContentSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView__updateContentSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_getVerticalFillOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_getVerticalFillOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getVerticalFillOrder();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVerticalFillOrder\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_getVerticalFillOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_removeCellAtIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_removeCellAtIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->removeCellAtIndex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeCellAtIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_removeCellAtIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_initWithViewSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_initWithViewSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithViewSize(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        cocos2d::Size arg0;\n        cocos2d::Node* arg1;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithViewSize(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithViewSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_initWithViewSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_scrollViewDidScroll(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_scrollViewDidScroll'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::ScrollView* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.ScrollView\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::extension::ScrollView*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->scrollViewDidScroll(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollViewDidScroll\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_scrollViewDidScroll'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_reloadData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_reloadData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->reloadData();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reloadData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_reloadData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_insertCellAtIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_insertCellAtIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->insertCellAtIndex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"insertCellAtIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_insertCellAtIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_cellAtIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_cellAtIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::extension::TableViewCell* ret = cobj->cellAtIndex(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TableViewCell\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::TableViewCell*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"cellAtIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_cellAtIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_dequeueCell(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::TableView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_TableView_dequeueCell'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::extension::TableViewCell* ret = cobj->dequeueCell();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.TableViewCell\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::TableViewCell*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"dequeueCell\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_dequeueCell'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_TableView_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::TableView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::TableView();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.TableView\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.TableView\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TableView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_TableView_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_TableView_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TableView)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_TableView(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.TableView\");\n    tolua_cclass(tolua_S,\"TableView\",\"cc.TableView\",\"cc.ScrollView\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TableView\");\n        tolua_function(tolua_S,\"updateCellAtIndex\",lua_cocos2dx_extension_TableView_updateCellAtIndex);\n        tolua_function(tolua_S,\"setVerticalFillOrder\",lua_cocos2dx_extension_TableView_setVerticalFillOrder);\n        tolua_function(tolua_S,\"scrollViewDidZoom\",lua_cocos2dx_extension_TableView_scrollViewDidZoom);\n        tolua_function(tolua_S,\"_updateContentSize\",lua_cocos2dx_extension_TableView__updateContentSize);\n        tolua_function(tolua_S,\"getVerticalFillOrder\",lua_cocos2dx_extension_TableView_getVerticalFillOrder);\n        tolua_function(tolua_S,\"removeCellAtIndex\",lua_cocos2dx_extension_TableView_removeCellAtIndex);\n        tolua_function(tolua_S,\"initWithViewSize\",lua_cocos2dx_extension_TableView_initWithViewSize);\n        tolua_function(tolua_S,\"scrollViewDidScroll\",lua_cocos2dx_extension_TableView_scrollViewDidScroll);\n        tolua_function(tolua_S,\"reloadData\",lua_cocos2dx_extension_TableView_reloadData);\n        tolua_function(tolua_S,\"insertCellAtIndex\",lua_cocos2dx_extension_TableView_insertCellAtIndex);\n        tolua_function(tolua_S,\"cellAtIndex\",lua_cocos2dx_extension_TableView_cellAtIndex);\n        tolua_function(tolua_S,\"dequeueCell\",lua_cocos2dx_extension_TableView_dequeueCell);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_TableView_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::TableView).name();\n    g_luaType[typeName] = \"cc.TableView\";\n    g_typeCast[\"TableView\"] = \"cc.TableView\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_EditBox_getText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_getText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getText();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getText\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_getText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setPlaceholderFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setPlaceholderFontName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlaceholderFontName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_getPlaceHolder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_getPlaceHolder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getPlaceHolder();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPlaceHolder\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_getPlaceHolder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setFontName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setPlaceholderFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPlaceholderFontSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlaceholderFontSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setInputMode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setInputMode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::EditBox::InputMode arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInputMode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInputMode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setInputMode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setPlaceholderFontColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPlaceholderFontColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlaceholderFontColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setFontColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFontColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setFontColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setPlaceholderFont(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFont'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        int arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setPlaceholderFont(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlaceholderFont\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFont'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Size arg0;\n        cocos2d::extension::Scale9Sprite* arg1;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithSizeAndBackgroundSprite(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithSizeAndBackgroundSprite\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setPlaceHolder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceHolder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setPlaceHolder(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlaceHolder\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceHolder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setReturnType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setReturnType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::EditBox::KeyboardReturnType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setReturnType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setReturnType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setReturnType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setInputFlag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setInputFlag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::EditBox::InputFlag arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInputFlag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInputFlag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setInputFlag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_getMaxLength(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_getMaxLength'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getMaxLength();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaxLength\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_getMaxLength'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setText(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setText\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setMaxLength(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setMaxLength'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaxLength(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaxLength\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setMaxLength'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_setFont(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFont'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        int arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setFont(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFont\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_setFont'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::Size arg0;\n        cocos2d::extension::Scale9Sprite* arg1;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EditBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::EditBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Size arg0;\n        cocos2d::extension::Scale9Sprite* arg1;\n        cocos2d::extension::Scale9Sprite* arg2;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EditBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::EditBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        cocos2d::Size arg0;\n        cocos2d::extension::Scale9Sprite* arg1;\n        cocos2d::extension::Scale9Sprite* arg2;\n        cocos2d::extension::Scale9Sprite* arg3;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.Scale9Sprite\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EditBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::EditBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_EditBox_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::EditBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::EditBox();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.EditBox\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.EditBox\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"EditBox\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_EditBox_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_EditBox_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EditBox)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_EditBox(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EditBox\");\n    tolua_cclass(tolua_S,\"EditBox\",\"cc.EditBox\",\"cc.ControlButton\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EditBox\");\n        tolua_function(tolua_S,\"getText\",lua_cocos2dx_extension_EditBox_getText);\n        tolua_function(tolua_S,\"setPlaceholderFontName\",lua_cocos2dx_extension_EditBox_setPlaceholderFontName);\n        tolua_function(tolua_S,\"getPlaceHolder\",lua_cocos2dx_extension_EditBox_getPlaceHolder);\n        tolua_function(tolua_S,\"setFontName\",lua_cocos2dx_extension_EditBox_setFontName);\n        tolua_function(tolua_S,\"setPlaceholderFontSize\",lua_cocos2dx_extension_EditBox_setPlaceholderFontSize);\n        tolua_function(tolua_S,\"setInputMode\",lua_cocos2dx_extension_EditBox_setInputMode);\n        tolua_function(tolua_S,\"setPlaceholderFontColor\",lua_cocos2dx_extension_EditBox_setPlaceholderFontColor);\n        tolua_function(tolua_S,\"setFontColor\",lua_cocos2dx_extension_EditBox_setFontColor);\n        tolua_function(tolua_S,\"setPlaceholderFont\",lua_cocos2dx_extension_EditBox_setPlaceholderFont);\n        tolua_function(tolua_S,\"setFontSize\",lua_cocos2dx_extension_EditBox_setFontSize);\n        tolua_function(tolua_S,\"initWithSizeAndBackgroundSprite\",lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite);\n        tolua_function(tolua_S,\"setPlaceHolder\",lua_cocos2dx_extension_EditBox_setPlaceHolder);\n        tolua_function(tolua_S,\"setReturnType\",lua_cocos2dx_extension_EditBox_setReturnType);\n        tolua_function(tolua_S,\"setInputFlag\",lua_cocos2dx_extension_EditBox_setInputFlag);\n        tolua_function(tolua_S,\"getMaxLength\",lua_cocos2dx_extension_EditBox_getMaxLength);\n        tolua_function(tolua_S,\"setText\",lua_cocos2dx_extension_EditBox_setText);\n        tolua_function(tolua_S,\"setMaxLength\",lua_cocos2dx_extension_EditBox_setMaxLength);\n        tolua_function(tolua_S,\"setFont\",lua_cocos2dx_extension_EditBox_setFont);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_EditBox_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_EditBox_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::EditBox).name();\n    g_luaType[typeName] = \"cc.EditBox\";\n    g_typeCast[\"EditBox\"] = \"cc.EditBox\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_AssetsManager_setStoragePath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_setStoragePath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setStoragePath(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStoragePath\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_setStoragePath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_setPackageUrl(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_setPackageUrl'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setPackageUrl(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPackageUrl\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_setPackageUrl'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_checkUpdate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_checkUpdate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->checkUpdate();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"checkUpdate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_checkUpdate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_getStoragePath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_getStoragePath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getStoragePath();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStoragePath\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_getStoragePath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_update(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_update'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->update();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"update\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_update'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_setConnectionTimeout(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_setConnectionTimeout'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setConnectionTimeout(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setConnectionTimeout\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_setConnectionTimeout'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_setVersionFileUrl(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_setVersionFileUrl'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setVersionFileUrl(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVersionFileUrl\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_setVersionFileUrl'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_getPackageUrl(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_getPackageUrl'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getPackageUrl();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPackageUrl\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_getPackageUrl'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_getConnectionTimeout(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_getConnectionTimeout'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        unsigned int ret = cobj->getConnectionTimeout();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getConnectionTimeout\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_getConnectionTimeout'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_getVersion(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_getVersion'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getVersion();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVersion\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_getVersion'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_getVersionFileUrl(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_getVersionFileUrl'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getVersionFileUrl();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVersionFileUrl\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_getVersionFileUrl'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_deleteVersion(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::extension::AssetsManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_AssetsManager_deleteVersion'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->deleteVersion();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"deleteVersion\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_deleteVersion'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 6)\n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n        std::function<void (int)> arg3;\n        std::function<void (int)> arg4;\n        std::function<void ()> arg5;\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n        do {\n\t\t\t// Lambda binding for lua is not supported.\n\t\t\tassert(false);\n\t\t} while(0)\n\t\t;\n        do {\n\t\t\t// Lambda binding for lua is not supported.\n\t\t\tassert(false);\n\t\t} while(0)\n\t\t;\n        do {\n\t\t\t// Lambda binding for lua is not supported.\n\t\t\tassert(false);\n\t\t} while(0)\n\t\t;\n        if(!ok)\n            return 0;\n        cocos2d::extension::AssetsManager* ret = cocos2d::extension::AssetsManager::create(arg0, arg1, arg2, arg3, arg4, arg5);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.AssetsManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::extension::AssetsManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 6);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_AssetsManager_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::extension::AssetsManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::AssetsManager();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.AssetsManager\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.AssetsManager\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::AssetsManager(arg0);\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.AssetsManager\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.AssetsManager\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        const char* arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::AssetsManager(arg0, arg1);\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.AssetsManager\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.AssetsManager\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    if (argc == 3) \n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::extension::AssetsManager(arg0, arg1, arg2);\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.AssetsManager\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.AssetsManager\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"AssetsManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_AssetsManager_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_AssetsManager_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (AssetsManager)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_AssetsManager(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.AssetsManager\");\n    tolua_cclass(tolua_S,\"AssetsManager\",\"cc.AssetsManager\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"AssetsManager\");\n        tolua_function(tolua_S,\"setStoragePath\",lua_cocos2dx_extension_AssetsManager_setStoragePath);\n        tolua_function(tolua_S,\"setPackageUrl\",lua_cocos2dx_extension_AssetsManager_setPackageUrl);\n        tolua_function(tolua_S,\"checkUpdate\",lua_cocos2dx_extension_AssetsManager_checkUpdate);\n        tolua_function(tolua_S,\"getStoragePath\",lua_cocos2dx_extension_AssetsManager_getStoragePath);\n        tolua_function(tolua_S,\"update\",lua_cocos2dx_extension_AssetsManager_update);\n        tolua_function(tolua_S,\"setConnectionTimeout\",lua_cocos2dx_extension_AssetsManager_setConnectionTimeout);\n        tolua_function(tolua_S,\"setVersionFileUrl\",lua_cocos2dx_extension_AssetsManager_setVersionFileUrl);\n        tolua_function(tolua_S,\"getPackageUrl\",lua_cocos2dx_extension_AssetsManager_getPackageUrl);\n        tolua_function(tolua_S,\"getConnectionTimeout\",lua_cocos2dx_extension_AssetsManager_getConnectionTimeout);\n        tolua_function(tolua_S,\"getVersion\",lua_cocos2dx_extension_AssetsManager_getVersion);\n        tolua_function(tolua_S,\"getVersionFileUrl\",lua_cocos2dx_extension_AssetsManager_getVersionFileUrl);\n        tolua_function(tolua_S,\"deleteVersion\",lua_cocos2dx_extension_AssetsManager_deleteVersion);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_AssetsManager_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_extension_AssetsManager_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::extension::AssetsManager).name();\n    g_luaType[typeName] = \"cc.AssetsManager\";\n    g_typeCast[\"AssetsManager\"] = \"cc.AssetsManager\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_CCBAnimationManager_moveAnimationsFromNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_moveAnimationsFromNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::Node* arg0;\n        cocos2d::Node* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->moveAnimationsFromNode(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"moveAnimationsFromNode\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_moveAnimationsFromNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_setAutoPlaySequenceId(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_setAutoPlaySequenceId'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAutoPlaySequenceId(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAutoPlaySequenceId\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_setAutoPlaySequenceId'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector& ret = cobj->getDocumentCallbackNames();\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDocumentCallbackNames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_actionForSoundChannel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_actionForSoundChannel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocosbuilder::CCBSequenceProperty* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.CCBSequenceProperty\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::CCBSequenceProperty*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Object* ret = cobj->actionForSoundChannel(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Object\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Object*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"actionForSoundChannel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_actionForSoundChannel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_setBaseValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_setBaseValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Value arg0;\n        cocos2d::Node* arg1;\n        std::string arg2;\n\n        ok &= luaval_to_ccvalue(tolua_S, 2, &arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setBaseValue(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBaseValue\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_setBaseValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNodes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNodes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::Node *>& ret = cobj->getDocumentOutletNodes();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDocumentOutletNodes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNodes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getLastCompletedSequenceName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getLastCompletedSequenceName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getLastCompletedSequenceName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLastCompletedSequenceName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getLastCompletedSequenceName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_setRootNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_setRootNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setRootNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRootNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_setRootNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        double arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->runAnimationsForSequenceNamedTweenDuration(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"runAnimationsForSequenceNamedTweenDuration\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addDocumentOutletName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDocumentOutletName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getSequences(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getSequences'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocosbuilder::CCBSequence *>& ret = cobj->getSequences();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSequences\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getSequences'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getRootContainerSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getRootContainerSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getRootContainerSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRootContainerSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getRootContainerSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_setDocumentControllerName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_setDocumentControllerName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDocumentControllerName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDocumentControllerName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_setDocumentControllerName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_setObject(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_setObject'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Object* arg0;\n        cocos2d::Node* arg1;\n        std::string arg2;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Object\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Object*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::Node*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setObject(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setObject\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_setObject'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getContainerSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getContainerSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getContainerSize(arg0);\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContainerSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getContainerSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_actionForCallbackChannel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_actionForCallbackChannel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocosbuilder::CCBSequenceProperty* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.CCBSequenceProperty\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::CCBSequenceProperty*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::Object* ret = cobj->actionForCallbackChannel(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Object\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Object*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"actionForCallbackChannel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_actionForCallbackChannel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector& ret = cobj->getDocumentOutletNames();\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDocumentOutletNames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackControlEvents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackControlEvents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::EventType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->addDocumentCallbackControlEvents(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDocumentCallbackControlEvents\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackControlEvents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getKeyframeCallbacks(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getKeyframeCallbacks'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector& ret = cobj->getKeyframeCallbacks();\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getKeyframeCallbacks\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getKeyframeCallbacks'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackControlEvents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackControlEvents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector& ret = cobj->getDocumentCallbackControlEvents();\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDocumentCallbackControlEvents\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackControlEvents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_setRootContainerSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_setRootContainerSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setRootContainerSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRootContainerSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_setRootContainerSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        double arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->runAnimationsForSequenceIdTweenDuration(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"runAnimationsForSequenceIdTweenDuration\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getRunningSequenceName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getRunningSequenceName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getRunningSequenceName();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRunningSequenceName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getRunningSequenceName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getAutoPlaySequenceId(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getAutoPlaySequenceId'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getAutoPlaySequenceId();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAutoPlaySequenceId\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getAutoPlaySequenceId'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addDocumentCallbackName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDocumentCallbackName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getRootNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getRootNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getRootNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRootNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getRootNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addDocumentOutletNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDocumentOutletNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getSequenceDuration(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getSequenceDuration'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        double ret = cobj->getSequenceDuration(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSequenceDuration\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getSequenceDuration'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addDocumentCallbackNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDocumentCallbackNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->runAnimationsForSequenceNamed(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"runAnimationsForSequenceNamed\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getSequenceId(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getSequenceId'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        int ret = cobj->getSequenceId(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSequenceId\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getSequenceId'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNodes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNodes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::Node *>& ret = cobj->getDocumentCallbackNodes();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDocumentCallbackNodes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNodes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_setSequences(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_setSequences'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Vector<cocosbuilder::CCBSequence *> arg0;\n\n        ok &= luaval_to_ccvector(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setSequences(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSequences\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_setSequences'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_debug(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_debug'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->debug();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"debug\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_debug'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_getDocumentControllerName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentControllerName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getDocumentControllerName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDocumentControllerName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_getDocumentControllerName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBAnimationManager_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBAnimationManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocosbuilder::CCBAnimationManager();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CCBAnimationManager\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CCBAnimationManager\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"CCBAnimationManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBAnimationManager_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_CCBAnimationManager_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CCBAnimationManager)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_CCBAnimationManager(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.CCBAnimationManager\");\n    tolua_cclass(tolua_S,\"CCBAnimationManager\",\"cc.CCBAnimationManager\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CCBAnimationManager\");\n        tolua_function(tolua_S,\"moveAnimationsFromNode\",lua_cocos2dx_extension_CCBAnimationManager_moveAnimationsFromNode);\n        tolua_function(tolua_S,\"setAutoPlaySequenceId\",lua_cocos2dx_extension_CCBAnimationManager_setAutoPlaySequenceId);\n        tolua_function(tolua_S,\"getDocumentCallbackNames\",lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNames);\n        tolua_function(tolua_S,\"actionForSoundChannel\",lua_cocos2dx_extension_CCBAnimationManager_actionForSoundChannel);\n        tolua_function(tolua_S,\"setBaseValue\",lua_cocos2dx_extension_CCBAnimationManager_setBaseValue);\n        tolua_function(tolua_S,\"getDocumentOutletNodes\",lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNodes);\n        tolua_function(tolua_S,\"getLastCompletedSequenceName\",lua_cocos2dx_extension_CCBAnimationManager_getLastCompletedSequenceName);\n        tolua_function(tolua_S,\"setRootNode\",lua_cocos2dx_extension_CCBAnimationManager_setRootNode);\n        tolua_function(tolua_S,\"runAnimationsForSequenceNamedTweenDuration\",lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamedTweenDuration);\n        tolua_function(tolua_S,\"addDocumentOutletName\",lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletName);\n        tolua_function(tolua_S,\"getSequences\",lua_cocos2dx_extension_CCBAnimationManager_getSequences);\n        tolua_function(tolua_S,\"getRootContainerSize\",lua_cocos2dx_extension_CCBAnimationManager_getRootContainerSize);\n        tolua_function(tolua_S,\"setDocumentControllerName\",lua_cocos2dx_extension_CCBAnimationManager_setDocumentControllerName);\n        tolua_function(tolua_S,\"setObject\",lua_cocos2dx_extension_CCBAnimationManager_setObject);\n        tolua_function(tolua_S,\"getContainerSize\",lua_cocos2dx_extension_CCBAnimationManager_getContainerSize);\n        tolua_function(tolua_S,\"actionForCallbackChannel\",lua_cocos2dx_extension_CCBAnimationManager_actionForCallbackChannel);\n        tolua_function(tolua_S,\"getDocumentOutletNames\",lua_cocos2dx_extension_CCBAnimationManager_getDocumentOutletNames);\n        tolua_function(tolua_S,\"addDocumentCallbackControlEvents\",lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackControlEvents);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_extension_CCBAnimationManager_init);\n        tolua_function(tolua_S,\"getKeyframeCallbacks\",lua_cocos2dx_extension_CCBAnimationManager_getKeyframeCallbacks);\n        tolua_function(tolua_S,\"getDocumentCallbackControlEvents\",lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackControlEvents);\n        tolua_function(tolua_S,\"setRootContainerSize\",lua_cocos2dx_extension_CCBAnimationManager_setRootContainerSize);\n        tolua_function(tolua_S,\"runAnimationsForSequenceIdTweenDuration\",lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceIdTweenDuration);\n        tolua_function(tolua_S,\"getRunningSequenceName\",lua_cocos2dx_extension_CCBAnimationManager_getRunningSequenceName);\n        tolua_function(tolua_S,\"getAutoPlaySequenceId\",lua_cocos2dx_extension_CCBAnimationManager_getAutoPlaySequenceId);\n        tolua_function(tolua_S,\"addDocumentCallbackName\",lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackName);\n        tolua_function(tolua_S,\"getRootNode\",lua_cocos2dx_extension_CCBAnimationManager_getRootNode);\n        tolua_function(tolua_S,\"addDocumentOutletNode\",lua_cocos2dx_extension_CCBAnimationManager_addDocumentOutletNode);\n        tolua_function(tolua_S,\"getSequenceDuration\",lua_cocos2dx_extension_CCBAnimationManager_getSequenceDuration);\n        tolua_function(tolua_S,\"addDocumentCallbackNode\",lua_cocos2dx_extension_CCBAnimationManager_addDocumentCallbackNode);\n        tolua_function(tolua_S,\"runAnimationsForSequenceNamed\",lua_cocos2dx_extension_CCBAnimationManager_runAnimationsForSequenceNamed);\n        tolua_function(tolua_S,\"getSequenceId\",lua_cocos2dx_extension_CCBAnimationManager_getSequenceId);\n        tolua_function(tolua_S,\"getDocumentCallbackNodes\",lua_cocos2dx_extension_CCBAnimationManager_getDocumentCallbackNodes);\n        tolua_function(tolua_S,\"setSequences\",lua_cocos2dx_extension_CCBAnimationManager_setSequences);\n        tolua_function(tolua_S,\"debug\",lua_cocos2dx_extension_CCBAnimationManager_debug);\n        tolua_function(tolua_S,\"getDocumentControllerName\",lua_cocos2dx_extension_CCBAnimationManager_getDocumentControllerName);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_CCBAnimationManager_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocosbuilder::CCBAnimationManager).name();\n    g_luaType[typeName] = \"cc.CCBAnimationManager\";\n    g_typeCast[\"CCBAnimationManager\"] = \"cc.CCBAnimationManager\";\n    return 1;\n}\n\nint lua_cocos2dx_extension_CCBReader_addOwnerOutletName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_addOwnerOutletName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addOwnerOutletName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addOwnerOutletName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_addOwnerOutletName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getOwnerCallbackNames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getOwnerCallbackNames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector ret = cobj->getOwnerCallbackNames();\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOwnerCallbackNames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getOwnerCallbackNames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_addDocumentCallbackControlEvents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_addDocumentCallbackControlEvents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::EventType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->addDocumentCallbackControlEvents(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDocumentCallbackControlEvents\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_addDocumentCallbackControlEvents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_setCCBRootPath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_setCCBRootPath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setCCBRootPath(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCCBRootPath\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_setCCBRootPath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_addOwnerOutletNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_addOwnerOutletNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addOwnerOutletNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addOwnerOutletNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_addOwnerOutletNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getOwnerCallbackNodes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getOwnerCallbackNodes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::Node *>& ret = cobj->getOwnerCallbackNodes();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOwnerCallbackNodes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getOwnerCallbackNodes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_readSoundKeyframesForSeq(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_readSoundKeyframesForSeq'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocosbuilder::CCBSequence* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.CCBSequence\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::CCBSequence*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->readSoundKeyframesForSeq(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"readSoundKeyframesForSeq\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_readSoundKeyframesForSeq'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getCCBRootPath(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getCCBRootPath'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getCCBRootPath();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCCBRootPath\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getCCBRootPath'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getOwnerCallbackControlEvents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getOwnerCallbackControlEvents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector& ret = cobj->getOwnerCallbackControlEvents();\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOwnerCallbackControlEvents\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getOwnerCallbackControlEvents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getOwnerOutletNodes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getOwnerOutletNodes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::Node *>& ret = cobj->getOwnerOutletNodes();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOwnerOutletNodes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getOwnerOutletNodes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_readUTF8(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_readUTF8'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->readUTF8();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"readUTF8\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_readUTF8'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_addOwnerCallbackControlEvents(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_addOwnerCallbackControlEvents'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::extension::Control::EventType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->addOwnerCallbackControlEvents(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addOwnerCallbackControlEvents\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_addOwnerCallbackControlEvents'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getOwnerOutletNames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getOwnerOutletNames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::ValueVector ret = cobj->getOwnerOutletNames();\n        ccvaluevector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOwnerOutletNames\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getOwnerOutletNames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_setAnimationManager(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_setAnimationManager'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocosbuilder::CCBAnimationManager* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.CCBAnimationManager\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::CCBAnimationManager*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setAnimationManager(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimationManager\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_setAnimationManager'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_readCallbackKeyframesForSeq(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_readCallbackKeyframesForSeq'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocosbuilder::CCBSequence* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.CCBSequence\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::CCBSequence*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->readCallbackKeyframesForSeq(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"readCallbackKeyframesForSeq\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_readCallbackKeyframesForSeq'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getAnimationManagersForNodes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getAnimationManagersForNodes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocosbuilder::CCBAnimationManager *>& ret = cobj->getAnimationManagersForNodes();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimationManagersForNodes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getAnimationManagersForNodes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getNodesWithAnimationManagers(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getNodesWithAnimationManagers'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::Node *>& ret = cobj->getNodesWithAnimationManagers();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodesWithAnimationManagers\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getNodesWithAnimationManagers'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_getAnimationManager(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_extension_CCBReader_getAnimationManager'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocosbuilder::CCBAnimationManager* ret = cobj->getAnimationManager();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.CCBAnimationManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocosbuilder::CCBAnimationManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimationManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_getAnimationManager'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_setResolutionScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocosbuilder::CCBReader::setResolutionScale(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"setResolutionScale\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_setResolutionScale'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_extension_CCBReader_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocosbuilder::CCBReader* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            cocosbuilder::CCBReader* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.CCBReader\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::CCBReader*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj = new cocosbuilder::CCBReader(arg0);\n            cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n            if (NULL != dynObject) \n            {\n                dynObject->autorelease();\n                int ID =  (int)dynObject->_ID ;\n                int* luaID =  &dynObject->_luaID ;\n                toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CCBReader\");\n            }\n            else\n            {\n                tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CCBReader\");\n                tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n            }\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocosbuilder::NodeLoaderLibrary* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.NodeLoaderLibrary\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj = new cocosbuilder::CCBReader(arg0);\n            cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n            if (NULL != dynObject) \n            {\n                dynObject->autorelease();\n                int ID =  (int)dynObject->_ID ;\n                int* luaID =  &dynObject->_luaID ;\n                toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CCBReader\");\n            }\n            else\n            {\n                tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CCBReader\");\n                tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n            }\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            cocosbuilder::NodeLoaderLibrary* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.NodeLoaderLibrary\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocosbuilder::CCBMemberVariableAssigner* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.CCBMemberVariableAssigner\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocosbuilder::CCBMemberVariableAssigner*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj = new cocosbuilder::CCBReader(arg0, arg1);\n            cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n            if (NULL != dynObject) \n            {\n                dynObject->autorelease();\n                int ID =  (int)dynObject->_ID ;\n                int* luaID =  &dynObject->_luaID ;\n                toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CCBReader\");\n            }\n            else\n            {\n                tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CCBReader\");\n                tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n            }\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            cocosbuilder::NodeLoaderLibrary* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.NodeLoaderLibrary\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocosbuilder::CCBMemberVariableAssigner* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.CCBMemberVariableAssigner\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocosbuilder::CCBMemberVariableAssigner*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocosbuilder::CCBSelectorResolver* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.CCBSelectorResolver\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocosbuilder::CCBSelectorResolver*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj = new cocosbuilder::CCBReader(arg0, arg1, arg2);\n            cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n            if (NULL != dynObject) \n            {\n                dynObject->autorelease();\n                int ID =  (int)dynObject->_ID ;\n                int* luaID =  &dynObject->_luaID ;\n                toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CCBReader\");\n            }\n            else\n            {\n                tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CCBReader\");\n                tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n            }\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 4) {\n            cocosbuilder::NodeLoaderLibrary* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.NodeLoaderLibrary\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocosbuilder::NodeLoaderLibrary*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocosbuilder::CCBMemberVariableAssigner* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.CCBMemberVariableAssigner\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocosbuilder::CCBMemberVariableAssigner*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocosbuilder::CCBSelectorResolver* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.CCBSelectorResolver\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocosbuilder::CCBSelectorResolver*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocosbuilder::NodeLoaderListener* arg3;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,5,\"cc.NodeLoaderListener\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ3 = (cocosbuilder::NodeLoaderListener*)tolua_tousertype(tolua_S,5,0);\n\t\t\t\t\tif (nullptr == arg3){\n\t\t\t\t\t\tLUA_PRECONDITION( arg3, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj = new cocosbuilder::CCBReader(arg0, arg1, arg2, arg3);\n            cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n            if (NULL != dynObject) \n            {\n                dynObject->autorelease();\n                int ID =  (int)dynObject->_ID ;\n                int* luaID =  &dynObject->_luaID ;\n                toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CCBReader\");\n            }\n            else\n            {\n                tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CCBReader\");\n                tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n            }\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cobj = new cocosbuilder::CCBReader();\n            cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n            if (NULL != dynObject) \n            {\n                dynObject->autorelease();\n                int ID =  (int)dynObject->_ID ;\n                int* luaID =  &dynObject->_luaID ;\n                toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"cc.CCBReader\");\n            }\n            else\n            {\n                tolua_pushusertype(tolua_S,(void*)cobj,\"cc.CCBReader\");\n                tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n            }\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"CCBReader\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_extension_CCBReader_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_extension_CCBReader_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CCBReader)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_extension_CCBReader(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.CCBReader\");\n    tolua_cclass(tolua_S,\"CCBReader\",\"cc.CCBReader\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CCBReader\");\n        tolua_function(tolua_S,\"addOwnerOutletName\",lua_cocos2dx_extension_CCBReader_addOwnerOutletName);\n        tolua_function(tolua_S,\"getOwnerCallbackNames\",lua_cocos2dx_extension_CCBReader_getOwnerCallbackNames);\n        tolua_function(tolua_S,\"addDocumentCallbackControlEvents\",lua_cocos2dx_extension_CCBReader_addDocumentCallbackControlEvents);\n        tolua_function(tolua_S,\"setCCBRootPath\",lua_cocos2dx_extension_CCBReader_setCCBRootPath);\n        tolua_function(tolua_S,\"addOwnerOutletNode\",lua_cocos2dx_extension_CCBReader_addOwnerOutletNode);\n        tolua_function(tolua_S,\"getOwnerCallbackNodes\",lua_cocos2dx_extension_CCBReader_getOwnerCallbackNodes);\n        tolua_function(tolua_S,\"readSoundKeyframesForSeq\",lua_cocos2dx_extension_CCBReader_readSoundKeyframesForSeq);\n        tolua_function(tolua_S,\"getCCBRootPath\",lua_cocos2dx_extension_CCBReader_getCCBRootPath);\n        tolua_function(tolua_S,\"getOwnerCallbackControlEvents\",lua_cocos2dx_extension_CCBReader_getOwnerCallbackControlEvents);\n        tolua_function(tolua_S,\"getOwnerOutletNodes\",lua_cocos2dx_extension_CCBReader_getOwnerOutletNodes);\n        tolua_function(tolua_S,\"readUTF8\",lua_cocos2dx_extension_CCBReader_readUTF8);\n        tolua_function(tolua_S,\"addOwnerCallbackControlEvents\",lua_cocos2dx_extension_CCBReader_addOwnerCallbackControlEvents);\n        tolua_function(tolua_S,\"getOwnerOutletNames\",lua_cocos2dx_extension_CCBReader_getOwnerOutletNames);\n        tolua_function(tolua_S,\"setActionManager\",lua_cocos2dx_extension_CCBReader_setAnimationManager);\n        tolua_function(tolua_S,\"readCallbackKeyframesForSeq\",lua_cocos2dx_extension_CCBReader_readCallbackKeyframesForSeq);\n        tolua_function(tolua_S,\"getAnimationManagersForNodes\",lua_cocos2dx_extension_CCBReader_getAnimationManagersForNodes);\n        tolua_function(tolua_S,\"getNodesWithAnimationManagers\",lua_cocos2dx_extension_CCBReader_getNodesWithAnimationManagers);\n        tolua_function(tolua_S,\"getActionManager\",lua_cocos2dx_extension_CCBReader_getAnimationManager);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_extension_CCBReader_constructor);\n        tolua_function(tolua_S,\"setResolutionScale\", lua_cocos2dx_extension_CCBReader_setResolutionScale);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocosbuilder::CCBReader).name();\n    g_luaType[typeName] = \"cc.CCBReader\";\n    g_typeCast[\"CCBReader\"] = \"cc.CCBReader\";\n    return 1;\n}\nTOLUA_API int register_all_cocos2dx_extension(lua_State* tolua_S)\n{\n\ttolua_open(tolua_S);\n\t\n\ttolua_module(tolua_S,\"cc\",0);\n\ttolua_beginmodule(tolua_S,\"cc\");\n\n\tlua_register_cocos2dx_extension_Control(tolua_S);\n\tlua_register_cocos2dx_extension_TableViewCell(tolua_S);\n\tlua_register_cocos2dx_extension_Scale9Sprite(tolua_S);\n\tlua_register_cocos2dx_extension_ControlSwitch(tolua_S);\n\tlua_register_cocos2dx_extension_ScrollView(tolua_S);\n\tlua_register_cocos2dx_extension_TableView(tolua_S);\n\tlua_register_cocos2dx_extension_AssetsManager(tolua_S);\n\tlua_register_cocos2dx_extension_ControlButton(tolua_S);\n\tlua_register_cocos2dx_extension_EditBox(tolua_S);\n\tlua_register_cocos2dx_extension_ControlSlider(tolua_S);\n\tlua_register_cocos2dx_extension_ControlStepper(tolua_S);\n\tlua_register_cocos2dx_extension_CCBReader(tolua_S);\n\tlua_register_cocos2dx_extension_ControlSaturationBrightnessPicker(tolua_S);\n\tlua_register_cocos2dx_extension_ControlColourPicker(tolua_S);\n\tlua_register_cocos2dx_extension_ControlPotentiometer(tolua_S);\n\tlua_register_cocos2dx_extension_CCBAnimationManager(tolua_S);\n\tlua_register_cocos2dx_extension_ControlHuePicker(tolua_S);\n\n\ttolua_endmodule(tolua_S);\n\treturn 1;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_extension_auto.hpp",
    "content": "#ifndef __cocos2dx_extension_h__\n#define __cocos2dx_extension_h__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\nint register_all_cocos2dx_extension(lua_State* tolua_S);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#endif // __cocos2dx_extension_h__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_extension_auto_api.js",
    "content": "/**\n * @module cocos2dx_extension\n */\nvar cc = cc || {};\n\n/**\n * @class Scale9Sprite\n */\ncc.Scale9Sprite = {\n\n/**\n * @method resizableSpriteWithCapInsets\n * @return A value converted from C/C++ \"cocos2d::extension::Scale9Sprite*\"\n * @param {const cocos2d::Rect&}\n */\nresizableSpriteWithCapInsets : function () {},\n\n/**\n * @method setInsetBottom\n * @param {float}\n */\nsetInsetBottom : function () {},\n\n/**\n * @method setInsetTop\n * @param {float}\n */\nsetInsetTop : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setPreferredSize\n * @param {cocos2d::Size}\n */\nsetPreferredSize : function () {},\n\n/**\n * @method setSpriteFrame\n * @param {cocos2d::SpriteFrame*}\n */\nsetSpriteFrame : function () {},\n\n/**\n * @method getInsetBottom\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetBottom : function () {},\n\n/**\n * @method getCapInsets\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\ngetCapInsets : function () {},\n\n/**\n * @method updateWithBatchNode\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::SpriteBatchNode*}\n * @param {const cocos2d::Rect&}\n * @param {bool}\n * @param {const cocos2d::Rect&}\n */\nupdateWithBatchNode : function () {},\n\n/**\n * @method getInsetRight\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetRight : function () {},\n\n/**\n * @method getOriginalSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetOriginalSize : function () {},\n\n/**\n * @method getInsetTop\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetTop : function () {},\n\n/**\n * @method setInsetLeft\n * @param {float}\n */\nsetInsetLeft : function () {},\n\n/**\n * @method getPreferredSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetPreferredSize : function () {},\n\n/**\n * @method setCapInsets\n * @param {cocos2d::Rect}\n */\nsetCapInsets : function () {},\n\n/**\n * @method getInsetLeft\n * @return A value converted from C/C++ \"float\"\n */\ngetInsetLeft : function () {},\n\n/**\n * @method setInsetRight\n * @param {float}\n */\nsetInsetRight : function () {},\n\n/**\n * @method Scale9Sprite\n * @constructor\n */\nScale9Sprite : function () {},\n\n};\n\n/**\n * @class Control\n */\ncc.Control = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method onTouchMoved\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchMoved : function () {},\n\n/**\n * @method getState\n * @return A value converted from C/C++ \"cocos2d::extension::Control::State\"\n */\ngetState : function () {},\n\n/**\n * @method onTouchEnded\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchEnded : function () {},\n\n/**\n * @method sendActionsForControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\nsendActionsForControlEvents : function () {},\n\n/**\n * @method setSelected\n * @param {bool}\n */\nsetSelected : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method onTouchCancelled\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchCancelled : function () {},\n\n/**\n * @method needsLayout\n */\nneedsLayout : function () {},\n\n/**\n * @method onTouchBegan\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchBegan : function () {},\n\n/**\n * @method hasVisibleParents\n * @return A value converted from C/C++ \"bool\"\n */\nhasVisibleParents : function () {},\n\n/**\n * @method isSelected\n * @return A value converted from C/C++ \"bool\"\n */\nisSelected : function () {},\n\n/**\n * @method isTouchInside\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Touch*}\n */\nisTouchInside : function () {},\n\n/**\n * @method setHighlighted\n * @param {bool}\n */\nsetHighlighted : function () {},\n\n/**\n * @method getTouchLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\ngetTouchLocation : function () {},\n\n/**\n * @method isHighlighted\n * @return A value converted from C/C++ \"bool\"\n */\nisHighlighted : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::Control*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ControlButton\n */\ncc.ControlButton = {\n\n/**\n * @method isPushed\n * @return A value converted from C/C++ \"bool\"\n */\nisPushed : function () {},\n\n/**\n * @method setSelected\n * @param {bool}\n */\nsetSelected : function () {},\n\n/**\n * @method setTitleLabelForState\n * @param {cocos2d::Node*}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleLabelForState : function () {},\n\n/**\n * @method setAdjustBackgroundImage\n * @param {bool}\n */\nsetAdjustBackgroundImage : function () {},\n\n/**\n * @method setHighlighted\n * @param {bool}\n */\nsetHighlighted : function () {},\n\n/**\n * @method setZoomOnTouchDown\n * @param {bool}\n */\nsetZoomOnTouchDown : function () {},\n\n/**\n * @method setTitleForState\n * @param {const std::string&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleForState : function () {},\n\n/**\n * @method setLabelAnchorPoint\n * @param {const cocos2d::Point&}\n */\nsetLabelAnchorPoint : function () {},\n\n/**\n * @method getLabelAnchorPoint\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetLabelAnchorPoint : function () {},\n\n/**\n * @method getTitleTTFSizeForState\n * @return A value converted from C/C++ \"float\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleTTFSizeForState : function () {},\n\n/**\n * @method setTitleTTFForState\n * @param {const std::string&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleTTFForState : function () {},\n\n/**\n * @method setTitleTTFSizeForState\n * @param {float}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleTTFSizeForState : function () {},\n\n/**\n * @method setTitleLabel\n * @param {cocos2d::Node*}\n */\nsetTitleLabel : function () {},\n\n/**\n * @method setPreferredSize\n * @param {const cocos2d::Size&}\n */\nsetPreferredSize : function () {},\n\n/**\n * @method getCurrentTitleColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetCurrentTitleColor : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method getBackgroundSpriteForState\n * @return A value converted from C/C++ \"cocos2d::extension::Scale9Sprite*\"\n * @param {cocos2d::extension::Control::State}\n */\ngetBackgroundSpriteForState : function () {},\n\n/**\n * @method getHorizontalOrigin\n * @return A value converted from C/C++ \"int\"\n */\ngetHorizontalOrigin : function () {},\n\n/**\n * @method needsLayout\n */\nneedsLayout : function () {},\n\n/**\n * @method getScaleRatio\n * @return A value converted from C/C++ \"float\"\n */\ngetScaleRatio : function () {},\n\n/**\n * @method getTitleTTFForState\n * @return A value converted from C/C++ \"const std::string&\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleTTFForState : function () {},\n\n/**\n * @method getBackgroundSprite\n * @return A value converted from C/C++ \"cocos2d::extension::Scale9Sprite*\"\n */\ngetBackgroundSprite : function () {},\n\n/**\n * @method getTitleColorForState\n * @return A value converted from C/C++ \"cocos2d::Color3B\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleColorForState : function () {},\n\n/**\n * @method setTitleColorForState\n * @param {const cocos2d::Color3B&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleColorForState : function () {},\n\n/**\n * @method doesAdjustBackgroundImage\n * @return A value converted from C/C++ \"bool\"\n */\ndoesAdjustBackgroundImage : function () {},\n\n/**\n * @method setBackgroundSpriteFrameForState\n * @param {cocos2d::SpriteFrame*}\n * @param {cocos2d::extension::Control::State}\n */\nsetBackgroundSpriteFrameForState : function () {},\n\n/**\n * @method setBackgroundSpriteForState\n * @param {cocos2d::extension::Scale9Sprite*}\n * @param {cocos2d::extension::Control::State}\n */\nsetBackgroundSpriteForState : function () {},\n\n/**\n * @method setScaleRatio\n * @param {float}\n */\nsetScaleRatio : function () {},\n\n/**\n * @method setBackgroundSprite\n * @param {cocos2d::extension::Scale9Sprite*}\n */\nsetBackgroundSprite : function () {},\n\n/**\n * @method getTitleLabel\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetTitleLabel : function () {},\n\n/**\n * @method getPreferredSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetPreferredSize : function () {},\n\n/**\n * @method getVerticalMargin\n * @return A value converted from C/C++ \"int\"\n */\ngetVerticalMargin : function () {},\n\n/**\n * @method getTitleLabelForState\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleLabelForState : function () {},\n\n/**\n * @method setMargins\n * @param {int}\n * @param {int}\n */\nsetMargins : function () {},\n\n/**\n * @method setTitleBMFontForState\n * @param {const std::string&}\n * @param {cocos2d::extension::Control::State}\n */\nsetTitleBMFontForState : function () {},\n\n/**\n * @method getTitleBMFontForState\n * @return A value converted from C/C++ \"const std::string&\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleBMFontForState : function () {},\n\n/**\n * @method getZoomOnTouchDown\n * @return A value converted from C/C++ \"bool\"\n */\ngetZoomOnTouchDown : function () {},\n\n/**\n * @method getTitleForState\n * @return A value converted from C/C++ \"std::string\"\n * @param {cocos2d::extension::Control::State}\n */\ngetTitleForState : function () {},\n\n};\n\n/**\n * @class ControlHuePicker\n */\ncc.ControlHuePicker = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method initWithTargetAndPos\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ninitWithTargetAndPos : function () {},\n\n/**\n * @method setHue\n * @param {float}\n */\nsetHue : function () {},\n\n/**\n * @method getStartPos\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartPos : function () {},\n\n/**\n * @method getHue\n * @return A value converted from C/C++ \"float\"\n */\ngetHue : function () {},\n\n/**\n * @method getSlider\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSlider : function () {},\n\n/**\n * @method setBackground\n * @param {cocos2d::Sprite*}\n */\nsetBackground : function () {},\n\n/**\n * @method setHuePercentage\n * @param {float}\n */\nsetHuePercentage : function () {},\n\n/**\n * @method getBackground\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackground : function () {},\n\n/**\n * @method getHuePercentage\n * @return A value converted from C/C++ \"float\"\n */\ngetHuePercentage : function () {},\n\n/**\n * @method setSlider\n * @param {cocos2d::Sprite*}\n */\nsetSlider : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlHuePicker*\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ncreate : function () {},\n\n/**\n * @method ControlHuePicker\n * @constructor\n */\nControlHuePicker : function () {},\n\n};\n\n/**\n * @class ControlSaturationBrightnessPicker\n */\ncc.ControlSaturationBrightnessPicker = {\n\n/**\n * @method getShadow\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetShadow : function () {},\n\n/**\n * @method initWithTargetAndPos\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ninitWithTargetAndPos : function () {},\n\n/**\n * @method getStartPos\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetStartPos : function () {},\n\n/**\n * @method getOverlay\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetOverlay : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method getSlider\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSlider : function () {},\n\n/**\n * @method getBackground\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackground : function () {},\n\n/**\n * @method getSaturation\n * @return A value converted from C/C++ \"float\"\n */\ngetSaturation : function () {},\n\n/**\n * @method getBrightness\n * @return A value converted from C/C++ \"float\"\n */\ngetBrightness : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlSaturationBrightnessPicker*\"\n * @param {cocos2d::Node*}\n * @param {cocos2d::Point}\n */\ncreate : function () {},\n\n/**\n * @method ControlSaturationBrightnessPicker\n * @constructor\n */\nControlSaturationBrightnessPicker : function () {},\n\n};\n\n/**\n * @class ControlColourPicker\n */\ncc.ControlColourPicker = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method getHuePicker\n * @return A value converted from C/C++ \"cocos2d::extension::ControlHuePicker*\"\n */\ngetHuePicker : function () {},\n\n/**\n * @method setColor\n * @param {const cocos2d::Color3B&}\n */\nsetColor : function () {},\n\n/**\n * @method hueSliderValueChanged\n * @param {cocos2d::Object*}\n * @param {cocos2d::extension::Control::EventType}\n */\nhueSliderValueChanged : function () {},\n\n/**\n * @method getcolourPicker\n * @return A value converted from C/C++ \"cocos2d::extension::ControlSaturationBrightnessPicker*\"\n */\ngetcolourPicker : function () {},\n\n/**\n * @method setBackground\n * @param {cocos2d::Sprite*}\n */\nsetBackground : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setcolourPicker\n * @param {cocos2d::extension::ControlSaturationBrightnessPicker*}\n */\nsetcolourPicker : function () {},\n\n/**\n * @method colourSliderValueChanged\n * @param {cocos2d::Object*}\n * @param {cocos2d::extension::Control::EventType}\n */\ncolourSliderValueChanged : function () {},\n\n/**\n * @method setHuePicker\n * @param {cocos2d::extension::ControlHuePicker*}\n */\nsetHuePicker : function () {},\n\n/**\n * @method getBackground\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackground : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlColourPicker*\"\n */\ncreate : function () {},\n\n/**\n * @method ControlColourPicker\n * @constructor\n */\nControlColourPicker : function () {},\n\n};\n\n/**\n * @class ControlPotentiometer\n */\ncc.ControlPotentiometer = {\n\n/**\n * @method setPreviousLocation\n * @param {cocos2d::Point}\n */\nsetPreviousLocation : function () {},\n\n/**\n * @method setValue\n * @param {float}\n */\nsetValue : function () {},\n\n/**\n * @method getProgressTimer\n * @return A value converted from C/C++ \"cocos2d::ProgressTimer*\"\n */\ngetProgressTimer : function () {},\n\n/**\n * @method getMaximumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMaximumValue : function () {},\n\n/**\n * @method angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint\n * @return A value converted from C/C++ \"float\"\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n */\nangleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint : function () {},\n\n/**\n * @method potentiometerBegan\n * @param {cocos2d::Point}\n */\npotentiometerBegan : function () {},\n\n/**\n * @method setMaximumValue\n * @param {float}\n */\nsetMaximumValue : function () {},\n\n/**\n * @method getMinimumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMinimumValue : function () {},\n\n/**\n * @method setThumbSprite\n * @param {cocos2d::Sprite*}\n */\nsetThumbSprite : function () {},\n\n/**\n * @method getValue\n * @return A value converted from C/C++ \"float\"\n */\ngetValue : function () {},\n\n/**\n * @method getPreviousLocation\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPreviousLocation : function () {},\n\n/**\n * @method distanceBetweenPointAndPoint\n * @return A value converted from C/C++ \"float\"\n * @param {cocos2d::Point}\n * @param {cocos2d::Point}\n */\ndistanceBetweenPointAndPoint : function () {},\n\n/**\n * @method potentiometerEnded\n * @param {cocos2d::Point}\n */\npotentiometerEnded : function () {},\n\n/**\n * @method setProgressTimer\n * @param {cocos2d::ProgressTimer*}\n */\nsetProgressTimer : function () {},\n\n/**\n * @method setMinimumValue\n * @param {float}\n */\nsetMinimumValue : function () {},\n\n/**\n * @method getThumbSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetThumbSprite : function () {},\n\n/**\n * @method initWithTrackSprite_ProgressTimer_ThumbSprite\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Sprite*}\n * @param {cocos2d::ProgressTimer*}\n * @param {cocos2d::Sprite*}\n */\ninitWithTrackSprite_ProgressTimer_ThumbSprite : function () {},\n\n/**\n * @method potentiometerMoved\n * @param {cocos2d::Point}\n */\npotentiometerMoved : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlPotentiometer*\"\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n */\ncreate : function () {},\n\n/**\n * @method ControlPotentiometer\n * @constructor\n */\nControlPotentiometer : function () {},\n\n};\n\n/**\n * @class ControlSlider\n */\ncc.ControlSlider = {\n\n/**\n * @method getSelectedThumbSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetSelectedThumbSprite : function () {},\n\n/**\n * @method locationFromTouch\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nlocationFromTouch : function () {},\n\n/**\n * @method setSelectedThumbSprite\n * @param {cocos2d::Sprite*}\n */\nsetSelectedThumbSprite : function () {},\n\n/**\n * @method setProgressSprite\n * @param {cocos2d::Sprite*}\n */\nsetProgressSprite : function () {},\n\n/**\n * @method getMaximumAllowedValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMaximumAllowedValue : function () {},\n\n/**\n * @method getMinimumAllowedValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMinimumAllowedValue : function () {},\n\n/**\n * @method getMinimumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMinimumValue : function () {},\n\n/**\n * @method setThumbSprite\n * @param {cocos2d::Sprite*}\n */\nsetThumbSprite : function () {},\n\n/**\n * @method setMinimumValue\n * @param {float}\n */\nsetMinimumValue : function () {},\n\n/**\n * @method setMinimumAllowedValue\n * @param {float}\n */\nsetMinimumAllowedValue : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method setValue\n * @param {float}\n */\nsetValue : function () {},\n\n/**\n * @method setMaximumValue\n * @param {float}\n */\nsetMaximumValue : function () {},\n\n/**\n * @method needsLayout\n */\nneedsLayout : function () {},\n\n/**\n * @method getBackgroundSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetBackgroundSprite : function () {},\n\n/**\n * @method getMaximumValue\n * @return A value converted from C/C++ \"float\"\n */\ngetMaximumValue : function () {},\n\n/**\n * @method isTouchInside\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Touch*}\n */\nisTouchInside : function () {},\n\n/**\n * @method getValue\n * @return A value converted from C/C++ \"float\"\n */\ngetValue : function () {},\n\n/**\n * @method getThumbSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetThumbSprite : function () {},\n\n/**\n * @method getProgressSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetProgressSprite : function () {},\n\n/**\n * @method setBackgroundSprite\n * @param {cocos2d::Sprite*}\n */\nsetBackgroundSprite : function () {},\n\n/**\n * @method setMaximumAllowedValue\n * @param {float}\n */\nsetMaximumAllowedValue : function () {},\n\n/**\n * @method ControlSlider\n * @constructor\n */\nControlSlider : function () {},\n\n};\n\n/**\n * @class ControlStepper\n */\ncc.ControlStepper = {\n\n/**\n * @method setMinusSprite\n * @param {cocos2d::Sprite*}\n */\nsetMinusSprite : function () {},\n\n/**\n * @method getMinusLabel\n * @return A value converted from C/C++ \"cocos2d::LabelTTF*\"\n */\ngetMinusLabel : function () {},\n\n/**\n * @method setWraps\n * @param {bool}\n */\nsetWraps : function () {},\n\n/**\n * @method isContinuous\n * @return A value converted from C/C++ \"bool\"\n */\nisContinuous : function () {},\n\n/**\n * @method getMinusSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetMinusSprite : function () {},\n\n/**\n * @method updateLayoutUsingTouchLocation\n * @param {cocos2d::Point}\n */\nupdateLayoutUsingTouchLocation : function () {},\n\n/**\n * @method setValueWithSendingEvent\n * @param {double}\n * @param {bool}\n */\nsetValueWithSendingEvent : function () {},\n\n/**\n * @method getPlusLabel\n * @return A value converted from C/C++ \"cocos2d::LabelTTF*\"\n */\ngetPlusLabel : function () {},\n\n/**\n * @method stopAutorepeat\n */\nstopAutorepeat : function () {},\n\n/**\n * @method setMinimumValue\n * @param {double}\n */\nsetMinimumValue : function () {},\n\n/**\n * @method getPlusSprite\n * @return A value converted from C/C++ \"cocos2d::Sprite*\"\n */\ngetPlusSprite : function () {},\n\n/**\n * @method setPlusSprite\n * @param {cocos2d::Sprite*}\n */\nsetPlusSprite : function () {},\n\n/**\n * @method setMinusLabel\n * @param {cocos2d::LabelTTF*}\n */\nsetMinusLabel : function () {},\n\n/**\n * @method setValue\n * @param {double}\n */\nsetValue : function () {},\n\n/**\n * @method setStepValue\n * @param {double}\n */\nsetStepValue : function () {},\n\n/**\n * @method setMaximumValue\n * @param {double}\n */\nsetMaximumValue : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method startAutorepeat\n */\nstartAutorepeat : function () {},\n\n/**\n * @method initWithMinusSpriteAndPlusSprite\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Sprite*}\n * @param {cocos2d::Sprite*}\n */\ninitWithMinusSpriteAndPlusSprite : function () {},\n\n/**\n * @method getValue\n * @return A value converted from C/C++ \"double\"\n */\ngetValue : function () {},\n\n/**\n * @method setPlusLabel\n * @param {cocos2d::LabelTTF*}\n */\nsetPlusLabel : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::ControlStepper*\"\n * @param {cocos2d::Sprite*}\n * @param {cocos2d::Sprite*}\n */\ncreate : function () {},\n\n/**\n * @method ControlStepper\n * @constructor\n */\nControlStepper : function () {},\n\n};\n\n/**\n * @class ControlSwitch\n */\ncc.ControlSwitch = {\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method isOn\n * @return A value converted from C/C++ \"bool\"\n */\nisOn : function () {},\n\n/**\n * @method hasMoved\n * @return A value converted from C/C++ \"bool\"\n */\nhasMoved : function () {},\n\n/**\n * @method locationFromTouch\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {cocos2d::Touch*}\n */\nlocationFromTouch : function () {},\n\n/**\n * @method ControlSwitch\n * @constructor\n */\nControlSwitch : function () {},\n\n};\n\n/**\n * @class ScrollView\n */\ncc.ScrollView = {\n\n/**\n * @method isClippingToBounds\n * @return A value converted from C/C++ \"bool\"\n */\nisClippingToBounds : function () {},\n\n/**\n * @method setContainer\n * @param {cocos2d::Node*}\n */\nsetContainer : function () {},\n\n/**\n * @method onTouchEnded\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchEnded : function () {},\n\n/**\n * @method setContentOffsetInDuration\n * @param {cocos2d::Point}\n * @param {float}\n */\nsetContentOffsetInDuration : function () {},\n\n/**\n * @method setZoomScaleInDuration\n * @param {float}\n * @param {float}\n */\nsetZoomScaleInDuration : function () {},\n\n/**\n * @method setBounceable\n * @param {bool}\n */\nsetBounceable : function () {},\n\n/**\n * @method getDirection\n * @return A value converted from C/C++ \"cocos2d::extension::ScrollView::Direction\"\n */\ngetDirection : function () {},\n\n/**\n * @method getContainer\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetContainer : function () {},\n\n/**\n * @method getZoomScale\n * @return A value converted from C/C++ \"float\"\n */\ngetZoomScale : function () {},\n\n/**\n * @method updateInset\n */\nupdateInset : function () {},\n\n/**\n * @method initWithViewSize\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Size}\n * @param {cocos2d::Node*}\n */\ninitWithViewSize : function () {},\n\n/**\n * @method pause\n * @param {cocos2d::Object*}\n */\npause : function () {},\n\n/**\n * @method setDirection\n * @param {cocos2d::extension::ScrollView::Direction}\n */\nsetDirection : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method setContentOffset\n * @param {cocos2d::Point}\n * @param {bool}\n */\nsetContentOffset : function () {},\n\n/**\n * @method isDragging\n * @return A value converted from C/C++ \"bool\"\n */\nisDragging : function () {},\n\n/**\n * @method isTouchEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchEnabled : function () {},\n\n/**\n * @method isBounceable\n * @return A value converted from C/C++ \"bool\"\n */\nisBounceable : function () {},\n\n/**\n * @method setTouchEnabled\n * @param {bool}\n */\nsetTouchEnabled : function () {},\n\n/**\n * @method onTouchMoved\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchMoved : function () {},\n\n/**\n * @method getContentOffset\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetContentOffset : function () {},\n\n/**\n * @method resume\n * @param {cocos2d::Object*}\n */\nresume : function () {},\n\n/**\n * @method setClippingToBounds\n * @param {bool}\n */\nsetClippingToBounds : function () {},\n\n/**\n * @method setViewSize\n * @param {cocos2d::Size}\n */\nsetViewSize : function () {},\n\n/**\n * @method onTouchCancelled\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchCancelled : function () {},\n\n/**\n * @method getViewSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetViewSize : function () {},\n\n/**\n * @method maxContainerOffset\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\nmaxContainerOffset : function () {},\n\n/**\n * @method onTouchBegan\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Touch*}\n * @param {cocos2d::Event*}\n */\nonTouchBegan : function () {},\n\n/**\n * @method isTouchMoved\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchMoved : function () {},\n\n/**\n * @method isNodeVisible\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Node*}\n */\nisNodeVisible : function () {},\n\n/**\n * @method minContainerOffset\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\nminContainerOffset : function () {},\n\n/**\n * @method ScrollView\n * @constructor\n */\nScrollView : function () {},\n\n};\n\n/**\n * @class TableViewCell\n */\ncc.TableViewCell = {\n\n/**\n * @method reset\n */\nreset : function () {},\n\n/**\n * @method getIdx\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetIdx : function () {},\n\n/**\n * @method setIdx\n * @param {ssize_t}\n */\nsetIdx : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::TableViewCell*\"\n */\ncreate : function () {},\n\n/**\n * @method TableViewCell\n * @constructor\n */\nTableViewCell : function () {},\n\n};\n\n/**\n * @class TableView\n */\ncc.TableView = {\n\n/**\n * @method updateCellAtIndex\n * @param {ssize_t}\n */\nupdateCellAtIndex : function () {},\n\n/**\n * @method setVerticalFillOrder\n * @param {cocos2d::extension::TableView::VerticalFillOrder}\n */\nsetVerticalFillOrder : function () {},\n\n/**\n * @method scrollViewDidZoom\n * @param {cocos2d::extension::ScrollView*}\n */\nscrollViewDidZoom : function () {},\n\n/**\n * @method _updateContentSize\n */\n_updateContentSize : function () {},\n\n/**\n * @method getVerticalFillOrder\n * @return A value converted from C/C++ \"cocos2d::extension::TableView::VerticalFillOrder\"\n */\ngetVerticalFillOrder : function () {},\n\n/**\n * @method removeCellAtIndex\n * @param {ssize_t}\n */\nremoveCellAtIndex : function () {},\n\n/**\n * @method initWithViewSize\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::Size}\n * @param {cocos2d::Node*}\n */\ninitWithViewSize : function () {},\n\n/**\n * @method scrollViewDidScroll\n * @param {cocos2d::extension::ScrollView*}\n */\nscrollViewDidScroll : function () {},\n\n/**\n * @method reloadData\n */\nreloadData : function () {},\n\n/**\n * @method insertCellAtIndex\n * @param {ssize_t}\n */\ninsertCellAtIndex : function () {},\n\n/**\n * @method cellAtIndex\n * @return A value converted from C/C++ \"cocos2d::extension::TableViewCell*\"\n * @param {ssize_t}\n */\ncellAtIndex : function () {},\n\n/**\n * @method dequeueCell\n * @return A value converted from C/C++ \"cocos2d::extension::TableViewCell*\"\n */\ndequeueCell : function () {},\n\n/**\n * @method TableView\n * @constructor\n */\nTableView : function () {},\n\n};\n\n/**\n * @class EditBox\n */\ncc.EditBox = {\n\n/**\n * @method getText\n * @return A value converted from C/C++ \"const char*\"\n */\ngetText : function () {},\n\n/**\n * @method setPlaceholderFontName\n * @param {const char*}\n */\nsetPlaceholderFontName : function () {},\n\n/**\n * @method getPlaceHolder\n * @return A value converted from C/C++ \"const char*\"\n */\ngetPlaceHolder : function () {},\n\n/**\n * @method setFontName\n * @param {const char*}\n */\nsetFontName : function () {},\n\n/**\n * @method setPlaceholderFontSize\n * @param {int}\n */\nsetPlaceholderFontSize : function () {},\n\n/**\n * @method setInputMode\n * @param {cocos2d::extension::EditBox::InputMode}\n */\nsetInputMode : function () {},\n\n/**\n * @method setPlaceholderFontColor\n * @param {const cocos2d::Color3B&}\n */\nsetPlaceholderFontColor : function () {},\n\n/**\n * @method setFontColor\n * @param {const cocos2d::Color3B&}\n */\nsetFontColor : function () {},\n\n/**\n * @method setPlaceholderFont\n * @param {const char*}\n * @param {int}\n */\nsetPlaceholderFont : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n/**\n * @method initWithSizeAndBackgroundSprite\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Size&}\n * @param {cocos2d::extension::Scale9Sprite*}\n */\ninitWithSizeAndBackgroundSprite : function () {},\n\n/**\n * @method setPlaceHolder\n * @param {const char*}\n */\nsetPlaceHolder : function () {},\n\n/**\n * @method setReturnType\n * @param {cocos2d::extension::EditBox::KeyboardReturnType}\n */\nsetReturnType : function () {},\n\n/**\n * @method setInputFlag\n * @param {cocos2d::extension::EditBox::InputFlag}\n */\nsetInputFlag : function () {},\n\n/**\n * @method getMaxLength\n * @return A value converted from C/C++ \"int\"\n */\ngetMaxLength : function () {},\n\n/**\n * @method setText\n * @param {const char*}\n */\nsetText : function () {},\n\n/**\n * @method setMaxLength\n * @param {int}\n */\nsetMaxLength : function () {},\n\n/**\n * @method setFont\n * @param {const char*}\n * @param {int}\n */\nsetFont : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::EditBox*\"\n * @param {const cocos2d::Size&}\n * @param {cocos2d::extension::Scale9Sprite*}\n * @param {cocos2d::extension::Scale9Sprite*}\n * @param {cocos2d::extension::Scale9Sprite*}\n */\ncreate : function () {},\n\n/**\n * @method EditBox\n * @constructor\n */\nEditBox : function () {},\n\n};\n\n/**\n * @class AssetsManager\n */\ncc.AssetsManager = {\n\n/**\n * @method setStoragePath\n * @param {const char*}\n */\nsetStoragePath : function () {},\n\n/**\n * @method setPackageUrl\n * @param {const char*}\n */\nsetPackageUrl : function () {},\n\n/**\n * @method checkUpdate\n * @return A value converted from C/C++ \"bool\"\n */\ncheckUpdate : function () {},\n\n/**\n * @method getStoragePath\n * @return A value converted from C/C++ \"const char*\"\n */\ngetStoragePath : function () {},\n\n/**\n * @method update\n */\nupdate : function () {},\n\n/**\n * @method setConnectionTimeout\n * @param {unsigned int}\n */\nsetConnectionTimeout : function () {},\n\n/**\n * @method setVersionFileUrl\n * @param {const char*}\n */\nsetVersionFileUrl : function () {},\n\n/**\n * @method getPackageUrl\n * @return A value converted from C/C++ \"const char*\"\n */\ngetPackageUrl : function () {},\n\n/**\n * @method getConnectionTimeout\n * @return A value converted from C/C++ \"unsigned int\"\n */\ngetConnectionTimeout : function () {},\n\n/**\n * @method getVersion\n * @return A value converted from C/C++ \"std::string\"\n */\ngetVersion : function () {},\n\n/**\n * @method getVersionFileUrl\n * @return A value converted from C/C++ \"const char*\"\n */\ngetVersionFileUrl : function () {},\n\n/**\n * @method deleteVersion\n */\ndeleteVersion : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::extension::AssetsManager*\"\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::extension::AssetsManager::ErrorCallback}\n * @param {cocos2d::extension::AssetsManager::ProgressCallback}\n * @param {cocos2d::extension::AssetsManager::SuccessCallback}\n */\ncreate : function () {},\n\n/**\n * @method AssetsManager\n * @constructor\n */\nAssetsManager : function () {},\n\n};\n\n/**\n * @class CCBAnimationManager\n */\ncc.AnimationManager = {\n\n/**\n * @method moveAnimationsFromNode\n * @param {cocos2d::Node*}\n * @param {cocos2d::Node*}\n */\nmoveAnimationsFromNode : function () {},\n\n/**\n * @method setAutoPlaySequenceId\n * @param {int}\n */\nsetAutoPlaySequenceId : function () {},\n\n/**\n * @method getDocumentCallbackNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetDocumentCallbackNames : function () {},\n\n/**\n * @method actionForSoundChannel\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n * @param {cocosbuilder::CCBSequenceProperty*}\n */\nactionForSoundChannel : function () {},\n\n/**\n * @method setBaseValue\n * @param {const cocos2d::Value&}\n * @param {cocos2d::Node*}\n * @param {const std::string&}\n */\nsetBaseValue : function () {},\n\n/**\n * @method getDocumentOutletNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetDocumentOutletNodes : function () {},\n\n/**\n * @method getLastCompletedSequenceName\n * @return A value converted from C/C++ \"std::string\"\n */\ngetLastCompletedSequenceName : function () {},\n\n/**\n * @method setRootNode\n * @param {cocos2d::Node*}\n */\nsetRootNode : function () {},\n\n/**\n * @method runAnimationsForSequenceNamedTweenDuration\n * @param {const char*}\n * @param {float}\n */\nrunAnimationsForSequenceNamedTweenDuration : function () {},\n\n/**\n * @method addDocumentOutletName\n * @param {std::string}\n */\naddDocumentOutletName : function () {},\n\n/**\n * @method getSequences\n * @return A value converted from C/C++ \"cocos2d::Vector<cocosbuilder::CCBSequence *>&\"\n */\ngetSequences : function () {},\n\n/**\n * @method getRootContainerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetRootContainerSize : function () {},\n\n/**\n * @method setDocumentControllerName\n * @param {const std::string&}\n */\nsetDocumentControllerName : function () {},\n\n/**\n * @method setObject\n * @param {cocos2d::Object*}\n * @param {cocos2d::Node*}\n * @param {const std::string&}\n */\nsetObject : function () {},\n\n/**\n * @method getContainerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n * @param {cocos2d::Node*}\n */\ngetContainerSize : function () {},\n\n/**\n * @method actionForCallbackChannel\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n * @param {cocosbuilder::CCBSequenceProperty*}\n */\nactionForCallbackChannel : function () {},\n\n/**\n * @method getDocumentOutletNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetDocumentOutletNames : function () {},\n\n/**\n * @method addDocumentCallbackControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\naddDocumentCallbackControlEvents : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method getKeyframeCallbacks\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetKeyframeCallbacks : function () {},\n\n/**\n * @method getDocumentCallbackControlEvents\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetDocumentCallbackControlEvents : function () {},\n\n/**\n * @method setRootContainerSize\n * @param {const cocos2d::Size&}\n */\nsetRootContainerSize : function () {},\n\n/**\n * @method runAnimationsForSequenceIdTweenDuration\n * @param {int}\n * @param {float}\n */\nrunAnimationsForSequenceIdTweenDuration : function () {},\n\n/**\n * @method getRunningSequenceName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetRunningSequenceName : function () {},\n\n/**\n * @method getAutoPlaySequenceId\n * @return A value converted from C/C++ \"int\"\n */\ngetAutoPlaySequenceId : function () {},\n\n/**\n * @method addDocumentCallbackName\n * @param {std::string}\n */\naddDocumentCallbackName : function () {},\n\n/**\n * @method getRootNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetRootNode : function () {},\n\n/**\n * @method addDocumentOutletNode\n * @param {cocos2d::Node*}\n */\naddDocumentOutletNode : function () {},\n\n/**\n * @method getSequenceDuration\n * @return A value converted from C/C++ \"float\"\n * @param {const char*}\n */\ngetSequenceDuration : function () {},\n\n/**\n * @method addDocumentCallbackNode\n * @param {cocos2d::Node*}\n */\naddDocumentCallbackNode : function () {},\n\n/**\n * @method runAnimationsForSequenceNamed\n * @param {const char*}\n */\nrunAnimationsForSequenceNamed : function () {},\n\n/**\n * @method getSequenceId\n * @return A value converted from C/C++ \"int\"\n * @param {const char*}\n */\ngetSequenceId : function () {},\n\n/**\n * @method getDocumentCallbackNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetDocumentCallbackNodes : function () {},\n\n/**\n * @method setSequences\n * @param {const cocos2d::Vector<cocosbuilder::CCBSequence *>&}\n */\nsetSequences : function () {},\n\n/**\n * @method debug\n */\ndebug : function () {},\n\n/**\n * @method getDocumentControllerName\n * @return A value converted from C/C++ \"std::string\"\n */\ngetDocumentControllerName : function () {},\n\n/**\n * @method CCBAnimationManager\n * @constructor\n */\nCCBAnimationManager : function () {},\n\n};\n\n/**\n * @class CCBReader\n */\ncc._Reader = {\n\n/**\n * @method addOwnerOutletName\n * @param {std::string}\n */\naddOwnerOutletName : function () {},\n\n/**\n * @method getOwnerCallbackNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector\"\n */\ngetOwnerCallbackNames : function () {},\n\n/**\n * @method addDocumentCallbackControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\naddDocumentCallbackControlEvents : function () {},\n\n/**\n * @method setCCBRootPath\n * @param {const char*}\n */\nsetCCBRootPath : function () {},\n\n/**\n * @method addOwnerOutletNode\n * @param {cocos2d::Node*}\n */\naddOwnerOutletNode : function () {},\n\n/**\n * @method getOwnerCallbackNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetOwnerCallbackNodes : function () {},\n\n/**\n * @method readSoundKeyframesForSeq\n * @return A value converted from C/C++ \"bool\"\n * @param {cocosbuilder::CCBSequence*}\n */\nreadSoundKeyframesForSeq : function () {},\n\n/**\n * @method getCCBRootPath\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetCCBRootPath : function () {},\n\n/**\n * @method getOwnerCallbackControlEvents\n * @return A value converted from C/C++ \"cocos2d::ValueVector&\"\n */\ngetOwnerCallbackControlEvents : function () {},\n\n/**\n * @method getOwnerOutletNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetOwnerOutletNodes : function () {},\n\n/**\n * @method readUTF8\n * @return A value converted from C/C++ \"std::string\"\n */\nreadUTF8 : function () {},\n\n/**\n * @method addOwnerCallbackControlEvents\n * @param {cocos2d::extension::Control::EventType}\n */\naddOwnerCallbackControlEvents : function () {},\n\n/**\n * @method getOwnerOutletNames\n * @return A value converted from C/C++ \"cocos2d::ValueVector\"\n */\ngetOwnerOutletNames : function () {},\n\n/**\n * @method setAnimationManager\n * @param {cocosbuilder::CCBAnimationManager*}\n */\nsetAnimationManager : function () {},\n\n/**\n * @method readCallbackKeyframesForSeq\n * @return A value converted from C/C++ \"bool\"\n * @param {cocosbuilder::CCBSequence*}\n */\nreadCallbackKeyframesForSeq : function () {},\n\n/**\n * @method getAnimationManagersForNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocosbuilder::CCBAnimationManager *>&\"\n */\ngetAnimationManagersForNodes : function () {},\n\n/**\n * @method getNodesWithAnimationManagers\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetNodesWithAnimationManagers : function () {},\n\n/**\n * @method getAnimationManager\n * @return A value converted from C/C++ \"cocosbuilder::CCBAnimationManager*\"\n */\ngetAnimationManager : function () {},\n\n/**\n * @method setResolutionScale\n * @param {float}\n */\nsetResolutionScale : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp",
    "content": "#include \"lua_cocos2dx_gui_auto.hpp\"\n#include \"CocosGUI.h\"\n#include \"tolua_fix.h\"\n#include \"LuaBasicConversions.h\"\n\n\n\nint lua_cocos2dx_gui_LayoutParameter_getLayoutType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LayoutParameter_getLayoutType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getLayoutType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayoutType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LayoutParameter_getLayoutType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LayoutParameter_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.LayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::LayoutParameter* ret = cocos2d::gui::LayoutParameter::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.LayoutParameter\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::LayoutParameter*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LayoutParameter_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_LayoutParameter_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::LayoutParameter();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.LayoutParameter\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.LayoutParameter\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"LayoutParameter\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LayoutParameter_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_LayoutParameter_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LayoutParameter)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_LayoutParameter(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.LayoutParameter\");\n    tolua_cclass(tolua_S,\"LayoutParameter\",\"ccui.LayoutParameter\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LayoutParameter\");\n        tolua_function(tolua_S,\"getLayoutType\",lua_cocos2dx_gui_LayoutParameter_getLayoutType);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_LayoutParameter_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_LayoutParameter_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::LayoutParameter).name();\n    g_luaType[typeName] = \"ccui.LayoutParameter\";\n    g_typeCast[\"LayoutParameter\"] = \"ccui.LayoutParameter\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_LinearLayoutParameter_setGravity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LinearLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LinearLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LinearLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LinearLayoutParameter_setGravity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::LinearGravity arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setGravity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGravity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LinearLayoutParameter_setGravity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LinearLayoutParameter_getGravity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LinearLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LinearLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LinearLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LinearLayoutParameter_getGravity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getGravity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGravity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LinearLayoutParameter_getGravity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LinearLayoutParameter_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.LinearLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::LinearLayoutParameter* ret = cocos2d::gui::LinearLayoutParameter::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.LinearLayoutParameter\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::LinearLayoutParameter*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LinearLayoutParameter_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_LinearLayoutParameter_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LinearLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::LinearLayoutParameter();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.LinearLayoutParameter\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.LinearLayoutParameter\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"LinearLayoutParameter\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LinearLayoutParameter_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_LinearLayoutParameter_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LinearLayoutParameter)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_LinearLayoutParameter(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.LinearLayoutParameter\");\n    tolua_cclass(tolua_S,\"LinearLayoutParameter\",\"ccui.LinearLayoutParameter\",\"ccui.LayoutParameter\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LinearLayoutParameter\");\n        tolua_function(tolua_S,\"setGravity\",lua_cocos2dx_gui_LinearLayoutParameter_setGravity);\n        tolua_function(tolua_S,\"getGravity\",lua_cocos2dx_gui_LinearLayoutParameter_getGravity);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_LinearLayoutParameter_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_LinearLayoutParameter_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::LinearLayoutParameter).name();\n    g_luaType[typeName] = \"ccui.LinearLayoutParameter\";\n    g_typeCast[\"LinearLayoutParameter\"] = \"ccui.LinearLayoutParameter\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_RelativeLayoutParameter_setAlign(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::RelativeLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.RelativeLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::RelativeLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_RelativeLayoutParameter_setAlign'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::RelativeAlign arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAlign(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAlign\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_setAlign'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::RelativeLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.RelativeLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::RelativeLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setRelativeToWidgetName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRelativeToWidgetName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::RelativeLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.RelativeLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::RelativeLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getRelativeName();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRelativeName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::RelativeLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.RelativeLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::RelativeLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getRelativeToWidgetName();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRelativeToWidgetName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::RelativeLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.RelativeLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::RelativeLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setRelativeName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRelativeName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_RelativeLayoutParameter_getAlign(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::RelativeLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.RelativeLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::RelativeLayoutParameter*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_RelativeLayoutParameter_getAlign'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getAlign();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAlign\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_getAlign'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_RelativeLayoutParameter_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.RelativeLayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::RelativeLayoutParameter* ret = cocos2d::gui::RelativeLayoutParameter::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.RelativeLayoutParameter\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::RelativeLayoutParameter*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_RelativeLayoutParameter_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::RelativeLayoutParameter* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::RelativeLayoutParameter();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.RelativeLayoutParameter\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.RelativeLayoutParameter\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"RelativeLayoutParameter\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_RelativeLayoutParameter_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_RelativeLayoutParameter_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (RelativeLayoutParameter)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_RelativeLayoutParameter(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.RelativeLayoutParameter\");\n    tolua_cclass(tolua_S,\"RelativeLayoutParameter\",\"ccui.RelativeLayoutParameter\",\"ccui.LayoutParameter\",NULL);\n\n    tolua_beginmodule(tolua_S,\"RelativeLayoutParameter\");\n        tolua_function(tolua_S,\"setAlign\",lua_cocos2dx_gui_RelativeLayoutParameter_setAlign);\n        tolua_function(tolua_S,\"setRelativeToWidgetName\",lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeToWidgetName);\n        tolua_function(tolua_S,\"getRelativeName\",lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeName);\n        tolua_function(tolua_S,\"getRelativeToWidgetName\",lua_cocos2dx_gui_RelativeLayoutParameter_getRelativeToWidgetName);\n        tolua_function(tolua_S,\"setRelativeName\",lua_cocos2dx_gui_RelativeLayoutParameter_setRelativeName);\n        tolua_function(tolua_S,\"getAlign\",lua_cocos2dx_gui_RelativeLayoutParameter_getAlign);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_RelativeLayoutParameter_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_RelativeLayoutParameter_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::RelativeLayoutParameter).name();\n    g_luaType[typeName] = \"ccui.RelativeLayoutParameter\";\n    g_typeCast[\"RelativeLayoutParameter\"] = \"ccui.RelativeLayoutParameter\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_Widget_getVirtualRenderer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getVirtualRenderer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getVirtualRenderer();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVirtualRenderer\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getVirtualRenderer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setSizePercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setSizePercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setSizePercent(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSizePercent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setSizePercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setActionTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setActionTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setActionTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setActionTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setActionTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getNodeByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getNodeByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getNodeByTag(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeByTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getNodeByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_isFlipY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_isFlipY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFlipY();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFlipY\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_isFlipY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getTouchEndPos(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getTouchEndPos'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getTouchEndPos();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTouchEndPos\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getTouchEndPos'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setPositionPercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setPositionPercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setPositionPercent(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPositionPercent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setPositionPercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getNodes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getNodes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::Node *>& ret = cobj->getNodes();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getNodes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setPositionType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setPositionType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::PositionType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPositionType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPositionType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setPositionType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getName();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isIgnoreContentAdaptWithSize();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isIgnoreContentAdaptWithSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_updateSizeAndPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_updateSizeAndPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateSizeAndPosition();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateSizeAndPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_updateSizeAndPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getBottomInParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getBottomInParent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getBottomInParent();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBottomInParent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getBottomInParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getActionTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getActionTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getActionTag();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getActionTag\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getActionTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getLayoutParameter(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getLayoutParameter'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::LayoutParameterType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::gui::LayoutParameter* ret = cobj->getLayoutParameter(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.LayoutParameter\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::LayoutParameter*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayoutParameter\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getLayoutParameter'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getPositionType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getPositionType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getPositionType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPositionType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getPositionType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getChildByName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getChildByName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cobj->getChildByName(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getChildByName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getChildByName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_isFlipX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_isFlipX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFlipX();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFlipX\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_isFlipX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_removeNodeByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_removeNodeByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeNodeByTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeNodeByTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_removeNodeByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_isTouchEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_isTouchEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTouchEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTouchEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_isTouchEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getContentSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getContentSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getContentSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContentSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getContentSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getTouchStartPos(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getTouchStartPos'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getTouchStartPos();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTouchStartPos\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getTouchStartPos'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_didNotSelectSelf(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_didNotSelectSelf'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->didNotSelectSelf();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"didNotSelectSelf\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_didNotSelectSelf'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setFocused(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setFocused'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFocused(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFocused\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setFocused'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setTouchEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setTouchEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTouchEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTouchEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setTouchEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_clone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_clone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cobj->clone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_clone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getTouchMovePos(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getTouchMovePos'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getTouchMovePos();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTouchMovePos\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getTouchMovePos'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setBrightStyle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setBrightStyle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::BrightStyle arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBrightStyle(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBrightStyle\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setBrightStyle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_addNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_addNode'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cobj->addNode(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->addNode(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 3) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            int arg2;\n            ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n            if (!ok) { break; }\n            cobj->addNode(arg0, arg1, arg2);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addNode\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_addNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setLayoutParameter(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setLayoutParameter'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::LayoutParameter* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.LayoutParameter\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::LayoutParameter*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setLayoutParameter(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLayoutParameter\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setLayoutParameter'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setFlipY(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setFlipY'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFlipY(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFlipY\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setFlipY'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setFlipX(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setFlipX'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFlipX(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFlipX\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setFlipX'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getLeftInParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getLeftInParent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getLeftInParent();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLeftInParent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getLeftInParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_ignoreContentAdaptWithSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_ignoreContentAdaptWithSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->ignoreContentAdaptWithSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ignoreContentAdaptWithSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_ignoreContentAdaptWithSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_isBright(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_isBright'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBright();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBright\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_isBright'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_clippingParentAreaContainPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_clippingParentAreaContainPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->clippingParentAreaContainPoint(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clippingParentAreaContainPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_clippingParentAreaContainPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getSizePercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getSizePercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getSizePercent();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSizePercent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getSizePercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getTopInParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getTopInParent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getTopInParent();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTopInParent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getTopInParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getWidgetType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getWidgetType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getWidgetType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWidgetType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getWidgetType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getRightInParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getRightInParent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRightInParent();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRightInParent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getRightInParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getSizeType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getSizeType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getSizeType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSizeType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getSizeType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_removeNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_removeNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_removeNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_removeAllNodes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_removeAllNodes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllNodes();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllNodes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_removeAllNodes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getWorldPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getWorldPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getWorldPosition();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWorldPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getWorldPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_getPositionPercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_getPositionPercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Point& ret = cobj->getPositionPercent();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPositionPercent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_getPositionPercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_hitTest(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_hitTest'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->hitTest(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hitTest\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_hitTest'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_isFocused(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_isFocused'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isFocused();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isFocused\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_isFocused'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setSizeType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setSizeType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::SizeType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSizeType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSizeType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setSizeType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_checkChildInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_checkChildInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        cocos2d::gui::Widget* arg1;\n        cocos2d::Point arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cobj->checkChildInfo(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"checkChildInfo\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_checkChildInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_setBright(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Widget_setBright'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBright(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBright\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_setBright'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cocos2d::gui::Widget::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Widget_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Widget* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::Widget();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.Widget\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.Widget\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Widget\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Widget_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_Widget_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Widget)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_Widget(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.Widget\");\n    tolua_cclass(tolua_S,\"Widget\",\"ccui.Widget\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Widget\");\n        tolua_function(tolua_S,\"getVirtualRenderer\",lua_cocos2dx_gui_Widget_getVirtualRenderer);\n        tolua_function(tolua_S,\"setSizePercent\",lua_cocos2dx_gui_Widget_setSizePercent);\n        tolua_function(tolua_S,\"setActionTag\",lua_cocos2dx_gui_Widget_setActionTag);\n        tolua_function(tolua_S,\"getNodeByTag\",lua_cocos2dx_gui_Widget_getNodeByTag);\n        tolua_function(tolua_S,\"isFlipY\",lua_cocos2dx_gui_Widget_isFlipY);\n        tolua_function(tolua_S,\"getTouchEndPos\",lua_cocos2dx_gui_Widget_getTouchEndPos);\n        tolua_function(tolua_S,\"setPositionPercent\",lua_cocos2dx_gui_Widget_setPositionPercent);\n        tolua_function(tolua_S,\"getNodes\",lua_cocos2dx_gui_Widget_getNodes);\n        tolua_function(tolua_S,\"setPositionType\",lua_cocos2dx_gui_Widget_setPositionType);\n        tolua_function(tolua_S,\"getName\",lua_cocos2dx_gui_Widget_getName);\n        tolua_function(tolua_S,\"isIgnoreContentAdaptWithSize\",lua_cocos2dx_gui_Widget_isIgnoreContentAdaptWithSize);\n        tolua_function(tolua_S,\"updateSizeAndPosition\",lua_cocos2dx_gui_Widget_updateSizeAndPosition);\n        tolua_function(tolua_S,\"getBottomInParent\",lua_cocos2dx_gui_Widget_getBottomInParent);\n        tolua_function(tolua_S,\"getActionTag\",lua_cocos2dx_gui_Widget_getActionTag);\n        tolua_function(tolua_S,\"getLayoutParameter\",lua_cocos2dx_gui_Widget_getLayoutParameter);\n        tolua_function(tolua_S,\"getPositionType\",lua_cocos2dx_gui_Widget_getPositionType);\n        tolua_function(tolua_S,\"setName\",lua_cocos2dx_gui_Widget_setName);\n        tolua_function(tolua_S,\"getChildByName\",lua_cocos2dx_gui_Widget_getChildByName);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_gui_Widget_isEnabled);\n        tolua_function(tolua_S,\"isFlipX\",lua_cocos2dx_gui_Widget_isFlipX);\n        tolua_function(tolua_S,\"removeNodeByTag\",lua_cocos2dx_gui_Widget_removeNodeByTag);\n        tolua_function(tolua_S,\"isTouchEnabled\",lua_cocos2dx_gui_Widget_isTouchEnabled);\n        tolua_function(tolua_S,\"getContentSize\",lua_cocos2dx_gui_Widget_getContentSize);\n        tolua_function(tolua_S,\"getTouchStartPos\",lua_cocos2dx_gui_Widget_getTouchStartPos);\n        tolua_function(tolua_S,\"didNotSelectSelf\",lua_cocos2dx_gui_Widget_didNotSelectSelf);\n        tolua_function(tolua_S,\"setFocused\",lua_cocos2dx_gui_Widget_setFocused);\n        tolua_function(tolua_S,\"setTouchEnabled\",lua_cocos2dx_gui_Widget_setTouchEnabled);\n        tolua_function(tolua_S,\"clone\",lua_cocos2dx_gui_Widget_clone);\n        tolua_function(tolua_S,\"getTouchMovePos\",lua_cocos2dx_gui_Widget_getTouchMovePos);\n        tolua_function(tolua_S,\"setEnabled\",lua_cocos2dx_gui_Widget_setEnabled);\n        tolua_function(tolua_S,\"setBrightStyle\",lua_cocos2dx_gui_Widget_setBrightStyle);\n        tolua_function(tolua_S,\"addNode\",lua_cocos2dx_gui_Widget_addNode);\n        tolua_function(tolua_S,\"setLayoutParameter\",lua_cocos2dx_gui_Widget_setLayoutParameter);\n        tolua_function(tolua_S,\"setFlipY\",lua_cocos2dx_gui_Widget_setFlipY);\n        tolua_function(tolua_S,\"setFlipX\",lua_cocos2dx_gui_Widget_setFlipX);\n        tolua_function(tolua_S,\"getLeftInParent\",lua_cocos2dx_gui_Widget_getLeftInParent);\n        tolua_function(tolua_S,\"ignoreContentAdaptWithSize\",lua_cocos2dx_gui_Widget_ignoreContentAdaptWithSize);\n        tolua_function(tolua_S,\"isBright\",lua_cocos2dx_gui_Widget_isBright);\n        tolua_function(tolua_S,\"clippingParentAreaContainPoint\",lua_cocos2dx_gui_Widget_clippingParentAreaContainPoint);\n        tolua_function(tolua_S,\"getSizePercent\",lua_cocos2dx_gui_Widget_getSizePercent);\n        tolua_function(tolua_S,\"getTopInParent\",lua_cocos2dx_gui_Widget_getTopInParent);\n        tolua_function(tolua_S,\"getWidgetType\",lua_cocos2dx_gui_Widget_getWidgetType);\n        tolua_function(tolua_S,\"getSize\",lua_cocos2dx_gui_Widget_getSize);\n        tolua_function(tolua_S,\"getRightInParent\",lua_cocos2dx_gui_Widget_getRightInParent);\n        tolua_function(tolua_S,\"getSizeType\",lua_cocos2dx_gui_Widget_getSizeType);\n        tolua_function(tolua_S,\"removeNode\",lua_cocos2dx_gui_Widget_removeNode);\n        tolua_function(tolua_S,\"removeAllNodes\",lua_cocos2dx_gui_Widget_removeAllNodes);\n        tolua_function(tolua_S,\"getWorldPosition\",lua_cocos2dx_gui_Widget_getWorldPosition);\n        tolua_function(tolua_S,\"getPositionPercent\",lua_cocos2dx_gui_Widget_getPositionPercent);\n        tolua_function(tolua_S,\"hitTest\",lua_cocos2dx_gui_Widget_hitTest);\n        tolua_function(tolua_S,\"isFocused\",lua_cocos2dx_gui_Widget_isFocused);\n        tolua_function(tolua_S,\"setSizeType\",lua_cocos2dx_gui_Widget_setSizeType);\n        tolua_function(tolua_S,\"checkChildInfo\",lua_cocos2dx_gui_Widget_checkChildInfo);\n        tolua_function(tolua_S,\"setSize\",lua_cocos2dx_gui_Widget_setSize);\n        tolua_function(tolua_S,\"setBright\",lua_cocos2dx_gui_Widget_setBright);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_Widget_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_Widget_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::Widget).name();\n    g_luaType[typeName] = \"ccui.Widget\";\n    g_typeCast[\"Widget\"] = \"ccui.Widget\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_Layout_setBackGroundColorVector(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setBackGroundColorVector'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setBackGroundColorVector(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackGroundColorVector\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setBackGroundColorVector'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_hitTest(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_hitTest'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->hitTest(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hitTest\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_hitTest'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_getBackGroundImageTextureSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_getBackGroundImageTextureSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getBackGroundImageTextureSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackGroundImageTextureSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_getBackGroundImageTextureSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_getLayoutType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_getLayoutType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getLayoutType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLayoutType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_getLayoutType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setClippingType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setClippingType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::LayoutClippingType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setClippingType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setClippingType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setClippingType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setBackGroundColorType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setBackGroundColorType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::LayoutBackGroundColorType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBackGroundColorType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackGroundColorType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setBackGroundColorType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setBackGroundImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setBackGroundImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setBackGroundImage(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setBackGroundImage(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackGroundImage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setBackGroundImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setBackGroundColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setBackGroundColor'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Color3B arg0;\n            ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cocos2d::Color3B arg1;\n            ok &= luaval_to_color3b(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cobj->setBackGroundColor(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Color3B arg0;\n            ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cobj->setBackGroundColor(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackGroundColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setBackGroundColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_requestDoLayout(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_requestDoLayout'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->requestDoLayout();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"requestDoLayout\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_requestDoLayout'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_isClippingEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_isClippingEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isClippingEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isClippingEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_isClippingEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setBackGroundColorOpacity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setBackGroundColorOpacity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBackGroundColorOpacity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackGroundColorOpacity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setBackGroundColorOpacity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setBackGroundImageCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setBackGroundImageCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setBackGroundImageCapInsets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackGroundImageCapInsets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setBackGroundImageCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_removeBackGroundImage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_removeBackGroundImage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeBackGroundImage();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeBackGroundImage\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_removeBackGroundImage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBackGroundImageScale9Enabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackGroundImageScale9Enabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setClippingEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setClippingEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setClippingEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setClippingEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setClippingEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_setLayoutType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Layout_setLayoutType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::LayoutType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLayoutType(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLayoutType\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_setLayoutType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Layout\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::Layout* ret = cocos2d::gui::Layout::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Layout\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Layout*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Layout_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Layout* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::Layout();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.Layout\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.Layout\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Layout\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Layout_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_Layout_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Layout)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_Layout(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.Layout\");\n    tolua_cclass(tolua_S,\"Layout\",\"ccui.Layout\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Layout\");\n        tolua_function(tolua_S,\"setBackGroundColorVector\",lua_cocos2dx_gui_Layout_setBackGroundColorVector);\n        tolua_function(tolua_S,\"hitTest\",lua_cocos2dx_gui_Layout_hitTest);\n        tolua_function(tolua_S,\"getBackGroundImageTextureSize\",lua_cocos2dx_gui_Layout_getBackGroundImageTextureSize);\n        tolua_function(tolua_S,\"getLayoutType\",lua_cocos2dx_gui_Layout_getLayoutType);\n        tolua_function(tolua_S,\"setClippingType\",lua_cocos2dx_gui_Layout_setClippingType);\n        tolua_function(tolua_S,\"setBackGroundColorType\",lua_cocos2dx_gui_Layout_setBackGroundColorType);\n        tolua_function(tolua_S,\"setBackGroundImage\",lua_cocos2dx_gui_Layout_setBackGroundImage);\n        tolua_function(tolua_S,\"setBackGroundColor\",lua_cocos2dx_gui_Layout_setBackGroundColor);\n        tolua_function(tolua_S,\"requestDoLayout\",lua_cocos2dx_gui_Layout_requestDoLayout);\n        tolua_function(tolua_S,\"isClippingEnabled\",lua_cocos2dx_gui_Layout_isClippingEnabled);\n        tolua_function(tolua_S,\"setBackGroundColorOpacity\",lua_cocos2dx_gui_Layout_setBackGroundColorOpacity);\n        tolua_function(tolua_S,\"setBackGroundImageCapInsets\",lua_cocos2dx_gui_Layout_setBackGroundImageCapInsets);\n        tolua_function(tolua_S,\"removeBackGroundImage\",lua_cocos2dx_gui_Layout_removeBackGroundImage);\n        tolua_function(tolua_S,\"setBackGroundImageScale9Enabled\",lua_cocos2dx_gui_Layout_setBackGroundImageScale9Enabled);\n        tolua_function(tolua_S,\"setClippingEnabled\",lua_cocos2dx_gui_Layout_setClippingEnabled);\n        tolua_function(tolua_S,\"setLayoutType\",lua_cocos2dx_gui_Layout_setLayoutType);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_Layout_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_Layout_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::Layout).name();\n    g_luaType[typeName] = \"ccui.Layout\";\n    g_typeCast[\"Layout\"] = \"ccui.Layout\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_Button_getTitleText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_getTitleText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getTitleText();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleText\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_getTitleText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_loadTextureNormal(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_loadTextureNormal'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextureNormal(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTextureNormal(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextureNormal\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_loadTextureNormal'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setCapInsetsNormalRenderer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setCapInsetsNormalRenderer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsetsNormalRenderer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsetsNormalRenderer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setCapInsetsNormalRenderer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setCapInsetsPressedRenderer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setCapInsetsPressedRenderer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsetsPressedRenderer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsetsPressedRenderer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setCapInsetsPressedRenderer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_loadTexturePressed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_loadTexturePressed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTexturePressed(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTexturePressed(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTexturePressed\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_loadTexturePressed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setTitleFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setTitleFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTitleFontSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleFontSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setTitleFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setCapInsetsDisabledRenderer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setCapInsetsDisabledRenderer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsetsDisabledRenderer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsetsDisabledRenderer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setCapInsetsDisabledRenderer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setTitleFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setTitleFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setTitleFontName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleFontName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setTitleFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_getTitleColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_getTitleColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Color3B& ret = cobj->getTitleColor();\n        color3b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_getTitleColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_loadTextureDisabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_loadTextureDisabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextureDisabled(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTextureDisabled(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextureDisabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_loadTextureDisabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_getTitleFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_getTitleFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getTitleFontName();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleFontName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_getTitleFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setPressedActionEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setPressedActionEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPressedActionEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPressedActionEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setPressedActionEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setScale9Enabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setScale9Enabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScale9Enabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScale9Enabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setScale9Enabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_loadTextures(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_loadTextures'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextures(arg0, arg1, arg2);\n        return 0;\n    }\n    if (argc == 4) \n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n        cocos2d::gui::TextureResType arg3;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cobj->loadTextures(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextures\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_loadTextures'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_getTitleFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_getTitleFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getTitleFontSize();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTitleFontSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_getTitleFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setTitleText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setTitleText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTitleText(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleText\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setTitleText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_setTitleColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Button*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Button_setTitleColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color3B arg0;\n\n        ok &= luaval_to_color3b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTitleColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTitleColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_setTitleColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Button_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Button\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::Button* ret = cocos2d::gui::Button::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Button\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Button*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Button_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Button* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::Button();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.Button\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.Button\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Button\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Button_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_Button_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Button)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_Button(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.Button\");\n    tolua_cclass(tolua_S,\"Button\",\"ccui.Button\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Button\");\n        tolua_function(tolua_S,\"getTitleText\",lua_cocos2dx_gui_Button_getTitleText);\n        tolua_function(tolua_S,\"loadTextureNormal\",lua_cocos2dx_gui_Button_loadTextureNormal);\n        tolua_function(tolua_S,\"setCapInsetsNormalRenderer\",lua_cocos2dx_gui_Button_setCapInsetsNormalRenderer);\n        tolua_function(tolua_S,\"setCapInsetsPressedRenderer\",lua_cocos2dx_gui_Button_setCapInsetsPressedRenderer);\n        tolua_function(tolua_S,\"loadTexturePressed\",lua_cocos2dx_gui_Button_loadTexturePressed);\n        tolua_function(tolua_S,\"setTitleFontSize\",lua_cocos2dx_gui_Button_setTitleFontSize);\n        tolua_function(tolua_S,\"setCapInsetsDisabledRenderer\",lua_cocos2dx_gui_Button_setCapInsetsDisabledRenderer);\n        tolua_function(tolua_S,\"setTitleFontName\",lua_cocos2dx_gui_Button_setTitleFontName);\n        tolua_function(tolua_S,\"getTitleColor\",lua_cocos2dx_gui_Button_getTitleColor);\n        tolua_function(tolua_S,\"loadTextureDisabled\",lua_cocos2dx_gui_Button_loadTextureDisabled);\n        tolua_function(tolua_S,\"getTitleFontName\",lua_cocos2dx_gui_Button_getTitleFontName);\n        tolua_function(tolua_S,\"setPressedActionEnabled\",lua_cocos2dx_gui_Button_setPressedActionEnabled);\n        tolua_function(tolua_S,\"setCapInsets\",lua_cocos2dx_gui_Button_setCapInsets);\n        tolua_function(tolua_S,\"setScale9Enabled\",lua_cocos2dx_gui_Button_setScale9Enabled);\n        tolua_function(tolua_S,\"loadTextures\",lua_cocos2dx_gui_Button_loadTextures);\n        tolua_function(tolua_S,\"getTitleFontSize\",lua_cocos2dx_gui_Button_getTitleFontSize);\n        tolua_function(tolua_S,\"setTitleText\",lua_cocos2dx_gui_Button_setTitleText);\n        tolua_function(tolua_S,\"setTitleColor\",lua_cocos2dx_gui_Button_setTitleColor);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_Button_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_Button_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::Button).name();\n    g_luaType[typeName] = \"ccui.Button\";\n    g_typeCast[\"Button\"] = \"ccui.Button\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_CheckBox_getSelectedState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_getSelectedState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getSelectedState();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSelectedState\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_getSelectedState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextureBackGroundSelected(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTextureBackGroundSelected(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextureBackGroundSelected\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextureBackGroundDisabled(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTextureBackGroundDisabled(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextureBackGroundDisabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_loadTextureFrontCross(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_loadTextureFrontCross'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextureFrontCross(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTextureFrontCross(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextureFrontCross\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_loadTextureFrontCross'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_loadTextures(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_loadTextures'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 5) \n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n        const char* arg3;\n        const char* arg4;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n\n        std::string arg3_tmp; ok &= luaval_to_std_string(tolua_S, 5, &arg3_tmp); arg3 = arg3_tmp.c_str();\n\n        std::string arg4_tmp; ok &= luaval_to_std_string(tolua_S, 6, &arg4_tmp); arg4 = arg4_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextures(arg0, arg1, arg2, arg3, arg4);\n        return 0;\n    }\n    if (argc == 6) \n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n        const char* arg3;\n        const char* arg4;\n        cocos2d::gui::TextureResType arg5;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n\n        std::string arg3_tmp; ok &= luaval_to_std_string(tolua_S, 5, &arg3_tmp); arg3 = arg3_tmp.c_str();\n\n        std::string arg4_tmp; ok &= luaval_to_std_string(tolua_S, 6, &arg4_tmp); arg4 = arg4_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 7,(int *)&arg5);\n        if(!ok)\n            return 0;\n        cobj->loadTextures(arg0, arg1, arg2, arg3, arg4, arg5);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextures\",argc, 5);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_loadTextures'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_loadTextureBackGround(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_loadTextureBackGround'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextureBackGround(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTextureBackGround(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextureBackGround\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_loadTextureBackGround'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_setSelectedState(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_setSelectedState'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSelectedState(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSelectedState\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_setSelectedState'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::CheckBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTextureFrontCrossDisabled(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTextureFrontCrossDisabled(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTextureFrontCrossDisabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::CheckBox* ret = cocos2d::gui::CheckBox::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.CheckBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::CheckBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_CheckBox_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::CheckBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::CheckBox();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.CheckBox\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.CheckBox\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"CheckBox\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_CheckBox_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_CheckBox_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (CheckBox)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_CheckBox(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.CheckBox\");\n    tolua_cclass(tolua_S,\"CheckBox\",\"ccui.CheckBox\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"CheckBox\");\n        tolua_function(tolua_S,\"getSelectedState\",lua_cocos2dx_gui_CheckBox_getSelectedState);\n        tolua_function(tolua_S,\"loadTextureBackGroundSelected\",lua_cocos2dx_gui_CheckBox_loadTextureBackGroundSelected);\n        tolua_function(tolua_S,\"loadTextureBackGroundDisabled\",lua_cocos2dx_gui_CheckBox_loadTextureBackGroundDisabled);\n        tolua_function(tolua_S,\"loadTextureFrontCross\",lua_cocos2dx_gui_CheckBox_loadTextureFrontCross);\n        tolua_function(tolua_S,\"loadTextures\",lua_cocos2dx_gui_CheckBox_loadTextures);\n        tolua_function(tolua_S,\"loadTextureBackGround\",lua_cocos2dx_gui_CheckBox_loadTextureBackGround);\n        tolua_function(tolua_S,\"setSelectedState\",lua_cocos2dx_gui_CheckBox_setSelectedState);\n        tolua_function(tolua_S,\"loadTextureFrontCrossDisabled\",lua_cocos2dx_gui_CheckBox_loadTextureFrontCrossDisabled);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_CheckBox_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_CheckBox_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::CheckBox).name();\n    g_luaType[typeName] = \"ccui.CheckBox\";\n    g_typeCast[\"CheckBox\"] = \"ccui.CheckBox\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_ImageView_setTextureRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ImageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ImageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ImageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ImageView_setTextureRect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTextureRect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextureRect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ImageView_setTextureRect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ImageView_setCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ImageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ImageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ImageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ImageView_setCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ImageView_setCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ImageView_setScale9Enabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ImageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ImageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ImageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ImageView_setScale9Enabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScale9Enabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScale9Enabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ImageView_setScale9Enabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ImageView_loadTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ImageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ImageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ImageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ImageView_loadTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTexture(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTexture(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ImageView_loadTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ImageView_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.ImageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::ImageView* ret = cocos2d::gui::ImageView::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.ImageView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::ImageView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ImageView_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_ImageView_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ImageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::ImageView();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.ImageView\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.ImageView\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ImageView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ImageView_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_ImageView_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ImageView)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_ImageView(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.ImageView\");\n    tolua_cclass(tolua_S,\"ImageView\",\"ccui.ImageView\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ImageView\");\n        tolua_function(tolua_S,\"setTextureRect\",lua_cocos2dx_gui_ImageView_setTextureRect);\n        tolua_function(tolua_S,\"setCapInsets\",lua_cocos2dx_gui_ImageView_setCapInsets);\n        tolua_function(tolua_S,\"setScale9Enabled\",lua_cocos2dx_gui_ImageView_setScale9Enabled);\n        tolua_function(tolua_S,\"loadTexture\",lua_cocos2dx_gui_ImageView_loadTexture);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_ImageView_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_ImageView_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::ImageView).name();\n    g_luaType[typeName] = \"ccui.ImageView\";\n    g_typeCast[\"ImageView\"] = \"ccui.ImageView\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_Text_getStringLength(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_getStringLength'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getStringLength();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringLength\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_getStringLength'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_setFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_setFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_setFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_setTouchScaleChangeEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_setTouchScaleChangeEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTouchScaleChangeEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTouchScaleChangeEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_setTouchScaleChangeEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_getStringValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_getStringValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getStringValue();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_getStringValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_setText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_setText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setText(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setText\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_setText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_setTextVerticalAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_setTextVerticalAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextVAlignment arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTextVerticalAlignment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextVerticalAlignment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_setTextVerticalAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_setFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_setFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_setFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_isTouchScaleChangeEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_isTouchScaleChangeEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTouchScaleChangeEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTouchScaleChangeEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_isTouchScaleChangeEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_setTextHorizontalAlignment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_setTextHorizontalAlignment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::TextHAlignment arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTextHorizontalAlignment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextHorizontalAlignment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_setTextHorizontalAlignment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_setTextAreaSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Text*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Text_setTextAreaSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTextAreaSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTextAreaSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_setTextAreaSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Text_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Text\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::Text* ret = cocos2d::gui::Text::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Text\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Text*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Text_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Text* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::Text();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.Text\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.Text\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Text\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Text_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_Text_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Text)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_Text(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.Text\");\n    tolua_cclass(tolua_S,\"Text\",\"ccui.Text\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Text\");\n        tolua_function(tolua_S,\"getStringLength\",lua_cocos2dx_gui_Text_getStringLength);\n        tolua_function(tolua_S,\"setFontName\",lua_cocos2dx_gui_Text_setFontName);\n        tolua_function(tolua_S,\"setTouchScaleChangeEnabled\",lua_cocos2dx_gui_Text_setTouchScaleChangeEnabled);\n        tolua_function(tolua_S,\"getStringValue\",lua_cocos2dx_gui_Text_getStringValue);\n        tolua_function(tolua_S,\"setText\",lua_cocos2dx_gui_Text_setText);\n        tolua_function(tolua_S,\"setTextVerticalAlignment\",lua_cocos2dx_gui_Text_setTextVerticalAlignment);\n        tolua_function(tolua_S,\"setFontSize\",lua_cocos2dx_gui_Text_setFontSize);\n        tolua_function(tolua_S,\"isTouchScaleChangeEnabled\",lua_cocos2dx_gui_Text_isTouchScaleChangeEnabled);\n        tolua_function(tolua_S,\"setTextHorizontalAlignment\",lua_cocos2dx_gui_Text_setTextHorizontalAlignment);\n        tolua_function(tolua_S,\"setTextAreaSize\",lua_cocos2dx_gui_Text_setTextAreaSize);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_Text_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_Text_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::Text).name();\n    g_luaType[typeName] = \"ccui.Text\";\n    g_typeCast[\"Text\"] = \"ccui.Text\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_TextAtlas_setProperty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextAtlas_setProperty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 5) \n    {\n        std::string arg0;\n        std::string arg1;\n        int arg2;\n        int arg3;\n        std::string arg4;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n        ok &= luaval_to_std_string(tolua_S, 6,&arg4);\n        if(!ok)\n            return 0;\n        cobj->setProperty(arg0, arg1, arg2, arg3, arg4);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setProperty\",argc, 5);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextAtlas_setProperty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextAtlas_getStringValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextAtlas_getStringValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getStringValue();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextAtlas_getStringValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextAtlas_setStringValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextAtlas*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextAtlas_setStringValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStringValue(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStringValue\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextAtlas_setStringValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextAtlas_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.TextAtlas\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::TextAtlas* ret = cocos2d::gui::TextAtlas::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.TextAtlas\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::TextAtlas*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextAtlas_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_TextAtlas_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextAtlas* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::TextAtlas();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.TextAtlas\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.TextAtlas\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TextAtlas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextAtlas_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_TextAtlas_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TextAtlas)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_TextAtlas(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.TextAtlas\");\n    tolua_cclass(tolua_S,\"TextAtlas\",\"ccui.TextAtlas\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TextAtlas\");\n        tolua_function(tolua_S,\"setProperty\",lua_cocos2dx_gui_TextAtlas_setProperty);\n        tolua_function(tolua_S,\"getStringValue\",lua_cocos2dx_gui_TextAtlas_getStringValue);\n        tolua_function(tolua_S,\"setStringValue\",lua_cocos2dx_gui_TextAtlas_setStringValue);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_TextAtlas_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_TextAtlas_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::TextAtlas).name();\n    g_luaType[typeName] = \"ccui.TextAtlas\";\n    g_typeCast[\"TextAtlas\"] = \"ccui.TextAtlas\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_LoadingBar_setPercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LoadingBar*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LoadingBar_setPercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPercent(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPercent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_setPercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_loadTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LoadingBar*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LoadingBar_loadTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadTexture(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadTexture(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_loadTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_setDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LoadingBar*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LoadingBar_setDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::LoadingBarType arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDirection(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDirection\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_setDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_setScale9Enabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LoadingBar*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LoadingBar_setScale9Enabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScale9Enabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScale9Enabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_setScale9Enabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_setCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LoadingBar*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LoadingBar_setCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_setCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_getDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LoadingBar*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LoadingBar_getDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getDirection();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDirection\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_getDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_getPercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::LoadingBar*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_LoadingBar_getPercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPercent();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPercent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_getPercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.LoadingBar\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::LoadingBar* ret = cocos2d::gui::LoadingBar::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.LoadingBar\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::LoadingBar*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_LoadingBar_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::LoadingBar* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::LoadingBar();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.LoadingBar\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.LoadingBar\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"LoadingBar\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_LoadingBar_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_LoadingBar_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (LoadingBar)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_LoadingBar(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.LoadingBar\");\n    tolua_cclass(tolua_S,\"LoadingBar\",\"ccui.LoadingBar\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"LoadingBar\");\n        tolua_function(tolua_S,\"setPercent\",lua_cocos2dx_gui_LoadingBar_setPercent);\n        tolua_function(tolua_S,\"loadTexture\",lua_cocos2dx_gui_LoadingBar_loadTexture);\n        tolua_function(tolua_S,\"setDirection\",lua_cocos2dx_gui_LoadingBar_setDirection);\n        tolua_function(tolua_S,\"setScale9Enabled\",lua_cocos2dx_gui_LoadingBar_setScale9Enabled);\n        tolua_function(tolua_S,\"setCapInsets\",lua_cocos2dx_gui_LoadingBar_setCapInsets);\n        tolua_function(tolua_S,\"getDirection\",lua_cocos2dx_gui_LoadingBar_getDirection);\n        tolua_function(tolua_S,\"getPercent\",lua_cocos2dx_gui_LoadingBar_getPercent);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_LoadingBar_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_LoadingBar_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::LoadingBar).name();\n    g_luaType[typeName] = \"ccui.LoadingBar\";\n    g_typeCast[\"LoadingBar\"] = \"ccui.LoadingBar\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_ScrollView_scrollToTop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToTop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToTop(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToTop\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToTop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToPercentHorizontal(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToPercentHorizontal'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        double arg0;\n        double arg1;\n        bool arg2;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->scrollToPercentHorizontal(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToPercentHorizontal\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToPercentHorizontal'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_isInertiaScrollEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_isInertiaScrollEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isInertiaScrollEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isInertiaScrollEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_isInertiaScrollEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToPercentBothDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToPercentBothDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::Point arg0;\n        double arg1;\n        bool arg2;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->scrollToPercentBothDirection(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToPercentBothDirection\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToPercentBothDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_getDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_getDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getDirection();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDirection\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_getDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToBottomLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToBottomLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToBottomLeft(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToBottomLeft\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToBottomLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_getInnerContainer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_getInnerContainer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::Layout* ret = cobj->getInnerContainer();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Layout\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Layout*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInnerContainer\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_getInnerContainer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToBottom(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToBottom'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToBottom();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToBottom\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToBottom'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_setDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_setDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::SCROLLVIEW_DIR arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDirection(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDirection\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_setDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToTopLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToTopLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToTopLeft(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToTopLeft\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToTopLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToTopRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToTopRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToTopRight();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToTopRight\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToTopRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToBottomLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToBottomLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToBottomLeft();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToBottomLeft\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToBottomLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_setInnerContainerSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_setInnerContainerSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setInnerContainerSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInnerContainerSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_setInnerContainerSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_getInnerContainerSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_getInnerContainerSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Size& ret = cobj->getInnerContainerSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInnerContainerSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_getInnerContainerSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_isBounceEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_isBounceEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBounceEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBounceEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_isBounceEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToPercentVertical(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToPercentVertical'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->jumpToPercentVertical(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToPercentVertical\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToPercentVertical'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_setInertiaScrollEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_setInertiaScrollEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInertiaScrollEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInertiaScrollEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_setInertiaScrollEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToTopLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToTopLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToTopLeft();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToTopLeft\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToTopLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToPercentHorizontal(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToPercentHorizontal'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->jumpToPercentHorizontal(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToPercentHorizontal\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToPercentHorizontal'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToBottomRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToBottomRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToBottomRight();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToBottomRight\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToBottomRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_setBounceEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_setBounceEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBounceEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBounceEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_setBounceEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToTop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToTop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToTop();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToTop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToTop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToLeft(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToLeft\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToPercentBothDirection(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToPercentBothDirection'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->jumpToPercentBothDirection(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToPercentBothDirection\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToPercentBothDirection'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToPercentVertical(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToPercentVertical'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        double arg0;\n        double arg1;\n        bool arg2;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->scrollToPercentVertical(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToPercentVertical\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToPercentVertical'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToBottom(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToBottom'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToBottom(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToBottom\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToBottom'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToBottomRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToBottomRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToBottomRight(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToBottomRight\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToBottomRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToLeft(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToLeft'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToLeft();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToLeft\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToLeft'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToRight(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToRight\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_jumpToRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_jumpToRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->jumpToRight();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"jumpToRight\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_jumpToRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_scrollToTopRight(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ScrollView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ScrollView_scrollToTopRight'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        bool arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->scrollToTopRight(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToTopRight\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_scrollToTopRight'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::ScrollView* ret = cocos2d::gui::ScrollView::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.ScrollView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::ScrollView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_ScrollView_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ScrollView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::ScrollView();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.ScrollView\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.ScrollView\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ScrollView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ScrollView_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_ScrollView_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ScrollView)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_ScrollView(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.ScrollView\");\n    tolua_cclass(tolua_S,\"ScrollView\",\"ccui.ScrollView\",\"ccui.Layout\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ScrollView\");\n        tolua_function(tolua_S,\"scrollToTop\",lua_cocos2dx_gui_ScrollView_scrollToTop);\n        tolua_function(tolua_S,\"scrollToPercentHorizontal\",lua_cocos2dx_gui_ScrollView_scrollToPercentHorizontal);\n        tolua_function(tolua_S,\"isInertiaScrollEnabled\",lua_cocos2dx_gui_ScrollView_isInertiaScrollEnabled);\n        tolua_function(tolua_S,\"scrollToPercentBothDirection\",lua_cocos2dx_gui_ScrollView_scrollToPercentBothDirection);\n        tolua_function(tolua_S,\"getDirection\",lua_cocos2dx_gui_ScrollView_getDirection);\n        tolua_function(tolua_S,\"scrollToBottomLeft\",lua_cocos2dx_gui_ScrollView_scrollToBottomLeft);\n        tolua_function(tolua_S,\"getInnerContainer\",lua_cocos2dx_gui_ScrollView_getInnerContainer);\n        tolua_function(tolua_S,\"jumpToBottom\",lua_cocos2dx_gui_ScrollView_jumpToBottom);\n        tolua_function(tolua_S,\"setDirection\",lua_cocos2dx_gui_ScrollView_setDirection);\n        tolua_function(tolua_S,\"scrollToTopLeft\",lua_cocos2dx_gui_ScrollView_scrollToTopLeft);\n        tolua_function(tolua_S,\"jumpToTopRight\",lua_cocos2dx_gui_ScrollView_jumpToTopRight);\n        tolua_function(tolua_S,\"jumpToBottomLeft\",lua_cocos2dx_gui_ScrollView_jumpToBottomLeft);\n        tolua_function(tolua_S,\"setInnerContainerSize\",lua_cocos2dx_gui_ScrollView_setInnerContainerSize);\n        tolua_function(tolua_S,\"getInnerContainerSize\",lua_cocos2dx_gui_ScrollView_getInnerContainerSize);\n        tolua_function(tolua_S,\"isBounceEnabled\",lua_cocos2dx_gui_ScrollView_isBounceEnabled);\n        tolua_function(tolua_S,\"jumpToPercentVertical\",lua_cocos2dx_gui_ScrollView_jumpToPercentVertical);\n        tolua_function(tolua_S,\"setInertiaScrollEnabled\",lua_cocos2dx_gui_ScrollView_setInertiaScrollEnabled);\n        tolua_function(tolua_S,\"jumpToTopLeft\",lua_cocos2dx_gui_ScrollView_jumpToTopLeft);\n        tolua_function(tolua_S,\"jumpToPercentHorizontal\",lua_cocos2dx_gui_ScrollView_jumpToPercentHorizontal);\n        tolua_function(tolua_S,\"jumpToBottomRight\",lua_cocos2dx_gui_ScrollView_jumpToBottomRight);\n        tolua_function(tolua_S,\"setBounceEnabled\",lua_cocos2dx_gui_ScrollView_setBounceEnabled);\n        tolua_function(tolua_S,\"jumpToTop\",lua_cocos2dx_gui_ScrollView_jumpToTop);\n        tolua_function(tolua_S,\"scrollToLeft\",lua_cocos2dx_gui_ScrollView_scrollToLeft);\n        tolua_function(tolua_S,\"jumpToPercentBothDirection\",lua_cocos2dx_gui_ScrollView_jumpToPercentBothDirection);\n        tolua_function(tolua_S,\"scrollToPercentVertical\",lua_cocos2dx_gui_ScrollView_scrollToPercentVertical);\n        tolua_function(tolua_S,\"scrollToBottom\",lua_cocos2dx_gui_ScrollView_scrollToBottom);\n        tolua_function(tolua_S,\"scrollToBottomRight\",lua_cocos2dx_gui_ScrollView_scrollToBottomRight);\n        tolua_function(tolua_S,\"jumpToLeft\",lua_cocos2dx_gui_ScrollView_jumpToLeft);\n        tolua_function(tolua_S,\"scrollToRight\",lua_cocos2dx_gui_ScrollView_scrollToRight);\n        tolua_function(tolua_S,\"jumpToRight\",lua_cocos2dx_gui_ScrollView_jumpToRight);\n        tolua_function(tolua_S,\"scrollToTopRight\",lua_cocos2dx_gui_ScrollView_scrollToTopRight);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_ScrollView_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_ScrollView_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::ScrollView).name();\n    g_luaType[typeName] = \"ccui.ScrollView\";\n    g_typeCast[\"ScrollView\"] = \"ccui.ScrollView\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_ListView_getIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_getIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::Widget* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getIndex(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_getIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_removeAllItems(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_removeAllItems'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllItems();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllItems\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_removeAllItems'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_setGravity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_setGravity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::ListViewGravity arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setGravity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGravity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_setGravity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_pushBackCustomItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_pushBackCustomItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::Widget* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->pushBackCustomItem(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pushBackCustomItem\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_pushBackCustomItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_getItems(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_getItems'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::gui::Widget *>& ret = cobj->getItems();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getItems\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_getItems'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_removeItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_removeItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->removeItem(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeItem\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_removeItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_getCurSelectedIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_getCurSelectedIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getCurSelectedIndex();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurSelectedIndex\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_getCurSelectedIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_insertDefaultItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_insertDefaultItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->insertDefaultItem(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"insertDefaultItem\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_insertDefaultItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_setItemsMargin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_setItemsMargin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setItemsMargin(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setItemsMargin\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_setItemsMargin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_removeLastItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_removeLastItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeLastItem();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeLastItem\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_removeLastItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_getItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_getItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cobj->getItem(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getItem\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_getItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_setItemModel(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_setItemModel'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::Widget* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setItemModel(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setItemModel\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_setItemModel'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_requestRefreshView(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_requestRefreshView'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->requestRefreshView();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"requestRefreshView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_requestRefreshView'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_pushBackDefaultItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_pushBackDefaultItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pushBackDefaultItem();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pushBackDefaultItem\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_pushBackDefaultItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_insertCustomItem(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::ListView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_ListView_insertCustomItem'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::gui::Widget* arg0;\n        ssize_t arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->insertCustomItem(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"insertCustomItem\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_insertCustomItem'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::ListView* ret = cocos2d::gui::ListView::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.ListView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::ListView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_ListView_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::ListView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::ListView();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.ListView\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.ListView\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ListView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_ListView_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_ListView_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ListView)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_ListView(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.ListView\");\n    tolua_cclass(tolua_S,\"ListView\",\"ccui.ListView\",\"ccui.ScrollView\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ListView\");\n        tolua_function(tolua_S,\"getIndex\",lua_cocos2dx_gui_ListView_getIndex);\n        tolua_function(tolua_S,\"removeAllItems\",lua_cocos2dx_gui_ListView_removeAllItems);\n        tolua_function(tolua_S,\"setGravity\",lua_cocos2dx_gui_ListView_setGravity);\n        tolua_function(tolua_S,\"pushBackCustomItem\",lua_cocos2dx_gui_ListView_pushBackCustomItem);\n        tolua_function(tolua_S,\"getItems\",lua_cocos2dx_gui_ListView_getItems);\n        tolua_function(tolua_S,\"removeItem\",lua_cocos2dx_gui_ListView_removeItem);\n        tolua_function(tolua_S,\"getCurSelectedIndex\",lua_cocos2dx_gui_ListView_getCurSelectedIndex);\n        tolua_function(tolua_S,\"insertDefaultItem\",lua_cocos2dx_gui_ListView_insertDefaultItem);\n        tolua_function(tolua_S,\"setItemsMargin\",lua_cocos2dx_gui_ListView_setItemsMargin);\n        tolua_function(tolua_S,\"removeLastItem\",lua_cocos2dx_gui_ListView_removeLastItem);\n        tolua_function(tolua_S,\"getItem\",lua_cocos2dx_gui_ListView_getItem);\n        tolua_function(tolua_S,\"setItemModel\",lua_cocos2dx_gui_ListView_setItemModel);\n        tolua_function(tolua_S,\"requestRefreshView\",lua_cocos2dx_gui_ListView_requestRefreshView);\n        tolua_function(tolua_S,\"pushBackDefaultItem\",lua_cocos2dx_gui_ListView_pushBackDefaultItem);\n        tolua_function(tolua_S,\"insertCustomItem\",lua_cocos2dx_gui_ListView_insertCustomItem);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_ListView_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_ListView_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::ListView).name();\n    g_luaType[typeName] = \"ccui.ListView\";\n    g_typeCast[\"ListView\"] = \"ccui.ListView\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_Slider_setPercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_setPercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPercent(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPercent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_setPercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_loadSlidBallTextureNormal(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_loadSlidBallTextureNormal'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTextureNormal(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTextureNormal(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadSlidBallTextureNormal\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_loadSlidBallTextureNormal'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_loadBarTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_loadBarTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadBarTexture(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadBarTexture(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadBarTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_loadBarTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_loadProgressBarTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_loadProgressBarTexture'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadProgressBarTexture(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadProgressBarTexture(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadProgressBarTexture\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_loadProgressBarTexture'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_loadSlidBallTextures(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_loadSlidBallTextures'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTextures(arg0, arg1, arg2);\n        return 0;\n    }\n    if (argc == 4) \n    {\n        const char* arg0;\n        const char* arg1;\n        const char* arg2;\n        cocos2d::gui::TextureResType arg3;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        std::string arg2_tmp; ok &= luaval_to_std_string(tolua_S, 4, &arg2_tmp); arg2 = arg2_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTextures(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadSlidBallTextures\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_loadSlidBallTextures'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsetProgressBarRebderer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsetProgressBarRebderer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_setCapInsetsBarRenderer(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_setCapInsetsBarRenderer'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsetsBarRenderer(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsetsBarRenderer\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_setCapInsetsBarRenderer'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_setScale9Enabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_setScale9Enabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setScale9Enabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setScale9Enabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_setScale9Enabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_setCapInsets(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_setCapInsets'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Rect arg0;\n\n        ok &= luaval_to_rect(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setCapInsets(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCapInsets\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_setCapInsets'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_loadSlidBallTexturePressed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_loadSlidBallTexturePressed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTexturePressed(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTexturePressed(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadSlidBallTexturePressed\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_loadSlidBallTexturePressed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_loadSlidBallTextureDisabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_loadSlidBallTextureDisabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTextureDisabled(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        const char* arg0;\n        cocos2d::gui::TextureResType arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->loadSlidBallTextureDisabled(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"loadSlidBallTextureDisabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_loadSlidBallTextureDisabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_getPercent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::Slider*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_Slider_getPercent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPercent();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPercent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_getPercent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::Slider* ret = cocos2d::gui::Slider::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Slider\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Slider*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Slider_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::Slider* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::Slider();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.Slider\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.Slider\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Slider\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Slider_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_Slider_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Slider)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_Slider(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.Slider\");\n    tolua_cclass(tolua_S,\"Slider\",\"ccui.Slider\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Slider\");\n        tolua_function(tolua_S,\"setPercent\",lua_cocos2dx_gui_Slider_setPercent);\n        tolua_function(tolua_S,\"loadSlidBallTextureNormal\",lua_cocos2dx_gui_Slider_loadSlidBallTextureNormal);\n        tolua_function(tolua_S,\"loadBarTexture\",lua_cocos2dx_gui_Slider_loadBarTexture);\n        tolua_function(tolua_S,\"loadProgressBarTexture\",lua_cocos2dx_gui_Slider_loadProgressBarTexture);\n        tolua_function(tolua_S,\"loadSlidBallTextures\",lua_cocos2dx_gui_Slider_loadSlidBallTextures);\n        tolua_function(tolua_S,\"setCapInsetProgressBarRebderer\",lua_cocos2dx_gui_Slider_setCapInsetProgressBarRebderer);\n        tolua_function(tolua_S,\"setCapInsetsBarRenderer\",lua_cocos2dx_gui_Slider_setCapInsetsBarRenderer);\n        tolua_function(tolua_S,\"setScale9Enabled\",lua_cocos2dx_gui_Slider_setScale9Enabled);\n        tolua_function(tolua_S,\"setCapInsets\",lua_cocos2dx_gui_Slider_setCapInsets);\n        tolua_function(tolua_S,\"loadSlidBallTexturePressed\",lua_cocos2dx_gui_Slider_loadSlidBallTexturePressed);\n        tolua_function(tolua_S,\"loadSlidBallTextureDisabled\",lua_cocos2dx_gui_Slider_loadSlidBallTextureDisabled);\n        tolua_function(tolua_S,\"getPercent\",lua_cocos2dx_gui_Slider_getPercent);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_Slider_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_Slider_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::Slider).name();\n    g_luaType[typeName] = \"ccui.Slider\";\n    g_typeCast[\"Slider\"] = \"ccui.Slider\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_TextField_setAttachWithIME(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setAttachWithIME'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAttachWithIME(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAttachWithIME\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setAttachWithIME'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_getStringValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_getStringValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getStringValue();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_getStringValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setPasswordStyleText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setPasswordStyleText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setPasswordStyleText(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPasswordStyleText\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setPasswordStyleText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_getAttachWithIME(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_getAttachWithIME'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getAttachWithIME();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAttachWithIME\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_getAttachWithIME'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setFontName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setFontName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setFontName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_getInsertText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_getInsertText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getInsertText();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInsertText\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_getInsertText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setInsertText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setInsertText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setInsertText(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInsertText\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setInsertText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_getDetachWithIME(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_getDetachWithIME'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getDetachWithIME();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDetachWithIME\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_getDetachWithIME'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_didNotSelectSelf(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_didNotSelectSelf'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->didNotSelectSelf();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"didNotSelectSelf\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_didNotSelectSelf'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_attachWithIME(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_attachWithIME'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->attachWithIME();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"attachWithIME\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_attachWithIME'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setPasswordEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setPasswordEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPasswordEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPasswordEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setPasswordEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setMaxLengthEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setMaxLengthEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaxLengthEnabled(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaxLengthEnabled\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setMaxLengthEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_getDeleteBackward(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_getDeleteBackward'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getDeleteBackward();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDeleteBackward\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_getDeleteBackward'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setFontSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setFontSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFontSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFontSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setFontSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setPlaceHolder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setPlaceHolder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPlaceHolder(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPlaceHolder\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setPlaceHolder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_isPasswordEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_isPasswordEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isPasswordEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isPasswordEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_isPasswordEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_getMaxLength(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_getMaxLength'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getMaxLength();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaxLength\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_getMaxLength'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_isMaxLengthEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_isMaxLengthEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isMaxLengthEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isMaxLengthEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_isMaxLengthEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setDetachWithIME(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setDetachWithIME'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDetachWithIME(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDetachWithIME\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setDetachWithIME'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setText(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setText\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setMaxLength(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setMaxLength'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaxLength(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaxLength\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setMaxLength'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setTouchSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setTouchSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Size arg0;\n\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setTouchSize(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTouchSize\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setTouchSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_setDeleteBackward(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextField*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextField_setDeleteBackward'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDeleteBackward(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDeleteBackward\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_setDeleteBackward'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::TextField* ret = cocos2d::gui::TextField::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.TextField\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::TextField*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_TextField_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextField* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::TextField();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.TextField\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.TextField\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TextField\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextField_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_TextField_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TextField)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_TextField(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.TextField\");\n    tolua_cclass(tolua_S,\"TextField\",\"ccui.TextField\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TextField\");\n        tolua_function(tolua_S,\"setAttachWithIME\",lua_cocos2dx_gui_TextField_setAttachWithIME);\n        tolua_function(tolua_S,\"getStringValue\",lua_cocos2dx_gui_TextField_getStringValue);\n        tolua_function(tolua_S,\"setPasswordStyleText\",lua_cocos2dx_gui_TextField_setPasswordStyleText);\n        tolua_function(tolua_S,\"getAttachWithIME\",lua_cocos2dx_gui_TextField_getAttachWithIME);\n        tolua_function(tolua_S,\"setFontName\",lua_cocos2dx_gui_TextField_setFontName);\n        tolua_function(tolua_S,\"getInsertText\",lua_cocos2dx_gui_TextField_getInsertText);\n        tolua_function(tolua_S,\"setInsertText\",lua_cocos2dx_gui_TextField_setInsertText);\n        tolua_function(tolua_S,\"getDetachWithIME\",lua_cocos2dx_gui_TextField_getDetachWithIME);\n        tolua_function(tolua_S,\"didNotSelectSelf\",lua_cocos2dx_gui_TextField_didNotSelectSelf);\n        tolua_function(tolua_S,\"attachWithIME\",lua_cocos2dx_gui_TextField_attachWithIME);\n        tolua_function(tolua_S,\"setPasswordEnabled\",lua_cocos2dx_gui_TextField_setPasswordEnabled);\n        tolua_function(tolua_S,\"setMaxLengthEnabled\",lua_cocos2dx_gui_TextField_setMaxLengthEnabled);\n        tolua_function(tolua_S,\"getDeleteBackward\",lua_cocos2dx_gui_TextField_getDeleteBackward);\n        tolua_function(tolua_S,\"setFontSize\",lua_cocos2dx_gui_TextField_setFontSize);\n        tolua_function(tolua_S,\"setPlaceHolder\",lua_cocos2dx_gui_TextField_setPlaceHolder);\n        tolua_function(tolua_S,\"isPasswordEnabled\",lua_cocos2dx_gui_TextField_isPasswordEnabled);\n        tolua_function(tolua_S,\"getMaxLength\",lua_cocos2dx_gui_TextField_getMaxLength);\n        tolua_function(tolua_S,\"isMaxLengthEnabled\",lua_cocos2dx_gui_TextField_isMaxLengthEnabled);\n        tolua_function(tolua_S,\"setDetachWithIME\",lua_cocos2dx_gui_TextField_setDetachWithIME);\n        tolua_function(tolua_S,\"setText\",lua_cocos2dx_gui_TextField_setText);\n        tolua_function(tolua_S,\"setMaxLength\",lua_cocos2dx_gui_TextField_setMaxLength);\n        tolua_function(tolua_S,\"setTouchSize\",lua_cocos2dx_gui_TextField_setTouchSize);\n        tolua_function(tolua_S,\"setDeleteBackward\",lua_cocos2dx_gui_TextField_setDeleteBackward);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_TextField_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_TextField_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::TextField).name();\n    g_luaType[typeName] = \"ccui.TextField\";\n    g_typeCast[\"TextField\"] = \"ccui.TextField\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_TextBMFont_setFntFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextBMFont_setFntFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setFntFile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFntFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextBMFont_setFntFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextBMFont_getStringValue(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextBMFont_getStringValue'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getStringValue();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStringValue\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextBMFont_getStringValue'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextBMFont_setText(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.TextBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::TextBMFont*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_TextBMFont_setText'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setText(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setText\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextBMFont_setText'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_TextBMFont_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.TextBMFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::TextBMFont* ret = cocos2d::gui::TextBMFont::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.TextBMFont\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::TextBMFont*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextBMFont_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_TextBMFont_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::TextBMFont* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::TextBMFont();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.TextBMFont\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.TextBMFont\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TextBMFont\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_TextBMFont_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_TextBMFont_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TextBMFont)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_TextBMFont(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.TextBMFont\");\n    tolua_cclass(tolua_S,\"TextBMFont\",\"ccui.TextBMFont\",\"ccui.Widget\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TextBMFont\");\n        tolua_function(tolua_S,\"setFntFile\",lua_cocos2dx_gui_TextBMFont_setFntFile);\n        tolua_function(tolua_S,\"getStringValue\",lua_cocos2dx_gui_TextBMFont_getStringValue);\n        tolua_function(tolua_S,\"setText\",lua_cocos2dx_gui_TextBMFont_setText);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_TextBMFont_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_TextBMFont_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::TextBMFont).name();\n    g_luaType[typeName] = \"ccui.TextBMFont\";\n    g_typeCast[\"TextBMFont\"] = \"ccui.TextBMFont\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_PageView_getCurPageIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_getCurPageIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getCurPageIndex();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurPageIndex\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_getCurPageIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_addWidgetToPage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_addWidgetToPage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        cocos2d::gui::Widget* arg0;\n        ssize_t arg1;\n        bool arg2;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_ssize(tolua_S, 3, &arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->addWidgetToPage(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addWidgetToPage\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_addWidgetToPage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_getPage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_getPage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::gui::Layout* ret = cobj->getPage(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Layout\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Layout*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_getPage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_removePage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_removePage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::Layout* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Layout\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removePage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removePage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_removePage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_insertPage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_insertPage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::gui::Layout* arg0;\n        int arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Layout\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->insertPage(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"insertPage\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_insertPage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_scrollToPage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_scrollToPage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->scrollToPage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"scrollToPage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_scrollToPage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_removePageAtIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_removePageAtIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        ssize_t arg0;\n\n        ok &= luaval_to_ssize(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->removePageAtIndex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removePageAtIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_removePageAtIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_getPages(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_getPages'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::gui::Layout *>& ret = cobj->getPages();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPages\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_getPages'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_removeAllPages(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_removeAllPages'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllPages();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllPages\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_removeAllPages'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_addPage(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::gui::PageView*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_gui_PageView_addPage'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::gui::Layout* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Layout\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Layout*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addPage(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addPage\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_addPage'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::gui::PageView* ret = cocos2d::gui::PageView::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.PageView\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::PageView*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_PageView_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::gui::PageView* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocos2d::gui::PageView();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccui.PageView\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccui.PageView\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"PageView\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_PageView_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_gui_PageView_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PageView)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_PageView(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.PageView\");\n    tolua_cclass(tolua_S,\"PageView\",\"ccui.PageView\",\"ccui.Layout\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PageView\");\n        tolua_function(tolua_S,\"getCurPageIndex\",lua_cocos2dx_gui_PageView_getCurPageIndex);\n        tolua_function(tolua_S,\"addWidgetToPage\",lua_cocos2dx_gui_PageView_addWidgetToPage);\n        tolua_function(tolua_S,\"getPage\",lua_cocos2dx_gui_PageView_getPage);\n        tolua_function(tolua_S,\"removePage\",lua_cocos2dx_gui_PageView_removePage);\n        tolua_function(tolua_S,\"insertPage\",lua_cocos2dx_gui_PageView_insertPage);\n        tolua_function(tolua_S,\"scrollToPage\",lua_cocos2dx_gui_PageView_scrollToPage);\n        tolua_function(tolua_S,\"removePageAtIndex\",lua_cocos2dx_gui_PageView_removePageAtIndex);\n        tolua_function(tolua_S,\"getPages\",lua_cocos2dx_gui_PageView_getPages);\n        tolua_function(tolua_S,\"removeAllPages\",lua_cocos2dx_gui_PageView_removeAllPages);\n        tolua_function(tolua_S,\"addPage\",lua_cocos2dx_gui_PageView_addPage);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_gui_PageView_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_gui_PageView_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::PageView).name();\n    g_luaType[typeName] = \"ccui.PageView\";\n    g_typeCast[\"PageView\"] = \"ccui.PageView\";\n    return 1;\n}\n\nint lua_cocos2dx_gui_Helper_seekActionWidgetByActionTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Helper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::gui::Widget* arg0;\n        int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekActionWidgetByActionTag(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"seekActionWidgetByActionTag\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Helper_seekActionWidgetByActionTag'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Helper_seekWidgetByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Helper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::gui::Widget* arg0;\n        int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekWidgetByTag(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"seekWidgetByTag\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Helper_seekWidgetByTag'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Helper_seekWidgetByRelativeName(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Helper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::gui::Widget* arg0;\n        const char* arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekWidgetByRelativeName(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"seekWidgetByRelativeName\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Helper_seekWidgetByRelativeName'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_gui_Helper_seekWidgetByName(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccui.Helper\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::gui::Widget* arg0;\n        const char* arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccui.Widget\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::gui::Widget*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cocos2d::gui::Helper::seekWidgetByName(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"seekWidgetByName\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_gui_Helper_seekWidgetByName'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_gui_Helper_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Helper)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_gui_Helper(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccui.Helper\");\n    tolua_cclass(tolua_S,\"Helper\",\"ccui.Helper\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Helper\");\n        tolua_function(tolua_S,\"seekActionWidgetByActionTag\", lua_cocos2dx_gui_Helper_seekActionWidgetByActionTag);\n        tolua_function(tolua_S,\"seekWidgetByTag\", lua_cocos2dx_gui_Helper_seekWidgetByTag);\n        tolua_function(tolua_S,\"seekWidgetByRelativeName\", lua_cocos2dx_gui_Helper_seekWidgetByRelativeName);\n        tolua_function(tolua_S,\"seekWidgetByName\", lua_cocos2dx_gui_Helper_seekWidgetByName);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::gui::Helper).name();\n    g_luaType[typeName] = \"ccui.Helper\";\n    g_typeCast[\"Helper\"] = \"ccui.Helper\";\n    return 1;\n}\nTOLUA_API int register_all_cocos2dx_gui(lua_State* tolua_S)\n{\n\ttolua_open(tolua_S);\n\t\n\ttolua_module(tolua_S,\"ccui\",0);\n\ttolua_beginmodule(tolua_S,\"ccui\");\n\n\tlua_register_cocos2dx_gui_Widget(tolua_S);\n\tlua_register_cocos2dx_gui_Layout(tolua_S);\n\tlua_register_cocos2dx_gui_PageView(tolua_S);\n\tlua_register_cocos2dx_gui_CheckBox(tolua_S);\n\tlua_register_cocos2dx_gui_Helper(tolua_S);\n\tlua_register_cocos2dx_gui_Text(tolua_S);\n\tlua_register_cocos2dx_gui_Button(tolua_S);\n\tlua_register_cocos2dx_gui_LayoutParameter(tolua_S);\n\tlua_register_cocos2dx_gui_LinearLayoutParameter(tolua_S);\n\tlua_register_cocos2dx_gui_TextBMFont(tolua_S);\n\tlua_register_cocos2dx_gui_ScrollView(tolua_S);\n\tlua_register_cocos2dx_gui_LoadingBar(tolua_S);\n\tlua_register_cocos2dx_gui_Slider(tolua_S);\n\tlua_register_cocos2dx_gui_RelativeLayoutParameter(tolua_S);\n\tlua_register_cocos2dx_gui_ImageView(tolua_S);\n\tlua_register_cocos2dx_gui_TextAtlas(tolua_S);\n\tlua_register_cocos2dx_gui_TextField(tolua_S);\n\tlua_register_cocos2dx_gui_ListView(tolua_S);\n\n\ttolua_endmodule(tolua_S);\n\treturn 1;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_gui_auto.hpp",
    "content": "#ifndef __cocos2dx_gui_h__\n#define __cocos2dx_gui_h__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\nint register_all_cocos2dx_gui(lua_State* tolua_S);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#endif // __cocos2dx_gui_h__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_gui_auto_api.js",
    "content": "/**\n * @module cocos2dx_gui\n */\nvar ccui = ccui || {};\n\n/**\n * @class LayoutParameter\n */\nccui.LayoutParameter = {\n\n/**\n * @method getLayoutType\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutParameterType\"\n */\ngetLayoutType : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutParameter*\"\n */\ncreate : function () {},\n\n/**\n * @method LayoutParameter\n * @constructor\n */\nLayoutParameter : function () {},\n\n};\n\n/**\n * @class LinearLayoutParameter\n */\nccui.LinearLayoutParameter = {\n\n/**\n * @method setGravity\n * @param {cocos2d::gui::LinearGravity}\n */\nsetGravity : function () {},\n\n/**\n * @method getGravity\n * @return A value converted from C/C++ \"cocos2d::gui::LinearGravity\"\n */\ngetGravity : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::LinearLayoutParameter*\"\n */\ncreate : function () {},\n\n/**\n * @method LinearLayoutParameter\n * @constructor\n */\nLinearLayoutParameter : function () {},\n\n};\n\n/**\n * @class RelativeLayoutParameter\n */\nccui.RelativeLayoutParameter = {\n\n/**\n * @method setAlign\n * @param {cocos2d::gui::RelativeAlign}\n */\nsetAlign : function () {},\n\n/**\n * @method setRelativeToWidgetName\n * @param {const char*}\n */\nsetRelativeToWidgetName : function () {},\n\n/**\n * @method getRelativeName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetRelativeName : function () {},\n\n/**\n * @method getRelativeToWidgetName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetRelativeToWidgetName : function () {},\n\n/**\n * @method setRelativeName\n * @param {const char*}\n */\nsetRelativeName : function () {},\n\n/**\n * @method getAlign\n * @return A value converted from C/C++ \"cocos2d::gui::RelativeAlign\"\n */\ngetAlign : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::RelativeLayoutParameter*\"\n */\ncreate : function () {},\n\n/**\n * @method RelativeLayoutParameter\n * @constructor\n */\nRelativeLayoutParameter : function () {},\n\n};\n\n/**\n * @class Widget\n */\nccui.Widget = {\n\n/**\n * @method getVirtualRenderer\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetVirtualRenderer : function () {},\n\n/**\n * @method setSizePercent\n * @param {const cocos2d::Point&}\n */\nsetSizePercent : function () {},\n\n/**\n * @method setActionTag\n * @param {int}\n */\nsetActionTag : function () {},\n\n/**\n * @method getNodeByTag\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {int}\n */\ngetNodeByTag : function () {},\n\n/**\n * @method isFlipY\n * @return A value converted from C/C++ \"bool\"\n */\nisFlipY : function () {},\n\n/**\n * @method getTouchEndPos\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetTouchEndPos : function () {},\n\n/**\n * @method setPositionPercent\n * @param {const cocos2d::Point&}\n */\nsetPositionPercent : function () {},\n\n/**\n * @method getNodes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::Node *>&\"\n */\ngetNodes : function () {},\n\n/**\n * @method setPositionType\n * @param {cocos2d::gui::PositionType}\n */\nsetPositionType : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetName : function () {},\n\n/**\n * @method isIgnoreContentAdaptWithSize\n * @return A value converted from C/C++ \"bool\"\n */\nisIgnoreContentAdaptWithSize : function () {},\n\n/**\n * @method updateSizeAndPosition\n */\nupdateSizeAndPosition : function () {},\n\n/**\n * @method getBottomInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetBottomInParent : function () {},\n\n/**\n * @method getActionTag\n * @return A value converted from C/C++ \"int\"\n */\ngetActionTag : function () {},\n\n/**\n * @method getLayoutParameter\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutParameter*\"\n * @param {cocos2d::gui::LayoutParameterType}\n */\ngetLayoutParameter : function () {},\n\n/**\n * @method getPositionType\n * @return A value converted from C/C++ \"cocos2d::gui::PositionType\"\n */\ngetPositionType : function () {},\n\n/**\n * @method setName\n * @param {const char*}\n */\nsetName : function () {},\n\n/**\n * @method getChildByName\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {const char*}\n */\ngetChildByName : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method isFlipX\n * @return A value converted from C/C++ \"bool\"\n */\nisFlipX : function () {},\n\n/**\n * @method removeNodeByTag\n * @param {int}\n */\nremoveNodeByTag : function () {},\n\n/**\n * @method isTouchEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchEnabled : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetContentSize : function () {},\n\n/**\n * @method getTouchStartPos\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetTouchStartPos : function () {},\n\n/**\n * @method didNotSelectSelf\n */\ndidNotSelectSelf : function () {},\n\n/**\n * @method setFocused\n * @param {bool}\n */\nsetFocused : function () {},\n\n/**\n * @method setTouchEnabled\n * @param {bool}\n */\nsetTouchEnabled : function () {},\n\n/**\n * @method clone\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n */\nclone : function () {},\n\n/**\n * @method getTouchMovePos\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetTouchMovePos : function () {},\n\n/**\n * @method setEnabled\n * @param {bool}\n */\nsetEnabled : function () {},\n\n/**\n * @method setBrightStyle\n * @param {cocos2d::gui::BrightStyle}\n */\nsetBrightStyle : function () {},\n\n/**\n * @method setLayoutParameter\n * @param {cocos2d::gui::LayoutParameter*}\n */\nsetLayoutParameter : function () {},\n\n/**\n * @method setFlipY\n * @param {bool}\n */\nsetFlipY : function () {},\n\n/**\n * @method setFlipX\n * @param {bool}\n */\nsetFlipX : function () {},\n\n/**\n * @method getLeftInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetLeftInParent : function () {},\n\n/**\n * @method ignoreContentAdaptWithSize\n * @param {bool}\n */\nignoreContentAdaptWithSize : function () {},\n\n/**\n * @method isBright\n * @return A value converted from C/C++ \"bool\"\n */\nisBright : function () {},\n\n/**\n * @method clippingParentAreaContainPoint\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n */\nclippingParentAreaContainPoint : function () {},\n\n/**\n * @method getSizePercent\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetSizePercent : function () {},\n\n/**\n * @method getTopInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetTopInParent : function () {},\n\n/**\n * @method getWidgetType\n * @return A value converted from C/C++ \"cocos2d::gui::WidgetType\"\n */\ngetWidgetType : function () {},\n\n/**\n * @method getSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetSize : function () {},\n\n/**\n * @method getRightInParent\n * @return A value converted from C/C++ \"float\"\n */\ngetRightInParent : function () {},\n\n/**\n * @method getSizeType\n * @return A value converted from C/C++ \"cocos2d::gui::SizeType\"\n */\ngetSizeType : function () {},\n\n/**\n * @method removeNode\n * @param {cocos2d::Node*}\n */\nremoveNode : function () {},\n\n/**\n * @method removeAllNodes\n */\nremoveAllNodes : function () {},\n\n/**\n * @method getWorldPosition\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetWorldPosition : function () {},\n\n/**\n * @method getPositionPercent\n * @return A value converted from C/C++ \"const cocos2d::Point&\"\n */\ngetPositionPercent : function () {},\n\n/**\n * @method hitTest\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n */\nhitTest : function () {},\n\n/**\n * @method isFocused\n * @return A value converted from C/C++ \"bool\"\n */\nisFocused : function () {},\n\n/**\n * @method setSizeType\n * @param {cocos2d::gui::SizeType}\n */\nsetSizeType : function () {},\n\n/**\n * @method checkChildInfo\n * @param {int}\n * @param {cocos2d::gui::Widget*}\n * @param {const cocos2d::Point&}\n */\ncheckChildInfo : function () {},\n\n/**\n * @method setSize\n * @param {const cocos2d::Size&}\n */\nsetSize : function () {},\n\n/**\n * @method setBright\n * @param {bool}\n */\nsetBright : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n */\ncreate : function () {},\n\n/**\n * @method Widget\n * @constructor\n */\nWidget : function () {},\n\n};\n\n/**\n * @class Layout\n */\nccui.Layout = {\n\n/**\n * @method setBackGroundColorVector\n * @param {const cocos2d::Point&}\n */\nsetBackGroundColorVector : function () {},\n\n/**\n * @method hitTest\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n */\nhitTest : function () {},\n\n/**\n * @method getBackGroundImageTextureSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetBackGroundImageTextureSize : function () {},\n\n/**\n * @method getLayoutType\n * @return A value converted from C/C++ \"cocos2d::gui::LayoutType\"\n */\ngetLayoutType : function () {},\n\n/**\n * @method setClippingType\n * @param {cocos2d::gui::LayoutClippingType}\n */\nsetClippingType : function () {},\n\n/**\n * @method setBackGroundColorType\n * @param {cocos2d::gui::LayoutBackGroundColorType}\n */\nsetBackGroundColorType : function () {},\n\n/**\n * @method setBackGroundImage\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nsetBackGroundImage : function () {},\n\n/**\n * @method requestDoLayout\n */\nrequestDoLayout : function () {},\n\n/**\n * @method isClippingEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisClippingEnabled : function () {},\n\n/**\n * @method setBackGroundColorOpacity\n * @param {int}\n */\nsetBackGroundColorOpacity : function () {},\n\n/**\n * @method setBackGroundImageCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetBackGroundImageCapInsets : function () {},\n\n/**\n * @method removeBackGroundImage\n */\nremoveBackGroundImage : function () {},\n\n/**\n * @method setBackGroundImageScale9Enabled\n * @param {bool}\n */\nsetBackGroundImageScale9Enabled : function () {},\n\n/**\n * @method setClippingEnabled\n * @param {bool}\n */\nsetClippingEnabled : function () {},\n\n/**\n * @method setLayoutType\n * @param {cocos2d::gui::LayoutType}\n */\nsetLayoutType : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Layout*\"\n */\ncreate : function () {},\n\n/**\n * @method Layout\n * @constructor\n */\nLayout : function () {},\n\n};\n\n/**\n * @class Button\n */\nccui.Button = {\n\n/**\n * @method getTitleText\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetTitleText : function () {},\n\n/**\n * @method loadTextureNormal\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureNormal : function () {},\n\n/**\n * @method setCapInsetsNormalRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsNormalRenderer : function () {},\n\n/**\n * @method setCapInsetsPressedRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsPressedRenderer : function () {},\n\n/**\n * @method loadTexturePressed\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTexturePressed : function () {},\n\n/**\n * @method setTitleFontSize\n * @param {float}\n */\nsetTitleFontSize : function () {},\n\n/**\n * @method setCapInsetsDisabledRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsDisabledRenderer : function () {},\n\n/**\n * @method setTitleFontName\n * @param {const char*}\n */\nsetTitleFontName : function () {},\n\n/**\n * @method getTitleColor\n * @return A value converted from C/C++ \"const cocos2d::Color3B&\"\n */\ngetTitleColor : function () {},\n\n/**\n * @method loadTextureDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureDisabled : function () {},\n\n/**\n * @method getTitleFontName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetTitleFontName : function () {},\n\n/**\n * @method setPressedActionEnabled\n * @param {bool}\n */\nsetPressedActionEnabled : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method loadTextures\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextures : function () {},\n\n/**\n * @method getTitleFontSize\n * @return A value converted from C/C++ \"float\"\n */\ngetTitleFontSize : function () {},\n\n/**\n * @method setTitleText\n * @param {const std::string&}\n */\nsetTitleText : function () {},\n\n/**\n * @method setTitleColor\n * @param {const cocos2d::Color3B&}\n */\nsetTitleColor : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Button*\"\n */\ncreate : function () {},\n\n/**\n * @method Button\n * @constructor\n */\nButton : function () {},\n\n};\n\n/**\n * @class CheckBox\n */\nccui.CheckBox = {\n\n/**\n * @method getSelectedState\n * @return A value converted from C/C++ \"bool\"\n */\ngetSelectedState : function () {},\n\n/**\n * @method loadTextureBackGroundSelected\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureBackGroundSelected : function () {},\n\n/**\n * @method loadTextureBackGroundDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureBackGroundDisabled : function () {},\n\n/**\n * @method loadTextureFrontCross\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureFrontCross : function () {},\n\n/**\n * @method loadTextures\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextures : function () {},\n\n/**\n * @method loadTextureBackGround\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureBackGround : function () {},\n\n/**\n * @method setSelectedState\n * @param {bool}\n */\nsetSelectedState : function () {},\n\n/**\n * @method loadTextureFrontCrossDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTextureFrontCrossDisabled : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::CheckBox*\"\n */\ncreate : function () {},\n\n/**\n * @method CheckBox\n * @constructor\n */\nCheckBox : function () {},\n\n};\n\n/**\n * @class ImageView\n */\nccui.ImageView = {\n\n/**\n * @method setTextureRect\n * @param {const cocos2d::Rect&}\n */\nsetTextureRect : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method loadTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTexture : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::ImageView*\"\n */\ncreate : function () {},\n\n/**\n * @method ImageView\n * @constructor\n */\nImageView : function () {},\n\n};\n\n/**\n * @class Text\n */\nccui.Text = {\n\n/**\n * @method getStringLength\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetStringLength : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method setTouchScaleChangeEnabled\n * @param {bool}\n */\nsetTouchScaleChangeEnabled : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setText\n * @param {const std::string&}\n */\nsetText : function () {},\n\n/**\n * @method setTextVerticalAlignment\n * @param {cocos2d::TextVAlignment}\n */\nsetTextVerticalAlignment : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n/**\n * @method isTouchScaleChangeEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisTouchScaleChangeEnabled : function () {},\n\n/**\n * @method setTextHorizontalAlignment\n * @param {cocos2d::TextHAlignment}\n */\nsetTextHorizontalAlignment : function () {},\n\n/**\n * @method setTextAreaSize\n * @param {const cocos2d::Size&}\n */\nsetTextAreaSize : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Text*\"\n */\ncreate : function () {},\n\n/**\n * @method Text\n * @constructor\n */\nText : function () {},\n\n};\n\n/**\n * @class TextAtlas\n */\nccui.TextAtlas = {\n\n/**\n * @method setProperty\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n * @param {const std::string&}\n */\nsetProperty : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setStringValue\n * @param {const std::string&}\n */\nsetStringValue : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::TextAtlas*\"\n */\ncreate : function () {},\n\n/**\n * @method TextAtlas\n * @constructor\n */\nTextAtlas : function () {},\n\n};\n\n/**\n * @class LoadingBar\n */\nccui.LoadingBar = {\n\n/**\n * @method setPercent\n * @param {int}\n */\nsetPercent : function () {},\n\n/**\n * @method loadTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadTexture : function () {},\n\n/**\n * @method setDirection\n * @param {cocos2d::gui::LoadingBarType}\n */\nsetDirection : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method getDirection\n * @return A value converted from C/C++ \"int\"\n */\ngetDirection : function () {},\n\n/**\n * @method getPercent\n * @return A value converted from C/C++ \"int\"\n */\ngetPercent : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::LoadingBar*\"\n */\ncreate : function () {},\n\n/**\n * @method LoadingBar\n * @constructor\n */\nLoadingBar : function () {},\n\n};\n\n/**\n * @class ScrollView\n */\nccui.ScrollView = {\n\n/**\n * @method scrollToTop\n * @param {float}\n * @param {bool}\n */\nscrollToTop : function () {},\n\n/**\n * @method scrollToPercentHorizontal\n * @param {float}\n * @param {float}\n * @param {bool}\n */\nscrollToPercentHorizontal : function () {},\n\n/**\n * @method isInertiaScrollEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisInertiaScrollEnabled : function () {},\n\n/**\n * @method scrollToPercentBothDirection\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {bool}\n */\nscrollToPercentBothDirection : function () {},\n\n/**\n * @method getDirection\n * @return A value converted from C/C++ \"cocos2d::gui::SCROLLVIEW_DIR\"\n */\ngetDirection : function () {},\n\n/**\n * @method scrollToBottomLeft\n * @param {float}\n * @param {bool}\n */\nscrollToBottomLeft : function () {},\n\n/**\n * @method getInnerContainer\n * @return A value converted from C/C++ \"cocos2d::gui::Layout*\"\n */\ngetInnerContainer : function () {},\n\n/**\n * @method jumpToBottom\n */\njumpToBottom : function () {},\n\n/**\n * @method setDirection\n * @param {cocos2d::gui::SCROLLVIEW_DIR}\n */\nsetDirection : function () {},\n\n/**\n * @method scrollToTopLeft\n * @param {float}\n * @param {bool}\n */\nscrollToTopLeft : function () {},\n\n/**\n * @method jumpToTopRight\n */\njumpToTopRight : function () {},\n\n/**\n * @method jumpToBottomLeft\n */\njumpToBottomLeft : function () {},\n\n/**\n * @method setInnerContainerSize\n * @param {const cocos2d::Size&}\n */\nsetInnerContainerSize : function () {},\n\n/**\n * @method getInnerContainerSize\n * @return A value converted from C/C++ \"const cocos2d::Size&\"\n */\ngetInnerContainerSize : function () {},\n\n/**\n * @method isBounceEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisBounceEnabled : function () {},\n\n/**\n * @method jumpToPercentVertical\n * @param {float}\n */\njumpToPercentVertical : function () {},\n\n/**\n * @method setInertiaScrollEnabled\n * @param {bool}\n */\nsetInertiaScrollEnabled : function () {},\n\n/**\n * @method jumpToTopLeft\n */\njumpToTopLeft : function () {},\n\n/**\n * @method jumpToPercentHorizontal\n * @param {float}\n */\njumpToPercentHorizontal : function () {},\n\n/**\n * @method jumpToBottomRight\n */\njumpToBottomRight : function () {},\n\n/**\n * @method setBounceEnabled\n * @param {bool}\n */\nsetBounceEnabled : function () {},\n\n/**\n * @method jumpToTop\n */\njumpToTop : function () {},\n\n/**\n * @method scrollToLeft\n * @param {float}\n * @param {bool}\n */\nscrollToLeft : function () {},\n\n/**\n * @method jumpToPercentBothDirection\n * @param {const cocos2d::Point&}\n */\njumpToPercentBothDirection : function () {},\n\n/**\n * @method scrollToPercentVertical\n * @param {float}\n * @param {float}\n * @param {bool}\n */\nscrollToPercentVertical : function () {},\n\n/**\n * @method scrollToBottom\n * @param {float}\n * @param {bool}\n */\nscrollToBottom : function () {},\n\n/**\n * @method scrollToBottomRight\n * @param {float}\n * @param {bool}\n */\nscrollToBottomRight : function () {},\n\n/**\n * @method jumpToLeft\n */\njumpToLeft : function () {},\n\n/**\n * @method scrollToRight\n * @param {float}\n * @param {bool}\n */\nscrollToRight : function () {},\n\n/**\n * @method jumpToRight\n */\njumpToRight : function () {},\n\n/**\n * @method scrollToTopRight\n * @param {float}\n * @param {bool}\n */\nscrollToTopRight : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::ScrollView*\"\n */\ncreate : function () {},\n\n/**\n * @method ScrollView\n * @constructor\n */\nScrollView : function () {},\n\n};\n\n/**\n * @class ListView\n */\nccui.ListView = {\n\n/**\n * @method getIndex\n * @return A value converted from C/C++ \"ssize_t\"\n * @param {cocos2d::gui::Widget*}\n */\ngetIndex : function () {},\n\n/**\n * @method removeAllItems\n */\nremoveAllItems : function () {},\n\n/**\n * @method setGravity\n * @param {cocos2d::gui::ListViewGravity}\n */\nsetGravity : function () {},\n\n/**\n * @method pushBackCustomItem\n * @param {cocos2d::gui::Widget*}\n */\npushBackCustomItem : function () {},\n\n/**\n * @method getItems\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::gui::Widget *>&\"\n */\ngetItems : function () {},\n\n/**\n * @method removeItem\n * @param {ssize_t}\n */\nremoveItem : function () {},\n\n/**\n * @method getCurSelectedIndex\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetCurSelectedIndex : function () {},\n\n/**\n * @method insertDefaultItem\n * @param {ssize_t}\n */\ninsertDefaultItem : function () {},\n\n/**\n * @method setItemsMargin\n * @param {float}\n */\nsetItemsMargin : function () {},\n\n/**\n * @method removeLastItem\n */\nremoveLastItem : function () {},\n\n/**\n * @method getItem\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {ssize_t}\n */\ngetItem : function () {},\n\n/**\n * @method setItemModel\n * @param {cocos2d::gui::Widget*}\n */\nsetItemModel : function () {},\n\n/**\n * @method requestRefreshView\n */\nrequestRefreshView : function () {},\n\n/**\n * @method pushBackDefaultItem\n */\npushBackDefaultItem : function () {},\n\n/**\n * @method insertCustomItem\n * @param {cocos2d::gui::Widget*}\n * @param {ssize_t}\n */\ninsertCustomItem : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::ListView*\"\n */\ncreate : function () {},\n\n/**\n * @method ListView\n * @constructor\n */\nListView : function () {},\n\n};\n\n/**\n * @class Slider\n */\nccui.Slider = {\n\n/**\n * @method setPercent\n * @param {int}\n */\nsetPercent : function () {},\n\n/**\n * @method loadSlidBallTextureNormal\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTextureNormal : function () {},\n\n/**\n * @method loadBarTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadBarTexture : function () {},\n\n/**\n * @method loadProgressBarTexture\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadProgressBarTexture : function () {},\n\n/**\n * @method loadSlidBallTextures\n * @param {const char*}\n * @param {const char*}\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTextures : function () {},\n\n/**\n * @method setCapInsetProgressBarRebderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetProgressBarRebderer : function () {},\n\n/**\n * @method setCapInsetsBarRenderer\n * @param {const cocos2d::Rect&}\n */\nsetCapInsetsBarRenderer : function () {},\n\n/**\n * @method setScale9Enabled\n * @param {bool}\n */\nsetScale9Enabled : function () {},\n\n/**\n * @method setCapInsets\n * @param {const cocos2d::Rect&}\n */\nsetCapInsets : function () {},\n\n/**\n * @method loadSlidBallTexturePressed\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTexturePressed : function () {},\n\n/**\n * @method loadSlidBallTextureDisabled\n * @param {const char*}\n * @param {cocos2d::gui::TextureResType}\n */\nloadSlidBallTextureDisabled : function () {},\n\n/**\n * @method getPercent\n * @return A value converted from C/C++ \"int\"\n */\ngetPercent : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::Slider*\"\n */\ncreate : function () {},\n\n/**\n * @method Slider\n * @constructor\n */\nSlider : function () {},\n\n};\n\n/**\n * @class TextField\n */\nccui.TextField = {\n\n/**\n * @method setAttachWithIME\n * @param {bool}\n */\nsetAttachWithIME : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setPasswordStyleText\n * @param {const char*}\n */\nsetPasswordStyleText : function () {},\n\n/**\n * @method getAttachWithIME\n * @return A value converted from C/C++ \"bool\"\n */\ngetAttachWithIME : function () {},\n\n/**\n * @method setFontName\n * @param {const std::string&}\n */\nsetFontName : function () {},\n\n/**\n * @method getInsertText\n * @return A value converted from C/C++ \"bool\"\n */\ngetInsertText : function () {},\n\n/**\n * @method setInsertText\n * @param {bool}\n */\nsetInsertText : function () {},\n\n/**\n * @method getDetachWithIME\n * @return A value converted from C/C++ \"bool\"\n */\ngetDetachWithIME : function () {},\n\n/**\n * @method didNotSelectSelf\n */\ndidNotSelectSelf : function () {},\n\n/**\n * @method attachWithIME\n */\nattachWithIME : function () {},\n\n/**\n * @method setPasswordEnabled\n * @param {bool}\n */\nsetPasswordEnabled : function () {},\n\n/**\n * @method setMaxLengthEnabled\n * @param {bool}\n */\nsetMaxLengthEnabled : function () {},\n\n/**\n * @method getDeleteBackward\n * @return A value converted from C/C++ \"bool\"\n */\ngetDeleteBackward : function () {},\n\n/**\n * @method setFontSize\n * @param {int}\n */\nsetFontSize : function () {},\n\n/**\n * @method setPlaceHolder\n * @param {const std::string&}\n */\nsetPlaceHolder : function () {},\n\n/**\n * @method isPasswordEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisPasswordEnabled : function () {},\n\n/**\n * @method getMaxLength\n * @return A value converted from C/C++ \"int\"\n */\ngetMaxLength : function () {},\n\n/**\n * @method isMaxLengthEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisMaxLengthEnabled : function () {},\n\n/**\n * @method setDetachWithIME\n * @param {bool}\n */\nsetDetachWithIME : function () {},\n\n/**\n * @method setText\n * @param {const std::string&}\n */\nsetText : function () {},\n\n/**\n * @method setMaxLength\n * @param {int}\n */\nsetMaxLength : function () {},\n\n/**\n * @method setTouchSize\n * @param {const cocos2d::Size&}\n */\nsetTouchSize : function () {},\n\n/**\n * @method setDeleteBackward\n * @param {bool}\n */\nsetDeleteBackward : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::TextField*\"\n */\ncreate : function () {},\n\n/**\n * @method TextField\n * @constructor\n */\nTextField : function () {},\n\n};\n\n/**\n * @class TextBMFont\n */\nccui.TextBMFont = {\n\n/**\n * @method setFntFile\n * @param {const char*}\n */\nsetFntFile : function () {},\n\n/**\n * @method getStringValue\n * @return A value converted from C/C++ \"const char*\"\n */\ngetStringValue : function () {},\n\n/**\n * @method setText\n * @param {const char*}\n */\nsetText : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::TextBMFont*\"\n */\ncreate : function () {},\n\n/**\n * @method TextBMFont\n * @constructor\n */\nTextBMFont : function () {},\n\n};\n\n/**\n * @class PageView\n */\nccui.PageView = {\n\n/**\n * @method getCurPageIndex\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetCurPageIndex : function () {},\n\n/**\n * @method addWidgetToPage\n * @param {cocos2d::gui::Widget*}\n * @param {ssize_t}\n * @param {bool}\n */\naddWidgetToPage : function () {},\n\n/**\n * @method getPage\n * @return A value converted from C/C++ \"cocos2d::gui::Layout*\"\n * @param {ssize_t}\n */\ngetPage : function () {},\n\n/**\n * @method removePage\n * @param {cocos2d::gui::Layout*}\n */\nremovePage : function () {},\n\n/**\n * @method insertPage\n * @param {cocos2d::gui::Layout*}\n * @param {int}\n */\ninsertPage : function () {},\n\n/**\n * @method scrollToPage\n * @param {ssize_t}\n */\nscrollToPage : function () {},\n\n/**\n * @method removePageAtIndex\n * @param {ssize_t}\n */\nremovePageAtIndex : function () {},\n\n/**\n * @method getPages\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::gui::Layout *>&\"\n */\ngetPages : function () {},\n\n/**\n * @method removeAllPages\n */\nremoveAllPages : function () {},\n\n/**\n * @method addPage\n * @param {cocos2d::gui::Layout*}\n */\naddPage : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::gui::PageView*\"\n */\ncreate : function () {},\n\n/**\n * @method PageView\n * @constructor\n */\nPageView : function () {},\n\n};\n\n/**\n * @class Helper\n */\nccui.Helper = {\n\n/**\n * @method seekActionWidgetByActionTag\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {int}\n */\nseekActionWidgetByActionTag : function () {},\n\n/**\n * @method seekWidgetByTag\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {int}\n */\nseekWidgetByTag : function () {},\n\n/**\n * @method seekWidgetByRelativeName\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {const char*}\n */\nseekWidgetByRelativeName : function () {},\n\n/**\n * @method seekWidgetByName\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {cocos2d::gui::Widget*}\n * @param {const char*}\n */\nseekWidgetByName : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_physics_auto.cpp",
    "content": "#include \"lua_cocos2dx_physics_auto.hpp\"\n#include \"cocos2d.h\"\n#include \"tolua_fix.h\"\n#include \"LuaBasicConversions.h\"\n\n\n\nint lua_cocos2dx_physics_PhysicsShape_getFriction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getFriction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getFriction();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFriction\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getFriction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setGroup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setGroup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setGroup(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGroup\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setGroup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setDensity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setDensity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDensity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDensity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setDensity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getMass(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getMass'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMass();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMass\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getMass'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getMaterial(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getMaterial'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::PhysicsMaterial& ret = cobj->getMaterial();\n        physics_material_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaterial\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getMaterial'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getCollisionBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getCollisionBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getCollisionBitmask();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCollisionBitmask\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getCollisionBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getArea(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getArea'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getArea();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getArea\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getArea'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setCategoryBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setCategoryBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCategoryBitmask(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCategoryBitmask\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setCategoryBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getGroup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getGroup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getGroup();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGroup\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getGroup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setMoment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMoment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMoment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setMoment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_containsPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_containsPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->containsPoint(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"containsPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_containsPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getCategoryBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getCategoryBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getCategoryBitmask();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCategoryBitmask\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getCategoryBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getContactTestBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getContactTestBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getContactTestBitmask();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContactTestBitmask\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getContactTestBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getCenter(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getCenter'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getCenter();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCenter\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getCenter'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getDensity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getDensity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDensity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDensity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getDensity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setMass(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setMass'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMass(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMass\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setMass'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getTag();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTag\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_calculateDefaultMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_calculateDefaultMoment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->calculateDefaultMoment();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"calculateDefaultMoment\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_calculateDefaultMoment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setCollisionBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setCollisionBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCollisionBitmask(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCollisionBitmask\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setCollisionBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getMoment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMoment();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMoment\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getMoment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getOffset(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getOffset'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getOffset();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getOffset\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getOffset'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getRestitution(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getRestitution'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRestitution();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRestitution\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getRestitution'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setFriction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setFriction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFriction(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFriction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setFriction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setMaterial(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setMaterial'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::PhysicsMaterial arg0;\n\n        ok &= luaval_to_physics_material(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaterial(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaterial\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setMaterial'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setContactTestBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setContactTestBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setContactTestBitmask(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setContactTestBitmask\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setContactTestBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_setRestitution(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_setRestitution'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRestitution(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRestitution\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_setRestitution'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShape_getBody(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShape* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShape_getBody'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cobj->getBody();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBody\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getBody'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShape_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShape)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShape(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShape\");\n    tolua_cclass(tolua_S,\"PhysicsShape\",\"cc.PhysicsShape\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShape\");\n        tolua_function(tolua_S,\"getFriction\",lua_cocos2dx_physics_PhysicsShape_getFriction);\n        tolua_function(tolua_S,\"setGroup\",lua_cocos2dx_physics_PhysicsShape_setGroup);\n        tolua_function(tolua_S,\"setDensity\",lua_cocos2dx_physics_PhysicsShape_setDensity);\n        tolua_function(tolua_S,\"getMass\",lua_cocos2dx_physics_PhysicsShape_getMass);\n        tolua_function(tolua_S,\"getMaterial\",lua_cocos2dx_physics_PhysicsShape_getMaterial);\n        tolua_function(tolua_S,\"getCollisionBitmask\",lua_cocos2dx_physics_PhysicsShape_getCollisionBitmask);\n        tolua_function(tolua_S,\"getArea\",lua_cocos2dx_physics_PhysicsShape_getArea);\n        tolua_function(tolua_S,\"setCategoryBitmask\",lua_cocos2dx_physics_PhysicsShape_setCategoryBitmask);\n        tolua_function(tolua_S,\"getGroup\",lua_cocos2dx_physics_PhysicsShape_getGroup);\n        tolua_function(tolua_S,\"setMoment\",lua_cocos2dx_physics_PhysicsShape_setMoment);\n        tolua_function(tolua_S,\"containsPoint\",lua_cocos2dx_physics_PhysicsShape_containsPoint);\n        tolua_function(tolua_S,\"getCategoryBitmask\",lua_cocos2dx_physics_PhysicsShape_getCategoryBitmask);\n        tolua_function(tolua_S,\"getType\",lua_cocos2dx_physics_PhysicsShape_getType);\n        tolua_function(tolua_S,\"getContactTestBitmask\",lua_cocos2dx_physics_PhysicsShape_getContactTestBitmask);\n        tolua_function(tolua_S,\"getCenter\",lua_cocos2dx_physics_PhysicsShape_getCenter);\n        tolua_function(tolua_S,\"getDensity\",lua_cocos2dx_physics_PhysicsShape_getDensity);\n        tolua_function(tolua_S,\"setMass\",lua_cocos2dx_physics_PhysicsShape_setMass);\n        tolua_function(tolua_S,\"getTag\",lua_cocos2dx_physics_PhysicsShape_getTag);\n        tolua_function(tolua_S,\"calculateDefaultMoment\",lua_cocos2dx_physics_PhysicsShape_calculateDefaultMoment);\n        tolua_function(tolua_S,\"setCollisionBitmask\",lua_cocos2dx_physics_PhysicsShape_setCollisionBitmask);\n        tolua_function(tolua_S,\"getMoment\",lua_cocos2dx_physics_PhysicsShape_getMoment);\n        tolua_function(tolua_S,\"getOffset\",lua_cocos2dx_physics_PhysicsShape_getOffset);\n        tolua_function(tolua_S,\"getRestitution\",lua_cocos2dx_physics_PhysicsShape_getRestitution);\n        tolua_function(tolua_S,\"setFriction\",lua_cocos2dx_physics_PhysicsShape_setFriction);\n        tolua_function(tolua_S,\"setMaterial\",lua_cocos2dx_physics_PhysicsShape_setMaterial);\n        tolua_function(tolua_S,\"setTag\",lua_cocos2dx_physics_PhysicsShape_setTag);\n        tolua_function(tolua_S,\"setContactTestBitmask\",lua_cocos2dx_physics_PhysicsShape_setContactTestBitmask);\n        tolua_function(tolua_S,\"setRestitution\",lua_cocos2dx_physics_PhysicsShape_setRestitution);\n        tolua_function(tolua_S,\"getBody\",lua_cocos2dx_physics_PhysicsShape_getBody);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShape).name();\n    g_luaType[typeName] = \"cc.PhysicsShape\";\n    g_typeCast[\"PhysicsShape\"] = \"cc.PhysicsShape\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeCircle_getRadius(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeCircle* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeCircle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeCircle*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeCircle_getRadius'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRadius();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRadius\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeCircle_getRadius'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeCircle_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeCircle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeCircle* ret = cocos2d::PhysicsShapeCircle::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeCircle\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeCircle*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::PhysicsMaterial arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeCircle* ret = cocos2d::PhysicsShapeCircle::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeCircle\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeCircle*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        double arg0;\n        cocos2d::PhysicsMaterial arg1;\n        cocos2d::Point arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeCircle* ret = cocos2d::PhysicsShapeCircle::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeCircle\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeCircle*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeCircle_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeCircle_calculateArea(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeCircle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapeCircle::calculateArea(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"calculateArea\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeCircle_calculateArea'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeCircle_calculateMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeCircle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        double arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapeCircle::calculateMoment(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        double arg0;\n        double arg1;\n        cocos2d::Point arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapeCircle::calculateMoment(arg0, arg1, arg2);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"calculateMoment\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeCircle_calculateMoment'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShapeCircle_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShapeCircle)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShapeCircle(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShapeCircle\");\n    tolua_cclass(tolua_S,\"PhysicsShapeCircle\",\"cc.PhysicsShapeCircle\",\"cc.PhysicsShape\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShapeCircle\");\n        tolua_function(tolua_S,\"getRadius\",lua_cocos2dx_physics_PhysicsShapeCircle_getRadius);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsShapeCircle_create);\n        tolua_function(tolua_S,\"calculateArea\", lua_cocos2dx_physics_PhysicsShapeCircle_calculateArea);\n        tolua_function(tolua_S,\"calculateMoment\", lua_cocos2dx_physics_PhysicsShapeCircle_calculateMoment);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShapeCircle).name();\n    g_luaType[typeName] = \"cc.PhysicsShapeCircle\";\n    g_typeCast[\"PhysicsShapeCircle\"] = \"cc.PhysicsShapeCircle\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeBox_getPointsCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPointsCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPointsCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPointsCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPointsCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeBox_getSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeBox_getSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_getSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeBox_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Size arg0;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeBox* ret = cocos2d::PhysicsShapeBox::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeBox* ret = cocos2d::PhysicsShapeBox::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        cocos2d::Point arg2;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeBox* ret = cocos2d::PhysicsShapeBox::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeBox_calculateArea(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Size arg0;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapeBox::calculateArea(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"calculateArea\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_calculateArea'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeBox_calculateMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapeBox::calculateMoment(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        double arg0;\n        cocos2d::Size arg1;\n        cocos2d::Point arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_size(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapeBox::calculateMoment(arg0, arg1, arg2);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"calculateMoment\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_calculateMoment'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShapeBox_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShapeBox)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShapeBox(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShapeBox\");\n    tolua_cclass(tolua_S,\"PhysicsShapeBox\",\"cc.PhysicsShapeBox\",\"cc.PhysicsShape\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShapeBox\");\n        tolua_function(tolua_S,\"getPointsCount\",lua_cocos2dx_physics_PhysicsShapeBox_getPointsCount);\n        tolua_function(tolua_S,\"getSize\",lua_cocos2dx_physics_PhysicsShapeBox_getSize);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsShapeBox_create);\n        tolua_function(tolua_S,\"calculateArea\", lua_cocos2dx_physics_PhysicsShapeBox_calculateArea);\n        tolua_function(tolua_S,\"calculateMoment\", lua_cocos2dx_physics_PhysicsShapeBox_calculateMoment);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShapeBox).name();\n    g_luaType[typeName] = \"cc.PhysicsShapeBox\";\n    g_typeCast[\"PhysicsShapeBox\"] = \"cc.PhysicsShapeBox\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsShapePolygon_getPointsCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapePolygon* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapePolygon*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPointsCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPointsCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPointsCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPointsCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapePolygon_getPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapePolygon* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapePolygon*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPoint(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapePolygon_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapePolygon\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapePolygon*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapePolygon\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapePolygon*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        cocos2d::Point arg3;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapePolygon* ret = cocos2d::PhysicsShapePolygon::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapePolygon\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapePolygon*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapePolygon::calculateArea(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"calculateArea\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        double arg0;\n        const cocos2d::Point* arg1;\n        int arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (const cocos2d::Point*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        double arg0;\n        const cocos2d::Point* arg1;\n        int arg2;\n        cocos2d::Point arg3;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (const cocos2d::Point*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        double ret = cocos2d::PhysicsShapePolygon::calculateMoment(arg0, arg1, arg2, arg3);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"calculateMoment\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShapePolygon_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShapePolygon)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShapePolygon(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShapePolygon\");\n    tolua_cclass(tolua_S,\"PhysicsShapePolygon\",\"cc.PhysicsShapePolygon\",\"cc.PhysicsShape\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShapePolygon\");\n        tolua_function(tolua_S,\"getPointsCount\",lua_cocos2dx_physics_PhysicsShapePolygon_getPointsCount);\n        tolua_function(tolua_S,\"getPoint\",lua_cocos2dx_physics_PhysicsShapePolygon_getPoint);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsShapePolygon_create);\n        tolua_function(tolua_S,\"calculateArea\", lua_cocos2dx_physics_PhysicsShapePolygon_calculateArea);\n        tolua_function(tolua_S,\"calculateMoment\", lua_cocos2dx_physics_PhysicsShapePolygon_calculateMoment);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShapePolygon).name();\n    g_luaType[typeName] = \"cc.PhysicsShapePolygon\";\n    g_typeCast[\"PhysicsShapePolygon\"] = \"cc.PhysicsShapePolygon\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgeSegment* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgeSegment\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeEdgeSegment*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPointB();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPointB\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointA(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgeSegment* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgeSegment\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeEdgeSegment*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointA'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPointA();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPointA\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointA'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeEdgeSegment\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeSegment* ret = cocos2d::PhysicsShapeEdgeSegment::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeSegment\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeSegment*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::PhysicsMaterial arg2;\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeSegment* ret = cocos2d::PhysicsShapeEdgeSegment::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeSegment\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeSegment*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::PhysicsMaterial arg2;\n        double arg3;\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeSegment* ret = cocos2d::PhysicsShapeEdgeSegment::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeSegment\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeSegment*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShapeEdgeSegment_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShapeEdgeSegment)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShapeEdgeSegment(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShapeEdgeSegment\");\n    tolua_cclass(tolua_S,\"PhysicsShapeEdgeSegment\",\"cc.PhysicsShapeEdgeSegment\",\"cc.PhysicsShape\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShapeEdgeSegment\");\n        tolua_function(tolua_S,\"getPointB\",lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointB);\n        tolua_function(tolua_S,\"getPointA\",lua_cocos2dx_physics_PhysicsShapeEdgeSegment_getPointA);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsShapeEdgeSegment_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShapeEdgeSegment).name();\n    g_luaType[typeName] = \"cc.PhysicsShapeEdgeSegment\";\n    g_typeCast[\"PhysicsShapeEdgeSegment\"] = \"cc.PhysicsShapeEdgeSegment\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPointsCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgeBox* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeEdgeBox*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPointsCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPointsCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPointsCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPointsCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeEdgeBox_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeEdgeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Size arg0;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeBox* ret = cocos2d::PhysicsShapeEdgeBox::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeBox* ret = cocos2d::PhysicsShapeEdgeBox::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        double arg2;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeBox* ret = cocos2d::PhysicsShapeEdgeBox::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        double arg2;\n        cocos2d::Point arg3;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeBox* ret = cocos2d::PhysicsShapeEdgeBox::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeBox\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeBox*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShapeEdgeBox_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShapeEdgeBox)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShapeEdgeBox(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShapeEdgeBox\");\n    tolua_cclass(tolua_S,\"PhysicsShapeEdgeBox\",\"cc.PhysicsShapeEdgeBox\",\"cc.PhysicsShape\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShapeEdgeBox\");\n        tolua_function(tolua_S,\"getPointsCount\",lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPointsCount);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsShapeEdgeBox_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShapeEdgeBox).name();\n    g_luaType[typeName] = \"cc.PhysicsShapeEdgeBox\";\n    g_typeCast[\"PhysicsShapeEdgeBox\"] = \"cc.PhysicsShapeEdgeBox\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPointsCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgePolygon* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeEdgePolygon*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPointsCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPointsCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPointsCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPointsCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeEdgePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgePolygon\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgePolygon*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgePolygon\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgePolygon*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        double arg3;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgePolygon* ret = cocos2d::PhysicsShapeEdgePolygon::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgePolygon\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgePolygon*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShapeEdgePolygon_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShapeEdgePolygon)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShapeEdgePolygon(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShapeEdgePolygon\");\n    tolua_cclass(tolua_S,\"PhysicsShapeEdgePolygon\",\"cc.PhysicsShapeEdgePolygon\",\"cc.PhysicsShape\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShapeEdgePolygon\");\n        tolua_function(tolua_S,\"getPointsCount\",lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPointsCount);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsShapeEdgePolygon_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShapeEdgePolygon).name();\n    g_luaType[typeName] = \"cc.PhysicsShapeEdgePolygon\";\n    g_typeCast[\"PhysicsShapeEdgePolygon\"] = \"cc.PhysicsShapeEdgePolygon\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPointsCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgeChain* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgeChain\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsShapeEdgeChain*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPointsCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getPointsCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPointsCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPointsCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsShapeEdgeChain_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShapeEdgeChain\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeChain\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeChain*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeChain\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeChain*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        const cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        double arg3;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Point\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocos2d::Point*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShapeEdgeChain* ret = cocos2d::PhysicsShapeEdgeChain::create(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShapeEdgeChain\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShapeEdgeChain*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsShapeEdgeChain_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsShapeEdgeChain)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsShapeEdgeChain(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsShapeEdgeChain\");\n    tolua_cclass(tolua_S,\"PhysicsShapeEdgeChain\",\"cc.PhysicsShapeEdgeChain\",\"cc.PhysicsShape\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsShapeEdgeChain\");\n        tolua_function(tolua_S,\"getPointsCount\",lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPointsCount);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsShapeEdgeChain_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsShapeEdgeChain).name();\n    g_luaType[typeName] = \"cc.PhysicsShapeEdgeChain\";\n    g_typeCast[\"PhysicsShapeEdgeChain\"] = \"cc.PhysicsShapeEdgeChain\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsBody_isGravityEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_isGravityEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isGravityEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isGravityEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_isGravityEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_resetForces(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_resetForces'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resetForces();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resetForces\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_resetForces'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getVelocityLimit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getVelocityLimit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getVelocityLimit();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVelocityLimit\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getVelocityLimit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setGroup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setGroup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setGroup(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGroup\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setGroup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getMass(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getMass'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMass();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMass\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getMass'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getCollisionBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getCollisionBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getCollisionBitmask();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCollisionBitmask\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getCollisionBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getRotation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getRotation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRotation();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRotation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getRotation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_isResting(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_isResting'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isResting();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isResting\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_isResting'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_applyImpulse(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_applyImpulse'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Point arg0;\n            ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cocos2d::Point arg1;\n            ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cobj->applyImpulse(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Point arg0;\n            ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cobj->applyImpulse(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"applyImpulse\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_applyImpulse'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_applyForce(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_applyForce'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Point arg0;\n            ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cocos2d::Point arg1;\n            ok &= luaval_to_point(tolua_S, 3, &arg1);\n\n            if (!ok) { break; }\n            cobj->applyForce(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Point arg0;\n            ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            cobj->applyForce(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"applyForce\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_applyForce'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_addShape(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_addShape'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::PhysicsShape* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShape* ret = cobj->addShape(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShape\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShape*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        cocos2d::PhysicsShape* arg0;\n        bool arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShape* ret = cobj->addShape(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShape\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShape*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addShape\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_addShape'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_applyTorque(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_applyTorque'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->applyTorque(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"applyTorque\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_applyTorque'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getAngularVelocityLimit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getAngularVelocityLimit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAngularVelocityLimit();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAngularVelocityLimit\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getAngularVelocityLimit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setAngularVelocityLimit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setAngularVelocityLimit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAngularVelocityLimit(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAngularVelocityLimit\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setAngularVelocityLimit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getVelocity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getVelocity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getVelocity();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVelocity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getVelocity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getLinearDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getLinearDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getLinearDamping();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLinearDamping\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getLinearDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_removeAllShapes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_removeAllShapes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllShapes();\n        return 0;\n    }\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAllShapes(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllShapes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_removeAllShapes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setAngularDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setAngularDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAngularDamping(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAngularDamping\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setAngularDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setVelocityLimit(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setVelocityLimit'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setVelocityLimit(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVelocityLimit\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setVelocityLimit'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setEnable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setEnable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnable(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnable\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setEnable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setCategoryBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setCategoryBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCategoryBitmask(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCategoryBitmask\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setCategoryBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getWorld(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getWorld'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsWorld* ret = cobj->getWorld();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsWorld\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsWorld*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWorld\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getWorld'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getAngularVelocity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getAngularVelocity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAngularVelocity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAngularVelocity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getAngularVelocity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getPosition(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getPosition'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getPosition();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPosition\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getPosition'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setGravityEnable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setGravityEnable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setGravityEnable(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGravityEnable\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setGravityEnable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getGroup(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getGroup'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getGroup();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGroup\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getGroup'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setMoment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMoment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMoment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setMoment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getTag();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTag\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_local2World(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_local2World'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->local2World(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"local2World\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_local2World'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getCategoryBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getCategoryBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getCategoryBitmask();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCategoryBitmask\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getCategoryBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getMoment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        double ret = cobj->getMoment(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMoment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getMoment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getFirstShape(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getFirstShape'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShape* ret = cobj->getFirstShape();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShape\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShape*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFirstShape\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getFirstShape'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getShapes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getShapes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Vector<cocos2d::PhysicsShape *>& ret = cobj->getShapes();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShapes\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getShapes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getContactTestBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getContactTestBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getContactTestBitmask();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContactTestBitmask\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getContactTestBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setAngularVelocity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setAngularVelocity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAngularVelocity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAngularVelocity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setAngularVelocity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_world2Local(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_world2Local'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->world2Local(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"world2Local\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_world2Local'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_removeShape(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_removeShape'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            cobj->removeShape(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->removeShape(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::PhysicsShape* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->removeShape(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            cocos2d::PhysicsShape* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->removeShape(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeShape\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_removeShape'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setMass(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setMass'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMass(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMass\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setMass'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_addMoment(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_addMoment'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addMoment(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addMoment\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_addMoment'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setVelocity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setVelocity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setVelocity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVelocity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setVelocity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setLinearDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setLinearDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLinearDamping(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLinearDamping\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setLinearDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setCollisionBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setCollisionBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCollisionBitmask(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCollisionBitmask\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setCollisionBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setDynamic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setDynamic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDynamic(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDynamic\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setDynamic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setRotationEnable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setRotationEnable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRotationEnable(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRotationEnable\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setRotationEnable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getAngularDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getAngularDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAngularDamping();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAngularDamping\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getAngularDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getVelocityAtLocalPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getVelocityAtLocalPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getVelocityAtLocalPoint(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVelocityAtLocalPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getVelocityAtLocalPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_isRotationEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_isRotationEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isRotationEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isRotationEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_isRotationEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_addMass(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_addMass'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->addMass(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addMass\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_addMass'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getShape(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getShape'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShape* ret = cobj->getShape(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShape\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShape*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShape\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getShape'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getVelocityAtWorldPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getVelocityAtWorldPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getVelocityAtWorldPoint(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVelocityAtWorldPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getVelocityAtWorldPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_setContactTestBitmask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_setContactTestBitmask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setContactTestBitmask(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setContactTestBitmask\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_setContactTestBitmask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_removeFromWorld(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_removeFromWorld'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeFromWorld();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeFromWorld\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_removeFromWorld'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_isDynamic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_isDynamic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isDynamic();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isDynamic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_isDynamic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_getNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_createBox(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Size arg0;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createBox(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createBox(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        cocos2d::Point arg2;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createBox(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createBox\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createBox'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_createEdgeSegment(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeSegment(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::PhysicsMaterial arg2;\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeSegment(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        cocos2d::Point arg0;\n        cocos2d::Point arg1;\n        cocos2d::PhysicsMaterial arg2;\n        double arg3;\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        ok &= luaval_to_physics_material(tolua_S, 4, &arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeSegment(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createEdgeSegment\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgeSegment'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n            if (!ok) { break; }\n            cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_createEdgeBox(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::Size arg0;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeBox(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeBox(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        double arg2;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeBox(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 4)\n    {\n        cocos2d::Size arg0;\n        cocos2d::PhysicsMaterial arg1;\n        double arg2;\n        cocos2d::Point arg3;\n        ok &= luaval_to_size(tolua_S, 2, &arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeBox(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createEdgeBox\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgeBox'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsBody_createCircle(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        double arg0;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createCircle(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        double arg0;\n        cocos2d::PhysicsMaterial arg1;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createCircle(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        double arg0;\n        cocos2d::PhysicsMaterial arg1;\n        cocos2d::Point arg2;\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createCircle(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createCircle\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createCircle'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsBody_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsBody)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsBody(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsBody\");\n    tolua_cclass(tolua_S,\"PhysicsBody\",\"cc.PhysicsBody\",\"cc.Object\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsBody\");\n        tolua_function(tolua_S,\"isGravityEnabled\",lua_cocos2dx_physics_PhysicsBody_isGravityEnabled);\n        tolua_function(tolua_S,\"resetForces\",lua_cocos2dx_physics_PhysicsBody_resetForces);\n        tolua_function(tolua_S,\"getVelocityLimit\",lua_cocos2dx_physics_PhysicsBody_getVelocityLimit);\n        tolua_function(tolua_S,\"setGroup\",lua_cocos2dx_physics_PhysicsBody_setGroup);\n        tolua_function(tolua_S,\"getMass\",lua_cocos2dx_physics_PhysicsBody_getMass);\n        tolua_function(tolua_S,\"getCollisionBitmask\",lua_cocos2dx_physics_PhysicsBody_getCollisionBitmask);\n        tolua_function(tolua_S,\"getRotation\",lua_cocos2dx_physics_PhysicsBody_getRotation);\n        tolua_function(tolua_S,\"isResting\",lua_cocos2dx_physics_PhysicsBody_isResting);\n        tolua_function(tolua_S,\"applyImpulse\",lua_cocos2dx_physics_PhysicsBody_applyImpulse);\n        tolua_function(tolua_S,\"applyForce\",lua_cocos2dx_physics_PhysicsBody_applyForce);\n        tolua_function(tolua_S,\"addShape\",lua_cocos2dx_physics_PhysicsBody_addShape);\n        tolua_function(tolua_S,\"applyTorque\",lua_cocos2dx_physics_PhysicsBody_applyTorque);\n        tolua_function(tolua_S,\"getAngularVelocityLimit\",lua_cocos2dx_physics_PhysicsBody_getAngularVelocityLimit);\n        tolua_function(tolua_S,\"setAngularVelocityLimit\",lua_cocos2dx_physics_PhysicsBody_setAngularVelocityLimit);\n        tolua_function(tolua_S,\"getVelocity\",lua_cocos2dx_physics_PhysicsBody_getVelocity);\n        tolua_function(tolua_S,\"getLinearDamping\",lua_cocos2dx_physics_PhysicsBody_getLinearDamping);\n        tolua_function(tolua_S,\"removeAllShapes\",lua_cocos2dx_physics_PhysicsBody_removeAllShapes);\n        tolua_function(tolua_S,\"setAngularDamping\",lua_cocos2dx_physics_PhysicsBody_setAngularDamping);\n        tolua_function(tolua_S,\"setVelocityLimit\",lua_cocos2dx_physics_PhysicsBody_setVelocityLimit);\n        tolua_function(tolua_S,\"setEnable\",lua_cocos2dx_physics_PhysicsBody_setEnable);\n        tolua_function(tolua_S,\"setCategoryBitmask\",lua_cocos2dx_physics_PhysicsBody_setCategoryBitmask);\n        tolua_function(tolua_S,\"getWorld\",lua_cocos2dx_physics_PhysicsBody_getWorld);\n        tolua_function(tolua_S,\"getAngularVelocity\",lua_cocos2dx_physics_PhysicsBody_getAngularVelocity);\n        tolua_function(tolua_S,\"getPosition\",lua_cocos2dx_physics_PhysicsBody_getPosition);\n        tolua_function(tolua_S,\"setGravityEnable\",lua_cocos2dx_physics_PhysicsBody_setGravityEnable);\n        tolua_function(tolua_S,\"getGroup\",lua_cocos2dx_physics_PhysicsBody_getGroup);\n        tolua_function(tolua_S,\"setMoment\",lua_cocos2dx_physics_PhysicsBody_setMoment);\n        tolua_function(tolua_S,\"getTag\",lua_cocos2dx_physics_PhysicsBody_getTag);\n        tolua_function(tolua_S,\"local2World\",lua_cocos2dx_physics_PhysicsBody_local2World);\n        tolua_function(tolua_S,\"getCategoryBitmask\",lua_cocos2dx_physics_PhysicsBody_getCategoryBitmask);\n        tolua_function(tolua_S,\"getMoment\",lua_cocos2dx_physics_PhysicsBody_getMoment);\n        tolua_function(tolua_S,\"getFirstShape\",lua_cocos2dx_physics_PhysicsBody_getFirstShape);\n        tolua_function(tolua_S,\"getShapes\",lua_cocos2dx_physics_PhysicsBody_getShapes);\n        tolua_function(tolua_S,\"getContactTestBitmask\",lua_cocos2dx_physics_PhysicsBody_getContactTestBitmask);\n        tolua_function(tolua_S,\"setAngularVelocity\",lua_cocos2dx_physics_PhysicsBody_setAngularVelocity);\n        tolua_function(tolua_S,\"world2Local\",lua_cocos2dx_physics_PhysicsBody_world2Local);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_physics_PhysicsBody_isEnabled);\n        tolua_function(tolua_S,\"removeShape\",lua_cocos2dx_physics_PhysicsBody_removeShape);\n        tolua_function(tolua_S,\"setMass\",lua_cocos2dx_physics_PhysicsBody_setMass);\n        tolua_function(tolua_S,\"addMoment\",lua_cocos2dx_physics_PhysicsBody_addMoment);\n        tolua_function(tolua_S,\"setVelocity\",lua_cocos2dx_physics_PhysicsBody_setVelocity);\n        tolua_function(tolua_S,\"setLinearDamping\",lua_cocos2dx_physics_PhysicsBody_setLinearDamping);\n        tolua_function(tolua_S,\"setCollisionBitmask\",lua_cocos2dx_physics_PhysicsBody_setCollisionBitmask);\n        tolua_function(tolua_S,\"setDynamic\",lua_cocos2dx_physics_PhysicsBody_setDynamic);\n        tolua_function(tolua_S,\"setRotationEnable\",lua_cocos2dx_physics_PhysicsBody_setRotationEnable);\n        tolua_function(tolua_S,\"getAngularDamping\",lua_cocos2dx_physics_PhysicsBody_getAngularDamping);\n        tolua_function(tolua_S,\"getVelocityAtLocalPoint\",lua_cocos2dx_physics_PhysicsBody_getVelocityAtLocalPoint);\n        tolua_function(tolua_S,\"isRotationEnabled\",lua_cocos2dx_physics_PhysicsBody_isRotationEnabled);\n        tolua_function(tolua_S,\"addMass\",lua_cocos2dx_physics_PhysicsBody_addMass);\n        tolua_function(tolua_S,\"getShape\",lua_cocos2dx_physics_PhysicsBody_getShape);\n        tolua_function(tolua_S,\"setTag\",lua_cocos2dx_physics_PhysicsBody_setTag);\n        tolua_function(tolua_S,\"getVelocityAtWorldPoint\",lua_cocos2dx_physics_PhysicsBody_getVelocityAtWorldPoint);\n        tolua_function(tolua_S,\"setContactTestBitmask\",lua_cocos2dx_physics_PhysicsBody_setContactTestBitmask);\n        tolua_function(tolua_S,\"removeFromWorld\",lua_cocos2dx_physics_PhysicsBody_removeFromWorld);\n        tolua_function(tolua_S,\"isDynamic\",lua_cocos2dx_physics_PhysicsBody_isDynamic);\n        tolua_function(tolua_S,\"getNode\",lua_cocos2dx_physics_PhysicsBody_getNode);\n        tolua_function(tolua_S,\"createBox\", lua_cocos2dx_physics_PhysicsBody_createBox);\n        tolua_function(tolua_S,\"createEdgeSegment\", lua_cocos2dx_physics_PhysicsBody_createEdgeSegment);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_PhysicsBody_create);\n        tolua_function(tolua_S,\"createEdgeBox\", lua_cocos2dx_physics_PhysicsBody_createEdgeBox);\n        tolua_function(tolua_S,\"createCircle\", lua_cocos2dx_physics_PhysicsBody_createCircle);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsBody).name();\n    g_luaType[typeName] = \"cc.PhysicsBody\";\n    g_typeCast[\"PhysicsBody\"] = \"cc.PhysicsBody\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsWorld_getGravity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getGravity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getGravity();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGravity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getGravity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_getAllBodies(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getAllBodies'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Vector<cocos2d::PhysicsBody *>& ret = cobj->getAllBodies();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAllBodies\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getAllBodies'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_setGravity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setGravity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setGravity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGravity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setGravity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_getSpeed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getSpeed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSpeed();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpeed\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getSpeed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_removeBody(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeBody'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            int arg0;\n            ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n            if (!ok) { break; }\n            cobj->removeBody(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::PhysicsBody* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->removeBody(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeBody\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeBody'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_removeJoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeJoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::PhysicsJoint* arg0;\n        bool arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsJoint\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->removeJoint(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeJoint\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeJoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_getUpdateRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getUpdateRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getUpdateRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getUpdateRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getUpdateRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_setSpeed(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setSpeed'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSpeed(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpeed\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setSpeed'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_getShapes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getShapes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Vector<cocos2d::PhysicsShape *> ret = cobj->getShapes(arg0);\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShapes\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getShapes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_removeAllJoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllJoints'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAllJoints(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllJoints\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllJoints'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_getShape(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getShape'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShape* ret = cobj->getShape(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShape\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShape*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShape\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getShape'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_removeAllBodies(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllBodies'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeAllBodies();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAllBodies\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_removeAllBodies'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getDebugDrawMask();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDebugDrawMask\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDebugDrawMask(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDebugDrawMask\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_getBody(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getBody'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cobj->getBody(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBody\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getBody'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_setUpdateRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_setUpdateRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setUpdateRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUpdateRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_setUpdateRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_addJoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_addJoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::PhysicsJoint* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsJoint\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addJoint(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addJoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_addJoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsWorld_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsWorld)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsWorld(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsWorld\");\n    tolua_cclass(tolua_S,\"PhysicsWorld\",\"cc.PhysicsWorld\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsWorld\");\n        tolua_function(tolua_S,\"getGravity\",lua_cocos2dx_physics_PhysicsWorld_getGravity);\n        tolua_function(tolua_S,\"getAllBodies\",lua_cocos2dx_physics_PhysicsWorld_getAllBodies);\n        tolua_function(tolua_S,\"setGravity\",lua_cocos2dx_physics_PhysicsWorld_setGravity);\n        tolua_function(tolua_S,\"getSpeed\",lua_cocos2dx_physics_PhysicsWorld_getSpeed);\n        tolua_function(tolua_S,\"removeBody\",lua_cocos2dx_physics_PhysicsWorld_removeBody);\n        tolua_function(tolua_S,\"removeJoint\",lua_cocos2dx_physics_PhysicsWorld_removeJoint);\n        tolua_function(tolua_S,\"getUpdateRate\",lua_cocos2dx_physics_PhysicsWorld_getUpdateRate);\n        tolua_function(tolua_S,\"setSpeed\",lua_cocos2dx_physics_PhysicsWorld_setSpeed);\n        tolua_function(tolua_S,\"getShapes\",lua_cocos2dx_physics_PhysicsWorld_getShapes);\n        tolua_function(tolua_S,\"removeAllJoints\",lua_cocos2dx_physics_PhysicsWorld_removeAllJoints);\n        tolua_function(tolua_S,\"getShape\",lua_cocos2dx_physics_PhysicsWorld_getShape);\n        tolua_function(tolua_S,\"removeAllBodies\",lua_cocos2dx_physics_PhysicsWorld_removeAllBodies);\n        tolua_function(tolua_S,\"getDebugDrawMask\",lua_cocos2dx_physics_PhysicsWorld_getDebugDrawMask);\n        tolua_function(tolua_S,\"setDebugDrawMask\",lua_cocos2dx_physics_PhysicsWorld_setDebugDrawMask);\n        tolua_function(tolua_S,\"getBody\",lua_cocos2dx_physics_PhysicsWorld_getBody);\n        tolua_function(tolua_S,\"setUpdateRate\",lua_cocos2dx_physics_PhysicsWorld_setUpdateRate);\n        tolua_function(tolua_S,\"addJoint\",lua_cocos2dx_physics_PhysicsWorld_addJoint);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsWorld).name();\n    g_luaType[typeName] = \"cc.PhysicsWorld\";\n    g_typeCast[\"PhysicsWorld\"] = \"cc.PhysicsWorld\";\n    return 1;\n}\n\nstatic int lua_cocos2dx_physics_PhysicsDebugDraw_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsDebugDraw)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsDebugDraw(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsDebugDraw\");\n    tolua_cclass(tolua_S,\"PhysicsDebugDraw\",\"cc.PhysicsDebugDraw\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsDebugDraw\");\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsDebugDraw).name();\n    g_luaType[typeName] = \"cc.PhysicsDebugDraw\";\n    g_typeCast[\"PhysicsDebugDraw\"] = \"cc.PhysicsDebugDraw\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsContact_getContactData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContact* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContact\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContact*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContact_getContactData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::PhysicsContactData* ret = cobj->getContactData();\n        physics_contactdata_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContactData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContact_getContactData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContact_getEventCode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContact* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContact\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContact*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContact_getEventCode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getEventCode();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEventCode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContact_getEventCode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContact_getShapeA(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContact* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContact\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContact*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContact_getShapeA'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShape* ret = cobj->getShapeA();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShape\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShape*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShapeA\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContact_getShapeA'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContact_getShapeB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContact* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContact\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContact*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContact_getShapeB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsShape* ret = cobj->getShapeB();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsShape\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsShape*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getShapeB\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContact_getShapeB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsContact_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsContact)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsContact(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsContact\");\n    tolua_cclass(tolua_S,\"PhysicsContact\",\"cc.PhysicsContact\",\"cc.Event\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsContact\");\n        tolua_function(tolua_S,\"getContactData\",lua_cocos2dx_physics_PhysicsContact_getContactData);\n        tolua_function(tolua_S,\"getEventCode\",lua_cocos2dx_physics_PhysicsContact_getEventCode);\n        tolua_function(tolua_S,\"getShapeA\",lua_cocos2dx_physics_PhysicsContact_getShapeA);\n        tolua_function(tolua_S,\"getShapeB\",lua_cocos2dx_physics_PhysicsContact_getShapeB);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsContact).name();\n    g_luaType[typeName] = \"cc.PhysicsContact\";\n    g_typeCast[\"PhysicsContact\"] = \"cc.PhysicsContact\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsContactPreSolve_getFriction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPreSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPreSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPreSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_getFriction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getFriction();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFriction\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_getFriction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPreSolve_getElasticity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPreSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPreSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPreSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_getElasticity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getElasticity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getElasticity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_getElasticity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPreSolve_setElasticity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPreSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPreSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPreSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_setElasticity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setElasticity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setElasticity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_setElasticity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPreSolve_setFriction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPreSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPreSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPreSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_setFriction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setFriction(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFriction\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_setFriction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPreSolve_ignore(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPreSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPreSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPreSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_ignore'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->ignore();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ignore\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_ignore'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPreSolve_getSurfaceVelocity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPreSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPreSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPreSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_getSurfaceVelocity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getSurfaceVelocity();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSurfaceVelocity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_getSurfaceVelocity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPreSolve_setSurfaceVelocity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPreSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPreSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPreSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_setSurfaceVelocity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setSurfaceVelocity(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSurfaceVelocity\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPreSolve_setSurfaceVelocity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsContactPreSolve_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsContactPreSolve)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsContactPreSolve(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsContactPreSolve\");\n    tolua_cclass(tolua_S,\"PhysicsContactPreSolve\",\"cc.PhysicsContactPreSolve\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsContactPreSolve\");\n        tolua_function(tolua_S,\"getFriction\",lua_cocos2dx_physics_PhysicsContactPreSolve_getFriction);\n        tolua_function(tolua_S,\"getElasticity\",lua_cocos2dx_physics_PhysicsContactPreSolve_getElasticity);\n        tolua_function(tolua_S,\"setElasticity\",lua_cocos2dx_physics_PhysicsContactPreSolve_setElasticity);\n        tolua_function(tolua_S,\"setFriction\",lua_cocos2dx_physics_PhysicsContactPreSolve_setFriction);\n        tolua_function(tolua_S,\"ignore\",lua_cocos2dx_physics_PhysicsContactPreSolve_ignore);\n        tolua_function(tolua_S,\"getSurfaceVelocity\",lua_cocos2dx_physics_PhysicsContactPreSolve_getSurfaceVelocity);\n        tolua_function(tolua_S,\"setSurfaceVelocity\",lua_cocos2dx_physics_PhysicsContactPreSolve_setSurfaceVelocity);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsContactPreSolve).name();\n    g_luaType[typeName] = \"cc.PhysicsContactPreSolve\";\n    g_typeCast[\"PhysicsContactPreSolve\"] = \"cc.PhysicsContactPreSolve\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsContactPostSolve_getFriction(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPostSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPostSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPostSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPostSolve_getFriction'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getFriction();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFriction\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPostSolve_getFriction'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPostSolve_getSurfaceVelocity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPostSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPostSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPostSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPostSolve_getSurfaceVelocity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getSurfaceVelocity();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSurfaceVelocity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPostSolve_getSurfaceVelocity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsContactPostSolve_getElasticity(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsContactPostSolve* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsContactPostSolve\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsContactPostSolve*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsContactPostSolve_getElasticity'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getElasticity();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getElasticity\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsContactPostSolve_getElasticity'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsContactPostSolve_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsContactPostSolve)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsContactPostSolve(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsContactPostSolve\");\n    tolua_cclass(tolua_S,\"PhysicsContactPostSolve\",\"cc.PhysicsContactPostSolve\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsContactPostSolve\");\n        tolua_function(tolua_S,\"getFriction\",lua_cocos2dx_physics_PhysicsContactPostSolve_getFriction);\n        tolua_function(tolua_S,\"getSurfaceVelocity\",lua_cocos2dx_physics_PhysicsContactPostSolve_getSurfaceVelocity);\n        tolua_function(tolua_S,\"getElasticity\",lua_cocos2dx_physics_PhysicsContactPostSolve_getElasticity);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsContactPostSolve).name();\n    g_luaType[typeName] = \"cc.PhysicsContactPostSolve\";\n    g_typeCast[\"PhysicsContactPostSolve\"] = \"cc.PhysicsContactPostSolve\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_EventListenerPhysicsContact_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EventListenerPhysicsContact\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::EventListenerPhysicsContact* ret = cocos2d::EventListenerPhysicsContact::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EventListenerPhysicsContact\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EventListenerPhysicsContact*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_EventListenerPhysicsContact_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_EventListenerPhysicsContact_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerPhysicsContact)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_EventListenerPhysicsContact(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerPhysicsContact\");\n    tolua_cclass(tolua_S,\"EventListenerPhysicsContact\",\"cc.EventListenerPhysicsContact\",\"cc.EventListenerCustom\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerPhysicsContact\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_EventListenerPhysicsContact_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerPhysicsContact).name();\n    g_luaType[typeName] = \"cc.EventListenerPhysicsContact\";\n    g_typeCast[\"EventListenerPhysicsContact\"] = \"cc.EventListenerPhysicsContact\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_hitTest(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventListenerPhysicsContactWithBodies* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventListenerPhysicsContactWithBodies\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventListenerPhysicsContactWithBodies*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_hitTest'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::PhysicsShape* arg0;\n        cocos2d::PhysicsShape* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->hitTest(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hitTest\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_hitTest'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EventListenerPhysicsContactWithBodies\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EventListenerPhysicsContactWithBodies* ret = cocos2d::EventListenerPhysicsContactWithBodies::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EventListenerPhysicsContactWithBodies\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EventListenerPhysicsContactWithBodies*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerPhysicsContactWithBodies)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_EventListenerPhysicsContactWithBodies(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerPhysicsContactWithBodies\");\n    tolua_cclass(tolua_S,\"EventListenerPhysicsContactWithBodies\",\"cc.EventListenerPhysicsContactWithBodies\",\"cc.EventListenerPhysicsContact\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerPhysicsContactWithBodies\");\n        tolua_function(tolua_S,\"hitTest\",lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_hitTest);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_EventListenerPhysicsContactWithBodies_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerPhysicsContactWithBodies).name();\n    g_luaType[typeName] = \"cc.EventListenerPhysicsContactWithBodies\";\n    g_typeCast[\"EventListenerPhysicsContactWithBodies\"] = \"cc.EventListenerPhysicsContactWithBodies\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_hitTest(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventListenerPhysicsContactWithShapes* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventListenerPhysicsContactWithShapes\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventListenerPhysicsContactWithShapes*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_hitTest'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::PhysicsShape* arg0;\n        cocos2d::PhysicsShape* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->hitTest(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hitTest\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_hitTest'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EventListenerPhysicsContactWithShapes\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 2)\n    {\n        cocos2d::PhysicsShape* arg0;\n        cocos2d::PhysicsShape* arg1;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::EventListenerPhysicsContactWithShapes* ret = cocos2d::EventListenerPhysicsContactWithShapes::create(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EventListenerPhysicsContactWithShapes\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EventListenerPhysicsContactWithShapes*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerPhysicsContactWithShapes)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_EventListenerPhysicsContactWithShapes(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerPhysicsContactWithShapes\");\n    tolua_cclass(tolua_S,\"EventListenerPhysicsContactWithShapes\",\"cc.EventListenerPhysicsContactWithShapes\",\"cc.EventListenerPhysicsContact\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerPhysicsContactWithShapes\");\n        tolua_function(tolua_S,\"hitTest\",lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_hitTest);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_EventListenerPhysicsContactWithShapes_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerPhysicsContactWithShapes).name();\n    g_luaType[typeName] = \"cc.EventListenerPhysicsContactWithShapes\";\n    g_typeCast[\"EventListenerPhysicsContactWithShapes\"] = \"cc.EventListenerPhysicsContactWithShapes\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_hitTest(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::EventListenerPhysicsContactWithGroup* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.EventListenerPhysicsContactWithGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::EventListenerPhysicsContactWithGroup*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_hitTest'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocos2d::PhysicsShape* arg0;\n        cocos2d::PhysicsShape* arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsShape\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsShape*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->hitTest(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"hitTest\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_hitTest'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.EventListenerPhysicsContactWithGroup\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        int arg0;\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::EventListenerPhysicsContactWithGroup* ret = cocos2d::EventListenerPhysicsContactWithGroup::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.EventListenerPhysicsContactWithGroup\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::EventListenerPhysicsContactWithGroup*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (EventListenerPhysicsContactWithGroup)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_EventListenerPhysicsContactWithGroup(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.EventListenerPhysicsContactWithGroup\");\n    tolua_cclass(tolua_S,\"EventListenerPhysicsContactWithGroup\",\"cc.EventListenerPhysicsContactWithGroup\",\"cc.EventListenerPhysicsContact\",NULL);\n\n    tolua_beginmodule(tolua_S,\"EventListenerPhysicsContactWithGroup\");\n        tolua_function(tolua_S,\"hitTest\",lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_hitTest);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_physics_EventListenerPhysicsContactWithGroup_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::EventListenerPhysicsContactWithGroup).name();\n    g_luaType[typeName] = \"cc.EventListenerPhysicsContactWithGroup\";\n    g_typeCast[\"EventListenerPhysicsContactWithGroup\"] = \"cc.EventListenerPhysicsContactWithGroup\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJoint_getBodyA(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_getBodyA'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cobj->getBodyA();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBodyA\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_getBodyA'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_getBodyB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_getBodyB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsBody* ret = cobj->getBodyB();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBodyB\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_getBodyB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_getMaxForce(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_getMaxForce'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMaxForce();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMaxForce\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_getMaxForce'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_setMaxForce(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_setMaxForce'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMaxForce(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMaxForce\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_setMaxForce'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_isEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_isEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_isEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_setEnable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_setEnable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEnable(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEnable\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_setEnable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_setCollisionEnable(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_setCollisionEnable'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCollisionEnable(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCollisionEnable\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_setCollisionEnable'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_getWorld(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_getWorld'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsWorld* ret = cobj->getWorld();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsWorld\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsWorld*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWorld\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_getWorld'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_setTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_setTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTag(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_setTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_removeFormWorld(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_removeFormWorld'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->removeFormWorld();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeFormWorld\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_removeFormWorld'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_isCollisionEnabled(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_isCollisionEnabled'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isCollisionEnabled();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isCollisionEnabled\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_isCollisionEnabled'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_getTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJoint* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJoint_getTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getTag();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTag\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_getTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJoint_destroy(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJoint\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocos2d::PhysicsJoint* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsJoint\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsJoint*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJoint::destroy(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroy\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJoint_destroy'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJoint_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJoint)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJoint(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJoint\");\n    tolua_cclass(tolua_S,\"PhysicsJoint\",\"cc.PhysicsJoint\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJoint\");\n        tolua_function(tolua_S,\"getBodyA\",lua_cocos2dx_physics_PhysicsJoint_getBodyA);\n        tolua_function(tolua_S,\"getBodyB\",lua_cocos2dx_physics_PhysicsJoint_getBodyB);\n        tolua_function(tolua_S,\"getMaxForce\",lua_cocos2dx_physics_PhysicsJoint_getMaxForce);\n        tolua_function(tolua_S,\"setMaxForce\",lua_cocos2dx_physics_PhysicsJoint_setMaxForce);\n        tolua_function(tolua_S,\"isEnabled\",lua_cocos2dx_physics_PhysicsJoint_isEnabled);\n        tolua_function(tolua_S,\"setEnable\",lua_cocos2dx_physics_PhysicsJoint_setEnable);\n        tolua_function(tolua_S,\"setCollisionEnable\",lua_cocos2dx_physics_PhysicsJoint_setCollisionEnable);\n        tolua_function(tolua_S,\"getWorld\",lua_cocos2dx_physics_PhysicsJoint_getWorld);\n        tolua_function(tolua_S,\"setTag\",lua_cocos2dx_physics_PhysicsJoint_setTag);\n        tolua_function(tolua_S,\"removeFormWorld\",lua_cocos2dx_physics_PhysicsJoint_removeFormWorld);\n        tolua_function(tolua_S,\"isCollisionEnabled\",lua_cocos2dx_physics_PhysicsJoint_isCollisionEnabled);\n        tolua_function(tolua_S,\"getTag\",lua_cocos2dx_physics_PhysicsJoint_getTag);\n        tolua_function(tolua_S,\"destroy\", lua_cocos2dx_physics_PhysicsJoint_destroy);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJoint).name();\n    g_luaType[typeName] = \"cc.PhysicsJoint\";\n    g_typeCast[\"PhysicsJoint\"] = \"cc.PhysicsJoint\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointFixed_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointFixed\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        cocos2d::Point arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointFixed* ret = cocos2d::PhysicsJointFixed::construct(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointFixed\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointFixed*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointFixed_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointFixed_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointFixed)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointFixed(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointFixed\");\n    tolua_cclass(tolua_S,\"PhysicsJointFixed\",\"cc.PhysicsJointFixed\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointFixed\");\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointFixed_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointFixed).name();\n    g_luaType[typeName] = \"cc.PhysicsJointFixed\";\n    g_typeCast[\"PhysicsJointFixed\"] = \"cc.PhysicsJointFixed\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointLimit_setAnchr2(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_setAnchr2'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setAnchr2(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnchr2\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_setAnchr2'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_setAnchr1(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_setAnchr1'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setAnchr1(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnchr1\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_setAnchr1'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_setMax(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_setMax'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMax(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMax\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_setMax'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_getAnchr2(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_getAnchr2'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getAnchr2();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchr2\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_getAnchr2'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_getAnchr1(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_getAnchr1'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getAnchr1();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchr1\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_getAnchr1'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_getMin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_getMin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMin();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_getMin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_getMax(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_getMax'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMax();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMax\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_getMax'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_setMin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointLimit_setMin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMin(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMin\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_setMin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointLimit_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 6)\n        {\n            cocos2d::PhysicsBody* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::PhysicsBody* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Point arg2;\n            ok &= luaval_to_point(tolua_S, 4, &arg2);\n            if (!ok) { break; }\n            cocos2d::Point arg3;\n            ok &= luaval_to_point(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            double arg4;\n            ok &= luaval_to_number(tolua_S, 6,&arg4);\n            if (!ok) { break; }\n            double arg5;\n            ok &= luaval_to_number(tolua_S, 7,&arg5);\n            if (!ok) { break; }\n            cocos2d::PhysicsJointLimit* ret = cocos2d::PhysicsJointLimit::construct(arg0, arg1, arg2, arg3, arg4, arg5);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointLimit\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointLimit*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 4)\n        {\n            cocos2d::PhysicsBody* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::PhysicsBody* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::Point arg2;\n            ok &= luaval_to_point(tolua_S, 4, &arg2);\n            if (!ok) { break; }\n            cocos2d::Point arg3;\n            ok &= luaval_to_point(tolua_S, 5, &arg3);\n            if (!ok) { break; }\n            cocos2d::PhysicsJointLimit* ret = cocos2d::PhysicsJointLimit::construct(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointLimit\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointLimit*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"construct\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointLimit_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointLimit_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointLimit)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointLimit(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointLimit\");\n    tolua_cclass(tolua_S,\"PhysicsJointLimit\",\"cc.PhysicsJointLimit\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointLimit\");\n        tolua_function(tolua_S,\"setAnchr2\",lua_cocos2dx_physics_PhysicsJointLimit_setAnchr2);\n        tolua_function(tolua_S,\"setAnchr1\",lua_cocos2dx_physics_PhysicsJointLimit_setAnchr1);\n        tolua_function(tolua_S,\"setMax\",lua_cocos2dx_physics_PhysicsJointLimit_setMax);\n        tolua_function(tolua_S,\"getAnchr2\",lua_cocos2dx_physics_PhysicsJointLimit_getAnchr2);\n        tolua_function(tolua_S,\"getAnchr1\",lua_cocos2dx_physics_PhysicsJointLimit_getAnchr1);\n        tolua_function(tolua_S,\"getMin\",lua_cocos2dx_physics_PhysicsJointLimit_getMin);\n        tolua_function(tolua_S,\"getMax\",lua_cocos2dx_physics_PhysicsJointLimit_getMax);\n        tolua_function(tolua_S,\"setMin\",lua_cocos2dx_physics_PhysicsJointLimit_setMin);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointLimit_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointLimit).name();\n    g_luaType[typeName] = \"cc.PhysicsJointLimit\";\n    g_typeCast[\"PhysicsJointLimit\"] = \"cc.PhysicsJointLimit\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointPin_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointPin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        cocos2d::Point arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointPin* ret = cocos2d::PhysicsJointPin::construct(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointPin\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointPin*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointPin_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointPin_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointPin)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointPin(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointPin\");\n    tolua_cclass(tolua_S,\"PhysicsJointPin\",\"cc.PhysicsJointPin\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointPin\");\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointPin_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointPin).name();\n    g_luaType[typeName] = \"cc.PhysicsJointPin\";\n    g_typeCast[\"PhysicsJointPin\"] = \"cc.PhysicsJointPin\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointDistance_setDistance(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointDistance* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointDistance\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointDistance*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointDistance_setDistance'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDistance(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDistance\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointDistance_setDistance'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointDistance_getDistance(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointDistance* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointDistance\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointDistance*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointDistance_getDistance'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDistance();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDistance\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointDistance_getDistance'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointDistance_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointDistance\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        cocos2d::Point arg2;\n        cocos2d::Point arg3;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointDistance* ret = cocos2d::PhysicsJointDistance::construct(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointDistance\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointDistance*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointDistance_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointDistance_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointDistance)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointDistance(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointDistance\");\n    tolua_cclass(tolua_S,\"PhysicsJointDistance\",\"cc.PhysicsJointDistance\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointDistance\");\n        tolua_function(tolua_S,\"setDistance\",lua_cocos2dx_physics_PhysicsJointDistance_setDistance);\n        tolua_function(tolua_S,\"getDistance\",lua_cocos2dx_physics_PhysicsJointDistance_getDistance);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointDistance_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointDistance).name();\n    g_luaType[typeName] = \"cc.PhysicsJointDistance\";\n    g_typeCast[\"PhysicsJointDistance\"] = \"cc.PhysicsJointDistance\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointSpring_setAnchr2(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_setAnchr2'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setAnchr2(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnchr2\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_setAnchr2'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_setAnchr1(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_setAnchr1'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setAnchr1(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnchr1\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_setAnchr1'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_getDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_getDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDamping();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDamping\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_getDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_setStiffness(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_setStiffness'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStiffness(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStiffness\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_setStiffness'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_getRestLength(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_getRestLength'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRestLength();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRestLength\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_getRestLength'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_getAnchr2(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_getAnchr2'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getAnchr2();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchr2\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_getAnchr2'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_getAnchr1(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_getAnchr1'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getAnchr1();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchr1\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_getAnchr1'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_getStiffness(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_getStiffness'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStiffness();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStiffness\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_getStiffness'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_setRestLength(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_setRestLength'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRestLength(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRestLength\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_setRestLength'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_setDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointSpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointSpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointSpring_setDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDamping(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDamping\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_setDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointSpring_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointSpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 6)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        cocos2d::Point arg2;\n        cocos2d::Point arg3;\n        double arg4;\n        double arg5;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        ok &= luaval_to_number(tolua_S, 6,&arg4);\n        ok &= luaval_to_number(tolua_S, 7,&arg5);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointSpring* ret = cocos2d::PhysicsJointSpring::construct(arg0, arg1, arg2, arg3, arg4, arg5);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointSpring\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointSpring*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 6);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointSpring_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointSpring_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointSpring)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointSpring(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointSpring\");\n    tolua_cclass(tolua_S,\"PhysicsJointSpring\",\"cc.PhysicsJointSpring\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointSpring\");\n        tolua_function(tolua_S,\"setAnchr2\",lua_cocos2dx_physics_PhysicsJointSpring_setAnchr2);\n        tolua_function(tolua_S,\"setAnchr1\",lua_cocos2dx_physics_PhysicsJointSpring_setAnchr1);\n        tolua_function(tolua_S,\"getDamping\",lua_cocos2dx_physics_PhysicsJointSpring_getDamping);\n        tolua_function(tolua_S,\"setStiffness\",lua_cocos2dx_physics_PhysicsJointSpring_setStiffness);\n        tolua_function(tolua_S,\"getRestLength\",lua_cocos2dx_physics_PhysicsJointSpring_getRestLength);\n        tolua_function(tolua_S,\"getAnchr2\",lua_cocos2dx_physics_PhysicsJointSpring_getAnchr2);\n        tolua_function(tolua_S,\"getAnchr1\",lua_cocos2dx_physics_PhysicsJointSpring_getAnchr1);\n        tolua_function(tolua_S,\"getStiffness\",lua_cocos2dx_physics_PhysicsJointSpring_getStiffness);\n        tolua_function(tolua_S,\"setRestLength\",lua_cocos2dx_physics_PhysicsJointSpring_setRestLength);\n        tolua_function(tolua_S,\"setDamping\",lua_cocos2dx_physics_PhysicsJointSpring_setDamping);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointSpring_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointSpring).name();\n    g_luaType[typeName] = \"cc.PhysicsJointSpring\";\n    g_typeCast[\"PhysicsJointSpring\"] = \"cc.PhysicsJointSpring\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointGroove_setAnchr2(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGroove* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGroove\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGroove*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGroove_setAnchr2'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setAnchr2(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnchr2\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGroove_setAnchr2'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGroove_setGrooveA(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGroove* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGroove\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGroove*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGroove_setGrooveA'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setGrooveA(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGrooveA\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGroove_setGrooveA'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGroove_setGrooveB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGroove* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGroove\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGroove*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGroove_setGrooveB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setGrooveB(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setGrooveB\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGroove_setGrooveB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGroove_getGrooveA(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGroove* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGroove\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGroove*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGroove_getGrooveA'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getGrooveA();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGrooveA\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGroove_getGrooveA'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGroove_getGrooveB(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGroove* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGroove\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGroove*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGroove_getGrooveB'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getGrooveB();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getGrooveB\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGroove_getGrooveB'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGroove_getAnchr2(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGroove* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGroove\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGroove*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGroove_getAnchr2'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getAnchr2();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchr2\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGroove_getAnchr2'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGroove_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointGroove\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 5)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        cocos2d::Point arg2;\n        cocos2d::Point arg3;\n        cocos2d::Point arg4;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        ok &= luaval_to_point(tolua_S, 5, &arg3);\n        ok &= luaval_to_point(tolua_S, 6, &arg4);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointGroove* ret = cocos2d::PhysicsJointGroove::construct(arg0, arg1, arg2, arg3, arg4);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointGroove\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointGroove*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 5);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGroove_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointGroove_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointGroove)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointGroove(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointGroove\");\n    tolua_cclass(tolua_S,\"PhysicsJointGroove\",\"cc.PhysicsJointGroove\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointGroove\");\n        tolua_function(tolua_S,\"setAnchr2\",lua_cocos2dx_physics_PhysicsJointGroove_setAnchr2);\n        tolua_function(tolua_S,\"setGrooveA\",lua_cocos2dx_physics_PhysicsJointGroove_setGrooveA);\n        tolua_function(tolua_S,\"setGrooveB\",lua_cocos2dx_physics_PhysicsJointGroove_setGrooveB);\n        tolua_function(tolua_S,\"getGrooveA\",lua_cocos2dx_physics_PhysicsJointGroove_getGrooveA);\n        tolua_function(tolua_S,\"getGrooveB\",lua_cocos2dx_physics_PhysicsJointGroove_getGrooveB);\n        tolua_function(tolua_S,\"getAnchr2\",lua_cocos2dx_physics_PhysicsJointGroove_getAnchr2);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointGroove_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointGroove).name();\n    g_luaType[typeName] = \"cc.PhysicsJointGroove\";\n    g_typeCast[\"PhysicsJointGroove\"] = \"cc.PhysicsJointGroove\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointRotarySpring_getDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotarySpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotarySpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotarySpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_getDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getDamping();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDamping\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_getDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotarySpring_setRestAngle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotarySpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotarySpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotarySpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_setRestAngle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRestAngle(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRestAngle\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_setRestAngle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotarySpring_getStiffness(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotarySpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotarySpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotarySpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_getStiffness'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getStiffness();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getStiffness\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_getStiffness'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotarySpring_setStiffness(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotarySpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotarySpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotarySpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_setStiffness'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setStiffness(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setStiffness\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_setStiffness'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotarySpring_setDamping(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotarySpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotarySpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotarySpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_setDamping'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setDamping(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setDamping\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_setDamping'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotarySpring_getRestAngle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotarySpring* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotarySpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotarySpring*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_getRestAngle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRestAngle();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRestAngle\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_getRestAngle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotarySpring_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointRotarySpring\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        double arg2;\n        double arg3;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointRotarySpring* ret = cocos2d::PhysicsJointRotarySpring::construct(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointRotarySpring\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointRotarySpring*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotarySpring_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointRotarySpring_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointRotarySpring)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointRotarySpring(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointRotarySpring\");\n    tolua_cclass(tolua_S,\"PhysicsJointRotarySpring\",\"cc.PhysicsJointRotarySpring\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointRotarySpring\");\n        tolua_function(tolua_S,\"getDamping\",lua_cocos2dx_physics_PhysicsJointRotarySpring_getDamping);\n        tolua_function(tolua_S,\"setRestAngle\",lua_cocos2dx_physics_PhysicsJointRotarySpring_setRestAngle);\n        tolua_function(tolua_S,\"getStiffness\",lua_cocos2dx_physics_PhysicsJointRotarySpring_getStiffness);\n        tolua_function(tolua_S,\"setStiffness\",lua_cocos2dx_physics_PhysicsJointRotarySpring_setStiffness);\n        tolua_function(tolua_S,\"setDamping\",lua_cocos2dx_physics_PhysicsJointRotarySpring_setDamping);\n        tolua_function(tolua_S,\"getRestAngle\",lua_cocos2dx_physics_PhysicsJointRotarySpring_getRestAngle);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointRotarySpring_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointRotarySpring).name();\n    g_luaType[typeName] = \"cc.PhysicsJointRotarySpring\";\n    g_typeCast[\"PhysicsJointRotarySpring\"] = \"cc.PhysicsJointRotarySpring\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMax(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotaryLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotaryLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotaryLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMax'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMax();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMax\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMax'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotaryLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotaryLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotaryLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMin(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMin\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMax(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotaryLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotaryLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotaryLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMax'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setMax(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMax\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMax'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMin(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRotaryLimit* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRotaryLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRotaryLimit*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getMin();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRotaryLimit_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointRotaryLimit\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::PhysicsBody* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::PhysicsBody* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::PhysicsJointRotaryLimit* ret = cocos2d::PhysicsJointRotaryLimit::construct(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointRotaryLimit\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointRotaryLimit*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 4)\n        {\n            cocos2d::PhysicsBody* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocos2d::PhysicsBody* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            double arg2;\n            ok &= luaval_to_number(tolua_S, 4,&arg2);\n            if (!ok) { break; }\n            double arg3;\n            ok &= luaval_to_number(tolua_S, 5,&arg3);\n            if (!ok) { break; }\n            cocos2d::PhysicsJointRotaryLimit* ret = cocos2d::PhysicsJointRotaryLimit::construct(arg0, arg1, arg2, arg3);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointRotaryLimit\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointRotaryLimit*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"construct\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRotaryLimit_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointRotaryLimit_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointRotaryLimit)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointRotaryLimit(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointRotaryLimit\");\n    tolua_cclass(tolua_S,\"PhysicsJointRotaryLimit\",\"cc.PhysicsJointRotaryLimit\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointRotaryLimit\");\n        tolua_function(tolua_S,\"getMax\",lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMax);\n        tolua_function(tolua_S,\"setMin\",lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMin);\n        tolua_function(tolua_S,\"setMax\",lua_cocos2dx_physics_PhysicsJointRotaryLimit_setMax);\n        tolua_function(tolua_S,\"getMin\",lua_cocos2dx_physics_PhysicsJointRotaryLimit_getMin);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointRotaryLimit_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointRotaryLimit).name();\n    g_luaType[typeName] = \"cc.PhysicsJointRotaryLimit\";\n    g_typeCast[\"PhysicsJointRotaryLimit\"] = \"cc.PhysicsJointRotaryLimit\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointRatchet_getAngle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRatchet* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRatchet\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRatchet*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRatchet_getAngle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getAngle();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAngle\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRatchet_getAngle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRatchet_setAngle(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRatchet* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRatchet\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRatchet*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRatchet_setAngle'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setAngle(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAngle\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRatchet_setAngle'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRatchet_setPhase(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRatchet* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRatchet\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRatchet*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRatchet_setPhase'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPhase(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPhase\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRatchet_setPhase'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRatchet_getPhase(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRatchet* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRatchet\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRatchet*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRatchet_getPhase'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getPhase();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPhase\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRatchet_getPhase'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRatchet_setRatchet(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRatchet* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRatchet\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRatchet*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRatchet_setRatchet'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRatchet(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRatchet\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRatchet_setRatchet'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRatchet_getRatchet(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointRatchet* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointRatchet\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointRatchet*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointRatchet_getRatchet'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRatchet();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRatchet\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRatchet_getRatchet'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointRatchet_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointRatchet\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        double arg2;\n        double arg3;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointRatchet* ret = cocos2d::PhysicsJointRatchet::construct(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointRatchet\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointRatchet*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointRatchet_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointRatchet_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointRatchet)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointRatchet(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointRatchet\");\n    tolua_cclass(tolua_S,\"PhysicsJointRatchet\",\"cc.PhysicsJointRatchet\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointRatchet\");\n        tolua_function(tolua_S,\"getAngle\",lua_cocos2dx_physics_PhysicsJointRatchet_getAngle);\n        tolua_function(tolua_S,\"setAngle\",lua_cocos2dx_physics_PhysicsJointRatchet_setAngle);\n        tolua_function(tolua_S,\"setPhase\",lua_cocos2dx_physics_PhysicsJointRatchet_setPhase);\n        tolua_function(tolua_S,\"getPhase\",lua_cocos2dx_physics_PhysicsJointRatchet_getPhase);\n        tolua_function(tolua_S,\"setRatchet\",lua_cocos2dx_physics_PhysicsJointRatchet_setRatchet);\n        tolua_function(tolua_S,\"getRatchet\",lua_cocos2dx_physics_PhysicsJointRatchet_getRatchet);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointRatchet_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointRatchet).name();\n    g_luaType[typeName] = \"cc.PhysicsJointRatchet\";\n    g_typeCast[\"PhysicsJointRatchet\"] = \"cc.PhysicsJointRatchet\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointGear_setRatio(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGear* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGear\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGear*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGear_setRatio'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRatio(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRatio\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGear_setRatio'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGear_getPhase(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGear* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGear\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGear*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGear_getPhase'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getPhase();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPhase\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGear_getPhase'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGear_setPhase(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGear* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGear\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGear*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGear_setPhase'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setPhase(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setPhase\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGear_setPhase'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGear_getRatio(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointGear* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointGear\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointGear*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointGear_getRatio'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRatio();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRatio\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGear_getRatio'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointGear_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointGear\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 4)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        double arg2;\n        double arg3;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointGear* ret = cocos2d::PhysicsJointGear::construct(arg0, arg1, arg2, arg3);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointGear\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointGear*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 4);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointGear_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointGear_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointGear)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointGear(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointGear\");\n    tolua_cclass(tolua_S,\"PhysicsJointGear\",\"cc.PhysicsJointGear\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointGear\");\n        tolua_function(tolua_S,\"setRatio\",lua_cocos2dx_physics_PhysicsJointGear_setRatio);\n        tolua_function(tolua_S,\"getPhase\",lua_cocos2dx_physics_PhysicsJointGear_getPhase);\n        tolua_function(tolua_S,\"setPhase\",lua_cocos2dx_physics_PhysicsJointGear_setPhase);\n        tolua_function(tolua_S,\"getRatio\",lua_cocos2dx_physics_PhysicsJointGear_getRatio);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointGear_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointGear).name();\n    g_luaType[typeName] = \"cc.PhysicsJointGear\";\n    g_typeCast[\"PhysicsJointGear\"] = \"cc.PhysicsJointGear\";\n    return 1;\n}\n\nint lua_cocos2dx_physics_PhysicsJointMotor_setRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointMotor* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointMotor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointMotor*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointMotor_setRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setRate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setRate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointMotor_setRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointMotor_getRate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsJointMotor* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsJointMotor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocos2d::PhysicsJointMotor*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsJointMotor_getRate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getRate();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getRate\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointMotor_getRate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsJointMotor_construct(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsJointMotor\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 3)\n    {\n        cocos2d::PhysicsBody* arg0;\n        cocos2d::PhysicsBody* arg1;\n        double arg2;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"cc.PhysicsBody\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cocos2d::PhysicsJointMotor* ret = cocos2d::PhysicsJointMotor::construct(arg0, arg1, arg2);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJointMotor\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsJointMotor*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"construct\",argc, 3);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsJointMotor_construct'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_physics_PhysicsJointMotor_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (PhysicsJointMotor)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_physics_PhysicsJointMotor(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"cc.PhysicsJointMotor\");\n    tolua_cclass(tolua_S,\"PhysicsJointMotor\",\"cc.PhysicsJointMotor\",\"cc.PhysicsJoint\",NULL);\n\n    tolua_beginmodule(tolua_S,\"PhysicsJointMotor\");\n        tolua_function(tolua_S,\"setRate\",lua_cocos2dx_physics_PhysicsJointMotor_setRate);\n        tolua_function(tolua_S,\"getRate\",lua_cocos2dx_physics_PhysicsJointMotor_getRate);\n        tolua_function(tolua_S,\"construct\", lua_cocos2dx_physics_PhysicsJointMotor_construct);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocos2d::PhysicsJointMotor).name();\n    g_luaType[typeName] = \"cc.PhysicsJointMotor\";\n    g_typeCast[\"PhysicsJointMotor\"] = \"cc.PhysicsJointMotor\";\n    return 1;\n}\nTOLUA_API int register_all_cocos2dx_physics(lua_State* tolua_S)\n{\n\ttolua_open(tolua_S);\n\t\n\ttolua_module(tolua_S,\"cc\",0);\n\ttolua_beginmodule(tolua_S,\"cc\");\n\n\tlua_register_cocos2dx_physics_PhysicsBody(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsWorld(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJoint(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointLimit(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointFixed(tolua_S);\n\tlua_register_cocos2dx_physics_EventListenerPhysicsContact(tolua_S);\n\tlua_register_cocos2dx_physics_EventListenerPhysicsContactWithGroup(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShape(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShapeBox(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointMotor(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointDistance(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShapeCircle(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShapeEdgePolygon(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointPin(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsContactPreSolve(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsDebugDraw(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShapeEdgeChain(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShapeEdgeSegment(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointGear(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsContact(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShapePolygon(tolua_S);\n\tlua_register_cocos2dx_physics_EventListenerPhysicsContactWithBodies(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointRotarySpring(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsContactPostSolve(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointGroove(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsShapeEdgeBox(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointRotaryLimit(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointRatchet(tolua_S);\n\tlua_register_cocos2dx_physics_PhysicsJointSpring(tolua_S);\n\tlua_register_cocos2dx_physics_EventListenerPhysicsContactWithShapes(tolua_S);\n\n\ttolua_endmodule(tolua_S);\n\treturn 1;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_physics_auto.hpp",
    "content": "#ifndef __cocos2dx_physics_h__\n#define __cocos2dx_physics_h__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\nint register_all_cocos2dx_physics(lua_State* tolua_S);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#endif // __cocos2dx_physics_h__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_physics_auto_api.js",
    "content": "/**\n * @module cocos2dx_physics\n */\nvar cc = cc || {};\n\n/**\n * @class PhysicsShape\n */\ncc.PhysicsShape = {\n\n/**\n * @method getFriction\n * @return A value converted from C/C++ \"float\"\n */\ngetFriction : function () {},\n\n/**\n * @method setGroup\n * @param {int}\n */\nsetGroup : function () {},\n\n/**\n * @method setDensity\n * @param {float}\n */\nsetDensity : function () {},\n\n/**\n * @method getMass\n * @return A value converted from C/C++ \"float\"\n */\ngetMass : function () {},\n\n/**\n * @method getMaterial\n * @return A value converted from C/C++ \"const cocos2d::PhysicsMaterial&\"\n */\ngetMaterial : function () {},\n\n/**\n * @method getCollisionBitmask\n * @return A value converted from C/C++ \"int\"\n */\ngetCollisionBitmask : function () {},\n\n/**\n * @method getArea\n * @return A value converted from C/C++ \"float\"\n */\ngetArea : function () {},\n\n/**\n * @method setCategoryBitmask\n * @param {int}\n */\nsetCategoryBitmask : function () {},\n\n/**\n * @method getGroup\n * @return A value converted from C/C++ \"int\"\n */\ngetGroup : function () {},\n\n/**\n * @method setMoment\n * @param {float}\n */\nsetMoment : function () {},\n\n/**\n * @method containsPoint\n * @return A value converted from C/C++ \"bool\"\n * @param {const cocos2d::Point&}\n */\ncontainsPoint : function () {},\n\n/**\n * @method getCategoryBitmask\n * @return A value converted from C/C++ \"int\"\n */\ngetCategoryBitmask : function () {},\n\n/**\n * @method getType\n * @return A value converted from C/C++ \"cocos2d::PhysicsShape::Type\"\n */\ngetType : function () {},\n\n/**\n * @method getContactTestBitmask\n * @return A value converted from C/C++ \"int\"\n */\ngetContactTestBitmask : function () {},\n\n/**\n * @method getCenter\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetCenter : function () {},\n\n/**\n * @method getDensity\n * @return A value converted from C/C++ \"float\"\n */\ngetDensity : function () {},\n\n/**\n * @method setMass\n * @param {float}\n */\nsetMass : function () {},\n\n/**\n * @method getTag\n * @return A value converted from C/C++ \"int\"\n */\ngetTag : function () {},\n\n/**\n * @method calculateDefaultMoment\n * @return A value converted from C/C++ \"float\"\n */\ncalculateDefaultMoment : function () {},\n\n/**\n * @method setCollisionBitmask\n * @param {int}\n */\nsetCollisionBitmask : function () {},\n\n/**\n * @method getMoment\n * @return A value converted from C/C++ \"float\"\n */\ngetMoment : function () {},\n\n/**\n * @method getOffset\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetOffset : function () {},\n\n/**\n * @method getRestitution\n * @return A value converted from C/C++ \"float\"\n */\ngetRestitution : function () {},\n\n/**\n * @method setFriction\n * @param {float}\n */\nsetFriction : function () {},\n\n/**\n * @method setMaterial\n * @param {const cocos2d::PhysicsMaterial&}\n */\nsetMaterial : function () {},\n\n/**\n * @method setTag\n * @param {int}\n */\nsetTag : function () {},\n\n/**\n * @method setContactTestBitmask\n * @param {int}\n */\nsetContactTestBitmask : function () {},\n\n/**\n * @method setRestitution\n * @param {float}\n */\nsetRestitution : function () {},\n\n/**\n * @method getBody\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n */\ngetBody : function () {},\n\n};\n\n/**\n * @class PhysicsShapeCircle\n */\ncc.PhysicsShapeCircle = {\n\n/**\n * @method getRadius\n * @return A value converted from C/C++ \"float\"\n */\ngetRadius : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PhysicsShapeCircle*\"\n * @param {float}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n/**\n * @method calculateArea\n * @return A value converted from C/C++ \"float\"\n * @param {float}\n */\ncalculateArea : function () {},\n\n/**\n * @method calculateMoment\n * @return A value converted from C/C++ \"float\"\n * @param {float}\n * @param {float}\n * @param {const cocos2d::Point&}\n */\ncalculateMoment : function () {},\n\n};\n\n/**\n * @class PhysicsShapeBox\n */\ncc.PhysicsShapeBox = {\n\n/**\n * @method getPointsCount\n * @return A value converted from C/C++ \"int\"\n */\ngetPointsCount : function () {},\n\n/**\n * @method getSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetSize : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PhysicsShapeBox*\"\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n/**\n * @method calculateArea\n * @return A value converted from C/C++ \"float\"\n * @param {const cocos2d::Size&}\n */\ncalculateArea : function () {},\n\n/**\n * @method calculateMoment\n * @return A value converted from C/C++ \"float\"\n * @param {float}\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::Point&}\n */\ncalculateMoment : function () {},\n\n};\n\n/**\n * @class PhysicsShapePolygon\n */\ncc.PhysicsShapePolygon = {\n\n/**\n * @method getPointsCount\n * @return A value converted from C/C++ \"int\"\n */\ngetPointsCount : function () {},\n\n/**\n * @method getPoint\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {int}\n */\ngetPoint : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PhysicsShapePolygon*\"\n * @param {const cocos2d::Point*}\n * @param {int}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n/**\n * @method calculateArea\n * @return A value converted from C/C++ \"float\"\n * @param {const cocos2d::Point*}\n * @param {int}\n */\ncalculateArea : function () {},\n\n/**\n * @method calculateMoment\n * @return A value converted from C/C++ \"float\"\n * @param {float}\n * @param {const cocos2d::Point*}\n * @param {int}\n * @param {const cocos2d::Point&}\n */\ncalculateMoment : function () {},\n\n};\n\n/**\n * @class PhysicsShapeEdgeSegment\n */\ncc.PhysicsShapeEdgeSegment = {\n\n/**\n * @method getPointB\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPointB : function () {},\n\n/**\n * @method getPointA\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPointA : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PhysicsShapeEdgeSegment*\"\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class PhysicsShapeEdgeBox\n */\ncc.PhysicsShapeEdgeBox = {\n\n/**\n * @method getPointsCount\n * @return A value converted from C/C++ \"int\"\n */\ngetPointsCount : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PhysicsShapeEdgeBox*\"\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {float}\n * @param {const cocos2d::Point&}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class PhysicsShapeEdgePolygon\n */\ncc.PhysicsShapeEdgePolygon = {\n\n/**\n * @method getPointsCount\n * @return A value converted from C/C++ \"int\"\n */\ngetPointsCount : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PhysicsShapeEdgePolygon*\"\n * @param {const cocos2d::Point*}\n * @param {int}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class PhysicsShapeEdgeChain\n */\ncc.PhysicsShapeEdgeChain = {\n\n/**\n * @method getPointsCount\n * @return A value converted from C/C++ \"int\"\n */\ngetPointsCount : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::PhysicsShapeEdgeChain*\"\n * @param {const cocos2d::Point*}\n * @param {int}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {float}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class PhysicsBody\n */\ncc.PhysicsBody = {\n\n/**\n * @method isGravityEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisGravityEnabled : function () {},\n\n/**\n * @method resetForces\n */\nresetForces : function () {},\n\n/**\n * @method getVelocityLimit\n * @return A value converted from C/C++ \"float\"\n */\ngetVelocityLimit : function () {},\n\n/**\n * @method setGroup\n * @param {int}\n */\nsetGroup : function () {},\n\n/**\n * @method getMass\n * @return A value converted from C/C++ \"float\"\n */\ngetMass : function () {},\n\n/**\n * @method getCollisionBitmask\n * @return A value converted from C/C++ \"int\"\n */\ngetCollisionBitmask : function () {},\n\n/**\n * @method getRotation\n * @return A value converted from C/C++ \"float\"\n */\ngetRotation : function () {},\n\n/**\n * @method isResting\n * @return A value converted from C/C++ \"bool\"\n */\nisResting : function () {},\n\n/**\n * @method addShape\n * @return A value converted from C/C++ \"cocos2d::PhysicsShape*\"\n * @param {cocos2d::PhysicsShape*}\n * @param {bool}\n */\naddShape : function () {},\n\n/**\n * @method applyTorque\n * @param {float}\n */\napplyTorque : function () {},\n\n/**\n * @method getAngularVelocityLimit\n * @return A value converted from C/C++ \"float\"\n */\ngetAngularVelocityLimit : function () {},\n\n/**\n * @method setAngularVelocityLimit\n * @param {float}\n */\nsetAngularVelocityLimit : function () {},\n\n/**\n * @method getVelocity\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetVelocity : function () {},\n\n/**\n * @method getLinearDamping\n * @return A value converted from C/C++ \"float\"\n */\ngetLinearDamping : function () {},\n\n/**\n * @method removeAllShapes\n */\nremoveAllShapes : function () {},\n\n/**\n * @method setAngularDamping\n * @param {float}\n */\nsetAngularDamping : function () {},\n\n/**\n * @method setVelocityLimit\n * @param {float}\n */\nsetVelocityLimit : function () {},\n\n/**\n * @method setEnable\n * @param {bool}\n */\nsetEnable : function () {},\n\n/**\n * @method setCategoryBitmask\n * @param {int}\n */\nsetCategoryBitmask : function () {},\n\n/**\n * @method getWorld\n * @return A value converted from C/C++ \"cocos2d::PhysicsWorld*\"\n */\ngetWorld : function () {},\n\n/**\n * @method getAngularVelocity\n * @return A value converted from C/C++ \"float\"\n */\ngetAngularVelocity : function () {},\n\n/**\n * @method getPosition\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetPosition : function () {},\n\n/**\n * @method setGravityEnable\n * @param {bool}\n */\nsetGravityEnable : function () {},\n\n/**\n * @method getGroup\n * @return A value converted from C/C++ \"int\"\n */\ngetGroup : function () {},\n\n/**\n * @method setMoment\n * @param {float}\n */\nsetMoment : function () {},\n\n/**\n * @method getTag\n * @return A value converted from C/C++ \"int\"\n */\ngetTag : function () {},\n\n/**\n * @method local2World\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nlocal2World : function () {},\n\n/**\n * @method getCategoryBitmask\n * @return A value converted from C/C++ \"int\"\n */\ngetCategoryBitmask : function () {},\n\n/**\n * @method getMoment\n * @return A value converted from C/C++ \"float\"\n * @param {float}\n */\ngetMoment : function () {},\n\n/**\n * @method getFirstShape\n * @return A value converted from C/C++ \"cocos2d::PhysicsShape*\"\n */\ngetFirstShape : function () {},\n\n/**\n * @method getShapes\n * @return A value converted from C/C++ \"const cocos2d::Vector<cocos2d::PhysicsShape *>&\"\n */\ngetShapes : function () {},\n\n/**\n * @method getContactTestBitmask\n * @return A value converted from C/C++ \"int\"\n */\ngetContactTestBitmask : function () {},\n\n/**\n * @method setAngularVelocity\n * @param {float}\n */\nsetAngularVelocity : function () {},\n\n/**\n * @method world2Local\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\nworld2Local : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method setMass\n * @param {float}\n */\nsetMass : function () {},\n\n/**\n * @method addMoment\n * @param {float}\n */\naddMoment : function () {},\n\n/**\n * @method setVelocity\n * @param {const cocos2d::Vect&}\n */\nsetVelocity : function () {},\n\n/**\n * @method setLinearDamping\n * @param {float}\n */\nsetLinearDamping : function () {},\n\n/**\n * @method setCollisionBitmask\n * @param {int}\n */\nsetCollisionBitmask : function () {},\n\n/**\n * @method setDynamic\n * @param {bool}\n */\nsetDynamic : function () {},\n\n/**\n * @method setRotationEnable\n * @param {bool}\n */\nsetRotationEnable : function () {},\n\n/**\n * @method getAngularDamping\n * @return A value converted from C/C++ \"float\"\n */\ngetAngularDamping : function () {},\n\n/**\n * @method getVelocityAtLocalPoint\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\ngetVelocityAtLocalPoint : function () {},\n\n/**\n * @method isRotationEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisRotationEnabled : function () {},\n\n/**\n * @method addMass\n * @param {float}\n */\naddMass : function () {},\n\n/**\n * @method getShape\n * @return A value converted from C/C++ \"cocos2d::PhysicsShape*\"\n * @param {int}\n */\ngetShape : function () {},\n\n/**\n * @method setTag\n * @param {int}\n */\nsetTag : function () {},\n\n/**\n * @method getVelocityAtWorldPoint\n * @return A value converted from C/C++ \"cocos2d::Point\"\n * @param {const cocos2d::Point&}\n */\ngetVelocityAtWorldPoint : function () {},\n\n/**\n * @method setContactTestBitmask\n * @param {int}\n */\nsetContactTestBitmask : function () {},\n\n/**\n * @method removeFromWorld\n */\nremoveFromWorld : function () {},\n\n/**\n * @method isDynamic\n * @return A value converted from C/C++ \"bool\"\n */\nisDynamic : function () {},\n\n/**\n * @method getNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetNode : function () {},\n\n/**\n * @method createBox\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {const cocos2d::Point&}\n */\ncreateBox : function () {},\n\n/**\n * @method createEdgeSegment\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {float}\n */\ncreateEdgeSegment : function () {},\n\n/**\n * @method createEdgeBox\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n * @param {const cocos2d::Size&}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {float}\n * @param {const cocos2d::Point&}\n */\ncreateEdgeBox : function () {},\n\n/**\n * @method createCircle\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n * @param {float}\n * @param {const cocos2d::PhysicsMaterial&}\n * @param {const cocos2d::Point&}\n */\ncreateCircle : function () {},\n\n};\n\n/**\n * @class PhysicsWorld\n */\ncc.PhysicsWorld = {\n\n/**\n * @method getGravity\n * @return A value converted from C/C++ \"cocos2d::Vect\"\n */\ngetGravity : function () {},\n\n/**\n * @method getAllBodies\n * @return A value converted from C/C++ \"const cocos2d::Vector<cocos2d::PhysicsBody *>&\"\n */\ngetAllBodies : function () {},\n\n/**\n * @method setGravity\n * @param {const cocos2d::Vect&}\n */\nsetGravity : function () {},\n\n/**\n * @method getSpeed\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeed : function () {},\n\n/**\n * @method removeJoint\n * @param {cocos2d::PhysicsJoint*}\n * @param {bool}\n */\nremoveJoint : function () {},\n\n/**\n * @method getUpdateRate\n * @return A value converted from C/C++ \"int\"\n */\ngetUpdateRate : function () {},\n\n/**\n * @method setSpeed\n * @param {float}\n */\nsetSpeed : function () {},\n\n/**\n * @method getShapes\n * @return A value converted from C/C++ \"cocos2d::Vector<cocos2d::PhysicsShape *>\"\n * @param {const cocos2d::Point&}\n */\ngetShapes : function () {},\n\n/**\n * @method removeAllJoints\n * @param {bool}\n */\nremoveAllJoints : function () {},\n\n/**\n * @method getShape\n * @return A value converted from C/C++ \"cocos2d::PhysicsShape*\"\n * @param {const cocos2d::Point&}\n */\ngetShape : function () {},\n\n/**\n * @method removeAllBodies\n */\nremoveAllBodies : function () {},\n\n/**\n * @method getDebugDrawMask\n * @return A value converted from C/C++ \"int\"\n */\ngetDebugDrawMask : function () {},\n\n/**\n * @method setDebugDrawMask\n * @param {int}\n */\nsetDebugDrawMask : function () {},\n\n/**\n * @method getBody\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n * @param {int}\n */\ngetBody : function () {},\n\n/**\n * @method setUpdateRate\n * @param {int}\n */\nsetUpdateRate : function () {},\n\n/**\n * @method addJoint\n * @param {cocos2d::PhysicsJoint*}\n */\naddJoint : function () {},\n\n};\n\n/**\n * @class PhysicsDebugDraw\n */\ncc.PhysicsDebugDraw = {\n\n};\n\n/**\n * @class PhysicsContact\n */\ncc.PhysicsContact = {\n\n/**\n * @method getContactData\n * @return A value converted from C/C++ \"const cocos2d::PhysicsContactData*\"\n */\ngetContactData : function () {},\n\n/**\n * @method getEventCode\n * @return A value converted from C/C++ \"cocos2d::PhysicsContact::EventCode\"\n */\ngetEventCode : function () {},\n\n/**\n * @method getShapeA\n * @return A value converted from C/C++ \"cocos2d::PhysicsShape*\"\n */\ngetShapeA : function () {},\n\n/**\n * @method getShapeB\n * @return A value converted from C/C++ \"cocos2d::PhysicsShape*\"\n */\ngetShapeB : function () {},\n\n};\n\n/**\n * @class PhysicsContactPreSolve\n */\ncc.PhysicsContactPreSolve = {\n\n/**\n * @method getFriction\n * @return A value converted from C/C++ \"float\"\n */\ngetFriction : function () {},\n\n/**\n * @method getElasticity\n * @return A value converted from C/C++ \"float\"\n */\ngetElasticity : function () {},\n\n/**\n * @method setElasticity\n * @param {float}\n */\nsetElasticity : function () {},\n\n/**\n * @method setFriction\n * @param {float}\n */\nsetFriction : function () {},\n\n/**\n * @method ignore\n */\nignore : function () {},\n\n/**\n * @method getSurfaceVelocity\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetSurfaceVelocity : function () {},\n\n/**\n * @method setSurfaceVelocity\n * @param {const cocos2d::Vect&}\n */\nsetSurfaceVelocity : function () {},\n\n};\n\n/**\n * @class PhysicsContactPostSolve\n */\ncc.PhysicsContactPostSolve = {\n\n/**\n * @method getFriction\n * @return A value converted from C/C++ \"float\"\n */\ngetFriction : function () {},\n\n/**\n * @method getSurfaceVelocity\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetSurfaceVelocity : function () {},\n\n/**\n * @method getElasticity\n * @return A value converted from C/C++ \"float\"\n */\ngetElasticity : function () {},\n\n};\n\n/**\n * @class EventListenerPhysicsContact\n */\ncc.EventListenerPhysicsContact = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EventListenerPhysicsContact*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EventListenerPhysicsContactWithBodies\n */\ncc.EventListenerPhysicsContactWithBodies = {\n\n/**\n * @method hitTest\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::PhysicsShape*}\n * @param {cocos2d::PhysicsShape*}\n */\nhitTest : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EventListenerPhysicsContactWithBodies*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EventListenerPhysicsContactWithShapes\n */\ncc.EventListenerPhysicsContactWithShapes = {\n\n/**\n * @method hitTest\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::PhysicsShape*}\n * @param {cocos2d::PhysicsShape*}\n */\nhitTest : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EventListenerPhysicsContactWithShapes*\"\n * @param {cocos2d::PhysicsShape*}\n * @param {cocos2d::PhysicsShape*}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class EventListenerPhysicsContactWithGroup\n */\ncc.EventListenerPhysicsContactWithGroup = {\n\n/**\n * @method hitTest\n * @return A value converted from C/C++ \"bool\"\n * @param {cocos2d::PhysicsShape*}\n * @param {cocos2d::PhysicsShape*}\n */\nhitTest : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocos2d::EventListenerPhysicsContactWithGroup*\"\n * @param {int}\n */\ncreate : function () {},\n\n};\n\n/**\n * @class PhysicsJoint\n */\ncc.PhysicsJoint = {\n\n/**\n * @method getBodyA\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n */\ngetBodyA : function () {},\n\n/**\n * @method getBodyB\n * @return A value converted from C/C++ \"cocos2d::PhysicsBody*\"\n */\ngetBodyB : function () {},\n\n/**\n * @method getMaxForce\n * @return A value converted from C/C++ \"float\"\n */\ngetMaxForce : function () {},\n\n/**\n * @method setMaxForce\n * @param {float}\n */\nsetMaxForce : function () {},\n\n/**\n * @method isEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisEnabled : function () {},\n\n/**\n * @method setEnable\n * @param {bool}\n */\nsetEnable : function () {},\n\n/**\n * @method setCollisionEnable\n * @param {bool}\n */\nsetCollisionEnable : function () {},\n\n/**\n * @method getWorld\n * @return A value converted from C/C++ \"cocos2d::PhysicsWorld*\"\n */\ngetWorld : function () {},\n\n/**\n * @method setTag\n * @param {int}\n */\nsetTag : function () {},\n\n/**\n * @method removeFormWorld\n */\nremoveFormWorld : function () {},\n\n/**\n * @method isCollisionEnabled\n * @return A value converted from C/C++ \"bool\"\n */\nisCollisionEnabled : function () {},\n\n/**\n * @method getTag\n * @return A value converted from C/C++ \"int\"\n */\ngetTag : function () {},\n\n/**\n * @method destroy\n * @param {cocos2d::PhysicsJoint*}\n */\ndestroy : function () {},\n\n};\n\n/**\n * @class PhysicsJointFixed\n */\ncc.PhysicsJointFixed = {\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointFixed*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {const cocos2d::Point&}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointLimit\n */\ncc.PhysicsJointLimit = {\n\n/**\n * @method setAnchr2\n * @param {const cocos2d::Point&}\n */\nsetAnchr2 : function () {},\n\n/**\n * @method setAnchr1\n * @param {const cocos2d::Point&}\n */\nsetAnchr1 : function () {},\n\n/**\n * @method setMax\n * @param {float}\n */\nsetMax : function () {},\n\n/**\n * @method getAnchr2\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchr2 : function () {},\n\n/**\n * @method getAnchr1\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchr1 : function () {},\n\n/**\n * @method getMin\n * @return A value converted from C/C++ \"float\"\n */\ngetMin : function () {},\n\n/**\n * @method getMax\n * @return A value converted from C/C++ \"float\"\n */\ngetMax : function () {},\n\n/**\n * @method setMin\n * @param {float}\n */\nsetMin : function () {},\n\n};\n\n/**\n * @class PhysicsJointPin\n */\ncc.PhysicsJointPin = {\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointPin*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {const cocos2d::Point&}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointDistance\n */\ncc.PhysicsJointDistance = {\n\n/**\n * @method setDistance\n * @param {float}\n */\nsetDistance : function () {},\n\n/**\n * @method getDistance\n * @return A value converted from C/C++ \"float\"\n */\ngetDistance : function () {},\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointDistance*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointSpring\n */\ncc.PhysicsJointSpring = {\n\n/**\n * @method setAnchr2\n * @param {const cocos2d::Point&}\n */\nsetAnchr2 : function () {},\n\n/**\n * @method setAnchr1\n * @param {const cocos2d::Point&}\n */\nsetAnchr1 : function () {},\n\n/**\n * @method getDamping\n * @return A value converted from C/C++ \"float\"\n */\ngetDamping : function () {},\n\n/**\n * @method setStiffness\n * @param {float}\n */\nsetStiffness : function () {},\n\n/**\n * @method getRestLength\n * @return A value converted from C/C++ \"float\"\n */\ngetRestLength : function () {},\n\n/**\n * @method getAnchr2\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchr2 : function () {},\n\n/**\n * @method getAnchr1\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchr1 : function () {},\n\n/**\n * @method getStiffness\n * @return A value converted from C/C++ \"float\"\n */\ngetStiffness : function () {},\n\n/**\n * @method setRestLength\n * @param {float}\n */\nsetRestLength : function () {},\n\n/**\n * @method setDamping\n * @param {float}\n */\nsetDamping : function () {},\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointSpring*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {float}\n * @param {float}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointGroove\n */\ncc.PhysicsJointGroove = {\n\n/**\n * @method setAnchr2\n * @param {const cocos2d::Point&}\n */\nsetAnchr2 : function () {},\n\n/**\n * @method setGrooveA\n * @param {const cocos2d::Point&}\n */\nsetGrooveA : function () {},\n\n/**\n * @method setGrooveB\n * @param {const cocos2d::Point&}\n */\nsetGrooveB : function () {},\n\n/**\n * @method getGrooveA\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetGrooveA : function () {},\n\n/**\n * @method getGrooveB\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetGrooveB : function () {},\n\n/**\n * @method getAnchr2\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchr2 : function () {},\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointGroove*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n * @param {const cocos2d::Point&}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointRotarySpring\n */\ncc.PhysicsJointRotarySpring = {\n\n/**\n * @method getDamping\n * @return A value converted from C/C++ \"float\"\n */\ngetDamping : function () {},\n\n/**\n * @method setRestAngle\n * @param {float}\n */\nsetRestAngle : function () {},\n\n/**\n * @method getStiffness\n * @return A value converted from C/C++ \"float\"\n */\ngetStiffness : function () {},\n\n/**\n * @method setStiffness\n * @param {float}\n */\nsetStiffness : function () {},\n\n/**\n * @method setDamping\n * @param {float}\n */\nsetDamping : function () {},\n\n/**\n * @method getRestAngle\n * @return A value converted from C/C++ \"float\"\n */\ngetRestAngle : function () {},\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointRotarySpring*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {float}\n * @param {float}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointRotaryLimit\n */\ncc.PhysicsJointRotaryLimit = {\n\n/**\n * @method getMax\n * @return A value converted from C/C++ \"float\"\n */\ngetMax : function () {},\n\n/**\n * @method setMin\n * @param {float}\n */\nsetMin : function () {},\n\n/**\n * @method setMax\n * @param {float}\n */\nsetMax : function () {},\n\n/**\n * @method getMin\n * @return A value converted from C/C++ \"float\"\n */\ngetMin : function () {},\n\n};\n\n/**\n * @class PhysicsJointRatchet\n */\ncc.PhysicsJointRatchet = {\n\n/**\n * @method getAngle\n * @return A value converted from C/C++ \"float\"\n */\ngetAngle : function () {},\n\n/**\n * @method setAngle\n * @param {float}\n */\nsetAngle : function () {},\n\n/**\n * @method setPhase\n * @param {float}\n */\nsetPhase : function () {},\n\n/**\n * @method getPhase\n * @return A value converted from C/C++ \"float\"\n */\ngetPhase : function () {},\n\n/**\n * @method setRatchet\n * @param {float}\n */\nsetRatchet : function () {},\n\n/**\n * @method getRatchet\n * @return A value converted from C/C++ \"float\"\n */\ngetRatchet : function () {},\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointRatchet*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {float}\n * @param {float}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointGear\n */\ncc.PhysicsJointGear = {\n\n/**\n * @method setRatio\n * @param {float}\n */\nsetRatio : function () {},\n\n/**\n * @method getPhase\n * @return A value converted from C/C++ \"float\"\n */\ngetPhase : function () {},\n\n/**\n * @method setPhase\n * @param {float}\n */\nsetPhase : function () {},\n\n/**\n * @method getRatio\n * @return A value converted from C/C++ \"float\"\n */\ngetRatio : function () {},\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointGear*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {float}\n * @param {float}\n */\nconstruct : function () {},\n\n};\n\n/**\n * @class PhysicsJointMotor\n */\ncc.PhysicsJointMotor = {\n\n/**\n * @method setRate\n * @param {float}\n */\nsetRate : function () {},\n\n/**\n * @method getRate\n * @return A value converted from C/C++ \"float\"\n */\ngetRate : function () {},\n\n/**\n * @method construct\n * @return A value converted from C/C++ \"cocos2d::PhysicsJointMotor*\"\n * @param {cocos2d::PhysicsBody*}\n * @param {cocos2d::PhysicsBody*}\n * @param {float}\n */\nconstruct : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp",
    "content": "#include \"lua_cocos2dx_spine_auto.hpp\"\n#include \"spine-cocos2dx.h\"\n#include \"tolua_fix.h\"\n#include \"LuaBasicConversions.h\"\n\n\n\nint lua_cocos2dx_spine_Skeleton_setToSetupPose(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::Skeleton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.Skeleton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::Skeleton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_Skeleton_setToSetupPose'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setToSetupPose();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setToSetupPose\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_Skeleton_setToSetupPose'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_Skeleton_setBlendFunc(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::Skeleton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.Skeleton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::Skeleton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_Skeleton_setBlendFunc'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::BlendFunc arg0;\n\n        #pragma warning NO CONVERSION TO NATIVE FOR BlendFunc;\n        if(!ok)\n            return 0;\n        cobj->setBlendFunc(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBlendFunc\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_Skeleton_setBlendFunc'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_Skeleton_onDraw(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::Skeleton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.Skeleton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::Skeleton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_Skeleton_onDraw'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->onDraw();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onDraw\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_Skeleton_onDraw'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_Skeleton_setSlotsToSetupPose(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::Skeleton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.Skeleton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::Skeleton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_Skeleton_setSlotsToSetupPose'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setSlotsToSetupPose();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSlotsToSetupPose\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_Skeleton_setSlotsToSetupPose'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_Skeleton_getBlendFunc(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::Skeleton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.Skeleton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::Skeleton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_Skeleton_getBlendFunc'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::BlendFunc& ret = cobj->getBlendFunc();\n        #pragma warning NO CONVERSION FROM NATIVE FOR BlendFunc;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBlendFunc\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_Skeleton_getBlendFunc'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_Skeleton_setSkin(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::Skeleton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.Skeleton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::Skeleton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_Skeleton_setSkin'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        bool ret = cobj->setSkin(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSkin\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_Skeleton_setSkin'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_Skeleton_setBonesToSetupPose(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::Skeleton* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.Skeleton\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::Skeleton*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_Skeleton_setBonesToSetupPose'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->setBonesToSetupPose();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBonesToSetupPose\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_Skeleton_setBonesToSetupPose'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_spine_Skeleton_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Skeleton)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_spine_Skeleton(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"sp.Skeleton\");\n    tolua_cclass(tolua_S,\"Skeleton\",\"sp.Skeleton\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Skeleton\");\n        tolua_function(tolua_S,\"setToSetupPose\",lua_cocos2dx_spine_Skeleton_setToSetupPose);\n        tolua_function(tolua_S,\"setBlendFunc\",lua_cocos2dx_spine_Skeleton_setBlendFunc);\n        tolua_function(tolua_S,\"onDraw\",lua_cocos2dx_spine_Skeleton_onDraw);\n        tolua_function(tolua_S,\"setSlotsToSetupPose\",lua_cocos2dx_spine_Skeleton_setSlotsToSetupPose);\n        tolua_function(tolua_S,\"getBlendFunc\",lua_cocos2dx_spine_Skeleton_getBlendFunc);\n        tolua_function(tolua_S,\"setSkin\",lua_cocos2dx_spine_Skeleton_setSkin);\n        tolua_function(tolua_S,\"setBonesToSetupPose\",lua_cocos2dx_spine_Skeleton_setBonesToSetupPose);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(spine::Skeleton).name();\n    g_luaType[typeName] = \"sp.Skeleton\";\n    g_typeCast[\"Skeleton\"] = \"sp.Skeleton\";\n    return 1;\n}\n\nint lua_cocos2dx_spine_SkeletonAnimation_addAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::SkeletonAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_addAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        const char* arg1;\n        bool arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        spTrackEntry* ret = cobj->addAnimation(arg0, arg1, arg2);\n        #pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n        return 1;\n    }\n    if (argc == 4) \n    {\n        int arg0;\n        const char* arg1;\n        bool arg2;\n        double arg3;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n\n        ok &= luaval_to_number(tolua_S, 5,&arg3);\n        if(!ok)\n            return 0;\n        spTrackEntry* ret = cobj->addAnimation(arg0, arg1, arg2, arg3);\n        #pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addAnimation\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_addAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_SkeletonAnimation_getCurrent(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::SkeletonAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_getCurrent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        spTrackEntry* ret = cobj->getCurrent();\n        #pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n        return 1;\n    }\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        spTrackEntry* ret = cobj->getCurrent(arg0);\n        #pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrent\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_getCurrent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_SkeletonAnimation_setMix(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::SkeletonAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_setMix'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        const char* arg0;\n        const char* arg1;\n        double arg2;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        ok &= luaval_to_number(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->setMix(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setMix\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_setMix'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_SkeletonAnimation_setAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::SkeletonAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_setAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3) \n    {\n        int arg0;\n        const char* arg1;\n        bool arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        spTrackEntry* ret = cobj->setAnimation(arg0, arg1, arg2);\n        #pragma warning NO CONVERSION FROM NATIVE FOR spTrackEntry*;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimation\",argc, 3);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_setAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_SkeletonAnimation_clearTracks(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::SkeletonAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_clearTracks'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->clearTracks();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clearTracks\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_clearTracks'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_SkeletonAnimation_clearTrack(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::SkeletonAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_clearTrack'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->clearTrack();\n        return 0;\n    }\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->clearTrack(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"clearTrack\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_clearTrack'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent(lua_State* tolua_S)\n{\n    int argc = 0;\n    spine::SkeletonAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 4) \n    {\n        int arg0;\n        spEventType arg1;\n        spEvent* arg2;\n        int arg3;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        #pragma warning NO CONVERSION TO NATIVE FOR spEvent*;\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n        if(!ok)\n            return 0;\n        cobj->onAnimationStateEvent(arg0, arg1, arg2, arg3);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"onAnimationStateEvent\",argc, 4);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nstatic int lua_cocos2dx_spine_SkeletonAnimation_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SkeletonAnimation)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_spine_SkeletonAnimation(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"sp.SkeletonAnimation\");\n    tolua_cclass(tolua_S,\"SkeletonAnimation\",\"sp.SkeletonAnimation\",\"sp.Skeleton\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SkeletonAnimation\");\n        tolua_function(tolua_S,\"addAnimation\",lua_cocos2dx_spine_SkeletonAnimation_addAnimation);\n        tolua_function(tolua_S,\"getCurrent\",lua_cocos2dx_spine_SkeletonAnimation_getCurrent);\n        tolua_function(tolua_S,\"setMix\",lua_cocos2dx_spine_SkeletonAnimation_setMix);\n        tolua_function(tolua_S,\"setAnimation\",lua_cocos2dx_spine_SkeletonAnimation_setAnimation);\n        tolua_function(tolua_S,\"clearTracks\",lua_cocos2dx_spine_SkeletonAnimation_clearTracks);\n        tolua_function(tolua_S,\"clearTrack\",lua_cocos2dx_spine_SkeletonAnimation_clearTrack);\n        tolua_function(tolua_S,\"onAnimationStateEvent\",lua_cocos2dx_spine_SkeletonAnimation_onAnimationStateEvent);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(spine::SkeletonAnimation).name();\n    g_luaType[typeName] = \"sp.SkeletonAnimation\";\n    g_typeCast[\"SkeletonAnimation\"] = \"sp.SkeletonAnimation\";\n    return 1;\n}\nTOLUA_API int register_all_cocos2dx_spine(lua_State* tolua_S)\n{\n\ttolua_open(tolua_S);\n\t\n\ttolua_module(tolua_S,\"sp\",0);\n\ttolua_beginmodule(tolua_S,\"sp\");\n\n\tlua_register_cocos2dx_spine_Skeleton(tolua_S);\n\tlua_register_cocos2dx_spine_SkeletonAnimation(tolua_S);\n\n\ttolua_endmodule(tolua_S);\n\treturn 1;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_spine_auto.hpp",
    "content": "#ifndef __cocos2dx_spine_h__\n#define __cocos2dx_spine_h__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\nint register_all_cocos2dx_spine(lua_State* tolua_S);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#endif // __cocos2dx_spine_h__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_spine_auto_api.js",
    "content": "/**\n * @module cocos2dx_spine\n */\nvar sp = sp || {};\n\n/**\n * @class Skeleton\n */\nsp.Skeleton = {\n\n/**\n * @method setToSetupPose\n */\nsetToSetupPose : function () {},\n\n/**\n * @method setBlendFunc\n * @param {const cocos2d::BlendFunc&}\n */\nsetBlendFunc : function () {},\n\n/**\n * @method onDraw\n */\nonDraw : function () {},\n\n/**\n * @method setSlotsToSetupPose\n */\nsetSlotsToSetupPose : function () {},\n\n/**\n * @method getBlendFunc\n * @return A value converted from C/C++ \"const cocos2d::BlendFunc&\"\n */\ngetBlendFunc : function () {},\n\n/**\n * @method setSkin\n * @return A value converted from C/C++ \"bool\"\n * @param {const char*}\n */\nsetSkin : function () {},\n\n/**\n * @method setBonesToSetupPose\n */\nsetBonesToSetupPose : function () {},\n\n};\n\n/**\n * @class SkeletonAnimation\n */\nsp.SkeletonAnimation = {\n\n/**\n * @method addAnimation\n * @return A value converted from C/C++ \"spTrackEntry*\"\n * @param {int}\n * @param {const char*}\n * @param {bool}\n * @param {float}\n */\naddAnimation : function () {},\n\n/**\n * @method getCurrent\n * @return A value converted from C/C++ \"spTrackEntry*\"\n */\ngetCurrent : function () {},\n\n/**\n * @method setMix\n * @param {const char*}\n * @param {const char*}\n * @param {float}\n */\nsetMix : function () {},\n\n/**\n * @method setAnimation\n * @return A value converted from C/C++ \"spTrackEntry*\"\n * @param {int}\n * @param {const char*}\n * @param {bool}\n */\nsetAnimation : function () {},\n\n/**\n * @method clearTracks\n */\nclearTracks : function () {},\n\n/**\n * @method clearTrack\n */\nclearTrack : function () {},\n\n/**\n * @method onAnimationStateEvent\n * @param {int}\n * @param {spEventType}\n * @param {spEvent*}\n * @param {int}\n */\nonAnimationStateEvent : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp",
    "content": "#include \"lua_cocos2dx_studio_auto.hpp\"\n#include \"CocoStudio.h\"\n#include \"tolua_fix.h\"\n#include \"LuaBasicConversions.h\"\n\n\n\nint lua_cocos2dx_studio_ActionObject_setCurrentTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_setCurrentTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setCurrentTime(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setCurrentTime\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_setCurrentTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_pause(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_pause'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pause();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pause\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_pause'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_setName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_setName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_setName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_setUnitTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_setUnitTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setUnitTime(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setUnitTime\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_setUnitTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_getTotalTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_getTotalTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getTotalTime();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTotalTime\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_getTotalTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_getName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_getName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getName();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_getName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_stop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_stop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stop();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_stop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_play(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_play'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            cocos2d::CallFunc* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.CallFunc\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::CallFunc*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cobj->play(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cobj->play();\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"play\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_play'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_getCurrentTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_getCurrentTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getCurrentTime();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentTime\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_getCurrentTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_removeActionNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_removeActionNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::ActionNode* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.ActionNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::ActionNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->removeActionNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeActionNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_removeActionNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_getLoop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_getLoop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getLoop();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getLoop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_getLoop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_addActionNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_addActionNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::ActionNode* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.ActionNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::ActionNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addActionNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addActionNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_addActionNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_getUnitTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_getUnitTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getUnitTime();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getUnitTime\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_getUnitTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_isPlaying(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_isPlaying'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isPlaying();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isPlaying\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_isPlaying'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_updateToFrameByTime(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_updateToFrameByTime'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->updateToFrameByTime(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateToFrameByTime\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_updateToFrameByTime'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_setLoop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_setLoop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLoop(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLoop\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_setLoop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_simulationActionUpdate(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionObject\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionObject*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionObject_simulationActionUpdate'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->simulationActionUpdate(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"simulationActionUpdate\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_simulationActionUpdate'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionObject_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionObject* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::ActionObject();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.ActionObject\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.ActionObject\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ActionObject\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionObject_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_ActionObject_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionObject)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ActionObject(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ActionObject\");\n    tolua_cclass(tolua_S,\"ActionObject\",\"ccs.ActionObject\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionObject\");\n        tolua_function(tolua_S,\"setCurrentTime\",lua_cocos2dx_studio_ActionObject_setCurrentTime);\n        tolua_function(tolua_S,\"pause\",lua_cocos2dx_studio_ActionObject_pause);\n        tolua_function(tolua_S,\"setName\",lua_cocos2dx_studio_ActionObject_setName);\n        tolua_function(tolua_S,\"setUnitTime\",lua_cocos2dx_studio_ActionObject_setUnitTime);\n        tolua_function(tolua_S,\"getTotalTime\",lua_cocos2dx_studio_ActionObject_getTotalTime);\n        tolua_function(tolua_S,\"getName\",lua_cocos2dx_studio_ActionObject_getName);\n        tolua_function(tolua_S,\"stop\",lua_cocos2dx_studio_ActionObject_stop);\n        tolua_function(tolua_S,\"play\",lua_cocos2dx_studio_ActionObject_play);\n        tolua_function(tolua_S,\"getCurrentTime\",lua_cocos2dx_studio_ActionObject_getCurrentTime);\n        tolua_function(tolua_S,\"removeActionNode\",lua_cocos2dx_studio_ActionObject_removeActionNode);\n        tolua_function(tolua_S,\"getLoop\",lua_cocos2dx_studio_ActionObject_getLoop);\n        tolua_function(tolua_S,\"addActionNode\",lua_cocos2dx_studio_ActionObject_addActionNode);\n        tolua_function(tolua_S,\"getUnitTime\",lua_cocos2dx_studio_ActionObject_getUnitTime);\n        tolua_function(tolua_S,\"isPlaying\",lua_cocos2dx_studio_ActionObject_isPlaying);\n        tolua_function(tolua_S,\"updateToFrameByTime\",lua_cocos2dx_studio_ActionObject_updateToFrameByTime);\n        tolua_function(tolua_S,\"setLoop\",lua_cocos2dx_studio_ActionObject_setLoop);\n        tolua_function(tolua_S,\"simulationActionUpdate\",lua_cocos2dx_studio_ActionObject_simulationActionUpdate);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_ActionObject_constructor);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ActionObject).name();\n    g_luaType[typeName] = \"ccs.ActionObject\";\n    g_typeCast[\"ActionObject\"] = \"ccs.ActionObject\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ActionManagerEx_playActionByName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionManagerEx* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionManagerEx\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::ActionManagerEx*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionManagerEx_playActionByName'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 3) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n            if (!ok) { break; }\n            cocos2d::CallFunc* arg2;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,4,\"cc.CallFunc\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ2 = (cocos2d::CallFunc*)tolua_tousertype(tolua_S,4,0);\n\t\t\t\t\tif (nullptr == arg2){\n\t\t\t\t\t\tLUA_PRECONDITION( arg2, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            cocostudio::ActionObject* ret = cobj->playActionByName(arg0, arg1, arg2);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ActionObject\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ActionObject*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n            if (!ok) { break; }\n            cocostudio::ActionObject* ret = cobj->playActionByName(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ActionObject\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ActionObject*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playActionByName\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionManagerEx_playActionByName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionManagerEx_getActionByName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionManagerEx* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionManagerEx\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionManagerEx*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionManagerEx_getActionByName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        const char* arg0;\n        const char* arg1;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        if(!ok)\n            return 0;\n        cocostudio::ActionObject* ret = cobj->getActionByName(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ActionObject\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ActionObject*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getActionByName\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionManagerEx_getActionByName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionManagerEx_releaseActions(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ActionManagerEx* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ActionManagerEx\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ActionManagerEx*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionManagerEx_releaseActions'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->releaseActions();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"releaseActions\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionManagerEx_releaseActions'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ActionManagerEx_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ActionManagerEx\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ActionManagerEx::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionManagerEx_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ActionManagerEx_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ActionManagerEx\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ActionManagerEx* ret = cocostudio::ActionManagerEx::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ActionManagerEx\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ActionManagerEx*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ActionManagerEx_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_ActionManagerEx_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ActionManagerEx)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ActionManagerEx(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ActionManagerEx\");\n    tolua_cclass(tolua_S,\"ActionManagerEx\",\"ccs.ActionManagerEx\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ActionManagerEx\");\n        tolua_function(tolua_S,\"playActionByName\",lua_cocos2dx_studio_ActionManagerEx_playActionByName);\n        tolua_function(tolua_S,\"getActionByName\",lua_cocos2dx_studio_ActionManagerEx_getActionByName);\n        tolua_function(tolua_S,\"releaseActions\",lua_cocos2dx_studio_ActionManagerEx_releaseActions);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_studio_ActionManagerEx_destroyInstance);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_studio_ActionManagerEx_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ActionManagerEx).name();\n    g_luaType[typeName] = \"ccs.ActionManagerEx\";\n    g_typeCast[\"ActionManagerEx\"] = \"ccs.ActionManagerEx\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_BaseData_getColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BaseData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.BaseData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::BaseData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_BaseData_getColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Color4B ret = cobj->getColor();\n        color4b_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BaseData_getColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_BaseData_setColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BaseData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.BaseData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::BaseData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_BaseData_setColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Color4B arg0;\n\n        ok &=luaval_to_color4b(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->setColor(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setColor\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BaseData_setColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_BaseData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.BaseData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::BaseData* ret = cocostudio::BaseData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.BaseData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::BaseData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BaseData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_BaseData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BaseData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::BaseData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.BaseData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.BaseData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"BaseData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BaseData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_BaseData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (BaseData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_BaseData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.BaseData\");\n    tolua_cclass(tolua_S,\"BaseData\",\"ccs.BaseData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"BaseData\");\n        tolua_function(tolua_S,\"getColor\",lua_cocos2dx_studio_BaseData_getColor);\n        tolua_function(tolua_S,\"setColor\",lua_cocos2dx_studio_BaseData_setColor);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_BaseData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_BaseData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::BaseData).name();\n    g_luaType[typeName] = \"ccs.BaseData\";\n    g_typeCast[\"BaseData\"] = \"ccs.BaseData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_DisplayData_copy(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayData_copy'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::DisplayData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.DisplayData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::DisplayData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->copy(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"copy\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayData_copy'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayData_changeDisplayToTexture(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.DisplayData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        const std::string ret = cocostudio::DisplayData::changeDisplayToTexture(arg0);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"changeDisplayToTexture\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayData_changeDisplayToTexture'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.DisplayData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::DisplayData* ret = cocostudio::DisplayData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.DisplayData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::DisplayData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::DisplayData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.DisplayData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.DisplayData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"DisplayData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_DisplayData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (DisplayData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_DisplayData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.DisplayData\");\n    tolua_cclass(tolua_S,\"DisplayData\",\"ccs.DisplayData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"DisplayData\");\n        tolua_function(tolua_S,\"copy\",lua_cocos2dx_studio_DisplayData_copy);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_DisplayData_constructor);\n        tolua_function(tolua_S,\"changeDisplayToTexture\", lua_cocos2dx_studio_DisplayData_changeDisplayToTexture);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_DisplayData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::DisplayData).name();\n    g_luaType[typeName] = \"ccs.DisplayData\";\n    g_typeCast[\"DisplayData\"] = \"ccs.DisplayData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_SpriteDisplayData_copy(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::SpriteDisplayData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.SpriteDisplayData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::SpriteDisplayData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_SpriteDisplayData_copy'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::DisplayData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.DisplayData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::DisplayData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->copy(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"copy\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SpriteDisplayData_copy'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_SpriteDisplayData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.SpriteDisplayData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::SpriteDisplayData* ret = cocostudio::SpriteDisplayData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.SpriteDisplayData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::SpriteDisplayData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SpriteDisplayData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_SpriteDisplayData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::SpriteDisplayData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::SpriteDisplayData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.SpriteDisplayData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.SpriteDisplayData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"SpriteDisplayData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SpriteDisplayData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_SpriteDisplayData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SpriteDisplayData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_SpriteDisplayData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.SpriteDisplayData\");\n    tolua_cclass(tolua_S,\"SpriteDisplayData\",\"ccs.SpriteDisplayData\",\"ccs.DisplayData\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SpriteDisplayData\");\n        tolua_function(tolua_S,\"copy\",lua_cocos2dx_studio_SpriteDisplayData_copy);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_SpriteDisplayData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_SpriteDisplayData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::SpriteDisplayData).name();\n    g_luaType[typeName] = \"ccs.SpriteDisplayData\";\n    g_typeCast[\"SpriteDisplayData\"] = \"ccs.SpriteDisplayData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ArmatureDisplayData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ArmatureDisplayData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureDisplayData* ret = cocostudio::ArmatureDisplayData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureDisplayData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureDisplayData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDisplayData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDisplayData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDisplayData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::ArmatureDisplayData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.ArmatureDisplayData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.ArmatureDisplayData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ArmatureDisplayData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDisplayData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_ArmatureDisplayData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ArmatureDisplayData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ArmatureDisplayData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ArmatureDisplayData\");\n    tolua_cclass(tolua_S,\"ArmatureDisplayData\",\"ccs.ArmatureDisplayData\",\"ccs.DisplayData\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ArmatureDisplayData\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ArmatureDisplayData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ArmatureDisplayData).name();\n    g_luaType[typeName] = \"ccs.ArmatureDisplayData\";\n    g_typeCast[\"ArmatureDisplayData\"] = \"ccs.ArmatureDisplayData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ParticleDisplayData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ParticleDisplayData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ParticleDisplayData* ret = cocostudio::ParticleDisplayData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ParticleDisplayData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ParticleDisplayData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ParticleDisplayData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ParticleDisplayData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ParticleDisplayData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::ParticleDisplayData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.ParticleDisplayData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.ParticleDisplayData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ParticleDisplayData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ParticleDisplayData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_ParticleDisplayData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ParticleDisplayData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ParticleDisplayData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ParticleDisplayData\");\n    tolua_cclass(tolua_S,\"ParticleDisplayData\",\"ccs.ParticleDisplayData\",\"ccs.DisplayData\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ParticleDisplayData\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ParticleDisplayData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ParticleDisplayData).name();\n    g_luaType[typeName] = \"ccs.ParticleDisplayData\";\n    g_typeCast[\"ParticleDisplayData\"] = \"ccs.ParticleDisplayData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_BoneData_getDisplayData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.BoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::BoneData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_BoneData_getDisplayData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::DisplayData* ret = cobj->getDisplayData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.DisplayData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::DisplayData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BoneData_getDisplayData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_BoneData_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.BoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::BoneData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_BoneData_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BoneData_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_BoneData_addDisplayData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.BoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::BoneData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_BoneData_addDisplayData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::DisplayData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.DisplayData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::DisplayData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addDisplayData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDisplayData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BoneData_addDisplayData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_BoneData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.BoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::BoneData* ret = cocostudio::BoneData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.BoneData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::BoneData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BoneData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_BoneData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::BoneData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.BoneData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.BoneData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"BoneData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BoneData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_BoneData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (BoneData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_BoneData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.BoneData\");\n    tolua_cclass(tolua_S,\"BoneData\",\"ccs.BoneData\",\"ccs.BaseData\",NULL);\n\n    tolua_beginmodule(tolua_S,\"BoneData\");\n        tolua_function(tolua_S,\"getDisplayData\",lua_cocos2dx_studio_BoneData_getDisplayData);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_BoneData_init);\n        tolua_function(tolua_S,\"addDisplayData\",lua_cocos2dx_studio_BoneData_addDisplayData);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_BoneData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_BoneData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::BoneData).name();\n    g_luaType[typeName] = \"ccs.BoneData\";\n    g_typeCast[\"BoneData\"] = \"ccs.BoneData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ArmatureData_addBoneData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureData_addBoneData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::BoneData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.BoneData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::BoneData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addBoneData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addBoneData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureData_addBoneData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureData_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureData_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureData_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureData_getBoneData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureData_getBoneData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::BoneData* ret = cobj->getBoneData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.BoneData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::BoneData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBoneData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureData_getBoneData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ArmatureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureData* ret = cocostudio::ArmatureData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::ArmatureData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.ArmatureData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.ArmatureData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ArmatureData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_ArmatureData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ArmatureData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ArmatureData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ArmatureData\");\n    tolua_cclass(tolua_S,\"ArmatureData\",\"ccs.ArmatureData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ArmatureData\");\n        tolua_function(tolua_S,\"addBoneData\",lua_cocos2dx_studio_ArmatureData_addBoneData);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_ArmatureData_init);\n        tolua_function(tolua_S,\"getBoneData\",lua_cocos2dx_studio_ArmatureData_getBoneData);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_ArmatureData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ArmatureData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ArmatureData).name();\n    g_luaType[typeName] = \"ccs.ArmatureData\";\n    g_typeCast[\"ArmatureData\"] = \"ccs.ArmatureData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_FrameData_copy(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::FrameData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.FrameData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::FrameData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_FrameData_copy'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const cocostudio::BaseData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.BaseData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (const cocostudio::BaseData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->copy(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"copy\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_FrameData_copy'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_FrameData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.FrameData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::FrameData* ret = cocostudio::FrameData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.FrameData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::FrameData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_FrameData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_FrameData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::FrameData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::FrameData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.FrameData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.FrameData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"FrameData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_FrameData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_FrameData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (FrameData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_FrameData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.FrameData\");\n    tolua_cclass(tolua_S,\"FrameData\",\"ccs.FrameData\",\"ccs.BaseData\",NULL);\n\n    tolua_beginmodule(tolua_S,\"FrameData\");\n        tolua_function(tolua_S,\"copy\",lua_cocos2dx_studio_FrameData_copy);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_FrameData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_FrameData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::FrameData).name();\n    g_luaType[typeName] = \"ccs.FrameData\";\n    g_typeCast[\"FrameData\"] = \"ccs.FrameData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_MovementBoneData_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::MovementBoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.MovementBoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::MovementBoneData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_MovementBoneData_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementBoneData_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_MovementBoneData_getFrameData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::MovementBoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.MovementBoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::MovementBoneData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_MovementBoneData_getFrameData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::FrameData* ret = cobj->getFrameData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.FrameData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::FrameData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFrameData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementBoneData_getFrameData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_MovementBoneData_addFrameData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::MovementBoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.MovementBoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::MovementBoneData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_MovementBoneData_addFrameData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::FrameData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.FrameData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::FrameData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addFrameData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addFrameData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementBoneData_addFrameData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_MovementBoneData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.MovementBoneData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::MovementBoneData* ret = cocostudio::MovementBoneData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.MovementBoneData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::MovementBoneData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementBoneData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_MovementBoneData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::MovementBoneData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::MovementBoneData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.MovementBoneData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.MovementBoneData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"MovementBoneData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementBoneData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_MovementBoneData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MovementBoneData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_MovementBoneData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.MovementBoneData\");\n    tolua_cclass(tolua_S,\"MovementBoneData\",\"ccs.MovementBoneData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MovementBoneData\");\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_MovementBoneData_init);\n        tolua_function(tolua_S,\"getFrameData\",lua_cocos2dx_studio_MovementBoneData_getFrameData);\n        tolua_function(tolua_S,\"addFrameData\",lua_cocos2dx_studio_MovementBoneData_addFrameData);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_MovementBoneData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_MovementBoneData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::MovementBoneData).name();\n    g_luaType[typeName] = \"ccs.MovementBoneData\";\n    g_typeCast[\"MovementBoneData\"] = \"ccs.MovementBoneData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_MovementData_getMovementBoneData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::MovementData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.MovementData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::MovementData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_MovementData_getMovementBoneData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::MovementBoneData* ret = cobj->getMovementBoneData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.MovementBoneData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::MovementBoneData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMovementBoneData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementData_getMovementBoneData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_MovementData_addMovementBoneData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::MovementData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.MovementData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::MovementData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_MovementData_addMovementBoneData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::MovementBoneData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.MovementBoneData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::MovementBoneData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addMovementBoneData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addMovementBoneData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementData_addMovementBoneData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_MovementData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.MovementData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::MovementData* ret = cocostudio::MovementData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.MovementData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::MovementData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_MovementData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::MovementData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::MovementData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.MovementData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.MovementData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"MovementData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_MovementData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_MovementData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (MovementData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_MovementData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.MovementData\");\n    tolua_cclass(tolua_S,\"MovementData\",\"ccs.MovementData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"MovementData\");\n        tolua_function(tolua_S,\"getMovementBoneData\",lua_cocos2dx_studio_MovementData_getMovementBoneData);\n        tolua_function(tolua_S,\"addMovementBoneData\",lua_cocos2dx_studio_MovementData_addMovementBoneData);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_MovementData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_MovementData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::MovementData).name();\n    g_luaType[typeName] = \"ccs.MovementData\";\n    g_typeCast[\"MovementData\"] = \"ccs.MovementData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_AnimationData_getMovement(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::AnimationData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.AnimationData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::AnimationData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_AnimationData_getMovement'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::MovementData* ret = cobj->getMovement(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.MovementData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::MovementData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMovement\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_AnimationData_getMovement'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_AnimationData_getMovementCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::AnimationData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.AnimationData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::AnimationData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_AnimationData_getMovementCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getMovementCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMovementCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_AnimationData_getMovementCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_AnimationData_addMovement(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::AnimationData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.AnimationData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::AnimationData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_AnimationData_addMovement'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::MovementData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.MovementData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::MovementData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addMovement(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addMovement\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_AnimationData_addMovement'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_AnimationData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.AnimationData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::AnimationData* ret = cocostudio::AnimationData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.AnimationData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::AnimationData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_AnimationData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_AnimationData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::AnimationData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::AnimationData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.AnimationData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.AnimationData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"AnimationData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_AnimationData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_AnimationData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (AnimationData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_AnimationData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.AnimationData\");\n    tolua_cclass(tolua_S,\"AnimationData\",\"ccs.AnimationData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"AnimationData\");\n        tolua_function(tolua_S,\"getMovement\",lua_cocos2dx_studio_AnimationData_getMovement);\n        tolua_function(tolua_S,\"getMovementCount\",lua_cocos2dx_studio_AnimationData_getMovementCount);\n        tolua_function(tolua_S,\"addMovement\",lua_cocos2dx_studio_AnimationData_addMovement);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_AnimationData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_AnimationData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::AnimationData).name();\n    g_luaType[typeName] = \"ccs.AnimationData\";\n    g_typeCast[\"AnimationData\"] = \"ccs.AnimationData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ContourData_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ContourData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ContourData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ContourData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ContourData_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ContourData_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ContourData_addVertex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ContourData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ContourData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ContourData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ContourData_addVertex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Point arg0;\n\n        ok &= luaval_to_point(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->addVertex(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addVertex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ContourData_addVertex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ContourData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ContourData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ContourData* ret = cocostudio::ContourData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ContourData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ContourData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ContourData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ContourData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ContourData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::ContourData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.ContourData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.ContourData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ContourData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ContourData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_ContourData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ContourData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ContourData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ContourData\");\n    tolua_cclass(tolua_S,\"ContourData\",\"ccs.ContourData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ContourData\");\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_ContourData_init);\n        tolua_function(tolua_S,\"addVertex\",lua_cocos2dx_studio_ContourData_addVertex);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_ContourData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ContourData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ContourData).name();\n    g_luaType[typeName] = \"ccs.ContourData\";\n    g_typeCast[\"ContourData\"] = \"ccs.ContourData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_TextureData_getContourData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::TextureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.TextureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::TextureData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_TextureData_getContourData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::ContourData* ret = cobj->getContourData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ContourData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ContourData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContourData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_TextureData_getContourData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_TextureData_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::TextureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.TextureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::TextureData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_TextureData_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_TextureData_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_TextureData_addContourData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::TextureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.TextureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::TextureData*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_TextureData_addContourData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::ContourData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.ContourData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::ContourData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addContourData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addContourData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_TextureData_addContourData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_TextureData_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.TextureData\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::TextureData* ret = cocostudio::TextureData::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.TextureData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::TextureData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_TextureData_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_TextureData_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::TextureData* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::TextureData();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.TextureData\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.TextureData\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"TextureData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_TextureData_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_TextureData_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (TextureData)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_TextureData(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.TextureData\");\n    tolua_cclass(tolua_S,\"TextureData\",\"ccs.TextureData\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"TextureData\");\n        tolua_function(tolua_S,\"getContourData\",lua_cocos2dx_studio_TextureData_getContourData);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_TextureData_init);\n        tolua_function(tolua_S,\"addContourData\",lua_cocos2dx_studio_TextureData_addContourData);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_TextureData_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_TextureData_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::TextureData).name();\n    g_luaType[typeName] = \"ccs.TextureData\";\n    g_typeCast[\"TextureData\"] = \"ccs.TextureData\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_Tween_getAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Tween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Tween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Tween*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Tween_getAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureAnimation* ret = cobj->getAnimation();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureAnimation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureAnimation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_getAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Tween_gotoAndPause(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Tween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Tween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Tween*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Tween_gotoAndPause'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->gotoAndPause(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"gotoAndPause\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_gotoAndPause'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Tween_play(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Tween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Tween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Tween*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Tween_play'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 5) \n    {\n        cocostudio::MovementBoneData* arg0;\n        int arg1;\n        int arg2;\n        int arg3;\n        int arg4;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.MovementBoneData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::MovementBoneData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n\n        ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3);\n\n        ok &= luaval_to_int32(tolua_S, 6,(int *)&arg4);\n        if(!ok)\n            return 0;\n        cobj->play(arg0, arg1, arg2, arg3, arg4);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"play\",argc, 5);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_play'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Tween_gotoAndPlay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Tween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Tween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Tween*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Tween_gotoAndPlay'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->gotoAndPlay(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"gotoAndPlay\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_gotoAndPlay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Tween_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Tween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Tween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Tween*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Tween_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Bone* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->init(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Tween_setAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Tween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Tween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Tween*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Tween_setAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::ArmatureAnimation* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.ArmatureAnimation\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setAnimation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_setAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Tween_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.Tween\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocostudio::Bone* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocostudio::Tween* ret = cocostudio::Tween::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Tween\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Tween*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_Tween_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Tween* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::Tween();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.Tween\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.Tween\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Tween\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Tween_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_Tween_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Tween)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_Tween(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.Tween\");\n    tolua_cclass(tolua_S,\"Tween\",\"ccs.Tween\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Tween\");\n        tolua_function(tolua_S,\"getAnimation\",lua_cocos2dx_studio_Tween_getAnimation);\n        tolua_function(tolua_S,\"gotoAndPause\",lua_cocos2dx_studio_Tween_gotoAndPause);\n        tolua_function(tolua_S,\"play\",lua_cocos2dx_studio_Tween_play);\n        tolua_function(tolua_S,\"gotoAndPlay\",lua_cocos2dx_studio_Tween_gotoAndPlay);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_Tween_init);\n        tolua_function(tolua_S,\"setAnimation\",lua_cocos2dx_studio_Tween_setAnimation);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_Tween_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_Tween_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::Tween).name();\n    g_luaType[typeName] = \"ccs.Tween\";\n    g_typeCast[\"Tween\"] = \"ccs.Tween\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_DisplayManager_getDisplayRenderNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getDisplayRenderNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getDisplayRenderNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayRenderNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getDisplayRenderNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_getAnchorPointInPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getAnchorPointInPoints'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getAnchorPointInPoints();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchorPointInPoints\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getAnchorPointInPoints'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getDisplayRenderNodeType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayRenderNodeType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_removeDisplay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_removeDisplay'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeDisplay(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeDisplay\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_removeDisplay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_setForceChangeDisplay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_setForceChangeDisplay'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setForceChangeDisplay(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setForceChangeDisplay\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_setForceChangeDisplay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Bone* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->init(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_getContentSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getContentSize'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Size ret = cobj->getContentSize();\n        size_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getContentSize\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getContentSize'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_getBoundingBox(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getBoundingBox'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Rect ret = cobj->getBoundingBox();\n        rect_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBoundingBox\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getBoundingBox'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_addDisplay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_addDisplay'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cobj->addDisplay(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            cocostudio::DisplayData* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.DisplayData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::DisplayData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cobj->addDisplay(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDisplay\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_addDisplay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_containPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_containPoint'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            double arg0;\n            ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            double arg1;\n            ok &= luaval_to_number(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            bool ret = cobj->containPoint(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            cocos2d::Point arg0;\n            ok &= luaval_to_point(tolua_S, 2, &arg0);\n\n            if (!ok) { break; }\n            bool ret = cobj->containPoint(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"containPoint\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_containPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_changeDisplayWithIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_changeDisplayWithIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        bool arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->changeDisplayWithIndex(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeDisplayWithIndex\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_changeDisplayWithIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_changeDisplayWithName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_changeDisplayWithName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        bool arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->changeDisplayWithName(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeDisplayWithName\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_changeDisplayWithName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_isForceChangeDisplay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_isForceChangeDisplay'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isForceChangeDisplay();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isForceChangeDisplay\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_isForceChangeDisplay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = cobj->getCurrentDisplayIndex();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentDisplayIndex\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_getAnchorPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getAnchorPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Point ret = cobj->getAnchorPoint();\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnchorPoint\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getAnchorPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_getDecorativeDisplayList(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_getDecorativeDisplayList'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Vector<cocostudio::DecorativeDisplay *>& ret = cobj->getDecorativeDisplayList();\n        ccvector_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDecorativeDisplayList\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_getDecorativeDisplayList'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_isVisible(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_isVisible'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isVisible();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isVisible\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_isVisible'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_setVisible(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::DisplayManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_DisplayManager_setVisible'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setVisible(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVisible\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_setVisible'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.DisplayManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocostudio::Bone* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocostudio::DisplayManager* ret = cocostudio::DisplayManager::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.DisplayManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::DisplayManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_DisplayManager_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::DisplayManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::DisplayManager();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.DisplayManager\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.DisplayManager\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"DisplayManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_DisplayManager_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_DisplayManager_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (DisplayManager)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_DisplayManager(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.DisplayManager\");\n    tolua_cclass(tolua_S,\"DisplayManager\",\"ccs.DisplayManager\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"DisplayManager\");\n        tolua_function(tolua_S,\"getDisplayRenderNode\",lua_cocos2dx_studio_DisplayManager_getDisplayRenderNode);\n        tolua_function(tolua_S,\"getAnchorPointInPoints\",lua_cocos2dx_studio_DisplayManager_getAnchorPointInPoints);\n        tolua_function(tolua_S,\"getDisplayRenderNodeType\",lua_cocos2dx_studio_DisplayManager_getDisplayRenderNodeType);\n        tolua_function(tolua_S,\"removeDisplay\",lua_cocos2dx_studio_DisplayManager_removeDisplay);\n        tolua_function(tolua_S,\"setForceChangeDisplay\",lua_cocos2dx_studio_DisplayManager_setForceChangeDisplay);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_DisplayManager_init);\n        tolua_function(tolua_S,\"getContentSize\",lua_cocos2dx_studio_DisplayManager_getContentSize);\n        tolua_function(tolua_S,\"getBoundingBox\",lua_cocos2dx_studio_DisplayManager_getBoundingBox);\n        tolua_function(tolua_S,\"addDisplay\",lua_cocos2dx_studio_DisplayManager_addDisplay);\n        tolua_function(tolua_S,\"containPoint\",lua_cocos2dx_studio_DisplayManager_containPoint);\n        tolua_function(tolua_S,\"changeDisplayWithIndex\",lua_cocos2dx_studio_DisplayManager_changeDisplayWithIndex);\n        tolua_function(tolua_S,\"changeDisplayWithName\",lua_cocos2dx_studio_DisplayManager_changeDisplayWithName);\n        tolua_function(tolua_S,\"isForceChangeDisplay\",lua_cocos2dx_studio_DisplayManager_isForceChangeDisplay);\n        tolua_function(tolua_S,\"getCurrentDisplayIndex\",lua_cocos2dx_studio_DisplayManager_getCurrentDisplayIndex);\n        tolua_function(tolua_S,\"getAnchorPoint\",lua_cocos2dx_studio_DisplayManager_getAnchorPoint);\n        tolua_function(tolua_S,\"getDecorativeDisplayList\",lua_cocos2dx_studio_DisplayManager_getDecorativeDisplayList);\n        tolua_function(tolua_S,\"isVisible\",lua_cocos2dx_studio_DisplayManager_isVisible);\n        tolua_function(tolua_S,\"setVisible\",lua_cocos2dx_studio_DisplayManager_setVisible);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_DisplayManager_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_DisplayManager_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::DisplayManager).name();\n    g_luaType[typeName] = \"ccs.DisplayManager\";\n    g_typeCast[\"DisplayManager\"] = \"ccs.DisplayManager\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_Bone_isTransformDirty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_isTransformDirty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isTransformDirty();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isTransformDirty\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_isTransformDirty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_isIgnoreMovementBoneData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_isIgnoreMovementBoneData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isIgnoreMovementBoneData();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isIgnoreMovementBoneData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_isIgnoreMovementBoneData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_updateZOrder(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_updateZOrder'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateZOrder();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateZOrder\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_updateZOrder'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getDisplayRenderNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getDisplayRenderNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getDisplayRenderNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayRenderNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getDisplayRenderNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_isBlendDirty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_isBlendDirty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBlendDirty();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBlendDirty\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_isBlendDirty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_addChildBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_addChildBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Bone* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addChildBone(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addChildBone\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_addChildBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getWorldInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getWorldInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::BaseData* ret = cobj->getWorldInfo();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.BaseData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::BaseData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getWorldInfo\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getWorldInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getTween(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getTween'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::Tween* ret = cobj->getTween();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Tween\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Tween*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTween\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getTween'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getParentBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getParentBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::Bone* ret = cobj->getParentBone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Bone\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Bone*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParentBone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getParentBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_updateColor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_updateColor'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateColor();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateColor\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_updateColor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string ret = cobj->getName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_setTransformDirty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_setTransformDirty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setTransformDirty(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTransformDirty\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_setTransformDirty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getDisplayRenderNodeType(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getDisplayRenderNodeType'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        int ret = (int)cobj->getDisplayRenderNodeType();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayRenderNodeType\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getDisplayRenderNodeType'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_removeDisplay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_removeDisplay'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeDisplay(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeDisplay\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_removeDisplay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_setBoneData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_setBoneData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::BoneData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.BoneData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::BoneData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBoneData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBoneData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_setBoneData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_init'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            bool ret = cobj->init(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            bool ret = cobj->init();\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_setParentBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_setParentBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Bone* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setParentBone(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setParentBone\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_setParentBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_addDisplay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_addDisplay'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 2) {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cobj->addDisplay(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            cocostudio::DisplayData* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.DisplayData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::DisplayData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            int arg1;\n            ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n            if (!ok) { break; }\n            cobj->addDisplay(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addDisplay\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_addDisplay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_setName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_setName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_setName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_removeFromParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_removeFromParent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeFromParent(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeFromParent\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_removeFromParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getColliderDetector(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getColliderDetector'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::ColliderDetector* ret = cobj->getColliderDetector();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ColliderDetector\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ColliderDetector*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getColliderDetector\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getColliderDetector'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getChildArmature(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getChildArmature'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::Armature* ret = cobj->getChildArmature();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Armature\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Armature*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getChildArmature\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getChildArmature'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getTweenData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getTweenData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::FrameData* ret = cobj->getTweenData();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.FrameData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::FrameData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTweenData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getTweenData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_changeDisplayWithIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_changeDisplayWithIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        int arg0;\n        bool arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->changeDisplayWithIndex(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeDisplayWithIndex\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_changeDisplayWithIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_changeDisplayWithName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_changeDisplayWithName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        bool arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->changeDisplayWithName(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeDisplayWithName\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_changeDisplayWithName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_setArmature(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_setArmature'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Armature* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Armature\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Armature*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setArmature(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setArmature\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_setArmature'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_setBlendDirty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_setBlendDirty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBlendDirty(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBlendDirty\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_setBlendDirty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_removeChildBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_removeChildBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocostudio::Bone* arg0;\n        bool arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->removeChildBone(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeChildBone\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_removeChildBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_setChildArmature(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_setChildArmature'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Armature* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Armature\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Armature*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setChildArmature(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setChildArmature\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_setChildArmature'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getNodeToArmatureTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getNodeToArmatureTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        kmMat4 ret = cobj->getNodeToArmatureTransform();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeToArmatureTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getNodeToArmatureTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getDisplayManager(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getDisplayManager'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::DisplayManager* ret = cobj->getDisplayManager();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.DisplayManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::DisplayManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayManager\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getDisplayManager'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getArmature(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getArmature'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::Armature* ret = cobj->getArmature();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Armature\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Armature*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getArmature\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getArmature'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_getBoneData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Bone*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Bone_getBoneData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::BoneData* ret = cobj->getBoneData();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.BoneData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::BoneData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBoneData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_getBoneData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocostudio::Bone* ret = cocostudio::Bone::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Bone\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Bone*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocostudio::Bone* ret = cocostudio::Bone::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Bone\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Bone*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_Bone_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Bone* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::Bone();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.Bone\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.Bone\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Bone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Bone_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_Bone_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Bone)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_Bone(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.Bone\");\n    tolua_cclass(tolua_S,\"Bone\",\"ccs.Bone\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Bone\");\n        tolua_function(tolua_S,\"isTransformDirty\",lua_cocos2dx_studio_Bone_isTransformDirty);\n        tolua_function(tolua_S,\"isIgnoreMovementBoneData\",lua_cocos2dx_studio_Bone_isIgnoreMovementBoneData);\n        tolua_function(tolua_S,\"updateZOrder\",lua_cocos2dx_studio_Bone_updateZOrder);\n        tolua_function(tolua_S,\"getDisplayRenderNode\",lua_cocos2dx_studio_Bone_getDisplayRenderNode);\n        tolua_function(tolua_S,\"isBlendDirty\",lua_cocos2dx_studio_Bone_isBlendDirty);\n        tolua_function(tolua_S,\"addChildBone\",lua_cocos2dx_studio_Bone_addChildBone);\n        tolua_function(tolua_S,\"getWorldInfo\",lua_cocos2dx_studio_Bone_getWorldInfo);\n        tolua_function(tolua_S,\"getTween\",lua_cocos2dx_studio_Bone_getTween);\n        tolua_function(tolua_S,\"getParentBone\",lua_cocos2dx_studio_Bone_getParentBone);\n        tolua_function(tolua_S,\"updateColor\",lua_cocos2dx_studio_Bone_updateColor);\n        tolua_function(tolua_S,\"getName\",lua_cocos2dx_studio_Bone_getName);\n        tolua_function(tolua_S,\"setTransformDirty\",lua_cocos2dx_studio_Bone_setTransformDirty);\n        tolua_function(tolua_S,\"getDisplayRenderNodeType\",lua_cocos2dx_studio_Bone_getDisplayRenderNodeType);\n        tolua_function(tolua_S,\"removeDisplay\",lua_cocos2dx_studio_Bone_removeDisplay);\n        tolua_function(tolua_S,\"setBoneData\",lua_cocos2dx_studio_Bone_setBoneData);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_Bone_init);\n        tolua_function(tolua_S,\"setParentBone\",lua_cocos2dx_studio_Bone_setParentBone);\n        tolua_function(tolua_S,\"addDisplay\",lua_cocos2dx_studio_Bone_addDisplay);\n        tolua_function(tolua_S,\"setName\",lua_cocos2dx_studio_Bone_setName);\n        tolua_function(tolua_S,\"removeFromParent\",lua_cocos2dx_studio_Bone_removeFromParent);\n        tolua_function(tolua_S,\"getColliderDetector\",lua_cocos2dx_studio_Bone_getColliderDetector);\n        tolua_function(tolua_S,\"getChildArmature\",lua_cocos2dx_studio_Bone_getChildArmature);\n        tolua_function(tolua_S,\"getTweenData\",lua_cocos2dx_studio_Bone_getTweenData);\n        tolua_function(tolua_S,\"changeDisplayWithIndex\",lua_cocos2dx_studio_Bone_changeDisplayWithIndex);\n        tolua_function(tolua_S,\"changeDisplayWithName\",lua_cocos2dx_studio_Bone_changeDisplayWithName);\n        tolua_function(tolua_S,\"setArmature\",lua_cocos2dx_studio_Bone_setArmature);\n        tolua_function(tolua_S,\"setBlendDirty\",lua_cocos2dx_studio_Bone_setBlendDirty);\n        tolua_function(tolua_S,\"removeChildBone\",lua_cocos2dx_studio_Bone_removeChildBone);\n        tolua_function(tolua_S,\"setChildArmature\",lua_cocos2dx_studio_Bone_setChildArmature);\n        tolua_function(tolua_S,\"getNodeToArmatureTransform\",lua_cocos2dx_studio_Bone_getNodeToArmatureTransform);\n        tolua_function(tolua_S,\"getDisplayManager\",lua_cocos2dx_studio_Bone_getDisplayManager);\n        tolua_function(tolua_S,\"getArmature\",lua_cocos2dx_studio_Bone_getArmature);\n        tolua_function(tolua_S,\"getBoneData\",lua_cocos2dx_studio_Bone_getBoneData);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_Bone_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_Bone_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::Bone).name();\n    g_luaType[typeName] = \"ccs.Bone\";\n    g_typeCast[\"Bone\"] = \"ccs.Bone\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_BatchNode_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::BatchNode* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.BatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::BatchNode*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_BatchNode_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BatchNode_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_BatchNode_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.BatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::BatchNode* ret = cocostudio::BatchNode::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.BatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::BatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_BatchNode_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_BatchNode_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (BatchNode)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_BatchNode(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.BatchNode\");\n    tolua_cclass(tolua_S,\"BatchNode\",\"ccs.BatchNode\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"BatchNode\");\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_BatchNode_init);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_BatchNode_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::BatchNode).name();\n    g_luaType[typeName] = \"ccs.BatchNode\";\n    g_typeCast[\"BatchNode\"] = \"ccs.BatchNode\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ArmatureAnimation_getSpeedScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_getSpeedScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getSpeedScale();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getSpeedScale\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_getSpeedScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_pause(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_pause'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pause();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pause\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_pause'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_setSpeedScale(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_setSpeedScale'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setSpeedScale(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setSpeedScale\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_setSpeedScale'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Armature* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Armature\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Armature*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->init(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_playWithIndexes(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_playWithIndexes'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::vector<int> arg0;\n\n        ok &= luaval_to_std_vector_int(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->playWithIndexes(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        std::vector<int> arg0;\n        int arg1;\n\n        ok &= luaval_to_std_vector_int(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->playWithIndexes(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        std::vector<int> arg0;\n        int arg1;\n        bool arg2;\n\n        ok &= luaval_to_std_vector_int(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->playWithIndexes(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playWithIndexes\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_playWithIndexes'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_play(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_play'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->play(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        std::string arg0;\n        int arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->play(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        std::string arg0;\n        int arg1;\n        int arg2;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        cobj->play(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"play\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_play'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_gotoAndPause(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_gotoAndPause'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->gotoAndPause(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"gotoAndPause\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_gotoAndPause'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_resume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_resume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resume();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resume\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_resume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_stop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_stop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stop();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_stop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_update(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_update'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->update(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"update\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_update'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_getAnimationData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_getAnimationData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::AnimationData* ret = cobj->getAnimationData();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.AnimationData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::AnimationData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimationData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_getAnimationData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_playWithIndex(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_playWithIndex'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->playWithIndex(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        int arg0;\n        int arg1;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->playWithIndex(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        int arg0;\n        int arg1;\n        int arg2;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2);\n        if(!ok)\n            return 0;\n        cobj->playWithIndex(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playWithIndex\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_playWithIndex'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getCurrentMovementID();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getCurrentMovementID\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_setAnimationData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_setAnimationData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::AnimationData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.AnimationData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::AnimationData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setAnimationData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimationData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_setAnimationData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_gotoAndPlay(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_gotoAndPlay'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cobj->gotoAndPlay(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"gotoAndPlay\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_gotoAndPlay'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_playWithNames(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_playWithNames'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::vector<std::string> arg0;\n\n        ok &= luaval_to_std_vector_string(tolua_S, 2, &arg0);\n        if(!ok)\n            return 0;\n        cobj->playWithNames(arg0);\n        return 0;\n    }\n    if (argc == 2) \n    {\n        std::vector<std::string> arg0;\n        int arg1;\n\n        ok &= luaval_to_std_vector_string(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->playWithNames(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        std::vector<std::string> arg0;\n        int arg1;\n        bool arg2;\n\n        ok &= luaval_to_std_vector_string(tolua_S, 2, &arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n\n        ok &= luaval_to_boolean(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->playWithNames(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playWithNames\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_playWithNames'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_getMovementCount(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureAnimation_getMovementCount'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        ssize_t ret = cobj->getMovementCount();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getMovementCount\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_getMovementCount'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        cocostudio::Armature* arg0;\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Armature\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Armature*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureAnimation* ret = cocostudio::ArmatureAnimation::create(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureAnimation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureAnimation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureAnimation_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureAnimation* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::ArmatureAnimation();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.ArmatureAnimation\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.ArmatureAnimation\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ArmatureAnimation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureAnimation_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_ArmatureAnimation_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ArmatureAnimation)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ArmatureAnimation(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ArmatureAnimation\");\n    tolua_cclass(tolua_S,\"ArmatureAnimation\",\"ccs.ArmatureAnimation\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ArmatureAnimation\");\n        tolua_function(tolua_S,\"getSpeedScale\",lua_cocos2dx_studio_ArmatureAnimation_getSpeedScale);\n        tolua_function(tolua_S,\"pause\",lua_cocos2dx_studio_ArmatureAnimation_pause);\n        tolua_function(tolua_S,\"setSpeedScale\",lua_cocos2dx_studio_ArmatureAnimation_setSpeedScale);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_ArmatureAnimation_init);\n        tolua_function(tolua_S,\"playWithIndexes\",lua_cocos2dx_studio_ArmatureAnimation_playWithIndexes);\n        tolua_function(tolua_S,\"play\",lua_cocos2dx_studio_ArmatureAnimation_play);\n        tolua_function(tolua_S,\"gotoAndPause\",lua_cocos2dx_studio_ArmatureAnimation_gotoAndPause);\n        tolua_function(tolua_S,\"resume\",lua_cocos2dx_studio_ArmatureAnimation_resume);\n        tolua_function(tolua_S,\"stop\",lua_cocos2dx_studio_ArmatureAnimation_stop);\n        tolua_function(tolua_S,\"update\",lua_cocos2dx_studio_ArmatureAnimation_update);\n        tolua_function(tolua_S,\"getAnimationData\",lua_cocos2dx_studio_ArmatureAnimation_getAnimationData);\n        tolua_function(tolua_S,\"playWithIndex\",lua_cocos2dx_studio_ArmatureAnimation_playWithIndex);\n        tolua_function(tolua_S,\"getCurrentMovementID\",lua_cocos2dx_studio_ArmatureAnimation_getCurrentMovementID);\n        tolua_function(tolua_S,\"setAnimationData\",lua_cocos2dx_studio_ArmatureAnimation_setAnimationData);\n        tolua_function(tolua_S,\"gotoAndPlay\",lua_cocos2dx_studio_ArmatureAnimation_gotoAndPlay);\n        tolua_function(tolua_S,\"playWithNames\",lua_cocos2dx_studio_ArmatureAnimation_playWithNames);\n        tolua_function(tolua_S,\"getMovementCount\",lua_cocos2dx_studio_ArmatureAnimation_getMovementCount);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_ArmatureAnimation_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ArmatureAnimation_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ArmatureAnimation).name();\n    g_luaType[typeName] = \"ccs.ArmatureAnimation\";\n    g_typeCast[\"ArmatureAnimation\"] = \"ccs.ArmatureAnimation\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ArmatureDataManager_getAnimationDatas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_getAnimationDatas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Map<std::string, cocostudio::AnimationData *>& ret = cobj->getAnimationDatas();\n        ccmap_string_key_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimationDatas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_getAnimationDatas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_removeAnimationData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_removeAnimationData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeAnimationData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeAnimationData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_removeAnimationData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_addArmatureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_addArmatureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        cocostudio::ArmatureData* arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.ArmatureData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::ArmatureData*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addArmatureData(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        std::string arg0;\n        cocostudio::ArmatureData* arg1;\n        std::string arg2;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.ArmatureData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::ArmatureData*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->addArmatureData(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addArmatureData\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_addArmatureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 3) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            std::string arg1;\n            ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            std::string arg2;\n            ok &= luaval_to_std_string(tolua_S, 4,&arg2);\n\n            if (!ok) { break; }\n            cobj->addArmatureFileInfo(arg0, arg1, arg2);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->addArmatureFileInfo(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addArmatureFileInfo\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeArmatureFileInfo(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeArmatureFileInfo\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_getTextureDatas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_getTextureDatas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Map<std::string, cocostudio::TextureData *>& ret = cobj->getTextureDatas();\n        ccmap_string_key_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureDatas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_getTextureDatas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_getTextureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_getTextureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::TextureData* ret = cobj->getTextureData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.TextureData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::TextureData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getTextureData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_getTextureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_getArmatureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_getArmatureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureData* ret = cobj->getArmatureData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getArmatureData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_getArmatureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_getAnimationData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_getAnimationData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::AnimationData* ret = cobj->getAnimationData(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.AnimationData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::AnimationData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimationData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_getAnimationData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_addAnimationData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_addAnimationData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        cocostudio::AnimationData* arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.AnimationData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::AnimationData*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addAnimationData(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        std::string arg0;\n        cocostudio::AnimationData* arg1;\n        std::string arg2;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.AnimationData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::AnimationData*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->addAnimationData(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addAnimationData\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_addAnimationData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_init'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->init();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_removeArmatureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_removeArmatureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeArmatureData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeArmatureData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_removeArmatureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_getArmatureDatas(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_getArmatureDatas'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Map<std::string, cocostudio::ArmatureData *>& ret = cobj->getArmatureDatas();\n        ccmap_string_key_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getArmatureDatas\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_getArmatureDatas'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_removeTextureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_removeTextureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->removeTextureData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeTextureData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_removeTextureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_addTextureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_addTextureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        cocostudio::TextureData* arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.TextureData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::TextureData*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->addTextureData(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        std::string arg0;\n        cocostudio::TextureData* arg1;\n        std::string arg2;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.TextureData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::TextureData*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->addTextureData(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addTextureData\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_addTextureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isAutoLoadSpriteFile();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isAutoLoadSpriteFile\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ArmatureDataManager* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ArmatureDataManager*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        std::string arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->addSpriteFrameFromFile(arg0, arg1);\n        return 0;\n    }\n    if (argc == 3) \n    {\n        std::string arg0;\n        std::string arg1;\n        std::string arg2;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n\n        ok &= luaval_to_std_string(tolua_S, 4,&arg2);\n        if(!ok)\n            return 0;\n        cobj->addSpriteFrameFromFile(arg0, arg1, arg2);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addSpriteFrameFromFile\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureDataManager::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ArmatureDataManager_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureDataManager* ret = cocostudio::ArmatureDataManager::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureDataManager\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureDataManager*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ArmatureDataManager_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_ArmatureDataManager_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ArmatureDataManager)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ArmatureDataManager(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ArmatureDataManager\");\n    tolua_cclass(tolua_S,\"ArmatureDataManager\",\"ccs.ArmatureDataManager\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ArmatureDataManager\");\n        tolua_function(tolua_S,\"getAnimationDatas\",lua_cocos2dx_studio_ArmatureDataManager_getAnimationDatas);\n        tolua_function(tolua_S,\"removeAnimationData\",lua_cocos2dx_studio_ArmatureDataManager_removeAnimationData);\n        tolua_function(tolua_S,\"addArmatureData\",lua_cocos2dx_studio_ArmatureDataManager_addArmatureData);\n        tolua_function(tolua_S,\"addArmatureFileInfo\",lua_cocos2dx_studio_ArmatureDataManager_addArmatureFileInfo);\n        tolua_function(tolua_S,\"removeArmatureFileInfo\",lua_cocos2dx_studio_ArmatureDataManager_removeArmatureFileInfo);\n        tolua_function(tolua_S,\"getTextureDatas\",lua_cocos2dx_studio_ArmatureDataManager_getTextureDatas);\n        tolua_function(tolua_S,\"getTextureData\",lua_cocos2dx_studio_ArmatureDataManager_getTextureData);\n        tolua_function(tolua_S,\"getArmatureData\",lua_cocos2dx_studio_ArmatureDataManager_getArmatureData);\n        tolua_function(tolua_S,\"getAnimationData\",lua_cocos2dx_studio_ArmatureDataManager_getAnimationData);\n        tolua_function(tolua_S,\"addAnimationData\",lua_cocos2dx_studio_ArmatureDataManager_addAnimationData);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_ArmatureDataManager_init);\n        tolua_function(tolua_S,\"removeArmatureData\",lua_cocos2dx_studio_ArmatureDataManager_removeArmatureData);\n        tolua_function(tolua_S,\"getArmatureDatas\",lua_cocos2dx_studio_ArmatureDataManager_getArmatureDatas);\n        tolua_function(tolua_S,\"removeTextureData\",lua_cocos2dx_studio_ArmatureDataManager_removeTextureData);\n        tolua_function(tolua_S,\"addTextureData\",lua_cocos2dx_studio_ArmatureDataManager_addTextureData);\n        tolua_function(tolua_S,\"isAutoLoadSpriteFile\",lua_cocos2dx_studio_ArmatureDataManager_isAutoLoadSpriteFile);\n        tolua_function(tolua_S,\"addSpriteFrameFromFile\",lua_cocos2dx_studio_ArmatureDataManager_addSpriteFrameFromFile);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_studio_ArmatureDataManager_destroyInstance);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_studio_ArmatureDataManager_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ArmatureDataManager).name();\n    g_luaType[typeName] = \"ccs.ArmatureDataManager\";\n    g_typeCast[\"ArmatureDataManager\"] = \"ccs.ArmatureDataManager\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_Armature_getBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::Bone* ret = cobj->getBone(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Bone\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Bone*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBone\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_changeBoneParent(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_changeBoneParent'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocostudio::Bone* arg0;\n        std::string arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->changeBoneParent(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"changeBoneParent\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_changeBoneParent'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_setAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_setAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::ArmatureAnimation* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.ArmatureAnimation\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::ArmatureAnimation*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setAnimation(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnimation\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_setAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getBoneAtPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getBoneAtPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        double arg0;\n        double arg1;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cocostudio::Bone* ret = cobj->getBoneAtPoint(arg0, arg1);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Bone\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Bone*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBoneAtPoint\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getBoneAtPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getArmatureTransformDirty(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getArmatureTransformDirty'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->getArmatureTransformDirty();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getArmatureTransformDirty\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getArmatureTransformDirty'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_setVersion(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_setVersion'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setVersion(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setVersion\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_setVersion'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_updateOffsetPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_updateOffsetPoint'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateOffsetPoint();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateOffsetPoint\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_updateOffsetPoint'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getParentBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getParentBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::Bone* ret = cobj->getParentBone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Bone\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Bone*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getParentBone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getParentBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_setArmatureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_setArmatureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::ArmatureData* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.ArmatureData\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::ArmatureData*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setArmatureData(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setArmatureData\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_setArmatureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_removeBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_removeBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocostudio::Bone* arg0;\n        bool arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->removeBone(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"removeBone\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_removeBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::BatchNode* ret = cobj->getBatchNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.BatchNode\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::BatchNode*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBatchNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_init(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_init'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            bool ret = cobj->init(arg0);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            bool ret = cobj->init();\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cocostudio::Bone* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::Bone*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n            if (!ok) { break; }\n            bool ret = cobj->init(arg0, arg1);\n            tolua_pushboolean(tolua_S,(bool)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"init\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_init'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_setParentBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_setParentBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Bone* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setParentBone(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setParentBone\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_setParentBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_drawContour(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_drawContour'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->drawContour();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"drawContour\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_drawContour'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_setBatchNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_setBatchNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::BatchNode* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.BatchNode\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::BatchNode*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBatchNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBatchNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_setBatchNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_setName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_setName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setName(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_setName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_addBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_addBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        cocostudio::Bone* arg0;\n        std::string arg1;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->addBone(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"addBone\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_addBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getArmatureData(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getArmatureData'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureData* ret = cobj->getArmatureData();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureData\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureData*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getArmatureData\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getArmatureData'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getVersion(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getVersion'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getVersion();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVersion\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getVersion'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getAnimation(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getAnimation'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::ArmatureAnimation* ret = cobj->getAnimation();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ArmatureAnimation\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ArmatureAnimation*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getAnimation\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getAnimation'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_getBoneDic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Armature*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Armature_getBoneDic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const cocos2d::Map<std::string, cocostudio::Bone *>& ret = cobj->getBoneDic();\n        ccmap_string_key_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBoneDic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_getBoneDic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.Armature\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocostudio::Armature* ret = cocostudio::Armature::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Armature\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Armature*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocostudio::Armature* ret = cocostudio::Armature::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Armature\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Armature*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 2)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocostudio::Bone* arg1;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,3,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ1 = (cocostudio::Bone*)tolua_tousertype(tolua_S,3,0);\n\t\t\t\t\tif (nullptr == arg1){\n\t\t\t\t\t\tLUA_PRECONDITION( arg1, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            cocostudio::Armature* ret = cocostudio::Armature::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Armature\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Armature*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_Armature_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Armature* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::Armature();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.Armature\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.Armature\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Armature\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Armature_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_Armature_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Armature)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_Armature(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.Armature\");\n    tolua_cclass(tolua_S,\"Armature\",\"ccs.Armature\",\"cc.Node\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Armature\");\n        tolua_function(tolua_S,\"getBone\",lua_cocos2dx_studio_Armature_getBone);\n        tolua_function(tolua_S,\"changeBoneParent\",lua_cocos2dx_studio_Armature_changeBoneParent);\n        tolua_function(tolua_S,\"setAnimation\",lua_cocos2dx_studio_Armature_setAnimation);\n        tolua_function(tolua_S,\"getBoneAtPoint\",lua_cocos2dx_studio_Armature_getBoneAtPoint);\n        tolua_function(tolua_S,\"getArmatureTransformDirty\",lua_cocos2dx_studio_Armature_getArmatureTransformDirty);\n        tolua_function(tolua_S,\"setVersion\",lua_cocos2dx_studio_Armature_setVersion);\n        tolua_function(tolua_S,\"updateOffsetPoint\",lua_cocos2dx_studio_Armature_updateOffsetPoint);\n        tolua_function(tolua_S,\"getParentBone\",lua_cocos2dx_studio_Armature_getParentBone);\n        tolua_function(tolua_S,\"setArmatureData\",lua_cocos2dx_studio_Armature_setArmatureData);\n        tolua_function(tolua_S,\"removeBone\",lua_cocos2dx_studio_Armature_removeBone);\n        tolua_function(tolua_S,\"getBatchNode\",lua_cocos2dx_studio_Armature_getBatchNode);\n        tolua_function(tolua_S,\"getName\",lua_cocos2dx_studio_Armature_getName);\n        tolua_function(tolua_S,\"init\",lua_cocos2dx_studio_Armature_init);\n        tolua_function(tolua_S,\"setParentBone\",lua_cocos2dx_studio_Armature_setParentBone);\n        tolua_function(tolua_S,\"drawContour\",lua_cocos2dx_studio_Armature_drawContour);\n        tolua_function(tolua_S,\"setBatchNode\",lua_cocos2dx_studio_Armature_setBatchNode);\n        tolua_function(tolua_S,\"setName\",lua_cocos2dx_studio_Armature_setName);\n        tolua_function(tolua_S,\"addBone\",lua_cocos2dx_studio_Armature_addBone);\n        tolua_function(tolua_S,\"getArmatureData\",lua_cocos2dx_studio_Armature_getArmatureData);\n        tolua_function(tolua_S,\"getVersion\",lua_cocos2dx_studio_Armature_getVersion);\n        tolua_function(tolua_S,\"getAnimation\",lua_cocos2dx_studio_Armature_getAnimation);\n        tolua_function(tolua_S,\"getBoneDic\",lua_cocos2dx_studio_Armature_getBoneDic);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_Armature_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_Armature_create);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::Armature).name();\n    g_luaType[typeName] = \"ccs.Armature\";\n    g_typeCast[\"Armature\"] = \"ccs.Armature\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_Skin_getBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Skin*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Skin_getBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocostudio::Bone* ret = cobj->getBone();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Bone\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Bone*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBone\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_getBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_getNodeToWorldTransformAR(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Skin*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Skin_getNodeToWorldTransformAR'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        kmMat4 ret = cobj->getNodeToWorldTransformAR();\n        #pragma warning NO CONVERSION FROM NATIVE FOR kmMat4;\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeToWorldTransformAR\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_getNodeToWorldTransformAR'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_initWithFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Skin*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Skin_initWithFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithFile(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_initWithFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_getDisplayName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Skin*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Skin_getDisplayName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const std::string& ret = cobj->getDisplayName();\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDisplayName\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_getDisplayName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_updateArmatureTransform(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Skin*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Skin_updateArmatureTransform'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->updateArmatureTransform();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"updateArmatureTransform\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_updateArmatureTransform'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_initWithSpriteFrameName(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Skin*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Skin_initWithSpriteFrameName'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->initWithSpriteFrameName(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"initWithSpriteFrameName\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_initWithSpriteFrameName'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_setBone(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::Skin*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_Skin_setBone'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocostudio::Bone* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"ccs.Bone\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocostudio::Bone*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setBone(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBone\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_setBone'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 1)\n        {\n            std::string arg0;\n            ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n            if (!ok) { break; }\n            cocostudio::Skin* ret = cocostudio::Skin::create(arg0);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Skin\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Skin*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocostudio::Skin* ret = cocostudio::Skin::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Skin\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Skin*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_createWithSpriteFrameName(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.Skin\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 1)\n    {\n        std::string arg0;\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocostudio::Skin* ret = cocostudio::Skin::createWithSpriteFrameName(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.Skin\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::Skin*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createWithSpriteFrameName\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_createWithSpriteFrameName'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_Skin_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::Skin* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::Skin();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.Skin\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.Skin\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"Skin\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_Skin_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_Skin_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (Skin)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_Skin(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.Skin\");\n    tolua_cclass(tolua_S,\"Skin\",\"ccs.Skin\",\"cc.Sprite\",NULL);\n\n    tolua_beginmodule(tolua_S,\"Skin\");\n        tolua_function(tolua_S,\"getBone\",lua_cocos2dx_studio_Skin_getBone);\n        tolua_function(tolua_S,\"getNodeToWorldTransformAR\",lua_cocos2dx_studio_Skin_getNodeToWorldTransformAR);\n        tolua_function(tolua_S,\"initWithFile\",lua_cocos2dx_studio_Skin_initWithFile);\n        tolua_function(tolua_S,\"getDisplayName\",lua_cocos2dx_studio_Skin_getDisplayName);\n        tolua_function(tolua_S,\"updateArmatureTransform\",lua_cocos2dx_studio_Skin_updateArmatureTransform);\n        tolua_function(tolua_S,\"initWithSpriteFrameName\",lua_cocos2dx_studio_Skin_initWithSpriteFrameName);\n        tolua_function(tolua_S,\"setBone\",lua_cocos2dx_studio_Skin_setBone);\n        tolua_function(tolua_S,\"new\",lua_cocos2dx_studio_Skin_constructor);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_Skin_create);\n        tolua_function(tolua_S,\"createWithSpriteFrameName\", lua_cocos2dx_studio_Skin_createWithSpriteFrameName);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::Skin).name();\n    g_luaType[typeName] = \"ccs.Skin\";\n    g_typeCast[\"Skin\"] = \"ccs.Skin\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ComAttribute_getFloat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_getFloat'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        double ret = cobj->getFloat(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        std::string arg0;\n        double arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        double ret = cobj->getFloat(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFloat\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_getFloat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_getString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_getString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getString(arg0);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        std::string arg0;\n        std::string arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        std::string ret = cobj->getString(arg0, arg1);\n        tolua_pushcppstring(tolua_S,ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getString\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_getString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_setFloat(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_setFloat'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        double arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_number(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setFloat(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFloat\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_setFloat'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_setString(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_setString'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        std::string arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_std_string(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setString(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setString\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_setString'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_getBool(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_getBool'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->getBool(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        std::string arg0;\n        bool arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        bool ret = cobj->getBool(arg0, arg1);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBool\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_getBool'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_setInt(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_setInt'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        int arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        cobj->setInt(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setInt\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_setInt'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_parse(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_parse'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        bool ret = cobj->parse(arg0);\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"parse\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_parse'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_getInt(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_getInt'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        int ret = cobj->getInt(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    if (argc == 2) \n    {\n        std::string arg0;\n        int arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1);\n        if(!ok)\n            return 0;\n        int ret = cobj->getInt(arg0, arg1);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getInt\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_getInt'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_setBool(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAttribute* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAttribute*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAttribute_setBool'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2) \n    {\n        std::string arg0;\n        bool arg1;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n\n        ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n        if(!ok)\n            return 0;\n        cobj->setBool(arg0, arg1);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBool\",argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_setBool'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ComAttribute* ret = cocostudio::ComAttribute::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ComAttribute\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ComAttribute*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ComAttribute_createInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComAttribute\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Object* ret = cocostudio::ComAttribute::createInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Object\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Object*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAttribute_createInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_ComAttribute_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ComAttribute)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ComAttribute(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ComAttribute\");\n    tolua_cclass(tolua_S,\"ComAttribute\",\"ccs.ComAttribute\",\"cc.Component\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ComAttribute\");\n        tolua_function(tolua_S,\"getFloat\",lua_cocos2dx_studio_ComAttribute_getFloat);\n        tolua_function(tolua_S,\"getString\",lua_cocos2dx_studio_ComAttribute_getString);\n        tolua_function(tolua_S,\"setFloat\",lua_cocos2dx_studio_ComAttribute_setFloat);\n        tolua_function(tolua_S,\"setString\",lua_cocos2dx_studio_ComAttribute_setString);\n        tolua_function(tolua_S,\"getBool\",lua_cocos2dx_studio_ComAttribute_getBool);\n        tolua_function(tolua_S,\"setInt\",lua_cocos2dx_studio_ComAttribute_setInt);\n        tolua_function(tolua_S,\"parse\",lua_cocos2dx_studio_ComAttribute_parse);\n        tolua_function(tolua_S,\"getInt\",lua_cocos2dx_studio_ComAttribute_getInt);\n        tolua_function(tolua_S,\"setBool\",lua_cocos2dx_studio_ComAttribute_setBool);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ComAttribute_create);\n        tolua_function(tolua_S,\"createInstance\", lua_cocos2dx_studio_ComAttribute_createInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ComAttribute).name();\n    g_luaType[typeName] = \"ccs.ComAttribute\";\n    g_typeCast[\"ComAttribute\"] = \"ccs.ComAttribute\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ComAudio_stopAllEffects(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_stopAllEffects'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->stopAllEffects();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopAllEffects\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_stopAllEffects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_getEffectsVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_getEffectsVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getEffectsVolume();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getEffectsVolume\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_getEffectsVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_stopEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_stopEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->stopEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_stopEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_getBackgroundMusicVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_getBackgroundMusicVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        double ret = cobj->getBackgroundMusicVolume();\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getBackgroundMusicVolume\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_getBackgroundMusicVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_willPlayBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_willPlayBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->willPlayBackgroundMusic();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"willPlayBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_willPlayBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_setBackgroundMusicVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_setBackgroundMusicVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setBackgroundMusicVolume(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setBackgroundMusicVolume\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_setBackgroundMusicVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_end(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_end'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->end();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"end\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_end'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_stopBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_stopBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 0) {\n            cobj->stopBackgroundMusic();\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 1) {\n            bool arg0;\n            ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n\n            if (!ok) { break; }\n            cobj->stopBackgroundMusic(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"stopBackgroundMusic\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_stopBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_pauseBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_pauseBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pauseBackgroundMusic();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_pauseBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isBackgroundMusicPlaying();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isBackgroundMusicPlaying\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_isLoop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_isLoop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        bool ret = cobj->isLoop();\n        tolua_pushboolean(tolua_S,(bool)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"isLoop\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_isLoop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_resumeAllEffects(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_resumeAllEffects'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resumeAllEffects();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeAllEffects\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_resumeAllEffects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_pauseAllEffects(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_pauseAllEffects'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->pauseAllEffects();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseAllEffects\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_pauseAllEffects'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_preloadBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_preloadBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->preloadBackgroundMusic(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"preloadBackgroundMusic\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_preloadBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_playBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_playBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            cobj->playBackgroundMusic(arg0);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            cobj->playBackgroundMusic(arg0, arg1);\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            cobj->playBackgroundMusic();\n            return 0;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_playBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_playEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_playEffect'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    do{\n        if (argc == 1) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            unsigned int ret = cobj->playEffect(arg0);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 2) {\n            const char* arg0;\n            std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n            if (!ok) { break; }\n            bool arg1;\n            ok &= luaval_to_boolean(tolua_S, 3,&arg1);\n\n            if (!ok) { break; }\n            unsigned int ret = cobj->playEffect(arg0, arg1);\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    do{\n        if (argc == 0) {\n            unsigned int ret = cobj->playEffect();\n            tolua_pushnumber(tolua_S,(lua_Number)ret);\n            return 1;\n        }\n    }while(0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"playEffect\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_playEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_preloadEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_preloadEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->preloadEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"preloadEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_preloadEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_setLoop(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_setLoop'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        bool arg0;\n\n        ok &= luaval_to_boolean(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setLoop(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setLoop\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_setLoop'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_unloadEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_unloadEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->unloadEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"unloadEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_unloadEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_rewindBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_rewindBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->rewindBackgroundMusic();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"rewindBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_rewindBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_pauseEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_pauseEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->pauseEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"pauseEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_pauseEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_resumeBackgroundMusic(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_resumeBackgroundMusic'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj->resumeBackgroundMusic();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeBackgroundMusic\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_resumeBackgroundMusic'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_setFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_setFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cobj->setFile(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_setFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_setEffectsVolume(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_setEffectsVolume'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        double arg0;\n\n        ok &= luaval_to_number(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->setEffectsVolume(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setEffectsVolume\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_setEffectsVolume'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_getFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_getFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        const char* ret = cobj->getFile();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getFile\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_getFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_resumeEffect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComAudio* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComAudio*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComAudio_resumeEffect'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        unsigned int arg0;\n\n        ok &= luaval_to_uint32(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cobj->resumeEffect(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"resumeEffect\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_resumeEffect'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ComAudio* ret = cocostudio::ComAudio::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ComAudio\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ComAudio*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ComAudio_createInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComAudio\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Object* ret = cocostudio::ComAudio::createInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Object\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Object*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComAudio_createInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_ComAudio_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ComAudio)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ComAudio(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ComAudio\");\n    tolua_cclass(tolua_S,\"ComAudio\",\"ccs.ComAudio\",\"cc.Component\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ComAudio\");\n        tolua_function(tolua_S,\"stopAllEffects\",lua_cocos2dx_studio_ComAudio_stopAllEffects);\n        tolua_function(tolua_S,\"getEffectsVolume\",lua_cocos2dx_studio_ComAudio_getEffectsVolume);\n        tolua_function(tolua_S,\"stopEffect\",lua_cocos2dx_studio_ComAudio_stopEffect);\n        tolua_function(tolua_S,\"getBackgroundMusicVolume\",lua_cocos2dx_studio_ComAudio_getBackgroundMusicVolume);\n        tolua_function(tolua_S,\"willPlayBackgroundMusic\",lua_cocos2dx_studio_ComAudio_willPlayBackgroundMusic);\n        tolua_function(tolua_S,\"setBackgroundMusicVolume\",lua_cocos2dx_studio_ComAudio_setBackgroundMusicVolume);\n        tolua_function(tolua_S,\"end\",lua_cocos2dx_studio_ComAudio_end);\n        tolua_function(tolua_S,\"stopBackgroundMusic\",lua_cocos2dx_studio_ComAudio_stopBackgroundMusic);\n        tolua_function(tolua_S,\"pauseBackgroundMusic\",lua_cocos2dx_studio_ComAudio_pauseBackgroundMusic);\n        tolua_function(tolua_S,\"isBackgroundMusicPlaying\",lua_cocos2dx_studio_ComAudio_isBackgroundMusicPlaying);\n        tolua_function(tolua_S,\"isLoop\",lua_cocos2dx_studio_ComAudio_isLoop);\n        tolua_function(tolua_S,\"resumeAllEffects\",lua_cocos2dx_studio_ComAudio_resumeAllEffects);\n        tolua_function(tolua_S,\"pauseAllEffects\",lua_cocos2dx_studio_ComAudio_pauseAllEffects);\n        tolua_function(tolua_S,\"preloadBackgroundMusic\",lua_cocos2dx_studio_ComAudio_preloadBackgroundMusic);\n        tolua_function(tolua_S,\"playBackgroundMusic\",lua_cocos2dx_studio_ComAudio_playBackgroundMusic);\n        tolua_function(tolua_S,\"playEffect\",lua_cocos2dx_studio_ComAudio_playEffect);\n        tolua_function(tolua_S,\"preloadEffect\",lua_cocos2dx_studio_ComAudio_preloadEffect);\n        tolua_function(tolua_S,\"setLoop\",lua_cocos2dx_studio_ComAudio_setLoop);\n        tolua_function(tolua_S,\"unloadEffect\",lua_cocos2dx_studio_ComAudio_unloadEffect);\n        tolua_function(tolua_S,\"rewindBackgroundMusic\",lua_cocos2dx_studio_ComAudio_rewindBackgroundMusic);\n        tolua_function(tolua_S,\"pauseEffect\",lua_cocos2dx_studio_ComAudio_pauseEffect);\n        tolua_function(tolua_S,\"resumeBackgroundMusic\",lua_cocos2dx_studio_ComAudio_resumeBackgroundMusic);\n        tolua_function(tolua_S,\"setFile\",lua_cocos2dx_studio_ComAudio_setFile);\n        tolua_function(tolua_S,\"setEffectsVolume\",lua_cocos2dx_studio_ComAudio_setEffectsVolume);\n        tolua_function(tolua_S,\"getFile\",lua_cocos2dx_studio_ComAudio_getFile);\n        tolua_function(tolua_S,\"resumeEffect\",lua_cocos2dx_studio_ComAudio_resumeEffect);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ComAudio_create);\n        tolua_function(tolua_S,\"createInstance\", lua_cocos2dx_studio_ComAudio_createInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ComAudio).name();\n    g_luaType[typeName] = \"ccs.ComAudio\";\n    g_typeCast[\"ComAudio\"] = \"ccs.ComAudio\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ComController_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComController\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::ComController* ret = cocostudio::ComController::create();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ComController\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ComController*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComController_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ComController_createInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComController\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Object* ret = cocostudio::ComController::createInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Object\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Object*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComController_createInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ComController_constructor(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComController* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cobj = new cocostudio::ComController();\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"ccs.ComController\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"ccs.ComController\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"ComController\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComController_constructor'.\",&tolua_err);\n#endif\n\n    return 0;\n}\n\nstatic int lua_cocos2dx_studio_ComController_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ComController)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ComController(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ComController\");\n    tolua_cclass(tolua_S,\"ComController\",\"ccs.ComController\",\"cc.Component\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ComController\");\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ComController_create);\n        tolua_function(tolua_S,\"createInstance\", lua_cocos2dx_studio_ComController_createInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ComController).name();\n    g_luaType[typeName] = \"ccs.ComController\";\n    g_typeCast[\"ComController\"] = \"ccs.ComController\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_ComRender_setNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComRender* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComRender\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComRender*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComRender_setNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        cocos2d::Node* arg0;\n\n        do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n        if(!ok)\n            return 0;\n        cobj->setNode(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setNode\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComRender_setNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComRender_getNode(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::ComRender* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.ComRender\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::ComRender*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_ComRender_getNode'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0) \n    {\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getNode();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNode\",argc, 0);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComRender_getNode'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_ComRender_create(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComRender\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    do \n    {\n        if (argc == 2)\n        {\n            cocos2d::Node* arg0;\n            do {\n\t\t\t\tif (!luaval_is_usertype(tolua_S,2,\"cc.Node\",0)){\n\t\t\t\t\tok = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (ok){\n\t\t\t\t\targ0 = (cocos2d::Node*)tolua_tousertype(tolua_S,2,0);\n\t\t\t\t\tif (nullptr == arg0){\n\t\t\t\t\t\tLUA_PRECONDITION( arg0, \"Invalid Native Object\");\n\t\t\t}}} while (0);\n            if (!ok) { break; }\n            const char* arg1;\n            std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n            if (!ok) { break; }\n            cocostudio::ComRender* ret = cocostudio::ComRender::create(arg0, arg1);\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ComRender\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ComRender*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    do \n    {\n        if (argc == 0)\n        {\n            cocostudio::ComRender* ret = cocostudio::ComRender::create();\n            do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.ComRender\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::ComRender*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n            return 1;\n        }\n    } while (0);\n    ok  = true;\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"create\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComRender_create'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_ComRender_createInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.ComRender\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Object* ret = cocostudio::ComRender::createInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Object\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Object*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_ComRender_createInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_ComRender_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (ComRender)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_ComRender(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.ComRender\");\n    tolua_cclass(tolua_S,\"ComRender\",\"ccs.ComRender\",\"cc.Component\",NULL);\n\n    tolua_beginmodule(tolua_S,\"ComRender\");\n        tolua_function(tolua_S,\"setNode\",lua_cocos2dx_studio_ComRender_setNode);\n        tolua_function(tolua_S,\"getNode\",lua_cocos2dx_studio_ComRender_getNode);\n        tolua_function(tolua_S,\"create\", lua_cocos2dx_studio_ComRender_create);\n        tolua_function(tolua_S,\"createInstance\", lua_cocos2dx_studio_ComRender_createInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::ComRender).name();\n    g_luaType[typeName] = \"ccs.ComRender\";\n    g_typeCast[\"ComRender\"] = \"ccs.ComRender\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_GUIReader_widgetFromJsonFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::GUIReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.GUIReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::GUIReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_GUIReader_widgetFromJsonFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        cocos2d::gui::Widget* ret = cobj->widgetFromJsonFile(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccui.Widget\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::gui::Widget*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"widgetFromJsonFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_GUIReader_widgetFromJsonFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_GUIReader_getVersionInteger(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::GUIReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.GUIReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::GUIReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_GUIReader_getVersionInteger'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        const char* arg0;\n\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if(!ok)\n            return 0;\n        int ret = cobj->getVersionInteger(arg0);\n        tolua_pushnumber(tolua_S,(lua_Number)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getVersionInteger\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_GUIReader_getVersionInteger'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_GUIReader_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.GUIReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::GUIReader::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_GUIReader_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_GUIReader_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.GUIReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::GUIReader* ret = cocostudio::GUIReader::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.GUIReader\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::GUIReader*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_GUIReader_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_GUIReader_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (GUIReader)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_GUIReader(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.GUIReader\");\n    tolua_cclass(tolua_S,\"GUIReader\",\"ccs.GUIReader\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"GUIReader\");\n        tolua_function(tolua_S,\"widgetFromJsonFile\",lua_cocos2dx_studio_GUIReader_widgetFromJsonFile);\n        tolua_function(tolua_S,\"getVersionInteger\",lua_cocos2dx_studio_GUIReader_getVersionInteger);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_studio_GUIReader_destroyInstance);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_studio_GUIReader_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::GUIReader).name();\n    g_luaType[typeName] = \"ccs.GUIReader\";\n    g_typeCast[\"GUIReader\"] = \"ccs.GUIReader\";\n    return 1;\n}\n\nint lua_cocos2dx_studio_SceneReader_setTarget(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::SceneReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.SceneReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::SceneReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_SceneReader_setTarget'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::function<void (cocos2d::Object *, void *)> arg0;\n\n        do {\n\t\t\t// Lambda binding for lua is not supported.\n\t\t\tassert(false);\n\t\t} while(0)\n\t\t;\n        if(!ok)\n            return 0;\n        cobj->setTarget(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setTarget\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SceneReader_setTarget'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_SceneReader_createNodeWithSceneFile(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::SceneReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.SceneReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::SceneReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_SceneReader_createNodeWithSceneFile'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        std::string arg0;\n\n        ok &= luaval_to_std_string(tolua_S, 2,&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->createNodeWithSceneFile(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"createNodeWithSceneFile\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SceneReader_createNodeWithSceneFile'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_SceneReader_getNodeByTag(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocostudio::SceneReader* cobj = nullptr;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"ccs.SceneReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    cobj = (cocostudio::SceneReader*)tolua_tousertype(tolua_S,1,0);\n\n#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_studio_SceneReader_getNodeByTag'\", NULL);\n        return 0;\n    }\n#endif\n\n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 1) \n    {\n        int arg0;\n\n        ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0);\n        if(!ok)\n            return 0;\n        cocos2d::Node* ret = cobj->getNodeByTag(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.Node\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::Node*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getNodeByTag\",argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SceneReader_getNodeByTag'.\",&tolua_err);\n#endif\n\n    return 0;\n}\nint lua_cocos2dx_studio_SceneReader_destroyInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.SceneReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::SceneReader::destroyInstance();\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"destroyInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SceneReader_destroyInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_SceneReader_sceneReaderVersion(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.SceneReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        const char* ret = cocostudio::SceneReader::sceneReaderVersion();\n        tolua_pushstring(tolua_S,(const char*)ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"sceneReaderVersion\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SceneReader_sceneReaderVersion'.\",&tolua_err);\n#endif\n    return 0;\n}\nint lua_cocos2dx_studio_SceneReader_getInstance(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"ccs.SceneReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocostudio::SceneReader* ret = cocostudio::SceneReader::getInstance();\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"ccs.SceneReader\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocostudio::SceneReader*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n\t\t\t\t\t tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n\t\t\t}} else {\n\t\t\t\tlua_pushnil(tolua_S);\n\t\t\t}\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getInstance\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_studio_SceneReader_getInstance'.\",&tolua_err);\n#endif\n    return 0;\n}\nstatic int lua_cocos2dx_studio_SceneReader_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (SceneReader)\");\n    return 0;\n}\n\nint lua_register_cocos2dx_studio_SceneReader(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"ccs.SceneReader\");\n    tolua_cclass(tolua_S,\"SceneReader\",\"ccs.SceneReader\",\"\",NULL);\n\n    tolua_beginmodule(tolua_S,\"SceneReader\");\n        tolua_function(tolua_S,\"setTarget\",lua_cocos2dx_studio_SceneReader_setTarget);\n        tolua_function(tolua_S,\"createNodeWithSceneFile\",lua_cocos2dx_studio_SceneReader_createNodeWithSceneFile);\n        tolua_function(tolua_S,\"getNodeByTag\",lua_cocos2dx_studio_SceneReader_getNodeByTag);\n        tolua_function(tolua_S,\"destroyInstance\", lua_cocos2dx_studio_SceneReader_destroyInstance);\n        tolua_function(tolua_S,\"sceneReaderVersion\", lua_cocos2dx_studio_SceneReader_sceneReaderVersion);\n        tolua_function(tolua_S,\"getInstance\", lua_cocos2dx_studio_SceneReader_getInstance);\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(cocostudio::SceneReader).name();\n    g_luaType[typeName] = \"ccs.SceneReader\";\n    g_typeCast[\"SceneReader\"] = \"ccs.SceneReader\";\n    return 1;\n}\nTOLUA_API int register_all_cocos2dx_studio(lua_State* tolua_S)\n{\n\ttolua_open(tolua_S);\n\t\n\ttolua_module(tolua_S,\"ccs\",0);\n\ttolua_beginmodule(tolua_S,\"ccs\");\n\n\tlua_register_cocos2dx_studio_Tween(tolua_S);\n\tlua_register_cocos2dx_studio_ContourData(tolua_S);\n\tlua_register_cocos2dx_studio_SceneReader(tolua_S);\n\tlua_register_cocos2dx_studio_ComAudio(tolua_S);\n\tlua_register_cocos2dx_studio_DisplayData(tolua_S);\n\tlua_register_cocos2dx_studio_ArmatureDisplayData(tolua_S);\n\tlua_register_cocos2dx_studio_MovementData(tolua_S);\n\tlua_register_cocos2dx_studio_ArmatureDataManager(tolua_S);\n\tlua_register_cocos2dx_studio_ArmatureData(tolua_S);\n\tlua_register_cocos2dx_studio_BaseData(tolua_S);\n\tlua_register_cocos2dx_studio_FrameData(tolua_S);\n\tlua_register_cocos2dx_studio_ComController(tolua_S);\n\tlua_register_cocos2dx_studio_BoneData(tolua_S);\n\tlua_register_cocos2dx_studio_ComRender(tolua_S);\n\tlua_register_cocos2dx_studio_ParticleDisplayData(tolua_S);\n\tlua_register_cocos2dx_studio_BatchNode(tolua_S);\n\tlua_register_cocos2dx_studio_ActionObject(tolua_S);\n\tlua_register_cocos2dx_studio_Skin(tolua_S);\n\tlua_register_cocos2dx_studio_MovementBoneData(tolua_S);\n\tlua_register_cocos2dx_studio_DisplayManager(tolua_S);\n\tlua_register_cocos2dx_studio_GUIReader(tolua_S);\n\tlua_register_cocos2dx_studio_ArmatureAnimation(tolua_S);\n\tlua_register_cocos2dx_studio_Armature(tolua_S);\n\tlua_register_cocos2dx_studio_SpriteDisplayData(tolua_S);\n\tlua_register_cocos2dx_studio_ActionManagerEx(tolua_S);\n\tlua_register_cocos2dx_studio_Bone(tolua_S);\n\tlua_register_cocos2dx_studio_ComAttribute(tolua_S);\n\tlua_register_cocos2dx_studio_TextureData(tolua_S);\n\tlua_register_cocos2dx_studio_AnimationData(tolua_S);\n\n\ttolua_endmodule(tolua_S);\n\treturn 1;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_studio_auto.hpp",
    "content": "#ifndef __cocos2dx_studio_h__\n#define __cocos2dx_studio_h__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\nint register_all_cocos2dx_studio(lua_State* tolua_S);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#endif // __cocos2dx_studio_h__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_studio_auto_api.js",
    "content": "/**\n * @module cocos2dx_studio\n */\nvar ccs = ccs || {};\n\n/**\n * @class ActionObject\n */\nccs.ActionObject = {\n\n/**\n * @method setCurrentTime\n * @param {float}\n */\nsetCurrentTime : function () {},\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method setName\n * @param {const char*}\n */\nsetName : function () {},\n\n/**\n * @method setUnitTime\n * @param {float}\n */\nsetUnitTime : function () {},\n\n/**\n * @method getTotalTime\n * @return A value converted from C/C++ \"float\"\n */\ngetTotalTime : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetName : function () {},\n\n/**\n * @method stop\n */\nstop : function () {},\n\n/**\n * @method getCurrentTime\n * @return A value converted from C/C++ \"float\"\n */\ngetCurrentTime : function () {},\n\n/**\n * @method removeActionNode\n * @param {cocostudio::ActionNode*}\n */\nremoveActionNode : function () {},\n\n/**\n * @method getLoop\n * @return A value converted from C/C++ \"bool\"\n */\ngetLoop : function () {},\n\n/**\n * @method addActionNode\n * @param {cocostudio::ActionNode*}\n */\naddActionNode : function () {},\n\n/**\n * @method getUnitTime\n * @return A value converted from C/C++ \"float\"\n */\ngetUnitTime : function () {},\n\n/**\n * @method isPlaying\n * @return A value converted from C/C++ \"bool\"\n */\nisPlaying : function () {},\n\n/**\n * @method updateToFrameByTime\n * @param {float}\n */\nupdateToFrameByTime : function () {},\n\n/**\n * @method setLoop\n * @param {bool}\n */\nsetLoop : function () {},\n\n/**\n * @method simulationActionUpdate\n * @param {float}\n */\nsimulationActionUpdate : function () {},\n\n/**\n * @method ActionObject\n * @constructor\n */\nActionObject : function () {},\n\n};\n\n/**\n * @class ActionManagerEx\n */\nccs.ActionManagerEx = {\n\n/**\n * @method getActionByName\n * @return A value converted from C/C++ \"cocostudio::ActionObject*\"\n * @param {const char*}\n * @param {const char*}\n */\ngetActionByName : function () {},\n\n/**\n * @method releaseActions\n */\nreleaseActions : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::ActionManagerEx*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class BaseData\n */\nccs.BaseData = {\n\n/**\n * @method getColor\n * @return A value converted from C/C++ \"cocos2d::Color4B\"\n */\ngetColor : function () {},\n\n/**\n * @method setColor\n * @param {const cocos2d::Color4B&}\n */\nsetColor : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::BaseData*\"\n */\ncreate : function () {},\n\n/**\n * @method BaseData\n * @constructor\n */\nBaseData : function () {},\n\n};\n\n/**\n * @class DisplayData\n */\nccs.DisplayData = {\n\n/**\n * @method copy\n * @param {cocostudio::DisplayData*}\n */\ncopy : function () {},\n\n/**\n * @method changeDisplayToTexture\n * @return A value converted from C/C++ \"const std::string\"\n * @param {const std::string&}\n */\nchangeDisplayToTexture : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::DisplayData*\"\n */\ncreate : function () {},\n\n/**\n * @method DisplayData\n * @constructor\n */\nDisplayData : function () {},\n\n};\n\n/**\n * @class SpriteDisplayData\n */\nccs.SpriteDisplayData = {\n\n/**\n * @method copy\n * @param {cocostudio::DisplayData*}\n */\ncopy : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::SpriteDisplayData*\"\n */\ncreate : function () {},\n\n/**\n * @method SpriteDisplayData\n * @constructor\n */\nSpriteDisplayData : function () {},\n\n};\n\n/**\n * @class ArmatureDisplayData\n */\nccs.ArmatureDisplayData = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ArmatureDisplayData*\"\n */\ncreate : function () {},\n\n/**\n * @method ArmatureDisplayData\n * @constructor\n */\nArmatureDisplayData : function () {},\n\n};\n\n/**\n * @class ParticleDisplayData\n */\nccs.ParticleDisplayData = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ParticleDisplayData*\"\n */\ncreate : function () {},\n\n/**\n * @method ParticleDisplayData\n * @constructor\n */\nParticleDisplayData : function () {},\n\n};\n\n/**\n * @class BoneData\n */\nccs.BoneData = {\n\n/**\n * @method getDisplayData\n * @return A value converted from C/C++ \"cocostudio::DisplayData*\"\n * @param {int}\n */\ngetDisplayData : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method addDisplayData\n * @param {cocostudio::DisplayData*}\n */\naddDisplayData : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::BoneData*\"\n */\ncreate : function () {},\n\n/**\n * @method BoneData\n * @constructor\n */\nBoneData : function () {},\n\n};\n\n/**\n * @class ArmatureData\n */\nccs.ArmatureData = {\n\n/**\n * @method addBoneData\n * @param {cocostudio::BoneData*}\n */\naddBoneData : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method getBoneData\n * @return A value converted from C/C++ \"cocostudio::BoneData*\"\n * @param {const std::string&}\n */\ngetBoneData : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ArmatureData*\"\n */\ncreate : function () {},\n\n/**\n * @method ArmatureData\n * @constructor\n */\nArmatureData : function () {},\n\n};\n\n/**\n * @class FrameData\n */\nccs.FrameData = {\n\n/**\n * @method copy\n * @param {const cocostudio::BaseData*}\n */\ncopy : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::FrameData*\"\n */\ncreate : function () {},\n\n/**\n * @method FrameData\n * @constructor\n */\nFrameData : function () {},\n\n};\n\n/**\n * @class MovementBoneData\n */\nccs.MovementBoneData = {\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method getFrameData\n * @return A value converted from C/C++ \"cocostudio::FrameData*\"\n * @param {int}\n */\ngetFrameData : function () {},\n\n/**\n * @method addFrameData\n * @param {cocostudio::FrameData*}\n */\naddFrameData : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::MovementBoneData*\"\n */\ncreate : function () {},\n\n/**\n * @method MovementBoneData\n * @constructor\n */\nMovementBoneData : function () {},\n\n};\n\n/**\n * @class MovementData\n */\nccs.MovementData = {\n\n/**\n * @method getMovementBoneData\n * @return A value converted from C/C++ \"cocostudio::MovementBoneData*\"\n * @param {const std::string&}\n */\ngetMovementBoneData : function () {},\n\n/**\n * @method addMovementBoneData\n * @param {cocostudio::MovementBoneData*}\n */\naddMovementBoneData : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::MovementData*\"\n */\ncreate : function () {},\n\n/**\n * @method MovementData\n * @constructor\n */\nMovementData : function () {},\n\n};\n\n/**\n * @class AnimationData\n */\nccs.AnimationData = {\n\n/**\n * @method getMovement\n * @return A value converted from C/C++ \"cocostudio::MovementData*\"\n * @param {const std::string&}\n */\ngetMovement : function () {},\n\n/**\n * @method getMovementCount\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetMovementCount : function () {},\n\n/**\n * @method addMovement\n * @param {cocostudio::MovementData*}\n */\naddMovement : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::AnimationData*\"\n */\ncreate : function () {},\n\n/**\n * @method AnimationData\n * @constructor\n */\nAnimationData : function () {},\n\n};\n\n/**\n * @class ContourData\n */\nccs.ContourData = {\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method addVertex\n * @param {cocos2d::Point&}\n */\naddVertex : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ContourData*\"\n */\ncreate : function () {},\n\n/**\n * @method ContourData\n * @constructor\n */\nContourData : function () {},\n\n};\n\n/**\n * @class TextureData\n */\nccs.TextureData = {\n\n/**\n * @method getContourData\n * @return A value converted from C/C++ \"cocostudio::ContourData*\"\n * @param {int}\n */\ngetContourData : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method addContourData\n * @param {cocostudio::ContourData*}\n */\naddContourData : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::TextureData*\"\n */\ncreate : function () {},\n\n/**\n * @method TextureData\n * @constructor\n */\nTextureData : function () {},\n\n};\n\n/**\n * @class Tween\n */\nccs.Tween = {\n\n/**\n * @method getAnimation\n * @return A value converted from C/C++ \"cocostudio::ArmatureAnimation*\"\n */\ngetAnimation : function () {},\n\n/**\n * @method gotoAndPause\n * @param {int}\n */\ngotoAndPause : function () {},\n\n/**\n * @method play\n * @param {cocostudio::MovementBoneData*}\n * @param {int}\n * @param {int}\n * @param {int}\n * @param {int}\n */\nplay : function () {},\n\n/**\n * @method gotoAndPlay\n * @param {int}\n */\ngotoAndPlay : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n * @param {cocostudio::Bone*}\n */\ninit : function () {},\n\n/**\n * @method setAnimation\n * @param {cocostudio::ArmatureAnimation*}\n */\nsetAnimation : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::Tween*\"\n * @param {cocostudio::Bone*}\n */\ncreate : function () {},\n\n/**\n * @method Tween\n * @constructor\n */\nTween : function () {},\n\n};\n\n/**\n * @class DisplayManager\n */\nccs.DisplayManager = {\n\n/**\n * @method getDisplayRenderNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetDisplayRenderNode : function () {},\n\n/**\n * @method getAnchorPointInPoints\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchorPointInPoints : function () {},\n\n/**\n * @method getDisplayRenderNodeType\n * @return A value converted from C/C++ \"cocostudio::DisplayType\"\n */\ngetDisplayRenderNodeType : function () {},\n\n/**\n * @method removeDisplay\n * @param {int}\n */\nremoveDisplay : function () {},\n\n/**\n * @method setForceChangeDisplay\n * @param {bool}\n */\nsetForceChangeDisplay : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n * @param {cocostudio::Bone*}\n */\ninit : function () {},\n\n/**\n * @method getContentSize\n * @return A value converted from C/C++ \"cocos2d::Size\"\n */\ngetContentSize : function () {},\n\n/**\n * @method getBoundingBox\n * @return A value converted from C/C++ \"cocos2d::Rect\"\n */\ngetBoundingBox : function () {},\n\n/**\n * @method changeDisplayWithIndex\n * @param {int}\n * @param {bool}\n */\nchangeDisplayWithIndex : function () {},\n\n/**\n * @method changeDisplayWithName\n * @param {const std::string&}\n * @param {bool}\n */\nchangeDisplayWithName : function () {},\n\n/**\n * @method isForceChangeDisplay\n * @return A value converted from C/C++ \"bool\"\n */\nisForceChangeDisplay : function () {},\n\n/**\n * @method getCurrentDisplayIndex\n * @return A value converted from C/C++ \"int\"\n */\ngetCurrentDisplayIndex : function () {},\n\n/**\n * @method getAnchorPoint\n * @return A value converted from C/C++ \"cocos2d::Point\"\n */\ngetAnchorPoint : function () {},\n\n/**\n * @method getDecorativeDisplayList\n * @return A value converted from C/C++ \"const cocos2d::Vector<cocostudio::DecorativeDisplay *>&\"\n */\ngetDecorativeDisplayList : function () {},\n\n/**\n * @method isVisible\n * @return A value converted from C/C++ \"bool\"\n */\nisVisible : function () {},\n\n/**\n * @method setVisible\n * @param {bool}\n */\nsetVisible : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::DisplayManager*\"\n * @param {cocostudio::Bone*}\n */\ncreate : function () {},\n\n/**\n * @method DisplayManager\n * @constructor\n */\nDisplayManager : function () {},\n\n};\n\n/**\n * @class Bone\n */\nccs.Bone = {\n\n/**\n * @method isTransformDirty\n * @return A value converted from C/C++ \"bool\"\n */\nisTransformDirty : function () {},\n\n/**\n * @method isIgnoreMovementBoneData\n * @return A value converted from C/C++ \"bool\"\n */\nisIgnoreMovementBoneData : function () {},\n\n/**\n * @method updateZOrder\n */\nupdateZOrder : function () {},\n\n/**\n * @method getDisplayRenderNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetDisplayRenderNode : function () {},\n\n/**\n * @method isBlendDirty\n * @return A value converted from C/C++ \"bool\"\n */\nisBlendDirty : function () {},\n\n/**\n * @method addChildBone\n * @param {cocostudio::Bone*}\n */\naddChildBone : function () {},\n\n/**\n * @method getWorldInfo\n * @return A value converted from C/C++ \"cocostudio::BaseData*\"\n */\ngetWorldInfo : function () {},\n\n/**\n * @method getTween\n * @return A value converted from C/C++ \"cocostudio::Tween*\"\n */\ngetTween : function () {},\n\n/**\n * @method getParentBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n */\ngetParentBone : function () {},\n\n/**\n * @method updateColor\n */\nupdateColor : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const std::string\"\n */\ngetName : function () {},\n\n/**\n * @method setTransformDirty\n * @param {bool}\n */\nsetTransformDirty : function () {},\n\n/**\n * @method getDisplayRenderNodeType\n * @return A value converted from C/C++ \"cocostudio::DisplayType\"\n */\ngetDisplayRenderNodeType : function () {},\n\n/**\n * @method removeDisplay\n * @param {int}\n */\nremoveDisplay : function () {},\n\n/**\n * @method setBoneData\n * @param {cocostudio::BoneData*}\n */\nsetBoneData : function () {},\n\n/**\n * @method setParentBone\n * @param {cocostudio::Bone*}\n */\nsetParentBone : function () {},\n\n/**\n * @method setName\n * @param {const std::string&}\n */\nsetName : function () {},\n\n/**\n * @method removeFromParent\n * @param {bool}\n */\nremoveFromParent : function () {},\n\n/**\n * @method getColliderDetector\n * @return A value converted from C/C++ \"cocostudio::ColliderDetector*\"\n */\ngetColliderDetector : function () {},\n\n/**\n * @method getChildArmature\n * @return A value converted from C/C++ \"cocostudio::Armature*\"\n */\ngetChildArmature : function () {},\n\n/**\n * @method getTweenData\n * @return A value converted from C/C++ \"cocostudio::FrameData*\"\n */\ngetTweenData : function () {},\n\n/**\n * @method changeDisplayWithIndex\n * @param {int}\n * @param {bool}\n */\nchangeDisplayWithIndex : function () {},\n\n/**\n * @method changeDisplayWithName\n * @param {const std::string&}\n * @param {bool}\n */\nchangeDisplayWithName : function () {},\n\n/**\n * @method setArmature\n * @param {cocostudio::Armature*}\n */\nsetArmature : function () {},\n\n/**\n * @method setBlendDirty\n * @param {bool}\n */\nsetBlendDirty : function () {},\n\n/**\n * @method removeChildBone\n * @param {cocostudio::Bone*}\n * @param {bool}\n */\nremoveChildBone : function () {},\n\n/**\n * @method setChildArmature\n * @param {cocostudio::Armature*}\n */\nsetChildArmature : function () {},\n\n/**\n * @method getNodeToArmatureTransform\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetNodeToArmatureTransform : function () {},\n\n/**\n * @method getDisplayManager\n * @return A value converted from C/C++ \"cocostudio::DisplayManager*\"\n */\ngetDisplayManager : function () {},\n\n/**\n * @method getArmature\n * @return A value converted from C/C++ \"cocostudio::Armature*\"\n */\ngetArmature : function () {},\n\n/**\n * @method getBoneData\n * @return A value converted from C/C++ \"cocostudio::BoneData*\"\n */\ngetBoneData : function () {},\n\n/**\n * @method Bone\n * @constructor\n */\nBone : function () {},\n\n};\n\n/**\n * @class BatchNode\n */\nccs.BatchNode = {\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::BatchNode*\"\n */\ncreate : function () {},\n\n};\n\n/**\n * @class ArmatureAnimation\n */\nccs.ArmatureAnimation = {\n\n/**\n * @method getSpeedScale\n * @return A value converted from C/C++ \"float\"\n */\ngetSpeedScale : function () {},\n\n/**\n * @method pause\n */\npause : function () {},\n\n/**\n * @method setSpeedScale\n * @param {float}\n */\nsetSpeedScale : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n * @param {cocostudio::Armature*}\n */\ninit : function () {},\n\n/**\n * @method playWithIndexes\n * @param {const std::vector<int, std::allocator<int> >&}\n * @param {int}\n * @param {bool}\n */\nplayWithIndexes : function () {},\n\n/**\n * @method play\n * @param {const std::string&}\n * @param {int}\n * @param {int}\n */\nplay : function () {},\n\n/**\n * @method gotoAndPause\n * @param {int}\n */\ngotoAndPause : function () {},\n\n/**\n * @method resume\n */\nresume : function () {},\n\n/**\n * @method stop\n */\nstop : function () {},\n\n/**\n * @method update\n * @param {float}\n */\nupdate : function () {},\n\n/**\n * @method getAnimationData\n * @return A value converted from C/C++ \"cocostudio::AnimationData*\"\n */\ngetAnimationData : function () {},\n\n/**\n * @method playWithIndex\n * @param {int}\n * @param {int}\n * @param {int}\n */\nplayWithIndex : function () {},\n\n/**\n * @method getCurrentMovementID\n * @return A value converted from C/C++ \"std::string\"\n */\ngetCurrentMovementID : function () {},\n\n/**\n * @method setAnimationData\n * @param {cocostudio::AnimationData*}\n */\nsetAnimationData : function () {},\n\n/**\n * @method gotoAndPlay\n * @param {int}\n */\ngotoAndPlay : function () {},\n\n/**\n * @method playWithNames\n * @param {const std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > >&}\n * @param {int}\n * @param {bool}\n */\nplayWithNames : function () {},\n\n/**\n * @method getMovementCount\n * @return A value converted from C/C++ \"ssize_t\"\n */\ngetMovementCount : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ArmatureAnimation*\"\n * @param {cocostudio::Armature*}\n */\ncreate : function () {},\n\n/**\n * @method ArmatureAnimation\n * @constructor\n */\nArmatureAnimation : function () {},\n\n};\n\n/**\n * @class ArmatureDataManager\n */\nccs.ArmatureDataManager = {\n\n/**\n * @method getAnimationDatas\n * @return A value converted from C/C++ \"const cocos2d::Map<std::basic_string<char>, cocostudio::AnimationData *>&\"\n */\ngetAnimationDatas : function () {},\n\n/**\n * @method removeAnimationData\n * @param {const std::string&}\n */\nremoveAnimationData : function () {},\n\n/**\n * @method addArmatureData\n * @param {const std::string&}\n * @param {cocostudio::ArmatureData*}\n * @param {const std::string&}\n */\naddArmatureData : function () {},\n\n/**\n * @method removeArmatureFileInfo\n * @param {const std::string&}\n */\nremoveArmatureFileInfo : function () {},\n\n/**\n * @method getTextureDatas\n * @return A value converted from C/C++ \"const cocos2d::Map<std::basic_string<char>, cocostudio::TextureData *>&\"\n */\ngetTextureDatas : function () {},\n\n/**\n * @method getTextureData\n * @return A value converted from C/C++ \"cocostudio::TextureData*\"\n * @param {const std::string&}\n */\ngetTextureData : function () {},\n\n/**\n * @method getArmatureData\n * @return A value converted from C/C++ \"cocostudio::ArmatureData*\"\n * @param {const std::string&}\n */\ngetArmatureData : function () {},\n\n/**\n * @method getAnimationData\n * @return A value converted from C/C++ \"cocostudio::AnimationData*\"\n * @param {const std::string&}\n */\ngetAnimationData : function () {},\n\n/**\n * @method addAnimationData\n * @param {const std::string&}\n * @param {cocostudio::AnimationData*}\n * @param {const std::string&}\n */\naddAnimationData : function () {},\n\n/**\n * @method init\n * @return A value converted from C/C++ \"bool\"\n */\ninit : function () {},\n\n/**\n * @method removeArmatureData\n * @param {const std::string&}\n */\nremoveArmatureData : function () {},\n\n/**\n * @method getArmatureDatas\n * @return A value converted from C/C++ \"const cocos2d::Map<std::basic_string<char>, cocostudio::ArmatureData *>&\"\n */\ngetArmatureDatas : function () {},\n\n/**\n * @method removeTextureData\n * @param {const std::string&}\n */\nremoveTextureData : function () {},\n\n/**\n * @method addTextureData\n * @param {const std::string&}\n * @param {cocostudio::TextureData*}\n * @param {const std::string&}\n */\naddTextureData : function () {},\n\n/**\n * @method isAutoLoadSpriteFile\n * @return A value converted from C/C++ \"bool\"\n */\nisAutoLoadSpriteFile : function () {},\n\n/**\n * @method addSpriteFrameFromFile\n * @param {const std::string&}\n * @param {const std::string&}\n * @param {const std::string&}\n */\naddSpriteFrameFromFile : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::ArmatureDataManager*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class Armature\n */\nccs.Armature = {\n\n/**\n * @method getBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n * @param {const std::string&}\n */\ngetBone : function () {},\n\n/**\n * @method changeBoneParent\n * @param {cocostudio::Bone*}\n * @param {const std::string&}\n */\nchangeBoneParent : function () {},\n\n/**\n * @method setAnimation\n * @param {cocostudio::ArmatureAnimation*}\n */\nsetAnimation : function () {},\n\n/**\n * @method getBoneAtPoint\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n * @param {float}\n * @param {float}\n */\ngetBoneAtPoint : function () {},\n\n/**\n * @method getArmatureTransformDirty\n * @return A value converted from C/C++ \"bool\"\n */\ngetArmatureTransformDirty : function () {},\n\n/**\n * @method setVersion\n * @param {float}\n */\nsetVersion : function () {},\n\n/**\n * @method updateOffsetPoint\n */\nupdateOffsetPoint : function () {},\n\n/**\n * @method getParentBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n */\ngetParentBone : function () {},\n\n/**\n * @method setArmatureData\n * @param {cocostudio::ArmatureData*}\n */\nsetArmatureData : function () {},\n\n/**\n * @method removeBone\n * @param {cocostudio::Bone*}\n * @param {bool}\n */\nremoveBone : function () {},\n\n/**\n * @method getBatchNode\n * @return A value converted from C/C++ \"cocostudio::BatchNode*\"\n */\ngetBatchNode : function () {},\n\n/**\n * @method getName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetName : function () {},\n\n/**\n * @method setParentBone\n * @param {cocostudio::Bone*}\n */\nsetParentBone : function () {},\n\n/**\n * @method drawContour\n */\ndrawContour : function () {},\n\n/**\n * @method setBatchNode\n * @param {cocostudio::BatchNode*}\n */\nsetBatchNode : function () {},\n\n/**\n * @method setName\n * @param {const std::string&}\n */\nsetName : function () {},\n\n/**\n * @method addBone\n * @param {cocostudio::Bone*}\n * @param {const std::string&}\n */\naddBone : function () {},\n\n/**\n * @method getArmatureData\n * @return A value converted from C/C++ \"cocostudio::ArmatureData*\"\n */\ngetArmatureData : function () {},\n\n/**\n * @method getVersion\n * @return A value converted from C/C++ \"float\"\n */\ngetVersion : function () {},\n\n/**\n * @method getAnimation\n * @return A value converted from C/C++ \"cocostudio::ArmatureAnimation*\"\n */\ngetAnimation : function () {},\n\n/**\n * @method getBoneDic\n * @return A value converted from C/C++ \"const cocos2d::Map<std::basic_string<char>, cocostudio::Bone *>&\"\n */\ngetBoneDic : function () {},\n\n/**\n * @method Armature\n * @constructor\n */\nArmature : function () {},\n\n};\n\n/**\n * @class Skin\n */\nccs.Skin = {\n\n/**\n * @method getBone\n * @return A value converted from C/C++ \"cocostudio::Bone*\"\n */\ngetBone : function () {},\n\n/**\n * @method getNodeToWorldTransformAR\n * @return A value converted from C/C++ \"kmMat4\"\n */\ngetNodeToWorldTransformAR : function () {},\n\n/**\n * @method initWithFile\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\ninitWithFile : function () {},\n\n/**\n * @method getDisplayName\n * @return A value converted from C/C++ \"const std::string&\"\n */\ngetDisplayName : function () {},\n\n/**\n * @method updateArmatureTransform\n */\nupdateArmatureTransform : function () {},\n\n/**\n * @method initWithSpriteFrameName\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\ninitWithSpriteFrameName : function () {},\n\n/**\n * @method setBone\n * @param {cocostudio::Bone*}\n */\nsetBone : function () {},\n\n/**\n * @method createWithSpriteFrameName\n * @return A value converted from C/C++ \"cocostudio::Skin*\"\n * @param {const std::string&}\n */\ncreateWithSpriteFrameName : function () {},\n\n/**\n * @method Skin\n * @constructor\n */\nSkin : function () {},\n\n};\n\n/**\n * @class ComAttribute\n */\nccs.ComAttribute = {\n\n/**\n * @method getFloat\n * @return A value converted from C/C++ \"float\"\n * @param {const std::string&}\n * @param {float}\n */\ngetFloat : function () {},\n\n/**\n * @method getString\n * @return A value converted from C/C++ \"std::string\"\n * @param {const std::string&}\n * @param {const std::string&}\n */\ngetString : function () {},\n\n/**\n * @method setFloat\n * @param {const std::string&}\n * @param {float}\n */\nsetFloat : function () {},\n\n/**\n * @method setString\n * @param {const std::string&}\n * @param {const std::string&}\n */\nsetString : function () {},\n\n/**\n * @method getBool\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n * @param {bool}\n */\ngetBool : function () {},\n\n/**\n * @method setInt\n * @param {const std::string&}\n * @param {int}\n */\nsetInt : function () {},\n\n/**\n * @method parse\n * @return A value converted from C/C++ \"bool\"\n * @param {const std::string&}\n */\nparse : function () {},\n\n/**\n * @method getInt\n * @return A value converted from C/C++ \"int\"\n * @param {const std::string&}\n * @param {int}\n */\ngetInt : function () {},\n\n/**\n * @method setBool\n * @param {const std::string&}\n * @param {bool}\n */\nsetBool : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ComAttribute*\"\n */\ncreate : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n};\n\n/**\n * @class ComAudio\n */\nccs.ComAudio = {\n\n/**\n * @method stopAllEffects\n */\nstopAllEffects : function () {},\n\n/**\n * @method getEffectsVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetEffectsVolume : function () {},\n\n/**\n * @method stopEffect\n * @param {unsigned int}\n */\nstopEffect : function () {},\n\n/**\n * @method getBackgroundMusicVolume\n * @return A value converted from C/C++ \"float\"\n */\ngetBackgroundMusicVolume : function () {},\n\n/**\n * @method willPlayBackgroundMusic\n * @return A value converted from C/C++ \"bool\"\n */\nwillPlayBackgroundMusic : function () {},\n\n/**\n * @method setBackgroundMusicVolume\n * @param {float}\n */\nsetBackgroundMusicVolume : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method pauseBackgroundMusic\n */\npauseBackgroundMusic : function () {},\n\n/**\n * @method isBackgroundMusicPlaying\n * @return A value converted from C/C++ \"bool\"\n */\nisBackgroundMusicPlaying : function () {},\n\n/**\n * @method isLoop\n * @return A value converted from C/C++ \"bool\"\n */\nisLoop : function () {},\n\n/**\n * @method resumeAllEffects\n */\nresumeAllEffects : function () {},\n\n/**\n * @method pauseAllEffects\n */\npauseAllEffects : function () {},\n\n/**\n * @method preloadBackgroundMusic\n * @param {const char*}\n */\npreloadBackgroundMusic : function () {},\n\n/**\n * @method preloadEffect\n * @param {const char*}\n */\npreloadEffect : function () {},\n\n/**\n * @method setLoop\n * @param {bool}\n */\nsetLoop : function () {},\n\n/**\n * @method unloadEffect\n * @param {const char*}\n */\nunloadEffect : function () {},\n\n/**\n * @method rewindBackgroundMusic\n */\nrewindBackgroundMusic : function () {},\n\n/**\n * @method pauseEffect\n * @param {unsigned int}\n */\npauseEffect : function () {},\n\n/**\n * @method resumeBackgroundMusic\n */\nresumeBackgroundMusic : function () {},\n\n/**\n * @method setFile\n * @param {const char*}\n */\nsetFile : function () {},\n\n/**\n * @method setEffectsVolume\n * @param {float}\n */\nsetEffectsVolume : function () {},\n\n/**\n * @method getFile\n * @return A value converted from C/C++ \"const char*\"\n */\ngetFile : function () {},\n\n/**\n * @method resumeEffect\n * @param {unsigned int}\n */\nresumeEffect : function () {},\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ComAudio*\"\n */\ncreate : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n};\n\n/**\n * @class ComController\n */\nccs.ComController = {\n\n/**\n * @method create\n * @return A value converted from C/C++ \"cocostudio::ComController*\"\n */\ncreate : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n/**\n * @method ComController\n * @constructor\n */\nComController : function () {},\n\n};\n\n/**\n * @class ComRender\n */\nccs.ComRender = {\n\n/**\n * @method setNode\n * @param {cocos2d::Node*}\n */\nsetNode : function () {},\n\n/**\n * @method getNode\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n */\ngetNode : function () {},\n\n/**\n * @method createInstance\n * @return A value converted from C/C++ \"cocos2d::Object*\"\n */\ncreateInstance : function () {},\n\n};\n\n/**\n * @class GUIReader\n */\nccs.GUIReader = {\n\n/**\n * @method widgetFromJsonFile\n * @return A value converted from C/C++ \"cocos2d::gui::Widget*\"\n * @param {const char*}\n */\nwidgetFromJsonFile : function () {},\n\n/**\n * @method getVersionInteger\n * @return A value converted from C/C++ \"int\"\n * @param {const char*}\n */\ngetVersionInteger : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::GUIReader*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class SceneReader\n */\nccs.SceneReader = {\n\n/**\n * @method setTarget\n * @param {const std::function<void (cocos2d::Object *, void *)>&}\n */\nsetTarget : function () {},\n\n/**\n * @method createNodeWithSceneFile\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {const std::string&}\n */\ncreateNodeWithSceneFile : function () {},\n\n/**\n * @method getNodeByTag\n * @return A value converted from C/C++ \"cocos2d::Node*\"\n * @param {int}\n */\ngetNodeByTag : function () {},\n\n/**\n * @method destroyInstance\n */\ndestroyInstance : function () {},\n\n/**\n * @method sceneReaderVersion\n * @return A value converted from C/C++ \"const char*\"\n */\nsceneReaderVersion : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocostudio::SceneReader*\"\n */\ngetInstance : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos_jsb_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsb\n\nLOCAL_SRC_FILES := ScriptingCore.cpp \\\n                   cocos2d_specifics.cpp \\\n                   js_manual_conversions.cpp \\\n                   js_bindings_core.cpp \\\n                   js_bindings_opengl.cpp \\\n                   jsb_opengl_functions.cpp \\\n                   jsb_opengl_manual.cpp \\\n                   jsb_opengl_registration.cpp \\\n                   ../../auto-generated/js-bindings/jsb_cocos2dx_auto.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../audio/include \\\n                    $(LOCAL_PATH)/../../../storage \\\n                    $(LOCAL_PATH)/../../auto-generated/js-bindings \\\n                    $(LOCAL_PATH)/../../../../extensions \\\n                    $(LOCAL_PATH)/../../../editor-support/spine \\\n                    $(LOCAL_PATH)/../../../editor-support\n\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \\\n                           $(LOCAL_PATH)/../../auto-generated/js-bindings \\\n                           $(LOCAL_PATH)/../../../audio/include \n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static\nLOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,2d)\n$(call import-module,audio/android)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/ScriptingCore.cpp",
    "content": "//\n//  ScriptingCore.cpp\n//  testmonkey\n//\n//  Created by Rolando Abarca on 3/14/12.\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n#include <iostream>\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <vector>\n#include <map>\n#include \"ScriptingCore.h\"\n#include \"jsdbgapi.h\"\n#include \"cocos2d.h\"\n#include \"local-storage/LocalStorage.h\"\n#include \"cocos2d_specifics.hpp\"\n#include \"js_bindings_config.h\"\n// for debug socket\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n#include <io.h>\n#include <WS2tcpip.h>\n#else\n#include <sys/socket.h>\n#include <unistd.h>\n#include <netdb.h>\n#endif\n\n#include <thread>\n\n#ifdef ANDROID\n#include <android/log.h>\n#include <jni/JniHelper.h>\n#include <netinet/in.h>\n#endif\n\n#ifdef ANDROID\n#define  LOG_TAG    \"ScriptingCore.cpp\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n#else\n#define  LOGD(...) js_log(__VA_ARGS__)\n#endif\n\n#include \"js_bindings_config.h\"\n\n#if COCOS2D_DEBUG\n#define TRACE_DEBUGGER_SERVER(...) CCLOG(__VA_ARGS__)\n#else\n#define TRACE_DEBUGGER_SERVER(...)\n#endif // #if DEBUG\n\n#define BYTE_CODE_FILE_EXT \".jsc\"\n\nusing namespace cocos2d;\n\nstatic std::string inData;\nstatic std::string outData;\nstatic std::vector<std::string> g_queue;\nstatic std::mutex g_qMutex;\nstatic std::mutex g_rwMutex;\nstatic int clientSocket = -1;\nstatic uint32_t s_nestedLoopLevel = 0;\n\n// server entry point for the bg thread\nstatic void serverEntryPoint(void);\n\njs_proxy_t *_native_js_global_ht = NULL;\njs_proxy_t *_js_native_global_ht = NULL;\nstd::unordered_map<std::string, js_type_class_t*> _js_global_type_map;\n\nstatic char *_js_log_buf = NULL;\n\nstatic std::vector<sc_register_sth> registrationList;\n\n// name ~> JSScript map\nstatic std::unordered_map<std::string, JSScript*> filename_script;\n// port ~> socket map\nstatic std::unordered_map<int,int> ports_sockets;\n// name ~> globals\nstatic std::unordered_map<std::string, js::RootedObject*> globals;\n\nstatic void ReportException(JSContext *cx)\n{\n    if (JS_IsExceptionPending(cx)) {\n        if (!JS_ReportPendingException(cx)) {\n            JS_ClearPendingException(cx);\n        }\n    }\n}\n\nstatic void executeJSFunctionFromReservedSpot(JSContext *cx, JSObject *obj,\n                                              jsval &dataVal, jsval &retval) {\n\n    jsval func = JS_GetReservedSlot(obj, 0);\n\n    if (func == JSVAL_VOID) { return; }\n    jsval thisObj = JS_GetReservedSlot(obj, 1);\n    JSAutoCompartment ac(cx, obj);\n    \n    if (thisObj == JSVAL_VOID) {\n        JS_CallFunctionValue(cx, obj, func, 1, &dataVal, &retval);\n    } else {\n        assert(!JSVAL_IS_PRIMITIVE(thisObj));\n        JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(thisObj), func, 1, &dataVal, &retval);\n    }\n}\n\nstatic void getTouchesFuncName(EventTouch::EventCode eventCode, std::string &funcName)\n{\n    switch(eventCode)\n    {\n        case EventTouch::EventCode::BEGAN:\n            funcName = \"onTouchesBegan\";\n            break;\n        case EventTouch::EventCode::ENDED:\n            funcName = \"onTouchesEnded\";\n            break;\n        case EventTouch::EventCode::MOVED:\n            funcName = \"onTouchesMoved\";\n            break;\n        case EventTouch::EventCode::CANCELLED:\n            funcName = \"onTouchesCancelled\";\n            break;\n    }\n}\n\nstatic void getTouchFuncName(EventTouch::EventCode eventCode, std::string &funcName)\n{\n    switch(eventCode) {\n        case EventTouch::EventCode::BEGAN:\n            funcName = \"onTouchBegan\";\n            break;\n        case EventTouch::EventCode::ENDED:\n            funcName = \"onTouchEnded\";\n            break;\n        case EventTouch::EventCode::MOVED:\n            funcName = \"onTouchMoved\";\n            break;\n        case EventTouch::EventCode::CANCELLED:\n            funcName = \"onTouchCancelled\";\n            break;\n    }\n}\n\nstatic void rootObject(JSContext *cx, JSObject *obj) {\n    JS_AddNamedObjectRoot(cx, &obj, \"unnamed\");\n}\n\n\nstatic void unRootObject(JSContext *cx, JSObject *obj) {\n    JS_RemoveObjectRoot(cx, &obj);\n}\n\nstatic void getJSTouchObject(JSContext *cx, Touch *x, jsval &jsret) {\n    js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Touch>(cx, x);\n    jsret = OBJECT_TO_JSVAL(proxy->obj);\n}\n\nstatic void removeJSTouchObject(JSContext *cx, Touch *x, jsval &jsret) {\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    void *ptr = (void*)x;\n    nproxy = jsb_get_native_proxy(ptr);\n    if (nproxy) {\n        jsproxy = jsb_get_js_proxy(nproxy->obj);\n        JS_RemoveObjectRoot(cx, &jsproxy->obj);\n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid ScriptingCore::executeJSFunctionWithThisObj(jsval thisObj,\n                                                 jsval callback,\n                                                 uint32_t argc/* = 0*/,\n                                                 jsval* vp/* = NULL*/,\n                                                 jsval* retVal/* = NULL*/)\n{\n    if (callback != JSVAL_VOID || thisObj != JSVAL_VOID)\n    {\n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n        \n        // Very important: The last parameter 'retVal' passed to 'JS_CallFunctionValue' should not be a NULL pointer.\n        // If it's a NULL pointer, crash will be triggered in 'JS_CallFunctionValue'. To find out the reason of this crash is very difficult.\n        // So we have to check the availability of 'retVal'.\n        if (retVal)\n        {\n            JS_CallFunctionValue(_cx, JSVAL_TO_OBJECT(thisObj), callback, argc, vp, retVal);\n        }\n        else\n        {\n            jsval jsRet;\n            JS_CallFunctionValue(_cx, JSVAL_TO_OBJECT(thisObj), callback, argc, vp, &jsRet);\n        }\n    }\n}\n\nvoid js_log(const char *format, ...) {\n\n    if (_js_log_buf == NULL)\n    {\n        _js_log_buf = (char *)calloc(sizeof(char), MAX_LOG_LENGTH+1);\n        _js_log_buf[MAX_LOG_LENGTH] = '\\0';\n    }\n    va_list vl;\n    va_start(vl, format);\n    int len = vsnprintf(_js_log_buf, MAX_LOG_LENGTH, format, vl);\n    va_end(vl);\n    if (len > 0)\n    {\n        CCLOG(\"JS: %s\\n\", _js_log_buf);\n    }\n}\n\n#define JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES 1\n\nJSBool JSBCore_platform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc!=0)\n    {\n        JS_ReportError(cx, \"Invalid number of arguments in __getPlatform\");\n        return JS_FALSE;\n    }\n\n    JSString * platform;\n\n    // config.deviceType: Device Type\n    // 'mobile' for any kind of mobile devices, 'desktop' for PCs, 'browser' for Web Browsers\n    // #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n    //     platform = JS_InternString(_cx, \"desktop\");\n    // #else\n    platform = JS_InternString(cx, \"mobile\");\n    // #endif\n\n    jsval ret = STRING_TO_JSVAL(platform);\n\n    JS_SET_RVAL(cx, vp, ret);\n\n    return JS_TRUE;\n};\n\nJSBool JSBCore_version(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc!=0)\n    {\n        JS_ReportError(cx, \"Invalid number of arguments in __getVersion\");\n        return JS_FALSE;\n    }\n\n    char version[256];\n    snprintf(version, sizeof(version)-1, \"%s\", cocos2dVersion());\n    JSString * js_version = JS_InternString(cx, version);\n\n    jsval ret = STRING_TO_JSVAL(js_version);\n    JS_SET_RVAL(cx, vp, ret);\n\n    return JS_TRUE;\n};\n\nJSBool JSBCore_os(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc!=0)\n    {\n        JS_ReportError(cx, \"Invalid number of arguments in __getOS\");\n        return JS_FALSE;\n    }\n\n    JSString * os;\n\n    // osx, ios, android, windows, linux, etc..\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    os = JS_InternString(cx, \"ios\");\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n    os = JS_InternString(cx, \"android\");\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n    os = JS_InternString(cx, \"windows\");\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)\n    os = JS_InternString(cx, \"marmalade\");\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)\n    os = JS_InternString(cx, \"linux\");\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)\n    os = JS_InternString(cx, \"bada\");\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)\n    os = JS_InternString(cx, \"blackberry\");\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n    os = JS_InternString(cx, \"osx\");\n#else\n    os = JS_InternString(cx, \"unknown\");\n#endif\n\n    jsval ret = STRING_TO_JSVAL(os);\n    JS_SET_RVAL(cx, vp, ret);\n\n    return JS_TRUE;\n};\n\nJSBool JSB_core_restartVM(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments in executeScript\");\n    ScriptingCore::getInstance()->reset();\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n};\n\nvoid registerDefaultClasses(JSContext* cx, JSObject* global) {\n    // first, try to get the ns\n    JS::RootedValue nsval(cx);\n    JSObject *ns;\n    JS_GetProperty(cx, global, \"cc\", &nsval);\n    if (nsval == JSVAL_VOID) {\n        ns = JS_NewObject(cx, NULL, NULL, NULL);\n        nsval = OBJECT_TO_JSVAL(ns);\n        JS_SetProperty(cx, global, \"cc\", nsval);\n    } else {\n        JS_ValueToObject(cx, nsval, &ns);\n    }\n\n    //\n    // Javascript controller (__jsc__)\n    //\n    JSObject *jsc = JS_NewObject(cx, NULL, NULL, NULL);\n    JS::RootedValue jscVal(cx);\n    jscVal = OBJECT_TO_JSVAL(jsc);\n    JS_SetProperty(cx, global, \"__jsc__\", jscVal);\n\n    JS_DefineFunction(cx, jsc, \"garbageCollect\", ScriptingCore::forceGC, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(cx, jsc, \"dumpRoot\", ScriptingCore::dumpRoot, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(cx, jsc, \"addGCRootObject\", ScriptingCore::addRootJS, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(cx, jsc, \"removeGCRootObject\", ScriptingCore::removeRootJS, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(cx, jsc, \"executeScript\", ScriptingCore::executeScript, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\n    // register some global functions\n    JS_DefineFunction(cx, global, \"require\", ScriptingCore::executeScript, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"log\", ScriptingCore::log, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"executeScript\", ScriptingCore::executeScript, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"forceGC\", ScriptingCore::forceGC, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, global, \"__getPlatform\", JSBCore_platform, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"__getOS\", JSBCore_os, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"__getVersion\", JSBCore_version, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"__restartVM\", JSB_core_restartVM, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n}\n\nstatic void sc_finalize(JSFreeOp *freeOp, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (global class)\", obj);\n}\n\nstatic JSClass global_class = {\n    \"global\", JSCLASS_GLOBAL_FLAGS,\n    JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,\n    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, sc_finalize,\n    JSCLASS_NO_OPTIONAL_MEMBERS\n};\n\nScriptingCore::ScriptingCore()\n: _rt(nullptr)\n, _cx(nullptr)\n, _global(nullptr)\n, _debugGlobal(nullptr)\n{\n    // set utf8 strings internally (we don't need utf16)\n    // XXX: Removed in SpiderMonkey 19.0\n    //JS_SetCStringsAreUTF8();\n    this->addRegisterCallback(registerDefaultClasses);\n    this->_runLoop = new SimpleRunLoop();\n}\n\nvoid ScriptingCore::string_report(jsval val) {\n    if (JSVAL_IS_NULL(val)) {\n        LOGD(\"val : (JSVAL_IS_NULL(val)\");\n        // return 1;\n    } else if ((JSVAL_IS_BOOLEAN(val)) &&\n               (JS_FALSE == (JSVAL_TO_BOOLEAN(val)))) {\n        LOGD(\"val : (return value is JS_FALSE\");\n        // return 1;\n    } else if (JSVAL_IS_STRING(val)) {\n        JSString *str = JS_ValueToString(this->getGlobalContext(), val);\n        if (NULL == str) {\n            LOGD(\"val : return string is NULL\");\n        } else {\n            JSStringWrapper wrapper(str);\n            LOGD(\"val : return string =\\n%s\\n\", wrapper.get());\n        }\n    } else if (JSVAL_IS_NUMBER(val)) {\n        double number;\n        if (JS_FALSE ==\n            JS_ValueToNumber(this->getGlobalContext(), val, &number)) {\n            LOGD(\"val : return number could not be converted\");\n        } else {\n            LOGD(\"val : return number =\\n%f\", number);\n        }\n    }\n}\n\nJSBool ScriptingCore::evalString(const char *string, jsval *outVal, const char *filename, JSContext* cx, JSObject* global)\n{\n    if (cx == NULL)\n        cx = _cx;\n    if (global == NULL)\n        global = _global;\n    \n    JSAutoCompartment ac(cx, global);\n    \n    JSScript* script = JS_CompileScript(cx, global, string, strlen(string), filename, 1);\n    if (script)\n    {\n        JSBool evaluatedOK = JS_ExecuteScript(cx, global, script, outVal);\n        if (JS_FALSE == evaluatedOK)\n        {\n            fprintf(stderr, \"(evaluatedOK == JS_FALSE)\\n\");\n        }\n        return evaluatedOK;\n    }\n    return JS_FALSE;\n}\n\nvoid ScriptingCore::start() {\n    // for now just this\n    this->createGlobalContext();\n}\n\nvoid ScriptingCore::addRegisterCallback(sc_register_sth callback) {\n    registrationList.push_back(callback);\n}\n\nvoid ScriptingCore::removeAllRoots(JSContext *cx) {\n    js_proxy_t *current, *tmp;\n    HASH_ITER(hh, _js_native_global_ht, current, tmp) {\n        JS_RemoveObjectRoot(cx, &current->obj);\n        HASH_DEL(_js_native_global_ht, current);\n        free(current);\n    }\n    HASH_ITER(hh, _native_js_global_ht, current, tmp) {\n        HASH_DEL(_native_js_global_ht, current);\n        free(current);\n    }\n    HASH_CLEAR(hh, _js_native_global_ht);\n    HASH_CLEAR(hh, _native_js_global_ht);\n}\n\nstatic JSPrincipals shellTrustedPrincipals = { 1 };\n\nstatic JSBool\nCheckObjectAccess(JSContext *cx, js::HandleObject obj, js::HandleId id, JSAccessMode mode,\n                  js::MutableHandleValue vp)\n{\n    return JS_TRUE;\n}\n\nstatic JSSecurityCallbacks securityCallbacks = {\n    CheckObjectAccess,\n    NULL\n};\n\nvoid ScriptingCore::createGlobalContext() {\n    if (this->_cx && this->_rt) {\n        ScriptingCore::removeAllRoots(this->_cx);\n        JS_DestroyContext(this->_cx);\n        JS_DestroyRuntime(this->_rt);\n        this->_cx = NULL;\n        this->_rt = NULL;\n    }\n    \n    // Start the engine. Added in SpiderMonkey v25\n    if (!JS_Init())\n        return;\n    \n    // Removed from Spidermonkey 19.\n    //JS_SetCStringsAreUTF8();\n    this->_rt = JS_NewRuntime(8L * 1024L * 1024L, JS_USE_HELPER_THREADS);\n    JS_SetGCParameter(_rt, JSGC_MAX_BYTES, 0xffffffff);\n\t\n    JS_SetTrustedPrincipals(_rt, &shellTrustedPrincipals);\n    JS_SetSecurityCallbacks(_rt, &securityCallbacks);\n\tJS_SetNativeStackQuota(_rt, JSB_MAX_STACK_QUOTA);\n    \n    this->_cx = JS_NewContext(_rt, 8192);\n    \n    JS_SetOptions(this->_cx, JSOPTION_TYPE_INFERENCE);\n    \n//    JS_SetVersion(this->_cx, JSVERSION_LATEST);\n    \n    // Only disable METHODJIT on iOS.\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n//    JS_SetOptions(this->_cx, JS_GetOptions(this->_cx) & ~JSOPTION_METHODJIT);\n//    JS_SetOptions(this->_cx, JS_GetOptions(this->_cx) & ~JSOPTION_METHODJIT_ALWAYS);\n#endif\n    \n    JS_SetErrorReporter(this->_cx, ScriptingCore::reportError);\n#if defined(JS_GC_ZEAL) && defined(DEBUG)\n    //JS_SetGCZeal(this->_cx, 2, JS_DEFAULT_ZEAL_FREQ);\n#endif\n    this->_global = NewGlobalObject(_cx);\n\n    JSAutoCompartment ac(_cx, _global);\n    js::SetDefaultObjectForContext(_cx, _global);\n    \n    for (std::vector<sc_register_sth>::iterator it = registrationList.begin(); it != registrationList.end(); it++) {\n        sc_register_sth callback = *it;\n        callback(this->_cx, this->_global);\n    }\n}\n\nstatic std::string RemoveFileExt(const std::string& filePath) {\n    size_t pos = filePath.rfind('.');\n    if (0 < pos) {\n        return filePath.substr(0, pos);\n    }\n    else {\n        return filePath;\n    }\n}\n\nJSBool ScriptingCore::runScript(const char *path, JSObject* global, JSContext* cx)\n{\n    if (!path) {\n        return false;\n    }\n    \n    \n    cocos2d::FileUtils *futil = cocos2d::FileUtils::getInstance();\n\n    if (global == NULL) {\n        global = _global;\n    }\n    if (cx == NULL) {\n        cx = _cx;\n    }\n    \n    JSAutoCompartment ac(cx, global);\n    \n    js::RootedScript script(cx);\n    js::RootedObject obj(cx, global);\n    \n    // a) check jsc file first\n    std::string byteCodePath = RemoveFileExt(std::string(path)) + BYTE_CODE_FILE_EXT;\n\n    Data data = futil->getDataFromFile(byteCodePath);\n    \n    if (!data.isNull())\n    {\n        script = JS_DecodeScript(cx, data.getBytes(), static_cast<uint32_t>(data.getSize()), nullptr, nullptr);\n    }\n    \n    // b) no jsc file, check js file\n    if (!script)\n    {\n        /* Clear any pending exception from previous failed decoding.  */\n        ReportException(cx);\n        \n        std::string fullPath = futil->fullPathForFilename(path);\n        JS::CompileOptions options(cx);\n        options.setUTF8(true).setFileAndLine(fullPath.c_str(), 1);\n        \n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n        std::string jsFileContent = futil->getStringFromFile(fullPath);\n        if (!jsFileContent.empty())\n        {\n            script = JS::Compile(cx, obj, options, jsFileContent.c_str(), jsFileContent.size());\n        }\n#else\n        script = JS::Compile(cx, obj, options, fullPath.c_str());\n#endif\n    }\n    \n    JSBool evaluatedOK = false;\n    if (script) {\n        jsval rval;\n        filename_script[path] = script;\n\n        evaluatedOK = JS_ExecuteScript(cx, global, script, &rval);\n        if (JS_FALSE == evaluatedOK) {\n            cocos2d::log(\"(evaluatedOK == JS_FALSE)\");\n            JS_ReportPendingException(cx);\n        }\n    }\n    return evaluatedOK;\n}\n\nvoid ScriptingCore::reset()\n{\n    cleanup();\n    start();\n}\n\nScriptingCore::~ScriptingCore()\n{\n    cleanup();\n}\n\nvoid ScriptingCore::cleanup()\n{\n    localStorageFree();\n    removeAllRoots(_cx);\n    if (_cx)\n    {\n        JS_DestroyContext(_cx);\n        _cx = NULL;\n    }\n    if (_rt)\n    {\n        JS_DestroyRuntime(_rt);\n        _rt = NULL;\n    }\n    JS_ShutDown();\n    if (_js_log_buf) {\n        free(_js_log_buf);\n        _js_log_buf = NULL;\n    }\n\n    for (auto iter = _js_global_type_map.begin(); iter != _js_global_type_map.end(); ++iter)\n    {\n        free(iter->second->jsclass);\n        free(iter->second);\n    }\n    \n    _js_global_type_map.clear();\n}\n\nvoid ScriptingCore::reportError(JSContext *cx, const char *message, JSErrorReport *report)\n{\n    js_log(\"%s:%u:%s\\n\",\n            report->filename ? report->filename : \"<no filename=\\\"filename\\\">\",\n            (unsigned int) report->lineno,\n            message);\n};\n\n\nJSBool ScriptingCore::log(JSContext* cx, uint32_t argc, jsval *vp)\n{\n    if (argc > 0) {\n        JSString *string = NULL;\n        JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"S\", &string);\n        if (string) {\n            JSStringWrapper wrapper(string);\n            js_log(\"%s\", wrapper.get());\n        }\n    }\n    return JS_TRUE;\n}\n\n\nvoid ScriptingCore::removeScriptObjectByObject(Object* pObj)\n{\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    void *ptr = (void*)pObj;\n    nproxy = jsb_get_native_proxy(ptr);\n    if (nproxy) {\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        jsproxy = jsb_get_js_proxy(nproxy->obj);\n        JS_RemoveObjectRoot(cx, &jsproxy->obj);\n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\n\nJSBool ScriptingCore::setReservedSpot(uint32_t i, JSObject *obj, jsval value) {\n    JS_SetReservedSlot(obj, i, value);\n    return JS_TRUE;\n}\n\nJSBool ScriptingCore::executeScript(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1) {\n        jsval* argv = JS_ARGV(cx, vp);\n        JSString* str = JS_ValueToString(cx, argv[0]);\n        JSStringWrapper path(str);\n        JSBool res = false;\n        if (argc == 2 && argv[1].isString()) {\n            JSString* globalName = JSVAL_TO_STRING(argv[1]);\n            JSStringWrapper name(globalName);\n//            js::RootedObject* rootedGlobal = globals[name];\n            JSObject* debugObj = ScriptingCore::getInstance()->getDebugGlobal();\n            if (debugObj) {\n                res = ScriptingCore::getInstance()->runScript(path.get(), debugObj);\n            } else {\n                JS_ReportError(cx, \"Invalid global object: %s\", name.get());\n                return JS_FALSE;\n            }\n        } else {\n            JSObject* glob = JS::CurrentGlobalOrNull(cx);\n            res = ScriptingCore::getInstance()->runScript(path.get(), glob);\n        }\n        return res;\n    }\n    return JS_TRUE;\n}\n\nJSBool ScriptingCore::forceGC(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSRuntime *rt = JS_GetRuntime(cx);\n    JS_GC(rt);\n    return JS_TRUE;\n}\n\n//static void dumpNamedRoot(const char *name, void *addr,  JSGCRootType type, void *data)\n//{\n//    CCLOG(\"Root: '%s' at %p\", name, addr);\n//}\n\nJSBool ScriptingCore::dumpRoot(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    // JS_DumpNamedRoots is only available on DEBUG versions of SpiderMonkey.\n    // Mac and Simulator versions were compiled with DEBUG.\n#if COCOS2D_DEBUG\n//    JSContext *_cx = ScriptingCore::getInstance()->getGlobalContext();\n//    JSRuntime *rt = JS_GetRuntime(_cx);\n//    JS_DumpNamedRoots(rt, dumpNamedRoot, NULL);\n//    JS_DumpHeap(rt, stdout, NULL, JSTRACE_OBJECT, NULL, 2, NULL);\n#endif\n    return JS_TRUE;\n}\n\nJSBool ScriptingCore::addRootJS(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc == 1) {\n        JSObject *o = NULL;\n        if (JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"o\", &o) == JS_TRUE) {\n            if (JS_AddNamedObjectRoot(cx, &o, \"from-js\") == JS_FALSE) {\n                LOGD(\"something went wrong when setting an object to the root\");\n            }\n        }\n        return JS_TRUE;\n    }\n    return JS_FALSE;\n}\n\nJSBool ScriptingCore::removeRootJS(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc == 1) {\n        JSObject *o = NULL;\n        if (JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"o\", &o) == JS_TRUE) {\n            JS_RemoveObjectRoot(cx, &o);\n        }\n        return JS_TRUE;\n    }\n    return JS_FALSE;\n}\n\nvoid ScriptingCore::pauseSchedulesAndActions(js_proxy_t* p)\n{\n    Array * arr = JSScheduleWrapper::getTargetForJSObject(p->obj);\n    if (! arr) return;\n    \n    Node* node = (Node*)p->ptr;\n    for(unsigned int i = 0; i < arr->count(); ++i) {\n        if (arr->getObjectAtIndex(i)) {\n            node->getScheduler()->pauseTarget(arr->getObjectAtIndex(i));\n        }\n    }\n}\n\n\nvoid ScriptingCore::resumeSchedulesAndActions(js_proxy_t* p)\n{\n    Array * arr = JSScheduleWrapper::getTargetForJSObject(p->obj);\n    if (!arr) return;\n    \n    Node* node = (Node*)p->ptr;\n    for(unsigned int i = 0; i < arr->count(); ++i) {\n        if (!arr->getObjectAtIndex(i)) continue;\n        node->getScheduler()->resumeTarget(arr->getObjectAtIndex(i));\n    }\n}\n\nvoid ScriptingCore::cleanupSchedulesAndActions(js_proxy_t* p)\n{\n    Array* arr = JSScheduleWrapper::getTargetForJSObject(p->obj);\n    if (arr) {\n        Scheduler* pScheduler = Director::getInstance()->getScheduler();\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(arr, pObj)\n        {\n            pScheduler->unscheduleAllForTarget(pObj);\n        }\n\n        JSScheduleWrapper::removeAllTargetsForJSObject(p->obj);\n    }\n}\n\nint ScriptingCore::handleNodeEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (NULL == basicScriptData->nativeObject || NULL == basicScriptData->value)\n        return 0;\n    \n    Node* node = static_cast<Node*>(basicScriptData->nativeObject);\n    int action = *((int*)(basicScriptData->value));\n                                                         \n    js_proxy_t * p = jsb_get_native_proxy(node);\n    if (!p) return 0;\n\n    jsval retval;\n    jsval dataVal = INT_TO_JSVAL(1);\n\n    if (action == kNodeOnEnter)\n    {\n        executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"onEnter\", 1, &dataVal, &retval);\n        resumeSchedulesAndActions(p);\n    }\n    else if (action == kNodeOnExit)\n    {\n        executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"onExit\", 1, &dataVal, &retval);\n        pauseSchedulesAndActions(p);\n    }\n    else if (action == kNodeOnEnterTransitionDidFinish)\n    {\n        executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"onEnterTransitionDidFinish\", 1, &dataVal, &retval);\n    }\n    else if (action == kNodeOnExitTransitionDidStart)\n    {\n        executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"onExitTransitionDidStart\", 1, &dataVal, &retval);\n    }\n    else if (action == kNodeOnCleanup) {\n        cleanupSchedulesAndActions(p);\n    }\n\n    return 1;\n}\n\nint ScriptingCore::handleMenuClickedEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (NULL == basicScriptData->nativeObject)\n        return 0;\n    \n    MenuItem* menuItem = static_cast<MenuItem*>(basicScriptData->nativeObject);\n    \n    js_proxy_t * p = jsb_get_native_proxy(menuItem);\n    if (!p) return 0;\n\n    jsval retval;\n    jsval dataVal;\n    js_proxy_t *proxy = jsb_get_native_proxy(menuItem);\n    dataVal = (proxy ? OBJECT_TO_JSVAL(proxy->obj) : JSVAL_NULL);\n\n    executeJSFunctionFromReservedSpot(this->_cx, p->obj, dataVal, retval);\n\n    return 1;\n}\n\nint ScriptingCore::handleTouchesEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    TouchesScriptData* touchesScriptData = static_cast<TouchesScriptData*>(data);\n    if (NULL == touchesScriptData->nativeObject || touchesScriptData->touches.empty())\n        return 0;\n    \n    Layer* pLayer = static_cast<Layer*>(touchesScriptData->nativeObject);\n    EventTouch::EventCode eventType = touchesScriptData->actionType;\n    const std::vector<Touch*>& touches = touchesScriptData->touches;\n    \n    std::string funcName = \"\";\n    getTouchesFuncName(eventType, funcName);\n\n    JSObject *jsretArr = JS_NewArrayObject(this->_cx, 0, NULL);\n\n    JS_AddNamedObjectRoot(this->_cx, &jsretArr, \"touchArray\");\n    int count = 0;\n    \n    for (auto& touch : touches)\n    {\n        jsval jsret;\n        getJSTouchObject(this->_cx, touch, jsret);\n        if (!JS_SetElement(this->_cx, jsretArr, count, &jsret))\n        {\n            break;\n        }\n        ++count;\n    }\n\n    executeFunctionWithObjectData(pLayer,  funcName.c_str(), jsretArr);\n\n    JS_RemoveObjectRoot(this->_cx, &jsretArr);\n\n    for (auto& touch : touches)\n    {\n        jsval jsret;\n        removeJSTouchObject(this->_cx, touch, jsret);\n    }\n\n    return 1;\n}\n\nint ScriptingCore::handleTouchEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    TouchScriptData* touchScriptData = static_cast<TouchScriptData*>(data);\n    if (NULL == touchScriptData->nativeObject || NULL == touchScriptData->touch)\n        return 0;\n    \n    Layer* pLayer = static_cast<Layer*>(touchScriptData->nativeObject);\n    EventTouch::EventCode eventType = touchScriptData->actionType;\n    Touch *pTouch = touchScriptData->touch;\n\n    \n    std::string funcName = \"\";\n    getTouchFuncName(eventType, funcName);\n\n    jsval jsret;\n    getJSTouchObject(this->getGlobalContext(), pTouch, jsret);\n    JSObject *jsObj = JSVAL_TO_OBJECT(jsret);\n    bool retval = executeFunctionWithObjectData(pLayer,  funcName.c_str(), jsObj);\n\n    removeJSTouchObject(this->getGlobalContext(), pTouch, jsret);\n\n    return retval;\n}\n\nbool ScriptingCore::executeFunctionWithObjectData(Node *self, const char *name, JSObject *obj) {\n\n    js_proxy_t * p = jsb_get_native_proxy(self);\n    if (!p) return false;\n\n    jsval retval;\n    jsval dataVal = OBJECT_TO_JSVAL(obj);\n\n    executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), name, 1, &dataVal, &retval);\n    if (JSVAL_IS_NULL(retval)) {\n        return false;\n    }\n    else if (JSVAL_IS_BOOLEAN(retval)) {\n        return JSVAL_TO_BOOLEAN(retval);\n    }\n    return false;\n}\n\nJSBool ScriptingCore::executeFunctionWithOwner(jsval owner, const char *name, uint32_t argc /* = 0 */, jsval *vp /* = NULL */, jsval* retVal /* = NULL */)\n{\n    JSBool bRet = JS_FALSE;\n    JSBool hasAction;\n    JSContext* cx = this->_cx;\n    JS::RootedValue temp_retval(cx);\n    JSObject* obj = JSVAL_TO_OBJECT(owner);\n    \n    do\n    {\n        JSAutoCompartment ac(cx, obj);\n        \n        if (JS_HasProperty(cx, obj, name, &hasAction) && hasAction) {\n            if (!JS_GetProperty(cx, obj, name, &temp_retval)) {\n                break;\n            }\n            if (temp_retval == JSVAL_VOID) {\n                break;\n            }            \n            \n            if (retVal) {\n                bRet = JS_CallFunctionName(cx, obj, name, argc, vp, retVal);\n            }\n            else {\n                jsval jsret;\n                bRet = JS_CallFunctionName(cx, obj, name, argc, vp, &jsret);\n            }\n        }\n    }while(0);\n    return bRet;\n}\n\nint ScriptingCore::handleAccelerometerEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (NULL == basicScriptData->nativeObject || NULL == basicScriptData->value)\n        return 0;\n    \n    Acceleration* accelerationValue = static_cast<Acceleration*>(basicScriptData->value);\n    Layer* layer = static_cast<Layer*>(basicScriptData->nativeObject);\n    \n    jsval value = ccacceleration_to_jsval(this->getGlobalContext(), *accelerationValue);\n    JS_AddValueRoot(this->getGlobalContext(), &value);\n\n    executeFunctionWithObjectData(layer, \"onAccelerometer\", JSVAL_TO_OBJECT(value));\n\n    JS_RemoveValueRoot(this->getGlobalContext(), &value);\n    return 1;\n}\n\nint ScriptingCore::handleKeypadEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    KeypadScriptData* keypadScriptData = static_cast<KeypadScriptData*>(data);\n    if (NULL == keypadScriptData->nativeObject)\n        return 0;\n    \n    EventKeyboard::KeyCode action = keypadScriptData->actionType;\n    \n\tjs_proxy_t * p = jsb_get_native_proxy(keypadScriptData->nativeObject);\n\n\tif (p)\n    {\n        JSBool ret = JS_FALSE;\n        switch(action)\n        {\n        case EventKeyboard::KeyCode::KEY_BACKSPACE:\n\t\t\tret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"onBackClicked\");\n            if (!ret)\n            {\n                ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"backClicked\");\n                if (ret)\n                {\n                    CCLOG(\"backClicked will be deprecated, please use onBackClicked instead.\");\n                }\n            }\n\t\t\tbreak;\n\t\tcase EventKeyboard::KeyCode::KEY_MENU:\n            ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"onMenuClicked\");\n            if (!ret)\n            {\n                ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), \"menuClicked\");\n                if (ret)\n                {\n                    CCLOG(\"menuClicked will be deprecated, please use onMenuClicked instead.\");\n                }\n            }\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n\n\nint ScriptingCore::executeCustomTouchesEvent(EventTouch::EventCode eventType,\n                                       const std::vector<Touch*>& touches, JSObject *obj)\n{\n    jsval retval;\n    std::string funcName;\n    getTouchesFuncName(eventType, funcName);\n\n    JSObject *jsretArr = JS_NewArrayObject(this->_cx, 0, NULL);\n    JS_AddNamedObjectRoot(this->_cx, &jsretArr, \"touchArray\");\n    int count = 0;\n    for (auto& touch : touches)\n    {\n        jsval jsret;\n        getJSTouchObject(this->_cx, touch, jsret);\n        if (!JS_SetElement(this->_cx, jsretArr, count, &jsret)) {\n            break;\n        }\n        ++count;\n    }\n\n    jsval jsretArrVal = OBJECT_TO_JSVAL(jsretArr);\n    executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), funcName.c_str(), 1, &jsretArrVal, &retval);\n    JS_RemoveObjectRoot(this->_cx, &jsretArr);\n\n    for (auto& touch : touches)\n    {\n        jsval jsret;\n        removeJSTouchObject(this->_cx, touch, jsret);\n    }\n\n    return 1;\n}\n\n\nint ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType,\n                                           Touch *pTouch, JSObject *obj)\n{\n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n    \n    jsval retval;\n    std::string funcName;\n    getTouchFuncName(eventType, funcName);\n\n    jsval jsTouch;\n    getJSTouchObject(this->_cx, pTouch, jsTouch);\n\n    executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), funcName.c_str(), 1, &jsTouch, &retval);\n\n    // Remove touch object from global hash table and unroot it.\n    removeJSTouchObject(this->_cx, pTouch, jsTouch);\n    return 1;\n\n}\n\n\nint ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType,\n                                           Touch *pTouch, JSObject *obj,\n                                           jsval &retval)\n{\n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n    \n    std::string funcName;\n    getTouchFuncName(eventType, funcName);\n\n    jsval jsTouch;\n    getJSTouchObject(this->_cx, pTouch, jsTouch);\n\n    executeFunctionWithOwner(OBJECT_TO_JSVAL(obj), funcName.c_str(), 1, &jsTouch, &retval);\n\n    // Remove touch object from global hash table and unroot it.\n    removeJSTouchObject(this->_cx, pTouch, jsTouch);\n\n    return 1;\n\n}\n\nint ScriptingCore::sendEvent(ScriptEvent* evt)\n{\n    if (NULL == evt)\n        return 0;\n \n    JSAutoCompartment ac(_cx, _global);\n    \n    switch (evt->type)\n    {\n        case kNodeEvent:\n            {\n                return handleNodeEvent(evt->data);\n            }\n            break;\n        case kMenuClickedEvent:\n            {\n                return handleMenuClickedEvent(evt->data);\n            }\n            break;\n        case kTouchEvent:\n            {\n                return handleTouchEvent(evt->data);\n            }\n            break;\n        case kTouchesEvent:\n            {\n                return handleTouchesEvent(evt->data);\n            }\n            break;\n        case kKeypadEvent:\n            {\n                return handleKeypadEvent(evt->data);\n            }\n            break;\n        case kAccelerometerEvent:\n            {\n                return handleAccelerometerEvent(evt->data);\n            }\n            break;\n        default:\n            break;\n    }\n    \n    return 0;\n}\n\nbool ScriptingCore::parseConfig(ConfigType type, const std::string &str)\n{\n    jsval args[2];\n    args[0] = int32_to_jsval(_cx, static_cast<int>(type));\n    args[1] = std_string_to_jsval(_cx, str);\n    return (JS_TRUE == executeFunctionWithOwner(OBJECT_TO_JSVAL(_global), \"__onParseConfig\", 2, args));\n}\n\n#pragma mark - Debug\n\nvoid SimpleRunLoop::update(float dt)\n{\n    g_qMutex.lock();\n    size_t size = g_queue.size();\n    g_qMutex.unlock();\n    \n    while (size > 0)\n    {\n        g_qMutex.lock();\n        auto first = g_queue.begin();\n        std::string str = *first;\n        g_queue.erase(first);\n        size = g_queue.size();\n        g_qMutex.unlock();\n        \n        ScriptingCore::getInstance()->debugProcessInput(str);\n    }\n}\n\nvoid ScriptingCore::debugProcessInput(const std::string& str)\n{\n    JSAutoCompartment ac(_cx, _debugGlobal);\n    \n    JSString* jsstr = JS_NewStringCopyZ(_cx, str.c_str());\n    jsval argv = STRING_TO_JSVAL(jsstr);\n    jsval outval;\n    \n    JS_CallFunctionName(_cx, _debugGlobal, \"processInput\", 1, &argv, &outval);\n}\n\nstatic bool NS_ProcessNextEvent()\n{\n    g_qMutex.lock();\n    size_t size = g_queue.size();\n    g_qMutex.unlock();\n    \n    while (size > 0)\n    {\n        g_qMutex.lock();\n        auto first = g_queue.begin();\n        std::string str = *first;\n        g_queue.erase(first);\n        size = g_queue.size();\n        g_qMutex.unlock();\n        \n        ScriptingCore::getInstance()->debugProcessInput(str);\n    }\n//    std::this_thread::yield();\n    std::this_thread::sleep_for(std::chrono::milliseconds(10));\n    \n    return true;\n}\n\nJSBool JSBDebug_enterNestedEventLoop(JSContext* cx, unsigned argc, jsval* vp)\n{\n    enum {\n        NS_OK = 0,\n        NS_ERROR_UNEXPECTED\n    };\n    \n#define NS_SUCCEEDED(v) ((v) == NS_OK)\n    \n    int rv = NS_OK;\n    \n    uint32_t nestLevel = ++s_nestedLoopLevel;\n\n    while (NS_SUCCEEDED(rv) && s_nestedLoopLevel >= nestLevel) {\n        if (!NS_ProcessNextEvent())\n            rv = NS_ERROR_UNEXPECTED;\n    }\n    \n    CCASSERT(s_nestedLoopLevel <= nestLevel,\n             \"nested event didn't unwind properly\");\n    \n    JS_SET_RVAL(cx, vp, UINT_TO_JSVAL(s_nestedLoopLevel));\n    return JS_TRUE;\n}\n\nJSBool JSBDebug_exitNestedEventLoop(JSContext* cx, unsigned argc, jsval* vp)\n{\n    if (s_nestedLoopLevel > 0) {\n        --s_nestedLoopLevel;\n    } else {\n        JS_SET_RVAL(cx, vp, UINT_TO_JSVAL(0));\n        return JS_TRUE;\n    }\n    \n    JS_SET_RVAL(cx, vp, UINT_TO_JSVAL(s_nestedLoopLevel));\n    return JS_TRUE;\n}\n\nJSBool JSBDebug_getEventLoopNestLevel(JSContext* cx, unsigned argc, jsval* vp)\n{\n    JS_SET_RVAL(cx, vp, UINT_TO_JSVAL(s_nestedLoopLevel));\n    return JS_TRUE;\n}\n\n//#pragma mark - Debugger\n\nstatic void _clientSocketWriteAndClearString(std::string& s)\n{\n    ::send(clientSocket, s.c_str(), s.length(), 0);\n    s.clear();\n}\n\nstatic void processInput(const std::string& data) {\n    std::lock_guard<std::mutex> lk(g_qMutex);\n    g_queue.push_back(data);\n}\n\nstatic void clearBuffers() {\n    std::lock_guard<std::mutex> lk(g_rwMutex);\n    // only process input if there's something and we're not locked\n    if (inData.length() > 0) {\n        processInput(inData);\n        inData.clear();\n    }\n    if (outData.length() > 0) {\n        _clientSocketWriteAndClearString(outData);\n    }\n}\n\nstatic void serverEntryPoint(void)\n{\n    // start a server, accept the connection and keep reading data from it\n    struct addrinfo hints, *result = nullptr, *rp = nullptr;\n    int s = 0;\n    memset(&hints, 0, sizeof(struct addrinfo));\n    hints.ai_family = AF_INET;       // IPv4\n    hints.ai_socktype = SOCK_STREAM; // TCP stream sockets\n    hints.ai_flags = AI_PASSIVE;     // fill in my IP for me\n    \n    std::stringstream portstr;\n    portstr << JSB_DEBUGGER_PORT;\n    \n    int err = 0;\n    \n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n    WSADATA wsaData;\n    err = WSAStartup(MAKEWORD(2, 2),&wsaData);\n#endif\n    \n    if ((err = getaddrinfo(NULL, portstr.str().c_str(), &hints, &result)) != 0) {\n        LOGD(\"getaddrinfo error : %s\\n\", gai_strerror(err));\n    }\n    \n    for (rp = result; rp != NULL; rp = rp->ai_next) {\n        if ((s = socket(rp->ai_family, rp->ai_socktype, 0)) < 0) {\n            continue;\n        }\n        int optval = 1;\n        if ((setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char*)&optval, sizeof(optval))) < 0) {\n            close(s);\n\t\t\tTRACE_DEBUGGER_SERVER(\"debug server : error setting socket option SO_REUSEADDR\");\n            return;\n        }\n        \n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n\t\tif ((setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval))) < 0) {\n\t\t\tclose(s);\n\t\t\tTRACE_DEBUGGER_SERVER(\"debug server : error setting socket option SO_NOSIGPIPE\");\n\t\t\treturn;\n\t\t}\n#endif //(CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n        \n        if ((::bind(s, rp->ai_addr, rp->ai_addrlen)) == 0) {\n            break;\n        }\n        close(s);\n        s = -1;\n    }\n    if (s < 0 || rp == NULL) {\n\t\tTRACE_DEBUGGER_SERVER(\"debug server : error creating/binding socket\");\n        return;\n    }\n    \n    freeaddrinfo(result);\n    \n    listen(s, 1);\n    \n\twhile (true) {\n        clientSocket = accept(s, NULL, NULL);\n        \n        if (clientSocket < 0)\n        {\n            TRACE_DEBUGGER_SERVER(\"debug server : error on accept\");\n            return;\n        }\n        else\n        {\n            // read/write data\n            TRACE_DEBUGGER_SERVER(\"debug server : client connected\");\n            \n            inData = \"connected\";\n            // process any input, send any output\n            clearBuffers();\n            \n            char buf[1024] = {0};\n            int readBytes = 0;\n            while ((readBytes = ::recv(clientSocket, buf, sizeof(buf), 0)) > 0)\n            {\n                buf[readBytes] = '\\0';\n                // TRACE_DEBUGGER_SERVER(\"debug server : received command >%s\", buf);\n                \n                // no other thread is using this\n                inData.append(buf);\n                // process any input, send any output\n                clearBuffers();\n            } // while(read)\n            \n            close(clientSocket);\n        }\n\t} // while(true)\n}\n\nJSBool JSBDebug_BufferWrite(JSContext* cx, unsigned argc, jsval* vp)\n{\n    if (argc == 1) {\n        jsval* argv = JS_ARGV(cx, vp);\n        JSStringWrapper strWrapper(argv[0]);\n        // this is safe because we're already inside a lock (from clearBuffers)\n        outData.append(strWrapper.get());\n        _clientSocketWriteAndClearString(outData);\n    }\n    return JS_TRUE;\n}\n\nvoid ScriptingCore::enableDebugger()\n{\n    if (_debugGlobal == NULL)\n    {\n        JSAutoCompartment ac0(_cx, _global);\n        \n        JS_SetDebugMode(_cx, JS_TRUE);\n        \n        _debugGlobal = NewGlobalObject(_cx, true);\n        // Adds the debugger object to root, otherwise it may be collected by GC.\n        JS_AddObjectRoot(_cx, &_debugGlobal);\n        \n        JS_WrapObject(_cx, &_debugGlobal);\n        JSAutoCompartment ac(_cx, _debugGlobal);\n        // these are used in the debug program\n        JS_DefineFunction(_cx, _debugGlobal, \"log\", ScriptingCore::log, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n        JS_DefineFunction(_cx, _debugGlobal, \"_bufferWrite\", JSBDebug_BufferWrite, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n        JS_DefineFunction(_cx, _debugGlobal, \"_enterNestedEventLoop\", JSBDebug_enterNestedEventLoop, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n        JS_DefineFunction(_cx, _debugGlobal, \"_exitNestedEventLoop\", JSBDebug_exitNestedEventLoop, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n        JS_DefineFunction(_cx, _debugGlobal, \"_getEventLoopNestLevel\", JSBDebug_getEventLoopNestLevel, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n        \n        \n        runScript(\"jsb_debugger.js\", _debugGlobal);\n        \n        // prepare the debugger\n        jsval argv = OBJECT_TO_JSVAL(_global);\n        jsval outval;\n        JSBool ok = JS_CallFunctionName(_cx, _debugGlobal, \"_prepareDebugger\", 1, &argv, &outval);\n        if (!ok) {\n            JS_ReportPendingException(_cx);\n        }\n        \n        // start bg thread\n        auto t = std::thread(&serverEntryPoint);\n        t.detach();\n\n        Scheduler* scheduler = Director::getInstance()->getScheduler();\n        scheduler->scheduleUpdateForTarget(this->_runLoop, 0, false);\n    }\n}\n\nJSObject* NewGlobalObject(JSContext* cx, bool debug)\n{\n    JS::CompartmentOptions options;\n    options.setVersion(JSVERSION_LATEST);\n    \n    JS::RootedObject glob(cx, JS_NewGlobalObject(cx, &global_class, NULL, JS::DontFireOnNewGlobalHook, options));\n    if (!glob) {\n        return NULL;\n    }\n    JSAutoCompartment ac(cx, glob);\n    JSBool ok = JS_TRUE;\n    ok = JS_InitStandardClasses(cx, glob);\n    if (ok)\n        JS_InitReflect(cx, glob);\n    if (ok && debug)\n        ok = JS_DefineDebuggerObject(cx, glob);\n    if (!ok)\n        return NULL;\n\n    JS_FireOnNewGlobalObject(cx, glob);\n    \n    return glob;\n}\n\nJSBool jsb_set_reserved_slot(JSObject *obj, uint32_t idx, jsval value)\n{\n    JSClass *klass = JS_GetClass(obj);\n    unsigned int slots = JSCLASS_RESERVED_SLOTS(klass);\n    if ( idx >= slots )\n        return JS_FALSE;\n\n    JS_SetReservedSlot(obj, idx, value);\n\n    return JS_TRUE;\n}\n\nJSBool jsb_get_reserved_slot(JSObject *obj, uint32_t idx, jsval& ret)\n{\n    JSClass *klass = JS_GetClass(obj);\n    unsigned int slots = JSCLASS_RESERVED_SLOTS(klass);\n    if ( idx >= slots )\n        return JS_FALSE;\n\n    ret = JS_GetReservedSlot(obj, idx);\n\n    return JS_TRUE;\n}\n\njs_proxy_t* jsb_new_proxy(void* nativeObj, JSObject* jsObj)\n{\n    js_proxy_t* p = nullptr;\n    JS_NEW_PROXY(p, nativeObj, jsObj);\n    return p;\n}\n\njs_proxy_t* jsb_get_native_proxy(void* nativeObj)\n{\n    js_proxy_t* p = nullptr;\n    JS_GET_PROXY(p, nativeObj);\n    return p;\n}\n\njs_proxy_t* jsb_get_js_proxy(JSObject* jsObj)\n{\n    js_proxy_t* p = nullptr;\n    JS_GET_NATIVE_PROXY(p, jsObj);\n    return p;\n}\n\nvoid jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy)\n{\n    JS_REMOVE_PROXY(nativeProxy, jsProxy);\n}\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/ScriptingCore.h",
    "content": "//\n//  ScriptingCore.h\n//  testmonkey\n//\n//  Created by Rolando Abarca on 3/14/12.\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n#ifndef __SCRIPTING_CORE_H__\n#define __SCRIPTING_CORE_H__\n\n#include <assert.h>\n#include <memory>\n#include \"cocos2d.h\"\n#include \"js_bindings_config.h\"\n#include \"js_bindings_core.h\"\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n#include \"spidermonkey_specifics.h\"\n#include \"js_manual_conversions.h\"\n\nvoid js_log(const char *format, ...);\n\ntypedef void (*sc_register_sth)(JSContext* cx, JSObject* global);\n\nvoid registerDefaultClasses(JSContext* cx, JSObject* global);\n\n\nclass SimpleRunLoop : public cocos2d::Object\n{\npublic:\n\tvoid update(float d);\n};\n\nclass ScriptingCore : public cocos2d::ScriptEngineProtocol\n{\n\tJSRuntime *_rt;\n\tJSContext *_cx;\n\tJSObject  *_global;\n\tJSObject  *_debugGlobal;\n\tSimpleRunLoop* _runLoop;\n\n\tScriptingCore();\npublic:\n\t~ScriptingCore();\n\n\tstatic ScriptingCore *getInstance() {\n\t\tstatic ScriptingCore* pInstance = NULL;\n        if (pInstance == NULL) {\n            pInstance = new ScriptingCore();\n        }\n\t\treturn pInstance;\n\t};\n\n    virtual cocos2d::ccScriptType getScriptType() { return cocos2d::kScriptTypeJavascript; };\n\n    /**\n     @brief Remove Object from lua state\n     @param object to remove\n     */\n    virtual void removeScriptObjectByObject(cocos2d::Object* pObj);\n\n    /**\n     @brief Execute script code contained in the given string.\n     @param codes holding the valid script code that should be executed.\n     @return 0 if the string is excuted correctly.\n     @return other if the string is excuted wrongly.\n     */\n\tvirtual int executeString(const char* codes) { return 0; }\n    void pauseSchedulesAndActions(js_proxy_t* p);\n    void resumeSchedulesAndActions(js_proxy_t* p);\n    void cleanupSchedulesAndActions(js_proxy_t* p);\n\n    /**\n     @brief Execute a script file.\n     @param filename String object holding the filename of the script file that is to be executed\n     */\n    virtual  int executeScriptFile(const char* filename) { return 0; }\n\n    /**\n     @brief Execute a scripted global function.\n     @brief The function should not take any parameters and should return an integer.\n     @param functionName String object holding the name of the function, in the global script environment, that is to be executed.\n     @return The integer value returned from the script function.\n     */\n\tvirtual int executeGlobalFunction(const char* functionName) { return 0; }\n\n    virtual int sendEvent(cocos2d::ScriptEvent* message) override;\n    \n    virtual bool parseConfig(ConfigType type, const std::string& str) override;\n\n    virtual bool handleAssert(const char *msg) { return false; }\n\n    bool executeFunctionWithObjectData(cocos2d::Node *self, const char *name, JSObject *obj);\n    JSBool executeFunctionWithOwner(jsval owner, const char *name, uint32_t argc = 0, jsval* vp = NULL, jsval* retVal = NULL);\n\n    void executeJSFunctionWithThisObj(jsval thisObj, jsval callback, uint32_t argc = 0, jsval* vp = NULL, jsval* retVal = NULL);\n\n\t/**\n\t * will eval the specified string\n\t * @param string The string with the javascript code to be evaluated\n\t * @param outVal The jsval that will hold the return value of the evaluation.\n\t * Can be NULL.\n\t */\n\tJSBool evalString(const char *string, jsval *outVal, const char *filename = NULL, JSContext* cx = NULL, JSObject* global = NULL);\n\n\t/**\n\t * will run the specified string\n\t * @param string The path of the script to be run\n\t */\n\tJSBool runScript(const char *path, JSObject* global = NULL, JSContext* cx = NULL);\n\n\t/**\n\t * initialize everything\n\t */\n\tvoid start();\n\n\t/**\n\t * cleanup everything\n\t */\n\tvoid cleanup();\n\n\t/**\n\t * cleanup everything then initialize everything\n\t */\n\tvoid reset();\n\n\t/**\n\t * will add the register_sth callback to the list of functions that need to be called\n\t * after the creation of the context\n\t */\n\tvoid addRegisterCallback(sc_register_sth callback);\n\n\t/**\n\t * Will create a new context. If one is already there, it will destroy the old context\n\t * and create a new one.\n\t */\n\tvoid createGlobalContext();\n\n    static void removeAllRoots(JSContext *cx);\n\n\n    int executeCustomTouchEvent(cocos2d::EventTouch::EventCode eventType,\n                                cocos2d::Touch *pTouch, JSObject *obj, jsval &retval);\n    int executeCustomTouchEvent(cocos2d::EventTouch::EventCode eventType,\n                                cocos2d::Touch *pTouch, JSObject *obj);\n    int executeCustomTouchesEvent(cocos2d::EventTouch::EventCode eventType,\n                                  const std::vector<cocos2d::Touch*>& touches, JSObject *obj);\n\t/**\n\t * @return the global context\n\t */\n\tJSContext* getGlobalContext() {\n\t\treturn _cx;\n\t};\n\n\t/**\n\t * @param cx\n\t * @param message\n\t * @param report\n\t */\n\tstatic void reportError(JSContext *cx, const char *message, JSErrorReport *report);\n\n\t/**\n\t * Log something using CCLog\n\t * @param cx\n\t * @param argc\n\t * @param vp\n\t */\n\tstatic JSBool log(JSContext *cx, uint32_t argc, jsval *vp);\n\n\tJSBool setReservedSpot(uint32_t i, JSObject *obj, jsval value);\n\n\t/**\n\t * run a script from script :)\n\t */\n\tstatic JSBool executeScript(JSContext *cx, uint32_t argc, jsval *vp);\n\n\t/**\n\t * Force a cycle of GC\n\t * @param cx\n\t * @param argc\n\t * @param vp\n\t */\n\tstatic JSBool forceGC(JSContext *cx, uint32_t argc, jsval *vp);\n\tstatic JSBool dumpRoot(JSContext *cx, uint32_t argc, jsval *vp);\n\tstatic JSBool addRootJS(JSContext *cx, uint32_t argc, jsval *vp);\n\tstatic JSBool removeRootJS(JSContext *cx, uint32_t argc, jsval *vp);\n\n\t/**\n\t * enable the debug environment\n\t */\n\tvoid debugProcessInput(const std::string& str);\n\tvoid enableDebugger();\n\tJSObject* getDebugGlobal() { return _debugGlobal; }\n    JSObject* getGlobalObject() { return _global; }\n    \n private:\n    void string_report(jsval val);\n    \n    int handleTouchesEvent(void* data);\n    int handleTouchEvent(void* data);\n    int handleNodeEvent(void* data);\n    int handleMenuClickedEvent(void* data);\n    int handleAccelerometerEvent(void* data);\n    int handleKeypadEvent(void* data);\n};\n\nJSObject* NewGlobalObject(JSContext* cx, bool debug = false);\n\nJSBool jsb_set_reserved_slot(JSObject *obj, uint32_t idx, jsval value);\nJSBool jsb_get_reserved_slot(JSObject *obj, uint32_t idx, jsval& ret);\n\njs_proxy_t* jsb_new_proxy(void* nativeObj, JSObject* jsObj);\njs_proxy_t* jsb_get_native_proxy(void* nativeObj);\njs_proxy_t* jsb_get_js_proxy(JSObject* jsObj);\nvoid jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy);\n\n\n#endif /* __SCRIPTING_CORE_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_chipmunk_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsbchipmunk\n\nLOCAL_SRC_FILES := js_bindings_chipmunk_manual.cpp \\\n                   js_bindings_chipmunk_functions.cpp \\\n                   js_bindings_chipmunk_auto_classes.cpp \\\n                   js_bindings_chipmunk_registration.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../../..\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static \nLOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,extensions)\n$(call import-module,chipmunk)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_auto_classes.cpp",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c chipmunk_jsb.ini\" on 2012-11-07\n* Script version: v0.3\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n\n#include \"js_bindings_chipmunk_manual.h\"\n\n#include \"jsfriendapi.h\"\n#include \"js_bindings_config.h\"\n#include \"js_manual_conversions.h\"\n#include \"js_bindings_chipmunk_functions.h\"\n\n/*\n * cpConstraint\n */\n#pragma mark - cpConstraint\n\nJSClass* JSB_cpConstraint_class = NULL;\nJSObject* JSB_cpConstraint_object = NULL;\n\n// Constructor\nJSBool JSB_cpConstraint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSB_PRECONDITION2(false, cx, JS_TRUE, \"No constructor\");\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpConstraint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpConstraint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpConstraint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpConstraint_activateBodies(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\n\tcpConstraintActivateBodies((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpConstraint_destroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\n\tcpConstraintDestroy((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBody*\nJSBool JSB_cpConstraint_getA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tcpBody* ret_val;\n\n\tret_val = cpConstraintGetA((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpBody_object, JSB_cpBody_class, \"cpBody\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBody*\nJSBool JSB_cpConstraint_getB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tcpBody* ret_val;\n\n\tret_val = cpConstraintGetB((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpBody_object, JSB_cpBody_class, \"cpBody\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpConstraint_getErrorBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetErrorBias((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpConstraint_getImpulse(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetImpulse((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpConstraint_getMaxBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetMaxBias((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpConstraint_getMaxForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetMaxForce((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpSpace*\nJSBool JSB_cpConstraint_getSpace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tcpSpace* ret_val;\n\n\tret_val = cpConstraintGetSpace((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpSpace_object, JSB_cpSpace_class, \"cpSpace\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpConstraint_setErrorBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintSetErrorBias((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpConstraint_setMaxBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintSetMaxBias((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpConstraint_setMaxForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpConstraint* arg0 = (cpConstraint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintSetMaxForce((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpConstraint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpConstraint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpConstraint_class->name = name;\n\tJSB_cpConstraint_class->addProperty = JS_PropertyStub;\n\tJSB_cpConstraint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpConstraint_class->getProperty = JS_PropertyStub;\n\tJSB_cpConstraint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpConstraint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpConstraint_class->resolve = JS_ResolveStub;\n\tJSB_cpConstraint_class->convert = JS_ConvertStub;\n\tJSB_cpConstraint_class->finalize = JSB_cpConstraint_finalize;\n\tJSB_cpConstraint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"activateBodies\", JSB_cpConstraint_activateBodies, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"destroy\", JSB_cpConstraint_destroy, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getA\", JSB_cpConstraint_getA, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getB\", JSB_cpConstraint_getB, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getErrorBias\", JSB_cpConstraint_getErrorBias, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getImpulse\", JSB_cpConstraint_getImpulse, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaxBias\", JSB_cpConstraint_getMaxBias, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMaxForce\", JSB_cpConstraint_getMaxForce, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpace\", JSB_cpConstraint_getSpace, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setErrorBias\", JSB_cpConstraint_setErrorBias, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaxBias\", JSB_cpConstraint_setMaxBias, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMaxForce\", JSB_cpConstraint_setMaxForce, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpConstraint_object = JS_InitClass(cx, globalObj, JSB_cpBase_object, JSB_cpConstraint_class, JSB_cpConstraint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpGrooveJoint\n */\n#pragma mark - cpGrooveJoint\n\nJSClass* JSB_cpGrooveJoint_class = NULL;\nJSObject* JSB_cpGrooveJoint_object = NULL;\n// Arguments: cpBody*, cpBody*, cpVect, cpVect, cpVect\n// Constructor\nJSBool JSB_cpGrooveJoint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==5, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpGrooveJoint_class, JSB_cpGrooveJoint_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; cpVect arg4; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpGrooveJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3 , (cpVect)arg4  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpGrooveJoint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpGrooveJoint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpGrooveJoint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpGrooveJoint_getAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGrooveJoint* arg0 = (cpGrooveJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpGrooveJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpGrooveJoint_getGrooveA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGrooveJoint* arg0 = (cpGrooveJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpGrooveJointGetGrooveA((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpGrooveJoint_getGrooveB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGrooveJoint* arg0 = (cpGrooveJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpGrooveJointGetGrooveB((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpGrooveJoint_setAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGrooveJoint* arg0 = (cpGrooveJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGrooveJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpGrooveJoint_setGrooveA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGrooveJoint* arg0 = (cpGrooveJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGrooveJointSetGrooveA((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpGrooveJoint_setGrooveB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGrooveJoint* arg0 = (cpGrooveJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGrooveJointSetGrooveB((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpGrooveJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpGrooveJoint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpGrooveJoint_class->name = name;\n\tJSB_cpGrooveJoint_class->addProperty = JS_PropertyStub;\n\tJSB_cpGrooveJoint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpGrooveJoint_class->getProperty = JS_PropertyStub;\n\tJSB_cpGrooveJoint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpGrooveJoint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpGrooveJoint_class->resolve = JS_ResolveStub;\n\tJSB_cpGrooveJoint_class->convert = JS_ConvertStub;\n\tJSB_cpGrooveJoint_class->finalize = JSB_cpGrooveJoint_finalize;\n\tJSB_cpGrooveJoint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnchr2\", JSB_cpGrooveJoint_getAnchr2, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGrooveA\", JSB_cpGrooveJoint_getGrooveA, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGrooveB\", JSB_cpGrooveJoint_getGrooveB, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr2\", JSB_cpGrooveJoint_setAnchr2, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGrooveA\", JSB_cpGrooveJoint_setGrooveA, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGrooveB\", JSB_cpGrooveJoint_setGrooveB, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpGrooveJoint_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpGrooveJoint_class, JSB_cpGrooveJoint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpSimpleMotor\n */\n#pragma mark - cpSimpleMotor\n\nJSClass* JSB_cpSimpleMotor_class = NULL;\nJSObject* JSB_cpSimpleMotor_object = NULL;\n// Arguments: cpBody*, cpBody*, cpFloat\n// Constructor\nJSBool JSB_cpSimpleMotor_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==3, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpSimpleMotor_class, JSB_cpSimpleMotor_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpSimpleMotorNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpSimpleMotor_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpSimpleMotor), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpSimpleMotor)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSimpleMotor_getRate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSimpleMotor* arg0 = (cpSimpleMotor*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSimpleMotorGetRate((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSimpleMotor_setRate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSimpleMotor* arg0 = (cpSimpleMotor*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSimpleMotorSetRate((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpSimpleMotor_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpSimpleMotor_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpSimpleMotor_class->name = name;\n\tJSB_cpSimpleMotor_class->addProperty = JS_PropertyStub;\n\tJSB_cpSimpleMotor_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpSimpleMotor_class->getProperty = JS_PropertyStub;\n\tJSB_cpSimpleMotor_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpSimpleMotor_class->enumerate = JS_EnumerateStub;\n\tJSB_cpSimpleMotor_class->resolve = JS_ResolveStub;\n\tJSB_cpSimpleMotor_class->convert = JS_ConvertStub;\n\tJSB_cpSimpleMotor_class->finalize = JSB_cpSimpleMotor_finalize;\n\tJSB_cpSimpleMotor_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getRate\", JSB_cpSimpleMotor_getRate, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRate\", JSB_cpSimpleMotor_setRate, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpSimpleMotor_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpSimpleMotor_class, JSB_cpSimpleMotor_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpPivotJoint\n */\n#pragma mark - cpPivotJoint\n\nJSClass* JSB_cpPivotJoint_class = NULL;\nJSObject* JSB_cpPivotJoint_object = NULL;\n// Arguments: cpBody*, cpBody*, cpVect\n// Constructor\nJSBool JSB_cpPivotJoint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==4 || argc==3, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpPivotJoint_class, JSB_cpPivotJoint_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; void *ret_val;\n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tif(argc == 4) {\n\t\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tret_val = cpPivotJointNew2((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2, (cpVect)arg3  );\n\t} else {\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tret_val = cpPivotJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2);\n\t}\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n// Destructor\nvoid JSB_cpPivotJoint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpPivotJoint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpPivotJoint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpPivotJoint_getAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPivotJoint* arg0 = (cpPivotJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpPivotJointGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpPivotJoint_getAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPivotJoint* arg0 = (cpPivotJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpPivotJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpPivotJoint_setAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPivotJoint* arg0 = (cpPivotJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPivotJointSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpPivotJoint_setAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPivotJoint* arg0 = (cpPivotJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPivotJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpPivotJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpPivotJoint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpPivotJoint_class->name = name;\n\tJSB_cpPivotJoint_class->addProperty = JS_PropertyStub;\n\tJSB_cpPivotJoint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpPivotJoint_class->getProperty = JS_PropertyStub;\n\tJSB_cpPivotJoint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpPivotJoint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpPivotJoint_class->resolve = JS_ResolveStub;\n\tJSB_cpPivotJoint_class->convert = JS_ConvertStub;\n\tJSB_cpPivotJoint_class->finalize = JSB_cpPivotJoint_finalize;\n\tJSB_cpPivotJoint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnchr1\", JSB_cpPivotJoint_getAnchr1, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchr2\", JSB_cpPivotJoint_getAnchr2, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr1\", JSB_cpPivotJoint_setAnchr1, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr2\", JSB_cpPivotJoint_setAnchr2, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpPivotJoint_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpPivotJoint_class, JSB_cpPivotJoint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpPinJoint\n */\n#pragma mark - cpPinJoint\n\nJSClass* JSB_cpPinJoint_class = NULL;\nJSObject* JSB_cpPinJoint_object = NULL;\n// Arguments: cpBody*, cpBody*, cpVect, cpVect\n// Constructor\nJSBool JSB_cpPinJoint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==4, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpPinJoint_class, JSB_cpPinJoint_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpPinJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpPinJoint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpPinJoint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpPinJoint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpPinJoint_getAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPinJoint* arg0 = (cpPinJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpPinJointGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpPinJoint_getAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPinJoint* arg0 = (cpPinJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpPinJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpPinJoint_getDist(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPinJoint* arg0 = (cpPinJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpPinJointGetDist((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpPinJoint_setAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPinJoint* arg0 = (cpPinJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPinJointSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpPinJoint_setAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPinJoint* arg0 = (cpPinJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPinJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpPinJoint_setDist(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPinJoint* arg0 = (cpPinJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPinJointSetDist((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpPinJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpPinJoint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpPinJoint_class->name = name;\n\tJSB_cpPinJoint_class->addProperty = JS_PropertyStub;\n\tJSB_cpPinJoint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpPinJoint_class->getProperty = JS_PropertyStub;\n\tJSB_cpPinJoint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpPinJoint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpPinJoint_class->resolve = JS_ResolveStub;\n\tJSB_cpPinJoint_class->convert = JS_ConvertStub;\n\tJSB_cpPinJoint_class->finalize = JSB_cpPinJoint_finalize;\n\tJSB_cpPinJoint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnchr1\", JSB_cpPinJoint_getAnchr1, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchr2\", JSB_cpPinJoint_getAnchr2, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDist\", JSB_cpPinJoint_getDist, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr1\", JSB_cpPinJoint_setAnchr1, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr2\", JSB_cpPinJoint_setAnchr2, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDist\", JSB_cpPinJoint_setDist, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpPinJoint_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpPinJoint_class, JSB_cpPinJoint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpSlideJoint\n */\n#pragma mark - cpSlideJoint\n\nJSClass* JSB_cpSlideJoint_class = NULL;\nJSObject* JSB_cpSlideJoint_object = NULL;\n// Arguments: cpBody*, cpBody*, cpVect, cpVect, cpFloat, cpFloat\n// Constructor\nJSBool JSB_cpSlideJoint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==6, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpSlideJoint_class, JSB_cpSlideJoint_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; double arg4; double arg5; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg4 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg5 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpSlideJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3 , (cpFloat)arg4 , (cpFloat)arg5  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpSlideJoint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpSlideJoint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpSlideJoint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpSlideJoint_getAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpSlideJointGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpSlideJoint_getAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpSlideJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSlideJoint_getMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSlideJointGetMax((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSlideJoint_getMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSlideJointGetMin((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpSlideJoint_setAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpSlideJoint_setAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSlideJoint_setMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetMax((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSlideJoint_setMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSlideJoint* arg0 = (cpSlideJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetMin((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpSlideJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpSlideJoint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpSlideJoint_class->name = name;\n\tJSB_cpSlideJoint_class->addProperty = JS_PropertyStub;\n\tJSB_cpSlideJoint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpSlideJoint_class->getProperty = JS_PropertyStub;\n\tJSB_cpSlideJoint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpSlideJoint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpSlideJoint_class->resolve = JS_ResolveStub;\n\tJSB_cpSlideJoint_class->convert = JS_ConvertStub;\n\tJSB_cpSlideJoint_class->finalize = JSB_cpSlideJoint_finalize;\n\tJSB_cpSlideJoint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnchr1\", JSB_cpSlideJoint_getAnchr1, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchr2\", JSB_cpSlideJoint_getAnchr2, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMax\", JSB_cpSlideJoint_getMax, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMin\", JSB_cpSlideJoint_getMin, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr1\", JSB_cpSlideJoint_setAnchr1, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr2\", JSB_cpSlideJoint_setAnchr2, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMax\", JSB_cpSlideJoint_setMax, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMin\", JSB_cpSlideJoint_setMin, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpSlideJoint_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpSlideJoint_class, JSB_cpSlideJoint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpGearJoint\n */\n#pragma mark - cpGearJoint\n\nJSClass* JSB_cpGearJoint_class = NULL;\nJSObject* JSB_cpGearJoint_object = NULL;\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat\n// Constructor\nJSBool JSB_cpGearJoint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==4, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpGearJoint_class, JSB_cpGearJoint_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpGearJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpGearJoint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpGearJoint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpGearJoint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpGearJoint_getPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGearJoint* arg0 = (cpGearJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpGearJointGetPhase((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpGearJoint_getRatio(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGearJoint* arg0 = (cpGearJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpGearJointGetRatio((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpGearJoint_setPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGearJoint* arg0 = (cpGearJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGearJointSetPhase((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpGearJoint_setRatio(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpGearJoint* arg0 = (cpGearJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGearJointSetRatio((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpGearJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpGearJoint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpGearJoint_class->name = name;\n\tJSB_cpGearJoint_class->addProperty = JS_PropertyStub;\n\tJSB_cpGearJoint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpGearJoint_class->getProperty = JS_PropertyStub;\n\tJSB_cpGearJoint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpGearJoint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpGearJoint_class->resolve = JS_ResolveStub;\n\tJSB_cpGearJoint_class->convert = JS_ConvertStub;\n\tJSB_cpGearJoint_class->finalize = JSB_cpGearJoint_finalize;\n\tJSB_cpGearJoint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getPhase\", JSB_cpGearJoint_getPhase, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRatio\", JSB_cpGearJoint_getRatio, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPhase\", JSB_cpGearJoint_setPhase, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRatio\", JSB_cpGearJoint_setRatio, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpGearJoint_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpGearJoint_class, JSB_cpGearJoint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpDampedRotarySpring\n */\n#pragma mark - cpDampedRotarySpring\n\nJSClass* JSB_cpDampedRotarySpring_class = NULL;\nJSObject* JSB_cpDampedRotarySpring_object = NULL;\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat, cpFloat\n// Constructor\nJSBool JSB_cpDampedRotarySpring_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==5, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpDampedRotarySpring_class, JSB_cpDampedRotarySpring_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; double arg4; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpDampedRotarySpringNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3 , (cpFloat)arg4  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpDampedRotarySpring_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpDampedRotarySpring), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpDampedRotarySpring)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpDampedRotarySpring_getDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedRotarySpring* arg0 = (cpDampedRotarySpring*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpDampedRotarySpringGetDamping((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpDampedRotarySpring_getRestAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedRotarySpring* arg0 = (cpDampedRotarySpring*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpDampedRotarySpringGetRestAngle((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpDampedRotarySpring_getStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedRotarySpring* arg0 = (cpDampedRotarySpring*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpDampedRotarySpringGetStiffness((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpDampedRotarySpring_setDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedRotarySpring* arg0 = (cpDampedRotarySpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedRotarySpringSetDamping((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpDampedRotarySpring_setRestAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedRotarySpring* arg0 = (cpDampedRotarySpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedRotarySpringSetRestAngle((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpDampedRotarySpring_setStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedRotarySpring* arg0 = (cpDampedRotarySpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedRotarySpringSetStiffness((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpDampedRotarySpring_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpDampedRotarySpring_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpDampedRotarySpring_class->name = name;\n\tJSB_cpDampedRotarySpring_class->addProperty = JS_PropertyStub;\n\tJSB_cpDampedRotarySpring_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpDampedRotarySpring_class->getProperty = JS_PropertyStub;\n\tJSB_cpDampedRotarySpring_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpDampedRotarySpring_class->enumerate = JS_EnumerateStub;\n\tJSB_cpDampedRotarySpring_class->resolve = JS_ResolveStub;\n\tJSB_cpDampedRotarySpring_class->convert = JS_ConvertStub;\n\tJSB_cpDampedRotarySpring_class->finalize = JSB_cpDampedRotarySpring_finalize;\n\tJSB_cpDampedRotarySpring_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getDamping\", JSB_cpDampedRotarySpring_getDamping, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRestAngle\", JSB_cpDampedRotarySpring_getRestAngle, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStiffness\", JSB_cpDampedRotarySpring_getStiffness, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDamping\", JSB_cpDampedRotarySpring_setDamping, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRestAngle\", JSB_cpDampedRotarySpring_setRestAngle, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStiffness\", JSB_cpDampedRotarySpring_setStiffness, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpDampedRotarySpring_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpDampedRotarySpring_class, JSB_cpDampedRotarySpring_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpDampedSpring\n */\n#pragma mark - cpDampedSpring\n\nJSClass* JSB_cpDampedSpring_class = NULL;\nJSObject* JSB_cpDampedSpring_object = NULL;\n// Arguments: cpBody*, cpBody*, cpVect, cpVect, cpFloat, cpFloat, cpFloat\n// Constructor\nJSBool JSB_cpDampedSpring_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==7, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpDampedSpring_class, JSB_cpDampedSpring_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; double arg4; double arg5; double arg6; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg4 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg5 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg6 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpDampedSpringNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3 , (cpFloat)arg4 , (cpFloat)arg5 , (cpFloat)arg6  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpDampedSpring_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpDampedSpring), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpDampedSpring)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpDampedSpring_getAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpDampedSpringGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpDampedSpring_getAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpDampedSpringGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpDampedSpring_getDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpDampedSpringGetDamping((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpDampedSpring_getRestLength(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpDampedSpringGetRestLength((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpDampedSpring_getStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpDampedSpringGetStiffness((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpDampedSpring_setAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpDampedSpring_setAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpDampedSpring_setDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetDamping((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpDampedSpring_setRestLength(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetRestLength((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpDampedSpring_setStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpDampedSpring* arg0 = (cpDampedSpring*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetStiffness((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpDampedSpring_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpDampedSpring_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpDampedSpring_class->name = name;\n\tJSB_cpDampedSpring_class->addProperty = JS_PropertyStub;\n\tJSB_cpDampedSpring_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpDampedSpring_class->getProperty = JS_PropertyStub;\n\tJSB_cpDampedSpring_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpDampedSpring_class->enumerate = JS_EnumerateStub;\n\tJSB_cpDampedSpring_class->resolve = JS_ResolveStub;\n\tJSB_cpDampedSpring_class->convert = JS_ConvertStub;\n\tJSB_cpDampedSpring_class->finalize = JSB_cpDampedSpring_finalize;\n\tJSB_cpDampedSpring_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAnchr1\", JSB_cpDampedSpring_getAnchr1, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAnchr2\", JSB_cpDampedSpring_getAnchr2, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDamping\", JSB_cpDampedSpring_getDamping, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRestLength\", JSB_cpDampedSpring_getRestLength, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStiffness\", JSB_cpDampedSpring_getStiffness, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr1\", JSB_cpDampedSpring_setAnchr1, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAnchr2\", JSB_cpDampedSpring_setAnchr2, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDamping\", JSB_cpDampedSpring_setDamping, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRestLength\", JSB_cpDampedSpring_setRestLength, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setStiffness\", JSB_cpDampedSpring_setStiffness, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpDampedSpring_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpDampedSpring_class, JSB_cpDampedSpring_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpRatchetJoint\n */\n#pragma mark - cpRatchetJoint\n\nJSClass* JSB_cpRatchetJoint_class = NULL;\nJSObject* JSB_cpRatchetJoint_object = NULL;\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat\n// Constructor\nJSBool JSB_cpRatchetJoint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==4, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpRatchetJoint_class, JSB_cpRatchetJoint_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpRatchetJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpRatchetJoint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpRatchetJoint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpRatchetJoint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpRatchetJoint_getAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRatchetJoint* arg0 = (cpRatchetJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpRatchetJointGetAngle((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpRatchetJoint_getPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRatchetJoint* arg0 = (cpRatchetJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpRatchetJointGetPhase((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpRatchetJoint_getRatchet(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRatchetJoint* arg0 = (cpRatchetJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpRatchetJointGetRatchet((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpRatchetJoint_setAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRatchetJoint* arg0 = (cpRatchetJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRatchetJointSetAngle((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpRatchetJoint_setPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRatchetJoint* arg0 = (cpRatchetJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRatchetJointSetPhase((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpRatchetJoint_setRatchet(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRatchetJoint* arg0 = (cpRatchetJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRatchetJointSetRatchet((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpRatchetJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpRatchetJoint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpRatchetJoint_class->name = name;\n\tJSB_cpRatchetJoint_class->addProperty = JS_PropertyStub;\n\tJSB_cpRatchetJoint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpRatchetJoint_class->getProperty = JS_PropertyStub;\n\tJSB_cpRatchetJoint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpRatchetJoint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpRatchetJoint_class->resolve = JS_ResolveStub;\n\tJSB_cpRatchetJoint_class->convert = JS_ConvertStub;\n\tJSB_cpRatchetJoint_class->finalize = JSB_cpRatchetJoint_finalize;\n\tJSB_cpRatchetJoint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getAngle\", JSB_cpRatchetJoint_getAngle, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPhase\", JSB_cpRatchetJoint_getPhase, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRatchet\", JSB_cpRatchetJoint_getRatchet, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAngle\", JSB_cpRatchetJoint_setAngle, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPhase\", JSB_cpRatchetJoint_setPhase, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setRatchet\", JSB_cpRatchetJoint_setRatchet, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpRatchetJoint_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpRatchetJoint_class, JSB_cpRatchetJoint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpRotaryLimitJoint\n */\n#pragma mark - cpRotaryLimitJoint\n\nJSClass* JSB_cpRotaryLimitJoint_class = NULL;\nJSObject* JSB_cpRotaryLimitJoint_object = NULL;\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat\n// Constructor\nJSBool JSB_cpRotaryLimitJoint_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==4, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpRotaryLimitJoint_class, JSB_cpRotaryLimitJoint_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpRotaryLimitJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpRotaryLimitJoint_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpRotaryLimitJoint), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpConstraintFree( (cpConstraint*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpRotaryLimitJoint)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpRotaryLimitJoint_getMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRotaryLimitJoint* arg0 = (cpRotaryLimitJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpRotaryLimitJointGetMax((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpRotaryLimitJoint_getMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRotaryLimitJoint* arg0 = (cpRotaryLimitJoint*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpRotaryLimitJointGetMin((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpRotaryLimitJoint_setMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRotaryLimitJoint* arg0 = (cpRotaryLimitJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRotaryLimitJointSetMax((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpRotaryLimitJoint_setMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpRotaryLimitJoint* arg0 = (cpRotaryLimitJoint*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRotaryLimitJointSetMin((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpRotaryLimitJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpRotaryLimitJoint_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpRotaryLimitJoint_class->name = name;\n\tJSB_cpRotaryLimitJoint_class->addProperty = JS_PropertyStub;\n\tJSB_cpRotaryLimitJoint_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpRotaryLimitJoint_class->getProperty = JS_PropertyStub;\n\tJSB_cpRotaryLimitJoint_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpRotaryLimitJoint_class->enumerate = JS_EnumerateStub;\n\tJSB_cpRotaryLimitJoint_class->resolve = JS_ResolveStub;\n\tJSB_cpRotaryLimitJoint_class->convert = JS_ConvertStub;\n\tJSB_cpRotaryLimitJoint_class->finalize = JSB_cpRotaryLimitJoint_finalize;\n\tJSB_cpRotaryLimitJoint_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getMax\", JSB_cpRotaryLimitJoint_getMax, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMin\", JSB_cpRotaryLimitJoint_getMin, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMax\", JSB_cpRotaryLimitJoint_setMax, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMin\", JSB_cpRotaryLimitJoint_setMin, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpRotaryLimitJoint_object = JS_InitClass(cx, globalObj, JSB_cpConstraint_object, JSB_cpRotaryLimitJoint_class, JSB_cpRotaryLimitJoint_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpArbiter\n */\n#pragma mark - cpArbiter\n\nJSClass* JSB_cpArbiter_class = NULL;\nJSObject* JSB_cpArbiter_object = NULL;\n\n// Constructor\nJSBool JSB_cpArbiter_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSB_PRECONDITION2(false, cx, JS_TRUE, \"No constructor\");\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpArbiter_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpArbiter), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\t// No destructor found: ( (None*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpArbiter)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: int\nJSBool JSB_cpArbiter_getCount(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tint ret_val;\n\n\tret_val = cpArbiterGetCount((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: int\n// Ret value: cpFloat\nJSBool JSB_cpArbiter_getDepth(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterGetDepth((cpArbiter*)arg0 , (int)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpArbiter_getElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterGetElasticity((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpArbiter_getFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterGetFriction((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: int\n// Ret value: cpVect\nJSBool JSB_cpArbiter_getNormal(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpArbiterGetNormal((cpArbiter*)arg0 , (int)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: int\n// Ret value: cpVect\nJSBool JSB_cpArbiter_getPoint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpArbiterGetPoint((cpArbiter*)arg0 , (int)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpArbiter_getSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpArbiterGetSurfaceVelocity((cpArbiter*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpArbiter_ignore(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\n\tcpArbiterIgnore((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBool\nJSBool JSB_cpArbiter_isFirstContact(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tcpBool ret_val;\n\n\tret_val = cpArbiterIsFirstContact((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpArbiter_setElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpArbiterSetElasticity((cpArbiter*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpArbiter_setFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpArbiterSetFriction((cpArbiter*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpArbiter_setSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpArbiterSetSurfaceVelocity((cpArbiter*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpArbiter_totalImpulse(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpArbiterTotalImpulse((cpArbiter*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpArbiter_totalImpulseWithFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpArbiterTotalImpulseWithFriction((cpArbiter*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpArbiter_totalKE(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpArbiter* arg0 = (cpArbiter*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterTotalKE((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpArbiter_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpArbiter_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpArbiter_class->name = name;\n\tJSB_cpArbiter_class->addProperty = JS_PropertyStub;\n\tJSB_cpArbiter_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpArbiter_class->getProperty = JS_PropertyStub;\n\tJSB_cpArbiter_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpArbiter_class->enumerate = JS_EnumerateStub;\n\tJSB_cpArbiter_class->resolve = JS_ResolveStub;\n\tJSB_cpArbiter_class->convert = JS_ConvertStub;\n\tJSB_cpArbiter_class->finalize = JSB_cpArbiter_finalize;\n\tJSB_cpArbiter_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getCount\", JSB_cpArbiter_getCount, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDepth\", JSB_cpArbiter_getDepth, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getElasticity\", JSB_cpArbiter_getElasticity, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFriction\", JSB_cpArbiter_getFriction, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNormal\", JSB_cpArbiter_getNormal, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPoint\", JSB_cpArbiter_getPoint, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSurfaceVelocity\", JSB_cpArbiter_getSurfaceVelocity, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"ignore\", JSB_cpArbiter_ignore, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isFirstContact\", JSB_cpArbiter_isFirstContact, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setElasticity\", JSB_cpArbiter_setElasticity, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFriction\", JSB_cpArbiter_setFriction, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSurfaceVelocity\", JSB_cpArbiter_setSurfaceVelocity, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"totalImpulse\", JSB_cpArbiter_totalImpulse, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"totalImpulseWithFriction\", JSB_cpArbiter_totalImpulseWithFriction, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"totalKE\", JSB_cpArbiter_totalKE, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getShapes\", JSB_cpArbiter_getShapes, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBodies\", JSB_cpArbiter_getBodies, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpArbiter_object = JS_InitClass(cx, globalObj, JSB_cpBase_object, JSB_cpArbiter_class, JSB_cpArbiter_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpSpace\n */\n#pragma mark - cpSpace\n\nJSClass* JSB_cpSpace_class = NULL;\nJSObject* JSB_cpSpace_object = NULL;\n// Arguments: \n// Constructor\nJSBool JSB_cpSpace_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpSpace_class, JSB_cpSpace_object, NULL);\n\tvoid* \tret_val = cpSpaceNew( );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: void\nJSBool JSB_cpSpace_activateShapesTouchingShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceActivateShapesTouchingShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpBool\nJSBool JSB_cpSpace_containsBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceContainsBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpBool\nJSBool JSB_cpSpace_containsConstraint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceContainsConstraint((cpSpace*)arg0 , (cpConstraint*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpBool\nJSBool JSB_cpSpace_containsShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceContainsShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpSpace_destroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\n\tcpSpaceDestroy((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSpace_getCollisionBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetCollisionBias((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpTimestamp\nJSBool JSB_cpSpace_getCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpTimestamp ret_val;\n\n\tret_val = cpSpaceGetCollisionPersistence((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSpace_getCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetCollisionSlop((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSpace_getCurrentTimeStep(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetCurrentTimeStep((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSpace_getDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetDamping((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBool\nJSBool JSB_cpSpace_getEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpBool ret_val;\n\n\tret_val = cpSpaceGetEnableContactGraph((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpSpace_getGravity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpSpaceGetGravity((cpSpace*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSpace_getIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetIdleSpeedThreshold((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: int\nJSBool JSB_cpSpace_getIterations(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tint ret_val;\n\n\tret_val = cpSpaceGetIterations((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSpace_getSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetSleepTimeThreshold((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBody*\nJSBool JSB_cpSpace_getStaticBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpBody* ret_val;\n\n\tret_val = cpSpaceGetStaticBody((cpSpace*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpBody_object, JSB_cpBody_class, \"cpBody\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpSpace*\nJSBool JSB_cpSpace_init(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpSpace* ret_val;\n\n\tret_val = cpSpaceInit((cpSpace*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpSpace_object, JSB_cpSpace_class, \"cpSpace\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBool\nJSBool JSB_cpSpace_isLocked(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tcpBool ret_val;\n\n\tret_val = cpSpaceIsLocked((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpLayers, cpGroup\n// Ret value: cpShape*\nJSBool JSB_cpSpace_pointQueryFirst(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; uint32_t arg2; cpGroup arg3;\n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint( cx, *argvp++, (unsigned int*) &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpSpacePointQueryFirst((cpSpace*)arg0 , (cpVect)arg1 , (cpLayers)arg2 , (cpGroup)arg3  );\n\n\tif(ret_val) {\n\t\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpShape_object, JSB_cpShape_class, \"cpShape\" );\n\t\tJS_SET_RVAL(cx, vp, ret_jsval);\n\t} else {\n\t\tJS_SET_RVAL(cx, vp, JSVAL_NULL);\n\t}\n\treturn JS_TRUE;\n}\n// Arguments: cpShape*\n// Ret value: void\nJSBool JSB_cpSpace_reindexShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceReindexShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpSpace_reindexShapesForBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceReindexShapesForBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpSpace_reindexStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\n\tcpSpaceReindexStatic((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSpace_setCollisionBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetCollisionBias((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpTimestamp\n// Ret value: void\nJSBool JSB_cpSpace_setCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetCollisionPersistence((cpSpace*)arg0 , (cpTimestamp)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSpace_setCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetCollisionSlop((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSpace_setDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetDamping((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBool\n// Ret value: void\nJSBool JSB_cpSpace_setEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetEnableContactGraph((cpSpace*)arg0 , (cpBool)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpSpace_setGravity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetGravity((cpSpace*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSpace_setIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetIdleSpeedThreshold((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: int\n// Ret value: void\nJSBool JSB_cpSpace_setIterations(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetIterations((cpSpace*)arg0 , (int)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSpace_setSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetSleepTimeThreshold((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpSpace_step(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceStep((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, int\n// Ret value: void\nJSBool JSB_cpSpace_useSpatialHash(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; int32_t arg2; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceUseSpatialHash((cpSpace*)arg0 , (cpFloat)arg1 , (int)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpSpace_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpSpace_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpSpace_class->name = name;\n\tJSB_cpSpace_class->addProperty = JS_PropertyStub;\n\tJSB_cpSpace_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpSpace_class->getProperty = JS_PropertyStub;\n\tJSB_cpSpace_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpSpace_class->enumerate = JS_EnumerateStub;\n\tJSB_cpSpace_class->resolve = JS_ResolveStub;\n\tJSB_cpSpace_class->convert = JS_ConvertStub;\n\tJSB_cpSpace_class->finalize = JSB_cpSpace_finalize;\n\tJSB_cpSpace_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"activateShapesTouchingShape\", JSB_cpSpace_activateShapesTouchingShape, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"containsBody\", JSB_cpSpace_containsBody, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"containsConstraint\", JSB_cpSpace_containsConstraint, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"containsShape\", JSB_cpSpace_containsShape, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"destroy\", JSB_cpSpace_destroy, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCollisionBias\", JSB_cpSpace_getCollisionBias, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCollisionPersistence\", JSB_cpSpace_getCollisionPersistence, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCollisionSlop\", JSB_cpSpace_getCollisionSlop, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCurrentTimeStep\", JSB_cpSpace_getCurrentTimeStep, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getDamping\", JSB_cpSpace_getDamping, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getEnableContactGraph\", JSB_cpSpace_getEnableContactGraph, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGravity\", JSB_cpSpace_getGravity, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getIdleSpeedThreshold\", JSB_cpSpace_getIdleSpeedThreshold, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getIterations\", JSB_cpSpace_getIterations, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSleepTimeThreshold\", JSB_cpSpace_getSleepTimeThreshold, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getStaticBody\", JSB_cpSpace_getStaticBody, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", JSB_cpSpace_init, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isLocked\", JSB_cpSpace_isLocked, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pointQueryFirst\", JSB_cpSpace_pointQueryFirst, 3, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reindexShape\", JSB_cpSpace_reindexShape, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reindexShapesForBody\", JSB_cpSpace_reindexShapesForBody, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"reindexStatic\", JSB_cpSpace_reindexStatic, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCollisionBias\", JSB_cpSpace_setCollisionBias, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCollisionPersistence\", JSB_cpSpace_setCollisionPersistence, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCollisionSlop\", JSB_cpSpace_setCollisionSlop, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDamping\", JSB_cpSpace_setDamping, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setEnableContactGraph\", JSB_cpSpace_setEnableContactGraph, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGravity\", JSB_cpSpace_setGravity, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setIdleSpeedThreshold\", JSB_cpSpace_setIdleSpeedThreshold, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setIterations\", JSB_cpSpace_setIterations, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSleepTimeThreshold\", JSB_cpSpace_setSleepTimeThreshold, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"step\", JSB_cpSpace_step, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"useSpatialHash\", JSB_cpSpace_useSpatialHash, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addShape\", JSB_cpSpace_addShape, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addCollisionHandler\", JSB_cpSpace_addCollisionHandler, 7, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addStaticShape\", JSB_cpSpace_addStaticShape, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeConstraint\", JSB_cpSpace_removeConstraint, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeBody\", JSB_cpSpace_removeBody, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeCollisionHandler\", JSB_cpSpace_removeCollisionHandler, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeStaticShape\", JSB_cpSpace_removeStaticShape, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addConstraint\", JSB_cpSpace_addConstraint, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"addBody\", JSB_cpSpace_addBody, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"removeShape\", JSB_cpSpace_removeShape, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpSpace_object = JS_InitClass(cx, globalObj, JSB_cpBase_object, JSB_cpSpace_class, JSB_cpSpace_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpBody\n */\n#pragma mark - cpBody\n\nJSClass* JSB_cpBody_class = NULL;\nJSObject* JSB_cpBody_object = NULL;\n\n// Destructor\nvoid JSB_cpBody_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpBody), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpBodyFree( (cpBody*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpBody)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpBody_activate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\n\tcpBodyActivate((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: void\nJSBool JSB_cpBody_activateStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyActivateStatic((cpBody*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: void\nJSBool JSB_cpBody_applyForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyApplyForce((cpBody*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: void\nJSBool JSB_cpBody_applyImpulse(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyApplyImpulse((cpBody*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpBody_destroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\n\tcpBodyDestroy((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_getAngVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetAngVel((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_getAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetAngVelLimit((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_getAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetAngle((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpBody_getForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetForce((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_getMass(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetMass((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_getMoment(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetMoment((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpBody_getPos(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetPos((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpBody_getRot(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetRot((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpSpace*\nJSBool JSB_cpBody_getSpace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpSpace* ret_val;\n\n\tret_val = cpBodyGetSpace((cpBody*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpSpace_object, JSB_cpSpace_class, \"cpSpace\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_getTorque(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetTorque((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpBody_getVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetVel((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpBody_getVelAtLocalPoint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetVelAtLocalPoint((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpBody_getVelAtWorldPoint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetVelAtWorldPoint((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_getVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetVelLimit((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat\n// Ret value: cpBody*\nJSBool JSB_cpBody_init(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; double arg2; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpBodyInit((cpBody*)arg0 , (cpFloat)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpBody_object, JSB_cpBody_class, \"cpBody\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBody*\nJSBool JSB_cpBody_initStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpBody* ret_val;\n\n\tret_val = cpBodyInitStatic((cpBody*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpBody_object, JSB_cpBody_class, \"cpBody\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBool\nJSBool JSB_cpBody_isRogue(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpBool ret_val;\n\n\tret_val = cpBodyIsRogue((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBool\nJSBool JSB_cpBody_isSleeping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpBool ret_val;\n\n\tret_val = cpBodyIsSleeping((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBool\nJSBool JSB_cpBody_isStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpBool ret_val;\n\n\tret_val = cpBodyIsStatic((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpBody_kineticEnergy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpBodyKineticEnergy((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpBody_local2World(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyLocal2World((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpBody_resetForces(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\n\tcpBodyResetForces((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_setAngVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetAngVel((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_setAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetAngVelLimit((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_setAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetAngle((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpBody_setForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetForce((cpBody*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_setMass(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetMass((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_setMoment(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetMoment((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpBody_setPos(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetPos((cpBody*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_setTorque(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetTorque((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpBody_setVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetVel((cpBody*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_setVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetVelLimit((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpBody_sleep(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\n\tcpBodySleep((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpBody_sleepWithGroup(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySleepWithGroup((cpBody*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpBody_updatePosition(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyUpdatePosition((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpFloat, cpFloat\n// Ret value: void\nJSBool JSB_cpBody_updateVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; double arg2; double arg3; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyUpdateVelocity((cpBody*)arg0 , (cpVect)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpBody_world2Local(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpBody* arg0 = (cpBody*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyWorld2Local((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpBody_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpBody_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpBody_class->name = name;\n\tJSB_cpBody_class->addProperty = JS_PropertyStub;\n\tJSB_cpBody_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpBody_class->getProperty = JS_PropertyStub;\n\tJSB_cpBody_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpBody_class->enumerate = JS_EnumerateStub;\n\tJSB_cpBody_class->resolve = JS_ResolveStub;\n\tJSB_cpBody_class->convert = JS_ConvertStub;\n\tJSB_cpBody_class->finalize = JSB_cpBody_finalize;\n\tJSB_cpBody_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"activate\", JSB_cpBody_activate, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"activateStatic\", JSB_cpBody_activateStatic, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"applyForce\", JSB_cpBody_applyForce, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"applyImpulse\", JSB_cpBody_applyImpulse, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"destroy\", JSB_cpBody_destroy, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAngVel\", JSB_cpBody_getAngVel, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAngVelLimit\", JSB_cpBody_getAngVelLimit, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAngle\", JSB_cpBody_getAngle, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getForce\", JSB_cpBody_getForce, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMass\", JSB_cpBody_getMass, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getMoment\", JSB_cpBody_getMoment, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPos\", JSB_cpBody_getPos, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRot\", JSB_cpBody_getRot, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpace\", JSB_cpBody_getSpace, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getTorque\", JSB_cpBody_getTorque, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVel\", JSB_cpBody_getVel, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVelAtLocalPoint\", JSB_cpBody_getVelAtLocalPoint, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVelAtWorldPoint\", JSB_cpBody_getVelAtWorldPoint, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVelLimit\", JSB_cpBody_getVelLimit, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"init\", JSB_cpBody_init, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"initStatic\", JSB_cpBody_initStatic, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isRogue\", JSB_cpBody_isRogue, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isSleeping\", JSB_cpBody_isSleeping, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"isStatic\", JSB_cpBody_isStatic, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"kineticEnergy\", JSB_cpBody_kineticEnergy, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"local2World\", JSB_cpBody_local2World, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"resetForces\", JSB_cpBody_resetForces, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAngVel\", JSB_cpBody_setAngVel, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAngVelLimit\", JSB_cpBody_setAngVelLimit, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setAngle\", JSB_cpBody_setAngle, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setForce\", JSB_cpBody_setForce, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMass\", JSB_cpBody_setMass, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setMoment\", JSB_cpBody_setMoment, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setPos\", JSB_cpBody_setPos, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setTorque\", JSB_cpBody_setTorque, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVel\", JSB_cpBody_setVel, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setVelLimit\", JSB_cpBody_setVelLimit, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"sleep\", JSB_cpBody_sleep, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"sleepWithGroup\", JSB_cpBody_sleepWithGroup, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updatePosition\", JSB_cpBody_updatePosition, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"updateVelocity\", JSB_cpBody_updateVelocity, 3, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"world2Local\", JSB_cpBody_world2Local, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setUserData\", JSB_cpBody_setUserData, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getUserData\", JSB_cpBody_getUserData, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpBody_object = JS_InitClass(cx, globalObj, JSB_cpBase_object, JSB_cpBody_class, JSB_cpBody_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpShape\n */\n#pragma mark - cpShape\n\nJSClass* JSB_cpShape_class = NULL;\nJSObject* JSB_cpShape_object = NULL;\n\n// Constructor\nJSBool JSB_cpShape_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSB_PRECONDITION2(false, cx, JS_TRUE, \"No constructor\");\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpShape_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpShape), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpShapeFree( (cpShape*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpShape)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpBB\nJSBool JSB_cpShape_cacheBB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpBB ret_val;\n\n\tret_val = cpShapeCacheBB((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpShape_destroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\n\tcpShapeDestroy((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBB\nJSBool JSB_cpShape_getBB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpBB ret_val;\n\n\tret_val = cpShapeGetBB((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBody*\nJSBool JSB_cpShape_getBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpBody* ret_val;\n\n\tret_val = cpShapeGetBody((cpShape*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpBody_object, JSB_cpBody_class, \"cpBody\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpCollisionType\nJSBool JSB_cpShape_getCollisionType(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpCollisionType ret_val;\n\n\tret_val = cpShapeGetCollisionType((cpShape*)arg0  );\n\n\tjsval ret_jsval = uint32_to_jsval( cx, (cpCollisionType)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpShape_getElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpShapeGetElasticity((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpShape_getFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpShapeGetFriction((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpGroup\nJSBool JSB_cpShape_getGroup(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpGroup ret_val;\n\n\tret_val = cpShapeGetGroup((cpShape*)arg0  );\n\n\tjsval ret_jsval = uint32_to_jsval( cx, (cpGroup)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpLayers\nJSBool JSB_cpShape_getLayers(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpLayers ret_val;\n\n\tret_val = cpShapeGetLayers((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBool\nJSBool JSB_cpShape_getSensor(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpBool ret_val;\n\n\tret_val = cpShapeGetSensor((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpSpace*\nJSBool JSB_cpShape_getSpace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpSpace* ret_val;\n\n\tret_val = cpShapeGetSpace((cpShape*)arg0  );\n\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpSpace_object, JSB_cpSpace_class, \"cpSpace\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpShape_getSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpShapeGetSurfaceVelocity((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpBool\nJSBool JSB_cpShape_pointQuery(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpShapePointQuery((cpShape*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpShape_setBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg1; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, NULL );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetBody((cpShape*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpCollisionType\n// Ret value: void\nJSBool JSB_cpShape_setCollisionType(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpCollisionType arg1; \n\n\tok &= jsval_to_uint( cx, *argvp++, (unsigned int*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetCollisionType((cpShape*)arg0 , (cpCollisionType)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpShape_setElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetElasticity((cpShape*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: void\nJSBool JSB_cpShape_setFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetFriction((cpShape*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpGroup\n// Ret value: void\nJSBool JSB_cpShape_setGroup(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpGroup arg1; \n\n\tok &= jsval_to_uint( cx, *argvp++, (unsigned int*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetGroup((cpShape*)arg0 , (cpGroup)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpLayers\n// Ret value: void\nJSBool JSB_cpShape_setLayers(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetLayers((cpShape*)arg0 , (cpLayers)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBool\n// Ret value: void\nJSBool JSB_cpShape_setSensor(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetSensor((cpShape*)arg0 , (cpBool)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: void\nJSBool JSB_cpShape_setSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetSurfaceVelocity((cpShape*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpBB\nJSBool JSB_cpShape_update(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpShape* arg0 = (cpShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpShapeUpdate((cpShape*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpShape_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpShape_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpShape_class->name = name;\n\tJSB_cpShape_class->addProperty = JS_PropertyStub;\n\tJSB_cpShape_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpShape_class->getProperty = JS_PropertyStub;\n\tJSB_cpShape_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpShape_class->enumerate = JS_EnumerateStub;\n\tJSB_cpShape_class->resolve = JS_ResolveStub;\n\tJSB_cpShape_class->convert = JS_ConvertStub;\n\tJSB_cpShape_class->finalize = JSB_cpShape_finalize;\n\tJSB_cpShape_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"cacheBB\", JSB_cpShape_cacheBB, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"destroy\", JSB_cpShape_destroy, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBB\", JSB_cpShape_getBB, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getBody\", JSB_cpShape_getBody, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getCollisionType\", JSB_cpShape_getCollisionType, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getElasticity\", JSB_cpShape_getElasticity, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getFriction\", JSB_cpShape_getFriction, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getGroup\", JSB_cpShape_getGroup, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getLayers\", JSB_cpShape_getLayers, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSensor\", JSB_cpShape_getSensor, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpace\", JSB_cpShape_getSpace, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSurfaceVelocity\", JSB_cpShape_getSurfaceVelocity, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"pointQuery\", JSB_cpShape_pointQuery, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setBody\", JSB_cpShape_setBody, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCollisionType\", JSB_cpShape_setCollisionType, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setElasticity\", JSB_cpShape_setElasticity, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setFriction\", JSB_cpShape_setFriction, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setGroup\", JSB_cpShape_setGroup, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setLayers\", JSB_cpShape_setLayers, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSensor\", JSB_cpShape_setSensor, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSurfaceVelocity\", JSB_cpShape_setSurfaceVelocity, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"update\", JSB_cpShape_update, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpShape_object = JS_InitClass(cx, globalObj, JSB_cpBase_object, JSB_cpShape_class, JSB_cpShape_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpCircleShape\n */\n#pragma mark - cpCircleShape\n\nJSClass* JSB_cpCircleShape_class = NULL;\nJSObject* JSB_cpCircleShape_object = NULL;\n// Arguments: cpBody*, cpFloat, cpVect\n// Constructor\nJSBool JSB_cpCircleShape_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==3, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpCircleShape_class, JSB_cpCircleShape_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; cpVect arg2; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpCircleShapeNew((cpBody*)arg0 , (cpFloat)arg1 , (cpVect)arg2  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpCircleShape_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpCircleShape), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpShapeFree( (cpShape*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpCircleShape)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpCircleShape_getOffset(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpCircleShape* arg0 = (cpCircleShape*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpCircleShapeGetOffset((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpCircleShape_getRadius(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpCircleShape* arg0 = (cpCircleShape*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpCircleShapeGetRadius((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpCircleShape_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpCircleShape_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpCircleShape_class->name = name;\n\tJSB_cpCircleShape_class->addProperty = JS_PropertyStub;\n\tJSB_cpCircleShape_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpCircleShape_class->getProperty = JS_PropertyStub;\n\tJSB_cpCircleShape_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpCircleShape_class->enumerate = JS_EnumerateStub;\n\tJSB_cpCircleShape_class->resolve = JS_ResolveStub;\n\tJSB_cpCircleShape_class->convert = JS_ConvertStub;\n\tJSB_cpCircleShape_class->finalize = JSB_cpCircleShape_finalize;\n\tJSB_cpCircleShape_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getOffset\", JSB_cpCircleShape_getOffset, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRadius\", JSB_cpCircleShape_getRadius, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpCircleShape_object = JS_InitClass(cx, globalObj, JSB_cpShape_object, JSB_cpCircleShape_class, JSB_cpCircleShape_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpSegmentShape\n */\n#pragma mark - cpSegmentShape\n\nJSClass* JSB_cpSegmentShape_class = NULL;\nJSObject* JSB_cpSegmentShape_object = NULL;\n// Arguments: cpBody*, cpVect, cpVect, cpFloat\n// Constructor\nJSBool JSB_cpSegmentShape_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==4, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpSegmentShape_class, JSB_cpSegmentShape_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; cpVect arg2; double arg3; \n\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg0, NULL );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tvoid* \tret_val = cpSegmentShapeNew((cpBody*)arg0 , (cpVect)arg1 , (cpVect)arg2 , (cpFloat)arg3  );\n\n\tjsb_set_jsobject_for_proxy(jsobj, ret_val);\n\tjsb_set_c_proxy_for_jsobject(jsobj, ret_val, JSB_C_FLAG_CALL_FREE);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpSegmentShape_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpSegmentShape), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpShapeFree( (cpShape*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpSegmentShape)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpSegmentShape_getA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSegmentShape* arg0 = (cpSegmentShape*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpSegmentShapeGetA((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpSegmentShape_getB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSegmentShape* arg0 = (cpSegmentShape*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpSegmentShapeGetB((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpVect\nJSBool JSB_cpSegmentShape_getNormal(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSegmentShape* arg0 = (cpSegmentShape*) proxy->handle;\n\tcpVect ret_val;\n\n\tret_val = cpSegmentShapeGetNormal((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpFloat\nJSBool JSB_cpSegmentShape_getRadius(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSegmentShape* arg0 = (cpSegmentShape*) proxy->handle;\n\tcpFloat ret_val;\n\n\tret_val = cpSegmentShapeGetRadius((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: void\nJSBool JSB_cpSegmentShape_setNeighbors(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSegmentShape* arg0 = (cpSegmentShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSegmentShapeSetNeighbors((cpShape*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpSegmentShape_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpSegmentShape_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpSegmentShape_class->name = name;\n\tJSB_cpSegmentShape_class->addProperty = JS_PropertyStub;\n\tJSB_cpSegmentShape_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpSegmentShape_class->getProperty = JS_PropertyStub;\n\tJSB_cpSegmentShape_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpSegmentShape_class->enumerate = JS_EnumerateStub;\n\tJSB_cpSegmentShape_class->resolve = JS_ResolveStub;\n\tJSB_cpSegmentShape_class->convert = JS_ConvertStub;\n\tJSB_cpSegmentShape_class->finalize = JSB_cpSegmentShape_finalize;\n\tJSB_cpSegmentShape_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getA\", JSB_cpSegmentShape_getA, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getB\", JSB_cpSegmentShape_getB, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getNormal\", JSB_cpSegmentShape_getNormal, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getRadius\", JSB_cpSegmentShape_getRadius, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setNeighbors\", JSB_cpSegmentShape_setNeighbors, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpSegmentShape_object = JS_InitClass(cx, globalObj, JSB_cpShape_object, JSB_cpSegmentShape_class, JSB_cpSegmentShape_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n/*\n * cpPolyShape\n */\n#pragma mark - cpPolyShape\n\nJSClass* JSB_cpPolyShape_class = NULL;\nJSObject* JSB_cpPolyShape_object = NULL;\n\n// Destructor\nvoid JSB_cpPolyShape_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpPolyShape), handle: %p\", jsthis, proxy->handle);\n\n\t\tjsb_del_jsobject_for_proxy(proxy->handle);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpShapeFree( (cpShape*)proxy->handle);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t} else {\n\t\tCCLOGINFO(\"jsbindings: finalizing uninitialized JS object %p (cpPolyShape)\", jsthis);\n\t}\n}\n\n// Arguments: \n// Ret value: int\nJSBool JSB_cpPolyShape_getNumVerts(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPolyShape* arg0 = (cpPolyShape*) proxy->handle;\n\tint ret_val;\n\n\tret_val = cpPolyShapeGetNumVerts((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: int\n// Ret value: cpVect\nJSBool JSB_cpPolyShape_getVert(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpPolyShape* arg0 = (cpPolyShape*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpPolyShapeGetVert((cpShape*)arg0 , (int)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\nvoid JSB_cpPolyShape_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpPolyShape_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpPolyShape_class->name = name;\n\tJSB_cpPolyShape_class->addProperty = JS_PropertyStub;\n\tJSB_cpPolyShape_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpPolyShape_class->getProperty = JS_PropertyStub;\n\tJSB_cpPolyShape_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpPolyShape_class->enumerate = JS_EnumerateStub;\n\tJSB_cpPolyShape_class->resolve = JS_ResolveStub;\n\tJSB_cpPolyShape_class->convert = JS_ConvertStub;\n\tJSB_cpPolyShape_class->finalize = JSB_cpPolyShape_finalize;\n\tJSB_cpPolyShape_class->flags = JSCLASS_HAS_PRIVATE;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getNumVerts\", JSB_cpPolyShape_getNumVerts, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getVert\", JSB_cpPolyShape_getVert, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\n\tJSB_cpPolyShape_object = JS_InitClass(cx, globalObj, JSB_cpShape_object, JSB_cpPolyShape_class, JSB_cpPolyShape_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n\n#endif // JSB_INCLUDE_CHIPMUNK\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_auto_classes.h",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c chipmunk_jsb.ini\" on 2012-11-07\n* Script version: v0.3\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n\n#include \"js_bindings_chipmunk_manual.h\"\nextern JSObject *JSB_cpConstraint_object;\nextern JSClass *JSB_cpConstraint_class;\nvoid JSB_cpConstraint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpGrooveJoint_object;\nextern JSClass *JSB_cpGrooveJoint_class;\nvoid JSB_cpGrooveJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpSimpleMotor_object;\nextern JSClass *JSB_cpSimpleMotor_class;\nvoid JSB_cpSimpleMotor_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpPivotJoint_object;\nextern JSClass *JSB_cpPivotJoint_class;\nvoid JSB_cpPivotJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpPinJoint_object;\nextern JSClass *JSB_cpPinJoint_class;\nvoid JSB_cpPinJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpSlideJoint_object;\nextern JSClass *JSB_cpSlideJoint_class;\nvoid JSB_cpSlideJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpGearJoint_object;\nextern JSClass *JSB_cpGearJoint_class;\nvoid JSB_cpGearJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpDampedRotarySpring_object;\nextern JSClass *JSB_cpDampedRotarySpring_class;\nvoid JSB_cpDampedRotarySpring_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpDampedSpring_object;\nextern JSClass *JSB_cpDampedSpring_class;\nvoid JSB_cpDampedSpring_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpRatchetJoint_object;\nextern JSClass *JSB_cpRatchetJoint_class;\nvoid JSB_cpRatchetJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpRotaryLimitJoint_object;\nextern JSClass *JSB_cpRotaryLimitJoint_class;\nvoid JSB_cpRotaryLimitJoint_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpArbiter_object;\nextern JSClass *JSB_cpArbiter_class;\nvoid JSB_cpArbiter_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpSpace_object;\nextern JSClass *JSB_cpSpace_class;\nvoid JSB_cpSpace_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpBody_object;\nextern JSClass *JSB_cpBody_class;\nvoid JSB_cpBody_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpShape_object;\nextern JSClass *JSB_cpShape_class;\nvoid JSB_cpShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpCircleShape_object;\nextern JSClass *JSB_cpCircleShape_class;\nvoid JSB_cpCircleShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpSegmentShape_object;\nextern JSClass *JSB_cpSegmentShape_class;\nvoid JSB_cpSegmentShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );\nextern JSObject *JSB_cpPolyShape_object;\nextern JSClass *JSB_cpPolyShape_class;\nvoid JSB_cpPolyShape_createClass(JSContext *cx, JSObject* globalObj, const char* name );\n\n\n#endif // JSB_INCLUDE_CHIPMUNK\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_auto_classes_registration.h",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c chipmunk_jsb.ini\" on 2012-11-07\n* Script version: v0.3\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n\nJSB_cpConstraint_createClass(cx, chipmunk, \"Constraint\");\nJSB_cpGrooveJoint_createClass(cx, chipmunk, \"GrooveJoint\");\nJSB_cpSimpleMotor_createClass(cx, chipmunk, \"SimpleMotor\");\nJSB_cpPivotJoint_createClass(cx, chipmunk, \"PivotJoint\");\nJSB_cpPinJoint_createClass(cx, chipmunk, \"PinJoint\");\nJSB_cpSlideJoint_createClass(cx, chipmunk, \"SlideJoint\");\nJSB_cpGearJoint_createClass(cx, chipmunk, \"GearJoint\");\nJSB_cpDampedRotarySpring_createClass(cx, chipmunk, \"DampedRotarySpring\");\nJSB_cpDampedSpring_createClass(cx, chipmunk, \"DampedSpring\");\nJSB_cpRatchetJoint_createClass(cx, chipmunk, \"RatchetJoint\");\nJSB_cpRotaryLimitJoint_createClass(cx, chipmunk, \"RotaryLimitJoint\");\nJSB_cpArbiter_createClass(cx, chipmunk, \"Arbiter\");\nJSB_cpSpace_createClass(cx, chipmunk, \"Space\");\nJSB_cpBody_createClass(cx, chipmunk, \"Body\");\nJSB_cpShape_createClass(cx, chipmunk, \"Shape\");\nJSB_cpCircleShape_createClass(cx, chipmunk, \"CircleShape\");\nJSB_cpSegmentShape_createClass(cx, chipmunk, \"SegmentShape\");\nJSB_cpPolyShape_createClass(cx, chipmunk, \"PolyShape\");\n\n\n#endif // JSB_INCLUDE_CHIPMUNK\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_functions.cpp",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c chipmunk_jsb.ini\" on 2012-11-07\n* Script version: v0.3\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n\n#include \"js_bindings_chipmunk_manual.h\"\n\n#include \"jsfriendapi.h\"\n#include \"js_bindings_config.h\"\n#include \"js_manual_conversions.h\"\n#include \"js_bindings_chipmunk_functions.h\"\n\n// Arguments: cpArbiter*\n// Ret value: int\nJSBool JSB_cpArbiterGetCount(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tint ret_val;\n\n\tret_val = cpArbiterGetCount((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*, int\n// Ret value: cpFloat\nJSBool JSB_cpArbiterGetDepth(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; int32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterGetDepth((cpArbiter*)arg0 , (int)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: cpFloat\nJSBool JSB_cpArbiterGetElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterGetElasticity((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: cpFloat\nJSBool JSB_cpArbiterGetFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterGetFriction((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*, int\n// Ret value: cpVect\nJSBool JSB_cpArbiterGetNormal(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; int32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpArbiterGetNormal((cpArbiter*)arg0 , (int)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*, int\n// Ret value: cpVect\nJSBool JSB_cpArbiterGetPoint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; int32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpArbiterGetPoint((cpArbiter*)arg0 , (int)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: cpVect\nJSBool JSB_cpArbiterGetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpArbiterGetSurfaceVelocity((cpArbiter*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: void\nJSBool JSB_cpArbiterIgnore(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpArbiterIgnore((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: cpBool\nJSBool JSB_cpArbiterIsFirstContact(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpArbiterIsFirstContact((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*, cpFloat\n// Ret value: void\nJSBool JSB_cpArbiterSetElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpArbiterSetElasticity((cpArbiter*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*, cpFloat\n// Ret value: void\nJSBool JSB_cpArbiterSetFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpArbiterSetFriction((cpArbiter*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*, cpVect\n// Ret value: void\nJSBool JSB_cpArbiterSetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpArbiterSetSurfaceVelocity((cpArbiter*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: cpVect\nJSBool JSB_cpArbiterTotalImpulse(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpArbiterTotalImpulse((cpArbiter*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: cpVect\nJSBool JSB_cpArbiterTotalImpulseWithFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpArbiterTotalImpulseWithFriction((cpArbiter*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpArbiter*\n// Ret value: cpFloat\nJSBool JSB_cpArbiterTotalKE(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpArbiter* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpArbiterTotalKE((cpArbiter*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpAreaForCircle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpAreaForCircle((cpFloat)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpAreaForSegment(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; double arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpAreaForSegment((cpVect)arg0 , (cpVect)arg1 , (cpFloat)arg2  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB\n// Ret value: cpFloat\nJSBool JSB_cpBBArea(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBBArea((cpBB)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpVect\n// Ret value: cpVect\nJSBool JSB_cpBBClampVect(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpVect arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBBClampVect((cpBB)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpBB\n// Ret value: cpBool\nJSBool JSB_cpBBContainsBB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpBB arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpBBContainsBB((cpBB)arg0 , (cpBB)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpVect\n// Ret value: cpBool\nJSBool JSB_cpBBContainsVect(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpVect arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpBBContainsVect((cpBB)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpVect\n// Ret value: cpBB\nJSBool JSB_cpBBExpand(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpVect arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpBBExpand((cpBB)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpBB\n// Ret value: cpBool\nJSBool JSB_cpBBIntersects(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpBB arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpBBIntersects((cpBB)arg0 , (cpBB)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpVect, cpVect\n// Ret value: cpBool\nJSBool JSB_cpBBIntersectsSegment(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpBBIntersectsSegment((cpBB)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpBB\n// Ret value: cpBB\nJSBool JSB_cpBBMerge(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpBB arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpBBMerge((cpBB)arg0 , (cpBB)arg1  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpBB\n// Ret value: cpFloat\nJSBool JSB_cpBBMergedArea(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpBB arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBBMergedArea((cpBB)arg0 , (cpBB)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat, cpFloat, cpFloat\n// Ret value: cpBB\nJSBool JSB_cpBBNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; double arg2; double arg3; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpBBNew((cpFloat)arg0 , (cpFloat)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpFloat\n// Ret value: cpBB\nJSBool JSB_cpBBNewForCircle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; double arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpBBNewForCircle((cpVect)arg0 , (cpFloat)arg1  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpVect, cpVect\n// Ret value: cpFloat\nJSBool JSB_cpBBSegmentQuery(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBBSegmentQuery((cpBB)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBB, cpVect\n// Ret value: cpVect\nJSBool JSB_cpBBWrapVect(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBB arg0; cpVect arg1; \n\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBBWrapVect((cpBB)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpBodyActivate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyActivate((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpShape*\n// Ret value: void\nJSBool JSB_cpBodyActivateStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyActivateStatic((cpBody*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect, cpVect\n// Ret value: void\nJSBool JSB_cpBodyApplyForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyApplyForce((cpBody*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect, cpVect\n// Ret value: void\nJSBool JSB_cpBodyApplyImpulse(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyApplyImpulse((cpBody*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpBodyDestroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyDestroy((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpBodyFree(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyFree((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyGetAngVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetAngVel((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyGetAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetAngVelLimit((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyGetAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetAngle((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpVect\nJSBool JSB_cpBodyGetForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetForce((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyGetMass(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetMass((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyGetMoment(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetMoment((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpVect\nJSBool JSB_cpBodyGetPos(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetPos((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpVect\nJSBool JSB_cpBodyGetRot(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetRot((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpSpace*\nJSBool JSB_cpBodyGetSpace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpSpace* ret_val;\n\n\tret_val = cpBodyGetSpace((cpBody*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyGetTorque(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetTorque((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpVect\nJSBool JSB_cpBodyGetVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetVel((cpBody*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect\n// Ret value: cpVect\nJSBool JSB_cpBodyGetVelAtLocalPoint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetVelAtLocalPoint((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect\n// Ret value: cpVect\nJSBool JSB_cpBodyGetVelAtWorldPoint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyGetVelAtWorldPoint((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyGetVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyGetVelLimit((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat, cpFloat\n// Ret value: cpBody*\nJSBool JSB_cpBodyInit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; double arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpBodyInit((cpBody*)arg0 , (cpFloat)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpBody*\nJSBool JSB_cpBodyInitStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpBodyInitStatic((cpBody*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpBool\nJSBool JSB_cpBodyIsRogue(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpBodyIsRogue((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpBool\nJSBool JSB_cpBodyIsSleeping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpBodyIsSleeping((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpBool\nJSBool JSB_cpBodyIsStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpBodyIsStatic((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: cpFloat\nJSBool JSB_cpBodyKineticEnergy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpBodyKineticEnergy((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect\n// Ret value: cpVect\nJSBool JSB_cpBodyLocal2World(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyLocal2World((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat\n// Ret value: cpBody*\nJSBool JSB_cpBodyNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpBodyNew((cpFloat)arg0 , (cpFloat)arg1  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpBody*\nJSBool JSB_cpBodyNewStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tcpBody* ret_val;\n\n\tret_val = cpBodyNewStatic( );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpBodyResetForces(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyResetForces((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodySetAngVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetAngVel((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodySetAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetAngVelLimit((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodySetAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetAngle((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect\n// Ret value: void\nJSBool JSB_cpBodySetForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetForce((cpBody*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodySetMass(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetMass((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodySetMoment(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetMoment((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect\n// Ret value: void\nJSBool JSB_cpBodySetPos(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetPos((cpBody*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodySetTorque(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetTorque((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect\n// Ret value: void\nJSBool JSB_cpBodySetVel(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetVel((cpBody*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodySetVelLimit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySetVelLimit((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpBodySleep(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySleep((cpBody*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*\n// Ret value: void\nJSBool JSB_cpBodySleepWithGroup(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodySleepWithGroup((cpBody*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat\n// Ret value: void\nJSBool JSB_cpBodyUpdatePosition(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyUpdatePosition((cpBody*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect, cpFloat, cpFloat\n// Ret value: void\nJSBool JSB_cpBodyUpdateVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; double arg2; double arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpBodyUpdateVelocity((cpBody*)arg0 , (cpVect)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect\n// Ret value: cpVect\nJSBool JSB_cpBodyWorld2Local(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpBodyWorld2Local((cpBody*)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat, cpFloat\n// Ret value: cpShape*\nJSBool JSB_cpBoxShapeNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; double arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpBoxShapeNew((cpBody*)arg0 , (cpFloat)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBB\n// Ret value: cpShape*\nJSBool JSB_cpBoxShapeNew2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBB arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpBoxShapeNew2((cpBody*)arg0 , (cpBB)arg1  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpVect\nJSBool JSB_cpCircleShapeGetOffset(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpCircleShapeGetOffset((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpFloat\nJSBool JSB_cpCircleShapeGetRadius(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpCircleShapeGetRadius((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpFloat, cpVect\n// Ret value: cpShape*\nJSBool JSB_cpCircleShapeNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; double arg1; cpVect arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpCircleShapeNew((cpBody*)arg0 , (cpFloat)arg1 , (cpVect)arg2  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: void\nJSBool JSB_cpConstraintActivateBodies(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintActivateBodies((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: void\nJSBool JSB_cpConstraintDestroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintDestroy((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: void\nJSBool JSB_cpConstraintFree(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintFree((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpBody*\nJSBool JSB_cpConstraintGetA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpConstraintGetA((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpBody*\nJSBool JSB_cpConstraintGetB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpConstraintGetB((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpConstraintGetErrorBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetErrorBias((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpConstraintGetImpulse(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetImpulse((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpConstraintGetMaxBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetMaxBias((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpConstraintGetMaxForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpConstraintGetMaxForce((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpSpace*\nJSBool JSB_cpConstraintGetSpace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpSpace* ret_val;\n\n\tret_val = cpConstraintGetSpace((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpConstraintSetErrorBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintSetErrorBias((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpConstraintSetMaxBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintSetMaxBias((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpConstraintSetMaxForce(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpConstraintSetMaxForce((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpDampedRotarySpringGetDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpDampedRotarySpringGetDamping((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpDampedRotarySpringGetRestAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpDampedRotarySpringGetRestAngle((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpDampedRotarySpringGetStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpDampedRotarySpringGetStiffness((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat, cpFloat\n// Ret value: cpConstraint*\nJSBool JSB_cpDampedRotarySpringNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 5, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; double arg4; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpDampedRotarySpringNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3 , (cpFloat)arg4  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpDampedRotarySpringSetDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedRotarySpringSetDamping((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpDampedRotarySpringSetRestAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedRotarySpringSetRestAngle((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpDampedRotarySpringSetStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedRotarySpringSetStiffness((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpDampedSpringGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpDampedSpringGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpDampedSpringGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpDampedSpringGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpDampedSpringGetDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpDampedSpringGetDamping((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpDampedSpringGetRestLength(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpDampedSpringGetRestLength((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpDampedSpringGetStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpDampedSpringGetStiffness((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpVect, cpVect, cpFloat, cpFloat, cpFloat\n// Ret value: cpConstraint*\nJSBool JSB_cpDampedSpringNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 7, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; double arg4; double arg5; double arg6; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg4 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg5 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg6 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpDampedSpringNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3 , (cpFloat)arg4 , (cpFloat)arg5 , (cpFloat)arg6  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpDampedSpringSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpDampedSpringSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpDampedSpringSetDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetDamping((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpDampedSpringSetRestLength(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetRestLength((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpDampedSpringSetStiffness(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpDampedSpringSetStiffness((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpGearJointGetPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpGearJointGetPhase((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpGearJointGetRatio(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpGearJointGetRatio((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat\n// Ret value: cpConstraint*\nJSBool JSB_cpGearJointNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpGearJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpGearJointSetPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGearJointSetPhase((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpGearJointSetRatio(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGearJointSetRatio((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpGrooveJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpGrooveJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpGrooveJointGetGrooveA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpGrooveJointGetGrooveA((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpGrooveJointGetGrooveB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpGrooveJointGetGrooveB((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpVect, cpVect, cpVect\n// Ret value: cpConstraint*\nJSBool JSB_cpGrooveJointNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 5, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; cpVect arg4; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpGrooveJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3 , (cpVect)arg4  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpGrooveJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGrooveJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpGrooveJointSetGrooveA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGrooveJointSetGrooveA((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpGrooveJointSetGrooveB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpGrooveJointSetGrooveB((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpInitChipmunk(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tcpInitChipmunk( );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpMomentForBox(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; double arg2; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpMomentForBox((cpFloat)arg0 , (cpFloat)arg1 , (cpFloat)arg2  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpBB\n// Ret value: cpFloat\nJSBool JSB_cpMomentForBox2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; cpBB arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= jsval_to_cpBB( cx, *argvp++, (cpBB*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpMomentForBox2((cpFloat)arg0 , (cpBB)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat, cpFloat, cpVect\n// Ret value: cpFloat\nJSBool JSB_cpMomentForCircle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; double arg2; cpVect arg3; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpMomentForCircle((cpFloat)arg0 , (cpFloat)arg1 , (cpFloat)arg2 , (cpVect)arg3  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpVect, cpVect\n// Ret value: cpFloat\nJSBool JSB_cpMomentForSegment(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; cpVect arg1; cpVect arg2; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpMomentForSegment((cpFloat)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpPinJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpPinJointGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpPinJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpPinJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpPinJointGetDist(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpPinJointGetDist((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpVect, cpVect\n// Ret value: cpConstraint*\nJSBool JSB_cpPinJointNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpPinJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpPinJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPinJointSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpPinJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPinJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpPinJointSetDist(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPinJointSetDist((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpPivotJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpPivotJointGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpPivotJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpPivotJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpVect\n// Ret value: cpConstraint*\nJSBool JSB_cpPivotJointNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3 || argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3;\n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tif(argc == 4) {\n\t\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\t}\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tif(argc == 4) {\n\t\tret_val = cpPivotJointNew2((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3  );\n\t} else {\n\t\tret_val = cpPivotJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2  );\n\t}\n\t\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpVect, cpVect\n// Ret value: cpConstraint*\nJSBool JSB_cpPivotJointNew2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpPivotJointNew2((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpPivotJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPivotJointSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpPivotJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpPivotJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: int\nJSBool JSB_cpPolyShapeGetNumVerts(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tint ret_val;\n\n\tret_val = cpPolyShapeGetNumVerts((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, int\n// Ret value: cpVect\nJSBool JSB_cpPolyShapeGetVert(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; int32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpPolyShapeGetVert((cpShape*)arg0 , (int)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpRatchetJointGetAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpRatchetJointGetAngle((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpRatchetJointGetPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpRatchetJointGetPhase((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpRatchetJointGetRatchet(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpRatchetJointGetRatchet((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat\n// Ret value: cpConstraint*\nJSBool JSB_cpRatchetJointNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpRatchetJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpRatchetJointSetAngle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRatchetJointSetAngle((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpRatchetJointSetPhase(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRatchetJointSetPhase((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpRatchetJointSetRatchet(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRatchetJointSetRatchet((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_cpResetShapeIdCounter(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tcpResetShapeIdCounter( );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpRotaryLimitJointGetMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpRotaryLimitJointGetMax((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpRotaryLimitJointGetMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpRotaryLimitJointGetMin((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpFloat, cpFloat\n// Ret value: cpConstraint*\nJSBool JSB_cpRotaryLimitJointNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; double arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpRotaryLimitJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2 , (cpFloat)arg3  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpRotaryLimitJointSetMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRotaryLimitJointSetMax((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpRotaryLimitJointSetMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpRotaryLimitJointSetMin((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpVect\nJSBool JSB_cpSegmentShapeGetA(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpSegmentShapeGetA((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpVect\nJSBool JSB_cpSegmentShapeGetB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpSegmentShapeGetB((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpVect\nJSBool JSB_cpSegmentShapeGetNormal(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpSegmentShapeGetNormal((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpFloat\nJSBool JSB_cpSegmentShapeGetRadius(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSegmentShapeGetRadius((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpVect, cpVect, cpFloat\n// Ret value: cpShape*\nJSBool JSB_cpSegmentShapeNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpVect arg1; cpVect arg2; double arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpSegmentShapeNew((cpBody*)arg0 , (cpVect)arg1 , (cpVect)arg2 , (cpFloat)arg3  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpVect, cpVect\n// Ret value: void\nJSBool JSB_cpSegmentShapeSetNeighbors(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; cpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSegmentShapeSetNeighbors((cpShape*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpBB\nJSBool JSB_cpShapeCacheBB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpShapeCacheBB((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: void\nJSBool JSB_cpShapeDestroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeDestroy((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: void\nJSBool JSB_cpShapeFree(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeFree((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpBB\nJSBool JSB_cpShapeGetBB(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpShapeGetBB((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpBody*\nJSBool JSB_cpShapeGetBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpShapeGetBody((cpShape*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpCollisionType\nJSBool JSB_cpShapeGetCollisionType(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpCollisionType ret_val;\n\n\tret_val = cpShapeGetCollisionType((cpShape*)arg0  );\n\n\tjsval ret_jsval = uint32_to_jsval( cx, (cpCollisionType)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpFloat\nJSBool JSB_cpShapeGetElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpShapeGetElasticity((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpFloat\nJSBool JSB_cpShapeGetFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpShapeGetFriction((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpGroup\nJSBool JSB_cpShapeGetGroup(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpGroup ret_val;\n\n\tret_val = cpShapeGetGroup((cpShape*)arg0  );\n\n\tjsval ret_jsval = uint32_to_jsval( cx, (cpGroup)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpLayers\nJSBool JSB_cpShapeGetLayers(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpLayers ret_val;\n\n\tret_val = cpShapeGetLayers((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpBool\nJSBool JSB_cpShapeGetSensor(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpShapeGetSensor((cpShape*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpSpace*\nJSBool JSB_cpShapeGetSpace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpSpace* ret_val;\n\n\tret_val = cpShapeGetSpace((cpShape*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpVect\nJSBool JSB_cpShapeGetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpShapeGetSurfaceVelocity((cpShape*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpVect\n// Ret value: cpBool\nJSBool JSB_cpShapePointQuery(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpShapePointQuery((cpShape*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpBody*\n// Ret value: void\nJSBool JSB_cpShapeSetBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; cpBody* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetBody((cpShape*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpCollisionType\n// Ret value: void\nJSBool JSB_cpShapeSetCollisionType(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; cpCollisionType arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_uint( cx, *argvp++, (unsigned int*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetCollisionType((cpShape*)arg0 , (cpCollisionType)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpFloat\n// Ret value: void\nJSBool JSB_cpShapeSetElasticity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetElasticity((cpShape*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpFloat\n// Ret value: void\nJSBool JSB_cpShapeSetFriction(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetFriction((cpShape*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpGroup\n// Ret value: void\nJSBool JSB_cpShapeSetGroup(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; cpGroup arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_uint( cx, *argvp++, (unsigned int*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetGroup((cpShape*)arg0 , (cpGroup)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpLayers\n// Ret value: void\nJSBool JSB_cpShapeSetLayers(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; uint32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetLayers((cpShape*)arg0 , (cpLayers)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpBool\n// Ret value: void\nJSBool JSB_cpShapeSetSensor(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; int32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetSensor((cpShape*)arg0 , (cpBool)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpVect\n// Ret value: void\nJSBool JSB_cpShapeSetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpShapeSetSurfaceVelocity((cpShape*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*, cpVect, cpVect\n// Ret value: cpBB\nJSBool JSB_cpShapeUpdate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg0; cpVect arg1; cpVect arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBB ret_val;\n\n\tret_val = cpShapeUpdate((cpShape*)arg0 , (cpVect)arg1 , (cpVect)arg2  );\n\n\tjsval ret_jsval = cpBB_to_jsval( cx, (cpBB)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpSimpleMotorGetRate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSimpleMotorGetRate((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpFloat\n// Ret value: cpConstraint*\nJSBool JSB_cpSimpleMotorNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; double arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpSimpleMotorNew((cpBody*)arg0 , (cpBody*)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpSimpleMotorSetRate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSimpleMotorSetRate((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpSlideJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpSlideJointGetAnchr1((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpVect\nJSBool JSB_cpSlideJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpSlideJointGetAnchr2((cpConstraint*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpSlideJointGetMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSlideJointGetMax((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpFloat\nJSBool JSB_cpSlideJointGetMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSlideJointGetMin((cpConstraint*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*, cpBody*, cpVect, cpVect, cpFloat, cpFloat\n// Ret value: cpConstraint*\nJSBool JSB_cpSlideJointNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 6, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg0; cpBody* arg1; cpVect arg2; cpVect arg3; double arg4; double arg5; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg2 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg3 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg4 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg5 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpSlideJointNew((cpBody*)arg0 , (cpBody*)arg1 , (cpVect)arg2 , (cpVect)arg3 , (cpFloat)arg4 , (cpFloat)arg5  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpSlideJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetAnchr1((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpVect\n// Ret value: void\nJSBool JSB_cpSlideJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetAnchr2((cpConstraint*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpSlideJointSetMax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetMax((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*, cpFloat\n// Ret value: void\nJSBool JSB_cpSlideJointSetMin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSlideJointSetMin((cpConstraint*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpShape*\n// Ret value: void\nJSBool JSB_cpSpaceActivateShapesTouchingShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceActivateShapesTouchingShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpBody*\n// Ret value: cpBody*\nJSBool JSB_cpSpaceAddBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpBody* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpSpaceAddBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpConstraint*\n// Ret value: cpConstraint*\nJSBool JSB_cpSpaceAddConstraint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpConstraint* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpConstraint* ret_val;\n\n\tret_val = cpSpaceAddConstraint((cpSpace*)arg0 , (cpConstraint*)arg1  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpShape*\n// Ret value: cpShape*\nJSBool JSB_cpSpaceAddShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpSpaceAddShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpShape*\n// Ret value: cpShape*\nJSBool JSB_cpSpaceAddStaticShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpSpaceAddStaticShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpBody*\n// Ret value: cpBool\nJSBool JSB_cpSpaceContainsBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpBody* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceContainsBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpConstraint*\n// Ret value: cpBool\nJSBool JSB_cpSpaceContainsConstraint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpConstraint* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceContainsConstraint((cpSpace*)arg0 , (cpConstraint*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpShape*\n// Ret value: cpBool\nJSBool JSB_cpSpaceContainsShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceContainsShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: void\nJSBool JSB_cpSpaceDestroy(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceDestroy((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: void\nJSBool JSB_cpSpaceFree(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceFree((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpFloat\nJSBool JSB_cpSpaceGetCollisionBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetCollisionBias((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpTimestamp\nJSBool JSB_cpSpaceGetCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpTimestamp ret_val;\n\n\tret_val = cpSpaceGetCollisionPersistence((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpFloat\nJSBool JSB_cpSpaceGetCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetCollisionSlop((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpFloat\nJSBool JSB_cpSpaceGetCurrentTimeStep(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetCurrentTimeStep((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpFloat\nJSBool JSB_cpSpaceGetDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetDamping((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpBool\nJSBool JSB_cpSpaceGetEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceGetEnableContactGraph((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpVect\nJSBool JSB_cpSpaceGetGravity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpSpaceGetGravity((cpSpace*)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpFloat\nJSBool JSB_cpSpaceGetIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetIdleSpeedThreshold((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: int\nJSBool JSB_cpSpaceGetIterations(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tint ret_val;\n\n\tret_val = cpSpaceGetIterations((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpFloat\nJSBool JSB_cpSpaceGetSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpSpaceGetSleepTimeThreshold((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpBody*\nJSBool JSB_cpSpaceGetStaticBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBody* ret_val;\n\n\tret_val = cpSpaceGetStaticBody((cpSpace*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpSpace*\nJSBool JSB_cpSpaceInit(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpSpace* ret_val;\n\n\tret_val = cpSpaceInit((cpSpace*)arg0  );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: cpBool\nJSBool JSB_cpSpaceIsLocked(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpSpaceIsLocked((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpSpace*\nJSBool JSB_cpSpaceNew(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tcpSpace* ret_val;\n\n\tret_val = cpSpaceNew( );\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpVect, cpLayers, cpGroup\n// Ret value: cpShape*\nJSBool JSB_cpSpacePointQueryFirst(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpVect arg1; uint32_t arg2; cpGroup arg3; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint( cx, *argvp++, (unsigned int*) &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpShape* ret_val;\n\n\tret_val = cpSpacePointQueryFirst((cpSpace*)arg0 , (cpVect)arg1 , (cpLayers)arg2 , (cpGroup)arg3  );\n\tif(ret_val) {\n\t\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\t\tJS_SET_RVAL(cx, vp, ret_jsval);\n\t} else {\n\t\tJS_SET_RVAL(cx, vp, JSVAL_NULL);\n\t}\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpShape*\n// Ret value: void\nJSBool JSB_cpSpaceReindexShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceReindexShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpBody*\n// Ret value: void\nJSBool JSB_cpSpaceReindexShapesForBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpBody* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceReindexShapesForBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: void\nJSBool JSB_cpSpaceReindexStatic(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceReindexStatic((cpSpace*)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpBody*\n// Ret value: void\nJSBool JSB_cpSpaceRemoveBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpBody* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceRemoveBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpConstraint*\n// Ret value: void\nJSBool JSB_cpSpaceRemoveConstraint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpConstraint* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceRemoveConstraint((cpSpace*)arg0 , (cpConstraint*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpShape*\n// Ret value: void\nJSBool JSB_cpSpaceRemoveShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceRemoveShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpShape*\n// Ret value: void\nJSBool JSB_cpSpaceRemoveStaticShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpShape* arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceRemoveStaticShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpFloat\n// Ret value: void\nJSBool JSB_cpSpaceSetCollisionBias(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetCollisionBias((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpTimestamp\n// Ret value: void\nJSBool JSB_cpSpaceSetCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; uint32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetCollisionPersistence((cpSpace*)arg0 , (cpTimestamp)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpFloat\n// Ret value: void\nJSBool JSB_cpSpaceSetCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetCollisionSlop((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpFloat\n// Ret value: void\nJSBool JSB_cpSpaceSetDamping(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetDamping((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpBool\n// Ret value: void\nJSBool JSB_cpSpaceSetEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; int32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetEnableContactGraph((cpSpace*)arg0 , (cpBool)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpVect\n// Ret value: void\nJSBool JSB_cpSpaceSetGravity(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; cpVect arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetGravity((cpSpace*)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpFloat\n// Ret value: void\nJSBool JSB_cpSpaceSetIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetIdleSpeedThreshold((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, int\n// Ret value: void\nJSBool JSB_cpSpaceSetIterations(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; int32_t arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetIterations((cpSpace*)arg0 , (int)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpFloat\n// Ret value: void\nJSBool JSB_cpSpaceSetSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceSetSleepTimeThreshold((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpFloat\n// Ret value: void\nJSBool JSB_cpSpaceStep(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; double arg1; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceStep((cpSpace*)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*, cpFloat, int\n// Ret value: void\nJSBool JSB_cpSpaceUseSpatialHash(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; double arg1; int32_t arg2; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tcpSpaceUseSpatialHash((cpSpace*)arg0 , (cpFloat)arg1 , (int)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpfabs(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpfabs((cpFloat)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpfclamp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; double arg2; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpfclamp((cpFloat)arg0 , (cpFloat)arg1 , (cpFloat)arg2  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpfclamp01(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpfclamp01((cpFloat)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpflerp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; double arg2; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpflerp((cpFloat)arg0 , (cpFloat)arg1 , (cpFloat)arg2  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpflerpconst(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; double arg2; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpflerpconst((cpFloat)arg0 , (cpFloat)arg1 , (cpFloat)arg2  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpfmax(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpfmax((cpFloat)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat, cpFloat\n// Ret value: cpFloat\nJSBool JSB_cpfmin(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; double arg1; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpfmin((cpFloat)arg0 , (cpFloat)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpVect\nJSBool JSB_cpvadd(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvadd((cpVect)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpFloat\n// Ret value: cpVect\nJSBool JSB_cpvclamp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; double arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvclamp((cpVect)arg0 , (cpFloat)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpFloat\nJSBool JSB_cpvcross(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpvcross((cpVect)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpFloat\nJSBool JSB_cpvdist(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpvdist((cpVect)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpFloat\nJSBool JSB_cpvdistsq(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpvdistsq((cpVect)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpFloat\nJSBool JSB_cpvdot(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpvdot((cpVect)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpBool\nJSBool JSB_cpveql(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpveql((cpVect)arg0 , (cpVect)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpFloat\n// Ret value: cpVect\nJSBool JSB_cpvforangle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble arg0; \n\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvforangle((cpFloat)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpFloat\nJSBool JSB_cpvlength(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpvlength((cpVect)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpFloat\nJSBool JSB_cpvlengthsq(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpvlengthsq((cpVect)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect, cpFloat\n// Ret value: cpVect\nJSBool JSB_cpvlerp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; double arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvlerp((cpVect)arg0 , (cpVect)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect, cpFloat\n// Ret value: cpVect\nJSBool JSB_cpvlerpconst(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; double arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvlerpconst((cpVect)arg0 , (cpVect)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpFloat\n// Ret value: cpVect\nJSBool JSB_cpvmult(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; double arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvmult((cpVect)arg0 , (cpFloat)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect, cpFloat\n// Ret value: cpBool\nJSBool JSB_cpvnear(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; double arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpBool ret_val;\n\n\tret_val = cpvnear((cpVect)arg0 , (cpVect)arg1 , (cpFloat)arg2  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpvneg(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvneg((cpVect)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpvnormalize(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvnormalize((cpVect)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpvnormalize_safe(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvnormalize_safe((cpVect)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpvperp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvperp((cpVect)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpVect\nJSBool JSB_cpvproject(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvproject((cpVect)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpVect\nJSBool JSB_cpvrotate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvrotate((cpVect)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpVect\nJSBool JSB_cpvrperp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvrperp((cpVect)arg0  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect, cpFloat\n// Ret value: cpVect\nJSBool JSB_cpvslerp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; double arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvslerp((cpVect)arg0 , (cpVect)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect, cpFloat\n// Ret value: cpVect\nJSBool JSB_cpvslerpconst(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; double arg2; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tok &= JS_ValueToNumber( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvslerpconst((cpVect)arg0 , (cpVect)arg1 , (cpFloat)arg2  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpVect\nJSBool JSB_cpvsub(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvsub((cpVect)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect\n// Ret value: cpFloat\nJSBool JSB_cpvtoangle(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpFloat ret_val;\n\n\tret_val = cpvtoangle((cpVect)arg0  );\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpVect, cpVect\n// Ret value: cpVect\nJSBool JSB_cpvunrotate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect arg0; cpVect arg1; \n\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg0 );\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tcpVect ret_val;\n\n\tret_val = cpvunrotate((cpVect)arg0 , (cpVect)arg1  );\n\n\tjsval ret_jsval = cpVect_to_jsval( cx, (cpVect)ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n\n\treturn JS_TRUE;\n}\n\n\n#endif // JSB_INCLUDE_CHIPMUNK\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_functions.h",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c chipmunk_jsb.ini\" on 2012-11-07\n* Script version: v0.3\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n#include \"js_bindings_chipmunk_manual.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nJSBool JSB_cpArbiterGetCount(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterGetDepth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterGetElasticity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterGetFriction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterGetNormal(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterGetPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterGetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterIgnore(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterIsFirstContact(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterSetElasticity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterSetFriction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterSetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterTotalImpulse(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterTotalImpulseWithFriction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterTotalKE(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpAreaForCircle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpAreaForSegment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBArea(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBClampVect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBContainsBB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBContainsVect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBExpand(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBIntersects(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBIntersectsSegment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBMerge(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBMergedArea(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBNewForCircle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBSegmentQuery(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBBWrapVect(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyActivate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyActivateStatic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyApplyForce(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyApplyImpulse(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyDestroy(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyFree(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetAngVel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetForce(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetMass(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetMoment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetRot(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetTorque(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetVel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetVelAtLocalPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetVelAtWorldPoint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyGetVelLimit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyInit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyInitStatic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyIsRogue(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyIsSleeping(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyIsStatic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyKineticEnergy(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyLocal2World(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyNewStatic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyResetForces(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetAngVel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetAngVelLimit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetForce(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetMass(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetMoment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetPos(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetTorque(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetVel(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetVelLimit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySleep(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySleepWithGroup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyUpdatePosition(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyUpdateVelocity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodyWorld2Local(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBoxShapeNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBoxShapeNew2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpCircleShapeGetOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpCircleShapeGetRadius(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpCircleShapeNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintActivateBodies(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintDestroy(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintFree(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintGetA(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintGetB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintGetErrorBias(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintGetImpulse(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintGetMaxBias(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintGetMaxForce(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintGetSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintSetErrorBias(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintSetMaxBias(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpConstraintSetMaxForce(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedRotarySpringGetDamping(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedRotarySpringGetRestAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedRotarySpringGetStiffness(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedRotarySpringNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedRotarySpringSetDamping(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedRotarySpringSetRestAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedRotarySpringSetStiffness(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringGetDamping(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringGetRestLength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringGetStiffness(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringSetDamping(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringSetRestLength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpDampedSpringSetStiffness(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGearJointGetPhase(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGearJointGetRatio(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGearJointNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGearJointSetPhase(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGearJointSetRatio(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGrooveJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGrooveJointGetGrooveA(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGrooveJointGetGrooveB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGrooveJointNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGrooveJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGrooveJointSetGrooveA(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpGrooveJointSetGrooveB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpInitChipmunk(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpMomentForBox(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpMomentForBox2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpMomentForCircle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpMomentForSegment(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPinJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPinJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPinJointGetDist(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPinJointNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPinJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPinJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPinJointSetDist(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPivotJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPivotJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPivotJointNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPivotJointNew2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPivotJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPivotJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPolyShapeGetNumVerts(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpPolyShapeGetVert(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRatchetJointGetAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRatchetJointGetPhase(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRatchetJointGetRatchet(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRatchetJointNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRatchetJointSetAngle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRatchetJointSetPhase(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRatchetJointSetRatchet(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpResetShapeIdCounter(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRotaryLimitJointGetMax(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRotaryLimitJointGetMin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRotaryLimitJointNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRotaryLimitJointSetMax(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRotaryLimitJointSetMin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSegmentShapeGetA(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSegmentShapeGetB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSegmentShapeGetNormal(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSegmentShapeGetRadius(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSegmentShapeNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSegmentShapeSetNeighbors(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeCacheBB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeDestroy(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeFree(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetBB(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetCollisionType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetElasticity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetFriction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetGroup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetLayers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetSensor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetSpace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeGetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapePointQuery(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetCollisionType(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetElasticity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetFriction(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetGroup(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetLayers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetSensor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeSetSurfaceVelocity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpShapeUpdate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSimpleMotorGetRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSimpleMotorNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSimpleMotorSetRate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointGetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointGetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointGetMax(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointGetMin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointSetAnchr1(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointSetAnchr2(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointSetMax(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSlideJointSetMin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceActivateShapesTouchingShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceAddBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceAddConstraint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceAddShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceAddStaticShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceContainsBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceContainsConstraint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceContainsShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceDestroy(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceFree(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetCollisionBias(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetCurrentTimeStep(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetDamping(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetGravity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetIterations(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceGetStaticBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceInit(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceIsLocked(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceNew(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpacePointQueryFirst(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceReindexShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceReindexShapesForBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceReindexStatic(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceRemoveBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceRemoveConstraint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceRemoveShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceRemoveStaticShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetCollisionBias(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetCollisionPersistence(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetCollisionSlop(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetDamping(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetEnableContactGraph(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetGravity(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetIdleSpeedThreshold(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetIterations(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceSetSleepTimeThreshold(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceStep(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceUseSpatialHash(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpfabs(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpfclamp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpfclamp01(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpflerp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpflerpconst(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpfmax(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpfmin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvadd(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvclamp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvcross(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvdist(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvdistsq(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvdot(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpveql(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvforangle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvlength(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvlengthsq(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvlerp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvlerpconst(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvmult(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvnear(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvneg(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvnormalize(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvnormalize_safe(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvperp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvproject(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvrotate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvrperp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvslerp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvslerpconst(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvsub(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvtoangle(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpvunrotate(JSContext *cx, uint32_t argc, jsval *vp);\n\n#ifdef __cplusplus\n}\n#endif\n\n\n#endif // JSB_INCLUDE_CHIPMUNK\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_functions_registration.h",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c chipmunk_jsb.ini\" on 2012-10-18\n* Script version: v0.3\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n\n#include \"js_bindings_chipmunk_manual.h\"\nJS_DefineFunction(cx, chipmunk, \"arbiterGetCount\", JSB_cpArbiterGetCount, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterGetDepth\", JSB_cpArbiterGetDepth, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterGetElasticity\", JSB_cpArbiterGetElasticity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterGetFriction\", JSB_cpArbiterGetFriction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterGetNormal\", JSB_cpArbiterGetNormal, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterGetPoint\", JSB_cpArbiterGetPoint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterGetSurfaceVelocity\", JSB_cpArbiterGetSurfaceVelocity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterIgnore\", JSB_cpArbiterIgnore, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterIsFirstContact\", JSB_cpArbiterIsFirstContact, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterSetElasticity\", JSB_cpArbiterSetElasticity, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterSetFriction\", JSB_cpArbiterSetFriction, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterSetSurfaceVelocity\", JSB_cpArbiterSetSurfaceVelocity, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterTotalImpulse\", JSB_cpArbiterTotalImpulse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterTotalImpulseWithFriction\", JSB_cpArbiterTotalImpulseWithFriction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"arbiterTotalKE\", JSB_cpArbiterTotalKE, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"areaForCircle\", JSB_cpAreaForCircle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"areaForSegment\", JSB_cpAreaForSegment, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBArea\", JSB_cpBBArea, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBClampVect\", JSB_cpBBClampVect, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBContainsBB\", JSB_cpBBContainsBB, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBContainsVect\", JSB_cpBBContainsVect, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBExpand\", JSB_cpBBExpand, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBIntersects\", JSB_cpBBIntersects, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBIntersectsSegment\", JSB_cpBBIntersectsSegment, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBMerge\", JSB_cpBBMerge, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBMergedArea\", JSB_cpBBMergedArea, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBNew\", JSB_cpBBNew, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBNewForCircle\", JSB_cpBBNewForCircle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBSegmentQuery\", JSB_cpBBSegmentQuery, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bBWrapVect\", JSB_cpBBWrapVect, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyActivate\", JSB_cpBodyActivate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyActivateStatic\", JSB_cpBodyActivateStatic, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyApplyForce\", JSB_cpBodyApplyForce, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyApplyImpulse\", JSB_cpBodyApplyImpulse, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyDestroy\", JSB_cpBodyDestroy, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyFree\", JSB_cpBodyFree, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetAngVel\", JSB_cpBodyGetAngVel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetAngVelLimit\", JSB_cpBodyGetAngVelLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetAngle\", JSB_cpBodyGetAngle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetForce\", JSB_cpBodyGetForce, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetMass\", JSB_cpBodyGetMass, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetMoment\", JSB_cpBodyGetMoment, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetPos\", JSB_cpBodyGetPos, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetRot\", JSB_cpBodyGetRot, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetSpace\", JSB_cpBodyGetSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetTorque\", JSB_cpBodyGetTorque, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetVel\", JSB_cpBodyGetVel, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetVelAtLocalPoint\", JSB_cpBodyGetVelAtLocalPoint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetVelAtWorldPoint\", JSB_cpBodyGetVelAtWorldPoint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyGetVelLimit\", JSB_cpBodyGetVelLimit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyInit\", JSB_cpBodyInit, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyInitStatic\", JSB_cpBodyInitStatic, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyIsRogue\", JSB_cpBodyIsRogue, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyIsSleeping\", JSB_cpBodyIsSleeping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyIsStatic\", JSB_cpBodyIsStatic, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyKineticEnergy\", JSB_cpBodyKineticEnergy, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyLocal2World\", JSB_cpBodyLocal2World, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyNew\", JSB_cpBodyNew, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyNewStatic\", JSB_cpBodyNewStatic, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyResetForces\", JSB_cpBodyResetForces, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetAngVel\", JSB_cpBodySetAngVel, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetAngVelLimit\", JSB_cpBodySetAngVelLimit, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetAngle\", JSB_cpBodySetAngle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetForce\", JSB_cpBodySetForce, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetMass\", JSB_cpBodySetMass, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetMoment\", JSB_cpBodySetMoment, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetPos\", JSB_cpBodySetPos, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetTorque\", JSB_cpBodySetTorque, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetVel\", JSB_cpBodySetVel, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySetVelLimit\", JSB_cpBodySetVelLimit, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySleep\", JSB_cpBodySleep, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodySleepWithGroup\", JSB_cpBodySleepWithGroup, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyUpdatePosition\", JSB_cpBodyUpdatePosition, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyUpdateVelocity\", JSB_cpBodyUpdateVelocity, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"bodyWorld2Local\", JSB_cpBodyWorld2Local, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"boxShapeNew\", JSB_cpBoxShapeNew, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"boxShapeNew2\", JSB_cpBoxShapeNew2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"circleShapeGetOffset\", JSB_cpCircleShapeGetOffset, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"circleShapeGetRadius\", JSB_cpCircleShapeGetRadius, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"circleShapeNew\", JSB_cpCircleShapeNew, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintActivateBodies\", JSB_cpConstraintActivateBodies, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintDestroy\", JSB_cpConstraintDestroy, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintFree\", JSB_cpConstraintFree, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintGetA\", JSB_cpConstraintGetA, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintGetB\", JSB_cpConstraintGetB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintGetErrorBias\", JSB_cpConstraintGetErrorBias, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintGetImpulse\", JSB_cpConstraintGetImpulse, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintGetMaxBias\", JSB_cpConstraintGetMaxBias, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintGetMaxForce\", JSB_cpConstraintGetMaxForce, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintGetSpace\", JSB_cpConstraintGetSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintSetErrorBias\", JSB_cpConstraintSetErrorBias, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintSetMaxBias\", JSB_cpConstraintSetMaxBias, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"constraintSetMaxForce\", JSB_cpConstraintSetMaxForce, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedRotarySpringGetDamping\", JSB_cpDampedRotarySpringGetDamping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedRotarySpringGetRestAngle\", JSB_cpDampedRotarySpringGetRestAngle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedRotarySpringGetStiffness\", JSB_cpDampedRotarySpringGetStiffness, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedRotarySpringNew\", JSB_cpDampedRotarySpringNew, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedRotarySpringSetDamping\", JSB_cpDampedRotarySpringSetDamping, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedRotarySpringSetRestAngle\", JSB_cpDampedRotarySpringSetRestAngle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedRotarySpringSetStiffness\", JSB_cpDampedRotarySpringSetStiffness, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringGetAnchr1\", JSB_cpDampedSpringGetAnchr1, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringGetAnchr2\", JSB_cpDampedSpringGetAnchr2, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringGetDamping\", JSB_cpDampedSpringGetDamping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringGetRestLength\", JSB_cpDampedSpringGetRestLength, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringGetStiffness\", JSB_cpDampedSpringGetStiffness, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringNew\", JSB_cpDampedSpringNew, 7, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringSetAnchr1\", JSB_cpDampedSpringSetAnchr1, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringSetAnchr2\", JSB_cpDampedSpringSetAnchr2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringSetDamping\", JSB_cpDampedSpringSetDamping, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringSetRestLength\", JSB_cpDampedSpringSetRestLength, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"dampedSpringSetStiffness\", JSB_cpDampedSpringSetStiffness, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"gearJointGetPhase\", JSB_cpGearJointGetPhase, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"gearJointGetRatio\", JSB_cpGearJointGetRatio, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"gearJointNew\", JSB_cpGearJointNew, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"gearJointSetPhase\", JSB_cpGearJointSetPhase, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"gearJointSetRatio\", JSB_cpGearJointSetRatio, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"grooveJointGetAnchr2\", JSB_cpGrooveJointGetAnchr2, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"grooveJointGetGrooveA\", JSB_cpGrooveJointGetGrooveA, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"grooveJointGetGrooveB\", JSB_cpGrooveJointGetGrooveB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"grooveJointNew\", JSB_cpGrooveJointNew, 5, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"grooveJointSetAnchr2\", JSB_cpGrooveJointSetAnchr2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"grooveJointSetGrooveA\", JSB_cpGrooveJointSetGrooveA, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"grooveJointSetGrooveB\", JSB_cpGrooveJointSetGrooveB, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"initChipmunk\", JSB_cpInitChipmunk, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"momentForBox\", JSB_cpMomentForBox, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"momentForBox2\", JSB_cpMomentForBox2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"momentForCircle\", JSB_cpMomentForCircle, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"momentForSegment\", JSB_cpMomentForSegment, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pinJointGetAnchr1\", JSB_cpPinJointGetAnchr1, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pinJointGetAnchr2\", JSB_cpPinJointGetAnchr2, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pinJointGetDist\", JSB_cpPinJointGetDist, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pinJointNew\", JSB_cpPinJointNew, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pinJointSetAnchr1\", JSB_cpPinJointSetAnchr1, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pinJointSetAnchr2\", JSB_cpPinJointSetAnchr2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pinJointSetDist\", JSB_cpPinJointSetDist, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pivotJointGetAnchr1\", JSB_cpPivotJointGetAnchr1, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pivotJointGetAnchr2\", JSB_cpPivotJointGetAnchr2, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pivotJointNew\", JSB_cpPivotJointNew, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pivotJointNew2\", JSB_cpPivotJointNew2, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pivotJointSetAnchr1\", JSB_cpPivotJointSetAnchr1, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"pivotJointSetAnchr2\", JSB_cpPivotJointSetAnchr2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"polyShapeGetNumVerts\", JSB_cpPolyShapeGetNumVerts, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"polyShapeGetVert\", JSB_cpPolyShapeGetVert, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"ratchetJointGetAngle\", JSB_cpRatchetJointGetAngle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"ratchetJointGetPhase\", JSB_cpRatchetJointGetPhase, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"ratchetJointGetRatchet\", JSB_cpRatchetJointGetRatchet, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"ratchetJointNew\", JSB_cpRatchetJointNew, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"ratchetJointSetAngle\", JSB_cpRatchetJointSetAngle, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"ratchetJointSetPhase\", JSB_cpRatchetJointSetPhase, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"ratchetJointSetRatchet\", JSB_cpRatchetJointSetRatchet, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"resetShapeIdCounter\", JSB_cpResetShapeIdCounter, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"rotaryLimitJointGetMax\", JSB_cpRotaryLimitJointGetMax, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"rotaryLimitJointGetMin\", JSB_cpRotaryLimitJointGetMin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"rotaryLimitJointNew\", JSB_cpRotaryLimitJointNew, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"rotaryLimitJointSetMax\", JSB_cpRotaryLimitJointSetMax, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"rotaryLimitJointSetMin\", JSB_cpRotaryLimitJointSetMin, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"segmentShapeGetA\", JSB_cpSegmentShapeGetA, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"segmentShapeGetB\", JSB_cpSegmentShapeGetB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"segmentShapeGetNormal\", JSB_cpSegmentShapeGetNormal, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"segmentShapeGetRadius\", JSB_cpSegmentShapeGetRadius, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"segmentShapeNew\", JSB_cpSegmentShapeNew, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"segmentShapeSetNeighbors\", JSB_cpSegmentShapeSetNeighbors, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeCacheBB\", JSB_cpShapeCacheBB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeDestroy\", JSB_cpShapeDestroy, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeFree\", JSB_cpShapeFree, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetBB\", JSB_cpShapeGetBB, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetBody\", JSB_cpShapeGetBody, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetCollisionType\", JSB_cpShapeGetCollisionType, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetElasticity\", JSB_cpShapeGetElasticity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetFriction\", JSB_cpShapeGetFriction, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetGroup\", JSB_cpShapeGetGroup, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetLayers\", JSB_cpShapeGetLayers, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetSensor\", JSB_cpShapeGetSensor, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetSpace\", JSB_cpShapeGetSpace, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeGetSurfaceVelocity\", JSB_cpShapeGetSurfaceVelocity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapePointQuery\", JSB_cpShapePointQuery, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetBody\", JSB_cpShapeSetBody, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetCollisionType\", JSB_cpShapeSetCollisionType, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetElasticity\", JSB_cpShapeSetElasticity, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetFriction\", JSB_cpShapeSetFriction, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetGroup\", JSB_cpShapeSetGroup, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetLayers\", JSB_cpShapeSetLayers, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetSensor\", JSB_cpShapeSetSensor, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeSetSurfaceVelocity\", JSB_cpShapeSetSurfaceVelocity, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"shapeUpdate\", JSB_cpShapeUpdate, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"simpleMotorGetRate\", JSB_cpSimpleMotorGetRate, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"simpleMotorNew\", JSB_cpSimpleMotorNew, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"simpleMotorSetRate\", JSB_cpSimpleMotorSetRate, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointGetAnchr1\", JSB_cpSlideJointGetAnchr1, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointGetAnchr2\", JSB_cpSlideJointGetAnchr2, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointGetMax\", JSB_cpSlideJointGetMax, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointGetMin\", JSB_cpSlideJointGetMin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointNew\", JSB_cpSlideJointNew, 6, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointSetAnchr1\", JSB_cpSlideJointSetAnchr1, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointSetAnchr2\", JSB_cpSlideJointSetAnchr2, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointSetMax\", JSB_cpSlideJointSetMax, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"slideJointSetMin\", JSB_cpSlideJointSetMin, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceActivateShapesTouchingShape\", JSB_cpSpaceActivateShapesTouchingShape, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceAddBody\", JSB_cpSpaceAddBody, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceAddConstraint\", JSB_cpSpaceAddConstraint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceAddShape\", JSB_cpSpaceAddShape, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceAddStaticShape\", JSB_cpSpaceAddStaticShape, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceContainsBody\", JSB_cpSpaceContainsBody, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceContainsConstraint\", JSB_cpSpaceContainsConstraint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceContainsShape\", JSB_cpSpaceContainsShape, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceDestroy\", JSB_cpSpaceDestroy, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceFree\", JSB_cpSpaceFree, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetCollisionBias\", JSB_cpSpaceGetCollisionBias, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetCollisionPersistence\", JSB_cpSpaceGetCollisionPersistence, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetCollisionSlop\", JSB_cpSpaceGetCollisionSlop, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetCurrentTimeStep\", JSB_cpSpaceGetCurrentTimeStep, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetDamping\", JSB_cpSpaceGetDamping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetEnableContactGraph\", JSB_cpSpaceGetEnableContactGraph, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetGravity\", JSB_cpSpaceGetGravity, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetIdleSpeedThreshold\", JSB_cpSpaceGetIdleSpeedThreshold, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetIterations\", JSB_cpSpaceGetIterations, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetSleepTimeThreshold\", JSB_cpSpaceGetSleepTimeThreshold, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceGetStaticBody\", JSB_cpSpaceGetStaticBody, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceInit\", JSB_cpSpaceInit, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceIsLocked\", JSB_cpSpaceIsLocked, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceNew\", JSB_cpSpaceNew, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spacePointQueryFirst\", JSB_cpSpacePointQueryFirst, 4, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceReindexShape\", JSB_cpSpaceReindexShape, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceReindexShapesForBody\", JSB_cpSpaceReindexShapesForBody, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceReindexStatic\", JSB_cpSpaceReindexStatic, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceRemoveBody\", JSB_cpSpaceRemoveBody, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceRemoveConstraint\", JSB_cpSpaceRemoveConstraint, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceRemoveShape\", JSB_cpSpaceRemoveShape, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceRemoveStaticShape\", JSB_cpSpaceRemoveStaticShape, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetCollisionBias\", JSB_cpSpaceSetCollisionBias, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetCollisionPersistence\", JSB_cpSpaceSetCollisionPersistence, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetCollisionSlop\", JSB_cpSpaceSetCollisionSlop, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetDamping\", JSB_cpSpaceSetDamping, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetEnableContactGraph\", JSB_cpSpaceSetEnableContactGraph, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetGravity\", JSB_cpSpaceSetGravity, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetIdleSpeedThreshold\", JSB_cpSpaceSetIdleSpeedThreshold, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetIterations\", JSB_cpSpaceSetIterations, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceSetSleepTimeThreshold\", JSB_cpSpaceSetSleepTimeThreshold, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceStep\", JSB_cpSpaceStep, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"spaceUseSpatialHash\", JSB_cpSpaceUseSpatialHash, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"fabs\", JSB_cpfabs, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"fclamp\", JSB_cpfclamp, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"fclamp01\", JSB_cpfclamp01, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"flerp\", JSB_cpflerp, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"flerpconst\", JSB_cpflerpconst, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"fmax\", JSB_cpfmax, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"fmin\", JSB_cpfmin, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vadd\", JSB_cpvadd, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vclamp\", JSB_cpvclamp, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vcross\", JSB_cpvcross, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vdist\", JSB_cpvdist, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vdistsq\", JSB_cpvdistsq, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vdot\", JSB_cpvdot, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"veql\", JSB_cpveql, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vforangle\", JSB_cpvforangle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vlength\", JSB_cpvlength, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vlengthsq\", JSB_cpvlengthsq, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vlerp\", JSB_cpvlerp, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vlerpconst\", JSB_cpvlerpconst, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vmult\", JSB_cpvmult, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vnear\", JSB_cpvnear, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vneg\", JSB_cpvneg, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vnormalize\", JSB_cpvnormalize, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vnormalize_safe\", JSB_cpvnormalize_safe, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vperp\", JSB_cpvperp, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vproject\", JSB_cpvproject, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vrotate\", JSB_cpvrotate, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vrperp\", JSB_cpvrperp, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vslerp\", JSB_cpvslerp, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vslerpconst\", JSB_cpvslerpconst, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vsub\", JSB_cpvsub, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vtoangle\", JSB_cpvtoangle, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(cx, chipmunk, \"vunrotate\", JSB_cpvunrotate, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\n\n#endif // JSB_INCLUDE_CHIPMUNK\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_manual.cpp",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n#include \"extensions/cocos-ext.h\"\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n#include \"js_bindings_chipmunk_manual.h\"\n#include \"js_manual_conversions.h\"\n\nUSING_NS_CC_EXT;\n// Function declarations\nvoid static freeSpaceChildren(cpSpace *space);\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    TypeTest<T> t;\n    T* cobj = new T();\n    cobj->autorelease();\n    js_type_class_t *p;\n    std::string typeName = t.s_name();\n    auto typeMapIter = _js_global_type_map.find(typeName);\n    \n    CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n    p = typeMapIter->second;\n    CCASSERT(p, \"The value is null.\");\n    \n    JSObject *_tmp = JS_NewObject(cx, p->jsclass, p->proto, p->parentProto);\n    js_proxy_t *pp = jsb_new_proxy(cobj, _tmp);\n    JS_AddObjectRoot(cx, &pp->obj);\n    JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\n    return JS_TRUE;\n}\n\n#pragma mark - convertions\n\n/*\n * PhysicsSprite\n */\n#pragma mark - PhysicsSprite\n\nJSClass* JSPROXY_CCPhysicsSprite_class = NULL;\nJSObject* JSPROXY_CCPhysicsSprite_object = NULL;\n// Constructor\n\n// Destructor\nvoid JSPROXY_CCPhysicsSprite_finalize(JSFreeOp *fop, JSObject *obj)\n{\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (PhysicsSprite)\", obj);\n}\n\n// Arguments:\n// Ret value: cpBody* (N/A)\nJSBool JSPROXY_CCPhysicsSprite_getCPBody(JSContext *cx, uint32_t argc, jsval *vp) {\n    \n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n    PhysicsSprite* real = (PhysicsSprite *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, real)\n\tcpBody* ret_val;\n    \n\tret_val = real->getCPBody();\n\tjsval ret_jsval = c_class_to_jsval( cx, ret_val, JSB_cpBody_object, JSB_cpBody_class, \"cpBody\" );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments:\n// Ret value: BOOL (b)\nJSBool JSPROXY_CCPhysicsSprite_ignoreBodyRotation(JSContext *cx, uint32_t argc, jsval *vp) {\n    \n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tPhysicsSprite* real = (PhysicsSprite *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, real)\n    \n\tbool ret_val;\n    \n\tret_val = real->isIgnoreBodyRotation();\n\tJS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: cpBody*\n// Ret value: void (None)\nJSBool JSPROXY_CCPhysicsSprite_setCPBody_(JSContext *cx, uint32_t argc, jsval *vp) {\n    \n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tPhysicsSprite* real = (PhysicsSprite *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, real)\n    \n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n    \n    cpBody* arg0;\n    \n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tif( ! ok ) return JS_FALSE;\n    \n\treal->setCPBody((cpBody*)arg0);\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: BOOL\n// Ret value: void (None)\nJSBool JSPROXY_CCPhysicsSprite_setIgnoreBodyRotation_(JSContext *cx, uint32_t argc, jsval *vp) {\n    \n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tPhysicsSprite* real = (PhysicsSprite *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, real)\n    \n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tJSBool arg0;\n    \n\tok &= JS_ValueToBoolean( cx, *argvp++, &arg0 );\n\tif( ! ok ) return JS_FALSE;\n    \n\treal->setIgnoreBodyRotation((bool)arg0);\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n/*\n * PhysicsDebugNode\n */\n//#pragma mark - PhysicsDebugNode\n\nJSClass* JSB_CCPhysicsDebugNode_class = NULL;\nJSObject* JSB_CCPhysicsDebugNode_object = NULL;\nextern JSObject *js_cocos2dx_CCDrawNode_prototype;\n\n// Constructor\n\n// Destructor\nvoid JSB_CCPhysicsDebugNode_finalize(JSFreeOp *fop, JSObject *obj)\n{\n\tCCLOGINFO(\"jsbindings: finalizing JS object %p (PhysicsDebugNode)\", obj);\n}\n\n// Arguments: cpSpace*\n// Ret value: PhysicsDebugNode* (o)\nJSBool JSB_CCPhysicsDebugNode_debugNodeForCPSpace__static(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tPhysicsDebugNode* ret = PhysicsDebugNode::create(arg0);\n    jsval jsret;\n    do {\n        if (ret) {\n            TypeTest<PhysicsDebugNode> t;\n            js_type_class_t *typeClass = nullptr;\n            std::string typeName = t.s_name();\n            auto typeMapIter = _js_global_type_map.find(typeName);\n            \n            CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n            typeClass = typeMapIter->second;\n            CCASSERT(typeClass, \"The value is null.\");\n            \n            JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n            jsret = OBJECT_TO_JSVAL(obj);\n            js_proxy_t *p = jsb_new_proxy(ret, obj);\n            JS_AddNamedObjectRoot(cx, &p->obj, \"CCDebugNode\");\n        } else {\n            jsret = JSVAL_NULL;\n        }\n    } while (0);\n    JS_SET_RVAL(cx, vp, jsret);\n\n\treturn JS_TRUE;\n}\n\n// Arguments: cpSpace*\n// Ret value: void (None)\nJSBool JSB_CCPhysicsDebugNode_setSpace_(JSContext *cx, uint32_t argc, jsval *vp) {\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(jsthis);\n    PhysicsDebugNode* real = (PhysicsDebugNode *)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, real)\n\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpSpace* arg0; \n\n\tok &= jsval_to_opaque( cx, *argvp++, (void**)&arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\treal->setSpace(arg0);\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: cpSpace* (N/A)\nJSBool JSB_CCPhysicsDebugNode_space(JSContext *cx, uint32_t argc, jsval *vp) {\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(jsthis);\n    PhysicsDebugNode* real = (PhysicsDebugNode *)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, real)\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tcpSpace* ret_val;\n\n\tret_val = real->getSpace();\n\n\tjsval ret_jsval = opaque_to_jsval( cx, ret_val );\n\tJS_SET_RVAL(cx, vp, ret_jsval);\n    \n\treturn JS_TRUE;\n}\n\nvoid JSB_CCPhysicsDebugNode_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_CCPhysicsDebugNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_CCPhysicsDebugNode_class->name = name;\n\tJSB_CCPhysicsDebugNode_class->addProperty = JS_PropertyStub;\n\tJSB_CCPhysicsDebugNode_class->delProperty = JS_DeletePropertyStub;\n\tJSB_CCPhysicsDebugNode_class->getProperty = JS_PropertyStub;\n\tJSB_CCPhysicsDebugNode_class->setProperty = JS_StrictPropertyStub;\n\tJSB_CCPhysicsDebugNode_class->enumerate = JS_EnumerateStub;\n\tJSB_CCPhysicsDebugNode_class->resolve = JS_ResolveStub;\n\tJSB_CCPhysicsDebugNode_class->convert = JS_ConvertStub;\n\tJSB_CCPhysicsDebugNode_class->finalize = JSB_CCPhysicsDebugNode_finalize;\n\tJSB_CCPhysicsDebugNode_class->flags = 0;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"_setSpace\", JSB_CCPhysicsDebugNode_setSpace_, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSpace\", JSB_CCPhysicsDebugNode_space, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"_create\", JSB_CCPhysicsDebugNode_debugNodeForCPSpace__static, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n    TypeTest<cocos2d::DrawNode> t1;\n    js_type_class_t *typeClass = nullptr;\n    std::string typeName = t1.s_name();\n    auto typeMapIter = _js_global_type_map.find(typeName);\n    \n    CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n    typeClass = typeMapIter->second;\n    CCASSERT(typeClass, \"The value is null.\");\n\n    JSB_CCPhysicsDebugNode_object = JS_InitClass(cx, globalObj, typeClass->proto, JSB_CCPhysicsDebugNode_class, dummy_constructor<PhysicsDebugNode>, 0,properties,funcs,NULL,st_funcs);\n\n    TypeTest<PhysicsDebugNode> t;\n    js_type_class_t *p;\n    typeName = t.s_name();\n    \n    if (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n    {\n        p = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n        p->jsclass = JSB_CCPhysicsDebugNode_class;\n        p->proto = JSB_CCPhysicsDebugNode_object;\n        p->parentProto = typeClass->proto;\n        _js_global_type_map.insert(std::make_pair(typeName, p));\n    }\n}\n\n// Arguments: NSString*, CGRect\n// Ret value: PhysicsSprite* (o)\nJSBool JSPROXY_CCPhysicsSprite_spriteWithFile_rect__static(JSContext *cx, uint32_t argc, jsval *vp) {\n\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tcocos2d::Rect arg1;\n\t\tok &= jsval_to_ccrect(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        PhysicsSprite* ret = PhysicsSprite::create(arg0, arg1);\n\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n                TypeTest<PhysicsSprite> t;\n                js_type_class_t *typeClass = nullptr;\n                std::string typeName = t.s_name();\n                auto typeMapIter = _js_global_type_map.find(typeName);\n                CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n                typeClass = typeMapIter->second;\n                CCASSERT(typeClass, \"The value is null.\");\n                \n                JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(obj);\n                js_proxy_t *p = jsb_new_proxy(ret, obj);\n                JS_AddNamedObjectRoot(cx, &p->obj, \"CCPhysicsSprite\");\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPhysicsSprite* ret = PhysicsSprite::create(arg0);\n\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tTypeTest<PhysicsSprite> t;\n                js_type_class_t *typeClass = nullptr;\n                std::string typeName = t.s_name();\n                auto typeMapIter = _js_global_type_map.find(typeName);\n                CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n                typeClass = typeMapIter->second;\n                CCASSERT(typeClass, \"The value is null.\");\n                JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(obj);\n                js_proxy_t *p = jsb_new_proxy(ret, obj);\n                JS_AddNamedObjectRoot(cx, &p->obj, \"CCPhysicsSprite\");\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\treturn JS_FALSE;\n\n}\n\n// Arguments: SpriteFrame*\n// Ret value: PhysicsSprite* (o)\nJSBool JSPROXY_CCPhysicsSprite_spriteWithSpriteFrame__static(JSContext *cx, uint32_t argc, jsval *vp) {\n\tjsval *argv = JS_ARGV(cx, vp);\n\tcocos2d::SpriteFrame* arg0;\n\tif (argc >= 1) {\n\t\tdo {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ0 = (cocos2d::SpriteFrame*)(proxy ? proxy->ptr : NULL);\n\t\t\tTEST_NATIVE_OBJECT(cx, arg0)\n\t\t} while (0);\n\t}\n    PhysicsSprite* ret = PhysicsSprite::createWithSpriteFrame(arg0);\n\n\tjsval jsret;\n\tdo {\n\t\tif (ret) {\n            TypeTest<PhysicsSprite> t;\n            js_type_class_t *typeClass = nullptr;\n            std::string typeName = t.s_name();\n            auto typeMapIter = _js_global_type_map.find(typeName);\n            CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n            typeClass = typeMapIter->second;\n            CCASSERT(typeClass, \"The value is null.\");\n            JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n            jsret = OBJECT_TO_JSVAL(obj);\n            js_proxy_t *p = jsb_new_proxy(ret, obj);\n            JS_AddNamedObjectRoot(cx, &p->obj, \"CCPhysicsSprite\");\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\tJS_SET_RVAL(cx, vp, jsret);\n\treturn JS_TRUE;\n}\n\n// Arguments: NSString*\n// Ret value: PhysicsSprite* (o)\nJSBool JSPROXY_CCPhysicsSprite_spriteWithSpriteFrameName__static(JSContext *cx, uint32_t argc, jsval *vp) {\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tconst char* arg0;\n    std::string arg0_tmp;\n\tif (argc == 1) {\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\n        PhysicsSprite* ret = PhysicsSprite::createWithSpriteFrameName(arg0);\n\n        jsval jsret;\n        do {\n            if (ret) {\n                TypeTest<PhysicsSprite> t;\n                js_type_class_t *typeClass = nullptr;\n                std::string typeName = t.s_name();\n                auto typeMapIter = _js_global_type_map.find(typeName);\n                CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n                typeClass = typeMapIter->second;\n                CCASSERT(typeClass, \"The value is null.\");\n                JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n                jsret = OBJECT_TO_JSVAL(obj);\n                js_proxy_t *p = jsb_new_proxy(ret, obj);\n                JS_AddNamedObjectRoot(cx, &p->obj, \"CCPhysicsSprite\");\n            } else {\n                jsret = JSVAL_NULL;\n            }\n        } while (0);\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    \n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nvoid JSPROXY_CCPhysicsSprite_createClass(JSContext *cx, JSObject* globalObj)\n{\n\tJSPROXY_CCPhysicsSprite_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSPROXY_CCPhysicsSprite_class->name = \"PhysicsSprite\";\n\tJSPROXY_CCPhysicsSprite_class->addProperty = JS_PropertyStub;\n\tJSPROXY_CCPhysicsSprite_class->delProperty = JS_DeletePropertyStub;\n\tJSPROXY_CCPhysicsSprite_class->getProperty = JS_PropertyStub;\n\tJSPROXY_CCPhysicsSprite_class->setProperty = JS_StrictPropertyStub;\n\tJSPROXY_CCPhysicsSprite_class->enumerate = JS_EnumerateStub;\n\tJSPROXY_CCPhysicsSprite_class->resolve = JS_ResolveStub;\n\tJSPROXY_CCPhysicsSprite_class->convert = JS_ConvertStub;\n\tJSPROXY_CCPhysicsSprite_class->finalize = JSPROXY_CCPhysicsSprite_finalize;\n\tJSPROXY_CCPhysicsSprite_class->flags = 0;\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getCPBody\", JSPROXY_CCPhysicsSprite_getCPBody, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getIgnoreBodyRotation\", JSPROXY_CCPhysicsSprite_ignoreBodyRotation, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"_setCPBody\", JSPROXY_CCPhysicsSprite_setCPBody_, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setIgnoreBodyRotation\", JSPROXY_CCPhysicsSprite_setIgnoreBodyRotation_, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"create\", JSPROXY_CCPhysicsSprite_spriteWithFile_rect__static, 2, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithSpriteFrame\", JSPROXY_CCPhysicsSprite_spriteWithSpriteFrame__static, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"createWithSpriteFrameName\", JSPROXY_CCPhysicsSprite_spriteWithSpriteFrameName__static, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n    TypeTest<cocos2d::Sprite> t1;\n\tjs_type_class_t *typeClass = nullptr;\n    std::string typeName = t1.s_name();\n\tauto typeMapIter = _js_global_type_map.find(typeName);\n\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\ttypeClass = typeMapIter->second;\n\tCCASSERT(typeClass, \"The value is null.\");\n\n\tJSPROXY_CCPhysicsSprite_object = JS_InitClass(cx, globalObj, typeClass->proto, JSPROXY_CCPhysicsSprite_class, dummy_constructor<PhysicsSprite>, 0,properties,funcs,NULL,st_funcs);\n\n    TypeTest<PhysicsSprite> t;\n\tjs_type_class_t *p;\n\ttypeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n    {\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = JSPROXY_CCPhysicsSprite_class;\n\t\tp->proto = JSPROXY_CCPhysicsSprite_object;\n\t\tp->parentProto = typeClass->proto;\n        _js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\n\nvoid register_CCPhysicsSprite(JSContext *cx, JSObject *obj) {\n    JS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"cc\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"cc\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n    JSPROXY_CCPhysicsSprite_createClass(cx, obj);\n}\n\nvoid register_CCPhysicsDebugNode(JSContext *cx, JSObject *obj) {\n    JS::RootedValue nsval(cx);\n    JSObject *ns;\n    JS_GetProperty(cx, obj, \"cc\", &nsval);\n    if (nsval == JSVAL_VOID) {\n        ns = JS_NewObject(cx, NULL, NULL, NULL);\n        nsval = OBJECT_TO_JSVAL(ns);\n        JS_SetProperty(cx, obj, \"cc\", nsval);\n    } else {\n        JS_ValueToObject(cx, nsval, &ns);\n    }\n    obj = ns;\n    JSB_CCPhysicsDebugNode_createClass(cx, obj, \"PhysicsDebugNode\");\n}\n\nJSBool jsval_to_cpBB( JSContext *cx, jsval vp, cpBB *ret )\n{\n\tJSObject *jsobj;\n\tJSBool ok = JS_ValueToObject( cx, vp, &jsobj );\n\tJSB_PRECONDITION( ok, \"Error converting value to object\");\n\tJSB_PRECONDITION( jsobj, \"Not a valid JS object\");\n\t\n    JS::RootedValue vall(cx);\n    JS::RootedValue valb(cx);\n    JS::RootedValue valr(cx);\n    JS::RootedValue valt(cx);\n\tok = JS_TRUE;\n\tok &= JS_GetProperty(cx, jsobj, \"l\", &vall);\n\tok &= JS_GetProperty(cx, jsobj, \"b\", &valb);\n\tok &= JS_GetProperty(cx, jsobj, \"r\", &valr);\n\tok &= JS_GetProperty(cx, jsobj, \"t\", &valt);\n\tJSB_PRECONDITION( ok, \"Error obtaining point properties\");\n\t\n\tdouble l, b, r, t;\n\tok &= JS_ValueToNumber(cx, vall, &l);\n\tok &= JS_ValueToNumber(cx, valb, &b);\n\tok &= JS_ValueToNumber(cx, valr, &r);\n\tok &= JS_ValueToNumber(cx, valt, &t);\n\tJSB_PRECONDITION( ok, \"Error converting value to numbers\");\n\t\n\tret->l = l;\n\tret->b = b;\n\tret->r = r;\n\tret->t = t;\n\t\n\treturn JS_TRUE;\n}\n\njsval cpBB_to_jsval(JSContext *cx, cpBB bb )\n{\n\tJSObject *object = JS_NewObject(cx, NULL, NULL, NULL );\n\tif (!object)\n\t\treturn JSVAL_VOID;\n\t\n\tif (!JS_DefineProperty(cx, object, \"l\", DOUBLE_TO_JSVAL(bb.l), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n\t\t!JS_DefineProperty(cx, object, \"b\", DOUBLE_TO_JSVAL(bb.b), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n\t\t!JS_DefineProperty(cx, object, \"r\", DOUBLE_TO_JSVAL(bb.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n\t\t!JS_DefineProperty(cx, object, \"t\", DOUBLE_TO_JSVAL(bb.t), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) )\n\t\treturn JSVAL_VOID;\n\t\n\treturn OBJECT_TO_JSVAL(object);\n}\n\n// In order to be compatible with Chipmunk-JS API,\n// this function expect to receive an array of numbers, and not an array of vects\n// OK:  [1,2,  3,4,  5,6]   <- expected\n// BAD: [{x:1, y:2}, {x:3,y:4}, {x:5, y:6}]  <- not expected\nJSBool jsval_to_array_of_cpvect( JSContext *cx, jsval vp, cpVect**verts, int *numVerts)\n{\n\t// Parsing sequence\n\tJSObject *jsobj;\n\tJSBool ok = JS_ValueToObject( cx, vp, &jsobj );\n\tJSB_PRECONDITION( ok, \"Error converting value to object\");\n\t\n\tJSB_PRECONDITION( jsobj && JS_IsArrayObject( cx, jsobj),  \"Object must be an array\");\n\n\tuint32_t len;\n\tJS_GetArrayLength(cx, jsobj, &len);\n\t\n\tJSB_PRECONDITION( len%2==0, \"Array lenght should be even\");\n\t\n\tcpVect *array = (cpVect*)malloc( sizeof(cpVect) * len/2);\n\t\n\tfor( uint32_t i=0; i< len;i++ ) {\n\t\tjsval valarg;\n\t\tJS_GetElement(cx, jsobj, i, &valarg);\n\n\t\tdouble value;\n\t\tok = JS_ValueToNumber(cx, valarg, &value);\n\t\tJSB_PRECONDITION( ok, \"Error converting value to nsobject\");\n\t\t\n\t\tif(i%2==0)\n\t\t\tarray[i/2].x = value;\n\t\telse\n\t\t\tarray[i/2].y = value;\n\t}\n\t\n\t*numVerts = len/2;\n\t*verts = array;\n\t\n\treturn JS_TRUE;\n}\n\n#pragma mark - Collision Handler\n\nstruct collision_handler {\n\tcpCollisionType\t\ttypeA;\n\tcpCollisionType\t\ttypeB;\n\t\n\tJSObject\t\t\t*begin;\n\tJSObject\t\t\t*pre;\n\tJSObject\t\t\t*post;\n\tJSObject\t\t\t*separate;\n\tJSObject\t\t\t*jsthis;\n\tJSContext\t\t\t*cx;\n\n\t// \"owner\" of the collision handler\n\t// Needed when the space goes out of scope, it will remove all the allocated collision handlers for him.\n\tcpSpace\t\t\t\t*space;\n\t\n\tunsigned long\t\thash_key;\n\n\tunsigned int\t\tis_oo; // Objected oriented API ?\n\tUT_hash_handle  hh;\n};\n\n// hash\nstruct collision_handler* collision_handler_hash = NULL;\n\n// helper pair\nstatic unsigned long pair_ints( unsigned long A, unsigned long B )\n{\n\t// order is not important\n\tunsigned long k1 = MIN(A, B );\n\tunsigned long k2 = MAX(A, B );\n\t\n\treturn (k1 + k2) * (k1 + k2 + 1) /2 + k2;\n}\n\nstatic cpBool myCollisionBegin(cpArbiter *arb, cpSpace *space, void *data)\n{\n\tstruct collision_handler *handler = (struct collision_handler*) data;\n\t\n\tjsval args[2];\n\tif( handler->is_oo ) {\n\t\targs[0] = c_class_to_jsval(handler->cx, arb, JSB_cpArbiter_object, JSB_cpArbiter_class, \"cpArbiter\");\n\t\targs[1] = c_class_to_jsval(handler->cx, space, JSB_cpSpace_object, JSB_cpSpace_class, \"cpArbiter\");\n\t} else {\n\t\targs[0] = opaque_to_jsval( handler->cx, arb);\n\t\targs[1] = opaque_to_jsval( handler->cx, space );\n\t}\n    \n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n\t\n\tjsval rval;\n\tJSBool ok = JS_CallFunctionValue( handler->cx, handler->jsthis, OBJECT_TO_JSVAL(handler->begin), 2, args, &rval);\n\tJSB_PRECONDITION2(ok, handler->cx, cpFalse, \"Error calling collision callback: begin\");\n\n\tif( JSVAL_IS_BOOLEAN(rval) ) {\n\t\tJSBool ret = JSVAL_TO_BOOLEAN(rval);\n\t\treturn (cpBool)ret;\n\t}\n\treturn cpTrue;\t\n}\n\nstatic cpBool myCollisionPre(cpArbiter *arb, cpSpace *space, void *data)\n{\n\tstruct collision_handler *handler = (struct collision_handler*) data;\n\t\n\tjsval args[2];\n\tif( handler->is_oo ) {\n\t\targs[0] = c_class_to_jsval(handler->cx, arb, JSB_cpArbiter_object, JSB_cpArbiter_class, \"cpArbiter\");\n\t\targs[1] = c_class_to_jsval(handler->cx, space, JSB_cpSpace_object, JSB_cpSpace_class, \"cpArbiter\");\n\t} else {\n\t\targs[0] = opaque_to_jsval( handler->cx, arb);\n\t\targs[1] = opaque_to_jsval( handler->cx, space );\n\t}\n    \n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n\t\n\tjsval rval;\n\tJSBool ok = JS_CallFunctionValue( handler->cx, handler->jsthis, OBJECT_TO_JSVAL(handler->pre), 2, args, &rval);\n\tJSB_PRECONDITION2(ok, handler->cx, JS_FALSE, \"Error calling collision callback: pre\");\n\t\n\tif( JSVAL_IS_BOOLEAN(rval) ) {\n\t\tJSBool ret = JSVAL_TO_BOOLEAN(rval);\n\t\treturn (cpBool)ret;\n\t}\n\treturn cpTrue;\t\n}\n\nstatic void myCollisionPost(cpArbiter *arb, cpSpace *space, void *data)\n{\n\tstruct collision_handler *handler = (struct collision_handler*) data;\n\t\n\tjsval args[2];\n\t\n\tif( handler->is_oo ) {\n\t\targs[0] = c_class_to_jsval(handler->cx, arb, JSB_cpArbiter_object, JSB_cpArbiter_class, \"cpArbiter\");\n\t\targs[1] = c_class_to_jsval(handler->cx, space, JSB_cpSpace_object, JSB_cpSpace_class, \"cpArbiter\");\n\t} else {\n\t\targs[0] = opaque_to_jsval( handler->cx, arb);\n\t\targs[1] = opaque_to_jsval( handler->cx, space );\n\t}\n    \n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n\t\n\tjsval ignore;\n\tJSBool ok = JS_CallFunctionValue( handler->cx, handler->jsthis, OBJECT_TO_JSVAL(handler->post), 2, args, &ignore);\n\tJSB_PRECONDITION2(ok, handler->cx, , \"Error calling collision callback: Post\");\n}\n\nstatic void myCollisionSeparate(cpArbiter *arb, cpSpace *space, void *data)\n{\n\tstruct collision_handler *handler = (struct collision_handler*) data;\n\t\n\tjsval args[2];\n\tif( handler->is_oo ) {\n\t\targs[0] = c_class_to_jsval(handler->cx, arb, JSB_cpArbiter_object, JSB_cpArbiter_class, \"cpArbiter\");\n\t\targs[1] = c_class_to_jsval(handler->cx, space, JSB_cpSpace_object, JSB_cpSpace_class, \"cpArbiter\");\n\t} else {\n\t\targs[0] = opaque_to_jsval( handler->cx, arb);\n\t\targs[1] = opaque_to_jsval( handler->cx, space );\n\t}\n    \n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n\t\n\tjsval ignore;\n\tJSBool ok = JS_CallFunctionValue( handler->cx, handler->jsthis, OBJECT_TO_JSVAL(handler->separate), 2, args, &ignore);\n\tJSB_PRECONDITION2(ok, handler->cx, , \"Error calling collision callback: Separate\");}\n\n#pragma mark - cpSpace\n\n#pragma mark constructor / destructor\n\nvoid JSB_cpSpace_finalize(JSFreeOp *fop, JSObject *jsthis)\n{\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tif( proxy ) {\n\t\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpSpace), handle: %p\", jsthis, proxy->handle);\n\t\t\n\t\t// space\n\t\tcpSpace *space = (cpSpace*) proxy->handle;\n\t\t\n\t\t\n\t\t// Remove collision handlers, since the user might have forgotten to manually remove them\n\t\tstruct collision_handler *current, *tmp;\n\t\tHASH_ITER(hh, collision_handler_hash, current, tmp) {\n\t\t\tif( current->space == space ) {\n\n\t\t\t\tJSContext *cx = current->cx;\n\n\t\t\t\t// unroot it\n\t\t\t\tif( current->begin ) {\n\t\t\t\t\tJS_RemoveObjectRoot(cx, &current->begin);\n                }\n\t\t\t\tif( current->pre )\n\t\t\t\t\tJS_RemoveObjectRoot(cx, &current->pre);\n\t\t\t\tif( current->post )\n\t\t\t\t\tJS_RemoveObjectRoot(cx, &current->post);\n\t\t\t\tif( current->separate )\n\t\t\t\t\tJS_RemoveObjectRoot(cx, &current->separate);\n\t\t\t\t\n\t\t\t\tHASH_DEL(collision_handler_hash,current);  /* delete; users advances to next */\n\t\t\t\tfree(current);            /* optional- if you want to free  */\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Free Space Children\n\t\tfreeSpaceChildren(space);\n\t\t\n\t\tjsb_del_jsobject_for_proxy(space);\n\t\tif(proxy->flags == JSB_C_FLAG_CALL_FREE)\n\t\t\tcpSpaceFree(space);\n\t\tjsb_del_c_proxy_for_jsobject(jsthis);\n\t}\n}\n\n\n#pragma mark addCollisionHandler\n\nstatic\nJSBool __jsb_cpSpace_addCollisionHandler(JSContext *cx, jsval *vp, jsval *argvp, cpSpace *space, unsigned int is_oo)\n{\n\tstruct collision_handler *handler = (struct collision_handler*) malloc( sizeof(*handler) );\n\n\tJSB_PRECONDITION(handler, \"Error allocating memory\");\n\t\n\tJSBool ok = JS_TRUE;\n\t\n\t// args\n\tok &= jsval_to_int(cx, *argvp++, (int32_t*) &handler->typeA );\n\tok &= jsval_to_int(cx, *argvp++, (int32_t*) &handler->typeB );\n\t\n\t// this is no longer passed, so \"this\" is going to be \"this\".\n//\tok &= JS_ValueToObject(cx, *argvp++, &handler->jsthis );\n\thandler->jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\t\n\thandler->begin = !JSVAL_IS_NULL(*argvp) ? JSVAL_TO_OBJECT(*argvp) : NULL;\n\targvp++;\n\thandler->pre = !JSVAL_IS_NULL(*argvp) ? JSVAL_TO_OBJECT(*argvp) : NULL;\n\targvp++;\n\thandler->post = !JSVAL_IS_NULL(*argvp) ? JSVAL_TO_OBJECT(*argvp) : NULL;\n\targvp++;\n\thandler->separate = !JSVAL_IS_NULL(*argvp) ? JSVAL_TO_OBJECT(*argvp) : NULL;\n\targvp++;\n\t\n\tJSB_PRECONDITION(ok, \"Error parsing arguments\");\n\t\n\t// Object Oriented API ?\n\thandler->is_oo = is_oo;\n\t\n\t// owner of the collision handler\n\thandler->space = space;\n\t\n\t// Root it\n\tif( handler->begin )\n\t\tJS_AddNamedObjectRoot(cx, &handler->begin, \"begin collision_handler\");\n\tif( handler->pre )\n\t\tJS_AddNamedObjectRoot(cx, &handler->pre, \"pre collision_handler\");\n\tif( handler->post )\n\t\tJS_AddNamedObjectRoot(cx, &handler->post, \"post collision_handler\");\n\tif( handler->separate )\n\t\tJS_AddNamedObjectRoot(cx, &handler->separate, \"separate collision_handler\");\n\t\n\thandler->cx = cx;\n\t\n\tcpSpaceAddCollisionHandler(space, handler->typeA, handler->typeB,\n\t\t\t\t\t\t\t   !handler->begin ? NULL : &myCollisionBegin,\n\t\t\t\t\t\t\t   !handler->pre ? NULL : &myCollisionPre,\n\t\t\t\t\t\t\t   !handler->post ? NULL : &myCollisionPost,\n\t\t\t\t\t\t\t   !handler->separate ? NULL : &myCollisionSeparate,\n\t\t\t\t\t\t\t   handler );\n\t\n\t\n\t//\n\t// Already added ? If so, remove it.\n\t// Then add new entry\n\t//\n\tstruct collision_handler *hashElement = NULL;\n\tunsigned long paired_key = pair_ints(handler->typeA, handler->typeB );\n\tHASH_FIND_INT(collision_handler_hash, &paired_key, hashElement);\n    if( hashElement ) {\n\t\tHASH_DEL( collision_handler_hash, hashElement );\n\t\tfree( hashElement );\n\t}\n\t\n\thandler->hash_key = paired_key;\n\tHASH_ADD_INT( collision_handler_hash, hash_key, handler );\n\t\n\t\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\nJSBool JSB_cpSpaceAddCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==7, cx, JS_FALSE, \"Invalid number of arguments\");\n\n\n\tjsval *argvp = JS_ARGV(cx,vp);\n\n\t// args\n\tcpSpace *space;\n\tJSBool ok = jsval_to_opaque( cx, *argvp++, (void**)&space);\n\tJSB_PRECONDITION(ok, \"Error parsing arguments\");\n\t\n\treturn __jsb_cpSpace_addCollisionHandler(cx, vp, argvp, space, 0);\n}\n\n// method\nJSBool JSB_cpSpace_addCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==6, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\t\n\tstruct jsb_c_proxy_s* proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tvoid *handle = proxy->handle;\n\t\n\treturn __jsb_cpSpace_addCollisionHandler(cx, vp, JS_ARGV(cx,vp), (cpSpace*)handle, 1);\n}\n\n#pragma mark removeCollisionHandler\n\nstatic\nJSBool __jsb_cpSpace_removeCollisionHandler(JSContext *cx, jsval *vp, jsval *argvp, cpSpace *space)\n{\n\tJSBool ok = JS_TRUE;\n\t\n\tcpCollisionType typeA;\n\tcpCollisionType typeB;\n\tok &= jsval_to_int(cx, *argvp++, (int32_t*) &typeA );\n\tok &= jsval_to_int(cx, *argvp++, (int32_t*) &typeB );\n\n\tJSB_PRECONDITION(ok, \"Error parsing arguments\");\n\t\n\tcpSpaceRemoveCollisionHandler(space, typeA, typeB );\n\t\n\t// Remove it\n\tstruct collision_handler *hashElement = NULL;\n\tunsigned long key = pair_ints(typeA, typeB );\n\tHASH_FIND_INT(collision_handler_hash, &key, hashElement);\n    if( hashElement ) {\n\t\t\n\t\t// unroot it\n\t\tif( hashElement->begin )\n\t\t\tJS_RemoveObjectRoot(cx, &hashElement->begin);\n\t\tif( hashElement->pre )\n\t\t\tJS_RemoveObjectRoot(cx, &hashElement->pre);\n\t\tif( hashElement->post )\n\t\t\tJS_RemoveObjectRoot(cx, &hashElement->post);\n\t\tif( hashElement->separate )\n\t\t\tJS_RemoveObjectRoot(cx, &hashElement->separate);\n\t\t\n\t\tHASH_DEL( collision_handler_hash, hashElement );\n\t\tfree( hashElement );\n\t}\n\t\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Free function\nJSBool JSB_cpSpaceRemoveCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==3, cx, JS_FALSE, \"Invalid number of arguments\");\n\n\tjsval *argvp = JS_ARGV(cx,vp);\n\t\n\tcpSpace* space;\n\tJSBool ok = jsval_to_opaque( cx, *argvp++, (void**)&space);\n\t\n\tJSB_PRECONDITION(ok, \"Error parsing arguments\");\n\n\treturn __jsb_cpSpace_removeCollisionHandler(cx, vp, argvp, space);\n}\n\n// method\nJSBool JSB_cpSpace_removeCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==2, cx, JS_FALSE, \"Invalid number of arguments\");\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\t\n\tstruct jsb_c_proxy_s* proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tvoid *handle = proxy->handle;\n\t\n\treturn __jsb_cpSpace_removeCollisionHandler(cx, vp, JS_ARGV(cx,vp), (cpSpace*)handle);\n}\n\n#pragma mark Add functios. Root JSObjects\n\n// Arguments: cpBody*\n// Ret value: cpBody*\nJSBool JSB_cpSpace_addBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg1;\n\t\n\tjsval retval = *argvp; struct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceAddBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\t\n\t// Root it:\n\tJS_AddNamedObjectRoot(cx, &retproxy->jsobj, \"cpBody\");\n\t\n\t// addBody returns the same object that was added, so return it without conversions\n\tJS_SET_RVAL(cx, vp, retval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: cpConstraint*\nJSBool JSB_cpSpace_addConstraint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg1;\n\t\n\tjsval retval = *argvp; struct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceAddConstraint((cpSpace*)arg0 , (cpConstraint*)arg1  );\n\t\n\t// Root it:\n\tJS_AddNamedObjectRoot(cx, &retproxy->jsobj, \"cpConstraint\");\n\t\n\t// addConstraint returns the same object that was added, so return it without conversions\n\tJS_SET_RVAL(cx, vp, retval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpShape*\nJSBool JSB_cpSpace_addShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1;\n\n\tjsval retval = *argvp; struct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceAddShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\t\n\t// Root it:\n\tJS_AddNamedObjectRoot(cx, &retproxy->jsobj, \"cpShape\");\n\t\n\t// addShape returns the same object that was added, so return it without conversions\n\tJS_SET_RVAL(cx, vp, retval);\n    \n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: cpShape*\nJSBool JSB_cpSpace_addStaticShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1;\n\t\n\tjsval retval = *argvp; struct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceAddStaticShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\t\n\t// Root it:\n\tJS_AddNamedObjectRoot(cx, &retproxy->jsobj, \"cpShape (static)\");\n\n\t// addStaticShape returns the same object that was added, so return it without conversions\n\tJS_SET_RVAL(cx, vp, retval);\n    \n\treturn JS_TRUE;\n}\n\n#pragma mark Remove functios. Untoot JSObjects\n\n// Arguments: cpBody*\n// Ret value: void\nJSBool JSB_cpSpace_removeBody(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* arg1;\n\t\n\tstruct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceRemoveBody((cpSpace*)arg0 , (cpBody*)arg1  );\n\tJS_RemoveObjectRoot(cx, &retproxy->jsobj);\n\t\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpConstraint*\n// Ret value: void\nJSBool JSB_cpSpace_removeConstraint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpConstraint* arg1;\n\t\n\tstruct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceRemoveConstraint((cpSpace*)arg0 , (cpConstraint*)arg1  );\n\tJS_RemoveObjectRoot(cx, &retproxy->jsobj);\n\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: void\nJSBool JSB_cpSpace_removeShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1;\n\t\n\tstruct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceRemoveShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_RemoveObjectRoot(cx, &retproxy->jsobj);\n\t\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: cpShape*\n// Ret value: void\nJSBool JSB_cpSpace_removeStaticShape(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tcpSpace* arg0 = (cpSpace*) proxy->handle;\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpShape* arg1;\n\t\n\tstruct jsb_c_proxy_s *retproxy;\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&arg1, &retproxy );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpSpaceRemoveStaticShape((cpSpace*)arg0 , (cpShape*)arg1  );\n\tJS_RemoveObjectRoot(cx, &retproxy->jsobj);\n\t\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n#pragma mark - Arbiter\n\n#pragma mark getBodies\nstatic\nJSBool __jsb_cpArbiter_getBodies(JSContext *cx, jsval *vp, jsval *argvp, cpArbiter *arbiter, unsigned int is_oo)\n{\n\tcpBody *bodyA;\n\tcpBody *bodyB;\n\tcpArbiterGetBodies(arbiter, &bodyA, &bodyB);\n\t\n\tjsval valA, valB;\n\tif( is_oo ) {\n\t\tvalA = c_class_to_jsval(cx, bodyA, JSB_cpBody_object, JSB_cpBody_class, \"cpArbiter\");\n\t\tvalB = c_class_to_jsval(cx, bodyB, JSB_cpBody_object, JSB_cpBody_class, \"cpArbiter\");\n\t} else {\n\t\tvalA = opaque_to_jsval(cx, bodyA);\n\t\tvalB = opaque_to_jsval(cx, bodyB);\t\t\n\t}\n\t\n\tJSObject *jsobj = JS_NewArrayObject(cx, 2, NULL);\n\tJS_SetElement(cx, jsobj, 0, &valA);\n\tJS_SetElement(cx, jsobj, 1, &valB);\n\t\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\t\n\treturn JS_TRUE;\t\n}\n\n// Free function\nJSBool JSB_cpArbiterGetBodies(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tjsval *argvp = JS_ARGV(cx,vp);\n\t\n\tcpArbiter* arbiter;\n\tif( ! jsval_to_opaque( cx, *argvp++, (void**)&arbiter ) )\n\t\treturn JS_FALSE;\n\n\treturn __jsb_cpArbiter_getBodies(cx, vp, argvp, arbiter, 0);\n}\n\n// Method\nJSBool JSB_cpArbiter_getBodies(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\t\n\tstruct jsb_c_proxy_s* proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tJSB_PRECONDITION( proxy, \"Invalid private object\");\n\tvoid *handle = proxy->handle;\n\t\n\treturn __jsb_cpArbiter_getBodies(cx, vp, JS_ARGV(cx,vp), (cpArbiter*)handle, 1);\n}\n\n#pragma mark getShapes\nstatic\nJSBool __jsb_cpArbiter_getShapes(JSContext *cx, jsval *vp, jsval *argvp, cpArbiter *arbiter, unsigned int is_oo)\n{\n\tcpShape *shapeA;\n\tcpShape *shapeB;\n\tcpArbiterGetShapes(arbiter, &shapeA, &shapeB);\n\n\tjsval valA, valB;\n\tif( is_oo ) {\n\t\tvalA = c_class_to_jsval(cx, shapeA, JSB_cpShape_object, JSB_cpShape_class, \"cpShape\");\n\t\tvalB = c_class_to_jsval(cx, shapeB, JSB_cpShape_object, JSB_cpShape_class, \"cpShape\");\n\t} else {\n\t\tvalA = opaque_to_jsval(cx, shapeA);\n\t\tvalB = opaque_to_jsval(cx, shapeB);\n\t}\n\t\n\tJSObject *jsobj = JS_NewArrayObject(cx, 2, NULL);\n\tJS_SetElement(cx, jsobj, 0, &valA);\n\tJS_SetElement(cx, jsobj, 1, &valB);\n\t\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\t\n\treturn JS_TRUE;\n}\n\n// function\nJSBool JSB_cpArbiterGetShapes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tjsval *argvp = JS_ARGV(cx,vp);\n\t\n\tcpArbiter* arbiter;\n\tif( ! jsval_to_opaque( cx, *argvp++, (void**) &arbiter ) )\n\t   return JS_FALSE;\n\n\treturn __jsb_cpArbiter_getShapes(cx, vp, argvp, arbiter, 0);\n}\n\n// method\nJSBool JSB_cpArbiter_getShapes(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\t\n\tstruct jsb_c_proxy_s* proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tvoid *handle = proxy->handle;\n\t\n\treturn __jsb_cpArbiter_getShapes(cx, vp, JS_ARGV(cx,vp), (cpArbiter*)handle, 1);\n}\n\n#pragma mark - Body\n\n#pragma mark constructor\n\n// Manually added to identify static vs dynamic bodies\nJSBool JSB_cpBody_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==2, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpBody_class, JSB_cpBody_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tdouble m; double i;\n\t\n\tok &= JS_ValueToNumber( cx, *argvp++, &m );\n\tok &= JS_ValueToNumber( cx, *argvp++, &i );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\t\n\tcpBody *ret_body = NULL;\n\tif( m == INFINITY && i == INFINITY) {\n\t\tret_body = cpBodyNewStatic();\n\t\t\n\t\t// XXX: Hack. IT WILL LEAK \"rogue\" objects., But at least it prevents a crash.\n\t\t// The thing is that \"rogue\" bodies needs to be freed after the its shape, and I am not sure\n\t\t// how to do it in a \"js\" way.\n\t\tjsb_set_c_proxy_for_jsobject(jsobj, ret_body, JSB_C_FLAG_DO_NOT_CALL_FREE);\n\t} else {\n\t\tret_body = cpBodyNew((cpFloat)m , (cpFloat)i  );\n\t\tjsb_set_c_proxy_for_jsobject(jsobj, ret_body, JSB_C_FLAG_CALL_FREE);\n\t}\n\t\n\tjsb_set_jsobject_for_proxy(jsobj, ret_body);\n\t\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\treturn JS_TRUE;\n}\n\n#pragma mark getUserData\n\nstatic\nJSBool __jsb_cpBody_getUserData(JSContext *cx, jsval *vp, jsval *argvp, cpBody *body)\n{\n\tJSObject *data = (JSObject*) cpBodyGetUserData(body);\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(data));\n\t\n\treturn JS_TRUE;\n}\n\n// free function\nJSBool JSB_cpBodyGetUserData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tcpBody *body;\n\tif( ! jsval_to_opaque( cx, *argvp++, (void**) &body ) )\n\t\treturn JS_FALSE;\n\n\treturn __jsb_cpBody_getUserData(cx, vp, argvp, body);\n}\n\n// method\nJSBool JSB_cpBody_getUserData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\t\n\tstruct jsb_c_proxy_s* proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tvoid *handle = proxy->handle;\n\t\n\treturn __jsb_cpBody_getUserData(cx, vp, JS_ARGV(cx,vp), (cpBody*)handle);\n}\n\n\n#pragma mark setUserData\n\nstatic\nJSBool __jsb_cpBody_setUserData(JSContext *cx, jsval *vp, jsval *argvp, cpBody *body)\n{\n\tJSObject *jsobj;\n\n\tJSBool ok = JS_ValueToObject(cx, *argvp++, &jsobj);\n\n\tJSB_PRECONDITION(ok, \"Error parsing arguments\");\n\t\n\tcpBodySetUserData(body, jsobj);\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\n\treturn JS_TRUE;\n}\n\n// free function\nJSBool JSB_cpBodySetUserData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==2, cx, JS_FALSE, \"Invalid number of arguments\");\n\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tcpBody *body;\n\tJSBool ok = jsval_to_opaque( cx, *argvp++, (void**) &body );\n\tJSB_PRECONDITION(ok, \"Error parsing arguments\");\n\treturn __jsb_cpBody_setUserData(cx, vp, argvp, body);\n}\n\n// method\nJSBool JSB_cpBody_setUserData(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\t\n\tstruct jsb_c_proxy_s* proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tvoid *handle = proxy->handle;\n\t\n\treturn __jsb_cpBody_setUserData(cx, vp, JS_ARGV(cx,vp), (cpBody*)handle);\n}\n\n#pragma mark - Poly related\n\n// cpFloat cpAreaForPoly(const int numVerts, const cpVect *verts);\nJSBool JSB_cpAreaForPoly(JSContext *cx, uint32_t argc, jsval *vp)\n{\t\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect *verts;\n\tint numVerts;\n\t\n\tok &= jsval_to_array_of_cpvect( cx, *argvp++, &verts, &numVerts);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error parsing array\");\n\t\n\tcpFloat area = cpAreaForPoly(numVerts, verts);\n\t\n\tfree(verts);\n\t\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(area));\n\treturn JS_TRUE;\n}\n\n// cpFloat cpMomentForPoly(cpFloat m, int numVerts, const cpVect *verts, cpVect offset);\nJSBool JSB_cpMomentForPoly(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==3, cx, JS_FALSE, \"Invalid number of arguments\");\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect *verts; cpVect offset;\n\tint numVerts;\n\tdouble m;\n\t\n\tok &= JS_ValueToNumber(cx, *argvp++, &m);\n\tok &= jsval_to_array_of_cpvect( cx, *argvp++, &verts, &numVerts);\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &offset );\n\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error parsing args\");\n\t\n\tcpFloat moment = cpMomentForPoly((cpFloat)m, numVerts, verts, offset);\n\t\n\tfree(verts);\n\t\n\tJS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(moment));\n\treturn JS_TRUE;\n}\n\n// cpVect cpCentroidForPoly(const int numVerts, const cpVect *verts);\nJSBool JSB_cpCentroidForPoly(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpVect *verts;\n\tint numVerts;\n\t\n\tok &= jsval_to_array_of_cpvect( cx, *argvp++, &verts, &numVerts);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error parsing args\");\n\t\n\tcpVect centroid = cpCentroidForPoly(numVerts, verts);\n\t\n\tfree(verts);\n\t\n\tJS_SET_RVAL(cx, vp, cpVect_to_jsval(cx, (cpVect)centroid));\n\treturn JS_TRUE;\n}\n\n// void cpRecenterPoly(const int numVerts, cpVect *verts);\nJSBool JSB_cpRecenterPoly(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tCCASSERT(false, \"NOT IMPLEMENTED\");\n\treturn JS_FALSE;\n}\n\n#pragma mark - Object Oriented Chipmunk\n\n/*\n * Chipmunk Base Object\n */\n\nJSClass* JSB_cpBase_class = NULL;\nJSObject* JSB_cpBase_object = NULL;\n// Constructor\nJSBool JSB_cpBase_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2( argc==1, cx, JS_FALSE, \"Invalid arguments. Expecting 1\");\n\t\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpBase_class, JSB_cpBase_object, NULL);\n\t\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\t\n\tvoid *handle = NULL;\n\t\n\tok = jsval_to_opaque(cx, *argvp++, &handle);\n\t\n\tJSB_PRECONDITION(ok, \"Error converting arguments for JSB_cpBase_constructor\");\n\n\tjsb_set_c_proxy_for_jsobject(jsobj, handle, JSB_C_FLAG_DO_NOT_CALL_FREE);\n\tjsb_set_jsobject_for_proxy(jsobj, handle);\n\t\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\treturn JS_TRUE;\n}\n\n// Destructor\nvoid JSB_cpBase_finalize(JSFreeOp *fop, JSObject *obj)\n{\n\tCCLOGINFO(\"jsbindings: finalizing JS object %p (cpBase)\", obj);\n\t\n\t// should not delete the handle since it was manually added\n}\n\nJSBool JSB_cpBase_getHandle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\tJSB_PRECONDITION2(argc==0, cx, JS_FALSE, \"Invalid number of arguments\");\n\n\tstruct jsb_c_proxy_s* proxy = jsb_get_c_proxy_for_jsobject(jsthis);\n\tvoid *handle = proxy->handle;\n\t\n\tjsval ret_val = opaque_to_jsval(cx, handle);\n\tJS_SET_RVAL(cx, vp, ret_val);\n\treturn JS_TRUE;\n}\n\nJSBool JSB_cpBase_setHandle(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n\tJSB_PRECONDITION( jsthis, \"Invalid jsthis object\");\n\tJSB_PRECONDITION2(argc==1, cx, JS_FALSE, \"Invalid number of arguments\");\n\t\n\tjsval *argvp = JS_ARGV(cx,vp);\n\t\n\tvoid *handle;\n\tJSBool ok = jsval_to_opaque(cx, *argvp++, &handle);\n\tJSB_PRECONDITION( ok, \"Invalid parsing arguments\");\n\n\tjsb_set_c_proxy_for_jsobject(jsthis, handle, JSB_C_FLAG_DO_NOT_CALL_FREE);\n\tjsb_set_jsobject_for_proxy(jsthis, handle);\n\t\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n\nvoid JSB_cpBase_createClass(JSContext *cx, JSObject* globalObj, const char* name )\n{\n\tJSB_cpBase_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tJSB_cpBase_class->name = name;\n\tJSB_cpBase_class->addProperty = JS_PropertyStub;\n\tJSB_cpBase_class->delProperty = JS_DeletePropertyStub;\n\tJSB_cpBase_class->getProperty = JS_PropertyStub;\n\tJSB_cpBase_class->setProperty = JS_StrictPropertyStub;\n\tJSB_cpBase_class->enumerate = JS_EnumerateStub;\n\tJSB_cpBase_class->resolve = JS_ResolveStub;\n\tJSB_cpBase_class->convert = JS_ConvertStub;\n\tJSB_cpBase_class->finalize = JSB_cpBase_finalize;\n\tJSB_cpBase_class->flags = JSCLASS_HAS_PRIVATE;\n\t\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, 0, 0}\n\t};\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getHandle\", JSB_cpBase_getHandle, 0, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setHandle\", JSB_cpBase_setHandle, 1, JSPROP_PERMANENT  | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FS_END\n\t};\n\t\n\tJSB_cpBase_object = JS_InitClass(cx, globalObj, NULL, JSB_cpBase_class, JSB_cpBase_constructor,0,properties,funcs,NULL,st_funcs);\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, globalObj, name, JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n// Manual \"methods\"\n// Constructor\nJSBool JSB_cpPolyShape_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSB_PRECONDITION2(argc==3, cx, JS_FALSE, \"Invalid number of arguments\");\n\tJSObject *jsobj = JS_NewObject(cx, JSB_cpPolyShape_class, JSB_cpPolyShape_object, NULL);\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tcpBody* body; cpVect *verts; cpVect offset;\n\tint numVerts;\n\t\n\tok &= jsval_to_c_class( cx, *argvp++, (void**)&body, NULL );\n\tok &= jsval_to_array_of_cpvect( cx, *argvp++, &verts, &numVerts);\n\tok &= jsval_to_cpVect( cx, *argvp++, (cpVect*) &offset );\n\tJSB_PRECONDITION(ok, \"Error processing arguments\");\n\tcpShape *shape = cpPolyShapeNew(body, numVerts, verts, offset);\n\n\tjsb_set_c_proxy_for_jsobject(jsobj, shape, JSB_C_FLAG_DO_NOT_CALL_FREE);\n\tjsb_set_jsobject_for_proxy(jsobj, shape);\n\t\n\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n\t\n\tfree(verts);\n\t\n\treturn JS_TRUE;\n}\n\n\n#pragma mark Space Free functions\n//\n// When the space is removed, it should all remove its children. But not \"free\" them.\n// \"free\" will be performed by the JS Garbage Collector\n//\n// Functions copied & pasted from ChipmunkDemo.c\n// https://github.com/slembcke/Chipmunk-Physics/blob/master/Demo/ChipmunkDemo.c#L89\n//\n\nstatic void unroot_jsobject_from_handle(void *handle)\n{\n\tJSObject *jsobj = jsb_get_jsobject_for_proxy(handle);\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsobj);\n\t\n\t// HACK context from global\n\tJSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n\tJS_RemoveObjectRoot(cx, &proxy->jsobj);\n\t\n}\nstatic void shapeFreeWrap(cpSpace *space, cpShape *shape, void *unused){\n\tcpSpaceRemoveShape(space, shape);\n\tunroot_jsobject_from_handle(shape);\n//\tcpShapeFree(shape);\n}\n\nstatic void postShapeFree(cpShape *shape, cpSpace *space){\n\tcpSpaceAddPostStepCallback(space, (cpPostStepFunc)shapeFreeWrap, shape, NULL);\n}\n\nstatic void constraintFreeWrap(cpSpace *space, cpConstraint *constraint, void *unused){\n\tcpSpaceRemoveConstraint(space, constraint);\n\tunroot_jsobject_from_handle(constraint);\n//\tcpConstraintFree(constraint);\n}\n\nstatic void postConstraintFree(cpConstraint *constraint, cpSpace *space){\n\tcpSpaceAddPostStepCallback(space, (cpPostStepFunc)constraintFreeWrap, constraint, NULL);\n}\n\nstatic void bodyFreeWrap(cpSpace *space, cpBody *body, void *unused){\n\tcpSpaceRemoveBody(space, body);\n\tunroot_jsobject_from_handle(body);\n//\tcpBodyFree(body);\n}\n\nstatic void postBodyFree(cpBody *body, cpSpace *space){\n\tcpSpaceAddPostStepCallback(space, (cpPostStepFunc)bodyFreeWrap, body, NULL);\n}\n\n// Safe and future proof way to remove and free all objects that have been added to the space.\nvoid static freeSpaceChildren(cpSpace *space)\n{\n\t// Must remove these BEFORE freeing the body or you will access dangling pointers.\n\tcpSpaceEachShape(space, (cpSpaceShapeIteratorFunc)postShapeFree, space);\n\tcpSpaceEachConstraint(space, (cpSpaceConstraintIteratorFunc)postConstraintFree, space);\n\t\n\tcpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)postBodyFree, space);\n}\n\n#endif // JSB_INCLUDE_CHIPMUNK\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_manual.h",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n#ifndef __js_bindings_chipmunk_manual\n#define __js_bindings_chipmunk_manual\n\n#include \"js_bindings_config.h\"\n#include \"js_manual_conversions.h\"\n#include \"ScriptingCore.h\"\n#ifdef JSB_INCLUDE_CHIPMUNK\n\n#include \"chipmunk.h\"\n#include \"jsapi.h\"\n\n#include \"js_bindings_chipmunk_auto_classes.h\"\n\n// Free Functions\nJSBool JSB_cpSpaceAddCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpaceRemoveCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);\n\nJSBool JSB_cpArbiterGetBodies(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiterGetShapes(JSContext *cx, uint32_t argc, jsval *vp);\n\nJSBool JSB_cpBodyGetUserData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBodySetUserData(JSContext *cx, uint32_t argc, jsval *vp);\n\n// poly related\nJSBool JSB_cpAreaForPoly(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpMomentForPoly(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpCentroidForPoly(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpRecenterPoly(JSContext *cx, uint32_t argc, jsval *vp);\n\n// \"Methods\" from the OO API\nJSBool JSB_cpSpace_addCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_removeCollisionHandler(JSContext *cx, uint32_t argc, jsval *vp);\n\n// manually wrapped for rooting/unrooting purposes\nJSBool JSB_cpSpace_addBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_addConstraint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_addShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_addStaticShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_removeBody(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_removeConstraint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_removeShape(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpSpace_removeStaticShape(JSContext *cx, uint32_t argc, jsval *vp);\n\n\nJSBool JSB_cpArbiter_getBodies(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpArbiter_getShapes(JSContext *cx, uint32_t argc, jsval *vp);\n\nJSBool JSB_cpBody_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBody_getUserData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_cpBody_setUserData(JSContext *cx, uint32_t argc, jsval *vp);\n\n\n// convertions\n\njsval cpBB_to_jsval(JSContext *cx, cpBB bb );\nJSBool jsval_to_cpBB( JSContext *cx, jsval vp, cpBB *ret );\nJSBool jsval_to_array_of_cpvect( JSContext *cx, jsval vp, cpVect**verts, int *numVerts);\n\n// requires cocos2d\n#define cpVect_to_jsval CGPoint_to_jsval\n#define jsval_to_cpVect jsval_to_CGPoint\n\n\n// Object Oriented Chipmunk\nvoid JSB_cpBase_createClass(JSContext* cx, JSObject* globalObj, const char * name );\nextern JSObject* JSB_cpBase_object;\nextern JSClass* JSB_cpBase_class;\nextern void register_CCPhysicsSprite(JSContext *cx, JSObject *obj);\nextern void register_CCPhysicsDebugNode(JSContext *cx, JSObject *obj);\n\n// Manual constructor / destructors\nJSBool JSB_cpPolyShape_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid JSB_cpSpace_finalize(JSFreeOp *fop, JSObject *obj);\n\n#endif // JSB_INCLUDE_CHIPMUNK\n\n#endif // __js_bindings_chipmunk_manual\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_registration.cpp",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n#ifndef JSB_INCLUDE_CHIPMUNK\n#define JSB_INCLUDE_CHIPMUNK\n#endif\n\n#include \"js_bindings_config.h\"\n#include \"ScriptingCore.h\"\n\n\n// chipmunk\n#include \"js_bindings_chipmunk_auto_classes.h\"\n#include \"js_bindings_chipmunk_functions.h\"\n#include \"js_bindings_chipmunk_manual.h\"\n\n\nvoid jsb_register_chipmunk(JSContext* cx, JSObject *object)\n{\n\t//\n\t// Chipmunk\n\t//\n\tJSObject *chipmunk = JS_NewObject(cx, NULL, NULL, NULL);\n    JS::RootedValue chipmunkVal(cx);\n    \n    chipmunkVal = OBJECT_TO_JSVAL(chipmunk);\n\tJS_SetProperty(cx, object, \"cp\", chipmunkVal);\n\t\n\tJSB_cpBase_createClass(cx, chipmunk, \"Base\");  // manual base class registration\n#include \"js_bindings_chipmunk_auto_classes_registration.h\"\n#include \"js_bindings_chipmunk_functions_registration.h\"\n\t\n\t// manual\n\tJS_DefineFunction(cx, chipmunk, \"spaceAddCollisionHandler\", JSB_cpSpaceAddCollisionHandler, 8, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"spaceRemoveCollisionHandler\", JSB_cpSpaceRemoveCollisionHandler, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"arbiterGetBodies\", JSB_cpArbiterGetBodies, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"arbiterGetShapes\", JSB_cpArbiterGetShapes, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"bodyGetUserData\", JSB_cpBodyGetUserData, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"bodySetUserData\", JSB_cpBodySetUserData, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\n\tJS_DefineFunction(cx, chipmunk, \"areaForPoly\", JSB_cpAreaForPoly, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"momentForPoly\", JSB_cpMomentForPoly, 3, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"centroidForPoly\", JSB_cpCentroidForPoly, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\tJS_DefineFunction(cx, chipmunk, \"recenterPoly\", JSB_cpRecenterPoly, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    register_CCPhysicsSprite(cx, object);\n    register_CCPhysicsDebugNode(cx, object);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_registration.h",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n#ifndef __JSB_CHIPMUNK_REGISTRATION\n#define __JSB_CHIPMUNK_REGISTRATION\n\nvoid jsb_register_chipmunk( JSContext *globalC, JSObject *globalO);\n\n#endif // __JSB_CHIPMUNK_REGISTRATION\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/libJSBindingForChipmunk.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"js_bindings_chipmunk_auto_classes.h\" />\n    <ClInclude Include=\"js_bindings_chipmunk_auto_classes_registration.h\" />\n    <ClInclude Include=\"js_bindings_chipmunk_functions.h\" />\n    <ClInclude Include=\"js_bindings_chipmunk_functions_registration.h\" />\n    <ClInclude Include=\"js_bindings_chipmunk_manual.h\" />\n    <ClInclude Include=\"js_bindings_chipmunk_registration.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"js_bindings_chipmunk_auto_classes.cpp\" />\n    <ClCompile Include=\"js_bindings_chipmunk_functions.cpp\" />\n    <ClCompile Include=\"js_bindings_chipmunk_manual.cpp\" />\n    <ClCompile Include=\"js_bindings_chipmunk_registration.cpp\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{21070E58-EEC6-4E16-8B4F-6D083DF55790}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForChipmunk</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/chipmunk/libJSBindingForChipmunk.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"js_bindings_chipmunk_auto_classes_registration.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_chipmunk_functions.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_chipmunk_functions_registration.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_chipmunk_manual.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_chipmunk_registration.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_chipmunk_auto_classes.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"js_bindings_chipmunk_functions.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"js_bindings_chipmunk_manual.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"js_bindings_chipmunk_registration.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"js_bindings_chipmunk_auto_classes.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocos2d_specifics.cpp",
    "content": "#include \"cocos2d.h\"\n#include \"cocos2d_specifics.hpp\"\n#include <typeinfo>\n#include \"js_bindings_config.h\"\n#include \"jsb_cocos2dx_auto.hpp\"\n\nusing namespace cocos2d;\n\n\nschedFunc_proxy_t *_schedFunc_target_ht = NULL;\nschedTarget_proxy_t *_schedObj_target_ht = NULL;\n\nJSTouchDelegate::TouchDelegateMap JSTouchDelegate::sTouchDelegateMap;\n\nJSTouchDelegate::JSTouchDelegate()\n: _obj(nullptr)\n, _needUnroot(false)\n, _touchListenerAllAtOnce(nullptr)\n, _touchListenerOneByOne(nullptr)\n{\n}\n\nJSTouchDelegate::~JSTouchDelegate()\n{\n    CCLOGINFO(\"In the destructor of JSTouchDelegate.\");\n}\n\nvoid JSTouchDelegate::setDelegateForJSObject(JSObject* pJSObj, JSTouchDelegate* pDelegate)\n{\n    CCASSERT(sTouchDelegateMap.find(pJSObj) == sTouchDelegateMap.end(), \"\");\n    sTouchDelegateMap.insert(TouchDelegatePair(pJSObj, pDelegate));\n}\n\nJSTouchDelegate* JSTouchDelegate::getDelegateForJSObject(JSObject* pJSObj)\n{\n    JSTouchDelegate* pRet = NULL;\n    TouchDelegateMap::iterator iter = sTouchDelegateMap.find(pJSObj);\n    if (iter != sTouchDelegateMap.end())\n    {\n        pRet = iter->second;\n    }\n    return pRet;\n}\n\nvoid JSTouchDelegate::removeDelegateForJSObject(JSObject* pJSObj)\n{\n    TouchDelegateMap::iterator iter = sTouchDelegateMap.find(pJSObj);\n    CCASSERT(iter != sTouchDelegateMap.end(), \"\");\n    sTouchDelegateMap.erase(pJSObj);\n}\n\nvoid JSTouchDelegate::setJSObject(JSObject *obj)\n{\n    _obj = obj;\n    \n    js_proxy_t *p = jsb_get_js_proxy(_obj);\n    if (!p)\n    {\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_AddNamedObjectRoot(cx, &_obj, \"JSB_TouchDelegateTarget, target\");\n        _needUnroot = true;\n    }\n}\n\nvoid JSTouchDelegate::registerStandardDelegate(int priority)\n{\n    auto dispatcher = Director::getInstance()->getEventDispatcher();\n    dispatcher->removeEventListener(_touchListenerAllAtOnce);\n    \n    auto listener = EventListenerTouchAllAtOnce::create();\n    \n    listener->onTouchesBegan = CC_CALLBACK_2(JSTouchDelegate::onTouchesBegan, this);\n    listener->onTouchesMoved = CC_CALLBACK_2(JSTouchDelegate::onTouchesMoved, this);\n    listener->onTouchesEnded = CC_CALLBACK_2(JSTouchDelegate::onTouchesEnded, this);\n    listener->onTouchesCancelled = CC_CALLBACK_2(JSTouchDelegate::onTouchesCancelled, this);\n    \n    dispatcher->addEventListenerWithFixedPriority(listener, priority);\n    \n    _touchListenerAllAtOnce = listener;\n}\n\nvoid JSTouchDelegate::registerTargetedDelegate(int priority, bool swallowsTouches)\n{\n    auto dispatcher = Director::getInstance()->getEventDispatcher();\n    dispatcher->removeEventListener(_touchListenerOneByOne);\n    \n    auto listener = EventListenerTouchOneByOne::create();\n    listener->setSwallowTouches(swallowsTouches);\n    \n    listener->onTouchBegan = CC_CALLBACK_2(JSTouchDelegate::onTouchBegan, this);\n    listener->onTouchMoved = CC_CALLBACK_2(JSTouchDelegate::onTouchMoved, this);\n    listener->onTouchEnded = CC_CALLBACK_2(JSTouchDelegate::onTouchEnded, this);\n    listener->onTouchCancelled = CC_CALLBACK_2(JSTouchDelegate::onTouchCancelled, this);\n    \n    dispatcher->addEventListenerWithFixedPriority(listener, priority);\n    _touchListenerOneByOne = listener;\n}\n\nvoid JSTouchDelegate::unregisterTouchDelegate()\n{\n    if (_needUnroot)\n    {\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_RemoveObjectRoot(cx, &_obj);\n    }\n    \n    auto dispatcher = Director::getInstance()->getEventDispatcher();\n    dispatcher->removeEventListener(_touchListenerAllAtOnce);\n    dispatcher->removeEventListener(_touchListenerOneByOne);\n    \n    this->release();\n}\n\nbool JSTouchDelegate::onTouchBegan(Touch *touch, Event *event)\n{\n    CC_UNUSED_PARAM(event); \n    jsval retval;\n    bool bRet = false;\n    \n    ScriptingCore::getInstance()->executeCustomTouchEvent(EventTouch::EventCode::BEGAN,\n        touch, _obj, retval);\n    \n    if(JSVAL_IS_BOOLEAN(retval))\n    {\n        bRet = JSVAL_TO_BOOLEAN(retval);\n    } \n\n    return bRet;\n};\n// optional\n\nvoid JSTouchDelegate::onTouchMoved(Touch *touch, Event *event)\n{\n    CC_UNUSED_PARAM(event);\n\n    ScriptingCore::getInstance()->executeCustomTouchEvent(EventTouch::EventCode::MOVED,\n        touch, _obj);\n}\n\nvoid JSTouchDelegate::onTouchEnded(Touch *touch, Event *event)\n{\n    CC_UNUSED_PARAM(event);\n\n    ScriptingCore::getInstance()->executeCustomTouchEvent(EventTouch::EventCode::ENDED,\n        touch, _obj);\n}\n\nvoid JSTouchDelegate::onTouchCancelled(Touch *touch, Event *event)\n{\n    CC_UNUSED_PARAM(event);\n    ScriptingCore::getInstance()->executeCustomTouchEvent(EventTouch::EventCode::CANCELLED,\n        touch, _obj);\n}\n\n// optional\nvoid JSTouchDelegate::onTouchesBegan(const std::vector<Touch*>& touches, Event *event)\n{\n    CC_UNUSED_PARAM(event);\n    ScriptingCore::getInstance()->executeCustomTouchesEvent(EventTouch::EventCode::BEGAN, touches, _obj);\n}\n\nvoid JSTouchDelegate::onTouchesMoved(const std::vector<Touch*>& touches, Event *event)\n{\n    CC_UNUSED_PARAM(event);\n    ScriptingCore::getInstance()->executeCustomTouchesEvent(EventTouch::EventCode::MOVED, touches, _obj);\n}\n\nvoid JSTouchDelegate::onTouchesEnded(const std::vector<Touch*>& touches, Event *event)\n{\n    CC_UNUSED_PARAM(event);\n    ScriptingCore::getInstance()->executeCustomTouchesEvent(EventTouch::EventCode::ENDED, touches, _obj);\n}\n\nvoid JSTouchDelegate::onTouchesCancelled(const std::vector<Touch*>& touches, Event *event)\n{\n    CC_UNUSED_PARAM(event);\n    ScriptingCore::getInstance()->executeCustomTouchesEvent(EventTouch::EventCode::CANCELLED, touches, _obj);\n}\n\nstatic void addCallBackAndThis(JSObject *obj, jsval callback, jsval &thisObj)\n{\n    if(callback != JSVAL_VOID) {\n        ScriptingCore::getInstance()->setReservedSpot(0, obj, callback);\n    }\n    if(thisObj != JSVAL_VOID) {\n        ScriptingCore::getInstance()->setReservedSpot(1, obj, thisObj);\n    }\n}\n\ntemplate<class T>\nJSObject* bind_menu_item(JSContext *cx, T* nativeObj, jsval callback, jsval thisObj) {    \n\tjs_proxy_t *p = jsb_get_native_proxy(nativeObj);\n\tif (p) {\n\t\taddCallBackAndThis(p->obj, callback, thisObj);\n\t\treturn p->obj;\n\t} else {\n\t\tjs_type_class_t *classType = js_get_type_from_native<T>(nativeObj);\n\t\tassert(classType);\n\t\tJSObject *tmp = JS_NewObject(cx, classType->jsclass, classType->proto, classType->parentProto);\n\n\t\t// bind nativeObj <-> JSObject\n\t\tjs_proxy_t *proxy = jsb_new_proxy(nativeObj, tmp);\n\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, typeid(*nativeObj).name());        \n\t\taddCallBackAndThis(tmp, callback, thisObj);\n\n\t\treturn tmp;\n\t}\n}\n\nJSBool js_cocos2dx_CCMenu_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tif (argc > 0) {\n\t\tVector<MenuItem*> items;\n\t\tuint32_t i = 0;\n\t\twhile (i < argc) {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\tcocos2d::MenuItem *item = (cocos2d::MenuItem*)(proxy ? proxy->ptr : NULL);\n\t\t\tTEST_NATIVE_OBJECT(cx, item)\n\t\t\titems.pushBack(item);\n\t\t\ti++;\n\t\t}\n\t\tcocos2d::Menu* ret = cocos2d::Menu::createWithArray(items);\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *p = jsb_get_native_proxy(ret);\n\t\t\t\tif (p) {\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(p->obj);\n\t\t\t\t} else {\n\t\t\t\t\t// create a new js obj of that class\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Menu>(cx, ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 0) {\n\t\tcocos2d::Menu* ret = cocos2d::Menu::create();\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *p = jsb_get_native_proxy(ret);\n\t\t\t\tif (p) {\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(p->obj);\n\t\t\t\t} else {\n\t\t\t\t\t// create a new js obj of that class\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Menu>(cx, ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCSequence_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tif (argc > 0) {\n\t\tVector<FiniteTimeAction*> array;\n        if (argc == 1 && JS_IsArrayObject(cx, JSVAL_TO_OBJECT(argv[0]))) {\n            JSBool ok = JS_TRUE;\n            ok &= jsval_to_ccvector(cx, argv[0], &array);\n            JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        } else {\n            uint32_t i = 0;\n            while (i < argc) {\n                js_proxy_t *proxy;\n                JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n                proxy = jsb_get_js_proxy(tmpObj);\n                cocos2d::FiniteTimeAction *item = (cocos2d::FiniteTimeAction*)(proxy ? proxy->ptr : NULL);\n                TEST_NATIVE_OBJECT(cx, item)\n                array.pushBack(item);\n                i++;\n            }\n        }\n\t\tcocos2d::FiniteTimeAction* ret = cocos2d::Sequence::create(array);\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *p = jsb_get_native_proxy(ret);\n\t\t\t\tif (p) {\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(p->obj);\n\t\t\t\t} else {\n\t\t\t\t\t// create a new js obj of that class\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FiniteTimeAction>(cx, ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCSpawn_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tif (argc > 0) {\n\t\tVector<FiniteTimeAction*> array;\n        if (argc == 1 && JS_IsArrayObject(cx, JSVAL_TO_OBJECT(argv[0]))) {\n            JSBool ok = JS_TRUE;\n            ok &= jsval_to_ccvector(cx, argv[0], &array);\n            JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        } else {\n            uint32_t i = 0;\n            while (i < argc) {\n                js_proxy_t *proxy;\n                JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n                proxy = jsb_get_js_proxy(tmpObj);\n                cocos2d::FiniteTimeAction *item = (cocos2d::FiniteTimeAction*)(proxy ? proxy->ptr : NULL);\n                TEST_NATIVE_OBJECT(cx, item)\n                array.pushBack(item);\n                i++;\n            }\n        }\n\t\tcocos2d::FiniteTimeAction* ret = cocos2d::Spawn::create(array);\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *p = jsb_get_native_proxy(ret);\n\t\t\t\tif (p) {\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(p->obj);\n\t\t\t\t} else {\n\t\t\t\t\t// create a new js obj of that class\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::FiniteTimeAction>(cx, ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCMenuItem_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc >= 1) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\t\tcocos2d::MenuItem* ret = cocos2d::MenuItem::create();\n\t\tJSObject *obj = bind_menu_item<cocos2d::MenuItem>(cx, ret, argv[0], argc == 2? argv[1] : JSVAL_VOID);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n// \"create\" in JS\n// cc.MenuItemSprite.create( normalSprite, selectedSprite, [disabledSprite], [callback_fn], [this]\nJSBool js_cocos2dx_CCMenuItemSprite_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc >= 2 && argc <= 5) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\t\tjs_proxy_t *proxy;\n\t\tJSObject *tmpObj;\n\t\t\n\t\ttmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\tcocos2d::Node* arg0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\tTEST_NATIVE_OBJECT(cx, arg0);\n\n\t\ttmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\tcocos2d::Node* arg1 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\tTEST_NATIVE_OBJECT(cx, arg1);\n\n        int last = 2;\n\t\tJSBool thirdArgIsCallback = JS_FALSE;\n\n\t\tjsval jsCallback = JSVAL_VOID;\n\t\tjsval jsThis = JSVAL_VOID;\n\n\t\tcocos2d::Node* arg2 = NULL;\n\t\tif (argc >= 3) {\n\t\t\ttmpObj = JSVAL_TO_OBJECT(argv[2]);\n\t\t\tthirdArgIsCallback = JS_ObjectIsFunction(cx, tmpObj);\n\t\t\tif (!thirdArgIsCallback) { \n\t\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\t\targ2 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\t\t\tTEST_NATIVE_OBJECT(cx, arg2);\n\t\t\t\tlast = 3;\n\t\t\t}\n\t\t}\n\t\tcocos2d::MenuItemSprite* ret = cocos2d::MenuItemSprite::create(arg0, arg1, arg2);\n\t\tif (argc >= 3) { \n\t\t\tif (thirdArgIsCallback) {\n\t\t\t\t//cc.MenuItemSprite.create( normalSprite, selectedSprite, callback_fn, [this] )\n\t\t\t\tjsCallback = argv[last++];\n\t\t\t\tif (argc == 4) {\n\t\t\t\t\tjsThis = argv[last];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { \n\t\t\t\t//cc.MenuItemSprite.create( normalSprite, selectedSprite, disabledSprite, callback_fn, [this] )\n\t\t\t\tif (argc >= 4) {\n\t\t\t\t\tjsCallback = argv[last++];\n\t\t\t\t\tif (argc == 5) {\n\t\t\t\t\t\tjsThis = argv[last];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tJSObject *obj = bind_menu_item<cocos2d::MenuItemSprite>(cx, ret, jsCallback, jsThis);\n\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"Invalid number of arguments. Expecting: 2 <= args <= 5\");\n\treturn JS_FALSE;\n}\n\n// \"create\" in JS\n// cc.MenuItemImage.create( normalImage, selectedImage, [disabledImage], callback_fn, [this] \nJSBool js_cocos2dx_CCMenuItemImage_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc >= 2 && argc <= 5) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\t\tJSStringWrapper arg0(argv[0]);\n\t\tJSStringWrapper arg1(argv[1]);\n\t\tJSStringWrapper arg2;\n\n\t\tbool thirdArgIsString = true;\n\n\t\tjsval jsCallback = JSVAL_VOID;\n\t\tjsval jsThis = JSVAL_VOID;\n\n\t\tint last = 2;\n\t\tif (argc >= 3) {\n\t\t\tthirdArgIsString = argv[2].isString();\n\t\t\tif (thirdArgIsString) {\n\t\t\t\targ2.set(argv[2], cx);\n\t\t\t\tlast = 3;\n\t\t\t}\n\t\t}\n\t\tcocos2d::MenuItemImage* ret = cocos2d::MenuItemImage::create(arg0.get(), arg1.get(), std::string(arg2.get()));\n\n\t\tif (argc >= 3) { \n\t\t\tif (!thirdArgIsString) {\n\t\t\t\t//cc.MenuItemImage.create( normalImage, selectedImage, callback_fn, [this] )\n\t\t\t\tjsCallback = argv[last++];\n\t\t\t\tif (argc == 4) {\n\t\t\t\t\tjsThis = argv[last];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { \n\t\t\t\t//cc.MenuItemImage.create( normalImage, selectedImage, disabledImage, callback_fn, [this] )\n\t\t\t\tif (argc >= 4) {\n\t\t\t\t\tjsCallback = argv[last++];\n\t\t\t\t\tif (argc == 5) {\n\t\t\t\t\t\tjsThis = argv[last];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n        JSObject *obj = bind_menu_item<cocos2d::MenuItemImage>(cx, ret, jsCallback, jsThis);\n\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"Invalid number of arguments. Expecting: 2 <= args <= 5\");\n\treturn JS_FALSE;\n}\n\n// \"create\" in JS:\n// cc.MenuItemLabel.create( label, callback_fn, [this] );\nJSBool js_cocos2dx_CCMenuItemLabel_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc >= 1 && argc <= 3) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\t\tjs_proxy_t *proxy;\n\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\tcocos2d::Node* arg0 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n\t\tTEST_NATIVE_OBJECT(cx, arg0)\n\t\tcocos2d::MenuItemLabel* ret = cocos2d::MenuItemLabel::create(arg0);\n\t\tJSObject *obj = bind_menu_item<cocos2d::MenuItemLabel>(cx, ret, (argc >= 2 ? argv[1] : JSVAL_VOID), (argc == 3 ? argv[2] : JSVAL_VOID) );\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d or %d or %d\", argc, 1, 2, 3);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCMenuItemAtlasFont_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc >= 5) {\n        JSBool ok = JS_TRUE;\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\t\tJSStringWrapper arg0(argv[0]);\n\t\tJSStringWrapper arg1(argv[1]);\n\t\tint arg2; ok &= jsval_to_int32(cx, argv[2], &arg2);\n\t\tint arg3; ok &= jsval_to_int32(cx, argv[3], &arg3);\n\t\tint arg4; ok &= jsval_to_int32(cx, argv[4], &arg4);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tcocos2d::MenuItemAtlasFont* ret = cocos2d::MenuItemAtlasFont::create(arg0.get(), arg1.get(), arg2, arg3, arg4);\n\t\tJSObject *obj = bind_menu_item<cocos2d::MenuItemAtlasFont>(cx, ret, (argc >= 6 ? argv[5] : JSVAL_VOID), (argc == 7 ? argv[6] : JSVAL_VOID));\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n// \"create\" in JS\n// cc.MenuItemFont.create( string, callback_fn, [this] );\nJSBool js_cocos2dx_CCMenuItemFont_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc >= 1 && argc <= 3) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\t\tJSStringWrapper arg0(argv[0]);\n\t\tcocos2d::MenuItemFont* ret = cocos2d::MenuItemFont::create(arg0.get());\n\t\tJSObject *obj = bind_menu_item<cocos2d::MenuItemFont>(cx, ret, (argc >= 2 ? argv[1] : JSVAL_VOID), (argc == 3 ? argv[2] : JSVAL_VOID));\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d or %d or %d\", argc, 1, 2, 3);\n\treturn JS_FALSE;\n}\n\n\nJSBool js_cocos2dx_CCMenuItemToggle_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1) {\n        jsval *argv = JS_ARGV(cx, vp);\n        cocos2d::MenuItemToggle* ret = cocos2d::MenuItemToggle::create();\n\n        for (uint32_t i=0; i < argc; i++) {\n            js_proxy_t *proxy;\n            JSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n            proxy = jsb_get_js_proxy(tmpObj);\n            cocos2d::MenuItem* item = (cocos2d::MenuItem*)(proxy ? proxy->ptr : NULL);\n            TEST_NATIVE_OBJECT(cx, item)\n            ret->addSubItem(item);\n        }\n\n        ret->setSelectedIndex(0);\n        \n        jsval jsret;\n        if (ret) {\n            js_proxy_t *proxy = jsb_get_native_proxy(ret);\n            if (proxy) {\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            } else {\n                // create a new js obj of that class\n                proxy = js_get_or_create_proxy<cocos2d::MenuItemToggle>(cx, ret);\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            }\n        } else {\n            jsret = JSVAL_NULL;\n        }\n        \n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\n// \"setCallback\" in JS\n// item.setCallback( callback_fn, [this]);\ntemplate<class T>\nJSBool js_cocos2dx_setCallback(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if(argc == 1 || argc == 2)\n    {\n        jsval *argv = JS_ARGV(cx, vp);\n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n        jsval jsThis = JSVAL_VOID;\n        jsval jsFunc = argv[0];\n        \n        if (jsFunc.isUndefined())\n        {\n            JS_ReportError(cx, \"The callback function is undefined.\");\n            return JS_FALSE;\n        }\n        \n        if (argc == 2)\n        {\n            jsThis = argv[1];\n        }\n        \n        js_proxy_t *proxy = jsb_get_js_proxy(obj);\n        T* item = (T*)(proxy ? proxy->ptr : NULL);\n        TEST_NATIVE_OBJECT(cx, item)\n        bind_menu_item(cx, item, jsFunc, jsThis);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d or %d\", argc, 1, 2);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCMenuItem_setCallback(JSContext *cx, uint32_t argc, jsval *vp) {\n    return js_cocos2dx_setCallback<cocos2d::MenuItem>(cx, argc, vp);\n}\n\n\nJSBool js_cocos2dx_CCAnimation_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n\tjsval *argv = JS_ARGV(cx, vp);\n\tif (argc <= 3) {\n\t\tcocos2d::Animation* ret = nullptr;\n\t\tdouble arg1 = 0.0f;\n\t\tif (argc == 2) {\n            Vector<SpriteFrame*> arg0;\n            if (argc > 0) {\n                ok &= jsval_to_ccvector(cx, argv[0], &arg0);\n                JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n            }\n            ok &= JS_ValueToNumber(cx, argv[1], &arg1);\n            JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\t\tret = cocos2d::Animation::createWithSpriteFrames(arg0, arg1);\n\t\t} else if (argc == 3) {\n            Vector<AnimationFrame*> arg0;\n            if (argc > 0) {\n                ok &= jsval_to_ccvector(cx, argv[0], &arg0);\n                JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n            }\n\t\t\tunsigned int loops;\n\t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n\t\t\tok &= jsval_to_uint32(cx, argv[2], &loops);\n            JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\t\tret = cocos2d::Animation::create(arg0, arg1, loops);\n\t\t} else if (argc == 1) {\n            Vector<SpriteFrame*> arg0;\n            if (argc > 0) {\n                ok &= jsval_to_ccvector(cx, argv[0], &arg0);\n                JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n            }\n\t\t\tret = cocos2d::Animation::createWithSpriteFrames(arg0);\n\t\t} else if (argc == 0) {\n            ret = cocos2d::Animation::create();\n        }\n\t\tjsval jsret;\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = jsb_get_native_proxy(ret);\n\t\t\tif (proxy) {\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\t// create a new js obj of that class\n\t\t\t\tproxy = js_get_or_create_proxy<cocos2d::Animation>(cx, ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t}\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayerMultiplex_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tVector<Layer*> arg0;\n    JSBool ok = JS_TRUE;\n\tok &= jsvals_variadic_to_ccvector(cx, argv, argc, &arg0);\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n\tcocos2d::LayerMultiplex* ret = cocos2d::LayerMultiplex::createWithArray(arg0);\n\tjsval jsret;\n\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::LayerMultiplex>(cx, ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\tJS_SET_RVAL(cx, vp, jsret);\n\treturn JS_TRUE;\n}\n\nJSBool js_cocos2dx_JSTouchDelegate_registerStandardDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 1 || argc == 2)\n    {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        JSObject* jsobj = NULL;\n\n        JSTouchDelegate *touch = new JSTouchDelegate();\n        \n        int priority = 1;\n        if (argc == 2)\n        {\n            priority = JSVAL_TO_INT(argv[1]);\n        }\n        \n        touch->registerStandardDelegate(priority);\n        \n        jsobj = JSVAL_TO_OBJECT(argv[0]); \n        touch->setJSObject(jsobj);\n        JSTouchDelegate::setDelegateForJSObject(jsobj, touch);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_JSTouchDelegate_registerTargetedDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 3)\n    {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        JSObject* jsobj = NULL;\n\n        JSTouchDelegate *touch = new JSTouchDelegate();\n        touch->registerTargetedDelegate(JSVAL_TO_INT(argv[0]), JSVAL_TO_BOOLEAN(argv[1]));\n        \n        jsobj = JSVAL_TO_OBJECT(argv[2]);\n        touch->setJSObject(jsobj);\n        JSTouchDelegate::setDelegateForJSObject(jsobj, touch);\n\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 3);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_JSTouchDelegate_unregisterTouchDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc == 1) {\n        jsval *argv = JS_ARGV(cx, vp);\n        JSObject* jsobj = JSVAL_TO_OBJECT(argv[0]);\n        JSTouchDelegate* pDelegate = JSTouchDelegate::getDelegateForJSObject(jsobj);\n        if (pDelegate)\n        {\n            pDelegate->unregisterTouchDelegate();\n            JSTouchDelegate::removeDelegateForJSObject(jsobj);\n        }\n        \n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_swap_native_object(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 2) {\n\t\t// get the native object from the second object to the first object\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\t\tJSObject *one = JSVAL_TO_OBJECT(argv[0]);\n\t\tJSObject *two = JSVAL_TO_OBJECT(argv[1]);\n\t\tjs_proxy_t *jsproxy = jsb_get_js_proxy(two);\n\t\tvoid *ptrTwo = (jsproxy ? jsproxy->ptr : NULL);\n\t\tif (jsproxy) {\n\t\t\tjs_proxy_t *nproxy = jsb_get_native_proxy(ptrTwo);\n\t\t\tif (nproxy) {\n                JS_RemoveObjectRoot(cx, &jsproxy->obj);\n\t\t\t\tjsb_remove_proxy(nproxy, jsproxy);\n                jsproxy = jsb_new_proxy(ptrTwo, one);\n                JS_AddNamedObjectRoot(cx, &jsproxy->obj, typeid(*((Object*)jsproxy->ptr)).name());\n\t\t\t}\n\t\t}\n\t}\n\treturn JS_TRUE;\n}\n\nJSObject* getObjectFromNamespace(JSContext* cx, JSObject *ns, const char *name) {\n\tJS::RootedValue out(cx);\n    JSBool ok = JS_TRUE;\n\tif (JS_GetProperty(cx, ns, name, &out) == JS_TRUE) {\n\t\tJSObject *obj;\n\t\tok &= JS_ValueToObject(cx, out, &obj);\n        JSB_PRECONDITION2(ok, cx, NULL, \"Error processing arguments\");\n\t}\n\treturn NULL;\n}\n\njsval anonEvaluate(JSContext *cx, JSObject *thisObj, const char* string) {\n\tjsval out;\n\tif (JS_EvaluateScript(cx, thisObj, string, strlen(string), \"(string)\", 1, &out) == JS_TRUE) {\n\t\treturn out;\n\t}\n\treturn JSVAL_VOID;\n}\n\nJSBool js_platform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSString *str = JS_NewStringCopyZ(cx, \"mobile\");\n\tjsval out = STRING_TO_JSVAL(str);\n\tJS_SET_RVAL(cx, vp, out);\n\treturn JS_TRUE;\n}\n\nJSCallbackWrapper::JSCallbackWrapper()\n: _jsCallback(JSVAL_VOID), _jsThisObj(JSVAL_VOID), _extraData(JSVAL_VOID)\n{\n\n}\n\nJSCallbackWrapper::~JSCallbackWrapper()\n{\n    JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n    JS_RemoveValueRoot(cx, &_jsCallback);\n}\n\nvoid JSCallbackWrapper::setJSCallbackFunc(jsval func) {\n    _jsCallback = func;\n    JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n\t// Root the callback function.\n    JS_AddNamedValueRoot(cx, &_jsCallback, \"JSCallbackWrapper_callback_func\");\n}\n\nvoid JSCallbackWrapper::setJSCallbackThis(jsval thisObj) {\n    _jsThisObj = thisObj;\n}\n\nvoid JSCallbackWrapper::setJSExtraData(jsval data) {\n    _extraData = data;\n}\n\nconst jsval& JSCallbackWrapper::getJSCallbackFunc() const\n{\n    return _jsCallback;\n}\n\nconst jsval& JSCallbackWrapper::getJSCallbackThis() const\n{\n    return _jsThisObj;\n}\n\nconst jsval& JSCallbackWrapper::getJSExtraData() const\n{\n    return _extraData;\n}\n\n// cc.CallFunc.create( func, this, [data])\n// cc.CallFunc.create( func )\nstatic JSBool js_callFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1 && argc <= 3) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n\n        std::shared_ptr<JSCallbackWrapper> tmpCobj(new JSCallbackWrapper());\n        \n        tmpCobj->setJSCallbackFunc(argv[0]);\n        if(argc >= 2) {\n            tmpCobj->setJSCallbackThis(argv[1]);\n        } if(argc == 3) {\n            tmpCobj->setJSExtraData(argv[2]);\n        }\n        \n        CallFuncN *ret = CallFuncN::create([=](Node* sender){\n            const jsval& jsvalThis = tmpCobj->getJSCallbackThis();\n            const jsval& jsvalCallback = tmpCobj->getJSCallbackFunc();\n            const jsval& jsvalExtraData = tmpCobj->getJSExtraData();\n            \n            bool hasExtraData = !JSVAL_IS_VOID(jsvalExtraData);\n            JSObject* thisObj = JSVAL_IS_VOID(jsvalThis) ? nullptr : JSVAL_TO_OBJECT(jsvalThis);\n            \n            JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n            \n            js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, sender);\n            \n            jsval retval;\n            if(jsvalCallback != JSVAL_VOID)\n            {\n                if (hasExtraData)\n                {\n                    jsval valArr[2];\n                    valArr[0] = OBJECT_TO_JSVAL(proxy->obj);\n                    valArr[1] = jsvalExtraData;\n                    \n                    JS_AddValueRoot(cx, valArr);\n                    JS_CallFunctionValue(cx, thisObj, jsvalCallback, 2, valArr, &retval);\n                    JS_RemoveValueRoot(cx, valArr);\n                }\n                else\n                {\n                    jsval senderVal = OBJECT_TO_JSVAL(proxy->obj);\n                    JS_AddValueRoot(cx, &senderVal);\n                    JS_CallFunctionValue(cx, thisObj, jsvalCallback, 1, &senderVal, &retval);\n                    JS_RemoveValueRoot(cx, &senderVal);\n                }\n            }\n            \n            // I think the JSCallFuncWrapper isn't needed.\n            // Since an action will be run by a cc.Node, it will be released at the Node::cleanup.\n            // By James Chen\n            // JSCallFuncWrapper::setTargetForNativeNode(node, (JSCallFuncWrapper *)this);\n        });\n        \n\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::CallFunc>(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(proxy->obj));\n        \n        JS_SetReservedSlot(proxy->obj, 0, argv[0]);\n        if(argc > 1) {\n            JS_SetReservedSlot(proxy->obj, 1, argv[1]);\n        }\n//        if(argc == 3) {\n//            JS_SetReservedSlot(proxy->obj, 2, argv[2]);\n//        }\n        \n      //  test->execute();\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nJSScheduleWrapper::~JSScheduleWrapper()\n{\n    if (_pPureJSTarget) {\n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_RemoveObjectRoot(cx, &_pPureJSTarget);\n    }\n}\n\nvoid JSScheduleWrapper::setTargetForSchedule(jsval sched, JSScheduleWrapper *target) {\n    do {\n        JSObject* jsfunc = JSVAL_TO_OBJECT(sched);\n        Array* targetArray = getTargetForSchedule(sched);\n        if (NULL == targetArray) {\n            targetArray = new Array();\n            targetArray->init();\n            schedFunc_proxy_t *p = (schedFunc_proxy_t *)malloc(sizeof(schedFunc_proxy_t));\n            assert(p);\n            p->jsfuncObj = jsfunc;\n            p->targets = targetArray;\n            HASH_ADD_PTR(_schedFunc_target_ht, jsfuncObj, p);\n        }\n\n        CCASSERT(!targetArray->containsObject(target), \"The target was already added.\");\n\n        targetArray->addObject(target);\n    } while(0);\n}\n\nArray * JSScheduleWrapper::getTargetForSchedule(jsval sched) {\n    schedFunc_proxy_t *t = NULL;\n    JSObject *o = JSVAL_TO_OBJECT(sched);\n    HASH_FIND_PTR(_schedFunc_target_ht, &o, t);\n    return t != NULL ? t->targets : NULL;\n}\n\n\nvoid JSScheduleWrapper::setTargetForJSObject(JSObject* jsTargetObj, JSScheduleWrapper *target)\n{\n    Array* targetArray = getTargetForJSObject(jsTargetObj);\n    if (NULL == targetArray) {\n        targetArray = new Array();\n        targetArray->init();\n        schedTarget_proxy_t *p = (schedTarget_proxy_t *)malloc(sizeof(schedTarget_proxy_t));\n        assert(p);\n        p->jsTargetObj = jsTargetObj;\n        p->targets = targetArray;\n        HASH_ADD_PTR(_schedObj_target_ht, jsTargetObj, p);\n    }\n    \n    CCASSERT(!targetArray->containsObject(target), \"The target was already added.\");\n    targetArray->addObject(target);\n}\n\nArray * JSScheduleWrapper::getTargetForJSObject(JSObject* jsTargetObj)\n{\n    schedTarget_proxy_t *t = NULL;\n    HASH_FIND_PTR(_schedObj_target_ht, &jsTargetObj, t);\n    return t != NULL ? t->targets : NULL;\n}\n\nvoid JSScheduleWrapper::removeAllTargets()\n{\n    CCLOGINFO(\"removeAllTargets begin\");\n    dump();\n    \n    {\n        schedFunc_proxy_t *current, *tmp;\n        HASH_ITER(hh, _schedFunc_target_ht, current, tmp) {\n            current->targets->removeAllObjects();\n            current->targets->release();\n            HASH_DEL(_schedFunc_target_ht, current);\n            free(current);\n        }\n    }\n    \n    {\n        schedTarget_proxy_t *current, *tmp;\n        HASH_ITER(hh, _schedObj_target_ht, current, tmp) {\n            current->targets->removeAllObjects();\n            current->targets->release();\n            HASH_DEL(_schedObj_target_ht, current);\n            free(current);\n        }\n    }\n    \n    dump();\n    CCLOGINFO(\"removeAllTargets end\");\n}\n\nvoid JSScheduleWrapper::removeAllTargetsForMinPriority(int minPriority)\n{\n    CCLOGINFO(\"removeAllTargetsForPriority begin\");\n    dump();\n    \n    {\n        schedFunc_proxy_t *current, *tmp;\n        HASH_ITER(hh, _schedFunc_target_ht, current, tmp) {\n            std::vector<Object*> objectsNeedToBeReleased;\n            Array* targets = current->targets;\n            Object* pObj = NULL;\n            CCARRAY_FOREACH(targets, pObj)\n            {\n                JSScheduleWrapper* wrapper = static_cast<JSScheduleWrapper*>(pObj);\n                bool isUpdateSchedule = wrapper->isUpdateSchedule();\n                if (!isUpdateSchedule || (isUpdateSchedule && wrapper->getPriority() >= minPriority))\n                {\n                    objectsNeedToBeReleased.push_back(pObj);\n                }\n            }\n            \n            std::vector<Object*>::iterator iter = objectsNeedToBeReleased.begin();\n            for (; iter != objectsNeedToBeReleased.end(); ++iter)\n            {\n                targets->removeObject(*iter, true);\n            }\n            \n            if (targets->count() == 0)\n            {\n                HASH_DEL(_schedFunc_target_ht, current);\n                targets->release();\n                free(current);\n            }\n        }\n    }\n    \n    {\n        schedTarget_proxy_t *current, *tmp;\n        HASH_ITER(hh, _schedObj_target_ht, current, tmp) {\n            std::vector<Object*> objectsNeedToBeReleased;\n            Array* targets = current->targets;\n            Object* pObj = NULL;\n            CCARRAY_FOREACH(targets, pObj)\n            {\n                JSScheduleWrapper* wrapper = static_cast<JSScheduleWrapper*>(pObj);\n                bool isUpdateSchedule = wrapper->isUpdateSchedule();\n                if (!isUpdateSchedule || (isUpdateSchedule && wrapper->getPriority() >= minPriority))\n                {\n                    CCLOG(\"isUpdateSchedule2:%d\", isUpdateSchedule);\n                    objectsNeedToBeReleased.push_back(pObj);\n                }\n            }\n            \n            auto iter = objectsNeedToBeReleased.begin();\n            for (; iter != objectsNeedToBeReleased.end(); ++iter)\n            {\n                targets->removeObject(*iter, true);\n            }\n            \n            if (targets->count() == 0)\n            {\n                HASH_DEL(_schedObj_target_ht, current);\n                targets->release();\n                free(current);\n            }\n        }\n    }\n    \n    dump();\n    CCLOGINFO(\"removeAllTargetsForPriority end\");\n}\n\nvoid JSScheduleWrapper::removeAllTargetsForJSObject(JSObject* jsTargetObj)\n{\n    CCLOGINFO(\"removeAllTargetsForNatiaveNode begin\");\n    dump();\n    Array* removeNativeTargets = NULL;\n    schedTarget_proxy_t *t = NULL;\n    HASH_FIND_PTR(_schedObj_target_ht, &jsTargetObj, t);\n    if (t != NULL) {\n        removeNativeTargets = t->targets;\n        HASH_DEL(_schedObj_target_ht, t);\n    }\n\n    if (removeNativeTargets == NULL) return;\n\n    schedFunc_proxy_t *current, *tmp;\n    HASH_ITER(hh, _schedFunc_target_ht, current, tmp) {\n        std::vector<Object*> objectsNeedToBeReleased;\n        Array* targets = current->targets;\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(targets, pObj)\n        {\n            if (removeNativeTargets->containsObject(pObj))\n            {\n                objectsNeedToBeReleased.push_back(pObj);\n            }\n        }\n        \n        auto iter = objectsNeedToBeReleased.begin();\n        for (; iter != objectsNeedToBeReleased.end(); ++iter)\n        {\n            targets->removeObject(*iter, true);\n        }\n\n        if (targets->count() == 0)\n        {\n            HASH_DEL(_schedFunc_target_ht, current);\n            targets->release();\n            free(current);\n        }  \n    }\n\n    removeNativeTargets->removeAllObjects();\n    removeNativeTargets->release();\n    free(t);\n    dump();\n    CCLOGINFO(\"removeAllTargetsForNatiaveNode end\");\n}\n\nvoid JSScheduleWrapper::removeTargetForJSObject(JSObject* jsTargetObj, JSScheduleWrapper* target)\n{\n    CCLOGINFO(\"removeTargetForJSObject begin\");\n    dump();\n    schedTarget_proxy_t *t = NULL;\n    HASH_FIND_PTR(_schedObj_target_ht, &jsTargetObj, t);\n    if (t != NULL) {\n        t->targets->removeObject(target);\n        if (t->targets->count() == 0)\n        {\n            t->targets->release();\n            HASH_DEL(_schedObj_target_ht, t);\n            free(t);\n        }\n    }\n\n    schedFunc_proxy_t *current, *tmp, *removed=NULL;\n\n    HASH_ITER(hh, _schedFunc_target_ht, current, tmp) {\n        Array* targets = current->targets;\n        Object* pObj = NULL;\n        \n        CCARRAY_FOREACH(targets, pObj)\n        {\n            JSScheduleWrapper* pOneTarget = static_cast<JSScheduleWrapper*>(pObj);\n            if (pOneTarget == target)\n            {\n                removed = current;\n                break;\n            }\n        }\n        if (removed) break;\n    }\n\n    if (removed)\n    {\n        removed->targets->removeObject(target);\n        if (removed->targets->count() == 0)\n        {\n            removed->targets->release();\n            HASH_DEL(_schedFunc_target_ht, removed);\n            free(removed);\n        }  \n    }\n    dump();\n    CCLOGINFO(\"removeTargetForJSObject end\");\n}\n\nvoid JSScheduleWrapper::dump()\n{\n#if COCOS2D_DEBUG > 1\n    CCLOG(\"\\n---------JSScheduleWrapper dump begin--------------\\n\");\n    CCLOG(\"target hash count = %d, func hash count = %d\", HASH_COUNT(_schedObj_target_ht), HASH_COUNT(_schedFunc_target_ht));\n    schedTarget_proxy_t *current, *tmp;\n    int nativeTargetsCount = 0;\n    HASH_ITER(hh, _schedObj_target_ht, current, tmp) {\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(current->targets, pObj)\n        {\n            CCLOG(\"js target ( %p ), native target[%d]=( %p )\", current->jsTargetObj, nativeTargetsCount, pObj);\n            nativeTargetsCount++;\n        }\n    }\n\n    CCLOG(\"\\n-----------------------------\\n\");\n\n    schedFunc_proxy_t *current_func, *tmp_func;\n    int jsfuncTargetCount = 0;\n    HASH_ITER(hh, _schedFunc_target_ht, current_func, tmp_func) {\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(current_func->targets, pObj)\n        {\n            CCLOG(\"js func ( %p ), native target[%d]=( %p )\", current_func->jsfuncObj, jsfuncTargetCount, pObj);\n            jsfuncTargetCount++;\n        }\n    }\n    CCASSERT(nativeTargetsCount == jsfuncTargetCount, \"\");\n    CCLOG(\"\\n---------JSScheduleWrapper dump end--------------\\n\");\n#endif\n}\n\nvoid JSScheduleWrapper::scheduleFunc(float dt)\n{\n    jsval retval = JSVAL_NULL;\n    jsval data = DOUBLE_TO_JSVAL(dt);\n\n    JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n\n    JSBool ok = JS_AddValueRoot(cx, &data);\n    if (!ok) {\n        CCLOG(\"scheduleFunc: Root value fails.\");\n        return;\n    }\n    \n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n\n    if(!_jsCallback.isNullOrUndefined()) {\n        if (!_jsThisObj.isNullOrUndefined()) {\n            JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(_jsThisObj), _jsCallback, 1, &data, &retval);\n        }\n        else {\n            JS_CallFunctionValue(cx, NULL, _jsCallback, 1, &data, &retval);\n        }\n    }\n\n    JS_RemoveValueRoot(cx, &data);\n}\n\nvoid JSScheduleWrapper::update(float dt)\n{\n    jsval data = DOUBLE_TO_JSVAL(dt);\n    \n    JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n    \n    JSBool ok = JS_AddValueRoot(cx, &data);\n    if (!ok) {\n        CCLOG(\"scheduleFunc: Root value fails.\");\n        return;\n    }\n    \n    ScriptingCore::getInstance()->executeFunctionWithOwner(_jsThisObj, \"update\", 1, &data);\n    \n    JS_RemoveValueRoot(cx, &data);\n}\n\nObject* JSScheduleWrapper::getTarget()\n{\n    return _pTarget;\n}\n\nvoid JSScheduleWrapper::setTarget(Object* pTarget)\n{\n    _pTarget = pTarget;\n}\n\nvoid JSScheduleWrapper::setPureJSTarget(JSObject* pPureJSTarget)\n{\n    CCASSERT(_pPureJSTarget == NULL, \"The pure js target has been set\");\n    JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n    _pPureJSTarget = pPureJSTarget;\n    JS_AddNamedObjectRoot(cx, &_pPureJSTarget, \"Pure JS target\");\n}\n\nJSObject* JSScheduleWrapper::getPureJSTarget()\n{\n    return _pPureJSTarget;\n}\n\nvoid JSScheduleWrapper::setPriority(int priority)\n{\n    _priority = priority;\n}\n\nint  JSScheduleWrapper::getPriority()\n{\n    return _priority;\n}\n\nvoid JSScheduleWrapper::setUpdateSchedule(bool isUpdateSchedule)\n{\n    _isUpdateSchedule = isUpdateSchedule;\n}\n\nbool JSScheduleWrapper::isUpdateSchedule()\n{\n    return _isUpdateSchedule;\n}\n\nJSBool js_CCNode_unschedule(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc == 1) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        \n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\t\tcocos2d::Node *node = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n        JSB_PRECONDITION2(node, cx, JS_FALSE, \"Invalid Native Object\");\n        \n        Scheduler *sched = node->getScheduler();\n        \n        Array* targetArray = JSScheduleWrapper::getTargetForSchedule(argv[0]);\n        CCLOGINFO(\"unschedule target number: %d\", targetArray->count());\n        Object* tmp = NULL;\n        CCARRAY_FOREACH(targetArray, tmp)\n        {\n            JSScheduleWrapper* target = static_cast<JSScheduleWrapper*>(tmp);\n            if (node == target->getTarget())\n            {\n                sched->unscheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), target);\n                JSScheduleWrapper::removeTargetForJSObject(obj, target);\n                break;\n            }\n        }\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    }\n    return JS_TRUE;\n}\n\nJSBool js_cocos2dx_CCNode_unscheduleAllSelectors(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 0)\n    {\n        cobj->unscheduleAllSelectors();\n\n        Array *arr = JSScheduleWrapper::getTargetForJSObject(obj);\n\t\t// If there aren't any targets, just return true.\n\t\t// Otherwise, the for loop will break immediately. \n\t\t// It will lead to logic errors. \n\t\t// For details to reproduce it, please refer to SchedulerTest/SchedulerUpdate.\n        if(! arr) return JS_TRUE;\n        JSScheduleWrapper* wrapper = NULL;\n        for(unsigned int i = 0; i < arr->count(); ++i) {\n            wrapper = (JSScheduleWrapper*)arr->getObjectAtIndex(i);\n            if(wrapper) {\n                cobj->getScheduler()->unscheduleAllForTarget(wrapper);\n            }\n        }\n        \n        JSScheduleWrapper::removeAllTargetsForJSObject(obj);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nJSBool js_CCNode_scheduleOnce(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1) {\n        JSBool ok = JS_TRUE;\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        \n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\t\tcocos2d::Node *node = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n        \n        Scheduler *sched = node->getScheduler();\n        \n        JSScheduleWrapper *tmpCobj = NULL;\n\n        //\n        // delay\n        //\n        double delay;\n        if( argc >= 2 ) {\n            ok &= JS_ValueToNumber(cx, argv[1], &delay );\n            JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        }\n        \n        bool bFound = false;\n        Array* pTargetArr = JSScheduleWrapper::getTargetForJSObject(obj);\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(pTargetArr, pObj)\n        {\n            JSScheduleWrapper* pTarget = static_cast<JSScheduleWrapper*>(pObj);\n            if (argv[0] == pTarget->getJSCallbackFunc())\n            {\n                tmpCobj = pTarget;\n                bFound = true;\n                break;\n            }\n        }\n\n        if (!bFound)\n        {\n            tmpCobj = new JSScheduleWrapper();\n            tmpCobj->autorelease();\n            tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj));\n            tmpCobj->setJSCallbackFunc(argv[0]);\n            tmpCobj->setTarget(node);\n\n            JSScheduleWrapper::setTargetForSchedule(argv[0], tmpCobj);\n            JSScheduleWrapper::setTargetForJSObject(obj, tmpCobj);\n        }\n\n        if(argc == 1) {\n            sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, 0, 0, 0.0f, !node->isRunning());\n        } else {\n            sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, 0, 0, delay, !node->isRunning());\n        }\n\n\t\t/* We shouldn't set the js callback function to reserved slot,\n\t\t   since the target object may execute more than one schedule.\n\t\t   Therefore, previous js callback function will be replaced \n\t\t   by the current one. For example:\n\t\t      this.scheduleOnce(function() { temporary function 1 }, 0.5);\n\t\t      this.scheduleOnce(function() { temporary function 2 }, 0.5);\n\t\t   In this case, the temporary function 1 will be removed from reserved slot 0.\n\t\t   And temporary function 2 will be set to reserved slot 0 of this object.\n\t\t   If gc is triggered before the 'JSScheduleWrapper::scheduleFunc' is invoked, \n\t\t   crash will happen. You could simply reproduce it by adding '__jsc__.garbageCollect();' after scheduleOnce.\n\t\t   \n\t\t   [Solution] Because one schedule corresponds to one JSScheduleWrapper, we root \n\t\t   the js callback function in JSScheduleWrapper::setJSCallbackFunc and unroot it \n\t\t   at the destructor of JSScheduleWrapper.\n\t\t*/\n        //jsb_set_reserved_slot(proxy->obj, 0, argv[0]);\n\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\nJSBool js_CCNode_schedule(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1) {\n        JSBool ok = JS_TRUE;\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        \n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\t\tcocos2d::Node *node = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n        Scheduler *sched = node->getScheduler();\n\n        JSScheduleWrapper *tmpCobj = NULL;\n\n    \tdouble interval = 0.0;\n        if( argc >= 2 ) {\n            ok &= JS_ValueToNumber(cx, argv[1], &interval );\n        }\n        \n        //\n        // repeat\n        //\n        double repeat = 0.0;\n        if( argc >= 3 ) {\n            ok &= JS_ValueToNumber(cx, argv[2], &repeat );\n        }\n        \n        //\n        // delay\n        //\n        double delay = 0.0;\n        if( argc >= 4 ) {\n            ok &= JS_ValueToNumber(cx, argv[3], &delay );\n        }\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        bool bFound = false;\n        Array* pTargetArr = JSScheduleWrapper::getTargetForJSObject(obj);\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(pTargetArr, pObj)\n        {\n            JSScheduleWrapper* pTarget = static_cast<JSScheduleWrapper*>(pObj);\n            if (argv[0] == pTarget->getJSCallbackFunc())\n            {\n                tmpCobj = pTarget;\n                bFound = true;\n                break;\n            }\n        }\n\n        if (!bFound)\n        {\n            tmpCobj = new JSScheduleWrapper();\n            tmpCobj->autorelease();\n            tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj));\n            tmpCobj->setJSCallbackFunc(argv[0]);\n            tmpCobj->setTarget(node);\n            JSScheduleWrapper::setTargetForSchedule(argv[0], tmpCobj);        \n            JSScheduleWrapper::setTargetForJSObject(obj, tmpCobj);\n        }\n        \n        if(argc == 1) {\n            sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, 0, !node->isRunning());\n        } if(argc == 2) {\n            sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, interval, !node->isRunning());\n        } if(argc == 3) {\n            sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, interval, (unsigned int)repeat, 0, !node->isRunning());\n        } if (argc == 4) {\n            sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, interval, (unsigned int)repeat, delay, !node->isRunning());\n        }\n\t\t\n        // I comment next line with the same reason in the js_CCNode_scheduleOnce.\n        //jsb_set_reserved_slot(proxy->obj, 0, argv[0]);\n\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCNode_scheduleUpdateWithPriority(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0 = 0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        JSBool isFoundUpdate = JS_FALSE;\n        ok = JS_HasProperty(cx, obj, \"update\", &isFoundUpdate);\n        JS::RootedValue jsUpdateFunc(cx);\n        if (ok && isFoundUpdate) {\n            ok = JS_GetProperty(cx, obj, \"update\", &jsUpdateFunc);\n        }\n        \n        // if no 'update' property, return JS_TRUE directly.\n        if (!ok) {\n            JS_SET_RVAL(cx, vp, JSVAL_VOID);\n            return JS_TRUE;\n        }\n        \n        JSScheduleWrapper* tmpCobj = NULL;\n        \n        bool bFound = false;\n        Array* pTargetArr = JSScheduleWrapper::getTargetForJSObject(obj);\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(pTargetArr, pObj)\n        {\n            JSScheduleWrapper* pTarget = static_cast<JSScheduleWrapper*>(pObj);\n            if (jsUpdateFunc == pTarget->getJSCallbackFunc())\n            {\n                tmpCobj = pTarget;\n                bFound = true;\n                break;\n            }\n        }\n        \n        if (!bFound)\n        {\n            tmpCobj = new JSScheduleWrapper();\n            tmpCobj->autorelease();\n            tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj));\n            tmpCobj->setJSCallbackFunc(jsUpdateFunc);\n            tmpCobj->setTarget(cobj);\n            tmpCobj->setUpdateSchedule(true);\n            JSScheduleWrapper::setTargetForSchedule(jsUpdateFunc, tmpCobj);\n            JSScheduleWrapper::setTargetForJSObject(obj, tmpCobj);\n        }\n        \n        tmpCobj->setPriority(arg0);\n        cobj->getScheduler()->scheduleUpdateForTarget(tmpCobj, arg0, !cobj->isRunning());\n        \n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCNode_unscheduleUpdate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 0)\n    {\n        cobj->unscheduleUpdate();\n        do {\n\t\t\tJSObject *tmpObj = obj;\n            \n            Array *arr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n\t\t\t// If there aren't any targets, just return true.\n\t\t\t// Otherwise, the for loop will break immediately.\n\t\t\t// It will lead to logic errors.\n\t\t\t// For details to reproduce it, please refer to SchedulerTest/SchedulerUpdate.\n            if(! arr) return JS_TRUE;\n            \n            JSScheduleWrapper* wrapper = NULL;\n            for(unsigned int i = 0; i < arr->count(); ++i) {\n                wrapper = (JSScheduleWrapper*)arr->getObjectAtIndex(i);\n                if(wrapper && wrapper->isUpdateSchedule()) {\n                    cobj->getScheduler()->unscheduleUpdateForTarget(wrapper);\n                    CCASSERT(OBJECT_TO_JSVAL(tmpObj) == wrapper->getJSCallbackThis(), \"Wrong target object.\");\n                    JSScheduleWrapper::removeTargetForJSObject(tmpObj, wrapper);\n                    break;\n                }\n            }\n\t\t} while (0);\n        \n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n    }\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCNode_scheduleUpdate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 0) {\n        \n        JSBool isFoundUpdate = JS_FALSE;\n        ok = JS_HasProperty(cx, obj, \"update\", &isFoundUpdate);\n        JS::RootedValue jsUpdateFunc(cx);\n        if (ok && isFoundUpdate) {\n            ok = JS_GetProperty(cx, obj, \"update\", &jsUpdateFunc);\n        }\n        \n        // if no 'update' property, return JS_TRUE directly.\n        if (!ok) {\n            JS_SET_RVAL(cx, vp, JSVAL_VOID);\n            return JS_TRUE;\n        }\n        \n        JSScheduleWrapper* tmpCobj = NULL;\n        \n        bool bFound = false;\n        Array* pTargetArr = JSScheduleWrapper::getTargetForJSObject(obj);\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(pTargetArr, pObj)\n        {\n            JSScheduleWrapper* pTarget = static_cast<JSScheduleWrapper*>(pObj);\n            if (jsUpdateFunc == pTarget->getJSCallbackFunc())\n            {\n                tmpCobj = pTarget;\n                bFound = true;\n                break;\n            }\n        }\n        \n        if (!bFound)\n        {\n            tmpCobj = new JSScheduleWrapper();\n            tmpCobj->autorelease();\n            tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj));\n            tmpCobj->setJSCallbackFunc(jsUpdateFunc);\n            tmpCobj->setTarget(cobj);\n            tmpCobj->setUpdateSchedule(true);\n            JSScheduleWrapper::setTargetForSchedule(jsUpdateFunc, tmpCobj);\n            JSScheduleWrapper::setTargetForJSObject(obj, tmpCobj);\n        }\n        \n        cobj->getScheduler()->scheduleUpdateForTarget(tmpCobj, 0, !cobj->isRunning());\n        \n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCScheduler_unscheduleAllSelectorsForTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 1) {\n\t\tdo {\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n            \n            Array *arr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n\t\t\t// If there aren't any targets, just return true.\n\t\t\t// Otherwise, the for loop will break immediately.\n\t\t\t// It will lead to logic errors.\n\t\t\t// For details to reproduce it, please refer to SchedulerTest/SchedulerUpdate.\n            if(! arr) return JS_TRUE;\n            \n            JSScheduleWrapper* wrapper = NULL;\n            for(unsigned int i = 0; i < arr->count(); ++i) {\n                wrapper = (JSScheduleWrapper*)arr->getObjectAtIndex(i);\n                if(wrapper) {\n                    cobj->unscheduleAllForTarget(wrapper);\n                }\n            }\n            JSScheduleWrapper::removeAllTargetsForJSObject(tmpObj);\n            \n\t\t} while (0);\n        \n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_CCScheduler_scheduleUpdateForTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1) {\n        JSBool ok = JS_TRUE;\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        \n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\t\tcocos2d::Scheduler *sched = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n        \n        JSScheduleWrapper *tmpCObj = NULL;\n        \n        JSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n        proxy = jsb_get_js_proxy(tmpObj);\n        bool isPureJSTarget = proxy ? false : true;\n        \n        JSBool isFoundUpdate = JS_FALSE;\n        ok = JS_HasProperty(cx, tmpObj, \"update\", &isFoundUpdate);\n        JS::RootedValue jsUpdateFunc(cx);\n        if (ok && isFoundUpdate) {\n            ok = JS_GetProperty(cx, tmpObj, \"update\", &jsUpdateFunc);\n        }\n        \n        // if no 'update' property, return JS_TRUE directly.\n        if (!ok) {\n            JS_SET_RVAL(cx, vp, JSVAL_VOID);\n            return JS_TRUE;\n        }\n        \n        int arg1 = 0;\n        if (argc >= 2) {\n            ok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n        }\n\n        JSBool paused = JS_FALSE;\n        \n        if( argc >= 3 ) {\n            ok &= JS_ValueToBoolean(cx,  argv[2], &paused);\n        }\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        bool bFound = false;\n        Array* pTargetArr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(pTargetArr, pObj)\n        {\n            JSScheduleWrapper* pTarget = static_cast<JSScheduleWrapper*>(pObj);\n            if (jsUpdateFunc == pTarget->getJSCallbackFunc())\n            {\n                tmpCObj = pTarget;\n                bFound = true;\n                break;\n            }\n        }\n        \n        if (!bFound)\n        {\n            tmpCObj = new JSScheduleWrapper();\n            tmpCObj->autorelease();\n            tmpCObj->setJSCallbackThis(argv[0]);\n            tmpCObj->setJSCallbackFunc(jsUpdateFunc);\n            tmpCObj->setUpdateSchedule(true);\n            if (isPureJSTarget) {\n                tmpCObj->setPureJSTarget(tmpObj);\n            }\n            \n            JSScheduleWrapper::setTargetForSchedule(jsUpdateFunc, tmpCObj);\n            JSScheduleWrapper::setTargetForJSObject(tmpObj, tmpCObj);\n        }\n        tmpCObj->setPriority(arg1);\n        sched->scheduleUpdateForTarget(tmpCObj, arg1, paused);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\nJSBool js_CCScheduler_unscheduleUpdateForTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 1) {\n\t\tdo {\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n            \n            Array *arr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n\t\t\t// If there aren't any targets, just return true.\n\t\t\t// Otherwise, the for loop will break immediately.\n\t\t\t// It will lead to logic errors.\n\t\t\t// For details to reproduce it, please refer to SchedulerTest/SchedulerUpdate.\n            if(! arr) return JS_TRUE;\n            \n            JSScheduleWrapper* wrapper = NULL;\n            for(unsigned int i = 0; i < arr->count(); ++i) {\n                wrapper = (JSScheduleWrapper*)arr->getObjectAtIndex(i);\n                if(wrapper && wrapper->isUpdateSchedule()) {\n                    cobj->unscheduleUpdateForTarget(wrapper);\n                    CCASSERT(argv[0] == wrapper->getJSCallbackThis(), \"Wrong target object.\");\n                    JSScheduleWrapper::removeTargetForJSObject(tmpObj, wrapper);\n                    break;\n                }\n            }\n\t\t} while (0);\n        \n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_CCScheduler_schedule(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 2) {\n        JSBool ok = JS_TRUE;\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        \n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\t\tcocos2d::Scheduler *sched = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n        \n        JSScheduleWrapper *tmpCObj = NULL;\n        \n        JSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n        proxy = jsb_get_js_proxy(tmpObj);\n        bool isPureJSTarget = proxy ? false : true;\n        \n    \tdouble interval = 0;\n        if( argc >= 3 ) {\n            ok &= JS_ValueToNumber(cx, argv[2], &interval );\n        }\n        \n        //\n        // repeat\n        //\n        double repeat = kRepeatForever;\n        if( argc >= 4 ) {\n            ok &= JS_ValueToNumber(cx, argv[3], &repeat );\n        }\n        \n        //\n        // delay\n        //\n        double delay = 0;\n        if( argc >= 5 ) {\n            ok &= JS_ValueToNumber(cx, argv[4], &delay );\n        }\n        \n        JSBool paused = JS_FALSE;\n        \n        if( argc >= 6 ) {\n            ok &= JS_ValueToBoolean(cx,  argv[5], &paused);\n        }\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        bool bFound = false;\n        Array* pTargetArr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n        Object* pObj = NULL;\n        CCARRAY_FOREACH(pTargetArr, pObj)\n        {\n            JSScheduleWrapper* pTarget = static_cast<JSScheduleWrapper*>(pObj);\n            if (argv[1] == pTarget->getJSCallbackFunc())\n            {\n                tmpCObj = pTarget;\n                bFound = true;\n                break;\n            }\n        }\n\n        if (!bFound)\n        {\n            tmpCObj = new JSScheduleWrapper();\n            tmpCObj->autorelease();\n            tmpCObj->setJSCallbackThis(argv[0]);\n            tmpCObj->setJSCallbackFunc(argv[1]);\n            if (isPureJSTarget) {\n                tmpCObj->setPureJSTarget(tmpObj);\n            }\n            \n            JSScheduleWrapper::setTargetForSchedule(argv[1], tmpCObj);\n            JSScheduleWrapper::setTargetForJSObject(tmpObj, tmpCObj);\n        }\n        \n        sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCObj, interval, repeat, delay, paused);\n                \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\nJSBool js_CCScheduler_unscheduleCallbackForTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 2) {\n\t\tdo {\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n            \n            Array *arr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n\t\t\t// If there aren't any targets, just return true.\n\t\t\t// Otherwise, the for loop will break immediately.\n\t\t\t// It will lead to logic errors.\n\t\t\t// For details to reproduce it, please refer to SchedulerTest/SchedulerUpdate.\n            if(! arr) return JS_TRUE;\n            \n            JSScheduleWrapper* wrapper = NULL;\n            for(unsigned int i = 0; i < arr->count(); ++i) {\n                wrapper = (JSScheduleWrapper*)arr->getObjectAtIndex(i);\n                if(wrapper && wrapper->getJSCallbackFunc() == argv[1]) {\n                    cobj->unscheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), wrapper);\n                    JSScheduleWrapper::removeTargetForJSObject(tmpObj, wrapper);\n                    break;\n                }\n            }\n\t\t} while (0);\n        \n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCScheduler_unscheduleAll(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 0) {\n        cobj->unscheduleAll();\n        JSScheduleWrapper::removeAllTargets();\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCScheduler_unscheduleAllCallbacksWithMinPriority(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tcobj->unscheduleAllWithMinPriority(arg0);\n        JSScheduleWrapper::removeAllTargetsForMinPriority(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nJSBool js_cocos2dx_CCScheduler_pauseTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::Scheduler *sched = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n    \n\tif (argc == 1) {\n\t\tdo {\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n            Array *arr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n            if(! arr) return JS_TRUE;\n            for(unsigned int i = 0; i < arr->count(); ++i) {\n                if(arr->getObjectAtIndex(i)) {\n                    sched->pauseTarget(arr->getObjectAtIndex(i));\n                }\n            }\n\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCScheduler_resumeTarget(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::Scheduler *sched = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n    \n\tif (argc == 1) {\n\t\tdo {\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n            Array *arr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n            if(! arr) return JS_TRUE;\n            for(unsigned int i = 0; i < arr->count(); ++i) {\n                if(arr->getObjectAtIndex(i)) {\n                    sched->resumeTarget(arr->getObjectAtIndex(i));\n                }\n            }\n            \n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCScheduler_isTargetPaused(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Scheduler* cobj = (cocos2d::Scheduler *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 1) {\n        JSBool ret = JS_FALSE;\n\t\tdo {\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n            Array *arr = JSScheduleWrapper::getTargetForJSObject(tmpObj);\n            if(! arr) return JS_TRUE;\n            for(unsigned int i = 0; i < arr->count(); ++i) {\n                if(arr->getObjectAtIndex(i)) {\n                    ret = cobj->isTargetPaused(arr->getObjectAtIndex(i)) ? JS_TRUE : JS_FALSE;\n                    // break directly since all targets have the same `pause` status.\n                    break;\n                }\n            }\n\t\t} while (0);\n        JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(ret));\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_doNothing(JSContext *cx, uint32_t argc, jsval *vp) {\n    return JS_TRUE;\n}\n\nJSBool js_forceGC(JSContext *cx, uint32_t argc, jsval *vp) {\n    JSRuntime *rt = JS_GetRuntime(cx);\n    JS_GC(rt);\n    return JS_TRUE;\n}\n\nJSBool js_cocos2dx_retain(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *thisObj = JS_THIS_OBJECT(cx, vp);\n\tif (thisObj) {\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(thisObj);\n\t\tif (proxy) {\n\t\t\t((Object *)proxy->ptr)->retain();\n\t\t\treturn JS_TRUE;\n\t\t}\n\t}\n    JS_ReportError(cx, \"Invalid Native Object.\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_release(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *thisObj = JS_THIS_OBJECT(cx, vp);\n\tif (thisObj) {\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(thisObj);\n\t\tif (proxy) {\n\t\t\t((Object *)proxy->ptr)->release();\n\t\t\treturn JS_TRUE;\n\t\t}\n\t}\n    JS_ReportError(cx, \"Invalid Native Object.\");\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCNode_setPosition(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    JSBool ok = JS_TRUE;\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n        ok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tcobj->setPosition(arg0);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t} if (argc == 2) {\n        double x;\n        ok &= JS_ValueToNumber(cx, argv[0], &x );\n        double y;\n        ok &= JS_ValueToNumber(cx, argv[1], &y );\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        cobj->setPosition(Point(x,y));\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCNode_setContentSize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    JSBool ok = JS_TRUE;\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 1) {\n\t\tcocos2d::Size arg0;\n        ok &= jsval_to_ccsize(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tcobj->setContentSize(arg0);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t} if (argc == 2) {\n        double width;\n        ok &= JS_ValueToNumber(cx, argv[0], &width );\n        double height;\n        ok &= JS_ValueToNumber(cx, argv[1], &height );\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        cobj->setContentSize(Size(width,height));\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCNode_setAnchorPoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    JSBool ok = JS_TRUE;\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::Node* cobj = (cocos2d::Node *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n        ok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tcobj->setAnchorPoint(arg0);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t} if (argc == 2) {\n        double x;\n        ok &= JS_ValueToNumber(cx, argv[0], &x );\n        double y;\n        ok &= JS_ValueToNumber(cx, argv[1], &y );\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        cobj->setAnchorPoint(Point(x,y));\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCTMXLayer_tileFlagsAt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj;\n    JSBool ok = JS_TRUE;\n\tcocos2d::TMXLayer* cobj;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::ccTMXTileFlags flags = kTMXTileHorizontalFlag;\n\t\tjsval jsret;\n        jsret = UINT_TO_JSVAL((uint32_t)flags);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCTMXLayer_getTiles(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::TMXLayer* cobj = (cocos2d::TMXLayer *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 0) {\n        int* ret = cobj->getTiles();\n        Size size = cobj->getLayerSize();\n        int count = size.width * size.height;\n        JSObject* array = JS_NewInt32Array(cx, count);\n        if (NULL == array) {\n            JS_ReportError(cx, \"Can't allocate enough memory.\");\n            return JS_FALSE;\n        }\n        int32_t* bufdata = (int32_t*)JS_GetArrayBufferViewData(array);\n        memcpy(bufdata, ret, count*sizeof(int32_t));\n        JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(array));\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n\ntemplate<class T>\nJSBool js_BezierActions_create(JSContext *cx, uint32_t argc, jsval *vp) {\n\tjsval *argv = JS_ARGV(cx, vp);\n\n    if (argc == 2) {\n        double t;\n        if( ! JS_ValueToNumber(cx, argv[0], &t) ) {\n            return JS_FALSE;\n        }\n        \n        int num;\n        Point *arr;\n        jsval_to_ccarray_of_CCPoint(cx, argv[1], &arr, &num);\n        \n        ccBezierConfig config;\n        config.controlPoint_1 = arr[0];\n        config.controlPoint_2 = arr[1];\n        config.endPosition = arr[2];\n        \n        T* ret =  T::create(t, config);\n        \n        free(arr);\n\n        jsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *p = jsb_get_native_proxy(ret);\n\t\t\t\tif (p) {\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(p->obj);\n\t\t\t\t} else {\n\t\t\t\t\t// create a new js obj of that class\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<T>(cx, ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\ntemplate<class T>\nJSBool js_CardinalSplineActions_create(JSContext *cx, uint32_t argc, jsval *vp) {\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    \n    if (argc == 3) {\n        double dur;\n        ok &= JS_ValueToNumber(cx, argv[0], &dur);\n        \n        int num;\n        Point *arr;\n        ok &= jsval_to_ccarray_of_CCPoint(cx, argv[1], &arr, &num);\n        \n        double ten;\n        ok &= JS_ValueToNumber(cx, argv[2], &ten);\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        PointArray *points = PointArray::create(num);\n        \n        for( int i=0; i < num;i++) {\n            points->addControlPoint(arr[i]);\n        }\n        \n        T *ret = T::create(dur, points, ten);\n        \n        free(arr);\n        \n        jsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *p = jsb_get_native_proxy(ret);\n\t\t\t\tif (p) {\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(p->obj);\n\t\t\t\t} else {\n\t\t\t\t\t// create a new js obj of that class\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<T>(cx, ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\ntemplate<class T>\nJSBool js_CatmullRomActions_create(JSContext *cx, uint32_t argc, jsval *vp) {\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    \n    if (argc == 2) {\n        double dur;\n        ok &= JS_ValueToNumber(cx, argv[0], &dur);\n        \n        int num;\n        Point *arr;\n        ok &= jsval_to_ccarray_of_CCPoint(cx, argv[1], &arr, &num);\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        PointArray *points = PointArray::create(num);\n        \n        for( int i=0; i < num;i++) {\n            points->addControlPoint(arr[i]);\n        }\n        \n        T *ret = T::create(dur, points);\n        \n        free(arr);\n        \n        jsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *p = jsb_get_native_proxy(ret);\n\t\t\t\tif (p) {\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(p->obj);\n\t\t\t\t} else {\n\t\t\t\t\t// create a new js obj of that class\n\t\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<T>(cx, ret);\n\t\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nJSBool JSB_CCBezierBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {\n    return js_BezierActions_create<cocos2d::BezierBy>(cx, argc, vp);\n}\n\nJSBool JSB_CCBezierTo_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn js_BezierActions_create<cocos2d::BezierTo>(cx, argc, vp);\n}\n\n\nJSBool JSB_CCCardinalSplineBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {\n    return js_CardinalSplineActions_create<cocos2d::CardinalSplineBy>(cx, argc, vp);\n}\n\nJSBool JSB_CCCardinalSplineTo_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {\n    return js_CardinalSplineActions_create<cocos2d::CardinalSplineTo>(cx, argc, vp);\n}\n\nJSBool JSB_CCCatmullRomBy_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {\n    return js_CatmullRomActions_create<cocos2d::CatmullRomBy>(cx, argc, vp);\n}\n\nJSBool JSB_CCCatmullRomTo_actionWithDuration(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn js_CatmullRomActions_create<cocos2d::CatmullRomTo>(cx, argc, vp);\n}\n\nJSBool js_cocos2dx_ccGLEnableVertexAttribs(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n\tjsval *argv = JS_ARGV(cx, vp);\n    \n\tif (argc == 1) {\n\t\tunsigned int arg0;\n\t\tok &= jsval_to_uint32(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        GL::enableVertexAttribs(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_NULL);\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\n\nJSBool js_cocos2dx_ccpAdd(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n\tjsval *argv = JS_ARGV(cx, vp);\n    \n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0 + arg1;\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpDistanceSQ(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n\tjsval *argv = JS_ARGV(cx, vp);\n    \n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\t\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tfloat ret = arg0.getDistanceSq(arg1);\n\t\t\n\t\tjsval jsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpDistance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n\tjsval *argv = JS_ARGV(cx, vp);\n    \n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\t\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tfloat ret = arg0.getDistance(arg1);\n\t\t\n\t\tjsval jsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpClamp(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 3) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n\t\tcocos2d::Point arg2;\n\t\tok &= jsval_to_ccpoint(cx, argv[2], &arg2);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0.getClampPoint(arg1, arg2);\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpLengthSQ(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tfloat ret = arg0.getLengthSq();\n\n\t\tjsval jsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\n\t}\n\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpLength(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n        ok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\t\tfloat ret = arg0.getLength();\n\n\t\tjsval jsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\n\t}\n\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpNeg(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n        ok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = -arg0;\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpSub(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0 - arg1;\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n        \n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpMult(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n        cocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        \n\t\tdouble arg1;\n\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\t\n\t\tPoint ret = arg0 * arg1;\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpMidpoint(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0.getMidpoint(arg1);\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\n\nJSBool js_cocos2dx_ccpDot(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tfloat ret = arg0.dot(arg1);\n\t\t\n\t\tjsval jsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpCross(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tfloat ret = arg0.cross(arg1);\n\t\t\n\t\tjsval jsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpPerp(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0.getPerp();\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nJSBool js_cocos2dx_ccpRPerp(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0.getRPerp();\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nJSBool js_cocos2dx_ccpProject(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0.project(arg1);\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpRotate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 2) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n\t\tcocos2d::Point arg1;\n\t\tok &= jsval_to_ccpoint(cx, argv[1], &arg1);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0.rotate(arg1);\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n        \n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_ccpNormalize(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tif (argc == 1) {\n\t\tcocos2d::Point arg0;\n\t\tok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tPoint ret = arg0.normalize();\n\t\t\n\t\tjsval jsret = ccpoint_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\n\t\treturn JS_TRUE;\n\t}\n\t\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n// setBlendFunc\ntemplate<class T>\nJSBool js_cocos2dx_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj;\n    T* cobj;\n    obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cobj = (T*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    if (argc == 2)\n    {\n        GLenum src, dst;\n        jsval_to_int32(cx, argv[0], (int32_t*)&src);\n        jsval_to_int32(cx, argv[1], (int32_t*)&dst);\n        BlendFunc blendFunc = {src, dst};\n        cobj->setBlendFunc(blendFunc);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCSprite_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    return js_cocos2dx_setBlendFunc<Sprite>(cx, argc, vp);\n}\n\nJSBool js_cocos2dx_CCSpriteBatchNode_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    return js_cocos2dx_setBlendFunc<SpriteBatchNode>(cx, argc, vp);\n}\n\n// JSBool js_cocos2dx_CCMotionStreak_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n// {\n//     return js_cocos2dx_setBlendFunc<MotionStreak>(cx, argc, vp);\n// }\n\nJSBool js_cocos2dx_CCAtlasNode_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    return js_cocos2dx_setBlendFunc<AtlasNode>(cx, argc, vp);\n}\n\nJSBool js_cocos2dx_CCParticleBatchNode_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    return js_cocos2dx_setBlendFunc<ParticleBatchNode>(cx, argc, vp);\n}\n\nJSBool js_cocos2dx_CCLayerColor_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    return js_cocos2dx_setBlendFunc<LayerColor>(cx, argc, vp);\n}\n\nJSBool js_cocos2dx_CCParticleSystem_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    return js_cocos2dx_setBlendFunc<ParticleSystem>(cx, argc, vp);\n}\n\nJSBool js_cocos2dx_CCDrawNode_setBlendFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    return js_cocos2dx_setBlendFunc<DrawNode>(cx, argc, vp);\n}\n\nJSBool js_cocos2dx_CCTexture2D_setTexParameters(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Texture2D* cobj = (Texture2D*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n\n    if (argc == 4)\n    {\n        jsval *argvp = JS_ARGV(cx,vp);\n        JSBool ok = JS_TRUE;\n\n        GLuint arg0, arg1, arg2, arg3;\n\n        ok &= jsval_to_uint32(cx, *argvp++, &arg0);\n        ok &= jsval_to_uint32(cx, *argvp++, &arg1);\n        ok &= jsval_to_uint32(cx, *argvp++, &arg2);\n        ok &= jsval_to_uint32(cx, *argvp++, &arg3);\n\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n        Texture2D::TexParams param = { arg0, arg1, arg2, arg3 };\n\n        cobj->setTexParameters(param);\n\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 4);\n    return JS_FALSE;\t\t\n}\n\nJSBool js_cocos2dx_CCMenu_alignItemsInRows(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    JSBool ok = JS_TRUE;\n    js_proxy_t *proxy = jsb_get_js_proxy(jsthis);\n    Menu* cobj = (Menu*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n\n    jsval *argvp = JS_ARGV(cx,vp);\n\n    ValueVector items;\n    ok &= jsvals_variadic_to_ccvaluevector(cx, argvp, argc, &items);\n    if (ok)\n    {\n        cobj->alignItemsInRowsWithArray(items);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Error in js_cocos2dx_CCMenu_alignItemsInRows\");\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCMenu_alignItemsInColumns(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* jsthis = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    JSBool ok = JS_TRUE;\n    js_proxy_t *proxy = jsb_get_js_proxy(jsthis);\n    Menu* cobj = (Menu*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n\n    jsval *argvp = JS_ARGV(cx,vp);\n\n    ValueVector items;\n    ok &= jsvals_variadic_to_ccvaluevector(cx, argvp, argc, &items);\n    if (ok)\n    {\n        cobj->alignItemsInColumnsWithArray(items);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Error in js_cocos2dx_CCMenu_alignItemsInColumns\");\n    return JS_FALSE;\n}\n\n// FIXME: These are only for v2.x JSB compatibility\nJSBool js_cocos2dx_CCLayer_setTouchPriority(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\treturn JS_TRUE;\n}\n\nstatic int executeScriptTouchHandler(Layer* layer, EventTouch::EventCode eventType, Touch* touch)\n{\n    TouchScriptData data(eventType, layer, touch);\n    ScriptEvent event(kTouchEvent, &data);\n    return ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n }\n\nstatic int executeScriptTouchesHandler(Layer* layer, EventTouch::EventCode eventType, const std::vector<Touch*>& touches)\n{\n    TouchesScriptData data(eventType, layer, touches);\n    ScriptEvent event(kTouchesEvent, &data);\n    return ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n}\n\nstatic void setTouchEnabledForLayer(Layer* layer, bool enabled)\n{\n    auto dict = static_cast<Dictionary*>(layer->getUserObject());\n    if (dict == nullptr)\n    {\n        dict = Dictionary::create();\n        layer->setUserObject(dict);\n    }\n    \n    dict->setObject(Bool::create(enabled), \"touchEnabled\");\n    \n    auto touchListenerAllAtOnce = static_cast<EventListenerTouchAllAtOnce*>(dict->objectForKey(\"touchListenerAllAtOnce\"));\n    auto touchListenerOneByOne = static_cast<EventListenerTouchOneByOne*>(dict->objectForKey(\"touchListenerOneByOne\"));\n    auto touchMode = static_cast<Integer*>(dict->objectForKey(\"touchMode\"));\n    auto swallowTouches = static_cast<Bool*>(dict->objectForKey(\"swallowTouches\"));\n    \n    auto dispatcher = layer->getEventDispatcher();\n    if (touchListenerAllAtOnce != nullptr || touchListenerOneByOne != nullptr)\n    {\n        dispatcher->removeEventListener(touchListenerAllAtOnce);\n        dispatcher->removeEventListener(touchListenerOneByOne);\n        dict->removeObjectForKey(\"touchListenerAllAtOnce\");\n        dict->removeObjectForKey(\"touchListenerOneByOne\");\n        touchListenerAllAtOnce = nullptr;\n        touchListenerOneByOne = nullptr;\n    }\n    \n    if (enabled)\n    {\n        if (touchMode == nullptr || touchMode->getValue() == (int)Touch::DispatchMode::ALL_AT_ONCE)\n        {\n            auto listener = EventListenerTouchAllAtOnce::create();\n            listener->onTouchesBegan = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::BEGAN, touches);\n            };\n            listener->onTouchesMoved = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::MOVED, touches);\n            };\n            listener->onTouchesEnded = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::ENDED, touches);\n            };\n            listener->onTouchesCancelled = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::CANCELLED, touches);\n            };\n            \n            dispatcher->addEventListenerWithSceneGraphPriority(listener, layer);\n            \n            dict->setObject(listener, \"touchListenerAllAtOnce\");\n        }\n        else\n        {\n            auto listener = EventListenerTouchOneByOne::create();\n            listener->setSwallowTouches(swallowTouches ? swallowTouches->getValue() : false);\n            listener->onTouchBegan = [layer](Touch* touch, Event* event) -> bool{\n                return executeScriptTouchHandler(layer, EventTouch::EventCode::BEGAN, touch) == 0 ? false : true;\n            };\n            listener->onTouchMoved = [layer](Touch* touch, Event* event){\n                executeScriptTouchHandler(layer, EventTouch::EventCode::MOVED, touch);\n            };\n            listener->onTouchEnded = [layer](Touch* touch, Event* event){\n                executeScriptTouchHandler(layer, EventTouch::EventCode::ENDED, touch);\n            };\n            listener->onTouchCancelled = [layer](Touch* touch, Event* event){\n                executeScriptTouchHandler(layer, EventTouch::EventCode::CANCELLED, touch);\n            };\n            \n            dispatcher->addEventListenerWithSceneGraphPriority(listener, layer);\n            \n            dict->setObject(listener, \"touchListenerOneByOne\");\n        }\n    }\n}\n\nJSBool js_cocos2dx_CCLayer_setTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 1)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        bool enabled = JSVAL_TO_BOOLEAN(argv[0]);\n        \n        setTouchEnabledForLayer(cobj, enabled);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_isTouchEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 0)\n    {\n        JSBool ret = JS_FALSE;\n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            ret = enabled ? enabled->getValue() : JS_FALSE;\n        }\n        JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(ret));\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_setTouchMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 1)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        int32_t mode = 0;\n        jsval_to_int32(cx, argv[0], &mode);\n        Integer* touchModeObj = nullptr;\n        \n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            cobj->setUserObject(dict);\n        }\n        \n        touchModeObj = static_cast<Integer*>(dict->objectForKey(\"touchMode\"));\n        int32_t touchMode = touchModeObj ? touchModeObj->getValue() : 0;\n        \n        if (touchMode != mode)\n        {\n            dict->setObject(Integer::create(mode), \"touchMode\");\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            if (enabled && enabled->getValue())\n            {\n                setTouchEnabledForLayer(cobj, false);\n                setTouchEnabledForLayer(cobj, true);\n            }\n        }\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_getTouchMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 0)\n    {\n        int32_t ret = 0;\n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict != nullptr)\n        {\n            Integer* mode = static_cast<Integer*>(dict->objectForKey(\"touchMode\"));\n            ret = mode ? mode->getValue() : 0;\n        }\n        JS_SET_RVAL(cx, vp, INT_TO_JSVAL(ret));\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_setSwallowsTouches(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 1)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        bool swallowsTouches = JSVAL_TO_BOOLEAN(argv[0]);\n        Bool* swallowsTouchesObj = nullptr;\n        \n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            cobj->setUserObject(dict);\n        }\n        \n        swallowsTouchesObj = static_cast<Bool*>(dict->objectForKey(\"swallowTouches\"));\n        bool oldSwallowsTouches = swallowsTouchesObj ? swallowsTouchesObj->getValue() : false;\n        \n        if (oldSwallowsTouches != swallowsTouches)\n        {\n            dict->setObject(Integer::create(swallowsTouches), \"swallowTouches\");\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            if (enabled && enabled->getValue())\n            {\n                setTouchEnabledForLayer(cobj, false);\n                setTouchEnabledForLayer(cobj, true);\n            }\n        }\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_isSwallowsTouches(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 0)\n    {\n        JSBool ret = JS_FALSE;\n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* swallowTouches = static_cast<Bool*>(dict->objectForKey(\"swallowTouches\"));\n            ret = swallowTouches ? swallowTouches->getValue() : JS_FALSE;\n        }\n        JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(ret));\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_setKeyboardEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 1)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        bool enabled = JSVAL_TO_BOOLEAN(argv[0]);\n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            cobj->setUserObject(dict);\n        }\n        \n        dict->setObject(Bool::create(enabled), \"keyboardEnabled\");\n        \n        auto keyboardListener = static_cast<EventListenerKeyboard*>(dict->objectForKey(\"keyboardListener\"));\n        \n        auto dispatcher = cobj->getEventDispatcher();\n        dispatcher->removeEventListener(keyboardListener);\n        \n        if (enabled)\n        {\n            auto listener = EventListenerKeyboard::create();\n            listener->onKeyPressed = [cobj](EventKeyboard::KeyCode keyCode, Event* event){\n            \n            };\n            listener->onKeyReleased = [cobj](EventKeyboard::KeyCode keyCode, Event* event){\n                KeypadScriptData data(keyCode, cobj);\n                ScriptEvent scriptEvent(kKeypadEvent,&data);\n                ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n            };\n            \n            dispatcher->addEventListenerWithSceneGraphPriority(listener, cobj);\n            \n            dict->setObject(listener, \"keyboardListener\");\n        }\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_isKeyboardEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 0)\n    {\n        JSBool ret = JS_FALSE;\n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"keyboardEnabled\"));\n            ret = enabled ? enabled->getValue() : JS_FALSE;\n        }\n        JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(ret));\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_setAccelerometerEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 1)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        bool enabled = JSVAL_TO_BOOLEAN(argv[0]);\n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            cobj->setUserObject(dict);\n        }\n        \n        dict->setObject(Bool::create(enabled), \"accelerometerEnabled\");\n        \n        auto accListener = static_cast<EventListenerAcceleration*>(dict->objectForKey(\"accListener\"));\n        \n        auto dispatcher = cobj->getEventDispatcher();\n        dispatcher->removeEventListener(accListener);\n        \n        Device::setAccelerometerEnabled(enabled);\n        \n        if (enabled)\n        {\n            auto listener = EventListenerAcceleration::create([cobj](Acceleration* acc, Event* event){\n                BasicScriptData data(cobj,(void*)acc);\n                ScriptEvent accEvent(kAccelerometerEvent,&data);\n                ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&accEvent);\n            });\n            \n            dispatcher->addEventListenerWithSceneGraphPriority(listener, cobj);\n            \n            dict->setObject(listener, \"accListener\");\n        }\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_isAccelerometerEnabled(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 0)\n    {\n        JSBool ret = JS_FALSE;\n        auto dict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"accelerometerEnabled\"));\n            ret = enabled ? enabled->getValue() : JS_FALSE;\n        }\n        JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(ret));\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCLayer_setAccelerometerInterval(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    Layer* cobj = (Layer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 1)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        double interval = 0.0;\n        JS_ValueToNumber(cx, argv[0], &interval);\n        \n        Device::setAccelerometerInterval(interval);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\n\n// TMXLayer\nJSBool js_cocos2dx_CCTMXLayer_getTileFlagsAt(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    JSObject *obj;\n    TMXLayer* cobj;\n    obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cobj = (TMXLayer*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    if (argc == 1)\n    {\n        ccTMXTileFlags flags;\n        Point arg0;\n        ok &= jsval_to_ccpoint(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        cobj->getTileGIDAt(arg0, &flags);\n        \n        JS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)flags));\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n    return JS_FALSE;\n}\n\n//#pragma mark - DrawNode\n\n// Arguments: Array of points, fill color (Color4F), width(float), border color (Color4F)\n// Ret value: void\nJSBool js_cocos2dx_CCDrawNode_drawPolygon(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject* obj = (JSObject *)JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    DrawNode* cobj = (DrawNode*)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n\n    if ( argc == 4) {\n        jsval *argvp = JS_ARGV(cx,vp);\n        JSBool ok = JS_TRUE;\n        JSObject *argArray = NULL;\n        Color4F argFillColor = Color4F(0.0f, 0.0f, 0.0f, 0.0f);\n        double argWidth = 0.0;\n        Color4F argBorderColor = Color4F(0.0f, 0.0f, 0.0f, 0.0f);\n\n        // Points\n        ok &= JS_ValueToObject(cx, *argvp++, &argArray);\n        JSB_PRECONDITION2( (argArray && JS_IsArrayObject(cx, argArray)) , cx, JS_FALSE, \"Vertex should be anArray object\");\n\n        // Color 4F\n        ok &= jsval_to_cccolor4f(cx, *argvp++, &argFillColor);\n\n        // Width\n        ok &= JS_ValueToNumber( cx, *argvp++, &argWidth );\n\n        // Color Border (4F)\n        ok &= jsval_to_cccolor4f(cx, *argvp++, &argBorderColor);\n\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error parsing arguments\");\n\n        {\n            uint32_t l;\n            if( ! JS_GetArrayLength(cx, argArray, &l) )\n                return JS_FALSE;\n\n            Point* verts = new Point[ l ];\n            Point p;\n\n            for( uint32_t i=0; i<l; i++ ) {\n                jsval pointvp;\n                ok &= JS_GetElement(cx, argArray, i, &pointvp);\n                JSB_PRECONDITION2(ok, cx, JS_FALSE, \"JS_GetElement fails.\");\n                \n                ok &= jsval_to_ccpoint(cx, pointvp, &p);\n                JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n                verts[i] = p;\n            }\n\n            cobj->drawPolygon(verts, l, argFillColor, argWidth, argBorderColor);\n            CC_SAFE_DELETE_ARRAY(verts);\n        }\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\t\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 4);\n    return JS_FALSE;\n}\n\nstatic JSBool jsval_to_string_vector(JSContext* cx, jsval v, std::vector<std::string>& ret) {\n    JSObject *jsobj;\n    JSBool ok = JS_ValueToObject( cx, v, &jsobj );\n    JSB_PRECONDITION2( ok, cx, JS_FALSE, \"Error converting value to object\");\n\tJSB_PRECONDITION2( jsobj && JS_IsArrayObject( cx, jsobj),  cx, JS_FALSE, \"Object must be an array\");\n    \n    uint32_t len = 0;\n    JS_GetArrayLength(cx, jsobj, &len);\n\n    for (uint32_t i=0; i < len; i++) {\n        jsval elt;\n        if (JS_GetElement(cx, jsobj, i, &elt)) {\n            \n            if (JSVAL_IS_STRING(elt))\n            {\n                JSStringWrapper str(JSVAL_TO_STRING(elt));\n                ret.push_back(str.get());\n            }\n        }\n    }\n\n    return JS_TRUE;\n}\n\n\nstatic jsval string_vector_to_jsval(JSContext* cx, const std::vector<std::string>& arr) {\n    \n    JSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL);\n    \n    int i = 0;\n    for(std::vector<std::string>::const_iterator iter = arr.begin(); iter != arr.end(); ++iter, ++i) {\n        jsval arrElement = c_string_to_jsval(cx, iter->c_str());\n        if(!JS_SetElement(cx, jsretArr, i, &arrElement)) {\n            break;\n        }\n    }\n    return OBJECT_TO_JSVAL(jsretArr);\n}\n\nJSBool js_cocos2dx_CCFileUtils_setSearchResolutionsOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 1) {\n        std::vector<std::string> arg0;\n        ok &= jsval_to_string_vector(cx, argv[0], arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        cobj->setSearchResolutionsOrder(arg0);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCFileUtils_setSearchPaths(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 1) {\n        std::vector<std::string> arg0;\n        ok &= jsval_to_string_vector(cx, argv[0], arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        cobj->setSearchPaths(arg0);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\nJSBool js_cocos2dx_CCFileUtils_getSearchPaths(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 0) {\n        std::vector<std::string> ret = cobj->getSearchPaths();\n        jsval jsret;\n        jsret = string_vector_to_jsval(cx, ret);\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCFileUtils_getByteArrayFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 1) {\n        std::string arg0;\n        ok &= jsval_to_std_string(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n        Data data = cobj->getDataFromFile(arg0);\n        do\n        {\n            if (!data.isNull())\n            {\n                uint32_t size = static_cast<uint32_t>(data.getSize());\n                JSObject* array = JS_NewUint8Array(cx, size);\n                if (nullptr == array)\n                    break;\n\n                uint8_t* bufdata = (uint8_t*)JS_GetArrayBufferViewData(array);\n                memcpy(bufdata, data.getBytes(), size*sizeof(uint8_t));\n                \n                JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(array));\n                return JS_TRUE;\n            }\n        } while(false);\n        \n        JS_ReportError(cx, \"get file(%s) data fails\", arg0.c_str());\n        return JS_FALSE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 3);\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCFileUtils_getSearchResolutionsOrder(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 0) {\n        std::vector<std::string> ret = cobj->getSearchResolutionsOrder();\n        jsval jsret;\n        jsret = string_vector_to_jsval(cx, ret);\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_FileUtils_createDictionaryWithContentsOfFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::FileUtils* cobj = (cocos2d::FileUtils *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 1) {\n\t\tstd::string arg0;\n\t\tok &= jsval_to_std_string(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tcocos2d::ValueMap ret = FileUtils::getInstance()->getValueMapFromFile(arg0.c_str());\n\t\tjsval jsret;\n\t\tjsret = ccvaluemap_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCGLProgram_setUniformLocationWith4f(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    int arg0;\n    double arg1;\n    double arg2;\n    double arg3;\n    double arg4;\n    ok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n    ok &= JS_ValueToNumber(cx, argv[1], &arg1);\n    \n    if(argc == 2) {\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        cobj->setUniformLocationWith1f(arg0, arg1);\n    }\n\tif (argc == 3) {\n        ok &= JS_ValueToNumber(cx, argv[2], &arg2);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tcobj->setUniformLocationWith2f(arg0, arg1, arg2);\n\t}\n    if(argc == 4) {\n        ok &= JS_ValueToNumber(cx, argv[3], &arg3);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tcobj->setUniformLocationWith3f(arg0, arg1, arg2, arg3);\n    }\n    if(argc == 5) {\n        ok &= JS_ValueToNumber(cx, argv[4], &arg4);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\tcobj->setUniformLocationWith4f(arg0, arg1, arg2, arg3, arg4);\n    }\n    \n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 5);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCGLProgram_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n    if(argc != 2) {\n        JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n        return JS_FALSE;\n    }\n    \n    const char *arg0, *arg1;\n    std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n    std::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\n    GLProgram* ret = new GLProgram();\n    ret->autorelease();\n    \n    ret->initWithVertexShaderFilename(arg0, arg1);\n    \n    jsval jsret;\n    do {\n        if (ret) {\n            js_proxy_t *p = jsb_get_native_proxy(ret);\n            if (p) {\n                jsret = OBJECT_TO_JSVAL(p->obj);\n            } else {\n                // create a new js obj of that class\n                js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GLProgram>(cx, ret);\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            }\n        } else {\n            jsret = JSVAL_NULL;\n        }\n    } while (0);\n    JS_SET_RVAL(cx, vp, jsret);\n    return JS_TRUE;\n\n}\n\n\nJSBool js_cocos2dx_CCGLProgram_createWithString(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n    if(argc != 2) {\n        JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 2);\n        return JS_FALSE;\n    }\n    \n    const char *arg0, *arg1;\n    std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n    std::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n    \n    GLProgram* ret = new GLProgram();\n    ret->initWithVertexShaderByteArray(arg0, arg1);\n    \n    jsval jsret;\n    do {\n        if (ret) {\n            js_proxy_t *p = jsb_get_native_proxy(ret);\n            if (p) {\n                jsret = OBJECT_TO_JSVAL(p->obj);\n            } else {\n                // create a new js obj of that class\n                js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::GLProgram>(cx, ret);\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            }\n        } else {\n            jsret = JSVAL_NULL;\n        }\n    } while (0);\n    JS_SET_RVAL(cx, vp, jsret);\n    return JS_TRUE;\n    \n}\n\nJSBool js_cocos2dx_CCGLProgram_getProgram(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::GLProgram* cobj = (cocos2d::GLProgram *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\tif (argc == 0) {\n        GLuint ret = cobj->getProgram();\n        JS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret));\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\n#define js_cocos2dx_CCCamera_getXYZ(funcName) \\\n    JSBool ok = JS_TRUE;                                                                                                  \\\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);                                                                               \\\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);                                                                            \\\n\tcocos2d::Camera* cobj = (cocos2d::Camera *)(proxy ? proxy->ptr : NULL);                                           \\\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");                                                      \\\n\tif (argc == 0) {                                                                                                      \\\n\t\tfloat x;                                                                                                          \\\n\t\tfloat y;                                                                                                          \\\n\t\tfloat z;                                                                                                          \\\n\t\tcobj->funcName(&x, &y, &z);                                                                                       \\\n        JSObject* tmp = JS_NewObject(cx, NULL, NULL, NULL);                                                               \\\n                                                                                                                          \\\n        do                                                                                                                \\\n        {                                                                                                                 \\\n            if (NULL == tmp) break;                                                                                       \\\n                                                                                                                          \\\n            ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&  \\\n            JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&       \\\n            JS_DefineProperty(cx, tmp, \"z\", DOUBLE_TO_JSVAL(z), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);         \\\n                                                                                                                          \\\n            if (ok) {                                                                                                     \\\n                JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(tmp));                                                                \\\n                return JS_TRUE;                                                                                           \\\n            }                                                                                                             \\\n        } while (false);                                                                                                  \\\n                                                                                                                          \\\n\t\tJS_SET_RVAL(cx, vp, JSVAL_NULL);                                                                                  \\\n\t\treturn JS_TRUE;                                                                                                   \\\n\t}                                                                                                                     \\\n                                                                                                                          \\\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);                                       \\\n\treturn JS_FALSE;\n\n\n\nJSBool js_cocos2dx_SpriteBatchNode_getDescendants(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::SpriteBatchNode* cobj = (cocos2d::SpriteBatchNode *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_SpriteBatchNode_getDescendants : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::vector<Sprite*> ret = cobj->getDescendants();\n\t\t\n\t\tJSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL);\n\t\tsize_t vSize = ret.size();\n\t\tjsval jsret;\n\t\tfor (size_t i = 0; i < vSize; i++)\n\t\t{\n\t\t\tproxy = js_get_or_create_proxy<cocos2d::Sprite>(cx, ret[i]);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\tJS_SetElement(cx, jsretArr, static_cast<uint32_t>(i), &jsret);\n\t\t}\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsretArr));\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_cocos2dx_SpriteBatchNode_getDescendants : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_NodeGrid_setGrid(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::NodeGrid* cobj = (cocos2d::NodeGrid *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_NodeGrid_setGrid : Invalid Native Object\");\n    if (argc == 1) {\n        cocos2d::GridBase* arg0;\n        do {\n            if(argv[0].isNull()) { arg0 = nullptr; break;}\n            if (!argv[0].isObject()) { ok = JS_FALSE; break; }\n            JSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]);\n            proxy = jsb_get_js_proxy(tmpObj);\n            arg0 = (cocos2d::GridBase*)(proxy ? proxy->ptr : NULL);\n            JSB_PRECONDITION2( arg0, cx, JS_FALSE, \"Invalid Native Object\");\n        } while (0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_NodeGrid_setGrid : Error processing arguments\");\n        cobj->setGrid(arg0);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"js_cocos2dx_NodeGrid_setGrid : wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\n// cc.SAXParser.getInstance()\nJSBool js_SAXParser_getInstance(JSContext *cx, unsigned argc, JS::Value *vp) {\n    __JSSAXDelegator* delegator = __JSSAXDelegator::getInstance();\n    SAXParser* parser = delegator->getParser();\n    \n    jsval jsret;\n    if (parser) {\n        js_proxy_t *p = jsb_get_native_proxy(parser);\n        if (p) {\n            jsret = OBJECT_TO_JSVAL(p->obj);\n        } else {\n            // create a new js obj of that class\n            js_proxy_t *proxy = js_get_or_create_proxy<SAXParser>(cx, parser);\n            jsret = OBJECT_TO_JSVAL(proxy->obj);\n        }\n    } else {\n        jsret = JSVAL_NULL;\n    }\n    JS_SET_RVAL(cx, vp, jsret);\n    \n    return JS_TRUE;\n}\n// cc.SAXParser.getInstance().parse(filepath)\nJSBool js_SAXParser_parse(JSContext *cx, unsigned argc, JS::Value *vp) {\n    __JSSAXDelegator* delegator = __JSSAXDelegator::getInstance();\n    \n    JSBool ok = JS_TRUE;\n    jsval *argv = JS_ARGV(cx, vp);\n    if (argc == 1) {\n        std::string arg0;\n        ok &= jsval_to_std_string(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        std::string parsedStr = delegator->parse(arg0);\n        jsval strVal = std_string_to_jsval(cx, parsedStr);\n        // create a new js obj of the parsed string\n        JS::RootedValue outVal(cx);\n        ok = JS_ParseJSON(cx, JS_GetStringCharsZ(cx, JSVAL_TO_STRING(strVal)), static_cast<uint32_t>(parsedStr.size()), &outVal);\n        \n        if (ok)\n            JS_SET_RVAL(cx, vp, outVal);\n        else {\n            JS_SET_RVAL(cx, vp, JSVAL_NULL);\n            JS_ReportError(cx, \"js_SAXParser_parse : parse error\");\n        }\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"js_SAXParser_parse : wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n// cc.SAXParser.getInstance().preloadPlist(filepath)\nJSBool js_SAXParser_preloadPlist(JSContext *cx, unsigned argc, JS::Value *vp) {\n    __JSSAXDelegator* delegator = __JSSAXDelegator::getInstance();\n    \n    JSBool ok = JS_TRUE;\n    jsval *argv = JS_ARGV(cx, vp);\n    if (argc == 1) {\n        std::string arg0;\n        ok &= jsval_to_std_string(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        ok &= delegator->preloadPlist(arg0);\n        if(!ok)\n            JS_ReportError(cx, \"js_SAXParser_preloadPlist : file not found %d\", &arg0, 1);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"js_SAXParser_parse : wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n// cc.SAXParser.getInstance().unloadPlist(filepath)\nJSBool js_SAXParser_unloadPlist(JSContext *cx, unsigned argc, JS::Value *vp) {\n    return JS_TRUE;\n}\n// cc.SAXParser.getInstance().getList(key)\nJSBool js_SAXParser_getList(JSContext *cx, unsigned argc, JS::Value *vp) {\n    __JSSAXDelegator* delegator = __JSSAXDelegator::getInstance();\n    \n    JSBool ok = JS_TRUE;\n    jsval *argv = JS_ARGV(cx, vp);\n    if (argc == 1) {\n        std::string arg0;\n        ok &= jsval_to_std_string(cx, argv[0], &arg0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        std::string value = delegator->getList(arg0);\n        jsval ret = std_string_to_jsval(cx, value);\n        JS_SET_RVAL(cx, vp, ret);\n        \n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"js_SAXParser_parse : wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\ncocos2d::SAXParser* __JSSAXDelegator::getParser() {\n    return &_parser;\n}\n\nstd::string __JSSAXDelegator::parse(const std::string& path) {\n    _result.clear();\n    \n    SAXParser parser;\n    if (false != parser.init(\"UTF-8\") )\n    {\n        parser.setDelegator(this);\n        parser.parse(FileUtils::getInstance()->fullPathForFilename(path).c_str());\n    }\n    \n    return _result;\n}\n\n__JSSAXDelegator::~__JSSAXDelegator(){\n    CCLOGINFO(\"deallocing __JSSAXDelegator: %p\", this);\n}\n\nvoid __JSSAXDelegator::startElement(void *ctx, const char *name, const char **atts) {\n    _isStoringCharacters = true;\n    _currentValue.clear();\n    \n    std::string elementName = (char*)name;\n    \n    int end = (int)_result.size() - 1;\n    if(end >= 0 && _result[end] != '{' && _result[end] != '[' && _result[end] != ':') {\n        _result += \",\";\n    }\n    \n    if (elementName == \"dict\") {\n        _result += \"{\";\n    }\n    else if (elementName == \"array\") {\n        _result += \"[\";\n    }\n}\n\nvoid __JSSAXDelegator::endElement(void *ctx, const char *name) {\n    _isStoringCharacters = false;\n    std::string elementName = (char*)name;\n    \n    if (elementName == \"dict\") {\n        _result += \"}\";\n    }\n    else if (elementName == \"array\") {\n        _result += \"]\";\n    }\n    else if (elementName == \"key\") {\n        _result += \"\\\"\" + _currentValue + \"\\\":\";\n    }\n    else if (elementName == \"string\") {\n        _result += \"\\\"\" + _currentValue + \"\\\"\";\n    }\n    else if (elementName == \"false\" || elementName == \"true\") {\n        _result += elementName;\n    }\n    else if (elementName == \"real\" || elementName == \"integer\") {\n        _result += _currentValue;\n    }\n}\n\nvoid __JSSAXDelegator::textHandler(void *ctx, const char *ch, int len) {\n    CC_UNUSED_PARAM(ctx);\n    std::string text((char*)ch, 0, len);\n    \n    if (_isStoringCharacters)\n    {\n        _currentValue += text;\n    }\n}\n\nJSBool jsval_to_TTFConfig(JSContext *cx, jsval v, TTFConfig* ret) {\n    JSObject *tmp;\n    JS::RootedValue js_fontFilePath(cx);\n    JS::RootedValue js_fontSize(cx);\n    JS::RootedValue js_glyphs(cx);\n    JS::RootedValue js_customGlyphs(cx);\n    JS::RootedValue js_distanceFieldEnable(cx);\n\n    std::string fontFilePath,customGlyphs;\n    double fontSize, glyphs;\n    JSBool distanceFieldEnable;\n\n    JSBool ok = v.isObject() &&\n        JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"fontFilePath\", &js_fontFilePath) &&\n        JS_GetProperty(cx, tmp, \"fontSize\", &js_fontSize) &&\n        JS_GetProperty(cx, tmp, \"glyphs\", &js_glyphs) &&\n        JS_GetProperty(cx, tmp, \"customGlyphs\", &js_customGlyphs) &&\n        JS_GetProperty(cx, tmp, \"distanceFieldEnable\", &js_distanceFieldEnable) &&\n        JS_ValueToNumber(cx, js_fontSize, &fontSize) &&\n        JS_ValueToNumber(cx, js_glyphs, &glyphs) &&\n        JS_ValueToBoolean(cx,js_distanceFieldEnable,&distanceFieldEnable) &&\n        jsval_to_std_string(cx,js_fontFilePath,&ret->fontFilePath) &&\n        jsval_to_std_string(cx,js_customGlyphs,&customGlyphs);\n\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    ret->fontSize = (int)fontSize;\n    ret->glyphs = GlyphCollection((int)glyphs);\n    ret->distanceFieldEnabled = distanceFieldEnable;\n    if(ret->glyphs == GlyphCollection::CUSTOM && customGlyphs.length() > 0)\n        ret->customGlyphs = customGlyphs.c_str();\n    else\n        ret->customGlyphs = nullptr;\n\n    return JS_TRUE;\n}\n\nJSBool js_cocos2dx_Label_createWithTTF(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc < 2)\n        return JS_FALSE;\n\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\n    TTFConfig ttfConfig(\"\");\n    std::string text;\n\n    ok &= jsval_to_TTFConfig(cx, argv[0], &ttfConfig);\n    ok &= jsval_to_std_string(cx, argv[1], &text);\n\n    cocos2d::Label* ret = nullptr;\n\n    if (argc == 2) {\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_createWithTTF : Error processing arguments\");\n        ret = cocos2d::Label::createWithTTF(ttfConfig, text);\n        jsval jsret = JSVAL_NULL;\n        if (ret) {\n            js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n            jsret = OBJECT_TO_JSVAL(proxy->obj);\n        }\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    if (argc == 3) {\n        int arg2;\n        ok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_createWithTTF : Error processing arguments\");\n        TextHAlignment alignment = TextHAlignment(arg2);\n        cocos2d::Label* ret = cocos2d::Label::createWithTTF(ttfConfig, text, alignment);\n        jsval jsret = JSVAL_NULL;\n        if (ret) {\n            js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n            jsret = OBJECT_TO_JSVAL(proxy->obj);\n        }\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    if (argc == 4) {\n        int arg2,arg3;\n        ok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n        ok &= jsval_to_int32(cx, argv[3], (int32_t *)&arg3);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_createWithTTF : Error processing arguments\");\n        TextHAlignment alignment = TextHAlignment(arg2);\n        cocos2d::Label* ret = cocos2d::Label::createWithTTF(ttfConfig, text, alignment, arg3);\n        jsval jsret = JSVAL_NULL;\n        if (ret) {\n            js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Label>(cx, (cocos2d::Label*)ret);\n            jsret = OBJECT_TO_JSVAL(proxy->obj);\n        }\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"js_cocos2dx_Label_createWithTTF : wrong number of arguments\");\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_Label_setTTFConfig(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::Label* cobj = (cocos2d::Label *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_cocos2dx_Label_setTTFConfig : Invalid Native Object\");\n\n    if (argc == 1) {\n        TTFConfig ttfConfig(\"\");\n        do {\n            if (!argv[0].isObject()) { ok = JS_FALSE; break; }\n            ok &= jsval_to_TTFConfig(cx, argv[0], &ttfConfig);\n        } while (0);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_cocos2dx_Label_setTTFConfig : Error processing arguments\");\n        cobj->setTTFConfig(ttfConfig);\n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"js_cocos2dx_Label_setTTFConfig : wrong number of arguments\");\n    return JS_FALSE;\n}\n\nvoid register_cocos2dx_js_extensions(JSContext* cx, JSObject* global)\n{\n\t// first, try to get the ns\n    JS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, global, \"cc\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, global, \"cc\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\n\tJS_DefineFunction(cx, global, \"__associateObjWithNative\", js_cocos2dx_swap_native_object, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, global, \"__getPlatform\", js_platform, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n\n\tJSObject *tmpObj;\n    JS_DefineFunction(cx, jsb_cocos2d_Label_prototype, \"createWithTTF\", js_cocos2dx_Label_createWithTTF, 4, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Label_prototype, \"setTTFConfig\", js_cocos2dx_Label_setTTFConfig, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_NodeGrid_prototype, \"setGrid\", js_cocos2dx_NodeGrid_setGrid, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"retain\", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"release\", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    JS_DefineFunction(cx, jsb_cocos2d_GLProgram_prototype, \"retain\", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_GLProgram_prototype, \"release\", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"onExit\", js_doNothing, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"onEnter\", js_doNothing, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"onEnterTransitionDidFinish\", js_doNothing, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"onExitTransitionDidStart\", js_doNothing, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"init\", js_doNothing, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"schedule\", js_CCNode_schedule, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"scheduleOnce\", js_CCNode_scheduleOnce, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"scheduleUpdateWithPriority\", js_cocos2dx_CCNode_scheduleUpdateWithPriority, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"unscheduleUpdate\", js_cocos2dx_CCNode_unscheduleUpdate, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"scheduleUpdate\", js_cocos2dx_CCNode_scheduleUpdate, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"unschedule\", js_CCNode_unschedule, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"unscheduleAllCallbacks\", js_cocos2dx_CCNode_unscheduleAllSelectors, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"setPosition\", js_cocos2dx_CCNode_setPosition, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"setContentSize\", js_cocos2dx_CCNode_setContentSize, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Node_prototype, \"setAnchorPoint\", js_cocos2dx_CCNode_setAnchorPoint, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_GLProgram_prototype, \"setUniformLocationF32\", js_cocos2dx_CCGLProgram_setUniformLocationWith4f, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_GLProgram_prototype, \"getProgram\", js_cocos2dx_CCGLProgram_getProgram, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"resumeTarget\", js_cocos2dx_CCScheduler_resumeTarget, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"pauseTarget\", js_cocos2dx_CCScheduler_pauseTarget, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"scheduleUpdateForTarget\", js_CCScheduler_scheduleUpdateForTarget, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"unscheduleUpdateForTarget\", js_CCScheduler_unscheduleUpdateForTarget, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"scheduleCallbackForTarget\", js_CCScheduler_schedule, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"unscheduleCallbackForTarget\", js_CCScheduler_unscheduleCallbackForTarget, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"unscheduleAllCallbacksForTarget\", js_cocos2dx_CCScheduler_unscheduleAllSelectorsForTarget, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"unscheduleAllCallbacks\", js_cocos2dx_CCScheduler_unscheduleAll, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"unscheduleAllCallbacksWithMinPriority\", js_cocos2dx_CCScheduler_unscheduleAllCallbacksWithMinPriority, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Scheduler_prototype, \"isTargetPaused\", js_cocos2dx_CCScheduler_isTargetPaused, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    JS_DefineFunction(cx, jsb_cocos2d_TMXLayer_prototype, \"getTileFlagsAt\", js_cocos2dx_CCTMXLayer_getTileFlagsAt, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_DrawNode_prototype, \"drawPoly\", js_cocos2dx_CCDrawNode_drawPolygon, 4, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_DrawNode_prototype, \"setBlendFunc\", js_cocos2dx_CCDrawNode_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_Texture2D_prototype, \"setTexParameters\", js_cocos2dx_CCTexture2D_setTexParameters, 4, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Menu_prototype, \"alignItemsInRows\", js_cocos2dx_CCMenu_alignItemsInRows, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Menu_prototype, \"alignItemsInColumns\", js_cocos2dx_CCMenu_alignItemsInColumns, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n\n\tJS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"setTouchPriority\", js_cocos2dx_CCLayer_setTouchPriority, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"setTouchEnabled\", js_cocos2dx_CCLayer_setTouchEnabled, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"isTouchEnabled\", js_cocos2dx_CCLayer_isTouchEnabled, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"setKeyboardEnabled\", js_cocos2dx_CCLayer_setKeyboardEnabled, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"isKeyboardEnabled\", js_cocos2dx_CCLayer_isKeyboardEnabled, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"setTouchMode\", js_cocos2dx_CCLayer_setTouchMode, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"getTouchMode\", js_cocos2dx_CCLayer_getTouchMode, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"setSwallowsTouches\", js_cocos2dx_CCLayer_setSwallowsTouches, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"isSwallowsTouches\", js_cocos2dx_CCLayer_isSwallowsTouches, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"setAccelerometerEnabled\", js_cocos2dx_CCLayer_setAccelerometerEnabled, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"isAccelerometerEnabled\", js_cocos2dx_CCLayer_isAccelerometerEnabled, 0, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_Layer_prototype, \"setAccelerometerInterval\", js_cocos2dx_CCLayer_setAccelerometerInterval, 1, JSPROP_ENUMERATE  | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_FileUtils_prototype, \"setSearchResolutionsOrder\", js_cocos2dx_CCFileUtils_setSearchResolutionsOrder, 1, JSPROP_PERMANENT );\n    JS_DefineFunction(cx, jsb_cocos2d_FileUtils_prototype, \"setSearchPaths\", js_cocos2dx_CCFileUtils_setSearchPaths, 1, JSPROP_PERMANENT );\n    JS_DefineFunction(cx, jsb_cocos2d_FileUtils_prototype, \"getSearchPaths\", js_cocos2dx_CCFileUtils_getSearchPaths, 0, JSPROP_PERMANENT );\n    JS_DefineFunction(cx, jsb_cocos2d_FileUtils_prototype, \"getSearchResolutionsOrder\", js_cocos2dx_CCFileUtils_getSearchResolutionsOrder, 0, JSPROP_PERMANENT );\n\n    JS_DefineFunction(cx, jsb_cocos2d_FileUtils_prototype, \"createDictionaryWithContentsOfFile\", js_cocos2dx_FileUtils_createDictionaryWithContentsOfFile, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    JS_DefineFunction(cx, jsb_cocos2d_FileUtils_prototype, \"getByteArrayFromFile\", js_cocos2dx_CCFileUtils_getByteArrayFromFile, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.BezierBy; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", JSB_CCBezierBy_actionWithDuration, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.BezierTo; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", JSB_CCBezierTo_actionWithDuration, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.CardinalSplineBy; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", JSB_CCCardinalSplineBy_actionWithDuration, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.CardinalSplineTo; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", JSB_CCCardinalSplineTo_actionWithDuration, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.CatmullRomBy; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", JSB_CCCatmullRomBy_actionWithDuration, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.CatmullRomTo; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", JSB_CCCatmullRomTo_actionWithDuration, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    JS_DefineFunction(cx, jsb_cocos2d_Sprite_prototype, \"setBlendFunc\", js_cocos2dx_CCSprite_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_SpriteBatchNode_prototype, \"setBlendFunc\", js_cocos2dx_CCSpriteBatchNode_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_SpriteBatchNode_prototype, \"getDescendants\", js_cocos2dx_SpriteBatchNode_getDescendants, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    //JS_DefineFunction(cx, jsb_cocos2d_MotionStreak_prototype, \"setBlendFunc\", js_cocos2dx_CCMotionStreak_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_AtlasNode_prototype, \"setBlendFunc\", js_cocos2dx_CCAtlasNode_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_ParticleBatchNode_prototype, \"setBlendFunc\", js_cocos2dx_CCParticleBatchNode_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_LayerColor_prototype, \"setBlendFunc\", js_cocos2dx_CCLayerColor_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_ParticleSystem_prototype, \"setBlendFunc\", js_cocos2dx_CCParticleSystem_setBlendFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n\tJS_DefineFunction(cx, jsb_cocos2d_Action_prototype, \"retain\", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_Action_prototype, \"release\", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_Animation_prototype, \"retain\", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_Animation_prototype, \"release\", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_SpriteFrame_prototype, \"retain\", js_cocos2dx_retain, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_SpriteFrame_prototype, \"release\", js_cocos2dx_release, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, jsb_cocos2d_MenuItem_prototype, \"setCallback\", js_cocos2dx_CCMenuItem_setCallback, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_TMXLayer_prototype, \"getTileFlagsAt\", js_cocos2dx_CCTMXLayer_tileFlagsAt, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_TMXLayer_prototype, \"getTiles\", js_cocos2dx_CCTMXLayer_getTiles, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.Menu; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCMenu_create, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.MenuItem; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCMenuItem_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.MenuItemSprite; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCMenuItemSprite_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.MenuItemImage; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCMenuItemImage_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.MenuItemLabel; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCMenuItemLabel_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.MenuItemAtlasFont; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCMenuItemAtlasFont_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.MenuItemFont; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCMenuItemFont_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.MenuItemToggle; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"_create\", js_cocos2dx_CCMenuItemToggle_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.Sequence; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCSequence_create, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.Spawn; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCSpawn_create, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.Animation; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCAnimation_create, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.LayerMultiplex; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCLayerMultiplex_create, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n\tJS_DefineFunction(cx, ns, \"registerTargetedDelegate\", js_cocos2dx_JSTouchDelegate_registerTargetedDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, ns, \"registerStandardDelegate\", js_cocos2dx_JSTouchDelegate_registerStandardDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"unregisterTouchDelegate\", js_cocos2dx_JSTouchDelegate_unregisterTouchDelegate, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.CallFunc; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_callFunc, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.SAXParser; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"getInstance\", js_SAXParser_getInstance, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.SAXParser.getInstance(); })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"parse\", js_SAXParser_parse, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, tmpObj, \"preloadPlist\", js_SAXParser_preloadPlist, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, tmpObj, \"unloadPlist\", js_SAXParser_unloadPlist, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, tmpObj, \"getList\", js_SAXParser_getList, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\n    \n\ttmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.GLProgram; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCGLProgram_create, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, tmpObj, \"createWithString\", js_cocos2dx_CCGLProgram_createWithString, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\n     tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return this; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"garbageCollect\", js_forceGC, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, ns, \"glEnableVertexAttribs\", js_cocos2dx_ccGLEnableVertexAttribs, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pAdd\", js_cocos2dx_ccpAdd, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pDistanceSQ\", js_cocos2dx_ccpDistanceSQ, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pDistance\", js_cocos2dx_ccpDistance, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pSub\", js_cocos2dx_ccpSub, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pNeg\", js_cocos2dx_ccpNeg, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pMult\", js_cocos2dx_ccpMult, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pMidpoint\", js_cocos2dx_ccpMidpoint, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pDot\", js_cocos2dx_ccpDot, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pCross\", js_cocos2dx_ccpCross, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pPerp\", js_cocos2dx_ccpPerp, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pRPerp\", js_cocos2dx_ccpRPerp, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pProject\", js_cocos2dx_ccpProject, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pRotate\", js_cocos2dx_ccpRotate, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pNormalize\", js_cocos2dx_ccpNormalize, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pClamp\", js_cocos2dx_ccpClamp, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n\tJS_DefineFunction(cx, ns, \"pLengthSQ\", js_cocos2dx_ccpLengthSQ, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, ns, \"pLength\", js_cocos2dx_ccpLength, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocos2d_specifics.hpp",
    "content": "#ifndef __JS_COCOS2D_X_SPECIFICS_H__\n#define __JS_COCOS2D_X_SPECIFICS_H__\n\n#include \"jsapi.h\"\n#include \"ScriptingCore.h\"\n#include \"platform/CCSAXParser.h\"\n\nclass JSScheduleWrapper;\n\n// JSScheduleWrapper* --> Array* since one js function may correspond to many targets.\n// To debug this, you could refer to JSScheduleWrapper::dump function.\n// It will prove that i'm right. :)\ntypedef struct jsScheduleFunc_proxy {\n    JSObject* jsfuncObj;\n    cocos2d::Array*  targets;\n    UT_hash_handle hh;\n} schedFunc_proxy_t;\n\ntypedef struct jsScheduleTarget_proxy {\n    JSObject* jsTargetObj;\n    cocos2d::Array*  targets;\n    UT_hash_handle hh;\n} schedTarget_proxy_t;\n\n\ntypedef struct jsCallFuncTarget_proxy {\n    void * ptr;\n    cocos2d::Array *obj;\n    UT_hash_handle hh;\n} callfuncTarget_proxy_t;\n\nextern schedFunc_proxy_t *_schedFunc_target_ht;\nextern schedTarget_proxy_t *_schedObj_target_ht;\n\nextern callfuncTarget_proxy_t *_callfuncTarget_native_ht;\n\n/**\n * You don't need to manage the returned pointer. They live for the whole life of\n * the app.\n */\ntemplate <class T>\ninline js_type_class_t *js_get_type_from_native(T* native_obj) {\n    bool found = false;\n    std::string typeName = typeid(*native_obj).name();\n    auto typeProxyIter = _js_global_type_map.find(typeName);\n    if (typeProxyIter == _js_global_type_map.end())\n    {\n        typeName = typeid(T).name();\n        typeProxyIter = _js_global_type_map.find(typeName);\n        if (typeProxyIter != _js_global_type_map.end())\n        {\n            found = true;\n        }\n    }\n    else\n    {\n        found = true;\n    }\n    return found ? typeProxyIter->second : nullptr;\n}\n\n/**\n * The returned pointer should be deleted using jsb_remove_proxy. Most of the\n * time you do that in the C++ destructor.\n */\ntemplate<class T>\ninline js_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj) {\n    js_proxy_t *proxy;\n    HASH_FIND_PTR(_native_js_global_ht, &native_obj, proxy);\n    if (!proxy) {\n        js_type_class_t *typeProxy = js_get_type_from_native<T>(native_obj);\n        // Return NULL if can't find its type rather than making an assert.\n//        assert(typeProxy);\n        if (!typeProxy) {\n            CCLOGINFO(\"Could not find the type of native object.\");\n            return NULL;\n        }\n        \n        JSObject* js_obj = JS_NewObject(cx, typeProxy->jsclass, typeProxy->proto, typeProxy->parentProto);\n        proxy = jsb_new_proxy(native_obj, js_obj);\n#ifdef DEBUG\n        JS_AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name());\n#else\n        JS_AddObjectRoot(cx, &proxy->obj);\n#endif\n        return proxy;\n    } else {\n        return proxy;\n    }\n    return NULL;\n}\n\njsval anonEvaluate(JSContext *cx, JSObject *thisObj, const char* string);\nvoid register_cocos2dx_js_extensions(JSContext* cx, JSObject* obj);\n\n\nclass JSCallbackWrapper: public cocos2d::Object {\npublic:\n    JSCallbackWrapper();\n    virtual ~JSCallbackWrapper();\n    void setJSCallbackFunc(jsval obj);\n    void setJSCallbackThis(jsval thisObj);\n    void setJSExtraData(jsval data);\n    \n    const jsval& getJSCallbackFunc() const;\n    const jsval& getJSCallbackThis() const;\n    const jsval& getJSExtraData() const;\nprotected:\n    jsval _jsCallback;\n    jsval _jsThisObj;\n    jsval _extraData;\n};\n\n\nclass JSScheduleWrapper: public JSCallbackWrapper {\n    \npublic:\n    JSScheduleWrapper() : _pTarget(NULL), _pPureJSTarget(NULL), _priority(0), _isUpdateSchedule(false) {}\n    virtual ~JSScheduleWrapper();\n\n    static void setTargetForSchedule(jsval sched, JSScheduleWrapper *target);\n    static cocos2d::Array * getTargetForSchedule(jsval sched);\n    static void setTargetForJSObject(JSObject* jsTargetObj, JSScheduleWrapper *target);\n    static cocos2d::Array * getTargetForJSObject(JSObject* jsTargetObj);\n    \n    // Remove all targets.\n    static void removeAllTargets();\n    // Remove all targets for priority.\n    static void removeAllTargetsForMinPriority(int minPriority);\n\t// Remove all targets by js object from hash table(_schedFunc_target_ht and _schedObj_target_ht).\t\n    static void removeAllTargetsForJSObject(JSObject* jsTargetObj);\n\t// Remove the target by js object and the wrapper for native schedule.\n    static void removeTargetForJSObject(JSObject* jsTargetObj, JSScheduleWrapper* target);\n    static void dump();\n\n    void pause();\n    \n    void scheduleFunc(float dt);\n    virtual void update(float dt);\n    \n    Object* getTarget();\n    void setTarget(Object* pTarget);\n    \n    void setPureJSTarget(JSObject* jstarget);\n    JSObject* getPureJSTarget();\n    \n    void setPriority(int priority);\n    int  getPriority();\n    \n    void setUpdateSchedule(bool isUpdateSchedule);\n    bool isUpdateSchedule();\n    \nprotected:\n    Object* _pTarget;\n    JSObject* _pPureJSTarget;\n    int _priority;\n    bool _isUpdateSchedule;\n};\n\n\nclass JSTouchDelegate: public cocos2d::Object\n{\npublic:\n    JSTouchDelegate();\n    ~JSTouchDelegate();\n    \n\t// Set the touch delegate to map by using the key (pJSObj).\n    static void setDelegateForJSObject(JSObject* pJSObj, JSTouchDelegate* pDelegate);\n    // Get the touch delegate by the key (pJSObj).\n\tstatic JSTouchDelegate* getDelegateForJSObject(JSObject* pJSObj);\n\t// Remove the delegate by the key (pJSObj).\n    static void removeDelegateForJSObject(JSObject* pJSObj);\n\n    void setJSObject(JSObject *obj);\n    void registerStandardDelegate(int priority);\n    void registerTargetedDelegate(int priority, bool swallowsTouches);\n\t// unregister touch delegate.\n\t// Normally, developer should invoke cc.unregisterTouchDelegate() in when the scene exits.\n\t// So this function need to be binded.\n    void unregisterTouchDelegate();\n\n    bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event);\n    void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event);\n    void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *event);\n    void onTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *event);\n    \n    // optional\n    void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n    void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n    void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n    void onTouchesCancelled(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);\n\nprivate:\n    JSObject* _obj;\n    typedef std::unordered_map<JSObject*, JSTouchDelegate*> TouchDelegateMap;\n    typedef std::pair<JSObject*, JSTouchDelegate*> TouchDelegatePair;\n    static TouchDelegateMap sTouchDelegateMap;\n    bool _needUnroot;\n    cocos2d::EventListenerTouchOneByOne*  _touchListenerOneByOne;\n    cocos2d::EventListenerTouchAllAtOnce* _touchListenerAllAtOnce;\n};\n\n\nclass CC_DLL __JSSAXDelegator: public cocos2d::SAXDelegator\n{\npublic:\n    static __JSSAXDelegator* getInstance() {\n\t\tstatic __JSSAXDelegator* pInstance = NULL;\n        if (pInstance == NULL) {\n            pInstance = new __JSSAXDelegator();\n        }\n\t\treturn pInstance;\n\t};\n    \n    ~__JSSAXDelegator();\n    \n    cocos2d::SAXParser* getParser();\n    \n    std::string parse(const std::string& path);\n    \n    bool preloadPlist(const std::string& path) {\n        return true;\n    }\n    \n    std::string getList(const std::string& path) {\n        return path;\n    }\n    \n    // implement pure virtual methods of SAXDelegator\n    void startElement(void *ctx, const char *name, const char **atts);\n    void endElement(void *ctx, const char *name);\n    void textHandler(void *ctx, const char *ch, int len);\n\nprivate:\n    cocos2d::SAXParser _parser;\n    JSObject* _obj;\n    std::string _result;\n    bool _isStoringCharacters;\n    std::string _currentValue;\n};\n\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocosbuilder/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_builder_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsbbuilder\n\nLOCAL_SRC_FILES := js_bindings_ccbreader.cpp \\\n                   ../../../auto-generated/js-bindings/jsb_cocos2dx_builder_auto.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../../editor-support/cocosbuilder\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,editor-support/cocosbuilder)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocosbuilder/cocosbuilder_specifics.hpp",
    "content": "#ifndef __JS_COCOSBUILDER_SPECIFICS_H__\n#define __JS_COCOSBUILDER_SPECIFICS_H__\n\n#include \"../cocos2d_specifics.hpp\"\n\nclass JSCCBAnimationWrapper: public JSCallbackWrapper {\npublic:\n    JSCCBAnimationWrapper() {}\n    virtual ~JSCCBAnimationWrapper() {}\n    \n    void animationCompleteCallback() {\n        \n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        jsval retval = JSVAL_NULL;\n        \n        if(!JSVAL_IS_VOID(_jsCallback)  && !JSVAL_IS_VOID(_jsThisObj)) {\n            JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n            \n            JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(_jsThisObj), _jsCallback, 0, NULL, &retval);\n        }\n    }\n    \n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocosbuilder/js_bindings_ccbreader.cpp",
    "content": "//\n//  js_bindings_ccbreader.cpp\n//  watermelon\n//\n//  Created by Rohan Kuruvilla on 14/08/2012.\n//\n//\n\n#include \"js_bindings_ccbreader.h\"\n#include \"ScriptingCore.h\"\n#include \"js_bindings_config.h\"\n\nUSING_NS_CC;\nUSING_NS_CC_EXT;\nusing namespace cocosbuilder;\n\nstatic void removeSelector(std::string &str) {\n    size_t found;\n    found = str.find(\":\");\n    while (found!=std::string::npos){\n        str.replace(found, found+1, \"\");\n        found = str.find(\":\");\n    }\n}\n\nSEL_MenuHandler CCBScriptCallbackProxy::onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget,\n                                                                       const char * pSelectorName) {\n    this->callBackProp = pSelectorName;\n    removeSelector(this->callBackProp);\n    return menu_selector(CCBScriptCallbackProxy::menuItemCallback);\n}\n\nControl::Handler CCBScriptCallbackProxy::onResolveCCBCCControlSelector(Object * pTarget,\n                                                                           const char * pSelectorName) {\n    \n    this->callBackProp = pSelectorName;\n    removeSelector(this->callBackProp);\n    return cccontrol_selector(CCBScriptCallbackProxy::controlCallback);\n}\n\nbool CCBScriptCallbackProxy::onAssignCCBMemberVariable(Object * pTarget,\n                                                       const char * pMemberVariableName,\n                                                       Node * pNode) {\n    return true;\n}\n\nvoid CCBScriptCallbackProxy::onNodeLoaded(Node * pNode,\n                                          NodeLoader * pNodeLoader) {}\n\nCCBSelectorResolver * CCBScriptCallbackProxy::createNew() {\n    CCBScriptCallbackProxy * ret = new CCBScriptCallbackProxy();\n    ret->setJSOwner(this->owner);\n    return dynamic_cast<CCBSelectorResolver *>(ret);\n}\n\nvoid CCBScriptCallbackProxy::menuItemCallback(Object *pSender) {\n    ScriptingCore::getInstance()->executeFunctionWithOwner(owner, callBackProp.c_str() );\n}\n\nvoid CCBScriptCallbackProxy::controlCallback(Object *pSender, Control::EventType event) {\n    ScriptingCore::getInstance()->executeFunctionWithOwner(owner, callBackProp.c_str() );\n}\n\nvoid CCBScriptCallbackProxy::setCallbackProperty(const char *prop) {\n    callBackProp = prop;\n}\n\nvoid CCBScriptCallbackProxy::setJSOwner(jsval ownr) {\n    owner = ownr;\n}\n\njsval CCBScriptCallbackProxy::getJSOwner() {\n    return owner;\n}\n\nJSBool js_cocos2dx_CCBAnimationManager_animationCompleteCallback(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1) {\n\t\tjsval *argv = JS_ARGV(cx, vp);\n        \n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n\t\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\t\tcocosbuilder::CCBAnimationManager *node = (cocosbuilder::CCBAnimationManager *)(proxy ? proxy->ptr : NULL);\n        \n        JSCCBAnimationWrapper *tmpCobj = new JSCCBAnimationWrapper();\n        tmpCobj->autorelease();\n        \n        tmpCobj->setJSCallbackThis(argv[0]);\n        if(argc >= 2) {\n            tmpCobj->setJSCallbackFunc(argv[1]);\n        }\n        \n        node->setAnimationCompletedCallback(tmpCobj, callfunc_selector(JSCCBAnimationWrapper::animationCompleteCallback));\n        \n        JS_SetReservedSlot(proxy->obj, 0, argv[0]);\n        JS_SetReservedSlot(proxy->obj, 1, argv[1]);\n        return JS_TRUE;\n    }\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCBReader_readNodeGraphFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    JSObject *obj;\n    cocosbuilder::CCBReader* cobj;\n    obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n    TEST_NATIVE_OBJECT(cx, cobj)\n    \n    if (argc == 2) {\n        const char* arg0;\n        std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n        cocos2d::Object* arg1;\n        do {\n            js_proxy_t *proxy;\n            JSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n            proxy = jsb_get_js_proxy(tmpObj);\n            arg1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n            TEST_NATIVE_OBJECT(cx, arg1)\n        } while (0);\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n        cocos2d::Node* ret = cobj->readNodeGraphFromFile(arg0, arg1);\n        jsval jsret; do {\n            if (ret) {\n                js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, ret);\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            } else {\n                jsret = JSVAL_NULL;\n            }\n        } while (0);\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    if (argc == 1) {\n        const char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        cocos2d::Node* ret = cobj->readNodeGraphFromFile(arg0);\n        jsval jsret; do {\n            if (ret) {\n                js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, ret);\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            } else {\n                jsret = JSVAL_NULL;\n            }\n        } while (0);\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    if (argc == 3) {\n        const char* arg0;\n        std::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n        cocos2d::Object* arg1;\n        do {\n            js_proxy_t *proxy;\n            JSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n            proxy = jsb_get_js_proxy(tmpObj);\n            arg1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n            TEST_NATIVE_OBJECT(cx, arg1)\n        } while (0);\n        cocos2d::Size arg2;\n        ok &= jsval_to_ccsize(cx, argv[2], &arg2);\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n        cocos2d::Node* ret = cobj->readNodeGraphFromFile(arg0, arg1, arg2);\n        jsval jsret; do {\n            if (ret) {\n                js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Node>(cx, ret);\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            } else {\n                jsret = JSVAL_NULL;\n            }\n        } while (0);\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n\tJSObject *obj;\n\tcocosbuilder::CCBReader* cobj;\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (cocosbuilder::CCBReader *)(proxy ? proxy->ptr : NULL);\n\tTEST_NATIVE_OBJECT(cx, cobj)\n    \n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tcocos2d::Object* arg1;\n\t\tdo {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tTEST_NATIVE_OBJECT(cx, arg1)\n\t\t} while (0);\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tcocos2d::Scene* ret = cobj->createSceneWithNodeGraphFromFile(arg0, arg1);\n\t\tjsval jsret; do {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tcocos2d::Scene* ret = cobj->createSceneWithNodeGraphFromFile(arg0);\n\t\tjsval jsret; do {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 3) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tcocos2d::Object* arg1;\n\t\tdo {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[1]);\n\t\t\tproxy = jsb_get_js_proxy(tmpObj);\n\t\t\targ1 = (cocos2d::Object*)(proxy ? proxy->ptr : NULL);\n\t\t\tTEST_NATIVE_OBJECT(cx, arg1)\n\t\t} while (0);\n\t\tcocos2d::Size arg2;\n        ok &= jsval_to_ccsize(cx, argv[2], &arg2);\n        \n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n        \n\t\tcocos2d::Scene* ret = cobj->createSceneWithNodeGraphFromFile(arg0, arg1, arg2);\n\t\tjsval jsret; do {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::Scene>(cx, ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    \n    return JS_FALSE;\n}\n\n\nJSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    \n\tNodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::getInstance();\n    \n    ccNodeLoaderLibrary->registerNodeLoader(\"\", JSLayerLoader::loader());\n    \n    CCBReader * ret = new CCBReader(ccNodeLoaderLibrary);\n    ret->autorelease();\n    \n    jsval jsret;\n    if (ret) {\n        js_proxy_t *proxy = jsb_get_native_proxy(ret);\n        if (proxy) {\n            jsret = OBJECT_TO_JSVAL(proxy->obj);\n        } else {\n            // create a new js obj of that class\n            proxy = js_get_or_create_proxy<CCBReader>(cx, ret);\n            jsret = OBJECT_TO_JSVAL(proxy->obj);\n        }\n    } else {\n        jsret = JSVAL_NULL;\n    }\n    JS_SET_RVAL(cx, vp, jsret);\n    return JS_TRUE;\n    \n}\n\nextern JSObject* jsb_cocosbuilder_CCBReader_prototype;\nextern JSObject* jsb_cocosbuilder_CCBAnimationManager_prototype;\n\nvoid register_CCBuilderReader(JSContext *cx, JSObject *obj) {\n    JS::RootedValue  nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"cc\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"cc\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n    JSObject  *tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, obj, \"(function () { return cc._Reader; })()\"));\n    JS_DefineFunction(cx, tmpObj, \"create\", js_CocosBuilder_create, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, tmpObj, \"loadScene\", js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    \n    JS_DefineFunction(cx, jsb_cocosbuilder_CCBReader_prototype, \"load\", js_cocos2dx_CCBReader_readNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocosbuilder_CCBAnimationManager_prototype, \"setCompletedAnimationCallback\", js_cocos2dx_CCBAnimationManager_animationCompleteCallback, 2, JSPROP_READONLY | JSPROP_PERMANENT);\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocosbuilder/js_bindings_ccbreader.h",
    "content": "//\n//  js_bindings_ccbreader.h\n//  watermelon\n//\n//  Created by Rohan Kuruvilla on 14/08/2012.\n//\n//\n#ifndef __JS_BINDINGS_CCBREADER_H__\n#define __JS_BINDINGS_CCBREADER_H__\n\n#include \"jsapi.h\"\n#include \"cocosbuilder_specifics.hpp\"\n#include \"cocosbuilder/CocosBuilder.h\"\n\nclass CCBScriptCallbackProxy:  public cocos2d::Layer\n, public cocosbuilder::CCBSelectorResolver\n, public cocosbuilder::CCBMemberVariableAssigner {\n    \n    std::string callBackProp;\n    jsval owner;\n\npublic:\n\n\n    CCBScriptCallbackProxy () {}\n    virtual ~CCBScriptCallbackProxy() {}\n\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(CCBScriptCallbackProxy, create);\n    virtual cocos2d::SEL_MenuHandler onResolveCCBCCMenuItemSelector(cocos2d::Object * pTarget,\n                                                                    const char * pSelectorName);\n\n    virtual cocos2d::extension::Control::Handler onResolveCCBCCControlSelector(cocos2d::Object * pTarget,\n                                                                                   const char * pSelectorName);\n    virtual bool onAssignCCBMemberVariable(cocos2d::Object * pTarget, const char * pMemberVariableName,\n                                           cocos2d::Node * pNode);\n    virtual void onNodeLoaded(cocos2d::Node * pNode,\n                              cocosbuilder::NodeLoader * pNodeLoader);\n        \n    virtual CCBSelectorResolver * createNew();\n    void menuItemCallback(Object *pSender);\n    void controlCallback(Object *pSender, cocos2d::extension::Control::EventType event);\n    void setCallbackProperty(const char *prop);\n    void setJSOwner(jsval ownr);\n    jsval getJSOwner();\n};\n\n\nclass JSLayerLoader : public cocosbuilder::LayerLoader {\npublic:\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(JSLayerLoader, loader);\n    \nprotected:\n    CCB_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(CCBScriptCallbackProxy);\n};\n\nvoid register_CCBuilderReader(JSContext *cx, JSObject *global);\nJSBool js_CocosBuilder_Run(JSContext *cx, uint32_t argc, jsval *vp);\n\n#endif /* __JS_BINDINGS_CCBREADER_H__ */\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocosbuilder/libJSBindingForBuilder.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_builder_auto.cpp\" />\n    <ClCompile Include=\"js_bindings_ccbreader.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_builder_auto.hpp\" />\n    <ClInclude Include=\"cocosbuilder_specifics.hpp\" />\n    <ClInclude Include=\"js_bindings_ccbreader.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_builder_auto_api.js\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{F9DA0FC1-651B-457B-962E-A4D61CEBF5FD}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForBuilder</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocosbuilder;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocosbuilder;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocosbuilder/libJSBindingForBuilder.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_builder_auto.cpp\">\n      <Filter>generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"js_bindings_ccbreader.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_builder_auto.hpp\">\n      <Filter>generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"cocosbuilder_specifics.hpp\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_ccbreader.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_builder_auto_api.js\">\n      <Filter>generated</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocostudio/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_studio_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsbstudio\n\nLOCAL_SRC_FILES := jsb_cocos2dx_studio_manual.cpp \\\n                   ../../../auto-generated/js-bindings/jsb_cocos2dx_studio_auto.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../../../extensions \\\n                    $(LOCAL_PATH)/../../../../editor-support/cocostudio\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n                            \nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,editor-support/cocostudio)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp",
    "content": "//\n//  jsb_cocos2dx_studio_manual.h\n//\n//  Created by LinWenhai on 20/10/13.\n//\n//\n#include \"jsb_cocos2dx_studio_manual.h\"\n#include \"ScriptingCore.h\"\n#include \"cocos2d_specifics.hpp\"\n#include \"cocostudio/CocoStudio.h\"\n\nclass JSArmatureWrapper: public JSCallbackWrapper {\npublic:\n    JSArmatureWrapper();\n    virtual ~JSArmatureWrapper();\n\n    virtual void setJSCallbackThis(jsval thisObj);\n\n    void movementCallbackFunc(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID);\n    void frameCallbackFunc(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex);\n    void addArmatureFileInfoAsyncCallbackFunc(float percent);\n\nprivate:\n    bool m_bNeedUnroot;\n};\n\nJSArmatureWrapper::JSArmatureWrapper()\n    : m_bNeedUnroot(false)\n{\n\n}\n\nJSArmatureWrapper::~JSArmatureWrapper()\n{\n    if (m_bNeedUnroot)\n    {\n        JSObject *thisObj = JSVAL_TO_OBJECT(_jsThisObj);\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_RemoveObjectRoot(cx, &thisObj);\n    }\n}\n\nvoid JSArmatureWrapper::setJSCallbackThis(jsval _jsThisObj)\n{\n    JSCallbackWrapper::setJSCallbackThis(_jsThisObj);\n\n    JSObject *thisObj = JSVAL_TO_OBJECT(_jsThisObj);\n    js_proxy *p = jsb_get_js_proxy(thisObj);\n    if (!p)\n    {\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_AddObjectRoot(cx, &thisObj);\n        m_bNeedUnroot = true;\n    }\n}\n\nvoid JSArmatureWrapper::movementCallbackFunc(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID)\n{\n    JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n    JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj);\n    js_proxy_t *proxy = js_get_or_create_proxy(cx, armature);\n    jsval retval;\n    if (_jsCallback != JSVAL_VOID)\n    {\n        int movementEventType = (int)movementType;\n        jsval movementVal = INT_TO_JSVAL(movementEventType);\n\n        jsval idVal = std_string_to_jsval(cx, movementID);\n\n        jsval valArr[3];\n        valArr[0] = OBJECT_TO_JSVAL(proxy->obj);\n        valArr[1] = movementVal;\n        valArr[2] = idVal;\n\n        JS_AddValueRoot(cx, valArr);\n        \n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n        \n        JS_CallFunctionValue(cx, thisObj, _jsCallback, 3, valArr, &retval);\n        JS_RemoveValueRoot(cx, valArr);\n    }\n}\n\nvoid JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc(float percent)\n{\n    JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n    JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj);\n    jsval retval;\n    if (_jsCallback != JSVAL_VOID)\n    {\n        jsval percentVal = DOUBLE_TO_JSVAL(percent);\n\n        JS_AddValueRoot(cx, &percentVal);\n        \n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n        \n        JS_CallFunctionValue(cx, thisObj, _jsCallback, 1, &percentVal, &retval);\n        JS_RemoveValueRoot(cx, &percentVal);\n    }\n}\n\n\nvoid JSArmatureWrapper::frameCallbackFunc(cocostudio::Bone *bone, const std::string& evt, int originFrameIndex, int currentFrameIndex)\n{\n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n    \n    JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n    JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj);\n    js_proxy_t *proxy = js_get_or_create_proxy(cx, bone);\n    jsval retval;\n    if (_jsCallback != JSVAL_VOID)\n    {\n        jsval nameVal = std_string_to_jsval(cx, evt);\n        jsval originIndexVal = INT_TO_JSVAL(originFrameIndex);\n        jsval currentIndexVal = INT_TO_JSVAL(currentFrameIndex);\n\n        jsval valArr[4];\n        valArr[0] = OBJECT_TO_JSVAL(proxy->obj);\n        valArr[1] = nameVal;\n        valArr[2] = originIndexVal;\n        valArr[3] = currentIndexVal;\n\n        JS_AddValueRoot(cx, valArr);\n        \n        JS_CallFunctionValue(cx, thisObj, _jsCallback, 4, valArr, &retval);\n        JS_RemoveValueRoot(cx, valArr);\n    }\n}\n\nstatic JSBool js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSArmatureWrapper *tmpObj = new JSArmatureWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n\n        cobj->setMovementEventCallFunc(CC_CALLBACK_0(JSArmatureWrapper::movementCallbackFunc, tmpObj, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));\n        \n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocostudio::ArmatureAnimation* cobj = (cocostudio::ArmatureAnimation *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSArmatureWrapper *tmpObj = new JSArmatureWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n\n        cobj->setFrameEventCallFunc(CC_CALLBACK_0(JSArmatureWrapper::frameCallbackFunc, tmpObj, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool jsb_Animation_addArmatureFileInfoAsyncCallFunc(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocostudio::ArmatureDataManager* cobj = (cocostudio::ArmatureDataManager *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 3) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSArmatureWrapper *tmpObj = new JSArmatureWrapper();\n        tmpObj->autorelease();\n\n        tmpObj->setJSCallbackFunc(argv[1]);\n        tmpObj->setJSCallbackThis(argv[2]);\n\n        std::string ret;\n        jsval_to_std_string(cx, argv[0], &ret);\n\n        cobj->addArmatureFileInfoAsync(ret.c_str(), tmpObj, schedule_selector(JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc));\n\n        return JS_TRUE;\n    }\n\n    if(argc == 5){\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSArmatureWrapper *tmpObj = new JSArmatureWrapper();\n        tmpObj->autorelease();\n\n        tmpObj->setJSCallbackFunc(argv[3]);\n        tmpObj->setJSCallbackThis(argv[4]);\n\n        std::string imagePath;\n        jsval_to_std_string(cx ,argv[0] , &imagePath);\n\n        std::string plistPath;\n        jsval_to_std_string(cx ,argv[1] , &plistPath);\n\n        std::string configFilePath;\n        jsval_to_std_string(cx ,argv[2] , &configFilePath);\n\n        cobj->addArmatureFileInfoAsync(imagePath.c_str(), plistPath.c_str(), configFilePath.c_str(), tmpObj, schedule_selector(JSArmatureWrapper::addArmatureFileInfoAsyncCallbackFunc));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nJSBool js_cocos2dx_studio_ColliderBody_getCalculatedVertexList(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocostudio::ColliderBody* cobj = (cocostudio::ColliderBody *)(proxy ? proxy->ptr : nullptr);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    if (argc == 0) {\n        const std::vector<cocos2d::Point>& ret = cobj->getCalculatedVertexList();\n        JSObject *jsretArr = JS_NewArrayObject(cx, 0, nullptr);\n        jsval jsret;\n        //CCObject* obj;\n        int i = 0;\n        for(std::vector<cocos2d::Point>::const_iterator it = ret.begin(); it != ret.end(); it++)\n        {\n            const cocos2d::Point& point = *it;\n            JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n            if (!tmp) break;\n            JSBool ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(point.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(point.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n            jsval jsTmp = OBJECT_TO_JSVAL(tmp);\n            if(!ok || !JS_SetElement(cx, jsretArr, i, &jsTmp))\n            {\n                break;\n            }\n            ++i;\n        }\n        jsret = OBJECT_TO_JSVAL(jsretArr);\n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nextern JSObject* jsb_cocostudio_ArmatureAnimation_prototype;\nextern JSObject* jsb_cocostudio_ArmatureDataManager_prototype;\nextern JSObject* jsb_cocostudio_ColliderBody_prototype;\n\nvoid register_all_cocos2dx_studio_manual(JSContext* cx, JSObject* global)\n{\n    JS_DefineFunction(cx, jsb_cocostudio_ColliderBody_prototype, \"getCalculatedVertexList\", js_cocos2dx_studio_ColliderBody_getCalculatedVertexList, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocostudio_ArmatureAnimation_prototype, \"setMovementEventCallFunc\", js_cocos2dx_ArmatureAnimation_setMovementEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocostudio_ArmatureAnimation_prototype, \"setFrameEventCallFunc\", js_cocos2dx_ArmatureAnimation_setFrameEventCallFunc, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocostudio_ArmatureDataManager_prototype, \"addArmatureFileInfoAsync\", jsb_Animation_addArmatureFileInfoAsyncCallFunc, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n}"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.h",
    "content": "//\n//  jsb_cocos2dx_studio_manual.h\n//\n//  Created by LinWenhai on 20/10/13.\n//\n//\n\n#ifndef __jsb_cocos2dx_studio_manual__\n#define __jsb_cocos2dx_studio_manual__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nvoid register_all_cocos2dx_studio_manual(JSContext* cx, JSObject* global);\n\n#endif /* defined(__jsb_cocos2dx_studio_manual__) */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocostudio/libJSBindingForStudio.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_studio_auto.cpp\" />\n    <ClCompile Include=\"jsb_cocos2dx_studio_manual.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_studio_auto.hpp\" />\n    <ClInclude Include=\"jsb_cocos2dx_studio_manual.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_studio_auto_api.js\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{79D34511-E54E-410A-8BBA-EF175AD6C695}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForStudio</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocostudio;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocostudio;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/cocostudio/libJSBindingForStudio.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_studio_auto.cpp\">\n      <Filter>generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jsb_cocos2dx_studio_manual.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_studio_auto.hpp\">\n      <Filter>generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jsb_cocos2dx_studio_manual.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_studio_auto_api.js\">\n      <Filter>generated</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/extension/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_extension_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsbextension\n\nLOCAL_SRC_FILES := jsb_cocos2dx_extension_manual.cpp \\\n                   ../../../auto-generated/js-bindings/jsb_cocos2dx_extension_auto.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../../../extensions\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \\\n                           $(LOCAL_PATH)/../../../../../\n\nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,extensions)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp",
    "content": "//\n//  jsb_cocos2d_extension_manual.cpp\n//\n//  Created by James Chen on 3/11/13.\n//\n//\n\n#include \"jsb_cocos2dx_extension_manual.h\"\n#include \"extensions/cocos-ext.h\"\n#include \"ScriptingCore.h\"\n#include \"cocos2d_specifics.hpp\"\n\nUSING_NS_CC;\nUSING_NS_CC_EXT;\n\n\nclass JSB_ScrollViewDelegate\n: public Object\n, public ScrollViewDelegate\n{\npublic:\n    JSB_ScrollViewDelegate()\n    : _JSDelegate(NULL)\n    , _needUnroot(false)\n    {}\n    \n    virtual ~JSB_ScrollViewDelegate()\n    {\n        if (_needUnroot)\n        {\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_RemoveObjectRoot(cx, &_JSDelegate);\n        }\n    }\n    \n    virtual void scrollViewDidScroll(ScrollView* view) override\n    {\n        js_proxy_t * p = jsb_get_native_proxy(view);\n        if (!p) return;\n        \n        jsval arg = OBJECT_TO_JSVAL(p->obj);\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"scrollViewDidScroll\", 1, &arg, NULL);\n    }\n    \n    virtual void scrollViewDidZoom(ScrollView* view) override\n    {\n        js_proxy_t * p = jsb_get_native_proxy(view);\n        if (!p) return;\n        \n        jsval arg = OBJECT_TO_JSVAL(p->obj);\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"scrollViewDidZoom\", 1, &arg, NULL);\n    }\n    \n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n        \n        // Check whether the js delegate is a pure js object.\n        js_proxy_t* p = jsb_get_js_proxy(_JSDelegate);\n        if (!p)\n        {\n            _needUnroot = true;\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_AddNamedObjectRoot(cx, &_JSDelegate, \"TableViewDelegate\");\n        }\n    }\nprivate:\n    JSObject* _JSDelegate;\n    bool _needUnroot;\n};\n\nstatic JSBool js_cocos2dx_CCScrollView_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::extension::ScrollView* cobj = (cocos2d::extension::ScrollView *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 1)\n    {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        JSB_ScrollViewDelegate* nativeDelegate = new JSB_ScrollViewDelegate();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        \n        cobj->setUserObject(nativeDelegate);\n        cobj->setDelegate(nativeDelegate);\n        \n        nativeDelegate->release();\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\n\n#define KEY_TABLEVIEW_DATA_SOURCE  \"TableViewDataSource\"\n#define KEY_TABLEVIEW_DELEGATE     \"TableViewDelegate\"\n\nclass JSB_TableViewDelegate\n: public Object\n, public TableViewDelegate\n{\npublic:\n    JSB_TableViewDelegate()\n    : _JSDelegate(NULL)\n    , _needUnroot(false)\n    {}\n    \n    virtual ~JSB_TableViewDelegate()\n    {\n        if (_needUnroot)\n        {\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_RemoveObjectRoot(cx, &_JSDelegate);\n        }\n    }\n    \n    virtual void scrollViewDidScroll(ScrollView* view) override\n    {\n        callJSDelegate(view, \"scrollViewDidScroll\");\n    }\n    \n    virtual void scrollViewDidZoom(ScrollView* view) override\n    {\n        callJSDelegate(view, \"scrollViewDidZoom\");\n    }\n    \n    virtual void tableCellTouched(TableView* table, TableViewCell* cell) override\n    {\n        callJSDelegate(table, cell, \"tableCellTouched\");\n    }\n    \n    virtual void tableCellHighlight(TableView* table, TableViewCell* cell) override\n    {\n        callJSDelegate(table, cell, \"tableCellHighlight\");\n    }\n    \n    virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell) override\n    {\n        callJSDelegate(table, cell, \"tableCellUnhighlight\");\n    }\n    \n    virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell) override\n    {\n        callJSDelegate(table, cell, \"tableCellWillRecycle\");\n    }\n    \n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n        \n        // Check whether the js delegate is a pure js object.\n        js_proxy_t* p = jsb_get_js_proxy(_JSDelegate);\n        if (!p)\n        {\n            _needUnroot = true;\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_AddNamedObjectRoot(cx, &_JSDelegate, \"TableViewDelegate\");\n        }\n    }\n    \n    \nprivate:\n    void callJSDelegate(ScrollView* view, std::string jsFunctionName)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(view);\n        if (!p) return;\n        \n        jsval arg = OBJECT_TO_JSVAL(p->obj);\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), jsFunctionName.c_str(), 1, &arg, NULL);\n    }\n    \n    void callJSDelegate(TableView* table, TableViewCell* cell, std::string jsFunctionName)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(table);\n        if (!p) return;\n        \n        js_proxy_t * pCellProxy = jsb_get_native_proxy(cell);\n        if (!pCellProxy) return;\n        \n        jsval args[2];\n        args[0] = OBJECT_TO_JSVAL(p->obj);\n        args[1] = OBJECT_TO_JSVAL(pCellProxy->obj);\n        \n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), jsFunctionName.c_str(), 2, args, NULL);\n    }\n    \n    JSObject* _JSDelegate;\n    bool _needUnroot;\n};\n\nstatic JSBool js_cocos2dx_CCTableView_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 1)\n    {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        JSB_TableViewDelegate* nativeDelegate = new JSB_TableViewDelegate();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        \n        Dictionary* userDict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (NULL == userDict)\n        {\n            userDict = new Dictionary();\n            cobj->setUserObject(userDict);\n            userDict->release();\n        }\n        \n        userDict->setObject(nativeDelegate, KEY_TABLEVIEW_DELEGATE);\n        \n        cobj->setDelegate(nativeDelegate);\n        \n        nativeDelegate->release();\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nclass JSB_TableViewDataSource\n: public Object\n, public TableViewDataSource\n{\npublic:\n    JSB_TableViewDataSource()\n    : _JSTableViewDataSource(NULL)\n    , _needUnroot(false)\n    {}\n    \n    virtual ~JSB_TableViewDataSource()\n    {\n        if (_needUnroot)\n        {\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_RemoveObjectRoot(cx, &_JSTableViewDataSource);\n        }\n    }\n    \n    virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) override\n    {\n        jsval ret;\n        bool ok = callJSDelegate(table, idx, \"tableCellSizeForIndex\", ret);\n        if (!ok) \n        {\n            ok = callJSDelegate(table, \"cellSizeForTable\", ret);\n        }\n        if (ok) \n        {\n            JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            Size size;\n            JSBool isSucceed = jsval_to_ccsize(cx, ret, &size);\n            if (isSucceed) return size;\n        }\n        return Size::ZERO;\n        \n    }\n    \n    virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) override\n    {\n        jsval ret;\n        bool ok = callJSDelegate(table, idx, \"tableCellAtIndex\", ret);\n        if (ok)\n        {\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            cocos2d::extension::TableViewCell* arg0;\n            do {\n                js_proxy_t *proxy;\n                JSObject *tmpObj = JSVAL_TO_OBJECT(ret);\n                proxy = jsb_get_js_proxy(tmpObj);\n                arg0 = (cocos2d::extension::TableViewCell*)(proxy ? proxy->ptr : NULL);\n                JSB_PRECONDITION2( arg0, cx, NULL, \"Invalid Native Object\");\n            } while (0);\n            return arg0;\n        }\n        return NULL;\n    }\n    \n    virtual ssize_t numberOfCellsInTableView(TableView *table) override\n    {\n        jsval ret;\n        bool ok = callJSDelegate(table, \"numberOfCellsInTableView\", ret);\n        if (ok)\n        {\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            ssize_t count = 0;\n            JSBool isSucceed = jsval_to_ssize(cx, ret, &count);\n            if (isSucceed) return count;\n        }\n        return 0;\n    }\n    \n    \n    void setTableViewDataSource(JSObject* pJSSource)\n    {\n        _JSTableViewDataSource = pJSSource;\n        \n        // Check whether the js delegate is a pure js object.\n        js_proxy_t* p = jsb_get_js_proxy(_JSTableViewDataSource);\n        if (!p)\n        {\n            _needUnroot = true;\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_AddNamedObjectRoot(cx, &_JSTableViewDataSource, \"TableViewDataSource\");\n        }\n    }\n    \nprivate:\n    bool callJSDelegate(TableView* table, std::string jsFunctionName, jsval& retVal)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(table);\n        if (!p) return false;\n        \n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        \n        JSBool hasAction;\n        JS::RootedValue temp_retval(cx);\n        jsval dataVal = OBJECT_TO_JSVAL(p->obj);\n        \n        JSObject* obj = _JSTableViewDataSource;\n        JSAutoCompartment ac(cx, obj);\n        \n        if (JS_HasProperty(cx, obj, jsFunctionName.c_str(), &hasAction) && hasAction)\n        {\n            if(!JS_GetProperty(cx, obj, jsFunctionName.c_str(), &temp_retval))\n            {\n                return false;\n            }\n            if(temp_retval == JSVAL_VOID)\n            {\n                return false;\n            }\n\n            JS_CallFunctionName(cx, obj, jsFunctionName.c_str(),\n                                1, &dataVal, &retVal);\n            return true;\n        }\n        return false;\n    }\n    \n    bool callJSDelegate(TableView* table, ssize_t idx, std::string jsFunctionName, jsval& retVal)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(table);\n        if (!p) return false;\n        \n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        JSBool hasAction;\n        JS::RootedValue temp_retval(cx);\n        jsval dataVal[2];\n        dataVal[0] = OBJECT_TO_JSVAL(p->obj);\n        dataVal[1] = ssize_to_jsval(cx,idx);\n        \n        JSObject* obj = _JSTableViewDataSource;\n        JSAutoCompartment ac(cx, obj);\n        \n        if (JS_HasProperty(cx, obj, jsFunctionName.c_str(), &hasAction) && hasAction)\n        {\n            if(!JS_GetProperty(cx, obj, jsFunctionName.c_str(), &temp_retval))\n            {\n                return false;\n            }\n            \n            if(temp_retval == JSVAL_VOID)\n            {\n                return false;\n            }\n\n            JSBool ret = JS_CallFunctionName(cx, obj, jsFunctionName.c_str(),\n                                2, dataVal, &retVal);\n            return ret == JS_TRUE ? true : false;\n        }\n        return false;\n    }\n    \nprivate:\n    JSObject* _JSTableViewDataSource;\n    bool _needUnroot;\n};\n\nstatic JSBool js_cocos2dx_CCTableView_setDataSource(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::extension::TableView* cobj = (cocos2d::extension::TableView *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    if (argc == 1)\n    {\n        JSB_TableViewDataSource* pNativeSource = new JSB_TableViewDataSource();\n        pNativeSource->setTableViewDataSource(JSVAL_TO_OBJECT(argv[0]));\n    \n        Dictionary* userDict = static_cast<Dictionary*>(cobj->getUserObject());\n        if (NULL == userDict)\n        {\n            userDict = new Dictionary();\n            cobj->setUserObject(userDict);\n            userDict->release();\n        }\n\n        userDict->setObject(pNativeSource, KEY_TABLEVIEW_DATA_SOURCE);\n\n        cobj->setDataSource(pNativeSource);\n        \n        pNativeSource->release();\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    \n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_CCTableView_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSBool ok = JS_TRUE;\n    if (argc == 3 || argc == 2)\n    {\n        \n        JSB_TableViewDataSource* pNativeSource = new JSB_TableViewDataSource();\n        pNativeSource->setTableViewDataSource(JSVAL_TO_OBJECT(argv[0]));\n        \n        cocos2d::Size arg1;\n        ok &= jsval_to_ccsize(cx, argv[1], &arg1);\n        cocos2d::extension::TableView* ret = NULL;\n        ret = new TableView();\n        ret->autorelease();\n        \n        ret->setDataSource(pNativeSource);\n        \n        jsval jsret;\n        do {\n            if (ret)\n            {\n                js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::extension::TableView>(cx, ret);\n                jsret = OBJECT_TO_JSVAL(proxy->obj);\n            } \n            else\n            {\n                jsret = JSVAL_NULL;\n            }\n        } while (0);\n        \n        if (argc == 2)\n        {\n            ret->initWithViewSize(arg1);\n        }\n        else\n        {\n            cocos2d::Node* arg2;\n            do \n            {\n                js_proxy_t *proxy;\n                JSObject *tmpObj = JSVAL_TO_OBJECT(argv[2]);\n                proxy = jsb_get_js_proxy(tmpObj);\n                arg2 = (cocos2d::Node*)(proxy ? proxy->ptr : NULL);\n                JSB_PRECONDITION2( arg2, cx, JS_FALSE, \"Invalid Native Object\");\n            } while (0);\n            JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n            ret->initWithViewSize(arg1, arg2);\n        }\n        ret->reloadData();\n        \n        Dictionary* userDict = new Dictionary();\n        userDict->setObject(pNativeSource, KEY_TABLEVIEW_DATA_SOURCE);\n        ret->setUserObject(userDict);\n        userDict->release();\n        \n        pNativeSource->release();\n        \n        JS_SET_RVAL(cx, vp, jsret);\n        return JS_TRUE;\n    }\n    \n    JS_ReportError(cx, \"wrong number of arguments\");\n    return JS_FALSE;\n}\n\nclass JSB_EditBoxDelegate\n: public Object\n, public EditBoxDelegate\n{\npublic:\n    JSB_EditBoxDelegate()\n    : _JSDelegate(NULL)\n    , _needUnroot(false)\n    {}\n    \n    virtual ~JSB_EditBoxDelegate()\n    {\n        if (_needUnroot)\n        {\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_RemoveObjectRoot(cx, &_JSDelegate);\n        }\n    }\n    \n    virtual void editBoxEditingDidBegin(EditBox* editBox) override\n    {\n        js_proxy_t * p = jsb_get_native_proxy(editBox);\n        if (!p) return;\n        \n        jsval arg = OBJECT_TO_JSVAL(p->obj);\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"editBoxEditingDidBegin\", 1, &arg, NULL);\n    }\n    \n    virtual void editBoxEditingDidEnd(EditBox* editBox) override\n    {\n        js_proxy_t * p = jsb_get_native_proxy(editBox);\n        if (!p) return;\n        \n        jsval arg = OBJECT_TO_JSVAL(p->obj);\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"editBoxEditingDidEnd\", 1, &arg, NULL);\n    }\n    \n    virtual void editBoxTextChanged(EditBox* editBox, const std::string& text) override\n    {\n        js_proxy_t * p = jsb_get_native_proxy(editBox);\n        if (!p) return;\n        \n        jsval dataVal[2];\n        dataVal[0] = OBJECT_TO_JSVAL(p->obj);\n        std::string arg1 = text;\n        dataVal[1] = std_string_to_jsval(ScriptingCore::getInstance()->getGlobalContext(), arg1);\n        \n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"editBoxTextChanged\", 2, dataVal, NULL);\n    }\n    \n    virtual void editBoxReturn(EditBox* editBox) override\n    {\n        js_proxy_t * p = jsb_get_native_proxy(editBox);\n        if (!p) return;\n        \n        jsval arg = OBJECT_TO_JSVAL(p->obj);\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"editBoxReturn\", 1, &arg, NULL);\n    }\n    \n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n        \n        // Check whether the js delegate is a pure js object.\n        js_proxy_t* p = jsb_get_js_proxy(_JSDelegate);\n        if (!p)\n        {\n            _needUnroot = true;\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_AddNamedObjectRoot(cx, &_JSDelegate, \"TableViewDelegate\");\n        }\n    }\nprivate:\n    JSObject* _JSDelegate;\n    bool _needUnroot;\n};\n\nstatic JSBool js_cocos2dx_CCEditBox_setDelegate(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::extension::EditBox* cobj = (cocos2d::extension::EditBox *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (argc == 1)\n    {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        JSB_EditBoxDelegate* nativeDelegate = new JSB_EditBoxDelegate();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        \n        cobj->setUserObject(nativeDelegate);\n        cobj->setDelegate(nativeDelegate);\n        \n        nativeDelegate->release();\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\n\n\nclass JSB_ControlButtonTarget : public Object\n{\npublic:\n    JSB_ControlButtonTarget()\n    : _jsFunc(nullptr),\n      _type(Control::EventType::TOUCH_DOWN),\n      _jsTarget(nullptr),\n      _needUnroot(false)\n    {}\n    \n    virtual ~JSB_ControlButtonTarget()\n    {\n        CCLOGINFO(\"In the destruction of JSB_ControlButtonTarget ...\");\n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        if (_needUnroot)\n        {\n            JS_RemoveObjectRoot(cx, &_jsTarget);\n        }\n        \n        JS_RemoveObjectRoot(cx, &_jsFunc);\n\n        for (auto iter = _jsNativeTargetMap.begin(); iter != _jsNativeTargetMap.end(); ++iter)\n        {\n            if (this == iter->second)\n            {\n                _jsNativeTargetMap.erase(iter);\n                break;\n            }\n        }\n    }\n    \n    virtual void onEvent(Object *controlButton, Control::EventType event)\n    {\n        js_proxy_t * p;\n        JS_GET_PROXY(p, controlButton);\n        if (!p)\n        {\n            log(\"Failed to get proxy for control button\");\n            return;\n        }\n        \n        jsval dataVal[2];\n        dataVal[0] = OBJECT_TO_JSVAL(p->obj);\n        int arg1 = (int)event;\n        dataVal[1] = INT_TO_JSVAL(arg1);\n        jsval jsRet;\n\n        ScriptingCore::getInstance()->executeJSFunctionWithThisObj(OBJECT_TO_JSVAL(_jsTarget), OBJECT_TO_JSVAL(_jsFunc), 2, dataVal, &jsRet);\n    }\n    \n    void setJSTarget(JSObject* pJSTarget)\n    {\n        _jsTarget = pJSTarget;\n        \n        js_proxy_t* p = jsb_get_js_proxy(_jsTarget);\n        if (!p)\n        {\n            JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n            JS_AddNamedObjectRoot(cx, &_jsTarget, \"JSB_ControlButtonTarget, target\");\n            _needUnroot = true;\n        }\n    }\n    \n    void setJSAction(JSObject* jsFunc)\n    {\n        _jsFunc = jsFunc;\n\n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_AddNamedObjectRoot(cx, &_jsFunc, \"JSB_ControlButtonTarget, func\");\n    }\n    \n    void setEventType(Control::EventType type)\n    {\n        _type = type;\n    }\npublic:\n    \n    static std::multimap<JSObject*, JSB_ControlButtonTarget*> _jsNativeTargetMap;\n    JSObject* _jsFunc;\n    Control::EventType _type;\nprivate:\n    JSObject* _jsTarget;\n    bool _needUnroot;\n};\n\nstd::multimap<JSObject*, JSB_ControlButtonTarget*> JSB_ControlButtonTarget::_jsNativeTargetMap;\n\nstatic JSBool js_cocos2dx_CCControl_addTargetWithActionForControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    JSBool ok = JS_TRUE;\n    if (argc == 3)\n    {\n        JSObject* jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        JSObject* jsFunc = JSVAL_TO_OBJECT(argv[1]);\n        Control::EventType arg2;\n        ok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing control event\");\n        \n        // Check whether the target already exists.\n        auto range = JSB_ControlButtonTarget::_jsNativeTargetMap.equal_range(jsDelegate);\n        for (auto it = range.first; it != range.second; ++it)\n        {\n            if (it->second->_jsFunc == jsFunc && arg2 == it->second->_type)\n            {\n                // Return true directly.\n                JS_SET_RVAL(cx, vp, JSVAL_VOID);\n                return JS_TRUE;\n            }\n        }\n        \n        // save the delegate\n        JSB_ControlButtonTarget* nativeDelegate = new JSB_ControlButtonTarget();\n        \n        nativeDelegate->setJSTarget(jsDelegate);\n        nativeDelegate->setJSAction(jsFunc);\n        nativeDelegate->setEventType(arg2);\n\n        Array* nativeDelegateArray = static_cast<Array*>(cobj->getUserObject());\n        if (nullptr == nativeDelegateArray)\n        {\n            nativeDelegateArray = new Array();\n            nativeDelegateArray->init();\n            cobj->setUserObject(nativeDelegateArray);  // The reference of nativeDelegateArray is added to 2\n            nativeDelegateArray->release(); // Release nativeDelegateArray to make the reference to 1\n        }\n        \n        nativeDelegateArray->addObject(nativeDelegate); // The reference of nativeDelegate is added to 2\n        nativeDelegate->release(); // Release nativeDelegate to make the reference to 1\n        \n        cobj->addTargetWithActionForControlEvents(nativeDelegate, cccontrol_selector(JSB_ControlButtonTarget::onEvent), arg2);\n        \n        JSB_ControlButtonTarget::_jsNativeTargetMap.insert(std::make_pair(jsDelegate, nativeDelegate));\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        \n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 3);\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_CCControl_removeTargetWithActionForControlEvents(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    cocos2d::extension::Control* cobj = (cocos2d::extension::Control *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    JSBool ok = JS_TRUE;\n    if (argc == 3)\n    {\n        Control::EventType arg2;\n        ok &= jsval_to_int32(cx, argv[2], (int32_t *)&arg2);\n        JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing control event\");\n        \n        obj = JSVAL_TO_OBJECT(argv[0]);\n        JSObject* jsFunc = JSVAL_TO_OBJECT(argv[1]);\n        \n        JSB_ControlButtonTarget* nativeTargetToRemoved = nullptr;\n        \n        auto range = JSB_ControlButtonTarget::_jsNativeTargetMap.equal_range(obj);\n        for (auto it = range.first; it != range.second; ++it)\n        {\n            if (it->second->_jsFunc == jsFunc && arg2 == it->second->_type)\n            {\n                nativeTargetToRemoved = it->second;\n                JSB_ControlButtonTarget::_jsNativeTargetMap.erase(it);\n                break;\n            }\n        }\n        \n        cobj->removeTargetWithActionForControlEvents(nativeTargetToRemoved, cccontrol_selector(JSB_ControlButtonTarget::onEvent), arg2);\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 3);\n    return JS_FALSE;\n}\n\nextern JSObject* jsb_cocos2d_extension_ScrollView_prototype;\nextern JSObject* jsb_cocos2d_extension_TableView_prototype;\nextern JSObject* jsb_cocos2d_extension_EditBox_prototype;\nextern JSObject* jsb_cocos2d_extension_Control_prototype;\n\nvoid register_all_cocos2dx_extension_manual(JSContext* cx, JSObject* global)\n{\n    JS_DefineFunction(cx, jsb_cocos2d_extension_ScrollView_prototype, \"setDelegate\", js_cocos2dx_CCScrollView_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_extension_TableView_prototype, \"setDelegate\", js_cocos2dx_CCTableView_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_extension_TableView_prototype, \"setDataSource\", js_cocos2dx_CCTableView_setDataSource, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_extension_EditBox_prototype, \"setDelegate\", js_cocos2dx_CCEditBox_setDelegate, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_extension_Control_prototype, \"addTargetWithActionForControlEvents\", js_cocos2dx_CCControl_addTargetWithActionForControlEvents, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_extension_Control_prototype, \"removeTargetWithActionForControlEvents\", js_cocos2dx_CCControl_removeTargetWithActionForControlEvents, 3, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    JSObject *tmpObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return cc.TableView; })()\"));\n\tJS_DefineFunction(cx, tmpObj, \"create\", js_cocos2dx_CCTableView_create, 3, JSPROP_READONLY | JSPROP_PERMANENT);\n}"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.h",
    "content": "//\n//  jsb_cocos2d_extension_manual.h\n//\n//  Created by James Chen on 3/11/13.\n//\n//\n\n#ifndef __jsb_cocos2dx_extension_manual__\n#define __jsb_cocos2dx_extension_manual__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nvoid register_all_cocos2dx_extension_manual(JSContext* cx, JSObject* global);\n\n#endif /* defined(__jsb_cocos2dx_extension_manual__) */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/extension/libJSBindingForExtension.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_extension_auto.cpp\" />\n    <ClCompile Include=\"jsb_cocos2dx_extension_manual.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_extension_auto.hpp\" />\n    <ClInclude Include=\"jsb_cocos2dx_extension_manual.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_extension_auto_api.js\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{625F7391-9A91-48A1-8CFC-79508C822637}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForExtension</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\network;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\network;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/extension/libJSBindingForExtension.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_extension_auto.cpp\">\n      <Filter>generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jsb_cocos2dx_extension_manual.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_extension_auto.hpp\">\n      <Filter>generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jsb_cocos2dx_extension_manual.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_extension_auto_api.js\">\n      <Filter>generated</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/gui/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_gui_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsbgui\n\nLOCAL_SRC_FILES := jsb_cocos2dx_gui_manual.cpp \\\n                   ../../../auto-generated/js-bindings/jsb_cocos2dx_gui_auto.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../../../extensions \\\n                    $(LOCAL_PATH)/../../../../gui\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n                            \nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_gui_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,gui)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.cpp",
    "content": "//\n//  jsb_cocos2dx_gui_manual.h\n//\n//  Created by LinWenhai on 17/11/13.\n//\n//\n#include \"jsb_cocos2dx_gui_manual.h\"\n#include \"ScriptingCore.h\"\n#include \"cocos2d_specifics.hpp\"\n#include \"gui/CocosGUI.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::gui;\n\nclass JSStudioEventListenerWrapper: public JSCallbackWrapper {\npublic:\n    JSStudioEventListenerWrapper();\n    virtual ~JSStudioEventListenerWrapper();\n\n    virtual void setJSCallbackThis(jsval thisObj);\n\n    virtual void eventCallbackFunc(Object*,int);\n\nprivate:\n    bool m_bNeedUnroot;\n};\n\nJSStudioEventListenerWrapper::JSStudioEventListenerWrapper()\n    : m_bNeedUnroot(false)\n{\n\n}\n\nJSStudioEventListenerWrapper::~JSStudioEventListenerWrapper()\n{\n    if (m_bNeedUnroot)\n    {\n        JSObject *thisObj = JSVAL_TO_OBJECT(_jsThisObj);\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_RemoveObjectRoot(cx, &thisObj);\n    }\n}\n\nvoid JSStudioEventListenerWrapper::setJSCallbackThis(jsval jsThisObj)\n{\n    JSCallbackWrapper::setJSCallbackThis(jsThisObj);\n\n    JSObject *thisObj = JSVAL_TO_OBJECT(jsThisObj);\n    js_proxy *p = jsb_get_js_proxy(thisObj);\n    if (!p)\n    {\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_AddObjectRoot(cx, &thisObj);\n        m_bNeedUnroot = true;\n    }\n}\n\nvoid JSStudioEventListenerWrapper::eventCallbackFunc(Object* sender,int eventType)\n{\n    JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n    JSObject *thisObj = JSVAL_IS_VOID(_jsThisObj) ? NULL : JSVAL_TO_OBJECT(_jsThisObj);\n    js_proxy_t *proxy = js_get_or_create_proxy(cx, sender);\n    jsval retval;\n    if (_jsCallback != JSVAL_VOID)\n    {\n        jsval touchVal = INT_TO_JSVAL(eventType);\n\n        jsval valArr[2];\n        valArr[0] = OBJECT_TO_JSVAL(proxy->obj);\n        valArr[1] = touchVal;\n\n        JS_AddValueRoot(cx, valArr);\n\n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n\n        JS_CallFunctionValue(cx, thisObj, _jsCallback, 2, valArr, &retval);\n        JS_RemoveValueRoot(cx, valArr);\n    }\n}\n\nstatic JSBool js_cocos2dx_UIWidget_addTouchEventListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::Widget* cobj = (gui::Widget *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n        \n        cobj->addTouchEventListener(tmpObj, toucheventselector(JSStudioEventListenerWrapper::eventCallbackFunc));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_UICheckBox_addEventListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::CheckBox* cobj = (gui::CheckBox *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n\n        cobj->addEventListenerCheckBox(tmpObj, checkboxselectedeventselector(JSStudioEventListenerWrapper::eventCallbackFunc));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_UISlider_addEventListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::Slider* cobj = (gui::Slider *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n\n        cobj->addEventListenerSlider(tmpObj, sliderpercentchangedselector(JSStudioEventListenerWrapper::eventCallbackFunc));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_UITextField_addEventListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::TextField* cobj = (gui::TextField *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n\n        cobj->addEventListenerTextField(tmpObj, textfieldeventselector(JSStudioEventListenerWrapper::eventCallbackFunc));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_UIPageView_addEventListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::PageView* cobj = (gui::PageView *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n\n        cobj->addEventListenerPageView(tmpObj, pagevieweventselector(JSStudioEventListenerWrapper::eventCallbackFunc));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_UIListView_addEventListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::ListView* cobj = (gui::ListView *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 2) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSStudioEventListenerWrapper *tmpObj = new JSStudioEventListenerWrapper();\n        cobj->setUserObject(tmpObj);\n        tmpObj->release();\n\n        tmpObj->setJSCallbackFunc(argv[0]);\n        tmpObj->setJSCallbackThis(argv[1]);\n\n        cobj->addEventListenerListView(tmpObj, listvieweventselector(JSStudioEventListenerWrapper::eventCallbackFunc));\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_LayoutParameter_setMargin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::LayoutParameter* cobj = (gui::LayoutParameter *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 1) {\n        jsval *argv = JS_ARGV(cx, vp);\n\n        JSObject *tmp;\n        JS::RootedValue jsleft(cx), jstop(cx),jsright(cx),jsbottom(cx);\n        double left, top,right,bottom;\n        JSBool ok = argv[0].isObject() &&\n            JS_ValueToObject(cx, argv[0], &tmp) &&\n            JS_GetProperty(cx, tmp, \"left\", &jsleft) &&\n            JS_GetProperty(cx, tmp, \"top\", &jstop) &&\n            JS_GetProperty(cx, tmp, \"right\", &jsright) &&\n            JS_GetProperty(cx, tmp, \"bottom\", &jsbottom) &&\n            JS_ValueToNumber(cx, jsleft, &left) &&\n            JS_ValueToNumber(cx, jstop, &top) &&\n            JS_ValueToNumber(cx, jsright, &right) &&\n            JS_ValueToNumber(cx, jsbottom, &bottom);\n\n        JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n        cobj->setMargin(gui::Margin(left,top,right,bottom));\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_LayoutParameter_getMargin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy = jsb_get_js_proxy(obj);\n    gui::LayoutParameter* cobj = (gui::LayoutParameter *)(proxy ? proxy->ptr : NULL);\n    JSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n    if (argc == 0) {\n        JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n        if (!tmp) return JS_FALSE;\n        gui::Margin margin = cobj->getMargin();\n        JSBool ok = JS_DefineProperty(cx, tmp, \"left\", DOUBLE_TO_JSVAL(margin.left), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n            JS_DefineProperty(cx, tmp, \"top\", DOUBLE_TO_JSVAL(margin.top), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n            JS_DefineProperty(cx, tmp, \"right\", DOUBLE_TO_JSVAL(margin.right), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n            JS_DefineProperty(cx, tmp, \"bottom\", DOUBLE_TO_JSVAL(margin.bottom), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n        if (ok) \n        {\n            JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(tmp));\n        }\n        else\n        {\n            return JS_FALSE;\n        }\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid number of arguments\");\n    return JS_FALSE;\n}\n\nextern JSObject* jsb_cocos2d_gui_Widget_prototype;\nextern JSObject* jsb_cocos2d_gui_CheckBox_prototype;\nextern JSObject* jsb_cocos2d_gui_Slider_prototype;\nextern JSObject* jsb_cocos2d_gui_TextField_prototype;\nextern JSObject* jsb_cocos2d_gui_LayoutParameter_prototype;\nextern JSObject* jsb_cocos2d_gui_PageView_prototype;\nextern JSObject* jsb_cocos2d_gui_ListView_prototype;\n\nvoid register_all_cocos2dx_gui_manual(JSContext* cx, JSObject* global)\n{\n    JS_DefineFunction(cx, jsb_cocos2d_gui_Widget_prototype, \"addTouchEventListener\", js_cocos2dx_UIWidget_addTouchEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_gui_CheckBox_prototype, \"addEventListenerCheckBox\", js_cocos2dx_UICheckBox_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_gui_Slider_prototype, \"addEventListenerSlider\", js_cocos2dx_UISlider_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_gui_TextField_prototype, \"addEventListenerTextField\", js_cocos2dx_UITextField_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_gui_PageView_prototype, \"addEventListenerPageView\", js_cocos2dx_UIPageView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_gui_ListView_prototype, \"addEventListenerListView\", js_cocos2dx_UIListView_addEventListener, 2, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_gui_LayoutParameter_prototype, \"setMargin\", js_cocos2dx_LayoutParameter_setMargin, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n\n    JS_DefineFunction(cx, jsb_cocos2d_gui_LayoutParameter_prototype, \"getMargin\", js_cocos2dx_LayoutParameter_getMargin, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n}"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.h",
    "content": "//\n//  jsb_cocos2dx_gui_manual.h\n//\n//  Created by LinWenhai on 17/11/13.\n//\n//\n\n#ifndef __jsb_cocos2dx_gui_manual__\n#define __jsb_cocos2dx_gui_manual__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nvoid register_all_cocos2dx_gui_manual(JSContext* cx, JSObject* global);\n\n#endif /* defined(__jsb_cocos2dx_gui_manual__) */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/gui/libJSBindingForGui.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_gui_auto.cpp\" />\n    <ClCompile Include=\"jsb_cocos2dx_gui_manual.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_gui_auto.hpp\" />\n    <ClInclude Include=\"jsb_cocos2dx_gui_manual.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_gui_auto_api.js\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{9A844C88-97E8-4E2D-B09A-E138C67D338B}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForGui</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocostudio;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocostudio;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/gui/libJSBindingForGui.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_gui_auto.cpp\">\n      <Filter>generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"jsb_cocos2dx_gui_manual.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_gui_auto.hpp\">\n      <Filter>generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"jsb_cocos2dx_gui_manual.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_gui_auto_api.js\">\n      <Filter>generated</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/js_bindings_config.h",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n#ifndef __JS_BINDINGS_CONFIG_H\n#define __JS_BINDINGS_CONFIG_H\n\n\n/** @def JSB_ASSERT_ON_FAIL\n Whether or not to assert when the arguments or conversions are incorrect.\n It is recommened to turn it off in Release mode.\n */\n#ifndef JSB_ASSERT_ON_FAIL\n#define JSB_ASSERT_ON_FAIL 0\n#endif\n\n\n#if JSB_ASSERT_ON_FAIL\n#define JSB_PRECONDITION( condition, error_msg) do { NSCAssert( condition, [NSString stringWithUTF8String:error_msg] ); } while(0)\n#define JSB_PRECONDITION2( condition, context, ret_value, error_msg) do { NSCAssert( condition, [NSString stringWithUTF8String:error_msg] ); } while(0)\n#define ASSERT( condition, error_msg) do { NSCAssert( condition, [NSString stringWithUTF8String:error_msg] ); } while(0)\n\n#else\n#define JSB_PRECONDITION( condition, ...) do {\t\t\t\t\t\t\t\\\n\tif( ! (condition) ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n        cocos2d::log(\"jsb: ERROR: File %s: Line: %d, Function: %s\", __FILE__, __LINE__, __FUNCTION__ );\t\t\t\\\n        cocos2d::log(__VA_ARGS__);                                        \\\n\t\tJSContext* globalContext = ScriptingCore::getInstance()->getGlobalContext();\t\\\n\t\tif( ! JS_IsExceptionPending( globalContext ) ) {\t\t\t\t\t\t\\\n\t\t\tJS_ReportError( globalContext, __VA_ARGS__ );\t\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\treturn JS_FALSE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n} while(0)\n#define JSB_PRECONDITION2( condition, context, ret_value, ...) do {             \\\n    if( ! (condition) ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n        cocos2d::log(\"jsb: ERROR: File %s: Line: %d, Function: %s\", __FILE__, __LINE__, __FUNCTION__ );\t\t\t\\\n        cocos2d::log(__VA_ARGS__);                                        \\\n        if( ! JS_IsExceptionPending( context ) ) {\t\t\t\t\t\t\t\\\n            JS_ReportError( context, __VA_ARGS__ );\t\t\t\t\t\t\t\t\\\n        }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n        return ret_value;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n    }                                                                           \\\n} while(0)\n#define ASSERT( condition, error_msg) do {\t\t\t\t\t\t\t\t\t\t\\\n\tif( ! (condition) ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\tCCLOG(\"jsb: ERROR in %s: %s\\n\", __FUNCTION__, error_msg);\t\t\t\t\\\n\t\treturn false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t} while(0)\n#endif\n\n#define JSB_PRECONDITION3( condition, context, ret_value, ...) do { \\\n        if( ! (condition) ) return (ret_value); \\\n    } while(0)\n\n\n/** @def JSB_REPRESENT_LONGLONG_AS_STR\n When JSB_REPRESENT_LONGLONG_AS_STR is defined, the long long will be represented as JS strings.\n Otherwise they will be represented as an array of two intengers.\n It is needed to to use an special representation since there are no 64-bit integers in JS.\n Representing the long long as string could be a bit slower, but it is easier to debug from JS.\n Enabled by default.\n */\n#ifndef JSB_REPRESENT_LONGLONG_AS_STR\n#define JSB_REPRESENT_LONGLONG_AS_STR 1\n#endif // JSB_REPRESENT_LONGLONG_AS_STR\n\n\n/** @def JSB_INCLUDE_NS\n Whether or not it should include JS bindings for basic NS* / Cocoa / CocoaTouch objects.\n It should be enabled in order to support bindings for any objective-c projects.\n Not needed for pure C projects.\n Enabled by default.\n */\n#ifndef JSB_INCLUDE_NS\n#define JSB_INCLUDE_NS 1\n#endif // JSB_INCLUDE_NS\n\n\n/** @def JSB_INCLUDE_COCOS2D\n Whether or not it should include JS bindings for cocos2d.\n */\n#ifndef JSB_INCLUDE_COCOS2D\n#define JSB_INCLUDE_COCOS2D 1\n\n#include \"cocos2d.h\"\n#if defined(__CC_PLATFORM_IOS)\n#define JSB_INCLUDE_COCOS2D_IOS 1\n#elif defined(__CC_PLATFORM_MAC)\n#define JSB_INCLUDE_COCOS2D_MAC 1\n#endif\n\n#endif // JSB_INCLUDE_COCOS2D\n\n\n/** @def JSB_INCLUDE_CHIPMUNK\n Whether or not it should include JS bindings for Chipmunk\n */\n#ifndef JSB_INCLUDE_CHIPMUNK\n#define JSB_INCLUDE_CHIPMUNK 1\n#endif // JSB_INCLUDE_CHIPMUNK\n\n\n/** @def JSB_INCLUDE_COCOSBUILDERREADER\n Whether or not it should include JS bindings for CocosBuilder Reader\n */\n#ifndef JSB_INCLUDE_COCOSBUILDERREADER\n#define JSB_INCLUDE_COCOSBUILDERREADER 1\n#endif // JSB_INCLUDE_COCOSBUILDERREADER\n\n/** @def JSB_INCLUDE_COCOSDENSHION\n Whether or not it should include bindings for CocosDenshion (sound engine)\n */\n#ifndef JSB_INCLUDE_COCOSDENSHION\n#define JSB_INCLUDE_COCOSDENSHION 1\n#endif // JSB_INCLUDE_COCOSDENSHION\n\n#if JSB_ENABLE_DEBUGGER\n#define JSB_ENSURE_AUTOCOMPARTMENT(cx, obj) \\\nJSAutoCompartment ac(cx, obj)\n#else\n#define JSB_ENSURE_AUTOCOMPARTMENT(cx, obj)\n#endif\n\n#define JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET \\\nJSAutoCompartment __jsb_ac(ScriptingCore::getInstance()->getGlobalContext(), ScriptingCore::getInstance()->getGlobalObject());\n\n/**\n * @def JSB_DEBUGGER_PORT\n * The port number, where the client will be listening on\n */\n#define JSB_DEBUGGER_PORT 5086\n\n/** @def JSB_INCLUDE_SYSTEM\n Whether or not it should include bindings for system components like LocalStorage\n */\n#ifndef JSB_INCLUDE_SYSTEM\n#define JSB_INCLUDE_SYSTEM 1\n#endif // JSB_INCLUDE_SYSTEM\n\n/** @def JSB_INCLUDE_OPENGL\n Whether or not it should include bindings for WebGL / OpenGL ES 2.0\n */\n#ifndef JSB_INCLUDE_OPENGL\n#define JSB_INCLUDE_OPENGL 1\n#endif // JSB_INCLUDE_OPENGL\n\n/** @def JSB_INCLUDE_XMLHTTP\n Whether or not it should include bindings for XmlHttpRequest\n */\n#ifndef JSB_INCLUDE_XMLHTTP\n#define JSB_INCLUDE_XMLHTTP 1\n#endif // JSB_INCLUDE_XMLHTTP\n\n#ifndef JSB_MAX_STACK_QUOTA\n#define JSB_MAX_STACK_QUOTA 500000\n#endif // JSB_MAX_STACK_QUOTA\n\n#endif // __JS_BINDINGS_CONFIG_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/js_bindings_core.cpp",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n#include \"js_bindings_config.h\"\n#include \"js_bindings_core.h\"\n\n\n// cocos2d + chipmunk registration files\n#include \"chipmunk/js_bindings_chipmunk_registration.h\"\n\n\n//#pragma mark - Hash\n\nusing namespace cocos2d;\n\ntypedef struct _hashJSObject\n{\n\tJSObject\t\t\t*jsObject;\n\tvoid\t\t\t\t*proxy;\n\tUT_hash_handle\t\thh;\n} tHashJSObject;\n\nstatic tHashJSObject *hash = NULL;\nstatic tHashJSObject *reverse_hash = NULL;\n\n//#pragma mark JSBCore - Helper free functions\nstatic void reportError(JSContext *cx, const char *message, JSErrorReport *report)\n{\n\tfprintf(stderr, \"%s:%u:%s\\n\",  \n\t\t\treport->filename ? report->filename : \"<no filename=\\\"filename\\\">\",  \n\t\t\t(unsigned int) report->lineno,  \n\t\t\tmessage);\n};\n\n\n// Hash of JSObject -> proxy\nvoid* jsb_get_proxy_for_jsobject(JSObject *obj)\n{\n\ttHashJSObject *element = NULL;\n\tHASH_FIND_PTR(hash, &obj, element);\n\t\n\tif( element )\n\t\treturn element->proxy;\n\treturn NULL;\n}\n\nvoid jsb_set_proxy_for_jsobject(void *proxy, JSObject *obj)\n{\n\tCCASSERT( !jsb_get_proxy_for_jsobject(obj), \"Already added. abort\");\n\t\n//\tprintf(\"Setting proxy for: %p - %p (%s)\\n\", obj, proxy, [[proxy description] UTF8String] );\n\t\n\ttHashJSObject *element = (tHashJSObject*) malloc( sizeof( *element ) );\n\n\t// XXX: Do not retain it here.\n//\t[proxy retain];\n\telement->proxy = proxy;\n\telement->jsObject = obj;\n\n\tHASH_ADD_PTR( hash, jsObject, element );\n}\n\nvoid jsb_del_proxy_for_jsobject(JSObject *obj)\n{\n\ttHashJSObject *element = NULL;\n\tHASH_FIND_PTR(hash, &obj, element);\n\tif( element ) {\t\t\n\t\tHASH_DEL(hash, element);\n\t\tfree(element);\n\t}\n}\n\n//#pragma mark Proxy -> JSObject\n\n// Reverse hash: Proxy -> JSObject\nJSObject* jsb_get_jsobject_for_proxy(void *proxy)\n{\n\ttHashJSObject *element = NULL;\n\tHASH_FIND_PTR(reverse_hash, &proxy, element);\n\t\n\tif( element )\n\t\treturn element->jsObject;\n\treturn NULL;\n}\n\nvoid jsb_set_jsobject_for_proxy(JSObject *jsobj, void* proxy)\n{\n\tCCASSERT( !jsb_get_jsobject_for_proxy(proxy), \"Already added. abort\");\n\t\n\ttHashJSObject *element = (tHashJSObject*) malloc( sizeof( *element ) );\n\t\n\telement->proxy = proxy;\n\telement->jsObject = jsobj;\n\t\n\tHASH_ADD_PTR( reverse_hash, proxy, element );\n}\n\nvoid jsb_del_jsobject_for_proxy(void* proxy)\n{\n\ttHashJSObject *element = NULL;\n\tHASH_FIND_PTR(reverse_hash, &proxy, element);\n\tif( element ) {\t\t\n\t\tHASH_DEL(reverse_hash, element);\n\t\tfree(element);\n\t}\t\n}\n\n//#pragma mark\n\n\n//#pragma mark \"C\" proxy functions\n\nstruct jsb_c_proxy_s* jsb_get_c_proxy_for_jsobject( JSObject *jsobj )\n{\n\tstruct jsb_c_proxy_s *proxy = (struct jsb_c_proxy_s *) JS_GetPrivate(jsobj);\n\n\treturn proxy;\n}\n\nvoid jsb_del_c_proxy_for_jsobject( JSObject *jsobj )\n{\n\tstruct jsb_c_proxy_s *proxy = (struct jsb_c_proxy_s *) JS_GetPrivate(jsobj);\n\tCCASSERT(proxy, \"Invalid proxy for JSObject\");\n\tJS_SetPrivate(jsobj, NULL);\n\t\n\tfree(proxy);\n}\n\nvoid jsb_set_c_proxy_for_jsobject( JSObject *jsobj, void *handle, unsigned long flags)\n{\n\tstruct jsb_c_proxy_s *proxy = (struct jsb_c_proxy_s*) malloc(sizeof(*proxy));\n\tCCASSERT(proxy, \"No memory for proxy\");\n\t\n\tproxy->handle = handle;\n\tproxy->flags = flags;\n\tproxy->jsobj = jsobj;\n\t\n\tJS_SetPrivate(jsobj, proxy);\n}\n\n\n//#pragma mark Do Nothing - Callbacks\n\nJSBool JSB_do_nothing(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/js_bindings_core.h",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n#ifndef __JS_BINDINGS_CORE_H__\n#define __JS_BINDINGS_CORE_H__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n#include \"cocos2d.h\"\n#include \"chipmunk.h\"\n#include \"SimpleAudioEngine.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\tenum {\n\t\tJSB_C_FLAG_CALL_FREE = 0,\n\t\tJSB_C_FLAG_DO_NOT_CALL_FREE =1,\n\t};\n\n\t// structure used by \"Object Oriented Functions\".\n\t// handle is a pointer to the native object\n\t// flags: flags for the object\n\tstruct jsb_c_proxy_s {\n\t\tunsigned long flags;\t// Should it be removed at \"destructor\" time, or not ?\n\t\tvoid *handle;\t\t\t// native object, like cpSpace, cpBody, etc.\n\t\tJSObject *jsobj;\t\t// JS Object. Needed for rooting / unrooting\n\t};\n\t\n\t// Functions for setting / removing / getting the proxy used by the \"C\" Object Oriented API. Think of Chipmunk classes\n\tstruct jsb_c_proxy_s* jsb_get_c_proxy_for_jsobject( JSObject *jsobj );\n\tvoid jsb_del_c_proxy_for_jsobject( JSObject *jsobj );\n\tvoid jsb_set_c_proxy_for_jsobject( JSObject *jsobj, void *handle, unsigned long flags);\n\n\t// JSObject -> proxy\n\t/** gets a proxy for a given JSObject */\n\tvoid* jsb_get_proxy_for_jsobject(JSObject *jsobj);\n\t/** sets a proxy for a given JSObject */\n\tvoid jsb_set_proxy_for_jsobject(void* proxy, JSObject *jsobj);\n\t/** dels a proxy for a given JSObject */\n\tvoid jsb_del_proxy_for_jsobject(JSObject *jsobj);\n\n\t// reverse: proxy -> JSObject\n\t/** gets a JSObject for a given proxy */\n\tJSObject* jsb_get_jsobject_for_proxy(void *proxy);\n\t/** sets a JSObject for a given proxy */\n\tvoid jsb_set_jsobject_for_proxy(JSObject *jsobj, void* proxy);\n\t/** delts a JSObject for a given proxy */\n\tvoid jsb_del_jsobject_for_proxy(void* proxy);\n\t\n\t\n\t// needed for callbacks. It does nothing.\n\tJSBool JSB_do_nothing(JSContext *cx, uint32_t argc, jsval *vp);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __JS_BINDINGS_CORE_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/js_bindings_opengl.cpp",
    "content": "#include \"js_bindings_opengl.h\"\n\nvoid GLNode::draw() {\n    js_proxy_t* proxy = NULL;\n    JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n    proxy = js_get_or_create_proxy<cocos2d::Node>(cx, this);\n\n    if( proxy ) {\n        JSObject *jsObj = proxy->obj;\n        if (jsObj) {\n            JSBool found;\n            JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n                    JS_HasProperty(cx, jsObj, \"draw\", &found);\n            if (found == JS_TRUE) {\n                JS::RootedValue rval(cx);\n                JS::RootedValue fval(cx);\n                jsval *argv = NULL; unsigned argc=0;\n\n                JS_GetProperty(cx, jsObj, \"draw\", &fval);\n                JS_CallFunctionValue(cx, jsObj, fval, argc, argv, rval.address());\n            }\n        }\n    }\n}\n\n\nJSClass  *js_cocos2dx_GLNode_class;\nJSObject *js_cocos2dx_GLNode_prototype;\n\nJSBool js_cocos2dx_GLNode_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\n    if (argc == 0) {\n        GLNode* cobj = new GLNode();\n        cocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n        if (_ccobj) {\n            _ccobj->autorelease();\n        }\n\n        TypeTest<GLNode> t;\n        js_type_class_t *typeClass = nullptr;\n        std::string typeName = t.s_name();\n        auto typeMapIter = _js_global_type_map.find(typeName);\n\n        CCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n        typeClass = typeMapIter->second;\n        CCASSERT(typeClass, \"The value is null.\");\n\n        JSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n        JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n        // link the native object with the javascript object\n        js_proxy_t *p = jsb_new_proxy(cobj, obj);\n\n        JS_AddNamedObjectRoot(cx, &p->obj, \"cocos2d::GLNode\");\n\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n    return JS_FALSE;\n}\n\nvoid js_cocos2dx_GLNode_finalize(JSFreeOp *fop, JSObject *obj) {\n}\n\nstatic JSBool js_cocos2dx_GLNode_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    GLNode *nobj = new GLNode();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n    nobj->autorelease();\n    JS_AddNamedObjectRoot(cx, &p->obj, \"GLNode\");\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n\nJSBool js_cocos2dx_GLNode_create(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    GLNode* ret = new GLNode();\n    jsval jsret;\n    do {\n        if (ret) {\n            js_proxy_t *proxy = js_get_or_create_proxy<GLNode>(cx, ret);\n            jsret = OBJECT_TO_JSVAL(proxy->obj);\n        } else {\n            jsret = JSVAL_NULL;\n        }\n    } while (0);\n    JS_SET_RVAL(cx, vp, jsret);\n    return JS_TRUE;\n}\n\nextern JSObject* jsb_cocos2d_Node_prototype;\n\nvoid js_register_cocos2dx_GLNode(JSContext *cx, JSObject *global) {\n    js_cocos2dx_GLNode_class = (JSClass *)calloc(1, sizeof(JSClass));\n    js_cocos2dx_GLNode_class->name = \"GLNode\";\n    js_cocos2dx_GLNode_class->addProperty = JS_PropertyStub;\n    js_cocos2dx_GLNode_class->delProperty = JS_DeletePropertyStub;\n    js_cocos2dx_GLNode_class->getProperty = JS_PropertyStub;\n    js_cocos2dx_GLNode_class->setProperty = JS_StrictPropertyStub;\n    js_cocos2dx_GLNode_class->enumerate = JS_EnumerateStub;\n    js_cocos2dx_GLNode_class->resolve = JS_ResolveStub;\n    js_cocos2dx_GLNode_class->convert = JS_ConvertStub;\n    js_cocos2dx_GLNode_class->finalize = js_cocos2dx_GLNode_finalize;\n    js_cocos2dx_GLNode_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n    static JSPropertySpec properties[] = {\n        {0, 0, 0, 0, 0}\n    };\n\n    static JSFunctionSpec funcs[] = {\n        JS_FN(\"ctor\", js_cocos2dx_GLNode_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n    };\n\n    static JSFunctionSpec st_funcs[] = {\n        JS_FN(\"create\", js_cocos2dx_GLNode_create, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n    };\n\n    js_cocos2dx_GLNode_prototype = JS_InitClass(\n        cx, global,\n        jsb_cocos2d_Node_prototype,\n        js_cocos2dx_GLNode_class,\n        js_cocos2dx_GLNode_constructor, 0, // constructor\n        properties,\n        funcs,\n        NULL, // no static properties\n        st_funcs);\n    // make the class enumerable in the registered namespace\n    JSBool found;\n    JS_SetPropertyAttributes(cx, global, \"GLNode\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n    // add the proto and JSClass to the type->js info hash table\n    TypeTest<GLNode> t;\n    js_type_class_t *p;\n    std::string typeName = t.s_name();\n    if (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n    {\n        p = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n        p->jsclass = js_cocos2dx_GLNode_class;\n        p->proto = js_cocos2dx_GLNode_prototype;\n        p->parentProto = jsb_cocos2d_Node_prototype;\n        _js_global_type_map.insert(std::make_pair(typeName, p));\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/js_bindings_opengl.h",
    "content": "#include \"cocos2d.h\"\n#include \"ScriptingCore.h\"\n#include \"cocos2d_specifics.hpp\"\n\nclass GLNode : public cocos2d::Node {\n public:\n  void draw();\n};\n\nvoid js_register_cocos2dx_GLNode(JSContext *cx, JSObject *global);"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/js_manual_conversions.cpp",
    "content": "//\n//  Created by Rohan Kuruvilla\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n#include \"ScriptingCore.h\"\n#include \"js_bindings_config.h\"\n#include \"js_manual_conversions.h\"\n#include \"cocos2d_specifics.hpp\"\n\nUSING_NS_CC;\n\n// JSStringWrapper\nJSStringWrapper::JSStringWrapper()\n: _buffer(nullptr)\n{\n}\n\nJSStringWrapper::JSStringWrapper(JSString* str, JSContext* cx/* = NULL*/)\n: _buffer(nullptr)\n{\n    set(str, cx);\n}\n\nJSStringWrapper::JSStringWrapper(jsval val, JSContext* cx/* = NULL*/)\n: _buffer(nullptr)\n{\n    set(val, cx);\n}\n\nJSStringWrapper::~JSStringWrapper()\n{\n    CC_SAFE_DELETE_ARRAY(_buffer);\n}\n\nvoid JSStringWrapper::set(jsval val, JSContext* cx)\n{\n    if (val.isString())\n    {\n        this->set(val.toString(), cx);\n    }\n    else\n    {\n        CC_SAFE_DELETE_ARRAY(_buffer);\n    }\n}\n\nvoid JSStringWrapper::set(JSString* str, JSContext* cx)\n{\n    CC_SAFE_DELETE_ARRAY(_buffer);\n    \n    if (!cx)\n    {\n        cx = ScriptingCore::getInstance()->getGlobalContext();\n    }\n    // JS_EncodeString isn't supported in SpiderMonkey ff19.0.\n    //buffer = JS_EncodeString(cx, string);\n    unsigned short* pStrUTF16 = (unsigned short*)JS_GetStringCharsZ(cx, str);\n    \n    _buffer = cc_utf16_to_utf8(pStrUTF16, -1, NULL, NULL);\n}\n\nconst char* JSStringWrapper::get()\n{\n    return _buffer ? _buffer : \"\";\n}\n\n// JSFunctionWrapper\nJSFunctionWrapper::JSFunctionWrapper(JSContext* cx, JSObject *jsthis, jsval fval)\n: _cx(cx)\n, _jsthis(jsthis)\n, _fval(fval)\n{\n    JS_AddNamedValueRoot(cx, &this->_fval, \"JSFunctionWrapper\");\n    JS_AddNamedObjectRoot(cx, &this->_jsthis, \"JSFunctionWrapper\");\n}\n\nJSFunctionWrapper::~JSFunctionWrapper()\n{\n    JS_RemoveValueRoot(this->_cx, &this->_fval);\n    JS_RemoveObjectRoot(this->_cx, &this->_jsthis);\n}\n\nJSBool JSFunctionWrapper::invoke(unsigned int argc, jsval *argv, jsval &rval)\n{\n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n    \n    return JS_CallFunctionValue(this->_cx, this->_jsthis, this->_fval, argc, argv, &rval);\n}\n\nstatic Color3B getColorFromJSObject(JSContext *cx, JSObject *colorObject)\n{\n    JS::RootedValue jsr(cx);\n    Color3B out;\n    JS_GetProperty(cx, colorObject, \"r\", &jsr);\n    double fontR = 0.0;\n    JS_ValueToNumber(cx, jsr, &fontR);\n    \n    JS_GetProperty(cx, colorObject, \"g\", &jsr);\n    double fontG = 0.0;\n    JS_ValueToNumber(cx, jsr, &fontG);\n    \n    JS_GetProperty(cx, colorObject, \"b\", &jsr);\n    double fontB = 0.0;\n    JS_ValueToNumber(cx, jsr, &fontB);\n    \n    // the out\n    out.r = (unsigned char)fontR;\n    out.g = (unsigned char)fontG;\n    out.b = (unsigned char)fontB;\n    \n    return out;\n}\n\nstatic Size getSizeFromJSObject(JSContext *cx, JSObject *sizeObject)\n{\n    JS::RootedValue jsr(cx);\n    Size out;\n    JS_GetProperty(cx, sizeObject, \"width\", &jsr);\n    double width = 0.0;\n    JS_ValueToNumber(cx, jsr, &width);\n    \n    JS_GetProperty(cx, sizeObject, \"height\", &jsr);\n    double height = 0.0;\n    JS_ValueToNumber(cx, jsr, &height);\n    \n    \n    // the out\n    out.width  = width;\n    out.height = height;\n    \n    return out;\n}\n\nJSBool jsval_to_opaque( JSContext *cx, jsval vp, void **r)\n{\n#ifdef __LP64__\n\n    // begin\n\tJSObject *tmp_arg;\n\tJSBool ok = JS_ValueToObject( cx, vp, &tmp_arg );\n\tJSB_PRECONDITION2( ok, cx, JS_FALSE, \"Error converting value to object\");\n\tJSB_PRECONDITION2( tmp_arg && JS_IsTypedArrayObject( tmp_arg ), cx, JS_FALSE, \"Not a TypedArray object\");\n\tJSB_PRECONDITION2( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(void*), cx, JS_FALSE, \"Invalid Typed Array length\");\n\n\tuint32_t* arg_array = (uint32_t*)JS_GetArrayBufferViewData( tmp_arg );\n\tuint64_t ret =  arg_array[0];\n\tret = ret << 32;\n\tret |= arg_array[1];\n\n#else\n\tassert( sizeof(int)==4);\n\tint32_t ret;\n\tif( ! jsval_to_int32(cx, vp, &ret ) )\n\t  return JS_FALSE;\n#endif\n\t*r = (void*)ret;\n\treturn JS_TRUE;\n}\n\nJSBool jsval_to_int( JSContext *cx, jsval vp, int *ret )\n{\n\t// Since this is called to cast uint64 to uint32,\n\t// it is needed to initialize the value to 0 first\n#ifdef __LP64__\n\tlong *tmp = (long*)ret;\n\t*tmp = 0;\n#endif\n\treturn jsval_to_int32(cx, vp, (int32_t*)ret);\n}\n\njsval opaque_to_jsval( JSContext *cx, void *opaque )\n{\n#ifdef __LP64__\n\tuint64_t number = (uint64_t)opaque;\n\tJSObject *typedArray = JS_NewUint32Array( cx, 2 );\n\tuint32_t *buffer = (uint32_t*)JS_GetArrayBufferViewData(typedArray);\n\tbuffer[0] = number >> 32;\n\tbuffer[1] = number & 0xffffffff;\n\treturn OBJECT_TO_JSVAL(typedArray);\n#else\n\tassert(sizeof(int)==4);\n\tint32_t number = (int32_t) opaque;\n\treturn INT_TO_JSVAL(number);\n#endif\n}\n\njsval c_class_to_jsval( JSContext *cx, void* handle, JSObject* object, JSClass *klass, const char* class_name)\n{\n\tJSObject *jsobj;\n    \n\tjsobj = jsb_get_jsobject_for_proxy(handle);\n\tif( !jsobj ) {\n\t\tjsobj = JS_NewObject(cx, klass, object, NULL);\n\t\tCCASSERT(jsobj, \"Invalid object\");\n\t\tjsb_set_c_proxy_for_jsobject(jsobj, handle, JSB_C_FLAG_DO_NOT_CALL_FREE);\n\t\tjsb_set_jsobject_for_proxy(jsobj, handle);\n\t}\n    \n\treturn OBJECT_TO_JSVAL(jsobj);\n}\n\nJSBool jsval_to_c_class( JSContext *cx, jsval vp, void **out_native, struct jsb_c_proxy_s **out_proxy)\n{\n\tJSObject *jsobj;\n\tJSBool ok = JS_ValueToObject(cx, vp, &jsobj);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error converting jsval to object\");\n\t\n\tstruct jsb_c_proxy_s *proxy = jsb_get_c_proxy_for_jsobject(jsobj);\n\t*out_native = proxy->handle;\n\tif( out_proxy )\n\t\t*out_proxy = proxy;\n\treturn JS_TRUE;\n}\n\nJSBool jsval_to_uint( JSContext *cx, jsval vp, unsigned int *ret )\n{\n\t// Since this is called to cast uint64 to uint32,\n\t// it is needed to initialize the value to 0 first\n#ifdef __LP64__\n\tlong *tmp = (long*)ret;\n\t*tmp = 0;\n#endif\n\treturn jsval_to_int32(cx, vp, (int32_t*)ret);\n}\n\njsval long_to_jsval( JSContext *cx, long number )\n{\n#ifdef __LP64__\n\tassert( sizeof(long)==8);\n\n\tchar chr[128];\n\tsnprintf(chr, sizeof(chr)-1, \"%ld\", number);\n\tJSString *ret_obj = JS_NewStringCopyZ(cx, chr);\n\treturn STRING_TO_JSVAL(ret_obj);\n#else\n\tCCASSERT( sizeof(int)==4, \"Error!\");\n\treturn INT_TO_JSVAL(number);\n#endif\n}\n\njsval ulong_to_jsval( JSContext *cx, unsigned long number )\n{\n#ifdef __LP64__\n\tassert( sizeof(unsigned long)==8);\n    \n\tchar chr[128];\n\tsnprintf(chr, sizeof(chr)-1, \"%lu\", number);\n\tJSString *ret_obj = JS_NewStringCopyZ(cx, chr);\n\treturn STRING_TO_JSVAL(ret_obj);\n#else\n\tCCASSERT( sizeof(int)==4, \"Error!\");\n\treturn UINT_TO_JSVAL(number);\n#endif\n}\n\njsval longlong_to_jsval( JSContext *cx, long long number )\n{\n#if JSB_REPRESENT_LONGLONG_AS_STR\n\tchar chr[128];\n\tsnprintf(chr, sizeof(chr)-1, \"%lld\", number);\n\tJSString *ret_obj = JS_NewStringCopyZ(cx, chr);\n\treturn STRING_TO_JSVAL(ret_obj);\n    \n#else\n\tCCASSERT( sizeof(long long)==8, \"Error!\");\n\tJSObject *typedArray = JS_NewUint32Array( cx, 2 );\n\tuint32_t *buffer = (uint32_t*)JS_GetArrayBufferViewData(typedArray, cx);\n\tbuffer[0] = number >> 32;\n\tbuffer[1] = number & 0xffffffff;\n\treturn OBJECT_TO_JSVAL(typedArray);\n#endif\n}\n\nJSBool jsval_to_charptr( JSContext *cx, jsval vp, const char **ret )\n{\n    JSString *jsstr = JS_ValueToString( cx, vp );\n    JSB_PRECONDITION2( jsstr, cx, JS_FALSE, \"invalid string\" );\n\n    // root it\n    vp = STRING_TO_JSVAL(jsstr);\n\n    JSStringWrapper strWrapper(jsstr);\n    \n    // XXX: It is converted to String and then back to char* to autorelease the created object.\n    String *tmp = String::create(strWrapper.get());\n\n    JSB_PRECONDITION2( tmp, cx, JS_FALSE, \"Error creating string from UTF8\");\n\n    *ret = tmp->getCString();\n\n    return JS_TRUE;\n}\n\njsval charptr_to_jsval( JSContext *cx, const char *str)\n{\n    return c_string_to_jsval(cx, str);\n}\n\nJSBool JSB_jsval_typedarray_to_dataptr( JSContext *cx, jsval vp, GLsizei *count, void **data, JSArrayBufferViewType t)\n{\n\tJSObject *jsobj;\n\tJSBool ok = JS_ValueToObject( cx, vp, &jsobj );\n\tJSB_PRECONDITION2( ok && jsobj, cx, JS_FALSE, \"Error converting value to object\");\n    \n\t// WebGL supports TypedArray and sequences for some of its APIs. So when converting a TypedArray, we should\n\t// also check for a possible non-Typed Array JS object, like a JS Array.\n    \n\tif( JS_IsTypedArrayObject( jsobj ) ) {\n        \n\t\t*count = JS_GetTypedArrayLength(jsobj);\n\t\tJSArrayBufferViewType type = JS_GetArrayBufferViewType(jsobj);\n\t\tJSB_PRECONDITION2(t==type, cx, JS_FALSE, \"TypedArray type different than expected type\");\n        \n\t\tswitch (t) {\n\t\t\tcase js::ArrayBufferView::TYPE_INT8:\n\t\t\tcase js::ArrayBufferView::TYPE_UINT8:\n\t\t\t\t*data = JS_GetUint8ArrayData(jsobj);\n\t\t\t\tbreak;\n                \n\t\t\tcase js::ArrayBufferView::TYPE_INT16:\n\t\t\tcase js::ArrayBufferView::TYPE_UINT16:\n\t\t\t\t*data = JS_GetUint16ArrayData(jsobj);\n\t\t\t\tbreak;\n                \n\t\t\tcase js::ArrayBufferView::TYPE_INT32:\n\t\t\tcase js::ArrayBufferView::TYPE_UINT32:\n\t\t\t\t*data = JS_GetUint32ArrayData(jsobj);\n\t\t\t\tbreak;\n                \n\t\t\tcase js::ArrayBufferView::TYPE_FLOAT32:\n\t\t\t\t*data = JS_GetFloat32ArrayData(jsobj);\n\t\t\t\tbreak;\n                \n\t\t\tdefault:\n\t\t\t\tJSB_PRECONDITION2(false, cx, JS_FALSE, \"Unsupported typedarray type\");\n\t\t\t\tbreak;\n\t\t}\n\t} else if( JS_IsArrayObject(cx, jsobj)) {\n\t\t// Slow... avoid it. Use TypedArray instead, but the spec says that it can receive\n\t\t// Sequence<> as well.\n\t\tuint32_t length;\n\t\tJS_GetArrayLength(cx, jsobj, &length);\n        \n\t\tfor( uint32_t i=0; i<length;i++ ) {\n            \n\t\t\tjsval valarg;\n\t\t\tJS_GetElement(cx, jsobj, i, &valarg);\n            \n\t\t\tswitch(t) {\n\t\t\t\tcase js::ArrayBufferView::TYPE_INT32:\n\t\t\t\tcase js::ArrayBufferView::TYPE_UINT32:\n\t\t\t\t{\n\t\t\t\t\tuint32_t e = JSVAL_TO_INT(valarg);\n\t\t\t\t\t((uint32_t*)data)[i] = e;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase js::ArrayBufferView::TYPE_FLOAT32:\n\t\t\t\t{\n\t\t\t\t\tdouble e = JSVAL_TO_DOUBLE(valarg);\n\t\t\t\t\t((GLfloat*)data)[i] = (GLfloat)e;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tJSB_PRECONDITION2(false, cx, JS_FALSE, \"Unsupported typedarray type\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n        \n\t} else\n\t\tJSB_PRECONDITION2(false, cx, JS_FALSE, \"Object shall be a TypedArray or Sequence\");\n    \n\treturn JS_TRUE;\n}\n\nJSBool JSB_get_arraybufferview_dataptr( JSContext *cx, jsval vp, GLsizei *count, GLvoid **data )\n{\n\tJSObject *jsobj;\n\tJSBool ok = JS_ValueToObject( cx, vp, &jsobj );\n\tJSB_PRECONDITION2( ok && jsobj, cx, JS_FALSE, \"Error converting value to object\");\n\tJSB_PRECONDITION2( JS_IsArrayBufferViewObject(jsobj), cx, JS_FALSE, \"Not an ArrayBufferView object\");\n    \n\t*data = JS_GetArrayBufferViewData(jsobj);\n\t*count = JS_GetArrayBufferViewByteLength(jsobj);\n    \n\treturn JS_TRUE;\n}\n\n\n#pragma mark - Conversion Routines\nJSBool jsval_to_ushort( JSContext *cx, jsval vp, unsigned short *outval )\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    ok &= !isnan(dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    *outval = (unsigned short)dp;\n\n    return ok;\n}\n\nJSBool jsval_to_int32( JSContext *cx, jsval vp, int32_t *outval )\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    ok &= !isnan(dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    *outval = (int32_t)dp;\n    \n    return ok;\n}\n\nJSBool jsval_to_uint32( JSContext *cx, jsval vp, uint32_t *outval )\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    ok &= !isnan(dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    *outval = (uint32_t)dp;\n    \n    return ok;\n}\n\nJSBool jsval_to_uint16( JSContext *cx, jsval vp, uint16_t *outval )\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    ok &= !isnan(dp);\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    *outval = (uint16_t)dp;\n    \n    return ok;\n}\n\n// XXX: sizeof(long) == 8 in 64 bits on OS X... apparently on Windows it is 32 bits (???)\nJSBool jsval_to_long( JSContext *cx, jsval vp, long *r )\n{\n#ifdef __LP64__\n\t// compatibility check\n\tassert( sizeof(long)==8);\n\tJSString *jsstr = JS_ValueToString(cx, vp);\n\tJSB_PRECONDITION2(jsstr, cx, JS_FALSE, \"Error converting value to string\");\n    \n\tchar *str = JS_EncodeString(cx, jsstr);\n\tJSB_PRECONDITION2(str, cx, JS_FALSE, \"Error encoding string\");\n    \n\tchar *endptr;\n\tlong ret = strtol(str, &endptr, 10);\n    \n\t*r = ret;\n\treturn JS_TRUE;\n    \n#else\n\t// compatibility check\n\tassert( sizeof(int)==4);\n\tlong ret = JSVAL_TO_INT(vp);\n#endif\n\t\n\t*r = ret;\n\treturn JS_TRUE;\n}\n\n\nJSBool jsval_to_ulong( JSContext *cx, jsval vp, unsigned long *out)\n{\n    if (out == nullptr)\n        return JS_FALSE;\n    \n    long rval = 0;\n    JSBool ret = JS_FALSE;\n    ret = jsval_to_long(cx, vp, &rval);\n    if (ret)\n    {\n        *out = (unsigned long)rval;\n    }\n    return ret;\n}\n\nJSBool jsval_to_long_long(JSContext *cx, jsval vp, long long* r)\n{\n\tJSObject *tmp_arg;\n\tJSBool ok = JS_ValueToObject( cx, vp, &tmp_arg );\n\tJSB_PRECONDITION3( ok, cx, JS_FALSE, \"Error converting value to object\");\n\tJSB_PRECONDITION3( tmp_arg && JS_IsTypedArrayObject( tmp_arg ), cx, JS_FALSE, \"Not a TypedArray object\");\n\tJSB_PRECONDITION3( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(long long), cx, JS_FALSE, \"Invalid Typed Array length\");\n\t\n\tuint32_t* arg_array = (uint32_t*)JS_GetArrayBufferViewData( tmp_arg );\n\tlong long ret =  arg_array[0];\n\tret = ret << 32;\n\tret |= arg_array[1];\n\t\n\t*r = ret;\n\treturn JS_TRUE;\n}\n\nJSBool jsval_to_std_string(JSContext *cx, jsval v, std::string* ret) {\n    JSString *tmp = JS_ValueToString(cx, v);\n    JSB_PRECONDITION3(tmp, cx, JS_FALSE, \"Error processing arguments\");\n    \n    JSStringWrapper str(tmp);\n    *ret = str.get();\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccpoint(JSContext *cx, jsval v, Point* ret) {\n    JSObject *tmp;\n    JS::RootedValue jsx(cx);\n    JS::RootedValue jsy(cx);\n    double x, y;\n    JSBool ok = v.isObject() &&\n    JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"x\", &jsx) &&\n    JS_GetProperty(cx, tmp, \"y\", &jsy) &&\n    JS_ValueToNumber(cx, jsx, &x) &&\n    JS_ValueToNumber(cx, jsy, &y);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    ret->x = (float)x;\n    ret->y = (float)y;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccacceleration(JSContext* cx,jsval v, Acceleration* ret) {\n    JSObject *tmp;\n    JS::RootedValue jsx(cx);\n    JS::RootedValue jsy(cx);\n    JS::RootedValue jsz(cx);\n    JS::RootedValue jstimestamp(cx);\n    \n    double x, y, timestamp, z;\n    JSBool ok = v.isObject() &&\n    JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"x\", &jsx) &&\n    JS_GetProperty(cx, tmp, \"y\", &jsy) &&\n    JS_GetProperty(cx, tmp, \"z\", &jsz) &&\n    JS_GetProperty(cx, tmp, \"timestamp\", &jstimestamp) &&\n    JS_ValueToNumber(cx, jsx, &x) &&\n    JS_ValueToNumber(cx, jsy, &y) &&\n    JS_ValueToNumber(cx, jsz, &z) &&\n    JS_ValueToNumber(cx, jstimestamp, &timestamp);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    ret->x = x;\n    ret->y = y;\n    ret->z = z;\n    ret->timestamp = timestamp;\n    return JS_TRUE;\n}\n\nJSBool jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc, Array** ret)\n{\n    JSBool ok = JS_TRUE;\n    Array* pArray = Array::create();\n    for( int i=0; i < argc; i++ )\n    {\n        double num = 0.0;\n        // optimization: JS_ValueToNumber is expensive. And can convert an string like \"12\" to a number\n        if ( JSVAL_IS_NUMBER(*vp)) {\n            ok &= JS_ValueToNumber(cx, *vp, &num );\n            if (!ok) {\n                break;\n            }\n            pArray->addObject(Integer::create((int)num));\n        }\n        else if (JSVAL_IS_STRING(*vp))\n        {\n            JSStringWrapper str(JSVAL_TO_STRING(*vp), cx);\n            pArray->addObject(String::create(str.get()));\n        }\n        else\n        {\n            js_proxy_t* p;\n            JSObject* obj = JSVAL_TO_OBJECT(*vp);\n            p = jsb_get_js_proxy(obj);\n            if (p) {\n                pArray->addObject((Object*)p->ptr);\n            }\n        }\n        // next\n        vp++;\n    }\n    *ret = pArray;\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    return ok;\n}\n\nJSBool jsvals_variadic_to_ccvaluevector( JSContext *cx, jsval *vp, int argc, cocos2d::ValueVector* ret)\n{\n    \n    for (int i = 0; i < argc; i++)\n    {\n        jsval value = *vp;\n        if (value.isObject())\n        {\n            JSObject* jsobj = JSVAL_TO_OBJECT(value);\n            CCASSERT(jsb_get_js_proxy(jsobj) == nullptr, \"Native object should be added!\");\n            \n            if (!JS_IsArrayObject(cx, jsobj))\n            {\n                // It's a normal js object.\n                ValueMap dictVal;\n                JSBool ok = jsval_to_ccvaluemap(cx, value, &dictVal);\n                if (ok)\n                {\n                    ret->push_back(Value(dictVal));\n                }\n            }\n            else {\n                // It's a js array object.\n                ValueVector arrVal;\n                JSBool ok = jsval_to_ccvaluevector(cx, value, &arrVal);\n                if (ok)\n                {\n                    ret->push_back(Value(arrVal));\n                }\n            }\n        }\n        else if (JSVAL_IS_STRING(value))\n        {\n            JSStringWrapper valueWapper(JSVAL_TO_STRING(value), cx);\n            ret->push_back(Value(valueWapper.get()));\n        }\n        else if (JSVAL_IS_NUMBER(value))\n        {\n            double number = 0.0;\n            JSBool ok = JS_ValueToNumber(cx, value, &number);\n            if (ok)\n            {\n                ret->push_back(Value(number));\n            }\n        }\n        else if (JSVAL_IS_BOOLEAN(value))\n        {\n            JSBool boolVal = JS_FALSE;\n            JSBool ok = JS_ValueToBoolean(cx, value, &boolVal);\n            if (ok)\n            {\n                ret->push_back(Value(boolVal));\n            }\n        }\n        else\n        {\n            CCASSERT(false, \"not supported type\");\n        }\n        // next\n        vp++;\n    }\n    \n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccrect(JSContext *cx, jsval v, Rect* ret) {\n    JSObject *tmp;\n    JS::RootedValue jsx(cx);\n    JS::RootedValue jsy(cx);\n    JS::RootedValue jswidth(cx);\n    JS::RootedValue jsheight(cx);\n    \n    double x, y, width, height;\n    JSBool ok = v.isObject() &&\n    JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"x\", &jsx) &&\n    JS_GetProperty(cx, tmp, \"y\", &jsy) &&\n    JS_GetProperty(cx, tmp, \"width\", &jswidth) &&\n    JS_GetProperty(cx, tmp, \"height\", &jsheight) &&\n    JS_ValueToNumber(cx, jsx, &x) &&\n    JS_ValueToNumber(cx, jsy, &y) &&\n    JS_ValueToNumber(cx, jswidth, &width) &&\n    JS_ValueToNumber(cx, jsheight, &height);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    ret->origin.x = x;\n    ret->origin.y = y;\n    ret->size.width = width;\n    ret->size.height = height;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccsize(JSContext *cx, jsval v, Size* ret) {\n    JSObject *tmp;\n    JS::RootedValue jsw(cx);\n    JS::RootedValue jsh(cx);\n    double w, h;\n    JSBool ok = v.isObject() &&\n    JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"width\", &jsw) &&\n    JS_GetProperty(cx, tmp, \"height\", &jsh) &&\n    JS_ValueToNumber(cx, jsw, &w) &&\n    JS_ValueToNumber(cx, jsh, &h);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    ret->width = w;\n    ret->height = h;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_cccolor4b(JSContext *cx, jsval v, Color4B* ret) {\n    JSObject *tmp;\n    JS::RootedValue jsr(cx);\n    JS::RootedValue jsg(cx);\n    JS::RootedValue jsb(cx);\n    JS::RootedValue jsa(cx);\n    \n    double r, g, b, a;\n    JSBool ok = v.isObject() &&\n    JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"r\", &jsr) &&\n    JS_GetProperty(cx, tmp, \"g\", &jsg) &&\n    JS_GetProperty(cx, tmp, \"b\", &jsb) &&\n    JS_GetProperty(cx, tmp, \"a\", &jsa) &&\n    JS_ValueToNumber(cx, jsr, &r) &&\n    JS_ValueToNumber(cx, jsg, &g) &&\n    JS_ValueToNumber(cx, jsb, &b) &&\n    JS_ValueToNumber(cx, jsa, &a);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    ret->r = r;\n    ret->g = g;\n    ret->b = b;\n    ret->a = a;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_cccolor4f(JSContext *cx, jsval v, Color4F* ret) {\n    JSObject *tmp;\n    JS::RootedValue jsr(cx);\n    JS::RootedValue jsg(cx);\n    JS::RootedValue jsb(cx);\n    JS::RootedValue jsa(cx);\n    double r, g, b, a;\n    JSBool ok = v.isObject() &&\n    JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"r\", &jsr) &&\n    JS_GetProperty(cx, tmp, \"g\", &jsg) &&\n    JS_GetProperty(cx, tmp, \"b\", &jsb) &&\n    JS_GetProperty(cx, tmp, \"a\", &jsa) &&\n    JS_ValueToNumber(cx, jsr, &r) &&\n    JS_ValueToNumber(cx, jsg, &g) &&\n    JS_ValueToNumber(cx, jsb, &b) &&\n    JS_ValueToNumber(cx, jsa, &a);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    ret->r = r;\n    ret->g = g;\n    ret->b = b;\n    ret->a = a;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_cccolor3b(JSContext *cx, jsval v, Color3B* ret) {\n    JSObject *tmp;\n    JS::RootedValue jsr(cx);\n    JS::RootedValue jsg(cx);\n    JS::RootedValue jsb(cx);\n    double r, g, b;\n    JSBool ok = v.isObject() &&\n    JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"r\", &jsr) &&\n    JS_GetProperty(cx, tmp, \"g\", &jsg) &&\n    JS_GetProperty(cx, tmp, \"b\", &jsb) &&\n    JS_ValueToNumber(cx, jsr, &r) &&\n    JS_ValueToNumber(cx, jsg, &g) &&\n    JS_ValueToNumber(cx, jsb, &b);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    ret->r = r;\n    ret->g = g;\n    ret->b = b;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccarray_of_CCPoint(JSContext* cx, jsval v, Point **points, int *numPoints) {\n    // Parsing sequence\n    JSObject *jsobj;\n    JSBool ok = v.isObject() && JS_ValueToObject( cx, v, &jsobj );\n    JSB_PRECONDITION3( ok, cx, JS_FALSE, \"Error converting value to object\");\n    JSB_PRECONDITION3( jsobj && JS_IsArrayObject( cx, jsobj), cx, JS_FALSE, \"Object must be an array\");\n    \n    uint32_t len;\n    JS_GetArrayLength(cx, jsobj, &len);\n    \n    Point *array = (Point*)malloc( sizeof(Point) * len);\n    \n    for( uint32_t i=0; i< len;i++ ) {\n        jsval valarg;\n        JS_GetElement(cx, jsobj, i, &valarg);\n        \n        ok = jsval_to_ccpoint(cx, valarg, &array[i]);\n        JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    }\n    \n    *numPoints = len;\n    *points = array;\n    \n    return JS_TRUE;\n}\n\n\nJSBool jsval_to_ccarray(JSContext* cx, jsval v, __Array** ret)\n{\n    JSObject *jsobj;\n    JSBool ok = v.isObject() && JS_ValueToObject( cx, v, &jsobj );\n    JSB_PRECONDITION3( ok, cx, JS_FALSE, \"Error converting value to object\");\n    JSB_PRECONDITION3( jsobj && JS_IsArrayObject( cx, jsobj),  cx, JS_FALSE, \"Object must be an array\");\n    \n    uint32_t len = 0;\n    JS_GetArrayLength(cx, jsobj, &len);\n    __Array* arr = __Array::createWithCapacity(len);\n    for (uint32_t i=0; i < len; i++) {\n        jsval value;\n        if (JS_GetElement(cx, jsobj, i, &value)) {\n            if (value.isObject())\n            {\n                js_proxy_t *proxy;\n                JSObject *tmp = JSVAL_TO_OBJECT(value);\n                proxy = jsb_get_js_proxy(tmp);\n                cocos2d::Object* cobj = (cocos2d::Object *)(proxy ? proxy->ptr : NULL);\n                // Don't test it.\n                //TEST_NATIVE_OBJECT(cx, cobj)\n                if (cobj) {\n                    // It's a native js object.\n                    arr->addObject(cobj);\n                }\n                else if (!JS_IsArrayObject(cx, tmp)){\n                    // It's a normal js object.\n                    __Dictionary* dictVal = NULL;\n                    JSBool ok = jsval_to_ccdictionary(cx, value, &dictVal);\n                    if (ok) {\n                        arr->addObject(dictVal);\n                    }\n                }\n                else {\n                    // It's a js array object.\n                    __Array* arrVal = NULL;\n                    JSBool ok = jsval_to_ccarray(cx, value, &arrVal);\n                    if (ok) {\n                        arr->addObject(arrVal);\n                    }\n                }\n            }\n            else if (JSVAL_IS_STRING(value)) {\n                JSStringWrapper valueWapper(JSVAL_TO_STRING(value), cx);\n                arr->addObject(String::create(valueWapper.get()));\n                //                CCLOG(\"iterate array: value = %s\", valueWapper.get().c_str());\n            }\n            else if (JSVAL_IS_NUMBER(value)) {\n                double number = 0.0;\n                JSBool ok = JS_ValueToNumber(cx, value, &number);\n                if (ok) {\n                    arr->addObject(Double::create(number));\n                    //                    CCLOG(\"iterate array: value = %lf\", number);\n                }\n            }\n            else if (JSVAL_IS_BOOLEAN(value)) {\n                JSBool boolVal = JS_FALSE;\n                JSBool ok = JS_ValueToBoolean(cx, value, &boolVal);\n                if (ok) {\n                    arr->addObject(Bool::create(boolVal));\n                    // CCLOG(\"iterate object: value = %d\", boolVal);\n                }\n            }\n            else {\n                CCASSERT(false, \"not supported type\");\n            }\n        }\n    }\n    *ret = arr;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccvalue(JSContext* cx, jsval v, cocos2d::Value* ret)\n{\n    if (v.isObject())\n    {\n        JSObject* jsobj = JSVAL_TO_OBJECT(v);\n        CCASSERT(jsb_get_js_proxy(jsobj) == nullptr, \"Native object should be added!\");\n        if (!JS_IsArrayObject(cx, jsobj))\n        {\n            // It's a normal js object.\n            ValueMap dictVal;\n            JSBool ok = jsval_to_ccvaluemap(cx, v, &dictVal);\n            if (ok)\n            {\n                *ret = Value(dictVal);\n            }\n        }\n        else {\n            // It's a js array object.\n            ValueVector arrVal;\n            JSBool ok = jsval_to_ccvaluevector(cx, v, &arrVal);\n            if (ok)\n            {\n                *ret = Value(arrVal);\n            }\n        }\n    }\n    else if (JSVAL_IS_STRING(v))\n    {\n        JSStringWrapper valueWapper(JSVAL_TO_STRING(v), cx);\n        *ret = Value(valueWapper.get());\n    }\n    else if (JSVAL_IS_NUMBER(v))\n    {\n        double number = 0.0;\n        JSBool ok = JS_ValueToNumber(cx, v, &number);\n        if (ok) {\n            *ret = Value(number);\n        }\n    }\n    else if (JSVAL_IS_BOOLEAN(v))\n    {\n        JSBool boolVal = JS_FALSE;\n        JSBool ok = JS_ValueToBoolean(cx, v, &boolVal);\n        if (ok) {\n            *ret = Value(boolVal);\n        }\n    }\n    else {\n        CCASSERT(false, \"not supported type\");\n    }\n\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccvaluemap(JSContext* cx, jsval v, cocos2d::ValueMap* ret)\n{\n    if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))\n    {\n        return JS_TRUE;\n    }\n    \n    JSObject* tmp = JSVAL_TO_OBJECT(v);\n    if (!tmp) {\n        CCLOG(\"%s\", \"jsval_to_ccvaluemap: the jsval is not an object.\");\n        return JS_FALSE;\n    }\n    \n    JSObject* it = JS_NewPropertyIterator(cx, tmp);\n    \n    ValueMap& dict = *ret;\n    \n    while (true)\n    {\n        jsid idp;\n        jsval key;\n        if (! JS_NextProperty(cx, it, &idp) || ! JS_IdToValue(cx, idp, &key)) {\n            return JS_FALSE; // error\n        }\n        \n        if (key == JSVAL_VOID) {\n            break; // end of iteration\n        }\n        \n        if (!JSVAL_IS_STRING(key)) {\n            continue; // ignore integer properties\n        }\n        \n        JSStringWrapper keyWrapper(JSVAL_TO_STRING(key), cx);\n        \n        JS::RootedValue value(cx);\n        JS_GetPropertyById(cx, tmp, idp, &value);\n        if (value.isObject())\n        {\n            JSObject* jsobj = JSVAL_TO_OBJECT(value);\n            CCASSERT(jsb_get_js_proxy(jsobj) == nullptr, \"Native object should be added!\");\n            if (!JS_IsArrayObject(cx, jsobj))\n            {\n                // It's a normal js object.\n                ValueMap dictVal;\n                JSBool ok = jsval_to_ccvaluemap(cx, value, &dictVal);\n                if (ok)\n                {\n                    dict[keyWrapper.get()] = Value(dictVal);\n                }\n            }\n            else {\n                // It's a js array object.\n                ValueVector arrVal;\n                JSBool ok = jsval_to_ccvaluevector(cx, value, &arrVal);\n                if (ok)\n                {\n                    dict[keyWrapper.get()] = Value(arrVal);\n                }\n            }\n        }\n        else if (JSVAL_IS_STRING(value))\n        {\n            JSStringWrapper valueWapper(JSVAL_TO_STRING(value), cx);\n            dict[keyWrapper.get()] = Value(valueWapper.get());\n            //            CCLOG(\"iterate object: key = %s, value = %s\", keyWrapper.get().c_str(), valueWapper.get().c_str());\n        }\n        else if (JSVAL_IS_NUMBER(value))\n        {\n            double number = 0.0;\n            JSBool ok = JS_ValueToNumber(cx, value, &number);\n            if (ok) {\n                dict[keyWrapper.get()] = Value(number);\n                // CCLOG(\"iterate object: key = %s, value = %lf\", keyWrapper.get().c_str(), number);\n            }\n        }\n        else if (JSVAL_IS_BOOLEAN(value))\n        {\n            JSBool boolVal = JS_FALSE;\n            JSBool ok = JS_ValueToBoolean(cx, value, &boolVal);\n            if (ok) {\n                dict[keyWrapper.get()] = Value(boolVal);\n                // CCLOG(\"iterate object: key = %s, value = %d\", keyWrapper.get().c_str(), boolVal);\n            }\n        }\n        else {\n            CCASSERT(false, \"not supported type\");\n        }\n    }\n    \n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccvaluemapintkey(JSContext* cx, jsval v, cocos2d::ValueMapIntKey* ret)\n{\n    if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))\n    {\n        return JS_TRUE;\n    }\n    \n    JSObject* tmp = JSVAL_TO_OBJECT(v);\n    if (!tmp) {\n        CCLOG(\"%s\", \"jsval_to_ccvaluemap: the jsval is not an object.\");\n        return JS_FALSE;\n    }\n    \n    JSObject* it = JS_NewPropertyIterator(cx, tmp);\n    \n    ValueMapIntKey& dict = *ret;\n    \n    while (true)\n    {\n        jsid idp;\n        jsval key;\n        if (! JS_NextProperty(cx, it, &idp) || ! JS_IdToValue(cx, idp, &key)) {\n            return JS_FALSE; // error\n        }\n        \n        if (key == JSVAL_VOID) {\n            break; // end of iteration\n        }\n        \n        if (!JSVAL_IS_STRING(key)) {\n            continue; // ignore integer properties\n        }\n        \n        int keyVal = JSVAL_TO_INT(key);\n        \n        JS::RootedValue value(cx);\n        JS_GetPropertyById(cx, tmp, idp, &value);\n        if (value.isObject())\n        {\n            JSObject* jsobj = JSVAL_TO_OBJECT(value);\n            CCASSERT(jsb_get_js_proxy(jsobj) == nullptr, \"Native object should be added!\");\n            if (!JS_IsArrayObject(cx, jsobj))\n            {\n                // It's a normal js object.\n                ValueMap dictVal;\n                JSBool ok = jsval_to_ccvaluemap(cx, value, &dictVal);\n                if (ok)\n                {\n                    dict[keyVal] = Value(dictVal);\n                }\n            }\n            else {\n                // It's a js array object.\n                ValueVector arrVal;\n                JSBool ok = jsval_to_ccvaluevector(cx, value, &arrVal);\n                if (ok)\n                {\n                    dict[keyVal] = Value(arrVal);\n                }\n            }\n        }\n        else if (JSVAL_IS_STRING(value))\n        {\n            JSStringWrapper valueWapper(JSVAL_TO_STRING(value), cx);\n            dict[keyVal] = Value(valueWapper.get());\n        }\n        else if (JSVAL_IS_NUMBER(value))\n        {\n            double number = 0.0;\n            JSBool ok = JS_ValueToNumber(cx, value, &number);\n            if (ok) {\n                dict[keyVal] = Value(number);\n            }\n        }\n        else if (JSVAL_IS_BOOLEAN(value))\n        {\n            JSBool boolVal = JS_FALSE;\n            JSBool ok = JS_ValueToBoolean(cx, value, &boolVal);\n            if (ok) {\n                dict[keyVal] = Value(boolVal);\n            }\n        }\n        else {\n            CCASSERT(false, \"not supported type\");\n        }\n    }\n    \n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccvaluevector(JSContext* cx, jsval v, cocos2d::ValueVector* ret)\n{\n    JSObject *jsobj;\n    JSBool ok = v.isObject() && JS_ValueToObject( cx, v, &jsobj );\n    JSB_PRECONDITION3( ok, cx, JS_FALSE, \"Error converting value to object\");\n    JSB_PRECONDITION3( jsobj && JS_IsArrayObject( cx, jsobj),  cx, JS_FALSE, \"Object must be an array\");\n    \n    uint32_t len = 0;\n    JS_GetArrayLength(cx, jsobj, &len);\n\n    for (uint32_t i=0; i < len; i++)\n    {\n        jsval value;\n        if (JS_GetElement(cx, jsobj, i, &value))\n        {\n            if (value.isObject())\n            {\n                JSObject* jsobj = JSVAL_TO_OBJECT(value);\n                CCASSERT(jsb_get_js_proxy(jsobj) == nullptr, \"Native object should be added!\");\n                \n                if (!JS_IsArrayObject(cx, jsobj))\n                {\n                    // It's a normal js object.\n                    ValueMap dictVal;\n                    JSBool ok = jsval_to_ccvaluemap(cx, value, &dictVal);\n                    if (ok)\n                    {\n                        ret->push_back(Value(dictVal));\n                    }\n                }\n                else {\n                    // It's a js array object.\n                    ValueVector arrVal;\n                    JSBool ok = jsval_to_ccvaluevector(cx, value, &arrVal);\n                    if (ok)\n                    {\n                        ret->push_back(Value(arrVal));\n                    }\n                }\n            }\n            else if (JSVAL_IS_STRING(value))\n            {\n                JSStringWrapper valueWapper(JSVAL_TO_STRING(value), cx);\n                ret->push_back(Value(valueWapper.get()));\n            }\n            else if (JSVAL_IS_NUMBER(value))\n            {\n                double number = 0.0;\n                JSBool ok = JS_ValueToNumber(cx, value, &number);\n                if (ok)\n                {\n                    ret->push_back(Value(number));\n                }\n            }\n            else if (JSVAL_IS_BOOLEAN(value))\n            {\n                JSBool boolVal = JS_FALSE;\n                JSBool ok = JS_ValueToBoolean(cx, value, &boolVal);\n                if (ok)\n                {\n                    ret->push_back(Value(boolVal));\n                }\n            }\n            else\n            {\n                CCASSERT(false, \"not supported type\");\n            }\n        }\n    }\n\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ssize( JSContext *cx, jsval vp, ssize_t* size)\n{\n    JSBool ret = JS_FALSE;\n    int32_t sizeInt32 = 0;\n    ret = jsval_to_int32(cx, vp, &sizeInt32);\n    *size = sizeInt32;\n    return ret;\n}\n\nJSBool jsval_to_std_vector_string( JSContext *cx, jsval vp, std::vector<std::string>* ret)\n{\n    JSObject *jsobj;\n    JSBool ok = vp.isObject() && JS_ValueToObject( cx, vp, &jsobj );\n    JSB_PRECONDITION3( ok, cx, JS_FALSE, \"Error converting value to object\");\n    JSB_PRECONDITION3( jsobj && JS_IsArrayObject( cx, jsobj),  cx, JS_FALSE, \"Object must be an array\");\n    \n    uint32_t len = 0;\n    JS_GetArrayLength(cx, jsobj, &len);\n    \n    for (uint32_t i=0; i < len; i++)\n    {\n        jsval value;\n        if (JS_GetElement(cx, jsobj, i, &value))\n        {\n            if (JSVAL_IS_STRING(value))\n            {\n                JSStringWrapper valueWapper(JSVAL_TO_STRING(value), cx);\n                ret->push_back(valueWapper.get());\n            }\n            else\n            {\n                JS_ReportError(cx, \"not supported type in array\");\n                return JS_FALSE;\n            }\n        }\n    }\n    \n    return JS_TRUE;\n}\n\nJSBool jsval_to_std_vector_int( JSContext *cx, jsval vp, std::vector<int>* ret)\n{\n    JSObject *jsobj;\n    JSBool ok = vp.isObject() && JS_ValueToObject( cx, vp, &jsobj );\n    JSB_PRECONDITION3( ok, cx, JS_FALSE, \"Error converting value to object\");\n    JSB_PRECONDITION3( jsobj && JS_IsArrayObject( cx, jsobj),  cx, JS_FALSE, \"Object must be an array\");\n    \n    uint32_t len = 0;\n    JS_GetArrayLength(cx, jsobj, &len);\n    \n    for (uint32_t i=0; i < len; i++)\n    {\n        jsval value;\n        if (JS_GetElement(cx, jsobj, i, &value))\n        {\n            if (JSVAL_IS_NUMBER(value))\n            {\n                double number = 0.0;\n                JSBool ok = JS_ValueToNumber(cx, value, &number);\n                if (ok)\n                {\n                    ret->push_back(static_cast<int>(number));\n                }\n            }\n            else\n            {\n                JS_ReportError(cx, \"not supported type in array\");\n                return JS_FALSE;\n            }\n        }\n    }\n    \n    return JS_TRUE;\n}\n\n// native --> jsval\n\njsval ccarray_to_jsval(JSContext* cx, __Array *arr)\n{\n    JSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL);\n    \n    Object* obj;\n    int i = 0;\n    CCARRAY_FOREACH(arr, obj)\n    {\n        jsval arrElement;\n        \n        //First, check whether object is associated with js object.\n        js_proxy_t* jsproxy = js_get_or_create_proxy<cocos2d::Object>(cx, obj);\n        if (jsproxy) {\n            arrElement = OBJECT_TO_JSVAL(jsproxy->obj);\n        }\n        else {\n            __String* strVal = NULL;\n            __Dictionary* dictVal = NULL;\n            __Array* arrVal = NULL;\n            __Double* doubleVal = NULL;\n            __Bool* boolVal = NULL;\n            __Float* floatVal = NULL;\n            __Integer* intVal = NULL;\n            \n            if ((strVal = dynamic_cast<cocos2d::__String *>(obj))) {\n                arrElement = c_string_to_jsval(cx, strVal->getCString());\n            } else if ((dictVal = dynamic_cast<cocos2d::__Dictionary*>(obj))) {\n                arrElement = ccdictionary_to_jsval(cx, dictVal);\n            } else if ((arrVal = dynamic_cast<cocos2d::__Array*>(obj))) {\n                arrElement = ccarray_to_jsval(cx, arrVal);\n            } else if ((doubleVal = dynamic_cast<__Double*>(obj))) {\n                arrElement = DOUBLE_TO_JSVAL(doubleVal->getValue());\n            } else if ((floatVal = dynamic_cast<__Float*>(obj))) {\n                arrElement = DOUBLE_TO_JSVAL(floatVal->getValue());\n            } else if ((intVal = dynamic_cast<__Integer*>(obj))) {\n                arrElement = INT_TO_JSVAL(intVal->getValue());\n            }  else if ((boolVal = dynamic_cast<__Bool*>(obj))) {\n                arrElement = BOOLEAN_TO_JSVAL(boolVal->getValue() ? JS_TRUE : JS_FALSE);\n            } else {\n                CCASSERT(false, \"the type isn't suppored.\");\n            }\n        }\n        if (!JS_SetElement(cx, jsretArr, i, &arrElement)) {\n            break;\n        }\n        ++i;\n    }\n    return OBJECT_TO_JSVAL(jsretArr);\n}\n\njsval ccdictionary_to_jsval(JSContext* cx, __Dictionary* dict)\n{\n    JSObject* jsRet = JS_NewObject(cx, NULL, NULL, NULL);\n    DictElement* pElement = NULL;\n    CCDICT_FOREACH(dict, pElement)\n    {\n        JS::RootedValue dictElement(cx);\n        Object* obj = pElement->getObject();\n        //First, check whether object is associated with js object.\n        js_proxy_t* jsproxy = js_get_or_create_proxy<cocos2d::Object>(cx, obj);\n        if (jsproxy) {\n            dictElement = OBJECT_TO_JSVAL(jsproxy->obj);\n        }\n        else {\n            __String* strVal = NULL;\n            __Dictionary* dictVal = NULL;\n            __Array* arrVal = NULL;\n            __Double* doubleVal = NULL;\n            __Bool* boolVal = NULL;\n            __Float* floatVal = NULL;\n            __Integer* intVal = NULL;\n            \n            if ((strVal = dynamic_cast<cocos2d::__String *>(obj))) {\n                dictElement = c_string_to_jsval(cx, strVal->getCString());\n            } else if ((dictVal = dynamic_cast<__Dictionary*>(obj))) {\n                dictElement = ccdictionary_to_jsval(cx, dictVal);\n            } else if ((arrVal = dynamic_cast<__Array*>(obj))) {\n                dictElement = ccarray_to_jsval(cx, arrVal);\n            } else if ((doubleVal = dynamic_cast<__Double*>(obj))) {\n                dictElement = DOUBLE_TO_JSVAL(doubleVal->getValue());\n            } else if ((floatVal = dynamic_cast<__Float*>(obj))) {\n                dictElement = DOUBLE_TO_JSVAL(floatVal->getValue());\n            } else if ((intVal = dynamic_cast<__Integer*>(obj))) {\n                dictElement = INT_TO_JSVAL(intVal->getValue());\n            } else if ((boolVal = dynamic_cast<__Bool*>(obj))) {\n                dictElement = BOOLEAN_TO_JSVAL(boolVal->getValue() ? JS_TRUE : JS_FALSE);\n            } else {\n                CCASSERT(false, \"the type isn't suppored.\");\n            }\n        }\n        const char* key = pElement->getStrKey();\n        if (key && strlen(key) > 0)\n        {\n            JS_SetProperty(cx, jsRet, key, dictElement);\n        }\n    }\n    return OBJECT_TO_JSVAL(jsRet);\n}\n\nJSBool jsval_to_ccdictionary(JSContext* cx, jsval v, __Dictionary** ret)\n{\n    if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))\n    {\n        *ret = NULL;\n        return JS_TRUE;\n    }\n    \n    JSObject* tmp = JSVAL_TO_OBJECT(v);\n    if (!tmp) {\n        CCLOG(\"%s\", \"jsval_to_ccdictionary: the jsval is not an object.\");\n        return JS_FALSE;\n    }\n    \n    JSObject* it = JS_NewPropertyIterator(cx, tmp);\n    __Dictionary* dict = NULL;\n    \n    while (true)\n    {\n        jsid idp;\n        jsval key;\n        if (! JS_NextProperty(cx, it, &idp) || ! JS_IdToValue(cx, idp, &key)) {\n            return JS_FALSE; // error\n        }\n        \n        if (key == JSVAL_VOID) {\n            break; // end of iteration\n        }\n        \n        if (!JSVAL_IS_STRING(key)) {\n            continue; // ignore integer properties\n        }\n        \n        JSStringWrapper keyWrapper(JSVAL_TO_STRING(key), cx);\n        if (!dict) {\n            dict = __Dictionary::create();\n        }\n        \n        JS::RootedValue value(cx);\n        JS_GetPropertyById(cx, tmp, idp, &value);\n        if (value.isObject())\n        {\n            js_proxy_t *proxy;\n            tmp = JSVAL_TO_OBJECT(value);\n            proxy = jsb_get_js_proxy(tmp);\n            cocos2d::Object* cobj = (cocos2d::Object *)(proxy ? proxy->ptr : NULL);\n            // Don't test it.\n            //TEST_NATIVE_OBJECT(cx, cobj)\n            if (cobj) {\n                // It's a native <-> js glue object.\n                dict->setObject(cobj, keyWrapper.get());\n            }\n            else if (!JS_IsArrayObject(cx, tmp)){\n                // It's a normal js object.\n                __Dictionary* dictVal = NULL;\n                JSBool ok = jsval_to_ccdictionary(cx, value, &dictVal);\n                if (ok) {\n                    dict->setObject(dictVal, keyWrapper.get());\n                }\n            }\n            else {\n                // It's a js array object.\n                __Array* arrVal = NULL;\n                JSBool ok = jsval_to_ccarray(cx, value, &arrVal);\n                if (ok) {\n                    dict->setObject(arrVal, keyWrapper.get());\n                }\n            }\n        }\n        else if (JSVAL_IS_STRING(value)) {\n            JSStringWrapper valueWapper(JSVAL_TO_STRING(value), cx);\n            dict->setObject(String::create(valueWapper.get()), keyWrapper.get());\n            //            CCLOG(\"iterate object: key = %s, value = %s\", keyWrapper.get().c_str(), valueWapper.get().c_str());\n        }\n        else if (JSVAL_IS_NUMBER(value)) {\n            double number = 0.0;\n            JSBool ok = JS_ValueToNumber(cx, value, &number);\n            if (ok) {\n                dict->setObject(Double::create(number), keyWrapper.get());\n                //                CCLOG(\"iterate object: key = %s, value = %lf\", keyWrapper.get().c_str(), number);\n            }\n        }\n        else if (JSVAL_IS_BOOLEAN(value)) {\n            JSBool boolVal = JS_FALSE;\n            JSBool ok = JS_ValueToBoolean(cx, value, &boolVal);\n            if (ok) {\n                dict->setObject(Bool::create(boolVal), keyWrapper.get());\n                //                CCLOG(\"iterate object: key = %s, value = %d\", keyWrapper.get().c_str(), boolVal);\n            }\n        }\n        else {\n            CCASSERT(false, \"not supported type\");\n        }\n    }\n    \n    *ret = dict;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccaffinetransform(JSContext* cx, jsval v, AffineTransform* ret)\n{\n    JSObject *tmp;\n    JS::RootedValue jsa(cx);\n    JS::RootedValue jsb(cx);\n    JS::RootedValue jsc(cx);\n    JS::RootedValue jsd(cx);\n    JS::RootedValue jstx(cx);\n    JS::RootedValue jsty(cx);\n    double a, b, c, d, tx, ty;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n    JS_GetProperty(cx, tmp, \"a\", &jsa) &&\n    JS_GetProperty(cx, tmp, \"b\", &jsb) &&\n    JS_GetProperty(cx, tmp, \"c\", &jsc) &&\n    JS_GetProperty(cx, tmp, \"d\", &jsd) &&\n    JS_GetProperty(cx, tmp, \"tx\", &jstx) &&\n    JS_GetProperty(cx, tmp, \"ty\", &jsty) &&\n    JS_ValueToNumber(cx, jsa, &a) &&\n    JS_ValueToNumber(cx, jsb, &b) &&\n    JS_ValueToNumber(cx, jsc, &c) &&\n    JS_ValueToNumber(cx, jsd, &d) &&\n    JS_ValueToNumber(cx, jstx, &tx) &&\n    JS_ValueToNumber(cx, jsty, &ty);\n    \n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    \n    *ret = AffineTransformMake(a, b, c, d, tx, ty);\n    return JS_TRUE;\n}\n\n// From native type to jsval\njsval int32_to_jsval( JSContext *cx, int32_t number )\n{\n    return INT_TO_JSVAL(number);\n}\n\njsval uint32_to_jsval( JSContext *cx, uint32_t number )\n{\n    return UINT_TO_JSVAL(number);\n}\n\njsval ushort_to_jsval( JSContext *cx, unsigned short number )\n{\n    return UINT_TO_JSVAL(number);\n}\n\njsval std_string_to_jsval(JSContext* cx, const std::string& v)\n{\n    return c_string_to_jsval(cx, v.c_str(), v.size());\n}\n\njsval c_string_to_jsval(JSContext* cx, const char* v, size_t length /* = -1 */)\n{\n    if (v == NULL)\n    {\n        return JSVAL_NULL;\n    }\n    \n    JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n    \n    if (0 == length)\n    {\n        auto emptyStr = JS_NewStringCopyZ(cx, \"\");\n        return STRING_TO_JSVAL(emptyStr);\n    }\n    \n    jsval ret = JSVAL_NULL;\n    int utf16_size = 0;\n    jschar* strUTF16 = (jschar*)cc_utf8_to_utf16(v, length, &utf16_size);\n    \n    if (strUTF16 && utf16_size > 0) {\n        JSString* str = JS_NewUCStringCopyN(cx, strUTF16, utf16_size);\n        if (str) {\n            ret = STRING_TO_JSVAL(str);\n        }\n        delete[] strUTF16;\n    }\n    return ret;\n}\n\njsval ccpoint_to_jsval(JSContext* cx, const Point& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(v.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(v.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval ccacceleration_to_jsval(JSContext* cx, const Acceleration& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(v.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(v.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"z\", DOUBLE_TO_JSVAL(v.z), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"timestamp\", DOUBLE_TO_JSVAL(v.timestamp), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval ccrect_to_jsval(JSContext* cx, const Rect& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(v.origin.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(v.origin.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"width\", DOUBLE_TO_JSVAL(v.size.width), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"height\", DOUBLE_TO_JSVAL(v.size.height), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval ccsize_to_jsval(JSContext* cx, const Size& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"width\", DOUBLE_TO_JSVAL(v.width), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"height\", DOUBLE_TO_JSVAL(v.height), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval cccolor4b_to_jsval(JSContext* cx, const Color4B& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"r\", INT_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"g\", INT_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"b\", INT_TO_JSVAL(v.b), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"a\", INT_TO_JSVAL(v.a), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval cccolor4f_to_jsval(JSContext* cx, const Color4F& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"r\", DOUBLE_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"g\", DOUBLE_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"b\", DOUBLE_TO_JSVAL(v.b), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"a\", DOUBLE_TO_JSVAL(v.a), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval cccolor3b_to_jsval(JSContext* cx, const Color3B& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"r\", INT_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"g\", INT_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"b\", INT_TO_JSVAL(v.b), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval ccaffinetransform_to_jsval(JSContext* cx, const AffineTransform& t)\n{\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"a\", DOUBLE_TO_JSVAL(t.a), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"b\", DOUBLE_TO_JSVAL(t.b), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"c\", DOUBLE_TO_JSVAL(t.c), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"d\", DOUBLE_TO_JSVAL(t.d), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"tx\", DOUBLE_TO_JSVAL(t.tx), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n    JS_DefineProperty(cx, tmp, \"ty\", DOUBLE_TO_JSVAL(t.ty), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval FontDefinition_to_jsval(JSContext* cx, const FontDefinition& t)\n{\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_TRUE;\n    \n    ok &= JS_DefineProperty(cx, tmp, \"fontName\", std_string_to_jsval(cx, t._fontName), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"fontSize\", int32_to_jsval(cx, t._fontSize), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"fontAlignmentH\", int32_to_jsval(cx, (int32_t)t._alignment), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"fontAlignmentV\", int32_to_jsval(cx, (int32_t)t._vertAlignment), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"fontFillColor\", cccolor3b_to_jsval(cx, t._fontFillColor), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"fontDimensions\", ccsize_to_jsval(cx, t._dimensions), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    // Shadow\n    ok &= JS_DefineProperty(cx, tmp, \"shadowEnabled\", BOOLEAN_TO_JSVAL(t._shadow._shadowEnabled), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"shadowOffset\", ccsize_to_jsval(cx, t._shadow._shadowOffset), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"shadowBlur\", DOUBLE_TO_JSVAL(t._shadow._shadowBlur), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"shadowOpacity\", DOUBLE_TO_JSVAL(t._shadow._shadowOpacity), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    // Stroke\n    ok &= JS_DefineProperty(cx, tmp, \"strokeEnabled\", BOOLEAN_TO_JSVAL(t._stroke._strokeEnabled), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"strokeColor\", cccolor3b_to_jsval(cx, t._stroke._strokeColor), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    ok &= JS_DefineProperty(cx, tmp, \"strokeSize\", DOUBLE_TO_JSVAL(t._stroke._strokeSize), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    \n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\nJSBool jsval_to_FontDefinition( JSContext *cx, jsval vp, FontDefinition *out )\n{\n    JSObject *jsobj;\n    \n\tif (!JS_ValueToObject( cx, vp, &jsobj ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( jsobj, \"Not a valid JS object\");\n    \n    // defaul values\n    const char *            defautlFontName         = \"Arial\";\n    const int               defaultFontSize         = 32;\n    TextHAlignment         defaultTextAlignment    = TextHAlignment::LEFT;\n    TextVAlignment defaultTextVAlignment   = TextVAlignment::TOP;\n    \n    // by default shadow and stroke are off\n    out->_shadow._shadowEnabled = false;\n    out->_stroke._strokeEnabled = false;\n    \n    // white text by default\n    out->_fontFillColor = Color3B::WHITE;\n    \n    // font name\n    JS::RootedValue jsr(cx);\n    JS_GetProperty(cx, jsobj, \"fontName\", &jsr);\n    JS_ValueToString(cx, jsr);\n    JSStringWrapper wrapper(jsr);\n    const char* fontName = wrapper.get();\n    \n    if (fontName && strlen(fontName) > 0)\n    {\n        out->_fontName  = fontName;\n    }\n    else\n    {\n        out->_fontName  = defautlFontName;\n    }\n    \n    // font size\n    JSBool hasProperty;\n    JS_HasProperty(cx, jsobj, \"fontSize\", &hasProperty);\n    if ( hasProperty )\n    {\n        JS_GetProperty(cx, jsobj, \"fontSize\", &jsr);\n        double fontSize = 0.0;\n        JS_ValueToNumber(cx, jsr, &fontSize);\n        out->_fontSize  = fontSize;\n    }\n    else\n    {\n        out->_fontSize  = defaultFontSize;\n    }\n    \n    // font alignment horizontal\n    JS_HasProperty(cx, jsobj, \"fontAlignmentH\", &hasProperty);\n    if ( hasProperty )\n    {\n        JS_GetProperty(cx, jsobj, \"fontAlignmentH\", &jsr);\n        double fontAlign = 0.0;\n        JS_ValueToNumber(cx, jsr, &fontAlign);\n        out->_alignment = (TextHAlignment)(int)fontAlign;\n    }\n    else\n    {\n        out->_alignment  = defaultTextAlignment;\n    }\n    \n    // font alignment vertical\n    JS_HasProperty(cx, jsobj, \"fontAlignmentV\", &hasProperty);\n    if ( hasProperty )\n    {\n        JS_GetProperty(cx, jsobj, \"fontAlignmentV\", &jsr);\n        double fontAlign = 0.0;\n        JS_ValueToNumber(cx, jsr, &fontAlign);\n        out->_vertAlignment = (TextVAlignment)(int)fontAlign;\n    }\n    else\n    {\n        out->_vertAlignment  = defaultTextVAlignment;\n    }\n    \n    // font fill color\n    JS_HasProperty(cx, jsobj, \"fontFillColor\", &hasProperty);\n    if ( hasProperty )\n    {\n        JS_GetProperty(cx, jsobj, \"fontFillColor\", &jsr);\n        \n        JSObject *jsobjColor;\n        if (!JS_ValueToObject( cx, jsr, &jsobjColor ) )\n            return JS_FALSE;\n        \n        out->_fontFillColor = getColorFromJSObject(cx, jsobjColor);\n    }\n    \n    // font rendering box dimensions\n    JS_HasProperty(cx, jsobj, \"fontDimensions\", &hasProperty);\n    if ( hasProperty )\n    {\n        JS_GetProperty(cx, jsobj, \"fontDimensions\", &jsr);\n        \n        JSObject *jsobjSize;\n        if (!JS_ValueToObject( cx, jsr, &jsobjSize ) )\n            return JS_FALSE;\n        \n        out->_dimensions = getSizeFromJSObject(cx, jsobjSize);\n    }\n    \n    // shadow\n    JS_HasProperty(cx, jsobj, \"shadowEnabled\", &hasProperty);\n    if ( hasProperty )\n    {\n        JS_GetProperty(cx, jsobj, \"shadowEnabled\", &jsr);\n        out->_shadow._shadowEnabled  = ToBoolean(jsr);\n        \n        if ( out->_shadow._shadowEnabled )\n        {\n            // default shadow values\n            out->_shadow._shadowOffset  = Size(5, 5);\n            out->_shadow._shadowBlur    = 1;\n            out->_shadow._shadowOpacity = 1;\n            \n            // shado offset\n            JS_HasProperty(cx, jsobj, \"shadowOffset\", &hasProperty);\n            if ( hasProperty )\n            {\n                JS_GetProperty(cx, jsobj, \"shadowOffset\", &jsr);\n                \n                JSObject *jsobjShadowOffset;\n                if (!JS_ValueToObject( cx, jsr, &jsobjShadowOffset ) )\n                    return JS_FALSE;\n                out->_shadow._shadowOffset = getSizeFromJSObject(cx, jsobjShadowOffset);\n            }\n            \n            // shadow blur\n            JS_HasProperty(cx, jsobj, \"shadowBlur\", &hasProperty);\n            if ( hasProperty )\n            {\n                JS_GetProperty(cx, jsobj, \"shadowBlur\", &jsr);\n                double shadowBlur = 0.0;\n                JS_ValueToNumber(cx, jsr, &shadowBlur);\n                out->_shadow._shadowBlur = shadowBlur;\n            }\n            \n            // shadow intensity\n            JS_HasProperty(cx, jsobj, \"shadowOpacity\", &hasProperty);\n            if ( hasProperty )\n            {\n                JS_GetProperty(cx, jsobj, \"shadowOpacity\", &jsr);\n                double shadowOpacity = 0.0;\n                JS_ValueToNumber(cx, jsr, &shadowOpacity);\n                out->_shadow._shadowOpacity = shadowOpacity;\n            }\n        }\n    }\n    \n    // stroke\n    JS_HasProperty(cx, jsobj, \"strokeEnabled\", &hasProperty);\n    if ( hasProperty )\n    {\n        JS_GetProperty(cx, jsobj, \"strokeEnabled\", &jsr);\n        out->_stroke._strokeEnabled  = ToBoolean(jsr);\n        \n        if ( out->_stroke._strokeEnabled )\n        {\n            // default stroke values\n            out->_stroke._strokeSize  = 1;\n            out->_stroke._strokeColor = Color3B::BLUE;\n            \n            // stroke color\n            JS_HasProperty(cx, jsobj, \"strokeColor\", &hasProperty);\n            if ( hasProperty )\n            {\n                JS_GetProperty(cx, jsobj, \"strokeColor\", &jsr);\n                \n                JSObject *jsobjStrokeColor;\n                if (!JS_ValueToObject( cx, jsr, &jsobjStrokeColor ) )\n                    return JS_FALSE;\n                out->_stroke._strokeColor = getColorFromJSObject(cx, jsobjStrokeColor);\n            }\n            \n            // stroke size\n            JS_HasProperty(cx, jsobj, \"strokeSize\", &hasProperty);\n            if ( hasProperty )\n            {\n                JS_GetProperty(cx, jsobj, \"strokeSize\", &jsr);\n                double strokeSize = 0.0;\n                JS_ValueToNumber(cx, jsr, &strokeSize);\n                out->_stroke._strokeSize = strokeSize;\n            }\n        }\n    }\n    \n    // we are done here\n\treturn JS_TRUE;\n}\n\n#define JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n\nJSBool jsval_to_CCPoint( JSContext *cx, jsval vp, Point *ret )\n{\n#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *jsobj;\n\tif( ! JS_ValueToObject( cx, vp, &jsobj ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( jsobj, \"Not a valid JS object\");\n    \n    JS::RootedValue valx(cx);\n    JS::RootedValue valy(cx);\n\tJSBool ok = JS_TRUE;\n\tok &= JS_GetProperty(cx, jsobj, \"x\", &valx);\n\tok &= JS_GetProperty(cx, jsobj, \"y\", &valy);\n    \n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tdouble x, y;\n\tok &= JS_ValueToNumber(cx, valx, &x);\n\tok &= JS_ValueToNumber(cx, valy, &y);\n\t\n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tret->x = x;\n\tret->y = y;\n    \n\treturn JS_TRUE;\n    \n#else // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *tmp_arg;\n\tif( ! JS_ValueToObject( cx, vp, &tmp_arg ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( tmp_arg && JS_IsTypedArrayObject( tmp_arg, cx ), \"Not a TypedArray object\");\n\t\n\tJSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg, cx ) == sizeof(cpVect), \"Invalid length\");\n\t\n\t*ret = *(Point*)JS_GetArrayBufferViewData( tmp_arg, cx );\n\t\n\treturn JS_TRUE;\n#endif // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n}\n\n\nJSBool jsval_to_CGPoint( JSContext *cx, jsval vp, cpVect *ret )\n{\n#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *jsobj;\n\tif( ! JS_ValueToObject( cx, vp, &jsobj ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( jsobj, \"Not a valid JS object\");\n    \n    JS::RootedValue valx(cx);\n    JS::RootedValue valy(cx);\n\tJSBool ok = JS_TRUE;\n\tok &= JS_GetProperty(cx, jsobj, \"x\", &valx);\n\tok &= JS_GetProperty(cx, jsobj, \"y\", &valy);\n    \n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tdouble x, y;\n\tok &= JS_ValueToNumber(cx, valx, &x);\n\tok &= JS_ValueToNumber(cx, valy, &y);\n\t\n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tret->x = x;\n\tret->y = y;\n    \n\treturn JS_TRUE;\n    \n#else // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *tmp_arg;\n\tif( ! JS_ValueToObject( cx, vp, &tmp_arg ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( tmp_arg && JS_IsTypedArrayObject( tmp_arg, cx ), \"Not a TypedArray object\");\n\t\n\tJSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg, cx ) == sizeof(cpVect), \"Invalid length\");\n\t\n\t*ret = *(cpVect*)JS_GetArrayBufferViewData( tmp_arg, cx );\n\t\n\treturn JS_TRUE;\n#endif // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n}\n\n\njsval CGPoint_to_jsval( JSContext *cx, cpVect p)\n{\n\t\n#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *object = JS_NewObject(cx, NULL, NULL, NULL );\n\tif (!object)\n\t\treturn JSVAL_VOID;\n    \n\tif (!JS_DefineProperty(cx, object, \"x\", DOUBLE_TO_JSVAL(p.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n\t\t!JS_DefineProperty(cx, object, \"y\", DOUBLE_TO_JSVAL(p.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) )\n\t\treturn JSVAL_VOID;\n\t\n\treturn OBJECT_TO_JSVAL(object);\n    \n#else // JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n\t\n#ifdef __LP64__\n\tJSObject *typedArray = JS_NewFloat64Array( cx, 2 );\n#else\n\tJSObject *typedArray = JS_NewFloat32Array( cx, 2 );\n#endif\n    \n\tcpVect *buffer = (cpVect*)JS_GetArrayBufferViewData(typedArray, cx );\n\t*buffer = p;\n\treturn OBJECT_TO_JSVAL(typedArray);\n#endif // ! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n}\n\njsval ccvalue_to_jsval(JSContext* cx, const cocos2d::Value& v)\n{\n    jsval ret = JSVAL_NULL;\n    const Value& obj = v;\n    \n    switch (obj.getType())\n    {\n        case Value::Type::BOOLEAN:\n            ret = BOOLEAN_TO_JSVAL(obj.asBool());\n            break;\n        case Value::Type::FLOAT:\n        case Value::Type::DOUBLE:\n            ret = DOUBLE_TO_JSVAL(obj.asDouble());\n            break;\n        case Value::Type::INTEGER:\n            ret = INT_TO_JSVAL(obj.asInt());\n            break;\n        case Value::Type::STRING:\n            ret = std_string_to_jsval(cx, obj.asString());\n            break;\n        case Value::Type::VECTOR:\n            ret = ccvaluevector_to_jsval(cx, obj.asValueVector());\n            break;\n        case Value::Type::MAP:\n            ret = ccvaluemap_to_jsval(cx, obj.asValueMap());\n            break;\n        case Value::Type::INT_KEY_MAP:\n            ret = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());\n            break;\n        default:\n            break;\n    }\n    \n    return ret;\n}\n\njsval ccvaluemap_to_jsval(JSContext* cx, const cocos2d::ValueMap& v)\n{\n    JSObject* jsRet = JS_NewObject(cx, NULL, NULL, NULL);\n    \n    for (auto iter = v.begin(); iter != v.end(); ++iter)\n    {\n        JS::RootedValue dictElement(cx);\n\n        std::string key = iter->first;\n        const Value& obj = iter->second;\n        \n        switch (obj.getType())\n        {\n            case Value::Type::BOOLEAN:\n                dictElement = BOOLEAN_TO_JSVAL(obj.asBool());\n                break;\n            case Value::Type::FLOAT:\n            case Value::Type::DOUBLE:\n                dictElement = DOUBLE_TO_JSVAL(obj.asDouble());\n                break;\n            case Value::Type::INTEGER:\n                dictElement = INT_TO_JSVAL(obj.asInt());\n                break;\n            case Value::Type::STRING:\n                dictElement = std_string_to_jsval(cx, obj.asString());\n                break;\n            case Value::Type::VECTOR:\n                dictElement = ccvaluevector_to_jsval(cx, obj.asValueVector());\n                break;\n            case Value::Type::MAP:\n                dictElement = ccvaluemap_to_jsval(cx, obj.asValueMap());\n                break;\n            case Value::Type::INT_KEY_MAP:\n                dictElement = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());\n                break;\n            default:\n                break;\n        }\n        \n        if (!key.empty())\n        {\n            JS_SetProperty(cx, jsRet, key.c_str(), dictElement);\n        }\n    }\n    return OBJECT_TO_JSVAL(jsRet);\n}\n\njsval ccvaluemapintkey_to_jsval(JSContext* cx, const cocos2d::ValueMapIntKey& v)\n{\n    JSObject* jsRet = JS_NewObject(cx, NULL, NULL, NULL);\n    \n    for (auto iter = v.begin(); iter != v.end(); ++iter)\n    {\n        JS::RootedValue dictElement(cx);\n        std::stringstream keyss;\n        keyss << iter->first;\n        std::string key = keyss.str();\n        \n        const Value& obj = iter->second;\n        \n        switch (obj.getType())\n        {\n            case Value::Type::BOOLEAN:\n                dictElement = BOOLEAN_TO_JSVAL(obj.asBool());\n                break;\n            case Value::Type::FLOAT:\n            case Value::Type::DOUBLE:\n                dictElement = DOUBLE_TO_JSVAL(obj.asDouble());\n                break;\n            case Value::Type::INTEGER:\n                dictElement = INT_TO_JSVAL(obj.asInt());\n                break;\n            case Value::Type::STRING:\n                dictElement = std_string_to_jsval(cx, obj.asString());\n                break;\n            case Value::Type::VECTOR:\n                dictElement = ccvaluevector_to_jsval(cx, obj.asValueVector());\n                break;\n            case Value::Type::MAP:\n                dictElement = ccvaluemap_to_jsval(cx, obj.asValueMap());\n                break;\n            case Value::Type::INT_KEY_MAP:\n                dictElement = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());\n                break;\n            default:\n                break;\n        }\n        \n        if (!key.empty())\n        {\n            JS_SetProperty(cx, jsRet, key.c_str(), dictElement);\n        }\n    }\n    return OBJECT_TO_JSVAL(jsRet);\n}\n\njsval ccvaluevector_to_jsval(JSContext* cx, const cocos2d::ValueVector& v)\n{\n    JSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL);\n    \n    int i = 0;\n    for (const auto& obj : v)\n    {\n        jsval arrElement;\n        \n        switch (obj.getType())\n        {\n            case Value::Type::BOOLEAN:\n                arrElement = BOOLEAN_TO_JSVAL(obj.asBool());\n                break;\n            case Value::Type::FLOAT:\n            case Value::Type::DOUBLE:\n                arrElement = DOUBLE_TO_JSVAL(obj.asDouble());\n                break;\n            case Value::Type::INTEGER:\n                arrElement = INT_TO_JSVAL(obj.asInt());\n                break;\n            case Value::Type::STRING:\n                arrElement = std_string_to_jsval(cx, obj.asString());\n                break;\n            case Value::Type::VECTOR:\n                arrElement = ccvaluevector_to_jsval(cx, obj.asValueVector());\n                break;\n            case Value::Type::MAP:\n                arrElement = ccvaluemap_to_jsval(cx, obj.asValueMap());\n                break;\n            case Value::Type::INT_KEY_MAP:\n                arrElement = ccvaluemapintkey_to_jsval(cx, obj.asIntKeyMap());\n                break;\n            default:\n                break;\n        }\n\n        if (!JS_SetElement(cx, jsretArr, i, &arrElement)) {\n            break;\n        }\n        ++i;\n    }\n    return OBJECT_TO_JSVAL(jsretArr);\n}\n\njsval ssize_to_jsval(JSContext *cx, ssize_t v)\n{\n    CCASSERT(v < INT_MAX, \"The size should not bigger than 32 bit (int32_t).\");\n    return int32_to_jsval(cx, static_cast<int>(v));\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/js_manual_conversions.h",
    "content": "//\n//  Created by Rohan Kuruvilla\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n#ifndef __JS_MANUAL_CONVERSIONS_H__\n#define __JS_MANUAL_CONVERSIONS_H__\n\n#include \"jsapi.h\"\n#include \"js_bindings_core.h\"\n#include \"js_bindings_config.h\"\n#include \"cocos2d.h\"\n#include \"spidermonkey_specifics.h\"\n\n// just a simple utility to avoid mem leaking when using JSString\nclass JSStringWrapper\n{\npublic:\n    JSStringWrapper();\n    JSStringWrapper(JSString* str, JSContext* cx = NULL);\n    JSStringWrapper(jsval val, JSContext* cx = NULL);\n    ~JSStringWrapper();\n    \n    void set(jsval val, JSContext* cx);\n    void set(JSString* str, JSContext* cx);\n    const char* get();\n    \nprivate:\n    const char* _buffer;\n    \nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(JSStringWrapper);\n};\n\n// wraps a function and \"this\" object\nclass JSFunctionWrapper\n{\npublic:\n    JSFunctionWrapper(JSContext* cx, JSObject *jsthis, jsval fval);\n    ~JSFunctionWrapper();\n\n    JSBool invoke(unsigned int argc, jsval *argv, jsval &rval);\nprivate:\n    JSContext *_cx;\n    JSObject *_jsthis;\n    jsval _fval;\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(JSFunctionWrapper);\n};\n\nJSBool jsval_to_opaque( JSContext *cx, jsval vp, void **out );\nJSBool jsval_to_int( JSContext *cx, jsval vp, int *out);\nJSBool jsval_to_uint( JSContext *cx, jsval vp, unsigned int *out);\nJSBool jsval_to_c_class( JSContext *cx, jsval vp, void **out_native, struct jsb_c_proxy_s **out_proxy);\n/** converts a jsval (JS string) into a char */\nJSBool jsval_to_charptr( JSContext *cx, jsval vp, const char **out);\n\njsval opaque_to_jsval( JSContext *cx, void* opaque);\njsval c_class_to_jsval( JSContext *cx, void* handle, JSObject* object, JSClass *klass, const char* class_name);\n\n/* Converts a char ptr into a jsval (using JS string) */\njsval charptr_to_jsval( JSContext *cx, const char *str);\nJSBool JSB_jsval_typedarray_to_dataptr( JSContext *cx, jsval vp, GLsizei *count, void **data, JSArrayBufferViewType t);\nJSBool JSB_get_arraybufferview_dataptr( JSContext *cx, jsval vp, GLsizei *count, GLvoid **data );\n\n// some utility functions\n// to native\nJSBool jsval_to_ushort( JSContext *cx, jsval vp, unsigned short *ret );\nJSBool jsval_to_int32( JSContext *cx, jsval vp, int32_t *ret );\nJSBool jsval_to_uint32( JSContext *cx, jsval vp, uint32_t *ret );\nJSBool jsval_to_uint16( JSContext *cx, jsval vp, uint16_t *ret );\nJSBool jsval_to_long( JSContext *cx, jsval vp, long *out);\nJSBool jsval_to_ulong( JSContext *cx, jsval vp, unsigned long *out);\nJSBool jsval_to_long_long(JSContext *cx, jsval v, long long* ret);\nJSBool jsval_to_std_string(JSContext *cx, jsval v, std::string* ret);\nJSBool jsval_to_ccpoint(JSContext *cx, jsval v, cocos2d::Point* ret);\nJSBool jsval_to_ccrect(JSContext *cx, jsval v, cocos2d::Rect* ret);\nJSBool jsval_to_ccsize(JSContext *cx, jsval v, cocos2d::Size* ret);\nJSBool jsval_to_cccolor4b(JSContext *cx, jsval v, cocos2d::Color4B* ret);\nJSBool jsval_to_cccolor4f(JSContext *cx, jsval v, cocos2d::Color4F* ret);\nJSBool jsval_to_cccolor3b(JSContext *cx, jsval v, cocos2d::Color3B* ret);\nJSBool jsval_to_ccarray_of_CCPoint(JSContext* cx, jsval v, cocos2d::Point **points, int *numPoints);\nJSBool jsval_to_ccarray(JSContext* cx, jsval v, cocos2d::__Array** ret);\nJSBool jsval_to_ccdictionary(JSContext* cx, jsval v, cocos2d::__Dictionary** ret);\nJSBool jsval_to_ccacceleration(JSContext* cx,jsval v, cocos2d::Acceleration* ret);\nJSBool jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc, cocos2d::__Array** ret);\n\n// forward declaration\njs_proxy_t* jsb_get_js_proxy(JSObject* jsObj);\n\ntemplate <class T>\nJSBool jsvals_variadic_to_ccvector( JSContext *cx, jsval *vp, int argc, cocos2d::Vector<T>* ret)\n{\n    JSBool ok = JS_TRUE;\n\n    for (int i = 0; i < argc; i++)\n    {\n        js_proxy_t* p;\n        JSObject* obj = JSVAL_TO_OBJECT(*vp);\n        p = jsb_get_js_proxy(obj);\n        CCASSERT(p, \"Native object not found!\");\n        if (p) {\n            ret->pushBack((T)p->ptr);\n        }\n        \n        // next\n        vp++;\n    }\n\n    JSB_PRECONDITION3(ok, cx, JS_FALSE, \"Error processing arguments\");\n    return ok;\n}\n\nJSBool jsvals_variadic_to_ccvaluevector( JSContext *cx, jsval *vp, int argc, cocos2d::ValueVector* ret);\n\nJSBool jsval_to_ccaffinetransform(JSContext* cx, jsval v, cocos2d::AffineTransform* ret);\nJSBool jsval_to_FontDefinition( JSContext *cx, jsval vp, cocos2d::FontDefinition* ret );\n\ntemplate <class T>\nJSBool jsval_to_ccvector(JSContext* cx, jsval v, cocos2d::Vector<T>* ret)\n{\n    JSObject *jsobj;\n    JSBool ok = v.isObject() && JS_ValueToObject( cx, v, &jsobj );\n    JSB_PRECONDITION3( ok, cx, JS_FALSE, \"Error converting value to object\");\n    JSB_PRECONDITION3( jsobj && JS_IsArrayObject( cx, jsobj),  cx, JS_FALSE, \"Object must be an array\");\n    \n    uint32_t len = 0;\n    JS_GetArrayLength(cx, jsobj, &len);\n\n    for (uint32_t i=0; i < len; i++)\n    {\n        jsval value;\n        if (JS_GetElement(cx, jsobj, i, &value))\n        {\n            CCASSERT(value.isObject(), \"the element in Vector isn't a native object.\");\n\n            js_proxy_t *proxy;\n            JSObject *tmp = JSVAL_TO_OBJECT(value);\n            proxy = jsb_get_js_proxy(tmp);\n            T cobj = (T)(proxy ? proxy->ptr : nullptr);\n            if (cobj)\n            {\n                ret->pushBack(cobj);\n            }\n        }\n    }\n\n    return JS_TRUE;\n}\n\nJSBool jsval_to_ccvalue(JSContext* cx, jsval v, cocos2d::Value* ret);\nJSBool jsval_to_ccvaluemap(JSContext* cx, jsval v, cocos2d::ValueMap* ret);\nJSBool jsval_to_ccvaluemapintkey(JSContext* cx, jsval v, cocos2d::ValueMapIntKey* ret);\nJSBool jsval_to_ccvaluevector(JSContext* cx, jsval v, cocos2d::ValueVector* ret);\nJSBool jsval_to_ssize( JSContext *cx, jsval vp, ssize_t* ret);\nJSBool jsval_to_std_vector_string( JSContext *cx, jsval vp, std::vector<std::string>* ret);\nJSBool jsval_to_std_vector_int( JSContext *cx, jsval vp, std::vector<int>* ret);\n\ntemplate <class T>\nJSBool jsval_to_ccmap_string_key(JSContext *cx, jsval v, cocos2d::Map<std::string, T>* ret)\n{\n    if (JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v))\n    {\n        return JS_TRUE;\n    }\n    \n    JSObject* tmp = JSVAL_TO_OBJECT(v);\n    if (!tmp) {\n        CCLOG(\"%s\", \"jsval_to_ccvaluemap: the jsval is not an object.\");\n        return JS_FALSE;\n    }\n    \n    JSObject* it = JS_NewPropertyIterator(cx, tmp);\n    \n    while (true)\n    {\n        jsid idp;\n        jsval key;\n        if (! JS_NextProperty(cx, it, &idp) || ! JS_IdToValue(cx, idp, &key)) {\n            return JS_FALSE; // error\n        }\n        \n        if (key == JSVAL_VOID) {\n            break; // end of iteration\n        }\n        \n        if (!JSVAL_IS_STRING(key)) {\n            continue; // ignore integer properties\n        }\n        \n        JSStringWrapper keyWrapper(JSVAL_TO_STRING(key), cx);\n        \n        JS::RootedValue value(cx);\n        JS_GetPropertyById(cx, tmp, idp, &value);\n        if (value.isObject())\n        {\n            js_proxy_t *proxy = nullptr;\n            JSObject* jsobj = JSVAL_TO_OBJECT(value);\n            proxy = jsb_get_js_proxy(jsobj);\n            CCASSERT(proxy, \"Native object should be added!\");\n            T cobj = (T)(proxy ? proxy->ptr : nullptr);\n            ret->insert(keyWrapper.get(), cobj);\n        }\n        else\n        {\n            CCASSERT(false, \"not supported type\");\n        }\n    }\n    \n    return JS_TRUE;\n}\n\n// from native\njsval int32_to_jsval( JSContext *cx, int32_t l);\njsval uint32_to_jsval( JSContext *cx, uint32_t number );\njsval ushort_to_jsval( JSContext *cx, unsigned short number );\njsval long_to_jsval( JSContext *cx, long number );\njsval ulong_to_jsval(JSContext* cx, unsigned long v);\njsval long_long_to_jsval(JSContext* cx, long long v);\njsval std_string_to_jsval(JSContext* cx, const std::string& v);\njsval c_string_to_jsval(JSContext* cx, const char* v, size_t length = -1);\njsval ccpoint_to_jsval(JSContext* cx, const cocos2d::Point& v);\njsval ccrect_to_jsval(JSContext* cx, const cocos2d::Rect& v);\njsval ccsize_to_jsval(JSContext* cx, const cocos2d::Size& v);\njsval cccolor4b_to_jsval(JSContext* cx, const cocos2d::Color4B& v);\njsval cccolor4f_to_jsval(JSContext* cx, const cocos2d::Color4F& v);\njsval cccolor3b_to_jsval(JSContext* cx, const cocos2d::Color3B& v);\njsval ccdictionary_to_jsval(JSContext* cx, cocos2d::__Dictionary *dict);\njsval ccarray_to_jsval(JSContext* cx, cocos2d::__Array *arr);\njsval ccacceleration_to_jsval(JSContext* cx, const cocos2d::Acceleration& v);\njsval ccaffinetransform_to_jsval(JSContext* cx, const cocos2d::AffineTransform& t);\njsval FontDefinition_to_jsval(JSContext* cx, const cocos2d::FontDefinition& t);\n\nJSBool jsval_to_CGPoint( JSContext *cx, jsval vp, cpVect *out );\njsval CGPoint_to_jsval( JSContext *cx, cpVect p );\n\n#define cpVect_to_jsval CGPoint_to_jsval\n#define jsval_to_cpVect jsval_to_CGPoint\n\n\ntemplate<class T>\njs_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj);\n\ntemplate <class T>\njsval ccvector_to_jsval(JSContext* cx, const cocos2d::Vector<T>& v)\n{\n    JSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL);\n    \n    int i = 0;\n    for (const auto& obj : v)\n    {\n        jsval arrElement;\n        \n        //First, check whether object is associated with js object.\n        js_proxy_t* jsproxy = js_get_or_create_proxy<cocos2d::Object>(cx, obj);\n        if (jsproxy) {\n            arrElement = OBJECT_TO_JSVAL(jsproxy->obj);\n        }\n\n        if (!JS_SetElement(cx, jsretArr, i, &arrElement)) {\n            break;\n        }\n        ++i;\n    }\n    return OBJECT_TO_JSVAL(jsretArr);\n}\n\ntemplate <class T>\njsval ccmap_string_key_to_jsval(JSContext* cx, const cocos2d::Map<std::string, T>& v)\n{\n    JSObject* jsRet = JS_NewObject(cx, NULL, NULL, NULL);\n    \n    for (auto iter = v.begin(); iter != v.end(); ++iter)\n    {\n        JS::RootedValue element(cx);\n        \n        std::string key = iter->first;\n        T obj = iter->second;\n        \n        //First, check whether object is associated with js object.\n        js_proxy_t* jsproxy = js_get_or_create_proxy<cocos2d::Object>(cx, obj);\n        if (jsproxy) {\n            element = OBJECT_TO_JSVAL(jsproxy->obj);\n        }\n        \n        if (!key.empty())\n        {\n            JS_SetProperty(cx, jsRet, key.c_str(), element);\n        }\n    }\n    return OBJECT_TO_JSVAL(jsRet);\n}\n\njsval ccvalue_to_jsval(JSContext* cx, const cocos2d::Value& v);\njsval ccvaluemap_to_jsval(JSContext* cx, const cocos2d::ValueMap& v);\njsval ccvaluemapintkey_to_jsval(JSContext* cx, const cocos2d::ValueMapIntKey& v);\njsval ccvaluevector_to_jsval(JSContext* cx, const cocos2d::ValueVector& v);\njsval ssize_to_jsval(JSContext *cx, ssize_t v);\n\n#endif /* __JS_MANUAL_CONVERSIONS_H__ */\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/jsb_helper.h",
    "content": "#ifndef __XMLHTTPHELPER_H__\n#define __XMLHTTPHELPER_H__\n\n#include <typeinfo>\n#include <string>\n#include <memory>\n#include \"jsapi.h\"\n\n//#pragma mark - Helpful Macros\n\n#define JS_BINDED_CLASS_GLUE(klass) \\\nstatic JSClass js_class; \\\nstatic JSObject* js_proto; \\\nstatic JSObject* js_parent; \\\nstatic void _js_register(JSContext* cx, JSObject* global);\n\n#define JS_BINDED_CLASS_GLUE_IMPL(klass) \\\nJSClass klass::js_class = {}; \\\nJSObject* klass::js_proto = NULL; \\\nJSObject* klass::js_parent = NULL; \\\n\n#define JS_BINDED_FUNC(klass, name) \\\nJSBool name(JSContext *cx, unsigned argc, jsval *vp)\n\n#define JS_BINDED_CONSTRUCTOR(klass) \\\nstatic JSBool _js_constructor(JSContext *cx, unsigned argc, jsval *vp)\n\n#define JS_BINDED_CONSTRUCTOR_IMPL(klass) \\\nJSBool klass::_js_constructor(JSContext *cx, unsigned argc, jsval *vp)\n\n#define JS_BINDED_FUNC_IMPL(klass, name) \\\nstatic JSBool klass##_func_##name(JSContext *cx, unsigned argc, jsval *vp) { \\\nJSObject* thisObj = JS_THIS_OBJECT(cx, vp); \\\nklass* obj = (klass*)JS_GetPrivate(thisObj); \\\nif (obj) { \\\nreturn obj->name(cx, argc, vp); \\\n} \\\nJS_ReportError(cx, \"Invalid object call for function %s\", #name); \\\nreturn JS_FALSE; \\\n} \\\nJSBool klass::name(JSContext *cx, unsigned argc, jsval *vp)\n\n#define JS_WRAP_OBJECT_IN_VAL(klass, cobj, out) \\\ndo { \\\nJSObject *obj = JS_NewObject(cx, &klass::js_class, klass::js_proto, klass::js_parent); \\\nif (obj) { \\\nJS_SetPrivate(obj, cobj); \\\nout = OBJECT_TO_JSVAL(obj); \\\n} \\\n} while(0) \\\n\n#define JS_BINDED_FUNC_FOR_DEF(klass, name) \\\nJS_FN(#name, klass##_func_##name, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT)\n\n#define JS_BINDED_PROP_GET(klass, propName) \\\nJSBool _js_get_##propName(JSContext *cx, JS::HandleId id, JS::MutableHandleValue vp)\n\n#define JS_BINDED_PROP_GET_IMPL(klass, propName) \\\nstatic JSBool _js_get_##klass##_##propName(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp) { \\\nklass* cobj = (klass*)JS_GetPrivate(obj); \\\nif (cobj) { \\\nreturn cobj->_js_get_##propName(cx, id, vp); \\\n} \\\nJS_ReportError(cx, \"Invalid getter call for property %s\", #propName); \\\nreturn JS_FALSE; \\\n} \\\nJSBool klass::_js_get_##propName(JSContext *cx, JS::HandleId id, JS::MutableHandleValue vp)\n\n#define JS_BINDED_PROP_SET(klass, propName) \\\nJSBool _js_set_##propName(JSContext *cx, JS::HandleId id, JSBool strict, JS::MutableHandleValue vp)\n\n#define JS_BINDED_PROP_SET_IMPL(klass, propName) \\\nstatic JSBool _js_set_##klass##_##propName(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict, JS::MutableHandleValue vp) { \\\nklass* cobj = (klass*)JS_GetPrivate(obj); \\\nif (cobj) { \\\nreturn cobj->_js_set_##propName(cx, id, strict, vp); \\\n} \\\nJS_ReportError(cx, \"Invalid setter call for property %s\", #propName); \\\nreturn JS_FALSE; \\\n} \\\nJSBool klass::_js_set_##propName(JSContext *cx, JS::HandleId id, JSBool strict, JS::MutableHandleValue vp)\n\n#define JS_BINDED_PROP_ACCESSOR(klass, propName) \\\nJS_BINDED_PROP_GET(klass, propName); \\\nJS_BINDED_PROP_SET(klass, propName);\n\n#define JS_BINDED_PROP_DEF_GETTER(klass, propName) \\\n{#propName, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_SHARED, JSOP_WRAPPER(_js_get_##klass##_##propName), NULL}\n\n#define JS_BINDED_PROP_DEF_ACCESSOR(klass, propName) \\\n{#propName, 0, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_SHARED, JSOP_WRAPPER(_js_get_##klass##_##propName), JSOP_WRAPPER(_js_set_##klass##_##propName)}\n\n#define JS_CREATE_UINT_WRAPPED(valOut, propName, val) \\\ndo { \\\nJSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL); \\\njsval propVal = UINT_TO_JSVAL(val); \\\nJS_SetProperty(cx, jsobj, \"__\" propName, &propVal); \\\nvalOut = OBJECT_TO_JSVAL(jsobj); \\\n} while(0)\n\n#define JS_GET_UINT_WRAPPED(inVal, propName, out) \\\ndo { \\\nif (inVal.isObject()) {\\\nJSObject* jsobj = JSVAL_TO_OBJECT(inVal); \\\njsval outVal; \\\nJS_GetProperty(cx, jsobj, \"__\" propName, &outVal); \\\nJS_ValueToECMAUint32(cx, outVal, &out); \\\n} else { \\\nint32_t tmp; \\\nJS_ValueToInt32(cx, inVal, &tmp); \\\nout = (uint32_t)tmp; \\\n} \\\n} while (0)\n\n#endif /* __XMLHTTPHELPER_H__ */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/jsb_opengl_functions.cpp",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_jsb.py -c opengl_jsb.ini\" on 2013-03-05\n* Script version: v0.6\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_OPENGL\n\n#include \"jsb_opengl_manual.h\"\n\n#include \"jsfriendapi.h\"\n//#include \"jsb_config.h\"\n#include \"js_bindings_core.h\"\n#include \"js_manual_conversions.h\"\n#include \"jsb_opengl_functions.h\"\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glActiveTexture(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0;\n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglActiveTexture((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLuint\n// Ret value: void\nJSBool JSB_glAttachShader(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglAttachShader((GLuint)arg0 , (GLuint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLuint, char*\n// Ret value: void\nJSBool JSB_glBindAttribLocation(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; const char* arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_charptr(cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBindAttribLocation((GLuint)arg0 , (GLuint)arg1 , (char*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLuint\n// Ret value: void\nJSBool JSB_glBindBuffer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBindBuffer((GLenum)arg0 , (GLuint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLuint\n// Ret value: void\nJSBool JSB_glBindFramebuffer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBindFramebuffer((GLenum)arg0 , (GLuint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLuint\n// Ret value: void\nJSBool JSB_glBindRenderbuffer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBindRenderbuffer((GLenum)arg0 , (GLuint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLuint\n// Ret value: void\nJSBool JSB_glBindTexture(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBindTexture((GLenum)arg0 , (GLuint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLclampf, GLclampf, GLclampf, GLclampf\n// Ret value: void\nJSBool JSB_glBlendColor(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBlendColor((GLclampf)arg0 , (GLclampf)arg1 , (GLclampf)arg2 , (GLclampf)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glBlendEquation(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBlendEquation((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum\n// Ret value: void\nJSBool JSB_glBlendEquationSeparate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBlendEquationSeparate((GLenum)arg0 , (GLenum)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum\n// Ret value: void\nJSBool JSB_glBlendFunc(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBlendFunc((GLenum)arg0 , (GLenum)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLenum, GLenum\n// Ret value: void\nJSBool JSB_glBlendFuncSeparate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; uint32_t arg2; uint32_t arg3; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBlendFuncSeparate((GLenum)arg0 , (GLenum)arg1 , (GLenum)arg2 , (GLenum)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, ArrayBufferView, GLenum\n// Ret value: void\nJSBool JSB_glBufferData(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; void* arg1; uint32_t arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg1);\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBufferData((GLenum)arg0 , count, (GLvoid*)arg1 , (GLenum)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLintptr, ArrayBufferView\n// Ret value: void\nJSBool JSB_glBufferSubData(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg2);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglBufferSubData((GLenum)arg0 , (GLintptr)arg1 , count, (GLvoid*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: GLenum\nJSBool JSB_glCheckFramebufferStatus(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLenum ret_val;\n\n\tret_val = glCheckFramebufferStatus((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLbitfield\n// Ret value: void\nJSBool JSB_glClear(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglClear((GLbitfield)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLclampf, GLclampf, GLclampf, GLclampf\n// Ret value: void\nJSBool JSB_glClearColor(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglClearColor((GLclampf)arg0 , (GLclampf)arg1 , (GLclampf)arg2 , (GLclampf)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLclampf\n// Ret value: void\nJSBool JSB_glClearDepthf(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglClearDepthf((GLclampf)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint\n// Ret value: void\nJSBool JSB_glClearStencil(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglClearStencil((GLint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLboolean, GLboolean, GLboolean, GLboolean\n// Ret value: void\nJSBool JSB_glColorMask(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint16_t arg0; uint16_t arg1; uint16_t arg2; uint16_t arg3; \n\n\tok &= jsval_to_uint16( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglColorMask((GLboolean)arg0 , (GLboolean)arg1 , (GLboolean)arg2 , (GLboolean)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glCompileShader(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglCompileShader((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, ArrayBufferView\n// Ret value: void\nJSBool JSB_glCompressedTexImage2D(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 8, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; uint32_t arg2; int32_t arg3; int32_t arg4; int32_t arg5; int32_t arg6; void* arg7; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg5 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg6 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg7);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglCompressedTexImage2D((GLenum)arg0 , (GLint)arg1 , (GLenum)arg2 , (GLsizei)arg3 , (GLsizei)arg4 , (GLint)arg5 , (GLsizei)arg6 , (GLvoid*)arg7  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, ArrayBufferView\n// Ret value: void\nJSBool JSB_glCompressedTexSubImage2D(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 9, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; int32_t arg4; int32_t arg5; uint32_t arg6; int32_t arg7; void* arg8; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg5 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg6 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg7 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg8);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglCompressedTexSubImage2D((GLenum)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3 , (GLsizei)arg4 , (GLsizei)arg5 , (GLenum)arg6 , (GLsizei)arg7 , (GLvoid*)arg8  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint\n// Ret value: void\nJSBool JSB_glCopyTexImage2D(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 8, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; uint32_t arg2; int32_t arg3; int32_t arg4; int32_t arg5; int32_t arg6; int32_t arg7; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg5 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg6 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg7 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglCopyTexImage2D((GLenum)arg0 , (GLint)arg1 , (GLenum)arg2 , (GLint)arg3 , (GLint)arg4 , (GLsizei)arg5 , (GLsizei)arg6 , (GLint)arg7  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei\n// Ret value: void\nJSBool JSB_glCopyTexSubImage2D(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 8, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; int32_t arg4; int32_t arg5; int32_t arg6; int32_t arg7; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg5 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg6 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg7 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglCopyTexSubImage2D((GLenum)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3 , (GLint)arg4 , (GLint)arg5 , (GLsizei)arg6 , (GLsizei)arg7  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: GLuint\nJSBool JSB_glCreateProgram(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tGLuint ret_val;\n\n\tret_val = glCreateProgram( );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: GLuint\nJSBool JSB_glCreateShader(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLuint ret_val;\n\n\tret_val = glCreateShader((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glCullFace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglCullFace((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glDeleteProgram(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDeleteProgram((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glDeleteShader(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDeleteShader((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glDepthFunc(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDepthFunc((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLboolean\n// Ret value: void\nJSBool JSB_glDepthMask(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint16_t arg0; \n\n\tok &= jsval_to_uint16( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDepthMask((GLboolean)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLclampf, GLclampf\n// Ret value: void\nJSBool JSB_glDepthRangef(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDepthRangef((GLclampf)arg0 , (GLclampf)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLuint\n// Ret value: void\nJSBool JSB_glDetachShader(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDetachShader((GLuint)arg0 , (GLuint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glDisable(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDisable((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glDisableVertexAttribArray(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDisableVertexAttribArray((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLsizei\n// Ret value: void\nJSBool JSB_glDrawArrays(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDrawArrays((GLenum)arg0 , (GLint)arg1 , (GLsizei)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLsizei, GLenum, ArrayBufferView\n// Ret value: void\nJSBool JSB_glDrawElements(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; uint32_t arg2; void* arg3; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg3);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glEnable(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglEnable((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glEnableVertexAttribArray(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglEnableVertexAttribArray((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_glFinish(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tglFinish( );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_glFlush(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tglFlush( );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLenum, GLuint\n// Ret value: void\nJSBool JSB_glFramebufferRenderbuffer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; uint32_t arg2; uint32_t arg3; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglFramebufferRenderbuffer((GLenum)arg0 , (GLenum)arg1 , (GLenum)arg2 , (GLuint)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLenum, GLuint, GLint\n// Ret value: void\nJSBool JSB_glFramebufferTexture2D(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 5, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; uint32_t arg2; uint32_t arg3; int32_t arg4; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglFramebufferTexture2D((GLenum)arg0 , (GLenum)arg1 , (GLenum)arg2 , (GLuint)arg3 , (GLint)arg4  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glFrontFace(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglFrontFace((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: void\nJSBool JSB_glGenerateMipmap(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglGenerateMipmap((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, char*\n// Ret value: int\nJSBool JSB_glGetAttribLocation(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; const char* arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_charptr( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tint ret_val;\n\n\tret_val = glGetAttribLocation((GLuint)arg0 , (char*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: GLenum\nJSBool JSB_glGetError(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tGLenum ret_val;\n\n\tret_val = glGetError( );\n\tJS_SET_RVAL(cx, vp, UINT_TO_JSVAL((uint32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, char*\n// Ret value: int\nJSBool JSB_glGetUniformLocation(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; const char* arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_charptr( cx, *argvp++, &arg1 );\n    printf(\"%s \", arg1);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tint ret_val;\n\n\tret_val = glGetUniformLocation((GLuint)arg0 , (char*)arg1  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum\n// Ret value: void\nJSBool JSB_glHint(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglHint((GLenum)arg0 , (GLenum)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: GLboolean\nJSBool JSB_glIsBuffer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLboolean ret_val;\n\n\tret_val = glIsBuffer((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum\n// Ret value: GLboolean\nJSBool JSB_glIsEnabled(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLboolean ret_val;\n\n\tret_val = glIsEnabled((GLenum)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: GLboolean\nJSBool JSB_glIsFramebuffer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLboolean ret_val;\n\n\tret_val = glIsFramebuffer((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: GLboolean\nJSBool JSB_glIsProgram(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLboolean ret_val;\n\n\tret_val = glIsProgram((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: GLboolean\nJSBool JSB_glIsRenderbuffer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLboolean ret_val;\n\n\tret_val = glIsRenderbuffer((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: GLboolean\nJSBool JSB_glIsShader(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLboolean ret_val;\n\n\tret_val = glIsShader((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: GLboolean\nJSBool JSB_glIsTexture(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tGLboolean ret_val;\n\n\tret_val = glIsTexture((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL((int32_t)ret_val));\n\treturn JS_TRUE;\n}\n\n// Arguments: GLfloat\n// Ret value: void\nJSBool JSB_glLineWidth(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglLineWidth((GLfloat)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glLinkProgram(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglLinkProgram((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint\n// Ret value: void\nJSBool JSB_glPixelStorei(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglPixelStorei((GLenum)arg0 , (GLint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLfloat, GLfloat\n// Ret value: void\nJSBool JSB_glPolygonOffset(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglPolygonOffset((GLfloat)arg0 , (GLfloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, ArrayBufferView\n// Ret value: void\nJSBool JSB_glReadPixels(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 7, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; uint32_t arg4; uint32_t arg5; void* arg6; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg5 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg6);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglReadPixels((GLint)arg0 , (GLint)arg1 , (GLsizei)arg2 , (GLsizei)arg3 , (GLenum)arg4 , (GLenum)arg5 , (GLvoid*)arg6  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: \n// Ret value: void\nJSBool JSB_glReleaseShaderCompiler(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n\tglReleaseShaderCompiler( );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLsizei, GLsizei\n// Ret value: void\nJSBool JSB_glRenderbufferStorage(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglRenderbufferStorage((GLenum)arg0 , (GLenum)arg1 , (GLsizei)arg2 , (GLsizei)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLclampf, GLboolean\n// Ret value: void\nJSBool JSB_glSampleCoverage(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; uint16_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglSampleCoverage((GLclampf)arg0 , (GLboolean)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLint, GLsizei, GLsizei\n// Ret value: void\nJSBool JSB_glScissor(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglScissor((GLint)arg0 , (GLint)arg1 , (GLsizei)arg2 , (GLsizei)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLuint\n// Ret value: void\nJSBool JSB_glStencilFunc(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; uint32_t arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglStencilFunc((GLenum)arg0 , (GLint)arg1 , (GLuint)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLint, GLuint\n// Ret value: void\nJSBool JSB_glStencilFuncSeparate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; int32_t arg2; uint32_t arg3; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglStencilFuncSeparate((GLenum)arg0 , (GLenum)arg1 , (GLint)arg2 , (GLuint)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glStencilMask(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglStencilMask((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLuint\n// Ret value: void\nJSBool JSB_glStencilMaskSeparate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglStencilMaskSeparate((GLenum)arg0 , (GLuint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLenum\n// Ret value: void\nJSBool JSB_glStencilOp(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; uint32_t arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglStencilOp((GLenum)arg0 , (GLenum)arg1 , (GLenum)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLenum, GLenum\n// Ret value: void\nJSBool JSB_glStencilOpSeparate(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; uint32_t arg2; uint32_t arg3; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglStencilOpSeparate((GLenum)arg0 , (GLenum)arg1 , (GLenum)arg2 , (GLenum)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, ArrayBufferView\n// Ret value: void\nJSBool JSB_glTexImage2D(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 9, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; int32_t arg4; int32_t arg5; uint32_t arg6; uint32_t arg7; void* arg8; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg5 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg6 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg7 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg8);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglTexImage2D((GLenum)arg0 , (GLint)arg1 , (GLint)arg2 , (GLsizei)arg3 , (GLsizei)arg4 , (GLint)arg5 , (GLenum)arg6 , (GLenum)arg7 , (GLvoid*)arg8  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLfloat\n// Ret value: void\nJSBool JSB_glTexParameterf(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; int32_t arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglTexParameterf((GLenum)arg0 , (GLenum)arg1 , (GLfloat)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLenum, GLint\n// Ret value: void\nJSBool JSB_glTexParameteri(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; uint32_t arg1; int32_t arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglTexParameteri((GLenum)arg0 , (GLenum)arg1 , (GLint)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, ArrayBufferView\n// Ret value: void\nJSBool JSB_glTexSubImage2D(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 9, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; int32_t arg4; int32_t arg5; uint32_t arg6; uint32_t arg7; void* arg8; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg5 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg6 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg7 );\n\tGLsizei count;\n\tok &= JSB_get_arraybufferview_dataptr( cx, *argvp++, &count, &arg8);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglTexSubImage2D((GLenum)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3 , (GLsizei)arg4 , (GLsizei)arg5 , (GLenum)arg6 , (GLenum)arg7 , (GLvoid*)arg8  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLfloat\n// Ret value: void\nJSBool JSB_glUniform1f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform1f((GLint)arg0 , (GLfloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform1fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform1fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLint\n// Ret value: void\nJSBool JSB_glUniform1i(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform1i((GLint)arg0 , (GLint)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform1iv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_INT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform1iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLfloat, GLfloat\n// Ret value: void\nJSBool JSB_glUniform2f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform2f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform2fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform2fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLint, GLint\n// Ret value: void\nJSBool JSB_glUniform2i(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform2i((GLint)arg0 , (GLint)arg1 , (GLint)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform2iv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_INT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform2iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLfloat, GLfloat, GLfloat\n// Ret value: void\nJSBool JSB_glUniform3f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform3f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform3fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform3fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLint, GLint, GLint\n// Ret value: void\nJSBool JSB_glUniform3i(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform3i((GLint)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform3iv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_INT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform3iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLfloat, GLfloat, GLfloat, GLfloat\n// Ret value: void\nJSBool JSB_glUniform4f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 5, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; int32_t arg4; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform4f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 , (GLfloat)arg4  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform4fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform4fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLint, GLint, GLint, GLint\n// Ret value: void\nJSBool JSB_glUniform4i(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 5, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; int32_t arg4; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform4i((GLint)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3 , (GLint)arg4  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLsizei, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniform4iv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_INT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniform4iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLboolean, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniformMatrix2fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; uint16_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniformMatrix2fv(arg0, 1, (GLboolean)arg1 , (GLfloat*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLboolean, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniformMatrix3fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; uint16_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniformMatrix3fv(arg0, 1, (GLboolean)arg1 , (GLfloat*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLboolean, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glUniformMatrix4fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; uint16_t arg1; void* arg2; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg1 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg2, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUniformMatrix4fv(arg0, 1, (GLboolean)arg1 , (GLfloat*)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glUseProgram(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglUseProgram((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint\n// Ret value: void\nJSBool JSB_glValidateProgram(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglValidateProgram((GLuint)arg0  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLfloat\n// Ret value: void\nJSBool JSB_glVertexAttrib1f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib1f((GLuint)arg0 , (GLfloat)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glVertexAttrib1fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; void* arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg1, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib1fv((GLuint)arg0 , (GLfloat*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLfloat, GLfloat\n// Ret value: void\nJSBool JSB_glVertexAttrib2f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 3, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib2f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glVertexAttrib2fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; void* arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg1, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib2fv((GLuint)arg0 , (GLfloat*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLfloat, GLfloat, GLfloat\n// Ret value: void\nJSBool JSB_glVertexAttrib3f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib3f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glVertexAttrib3fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; void* arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg1, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib3fv((GLuint)arg0 , (GLfloat*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLfloat, GLfloat, GLfloat, GLfloat\n// Ret value: void\nJSBool JSB_glVertexAttrib4f(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 5, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; int32_t arg4; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib4f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 , (GLfloat)arg4  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, TypedArray/Sequence\n// Ret value: void\nJSBool JSB_glVertexAttrib4fv(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; void* arg1; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tGLsizei count;\n\tok &= JSB_jsval_typedarray_to_dataptr( cx, *argvp++, &count, &arg1, js::ArrayBufferView::TYPE_FLOAT32);\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttrib4fv((GLuint)arg0 , (GLfloat*)arg1  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLuint, GLint, GLenum, GLboolean, GLsizei, GLvoid*\n// Ret value: void\nJSBool JSB_glVertexAttribPointer(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 6, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tuint32_t arg0; int32_t arg1; uint32_t arg2; uint16_t arg3; int32_t arg4; int32_t arg5; \n\n\tok &= jsval_to_uint32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_uint32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_uint16( cx, *argvp++, &arg3 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg4 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg5 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglVertexAttribPointer((GLuint)arg0 , (GLint)arg1 , (GLenum)arg2 , (GLboolean)arg3 , (GLsizei)arg4 , (GLvoid*)arg5  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: GLint, GLint, GLsizei, GLsizei\n// Ret value: void\nJSBool JSB_glViewport(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 4, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tint32_t arg0; int32_t arg1; int32_t arg2; int32_t arg3; \n\n\tok &= jsval_to_int32( cx, *argvp++, &arg0 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg1 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg2 );\n\tok &= jsval_to_int32( cx, *argvp++, &arg3 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tglViewport((GLint)arg0 , (GLint)arg1 , (GLsizei)arg2 , (GLsizei)arg3  );\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n\n#endif // JSB_INCLUDE_OPENGL\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/jsb_opengl_functions.h",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_jsb.py -c opengl_jsb.ini\" on 2013-03-05\n* Script version: v0.6\n*/\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_OPENGL\n\n#include \"jsb_opengl_manual.h\"\n\nextern \"C\" {\n    \nJSBool JSB_glActiveTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glAttachShader(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBindAttribLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBindBuffer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBindFramebuffer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBindRenderbuffer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBindTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBlendColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBlendEquation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBlendEquationSeparate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBlendFunc(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBlendFuncSeparate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBufferData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glBufferSubData(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCheckFramebufferStatus(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glClear(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glClearColor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glClearDepthf(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glClearStencil(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glColorMask(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCompileShader(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCompressedTexImage2D(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCompressedTexSubImage2D(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCopyTexImage2D(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCopyTexSubImage2D(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCreateProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCreateShader(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glCullFace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDeleteBuffers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDeleteFramebuffers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDeleteProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDeleteRenderbuffers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDeleteShader(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDeleteTextures(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDepthFunc(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDepthMask(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDepthRangef(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDetachShader(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDisable(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDisableVertexAttribArray(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDrawArrays(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glDrawElements(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glEnable(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glEnableVertexAttribArray(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glFinish(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glFlush(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glFramebufferRenderbuffer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glFramebufferTexture2D(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glFrontFace(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGenBuffers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGenFramebuffers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGenRenderbuffers(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGenTextures(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGenerateMipmap(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetActiveAttrib(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetActiveUniform(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetAttachedShaders(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetAttribLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetError(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetProgramInfoLog(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetProgramiv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetShaderInfoLog(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetShaderSource(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetShaderiv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetTexParameterfv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetUniformLocation(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glGetUniformfv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glHint(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glIsBuffer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glIsEnabled(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glIsFramebuffer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glIsProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glIsRenderbuffer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glIsShader(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glIsTexture(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glLineWidth(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glLinkProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glPixelStorei(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glPolygonOffset(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glReadPixels(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glReleaseShaderCompiler(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glRenderbufferStorage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glSampleCoverage(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glScissor(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glShaderSource(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glStencilFunc(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glStencilFuncSeparate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glStencilMask(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glStencilMaskSeparate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glStencilOp(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glStencilOpSeparate(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glTexImage2D(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glTexParameterf(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glTexParameteri(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glTexSubImage2D(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform1f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform1fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform1i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform1iv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform2f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform2fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform2i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform2iv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform3f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform3fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform3i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform3iv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform4f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform4fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform4i(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniform4iv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniformMatrix2fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniformMatrix3fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUniformMatrix4fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glUseProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glValidateProgram(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib1f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib1fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib2f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib2fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib3f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib3fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib4f(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttrib4fv(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glVertexAttribPointer(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_glViewport(JSContext *cx, uint32_t argc, jsval *vp);\n\n}\n\n\n\n#endif // JSB_INCLUDE_OPENGL\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/jsb_opengl_manual.cpp",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2013 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_OPENGL\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n#include \"jsb_opengl_manual.h\"\n#include \"js_manual_conversions.h\"\n#include \"js_bindings_core.h\"\n#include \"jsb_opengl_functions.h\"\n\n\n// Helper functions that link \"glGenXXXs\" (OpenGL ES 2.0 spec), with \"gl.createXXX\" (WebGL spec)\nJSBool JSB_glGenTextures(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n    GLuint texture;\n    glGenTextures(1, &texture);\n    JS_SET_RVAL(cx, vp, INT_TO_JSVAL(texture));\n    return JS_TRUE;\n}\n\nJSBool JSB_glGenBuffers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n    GLuint buffer;\n    glGenBuffers(1, &buffer);\n    JS_SET_RVAL(cx, vp, INT_TO_JSVAL(buffer));\n    return JS_TRUE;\n}\n\nJSBool JSB_glGenRenderbuffers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n    GLuint renderbuffers;\n    glGenRenderbuffers(1, &renderbuffers);\n    JS_SET_RVAL(cx, vp, INT_TO_JSVAL(renderbuffers));\n    return JS_TRUE;\n}\n\nJSBool JSB_glGenFramebuffers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n    GLuint framebuffers;\n    glGenFramebuffers(1, &framebuffers);\n    JS_SET_RVAL(cx, vp, INT_TO_JSVAL(framebuffers));\n    return JS_TRUE;\n}\n\nJSBool JSB_glDeleteTextures(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    glDeleteTextures(1, &arg0);\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n\nJSBool JSB_glDeleteBuffers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    glDeleteBuffers(1, &arg0);\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n\nJSBool JSB_glDeleteRenderbuffers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    glDeleteRenderbuffers(1, &arg0);\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n\nJSBool JSB_glDeleteFramebuffers(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    glDeleteFramebuffers(1, &arg0);\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n\nJSBool JSB_glShaderSource(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0; const char *arg1;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    ok &= jsval_to_charptr(cx, *argvp++, &arg1);\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    glShaderSource(arg0, 1, &arg1, NULL);\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n\nJSBool JSB_glGetShaderiv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0, arg1;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    ok &= jsval_to_uint( cx, *argvp++, &arg1 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLint ret;\n    glGetShaderiv(arg0, arg1, &ret);\n    JS_SET_RVAL(cx, vp, INT_TO_JSVAL(ret));\n    return JS_TRUE;\n}\n\nJSBool JSB_glGetProgramiv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0, arg1;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    ok &= jsval_to_uint( cx, *argvp++, &arg1 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLint ret;\n    glGetProgramiv(arg0, arg1, &ret);\n    JS_SET_RVAL(cx, vp, INT_TO_JSVAL(ret));\n    return JS_TRUE;\n}\n\nJSBool JSB_glGetProgramInfoLog(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLsizei length;\n    glGetProgramiv(arg0, GL_INFO_LOG_LENGTH, &length);\n    GLchar* src = new GLchar[length];\n    glGetProgramInfoLog(arg0, length, NULL, src);\n    \n    JS_SET_RVAL(cx, vp, charptr_to_jsval(cx, src));\n    CC_SAFE_DELETE_ARRAY(src);\n    return JS_TRUE;\n}\n\n// DOMString? getShaderInfoLog(WebGLShader? shader);\nJSBool JSB_glGetShaderInfoLog(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLsizei length;\n    glGetShaderiv(arg0, GL_INFO_LOG_LENGTH, &length);\n    GLchar* src = new GLchar[length];\n    glGetShaderInfoLog(arg0, length, NULL, src);\n    \n    JS_SET_RVAL(cx, vp, charptr_to_jsval(cx, src));\n    CC_SAFE_DELETE_ARRAY(src);\n    return JS_TRUE;\n}\n\n// DOMString? getShaderSource(WebGLShader? shader);\nJSBool JSB_glGetShaderSource(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLsizei length;\n    glGetShaderiv(arg0, GL_SHADER_SOURCE_LENGTH, &length);\n    GLchar* src = new GLchar[length];\n    glGetShaderSource(arg0, length, NULL, src);\n\n    JS_SET_RVAL(cx, vp, charptr_to_jsval(cx, src));\n    CC_SAFE_DELETE_ARRAY(src);\n    return JS_TRUE;\n}\n\n//  interface WebGLActiveInfo {\n//      readonly attribute GLint size;\n//      readonly attribute GLenum type;\n//      readonly attribute DOMString name;\n// WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index);\nJSBool JSB_glGetActiveAttrib(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0, arg1;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    ok &= jsval_to_uint( cx, *argvp++, &arg1 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLsizei length;\n    glGetProgramiv(arg0, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &length);\n    GLchar* buffer = new GLchar[length];\n    GLint size = -1;\n    GLenum type = -1;\n\n    glGetActiveAttrib(arg0, arg1, length, NULL, &size, &type, buffer);\n\n    jsval retval = JSVAL_VOID;\n\n    JSObject *object = JS_NewObject(cx, NULL, NULL, NULL );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error creating JS Object\");\n\n    if (!JS_DefineProperty(cx, object, \"size\", INT_TO_JSVAL(size), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n        !JS_DefineProperty(cx, object, \"type\", INT_TO_JSVAL(type), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n        !JS_DefineProperty(cx, object, \"name\", charptr_to_jsval(cx, buffer), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) )\n        return JS_FALSE;\n\n    retval = OBJECT_TO_JSVAL(object);\n\n    JS_SET_RVAL(cx, vp, retval);\n    CC_SAFE_DELETE_ARRAY(buffer);\n    return JS_TRUE;\n}\n\n\n//  interface WebGLActiveInfo {\n//      readonly attribute GLint size;\n//      readonly attribute GLenum type;\n//      readonly attribute DOMString name;\n//  };\n// WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index);\nJSBool JSB_glGetActiveUniform(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0, arg1;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    ok &= jsval_to_uint( cx, *argvp++, &arg1 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLsizei length;\n    glGetProgramiv(arg0, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &length);\n    GLchar* buffer = new GLchar[length];\n    GLint size = -1;\n    GLenum type = -1;\n\n    glGetActiveUniform(arg0, arg1, length, NULL, &size, &type, buffer);\n\n    jsval retval = JSVAL_VOID;\n\n\n    JSObject *object = JS_NewObject(cx, NULL, NULL, NULL );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error creating JS Object\");\n\n    if (!JS_DefineProperty(cx, object, \"size\", INT_TO_JSVAL(size), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n        !JS_DefineProperty(cx, object, \"type\", INT_TO_JSVAL(type), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n        !JS_DefineProperty(cx, object, \"name\", charptr_to_jsval(cx, buffer), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) )\n        return JS_FALSE;\n\n    retval = OBJECT_TO_JSVAL(object);\n\n    JS_SET_RVAL(cx, vp, retval);\n    CC_SAFE_DELETE_ARRAY(buffer);\n    return JS_TRUE;\n}\n\n// sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);\nJSBool JSB_glGetAttachedShaders(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    GLsizei length;\n    glGetProgramiv(arg0, GL_ATTACHED_SHADERS, &length);\n    GLuint* buffer = new GLuint[length];\n    memset(buffer, 0, length * sizeof(GLuint));\n    //Fix bug 2448, it seems that glGetAttachedShaders will crash if we send NULL to the third parameter (eg Windows), same as in lua binding\n    GLsizei realShaderCount = 0;\n    glGetAttachedShaders(arg0, length, &realShaderCount, buffer);\n    \n    JSObject *jsobj = JS_NewArrayObject(cx, length, NULL);\n    JSB_PRECONDITION2(jsobj, cx, JS_FALSE, \"Error creating JS Object\");\n\n    for( int i=0; i<length; i++) {\n        jsval e = INT_TO_JSVAL(buffer[i]);\n        JS_SetElement(cx, jsobj, i, &e );\n    }\n\n    JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n    CC_SAFE_DELETE_ARRAY(buffer);\n    return JS_TRUE;\n\n}\n\n// sequence<DOMString>? getSupportedExtensions();\nJSBool JSB_glGetSupportedExtensions(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 0, cx, JS_FALSE, \"Invalid number of arguments\" );\n\n    const GLubyte *extensions = glGetString(GL_EXTENSIONS);\n\n    JSObject *jsobj = JS_NewArrayObject(cx, 0, NULL);\n    JSB_PRECONDITION2(jsobj, cx, JS_FALSE, \"Error creating JS Object\");\n\n    // copy, to be able to add '\\0'\n    size_t len = strlen((char*)extensions);\n    GLubyte* copy = new GLubyte[len+1];\n    strncpy((char*)copy, (const char*)extensions, len );\n\n    int start_extension=0;\n    int element=0;\n    for( int i=0; i<len+1; i++) {\n        if( copy[i]==' ' || copy[i]==',' || i==len ) {\n            copy[i] = 0;\n\n            jsval str = charptr_to_jsval(cx, (const char*)&copy[start_extension]);\n            JS_SetElement(cx, jsobj, element++, &str );\n\n            start_extension = i+1;\n\n            i++;\n        }\n    }\n\n    JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(jsobj));\n    CC_SAFE_DELETE_ARRAY(copy);\n    return JS_TRUE;\n    \n}\n\n// any getTexParameter(GLenum target, GLenum pname);\nJSBool JSB_glGetTexParameterfv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"JSB_glGetTexParameterfv: Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0, arg1;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    ok &= jsval_to_uint( cx, *argvp++, &arg1 );\n\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"JSB_glGetTexParameterfv: Error processing arguments\");\n\n    GLfloat param;\n    glGetTexParameterfv(arg0, arg1, &param);\n\n    JS_SET_RVAL(cx, vp, DOUBLE_TO_JSVAL(param));\n    return JS_TRUE;\n}\n\n// any getUniform(WebGLProgram? program, WebGLUniformLocation? location);\nJSBool JSB_glGetUniformfv(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"JSB_glGetUniformfv: Invalid number of arguments\" );\n    jsval *argvp = JS_ARGV(cx,vp);\n    JSBool ok = JS_TRUE;\n    uint32_t arg0, arg1;\n\n    ok &= jsval_to_uint( cx, *argvp++, &arg0 );\n    ok &= jsval_to_uint( cx, *argvp++, &arg1 );\n\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"JSB_glGetUniformfv: Error processing arguments\");\n\n    GLsizei length;\n    glGetProgramiv(arg0, GL_ACTIVE_UNIFORM_MAX_LENGTH, &length);\n    GLchar* namebuffer = new GLchar[length+1];\n    GLint size = -1;\n    GLenum type = -1;\n\n    glGetActiveUniform(arg0, arg1, length, NULL, &size, &type, namebuffer);\n    CC_SAFE_DELETE_ARRAY(namebuffer);\n\n    int usize = 0;\n    int utype = 0;\n    switch(type) {\n\n        // float\n        case GL_FLOAT:\n            usize = 1;\n            utype = GL_FLOAT;\n            break;\n        case GL_FLOAT_MAT2:\n            usize = 2 * 2;\n            utype = GL_FLOAT;\n            break;\n        case GL_FLOAT_MAT3:\n            usize = 3 * 3;\n            utype = GL_FLOAT;\n            break;\n        case GL_FLOAT_MAT4:\n            usize = 4 * 4;\n            utype = GL_FLOAT;\n            break;\n        case GL_FLOAT_VEC2:\n            usize = 2;\n            utype = GL_FLOAT;\n            break;\n        case GL_FLOAT_VEC3:\n            usize = 3;\n            utype = GL_FLOAT;\n            break;\n        case GL_FLOAT_VEC4:\n            usize = 4;\n            utype = GL_FLOAT;           \n            break;\n\n        // int\n        case GL_INT:\n            usize = 1;\n            utype = GL_INT;\n            break;\n        case GL_INT_VEC2:\n            usize = 1;\n            utype = GL_INT;\n            break;\n        case GL_INT_VEC3:\n            usize = 1;\n            utype = GL_INT;\n            break;\n        case GL_INT_VEC4:\n            usize = 1;\n            utype = GL_INT;\n            break;\n\n        default:\n            JSB_PRECONDITION2(false, cx, JS_FALSE, \"JSB_glGetUniformfv: Uniform Type not supported\");\n    }\n\n    JSObject *typedArray = NULL;\n    if( utype == GL_FLOAT) {\n        // FIXME: glew on windows will cause array overflow after invoking glGetUniformfv.\n        // It seems that glGetUniformfv re-assign the memeroy with a wrong size which is 4x than we pass in.\n        // For temporary solution, we allocate 4x array. \n        GLfloat* param = new GLfloat[usize*4];\n        glGetUniformfv(arg0, arg1, param);\n\n        typedArray = JS_NewFloat32Array(cx, usize);\n        float *buffer = (float*)JS_GetArrayBufferViewData(typedArray);\n        memcpy( buffer, param, sizeof(float) * usize);\n        CC_SAFE_DELETE_ARRAY(param);\n    } else if( utype == GL_INT ) {\n        // FIXME: glew on windows will cause array overflow after invoking glGetUniformfv.\n        // It seems that glGetUniformfv re-assign the memeroy with a wrong size which is 4x than we pass in.\n        // For temporary solution, we allocate 4x array. \n        GLint* param = new GLint[usize*4];\n        glGetUniformiv(arg0, arg1, param);\n\n        typedArray = JS_NewInt32Array(cx, usize);\n        GLint *buffer = (GLint*)JS_GetArrayBufferViewData(typedArray);\n        memcpy( buffer, param, sizeof(GLint) * usize);\n        CC_SAFE_DELETE_ARRAY(param);\n    }\n\n    JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(typedArray));\n    return JS_TRUE;\n}\n\n\n#endif // JSB_INCLUDE_OPENGL\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/jsb_opengl_manual.h",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n#ifndef __jsb_opengl_manual\n#define __jsb_opengl_manual\n\n#include \"js_bindings_config.h\"\n#ifdef JSB_INCLUDE_OPENGL\n\n//#include <Availability.h>\n#include \"jsapi.h\"\n\n#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED\n#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)\n\n// compatible with iOS\n#define glClearDepthf glClearDepth\n#define glDepthRangef glDepthRange\n#define glReleaseShaderCompiler()\n\n#endif // __MAC_OS_X_VERSION_MAX_ALLOWED\n\n// forward declaration of new functions\nJSBool JSB_glGetSupportedExtensions(JSContext *cx, uint32_t argc, jsval *vp);\n\n\n#endif // JSB_INCLUDE_OPENGL\n\n#endif // __jsb_opengl_manual\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/jsb_opengl_registration.cpp",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n#include \"js_bindings_config.h\"\n#include \"js_bindings_core.h\"\n#include \"jsfriendapi.h\"\n#include \"jsb_opengl_manual.h\"\n#include \"js_bindings_opengl.h\"\n\n//#include \"jsb_opengl_functions_registration.h\"\n\n// system\n#include \"jsb_opengl_functions.h\"\n\nvoid JSB_register_opengl(JSContext *_cx, JSObject *object)\n{\n\t//\n\t// gl\n\t//\n\tJSObject *opengl = JS_NewObject(_cx, NULL, NULL, NULL);\n    \n    JS::RootedValue openglVal(_cx);\n\topenglVal = OBJECT_TO_JSVAL(opengl);\n\tJS_SetProperty(_cx, object, \"gl\", openglVal);\n\n    JS::RootedValue nsval(_cx);\n\tJSObject *ccns;\n\tJS_GetProperty(_cx, object, \"cc\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tccns = JS_NewObject(_cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ccns);\n\t\tJS_SetProperty(_cx, object, \"cc\", nsval);\n\t} else {\n\t\tJS_ValueToObject(_cx, nsval, &ccns);\n\t}\n    \n    js_register_cocos2dx_GLNode(_cx, ccns);\n    \n\t// New WebGL functions, not present on OpenGL ES 2.0\n\tJS_DefineFunction(_cx, opengl, \"getSupportedExtensions\", JSB_glGetSupportedExtensions, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"activeTexture\", JSB_glActiveTexture, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_attachShader\", JSB_glAttachShader, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_bindAttribLocation\", JSB_glBindAttribLocation, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_bindBuffer\", JSB_glBindBuffer, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_bindFramebuffer\", JSB_glBindFramebuffer, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_bindRenderbuffer\", JSB_glBindRenderbuffer, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_bindTexture\", JSB_glBindTexture, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"blendColor\", JSB_glBlendColor, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"blendEquation\", JSB_glBlendEquation, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"blendEquationSeparate\", JSB_glBlendEquationSeparate, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"blendFunc\", JSB_glBlendFunc, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"blendFuncSeparate\", JSB_glBlendFuncSeparate, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"bufferData\", JSB_glBufferData, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"bufferSubData\", JSB_glBufferSubData, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"checkFramebufferStatus\", JSB_glCheckFramebufferStatus, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"clear\", JSB_glClear, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"clearColor\", JSB_glClearColor, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"clearDepthf\", JSB_glClearDepthf, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"clearStencil\", JSB_glClearStencil, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"colorMask\", JSB_glColorMask, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_compileShader\", JSB_glCompileShader, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"compressedTexImage2D\", JSB_glCompressedTexImage2D, 8, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"compressedTexSubImage2D\", JSB_glCompressedTexSubImage2D, 9, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"copyTexImage2D\", JSB_glCopyTexImage2D, 8, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"copyTexSubImage2D\", JSB_glCopyTexSubImage2D, 8, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_createProgram\", JSB_glCreateProgram, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_createShader\", JSB_glCreateShader, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"cullFace\", JSB_glCullFace, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_deleteBuffer\", JSB_glDeleteBuffers, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_deleteFramebuffer\", JSB_glDeleteFramebuffers, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_deleteProgram\", JSB_glDeleteProgram, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_deleteRenderbuffer\", JSB_glDeleteRenderbuffers, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_deleteShader\", JSB_glDeleteShader, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_deleteTexture\", JSB_glDeleteTextures, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"depthFunc\", JSB_glDepthFunc, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"depthMask\", JSB_glDepthMask, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"depthRangef\", JSB_glDepthRangef, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"detachShader\", JSB_glDetachShader, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"disable\", JSB_glDisable, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"disableVertexAttribArray\", JSB_glDisableVertexAttribArray, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"drawArrays\", JSB_glDrawArrays, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"drawElements\", JSB_glDrawElements, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"enable\", JSB_glEnable, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"enableVertexAttribArray\", JSB_glEnableVertexAttribArray, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"finish\", JSB_glFinish, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"flush\", JSB_glFlush, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"framebufferRenderbuffer\", JSB_glFramebufferRenderbuffer, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"framebufferTexture2D\", JSB_glFramebufferTexture2D, 5, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"frontFace\", JSB_glFrontFace, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_createBuffer\", JSB_glGenBuffers, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_createFramebuffer\", JSB_glGenFramebuffers, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_createRenderbuffer\", JSB_glGenRenderbuffers, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_createTexture\", JSB_glGenTextures, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"generateMipmap\", JSB_glGenerateMipmap, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getActiveAttrib\", JSB_glGetActiveAttrib, 7, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getActiveUniform\", JSB_glGetActiveUniform, 7, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getAttachedShaders\", JSB_glGetAttachedShaders, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getAttribLocation\", JSB_glGetAttribLocation, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"getError\", JSB_glGetError, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getProgramInfoLog\", JSB_glGetProgramInfoLog, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getProgramParameter\", JSB_glGetProgramiv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getShaderInfoLog\", JSB_glGetShaderInfoLog, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getShaderSource\", JSB_glGetShaderSource, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getShaderParameter\", JSB_glGetShaderiv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"getTexParameter\", JSB_glGetTexParameterfv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getUniformLocation\", JSB_glGetUniformLocation, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_getUniform\", JSB_glGetUniformfv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"hint\", JSB_glHint, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"isBuffer\", JSB_glIsBuffer, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"isEnabled\", JSB_glIsEnabled, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"isFramebuffer\", JSB_glIsFramebuffer, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"isProgram\", JSB_glIsProgram, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"isRenderbuffer\", JSB_glIsRenderbuffer, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"isShader\", JSB_glIsShader, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"isTexture\", JSB_glIsTexture, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"lineWidth\", JSB_glLineWidth, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_linkProgram\", JSB_glLinkProgram, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"pixelStorei\", JSB_glPixelStorei, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"polygonOffset\", JSB_glPolygonOffset, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"readPixels\", JSB_glReadPixels, 7, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"releaseShaderCompiler\", JSB_glReleaseShaderCompiler, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"renderbufferStorage\", JSB_glRenderbufferStorage, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"sampleCoverage\", JSB_glSampleCoverage, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"scissor\", JSB_glScissor, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_shaderSource\", JSB_glShaderSource, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"stencilFunc\", JSB_glStencilFunc, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"stencilFuncSeparate\", JSB_glStencilFuncSeparate, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"stencilMask\", JSB_glStencilMask, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"stencilMaskSeparate\", JSB_glStencilMaskSeparate, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"stencilOp\", JSB_glStencilOp, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"stencilOpSeparate\", JSB_glStencilOpSeparate, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_texImage2D\", JSB_glTexImage2D, 9, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"texParameterf\", JSB_glTexParameterf, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"texParameteri\", JSB_glTexParameteri, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_texSubImage2D\", JSB_glTexSubImage2D, 9, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform1f\", JSB_glUniform1f, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform1fv\", JSB_glUniform1fv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform1i\", JSB_glUniform1i, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform1iv\", JSB_glUniform1iv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform2f\", JSB_glUniform2f, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform2fv\", JSB_glUniform2fv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform2i\", JSB_glUniform2i, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform2iv\", JSB_glUniform2iv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform3f\", JSB_glUniform3f, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform3fv\", JSB_glUniform3fv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform3i\", JSB_glUniform3i, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform3iv\", JSB_glUniform3iv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform4f\", JSB_glUniform4f, 5, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform4fv\", JSB_glUniform4fv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform4i\", JSB_glUniform4i, 5, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniform4iv\", JSB_glUniform4iv, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniformMatrix2fv\", JSB_glUniformMatrix2fv, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniformMatrix3fv\", JSB_glUniformMatrix3fv, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"uniformMatrix4fv\", JSB_glUniformMatrix4fv, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_useProgram\", JSB_glUseProgram, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"_validateProgram\", JSB_glValidateProgram, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib1f\", JSB_glVertexAttrib1f, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib1fv\", JSB_glVertexAttrib1fv, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib2f\", JSB_glVertexAttrib2f, 3, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib2fv\", JSB_glVertexAttrib2fv, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib3f\", JSB_glVertexAttrib3f, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib3fv\", JSB_glVertexAttrib3fv, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib4f\", JSB_glVertexAttrib4f, 5, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttrib4fv\", JSB_glVertexAttrib4fv, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"vertexAttribPointer\", JSB_glVertexAttribPointer, 6, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(_cx, opengl, \"viewport\", JSB_glViewport, 4, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    \n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/jsb_opengl_registration.h",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n#ifndef __JSB_OPENGL_REGISTRATION\n#define __JSB_OPENGL_REGISTRATION\n#include \"jsb_opengl_functions.h\"\n\nvoid JSB_register_opengl( JSContext *globalC, JSObject *globalO);\n\n#endif // __JSB_OPENGL_REGISTRATION\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_localstorage_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsblocalstorage\n\nLOCAL_SRC_FILES := js_bindings_system_functions.cpp \\\n                   js_bindings_system_registration.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../../../extensions\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_localstorage_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,storage/local-storage)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/js_bindings_system_functions.cpp",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c system_jsb.ini\" on 2012-12-17\n* Script version: v0.5\n*/\n#include \"cocos2d.h\"\n#include \"js_bindings_config.h\"\n//#ifdef JSB_INCLUDE_SYSTEM\n\n#include \"local-storage/LocalStorage.h\"\n\n#include \"jsfriendapi.h\"\n#include \"js_bindings_config.h\"\n#include \"js_bindings_core.h\"\n#include \"js_manual_conversions.h\"\n#include \"js_bindings_system_functions.h\"\n#include \"ScriptingCore.h\"\n\nUSING_NS_CC;\n\n// Arguments: char*\n// Ret value: const char*\nJSBool JSB_localStorageGetItem(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tstd::string arg0; \n\n\tok &= jsval_to_std_string( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\tstd::string ret_val;\n\n\tret_val = localStorageGetItem(arg0);\n\n\tjsval ret_jsval = std_string_to_jsval(cx, ret_val);\n\tJS_SET_RVAL(cx, vp, ret_jsval );\n\n\treturn JS_TRUE;\n}\n\n// Arguments: char*\n// Ret value: void\nJSBool JSB_localStorageRemoveItem(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 1, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tstd::string arg0; \n\n\tok &= jsval_to_std_string( cx, *argvp++, &arg0 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tlocalStorageRemoveItem(arg0);\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n// Arguments: char*, char*\n// Ret value: void\nJSBool JSB_localStorageSetItem(JSContext *cx, uint32_t argc, jsval *vp) {\n\tJSB_PRECONDITION2( argc == 2, cx, JS_FALSE, \"Invalid number of arguments\" );\n\tjsval *argvp = JS_ARGV(cx,vp);\n\tJSBool ok = JS_TRUE;\n\tstd::string arg0; std::string arg1; \n\n\tok &= jsval_to_std_string( cx, *argvp++, &arg0 );\n\tok &= jsval_to_std_string( cx, *argvp++, &arg1 );\n\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n\tlocalStorageSetItem(arg0 , arg1);\n\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\treturn JS_TRUE;\n}\n\n\n//#endif // JSB_INCLUDE_SYSTEM\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/js_bindings_system_functions.h",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c system_jsb.ini\" on 2012-12-17\n* Script version: v0.5\n*/\n#include \"js_bindings_config.h\"\n//#ifdef JSB_INCLUDE_SYSTEM\n\n//#include \"LocalStorage.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nJSBool JSB_localStorageGetItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_localStorageRemoveItem(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool JSB_localStorageSetItem(JSContext *cx, uint32_t argc, jsval *vp);\n\n#ifdef __cplusplus\n}\n#endif\n\n\n//#endif // JSB_INCLUDE_SYSTEM\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/js_bindings_system_functions_registration.h",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_js_bindings.py -c system_jsb.ini\" on 2012-12-17\n* Script version: v0.5\n*/\n#include \"../js_bindings_config.h\"\n//#ifdef JSB_INCLUDE_SYSTEM\n\n//#include \"LocalStorage.h\"\nJS_DefineFunction(_cx, system, \"getItem\", JSB_localStorageGetItem, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(_cx, system, \"removeItem\", JSB_localStorageRemoveItem, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\nJS_DefineFunction(_cx, system, \"setItem\", JSB_localStorageSetItem, 2, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\n\n//#endif // JSB_INCLUDE_SYSTEM\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/js_bindings_system_registration.cpp",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n#include \"js_bindings_config.h\"\n#include \"js_bindings_core.h\"\n#include \"local-storage/LocalStorage.h\"\n#include \"cocos2d.h\"\n\n// system\n#include \"js_bindings_system_functions.h\"\n\n\nvoid jsb_register_system( JSContext *_cx, JSObject *object)\n{\n\t//\n\t// sys\n\t//\n\tJSObject *sys = JS_NewObject(_cx, NULL, NULL, NULL);\n    JS::RootedValue systemVal(_cx);\n    systemVal = OBJECT_TO_JSVAL(sys);\n\tJS_SetProperty(_cx, object, \"sys\", systemVal);\n\n\n\t// sys.localStorage\n\tJSObject *ls = JS_NewObject(_cx, NULL, NULL, NULL);\n\tJS::RootedValue lsVal(_cx);\n    lsVal = OBJECT_TO_JSVAL(ls);\n\tJS_SetProperty(_cx, sys, \"localStorage\", lsVal);\n\n\t// sys.localStorage functions\n\tJSObject *system = ls;\n#include \"js_bindings_system_functions_registration.h\"\n\t\n\t\n\t// Init DB with full path\n\t//NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];\n\t//NSString *fullpath = [path stringByAppendingPathComponent:@\"jsb.sqlite\"];\n    std::string strFilePath = cocos2d::FileUtils::getInstance()->getWritablePath();\n    strFilePath += \"/jsb.sqlite\";\n\tlocalStorageInit(strFilePath.c_str());\n\t\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/js_bindings_system_registration.h",
    "content": "/*\n * JS Bindings: https://github.com/zynga/jsbindings\n *\n * Copyright (c) 2012 Zynga Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n#ifndef __JSB_SYSTEM_REGISTRATION\n#define __JSB_SYSTEM_REGISTRATION\n\nvoid jsb_register_system( JSContext *globalC, JSObject *globalO);\n\n#endif // __JSB_CHIPMUNK_REGISTRATION\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/libJSBindingForLocalStorage.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"js_bindings_system_functions.cpp\" />\n    <ClCompile Include=\"js_bindings_system_registration.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"js_bindings_system_functions.h\" />\n    <ClInclude Include=\"js_bindings_system_functions_registration.h\" />\n    <ClInclude Include=\"js_bindings_system_registration.h\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{68F5F371-BD7B-4C30-AE5B-0B08F22E0CDE}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForLocalStorage</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\storage;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)external\\spidermonkey\\include\\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\storage;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)external\\spidermonkey\\include\\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/localstorage/libJSBindingForLocalStorage.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"js_bindings_system_functions.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"js_bindings_system_registration.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"js_bindings_system_functions.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_system_functions_registration.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"js_bindings_system_registration.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/network/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_network_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsbnetwork\n\nLOCAL_SRC_FILES := XMLHTTPRequest.cpp \\\n                   jsb_websocket.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static\nLOCAL_WHOLE_STATIC_LIBRARIES += websockets_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,network)\n$(call import-module,websockets/prebuilt/android)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp",
    "content": "//\n//  XMLHTTPRequest.cpp\n//  XMLHttpRequest\n//\n//  Created by Zynga 2013\n//\n//  Heavy based on: https://github.com/funkaster/FakeWebGL/blob/master/FakeWebGL/WebGL/XMLHTTPRequest.cpp\n//  Copyright (c) 2012 Rolando Abarca. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#include \"XMLHTTPRequest.h\"\n#include <string>\n\nusing namespace std;\n\n//#pragma mark - MinXmlHttpRequest\n\n/**\n *  @brief Implementation for header retrieving.\n *  @param header \n */\nvoid MinXmlHttpRequest::_gotHeader(string header)\n{\n\t// Get Header and Set StatusText\n    // Split String into Tokens\n    char * cstr = new char [header.length()+1];\n    \n    // check for colon.\n    unsigned found_header_field = header.find_first_of(\":\");\n    \n    if (found_header_field != std::string::npos)\n    {\n        // Found a header field.\n        string http_field;\n        string http_value;\n        \n        http_field = header.substr(0,found_header_field);\n        http_value = header.substr(found_header_field+1, header.length());\n        \n        // Get rid of all \\n\n        if (!http_value.empty() && http_value[http_value.size() - 1] == '\\n') {\n        \thttp_value.erase(http_value.size() - 1);\n        }\n        \n        _httpHeader[http_field] = http_value;\n        \n    }\n    else\n    {\n        // Seems like we have the response Code! Parse it and check for it.\n        char * pch;\n        strcpy(cstr, header.c_str());\n        \n        pch = strtok(cstr,\" \");\n        while (pch != NULL)\n        {\n            \n            stringstream ss;\n            string val;\n            \n            ss << pch;\n            val = ss.str();\n            unsigned found_http = val.find(\"HTTP\");\n            \n            // Check for HTTP Header to set statusText\n            if (found_http != std::string::npos) {\n                \n                stringstream mystream;\n                \n                // Get Response Status\n                pch = strtok (NULL, \" \");\n                mystream << pch;\n\n                pch = strtok (NULL, \" \");\n                mystream << \" \" << pch;\n                \n                _statusText = mystream.str();\n                \n            }\n            \n            pch = strtok (NULL, \" \");\n        }\n    }\n    \n    CC_SAFE_DELETE_ARRAY(cstr);\n}\n\n/**\n *  @brief Set Request header for next call.\n *  @param field  Name of the Header to be set.\n *  @param value  Value of the Headerfield\n */\nvoid MinXmlHttpRequest::_setRequestHeader(const char* field, const char* value)\n{\n    stringstream header_s;\n    stringstream value_s;\n    string header;\n    \n    auto iter = _requestHeader.find(field);\n    \n    // Concatenate values when header exists.\n    if (iter != _requestHeader.end())\n    {\n        value_s << iter->second << \",\" << value;\n    }\n    else\n    {\n        value_s << value;\n    }\n    \n    _requestHeader[field] = value_s.str();\n}\n\n/**\n * @brief  If headers has been set, pass them to curl.\n * \n */\nvoid MinXmlHttpRequest::_setHttpRequestHeader()\n{\n    std::vector<string> header;\n\n    for (auto it = _requestHeader.begin(); it != _requestHeader.end(); ++it)\n    {\n        const char* first = it->first.c_str();\n        const char* second = it->second.c_str();\n        size_t len = sizeof(char) * (strlen(first) + 3 + strlen(second));\n        char* test = (char*) malloc(len);\n        memset(test, 0,len);\n        \n        strcpy(test, first);\n        strcpy(test + strlen(first) , \": \");\n        strcpy(test + strlen(first) + 2, second);\n\n        header.push_back(test);\n        \n        free(test);\n        \n    }\n    \n    if (!header.empty())\n    {\n        _httpRequest->setHeaders(header);\n    }\n    \n}\n\n/**\n *  @brief Callback for HTTPRequest. Handles the response and invokes Callback.\n *  @param sender   Object which initialized callback\n *  @param respone  Response object\n */\nvoid MinXmlHttpRequest::handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response)\n{\n    if (0 != strlen(response->getHttpRequest()->getTag()))\n    {\n        CCLOG(\"%s completed\", response->getHttpRequest()->getTag());\n    }\n    \n    long statusCode = response->getResponseCode();\n    char statusString[64] = {0};\n    sprintf(statusString, \"HTTP Status Code: %ld, tag = %s\", statusCode, response->getHttpRequest()->getTag());\n    \n    if (!response->isSucceed())\n    {\n        CCLOG(\"Response failed, error buffer: %s\", response->getErrorBuffer());\n    }\n    \n    // set header\n    std::vector<char> *headers = response->getResponseHeader();\n    \n    char* concatHeader = (char*) malloc(headers->size() + 1);\n    std::string header(headers->begin(), headers->end());\n    strcpy(concatHeader, header.c_str());\n    \n    std::istringstream stream(concatHeader);\n    std::string line;\n    while(std::getline(stream, line)) {\n        _gotHeader(line);\n    }\n    \n    /** get the response data **/\n    std::vector<char> *buffer = response->getResponseData();\n    \n    if (statusCode == 200)\n    {\n        //Succeeded\n        _status = 200;\n        _readyState = DONE;\n        \n        _dataSize = static_cast<uint32_t>(buffer->size());\n        CC_SAFE_FREE(_data);\n        _data = (char*) malloc(_dataSize + 1);\n        _data[_dataSize] = '\\0';\n        memcpy((void*)_data, (const void*)buffer->data(), _dataSize);\n    }\n    else\n    {\n        _status = 0;\n    }\n    // Free Memory.\n    free((void*) concatHeader);\n    \n    js_proxy_t * p;\n    void* ptr = (void*)this;\n    p = jsb_get_native_proxy(ptr);\n    \n    if(p)\n    {\n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n       \n        if (_onreadystateCallback)\n        {\n            JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n            //JS_IsExceptionPending(cx) && JS_ReportPendingException(cx);\n            jsval fval = OBJECT_TO_JSVAL(_onreadystateCallback);\n            jsval out;\n            JS_CallFunctionValue(cx, NULL, fval, 0, NULL, &out);\n        }\n     \n    }\n\n}\n/**\n * @brief   Send out request and fire callback when done.\n * @param cx    Javascript context\n */\nvoid MinXmlHttpRequest::_sendRequest(JSContext *cx)\n{\n    _httpRequest->setResponseCallback(this, httpresponse_selector(MinXmlHttpRequest::handle_requestResponse));\n    cocos2d::network::HttpClient::getInstance()->send(_httpRequest);\n    _httpRequest->release();\n}\n\n/**\n * @brief  Constructor initializes cchttprequest and stuff\n *\n */\nMinXmlHttpRequest::MinXmlHttpRequest()\n: _onreadystateCallback(nullptr)\n, _isNetwork(true)\n, _data(nullptr)\n{\n    _httpHeader.clear();\n    _requestHeader.clear();\n    _withCredentialsValue = true;\n    _cx = ScriptingCore::getInstance()->getGlobalContext();\n    _httpRequest = new cocos2d::network::HttpRequest();\n}\n\n/**\n * @brief Destructor cleans up _httpRequest and stuff\n *\n */\nMinXmlHttpRequest::~MinXmlHttpRequest()\n{\n    _httpHeader.clear();\n    _requestHeader.clear();\n\n    if (_onreadystateCallback != NULL)\n    {\n        JS_RemoveObjectRoot(_cx, &_onreadystateCallback);\n    }\n    \n    if (_httpRequest)\n    {\n        // We don't need to release _httpRequest here since it will be released in the http callback.\n//        _httpRequest->release();\n    }\n\n    CC_SAFE_FREE(_data);\n}\n\n/**\n *  @brief Initialize Object and needed properties.\n *\n */\nJS_BINDED_CLASS_GLUE_IMPL(MinXmlHttpRequest);\n\n/**\n *  @brief Implementation for the Javascript Constructor\n *\n */\nJS_BINDED_CONSTRUCTOR_IMPL(MinXmlHttpRequest)\n{\n    MinXmlHttpRequest* req = new MinXmlHttpRequest();\n    req->autorelease();\n    \n    js_proxy_t *p;\n    jsval out;\n    \n    JSObject *obj = JS_NewObject(cx, &MinXmlHttpRequest::js_class, MinXmlHttpRequest::js_proto, MinXmlHttpRequest::js_parent);\n    \n    if (obj) {\n        JS_SetPrivate(obj, req);\n        out = OBJECT_TO_JSVAL(obj);\n    }\n\n    JS_SET_RVAL(cx, vp, out);\n    p =jsb_new_proxy(req, obj);\n    \n    JS_AddNamedObjectRoot(cx, &p->obj, \"XMLHttpRequest\");\n    return JS_TRUE;\n}\n\n/**\n *  @brief  get Callback function for Javascript\n * \n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, onreadystatechange)\n{\n    if (_onreadystateCallback)\n    {\n        JSString *tmpstr = JS_NewStringCopyZ(cx, \"1\");\n        JS::RootedValue tmpval(cx);\n        tmpval = STRING_TO_JSVAL(tmpstr);\n        JS_SetProperty(cx, _onreadystateCallback, \"readyState\", tmpval);\n        \n        jsval out = OBJECT_TO_JSVAL(_onreadystateCallback);\n        vp.set(out);\n        \n    }\n    else\n    {\n        vp.set(JSVAL_NULL);\n    }\n    return JS_TRUE;\n}\n\n/**\n *  @brief Set Callback function coming from Javascript\n *\n *\n */\nJS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, onreadystatechange)\n{\n    jsval callback = vp.get();\n    if (callback != JSVAL_NULL)\n    {\n        _onreadystateCallback = JSVAL_TO_OBJECT(callback);\n        JS_AddNamedObjectRoot(cx, &_onreadystateCallback, \"onreadystateCallback\");\n    }\n    return JS_TRUE;\n}\n\n/**\n *  @brief upload getter - TODO\n *\n *  Placeholder for further implementations!!\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, upload)\n{\n    vp.set(JSVAL_NULL);\n    return JS_TRUE;\n}\n\n/**\n *  @brief upload setter - TODO\n *\n *  Placeholder for further implementations\n */\nJS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, upload)\n{\n    vp.set(JSVAL_NULL);\n    return JS_TRUE;\n}\n\n/**\n *  @brief timeout getter - TODO\n *\n *  Placeholder for further implementations\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, timeout)\n{\n    vp.set(INT_TO_JSVAL(_timeout));\n    return JS_TRUE;\n}\n\n/**\n *  @brief timeout setter - TODO\n *\n *  Placeholder for further implementations\n */\nJS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, timeout)\n{\n    jsval timeout_ms = vp.get();\n    \n    _timeout = JSVAL_TO_INT(timeout_ms);\n    //curl_easy_setopt(curlHandle, CURLOPT_CONNECTTIMEOUT_MS, timeout);\n    return JS_TRUE;\n    \n}\n\n/**\n *  @brief  get response type for actual XHR\n *\n *\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseType)\n{\n    JSString* str = JS_NewStringCopyN(cx, \"\", 0);\n    vp.set(STRING_TO_JSVAL(str));\n    return JS_TRUE;\n}\n\n/**\n *  @brief  responseXML getter - TODO\n *\n *  Placeholder for further implementation.\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseXML)\n{\n    vp.set(JSVAL_NULL);\n    return JS_TRUE;\n}\n\n/**\n *  @brief  set response type for actual XHR\n *\n *\n */\nJS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, responseType)\n{\n    jsval type = vp.get();\n    if (type.isString()) {\n        JSString* str = type.toString();\n        JSBool equal;\n        \n        JS_StringEqualsAscii(cx, str, \"text\", &equal);\n        if (equal)\n        {\n            _responseType = ResponseType::STRING;\n            return JS_TRUE;\n        }\n        \n        JS_StringEqualsAscii(cx, str, \"arraybuffer\", &equal);\n        if (equal)\n        {\n            _responseType = ResponseType::ARRAY_BUFFER;\n            return JS_TRUE;\n        }\n        \n        JS_StringEqualsAscii(cx, str, \"json\", &equal);\n        if (equal)\n        {\n            _responseType = ResponseType::JSON;\n            return JS_TRUE;\n        }\n        // ignore the rest of the response types for now\n        return JS_TRUE;\n    }\n    JS_ReportError(cx, \"Invalid response type\");\n    return JS_FALSE;\n}\n\n/**\n * @brief get readyState for actual XHR\n *\n *\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, readyState)\n{\n    vp.set(INT_TO_JSVAL(_readyState));\n    return JS_TRUE;\n}\n\n/**\n *  @brief get status for actual XHR\n *\n *\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, status)\n{\n    vp.set(INT_TO_JSVAL(_status));\n    return JS_TRUE;\n}\n\n/**\n *  @brief get statusText for actual XHR\n *\n *\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, statusText)\n{\n    jsval strVal = std_string_to_jsval(cx, _statusText);\n    \n    if (strVal != JSVAL_NULL)\n    {\n        vp.set(strVal);\n        return JS_TRUE;\n    }\n    else\n    {\n        JS_ReportError(cx, \"Error trying to create JSString from data\");\n        return JS_FALSE;\n    }\n}\n\n/**\n *  @brief  get value of withCredentials property.\n *\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, withCredentials)\n{\n    vp.set(BOOLEAN_TO_JSVAL(_withCredentialsValue));\n    return JS_TRUE;\n}\n\n/**\n *  withCredentials - set value of withCredentials property.\n *\n */\nJS_BINDED_PROP_SET_IMPL(MinXmlHttpRequest, withCredentials)\n{\n    jsval credential = vp.get();\n    if (credential != JSVAL_NULL)\n    {\n        _withCredentialsValue = JSVAL_TO_BOOLEAN(credential);\n    }\n    \n    return JS_TRUE;\n}\n\n/**\n *  @brief  get (raw) responseText\n *\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseText)\n{\n    if (_data)\n    {\n        jsval strVal = std_string_to_jsval(cx, _data);\n\n        if (strVal != JSVAL_NULL)\n        {\n            vp.set(strVal);\n            return JS_TRUE;\n        }\n    }\n\n    CCLOGERROR(\"ResponseText was empty, probably there is a network error!\");\n    \n    // Return an empty string\n    vp.set(std_string_to_jsval(cx, \"\"));\n\n    return JS_TRUE;\n}\n\n/**\n *  @brief get response of latest XHR\n *\n */\nJS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, response)\n{\n    \n    if (_responseType == ResponseType::JSON)\n    {\n        JS::RootedValue outVal(cx);\n        \n        jsval strVal = std_string_to_jsval(cx, _data);\n        if (JS_ParseJSON(cx, JS_GetStringCharsZ(cx, JSVAL_TO_STRING(strVal)), _dataSize, &outVal))\n        {\n            vp.set(outVal);\n            return JS_TRUE;\n        }\n    }\n    else if (_responseType == ResponseType::ARRAY_BUFFER)\n    {\n        JSObject* tmp = JS_NewArrayBuffer(cx, _dataSize);\n        uint8_t* tmpData = JS_GetArrayBufferData(tmp);\n        memcpy((void*)tmpData, (const void*)_data, _dataSize);\n        jsval outVal = OBJECT_TO_JSVAL(tmp);\n\n        vp.set(outVal);\n        return JS_TRUE;\n    }\n    // by default, return text\n    return _js_get_responseText(cx, id, vp);\n}\n\n/**\n *  @brief initialize new xhr.\n *\n */\nJS_BINDED_FUNC_IMPL(MinXmlHttpRequest, open)\n{\n    if (argc >= 2)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        const char* method;\n        const char* urlstr;\n        JSBool async = true;\n        JSString* jsMethod = JS_ValueToString(cx, argv[0]);\n        JSString* jsURL = JS_ValueToString(cx, argv[1]);\n        \n        if (argc > 2) {\n            JS_ValueToBoolean(cx, argv[2], &async);\n        }\n        \n        JSStringWrapper w1(jsMethod);\n        JSStringWrapper w2(jsURL);\n        method = w1.get();\n        urlstr = w2.get();\n        \n        _url = urlstr;\n        _meth = method;\n        _readyState = 1;\n        _isAsync = async;\n        \n        if (_url.length() > 5 && _url.compare(_url.length() - 5, 5, \".json\") == 0)\n        {\n            _responseType = ResponseType::JSON;\n        }\n\n        if (_meth.compare(\"post\") == 0 || _meth.compare(\"POST\") == 0)\n        {\n            _httpRequest->setRequestType(cocos2d::network::HttpRequest::Type::POST);\n        }\n        else\n        {\n            _httpRequest->setRequestType(cocos2d::network::HttpRequest::Type::GET);\n        }\n        \n        _httpRequest->setUrl(_url.c_str());\n        \n        _isNetwork = true;\n        _readyState = OPENED;\n        \n        return JS_TRUE;\n    }\n    \n    JS_ReportError(cx, \"invalid call: %s\", __FUNCTION__);\n    return JS_FALSE;\n    \n}\n\n/**\n *  @brief  send xhr\n *\n */\nJS_BINDED_FUNC_IMPL(MinXmlHttpRequest, send)\n{\n    JSString *str = NULL;\n    std::string data;\n    \n    // Clean up header map. New request, new headers!\n    _httpHeader.clear();\n    \n    if (argc == 1)\n    {\n        if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"S\", &str))\n        {\n            return JS_FALSE;\n        }\n        JSStringWrapper strWrap(str);\n        data = strWrap.get();\n    }\n\n\n    if (data.length() > 0 && (_meth.compare(\"post\") == 0 || _meth.compare(\"POST\") == 0))\n    {\n        _httpRequest->setRequestData(data.c_str(), data.length());\n    }\n\n    _setHttpRequestHeader();\n    _sendRequest(cx);\n\n    return JS_TRUE;\n}\n\n/**\n *  @brief abort function Placeholder!\n *\n */\nJS_BINDED_FUNC_IMPL(MinXmlHttpRequest, abort)\n{\n    return JS_TRUE;\n}\n\n/**\n *  @brief Get all response headers as a string\n *\n */\nJS_BINDED_FUNC_IMPL(MinXmlHttpRequest, getAllResponseHeaders)\n{\n    stringstream responseheaders;\n    string responseheader;\n    \n    for (auto it = _httpHeader.begin(); it != _httpHeader.end(); ++it)\n    {\n        responseheaders << it->first << \": \" << it->second << \"\\n\";\n    }\n    \n    responseheader = responseheaders.str();\n    \n    jsval strVal = std_string_to_jsval(cx, responseheader);\n    if (strVal != JSVAL_NULL)\n    {\n        JS_SET_RVAL(cx, vp, strVal);\n        return JS_TRUE;\n    }\n    else\n    {\n        JS_ReportError(cx, \"Error trying to create JSString from data\");\n        return JS_FALSE;\n    }\n    \n    return JS_TRUE;\n}\n\n/**\n *  @brief Get all response headers as a string\n *\n */\nJS_BINDED_FUNC_IMPL(MinXmlHttpRequest, getResponseHeader)\n{\n    JSString *header_value;\n    \n    if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"S\", &header_value)) {\n        return JS_FALSE;\n    };\n    \n    std::string data;\n    JSStringWrapper strWrap(header_value);\n    data = strWrap.get();\n    \n    stringstream streamdata;\n    \n    streamdata << data;\n\n    string value = streamdata.str();\n    \n    auto iter = _httpHeader.find(value);\n    if (iter != _httpHeader.end())\n    {\n        jsval js_ret_val =  std_string_to_jsval(cx, iter->second);\n        JS_SET_RVAL(cx, vp, js_ret_val);\n        return JS_TRUE;\n    }\n    else {\n        JS_SET_RVAL(cx, vp, JSVAL_NULL);\n        return JS_TRUE;\n    }\n}\n\n/**\n *  @brief Set the given Fields to request Header.\n *\n *\n */\nJS_BINDED_FUNC_IMPL(MinXmlHttpRequest, setRequestHeader)\n{\n    if (argc >= 2)\n    {\n        jsval* argv = JS_ARGV(cx, vp);\n        const char* field;\n        const char* value;\n        \n        JSString* jsField = JS_ValueToString(cx, argv[0]);\n        JSString* jsValue = JS_ValueToString(cx, argv[1]);\n        \n        JSStringWrapper w1(jsField);\n        JSStringWrapper w2(jsValue);\n        field = w1.get();\n        value = w2.get();\n        \n        // Populate the request_header map.\n        _setRequestHeader(field, value);\n        \n        return JS_TRUE;\n    }\n     \n    return JS_FALSE;\n    \n}\n\n/**\n * @brief overrideMimeType function - TODO!\n *\n * Just a placeholder for further implementations.\n */\nJS_BINDED_FUNC_IMPL(MinXmlHttpRequest, overrideMimeType)\n{\n    return JS_TRUE;\n}\n\n/**\n *  @brief destructor for Javascript\n *\n */\nstatic void basic_object_finalize(JSFreeOp *freeOp, JSObject *obj)\n{\n    CCLOG(\"basic_object_finalize %p ...\", obj);\n}\n\n/**\n *  @brief Register XMLHttpRequest to be usable in JS and add properties and Mehtods.\n *  @param cx   Global Spidermonkey JS Context.\n *  @param global   Global Spidermonkey Javascript object.\n */\nvoid MinXmlHttpRequest::_js_register(JSContext *cx, JSObject *global)\n{\n    JSClass js_class = {\n        \"XMLHttpRequest\", JSCLASS_HAS_PRIVATE, JS_PropertyStub,\n        JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,\n        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub,\n        basic_object_finalize, JSCLASS_NO_OPTIONAL_MEMBERS\n    };\n    \n    MinXmlHttpRequest::js_class = js_class;\n    static JSPropertySpec props[] = {\n        JS_BINDED_PROP_DEF_ACCESSOR(MinXmlHttpRequest, onreadystatechange),\n        JS_BINDED_PROP_DEF_ACCESSOR(MinXmlHttpRequest, responseType),\n        JS_BINDED_PROP_DEF_ACCESSOR(MinXmlHttpRequest, withCredentials),\n        JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, readyState),\n        JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, status),\n        JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, statusText),\n        JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, responseText),\n        JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, responseXML),\n        JS_BINDED_PROP_DEF_GETTER(MinXmlHttpRequest, response),\n        {0, 0, 0, 0, 0}\n    };\n    \n    static JSFunctionSpec funcs[] = {\n        JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, open),\n        JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, abort),\n        JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, send),\n        JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, setRequestHeader),\n        JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getAllResponseHeaders),\n        JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, getResponseHeader),\n        JS_BINDED_FUNC_FOR_DEF(MinXmlHttpRequest, overrideMimeType),\n        JS_FS_END\n    };\n    \n    MinXmlHttpRequest::js_parent = NULL;\n    MinXmlHttpRequest::js_proto = JS_InitClass(cx, global, NULL, &MinXmlHttpRequest::js_class , MinXmlHttpRequest::_js_constructor, 0, props, funcs, NULL, NULL);\n    \n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h",
    "content": "//\n//  XMLHTTPRequest.h\n//  XMLHttpRequest\n//\n//  Created by Zynga 2013\n//\n//  Heavy based on: https://github.com/funkaster/FakeWebGL/blob/master/FakeWebGL/WebGL/XMLHTTPRequest.h\n//  Copyright (c) 2012 Rolando Abarca. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#ifndef __FAKE_XMLHTTPREQUEST_H__\n#define __FAKE_XMLHTTPREQUEST_H__\n\n#include \"network/HttpClient.h\"\n#include \"js_bindings_config.h\"\n#include \"ScriptingCore.h\"\n#include \"jstypes.h\"\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n#include \"jsb_helper.h\"\n\nclass MinXmlHttpRequest : public cocos2d::Object\n{\npublic:\n    enum class ResponseType\n    {\n        STRING,\n        ARRAY_BUFFER,\n        BLOB,\n        DOCUMENT,\n        JSON\n    };\n\n    // Ready States (http://www.w3.org/TR/XMLHttpRequest/#interface-xmlhttprequest)\n    static const unsigned short UNSENT = 0;\n    static const unsigned short OPENED = 1;\n    static const unsigned short HEADERS_RECEIVED = 2;\n    static const unsigned short LOADING = 3;\n    static const unsigned short DONE = 4;\n\n    MinXmlHttpRequest();\n    ~MinXmlHttpRequest();\n    \n    JS_BINDED_CLASS_GLUE(MinXmlHttpRequest);\n    JS_BINDED_CONSTRUCTOR(MinXmlHttpRequest);\n    JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, onreadystatechange);\n    JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, responseType);\n    JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, withCredentials);\n    JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, upload);\n    JS_BINDED_PROP_ACCESSOR(MinXmlHttpRequest, timeout);\n    JS_BINDED_PROP_GET(MinXmlHttpRequest, readyState);\n    JS_BINDED_PROP_GET(MinXmlHttpRequest, status);\n    JS_BINDED_PROP_GET(MinXmlHttpRequest, statusText);\n    JS_BINDED_PROP_GET(MinXmlHttpRequest, responseText);\n    JS_BINDED_PROP_GET(MinXmlHttpRequest, response);\n    JS_BINDED_PROP_GET(MinXmlHttpRequest, responseXML);\n    JS_BINDED_FUNC(MinXmlHttpRequest, open);\n    JS_BINDED_FUNC(MinXmlHttpRequest, send);\n    JS_BINDED_FUNC(MinXmlHttpRequest, abort);\n    JS_BINDED_FUNC(MinXmlHttpRequest, getAllResponseHeaders);\n    JS_BINDED_FUNC(MinXmlHttpRequest, getResponseHeader);\n    JS_BINDED_FUNC(MinXmlHttpRequest, setRequestHeader);\n    JS_BINDED_FUNC(MinXmlHttpRequest, overrideMimeType);\n\n    void handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);\n\n\nprivate:\n    void _gotHeader(std::string header);\n    void _setRequestHeader(const char* field, const char* value);\n    void _setHttpRequestHeader();\n    void _sendRequest(JSContext *cx);\n    \n    std::string                       _url;\n    JSContext*                        _cx;\n    std::string                       _meth;\n    std::string                       _type;\n    char*                             _data;\n    uint32_t                          _dataSize;\n    JSObject*                         _onreadystateCallback;\n    int                               _readyState;\n    int                               _status;\n    std::string                       _statusText;\n    ResponseType                      _responseType;\n    unsigned                          _timeout;\n    bool                              _isAsync;\n    cocos2d::network::HttpRequest*    _httpRequest;\n    bool                              _isNetwork;\n    bool                              _withCredentialsValue;\n    std::unordered_map<std::string, std::string>          _httpHeader;\n    std::unordered_map<std::string, std::string>          _requestHeader;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/network/jsb_websocket.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\nCopyright (c) 2013 James Chen\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"jsb_websocket.h\"\n#include \"cocos2d.h\"\n#include \"network/WebSocket.h\"\n#include \"spidermonkey_specifics.h\"\n#include \"ScriptingCore.h\"\n#include \"cocos2d_specifics.hpp\"\n\nusing namespace cocos2d::network;\n\n/*\n [Constructor(in DOMString url, in optional DOMString protocols)]\n [Constructor(in DOMString url, in optional DOMString[] protocols)]\n interface WebSocket {\n readonly attribute DOMString url;\n \n // ready state\n const unsigned short CONNECTING = 0;\n const unsigned short OPEN = 1;\n const unsigned short CLOSING = 2;\n const unsigned short CLOSED = 3;\n readonly attribute unsigned short readyState;\n readonly attribute unsigned long bufferedAmount;\n \n // networking\n attribute Function onopen;\n attribute Function onmessage;\n attribute Function onerror;\n attribute Function onclose;\n readonly attribute DOMString protocol;\n void send(in DOMString data);\n void close();\n };\n WebSocket implements EventTarget;\n */\n\nclass JSB_WebSocketDelegate : public WebSocket::Delegate\n{\npublic:\n    \n    virtual void onOpen(WebSocket* ws)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(ws);\n        if (!p) return;\n        \n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n        \n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);\n        JS::RootedValue vp(cx);\n        vp = c_string_to_jsval(cx, \"open\");\n        JS_SetProperty(cx, jsobj, \"type\", vp);\n        \n        jsval args = OBJECT_TO_JSVAL(jsobj);\n        \n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"onopen\", 1, &args);\n    }\n    \n    virtual void onMessage(WebSocket* ws, const WebSocket::Data& data)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(ws);\n        if (!p) return;\n        \n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n        \n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);\n        JS::RootedValue vp(cx);\n        vp = c_string_to_jsval(cx, \"message\");\n        JS_SetProperty(cx, jsobj, \"type\", vp);\n        \n        jsval args = OBJECT_TO_JSVAL(jsobj);\n        \n        if (data.isBinary)\n        {// data is binary\n            JSObject* buffer = JS_NewArrayBuffer(cx, data.len);\n            uint8_t* bufdata = JS_GetArrayBufferData(buffer);\n            memcpy((void*)bufdata, (void*)data.bytes, data.len);\n            JS::RootedValue dataVal(cx);\n            dataVal = OBJECT_TO_JSVAL(buffer);\n            JS_SetProperty(cx, jsobj, \"data\", dataVal);\n        }\n        else\n        {// data is string\n            JS::RootedValue dataVal(cx);\n            dataVal = c_string_to_jsval(cx, data.bytes);\n            JS_SetProperty(cx, jsobj, \"data\", dataVal);\n        }\n\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"onmessage\", 1, &args);\n    }\n    \n    virtual void onClose(WebSocket* ws)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(ws);\n        if (!p) return;\n        \n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n        \n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);\n        JS::RootedValue vp(cx);\n        vp = c_string_to_jsval(cx, \"close\");\n        JS_SetProperty(cx, jsobj, \"type\", vp);\n        \n        jsval args = OBJECT_TO_JSVAL(jsobj);\n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"onclose\", 1, &args);\n\n        js_proxy_t* jsproxy = jsb_get_js_proxy(p->obj);\n        JS_RemoveObjectRoot(cx, &jsproxy->obj);\n        jsb_remove_proxy(p, jsproxy);\n        CC_SAFE_DELETE(ws);\n    }\n    \n    virtual void onError(WebSocket* ws, const WebSocket::ErrorCode& error)\n    {\n        js_proxy_t * p = jsb_get_native_proxy(ws);\n        if (!p) return;\n        \n        JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET\n        \n        JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();\n        JSObject* jsobj = JS_NewObject(cx, NULL, NULL, NULL);\n        JS::RootedValue vp(cx);\n        vp = c_string_to_jsval(cx, \"error\");\n        JS_SetProperty(cx, jsobj, \"type\", vp);\n        \n        jsval args = OBJECT_TO_JSVAL(jsobj);\n        \n        ScriptingCore::getInstance()->executeFunctionWithOwner(OBJECT_TO_JSVAL(_JSDelegate), \"onerror\", 1, &args);\n    }\n    \n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n    }\nprivate:\n    JSObject* _JSDelegate;\n};\n\nJSClass  *js_cocos2dx_websocket_class;\nJSObject *js_cocos2dx_websocket_prototype;\n\nvoid js_cocos2dx_WebSocket_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOG(\"jsbindings: finalizing JS object %p (WebSocket)\", obj);\n}\n\nJSBool js_cocos2dx_extension_WebSocket_send(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tWebSocket* cobj = (WebSocket *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n\n\tif(argc == 1){\n        do\n        {\n            if (JSVAL_IS_STRING(argv[0]))\n            {\n                std::string data;\n                jsval_to_std_string(cx, argv[0], &data);\n                cobj->send(data);\n                break;\n            }\n\n            if (argv[0].isObject())\n            {\n                uint8_t *bufdata = NULL;\n                uint32_t len = 0;\n                \n                JSObject* jsobj = JSVAL_TO_OBJECT(argv[0]);\n                if (JS_IsArrayBufferObject(jsobj))\n                {\n                    bufdata = JS_GetArrayBufferData(jsobj);\n                    len = JS_GetArrayBufferByteLength(jsobj);\n                }\n                else if (JS_IsArrayBufferViewObject(jsobj))\n                {\n                    bufdata = (uint8_t*)JS_GetArrayBufferViewData(jsobj);\n                    len = JS_GetArrayBufferViewByteLength(jsobj);\n                }\n                \n                if (bufdata && len > 0)\n                {\n                    cobj->send(bufdata, len);\n                    break;\n                }\n            }\n            \n            JS_ReportError(cx, \"data type to be sent is unsupported.\");\n\n        } while (0);\n        \n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_TRUE;\n}\n\nJSBool js_cocos2dx_extension_WebSocket_close(JSContext *cx, uint32_t argc, jsval *vp){\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tWebSocket* cobj = (WebSocket *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n\tif(argc == 0){\n\t\tcobj->close();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nJSBool js_cocos2dx_extension_WebSocket_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    jsval *argv = JS_ARGV(cx, vp);\n    \n\tif (argc == 1 || argc == 2)\n    {\n\n\t\tstd::string url;\n\t\t\n\t\tdo {\n\t\t\tJSBool ok = jsval_to_std_string(cx, argv[0], &url);\n\t\t\tJSB_PRECONDITION2( ok, cx, JS_FALSE, \"Error processing arguments\");\n\t\t} while (0);\n        \n\t\tJSObject *obj = JS_NewObject(cx, js_cocos2dx_websocket_class, js_cocos2dx_websocket_prototype, NULL);\n\t\t\n        \n\t\tWebSocket* cobj = new WebSocket();\n        JSB_WebSocketDelegate* delegate = new JSB_WebSocketDelegate();\n        delegate->setJSDelegate(obj);\n        \n        if (argc == 2)\n        {\n            std::vector<std::string> protocols;\n            \n            if (JSVAL_IS_STRING(argv[1]))\n            {\n                std::string protocol;\n                do {\n                    JSBool ok = jsval_to_std_string(cx, argv[1], &protocol);\n                    JSB_PRECONDITION2( ok, cx, JS_FALSE, \"Error processing arguments\");\n                } while (0);\n                protocols.push_back(protocol);\n            }\n            else if (argv[1].isObject())\n            {\n                JSBool ok = JS_TRUE;\n                JSObject* arg2 = JSVAL_TO_OBJECT(argv[1]);\n                JSB_PRECONDITION(JS_IsArrayObject( cx, arg2 ),  \"Object must be an array\");\n                \n                uint32_t len = 0;\n                JS_GetArrayLength(cx, arg2, &len);\n                \n                for( uint32_t i=0; i< len;i++ )\n                {\n                    jsval valarg;\n                    JS_GetElement(cx, arg2, i, &valarg);\n                    std::string protocol;\n                    do {\n                        ok = jsval_to_std_string(cx, valarg, &protocol);\n                        JSB_PRECONDITION2( ok, cx, JS_FALSE, \"Error processing arguments\");\n                    } while (0);\n                    \n                    protocols.push_back(protocol);\n                }\n            }\n            cobj->init(*delegate, url, &protocols);\n        }\n        else\n        {\n            cobj->init(*delegate, url);\n        }\n        \n        \n        JS_DefineProperty(cx, obj, \"URL\", argv[0]\n                          , NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);\n        \n\t\t//protocol not support yet (always return \"\")\n\t\tJS_DefineProperty(cx, obj, \"protocol\", c_string_to_jsval(cx, \"\")\n                          , NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);\n        \n        // link the native object with the javascript object\n\t\tjs_proxy_t *p = jsb_new_proxy(cobj, obj);\n        JS_AddNamedObjectRoot(cx, &p->obj, \"WebSocket\");\n        \n        JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n    \n\tJS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_cocos2dx_extension_WebSocket_get_readyState(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n    JSObject* jsobj = obj.get();\n\tjs_proxy_t *proxy = jsb_get_js_proxy(jsobj);\n\tWebSocket* cobj = (WebSocket *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"Invalid Native Object\");\n    \n    if (cobj) {\n        vp.set(INT_TO_JSVAL((int)cobj->getReadyState()));\n        return JS_TRUE;\n    } else {\n        JS_ReportError(cx, \"Error: WebSocket instance is invalid.\");\n        return JS_FALSE;\n    }\n}\n\nvoid register_jsb_websocket(JSContext *cx, JSObject *global) {\n    \n    js_cocos2dx_websocket_class = (JSClass *)calloc(1, sizeof(JSClass));\n    js_cocos2dx_websocket_class->name = \"WebSocket\";\n    js_cocos2dx_websocket_class->addProperty = JS_PropertyStub;\n    js_cocos2dx_websocket_class->delProperty = JS_DeletePropertyStub;\n    js_cocos2dx_websocket_class->getProperty = JS_PropertyStub;\n    js_cocos2dx_websocket_class->setProperty = JS_StrictPropertyStub;\n    js_cocos2dx_websocket_class->enumerate = JS_EnumerateStub;\n    js_cocos2dx_websocket_class->resolve = JS_ResolveStub;\n    js_cocos2dx_websocket_class->convert = JS_ConvertStub;\n    js_cocos2dx_websocket_class->finalize = js_cocos2dx_WebSocket_finalize;\n    js_cocos2dx_websocket_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n    \n    static JSPropertySpec properties[] = {\n        {\"readyState\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_SHARED, JSOP_WRAPPER(js_cocos2dx_extension_WebSocket_get_readyState), NULL},\n        {0, 0, 0, 0, 0}\n    };\n    \n    static JSFunctionSpec funcs[] = {\n        JS_FN(\"send\",js_cocos2dx_extension_WebSocket_send, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"close\",js_cocos2dx_extension_WebSocket_close, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n    };\n    \n    static JSFunctionSpec st_funcs[] = {\n        JS_FS_END\n    };\n    \n    js_cocos2dx_websocket_prototype = JS_InitClass(\n                                                cx, global,\n                                                NULL,\n                                                js_cocos2dx_websocket_class,\n                                                js_cocos2dx_extension_WebSocket_constructor, 0, // constructor\n                                                properties,\n                                                funcs,\n                                                NULL, // no static properties\n                                                st_funcs);\n    \n    JSObject* jsclassObj = JSVAL_TO_OBJECT(anonEvaluate(cx, global, \"(function () { return WebSocket; })()\"));\n\n    JS_DefineProperty(cx, jsclassObj, \"CONNECTING\", INT_TO_JSVAL((int)WebSocket::State::CONNECTING)\n                      , NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);\n\tJS_DefineProperty(cx, jsclassObj, \"OPEN\", INT_TO_JSVAL((int)WebSocket::State::OPEN)\n                      , NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);\n\tJS_DefineProperty(cx, jsclassObj, \"CLOSING\", INT_TO_JSVAL((int)WebSocket::State::CLOSING)\n                      , NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);\n\tJS_DefineProperty(cx, jsclassObj, \"CLOSED\", INT_TO_JSVAL((int)WebSocket::State::CLOSED)\n                      , NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY);\n    \n    // make the class enumerable in the registered namespace\n    JSBool found;\n    JS_SetPropertyAttributes(cx, global, \"WebSocket\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n}\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/network/jsb_websocket.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\nCopyright (c) 2013 James Chen\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __jsb_websocket__\n#define __jsb_websocket__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nvoid register_jsb_websocket(JSContext* cx, JSObject* global);\n\n#endif /* defined(__jsb_websocket__) */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/network/libJSBindingForNetwork.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"jsb_websocket.cpp\" />\n    <ClCompile Include=\"XMLHTTPRequest.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jsb_websocket.h\" />\n    <ClInclude Include=\"XMLHTTPRequest.h\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{3BEC13F5-E227-4D80-BC77-1C857F83BCFC}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForNetwork</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\network;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)external\\websockets\\include\\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\network;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)external\\websockets\\include\\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/network/libJSBindingForNetwork.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"jsb_websocket.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"XMLHTTPRequest.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"jsb_websocket.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"XMLHTTPRequest.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_auto.cpp\" />\n    <ClCompile Include=\"..\\cocos2d_specifics.cpp\" />\n    <ClCompile Include=\"..\\jsb_opengl_functions.cpp\" />\n    <ClCompile Include=\"..\\jsb_opengl_manual.cpp\" />\n    <ClCompile Include=\"..\\jsb_opengl_registration.cpp\" />\n    <ClCompile Include=\"..\\js_bindings_core.cpp\" />\n    <ClCompile Include=\"..\\js_bindings_opengl.cpp\" />\n    <ClCompile Include=\"..\\js_manual_conversions.cpp\" />\n    <ClCompile Include=\"..\\ScriptingCore.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_auto.hpp\" />\n    <ClInclude Include=\"..\\cocos2d_specifics.hpp\" />\n    <ClInclude Include=\"..\\jsb_helper.h\" />\n    <ClInclude Include=\"..\\jsb_opengl_functions.h\" />\n    <ClInclude Include=\"..\\jsb_opengl_manual.h\" />\n    <ClInclude Include=\"..\\jsb_opengl_registration.h\" />\n    <ClInclude Include=\"..\\js_bindings_config.h\" />\n    <ClInclude Include=\"..\\js_bindings_core.h\" />\n    <ClInclude Include=\"..\\js_bindings_opengl.h\" />\n    <ClInclude Include=\"..\\js_manual_conversions.h\" />\n    <ClInclude Include=\"..\\ScriptingCore.h\" />\n    <ClInclude Include=\"..\\spidermonkey_specifics.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_auto_api.js\" />\n    <None Include=\"..\\..\\script\\jsb.js\" />\n    <None Include=\"..\\..\\script\\jsb_chipmunk.js\" />\n    <None Include=\"..\\..\\script\\jsb_cocos2d.js\" />\n    <None Include=\"..\\..\\script\\jsb_cocos2d_extension.js\" />\n    <None Include=\"..\\..\\script\\jsb_cocosbuilder.js\" />\n    <None Include=\"..\\..\\script\\jsb_debugger.js\" />\n    <None Include=\"..\\..\\script\\jsb_opengl.js\" />\n    <None Include=\"..\\..\\script\\jsb_sys.js\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{39379840-825A-45A0-B363-C09FFEF864BD}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBinding</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\storage;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\storage;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\..\\external\\sqlite3\\libraries\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"js\">\n      <UniqueIdentifier>{e19c6b81-737e-46ca-a683-a6d1db50a29c}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\cocos2d_specifics.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\js_bindings_core.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\js_manual_conversions.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\ScriptingCore.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\js_bindings_opengl.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\jsb_opengl_registration.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\jsb_opengl_manual.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\jsb_opengl_functions.cpp\">\n      <Filter>manual</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_auto.cpp\">\n      <Filter>generated</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\cocos2d_specifics.hpp\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\js_bindings_config.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\js_bindings_core.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\js_manual_conversions.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\ScriptingCore.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\spidermonkey_specifics.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\js_bindings_opengl.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\jsb_opengl_functions.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\jsb_opengl_manual.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\jsb_opengl_registration.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\jsb_helper.h\">\n      <Filter>manual</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_auto.hpp\">\n      <Filter>generated</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_auto_api.js\">\n      <Filter>generated</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb.js\">\n      <Filter>js</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb_chipmunk.js\">\n      <Filter>js</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb_cocos2d.js\">\n      <Filter>js</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb_cocos2d_extension.js\">\n      <Filter>js</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb_opengl.js\">\n      <Filter>js</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb_sys.js\">\n      <Filter>js</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb_debugger.js\">\n      <Filter>js</Filter>\n    </None>\n    <None Include=\"..\\..\\script\\jsb_cocosbuilder.js\">\n      <Filter>js</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/spidermonkey_specifics.h",
    "content": "#ifndef __SPIDERMONKEY_SPECIFICS_H__\n#define __SPIDERMONKEY_SPECIFICS_H__\n\n#include \"jsapi.h\"\n#include \"uthash.h\"\n#include <unordered_map>\n\ntypedef struct js_proxy {\n\tvoid *ptr;\n\tJSObject *obj;\n\tUT_hash_handle hh;\n} js_proxy_t;\n\nextern js_proxy_t *_native_js_global_ht;\nextern js_proxy_t *_js_native_global_ht;\n\ntypedef struct js_type_class {\n\tJSClass *jsclass;\n\tJSObject *proto;\n\tJSObject *parentProto;\n} js_type_class_t;\n\nextern std::unordered_map<std::string, js_type_class_t*> _js_global_type_map;\n\ntemplate< typename DERIVED >\nclass TypeTest\n{\npublic:\n\tstatic const char* s_name()\n\t{\n\t\t// return id unique for DERIVED\n\t\t// ALWAYS VALID BUT STRING, NOT INT - BUT VALID AND CROSS-PLATFORM/CROSS-VERSION COMPATBLE\n\t\t// AS FAR AS YOU KEEP THE CLASS NAME\n\t\treturn typeid( DERIVED ).name();\n\t}\n};\n\n\n#define JS_NEW_PROXY(p, native_obj, js_obj) \\\ndo { \\\n\tp = (js_proxy_t *)malloc(sizeof(js_proxy_t)); \\\n\tassert(p); \\\n    js_proxy_t* native_obj##js_obj##tmp = NULL; \\\n    HASH_FIND_PTR(_native_js_global_ht, &native_obj, native_obj##js_obj##tmp); \\\n    assert(!native_obj##js_obj##tmp); \\\n\tp->ptr = native_obj; \\\n\tp->obj = js_obj; \\\n\tHASH_ADD_PTR(_native_js_global_ht, ptr, p); \\\n\tp = (js_proxy_t *)malloc(sizeof(js_proxy_t)); \\\n\tassert(p); \\\n    native_obj##js_obj##tmp = NULL; \\\n    HASH_FIND_PTR(_js_native_global_ht, &js_obj, native_obj##js_obj##tmp); \\\n    assert(!native_obj##js_obj##tmp); \\\n\tp->ptr = native_obj; \\\n\tp->obj = js_obj; \\\n\tHASH_ADD_PTR(_js_native_global_ht, obj, p); \\\n} while(0) \\\n\n#define JS_GET_PROXY(p, native_obj) \\\ndo { \\\n\tHASH_FIND_PTR(_native_js_global_ht, &native_obj, p); \\\n} while (0)\n\n#define JS_GET_NATIVE_PROXY(p, js_obj) \\\ndo { \\\n\tHASH_FIND_PTR(_js_native_global_ht, &js_obj, p); \\\n} while (0)\n\n#define JS_REMOVE_PROXY(nproxy, jsproxy) \\\ndo { \\\n\tif (nproxy) { HASH_DEL(_native_js_global_ht, nproxy); free(nproxy); } \\\n\tif (jsproxy) { HASH_DEL(_js_native_global_ht, jsproxy); free(jsproxy); } \\\n} while (0)\n\n#define TEST_NATIVE_OBJECT(cx, native_obj) \\\nif (!native_obj) { \\\n\tJS_ReportError(cx, \"Invalid Native Object\"); \\\n\treturn JS_FALSE; \\\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/spine/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := jsb_spine_static\n\nLOCAL_MODULE_FILENAME := libcocos2dxjsbspine\n\nLOCAL_SRC_FILES := ../../../auto-generated/js-bindings/jsb_cocos2dx_spine_auto.cpp\n\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH) \\\n                    $(LOCAL_PATH)/../../../../editor-support/spine\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_jsb_static\nLOCAL_WHOLE_STATIC_LIBRARIES += spine_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/prebuilt/android)\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,editor-support/spine)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_spine_auto.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_spine_auto.hpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_spine_auto_api.js\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{E78CDC6B-F37D-48D2-AD91-1DB549497E32}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>libJSBindingForSpine</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\spine;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)cocos\\audio\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <MinimalRebuild>false</MinimalRebuild>\n      <DebugInformationFormat>OldStyle</DebugInformationFormat>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>$(ProjectDir)..;$(EngineRoot);$(EngineRoot)cocos;$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\spine;$(EngineRoot)cocos\\scripting\\auto-generated\\js-bindings;$(EngineRoot)external\\spidermonkey\\include\\win32;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)cocos\\audio\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"generated\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"manual\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_spine_auto.cpp\">\n      <Filter>generated</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_spine_auto.hpp\">\n      <Filter>generated</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\..\\auto-generated\\js-bindings\\jsb_cocos2dx_spine_auto_api.js\">\n      <Filter>generated</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/debugger/DevToolsUtils.js",
    "content": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n\"use strict\";\n\nfunction utf16to8(str) {\n    var out, i, len, c;\n\n    out = \"\";\n    len = str.length;\n    for(i = 0; i < len; i++) \n    { \n        c = str.charCodeAt(i);   \n        if ((c >= 0x0001) && (c <= 0x007F))\n        {\n            out += str.charAt(i);\n        }\n        else if (c > 0x07FF)\n        {\n            out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));\n            out += String.fromCharCode(0x80 | ((c >>  6) & 0x3F));\n            out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));\n        } \n        else\n        {\n            out += String.fromCharCode(0xC0 | ((c >>  6) & 0x1F));\n            out += String.fromCharCode(0x80 | ((c >>  0) & 0x3F));\n        }\n    }\n    return out;\n}\n\nfunction utf8to16(str) {\n     var out, i, len, c;\n     var char2, char3;\n\n     out = \"\";\n     len = str.length;\n     i = 0;\n     while(i < len) {   c = str.charCodeAt(i++);   switch(c >> 4)\n  {\n    case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n      // 0xxxxxxx\n      out += str.charAt(i-1);\n      break;\n    case 12: case 13:\n      // 110x xxxx   10xx xxxx\n      char2 = str.charCodeAt(i++);\n      out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n      break;\n    case 14:\n      // 1110 xxxx  10xx xxxx  10xx xxxx\n      char2 = str.charCodeAt(i++);\n      char3 = str.charCodeAt(i++);\n      out += String.fromCharCode(((c & 0x0F) << 12) |\n         ((char2 & 0x3F) << 6) |\n         ((char3 & 0x3F) << 0));\n      break;\n  }\n     }\n\n     return out;\n }\n\nvar dump = function(msg) {\n  log(msg);\n};\n\n/* General utilities used throughout devtools. */\n\n/* Turn the error e into a string, without fail. */\nthis.safeErrorString = function safeErrorString(aError) {\n  try {\n    var s = aError.toString();\n    if (typeof s === \"string\")\n      return s;\n  } catch (ee) { }\n\n  return \"<failed trying to find error description>\";\n}\n\n/**\n * Report that |aWho| threw an exception, |aException|.\n */\nthis.reportException = function reportException(aWho, aException) {\n  let msg = aWho + \" threw an exception: \" + safeErrorString(aException);\n  if (aException.stack) {\n    msg += \"\\nCall stack:\\n\" + aException.stack;\n  }\n\n  dump(msg + \"\\n\");\n\n  // if (Components.utils.reportError) {\n  //   /*\n  //    * Note that the xpcshell test harness registers an observer for\n  //    * console messages, so when we're running tests, this will cause\n  //    * the test to quit.\n  //    */\n  //   Components.utils.reportError(msg);\n  // }\n}\n\n/**\n * Given a handler function that may throw, return an infallible handler\n * function that calls the fallible handler, and logs any exceptions it\n * throws.\n *\n * @param aHandler function\n *      A handler function, which may throw.\n * @param aName string\n *      A name for aHandler, for use in error messages. If omitted, we use\n *      aHandler.name.\n *\n * (SpiderMonkey does generate good names for anonymous functions, but we\n * don't have a way to get at them from JavaScript at the moment.)\n */\nthis.makeInfallible = function makeInfallible(aHandler, aName) {\n  if (!aName)\n    aName = aHandler.name;\n\n  return function (/* arguments */) {\n    try {\n      return aHandler.apply(this, arguments);\n    } catch (ex) {\n      let who = \"Handler function\";\n      if (aName) {\n        who += \" \" + aName;\n      }\n      reportException(who, ex);\n    }\n  }\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/debugger/README.md",
    "content": "Remote Debugging By Using FireFox\n=================================\n\nRequirement\n-----------\n\n* Firefox: From v24\n\nHow To Use\n----------\n\n### Prepare ###\n\nPlease refer to https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging .\n\n### Enable Debugger Support For Your JSB Project ###\n\n```\nbool AppDelegate::applicationDidFinishLaunching()\n{\n    ...\n    \n    ScriptingCore* sc = ScriptingCore::getInstance();\n    sc->addRegisterCallback(register_all_cocos2dx);\n    sc->addRegisterCallback(register_all_cocos2dx_extension);\n    sc->addRegisterCallback(register_cocos2dx_js_extensions);\n    sc->addRegisterCallback(jsb_register_chipmunk);\n    sc->addRegisterCallback(register_all_cocos2dx_extension_manual);\n    sc->addRegisterCallback(register_CCBuilderReader);\n    sc->addRegisterCallback(jsb_register_system);\n    sc->addRegisterCallback(JSB_register_opengl);\n    \n    sc->start();\n    \n#if defined(COCOS2D_DEBUG) && (COCOS2D_DEBUG > 0)\n    sc->enableDebugger();   // Enable debugger here\n#endif\n\n   ...\n}\n```\n\nRun your game.\n\n### Open Firefox And Follow The Step As Follows ###\n\n\n![pic 1](https://lh5.googleusercontent.com/-HoxLGBdV2J0/UlZ7ZoFUjyI/AAAAAAAAADM/68GDaCQ1vP0/s0-I/Firefox-Remote-Debug01.jpg)\n![pic 2](https://lh6.googleusercontent.com/-7FDIHAYsKAY/UlZ7Yf8W-pI/AAAAAAAAAFQ/joG0AymnuBk/s0-I/Firefox-Remote-Debug02.jpg)\n![pic 3](https://lh4.googleusercontent.com/-idvnMRGcGy8/UlZ7Wj6DDuI/AAAAAAAAAC0/L9IVyHLNqeQ/s0-I/Firefox-Remote-Debug04.jpg)\n![pic 4](https://lh6.googleusercontent.com/-YuZj7JGAtFE/UlZ9DDGDczI/AAAAAAAAAEQ/D2qIedjP5FU/s0-I/Firefox-Remote-Debug04.png.png)\n![pic 5](https://lh3.googleusercontent.com/-cdIcNa3jT5c/UlZ9uapf3OI/AAAAAAAAAEg/MGq3vLHsauw/s0-I/Firefox-Remote-Debug05.png)\n![pic 6](https://lh5.googleusercontent.com/-T79-o5ylJKI/UlZ_JJQe3MI/AAAAAAAAAE8/F63fSVxlJKs/s0-I/Firefox-Remote-Debug06.png)\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/debugger/actors/root.js",
    "content": "/* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ft=javascript ts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n\"use strict\";\n\n/* Root actor for the remote debugging protocol. */\n\n/**\n * Methods shared between RootActor and BrowserTabActor.\n */\n\n/**\n * Populate |this._extraActors| as specified by |aFactories|, reusing whatever\n * actors are already there. Add all actors in the final extra actors table to\n * |aPool|.\n *\n * The root actor and the tab actor use this to instantiate actors that other\n * parts of the browser have specified with DebuggerServer.addTabActor antd\n * DebuggerServer.addGlobalActor.\n *\n * @param aFactories\n *     An object whose own property names are the names of properties to add to\n *     some reply packet (say, a tab actor grip or the \"listTabs\" response\n *     form), and whose own property values are actor constructor functions, as\n *     documented for addTabActor and addGlobalActor.\n *\n * @param this\n *     The BrowserRootActor or BrowserTabActor with which the new actors will\n *     be associated. It should support whatever API the |aFactories|\n *     constructor functions might be interested in, as it is passed to them.\n *     For the sake of CommonCreateExtraActors itself, it should have at least\n *     the following properties:\n *\n *     - _extraActors\n *        An object whose own property names are factory table (and packet)\n *        property names, and whose values are no-argument actor constructors,\n *        of the sort that one can add to an ActorPool.\n *\n *     - conn\n *        The DebuggerServerConnection in which the new actors will participate.\n *\n *     - actorID\n *        The actor's name, for use as the new actors' parentID.\n */\nfunction CommonCreateExtraActors(aFactories, aPool) {\n  // Walk over global actors added by extensions.\n  for (let name in aFactories) {\n    let actor = this._extraActors[name];\n    if (!actor) {\n      actor = aFactories[name].bind(null, this.conn, this);\n      actor.prototype = aFactories[name].prototype;\n      actor.parentID = this.actorID;\n      this._extraActors[name] = actor;\n    }\n    aPool.addActor(actor);\n  }\n}\n\n/**\n * Append the extra actors in |this._extraActors|, constructed by a prior call\n * to CommonCreateExtraActors, to |aObject|.\n *\n * @param aObject\n *     The object to which the extra actors should be added, under the\n *     property names given in the |aFactories| table passed to\n *     CommonCreateExtraActors.\n *\n * @param this\n *     The BrowserRootActor or BrowserTabActor whose |_extraActors| table we\n *     should use; see above.\n */\nfunction CommonAppendExtraActors(aObject) {\n  for (let name in this._extraActors) {\n    let actor = this._extraActors[name];\n    aObject[name] = actor.actorID;\n  }\n}\n\n/**\n * Create a remote debugging protocol root actor.\n *\n * @param aConnection\n *     The DebuggerServerConnection whose root actor we are constructing.\n *\n * @param aParameters\n *     The properties of |aParameters| provide backing objects for the root\n *     actor's requests; if a given property is omitted from |aParameters|, the\n *     root actor won't implement the corresponding requests or notifications.\n *     Supported properties:\n *\n *     - tabList: a live list (see below) of tab actors. If present, the\n *       new root actor supports the 'listTabs' request, providing the live\n *       list's elements as its tab actors, and sending 'tabListChanged'\n *       notifications when the live list's contents change. One actor in\n *       this list must have a true '.selected' property.\n *\n *     - globalActorFactories: an object |A| describing further actors to\n *       attach to the 'listTabs' reply. This is the type accumulated by\n *       DebuggerServer.addGlobalActor. For each own property |P| of |A|,\n *       the root actor adds a property named |P| to the 'listTabs'\n *       reply whose value is the name of an actor constructed by\n *       |A[P]|.\n *\n *     - onShutdown: a function to call when the root actor is disconnected.\n *\n * Instance properties:\n *\n * - applicationType: the string the root actor will include as the\n *      \"applicationType\" property in the greeting packet. By default, this\n *      is \"browser\".\n *\n * Live lists:\n *\n * A \"live list\", as used for the |tabList|, is an object that presents a\n * list of actors, and also notifies its clients of changes to the list. A\n * live list's interface is two properties:\n *\n * - iterator: a method that returns an iterator. A for-of loop will call\n *             this method to obtain an iterator for the loop, so if LL is\n *             a live list, one can simply write 'for (i of LL) ...'.\n *\n * - onListChanged: a handler called, with no arguments, when the set of\n *             values the iterator would produce has changed since the last\n *             time 'iterator' was called. This may only be set to null or a\n *             callable value (one for which the typeof operator returns\n *             'function'). (Note that the live list will not call the\n *             onListChanged handler until the list has been iterated over\n *             once; if nobody's seen the list in the first place, nobody\n *             should care if its contents have changed!)\n *\n * When the list changes, the list implementation should ensure that any\n * actors yielded in previous iterations whose referents (tabs) still exist\n * get yielded again in subsequent iterations. If the underlying referent\n * is the same, the same actor should be presented for it.\n *\n * The root actor registers an 'onListChanged' handler on the appropriate\n * list when it may need to send the client 'tabListChanged' notifications,\n * and is careful to remove the handler whenever it does not need to send\n * such notifications (including when it is disconnected). This means that\n * live list implementations can use the state of the handler property (set\n * or null) to install and remove observers and event listeners.\n *\n * Note that, as the only way for the root actor to see the members of the\n * live list is to begin an iteration over the list, the live list need not\n * actually produce any actors until they are reached in the course of\n * iteration: alliterative lazy live lists.\n */\nfunction RootActor(aConnection, aParameters) {\n  this.conn = aConnection;\n  this._parameters = aParameters;\n  this._onTabListChanged = this.onTabListChanged.bind(this);\n  this._extraActors = {};\n}\n\nRootActor.prototype = {\n  constructor: RootActor,\n  applicationType: \"browser\",\n\n  /**\n   * Return a 'hello' packet as specified by the Remote Debugging Protocol.\n   */\n  sayHello: function() {\n    return {\n      from: this.actorID,\n      applicationType: this.applicationType,\n      /* This is not in the spec, but it's used by tests. */\n      testConnectionPrefix: this.conn.prefix,\n      traits: {\n        sources: true\n      }\n    };\n  },\n\n  /**\n   * This is true for the root actor only, used by some child actors\n   */\n  get isRootActor() true,\n\n  /**\n   * The (chrome) window, for use by child actors\n   */\n  get window() Services.wm.getMostRecentWindow(DebuggerServer.chromeWindowType),\n\n  /**\n   * Disconnects the actor from the browser window.\n   */\n  disconnect: function() {\n    /* Tell the live lists we aren't watching any more. */\n    if (this._parameters.tabList) {\n      this._parameters.tabList.onListChanged = null;\n    }\n    if (typeof this._parameters.onShutdown === 'function') {\n      this._parameters.onShutdown();\n    }\n    this._extraActors = null;\n  },\n\n  /* The 'listTabs' request and the 'tabListChanged' notification. */\n\n  /**\n   * Handles the listTabs request. The actors will survive until at least\n   * the next listTabs request.\n   */\n  onListTabs: function() {\n    let tabList = this._parameters.tabList;\n    if (!tabList) {\n      return { from: this.actorID, error: \"noTabs\",\n               message: \"This root actor has no browser tabs.\" };\n    }\n\n    /*\n     * Walk the tab list, accumulating the array of tab actors for the\n     * reply, and moving all the actors to a new ActorPool. We'll\n     * replace the old tab actor pool with the one we build here, thus\n     * retiring any actors that didn't get listed again, and preparing any\n     * new actors to receive packets.\n     */\n    let newActorPool = new ActorPool(this.conn);\n    let tabActorList = [];\n    let selected;\n    for (let tabActor of tabList) {\n      if (tabActor.selected) {\n        selected = tabActorList.length;\n      }\n      tabActor.parentID = this.actorID;\n      newActorPool.addActor(tabActor);\n      tabActorList.push(tabActor);\n    }\n\n    /* DebuggerServer.addGlobalActor support: create actors. */\n    this._createExtraActors(this._parameters.globalActorFactories, newActorPool);\n\n    /*\n     * Drop the old actorID -> actor map. Actors that still mattered were\n     * added to the new map; others will go away.\n     */\n    if (this._tabActorPool) {\n      this.conn.removeActorPool(this._tabActorPool);\n    }\n    this._tabActorPool = newActorPool;\n    this.conn.addActorPool(this._tabActorPool);\n\n    let reply = {\n      \"from\": this.actorID,\n      \"selected\": selected || 0,\n      \"tabs\": [actor.grip() for (actor of tabActorList)],\n    };\n\n    /* DebuggerServer.addGlobalActor support: name actors in 'listTabs' reply. */\n    this._appendExtraActors(reply);\n\n    /*\n     * Now that we're actually going to report the contents of tabList to\n     * the client, we're responsible for letting the client know if it\n     * changes.\n     */\n    tabList.onListChanged = this._onTabListChanged;\n\n    return reply;\n  },\n\n  onTabListChanged: function () {\n    this.conn.send({ from: this.actorID, type:\"tabListChanged\" });\n    /* It's a one-shot notification; no need to watch any more. */\n    this._parameters.tabList.onListChanged = null;\n  },\n\n  /* This is not in the spec, but it's used by tests. */\n  onEcho: function (aRequest) {\n    /*\n     * Request packets are frozen. Copy aRequest, so that\n     * DebuggerServerConnection.onPacket can attach a 'from' property.\n     */\n    return JSON.parse(JSON.stringify(aRequest));\n  },\n\n  /* Support for DebuggerServer.addGlobalActor. */\n  _createExtraActors: CommonCreateExtraActors,\n  _appendExtraActors: CommonAppendExtraActors,\n\n  /* ThreadActor hooks. */\n\n  /**\n   * Prepare to enter a nested event loop by disabling debuggee events.\n   */\n  preNest: function() {\n    // Disable events in all open windows.\n    let e = windowMediator.getEnumerator(null);\n    while (e.hasMoreElements()) {\n      let win = e.getNext();\n      let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor)\n                           .getInterface(Ci.nsIDOMWindowUtils);\n      windowUtils.suppressEventHandling(true);\n      windowUtils.suspendTimeouts();\n    }\n  },\n\n  /**\n   * Prepare to exit a nested event loop by enabling debuggee events.\n   */\n  postNest: function(aNestData) {\n    // Enable events in all open windows.\n    let e = windowMediator.getEnumerator(null);\n    while (e.hasMoreElements()) {\n      let win = e.getNext();\n      let windowUtils = win.QueryInterface(Ci.nsIInterfaceRequestor)\n                           .getInterface(Ci.nsIDOMWindowUtils);\n      windowUtils.resumeTimeouts();\n      windowUtils.suppressEventHandling(false);\n    }\n  },\n\n  /* ChromeDebuggerActor hooks. */\n\n  /**\n   * Add the specified actor to the default actor pool connection, in order to\n   * keep it alive as long as the server is. This is used by breakpoints in the\n   * thread and chrome debugger actors.\n   *\n   * @param actor aActor\n   *        The actor object.\n   */\n  addToParentPool: function(aActor) {\n    this.conn.addActor(aActor);\n  },\n\n  /**\n   * Remove the specified actor from the default actor pool.\n   *\n   * @param BreakpointActor aActor\n   *        The actor object.\n   */\n  removeFromParentPool: function(aActor) {\n    this.conn.removeActor(aActor);\n  }\n}\n\nRootActor.prototype.requestTypes = {\n  \"listTabs\": RootActor.prototype.onListTabs,\n  \"echo\": RootActor.prototype.onEcho\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/debugger/actors/script.js",
    "content": "/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; js-indent-level: 2; -*- */\n/* vim: set ft=javascript ts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n\"use strict\";\n\n/**\n * BreakpointStore objects keep track of all breakpoints that get set so that we\n * can reset them when the same script is introduced to the thread again (such\n * as after a refresh).\n */\nfunction BreakpointStore() {\n  // If we have a whole-line breakpoint set at LINE in URL, then\n  //\n  //   this._wholeLineBreakpoints[URL][LINE]\n  //\n  // is an object\n  //\n  //   { url, line[, actor] }\n  //\n  // where the `actor` property is optional.\n  this._wholeLineBreakpoints = Object.create(null);\n\n  // If we have a breakpoint set at LINE, COLUMN in URL, then\n  //\n  //   this._breakpoints[URL][LINE][COLUMN]\n  //\n  // is an object\n  //\n  //   { url, line[, actor] }\n  //\n  // where the `actor` property is optional.\n  this._breakpoints = Object.create(null);\n}\n\nBreakpointStore.prototype = {\n\n  /**\n   * Add a breakpoint to the breakpoint store.\n   *\n   * @param Object aBreakpoint\n   *        The breakpoint to be added (not copied). It is an object with the\n   *        following properties:\n   *          - url\n   *          - line\n   *          - column (optional; omission implies that the breakpoint is for\n   *            the whole line)\n   *          - actor (optional)\n   */\n  addBreakpoint: function BS_addBreakpoint(aBreakpoint) {\n    let { url, line, column } = aBreakpoint;\n\n    if (column != null) {\n      if (!this._breakpoints[url]) {\n        this._breakpoints[url] = [];\n      }\n      if (!this._breakpoints[url][line]) {\n        this._breakpoints[url][line] = [];\n      }\n      this._breakpoints[url][line][column] = aBreakpoint;\n    } else {\n      // Add a breakpoint that breaks on the whole line.\n      if (!this._wholeLineBreakpoints[url]) {\n        this._wholeLineBreakpoints[url] = [];\n      }\n      this._wholeLineBreakpoints[url][line] = aBreakpoint;\n    }\n  },\n\n  /**\n   * Remove a breakpoint from the breakpoint store.\n   *\n   * @param Object aBreakpoint\n   *        The breakpoint to be removed. It is an object with the following\n   *        properties:\n   *          - url\n   *          - line\n   *          - column (optional)\n   */\n  removeBreakpoint: function BS_removeBreakpoint({ url, line, column }) {\n    if (column != null) {\n      if (this._breakpoints[url]) {\n        if (this._breakpoints[url][line]) {\n          delete this._breakpoints[url][line][column];\n\n          // If this was the last breakpoint on this line, delete the line from\n          // `this._breakpoints[url]` as well. Otherwise `_iterLines` will yield\n          // this line even though we no longer have breakpoints on\n          // it. Furthermore, we use Object.keys() instead of just checking\n          // `this._breakpoints[url].length` directly, because deleting\n          // properties from sparse arrays doesn't update the `length` property\n          // like adding them does.\n          if (Object.keys(this._breakpoints[url][line]).length === 0) {\n            delete this._breakpoints[url][line];\n          }\n        }\n      }\n    } else {\n      if (this._wholeLineBreakpoints[url]) {\n        delete this._wholeLineBreakpoints[url][line];\n      }\n    }\n  },\n\n  /**\n   * Get a breakpoint from the breakpoint store. Will throw an error if the\n   * breakpoint is not found.\n   *\n   * @param Object aLocation\n   *        The location of the breakpoint you are retrieving. It is an object\n   *        with the following properties:\n   *          - url\n   *          - line\n   *          - column (optional)\n   */\n  getBreakpoint: function BS_getBreakpoint(aLocation) {\n    let { url, line, column } = aLocation;\n    dbg_assert(url != null);\n    dbg_assert(line != null);\n\n    var foundBreakpoint = this.hasBreakpoint(aLocation);\n    if (foundBreakpoint == null) {\n      throw new Error(\"No breakpoint at url = \" + url\n          + \", line = \" + line\n          + \", column = \" + column);\n    }\n\n    return foundBreakpoint;\n  },\n\n  /**\n   * Checks if the breakpoint store has a requested breakpoint.\n   *\n   * @param Object aLocation\n   *        The location of the breakpoint you are retrieving. It is an object\n   *        with the following properties:\n   *          - url\n   *          - line\n   *          - column (optional)\n   * @returns The stored breakpoint if it exists, null otherwise.\n   */\n  hasBreakpoint: function BS_hasBreakpoint(aLocation) {\n    let { url, line, column } = aLocation;\n    dbg_assert(url != null);\n    dbg_assert(line != null);\n    for (let bp of this.findBreakpoints(aLocation)) {\n      // We will get whole line breakpoints before individual columns, so just\n      // return the first one and if they didn't specify a column then they will\n      // get the whole line breakpoint, and otherwise we will find the correct\n      // one.\n      return bp;\n    }\n\n    return null;\n  },\n\n  /**\n   * Iterate over the breakpoints in this breakpoint store. You can optionally\n   * provide search parameters to filter the set of breakpoints down to those\n   * that match your parameters.\n   *\n   * @param Object aSearchParams\n   *        Optional. An object with the following properties:\n   *          - url\n   *          - line (optional; requires the url property)\n   *          - column (optional; requires the line property)\n   */\n  findBreakpoints: function BS_findBreakpoints(aSearchParams={}) {\n    if (aSearchParams.column != null) {\n      dbg_assert(aSearchParams.line != null);\n    }\n    if (aSearchParams.line != null) {\n      dbg_assert(aSearchParams.url != null);\n    }\n\n    for (let url of this._iterUrls(aSearchParams.url)) {\n      for (let line of this._iterLines(url, aSearchParams.line)) {\n        // Always yield whole line breakpoints first. See comment in\n        // |BreakpointStore.prototype.hasBreakpoint|.\n        if (aSearchParams.column == null\n            && this._wholeLineBreakpoints[url]\n            && this._wholeLineBreakpoints[url][line]) {\n          yield this._wholeLineBreakpoints[url][line];\n        }\n        for (let column of this._iterColumns(url, line, aSearchParams.column)) {\n          yield this._breakpoints[url][line][column];\n        }\n      }\n    }\n  },\n\n  _iterUrls: function BS__iterUrls(aUrl) {\n    if (aUrl) {\n      if (this._breakpoints[aUrl] || this._wholeLineBreakpoints[aUrl]) {\n        yield aUrl;\n      }\n    } else {\n      for (let url of Object.keys(this._wholeLineBreakpoints)) {\n        yield url;\n      }\n      for (let url of Object.keys(this._breakpoints)) {\n        if (url in this._wholeLineBreakpoints) {\n          continue;\n        }\n        yield url;\n      }\n    }\n  },\n\n  _iterLines: function BS__iterLines(aUrl, aLine) {\n    if (aLine != null) {\n      if ((this._wholeLineBreakpoints[aUrl]\n           && this._wholeLineBreakpoints[aUrl][aLine])\n          || (this._breakpoints[aUrl] && this._breakpoints[aUrl][aLine])) {\n        yield aLine;\n      }\n    } else {\n      const wholeLines = this._wholeLineBreakpoints[aUrl]\n        ? Object.keys(this._wholeLineBreakpoints[aUrl])\n        : [];\n      const columnLines = this._breakpoints[aUrl]\n        ? Object.keys(this._breakpoints[aUrl])\n        : [];\n\n      const lines = wholeLines.concat(columnLines).sort();\n\n      let lastLine;\n      for (let line of lines) {\n        if (line === lastLine) {\n          continue;\n        }\n        yield line;\n        lastLine = line;\n      }\n    }\n  },\n\n  _iterColumns: function BS__iterColumns(aUrl, aLine, aColumn) {\n    if (!this._breakpoints[aUrl] || !this._breakpoints[aUrl][aLine]) {\n      return;\n    }\n\n    if (aColumn != null) {\n      if (this._breakpoints[aUrl][aLine][aColumn]) {\n        yield aColumn;\n      }\n    } else {\n      for (let column in this._breakpoints[aUrl][aLine]) {\n        yield column;\n      }\n    }\n  },\n};\n\n/**\n * Manages pushing event loops and automatically pops and exits them in the\n * correct order as they are resolved.\n *\n * @param nsIJSInspector inspector\n *        The underlying JS inspector we use to enter and exit nested event\n *        loops.\n * @param Object hooks\n *        An object with the following properties:\n *          - url: The URL string of the debuggee we are spinning an event loop\n *                 for.\n *          - preNest: function called before entering a nested event loop\n *          - postNest: function called after exiting a nested event loop\n * @param ThreadActor thread\n *        The thread actor instance that owns this EventLoopStack.\n */\nfunction EventLoopStack({ inspector, thread, hooks }) {\n  this._inspector = inspector;\n  this._hooks = hooks;\n  this._thread = thread;\n}\n\nEventLoopStack.prototype = {\n  /**\n   * The number of nested event loops on the stack.\n   */\n  get size() {\n    return this._inspector.eventLoopNestLevel();\n  },\n\n  /**\n   * The URL of the debuggee who pushed the event loop on top of the stack.\n   */\n  get lastPausedUrl() {\n    let url = null;\n    if (this.size > 0) {\n      try {\n        url = this._inspector.lastNestRequestor.url\n      } catch (e) {\n        // The tab's URL getter may throw if the tab is destroyed by the time\n        // this code runs, but we don't really care at this point.\n        dumpn(e);\n      }\n    }\n    return url;\n  },\n\n  /**\n   * Push a new nested event loop onto the stack.\n   *\n   * @returns EventLoop\n   */\n  push: function () {\n    return new EventLoop({\n      inspector: this._inspector,\n      thread: this._thread,\n      hooks: this._hooks\n    });\n  }\n};\n\n/**\n * An object that represents a nested event loop. It is used as the nest\n * requestor with nsIJSInspector instances.\n *\n * @param nsIJSInspector inspector\n *        The JS Inspector that runs nested event loops.\n * @param ThreadActor thread\n *        The thread actor that is creating this nested event loop.\n * @param Object hooks\n *        The same hooks object passed into EventLoopStack during its\n *        initialization.\n */\nfunction EventLoop({ inspector, thread, hooks }) {\n  this._inspector = inspector;\n  this._thread = thread;\n  this._hooks = hooks;\n\n  this.enter = this.enter.bind(this);\n  this.resolve = this.resolve.bind(this);\n}\n\nEventLoop.prototype = {\n  entered: false,\n  resolved: false,\n  get url() { return this._hooks.url; },\n\n  /**\n   * Enter this nested event loop.\n   */\n  enter: function () {\n    let nestData = this._hooks.preNest\n      ? this._hooks.preNest()\n      : null;\n\n    this.entered = true;\n    this._inspector.enterNestedEventLoop(this);\n\n    // Keep exiting nested event loops while the last requestor is resolved.\n    // James commented.\n    //  if (this._inspector.eventLoopNestLevel() > 0) {\n    //   const { resolved } = this._inspector.lastNestRequestor;\n    //   if (resolved) {\n    //     this._inspector.exitNestedEventLoop();\n    //   }\n    // }\n\n    dbg_assert(this._thread.state === \"running\",\n               \"Should be in the running state\");\n\n    if (this._hooks.postNest) {\n      this._hooks.postNest(nestData);\n    }\n  },\n\n  /**\n   * Resolve this nested event loop.\n   *\n   * @returns boolean\n   *          True if we exited this nested event loop because it was on top of\n   *          the stack, false if there is another nested event loop above this\n   *          one that hasn't resolved yet.\n   */\n  resolve: function () {\n    if (!this.entered) {\n      throw new Error(\"Can't resolve an event loop before it has been entered!\");\n    }\n    if (this.resolved) {\n      throw new Error(\"Already resolved this nested event loop!\");\n    }\n    this.resolved = true;\n    // James commented. if (this === this._inspector.lastNestRequestor) \n    {\n      this._inspector.exitNestedEventLoop();\n      return true;\n    }\n    return false;\n  },\n};\n\n/**\n * JSD2 actors.\n */\n/**\n * Creates a ThreadActor.\n *\n * ThreadActors manage a JSInspector object and manage execution/inspection\n * of debuggees.\n *\n * @param aHooks object\n *        An object with preNest and postNest methods for calling when entering\n *        and exiting a nested event loop, addToParentPool and\n *        removeFromParentPool methods for handling the lifetime of actors that\n *        will outlive the thread, like breakpoints.\n * @param aGlobal object [optional]\n *        An optional (for content debugging only) reference to the content\n *        window.\n */\nfunction ThreadActor(aHooks, aGlobal)\n{\n  this._state = \"detached\";\n  this._frameActors = [];\n  this._environmentActors = [];\n  this._hooks = aHooks;\n  this.global = aGlobal;\n  this._nestedEventLoops = new EventLoopStack({\n    inspector: DebuggerServer.xpcInspector,\n    hooks: aHooks,\n    thread: this\n  });\n  // A map of actorID -> actor for breakpoints created and managed by the server.\n  this._hiddenBreakpoints = new Map();\n\n  this.findGlobals = this.globalManager.findGlobals.bind(this);\n  this.onNewGlobal = this.globalManager.onNewGlobal.bind(this);\n  this.onNewSource = this.onNewSource.bind(this);\n  this._allEventsListener = this._allEventsListener.bind(this);\n\n  this._options = {\n    useSourceMaps: false\n  };\n}\n\n/**\n * The breakpoint store must be shared across instances of ThreadActor so that\n * page reloads don't blow away all of our breakpoints.\n */\nThreadActor.breakpointStore = new BreakpointStore();\n\nThreadActor.prototype = {\n  actorPrefix: \"context\",\n\n  get state() { return this._state; },\n  get attached() this.state == \"attached\" ||\n                 this.state == \"running\" ||\n                 this.state == \"paused\",\n\n  get breakpointStore() { return ThreadActor.breakpointStore; },\n\n  get threadLifetimePool() {\n    if (!this._threadLifetimePool) {\n      this._threadLifetimePool = new ActorPool(this.conn);\n      this.conn.addActorPool(this._threadLifetimePool);\n      this._threadLifetimePool.objectActors = new WeakMap();\n    }\n    return this._threadLifetimePool;\n  },\n\n  get sources() {\n    if (!this._sources) {\n      this._sources = new ThreadSources(this, this._options.useSourceMaps,\n                                        this._allowSource, this.onNewSource);\n    }\n    return this._sources;\n  },\n\n  /**\n   * Keep track of all of the nested event loops we use to pause the debuggee\n   * when we hit a breakpoint/debugger statement/etc in one place so we can\n   * resolve them when we get resume packets. We have more than one (and keep\n   * them in a stack) because we can pause within client evals.\n   */\n  _threadPauseEventLoops: null,\n  _pushThreadPause: function TA__pushThreadPause() {\n    if (!this._threadPauseEventLoops) {\n      this._threadPauseEventLoops = [];\n    }\n    const eventLoop = this._nestedEventLoops.push();\n    this._threadPauseEventLoops.push(eventLoop);\n    eventLoop.enter();\n  },\n  _popThreadPause: function TA__popThreadPause() {\n    const eventLoop = this._threadPauseEventLoops.pop();\n    dbg_assert(eventLoop, \"Should have an event loop.\");\n    eventLoop.resolve();\n  },\n\n  clearDebuggees: function TA_clearDebuggees() {\n    if (this.dbg) {\n      this.dbg.removeAllDebuggees();\n    }\n    this.conn.removeActorPool(this._threadLifetimePool || undefined);\n    this._threadLifetimePool = null;\n    this._sources = null;\n  },\n\n  /**\n   * Add a debuggee global to the Debugger object.\n   *\n   * @returns the Debugger.Object that corresponds to the global.\n   */\n  addDebuggee: function TA_addDebuggee(aGlobal) {\n    let globalDebugObject;\n    try {\n      globalDebugObject = this.dbg.addDebuggee(aGlobal);\n    } catch (e) {\n      // Ignore attempts to add the debugger's compartment as a debuggee.\n      dumpn(\"Ignoring request to add the debugger's compartment as a debuggee\");\n    }\n    return globalDebugObject;\n  },\n\n  /**\n   * Initialize the Debugger.\n   */\n  _initDebugger: function TA__initDebugger() {\n    this.dbg = new Debugger();\n    this.dbg.uncaughtExceptionHook = this.uncaughtExceptionHook.bind(this);\n    this.dbg.onDebuggerStatement = this.onDebuggerStatement.bind(this);\n    this.dbg.onNewScript = this.onNewScript.bind(this);\n    this.dbg.onNewGlobalObject = this.globalManager.onNewGlobal.bind(this);\n    // Keep the debugger disabled until a client attaches.\n    this.dbg.enabled = this._state != \"detached\";\n  },\n\n  /**\n   * Remove a debuggee global from the JSInspector.\n   */\n  removeDebugee: function TA_removeDebuggee(aGlobal) {\n    try {\n      this.dbg.removeDebuggee(aGlobal);\n    } catch(ex) {\n      // XXX: This debuggee has code currently executing on the stack,\n      // we need to save this for later.\n    }\n  },\n\n  /**\n   * Add the provided window and all windows in its frame tree as debuggees.\n   *\n   * @returns the Debugger.Object that corresponds to the window.\n   */\n  _addDebuggees: function TA__addDebuggees(aWindow) {\n    let globalDebugObject = this.addDebuggee(aWindow);\n    let frames = aWindow.frames;\n    if (frames) {\n      for (let i = 0; i < frames.length; i++) {\n        this._addDebuggees(frames[i]);\n      }\n    }\n    return globalDebugObject;\n  },\n\n  /**\n   * An object that will be used by ThreadActors to tailor their behavior\n   * depending on the debugging context being required (chrome or content).\n   */\n  globalManager: {\n    findGlobals: function TA_findGlobals() {\n      this.globalDebugObject = this._addDebuggees(this.global);\n    },\n\n    /**\n     * A function that the engine calls when a new global object has been\n     * created.\n     *\n     * @param aGlobal Debugger.Object\n     *        The new global object that was created.\n     */\n    onNewGlobal: function TA_onNewGlobal(aGlobal) {\n      // Content debugging only cares about new globals in the contant window,\n      // like iframe children.\n      if (aGlobal.hostAnnotations &&\n          aGlobal.hostAnnotations.type == \"document\" &&\n          aGlobal.hostAnnotations.element === this.global) {\n        this.addDebuggee(aGlobal);\n        // Notify the client.\n        this.conn.send({\n          from: this.actorID,\n          type: \"newGlobal\",\n          // TODO: after bug 801084 lands see if we need to JSONify this.\n          hostAnnotations: aGlobal.hostAnnotations\n        });\n      }\n    }\n  },\n\n  disconnect: function TA_disconnect() {\n    dumpn(\"in ThreadActor.prototype.disconnect\");\n    if (this._state == \"paused\") {\n      this.onResume();\n    }\n\n    this._state = \"exited\";\n\n    this.clearDebuggees();\n\n    if (!this.dbg) {\n      return;\n    }\n    this.dbg.enabled = false;\n    this.dbg = null;\n  },\n\n  /**\n   * Disconnect the debugger and put the actor in the exited state.\n   */\n  exit: function TA_exit() {\n    this.disconnect();\n  },\n\n  // Request handlers\n  onAttach: function TA_onAttach(aRequest) {\n    if (this.state === \"exited\") {\n      return { type: \"exited\" };\n    }\n\n    if (this.state !== \"detached\") {\n      return { error: \"wrongState\" };\n    }\n\n    this._state = \"attached\";\n\n    update(this._options, aRequest.options || {});\n\n    if (!this.dbg) {\n      this._initDebugger();\n    }\n    this.findGlobals();\n    this.dbg.enabled = true;\n    try {\n      // Put ourselves in the paused state.\n      let packet = this._paused();\n      if (!packet) {\n        return { error: \"notAttached\" };\n      }\n      packet.why = { type: \"attached\" };\n\n      this._restoreBreakpoints();\n\n      // Send the response to the attach request now (rather than\n      // returning it), because we're going to start a nested event loop\n      // here.\n      this.conn.send(packet);\n\n      // Start a nested event loop.\n      this._pushThreadPause();\n\n      // We already sent a response to this request, don't send one\n      // now.\n      return null;\n    } catch (e) {\n      reportError(e);\n      return { error: \"notAttached\", message: e.toString() };\n    }\n  },\n\n  onDetach: function TA_onDetach(aRequest) {\n    this.disconnect();\n    dumpn(\"ThreadActor.prototype.onDetach: returning 'detached' packet\");\n    return {\n      type: \"detached\"\n    };\n  },\n\n  onReconfigure: function TA_onReconfigure(aRequest) {\n    if (this.state == \"exited\") {\n      return { error: \"wrongState\" };\n    }\n\n    update(this._options, aRequest.options || {});\n    // Clear existing sources, so they can be recreated on next access.\n    this._sources = null;\n\n    return {};\n  },\n\n  /**\n   * Pause the debuggee, by entering a nested event loop, and return a 'paused'\n   * packet to the client.\n   *\n   * @param Debugger.Frame aFrame\n   *        The newest debuggee frame in the stack.\n   * @param object aReason\n   *        An object with a 'type' property containing the reason for the pause.\n   * @param function onPacket\n   *        Hook to modify the packet before it is sent. Feel free to return a\n   *        promise.\n   */\n  _pauseAndRespond: function TA__pauseAndRespond(aFrame, aReason,\n                                                 onPacket=function (k) { return k; }) {\n    try {\n      let packet = this._paused(aFrame);\n      if (!packet) {\n        return undefined;\n      }\n      packet.why = aReason;\n\n      let { url, line, column } = packet.frame.where;\n      this.sources.getOriginalLocation(url, line, column).then(aOrigPosition => {\n        packet.frame.where = aOrigPosition;\n        resolve(onPacket(packet))\n          .then(null, error => {\n            reportError(error);\n            return {\n              error: \"unknownError\",\n              message: error.message + \"\\n\" + error.stack\n            };\n          })\n          .then(packet => {\n            this.conn.send(packet)\n          });\n      });\n\n      this._pushThreadPause();\n    } catch(e) {\n      reportError(e, \"Got an exception during TA__pauseAndRespond: \");\n    }\n\n    return undefined;\n  },\n\n  /**\n   * Handle a protocol request to resume execution of the debuggee.\n   */\n  onResume: function TA_onResume(aRequest) {\n    if (this._state !== \"paused\") {\n      return {\n        error: \"wrongState\",\n        message: \"Can't resume when debuggee isn't paused. Current state is '\"\n          + this._state + \"'\"\n      };\n    }\n\n    // In case of multiple nested event loops (due to multiple debuggers open in\n    // different tabs or multiple debugger clients connected to the same tab)\n    // only allow resumption in a LIFO order.\n    // James commented\n    // if (this._nestedEventLoops.size && this._nestedEventLoops.lastPausedUrl\n    //     && this._nestedEventLoops.lastPausedUrl !== this._hooks.url) {\n    //   return {\n    //     error: \"wrongOrder\",\n    //     message: \"trying to resume in the wrong order.\",\n    //     lastPausedUrl: this._nestedEventLoops.lastPausedUrl\n    //   };\n    // }\n\n    if (aRequest && aRequest.forceCompletion) {\n      // TODO: remove this when Debugger.Frame.prototype.pop is implemented in\n      // bug 736733.\n      if (typeof this.frame.pop != \"function\") {\n        return { error: \"notImplemented\",\n                 message: \"forced completion is not yet implemented.\" };\n      }\n\n      this.dbg.getNewestFrame().pop(aRequest.completionValue);\n      let packet = this._resumed();\n      this._popThreadPause();\n      return { type: \"resumeLimit\", frameFinished: aRequest.forceCompletion };\n    }\n\n    if (aRequest && aRequest.resumeLimit) {\n      // Bind these methods because some of the hooks are called with 'this'\n      // set to the current frame.\n      let pauseAndRespond = (aFrame, onPacket=function (k) k) => {\n        this._pauseAndRespond(aFrame, { type: \"resumeLimit\" }, onPacket);\n      };\n      let createValueGrip = this.createValueGrip.bind(this);\n\n      let startFrame = this.youngestFrame;\n      let startLine;\n      if (this.youngestFrame.script) {\n        let offset = this.youngestFrame.offset;\n        startLine = this.youngestFrame.script.getOffsetLine(offset);\n      }\n\n      // Define the JS hook functions for stepping.\n\n      let onEnterFrame = aFrame => {\n        let { url } = this.synchronize(this.sources.getOriginalLocation(\n          aFrame.script.url,\n          aFrame.script.getOffsetLine(aFrame.offset),\n          getOffsetColumn(aFrame.offset, aFrame.script)));\n\n        return this.sources.isBlackBoxed(url)\n          ? undefined\n          : pauseAndRespond(aFrame);\n      };\n\n      let thread = this;\n\n      let onPop = function TA_onPop(aCompletion) {\n        // onPop is called with 'this' set to the current frame.\n\n        let { url } = thread.synchronize(thread.sources.getOriginalLocation(\n          this.script.url,\n          this.script.getOffsetLine(this.offset),\n          getOffsetColumn(this.offset, this.script)));\n\n        if (thread.sources.isBlackBoxed(url)) {\n          return undefined;\n        }\n\n        // Note that we're popping this frame; we need to watch for\n        // subsequent step events on its caller.\n        this.reportedPop = true;\n\n        return pauseAndRespond(this, aPacket => {\n          aPacket.why.frameFinished = {};\n          if (!aCompletion) {\n            aPacket.why.frameFinished.terminated = true;\n          } else if (aCompletion.hasOwnProperty(\"return\")) {\n            aPacket.why.frameFinished.return = createValueGrip(aCompletion.return);\n          } else if (aCompletion.hasOwnProperty(\"yield\")) {\n            aPacket.why.frameFinished.return = createValueGrip(aCompletion.yield);\n          } else {\n            aPacket.why.frameFinished.throw = createValueGrip(aCompletion.throw);\n          }\n          return aPacket;\n        });\n      };\n\n      let onStep = function TA_onStep() {\n        // onStep is called with 'this' set to the current frame.\n\n        let { url } = thread.synchronize(thread.sources.getOriginalLocation(\n          this.script.url,\n          this.script.getOffsetLine(this.offset),\n          getOffsetColumn(this.offset, this.script)));\n\n        if (thread.sources.isBlackBoxed(url)) {\n          return undefined;\n        }\n\n        // If we've changed frame or line, then report that.\n        if (this !== startFrame ||\n            (this.script &&\n             this.script.getOffsetLine(this.offset) != startLine)) {\n          return pauseAndRespond(this);\n        }\n\n        // Otherwise, let execution continue.\n        return undefined;\n      };\n\n      let steppingType = aRequest.resumeLimit.type;\n      if ([\"step\", \"next\", \"finish\"].indexOf(steppingType) == -1) {\n            return { error: \"badParameterType\",\n                     message: \"Unknown resumeLimit type\" };\n      }\n      // Make sure there is still a frame on the stack if we are to continue\n      // stepping.\n      let stepFrame = this._getNextStepFrame(startFrame);\n      if (stepFrame) {\n        switch (steppingType) {\n          case \"step\":\n            this.dbg.onEnterFrame = onEnterFrame;\n            // Fall through.\n          case \"next\":\n            stepFrame.onStep = onStep;\n            stepFrame.onPop = onPop;\n            break;\n          case \"finish\":\n            stepFrame.onPop = onPop;\n        }\n      }\n    } else {\n      // Clear any previous stepping hooks on a plain resumption.\n      let frame = this.youngestFrame;\n      while (frame) {\n        frame.onStep = undefined;\n        frame.onPop = undefined;\n        frame = frame.older;\n      }\n    }\n\n    if (aRequest) {\n      this._options.pauseOnExceptions = aRequest.pauseOnExceptions;\n      this.maybePauseOnExceptions();\n      // Break-on-DOMEvents is only supported in content debugging.\n      let events = aRequest.pauseOnDOMEvents;\n      if (this.global && events &&\n          (events == \"*\" ||\n          (Array.isArray(events) && events.length))) {\n        //James: Skip Dom event.\n        // this._pauseOnDOMEvents = events;\n        // let els = Cc[\"@mozilla.org/eventlistenerservice;1\"]\n        //           .getService(Ci.nsIEventListenerService);\n        // els.addListenerForAllEvents(this.global, this._allEventsListener, true);\n      }\n    }\n\n    let packet = this._resumed();\n    this._popThreadPause();\n    return packet;\n  },\n\n  /**\n   * Spin up a nested event loop so we can synchronously resolve a promise.\n   *\n   * @param aPromise\n   *        The promise we want to resolve.\n   * @returns The promise's resolution.\n   */\n  synchronize: function(aPromise) {\n    let needNest = true;\n    let eventLoop;\n    let returnVal;\n\n    aPromise\n      .then((aResolvedVal) => {\n        needNest = false;\n        returnVal = aResolvedVal;\n      })\n      .then(null, (aError) => {\n        reportError(aError, \"Error inside synchronize:\");\n      })\n      .then(() => {\n        if (eventLoop) {\n          eventLoop.resolve();\n        }\n      });\n\n    if (needNest) {\n      eventLoop = this._nestedEventLoops.push();\n      eventLoop.enter();\n    }\n\n    return returnVal;\n  },\n\n  /**\n   * Set the debugging hook to pause on exceptions if configured to do so.\n   */\n  maybePauseOnExceptions: function() {\n    if (this._options.pauseOnExceptions) {\n      this.dbg.onExceptionUnwind = this.onExceptionUnwind.bind(this);\n    }\n  },\n\n  /**\n   * A listener that gets called for every event fired on the page, when a list\n   * of interesting events was provided with the pauseOnDOMEvents property. It\n   * is used to set server-managed breakpoints on any existing event listeners\n   * for those events.\n   *\n   * @param Event event\n   *        The event that was fired.\n   */\n  _allEventsListener: function(event) {\n    if (this._pauseOnDOMEvents == \"*\" ||\n        this._pauseOnDOMEvents.indexOf(event.type) != -1) {\n      for (let listener of this._getAllEventListeners(event.target)) {\n        if (event.type == listener.type || this._pauseOnDOMEvents == \"*\") {\n          this._breakOnEnter(listener.script);\n        }\n      }\n    }\n  },\n\n  /**\n   * Return an array containing all the event listeners attached to the\n   * specified event target and its ancestors in the event target chain.\n   *\n   * @param EventTarget eventTarget\n   *        The target the event was dispatched on.\n   * @returns Array\n   */\n  _getAllEventListeners: function(eventTarget) {\n    let els = Cc[\"@mozilla.org/eventlistenerservice;1\"]\n                .getService(Ci.nsIEventListenerService);\n\n    let targets = els.getEventTargetChainFor(eventTarget);\n    let listeners = [];\n\n    for (let target of targets) {\n      let handlers = els.getListenerInfoFor(target);\n      for (let handler of handlers) {\n        // Null is returned for all-events handlers, and native event listeners\n        // don't provide any listenerObject, which makes them not that useful to\n        // a JS debugger.\n        if (!handler || !handler.listenerObject || !handler.type)\n          continue;\n        // Create a listener-like object suitable for our purposes.\n        let l = Object.create(null);\n        l.type = handler.type;\n        let listener = handler.listenerObject;\n        l.script = this.globalDebugObject.makeDebuggeeValue(listener).script;\n        // Chrome listeners won't be converted to debuggee values, since their\n        // compartment is not added as a debuggee.\n        if (!l.script)\n          continue;\n        listeners.push(l);\n      }\n    }\n    return listeners;\n  },\n\n  /**\n   * Set a breakpoint on the first bytecode offset in the provided script.\n   */\n  _breakOnEnter: function(script) {\n    let offsets = script.getAllOffsets();\n    for (let line = 0, n = offsets.length; line < n; line++) {\n      if (offsets[line]) {\n        let location = { url: script.url, line: line };\n        let resp = this._createAndStoreBreakpoint(location);\n        dbg_assert(!resp.actualLocation, \"No actualLocation should be returned\");\n        if (resp.error) {\n          reportError(new Error(\"Unable to set breakpoint on event listener\"));\n          return;\n        }\n        let bp = this.breakpointStore.getBreakpoint(location);\n        let bpActor = bp.actor;\n        dbg_assert(bp, \"Breakpoint must exist\");\n        dbg_assert(bpActor, \"Breakpoint actor must be created\");\n        this._hiddenBreakpoints.set(bpActor.actorID, bpActor);\n        break;\n      }\n    }\n  },\n\n  /**\n   * Helper method that returns the next frame when stepping.\n   */\n  _getNextStepFrame: function TA__getNextStepFrame(aFrame) {\n    let stepFrame = aFrame.reportedPop ? aFrame.older : aFrame;\n    if (!stepFrame || !stepFrame.script) {\n      stepFrame = null;\n    }\n    return stepFrame;\n  },\n\n  onClientEvaluate: function TA_onClientEvaluate(aRequest) {\n    if (this.state !== \"paused\") {\n      return { error: \"wrongState\",\n               message: \"Debuggee must be paused to evaluate code.\" };\n    };\n\n    let frame = this._requestFrame(aRequest.frame);\n    if (!frame) {\n      return { error: \"unknownFrame\",\n               message: \"Evaluation frame not found\" };\n    }\n\n    if (!frame.environment) {\n      return { error: \"notDebuggee\",\n               message: \"cannot access the environment of this frame.\" };\n    };\n\n    // We'll clobber the youngest frame if the eval causes a pause, so\n    // save our frame now to be restored after eval returns.\n    // XXX: or we could just start using dbg.getNewestFrame() now that it\n    // works as expected.\n    let youngest = this.youngestFrame;\n\n    // Put ourselves back in the running state and inform the client.\n    let resumedPacket = this._resumed();\n    this.conn.send(resumedPacket);\n\n    // Run the expression.\n    // XXX: test syntax errors\n    let completion = frame.eval(aRequest.expression);\n\n    // Put ourselves back in the pause state.\n    let packet = this._paused(youngest);\n    packet.why = { type: \"clientEvaluated\",\n                   frameFinished: this.createProtocolCompletionValue(completion) };\n\n    // Return back to our previous pause's event loop.\n    return packet;\n  },\n\n  onFrames: function TA_onFrames(aRequest) {\n    if (this.state !== \"paused\") {\n      return { error: \"wrongState\",\n               message: \"Stack frames are only available while the debuggee is paused.\"};\n    }\n\n    let start = aRequest.start ? aRequest.start : 0;\n    let count = aRequest.count;\n\n    // Find the starting frame...\n    let frame = this.youngestFrame;\n    let i = 0;\n    while (frame && (i < start)) {\n      frame = frame.older;\n      i++;\n    }\n\n    // Return request.count frames, or all remaining\n    // frames if count is not defined.\n    let frames = [];\n    let promises = [];\n    for (; frame && (!count || i < (start + count)); i++, frame=frame.older) {\n      let form = this._createFrameActor(frame).form();\n      form.depth = i;\n      frames.push(form);\n\n      let { url, line, column } = form.where;\n      let promise = this.sources.getOriginalLocation(url, line, column)\n        .then((aOrigLocation) => {\n          form.where = aOrigLocation;\n          let source = this.sources.source(form.where.url);\n          if (source) {\n            form.source = source.form();\n          }\n        });\n      promises.push(promise);\n    }\n\n    return all(promises).then(function () {\n      return { frames: frames };\n    });\n  },\n\n  onReleaseMany: function TA_onReleaseMany(aRequest) {\n    if (!aRequest.actors) {\n      return { error: \"missingParameter\",\n               message: \"no actors were specified\" };\n    }\n\n    let res;\n    for each (let actorID in aRequest.actors) {\n      let actor = this.threadLifetimePool.get(actorID);\n      if (!actor) {\n        if (!res) {\n          res = { error: \"notReleasable\",\n                  message: \"Only thread-lifetime actors can be released.\" };\n        }\n        continue;\n      }\n      actor.onRelease();\n    }\n    return res ? res : {};\n  },\n\n  /**\n   * Handle a protocol request to set a breakpoint.\n   */\n  onSetBreakpoint: function TA_onSetBreakpoint(aRequest) {\n    if (this.state !== \"paused\") {\n      return { error: \"wrongState\",\n               message: \"Breakpoints can only be set while the debuggee is paused.\"};\n    }\n\n    let { url: originalSource,\n          line: originalLine,\n          column: originalColumn } = aRequest.location;\n\n    let locationPromise = this.sources.getGeneratedLocation(originalSource,\n                                                            originalLine,\n                                                            originalColumn);\n    return locationPromise.then(({url, line, column}) => {\n      if (line == null ||\n          line < 0 ||\n          this.dbg.findScripts({ url: url }).length == 0) {\n        return { error: \"noScript\" };\n      }\n\n      let response = this._createAndStoreBreakpoint({\n        url: url,\n        line: line,\n        column: column\n      });\n      // If the original location of our generated location is different from\n      // the original location we attempted to set the breakpoint on, we will\n      // need to know so that we can set actualLocation on the response.\n      let originalLocation = this.sources.getOriginalLocation(url, line, column);\n\n      return all([response, originalLocation])\n        .then(([aResponse, {url, line}]) => {\n          if (aResponse.actualLocation) {\n            let actualOrigLocation = this.sources.getOriginalLocation(\n              aResponse.actualLocation.url,\n              aResponse.actualLocation.line,\n              aResponse.actualLocation.column);\n            return actualOrigLocation.then(function ({ url, line, column }) {\n              if (url !== originalSource\n                  || line !== originalLine\n                  || column !== originalColumn) {\n                aResponse.actualLocation = {\n                  url: url,\n                  line: line,\n                  column: column\n                };\n              }\n              return aResponse;\n            });\n          }\n\n          if (url !== originalSource || line !== originalLine) {\n            aResponse.actualLocation = { url: url, line: line };\n          }\n\n          return aResponse;\n        });\n    });\n  },\n\n  /**\n   * Create a breakpoint at the specified location and store it in the\n   * cache. Takes ownership of `aLocation`.\n   *\n   * @param Object aLocation\n   *        An object of the form { url, line[, column] }\n   */\n  _createAndStoreBreakpoint: function (aLocation) {\n    // Add the breakpoint to the store for later reuse, in case it belongs to a\n    // script that hasn't appeared yet.\n    this.breakpointStore.addBreakpoint(aLocation);\n    return this._setBreakpoint(aLocation);\n  },\n\n  /**\n   * Set a breakpoint using the jsdbg2 API. If the line on which the breakpoint\n   * is being set contains no code, then the breakpoint will slide down to the\n   * next line that has runnable code. In this case the server breakpoint cache\n   * will be updated, so callers that iterate over the breakpoint cache should\n   * take that into account.\n   *\n   * @param object aLocation\n   *        The location of the breakpoint (in the generated source, if source\n   *        mapping).\n   */\n  _setBreakpoint: function TA__setBreakpoint(aLocation) {\n    let actor;\n    let storedBp = this.breakpointStore.getBreakpoint(aLocation);\n    if (storedBp.actor) {\n      actor = storedBp.actor;\n    } else {\n      storedBp.actor = actor = new BreakpointActor(this, {\n        url: aLocation.url,\n        line: aLocation.line,\n        column: aLocation.column\n      });\n      this._hooks.addToParentPool(actor);\n    }\n\n    // Find all scripts matching the given location\n    let scripts = this.dbg.findScripts(aLocation);\n    if (scripts.length == 0) {\n      return {\n        error: \"noScript\",\n        actor: actor.actorID\n      };\n    }\n\n   /**\n    * For each script, if the given line has at least one entry point, set a\n    * breakpoint on the bytecode offets for each of them.\n    */\n\n    // Debugger.Script -> array of offset mappings\n    let scriptsAndOffsetMappings = new Map();\n\n    for (let script of scripts) {\n      this._findClosestOffsetMappings(aLocation,\n                                      script,\n                                      scriptsAndOffsetMappings);\n    }\n\n    if (scriptsAndOffsetMappings.size > 0) {\n      for (let [script, mappings] of scriptsAndOffsetMappings) {\n        for (let offsetMapping of mappings) {\n          script.setBreakpoint(offsetMapping.offset, actor);\n        }\n        actor.addScript(script, this);\n      }\n\n      return {\n        actor: actor.actorID\n      };\n    }\n\n   /**\n    * If we get here, no breakpoint was set. This is because the given line\n    * has no entry points, for example because it is empty. As a fallback\n    * strategy, we try to set the breakpoint on the smallest line greater\n    * than or equal to the given line that as at least one entry point.\n    */\n\n    // Find all innermost scripts matching the given location\n    let scripts = this.dbg.findScripts({\n      url: aLocation.url,\n      line: aLocation.line,\n      innermost: true\n    });\n\n    /**\n     * For each innermost script, look for the smallest line greater than or\n     * equal to the given line that has one or more entry points. If found, set\n     * a breakpoint on the bytecode offset for each of its entry points.\n     */\n    let actualLocation;\n    let found = false;\n    for (let script of scripts) {\n      let offsets = script.getAllOffsets();\n      for (let line = aLocation.line; line < offsets.length; ++line) {\n        if (offsets[line]) {\n          for (let offset of offsets[line]) {\n            script.setBreakpoint(offset, actor);\n          }\n          actor.addScript(script, this);\n          if (!actualLocation) {\n            actualLocation = {\n              url: aLocation.url,\n              line: line,\n              column: 0\n            };\n          }\n          found = true;\n          break;\n        }\n      }\n    }\n    if (found) {\n      let existingBp = this.breakpointStore.hasBreakpoint(actualLocation);\n\n      if (existingBp && existingBp.actor) {\n        /**\n         * We already have a breakpoint actor for the actual location, so\n         * actor we created earlier is now redundant. Delete it, update the\n         * breakpoint store, and return the actor for the actual location.\n         */\n        actor.onDelete();\n        this.breakpointStore.removeBreakpoint(aLocation);\n        return {\n          actor: existingBp.actor.actorID,\n          actualLocation: actualLocation\n        };\n      } else {\n        /**\n         * We don't have a breakpoint actor for the actual location yet.\n         * Instead or creating a new actor, reuse the actor we created earlier,\n         * and update the breakpoint store.\n         */\n        actor.location = actualLocation;\n        this.breakpointStore.addBreakpoint({\n          actor: actor,\n          url: actualLocation.url,\n          line: actualLocation.line,\n          column: actualLocation.column\n        });\n        this.breakpointStore.removeBreakpoint(aLocation);\n        return {\n          actor: actor.actorID,\n          actualLocation: actualLocation\n        };\n      }\n    }\n\n    /**\n     * If we get here, no line matching the given line was found, so just\n     * fail epically.\n     */\n    return {\n      error: \"noCodeAtLineColumn\",\n      actor: actor.actorID\n    };\n  },\n\n  /**\n   * Find all of the offset mappings associated with `aScript` that are closest\n   * to `aTargetLocation`. If new offset mappings are found that are closer to\n   * `aTargetOffset` than the existing offset mappings inside\n   * `aScriptsAndOffsetMappings`, we empty that map and only consider the\n   * closest offset mappings. If there is no column in `aTargetLocation`, we add\n   * all offset mappings that are on the given line.\n   *\n   * @param Object aTargetLocation\n   *        An object of the form { url, line[, column] }.\n   * @param Debugger.Script aScript\n   *        The script in which we are searching for offsets.\n   * @param Map aScriptsAndOffsetMappings\n   *        A Map object which maps Debugger.Script instances to arrays of\n   *        offset mappings. This is an out param.\n   */\n  _findClosestOffsetMappings: function TA__findClosestOffsetMappings(aTargetLocation,\n                                                                     aScript,\n                                                                     aScriptsAndOffsetMappings) {\n    let offsetMappings = aScript.getAllColumnOffsets()\n      .filter(({ lineNumber }) => lineNumber === aTargetLocation.line);\n\n    // If we are given a column, we will try and break only at that location,\n    // otherwise we will break anytime we get on that line.\n\n    if (aTargetLocation.column == null) {\n      if (offsetMappings.length) {\n        aScriptsAndOffsetMappings.set(aScript, offsetMappings);\n      }\n      return;\n    }\n\n    // Attempt to find the current closest offset distance from the target\n    // location by grabbing any offset mapping in the map by doing one iteration\n    // and then breaking (they all have the same distance from the target\n    // location).\n    let closestDistance = Infinity;\n    if (aScriptsAndOffsetMappings.size) {\n      for (let mappings of aScriptsAndOffsetMappings.values()) {\n        closestDistance = Math.abs(aTargetLocation.column - mappings[0].columnNumber);\n        break;\n      }\n    }\n\n    for (let mapping of offsetMappings) {\n      let currentDistance = Math.abs(aTargetLocation.column - mapping.columnNumber);\n\n      if (currentDistance > closestDistance) {\n        continue;\n      } else if (currentDistance < closestDistance) {\n        closestDistance = currentDistance;\n        aScriptsAndOffsetMappings.clear();\n        aScriptsAndOffsetMappings.set(aScript, [mapping]);\n      } else {\n        if (!aScriptsAndOffsetMappings.has(aScript)) {\n          aScriptsAndOffsetMappings.set(aScript, []);\n        }\n        aScriptsAndOffsetMappings.get(aScript).push(mapping);\n      }\n    }\n  },\n\n  /**\n   * Get the script and source lists from the debugger.\n   *\n   * TODO bug 637572: we should be dealing with sources directly, not inferring\n   * them through scripts.\n   */\n  _discoverSources: function TA__discoverSources() {\n    // Only get one script per url.\n    let scriptsByUrl = {};\n    for (let s of this.dbg.findScripts()) {\n      scriptsByUrl[s.url] = s;\n    }\n\n    return all([this.sources.sourcesForScript(scriptsByUrl[s])\n                for (s of Object.keys(scriptsByUrl))]);\n  },\n\n  onSources: function TA_onSources(aRequest) {\n    return this._discoverSources().then(() => {\n      return {\n        sources: [s.form() for (s of this.sources.iter())]\n      };\n    });\n  },\n\n  /**\n   * Disassociate all breakpoint actors from their scripts and clear the\n   * breakpoint handlers. This method can be used when the thread actor intends\n   * to keep the breakpoint store, but needs to clear any actual breakpoints,\n   * e.g. due to a page navigation. This way the breakpoint actors' script\n   * caches won't hold on to the Debugger.Script objects leaking memory.\n   */\n  disableAllBreakpoints: function () {\n    for (let bp of this.breakpointStore.findBreakpoints()) {\n      if (bp.actor) {\n        bp.actor.removeScripts();\n      }\n    }\n  },\n\n  /**\n   * Handle a protocol request to pause the debuggee.\n   */\n  onInterrupt: function TA_onInterrupt(aRequest) {\n    if (this.state == \"exited\") {\n      return { type: \"exited\" };\n    } else if (this.state == \"paused\") {\n      // TODO: return the actual reason for the existing pause.\n      return { type: \"paused\", why: { type: \"alreadyPaused\" } };\n    } else if (this.state != \"running\") {\n      return { error: \"wrongState\",\n               message: \"Received interrupt request in \" + this.state +\n                        \" state.\" };\n    }\n\n    try {\n      // Put ourselves in the paused state.\n      let packet = this._paused();\n      if (!packet) {\n        return { error: \"notInterrupted\" };\n      }\n      packet.why = { type: \"interrupted\" };\n\n      // Send the response to the interrupt request now (rather than\n      // returning it), because we're going to start a nested event loop\n      // here.\n      this.conn.send(packet);\n\n      // Start a nested event loop.\n      this._pushThreadPause();\n\n      // We already sent a response to this request, don't send one\n      // now.\n      return null;\n    } catch (e) {\n      reportError(e);\n      return { error: \"notInterrupted\", message: e.toString() };\n    }\n  },\n\n  /**\n   * Handle a protocol request to retrieve all the event listeners on the page.\n   */\n  onEventListeners: function TA_onEventListeners(aRequest) {\n    // This request is only supported in content debugging.\n    if (!this.global) {\n      return {\n        error: \"notImplemented\",\n        message: \"eventListeners request is only supported in content debugging\"\n      }\n    }\n\n    let els = Cc[\"@mozilla.org/eventlistenerservice;1\"]\n                .getService(Ci.nsIEventListenerService);\n\n    let nodes = this.global.document.getElementsByTagName(\"*\");\n    nodes = [this.global].concat([].slice.call(nodes));\n    let listeners = [];\n\n    for (let node of nodes) {\n      let handlers = els.getListenerInfoFor(node);\n\n      for (let handler of handlers) {\n        // Create a form object for serializing the listener via the protocol.\n        let listenerForm = Object.create(null);\n        let listener = handler.listenerObject;\n        // Native event listeners don't provide any listenerObject and are not\n        // that useful to a JS debugger.\n        if (!listener) {\n          continue;\n        }\n\n        // There will be no tagName if the event listener is set on the window.\n        let selector = node.tagName ? findCssSelector(node) : \"window\";\n        let nodeDO = this.globalDebugObject.makeDebuggeeValue(node);\n        listenerForm.node = {\n          selector: selector,\n          object: this.createValueGrip(nodeDO)\n        };\n        listenerForm.type = handler.type;\n        listenerForm.capturing = handler.capturing;\n        listenerForm.allowsUntrusted = handler.allowsUntrusted;\n        listenerForm.inSystemEventGroup = handler.inSystemEventGroup;\n        listenerForm.isEventHandler = !!node[\"on\" + listenerForm.type];\n        // Get the Debugger.Object for the listener object.\n        let listenerDO = this.globalDebugObject.makeDebuggeeValue(listener);\n        listenerForm.function = this.createValueGrip(listenerDO);\n        listeners.push(listenerForm);\n      }\n    }\n    return { listeners: listeners };\n  },\n\n  /**\n   * Return the Debug.Frame for a frame mentioned by the protocol.\n   */\n  _requestFrame: function TA_requestFrame(aFrameID) {\n    if (!aFrameID) {\n      return this.youngestFrame;\n    }\n\n    if (this._framePool.has(aFrameID)) {\n      return this._framePool.get(aFrameID).frame;\n    }\n\n    return undefined;\n  },\n\n  _paused: function TA__paused(aFrame) {\n    // We don't handle nested pauses correctly.  Don't try - if we're\n    // paused, just continue running whatever code triggered the pause.\n    // We don't want to actually have nested pauses (although we\n    // have nested event loops).  If code runs in the debuggee during\n    // a pause, it should cause the actor to resume (dropping\n    // pause-lifetime actors etc) and then repause when complete.\n\n    if (this.state === \"paused\") {\n      return undefined;\n    }\n\n    // Clear stepping hooks.\n    this.dbg.onEnterFrame = undefined;\n    this.dbg.onExceptionUnwind = undefined;\n    if (aFrame) {\n      aFrame.onStep = undefined;\n      aFrame.onPop = undefined;\n    }\n    // Clear DOM event breakpoints.\n    // XPCShell tests don't use actual DOM windows for globals and cause\n    // removeListenerForAllEvents to throw.\n    if (this.global && !this.global.toString().contains(\"Sandbox\")) {\n      //James: Skip Dom Event.\n      // let els = Cc[\"@mozilla.org/eventlistenerservice;1\"]\n      //           .getService(Ci.nsIEventListenerService);\n      // els.removeListenerForAllEvents(this.global, this._allEventsListener, true);\n      for (let [,bp] of this._hiddenBreakpoints) {\n        bp.onDelete();\n      }\n      this._hiddenBreakpoints.clear();\n    }\n\n    this._state = \"paused\";\n\n    // Save the pause frame (if any) as the youngest frame for\n    // stack viewing.\n    this.youngestFrame = aFrame;\n\n    // Create the actor pool that will hold the pause actor and its\n    // children.\n    dbg_assert(!this._pausePool, \"No pause pool should exist yet\");\n    this._pausePool = new ActorPool(this.conn);\n    this.conn.addActorPool(this._pausePool);\n\n    // Give children of the pause pool a quick link back to the\n    // thread...\n    this._pausePool.threadActor = this;\n\n    // Create the pause actor itself...\n    dbg_assert(!this._pauseActor, \"No pause actor should exist yet\");\n    this._pauseActor = new PauseActor(this._pausePool);\n    this._pausePool.addActor(this._pauseActor);\n\n    // Update the list of frames.\n    let poppedFrames = this._updateFrames();\n\n    // Send off the paused packet and spin an event loop.\n    let packet = { from: this.actorID,\n                   type: \"paused\",\n                   actor: this._pauseActor.actorID };\n    if (aFrame) {\n      packet.frame = this._createFrameActor(aFrame).form();\n    }\n\n    if (poppedFrames) {\n      packet.poppedFrames = poppedFrames;\n    }\n\n    return packet;\n  },\n\n  _resumed: function TA_resumed() {\n    this._state = \"running\";\n\n    // Drop the actors in the pause actor pool.\n    this.conn.removeActorPool(this._pausePool);\n\n    this._pausePool = null;\n    this._pauseActor = null;\n    this.youngestFrame = null;\n\n    return { from: this.actorID, type: \"resumed\" };\n  },\n\n  /**\n   * Expire frame actors for frames that have been popped.\n   *\n   * @returns A list of actor IDs whose frames have been popped.\n   */\n  _updateFrames: function TA_updateFrames() {\n    let popped = [];\n\n    // Create the actor pool that will hold the still-living frames.\n    let framePool = new ActorPool(this.conn);\n    let frameList = [];\n\n    for each (let frameActor in this._frameActors) {\n      if (frameActor.frame.live) {\n        framePool.addActor(frameActor);\n        frameList.push(frameActor);\n      } else {\n        popped.push(frameActor.actorID);\n      }\n    }\n\n    // Remove the old frame actor pool, this will expire\n    // any actors that weren't added to the new pool.\n    if (this._framePool) {\n      this.conn.removeActorPool(this._framePool);\n    }\n\n    this._frameActors = frameList;\n    this._framePool = framePool;\n    this.conn.addActorPool(framePool);\n\n    return popped;\n  },\n\n  _createFrameActor: function TA_createFrameActor(aFrame) {\n    if (aFrame.actor) {\n      return aFrame.actor;\n    }\n\n    let actor = new FrameActor(aFrame, this);\n    this._frameActors.push(actor);\n    this._framePool.addActor(actor);\n    aFrame.actor = actor;\n\n    return actor;\n  },\n\n  /**\n   * Create and return an environment actor that corresponds to the provided\n   * Debugger.Environment.\n   * @param Debugger.Environment aEnvironment\n   *        The lexical environment we want to extract.\n   * @param object aPool\n   *        The pool where the newly-created actor will be placed.\n   * @return The EnvironmentActor for aEnvironment or undefined for host\n   *         functions or functions scoped to a non-debuggee global.\n   */\n  createEnvironmentActor:\n  function TA_createEnvironmentActor(aEnvironment, aPool) {\n    if (!aEnvironment) {\n      return undefined;\n    }\n\n    if (aEnvironment.actor) {\n      return aEnvironment.actor;\n    }\n\n    let actor = new EnvironmentActor(aEnvironment, this);\n    this._environmentActors.push(actor);\n    aPool.addActor(actor);\n    aEnvironment.actor = actor;\n\n    return actor;\n  },\n\n  /**\n   * Create a grip for the given debuggee value.  If the value is an\n   * object, will create an actor with the given lifetime.\n   */\n  createValueGrip: function TA_createValueGrip(aValue, aPool=false) {\n    if (!aPool) {\n      aPool = this._pausePool;\n    }\n    let type = typeof(aValue);\n\n    if (type === \"string\" && this._stringIsLong(aValue)) {\n      return this.longStringGrip(aValue, aPool);\n    }\n\n    if (type === \"boolean\" || type === \"string\" || type === \"number\") {\n      return aValue;\n    }\n\n    if (aValue === null) {\n      return { type: \"null\" };\n    }\n\n    if (aValue === undefined) {\n      return { type: \"undefined\" }\n    }\n\n    if (typeof(aValue) === \"object\") {\n      return this.objectGrip(aValue, aPool);\n    }\n\n    dbg_assert(false, \"Failed to provide a grip for: \" + aValue);\n    return null;\n  },\n\n  /**\n   * Return a protocol completion value representing the given\n   * Debugger-provided completion value.\n   */\n  createProtocolCompletionValue:\n  function TA_createProtocolCompletionValue(aCompletion) {\n    let protoValue = {};\n    if (\"return\" in aCompletion) {\n      protoValue.return = this.createValueGrip(aCompletion.return);\n    } else if (\"yield\" in aCompletion) {\n      protoValue.return = this.createValueGrip(aCompletion.yield);\n    } else if (\"throw\" in aCompletion) {\n      protoValue.throw = this.createValueGrip(aCompletion.throw);\n    } else {\n      protoValue.terminated = true;\n    }\n    return protoValue;\n  },\n\n  /**\n   * Create a grip for the given debuggee object.\n   *\n   * @param aValue Debugger.Object\n   *        The debuggee object value.\n   * @param aPool ActorPool\n   *        The actor pool where the new object actor will be added.\n   */\n  objectGrip: function TA_objectGrip(aValue, aPool) {\n    if (!aPool.objectActors) {\n      aPool.objectActors = new WeakMap();\n    }\n\n    if (aPool.objectActors.has(aValue)) {\n      return aPool.objectActors.get(aValue).grip();\n    } else if (this.threadLifetimePool.objectActors.has(aValue)) {\n      return this.threadLifetimePool.objectActors.get(aValue).grip();\n    }\n\n    let actor = new PauseScopedObjectActor(aValue, this);\n    aPool.addActor(actor);\n    aPool.objectActors.set(aValue, actor);\n    return actor.grip();\n  },\n\n  /**\n   * Create a grip for the given debuggee object with a pause lifetime.\n   *\n   * @param aValue Debugger.Object\n   *        The debuggee object value.\n   */\n  pauseObjectGrip: function TA_pauseObjectGrip(aValue) {\n    if (!this._pausePool) {\n      throw \"Object grip requested while not paused.\";\n    }\n\n    return this.objectGrip(aValue, this._pausePool);\n  },\n\n  /**\n   * Extend the lifetime of the provided object actor to thread lifetime.\n   *\n   * @param aActor object\n   *        The object actor.\n   */\n  threadObjectGrip: function TA_threadObjectGrip(aActor) {\n    // We want to reuse the existing actor ID, so we just remove it from the\n    // current pool's weak map and then let pool.addActor do the rest.\n    aActor.registeredPool.objectActors.delete(aActor.obj);\n    this.threadLifetimePool.addActor(aActor);\n    this.threadLifetimePool.objectActors.set(aActor.obj, aActor);\n  },\n\n  /**\n   * Handle a protocol request to promote multiple pause-lifetime grips to\n   * thread-lifetime grips.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onThreadGrips: function OA_onThreadGrips(aRequest) {\n    if (this.state != \"paused\") {\n      return { error: \"wrongState\" };\n    }\n\n    if (!aRequest.actors) {\n      return { error: \"missingParameter\",\n               message: \"no actors were specified\" };\n    }\n\n    for (let actorID of aRequest.actors) {\n      let actor = this._pausePool.get(actorID);\n      if (actor) {\n        this.threadObjectGrip(actor);\n      }\n    }\n    return {};\n  },\n\n  /**\n   * Create a grip for the given string.\n   *\n   * @param aString String\n   *        The string we are creating a grip for.\n   * @param aPool ActorPool\n   *        The actor pool where the new actor will be added.\n   */\n  longStringGrip: function TA_longStringGrip(aString, aPool) {\n    if (!aPool.longStringActors) {\n      aPool.longStringActors = {};\n    }\n\n    if (aPool.longStringActors.hasOwnProperty(aString)) {\n      return aPool.longStringActors[aString].grip();\n    }\n\n    let actor = new LongStringActor(aString, this);\n    aPool.addActor(actor);\n    aPool.longStringActors[aString] = actor;\n    return actor.grip();\n  },\n\n  /**\n   * Create a long string grip that is scoped to a pause.\n   *\n   * @param aString String\n   *        The string we are creating a grip for.\n   */\n  pauseLongStringGrip: function TA_pauseLongStringGrip (aString) {\n    return this.longStringGrip(aString, this._pausePool);\n  },\n\n  /**\n   * Create a long string grip that is scoped to a thread.\n   *\n   * @param aString String\n   *        The string we are creating a grip for.\n   */\n  threadLongStringGrip: function TA_pauseLongStringGrip (aString) {\n    return this.longStringGrip(aString, this._threadLifetimePool);\n  },\n\n  /**\n   * Returns true if the string is long enough to use a LongStringActor instead\n   * of passing the value directly over the protocol.\n   *\n   * @param aString String\n   *        The string we are checking the length of.\n   */\n  _stringIsLong: function TA__stringIsLong(aString) {\n    return aString.length >= DebuggerServer.LONG_STRING_LENGTH;\n  },\n\n  // JS Debugger API hooks.\n\n  /**\n   * A function that the engine calls when a call to a debug event hook,\n   * breakpoint handler, watchpoint handler, or similar function throws some\n   * exception.\n   *\n   * @param aException exception\n   *        The exception that was thrown in the debugger code.\n   */\n  uncaughtExceptionHook: function TA_uncaughtExceptionHook(aException) {\n    dumpn(\"Got an exception: \" + aException.message + \"\\n\" + aException.stack);\n  },\n\n  /**\n   * A function that the engine calls when a debugger statement has been\n   * executed in the specified frame.\n   *\n   * @param aFrame Debugger.Frame\n   *        The stack frame that contained the debugger statement.\n   */\n  onDebuggerStatement: function TA_onDebuggerStatement(aFrame) {\n    // Don't pause if we are currently stepping (in or over) or the frame is\n    // black-boxed.\n    let { url } = this.synchronize(this.sources.getOriginalLocation(\n      aFrame.script.url,\n      aFrame.script.getOffsetLine(aFrame.offset),\n      getOffsetColumn(aFrame.offset, aFrame.script)));\n\n    return this.sources.isBlackBoxed(url) || aFrame.onStep\n      ? undefined\n      : this._pauseAndRespond(aFrame, { type: \"debuggerStatement\" });\n  },\n\n  /**\n   * A function that the engine calls when an exception has been thrown and has\n   * propagated to the specified frame.\n   *\n   * @param aFrame Debugger.Frame\n   *        The youngest remaining stack frame.\n   * @param aValue object\n   *        The exception that was thrown.\n   */\n  onExceptionUnwind: function TA_onExceptionUnwind(aFrame, aValue) {\n    let { url } = this.synchronize(this.sources.getOriginalLocation(\n      aFrame.script.url,\n      aFrame.script.getOffsetLine(aFrame.offset),\n      getOffsetColumn(aFrame.offset, aFrame.script)));\n\n    if (this.sources.isBlackBoxed(url)) {\n      return undefined;\n    }\n\n    try {\n      let packet = this._paused(aFrame);\n      if (!packet) {\n        return undefined;\n      }\n\n      packet.why = { type: \"exception\",\n                     exception: this.createValueGrip(aValue) };\n      this.conn.send(packet);\n\n      this._pushThreadPause();\n    } catch(e) {\n      reportError(e, \"Got an exception during TA_onExceptionUnwind: \");\n    }\n\n    return undefined;\n  },\n\n  /**\n   * A function that the engine calls when a new script has been loaded into the\n   * scope of the specified debuggee global.\n   *\n   * @param aScript Debugger.Script\n   *        The source script that has been loaded into a debuggee compartment.\n   * @param aGlobal Debugger.Object\n   *        A Debugger.Object instance whose referent is the global object.\n   */\n  onNewScript: function TA_onNewScript(aScript, aGlobal) {\n    this._addScript(aScript);\n    this.sources.sourcesForScript(aScript);\n  },\n\n  onNewSource: function TA_onNewSource(aSource) {\n    this.conn.send({\n      from: this.actorID,\n      type: \"newSource\",\n      source: aSource.form()\n    });\n  },\n\n  /**\n   * Check if scripts from the provided source URL are allowed to be stored in\n   * the cache.\n   *\n   * @param aSourceUrl String\n   *        The url of the script's source that will be stored.\n   * @returns true, if the script can be added, false otherwise.\n   */\n  _allowSource: function TA__allowSource(aSourceUrl) {\n    // Ignore anything we don't have a URL for (eval scripts, for example).\n    if (!aSourceUrl)\n      return false;\n    // Ignore XBL bindings for content debugging.\n    if (aSourceUrl.indexOf(\"chrome://\") == 0) {\n      return false;\n    }\n    // Ignore about:* pages for content debugging.\n    if (aSourceUrl.indexOf(\"about:\") == 0) {\n      return false;\n    }\n    return true;\n  },\n\n  /**\n   * Restore any pre-existing breakpoints to the scripts that we have access to.\n   */\n  _restoreBreakpoints: function TA__restoreBreakpoints() {\n    for (let s of this.dbg.findScripts()) {\n      this._addScript(s);\n    }\n  },\n\n  /**\n   * Add the provided script to the server cache.\n   *\n   * @param aScript Debugger.Script\n   *        The source script that will be stored.\n   * @returns true, if the script was added; false otherwise.\n   */\n  _addScript: function TA__addScript(aScript) {\n    if (!this._allowSource(aScript.url)) {\n      return false;\n    }\n\n    // Set any stored breakpoints.\n\n    let endLine = aScript.startLine + aScript.lineCount - 1;\n    for (let bp of this.breakpointStore.findBreakpoints({ url: aScript.url })) {\n      // Only consider breakpoints that are not already associated with\n      // scripts, and limit search to the line numbers contained in the new\n      // script.\n      if (!bp.actor.scripts.length\n          && bp.line >= aScript.startLine\n          && bp.line <= endLine) {\n        this._setBreakpoint(bp);\n      }\n    }\n\n    return true;\n  },\n\n};\n\nThreadActor.prototype.requestTypes = {\n  \"attach\": ThreadActor.prototype.onAttach,\n  \"detach\": ThreadActor.prototype.onDetach,\n  \"reconfigure\": ThreadActor.prototype.onReconfigure,\n  \"resume\": ThreadActor.prototype.onResume,\n  \"clientEvaluate\": ThreadActor.prototype.onClientEvaluate,\n  \"frames\": ThreadActor.prototype.onFrames,\n  \"interrupt\": ThreadActor.prototype.onInterrupt,\n  \"eventListeners\": ThreadActor.prototype.onEventListeners,\n  \"releaseMany\": ThreadActor.prototype.onReleaseMany,\n  \"setBreakpoint\": ThreadActor.prototype.onSetBreakpoint,\n  \"sources\": ThreadActor.prototype.onSources,\n  \"threadGrips\": ThreadActor.prototype.onThreadGrips\n};\n\n\n/**\n * Creates a PauseActor.\n *\n * PauseActors exist for the lifetime of a given debuggee pause.  Used to\n * scope pause-lifetime grips.\n *\n * @param ActorPool aPool\n *        The actor pool created for this pause.\n */\nfunction PauseActor(aPool)\n{\n  this.pool = aPool;\n}\n\nPauseActor.prototype = {\n  actorPrefix: \"pause\"\n};\n\n\n/**\n * A base actor for any actors that should only respond receive messages in the\n * paused state. Subclasses may expose a `threadActor` which is used to help\n * determine when we are in a paused state. Subclasses should set their own\n * \"constructor\" property if they want better error messages. You should never\n * instantiate a PauseScopedActor directly, only through subclasses.\n */\nfunction PauseScopedActor()\n{\n}\n\n/**\n * A function decorator for creating methods to handle protocol messages that\n * should only be received while in the paused state.\n *\n * @param aMethod Function\n *        The function we are decorating.\n */\nPauseScopedActor.withPaused = function PSA_withPaused(aMethod) {\n  return function () {\n    if (this.isPaused()) {\n      return aMethod.apply(this, arguments);\n    } else {\n      return this._wrongState();\n    }\n  };\n};\n\nPauseScopedActor.prototype = {\n\n  /**\n   * Returns true if we are in the paused state.\n   */\n  isPaused: function PSA_isPaused() {\n    // When there is not a ThreadActor available (like in the webconsole) we\n    // have to be optimistic and assume that we are paused so that we can\n    // respond to requests.\n    return this.threadActor ? this.threadActor.state === \"paused\" : true;\n  },\n\n  /**\n   * Returns the wrongState response packet for this actor.\n   */\n  _wrongState: function PSA_wrongState() {\n    return {\n      error: \"wrongState\",\n      message: this.constructor.name +\n        \" actors can only be accessed while the thread is paused.\"\n    };\n  }\n};\n\n\n/**\n * A SourceActor provides information about the source of a script.\n *\n * @param aUrl String\n *        The url of the source we are representing.\n * @param aThreadActor ThreadActor\n *        The current thread actor.\n * @param aSourceMap SourceMapConsumer\n *        Optional. The source map that introduced this source, if available.\n */\nfunction SourceActor(aUrl, aThreadActor, aSourceMap=null) {\n  this._threadActor = aThreadActor;\n  this._url = aUrl;\n  this._sourceMap = aSourceMap;\n}\n\nSourceActor.prototype = {\n  constructor: SourceActor,\n  actorPrefix: \"source\",\n\n  get threadActor() this._threadActor,\n  get url() this._url,\n\n  form: function SA_form() {\n    return {\n      actor: this.actorID,\n      url: this._url,\n      isBlackBoxed: this.threadActor.sources.isBlackBoxed(this.url)\n      // TODO bug 637572: introductionScript\n    };\n  },\n\n  disconnect: function LSA_disconnect() {\n    if (this.registeredPool && this.registeredPool.sourceActors) {\n      delete this.registeredPool.sourceActors[this.actorID];\n    }\n  },\n\n  /**\n   * Handler for the \"source\" packet.\n   */\n  onSource: function SA_onSource(aRequest) {\n    let sourceContent = null;\n    if (this._sourceMap) {\n      sourceContent = this._sourceMap.sourceContentFor(this._url);\n    }\n\n    if (sourceContent) {\n      return {\n        from: this.actorID,\n        source: this.threadActor.createValueGrip(\n          sourceContent, this.threadActor.threadLifetimePool)\n      };\n    }\n\n    // XXX bug 865252: Don't load from the cache if this is a source mapped\n    // source because we can't guarantee that the cache has the most up to date\n    // content for this source like we can if it isn't source mapped.\n    return fetch(this._url, { loadFromCache: !this._sourceMap })\n      .then((aSource) => {\n        return this.threadActor.createValueGrip(\n          aSource, this.threadActor.threadLifetimePool);\n      })\n      .then((aSourceGrip) => {\n        return {\n          from: this.actorID,\n          source: aSourceGrip\n        };\n      }, (aError) => {\n        reportError(aError, \"Got an exception during SA_onSource: \");\n        return {\n          \"from\": this.actorID,\n          \"error\": \"loadSourceError\",\n          \"message\": \"Could not load the source for \" + this._url + \".\"\n        };\n      });\n  },\n\n  /**\n   * Handler for the \"blackbox\" packet.\n   */\n  onBlackBox: function SA_onBlackBox(aRequest) {\n    this.threadActor.sources.blackBox(this.url);\n    let packet = {\n      from: this.actorID\n    };\n    if (this.threadActor.state == \"paused\"\n        && this.threadActor.youngestFrame\n        && this.threadActor.youngestFrame.script.url == this.url) {\n      packet.pausedInSource = true;\n    }\n    return packet;\n  },\n\n  /**\n   * Handler for the \"unblackbox\" packet.\n   */\n  onUnblackBox: function SA_onUnblackBox(aRequest) {\n    this.threadActor.sources.unblackBox(this.url);\n    return {\n      from: this.actorID\n    };\n  }\n};\n\nSourceActor.prototype.requestTypes = {\n  \"source\": SourceActor.prototype.onSource,\n  \"blackbox\": SourceActor.prototype.onBlackBox,\n  \"unblackbox\": SourceActor.prototype.onUnblackBox\n};\n\n\n/**\n * Creates an actor for the specified object.\n *\n * @param aObj Debugger.Object\n *        The debuggee object.\n * @param aThreadActor ThreadActor\n *        The parent thread actor for this object.\n */\nfunction ObjectActor(aObj, aThreadActor)\n{\n  this.obj = aObj;\n  this.threadActor = aThreadActor;\n}\n\nObjectActor.prototype = {\n  actorPrefix: \"obj\",\n\n  /**\n   * Returns a grip for this actor for returning in a protocol message.\n   */\n  grip: function OA_grip() {\n    let g = {\n      \"type\": \"object\",\n      \"class\": this.obj.class,\n      \"actor\": this.actorID,\n      \"extensible\": this.obj.isExtensible(),\n      \"frozen\": this.obj.isFrozen(),\n      \"sealed\": this.obj.isSealed()\n    };\n\n    // Add additional properties for functions.\n    if (this.obj.class === \"Function\") {\n      if (this.obj.name) {\n        g.name = this.obj.name;\n      } else if (this.obj.displayName) {\n        g.displayName = this.obj.displayName;\n      }\n\n      // Check if the developer has added a de-facto standard displayName\n      // property for us to use.\n      let desc = this.obj.getOwnPropertyDescriptor(\"displayName\");\n      if (desc && desc.value && typeof desc.value == \"string\") {\n        g.userDisplayName = this.threadActor.createValueGrip(desc.value);\n      }\n\n      // Add source location information.\n      if (this.obj.script) {\n        g.url = this.obj.script.url;\n        g.line = this.obj.script.startLine;\n      }\n    }\n\n    return g;\n  },\n\n  /**\n   * Releases this actor from the pool.\n   */\n  release: function OA_release() {\n    if (this.registeredPool.objectActors) {\n      this.registeredPool.objectActors.delete(this.obj);\n    }\n    this.registeredPool.removeActor(this);\n  },\n\n  /**\n   * Handle a protocol request to provide the names of the properties defined on\n   * the object and not its prototype.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onOwnPropertyNames: function OA_onOwnPropertyNames(aRequest) {\n    return { from: this.actorID,\n             ownPropertyNames: this.obj.getOwnPropertyNames() };\n  },\n\n  /**\n   * Handle a protocol request to provide the prototype and own properties of\n   * the object.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onPrototypeAndProperties: function OA_onPrototypeAndProperties(aRequest) {\n    let ownProperties = Object.create(null);\n    let names;\n    try {\n      names = this.obj.getOwnPropertyNames();\n    } catch (ex) {\n      // The above can throw if this.obj points to a dead object.\n      // TODO: we should use Cu.isDeadWrapper() - see bug 885800.\n      return { from: this.actorID,\n               prototype: this.threadActor.createValueGrip(null),\n               ownProperties: ownProperties,\n               safeGetterValues: Object.create(null) };\n    }\n    for (let name of names) {\n      ownProperties[name] = this._propertyDescriptor(name);\n    }\n    return { from: this.actorID,\n             prototype: this.threadActor.createValueGrip(this.obj.proto),\n             ownProperties: ownProperties,\n             safeGetterValues: this._findSafeGetterValues(ownProperties) };\n  },\n\n  /**\n   * Find the safe getter values for the current Debugger.Object, |this.obj|.\n   *\n   * @private\n   * @param object aOwnProperties\n   *        The object that holds the list of known ownProperties for\n   *        |this.obj|.\n   * @return object\n   *         An object that maps property names to safe getter descriptors as\n   *         defined by the remote debugging protocol.\n   */\n  _findSafeGetterValues: function OA__findSafeGetterValues(aOwnProperties)\n  {\n    let safeGetterValues = Object.create(null);\n    let obj = this.obj;\n    let level = 0;\n\n    while (obj) {\n      let getters = this._findSafeGetters(obj);\n      for (let name of getters) {\n        // Avoid overwriting properties from prototypes closer to this.obj. Also\n        // avoid providing safeGetterValues from prototypes if property |name|\n        // is already defined as an own property.\n        if (name in safeGetterValues ||\n            (obj != this.obj && name in aOwnProperties)) {\n          continue;\n        }\n\n        let desc = null, getter = null;\n        try {\n          desc = obj.getOwnPropertyDescriptor(name);\n          getter = desc.get;\n        } catch (ex) {\n          // The above can throw if the cache becomes stale.\n        }\n        if (!getter) {\n          obj._safeGetters = null;\n          continue;\n        }\n\n        let result = getter.call(this.obj);\n        if (result && !(\"throw\" in result)) {\n          let getterValue = undefined;\n          if (\"return\" in result) {\n            getterValue = result.return;\n          } else if (\"yield\" in result) {\n            getterValue = result.yield;\n          }\n          // WebIDL attributes specified with the LenientThis extended attribute\n          // return undefined and should be ignored.\n          if (getterValue !== undefined) {\n            safeGetterValues[name] = {\n              getterValue: this.threadActor.createValueGrip(getterValue),\n              getterPrototypeLevel: level,\n              enumerable: desc.enumerable,\n              writable: level == 0 ? desc.writable : true,\n            };\n          }\n        }\n      }\n\n      obj = obj.proto;\n      level++;\n    }\n\n    return safeGetterValues;\n  },\n\n  /**\n   * Find the safe getters for a given Debugger.Object. Safe getters are native\n   * getters which are safe to execute.\n   *\n   * @private\n   * @param Debugger.Object aObject\n   *        The Debugger.Object where you want to find safe getters.\n   * @return Set\n   *         A Set of names of safe getters. This result is cached for each\n   *         Debugger.Object.\n   */\n  _findSafeGetters: function OA__findSafeGetters(aObject)\n  {\n    if (aObject._safeGetters) {\n      return aObject._safeGetters;\n    }\n\n    let getters = new Set();\n    for (let name of aObject.getOwnPropertyNames()) {\n      let desc = null;\n      try {\n        desc = aObject.getOwnPropertyDescriptor(name);\n      } catch (e) {\n        // Calling getOwnPropertyDescriptor on wrapped native prototypes is not\n        // allowed (bug 560072).\n      }\n      if (!desc || desc.value !== undefined || !(\"get\" in desc)) {\n        continue;\n      }\n\n      let fn = desc.get;\n      if (fn && fn.callable && fn.class == \"Function\" &&\n          fn.script === undefined) {\n        getters.add(name);\n      }\n    }\n\n    aObject._safeGetters = getters;\n    return getters;\n  },\n\n  /**\n   * Handle a protocol request to provide the prototype of the object.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onPrototype: function OA_onPrototype(aRequest) {\n    return { from: this.actorID,\n             prototype: this.threadActor.createValueGrip(this.obj.proto) };\n  },\n\n  /**\n   * Handle a protocol request to provide the property descriptor of the\n   * object's specified property.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onProperty: function OA_onProperty(aRequest) {\n    if (!aRequest.name) {\n      return { error: \"missingParameter\",\n               message: \"no property name was specified\" };\n    }\n\n    return { from: this.actorID,\n             descriptor: this._propertyDescriptor(aRequest.name) };\n  },\n\n  /**\n   * Handle a protocol request to provide the display string for the object.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onDisplayString: function OA_onDisplayString(aRequest) {\n    let toString;\n    try {\n      // Attempt to locate the object's \"toString\" method.\n      let obj = this.obj;\n      do {\n        let desc = obj.getOwnPropertyDescriptor(\"toString\");\n        if (desc) {\n          toString = desc.value;\n          break;\n        }\n      } while ((obj = obj.proto))\n    } catch (e) {\n      dumpn(e);\n    }\n\n    let result = null;\n    if (toString && toString.callable) {\n      // If a toString method was found then call it on the object.\n      let ret = toString.call(this.obj).return;\n      if (typeof ret == \"string\") {\n        // Only use the result if it was a returned string.\n        result = ret;\n      }\n    }\n\n    return { from: this.actorID,\n             displayString: this.threadActor.createValueGrip(result) };\n  },\n\n  /**\n   * A helper method that creates a property descriptor for the provided object,\n   * properly formatted for sending in a protocol response.\n   *\n   * @param string aName\n   *        The property that the descriptor is generated for.\n   */\n  _propertyDescriptor: function OA_propertyDescriptor(aName) {\n    let desc;\n    try {\n      desc = this.obj.getOwnPropertyDescriptor(aName);\n    } catch (e) {\n      // Calling getOwnPropertyDescriptor on wrapped native prototypes is not\n      // allowed (bug 560072). Inform the user with a bogus, but hopefully\n      // explanatory, descriptor.\n      return {\n        configurable: false,\n        writable: false,\n        enumerable: false,\n        value: e.name\n      };\n    }\n\n    if (!desc) {\n      return undefined;\n    }\n\n    let retval = {\n      configurable: desc.configurable,\n      enumerable: desc.enumerable\n    };\n\n    if (\"value\" in desc) {\n      retval.writable = desc.writable;\n      retval.value = this.threadActor.createValueGrip(desc.value);\n    } else {\n      if (\"get\" in desc) {\n        retval.get = this.threadActor.createValueGrip(desc.get);\n      }\n      if (\"set\" in desc) {\n        retval.set = this.threadActor.createValueGrip(desc.set);\n      }\n    }\n    return retval;\n  },\n\n  /**\n   * Handle a protocol request to provide the source code of a function.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onDecompile: function OA_onDecompile(aRequest) {\n    if (this.obj.class !== \"Function\") {\n      return { error: \"objectNotFunction\",\n               message: \"decompile request is only valid for object grips \" +\n                        \"with a 'Function' class.\" };\n    }\n\n    return { from: this.actorID,\n             decompiledCode: this.obj.decompile(!!aRequest.pretty) };\n  },\n\n  /**\n   * Handle a protocol request to provide the parameters of a function.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onParameterNames: function OA_onParameterNames(aRequest) {\n    if (this.obj.class !== \"Function\") {\n      return { error: \"objectNotFunction\",\n               message: \"'parameterNames' request is only valid for object \" +\n                        \"grips with a 'Function' class.\" };\n    }\n\n    return { parameterNames: this.obj.parameterNames };\n  },\n\n  /**\n   * Handle a protocol request to release a thread-lifetime grip.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onRelease: function OA_onRelease(aRequest) {\n    this.release();\n    return {};\n  },\n};\n\nObjectActor.prototype.requestTypes = {\n  \"parameterNames\": ObjectActor.prototype.onParameterNames,\n  \"prototypeAndProperties\": ObjectActor.prototype.onPrototypeAndProperties,\n  \"prototype\": ObjectActor.prototype.onPrototype,\n  \"property\": ObjectActor.prototype.onProperty,\n  \"displayString\": ObjectActor.prototype.onDisplayString,\n  \"ownPropertyNames\": ObjectActor.prototype.onOwnPropertyNames,\n  \"decompile\": ObjectActor.prototype.onDecompile,\n  \"release\": ObjectActor.prototype.onRelease,\n};\n\n\n/**\n * Creates a pause-scoped actor for the specified object.\n * @see ObjectActor\n */\nfunction PauseScopedObjectActor()\n{\n  ObjectActor.apply(this, arguments);\n}\n\nPauseScopedObjectActor.prototype = Object.create(PauseScopedActor.prototype);\n\nupdate(PauseScopedObjectActor.prototype, ObjectActor.prototype);\n\nupdate(PauseScopedObjectActor.prototype, {\n  constructor: PauseScopedObjectActor,\n\n  onOwnPropertyNames:\n    PauseScopedActor.withPaused(ObjectActor.prototype.onOwnPropertyNames),\n\n  onPrototypeAndProperties:\n    PauseScopedActor.withPaused(ObjectActor.prototype.onPrototypeAndProperties),\n\n  onPrototype: PauseScopedActor.withPaused(ObjectActor.prototype.onPrototype),\n  onProperty: PauseScopedActor.withPaused(ObjectActor.prototype.onProperty),\n  onDecompile: PauseScopedActor.withPaused(ObjectActor.prototype.onDecompile),\n\n  onDisplayString:\n    PauseScopedActor.withPaused(ObjectActor.prototype.onDisplayString),\n\n  onParameterNames:\n    PauseScopedActor.withPaused(ObjectActor.prototype.onParameterNames),\n\n  /**\n   * Handle a protocol request to provide the lexical scope of a function.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onScope: PauseScopedActor.withPaused(function OA_onScope(aRequest) {\n    if (this.obj.class !== \"Function\") {\n      return { error: \"objectNotFunction\",\n               message: \"scope request is only valid for object grips with a\" +\n                        \" 'Function' class.\" };\n    }\n\n    let envActor = this.threadActor.createEnvironmentActor(this.obj.environment,\n                                                           this.registeredPool);\n    if (!envActor) {\n      return { error: \"notDebuggee\",\n               message: \"cannot access the environment of this function.\" };\n    }\n\n    return { from: this.actorID, scope: envActor.form() };\n  }),\n\n  /**\n   * Handle a protocol request to promote a pause-lifetime grip to a\n   * thread-lifetime grip.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onThreadGrip: PauseScopedActor.withPaused(function OA_onThreadGrip(aRequest) {\n    this.threadActor.threadObjectGrip(this);\n    return {};\n  }),\n\n  /**\n   * Handle a protocol request to release a thread-lifetime grip.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onRelease: PauseScopedActor.withPaused(function OA_onRelease(aRequest) {\n    if (this.registeredPool !== this.threadActor.threadLifetimePool) {\n      return { error: \"notReleasable\",\n               message: \"Only thread-lifetime actors can be released.\" };\n    }\n\n    this.release();\n    return {};\n  }),\n});\n\nupdate(PauseScopedObjectActor.prototype.requestTypes, {\n  \"scope\": PauseScopedObjectActor.prototype.onScope,\n  \"threadGrip\": PauseScopedObjectActor.prototype.onThreadGrip,\n});\n\n\n/**\n * Creates an actor for the specied \"very long\" string. \"Very long\" is specified\n * at the server's discretion.\n *\n * @param aString String\n *        The string.\n */\nfunction LongStringActor(aString)\n{\n  this.string = aString;\n  this.stringLength = aString.length;\n}\n\nLongStringActor.prototype = {\n\n  actorPrefix: \"longString\",\n\n  disconnect: function LSA_disconnect() {\n    // Because longStringActors is not a weak map, we won't automatically leave\n    // it so we need to manually leave on disconnect so that we don't leak\n    // memory.\n    if (this.registeredPool && this.registeredPool.longStringActors) {\n      delete this.registeredPool.longStringActors[this.actorID];\n    }\n  },\n\n  /**\n   * Returns a grip for this actor for returning in a protocol message.\n   */\n  grip: function LSA_grip() {\n    return {\n      \"type\": \"longString\",\n      \"initial\": this.string.substring(\n        0, DebuggerServer.LONG_STRING_INITIAL_LENGTH),\n      \"length\": this.stringLength,\n      \"actor\": this.actorID\n    };\n  },\n\n  /**\n   * Handle a request to extract part of this actor's string.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onSubstring: function LSA_onSubString(aRequest) {\n    return {\n      \"from\": this.actorID,\n      \"substring\": this.string.substring(aRequest.start, aRequest.end)\n    };\n  },\n\n  /**\n   * Handle a request to release this LongStringActor instance.\n   */\n  onRelease: function LSA_onRelease() {\n    // TODO: also check if registeredPool === threadActor.threadLifetimePool\n    // when the web console moves aray from manually releasing pause-scoped\n    // actors.\n    if (this.registeredPool.longStringActors) {\n      delete this.registeredPool.longStringActors[this.actorID];\n    }\n    this.registeredPool.removeActor(this);\n    return {};\n  },\n};\n\nLongStringActor.prototype.requestTypes = {\n  \"substring\": LongStringActor.prototype.onSubstring,\n  \"release\": LongStringActor.prototype.onRelease\n};\n\n\n/**\n * Creates an actor for the specified stack frame.\n *\n * @param aFrame Debugger.Frame\n *        The debuggee frame.\n * @param aThreadActor ThreadActor\n *        The parent thread actor for this frame.\n */\nfunction FrameActor(aFrame, aThreadActor)\n{\n  this.frame = aFrame;\n  this.threadActor = aThreadActor;\n}\n\nFrameActor.prototype = {\n  actorPrefix: \"frame\",\n\n  /**\n   * A pool that contains frame-lifetime objects, like the environment.\n   */\n  _frameLifetimePool: null,\n  get frameLifetimePool() {\n    if (!this._frameLifetimePool) {\n      this._frameLifetimePool = new ActorPool(this.conn);\n      this.conn.addActorPool(this._frameLifetimePool);\n    }\n    return this._frameLifetimePool;\n  },\n\n  /**\n   * Finalization handler that is called when the actor is being evicted from\n   * the pool.\n   */\n  disconnect: function FA_disconnect() {\n    this.conn.removeActorPool(this._frameLifetimePool);\n    this._frameLifetimePool = null;\n  },\n\n  /**\n   * Returns a frame form for use in a protocol message.\n   */\n  form: function FA_form() {\n    let form = { actor: this.actorID,\n                 type: this.frame.type };\n    if (this.frame.type === \"call\") {\n      form.callee = this.threadActor.createValueGrip(this.frame.callee);\n    }\n\n    if (this.frame.environment) {\n      let envActor = this.threadActor\n        .createEnvironmentActor(this.frame.environment,\n                                this.frameLifetimePool);\n      form.environment = envActor.form();\n    }\n    form.this = this.threadActor.createValueGrip(this.frame.this);\n    form.arguments = this._args();\n    if (this.frame.script) {\n      form.where = {\n        url: this.frame.script.url,\n        line: this.frame.script.getOffsetLine(this.frame.offset),\n        column: getOffsetColumn(this.frame.offset, this.frame.script)\n      };\n    }\n\n    if (!this.frame.older) {\n      form.oldest = true;\n    }\n\n    return form;\n  },\n\n  _args: function FA__args() {\n    if (!this.frame.arguments) {\n      return [];\n    }\n\n    return [this.threadActor.createValueGrip(arg)\n            for each (arg in this.frame.arguments)];\n  },\n\n  /**\n   * Handle a protocol request to pop this frame from the stack.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onPop: function FA_onPop(aRequest) {\n    // TODO: remove this when Debugger.Frame.prototype.pop is implemented\n    if (typeof this.frame.pop != \"function\") {\n      return { error: \"notImplemented\",\n               message: \"Popping frames is not yet implemented.\" };\n    }\n\n    while (this.frame != this.threadActor.dbg.getNewestFrame()) {\n      this.threadActor.dbg.getNewestFrame().pop();\n    }\n    this.frame.pop(aRequest.completionValue);\n\n    // TODO: return the watches property when frame pop watch actors are\n    // implemented.\n    return { from: this.actorID };\n  }\n};\n\nFrameActor.prototype.requestTypes = {\n  \"pop\": FrameActor.prototype.onPop,\n};\n\n\n/**\n * Creates a BreakpointActor. BreakpointActors exist for the lifetime of their\n * containing thread and are responsible for deleting breakpoints, handling\n * breakpoint hits and associating breakpoints with scripts.\n *\n * @param ThreadActor aThreadActor\n *        The parent thread actor that contains this breakpoint.\n * @param object aLocation\n *        The location of the breakpoint as specified in the protocol.\n */\nfunction BreakpointActor(aThreadActor, aLocation)\n{\n  this.scripts = [];\n  this.threadActor = aThreadActor;\n  this.location = aLocation;\n}\n\nBreakpointActor.prototype = {\n  actorPrefix: \"breakpoint\",\n\n  /**\n   * Called when this same breakpoint is added to another Debugger.Script\n   * instance, in the case of a page reload.\n   *\n   * @param aScript Debugger.Script\n   *        The new source script on which the breakpoint has been set.\n   * @param ThreadActor aThreadActor\n   *        The parent thread actor that contains this breakpoint.\n   */\n  addScript: function BA_addScript(aScript, aThreadActor) {\n    this.threadActor = aThreadActor;\n    this.scripts.push(aScript);\n  },\n\n  /**\n   * Remove the breakpoints from associated scripts and clear the script cache.\n   */\n  removeScripts: function () {\n    for (let script of this.scripts) {\n      script.clearBreakpoint(this);\n    }\n    this.scripts = [];\n  },\n\n  /**\n   * A function that the engine calls when a breakpoint has been hit.\n   *\n   * @param aFrame Debugger.Frame\n   *        The stack frame that contained the breakpoint.\n   */\n  hit: function BA_hit(aFrame) {\n    // Don't pause if we are currently stepping (in or over) or the frame is\n    // black-boxed.\n    let { url } = this.threadActor.synchronize(\n      this.threadActor.sources.getOriginalLocation(\n        this.location.url,\n        this.location.line,\n        this.location.column));\n\n    if (this.threadActor.sources.isBlackBoxed(url) || aFrame.onStep) {\n      return undefined;\n    }\n\n    let reason = {};\n    if (this.threadActor._hiddenBreakpoints.has(this.actorID)) {\n      reason.type = \"pauseOnDOMEvents\";\n    } else {\n      reason.type = \"breakpoint\";\n      // TODO: add the rest of the breakpoints on that line (bug 676602).\n      reason.actors = [ this.actorID ];\n    }\n    return this.threadActor._pauseAndRespond(aFrame, reason);\n  },\n\n  /**\n   * Handle a protocol request to remove this breakpoint.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onDelete: function BA_onDelete(aRequest) {\n    // Remove from the breakpoint store.\n    this.threadActor.breakpointStore.removeBreakpoint(this.location);\n    this.threadActor._hooks.removeFromParentPool(this);\n    // Remove the actual breakpoint from the associated scripts.\n    this.removeScripts();\n    return { from: this.actorID };\n  }\n};\n\nBreakpointActor.prototype.requestTypes = {\n  \"delete\": BreakpointActor.prototype.onDelete\n};\n\n\n/**\n * Creates an EnvironmentActor. EnvironmentActors are responsible for listing\n * the bindings introduced by a lexical environment and assigning new values to\n * those identifier bindings.\n *\n * @param Debugger.Environment aEnvironment\n *        The lexical environment that will be used to create the actor.\n * @param ThreadActor aThreadActor\n *        The parent thread actor that contains this environment.\n */\nfunction EnvironmentActor(aEnvironment, aThreadActor)\n{\n  this.obj = aEnvironment;\n  this.threadActor = aThreadActor;\n}\n\nEnvironmentActor.prototype = {\n  actorPrefix: \"environment\",\n\n  /**\n   * Return an environment form for use in a protocol message.\n   */\n  form: function EA_form() {\n    let form = { actor: this.actorID };\n\n    // What is this environment's type?\n    if (this.obj.type == \"declarative\") {\n      form.type = this.obj.callee ? \"function\" : \"block\";\n    } else {\n      form.type = this.obj.type;\n    }\n\n    // Does this environment have a parent?\n    if (this.obj.parent) {\n      form.parent = (this.threadActor\n                     .createEnvironmentActor(this.obj.parent,\n                                             this.registeredPool)\n                     .form());\n    }\n\n    // Does this environment reflect the properties of an object as variables?\n    if (this.obj.type == \"object\" || this.obj.type == \"with\") {\n      form.object = this.threadActor.createValueGrip(this.obj.object);\n    }\n\n    // Is this the environment created for a function call?\n    if (this.obj.callee) {\n      form.function = this.threadActor.createValueGrip(this.obj.callee);\n    }\n\n    // Shall we list this environment's bindings?\n    if (this.obj.type == \"declarative\") {\n      form.bindings = this._bindings();\n    }\n\n    return form;\n  },\n\n  /**\n   * Return the identifier bindings object as required by the remote protocol\n   * specification.\n   */\n  _bindings: function EA_bindings() {\n    let bindings = { arguments: [], variables: {} };\n\n    // TODO: this part should be removed in favor of the commented-out part\n    // below when getVariableDescriptor lands (bug 725815).\n    if (typeof this.obj.getVariable != \"function\") {\n    //if (typeof this.obj.getVariableDescriptor != \"function\") {\n      return bindings;\n    }\n\n    let parameterNames;\n    if (this.obj.callee) {\n      parameterNames = this.obj.callee.parameterNames;\n    }\n    for each (let name in parameterNames) {\n      let arg = {};\n      // TODO: this part should be removed in favor of the commented-out part\n      // below when getVariableDescriptor lands (bug 725815).\n      let desc = {\n        value: this.obj.getVariable(name),\n        configurable: false,\n        writable: true,\n        enumerable: true\n      };\n\n      // let desc = this.obj.getVariableDescriptor(name);\n      let descForm = {\n        enumerable: true,\n        configurable: desc.configurable\n      };\n      if (\"value\" in desc) {\n        descForm.value = this.threadActor.createValueGrip(desc.value);\n        descForm.writable = desc.writable;\n      } else {\n        descForm.get = this.threadActor.createValueGrip(desc.get);\n        descForm.set = this.threadActor.createValueGrip(desc.set);\n      }\n      arg[name] = descForm;\n      bindings.arguments.push(arg);\n    }\n\n    for each (let name in this.obj.names()) {\n      if (bindings.arguments.some(function exists(element) {\n                                    return !!element[name];\n                                  })) {\n        continue;\n      }\n\n      // TODO: this part should be removed in favor of the commented-out part\n      // below when getVariableDescriptor lands.\n      let desc = {\n        configurable: false,\n        writable: true,\n        enumerable: true\n      };\n      try {\n        desc.value = this.obj.getVariable(name);\n      } catch (e) {\n        // Avoid \"Debugger scope is not live\" errors for |arguments|, introduced\n        // in bug 746601.\n        if (name != \"arguments\") {\n          throw e;\n        }\n      }\n      //let desc = this.obj.getVariableDescriptor(name);\n      let descForm = {\n        enumerable: true,\n        configurable: desc.configurable\n      };\n      if (\"value\" in desc) {\n        descForm.value = this.threadActor.createValueGrip(desc.value);\n        descForm.writable = desc.writable;\n      } else {\n        descForm.get = this.threadActor.createValueGrip(desc.get);\n        descForm.set = this.threadActor.createValueGrip(desc.set);\n      }\n      bindings.variables[name] = descForm;\n    }\n\n    return bindings;\n  },\n\n  /**\n   * Handle a protocol request to change the value of a variable bound in this\n   * lexical environment.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onAssign: function EA_onAssign(aRequest) {\n    // TODO: enable the commented-out part when getVariableDescriptor lands\n    // (bug 725815).\n    /*let desc = this.obj.getVariableDescriptor(aRequest.name);\n\n    if (!desc.writable) {\n      return { error: \"immutableBinding\",\n               message: \"Changing the value of an immutable binding is not \" +\n                        \"allowed\" };\n    }*/\n\n    try {\n      this.obj.setVariable(aRequest.name, aRequest.value);\n    } catch (e) {\n      if (e instanceof Debugger.DebuggeeWouldRun) {\n        return { error: \"threadWouldRun\",\n                 cause: e.cause ? e.cause : \"setter\",\n                 message: \"Assigning a value would cause the debuggee to run\" };\n      }\n      // This should never happen, so let it complain loudly if it does.\n      throw e;\n    }\n    return { from: this.actorID };\n  },\n\n  /**\n   * Handle a protocol request to fully enumerate the bindings introduced by the\n   * lexical environment.\n   *\n   * @param aRequest object\n   *        The protocol request object.\n   */\n  onBindings: function EA_onBindings(aRequest) {\n    return { from: this.actorID,\n             bindings: this._bindings() };\n  }\n};\n\nEnvironmentActor.prototype.requestTypes = {\n  \"assign\": EnvironmentActor.prototype.onAssign,\n  \"bindings\": EnvironmentActor.prototype.onBindings\n};\n\n/**\n * Override the toString method in order to get more meaningful script output\n * for debugging the debugger.\n */\nDebugger.Script.prototype.toString = function() {\n  let output = \"\";\n  if (this.url) {\n    output += this.url;\n  }\n  if (typeof this.startLine != \"undefined\") {\n    output += \":\" + this.startLine;\n    if (this.lineCount && this.lineCount > 1) {\n      output += \"-\" + (this.startLine + this.lineCount - 1);\n    }\n  }\n  if (this.strictMode) {\n    output += \":strict\";\n  }\n  return output;\n};\n\n/**\n * Helper property for quickly getting to the line number a stack frame is\n * currently paused at.\n */\nObject.defineProperty(Debugger.Frame.prototype, \"line\", {\n  configurable: true,\n  get: function() {\n    if (this.script) {\n      return this.script.getOffsetLine(this.offset);\n    } else {\n      return null;\n    }\n  }\n});\n\n\n/**\n * Creates an actor for handling chrome debugging. ChromeDebuggerActor is a\n * thin wrapper over ThreadActor, slightly changing some of its behavior.\n *\n * @param aConnection object\n *        The DebuggerServerConnection with which this ChromeDebuggerActor\n *        is associated. (Currently unused, but required to make this\n *        constructor usable with addGlobalActor.)\n *\n * @param aHooks object\n *        An object with preNest and postNest methods for calling when entering\n *        and exiting a nested event loop and also addToParentPool and\n *        removeFromParentPool methods for handling the lifetime of actors that\n *        will outlive the thread, like breakpoints.\n */\nfunction ChromeDebuggerActor(aConnection, aHooks)\n{\n  ThreadActor.call(this, aHooks);\n}\n\nChromeDebuggerActor.prototype = Object.create(ThreadActor.prototype);\n\nupdate(ChromeDebuggerActor.prototype, {\n  constructor: ChromeDebuggerActor,\n\n  // A constant prefix that will be used to form the actor ID by the server.\n  actorPrefix: \"chromeDebugger\",\n\n  /**\n   * Override the eligibility check for scripts and sources to make sure every\n   * script and source with a URL is stored when debugging chrome.\n   */\n  _allowSource: function(aSourceURL) !!aSourceURL,\n\n   /**\n   * An object that will be used by ThreadActors to tailor their behavior\n   * depending on the debugging context being required (chrome or content).\n   * The methods that this object provides must be bound to the ThreadActor\n   * before use.\n   */\n  globalManager: {\n    findGlobals: function CDA_findGlobals() {\n      // Add every global known to the debugger as debuggee.\n      this.dbg.addAllGlobalsAsDebuggees();\n    },\n\n    /**\n     * A function that the engine calls when a new global object has been\n     * created.\n     *\n     * @param aGlobal Debugger.Object\n     *        The new global object that was created.\n     */\n    onNewGlobal: function CDA_onNewGlobal(aGlobal) {\n      this.addDebuggee(aGlobal);\n      // Notify the client.\n      this.conn.send({\n        from: this.actorID,\n        type: \"newGlobal\",\n        // TODO: after bug 801084 lands see if we need to JSONify this.\n        hostAnnotations: aGlobal.hostAnnotations\n      });\n    }\n  }\n});\n\n\n/**\n * Manages the sources for a thread. Handles source maps, locations in the\n * sources, etc for ThreadActors.\n */\nfunction ThreadSources(aThreadActor, aUseSourceMaps, aAllowPredicate,\n                       aOnNewSource) {\n  this._thread = aThreadActor;\n  this._useSourceMaps = aUseSourceMaps;\n  this._allow = aAllowPredicate;\n  this._onNewSource = aOnNewSource;\n\n  // source map URL --> promise of SourceMapConsumer\n  this._sourceMaps = Object.create(null);\n  // generated source url --> promise of SourceMapConsumer\n  this._sourceMapsByGeneratedSource = Object.create(null);\n  // original source url --> promise of SourceMapConsumer\n  this._sourceMapsByOriginalSource = Object.create(null);\n  // source url --> SourceActor\n  this._sourceActors = Object.create(null);\n  // original url --> generated url\n  this._generatedUrlsByOriginalUrl = Object.create(null);\n}\n\n/**\n * Must be a class property because it needs to persist across reloads, same as\n * the breakpoint store.\n */\nThreadSources._blackBoxedSources = new Set();\n\nThreadSources.prototype = {\n  /**\n   * Return the source actor representing |aURL|, creating one if none\n   * exists already. Returns null if |aURL| is not allowed by the 'allow'\n   * predicate.\n   *\n   * Right now this takes a URL, but in the future it should\n   * take a Debugger.Source. See bug 637572.\n   *\n   * @param String aURL\n   *        The source URL.\n   * @param optional SourceMapConsumer aSourceMap\n   *        The source map that introduced this source, if any.\n   * @returns a SourceActor representing the source at aURL or null.\n   */\n  source: function TS_source(aURL, aSourceMap=null) {\n    if (!this._allow(aURL)) {\n      return null;\n    }\n\n    if (aURL in this._sourceActors) {\n      return this._sourceActors[aURL];\n    }\n\n    let actor = new SourceActor(aURL, this._thread, aSourceMap);\n    this._thread.threadLifetimePool.addActor(actor);\n    this._sourceActors[aURL] = actor;\n    try {\n      this._onNewSource(actor);\n    } catch (e) {\n      reportError(e);\n    }\n    return actor;\n  },\n\n  /**\n   * Return a promise of an array of source actors representing all the\n   * sources of |aScript|.\n   *\n   * If source map handling is enabled and |aScript| has a source map, then\n   * use it to find all of |aScript|'s *original* sources; return a promise\n   * of an array of source actors for those.\n   */\n  sourcesForScript: function TS_sourcesForScript(aScript) {\n    if (!this._useSourceMaps || !aScript.sourceMapURL) {\n      return resolve([this.source(aScript.url)].filter(isNotNull));\n    }\n\n    return this.sourceMap(aScript)\n      .then((aSourceMap) => {\n        return [\n          this.source(s, aSourceMap) for (s of aSourceMap.sources)\n        ];\n      })\n      .then(null, (e) => {\n        reportError(e);\n        delete this._sourceMaps[this._normalize(aScript.sourceMapURL, aScript.url)];\n        delete this._sourceMapsByGeneratedSource[aScript.url];\n        return [this.source(aScript.url)];\n      })\n      .then(function (aSources) {\n        return aSources.filter(isNotNull);\n      });\n  },\n\n  /**\n   * Return a promise of a SourceMapConsumer for the source map for\n   * |aScript|; if we already have such a promise extant, return that.\n   * |aScript| must have a non-null sourceMapURL.\n   */\n  sourceMap: function TS_sourceMap(aScript) {\n    if (aScript.url in this._sourceMapsByGeneratedSource) {\n      return this._sourceMapsByGeneratedSource[aScript.url];\n    }\n    dbg_assert(aScript.sourceMapURL, \"Script should have a sourceMapURL\");\n    let sourceMapURL = this._normalize(aScript.sourceMapURL, aScript.url);\n    let map = this._fetchSourceMap(sourceMapURL, aScript.url)\n      .then((aSourceMap) => {\n        for (let s of aSourceMap.sources) {\n          this._generatedUrlsByOriginalUrl[s] = aScript.url;\n          this._sourceMapsByOriginalSource[s] = resolve(aSourceMap);\n        }\n        return aSourceMap;\n      });\n    this._sourceMapsByGeneratedSource[aScript.url] = map;\n    return map;\n  },\n\n  /**\n   * Return a promise of a SourceMapConsumer for the source map located at\n   * |aAbsSourceMapURL|, which must be absolute. If there is already such a\n   * promise extant, return it.\n   *\n   * @param string aAbsSourceMapURL\n   *        The source map URL, in absolute form, not relative.\n   * @param string aScriptURL\n   *        When the source map URL is a data URI, there is no sourceRoot on the\n   *        source map, and the source map's sources are relative, we resolve\n   *        them from aScriptURL.\n   */\n  _fetchSourceMap: function TS__fetchSourceMap(aAbsSourceMapURL, aScriptURL) {\n    if (aAbsSourceMapURL in this._sourceMaps) {\n      return this._sourceMaps[aAbsSourceMapURL];\n    }\n\n    let promise = fetch(aAbsSourceMapURL).then(rawSourceMap => {\n      let map = new SourceMapConsumer(rawSourceMap);\n      this._setSourceMapRoot(map, aAbsSourceMapURL, aScriptURL);\n      return map;\n    });\n    this._sourceMaps[aAbsSourceMapURL] = promise;\n    return promise;\n  },\n\n  /**\n   * Sets the source map's sourceRoot to be relative to the source map url.\n   */\n  _setSourceMapRoot: function TS__setSourceMapRoot(aSourceMap, aAbsSourceMapURL,\n                                                   aScriptURL) {\n    const base = this._dirname(\n      aAbsSourceMapURL.indexOf(\"data:\") === 0\n        ? aScriptURL\n        : aAbsSourceMapURL);\n    aSourceMap.sourceRoot = aSourceMap.sourceRoot\n      ? this._normalize(aSourceMap.sourceRoot, base)\n      : base;\n  },\n\n  _dirname: function TS__dirname(aPath) {\n    return Services.io.newURI(\n      \".\", null, Services.io.newURI(aPath, null, null)).spec;\n  },\n\n  /**\n   * Returns a promise of the location in the original source if the source is\n   * source mapped, otherwise a promise of the same location.\n   */\n  getOriginalLocation:\n  function TS_getOriginalLocation(aSourceUrl, aLine, aColumn) {\n    if (aSourceUrl in this._sourceMapsByGeneratedSource) {\n      return this._sourceMapsByGeneratedSource[aSourceUrl]\n        .then(function (aSourceMap) {\n          let { source, line, column } = aSourceMap.originalPositionFor({\n            line: aLine,\n            column: aColumn\n          });\n          return {\n            url: source,\n            line: line,\n            column: column\n          };\n        });\n    }\n\n    // No source map\n    return resolve({\n      url: aSourceUrl,\n      line: aLine,\n      column: aColumn\n    });\n  },\n\n  /**\n   * Returns a promise of the location in the generated source corresponding to\n   * the original source and line given.\n   *\n   * When we pass a script S representing generated code to |sourceMap|,\n   * above, that returns a promise P. The process of resolving P populates\n   * the tables this function uses; thus, it won't know that S's original\n   * source URLs map to S until P is resolved.\n   */\n  getGeneratedLocation:\n  function TS_getGeneratedLocation(aSourceUrl, aLine, aColumn) {\n    if (aSourceUrl in this._sourceMapsByOriginalSource) {\n      return this._sourceMapsByOriginalSource[aSourceUrl]\n        .then((aSourceMap) => {\n          let { line, column } = aSourceMap.generatedPositionFor({\n            source: aSourceUrl,\n            line: aLine,\n            column: aColumn == null ? Infinity : aColumn\n          });\n          return {\n            url: this._generatedUrlsByOriginalUrl[aSourceUrl],\n            line: line,\n            column: column\n          };\n        });\n    }\n\n    // No source map\n    return resolve({\n      url: aSourceUrl,\n      line: aLine,\n      column: aColumn\n    });\n  },\n\n  /**\n   * Returns true if URL for the given source is black boxed.\n   *\n   * @param aURL String\n   *        The URL of the source which we are checking whether it is black\n   *        boxed or not.\n   */\n  isBlackBoxed: function TS_isBlackBoxed(aURL) {\n    return ThreadSources._blackBoxedSources.has(aURL);\n  },\n\n  /**\n   * Add the given source URL to the set of sources that are black boxed. If the\n   * thread is currently paused and we are black boxing the yougest frame's\n   * source, this will force a step.\n   *\n   * @param aURL String\n   *        The URL of the source which we are black boxing.\n   */\n  blackBox: function TS_blackBox(aURL) {\n    ThreadSources._blackBoxedSources.add(aURL);\n  },\n\n  /**\n   * Remove the given source URL to the set of sources that are black boxed.\n   *\n   * @param aURL String\n   *        The URL of the source which we are no longer black boxing.\n   */\n  unblackBox: function TS_unblackBox(aURL) {\n    ThreadSources._blackBoxedSources.delete(aURL);\n  },\n\n  /**\n   * Normalize multiple relative paths towards the base paths on the right.\n   */\n  _normalize: function TS__normalize(...aURLs) {\n    dbg_assert(aURLs.length > 1, \"Should have more than 1 URL\");\n    let base = Services.io.newURI(aURLs.pop(), null, null);\n    let url;\n    while ((url = aURLs.pop())) {\n      base = Services.io.newURI(url, null, base);\n    }\n    return base.spec;\n  },\n\n  iter: function TS_iter() {\n    for (let url in this._sourceActors) {\n      yield this._sourceActors[url];\n    }\n  }\n};\n\n// Utility functions.\n\n// TODO bug 863089: use Debugger.Script.prototype.getOffsetColumn when it is\n// implemented.\nfunction getOffsetColumn(aOffset, aScript) {\n  let bestOffsetMapping = null;\n  for (let offsetMapping of aScript.getAllColumnOffsets()) {\n    if (!bestOffsetMapping ||\n        (offsetMapping.offset <= aOffset &&\n         offsetMapping.offset > bestOffsetMapping.offset)) {\n      bestOffsetMapping = offsetMapping;\n    }\n  }\n\n  if (!bestOffsetMapping) {\n    // XXX: Try not to completely break the experience of using the debugger for\n    // the user by assuming column 0. Simultaneously, report the error so that\n    // there is a paper trail if the assumption is bad and the debugging\n    // experience becomes wonky.\n    reportError(new Error(\"Could not find a column for offset \" + aOffset\n                          + \" in the script \" + aScript));\n    return 0;\n  }\n\n  return bestOffsetMapping.columnNumber;\n}\n\n/**\n * Utility function for updating an object with the properties of another\n * object.\n *\n * @param aTarget Object\n *        The object being updated.\n * @param aNewAttrs Object\n *        The new attributes being set on the target.\n */\nfunction update(aTarget, aNewAttrs) {\n  for (let key in aNewAttrs) {\n    let desc = Object.getOwnPropertyDescriptor(aNewAttrs, key);\n\n    if (desc) {\n      Object.defineProperty(aTarget, key, desc);\n    }\n  }\n}\n\n/**\n * Returns true if its argument is not null.\n */\nfunction isNotNull(aThing) {\n  return aThing !== null;\n}\n\n/**\n * Performs a request to load the desired URL and returns a promise.\n *\n * @param aURL String\n *        The URL we will request.\n * @returns Promise\n *        A promise of the document at that URL, as a string.\n *\n * XXX: It may be better to use nsITraceableChannel to get to the sources\n * without relying on caching when we can (not for eval, etc.):\n * http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/\n */\nfunction fetch(aURL, aOptions={ loadFromCache: true }) {\n  let deferred = defer();\n  let scheme;\n  let url = aURL.split(\" -> \").pop();\n  let charset;\n  let filePath = url;\n  // try {\n  //   scheme = Services.io.extractScheme(url);\n  // } catch (e) {\n    // In the xpcshell tests, the script url is the absolute path of the test\n    // file, which will make a malformed URI error be thrown. Add the file\n    // scheme prefix ourselves.\n    url = \"file://\" + url;\n  //   scheme = Services.io.extractScheme(url);\n  // }\n  scheme = \"file\";\n\n  switch (scheme) {\n    case \"file\":\n    case \"chrome\":\n    case \"resource\":\n      try {\n        // NetUtil.asyncFetch(url, function onFetch(aStream, aStatus) {\n          // if (!Components.isSuccessCode(aStatus)) {\n          //   deferred.reject(\"Request failed: \" + url);\n          //   return;\n          // }\n          let cc = globalDebuggee.cc;\n          let fileUtils = cc.FileUtils.getInstance();\n          let source = fileUtils.getStringFromFile(filePath);//NetUtil.readInputStreamToString(aStream, aStream.available());\n          if (!source)\n          {\n            deferred.reject(\"Request failed: \" + url);\n          }\n          else\n          {\n            deferred.resolve(source);\n          }\n          // aStream.close();\n        // });\n      } catch (ex) {\n        deferred.reject(\"Request failed: \" + url);\n      }\n      break;\n\n    default:\n      let channel;\n      try {\n        channel = Services.io.newChannel(url, null, null);\n      } catch (e if e.name == \"NS_ERROR_UNKNOWN_PROTOCOL\") {\n        // On Windows xpcshell tests, c:/foo/bar can pass as a valid URL, but\n        // newChannel won't be able to handle it.\n        url = \"file:///\" + url;\n        channel = Services.io.newChannel(url, null, null);\n      }\n      let chunks = [];\n      let streamListener = {\n        onStartRequest: function(aRequest, aContext, aStatusCode) {\n          if (!Components.isSuccessCode(aStatusCode)) {\n            deferred.reject(new Error(\"Request failed: \" + url));\n          }\n        },\n        onDataAvailable: function(aRequest, aContext, aStream, aOffset, aCount) {\n          chunks.push(NetUtil.readInputStreamToString(aStream, aCount));\n        },\n        onStopRequest: function(aRequest, aContext, aStatusCode) {\n          if (!Components.isSuccessCode(aStatusCode)) {\n            deferred.reject(new Error(\"Request failed: \" + url));\n            return;\n          }\n\n          charset = channel.contentCharset;\n          deferred.resolve(chunks.join(\"\"));\n        }\n      };\n\n      channel.loadFlags = aOptions.loadFromCache\n        ? channel.LOAD_FROM_CACHE\n        : channel.LOAD_BYPASS_CACHE;\n      channel.asyncOpen(streamListener, null);\n      break;\n  }\n\n  return deferred.promise.then(function (source) {\n    return convertToUnicode(source, charset);\n  });\n}\n\n/**\n * Convert a given string, encoded in a given character set, to unicode.\n *\n * @param string aString\n *        A string.\n * @param string aCharset\n *        A character set.\n */\nfunction convertToUnicode(aString, aCharset=null) {\n  // Decoding primitives.\n  // James: return aString directly.\n  // let converter = Cc[\"@mozilla.org/intl/scriptableunicodeconverter\"]\n  //   .createInstance(Ci.nsIScriptableUnicodeConverter);\n  // try {\n  //   converter.charset = aCharset || \"UTF-8\";\n  //   return converter.ConvertToUnicode(aString);\n  // } catch(e) {\n    return aString;\n  // }\n}\n\n/**\n * Report the given error in the error console and to stdout.\n *\n * @param Error aError\n *        The error object you wish to report.\n * @param String aPrefix\n *        An optional prefix for the reported error message.\n */\nfunction reportError(aError, aPrefix=\"\") {\n  dbg_assert(aError instanceof Error, \"Must pass Error objects to reportError\");\n  let msg = aPrefix + aError.message + \":\\n\" + aError.stack;\n  //Cu.reportError(msg);\n  dumpn(msg);\n}\n\n// The following are copied here verbatim from css-logic.js, until we create a\n// server-friendly helper module.\n\n/**\n * Find a unique CSS selector for a given element\n * @returns a string such that ele.ownerDocument.querySelector(reply) === ele\n * and ele.ownerDocument.querySelectorAll(reply).length === 1\n */\nfunction findCssSelector(ele) {\n  var document = ele.ownerDocument;\n  if (ele.id && document.getElementById(ele.id) === ele) {\n    return '#' + ele.id;\n  }\n\n  // Inherently unique by tag name\n  var tagName = ele.tagName.toLowerCase();\n  if (tagName === 'html') {\n    return 'html';\n  }\n  if (tagName === 'head') {\n    return 'head';\n  }\n  if (tagName === 'body') {\n    return 'body';\n  }\n\n  if (ele.parentNode == null) {\n    console.log('danger: ' + tagName);\n  }\n\n  // We might be able to find a unique class name\n  var selector, index, matches;\n  if (ele.classList.length > 0) {\n    for (var i = 0; i < ele.classList.length; i++) {\n      // Is this className unique by itself?\n      selector = '.' + ele.classList.item(i);\n      matches = document.querySelectorAll(selector);\n      if (matches.length === 1) {\n        return selector;\n      }\n      // Maybe it's unique with a tag name?\n      selector = tagName + selector;\n      matches = document.querySelectorAll(selector);\n      if (matches.length === 1) {\n        return selector;\n      }\n      // Maybe it's unique using a tag name and nth-child\n      index = positionInNodeList(ele, ele.parentNode.children) + 1;\n      selector = selector + ':nth-child(' + index + ')';\n      matches = document.querySelectorAll(selector);\n      if (matches.length === 1) {\n        return selector;\n      }\n    }\n  }\n\n  // So we can be unique w.r.t. our parent, and use recursion\n  index = positionInNodeList(ele, ele.parentNode.children) + 1;\n  selector = findCssSelector(ele.parentNode) + ' > ' +\n          tagName + ':nth-child(' + index + ')';\n\n  return selector;\n};\n\n/**\n * Find the position of [element] in [nodeList].\n * @returns an index of the match, or -1 if there is no match\n */\nfunction positionInNodeList(element, nodeList) {\n  for (var i = 0; i < nodeList.length; i++) {\n    if (element === nodeList[i]) {\n      return i;\n    }\n  }\n  return -1;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/debugger/core/promise.js",
    "content": "/* vim:set ts=2 sw=2 sts=2 expandtab */\n/*jshint undef: true es5: true node: true browser: true devel: true\n         forin: true latedef: false */\n/*global define: true, Cu: true, __URI__: true */\n//;(function(id, factory) { // Module boilerplate :(\n//  if (typeof(define) === 'function') { // RequireJS\n//    define(factory);\n//  } else if (typeof(require) === 'function') { // CommonJS\n//    factory.call(this, require, exports, module);\n//  } else if (String(this).indexOf('BackstagePass') >= 0) { // JSM\n//    this[factory.name] = {};\n//    try {\n//      this.console = this['Components'].utils\n//          .import('resource://gre/modules/devtools/Console.jsm', {}).console;\n//    }\n//    catch (ex) {\n//      // Avoid failures on different toolkit configurations.\n//    }\n//    factory(function require(uri) {\n//      var imports = {};\n//      this['Components'].utils.import(uri, imports);\n//      return imports;\n//    }, this[factory.name], { uri: __URI__, id: id });\n//    this.EXPORTED_SYMBOLS = [factory.name];\n//  } else {  // Browser or alike\n//    var globals = this;\n//    factory(function require(id) {\n//      return globals[id];\n//    }, (globals[id] = {}), { uri: document.location.href + '#' + id, id: id });\n//  }\n//}).call(this, 'promise/core', function Promise(require, exports, module) {\n\n'use strict';\n\nvar exports = exports || {};\n\n//module.metadata = {\n//  \"stability\": \"unstable\"\n//};\n\n/**\n * Internal utility: Wraps given `value` into simplified promise, successfully\n * fulfilled to a given `value`. Note the result is not a complete promise\n * implementation, as its method `then` does not returns anything.\n */\nfunction fulfilled(value) {\n  return { then: function then(fulfill) { fulfill(value); } };\n}\n\n/**\n * Internal utility: Wraps given input into simplified promise, pre-rejected\n * with a given `reason`. Note the result is not a complete promise\n * implementation, as its method `then` does not returns anything.\n */\nfunction rejected(reason) {\n  return { then: function then(fulfill, reject) { reject(reason); } };\n}\n\n/**\n * Internal utility: Returns `true` if given `value` is a promise. Value is\n * assumed to be a promise if it implements method `then`.\n */\nfunction isPromise(value) {\n  return value && typeof(value.then) === 'function';\n}\n\n/**\n * Creates deferred object containing fresh promise & methods to either resolve\n * or reject it. The result is an object with the following properties:\n * - `promise` Eventual value representation implementing CommonJS [Promises/A]\n *   (http://wiki.commonjs.org/wiki/Promises/A) API.\n * - `resolve` Single shot function that resolves enclosed `promise` with a\n *   given `value`.\n * - `reject` Single shot function that rejects enclosed `promise` with a given\n *   `reason`.\n *\n * An optional `prototype` argument is used as a prototype of the returned\n * `promise` allowing one to implement additional API. If prototype is not\n * passed then it falls back to `Object.prototype`.\n *\n *  ## Example\n *\n *  function fetchURI(uri, type) {\n *    var deferred = defer();\n *    var request = new XMLHttpRequest();\n *    request.open(\"GET\", uri, true);\n *    request.responseType = type;\n *    request.onload = function onload() {\n *      deferred.resolve(request.response);\n *    }\n *    request.onerror = function(event) {\n *     deferred.reject(event);\n *    }\n *    request.send();\n *\n *    return deferred.promise;\n *  }\n */\nfunction defer(prototype) {\n  // Define FIFO queue of observer pairs. Once promise is resolved & all queued\n  // observers are forwarded to `result` and variable is set to `null`.\n  var observers = [];\n\n  // Promise `result`, which will be assigned a resolution value once promise\n  // is resolved. Note that result will always be assigned promise (or alike)\n  // object to take care of propagation through promise chains. If result is\n  // `null` promise is not resolved yet.\n  var result = null;\n\n  prototype = (prototype || prototype === null) ? prototype : Object.prototype;\n\n  // Create an object implementing promise API.\n  var promise = Object.create(prototype, {\n    then: { value: function then(onFulfill, onError) {\n      var deferred = defer(prototype);\n\n      function resolve(value) {\n        // If `onFulfill` handler is provided resolve `deferred.promise` with\n        // result of invoking it with a resolution value. If handler is not\n        // provided propagate value through.\n        try {\n          deferred.resolve(onFulfill ? onFulfill(value) : value);\n        }\n        // `onFulfill` may throw exception in which case resulting promise\n        // is rejected with thrown exception.\n        catch(error) {\n          if (exports._reportErrors && typeof(console) === 'object')\n            console.error(error);\n          // Note: Following is equivalent of `deferred.reject(error)`,\n          // we use this shortcut to reduce a stack.\n          deferred.resolve(rejected(error));\n        }\n      }\n\n      function reject(reason) {\n        try {\n          if (onError) deferred.resolve(onError(reason));\n          else deferred.resolve(rejected(reason));\n        }\n        catch(error) {\n          if (exports._reportErrors && typeof(console) === 'object')\n            console.error(error);\n          deferred.resolve(rejected(error));\n        }\n      }\n\n      // If enclosed promise (`this.promise`) observers queue is still alive\n      // enqueue a new observer pair into it. Note that this does not\n      // necessary means that promise is pending, it may already be resolved,\n      // but we still have to queue observers to guarantee an order of\n      // propagation.\n      if (observers) {\n        observers.push({ resolve: resolve, reject: reject });\n      }\n      // Otherwise just forward observer pair right to a `result` promise.\n      else {\n        result.then(resolve, reject);\n      }\n\n      return deferred.promise;\n    }}\n  })\n\n  var deferred = {\n    promise: promise,\n    /**\n     * Resolves associated `promise` to a given `value`, unless it's already\n     * resolved or rejected. Note that resolved promise is not necessary a\n     * successfully fulfilled. Promise may be resolved with a promise `value`\n     * in which case `value` promise's fulfillment / rejection will propagate\n     * up to a promise resolved with `value`.\n     */\n    resolve: function resolve(value) {\n      if (!result) {\n        // Store resolution `value` in a `result` as a promise, so that all\n        // the subsequent handlers can be simply forwarded to it. Since\n        // `result` will be a promise all the value / error propagation will\n        // be uniformly taken care of.\n        result = isPromise(value) ? value : fulfilled(value);\n\n        // Forward already registered observers to a `result` promise in the\n        // order they were registered. Note that we intentionally dequeue\n        // observer at a time until queue is exhausted. This makes sure that\n        // handlers registered as side effect of observer forwarding are\n        // queued instead of being invoked immediately, guaranteeing FIFO\n        // order.\n        while (observers.length) {\n          var observer = observers.shift();\n          result.then(observer.resolve, observer.reject);\n        }\n\n        // Once `observers` queue is exhausted we `null`-ify it, so that\n        // new handlers are forwarded straight to the `result`.\n        observers = null;\n      }\n    },\n    /**\n     * Rejects associated `promise` with a given `reason`, unless it's already\n     * resolved / rejected. This is just a (better performing) convenience\n     * shortcut for `deferred.resolve(reject(reason))`.\n     */\n    reject: function reject(reason) {\n      // Note that if promise is resolved that does not necessary means that it\n      // is successfully fulfilled. Resolution value may be a promise in which\n      // case its result propagates. In other words if promise `a` is resolved\n      // with promise `b`, `a` is either fulfilled or rejected depending\n      // on weather `b` is fulfilled or rejected. Here `deferred.promise` is\n      // resolved with a promise pre-rejected with a given `reason`, there for\n      // `deferred.promise` is rejected with a given `reason`. This may feel\n      // little awkward first, but doing it this way greatly simplifies\n      // propagation through promise chains.\n      deferred.resolve(rejected(reason));\n    }\n  };\n\n  return deferred;\n}\nexports.defer = defer;\n\n/**\n * Returns a promise resolved to a given `value`. Optionally a second\n * `prototype` argument may be provided to be used as a prototype for the\n * returned promise.\n */\nfunction resolve(value, prototype) {\n  var deferred = defer(prototype);\n  deferred.resolve(value);\n  return deferred.promise;\n}\nexports.resolve = resolve;\n\n/**\n * Returns a promise rejected with a given `reason`. Optionally a second\n * `prototype` argument may be provided to be used as a prototype for the\n * returned promise.\n */\nfunction reject(reason, prototype) {\n  var deferred = defer(prototype);\n  deferred.reject(reason);\n  return deferred.promise;\n}\nexports.reject = reject;\n\nvar promised = (function() {\n  // Note: Define shortcuts and utility functions here in order to avoid\n  // slower property accesses and unnecessary closure creations on each\n  // call of this popular function.\n\n  var call = Function.call;\n  var concat = Array.prototype.concat;\n\n  // Utility function that does following:\n  // execute([ f, self, args...]) => f.apply(self, args)\n  function execute(args) { return call.apply(call, args) }\n\n  // Utility function that takes promise of `a` array and maybe promise `b`\n  // as arguments and returns promise for `a.concat(b)`.\n  function promisedConcat(promises, unknown) {\n    return promises.then(function(values) {\n      return resolve(unknown).then(function(value) {\n        return values.concat([ value ]);\n      });\n    });\n  }\n\n  return function promised(f, prototype) {\n    /**\n    Returns a wrapped `f`, which when called returns a promise that resolves to\n    `f(...)` passing all the given arguments to it, which by the way may be\n    promises. Optionally second `prototype` argument may be provided to be used\n    a prototype for a returned promise.\n\n    ## Example\n\n    var promise = promised(Array)(1, promise(2), promise(3))\n    promise.then(console.log) // => [ 1, 2, 3 ]\n    **/\n\n    return function promised() {\n      // create array of [ f, this, args... ]\n      return concat.apply([ f, this ], arguments).\n        // reduce it via `promisedConcat` to get promised array of fulfillments\n        reduce(promisedConcat, resolve([], prototype)).\n        // finally map that to promise of `f.apply(this, args...)`\n        then(execute);\n    };\n  }\n})();\nexports.promised = promised;\n//\nvar all = promised(Array);\nexports.all = all;\n//\n//});\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/debugger/main.js",
    "content": "/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ft=javascript ts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n\"use strict\";\n/**\n * Toolkit glue for the remote debugging protocol, loaded into the\n * debugging global.\n */\n\n/*\nconst Ci = Components.interfaces;\nconst Cc = Components.classes;\nconst CC = Components.Constructor;\nconst Cu = Components.utils;\nconst Cr = Components.results;\nconst DBG_STRINGS_URI = \"chrome://global/locale/devtools/debugger.properties\";\n\nCu.import(\"resource://gre/modules/Services.jsm\");\nCu.import(\"resource://gre/modules/XPCOMUtils.jsm\");\nlet wantLogging = Services.prefs.getBoolPref(\"devtools.debugger.log\");\n\nCu.import(\"resource://gre/modules/jsdebugger.jsm\");\naddDebuggerToGlobal(this);\n\nloadSubScript.call(this, \"resource://gre/modules/commonjs/sdk/core/promise.js\");\n\nCu.import(\"resource://gre/modules/devtools/SourceMap.jsm\");\n\nloadSubScript.call(this, \"resource://gre/modules/devtools/DevToolsUtils.js\");\n*/\n\nlet wantLogging = true;\nlet debuggerServer = null;\n\nfunction dumpn(str) {\n  if (wantLogging) {\n    log(\"DBG-SERVER: \" + str + \"\\n\");\n  }\n}\n\nfunction dbg_assert(cond, e) {\n  if (!cond) {\n    log(\"assert >>>> \" + cond.toString());\n    return e;\n  }\n}\n\nfunction XPCInspector() {\n  this.exitNestedEventLoop = _exitNestedEventLoop;\n  this.enterNestedEventLoop = _enterNestedEventLoop;\n  this.eventLoopNestLevel = _getEventLoopNestLevel;\n}\n\n//loadSubScript.call(this, \"resource://gre/modules/devtools/server/transport.js\");\n\n// XPCOM constructors\n// const ServerSocket = CC(\"@mozilla.org/network/server-socket;1\",\n//                         \"nsIServerSocket\",\n//                         \"initSpecialConnection\");\n\nfunction ServerSocket(aPort, flags, c){\n  this.asyncListen = function(server){\n      log(\"asyncListen....\");\n      debuggerServer = server;\n  };\n};\n\nvar gRegisteredModules = Object.create(null);\n\n/**\n * The ModuleAPI object is passed to modules loaded using the\n * DebuggerServer.registerModule() API.  Modules can use this\n * object to register actor factories.\n * Factories registered through the module API will be removed\n * when the module is unregistered or when the server is\n * destroyed.\n */\nfunction ModuleAPI() {\n  let activeTabActors = new Set();\n  let activeGlobalActors = new Set();\n\n  return {\n    // See DebuggerServer.addGlobalActor for a description.\n    addGlobalActor: function(factory, name) {\n      DebuggerServer.addGlobalActor(factory, name);\n      activeGlobalActors.add(factory);\n    },\n    // See DebuggerServer.removeGlobalActor for a description.\n    removeGlobalActor: function(factory) {\n      DebuggerServer.removeGlobalActor(factory);\n      activeGlobalActors.delete(factory);\n    },\n\n    // See DebuggerServer.addTabActor for a description.\n    addTabActor: function(factory, name) {\n      DebuggerServer.addTabActor(factory, name);\n      activeTabActors.add(factory);\n    },\n    // See DebuggerServer.removeTabActor for a description.\n    removeTabActor: function(factory) {\n      DebuggerServer.removeTabActor(factory);\n      activeTabActors.delete(factory);\n    },\n\n    // Destroy the module API object, unregistering any\n    // factories registered by the module.\n    destroy: function() {\n      for (let factory of activeTabActors) {\n        DebuggerServer.removeTabActor(factory);\n      }\n      activeTabActors = null;\n      for (let factory of activeGlobalActors) {\n        DebuggerServer.removeGlobalActor(factory);\n      }\n      activeGlobalActors = null;\n    }\n  }\n};\n\n/***\n * Public API\n */\nvar DebuggerServer = {\n  _listener: null,\n  _initialized: false,\n  _transportInitialized: false,\n  xpcInspector: null,\n  _transport: null, // James added\n  // Number of currently open TCP connections.\n  _socketConnections: 0,\n  // Map of global actor names to actor constructors provided by extensions.\n  globalActorFactories: {},\n  // Map of tab actor names to actor constructors provided by extensions.\n  tabActorFactories: {},\n\n  LONG_STRING_LENGTH: 10000,\n  LONG_STRING_INITIAL_LENGTH: 1000,\n  LONG_STRING_READ_LENGTH: 1000,\n\n  /**\n   * A handler function that prompts the user to accept or decline the incoming\n   * connection.\n   */\n  _allowConnection: null,\n\n  /**\n   * The windowtype of the chrome window to use for actors that use the global\n   * window (i.e the global style editor). Set this to your main window type,\n   * for example \"navigator:browser\".\n   */\n  chromeWindowType: null,\n\n  /**\n   * Prompt the user to accept or decline the incoming connection. This is the\n   * default implementation that products embedding the debugger server may\n   * choose to override.\n   *\n   * @return true if the connection should be permitted, false otherwise\n   */\n  _defaultAllowConnection: function DS__defaultAllowConnection() {\n    // let title = L10N.getStr(\"remoteIncomingPromptTitle\");\n    // let msg = L10N.getStr(\"remoteIncomingPromptMessage\");\n    // let disableButton = L10N.getStr(\"remoteIncomingPromptDisable\");\n    // let prompt = Services.prompt;\n    // let flags = prompt.BUTTON_POS_0 * prompt.BUTTON_TITLE_OK +\n    //             prompt.BUTTON_POS_1 * prompt.BUTTON_TITLE_CANCEL +\n    //             prompt.BUTTON_POS_2 * prompt.BUTTON_TITLE_IS_STRING +\n    //             prompt.BUTTON_POS_1_DEFAULT;\n    // let result = prompt.confirmEx(null, title, msg, flags, null, null,\n    //                               disableButton, null, { value: false });\n    // if (result == 0) {\n    //   return true;\n    // }\n    // if (result == 2) {\n    //   DebuggerServer.closeListener(true);\n    //   Services.prefs.setBoolPref(\"devtools.debugger.remote-enabled\", false);\n    // }\n    // return false;\n    return true;\n  },\n\n  /**\n   * Initialize the debugger server.\n   *\n   * @param function aAllowConnectionCallback\n   *        The embedder-provider callback, that decides whether an incoming\n   *        remote protocol conection should be allowed or refused.\n   */\n  init: function DS_init(aAllowConnectionCallback) {\n    if (this.initialized) {\n      return;\n    }\n\n    this.xpcInspector = new XPCInspector();//Cc[\"@mozilla.org/jsinspector;1\"].getService(Ci.nsIJSInspector);\n    this.initTransport(aAllowConnectionCallback);\n    this.addActors(\"resource://gre/modules/devtools/server/actors/root.js\");\n\n    this._initialized = true;\n  },\n\n  /**\n   * Initialize the debugger server's transport variables.  This can be\n   * in place of init() for cases where the jsdebugger isn't needed.\n   *\n   * @param function aAllowConnectionCallback\n   *        The embedder-provider callback, that decides whether an incoming\n   *        remote protocol conection should be allowed or refused.\n   */\n  initTransport: function DS_initTransport(aAllowConnectionCallback) {\n    if (this._transportInitialized) {\n      return;\n    }\n\n    this._connections = {};\n    this._nextConnID = 0;\n    this._transportInitialized = true;\n    this._allowConnection = aAllowConnectionCallback ?\n                            aAllowConnectionCallback :\n                            this._defaultAllowConnection;\n  },\n\n  get initialized() this._initialized,\n\n  /**\n   * Performs cleanup tasks before shutting down the debugger server. Such tasks\n   * include clearing any actor constructors added at runtime. This method\n   * should be called whenever a debugger server is no longer useful, to avoid\n   * memory leaks. After this method returns, the debugger server must be\n   * initialized again before use.\n   */\n  destroy: function DS_destroy() {\n    if (!this._initialized) {\n      return;\n    }\n\n    for (let connID of Object.getOwnPropertyNames(this._connections)) {\n      this._connections[connID].close();\n    }\n\n    for (let id of Object.getOwnPropertyNames(gRegisteredModules)) {\n      let mod = gRegisteredModules[id];\n      mod.module.unregister(mod.api);\n    }\n    gRegisteredModules = {};\n\n    this.closeListener();\n    this.globalActorFactories = {};\n    this.tabActorFactories = {};\n    delete this._allowConnection;\n    this._transportInitialized = false;\n    this._initialized = false;\n    dumpn(\"Debugger server is shut down.\");\n  },\n\n  /**\n   * Load a subscript into the debugging global.\n   *\n   * @param aURL string A url that will be loaded as a subscript into the\n   *        debugging global.  The user must load at least one script\n   *        that implements a createRootActor() function to create the\n   *        server's root actor.\n   */\n  addActors: function DS_addActors(aURL) {\n    //loadSubScript.call(this, aURL);\n  },\n\n  /**\n   * Register a CommonJS module with the debugger server.\n   * @param id string\n   *    The ID of a CommonJS module.  This module must export\n   *    'register' and 'unregister' functions.\n   */\n  registerModule: function(id) {\n    if (id in gRegisteredModules) {\n      throw new Error(\"Tried to register a module twice: \" + id + \"\\n\");\n    }\n\n    let moduleAPI = ModuleAPI();\n\n    let {devtools} = Cu.import(\"resource://gre/modules/devtools/Loader.jsm\", {});\n    let mod = devtools.require(id);\n    mod.register(moduleAPI);\n    gRegisteredModules[id] = { module: mod, api: moduleAPI };\n  },\n\n  /**\n   * Returns true if a module id has been registered.\n   */\n  isModuleRegistered: function(id) {\n    return (id in gRegisteredModules);\n  },\n\n  /**\n   * Unregister a previously-loaded CommonJS module from the debugger server.\n   */\n  unregisterModule: function(id) {\n    let mod = gRegisteredModules[id];\n    if (!mod) {\n      throw new Error(\"Tried to unregister a module that was not previously registered.\");\n    }\n    mod.module.unregister(mod.api);\n    mod.api.destroy();\n    delete gRegisteredModules[id];\n  },\n\n  /**\n   * Install Firefox-specific actors.\n   */\n  addBrowserActors: function DS_addBrowserActors() {\n    this.chromeWindowType = \"navigator:browser\";\n    this.addActors(\"resource://gre/modules/devtools/server/actors/webbrowser.js\");\n    this.addActors(\"resource://gre/modules/devtools/server/actors/script.js\");\n    this.addGlobalActor(this.ChromeDebuggerActor, \"chromeDebugger\");\n    this.addActors(\"resource://gre/modules/devtools/server/actors/webconsole.js\");\n    this.addActors(\"resource://gre/modules/devtools/server/actors/gcli.js\");\n    if (\"nsIProfiler\" in Ci)\n      this.addActors(\"resource://gre/modules/devtools/server/actors/profiler.js\");\n\n    this.addActors(\"resource://gre/modules/devtools/server/actors/styleeditor.js\");\n    this.addActors(\"resource://gre/modules/devtools/server/actors/webapps.js\");\n    this.registerModule(\"devtools/server/actors/inspector\");\n    this.registerModule(\"devtools/server/actors/tracer\");\n  },\n\n  /**\n   * Install tab actors in documents loaded in content childs\n   */\n  addChildActors: function () {\n    // In case of apps being loaded in parent process, DebuggerServer is already\n    // initialized and browser actors are already loaded,\n    // but childtab.js hasn't been loaded yet.\n    if (!(\"BrowserTabActor\" in this)) {\n      this.addActors(\"resource://gre/modules/devtools/server/actors/webbrowser.js\");\n      this.addActors(\"resource://gre/modules/devtools/server/actors/script.js\");\n      this.addActors(\"resource://gre/modules/devtools/server/actors/webconsole.js\");\n      this.addActors(\"resource://gre/modules/devtools/server/actors/gcli.js\");\n      this.addActors(\"resource://gre/modules/devtools/server/actors/styleeditor.js\");\n      this.registerModule(\"devtools/server/actors/inspector\");\n    }\n    if (!(\"ContentTabActor\" in DebuggerServer)) {\n      this.addActors(\"resource://gre/modules/devtools/server/actors/childtab.js\");\n    }\n  },\n\n  /**\n   * Listens on the given port for remote debugger connections.\n   *\n   * @param aPort int\n   *        The port to listen on.\n   */\n  openListener: function DS_openListener(aPort) {\n    // if (!Services.prefs.getBoolPref(\"devtools.debugger.remote-enabled\")) {\n    //   return false;\n    // }\n    this._checkInit();\n\n    // Return early if the server is already listening.\n    if (this._listener) {\n      return true;\n    }\n\n    // let flags = Ci.nsIServerSocket.KeepWhenOffline;\n    // A preference setting can force binding on the loopback interface.\n    // if (Services.prefs.getBoolPref(\"devtools.debugger.force-local\")) {\n    //   flags |= Ci.nsIServerSocket.LoopbackOnly;\n    // }\n\n    let flags = 0;\n    try {\n      let socket = new ServerSocket(aPort, flags, 4);\n      socket.asyncListen(this);\n      this._listener = socket;\n    } catch (e) {\n      dumpn(\"Could not start debugging listener on port \" + aPort + \": \" + e);\n      throw \"Cr.NS_ERROR_NOT_AVAILABLE\";\n    }\n    this._socketConnections++;\n\n    return true;\n  },\n\n  /**\n   * Close a previously-opened TCP listener.\n   *\n   * @param aForce boolean [optional]\n   *        If set to true, then the socket will be closed, regardless of the\n   *        number of open connections.\n   */\n  closeListener: function DS_closeListener(aForce) {\n    if (!this._listener || this._socketConnections == 0) {\n      return false;\n    }\n\n    // Only close the listener when the last connection is closed, or if the\n    // aForce flag is passed.\n    if (--this._socketConnections == 0 || aForce) {\n      this._listener.close();\n      this._listener = null;\n      this._socketConnections = 0;\n    }\n\n    return true;\n  },\n\n  /**\n   * Creates a new connection to the local debugger speaking over a fake\n   * transport. This connection results in straightforward calls to the onPacket\n   * handlers of each side.\n   *\n   * @param aPrefix string [optional]\n   *    If given, all actors in this connection will have names starting\n   *    with |aPrefix + ':'|.\n   * @returns a client-side DebuggerTransport for communicating with\n   *    the newly-created connection.\n   */\n  connectPipe: function DS_connectPipe(aPrefix) {\n    this._checkInit();\n\n    let serverTransport = new LocalDebuggerTransport;\n    let clientTransport = new LocalDebuggerTransport(serverTransport);\n    serverTransport.other = clientTransport;\n    let connection = this._onConnection(serverTransport, aPrefix);\n\n    // I'm putting this here because I trust you.\n    //\n    // There are times, when using a local connection, when you're going\n    // to be tempted to just get direct access to the server.  Resist that\n    // temptation!  If you succumb to that temptation, you will make the\n    // fine developers that work on Fennec and Firefox OS sad.  They're\n    // professionals, they'll try to act like they understand, but deep\n    // down you'll know that you hurt them.\n    //\n    // This reference allows you to give in to that temptation.  There are\n    // times this makes sense: tests, for example, and while porting a\n    // previously local-only codebase to the remote protocol.\n    //\n    // But every time you use this, you will feel the shame of having\n    // used a property that starts with a '_'.\n    clientTransport._serverConnection = connection;\n\n    return clientTransport;\n  },\n\n  /**\n   * In a content child process, create a new connection that exchanges\n   * nsIMessageSender messages with our parent process.\n   *\n   * @param aPrefix\n   *    The prefix we should use in our nsIMessageSender message names and\n   *    actor names. This connection will use messages named\n   *    \"debug:<prefix>:packet\", and all its actors will have names\n   *    beginning with \"<prefix>:\".\n   */\n  connectToParent: function(aPrefix, aMessageManager) {\n    this._checkInit();\n\n    let transport = new ChildDebuggerTransport(aMessageManager, aPrefix);\n    return this._onConnection(transport, aPrefix, true);\n  },\n\n  // nsIServerSocketListener implementation\n\n  onSocketAccepted:\n  makeInfallible(function DS_onSocketAccepted(aSocket, aTransport) {\n    if (!this._allowConnection()) {\n      return;\n    }\n    dumpn(\"New debugging connection on \" + aTransport.host + \":\" + aTransport.port);\n\n    let input = aTransport.openInputStream(0, 0, 0);\n    let output = aTransport.openOutputStream(0, 0, 0);\n    let transport = new DebuggerTransport(input, output);\n    DebuggerServer._onConnection(transport);\n  }, \"DebuggerServer.onSocketAccepted\"),\n\n  onStopListening: function DS_onStopListening(aSocket, status) {\n    dumpn(\"onStopListening, status: \" + status);\n  },\n\n  /**\n   * Raises an exception if the server has not been properly initialized.\n   */\n  _checkInit: function DS_checkInit() {\n    if (!this._transportInitialized) {\n      throw \"DebuggerServer has not been initialized.\";\n    }\n\n    if (!this.createRootActor) {\n      throw \"Use DebuggerServer.addActors() to add a root actor implementation.\";\n    }\n  },\n\n  /**\n   * Create a new debugger connection for the given transport. Called after\n   * connectPipe(), from connectToParent, or from an incoming socket\n   * connection handler.\n   *\n   * If present, |aForwardingPrefix| is a forwarding prefix that a parent\n   * server is using to recognizes messages intended for this server. Ensure\n   * that all our actors have names beginning with |aForwardingPrefix + ':'|.\n   * In particular, the root actor's name will be |aForwardingPrefix + ':root'|.\n   */\n  _onConnection: function DS_onConnection(aTransport, aForwardingPrefix, aNoRootActor = false) {\n    let connID;\n    this._transport = aTransport;\n    if (aForwardingPrefix) {\n      connID = aForwardingPrefix + \":\";\n    } else {\n      connID = \"conn\" + this._nextConnID++ + '.';\n    }\n    let conn = new DebuggerServerConnection(connID, aTransport);\n    this._connections[connID] = conn;\n\n    // Create a root actor for the connection and send the hello packet.\n    if (!aNoRootActor) {\n      conn.rootActor = this.createRootActor(conn);\n      if (aForwardingPrefix)\n        conn.rootActor.actorID = aForwardingPrefix + \":root\";\n      else\n        conn.rootActor.actorID = \"root\";\n      conn.addActor(conn.rootActor);\n      aTransport.send(conn.rootActor.sayHello());\n    }\n    aTransport.ready();\n\n    return conn;\n  },\n\n  /**\n   * Remove the connection from the debugging server.\n   */\n  _connectionClosed: function DS_connectionClosed(aConnection) {\n    delete this._connections[aConnection.prefix];\n  },\n\n  // DebuggerServer extension API.\n\n  /**\n   * Registers handlers for new tab-scoped request types defined dynamically.\n   * This is used for example by add-ons to augment the functionality of the tab\n   * actor. Note that the name or actorPrefix of the request type is not allowed\n   * to clash with existing protocol packet properties, like 'title', 'url' or\n   * 'actor', since that would break the protocol.\n   *\n   * @param aFunction function\n   *        The constructor function for this request type. This expects to be\n   *        called as a constructor (i.e. with 'new'), and passed two\n   *        arguments: the DebuggerServerConnection, and the BrowserTabActor\n   *        with which it will be associated.\n   *\n   * @param aName string [optional]\n   *        The name of the new request type. If this is not present, the\n   *        actorPrefix property of the constructor prototype is used.\n   */\n  addTabActor: function DS_addTabActor(aFunction, aName) {\n    let name = aName ? aName : aFunction.prototype.actorPrefix;\n    if ([\"title\", \"url\", \"actor\"].indexOf(name) != -1) {\n      throw Error(name + \" is not allowed\");\n    }\n    if (DebuggerServer.tabActorFactories.hasOwnProperty(name)) {\n      throw Error(name + \" already exists\");\n    }\n    DebuggerServer.tabActorFactories[name] = aFunction;\n  },\n\n  /**\n   * Unregisters the handler for the specified tab-scoped request type.\n   * This may be used for example by add-ons when shutting down or upgrading.\n   *\n   * @param aFunction function\n   *        The constructor function for this request type.\n   */\n  removeTabActor: function DS_removeTabActor(aFunction) {\n    for (let name in DebuggerServer.tabActorFactories) {\n      let handler = DebuggerServer.tabActorFactories[name];\n      if (handler.name == aFunction.name) {\n        delete DebuggerServer.tabActorFactories[name];\n      }\n    }\n  },\n\n  /**\n   * Registers handlers for new browser-scoped request types defined\n   * dynamically. This is used for example by add-ons to augment the\n   * functionality of the root actor. Note that the name or actorPrefix of the\n   * request type is not allowed to clash with existing protocol packet\n   * properties, like 'from', 'tabs' or 'selected', since that would break the\n   * protocol.\n   *\n   * @param aFunction function\n   *        The constructor function for this request type. This expects to be\n   *        called as a constructor (i.e. with 'new'), and passed two\n   *        arguments: the DebuggerServerConnection, and the BrowserRootActor\n   *        with which it will be associated.\n   *\n   * @param aName string [optional]\n   *        The name of the new request type. If this is not present, the\n   *        actorPrefix property of the constructor prototype is used.\n   */\n  addGlobalActor: function DS_addGlobalActor(aFunction, aName) {\n    let name = aName ? aName : aFunction.prototype.actorPrefix;\n    if ([\"from\", \"tabs\", \"selected\"].indexOf(name) != -1) {\n      throw Error(name + \" is not allowed\");\n    }\n    if (DebuggerServer.globalActorFactories.hasOwnProperty(name)) {\n      throw Error(name + \" already exists\");\n    }\n    DebuggerServer.globalActorFactories[name] = aFunction;\n  },\n\n  /**\n   * Unregisters the handler for the specified browser-scoped request type.\n   * This may be used for example by add-ons when shutting down or upgrading.\n   *\n   * @param aFunction function\n   *        The constructor function for this request type.\n   */\n  removeGlobalActor: function DS_removeGlobalActor(aFunction) {\n    for (let name in DebuggerServer.globalActorFactories) {\n      let handler = DebuggerServer.globalActorFactories[name];\n      if (handler.name == aFunction.name) {\n        delete DebuggerServer.globalActorFactories[name];\n      }\n    }\n  }\n};\n\n\n/**\n * Construct an ActorPool.\n *\n * ActorPools are actorID -> actor mapping and storage.  These are\n * used to accumulate and quickly dispose of groups of actors that\n * share a lifetime.\n */\nfunction ActorPool(aConnection)\n{\n  this.conn = aConnection;\n  this._cleanups = {};\n  this._actors = {};\n}\n\nActorPool.prototype = {\n  /**\n   * Add an actor to the actor pool.  If the actor doesn't have an ID,\n   * allocate one from the connection.\n   *\n   * @param aActor object\n   *        The actor implementation.  If the object has a\n   *        'disconnect' property, it will be called when the actor\n   *        pool is cleaned up.\n   */\n  addActor: function AP_addActor(aActor) {\n    aActor.conn = this.conn;\n    if (!aActor.actorID) {\n      let prefix = aActor.actorPrefix;\n      if (typeof aActor == \"function\") {\n        prefix = aActor.prototype.actorPrefix;\n      }\n      aActor.actorID = this.conn.allocID(prefix || undefined);\n    }\n\n    if (aActor.registeredPool) {\n      aActor.registeredPool.removeActor(aActor);\n    }\n    aActor.registeredPool = this;\n\n    this._actors[aActor.actorID] = aActor;\n    if (aActor.disconnect) {\n      this._cleanups[aActor.actorID] = aActor;\n    }\n  },\n\n  get: function AP_get(aActorID) {\n    return this._actors[aActorID];\n  },\n\n  has: function AP_has(aActorID) {\n    return aActorID in this._actors;\n  },\n\n  /**\n   * Returns true if the pool is empty.\n   */\n  isEmpty: function AP_isEmpty() {\n    return Object.keys(this._actors).length == 0;\n  },\n\n  /**\n   * Remove an actor from the actor pool.\n   */\n  removeActor: function AP_remove(aActor) {\n    delete this._actors[aActor.actorID];\n    delete this._cleanups[aActor.actorID];\n  },\n\n  /**\n   * Match the api expected by the protocol library.\n   */\n  unmanage: function(aActor) {\n    return this.removeActor(aActor);\n  },\n\n  /**\n   * Run all actor cleanups.\n   */\n  cleanup: function AP_cleanup() {\n    for each (let actor in this._cleanups) {\n      actor.disconnect();\n    }\n    this._cleanups = {};\n  }\n}\n\n/**\n * Creates a DebuggerServerConnection.\n *\n * Represents a connection to this debugging global from a client.\n * Manages a set of actors and actor pools, allocates actor ids, and\n * handles incoming requests.\n *\n * @param aPrefix string\n *        All actor IDs created by this connection should be prefixed\n *        with aPrefix.\n * @param aTransport transport\n *        Packet transport for the debugging protocol.\n */\nfunction DebuggerServerConnection(aPrefix, aTransport)\n{\n  this._prefix = aPrefix;\n  this._transport = aTransport;\n  this._transport.hooks = this;\n  this._nextID = 1;\n\n  this._actorPool = new ActorPool(this);\n  this._extraPools = [];\n\n  /*\n   * We can forward packets to other servers, if the actors on that server\n   * all use a distinct prefix on their names. This is a map from prefixes\n   * to transports: it maps a prefix P to a transport T if T conveys\n   * packets to the server whose actors' names all begin with P + \":\".\n   */\n  this._forwardingPrefixes = new Map;\n}\n\nDebuggerServerConnection.prototype = {\n  _prefix: null,\n  get prefix() { return this._prefix },\n\n  _transport: null,\n  get transport() { return this._transport },\n\n  close: function() {\n    this._transport.close();\n  },\n\n  send: function DSC_send(aPacket) {\n    this.transport.send(aPacket);\n  },\n\n  allocID: function DSC_allocID(aPrefix) {\n    return this.prefix + (aPrefix || '') + this._nextID++;\n  },\n\n  /**\n   * Add a map of actor IDs to the connection.\n   */\n  addActorPool: function DSC_addActorPool(aActorPool) {\n    this._extraPools.push(aActorPool);\n  },\n\n  /**\n   * Remove a previously-added pool of actors to the connection.\n   *\n   * @param ActorPool aActorPool\n   *        The ActorPool instance you want to remove.\n   * @param boolean aCleanup\n   *        True if you want to disconnect each actor from the pool, false\n   *        otherwise.\n   */\n  removeActorPool: function DSC_removeActorPool(aActorPool, aCleanup) {\n    let index = this._extraPools.lastIndexOf(aActorPool);\n    if (index > -1) {\n      let pool = this._extraPools.splice(index, 1);\n      if (aCleanup) {\n        pool.map(function(p) { p.cleanup(); });\n      }\n    }\n  },\n\n  /**\n   * Add an actor to the default actor pool for this connection.\n   */\n  addActor: function DSC_addActor(aActor) {\n    this._actorPool.addActor(aActor);\n  },\n\n  /**\n   * Remove an actor to the default actor pool for this connection.\n   */\n  removeActor: function DSC_removeActor(aActor) {\n    this._actorPool.removeActor(aActor);\n  },\n\n  /**\n   * Match the api expected by the protocol library.\n   */\n  unmanage: function(aActor) {\n    return this.removeActor(aActor);\n  },\n\n  /**\n   * Look up an actor implementation for an actorID.  Will search\n   * all the actor pools registered with the connection.\n   *\n   * @param aActorID string\n   *        Actor ID to look up.\n   */\n  getActor: function DSC_getActor(aActorID) {\n    let pool = this.poolFor(aActorID);\n    if (pool) {\n      return pool.get(aActorID);\n    }\n\n    if (aActorID === \"root\") {\n      return this.rootActor;\n    }\n\n    return null;\n  },\n\n  poolFor: function DSC_actorPool(aActorID) {\n    if (this._actorPool && this._actorPool.has(aActorID)) {\n      return this._actorPool;\n    }\n\n    for (let pool of this._extraPools) {\n      if (pool.has(aActorID)) {\n        return pool;\n      }\n    }\n    return null;\n  },\n\n  _unknownError: function DSC__unknownError(aPrefix, aError) {\n    let errorString = safeErrorString(aError);\n    errorString += \"\\n\" + aError.stack;\n    // Cu.reportError(errorString);\n    dumpn(errorString);\n    return {\n      error: \"unknownError\",\n      message: (aPrefix + \"': \" + errorString)\n    };\n  },\n\n  /* Forwarding packets to other transports based on actor name prefixes. */\n\n  /*\n   * Arrange to forward packets to another server. This is how we\n   * forward debugging connections to child processes.\n   *\n   * If we receive a packet for an actor whose name begins with |aPrefix|\n   * followed by ':', then we will forward that packet to |aTransport|.\n   *\n   * This overrides any prior forwarding for |aPrefix|.\n   *\n   * @param aPrefix string\n   *    The actor name prefix, not including the ':'.\n   * @param aTransport object\n   *    A packet transport to which we should forward packets to actors\n   *    whose names begin with |(aPrefix + ':').|\n   */\n  setForwarding: function(aPrefix, aTransport) {\n    this._forwardingPrefixes.set(aPrefix, aTransport);\n  },\n\n  /*\n   * Stop forwarding messages to actors whose names begin with\n   * |aPrefix+':'|. Such messages will now elicit 'noSuchActor' errors.\n   */\n  cancelForwarding: function(aPrefix) {\n    this._forwardingPrefixes.delete(aPrefix);\n  },\n\n  // Transport hooks.\n\n  /**\n   * Called by DebuggerTransport to dispatch incoming packets as appropriate.\n   *\n   * @param aPacket object\n   *        The incoming packet.\n   */\n  onPacket: function DSC_onPacket(aPacket) {\n    // If the actor's name begins with a prefix we've been asked to\n    // forward, do so.\n    //\n    // Note that the presence of a prefix alone doesn't indicate that\n    // forwarding is needed: in DebuggerServerConnection instances in child\n    // processes, every actor has a prefixed name.\n\n    if (this._forwardingPrefixes.size > 0) {\n      let colon = aPacket.to.indexOf(':');\n      if (colon >= 0) {\n        let forwardTo = this._forwardingPrefixes.get(aPacket.to.substring(0, colon));\n        if (forwardTo) {\n          forwardTo.send(aPacket);\n          return;\n        }\n      }\n    }\n\n    let actor = this.getActor(aPacket.to);\n    if (!actor) {\n      this.transport.send({ from: aPacket.to ? aPacket.to : \"root\",\n                            error: \"noSuchActor\" });\n      return;\n    }\n\n    // Dyamically-loaded actors have to be created lazily.\n    if (typeof actor == \"function\") {\n      let instance;\n      try {\n        instance = new actor();\n      } catch (e) {\n        this.transport.send(this._unknownError(\n          \"Error occurred while creating actor '\" + actor.name,\n          e));\n      }\n      instance.parentID = actor.parentID;\n      // We want the newly-constructed actor to completely replace the factory\n      // actor. Reusing the existing actor ID will make sure ActorPool.addActor\n      // does the right thing.\n      instance.actorID = actor.actorID;\n      actor.registeredPool.addActor(instance);\n      actor = instance;\n    }\n\n    var ret = null;\n    // Dispatch the request to the actor.\n    if (actor.requestTypes && actor.requestTypes[aPacket.type]) {\n      try {\n        this.currentPacket = aPacket;\n        ret = actor.requestTypes[aPacket.type].bind(actor)(aPacket, this);\n      } catch(e) {\n        this.transport.send(this._unknownError(\n          \"error occurred while processing '\" + aPacket.type,\n          e));\n      } finally {\n        delete this.currentPacket;\n      }\n    } else {\n      ret = { error: \"unrecognizedPacketType\",\n              message: ('Actor \"' + actor.actorID +\n                        '\" does not recognize the packet type \"' +\n                        aPacket.type + '\"') };\n    }\n\n    if (!ret) {\n      // This should become an error once we've converted every user\n      // of this to promises in bug 794078.\n      return;\n    }\n\n    resolve(ret)\n      .then(function (aResponse) {\n        if (!aResponse.from) {\n          aResponse.from = aPacket.to;\n        }\n        return aResponse;\n      })\n      .then(this.transport.send.bind(this.transport))\n      .then(null, (e) => {\n        return this._unknownError(\n          \"error occurred while processing '\" + aPacket.type,\n          e);\n      });\n  },\n\n  /**\n   * Called by DebuggerTransport when the underlying stream is closed.\n   *\n   * @param aStatus nsresult\n   *        The status code that corresponds to the reason for closing\n   *        the stream.\n   */\n  onClosed: function DSC_onClosed(aStatus) {\n    dumpn(\"Cleaning up connection.\");\n\n    this._actorPool.cleanup();\n    this._actorPool = null;\n    this._extraPools.map(function(p) { p.cleanup(); });\n    this._extraPools = null;\n\n    DebuggerServer._connectionClosed(this);\n  },\n\n  /*\n   * Debugging helper for inspecting the state of the actor pools.\n   */\n  _dumpPools: function DSC_dumpPools() {\n    dumpn(\"/-------------------- dumping pools:\");\n    if (this._actorPool) {\n      dumpn(\"--------------------- actorPool actors: \" +\n            uneval(Object.keys(this._actorPool._actors)));\n    }\n    for each (let pool in this._extraPools)\n      dumpn(\"--------------------- extraPool actors: \" +\n            uneval(Object.keys(pool._actors)));\n  },\n\n  /*\n   * Debugging helper for inspecting the state of an actor pool.\n   */\n  _dumpPool: function DSC_dumpPools(aPool) {\n    dumpn(\"/-------------------- dumping pool:\");\n    dumpn(\"--------------------- actorPool actors: \" +\n          uneval(Object.keys(aPool._actors)));\n  }\n};\n\n/**\n * Localization convenience methods.\n */\n// let L10N = {\n\n//   /**\n//    * L10N shortcut function.\n//    *\n//    * @param string aName\n//    * @return string\n//    */\n//   getStr: function L10N_getStr(aName) {\n//     return this.stringBundle.GetStringFromName(aName);\n//   }\n// };\n\n// XPCOMUtils.defineLazyGetter(L10N, \"stringBundle\", function() {\n//   return Services.strings.createBundle(DBG_STRINGS_URI);\n// });\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/debugger/transport.js",
    "content": "/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ft=javascript ts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n\"use strict\";\n// Components.utils.import(\"resource://gre/modules/NetUtil.jsm\");\n\n/**\n * An adapter that handles data transfers between the debugger client and\n * server. It can work with both nsIPipe and nsIServerSocket transports so\n * long as the properly created input and output streams are specified.\n * (However, for intra-process connections, LocalDebuggerTransport, below,\n * is more efficient than using an nsIPipe pair with DebuggerTransport.)\n *\n * @param aInput nsIInputStream\n *        The input stream.\n * @param aOutput nsIAsyncOutputStream\n *        The output stream.\n *\n * Given a DebuggerTransport instance dt:\n * 1) Set dt.hooks to a packet handler object (described below).\n * 2) Call dt.ready() to begin watching for input packets.\n * 3) Call dt.send() to send packets as you please, and handle incoming\n *    packets passed to hook.onPacket.\n * 4) Call dt.close() to close the connection, and disengage from the event\n *    loop.\n *\n * A packet handler is an object with two methods:\n *\n * - onPacket(packet) - called when we have received a complete packet.\n *   |Packet| is the parsed form of the packet --- a JavaScript value, not\n *   a JSON-syntax string.\n *\n * - onClosed(status) - called when the connection is closed. |Status| is\n *   an nsresult, of the sort passed to nsIRequestObserver.\n * \n * Data is transferred as a JSON packet serialized into a string, with the\n * string length prepended to the packet, followed by a colon\n * ([length]:[packet]). The contents of the JSON packet are specified in\n * the Remote Debugging Protocol specification.\n */\nthis.DebuggerTransport = function DebuggerTransport(aInput, aOutput)\n{\n  this._input = aInput;\n  this._output = aOutput;\n\n  this._converter = null;//Cc[\"@mozilla.org/intl/scriptableunicodeconverter\"]\n    // .createInstance(Ci.nsIScriptableUnicodeConverter);\n  // this._converter.charset = \"UTF-8\";\n\n  this._outgoing = \"\";\n  this._incoming = \"\";\n\n  this.hooks = null;\n}\n\nDebuggerTransport.prototype = {\n  /**\n   * Transmit a packet.\n   * \n   * This method returns immediately, without waiting for the entire\n   * packet to be transmitted, registering event handlers as needed to\n   * transmit the entire packet. Packets are transmitted in the order\n   * they are passed to this method.\n   */\n  send: function DT_send(aPacket) {\n    // TODO (bug 709088): remove pretty printing when the protocol is done.\n    let data = JSON.stringify(aPacket, null, 2);\n    // data = this._converter.ConvertFromUnicode(data);\n\n    let data_for_len = utf16to8(data);\n\n    this._outgoing = data_for_len.length + ':' + data;\n\n    this._flushOutgoing();\n  },\n\n  /**\n   * Close the transport.\n   */\n  close: function DT_close() {\n    this._input.close();\n    this._output.close();\n  },\n\n  /**\n   * Flush the outgoing stream.\n   */\n  _flushOutgoing: function DT_flushOutgoing() {\n    if (this._outgoing.length > 0) {\n      // var threadManager = Cc[\"@mozilla.org/thread-manager;1\"].getService();\n      // this._output.asyncWait(this, 0, 0, threadManager.currentThread);\n      log(\"outgoing: \" + this._outgoing);//.substring(0, 200));\n      _bufferWrite(this._outgoing);\n    }\n  },\n\n  onOutputStreamReady:\n  makeInfallible(function DT_onOutputStreamReady(aStream) {\n    let written = 0;\n    try {\n      written = aStream.write(this._outgoing, this._outgoing.length);\n    } catch(e if e.result == Components.results.NS_BASE_STREAM_CLOSED) {\n      dumpn(\"Connection closed.\");\n      this.close();\n      return;\n    }\n    this._outgoing = this._outgoing.slice(written);\n    this._flushOutgoing();\n  }, \"DebuggerTransport.prototype.onOutputStreamReady\"),\n\n  /**\n   * Initialize the input stream for reading. Once this method has been\n   * called, we watch for packets on the input stream, and pass them to\n   * this.hook.onPacket.\n   */\n  ready: function DT_ready() {\n    // let pump = Cc[\"@mozilla.org/network/input-stream-pump;1\"]\n    //   .createInstance(Ci.nsIInputStreamPump);\n    // pump.init(this._input, -1, -1, 0, 0, false);\n    // pump.asyncRead(this, null);\n  },\n\n  // nsIStreamListener\n  onStartRequest:\n  makeInfallible(function DT_onStartRequest(aRequest, aContext) {},\n                 \"DebuggerTransport.prototype.onStartRequest\"),\n\n  onStopRequest:\n  makeInfallible(function DT_onStopRequest(aRequest, aContext, aStatus) {\n    this.close();\n    if (this.hooks) {\n      this.hooks.onClosed(aStatus);\n      this.hooks = null;\n    }\n  }, \"DebuggerTransport.prototype.onStopRequest\"),\n\n  onDataAvailable: makeInfallible(function DT_onDataAvailable (incoming)\n//  makeInfallible(function DT_onDataAvailable(aRequest, aContext,\n//                                             aStream, aOffset, aCount) \n  {\n    this._incoming = incoming;//+= NetUtil.readInputStreamToString(aStream,\n                               //                       aStream.available());\n    while (this._processIncoming()) {};\n  }, \"DebuggerTransport.prototype.onDataAvailable\"),\n\n  /**\n   * Process incoming packets. Returns true if a packet has been received, either\n   * if it was properly parsed or not. Returns false if the incoming stream does\n   * not contain a full packet yet. After a proper packet is parsed, the dispatch\n   * handler DebuggerTransport.hooks.onPacket is called with the packet as a\n   * parameter.\n   */\n  _processIncoming: function DT__processIncoming() {\n    // Well this is ugly.\n    let sep = this._incoming.indexOf(':');\n    if (sep < 0) {\n      return false;\n    }\n\n    let count = parseInt(this._incoming.substring(0, sep));\n    if (this._incoming.length - (sep + 1) < count) {\n      // Don't have a complete request yet.\n      return false;\n    }\n\n    // We have a complete request, pluck it out of the data and parse it.\n    this._incoming = this._incoming.substring(sep + 1);\n    let packet = this._incoming.substring(0, count);\n    this._incoming = this._incoming.substring(count);\n\n    try {\n      // packet = this._converter.ConvertToUnicode(packet);\n      packet = utf8to16(packet);\n      var parsed = JSON.parse(packet);\n    } catch(e) {\n      let msg = \"Error parsing incoming packet: \" + packet + \" (\" + e + \" - \" + e.stack + \")\";\n      // if (Cu.reportError) {\n      //   Cu.reportError(msg);\n      // }\n      dump(msg + \"\\n\");\n      return true;\n    }\n\n    dumpn(\"Got: \" + packet);\n    let self = this;\n\n    // Services.tm.currentThread.dispatch(makeInfallible(function() {\n      self.hooks.onPacket(parsed);\n    // }, \"DebuggerTransport instance's this.hooks.onPacket\"), 0);\n\n    return true;\n  }\n}\n\n\n/**\n * An adapter that handles data transfers between the debugger client and\n * server when they both run in the same process. It presents the same API as\n * DebuggerTransport, but instead of transmitting serialized messages across a\n * connection it merely calls the packet dispatcher of the other side.\n *\n * @param aOther LocalDebuggerTransport\n *        The other endpoint for this debugger connection.\n *\n * @see DebuggerTransport\n */\nthis.LocalDebuggerTransport = function LocalDebuggerTransport(aOther)\n{\n  this.other = aOther;\n  this.hooks = null;\n\n  /*\n   * A packet number, shared between this and this.other. This isn't used\n   * by the protocol at all, but it makes the packet traces a lot easier to\n   * follow.\n   */\n  this._serial = this.other ? this.other._serial : { count: 0 };\n}\n\nLocalDebuggerTransport.prototype = {\n  /**\n   * Transmit a message by directly calling the onPacket handler of the other\n   * endpoint.\n   */\n  send: function LDT_send(aPacket) {\n    let serial = this._serial.count++;\n    if (wantLogging) {\n      /* Check 'from' first, as 'echo' packets have both. */\n      if (aPacket.from) {\n        dumpn(\"Packet \" + serial + \" sent from \" + uneval(aPacket.from));\n      } else if (aPacket.to) {\n        dumpn(\"Packet \" + serial + \" sent to \" + uneval(aPacket.to));\n      }\n    }\n    this._deepFreeze(aPacket);\n    let other = this.other;\n    if (other) {\n      Services.tm.currentThread.dispatch(makeInfallible(function() {\n        // Avoid the cost of JSON.stringify() when logging is disabled.\n        if (wantLogging) {\n          dumpn(\"Received packet \" + serial + \": \" + JSON.stringify(aPacket, null, 2));\n        }\n        if (other.hooks) {\n          other.hooks.onPacket(aPacket);\n        }\n      }, \"LocalDebuggerTransport instance's this.other.hooks.onPacket\"), 0);\n    }\n  },\n\n  /**\n   * Close the transport.\n   */\n  close: function LDT_close() {\n    if (this.other) {\n      // Remove the reference to the other endpoint before calling close(), to\n      // avoid infinite recursion.\n      let other = this.other;\n      delete this.other;\n      other.close();\n    }\n    if (this.hooks) {\n      try {\n        this.hooks.onClosed();\n      } catch(ex) {\n        Components.utils.reportError(ex);\n      }\n      this.hooks = null;\n    }\n  },\n\n  /**\n   * An empty method for emulating the DebuggerTransport API.\n   */\n  ready: function LDT_ready() {},\n\n  /**\n   * Helper function that makes an object fully immutable.\n   */\n  _deepFreeze: function LDT_deepFreeze(aObject) {\n    Object.freeze(aObject);\n    for (let prop in aObject) {\n      // Freeze the properties that are objects, not on the prototype, and not\n      // already frozen. Note that this might leave an unfrozen reference\n      // somewhere in the object if there is an already frozen object containing\n      // an unfrozen object.\n      if (aObject.hasOwnProperty(prop) && typeof aObject === \"object\" &&\n          !Object.isFrozen(aObject)) {\n        this._deepFreeze(o[prop]);\n      }\n    }\n  }\n};\n\n/**\n * A transport for the debugging protocol that uses nsIMessageSenders to\n * exchange packets with servers running in child processes.\n *\n * In the parent process, |aSender| should be the nsIMessageSender for the\n * child process. In a child process, |aSender| should be the child process\n * message manager, which sends packets to the parent.\n *\n * aPrefix is a string included in the message names, to distinguish\n * multiple servers running in the same child process.\n *\n * This transport exchanges messages named 'debug:<prefix>:packet', where\n * <prefix> is |aPrefix|, whose data is the protocol packet.\n */\nfunction ChildDebuggerTransport(aSender, aPrefix) {\n  this._sender = aSender.QueryInterface(Components.interfaces.nsIMessageSender);\n  this._messageName = \"debug:\" + aPrefix + \":packet\";\n}\n\n/*\n * To avoid confusion, we use 'message' to mean something that\n * nsIMessageSender conveys, and 'packet' to mean a remote debugging\n * protocol packet.\n */\nChildDebuggerTransport.prototype = {\n  constructor: ChildDebuggerTransport,\n\n  hooks: null,\n\n  ready: function () {\n    this._sender.addMessageListener(this._messageName, this);\n  },\n\n  close: function () {\n    this._sender.removeMessageListener(this._messageName, this);\n    this.hooks.onClosed();\n  },\n\n  receiveMessage: function ({data}) {\n    this.hooks.onPacket(data);\n  },\n\n  send: function (packet) {\n    this._sender.sendAsyncMessage(this._messageName, packet);\n  }\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb.js",
    "content": "//\n// Javascript Bindigns helper file\n//\n\n// DO NOT ALTER THE ORDER\nrequire('jsb_cocos2d_constants.js');\nrequire('jsb_cocos2d.js');\nrequire('jsb_cocos2d_extension.js');\nrequire('jsb_cocos2d_studio.js');\nrequire('jsb_cocos2d_gui.js');\nrequire('jsb_chipmunk_constants.js');\nrequire('jsb_chipmunk.js');\nrequire('jsb_opengl_constants.js');\nrequire('jsb_opengl.js');\nrequire('jsb_cocosbuilder.js');\nrequire('jsb_sys.js');\nrequire('jsb_deprecated.js');\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_chipmunk.js",
    "content": "//\n// Chipmunk defines\n//\n\nvar cp = cp || {};\n\ncp.v = cc.p;\ncp._v = cc._p;\ncp.vzero  = cp.v(0,0);\n\n// Vector: Compatibility with Chipmunk-JS\ncp.v.add = cp.vadd;\ncp.v.clamp = cp.vclamp;\ncp.v.cross = cp.vcross;\ncp.v.dist = cp.vdist;\ncp.v.distsq = cp.vdistsq;\ncp.v.dot = cp.vdot;\ncp.v.eql = cp.veql;\ncp.v.forangle = cp.vforangle;\ncp.v.len = cp.vlength;\ncp.v.lengthsq = cp.vlengthsq;\ncp.v.lerp = cp.vlerp;\ncp.v.lerpconst = cp.vlerpconst;\ncp.v.mult = cp.vmult;\ncp.v.near = cp.vnear;\ncp.v.neg = cp.vneg;\ncp.v.normalize = cp.vnormalize;\ncp.v.normalize_safe = cp.vnormalize_safe;\ncp.v.perp = cp.vperp;\ncp.v.project = cp.vproject;\ncp.v.rotate = cp.vrotate;\ncp.v.rperp = cp.vrperp;\ncp.v.slerp = cp.vslerp;\ncp.v.slerpconst = cp.vslerpconst;\ncp.v.sub = cp.vsub;\ncp.v.toangle = cp.vtoangle;\ncp.v.unrotate = cp.vunrotate;\n\n// XXX: renaming functions should be supported in JSB\ncp.clamp01 = cp.fclamp01;\n\n\n/// Initialize an offset box shaped polygon shape.\ncp.BoxShape2 = function(body, box)\n{\n\tvar verts = [\n\t\tbox.l, box.b,\n\t\tbox.l, box.t,\n\t\tbox.r, box.t,\n\t\tbox.r, box.b\n\t];\n\n\treturn new cp.PolyShape(body, verts, cp.vzero);\n};\n\n/// Initialize a box shaped polygon shape.\ncp.BoxShape = function(body, width, height)\n{\n\tvar hw = width/2;\n\tvar hh = height/2;\n\n\treturn cp.BoxShape2(body, new cp.BB(-hw, -hh, hw, hh));\n};\n\n\n/// Initialize an static body\ncp.StaticBody = function()\n{\n\treturn new cp.Body(Infinity, Infinity);\n};\n\n\n// \"Bounding Box\" compatibility with Chipmunk-JS\ncp.BB = function(l, b, r, t)\n{\n\treturn {l:l, b:b, r:r, t:t};\n};\n\n// helper function to create a BB\ncp.bb = function(l, b, r, t) {\n\treturn new cp.BB(l, b, r, t);\n};\n\n//\n// Some properties\n//\n// \"handle\" needed in some cases\nObject.defineProperties(cp.Base.prototype,\n\t\t\t\t{\n\t\t\t\t\t\"handle\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getHandle();\n                        },\n                        enumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t}\n\t\t\t\t});\n\n// Properties, for Chipmunk-JS compatibility\n// Space properties\nObject.defineProperties(cp.Space.prototype,\n\t\t\t\t{\n\t\t\t\t\t\"gravity\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getGravity();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setGravity(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"iterations\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getIterations();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setIterations(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"damping\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getDamping();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setDamping(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"staticBody\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getStaticBody();\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"idleSpeedThreshold\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getIdleSpeedThreshold();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setIdleSpeedThreshold(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"sleepTimeThreshold\": {\n\t\t\t\t\t\tget : function(){\n                            return this.getSleepTimeThreshold();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setSleepTimeThreshold(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"collisionSlop\": {\n\t\t\t\t\t\tget : function(){\n                            return this.getCollisionSlop();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setCollisionSlop(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"collisionBias\": {\n\t\t\t\t\t\tget : function(){\n                            return this.getCollisionBias();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setCollisionBias(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"collisionPersistence\": {\n\t\t\t\t\t\tget : function(){\n                            return this.getCollisionPersistence();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setCollisionPersistence(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"enableContactGraph\": {\n\t\t\t\t\t\tget : function(){\n                            return this.getEnableContactGraph();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setEnableContactGraph(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t}\n\t\t\t\t});\n\n// Body properties\nObject.defineProperties(cp.Body.prototype,\n\t\t\t\t{\n\t\t\t\t\t\"a\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getAngle();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setAngle(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"w\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getAngVel();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setAngVel(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"p\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getPos();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setPos(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"v\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getVel();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setVel(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"i\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getMoment();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setMoment(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n// Shape properties\nObject.defineProperties(cp.Shape.prototype,\n\t\t\t\t{\n\t\t\t\t\t\"body\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getBody();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setBody(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n                    \"group\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getGroup();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setGroup(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n                    },\n\t\t\t\t\t\"collision_type\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getCollisionType();\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t}\n\t\t\t\t});\n\n// Constraint properties\nObject.defineProperties(cp.Constraint.prototype,\n\t\t\t\t{\n\t\t\t\t\t\"maxForce\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getMaxForce();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setMaxForce(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t}\n\t\t\t\t});\n\n// PinJoint properties\nObject.defineProperties(cp.PinJoint.prototype,\n\t\t\t\t{\n\t\t\t\t\t\"anchr1\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getAnchr1();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setAnchr1(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t},\n\t\t\t\t\t\"anchr2\" : {\n\t\t\t\t\t\tget : function(){\n                            return this.getAnchr2();\n                        },\n\t\t\t\t\t\tset : function(newValue){\n                            this.setAnchr2(newValue);\n                        },\n\t\t\t\t\t\tenumerable : true,\n\t\t\t\t\t\tconfigurable : true\n\t\t\t\t\t}\n\t\t\t\t});\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_chipmunk_constants.js",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_jsb.py -c chipmunk_jsb.ini\" on 2013-03-05\n* Script version: v0.6\n*/\n\nvar cp = cp || {};\ncp.ALLOW_PRIVATE_ACCESS\t= 0x1;\ncp.ALL_LAYERS\t= 0xffffffff;\ncp.BUFFER_BYTES\t= 0x8000;\ncp.CIRCLE_SHAPE\t= 0x0;\ncp.HASH_COEF\t= 0xc75f71e1;\ncp.MAX_CONTACTS_PER_ARBITER\t= 0x4;\ncp.NO_GROUP\t= 0x0;\ncp.NUM_SHAPES\t= 0x3;\ncp.POLY_SHAPE\t= 0x2;\ncp.SEGMENT_SHAPE\t= 0x1;\ncp.USE_CGPOINTS\t= 0x1;\ncp.USE_DOUBLES\t= 0x0;\ncp.VERSION_MAJOR\t= 0x6;\ncp.VERSION_MINOR\t= 0x1;\ncp.VERSION_RELEASE\t= 0x1;\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_cocos2d.js",
    "content": "//\n// cocos2d constants\n//\n\nvar cc = cc || {};\n\ncc.TARGET_PLATFORM = {\n    WINDOWS:0,\n    LINUX:1,\n    MACOS:2,\n    ANDROID:3,\n    IPHONE:4,\n    IPAD:5,\n    BLACKBERRY:6,\n    NACL:7,\n    EMSCRIPTEN:8,\n    MOBILE_BROWSER:100,\n    PC_BROWSER:101\n};\n\ncc.RESOLUTION_POLICY = {\n    // The entire application is visible in the specified area without trying to preserve the original aspect ratio.\n    // Distortion can occur, and the application may appear stretched or compressed.\nEXACT_FIT:0,\n    // The entire application fills the specified area, without distortion but possibly with some cropping,\n    // while maintaining the original aspect ratio of the application.\nNO_BORDER:1,\n    // The entire application is visible in the specified area without distortion while maintaining the original\n    // aspect ratio of the application. Borders can appear on two sides of the application.\nSHOW_ALL:2,\n    // The application takes the height of the design resolution size and modifies the width of the internal\n    // canvas so that it fits the aspect ratio of the device\n    // no distortion will occur however you must make sure your application works on different\n    // aspect ratios\nFIXED_HEIGHT:3,\n    // The application takes the width of the design resolution size and modifies the height of the internal\n    // canvas so that it fits the aspect ratio of the device\n    // no distortion will occur however you must make sure your application works on different\n    // aspect ratios\nFIXED_WIDTH:4,\n    \nUNKNOWN:5\n};\n\ncc.LANGUAGE_ENGLISH    = 0;\ncc.LANGUAGE_CHINESE    = 1;\ncc.LANGUAGE_FRENCH     = 2;\ncc.LANGUAGE_ITALIAN    = 3;\ncc.LANGUAGE_GERMAN     = 4;\ncc.LANGUAGE_SPANISH    = 5;\ncc.LANGUAGE_RUSSIAN    = 6;\ncc.LANGUAGE_KOREAN     = 7;\ncc.LANGUAGE_JAPANESE   = 8;\ncc.LANGUAGE_HUNGARIAN  = 9;\ncc.LANGUAGE_PORTUGUESE = 10;\ncc.LANGUAGE_ARABIC     = 11;\n\ncc.DIRECTOR_PROJECTION_2D = 0;\ncc.DIRECTOR_PROJECTION_3D = 1;\n\ncc.TEXTURE_PIXELFORMAT_RGBA8888 = 0;\ncc.TEXTURE_PIXELFORMAT_RGB888 = 1;\ncc.TEXTURE_PIXELFORMAT_RGB565 = 2;\ncc.TEXTURE_PIXELFORMAT_A8 = 3;\ncc.TEXTURE_PIXELFORMAT_I8 = 4;\ncc.TEXTURE_PIXELFORMAT_AI88 = 5;\ncc.TEXTURE_PIXELFORMAT_RGBA4444 = 6;\ncc.TEXTURE_PIXELFORMAT_RGB5A1 = 7;\ncc.TEXTURE_PIXELFORMAT_PVRTC4 = 8;\ncc.TEXTURE_PIXELFORMAT_PVRTC4 = 9;\ncc.TEXTURE_PIXELFORMAT_DEFAULT = cc.TEXTURE_PIXELFORMAT_RGBA8888;\n\ncc.TEXT_ALIGNMENT_LEFT  = 0;\ncc.TEXT_ALIGNMENT_CENTER = 1;\ncc.TEXT_ALIGNMENT_RIGHT = 2;\n\ncc.VERTICAL_TEXT_ALIGNMENT_TOP = 0;\ncc.VERTICAL_TEXT_ALIGNMENT_CENTER = 1;\ncc.VERTICAL_TEXT_ALIGNMENT_BOTTOM = 2;\n\ncc.IMAGE_FORMAT_JPEG = 0;\ncc.IMAGE_FORMAT_PNG = 0;\n\ncc.PROGRESS_TIMER_TYPE_RADIAL = 0;\ncc.PROGRESS_TIMER_TYPE_BAR = 1;\n\ncc.PARTICLE_TYPE_FREE = 0;\ncc.PARTICLE_TYPE_RELATIVE = 1;\ncc.PARTICLE_TYPE_GROUPED = 2;\ncc.PARTICLE_DURATION_INFINITY = -1;\ncc.PARTICLE_MODE_GRAVITY = 0;\ncc.PARTICLE_MODE_RADIUS = 1;\ncc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE = -1;\ncc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS = -1;\n\ncc.TOUCH_ALL_AT_ONCE = 0;\ncc.TOUCH_ONE_BY_ONE = 1;\n\ncc.TMX_TILE_HORIZONTAL_FLAG = 0x80000000;\ncc.TMX_TILE_VERTICAL_FLAG = 0x40000000;\ncc.TMX_TILE_DIAGONAL_FLAG = 0x20000000;\n\ncc.TRANSITION_ORIENTATION_LEFT_OVER = 0;\ncc.TRANSITION_ORIENTATION_RIGHT_OVER = 1;\ncc.TRANSITION_ORIENTATION_UP_OVER = 0;\ncc.TRANSITION_ORIENTATION_DOWN_OVER = 1;\n\ncc.RED = {r:255, g:0, b:0};\ncc.GREEN = {r:0, g:255, b:0};\ncc.BLUE = {r:0, g:0, b:255};\ncc.BLACK = {r:0, g:0, b:0};\ncc.WHITE = {r:255, g:255, b:255};\ncc.YELLOW = {r:255, g:255, b:0};\n\ncc.POINT_ZERO = {x:0, y:0};\n\n// XXX: This definition is different than cocos2d-html5\n// cc.REPEAT_FOREVER = - 1;\n// We can't assign -1 to cc.REPEAT_FOREVER, since it will be a very big double value after\n// converting it to double by JS_ValueToNumber on android.\n// Then cast it to unsigned int, the value will be 0. The schedule will not be able to work.\n// I don't know why this occurs only on android.\n// So instead of passing -1 to it, I assign it with max value of unsigned int in c++.\ncc.REPEAT_FOREVER = 0xffffffff;\n\ncc.MENU_STATE_WAITING = 0;\ncc.MENU_STATE_TRACKING_TOUCH = 1;\ncc.MENU_HANDLER_PRIORITY = -128;\ncc.DEFAULT_PADDING = 5;\n\n// reusable objects\ncc._reuse_p = [ {x:0, y:0}, {x:0,y:0}, {x:0,y:0}, {x:0,y:0} ];\ncc._reuse_p_index = 0;\ncc._reuse_size = {width:0, height:0};\ncc._reuse_rect = {x:0, y:0, width:0, height:0};\ncc._reuse_color3b = {r:255, g:255, b:255 };\ncc._reuse_color4b = {r:255, g:255, b:255, a:255 };\ncc.log = cc._cocosplayerLog || cc.log || log;\n\n//\n// Color 3B\n//\ncc.c3b = function( r, g, b )\n{\n    switch (arguments.length) {\n        case 0:\n            return {r:0, g:0, b:0 };\n        case 1:\n            if (r && r instanceof cc.c3b) {\n            \t  return {r:r.r, g:r.g, b:r.b };\n            } else {\n                return {r:0, g:0, b:0 };\n            }\n        case 3:\n            return {r:r, g:g, b:b };\n        default:\n            throw \"unknown argument type\";\n            break;\n    }\n};\n\ncc.integerToColor3B = function (intValue) {\n    intValue = intValue || 0;\n\n    var offset = 0xff;\n    var retColor = {r:0, g:0, b:0 };\n    retColor.r = intValue & (offset);\n    retColor.g = (intValue >> 8) & offset;\n    retColor.b = (intValue >> 16) & offset;\n    return retColor;\n};\n\ncc._c3b = function( r, g, b )\n{\n    cc._reuse_color3b.r = r;\n    cc._reuse_color3b.g = g;\n    cc._reuse_color3b.b = b;\n    return cc._reuse_color3b;\n};\n\ncc.c3BEqual = function(color1, color2){\n    return color1.r === color2.r && color1.g === color2.g && color1.b === color2.b;\n};\n\ncc.white = function () {\n    return cc.c3b(255, 255, 255);\n};\n\ncc.yellow = function () {\n    return cc.c3b(255, 255, 0);\n};\n\ncc.blue = function () {\n    return cc.c3b(0, 0, 255);\n};\n\ncc.green = function () {\n    return cc.c3b(0, 255, 0);\n};\n\ncc.red = function () {\n    return cc.c3b(255, 0, 0);\n};\n\ncc.magenta = function () {\n    return cc.c3b(255, 0, 255);\n};\n\ncc.black = function () {\n    return cc.c3b(0, 0, 0);\n};\n\ncc.orange = function () {\n    return cc.c3b(255, 127, 0);\n};\n\ncc.gray = function () {\n    return cc.c3b(166, 166, 166);\n};\n\n//\n// Color 4B\n//\ncc.c4b = function( r, g, b, a )\n{\n    return {r:r, g:g, b:b, a:a };\n};\ncc._c4b = function( r, g, b, a )\n{\n    cc._reuse_color4b.r = r;\n    cc._reuse_color4b.g = g;\n    cc._reuse_color4b.b = b;\n    cc._reuse_color4b.a = a;\n    return cc._reuse_color4b;\n};\n// compatibility\ncc.c4 = cc.c4b;\ncc._c4 = cc._c4b;\n\n/**\n * convert Color3B to a string of color for style.\n * e.g.  Color3B(255,6,255)  to : \"#ff06ff\"\n * @param clr\n * @return {String}\n */\ncc.convertColor3BtoHexString = function (clr) {\n    var hR = clr.r.toString(16);\n    var hG = clr.g.toString(16);\n    var hB = clr.b.toString(16);\n    var stClr = \"#\" + (clr.r < 16 ? (\"0\" + hR) : hR) + (clr.g < 16 ? (\"0\" + hG) : hG) + (clr.b < 16 ? (\"0\" + hB) : hB);\n    return stClr;\n};\n\n//\n// Color 4F\n//\ncc.c4f = function( r, g, b, a )\n{\n    return {r:r, g:g, b:b, a:a };\n};\n\ncc.c4FFromccc3B = function (c) {\n    return cc.c4f(c.r / 255.0, c.g / 255.0, c.b / 255.0, 1.0);\n};\n\ncc.c4FFromccc4B = function (c) {\n    return cc.c4f(c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0);\n};\n\ncc.c4BFromccc4F = function (c) {\n    return cc.c4f(0 | (c.r * 255), 0 | (c.g * 255), 0 | (c.b * 255), 0 | (c.a * 255));\n};\n\ncc.c4FEqual = function (a, b) {\n    return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a;\n};\n\n//\n// Point\n//\ncc.p = function( x, y )\n{\n    return {x:x, y:y};\n};\ncc._p = function( x, y )\n{\n    if( cc._reuse_p_index == cc._reuse_p.length )\n        cc._reuse_p_index = 0;\n\n    var p = cc._reuse_p[ cc._reuse_p_index];\n    cc._reuse_p_index++;\n    p.x = x;\n    p.y = y;\n    return p;\n};\n\ncc.pointEqualToPoint = function (point1, point2) {\n    return ((point1.x == point2.x) && (point1.y == point2.y));\n};\n\ncc.PointZero = function () {\n    return cc.p(0, 0);\n};\n\n//\n// Grid\n//\ncc._g = function( x, y )\n{\n    cc._reuse_grid.x = x;\n    cc._reuse_grid.y = y;\n    return cc._reuse_grid;\n};\n\n//\n// Size\n//\ncc.size = function(w,h)\n{\n    return {width:w, height:h};\n};\ncc._size = function(w,h)\n{\n    cc._reuse_size.width = w;\n    cc._reuse_size.height = h;\n    return cc._reuse_size;\n};\ncc.sizeEqualToSize = function (size1, size2)\n{\n    return ((size1.width == size2.width) && (size1.height == size2.height));\n};\n\ncc.SizeZero = function () {\n    return cc.size(0, 0);\n};\n\n/**\n * create a cc.rect object\n * @param {Number|cc.point|cc.rect} [x] a Number value as x or a cc.point object as origin or a cc.rect clone object\n * @param {Number|cc.size} [y] x1 a Number value as y or a cc.size object as size\n * @param {Number} [w]\n * @param {Number} [h]\n * @return {Object} a cc.rect object\n */\ncc.rect = function(x,y,w,h)\n{\n    var argLen = arguments.length;\n    if (argLen === 0)\n        return { x: 0, y: 0, width: 0, height: 0 };\n\n    if (argLen === 1)\n        return { x: x.x, y: x.y, width: x.width, height: x.height };\n\n    if (argLen === 2)\n        return { x: x.x, y: x.y, width: y.width, height: y.height };\n\n    if (argLen === 4)\n        return { x: x, y: y, width: w, height: h };\n\n    throw \"unknown argument type\";\n};\ncc._rect = function(x,y,w,h)\n{\n    cc._reuse_rect.x = x;\n    cc._reuse_rect.y = y;\n    cc._reuse_rect.width = w;\n    cc._reuse_rect.height = h;\n    return cc._reuse_rect;\n};\ncc.rectEqualToRect = function (rect1, rect2) {\n    return ( rect1.x==rect2.x && rect1.y==rect2.y && rect1.width==rect2.width && rect1.height==rect2.height);\n};\n\ncc.rectContainsRect = function (rect1, rect2) {\n    if ((rect1.x >= rect2.x) || (rect1.y >= rect2.y) ||\n        ( rect1.x + rect1.width <= rect2.x + rect2.width) ||\n        ( rect1.y + rect1.height <= rect2.y + rect2.height))\n        return false;\n    return true;\n};\n\ncc.rectGetMaxX = function (rect) {\n    return (rect.x + rect.width);\n};\n\ncc.rectGetMidX = function (rect) {\n    return (rect.x + rect.width / 2.0);\n};\n\ncc.rectGetMinX = function (rect) {\n    return rect.x;\n};\n\ncc.rectGetMaxY = function (rect) {\n    return(rect.y + rect.height);\n};\n\ncc.rectGetMidY = function (rect) {\n    return rect.y + rect.height / 2.0;\n};\n\ncc.rectGetMinY = function (rect) {\n    return rect.y;\n};\n\ncc.rectContainsPoint = function (rect, point) {\n    var ret = false;\n    if (point.x >= rect.x && point.x <= rect.x + rect.width &&\n        point.y >= rect.y && point.y <= rect.y + rect.height) {\n        ret = true;\n    }\n    return ret;\n};\n\ncc.rectIntersectsRect = function( rectA, rectB )\n{\n    var bool = ! (  rectA.x > rectB.x + rectB.width ||\n                    rectA.x + rectA.width < rectB.x ||\n                    rectA.y > rectB.y +rectB.height ||\n                    rectA.y + rectA.height < rectB.y );\n\n    return bool;\n};\n\ncc.rectUnion = function (rectA, rectB) {\n    var rect = cc.rect(0, 0, 0, 0);\n    rect.x = Math.min(rectA.x, rectB.x);\n    rect.y = Math.min(rectA.y, rectB.y);\n    rect.width = Math.max(rectA.x + rectA.width, rectB.x + rectB.width) - rect.x;\n    rect.height = Math.max(rectA.y + rectA.height, rectB.y + rectB.height) - rect.y;\n    return rect;\n};\n\ncc.rectIntersection = function (rectA, rectB) {\n    var intersection = cc.rect(\n        Math.max(rectA.x, rectB.x),\n        Math.max(rectA.y, rectB.y),\n        0, 0);\n\n    intersection.width = Math.min(rectA.x+rectA.width, rectB.x+rectB.width) - intersection.x;\n    intersection.height = Math.min(rectA.y+rectA.height, rectB.y+rectB.height) - intersection.y;\n    return intersection;\n};\n\ncc.RectZero = function () {\n    return cc.rect(0, 0, 0, 0);\n};\n\n//\n// Array: for cocos2d-html5 compatibility\n//\n\n/**\n * Returns index of first occurence of object, -1 if value not found.\n * @function\n * @param {Array} arr Source Array\n * @param {*} findObj find object\n * @return {Number} index of first occurence of value\n */\ncc.ArrayGetIndexOfObject = function (arr, findObj) {\n    for (var i = 0; i < arr.length; i++) {\n        if (arr[i] == findObj)\n            return i;\n    }\n    return -1;\n};\n\n/**\n * Returns a Boolean value that indicates whether value is present in the array.\n * @function\n * @param {Array} arr\n * @param {*} findObj\n * @return {Boolean}\n */\ncc.ArrayContainsObject = function (arr, findObj) {\n    return cc.ArrayGetIndexOfObject(arr, findObj) != -1;\n};\n\ncc.ArrayRemoveObject = function (arr, delObj) {\n    for (var i = 0; i < arr.length; i++) {\n        if (arr[i] == delObj) {\n            arr.splice(i, 1);\n        }\n    }\n};\n\n//\n// Helpers\n//\ncc.dump = function(obj)\n{\n    for( var i in obj )\n        cc.log( i + \" = \" + obj[i] );\n};\n\n// dump config info, but only in debug mode\nvar sys = sys || undefined;\ncc.dumpConfig = function()\n{\n    if (sys) {\n        cc.dump(sys);\n        cc.dump(sys.capabilities);\n    }\n};\n\n//\n// Bindings Overrides\n//\n// MenuItemToggle\ncc.MenuItemToggle.create = function( /* var args */) {\n\n    var n = arguments.length;\n\n    if (typeof arguments[n-2] === 'function' || typeof arguments[n-1] === 'function') {\n        var args = Array.prototype.slice.call(arguments);\n        var obj = null;\n        if( typeof arguments[n-2] === 'function' )\n            obj = args.pop();\n\n        var func = args.pop();\n\n        // create it with arguments,\n        var item = cc.MenuItemToggle._create.apply(this, args);\n\n        // then set the callback\n        if( obj !== null )\n            item.setCallback(func, obj);\n        else\n            item.setCallback(func);\n        return item;\n    } else {\n        return cc.MenuItemToggle._create.apply(this, arguments);\n    }\n};\n\n// LabelAtlas\ncc.LabelAtlas.create = function( a,b,c,d,e ) {\n\n    var n = arguments.length;\n\n    if ( n == 5) {\n        return cc.LabelAtlas._create(a,b,c,d,e.charCodeAt(0));\n    } else {\n        return cc.LabelAtlas._create.apply(this, arguments);\n    }\n};\n\ncc.LayerMultiplex.create = cc.LayerMultiplex.createWithArray;\n\n\n/**\n * Associates a base class with a native superclass\n * @function\n * @param {object} jsobj subclass\n * @param {object} klass superclass\n */\ncc.associateWithNative = function( jsobj, superclass_or_instance ) {};\n\n//\n// JSB supports 2 official ways to create subclasses\n//\n// 1) Google \"subclasses\" borrowed from closure library\n// This is the recommended way to do it\n//\ncc.inherits = function (childCtor, parentCtor) {\n\t/** @constructor */\n\tfunction tempCtor() {};\n\ttempCtor.prototype = parentCtor.prototype;\n\tchildCtor.superClass_ = parentCtor.prototype;\n\tchildCtor.prototype = new tempCtor();\n\tchildCtor.prototype.constructor = childCtor;\n\n    // Copy \"static\" method, but doesn't generate subclasses.\n//\tfor( var i in parentCtor ) {\n//\t\tchildCtor[ i ] = parentCtor[ i ];\n//\t}\n};\ncc.base = function(me, opt_methodName, var_args) {\n\tvar caller = arguments.callee.caller;\n\tif (caller.superClass_) {\n\t\t// This is a constructor. Call the superclass constructor.\n\t\tret =  caller.superClass_.constructor.apply( me, Array.prototype.slice.call(arguments, 1));\n\t\treturn ret;\n\t}\n\n\tvar args = Array.prototype.slice.call(arguments, 2);\n\tvar foundCaller = false;\n\tfor (var ctor = me.constructor;\n        ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) {\n\t\tif (ctor.prototype[opt_methodName] === caller) {\n\t\t\tfoundCaller = true;\n\t\t} else if (foundCaller) {\n\t\t\treturn ctor.prototype[opt_methodName].apply(me, args);\n\t\t}\n\t}\n\n\t// If we did not find the caller in the prototype chain,\n\t// then one of two things happened:\n\t// 1) The caller is an instance method.\n\t// 2) This method was not called by the right caller.\n\tif (me[opt_methodName] === caller) {\n\t\treturn me.constructor.prototype[opt_methodName].apply(me, args);\n\t} else {\n\t\tthrow Error(\n\t\t\t\t\t'cc.base called from a method of one name ' +\n\t\t\t\t\t'to a method of a different name');\n\t}\n};\n\n\n//\n// 2) Using \"extend\" subclassing\n// Simple JavaScript Inheritance By John Resig http://ejohn.org/\n//\ncc.Class = function(){};\ncc.Class.extend = function (prop) {\n    var _super = this.prototype;\n\n    // Instantiate a base class (but only create the instance,\n    // don't run the init constructor)\n    initializing = true;\n    var prototype = new this();\n    initializing = false;\n    fnTest = /xyz/.test(function(){xyz;}) ? /\\b_super\\b/ : /.*/;\n\n    // Copy the properties over onto the new prototype\n    for (var name in prop) {\n        // Check if we're overwriting an existing function\n        prototype[name] = typeof prop[name] == \"function\" &&\n            typeof _super[name] == \"function\" && fnTest.test(prop[name]) ?\n            (function (name, fn) {\n                return function () {\n                    var tmp = this._super;\n\n                    // Add a new ._super() method that is the same method\n                    // but on the super-class\n                    this._super = _super[name];\n\n                    // The method only need to be bound temporarily, so we\n                    // remove it when we're done executing\n                    var ret = fn.apply(this, arguments);\n                    this._super = tmp;\n\n                    return ret;\n                };\n            })(name, prop[name]) :\n            prop[name];\n    }\n\n    // The dummy class constructor\n    function Class() {\n        // All construction is actually done in the init method\n        if (!initializing) {\n            if (!this.ctor) {\n                if (this.__nativeObj)\n                    cc.log(\"No ctor function found! Please check whether `classes_need_extend` section in `ini` file like which in `tools/tojs/cocos2dx.ini`\");\n            }\n            else {\n                this.ctor.apply(this, arguments);\n            }\n        }\n    }\n\n    // Populate our constructed prototype object\n    Class.prototype = prototype;\n\n    // Enforce the constructor to be what we expect\n    Class.prototype.constructor = Class;\n\n    // And make this class extendable\n    Class.extend = arguments.callee;\n\n    return Class;\n};\n\ncc.Node.extend = cc.Class.extend;\ncc.Layer.extend = cc.Class.extend;\ncc.LayerGradient.extend = cc.Class.extend;\ncc.LayerColor.extend = cc.Class.extend;\ncc.Sprite.extend = cc.Class.extend;\ncc.MenuItemFont.extend = cc.Class.extend;\ncc.Scene.extend = cc.Class.extend;\ncc.DrawNode.extend = cc.Class.extend;\n\n// Cocos2d-html5 supports multi scene resources preloading.\n// This is a compatible function for JSB.\ncc.Loader = cc.Class.extend({\n                            initWith:function (resources, selector, target) {\n                            if (selector) {\n                            this._selector = selector;\n                            this._target = target;\n                            }\n                            this._selector.call(this._target);\n                            }\n                            });\n\ncc.Loader.preload = function (resources, selector, target) {\n    if (!this._instance) {\n        this._instance = new cc.Loader();\n    }\n    this._instance.initWith(resources, selector, target);\n    return this._instance;\n};\n\ncc.LoaderScene = cc.Loader;\n\nvar ConfigType = {\n    NONE: 0,\n    COCOSTUDIO: 1\n};\n\nvar __onParseConfig = function(type, str) {\n    if (type === ConfigType.COCOSTUDIO) {\n        ccs.TriggerMng.getInstance().parse(JSON.parse(str));\n    }\n};\n\ncc.VisibleRect = {\n    _topLeft:cc.p(0,0),\n    _topRight:cc.p(0,0),\n    _top:cc.p(0,0),\n    _bottomLeft:cc.p(0,0),\n    _bottomRight:cc.p(0,0),\n    _bottom:cc.p(0,0),\n    _center:cc.p(0,0),\n    _left:cc.p(0,0),\n    _right:cc.p(0,0),\n    _width:0,\n    _height:0,\n    _isInitialized: false,\n    init:function(){\n        var director = cc.Director.getInstance();\n        var origin = director.getVisibleOrigin();\n        var size = director.getVisibleSize();\n\n        this._width = size.width;\n        this._height = size.height;\n\n        var x = origin.x;\n        var y = origin.y;\n        var w = this._width;\n        var h = this._height;\n\n        var left = origin.x;\n        var right = origin.x + size.width;\n        var middle = origin.x + size.width/2;\n\n        //top\n        this._top.y = this._topLeft.y = this._topRight.y = y + h;\n        this._topLeft.x = left;\n        this._top.x = middle;\n        this._topRight.x = right;\n\n        //bottom\n\n        this._bottom.y = this._bottomRight.y = this._bottomLeft.y = y;\n        this._bottomLeft.x = left\n        this._bottom.x = middle;\n        this._bottomRight.x = right;\n\n        //center\n        this._right.y = this._left.y = this._center.y = y + h/2;\n        this._center.x = middle;\n        \n        //left\n        this._left.x = left;\n\n        //right\n        this._right.x = right;\n    },\n\n    lazyInit: function(){\n        if (!this._isInitialized) {\n            this.init();\n            this._isInitialized = true;\n        }\n    },\n    getWidth:function(){\n        this.lazyInit();\n        return this._width;\n    },\n    getHeight:function(){\n        this.lazyInit();\n        return this._height;\n    },\n    topLeft:function(){\n        this.lazyInit();        \n        return this._topLeft;\n    },\n    topRight:function(){\n        this.lazyInit();        \n        return this._topRight;\n    },\n    top:function(){\n        this.lazyInit();        \n        return this._top;\n    },\n    bottomLeft:function(){\n        this.lazyInit();        \n        return this._bottomLeft;\n    },\n    bottomRight:function(){\n        this.lazyInit();        \n        return this._bottomRight;\n    },\n    bottom:function(){\n        this.lazyInit();        \n        return this._bottom;\n    },\n    center:function(){\n        this.lazyInit();        \n        return this._center;\n    },\n    left:function(){\n        this.lazyInit();        \n        return this._left;\n    },\n    right:function(){\n        this.lazyInit();        \n        return this._right;\n    }\n};\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_constants.js",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_jsb.py -c cocos2d_jsb.ini\" on 2013-03-10\n* Script version: v0.6\n*/\n\nvar cc = cc || {};\ncc.SPRITE_INDEX_NOT_INITIALIZED\t= 0xffffffff;\ncc.TMX_ORIENTATION_HEX\t= 0x1;\ncc.TMX_ORIENTATION_ISO\t= 0x2;\ncc.TMX_ORIENTATION_ORTHO\t= 0x0;\ncc.Z_COMPRESSION_BZIP2\t= 0x1;\ncc.Z_COMPRESSION_GZIP\t= 0x2;\ncc.Z_COMPRESSION_NONE\t= 0x3;\ncc.Z_COMPRESSION_ZLIB\t= 0x0;\ncc.BLEND_DST\t= 0x303;\ncc.BLEND_SRC\t= 0x1;\ncc.DIRECTOR_IOS_USE_BACKGROUND_THREAD\t= 0x0;\ncc.DIRECTOR_MAC_THREAD\t= 0x0;\ncc.DIRECTOR_STATS_INTERVAL\t= 0.1;\ncc.ENABLE_BOX2_D_INTEGRATION\t= 0x0;\ncc.ENABLE_DEPRECATED\t= 0x1;\ncc.ENABLE_GL_STATE_CACHE\t= 0x1;\ncc.ENABLE_PROFILERS\t= 0x0;\ncc.ENABLE_STACKABLE_ACTIONS\t= 0x1;\ncc.FIX_ARTIFACTS_BY_STRECHING_TEXEL\t= 0x0;\ncc.GL_ALL\t= 0x0;\ncc.LABELATLAS_DEBUG_DRAW\t= 0x0;\ncc.LABELBMFONT_DEBUG_DRAW\t= 0x0;\ncc.MAC_USE_DISPLAY_LINK_THREAD\t= 0x0;\ncc.MAC_USE_MAIN_THREAD\t= 0x2;\ncc.MAC_USE_OWN_THREAD\t= 0x1;\ncc.NODE_RENDER_SUBPIXEL\t= 0x1;\ncc.PVRMIPMAP_MAX\t= 0x10;\ncc.SPRITEBATCHNODE_RENDER_SUBPIXEL\t= 0x1;\ncc.SPRITE_DEBUG_DRAW\t= 0x0;\ncc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP\t= 0x0;\ncc.TEXTURE_ATLAS_USE_VAO\t= 0x1;\ncc.USE_L_A88_LABELS\t= 0x1;\ncc.ACTION_TAG_INVALID\t= -1;\ncc.DEVICE_MAC\t= 0x6;\ncc.DEVICE_MAC_RETINA_DISPLAY\t= 0x7;\ncc.DEVICEI_PAD\t= 0x4;\ncc.DEVICEI_PAD_RETINA_DISPLAY\t= 0x5;\ncc.DEVICEI_PHONE\t= 0x0;\ncc.DEVICEI_PHONE5\t= 0x2;\ncc.DEVICEI_PHONE5_RETINA_DISPLAY\t= 0x3;\ncc.DEVICEI_PHONE_RETINA_DISPLAY\t= 0x1;\ncc.DIRECTOR_PROJECTION2_D\t= 0x0;\ncc.DIRECTOR_PROJECTION3_D\t= 0x1;\ncc.DIRECTOR_PROJECTION_CUSTOM\t= 0x2;\ncc.DIRECTOR_PROJECTION_DEFAULT\t= 0x1;\ncc.FILE_UTILS_SEARCH_DIRECTORY_MODE\t= 0x1;\ncc.FILE_UTILS_SEARCH_SUFFIX_MODE\t= 0x0;\ncc.FLIPED_ALL\t= 0xe0000000;\ncc.FLIPPED_MASK\t= 0x1fffffff;\ncc.IMAGE_FORMAT_JPEG\t= 0x0;\ncc.IMAGE_FORMAT_PNG\t= 0x1;\ncc.ITEM_SIZE\t= 0x20;\ncc.LABEL_AUTOMATIC_WIDTH\t= -1;\ncc.LINE_BREAK_MODE_CHARACTER_WRAP\t= 0x1;\ncc.LINE_BREAK_MODE_CLIP\t= 0x2;\ncc.LINE_BREAK_MODE_HEAD_TRUNCATION\t= 0x3;\ncc.LINE_BREAK_MODE_MIDDLE_TRUNCATION\t= 0x5;\ncc.LINE_BREAK_MODE_TAIL_TRUNCATION\t= 0x4;\ncc.LINE_BREAK_MODE_WORD_WRAP\t= 0x0;\ncc.MAC_VERSION_10_6\t= 0xa060000;\ncc.MAC_VERSION_10_7\t= 0xa070000;\ncc.MAC_VERSION_10_8\t= 0xa080000;\ncc.MENU_HANDLER_PRIORITY\t= -128;\ncc.MENU_STATE_TRACKING_TOUCH\t= 0x1;\ncc.MENU_STATE_WAITING\t= 0x0;\ncc.NODE_TAG_INVALID\t= -1;\ncc.PARTICLE_DURATION_INFINITY\t= -1;\ncc.PARTICLE_MODE_GRAVITY\t= 0x0;\ncc.PARTICLE_MODE_RADIUS\t= 0x1;\ncc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS\t= -1;\ncc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE\t= -1;\ncc.POSITION_TYPE_FREE\t= 0x0;\ncc.POSITION_TYPE_GROUPED\t= 0x2;\ncc.POSITION_TYPE_RELATIVE\t= 0x1;\ncc.PRIORITY_NON_SYSTEM_MIN\t= -2147483647;\ncc.PRIORITY_SYSTEM\t= -2147483648;\ncc.PROGRESS_TIMER_TYPE_BAR\t= 0x1;\ncc.PROGRESS_TIMER_TYPE_RADIAL\t= 0x0;\ncc.REPEAT_FOREVER\t= 0xfffffffe;\ncc.RESOLUTION_MAC\t= 0x1;\ncc.RESOLUTION_MAC_RETINA_DISPLAY\t= 0x2;\ncc.RESOLUTION_UNKNOWN\t= 0x0;\ncc.TMX_TILE_DIAGONAL_FLAG\t= 0x20000000;\ncc.TMX_TILE_HORIZONTAL_FLAG\t= 0x80000000;\ncc.TMX_TILE_VERTICAL_FLAG\t= 0x40000000;\ncc.TEXT_ALIGNMENT_CENTER\t= 0x1;\ncc.TEXT_ALIGNMENT_LEFT\t= 0x0;\ncc.TEXT_ALIGNMENT_RIGHT\t= 0x2;\ncc.TEXTURE_2D_PIXEL_FORMAT_A8\t= 0x3;\ncc.TEXTURE_2D_PIXEL_FORMAT_AI88\t= 0x5;\ncc.TEXTURE_2D_PIXEL_FORMAT_DEFAULT\t= 0x0;\ncc.TEXTURE_2D_PIXEL_FORMAT_I8\t= 0x4;\ncc.TEXTURE_2D_PIXEL_FORMAT_PVRTC2\t= 0x9;\ncc.TEXTURE_2D_PIXEL_FORMAT_PVRTC4\t= 0x8;\ncc.TEXTURE_2D_PIXEL_FORMAT_RGB565\t= 0x2;\ncc.TEXTURE_2D_PIXEL_FORMAT_RGB5A1\t= 0x7;\ncc.TEXTURE_2D_PIXEL_FORMAT_RGB888\t= 0x1;\ncc.TEXTURE_2D_PIXEL_FORMAT_RGBA4444\t= 0x6;\ncc.TEXTURE_2D_PIXEL_FORMAT_RGBA8888\t= 0x0;\ncc.TOUCHES_ALL_AT_ONCE\t= 0x0;\ncc.TOUCHES_ONE_BY_ONE\t= 0x1;\ncc.TRANSITION_ORIENTATION_DOWN_OVER\t= 0x1;\ncc.TRANSITION_ORIENTATION_LEFT_OVER\t= 0x0;\ncc.TRANSITION_ORIENTATION_RIGHT_OVER\t= 0x1;\ncc.TRANSITION_ORIENTATION_UP_OVER\t= 0x0;\ncc.UNIFORM_COS_TIME\t= 0x5;\ncc.UNIFORM_MV_MATRIX\t= 0x1;\ncc.UNIFORM_MVP_MATRIX\t= 0x2;\ncc.UNIFORM_P_MATRIX\t= 0x0;\ncc.UNIFORM_RANDOM01\t= 0x6;\ncc.UNIFORM_SAMPLER\t= 0x7;\ncc.UNIFORM_SIN_TIME\t= 0x4;\ncc.UNIFORM_TIME\t= 0x3;\ncc.UNIFORM_MAX\t= 0x8;\ncc.VERTEX_ATTRIB_FLAG_COLOR\t= 0x2;\ncc.VERTEX_ATTRIB_FLAG_NONE\t= 0x0;\ncc.VERTEX_ATTRIB_FLAG_POS_COLOR_TEX\t= 0x7;\ncc.VERTEX_ATTRIB_FLAG_POSITION\t= 0x1;\ncc.VERTEX_ATTRIB_FLAG_TEX_COORDS\t= 0x4;\ncc.VERTEX_ATTRIB_COLOR\t= 0x1;\ncc.VERTEX_ATTRIB_MAX\t= 0x3;\ncc.VERTEX_ATTRIB_POSITION\t= 0x0;\ncc.VERTEX_ATTRIB_TEX_COORDS\t= 0x2;\ncc.VERTICAL_TEXT_ALIGNMENT_BOTTOM\t= 0x2;\ncc.VERTICAL_TEXT_ALIGNMENT_CENTER\t= 0x1;\ncc.VERTICAL_TEXT_ALIGNMENT_TOP\t= 0x0;\ncc.OS_VERSION_4_0\t= 0x4000000;\ncc.OS_VERSION_4_0_1\t= 0x4000100;\ncc.OS_VERSION_4_1\t= 0x4010000;\ncc.OS_VERSION_4_2\t= 0x4020000;\ncc.OS_VERSION_4_2_1\t= 0x4020100;\ncc.OS_VERSION_4_3\t= 0x4030000;\ncc.OS_VERSION_4_3_1\t= 0x4030100;\ncc.OS_VERSION_4_3_2\t= 0x4030200;\ncc.OS_VERSION_4_3_3\t= 0x4030300;\ncc.OS_VERSION_4_3_4\t= 0x4030400;\ncc.OS_VERSION_4_3_5\t= 0x4030500;\ncc.OS_VERSION_5_0\t= 0x5000000;\ncc.OS_VERSION_5_0_1\t= 0x5000100;\ncc.OS_VERSION_5_1_0\t= 0x5010000;\ncc.OS_VERSION_6_0_0\t= 0x6000000;\ncc.ANIMATION_FRAME_DISPLAYED_NOTIFICATION\t= 'CCAnimationFrameDisplayedNotification';\ncc.CHIPMUNK_IMPORT\t= 'chipmunk.h';\ncc.ATTRIBUTE_NAME_COLOR\t= 'a_color';\ncc.ATTRIBUTE_NAME_POSITION\t= 'a_position';\ncc.ATTRIBUTE_NAME_TEX_COORD\t= 'a_texCoord';\ncc.SHADER_POSITION_COLOR\t= 'ShaderPositionColor';\ncc.SHADER_POSITION_LENGTH_TEXURE_COLOR\t= 'ShaderPositionLengthTextureColor';\ncc.SHADER_POSITION_TEXTURE\t= 'ShaderPositionTexture';\ncc.SHADER_POSITION_TEXTURE_A8_COLOR\t= 'ShaderPositionTextureA8Color';\ncc.SHADER_POSITION_TEXTURE_COLOR\t= 'ShaderPositionTextureColor';\ncc.SHADER_POSITION_TEXTURE_COLOR_ALPHA_TEST\t= 'ShaderPositionTextureColorAlphaTest';\ncc.SHADER_POSITION_TEXTURE_U_COLOR\t= 'ShaderPositionTexture_uColor';\ncc.SHADER_POSITION_U_COLOR\t= 'ShaderPosition_uColor';\ncc.UNIFORM_ALPHA_TEST_VALUE_S\t= 'CC_AlphaValue';\ncc.UNIFORM_COS_TIME_S\t= 'CC_CosTime';\ncc.UNIFORM_MV_MATRIX_S\t= 'CC_MVMatrix';\ncc.UNIFORM_MVP_MATRIX_S\t= 'CC_MVPMatrix';\ncc.UNIFORM_P_MATRIX_S\t= 'CC_PMatrix';\ncc.UNIFORM_RANDOM01_S\t= 'CC_Random01';\ncc.UNIFORM_SAMPLER_S\t= 'CC_Texture0';\ncc.UNIFORM_SIN_TIME_S\t= 'CC_SinTime';\ncc.UNIFORM_TIME_S\t= 'CC_Time';\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_extension.js",
    "content": "//\n// cocos2d constants\n//\n// This helper file should be required after jsb_cocos2d.js\n//\n\nvar cc = cc || {};\n\ncc.SCROLLVIEW_DIRECTION_NONE = -1;\ncc.SCROLLVIEW_DIRECTION_HORIZONTAL = 0;\ncc.SCROLLVIEW_DIRECTION_VERTICAL = 1;\ncc.SCROLLVIEW_DIRECTION_BOTH = 2;\ncc.TABLEVIEW_FILL_TOPDOWN = 0;\ncc.TABLEVIEW_FILL_BOTTOMUP = 1;\n\n\n/**\n * @constant\n * @type Number\n */\ncc.KEYBOARD_RETURNTYPE_DEFAULT = 0;\n\n/**\n * @constant\n * @type Number\n */\ncc.KEYBOARD_RETURNTYPE_DONE = 1;\n\n/**\n * @constant\n * @type Number\n */\ncc.KEYBOARD_RETURNTYPE_SEND = 2;\n\n/**\n * @constant\n * @type Number\n */\ncc.KEYBOARD_RETURNTYPE_SEARCH = 3;\n\n/**\n * @constant\n * @type Number\n */\ncc.KEYBOARD_RETURNTYPE_GO = 4;\n\n/**\n * The EditBox::InputMode defines the type of text that the user is allowed * to enter.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_MODE_ANY = 0;\n\n/**\n * The user is allowed to enter an e-mail address.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_MODE_EMAILADDR = 1;\n\n/**\n * The user is allowed to enter an integer value.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_MODE_NUMERIC = 2;\n\n/**\n * The user is allowed to enter a phone number.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_MODE_PHONENUMBER = 3;\n\n/**\n * The user is allowed to enter a URL.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_MODE_URL = 4;\n\n/**\n * The user is allowed to enter a real number value.\n * This extends kEditBoxInputModeNumeric by allowing a decimal point.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_MODE_DECIMAL = 5;\n\n/**\n * The user is allowed to enter any text, except for line breaks.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_MODE_SINGLELINE = 6;\n\n/**\n * Indicates that the text entered is confidential data that should be\n * obscured whenever possible. This implies EDIT_BOX_INPUT_FLAG_SENSITIVE.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_FLAG_PASSWORD = 0;\n\n/**\n * Indicates that the text entered is sensitive data that the\n * implementation must never store into a dictionary or table for use\n * in predictive, auto-completing, or other accelerated input schemes.\n * A credit card number is an example of sensitive data.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_FLAG_SENSITIVE = 1;\n\n/**\n * This flag is a hint to the implementation that during text editing,\n * the initial letter of each word should be capitalized.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_WORD = 2;\n\n/**\n * This flag is a hint to the implementation that during text editing,\n * the initial letter of each sentence should be capitalized.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_SENTENCE = 3;\n\n/**\n * Capitalize all characters automatically.\n * @constant\n * @type Number\n */\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_ALL_CHARACTERS = 4;\n\ncc.CONTROL_EVENT_TOTAL_NUMBER = 9;\n\ncc.CONTROL_EVENT_TOUCH_DOWN = 1 << 0;    // A touch-down event in the control.\ncc.CONTROL_EVENT_TOUCH_DRAG_INSIDE = 1 << 1;    // An event where a finger is dragged inside the bounds of the control.\ncc.CONTROL_EVENT_TOUCH_DRAG_OUTSIDE = 1 << 2;    // An event where a finger is dragged just outside the bounds of the control.\ncc.CONTROL_EVENT_TOUCH_DRAG_ENTER = 1 << 3;    // An event where a finger is dragged into the bounds of the control.\ncc.CONTROL_EVENT_TOUCH_DRAG_EXIT = 1 << 4;    // An event where a finger is dragged from within a control to outside its bounds.\ncc.CONTROL_EVENT_TOUCH_UP_INSIDE = 1 << 5;    // A touch-up event in the control where the finger is inside the bounds of the control.\ncc.CONTROL_EVENT_TOUCH_UP_OUTSIDE = 1 << 6;    // A touch-up event in the control where the finger is outside the bounds of the control.\ncc.CONTROL_EVENT_TOUCH_CANCEL = 1 << 7;    // A system event canceling the current touches for the control.\ncc.CONTROL_EVENT_VALUECHANGED = 1 << 8;    // A touch dragging or otherwise manipulating a control; causing it to emit a series of different values.\n\ncc.CONTROL_STATE_NORMAL = 1 << 0; // The normal; or default state of a control梩hat is; enabled but neither selected nor highlighted.\ncc.CONTROL_STATE_HIGHLIGHTED = 1 << 1; // Highlighted state of a control. A control enters this state when a touch down; drag inside or drag enter is performed. You can retrieve and set this value through the highlighted property.\ncc.CONTROL_STATE_DISABLED = 1 << 2; // Disabled state of a control. This state indicates that the control is currently disabled. You can retrieve and set this value through the enabled property.\ncc.CONTROL_STATE_SELECTED = 1 << 3;  // Selected state of a control. This state indicates that the control is currently selected. You can retrieve and set this value through the selected property.\ncc.CONTROL_STATE_INITIAL = 1 << 3;\n\n// PhysicsDebugNode\ncc.PhysicsDebugNode.create = function( space ) {\n    var s = space;\n    if( space.handle !== undefined )\n        s = space.handle;\n    return cc.PhysicsDebugNode._create( s );\n};\ncc.PhysicsDebugNode.prototype.setSpace = function( space ) {\n    var s = space;\n    if( space.handle !== undefined )\n        s = space.handle;\n    return this._setSpace( s );\n};\n\n// PhysicsSprite\ncc.PhysicsSprite.prototype.setBody = function( body ) {\n    var b = body;\n    if( body.handle !== undefined )\n        b = body.handle;\n    return this._setCPBody( b );\n};\n\ncc.PhysicsSprite.prototype.getBody = function() {\n    return this.getCPBody();\n};\n\ncc.ScrollView.extend = cc.Class.extend;\ncc.TableView.extend = cc.Class.extend;\ncc.TableViewCell.extend = cc.Class.extend;\ncc.GLNode.extend = cc.Class.extend;\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_gui.js",
    "content": "//\n// cocos2d gui constants\n//\n// This helper file should be required after jsb_cocos2d.js\n//\n\nvar ccui = ccui || {};\n\nccui.BrightStyle = {\n    none: -1,\n    normal: 0,\n    highlight: 1\n};\n\nccui.WidgetType = {\n    widget: 0, //control\n    container: 1 //container\n};\n\nccui.TextureResType = {\n    local: 0,\n    plist: 1\n};\n\nccui.TouchEventType = {\n    began: 0,\n    moved: 1,\n    ended: 2,\n    canceled: 3\n};\n\nccui.SizeType = {\n    absolute: 0,\n    percent: 1\n};\n\nccui.PositionType = {\n    absolute: 0,\n    percent: 1\n};\n\nccui.CheckBoxEventType = {\n    selected: 0,\n    unselected: 1\n};\n\nccui.TextFiledEventType = {\n    attach_with_me: 0,\n    detach_with_ime: 1,\n    insert_text: 2,\n    delete_backward: 3\n};\n\nccui.LayoutBackGroundColorType = {\n    none: 0,\n    solid: 1,\n    gradient: 2\n};\n\nccui.LayoutType = {\n    absolute: 0,\n    linearVertical: 1,\n    linearHorizontal: 2,\n    relative: 3\n};\n\nccui.LayoutParameterType = {\n    none: 0,\n    linear: 1,\n    relative: 2\n};\n\nccui.LinearGravity = {\n    none: 0,\n    left: 1,\n    top: 2,\n    right: 3,\n    bottom: 4,\n    centerVertical: 5,\n    centerHorizontal: 6\n};\n\nccui.RelativeAlign = {\n    alignNone: 0,\n    alignParentTopLeft: 1,\n    alignParentTopCenterHorizontal: 2,\n    alignParentTopRight: 3,\n    alignParentLeftCenterVertical: 4,\n    centerInParent: 5,\n    alignParentRightCenterVertical: 6,\n    alignParentLeftBottom: 7,\n    alignParentBottomCenterHorizontal: 8,\n    alignParentRightBottom: 9,\n    locationAboveLeftAlign: 10,\n    locationAboveCenter: 11,\n    locationAboveRightAlign: 12,\n    locationLeftOfTopAlign: 13,\n    locationLeftOfCenter: 14,\n    locationLeftOfBottomAlign: 15,\n    locationRightOfTopAlign: 16,\n    locationRightOfCenter: 17,\n    locationRightOfBottomAlign: 18,\n    locationBelowLeftAlign: 19,\n    locationBelowCenter: 20,\n    locationBelowRightAlign: 21\n};\n\nccui.SliderEventType = {percent_changed: 0};\n\nccui.LoadingBarType = { left: 0, right: 1};\n\nccui.ScrollViewDir = {\n    none: 0,\n    vertical: 1,\n    horizontal: 2,\n    both: 3\n};\n\nccui.ScrollviewEventType = {\n    scrollToTop: 0,\n    scrollToBottom: 1,\n    scrollToLeft: 2,\n    scrollToRight: 3,\n    scrolling: 4,\n    bounceTop: 5,\n    bounceBottom: 6,\n    bounceLeft: 7,\n    bounceRight: 8\n};\n\nccui.ListViewEventType = {\n    init_child: 0,\n    update_child: 1\n};\n\nccui.ListViewGravity = {\n    left: 0,\n    right: 1,\n    centerHorizontal: 2,\n    top: 3,\n    bottom: 4,\n    centerVertical: 5\n};\n\nccui.PageViewEventType = {\n    turning: 0\n};\n\nccui.PVTouchDir = {\n    touchLeft: 0,\n    touchRight: 1\n};\n\nccui.Margin = cc.Class.extend({\n    left: 0,\n    top: 0,\n    right: 0,\n    bottom: 0,\n    ctor: function () {\n        if (arguments.length == 1) {\n            var uiMargin = arguments[0];\n            this.left = uiMargin.left;\n            this.top = uiMargin.top;\n            this.right = uiMargin.right;\n            this.bottom = uiMargin.bottom;\n        }\n        if (arguments.length == 4) {\n            this.left = arguments[0];\n            this.top = arguments[1];\n            this.right = arguments[2];\n            this.bottom = arguments[3];\n        }\n    },\n    setMargin: function (l, t, r, b) {\n        this.left = l;\n        this.top = t;\n        this.right = r;\n        this.bottom = b;\n    },\n    equals: function (target) {\n        return (this.left == target.left && this.top == target.top && this.right == target.right && this.bottom == target.bottom);\n    }\n});\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_cocos2d_studio.js",
    "content": "//\n// cocos2d studio constants\n//\n// This helper file should be required after jsb_cocos2d.js\n//\n\nvar ccs = ccs || {};\n\nccs.Class = ccs.Class || cc.Class || {};\n\n//movement event type\nccs.MovementEventType = {\n    start: 0,\n    complete: 1,\n    loopComplete: 2\n};\n\n// Armature\nif(ccs.Armature){\n\tccs.Armature.prototype.setBody = function( body ) {\n    var b = body;\n    if( body.handle !== undefined )\n        b = body.handle;\n    return this._setCPBody( b );\n  };\n  \n  ccs.ComController.extend = cc.Class.extend;\n  ccs.Armature.extend = cc.Class.extend;\n}\n\n\nccs.sendEvent = function (event) {\n    var triggerObjArr = ccs.TriggerMng.getInstance().get(event);\n    if (triggerObjArr == null) {\n        return;\n    }\n    for (var i = 0; i < triggerObjArr.length; i++) {\n        var triObj = triggerObjArr[i];\n        if (triObj != null && triObj.detect()) {\n            triObj.done();\n        }\n    }\n};\n\n\nccs.ObjectFactory = ccs.Class.extend({\n    _typeMap: null,\n    ctor: function () {\n        this._typeMap = {};\n    },\n    destroyInstance: function () {\n        this._sharedFactory = null;\n    },\n\n    createObject: function (className) {\n        var o = null;\n        var t = this._typeMap[className];\n        if (t) {\n            o = new t._fun();\n        }\n        return o;\n    },\n\n    registerType: function (t) {\n        this._typeMap[t._className] = t;\n    }\n});\n\nccs.ObjectFactory._sharedFactory = null;\n\nccs.ObjectFactory.getInstance = function () {\n    if (!this._sharedFactory) {\n        this._sharedFactory = new ccs.ObjectFactory();\n    }\n    return this._sharedFactory;\n};\n\nccs.TInfo = ccs.Class.extend({\n    _className: \"\",\n    _fun: null,\n    /**\n     *\n     * @param {String|ccs.TInfo}c\n     * @param {Function}f\n     */\n    ctor: function (c, f) {\n        if (f) {\n            this._className = c;\n            this._fun = f;\n        }else{\n            this._className = c._className;\n            this._fun = c._fun;\n        }\n        ccs.ObjectFactory.getInstance().registerType(this);\n    }\n});\n\nccs.registerTriggerClass = function(className, createFunc) {\n    new ccs.TInfo(className, createFunc);\n}\n\nccs.BaseTriggerCondition = ccs.Class.extend({\n    init: function () {\n        return true;\n    },\n\n    detect: function () {\n        return true;\n    },\n\n    serialize: function (jsonVal) {\n    },\n\n    removeAll: function () {\n    }\n});\nccs.BaseTriggerAction = ccs.Class.extend({\n\n    init: function () {\n        return true;\n    },\n\n    done: function () {\n\n    },\n\n    serialize: function (jsonVal) {\n    },\n\n    removeAll: function () {\n    }\n});\n\nccs.TriggerObj = ccs.Class.extend({\n    _cons: null,\n    _acts: null,\n    _id: 0,\n    _enable: true,\n    _vInt: null,\n\n    ctor: function () {\n        this._id = 0;\n        this._enable = true;\n    },\n\n    init: function () {\n        this._cons = [];\n        this._acts = [];\n        this._vInt = [];\n        return true;\n    },\n\n    detect: function () {\n        if (!this._enable || this._cons.length == 0) {\n            return true;\n        }\n        var ret = true;\n        var obj = null;\n        for (var i = 0; i < this._cons.length; i++) {\n            obj = this._cons[i];\n            if (obj && obj.detect) {\n                ret = ret && obj.detect();\n            }\n        }\n        return ret;\n    },\n\n    done: function () {\n        if (!this._enable || this._acts.length == 0) {\n            return;\n        }\n        var obj;\n        for (var i = 0; i < this._acts.length; i++) {\n            obj = this._acts[i];\n            if (obj && obj.done) {\n                obj.done();\n            }\n        }\n    },\n\n    removeAll: function () {\n        var obj = null;\n        for (var i = 0; i < this._cons.length; i++) {\n            obj = this._cons[i];\n            if (obj)\n                obj.removeAll();\n        }\n        this._cons = [];\n        for (var i = 0; i < this._acts.length; i++) {\n            obj = this._acts[i];\n            if (obj)\n                obj.removeAll();\n        }\n        this._acts = [];\n    },\n\n    serialize: function (jsonVal) {\n        this._id = jsonVal[\"id\"] || 0;\n        var conditions = jsonVal[\"conditions\"] || [];\n        for (var i = 0; i < conditions.length; i++) {\n            var subDict = conditions[i];\n            var classname = subDict[\"classname\"];\n            if (!classname) {\n                continue;\n            }\n            var con = ccs.ObjectFactory.getInstance().createObject(classname);\n            if (!con) {\n                cc.log(\"class named classname(\" + classname + \") can not implement!\");\n            }\n\n            con.serialize(subDict);\n            con.init();\n            this._cons.push(con);\n        }\n\n        var actions = jsonVal[\"actions\"] || [];\n        for (var i = 0; i < actions.length; i++) {\n            var subDict = actions[i];\n            var classname = subDict[\"classname\"];\n            if (!classname) {\n                continue;\n            }\n            var act = ccs.ObjectFactory.getInstance().createObject(classname);\n            if (!act) {\n                cc.log(\"class named classname(\" + classname + \") can not implement!\");\n            }\n\n            act.serialize(subDict);\n            act.init();\n            this._acts.push(act);\n        }\n\n        var events = jsonVal[\"events\"] || [];\n        for (var i = 0; i < events.length; i++) {\n            var subDict = events[i];\n            var event = subDict[\"id\"];\n            if (event < 0) {\n                continue;\n            }\n            this._vInt.push(event);\n        }\n    },\n\n    getId: function () {\n        return this._id;\n    },\n\n    setEnable: function (enable) {\n        this._enable = enable;\n    },\n\n    getEvents: function () {\n        return this._vInt;\n    }\n});\n\nccs.TriggerObj.create = function() {\n  var ret = new ccs.TriggerObj();\n  if (ret.init())\n    return ret;\n  return null;\n}\n\nccs.TriggerMng = ccs.Class.extend({\n    _eventTriggers: null,\n    _triggerObjs: null,\n    _movementDispatches: null,\n    ctor: function () {\n        this._eventTriggers = {};\n        this._triggerObjs = {};\n        this._movementDispatches = [];\n    },\n\n    destroyInstance: function () {\n        this.removeAll();\n        this._instance = null;\n    },\n\n    parse: function (root) {\n        var triggers = root;//[\"Triggers\"];\n        for (var i = 0; i < triggers.length; ++i) {\n            var subDict = triggers[i];\n            var triggerObj = ccs.TriggerObj.create();\n            triggerObj.serialize(subDict);\n            var events = triggerObj.getEvents();\n            for (var j = 0; j < events.length; j++) {\n                var event = events[j];\n                this.add(event, triggerObj);\n            }\n            this._triggerObjs[triggerObj.getId()] = triggerObj;\n        }\n    },\n\n    get: function (event) {\n        return this._eventTriggers[event];\n    },\n\n    getTriggerObj: function (id) {\n        return this._triggerObjs[id];\n    },\n\n    add: function (event, triggerObj) {\n        var eventTriggers = this._eventTriggers[event];\n        if (!eventTriggers) {\n            eventTriggers = [];\n        }\n        if (!cc.ArrayContainsObject(eventTriggers, triggerObj)) {\n            eventTriggers.push(triggerObj);\n            this._eventTriggers[event] = eventTriggers;\n        }\n    },\n\n    removeAll: function () {\n        for (var key in this._eventTriggers) {\n            var triObjArr = this._eventTriggers[key];\n            for (var j = 0; j < triObjArr.length; j++) {\n                var obj = triObjArr[j];\n                obj.removeAll();\n            }\n        }\n        this._eventTriggers = {};\n    },\n\n    remove: function (event, Obj) {\n        if (Obj) {\n            return this._removeObj(event, Obj);\n        }\n        var bRet = false;\n        do\n        {\n            var triObjects = this._eventTriggers[event];\n            if (!triObjects) break;\n            for (var i = 0; i < triObjects.length; i++) {\n                var triObject = triObjects[i];\n                if (triObject) {\n                    triObject.removeAll();\n                }\n            }\n            delete this._eventTriggers[event];\n            bRet = true;\n        } while (0);\n        return bRet;\n    },\n\n    _removeObj: function (event, Obj) {\n        var bRet = false;\n        do\n        {\n            var triObjects = this._eventTriggers[event];\n            if (!triObjects) break;\n            for (var i = 0; i < triObjects.length; i++) {\n                var triObject = triObjects[i];\n                if (triObject && triObject == Obj) {\n                    triObject.removeAll();\n                    triObjects.splice(i, 1);\n                    break;\n                }\n            }\n            bRet = true;\n        } while (0);\n        return bRet;\n    },\n\n    removeTriggerObj: function (id) {\n        var obj = this.getTriggerObj(id);\n        if (!obj) {\n            return false;\n        }\n        var events = obj.getEvents();\n        for (var i = 0; i < events.length; i++) {\n            var event = events[i];\n            this.remove(event, obj);\n        }\n        return true;\n    },\n    isEmpty: function () {\n        return !this._eventTriggers || this._eventTriggers.length <= 0;\n    },\n\n    addArmatureMovementCallBack: function (armature, callFunc, target) {\n        if (armature == null || target == null || callFunc == null) {\n            return;\n        }\n        var locAmd, hasADD = false;\n        for (var i = 0; i < this._movementDispatches.length; i++) {\n            locAmd = this._movementDispatches[i];\n            if (locAmd && locAmd[0] == armature) {\n                locAmd.addAnimationEventCallBack(callFunc, target);\n                hasADD = true;\n            }\n        }\n        if (!hasADD) {\n            var newAmd = new ccs.ArmatureMovementDispatcher();\n            armature.getAnimation().setMovementEventCallFunc(newAmd.animationEvent, newAmd);\n            newAmd.addAnimationEventCallBack(callFunc, target);\n            this._movementDispatches.push([armature, newAmd]);\n        }\n    },\n\n    removeArmatureMovementCallBack: function (armature, target, callFunc) {\n        if (armature == null || target == null || callFunc == null) {\n            return;\n        }\n        var locAmd;\n        for (var i = 0; i < this._movementDispatches.length; i++) {\n            locAmd = this._movementDispatches[i];\n            if (locAmd && locAmd[0] == armature) {\n                locAmd.removeAnimationEventCallBack(callFunc, target);\n            }\n        }\n    },\n\n    removeArmatureAllMovementCallBack: function (armature) {\n        if (armature == null) {\n            return;\n        }\n        var locAmd;\n        for (var i = 0; i < this._movementDispatches.length; i++) {\n            locAmd = this._movementDispatches[i];\n            if (locAmd && locAmd[0] == armature) {\n                this._movementDispatches.splice(i, 1);\n                break;\n            }\n        }\n    },\n\n    removeAllArmatureMovementCallBack: function () {\n        this._movementDispatches = [];\n    }\n});\n\nccs.TriggerMng.triggerMngVersion = function () {\n    return \"1.2.0.0\";\n};\nccs.TriggerMng._instance = null;\nccs.TriggerMng.getInstance = function () {\n    if (null == this._instance) {\n        this._instance = new ccs.TriggerMng();\n    }\n    return this._instance;\n};\n\n\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_cocosbuilder.js",
    "content": "//\n// CocosBuilder definitions\n//\n\ncc.BuilderReader = cc.BuilderReader || {};\ncc.BuilderReader._resourcePath = \"\";\n\nvar _ccbGlobalContext = this;\n\ncc.BuilderReader.setResourcePath = function (rootPath) {\n    cc.BuilderReader._resourcePath = rootPath;\n};\n\ncc.BuilderReader.load = function(file, owner, parentSize)\n{\n    // Load the node graph using the correct function\n    var reader = cc._Reader.create();\n    reader.setCCBRootPath(cc.BuilderReader._resourcePath);\n    \n    var node;\n\n    if (parentSize)\n    {\n        node = reader.load(file, null, parentSize);\n    }\n    else\n    {\n        node = reader.load(file);\n    }\n\n    // Assign owner callbacks & member variables\n    if (owner)\n    {\n        // Callbacks\n        var ownerCallbackNames = reader.getOwnerCallbackNames();\n        var ownerCallbackNodes = reader.getOwnerCallbackNodes();\n\n        for (var i = 0; i < ownerCallbackNames.length; i++)\n        {\n            var callbackName = ownerCallbackNames[i];\n            var callbackNode = ownerCallbackNodes[i];\n\n            if (owner[callbackName] === undefined)\n            {\n                cc.log(\"Warning: \" + \"owner.\" + callbackName + \" is undefined.\");\n            }\n            else\n            {\n                if(callbackNode instanceof cc.ControlButton)\n                {\n                    var ownerCallbackControlEvents = reader.getOwnerCallbackControlEvents();\n                    callbackNode.addTargetWithActionForControlEvents(owner, owner[callbackName], ownerCallbackControlEvents[i]);\n                }\n                else\n                {\n                    callbackNode.setCallback(owner[callbackName], owner);\n                }\n            }\n        }\n\n        // Variables\n        var ownerOutletNames = reader.getOwnerOutletNames();\n        var ownerOutletNodes = reader.getOwnerOutletNodes();\n\n        for (var i = 0; i < ownerOutletNames.length; i++)\n        {\n            var outletName = ownerOutletNames[i];\n            var outletNode = ownerOutletNodes[i];\n\n            owner[outletName] = outletNode;\n        }\n    }\n\n    var nodesWithAnimationManagers = reader.getNodesWithAnimationManagers();\n    var animationManagersForNodes = reader.getAnimationManagersForNodes();\n\n    // Attach animation managers to nodes and assign root node callbacks and member variables\n    for (var i = 0; i < nodesWithAnimationManagers.length; i++)\n    {\n        var innerNode = nodesWithAnimationManagers[i];\n        var animationManager = animationManagersForNodes[i];\n\n        innerNode.animationManager = animationManager;\n\n        var documentControllerName = animationManager.getDocumentControllerName();\n        if (!documentControllerName) continue;\n\n        // Create a document controller\n        var controller = new _ccbGlobalContext[documentControllerName]();\n        controller.controllerName = documentControllerName;\n\n        innerNode.controller = controller;\n        controller.rootNode = innerNode;\n\n        // Callbacks\n        var documentCallbackNames = animationManager.getDocumentCallbackNames();\n        var documentCallbackNodes = animationManager.getDocumentCallbackNodes();\n\n        for (var j = 0; j < documentCallbackNames.length; j++)\n        {\n            var callbackName = documentCallbackNames[j];\n            var callbackNode = documentCallbackNodes[j];\n\n            if (controller[callbackName] === undefined)\n            {\n                cc.log(\"Warning: \" + documentControllerName + \".\" + callbackName + \" is undefined.\");\n            }\n            else\n            {\n                if(callbackNode instanceof cc.ControlButton)\n                {\n                    var documentCallbackControlEvents = animationManager.getDocumentCallbackControlEvents();\n                    callbackNode.addTargetWithActionForControlEvents(controller, controller[callbackName], documentCallbackControlEvents[j]); \n                }\n                else\n                {\n                    callbackNode.setCallback(controller[callbackName], controller);\n                }\n            }\n        }\n\n\n        // Variables\n        var documentOutletNames = animationManager.getDocumentOutletNames();\n        var documentOutletNodes = animationManager.getDocumentOutletNodes();\n\n        for (var j = 0; j < documentOutletNames.length; j++)\n        {\n            var outletName = documentOutletNames[j];\n            var outletNode = documentOutletNodes[j];\n\n            controller[outletName] = outletNode;\n        }\n\n        if (typeof(controller.onDidLoadFromCCB) == \"function\")\n        {\n            controller.onDidLoadFromCCB();\n        }\n\n        // Setup timeline callbacks\n        var keyframeCallbacks = animationManager.getKeyframeCallbacks();\n        for (var j = 0; j < keyframeCallbacks.length; j++)\n        {\n            var callbackSplit = keyframeCallbacks[j].split(\":\");\n            var callbackType = callbackSplit[0];\n            var callbackName = callbackSplit[1];\n            \n            if (callbackType == 1) // Document callback\n            {\n                var callfunc = cc.CallFunc.create(controller[callbackName], controller);\n                animationManager.setCallFunc(callfunc, keyframeCallbacks[j]);\n            }\n            else if (callbackType == 2 && owner) // Owner callback\n            {\n                var callfunc = cc.CallFunc.create(owner[callbackName], owner);\n                animationManager.setCallFunc(callfunc, keyframeCallbacks[j]);\n            }\n        }\n        \n        // Start animation\n        var autoPlaySeqId = animationManager.getAutoPlaySequenceId();\n        if (autoPlaySeqId != -1)\n        {\n            animationManager.runAnimationsForSequenceIdTweenDuration(autoPlaySeqId, 0);\n        }\n    }\n\n    return node;\n};\n\ncc.BuilderReader.loadAsScene = function(file, owner, parentSize)\n{\n    var node = cc.BuilderReader.load(file, owner, parentSize);\n    var scene = cc.Scene.create();\n    scene.addChild( node );\n\n    return scene;\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_debugger.js",
    "content": "require('debugger/DevToolsUtils.js', \"debug\");\nrequire('debugger/core/promise.js', \"debug\");\nrequire('debugger/transport.js', \"debug\");\nrequire('debugger/actors/root.js', \"debug\");\nrequire('debugger/actors/script.js', \"debug\");\nrequire('debugger/main.js', \"debug\");\n\nvar globalDebuggee = null;\n\nfunction TestTabActor(aConnection, aGlobal)\n{\n  this.conn = aConnection;\n  this._global = aGlobal;\n  this._threadActor = new ThreadActor(this, this._global);\n  this.conn.addActor(this._threadActor);\n  this._attached = false;\n}\n\nTestTabActor.prototype = {\n  constructor: TestTabActor,\n  actorPrefix: \"TestTabActor\",\n\n  grip: function() {\n    return { actor: this.actorID, title: \"Hello Cocos2d-X JSB\", url: \"http://cocos2d-x.org\" };\n  },\n\n  onAttach: function(aRequest) {\n    this._attached = true;\n    return { type: \"tabAttached\", threadActor: this._threadActor.actorID };\n  },\n\n  onDetach: function(aRequest) {\n    if (!this._attached) {\n      return { \"error\":\"wrongState\" };\n    }\n    return { type: \"detached\" };\n  },\n\n  // Hooks for use by TestTabActors.\n  addToParentPool: function(aActor) {\n    this.conn.addActor(aActor);\n  },\n\n  removeFromParentPool: function(aActor) {\n    this.conn.removeActor(aActor);\n  }\n};\n\nTestTabActor.prototype.requestTypes = {\n  \"attach\": TestTabActor.prototype.onAttach,\n  \"detach\": TestTabActor.prototype.onDetach\n};\n\nfunction TestTabList(aConnection) {\n  this.conn = aConnection;\n\n  // An array of actors for each global added with\n  // DebuggerServer.addTestGlobal.\n  this._tabActors = [];\n\n  // A pool mapping those actors' names to the actors.\n  this._tabActorPool = new ActorPool(aConnection);\n\n  // for (let global of gTestGlobals) {\n    let actor = new TestTabActor(aConnection, globalDebuggee);\n    actor.selected = false;\n    this._tabActors.push(actor);\n    this._tabActorPool.addActor(actor);\n  // }\n  if (this._tabActors.length > 0) {\n    this._tabActors[0].selected = true;\n  }\n\n  aConnection.addActorPool(this._tabActorPool);\n}\n\nTestTabList.prototype = {\n  constructor: TestTabList,\n  iterator: function() {\n    for (let actor of this._tabActors) {\n      yield actor;\n    }\n  }\n};\n\nthis.processInput = function (inputstr) {\n\n    if (!inputstr) {\n        return;\n    }\n\n    if (inputstr === \"connected\")\n    {\n\n        DebuggerServer.createRootActor = (conn => {\n            return new RootActor(conn, { tabList: new TestTabList(conn) });\n        });\n        DebuggerServer.init(() => true);\n        DebuggerServer.openListener(5086);\n\n        if (debuggerServer && debuggerServer.onSocketAccepted)\n        {\n            var aTransport = {\n                host: \"127.0.0.1\",\n                port: 5086,\n                openInputStream: function() {\n                    return {\n                        close: function(){}\n                    };\n                },\n                openOutputStream: function() {\n                    return {\n                        close: function(){},\n                        write: function(){},\n                        asyncWait: function(){}\n                    };\n                },\n            };\n\n            debuggerServer.onSocketAccepted(null, aTransport);\n        }\n        return;\n    }\n\n    if (DebuggerServer && DebuggerServer._transport && DebuggerServer._transport.onDataAvailable)\n    {\n        DebuggerServer._transport.onDataAvailable(inputstr);\n    }\n};\n\nthis._prepareDebugger = function (global) {\n\n    globalDebuggee = global;\n};\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_deprecated.js",
    "content": "// Deprecated functions\n\nvar cc = cc || {};\n\n(function() {\n\n    var logW = function(old_name, new_name) {\n        cc.log(\"\\n********** \\n\"+old_name +\" was deprecated, please use \"+ new_name +\" instead.\\n**********\");\n    };\n\n    // Deprecated static functions\n    cc.AnimationCache.purgeSharedAnimationCache = function() {\n        logW(\"cc.AnimationCache.purgeSharedAnimationCache\", \"cc.AnimationCache.destroyInstance\");\n        cc.AnimationCache.destroyInstance();\n    };\n\n    cc.TextureCache.getInstance = function() {\n        return cc.Director.getInstance().getTextureCache();\n    };\n\n    // Deprecated member functions\n    cc.Action.prototype.copy = function() {\n        logW(\"cc.Action.copy\", \"cc.Action.clone\");\n        return cc.Action.prototype.clone.apply(this, arguments);\n    };\n\n    cc.Animation.prototype.copy = function() {\n        logW(\"cc.Animation.copy\", \"cc.Animation.clone\");\n        return cc.Animation.prototype.clone.apply(this, arguments);\n    };\n\n    cc.Node.prototype.nodeToWorldTransform = function() {\n        logW(\"cc.Node.nodeToWorldTransform\", \"cc.Node.getNodeToWorldTransform\");\n        return cc.Node.prototype.getNodeToWorldTransform.apply(this, arguments);\n    };\n\n    cc.Node.prototype.nodeToParentTransform = function() {\n        logW(\"cc.Node.nodeToParentTransform\", \"cc.Node.getNodeToParentTransform\");\n        return cc.Node.prototype.getNodeToParentTransform.apply(this, arguments);\n    };\n\n    cc.Node.prototype.worldToNodeTransform = function() {\n        logW(\"cc.Node.worldToNodeTransform\", \"cc.Node.getWorldToNodeTransform\");\n        return cc.Node.prototype.getWorldToNodeTransform.apply(this, arguments);\n    };\n\n    cc.Node.prototype.parentToNodeTransform = function() {\n        logW(\"cc.Node.parentToNodeTransform\", \"cc.Node.getParentToNodeTransform\");\n        return cc.Node.prototype.getParentToNodeTransform.apply(this, arguments);\n    };\n    \n    cc.Node.prototype.numberOfRunningActions = function() {\n        logW(\"cc.Node.numberOfRunningActions\", \"cc.Node.getNumberOfRunningActions\");\n        return cc.Node.prototype.getNumberOfRunningActions.apply(this, arguments);\n    };\n\n    cc.Node.prototype.numberOfRunningActionsInTarget = function() {\n        logW(\"cc.Node.numberOfRunningActionsInTarget\", \"cc.Node.getNumberOfRunningActionsInTarget\");\n        return cc.Node.prototype.getNumberOfRunningActionsInTarget.apply(this, arguments);\n    };\n\n    cc.TMXTiledMap.prototype.propertiesForGID = function() {\n        logW(\"cc.TMXTiledMap.propertiesForGID\", \"cc.TMXTiledMap.getPropertiesForGID\");\n        return cc.TMXTiledMap.prototype.getPropertiesForGID.apply(this, arguments);\n    };\n\n    cc.Menu.prototype.setHandlerPriority = function() {\n        cc.log(\"cc.Menu.setHandlerPriority was deprecated, 3.0 uses new event dispatcher to dispatch touch event based on draw order, so setHandlerPriority is not needed now.\");\n    };\n\n    cc.Layer.prototype.setKeypadEnabled = function() {\n        logW(\"cc.Layer.setKeypadEnabled\", \"cc.Layer.setKeyboardEnabled\");\n        return cc.Layer.prototype.setKeyboardEnabled.apply(this, arguments);\n    };\n\n    cc.Layer.prototype.isKeypadEnabled = function() {\n        logW(\"cc.Layer.isKeypadEnabled\", \"cc.Layer.isKeyboardEnabled\");\n        return cc.Layer.prototype.isKeyboardEnabled.apply(this, arguments);\n    };\n\n    cc.registerTargettedDelegate = function() {\n        logW(\"cc.registerTargettedDelegate\", \"cc.registerTargetedDelegate\");\n        return cc.registerTargetedDelegate.apply(this, arguments);\n    };\n\n})();\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_opengl.js",
    "content": "/*\n OpenGL ES 2.0 / WebGL helper functions\n */\n\n/*\n * According to the WebGL specification ( For further info see:s http://www.khronos.org/registry/webgl/specs/latest/webgl.idl ),\n * the API should work with objects like WebGLTexture, WebGLBuffer, WebGLRenderBuffer, WebGLFramebuffer, WebGLProgram, WebGLShader.\n * OpenGL ES 2.0 doesn't have \"objects\" concepts: Instead it uses ids (GLints). So, these objects are emulated in this thin wrapper.\n */\n\n\nvar gl = gl || {};\n\n//\n// Create functions\n//\ngl.createTexture = function() {\n\t// Returns a \"WebGLTexture\" object\n\tvar ret = gl._createTexture();\n\treturn { texture_id:ret };\n};\n\ngl.createBuffer = function() {\n\t// Returns a \"WebGLBuffer\" object\n\tvar ret = gl._createBuffer();\n\treturn { buffer_id:ret };\n};\n\ngl.createRenderbuffer = function() {\n\t// Returns a \"WebGLRenderBuffer\" object\n\tvar ret = gl._createRenderuffer();\n\treturn { renderbuffer_id:ret};\n};\n\ngl.createFramebuffer = function() {\n\t// Returns a \"WebGLFramebuffer\" object\n\tvar ret = gl._createFramebuffer();\n\treturn {framebuffer_id:ret};\n};\n\ngl.createProgram = function() {\n\t// Returns a \"WebGLProgram\" object\n\tvar ret = gl._createProgram();\n\treturn {program_id:ret};\n};\n\ngl.createShader = function(shaderType) {\n\t// Returns a \"WebGLShader\" object\n\tvar ret = gl._createShader(shaderType);\n\treturn {shader_id:ret};\n};\n\n//\n// Delete Functions\n//\ngl.deleteTexture = function(texture) {\n\tvar texture_id = texture.texture_id;\n\t// Accept numbers too. eg: gl.deleteTexture(0)\n\tif( typeof texture === 'number' )\n\t\ttexture_id = texture;\n\n\tgl._deleteTexture(texture_id);\n};\n\ngl.deleteBuffer = function(bufer) {\n\tvar buffer_id = buffer.buffer_id;\n\t// Accept numbers too. eg: gl.deleteBuffer(0)\n\tif( typeof buffer === 'number' )\n\t\tbuffer_id = buffer;\n\n\tgl._deleteBuffer(buffer_id);\n};\n\ngl.deleteRenderbuffer = function(bufer) {\n\tvar buffer_id = buffer.renderbuffer_id;\n\t// Accept numbers too. eg: gl.deleteRenderbuffer(0)\n\tif( typeof buffer === 'number' )\n\t\tbuffer_id = buffer;\n\n\tgl._deleteRenderbuffer(renderbuffer_id);\n};\n\ngl.deleteFramebuffer = function(bufer) {\n\tvar buffer_id = buffer.framebuffer_id;\n\t// Accept numbers too. eg: gl.deleteFramebuffer(0)\n\tif( typeof buffer === 'number' )\n\t\tbuffer_id = buffer;\n\n\tgl._deleteFramebuffer(buffer_id);\n};\n\ngl.deleteProgram = function(program) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.deleteShader(0)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\tgl._deleteProgram(program_id);\n};\n\ngl.deleteShader = function(shader) {\n\tvar shader_id = shader.shader_id;\n\t// Accept numbers too. eg: gl.deleteShader(0)\n\tif( typeof shader === 'number' )\n\t\tshader_id = shader;\n\n\tgl._deleteShader(shader_id);\n};\n\n//\n// Bind Related\n//\n// void bindTexture(GLenum target, WebGLTexture? texture);\ngl.bindTexture = function(target, texture) {\n\n\tvar texture_id;\n\t// Accept numbers too. eg: gl.bindTexture(0)\n\tif( typeof texture === 'number' )\n\t\ttexture_id = texture;\n\telse if( texture === null )\n\t\ttexture_id = 0;\n\telse\n\t\ttexture_id = texture.texture_id;\n\n\tgl._bindTexture( target, texture_id );\n};\n\n// void bindBuffer(GLenum target, WebGLBuffer? buffer);\ngl.bindBuffer = function(target, buffer) {\n\tvar buffer_id;\n\t// Accept numbers too. eg: gl.bindBuffer(0)\n\tif( typeof buffer === 'number' )\n\t\tbuffer_id = buffer;\n\telse if( buffer === null )\n\t\tbuffer_id = 0;\n\telse\n\t\tbuffer_id = buffer.buffer_id;\n\n\tgl._bindBuffer(target, buffer_id);\n};\n\n// void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);\ngl.bindRenderBuffer = function(target, buffer) {\n\tvar buffer_id;\n\n\t// Accept numbers too. eg: gl.bindRenderbuffer(0)\n\tif( typeof buffer === 'number' )\n\t\tbuffer_id = buffer;\n\telse if( buffer === null )\n\t\tbuffer_id = 0;\n\telse\n\t\tbuffer_id = buffer.buffer_id;\n\n\tgl._bindRenderbuffer(target, buffer_id);\n};\n\n// void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);\ngl.bindFramebuffer = function(target, buffer) {\n\tvar buffer_id;\n\n\t// Accept numbers too. eg: gl.bindFramebuffer(0)\n\tif( typeof buffer === 'number' )\n\t\tbuffer_id = buffer;\n\telse if( buffer === null )\n\t\tbuffer_id = 0;\n\telse\n\t\tbuffer_id = buffer.buffer_id;\n\n\tgl._bindFramebuffer(target, buffer_id);\n};\n\n//\n// Uniform related\n//\n// any getUniform(WebGLProgram? program, WebGLUniformLocation? location);\ngl.getUniform = function(program, location) {\n\tvar program_id;\n\tvar location_id;\n\n\t// Accept numbers too. eg: gl.bindFramebuffer(0)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\telse\n\t\tprogram_id = program.program_id;\n\n\tif( typeof location === 'number' )\n\t\tlocation_id = location;\n\telse\n\t\tlocation_id = location.location_id;\n\n\treturn gl._getUniform(program_id, location_id);\n};\n\n// gl.uniformMatrix2fv = function(location, bool, matrix) {\n// \tgl._uniformMatrix2fv(program.program_id, bool, matrix);\n// };\n\n// gl.uniformMatrix3fv = function(program, bool, matrix) {\n// \tgl._uniformMatrix3fv(program.program_id, bool, matrix);\n// };\n\n// gl.uniformMatrix4fv = function(program, bool, matrix) {\n// \tgl._uniformMatrix4fv(program.program_id, bool, matrix);\n// };\n\n\n//\n// Shader related\n//\n// void compileShader(WebGLShader? shader);\ngl.compileShader = function(shader) {\n\tgl._compileShader( shader.shader_id);\n};\n\n// void shaderSource(WebGLShader? shader, DOMString source);\ngl.shaderSource = function(shader, source) {\n\tgl._shaderSource(shader.shader_id, source);\n};\n\n// any getShaderParameter(WebGLShader? shader, GLenum pname);\ngl.getShaderParameter = function(shader, e) {\n\treturn gl._getShaderParameter(shader.shader_id,e);\n};\n\n// DOMString? getShaderInfoLog(WebGLShader? shader);\ngl.getShaderInfoLog = function(shader) {\n\treturn gl._getShaderInfoLog(shader.shader_id);\n};\n\n//\n// program related\n//\n// void attachShader(WebGLProgram? program, WebGLShader? shader);\ngl.attachShader = function(program, shader) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.attachShader(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\tgl._attachShader(program_id, shader.shader_id);\n};\n\n// void linkProgram(WebGLProgram? program);\ngl.linkProgram = function(program) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.linkProgram(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\tgl._linkProgram(program_id);\n};\n\n\n// any getProgramParameter(WebGLProgram? program, GLenum pname);\ngl.getProgramParameter = function(program, e) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.getProgramParameter(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\treturn gl._getProgramParameter(program_id, e);\n};\n\n// void useProgram(WebGLProgram? program);\ngl.useProgram = function(program) {\n\tvar program_id;\n\t// Accept numbers too. eg: gl.useProgram(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\telse\n\t\tprogram_id = program.program_id;\n\n\tgl._useProgram (program_id);\n};\n\n\n// [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name);\ngl.getAttribLocation = function(program, name) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.getAttribLocation(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\treturn gl._getAttribLocation(program_id, name);\n};\n\n// WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name);\ngl.getUniformLocation = function(program, name) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.getUniformLocation(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\t// XXX: it should return an object, not an integer\n\treturn gl._getUniformLocation(program_id,name);\n};\n\n\n// WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index);\ngl.getActiveAttrib = function(program, index) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.getActiveAttrib(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\treturn gl._getActiveAttrib(program_id, index);\n};\n\n// WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index);\ngl.getActiveUniform = function(program, index) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.getActiveUniform(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\treturn gl._getActiveUniform(program_id, index);\n};\n\n// sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);\ngl.getAttachedShaders = function(program) {\n\tvar program_id = program.program_id;\n\t// Accept numbers too. eg: gl.getAttachedShaders(17)\n\tif( typeof program === 'number' )\n\t\tprogram_id = program;\n\n\treturn gl._getAttachedShaders(program_id);\n};\n\n//\n// Texture functions\n//\n\n// XXX: Currently only the 1st one is supported\n// void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);\n// void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, ImageData? pixels);\n// void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException\n// void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException\n// void texImage2D(GLenum target, GLint level, GLenum internalformat, GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException\ngl.texImage2D = function() {\n\tif( arguments.length !=  9)\n\t\tthrow \"texImage2D: Unsupported number of parameters:\" + arguments.length;\n\n\tgl._texImage2D.apply(this, arguments);\n};\n\n// XXX: Currently only the 1st one is supported\n// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView? pixels);\n// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, ImageData? pixels);\n// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException\n// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException\n// void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException\ngl.texSubImage2D = function() {\n\tif( arguments.length !=  9)\n\t\tthrow \"texImage2D: Unsupported number of parameters\";\n\n\tgl._texSubImage2D.apply(this, arguments);\n};\n\n//\n// Extensions\n//\n// From the WebGL spec:\n// Returns an object if, and only if, name is an ASCII case-insensitive match [HTML] for one of the names returned from getSupportedExtensions;\n// otherwise, returns null. The object returned from getExtension contains any constants or functions provided by the extension.\n// A returned object may have no constants or functions if the extension does not define any, but a unique object must still be returned.\n// That object is used to indicate that the extension has been enabled.\n// XXX: The returned object must return the functions and constants.\ngl.getExtension = function(extension) {\n\tvar extensions = gl.getSupportedExtensions();\n\tif( extensions.indexOf(extension) > -1 )\n\t\treturn {};\n\treturn null;\n};\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_opengl_constants.js",
    "content": "/*\n* AUTOGENERATED FILE. DO NOT EDIT IT\n* Generated by \"generate_jsb.py -c opengl_jsb.ini\" on 2013-03-18\n* Script version: v0.6\n*/\n\nvar gl = gl || {};\ngl.GCCSO_SHADER_BINARY_FJ\t= 0x9260;\ngl._3DC_XY_AMD\t= 0x87fa;\ngl._3DC_X_AMD\t= 0x87f9;\ngl.ACTIVE_ATTRIBUTES\t= 0x8b89;\ngl.ACTIVE_ATTRIBUTE_MAX_LENGTH\t= 0x8b8a;\ngl.ACTIVE_PROGRAM_EXT\t= 0x8259;\ngl.ACTIVE_TEXTURE\t= 0x84e0;\ngl.ACTIVE_UNIFORMS\t= 0x8b86;\ngl.ACTIVE_UNIFORM_MAX_LENGTH\t= 0x8b87;\ngl.ALIASED_LINE_WIDTH_RANGE\t= 0x846e;\ngl.ALIASED_POINT_SIZE_RANGE\t= 0x846d;\ngl.ALL_COMPLETED_NV\t= 0x84f2;\ngl.ALL_SHADER_BITS_EXT\t= 0xffffffff;\ngl.ALPHA\t= 0x1906;\ngl.ALPHA16F_EXT\t= 0x881c;\ngl.ALPHA32F_EXT\t= 0x8816;\ngl.ALPHA8_EXT\t= 0x803c;\ngl.ALPHA8_OES\t= 0x803c;\ngl.ALPHA_BITS\t= 0xd55;\ngl.ALPHA_TEST_FUNC_QCOM\t= 0xbc1;\ngl.ALPHA_TEST_QCOM\t= 0xbc0;\ngl.ALPHA_TEST_REF_QCOM\t= 0xbc2;\ngl.ALREADY_SIGNALED_APPLE\t= 0x911a;\ngl.ALWAYS\t= 0x207;\ngl.AMD_compressed_3DC_texture\t= 0x1;\ngl.AMD_compressed_ATC_texture\t= 0x1;\ngl.AMD_performance_monitor\t= 0x1;\ngl.AMD_program_binary_Z400\t= 0x1;\ngl.ANGLE_depth_texture\t= 0x1;\ngl.ANGLE_framebuffer_blit\t= 0x1;\ngl.ANGLE_framebuffer_multisample\t= 0x1;\ngl.ANGLE_instanced_arrays\t= 0x1;\ngl.ANGLE_pack_reverse_row_order\t= 0x1;\ngl.ANGLE_program_binary\t= 0x1;\ngl.ANGLE_texture_compression_dxt3\t= 0x1;\ngl.ANGLE_texture_compression_dxt5\t= 0x1;\ngl.ANGLE_texture_usage\t= 0x1;\ngl.ANGLE_translated_shader_source\t= 0x1;\ngl.ANY_SAMPLES_PASSED_CONSERVATIVE_EXT\t= 0x8d6a;\ngl.ANY_SAMPLES_PASSED_EXT\t= 0x8c2f;\ngl.APPLE_copy_texture_levels\t= 0x1;\ngl.APPLE_framebuffer_multisample\t= 0x1;\ngl.APPLE_rgb_422\t= 0x1;\ngl.APPLE_sync\t= 0x1;\ngl.APPLE_texture_format_BGRA8888\t= 0x1;\ngl.APPLE_texture_max_level\t= 0x1;\ngl.ARM_mali_program_binary\t= 0x1;\ngl.ARM_mali_shader_binary\t= 0x1;\ngl.ARM_rgba8\t= 0x1;\ngl.ARRAY_BUFFER\t= 0x8892;\ngl.ARRAY_BUFFER_BINDING\t= 0x8894;\ngl.ATC_RGBA_EXPLICIT_ALPHA_AMD\t= 0x8c93;\ngl.ATC_RGBA_INTERPOLATED_ALPHA_AMD\t= 0x87ee;\ngl.ATC_RGB_AMD\t= 0x8c92;\ngl.ATTACHED_SHADERS\t= 0x8b85;\ngl.BACK\t= 0x405;\ngl.BGRA8_EXT\t= 0x93a1;\ngl.BGRA_EXT\t= 0x80e1;\ngl.BGRA_IMG\t= 0x80e1;\ngl.BINNING_CONTROL_HINT_QCOM\t= 0x8fb0;\ngl.BLEND\t= 0xbe2;\ngl.BLEND_COLOR\t= 0x8005;\ngl.BLEND_DST_ALPHA\t= 0x80ca;\ngl.BLEND_DST_RGB\t= 0x80c8;\ngl.BLEND_EQUATION\t= 0x8009;\ngl.BLEND_EQUATION_ALPHA\t= 0x883d;\ngl.BLEND_EQUATION_RGB\t= 0x8009;\ngl.BLEND_SRC_ALPHA\t= 0x80cb;\ngl.BLEND_SRC_RGB\t= 0x80c9;\ngl.BLUE_BITS\t= 0xd54;\ngl.BOOL\t= 0x8b56;\ngl.BOOL_VEC2\t= 0x8b57;\ngl.BOOL_VEC3\t= 0x8b58;\ngl.BOOL_VEC4\t= 0x8b59;\ngl.BUFFER\t= 0x82e0;\ngl.BUFFER_ACCESS_OES\t= 0x88bb;\ngl.BUFFER_MAPPED_OES\t= 0x88bc;\ngl.BUFFER_MAP_POINTER_OES\t= 0x88bd;\ngl.BUFFER_OBJECT_EXT\t= 0x9151;\ngl.BUFFER_SIZE\t= 0x8764;\ngl.BUFFER_USAGE\t= 0x8765;\ngl.BYTE\t= 0x1400;\ngl.CCW\t= 0x901;\ngl.CLAMP_TO_BORDER_NV\t= 0x812d;\ngl.CLAMP_TO_EDGE\t= 0x812f;\ngl.COLOR_ATTACHMENT0\t= 0x8ce0;\ngl.COLOR_ATTACHMENT0_NV\t= 0x8ce0;\ngl.COLOR_ATTACHMENT10_NV\t= 0x8cea;\ngl.COLOR_ATTACHMENT11_NV\t= 0x8ceb;\ngl.COLOR_ATTACHMENT12_NV\t= 0x8cec;\ngl.COLOR_ATTACHMENT13_NV\t= 0x8ced;\ngl.COLOR_ATTACHMENT14_NV\t= 0x8cee;\ngl.COLOR_ATTACHMENT15_NV\t= 0x8cef;\ngl.COLOR_ATTACHMENT1_NV\t= 0x8ce1;\ngl.COLOR_ATTACHMENT2_NV\t= 0x8ce2;\ngl.COLOR_ATTACHMENT3_NV\t= 0x8ce3;\ngl.COLOR_ATTACHMENT4_NV\t= 0x8ce4;\ngl.COLOR_ATTACHMENT5_NV\t= 0x8ce5;\ngl.COLOR_ATTACHMENT6_NV\t= 0x8ce6;\ngl.COLOR_ATTACHMENT7_NV\t= 0x8ce7;\ngl.COLOR_ATTACHMENT8_NV\t= 0x8ce8;\ngl.COLOR_ATTACHMENT9_NV\t= 0x8ce9;\ngl.COLOR_ATTACHMENT_EXT\t= 0x90f0;\ngl.COLOR_BUFFER_BIT\t= 0x4000;\ngl.COLOR_BUFFER_BIT0_QCOM\t= 0x1;\ngl.COLOR_BUFFER_BIT1_QCOM\t= 0x2;\ngl.COLOR_BUFFER_BIT2_QCOM\t= 0x4;\ngl.COLOR_BUFFER_BIT3_QCOM\t= 0x8;\ngl.COLOR_BUFFER_BIT4_QCOM\t= 0x10;\ngl.COLOR_BUFFER_BIT5_QCOM\t= 0x20;\ngl.COLOR_BUFFER_BIT6_QCOM\t= 0x40;\ngl.COLOR_BUFFER_BIT7_QCOM\t= 0x80;\ngl.COLOR_CLEAR_VALUE\t= 0xc22;\ngl.COLOR_EXT\t= 0x1800;\ngl.COLOR_WRITEMASK\t= 0xc23;\ngl.COMPARE_REF_TO_TEXTURE_EXT\t= 0x884e;\ngl.COMPILE_STATUS\t= 0x8b81;\ngl.COMPRESSED_RGBA_ASTC_10x10_KHR\t= 0x93bb;\ngl.COMPRESSED_RGBA_ASTC_10x5_KHR\t= 0x93b8;\ngl.COMPRESSED_RGBA_ASTC_10x6_KHR\t= 0x93b9;\ngl.COMPRESSED_RGBA_ASTC_10x8_KHR\t= 0x93ba;\ngl.COMPRESSED_RGBA_ASTC_12x10_KHR\t= 0x93bc;\ngl.COMPRESSED_RGBA_ASTC_12x12_KHR\t= 0x93bd;\ngl.COMPRESSED_RGBA_ASTC_4x4_KHR\t= 0x93b0;\ngl.COMPRESSED_RGBA_ASTC_5x4_KHR\t= 0x93b1;\ngl.COMPRESSED_RGBA_ASTC_5x5_KHR\t= 0x93b2;\ngl.COMPRESSED_RGBA_ASTC_6x5_KHR\t= 0x93b3;\ngl.COMPRESSED_RGBA_ASTC_6x6_KHR\t= 0x93b4;\ngl.COMPRESSED_RGBA_ASTC_8x5_KHR\t= 0x93b5;\ngl.COMPRESSED_RGBA_ASTC_8x6_KHR\t= 0x93b6;\ngl.COMPRESSED_RGBA_ASTC_8x8_KHR\t= 0x93b7;\ngl.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\t= 0x8c03;\ngl.COMPRESSED_RGBA_PVRTC_2BPPV2_IMG\t= 0x9137;\ngl.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\t= 0x8c02;\ngl.COMPRESSED_RGBA_PVRTC_4BPPV2_IMG\t= 0x9138;\ngl.COMPRESSED_RGBA_S3TC_DXT1_EXT\t= 0x83f1;\ngl.COMPRESSED_RGBA_S3TC_DXT3_ANGLE\t= 0x83f2;\ngl.COMPRESSED_RGBA_S3TC_DXT5_ANGLE\t= 0x83f3;\ngl.COMPRESSED_RGB_PVRTC_2BPPV1_IMG\t= 0x8c01;\ngl.COMPRESSED_RGB_PVRTC_4BPPV1_IMG\t= 0x8c00;\ngl.COMPRESSED_RGB_S3TC_DXT1_EXT\t= 0x83f0;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR\t= 0x93db;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR\t= 0x93d8;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR\t= 0x93d9;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR\t= 0x93da;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR\t= 0x93dc;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR\t= 0x93dd;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR\t= 0x93d0;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR\t= 0x93d1;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR\t= 0x93d2;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR\t= 0x93d3;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR\t= 0x93d4;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR\t= 0x93d5;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR\t= 0x93d6;\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR\t= 0x93d7;\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV\t= 0x8c4d;\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV\t= 0x8c4e;\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV\t= 0x8c4f;\ngl.COMPRESSED_SRGB_S3TC_DXT1_NV\t= 0x8c4c;\ngl.COMPRESSED_TEXTURE_FORMATS\t= 0x86a3;\ngl.CONDITION_SATISFIED_APPLE\t= 0x911c;\ngl.CONSTANT_ALPHA\t= 0x8003;\ngl.CONSTANT_COLOR\t= 0x8001;\ngl.CONTEXT_FLAG_DEBUG_BIT\t= 0x2;\ngl.CONTEXT_ROBUST_ACCESS_EXT\t= 0x90f3;\ngl.COUNTER_RANGE_AMD\t= 0x8bc1;\ngl.COUNTER_TYPE_AMD\t= 0x8bc0;\ngl.COVERAGE_ALL_FRAGMENTS_NV\t= 0x8ed5;\ngl.COVERAGE_ATTACHMENT_NV\t= 0x8ed2;\ngl.COVERAGE_AUTOMATIC_NV\t= 0x8ed7;\ngl.COVERAGE_BUFFERS_NV\t= 0x8ed3;\ngl.COVERAGE_BUFFER_BIT_NV\t= 0x8000;\ngl.COVERAGE_COMPONENT4_NV\t= 0x8ed1;\ngl.COVERAGE_COMPONENT_NV\t= 0x8ed0;\ngl.COVERAGE_EDGE_FRAGMENTS_NV\t= 0x8ed6;\ngl.COVERAGE_SAMPLES_NV\t= 0x8ed4;\ngl.CPU_OPTIMIZED_QCOM\t= 0x8fb1;\ngl.CULL_FACE\t= 0xb44;\ngl.CULL_FACE_MODE\t= 0xb45;\ngl.CURRENT_PROGRAM\t= 0x8b8d;\ngl.CURRENT_QUERY_EXT\t= 0x8865;\ngl.CURRENT_VERTEX_ATTRIB\t= 0x8626;\ngl.CW\t= 0x900;\ngl.DEBUG_CALLBACK_FUNCTION\t= 0x8244;\ngl.DEBUG_CALLBACK_USER_PARAM\t= 0x8245;\ngl.DEBUG_GROUP_STACK_DEPTH\t= 0x826d;\ngl.DEBUG_LOGGED_MESSAGES\t= 0x9145;\ngl.DEBUG_NEXT_LOGGED_MESSAGE_LENGTH\t= 0x8243;\ngl.DEBUG_OUTPUT\t= 0x92e0;\ngl.DEBUG_OUTPUT_SYNCHRONOUS\t= 0x8242;\ngl.DEBUG_SEVERITY_HIGH\t= 0x9146;\ngl.DEBUG_SEVERITY_LOW\t= 0x9148;\ngl.DEBUG_SEVERITY_MEDIUM\t= 0x9147;\ngl.DEBUG_SEVERITY_NOTIFICATION\t= 0x826b;\ngl.DEBUG_SOURCE_API\t= 0x8246;\ngl.DEBUG_SOURCE_APPLICATION\t= 0x824a;\ngl.DEBUG_SOURCE_OTHER\t= 0x824b;\ngl.DEBUG_SOURCE_SHADER_COMPILER\t= 0x8248;\ngl.DEBUG_SOURCE_THIRD_PARTY\t= 0x8249;\ngl.DEBUG_SOURCE_WINDOW_SYSTEM\t= 0x8247;\ngl.DEBUG_TYPE_DEPRECATED_BEHAVIOR\t= 0x824d;\ngl.DEBUG_TYPE_ERROR\t= 0x824c;\ngl.DEBUG_TYPE_MARKER\t= 0x8268;\ngl.DEBUG_TYPE_OTHER\t= 0x8251;\ngl.DEBUG_TYPE_PERFORMANCE\t= 0x8250;\ngl.DEBUG_TYPE_POP_GROUP\t= 0x826a;\ngl.DEBUG_TYPE_PORTABILITY\t= 0x824f;\ngl.DEBUG_TYPE_PUSH_GROUP\t= 0x8269;\ngl.DEBUG_TYPE_UNDEFINED_BEHAVIOR\t= 0x824e;\ngl.DECR\t= 0x1e03;\ngl.DECR_WRAP\t= 0x8508;\ngl.DELETE_STATUS\t= 0x8b80;\ngl.DEPTH24_STENCIL8_OES\t= 0x88f0;\ngl.DEPTH_ATTACHMENT\t= 0x8d00;\ngl.DEPTH_BITS\t= 0xd56;\ngl.DEPTH_BUFFER_BIT\t= 0x100;\ngl.DEPTH_BUFFER_BIT0_QCOM\t= 0x100;\ngl.DEPTH_BUFFER_BIT1_QCOM\t= 0x200;\ngl.DEPTH_BUFFER_BIT2_QCOM\t= 0x400;\ngl.DEPTH_BUFFER_BIT3_QCOM\t= 0x800;\ngl.DEPTH_BUFFER_BIT4_QCOM\t= 0x1000;\ngl.DEPTH_BUFFER_BIT5_QCOM\t= 0x2000;\ngl.DEPTH_BUFFER_BIT6_QCOM\t= 0x4000;\ngl.DEPTH_BUFFER_BIT7_QCOM\t= 0x8000;\ngl.DEPTH_CLEAR_VALUE\t= 0xb73;\ngl.DEPTH_COMPONENT\t= 0x1902;\ngl.DEPTH_COMPONENT16\t= 0x81a5;\ngl.DEPTH_COMPONENT16_NONLINEAR_NV\t= 0x8e2c;\ngl.DEPTH_COMPONENT16_OES\t= 0x81a5;\ngl.DEPTH_COMPONENT24_OES\t= 0x81a6;\ngl.DEPTH_COMPONENT32_OES\t= 0x81a7;\ngl.DEPTH_EXT\t= 0x1801;\ngl.DEPTH_FUNC\t= 0xb74;\ngl.DEPTH_RANGE\t= 0xb70;\ngl.DEPTH_STENCIL_OES\t= 0x84f9;\ngl.DEPTH_TEST\t= 0xb71;\ngl.DEPTH_WRITEMASK\t= 0xb72;\ngl.DITHER\t= 0xbd0;\ngl.DMP_shader_binary\t= 0x1;\ngl.DONT_CARE\t= 0x1100;\ngl.DRAW_BUFFER0_NV\t= 0x8825;\ngl.DRAW_BUFFER10_NV\t= 0x882f;\ngl.DRAW_BUFFER11_NV\t= 0x8830;\ngl.DRAW_BUFFER12_NV\t= 0x8831;\ngl.DRAW_BUFFER13_NV\t= 0x8832;\ngl.DRAW_BUFFER14_NV\t= 0x8833;\ngl.DRAW_BUFFER15_NV\t= 0x8834;\ngl.DRAW_BUFFER1_NV\t= 0x8826;\ngl.DRAW_BUFFER2_NV\t= 0x8827;\ngl.DRAW_BUFFER3_NV\t= 0x8828;\ngl.DRAW_BUFFER4_NV\t= 0x8829;\ngl.DRAW_BUFFER5_NV\t= 0x882a;\ngl.DRAW_BUFFER6_NV\t= 0x882b;\ngl.DRAW_BUFFER7_NV\t= 0x882c;\ngl.DRAW_BUFFER8_NV\t= 0x882d;\ngl.DRAW_BUFFER9_NV\t= 0x882e;\ngl.DRAW_BUFFER_EXT\t= 0xc01;\ngl.DRAW_FRAMEBUFFER_ANGLE\t= 0x8ca9;\ngl.DRAW_FRAMEBUFFER_APPLE\t= 0x8ca9;\ngl.DRAW_FRAMEBUFFER_BINDING_ANGLE\t= 0x8ca6;\ngl.DRAW_FRAMEBUFFER_BINDING_APPLE\t= 0x8ca6;\ngl.DRAW_FRAMEBUFFER_BINDING_NV\t= 0x8ca6;\ngl.DRAW_FRAMEBUFFER_NV\t= 0x8ca9;\ngl.DST_ALPHA\t= 0x304;\ngl.DST_COLOR\t= 0x306;\ngl.DYNAMIC_DRAW\t= 0x88e8;\ngl.ELEMENT_ARRAY_BUFFER\t= 0x8893;\ngl.ELEMENT_ARRAY_BUFFER_BINDING\t= 0x8895;\ngl.EQUAL\t= 0x202;\ngl.ES_VERSION_2_0\t= 0x1;\ngl.ETC1_RGB8_OES\t= 0x8d64;\ngl.ETC1_SRGB8_NV\t= 0x88ee;\ngl.EXTENSIONS\t= 0x1f03;\ngl.EXT_blend_minmax\t= 0x1;\ngl.EXT_color_buffer_half_float\t= 0x1;\ngl.EXT_debug_label\t= 0x1;\ngl.EXT_debug_marker\t= 0x1;\ngl.EXT_discard_framebuffer\t= 0x1;\ngl.EXT_map_buffer_range\t= 0x1;\ngl.EXT_multi_draw_arrays\t= 0x1;\ngl.EXT_multisampled_render_to_texture\t= 0x1;\ngl.EXT_multiview_draw_buffers\t= 0x1;\ngl.EXT_occlusion_query_boolean\t= 0x1;\ngl.EXT_read_format_bgra\t= 0x1;\ngl.EXT_robustness\t= 0x1;\ngl.EXT_sRGB\t= 0x1;\ngl.EXT_separate_shader_objects\t= 0x1;\ngl.EXT_shader_framebuffer_fetch\t= 0x1;\ngl.EXT_shader_texture_lod\t= 0x1;\ngl.EXT_shadow_samplers\t= 0x1;\ngl.EXT_texture_compression_dxt1\t= 0x1;\ngl.EXT_texture_filter_anisotropic\t= 0x1;\ngl.EXT_texture_format_BGRA8888\t= 0x1;\ngl.EXT_texture_rg\t= 0x1;\ngl.EXT_texture_storage\t= 0x1;\ngl.EXT_texture_type_2_10_10_10_REV\t= 0x1;\ngl.EXT_unpack_subimage\t= 0x1;\ngl.FALSE\t= 0x0;\ngl.FASTEST\t= 0x1101;\ngl.FENCE_CONDITION_NV\t= 0x84f4;\ngl.FENCE_STATUS_NV\t= 0x84f3;\ngl.FIXED\t= 0x140c;\ngl.FJ_shader_binary_GCCSO\t= 0x1;\ngl.FLOAT\t= 0x1406;\ngl.FLOAT_MAT2\t= 0x8b5a;\ngl.FLOAT_MAT3\t= 0x8b5b;\ngl.FLOAT_MAT4\t= 0x8b5c;\ngl.FLOAT_VEC2\t= 0x8b50;\ngl.FLOAT_VEC3\t= 0x8b51;\ngl.FLOAT_VEC4\t= 0x8b52;\ngl.FRAGMENT_SHADER\t= 0x8b30;\ngl.FRAGMENT_SHADER_BIT_EXT\t= 0x2;\ngl.FRAGMENT_SHADER_DERIVATIVE_HINT_OES\t= 0x8b8b;\ngl.FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT\t= 0x8a52;\ngl.FRAMEBUFFER\t= 0x8d40;\ngl.FRAMEBUFFER_ATTACHMENT_ANGLE\t= 0x93a3;\ngl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT\t= 0x8210;\ngl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT\t= 0x8211;\ngl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\t= 0x8cd1;\ngl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\t= 0x8cd0;\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES\t= 0x8cd4;\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\t= 0x8cd3;\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\t= 0x8cd2;\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT\t= 0x8d6c;\ngl.FRAMEBUFFER_BINDING\t= 0x8ca6;\ngl.FRAMEBUFFER_COMPLETE\t= 0x8cd5;\ngl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT\t= 0x8cd6;\ngl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS\t= 0x8cd9;\ngl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\t= 0x8cd7;\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE\t= 0x8d56;\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE\t= 0x8d56;\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\t= 0x8d56;\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG\t= 0x9134;\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV\t= 0x8d56;\ngl.FRAMEBUFFER_UNDEFINED_OES\t= 0x8219;\ngl.FRAMEBUFFER_UNSUPPORTED\t= 0x8cdd;\ngl.FRONT\t= 0x404;\ngl.FRONT_AND_BACK\t= 0x408;\ngl.FRONT_FACE\t= 0xb46;\ngl.FUNC_ADD\t= 0x8006;\ngl.FUNC_REVERSE_SUBTRACT\t= 0x800b;\ngl.FUNC_SUBTRACT\t= 0x800a;\ngl.GENERATE_MIPMAP_HINT\t= 0x8192;\ngl.GEQUAL\t= 0x206;\ngl.GPU_OPTIMIZED_QCOM\t= 0x8fb2;\ngl.GREATER\t= 0x204;\ngl.GREEN_BITS\t= 0xd53;\ngl.GUILTY_CONTEXT_RESET_EXT\t= 0x8253;\ngl.HALF_FLOAT_OES\t= 0x8d61;\ngl.HIGH_FLOAT\t= 0x8df2;\ngl.HIGH_INT\t= 0x8df5;\ngl.IMG_multisampled_render_to_texture\t= 0x1;\ngl.IMG_program_binary\t= 0x1;\ngl.IMG_read_format\t= 0x1;\ngl.IMG_shader_binary\t= 0x1;\ngl.IMG_texture_compression_pvrtc\t= 0x1;\ngl.IMG_texture_compression_pvrtc2\t= 0x1;\ngl.IMPLEMENTATION_COLOR_READ_FORMAT\t= 0x8b9b;\ngl.IMPLEMENTATION_COLOR_READ_TYPE\t= 0x8b9a;\ngl.INCR\t= 0x1e02;\ngl.INCR_WRAP\t= 0x8507;\ngl.INFO_LOG_LENGTH\t= 0x8b84;\ngl.INNOCENT_CONTEXT_RESET_EXT\t= 0x8254;\ngl.INT\t= 0x1404;\ngl.INT_10_10_10_2_OES\t= 0x8df7;\ngl.INT_VEC2\t= 0x8b53;\ngl.INT_VEC3\t= 0x8b54;\ngl.INT_VEC4\t= 0x8b55;\ngl.INVALID_ENUM\t= 0x500;\ngl.INVALID_FRAMEBUFFER_OPERATION\t= 0x506;\ngl.INVALID_OPERATION\t= 0x502;\ngl.INVALID_VALUE\t= 0x501;\ngl.INVERT\t= 0x150a;\ngl.KEEP\t= 0x1e00;\ngl.KHR_debug\t= 0x1;\ngl.KHR_texture_compression_astc_ldr\t= 0x1;\ngl.LEQUAL\t= 0x203;\ngl.LESS\t= 0x201;\ngl.LINEAR\t= 0x2601;\ngl.LINEAR_MIPMAP_LINEAR\t= 0x2703;\ngl.LINEAR_MIPMAP_NEAREST\t= 0x2701;\ngl.LINES\t= 0x1;\ngl.LINE_LOOP\t= 0x2;\ngl.LINE_STRIP\t= 0x3;\ngl.LINE_WIDTH\t= 0xb21;\ngl.LINK_STATUS\t= 0x8b82;\ngl.LOSE_CONTEXT_ON_RESET_EXT\t= 0x8252;\ngl.LOW_FLOAT\t= 0x8df0;\ngl.LOW_INT\t= 0x8df3;\ngl.LUMINANCE\t= 0x1909;\ngl.LUMINANCE16F_EXT\t= 0x881e;\ngl.LUMINANCE32F_EXT\t= 0x8818;\ngl.LUMINANCE4_ALPHA4_OES\t= 0x8043;\ngl.LUMINANCE8_ALPHA8_EXT\t= 0x8045;\ngl.LUMINANCE8_ALPHA8_OES\t= 0x8045;\ngl.LUMINANCE8_EXT\t= 0x8040;\ngl.LUMINANCE8_OES\t= 0x8040;\ngl.LUMINANCE_ALPHA\t= 0x190a;\ngl.LUMINANCE_ALPHA16F_EXT\t= 0x881f;\ngl.LUMINANCE_ALPHA32F_EXT\t= 0x8819;\ngl.MALI_PROGRAM_BINARY_ARM\t= 0x8f61;\ngl.MALI_SHADER_BINARY_ARM\t= 0x8f60;\ngl.MAP_FLUSH_EXPLICIT_BIT_EXT\t= 0x10;\ngl.MAP_INVALIDATE_BUFFER_BIT_EXT\t= 0x8;\ngl.MAP_INVALIDATE_RANGE_BIT_EXT\t= 0x4;\ngl.MAP_READ_BIT_EXT\t= 0x1;\ngl.MAP_UNSYNCHRONIZED_BIT_EXT\t= 0x20;\ngl.MAP_WRITE_BIT_EXT\t= 0x2;\ngl.MAX_3D_TEXTURE_SIZE_OES\t= 0x8073;\ngl.MAX_COLOR_ATTACHMENTS_NV\t= 0x8cdf;\ngl.MAX_COMBINED_TEXTURE_IMAGE_UNITS\t= 0x8b4d;\ngl.MAX_CUBE_MAP_TEXTURE_SIZE\t= 0x851c;\ngl.MAX_DEBUG_GROUP_STACK_DEPTH\t= 0x826c;\ngl.MAX_DEBUG_LOGGED_MESSAGES\t= 0x9144;\ngl.MAX_DEBUG_MESSAGE_LENGTH\t= 0x9143;\ngl.MAX_DRAW_BUFFERS_NV\t= 0x8824;\ngl.MAX_EXT\t= 0x8008;\ngl.MAX_FRAGMENT_UNIFORM_VECTORS\t= 0x8dfd;\ngl.MAX_LABEL_LENGTH\t= 0x82e8;\ngl.MAX_MULTIVIEW_BUFFERS_EXT\t= 0x90f2;\ngl.MAX_RENDERBUFFER_SIZE\t= 0x84e8;\ngl.MAX_SAMPLES_ANGLE\t= 0x8d57;\ngl.MAX_SAMPLES_APPLE\t= 0x8d57;\ngl.MAX_SAMPLES_EXT\t= 0x8d57;\ngl.MAX_SAMPLES_IMG\t= 0x9135;\ngl.MAX_SAMPLES_NV\t= 0x8d57;\ngl.MAX_SERVER_WAIT_TIMEOUT_APPLE\t= 0x9111;\ngl.MAX_TEXTURE_IMAGE_UNITS\t= 0x8872;\ngl.MAX_TEXTURE_MAX_ANISOTROPY_EXT\t= 0x84ff;\ngl.MAX_TEXTURE_SIZE\t= 0xd33;\ngl.MAX_VARYING_VECTORS\t= 0x8dfc;\ngl.MAX_VERTEX_ATTRIBS\t= 0x8869;\ngl.MAX_VERTEX_TEXTURE_IMAGE_UNITS\t= 0x8b4c;\ngl.MAX_VERTEX_UNIFORM_VECTORS\t= 0x8dfb;\ngl.MAX_VIEWPORT_DIMS\t= 0xd3a;\ngl.MEDIUM_FLOAT\t= 0x8df1;\ngl.MEDIUM_INT\t= 0x8df4;\ngl.MIN_EXT\t= 0x8007;\ngl.MIRRORED_REPEAT\t= 0x8370;\ngl.MULTISAMPLE_BUFFER_BIT0_QCOM\t= 0x1000000;\ngl.MULTISAMPLE_BUFFER_BIT1_QCOM\t= 0x2000000;\ngl.MULTISAMPLE_BUFFER_BIT2_QCOM\t= 0x4000000;\ngl.MULTISAMPLE_BUFFER_BIT3_QCOM\t= 0x8000000;\ngl.MULTISAMPLE_BUFFER_BIT4_QCOM\t= 0x10000000;\ngl.MULTISAMPLE_BUFFER_BIT5_QCOM\t= 0x20000000;\ngl.MULTISAMPLE_BUFFER_BIT6_QCOM\t= 0x40000000;\ngl.MULTISAMPLE_BUFFER_BIT7_QCOM\t= 0x80000000;\ngl.MULTIVIEW_EXT\t= 0x90f1;\ngl.NEAREST\t= 0x2600;\ngl.NEAREST_MIPMAP_LINEAR\t= 0x2702;\ngl.NEAREST_MIPMAP_NEAREST\t= 0x2700;\ngl.NEVER\t= 0x200;\ngl.NICEST\t= 0x1102;\ngl.NONE\t= 0x0;\ngl.NOTEQUAL\t= 0x205;\ngl.NO_ERROR\t= 0x0;\ngl.NO_RESET_NOTIFICATION_EXT\t= 0x8261;\ngl.NUM_COMPRESSED_TEXTURE_FORMATS\t= 0x86a2;\ngl.NUM_PROGRAM_BINARY_FORMATS_OES\t= 0x87fe;\ngl.NUM_SHADER_BINARY_FORMATS\t= 0x8df9;\ngl.NV_coverage_sample\t= 0x1;\ngl.NV_depth_nonlinear\t= 0x1;\ngl.NV_draw_buffers\t= 0x1;\ngl.NV_draw_instanced\t= 0x1;\ngl.NV_fbo_color_attachments\t= 0x1;\ngl.NV_fence\t= 0x1;\ngl.NV_framebuffer_blit\t= 0x1;\ngl.NV_framebuffer_multisample\t= 0x1;\ngl.NV_generate_mipmap_sRGB\t= 0x1;\ngl.NV_instanced_arrays\t= 0x1;\ngl.NV_read_buffer\t= 0x1;\ngl.NV_read_buffer_front\t= 0x1;\ngl.NV_read_depth\t= 0x1;\ngl.NV_read_depth_stencil\t= 0x1;\ngl.NV_read_stencil\t= 0x1;\ngl.NV_sRGB_formats\t= 0x1;\ngl.NV_shadow_samplers_array\t= 0x1;\ngl.NV_shadow_samplers_cube\t= 0x1;\ngl.NV_texture_border_clamp\t= 0x1;\ngl.NV_texture_compression_s3tc_update\t= 0x1;\ngl.NV_texture_npot_2D_mipmap\t= 0x1;\ngl.OBJECT_TYPE_APPLE\t= 0x9112;\ngl.OES_EGL_image\t= 0x1;\ngl.OES_EGL_image_external\t= 0x1;\ngl.OES_compressed_ETC1_RGB8_texture\t= 0x1;\ngl.OES_compressed_paletted_texture\t= 0x1;\ngl.OES_depth24\t= 0x1;\ngl.OES_depth32\t= 0x1;\ngl.OES_depth_texture\t= 0x1;\ngl.OES_element_index_uint\t= 0x1;\ngl.OES_fbo_render_mipmap\t= 0x1;\ngl.OES_fragment_precision_high\t= 0x1;\ngl.OES_get_program_binary\t= 0x1;\ngl.OES_mapbuffer\t= 0x1;\ngl.OES_packed_depth_stencil\t= 0x1;\ngl.OES_required_internalformat\t= 0x1;\ngl.OES_rgb8_rgba8\t= 0x1;\ngl.OES_standard_derivatives\t= 0x1;\ngl.OES_stencil1\t= 0x1;\ngl.OES_stencil4\t= 0x1;\ngl.OES_surfaceless_context\t= 0x1;\ngl.OES_texture_3D\t= 0x1;\ngl.OES_texture_float\t= 0x1;\ngl.OES_texture_float_linear\t= 0x1;\ngl.OES_texture_half_float\t= 0x1;\ngl.OES_texture_half_float_linear\t= 0x1;\ngl.OES_texture_npot\t= 0x1;\ngl.OES_vertex_array_object\t= 0x1;\ngl.OES_vertex_half_float\t= 0x1;\ngl.OES_vertex_type_10_10_10_2\t= 0x1;\ngl.ONE\t= 0x1;\ngl.ONE_MINUS_CONSTANT_ALPHA\t= 0x8004;\ngl.ONE_MINUS_CONSTANT_COLOR\t= 0x8002;\ngl.ONE_MINUS_DST_ALPHA\t= 0x305;\ngl.ONE_MINUS_DST_COLOR\t= 0x307;\ngl.ONE_MINUS_SRC_ALPHA\t= 0x303;\ngl.ONE_MINUS_SRC_COLOR\t= 0x301;\ngl.OUT_OF_MEMORY\t= 0x505;\ngl.PACK_ALIGNMENT\t= 0xd05;\ngl.PACK_REVERSE_ROW_ORDER_ANGLE\t= 0x93a4;\ngl.PALETTE4_R5_G6_B5_OES\t= 0x8b92;\ngl.PALETTE4_RGB5_A1_OES\t= 0x8b94;\ngl.PALETTE4_RGB8_OES\t= 0x8b90;\ngl.PALETTE4_RGBA4_OES\t= 0x8b93;\ngl.PALETTE4_RGBA8_OES\t= 0x8b91;\ngl.PALETTE8_R5_G6_B5_OES\t= 0x8b97;\ngl.PALETTE8_RGB5_A1_OES\t= 0x8b99;\ngl.PALETTE8_RGB8_OES\t= 0x8b95;\ngl.PALETTE8_RGBA4_OES\t= 0x8b98;\ngl.PALETTE8_RGBA8_OES\t= 0x8b96;\ngl.PERCENTAGE_AMD\t= 0x8bc3;\ngl.PERFMON_GLOBAL_MODE_QCOM\t= 0x8fa0;\ngl.PERFMON_RESULT_AMD\t= 0x8bc6;\ngl.PERFMON_RESULT_AVAILABLE_AMD\t= 0x8bc4;\ngl.PERFMON_RESULT_SIZE_AMD\t= 0x8bc5;\ngl.POINTS\t= 0x0;\ngl.POLYGON_OFFSET_FACTOR\t= 0x8038;\ngl.POLYGON_OFFSET_FILL\t= 0x8037;\ngl.POLYGON_OFFSET_UNITS\t= 0x2a00;\ngl.PROGRAM\t= 0x82e2;\ngl.PROGRAM_BINARY_ANGLE\t= 0x93a6;\ngl.PROGRAM_BINARY_FORMATS_OES\t= 0x87ff;\ngl.PROGRAM_BINARY_LENGTH_OES\t= 0x8741;\ngl.PROGRAM_OBJECT_EXT\t= 0x8b40;\ngl.PROGRAM_PIPELINE_BINDING_EXT\t= 0x825a;\ngl.PROGRAM_PIPELINE_OBJECT_EXT\t= 0x8a4f;\ngl.PROGRAM_SEPARABLE_EXT\t= 0x8258;\ngl.QCOM_alpha_test\t= 0x1;\ngl.QCOM_binning_control\t= 0x1;\ngl.QCOM_driver_control\t= 0x1;\ngl.QCOM_extended_get\t= 0x1;\ngl.QCOM_extended_get2\t= 0x1;\ngl.QCOM_perfmon_global_mode\t= 0x1;\ngl.QCOM_tiled_rendering\t= 0x1;\ngl.QCOM_writeonly_rendering\t= 0x1;\ngl.QUERY\t= 0x82e3;\ngl.QUERY_OBJECT_EXT\t= 0x9153;\ngl.QUERY_RESULT_AVAILABLE_EXT\t= 0x8867;\ngl.QUERY_RESULT_EXT\t= 0x8866;\ngl.R16F_EXT\t= 0x822d;\ngl.R32F_EXT\t= 0x822e;\ngl.R8_EXT\t= 0x8229;\ngl.READ_BUFFER_EXT\t= 0xc02;\ngl.READ_BUFFER_NV\t= 0xc02;\ngl.READ_FRAMEBUFFER_ANGLE\t= 0x8ca8;\ngl.READ_FRAMEBUFFER_APPLE\t= 0x8ca8;\ngl.READ_FRAMEBUFFER_BINDING_ANGLE\t= 0x8caa;\ngl.READ_FRAMEBUFFER_BINDING_APPLE\t= 0x8caa;\ngl.READ_FRAMEBUFFER_BINDING_NV\t= 0x8caa;\ngl.READ_FRAMEBUFFER_NV\t= 0x8ca8;\ngl.RED_BITS\t= 0xd52;\ngl.RED_EXT\t= 0x1903;\ngl.RENDERBUFFER\t= 0x8d41;\ngl.RENDERBUFFER_ALPHA_SIZE\t= 0x8d53;\ngl.RENDERBUFFER_BINDING\t= 0x8ca7;\ngl.RENDERBUFFER_BLUE_SIZE\t= 0x8d52;\ngl.RENDERBUFFER_DEPTH_SIZE\t= 0x8d54;\ngl.RENDERBUFFER_GREEN_SIZE\t= 0x8d51;\ngl.RENDERBUFFER_HEIGHT\t= 0x8d43;\ngl.RENDERBUFFER_INTERNAL_FORMAT\t= 0x8d44;\ngl.RENDERBUFFER_RED_SIZE\t= 0x8d50;\ngl.RENDERBUFFER_SAMPLES_ANGLE\t= 0x8cab;\ngl.RENDERBUFFER_SAMPLES_APPLE\t= 0x8cab;\ngl.RENDERBUFFER_SAMPLES_EXT\t= 0x8cab;\ngl.RENDERBUFFER_SAMPLES_IMG\t= 0x9133;\ngl.RENDERBUFFER_SAMPLES_NV\t= 0x8cab;\ngl.RENDERBUFFER_STENCIL_SIZE\t= 0x8d55;\ngl.RENDERBUFFER_WIDTH\t= 0x8d42;\ngl.RENDERER\t= 0x1f01;\ngl.RENDER_DIRECT_TO_FRAMEBUFFER_QCOM\t= 0x8fb3;\ngl.REPEAT\t= 0x2901;\ngl.REPLACE\t= 0x1e01;\ngl.REQUIRED_TEXTURE_IMAGE_UNITS_OES\t= 0x8d68;\ngl.RESET_NOTIFICATION_STRATEGY_EXT\t= 0x8256;\ngl.RG16F_EXT\t= 0x822f;\ngl.RG32F_EXT\t= 0x8230;\ngl.RG8_EXT\t= 0x822b;\ngl.RGB\t= 0x1907;\ngl.RGB10_A2_EXT\t= 0x8059;\ngl.RGB10_EXT\t= 0x8052;\ngl.RGB16F_EXT\t= 0x881b;\ngl.RGB32F_EXT\t= 0x8815;\ngl.RGB565\t= 0x8d62;\ngl.RGB565_OES\t= 0x8d62;\ngl.RGB5_A1\t= 0x8057;\ngl.RGB5_A1_OES\t= 0x8057;\ngl.RGB8_OES\t= 0x8051;\ngl.RGBA\t= 0x1908;\ngl.RGBA16F_EXT\t= 0x881a;\ngl.RGBA32F_EXT\t= 0x8814;\ngl.RGBA4\t= 0x8056;\ngl.RGBA4_OES\t= 0x8056;\ngl.RGBA8_OES\t= 0x8058;\ngl.RGB_422_APPLE\t= 0x8a1f;\ngl.RG_EXT\t= 0x8227;\ngl.SAMPLER\t= 0x82e6;\ngl.SAMPLER_2D\t= 0x8b5e;\ngl.SAMPLER_2D_ARRAY_SHADOW_NV\t= 0x8dc4;\ngl.SAMPLER_2D_SHADOW_EXT\t= 0x8b62;\ngl.SAMPLER_3D_OES\t= 0x8b5f;\ngl.SAMPLER_CUBE\t= 0x8b60;\ngl.SAMPLER_CUBE_SHADOW_NV\t= 0x8dc5;\ngl.SAMPLER_EXTERNAL_OES\t= 0x8d66;\ngl.SAMPLES\t= 0x80a9;\ngl.SAMPLE_ALPHA_TO_COVERAGE\t= 0x809e;\ngl.SAMPLE_BUFFERS\t= 0x80a8;\ngl.SAMPLE_COVERAGE\t= 0x80a0;\ngl.SAMPLE_COVERAGE_INVERT\t= 0x80ab;\ngl.SAMPLE_COVERAGE_VALUE\t= 0x80aa;\ngl.SCISSOR_BOX\t= 0xc10;\ngl.SCISSOR_TEST\t= 0xc11;\ngl.SGX_BINARY_IMG\t= 0x8c0a;\ngl.SGX_PROGRAM_BINARY_IMG\t= 0x9130;\ngl.SHADER\t= 0x82e1;\ngl.SHADER_BINARY_DMP\t= 0x9250;\ngl.SHADER_BINARY_FORMATS\t= 0x8df8;\ngl.SHADER_BINARY_VIV\t= 0x8fc4;\ngl.SHADER_COMPILER\t= 0x8dfa;\ngl.SHADER_OBJECT_EXT\t= 0x8b48;\ngl.SHADER_SOURCE_LENGTH\t= 0x8b88;\ngl.SHADER_TYPE\t= 0x8b4f;\ngl.SHADING_LANGUAGE_VERSION\t= 0x8b8c;\ngl.SHORT\t= 0x1402;\ngl.SIGNALED_APPLE\t= 0x9119;\ngl.SLUMINANCE8_ALPHA8_NV\t= 0x8c45;\ngl.SLUMINANCE8_NV\t= 0x8c47;\ngl.SLUMINANCE_ALPHA_NV\t= 0x8c44;\ngl.SLUMINANCE_NV\t= 0x8c46;\ngl.SRC_ALPHA\t= 0x302;\ngl.SRC_ALPHA_SATURATE\t= 0x308;\ngl.SRC_COLOR\t= 0x300;\ngl.SRGB8_ALPHA8_EXT\t= 0x8c43;\ngl.SRGB8_NV\t= 0x8c41;\ngl.SRGB_ALPHA_EXT\t= 0x8c42;\ngl.SRGB_EXT\t= 0x8c40;\ngl.STACK_OVERFLOW\t= 0x503;\ngl.STACK_UNDERFLOW\t= 0x504;\ngl.STATE_RESTORE\t= 0x8bdc;\ngl.STATIC_DRAW\t= 0x88e4;\ngl.STENCIL_ATTACHMENT\t= 0x8d20;\ngl.STENCIL_BACK_FAIL\t= 0x8801;\ngl.STENCIL_BACK_FUNC\t= 0x8800;\ngl.STENCIL_BACK_PASS_DEPTH_FAIL\t= 0x8802;\ngl.STENCIL_BACK_PASS_DEPTH_PASS\t= 0x8803;\ngl.STENCIL_BACK_REF\t= 0x8ca3;\ngl.STENCIL_BACK_VALUE_MASK\t= 0x8ca4;\ngl.STENCIL_BACK_WRITEMASK\t= 0x8ca5;\ngl.STENCIL_BITS\t= 0xd57;\ngl.STENCIL_BUFFER_BIT\t= 0x400;\ngl.STENCIL_BUFFER_BIT0_QCOM\t= 0x10000;\ngl.STENCIL_BUFFER_BIT1_QCOM\t= 0x20000;\ngl.STENCIL_BUFFER_BIT2_QCOM\t= 0x40000;\ngl.STENCIL_BUFFER_BIT3_QCOM\t= 0x80000;\ngl.STENCIL_BUFFER_BIT4_QCOM\t= 0x100000;\ngl.STENCIL_BUFFER_BIT5_QCOM\t= 0x200000;\ngl.STENCIL_BUFFER_BIT6_QCOM\t= 0x400000;\ngl.STENCIL_BUFFER_BIT7_QCOM\t= 0x800000;\ngl.STENCIL_CLEAR_VALUE\t= 0xb91;\ngl.STENCIL_EXT\t= 0x1802;\ngl.STENCIL_FAIL\t= 0xb94;\ngl.STENCIL_FUNC\t= 0xb92;\ngl.STENCIL_INDEX1_OES\t= 0x8d46;\ngl.STENCIL_INDEX4_OES\t= 0x8d47;\ngl.STENCIL_INDEX8\t= 0x8d48;\ngl.STENCIL_PASS_DEPTH_FAIL\t= 0xb95;\ngl.STENCIL_PASS_DEPTH_PASS\t= 0xb96;\ngl.STENCIL_REF\t= 0xb97;\ngl.STENCIL_TEST\t= 0xb90;\ngl.STENCIL_VALUE_MASK\t= 0xb93;\ngl.STENCIL_WRITEMASK\t= 0xb98;\ngl.STREAM_DRAW\t= 0x88e0;\ngl.SUBPIXEL_BITS\t= 0xd50;\ngl.SYNC_CONDITION_APPLE\t= 0x9113;\ngl.SYNC_FENCE_APPLE\t= 0x9116;\ngl.SYNC_FLAGS_APPLE\t= 0x9115;\ngl.SYNC_FLUSH_COMMANDS_BIT_APPLE\t= 0x1;\ngl.SYNC_GPU_COMMANDS_COMPLETE_APPLE\t= 0x9117;\ngl.SYNC_OBJECT_APPLE\t= 0x8a53;\ngl.SYNC_STATUS_APPLE\t= 0x9114;\ngl.TEXTURE\t= 0x1702;\ngl.TEXTURE0\t= 0x84c0;\ngl.TEXTURE1\t= 0x84c1;\ngl.TEXTURE10\t= 0x84ca;\ngl.TEXTURE11\t= 0x84cb;\ngl.TEXTURE12\t= 0x84cc;\ngl.TEXTURE13\t= 0x84cd;\ngl.TEXTURE14\t= 0x84ce;\ngl.TEXTURE15\t= 0x84cf;\ngl.TEXTURE16\t= 0x84d0;\ngl.TEXTURE17\t= 0x84d1;\ngl.TEXTURE18\t= 0x84d2;\ngl.TEXTURE19\t= 0x84d3;\ngl.TEXTURE2\t= 0x84c2;\ngl.TEXTURE20\t= 0x84d4;\ngl.TEXTURE21\t= 0x84d5;\ngl.TEXTURE22\t= 0x84d6;\ngl.TEXTURE23\t= 0x84d7;\ngl.TEXTURE24\t= 0x84d8;\ngl.TEXTURE25\t= 0x84d9;\ngl.TEXTURE26\t= 0x84da;\ngl.TEXTURE27\t= 0x84db;\ngl.TEXTURE28\t= 0x84dc;\ngl.TEXTURE29\t= 0x84dd;\ngl.TEXTURE3\t= 0x84c3;\ngl.TEXTURE30\t= 0x84de;\ngl.TEXTURE31\t= 0x84df;\ngl.TEXTURE4\t= 0x84c4;\ngl.TEXTURE5\t= 0x84c5;\ngl.TEXTURE6\t= 0x84c6;\ngl.TEXTURE7\t= 0x84c7;\ngl.TEXTURE8\t= 0x84c8;\ngl.TEXTURE9\t= 0x84c9;\ngl.TEXTURE_2D\t= 0xde1;\ngl.TEXTURE_3D_OES\t= 0x806f;\ngl.TEXTURE_BINDING_2D\t= 0x8069;\ngl.TEXTURE_BINDING_3D_OES\t= 0x806a;\ngl.TEXTURE_BINDING_CUBE_MAP\t= 0x8514;\ngl.TEXTURE_BINDING_EXTERNAL_OES\t= 0x8d67;\ngl.TEXTURE_BORDER_COLOR_NV\t= 0x1004;\ngl.TEXTURE_COMPARE_FUNC_EXT\t= 0x884d;\ngl.TEXTURE_COMPARE_MODE_EXT\t= 0x884c;\ngl.TEXTURE_CUBE_MAP\t= 0x8513;\ngl.TEXTURE_CUBE_MAP_NEGATIVE_X\t= 0x8516;\ngl.TEXTURE_CUBE_MAP_NEGATIVE_Y\t= 0x8518;\ngl.TEXTURE_CUBE_MAP_NEGATIVE_Z\t= 0x851a;\ngl.TEXTURE_CUBE_MAP_POSITIVE_X\t= 0x8515;\ngl.TEXTURE_CUBE_MAP_POSITIVE_Y\t= 0x8517;\ngl.TEXTURE_CUBE_MAP_POSITIVE_Z\t= 0x8519;\ngl.TEXTURE_DEPTH_QCOM\t= 0x8bd4;\ngl.TEXTURE_EXTERNAL_OES\t= 0x8d65;\ngl.TEXTURE_FORMAT_QCOM\t= 0x8bd6;\ngl.TEXTURE_HEIGHT_QCOM\t= 0x8bd3;\ngl.TEXTURE_IMAGE_VALID_QCOM\t= 0x8bd8;\ngl.TEXTURE_IMMUTABLE_FORMAT_EXT\t= 0x912f;\ngl.TEXTURE_INTERNAL_FORMAT_QCOM\t= 0x8bd5;\ngl.TEXTURE_MAG_FILTER\t= 0x2800;\ngl.TEXTURE_MAX_ANISOTROPY_EXT\t= 0x84fe;\ngl.TEXTURE_MAX_LEVEL_APPLE\t= 0x813d;\ngl.TEXTURE_MIN_FILTER\t= 0x2801;\ngl.TEXTURE_NUM_LEVELS_QCOM\t= 0x8bd9;\ngl.TEXTURE_OBJECT_VALID_QCOM\t= 0x8bdb;\ngl.TEXTURE_SAMPLES_IMG\t= 0x9136;\ngl.TEXTURE_TARGET_QCOM\t= 0x8bda;\ngl.TEXTURE_TYPE_QCOM\t= 0x8bd7;\ngl.TEXTURE_USAGE_ANGLE\t= 0x93a2;\ngl.TEXTURE_WIDTH_QCOM\t= 0x8bd2;\ngl.TEXTURE_WRAP_R_OES\t= 0x8072;\ngl.TEXTURE_WRAP_S\t= 0x2802;\ngl.TEXTURE_WRAP_T\t= 0x2803;\ngl.TIMEOUT_EXPIRED_APPLE\t= 0x911b;\ngl.TIMEOUT_IGNORED_APPLE\t= 0xffffffffffffffff;\ngl.TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE\t= 0x93a0;\ngl.TRIANGLES\t= 0x4;\ngl.TRIANGLE_FAN\t= 0x6;\ngl.TRIANGLE_STRIP\t= 0x5;\ngl.TRUE\t= 0x1;\ngl.UNKNOWN_CONTEXT_RESET_EXT\t= 0x8255;\ngl.UNPACK_ALIGNMENT\t= 0xcf5;\ngl.UNPACK_ROW_LENGTH\t= 0xcf2;\ngl.UNPACK_SKIP_PIXELS\t= 0xcf4;\ngl.UNPACK_SKIP_ROWS\t= 0xcf3;\ngl.UNSIGNALED_APPLE\t= 0x9118;\ngl.UNSIGNED_BYTE\t= 0x1401;\ngl.UNSIGNED_INT\t= 0x1405;\ngl.UNSIGNED_INT64_AMD\t= 0x8bc2;\ngl.UNSIGNED_INT_10_10_10_2_OES\t= 0x8df6;\ngl.UNSIGNED_INT_24_8_OES\t= 0x84fa;\ngl.UNSIGNED_INT_2_10_10_10_REV_EXT\t= 0x8368;\ngl.UNSIGNED_NORMALIZED_EXT\t= 0x8c17;\ngl.UNSIGNED_SHORT\t= 0x1403;\ngl.UNSIGNED_SHORT_1_5_5_5_REV_EXT\t= 0x8366;\ngl.UNSIGNED_SHORT_4_4_4_4\t= 0x8033;\ngl.UNSIGNED_SHORT_4_4_4_4_REV_EXT\t= 0x8365;\ngl.UNSIGNED_SHORT_4_4_4_4_REV_IMG\t= 0x8365;\ngl.UNSIGNED_SHORT_5_5_5_1\t= 0x8034;\ngl.UNSIGNED_SHORT_5_6_5\t= 0x8363;\ngl.UNSIGNED_SHORT_8_8_APPLE\t= 0x85ba;\ngl.UNSIGNED_SHORT_8_8_REV_APPLE\t= 0x85bb;\ngl.VALIDATE_STATUS\t= 0x8b83;\ngl.VENDOR\t= 0x1f00;\ngl.VERSION\t= 0x1f02;\ngl.VERTEX_ARRAY_BINDING_OES\t= 0x85b5;\ngl.VERTEX_ARRAY_OBJECT_EXT\t= 0x9154;\ngl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\t= 0x889f;\ngl.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE\t= 0x88fe;\ngl.VERTEX_ATTRIB_ARRAY_DIVISOR_NV\t= 0x88fe;\ngl.VERTEX_ATTRIB_ARRAY_ENABLED\t= 0x8622;\ngl.VERTEX_ATTRIB_ARRAY_NORMALIZED\t= 0x886a;\ngl.VERTEX_ATTRIB_ARRAY_POINTER\t= 0x8645;\ngl.VERTEX_ATTRIB_ARRAY_SIZE\t= 0x8623;\ngl.VERTEX_ATTRIB_ARRAY_STRIDE\t= 0x8624;\ngl.VERTEX_ATTRIB_ARRAY_TYPE\t= 0x8625;\ngl.VERTEX_SHADER\t= 0x8b31;\ngl.VERTEX_SHADER_BIT_EXT\t= 0x1;\ngl.VIEWPORT\t= 0xba2;\ngl.VIV_shader_binary\t= 0x1;\ngl.WAIT_FAILED_APPLE\t= 0x911d;\ngl.WRITEONLY_RENDERING_QCOM\t= 0x8823;\ngl.WRITE_ONLY_OES\t= 0x88b9;\ngl.Z400_BINARY_AMD\t= 0x8740;\ngl.ZERO\t= 0x0;\n"
  },
  {
    "path": "cocos2d/cocos/scripting/javascript/script/jsb_sys.js",
    "content": "//\n// sys properties\n//\n\nvar sys = sys || {};\n\nObject.defineProperties(sys,\n{\n\t\"capabilities\" : {\n\t\tget : function(){\n\t\t\tvar capabilities = {\"opengl\":true};\n\t\t\tif( sys.platform == 'mobile' ) {\n\t\t\t\tcapabilities[\"accelerometer\"] = true;\n\t\t\t\tcapabilities[\"touches\"] = true;\n\t\t\t} else {\n\t\t\t\t// desktop\n\t\t\t\tcapabilities[\"keyboard\"] = true;\n\t\t\t\tcapabilities[\"mouse\"] = true;\n\t\t\t}\n\t\t\treturn capabilities;\n        },\n\t\tenumerable : true,\n\t\tconfigurable : true\n\t},\n\t\"os\" : {\n\t\tget : function(){\n            return __getOS();\n        },\n\t\tenumerable : true,\n\t\tconfigurable : true\n\t},\n\t\"platform\" : {\n\t\tget : function(){\n            return __getPlatform();\n        },\n\t\tenumerable : true,\n\t\tconfigurable : true\n\t},\n\t\"version\" : {\n\t\tget : function(){\n            return __getVersion();\n        },\n\t\tenumerable : true,\n\t\tconfigurable : true\n\t}\n\n});\n\n// Forces the garbage collector\nsys.garbageCollect = function() {\n\t__jsc__.garbageCollect();\n};\n\n// Dumps rooted objects\nsys.dumpRoot = function() {\n\t__jsc__.dumpRoot();\n};\n\n// restarts the JS VM\nsys.restartVM = function() {\n\t__restartVM();\n};"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/.cproject",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<?fileVersion 4.0.0?><cproject storage_type_id=\"org.eclipse.cdt.core.XmlProjectDescriptionStorage\">\n\t<storageModule moduleId=\"org.eclipse.cdt.core.settings\">\n\t\t<cconfiguration id=\"cdt.managedbuild.config.gnu.so.debug.1532040290\">\n\t\t\t<storageModule buildSystemId=\"org.eclipse.cdt.managedbuilder.core.configurationDataProvider\" id=\"cdt.managedbuild.config.gnu.so.debug.1532040290\" moduleId=\"org.eclipse.cdt.core.settings\" name=\"Debug\">\n\t\t\t\t<externalSettings>\n\t\t\t\t\t<externalSetting>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"includePath\" name=\"/liblua\"/>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"libraryPath\" name=\"/liblua/Debug\"/>\n\t\t\t\t\t\t<entry flags=\"RESOLVED\" kind=\"libraryFile\" name=\"lua\" srcPrefixMapping=\"\" srcRootPath=\"\"/>\n\t\t\t\t\t</externalSetting>\n\t\t\t\t</externalSettings>\n\t\t\t\t<extensions>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.ELF\" point=\"org.eclipse.cdt.core.BinaryParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GmakeErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.CWDLocator\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GCCErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GASErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GLDErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t</extensions>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"cdtBuildSystem\" version=\"4.0.0\">\n\t\t\t\t<configuration artifactExtension=\"so\" artifactName=\"lua\" buildArtefactType=\"org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" buildProperties=\"org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" cleanCommand=\"rm -rf\" description=\"\" id=\"cdt.managedbuild.config.gnu.so.debug.1532040290\" name=\"Debug\" parent=\"cdt.managedbuild.config.gnu.so.debug\">\n\t\t\t\t\t<folderInfo id=\"cdt.managedbuild.config.gnu.so.debug.1532040290.\" name=\"/\" resourcePath=\"\">\n\t\t\t\t\t\t<toolChain id=\"cdt.managedbuild.toolchain.gnu.so.debug.1519046072\" name=\"Linux GCC\" superClass=\"cdt.managedbuild.toolchain.gnu.so.debug\">\n\t\t\t\t\t\t\t<targetPlatform id=\"cdt.managedbuild.target.gnu.platform.so.debug.1984647451\" name=\"Debug Platform\" superClass=\"cdt.managedbuild.target.gnu.platform.so.debug\"/>\n\t\t\t\t\t\t\t<builder buildPath=\"${workspace_loc:/liblua/Debug}\" id=\"cdt.managedbuild.target.gnu.builder.so.debug.1340041275\" keepEnvironmentInBuildfile=\"false\" managedBuildOn=\"true\" name=\"Gnu Make Builder\" superClass=\"cdt.managedbuild.target.gnu.builder.so.debug\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.archiver.base.741414828\" name=\"GCC Archiver\" superClass=\"cdt.managedbuild.tool.gnu.archiver.base\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.1908142641\" name=\"GCC C++ Compiler\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.debug\">\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.debug.option.optimization.level.1343441140\" name=\"Optimization Level\" superClass=\"gnu.cpp.compiler.so.debug.option.optimization.level\" value=\"gnu.cpp.compiler.optimization.level.none\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.debug.option.debugging.level.786650861\" name=\"Debug Level\" superClass=\"gnu.cpp.compiler.so.debug.option.debugging.level\" value=\"gnu.cpp.compiler.debugging.level.max\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.include.paths.2120072997\" name=\"Include paths (-I)\" superClass=\"gnu.cpp.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.other.pic.1350367798\" name=\"Position Independent Code (-fPIC)\" superClass=\"gnu.cpp.compiler.option.other.pic\" value=\"false\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.compiler.input.2035513663\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.compiler.so.debug.2114277329\" name=\"GCC C Compiler\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.so.debug\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"gnu.c.optimization.level.none\" id=\"gnu.c.compiler.so.debug.option.optimization.level.1730464463\" name=\"Optimization Level\" superClass=\"gnu.c.compiler.so.debug.option.optimization.level\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.so.debug.option.debugging.level.1279425095\" name=\"Debug Level\" superClass=\"gnu.c.compiler.so.debug.option.debugging.level\" value=\"gnu.c.debugging.level.max\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.include.paths.956555346\" name=\"Include paths (-I)\" superClass=\"gnu.c.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.misc.pic.859593969\" name=\"Position Independent Code (-fPIC)\" superClass=\"gnu.c.compiler.option.misc.pic\" value=\"true\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.c.compiler.input.1259937486\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.linker.so.debug.709544732\" name=\"GCC C Linker\" superClass=\"cdt.managedbuild.tool.gnu.c.linker.so.debug\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.c.link.so.debug.option.shared.1270521703\" name=\"Shared (-shared)\" superClass=\"gnu.c.link.so.debug.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.linker.so.debug.1186320686\" name=\"GCC C++ Linker\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.so.debug\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.cpp.link.so.debug.option.shared.918465649\" name=\"Shared (-shared)\" superClass=\"gnu.cpp.link.so.debug.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.linker.input.418512401\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.input\">\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinputdependency\" paths=\"$(USER_OBJS)\"/>\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinput\" paths=\"$(LIBS)\"/>\n\t\t\t\t\t\t\t\t</inputType>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.assembler.so.debug.558088018\" name=\"GCC Assembler\" superClass=\"cdt.managedbuild.tool.gnu.assembler.so.debug\">\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.assembler.input.1707443272\" superClass=\"cdt.managedbuild.tool.gnu.assembler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t</toolChain>\n\t\t\t\t\t</folderInfo>\n\t\t\t\t\t<sourceEntries>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"sourcePath\" name=\"lua\"/>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"sourcePath\" name=\"tolua\"/>\n\t\t\t\t\t</sourceEntries>\n\t\t\t\t</configuration>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"org.eclipse.cdt.core.externalSettings\"/>\n\t\t</cconfiguration>\n\t\t<cconfiguration id=\"cdt.managedbuild.config.gnu.so.release.1209971451\">\n\t\t\t<storageModule buildSystemId=\"org.eclipse.cdt.managedbuilder.core.configurationDataProvider\" id=\"cdt.managedbuild.config.gnu.so.release.1209971451\" moduleId=\"org.eclipse.cdt.core.settings\" name=\"Release\">\n\t\t\t\t<externalSettings>\n\t\t\t\t\t<externalSetting>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"includePath\" name=\"/liblua\"/>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"libraryPath\" name=\"/liblua/Release\"/>\n\t\t\t\t\t\t<entry flags=\"RESOLVED\" kind=\"libraryFile\" name=\"lua\" srcPrefixMapping=\"\" srcRootPath=\"\"/>\n\t\t\t\t\t</externalSetting>\n\t\t\t\t</externalSettings>\n\t\t\t\t<extensions>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.ELF\" point=\"org.eclipse.cdt.core.BinaryParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GmakeErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.CWDLocator\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GCCErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GASErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GLDErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t</extensions>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"cdtBuildSystem\" version=\"4.0.0\">\n\t\t\t\t<configuration artifactExtension=\"so\" artifactName=\"lua\" buildArtefactType=\"org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" buildProperties=\"org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" cleanCommand=\"rm -rf\" description=\"\" id=\"cdt.managedbuild.config.gnu.so.release.1209971451\" name=\"Release\" parent=\"cdt.managedbuild.config.gnu.so.release\">\n\t\t\t\t\t<folderInfo id=\"cdt.managedbuild.config.gnu.so.release.1209971451.\" name=\"/\" resourcePath=\"\">\n\t\t\t\t\t\t<toolChain id=\"cdt.managedbuild.toolchain.gnu.so.release.638782967\" name=\"Linux GCC\" superClass=\"cdt.managedbuild.toolchain.gnu.so.release\">\n\t\t\t\t\t\t\t<targetPlatform id=\"cdt.managedbuild.target.gnu.platform.so.release.103979431\" name=\"Debug Platform\" superClass=\"cdt.managedbuild.target.gnu.platform.so.release\"/>\n\t\t\t\t\t\t\t<builder buildPath=\"${workspace_loc:/liblua/Release}\" id=\"cdt.managedbuild.target.gnu.builder.so.release.1582399077\" keepEnvironmentInBuildfile=\"false\" managedBuildOn=\"true\" name=\"Gnu Make Builder\" superClass=\"cdt.managedbuild.target.gnu.builder.so.release\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.archiver.base.320299117\" name=\"GCC Archiver\" superClass=\"cdt.managedbuild.tool.gnu.archiver.base\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.release.1495522959\" name=\"GCC C++ Compiler\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.release\">\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.release.option.optimization.level.979797207\" name=\"Optimization Level\" superClass=\"gnu.cpp.compiler.so.release.option.optimization.level\" value=\"gnu.cpp.compiler.optimization.level.most\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.release.option.debugging.level.1805098853\" name=\"Debug Level\" superClass=\"gnu.cpp.compiler.so.release.option.debugging.level\" value=\"gnu.cpp.compiler.debugging.level.none\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.include.paths.2100249291\" name=\"Include paths (-I)\" superClass=\"gnu.cpp.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.compiler.input.1022202619\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.compiler.so.release.472386122\" name=\"GCC C Compiler\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.so.release\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"gnu.c.optimization.level.most\" id=\"gnu.c.compiler.so.release.option.optimization.level.1883494761\" name=\"Optimization Level\" superClass=\"gnu.c.compiler.so.release.option.optimization.level\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.so.release.option.debugging.level.1071645760\" name=\"Debug Level\" superClass=\"gnu.c.compiler.so.release.option.debugging.level\" value=\"gnu.c.debugging.level.none\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.include.paths.1050038430\" name=\"Include paths (-I)\" superClass=\"gnu.c.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.c.compiler.input.1197021556\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.linker.so.release.1511578599\" name=\"GCC C Linker\" superClass=\"cdt.managedbuild.tool.gnu.c.linker.so.release\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.c.link.so.release.option.shared.1652437254\" name=\"Shared (-shared)\" superClass=\"gnu.c.link.so.release.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.linker.so.release.1230370002\" name=\"GCC C++ Linker\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.so.release\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.cpp.link.so.release.option.shared.517821764\" name=\"Shared (-shared)\" superClass=\"gnu.cpp.link.so.release.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.linker.input.267988943\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.input\">\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinputdependency\" paths=\"$(USER_OBJS)\"/>\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinput\" paths=\"$(LIBS)\"/>\n\t\t\t\t\t\t\t\t</inputType>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.assembler.so.release.1520626301\" name=\"GCC Assembler\" superClass=\"cdt.managedbuild.tool.gnu.assembler.so.release\">\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.assembler.input.1578760595\" superClass=\"cdt.managedbuild.tool.gnu.assembler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t</toolChain>\n\t\t\t\t\t</folderInfo>\n\t\t\t\t</configuration>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"org.eclipse.cdt.core.externalSettings\"/>\n\t\t</cconfiguration>\n\t\t<cconfiguration id=\"cdt.managedbuild.config.gnu.so.debug.1532040290.368963197\">\n\t\t\t<storageModule buildSystemId=\"org.eclipse.cdt.managedbuilder.core.configurationDataProvider\" id=\"cdt.managedbuild.config.gnu.so.debug.1532040290.368963197\" moduleId=\"org.eclipse.cdt.core.settings\" name=\"Debug64\">\n\t\t\t\t<externalSettings>\n\t\t\t\t\t<externalSetting>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"includePath\" name=\"/liblua\"/>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"libraryPath\" name=\"/liblua/Debug64\"/>\n\t\t\t\t\t\t<entry flags=\"RESOLVED\" kind=\"libraryFile\" name=\"lua\" srcPrefixMapping=\"\" srcRootPath=\"\"/>\n\t\t\t\t\t</externalSetting>\n\t\t\t\t</externalSettings>\n\t\t\t\t<extensions>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.ELF\" point=\"org.eclipse.cdt.core.BinaryParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GmakeErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.CWDLocator\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GCCErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GASErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GLDErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t</extensions>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"cdtBuildSystem\" version=\"4.0.0\">\n\t\t\t\t<configuration artifactExtension=\"so\" artifactName=\"lua\" buildArtefactType=\"org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" buildProperties=\"org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" cleanCommand=\"rm -rf\" description=\"\" id=\"cdt.managedbuild.config.gnu.so.debug.1532040290.368963197\" name=\"Debug64\" parent=\"cdt.managedbuild.config.gnu.so.debug\">\n\t\t\t\t\t<folderInfo id=\"cdt.managedbuild.config.gnu.so.debug.1532040290.368963197.\" name=\"/\" resourcePath=\"\">\n\t\t\t\t\t\t<toolChain id=\"cdt.managedbuild.toolchain.gnu.so.debug.1878328271\" name=\"Linux GCC\" superClass=\"cdt.managedbuild.toolchain.gnu.so.debug\">\n\t\t\t\t\t\t\t<targetPlatform id=\"cdt.managedbuild.target.gnu.platform.so.debug.337402944\" name=\"Debug Platform\" superClass=\"cdt.managedbuild.target.gnu.platform.so.debug\"/>\n\t\t\t\t\t\t\t<builder buildPath=\"${workspace_loc:/liblua/Debug}\" id=\"cdt.managedbuild.target.gnu.builder.so.debug.1701154392\" keepEnvironmentInBuildfile=\"false\" managedBuildOn=\"true\" name=\"Gnu Make Builder\" superClass=\"cdt.managedbuild.target.gnu.builder.so.debug\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.archiver.base.1091029853\" name=\"GCC Archiver\" superClass=\"cdt.managedbuild.tool.gnu.archiver.base\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.268181350\" name=\"GCC C++ Compiler\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.debug\">\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.debug.option.optimization.level.404508120\" name=\"Optimization Level\" superClass=\"gnu.cpp.compiler.so.debug.option.optimization.level\" value=\"gnu.cpp.compiler.optimization.level.none\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.debug.option.debugging.level.1642014770\" name=\"Debug Level\" superClass=\"gnu.cpp.compiler.so.debug.option.debugging.level\" value=\"gnu.cpp.compiler.debugging.level.max\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.include.paths.1782053797\" name=\"Include paths (-I)\" superClass=\"gnu.cpp.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.other.pic.1763490280\" name=\"Position Independent Code (-fPIC)\" superClass=\"gnu.cpp.compiler.option.other.pic\" value=\"false\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.warnings.nowarn.1249030480\" superClass=\"gnu.cpp.compiler.option.warnings.nowarn\" value=\"true\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.warnings.allwarn.1859782287\" superClass=\"gnu.cpp.compiler.option.warnings.allwarn\" value=\"false\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.compiler.input.1828160276\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.compiler.so.debug.1951534923\" name=\"GCC C Compiler\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.so.debug\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"gnu.c.optimization.level.none\" id=\"gnu.c.compiler.so.debug.option.optimization.level.1537537903\" name=\"Optimization Level\" superClass=\"gnu.c.compiler.so.debug.option.optimization.level\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.so.debug.option.debugging.level.229421162\" name=\"Debug Level\" superClass=\"gnu.c.compiler.so.debug.option.debugging.level\" value=\"gnu.c.debugging.level.max\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.include.paths.985917847\" name=\"Include paths (-I)\" superClass=\"gnu.c.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.misc.pic.290622323\" name=\"Position Independent Code (-fPIC)\" superClass=\"gnu.c.compiler.option.misc.pic\" value=\"true\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.warnings.allwarn.1915422262\" superClass=\"gnu.c.compiler.option.warnings.allwarn\" value=\"false\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.warnings.extrawarn.1191721349\" superClass=\"gnu.c.compiler.option.warnings.extrawarn\" value=\"false\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.warnings.nowarn.857325611\" superClass=\"gnu.c.compiler.option.warnings.nowarn\" value=\"true\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.c.compiler.input.2033825789\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.linker.so.debug.1924566209\" name=\"GCC C Linker\" superClass=\"cdt.managedbuild.tool.gnu.c.linker.so.debug\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.c.link.so.debug.option.shared.38436049\" name=\"Shared (-shared)\" superClass=\"gnu.c.link.so.debug.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.linker.so.debug.681926634\" name=\"GCC C++ Linker\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.so.debug\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.cpp.link.so.debug.option.shared.1911315107\" name=\"Shared (-shared)\" superClass=\"gnu.cpp.link.so.debug.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.linker.input.1903467880\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.input\">\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinputdependency\" paths=\"$(USER_OBJS)\"/>\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinput\" paths=\"$(LIBS)\"/>\n\t\t\t\t\t\t\t\t</inputType>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.assembler.so.debug.1310744712\" name=\"GCC Assembler\" superClass=\"cdt.managedbuild.tool.gnu.assembler.so.debug\">\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.assembler.input.567645150\" superClass=\"cdt.managedbuild.tool.gnu.assembler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t</toolChain>\n\t\t\t\t\t</folderInfo>\n\t\t\t\t\t<sourceEntries>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"sourcePath\" name=\"lua\"/>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"sourcePath\" name=\"tolua\"/>\n\t\t\t\t\t</sourceEntries>\n\t\t\t\t</configuration>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"org.eclipse.cdt.core.externalSettings\"/>\n\t\t</cconfiguration>\n\t\t<cconfiguration id=\"cdt.managedbuild.config.gnu.so.release.1209971451.175111610\">\n\t\t\t<storageModule buildSystemId=\"org.eclipse.cdt.managedbuilder.core.configurationDataProvider\" id=\"cdt.managedbuild.config.gnu.so.release.1209971451.175111610\" moduleId=\"org.eclipse.cdt.core.settings\" name=\"Release64\">\n\t\t\t\t<externalSettings>\n\t\t\t\t\t<externalSetting>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"includePath\" name=\"/liblua\"/>\n\t\t\t\t\t\t<entry flags=\"VALUE_WORKSPACE_PATH\" kind=\"libraryPath\" name=\"/liblua/Release64\"/>\n\t\t\t\t\t\t<entry flags=\"RESOLVED\" kind=\"libraryFile\" name=\"lua\" srcPrefixMapping=\"\" srcRootPath=\"\"/>\n\t\t\t\t\t</externalSetting>\n\t\t\t\t</externalSettings>\n\t\t\t\t<extensions>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.ELF\" point=\"org.eclipse.cdt.core.BinaryParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GmakeErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.CWDLocator\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GCCErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GASErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t\t<extension id=\"org.eclipse.cdt.core.GLDErrorParser\" point=\"org.eclipse.cdt.core.ErrorParser\"/>\n\t\t\t\t</extensions>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"cdtBuildSystem\" version=\"4.0.0\">\n\t\t\t\t<configuration artifactExtension=\"so\" artifactName=\"lua\" buildArtefactType=\"org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" buildProperties=\"org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib\" cleanCommand=\"rm -rf\" description=\"\" id=\"cdt.managedbuild.config.gnu.so.release.1209971451.175111610\" name=\"Release64\" parent=\"cdt.managedbuild.config.gnu.so.release\">\n\t\t\t\t\t<folderInfo id=\"cdt.managedbuild.config.gnu.so.release.1209971451.175111610.\" name=\"/\" resourcePath=\"\">\n\t\t\t\t\t\t<toolChain id=\"cdt.managedbuild.toolchain.gnu.so.release.643878623\" name=\"Linux GCC\" superClass=\"cdt.managedbuild.toolchain.gnu.so.release\">\n\t\t\t\t\t\t\t<targetPlatform id=\"cdt.managedbuild.target.gnu.platform.so.release.449417563\" name=\"Debug Platform\" superClass=\"cdt.managedbuild.target.gnu.platform.so.release\"/>\n\t\t\t\t\t\t\t<builder buildPath=\"${workspace_loc:/liblua/Release}\" id=\"cdt.managedbuild.target.gnu.builder.so.release.1700037651\" keepEnvironmentInBuildfile=\"false\" managedBuildOn=\"true\" name=\"Gnu Make Builder\" superClass=\"cdt.managedbuild.target.gnu.builder.so.release\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.archiver.base.496908164\" name=\"GCC Archiver\" superClass=\"cdt.managedbuild.tool.gnu.archiver.base\"/>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.release.1783019068\" name=\"GCC C++ Compiler\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.so.release\">\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.release.option.optimization.level.531303910\" name=\"Optimization Level\" superClass=\"gnu.cpp.compiler.so.release.option.optimization.level\" value=\"gnu.cpp.compiler.optimization.level.most\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.so.release.option.debugging.level.1449761824\" name=\"Debug Level\" superClass=\"gnu.cpp.compiler.so.release.option.debugging.level\" value=\"gnu.cpp.compiler.debugging.level.none\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.cpp.compiler.option.include.paths.2133537792\" name=\"Include paths (-I)\" superClass=\"gnu.cpp.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.compiler.input.925020008\" superClass=\"cdt.managedbuild.tool.gnu.cpp.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.compiler.so.release.614844003\" name=\"GCC C Compiler\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.so.release\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"gnu.c.optimization.level.most\" id=\"gnu.c.compiler.so.release.option.optimization.level.267191787\" name=\"Optimization Level\" superClass=\"gnu.c.compiler.so.release.option.optimization.level\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.so.release.option.debugging.level.1392416544\" name=\"Debug Level\" superClass=\"gnu.c.compiler.so.release.option.debugging.level\" value=\"gnu.c.debugging.level.none\" valueType=\"enumerated\"/>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.include.paths.918210194\" name=\"Include paths (-I)\" superClass=\"gnu.c.compiler.option.include.paths\" valueType=\"includePath\">\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../lua\"/>\n\t\t\t\t\t\t\t\t\t<listOptionValue builtIn=\"false\" value=\"../../tolua\"/>\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t<option id=\"gnu.c.compiler.option.misc.pic.139224734\" name=\"Position Independent Code (-fPIC)\" superClass=\"gnu.c.compiler.option.misc.pic\" value=\"true\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.c.compiler.input.1502017301\" superClass=\"cdt.managedbuild.tool.gnu.c.compiler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.c.linker.so.release.1691816170\" name=\"GCC C Linker\" superClass=\"cdt.managedbuild.tool.gnu.c.linker.so.release\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.c.link.so.release.option.shared.707505456\" name=\"Shared (-shared)\" superClass=\"gnu.c.link.so.release.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.cpp.linker.so.release.1984643058\" name=\"GCC C++ Linker\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.so.release\">\n\t\t\t\t\t\t\t\t<option defaultValue=\"true\" id=\"gnu.cpp.link.so.release.option.shared.1682820251\" name=\"Shared (-shared)\" superClass=\"gnu.cpp.link.so.release.option.shared\" valueType=\"boolean\"/>\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.cpp.linker.input.448017925\" superClass=\"cdt.managedbuild.tool.gnu.cpp.linker.input\">\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinputdependency\" paths=\"$(USER_OBJS)\"/>\n\t\t\t\t\t\t\t\t\t<additionalInput kind=\"additionalinput\" paths=\"$(LIBS)\"/>\n\t\t\t\t\t\t\t\t</inputType>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t\t<tool id=\"cdt.managedbuild.tool.gnu.assembler.so.release.390620660\" name=\"GCC Assembler\" superClass=\"cdt.managedbuild.tool.gnu.assembler.so.release\">\n\t\t\t\t\t\t\t\t<inputType id=\"cdt.managedbuild.tool.gnu.assembler.input.1576195375\" superClass=\"cdt.managedbuild.tool.gnu.assembler.input\"/>\n\t\t\t\t\t\t\t</tool>\n\t\t\t\t\t\t</toolChain>\n\t\t\t\t\t</folderInfo>\n\t\t\t\t</configuration>\n\t\t\t</storageModule>\n\t\t\t<storageModule moduleId=\"org.eclipse.cdt.core.externalSettings\"/>\n\t\t</cconfiguration>\n\t</storageModule>\n\t<storageModule moduleId=\"cdtBuildSystem\" version=\"4.0.0\">\n\t\t<project id=\"liblua.cdt.managedbuild.target.gnu.so.1215346443\" name=\"Shared Library\" projectType=\"cdt.managedbuild.target.gnu.so\"/>\n\t</storageModule>\n\t<storageModule moduleId=\"scannerConfiguration\">\n\t\t<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\" selectedProfileId=\"\"/>\n\t\t<scannerConfigBuildInfo instanceId=\"cdt.managedbuild.config.gnu.so.debug.1532040290;cdt.managedbuild.config.gnu.so.debug.1532040290.;cdt.managedbuild.tool.gnu.c.compiler.so.debug.2114277329;cdt.managedbuild.tool.gnu.c.compiler.input.1259937486\">\n\t\t\t<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\" selectedProfileId=\"\"/>\n\t\t</scannerConfigBuildInfo>\n\t\t<scannerConfigBuildInfo instanceId=\"cdt.managedbuild.config.gnu.so.debug.1532040290;cdt.managedbuild.config.gnu.so.debug.1532040290.;cdt.managedbuild.tool.gnu.cpp.compiler.so.debug.1908142641;cdt.managedbuild.tool.gnu.cpp.compiler.input.2035513663\">\n\t\t\t<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\" selectedProfileId=\"\"/>\n\t\t</scannerConfigBuildInfo>\n\t\t<scannerConfigBuildInfo instanceId=\"cdt.managedbuild.config.gnu.so.release.1209971451;cdt.managedbuild.config.gnu.so.release.1209971451.;cdt.managedbuild.tool.gnu.c.compiler.so.release.472386122;cdt.managedbuild.tool.gnu.c.compiler.input.1197021556\">\n\t\t\t<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\" selectedProfileId=\"\"/>\n\t\t</scannerConfigBuildInfo>\n\t\t<scannerConfigBuildInfo instanceId=\"cdt.managedbuild.config.gnu.so.release.1209971451;cdt.managedbuild.config.gnu.so.release.1209971451.;cdt.managedbuild.tool.gnu.cpp.compiler.so.release.1495522959;cdt.managedbuild.tool.gnu.cpp.compiler.input.1022202619\">\n\t\t\t<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\" selectedProfileId=\"\"/>\n\t\t</scannerConfigBuildInfo>\n\t</storageModule>\n\t<storageModule moduleId=\"org.eclipse.cdt.core.LanguageSettingsProviders\"/>\n\t<storageModule moduleId=\"refreshScope\" versionNumber=\"2\">\n\t\t<configuration configurationName=\"Release\">\n\t\t\t<resource resourceType=\"PROJECT\" workspacePath=\"/liblua\"/>\n\t\t</configuration>\n\t\t<configuration configurationName=\"Debug\">\n\t\t\t<resource resourceType=\"PROJECT\" workspacePath=\"/liblua\"/>\n\t\t</configuration>\n\t</storageModule>\n\t<storageModule moduleId=\"org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings\"/>\n</cproject>\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>liblua</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>\n\t\t\t<triggers>clean,full,incremental,</triggers>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>\n\t\t\t<triggers>full,incremental,</triggers>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>org.eclipse.cdt.core.cnature</nature>\n\t\t<nature>org.eclipse.cdt.core.ccnature</nature>\n\t\t<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>\n\t\t<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>\n\t</natures>\n\t<linkedResources>\n\t\t<link>\n\t\t\t<name>lua</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-1-PROJECT_LOC/lua</locationURI>\n\t\t</link>\n\t\t<link>\n\t\t\t<name>tolua</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-1-PROJECT_LOC/tolua</locationURI>\n\t\t</link>\n\t</linkedResources>\n</projectDescription>\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE    := cocos_lua_static\n\nLOCAL_MODULE_FILENAME := liblua\n\nLOCAL_SRC_FILES := CCLuaBridge.cpp \\\n          CCLuaEngine.cpp \\\n          CCLuaStack.cpp \\\n          CCLuaValue.cpp \\\n          Cocos2dxLuaLoader.cpp \\\n          CCBProxy.cpp \\\n          Lua_web_socket.cpp \\\n          LuaOpengl.cpp \\\n          LuaScriptHandlerMgr.cpp \\\n          LuaBasicConversions.cpp \\\n          LuaSkeletonAnimation.cpp \\\n          ../../auto-generated/lua-bindings/lua_cocos2dx_auto.cpp \\\n          ../../auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp \\\n          ../../auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp \\\n          ../../auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp \\\n          ../../auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp \\\n          ../../auto-generated/lua-bindings/lua_cocos2dx_physics_auto.cpp \\\n          lua_cocos2dx_manual.cpp \\\n          lua_cocos2dx_extension_manual.cpp \\\n          lua_cocos2dx_coco_studio_manual.cpp \\\n          lua_cocos2dx_gui_manual.cpp \\\n          lua_cocos2dx_spine_manual.cpp \\\n          lua_cocos2dx_physics_manual.cpp \\\n          lua_cocos2dx_deprecated.cpp \\\n          lua_xml_http_request.cpp \\\n          platform/android/CCLuaJavaBridge.cpp \\\n          platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp \\\n          ../../../../external/lua/tolua/tolua_event.c \\\n          ../../../../external/lua/tolua/tolua_is.c \\\n          ../../../../external/lua/tolua/tolua_map.c \\\n          ../../../../external/lua/tolua/tolua_push.c \\\n          ../../../../external/lua/tolua/tolua_to.c \\\n          tolua_fix.c \\\n          socket/auxiliar.c \\\n          socket/luasocket_buffer.c \\\n          socket/except.c \\\n          socket/inet.c \\\n          socket/luasocket_io.c \\\n          socket/luasocket.c \\\n          socket/mime.c \\\n          socket/options.c \\\n          socket/select.c \\\n          socket/serial.c \\\n          socket/socket_scripts.c \\\n          socket/tcp.c \\\n          socket/timeout.c \\\n          socket/udp.c \\\n          socket/unix.c \\\n          socket/usocket.c \\\n          lua_extensions.c\n\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../external/lua/tolua \\\n                    $(LOCAL_PATH)/../../auto-generated/lua-bindings \\\n                    $(LOCAL_PATH)/platform/android \\\n                    $(LOCAL_PATH)/platform/android/jni \\\n                    $(LOCAL_PATH)/../../../../extensions \\\n                    $(LOCAL_PATH)/../../../editor-support/cocosbuilder \\\n                    $(LOCAL_PATH)/../../../editor-support/cocostudio \\\n                    $(LOCAL_PATH)/../../../editor-support/spine \\\n                    $(LOCAL_PATH)/../../../gui\n\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\n\nLOCAL_WHOLE_STATIC_LIBRARIES := luajit_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static\nLOCAL_WHOLE_STATIC_LIBRARIES += websockets_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static\nLOCAL_WHOLE_STATIC_LIBRARIES += spine_static\n\nLOCAL_CFLAGS += -Wno-psabi\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,lua/luajit/prebuilt/android)\n$(call import-module,extensions)\n$(call import-module,2d)\n$(call import-module,websockets/prebuilt/android)\n$(call import-module,network)\n$(call import-module,editor-support/cocostudio)\n$(call import-module,editor-support/cocosbuilder)\n$(call import-module,editor-support/spine)\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCBProxy.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCBProxy.h\"\n#include \"LuaScriptHandlerMgr.h\"\n\nCCBReader* CCBProxy::createCCBReader()\n{\n    NodeLoaderLibrary *ccNodeLoaderLibrary = NodeLoaderLibrary::getInstance();\n    CCBReader * pCCBReader = new CCBReader(ccNodeLoaderLibrary);\n    pCCBReader->autorelease();\n    \n    return pCCBReader;\n}\nNode* CCBProxy::readCCBFromFile(const char *pszFileName,CCBReader* pCCBReader,bool bSetOwner)\n{\n    if (NULL == pCCBReader || NULL == pszFileName || 0 == strlen(pszFileName)) {\n        return NULL;\n    }\n    Node *pNode = NULL;\n    if (bSetOwner) {\n        pNode = pCCBReader->readNodeGraphFromFile(pszFileName,this);\n    }\n    else\n    {\n        pNode = pCCBReader->readNodeGraphFromFile(pszFileName);\n    }\n    \n    \n    return pNode;\n}\n\nconst char* CCBProxy::getNodeTypeName(Node* pNode)\n{\n    if (NULL == pNode) {\n        return NULL;\n    }\n    \n    if (NULL != dynamic_cast<LabelTTF*>(pNode)) {\n        return \"cc.LabelTTF\";\n    }\n\n    if (NULL != dynamic_cast<LabelBMFont*>(pNode)) {\n        return \"cc.LabelBMFont\";\n    }\n\n    if (NULL != dynamic_cast<Sprite*>(pNode)) {\n        return \"cc.Sprite\";\n    }\n    \n    if (NULL != dynamic_cast<ControlButton*>(pNode)) {\n        return \"cc.ControlButton\";\n    }\n    \n    if (NULL != dynamic_cast<LayerGradient*>(pNode)) {\n        return \"cc.LayerGradient\";\n    }\n    \n    if (NULL != dynamic_cast<LayerColor*>(pNode)) {\n        return \"cc.LayerColor\";\n    }\n    \n    if (NULL != dynamic_cast<Scale9Sprite*>(pNode)) {\n        return \"cc.LayerGradient\";\n    }\n    \n    if (NULL != dynamic_cast<Menu*>(pNode)) {\n        return \"cc.Menu\";\n    }\n    \n    if (NULL != dynamic_cast<MenuItemAtlasFont*>(pNode)) {\n        return \"cc.MenuItemAtlasFont\";\n    }\n    \n    if (NULL != dynamic_cast<MenuItemFont*>(pNode)) {\n        return \"cc.MenuItemFont\";\n    }\n    \n    if (NULL != dynamic_cast<MenuItemLabel*>(pNode)) {\n        return \"cc.MenuItemLabel\";\n    }\n    \n    if (NULL != dynamic_cast<MenuItemImage*>(pNode)) {\n        return \"cc.MenuItemImage\";\n    }\n    \n    if (NULL != dynamic_cast<MenuItemToggle*>(pNode)) {\n        return \"cc.MenuItemToggle\";\n    }\n    \n    if (NULL != dynamic_cast<MenuItemSprite*>(pNode)) {\n        return \"cc.MenuItemSprite\";\n    }\n\n    if (NULL != dynamic_cast<MenuItem*>(pNode)) {\n        return \"cc.MenuItem\";\n    }\n\n    if (NULL != dynamic_cast<Layer*>(pNode)) {\n        return \"cc.Layer\";\n    }\n\n    if (NULL != dynamic_cast<String*>(pNode)) {\n        return \"cc.String\";\n    }\n    \n    if (NULL != dynamic_cast<ParticleSystemQuad*>(pNode)) {\n        return \"cc.ParticleSystemQuad\";\n    }\n\n    return \"No Support\";\n}\n\nvoid CCBProxy::setCallback(Node* node,int handle, int controlEvents)\n{\n    if (nullptr == node) {\n        return;\n    }\n    \n    if (nullptr != dynamic_cast<MenuItem*>(node))\n    {\n        MenuItem *menuItem = dynamic_cast<MenuItem*>(node);\n        if (nullptr != menuItem) {\n            ScriptHandlerMgr::getInstance()->addObjectHandler((void*)menuItem, handle, ScriptHandlerMgr::HandlerType::MENU_CLICKED);\n        }\n    }\n    else  if (NULL != dynamic_cast<Control*>(node))\n    {\n        Control* control = dynamic_cast<Control*>(node);\n        if (nullptr != control)\n        {\n            for (int i = 0; i < kControlEventTotalNumber; i++)\n            {\n                if ((controlEvents & (1 << i)))\n                {\n                    ScriptHandlerMgr::HandlerType handlerType = ScriptHandlerMgr::HandlerType((int)ScriptHandlerMgr::HandlerType::CONTROL_TOUCH_DOWN + i);\n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)control, handle, handlerType);\n                }\n            }\n        }\n    }\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCBProxy.h",
    "content": "#ifndef __CCBPROXY_H_\n#define __CCBPROXY_H_\n\n#include \"cocos2d.h\"\n#include \"CCLuaEngine.h\"\n#include \"SimpleAudioEngine.h\"\n#include \"extensions/cocos-ext.h\"\n#include \"cocosbuilder/CocosBuilder.h\"\n\nUSING_NS_CC;\nUSING_NS_CC_EXT;\nusing namespace cocosbuilder;\n\n\nclass CCBProxy : public Layer{\npublic:\n    CCBProxy() { }\n    virtual ~ CCBProxy(){ }\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(CCBProxy, create);\n    CCBReader* createCCBReader();\n    Node* readCCBFromFile(const char *pszFileName,CCBReader* pCCBReader,bool bSetOwner = false);\n    const char* getNodeTypeName(Node* pNode);\n    void setCallback(Node* node,int handle, int controlEvents = 0);\n};\n\nclass CCBLayerLoader:public LayerLoader{\npublic:\n    CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCBLayerLoader, loader);\n};\n\n#endif // __CCBPROXY_H_\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaBridge.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCLuaBridge.h\"\n\nNS_CC_BEGIN\n\nlua_State *LuaBridge::s_luaState = NULL;\nint        LuaBridge::s_newFunctionId = 0;\n\nLuaStack *LuaBridge::getStack(void)\n{\n    return LuaEngine::getInstance()->getLuaStack();\n}\n\nint LuaBridge::pushLuaFunctionById(int functionId)\n{\n    lua_State *L = s_luaState;\n    int top = lua_gettop(L);\n    /* L: */\n    lua_pushstring(L, LUA_BRIDGE_REGISTRY_FUNCTION);            /* L: key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f_id */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        return 0;\n    }\n    \n    lua_pushnil(L);                                             /* L: f_id nil */\n    while (lua_next(L, -2) != 0)                                /* L: f_id f id */\n    {\n        int value = lua_tonumber(L, -1);\n        lua_pop(L, 1);                                          /* L: f_id f */\n        if (value == functionId)\n        {\n            return -1;\n        }\n    }                                                           /* L: f_id */\n    \n    lua_settop(L, top);\n    return 0;\n}\n\nint LuaBridge::retainLuaFunctionById(int functionId)\n{\n    lua_State *L = s_luaState;\n    \n    lua_pushstring(L, LUA_BRIDGE_REGISTRY_RETAIN);              /* L: key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: id_r */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        return 0;\n    }\n    \n    // get counter\n    lua_pushinteger(L, functionId);                             /* L: id_r id */\n    lua_rawget(L, -2);                                          /* L: id_r r */\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        lua_pop(L, 2);\n        return 0;\n    }\n    \n    // increase counter\n    int retainCount = lua_tonumber(L, -1);\n    retainCount++;\n    lua_pop(L, 1);                                              /* L: id_r */\n    lua_pushinteger(L, functionId);                             /* L: id_r id */\n    lua_pushinteger(L, retainCount);                            /* L: id_r id r */\n    lua_rawset(L, -3);                            /* id_r[id] = r, L: id_r */\n    lua_pop(L, 1);\n    \n    CCLOG(\"CCLuaBridge::retainLuaFunctionById(%d) - retain count = %d\", functionId, retainCount);\n    \n    return retainCount;\n    \n}\n\nint LuaBridge::releaseLuaFunctionById(int functionId)\n{\n    lua_State *L = s_luaState;\n    /* L: */\n    lua_pushstring(L, LUA_BRIDGE_REGISTRY_FUNCTION);            /* L: key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f_id */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        CCLOG(\"CCLuaBridge::releaseLuaFunctionById() - LUA_BRIDGE_REGISTRY_FUNCTION not exists\");\n        return 0;\n    }\n    \n    lua_pushstring(L, LUA_BRIDGE_REGISTRY_RETAIN);              /* L: f_id key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f_id id_r */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 2);\n        CCLOG(\"CCLuaBridge::releaseLuaFunctionById() - LUA_BRIDGE_REGISTRY_RETAIN not exists\");\n        return 0;\n    }\n    \n    lua_pushinteger(L, functionId);                             /* L: f_id id_r id */\n    lua_rawget(L, -2);                                          /* L: f_id id_r r */\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        lua_pop(L, 3);\n        CCLOG(\"CCLuaBridge::releaseLuaFunctionById() - function id %d not found\", functionId);\n        return 0;\n    }\n    \n    int retainCount = lua_tonumber(L, -1);\n    retainCount--;\n    \n    if (retainCount > 0)\n    {\n        // update counter\n        lua_pop(L, 1);                                          /* L: f_id id_r */\n        lua_pushinteger(L, functionId);                         /* L: f_id id_r id */\n        lua_pushinteger(L, retainCount);                        /* L: f_id id_r id r */\n        lua_rawset(L, -3);                        /* id_r[id] = r, L: f_id id_r */\n        lua_pop(L, 2);\n        CCLOG(\"CCLuaBridge::releaseLuaFunctionById() - function id %d retain count = %d\", functionId, retainCount);\n        return retainCount;\n    }\n    \n    // remove lua function reference\n    lua_pop(L, 1);                                              /* L: f_id id_r */\n    lua_pushinteger(L, functionId);                             /* L: f_id id_r id */\n    lua_pushnil(L);                                             /* L: f_id id_r id nil */\n    lua_rawset(L, -3);                          /* id_r[id] = nil, L: f_id id_r */\n    \n    lua_pop(L, 1);                                              /* L: f_id */\n    lua_pushnil(L);                                             /* L: f_id nil */\n    while (lua_next(L, -2) != 0)                                /* L: f_id f id */\n    {\n        int value = lua_tonumber(L, -1);\n        lua_pop(L, 1);                                          /* L: f_id f */\n        if (value == functionId)\n        {\n            lua_pushnil(L);                                     /* L: f_id f nil */\n            lua_rawset(L, -3);                   /* f_id[f] = nil, L: f_id */\n            break;\n        }\n    }                                                           /* L: f_id */\n    \n    lua_pop(L, 1);\n    CCLOG(\"CCLuaBridge::releaseLuaFunctionById() - function id %d released\", functionId);\n    return 0;\n}\n\nint LuaBridge::retainLuaFunction(lua_State *L, int functionIndex, int *retainCountReturn)\n{\n    /* L: f ... */\n    lua_pushstring(L, LUA_BRIDGE_REGISTRY_FUNCTION);            /* L: f ... key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f ... f_id */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        lua_newtable(L);\n        lua_pushstring(L, LUA_BRIDGE_REGISTRY_FUNCTION);\n        lua_pushvalue(L, -2);\n        lua_rawset(L, LUA_REGISTRYINDEX);\n    }\n    \n    lua_pushstring(L, LUA_BRIDGE_REGISTRY_RETAIN);              /* L: f ... f_id key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f ... f_id id_r */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        lua_newtable(L);\n        lua_pushstring(L, LUA_BRIDGE_REGISTRY_RETAIN);\n        lua_pushvalue(L, -2);\n        lua_rawset(L, LUA_REGISTRYINDEX);\n    }\n    \n    // get function id\n    lua_pushvalue(L, functionIndex - 2);                        /* L: f ... f_id id_r f */\n    lua_rawget(L, -3);                                          /* L: f ... f_id id_r id */\n    \n    int functionId;\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        // first retain, create new id\n        lua_pop(L, 1);                                          /* L: f ... f_id id_r */\n        s_newFunctionId++;\n        functionId = s_newFunctionId;\n        \n        lua_pushvalue(L, functionIndex - 2);                    /* L: f ... f_id id_r f */\n        lua_pushinteger(L, functionId);                         /* L: f ... f_id id_r f id */\n        lua_rawset(L, -4);                        /* f_id[f] = id, L: f ... f_id id_r */\n        lua_pushinteger(L, functionId);                         /* L: f ... f_id id_r id */\n    }\n    else\n    {\n        functionId = lua_tonumber(L, -1);\n    }\n    \n    // get function retain\n    lua_pushvalue(L, -1);                                       /* L: f ... f_id id_r id id */\n    lua_rawget(L, -3);                                          /* L: f ... f_id id_r id r */\n    int retainCount = 1;\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        // first retain, set retain count = 1\n        lua_pop(L, 1);\n        lua_pushinteger(L, retainCount);\n    }\n    else\n    {\n        // add retain count\n        retainCount = lua_tonumber(L, -1);\n        retainCount++;\n        lua_pop(L, 1);\n        lua_pushinteger(L, retainCount);\n    }\n    \n    lua_rawset(L, -3);                            /* id_r[id] = r, L: f ... f_id id_r */\n    lua_pop(L, 2);                                              /* L: f ... */\n    \n    if (retainCountReturn) *retainCountReturn = retainCount;\n    return functionId;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaBridge.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __LUA_BRIDGE_H_\n#define __LUA_BRIDGE_H_\n\n#include <string>\n#include <map>\n#include \"CCLuaEngine.h\"\n\nextern \"C\" {\n#include \"lua.h\"\n}\n\nusing namespace std;\n\nNS_CC_BEGIN\n\ntypedef enum {\n    kLuaBridgeErrorOk                   = 0,\n    kLuaBridgeErrorInvalidParameters    = -1,\n    kLuaBridgeErrorClassNotFound        = -2,\n    kLuaBridgeErrorMethodNotFound       = -3,\n    kLuaBridgeErrorExceptionOccurred    = -4,\n    kLuaBridgeErrorMethodSignature      = -5,\n    kLuaBridgeErrorJavaVMError          = -6,\n} LuaBridgeError;\n\n#define LUA_BRIDGE_REGISTRY_FUNCTION    \"lua_bridge_function_id\"        // table[function] = id\n#define LUA_BRIDGE_REGISTRY_RETAIN      \"lua_bridge_function_id_retain\" // table[id] = retain count\n\nclass LuaBridge\n{\npublic:\n    static LuaStack *getStack(void);\n    static int pushLuaFunctionById(int functionId);\n\n    static int retainLuaFunctionById(int functionId);\n    static int releaseLuaFunctionById(int functionId);\n    \nprotected:\n    static int retainLuaFunction(lua_State *L, int functionIndex, int *retainCountReturn);\n\n    static lua_State *s_luaState;\n    static int        s_newFunctionId;\n};\n\nNS_CC_END\n\n#endif // __LUA_BRIDGE_H_\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaEngine.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2012      cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCLuaEngine.h\"\n#include \"tolua_fix.h\"\n#include \"cocos2d.h\"\n#include \"CCArray.h\"\n#include \"CCScheduler.h\"\n#include \"extensions/GUI/CCControlExtension/CCControl.h\"\n#include \"LuaOpengl.h\"\n#include \"lua_cocos2dx_manual.hpp\"\n#include \"lua_cocos2dx_extension_manual.h\"\n#include \"lua_cocos2dx_coco_studio_manual.hpp\"\n#include \"lua_cocos2dx_gui_manual.hpp\"\n\nNS_CC_BEGIN\n\nLuaEngine* LuaEngine::_defaultEngine = NULL;\n\nLuaEngine* LuaEngine::getInstance(void)\n{\n    if (!_defaultEngine)\n    {\n        _defaultEngine = new LuaEngine();\n        _defaultEngine->init();\n    }\n    return _defaultEngine;\n}\n\nLuaEngine::~LuaEngine(void)\n{\n    CC_SAFE_RELEASE(_stack);\n    _defaultEngine = NULL;\n}\n\nbool LuaEngine::init(void)\n{\n    _stack = LuaStack::create();\n    _stack->retain();\n    executeScriptFile(\"DeprecatedEnum.lua\");\n    executeScriptFile(\"DeprecatedClass.lua\");\n    executeScriptFile(\"Deprecated.lua\");\n    return true;\n}\n\nvoid LuaEngine::addSearchPath(const char* path)\n{\n    _stack->addSearchPath(path);\n}\n\nvoid LuaEngine::addLuaLoader(lua_CFunction func)\n{\n    _stack->addLuaLoader(func);\n}\n\nvoid LuaEngine::removeScriptObjectByObject(Object* pObj)\n{\n    _stack->removeScriptObjectByObject(pObj);\n    ScriptHandlerMgr::getInstance()->removeObjectAllHandlers(pObj);\n}\n\nvoid LuaEngine::removeScriptHandler(int nHandler)\n{\n    _stack->removeScriptHandler(nHandler);\n}\n\nint LuaEngine::executeString(const char *codes)\n{\n    int ret = _stack->executeString(codes);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::executeScriptFile(const char* filename)\n{\n    int ret = _stack->executeScriptFile(filename);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::executeGlobalFunction(const char* functionName)\n{\n    int ret = _stack->executeGlobalFunction(functionName);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::executeNodeEvent(Node* pNode, int nAction)\n{\n    return 0;\n}\n\nint LuaEngine::executeMenuItemEvent(MenuItem* pMenuItem)\n{\n    return 0;\n}\n\nint LuaEngine::executeNotificationEvent(NotificationCenter* pNotificationCenter, const char* pszName)\n{\n    int nHandler = pNotificationCenter->getObserverHandlerByName(pszName);\n    if (!nHandler) return 0;\n    \n    _stack->pushString(pszName);\n    int ret = _stack->executeFunctionByHandler(nHandler, 1);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::executeCallFuncActionEvent(CallFunc* pAction, Object* pTarget/* = NULL*/)\n{\n    return 0;\n}\n\nint LuaEngine::executeSchedule(int nHandler, float dt, Node* pNode/* = NULL*/)\n{\n    if (!nHandler) return 0;\n    _stack->pushFloat(dt);\n    int ret = _stack->executeFunctionByHandler(nHandler, 1);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::executeLayerTouchEvent(Layer* pLayer, int eventType, Touch *pTouch)\n{\n    return 0;\n}\n\nint LuaEngine::executeLayerTouchesEvent(Layer* pLayer, int eventType, Set *pTouches)\n{\n    return 0;\n}\n\nint LuaEngine::executeLayerKeypadEvent(Layer* pLayer, int eventType)\n{\n    return 0;\n}\n\nint LuaEngine::executeAccelerometerEvent(Layer* pLayer, Acceleration* pAccelerationValue)\n{\n    return 0;\n}\n\nint LuaEngine::executeEvent(int nHandler, const char* pEventName, Object* pEventSource /* = NULL*/, const char* pEventSourceClassName /* = NULL*/)\n{\n    _stack->pushString(pEventName);\n    if (pEventSource)\n    {\n        _stack->pushObject(pEventSource, pEventSourceClassName ? pEventSourceClassName : \"cc.Object\");\n    }\n    int ret = _stack->executeFunctionByHandler(nHandler, pEventSource ? 2 : 1);\n    _stack->clean();\n    return ret;\n}\n\nbool LuaEngine::handleAssert(const char *msg)\n{\n    bool ret = _stack->handleAssert(msg);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::reallocateScriptHandler(int nHandler)\n{    \n    int nRet = _stack->reallocateScriptHandler(nHandler);\n    _stack->clean();\n    return nRet;\n}\n\nbool LuaEngine::parseConfig(ConfigType type, const std::string& str)\n{\n    lua_getglobal(_stack->getLuaState(), \"__onParseConfig\");\n    if (!lua_isfunction(_stack->getLuaState(), -1))\n    {\n        CCLOG(\"[LUA ERROR] name '%s' does not represent a Lua function\", \"__onParseConfig\");\n        lua_pop(_stack->getLuaState(), 1);\n        return false;\n    }\n    \n    _stack->pushInt((int)type);\n    _stack->pushString(str.c_str());\n    \n    return _stack->executeFunction(2);\n}\n\nint LuaEngine::sendEvent(ScriptEvent* evt)\n{\n    if (NULL == evt)\n        return 0;\n    \n    switch (evt->type)\n    {\n        case kNodeEvent:\n            {\n               return handleNodeEvent(evt->data);\n            }\n            break;\n        case kMenuClickedEvent:\n            {\n                return handleMenuClickedEvent(evt->data);\n            }\n            break;\n        case kCallFuncEvent:\n            {\n                return handleCallFuncActionEvent(evt->data);\n            }\n            break;\n        case kScheduleEvent:\n            {\n                return handleScheduler(evt->data);\n            }\n            break;\n        case kTouchEvent:\n            {\n                return handleTouchEvent(evt->data);\n            }\n            break;\n        case kTouchesEvent:\n            {\n                return handleTouchesEvent(evt->data);\n            }\n            break;\n        case kKeypadEvent:\n            {\n                return handleKeypadEvent(evt->data);\n            }\n            break;\n        case kAccelerometerEvent:\n            {\n                return handleAccelerometerEvent(evt->data);\n            }\n            break;\n        case kCommonEvent:\n            {\n                return handleCommonEvent(evt->data);\n            }\n            break;\n        case kControlEvent:\n            {\n                return handlerControlEvent(evt->data);\n            }\n            break;\n        default:\n            break;\n    }\n    \n    return 0;\n}\n\nint LuaEngine::handleNodeEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = (BasicScriptData*)data;\n    if (NULL == basicScriptData->nativeObject || NULL == basicScriptData->value)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(basicScriptData->nativeObject, ScriptHandlerMgr::HandlerType::NODE);\n    \n    if (0 == handler)\n        return 0;\n    \n    int action = *((int*)(basicScriptData->value));\n    switch (action)\n    {\n        case kNodeOnEnter:\n            _stack->pushString(\"enter\");\n            break;\n            \n        case kNodeOnExit:\n            _stack->pushString(\"exit\");\n            break;\n            \n        case kNodeOnEnterTransitionDidFinish:\n            _stack->pushString(\"enterTransitionFinish\");\n            break;\n            \n        case kNodeOnExitTransitionDidStart:\n            _stack->pushString(\"exitTransitionStart\");\n            break;\n            \n        case kNodeOnCleanup:\n            _stack->pushString(\"cleanup\");\n            break;\n            \n        default:\n            return 0;\n    }\n    int ret = _stack->executeFunctionByHandler(handler, 1);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleMenuClickedEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = (BasicScriptData*)data;\n    if (NULL == basicScriptData->nativeObject)\n        return 0;\n        \n    MenuItem* menuItem = static_cast<MenuItem*>(basicScriptData->nativeObject);\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(menuItem, ScriptHandlerMgr::HandlerType::MENU_CLICKED);\n    if (0 == handler)\n        return 0;\n    \n    _stack->pushInt(menuItem->getTag());\n    _stack->pushObject(menuItem, \"cc.MenuItem\");\n    int ret = _stack->executeFunctionByHandler(handler, 2);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleCallFuncActionEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (NULL == basicScriptData->nativeObject)\n        return 0;\n        \n    int handler =ScriptHandlerMgr::getInstance()->getObjectHandler(basicScriptData->nativeObject, ScriptHandlerMgr::HandlerType::CALLFUNC);\n    \n    if (0 == handler)\n        return 0;\n    \n    Object* target = static_cast<Object*>(basicScriptData->value);\n    if (NULL != target)\n    {\n        _stack->pushObject(target, \"cc.Node\");\n    }\n    int ret = _stack->executeFunctionByHandler(handler, target ? 1 : 0);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleScheduler(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    SchedulerScriptData* schedulerInfo = static_cast<SchedulerScriptData*>(data);\n    \n    _stack->pushFloat(schedulerInfo->elapse);\n    int ret = _stack->executeFunctionByHandler(schedulerInfo->handler, 1);\n    _stack->clean();\n    \n    return ret;\n}\n\nint LuaEngine::handleKeypadEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    KeypadScriptData* keypadScriptData = static_cast<KeypadScriptData*>(data);\n    if (NULL == keypadScriptData->nativeObject)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(keypadScriptData->nativeObject, ScriptHandlerMgr::HandlerType::KEYPAD);\n    \n    if (0 == handler)\n        return 0;\n    \n    EventKeyboard::KeyCode action = keypadScriptData->actionType;\n\n    switch(action)\n    {\n        case EventKeyboard::KeyCode::KEY_BACKSPACE:\n\t\t\t_stack->pushString(\"backClicked\");\n\t\t\tbreak;\n\t\tcase EventKeyboard::KeyCode::KEY_MENU:\n            _stack->pushString(\"menuClicked\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n    }\n\n    int ret = _stack->executeFunctionByHandler(handler, 1);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleAccelerometerEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (NULL == basicScriptData->nativeObject || NULL == basicScriptData->value)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(basicScriptData->nativeObject, ScriptHandlerMgr::HandlerType::ACCELEROMETER);\n    if (0 == handler)\n        return 0;\n    \n    Acceleration* accelerationValue = static_cast<Acceleration*>(basicScriptData->value);\n    _stack->pushFloat(accelerationValue->x);\n    _stack->pushFloat(accelerationValue->y);\n    _stack->pushFloat(accelerationValue->z);\n    _stack->pushFloat(accelerationValue->timestamp);\n    int ret = _stack->executeFunctionByHandler(handler, 4);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleCommonEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n   \n    CommonScriptData* commonInfo = static_cast<CommonScriptData*>(data);\n    if (NULL == commonInfo->eventName || 0 == commonInfo->handler)\n        return 0;\n    \n    _stack->pushString(commonInfo->eventName);\n    if (NULL != commonInfo->eventSource)\n    {\n        if (NULL  != commonInfo->eventSourceClassName && strlen(commonInfo->eventSourceClassName) > 0)\n        {\n            _stack->pushObject(commonInfo->eventSource, commonInfo->eventSourceClassName);\n        }\n        else\n        {\n            _stack->pushObject(commonInfo->eventSource, \"cc.Object\");\n        }\n    }\n    int ret = _stack->executeFunctionByHandler(commonInfo->handler, commonInfo->eventSource ? 2 : 1);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleTouchEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    TouchScriptData* touchScriptData = static_cast<TouchScriptData*>(data);\n    if (NULL == touchScriptData->nativeObject || NULL == touchScriptData->touch)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)touchScriptData->nativeObject, ScriptHandlerMgr::HandlerType::TOUCHES);\n    \n    if (0 == handler)\n        return 0;\n    \n    switch (touchScriptData->actionType)\n    {\n        case EventTouch::EventCode::BEGAN:\n            _stack->pushString(\"began\");\n            break;\n            \n        case EventTouch::EventCode::MOVED:\n            _stack->pushString(\"moved\");\n            break;\n            \n        case EventTouch::EventCode::ENDED:\n            _stack->pushString(\"ended\");\n            break;\n            \n        case EventTouch::EventCode::CANCELLED:\n            _stack->pushString(\"cancelled\");\n            break;\n            \n        default:\n            return 0;\n    }\n\n    int ret = 0;\n\n    Touch* touch = touchScriptData->touch;\n    if (NULL != touch) {\n        const Point pt = Director::getInstance()->convertToGL(touch->getLocationInView());\n        _stack->pushFloat(pt.x);\n        _stack->pushFloat(pt.y);\n        ret = _stack->executeFunctionByHandler(handler, 3);\n    }\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleTouchesEvent(void* data)\n{\n    if (NULL == data)\n        return 0;\n    \n    TouchesScriptData* touchesScriptData = static_cast<TouchesScriptData*>(data);\n    if (NULL == touchesScriptData->nativeObject || touchesScriptData->touches.size() == 0)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)touchesScriptData->nativeObject, ScriptHandlerMgr::HandlerType::TOUCHES);\n    \n    if (0 == handler)\n        return 0;\n    \n    switch (touchesScriptData->actionType)\n    {\n        case EventTouch::EventCode::BEGAN:\n            _stack->pushString(\"began\");\n            break;\n            \n        case EventTouch::EventCode::MOVED:\n            _stack->pushString(\"moved\");\n            break;\n            \n        case EventTouch::EventCode::ENDED:\n            _stack->pushString(\"ended\");\n            break;\n            \n        case EventTouch::EventCode::CANCELLED:\n            _stack->pushString(\"cancelled\");\n            break;\n            \n        default:\n            return 0;\n    }\n    \n    Director* pDirector = Director::getInstance();\n    lua_State *L = _stack->getLuaState();\n    int ret = 0;\n\n    lua_newtable(L);\n    int i = 1;\n    for (auto& touch : touchesScriptData->touches)\n    {\n        Point pt = pDirector->convertToGL(touch->getLocationInView());\n        lua_pushnumber(L, pt.x);\n        lua_rawseti(L, -2, i++);\n        lua_pushnumber(L, pt.y);\n        lua_rawseti(L, -2, i++);\n        lua_pushinteger(L, touch->getID());\n        lua_rawseti(L, -2, i++);\n    }\n    ret = _stack->executeFunctionByHandler(handler, 2);\n\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handlerControlEvent(void* data)\n{\n    if ( NULL == data )\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (NULL == basicScriptData->nativeObject)\n        return 0;\n    \n    int controlEvents = *((int*)(basicScriptData->value));\n    \n    int handler = 0;\n    int ret = 0;\n    \n    for (int i = 0; i < kControlEventTotalNumber; i++)\n    {\n        if ((controlEvents & (1 << i)))\n        {\n            ScriptHandlerMgr::HandlerType controlHandler = ScriptHandlerMgr::HandlerType((int)ScriptHandlerMgr::HandlerType::CONTROL_TOUCH_DOWN + i);\n            handler = ScriptHandlerMgr::getInstance()->getObjectHandler(basicScriptData->nativeObject, controlHandler);\n            \n            if (0 != handler)\n            {\n                _stack->pushObject((Object*)basicScriptData->nativeObject, \"cc.Object\");\n                _stack->pushInt(controlEvents);\n                ret = _stack->executeFunctionByHandler(handler, 2);\n                _stack->clean();\n            }\n        }\n    }\n\n    return ret;    \n}\n\nint LuaEngine::handleEventAcc(void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (nullptr == basicScriptData->nativeObject || nullptr == basicScriptData->value)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(basicScriptData->nativeObject, ScriptHandlerMgr::HandlerType::EVENT_ACC);\n    if (0 == handler)\n        return 0;\n    \n    lua_State* L = _stack->getLuaState();\n    \n    LuaEventAccelerationData* eventListennerAcc = static_cast<LuaEventAccelerationData*>(basicScriptData->value);    \n    toluafix_pushusertype_ccobject(L, eventListennerAcc->event->_ID, &(eventListennerAcc->event->_luaID), (void*)(eventListennerAcc->event),\"cc.Event\");\n    Acceleration*  accleration = static_cast<Acceleration*>(eventListennerAcc->acc);\n    lua_pushnumber(L,accleration->x);\n    lua_pushnumber(L,accleration->y);\n    lua_pushnumber(L,accleration->z);\n    lua_pushnumber(L,accleration->timestamp);\n    int ret = _stack->executeFunctionByHandler(handler, 5);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleEventKeyboard(ScriptHandlerMgr::HandlerType type, void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (nullptr == basicScriptData->nativeObject || nullptr == basicScriptData->value)\n        return 0;\n    \n    LuaEventKeyboarData* keyboardData = static_cast<LuaEventKeyboarData*>(basicScriptData->value);\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(basicScriptData->nativeObject, type);\n    if (0 == handler)\n        return 0;\n    \n    lua_State* L = _stack->getLuaState();\n    lua_pushinteger(L, keyboardData->keyCode);\n    toluafix_pushusertype_ccobject(L, keyboardData->event->_ID, &(keyboardData->event->_luaID), (void*)(keyboardData->event),\"cc.Event\");\n    int ret = _stack->executeFunctionByHandler(handler, 2);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleEventTouch(ScriptHandlerMgr::HandlerType type, void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (nullptr == basicScriptData->nativeObject || nullptr == basicScriptData->value)\n        return 0;\n    \n    LuaEventTouchData* touchData = static_cast<LuaEventTouchData*>(basicScriptData->value);\n    if (nullptr == touchData->touch || nullptr == touchData->event)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler(basicScriptData->nativeObject, type);\n    if (0 == handler)\n        return 0;\n    \n    int ret = 0;\n    \n    Touch* touch = touchData->touch;\n    if (NULL != touch) {\n        _stack->pushObject(touchData->touch, \"cc.Touch\");\n        _stack->pushObject(touchData->event, \"cc.Event\");\n        ret = _stack->executeFunctionByHandler(handler, 2);\n    }\n    _stack->clean();\n    \n    return ret;\n}\n\nint LuaEngine::handleEventTouches(ScriptHandlerMgr::HandlerType type,void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (nullptr == basicScriptData->nativeObject || nullptr == basicScriptData->value)\n        return 0;\n    \n    LuaEventTouchesData * touchesData = static_cast<LuaEventTouchesData*>(basicScriptData->value);\n    if (nullptr == touchesData->event || touchesData->touches.size() == 0)\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)basicScriptData->nativeObject, type);\n    \n    if (0 == handler)\n        return 0;\n    \n    lua_State *L = _stack->getLuaState();\n    int ret = 0;\n    \n    lua_newtable(L);\n    int i = 1;\n    for (auto& touch : touchesData->touches)\n    {\n        _stack->pushInt(i);\n        _stack->pushObject(touch, \"cc.Touch\");\n        lua_rawset(L, -3);\n        ++i;\n    }\n    _stack->pushObject(touchesData->event, \"cc.Event\");\n    \n    ret = _stack->executeFunctionByHandler(handler, 2);\n    _stack->clean();\n    return ret;\n}\n\nint LuaEngine::handleEventMouse(ScriptHandlerMgr::HandlerType type, void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* basicScriptData = static_cast<BasicScriptData*>(data);\n    if (nullptr == basicScriptData->nativeObject || nullptr == basicScriptData->value)\n        return 0;\n    \n    LuaEventMouseData * mouseData = static_cast<LuaEventMouseData*>(basicScriptData->value);\n    if (nullptr == mouseData->event )\n        return 0;\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)basicScriptData->nativeObject, type);\n    \n    if (0 == handler)\n        return 0;\n    \n    _stack->pushObject(mouseData->event, \"cc.Event\");\n    int ret = _stack->executeFunctionByHandler(handler, 1);\n    _stack->clean();\n    \n    return ret;\n}\n\nint LuaEngine::handleEvenCustom(void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData * basicData = static_cast<BasicScriptData*>(data);\n    if (NULL == basicData->nativeObject || nullptr == basicData->value )\n        return 0;\n    \n    EventCustom* eventCustom = static_cast<EventCustom*>(basicData->value);\n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)basicData->nativeObject, ScriptHandlerMgr::HandlerType::EVENT_CUSTIOM);\n    \n    if (0 == handler)\n        return 0;\n    \n    lua_State* L = _stack->getLuaState();\n    toluafix_pushusertype_ccobject(L, eventCustom->_ID, &(eventCustom->_luaID), (void*)(eventCustom),\"cc.EventCustom\");\n    int ret = _stack->executeFunctionByHandler(handler, 1);\n    _stack->clean();\n    \n    return ret;\n}\n\nint LuaEngine::handleEvent(ScriptHandlerMgr::HandlerType type,void* data)\n{\n    switch (type)\n    {\n        case ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL:\n        case ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_TOUCHED:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_HIGHLIGHT:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE:\n            {\n                return handleTableViewEvent(type, data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::ASSETSMANAGER_PROGRESS:\n        case ScriptHandlerMgr::HandlerType::ASSETSMANAGER_ERROR:\n        case ScriptHandlerMgr::HandlerType::ASSETSMANAGER_SUCCESS:\n            {\n                return handleAssetsManagerEvent(type, data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER:\n            {\n                return handleStudioEventListener(type, data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::ARMATURE_EVENT:\n            {\n                return handleArmatureWrapper(type, data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::EVENT_ACC:\n            {\n                return handleEventAcc(data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::EVENT_KEYBOARD_PRESSED:\n        case ScriptHandlerMgr::HandlerType::EVENT_KEYBOARD_RELEASED:\n            {\n                return handleEventKeyboard(type,data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::EVENT_CUSTIOM:\n            {\n                return handleEvenCustom(data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_BEGAN:\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_MOVED:\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_ENDED:\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_CANCELLED:\n            {\n                return handleEventTouch(type, data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_BEGAN:\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_MOVED:\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_ENDED:\n        case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_CANCELLED:\n            {\n                return handleEventTouches(type, data);\n            }\n            break;\n        case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_DOWN:\n        case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_UP:\n        case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_MOVE:\n        case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_SCROLL:\n            {\n                return handleEventMouse(type, data);\n            }\n            break;\n        default:\n            break;\n    }\n    \n    return 0;\n}\n\nint LuaEngine::handleEvent(ScriptHandlerMgr::HandlerType type, void* data, int numResults, const std::function<void(lua_State*,int)>& func)\n{\n    switch (type)\n    {\n        case ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_AT_INDEX:\n        case ScriptHandlerMgr::HandlerType::TABLEVIEW_NUMS_OF_CELLS:\n            {\n                return handleTableViewEvent(type, data, numResults,func);\n            }\n            break;\n        default:\n            break;\n    }\n    \n    return 0;\n}\n\nint LuaEngine::handleTableViewEvent(ScriptHandlerMgr::HandlerType type,void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* eventData = static_cast<BasicScriptData*>(data);\n    if (nullptr == eventData->nativeObject || nullptr == eventData->value)\n        return 0;\n    \n    LuaTableViewEventData* tableViewData = static_cast<LuaTableViewEventData*>(eventData->value);\n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)eventData->nativeObject, type);\n    \n    if (0 == handler)\n        return 0;\n    \n    Object* obj = static_cast<Object*>(eventData->nativeObject);\n    if (nullptr == obj)\n        return 0;\n    \n    int ret = 0;\n    switch (type)\n    {\n        case ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL:\n        case ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM:\n        {\n            toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),\"cc.TableView\");\n            ret = _stack->executeFunctionByHandler(handler, 1);\n        }\n            break;\n        case ScriptHandlerMgr::HandlerType::TABLECELL_TOUCHED:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_HIGHLIGHT:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT:\n        case ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE:\n        {\n            Object* cellObject = static_cast<Object*>(tableViewData->value);\n            if (nullptr == cellObject) {\n                break;\n            }\n            toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),\"cc.TableView\");\n            toluafix_pushusertype_ccobject(_stack->getLuaState(), cellObject->_ID, &(cellObject->_luaID), (void*)(cellObject),\"cc.TableViewCell\");\n            ret = _stack->executeFunctionByHandler(handler, 2);\n        }\n            break;\n        default:\n            break;\n    }\n    \n    return ret;\n\n}\n\nint LuaEngine::handleTableViewEvent(ScriptHandlerMgr::HandlerType handlerType,void* data, int numResults, const std::function<void(lua_State*,int)>& func)\n{\n    if (nullptr == data || numResults <= 0)\n        return 0;\n    \n    BasicScriptData* eventData = static_cast<BasicScriptData*>(data);\n    if (nullptr == eventData->nativeObject || nullptr == eventData->value)\n        return 0;\n    \n    LuaTableViewEventData* tableViewData = static_cast<LuaTableViewEventData*>(eventData->value);\n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)eventData->nativeObject, handlerType);\n    \n    if (0 == handler)\n        return 0;\n    \n    Object* obj = static_cast<Object*>(eventData->nativeObject);\n    if (nullptr == obj)\n        return 0;\n    \n    int ret = 0;\n    switch (handlerType)\n    {\n        case ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX:\n        {\n            toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),\"cc.TableView\");\n            _stack->pushLong(*((ssize_t*)tableViewData->value));\n            ret = _stack->executeFunction(handler, 2, 2, func);\n        }\n            break;\n        case ScriptHandlerMgr::HandlerType::TABLECELL_AT_INDEX:\n        {\n            toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),\"cc.TableView\");\n            _stack->pushLong(*((ssize_t*)tableViewData->value));\n            ret = _stack->executeFunction(handler, 2, 1, func);\n        }\n            break;\n        case ScriptHandlerMgr::HandlerType::TABLEVIEW_NUMS_OF_CELLS:\n        {\n            toluafix_pushusertype_ccobject(_stack->getLuaState(), obj->_ID, &(obj->_luaID), (void*)(obj),\"cc.TableView\");\n            ret = _stack->executeFunction(handler, 1, 1, func);\n        }\n            break;\n        default:\n            break;\n    }\n    \n    return ret;\n}\n\nint LuaEngine::handleAssetsManagerEvent(ScriptHandlerMgr::HandlerType type,void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* eventData = static_cast<BasicScriptData*>(data);\n    if (nullptr == eventData->nativeObject || nullptr == eventData->value)\n        return 0;\n    \n    LuaAssetsManagerEventData* assetsManagerData = static_cast<LuaAssetsManagerEventData*>(eventData->value);\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)eventData->nativeObject, type);\n    \n    if (0 == handler)\n        return 0;\n    \n    int ret = 0;\n    switch (type)\n    {\n        case ScriptHandlerMgr::HandlerType::ASSETSMANAGER_PROGRESS:\n        case ScriptHandlerMgr::HandlerType::ASSETSMANAGER_ERROR:\n            {\n                _stack->pushInt(assetsManagerData->value);\n                ret = _stack->executeFunctionByHandler(handler, 1);\n            }\n            break;\n            \n        case ScriptHandlerMgr::HandlerType::ASSETSMANAGER_SUCCESS:\n            {\n                ret = _stack->executeFunctionByHandler(handler, 0);\n            }\n            break;\n            \n        default:\n            break;\n    }\n    \n    return ret;\n}\n\nint LuaEngine::handleStudioEventListener(ScriptHandlerMgr::HandlerType type,void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* eventData = static_cast<BasicScriptData*>(data);\n    if (nullptr == eventData->nativeObject || nullptr == eventData->value)\n        return 0;\n    \n    LuaStudioEventListenerData* listenerData = static_cast<LuaStudioEventListenerData*>(eventData->value);\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)eventData->nativeObject, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n    \n    if (0 == handler)\n        return 0;\n    \n    _stack->pushObject(listenerData->objTarget, \"cc.Object\");\n    _stack->pushInt(listenerData->eventType);\n    \n    _stack->executeFunctionByHandler(handler, 2);\n    _stack->clean();\n    \n    return 0;\n}\n\nint LuaEngine::handleArmatureWrapper(ScriptHandlerMgr::HandlerType type,void* data)\n{\n    if (nullptr == data)\n        return 0;\n    \n    BasicScriptData* eventData = static_cast<BasicScriptData*>(data);\n    if (nullptr == eventData->nativeObject || nullptr == eventData->value)\n        return 0;\n    \n    LuaArmatureWrapperEventData* wrapperData = static_cast<LuaArmatureWrapperEventData*>(eventData->value);\n    \n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)eventData->nativeObject, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n    \n    if (0 == handler)\n        return 0;\n    \n    switch (wrapperData->eventType)\n    {\n        case LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::MOVEMENT_EVENT:\n            {\n                LuaArmatureMovementEventData* movementData = static_cast<LuaArmatureMovementEventData*>(wrapperData->eventData);\n            \n                _stack->pushObject(movementData->objTarget, \"ccs.Armature\");\n                _stack->pushInt(movementData->movementType);\n                _stack->pushString(movementData->movementID.c_str());\n                _stack->executeFunctionByHandler(handler, 3);\n            }\n            break;\n        case LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::FRAME_EVENT:\n            {\n                LuaArmatureFrameEventData* frameData = static_cast<LuaArmatureFrameEventData*>(wrapperData->eventData);\n            \n                _stack->pushObject(frameData->objTarget, \"ccs.Bone\");\n                _stack->pushString(frameData->frameEventName.c_str());\n                _stack->pushInt(frameData->originFrameIndex);\n                _stack->pushInt(frameData->currentFrameIndex);\n                _stack->executeFunctionByHandler(handler, 4);\n            }\n            break;\n        case LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::FILE_ASYNC:\n            {\n                _stack->pushFloat(*(float*)wrapperData->eventData);\n                _stack->executeFunctionByHandler(handler, 1);\n            }\n            break;\n        default:\n            break;\n    }\n    \n    _stack->clean();\n    \n    return 0;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaEngine.h",
    "content": "/****************************************************************************\n Copyright (c) 2012      cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CC_LUA_ENGINE_H__\n#define __CC_LUA_ENGINE_H__\n\nextern \"C\" {\n#include \"lua.h\"\n}\n\n#include \"cocos2d.h\"\n#include \"CCScriptSupport.h\"\n#include \"CCLuaStack.h\"\n#include \"CCLuaValue.h\"\n#include \"LuaScriptHandlerMgr.h\"\n\nNS_CC_BEGIN\n\n// Lua support for cocos2d-x\nclass LuaEngine : public ScriptEngineProtocol\n{\npublic:\n    static LuaEngine* getInstance(void);\n    CC_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); }\n    virtual ~LuaEngine(void);\n    \n    virtual ccScriptType getScriptType() {\n        return kScriptTypeLua;\n    };\n\n    LuaStack *getLuaStack(void) {\n        return _stack;\n    }\n    \n    /**\n     @brief Add a path to find lua files in\n     @param path to be added to the Lua path\n     */\n    virtual void addSearchPath(const char* path);\n    \n    /**\n     @brief Add lua loader, now it is used on android\n     */\n    virtual void addLuaLoader(lua_CFunction func);\n    \n    /**\n     @brief Remove Object from lua state\n     @param object to remove\n     */\n    virtual void removeScriptObjectByObject(Object* object);\n    \n    /**\n     @brief Remove Lua function reference\n     */\n    virtual void removeScriptHandler(int nHandler);\n    \n    /**\n     @brief Reallocate Lua function reference\n     */\n    virtual int reallocateScriptHandler(int nHandler);\n    \n    /**\n     @brief Execute script code contained in the given string.\n     @param codes holding the valid script code that should be executed.\n     @return 0 if the string is excuted correctly.\n     @return other if the string is excuted wrongly.\n     */\n    virtual int executeString(const char* codes);\n    \n    /**\n     @brief Execute a script file.\n     @param filename String object holding the filename of the script file that is to be executed\n     */\n    virtual int executeScriptFile(const char* filename);\n    \n    /**\n     @brief Execute a scripted global function.\n     @brief The function should not take any parameters and should return an integer.\n     @param functionName String object holding the name of the function, in the global script environment, that is to be executed.\n     @return The integer value returned from the script function.\n     */\n    virtual int executeGlobalFunction(const char* functionName);\n\n    virtual int executeNodeEvent(Node* pNode, int nAction);\n    virtual int executeMenuItemEvent(MenuItem* pMenuItem);\n    virtual int executeNotificationEvent(NotificationCenter* pNotificationCenter, const char* pszName);\n    virtual int executeCallFuncActionEvent(CallFunc* pAction, Object* pTarget = NULL);\n    virtual int executeSchedule(int nHandler, float dt, Node* pNode = NULL);\n    virtual int executeLayerTouchesEvent(Layer* pLayer, int eventType, Set *pTouches);\n    virtual int executeLayerTouchEvent(Layer* pLayer, int eventType, Touch *pTouch);\n    virtual int executeLayerKeypadEvent(Layer* pLayer, int eventType);\n    /** execute a accelerometer event */\n    virtual int executeAccelerometerEvent(Layer* pLayer, Acceleration* pAccelerationValue);\n    virtual int executeEvent(int nHandler, const char* pEventName, Object* pEventSource = NULL, const char* pEventSourceClassName = NULL);\n\n    virtual bool handleAssert(const char *msg);\n    \n    virtual bool parseConfig(ConfigType type, const std::string& str) override;\n    virtual int sendEvent(ScriptEvent* message) override;\n    virtual int handleEvent(ScriptHandlerMgr::HandlerType type,void* data);\n    virtual int handleEvent(ScriptHandlerMgr::HandlerType type, void* data, int numResults, const std::function<void(lua_State*,int)>& func);\nprivate:\n    LuaEngine(void)\n    : _stack(NULL)\n    {\n    }\n    bool init(void);\n    int handleNodeEvent(void* data);\n    int handleMenuClickedEvent(void* data);\n    int handleCallFuncActionEvent(void* data);\n    int handleScheduler(void* data);\n    int handleKeypadEvent(void* data);\n    int handleAccelerometerEvent(void* data);\n    int handleCommonEvent(void* data);\n    int handleTouchEvent(void* data);\n    int handleTouchesEvent(void* data);\n    int handlerControlEvent(void* data);\n    int handleEvenCustom(void* data);\n    int handleAssetsManagerEvent(ScriptHandlerMgr::HandlerType type,void* data);\n    int handleTableViewEvent(ScriptHandlerMgr::HandlerType type,void* data);\n    int handleTableViewEvent(ScriptHandlerMgr::HandlerType type,void* data, int numResults, const std::function<void(lua_State*,int)>& func);\n    int handleStudioEventListener(ScriptHandlerMgr::HandlerType type,void* data);\n    int handleArmatureWrapper(ScriptHandlerMgr::HandlerType type,void* data);\n    int handleEventAcc(void* data);\n    int handleEventKeyboard(ScriptHandlerMgr::HandlerType type,void* data);\n    int handleEventTouch(ScriptHandlerMgr::HandlerType type, void* data);\n    int handleEventTouches(ScriptHandlerMgr::HandlerType type, void* data);\n    int handleEventMouse(ScriptHandlerMgr::HandlerType type, void* data);\n    \nprivate:\n    static LuaEngine* _defaultEngine;\n    LuaStack *_stack;\n};\n\nNS_CC_END\n\n#endif // __CC_LUA_ENGINE_H__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaStack.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCLuaStack.h\"\n\nextern \"C\" {\n#include \"lua.h\"\n#include \"tolua++.h\"\n#include \"lualib.h\"\n#include \"lauxlib.h\"\n#include \"tolua_fix.h\"\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n#include \"lua_extensions.h\"\n#endif\n}\n\n#include \"Cocos2dxLuaLoader.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n#include \"platform/ios/CCLuaObjcBridge.h\"\n#endif\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n#include \"platform/android/CCLuaJavaBridge.h\"\n#endif\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n#include \"Lua_web_socket.h\"\n#endif\n#include \"LuaOpengl.h\"\n#include \"LuaScriptHandlerMgr.h\"\n#include \"lua_cocos2dx_auto.hpp\"\n#include \"lua_cocos2dx_extension_auto.hpp\"\n#include \"lua_cocos2dx_manual.hpp\"\n#include \"LuaBasicConversions.h\"\n#include \"lua_cocos2dx_extension_manual.h\"\n#include \"lua_cocos2dx_deprecated.h\"\n#include \"lua_xml_http_request.h\"\n#include \"lua_cocos2dx_studio_auto.hpp\"\n#include \"lua_cocos2dx_coco_studio_manual.hpp\"\n#include \"lua_cocos2dx_spine_auto.hpp\"\n#include \"lua_cocos2dx_spine_manual.hpp\"\n#include \"lua_cocos2dx_physics_auto.hpp\"\n#include \"lua_cocos2dx_physics_manual.hpp\"\n#include \"lua_cocos2dx_gui_auto.hpp\"\n#include \"lua_cocos2dx_gui_manual.hpp\"\n\nnamespace {\nint lua_print(lua_State * luastate)\n{\n    int nargs = lua_gettop(luastate);\n\n    std::string t;\n    for (int i=1; i <= nargs; i++)\n    {\n        if (lua_istable(luastate, i))\n            t += \"table\";\n        else if (lua_isnone(luastate, i))\n            t += \"none\";\n        else if (lua_isnil(luastate, i))\n            t += \"nil\";\n        else if (lua_isboolean(luastate, i))\n        {\n            if (lua_toboolean(luastate, i) != 0)\n                t += \"true\";\n            else\n                t += \"false\";\n        }\n        else if (lua_isfunction(luastate, i))\n            t += \"function\";\n        else if (lua_islightuserdata(luastate, i))\n            t += \"lightuserdata\";\n        else if (lua_isthread(luastate, i))\n            t += \"thread\";\n        else\n        {\n            const char * str = lua_tostring(luastate, i);\n            if (str)\n                t += lua_tostring(luastate, i);\n            else\n                t += lua_typename(luastate, lua_type(luastate, i));\n        }\n        if (i!=nargs)\n            t += \"\\t\";\n    }\n    CCLOG(\"[LUA-print] %s\", t.c_str());\n\n    return 0;\n}\n}  // namespace {\n\nNS_CC_BEGIN\n\nLuaStack::~LuaStack()\n{\n    if (nullptr != _state)\n    {\n        lua_close(_state);\n    }\n}\n\nLuaStack *LuaStack::create(void)\n{\n    LuaStack *stack = new LuaStack();\n    stack->init();\n    stack->autorelease();\n    return stack;\n}\n\nLuaStack *LuaStack::attach(lua_State *L)\n{\n    LuaStack *stack = new LuaStack();\n    stack->initWithLuaState(L);\n    stack->autorelease();\n    return stack;\n}\n\nbool LuaStack::init(void)\n{\n    _state = lua_open();\n    luaL_openlibs(_state);\n    toluafix_open(_state);\n\n    // Register our version of the global \"print\" function\n    const luaL_reg global_functions [] = {\n        {\"print\", lua_print},\n        {NULL, NULL}\n    };\n    luaL_register(_state, \"_G\", global_functions);\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n    luaopen_lua_extensions(_state);\n#endif\n    g_luaType.clear();\n    register_all_cocos2dx(_state);\n    register_all_cocos2dx_extension(_state);\n    register_all_cocos2dx_deprecated(_state);\n    register_cocos2dx_extension_CCBProxy(_state);\n    tolua_opengl_open(_state);\n    register_all_cocos2dx_gui(_state);\n    register_all_cocos2dx_studio(_state);\n    register_all_cocos2dx_manual(_state);\n    register_all_cocos2dx_extension_manual(_state);\n    register_all_cocos2dx_manual_deprecated(_state);\n    register_all_cocos2dx_coco_studio_manual(_state);\n    register_all_cocos2dx_gui_manual(_state);\n    register_all_cocos2dx_spine(_state);\n    register_all_cocos2dx_spine_manual(_state);\n    register_glnode_manual(_state);\n#if CC_USE_PHYSICS\n    register_all_cocos2dx_physics(_state);\n    register_all_cocos2dx_physics_manual(_state);\n#endif\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n    LuaObjcBridge::luaopen_luaoc(_state);\n#endif\n    \n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n    LuaJavaBridge::luaopen_luaj(_state);\n#endif\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n    tolua_web_socket_open(_state);\n    register_web_socket_manual(_state);\n#endif\n    \n    register_xml_http_request(_state);\n    \n    tolua_script_handler_mgr_open(_state);\n    \n    // add cocos2dx loader\n    addLuaLoader(cocos2dx_lua_loader);\n\n    return true;\n}\n\nbool LuaStack::initWithLuaState(lua_State *L)\n{\n    _state = L;\n    return true;\n}\n\nvoid LuaStack::addSearchPath(const char* path)\n{\n    lua_getglobal(_state, \"package\");                                  /* L: package */\n    lua_getfield(_state, -1, \"path\");                /* get package.path, L: package path */\n    const char* cur_path =  lua_tostring(_state, -1);\n    lua_pushfstring(_state, \"%s;%s/?.lua\", cur_path, path);            /* L: package path newpath */\n    lua_setfield(_state, -3, \"path\");          /* package.path = newpath, L: package path */\n    lua_pop(_state, 2);                                                /* L: - */\n}\n\nvoid LuaStack::addLuaLoader(lua_CFunction func)\n{\n    if (!func) return;\n    \n    // stack content after the invoking of the function\n    // get loader table\n    lua_getglobal(_state, \"package\");                                  /* L: package */\n    lua_getfield(_state, -1, \"loaders\");                               /* L: package, loaders */\n    \n    // insert loader into index 2\n    lua_pushcfunction(_state, func);                                   /* L: package, loaders, func */\n    for (int i = lua_objlen(_state, -2) + 1; i > 2; --i)\n    {\n        lua_rawgeti(_state, -2, i - 1);                                /* L: package, loaders, func, function */\n        // we call lua_rawgeti, so the loader table now is at -3\n        lua_rawseti(_state, -3, i);                                    /* L: package, loaders, func */\n    }\n    lua_rawseti(_state, -2, 2);                                        /* L: package, loaders */\n    \n    // set loaders into package\n    lua_setfield(_state, -2, \"loaders\");                               /* L: package */\n    \n    lua_pop(_state, 1);\n}\n\n\nvoid LuaStack::removeScriptObjectByObject(Object* pObj)\n{\n    toluafix_remove_ccobject_by_refid(_state, pObj->_luaID);\n}\n\nvoid LuaStack::removeScriptHandler(int nHandler)\n{\n    toluafix_remove_function_by_refid(_state, nHandler);\n}\n\nint LuaStack::executeString(const char *codes)\n{\n    luaL_loadstring(_state, codes);\n    return executeFunction(0);\n}\n\nint LuaStack::executeScriptFile(const char* filename)\n{\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n    std::string code(\"require \\\"\");\n    code.append(filename);\n    code.append(\"\\\"\");\n    return executeString(code.c_str());\n#else\n    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(filename);\n    ++_callFromLua;\n    int nRet = luaL_dofile(_state, fullPath.c_str());\n    --_callFromLua;\n    CC_ASSERT(_callFromLua >= 0);\n    // lua_gc(_state, LUA_GCCOLLECT, 0);\n    \n    if (nRet != 0)\n    {\n        CCLOG(\"[LUA ERROR] %s\", lua_tostring(_state, -1));\n        lua_pop(_state, 1);\n        return nRet;\n    }\n    return 0;\n#endif\n}\n\nint LuaStack::executeGlobalFunction(const char* functionName)\n{\n    lua_getglobal(_state, functionName);       /* query function by name, stack: function */\n    if (!lua_isfunction(_state, -1))\n    {\n        CCLOG(\"[LUA ERROR] name '%s' does not represent a Lua function\", functionName);\n        lua_pop(_state, 1);\n        return 0;\n    }\n    return executeFunction(0);\n}\n\nvoid LuaStack::clean(void)\n{\n    lua_settop(_state, 0);\n}\n\nvoid LuaStack::pushInt(int intValue)\n{\n    lua_pushinteger(_state, intValue);\n}\n\nvoid LuaStack::pushFloat(float floatValue)\n{\n    lua_pushnumber(_state, floatValue);\n}\n\nvoid LuaStack::pushLong(long longValue)\n{\n    lua_pushnumber(_state, longValue);\n}\n\nvoid LuaStack::pushBoolean(bool boolValue)\n{\n    lua_pushboolean(_state, boolValue);\n}\n\nvoid LuaStack::pushString(const char* stringValue)\n{\n    lua_pushstring(_state, stringValue);\n}\n\nvoid LuaStack::pushString(const char* stringValue, int length)\n{\n    lua_pushlstring(_state, stringValue, length);\n}\n\nvoid LuaStack::pushNil(void)\n{\n    lua_pushnil(_state);\n}\n\nvoid LuaStack::pushObject(Object* objectValue, const char* typeName)\n{\n    toluafix_pushusertype_ccobject(_state, objectValue->_ID, &objectValue->_luaID, objectValue, typeName);\n}\n\nvoid LuaStack::pushLuaValue(const LuaValue& value)\n{\n    const LuaValueType type = value.getType();\n    if (type == LuaValueTypeInt)\n    {\n        return pushInt(value.intValue());\n    }\n    else if (type == LuaValueTypeFloat)\n    {\n        return pushFloat(value.floatValue());\n    }\n    else if (type == LuaValueTypeBoolean)\n    {\n        return pushBoolean(value.booleanValue());\n    }\n    else if (type == LuaValueTypeString)\n    {\n        return pushString(value.stringValue().c_str());\n    }\n    else if (type == LuaValueTypeDict)\n    {\n        pushLuaValueDict(value.dictValue());\n    }\n    else if (type == LuaValueTypeArray)\n    {\n        pushLuaValueArray(value.arrayValue());\n    }\n    else if (type == LuaValueTypeObject)\n    {\n        pushObject(value.ccobjectValue(), value.getObjectTypename().c_str());\n    }\n}\n\nvoid LuaStack::pushLuaValueDict(const LuaValueDict& dict)\n{\n    lua_newtable(_state);                                              /* L: table */\n    for (LuaValueDictIterator it = dict.begin(); it != dict.end(); ++it)\n    {\n        lua_pushstring(_state, it->first.c_str());                     /* L: table key */\n        pushLuaValue(it->second);                                     /* L: table key value */\n        lua_rawset(_state, -3);                     /* table.key = value, L: table */\n    }\n}\n\nvoid LuaStack::pushLuaValueArray(const LuaValueArray& array)\n{\n    lua_newtable(_state);                                              /* L: table */\n    int index = 1;\n    for (LuaValueArrayIterator it = array.begin(); it != array.end(); ++it)\n    {\n        pushLuaValue(*it);                                            /* L: table value */\n        lua_rawseti(_state, -2, index);          /* table[index] = value, L: table */\n        ++index;\n    }\n}\n\nbool LuaStack::pushFunctionByHandler(int nHandler)\n{\n    toluafix_get_function_by_refid(_state, nHandler);                  /* L: ... func */\n    if (!lua_isfunction(_state, -1))\n    {\n        CCLOG(\"[LUA ERROR] function refid '%d' does not reference a Lua function\", nHandler);\n        lua_pop(_state, 1);\n        return false;\n    }\n    return true;\n}\n\nint LuaStack::executeFunction(int numArgs)\n{\n    int functionIndex = -(numArgs + 1);\n    if (!lua_isfunction(_state, functionIndex))\n    {\n        CCLOG(\"value at stack [%d] is not function\", functionIndex);\n        lua_pop(_state, numArgs + 1); // remove function and arguments\n        return 0;\n    }\n\n    int traceback = 0;\n    lua_getglobal(_state, \"__G__TRACKBACK__\");                         /* L: ... func arg1 arg2 ... G */\n    if (!lua_isfunction(_state, -1))\n    {\n        lua_pop(_state, 1);                                            /* L: ... func arg1 arg2 ... */\n    }\n    else\n    {\n        lua_insert(_state, functionIndex - 1);                         /* L: ... G func arg1 arg2 ... */\n        traceback = functionIndex - 1;\n    }\n    \n    int error = 0;\n    ++_callFromLua;\n    error = lua_pcall(_state, numArgs, 1, traceback);                  /* L: ... [G] ret */\n    --_callFromLua;\n    if (error)\n    {\n        if (traceback == 0)\n        {\n            CCLOG(\"[LUA ERROR] %s\", lua_tostring(_state, - 1));        /* L: ... error */\n            lua_pop(_state, 1); // remove error message from stack\n        }\n        else                                                            /* L: ... G error */\n        {\n            lua_pop(_state, 2); // remove __G__TRACKBACK__ and error message from stack\n        }\n        return 0;\n    }\n    \n    // get return value\n    int ret = 0;\n    if (lua_isnumber(_state, -1))\n    {\n        ret = lua_tointeger(_state, -1);\n    }\n    else if (lua_isboolean(_state, -1))\n    {\n        ret = lua_toboolean(_state, -1);\n    }\n    // remove return value from stack\n    lua_pop(_state, 1);                                                /* L: ... [G] */\n    \n    if (traceback)\n    {\n        lua_pop(_state, 1); // remove __G__TRACKBACK__ from stack      /* L: ... */\n    }\n    \n    return ret;\n}\n\nint LuaStack::executeFunctionByHandler(int nHandler, int numArgs)\n{\n    int ret = 0;\n    if (pushFunctionByHandler(nHandler))                                /* L: ... arg1 arg2 ... func */\n    {\n        if (numArgs > 0)\n        {\n            lua_insert(_state, -(numArgs + 1));                        /* L: ... func arg1 arg2 ... */\n        }\n        ret = executeFunction(numArgs);\n    }\n    lua_settop(_state, 0);\n    return ret;\n}\n\nbool LuaStack::handleAssert(const char *msg)\n{\n    if (_callFromLua == 0) return false;\n    \n    lua_pushfstring(_state, \"ASSERT FAILED ON LUA EXECUTE: %s\", msg ? msg : \"unknown\");\n    lua_error(_state);\n    return true;\n}\n\nint LuaStack::reallocateScriptHandler(int nHandler)\n{\n    LUA_FUNCTION  nNewHandle = -1;\n    \n    if (pushFunctionByHandler(nHandler))\n    {\n       nNewHandle = toluafix_ref_function(_state,lua_gettop(_state),0);\n    }\n/*\n    toluafix_get_function_by_refid(_state,nNewHandle);\n    if (!lua_isfunction(_state, -1))\n    {\n        CCLOG(\"Error!\");\n    }\n    lua_settop(_state, 0);\n*/\n    return nNewHandle;\n\n}\n\nint LuaStack::executeFunctionReturnArray(int handler,int numArgs,int numResults,Array& resultArray)\n{\n    if (pushFunctionByHandler(handler))                 /* L: ... arg1 arg2 ... func */\n    {\n        if (numArgs > 0)\n        {\n            lua_insert(_state, -(numArgs + 1));         /* L: ... func arg1 arg2 ... */\n            int functionIndex = -(numArgs + 1);\n            if (!lua_isfunction(_state, functionIndex))\n            {\n                CCLOG(\"value at stack [%d] is not function\", functionIndex);\n                lua_pop(_state, numArgs + 1); // remove function and arguments\n                return 0;\n            }\n            \n            int traceback = 0;\n            lua_getglobal(_state, \"__G__TRACKBACK__\");                         /* L: ... func arg1 arg2 ... G */\n            if (!lua_isfunction(_state, -1))\n            {\n                lua_pop(_state, 1);                                            /* L: ... func arg1 arg2 ... */\n            }\n            else\n            {\n                lua_insert(_state, functionIndex - 1);                         /* L: ... G func arg1 arg2 ... */\n                traceback = functionIndex - 1;\n            }\n            \n            int error = 0;\n            ++_callFromLua;\n            error = lua_pcall(_state, numArgs, numResults, traceback);                  /* L: ... [G] ret1 ret2 ... retResults*/\n            --_callFromLua;\n            if (error)\n            {\n                if (traceback == 0)\n                {\n                    CCLOG(\"[LUA ERROR] %s\", lua_tostring(_state, - 1));        /* L: ... error */\n                    lua_pop(_state, 1); // remove error message from stack\n                }\n                else                                                            /* L: ... G error */\n                {\n                    lua_pop(_state, 2); // remove __G__TRACKBACK__ and error message from stack\n                }\n                return 0;\n            }\n            \n            // get return value,don't pass LUA_MULTRET to numResults,\n            if (numResults <= 0)\n                return 0;\n            \n            for (int i = 0 ; i < numResults; i++)\n            {\n                if (lua_type(_state, -1) == LUA_TBOOLEAN) {\n                    \n                    bool value = lua_toboolean(_state, -1);\n                    resultArray.addObject(Bool::create(value)) ;\n                    \n                }else if (lua_type(_state, -1) == LUA_TNUMBER) {\n                    \n                    double value = lua_tonumber(_state, -1);\n                    resultArray.addObject(Double::create(value));\n                    \n                }else if (lua_type(_state, -1) == LUA_TSTRING) {\n                    \n                    const char* value = lua_tostring(_state, -1);\n                    resultArray.addObject(String::create(value));\n                    \n                }else{\n                    \n                    resultArray.addObject(static_cast<Object*>(tolua_tousertype(_state, -1, NULL)));\n                }\n                // remove return value from stack\n                lua_pop(_state, 1);                                                /* L: ... [G] ret1 ret2 ... ret*/\n            }\n            /* L: ... [G]*/\n            \n            if (traceback)\n            {\n                lua_pop(_state, 1); // remove __G__TRACKBACK__ from stack      /* L: ... */\n            }\n        }\n    }\n    lua_settop(_state, 0);\n    return 1;\n}\n\nint LuaStack::executeFunction(int handler, int numArgs, int numResults, const std::function<void(lua_State*,int)>& func)\n{\n    if (pushFunctionByHandler(handler))                 /* L: ... arg1 arg2 ... func */\n    {\n        if (numArgs > 0)\n        {\n            lua_insert(_state, -(numArgs + 1));                        /* L: ... func arg1 arg2 ... */\n        }\n        \n        int functionIndex = -(numArgs + 1);\n        \n        if (!lua_isfunction(_state, functionIndex))\n        {\n            CCLOG(\"value at stack [%d] is not function\", functionIndex);\n            lua_pop(_state, numArgs + 1); // remove function and arguments\n            return 0;\n        }\n        \n        int traceCallback = 0;\n        lua_getglobal(_state, \"__G__TRACKBACK__\");                        /* L: ... func arg1 arg2 ... G */\n        if (!lua_isfunction(_state, -1))\n        {\n            lua_pop(_state, 1);                                           /* L: ... func arg1 arg2 ... */\n        }\n        else\n        {\n            lua_insert(_state, functionIndex - 1);                         /* L: ... G func arg1 arg2 ... */\n            traceCallback = functionIndex - 1;\n        }\n        \n        int error = 0;\n        ++_callFromLua;\n        error = lua_pcall(_state, numArgs, numResults, traceCallback);     /* L: ... [G] ret1 ret2 ... retResults*/\n        --_callFromLua;\n        \n        if (error)\n        {\n            if (traceCallback == 0)\n            {\n                CCLOG(\"[LUA ERROR] %s\", lua_tostring(_state, - 1));        /* L: ... error */\n                lua_pop(_state, 1);                                        // remove error message from stack\n            }\n            else                                                           /* L: ... G error */\n            {\n                lua_pop(_state, 2);                                        // remove __G__TRACKBACK__ and error message from stack\n            }\n            return 0;\n        }\n        \n        // get return value,don't pass LUA_MULTRET to numResults,\n        do {\n            \n            if (numResults <= 0 || nullptr == func)\n                break;\n            \n            func(_state, numResults);\n            \n        } while (0);\n        \n        if (traceCallback)\n        {\n            lua_pop(_state, 1);                                          // remove __G__TRACKBACK__ from stack      /* L: ... */\n        }\n    }\n    \n    return 1;\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaStack.h",
    "content": "/****************************************************************************\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CC_LUA_STACK_H_\n#define __CC_LUA_STACK_H_\n\nextern \"C\" {\n#include \"lua.h\"\n}\n\n#include \"cocos2d.h\"\n#include \"CCLuaValue.h\"\n\nNS_CC_BEGIN\n\nclass LuaStack : public Object\n{\npublic:\n    static LuaStack *create(void);\n    static LuaStack *attach(lua_State *L);\n    \n    virtual ~LuaStack();\n    \n    /**\n     @brief Method used to get a pointer to the lua_State that the script module is attached to.\n     @return A pointer to the lua_State that the script module is attached to.\n     */\n    lua_State* getLuaState(void) {\n        return _state;\n    }\n    \n    /**\n     @brief Add a path to find lua files in\n     @param path to be added to the Lua path\n     */\n    virtual void addSearchPath(const char* path);\n    \n    /**\n     @brief Add lua loader, now it is used on android\n     */\n    virtual void addLuaLoader(lua_CFunction func);\n    \n    /**\n     @brief Remove Object from lua state\n     @param object The object to be removed.\n     */\n    virtual void removeScriptObjectByObject(Object* object);\n    \n    /**\n     @brief Remove Lua function reference\n     */\n    virtual void removeScriptHandler(int nHandler);\n    \n    /**\n     @brief Remove Lua function reference\n     */\n    virtual int reallocateScriptHandler(int nHandler);\n    \n    /**\n     @brief Execute script code contained in the given string.\n     @param codes holding the valid script code that should be executed.\n     @return 0 if the string is excuted correctly.\n     @return other if the string is excuted wrongly.\n     */\n    virtual int executeString(const char* codes);\n    \n    /**\n     @brief Execute a script file.\n     @param filename String object holding the filename of the script file that is to be executed\n     */\n    virtual int executeScriptFile(const char* filename);\n\n    /**\n     @brief Execute a scripted global function.\n     @brief The function should not take any parameters and should return an integer.\n     @param functionName String object holding the name of the function, in the global script environment, that is to be executed.\n     @return The integer value returned from the script function.\n     */\n    virtual int executeGlobalFunction(const char* functionName);\n\n    virtual void clean(void);\n    virtual void pushInt(int intValue);\n    virtual void pushFloat(float floatValue);\n    virtual void pushLong(long longValue);\n    virtual void pushBoolean(bool boolValue);\n    virtual void pushString(const char* stringValue);\n    virtual void pushString(const char* stringValue, int length);\n    virtual void pushNil(void);\n    virtual void pushObject(Object* objectValue, const char* typeName);\n    virtual void pushLuaValue(const LuaValue& value);\n    virtual void pushLuaValueDict(const LuaValueDict& dict);\n    virtual void pushLuaValueArray(const LuaValueArray& array);    \n    virtual bool pushFunctionByHandler(int nHandler);\n    virtual int executeFunction(int numArgs);\n    \n    virtual int executeFunctionByHandler(int nHandler, int numArgs);\n    virtual int executeFunctionReturnArray(int handler,int numArgs,int numResults,Array& resultArray);\n    virtual int executeFunction(int handler, int numArgs, int numResults, const std::function<void(lua_State*,int)>& func);\n\n    virtual bool handleAssert(const char *msg);\n    \nprotected:\n    LuaStack(void)\n    : _state(NULL)\n    , _callFromLua(0)\n    {\n    }\n    \n    bool init(void);\n    bool initWithLuaState(lua_State *L);\n    \n    lua_State *_state;\n    int _callFromLua;\n};\n\nNS_CC_END\n\n#endif // __CC_LUA_STACK_H_\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaValue.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCLuaValue.h\"\n\n\nNS_CC_BEGIN\n\nconst LuaValue LuaValue::intValue(const int intValue)\n{\n    LuaValue value;\n    value._type = LuaValueTypeInt;\n    value._field.intValue = intValue;\n    return value;\n}\n\nconst LuaValue LuaValue::floatValue(const float floatValue)\n{\n    LuaValue value;\n    value._type = LuaValueTypeFloat;\n    value._field.floatValue = floatValue;\n    return value;\n}\n\nconst LuaValue LuaValue::booleanValue(const bool booleanValue)\n{\n    LuaValue value;\n    value._type = LuaValueTypeBoolean;\n    value._field.booleanValue = booleanValue;\n    return value;\n}\n\nconst LuaValue LuaValue::stringValue(const char* stringValue)\n{\n    LuaValue value;\n    value._type = LuaValueTypeString;\n    value._field.stringValue = new std::string(stringValue ? stringValue : \"\");\n    return value;\n}\n\nconst LuaValue LuaValue::stringValue(const std::string& stringValue)\n{\n    LuaValue value;\n    value._type = LuaValueTypeString;\n    value._field.stringValue = new std::string(stringValue);\n    return value;\n}\n\nconst LuaValue LuaValue::dictValue(const LuaValueDict& dictValue)\n{\n    LuaValue value;\n    value._type = LuaValueTypeDict;\n    value._field.dictValue = new LuaValueDict(dictValue);\n    return value;\n}\n\nconst LuaValue LuaValue::arrayValue(const LuaValueArray& arrayValue)\n{\n    LuaValue value;\n    value._type = LuaValueTypeArray;\n    value._field.arrayValue = new LuaValueArray(arrayValue);\n    return value;\n}\n\nconst LuaValue LuaValue::ccobjectValue(Object* ccobjectValue, const char* objectTypename)\n{\n    LuaValue value;\n    value._type = LuaValueTypeObject;\n    value._field.ccobjectValue = ccobjectValue;\n    ccobjectValue->retain();\n    value._ccobjectType = new std::string(objectTypename);\n    return value;\n}\n\nconst LuaValue LuaValue::ccobjectValue(Object* ccobjectValue, const std::string& objectTypename)\n{\n    return LuaValue::ccobjectValue(ccobjectValue, objectTypename.c_str());\n}\n\nLuaValue::LuaValue(const LuaValue& rhs)\n{\n    copy(rhs);\n}\n\nLuaValue& LuaValue::operator=(const LuaValue& rhs)\n{\n    if (this != &rhs) copy(rhs);\n    return *this;\n}\n\nLuaValue::~LuaValue(void)\n{\n    if (_type == LuaValueTypeString)\n    {\n        delete _field.stringValue;\n    }\n    else if (_type == LuaValueTypeDict)\n    {\n        delete _field.dictValue;\n    }\n    else if (_type == LuaValueTypeArray)\n    {\n        delete _field.arrayValue;\n    }\n    else if (_type == LuaValueTypeObject)\n    {\n        _field.ccobjectValue->release();\n        delete _ccobjectType;\n    }\n}\n\nvoid LuaValue::copy(const LuaValue& rhs)\n{\n    memcpy(&_field, &rhs._field, sizeof(_field));\n    _type = rhs._type;\n    if (_type == LuaValueTypeString)\n    {\n        _field.stringValue = new std::string(*rhs._field.stringValue);\n    }\n    else if (_type == LuaValueTypeDict)\n    {\n        _field.dictValue = new LuaValueDict(*rhs._field.dictValue);\n    }\n    else if (_type == LuaValueTypeArray)\n    {\n        _field.arrayValue = new LuaValueArray(*rhs._field.arrayValue);\n    }\n    else if (_type == LuaValueTypeObject)\n    {\n        _field.ccobjectValue = rhs._field.ccobjectValue;\n        _field.ccobjectValue->retain();\n        _ccobjectType = new std::string(*rhs._ccobjectType);\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/CCLuaValue.h",
    "content": "/****************************************************************************\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CC_LUA_VALUE_H_\n#define __CC_LUA_VALUE_H_\n\n#include <string>\n#include <map>\n#include <list>\n\nextern \"C\" {\n#include \"lua.h\"\n}\n\n#include \"ccTypes.h\"\n#include \"CCObject.h\"\n\n#if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY\nusing std::memset;\nusing std::memcpy;\n#endif\n\nNS_CC_BEGIN\n\ntypedef int LUA_FUNCTION;\ntypedef int LUA_TABLE;\ntypedef int LUA_STRING;\n\nclass LuaValue;\n\ntypedef std::map<std::string, LuaValue>   LuaValueDict;\ntypedef LuaValueDict::const_iterator      LuaValueDictIterator;\ntypedef std::list<LuaValue>               LuaValueArray;\ntypedef LuaValueArray::const_iterator     LuaValueArrayIterator;\n\ntypedef enum {\n    LuaValueTypeInt,\n    LuaValueTypeFloat,\n    LuaValueTypeBoolean,\n    LuaValueTypeString,\n    LuaValueTypeDict,\n    LuaValueTypeArray,\n    LuaValueTypeObject\n} LuaValueType;\n\ntypedef union {\n    int                 intValue;\n    float               floatValue;\n    bool                booleanValue;\n    std::string*        stringValue;\n    LuaValueDict*     dictValue;\n    LuaValueArray*    arrayValue;\n    Object*           ccobjectValue;\n} LuaValueField;\n\nclass LuaValue\n{\npublic:\n    static const LuaValue intValue(const int intValue);\n    static const LuaValue floatValue(const float floatValue);\n    static const LuaValue booleanValue(const bool booleanValue);\n    static const LuaValue stringValue(const char* stringValue);\n    static const LuaValue stringValue(const std::string& stringValue);\n    static const LuaValue dictValue(const LuaValueDict& dictValue);\n    static const LuaValue arrayValue(const LuaValueArray& arrayValue);\n    static const LuaValue ccobjectValue(Object* ccobjectValue, const char* objectTypename);\n    static const LuaValue ccobjectValue(Object* ccobjectValue, const std::string& objectTypename);\n    \n    LuaValue(void)\n    : _type(LuaValueTypeInt)\n    , _ccobjectType(NULL)\n    {\n        memset(&_field, 0, sizeof(_field));\n    }\n    LuaValue(const LuaValue& rhs);\n    LuaValue& operator=(const LuaValue& rhs);\n    ~LuaValue(void);\n    \n    const LuaValueType getType(void) const {\n        return _type;\n    }\n    \n    const std::string& getObjectTypename(void) const {\n        return *_ccobjectType;\n    }\n    \n    int intValue(void) const {\n        return _field.intValue;\n    }\n    \n    float floatValue(void) const {\n        return _field.floatValue;\n    }\n    \n    bool booleanValue(void) const {\n        return _field.booleanValue;\n    }\n    \n    const std::string& stringValue(void) const {\n        return *_field.stringValue;\n    }\n    \n    const LuaValueDict& dictValue(void) const {\n        return *_field.dictValue;\n    }\n    \n    const LuaValueArray& arrayValue(void) const {\n        return *_field.arrayValue;\n    }\n    \n    Object* ccobjectValue(void) const {\n        return _field.ccobjectValue;\n    }\n    \nprivate:\n    LuaValueField _field;\n    LuaValueType  _type;\n    std::string*    _ccobjectType;\n    \n    void copy(const LuaValue& rhs);\n};\n\nNS_CC_END\n\n#endif // __CC_LUA_VALUE_H_\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2011-2012 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"Cocos2dxLuaLoader.h\"\n#include <string>\n#include <algorithm>\n\nusing namespace cocos2d;\n\nextern \"C\"\n{\n    int cocos2dx_lua_loader(lua_State *L)\n    {\n        std::string filename(luaL_checkstring(L, 1));\n        size_t pos = filename.rfind(\".lua\");\n        if (pos != std::string::npos)\n        {\n            filename = filename.substr(0, pos);\n        }\n        \n        pos = filename.find_first_of(\".\");\n        while (pos != std::string::npos)\n        {\n            filename.replace(pos, 1, \"/\");\n            pos = filename.find_first_of(\".\");\n        }\n        filename.append(\".lua\");\n        \n        Data data = FileUtils::getInstance()->getDataFromFile(filename);\n        \n        if (!data.isNull())\n        {\n            if (luaL_loadbuffer(L, (char*)data.getBytes(), data.getSize(), filename.c_str()) != 0)\n            {\n                luaL_error(L, \"error loading module %s from file %s :\\n\\t%s\",\n                    lua_tostring(L, 1), filename.c_str(), lua_tostring(L, -1));\n            }\n        }\n        else\n        {\n            log(\"can not get file data of %s\", filename.c_str());\n        }\n        \n        return 1;\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h",
    "content": "/****************************************************************************\nCopyright (c) 2011-2012 cocos2d-x.org\nCopyright (c) 2013-2014 Chukong Technologies Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __COCOS2DX_LUA_LOADER_H__\n#define __COCOS2DX_LUA_LOADER_H__\n\n#include \"cocos2d.h\"\n\nextern \"C\"\n{\n#include \"lua.h\"\n#include \"lualib.h\"\n#include \"lauxlib.h\"\n\nextern int cocos2dx_lua_loader(lua_State *L);\n}\n\n#endif // __COCOS2DX_LUA_LOADER_H__"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaBasicConversions.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"LuaBasicConversions.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\nstd::unordered_map<std::string, std::string>  g_luaType;\nstd::unordered_map<std::string, std::string>  g_typeCast;\n\n#if COCOS2D_DEBUG >=1\nvoid luaval_to_native_err(lua_State* L,const char* msg,tolua_Error* err)\n{\n    if (NULL == L || NULL == err || NULL == msg || 0 == strlen(msg))\n        return;\n\n    if (msg[0] == '#')\n    {\n        const char* expected = err->type;\n        const char* provided = tolua_typename(L,err->index);\n        if (msg[1]=='f')\n        {\n            int narg = err->index;\n            if (err->array)\n                CCLOG(\"%s\\n     argument #%d is array of '%s'; array of '%s' expected.\\n\",msg+2,narg,provided,expected);\n            else\n                CCLOG(\"%s\\n     argument #%d is '%s'; '%s' expected.\\n\",msg+2,narg,provided,expected);\n        }\n        else if (msg[1]=='v')\n        {\n            if (err->array)\n                CCLOG(\"%s\\n     value is array of '%s'; array of '%s' expected.\\n\",msg+2,provided,expected);\n            else\n                CCLOG(\"%s\\n     value is '%s'; '%s' expected.\\n\",msg+2,provided,expected);\n        }\n    }\n}\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nextern int lua_isusertype (lua_State* L, int lo, const char* type);\n#ifdef __cplusplus\n}\n#endif\n\nbool luaval_is_usertype(lua_State* L,int lo,const char* type, int def)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return true;\n    \n    if (lua_isnil(L,lo) || lua_isusertype(L,lo,type))\n        return true;\n    \n    return false;\n}\n\nbool luaval_to_ushort(lua_State* L, int lo, unsigned short* outValue)\n{\n    if (nullptr == L || nullptr == outValue)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (unsigned short)tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\n\nbool luaval_to_int32(lua_State* L,int lo,int* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (int)tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_uint32(lua_State* L, int lo, unsigned int* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (unsigned int)tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_uint16(lua_State* L,int lo,uint16_t* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (unsigned char)tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_boolean(lua_State* L,int lo,bool* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_isboolean(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (bool)tolua_toboolean(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_number(lua_State* L,int lo,double* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_long_long(lua_State* L,int lo,long long* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (long long)tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_std_string(lua_State* L, int lo, std::string* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_iscppstring(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = tolua_tocppstring(L,lo,NULL);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_point(lua_State* L,int lo,Point* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n\n    \n    if (ok)\n    {\n        lua_pushstring(L, \"x\");\n        lua_gettable(L, lo);\n        outValue->x = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);\n        lua_pop(L, 1);\n        \n        lua_pushstring(L, \"y\");\n        lua_gettable(L, lo);\n        outValue->y = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);\n        lua_pop(L, 1);\n    }\n    return ok;\n}\n\nbool luaval_to_physics_material(lua_State* L,int lo,PhysicsMaterial* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    \n    if (ok)\n    {\n        lua_pushstring(L, \"density\");\n        lua_gettable(L, lo);\n        outValue->density = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);\n        lua_pop(L, 1);\n        \n        lua_pushstring(L, \"restitution\");\n        lua_gettable(L, lo);\n        outValue->restitution = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);\n        lua_pop(L, 1);\n        \n        lua_pushstring(L, \"friction\");\n        lua_gettable(L, lo);\n        outValue->friction = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1);\n        lua_pop(L, 1);\n    }\n    return ok;\n}\n\nbool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue)\n{\n    return luaval_to_long(L, lo, reinterpret_cast<long*>(outValue));\n}\n\nbool luaval_to_long(lua_State* L,int lo, long* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (long)tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_ulong(lua_State* L,int lo, unsigned long* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n    if (!tolua_isnumber(L,lo,0,&tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        *outValue = (unsigned long)tolua_tonumber(L, lo, 0);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_size(lua_State* L,int lo,Size* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        lua_pushstring(L, \"width\");  /* L: paramStack key */\n        lua_gettable(L,lo);/* L: paramStack paramStack[lo][key] */\n        outValue->width = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);/* L: paramStack*/\n        \n        lua_pushstring(L, \"height\");\n        lua_gettable(L,lo);\n        outValue->height = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_rect(lua_State* L,int lo,Rect* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        lua_pushstring(L, \"x\");\n        lua_gettable(L,lo);\n        outValue->origin.x = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"y\");\n        lua_gettable(L,lo);\n        outValue->origin.y = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"width\");\n        lua_gettable(L,lo);\n        outValue->size.width = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"height\");\n        lua_gettable(L,lo);\n        outValue->size.height = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_color4b(lua_State* L,int lo,Color4B* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if(ok)\n    {\n        lua_pushstring(L, \"r\");\n        lua_gettable(L,lo);\n        outValue->r = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"g\");\n        lua_gettable(L,lo);\n        outValue->g = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"b\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"a\");\n        lua_gettable(L,lo);\n        outValue->a = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        lua_pushstring(L, \"r\");\n        lua_gettable(L,lo);\n        outValue->r = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"g\");\n        lua_gettable(L,lo);\n        outValue->g = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"b\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"a\");\n        lua_gettable(L,lo);\n        outValue->a = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        lua_pushstring(L, \"r\");\n        lua_gettable(L,lo);\n        outValue->r = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"g\");\n        lua_gettable(L,lo);\n        outValue->g = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"b\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n    }\n    \n    return ok;\n}\n\nbool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        lua_pushstring(L, \"a\");\n        lua_gettable(L,lo);\n        outValue->a = lua_isnil(L,-1) ? 0 : (float)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"b\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : (float)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"c\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : (float)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"d\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : (float)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"tx\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : (float)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"ty\");\n        lua_gettable(L,lo);\n        outValue->b = lua_isnil(L,-1) ? 0 : (float)lua_tonumber(L,-1);\n        lua_pop(L,1);\n    }\n    return ok;\n}\n\nbool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue )\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n        ok = false;\n#endif\n    }\n    \n    if (ok)\n    {\n        // defaul values\n        const char *            defautlFontName         = \"Arial\";\n        const int               defaultFontSize         = 32;\n        TextHAlignment          defaultTextAlignment    = TextHAlignment::LEFT;\n        TextVAlignment          defaultTextVAlignment   = TextVAlignment::TOP;\n        \n        // by default shadow and stroke are off\n        outValue->_shadow._shadowEnabled = false;\n        outValue->_stroke._strokeEnabled = false;\n        \n        // white text by default\n        outValue->_fontFillColor = Color3B::WHITE;\n        \n        lua_pushstring(L, \"fontName\");\n        lua_gettable(L,lo);\n        outValue->_fontName = tolua_tocppstring(L,lo,defautlFontName);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"fontSize\");\n        lua_gettable(L,lo);\n        outValue->_fontSize = lua_isnil(L,-1) ? defaultFontSize : (int)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"fontAlignmentH\");\n        lua_gettable(L,lo);\n        outValue->_alignment = lua_isnil(L,-1) ? defaultTextAlignment : (TextHAlignment)(int)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"fontAlignmentV\");\n        lua_gettable(L,lo);\n        outValue->_vertAlignment = lua_isnil(L,-1) ? defaultTextVAlignment : (TextVAlignment)(int)lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"fontFillColor\");\n        lua_gettable(L,lo);\n        if (!lua_isnil(L,-1))\n        {\n            luaval_to_color3b(L, -1, &outValue->_fontFillColor);\n        }\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"fontDimensions\");\n        lua_gettable(L,lo);\n        if (!lua_isnil(L,-1))\n        {\n            luaval_to_size(L, -1, &outValue->_dimensions);\n        }\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"shadowEnabled\");\n        lua_gettable(L,lo);\n        if (!lua_isnil(L,-1))\n        {\n            luaval_to_boolean(L, -1, &outValue->_shadow._shadowEnabled);\n            if (outValue->_shadow._shadowEnabled)\n            {\n                // default shadow values\n                outValue->_shadow._shadowOffset  = Size(5, 5);\n                outValue->_shadow._shadowBlur    = 1;\n                outValue->_shadow._shadowOpacity = 1;\n            }\n            \n            lua_pushstring(L, \"shadowOffset\");\n            lua_gettable(L,lo);\n            if (!lua_isnil(L,-1))\n            {\n                luaval_to_size(L, -1, &outValue->_shadow._shadowOffset);                \n            }\n            lua_pop(L,1);\n            \n            lua_pushstring(L, \"shadowBlur\");\n            lua_gettable(L,lo);\n            if (!lua_isnil(L,-1))\n            {\n               outValue->_shadow._shadowBlur = (float)lua_tonumber(L,-1);\n            }\n            lua_pop(L,1);\n            \n            lua_pushstring(L, \"shadowOpacity\");\n            lua_gettable(L,lo);\n            if (!lua_isnil(L,-1))\n            {\n                outValue->_shadow._shadowOpacity = lua_tonumber(L,-1);\n            }\n            lua_pop(L,1);\n        }\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"strokeEnabled\");\n        lua_gettable(L,lo);\n        if (!lua_isnil(L,-1))\n        {\n            luaval_to_boolean(L, -1, &outValue->_stroke._strokeEnabled);\n            if (outValue->_stroke._strokeEnabled)\n            {\n                // default stroke values\n                outValue->_stroke._strokeSize  = 1;\n                outValue->_stroke._strokeColor = Color3B::BLUE;\n                \n                lua_pushstring(L, \"strokeColor\");\n                lua_gettable(L,lo);\n                if (!lua_isnil(L,-1))\n                {\n                     luaval_to_color3b(L, -1, &outValue->_stroke._strokeColor);\n                }\n                lua_pop(L,1);\n                \n                lua_pushstring(L, \"strokeSize\");\n                lua_gettable(L,lo);\n                if (!lua_isnil(L,-1))\n                {\n                    outValue->_stroke._strokeSize = (float)lua_tonumber(L,-1);\n                }\n                lua_pop(L,1);\n            }\n        }\n        lua_pop(L,1);\n    }\n\n    \n    return ok;\n}\n\nbool luaval_to_array(lua_State* L,int lo, Array** outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        size_t len = lua_objlen(L, lo);\n        if (len > 0)\n        {\n            Array* arr =  Array::createWithCapacity(len);\n            if (NULL == arr)\n                return false;\n            \n            for (int i = 0; i < len; i++)\n            {\n                lua_pushnumber(L,i + 1);\n                lua_gettable(L,lo);\n                if (lua_isnil(L,-1))\n                {\n                    lua_pop(L, 1);\n                    continue;\n                }\n                \n                if (lua_isuserdata(L, -1))\n                {\n                    Object* obj = static_cast<Object*>(tolua_tousertype(L, -1, NULL) );\n                    if (NULL != obj)\n                    {\n                        arr->addObject(obj);\n                    }\n                }\n                else if(lua_istable(L, -1))\n                {\n                    lua_pushnumber(L,1);\n                    lua_gettable(L,-2);\n                    if (lua_isnil(L, -1) )\n                    {\n                        lua_pop(L,1);\n                        Dictionary* dictVal = NULL;\n                        if (luaval_to_dictionary(L,-1,&dictVal))\n                        {\n                            arr->addObject(dictVal);\n                        }\n                    }\n                    else\n                    {\n                       lua_pop(L,1);\n                       Array* arrVal = NULL;\n                       if(luaval_to_array(L, -1, &arrVal))\n                       {\n                           arr->addObject(arrVal);\n                       }\n                    }\n                }\n                else if(lua_isstring(L, -1))\n                {\n                    std::string stringValue = \"\";\n                    if(luaval_to_std_string(L, -1, &stringValue) )\n                    {\n                        arr->addObject(String::create(stringValue));\n                    }\n                }\n                else if(lua_isboolean(L, -1))\n                {\n                    bool boolVal = false;\n                    if (luaval_to_boolean(L, -1, &boolVal))\n                    {\n                        arr->addObject(Bool::create(boolVal));\n                    }\n                }\n                else if(lua_isnumber(L, -1))\n                {\n                    arr->addObject(Double::create(tolua_tonumber(L, -1, 0)));\n                }\n                else\n                {\n                    CCASSERT(false, \"not supported type\");\n                }\n                lua_pop(L, 1);\n            }\n            \n            *outValue = arr;\n        }\n    }\n    \n    return ok;\n}\n\nbool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue)\n{\n    if (NULL == L || NULL == outValue)\n        return  false;\n    \n    bool ok = true;\n\n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        std::string stringKey = \"\";\n        std::string stringValue = \"\";\n        bool boolVal = false;\n        Dictionary* dict = NULL;\n        lua_pushnil(L);                                             /* L: lotable ..... nil */\n        while ( 0 != lua_next(L, lo ) )                             /* L: lotable ..... key value */\n        {\n            if (!lua_isstring(L, -2))\n            {\n                lua_pop(L, 1);\n                continue;\n            }\n            \n            if (NULL == dict)\n            {\n                dict = Dictionary::create();\n            }\n            \n            if(luaval_to_std_string(L, -2, &stringKey))\n            {\n                if (lua_isuserdata(L, -1))\n                {\n                    Object* obj = static_cast<Object*>(tolua_tousertype(L, -1, NULL) );\n                    if (NULL != obj)\n                    {\n                        //get the key to string\n                        dict->setObject(obj, stringKey);\n                    }\n                }\n                else if(lua_istable(L, -1))\n                {\n                    lua_pushnumber(L,1);\n                    lua_gettable(L,-2);\n                    if (lua_isnil(L, -1) )\n                    {\n                        lua_pop(L,1);\n                        Dictionary* dictVal = NULL;\n                        if (luaval_to_dictionary(L,-1,&dictVal))\n                        {\n                            dict->setObject(dictVal,stringKey);\n                        }\n                    }\n                    else\n                    {\n                        lua_pop(L,1);\n                        Array* arrVal = NULL;\n                        if(luaval_to_array(L, -1, &arrVal))\n                        {\n                            dict->setObject(arrVal,stringKey);\n                        }\n                    }\n                }\n                else if(lua_isstring(L, -1))\n                {\n                    if(luaval_to_std_string(L, -1, &stringValue))\n                    {\n                        dict->setObject(String::create(stringValue), stringKey);\n                    }\n                }\n                else if(lua_isboolean(L, -1))\n                {\n                    if (luaval_to_boolean(L, -1, &boolVal))\n                    {\n                        dict->setObject(Bool::create(boolVal),stringKey);\n                    }\n                }\n                else if(lua_isnumber(L, -1))\n                {\n                     dict->setObject(Double::create(tolua_tonumber(L, -1, 0)),stringKey);\n                }\n                else\n                {\n                    CCASSERT(false, \"not supported type\");\n                }\n            }\n            \n            lua_pop(L, 1);                                          /* L: lotable ..... key */\n        }\n        \n                                                                    /* L: lotable ..... */\n    }\n    \n    return ok;\n}\n\nbool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints)\n{\n    if (NULL == L)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        size_t len = lua_objlen(L, lo);\n        if (len > 0)\n        {\n            Point* array = (Point*)malloc(sizeof(Point) * len);\n            if (NULL == array)\n                return false;\n            for (uint32_t i = 0; i < len; ++i)\n            {\n                lua_pushnumber(L,i + 1);\n                lua_gettable(L,lo);\n                if (!tolua_istable(L,-1, 0, &tolua_err))\n                {\n#if COCOS2D_DEBUG >=1\n                    luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n                    lua_pop(L, 1);\n                    free(array);\n                    return false;\n                }\n                ok &= luaval_to_point(L, lua_gettop(L), &array[i]);\n                if (!ok)\n                {\n                    lua_pop(L, 1);\n                    free(array);\n                    return false;\n                }\n                lua_pop(L, 1);\n            }\n            \n            *numPoints = len;\n            *points    = array;\n        }\n    }\n    return ok;\n}\n\n\nbool luavals_variadic_to_array(lua_State* L,int argc, Array** ret)\n{\n    if (nullptr == L || argc == 0 )\n        return false;\n    \n    bool ok = true;\n    \n    Array* array = Array::create();\n    for (int i = 0; i < argc; i++)\n    {\n        double num = 0.0;\n        if (lua_isnumber(L, i + 2))\n        {\n            ok &= luaval_to_number(L, i + 2, &num);\n            if (!ok)\n                break;\n            \n            array->addObject(Integer::create((int)num));\n        }\n        else if (lua_isstring(L, i + 2))\n        {\n            std::string str = lua_tostring(L, i + 2);\n            array->addObject(String::create(str));\n        }\n        else if (lua_isuserdata(L, i + 2))\n        {\n            tolua_Error err;\n            if (!tolua_isusertype(L, i + 2, \"cc.Object\", 0, &err))\n            {\n#if COCOS2D_DEBUG >=1\n                luaval_to_native_err(L,\"#ferror:\",&err);\n#endif\n                ok = false;\n                break;\n            }\n            Object* obj = static_cast<Object*>(tolua_tousertype(L, i + 2, nullptr));\n            array->addObject(obj);\n        }\n    }\n    \n    *ret = array;\n    \n    return ok;\n}\n\nbool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret)\n{\n    if (nullptr == L || argc == 0 )\n        return false;\n    \n    for (int i = 0; i < argc; i++)\n    {\n        if(lua_istable(L, i + 2))\n        {\n            lua_pushnumber(L, 1);\n            lua_gettable(L, i + 2);\n            if (lua_isnil(L, -1) )\n            {\n                lua_pop(L,1);\n                ValueMap dictVal;\n                if (luaval_to_ccvaluemap(L, i + 2, &dictVal))\n                {\n                    ret->push_back(Value(dictVal));\n                }\n            }\n            else\n            {\n                lua_pop(L,1);\n                ValueVector arrVal;\n                if(luaval_to_ccvaluevector(L, i + 2, &arrVal))\n                {\n                    ret->push_back(Value(arrVal));\n                }\n            }\n        }\n        else if(lua_isstring(L, i + 2))\n        {\n            std::string stringValue = \"\";\n            if(luaval_to_std_string(L, i + 2, &stringValue) )\n            {\n                ret->push_back(Value(stringValue));\n            }\n        }\n        else if(lua_isboolean(L, i + 2))\n        {\n            bool boolVal = false;\n            if (luaval_to_boolean(L, i + 2, &boolVal))\n            {\n                ret->push_back(Value(boolVal));\n            }\n        }\n        else if(lua_isnumber(L, i + 2))\n        {\n            ret->push_back(Value(tolua_tonumber(L, i + 2, 0)));\n        }\n        else\n        {\n            CCASSERT(false, \"not supported type\");\n        }\n    }\n    \n    return true;\n }\n\nbool luaval_to_ccvalue(lua_State* L, int lo, cocos2d::Value* ret)\n{\n    if ( nullptr == L || nullptr == ret)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n    \n    if (tolua_istable(L, lo, 0, &tolua_err))\n    {\n        lua_pushnumber(L,1);\n        lua_gettable(L,lo);\n        \n        if (lua_isnil(L, -1) )                          /** if table[1] = nil,we don't think it is a pure array */\n        {\n            lua_pop(L,1);\n            ValueMap dictVal;\n            if (luaval_to_ccvaluemap(L, lo, &dictVal))\n            {\n                *ret = Value(dictVal);\n            }\n        }\n        else\n        {\n            lua_pop(L,1);\n            ValueVector arrVal;\n            if (luaval_to_ccvaluevector(L, lo, &arrVal))\n            {\n                *ret = Value(arrVal);\n            }\n        }\n    }\n    else if (tolua_isstring(L, lo, 0, &tolua_err))\n    {\n        std::string stringValue = \"\";\n        if (luaval_to_std_string(L, lo, &stringValue))\n        {\n             *ret = Value(stringValue);\n        }\n    }\n    else if (tolua_isboolean(L, lo, 0, &tolua_err))\n    {\n        bool boolVal = false;\n        if (luaval_to_boolean(L, lo, &boolVal))\n        {\n            *ret = Value(boolVal);\n        }\n    }\n    else if (tolua_isnumber(L, lo, 0, &tolua_err))\n    {\n        *ret = Value(tolua_tonumber(L, lo, 0));\n    }\n    \n    return ok;\n}\nbool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret)\n{\n    if ( nullptr == L || nullptr == ret)\n        return false;\n    \n    tolua_Error tolua_err;\n    bool ok = true;\n    if (!tolua_istable(L, lo, 0, &tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        std::string stringKey = \"\";\n        std::string stringValue = \"\";\n        bool boolVal = false;\n        ValueMap& dict = *ret;\n        lua_pushnil(L);                                             /* first key L: lotable ..... nil */\n        while ( 0 != lua_next(L, lo ) )                             /* L: lotable ..... key value */\n        {\n            if (!lua_isstring(L, -2))\n            {\n                lua_pop(L, 1);                                      /* removes 'value'; keep 'key' for next iteration*/\n                continue;\n            }\n            \n            if(luaval_to_std_string(L, -2, &stringKey))\n            {\n\n                if(lua_istable(L, -1))\n                {\n                    lua_pushnumber(L,1);\n                    lua_gettable(L,-2);\n\n                    if (lua_isnil(L, -1) )                          /** if table[1] = nil,we don't think it is a pure array */\n                    {\n                        lua_pop(L,1);\n                        ValueMap dictVal;\n                        if (luaval_to_ccvaluemap(L, -1, &dictVal))\n                        {\n                            dict[stringKey] = Value(dictVal);\n                        }\n                    }\n                    else\n                    {\n                        lua_pop(L,1);\n                        ValueVector arrVal;\n                        if (luaval_to_ccvaluevector(L, -1, &arrVal))\n                        {\n                            dict[stringKey] = Value(arrVal);\n                        }\n                    }\n                }\n                else if(lua_isstring(L, -1))\n                {\n                    if(luaval_to_std_string(L, -1, &stringValue))\n                    {\n                        dict[stringKey] = Value(stringValue);\n                    }\n                }\n                else if(lua_isboolean(L, -1))\n                {\n                    if (luaval_to_boolean(L, -1, &boolVal))\n                    {\n                        dict[stringKey] = Value(boolVal);\n                    }\n                }\n                else if(lua_isnumber(L, -1))\n                {\n                    dict[stringKey] = Value(tolua_tonumber(L, -1, 0));\n                }\n                else\n                {\n                    CCASSERT(false, \"not supported type\");\n                }\n            }\n            \n            lua_pop(L, 1);                                          /* L: lotable ..... key */\n        }\n    }\n    \n    return ok;\n}\nbool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIntKey* ret)\n{\n    if (nullptr == L || nullptr == ret)\n        return false;\n    \n    tolua_Error tolua_err;\n    bool ok = true;\n    if (!tolua_istable(L, lo, 0, &tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        std::string stringKey = \"\";\n        std::string stringValue = \"\";\n        int intKey = 0;\n        bool boolVal = false;\n        ValueMapIntKey& dict = *ret;\n        lua_pushnil(L);                                             /* first key L: lotable ..... nil */\n        while ( 0 != lua_next(L, lo ) )                             /* L: lotable ..... key value */\n        {\n            if (!lua_isstring(L, -2))\n            {\n                lua_pop(L, 1);                                      /* removes 'value'; keep 'key' for next iteration*/\n                continue;\n            }\n            \n            if(luaval_to_std_string(L, -2, &stringKey))\n            {\n                intKey = atoi(stringKey.c_str());\n                if(lua_istable(L, -1))\n                {\n                    lua_pushnumber(L,1);\n                    lua_gettable(L,-2);\n                    \n                    if (lua_isnil(L, -1) )                          /** if table[1] = nil,we don't think it is a pure array */\n                    {\n                        lua_pop(L,1);\n                        ValueMap dictVal;\n                        if (luaval_to_ccvaluemap(L, -1, &dictVal))\n                        {\n                            dict[intKey] = Value(dictVal);\n                        }\n                    }\n                    else\n                    {\n                        lua_pop(L,1);\n                        ValueVector arrVal;\n                        if (luaval_to_ccvaluevector(L, -1, &arrVal))\n                        {\n                            dict[intKey] = Value(arrVal);\n                        }\n                    }\n                }\n                else if(lua_isstring(L, -1))\n                {\n                    if(luaval_to_std_string(L, -1, &stringValue))\n                    {\n                        dict[intKey] = Value(stringValue);\n                    }\n                }\n                else if(lua_isboolean(L, -1))\n                {\n                    if (luaval_to_boolean(L, -1, &boolVal))\n                    {\n                        dict[intKey] = Value(boolVal);\n                    }\n                }\n                else if(lua_isnumber(L, -1))\n                {\n                    dict[intKey] = Value(tolua_tonumber(L, -1, 0));\n                }\n                else\n                {\n                    CCASSERT(false, \"not supported type\");\n                }\n            }\n            \n            lua_pop(L, 1);                                          /* L: lotable ..... key */\n        }\n    }\n    \n    return ok;\n}\nbool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* ret)\n{\n    if (nullptr == L || nullptr == ret)\n        return false;\n    \n    tolua_Error tolua_err;\n    bool ok = true;\n    if (!tolua_istable(L, lo, 0, &tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        size_t len = lua_objlen(L, lo);\n        for (int i = 0; i < len; i++)\n        {\n            lua_pushnumber(L,i + 1);\n            lua_gettable(L,lo);\n            if (lua_isnil(L,-1))\n            {\n                lua_pop(L, 1);\n                continue;\n            }\n            \n            if(lua_istable(L, -1))\n            {\n                lua_pushnumber(L,1);\n                lua_gettable(L,-2);\n                if (lua_isnil(L, -1) )\n                {\n                    lua_pop(L,1);\n                    ValueMap dictVal;\n                    if (luaval_to_ccvaluemap(L, -1, &dictVal))\n                    {\n                        ret->push_back(Value(dictVal));\n                    }\n                }\n                else\n                {\n                    lua_pop(L,1);\n                    ValueVector arrVal;\n                    if(luaval_to_ccvaluevector(L, -1, &arrVal))\n                    {\n                        ret->push_back(Value(arrVal));\n                    }\n                }\n            }\n            else if(lua_isstring(L, -1))\n            {\n                std::string stringValue = \"\";\n                if(luaval_to_std_string(L, -1, &stringValue) )\n                {\n                    ret->push_back(Value(stringValue));\n                }\n            }\n            else if(lua_isboolean(L, -1))\n            {\n                bool boolVal = false;\n                if (luaval_to_boolean(L, -1, &boolVal))\n                {\n                    ret->push_back(Value(boolVal));\n                }\n            }\n            else if(lua_isnumber(L, -1))\n            {\n                ret->push_back(Value(tolua_tonumber(L, -1, 0)));\n            }\n            else\n            {\n                CCASSERT(false, \"not supported type\");\n            }\n            lua_pop(L, 1);\n        }\n    }\n    \n    return ok;\n}\n\nbool luaval_to_std_vector_string(lua_State* L, int lo, std::vector<std::string>* ret)\n{\n    if (nullptr == L || nullptr == ret || lua_gettop(L) < lo)\n        return false;\n    \n    tolua_Error tolua_err;\n    bool ok = true;\n    if (!tolua_istable(L, lo, 0, &tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        size_t len = lua_objlen(L, lo);\n        std::string value = \"\";\n        for (int i = 0; i < len; i++)\n        {\n            lua_pushnumber(L, i + 1);\n            lua_gettable(L,lo);\n            if(lua_isstring(L, -1))\n            {\n                ok = luaval_to_std_string(L, -1, &value);\n                if(ok)\n                    ret->push_back(value);\n            }\n            else\n            {\n                CCASSERT(false, \"string type is needed\");\n            }\n            \n            lua_pop(L, 1);\n        }\n    }\n    \n    return ok;\n}\n\nbool luaval_to_std_vector_int(lua_State* L, int lo, std::vector<int>* ret)\n{\n    if (nullptr == L || nullptr == ret || lua_gettop(L) < lo)\n        return false;\n    \n    tolua_Error tolua_err;\n    bool ok = true;\n    if (!tolua_istable(L, lo, 0, &tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        size_t len = lua_objlen(L, lo);\n        for (int i = 0; i < len; i++)\n        {\n            lua_pushnumber(L, i + 1);\n            lua_gettable(L,lo);\n            if(lua_isnumber(L, -1))\n            {\n                ret->push_back((int)tolua_tonumber(L, -1, 0));\n            }\n            else\n            {\n                CCASSERT(false, \"int type is needed\");\n            }\n            \n            lua_pop(L, 1);\n        }\n    }\n    \n    return ok;\n}\n\nvoid points_to_luaval(lua_State* L,const Point* pt, int count)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);\n    for (int i = 1; i <= count; ++i)\n    {\n        lua_pushnumber(L, i);\n        point_to_luaval(L, pt[i-1]);\n        lua_rawset(L, -3);\n    }\n}\n\nvoid point_to_luaval(lua_State* L,const Point& pt)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"x\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) pt.x);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"y\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) pt.y);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"density\");                       /* L: table key */\n    lua_pushnumber(L, (lua_Number) pm.density);         /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"restitution\");                   /* L: table key */\n    lua_pushnumber(L, (lua_Number) pm.restitution);     /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"friction\");                      /* L: table key */\n    lua_pushnumber(L, (lua_Number) pm.friction);        /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info)\n{\n    if (NULL  == L)\n        return;\n    \n    lua_newtable(L);                                    /* L: table */\n    \n    lua_pushstring(L, \"shape\");                       /* L: table key */\n    PhysicsShape* shape = info.shape;\n    if (shape == nullptr)\n    {\n        lua_pushnil(L);\n    }else\n    {\n        std::string hashName = typeid(*shape).name();\n        auto iter = g_luaType.find(hashName);\n        std::string className = \"\";\n        if(iter != g_luaType.end()){\n            className = iter->second.c_str();\n        } else {\n            className = \"PhysicsShape\";\n        }\n        \n        int ID =  (int)(shape->_ID);\n        int* luaID = &(shape->_luaID);\n        toluafix_pushusertype_ccobject(L, ID, luaID, (void*)shape,className.c_str());\n    }\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"start\");                   /* L: table key */\n    point_to_luaval(L, info.start);\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"ended\");                   /* L: table key */\n    point_to_luaval(L, info.end);\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"contact\");                   /* L: table key */\n    point_to_luaval(L, info.contact);\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"normal\");                   /* L: table key */\n    point_to_luaval(L, info.normal);\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"fraction\");                      /* L: table key */\n    lua_pushnumber(L, (lua_Number) info.fraction);        /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data)\n{\n    if (nullptr  == L || nullptr == data)\n        return;\n    \n    lua_newtable(L);                                    /* L: table */\n    \n    lua_pushstring(L, \"points\");\n    points_to_luaval(L, data->points, data->count);\n    lua_rawset(L, -3);\n    \n    lua_pushstring(L, \"normal\");\n    point_to_luaval(L, data->normal);\n    lua_rawset(L, -3);\n    \n    lua_pushstring(L, \"POINT_MAX\");\n    lua_pushnumber(L, data->POINT_MAX);\n    lua_rawset(L, -3);\n}\n\nvoid size_to_luaval(lua_State* L,const Size& sz)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"width\");                         /* L: table key */\n    lua_pushnumber(L, (lua_Number) sz.width);           /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"height\");                        /* L: table key */\n    lua_pushnumber(L, (lua_Number) sz.height);          /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid rect_to_luaval(lua_State* L,const Rect& rt)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"x\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) rt.origin.x);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"y\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) rt.origin.y);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"width\");                         /* L: table key */\n    lua_pushnumber(L, (lua_Number) rt.size.width);           /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"height\");                        /* L: table key */\n    lua_pushnumber(L, (lua_Number) rt.size.height);          /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid color4b_to_luaval(lua_State* L,const Color4B& cc)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"r\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.r);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"g\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.g);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"b\");                         /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.b);           /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"a\");                        /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.a);          /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid color4f_to_luaval(lua_State* L,const Color4F& cc)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"r\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.r);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"g\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.g);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"b\");                         /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.b);           /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"a\");                        /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.a);          /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid color3b_to_luaval(lua_State* L,const Color3B& cc)\n{\n    if (NULL  == L)\n        return;\n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"r\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.r);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"g\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.g);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"b\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) cc.b);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue)\n{\n    if (NULL  == L)\n        return;\n    \n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"a\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue.a);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"b\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue.b);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"c\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue.c);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"d\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue.d);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"tx\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue.d);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"ty\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue.d);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue)\n{\n    if (NULL == L)\n        return;\n    \n    lua_newtable(L);                                    /* L: table */\n    lua_pushstring(L, \"fontName\");                      /* L: table key */\n    tolua_pushcppstring(L, inValue._fontName);          /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"fontSize\");                      /* L: table key */\n    lua_pushnumber(L,(lua_Number)inValue._fontSize);                 /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"fontAlignmentH\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue._alignment);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"fontAlignmentV\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number) inValue._vertAlignment);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"fontFillColor\");                             /* L: table key */\n    color3b_to_luaval(L, inValue._fontFillColor);               /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    lua_pushstring(L, \"fontDimensions\");                             /* L: table key */\n    size_to_luaval(L, inValue._dimensions);              /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    //Shadow\n    lua_pushstring(L, \"shadowEnabled\");                             /* L: table key */\n    lua_pushboolean(L, inValue._shadow._shadowEnabled);              /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"shadowOffset\");                             /* L: table key */\n    size_to_luaval(L, inValue._shadow._shadowOffset);              /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"shadowBlur\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number)inValue._shadow._shadowBlur);  /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"shadowOpacity\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number)inValue._shadow._shadowOpacity);  /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    //Stroke\n    lua_pushstring(L, \"shadowEnabled\");                             /* L: table key */\n    lua_pushboolean(L, inValue._stroke._strokeEnabled);              /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"strokeColor\");                             /* L: table key */\n    color3b_to_luaval(L, inValue._stroke._strokeColor);              /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n    \n    lua_pushstring(L, \"strokeSize\");                             /* L: table key */\n    lua_pushnumber(L, (lua_Number)inValue._stroke._strokeSize);              /* L: table key value*/\n    lua_rawset(L, -3);                                  /* table[key] = value, L: table */\n}\n\nvoid array_to_luaval(lua_State* L,Array* inValue)\n{\n    lua_newtable(L);\n    \n    if (nullptr == L || nullptr == inValue)\n        return;\n    \n    Object* obj = nullptr;\n    \n    std::string className = \"\";\n    String* strVal = nullptr;\n    Dictionary* dictVal = nullptr;\n    Array* arrVal = nullptr;\n    Double* doubleVal = nullptr;\n    Bool* boolVal = nullptr;\n    Float* floatVal = nullptr;\n    Integer* intVal = nullptr;\n    int indexTable = 1;\n    \n    CCARRAY_FOREACH(inValue, obj)\n    {\n        if (nullptr == obj)\n            continue;\n        \n        std::string typeName = typeid(*obj).name();\n        auto iter = g_luaType.find(typeName);\n        if (g_luaType.end() != iter)\n        {\n            className = iter->second;\n            if (nullptr != dynamic_cast<cocos2d::Object *>(obj))\n            {\n                lua_pushnumber(L, (lua_Number)indexTable);                \n                int ID = (obj) ? (int)obj->_ID : -1;\n                int* luaID = (obj) ? &obj->_luaID : NULL;\n                toluafix_pushusertype_ccobject(L, ID, luaID, (void*)obj,className.c_str());\n                lua_rawset(L, -3);\n                obj->retain();\n                ++indexTable;\n            }\n        }\n        else if((strVal = dynamic_cast<cocos2d::String *>(obj)))\n        {\n            lua_pushnumber(L, (lua_Number)indexTable);   \n            lua_pushstring(L, strVal->getCString());\n            lua_rawset(L, -3);\n            ++indexTable;\n        }\n        else if ((dictVal = dynamic_cast<cocos2d::Dictionary*>(obj)))\n        {\n            dictionary_to_luaval(L, dictVal);\n        }\n        else if ((arrVal = dynamic_cast<cocos2d::Array*>(obj)))\n        {\n            array_to_luaval(L, arrVal);\n        }\n        else if ((doubleVal = dynamic_cast<Double*>(obj)))\n        {\n            lua_pushnumber(L, (lua_Number)indexTable);   \n            lua_pushnumber(L, (lua_Number)doubleVal->getValue());\n            lua_rawset(L, -3);\n            ++indexTable;\n        }\n        else if ((floatVal = dynamic_cast<Float*>(obj)))\n        {\n            lua_pushnumber(L, (lua_Number)indexTable);   \n            lua_pushnumber(L, (lua_Number)floatVal->getValue());\n            lua_rawset(L, -3);\n            ++indexTable;\n        }\n        else if ((intVal = dynamic_cast<Integer*>(obj)))\n        {\n            lua_pushnumber(L, (lua_Number)indexTable);   \n            lua_pushinteger(L, (lua_Integer)intVal->getValue());\n            lua_rawset(L, -3);\n            ++indexTable;\n        }\n        else if ((boolVal = dynamic_cast<Bool*>(obj)))\n        {\n            lua_pushnumber(L, (lua_Number)indexTable);   \n            lua_pushboolean(L, boolVal->getValue());\n            lua_rawset(L, -3);\n            ++indexTable;\n        }\n        else\n        {\n            CCASSERT(false, \"the type isn't suppored.\");\n        }\n    }\n}\n\nvoid dictionary_to_luaval(lua_State* L, Dictionary* dict)\n{\n    lua_newtable(L);\n    \n    if (nullptr == L || nullptr == dict)\n        return;\n    \n    DictElement* element = nullptr;\n    \n    std::string className = \"\";\n    String* strVal = nullptr;\n    Dictionary* dictVal = nullptr;\n    Array* arrVal = nullptr;\n    Double* doubleVal = nullptr;\n    Bool* boolVal = nullptr;\n    Float* floatVal = nullptr;\n    Integer* intVal = nullptr;\n    \n    CCDICT_FOREACH(dict, element)\n    {\n        if (NULL == element)\n            continue;\n        \n        std::string typeName = typeid(element->getObject()).name();\n        \n        auto iter = g_luaType.find(typeName);\n        if (g_luaType.end() != iter)\n        {\n            className = iter->second;\n            if ( nullptr != dynamic_cast<cocos2d::Object *>(element->getObject()))\n            {\n                lua_pushstring(L, element->getStrKey());\n                int ID = (element->getObject()) ? (int)element->getObject()->_ID : -1;\n                int* luaID = (element->getObject()) ? &(element->getObject()->_luaID) : NULL;\n                toluafix_pushusertype_ccobject(L, ID, luaID, (void*)element->getObject(),className.c_str());\n                lua_rawset(L, -3);\n                element->getObject()->retain();\n            }\n        }\n        else if((strVal = dynamic_cast<cocos2d::String *>(element->getObject())))\n        {\n            lua_pushstring(L, element->getStrKey());\n            lua_pushstring(L, strVal->getCString());\n            lua_rawset(L, -3);\n        }\n        else if ((dictVal = dynamic_cast<cocos2d::Dictionary*>(element->getObject())))\n        {\n            dictionary_to_luaval(L, dictVal);\n        }\n        else if ((arrVal = dynamic_cast<cocos2d::Array*>(element->getObject())))\n        {\n            array_to_luaval(L, arrVal);\n        }\n        else if ((doubleVal = dynamic_cast<Double*>(element->getObject())))\n        {\n            lua_pushstring(L, element->getStrKey());\n            lua_pushnumber(L, (lua_Number)doubleVal->getValue());\n            lua_rawset(L, -3);\n        }\n        else if ((floatVal = dynamic_cast<Float*>(element->getObject())))\n        {\n            lua_pushstring(L, element->getStrKey());\n            lua_pushnumber(L, (lua_Number)floatVal->getValue());\n            lua_rawset(L, -3);\n        }\n        else if ((intVal = dynamic_cast<Integer*>(element->getObject())))\n        {\n            lua_pushstring(L, element->getStrKey());\n            lua_pushinteger(L, (lua_Integer)intVal->getValue());\n            lua_rawset(L, -3);\n        }\n        else if ((boolVal = dynamic_cast<Bool*>(element->getObject())))\n        {\n            lua_pushstring(L, element->getStrKey());\n            lua_pushboolean(L, boolVal->getValue());\n            lua_rawset(L, -3);\n        }\n        else\n        {\n            CCASSERT(false, \"the type isn't suppored.\");\n        }\n    }\n}\n\nvoid ccvalue_to_luaval(lua_State* L,const cocos2d::Value& inValue)\n{\n    const Value& obj = inValue;\n    switch (obj.getType())\n    {\n        case Value::Type::BOOLEAN:\n            lua_pushboolean(L, obj.asBool());\n            break;\n        case Value::Type::FLOAT:\n        case Value::Type::DOUBLE:\n            lua_pushnumber(L, obj.asDouble());\n            break;\n        case Value::Type::INTEGER:\n            lua_pushinteger(L, obj.asInt());\n            break;\n        case Value::Type::STRING:\n            lua_pushstring(L, obj.asString().c_str());\n            break;\n        case Value::Type::VECTOR:\n            ccvaluevector_to_luaval(L, obj.asValueVector());\n            break;\n        case Value::Type::MAP:\n            ccvaluemap_to_luaval(L, obj.asValueMap());\n            break;\n        case Value::Type::INT_KEY_MAP:\n            ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());\n            break;\n        default:\n            break;\n    }\n}\nvoid ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue)\n{\n    lua_newtable(L);\n    \n    if (nullptr == L)\n        return;\n    \n    for (auto iter = inValue.begin(); iter != inValue.end(); ++iter)\n    {\n        std::string key = iter->first;\n        const Value& obj = iter->second;\n        switch (obj.getType())\n        {\n            case Value::Type::BOOLEAN:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushboolean(L, obj.asBool());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::FLOAT:\n            case Value::Type::DOUBLE:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushnumber(L, obj.asDouble());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::INTEGER:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushinteger(L, obj.asInt());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::STRING:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushstring(L, obj.asString().c_str());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::VECTOR:\n                {\n                    lua_pushstring(L, key.c_str());\n                    ccvaluevector_to_luaval(L, obj.asValueVector());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::MAP:\n                {\n                    lua_pushstring(L, key.c_str());\n                    ccvaluemap_to_luaval(L, obj.asValueMap());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::INT_KEY_MAP:\n                {\n                    lua_pushstring(L, key.c_str());\n                    ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());\n                    lua_rawset(L, -3);\n                }\n                break;\n            default:\n                break;\n        }\n    }\n}\nvoid ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inValue)\n{\n    lua_newtable(L);\n    \n    if (nullptr == L)\n        return;\n    \n    for (auto iter = inValue.begin(); iter != inValue.end(); ++iter)\n    {\n        std::stringstream keyss;\n        keyss << iter->first;\n        std::string key = keyss.str();\n        \n        const Value& obj = iter->second;\n        \n        switch (obj.getType())\n        {\n            case Value::Type::BOOLEAN:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushboolean(L, obj.asBool());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::FLOAT:\n            case Value::Type::DOUBLE:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushnumber(L, obj.asDouble());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::INTEGER:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushinteger(L, obj.asInt());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::STRING:\n                {\n                    lua_pushstring(L, key.c_str());\n                    lua_pushstring(L, obj.asString().c_str());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::VECTOR:\n                {\n                    lua_pushstring(L, key.c_str());\n                    ccvaluevector_to_luaval(L, obj.asValueVector());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::MAP:\n                {\n                    lua_pushstring(L, key.c_str());\n                    ccvaluemap_to_luaval(L, obj.asValueMap());\n                    lua_rawset(L, -3);\n                }\n                break;\n            case Value::Type::INT_KEY_MAP:\n                {\n                    lua_pushstring(L, key.c_str());\n                    ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());\n                    lua_rawset(L, -3);\n                }\n                break;\n            default:\n                break;\n        }\n    }\n}\nvoid ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue)\n{\n    lua_newtable(L);\n    \n    if (nullptr == L)\n        return;\n    \n    int index  = 1;\n    for (const auto& obj : inValue)\n    {\n        switch (obj.getType())\n        {\n            case Value::Type::BOOLEAN:\n                {\n                    lua_pushnumber(L, (lua_Number)index);\n                    lua_pushboolean(L, obj.asBool());\n                    lua_rawset(L, -3);\n                    ++index;\n                }\n                break;\n            case Value::Type::FLOAT:\n            case Value::Type::DOUBLE:\n                {\n                    lua_pushnumber(L, (lua_Number)index);\n                    lua_pushnumber(L, obj.asDouble());\n                    lua_rawset(L, -3);\n                    ++index;\n                }\n                break;\n            case Value::Type::INTEGER:\n                {\n                    lua_pushnumber(L, (lua_Number)index);\n                    lua_pushnumber(L, obj.asInt());\n                    lua_rawset(L, -3);\n                    ++index;\n                }\n                break;\n            case Value::Type::STRING:\n                {\n                    lua_pushnumber(L, (lua_Number)index);\n                    lua_pushstring(L, obj.asString().c_str());\n                    lua_rawset(L, -3);\n                    ++index;\n                }\n                break;\n            case Value::Type::VECTOR:\n                {\n                    lua_pushnumber(L, (lua_Number)index);\n                    ccvaluevector_to_luaval(L, obj.asValueVector());\n                    lua_rawset(L, -3);\n                    ++index;\n                }\n                break;\n            case Value::Type::MAP:\n                {\n                    lua_pushnumber(L, (lua_Number)index);\n                    ccvaluemap_to_luaval(L, obj.asValueMap());\n                    lua_rawset(L, -3);\n                    ++index;\n                }\n                break;\n            case Value::Type::INT_KEY_MAP:\n                {\n                    lua_pushnumber(L, (lua_Number)index);\n                    ccvaluemapintkey_to_luaval(L, obj.asIntKeyMap());\n                    lua_rawset(L, -3);\n                    ++index;\n                }\n                break;\n            default:\n                break;\n        }\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaBasicConversions.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__\n#define __COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__\n\nextern \"C\" {\n#include \"lua.h\"\n#include \"tolua++.h\"\n#include \"tolua_fix.h\"\n}\n\n#include \"cocos2d.h\"\n\nusing namespace cocos2d;\n\nextern std::unordered_map<std::string, std::string>  g_luaType;\nextern std::unordered_map<std::string, std::string>  g_typeCast;\n\n#if COCOS2D_DEBUG >=1\nvoid luaval_to_native_err(lua_State* L,const char* msg,tolua_Error* err);\n#endif\n\n#define LUA_PRECONDITION( condition, ...) if( ! (condition) ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\ncocos2d::log(\"lua: ERROR: File %s: Line: %d, Function: %s\", __FILE__, __LINE__, __FUNCTION__ );                                                         \\\ncocos2d::log(__VA_ARGS__);                                                  \\\n}                                                                           \\\n\nextern bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def);\n// to native\nextern bool luaval_to_ushort(lua_State* L, int lo, unsigned short* outValue);\nextern bool luaval_to_int32(lua_State* L,int lo,int* outValue);\nextern bool luaval_to_uint32(lua_State* L, int lo, unsigned int* outValue);\nextern bool luaval_to_uint16(lua_State* L,int lo,uint16_t* outValue);\nextern bool luaval_to_boolean(lua_State* L,int lo,bool* outValue);\nextern bool luaval_to_number(lua_State* L,int lo,double* outValue);\nextern bool luaval_to_long_long(lua_State* L,int lo,long long* outValue);\nextern bool luaval_to_std_string(lua_State* L, int lo, std::string* outValue);\nextern bool luaval_to_long(lua_State* L,int lo, long* outValue);\nextern bool luaval_to_ssize(lua_State* L,int lo, ssize_t* outValue);\n\nextern bool luaval_to_point(lua_State* L,int lo,Point* outValue);\nextern bool luaval_to_size(lua_State* L,int lo,Size* outValue);\nextern bool luaval_to_rect(lua_State* L,int lo,Rect* outValue);\nextern bool luaval_to_color3b(lua_State* L,int lo,Color3B* outValue);\nextern bool luaval_to_color4b(lua_State* L,int lo,Color4B* outValue);\nextern bool luaval_to_color4f(lua_State* L,int lo,Color4F* outValue);\nextern bool luaval_to_physics_material(lua_State* L,int lo, cocos2d::PhysicsMaterial* outValue);\nextern bool luaval_to_affinetransform(lua_State* L,int lo, AffineTransform* outValue);\nextern bool luaval_to_fontdefinition(lua_State* L, int lo, FontDefinition* outValue );\nextern bool luaval_to_array(lua_State* L,int lo, Array** outValue);\nextern bool luaval_to_dictionary(lua_State* L,int lo, Dictionary** outValue);\nextern bool luaval_to_array_of_Point(lua_State* L,int lo,Point **points, int *numPoints);\nextern bool luavals_variadic_to_array(lua_State* L,int argc, Array** ret);\nextern bool luavals_variadic_to_ccvaluevector(lua_State* L, int argc, cocos2d::ValueVector* ret);\n\ntemplate <class T>\nbool luavals_variadic_to_ccvector( lua_State* L, int argc, cocos2d::Vector<T>* ret)\n{\n    if (nullptr == L || argc == 0 )\n        return false;\n    \n    bool ok = true;\n    \n    for (int i = 0; i < argc; i++)\n    {\n        if (lua_isuserdata(L, i + 2))\n        {\n            tolua_Error err;\n            //Undo check\n            if (!tolua_isusertype(L, i + 2, \"cc.Object\", 0, &err))\n            {\n                ok = false;\n                break;\n            }\n            T obj = static_cast<T>(tolua_tousertype(L, i + 2, nullptr));\n            ret->pushBack(obj);\n        }\n    }\n    \n    return ok;\n}\n\ntemplate <class T>\nbool luaval_to_ccvector(lua_State* L, int lo , cocos2d::Vector<T>* ret)\n{\n    if (nullptr == L || nullptr == ret)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n        ok = false;\n    \n    if (ok)\n    {\n        size_t len = lua_objlen(L, lo);\n        for (int i = 0; i < len; i++)\n        {\n            lua_pushnumber(L, i + 1);\n            lua_gettable(L, lo);\n            \n            if (lua_isnil(L, -1) || !lua_isuserdata(L, -1))\n            {\n                lua_pop(L, 1);\n                continue;\n            }\n            \n\n            T cobj = static_cast<T>(tolua_tousertype(L, -1, NULL) );\n            if (NULL != cobj)\n                ret->pushBack(cobj);\n            \n            lua_pop(L, 1);\n        }\n    }\n    \n    return ok;\n}\n\nbool luaval_to_std_vector_string(lua_State* L, int lo, std::vector<std::string>* ret);\nbool luaval_to_std_vector_int(lua_State* L, int lo, std::vector<int>* ret);\n\ntemplate <class T>\nbool luaval_to_ccmap_string_key(lua_State* L, int lo, cocos2d::Map<std::string, T>* ret)\n{\n    if(nullptr == L || nullptr == ret || lua_gettop(L) < lo)\n        return false;\n    \n    tolua_Error tolua_err;\n    bool ok = true;\n    if (!tolua_istable(L, lo, 0, &tolua_err))\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        std::string stringKey = \"\";\n        lua_pushnil(L);                                             /* first key L: lotable ..... nil */\n        while ( 0 != lua_next(L, lo ) )                             /* L: lotable ..... key value */\n        {\n            if (!lua_isstring(L, -2))\n            {\n                lua_pop(L, 1);                                      /* removes 'value'; keep 'key' for next iteration*/\n                continue;\n            }\n            \n            if (lua_isnil(L, -1) || !lua_isuserdata(L, -1))\n            {\n                lua_pop(L, 1);\n                continue;\n            }\n            \n            luaval_to_std_string(L, -2, &stringKey);\n            T obj = static_cast<T>(tolua_tousertype(L, -1, NULL) );\n            if (nullptr != obj)\n                ret->insert(stringKey, obj);\n                \n            lua_pop(L, 1);                                          /* L: lotable ..... key */\n        }\n    }\n    \n    return ok;\n}\n\n\nextern bool luaval_to_ccvalue(lua_State* L, int lo, cocos2d::Value* ret);\nextern bool luaval_to_ccvaluemap(lua_State* L, int lo, cocos2d::ValueMap* ret);\nextern bool luaval_to_ccvaluemapintkey(lua_State* L, int lo, cocos2d::ValueMapIntKey* ret);\nextern bool luaval_to_ccvaluevector(lua_State* L, int lo, cocos2d::ValueVector* ret);\n\n\n// from native\nextern void point_to_luaval(lua_State* L,const Point& pt);\nextern void points_to_luaval(lua_State* L,const Point* pt, int count);\nextern void size_to_luaval(lua_State* L,const Size& sz);\nextern void rect_to_luaval(lua_State* L,const Rect& rt);\nextern void color3b_to_luaval(lua_State* L,const Color3B& cc);\nextern void color4b_to_luaval(lua_State* L,const Color4B& cc);\nextern void color4f_to_luaval(lua_State* L,const Color4F& cc);\nextern void physics_material_to_luaval(lua_State* L,const PhysicsMaterial& pm);\nextern void physics_raycastinfo_to_luaval(lua_State* L, const PhysicsRayCastInfo& info);\nextern void physics_contactdata_to_luaval(lua_State* L, const PhysicsContactData* data);\nextern void affinetransform_to_luaval(lua_State* L,const AffineTransform& inValue);\nextern void fontdefinition_to_luaval(lua_State* L,const FontDefinition& inValue);\nextern void array_to_luaval(lua_State* L,Array* inValue);\nextern void dictionary_to_luaval(lua_State* L, Dictionary* dict);\n\ntemplate <class T>\nvoid ccvector_to_luaval(lua_State* L,const cocos2d::Vector<T>& inValue)\n{\n    lua_newtable(L);\n    \n    if (nullptr == L)\n        return;\n    \n    int indexTable = 1;\n    for (const auto& obj : inValue)\n    {\n        if (nullptr == obj)\n            continue;\n        \n\n        if (nullptr != dynamic_cast<cocos2d::Object *>(obj))\n        {\n            std::string typeName = typeid(*obj).name();\n            auto iter = g_luaType.find(typeName);\n            if (g_luaType.end() != iter)\n            {\n                lua_pushnumber(L, (lua_Number)indexTable);\n                int ID = (obj) ? (int)obj->_ID : -1;\n                int* luaID = (obj) ? &obj->_luaID : NULL;\n                toluafix_pushusertype_ccobject(L, ID, luaID, (void*)obj,iter->second.c_str());\n                lua_rawset(L, -3);\n                obj->retain();\n                ++indexTable;\n            }\n        }\n    }\n}\n\ntemplate <class T>\nvoid ccmap_string_key_to_luaval(lua_State* L, const cocos2d::Map<std::string, T>& v)\n{\n    lua_newtable(L);\n    \n    if(nullptr == L)\n        return;\n    \n    for (auto iter = v.begin(); iter != v.end(); ++iter)\n    {\n        std::string key = iter->first;\n        T obj = iter->second;\n        if (nullptr != dynamic_cast<cocos2d::Object *>(obj))\n        {\n            std::string name = typeid(*obj).name();\n            auto typeIter = g_luaType.find(name);\n            if (g_luaType.end() != typeIter)\n            {\n                lua_pushstring(L, name.c_str());\n                int ID = (obj) ? (int)obj->_ID : -1;\n                int* luaID = (obj) ? &obj->_luaID : NULL;\n                toluafix_pushusertype_ccobject(L, ID, luaID, (void*)obj,typeIter->second.c_str());\n                lua_rawset(L, -3);\n            }\n        }\n    }\n}\n\nvoid ccvalue_to_luaval(lua_State* L,const cocos2d::Value& inValue);\nvoid ccvaluemap_to_luaval(lua_State* L,const cocos2d::ValueMap& inValue);\nvoid ccvaluemapintkey_to_luaval(lua_State* L, const cocos2d::ValueMapIntKey& inValue);\nvoid ccvaluevector_to_luaval(lua_State* L, const cocos2d::ValueVector& inValue);\n#endif //__COCOS2DX_SCRIPTING_LUA_COCOS2DXSUPPORT_LUABAISCCONVERSIONS_H__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaOpengl.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n    #include \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include <map>\n#include <string>\n#include \"LuaOpengl.h\"\n#include \"cocos2d.h\"\n#include \"extensions/cocos-ext.h\"\n#include \"CCLuaStack.h\"\n#include \"CCLuaValue.h\"\n#include \"CCLuaEngine.h\"\n#include \"LuaScriptHandlerMgr.h\"\n#include \"LuaBasicConversions.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\n\n    \nvoid GLNode::draw()\n{\n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::GL_NODE_DRAW);\n    if (0 != handler)\n    {\n            CommonScriptData data(handler,\"\");\n            ScriptEvent event(kCommonEvent,(void*)&data);\n            ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n}\n\n/* function to release collected object via destructor */\nstatic void tolua_reg_gl_type(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S, \"cc.GLNode\");\n}\n\nstatic int tolua_collect_GLNode (lua_State* tolua_S)\n{\n    GLNode *self = (GLNode*) tolua_tousertype(tolua_S,1,0);\n    Mtolua_delete(self);\n    return 0;\n}\n\n/* method: create of class  GLNode */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_GLNode_create00\nstatic int tolua_Cocos2d_GLNode_create00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"cc.GLNode\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        GLNode *glNode = new GLNode();\n        if (NULL != glNode)\n        {\n            glNode->autorelease();\n            int nID = (int)glNode->_ID;\n            int* pLuaID = &glNode->_luaID;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)glNode,\"cc.GLNode\");\n            //tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n        else\n        {\n            return 0;\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* method: setShaderProgram of class  GLNode */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_GLNode_setShaderProgram00\nstatic int tolua_Cocos2d_GLNode_setShaderProgram00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"cc.GLNode\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"cc.GLProgram\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        GLNode* self = (GLNode*)  tolua_tousertype(tolua_S,1,0);\n        GLProgram* pShaderProgram = ((GLProgram*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'setShaderProgram'\", NULL);\n#endif\n        if(NULL != self)\n            self->setShaderProgram(pShaderProgram);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setShaderProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetSupportedExtensions*/\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetSupportedExtensions00\nstatic int tolua_Cocos2d_glGetSupportedExtensions00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isnoobj(tolua_S,1,&tolua_err))\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const GLubyte* extensions = glGetString(GL_EXTENSIONS);\n        size_t len  = strlen((const char*)extensions);\n        GLubyte* copy = new GLubyte[len+1];\n        strncpy((char*)copy, (const char*)extensions, len );\n        \n        int start_extension=0;\n        LuaValueArray array;\n        for (unsigned int i=0; i < len+1; i++)\n        {\n            if( copy[i]==' ' || copy[i]==',' || i == len )\n            {\n                copy[i] = 0;\n                LuaValue value = LuaValue::stringValue((const char*)&copy[start_extension]);\n                array.push_back(value);                \n                start_extension = i+1;\n                i++;\n            }\n        }\n        \n        lua_newtable(tolua_S);                                              /* L: table */\n        int index = 1;\n        for (LuaValueArrayIterator it = array.begin(); it != array.end(); ++it)\n        {\n            lua_pushstring(tolua_S, (*it).stringValue().c_str());     /* L: table value */\n            lua_rawseti(tolua_S, -2, index);                          /* table[index] = value, L: table */\n            ++index;\n        }\n        CC_SAFE_DELETE_ARRAY(copy);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetSupportedExtensions'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\n/* function: glActiveTexture */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glActiveTexture00\nstatic int tolua_Cocos2d_glActiveTexture00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isnumber(tolua_S,1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int activeTexture = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glActiveTexture((GLenum)activeTexture);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glActiveTexture'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glAttachShader */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glAttachShader00\nstatic int tolua_Cocos2d_glAttachShader00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int program = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int shader  = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        glAttachShader ((GLuint)program,(GLuint) shader);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glAttachShader'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBindAttribLocation  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBindAttribLocation00\nstatic int tolua_Cocos2d_glBindAttribLocation00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isstring(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int program = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int index   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        const char* name = (const char*)tolua_tostring(tolua_S, 3, \"\");\n        glBindAttribLocation ((GLuint)program,(GLuint) index,name);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBindAttribLocation'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBindBuffer */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBindBuffer00\nstatic int tolua_Cocos2d_glBindBuffer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int buffer   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        glBindBuffer((GLenum)target,(GLuint)buffer);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBindBuffer'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* method: glBindFramebuffer of class  GLNode */\n/*\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBindFramebuffer00\nstatic int tolua_Cocos2d_glBindFramebuffer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"GLNode\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        unsigned int framebuffer   = (unsigned int)tolua_tonumber(tolua_S,3,0);\n        glBindFramebuffer((GLenum)target,(GLuint)framebuffer);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBindFramebuffer'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n*/\n\n/* function: glBindRenderbuffer  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBindRenderbuffer00\nstatic int tolua_Cocos2d_glBindRenderbuffer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int renderbuffer   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        glBindRenderbuffer((GLenum)target,(GLuint)renderbuffer);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBindRenderbuffer'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBindTexture  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBindTexture00\nstatic int tolua_Cocos2d_glBindTexture00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int texture   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        glBindTexture((GLenum)target,(GLuint)texture);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBindTexture'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBlendColor  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBlendColor00\nstatic int tolua_Cocos2d_glBlendColor00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int red   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int green = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        unsigned int blue  = (unsigned int)tolua_tonumber(tolua_S,3,0);\n        unsigned int alpha  = (unsigned int)tolua_tonumber(tolua_S,4,0);\n        glBlendColor((GLclampf)red , (GLclampf)green , (GLclampf)blue , (GLclampf)alpha );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBlendColor'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBlendEquation */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBlendEquation00\nstatic int tolua_Cocos2d_glBlendEquation00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int mode   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glBlendEquation((GLenum)mode);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBlendEquation'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBlendEquationSeparate  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBlendEquationSeparate00\nstatic int tolua_Cocos2d_glBlendEquationSeparate00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int modeRGB   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int modeAlpha   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        glBlendEquationSeparate((GLenum)modeRGB , (GLenum)modeAlpha  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBlendEquationSeparate'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBlendFunc  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBlendFunc00\nstatic int tolua_Cocos2d_glBlendFunc00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int sfactor   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int dfactor   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        glBlendFunc((GLenum)sfactor , (GLenum)dfactor);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBlendFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBlendFuncSeparate */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBlendFuncSeparate00\nstatic int tolua_Cocos2d_glBlendFuncSeparate00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int srcRGB   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int dstRGB = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        unsigned int srcAlpha  = (unsigned int)tolua_tonumber(tolua_S,3,0);\n        unsigned int dstAlpha  = (unsigned int)tolua_tonumber(tolua_S,4,0);\n        glBlendFuncSeparate((GLenum)srcRGB , (GLenum)dstRGB , (GLenum)srcAlpha , (GLenum)dstAlpha );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBlendFuncSeparate'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBufferData  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBufferData00\nstatic int tolua_Cocos2d_glBufferData00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,2, 0,&tolua_err)            ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err)           ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        long length   = (long)tolua_tonumber(tolua_S,2,0);\n        float* floatArray     = new float[length];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= length; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 3, i, 0);\n        }\n        unsigned int usage  = (unsigned int)tolua_tonumber(tolua_S,4,0);\n        long lengthInByte = length * sizeof(float);\n        glBufferData((GLenum)target , (GLsizeiptr)lengthInByte, (GLvoid*)floatArray , (GLenum)usage);\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBufferData'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glBufferSubData  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glBufferSubData00\nstatic int tolua_Cocos2d_glBufferSubData00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,2, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)           ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)           ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        long offset = (long)tolua_tonumber(tolua_S,2,0);\n        long length   = (long)tolua_tonumber(tolua_S,3,0);\n        float* floatArray     = new float[length];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= length; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        long lengthInByte = length * sizeof(float);\n        long offsetInByte = offset * sizeof(float);\n        glBufferSubData((GLenum)target,(GLintptr)offsetInByte,(GLsizei)lengthInByte,(GLvoid*)floatArray);\n\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glBufferData'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCheckFramebufferStatus */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCheckFramebufferStatus00\nstatic int tolua_Cocos2d_glCheckFramebufferStatus00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int retVal = glCheckFramebufferStatus((GLenum)target);\n        tolua_pushnumber(tolua_S,retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCheckFramebufferStatus'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glClear */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glClear00\nstatic int tolua_Cocos2d_glClear00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int mask   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glClear((GLbitfield)mask);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glClear'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glClearColor  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glClearColor00\nstatic int tolua_Cocos2d_glClearColor00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int red   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int green   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        unsigned int blue   = (unsigned int)tolua_tonumber(tolua_S,3,0);\n        unsigned int alpha   = (unsigned int)tolua_tonumber(tolua_S,4,0);\n        glClearColor((GLclampf)red , (GLclampf)green , (GLclampf)blue , (GLclampf)alpha);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glClearColor'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glClearDepthf  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glClearDepthf00\nstatic int tolua_Cocos2d_glClearDepthf00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int depth   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glClearDepthf((GLclampf)depth  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glClearDepthf'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glClearStencil */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glClearStencil00\nstatic int tolua_Cocos2d_glClearStencil00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int stencil   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glClearStencil((GLint)stencil  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glClearStencil'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glColorMask  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glColorMask00\nstatic int tolua_Cocos2d_glColorMask00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned char red   = (unsigned char)tolua_tonumber(tolua_S,1,0);\n        unsigned char green   = (unsigned char)tolua_tonumber(tolua_S,2,0);\n        unsigned char blue   = (unsigned char)tolua_tonumber(tolua_S,3,0);\n        unsigned char alpha   = (unsigned char)tolua_tonumber(tolua_S,4,0);\n        glColorMask((GLboolean)red , (GLboolean)green , (GLboolean)blue , (GLboolean)alpha);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glColorMask'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCompileShader  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCompileShader00\nstatic int tolua_Cocos2d_glCompileShader00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int shader   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glCompileShader((GLuint)shader  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCompileShader'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCompressedTexImage2D */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCompressedTexImage2D00\nstatic int tolua_Cocos2d_glCompressedTexImage2D00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,2, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,5, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 6, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 7, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 8, 0, &tolua_err)          ||\n        !tolua_istable(tolua_S, 9, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 10, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        int level   = (int)tolua_tonumber(tolua_S,2,0);\n        unsigned int internalformat = (unsigned int)tolua_tonumber(tolua_S,3,0);\n        int width   = (int)tolua_tonumber(tolua_S, 4, 0);\n        int height   = (int)tolua_tonumber(tolua_S, 5, 0);\n        int border   = (int)tolua_tonumber(tolua_S, 6, 0);\n        int imageSize   = (int)tolua_tonumber(tolua_S, 7, 0);\n        \n        long length   = (long)tolua_tonumber(tolua_S,8,0);\n        float* floatArray     = new float[length];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= length; i++)\n        {\n            floatArray[i - 1] = (float)tolua_tofieldnumber(tolua_S, 9, i, 0);\n        }\n        glCompressedTexImage2D((GLenum)target , (GLint)level , (GLenum)internalformat , (GLsizei)width , (GLsizei)height , (GLint)border , (GLsizei)imageSize , (GLvoid*)floatArray  );\n        \n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCompressedTexImage2D'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCompressedTexSubImage2D  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCompressedTexSubImage2D00\nstatic int tolua_Cocos2d_glCompressedTexSubImage2D00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,2, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,5, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 6, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 7, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 8, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 9, 0, &tolua_err)          ||\n        !tolua_istable(tolua_S, 10, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 11, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        int level   = (int)tolua_tonumber(tolua_S,2,0);\n        int xoffset = (int)tolua_tonumber(tolua_S, 3, 0);\n        int yoffset = (int)tolua_tonumber(tolua_S, 4, 0);\n        int width   = (int)tolua_tonumber(tolua_S, 5, 0);\n        int height   = (int)tolua_tonumber(tolua_S, 6, 0);\n        unsigned int format = (unsigned int)tolua_tonumber(tolua_S,7,0);\n        int imageSize   = (int)tolua_tonumber(tolua_S, 8, 0);\n        \n        long length   = (long)tolua_tonumber(tolua_S,9,0);\n        float* floatArray     = new float[length];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= length; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 10, i, 0);\n        }\n        glCompressedTexSubImage2D((GLenum)target , (GLint)level , (GLint)xoffset , (GLint)yoffset , (GLsizei)width , (GLsizei)height , (GLenum)format , (GLsizei)imageSize , (GLvoid*)floatArray  );\n        \n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCompressedTexSubImage2D'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCopyTexImage2D  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCopyTexImage2D00\nstatic int tolua_Cocos2d_glCopyTexImage2D00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,5, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 6, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 7, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 8, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 9, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        int level   = (int)tolua_tonumber(tolua_S,2,0);\n        unsigned int internalformat = (unsigned int)tolua_tonumber(tolua_S, 3, 0);\n        int x  = (int)tolua_tonumber(tolua_S, 4, 0);\n        int y   = (int)tolua_tonumber(tolua_S, 5, 0);\n        int width   = (int)tolua_tonumber(tolua_S, 6, 0);\n        int height = (int)tolua_tonumber(tolua_S,7,0);\n        int border   = (int)tolua_tonumber(tolua_S, 8, 0);\n        glCopyTexImage2D((GLenum)target , (GLint)level , (GLenum)internalformat , (GLint)x , (GLint)y , (GLsizei)width , (GLsizei)height , (GLint)border  );\n        \n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCopyTexImage2D'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCopyTexSubImage2D */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCopyTexSubImage2D00\nstatic int tolua_Cocos2d_glCopyTexSubImage2D00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,2, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S,5, 0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 6, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 7, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 8, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 9, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        int level   = (int)tolua_tonumber(tolua_S,2,0);\n        int xoffset = (int)tolua_tonumber(tolua_S, 3, 0);\n        int yoffset = (int)tolua_tonumber(tolua_S, 4, 0);\n        int x  = (int)tolua_tonumber(tolua_S, 5, 0);\n        int y   = (int)tolua_tonumber(tolua_S, 6, 0);\n        int width   = (int)tolua_tonumber(tolua_S, 7, 0);\n        int height = (int)tolua_tonumber(tolua_S,8,0);\n        glCopyTexSubImage2D((GLenum)target , (GLint)level , (GLint)xoffset ,(GLint)yoffset , (GLint)x , (GLint)y , (GLsizei)width , (GLsizei)height);\n        \n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCopyTexSubImage2D'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCreateProgram  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCreateProgram00\nstatic int tolua_Cocos2d_glCreateProgram00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isnoobj(tolua_S, 1, &tolua_err))\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int retVal = glCreateProgram();\n        tolua_pushnumber(tolua_S,retVal);\n        \n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCreateProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCreateShader  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCreateShader00\nstatic int tolua_Cocos2d_glCreateShader00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int type   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        int retVal = glCreateShader((GLenum)type  );\n        tolua_pushnumber(tolua_S,retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCreateShader'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glCullFace */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glCullFace00\nstatic int tolua_Cocos2d_glCullFace00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int mode   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glCullFace((GLenum)mode  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glCullFace'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDeleteBuffers  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDeleteBuffers00\nstatic int tolua_Cocos2d_glDeleteBuffers00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int buffers   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDeleteBuffers(1,&buffers );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDeleteBuffers'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDeleteFramebuffers  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDeleteFramebuffers00\nstatic int tolua_Cocos2d_glDeleteFramebuffers00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int framebuffers   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDeleteBuffers(1,&framebuffers );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDeleteFramebuffers'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDeleteProgram */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDeleteProgram00\nstatic int tolua_Cocos2d_glDeleteProgram00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int program   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDeleteProgram((GLuint)program);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDeleteProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDeleteRenderbuffers */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDeleteRenderbuffers00\nstatic int tolua_Cocos2d_glDeleteRenderbuffers00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int renderbuffers   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDeleteRenderbuffers(1,&renderbuffers);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDeleteRenderbuffers'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDeleteShader  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDeleteShader00\nstatic int tolua_Cocos2d_glDeleteShader00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int shader   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDeleteShader((GLuint)shader  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDeleteShader'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDeleteTextures  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDeleteTextures00\nstatic int tolua_Cocos2d_glDeleteTextures00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int textures   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDeleteTextures(1,&textures );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDeleteTextures'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDepthFunc  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDepthFunc00\nstatic int tolua_Cocos2d_glDepthFunc00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int func   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDepthFunc((GLenum)func);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDepthFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDepthMask  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDepthMask00\nstatic int tolua_Cocos2d_glDepthMask00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned char flag   = (unsigned char)tolua_tonumber(tolua_S,1,0);\n        glDepthMask((GLboolean)flag  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDepthMask'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDepthRangef  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDepthRangef00\nstatic int tolua_Cocos2d_glDepthRangef00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int zNear   = (int)tolua_tonumber(tolua_S,1,0);\n        int zFar    = (int)tolua_tonumber(tolua_S,2,0);\n        glDepthRangef((GLclampf)zNear , (GLclampf)zFar  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDepthRangef'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDetachShader  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDetachShader00\nstatic int tolua_Cocos2d_glDetachShader00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int program   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        unsigned int shader    = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        glDetachShader((GLuint)program , (GLuint)shader  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDetachShader'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDisable  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDisable00\nstatic int tolua_Cocos2d_glDisable00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int cap   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDisable((GLenum)cap );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDisable'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDisableVertexAttribArray */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDisableVertexAttribArray00\nstatic int tolua_Cocos2d_glDisableVertexAttribArray00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int index   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glDisableVertexAttribArray((GLuint)index  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDisableVertexAttribArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glDrawArrays  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDrawArrays00\nstatic int tolua_Cocos2d_glDrawArrays00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int mode   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        int first   = (unsigned int)tolua_tonumber(tolua_S,2,0);\n        int count   = (unsigned int)tolua_tonumber(tolua_S,3,0);\n        glDrawArrays((GLenum)mode , (GLint)first , (GLsizei)count );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDrawArrays'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\n/* function: glDrawElements  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glDrawElements00\nstatic int tolua_Cocos2d_glDrawElements00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err)            ||\n        !tolua_istable(tolua_S,5,0,&tolua_err)             ||\n        !tolua_isnoobj(tolua_S,6, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1  = (int)tolua_tonumber(tolua_S, 2, 0);\n        unsigned int arg2  = (unsigned int)tolua_tonumber(tolua_S, 3, 0);\n        unsigned int arg3  = (unsigned int)tolua_tonumber(tolua_S, 4, 0);\n        if (GL_UNSIGNED_BYTE == arg2)\n        {\n            unsigned char* unit8Array     = new unsigned char[arg3];\n            if (NULL == unit8Array)\n            {\n                return 0;\n            }\n            for (unsigned int i = 1; i <= arg3; i++)\n            {\n                unit8Array[i-1] = (unsigned char)tolua_tofieldnumber(tolua_S, 5, i, 0);\n            }\n            glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)unit8Array);\n            CC_SAFE_DELETE_ARRAY(unit8Array);\n        }\n        else if(GL_UNSIGNED_SHORT == arg2)\n        {\n            unsigned short* shortArray     = new unsigned short[arg3];\n            if (NULL == shortArray)\n            {\n                return 0;\n            }\n            for (unsigned int i = 1; i <= arg3; i++)\n            {\n                shortArray[i-1] = (unsigned short)tolua_tofieldnumber(tolua_S, 5, i, 0);\n            }\n            glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)shortArray);\n            CC_SAFE_DELETE_ARRAY(shortArray);\n        }\n        else if(GL_UNSIGNED_INT == arg2)\n        {\n            unsigned int* intArray     = new unsigned int[arg3];\n            if (NULL == intArray)\n            {\n                return 0;\n            }\n            for (unsigned int i = 1; i <= arg3; i++)\n            {\n                intArray[i-1] = (unsigned int)tolua_tofieldnumber(tolua_S, 5, i, 0);\n            }\n            glDrawElements((GLenum)arg0 , (GLsizei)arg1 , (GLenum)arg2 , (GLvoid*)intArray);\n            CC_SAFE_DELETE_ARRAY(intArray);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glDrawElements'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\n/* function: glEnable  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glEnable00\nstatic int tolua_Cocos2d_glEnable00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int cap   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glEnable((GLenum)cap);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glEnable'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glEnableVertexAttribArray */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glEnableVertexAttribArray00\nstatic int tolua_Cocos2d_glEnableVertexAttribArray00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int index   = (unsigned int)tolua_tonumber(tolua_S,1,0);\n        glEnableVertexAttribArray((GLuint)index);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glEnableVertexAttribArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glFinish */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glFinish00\nstatic int tolua_Cocos2d_glFinish00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S, 1, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        glFinish();\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glFinish'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glFlush */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glFlush00\nstatic int tolua_Cocos2d_glFlush00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S, 1, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        glFlush();\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glFlush'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glFramebufferRenderbuffer  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glFramebufferRenderbuffer00\nstatic int tolua_Cocos2d_glFramebufferRenderbuffer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int attachment = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        unsigned int renderbuffertarget = (unsigned int)tolua_tonumber(tolua_S, 3, 0);\n        unsigned int renderbuffer = (unsigned int)tolua_tonumber(tolua_S, 4, 0);\n        glFramebufferRenderbuffer((GLenum)target , (GLenum)attachment , (GLenum)renderbuffertarget , (GLuint)renderbuffer  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glFramebufferRenderbuffer'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glFramebufferTexture2D  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glFramebufferTexture2D00\nstatic int tolua_Cocos2d_glFramebufferTexture2D00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 6, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int attachment = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        unsigned int textarget = (unsigned int)tolua_tonumber(tolua_S, 3, 0);\n        unsigned int texture = (unsigned int)tolua_tonumber(tolua_S, 4, 0);\n        int level = (int)tolua_tonumber(tolua_S, 5, 0);\n        glFramebufferTexture2D((GLenum)target , (GLenum)attachment , (GLenum)textarget , (GLuint)texture,(GLuint)level );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glFramebufferTexture2D'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glFrontFace */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glFrontFace00\nstatic int tolua_Cocos2d_glFrontFace00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int mode = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glFrontFace((GLenum)mode);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glFrontFace'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGenBuffers */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGenBuffers00\nstatic int tolua_Cocos2d_glGenBuffers00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S, 1, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int buffer = 0;\n        glGenBuffers(1, &buffer);\n        tolua_pushnumber(tolua_S, buffer);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGenBuffers'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGenFramebuffers  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGenFramebuffers00\nstatic int tolua_Cocos2d_glGenFramebuffers00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int framebuffer = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glGenFramebuffers(1, &framebuffer);\n        tolua_pushnumber(tolua_S, framebuffer);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGenFramebuffers'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGenRenderbuffers  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGenRenderbuffers00\nstatic int tolua_Cocos2d_glGenRenderbuffers00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int renderbuffer = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glGenRenderbuffers(1, &renderbuffer);\n        tolua_pushnumber(tolua_S, renderbuffer);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGenRenderbuffers'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGenTextures  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGenTextures00\nstatic int tolua_Cocos2d_glGenTextures00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S, 1, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        GLuint texture;\n        glGenTextures(1, &texture);\n        tolua_pushnumber(tolua_S, texture);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGenTextures'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGenerateMipmap  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGenerateMipmap00\nstatic int tolua_Cocos2d_glGenerateMipmap00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int target = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glGenerateMipmap((GLenum)target );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGenerateMipmap'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetActiveAttrib  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetActiveAttrib00\nstatic int tolua_Cocos2d_glGetActiveAttrib00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        GLsizei length;\n        glGetProgramiv(arg0, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &length);\n        GLchar* buffer = new GLchar[length];\n        GLint size = -1;\n        GLenum type = -1;\n        glGetActiveAttrib(arg0, arg1, length, NULL, &size, &type, buffer);\n        lua_pushnumber(tolua_S, size);\n        lua_pushnumber(tolua_S, type);\n        //may check\n        std::string name = buffer;\n        lua_pushstring(tolua_S, name.c_str());\n        CC_SAFE_DELETE_ARRAY(buffer);\n    }\n    return 3;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetActiveAttrib'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetActiveUniform  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetActiveUniform00\nstatic int tolua_Cocos2d_glGetActiveUniform00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        GLsizei length;\n        glGetProgramiv(arg0, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &length);\n        GLchar* buffer = new GLchar[length];\n        GLint size = -1;\n        GLenum type = -1;\n        glGetActiveUniform(arg0, arg1, length, NULL, &size, &type, buffer);\n        lua_pushnumber(tolua_S, size);\n        lua_pushnumber(tolua_S, type);\n        //may check\n        std::string name = buffer;\n        lua_pushstring(tolua_S, name.c_str());\n        CC_SAFE_DELETE_ARRAY(buffer);\n    }\n    return 3;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetActiveUniform'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetAttachedShaders */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetAttachedShaders00\nstatic int tolua_Cocos2d_glGetAttachedShaders00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        GLsizei length;\n        glGetProgramiv(arg0, GL_ATTACHED_SHADERS, &length);\n        GLuint* buffer = new GLuint[length];\n        memset(buffer, 0, length * sizeof(GLuint));\n        //Fix bug 2448, it seems that glGetAttachedShaders will crash if we send NULL to the third parameter (eg Windows), same as in JS binding\n        GLsizei realShaderCount = 0;\n        glGetAttachedShaders(arg0, length, &realShaderCount, buffer);\n       \n        lua_newtable(tolua_S);                                        /* L: table */\n        int index = 1;\n        for (int  i = 0; i < length; i++)\n        {\n            lua_pushnumber(tolua_S, buffer[i]);                       /* L: table value */\n            lua_rawseti(tolua_S, -2, index);                          /* table[index] = value, L: table */\n            ++index;\n        }\n        CC_SAFE_DELETE_ARRAY(buffer);        \n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetAttachedShaders'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetAttribLocation  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetAttribLocation00\nstatic int tolua_Cocos2d_glGetAttribLocation00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)          ||\n        !tolua_isstring(tolua_S, 2, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int program = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        const char*  name    = (const char*)tolua_tostring(tolua_S, 2, \"\");\n        int retVal = glGetAttribLocation((GLuint)program , name  );\n        lua_pushnumber(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetAttribLocation'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetError  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetError00\nstatic int tolua_Cocos2d_glGetError00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S, 1, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int retVal = glGetError();\n        lua_pushnumber(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetAttribLocation'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetProgramInfoLog */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetProgramInfoLog00\nstatic int tolua_Cocos2d_glGetProgramInfoLog00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        GLsizei length;\n        glGetProgramiv(arg0, GL_INFO_LOG_LENGTH, &length);\n        GLchar* src = new GLchar[length];\n        glGetProgramInfoLog(arg0, length, NULL, src);\n        lua_pushstring(tolua_S, src);\n        CC_SAFE_DELETE_ARRAY(src);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetProgramInfoLog'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetProgramiv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetProgramiv00\nstatic int tolua_Cocos2d_glGetProgramiv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1  = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        GLint ret;\n        glGetProgramiv(arg0, arg1, &ret);\n        lua_pushnumber(tolua_S, ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetProgramiv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetShaderInfoLog  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetShaderInfoLog00\nstatic int tolua_Cocos2d_glGetShaderInfoLog00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        GLsizei length;\n        glGetShaderiv(arg0, GL_INFO_LOG_LENGTH, &length);\n        GLchar* src = new GLchar[length];\n        glGetShaderInfoLog(arg0, length, NULL, src);\n        lua_pushstring(tolua_S, src);\n        CC_SAFE_DELETE_ARRAY(src);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetShaderInfoLog'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetShaderSource  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetShaderSource00\nstatic int tolua_Cocos2d_glGetShaderSource00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        GLsizei length;\n        glGetShaderiv(arg0, GL_SHADER_SOURCE_LENGTH, &length);\n        GLchar* src = new GLchar[length];\n        glGetShaderSource(arg0, length, NULL, src);\n        lua_pushstring(tolua_S, src);\n        CC_SAFE_DELETE_ARRAY(src);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetShaderSource'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetShaderiv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetShaderiv00\nstatic int tolua_Cocos2d_glGetShaderiv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1  = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        GLint ret;\n        glGetShaderiv(arg0, arg1, &ret);\n        lua_pushnumber(tolua_S, ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetShaderiv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetTexParameterfv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetTexParameterfv00\nstatic int tolua_Cocos2d_glGetTexParameterfv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1  = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        GLfloat param;\n        glGetTexParameterfv(arg0, arg1, &param);\n        lua_pushnumber(tolua_S, param);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetTexParameterfv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\n/* function: glGetUniformLocation  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetUniformLocation00\nstatic int tolua_Cocos2d_glGetUniformLocation00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isstring(tolua_S, 2,0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        const char*  arg1 = tolua_tostring(tolua_S, 2, \"\");\n        int retVal = glGetUniformLocation((GLuint)arg0 , arg1  );\n        lua_pushnumber(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetUniformLocation'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glGetUniformfv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glGetUniformfv00\nstatic int tolua_Cocos2d_glGetUniformfv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S, 2,0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        \n        GLsizei length;\n        glGetProgramiv(arg0, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &length);\n        GLchar* namebuffer = new GLchar[length];\n        GLint size = -1;\n        GLenum type = -1;\n        \n        glGetActiveUniform(arg0, arg1, length, NULL, &size, &type, namebuffer);\n        CC_SAFE_DELETE_ARRAY(namebuffer);\n        \n        int usize = 0;\n        int utype = 0;\n        switch(type) {\n                // float\n            case GL_FLOAT:\n                usize = 1;\n                utype = GL_FLOAT;\n                break;\n            case GL_FLOAT_MAT2:\n                usize = 2 * 2;\n                utype = GL_FLOAT;\n                break;\n            case GL_FLOAT_MAT3:\n                usize = 3 * 3;\n                utype = GL_FLOAT;\n                break;\n            case GL_FLOAT_MAT4:\n                usize = 4 * 4;\n                utype = GL_FLOAT;\n                break;\n            case GL_FLOAT_VEC2:\n                usize = 2;\n                utype = GL_FLOAT;\n                break;\n            case GL_FLOAT_VEC3:\n                usize = 3;\n                utype = GL_FLOAT;\n                break;\n            case GL_FLOAT_VEC4:\n                usize = 4;\n                utype = GL_FLOAT;\n                break;\n                \n                // int\n            case GL_INT:\n                usize = 1;\n                utype = GL_INT;\n                break;\n            case GL_INT_VEC2:\n                usize = 1;\n                utype = GL_INT;\n                break;\n            case GL_INT_VEC3:\n                usize = 1;\n                utype = GL_INT;\n                break;\n            case GL_INT_VEC4:\n                usize = 1;\n                utype = GL_INT;\n                break;\n                \n            default:\n#ifndef TOLUA_RELEASE\n                tolua_error(tolua_S,\"#ferror in function 'glGetUniformfv'.\",&tolua_err);\n                return 0;\n#endif\n                break;\n        }\n        if( utype == GL_FLOAT) {\n            GLfloat* param = new GLfloat[usize];\n            glGetUniformfv(arg0, arg1, param);\n            \n            lua_newtable(tolua_S);                                        /* L: table */\n            int index = 1;\n            for (int  i = 0; i < usize; i++)\n            {\n                lua_pushnumber(tolua_S, param[i]);                       /* L: table value */\n                lua_rawseti(tolua_S, -2, index);                          /* table[index] = value, L: table */\n                ++index;\n            }\n            CC_SAFE_DELETE_ARRAY(param);\n            \n        } else if( utype == GL_INT ) {\n            GLint* param = new GLint[usize];\n            glGetUniformiv(arg0, arg1, param);\n            \n            lua_newtable(tolua_S);                                        /* L: table */\n            int index = 1;\n            for (int  i = 0; i < usize; i++)\n            {\n                lua_pushnumber(tolua_S, param[i]);                       /* L: table value */\n                lua_rawseti(tolua_S, -2, index);                          /* table[index] = value, L: table */\n                ++index;\n            }\n            CC_SAFE_DELETE_ARRAY(param);\n        }\n\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glGetUniformfv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glHint  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glHint00\nstatic int tolua_Cocos2d_glHint00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,2,0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int  arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        glHint((GLenum)arg0 , (GLenum)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glHint'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glIsBuffer  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glIsBuffer00\nstatic int tolua_Cocos2d_glIsBuffer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        bool retVal = glIsBuffer((GLuint)arg0  );\n        lua_pushboolean(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glIsBuffer'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glIsEnabled  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glIsEnabled00\nstatic int tolua_Cocos2d_glIsEnabled00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        bool retVal = glIsEnabled((GLenum)arg0  );\n        lua_pushboolean(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glIsEnabled'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glIsFramebuffer */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glIsFramebuffer00\nstatic int tolua_Cocos2d_glIsFramebuffer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        bool retVal = glIsFramebuffer((GLuint)arg0  );\n        lua_pushboolean(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glIsFramebuffer'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glIsProgram  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glIsProgram00\nstatic int tolua_Cocos2d_glIsProgram00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        bool retVal = glIsProgram((GLuint)arg0  );\n        lua_pushboolean(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glIsProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glIsRenderbuffer */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glIsRenderbuffer00\nstatic int tolua_Cocos2d_glIsRenderbuffer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        bool retVal = glIsRenderbuffer((GLuint)arg0  );\n        lua_pushboolean(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glIsRenderbuffer'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glIsShader */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glIsShader00\nstatic int tolua_Cocos2d_glIsShader00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        bool retVal = glIsShader((GLuint)arg0  );\n        lua_pushboolean(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glIsShader'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glIsTexture  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glIsTexture00\nstatic int tolua_Cocos2d_glIsTexture00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        bool retVal = glIsTexture((GLuint)arg0  );\n        lua_pushboolean(tolua_S, retVal);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glIsTexture'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glLineWidth  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glLineWidth00\nstatic int tolua_Cocos2d_glLineWidth00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        float arg0  = (float)tolua_tonumber(tolua_S, 1, 0);\n        glLineWidth((GLfloat)arg0  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glLineWidth'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glLinkProgram */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glLinkProgram00\nstatic int tolua_Cocos2d_glLinkProgram00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glLinkProgram((GLuint)arg0  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glLinkProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glPixelStorei  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glPixelStorei00\nstatic int tolua_Cocos2d_glPixelStorei00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0  = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1  = (int)tolua_tonumber(tolua_S, 2, 0);\n        glPixelStorei((GLenum)arg0 , (GLint)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glPixelStorei'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glPolygonOffset */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glPolygonOffset00\nstatic int tolua_Cocos2d_glPolygonOffset00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)            ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0  = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1  = (int)tolua_tonumber(tolua_S, 2, 0);\n        glPolygonOffset((GLfloat)arg0 , (GLfloat)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glPolygonOffset'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\n/* function: glReadPixels  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glReadPixels00\nstatic int tolua_Cocos2d_glReadPixels00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,5,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,6,0,&tolua_err)            ||\n        !tolua_isnumber(tolua_S,7, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S,8, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0  = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1  = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2  = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3  = (int)tolua_tonumber(tolua_S, 4, 0);\n        unsigned int arg4  = (unsigned int)tolua_tonumber(tolua_S, 5, 0);\n        unsigned int arg5  = (unsigned int)tolua_tonumber(tolua_S, 6, 0);\n        \n        long length   = (long)tolua_tonumber(tolua_S,7,0);\n        unsigned char* unit8Array     = new unsigned char[length];\n        if (NULL == unit8Array)\n        {\n            return  0;\n        }\n        for (int i = 0; i < length; i++)\n        {\n            unit8Array[i] = 0;\n        }\n\n        glReadPixels((GLint)arg0 , (GLint)arg1 , (GLsizei)arg2 , (GLsizei)arg3 , (GLenum)arg4 , (GLenum)arg5 , (GLvoid*)unit8Array);\n        \n        lua_newtable(tolua_S);                                              /* L: table */\n        int index = 1;\n        for (int i = 0; i < length; i++)\n        {\n            lua_pushnumber(tolua_S, unit8Array[i]);                   /* L: unit8 value */\n            lua_rawseti(tolua_S, -2, index);                          /* table[index] = value, L: table */\n            ++index;\n        }\n        \n        CC_SAFE_DELETE_ARRAY(unit8Array);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glReadPixels'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glReleaseShaderCompiler  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glReleaseShaderCompiler00\nstatic int tolua_Cocos2d_glReleaseShaderCompiler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S, 1, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        glReleaseShaderCompiler( );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glReleaseShaderCompiler'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glRenderbufferStorage  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glRenderbufferStorage00\nstatic int tolua_Cocos2d_glRenderbufferStorage00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        glRenderbufferStorage((GLenum)arg0 , (GLenum)arg1 , (GLsizei)arg2 , (GLsizei)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glRenderbufferStorage'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glSampleCoverage */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glSampleCoverage00\nstatic int tolua_Cocos2d_glSampleCoverage00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned short arg1 = (unsigned short)tolua_tonumber(tolua_S, 2, 0);\n        glSampleCoverage((GLclampf)arg0 , (GLboolean)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glSampleCoverage'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glScissor */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glScissor00\nstatic int tolua_Cocos2d_glScissor00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        glScissor((GLint)arg0 , (GLint)arg1 , (GLsizei)arg2 , (GLsizei)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glScissor'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glShaderSource  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glShaderSource00\nstatic int tolua_Cocos2d_glShaderSource00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isstring(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        const char* arg1 = tolua_tostring(tolua_S, 2, \"\");\n        glShaderSource(arg0, 1, &arg1, NULL);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glShaderSource'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glStencilFunc */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glStencilFunc00\nstatic int tolua_Cocos2d_glStencilFunc00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        unsigned int arg2 = (unsigned int)tolua_tonumber(tolua_S, 3, 0);        \n        glStencilFunc((GLenum)arg0 , (GLint)arg1 , (GLuint)arg2  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glStencilFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glStencilFuncSeparate  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glStencilFuncSeparate00\nstatic int tolua_Cocos2d_glStencilFuncSeparate00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        unsigned int arg3 = (unsigned int)tolua_tonumber(tolua_S, 4, 0);\n        glStencilFuncSeparate((GLenum)arg0 , (GLenum)arg1 , (GLint)arg2 , (GLuint)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glStencilFuncSeparate'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glStencilMask  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glStencilMask00\nstatic int tolua_Cocos2d_glStencilMask00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glStencilMask((GLuint)arg0);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glStencilMask'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glStencilMaskSeparate  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glStencilMaskSeparate00\nstatic int tolua_Cocos2d_glStencilMaskSeparate00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        glStencilMaskSeparate((GLenum)arg0 , (GLuint)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glStencilMaskSeparate'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glStencilOp  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glStencilOp00\nstatic int tolua_Cocos2d_glStencilOp00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        unsigned int arg2 = (unsigned int)tolua_tonumber(tolua_S, 3, 0);\n        glStencilOp((GLenum)arg0 , (GLenum)arg1 , (GLenum)arg2  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glStencilOp'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glStencilOpSeparate */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glStencilOpSeparate00\nstatic int tolua_Cocos2d_glStencilOpSeparate00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        unsigned int arg2 = (unsigned int)tolua_tonumber(tolua_S, 3, 0);\n        unsigned int arg3 = (unsigned int)tolua_tonumber(tolua_S, 4, 0);\n        glStencilOpSeparate((GLenum)arg0 , (GLenum)arg1 , (GLenum)arg2 , (GLenum)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glStencilOpSeparate'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glTexImage2D  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glTexImage2D00\nstatic int tolua_Cocos2d_glTexImage2D00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 6, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 7, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 8, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 9, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 10, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 11, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        int arg4 = (int)tolua_tonumber(tolua_S, 5, 0);\n        int arg5 = (int)tolua_tonumber(tolua_S, 6, 0);\n        unsigned int arg6 = (unsigned int)tolua_tonumber(tolua_S, 7, 0);\n        unsigned int arg7 = (unsigned int)tolua_tonumber(tolua_S, 8, 0);\n        unsigned int arg8 = (unsigned int)tolua_tonumber(tolua_S, 9, 0);\n        \n        unsigned char* unit8Array     = new unsigned char[arg8];\n        if (NULL == unit8Array)\n        {\n            return  0;\n        }\n        \n        for (unsigned int i = 1; i <= arg8; i++)\n        {\n            unit8Array[i-1] = (unsigned char)tolua_tofieldnumber(tolua_S, 10, i, 0);\n        }\n        \n        glTexImage2D((GLenum)arg0 , (GLint)arg1 , (GLint)arg2 , (GLsizei)arg3 , (GLsizei)arg4 , (GLint)arg5 , (GLenum)arg6 , (GLenum)arg7 , (GLvoid*)unit8Array);\n\n//        lua_newtable(tolua_S);                                         /* L: table */\n//        int index = 1;\n//        for (int i = 0; i < arg8; i++)\n//        {\n//            lua_pushnumber(tolua_S, unit8Array[i]);                   /* L: unit8 value */\n//            lua_rawseti(tolua_S, -2, index);                          /* table[index] = value, L: table */\n//            ++index;\n//        }\n\n        \n        CC_SAFE_DELETE_ARRAY(unit8Array);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glTexImage2D'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glTexParameterf  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glTexParameterf00\nstatic int tolua_Cocos2d_glTexParameterf00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        glTexParameterf((GLenum)arg0 , (GLenum)arg1 , (GLfloat)arg2  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glTexParameterf'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glTexParameteri */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glTexParameteri00\nstatic int tolua_Cocos2d_glTexParameteri00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned int arg1 = (unsigned int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        glTexParameteri((GLenum)arg0 , (GLenum)arg1 , (GLint)arg2  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glTexParameteri'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glTexSubImage2D  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glTexSubImage2D00\nstatic int tolua_Cocos2d_glTexSubImage2D00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 6, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 7, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 8, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 9, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 10, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        int arg4 = (int)tolua_tonumber(tolua_S, 5, 0);\n        int arg5 = (int)tolua_tonumber(tolua_S, 6, 0);\n        unsigned int arg6 = (unsigned int)tolua_tonumber(tolua_S, 7, 0);\n        unsigned int arg7 = (unsigned int)tolua_tonumber(tolua_S, 8, 0);\n        unsigned int arg8 = (unsigned int)tolua_tonumber(tolua_S, 9, 0);\n        \n        unsigned char* unit8Array     = new unsigned char[arg8];\n        if (NULL == unit8Array)\n        {\n            return  0;\n        }\n        for (unsigned int i = 0; i < arg8; i++)\n        {\n            unit8Array[i] = 0;\n        }\n        \n        glTexSubImage2D((GLenum)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3 , (GLsizei)arg4 , (GLsizei)arg5 , (GLenum)arg6 , (GLenum)arg7 , (GLvoid*)unit8Array  );\n        \n        lua_newtable(tolua_S);                                         /* L: table */\n        int index = 1;\n        for (unsigned int i = 0; i < arg8; i++)\n        {\n            lua_pushnumber(tolua_S, unit8Array[i]);                   /* L: unit8 value */\n            lua_rawseti(tolua_S, -2, index);                          /* table[index] = value, L: table */\n            ++index;\n        }\n        \n        CC_SAFE_DELETE_ARRAY(unit8Array);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glTexSubImage2D'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform1f */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform1f00\nstatic int tolua_Cocos2d_glUniform1f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        glUniform1f((GLint)arg0 , (GLfloat)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform1f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform1fv */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform1fv00\nstatic int tolua_Cocos2d_glUniform1fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        float* floatArray     = new float[arg2];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform1fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform1fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform1i */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform1i00\nstatic int tolua_Cocos2d_glUniform1i00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        glUniform1i((GLint)arg0 , (GLint)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform1i'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform1iv */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform1iv00\nstatic int tolua_Cocos2d_glUniform1iv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int* intArray   = new int[arg2];\n        if (NULL == intArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            intArray[i-1] = (int)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform1iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)intArray  );\n        CC_SAFE_DELETE_ARRAY(intArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform1fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform2f  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform2f00\nstatic int tolua_Cocos2d_glUniform2f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        glUniform2f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform2f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform2fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform2fv00\nstatic int tolua_Cocos2d_glUniform2fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        float* floatArray     = new float[arg2];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform1fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform2fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform2i */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform2i00\nstatic int tolua_Cocos2d_glUniform2i00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        glUniform2i((GLint)arg0 , (GLint)arg1 , (GLint)arg2  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform2i'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform2iv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform2iv00\nstatic int tolua_Cocos2d_glUniform2iv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int* intArray   = new int[arg2];\n        if (NULL == intArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            intArray[i-1] = (int)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform2iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)intArray  );\n        CC_SAFE_DELETE_ARRAY(intArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform2iv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform3f */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform3f00\nstatic int tolua_Cocos2d_glUniform3f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        glUniform3f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform4f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform3fv */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform3fv00\nstatic int tolua_Cocos2d_glUniform3fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        float* floatArray     = new float[arg2];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform1fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform3fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform3i  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform3i00\nstatic int tolua_Cocos2d_glUniform3i00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        glUniform3i((GLint)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform3i'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform3iv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform3iv00\nstatic int tolua_Cocos2d_glUniform3iv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int* intArray   = new int[arg2];\n        if (NULL == intArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            intArray[i-1] = (int)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform3iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)intArray  );\n        CC_SAFE_DELETE_ARRAY(intArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform3iv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform4f  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform4f00\nstatic int tolua_Cocos2d_glUniform4f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 6, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        int arg4 = (int)tolua_tonumber(tolua_S, 5, 0);\n        glUniform4f((GLint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 , (GLfloat)arg4  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform4f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform4fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform4fv00\nstatic int tolua_Cocos2d_glUniform4fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        float* floatArray     = new float[arg2];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform4fv((GLint)arg0 , (GLsizei)arg1 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform4fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform4i  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform4i00\nstatic int tolua_Cocos2d_glUniform4i00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 6, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        int arg4 = (int)tolua_tonumber(tolua_S, 5, 0);\n        glUniform4i((GLint)arg0 , (GLint)arg1 , (GLint)arg2 , (GLint)arg3 , (GLint)arg4  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform4i'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniform4iv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniform4iv00\nstatic int tolua_Cocos2d_glUniform4iv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int* intArray   = new int[arg2];\n        if (NULL == intArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            intArray[i-1] = (int)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniform4iv((GLint)arg0 , (GLsizei)arg1 , (GLint*)intArray  );\n        CC_SAFE_DELETE_ARRAY(intArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniform4iv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniformMatrix2fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniformMatrix2fv00\nstatic int tolua_Cocos2d_glUniformMatrix2fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned short arg1 = (unsigned short)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        float* floatArray   = new float[arg2];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        for (int i = 1; i <= arg2; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        glUniformMatrix2fv(arg0, 1, (GLboolean)arg1 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniformMatrix2fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniformMatrix3fv */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniformMatrix3fv00\nstatic int tolua_Cocos2d_glUniformMatrix3fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        unsigned short arg1 = (unsigned short)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        float* floatArray   = new float[arg2];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        \n        for (int i = 1; i <= arg2; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        \n        glUniformMatrix3fv(arg0, 1, (GLboolean)arg1 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniformMatrix3fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUniformMatrix4fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUniformMatrix4fv00\nstatic int tolua_Cocos2d_glUniformMatrix4fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isboolean(tolua_S, 2, 0, &tolua_err)        ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        bool arg1 = (bool)tolua_toboolean(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        float* floatArray   = new float[arg2];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        \n        for (int i = 1; i <= arg2; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 4, i, 0);\n        }\n        \n        glUniformMatrix4fv(arg0, 1, (GLboolean)arg1 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUniformMatrix4fv'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glUseProgram  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glUseProgram00\nstatic int tolua_Cocos2d_glUseProgram00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glUseProgram((GLuint)arg0  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glUseProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glValidateProgram  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glValidateProgram00\nstatic int tolua_Cocos2d_glValidateProgram00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        glValidateProgram((GLuint)arg0  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glValidateProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib1f */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib1f00\nstatic int tolua_Cocos2d_glVertexAttrib1f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1          = (int)tolua_tonumber(tolua_S, 2, 0);\n        glVertexAttrib1f((GLuint)arg0 , (GLfloat)arg1  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib1f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib1fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib1fvf00\nstatic int tolua_Cocos2d_glVertexAttrib1fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        float* floatArray   = new float[arg1];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        \n        for (int i = 1; i <= arg1; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 3, i, 0);\n        }\n        \n        glVertexAttrib1fv((GLuint)arg0 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib1fv'.\",&tolua_err);\n    return 0;\n#endif\n\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib2f  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib2f00\nstatic int tolua_Cocos2d_glVertexAttrib2f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1          = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2          = (int)tolua_tonumber(tolua_S, 3, 0);\n        glVertexAttrib2f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib2f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib2fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib2fv00\nstatic int tolua_Cocos2d_glVertexAttrib2fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        float* floatArray   = new float[arg1];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        \n        for (int i = 1; i <= arg1; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 3, i, 0);\n        }\n        \n        glVertexAttrib2fv((GLuint)arg0 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib2fv'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib3f  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib3f00\nstatic int tolua_Cocos2d_glVertexAttrib3f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1          = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2          = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3          = (int)tolua_tonumber(tolua_S, 4, 0);\n        glVertexAttrib3f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib3f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib3fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib3fv00\nstatic int tolua_Cocos2d_glVertexAttrib3fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        float* floatArray   = new float[arg1];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        \n        for (int i = 1; i <= arg1; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 3, i, 0);\n        }\n        \n        glVertexAttrib3fv((GLuint)arg0 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib3fv'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib4f  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib4f00\nstatic int tolua_Cocos2d_glVertexAttrib4f00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 6, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1          = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2          = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3          = (int)tolua_tonumber(tolua_S, 4, 0);\n        int arg4          = (int)tolua_tonumber(tolua_S, 5, 0);\n        glVertexAttrib4f((GLuint)arg0 , (GLfloat)arg1 , (GLfloat)arg2 , (GLfloat)arg3 , (GLfloat)arg4  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib4f'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttrib4fv  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttrib4fv00\nstatic int tolua_Cocos2d_glVertexAttrib4fv00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err)          ||\n        !tolua_isnoobj(tolua_S, 4, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        float* floatArray   = new float[arg1];\n        if (NULL == floatArray)\n        {\n            return  0;\n        }\n        \n        for (int i = 1; i <= arg1; i++)\n        {\n            floatArray[i-1] = (float)tolua_tofieldnumber(tolua_S, 3, i, 0);\n        }\n        \n        glVertexAttrib4fv((GLuint)arg0 , (GLfloat*)floatArray  );\n        CC_SAFE_DELETE_ARRAY(floatArray);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttrib4fv'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glVertexAttribPointer  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glVertexAttribPointer00\nstatic int tolua_Cocos2d_glVertexAttribPointer00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isboolean(tolua_S, 4, 0, &tolua_err)        ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 6, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 7, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int arg0 = (unsigned int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        unsigned int arg2 = (unsigned int)tolua_tonumber(tolua_S, 3, 0);\n        bool arg3 = tolua_toboolean(tolua_S, 4, 0);\n        int arg4 = (int)tolua_tonumber(tolua_S, 5, 0);\n        //int arg5 = (int)tolua_tonumber(tolua_S, 7, 0);\n        glVertexAttribPointer((GLuint)arg0 , (GLint)arg1 , (GLenum)arg2 , (GLboolean)arg3 , (GLsizei)arg4 , (GLvoid*)NULL);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glVertexAttribPointer'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glViewport  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glViewport00\nstatic int tolua_Cocos2d_glViewport00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 2, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err)         ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 5, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        int arg1 = (int)tolua_tonumber(tolua_S, 2, 0);\n        int arg2 = (int)tolua_tonumber(tolua_S, 3, 0);\n        int arg3 = (int)tolua_tonumber(tolua_S, 4, 0);\n        glViewport((GLint)arg0 , (GLint)arg1 , (GLsizei)arg2 , (GLsizei)arg3  );\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glViewport'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: glEnableVertexAttribs  */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_glEnableVertexAttribs00\nstatic int tolua_Cocos2d_glEnableVertexAttribs00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S, 1, 0, &tolua_err)         ||\n        !tolua_isnoobj(tolua_S, 2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int arg0 = (int)tolua_tonumber(tolua_S, 1, 0);\n        GL::enableVertexAttribs(arg0);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'glEnableVertexAttribs'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: DrawPoint in the DrawPrimitives namespace */\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_ccDrawPoint00\nstatic int tolua_cocos2d_DrawPrimitives_drawPoint00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_istable(tolua_S,1,0, &tolua_err) ||\n        !tolua_isnoobj(tolua_S,2, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point point;\n        if(luaval_to_point(tolua_S, 1, &point))\n        {\n            DrawPrimitives::drawPoint(point);\n        }        \n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawPoint'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawPoints in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_DrawPoints00\nstatic int tolua_cocos2d_DrawPrimitives_drawPoints00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int numberOfPoints = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        \n        if (numberOfPoints > 0)\n        {\n            Point* points = new Point[numberOfPoints];\n            if (NULL == points)\n                return 0;\n            \n            for (int i = 0; i < numberOfPoints; i++)\n            {\n                lua_pushnumber(tolua_S,i + 1);\n                lua_gettable(tolua_S,1);\n                if (!tolua_istable(tolua_S,-1, 0, &tolua_err))\n                {\n                    CC_SAFE_DELETE_ARRAY(points);\n                    goto tolua_lerror;\n                }\n                \n                if(!luaval_to_point(tolua_S, lua_gettop(tolua_S), &points[i]))\n                {\n                    lua_pop(tolua_S, 1);\n                    CC_SAFE_DELETE_ARRAY(points);\n                    return 0;\n                }\n                lua_pop(tolua_S, 1);\n            }\n            DrawPrimitives::drawPoints(points, numberOfPoints);\n            CC_SAFE_DELETE_ARRAY(points);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawPoints'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawLine in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawLine00\nstatic int tolua_cocos2d_DrawPrimitives_drawLine00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_istable(tolua_S, 2, 0,&tolua_err)  ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n       )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point origin;\n        if (!luaval_to_point(tolua_S, 1, &origin))\n            return 0;\n        \n        Point destination;\n        if (!luaval_to_point(tolua_S, 2, &destination))\n            return 0;\n        \n        DrawPrimitives::drawLine(origin,destination);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawLine'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawRect in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawRect00\nstatic int tolua_cocos2d_DrawPrimitives_drawRect00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_istable(tolua_S, 2, 0,&tolua_err)  ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point origin;\n        if (!luaval_to_point(tolua_S, 1, &origin))\n            return 0;\n\n        Point destination;\n        if (!luaval_to_point(tolua_S, 2, &destination))\n            return 0;\n\n        DrawPrimitives::drawRect(origin,destination);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawRect'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawSolidRect in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_DrawPrimitives_drawSolidRect00\nstatic int tolua_cocos2d_DrawPrimitives_drawSolidRect00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_istable(tolua_S, 2, 0, &tolua_err) ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point origin;\n        if (!luaval_to_point(tolua_S, 1, &origin))\n            return 0;\n        \n        Point destination;\n        if (!luaval_to_point(tolua_S, 2, &destination)) \n            return 0;\n        \n        Color4F color;\n        if (!luaval_to_color4f(tolua_S, 3, &color))\n            return 0;\n\n \n        DrawPrimitives::drawSolidRect(origin,destination,color);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawSolidRect'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawPoly in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawPoly00\nstatic int tolua_cocos2d_DrawPrimitives_drawPoly00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int numOfVertices = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        bool closePolygon = ((bool)  tolua_toboolean(tolua_S,3,0));\n\n        if (numOfVertices > 0)\n        {\n            Point* points = new Point[numOfVertices];\n            if (NULL == points)\n                return 0;\n\n            for (int i = 0; i < numOfVertices; i++)\n            {\n                lua_pushnumber(tolua_S,i + 1);\n                lua_gettable(tolua_S,1);\n                if (!tolua_istable(tolua_S,-1, 0, &tolua_err))\n                {\n                    CC_SAFE_DELETE_ARRAY(points);\n                    goto tolua_lerror;\n                }\n                \n                if(!luaval_to_point(tolua_S, lua_gettop(tolua_S), &points[i]))\n                {\n                    lua_pop(tolua_S, 1);\n                    CC_SAFE_DELETE_ARRAY(points);\n                    return 0;\n                }\n                lua_pop(tolua_S, 1);\n            }\n            DrawPrimitives::drawPoly(points,numOfVertices,closePolygon);\n            CC_SAFE_DELETE_ARRAY(points);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'ccDrawPoly'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawSolidPoly in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawSolidPoly00\nstatic int tolua_cocos2d_DrawPrimitives_drawSolidPoly00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)   ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int numberOfPoints = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        if (numberOfPoints > 0)\n        {\n            Point* points = new Point[numberOfPoints];\n            if (NULL == points)\n                return 0;\n\n            for (int i = 0; i < numberOfPoints; i++)\n            {\n                lua_pushnumber(tolua_S,i + 1);\n                lua_gettable(tolua_S,1);\n                if (!tolua_istable(tolua_S,-1, 0, &tolua_err))\n                {\n                    CC_SAFE_DELETE_ARRAY(points);\n                    goto tolua_lerror;\n                }\n                \n                if(!luaval_to_point(tolua_S, lua_gettop(tolua_S), &points[i]))\n                {\n                    lua_pop(tolua_S, 1);\n                    CC_SAFE_DELETE_ARRAY(points);\n                    return 0;\n                }\n                lua_pop(tolua_S, 1);\n            }\n            \n            Color4F color;\n            if (!luaval_to_color4f(tolua_S, 3, &color))\n            {\n                CC_SAFE_DELETE_ARRAY(points);\n                return 0;\n            }\n            \n            DrawPrimitives::drawSolidPoly(points,numberOfPoints,color);\n            CC_SAFE_DELETE_ARRAY(points);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawSolidPoly'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawCircle in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawCircle00\nstatic int tolua_cocos2d_DrawPrimitives_drawCircle00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)   ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err)   ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err)   ||\n        !tolua_isboolean(tolua_S,5,0,&tolua_err)  ||\n        !tolua_isnumber(tolua_S,6,1,&tolua_err)   ||\n        !tolua_isnumber(tolua_S,7,1,&tolua_err)   ||\n        !tolua_isnoobj(tolua_S,8,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point center;\n        if (!luaval_to_point(tolua_S, 1, &center))\n            return 0;\n        \n        float radius = ((float)  tolua_tonumber(tolua_S,2,0));\n        float angle = ((float)  tolua_tonumber(tolua_S,3,0));\n        unsigned int segments = ((unsigned int)  tolua_tonumber(tolua_S,4,0));\n        bool drawLineToCenter = ((bool)  tolua_toboolean(tolua_S,5,0));\n        float xScale = ((float)  tolua_tonumber(tolua_S,6,1.0f));\n        float yScale = ((float)  tolua_tonumber(tolua_S,7,1.0f));\n\n        DrawPrimitives::drawCircle(center,radius,angle,segments,drawLineToCenter,xScale,yScale);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawCircle'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawSolidCircle in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawSolidCircle00\nstatic int tolua_cocos2d_DrawPrimitives_drawSolidCircle00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)   ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err)   ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err)   ||\n        !tolua_isnumber(tolua_S,5,1,&tolua_err)   ||\n        !tolua_isnumber(tolua_S,6,1,&tolua_err)   ||\n        !tolua_isnoobj(tolua_S,7,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point center;\n        if (!luaval_to_point(tolua_S, 1, &center))\n            return 0;\n        float radius = ((float)  tolua_tonumber(tolua_S,2,0));\n        float angle = ((float)  tolua_tonumber(tolua_S,3,0));\n        unsigned int segments = ((unsigned int)  tolua_tonumber(tolua_S,4,0));\n        float scaleX = ((float)  tolua_tonumber(tolua_S,5,1.0f));\n        float scaleY = ((float)  tolua_tonumber(tolua_S,6,1.0f));\n        DrawPrimitives::drawSolidCircle(center,radius,angle,segments,scaleX,scaleY);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawSolidCircle'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\n/* function: drawQuadBezier in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawQuadBezier00\nstatic int tolua_cocos2d_DrawPrimitives_drawQuadBezier00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err)  ||\n        !tolua_istable(tolua_S, 2, 0, &tolua_err)  ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err)  ||\n        !tolua_isnumber(tolua_S,4, 0, &tolua_err)  ||\n        !tolua_isnoobj(tolua_S,5,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point origin;\n        if (!luaval_to_point(tolua_S, 1, &origin))\n            return 0;\n        \n        Point control;\n        if (!luaval_to_point(tolua_S, 2, &control))\n            return 0;\n        \n        Point destination;\n        if (!luaval_to_point(tolua_S, 3, &destination))\n            return 0;\n        \n        unsigned int segments = ((unsigned int)  tolua_tonumber(tolua_S,4,0));\n        DrawPrimitives::drawQuadBezier(origin,control,destination,segments);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawQuadBezier'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawCubicBezier in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawCubicBezier00\nstatic int tolua_cocos2d_DrawPrimitives_drawCubicBezier00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err)  ||\n        !tolua_istable(tolua_S, 2, 0, &tolua_err)  ||\n        !tolua_istable(tolua_S, 3, 0, &tolua_err)  ||\n        !tolua_istable(tolua_S, 4, 0, &tolua_err)  ||\n        !tolua_isnumber(tolua_S,5, 0, &tolua_err)  ||\n        !tolua_isnoobj(tolua_S,6,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        \n        Point origin;\n        if (!luaval_to_point(tolua_S, 1, &origin))\n            return 0;\n        \n        Point control1;\n        if (!luaval_to_point(tolua_S, 2, &control1))\n            return 0;\n        \n        Point control2;\n        if (!luaval_to_point(tolua_S, 3, &control2))\n            return 0;\n        \n        Point destination;\n        if (!luaval_to_point(tolua_S, 4, &destination))\n            return 0;\n        \n        unsigned int segments = ((unsigned int)  tolua_tonumber(tolua_S,5,0));\n        DrawPrimitives::drawCubicBezier(origin,control1,control2,destination,segments);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawCubicBezier'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawCatmullRom in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawCatmullRom00\nint tolua_cocos2d_DrawPrimitives_drawCatmullRom00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err)   ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int num = 0;\n        Point *arr = NULL;\n        if (!luaval_to_array_of_Point(tolua_S, 1, &arr, &num))\n            return 0;\n        \n        \n        PointArray* points = PointArray::create(num);        \n        if (NULL == points)\n        {\n            free(arr);\n            return 0;\n        }\n        \n        for( int i = 0; i < num; i++) {\n            points->addControlPoint(arr[i]);\n        }\n        free(arr);\n        \n        unsigned int segments = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        \n        DrawPrimitives::drawCatmullRom(points,segments);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawCatmullRom'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawCardinalSpline in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawCardinalSpline00\nint tolua_cocos2d_DrawPrimitives_drawCardinalSpline00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_istable(tolua_S, 1, 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        int num = 0;\n        Point *arr = NULL;\n        if (!luaval_to_array_of_Point(tolua_S, 1, &arr, &num))\n            return 0;\n        \n        \n        PointArray* config = PointArray::create(num);\n        if (NULL == config)\n        {\n            free(arr);\n            return 0;\n        }\n        \n        for( int i = 0; i < num; i++) {\n            config->addControlPoint(arr[i]);\n        }\n        free(arr);\n        float tension = ((float)  tolua_tonumber(tolua_S,2,0));\n        unsigned int segments = ((unsigned int)  tolua_tonumber(tolua_S,3,0));\n        DrawPrimitives::drawCardinalSpline(config,tension,segments);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawCardinalSpline'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawColor4B in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawColor4B00\nstatic int tolua_cocos2d_DrawPrimitives_drawColor4B00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,5,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned char r = (( unsigned char)  tolua_tonumber(tolua_S,1,0));\n        unsigned char g = (( unsigned char)  tolua_tonumber(tolua_S,2,0));\n        unsigned char b = (( unsigned char)  tolua_tonumber(tolua_S,3,0));\n        unsigned char a = (( unsigned char)  tolua_tonumber(tolua_S,4,0));\n        DrawPrimitives::setDrawColor4B(r,g,b,a);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawColor4B'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: drawColor4F in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_drawColor4F00\nstatic int tolua_cocos2d_DrawPrimitives_drawColor4F00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,5,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned char r = (( unsigned char)  tolua_tonumber(tolua_S,1,0));\n        unsigned char g = (( unsigned char)  tolua_tonumber(tolua_S,2,0));\n        unsigned char b = (( unsigned char)  tolua_tonumber(tolua_S,3,0));\n        unsigned char a = (( unsigned char)  tolua_tonumber(tolua_S,4,0));\n        DrawPrimitives::setDrawColor4F(r,g,b,a);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawColor4F'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* function: setPointSize in the DrawPrimitives namespace*/\n#ifndef TOLUA_DISABLE_tolua_cocos2d_DrawPrimitives_setPointSize00\nstatic int tolua_cocos2d_DrawPrimitives_setPointSize00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        float pointSize = ((  float)  tolua_tonumber(tolua_S,1,0));\n        DrawPrimitives::setPointSize(pointSize);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setPointSize'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\nTOLUA_API int tolua_opengl_open(lua_State* tolua_S)\n{\n    tolua_open(tolua_S);\n    tolua_reg_gl_type(tolua_S);\n    tolua_module(tolua_S,\"cc\",0);\n    tolua_beginmodule(tolua_S,\"cc\");\n      tolua_cclass(tolua_S,\"GLNode\",\"cc.GLNode\",\"cc.Node\",tolua_collect_GLNode);\n        tolua_beginmodule(tolua_S,\"GLNode\");\n            tolua_function(tolua_S, \"create\", tolua_Cocos2d_GLNode_create00);\n            tolua_function(tolua_S, \"setShaderProgram\", tolua_Cocos2d_GLNode_setShaderProgram00);\n        tolua_endmodule(tolua_S);\n    tolua_module(tolua_S, \"DrawPrimitives\", 0);\n      tolua_beginmodule(tolua_S,\"DrawPrimitives\");\n        tolua_function(tolua_S,\"drawPoint\",tolua_cocos2d_DrawPrimitives_drawPoint00);\n        tolua_function(tolua_S,\"drawPoints\",tolua_cocos2d_DrawPrimitives_drawPoints00);\n        tolua_function(tolua_S,\"drawLine\",tolua_cocos2d_DrawPrimitives_drawLine00);\n        tolua_function(tolua_S,\"drawRect\",tolua_cocos2d_DrawPrimitives_drawRect00);\n        tolua_function(tolua_S,\"drawSolidRect\",tolua_cocos2d_DrawPrimitives_drawSolidRect00);\n        tolua_function(tolua_S,\"drawPoly\",tolua_cocos2d_DrawPrimitives_drawPoly00);\n        tolua_function(tolua_S,\"drawSolidPoly\",tolua_cocos2d_DrawPrimitives_drawSolidPoly00);\n        tolua_function(tolua_S,\"drawCircle\",tolua_cocos2d_DrawPrimitives_drawCircle00);\n        tolua_function(tolua_S,\"drawSolidCircle\",tolua_cocos2d_DrawPrimitives_drawSolidCircle00);\n        tolua_function(tolua_S,\"drawQuadBezier\",tolua_cocos2d_DrawPrimitives_drawQuadBezier00);\n        tolua_function(tolua_S,\"drawCubicBezier\",tolua_cocos2d_DrawPrimitives_drawCubicBezier00);\n        tolua_function(tolua_S,\"drawCatmullRom\",tolua_cocos2d_DrawPrimitives_drawCatmullRom00);\n        tolua_function(tolua_S,\"drawCardinalSpline\",tolua_cocos2d_DrawPrimitives_drawCardinalSpline00);\n        tolua_function(tolua_S,\"drawColor4B\",tolua_cocos2d_DrawPrimitives_drawColor4B00);\n        tolua_function(tolua_S,\"drawColor4F\",tolua_cocos2d_DrawPrimitives_drawColor4F00);\n        tolua_function(tolua_S,\"setPointSize\",tolua_cocos2d_DrawPrimitives_setPointSize00);\n      tolua_endmodule(tolua_S);\n    tolua_endmodule(tolua_S);\n    tolua_module(tolua_S, \"gl\", 0);\n    tolua_beginmodule(tolua_S,\"gl\");\n        tolua_function(tolua_S, \"getSupportedExtensions\", tolua_Cocos2d_glGetSupportedExtensions00);\n        tolua_function(tolua_S, \"activeTexture\", tolua_Cocos2d_glActiveTexture00);\n        tolua_function(tolua_S, \"_attachShader\", tolua_Cocos2d_glAttachShader00);\n        tolua_function(tolua_S, \"_bindAttribLocation\", tolua_Cocos2d_glBindAttribLocation00);\n        tolua_function(tolua_S, \"_bindBuffer\", tolua_Cocos2d_glBindBuffer00);\n        tolua_function(tolua_S, \"_bindFramebuffer\", tolua_Cocos2d_glBindBuffer00);\n        tolua_function(tolua_S, \"_bindRenderbuffer\", tolua_Cocos2d_glBindRenderbuffer00);\n        tolua_function(tolua_S, \"_bindTexture\", tolua_Cocos2d_glBindTexture00);\n        tolua_function(tolua_S, \"blendColor\", tolua_Cocos2d_glBlendColor00);\n        tolua_function(tolua_S, \"blendEquation\", tolua_Cocos2d_glBlendEquation00);\n        tolua_function(tolua_S, \"blendEquationSeparate\", tolua_Cocos2d_glBlendEquationSeparate00);\n        tolua_function(tolua_S, \"blendFunc\", tolua_Cocos2d_glBlendFunc00);\n        tolua_function(tolua_S, \"blendFuncSeparate\", tolua_Cocos2d_glBlendFuncSeparate00);\n        tolua_function(tolua_S, \"bufferData\", tolua_Cocos2d_glBufferData00);\n        tolua_function(tolua_S, \"bufferSubData\", tolua_Cocos2d_glBufferSubData00);\n        tolua_function(tolua_S, \"checkFramebufferStatus\", tolua_Cocos2d_glCheckFramebufferStatus00);\n        tolua_function(tolua_S, \"clear\", tolua_Cocos2d_glClear00);\n        tolua_function(tolua_S, \"clearColor\", tolua_Cocos2d_glClearColor00);\n        tolua_function(tolua_S, \"clearDepthf\", tolua_Cocos2d_glClearDepthf00);\n        tolua_function(tolua_S, \"clearStencil\", tolua_Cocos2d_glClearStencil00);\n        tolua_function(tolua_S, \"colorMask\", tolua_Cocos2d_glColorMask00);\n        tolua_function(tolua_S, \"_compileShader\", tolua_Cocos2d_glCompileShader00);\n        tolua_function(tolua_S, \"compressedTexImage2D\", tolua_Cocos2d_glCompressedTexImage2D00);\n        tolua_function(tolua_S, \"compressedTexSubImage2D\", tolua_Cocos2d_glCompressedTexSubImage2D00);\n        tolua_function(tolua_S, \"copyTexImage2D\", tolua_Cocos2d_glCopyTexImage2D00);\n        tolua_function(tolua_S, \"copyTexSubImage2D\", tolua_Cocos2d_glCopyTexSubImage2D00);\n        tolua_function(tolua_S, \"_createProgram\", tolua_Cocos2d_glCreateProgram00);\n        tolua_function(tolua_S, \"_createShader\", tolua_Cocos2d_glCreateShader00);\n        tolua_function(tolua_S, \"cullFace\", tolua_Cocos2d_glCullFace00);\n        tolua_function(tolua_S, \"_deleteBuffer\", tolua_Cocos2d_glDeleteBuffers00);\n        tolua_function(tolua_S, \"_deleteFramebuffer\", tolua_Cocos2d_glDeleteFramebuffers00);\n        tolua_function(tolua_S, \"_deleteProgram\", tolua_Cocos2d_glDeleteProgram00);\n        tolua_function(tolua_S, \"_deleteRenderbuffer\", tolua_Cocos2d_glDeleteRenderbuffers00);\n        tolua_function(tolua_S, \"_deleteShader\", tolua_Cocos2d_glDeleteShader00);\n        tolua_function(tolua_S, \"_deleteTexture\", tolua_Cocos2d_glDeleteTextures00);\n        tolua_function(tolua_S, \"depthFunc\", tolua_Cocos2d_glDepthFunc00);\n        tolua_function(tolua_S, \"depthMask\", tolua_Cocos2d_glDepthMask00);\n        tolua_function(tolua_S, \"depthRangef\", tolua_Cocos2d_glDepthRangef00);\n        tolua_function(tolua_S, \"detachShader\", tolua_Cocos2d_glDetachShader00);\n        tolua_function(tolua_S, \"disable\", tolua_Cocos2d_glDisable00);\n        tolua_function(tolua_S, \"disableVertexAttribArray\", tolua_Cocos2d_glDisableVertexAttribArray00);\n        tolua_function(tolua_S, \"drawArrays\", tolua_Cocos2d_glDrawArrays00);\n        tolua_function(tolua_S, \"drawElements\", tolua_Cocos2d_glDrawElements00);\n        tolua_function(tolua_S, \"enable\", tolua_Cocos2d_glEnable00);\n        tolua_function(tolua_S, \"enableVertexAttribArray\", tolua_Cocos2d_glEnableVertexAttribArray00);\n        tolua_function(tolua_S, \"finish\", tolua_Cocos2d_glFinish00);\n        tolua_function(tolua_S, \"flush\", tolua_Cocos2d_glFlush00);\n        tolua_function(tolua_S, \"framebufferRenderbuffer\", tolua_Cocos2d_glFramebufferRenderbuffer00);\n        tolua_function(tolua_S, \"framebufferTexture2D\", tolua_Cocos2d_glFramebufferTexture2D00);\n        tolua_function(tolua_S, \"frontFace\", tolua_Cocos2d_glFrontFace00);\n        tolua_function(tolua_S, \"_createBuffer\", tolua_Cocos2d_glGenBuffers00);\n        tolua_function(tolua_S, \"_createFramebuffer\", tolua_Cocos2d_glGenFramebuffers00);\n        tolua_function(tolua_S, \"_createRenderbuffer\", tolua_Cocos2d_glGenRenderbuffers00);\n        tolua_function(tolua_S, \"_createTexture\", tolua_Cocos2d_glGenTextures00);\n        tolua_function(tolua_S, \"generateMipmap\", tolua_Cocos2d_glGenerateMipmap00);\n        tolua_function(tolua_S, \"_getActiveAttrib\", tolua_Cocos2d_glGetActiveAttrib00);\n        tolua_function(tolua_S, \"_getActiveUniform\", tolua_Cocos2d_glGetActiveUniform00);\n        tolua_function(tolua_S, \"_getAttachedShaders\", tolua_Cocos2d_glGetAttachedShaders00);\n        tolua_function(tolua_S, \"_getAttribLocation\", tolua_Cocos2d_glGetAttribLocation00);\n        tolua_function(tolua_S, \"getError\", tolua_Cocos2d_glGetError00);\n        tolua_function(tolua_S, \"_getProgramInfoLog\", tolua_Cocos2d_glGetProgramInfoLog00);\n        tolua_function(tolua_S, \"_getProgramParameter\", tolua_Cocos2d_glGetProgramiv00);\n        tolua_function(tolua_S, \"_getShaderInfoLog\", tolua_Cocos2d_glGetShaderInfoLog00);\n        tolua_function(tolua_S, \"_getShaderSource\", tolua_Cocos2d_glGetShaderSource00);\n        tolua_function(tolua_S, \"_getShaderParameter\", tolua_Cocos2d_glGetShaderiv00);\n        tolua_function(tolua_S, \"getTexParameter\", tolua_Cocos2d_glGetTexParameterfv00);\n        tolua_function(tolua_S, \"_getUniformLocation\", tolua_Cocos2d_glGetUniformLocation00);\n        tolua_function(tolua_S, \"_getUniform\", tolua_Cocos2d_glGetUniformfv00);\n        tolua_function(tolua_S, \"hint\", tolua_Cocos2d_glHint00);\n        tolua_function(tolua_S, \"isBuffer\",tolua_Cocos2d_glIsBuffer00);\n        tolua_function(tolua_S, \"isEnabled\", tolua_Cocos2d_glIsEnabled00);\n        tolua_function(tolua_S, \"isFramebuffer\", tolua_Cocos2d_glIsFramebuffer00);\n        tolua_function(tolua_S, \"isProgram\", tolua_Cocos2d_glIsProgram00);\n        tolua_function(tolua_S, \"isRenderbuffer\", tolua_Cocos2d_glIsRenderbuffer00);\n        tolua_function(tolua_S, \"isShader\", tolua_Cocos2d_glIsShader00);\n        tolua_function(tolua_S, \"isTexture\", tolua_Cocos2d_glIsTexture00);\n        tolua_function(tolua_S, \"lineWidth\", tolua_Cocos2d_glLineWidth00);\n        tolua_function(tolua_S, \"_linkProgram\", tolua_Cocos2d_glLinkProgram00);\n        tolua_function(tolua_S, \"pixelStorei\", tolua_Cocos2d_glPixelStorei00);\n        tolua_function(tolua_S, \"polygonOffset\", tolua_Cocos2d_glPolygonOffset00);\n        tolua_function(tolua_S, \"readPixels\", tolua_Cocos2d_glReadPixels00);\n        tolua_function(tolua_S, \"releaseShaderCompiler\", tolua_Cocos2d_glReleaseShaderCompiler00);\n        tolua_function(tolua_S, \"renderbufferStorage\", tolua_Cocos2d_glRenderbufferStorage00);\n        tolua_function(tolua_S, \"sampleCoverage\", tolua_Cocos2d_glSampleCoverage00);\n        tolua_function(tolua_S, \"scissor\", tolua_Cocos2d_glScissor00);\n        tolua_function(tolua_S, \"_shaderSource\", tolua_Cocos2d_glShaderSource00);\n        tolua_function(tolua_S, \"stencilFunc\", tolua_Cocos2d_glStencilFunc00);\n        tolua_function(tolua_S, \"stencilFuncSeparate\", tolua_Cocos2d_glStencilFuncSeparate00);\n        tolua_function(tolua_S, \"stencilMask\", tolua_Cocos2d_glStencilMask00);\n        tolua_function(tolua_S, \"stencilMaskSeparate\", tolua_Cocos2d_glStencilMaskSeparate00);\n        tolua_function(tolua_S, \"stencilOp\", tolua_Cocos2d_glStencilOp00);\n        tolua_function(tolua_S, \"stencilOpSeparate\", tolua_Cocos2d_glStencilOpSeparate00);\n        tolua_function(tolua_S, \"_texImage2D\", tolua_Cocos2d_glTexImage2D00);\n        tolua_function(tolua_S, \"texParameterf\", tolua_Cocos2d_glTexParameterf00);\n        tolua_function(tolua_S, \"texParameteri\", tolua_Cocos2d_glTexParameteri00);\n        tolua_function(tolua_S, \"_texSubImage2D\", tolua_Cocos2d_glTexSubImage2D00);\n        tolua_function(tolua_S, \"uniform1f\", tolua_Cocos2d_glUniform1f00);\n        tolua_function(tolua_S, \"uniform1fv\", tolua_Cocos2d_glUniform1fv00);\n        tolua_function(tolua_S, \"uniform1i\", tolua_Cocos2d_glUniform1i00);\n        tolua_function(tolua_S, \"uniform1iv\", tolua_Cocos2d_glUniform1iv00);\n        tolua_function(tolua_S, \"uniform2f\", tolua_Cocos2d_glUniform2f00);\n        tolua_function(tolua_S, \"uniform2fv\", tolua_Cocos2d_glUniform2fv00);\n        tolua_function(tolua_S, \"uniform2i\", tolua_Cocos2d_glUniform2i00);\n        tolua_function(tolua_S, \"uniform2iv\", tolua_Cocos2d_glUniform2iv00);\n        tolua_function(tolua_S, \"uniform3f\", tolua_Cocos2d_glUniform3f00);\n        tolua_function(tolua_S, \"uniform3fv\", tolua_Cocos2d_glUniform3fv00);\n        tolua_function(tolua_S, \"uniform3i\", tolua_Cocos2d_glUniform3i00);\n        tolua_function(tolua_S, \"uniform3iv\", tolua_Cocos2d_glUniform3iv00);\n        tolua_function(tolua_S, \"uniform4f\", tolua_Cocos2d_glUniform4f00);\n        tolua_function(tolua_S, \"uniform4fv\", tolua_Cocos2d_glUniform4fv00);\n        tolua_function(tolua_S, \"uniform4i\", tolua_Cocos2d_glUniform4i00);\n        tolua_function(tolua_S, \"uniform4iv\", tolua_Cocos2d_glUniform4iv00);\n        tolua_function(tolua_S, \"uniformMatrix2fv\", tolua_Cocos2d_glUniformMatrix2fv00);\n        tolua_function(tolua_S, \"uniformMatrix3fv\", tolua_Cocos2d_glUniformMatrix3fv00);\n        tolua_function(tolua_S, \"uniformMatrix4fv\", tolua_Cocos2d_glUniformMatrix4fv00);\n        tolua_function(tolua_S, \"_useProgram\", tolua_Cocos2d_glUseProgram00);\n        tolua_function(tolua_S, \"_validateProgram\", tolua_Cocos2d_glValidateProgram00);\n        tolua_function(tolua_S, \"vertexAttrib1f\", tolua_Cocos2d_glVertexAttrib1f00);\n        tolua_function(tolua_S, \"vertexAttrib1fv\", tolua_Cocos2d_glVertexAttrib1fv00);\n        tolua_function(tolua_S, \"vertexAttrib2f\", tolua_Cocos2d_glVertexAttrib2f00);\n        tolua_function(tolua_S, \"vertexAttrib2fv\", tolua_Cocos2d_glVertexAttrib2fv00);\n        tolua_function(tolua_S, \"vertexAttrib3f\", tolua_Cocos2d_glVertexAttrib3f00);\n        tolua_function(tolua_S, \"vertexAttrib3fv\", tolua_Cocos2d_glVertexAttrib3fv00);\n        tolua_function(tolua_S, \"vertexAttrib4f\", tolua_Cocos2d_glVertexAttrib4f00);\n        tolua_function(tolua_S, \"vertexAttrib4fv\", tolua_Cocos2d_glVertexAttrib4fv00);\n        tolua_function(tolua_S, \"vertexAttribPointer\", tolua_Cocos2d_glVertexAttribPointer00);\n        tolua_function(tolua_S, \"viewport\", tolua_Cocos2d_glViewport00);\n        tolua_function(tolua_S, \"glEnableVertexAttribs\", tolua_Cocos2d_glEnableVertexAttribs00);\n      tolua_endmodule(tolua_S);\n    return 1;\n}\n\nstatic int tolua_Cocos2d_GLNode_registerScriptDrawHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLNode\",0,&tolua_err) ||\n        (tolua_isvaluenil(tolua_S,2,&tolua_err) || !toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err)) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err))\n        goto tolua_lerror;\n    else\n#endif\n    {\n        GLNode* glNode = (GLNode*)  tolua_tousertype(tolua_S,1,0);\n        LUA_FUNCTION handler = (  toluafix_ref_function(tolua_S,2,0));\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)glNode, handler, ScriptHandlerMgr::HandlerType::GL_NODE_DRAW);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptDrawHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_GLNode_unregisterScriptDrawHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLNode\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err))\n        goto tolua_lerror;\n    else\n#endif\n    {\n        GLNode* glNode = (GLNode*)tolua_tousertype(tolua_S,1,0);\n        ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)glNode,ScriptHandlerMgr::HandlerType::GL_NODE_DRAW);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptDrawHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint register_glnode_manual(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    lua_pushstring(tolua_S,\"cc.GLNode\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"registerScriptDrawHandler\");\n        lua_pushcfunction(tolua_S,tolua_Cocos2d_GLNode_registerScriptDrawHandler00);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"unregisterScriptDrawHandler\");\n        lua_pushcfunction(tolua_S,tolua_Cocos2d_GLNode_unregisterScriptDrawHandler00);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    return 1;\n}\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaOpengl.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __LUA_OPENGL_H__\n#define __LUA_OPENGL_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"CCNode.h\"\n\nclass GLNode:public cocos2d::Node\n{\n    virtual void draw() override;\n};\n\nTOLUA_API int tolua_opengl_open(lua_State* tolua_S);\nTOLUA_API int register_glnode_manual(lua_State* tolua_S);\n\n#endif //__LUA_OPENGL_H__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include <map>\n#include <string>\n#include \"LuaScriptHandlerMgr.h\"\n#include \"cocos2d.h\"\n#include \"extensions/cocos-ext.h\"\n#include \"CCLuaStack.h\"\n#include \"CCLuaValue.h\"\n#include \"CCLuaEngine.h\"\n#include \"Lua_web_socket.h\"\n#include \"LuaOpengl.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::extension;\n\nNS_CC_BEGIN\n\nScheduleHandlerDelegate* ScheduleHandlerDelegate::create()\n{\n    ScheduleHandlerDelegate *ret = new ScheduleHandlerDelegate();\n    if (NULL != ret )\n    {\n        ret->autorelease();\n        return ret;\n    }\n    else\n    {\n        CC_SAFE_DELETE(ret);\n        return NULL;\n    }\n}\n\nvoid ScheduleHandlerDelegate::scheduleFunc(float elapse)\n{\n\n}\n\nvoid ScheduleHandlerDelegate::update(float elapse)\n{\n\n}\n\n\nLuaCallFunc * LuaCallFunc::create(const std::function<void(void* ,Node*)>& func)\n{\n    auto ret = new LuaCallFunc();\n    \n    if (ret && ret->initWithFunction(func) ) {\n        ret->autorelease();\n        return ret;\n    }\n    \n    CC_SAFE_DELETE(ret);\n    return NULL;\n}\n\nvoid LuaCallFunc::execute()\n{\n    if (_functionLua)\n    {\n        _functionLua((void*)this,_target);\n    }\n    else\n    {\n        CallFuncN::execute();\n    }\n}\n\nbool LuaCallFunc::initWithFunction(const std::function<void (void*, Node*)> &func)\n{\n    _functionLua = func;\n    return true;\n}\n\nLuaCallFunc* LuaCallFunc::clone() const\n{\n    int handler =  ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::CALLFUNC);\n    \n    if (0 == handler)\n        return NULL;\n    \n    auto ret = new LuaCallFunc();\n    \n    if( _functionLua )\n    {\n        ret->initWithFunction(_functionLua);\n    }\n    \n    ret->autorelease();\n\n    int newscriptHandler = cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->reallocateScriptHandler(handler);\n    \n    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)ret, newscriptHandler, ScriptHandlerMgr::HandlerType::CALLFUNC);\n        \n    return ret;\n}\n\nScriptHandlerMgr* ScriptHandlerMgr::_scriptHandlerMgr = NULL;\n\nScriptHandlerMgr::ScriptHandlerMgr()\n{\n    \n}\nScriptHandlerMgr::~ScriptHandlerMgr()\n{\n    CC_SAFE_DELETE(_scriptHandlerMgr);\n}\nScriptHandlerMgr* ScriptHandlerMgr::getInstance()\n{\n    if (NULL == _scriptHandlerMgr)\n    {\n        _scriptHandlerMgr = new ScriptHandlerMgr();\n        _scriptHandlerMgr->init();\n    }\n    return _scriptHandlerMgr;\n}\n\nvoid ScriptHandlerMgr::init()\n{\n    _mapObjectHandlers.clear();\n}\n\nvoid ScriptHandlerMgr::addObjectHandler(void* object,int handler,ScriptHandlerMgr::HandlerType handlerType)\n{\n    if (NULL == object)\n        return;\n    \n    //may be not need\n    removeObjectHandler(object,handlerType);\n    \n    auto iter = _mapObjectHandlers.find(object);\n    VecHandlerPairs vecHandlers;\n    vecHandlers.clear();\n    if (_mapObjectHandlers.end() != iter)\n    {\n        vecHandlers = iter->second;\n    }\n    \n    HandlerPair eventHanler = std::make_pair(handlerType, handler);\n    vecHandlers.push_back(eventHanler);\n    _mapObjectHandlers[object] = vecHandlers;\n}\nvoid ScriptHandlerMgr::removeObjectHandler(void* object,ScriptHandlerMgr::HandlerType handlerType)\n{\n    if (NULL == object || _mapObjectHandlers.empty())\n        return;\n    \n    auto iterMap = _mapObjectHandlers.find(object);\n    if (_mapObjectHandlers.end() == iterMap)\n        return;\n    \n    if (iterMap->second.empty())\n        return;\n    \n    auto iterVec = iterMap->second.begin();\n    bool exist  = false;\n    for (; iterVec != iterMap->second.end(); ++iterVec)\n    {\n        if (iterVec->first == handlerType)\n        {\n            exist = true;\n            break;\n        }\n    }\n    \n    if (exist)\n    {\n        LuaEngine::getInstance()->removeScriptHandler(iterVec->second);\n        iterMap->second.erase(iterVec);\n    }\n\n}\nint  ScriptHandlerMgr::getObjectHandler(void* object,ScriptHandlerMgr::HandlerType handlerType)\n{\n    if (NULL == object ||   _mapObjectHandlers.empty() )\n        return 0;\n    \n    auto iter = _mapObjectHandlers.find(object);\n    \n    if (_mapObjectHandlers.end() != iter)\n    {\n        auto iterVec = (iter->second).begin();\n        for (; iterVec != (iter->second).end(); iterVec++)\n        {\n            if (iterVec->first == handlerType)\n            {\n                return iterVec->second;\n            }\n        }\n    }\n    \n    return 0;\n}\nvoid ScriptHandlerMgr::removeObjectAllHandlers(void* object)\n{\n    if (NULL == object || _mapObjectHandlers.empty())\n        return;\n    \n    auto iter = _mapObjectHandlers.find(object);\n    \n    if (_mapObjectHandlers.end() != iter)\n    {\n        if (!iter->second.empty())\n        {\n            auto iterVec = iter->second.begin();\n            for (; iterVec != iter->second.end(); ++iterVec)\n            {\n                LuaEngine::getInstance()->removeScriptHandler(iterVec->second);\n            }\n            (iter->second).clear();\n        }\n        _mapObjectHandlers.erase(iter);\n    }\n}\n\nNS_CC_END\n\n\nstatic void tolua_reg_script_handler_mgr_type(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S, \"ScheduleHandlerDelegate\");\n    tolua_usertype(tolua_S, \"ScriptHandlerMgr\");\n}\n\n/* method: getInstance of class  ScriptHandlerMgr */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_ScriptHandlerMgr_getInstance00\nstatic int tolua_Cocos2d_ScriptHandlerMgr_getInstance00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"ScriptHandlerMgr\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err) )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        ScriptHandlerMgr* tolua_ret = (ScriptHandlerMgr*)  ScriptHandlerMgr::getInstance();\n        tolua_pushusertype(tolua_S,(void*)tolua_ret,\"ScriptHandlerMgr\");\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getInstance'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* method: registerScriptHandler of class  ScriptHandlerMgr */\nstatic int tolua_Cocos2d_ScriptHandlerMgr_registerScriptHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"ScriptHandlerMgr\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S, 2, \"cc.Object\", 0, &tolua_err) ||\n        !toluafix_isfunction(tolua_S, 3, \"LUA_FUNCTION\", 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S, 4, 0, &tolua_err) ||\n        !tolua_isnoobj(tolua_S,5,&tolua_err) )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        cocos2d::ScriptHandlerMgr* scriptHanlderMgr = static_cast<cocos2d::ScriptHandlerMgr*>(tolua_tousertype(tolua_S,1,0));\n#ifndef TOLUA_RELEASE\n        if (nullptr == scriptHanlderMgr)\n        {\n            tolua_error(tolua_S,\"invalid 'scriptHanlderMgr' in function 'tolua_Cocos2d_ScriptHandlerMgr_registerScriptHandler00'\\n\", NULL);\n            return 0;\n        }\n#endif\n        LUA_FUNCTION handler =  toluafix_ref_function(tolua_S,3,0);\n        ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)(int)tolua_tonumber(tolua_S, 4, 0);\n        scriptHanlderMgr->addObjectHandler(tolua_tousertype(tolua_S, 2, 0), handler,handlerType);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n/* method: unregisterScriptHandler of class  ScriptHandlerMgr */\nstatic int tolua_Cocos2d_ScriptHandlerMgr_unregisterScriptHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"ScriptHandlerMgr\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S, 2, \"cc.Object\", 0, &tolua_err) ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err) )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        cocos2d::ScriptHandlerMgr* scriptHanlderMgr = static_cast<cocos2d::ScriptHandlerMgr*>(tolua_tousertype(tolua_S,1,0));\n#ifndef TOLUA_RELEASE\n        if (nullptr == scriptHanlderMgr)\n        {\n            tolua_error(tolua_S,\"invalid 'scriptHanlderMgr' in function 'tolua_Cocos2d_ScriptHandlerMgr_unregisterScriptHandler00'\\n\", NULL);\n            return 0;\n        }\n#endif\n        ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)(int)tolua_tonumber(tolua_S, 3, 0);\n        scriptHanlderMgr->removeObjectHandler(tolua_tousertype(tolua_S, 2, 0), handlerType);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n/* method: removeObjectAllHandlers of class  ScriptHandlerMgr */\nstatic int tolua_Cocos2d_ScriptHandlerMgr_removeObjectAllHandlers00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"ScriptHandlerMgr\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S, 2, \"cc.Object\", 0, &tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err) )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        cocos2d::ScriptHandlerMgr* scriptHanlderMgr = static_cast<cocos2d::ScriptHandlerMgr*>(tolua_tousertype(tolua_S,1,0));\n#ifndef TOLUA_RELEASE\n        if (nullptr == scriptHanlderMgr)\n        {\n            tolua_error(tolua_S,\"invalid 'scriptHanlderMgr' in function 'tolua_Cocos2d_ScriptHandlerMgr_removeObjectAllHandlers00'\\n\", NULL);\n            return 0;\n        }\n#endif\n        scriptHanlderMgr->removeObjectAllHandlers(tolua_tousertype(tolua_S, 2, 0));\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'removeObjectAllHandlers'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nTOLUA_API int tolua_script_handler_mgr_open(lua_State* tolua_S)\n{\n    tolua_open(tolua_S);\n    tolua_reg_script_handler_mgr_type(tolua_S);\n    tolua_module(tolua_S, NULL,0);\n    tolua_beginmodule(tolua_S, NULL);\n      tolua_cclass(tolua_S,\"ScriptHandlerMgr\",\"ScriptHandlerMgr\",\"\",NULL);\n      tolua_beginmodule(tolua_S, \"ScriptHandlerMgr\");\n        tolua_function(tolua_S, \"getInstance\", tolua_Cocos2d_ScriptHandlerMgr_getInstance00);\n        tolua_function(tolua_S, \"registerScriptHandler\", tolua_Cocos2d_ScriptHandlerMgr_registerScriptHandler00);\n        tolua_function(tolua_S, \"unregisterScriptHandler\", tolua_Cocos2d_ScriptHandlerMgr_unregisterScriptHandler00);\n        tolua_function(tolua_S, \"removeObjectAllHandlers\", tolua_Cocos2d_ScriptHandlerMgr_removeObjectAllHandlers00);\n      tolua_endmodule(tolua_S);\n    tolua_endmodule(tolua_S);\n   return 1; \n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __LUA_SCRIPT_HANDLER_MGR_H__\n#define __LUA_SCRIPT_HANDLER_MGR_H__\n\n\nextern \"C\" {\n#include \"tolua++.h\"\n}\n\n\n#include \"CCObject.h\"\n#include \"ccMacros.h\"\n#include \"CCActionInstant.h\"\n#include <vector>\n#include <map>\n\nNS_CC_BEGIN\n\nclass ScheduleHandlerDelegate;\n\n\ntypedef std::vector<ScheduleHandlerDelegate*> VecShedule;\ntypedef std::map<cocos2d::Node*,VecShedule> MapNodeSchedules;\n\nclass ScheduleHandlerDelegate:public cocos2d::Object\n{\npublic:\n    ScheduleHandlerDelegate():_isUpdateSchedule(false)\n    {}\n    virtual ~ScheduleHandlerDelegate()\n    {}\n    \n    static ScheduleHandlerDelegate* create();\n    \n    void scheduleFunc(float elapse);\n    \n    virtual void update(float elapse);\n    \n    void setUpdateSchedule(bool isUpdateSchedule){ _isUpdateSchedule = isUpdateSchedule; }\n    bool isUpdateSchedule(){ return _isUpdateSchedule; }\nprivate:\n    bool _isUpdateSchedule;\n};\n\nclass LuaCallFunc:public cocos2d::CallFuncN\n{\npublic:\n    LuaCallFunc():_functionLua(nullptr)\n    {}\n    virtual ~LuaCallFunc()\n    {}\n    \n    static LuaCallFunc* create(const std::function<void(void* self,Node*)>& func);\n    bool initWithFunction(const std::function<void(void* self,Node*)>& func);\n    virtual LuaCallFunc* clone() const;\n    virtual void execute() override;\nprotected:\n    /**\n     */\n    std::function<void(void* self,Node*)> _functionLua;\n    \n};\n\nclass ScriptHandlerMgr\n{\npublic:\n    enum class HandlerType: int\n    {\n        NODE = 0,\n        MENU_CLICKED,\n        CALLFUNC,\n        SCHEDULE,\n        TOUCHES,\n        KEYPAD,\n        ACCELEROMETER,\n        \n        CONTROL_TOUCH_DOWN,\n        CONTROL_TOUCH_DRAG_INSIDE,\n        CONTROL_TOUCH_DRAG_OUTSIDE,\n        CONTROL_TOUCH_DRAG_ENTER,\n        CONTROL_TOUCH_DRAG_EXIT,\n        CONTROL_TOUCH_UP_INSIDE,\n        CONTROL_TOUCH_UP_OUTSIDE,\n        CONTROL_TOUCH_UP_CANCEL,\n        CONTROL_VALUE_CHANGED,\n        \n        WEBSOCKET_OPEN,\n        WEBSOCKET_MESSAGE,\n        WEBSOCKET_CLOSE,\n        WEBSOCKET_ERROR,\n        \n        GL_NODE_DRAW,\n        \n        SCROLLVIEW_SCROLL,\n        SCROLLVIEW_ZOOM,\n        \n        TABLECELL_TOUCHED,\n        TABLECELL_HIGHLIGHT,\n        TABLECELL_UNHIGHLIGHT,\n        TABLECELL_WILL_RECYCLE,\n        TABLECELL_SIZE_FOR_INDEX,\n        TABLECELL_AT_INDEX,\n        TABLEVIEW_NUMS_OF_CELLS,\n        \n        XMLHTTPREQUEST_READY_STATE_CHANGE,\n        \n        ASSETSMANAGER_PROGRESS,\n        ASSETSMANAGER_SUCCESS,\n        ASSETSMANAGER_ERROR,\n        \n        STUDIO_EVENT_LISTENER,\n        ARMATURE_EVENT,\n        \n        EVENT_ACC,\n        EVENT_CUSTIOM,\n        \n        EVENT_KEYBOARD_PRESSED,\n        EVENT_KEYBOARD_RELEASED,\n        \n        EVENT_TOUCH_BEGAN,\n        EVENT_TOUCH_MOVED,\n        EVENT_TOUCH_ENDED,\n        EVENT_TOUCH_CANCELLED,\n        \n        EVENT_TOUCHES_BEGAN,\n        EVENT_TOUCHES_MOVED,\n        EVENT_TOUCHES_ENDED,\n        EVENT_TOUCHES_CANCELLED,\n        \n        EVENT_MOUSE_DOWN,\n        EVENT_MOUSE_UP,\n        EVENT_MOUSE_MOVE,\n        EVENT_MOUSE_SCROLL,\n        \n        EVENT_SPINE,\n        \n        EVENT_PHYSICS_CONTACT_BEGIN,\n        EVENT_PHYSICS_CONTACT_PRESOLVE,\n        EVENT_PHYSICS_CONTACT_POSTSOLVE,\n        EVENT_PHYSICS_CONTACT_SEPERATE,\n    };\n    \n    typedef int Handler;\n    typedef std::pair<HandlerType, Handler> HandlerPair;\n    typedef std::vector<HandlerPair> VecHandlerPairs;\n    typedef std::map<void*,VecHandlerPairs> MapObjectHandlers;\n    \n    ScriptHandlerMgr(void);\n    virtual ~ScriptHandlerMgr(void);\n    static ScriptHandlerMgr* getInstance(void);\n        \n    void addObjectHandler(void* object,int handler,ScriptHandlerMgr::HandlerType handlerType);\n    void removeObjectHandler(void* object,ScriptHandlerMgr::HandlerType handlerType);\n    int  getObjectHandler(void* object,ScriptHandlerMgr::HandlerType handlerType);\n    void removeObjectAllHandlers(void* object);\n    \nprivate:\n    void init(void);\n    static ScriptHandlerMgr* _scriptHandlerMgr;\n    MapObjectHandlers _mapObjectHandlers;\n};\n\nNS_CC_END\n\nTOLUA_API int tolua_script_handler_mgr_open(lua_State* tolua_S);\n\n#endif //__LUA_SCRIPT_HANDLER_MGR_H__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaSkeletonAnimation.cpp",
    "content": " /****************************************************************************\n Copyright (c) 2013      Edward Zhou\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"LuaSkeletonAnimation.h\"\n#include \"cocos2d.h\"\n#include \"LuaScriptHandlerMgr.h\"\n#include \"CCLuaStack.h\"\n#include \"CCLuaEngine.h\"\n\nusing namespace spine;\nUSING_NS_CC;\n\nstatic int SendSpineEventToLua(int nHandler, spine::SkeletonAnimation* node, int trackIndex, spEventType type, spEvent* event, int loopCount)\n{\n    if (nHandler <= 0) {\n        return 0;\n    }\n\n    if (NULL == ScriptEngineManager::getInstance()->getScriptEngine()) {\n        return 0;\n    }\n\n    LuaStack *pStack = LuaEngine::getInstance()->getLuaStack();\n    if (NULL == pStack) {\n        return 0;\n    }\n\n    lua_State *tolua_s = pStack->getLuaState();\n    if (NULL == tolua_s) {\n        return 0;\n    }\n\n    int nRet = 0;\n\n\tspTrackEntry* entry = spAnimationState_getCurrent(node->state, trackIndex);\n\tstd::string animationName = (entry && entry->animation) ? entry->animation->name : \"\";\n\tstd::string eventType = \"\";\n\n\tswitch (type) {\n\tcase ANIMATION_START:\n\t\teventType = \"start\";\n\t\tbreak;\n\tcase ANIMATION_END:\n\t\teventType = \"end\";\n\t\tbreak;\n\tcase ANIMATION_COMPLETE:\n\t\teventType = \"complete\";\n\t\tbreak;\n\tcase ANIMATION_EVENT:\n\t\teventType = \"event\";\n\t\tbreak;\n\t}\n\n\tLuaValueDict spineEvent;\n\tspineEvent.insert(spineEvent.end(), LuaValueDict::value_type(\"type\", LuaValue::stringValue(eventType)));\n\tspineEvent.insert(spineEvent.end(), LuaValueDict::value_type(\"trackIndex\", LuaValue::intValue(trackIndex)));\n\tspineEvent.insert(spineEvent.end(), LuaValueDict::value_type(\"animation\", LuaValue::stringValue(animationName)));\n\tspineEvent.insert(spineEvent.end(), LuaValueDict::value_type(\"loopCount\", LuaValue::intValue(loopCount)));\n\n\tif (NULL != event) {\n\t\tLuaValueDict eventData;\n\t\teventData.insert(eventData.end(), LuaValueDict::value_type(\"name\", LuaValue::stringValue(event->data->name)));\n\t\teventData.insert(eventData.end(), LuaValueDict::value_type(\"intValue\", LuaValue::intValue(event->intValue)));\n\t\teventData.insert(eventData.end(), LuaValueDict::value_type(\"floatValue\", LuaValue::floatValue(event->floatValue)));\n\t\teventData.insert(eventData.end(), LuaValueDict::value_type(\"stringValue\", LuaValue::stringValue(event->stringValue)));\n\t\tspineEvent.insert(spineEvent.end(), LuaValueDict::value_type(\"eventData\", LuaValue::dictValue(eventData)));\n\t}\n\n\tpStack->pushLuaValueDict(spineEvent);\n    nRet = pStack->executeFunctionByHandler(nHandler, 1);\n    pStack->clean();\n    return nRet;\n\n}\n\nLuaSkeletonAnimation::LuaSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale)\n: spine::SkeletonAnimation(skeletonDataFile, atlasFile, scale)\n{\n\tthis->setAnimationListener(this, animationStateEvent_selector(LuaSkeletonAnimation::animationStateEvent));\n}\n\n\nLuaSkeletonAnimation::~LuaSkeletonAnimation()\n{\n    ScriptHandlerMgr::getInstance()->removeObjectAllHandlers((void*)this);\n}\n\nLuaSkeletonAnimation* LuaSkeletonAnimation::createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale)\n{\n\tLuaSkeletonAnimation* node = new LuaSkeletonAnimation(skeletonDataFile, atlasFile, scale);\n\tnode->autorelease();\n\treturn node;\n}\n\nvoid LuaSkeletonAnimation::animationStateEvent (spine::SkeletonAnimation* node, int trackIndex, spEventType type, spEvent* event, int loopCount)\n{\n    int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::EVENT_SPINE);\n    if (0 != nHandler) {\n        SendSpineEventToLua(nHandler, node, trackIndex, type, event, loopCount);\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/LuaSkeletonAnimation.h",
    "content": " /****************************************************************************\n Copyright (c) 2013      Edward Zhou\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef LUASKELETONANIMATION_H_\n#define LUASKELETONANIMATION_H_\n#include \"spine-cocos2dx.h\"\n\nclass LuaSkeletonAnimation: public spine::SkeletonAnimation {\nprivate:\n\tvoid animationStateEvent (spine::SkeletonAnimation* node, int trackIndex, spEventType type, spEvent* event, int loopCount);\n\npublic:\n\tstatic LuaSkeletonAnimation* createWithFile (const char* skeletonDataFile, const char* atlasFile, float scale = 1);\n\n\tLuaSkeletonAnimation (const char* skeletonDataFile, const char* atlasFile, float scale = 1);\n\n\tvirtual ~LuaSkeletonAnimation();\n};\n\n#endif /* LUASKELETONANIMATION_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/Lua_web_socket.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n    #include \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include <map>\n#include <string>\n#include \"Lua_web_socket.h\"\n#include \"cocos2d.h\"\n#include \"CCLuaStack.h\"\n#include \"CCLuaValue.h\"\n#include \"CCLuaEngine.h\"\n#include \"LuaScriptHandlerMgr.h\"\n\nusing namespace cocos2d;\n\n\nstatic int SendBinaryMessageToLua(int nHandler,const unsigned char* pTable,int nLength)\n{\n    if (NULL == pTable || nHandler <= 0) {\n        return 0;\n    }\n    \n    if (NULL == ScriptEngineManager::getInstance()->getScriptEngine()) {\n        return 0;\n    }\n    \n    LuaStack *pStack = LuaEngine::getInstance()->getLuaStack();\n    if (NULL == pStack) {\n        return 0;\n    }\n\n    lua_State *tolua_s = pStack->getLuaState();\n    if (NULL == tolua_s) {\n        return 0;\n    }\n    \n    int nRet = 0;\n    LuaValueArray array;\n    for (int i = 0 ; i < nLength; i++) {\n        LuaValue value = LuaValue::intValue(pTable[i]);\n        array.push_back(value);\n    }\n    \n    pStack->pushLuaValueArray(array);\n    nRet = pStack->executeFunctionByHandler(nHandler, 1);\n    pStack->clean();\n    return nRet;\n}\n\n\n\nLuaWebSocket::~LuaWebSocket()\n{\n    ScriptHandlerMgr::getInstance()->removeObjectAllHandlers((void*)this);\n}\n\nvoid LuaWebSocket::onOpen(WebSocket* ws)\n{\n    LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);\n    if (NULL != luaWs) {\n        int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_OPEN);\n        if (0 != nHandler) {\n            CommonScriptData data(nHandler,\"\");\n            ScriptEvent event(kCommonEvent,(void*)&data);\n            ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        }\n    }\n}\n    \nvoid LuaWebSocket::onMessage(WebSocket* ws, const WebSocket::Data& data)\n{\n    LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);\n    if (NULL != luaWs) {\n        if (data.isBinary) {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE);\n            if (0 != handler) {\n                SendBinaryMessageToLua(handler, (const unsigned char*)data.bytes, data.len);\n            }\n        }\n        else{\n                \n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE);\n            if (0 != handler)\n            {\n                LuaStack* stack = LuaEngine::getInstance()->getLuaStack();\n                if (nullptr != stack)\n                {\n                    stack->pushString(data.bytes,data.len);\n                    stack->executeFunctionByHandler(handler,  1);\n                }\n            }\n        }\n    }\n}\n    \nvoid LuaWebSocket::onClose(WebSocket* ws)\n{\n    LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);\n    if (NULL != luaWs) {\n        int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_CLOSE);\n        if (0 != nHandler)\n        {\n            CommonScriptData data(nHandler,\"\");\n            ScriptEvent event(kCommonEvent,(void*)&data);\n            ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        }\n    }\n}\n    \nvoid LuaWebSocket::onError(WebSocket* ws, const WebSocket::ErrorCode& error)\n{\n    LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);\n    if (NULL != luaWs) {\n        int nHandler = 0;//luaWs->getScriptHandler(LuaWebSocket::kWebSocketScriptHandlerError);\n        if (0 != nHandler)\n        {\n            CommonScriptData data(nHandler,\"\");\n            ScriptEvent event(kCommonEvent,(void*)&data);\n            ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        }\n    }\n}\n\n\n\n#ifdef __cplusplus\nstatic int tolua_collect_WebSocket (lua_State* tolua_S)\n{\n    LuaWebSocket* self = (LuaWebSocket*) tolua_tousertype(tolua_S,1,0);\n    Mtolua_delete(self);\n    return 0;\n}\n#endif\n/* function to release collected object via destructor */\nstatic void tolua_reg_Web_Socket_type(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S, \"cc.WebSocket\");\n}\n\n/* method: create of class WebSocket */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_create00\nstatic int tolua_Cocos2d_WebSocket_create00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"cc.WebSocket\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err)  ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n            const char* urlName = ((const char*)  tolua_tostring(tolua_S,2,0));\n            LuaWebSocket *wSocket = new LuaWebSocket();\n            wSocket->init(*wSocket, urlName);\n            tolua_pushusertype(tolua_S,(void*)wSocket,\"cc.WebSocket\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* method: createByAProtocol of class WebSocket */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_createByAProtocol00\nstatic int tolua_Cocos2d_WebSocket_createByAProtocol00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"cc.WebSocket\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err)  ||\n        !tolua_isstring(tolua_S,3,0,&tolua_err)  ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const char *urlName  = ((const char*)  tolua_tostring(tolua_S,2,0));\n        const char *protocol = ((const char*)  tolua_tostring(tolua_S,3,0));\n        std::vector<std::string> protocols;\n        protocols.push_back(protocol);\n        LuaWebSocket *wSocket = new LuaWebSocket();\n        wSocket->init(*wSocket, urlName,&protocols);\n        tolua_pushusertype(tolua_S,(void*)wSocket,\"cc.WebSocket\");\n        tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createByAProtocol'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* method: createByAProtocol of class WebSocket */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_createByProtocolArray00\nstatic int tolua_Cocos2d_WebSocket_createByProtocolArray00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"cc.WebSocket\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err)  ||\n        !tolua_isusertable(tolua_S,3,\"CCArray\",0,&tolua_err)  ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const char *urlName  = ((const char*)  tolua_tostring(tolua_S,2,0));\n        Array*    protocolArray = ((Array*)  tolua_tousertype(tolua_S,3,0));\n        std::vector<std::string> protocols;\n        if (NULL != protocolArray) {\n            Object* pObj = NULL;\n            CCARRAY_FOREACH(protocolArray, pObj)\n            {\n                String* pStr = static_cast<String*>(pObj);\n                if (NULL != pStr) {\n                    protocols.push_back(pStr->getCString());\n                }\n            }\n        }\n        LuaWebSocket *wSocket = new LuaWebSocket();\n        wSocket->init(*wSocket, urlName,&protocols);\n        tolua_pushusertype(tolua_S,(void*)wSocket,\"cc.WebSocket\");\n        tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createByProtocolArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* method: getReadyState of class WebSocket */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_getReadyState00\nstatic int tolua_Cocos2d_WebSocket_getReadyState00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"cc.WebSocket\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        LuaWebSocket *self = (LuaWebSocket*)tolua_tousertype(tolua_S,1,0);\n        int tolua_ret = -1;\n        if (NULL != self) {\n            tolua_ret = (int)self->getReadyState();\n        }\n        tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getReadyState'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\n/* method: close of class WebSocket */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_close00\nstatic int tolua_Cocos2d_WebSocket_close00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"cc.WebSocket\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        LuaWebSocket* self    = (LuaWebSocket*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n            self->close();\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getReadyState'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n/* method: sendString of class WebSocket */\n#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_sendString00\nstatic int tolua_Cocos2d_WebSocket_sendString00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S, 1, \"cc.WebSocket\", 0, &tolua_err) ||\n        !tolua_isstring(tolua_S, 2, 0, &tolua_err)                ||\n        !tolua_isnoobj(tolua_S, 3, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        LuaWebSocket* self    = (LuaWebSocket*)  tolua_tousertype(tolua_S,1,0);\n        size_t size = 0;\n        const char* data = (const char*) lua_tolstring(tolua_S, 2, &size);\n        if ( NULL == data)\n            return 0;\n\n        if (strlen(data) != size)\n        {\n            self->send((const unsigned char*)data, size);\n        }\n        else\n        {\n            self->send(data);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'sendString'.\",&tolua_err);\n    return 0;\n#endif\n}\n#endif //#ifndef TOLUA_DISABLE\n\n\nTOLUA_API int tolua_web_socket_open(lua_State* tolua_S){\n    tolua_open(tolua_S);\n    tolua_reg_Web_Socket_type(tolua_S);\n    tolua_module(tolua_S,\"cc\",0);\n    tolua_beginmodule(tolua_S,\"cc\");\n      #ifdef __cplusplus\n      tolua_cclass(tolua_S,\"WebSocket\",\"cc.WebSocket\",\"\",tolua_collect_WebSocket);\n      #else\n      tolua_cclass(tolua_S,\"WebSocket\",\"cc.WebSocket\",\"\",NULL);\n      #endif\n      tolua_beginmodule(tolua_S,\"WebSocket\");\n        tolua_function(tolua_S, \"create\", tolua_Cocos2d_WebSocket_create00);\n        tolua_function(tolua_S, \"createByAProtocol\", tolua_Cocos2d_WebSocket_createByAProtocol00);\n        tolua_function(tolua_S, \"createByProtocolArray\", tolua_Cocos2d_WebSocket_createByProtocolArray00);\n        tolua_function(tolua_S, \"getReadyState\", tolua_Cocos2d_WebSocket_getReadyState00);\n        tolua_function(tolua_S, \"close\", tolua_Cocos2d_WebSocket_close00);\n        tolua_function(tolua_S, \"sendString\", tolua_Cocos2d_WebSocket_sendString00);\n      tolua_endmodule(tolua_S);\n    tolua_endmodule(tolua_S);\n\treturn 1;\n}\n\nint tolua_Cocos2d_WebSocket_registerScriptHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"cc.WebSocket\",0,&tolua_err) ||\n        !toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        LuaWebSocket* self    = (LuaWebSocket*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n            int handler = (  toluafix_ref_function(tolua_S,2,0));\n            ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)((int)tolua_tonumber(tolua_S,3,0) + (int)ScriptHandlerMgr::HandlerType::WEBSOCKET_OPEN);\n            ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, handlerType);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_Cocos2d_WebSocket_unregisterScriptHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"cc.WebSocket\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        LuaWebSocket* self    = (LuaWebSocket*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n            ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType)((int)tolua_tonumber(tolua_S,2,0) + (int)ScriptHandlerMgr::HandlerType::WEBSOCKET_OPEN);\n            \n            ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, handlerType);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nTOLUA_API int register_web_socket_manual(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0 ;\n    \n    lua_pushstring(tolua_S,\"cc.WebSocket\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"registerScriptHandler\");\n        lua_pushcfunction(tolua_S,tolua_Cocos2d_WebSocket_registerScriptHandler00);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"unregisterScriptHandler\");\n        lua_pushcfunction(tolua_S,tolua_Cocos2d_WebSocket_unregisterScriptHandler00);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    return 1;\n}\n\n#endif//(CC_TARGET_PLATFORM == CC_PLATFORM_IOS ...\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/Lua_web_socket.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __LUA_WEB_SOCKET_H__\n#define __LUA_WEB_SOCKET_H__\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"network/WebSocket.h\"\nclass LuaWebSocket: public cocos2d::network::WebSocket,public cocos2d::network::WebSocket::Delegate\n{\npublic:\n    virtual ~LuaWebSocket();\n    virtual void onOpen(WebSocket* ws) override;\n    virtual void onMessage(WebSocket* ws, const WebSocket::Data& data) override;\n    virtual void onClose(WebSocket* ws) override;\n    virtual void onError(WebSocket* ws, const WebSocket::ErrorCode& error) override;\n    \n    enum WebSocketScriptHandlerType\n    {\n        kWebSocketScriptHandlerOpen,\n        kWebSocketScriptHandlerMessage,\n        kWebSocketScriptHandlerClose,\n        kWebSocketScriptHandlerError,\n    };\n};\n\nTOLUA_API int tolua_web_socket_open(lua_State* tolua_S);\nTOLUA_API int register_web_socket_manual(lua_State* tolua_S);\n\n#endif //(CC_TARGET_PLATFORM == CC_PLATFORM_IOS ...\n\n#endif //__LUA_WEB_SOCKET_H__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/liblua.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{DDC3E27F-004D-4DD4-9DD3-931A013D2159}</ProjectGuid>\n    <RootNamespace>liblua</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(Configuration).win32\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration).win32\\</IntDir>\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\\..\\..;$(EngineRoot);$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocostudio;$(EngineRoot)cocos\\editor-support\\cocosbuilder;$(EngineRoot)cocos\\editor-support\\spine;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)extensions;$(EngineRoot)extensions\\network;$(EngineRoot)external;$(EngineRoot)external\\libwebsockets\\win32\\include;$(EngineRoot)external\\lua\\tolua;$(EngineRoot)external\\lua\\luajit\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\lua-bindings;$(EngineRoot)cocos\\gui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>false</MinimalRebuild>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile>\n      </PrecompiledHeaderOutputFile>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>OldStyle</DebugInformationFormat>\n      <DisableSpecificWarnings>4800;4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Lib>\n      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n    </Lib>\n    <PreLinkEvent>\n      <Command>\n      </Command>\n    </PreLinkEvent>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\external\\lua\\luajit\\prebuilt\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <Optimization>MaxSpeed</Optimization>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)..\\..\\..;$(EngineRoot);$(EngineRoot)cocos\\editor-support;$(EngineRoot)cocos\\editor-support\\cocostudio;$(EngineRoot)cocos\\editor-support\\cocosbuilder;$(EngineRoot)cocos\\editor-support\\spine;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)extensions;$(EngineRoot)extensions\\network;$(EngineRoot)external;$(EngineRoot)external\\libwebsockets\\win32\\include;$(EngineRoot)external\\lua\\tolua;$(EngineRoot)external\\lua\\luajit\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\lua-bindings;$(EngineRoot)cocos\\gui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <PrecompiledHeaderOutputFile>\n      </PrecompiledHeaderOutputFile>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <DisableSpecificWarnings>4800;4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Lib>\n      <AdditionalLibraryDirectories>libcocos2d.lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n    </Lib>\n    <PreLinkEvent>\n      <Command>\n      </Command>\n    </PreLinkEvent>\n    <PreBuildEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\..\\..\\..\\external\\lua\\luajit\\prebuilt\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_event.c\" />\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_is.c\" />\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_map.c\" />\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_push.c\" />\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_to.c\" />\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_auto.cpp\" />\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_extension_auto.cpp\" />\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_gui_auto.cpp\" />\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_physics_auto.cpp\" />\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_spine_auto.cpp\" />\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_studio_auto.cpp\" />\n    <ClCompile Include=\"CCBProxy.cpp\" />\n    <ClCompile Include=\"CCLuaBridge.cpp\" />\n    <ClCompile Include=\"CCLuaEngine.cpp\" />\n    <ClCompile Include=\"CCLuaStack.cpp\" />\n    <ClCompile Include=\"CCLuaValue.cpp\" />\n    <ClCompile Include=\"Cocos2dxLuaLoader.cpp\" />\n    <ClCompile Include=\"LuaBasicConversions.cpp\" />\n    <ClCompile Include=\"LuaOpengl.cpp\" />\n    <ClCompile Include=\"LuaScriptHandlerMgr.cpp\" />\n    <ClCompile Include=\"LuaSkeletonAnimation.cpp\" />\n    <ClCompile Include=\"lua_cocos2dx_coco_studio_manual.cpp\" />\n    <ClCompile Include=\"lua_cocos2dx_deprecated.cpp\" />\n    <ClCompile Include=\"lua_cocos2dx_extension_manual.cpp\" />\n    <ClCompile Include=\"lua_cocos2dx_gui_manual.cpp\" />\n    <ClCompile Include=\"lua_cocos2dx_manual.cpp\" />\n    <ClCompile Include=\"lua_cocos2dx_physics_manual.cpp\" />\n    <ClCompile Include=\"lua_cocos2dx_spine_manual.cpp\" />\n    <ClCompile Include=\"lua_extensions.c\" />\n    <ClCompile Include=\"Lua_web_socket.cpp\" />\n    <ClCompile Include=\"lua_xml_http_request.cpp\" />\n    <ClCompile Include=\"socket\\auxiliar.c\" />\n    <ClCompile Include=\"socket\\except.c\" />\n    <ClCompile Include=\"socket\\inet.c\" />\n    <ClCompile Include=\"socket\\luasocket.c\" />\n    <ClCompile Include=\"socket\\luasocket_buffer.c\" />\n    <ClCompile Include=\"socket\\luasocket_io.c\" />\n    <ClCompile Include=\"socket\\mime.c\" />\n    <ClCompile Include=\"socket\\options.c\" />\n    <ClCompile Include=\"socket\\select.c\" />\n    <ClCompile Include=\"socket\\socket_scripts.c\" />\n    <ClCompile Include=\"socket\\tcp.c\" />\n    <ClCompile Include=\"socket\\timeout.c\" />\n    <ClCompile Include=\"socket\\udp.c\" />\n    <ClCompile Include=\"socket\\wsocket.c\" />\n    <ClCompile Include=\"tolua_fix.c\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\lauxlib.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\lua.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\luaconf.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\lualib.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua++.h\" />\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_event.h\" />\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_auto.hpp\" />\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_extension_auto.hpp\" />\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_gui_auto.hpp\" />\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_physics_auto.hpp\" />\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_spine_auto.hpp\" />\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_studio_auto.hpp\" />\n    <ClInclude Include=\"CCBProxy.h\" />\n    <ClInclude Include=\"CCLuaBridge.h\" />\n    <ClInclude Include=\"CCLuaEngine.h\" />\n    <ClInclude Include=\"CCLuaStack.h\" />\n    <ClInclude Include=\"CCLuaValue.h\" />\n    <ClInclude Include=\"Cocos2dxLuaLoader.h\" />\n    <ClInclude Include=\"LuaBasicConversions.h\" />\n    <ClInclude Include=\"LuaOpengl.h\" />\n    <ClInclude Include=\"LuaScriptHandlerMgr.h\" />\n    <ClInclude Include=\"LuaSkeletonAnimation.h\" />\n    <ClInclude Include=\"lua_cocos2dx_coco_studio_manual.hpp\" />\n    <ClInclude Include=\"lua_cocos2dx_deprecated.h\" />\n    <ClInclude Include=\"lua_cocos2dx_extension_manual.h\" />\n    <ClInclude Include=\"lua_cocos2dx_gui_manual.hpp\" />\n    <ClInclude Include=\"lua_cocos2dx_manual.hpp\" />\n    <ClInclude Include=\"lua_cocos2dx_physics_manual.hpp\" />\n    <ClInclude Include=\"lua_cocos2dx_spine_manual.hpp\" />\n    <ClInclude Include=\"lua_extensions.h\" />\n    <ClInclude Include=\"Lua_web_socket.h\" />\n    <ClInclude Include=\"lua_xml_http_request.h\" />\n    <ClInclude Include=\"socket\\auxiliar.h\" />\n    <ClInclude Include=\"socket\\except.h\" />\n    <ClInclude Include=\"socket\\inet.h\" />\n    <ClInclude Include=\"socket\\luasocket.h\" />\n    <ClInclude Include=\"socket\\luasocket_buffer.h\" />\n    <ClInclude Include=\"socket\\luasocket_io.h\" />\n    <ClInclude Include=\"socket\\mime.h\" />\n    <ClInclude Include=\"socket\\options.h\" />\n    <ClInclude Include=\"socket\\select.h\" />\n    <ClInclude Include=\"socket\\socket.h\" />\n    <ClInclude Include=\"socket\\socket_scripts.h\" />\n    <ClInclude Include=\"socket\\tcp.h\" />\n    <ClInclude Include=\"socket\\timeout.h\" />\n    <ClInclude Include=\"socket\\udp.h\" />\n    <ClInclude Include=\"socket\\wsocket.h\" />\n    <ClInclude Include=\"tolua_fix.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_auto_api.js\" />\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_extension_auto_api.js\" />\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_gui_auto_api.js\" />\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_physics_auto_api.js\" />\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_spine_auto_api.js\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/liblua.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"tolua\">\n      <UniqueIdentifier>{243d29bc-c49a-4d05-8e2f-2c2f5858928a}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"cocos2dx_support\">\n      <UniqueIdentifier>{bbe428ed-e8e5-4e3c-80c9-0e586814b884}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"luajit\">\n      <UniqueIdentifier>{948e219e-763e-41d0-bc8d-6421dba8ad70}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"luajit\\include\">\n      <UniqueIdentifier>{b7025611-420a-4414-b567-f7496eec5f57}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"cocos2dx_support\\generated\">\n      <UniqueIdentifier>{19f563f0-e0ff-4500-890b-1755841d4ddb}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"cocos2dx_support\\socket\">\n      <UniqueIdentifier>{8815bb6e-fc9c-4cbf-b190-8b47169ed71f}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_auto.cpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_extension_auto.cpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_event.c\">\n      <Filter>tolua</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_is.c\">\n      <Filter>tolua</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_map.c\">\n      <Filter>tolua</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_push.c\">\n      <Filter>tolua</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_to.c\">\n      <Filter>tolua</Filter>\n    </ClCompile>\n    <ClCompile Include=\"LuaBasicConversions.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"LuaOpengl.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"LuaScriptHandlerMgr.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"tolua_fix.c\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCBProxy.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLuaBridge.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLuaEngine.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLuaStack.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CCLuaValue.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"Cocos2dxLuaLoader.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_cocos2dx_deprecated.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_cocos2dx_extension_manual.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_cocos2dx_manual.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"Lua_web_socket.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_xml_http_request.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_studio_auto.cpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_cocos2dx_coco_studio_manual.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_spine_auto.cpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_cocos2dx_spine_manual.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"LuaSkeletonAnimation.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_gui_auto.cpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_cocos2dx_gui_manual.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_cocos2dx_physics_manual.cpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_physics_auto.cpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\auxiliar.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\except.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\inet.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\luasocket.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\luasocket_buffer.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\luasocket_io.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\mime.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\options.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\select.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\socket_scripts.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\tcp.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\timeout.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\udp.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"socket\\wsocket.c\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClCompile>\n    <ClCompile Include=\"lua_extensions.c\">\n      <Filter>cocos2dx_support</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_auto.hpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_extension_auto.hpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\lauxlib.h\">\n      <Filter>luajit\\include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\lua.h\">\n      <Filter>luajit\\include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\luaconf.h\">\n      <Filter>luajit\\include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\luajit\\include\\lualib.h\">\n      <Filter>luajit\\include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua_event.h\">\n      <Filter>tolua</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\..\\..\\external\\lua\\tolua\\tolua++.h\">\n      <Filter>tolua</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCBProxy.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLuaBridge.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLuaEngine.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLuaStack.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CCLuaValue.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"Cocos2dxLuaLoader.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_cocos2dx_deprecated.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_cocos2dx_extension_manual.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_cocos2dx_manual.hpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"Lua_web_socket.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"LuaBasicConversions.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"LuaOpengl.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"LuaScriptHandlerMgr.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"tolua_fix.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_xml_http_request.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_studio_auto.hpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_cocos2dx_coco_studio_manual.hpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_spine_auto.hpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_cocos2dx_spine_manual.hpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"LuaSkeletonAnimation.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_gui_auto.hpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_cocos2dx_gui_manual.hpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_cocos2dx_physics_manual.hpp\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_physics_auto.hpp\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\auxiliar.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\except.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\inet.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\luasocket.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\luasocket_buffer.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\luasocket_io.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\mime.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\options.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\select.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\socket.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\socket_scripts.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\tcp.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\timeout.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\udp.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"socket\\wsocket.h\">\n      <Filter>cocos2dx_support\\socket</Filter>\n    </ClInclude>\n    <ClInclude Include=\"lua_extensions.h\">\n      <Filter>cocos2dx_support</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_auto_api.js\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </None>\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_extension_auto_api.js\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </None>\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_spine_auto_api.js\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </None>\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_gui_auto_api.js\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </None>\n    <None Include=\"..\\..\\auto-generated\\lua-bindings\\lua_cocos2dx_physics_auto_api.js\">\n      <Filter>cocos2dx_support\\generated</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"lua_cocos2dx_coco_studio_manual.hpp\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"cocos2d.h\"\n#include \"LuaBasicConversions.h\"\n#include \"LuaScriptHandlerMgr.h\"\n#include \"CCLuaValue.h\"\n#include \"CocoStudio.h\"\n#include \"CCLuaEngine.h\"\n\nusing namespace cocostudio;\n\nclass LuaArmatureWrapper:public Object\n{\npublic:\n    LuaArmatureWrapper();\n    virtual ~LuaArmatureWrapper();\n    \n    virtual void addArmatureFileInfoAsyncCallback(float percent);\n};\n\nLuaArmatureWrapper::LuaArmatureWrapper()\n{\n    \n}\n\nLuaArmatureWrapper::~LuaArmatureWrapper()\n{\n    \n}\n\nvoid LuaArmatureWrapper::addArmatureFileInfoAsyncCallback(float percent)\n{\n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n    \n    if (0 != handler)\n    {\n        LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::FILE_ASYNC , (void*)&percent);\n        \n        BasicScriptData data(this,(void*)&wrapperData);\n        \n        LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data);\n    }\n}\n\nstatic int lua_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    ArmatureAnimation* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<ArmatureAnimation*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_ArmatureAnimation_setMovementEventCallFunc'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n        \n        LuaArmatureWrapper* wrapper = new LuaArmatureWrapper();\n        wrapper->autorelease();\n        \n        Vector<LuaArmatureWrapper*> vec;\n        vec.pushBack(wrapper);\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n                \n        self->setMovementEventCallFunc([=](Armature *armature, MovementEventType movementType, const std::string& movementID){\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)vec.at(0), ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n            \n            if (0 != handler)\n            {\n                std::string strMovementID = movementID;\n                LuaArmatureMovementEventData movementData(armature,(int)movementType, strMovementID);\n                \n                LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::MOVEMENT_EVENT , (void*)&movementData);\n                \n                BasicScriptData data((void*)vec.at(0),(void*)&wrapperData);\n                \n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data);\n            }\n        });\n        return 0;\n    }\n    \n    CCLOG(\"'setMovementEventCallFunc' function of ArmatureAnimation has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setMovementEventCallFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    ArmatureAnimation* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccs.ArmatureAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<ArmatureAnimation*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n        \n        LuaArmatureWrapper* wrapper = new LuaArmatureWrapper();\n        wrapper->autorelease();\n        \n        Vector<LuaArmatureWrapper*> vec;\n        vec.pushBack(wrapper);\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n\n        self->setFrameEventCallFunc([=](Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex){\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)vec.at(0), ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n            \n            if (0 != handler)\n            {\n                std::string strFrameEventName(frameEventName);\n                \n                LuaArmatureFrameEventData frameData(bone,frameEventName,originFrameIndex,currentFrameIndex);\n                \n                LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::FRAME_EVENT , (void*)&frameData);\n                \n                BasicScriptData data((void*)vec.at(0),(void*)&wrapperData);\n                \n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data);\n            }\n        });\n        \n        return 0;\n    }\n    \n    \n    CCLOG(\"'setFrameEventCallFunc' function of ArmatureAnimation has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setFrameEventCallFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendArmatureAnimation(lua_State* L)\n{\n    lua_pushstring(L, \"ccs.ArmatureAnimation\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"setMovementEventCallFunc\", lua_cocos2dx_ArmatureAnimation_setMovementEventCallFunc);\n        tolua_function(L, \"setFrameEventCallFunc\", lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc(lua_State* L)\n{\n    if (nullptr == L)\n        return 0 ;\n    \n    int argc = 0;\n    ArmatureDataManager* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccs.ArmatureDataManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<ArmatureDataManager*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    \n    if (2 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(L, 2, 0, &tolua_err)  ||\n            !toluafix_isfunction(L,3,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        const char* configFilePath = tolua_tostring(L, 2, \"\");\n        LUA_FUNCTION handler = (  toluafix_ref_function(L, 3, 0));\n    \n        LuaArmatureWrapper* wrapper = new LuaArmatureWrapper();\n        wrapper->autorelease();\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n        \n        self->addArmatureFileInfoAsync(configFilePath, wrapper, schedule_selector(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback));\n        \n        return 0;\n    }\n    else if (4 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if ( !tolua_isstring(L, 2, 0, &tolua_err)  ||\n             !tolua_isstring(L, 3, 0, &tolua_err)  ||\n             !tolua_isstring(L, 4, 0, &tolua_err)  ||\n             !toluafix_isfunction(L,5,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif        \n        const char* imagePath = tolua_tostring(L, 2, \"\");\n        const char* plistPath = tolua_tostring(L, 3, \"\");\n        const char* configFilePath = tolua_tostring(L, 4, \"\");\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,5,0));\n        \n        LuaArmatureWrapper* wrapper = new LuaArmatureWrapper();\n        wrapper->autorelease();\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT);\n        \n        self->addArmatureFileInfoAsync(imagePath, plistPath,configFilePath,wrapper, schedule_selector(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback));\n        \n        return 0;\n    }\n    \n    CCLOG(\"'addArmatureFileInfoAsync' function of ArmatureDataManager has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'addArmatureFileInfoAsync'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendArmatureDataManager(lua_State* L)\n{\n    lua_pushstring(L, \"ccs.ArmatureDataManager\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"addArmatureFileInfoAsync\", lua_cocos2dx_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    cocostudio::Bone* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocostudio::Bone*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isboolean(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        bool ignore = (bool)tolua_toboolean(L, 2, 0);\n        self->setIgnoreMovementBoneData(ignore);\n        return 0;\n    }\n    \n    CCLOG(\"'setIgnoreMovementBoneData' function of Bone  has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setIgnoreMovementBoneData'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    cocostudio::Bone* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccs.Bone\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocostudio::Bone*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (0 == argc)\n    {\n        tolua_pushboolean(L, self->getIgnoreMovementBoneData());\n        return 1;\n    }\n    \n    CCLOG(\"'getIgnoreMovementBoneData' function of Bone  has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'getIgnoreMovementBoneData'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendBone(lua_State* L)\n{\n    lua_pushstring(L, \"ccs.Bone\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"setIgnoreMovementBoneData\", lua_cocos2dx_extension_Bone_setIgnoreMovementBoneData);\n        tolua_function(L, \"getIgnoreMovementBoneData\", lua_cocos2dx_extension_Bone_getIgnoreMovementBoneData);\n    }\n    lua_pop(L, 1);\n}\n\nint register_all_cocos2dx_coco_studio_manual(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    extendArmatureAnimation(L);\n    extendArmatureDataManager(L);\n    extendBone(L);\n    \n    return 0;\n}"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_COCO_STUDIO_MANUAL_H\n#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_COCO_STUDIO_MANUAL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"CCObject.h\"\n\nTOLUA_API int register_all_cocos2dx_coco_studio_manual(lua_State* L);\n\nstruct LuaArmatureWrapperEventData\n{\n    enum class LuaArmatureWrapperEventType\n    {\n        MOVEMENT_EVENT,\n        FRAME_EVENT,\n        FILE_ASYNC,\n    };\n    \n    LuaArmatureWrapperEventType eventType;\n    void* eventData;\n    \n    LuaArmatureWrapperEventData(LuaArmatureWrapperEventType _eventType, void* _eventData):eventType(_eventType),eventData(_eventData)\n    {\n    }\n};\n\nstruct LuaArmatureMovementEventData\n{\n    cocos2d::Object* objTarget;\n    int movementType;\n    std::string movementID;\n    \n    LuaArmatureMovementEventData(cocos2d::Object* _objTarget, int _movementType,const std::string& _movementID):objTarget(_objTarget),movementType(_movementType),movementID(_movementID)\n    {\n    }\n};\n\nstruct LuaArmatureFrameEventData\n{\n    cocos2d::Object* objTarget;\n    std::string  frameEventName;\n    int originFrameIndex;\n    int currentFrameIndex;\n    \n    LuaArmatureFrameEventData( cocos2d::Object* _objTarget, const std::string& _frameEventName, int _originFrameIndex, int _currentFrameIndex):objTarget(_objTarget), frameEventName(_frameEventName),originFrameIndex(_originFrameIndex), currentFrameIndex(_currentFrameIndex)\n    {\n    }\n};\n\n#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_COCO_STUDIO_MANUAL_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"lua_cocos2dx_deprecated.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"cocos2d.h\"\n#include \"LuaBasicConversions.h\"\n#include \"LuaScriptHandlerMgr.h\"\n#include \"CCLuaValue.h\"\n#include \"cocos-ext.h\"\n\nUSING_NS_CC;\nUSING_NS_CC_EXT;\n\ntemplate <class T>\nbool array_to_vector_t_deprecated(Array& array,Vector<T>& vec)\n{\n    if ( 0 == array.count() )\n        return false;\n    \n    vec.clear();\n    \n    for (int i = 0; i < array.count() ; i++)\n    {\n        T obj = dynamic_cast<T>(array.getObjectAtIndex(i));\n        if (nullptr  != obj)\n            vec.pushBack(obj);\n    }\n    \n    return true;\n}\n\nbool array_to_valuevector_deprecated(Array& array,ValueVector& valueVec)\n{\n    if (0 == array.count())\n        return false;\n    \n    valueVec.clear();\n    \n    String* strVal = nullptr;\n    Double* doubleVal = nullptr;\n    Bool* boolVal = nullptr;\n    Float* floatVal = nullptr;\n    Integer* intVal = nullptr;\n    \n    for (int i = 0; i < array.count(); i++)\n    {\n        if( (strVal = dynamic_cast<cocos2d::String *>(array.getObjectAtIndex(i))))\n        {\n            valueVec.push_back(Value(strVal->getCString()));\n        }\n        else if ((doubleVal = dynamic_cast<cocos2d::Double*>(array.getObjectAtIndex(i))))\n        {\n            valueVec.push_back(Value(doubleVal->getValue()));\n        }\n        else if ((floatVal = dynamic_cast<cocos2d::Float*>(array.getObjectAtIndex(i))))\n        {\n            valueVec.push_back(Value(floatVal->getValue()));\n        }\n        else if ((intVal = dynamic_cast<cocos2d::Integer*>(array.getObjectAtIndex(i))))\n        {\n            valueVec.push_back(Value(intVal->getValue()));\n        }\n        else if ((boolVal = dynamic_cast<cocos2d::Bool*>(array.getObjectAtIndex(i))))\n        {\n            valueVec.push_back(Value(boolVal->getValue()));\n        }\n        else\n        {\n            CCASSERT(false, \"the type isn't suppored.\");\n        }\n    }\n    \n    return true;\n}\n\n#define deprecatedClassTip(className) CCLOG(\"%s will be not binded in lua,please use the lua's table instead\",className)\n#define deprecatedFunctionTip(oldFun,newFun) CCLOG(\"%s was deprecated please use %s instead \",oldFun, newFun)\nstatic int tolua_Cocos2d_CCPoint_new00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCPoint\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCPoint\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point tolua_ret;\n        point_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'new'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCPoint_new00_local(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCPoint\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCPoint\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Point tolua_ret;\n        point_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'new'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCPoint_new01(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCPoint\");\n    \n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCPoint\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        float x = ((float)  tolua_tonumber(tolua_S,2,0));\n        float y = ((float)  tolua_tonumber(tolua_S,3,0));\n        Point tolua_ret(x,y);\n        point_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\ntolua_lerror:\n    return tolua_Cocos2d_CCPoint_new00(tolua_S);\n}\n\n\nstatic int tolua_Cocos2d_CCPoint_new01_local(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCPoint\");\n    \n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCPoint\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        float x = ((float)  tolua_tonumber(tolua_S,2,0));\n        float y = ((float)  tolua_tonumber(tolua_S,3,0));\n        Point tolua_ret(x,y);\n        point_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\ntolua_lerror:\n    return tolua_Cocos2d_CCPoint_new00_local(tolua_S);\n}\n\nstatic int tolua_collect_CCPoint (lua_State* tolua_S)\n{\n    Point* self = (Point*) tolua_tousertype(tolua_S,1,0);\n    Mtolua_delete(self);\n    return 0;\n}\n\nstatic int register_cocos2dx_deprecated_Point(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"CCPoint\");\n#ifdef __cplusplus\n    tolua_cclass(tolua_S,\"CCPoint\",\"CCPoint\",\"\",tolua_collect_CCPoint);\n#else\n    tolua_cclass(tolua_S,\"CCPoint\",\"CCPoint\",\"\",NULL);\n#endif\n    tolua_beginmodule(tolua_S,\"CCPoint\");\n        tolua_function(tolua_S,\"new\",tolua_Cocos2d_CCPoint_new00);\n        tolua_function(tolua_S,\"new_local\",tolua_Cocos2d_CCPoint_new00_local);\n        tolua_function(tolua_S,\".call\",tolua_Cocos2d_CCPoint_new00_local);\n        tolua_function(tolua_S,\"new\",tolua_Cocos2d_CCPoint_new01);\n        tolua_function(tolua_S,\"new_local\",tolua_Cocos2d_CCPoint_new01_local);\n        tolua_function(tolua_S,\".call\",tolua_Cocos2d_CCPoint_new01_local);\n    tolua_endmodule(tolua_S);\n    \n    return 1;\n}\n\nstatic int tolua_Cocos2d_CCRect_new00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCRect\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCRect\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Rect tolua_ret;\n        rect_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'new'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCRect_new00_local(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCRect\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCRect\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Rect tolua_ret;\n        rect_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'new'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCRect_new01(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCRect\");\n    \n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCRect\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,5,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,6,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        float x = ((float)  tolua_tonumber(tolua_S,2,0));\n        float y = ((float)  tolua_tonumber(tolua_S,3,0));\n        float width = ((float)  tolua_tonumber(tolua_S,4,0));\n        float height = ((float)  tolua_tonumber(tolua_S,5,0));\n        Rect tolua_ret(x, y, width, height);\n        rect_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\ntolua_lerror:\n    return tolua_Cocos2d_CCRect_new00(tolua_S);\n}\n\n\nstatic int tolua_Cocos2d_CCRect_new01_local(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCRect\");\n    \n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCRect\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,4,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,5,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,6,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        float x = ((float)  tolua_tonumber(tolua_S,2,0));\n        float y = ((float)  tolua_tonumber(tolua_S,3,0));\n        float width = ((float)  tolua_tonumber(tolua_S,4,0));\n        float height = ((float)  tolua_tonumber(tolua_S,5,0));\n        Rect tolua_ret(x, y, width, height);\n        rect_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\ntolua_lerror:\n    return tolua_Cocos2d_CCRect_new00_local(tolua_S);\n}\n\nstatic int register_cocos2dx_deprecated_Rect(lua_State* tolua_S)\n{\n    \n    tolua_usertype(tolua_S,\"CCRect\");\n    tolua_cclass(tolua_S,\"CCRect\",\"CCRect\",\"\",NULL);\n    tolua_beginmodule(tolua_S,\"CCRect\");\n        tolua_function(tolua_S,\"new\",tolua_Cocos2d_CCRect_new00);\n        tolua_function(tolua_S,\"new_local\",tolua_Cocos2d_CCRect_new00_local);\n        tolua_function(tolua_S,\".call\",tolua_Cocos2d_CCRect_new00_local);\n        tolua_function(tolua_S,\"new\",tolua_Cocos2d_CCRect_new01);\n        tolua_function(tolua_S,\"new_local\",tolua_Cocos2d_CCRect_new01_local);\n        tolua_function(tolua_S,\".call\",tolua_Cocos2d_CCRect_new01_local);\n    tolua_endmodule(tolua_S);\n    \n    return 1;\n}\n\nstatic int tolua_Cocos2d_CCSize_new00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCSize\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCSize\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Size tolua_ret;\n        size_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'new'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCSize_new00_local(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCSize\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCSize\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Size tolua_ret;\n        size_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'new'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCSize_new01(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCSize\");\n    \n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCSize\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        float width = ((float)  tolua_tonumber(tolua_S,2,0));\n        float height = ((float)  tolua_tonumber(tolua_S,3,0));\n        Size tolua_ret(width, height);\n        size_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\ntolua_lerror:\n    return tolua_Cocos2d_CCSize_new00(tolua_S);\n}\n\n\n\nstatic int tolua_Cocos2d_CCSize_new01_local(lua_State* tolua_S)\n{\n    \n    deprecatedClassTip(\"CCSize\");\n    \n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCSize\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        float width = ((float)  tolua_tonumber(tolua_S,2,0));\n        float height = ((float)  tolua_tonumber(tolua_S,3,0));\n        Size tolua_ret(width, height);\n        size_to_luaval(tolua_S, tolua_ret);\n    }\n    return 1;\ntolua_lerror:\n    return tolua_Cocos2d_CCSize_new00_local(tolua_S);\n}\n\n\nstatic int register_cocos2dx_deprecated_Size(lua_State* tolua_S)\n{\n    \n    tolua_usertype(tolua_S,\"CCSize\");\n    tolua_cclass(tolua_S,\"CCSize\",\"CCSize\",\"\",NULL);\n    tolua_beginmodule(tolua_S,\"CCSize\");\n        tolua_function(tolua_S,\"new\",tolua_Cocos2d_CCSize_new00);\n        tolua_function(tolua_S,\"new_local\",tolua_Cocos2d_CCSize_new00_local);\n        tolua_function(tolua_S,\".call\",tolua_Cocos2d_CCSize_new00_local);\n        tolua_function(tolua_S,\"new\",tolua_Cocos2d_CCSize_new01);\n        tolua_function(tolua_S,\"new_local\",tolua_Cocos2d_CCSize_new01_local);\n        tolua_function(tolua_S,\".call\",tolua_Cocos2d_CCSize_new01_local);\n    tolua_endmodule(tolua_S);\n    \n    return 1;\n}\n\n\nstatic int tolua_Cocos2d_CCArray_create00(lua_State* tolua_S)\n{\n    \n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        {\n            Array* tolua_ret = (Array*)  Array::create();\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCArray\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_createWithObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Object* pObject = ((Object*)  tolua_tousertype(tolua_S,2,0));\n        {\n            Array* tolua_ret = (Array*)  Array::createWithObject(pObject);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCArray\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_createWithArray00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* otherArray = ((Array*)  tolua_tousertype(tolua_S,2,0));\n        {\n            Array* tolua_ret = (Array*)  Array::createWithArray(otherArray);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCArray\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_createWithCapacity00(lua_State* tolua_S)\n{\n    \n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned int capacity = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        {\n            Array* tolua_ret = (Array*)  Array::createWithCapacity(capacity);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCArray\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithCapacity'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_createWithContentsOfFile00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const char* pFileName = ((const char*)  tolua_tostring(tolua_S,2,0));\n        {\n            Array* tolua_ret = (Array*)  Array::createWithContentsOfFile(pFileName);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCArray\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithContentsOfFile'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_count00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'count'\", NULL);\n#endif\n        {\n            unsigned int tolua_ret = (unsigned int)  self->count();\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'count'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_capacity00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'capacity'\", NULL);\n#endif\n        {\n            unsigned int tolua_ret = (unsigned int)  self->capacity();\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'capacity'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_indexOfObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Object* object = ((Object*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'indexOfObject'\", NULL);\n#endif\n        {\n            unsigned int tolua_ret = (unsigned int)  self->getIndexOfObject(object);\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'indexOfObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_objectAtIndex00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        unsigned int index = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'objectAtIndex'\", NULL);\n#endif\n        {\n            Object* tolua_ret = (Object*)  self->getObjectAtIndex(index);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Object\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'objectAtIndex'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_lastObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'lastObject'\", NULL);\n#endif\n        {\n            Object* tolua_ret = (Object*)  self->getLastObject();\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Object\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lastObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_randomObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'randomObject'\", NULL);\n#endif\n        {\n            Object* tolua_ret = (Object*)  self->getRandomObject();\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Object\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'randomObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_isEqualToArray00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Array* pOtherArray = ((Array*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'isEqualToArray'\", NULL);\n#endif\n        {\n            bool tolua_ret = (bool)  self->isEqualToArray(pOtherArray);\n            tolua_pushboolean(tolua_S,(bool)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'isEqualToArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_containsObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Object* object = ((Object*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'containsObject'\", NULL);\n#endif\n        {\n            bool tolua_ret = (bool)  self->containsObject(object);\n            tolua_pushboolean(tolua_S,(bool)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'containsObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_addObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Object* object = ((Object*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'addObject'\", NULL);\n#endif\n        {\n            self->addObject(object);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'addObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCArray_addObjectsFromArray00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Array* otherArray = ((Array*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'addObjectsFromArray'\", NULL);\n#endif\n        {\n            self->addObjectsFromArray(otherArray);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'addObjectsFromArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_insertObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Object* object = ((Object*)  tolua_tousertype(tolua_S,2,0));\n        unsigned int index = ((unsigned int)  tolua_tonumber(tolua_S,3,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'insertObject'\", NULL);\n#endif\n        {\n            self->insertObject(object,index);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'insertObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCArray_removeLastObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,2,1,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        bool bReleaseObj = ((bool)  tolua_toboolean(tolua_S,2,true));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'removeLastObject'\", NULL);\n#endif\n        {\n            self->removeLastObject(bReleaseObj);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'removeLastObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_removeObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,3,1,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Object* object = ((Object*)  tolua_tousertype(tolua_S,2,0));\n        bool bReleaseObj = ((bool)  tolua_toboolean(tolua_S,3,true));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'removeObject'\", NULL);\n#endif\n        {\n            self->removeObject(object,bReleaseObj);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'removeObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_removeObjectAtIndex00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,3,1,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        unsigned int index = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        bool bReleaseObj = ((bool)  tolua_toboolean(tolua_S,3,true));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'removeObjectAtIndex'\", NULL);\n#endif\n        {\n            self->removeObjectAtIndex(index,bReleaseObj);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'removeObjectAtIndex'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCArray_removeObjectsInArray00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Array* otherArray = ((Array*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'removeObjectsInArray'\", NULL);\n#endif\n        {\n            self->removeObjectsInArray(otherArray);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'removeObjectsInArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCArray_removeAllObjects00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'removeAllObjects'\", NULL);\n#endif\n        {\n            self->removeAllObjects();\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'removeAllObjects'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCArray_fastRemoveObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Object* object = ((Object*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'fastRemoveObject'\", NULL);\n#endif\n        {\n            self->fastRemoveObject(object);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'fastRemoveObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCArray_fastRemoveObjectAtIndex00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        unsigned int index = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'fastRemoveObjectAtIndex'\", NULL);\n#endif\n        {\n            self->fastRemoveObjectAtIndex(index);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'fastRemoveObjectAtIndex'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_exchangeObject00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"Object\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,3,\"Object\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        Object* object1 = ((Object*)  tolua_tousertype(tolua_S,2,0));\n        Object* object2 = ((Object*)  tolua_tousertype(tolua_S,3,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'exchangeObject'\", NULL);\n#endif\n        {\n            self->exchangeObject(object1,object2);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'exchangeObject'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCArray_exchangeObjectAtIndex00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        unsigned int index1 = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        unsigned int index2 = ((unsigned int)  tolua_tonumber(tolua_S,3,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'exchangeObjectAtIndex'\", NULL);\n#endif\n        {\n            self->exchangeObjectAtIndex(index1,index2);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'exchangeObjectAtIndex'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_reverseObjects00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'reverseObjects'\", NULL);\n#endif\n        {\n            self->reverseObjects();\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'reverseObjects'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_reduceMemoryFootprint00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'reduceMemoryFootprint'\", NULL);\n#endif\n        {\n            self->reduceMemoryFootprint();\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'reduceMemoryFootprint'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCArray_replaceObjectAtIndex00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCArray\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,3,\"Object\",0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,4,1,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,5,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* self = (Array*)  tolua_tousertype(tolua_S,1,0);\n        unsigned int uIndex = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        Object* pObject = ((Object*)  tolua_tousertype(tolua_S,3,0));\n        bool bReleaseObject = ((bool)  tolua_toboolean(tolua_S,4,true));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'replaceObjectAtIndex'\", NULL);\n#endif\n        {\n            self->replaceObjectAtIndex(uIndex,pObject,bReleaseObject);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'replaceObjectAtIndex'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int register_cocos2dx_deprecated_Array(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S, \"CCArray\");\n    \n    tolua_cclass(tolua_S,\"CCArray\",\"CCArray\",\"CCObject\",NULL);\n    tolua_beginmodule(tolua_S,\"CCArray\");\n        tolua_function(tolua_S,\"create\",tolua_Cocos2d_CCArray_create00);\n        tolua_function(tolua_S,\"createWithObject\",tolua_Cocos2d_CCArray_createWithObject00);\n        tolua_function(tolua_S,\"createWithArray\",tolua_Cocos2d_CCArray_createWithArray00);\n        tolua_function(tolua_S,\"createWithCapacity\",tolua_Cocos2d_CCArray_createWithCapacity00);\n        tolua_function(tolua_S,\"createWithContentsOfFile\",tolua_Cocos2d_CCArray_createWithContentsOfFile00);\n        tolua_function(tolua_S,\"count\",tolua_Cocos2d_CCArray_count00);\n        tolua_function(tolua_S,\"capacity\",tolua_Cocos2d_CCArray_capacity00);\n        tolua_function(tolua_S,\"indexOfObject\",tolua_Cocos2d_CCArray_indexOfObject00);\n        tolua_function(tolua_S,\"objectAtIndex\",tolua_Cocos2d_CCArray_objectAtIndex00);\n        tolua_function(tolua_S,\"lastObject\",tolua_Cocos2d_CCArray_lastObject00);\n        tolua_function(tolua_S,\"randomObject\",tolua_Cocos2d_CCArray_randomObject00);\n        tolua_function(tolua_S,\"isEqualToArray\",tolua_Cocos2d_CCArray_isEqualToArray00);\n        tolua_function(tolua_S,\"containsObject\",tolua_Cocos2d_CCArray_containsObject00);\n        tolua_function(tolua_S,\"addObject\",tolua_Cocos2d_CCArray_addObject00);\n        tolua_function(tolua_S,\"addObjectsFromArray\",tolua_Cocos2d_CCArray_addObjectsFromArray00);\n        tolua_function(tolua_S,\"insertObject\",tolua_Cocos2d_CCArray_insertObject00);\n        tolua_function(tolua_S,\"removeLastObject\",tolua_Cocos2d_CCArray_removeLastObject00);\n        tolua_function(tolua_S,\"removeObject\",tolua_Cocos2d_CCArray_removeObject00);\n        tolua_function(tolua_S,\"removeObjectAtIndex\",tolua_Cocos2d_CCArray_removeObjectAtIndex00);\n        tolua_function(tolua_S,\"removeObjectsInArray\",tolua_Cocos2d_CCArray_removeObjectsInArray00);\n        tolua_function(tolua_S,\"removeAllObjects\",tolua_Cocos2d_CCArray_removeAllObjects00);\n        tolua_function(tolua_S,\"fastRemoveObject\",tolua_Cocos2d_CCArray_fastRemoveObject00);\n        tolua_function(tolua_S,\"fastRemoveObjectAtIndex\",tolua_Cocos2d_CCArray_fastRemoveObjectAtIndex00);\n        tolua_function(tolua_S,\"exchangeObject\",tolua_Cocos2d_CCArray_exchangeObject00);\n        tolua_function(tolua_S,\"exchangeObjectAtIndex\",tolua_Cocos2d_CCArray_exchangeObjectAtIndex00);\n        tolua_function(tolua_S,\"reverseObjects\",tolua_Cocos2d_CCArray_reverseObjects00);\n        tolua_function(tolua_S,\"reduceMemoryFootprint\",tolua_Cocos2d_CCArray_reduceMemoryFootprint00);\n        tolua_function(tolua_S,\"replaceObjectAtIndex\",tolua_Cocos2d_CCArray_replaceObjectAtIndex00);\n    tolua_endmodule(tolua_S);\n    \n    return 1;\n}\n\nstatic int tolua_cocos2d_kmGLPushMatrix00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S,1,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        kmGLPushMatrix();\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'kmGLPushMatrix'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_kmGLTranslatef00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnumber(tolua_S,1,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        float x = ((float)  tolua_tonumber(tolua_S,1,0));\n        float y = ((float)  tolua_tonumber(tolua_S,2,0));\n        float z = ((float)  tolua_tonumber(tolua_S,3,0));\n        {\n            kmGLTranslatef(x,y,z);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'kmGLTranslatef'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_kmGLPopMatrix00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isnoobj(tolua_S,1,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        {\n            kmGLPopMatrix();\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'kmGLPopMatrix'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_intValue00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'intValue'\", NULL);\n#endif\n        {\n            int tolua_ret = (int)  self->intValue();\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'intValue'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_uintValue00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'uintValue'\", NULL);\n#endif\n        {\n            unsigned int tolua_ret = (unsigned int)  self->uintValue();\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'uintValue'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_floatValue00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'floatValue'\", NULL);\n#endif\n        {\n            float tolua_ret = (float)  self->floatValue();\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'floatValue'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_doubleValue00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'doubleValue'\", NULL);\n#endif\n        {\n            double tolua_ret = (double)  self->doubleValue();\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'doubleValue'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_boolValue00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'boolValue'\", NULL);\n#endif\n        {\n            bool tolua_ret = (bool)  self->boolValue();\n            tolua_pushboolean(tolua_S,(bool)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'boolValue'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_getCString00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'getCString'\", NULL);\n#endif\n        {\n            const char* tolua_ret = (const char*)  self->getCString();\n            tolua_pushstring(tolua_S,(const char*)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getCString'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\n\nstatic int tolua_Cocos2d_CCString_length00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'length'\", NULL);\n#endif\n        {\n            unsigned int tolua_ret = (unsigned int)  self->length();\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'length'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_compare00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"const CCString\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const String* self = (const String*)  tolua_tousertype(tolua_S,1,0);\n        const char* str = ((const char*)  tolua_tostring(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'compare'\", NULL);\n#endif\n        {\n            int tolua_ret = (int)  self->compare(str);\n            tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'compare'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\n\nstatic int tolua_Cocos2d_CCString_isEqual00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"CCString\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"const CCObject\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        String* self = (String*)  tolua_tousertype(tolua_S,1,0);\n        const Object* pObject = ((const Object*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'isEqual'\", NULL);\n#endif\n        {\n            bool tolua_ret = (bool)  self->isEqual(pObject);\n            tolua_pushboolean(tolua_S,(bool)tolua_ret);\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'isEqual'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_create00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCString\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const char* pStr = ((const char*)  tolua_tostring(tolua_S,2,0));\n        {\n            String* tolua_ret = (String*)  String::create(pStr);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCString\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_createWithData00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCString\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        unsigned char* pData = ((unsigned char*)  tolua_tostring(tolua_S,2,0));\n        unsigned long nLen = ((unsigned long)  tolua_tonumber(tolua_S,3,0));\n        {\n            String* tolua_ret = (String*)  String::createWithData(pData,nLen);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCString\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithData'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_CCString_createWithContentsOfFile00(lua_State* tolua_S)\n{\n    deprecatedClassTip(\"CCString\");\n    \n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"CCString\",0,&tolua_err) ||\n        !tolua_isstring(tolua_S,2,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        const char* pszFileName = ((const char*)  tolua_tostring(tolua_S,2,0));\n        {\n            String* tolua_ret = (String*)  String::createWithContentsOfFile(pszFileName);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCString\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithContentsOfFile'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int register_cocos2dx_deprecated_String(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S, \"CCString\");\n    tolua_cclass(tolua_S,\"CCString\",\"CCString\",\"Object\",NULL);\n    tolua_beginmodule(tolua_S,\"CCString\");\n        tolua_function(tolua_S,\"intValue\",tolua_Cocos2d_CCString_intValue00);\n        tolua_function(tolua_S,\"uintValue\",tolua_Cocos2d_CCString_uintValue00);\n        tolua_function(tolua_S,\"floatValue\",tolua_Cocos2d_CCString_floatValue00);\n        tolua_function(tolua_S,\"doubleValue\",tolua_Cocos2d_CCString_doubleValue00);\n        tolua_function(tolua_S,\"boolValue\",tolua_Cocos2d_CCString_boolValue00);\n        tolua_function(tolua_S,\"getCString\",tolua_Cocos2d_CCString_getCString00);\n        tolua_function(tolua_S,\"length\",tolua_Cocos2d_CCString_length00);\n        tolua_function(tolua_S,\"compare\",tolua_Cocos2d_CCString_compare00);\n        tolua_function(tolua_S,\"isEqual\",tolua_Cocos2d_CCString_isEqual00);\n        tolua_function(tolua_S,\"create\",tolua_Cocos2d_CCString_create00);\n        tolua_function(tolua_S,\"createWithData\",tolua_Cocos2d_CCString_createWithData00);\n        tolua_function(tolua_S,\"createWithContentsOfFile\",tolua_Cocos2d_CCString_createWithContentsOfFile00);\n    tolua_endmodule(tolua_S);\n    return 1;\n}\n\n\nint register_all_cocos2dx_deprecated(lua_State* tolua_S)\n{\n    tolua_open(tolua_S);\n    \n    tolua_module(tolua_S,NULL,0);\n    tolua_beginmodule(tolua_S,NULL);\n    register_cocos2dx_deprecated_Point(tolua_S);\n    register_cocos2dx_deprecated_Rect(tolua_S);\n    register_cocos2dx_deprecated_Size(tolua_S);\n    register_cocos2dx_deprecated_Array(tolua_S);\n    register_cocos2dx_deprecated_String(tolua_S);\n    tolua_function(tolua_S,\"kmGLPushMatrix\",tolua_cocos2d_kmGLPushMatrix00);\n    tolua_function(tolua_S,\"kmGLTranslatef\",tolua_cocos2d_kmGLTranslatef00);\n    tolua_function(tolua_S,\"kmGLPopMatrix\",tolua_cocos2d_kmGLPopMatrix00);\n    tolua_endmodule(tolua_S);\n    \n    return 0;\n}\n\nextern int lua_cocos2dx_Animation_createWithSpriteFrames(lua_State* tolua_S);\n\nstatic int tolua_cocos2d_Animation_createWithSpriteFrames_deprecated00(lua_State* tolua_S)\n{\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"Animation\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        Array* arrayOfSpriteFrameNames = ((Array*)  tolua_tousertype(tolua_S,2,0));\n        Vector<SpriteFrame*> vec;\n        array_to_vector_t_deprecated(*arrayOfSpriteFrameNames, vec);\n        float delay = ((float)  tolua_tonumber(tolua_S,3,0));\n        cocos2d::Animation* tolua_ret = (cocos2d::Animation*)  cocos2d::Animation::createWithSpriteFrames(vec,delay);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Animation\");\n    \n    }\n    return 1;\ntolua_lerror:\n    return lua_cocos2dx_Animation_createWithSpriteFrames(tolua_S);\n}\n\nstatic int tolua_cocos2d_Animation_createWithSpriteFrames_deprecated01(lua_State* tolua_S)\n{\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"Animation\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        Array* arrayOfSpriteFrameNames = ((Array*)  tolua_tousertype(tolua_S,2,0));\n        Vector<SpriteFrame*> vec;\n        array_to_vector_t_deprecated(*arrayOfSpriteFrameNames, vec);\n        cocos2d::Animation* tolua_ret = (cocos2d::Animation*)  cocos2d::Animation::createWithSpriteFrames(vec);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Animation\");\n        \n    }\n    return 1;\ntolua_lerror:\n    return tolua_cocos2d_Animation_createWithSpriteFrames_deprecated00(tolua_S);\n}\n\nstatic void extendAnimationDeprecated(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"Animation\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"createWithSpriteFrames\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Animation_createWithSpriteFrames_deprecated00);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"createWithSpriteFrames\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Animation_createWithSpriteFrames_deprecated01);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2d_Sequence_createWithTwoActions(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"Sequence\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"FiniteTimeAction\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,3,\"FiniteTimeAction\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        FiniteTimeAction* pActionOne = ((FiniteTimeAction*)  tolua_tousertype(tolua_S,2,0));\n        FiniteTimeAction* pActionTwo = ((FiniteTimeAction*)  tolua_tousertype(tolua_S,3,0));\n        {\n            Sequence* tolua_ret = (Sequence*)  Sequence::createWithTwoActions(pActionOne,pActionTwo);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Sequence\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithTwoActions'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nextern int tolua_cocos2d_Sequence_create(lua_State* tolua_S);\nstatic int tolua_Cocos2d_Sequence_create_deprecated00(lua_State* tolua_S)\n{\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"Sequence\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        Array* actions = ((Array*)  tolua_tousertype(tolua_S,2,0));\n        Vector<FiniteTimeAction*> vec;\n        array_to_vector_t_deprecated(*actions, vec);\n        Sequence* tolua_ret = (Sequence*)  Sequence::create(vec);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Sequence\");\n    }\n    return 1;\ntolua_lerror:\n    return tolua_cocos2d_Sequence_create(tolua_S);\n}\n\nstatic int extendSequenceDeprecated(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"Sequence\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"createWithTwoActions\",tolua_cocos2d_Sequence_createWithTwoActions);\n        tolua_function(tolua_S, \"create\", tolua_Cocos2d_Sequence_create_deprecated00);\n    }\n    lua_pop(tolua_S, 1);\n    \n    return 1;\n}\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nextern int tolua_bnd_cast(lua_State* tolua_S);\n#ifdef __cplusplus\n}\n#endif\n\nstatic int tolua_bnd_cast_deprecated00(lua_State* tolua_S)\n{\n    void* v = nullptr;\n    std::string strValue = \"\";\n    strValue = tolua_tostring(tolua_S,2,NULL);\n    int pos = strValue.find(\"CC\");\n    if (pos == 0 &&\n        std::string::npos == strValue.find(\"CCBAnimationManager\") &&\n        std::string::npos == strValue.find(\"CCString\") &&\n        std::string::npos == strValue.find(\"CCPoint\") &&\n        std::string::npos == strValue.find(\"CCRect\") &&\n        std::string::npos == strValue.find(\"CCSize\") &&\n        std::string::npos == strValue.find(\"CCArray\"))\n    {\n        strValue = strValue.substr(2);\n        if (lua_islightuserdata(tolua_S, 1)) {\n            v = tolua_touserdata(tolua_S, 1, NULL);\n        } else {\n            v = tolua_tousertype(tolua_S, 1, 0);\n        };\n        if (v && !strValue.empty())\n            tolua_pushusertype(tolua_S,v,strValue.c_str());\n        else\n            lua_pushnil(tolua_S);\n        return 1;        \n    }\n    else\n    {\n        std::string castName = tolua_tostring(tolua_S,2,NULL);\n        auto iter = g_typeCast.find(castName);\n        if (iter != g_typeCast.end() )\n        {\n            CCLOG(\"Cast name %s doesn't include modular name which it belongs to,please add the modular name\",iter->first.c_str());\n            tolua_pushstring(tolua_S, iter->second.c_str());\n            lua_insert(tolua_S, 2);\n            lua_pop(tolua_S, 1);\n        }\n        return tolua_bnd_cast(tolua_S);\n    }\n}\n\nstatic int extendToluaDeprecated(lua_State* tolua_S)\n{\n    lua_getglobal(tolua_S, \"_G\");\n    if (lua_istable(tolua_S,-1))//stack:...,_G,\n    {\n        lua_pushstring(tolua_S,\"tolua\");//stack:_G,keyValue\n        lua_gettable(tolua_S, -2);//stack:_G,toluaModule\n        if (lua_istable(tolua_S,-1))\n        {\n            tolua_function(tolua_S, \"cast\", tolua_bnd_cast_deprecated00);\n        }\n        lua_pop(tolua_S, 1);//statck:_G\n    }\n    lua_pop(tolua_S, 1);//statck:...\n    \n    return 1;\n}\n\nstatic int tolua_cocos2d_Spawn_createWithTwoActions_deprcated00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"Spawn\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"FiniteTimeAction\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,3,\"FiniteTimeAction\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,4,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        FiniteTimeAction* pAction1 = ((FiniteTimeAction*)  tolua_tousertype(tolua_S,2,0));\n        FiniteTimeAction* pAction2 = ((FiniteTimeAction*)  tolua_tousertype(tolua_S,3,0));\n        {\n            Spawn* tolua_ret = (Spawn*)  Spawn::createWithTwoActions(pAction1,pAction2);\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Spawn\");\n        }\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithTwoActions'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int extendSpawnDeprecated(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"Spawn\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"createWithTwoActions\", tolua_cocos2d_Spawn_createWithTwoActions_deprcated00);\n    }\n    lua_pop(tolua_S, 1);\n    return 1;\n}\n\n\nstatic int tolua_cocos2d_Menu_createWithArray00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"Menu\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* arrayOfItems = ((Array*)  tolua_tousertype(tolua_S,2,0));\n        Vector<MenuItem*> vec;\n        array_to_vector_t_deprecated(*arrayOfItems, vec);\n        Menu* tolua_ret = (Menu*)  Menu::createWithArray(vec);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"Menu\");\n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Menu_alignItemsInColumnsWithArray00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"Menu\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Menu* self = (Menu*)  tolua_tousertype(tolua_S,1,0);\n        Array* rows = ((Array*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'alignItemsInColumnsWithArray'\", NULL);\n#endif\n        ValueVector valueVector;\n        array_to_valuevector_deprecated(*rows, valueVector);\n        self->alignItemsInColumnsWithArray(valueVector);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'alignItemsInColumnsWithArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_cocos2d_Menu_alignItemsInRowsWithArray00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"Menu\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Menu* self = (Menu*)  tolua_tousertype(tolua_S,1,0);\n        Array* columns = ((Array*)  tolua_tousertype(tolua_S,2,0));\n#ifndef TOLUA_RELEASE\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'alignItemsInRowsWithArray'\", NULL);\n#endif\n        ValueVector valueVector;\n        array_to_valuevector_deprecated(*columns, valueVector);\n        self->alignItemsInRowsWithArray(valueVector);\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'alignItemsInRowsWithArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int extendMenuDeprecated(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"Menu\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"createWithArray\", tolua_cocos2d_Menu_createWithArray00);\n        tolua_function(tolua_S, \"alignItemsInColumnsWithArray\", tolua_cocos2d_Menu_alignItemsInColumnsWithArray00);\n        tolua_function(tolua_S, \"alignItemsInRowsWithArray\", tolua_cocos2d_Menu_alignItemsInRowsWithArray00);\n    }\n    lua_pop(tolua_S, 1);\n    return 1;\n}\n\nstatic int tolua_cocos2d_LayerMultiplex_createWithArray00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertable(tolua_S,1,\"LayerMultiplex\",0,&tolua_err) ||\n        !tolua_isusertype(tolua_S,2,\"CCArray\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n        Array* arrayOfLayers = ((Array*)  tolua_tousertype(tolua_S,2,0));\n        Vector<Layer*> vec;\n        array_to_vector_t_deprecated(*arrayOfLayers, vec);\n        LayerMultiplex* tolua_ret = (LayerMultiplex*)  LayerMultiplex::createWithArray(vec);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"LayerMultiplex\");\n        \n    }\n    return 1;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createWithArray'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int extendLayerMultiplexDeprecated(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"LayerMultiplex\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"createWithArray\", tolua_cocos2d_LayerMultiplex_createWithArray00);\n    }\n    lua_pop(tolua_S, 1);\n    return 1;\n}\n\n\nint register_all_cocos2dx_manual_deprecated(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    extendAnimationDeprecated(tolua_S);\n    extendSequenceDeprecated(tolua_S);\n    extendToluaDeprecated(tolua_S);\n    extendMenuDeprecated(tolua_S);\n    extendLayerMultiplexDeprecated(tolua_S);\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_DEPRECATED_H\n#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_DEPRECATED_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\nTOLUA_API int register_all_cocos2dx_deprecated(lua_State* tolua_S);\nTOLUA_API int register_all_cocos2dx_manual_deprecated(lua_State* tolua_S);\n\n#endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_DEPRECATED_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"lua_cocos2dx_extension_manual.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"cocos2d.h\"\n#include \"LuaBasicConversions.h\"\n#include \"CCLuaValue.h\"\n#include \"cocos-ext.h\"\n#include \"CCBProxy.h\"\n#include \"cocostudio/CocoStudio.h\"\n\nUSING_NS_CC;\nUSING_NS_CC_EXT;\nusing namespace cocostudio;\n\nclass LuaScrollViewDelegate:public Object, public ScrollViewDelegate\n{\npublic:\n    virtual ~LuaScrollViewDelegate()\n    {}\n    \n    virtual void scrollViewDidScroll(ScrollView* view) override\n    {\n        if (nullptr != view)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL);\n            if (0 != handler)\n            {\n                CommonScriptData data(handler,\"\");\n                ScriptEvent event(kCommonEvent,(void*)&data);\n                LuaEngine::getInstance()->sendEvent(&event);\n            }\n            \n        }\n    }\n    \n    virtual void scrollViewDidZoom(ScrollView* view) override\n    {\n        if (nullptr != view)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM);\n            if (0 != handler)\n            {\n                CommonScriptData data(handler,\"\");\n                ScriptEvent event(kCommonEvent,(void*)&data);\n                LuaEngine::getInstance()->sendEvent(&event);\n            }\n        }\n    }\n};\n\nstatic int tolua_cocos2dx_ScrollView_setDelegate(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    ScrollView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (ScrollView*)  tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_ScrollView_setDelegate'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        LuaScrollViewDelegate* delegate = new LuaScrollViewDelegate();\n        if (nullptr == delegate)\n            return 0;\n        \n        self->setUserObject(delegate);\n        self->setDelegate(delegate);\n        \n        delegate->release();\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setDelegate' function of ScrollView wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setDelegate'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_ScrollView_registerScriptHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    ScrollView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<ScrollView*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_ScrollView_registerScriptHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(tolua_S) - 1;\n    if (2 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = (  toluafix_ref_function(tolua_S,2,0));\n        ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(tolua_S,3,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL);\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, handlerType);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' function of ScrollView has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_ScrollView_unregisterScriptHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    ScrollView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.ScrollView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<ScrollView*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_ScrollView_unregisterScriptHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(tolua_S,2,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL);\n        ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, handlerType);\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptHandler' function of ScrollView  has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendScrollView(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.ScrollView\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setDelegate\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_ScrollView_setDelegate );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"registerScriptHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_ScrollView_registerScriptHandler );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"unregisterScriptHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_ScrollView_unregisterScriptHandler );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\n\nstatic int tolua_cocos2d_Control_registerControlEventHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Control* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<Control*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Control_registerControlEventHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (2 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = (  toluafix_ref_function(tolua_S,2,0));\n        int controlevent = (int)tolua_tonumber(tolua_S,3,0);\n        for (int i = 0; i < kControlEventTotalNumber; i++)\n        {\n            if ((controlevent & (1 << i)))\n            {\n                ScriptHandlerMgr::HandlerType handlerevent  = ScriptHandlerMgr::HandlerType((int)ScriptHandlerMgr::HandlerType::CONTROL_TOUCH_DOWN + i);\n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, handlerevent);\n            }\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'registerControlEventHandler' function of Control has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerControlEventHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_control_unregisterControlEventHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Control* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Control\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<Control*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_control_unregisterControlEventHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        int controlevent = (int)tolua_tonumber(tolua_S,2,0);\n        for (int i = 0; i < kControlEventTotalNumber; i++)\n        {\n            if ((controlevent & (1 << i)))\n            {\n                ScriptHandlerMgr::HandlerType handlerevent  = ScriptHandlerMgr::HandlerType((int)ScriptHandlerMgr::HandlerType::CONTROL_TOUCH_DOWN + i);\n                ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, handlerevent);\n                break;\n            }\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterControlEventHandler' function of Control  has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterControlEventHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendControl(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.Control\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"registerControlEventHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Control_registerControlEventHandler );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"unregisterControlEventHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_control_unregisterControlEventHandler );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2d_EditBox_registerScriptEditBoxHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    EditBox* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<EditBox*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_EditBox_registerScriptEditBoxHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = (  toluafix_ref_function(tolua_S,2,0));\n        self->registerScriptEditBoxHandler(handler);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptEditBoxHandler' function of EditBox  has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptEditBoxHandler'.\",&tolua_err);\n    return 0;\n#endif\n\n}\n\nstatic int tolua_cocos2d_EditBox_unregisterScriptEditBoxHandler(lua_State* tolua_S)\n{\n    \n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    EditBox* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.EditBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<EditBox*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_EditBox_unregisterScriptEditBoxHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        self->unregisterScriptEditBoxHandler();\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptEditBoxHandler' function of EditBox  has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptEditBoxHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendEditBox(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.EditBox\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"registerScriptEditBoxHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_EditBox_registerScriptEditBoxHandler );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"unregisterScriptEditBoxHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_EditBox_unregisterScriptEditBoxHandler );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2d_CCBProxy_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.CCBProxy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        CCBProxy* tolua_ret = (CCBProxy*)CCBProxy::create();        \n        int  nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int *pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.CCBProxy\");\n        return 1;\n    }\n    \n    CCLOG(\"'create' function of CCBProxy has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_cocos2d_CCBProxy_createCCBReader(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    CCBProxy* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.CCBProxy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<CCBProxy*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_CCBProxy_createCCBReader'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        CCBReader* tolua_ret = (CCBReader*) self->createCCBReader();\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.CCBReader\");\n        return 1;\n    }\n    \n    CCLOG(\"'createCCBReader' function of CCBProxy  has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'createCCBReader'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_CCBProxy_readCCBFromFile(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    CCBProxy* self = nullptr;\n    const char* ccbFilePath = nullptr;\n    CCBReader*  ccbReader   = nullptr;\n    bool        setOwner    = false;\n    Node*       tolua_ret    = nullptr;\n    int         ID          = 0;\n    int*        luaID       = nullptr;\n    \n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.CCBProxy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<CCBProxy*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_CCBProxy_readCCBFromFile'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (2 == argc || 3 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(tolua_S, 2, 0, &tolua_err)||\n            !tolua_isusertype(tolua_S,3,\"cc.CCBReader\",0,&tolua_err)||\n            !tolua_isboolean(tolua_S,4,1,&tolua_err )\n            )\n            goto tolua_lerror;\n#endif\n        ccbFilePath = ((const char*)  tolua_tostring(tolua_S,2,0));\n        ccbReader   = ((CCBReader*)  tolua_tousertype(tolua_S,3,0));\n        setOwner = (bool)  tolua_toboolean(tolua_S,4,-1);\n        tolua_ret = (Node*) self->readCCBFromFile(ccbFilePath, ccbReader, setOwner);\n        ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.Node\");\n        return 1;\n    }\n    \n    CCLOG(\"'readCCBFromFile' function of CCBProxy  has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'readCCBFromFile'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_cocos2d_CCBProxy_getNodeTypeName(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    CCBProxy* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.CCBProxy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<CCBProxy*>(tolua_tousertype(tolua_S,1,0));\n  \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_CCBProxy_getNodeTypeName'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n        \n        Node* node = static_cast<Node*>(tolua_tousertype(tolua_S,2,0));\n        const char* tolua_ret = (const char*)self->getNodeTypeName(node);\n        tolua_pushstring(tolua_S,(const char*)tolua_ret);\n        return 1;\n    }\n    \n    CCLOG(\"'getNodeTypeName' function of CCBProxy  has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getNodeTypeName'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_CCBProxy_setCallback(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    CCBProxy* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.CCBProxy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<CCBProxy*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_CCBProxy_setCallback'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if ( argc >= 2 && argc <= 3 )\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isusertype(tolua_S,2,\"cc.Node\",0,&tolua_err) ||\n            !toluafix_isfunction(tolua_S, 3, \"LUA_FUNCTION\", 0, &tolua_err) ||\n            !tolua_isnumber(tolua_S, 4, 1, &tolua_err)\n            )\n            goto tolua_lerror;\n#endif\n        \n        Node* node = ((Node*)tolua_tousertype(tolua_S,2,0));\n        LUA_FUNCTION funID = (  toluafix_ref_function(tolua_S,3,0));\n        int   controlEvents = (int)tolua_tonumber(tolua_S, 4, 1);\n        self->setCallback(node, funID, controlEvents);\n        return 0;\n    }\n    \n    CCLOG(\"'setCallback' function of CCBProxy  has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setCallback'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint register_cocos2dx_extension_CCBProxy(lua_State* tolua_S)\n{\n    tolua_module(tolua_S,\"cc\",0);\n\ttolua_beginmodule(tolua_S,\"cc\");\n    tolua_usertype(tolua_S,\"cc.CCBProxy\");\n    tolua_cclass(tolua_S,\"CCBProxy\",\"cc.CCBProxy\",\"cc.Layer\",NULL);\n    tolua_beginmodule(tolua_S,\"CCBProxy\");\n    tolua_function(tolua_S, \"create\", tolua_cocos2d_CCBProxy_create);\n    tolua_function(tolua_S, \"createCCBReader\", tolua_cocos2d_CCBProxy_createCCBReader);\n    tolua_function(tolua_S, \"readCCBFromFile\", tolua_cocos2d_CCBProxy_readCCBFromFile);\n    tolua_function(tolua_S, \"getNodeTypeName\", tolua_cocos2d_CCBProxy_getNodeTypeName);\n    tolua_function(tolua_S, \"setCallback\", tolua_cocos2d_CCBProxy_setCallback);\n    tolua_endmodule(tolua_S);\n    tolua_endmodule(tolua_S);\n    \n    std::string typeName = typeid(CCBProxy).name();\n    g_luaType[typeName] = \"cc.CCBProxy\";\n    return 1;\n}\n\nstatic int tolua_cocos2d_CCBReader_load(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    CCBReader* self = nullptr;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.CCBReader\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<CCBReader*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_CCBReader_load'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc >= 1 && argc <= 3)\n    {\n        const char* fileName = nullptr;\n        std::string fileName_tmp = \"\";\n        ok &= luaval_to_std_string(tolua_S, 2, &fileName_tmp);\n        fileName = fileName_tmp.c_str();\n        if (!ok)\n            return 0;\n        \n        if (1 == argc)\n        {\n            Node* tolua_ret = (Node*) self->readNodeGraphFromFile(fileName);\n            int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.Node\");\n            return 1;\n        }\n        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isusertype(tolua_S, 3, \"cc.Object\", 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        Object* owner = static_cast<Object*>(tolua_tousertype(tolua_S, 3, 0));\n        //In lua owner always define in lua script by table, so owner is always nullptr\n        if (2 == argc)\n        {\n            Node* tolua_ret = (Node*) self->readNodeGraphFromFile(fileName,owner);\n            int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.Node\");\n            return 1;\n        }\n        \n        Size size;\n        ok &= luaval_to_size(tolua_S, 4, &size);\n        if (!ok)\n            return 0;\n        \n        Node* tolua_ret = (Node*) self->readNodeGraphFromFile(fileName,owner,size);\n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.Node\");\n        return 1;\n        \n    }\n    \n    CCLOG(\"'load' function of CCBReader  has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'load'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendCCBReader(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.CCBReader\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"load\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_CCBReader_load );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\n\nstatic int tolua_cocos2d_CCBAnimationManager_setCallFuncForLuaCallbackNamed(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    CCBAnimationManager* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.CCBAnimationManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<CCBAnimationManager*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_CCBAnimationManager_setCallFuncForLuaCallbackNamed'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (2 == argc)\n    {\n        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isusertype(tolua_S,2, \"cc.CallFunc\", 0, &tolua_err) ||\n            !tolua_isstring(tolua_S, 3, 0, &tolua_err) )\n            goto tolua_lerror;\n#endif\n        \n        CallFunc* pCallFunc = static_cast<CallFunc*>(tolua_tousertype(tolua_S,2,0));\n        const char* keyframeCallback = ((const char*)  tolua_tostring(tolua_S,3,0));\n        std::string strKey = \"\";\n        if (NULL != keyframeCallback) {\n            strKey = keyframeCallback;\n        }\n        self->setCallFunc(pCallFunc, strKey);\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setCallFuncForLuaCallbackNamed' function of CCBAnimationManager  has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setCallFuncForLuaCallbackNamed'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendCCBAnimationManager(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.CCBAnimationManager\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setCallFuncForLuaCallbackNamed\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_CCBAnimationManager_setCallFuncForLuaCallbackNamed );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nclass LuaAssetsManagerDelegateProtocol:public Object, public AssetsManagerDelegateProtocol\n{\npublic:\n    virtual ~LuaAssetsManagerDelegateProtocol()\n    {}\n    \n    virtual void onProgress(int percent) override\n    {\n        int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::ASSETSMANAGER_PROGRESS);\n        if (0 != handler)\n        {\n            LuaAssetsManagerEventData eventData(percent);\n            BasicScriptData data((void*)this,&eventData);\n            LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ASSETSMANAGER_PROGRESS, (void*)&data);\n        }\n    }\n    \n    virtual void onSuccess() override\n    {\n        int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::ASSETSMANAGER_SUCCESS);\n        if (0 != handler)\n        {\n            LuaAssetsManagerEventData eventData;\n            BasicScriptData data((void*)this,&eventData);\n            LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ASSETSMANAGER_SUCCESS, (void*)&data);\n        }\n    }\n    \n    virtual void onError(AssetsManager::ErrorCode errorCode) override\n    {\n        int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::ASSETSMANAGER_ERROR);\n        if (0 != handler)\n        {\n            LuaAssetsManagerEventData eventData((int)errorCode);\n            BasicScriptData data((void*)this,&eventData);\n            LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ASSETSMANAGER_ERROR, (void*)&data);\n        }\n    }\n};\n\nstatic int lua_cocos2dx_AssetsManager_setDelegate(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    AssetsManager* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.AssetsManager\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (AssetsManager*)  tolua_tousertype(L,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_AssetsManager_setDelegate'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (2 == argc)\n    {        \n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L, 2, \"LUA_FUNCTION\", 0, &tolua_err) ||\n                !tolua_isnumber(L, 3, 0, &tolua_err) )\n        {\n                goto tolua_lerror;\n        }\n#endif\n        LuaAssetsManagerDelegateProtocol* delegate = dynamic_cast<LuaAssetsManagerDelegateProtocol*>( self->getDelegate());\n        if (nullptr == delegate)\n        {\n            delegate = new LuaAssetsManagerDelegateProtocol();\n            if (nullptr == delegate)\n                return 0;\n            \n            self->setUserObject(delegate);\n            self->setDelegate(delegate);\n            delegate->release();\n        }\n        \n        LUA_FUNCTION handler = toluafix_ref_function(L, 2, 0);\n        ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(L,3,0) + (int)ScriptHandlerMgr::HandlerType::ASSETSMANAGER_PROGRESS);\n            \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)delegate, handler, handlerType);\n        return 0;\n    }\n    \n    CCLOG(\"'setDelegate' function of AssetsManager has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setDelegate'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendAssetsManager(lua_State* L)\n{\n    lua_pushstring(L, \"cc.AssetsManager\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"setDelegate\", lua_cocos2dx_AssetsManager_setDelegate);\n    }\n    lua_pop(L, 1);\n}\n\n#define KEY_TABLEVIEW_DATA_SOURCE  \"TableViewDataSource\"\n#define KEY_TABLEVIEW_DELEGATE     \"TableViewDelegate\"\n\nclass LUA_TableViewDelegate:public Object, public TableViewDelegate\n{\npublic:\n    LUA_TableViewDelegate(){}\n    \n    virtual ~LUA_TableViewDelegate(){}\n    \n    \n    virtual void scrollViewDidScroll(ScrollView* view) override\n    {\n        if (nullptr != view)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData;\n                BasicScriptData data(view,&eventData);\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL, (void*)&data);\n            }\n        }\n    }\n    \n    virtual void scrollViewDidZoom(ScrollView* view) override\n    {\n        if (nullptr != view)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)view, ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData;\n                BasicScriptData data(view,&eventData);\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::SCROLLVIEW_ZOOM, (void*)&data);\n            }\n        }\n    }\n    \n    virtual void tableCellTouched(TableView* table, TableViewCell* cell) override\n    {\n        if (nullptr != table && nullptr != cell)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_TOUCHED);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData(cell);\n                BasicScriptData data(table,&eventData);\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_TOUCHED,(void*)&data);\n            }\n        }\n    }\n    \n    virtual void tableCellHighlight(TableView* table, TableViewCell* cell) override\n    {\n        if (nullptr != table && nullptr != cell)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_HIGHLIGHT);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData(cell);\n                BasicScriptData data(table,&eventData);\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_HIGHLIGHT,(void*)&data);\n            }\n        }\n    }\n    \n    virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell) override\n    {\n        if (nullptr != table && nullptr != cell)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData(cell);\n                BasicScriptData data(table,&eventData);\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_UNHIGHLIGHT,(void*)&data);\n            }\n        }\n    }\n    \n    virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell) override\n    {\n        if (nullptr != table && nullptr != cell)\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData(cell);\n                BasicScriptData data(table,&eventData);\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_WILL_RECYCLE,(void*)&data);\n            }\n        }\n    }\n};\n\nstatic int lua_cocos2dx_TableView_setDelegate(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    TableView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (TableView*)  tolua_tousertype(L,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_TableView_setDelegate'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (0 == argc)\n    {\n        LUA_TableViewDelegate* delegate = new LUA_TableViewDelegate();\n        if (nullptr == delegate)\n            return 0;\n        \n        Dictionary* userDict = static_cast<Dictionary*>(self->getUserObject());\n        if (nullptr == userDict)\n        {\n            userDict = new Dictionary();\n            if (NULL == userDict)\n                return 0;\n            \n            self->setUserObject(userDict);\n            userDict->release();\n        }\n        \n        userDict->setObject(delegate, KEY_TABLEVIEW_DELEGATE);\n        self->setDelegate(delegate);\n        delegate->release();\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setDelegate' function of TableView wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setDelegate'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nclass LUA_TableViewDataSource:public Object,public TableViewDataSource\n{\npublic:\n    LUA_TableViewDataSource(){}\n    virtual ~LUA_TableViewDataSource(){}\n    \n    virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) override\n    {\n        if (nullptr != table )\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData(&idx);\n                BasicScriptData data(table,&eventData);\n                float width = 0.0;\n                float height = 0.0;\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_SIZE_FOR_INDEX, (void*)&data,2,[&](lua_State* L,int numReturn){\n                    CCASSERT(numReturn == 2, \"tableCellSizeForIndex return count error\");\n                    ValueVector vec;\n                    width  = (float)tolua_tonumber(L, -1, 0);\n                    lua_pop(L, 1);\n                    height = (float)tolua_tonumber(L, -1, 0);\n                    lua_pop(L, 1);\n                });\n                \n                return Size(width, height);\n            }\n        }\n        \n        return Size::ZERO;\n    }\n    \n    virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) override\n    {\n        if (nullptr != table )\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLECELL_AT_INDEX);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData(&idx);\n                BasicScriptData data(table,&eventData);\n                TableViewCell* viewCell = nullptr;\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLECELL_AT_INDEX, (void*)&data, 1, [&](lua_State* L, int numReturn){\n                    CCASSERT(numReturn == 1, \"tableCellAtIndex return count error\");\n                    viewCell = static_cast<TableViewCell*>(tolua_tousertype(L, -1, nullptr));\n                    lua_pop(L, 1);\n                });\n                \n                return viewCell;\n            }\n        }\n        \n        return NULL;\n    }\n    \n    virtual ssize_t numberOfCellsInTableView(TableView *table) override\n    {\n        if (nullptr != table )\n        {\n            int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)table, ScriptHandlerMgr::HandlerType::TABLEVIEW_NUMS_OF_CELLS);\n            if (0 != handler)\n            {\n                LuaTableViewEventData eventData;\n                BasicScriptData data(table,&eventData);\n                ssize_t counts = 0;\n                LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::TABLEVIEW_NUMS_OF_CELLS, (void*)&data,1, [&](lua_State* L, int numReturn){\n                    CCASSERT(numReturn == 1, \"numberOfCellsInTableView return count error\");\n                    counts = (ssize_t)tolua_tonumber(L, -1, 0);\n                    lua_pop(L, 1);\n                });\n                return counts;\n            }\n        }\n        return 0;\n    }\n};\n\nstatic int lua_cocos2dx_TableView_setDataSource(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    TableView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (TableView*)  tolua_tousertype(L,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_TableView_setDataSource'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (0 == argc)\n    {\n        LUA_TableViewDataSource* dataSource = new LUA_TableViewDataSource();\n        if (nullptr == dataSource)\n            return 0;\n        \n        Dictionary* userDict = static_cast<Dictionary*>(self->getUserObject());\n        if (nullptr == userDict)\n        {\n            userDict = new Dictionary();\n            if (NULL == userDict)\n                return 0;\n            \n            self->setUserObject(userDict);\n            userDict->release();\n        }\n        \n        userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE);\n        \n        self->setDataSource(dataSource);\n        \n        dataSource->release();\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setDataSource' function of TableView wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setDataSource'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_TableView_create(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(L,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (2 == argc || 1 == argc)\n    {\n        LUA_TableViewDataSource* dataSource = new LUA_TableViewDataSource();\n        Size size;\n        ok &= luaval_to_size(L, 2, &size);\n        \n        TableView* ret = nullptr;\n        \n        if (1 == argc)\n        {\n            ret = TableView::create(dataSource, size);\n        }\n        else\n        {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isusertype(L,3,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n            Node* node = static_cast<Node*>(tolua_tousertype(L, 3, nullptr));\n            ret = TableView::create(dataSource, size, node);\n        }\n        \n        if (nullptr ==  ret)\n            return 0;\n        \n        ret->reloadData();\n        \n        Dictionary* userDict = new Dictionary();\n        userDict->setObject(dataSource, KEY_TABLEVIEW_DATA_SOURCE);\n        ret->setUserObject(userDict);\n        userDict->release();\n        \n        dataSource->release();\n        \n        \n        int  nID = (int)ret->_ID;\n        int* pLuaID =  &ret->_luaID;\n        toluafix_pushusertype_ccobject(L, nID, pLuaID, (void*)ret,\"cc.TableView\");\n        \n        return 1;\n    }\n    CCLOG(\"'create' function of TableView wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2d_TableView_registerScriptHandler(lua_State* L)\n{\n    if (NULL == L)\n        return 0;\n    \n    int argc = 0;\n    TableView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<TableView*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'tolua_cocos2d_TableView_registerScriptHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    if (2 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(L, 3, 0, &tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n        ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(L,3,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL);\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, handlerType);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' function of TableView has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2d_TableView_unregisterScriptHandler(lua_State* L)\n{\n    if (NULL == L)\n        return 0;\n    \n    int argc = 0;\n    TableView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.TableView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<TableView*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2d_TableView_unregisterScriptHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        ScriptHandlerMgr::HandlerType handlerType = (ScriptHandlerMgr::HandlerType) ((int)tolua_tonumber(L,2,0) + (int)ScriptHandlerMgr::HandlerType::SCROLLVIEW_SCROLL);\n        ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, handlerType);\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptHandler' function of TableView  has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'unregisterScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendTableView(lua_State* L)\n{\n    lua_pushstring(L, \"cc.TableView\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"setDelegate\", lua_cocos2dx_TableView_setDelegate);\n        tolua_function(L, \"setDataSource\", lua_cocos2dx_TableView_setDataSource);\n        tolua_function(L, \"create\", lua_cocos2dx_TableView_create);\n        tolua_function(L, \"registerScriptHandler\", lua_cocos2d_TableView_registerScriptHandler);\n        tolua_function(L, \"unregisterScriptHandler\", lua_cocos2d_TableView_unregisterScriptHandler);\n    }\n    lua_pop(L, 1);\n}\n\nint register_all_cocos2dx_extension_manual(lua_State* tolua_S)\n{\n    extendControl(tolua_S);\n    extendEditBox(tolua_S);\n    extendCCBReader(tolua_S);\n    extendCCBAnimationManager(tolua_S);\n    extendAssetsManager(tolua_S);\n    extendScrollView(tolua_S);\n    extendTableView(tolua_S);\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_EXTENSION_MANUAL_H\n#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_EXTENSION_MANUAL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"LuaScriptHandlerMgr.h\"\n\nTOLUA_API int register_all_cocos2dx_extension_manual(lua_State* tolua_S);\nTOLUA_API int register_cocos2dx_extension_CCBProxy(lua_State* tolua_S);\n\nstruct LuaAssetsManagerEventData\n{\n    int value;\n\n    LuaAssetsManagerEventData(int _value = 0):value(_value)\n    {\n    }\n};\n\nstruct LuaTableViewEventData\n{\n    void* value;\n    \n    // Constructor\n    LuaTableViewEventData(void* _value = nullptr)\n    :value(_value)\n    {\n    }\n};\n\n\n#endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_LUA_COCOS2DX_EXTENSION_MANUAL_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"lua_cocos2dx_gui_manual.hpp\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"cocos2d.h\"\n#include \"LuaBasicConversions.h\"\n#include \"LuaScriptHandlerMgr.h\"\n#include \"CCLuaValue.h\"\n#include \"CocosGUI.h\"\n#include \"CCLuaEngine.h\"\n\nusing namespace gui;\n\nclass LuaCocoStudioEventListener:public Object\n{\npublic:\n    LuaCocoStudioEventListener();\n    virtual ~LuaCocoStudioEventListener();\n    \n    static LuaCocoStudioEventListener* create();\n    \n    virtual void eventCallbackFunc(Object* sender,int eventType);\n};\n\nLuaCocoStudioEventListener::LuaCocoStudioEventListener()\n{\n    \n}\n\nLuaCocoStudioEventListener::~LuaCocoStudioEventListener()\n{\n\n}\n\nLuaCocoStudioEventListener* LuaCocoStudioEventListener::create()\n{\n    LuaCocoStudioEventListener* listener = new LuaCocoStudioEventListener();\n    if (nullptr == listener)\n        return nullptr;\n    \n    listener->autorelease();\n    \n    return listener;\n}\n\nvoid LuaCocoStudioEventListener::eventCallbackFunc(Object* sender,int eventType)\n{\n    int handler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n    \n    if (0 != handler)\n    {\n        LuaStudioEventListenerData eventData(sender,eventType);\n        BasicScriptData data(this,(void*)&eventData);\n        LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER, (void*)&data);\n    }\n}\n\nstatic int lua_cocos2dx_Widget_addTouchEventListener(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Widget* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.Widget\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<Widget*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Widget_addTouchEventListener'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();\n        if (nullptr == listener)\n        {\n            tolua_error(L,\"LuaCocoStudioEventListener create fail\\n\", NULL);\n            return 0;\n        }\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n        \n        self->setUserObject(listener);\n        self->addTouchEventListener(listener, toucheventselector(LuaCocoStudioEventListener::eventCallbackFunc));\n                \n        return 0;\n    }\n    \n    CCLOG(\"'addTouchEventListener' function of Widget has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'addTouchEventListener'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendWidget(lua_State* L)\n{\n    lua_pushstring(L, \"ccui.Widget\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"addTouchEventListener\", lua_cocos2dx_Widget_addTouchEventListener);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_CheckBox_addEventListenerCheckBox(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    CheckBox* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.CheckBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<CheckBox*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_CheckBox_addEventListenerCheckBox'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();\n        if (nullptr == listener)\n        {\n            tolua_error(L,\"LuaCocoStudioEventListener create fail\\n\", NULL);\n            return 0;\n        }\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n        \n        self->setUserObject(listener);        \n        self->addEventListenerCheckBox(listener, checkboxselectedeventselector(LuaCocoStudioEventListener::eventCallbackFunc));\n        \n        return 0;\n    }\n    \n    CCLOG(\"'addEventListenerCheckBox' function of CheckBox has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'addEventListenerCheckBox'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic void extendCheckBox(lua_State* L)\n{\n    lua_pushstring(L, \"ccui.CheckBox\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"addEventListenerCheckBox\", lua_cocos2dx_CheckBox_addEventListenerCheckBox);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_Slider_addEventListenerSlider(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Slider* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.Slider\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<Slider*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Slider_addEventListenerSlider'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();\n        if (nullptr == listener)\n        {\n            tolua_error(L,\"LuaCocoStudioEventListener create fail\\n\", NULL);\n            return 0;\n        }\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n        \n        self->setUserObject(listener);        \n        self->addEventListenerSlider(listener, sliderpercentchangedselector(LuaCocoStudioEventListener::eventCallbackFunc));\n        \n        return 0;\n    }\n    \n    CCLOG(\"'addEventListenerSlider' function of Slider has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'addEventListenerSlider'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendSlider(lua_State* L)\n{\n    lua_pushstring(L, \"ccui.Slider\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"addEventListenerSlider\", lua_cocos2dx_Slider_addEventListenerSlider);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_TextField_addEventListenerTextField(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    TextField* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.TextField\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<TextField*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_TextField_addEventListenerTextField'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();\n        if (nullptr == listener)\n        {\n            tolua_error(L,\"LuaCocoStudioEventListener create fail\\n\", NULL);\n            return 0;\n        }\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n        \n        self->setUserObject(listener);        \n        self->addEventListenerTextField(listener, textfieldeventselector(LuaCocoStudioEventListener::eventCallbackFunc));\n        \n        return 0;\n    }\n    \n    CCLOG(\"'addEventListenerTextField' function of TextField has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'addEventListenerTextField'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendTextField(lua_State* L)\n{\n    lua_pushstring(L, \"ccui.TextField\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"addEventListenerTextField\", lua_cocos2dx_TextField_addEventListenerTextField);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_PageView_addEventListenerPageView(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    PageView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.PageView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<PageView*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_PageView_addEventListenerPageView'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();\n        if (nullptr == listener)\n        {\n            tolua_error(L,\"LuaCocoStudioEventListener create fail\\n\", NULL);\n            return 0;\n        }\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n        \n        self->setUserObject(listener);        \n        self->addEventListenerPageView(listener, pagevieweventselector(LuaCocoStudioEventListener::eventCallbackFunc));\n        \n        return 0;\n    }\n    \n    CCLOG(\"'addEventListenerPageView' function of PageView has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'addEventListenerPageView'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendPageView(lua_State* L)\n{\n    lua_pushstring(L, \"ccui.PageView\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"addEventListenerPageView\", lua_cocos2dx_PageView_addEventListenerPageView);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_ListView_addEventListenerListView(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    ListView* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.ListView\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<ListView*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_ListView_addEventListenerListView'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LuaCocoStudioEventListener* listern = LuaCocoStudioEventListener::create();\n        if (nullptr == listern)\n        {\n            tolua_error(L,\"LuaCocoStudioEventListener create fail\\n\", NULL);\n            return 0;\n        }\n        \n        LUA_FUNCTION handler = (  toluafix_ref_function(L,2,0));\n        \n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listern, handler, ScriptHandlerMgr::HandlerType::STUDIO_EVENT_LISTENER);\n        \n        self->setUserObject(listern);\n        self->addEventListenerListView(listern, listvieweventselector(LuaCocoStudioEventListener::eventCallbackFunc));\n        \n        return 0;\n    }\n    \n    CCLOG(\"'addEventListenerListView' function of ListView has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'addEventListenerListView'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendListView(lua_State* L)\n{\n    lua_pushstring(L, \"ccui.ListView\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"addEventListenerListView\", lua_cocos2dx_ListView_addEventListenerListView);\n    }\n    lua_pop(L, 1);\n}\n\nstatic int lua_cocos2dx_LayoutParameter_setMargin(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    LayoutParameter* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.LayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<LayoutParameter*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_LayoutParameter_setMargin'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_istable(L, 2, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        Margin margin;\n        lua_pushstring(L, \"left\");\n        lua_gettable(L,2);\n        margin.left = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n            \n        lua_pushstring(L, \"top\");\n        lua_gettable(L,2);\n        margin.top = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n            \n        lua_pushstring(L, \"right\");\n        lua_gettable(L,2);\n        margin.right = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n            \n        lua_pushstring(L, \"bottom\");\n        lua_gettable(L,2);\n        margin.bottom = lua_isnil(L,-1) ? 0 : lua_tonumber(L,-1);\n        lua_pop(L,1);\n        \n        self->setMargin(margin);\n        return 0;\n    }\n    \n    CCLOG(\"'setMargin' function of LayoutParameter has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    \n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setMargin'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_LayoutParameter_getMargin(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    LayoutParameter* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"ccui.LayoutParameter\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<LayoutParameter*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_LayoutParameter_getMargin'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(L) - 1;\n    \n    if (0 == argc)\n    {\n        Margin margin = self->getMargin();\n        \n        lua_newtable(L);\n        \n        lua_pushstring(L, \"left\");                             \n        lua_pushnumber(L, (lua_Number) margin.left);\n        lua_rawset(L, -3);\n        \n        lua_pushstring(L, \"top\");                             \n        lua_pushnumber(L, (lua_Number) margin.top);\n        lua_rawset(L, -3);\n        \n        lua_pushstring(L, \"right\");\n        lua_pushnumber(L, (lua_Number) margin.right);\n        lua_rawset(L, -3);\n        \n        lua_pushstring(L, \"bottom\");\n        lua_pushnumber(L, (lua_Number) margin.bottom);\n        lua_rawset(L, -3);\n        \n        return 1;\n    }\n    \n    CCLOG(\"'getMargin' function of LayoutParameter has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    \n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'getMargin'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendLayoutParameter(lua_State* L)\n{\n    lua_pushstring(L, \"ccui.LayoutParameter\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"setMargin\", lua_cocos2dx_LayoutParameter_setMargin);\n        tolua_function(L, \"getMargin\", lua_cocos2dx_LayoutParameter_getMargin);\n    }\n    lua_pop(L, 1);\n}\n\nint register_all_cocos2dx_gui_manual(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    extendWidget(L);\n    extendCheckBox(L);\n    extendSlider(L);\n    extendTextField(L);\n    extendPageView(L);\n    extendListView(L);\n    extendLayoutParameter(L);\n    \n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H\n#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"CCObject.h\"\n\nTOLUA_API int register_all_cocos2dx_gui_manual(lua_State* L);\n\nstruct LuaStudioEventListenerData\n{\n    cocos2d::Object* objTarget;\n    int eventType;\n    \n    LuaStudioEventListenerData(cocos2d::Object* _objTarget, int _eventType):objTarget(_objTarget),eventType(_eventType)\n    {\n    }\n};\n#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_GUI_MANUAL_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"lua_cocos2dx_manual.hpp\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"LuaBasicConversions.h\"\n#include \"CCLuaValue.h\"\n#include \"CCLuaEngine.h\"\n\nstatic int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S) \n        return 0;\n\n    int argc = 0;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.MenuItemImage\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    do {\n        if (argc == 0)\n        {\n            MenuItemImage* tolua_ret = (MenuItemImage*)MenuItemImage::create();\n            //Uncheck\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.MenuItemImage\");\n            return 1;\n        }\n    } while (0);\n    do {\n#if COCOS2D_DEBUG >= 1\n\t\tif (!tolua_isstring(tolua_S,2,0,&tolua_err) ||\n            !tolua_isstring(tolua_S,3,0,&tolua_err))\n        {\n            ok = false;\n\t\t}\n#endif        \n        if (!ok)\n        {\n            ok = true;\n            break;\n        }\n        const std::string normalImage = ((const std::string)  tolua_tocppstring(tolua_S,2,0));\n        const std::string selectedImage = ((const std::string)  tolua_tocppstring(tolua_S,3,0));\n        MenuItemImage* tolua_ret = (MenuItemImage*)  MenuItemImage::create(normalImage,selectedImage);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.MenuItemImage\");\n        return 1;\n        \n    } while (0);\n    do {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||\n            !tolua_isstring(tolua_S,3,0,&tolua_err) ||\n            !tolua_isstring(tolua_S,4,0,&tolua_err) )\n        {\n            goto tolua_lerror;\n            break;\n        }\n#endif\n        const std::string normalImage = ((const std::string)  tolua_tocppstring(tolua_S,2,0));\n        const std::string selectedImage = ((const std::string)  tolua_tocppstring(tolua_S,3,0));\n        const std::string disabledImage = ((const std::string)  tolua_tocppstring(tolua_S,4,0));\n        \n        MenuItemImage* tolua_ret = (MenuItemImage*)  MenuItemImage::create(normalImage,selectedImage,disabledImage);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.MenuItemImage\");\n        return 1;\n        \n    } while (0);\n\n\tCCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n\ttolua_error(tolua_S,\"#ferror in function 'tolua_cocos2d_MenuItemImage_create'.\\n\",&tolua_err);\n#endif\n\treturn 0;\n    \n}\n\nstatic int tolua_cocos2d_MenuItemLabel_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.MenuItemLabel\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if(1 == argc)\n    {\n        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isusertype(tolua_S,2,\"cc.Node\",0,&tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        Node* label = ((Node*)  tolua_tousertype(tolua_S,2,0));\n        MenuItemLabel* tolua_ret = (MenuItemLabel*)  MenuItemLabel::create(label);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.MenuItemLabel\");\n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_MenuItemFont_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.MenuItemFont\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if(1 == argc)\n    {\n        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(tolua_S, 2, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        const std::string value = ((const std::string)  tolua_tocppstring(tolua_S,2,0));\n        MenuItemFont* tolua_ret = (MenuItemFont*)  MenuItemFont::create(value);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.MenuItemFont\");\n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_MenuItemSprite_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.MenuItemSprite\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if(argc >= 2 && argc <= 3)\n    {\n        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isusertype(tolua_S,2,\"cc.Node\",0,&tolua_err) ||\n            !tolua_isusertype(tolua_S,3,\"cc.Node\",0,&tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n        \n        if (3 == argc && !tolua_isusertype(tolua_S,4,\"cc.Node\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        Node* normalSprite = ((Node*)  tolua_tousertype(tolua_S,2,0));\n        Node* selectedSprite = ((Node*)  tolua_tousertype(tolua_S,3,0));\n        Node* disabledSprite = NULL;\n        if (3 == argc)\n        {\n            disabledSprite = (Node*)  tolua_tousertype(tolua_S,4,0);\n        }\n        MenuItemSprite* tolua_ret = (MenuItemSprite*)  MenuItemSprite::create(normalSprite,selectedSprite,disabledSprite);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.MenuItemSprite\");\n        return 1;\n    }\n    \n    CCLOG(\"create has wrong number of arguments: %d, was expecting %d\\n\", argc, 3);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Menu_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (argc > 0 )\n    {\n        Vector<MenuItem*> items;\n        uint32_t i = 1;\n        while (i <= argc)\n        {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isusertype(tolua_S, 1 + i, \"cc.MenuItem\", 0, &tolua_err))\n                goto tolua_lerror;\n#endif\n            \n            cocos2d::MenuItem* item = static_cast<cocos2d::MenuItem*>(tolua_tousertype(tolua_S, 1 + i, NULL));\n            if (NULL != item)\n            {\n                items.pushBack(item);\n                ++i;\n            }\n            \n        }\n        cocos2d::Menu* tolua_ret = cocos2d::Menu::createWithArray(items);\n        //UnCheck\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.Menu\");\n        return 1;\n    }\n    else if(argc == 0)\n    {\n        cocos2d::Menu* tolua_ret = cocos2d::Menu::create();\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.Menu\");\n        return 1;\n    }\n    \n    CCLOG(\"create wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n\ttolua_error(tolua_S,\"#ferror in function 'tolua_cocos2d_Menu_create'.\\n\",&tolua_err);\n#endif\n\treturn 0;\n}\n\n\n\nstatic int tolua_cocos2dx_Menu_alignItemsInRows(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Menu* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<Menu*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'lua_cocos2dx_Menu_alignItemsInRows'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (argc > 0)\n    {\n        ValueVector items;\n        if (luavals_variadic_to_ccvaluevector(tolua_S, argc, &items))\n        {\n            self->alignItemsInRowsWithArray(items);\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'alignItemsInRows' has wrong number of arguments in tolua_cocos2dx_Menu_alignItemsInRows: %d, was expecting %d\\n\", argc, 1);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n\ttolua_error(tolua_S,\"#ferror in function 'alignItemsInRows'.\\n\",&tolua_err);\n#endif\n\treturn 0;\n}\n\nstatic int tolua_cocos2dx_Menu_alignItemsInColumns(lua_State* tolua_S)\n{\n    \n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Menu* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Menu\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<Menu*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_Menu_alignItemsInColumns'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (argc > 0)\n    {\n        ValueVector items;\n        if (luavals_variadic_to_ccvaluevector(tolua_S, argc, &items))\n        {\n            self->alignItemsInColumnsWithArray(items);\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'alignItemsInColumns' has wrong number of arguments in tolua_cocos2dx_Menu_alignItemsInColumns: %d, was expecting %d\\n\", argc, 1);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n\ttolua_error(tolua_S,\"#ferror in function 'alignItemsInColumns'.\\n\",&tolua_err);\n#endif\n\treturn 0;\n}\n\nstatic int tolua_cocos2d_MenuItemToggle_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.MenuItemToggle\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if(argc >= 1)\n    {\n        MenuItemToggle* tolua_ret = MenuItemToggle::create();\n        if (NULL == tolua_ret)\n        {\n            return 0;\n        }\n        \n        for (uint32_t i = 0; i < argc; ++i)\n        {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isusertype(tolua_S, i + 2,\"cc.MenuItem\",0,&tolua_err) )\n            {\n                goto tolua_lerror;\n            }\n#endif\n            MenuItem* item = static_cast<MenuItem*>(tolua_tousertype(tolua_S, i + 2,0));\n            tolua_ret->addSubItem(item);\n        }\n        tolua_ret->setSelectedIndex(0);\n        \n        int  nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.MenuItemToggle\");\n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_MenuItem_registerScriptTapHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    MenuItem* cobj = nullptr;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = static_cast<cocos2d::MenuItemImage*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == cobj) {\n\t\ttolua_error(tolua_S,\"invalid 'cobj' in function 'tolua_cocos2d_MenuItem_registerScriptTapHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(tolua_S) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err)) {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, ScriptHandlerMgr::HandlerType::MENU_CLICKED);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptTapHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptTapHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_MenuItem_unregisterScriptTapHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    MenuItem* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.MenuItem\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = static_cast<cocos2d::MenuItemImage*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == cobj) {\n\t\ttolua_error(tolua_S,\"invalid 'cobj' in function 'tolua_cocos2d_MenuItem_unregisterScriptTapHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, ScriptHandlerMgr::HandlerType::MENU_CLICKED);\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptTapHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptTapHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int executeScriptTouchHandler(Layer* layer, EventTouch::EventCode eventType, Touch* touch)\n{\n    TouchScriptData data(eventType, layer, touch);\n    ScriptEvent event(kTouchEvent, &data);\n    return ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n}\n\nstatic int executeScriptTouchesHandler(Layer* layer, EventTouch::EventCode eventType, const std::vector<Touch*>& touches)\n{\n    TouchesScriptData data(eventType, layer, touches);\n    ScriptEvent event(kTouchesEvent, &data);\n    return ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n}\n\nstatic void setTouchEnabledForLayer(Layer* layer, bool enabled)\n{\n    if (nullptr == layer)\n        return;\n    \n    auto dict = static_cast<Dictionary*>(layer->getUserObject());\n    if (dict == nullptr)\n    {\n        dict = Dictionary::create();\n        layer->setUserObject(dict);\n    }\n    \n    dict->setObject(Bool::create(enabled), \"touchEnabled\");\n    \n    auto touchListenerAllAtOnce = static_cast<EventListenerTouchAllAtOnce*>(dict->objectForKey(\"touchListenerAllAtOnce\"));\n    auto touchListenerOneByOne = static_cast<EventListenerTouchOneByOne*>(dict->objectForKey(\"touchListenerOneByOne\"));\n    auto touchMode = static_cast<Integer*>(dict->objectForKey(\"touchMode\"));\n    auto swallowTouches = static_cast<Bool*>(dict->objectForKey(\"swallowTouches\"));\n    auto priority  = static_cast<Integer*>(dict->objectForKey(\"priority\"));\n    \n    auto dispatcher = layer->getEventDispatcher();\n    if (nullptr != dispatcher && (touchListenerAllAtOnce != nullptr || touchListenerOneByOne != nullptr))\n    {\n        dispatcher->removeEventListener(touchListenerAllAtOnce);\n        dispatcher->removeEventListener(touchListenerOneByOne);\n        dict->removeObjectForKey(\"touchListenerAllAtOnce\");\n        dict->removeObjectForKey(\"touchListenerOneByOne\");\n        touchListenerAllAtOnce = nullptr;\n        touchListenerOneByOne = nullptr;\n    }\n\n    if (enabled)\n    {\n        if (touchMode == nullptr || touchMode->getValue() == (int)Touch::DispatchMode::ALL_AT_ONCE)\n        {\n            auto listener = EventListenerTouchAllAtOnce::create();\n            listener->onTouchesBegan = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::BEGAN, touches);\n            };\n            listener->onTouchesMoved = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::MOVED, touches);\n            };\n            listener->onTouchesEnded = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::ENDED, touches);\n            };\n            listener->onTouchesCancelled = [layer](const std::vector<Touch*>& touches, Event* event){\n                executeScriptTouchesHandler(layer, EventTouch::EventCode::CANCELLED, touches);\n            };\n            \n            if (nullptr != priority && 0 != priority->getValue())\n            {\n                dispatcher->addEventListenerWithFixedPriority(listener, priority->getValue());\n            }\n            else\n            {\n                dispatcher->addEventListenerWithSceneGraphPriority(listener, layer);\n            }\n            \n            dict->setObject(listener, \"touchListenerAllAtOnce\");\n        }\n        else\n        {\n            auto listener = EventListenerTouchOneByOne::create();\n            listener->setSwallowTouches(swallowTouches ? swallowTouches->getValue() : false);\n            listener->onTouchBegan = [layer](Touch* touch, Event* event) -> bool{\n                return executeScriptTouchHandler(layer, EventTouch::EventCode::BEGAN, touch) == 0 ? false : true;\n            };\n            listener->onTouchMoved = [layer](Touch* touch, Event* event){\n                executeScriptTouchHandler(layer, EventTouch::EventCode::MOVED, touch);\n            };\n            listener->onTouchEnded = [layer](Touch* touch, Event* event){\n                executeScriptTouchHandler(layer, EventTouch::EventCode::ENDED, touch);\n            };\n            listener->onTouchCancelled = [layer](Touch* touch, Event* event){\n                executeScriptTouchHandler(layer, EventTouch::EventCode::CANCELLED, touch);\n            };\n            \n            if (nullptr != priority && 0 != priority->getValue())\n            {\n                dispatcher->addEventListenerWithFixedPriority(listener, priority->getValue());\n            }\n            else\n            {\n                dispatcher->addEventListenerWithSceneGraphPriority(listener, layer);\n            }\n            \n            dict->setObject(listener, \"touchListenerOneByOne\");\n        }\n    }\n    \n}\n\n//Only for v2.x lua compatibility\nstatic int lua_cocos2dx_Layer_setTouchPriority(lua_State* L)\n{\n    return 0;\n}\n\nstatic int lua_cocos2dx_Layer_setTouchEnabled(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_setTouchEnabled'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isboolean(L, 2, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        bool enabled = tolua_toboolean(L, 2, 0);\n        setTouchEnabledForLayer(self, enabled);\n        return 0;\n    }\n    \n    CCLOG(\"'setTouchEnabled' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setTouchEnabled'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n\nstatic int lua_cocos2dx_Layer_isTouchEnabled(lua_State* L)\n{\n    if (nullptr == L)\n    return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_isTouchEnabled'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (0 == argc)\n    {\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            bool ret = enabled ? enabled->getValue() : false;\n            tolua_pushboolean(L, ret);\n            return 1;\n        }\n        \n        return 0;\n    }\n    \n    CCLOG(\"'isTouchEnabled' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'isTouchEnabled'.\",&tolua_err);\n    return 0;\n#endif\n    \n    \n}\n\nstatic int lua_cocos2dx_Layer_setTouchMode(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_setTouchMode'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(L, 2, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        int32_t mode = (int32_t)tolua_tonumber(L, 2, 0);\n        \n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if ( nullptr == dict)\n        {\n            dict = Dictionary::create();\n            self->setUserObject(dict);\n        }\n        \n        Integer* touchModeObj = static_cast<Integer*>(dict->objectForKey(\"touchMode\"));\n        int32_t touchMode = touchModeObj ? touchModeObj->getValue() : 0;\n        if (touchMode != mode)\n        {\n            dict->setObject(Integer::create(mode), \"touchMode\");\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            if (enabled && enabled->getValue())\n            {\n                setTouchEnabledForLayer(self, false);\n                setTouchEnabledForLayer(self, true);\n            }\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'setTouchMode' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setTouchMode'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_getTouchMode(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_getTouchMode'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (0 == argc)\n    {\n        int32_t ret = 0;\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            Integer* mode = static_cast<Integer*>(dict->objectForKey(\"touchMode\"));\n            ret = mode ? mode->getValue() : 0;\n            tolua_pushnumber(L, (lua_Number)ret);\n            return 1;\n        }\n        \n        return 0;\n    }\n    \n    CCLOG(\"'getTouchMode' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'getTouchMode'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_setSwallowsTouches(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_setSwallowsTouches'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isboolean(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        \n        bool swallowsTouches = tolua_toboolean(L, 2, 0);\n        Bool* swallowsTouchesObj = nullptr;\n        \n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            self->setUserObject(dict);\n        }\n        \n        swallowsTouchesObj = static_cast<Bool*>(dict->objectForKey(\"swallowTouches\"));\n        bool oldSwallowsTouches = swallowsTouchesObj ? swallowsTouchesObj->getValue() : false;\n        \n        if (oldSwallowsTouches != swallowsTouches)\n        {\n            dict->setObject(Integer::create(swallowsTouches), \"swallowTouches\");\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            if (enabled && enabled->getValue())\n            {\n                setTouchEnabledForLayer(self, false);\n                setTouchEnabledForLayer(self, true);\n            }\n        }\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setSwallowsTouches' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setSwallowsTouches'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_isSwallowsTouches(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_isSwallowsTouches'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (0 == argc)\n    {\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* swallowTouches = static_cast<Bool*>(dict->objectForKey(\"swallowTouches\"));\n            bool ret = swallowTouches ? swallowTouches->getValue() : false;\n            lua_pushboolean(L, ret);\n            return 1;\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'isSwallowsTouches' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'isSwallowsTouches'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_setKeyboardEnabled(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_setKeyboardEnabled'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isboolean(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        bool enabled = tolua_toboolean(L, 2, 0);\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            self->setUserObject(dict);\n        }\n        \n        dict->setObject(Bool::create(enabled), \"keyboardEnabled\");\n        \n        auto keyboardListener = static_cast<EventListenerKeyboard*>(dict->objectForKey(\"keyboardListener\"));\n        \n        auto dispatcher = self->getEventDispatcher();\n        dispatcher->removeEventListener(keyboardListener);\n        if (enabled)\n        {\n            auto listener = EventListenerKeyboard::create();\n            listener->onKeyPressed = [self](EventKeyboard::KeyCode keyCode, Event* event){\n                \n            };\n            listener->onKeyReleased = [self](EventKeyboard::KeyCode keyCode, Event* event){\n                KeypadScriptData data(keyCode, self);\n                ScriptEvent scriptEvent(kKeypadEvent,&data);\n                ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&scriptEvent);\n            };\n            CCLOG(\"come in the keyboardEnable\");\n            dispatcher->addEventListenerWithSceneGraphPriority(listener, self);\n            \n            dict->setObject(listener, \"keyboardListener\");\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'setKeyboardEnabled' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setKeyboardEnabled'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_isKeyboardEnabled(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self)\n    {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_isKeyboardEnabled'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (0 == argc)\n    {\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"keyboardEnabled\"));\n            bool ret = enabled ? enabled->getValue() : false;\n            tolua_pushboolean(L, ret);\n            return 1;\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'isKeyboardEnabled' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'isKeyboardEnabled'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_setAccelerometerEnabled(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self)\n    {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_setAccelerometerEnabled'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isboolean(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        bool enabled = tolua_toboolean(L, 2, 0);\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            self->setUserObject(dict);\n        }\n        \n        dict->setObject(Bool::create(enabled), \"accelerometerEnabled\");\n        \n        auto accListener = static_cast<EventListenerAcceleration*>(dict->objectForKey(\"accListener\"));\n        \n        auto dispatcher = self->getEventDispatcher();\n        dispatcher->removeEventListener(accListener);\n        \n        Device::setAccelerometerEnabled(enabled);\n        \n        if (enabled)\n        {\n            auto listener = EventListenerAcceleration::create([self](Acceleration* acc, Event* event){\n                BasicScriptData data(self,(void*)acc);\n                ScriptEvent accEvent(kAccelerometerEvent,&data);\n                ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&accEvent);\n            });\n            \n            dispatcher->addEventListenerWithSceneGraphPriority(listener, self);\n            \n            dict->setObject(listener, \"accListener\");\n        }\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setAccelerometerEnabled' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setAccelerometerEnabled'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_isAccelerometerEnabled(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self)\n    {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_isAccelerometerEnabled'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (0 == argc)\n    {\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"accelerometerEnabled\"));\n            bool ret = enabled ? enabled->getValue() : false;\n            tolua_pushboolean(L, ret);\n            return 1;\n        }\n        \n        return 0;\n    }\n    \n    \n    CCLOG(\"'isAccelerometerEnabled' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'isAccelerometerEnabled'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Layer_setAccelerometerInterval(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(L,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self)\n    {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Layer_setAccelerometerInterval'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        double interval = tolua_tonumber(L, 2, 0);\n        Device::setAccelerometerEnabled(interval);\n        return 0;\n    }\n    \n    CCLOG(\"'setAccelerometerInterval' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setAccelerometerInterval'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_cocos2d_Layer_registerScriptTouchHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Layer_registerScriptTouchHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc >=1 && argc <= 4) {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err)) {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        bool isMultiTouches  = false;\n        int  priority        = 0;\n        bool swallowTouches  = true;\n        \n        if (argc >= 2) {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isboolean(tolua_S,3,0,&tolua_err)) {\n                goto tolua_lerror;\n            }\n#endif\n            isMultiTouches = (bool)tolua_toboolean(tolua_S,3,false);\n        }\n        \n        if (argc >= 3) {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isnumber(tolua_S,4,0,&tolua_err)) {\n                goto tolua_lerror;\n            }\n#endif\n            priority = (int)tolua_tonumber(tolua_S,4,0);\n        }\n        \n        if (argc == 4) {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isboolean(tolua_S,5,0,&tolua_err)) {\n                goto tolua_lerror;\n            }\n#endif\n            swallowTouches = (bool)tolua_toboolean(tolua_S,5,true);\n        }\n        \n        Touch::DispatchMode touchesMode = Touch::DispatchMode::ALL_AT_ONCE;\n        if (!isMultiTouches)\n            touchesMode = Touch::DispatchMode::ONE_BY_ONE;\n        \n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict == nullptr)\n        {\n            dict = Dictionary::create();\n            self->setUserObject(dict);\n        }\n        \n        auto touchModeValue = static_cast<Integer*>(dict->objectForKey(\"touchMode\"));\n        auto swallowTouchesValue = static_cast<Bool*>(dict->objectForKey(\"swallowTouches\"));\n        auto priorityValue = static_cast<Integer*>(dict->objectForKey(\"priority\"));\n        \n        //touch model\n        int32_t mode = touchModeValue?touchModeValue->getValue() : 0;\n        if (mode != (int)touchesMode)\n        {\n            dict->setObject(Integer::create((int)touchesMode), \"touchMode\");\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            if (enabled && enabled->getValue())\n            {\n                setTouchEnabledForLayer(self, false);\n                setTouchEnabledForLayer(self, true);\n            }\n        }\n        \n        int oldPriorityValue = priorityValue?priorityValue->getValue() : 0;\n        if (priority != oldPriorityValue)\n        {\n            dict->setObject(Integer::create(priority), \"priority\");\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            if (enabled && enabled->getValue())\n            {\n                setTouchEnabledForLayer(self, false);\n                setTouchEnabledForLayer(self, true);\n            }\n        }\n        \n        //swallowsTouches Obj\n        bool oldSwallowTouchesValue = swallowTouchesValue?swallowTouchesValue->getValue():false;\n        if (oldSwallowTouchesValue != swallowTouches)\n        {\n            dict->setObject(Integer::create(swallowTouches), \"swallowTouches\");\n            Bool* enabled = static_cast<Bool*>(dict->objectForKey(\"touchEnabled\"));\n            if (enabled && enabled->getValue())\n            {\n                setTouchEnabledForLayer(self, false);\n                setTouchEnabledForLayer(self, true);\n            }\n        }\n\t\t\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, ScriptHandlerMgr::HandlerType::TOUCHES);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptTouchHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptTouchHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Layer_unregisterScriptTouchHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Layer_unregisterScriptTouchHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            auto touchListenerAllAtOnce = static_cast<EventListenerTouchAllAtOnce*>(dict->objectForKey(\"touchListenerAllAtOnce\"));\n            auto touchListenerOneByOne = static_cast<EventListenerTouchOneByOne*>(dict->objectForKey(\"touchListenerOneByOne\"));\n            auto dispatcher = self->getEventDispatcher();\n            if (nullptr != dispatcher)\n            {\n                dispatcher->removeEventListener(touchListenerAllAtOnce);\n                dispatcher->removeEventListener(touchListenerOneByOne);\n            }\n        }\n\n        ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, ScriptHandlerMgr::HandlerType::TOUCHES);\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptTouchHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptTapHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Layer_registerScriptKeypadHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self)\n    {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Layer_registerScriptKeypadHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err)) {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, ScriptHandlerMgr::HandlerType::KEYPAD);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptKeypadHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptKeypadHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Layer_unregisterScriptKeypadHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self)\n    {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Layer_unregisterScriptKeypadHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            auto keyboardListener = static_cast<EventListenerKeyboard*>(dict->objectForKey(\"keyboardListener\"));\n            \n            auto dispatcher = self->getEventDispatcher();\n            if (dispatcher != nullptr)\n            {\n                dispatcher->removeEventListener(keyboardListener);\n            }\n        }\n        \n        ScriptHandlerMgr::getInstance()->removeObjectHandler(self, ScriptHandlerMgr::HandlerType::KEYPAD);\n        return 0;\n    }\n\n    CCLOG(\"'unregisterScriptKeypadHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptKeypadHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Layer_registerScriptAccelerateHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Layer_registerScriptAccelerateHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err)) {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler =  toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, ScriptHandlerMgr::HandlerType::ACCELEROMETER);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptAccelerateHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptAccelerateHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Layer_unregisterScriptAccelerateHandler(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Layer* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Layer\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Layer*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Layer_unregisterScriptAccelerateHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        auto dict = static_cast<Dictionary*>(self->getUserObject());\n        if (dict != nullptr)\n        {\n            auto accListener = static_cast<EventListenerAcceleration*>(dict->objectForKey(\"accListener\"));\n            \n            auto dispatcher = self->getEventDispatcher();\n            if (dispatcher != nullptr)\n            {\n                dispatcher->removeEventListener(accListener);\n            }\n        }\n        \n        ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, ScriptHandlerMgr::HandlerType::ACCELEROMETER);\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptAccelerateHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptAccelerateHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Scheduler_scheduleScriptFunc(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Scheduler* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Scheduler\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Scheduler*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Scheduler_scheduleScriptFunc'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (3 == argc) {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S,3,0,&tolua_err) ||\n            !tolua_isboolean(tolua_S,4,0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler =  toluafix_ref_function(tolua_S,2,0);\n        float interval = (float)  tolua_tonumber(tolua_S,3,0);\n        bool  paused   = (bool)  tolua_toboolean(tolua_S,4,0);\n        unsigned int tolua_ret = (unsigned int)  self->scheduleScriptFunc(handler,interval,paused);\n        tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        return 1;\n    }\n    \n    CCLOG(\"'scheduleScriptFunc' has wrong number of arguments: %d, was expecting %d\\n\", argc, 3);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'scheduleScriptFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_cocos2d_Scheduler_unscheduleScriptEntry(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Scheduler* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Scheduler\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Scheduler*>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Scheduler_unscheduleScriptEntry'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (1 == argc) {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(tolua_S,2,0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        unsigned int scheduleScriptEntryID = ((unsigned int)  tolua_tonumber(tolua_S,2,0));\n        self->unscheduleScriptEntry(scheduleScriptEntryID);\n        return 0;\n    }\n    \n    CCLOG(\"'unscheduleScriptEntry' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unscheduleScriptEntry'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_cocos2d_Sequence_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n    tolua_Error tolua_err;\n    \n#if COCOS2D_DEBUG >= 1\n\tif (!tolua_isusertable(tolua_S,1,\"cc.Sequence\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if(argc > 0)\n    {\n        Vector<FiniteTimeAction*> array;\n\n        if (1 == argc && tolua_istable(tolua_S, 2, 0, &tolua_err))\n        {\n            luaval_to_ccvector(tolua_S, 2, &array);\n        }\n        else\n        {\n            uint32_t i = 1;\n            while (i <= argc)\n            {\n#if COCOS2D_DEBUG >= 1\n                if (!tolua_isusertype(tolua_S, 1 + i, \"cc.FiniteTimeAction\", 0, &tolua_err))\n                    goto tolua_lerror;\n#endif\n                \n                cocos2d::FiniteTimeAction* item = static_cast<cocos2d::FiniteTimeAction*>(tolua_tousertype(tolua_S, 1 + i, NULL));\n                if (NULL != item)\n                {\n                    array.pushBack(item);\n                    ++i;\n                }\n            }\n        }\n        \n        cocos2d::Sequence* tolua_ret = cocos2d::Sequence::create(array);\n        //issue 2433 uncheck\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.Sequence\");\n        return 1;\n    }\n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_CallFunc_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertable(tolua_S,1,\"cc.CallFunc\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1 || argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if(!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err))\n            goto tolua_lerror;\n#endif\n        \n        LUA_FUNCTION handler =  toluafix_ref_function(tolua_S,2,0);\n        \n        bool hasExtraData = false;\n        int  ref  = 0;\n        if (argc == 2)\n        {\n#if COCOS2D_DEBUG >= 1\n            if(!tolua_istable(tolua_S, 3, 0, &tolua_err))\n                goto tolua_lerror;\n#endif\n            lua_pushvalue(tolua_S, 3);\n            ref = luaL_ref(tolua_S, LUA_REGISTRYINDEX);\n            hasExtraData = true;\n        }\n        LuaCallFunc* tolua_ret = new LuaCallFunc();\n        tolua_ret->initWithFunction([=](void* self,Node* target){\n            int callbackHandler =  ScriptHandlerMgr::getInstance()->getObjectHandler((void*)tolua_ret, ScriptHandlerMgr::HandlerType::CALLFUNC);\n            \n            if (0 != callbackHandler)\n            {\n                LuaStack* stack = LuaEngine::getInstance()->getLuaStack();\n                int argNums = 1;\n                if (nullptr != target)\n                {\n                    stack->pushObject(target, \"cc.Node\");\n                }\n                else\n                {\n                    stack->pushNil();\n                }\n                \n                if (hasExtraData)\n                {\n                    lua_rawgeti(tolua_S, LUA_REGISTRYINDEX,ref);\n                    if (lua_istable(tolua_S, -1))\n                    {\n                        argNums += 1;\n                    }\n                    else\n                    {\n                        lua_pop(tolua_S, 1);\n                    }\n                }\n                stack->executeFunctionByHandler(callbackHandler, argNums);\n                if (hasExtraData)\n                {\n                    luaL_unref(tolua_S, LUA_REGISTRYINDEX,ref);\n                }\n                stack->clean();\n            }\n        });\n        tolua_ret->autorelease();\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)tolua_ret, handler, ScriptHandlerMgr::HandlerType::CALLFUNC);\n        \n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.CallFunc\");\n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n\nstatic int tolua_cocos2d_Node_registerScriptHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Node* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Node*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Node_registerScriptHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1)\n    {\n#if COCOS2D_DEBUG >= 1\n        if(!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err))\n            goto tolua_lerror;\n#endif\n        \n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, ScriptHandlerMgr::HandlerType::NODE);\n\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Node_unregisterScriptHandler(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Node* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Node*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Node_unregisterScriptHandler'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 0)\n    {\n        ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, ScriptHandlerMgr::HandlerType::NODE);\n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_Cocos2d_Node_scheduleUpdateWithPriorityLua(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Node* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Node*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_Cocos2d_Node_scheduleUpdateWithPriorityLua'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if(!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err))\n            goto tolua_lerror;\n#endif\n        \n        LUA_FUNCTION handler =  toluafix_ref_function(tolua_S,2,0);\n        int priority = 0;\n        if (luaval_to_int32(tolua_S, 3, &priority))\n        {\n           self->scheduleUpdateWithPriorityLua(handler,priority);\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'scheduleUpdateWithPriorityLua' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'scheduleUpdateWithPriorityLua'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Node_unscheduleUpdate(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Node* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Node*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Node_unscheduleUpdate'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (0 == argc)\n    {\n        self->unscheduleUpdate();\n        return 0;\n    }\n    \n    CCLOG(\"'unscheduleUpdate' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unscheduleUpdate'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_cocos2d_Node_setContentSize(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setContentSize'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    \n    if (1 == argc)\n    {\n        cocos2d::Size size;\n        ok &= luaval_to_size(tolua_S, 2, &size);\n        if (!ok)\n            return 0;\n        \n        cobj->setContentSize(size);\n        return 0;\n    }\n    else if(2 == argc)\n    {\n        double width;\n        ok &= luaval_to_number(tolua_S, 2,&width);\n        \n        if (!ok)\n            return 0;\n        \n        double height;\n        ok &= luaval_to_number(tolua_S, 3,&height);\n        \n        if (!ok)\n            return 0;\n        \n        cobj->setContentSize(Size(width, height));\n        return 0;\n    }\n    \n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setContentSize\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setContentSize'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nint tolua_cocos2d_Node_setAnchorPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::Node* cobj = NULL;\n    bool ok  = true;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_Node_setAnchorPoint'\", NULL);\n        return 0;\n    }\n#endif\n    argc = lua_gettop(tolua_S)-1;\n    \n    if (1 == argc)\n    {\n        cocos2d::Point pt;\n        ok &= luaval_to_point(tolua_S, 2, &pt);\n        if (!ok)\n            return 0;\n        \n        cobj->setAnchorPoint(pt);\n        return 0;\n    }\n    else if(2 == argc)\n    {\n        double x;\n        ok &= luaval_to_number(tolua_S, 2,&x);\n        \n        if (!ok)\n            return 0;\n        \n        double y;\n        ok &= luaval_to_number(tolua_S, 3,&y);\n        \n        if (!ok)\n            return 0;\n        \n        cobj->setAnchorPoint(Point(x,y));\n        return 0;\n    }\n    \n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"setAnchorPoint\",argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_Node_setAnchorPoint'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nstatic int tolua_cocos2d_Node_getPosition(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Node* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Node*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_Node_getPosition'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc >= 0 && argc <= 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(tolua_S,2,1,&tolua_err) || !tolua_isnumber(tolua_S,3,1,&tolua_err) )\n            goto tolua_lerror;\n#endif\n        float x = (float)  tolua_tonumber(tolua_S,2,0);\n        float y = (float)  tolua_tonumber(tolua_S,3,0);\n        \n        self->getPosition(&x,&y);\n        \n        tolua_pushnumber(tolua_S,(lua_Number)x);\n        tolua_pushnumber(tolua_S,(lua_Number)y);\n        \n        return 2;\n    }\n    \n    CCLOG(\"'getPosition' function in Node has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getPosition'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_Spawn_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n    tolua_Error tolua_err;\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.Spawn\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc > 0)\n    {\n        Vector<FiniteTimeAction*> array;        \n        uint32_t i = 1;\n        \n        if (1 == argc && tolua_istable(tolua_S, 2, 0, &tolua_err))\n        {\n            luaval_to_ccvector(tolua_S, 2, &array);\n        }\n        else\n        {\n            while (i <= argc)\n            {\n#if COCOS2D_DEBUG >= 1\n                if (!tolua_isusertype(tolua_S, 1 + i, \"cc.FiniteTimeAction\", 0, &tolua_err))\n                    goto tolua_lerror;\n#endif\n                \n                cocos2d::FiniteTimeAction* item = static_cast<cocos2d::FiniteTimeAction*>(tolua_tousertype(tolua_S, 1 + i, NULL));\n                if (NULL != item)\n                {\n                    array.pushBack(item);\n                    ++i;\n                }\n            }\n        }\n        \n        cocos2d::Spawn * tolua_ret = cocos2d::Spawn::create(array);\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.Spawn\");\n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint lua_cocos2d_CardinalSplineBy_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"cc.CardinalSplineBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 3)\n    {\n        double dur = 0.0;\n        ok &= luaval_to_number(tolua_S, 2, &dur);\n        if (!ok)\n            return false;\n        \n        int num = 0;\n        Point *arr = NULL;\n        ok &= luaval_to_array_of_Point(tolua_S, 3, &arr, &num);\n        if (!ok)\n            return false;\n        \n        double ten = 0.0;\n        ok &= luaval_to_number(tolua_S, 4, &ten);\n        if (!ok)\n            return false;\n        \n        if (num > 0)\n        {\n            PointArray* points = PointArray::create(num);\n            \n            if (NULL == points)\n            {\n                free(arr);\n                return 0;\n            }\n            \n            for( int i = 0; i < num; i++) {\n                points->addControlPoint(arr[i]);\n            }\n            \n            free(arr);\n            CardinalSplineBy* tolua_ret = CardinalSplineBy::create(dur, points, ten);\n            if (NULL != tolua_ret)\n            {\n                int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n                int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n                toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.CardinalSplineBy\");\n                return 1;\n            }\n        }\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 3);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_cocos2d_CatmullRomBy_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"cc.CatmullRomBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n        double dur = 0.0;\n        ok &= luaval_to_number(tolua_S, 2, &dur);\n        if (!ok)\n            return false;\n        \n        int num = 0;\n        Point *arr = NULL;\n        ok &= luaval_to_array_of_Point(tolua_S, 3, &arr, &num);\n        if (!ok)\n            return false;\n        \n        if (num > 0)\n        {\n            PointArray* points = PointArray::create(num);\n            \n            if (NULL == points)\n            {\n                free(arr);\n                return 0;\n            }\n            \n            for( int i = 0; i < num; i++) {\n                points->addControlPoint(arr[i]);\n            }\n            \n            free(arr);\n            CatmullRomBy* tolua_ret = CatmullRomBy::create(dur, points);\n            if (NULL != tolua_ret)\n            {\n                int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n                int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n                toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.CatmullRomBy\");\n                return 1;\n            }\n        }\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_cocos2d_CatmullRomTo_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"cc.CatmullRomTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n        double dur = 0.0;\n        ok &= luaval_to_number(tolua_S, 2, &dur);\n        if (!ok)\n            return false;\n        \n        int num = 0;\n        Point *arr = NULL;\n        ok &= luaval_to_array_of_Point(tolua_S, 3, &arr, &num);\n        if (!ok)\n            return false;\n        \n        if (num > 0)\n        {\n            PointArray* points = PointArray::create(num);\n            \n            if (NULL == points)\n            {\n                free(arr);\n                return 0;\n            }\n            \n            for( int i = 0; i < num; i++) {\n                points->addControlPoint(arr[i]);\n            }\n            \n            free(arr);\n            CatmullRomTo* tolua_ret = CatmullRomTo::create(dur, points);\n            if (NULL != tolua_ret)\n            {\n                int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n                int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n                toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.CatmullRomTo\");\n                return 1;\n            }\n        }\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_cocos2d_BezierBy_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"cc.BezierBy\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n        double t = 0.0;\n        ok &= luaval_to_number(tolua_S, 2, &t);\n        if (!ok)\n            return false;\n        \n        int num = 0;\n        Point *arr = NULL;\n        ok &= luaval_to_array_of_Point(tolua_S, 3, &arr, &num);\n        if (!ok)\n            return false;\n        \n        if (num < 3)\n        {\n            free(arr);\n            return false;\n        }\n        \n        ccBezierConfig config;\n        config.controlPoint_1 = arr[0];\n        config.controlPoint_2 = arr[1];\n        config.endPosition = arr[2];\n        free(arr);\n        \n        BezierBy* tolua_ret = BezierBy::create(t, config);\n        if (NULL != tolua_ret)\n        {\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.BezierBy\");\n            return 1;\n        }\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_cocos2d_BezierTo_create(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"cc.BezierTo\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n        double t = 0.0;\n        ok &= luaval_to_number(tolua_S, 2, &t);\n        if (!ok)\n            return false;\n        \n        int num = 0;\n        Point *arr = NULL;\n        ok &= luaval_to_array_of_Point(tolua_S, 3, &arr, &num);\n        if (!ok)\n            return false;\n        \n        if (num < 3)\n        {\n            free(arr);\n            return false;\n        }\n        \n        ccBezierConfig config;\n        config.controlPoint_1 = arr[0];\n        config.controlPoint_2 = arr[1];\n        config.endPosition = arr[2];\n        free(arr);\n        \n        BezierTo* tolua_ret = BezierTo::create(t, config);\n        if (NULL != tolua_ret)\n        {\n            int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.BezierTo\");\n            return 1;\n        }\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_DrawNode_drawPolygon(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    DrawNode* self = nullptr;\n  \n    tolua_Error tolua_err;\n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.DrawNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::DrawNode*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n\tif (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_DrawNode_drawPolygon'\\n\", NULL);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (5 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if(\n        !tolua_istable(tolua_S, 2, 0, &tolua_err)  ||\n        !tolua_isnumber(tolua_S, 3, 0, &tolua_err) ||\n        !tolua_istable(tolua_S, 4, 0,&tolua_err)   ||\n        !tolua_isnumber(tolua_S, 5, 0, &tolua_err) ||\n        !tolua_istable(tolua_S,6, 0,&tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        size_t size = lua_tonumber(tolua_S, 3);\n        if ( size > 0 )\n        {\n            Point* points = new Point[size];\n            if (NULL == points)\n                return 0;\n            \n            for (int i = 0; i < size; i++)\n            {\n                lua_pushnumber(tolua_S,i + 1);\n                lua_gettable(tolua_S,2);\n                if (!tolua_istable(tolua_S,-1, 0, &tolua_err))\n                {\n                    CC_SAFE_DELETE_ARRAY(points);\n#if COCOS2D_DEBUG >= 1\n                    goto tolua_lerror;\n#endif\n                }\n                \n                if(!luaval_to_point(tolua_S, lua_gettop(tolua_S), &points[i]))\n                {\n                    lua_pop(tolua_S, 1);\n                    CC_SAFE_DELETE_ARRAY(points);\n                    return 0;\n                }\n                lua_pop(tolua_S, 1);\n            }\n            \n            Color4F fillColor;\n            if (!luaval_to_color4f(tolua_S, 4, &fillColor))\n            {\n                CC_SAFE_DELETE_ARRAY(points);\n                return 0;\n            }\n            \n            float borderWidth  = (float)tolua_tonumber(tolua_S, 5, 0);\n            \n            Color4F borderColor;\n            if (!luaval_to_color4f(tolua_S, 6, &borderColor))\n            {\n                CC_SAFE_DELETE_ARRAY(points);\n                return 0;\n            }\n            \n            self->drawPolygon(points, size, fillColor, borderWidth, borderColor);\n            CC_SAFE_DELETE_ARRAY(points);\n            return 0;\n        }        \n    }\n    \n    CCLOG(\"'drawPolygon' has wrong number of arguments: %d, was expecting %d\\n\", argc, 5);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'drawPolygon'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n// setBlendFunc\ntemplate<class T>\nstatic int tolua_cocos2dx_setBlendFunc(lua_State* tolua_S,const char* className)\n{\n    if (NULL == tolua_S || NULL == className || strlen(className) == 0)\n        return 0;\n    \n    int argc = 0;\n    T* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,className,0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<T*>(tolua_tousertype(tolua_S,1,0));\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (2 == argc)\n    {\n        GLenum src, dst;\n        if (!luaval_to_int32(tolua_S, 2, (int32_t*)&src))\n            return 0;\n        \n        if (!luaval_to_int32(tolua_S, 3, (int32_t*)&dst))\n            return 0;\n        \n        BlendFunc blendFunc = {src, dst};\n        self->setBlendFunc(blendFunc);\n        return 0;\n    }\n\n    \n    CCLOG(\"'setBlendFunc' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setBlendFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_Sprite_setBlendFunc(lua_State* tolua_S)\n{\n    return tolua_cocos2dx_setBlendFunc<Sprite>(tolua_S,\"cc.Sprite\");\n}\n\nstatic int tolua_cocos2dx_SpriteBatchNode_setBlendFunc(lua_State* tolua_S)\n{\n    return tolua_cocos2dx_setBlendFunc<SpriteBatchNode>(tolua_S,\"cc.SpriteBatchNode\");\n}\n\nstatic int tolua_cocos2dx_MotionStreak_setBlendFunc(lua_State* tolua_S)\n{\n    return tolua_cocos2dx_setBlendFunc<MotionStreak>(tolua_S,\"cc.MotionStreak\");\n}\n\nstatic int tolua_cocos2dx_AtlasNode_setBlendFunc(lua_State* tolua_S)\n{\n    return tolua_cocos2dx_setBlendFunc<AtlasNode>(tolua_S,\"cc.AtlasNode\");\n}\n\nstatic int tolua_cocos2dx_ParticleBatchNode_setBlendFunc(lua_State* tolua_S)\n{\n    return tolua_cocos2dx_setBlendFunc<ParticleBatchNode>(tolua_S,\"cc.ParticleBatchNode\");\n}\n\nstatic int tolua_cocos2dx_LayerColor_setBlendFunc(lua_State* tolua_S)\n{\n    return tolua_cocos2dx_setBlendFunc<LayerColor>(tolua_S,\"cc.LayerColor\");\n}\n\nstatic int tolua_cocos2dx_ParticleSystem_setBlendFunc(lua_State* tolua_S) \n{\n    return tolua_cocos2dx_setBlendFunc<ParticleSystem>(tolua_S,\"cc.ParticleSystem\");\n}\n\nstatic int tolua_cocos2dx_DrawNode_setBlendFunc(lua_State* tolua_S) \n{\n    return tolua_cocos2dx_setBlendFunc<DrawNode>(tolua_S,\"cc.DrawNode\");\n}\n\nstatic int tolua_cocos2dx_LayerMultiplex_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Vector<Layer*> arg0;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S, 1, \"cc.LayerMultiplex\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n \n    if (argc > 0)\n    {\n        if (luavals_variadic_to_ccvector(tolua_S, argc, &arg0))\n        {\n            LayerMultiplex* tolua_ret =  LayerMultiplex::createWithArray(arg0);\n            int  nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n            int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n            toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.LayerMultiplex\");\n            return 1;\n        }\n        else\n        {\n            CCLOG(\"error in tolua_cocos2dx_LayerMultiplex_create \\n\");\n            return 0;\n        }\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_FileUtils_getStringFromFile(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    FileUtils* self = nullptr;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"cc.FileUtils\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<FileUtils *>(tolua_tousertype(tolua_S,1,0));\n    \n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_FileUtils_getStringFromFile'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (1 == argc)\n    {\n        const char* arg0;\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        if (ok)\n        {\n            std::string fullPathName = FileUtils::getInstance()->fullPathForFilename(arg0);\n            String* contentsOfFile = String::createWithContentsOfFile(fullPathName.c_str());\n            if (nullptr != contentsOfFile)\n            {\n                const char* tolua_ret = contentsOfFile->getCString();\n                tolua_pushstring(tolua_S, tolua_ret);\n            }\n            return 1;\n        }\n    }\n    \n    CCLOG(\"'getStringFromFile' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getStringFromFile'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_UserDefault_getInstance(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"cc.UserDefault\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if(0 == argc)\n    {\n        UserDefault* tolua_ret = (UserDefault*)  UserDefault::getInstance();\n        tolua_pushusertype(tolua_S,(void*)tolua_ret,\"cc.UserDefault\");\n        return 1;\n    }\n    \n    CCLOG(\"'getInstance' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getInstance'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_GLProgram_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    bool ok = false;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if(2 == argc)\n    {\n        const char *arg0, *arg1;\n        std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp); arg0 = arg0_tmp.c_str();\n        std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp); arg1 = arg1_tmp.c_str();\n        \n        GLProgram* tolua_ret = new GLProgram();\n        if (nullptr == tolua_ret)\n            return 0;        \n\n        tolua_ret->autorelease();\n        tolua_ret->initWithVertexShaderFilename(arg0, arg1);\n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.GLProgram\");\n        return 1;\n        \n    }\n    \n    CCLOG(\"'create' function of GLProgram wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_cocos2d_GLProgram_getProgram(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    GLProgram* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (GLProgram*)  tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_GLProgram_getProgram'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    if (0 == argc)\n    {\n        unsigned const int tolua_ret = ( unsigned const int)  self->getProgram();\n        tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);\n        return 1;\n    }\n    \n    CCLOG(\"'getProgram' function of GLProgram wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'getProgram'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_GLProgram_setUniformLocationF32(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    GLProgram* self = nullptr;\n    int location = 0;\n    double f1 = 0.0;\n    double f2 = 0.0;\n    double f3 = 0.0;\n    double f4 = 0.0;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"cc.GLProgram\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (GLProgram*)  tolua_tousertype(tolua_S,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2d_GLProgram_getProgram'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc >= 2 && argc <= 5)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n            !tolua_isnumber(tolua_S,3,0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        location = (int)  tolua_tonumber(tolua_S,2,0);\n        f1 = (float)  tolua_tonumber(tolua_S,3,0);\n        \n        if (2 == argc)\n        {\n            self->setUniformLocationWith1f(location,f1);\n            return 0;\n        }\n        \n        if (argc >= 3)\n        {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isnumber(tolua_S,4,0,&tolua_err))\n                goto tolua_lerror;\n#endif\n            \n            f2 = (float)  tolua_tonumber(tolua_S,3,0);\n            if (3 == argc)\n            {\n                self->setUniformLocationWith2f(location, f1, f2);\n                return 0;\n            }\n        }\n        \n        if (argc >= 4)\n        {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isnumber(tolua_S,5,0,&tolua_err))\n                goto tolua_lerror;\n#endif\n            \n            f3 = (float)  tolua_tonumber(tolua_S,3,0);\n            if (4 == argc)\n            {\n                self->setUniformLocationWith3f(location, f1, f2, f3);\n                return 0;\n            }\n        }\n        \n        if (argc == 5)\n        {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isnumber(tolua_S,6,0,&tolua_err))\n                goto tolua_lerror;\n#endif\n            \n            f4 = (float)  tolua_tonumber(tolua_S,3,0);\n            if (4 == argc)\n            {\n                self->setUniformLocationWith4f(location, f1, f2, f3, f4);\n                return 0;\n            }\n\n        }\n    }\n    \n    CCLOG(\"'setUniformLocationF32' function of GLProgram wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setUniformLocationF32'.\",&tolua_err);\n    return 0;\n#endif    \n    \n}\n\nstatic void extendGLProgram(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.GLProgram\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_GLProgram_create );\n        lua_rawset(tolua_S,-3);\n        \n        lua_pushstring(tolua_S,\"getProgram\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_GLProgram_getProgram );\n        lua_rawset(tolua_S,-3);\n        \n        lua_pushstring(tolua_S,\"setUniformLocationF32\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_GLProgram_setUniformLocationF32 );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2dx_Texture2D_setTexParameters(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    Texture2D* self = nullptr;\n    GLuint arg1 = 0;\n    GLuint arg2 = 0;\n    GLuint arg3 = 0;\n    GLuint arg4 = 0;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,\"cc.Texture2D\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (Texture2D*)  tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_Texture2D_setTexParameters'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (4 == argc)\n    {        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err) ||\n            !tolua_isnumber(tolua_S, 4, 0, &tolua_err) ||\n            !tolua_isnumber(tolua_S, 5, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        arg1 = (GLuint)tolua_tonumber(tolua_S, 2, 0);\n        arg2 = (GLuint)tolua_tonumber(tolua_S, 3, 0);\n        arg3 = (GLuint)tolua_tonumber(tolua_S, 4, 0);\n        arg4 = (GLuint)tolua_tonumber(tolua_S, 5, 0);\n        \n        Texture2D::TexParams param = { arg1, arg2, arg3, arg4 };\n        \n        self->setTexParameters(param);\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setTexParameters' function of Texture2D wrong number of arguments: %d, was expecting %d\\n\", argc,4);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setTexParameters'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_SpriteBatchNode_getDescendants(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    cocos2d::SpriteBatchNode* cobj = nullptr;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.SpriteBatchNode\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::SpriteBatchNode*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'tolua_cocos2dx_SpriteBatchNode_getDescendants'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        std::vector<Sprite*> ret = cobj->getDescendants();\n\n        lua_newtable(tolua_S);\n        \n        if (ret.empty())\n            return 1;\n        \n        auto iter = ret.begin();\n        int  indexTable = 1;\n        for (; iter != ret.end(); ++iter)\n        {\n            if (nullptr == *iter)\n                continue;\n            \n            lua_pushnumber(tolua_S, (lua_Number)indexTable);\n            toluafix_pushusertype_ccobject(tolua_S, (*iter)->_ID, &((*iter)->_luaID), (void*)(*iter),\"cc.Sprite\");\n            lua_rawset(tolua_S, -3);\n            (*iter)->retain();\n            ++indexTable;\n        }\n        \n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getDescendants\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_SpriteBatchNode_getDescendants'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nstatic void extendTexture2D(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.Texture2D\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setTexParameters\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_Texture2D_setTexParameters );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMenuItem(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.MenuItem\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"registerScriptTapHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_MenuItem_registerScriptTapHandler);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"unregisterScriptTapHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_MenuItem_unregisterScriptTapHandler);\n        lua_rawset(tolua_S, -3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMenuItemImage(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.MenuItemImage\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_MenuItemImage_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMenuItemLabel(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.MenuItemLabel\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_MenuItemLabel_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMenuItemFont(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.MenuItemFont\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_MenuItemFont_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMenuItemSprite(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.MenuItemSprite\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_MenuItemSprite_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMenuItemToggle(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.MenuItemToggle\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_MenuItemToggle_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMenu(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.Menu\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S, -1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Menu_create);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"alignItemsInRows\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_Menu_alignItemsInRows);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"alignItemsInColumns\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_Menu_alignItemsInColumns);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendNode(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.Node\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"registerScriptHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Node_registerScriptHandler);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"unregisterScriptHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Node_unregisterScriptHandler);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S,\"scheduleUpdateWithPriorityLua\");\n        lua_pushcfunction(tolua_S,tolua_Cocos2d_Node_scheduleUpdateWithPriorityLua);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S,\"unscheduleUpdate\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Node_unscheduleUpdate);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S,\"getPosition\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Node_getPosition);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S, \"setContentSize\");\n        lua_pushcfunction(tolua_S, tolua_cocos2d_Node_setContentSize);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S, \"setAnchorPoint\");\n        lua_pushcfunction(tolua_S, tolua_cocos2d_Node_setAnchorPoint);\n        lua_rawset(tolua_S, -3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendLayer(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.Layer\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"registerScriptTouchHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Layer_registerScriptTouchHandler);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"unregisterScriptTouchHandler\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Layer_unregisterScriptTouchHandler);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S, \"registerScriptKeypadHandler\");\n        lua_pushcfunction(tolua_S, tolua_cocos2d_Layer_registerScriptKeypadHandler);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S, \"unregisterScriptKeypadHandler\");\n        lua_pushcfunction(tolua_S, tolua_cocos2d_Layer_unregisterScriptKeypadHandler);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S, \"registerScriptAccelerateHandler\");\n        lua_pushcfunction(tolua_S, tolua_cocos2d_Layer_registerScriptAccelerateHandler);\n        lua_rawset(tolua_S, -3);\n        lua_pushstring(tolua_S, \"unregisterScriptAccelerateHandler\");\n        lua_pushcfunction(tolua_S, tolua_cocos2d_Layer_unregisterScriptAccelerateHandler);\n        lua_rawset(tolua_S, -3);\n        \n        tolua_function(tolua_S, \"setTouchEnabled\", lua_cocos2dx_Layer_setTouchEnabled);\n        tolua_function(tolua_S, \"isTouchEnabled\", lua_cocos2dx_Layer_isTouchEnabled);\n        tolua_function(tolua_S, \"setTouchMode\", lua_cocos2dx_Layer_setTouchMode);\n        tolua_function(tolua_S, \"getTouchMode\", lua_cocos2dx_Layer_getTouchMode);\n        tolua_function(tolua_S, \"setSwallowsTouches\", lua_cocos2dx_Layer_setSwallowsTouches);\n        tolua_function(tolua_S, \"isSwallowsTouches\", lua_cocos2dx_Layer_isSwallowsTouches);\n        tolua_function(tolua_S, \"setKeyboardEnabled\", lua_cocos2dx_Layer_setKeyboardEnabled);\n        tolua_function(tolua_S, \"isKeyboardEnabled\", lua_cocos2dx_Layer_isKeyboardEnabled);\n        tolua_function(tolua_S, \"setAccelerometerEnabled\", lua_cocos2dx_Layer_setAccelerometerEnabled);\n        tolua_function(tolua_S, \"isAccelerometerEnabled\", lua_cocos2dx_Layer_isAccelerometerEnabled);\n        tolua_function(tolua_S, \"setAccelerometerInterval\", lua_cocos2dx_Layer_setAccelerometerInterval);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendScheduler(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.Scheduler\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"scheduleScriptFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Scheduler_scheduleScriptFunc);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"unscheduleScriptEntry\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Scheduler_unscheduleScriptEntry);\n        lua_rawset(tolua_S, -3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendSequence(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.Sequence\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Sequence_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendCallFunc(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.CallFunc\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_CallFunc_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendSpawn(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.Spawn\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_Spawn_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendCardinalSplineBy(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.CardinalSplineBy\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,lua_cocos2d_CardinalSplineBy_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendCatmullRomBy(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.CatmullRomBy\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_CatmullRomBy_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendCatmullRomTo(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.CatmullRomTo\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_CatmullRomTo_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendBezierBy(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.BezierBy\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_BezierBy_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendBezierTo(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.BezierTo\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_BezierTo_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendDrawNode(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.DrawNode\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"drawPolygon\");\n        lua_pushcfunction(tolua_S,tolua_cocos2d_DrawNode_drawPolygon);\n        lua_rawset(tolua_S,-3);\n\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_DrawNode_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendSprite(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.Sprite\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_Sprite_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendLayerColor(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.LayerColor\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_LayerColor_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendLayerMultiplex(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.LayerMultiplex\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"create\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_LayerMultiplex_create);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendParticleSystem(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S,\"cc.ParticleSystem\");\n    lua_rawget(tolua_S,LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_ParticleSystem_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendFileUtils(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.FileUtils\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getStringFromFile\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_FileUtils_getStringFromFile );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendUserDefault(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.UserDefault\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getInstance\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_UserDefault_getInstance );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendSpriteBatchNode(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.SpriteBatchNode\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getDescendants\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_SpriteBatchNode_getDescendants );\n        lua_rawset(tolua_S,-3);\n\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_SpriteBatchNode_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendMotionStreak(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.MotionStreak\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_MotionStreak_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendAtlasNode(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.AtlasNode\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_AtlasNode_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendParticleBatchNode(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.ParticleBatchNode\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"setBlendFunc\");\n        lua_pushcfunction(tolua_S,tolua_cocos2dx_ParticleBatchNode_setBlendFunc);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nNS_CC_BEGIN\nEventListenerAcceleration* LuaEventListenerAcceleration::create()\n{\n    EventListenerAcceleration* eventAcceleration = new EventListenerAcceleration();\n    if (nullptr == eventAcceleration)\n        return nullptr;\n    \n    if ( eventAcceleration->init([=](Acceleration* acc, Event* event){\n        LuaEventAccelerationData listenerData((void*)acc,event);\n        BasicScriptData data(eventAcceleration,(void*)&listenerData);\n        LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::EVENT_ACC, (void*)&data);\n    }))\n    {\n        eventAcceleration->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(eventAcceleration);\n    }\n    return eventAcceleration;\n}\n\nEventListenerCustom* LuaEventListenerCustom::create(const std::string& eventName)\n{\n    EventListenerCustom* eventCustom = new EventListenerCustom();\n    if (nullptr == eventCustom)\n        return nullptr;\n    \n    if ( eventCustom->init(eventName, [=](EventCustom* event){\n        BasicScriptData data((void*)eventCustom,(void*)event);\n        LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::EVENT_CUSTIOM, (void*)&data );\n    }))\n    {\n        eventCustom->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(eventCustom);\n    }\n    return eventCustom;\n}\nNS_CC_END\n\nstatic int tolua_cocos2dx_LuaEventListenerAcceleration_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S, 1, \"cc.EventListenerAcceleration\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n \n    if (argc == 1)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err)) {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        cocos2d::EventListenerAcceleration* tolua_ret = cocos2d::LuaEventListenerAcceleration::create();\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)tolua_ret, handler, ScriptHandlerMgr::HandlerType::EVENT_ACC);\n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.EventListenerAcceleration\");\n        \n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2d_LuaEventListenerCustom_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S, 1, \"cc.EventListenerCustom\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||\n            !toluafix_isfunction(tolua_S,3,\"LUA_FUNCTION\",0,&tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        const std::string eventName = ((const std::string)  tolua_tocppstring(tolua_S,2,0));\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,3,0);\n        cocos2d::EventListenerCustom* tolua_ret = LuaEventListenerCustom::create(eventName);\n        ScriptHandlerMgr::getInstance()->addObjectHandler((void*)tolua_ret, handler, ScriptHandlerMgr::HandlerType::EVENT_CUSTIOM);\n        \n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.EventListenerCustom\");\n        \n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendEventListenerCustom(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.EventListenerCustom\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"create\",tolua_cocos2d_LuaEventListenerCustom_create);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic void extendEventListenerAcceleration(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.EventListenerAcceleration\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"create\",tolua_cocos2dx_LuaEventListenerAcceleration_create);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2dx_EventListenerKeyboard_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S, 1, \"cc.EventListenerKeyboard\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 0)\n    {\n        cocos2d::EventListenerKeyboard* tolua_ret = cocos2d::EventListenerKeyboard::create();\n        if(nullptr == tolua_ret)\n            return 0;\n        \n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.EventListenerKeyboard\");\n        \n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_EventListenerKeyboard_registerScriptHandler(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    EventListenerKeyboard* self = nullptr;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S, 1, \"cc.EventListenerKeyboard\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    self = static_cast<EventListenerKeyboard*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_EventListenerKeyboard_registerScriptHandler'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        \n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::HandlerType type = static_cast<ScriptHandlerMgr::HandlerType>((int)tolua_tonumber(tolua_S, 3, 0));\n        switch (type)\n        {\n            case ScriptHandlerMgr::HandlerType::EVENT_KEYBOARD_PRESSED:\n                {\n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                    self->onKeyPressed = [=](EventKeyboard::KeyCode keyCode, Event* event){\n                        LuaEventKeyboarData listenerData((int)keyCode, event);\n                        BasicScriptData data((void*)self,(void*)&listenerData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_KEYBOARD_RELEASED:\n                {\n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                    self->onKeyReleased = [=](EventKeyboard::KeyCode keyCode, Event* event){\n                        LuaEventKeyboarData listenerData((int)keyCode, event);\n                        BasicScriptData data((void*)self,(void*)&listenerData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                }\n                break;\n            default:\n                break;\n        }\n        \n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendEventListenerKeyboard(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.EventListenerKeyboard\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"create\",tolua_cocos2dx_EventListenerKeyboard_create);\n        tolua_function(tolua_S, \"registerScriptHandler\", tolua_cocos2dx_EventListenerKeyboard_registerScriptHandler);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2dx_EventListenerTouchOneByOne_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S, 1, \"cc.EventListenerTouchOneByOne\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 0)\n    {\n        cocos2d::EventListenerTouchOneByOne* tolua_ret = cocos2d::EventListenerTouchOneByOne::create();\n        if(nullptr == tolua_ret)\n            return 0;\n        \n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.EventListenerTouchOneByOne\");\n        \n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_EventListenerTouchOneByOne_registerScriptHandler(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    EventListenerTouchOneByOne* self = nullptr;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S, 1, \"cc.EventListenerTouchOneByOne\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    self = static_cast<EventListenerTouchOneByOne*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_EventListenerTouchOneByOne_registerScriptHandler'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::HandlerType type        = static_cast<ScriptHandlerMgr::HandlerType>((int)tolua_tonumber(tolua_S, 3, 0));\n        switch (type)\n        {\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_BEGAN:\n                {\n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                    \n                    self->onTouchBegan = [=](Touch* touch, Event* event){\n                        LuaEventTouchData touchData(touch, event);\n                        BasicScriptData data((void*)self,(void*)&touchData);\n                        return LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_MOVED:\n                {\n                    self->onTouchMoved = [=](Touch* touch, Event* event){\n                        LuaEventTouchData touchData(touch, event);\n                        BasicScriptData data((void*)self,(void*)&touchData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                    \n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_ENDED:\n                {\n                    self->onTouchEnded = [=](Touch* touch, Event* event){\n                        LuaEventTouchData touchData(touch, event);\n                        BasicScriptData data((void*)self,(void*)&touchData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                    \n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCH_CANCELLED:\n                {\n                    self->onTouchCancelled = [=](Touch* touch, Event* event){\n                        LuaEventTouchData touchData(touch, event);\n                        BasicScriptData data((void*)self,(void*)&touchData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                    \n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                }\n                break;\n            default:\n                break;\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendEventListenerTouchOneByOne(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.EventListenerTouchOneByOne\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"create\", tolua_cocos2dx_EventListenerTouchOneByOne_create);\n        tolua_function(tolua_S, \"registerScriptHandler\", tolua_cocos2dx_EventListenerTouchOneByOne_registerScriptHandler);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2dx_EventListenerTouchAllAtOnce_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S, 1, \"cc.EventListenerTouchAllAtOnce\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 0)\n    {\n        cocos2d::EventListenerTouchAllAtOnce* tolua_ret = cocos2d::EventListenerTouchAllAtOnce::create();\n        if(nullptr == tolua_ret)\n            return 0;\n\n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.EventListenerTouchAllAtOnce\");\n        \n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_EventListenerTouchAllAtOnce_registerScriptHandler(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    EventListenerTouchAllAtOnce* self = nullptr;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S, 1, \"cc.EventListenerTouchAllAtOnce\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    self = static_cast<EventListenerTouchAllAtOnce*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_EventListenerTouchAllAtOnce_registerScriptHandler'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::HandlerType type        = static_cast<ScriptHandlerMgr::HandlerType>((int)tolua_tonumber(tolua_S, 3, 0));\n        switch (type)\n        {\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_BEGAN:\n                {\n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                \n                    self->onTouchesBegan = [=](const std::vector<Touch*>& touches, Event* event){\n                        LuaEventTouchesData touchesData(touches, event);\n                        BasicScriptData data((void*)self,(void*)&touchesData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_MOVED:\n            {\n                self->onTouchesMoved = [=](const std::vector<Touch*>& touches, Event* event){\n                    LuaEventTouchesData touchesData(touches, event);\n                    BasicScriptData data((void*)self,(void*)&touchesData);\n                    LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                };\n                \n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n            }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_ENDED:\n            {\n                self->onTouchesEnded = [=](const std::vector<Touch*>& touches, Event* event){\n                    LuaEventTouchesData touchesData(touches, event);\n                    BasicScriptData data((void*)self,(void*)&touchesData);\n                    LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                };\n                \n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n            }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_TOUCHES_CANCELLED:\n            {\n                self->onTouchesCancelled = [=](const std::vector<Touch*>& touches, Event* event){\n                    LuaEventTouchesData touchesData(touches, event);\n                    BasicScriptData data((void*)self,(void*)&touchesData);\n                    LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                };\n                \n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n            }\n                break;\n            default:\n                break;\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendEventListenerTouchAllAtOnce(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.EventListenerTouchAllAtOnce\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"create\", tolua_cocos2dx_EventListenerTouchAllAtOnce_create);\n        tolua_function(tolua_S, \"registerScriptHandler\", tolua_cocos2dx_EventListenerTouchAllAtOnce_registerScriptHandler);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2dx_EventListenerMouse_create(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(tolua_S, 1, \"cc.EventListenerMouse\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1)\n    {\n        cocos2d::EventListenerMouse* tolua_ret = cocos2d::EventListenerMouse::create();\n        if(nullptr == tolua_ret)\n            return 0;\n\n        int ID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* luaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tolua_ret,\"cc.EventListenerMouse\");\n        \n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'create'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_cocos2dx_EventListenerMouse_registerScriptHandler(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    EventListenerMouse* self = nullptr;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S, 1, \"cc.EventListenerMouse\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    self = static_cast<EventListenerMouse*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_EventListenerMouse_registerScriptHandler'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::HandlerType type = static_cast<ScriptHandlerMgr::HandlerType>((int)tolua_tonumber(tolua_S, 3, 0) ) ;\n        \n        switch (type)\n        {\n            case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_DOWN:\n                {\n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                \n                    self->onMouseDown = [=](Event* event){\n                        LuaEventMouseData mouseData(event);\n                        BasicScriptData data((void*)self,(void*)&mouseData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_UP:\n                {\n                    self->onMouseUp = [=](Event* event){\n                        LuaEventMouseData mouseData(event);\n                        BasicScriptData data((void*)self,(void*)&mouseData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                \n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_MOVE:\n                {\n                    self->onMouseMove = [=](Event* event){\n                        LuaEventMouseData mouseData(event);\n                        BasicScriptData data((void*)self,(void*)&mouseData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                \n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_MOUSE_SCROLL:\n                {\n                    self->onMouseScroll = [=](Event* event){\n                        LuaEventMouseData mouseData(event);\n                        BasicScriptData data((void*)self,(void*)&mouseData);\n                        LuaEngine::getInstance()->handleEvent(type, (void*)&data);\n                    };\n                \n                    ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                }\n                break;\n            default:\n                break;\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic void extendEventListenerMouse(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.EventListenerMouse\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"create\", tolua_cocos2dx_EventListenerMouse_create);\n        tolua_function(tolua_S, \"registerScriptHandler\", tolua_cocos2dx_EventListenerMouse_registerScriptHandler);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2dx_ActionCamera_reverse(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    cocos2d::ActionCamera* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.ActionCamera\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::ActionCamera*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'tolua_cocos2dx_ActionCamera_reverse'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        cocos2d::ActionCamera* reverse = cobj->reverse();\n        toluafix_pushusertype_ccobject(tolua_S, reverse->_ID, &(reverse->_luaID), (void*)(reverse),\"cc.ActionCamera\");\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reverse\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'tolua_cocos2dx_ActionCamera_reverse'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nstatic void extendActionCamera(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.ActionCamera\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"reverse\", tolua_cocos2dx_ActionCamera_reverse);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic int tolua_cocos2dx_GridAction_reverse(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    cocos2d::GridAction* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.GridAction\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::GridAction*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'tolua_cocos2dx_GridAction_reverse'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        cocos2d::GridAction* reverse = cobj->reverse();\n        toluafix_pushusertype_ccobject(tolua_S, reverse->_ID, &(reverse->_luaID), (void*)(reverse),\"cc.GridAction\");\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"reverse\",argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'tolua_cocos2dx_GridAction_reverse'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nstatic void extendGridAction(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.GridAction\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"reverse\", tolua_cocos2dx_GridAction_reverse);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nstatic bool luaval_to_TTFConfig(lua_State* L,int lo, TTFConfig* ret)\n{\n    if (nullptr == ret)\n        return false;\n    \n    bool ok = true;\n    \n    tolua_Error tolua_err;\n    if (!tolua_istable(L, lo, 0, &tolua_err) )\n    {\n#if COCOS2D_DEBUG >=1\n        luaval_to_native_err(L,\"#ferror:\",&tolua_err);\n#endif\n        ok = false;\n    }\n    \n    if (ok)\n    {\n        lua_pushstring(L, \"fontFilePath\");         /* L: paramStack key */\n        lua_gettable(L,lo);                        /* L: paramStack paramStack[lo][key] */\n        ret->fontFilePath = lua_isstring(L, -1)? lua_tostring(L, -1) : \"\";\n        lua_pop(L,1);                              /* L: paramStack*/\n        \n        lua_pushstring(L, \"fontSize\");\n        lua_gettable(L,lo);\n        ret->fontSize = lua_isnumber(L, -1)?(int)lua_tointeger(L, -1) : 0;\n        lua_pop(L,1);\n        \n        lua_pushstring(L, \"glyphs\");\n        lua_gettable(L, lo);\n        ret->glyphs = lua_isnumber(L, -1)?static_cast<GlyphCollection>(lua_tointeger(L, -1)) : GlyphCollection::NEHE;\n        lua_pop(L, 1);\n        \n        lua_pushstring(L, \"customGlyphs\");\n        lua_gettable(L, lo);\n        ret->customGlyphs = lua_isstring(L, -1)?lua_tostring(L, -1) : \"\";\n        lua_pop(L, 1);\n        \n        lua_pushstring(L, \"distanceFieldEnabled\");\n        lua_gettable(L, lo);\n        ret->distanceFieldEnabled = lua_isboolean(L, -1)?lua_toboolean(L, -1) : false;\n        lua_pop(L, 1);\n        \n        return true;\n    }\n    \n    return false;\n}\n\nstatic int lua_cocos2dx_Label_createWithTTF00(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    bool ok = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertable(L,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (argc >= 2 && argc <= 4)\n    {\n        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_istable(L, 2, 0, &tolua_err)  ||\n            !tolua_isstring(L, 3, 0, &tolua_err) ||\n            !tolua_isnumber(L, 4, 1, &tolua_err) ||\n            !tolua_isnumber(L, 5, 1, &tolua_err) )\n        {\n            goto tolua_lerror;\n        }\n#endif\n        TTFConfig ttfConfig(\"\");\n        std::string text = \"\";\n\n        ok &= luaval_to_TTFConfig(L, 2, &ttfConfig);\n        if (!ok)\n            return 0;\n        \n        ok &= luaval_to_std_string(L, 3, &text);\n        if (!ok)\n            return 0;\n        \n        \n        int alignment = tolua_tonumber(L, 4, 1);\n        int lineSize  = tolua_tonumber(L, 5, 0);\n        cocos2d::Label* ret = cocos2d::Label::createWithTTF(ttfConfig, text, static_cast<TextHAlignment>(alignment), lineSize);\n        int ID = ret ? (int)(ret->_ID) : -1;\n        int* luaID = ret ? &(ret->_luaID) : nullptr;\n        toluafix_pushusertype_ccobject(L,ID, luaID, (void*)ret,\"cc.Label\");\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"create\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_Label_createWithTTF'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nstatic int lua_cocos2dx_Label_setTTFConfig(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    int argc = 0;\n    cocos2d::Label* self = nullptr;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n\ttolua_Error tolua_err;\n\tif (!tolua_isusertype(L,1,\"cc.Label\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = static_cast<cocos2d::Label*>(tolua_tousertype(L, 1, 0));\n    \n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n\t\ttolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_Label_setTTFConfig'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    if(1 == argc)\n    {\n        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_istable(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        TTFConfig ttfConfig(\"\");\n        ok &= luaval_to_TTFConfig(L, 2, &ttfConfig);\n        if (!ok)\n            return 0;\n        \n        self->setTTFConfig(ttfConfig);\n        return 1;\n    }\n    \n    CCLOG(\"'create' has wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n\treturn 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'setTTFConfig'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_Label_createWithTTF01(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n    \n    tolua_Error tolua_err;\n    \n    if (!tolua_isusertable(L, 1, \"cc.Label\", 0, &tolua_err) ||\n        !tolua_isstring(L, 2, 0, &tolua_err) ||\n        !tolua_isstring(L, 3, 0, &tolua_err) ||\n        !tolua_isnumber(L, 4, 0, &tolua_err) ||\n        !tolua_isnumber(L, 5, 1, &tolua_err) ||\n        !tolua_isnumber(L, 6, 1, &tolua_err) ||\n        !tolua_isnumber(L, 7, 1, &tolua_err) ||\n        !tolua_isstring(L, 8, 1, &tolua_err) ||\n        !tolua_isboolean(L, 9, 1, &tolua_err)\n        )\n        goto tolua_lerror;\n    else\n    {\n        CCLOG(\"The createWithTTF(text, ...) was deprecated,please use create createWithTTF(ttfConfig, ...) instead\");\n        std::string text = tolua_tostring(L, 2, \"\");\n        std::string fontFilePath = tolua_tostring(L, 3, \"\");\n        int fontSize = (int)tolua_tonumber(L, 4, 0);\n        int lineSize = (int)tolua_tonumber(L, 5, 0);\n        TextHAlignment alignment = static_cast<TextHAlignment>((int)tolua_tonumber(L, 6, 1));\n        GlyphCollection glyphs   = static_cast<GlyphCollection>((int)tolua_tonumber(L, 7, 1));\n        const char* customGlyphs = tolua_tostring(L, 8, \"\");\n        bool useDistanceField = tolua_toboolean(L, 9, false);\n        \n        TTFConfig ttfConfig(fontFilePath.c_str(), fontSize, glyphs, customGlyphs, useDistanceField);\n        \n        cocos2d::Label* ret = cocos2d::Label::createWithTTF(ttfConfig, text,alignment, lineSize);\n        int ID = ret ? (int)(ret->_ID) : -1;\n        int* luaID = ret ? &(ret->_luaID) : nullptr;\n        toluafix_pushusertype_ccobject(L,ID, luaID, (void*)ret,\"cc.Label\");\n        return 1;\n    }\ntolua_lerror:\n    return lua_cocos2dx_Label_createWithTTF00(L);\n}\n\nstatic void extendLabel(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.Label\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"createWithTTF\", lua_cocos2dx_Label_createWithTTF00);\n        tolua_function(tolua_S, \"setTTFConfig\",  lua_cocos2dx_Label_setTTFConfig);\n        tolua_function(tolua_S, \"createWithTTF\", lua_cocos2dx_Label_createWithTTF01);\n    }\n    lua_pop(tolua_S, 1);\n}\n\nint register_all_cocos2dx_manual(lua_State* tolua_S)\n{\n    if (NULL == tolua_S)\n        return 0;\n    \n    extendNode(tolua_S);\n    extendLayer(tolua_S);\n    extendMenuItem(tolua_S);\n    extendMenuItemImage(tolua_S);\n    extendMenuItemLabel(tolua_S);\n    extendMenuItemFont(tolua_S);\n    extendMenuItemSprite(tolua_S);\n    extendMenuItemToggle(tolua_S);\n    extendMenu(tolua_S);\n    extendScheduler(tolua_S);\n    extendSequence(tolua_S);\n    extendCallFunc(tolua_S);\n    extendSpawn(tolua_S);\n    extendCardinalSplineBy(tolua_S);\n    extendCatmullRomBy(tolua_S);\n    extendCatmullRomTo(tolua_S);\n    extendBezierBy(tolua_S);\n    extendBezierTo(tolua_S);\n    extendDrawNode(tolua_S);\n    extendSprite(tolua_S);\n    extendLayerColor(tolua_S);\n    extendLayerMultiplex(tolua_S);\n    extendParticleSystem(tolua_S);\n    extendFileUtils(tolua_S);\n    extendUserDefault(tolua_S);\n    extendGLProgram(tolua_S);\n    extendTexture2D(tolua_S);\n    extendSpriteBatchNode(tolua_S);\n    extendEventListenerKeyboard(tolua_S);\n    extendEventListenerTouchOneByOne(tolua_S);\n    extendEventListenerTouchAllAtOnce(tolua_S);\n    extendEventListenerMouse(tolua_S);\n    extendEventListenerCustom(tolua_S);\n    extendEventListenerAcceleration(tolua_S);\n    extendActionCamera(tolua_S);\n    extendGridAction(tolua_S);\n    \n    extendMotionStreak(tolua_S);\n    extendAtlasNode(tolua_S);\n    extendParticleBatchNode(tolua_S);\n    extendLabel(tolua_S);\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H\n#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"cocos2d.h\"\n#include \"LuaScriptHandlerMgr.h\"\n\nNS_CC_BEGIN\nclass LuaEventListenerCustom\n{\npublic:\n    static EventListenerCustom* create(const std::string& eventName);\n};\n\nclass LuaEventListenerAcceleration\n{\npublic:\n    static EventListenerAcceleration* create();\n};\nNS_CC_END\n\nUSING_NS_CC;\n\nTOLUA_API int register_all_cocos2dx_manual(lua_State* tolua_S);\n\nTOLUA_API int register_cocos2dx_event_releated(lua_State* tolua_S);\n\nstruct LuaEventAccelerationData\n{\n    void* acc;\n    Event* event;\n    \n    LuaEventAccelerationData(void* inAcc,Event* inEvent)\n    :acc(inAcc),event(inEvent)\n    {\n    }\n};\n\nstruct LuaEventKeyboarData\n{\n    int keyCode;\n    Event* event;\n    \n    LuaEventKeyboarData(int inKeyCode,Event* inEvent)\n    :keyCode(inKeyCode),event(inEvent)\n    {\n    }\n};\n\nstruct LuaEventTouchData\n{\n    Touch* touch;\n    Event* event;\n    \n    LuaEventTouchData(Touch* inTouch, Event* inEvent)\n    :touch(inTouch),\n    event(inEvent)\n    {\n    }\n};\n\nstruct LuaEventTouchesData\n{\n    std::vector<Touch*> touches;\n    Event* event;\n    \n    LuaEventTouchesData(std::vector<Touch*> inTouches, Event* inEvent)\n    :touches(inTouches),\n    event(inEvent)\n    {\n    }\n};\n\nstruct LuaEventMouseData\n{\n    Event* event;\n    \n    LuaEventMouseData(Event* inEvent)\n    :event(inEvent)\n    {\n    }\n};\n\n#endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_MANUAL_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp",
    "content": "#include \"lua_cocos2dx_manual.hpp\"\n\n#if CC_USE_PHYSICS\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"LuaBasicConversions.h\"\n#include \"CCLuaValue.h\"\n#include \"CCLuaEngine.h\"\n\n#ifndef CC_SAFE_FREE\n#define CC_SAFE_FREE(p) { if(p) free(p); p = nullptr; }\n#endif\n\nint lua_cocos2dx_physics_PhysicsBody_getJoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsBody* cobj = nullptr;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsBody*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsBody_getJoints'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        do {\n            \n            if(!ok)\n                return 0;\n            auto& ret = cobj->getJoints();\n            \n            lua_newtable(tolua_S);\n            \n            if (ret.empty())\n                return 1;\n            \n            auto iter = ret.begin();\n            int  indexTable = 1;\n            for (; iter != ret.end(); ++iter)\n            {\n                if (nullptr == *iter)\n                    continue;\n                \n\t\t\t\tstd::string hashName = typeid(*iter).name();\n\t\t\t\tauto name = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(name != g_luaType.end()){\n\t\t\t\t\tclassName = name->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsJoint\";\n\t\t\t\t}\n                \n                lua_pushnumber(tolua_S, (lua_Number)indexTable);\n                tolua_pushusertype(tolua_S,(void*)(*iter), className.c_str());\n                lua_rawset(tolua_S, -3);\n                ++indexTable;\n            }\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getJoints\",argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_getJoints'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsWorld_getScene(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_getScene'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        if(!ok)\n            return 0;\n        cocos2d::Scene& ret = cobj->getScene();\n        do {\n            \n            std::string hashName = typeid(ret).name();\n            auto iter = g_luaType.find(hashName);\n            std::string className = \"\";\n            if(iter != g_luaType.end()){\n                className = iter->second.c_str();\n            } else {\n                className = \"cc.Scene\";\n            }\n            \n            int ID =  (int)(ret._ID);\n            int* luaID = &(ret._luaID);\n            toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)(&ret),className.c_str());\n            \n        }while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getScene\",argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_getScene'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\n\nint lua_cocos2dx_physics_PhysicsWorld_rayCast(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 3)\n    {\n        std::function<bool (cocos2d::PhysicsWorld &, const cocos2d::PhysicsRayCastInfo &, void *)> arg0;\n        cocos2d::Point arg1;\n        cocos2d::Point arg2;\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);\n        do {\n            arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, const cocos2d::PhysicsRayCastInfo &info, void * data) -> bool\n            {\n                std::string hashName = typeid(&world).name();\n                auto iter = g_luaType.find(hashName);\n                std::string className = \"\";\n                if(iter != g_luaType.end()){\n                    className = iter->second.c_str();\n                } else {\n                    className = \"cc.PhysicsWorld\";\n                }\n                \n                tolua_pushusertype(tolua_S, (void*)(&world), className.c_str());\n                physics_raycastinfo_to_luaval(tolua_S, info);\n                return LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2);\n            };\n\t\t} while(0);\n        \n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        ok &= luaval_to_point(tolua_S, 4, &arg2);\n        if(!ok)\n            return 0;\n        cobj->rayCast(arg0, arg1, arg2, nullptr);\n        toluafix_remove_function_by_refid(tolua_S, handler);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"rayCast\",argc, 4);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_rayCast'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\nint lua_cocos2dx_physics_PhysicsWorld_queryRect(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_queryRect'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2)\n    {\n        std::function<bool (cocos2d::PhysicsWorld &, cocos2d::PhysicsShape &, void *)> arg0;\n        cocos2d::Rect arg1;\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);\n        do {\n            arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool\n            {\n                std::string hashName = typeid(&world).name();\n                auto iter = g_luaType.find(hashName);\n                std::string className = \"\";\n                if(iter != g_luaType.end()){\n                    className = iter->second.c_str();\n                } else {\n                    className = \"cc.PhysicsWorld\";\n                }\n                \n                tolua_pushusertype(tolua_S, (void*)(&world), className.c_str());\n                \n                hashName = typeid(&shape).name();\n                iter = g_luaType.find(hashName);\n                className = \"\";\n                if(iter != g_luaType.end()){\n                    className = iter->second.c_str();\n                } else {\n                    className = \"cc.PhysicsShape\";\n                }\n                toluafix_pushusertype_ccobject(tolua_S, shape._ID, &shape._luaID, (void*)(&shape), className.c_str());\n                return LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2);\n            };\n\t\t} while(0);\n        \n        ok &= luaval_to_rect(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->queryRect(arg0, arg1, nullptr);\n        toluafix_remove_function_by_refid(tolua_S, handler);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"queryRect\",argc, 3);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_queryRect'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\n\nint lua_cocos2dx_physics_PhysicsWorld_queryPoint(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsWorld* cobj = nullptr;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsWorld\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsWorld*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsWorld_queryPoint'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 2)\n    {\n        std::function<bool (cocos2d::PhysicsWorld &, cocos2d::PhysicsShape &, void *)> arg0;\n        cocos2d::Point arg1;\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 2, 0);\n        do {\n            arg0 = [handler, tolua_S](cocos2d::PhysicsWorld &world, cocos2d::PhysicsShape &shape, void * data) -> bool\n            {\n                std::string hashName = typeid(&world).name();\n                auto iter = g_luaType.find(hashName);\n                std::string className = \"\";\n                if(iter != g_luaType.end()){\n                    className = iter->second.c_str();\n                } else {\n                    className = \"cc.PhysicsWorld\";\n                }\n                \n                tolua_pushusertype(tolua_S, (void*)(&world), className.c_str());\n                \n                hashName = typeid(&shape).name();\n                iter = g_luaType.find(hashName);\n                className = \"\";\n                if(iter != g_luaType.end()){\n                    className = iter->second.c_str();\n                } else {\n                    className = \"cc.PhysicsShape\";\n                }\n                toluafix_pushusertype_ccobject(tolua_S, shape._ID, &shape._luaID, (void*)(&shape), className.c_str());\n                return LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2);\n            };\n\t\t\tassert(false);\n\t\t} while(0)\n            ;\n        ok &= luaval_to_point(tolua_S, 3, &arg1);\n        if(!ok)\n            return 0;\n        cobj->queryPoint(arg0, arg1, nullptr);\n        toluafix_remove_function_by_refid(tolua_S, handler);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"queryPoint\",argc, 3);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsWorld_queryPoint'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsBody_createPolygon(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1)\n    {\n        cocos2d::Point* arg0 = nullptr;\n        int arg1 = 0;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Point* arg0;\n        int arg1 = 0;\n        cocos2d::PhysicsMaterial arg2;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Point* arg0;\n        int arg1 = 0;\n        cocos2d::PhysicsMaterial arg2;\n        cocos2d::Point arg3;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);\n        ok &= luaval_to_point(tolua_S, 4, &arg3);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createPolygon(arg0, arg1, arg2, arg3);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createPolygon\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createPolygon'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsBody_createEdgePolygon(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1)\n    {\n        cocos2d::Point* arg0;\n        int arg1;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        double arg3;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);\n        ok &= luaval_to_number(tolua_S, 4,&arg3);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgePolygon(arg0, arg1, arg2, arg3);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createEdgePolygon\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgePolygon'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsBody_createEdgeChain(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsBody\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1)\n    {\n        cocos2d::Point* arg0;\n        int arg1;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    if (argc == 3)\n    {\n        cocos2d::Point* arg0;\n        int arg1;\n        cocos2d::PhysicsMaterial arg2;\n        double arg3;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        ok &= luaval_to_physics_material(tolua_S, 3, &arg2);\n        ok &= luaval_to_number(tolua_S, 4,&arg3);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsBody* ret = cocos2d::PhysicsBody::createEdgeChain(arg0, arg1, arg2, arg3);\n        CC_SAFE_FREE(arg0);\n        do {\n\t\t\tif (NULL != ret){\n\t\t\t\tstd::string hashName = typeid(*ret).name();\n\t\t\t\tauto iter = g_luaType.find(hashName);\n\t\t\t\tstd::string className = \"\";\n\t\t\t\tif(iter != g_luaType.end()){\n\t\t\t\t\tclassName = iter->second.c_str();\n\t\t\t\t} else {\n\t\t\t\t\tclassName = \"cc.PhysicsBody\";\n\t\t\t\t}\n\t\t\t\tcocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((cocos2d::PhysicsBody*)ret);\n\t\t\t\tif (NULL != dynObject) {\n\t\t\t\t\tint ID = ret ? (int)(dynObject->_ID) : -1;\n\t\t\t\t\tint* luaID = ret ? &(dynObject->_luaID) : NULL;\n\t\t\t\t\ttoluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)ret,className.c_str());\n\t\t\t\t} else {\n                    tolua_pushusertype(tolua_S,(void*)ret,className.c_str());\n                }} else {\n                    lua_pushnil(tolua_S);\n                }\n\t\t} while (0);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"createEdgeChain\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsBody_createEdgeChain'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsShape_recenterPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1)\n    {\n        cocos2d::Point* arg0;\n        int arg1 = 0;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsShape::recenterPoints(arg0, arg1);\n        points_to_luaval(tolua_S, arg0, arg1);\n        CC_SAFE_FREE(arg0);\n        \n        return 0;\n    }\n    if (argc == 2)\n    {\n        cocos2d::Point* arg0;\n        int arg1 = 0;\n        cocos2d::Point arg2;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        ok &= luaval_to_point(tolua_S, 3, &arg2);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::PhysicsShape::recenterPoints(arg0, arg1, arg2);\n        points_to_luaval(tolua_S, arg0, arg1);\n        CC_SAFE_FREE(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"recenterPoints\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_recenterPoints'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsShape_getPolyonCenter(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"cc.PhysicsShape\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 1)\n    {\n        cocos2d::Point* arg0;\n        int arg1 = 0;\n        do {\n            ok = luaval_to_array_of_Point(tolua_S, 2, &arg0, &arg1);\n            if (nullptr == arg0){\n                LUA_PRECONDITION( arg0, \"Invalid Native Object\");\n            }} while (0);\n        if(!ok)\n        {\n            CC_SAFE_FREE(arg0);\n            return 0;\n        }\n        cocos2d::Point ret = cocos2d::PhysicsShape::getPolyonCenter(arg0, arg1);\n        CC_SAFE_FREE(arg0);\n        point_to_luaval(tolua_S, ret);\n        return 1;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"getPolyonCenter\",argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShape_getPolyonCenter'.\",&tolua_err);\n#endif\n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeBox_getPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeBox* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsShapeBox*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPoints'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        cocos2d::Point arg0[4];\n        cobj->getPoints(arg0);\n        points_to_luaval(tolua_S, arg0, 4);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPoints\",argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeBox_getPoints'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsShapePolygon_getPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapePolygon* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsShapePolygon*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoints'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        int count = cobj->getPointsCount();\n        cocos2d::Point* arg0 = new cocos2d::Point[count];\n        cobj->getPoints(arg0);\n        points_to_luaval(tolua_S, arg0, count);\n        CC_SAFE_FREE(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPoints\",argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapePolygon_getPoints'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgeBox* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgeBox\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsShapeEdgeBox*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        int count = cobj->getPointsCount();\n        cocos2d::Point* arg0 = new cocos2d::Point[count];\n        cobj->getPoints(arg0);\n        points_to_luaval(tolua_S, arg0, count);\n        CC_SAFE_FREE(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPoints\",argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgePolygon* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgePolygon\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsShapeEdgePolygon*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        int count = cobj->getPointsCount();\n        cocos2d::Point* arg0 = new cocos2d::Point[count];\n        cobj->getPoints(arg0);\n        points_to_luaval(tolua_S, arg0, count);\n        CC_SAFE_FREE(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPoints\",argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\nint lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints(lua_State* tolua_S)\n{\n    int argc = 0;\n    cocos2d::PhysicsShapeEdgeChain* cobj = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"cc.PhysicsShapeEdgeChain\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    cobj = (cocos2d::PhysicsShapeEdgeChain*)tolua_tousertype(tolua_S,1,0);\n    \n#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints'\", NULL);\n        return 0;\n    }\n#endif\n    \n    argc = lua_gettop(tolua_S)-1;\n    if (argc == 0)\n    {\n        int count = cobj->getPointsCount();\n        cocos2d::Point* arg0 = new cocos2d::Point[count];\n        cobj->getPoints(arg0);\n        points_to_luaval(tolua_S, arg0, count);\n        CC_SAFE_FREE(arg0);\n        return 0;\n    }\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"getPoints\",argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints'.\",&tolua_err);\n#endif\n    \n    return 0;\n}\n\nstatic int tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler(lua_State* tolua_S)\n{\n    if (nullptr == tolua_S)\n        return 0;\n    \n    int argc = 0;\n    EventListenerPhysicsContact* self = nullptr;\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S, 1, \"cc.EventListenerPhysicsContact\", 0, &tolua_err))  goto tolua_lerror;\n#endif\n    \n    self = static_cast<EventListenerPhysicsContact*>(tolua_tousertype(tolua_S,1,0));\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self) {\n\t\ttolua_error(tolua_S,\"invalid 'self' in function 'tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler'\\n\", nullptr);\n\t\treturn 0;\n\t}\n#endif\n    argc = lua_gettop(tolua_S) - 1;\n    \n    if (argc == 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n            !tolua_isnumber(tolua_S, 3, 0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        LUA_FUNCTION handler = toluafix_ref_function(tolua_S,2,0);\n        ScriptHandlerMgr::HandlerType type        = static_cast<ScriptHandlerMgr::HandlerType>((int)tolua_tonumber(tolua_S, 3, 0));\n        switch (type)\n        {\n            case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_BEGIN:\n            {\n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                \n                self->onContactBegin = [handler](EventCustom* event, const PhysicsContact& contact) -> bool{\n                    LuaStack* stack = LuaEngine::getInstance()->getLuaStack();\n                    stack->pushObject(event, \"cc.EventCustom\");\n                    stack->pushObject(const_cast<PhysicsContact*>(&contact), \"cc.PhysicsContact\");\n                    bool ret = stack->executeFunctionByHandler(handler, 2);\n                    stack->clean();\n                    \n                    return ret;\n                };\n            }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_PRESOLVE:\n            {\n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                \n                self->onContactPreSolve = [handler](EventCustom* event, const PhysicsContact& contact, const PhysicsContactPreSolve& solve) -> bool{\n                    LuaStack* stack = LuaEngine::getInstance()->getLuaStack();\n                    stack->pushObject(event, \"cc.EventCustom\");\n                    stack->pushObject(const_cast<PhysicsContact*>(&contact), \"cc.PhysicsContact\");\n                    tolua_pushusertype(stack->getLuaState(), const_cast<PhysicsContactPreSolve*>(&solve), \"cc.PhysicsContactPreSolve\");\n                    bool ret = stack->executeFunctionByHandler(handler, 3);\n                    stack->clean();\n                    \n                    return ret;\n                };\n            }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_POSTSOLVE:\n            {\n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                \n                self->onContactPostSolve = [handler](EventCustom* event, const PhysicsContact& contact, const PhysicsContactPostSolve& solve){\n                    LuaStack* stack = LuaEngine::getInstance()->getLuaStack();\n                    stack->pushObject(event, \"cc.EventCustom\");\n                    stack->pushObject(const_cast<PhysicsContact*>(&contact), \"cc.PhysicsContact\");\n                    tolua_pushusertype(stack->getLuaState(), const_cast<PhysicsContactPostSolve*>(&solve), \"cc.PhysicsContactPostSolve\");\n                    stack->executeFunctionByHandler(handler, 3);\n                    stack->clean();\n                };\n            }\n                break;\n            case ScriptHandlerMgr::HandlerType::EVENT_PHYSICS_CONTACT_SEPERATE:\n            {\n                ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, type);\n                \n                self->onContactSeperate = [handler](EventCustom* event, const PhysicsContact& contact){\n                    LuaStack* stack = LuaEngine::getInstance()->getLuaStack();\n                    stack->pushObject(event, \"cc.EventCustom\");\n                    stack->pushObject(const_cast<PhysicsContact*>(&contact), \"cc.PhysicsContact\");\n                    stack->executeFunctionByHandler(handler, 2);\n                    stack->clean();\n                };\n            }\n                break;\n            default:\n                break;\n        }\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint register_all_cocos2dx_physics_manual(lua_State* tolua_S)\n{\n    lua_pushstring(tolua_S, \"cc.PhysicsBody\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getJoints\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_getJoints );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"createPolygon\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_createPolygon );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"createEdgeChain\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_createEdgeChain );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"createEdgePolygon\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsBody_createEdgePolygon );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.PhysicsShape\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"recenterPoints\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShape_recenterPoints );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"getPolyonCenter\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShape_getPolyonCenter );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.PhysicsShapeBox\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getPoints\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeBox_getPoints );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.PhysicsShapeEdgeBox\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getPoints\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeEdgeBox_getPoints );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.PhysicsShapePolygon\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getPoints\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapePolygon_getPoints );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.PhysicsShapeEdgePolygon\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getPoints\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeEdgePolygon_getPoints );\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.PhysicsShapeEdgeChain\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getPoints\");\n        lua_pushcfunction(tolua_S,lua_cocos2dx_physics_PhysicsShapeEdgeChain_getPoints);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.PhysicsWorld\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        lua_pushstring(tolua_S,\"getScene\");\n        lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_getScene );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"queryPoint\");\n        lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_queryPoint );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"queryRect\");\n        lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_queryRect );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S,\"rayCast\");\n        lua_pushcfunction(tolua_S, lua_cocos2dx_physics_PhysicsWorld_rayCast );\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"DEBUGDRAW_NONE\");\n        lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_NONE);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"DEBUGDRAW_SHAPE\");\n        lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_SHAPE);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"DEBUGDRAW_JOINT\");\n        lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_JOINT);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"DEBUGDRAW_CONTACT\");\n        lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_CONTACT);\n        lua_rawset(tolua_S,-3);\n        lua_pushstring(tolua_S, \"DEBUGDRAW_ALL\");\n        lua_pushnumber(tolua_S, PhysicsWorld::DEBUGDRAW_ALL);\n        lua_rawset(tolua_S,-3);\n    }\n    lua_pop(tolua_S, 1);\n    \n    lua_pushstring(tolua_S, \"cc.EventListenerPhysicsContact\");\n    lua_rawget(tolua_S, LUA_REGISTRYINDEX);\n    if (lua_istable(tolua_S,-1))\n    {\n        tolua_function(tolua_S, \"registerScriptHandler\", tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler);\n    }\n    lua_pop(tolua_S, 1);\n\n    tolua_constant(tolua_S, \"PHYSICS_INFINITY\", PHYSICS_INFINITY);\n    \n    return 0;\n}\n\n#endif"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.hpp",
    "content": "#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H\n#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H\n\n#if CC_USE_PHYSICS\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"cocos2d.h\"\n#include \"LuaScriptHandlerMgr.h\"\n\nint register_all_cocos2dx_physics_manual(lua_State* tolua_S);\n\n#endif // CC_USE_PHYSICS\n\n#endif // #ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_GENERATED_LUA_COCOS2DX_PHYSICS_MANUAL_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"lua_cocos2dx_spine_manual.hpp\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include  \"tolua_fix.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"cocos2d.h\"\n#include \"LuaBasicConversions.h\"\n#include \"LuaScriptHandlerMgr.h\"\n#include \"CCLuaValue.h\"\n#include \"spine.h\"\n#include \"spine-cocos2dx.h\"\n#include \"LuaSkeletonAnimation.h\"\n\nusing namespace spine;\n\n// setBlendFunc\ntemplate<class T>\nstatic int tolua_cocos2dx_setBlendFunc(lua_State* tolua_S,const char* className)\n{\n    if (NULL == tolua_S || NULL == className || strlen(className) == 0)\n        return 0;\n\n    int argc = 0;\n    T* self = nullptr;\n\n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(tolua_S,1,className,0,&tolua_err)) goto tolua_lerror;\n#endif\n\n    self = static_cast<T*>(tolua_tousertype(tolua_S,1,0));\n\n    argc = lua_gettop(tolua_S) - 1;\n    if (2 == argc)\n    {\n        GLenum src, dst;\n        if (!luaval_to_int32(tolua_S, 2, (int32_t*)&src))\n            return 0;\n\n        if (!luaval_to_int32(tolua_S, 3, (int32_t*)&dst))\n            return 0;\n\n        BlendFunc blendFunc = {src, dst};\n        self->setBlendFunc(blendFunc);\n        return 0;\n    }\n\n\n    CCLOG(\"'setBlendFunc' has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setBlendFunc'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int lua_cocos2dx_CCSkeletonAnimation_createWithFile(lua_State* L)\n{\n    if (nullptr == L)\n        return 0 ;\n    \n    int argc = 0;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\tif (!tolua_isusertable(L,1,\"sp.SkeletonAnimation\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (2 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(L, 2, 0, &tolua_err)  ||\n            !tolua_isstring(L, 3 ,0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        const char* skeletonDataFile = tolua_tostring(L, 2, \"\");\n        const char* atlasFile = tolua_tostring(L, 3, \"\");;\n        \n        auto tolua_ret = LuaSkeletonAnimation::createWithFile(skeletonDataFile, atlasFile);\n        \n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(L, nID, pLuaID, (void*)tolua_ret,\"sp.SkeletonAnimation\");\n        return 1;\n    } else if (3 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(L, 2, 0, &tolua_err)  ||\n            !tolua_isstring(L, 3 ,0, &tolua_err)  ||\n            !tolua_isnumber(L, 4 ,0, &tolua_err))\n        {\n            goto tolua_lerror;\n        }\n#endif\n        const char* skeletonDataFile = tolua_tostring(L, 2, \"\");\n        const char* atlasFile = tolua_tostring(L, 3, \"\");\n        LUA_NUMBER scale = tolua_tonumber(L, 4, 1);\n\n        auto tolua_ret = LuaSkeletonAnimation::createWithFile(skeletonDataFile, atlasFile, scale);\n\n        int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;\n        int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;\n        toluafix_pushusertype_ccobject(L, nID, pLuaID, (void*)tolua_ret,\"sp.SkeletonAnimation\");\n        return 1;\n    }\n    \n    CCLOG(\"'createWithFile' function of SkeletonAnimation has wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'createWithFile'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_Cocos2d_CCSkeletonAnimation_registerSpineEventHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err) ||\n        !toluafix_isfunction(tolua_S,2,\"LUA_FUNCTION\",0,&tolua_err) ||\n         !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n    \tLuaSkeletonAnimation* self    = (LuaSkeletonAnimation*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n            int handler = (  toluafix_ref_function(tolua_S,2,0));\n            ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, ScriptHandlerMgr::HandlerType::EVENT_SPINE);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'registerSpineEventHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nint tolua_Cocos2d_CCSkeletonAnimation_unregisterSpineEventHandler00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err) ||\n        !tolua_isnoobj(tolua_S,2,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n    \tLuaSkeletonAnimation* self    = (LuaSkeletonAnimation*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n            ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, ScriptHandlerMgr::HandlerType::EVENT_SPINE);\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'unregisterScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCSkeletonAnimation_setTimeScale00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err) ||\n        !tolua_isnumber(tolua_S,2,0,&tolua_err) ||\n         !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n    \tLuaSkeletonAnimation* self    = (LuaSkeletonAnimation*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n        \tLUA_NUMBER scale = tolua_tonumber(tolua_S, 2, 1);\n        \tself->timeScale = scale;\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setTimeScale'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCSkeletonAnimation_setDebugSlots00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,2,0,&tolua_err) ||\n         !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n    \tLuaSkeletonAnimation* self    = (LuaSkeletonAnimation*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n        \tbool debugSlots = tolua_toboolean(tolua_S, 2, 1);\n        \tself->debugSlots = debugSlots;\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setDebugSlots'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCSkeletonAnimation_setDebugBones00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,2,0,&tolua_err) ||\n         !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n    \tLuaSkeletonAnimation* self    = (LuaSkeletonAnimation*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n        \tbool debugBones = tolua_toboolean(tolua_S, 2, 1);\n        \tself->debugBones = debugBones;\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setDebugBones'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int tolua_Cocos2d_CCSkeletonAnimation_setPremultipliedAlpha00(lua_State* tolua_S)\n{\n#ifndef TOLUA_RELEASE\n    tolua_Error tolua_err;\n    if (\n        !tolua_isusertype(tolua_S,1,\"sp.SkeletonAnimation\",0,&tolua_err) ||\n        !tolua_isboolean(tolua_S,2,0,&tolua_err) ||\n         !tolua_isnoobj(tolua_S,3,&tolua_err)\n        )\n        goto tolua_lerror;\n    else\n#endif\n    {\n    \tLuaSkeletonAnimation* self    = (LuaSkeletonAnimation*)  tolua_tousertype(tolua_S,1,0);\n        if (NULL != self ) {\n        \tbool premultipliedAlpha = tolua_toboolean(tolua_S, 2, 1);\n        \tself->premultipliedAlpha = premultipliedAlpha;\n        }\n    }\n    return 0;\n#ifndef TOLUA_RELEASE\ntolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'setPremultipliedAlpha'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n\nstatic int tolua_spine_SkeletoneAnimation_setBlendFunc(lua_State* tolua_S)\n{\n    return tolua_cocos2dx_setBlendFunc<spine::SkeletonAnimation>(tolua_S,\"sp.SkeletonAnimation\");\n}\n\n\nstatic void extendCCSkeletonAnimation(lua_State* L)\n{\n    lua_pushstring(L, \"sp.SkeletonAnimation\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    if (lua_istable(L,-1))\n    {\n        tolua_function(L, \"create\", lua_cocos2dx_CCSkeletonAnimation_createWithFile);\n        tolua_function(L, \"registerSpineEventHandler\", tolua_Cocos2d_CCSkeletonAnimation_registerSpineEventHandler00);\n        tolua_function(L, \"unregisterSpineEventHandler\", tolua_Cocos2d_CCSkeletonAnimation_unregisterSpineEventHandler00);\n        tolua_function(L, \"setBlendFunc\", tolua_spine_SkeletoneAnimation_setBlendFunc);\n        tolua_function(L, \"setTimeScale\", tolua_Cocos2d_CCSkeletonAnimation_setTimeScale00);\n        tolua_function(L, \"setDebugSlots\", tolua_Cocos2d_CCSkeletonAnimation_setDebugSlots00);\n        tolua_function(L, \"setDebugBones\", tolua_Cocos2d_CCSkeletonAnimation_setDebugBones00);\n        tolua_function(L, \"setPremultipliedAlpha\", tolua_Cocos2d_CCSkeletonAnimation_setPremultipliedAlpha00);\n    }\n    lua_pop(L, 1);\n}\n\nint register_all_cocos2dx_spine_manual(lua_State* L)\n{\n    if (nullptr == L)\n        return 0;\n\n    extendCCSkeletonAnimation(L);\n    \n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.hpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_SPINE_MANUAL_H\n#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_SPINE_MANUAL_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include \"CCObject.h\"\n\nTOLUA_API int register_all_cocos2dx_spine_manual(lua_State* L);\n\n\n#endif // #ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_SPINE_MANUAL_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_extensions.c",
    "content": "\n#include \"lua_extensions.h\"\n\n#if __cplusplus\nextern \"C\" {\n#endif\n// socket\n#include \"socket/luasocket.h\"\n#include \"socket/mime.h\"\n#include \"socket/socket_scripts.h\"\n\nstatic luaL_Reg luax_exts[] = {\n    {\"socket.core\", luaopen_socket_core},\n    {\"mime.core\", luaopen_mime_core},\n    {NULL, NULL}\n};\n\nvoid luaopen_lua_extensions(lua_State *L)\n{\n    // load extensions\n    luaL_Reg* lib = luax_exts;\n    lua_getglobal(L, \"package\");\n    lua_getfield(L, -1, \"preload\");\n    for (; lib->func; lib++)\n    {\n        lua_pushcfunction(L, lib->func);\n        lua_setfield(L, -2, lib->name);\n    }\n    lua_pop(L, 2);\n\n    // load extensions script\n    luaopen_socket_scripts(L);\n}\n\n#if __cplusplus\n} // extern \"C\"\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_extensions.h",
    "content": "\n#ifndef __LUA_EXTRA_H_\n#define __LUA_EXTRA_H_\n\n#if defined(_USRDLL)\n    #define LUA_EXTENSIONS_DLL     __declspec(dllexport)\n#else         /* use a DLL library */\n    #define LUA_EXTENSIONS_DLL\n#endif\n\n#if __cplusplus\nextern \"C\" {\n#endif\n\n#include \"lauxlib.h\"\n\nvoid LUA_EXTENSIONS_DLL luaopen_lua_extensions(lua_State *L);\n    \n#if __cplusplus\n}\n#endif\n\n#endif /* __LUA_EXTRA_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_xml_http_request.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"lua_xml_http_request.h\"\n\nextern \"C\"\n{\n#include \"tolua_fix.h\"\n}\n\n#include <string>\n#include \"CCLuaStack.h\"\n#include \"CCLuaValue.h\"\n#include \"CCLuaEngine.h\"\n#include \"LuaScriptHandlerMgr.h\"\n\n\nusing namespace cocos2d;\nusing namespace std;\n\nLuaMinXmlHttpRequest::LuaMinXmlHttpRequest():_isNetwork(true)\n{\n    _httpHeader.clear();\n    _requestHeader.clear();\n    _withCredentialsValue = true;\n    _httpRequest  = new network::HttpRequest();\n}\n\nLuaMinXmlHttpRequest::~LuaMinXmlHttpRequest()\n{\n    _httpHeader.clear();\n    _requestHeader.clear();\n}\n\n/**\n *  @brief Implementation for header retrieving.\n *  @param header\n */\nvoid LuaMinXmlHttpRequest::_gotHeader(string header)\n{\n\t// Get Header and Set StatusText\n    // Split String into Tokens\n    char * cstr = new char [header.length()+1];\n    \n    // check for colon.\n    unsigned found_header_field = header.find_first_of(\":\");\n    \n    if (found_header_field != std::string::npos)\n    {\n        // Found a header field.\n        string http_field;\n        string http_value;\n        \n        http_field = header.substr(0,found_header_field);\n        http_value = header.substr(found_header_field+1, header.length());\n        \n        // Get rid of all \\n\n        if (!http_value.empty() && http_value[http_value.size() - 1] == '\\n') {\n        \thttp_value.erase(http_value.size() - 1);\n        }\n        \n        _httpHeader[http_field] = http_value;\n        \n    }\n    else\n    {\n        // Seems like we have the response Code! Parse it and check for it.\n        char * pch;\n        strcpy(cstr, header.c_str());\n        \n        pch = strtok(cstr,\" \");\n        while (pch != NULL)\n        {\n            \n            stringstream ss;\n            string val;\n            \n            ss << pch;\n            val = ss.str();\n            unsigned found_http = val.find(\"HTTP\");\n            \n            // Check for HTTP Header to set statusText\n            if (found_http != std::string::npos) {\n                \n                stringstream mystream;\n                \n                // Get Response Status\n                pch = strtok (NULL, \" \");\n                mystream << pch;\n                \n                pch = strtok (NULL, \" \");\n                mystream << \" \" << pch;\n                \n                _statusText = mystream.str();\n                \n            }\n            \n            pch = strtok (NULL, \" \");\n        }\n    }\n    \n    CC_SAFE_DELETE_ARRAY(cstr);\n}\n\n/**\n *  @brief Set Request header for next call.\n *  @param field  Name of the Header to be set.\n *  @param value  Value of the Headerfield\n */\nvoid LuaMinXmlHttpRequest::setRequestHeader(const char* field, const char* value)\n{\n    stringstream header_s;\n    stringstream value_s;\n    string header;\n    \n    map<string, string>::iterator iter = _requestHeader.find(field);\n    \n    // Concatenate values when header exists.\n    if (iter != _requestHeader.end())\n    {\n        value_s << iter->second << \",\" << value;\n    }\n    else\n    {\n        value_s << value;\n    }\n    \n    _requestHeader[field] = value_s.str();\n}\n\n/**\n * @brief  If headers has been set, pass them to curl.\n *\n */\nvoid LuaMinXmlHttpRequest::_setHttpRequestHeader()\n{\n    std::vector<string> header;\n    \n    for (auto it = _requestHeader.begin(); it != _requestHeader.end(); ++it)\n    {\n        const char* first = it->first.c_str();\n        const char* second = it->second.c_str();\n        size_t len = sizeof(char) * (strlen(first) + 3 + strlen(second));\n        char* test = (char*) malloc(len);\n        memset(test, 0,len);\n        \n        strcpy(test, first);\n        strcpy(test + strlen(first) , \": \");\n        strcpy(test + strlen(first) + 2, second);\n        \n        header.push_back(test);\n        \n        free(test);\n        \n    }\n    \n    if (!header.empty())\n    {\n        _httpRequest->setHeaders(header);\n    }\n    \n}\n\n/**\n * @brief   Send out request and fire callback when done.\n */\nvoid LuaMinXmlHttpRequest::_sendRequest()\n{\n    _httpRequest->setResponseCallback(this, httpresponse_selector(LuaMinXmlHttpRequest::handle_requestResponse));\n    network::HttpClient::getInstance()->send(_httpRequest);\n    _httpRequest->release();\n}\n\n\n/**\n *  @brief Callback for HTTPRequest. Handles the response and invokes Callback.\n *  @param sender   Object which initialized callback\n *  @param respone  Response object\n *  @js NA\n */\nvoid LuaMinXmlHttpRequest::handle_requestResponse(network::HttpClient *sender, network::HttpResponse *response)\n{\n    if (0 != strlen(response->getHttpRequest()->getTag()))\n    {\n        CCLOG(\"%s completed\", response->getHttpRequest()->getTag());\n    }\n    \n    int statusCode = response->getResponseCode();\n    char statusString[64] = {};\n    sprintf(statusString, \"HTTP Status Code: %d, tag = %s\", statusCode, response->getHttpRequest()->getTag());\n    \n    if (!response->isSucceed())\n    {\n        CCLOG(\"response failed\");\n        CCLOG(\"error buffer: %s\", response->getErrorBuffer());\n        return;\n    }\n    \n    // set header\n    std::vector<char> *headers = response->getResponseHeader();\n    \n    char* concatHeader = (char*) malloc(headers->size() + 1);\n    std::string header(headers->begin(), headers->end());\n    strcpy(concatHeader, header.c_str());\n    \n    std::istringstream stream(concatHeader);\n    std::string line;\n    while(std::getline(stream, line)) {\n        _gotHeader(line);\n    }\n\n    /** get the response data **/\n    std::vector<char> *buffer = response->getResponseData();\n    char* concatenated = (char*) malloc(buffer->size() + 1);\n    std::string s2(buffer->begin(), buffer->end());\n    strcpy(concatenated, s2.c_str());\n    \n    if (statusCode == 200)\n    {\n        //Succeeded\n        _status = 200;\n        _readyState = DONE;\n        _data << concatenated;\n        _dataSize = buffer->size();\n    }\n    else\n    {\n        _status = 0;\n    }\n    // Free Memory.\n    free((void*) concatHeader);\n    free((void*) concatenated);\n    \n    // call back lua function --TODO\n    int handler = cocos2d::ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this, cocos2d::ScriptHandlerMgr::HandlerType::XMLHTTPREQUEST_READY_STATE_CHANGE );\n    \n    if (0 != handler)\n    {\n        cocos2d::CommonScriptData data(handler,\"\");\n        cocos2d::ScriptEvent event(cocos2d::ScriptEventType::kCommonEvent,(void*)&data);\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n}\n\nvoid LuaMinXmlHttpRequest::getByteData(unsigned char* byteData)\n{\n    _data.read((char*)byteData, _dataSize);\n}\n\n/* function to regType */\nstatic void lua_reg_xml_http_request(lua_State* L)\n{\n    tolua_usertype(L, \"cc.XMLHttpRequest\");\n}\n\nstatic int lua_collect_xml_http_request (lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = (LuaMinXmlHttpRequest*) tolua_tousertype(L,1,0);\n    Mtolua_delete(self);\n    return 0;\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_constructor(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n#endif\n    \n    argc = lua_gettop(L)-1;\n    if (argc == 0)\n    {\n        self = new LuaMinXmlHttpRequest();\n        self->autorelease();\n        int ID =  self? (int)self->_ID : -1;\n        int* luaID = self? &self->_luaID : NULL;\n        toluafix_pushusertype_ccobject(L, ID, luaID, (void*)self, \"cc.XMLHttpRequest\");\n        return 1;\n    }\n    \n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"XMLHttpRequest\",argc, 0);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_constructor'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_responseType(lua_State* L)\n{    \n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_responseType'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    tolua_pushnumber(L, (lua_Number)self->getResponseType());\n    return 1;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_responseType'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_set_XMLHttpRequest_responseType(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_set_XMLHttpRequest_responseType'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {        \n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        int responseType = (int)tolua_tonumber(L,2,0);\n        \n        self->setResponseType((LuaMinXmlHttpRequest::ResponseType)responseType);\n        \n        return 0;\n    }\n    \n    CCLOG(\"'setResponseType' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_set_XMLHttpRequest_responseType'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_withCredentials(lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_withCredentials'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    tolua_pushboolean(L, self->getWithCredentialsValue());\n    return 1;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_withCredentials'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_set_XMLHttpRequest_withCredentials(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_set_XMLHttpRequest_withCredentials'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isboolean(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        self->setWithCredentialsValue((bool)tolua_toboolean(L, 2, 0));\n        return 0;\n    }\n    \n    CCLOG(\"'setWithCredentials' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_set_XMLHttpRequest_withCredentials'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_timeout(lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_timeout'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    tolua_pushnumber(L, (lua_Number)self->getTimeout());\n    return 1;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_timeout'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_set_XMLHttpRequest_timeout(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_set_XMLHttpRequest_timeout'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isnumber(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        self->setTimeout((unsigned)tolua_tonumber(L, 2, 0));\n        return 0;\n    }\n    \n    CCLOG(\"'setTimeout' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_set_XMLHttpRequest_timeout'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_readyState(lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_readyState'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    lua_pushinteger(L, (lua_Integer)self->getReadyState());\n    \n    return 1;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_readyState'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_status(lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_status'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    lua_pushinteger(L, (lua_Integer)self->getStatus());\n    \n    return 1;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_status'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_statusText(lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_statusText'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    lua_pushstring(L, self->getStatusText().c_str());\n    \n    return 1;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_statusText'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_responseText(lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_responseText'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    lua_pushstring(L, self->getDataStr().c_str());    \n    return 1;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_responseText'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_get_XMLHttpRequest_response(lua_State* L)\n{\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_get_XMLHttpRequest_response'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    if (self->getResponseType() == LuaMinXmlHttpRequest::ResponseType::JSON)\n    {\n        lua_pushstring(L, self->getDataStr().c_str());\n        return 1;\n    }\n    else if(self->getResponseType() == LuaMinXmlHttpRequest::ResponseType::ARRAY_BUFFER)\n    {\n        LuaStack *pStack = LuaEngine::getInstance()->getLuaStack();\n        if (NULL == pStack) {\n            return 0;\n        }\n        \n        lua_State *tolua_s = pStack->getLuaState();\n        if (NULL == tolua_s) {\n            return 0;\n        }\n        \n        int nRet = 0;\n        LuaValueArray array;\n        \n        uint8_t* tmpData = new uint8_t[self->getDataSize()];\n        if (nullptr == tmpData)\n        {\n            return 0;\n        }\n        \n        self->getByteData(tmpData);\n        \n        for (int i = 0 ; i < self->getDataSize(); i++)\n        {\n            LuaValue value = LuaValue::intValue(tmpData[i]);\n            array.push_back(value);\n        }\n        \n        pStack->pushLuaValueArray(array);\n        \n        CC_SAFE_DELETE_ARRAY(tmpData);\n        return 1;\n    }\n    else\n    {\n        lua_pushstring(L, self->getDataStr().c_str());\n        return 1;\n    }\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_get_XMLHttpRequest_response'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_open(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_XMLHttpRequest_open'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if ( argc >= 2)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(L, 2, 0, &tolua_err) ||\n            !tolua_isstring(L, 3, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        \n        std::string method = tolua_tostring(L, 2, \"\");\n        std::string url    = tolua_tostring(L, 3, \"\");\n        bool async = true;\n        if (argc > 2)\n        {\n#if COCOS2D_DEBUG >= 1\n            if (!tolua_isboolean(L, 4, 0, &tolua_err) )\n                goto tolua_lerror;\n#endif\n            async = tolua_toboolean(L, 4, 0);\n        }\n        \n        self->setUrl(url);\n        self->setMethod(method);\n        self->setReadyState(1);\n        self->setAsync(async);\n        \n        if (url.length() > 5 && url.compare(url.length() - 5, 5, \".json\") == 0 )\n        {\n            self->setResponseType(LuaMinXmlHttpRequest::ResponseType::JSON);\n        }\n        \n        if (nullptr != self->getHttpRequest())\n        {\n            if (method.compare(\"post\") == 0 || method.compare(\"POST\") == 0)\n            {\n                self->getHttpRequest()->setRequestType(network::HttpRequest::Type::POST);\n            }\n            else\n            {\n                self->getHttpRequest()->setRequestType(network::HttpRequest::Type::GET);\n            }\n            \n            self->getHttpRequest()->setUrl(url.c_str());\n            \n        }\n        \n        self->setIsNetWork(true);\n        self->setReadyState(LuaMinXmlHttpRequest::OPENED);\n\n        return 0;\n    }\n    \n    CCLOG(\"'open' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_open'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_send(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    //std::string data = \"\";\n    const char* data = NULL;\n    size_t size = 0;\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_XMLHttpRequest_send'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n\n    if ( 1 == argc )\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(L, 2, 0, &tolua_err))\n            goto tolua_lerror;\n#endif\n        //data = tolua_tostring(L, 2, \"\");\n        data = (const char*) lua_tolstring(L, 2, &size);\n    }\n    \n    if (size > 0 &&\n        (self->getMethod().compare(\"post\") == 0 || self->getMethod().compare(\"POST\") == 0) &&\n        nullptr != self->getHttpRequest())\n    {\n        self->getHttpRequest()->setRequestData(data,size);\n    }\n    \n    self->_setHttpRequestHeader();\n    self->_sendRequest();\n    return 0;\n    \n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_send'.\",&tolua_err);\n    return 0;\n#endif\n}\n\n/**\n * @brief abort function Placeholder!\n */\nstatic int lua_cocos2dx_XMLHttpRequest_abort(lua_State* L)\n{\n    return 0;\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_setRequestHeader(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    const char* field = \"\";\n    const char* value = \"\";\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_XMLHttpRequest_setRequestHeader'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if ( 2 == argc )\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(L, 2, 0, &tolua_err) ||\n            !tolua_isstring(L, 3, 0, &tolua_err) )\n            goto tolua_lerror;\n#endif\n        \n        field = tolua_tostring(L, 2, \"\");\n        value = tolua_tostring(L, 3, \"\");\n        self->setRequestHeader(field, value);\n        return 0;\n    }\n    \n    CCLOG(\"'setRequestHeader' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 2);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_setRequestHeader'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_getAllResponseHeaders(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n    stringstream responseheaders;\n    string responseheader = \"\";\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_XMLHttpRequest_getAllResponseHeaders'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if ( 0 == argc )\n    {\n        map<string, string> httpHeader = self->getHttpHeader();\n        \n        for (auto it = httpHeader.begin(); it != httpHeader.end(); ++it)\n        {\n            responseheaders << it->first << \": \"<< it->second << \"\\n\";\n        }\n        \n        responseheader = responseheaders.str();\n        tolua_pushstring(L, responseheader.c_str());\n        return 1;\n    }\n    \n    CCLOG(\"'getAllResponseHeaders' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_getAllResponseHeaders'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_getResponseHeader(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n    string responseheader = \"\";\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_XMLHttpRequest_getAllResponseHeaders'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if ( 1 == argc )\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!tolua_isstring(L, 2, 0, &tolua_err) )\n            goto tolua_lerror;\n#endif\n        responseheader = tolua_tostring(L, 2, \"\");\n        \n        stringstream streamData;\n        streamData << responseheader;\n        \n        string value = streamData.str();\n        \n        \n        auto iter = self->getHttpHeader().find(value);\n        if (iter != self->getHttpHeader().end())\n        {\n            tolua_pushstring(L, (iter->second).c_str());\n            return 1;\n        }\n    }\n    \n    CCLOG(\"'getResponseHeader' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_getAllResponseHeaders'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_registerScriptHandler(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n    string responseheader = \"\";\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_XMLHttpRequest_registerScriptHandler'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (1 == argc)\n    {\n#if COCOS2D_DEBUG >= 1\n        if (!toluafix_isfunction(L,2,\"LUA_FUNCTION\",0,&tolua_err))\n            goto tolua_lerror;\n#endif\n        \n        int handler = (  toluafix_ref_function(L,2,0));\n        cocos2d::ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, cocos2d::ScriptHandlerMgr::HandlerType::XMLHTTPREQUEST_READY_STATE_CHANGE);\n        return 0;\n    }\n    \n    CCLOG(\"'registerScriptHandler' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 1);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_registerScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n}\n\nstatic int lua_cocos2dx_XMLHttpRequest_unregisterScriptHandler(lua_State* L)\n{\n    int argc = 0;\n    LuaMinXmlHttpRequest* self = nullptr;\n    \n    string responseheader = \"\";\n    \n#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (!tolua_isusertype(L,1,\"cc.XMLHttpRequest\",0,&tolua_err)) goto tolua_lerror;\n#endif\n    \n    self = (LuaMinXmlHttpRequest*)  tolua_tousertype(L,1,0);\n#if COCOS2D_DEBUG >= 1\n    if (nullptr == self)\n    {\n        tolua_error(L,\"invalid 'self' in function 'lua_cocos2dx_XMLHttpRequest_unregisterScriptHandler'\\n\", nullptr);\n\t\treturn 0;\n    }\n#endif\n    \n    argc = lua_gettop(L) - 1;\n    \n    if (0 == argc)\n    {                \n        cocos2d::ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, cocos2d::ScriptHandlerMgr::HandlerType::XMLHTTPREQUEST_READY_STATE_CHANGE);\n        \n        return 0;\n    }\n    \n    CCLOG(\"'unregisterScriptHandler' function of XMLHttpRequest wrong number of arguments: %d, was expecting %d\\n\", argc, 0);\n    return 0;\n#if COCOS2D_DEBUG >= 1\ntolua_lerror:\n    tolua_error(L,\"#ferror in function 'lua_cocos2dx_XMLHttpRequest_unregisterScriptHandler'.\",&tolua_err);\n    return 0;\n#endif\n    \n}\n\n\nTOLUA_API int register_xml_http_request(lua_State* L)\n{\n    tolua_open(L);\n    lua_reg_xml_http_request(L);\n    tolua_module(L,\"cc\",0);\n    tolua_beginmodule(L,\"cc\");\n      tolua_cclass(L,\"XMLHttpRequest\",\"cc.XMLHttpRequest\",\"cc.Object\",lua_collect_xml_http_request);\n      tolua_beginmodule(L,\"XMLHttpRequest\");\n        tolua_variable(L, \"responseType\", lua_get_XMLHttpRequest_responseType, lua_set_XMLHttpRequest_responseType);\n        tolua_variable(L, \"withCredentials\", lua_get_XMLHttpRequest_withCredentials, lua_set_XMLHttpRequest_withCredentials);\n        tolua_variable(L, \"timeout\", lua_get_XMLHttpRequest_timeout, lua_set_XMLHttpRequest_timeout);\n        tolua_variable(L, \"readyState\", lua_get_XMLHttpRequest_readyState, nullptr);\n        tolua_variable(L, \"status\",lua_get_XMLHttpRequest_status,nullptr);\n        tolua_variable(L, \"statusText\", lua_get_XMLHttpRequest_statusText, nullptr);\n        tolua_variable(L, \"responseText\", lua_get_XMLHttpRequest_responseText, nullptr);\n        tolua_variable(L, \"response\", lua_get_XMLHttpRequest_response, nullptr);\n        tolua_function(L, \"new\", lua_cocos2dx_XMLHttpRequest_constructor);\n        tolua_function(L, \"open\", lua_cocos2dx_XMLHttpRequest_open);\n        tolua_function(L, \"send\", lua_cocos2dx_XMLHttpRequest_send);\n        tolua_function(L, \"abort\", lua_cocos2dx_XMLHttpRequest_abort);\n        tolua_function(L, \"setRequestHeader\", lua_cocos2dx_XMLHttpRequest_setRequestHeader);\n        tolua_function(L, \"getAllResponseHeaders\", lua_cocos2dx_XMLHttpRequest_getAllResponseHeaders);\n        tolua_function(L, \"getResponseHeader\", lua_cocos2dx_XMLHttpRequest_getResponseHeader);\n        tolua_function(L, \"registerScriptHandler\", lua_cocos2dx_XMLHttpRequest_registerScriptHandler);\n        tolua_function(L, \"unregisterScriptHandler\", lua_cocos2dx_XMLHttpRequest_unregisterScriptHandler);\n      tolua_endmodule(L);\n    tolua_endmodule(L);\n    return 1;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/lua_xml_http_request.h",
    "content": "/****************************************************************************\n Copyright (c) 2013-2014 Chukong Technologies Inc.\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#ifndef __COCOS_SCRIPTING_LUA_BINDINGS_LUA_XML_HTTP_REQUEST_H__\n#define __COCOS_SCRIPTING_LUA_BINDINGS_LUA_XML_HTTP_REQUEST_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include \"tolua++.h\"\n#ifdef __cplusplus\n}\n#endif\n\n#include <map>\n#include <sstream>\n\n#include \"network/HttpClient.h\"\n\nclass LuaMinXmlHttpRequest : public cocos2d::Object\n{\npublic:\n    enum class ResponseType\n    {\n        STRING,\n        ARRAY_BUFFER,\n        BLOB,\n        DOCUMENT,\n        JSON\n    };\n    \n    // Ready States (http://www.w3.org/TR/XMLHttpRequest/#interface-xmlhttprequest)\n    static const unsigned short UNSENT = 0;\n    static const unsigned short OPENED = 1;\n    static const unsigned short HEADERS_RECEIVED = 2;\n    static const unsigned short LOADING = 3;\n    static const unsigned short DONE = 4;\n    \n    LuaMinXmlHttpRequest();\n    ~LuaMinXmlHttpRequest();\n    \n    void handle_requestResponse(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);\n\n    inline void setResponseType(ResponseType type) { _responseType = type; }\n    inline ResponseType getResponseType() {return _responseType; }\n\n    inline void setWithCredentialsValue(bool value) { _withCredentialsValue = value; }\n    inline bool getWithCredentialsValue() {return _withCredentialsValue; }\n\n    inline void setTimeout(unsigned timeOut) {_timeout = timeOut; }\n    inline unsigned getTimeout() { return _timeout;}\n\n    inline void setReadyState(int readyState) { _readyState = readyState; }\n    inline int getReadyState() { return _readyState ;}\n\n    inline cocos2d::network::HttpRequest*  getHttpRequest() { return _httpRequest; }\n    inline int getStatus() { return _status; }\n    inline std::string getStatusText() { return _statusText ;}\n\n    inline std::string getUrl(){return _url;}\n    inline void setUrl(std::string url) { _url = url ;}\n\n    inline std::string getMethod(){return _meth;}\n    inline void setMethod(std::string meth) { _meth = meth ; }\n\n    inline void setAsync(bool isAsync){ _isAsync = isAsync; }\n    inline void setIsNetWork(bool isNetWork) {_isNetwork = isNetWork; }\n\n    void _setHttpRequestHeader();\n    void _sendRequest();\n    void setRequestHeader(const char* field, const char* value);\n\n    std::map<std::string, std::string> getHttpHeader() { return _httpHeader ;}\n    \n    void getByteData(unsigned char* byteData);\n    \n    inline std::string getDataStr() { return _data.str(); }\n    \n    inline size_t getDataSize() {   return _dataSize; }\n    \nprivate:\n    void _gotHeader(std::string header);\n    \n\n    std::string                          _url;\n    std::string                          _meth;\n    std::string                          _type;\n    std::stringstream                    _data;\n    size_t                               _dataSize;\n    int                                  _readyState;\n    int                                  _status;\n    std::string                          _statusText;\n    ResponseType                         _responseType;\n    unsigned                             _timeout;\n    bool                                 _isAsync;\n    cocos2d::network::HttpRequest*       _httpRequest;\n    bool                                 _isNetwork;\n    bool                                 _withCredentialsValue;\n    std::map<std::string, std::string>   _httpHeader;\n    std::map<std::string, std::string>   _requestHeader;\n};\n\nTOLUA_API int register_xml_http_request(lua_State* L);\n\n#endif //#ifndef __COCOS_SCRIPTING_LUA_BINDINGS_LUA_XML_HTTP_REQUEST_H__\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.cpp",
    "content": "\n#include \"CCLuaJavaBridge.h\"\n#include \"platform/android/jni/JniHelper.h\"\n#include <android/log.h>\n\n#define  LOG_TAG    \"luajc\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nextern \"C\" {\n#include \"tolua_fix.h\"\n}\n\nLuaJavaBridge::CallInfo::~CallInfo(void)\n{\n\tif (m_returnType == TypeString && m_ret.stringValue)\n\t{\n\t\tdelete m_ret.stringValue;\n\t}\n}\n\nbool LuaJavaBridge::CallInfo::execute(void)\n{\n\tswitch (m_returnType)\n    {\n        case TypeVoid:\n            m_env->CallStaticVoidMethod(m_classID, m_methodID);\n            break;\n\n        case TypeInteger:\n            m_ret.intValue = m_env->CallStaticIntMethod(m_classID, m_methodID);\n            break;\n\n        case TypeFloat:\n            m_ret.floatValue = m_env->CallStaticFloatMethod(m_classID, m_methodID);\n            break;\n\n        case TypeBoolean:\n            m_ret.boolValue = m_env->CallStaticBooleanMethod(m_classID, m_methodID);\n            break;\n\n        case TypeString:\n            m_retjs = (jstring)m_env->CallStaticObjectMethod(m_classID, m_methodID);\n            const char *stringBuff = m_env->GetStringUTFChars(m_retjs, 0);\n            m_ret.stringValue = new string(stringBuff);\n            m_env->ReleaseStringUTFChars(m_retjs, stringBuff);\n           break;\n    }\n\n\tif (m_env->ExceptionCheck() == JNI_TRUE)\n\t{\n\t\tm_env->ExceptionDescribe();\n\t\tm_env->ExceptionClear();\n\t\tm_error = LUAJ_ERR_EXCEPTION_OCCURRED;\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n\nbool LuaJavaBridge::CallInfo::executeWithArgs(jvalue *args)\n{\n    switch (m_returnType)\n     {\n         case TypeVoid:\n             m_env->CallStaticVoidMethodA(m_classID, m_methodID, args);\n             break;\n\n         case TypeInteger:\n             m_ret.intValue = m_env->CallStaticIntMethodA(m_classID, m_methodID, args);\n             break;\n\n         case TypeFloat:\n             m_ret.floatValue = m_env->CallStaticFloatMethodA(m_classID, m_methodID, args);\n             break;\n\n         case TypeBoolean:\n             m_ret.boolValue = m_env->CallStaticBooleanMethodA(m_classID, m_methodID, args);\n             break;\n\n         case TypeString:\n        \t m_retjs = (jstring)m_env->CallStaticObjectMethodA(m_classID, m_methodID, args);\n\t\t\t const char *stringBuff = m_env->GetStringUTFChars(m_retjs, 0);\n\t\t\t m_ret.stringValue = new string(stringBuff);\n\t\t\t m_env->ReleaseStringUTFChars(m_retjs, stringBuff);\n            break;\n     }\n\n\tif (m_env->ExceptionCheck() == JNI_TRUE)\n\t{\n\t\tm_env->ExceptionDescribe();\n\t\tm_env->ExceptionClear();\n\t\tm_error = LUAJ_ERR_EXCEPTION_OCCURRED;\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nint LuaJavaBridge::CallInfo::pushReturnValue(lua_State *L)\n{\n\tif (m_error != LUAJ_ERR_OK)\n\t{\n\t\tlua_pushinteger(L, m_error);\n\t\treturn 1;\n\t}\n\n\tswitch (m_returnType)\n\t{\n\t\tcase TypeInteger:\n\t\t\tlua_pushinteger(L, m_ret.intValue);\n\t\t\treturn 1;\n\t\tcase TypeFloat:\n\t\t\tlua_pushnumber(L, m_ret.floatValue);\n\t\t\treturn 1;\n\t\tcase TypeBoolean:\n\t\t\tlua_pushboolean(L, m_ret.boolValue);\n\t\t\treturn 1;\n\t\tcase TypeString:\n\t\t\tlua_pushstring(L, m_ret.stringValue->c_str());\n\t\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n\n\nbool LuaJavaBridge::CallInfo::validateMethodSig(void)\n{\n    size_t len = m_methodSig.length();\n    if (len < 3 || m_methodSig[0] != '(') // min sig is \"()V\"\n    {\n    \tm_error = LUAJ_ERR_INVALID_SIGNATURES;\n    \treturn false;\n\t}\n\n    size_t pos = 1;\n    while (pos < len && m_methodSig[pos] != ')')\n    {\n    \tLuaJavaBridge::ValueType type = checkType(m_methodSig, &pos);\n    \tif (type == TypeInvalid) return false;\n\n\t\tm_argumentsCount++;\n\t\tm_argumentsType.push_back(type);\n        pos++;\n    }\n\n    if (pos >= len || m_methodSig[pos] != ')')\n\t{\n    \tm_error = LUAJ_ERR_INVALID_SIGNATURES;\n    \treturn false;\n\t}\n\n    pos++;\n    m_returnType = checkType(m_methodSig, &pos);\n    return true;\n}\n\nLuaJavaBridge::ValueType LuaJavaBridge::CallInfo::checkType(const string& sig, size_t *pos)\n{\n    switch (sig[*pos])\n    {\n        case 'I':\n            return TypeInteger;\n        case 'F':\n            return TypeFloat;\n        case 'Z':\n            return TypeBoolean;\n        case 'V':\n        \treturn TypeVoid;\n        case 'L':\n            size_t pos2 = sig.find_first_of(';', *pos + 1);\n            if (pos2 == string::npos)\n            {\n                m_error = LUAJ_ERR_INVALID_SIGNATURES;\n                return TypeInvalid;\n            }\n\n            const string t = sig.substr(*pos, pos2 - *pos + 1);\n            if (t.compare(\"Ljava/lang/String;\") == 0)\n            {\n            \t*pos = pos2;\n                return TypeString;\n            }\n            else if (t.compare(\"Ljava/util/Vector;\") == 0)\n            {\n            \t*pos = pos2;\n                return TypeVector;\n            }\n            else\n            {\n            \tm_error = LUAJ_ERR_TYPE_NOT_SUPPORT;\n                return TypeInvalid;\n            }\n    }\n\n    m_error = LUAJ_ERR_TYPE_NOT_SUPPORT;\n    return TypeInvalid;\n}\n\n\nbool LuaJavaBridge::CallInfo::getMethodInfo(void)\n{\n    m_methodID = 0;\n    m_env = 0;\n\n    JavaVM* jvm = cocos2d::JniHelper::getJavaVM();\n    jint ret = jvm->GetEnv((void**)&m_env, JNI_VERSION_1_4);\n    switch (ret) {\n        case JNI_OK:\n            break;\n\n        case JNI_EDETACHED :\n            if (jvm->AttachCurrentThread(&m_env, NULL) < 0)\n            {\n                LOGD(\"%s\", \"Failed to get the environment using AttachCurrentThread()\");\n                m_error = LUAJ_ERR_VM_THREAD_DETACHED;\n                return false;\n            }\n            break;\n\n        case JNI_EVERSION :\n        default :\n            LOGD(\"%s\", \"Failed to get the environment using GetEnv()\");\n            m_error = LUAJ_ERR_VM_FAILURE;\n            return false;\n    }\n    jstring _jstrClassName = m_env->NewStringUTF(m_className.c_str());\n    m_classID = (jclass) m_env->CallObjectMethod(cocos2d::JniHelper::classloader,\n                                                   cocos2d::JniHelper::loadclassMethod_methodID,\n                                                   _jstrClassName);\n\n    if (NULL == m_classID) {\n        LOGD(\"Classloader failed to find class of %s\", m_className.c_str());\n    }\n\n    m_env->DeleteLocalRef(_jstrClassName);\n    m_methodID = m_env->GetStaticMethodID(m_classID, m_methodName.c_str(), m_methodSig.c_str());\n    if (!m_methodID)\n    {\n        m_env->ExceptionClear();\n        LOGD(\"Failed to find method id of %s.%s %s\",\n                m_className.c_str(),\n                m_methodName.c_str(),\n                m_methodSig.c_str());\n        m_error = LUAJ_ERR_METHOD_NOT_FOUND;\n        return false;\n    }\n\n    return true;\n}\n\n/* ---------------------------------------- */\n\nlua_State *LuaJavaBridge::s_luaState = NULL;\nint LuaJavaBridge::s_newFunctionId = 0;\n\nvoid LuaJavaBridge::luaopen_luaj(lua_State *L)\n{\n\ts_luaState = L;\n    lua_newtable(L);\n    lua_pushstring(L, \"callStaticMethod\");\n    lua_pushcfunction(L, LuaJavaBridge::callJavaStaticMethod);\n    lua_rawset(L, -3);\n    lua_setglobal(L, \"LuaJavaBridge\");\n}\n\n/*\nargs:\n    const char *className\n    const char *methodName\n    LUA_TABLE   args\n    const char *sig\n*/\nint LuaJavaBridge::callJavaStaticMethod(lua_State *L)\n{\n    if (!lua_isstring(L, -4) || !lua_isstring(L, -3)  || !lua_istable(L, -2) || !lua_isstring(L, -1))\n    {\n    \tlua_pushboolean(L, 0);\n    \tlua_pushinteger(L, LUAJ_ERR_INVALID_SIGNATURES);\n    \treturn 2;\n    }\n\n    LOGD(\"%s\", \"LuaJavaBridge::callJavaStaticMethod(lua_State *L)\");\n\n    const char *className  = lua_tostring(L, -4);\n    const char *methodName = lua_tostring(L, -3);\n    const char *methodSig  = lua_tostring(L, -1);\n\n    CallInfo call(className, methodName, methodSig);\n\n    // check args\n    lua_pop(L, 1);\t\t\t\t\t\t\t\t\t\t\t\t\t/* L: args */\n    int count = fetchArrayElements(L, -1);                      \t/* L: args e1 e2 e3 e4 ... */\n    jvalue *args = NULL;\n    if (count > 0)\n    {\n\t    args = new jvalue[count];\n\t    for (int i = 0; i < count; ++i)\n\t    {\n\t        int index = -count + i;\n\t        switch (call.argumentTypeAtIndex(i))\n\t        {\n\t            case TypeInteger:\n\t            \tif (lua_isfunction(L, index))\n\t            \t{\n\t                    args[i].i = retainLuaFunction(L, index, NULL);\n\t            \t}\n\t            \telse\n\t            \t{\n\t            \t\targs[i].i = (int)lua_tonumber(L, index);\n\t            \t}\n\t                break;\n\n\t            case TypeFloat:\n\t                args[i].f = lua_tonumber(L, index);\n\t                break;\n\n\t            case TypeBoolean:\n\t                args[i].z = lua_toboolean(L, index) != 0 ? JNI_TRUE : JNI_FALSE;\n\t                break;\n\n\t            case TypeString:\n\t            default:\n\t                args[i].l = call.getEnv()->NewStringUTF(lua_tostring(L, index));\n\t                break;\n\t        }\n\t    }\n\t    lua_pop(L, count);                               \t\t\t/* L: args */\n    }\n\n    bool success = args ? call.executeWithArgs(args) : call.execute();\n    if (args) delete []args;\n\n    if (!success)\n    {\n    \tLOGD(\"LuaJavaBridge::callJavaStaticMethod(\\\"%s\\\", \\\"%s\\\", args, \\\"%s\\\") EXECUTE FAILURE, ERROR CODE: %d\",\n    \t\t\tclassName, methodName, methodSig, call.getErrorCode());\n\n    \tlua_pushboolean(L, 0);\n    \tlua_pushinteger(L, call.getErrorCode());\n    \treturn 2;\n    }\n\n\tLOGD(\"LuaJavaBridge::callJavaStaticMethod(\\\"%s\\\", \\\"%s\\\", args, \\\"%s\\\") SUCCESS\",\n\t\t\tclassName, methodName, methodSig);\n\n\tlua_pushboolean(L, 1);\n\treturn 1 + call.pushReturnValue(L);\n}\n\n// increase lua function refernece counter, return counter\nint LuaJavaBridge::retainLuaFunctionById(int functionId)\n{\n    lua_State *L = s_luaState;\n\n    lua_pushstring(L, LUAJ_REGISTRY_RETAIN);                    /* L: key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: id_r */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        return 0;\n    }\n\n    // get counter\n    lua_pushinteger(L, functionId);                             /* L: id_r id */\n    lua_rawget(L, -2);                                          /* L: id_r r */\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        lua_pop(L, 2);\n        return 0;\n    }\n\n    // increase counter\n    int retainCount = lua_tonumber(L, -1);\n    retainCount++;\n    lua_pop(L, 1);                                              /* L: id_r */\n    lua_pushinteger(L, functionId);                             /* L: id_r id */\n    lua_pushinteger(L, retainCount);                            /* L: id_r id r */\n    lua_rawset(L, -3);                            /* id_r[id] = r, L: id_r */\n    lua_pop(L, 1);\n\n    LOGD(\"luajretainLuaFunctionById(%d) - retain count = %d\", functionId, retainCount);\n\n    return retainCount;\n}\n\n// decrease lua function reference counter, return counter\nint LuaJavaBridge::releaseLuaFunctionById(int functionId)\n{\n    lua_State *L = s_luaState;\n                                                                /* L: */\n    lua_pushstring(L, LUAJ_REGISTRY_FUNCTION);                  /* L: key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f_id */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        LOGD(\"%s\", \"luajreleaseLuaFunctionById() - LUAJ_REGISTRY_FUNCTION not exists\");\n        return 0;\n    }\n\n    lua_pushstring(L, LUAJ_REGISTRY_RETAIN);                    /* L: f_id key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f_id id_r */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 2);\n        LOGD(\"%s\", \"luajreleaseLuaFunctionById() - LUAJ_REGISTRY_RETAIN not exists\");\n        return 0;\n    }\n\n    lua_pushinteger(L, functionId);                             /* L: f_id id_r id */\n    lua_rawget(L, -2);                                          /* L: f_id id_r r */\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        lua_pop(L, 3);\n        LOGD(\"luajreleaseLuaFunctionById() - function id %d not found\", functionId);\n        return 0;\n    }\n\n    int retainCount = lua_tonumber(L, -1);\n    retainCount--;\n\n    if (retainCount > 0)\n    {\n        // update counter\n        lua_pop(L, 1);                                          /* L: f_id id_r */\n        lua_pushinteger(L, functionId);                         /* L: f_id id_r id */\n        lua_pushinteger(L, retainCount);                        /* L: f_id id_r id r */\n        lua_rawset(L, -3);                        /* id_r[id] = r, L: f_id id_r */\n        lua_pop(L, 2);\n        LOGD(\"luajreleaseLuaFunctionById() - function id %d retain count = %d\", functionId, retainCount);\n        return retainCount;\n    }\n\n    // remove lua function reference\n    lua_pop(L, 1);                                              /* L: f_id id_r */\n    lua_pushinteger(L, functionId);                             /* L: f_id id_r id */\n    lua_pushnil(L);                                             /* L: f_id id_r id nil */\n    lua_rawset(L, -3);                          /* id_r[id] = nil, L: f_id id_r */\n\n    lua_pop(L, 1);                                              /* L: f_id */\n    lua_pushnil(L);                                             /* L: f_id nil */\n    while (lua_next(L, -2) != 0)                                /* L: f_id f id */\n    {\n        int value = lua_tonumber(L, -1);\n        lua_pop(L, 1);                                          /* L: f_id f */\n        if (value == functionId)\n        {\n            lua_pushnil(L);                                     /* L: f_id f nil */\n            lua_rawset(L, -3);                   /* f_id[f] = nil, L: f_id */\n            break;\n        }\n    }                                                           /* L: f_id */\n\n    lua_pop(L, 1);\n    LOGD(\"luajreleaseLuaFunctionById() - function id %d released\", functionId);\n    return 0;\n}\n\nint LuaJavaBridge::callLuaFunctionById(int functionId, const char *arg)\n{\n    lua_State *L = s_luaState;\n    int top = lua_gettop(L);\n                                                                /* L: */\n    lua_pushstring(L, LUAJ_REGISTRY_FUNCTION);                  /* L: key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f_id */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        return -1;\n    }\n\n    lua_pushnil(L);                                             /* L: f_id nil */\n    while (lua_next(L, -2) != 0)                                /* L: f_id f id */\n    {\n        int value = lua_tonumber(L, -1);\n        lua_pop(L, 1);                                          /* L: f_id f */\n        if (value == functionId)\n        {\n            lua_pushstring(L, arg);                             /* L: f_id f arg */\n            int ok = lua_pcall(L, 1, 1, 0);                     /* L: f_id ret|err */\n            int ret;\n            if (ok == 0)\n            {\n                ret = lua_tonumber(L, -1);\n            }\n            else\n            {\n                ret = -ok;\n            }\n\n            lua_settop(L, top);\n            return ret;\n        }\n    }                                                           /* L: f_id */\n\n    lua_settop(L, top);\n    return -1;\n}\n\n// call lua global function\nint LuaJavaBridge::callLuaGlobalFunction(const char *functionName, const char *arg)\n{\n    lua_State *L = s_luaState;\n\n    int ret = -1;\n    int top = lua_gettop(L);\n\n    lua_getglobal(L, functionName);\n    if (lua_isfunction(L, -1))\n    {\n        lua_pushstring(L, arg);\n        int ok = lua_pcall(L, 1, 1, 0);\n        if (ok == 0)\n        {\n            ret = lua_tonumber(L, -1);\n        }\n        else\n        {\n            ret = -ok;\n        }\n    }\n\n    lua_settop(L, top);\n    return ret;\n}\n\n// ----------------------------------------\n\n// increase lua function reference counter, return functionId\nint LuaJavaBridge::retainLuaFunction(lua_State *L, int functionIndex, int *retainCountReturn)\n{\n                                                                /* L: f ... */\n    lua_pushstring(L, LUAJ_REGISTRY_FUNCTION);                  /* L: f ... key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f ... f_id */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        lua_newtable(L);\n        lua_pushstring(L, LUAJ_REGISTRY_FUNCTION);\n        lua_pushvalue(L, -2);\n        lua_rawset(L, LUA_REGISTRYINDEX);\n    }\n\n    lua_pushstring(L, LUAJ_REGISTRY_RETAIN);                    /* L: f ... f_id key */\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* L: f ... f_id id_r */\n    if (!lua_istable(L, -1))\n    {\n        lua_pop(L, 1);\n        lua_newtable(L);\n        lua_pushstring(L, LUAJ_REGISTRY_RETAIN);\n        lua_pushvalue(L, -2);\n        lua_rawset(L, LUA_REGISTRYINDEX);\n    }\n\n    // get function id\n    lua_pushvalue(L, functionIndex - 2);                        /* L: f ... f_id id_r f */\n    lua_rawget(L, -3);                                          /* L: f ... f_id id_r id */\n\n    int functionId;\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        // first retain, create new id\n        lua_pop(L, 1);                                          /* L: f ... f_id id_r */\n        s_newFunctionId++;\n        functionId = s_newFunctionId;\n\n        lua_pushvalue(L, functionIndex - 2);                    /* L: f ... f_id id_r f */\n        lua_pushinteger(L, functionId);                         /* L: f ... f_id id_r f id */\n        lua_rawset(L, -4);                        /* f_id[f] = id, L: f ... f_id id_r */\n        lua_pushinteger(L, functionId);                         /* L: f ... f_id id_r id */\n    }\n    else\n    {\n        functionId = lua_tonumber(L, -1);\n    }\n\n    // get function retain\n    lua_pushvalue(L, -1);                                       /* L: f ... f_id id_r id id */\n    lua_rawget(L, -3);                                          /* L: f ... f_id id_r id r */\n    int retainCount = 1;\n    if (lua_type(L, -1) != LUA_TNUMBER)\n    {\n        // first retain, set retain count = 1\n        lua_pop(L, 1);\n        lua_pushinteger(L, retainCount);\n    }\n    else\n    {\n        // add retain count\n        retainCount = lua_tonumber(L, -1);\n        retainCount++;\n        lua_pop(L, 1);\n        lua_pushinteger(L, retainCount);\n    }\n\n    lua_rawset(L, -3);                            /* id_r[id] = r, L: f ... f_id id_r */\n    lua_pop(L, 2);                                              /* L: f ... */\n\n    if (retainCountReturn) *retainCountReturn = retainCount;\n    return functionId;\n}\n\nint LuaJavaBridge::fetchArrayElements(lua_State *L, int index)\n{\n    int count = 0;\n    do\n    {\n        lua_rawgeti(L, index - count, count + 1);\n        if (lua_isnil(L, -1))\n        {\n            lua_pop(L, 1);\n            break;\n        }\n        ++count;\n    } while (1);\n    return count;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.h",
    "content": "#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_LUA_JAVA_BRIDGE_H\n#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_LUA_JAVA_BRIDGE_H\n\n#include <jni.h>\n#include <string>\n#include <vector>\n#include \"cocos2d.h\"\n\nusing namespace std;\n\nextern \"C\" {\n#include \"lua.h\"\n}\n\nusing namespace cocos2d;\n\n#define LUAJ_ERR_OK                 0\n#define LUAJ_ERR_TYPE_NOT_SUPPORT   (-1)\n#define LUAJ_ERR_INVALID_SIGNATURES (-2)\n#define LUAJ_ERR_METHOD_NOT_FOUND   (-3)\n#define LUAJ_ERR_EXCEPTION_OCCURRED (-4)\n#define LUAJ_ERR_VM_THREAD_DETACHED (-5)\n#define LUAJ_ERR_VM_FAILURE         (-6)\n\n#define LUAJ_REGISTRY_FUNCTION      \"luaj_function_id\"          // table[function] = id\n#define LUAJ_REGISTRY_RETAIN        \"luaj_function_id_retain\"   // table[id] = retain count\n\n\nclass LuaJavaBridge\n{\npublic:\n    static void luaopen_luaj(lua_State *L);\n\n    static int retainLuaFunctionById(int functionId);\n    static int releaseLuaFunctionById(int functionId);\n\n    static int callLuaFunctionById(int functionId, const char *arg);\n    static int callLuaGlobalFunction(const char *functionName, const char *arg);\n\nprivate:\n    typedef enum\n    {\n        TypeInvalid = -1,\n        TypeVoid    = 0,\n        TypeInteger = 1,\n        TypeFloat   = 2,\n        TypeBoolean = 3,\n        TypeString  = 4,\n        TypeVector  = 5,\n        TypeFunction= 6,\n    } ValueType;\n\n    typedef vector<ValueType> ValueTypes;\n\n    typedef union\n    {\n        int     intValue;\n        float   floatValue;\n        int     boolValue;\n        string *stringValue;\n    } ReturnValue;\n\n    class CallInfo\n    {\n    public:\n        CallInfo(const char *className, const char *methodName, const char *methodSig)\n        : m_valid(false)\n        , m_error(LUAJ_ERR_OK)\n        , m_className(className)\n        , m_methodName(methodName)\n        , m_methodSig(methodSig)\n        , m_returnType(TypeVoid)\n        , m_argumentsCount(0)\n        , m_retjs(NULL)\n        , m_env(NULL)\n        , m_classID(NULL)\n        , m_methodID(NULL)\n        {\n            memset(&m_ret, 0, sizeof(m_ret));\n        \tm_valid = validateMethodSig() && getMethodInfo();\n        }\n    \t~CallInfo(void);\n\n        bool isValid(void) {\n        \treturn m_valid;\n        }\n\n        int getErrorCode(void) {\n        \treturn m_error;\n        }\n\n        JNIEnv *getEnv(void) {\n        \treturn m_env;\n        }\n\n        int argumentTypeAtIndex(size_t index) {\n        \treturn m_argumentsType.at(index);\n        }\n\n        bool execute(void);\n        bool executeWithArgs(jvalue *args);\n        int pushReturnValue(lua_State *L);\n\n\n    private:\n        bool \t\tm_valid;\n        int \t\tm_error;\n\n        string      m_className;\n        string      m_methodName;\n        string      m_methodSig;\n        int         m_argumentsCount;\n        ValueTypes  m_argumentsType;\n        ValueType   m_returnType;\n\n        ReturnValue m_ret;\n        jstring     m_retjs;\n\n        JNIEnv     *m_env;\n        jclass      m_classID;\n        jmethodID   m_methodID;\n\n        bool validateMethodSig(void);\n        bool getMethodInfo(void);\n        ValueType checkType(const string& sig, size_t *pos);\n    };\n\n    static int callJavaStaticMethod(lua_State *L);\n    static int retainLuaFunction(lua_State *L, int functionIndex, int *retainCountReturn);\n    static int getMethodInfo(CallInfo *call, const char *className, const char *methodName, const char *paramCode);\n    static int fetchArrayElements(lua_State *L, int index);\n    static int callAndPushReturnValue(lua_State *L, CallInfo *call, jvalue *args);\n\n    static lua_State *s_luaState;\n    static int        s_newFunctionId;\n};\n\n#endif //COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_LUA_JAVA_BRIDGE_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp",
    "content": "\n#include \"Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h\"\n\n#include <android/log.h>\n\n#include \"CCLuaJavaBridge.h\"\n\n#define  LOG_TAG    \"Cocos2dxLuaJavaBridge_java\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nextern \"C\" {\n\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_callLuaFunctionWithString\n  (JNIEnv *env, jclass cls, jint functionId, jstring value)\n{\n    const char *value_ = env->GetStringUTFChars(value, 0);\n    int ret = LuaJavaBridge::callLuaFunctionById(functionId, value_);\n    env->ReleaseStringUTFChars(value, value_);\n    return ret;\n}\n\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_callLuaGlobalFunctionWithString\n  (JNIEnv *env, jclass cls, jstring luaFunctionName, jstring value)\n{\n    const char *luaFunctionName_ = env->GetStringUTFChars(luaFunctionName, 0);\n    const char *value_ = env->GetStringUTFChars(value, 0);\n    int ret = LuaJavaBridge::callLuaGlobalFunction(luaFunctionName_, value_);\n    env->ReleaseStringUTFChars(luaFunctionName, luaFunctionName_);\n    env->ReleaseStringUTFChars(value, value_);\n    return ret;\n}\n\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_retainLuaFunction\n  (JNIEnv *env, jclass cls, jint luaFunctionId)\n{\n    return LuaJavaBridge::retainLuaFunctionById(luaFunctionId);\n}\n\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_releaseLuaFunction\n  (JNIEnv *env, jclass cls, jint luaFunctionId)\n{\n    return LuaJavaBridge::releaseLuaFunctionById(luaFunctionId);\n}\n\n} // extern \"C\"\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h",
    "content": "#ifndef COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_JNI_JAVA_ORG_COCOS2DX_LIB_COCOS2DX_LUA_JAVA_BRIDEG_H\n#define COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_JNI_JAVA_ORG_COCOS2DX_LIB_COCOS2DX_LUA_JAVA_BRIDEG_H\n\n#include <jni.h>\n\nextern \"C\" {\n\n/*\n * Class:     Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge\n * Method:    callLuaFunctionWithString\n * Signature: (ILjava/lang/String;)I\n */\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_callLuaFunctionWithString\n  (JNIEnv *, jclass, jint, jstring);\n\n/*\n * Class:     Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge\n * Method:    callLuaGlobalFunctionWithString\n * Signature: (Ljava/lang/String;Ljava/lang/String;)I\n */\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_callLuaGlobalFunctionWithString\n  (JNIEnv *env, jclass, jstring, jstring);\n\n/*\n * Class:     Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge\n * Method:    retainLuaFunction\n * Signature: (I)I\n */\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_retainLuaFunction\n  (JNIEnv *env, jclass, jint);\n\n/*\n * Class:     Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge\n * Method:    releaseLuaFunction\n * Signature: (I)I\n */\nJNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_releaseLuaFunction\n  (JNIEnv *env, jclass, jint);\n\n} // extern \"C\"\n\n#endif // COCOS2DX_SCRIPT_LUA_COCOS2DX_SUPPORT_PLATFORM_ANDROID_JNI_JAVA_ORG_COCOS2DX_LIB_COCOS2DX_LUA_JAVA_BRIDEG_H\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.h",
    "content": "\n#ifndef __LUA_OBJC_BRIDGE_H_\n#define __LUA_OBJC_BRIDGE_H_\n\n#include \"CCLuaBridge.h\"\n\nNS_CC_BEGIN\n\nclass LuaObjcBridge : public LuaBridge\n{\npublic:\n    static void luaopen_luaoc(lua_State *L);\n    \nprotected:\n    static int callObjcStaticMethod(lua_State *L);\n    \n    static void pushValue(lua_State *L, void *val);\n};\n\nNS_CC_END\n\n#endif // __LUA_OBJC_BRIDGE_H_\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.mm",
    "content": "\n#include \"CCLuaObjcBridge.h\"\n\nNS_CC_BEGIN\n\nvoid LuaObjcBridge::luaopen_luaoc(lua_State *L)\n{\n    s_luaState = L;\n    lua_newtable(L);\n    lua_pushstring(L, \"callStaticMethod\");\n    lua_pushcfunction(L, LuaObjcBridge::callObjcStaticMethod);\n    lua_rawset(L, -3);\n    lua_setglobal(L, \"LuaObjcBridge\");\n}\n\n/**\n className\n methodName\n args\n */\nint LuaObjcBridge::callObjcStaticMethod(lua_State *L)\n{\n    if (lua_gettop(L) != 3 || !lua_isstring(L, -3) || !lua_isstring(L, -2))\n    {\n    \tlua_pushboolean(L, 0);\n    \tlua_pushinteger(L, kLuaBridgeErrorInvalidParameters);\n    \treturn 2;\n    }\n    \n    const char *className  = lua_tostring(L, -3);\n    const char *methodName = lua_tostring(L, -2);\n    if (!className || !methodName)\n    {\n        lua_pushboolean(L, 0);\n        lua_pushinteger(L, kLuaBridgeErrorInvalidParameters);\n        return 2;\n    }\n    \n    Class targetClass = NSClassFromString([NSString stringWithCString:className encoding:NSUTF8StringEncoding]);\n    if (!targetClass)\n    {\n        lua_pushboolean(L, 0);\n        lua_pushinteger(L, kLuaBridgeErrorClassNotFound);\n        return 2;\n    }\n    \n    SEL methodSel;\n    bool hasArguments = lua_istable(L, -1);\n    if (hasArguments)\n    {\n        NSString *methodName_ = [NSString stringWithCString:methodName encoding:NSUTF8StringEncoding];\n        methodName_ = [NSString stringWithFormat:@\"%@:\", methodName_];\n        methodSel = NSSelectorFromString(methodName_);\n    }\n    else\n    {\n        methodSel = NSSelectorFromString([NSString stringWithCString:methodName encoding:NSUTF8StringEncoding]);\n    }\n    if (methodSel == (SEL)0)\n    {\n        lua_pushboolean(L, 0);\n        lua_pushinteger(L, kLuaBridgeErrorMethodNotFound);\n        return 2;\n    }\n    \n    NSMethodSignature *methodSig = [targetClass methodSignatureForSelector:(SEL)methodSel];\n    if (methodSig == nil)\n    {\n        lua_pushboolean(L, 0);\n        lua_pushinteger(L, kLuaBridgeErrorMethodSignature);\n        return 2;\n    }\n    \n    @try {\n        NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSig];\n        [invocation setTarget:targetClass];\n        [invocation setSelector:methodSel];\n        NSUInteger returnLength = [methodSig methodReturnLength];\n        const char *returnType = [methodSig methodReturnType];\n        \n        if (hasArguments)\n        {\n            NSMutableDictionary *dict = [NSMutableDictionary dictionary];\n            lua_pushnil(L);\n            while (lua_next(L, -2))\n            {\n                NSString *key = [NSString stringWithCString:lua_tostring(L, -2) encoding:NSUTF8StringEncoding];\n                \n                switch (lua_type(L, -1))\n                {\n                    case LUA_TNUMBER:\n                        [dict setObject:[NSNumber numberWithFloat:lua_tonumber(L, -1)] forKey:key];\n                        break;\n                        \n                    case LUA_TBOOLEAN:\n                        [dict setObject:[NSNumber numberWithBool:lua_toboolean(L, -1)] forKey:key];\n                        break;\n                        \n                    case LUA_TSTRING:\n                        [dict setObject:[NSString stringWithCString:lua_tostring(L, -1) encoding:NSUTF8StringEncoding]\n                                 forKey:key];\n                        break;\n                        \n                    case LUA_TFUNCTION:\n                        int functionId = retainLuaFunction(L, -1, NULL);\n                        [dict setObject:[NSNumber numberWithInt:functionId] forKey:key];\n                        break;\n                }\n                \n                lua_pop(L, 1);\n            }\n            \n            [invocation setArgument:&dict atIndex:2];\n            [invocation invoke];\n        }\n        else\n        {\n            [invocation invoke];\n        }\n        \n        lua_pushboolean(L, 1);\n        if (returnLength > 0)\n        {\n            if (strcmp(returnType, \"@\") == 0)\n            {\n                id ret;\n                [invocation getReturnValue:&ret];\n                pushValue(L, ret);\n            }\n            else if (strcmp(returnType, \"c\") == 0) // BOOL\n            {\n                char ret;\n                [invocation getReturnValue:&ret];\n                lua_pushboolean(L, ret);\n            }\n            else if (strcmp(returnType, \"i\") == 0) // int\n            {\n                int ret;\n                [invocation getReturnValue:&ret];\n                lua_pushinteger(L, ret);\n            }\n            else if (strcmp(returnType, \"f\") == 0) // float\n            {\n                float ret;\n                [invocation getReturnValue:&ret];\n                lua_pushnumber(L, ret);\n            }\n            else\n            {\n                NSLog(@\"not support return type = %s\", returnType);\n                lua_pushnil(L);\n            }\n        }\n        else\n        {\n            lua_pushnil(L);\n        }\n        return 2;\n    }\n    @catch (NSException *exception)\n    {\n        NSLog(@\"EXCEPTION THROW: %@\", exception);\n        lua_pushboolean(L, 0);\n        lua_pushinteger(L, kLuaBridgeErrorExceptionOccurred);\n        return 2; \n    }\n}\n\nvoid LuaObjcBridge::pushValue(lua_State *L, void *val)\n{\n    id oval = (id)val;\n    if (oval == nil)\n    {\n        lua_pushnil(L);\n    }\n    else if ([oval isKindOfClass:[NSNumber class]])\n    {\n        NSNumber *number = (NSNumber *)oval;\n        const char *numberType = [number objCType];\n        if (strcmp(numberType, @encode(BOOL)) == 0)\n        {\n            lua_pushboolean(L, [number boolValue]);\n        }\n        else if (strcmp(numberType, @encode(int)) == 0)\n        {\n            lua_pushinteger(L, [number intValue]);\n        }\n        else\n        {\n            lua_pushnumber(L, [number floatValue]);\n        }\n    }\n    else if ([oval isKindOfClass:[NSString class]])\n    {\n        lua_pushstring(L, [oval cStringUsingEncoding:NSUTF8StringEncoding]);\n    }\n    else if ([oval isKindOfClass:[NSDictionary class]])\n    {\n        lua_newtable(L);\n        \n        for (id key in oval)\n        {\n            const char *key_ = [[NSString stringWithFormat:@\"%@\", key] cStringUsingEncoding:NSUTF8StringEncoding];\n            lua_pushstring(L, key_);\n            pushValue(L, [oval objectForKey:key]);\n            lua_rawset(L, -3);\n        }\n        \n        return;\n    }\n    else\n    {\n        lua_pushstring(L, [[NSString stringWithFormat:@\"%@\", oval] cStringUsingEncoding:NSUTF8StringEncoding]);\n    }\n}\n\nNS_CC_END\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/auxiliar.c",
    "content": "/*=========================================================================*\\\n* Auxiliar routines for class hierarchy manipulation\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h>\n#include <stdio.h>\n\n#include \"auxiliar.h\"\n\n/*=========================================================================*\\\n* Exported functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Initializes the module\n\\*-------------------------------------------------------------------------*/\nint auxiliar_open(lua_State *L) {\n    (void) L;\n    return 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Creates a new class with given methods\n* Methods whose names start with __ are passed directly to the metatable.\n\\*-------------------------------------------------------------------------*/\nvoid auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func) {\n    luaL_newmetatable(L, classname); /* mt */\n    /* create __index table to place methods */\n    lua_pushstring(L, \"__index\");    /* mt,\"__index\" */\n    lua_newtable(L);                 /* mt,\"__index\",it */ \n    /* put class name into class metatable */\n    lua_pushstring(L, \"class\");      /* mt,\"__index\",it,\"class\" */\n    lua_pushstring(L, classname);    /* mt,\"__index\",it,\"class\",classname */\n    lua_rawset(L, -3);               /* mt,\"__index\",it */\n    /* pass all methods that start with _ to the metatable, and all others\n     * to the index table */\n    for (; func->name; func++) {     /* mt,\"__index\",it */\n        lua_pushstring(L, func->name);\n        lua_pushcfunction(L, func->func);\n        lua_rawset(L, func->name[0] == '_' ? -5: -3);\n    }\n    lua_rawset(L, -3);               /* mt */\n    lua_pop(L, 1);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Prints the value of a class in a nice way\n\\*-------------------------------------------------------------------------*/\nint auxiliar_tostring(lua_State *L) {\n    char buf[32];\n    if (!lua_getmetatable(L, 1)) goto error;\n    lua_pushstring(L, \"__index\");\n    lua_gettable(L, -2);\n    if (!lua_istable(L, -1)) goto error;\n    lua_pushstring(L, \"class\");\n    lua_gettable(L, -2);\n    if (!lua_isstring(L, -1)) goto error;\n    sprintf(buf, \"%p\", lua_touserdata(L, 1));\n    lua_pushfstring(L, \"%s: %s\", lua_tostring(L, -1), buf);\n    return 1;\nerror:\n    lua_pushstring(L, \"invalid object passed to 'auxiliar.c:__tostring'\");\n    lua_error(L);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Insert class into group\n\\*-------------------------------------------------------------------------*/\nvoid auxiliar_add2group(lua_State *L, const char *classname, const char *groupname) {\n    luaL_getmetatable(L, classname);\n    lua_pushstring(L, groupname);\n    lua_pushboolean(L, 1);\n    lua_rawset(L, -3);\n    lua_pop(L, 1);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Make sure argument is a boolean\n\\*-------------------------------------------------------------------------*/\nint auxiliar_checkboolean(lua_State *L, int objidx) {\n    if (!lua_isboolean(L, objidx))\n        auxiliar_typeerror(L, objidx, lua_typename(L, LUA_TBOOLEAN));\n    return lua_toboolean(L, objidx);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Return userdata pointer if object belongs to a given class, abort with \n* error otherwise\n\\*-------------------------------------------------------------------------*/\nvoid *auxiliar_checkclass(lua_State *L, const char *classname, int objidx) {\n    void *data = auxiliar_getclassudata(L, classname, objidx);\n    if (!data) {\n        char msg[45];\n        sprintf(msg, \"%.35s expected\", classname);\n        luaL_argerror(L, objidx, msg);\n    }\n    return data;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Return userdata pointer if object belongs to a given group, abort with \n* error otherwise\n\\*-------------------------------------------------------------------------*/\nvoid *auxiliar_checkgroup(lua_State *L, const char *groupname, int objidx) {\n    void *data = auxiliar_getgroupudata(L, groupname, objidx);\n    if (!data) {\n        char msg[45];\n        sprintf(msg, \"%.35s expected\", groupname);\n        luaL_argerror(L, objidx, msg);\n    }\n    return data;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Set object class\n\\*-------------------------------------------------------------------------*/\nvoid auxiliar_setclass(lua_State *L, const char *classname, int objidx) {\n    luaL_getmetatable(L, classname);\n    if (objidx < 0) objidx--;\n    lua_setmetatable(L, objidx);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Get a userdata pointer if object belongs to a given group. Return NULL \n* otherwise\n\\*-------------------------------------------------------------------------*/\nvoid *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx) {\n    if (!lua_getmetatable(L, objidx))\n        return NULL;\n    lua_pushstring(L, groupname);\n    lua_rawget(L, -2);\n    if (lua_isnil(L, -1)) {\n        lua_pop(L, 2);\n        return NULL;\n    } else {\n        lua_pop(L, 2);\n        return lua_touserdata(L, objidx);\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Get a userdata pointer if object belongs to a given class. Return NULL \n* otherwise\n\\*-------------------------------------------------------------------------*/\nvoid *auxiliar_getclassudata(lua_State *L, const char *classname, int objidx) {\n    return luaL_checkudata(L, objidx, classname);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Throws error when argument does not have correct type.\n* Used to be part of lauxlib in Lua 5.1, was dropped from 5.2.\n\\*-------------------------------------------------------------------------*/\nint auxiliar_typeerror (lua_State *L, int narg, const char *tname) {\n  const char *msg = lua_pushfstring(L, \"%s expected, got %s\", tname, \n      luaL_typename(L, narg));\n  return luaL_argerror(L, narg, msg);\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/auxiliar.h",
    "content": "#ifndef AUXILIAR_H\n#define AUXILIAR_H\n/*=========================================================================*\\\n* Auxiliar routines for class hierarchy manipulation\n* LuaSocket toolkit (but completely independent of other LuaSocket modules)\n*\n* A LuaSocket class is a name associated with Lua metatables. A LuaSocket \n* group is a name associated with a class. A class can belong to any number \n* of groups. This module provides the functionality to:\n*\n*   - create new classes \n*   - add classes to groups \n*   - set the class of objects\n*   - check if an object belongs to a given class or group\n*   - get the userdata associated to objects\n*   - print objects in a pretty way\n*\n* LuaSocket class names follow the convention <module>{<class>}. Modules\n* can define any number of classes and groups. The module tcp.c, for\n* example, defines the classes tcp{master}, tcp{client} and tcp{server} and\n* the groups tcp{client,server} and tcp{any}. Module functions can then\n* perform type-checking on their arguments by either class or group.\n*\n* LuaSocket metatables define the __index metamethod as being a table. This\n* table has one field for each method supported by the class, and a field\n* \"class\" with the class name.\n*\n* The mapping from class name to the corresponding metatable and the\n* reverse mapping are done using lauxlib. \n\\*=========================================================================*/\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\nint auxiliar_open(lua_State *L);\nvoid auxiliar_newclass(lua_State *L, const char *classname, luaL_Reg *func);\nvoid auxiliar_add2group(lua_State *L, const char *classname, const char *group);\nvoid auxiliar_setclass(lua_State *L, const char *classname, int objidx);\nvoid *auxiliar_checkclass(lua_State *L, const char *classname, int objidx);\nvoid *auxiliar_checkgroup(lua_State *L, const char *groupname, int objidx);\nvoid *auxiliar_getclassudata(lua_State *L, const char *groupname, int objidx);\nvoid *auxiliar_getgroupudata(lua_State *L, const char *groupname, int objidx);\nint auxiliar_checkboolean(lua_State *L, int objidx);\nint auxiliar_tostring(lua_State *L);\nint auxiliar_typeerror(lua_State *L, int narg, const char *tname);\n\n#endif /* AUXILIAR_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/except.c",
    "content": "/*=========================================================================*\\\n* Simple exception support\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <stdio.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"except.h\"\n\n/*=========================================================================*\\\n* Internal function prototypes.\n\\*=========================================================================*/\nstatic int global_protect(lua_State *L);\nstatic int global_newtry(lua_State *L);\nstatic int protected_(lua_State *L);\nstatic int finalize(lua_State *L);\nstatic int do_nothing(lua_State *L);\n\n/* except functions */\nstatic luaL_Reg func[] = {\n    {\"newtry\",    global_newtry},\n    {\"protect\",   global_protect},\n    {NULL,        NULL}\n};\n\n/*-------------------------------------------------------------------------*\\\n* Try factory\n\\*-------------------------------------------------------------------------*/\nstatic void wrap(lua_State *L) {\n    lua_newtable(L);\n    lua_pushnumber(L, 1);\n    lua_pushvalue(L, -3);\n    lua_settable(L, -3);\n    lua_insert(L, -2);\n    lua_pop(L, 1);\n}\n\nstatic int finalize(lua_State *L) {\n    if (!lua_toboolean(L, 1)) {\n        lua_pushvalue(L, lua_upvalueindex(1));\n        lua_pcall(L, 0, 0, 0);\n        lua_settop(L, 2);\n        wrap(L);\n        lua_error(L);\n        return 0;\n    } else return lua_gettop(L);\n}\n\nstatic int do_nothing(lua_State *L) { \n    (void) L;\n    return 0; \n}\n\nstatic int global_newtry(lua_State *L) {\n    lua_settop(L, 1);\n    if (lua_isnil(L, 1)) lua_pushcfunction(L, do_nothing);\n    lua_pushcclosure(L, finalize, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Protect factory\n\\*-------------------------------------------------------------------------*/\nstatic int unwrap(lua_State *L) {\n    if (lua_istable(L, -1)) {\n        lua_pushnumber(L, 1);\n        lua_gettable(L, -2);\n        lua_pushnil(L);\n        lua_insert(L, -2);\n        return 1;\n    } else return 0;\n}\n\nstatic int protected_(lua_State *L) {\n    lua_pushvalue(L, lua_upvalueindex(1));\n    lua_insert(L, 1);\n    if (lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0) != 0) {\n        if (unwrap(L)) return 2;\n        else lua_error(L);\n        return 0;\n    } else return lua_gettop(L);\n}\n\nstatic int global_protect(lua_State *L) {\n    lua_pushcclosure(L, protected_, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Init module\n\\*-------------------------------------------------------------------------*/\nint except_open(lua_State *L) {\n    luaL_openlib(L, NULL, func, 0);\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/except.h",
    "content": "#ifndef EXCEPT_H\n#define EXCEPT_H\n/*=========================================================================*\\\n* Exception control\n* LuaSocket toolkit (but completely independent from other modules)\n*\n* This provides support for simple exceptions in Lua. During the\n* development of the HTTP/FTP/SMTP support, it became aparent that\n* error checking was taking a substantial amount of the coding. These\n* function greatly simplify the task of checking errors.\n*\n* The main idea is that functions should return nil as its first return\n* value when it finds an error, and return an error message (or value)\n* following nil. In case of success, as long as the first value is not nil,\n* the other values don't matter.\n*\n* The idea is to nest function calls with the \"try\" function. This function\n* checks the first value, and calls \"error\" on the second if the first is\n* nil. Otherwise, it returns all values it received. \n*\n* The protect function returns a new function that behaves exactly like the\n* function it receives, but the new function doesn't throw exceptions: it\n* returns nil followed by the error message instead.\n*\n* With these two function, it's easy to write functions that throw\n* exceptions on error, but that don't interrupt the user script. \n\\*=========================================================================*/\n\n#include \"lua.h\"\n\nint except_open(lua_State *L);\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/inet.c",
    "content": "/*=========================================================================*\\\n* Internet domain functions\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <stdio.h>\n#include <string.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"inet.h\"\n\n/*=========================================================================*\\\n* Internal function prototypes.\n\\*=========================================================================*/\nstatic int inet_global_toip(lua_State *L);\nstatic int inet_global_getaddrinfo(lua_State *L);\nstatic int inet_global_tohostname(lua_State *L);\nstatic int inet_global_getnameinfo(lua_State *L);\nstatic void inet_pushresolved(lua_State *L, struct hostent *hp);\nstatic int inet_global_gethostname(lua_State *L);\n\n/* DNS functions */\nstatic luaL_Reg func[] = {\n    { \"toip\", inet_global_toip},\n    { \"getaddrinfo\", inet_global_getaddrinfo},\n    { \"tohostname\", inet_global_tohostname},\n    { \"getnameinfo\", inet_global_getnameinfo},\n    { \"gethostname\", inet_global_gethostname},\n    { NULL, NULL}\n};\n\n#ifdef _WINDOWS_\n/****luodx patch for windows xp start**/\nchar* win32xp_inet_ntop(int family, PVOID src, char* dest, size_t length)\n{\n\tchar* result = inet_ntoa(*(IN_ADDR*)src);\n\tif (result != NULL){\n\t\tstrcpy(dest, result);\n\t}\n\treturn result;\n}\n\nint win32xp_inet_pton(int family, const char* string, PVOID dest) {\n\treturn inet_aton(string, (IN_ADDR*)dest);\n}\n/****luodx patch for windows xp end**/\n#endif\n\n\n/*=========================================================================*\\\n* Exported functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nint inet_open(lua_State *L)\n{\n    lua_pushstring(L, \"dns\");\n    lua_newtable(L);\n    luaL_openlib(L, NULL, func, 0);\n    lua_settable(L, -3);\n    return 0;\n}\n\n/*=========================================================================*\\\n* Global Lua functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Returns all information provided by the resolver given a host name\n* or ip address\n\\*-------------------------------------------------------------------------*/\nstatic int inet_gethost(const char *address, struct hostent **hp) {\n    struct in_addr addr;\n    if (inet_aton(address, &addr))\n        return socket_gethostbyaddr((char *) &addr, sizeof(addr), hp);\n    else\n        return socket_gethostbyname(address, hp);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Returns all information provided by the resolver given a host name\n* or ip address\n\\*-------------------------------------------------------------------------*/\nstatic int inet_global_tohostname(lua_State *L) {\n    const char *address = luaL_checkstring(L, 1);\n    struct hostent *hp = NULL;\n    int err = inet_gethost(address, &hp);\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_hoststrerror(err));\n        return 2;\n    }\n    lua_pushstring(L, hp->h_name);\n    inet_pushresolved(L, hp);\n    return 2;\n}\n\nstatic int inet_global_getnameinfo(lua_State *L) {\n    int i, ret;\n    char host[1024];\n    char serv[32];\n    struct addrinfo hints;\n    struct addrinfo *resolved, *iter;\n    const char *node = luaL_optstring(L, 1, NULL);\n    const char *service = luaL_optstring(L, 2, NULL);\n\n    if (!(node || service))\n        luaL_error(L, \"You have to specify a hostname, a service, or both\");\n\n    memset(&hints, 0, sizeof(hints));\n    hints.ai_socktype = SOCK_STREAM;\n    hints.ai_family = PF_UNSPEC;\n\n    /* getaddrinfo must get a node and a service argument */\n    ret = getaddrinfo(node ? node : \"127.0.0.1\", service ? service : \"7\",\n        &hints, &resolved);\n    if (ret != 0) {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_gaistrerror(ret));\n        return 2;\n    }\n\n    lua_newtable(L);\n    for (i = 1, iter = resolved; iter; i++, iter = iter->ai_next) {\n        getnameinfo(iter->ai_addr, (socklen_t) iter->ai_addrlen, host,\n            node ? (socklen_t) sizeof(host) : 0, serv, service ? (socklen_t) sizeof(serv) : 0, 0);\n\n        if (node) {\n            lua_pushnumber(L, i);\n            lua_pushstring(L, host);\n            lua_settable(L, -3);\n        }\n    }\n    freeaddrinfo(resolved);\n\n    if (service) {\n        lua_pushstring(L, serv);\n        return 2;\n    } else {\n        return 1;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Returns all information provided by the resolver given a host name\n* or ip address\n\\*-------------------------------------------------------------------------*/\nstatic int inet_global_toip(lua_State *L)\n{\n    const char *address = luaL_checkstring(L, 1);\n    struct hostent *hp = NULL;\n    int err = inet_gethost(address, &hp);\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_hoststrerror(err));\n        return 2;\n    }\n    lua_pushstring(L, inet_ntoa(*((struct in_addr *) hp->h_addr)));\n    inet_pushresolved(L, hp);\n    return 2;\n}\n\nint inet_optfamily(lua_State* L, int narg, const char* def)\n{\n    static const char* optname[] = { \"unspec\", \"inet\", \"inet6\", NULL };\n    static int optvalue[] = { PF_UNSPEC, PF_INET, PF_INET6, 0 };\n\n    return optvalue[luaL_checkoption(L, narg, def, optname)];\n}\n\nint inet_optsocktype(lua_State* L, int narg, const char* def)\n{\n    static const char* optname[] = { \"stream\", \"dgram\", NULL };\n    static int optvalue[] = { SOCK_STREAM, SOCK_DGRAM, 0 };\n\n    return optvalue[luaL_checkoption(L, narg, def, optname)];\n}\n\nstatic int inet_global_getaddrinfo(lua_State *L)\n{\n    const char *hostname = luaL_checkstring(L, 1);\n    struct addrinfo *iterator = NULL, *resolved = NULL;\n    struct addrinfo hints;\n    int i = 1, ret = 0;\n    memset(&hints, 0, sizeof(hints));\n    hints.ai_socktype = SOCK_STREAM;\n    hints.ai_family = PF_UNSPEC;\n    ret = getaddrinfo(hostname, NULL, &hints, &resolved);\n    if (ret != 0) {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_gaistrerror(ret));\n        return 2;\n    }\n    lua_newtable(L);\n    for (iterator = resolved; iterator; iterator = iterator->ai_next) {\n        char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];\n        getnameinfo(iterator->ai_addr, (socklen_t) iterator->ai_addrlen, hbuf, \n            (socklen_t) sizeof(hbuf), sbuf, 0, NI_NUMERICHOST);\n        lua_pushnumber(L, i);\n        lua_newtable(L);\n        switch (iterator->ai_family) {\n            case AF_INET:\n                lua_pushliteral(L, \"family\");\n                lua_pushliteral(L, \"inet\");\n                lua_settable(L, -3);\n                break;\n            case AF_INET6:\n                lua_pushliteral(L, \"family\");\n                lua_pushliteral(L, \"inet6\");\n                lua_settable(L, -3);\n                break;;\n        }\n        lua_pushliteral(L, \"addr\");\n        lua_pushstring(L, hbuf);\n        lua_settable(L, -3);\n        lua_settable(L, -3);\n        i++;\n    }\n    freeaddrinfo(resolved);\n    return 1;\n}\n\n\n/*-------------------------------------------------------------------------*\\\n* Gets the host name\n\\*-------------------------------------------------------------------------*/\nstatic int inet_global_gethostname(lua_State *L)\n{\n    char name[257];\n    name[256] = '\\0';\n    if (gethostname(name, 256) < 0) {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_strerror(errno));\n        return 2;\n    } else {\n        lua_pushstring(L, name);\n        return 1;\n    }\n}\n\n\n\n/*=========================================================================*\\\n* Lua methods\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Retrieves socket peer name\n\\*-------------------------------------------------------------------------*/\nint inet_meth_getpeername(lua_State *L, p_socket ps, int family)\n{\n    switch (family) {\n        case PF_INET: {\n            struct sockaddr_in peer;\n            socklen_t peer_len = sizeof(peer);\n            char name[INET_ADDRSTRLEN];\n            if (getpeername(*ps, (SA *) &peer, &peer_len) < 0) {\n                lua_pushnil(L);\n                lua_pushstring(L, socket_strerror(errno));\n                return 2;\n            } else {\n                my_inet_ntop(family, &peer.sin_addr, name, sizeof(name));\n                lua_pushstring(L, name); \n                lua_pushnumber(L, ntohs(peer.sin_port));\n                lua_pushliteral(L, \"inet\");\n                return 3;\n            }\n        }\n        case PF_INET6: {\n            struct sockaddr_in6 peer;\n            socklen_t peer_len = sizeof(peer);\n            char name[INET6_ADDRSTRLEN];\n            if (getpeername(*ps, (SA *) &peer, &peer_len) < 0) {\n                lua_pushnil(L);\n                lua_pushstring(L, socket_strerror(errno));\n                return 2;\n            } else {\n                my_inet_ntop(family, &peer.sin6_addr, name, sizeof(name));\n                lua_pushstring(L, name); \n                lua_pushnumber(L, ntohs(peer.sin6_port));\n                lua_pushliteral(L, \"inet6\");\n                return 3;\n            }\n        }\n        default:\n            lua_pushnil(L);\n            lua_pushfstring(L, \"unknown family %d\", family);\n            return 2;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Retrieves socket local name\n\\*-------------------------------------------------------------------------*/\nint inet_meth_getsockname(lua_State *L, p_socket ps, int family)\n{\n    switch (family) {\n        case PF_INET: {\n            struct sockaddr_in local;\n            socklen_t local_len = sizeof(local);\n            char name[INET_ADDRSTRLEN];\n            if (getsockname(*ps, (SA *) &local, &local_len) < 0) {\n                lua_pushnil(L);\n                lua_pushstring(L, socket_strerror(errno));\n                return 2;\n            } else {\n                my_inet_ntop(family, &local.sin_addr, name, sizeof(name));\n                lua_pushstring(L, name); \n                lua_pushnumber(L, ntohs(local.sin_port));\n                lua_pushliteral(L, \"inet\");\n                return 3;\n            }\n        }\n        case PF_INET6: {\n            struct sockaddr_in6 local;\n            socklen_t local_len = sizeof(local);\n            char name[INET6_ADDRSTRLEN];\n            if (getsockname(*ps, (SA *) &local, &local_len) < 0) {\n                lua_pushnil(L);\n                lua_pushstring(L, socket_strerror(errno));\n                return 2;\n            } else {\n                my_inet_ntop(family, &local.sin6_addr, name, sizeof(name));\n                lua_pushstring(L, name); \n                lua_pushnumber(L, ntohs(local.sin6_port));\n                lua_pushliteral(L, \"inet6\");\n                return 3;\n            }\n        }\n        default:\n            lua_pushnil(L);\n            lua_pushfstring(L, \"unknown family %d\", family);\n            return 2;\n    }\n}\n\n/*=========================================================================*\\\n* Internal functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Passes all resolver information to Lua as a table\n\\*-------------------------------------------------------------------------*/\nstatic void inet_pushresolved(lua_State *L, struct hostent *hp)\n{\n    char **alias;\n    struct in_addr **addr;\n    int i, resolved;\n    lua_newtable(L); resolved = lua_gettop(L);\n    lua_pushstring(L, \"name\");\n    lua_pushstring(L, hp->h_name);\n    lua_settable(L, resolved);\n    lua_pushstring(L, \"ip\");\n    lua_pushstring(L, \"alias\");\n    i = 1;\n    alias = hp->h_aliases;\n    lua_newtable(L);\n    if (alias) {\n        while (*alias) {\n            lua_pushnumber(L, i);\n            lua_pushstring(L, *alias);\n            lua_settable(L, -3);\n            i++; alias++;\n        }\n    }\n    lua_settable(L, resolved);\n    i = 1;\n    lua_newtable(L);\n    addr = (struct in_addr **) hp->h_addr_list;\n    if (addr) {\n        while (*addr) {\n            lua_pushnumber(L, i);\n            lua_pushstring(L, inet_ntoa(**addr));\n            lua_settable(L, -3);\n            i++; addr++;\n        }\n    }\n    lua_settable(L, resolved);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Tries to create a new inet socket\n\\*-------------------------------------------------------------------------*/\nconst char *inet_trycreate(p_socket ps, int family, int type) {\n    return socket_strerror(socket_create(ps, family, type, 0));\n}\n\n/*-------------------------------------------------------------------------*\\\n* \"Disconnects\" a DGRAM socket\n\\*-------------------------------------------------------------------------*/\nconst char *inet_trydisconnect(p_socket ps, int family, p_timeout tm)\n{\n    switch (family) {\n        case PF_INET: {\n            struct sockaddr_in sin;\n            memset((char *) &sin, 0, sizeof(sin));\n            sin.sin_family = AF_UNSPEC;\n            sin.sin_addr.s_addr = INADDR_ANY;\n            return socket_strerror(socket_connect(ps, (SA *) &sin, \n                sizeof(sin), tm));\n        }\n        case PF_INET6: {\n            struct sockaddr_in6 sin6;\n            struct in6_addr addrany = IN6ADDR_ANY_INIT; \n            memset((char *) &sin6, 0, sizeof(sin6));\n            sin6.sin6_family = AF_UNSPEC;\nfprintf(stderr, \"disconnecting\\n\");\n            sin6.sin6_addr = addrany;\n            return socket_strerror(socket_connect(ps, (SA *) &sin6, \n                sizeof(sin6), tm));\n        }\n    }\n    return NULL;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Tries to connect to remote address (address, port)\n\\*-------------------------------------------------------------------------*/\nconst char *inet_tryconnect(p_socket ps, const char *address,\n        const char *serv, p_timeout tm, struct addrinfo *connecthints)\n{\n    struct addrinfo *iterator = NULL, *resolved = NULL;\n    const char *err = NULL;\n    /* try resolving */\n    err = socket_gaistrerror(getaddrinfo(address, serv,\n                connecthints, &resolved));\n    if (err != NULL) {\n        if (resolved) freeaddrinfo(resolved);\n        return err;\n    }\n    for (iterator = resolved; iterator; iterator = iterator->ai_next) {\n        timeout_markstart(tm);\n        /* try connecting to remote address */\n        err = socket_strerror(socket_connect(ps, (SA *) iterator->ai_addr, \n            (socklen_t) iterator->ai_addrlen, tm));\n        /* if success, break out of loop */\n        if (err == NULL) break;\n    }\n    freeaddrinfo(resolved);\n    /* here, if err is set, we failed */\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Tries to accept a socket\n\\*-------------------------------------------------------------------------*/\nconst char *inet_tryaccept(p_socket server, int family, p_socket client, p_timeout tm)\n{\n\tsocklen_t len;\n\tt_sockaddr_storage addr;\n\tif (family == PF_INET6) {\n\t\tlen = sizeof(struct sockaddr_in6);\n\t} else {\n\t\tlen = sizeof(struct sockaddr_in);\n\t}\n\treturn socket_strerror(socket_accept(server, client, (SA *) &addr, &len, tm));\n}\n\n/*-------------------------------------------------------------------------*\\\n* Tries to bind socket to (address, port)\n\\*-------------------------------------------------------------------------*/\nconst char *inet_trybind(p_socket ps, const char *address, const char *serv,\n        struct addrinfo *bindhints)\n{\n    struct addrinfo *iterator = NULL, *resolved = NULL;\n    const char *err = NULL;\n    t_socket sock = *ps;\n    /* try resolving */\n    err = socket_gaistrerror(getaddrinfo(address, serv, bindhints, &resolved));\n    if (err) {\n        if (resolved) freeaddrinfo(resolved);\n        return err;\n    }\n    /* iterate over resolved addresses until one is good */\n    for (iterator = resolved; iterator; iterator = iterator->ai_next) {\n        if(sock == SOCKET_INVALID) {\n            err = socket_strerror(socket_create(&sock, iterator->ai_family,\n                        iterator->ai_socktype, iterator->ai_protocol));\n            if(err)\n                continue;\n        }\n        /* try binding to local address */\n        err = socket_strerror(socket_bind(&sock,\n            (SA *) iterator->ai_addr,\n            (socklen_t) iterator->ai_addrlen));\n\n        /* keep trying unless bind succeeded */\n        if (err) {\n            if(sock != *ps)\n                socket_destroy(&sock);\n        } else {\n            /* remember what we connected to, particularly the family */\n            *bindhints = *iterator;\n            break;\n        }\n    }\n    /* cleanup and return error */\n    freeaddrinfo(resolved);\n    *ps = sock;\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Some systems do not provide this so that we provide our own. It's not\n* marvelously fast, but it works just fine.\n\\*-------------------------------------------------------------------------*/\n#ifdef INET_ATON\nint inet_aton(const char *cp, struct in_addr *inp)\n{\n    unsigned int a = 0, b = 0, c = 0, d = 0;\n    int n = 0, r;\n    unsigned long int addr = 0;\n    r = sscanf(cp, \"%u.%u.%u.%u%n\", &a, &b, &c, &d, &n);\n    if (r == 0 || n == 0) return 0;\n    cp += n;\n    if (*cp) return 0;\n    if (a > 255 || b > 255 || c > 255 || d > 255) return 0;\n    if (inp) {\n        addr += a; addr <<= 8;\n        addr += b; addr <<= 8;\n        addr += c; addr <<= 8;\n        addr += d;\n        inp->s_addr = htonl(addr);\n    }\n    return 1;\n}\n#endif\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/inet.h",
    "content": "#ifndef INET_H \n#define INET_H \n/*=========================================================================*\\\n* Internet domain functions\n* LuaSocket toolkit\n*\n* This module implements the creation and connection of internet domain\n* sockets, on top of the socket.h interface, and the interface of with the\n* resolver. \n*\n* The function inet_aton is provided for the platforms where it is not\n* available. The module also implements the interface of the internet\n* getpeername and getsockname functions as seen by Lua programs.\n*\n* The Lua functions toip and tohostname are also implemented here.\n\\*=========================================================================*/\n#include \"lua.h\"\n#include \"socket.h\"\n#include \"timeout.h\"\n\n#ifdef _WIN32\n#define INET_ATON\n#endif\n\nint inet_open(lua_State *L);\n\nconst char *inet_trycreate(p_socket ps, int family, int type);\nconst char *inet_tryconnect(p_socket ps, const char *address,\n        const char *serv, p_timeout tm, struct addrinfo *connecthints);\nconst char *inet_trybind(p_socket ps, const char *address, const char *serv,\n        struct addrinfo *bindhints);\nconst char *inet_trydisconnect(p_socket ps, int family, p_timeout tm);\nconst char *inet_tryaccept(p_socket server, int family, p_socket client, p_timeout tm);\n\nint inet_meth_getpeername(lua_State *L, p_socket ps, int family);\nint inet_meth_getsockname(lua_State *L, p_socket ps, int family);\n\nint inet_optfamily(lua_State* L, int narg, const char* def);\nint inet_optsocktype(lua_State* L, int narg, const char* def);\n\n#ifdef INET_ATON\nint inet_aton(const char *cp, struct in_addr *inp);\n#endif\n\n#ifndef _WINDOWS_\n#define my_inet_ntop(a,b,c,d) inet_ntop(a,b,c,d)\n#define my_inet_pton(a,b,c) inet_pton(a,b,c)\n#else\nint win32xp_inet_pton(int family, const char* string, PVOID dest);\nchar* win32xp_inet_ntop(int family, PVOID src, char* dest, size_t length);\n#define my_inet_ntop(a,b,c,d) win32xp_inet_ntop(a,b,c,d)\n#define my_inet_pton(a,b,c) win32xp_inet_pton(a,b,c)\n#endif\n\n\n#endif /* INET_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/luasocket.c",
    "content": "/*=========================================================================*\\\n* LuaSocket toolkit\n* Networking support for the Lua language\n* Diego Nehab\n* 26/11/1999\n*\n* This library is part of an  effort to progressively increase the network\n* connectivity  of  the Lua  language.  The  Lua interface  to  networking\n* functions follows the Sockets API  closely, trying to simplify all tasks\n* involved in setting up both  client and server connections. The provided\n* IO routines, however, follow the Lua  style, being very similar  to the\n* standard Lua read and write functions.\n\\*=========================================================================*/\n\n/*=========================================================================*\\\n* Standard include files\n\\*=========================================================================*/\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501)\n#include \"compat-5.1.h\"\n#endif\n\n/*=========================================================================*\\\n* LuaSocket includes\n\\*=========================================================================*/\n#include \"luasocket.h\"\n#include \"auxiliar.h\"\n#include \"except.h\"\n#include \"timeout.h\"\n#include \"luasocket_buffer.h\"\n#include \"inet.h\"\n#include \"tcp.h\"\n#include \"udp.h\"\n#include \"select.h\"\n\n/*-------------------------------------------------------------------------*\\\n* Internal function prototypes\n\\*-------------------------------------------------------------------------*/\nstatic int global_skip(lua_State *L);\nstatic int global_unload(lua_State *L);\nstatic int base_open(lua_State *L);\n\n/*-------------------------------------------------------------------------*\\\n* Modules and functions\n\\*-------------------------------------------------------------------------*/\nstatic const luaL_Reg mod[] = {\n    {\"auxiliar\", auxiliar_open},\n    {\"except\", except_open},\n    {\"timeout\", timeout_open},\n    {\"buffer\", buffer_open},\n    {\"inet\", inet_open},\n    {\"tcp\", tcp_open},\n    {\"udp\", udp_open},\n    {\"select\", select_open},\n    {NULL, NULL}\n};\n\nstatic luaL_Reg func[] = {\n    {\"skip\",      global_skip},\n    {\"__unload\",  global_unload},\n    {NULL,        NULL}\n};\n\n/*-------------------------------------------------------------------------*\\\n* Skip a few arguments\n\\*-------------------------------------------------------------------------*/\nstatic int global_skip(lua_State *L) {\n    int amount = luaL_checkint(L, 1);\n    int ret = lua_gettop(L) - amount - 1;\n    return ret >= 0 ? ret : 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Unloads the library\n\\*-------------------------------------------------------------------------*/\nstatic int global_unload(lua_State *L) {\n    (void) L;\n    socket_close();\n    return 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Setup basic stuff.\n\\*-------------------------------------------------------------------------*/\nstatic int base_open(lua_State *L) {\n    if (socket_open()) {\n        /* export functions (and leave namespace table on top of stack) */\n        luaL_openlib(L, \"socket\", func, 0);\n#ifdef LUASOCKET_DEBUG\n        lua_pushstring(L, \"_DEBUG\");\n        lua_pushboolean(L, 1);\n        lua_rawset(L, -3);\n#endif\n        /* make version string available to scripts */\n        lua_pushstring(L, \"_VERSION\");\n        lua_pushstring(L, LUASOCKET_VERSION);\n        lua_rawset(L, -3);\n        return 1;\n    } else {\n        lua_pushstring(L, \"unable to initialize library\");\n        lua_error(L);\n        return 0;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Initializes all library modules.\n\\*-------------------------------------------------------------------------*/\nLUASOCKET_API int luaopen_socket_core(lua_State *L) {\n    int i;\n    base_open(L);\n    for (i = 0; mod[i].name; i++) mod[i].func(L);\n    return 1;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/luasocket.h",
    "content": "#ifndef LUASOCKET_H\n#define LUASOCKET_H\n/*=========================================================================*\\\n* LuaSocket toolkit\n* Networking support for the Lua language\n* Diego Nehab\n* 9/11/1999\n\\*=========================================================================*/\n#include \"lua.h\"\n\n/*-------------------------------------------------------------------------*\\\n* Current socket library version\n\\*-------------------------------------------------------------------------*/\n#define LUASOCKET_VERSION    \"LuaSocket 2.1-rc1\"\n#define LUASOCKET_COPYRIGHT  \"Copyright (C) 1999-2012 Diego Nehab\"\n#define LUASOCKET_AUTHORS    \"Diego Nehab\"\n\n/*-------------------------------------------------------------------------*\\\n* This macro prefixes all exported API functions\n\\*-------------------------------------------------------------------------*/\n#ifndef LUASOCKET_API\n#define LUASOCKET_API extern\n#endif\n\n#if LUA_VERSION_NUM\t> 501 & !( defined LUA_COMPAT_MODULE)\n#\terror Lua 5.2 requires LUA_COMPAT_MODULE defined for luaL_openlib\n#endif\n\n/*-------------------------------------------------------------------------*\\\n* Initializes the library.\n\\*-------------------------------------------------------------------------*/\nLUASOCKET_API int luaopen_socket_core(lua_State *L);\n\n#endif /* LUASOCKET_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/luasocket_buffer.c",
    "content": "/*=========================================================================*\\\n* Input/Output interface for Lua programs\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"luasocket_buffer.h\"\n\n/*=========================================================================*\\\n* Internal function prototypes\n\\*=========================================================================*/\nstatic int recvraw(p_buffer buf, size_t wanted, luaL_Buffer *b);\nstatic int recvline(p_buffer buf, luaL_Buffer *b);\nstatic int recvall(p_buffer buf, luaL_Buffer *b);\nstatic int buffer_get(p_buffer buf, const char **data, size_t *count);\nstatic void buffer_skip(p_buffer buf, size_t count);\nstatic int sendraw(p_buffer buf, const char *data, size_t count, size_t *sent);\n\n/* min and max macros */\n#ifndef MIN\n#define MIN(x, y) ((x) < (y) ? x : y)\n#endif\n#ifndef MAX\n#define MAX(x, y) ((x) > (y) ? x : y)\n#endif\n\n/*=========================================================================*\\\n* Exported functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nint buffer_open(lua_State *L) {\n    (void) L;\n    return 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Initializes C structure \n\\*-------------------------------------------------------------------------*/\nvoid buffer_init(p_buffer buf, p_io io, p_timeout tm) {\n    buf->first = buf->last = 0;\n    buf->io = io;\n    buf->tm = tm;\n    buf->received = buf->sent = 0;\n    buf->birthday = timeout_gettime();\n}\n\n/*-------------------------------------------------------------------------*\\\n* object:getstats() interface\n\\*-------------------------------------------------------------------------*/\nint buffer_meth_getstats(lua_State *L, p_buffer buf) {\n    lua_pushnumber(L, (lua_Number) buf->received);\n    lua_pushnumber(L, (lua_Number) buf->sent);\n    lua_pushnumber(L, timeout_gettime() - buf->birthday);\n    return 3;\n}\n\n/*-------------------------------------------------------------------------*\\\n* object:setstats() interface\n\\*-------------------------------------------------------------------------*/\nint buffer_meth_setstats(lua_State *L, p_buffer buf) {\n    buf->received = (long) luaL_optnumber(L, 2, (lua_Number) buf->received); \n    buf->sent = (long) luaL_optnumber(L, 3, (lua_Number) buf->sent); \n    if (lua_isnumber(L, 4)) buf->birthday = timeout_gettime() - lua_tonumber(L, 4);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* object:send() interface\n\\*-------------------------------------------------------------------------*/\nint buffer_meth_send(lua_State *L, p_buffer buf) {\n    int top = lua_gettop(L);\n    int err = IO_DONE;\n    size_t size = 0, sent = 0;\n    const char *data = luaL_checklstring(L, 2, &size);\n    long start = (long) luaL_optnumber(L, 3, 1);\n    long end = (long) luaL_optnumber(L, 4, -1);\n#ifdef LUASOCKET_DEBUG\n    p_timeout tm = timeout_markstart(buf->tm);\n#endif\n    if (start < 0) start = (long) (size+start+1);\n    if (end < 0) end = (long) (size+end+1);\n    if (start < 1) start = (long) 1;\n    if (end > (long) size) end = (long) size;\n    if (start <= end) err = sendraw(buf, data+start-1, end-start+1, &sent);\n    /* check if there was an error */\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, buf->io->error(buf->io->ctx, err)); \n        lua_pushnumber(L, (lua_Number) (sent+start-1));\n    } else {\n        lua_pushnumber(L, (lua_Number) (sent+start-1));\n        lua_pushnil(L);\n        lua_pushnil(L);\n    }\n#ifdef LUASOCKET_DEBUG\n    /* push time elapsed during operation as the last return value */\n    lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));\n#endif\n    return lua_gettop(L) - top;\n}\n\n/*-------------------------------------------------------------------------*\\\n* object:receive() interface\n\\*-------------------------------------------------------------------------*/\nint buffer_meth_receive(lua_State *L, p_buffer buf) {\n    int err = IO_DONE, top = lua_gettop(L);\n    luaL_Buffer b;\n    size_t size;\n    const char *part = luaL_optlstring(L, 3, \"\", &size);\n#ifdef LUASOCKET_DEBUG\n    p_timeout tm = timeout_markstart(buf->tm);\n#endif\n    /* initialize buffer with optional extra prefix \n     * (useful for concatenating previous partial results) */\n    luaL_buffinit(L, &b);\n    luaL_addlstring(&b, part, size);\n    /* receive new patterns */\n    if (!lua_isnumber(L, 2)) {\n        const char *p= luaL_optstring(L, 2, \"*l\");\n        if (p[0] == '*' && p[1] == 'l') err = recvline(buf, &b);\n        else if (p[0] == '*' && p[1] == 'a') err = recvall(buf, &b); \n        else luaL_argcheck(L, 0, 2, \"invalid receive pattern\");\n    /* get a fixed number of bytes (minus what was already partially \n     * received) */\n    } else {\n        double n = lua_tonumber(L, 2); \n        size_t wanted = (size_t) n;\n        luaL_argcheck(L, n >= 0, 2, \"invalid receive pattern\");\n        if (size == 0 || wanted > size)\n            err = recvraw(buf, wanted-size, &b);\n    }\n    /* check if there was an error */\n    if (err != IO_DONE) {\n        /* we can't push anyting in the stack before pushing the\n         * contents of the buffer. this is the reason for the complication */\n        luaL_pushresult(&b);\n        lua_pushstring(L, buf->io->error(buf->io->ctx, err)); \n        lua_pushvalue(L, -2); \n        lua_pushnil(L);\n        lua_replace(L, -4);\n    } else {\n        luaL_pushresult(&b);\n        lua_pushnil(L);\n        lua_pushnil(L);\n    }\n#ifdef LUASOCKET_DEBUG\n    /* push time elapsed during operation as the last return value */\n    lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm));\n#endif\n    return lua_gettop(L) - top;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Determines if there is any data in the read buffer\n\\*-------------------------------------------------------------------------*/\nint buffer_isempty(p_buffer buf) {\n    return buf->first >= buf->last;\n}\n\n/*=========================================================================*\\\n* Internal functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Sends a block of data (unbuffered)\n\\*-------------------------------------------------------------------------*/\n#define STEPSIZE 8192\nstatic int sendraw(p_buffer buf, const char *data, size_t count, size_t *sent) {\n    p_io io = buf->io;\n    p_timeout tm = buf->tm;\n    size_t total = 0;\n    int err = IO_DONE;\n    while (total < count && err == IO_DONE) {\n        size_t done = 0;\n        size_t step = (count-total <= STEPSIZE)? count-total: STEPSIZE;\n        err = io->send(io->ctx, data+total, step, &done, tm);\n        total += done;\n    }\n    *sent = total;\n    buf->sent += total;\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Reads a fixed number of bytes (buffered)\n\\*-------------------------------------------------------------------------*/\nstatic int recvraw(p_buffer buf, size_t wanted, luaL_Buffer *b) {\n    int err = IO_DONE;\n    size_t total = 0;\n    while (err == IO_DONE) {\n        size_t count; const char *data;\n        err = buffer_get(buf, &data, &count);\n        count = MIN(count, wanted - total);\n        luaL_addlstring(b, data, count);\n        buffer_skip(buf, count);\n        total += count;\n        if (total >= wanted) break;\n    }\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Reads everything until the connection is closed (buffered)\n\\*-------------------------------------------------------------------------*/\nstatic int recvall(p_buffer buf, luaL_Buffer *b) {\n    int err = IO_DONE;\n    size_t total = 0;\n    while (err == IO_DONE) {\n        const char *data; size_t count;\n        err = buffer_get(buf, &data, &count);\n        total += count;\n        luaL_addlstring(b, data, count);\n        buffer_skip(buf, count);\n    }\n    if (err == IO_CLOSED) {\n        if (total > 0) return IO_DONE;\n        else return IO_CLOSED;\n    } else return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Reads a line terminated by a CR LF pair or just by a LF. The CR and LF \n* are not returned by the function and are discarded from the buffer\n\\*-------------------------------------------------------------------------*/\nstatic int recvline(p_buffer buf, luaL_Buffer *b) {\n    int err = IO_DONE;\n    while (err == IO_DONE) {\n        size_t count, pos; const char *data;\n        err = buffer_get(buf, &data, &count);\n        pos = 0;\n        while (pos < count && data[pos] != '\\n') {\n            /* we ignore all \\r's */\n            if (data[pos] != '\\r') luaL_addchar(b, data[pos]);\n            pos++;\n        }\n        if (pos < count) { /* found '\\n' */\n            buffer_skip(buf, pos+1); /* skip '\\n' too */\n            break; /* we are done */\n        } else /* reached the end of the buffer */\n            buffer_skip(buf, pos);\n    }\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Skips a given number of bytes from read buffer. No data is read from the\n* transport layer\n\\*-------------------------------------------------------------------------*/\nstatic void buffer_skip(p_buffer buf, size_t count) {\n    buf->received += count;\n    buf->first += count;\n    if (buffer_isempty(buf)) \n        buf->first = buf->last = 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Return any data available in buffer, or get more data from transport layer\n* if buffer is empty\n\\*-------------------------------------------------------------------------*/\nstatic int buffer_get(p_buffer buf, const char **data, size_t *count) {\n    int err = IO_DONE;\n    p_io io = buf->io;\n    p_timeout tm = buf->tm;\n    if (buffer_isempty(buf)) {\n        size_t got;\n        err = io->recv(io->ctx, buf->data, BUF_SIZE, &got, tm);\n        buf->first = 0;\n        buf->last = got;\n    }\n    *count = buf->last - buf->first;\n    *data = buf->data + buf->first;\n    return err;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/luasocket_buffer.h",
    "content": "#ifndef BUF_H\n#define BUF_H \n/*=========================================================================*\\\n* Input/Output interface for Lua programs\n* LuaSocket toolkit\n*\n* Line patterns require buffering. Reading one character at a time involves\n* too many system calls and is very slow. This module implements the\n* LuaSocket interface for input/output on connected objects, as seen by \n* Lua programs. \n*\n* Input is buffered. Output is *not* buffered because there was no simple\n* way of making sure the buffered output data would ever be sent.\n*\n* The module is built on top of the I/O abstraction defined in io.h and the\n* timeout management is done with the timeout.h interface.\n\\*=========================================================================*/\n#include \"lua.h\"\n\n#include \"luasocket_io.h\"\n#include \"timeout.h\"\n\n/* buffer size in bytes */\n#define BUF_SIZE 8192\n\n/* buffer control structure */\ntypedef struct t_buffer_ {\n    double birthday;        /* throttle support info: creation time, */\n    size_t sent, received;  /* bytes sent, and bytes received */\n    p_io io;                /* IO driver used for this buffer */\n    p_timeout tm;           /* timeout management for this buffer */\n    size_t first, last;     /* index of first and last bytes of stored data */\n    char data[BUF_SIZE];    /* storage space for buffer data */\n} t_buffer;\ntypedef t_buffer *p_buffer;\n\nint buffer_open(lua_State *L);\nvoid buffer_init(p_buffer buf, p_io io, p_timeout tm);\nint buffer_meth_send(lua_State *L, p_buffer buf);\nint buffer_meth_receive(lua_State *L, p_buffer buf);\nint buffer_meth_getstats(lua_State *L, p_buffer buf);\nint buffer_meth_setstats(lua_State *L, p_buffer buf);\nint buffer_isempty(p_buffer buf);\n\n#endif /* BUF_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/luasocket_io.c",
    "content": "/*=========================================================================*\\\n* Input/Output abstraction\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include \"luasocket_io.h\"\n\n/*=========================================================================*\\\n* Exported functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Initializes C structure\n\\*-------------------------------------------------------------------------*/\nvoid io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx) {\n    io->send = send;\n    io->recv = recv;\n    io->error = error;\n    io->ctx = ctx;\n}\n\n/*-------------------------------------------------------------------------*\\\n* I/O error strings\n\\*-------------------------------------------------------------------------*/\nconst char *io_strerror(int err) {\n    switch (err) {\n        case IO_DONE: return NULL;\n        case IO_CLOSED: return \"closed\";\n        case IO_TIMEOUT: return \"timeout\";\n        default: return \"unknown error\"; \n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/luasocket_io.h",
    "content": "#ifndef IO_H\n#define IO_H\n/*=========================================================================*\\\n* Input/Output abstraction\n* LuaSocket toolkit\n*\n* This module defines the interface that LuaSocket expects from the\n* transport layer for streamed input/output. The idea is that if any\n* transport implements this interface, then the buffer.c functions\n* automatically work on it.\n*\n* The module socket.h implements this interface, and thus the module tcp.h\n* is very simple.\n\\*=========================================================================*/\n#include <stdio.h>\n#include \"lua.h\"\n\n#include \"timeout.h\"\n\n/* IO error codes */\nenum {\n    IO_DONE = 0,        /* operation completed successfully */\n    IO_TIMEOUT = -1,    /* operation timed out */\n    IO_CLOSED = -2,     /* the connection has been closed */\n\tIO_UNKNOWN = -3\n};\n\n/* interface to error message function */\ntypedef const char *(*p_error) (\n    void *ctx,          /* context needed by send */\n    int err             /* error code */\n);\n\n/* interface to send function */\ntypedef int (*p_send) (\n    void *ctx,          /* context needed by send */\n    const char *data,   /* pointer to buffer with data to send */\n    size_t count,       /* number of bytes to send from buffer */\n    size_t *sent,       /* number of bytes sent uppon return */\n    p_timeout tm        /* timeout control */\n);\n\n/* interface to recv function */\ntypedef int (*p_recv) (\n    void *ctx,          /* context needed by recv */\n    char *data,         /* pointer to buffer where data will be writen */\n    size_t count,       /* number of bytes to receive into buffer */\n    size_t *got,        /* number of bytes received uppon return */\n    p_timeout tm        /* timeout control */\n);\n\n/* IO driver definition */\ntypedef struct t_io_ {\n    void *ctx;          /* context needed by send/recv */\n    p_send send;        /* send function pointer */\n    p_recv recv;        /* receive function pointer */\n    p_error error;      /* strerror function */\n} t_io;\ntypedef t_io *p_io;\n\nvoid io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx);\nconst char *io_strerror(int err);\n\n#endif /* IO_H */\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/mime.c",
    "content": "/*=========================================================================*\\\n* MIME support functions\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501)\n#include \"compat-5.1.h\"\n#endif\n\n#include \"mime.h\"\n\n/*=========================================================================*\\\n* Don't want to trust escape character constants\n\\*=========================================================================*/\ntypedef unsigned char UC;\nstatic const char CRLF[] = \"\\r\\n\";\nstatic const char EQCRLF[] = \"=\\r\\n\";\n\n/*=========================================================================*\\\n* Internal function prototypes.\n\\*=========================================================================*/\nstatic int mime_global_wrp(lua_State *L);\nstatic int mime_global_b64(lua_State *L);\nstatic int mime_global_unb64(lua_State *L);\nstatic int mime_global_qp(lua_State *L);\nstatic int mime_global_unqp(lua_State *L);\nstatic int mime_global_qpwrp(lua_State *L);\nstatic int mime_global_eol(lua_State *L);\nstatic int mime_global_dot(lua_State *L);\n\nstatic size_t dot(int c, size_t state, luaL_Buffer *buffer);\nstatic void b64setup(UC *base);\nstatic size_t b64encode(UC c, UC *input, size_t size, luaL_Buffer *buffer);\nstatic size_t b64pad(const UC *input, size_t size, luaL_Buffer *buffer);\nstatic size_t b64decode(UC c, UC *input, size_t size, luaL_Buffer *buffer);\n\nstatic void qpsetup(UC *class, UC *unbase);\nstatic void qpquote(UC c, luaL_Buffer *buffer);\nstatic size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer);\nstatic size_t qpencode(UC c, UC *input, size_t size, \n        const char *marker, luaL_Buffer *buffer);\nstatic size_t qppad(UC *input, size_t size, luaL_Buffer *buffer);\n\n/* code support functions */\nstatic luaL_Reg func[] = {\n    { \"dot\", mime_global_dot },\n    { \"b64\", mime_global_b64 },\n    { \"eol\", mime_global_eol },\n    { \"qp\", mime_global_qp },\n    { \"qpwrp\", mime_global_qpwrp },\n    { \"unb64\", mime_global_unb64 },\n    { \"unqp\", mime_global_unqp },\n    { \"wrp\", mime_global_wrp },\n    { NULL, NULL }\n};\n\n/*-------------------------------------------------------------------------*\\\n* Quoted-printable globals\n\\*-------------------------------------------------------------------------*/\nstatic UC qpclass[256];\nstatic UC qpbase[] = \"0123456789ABCDEF\";\nstatic UC qpunbase[256];\nenum {QP_PLAIN, QP_QUOTED, QP_CR, QP_IF_LAST};\n\n/*-------------------------------------------------------------------------*\\\n* Base64 globals\n\\*-------------------------------------------------------------------------*/\nstatic const UC b64base[] =\n        \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nstatic UC b64unbase[256];\n\n/*=========================================================================*\\\n* Exported functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nMIME_API int luaopen_mime_core(lua_State *L)\n{\n    luaL_openlib(L, \"mime\", func, 0);\n    /* make version string available to scripts */\n    lua_pushstring(L, \"_VERSION\");\n    lua_pushstring(L, MIME_VERSION);\n    lua_rawset(L, -3);\n    /* initialize lookup tables */\n    qpsetup(qpclass, qpunbase);\n    b64setup(b64unbase);\n    return 1;\n}\n\n/*=========================================================================*\\\n* Global Lua functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Incrementaly breaks a string into lines. The string can have CRLF breaks.\n* A, n = wrp(l, B, length)\n* A is a copy of B, broken into lines of at most 'length' bytes. \n* 'l' is how many bytes are left for the first line of B. \n* 'n' is the number of bytes left in the last line of A. \n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_wrp(lua_State *L)\n{\n    size_t size = 0;\n    int left = (int) luaL_checknumber(L, 1);\n    const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size);\n    const UC *last = input + size;\n    int length = (int) luaL_optnumber(L, 3, 76);\n    luaL_Buffer buffer;\n    /* end of input black-hole */\n    if (!input) {\n        /* if last line has not been terminated, add a line break */\n        if (left < length) lua_pushstring(L, CRLF);\n        /* otherwise, we are done */\n        else lua_pushnil(L);\n        lua_pushnumber(L, length);\n        return 2;\n    } \n    luaL_buffinit(L, &buffer);\n    while (input < last) {\n        switch (*input) {\n            case '\\r':\n                break;\n            case '\\n':\n                luaL_addstring(&buffer, CRLF);\n                left = length;\n                break;\n            default:\n                if (left <= 0) {\n                    left = length;\n                    luaL_addstring(&buffer, CRLF);\n                }\n                luaL_addchar(&buffer, *input);\n                left--;\n                break;\n        }\n        input++;\n    }\n    luaL_pushresult(&buffer);\n    lua_pushnumber(L, left);\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Fill base64 decode map. \n\\*-------------------------------------------------------------------------*/\nstatic void b64setup(UC *unbase) \n{\n    int i;\n    for (i = 0; i <= 255; i++) unbase[i] = (UC) 255;\n    for (i = 0; i < 64; i++) unbase[b64base[i]] = (UC) i;\n    unbase['='] = 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Acumulates bytes in input buffer until 3 bytes are available. \n* Translate the 3 bytes into Base64 form and append to buffer.\n* Returns new number of bytes in buffer.\n\\*-------------------------------------------------------------------------*/\nstatic size_t b64encode(UC c, UC *input, size_t size, \n        luaL_Buffer *buffer)\n{\n    input[size++] = c;\n    if (size == 3) {\n        UC code[4];\n        unsigned long value = 0;\n        value += input[0]; value <<= 8;\n        value += input[1]; value <<= 8;\n        value += input[2]; \n        code[3] = b64base[value & 0x3f]; value >>= 6;\n        code[2] = b64base[value & 0x3f]; value >>= 6;\n        code[1] = b64base[value & 0x3f]; value >>= 6;\n        code[0] = b64base[value];\n        luaL_addlstring(buffer, (char *) code, 4);\n        size = 0;\n    }\n    return size;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Encodes the Base64 last 1 or 2 bytes and adds padding '=' \n* Result, if any, is appended to buffer.\n* Returns 0.\n\\*-------------------------------------------------------------------------*/\nstatic size_t b64pad(const UC *input, size_t size, \n        luaL_Buffer *buffer)\n{\n    unsigned long value = 0;\n    UC code[4] = {'=', '=', '=', '='};\n    switch (size) {\n        case 1:\n            value = input[0] << 4;\n            code[1] = b64base[value & 0x3f]; value >>= 6;\n            code[0] = b64base[value];\n            luaL_addlstring(buffer, (char *) code, 4);\n            break;\n        case 2:\n            value = input[0]; value <<= 8; \n            value |= input[1]; value <<= 2;\n            code[2] = b64base[value & 0x3f]; value >>= 6;\n            code[1] = b64base[value & 0x3f]; value >>= 6;\n            code[0] = b64base[value];\n            luaL_addlstring(buffer, (char *) code, 4);\n            break;\n        default:\n            break;\n    }\n    return 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Acumulates bytes in input buffer until 4 bytes are available. \n* Translate the 4 bytes from Base64 form and append to buffer.\n* Returns new number of bytes in buffer.\n\\*-------------------------------------------------------------------------*/\nstatic size_t b64decode(UC c, UC *input, size_t size, \n        luaL_Buffer *buffer)\n{\n    /* ignore invalid characters */\n    if (b64unbase[c] > 64) return size;\n    input[size++] = c;\n    /* decode atom */\n    if (size == 4) {\n        UC decoded[3];\n        int valid, value = 0;\n        value =  b64unbase[input[0]]; value <<= 6;\n        value |= b64unbase[input[1]]; value <<= 6;\n        value |= b64unbase[input[2]]; value <<= 6;\n        value |= b64unbase[input[3]];\n        decoded[2] = (UC) (value & 0xff); value >>= 8;\n        decoded[1] = (UC) (value & 0xff); value >>= 8;\n        decoded[0] = (UC) value;\n        /* take care of paddding */\n        valid = (input[2] == '=') ? 1 : (input[3] == '=') ? 2 : 3; \n        luaL_addlstring(buffer, (char *) decoded, valid);\n        return 0;\n    /* need more data */\n    } else return size;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Incrementally applies the Base64 transfer content encoding to a string\n* A, B = b64(C, D)\n* A is the encoded version of the largest prefix of C .. D that is\n* divisible by 3. B has the remaining bytes of C .. D, *without* encoding.\n* The easiest thing would be to concatenate the two strings and \n* encode the result, but we can't afford that or Lua would dupplicate\n* every chunk we received.\n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_b64(lua_State *L)\n{\n    UC atom[3];\n    size_t isize = 0, asize = 0;\n    const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);\n    const UC *last = input + isize;\n    luaL_Buffer buffer;\n    /* end-of-input blackhole */\n    if (!input) {\n        lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    }\n    /* make sure we don't confuse buffer stuff with arguments */\n    lua_settop(L, 2);\n    /* process first part of the input */\n    luaL_buffinit(L, &buffer);\n    while (input < last) \n        asize = b64encode(*input++, atom, asize, &buffer);\n    input = (UC *) luaL_optlstring(L, 2, NULL, &isize);\n    /* if second part is nil, we are done */\n    if (!input) {\n        size_t osize = 0;\n        asize = b64pad(atom, asize, &buffer);\n        luaL_pushresult(&buffer);\n        /* if the output is empty  and the input is nil, return nil */\n        lua_tolstring(L, -1, &osize);\n        if (osize == 0) lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    }\n    /* otherwise process the second part */\n    last = input + isize;\n    while (input < last) \n        asize = b64encode(*input++, atom, asize, &buffer);\n    luaL_pushresult(&buffer);\n    lua_pushlstring(L, (char *) atom, asize);\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Incrementally removes the Base64 transfer content encoding from a string\n* A, B = b64(C, D)\n* A is the encoded version of the largest prefix of C .. D that is\n* divisible by 4. B has the remaining bytes of C .. D, *without* encoding.\n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_unb64(lua_State *L)\n{\n    UC atom[4];\n    size_t isize = 0, asize = 0;\n    const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);\n    const UC *last = input + isize;\n    luaL_Buffer buffer;\n    /* end-of-input blackhole */\n    if (!input) {\n        lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    }\n    /* make sure we don't confuse buffer stuff with arguments */\n    lua_settop(L, 2);\n    /* process first part of the input */\n    luaL_buffinit(L, &buffer);\n    while (input < last) \n        asize = b64decode(*input++, atom, asize, &buffer);\n    input = (UC *) luaL_optlstring(L, 2, NULL, &isize);\n    /* if second is nil, we are done */\n    if (!input) {\n        size_t osize = 0;\n        luaL_pushresult(&buffer);\n        /* if the output is empty  and the input is nil, return nil */\n        lua_tolstring(L, -1, &osize);\n        if (osize == 0) lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    }\n    /* otherwise, process the rest of the input */\n    last = input + isize;\n    while (input < last) \n        asize = b64decode(*input++, atom, asize, &buffer);\n    luaL_pushresult(&buffer);\n    lua_pushlstring(L, (char *) atom, asize);\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Quoted-printable encoding scheme\n* all (except CRLF in text) can be =XX\n* CLRL in not text must be =XX=XX\n* 33 through 60 inclusive can be plain\n* 62 through 126 inclusive can be plain\n* 9 and 32 can be plain, unless in the end of a line, where must be =XX\n* encoded lines must be no longer than 76 not counting CRLF\n* soft line-break are =CRLF\n* To encode one byte, we need to see the next two. \n* Worst case is when we see a space, and wonder if a CRLF is comming\n\\*-------------------------------------------------------------------------*/\n/*-------------------------------------------------------------------------*\\\n* Split quoted-printable characters into classes\n* Precompute reverse map for encoding\n\\*-------------------------------------------------------------------------*/\nstatic void qpsetup(UC *cl, UC *unbase)\n{\n    int i;\n    for (i = 0; i < 256; i++) cl[i] = QP_QUOTED;\n    for (i = 33; i <= 60; i++) cl[i] = QP_PLAIN;\n    for (i = 62; i <= 126; i++) cl[i] = QP_PLAIN;\n    cl['\\t'] = QP_IF_LAST; \n    cl[' '] = QP_IF_LAST;\n    cl['\\r'] = QP_CR;\n    for (i = 0; i < 256; i++) unbase[i] = 255;\n    unbase['0'] = 0; unbase['1'] = 1; unbase['2'] = 2;\n    unbase['3'] = 3; unbase['4'] = 4; unbase['5'] = 5;\n    unbase['6'] = 6; unbase['7'] = 7; unbase['8'] = 8;\n    unbase['9'] = 9; unbase['A'] = 10; unbase['a'] = 10;\n    unbase['B'] = 11; unbase['b'] = 11; unbase['C'] = 12;\n    unbase['c'] = 12; unbase['D'] = 13; unbase['d'] = 13;\n    unbase['E'] = 14; unbase['e'] = 14; unbase['F'] = 15;\n    unbase['f'] = 15;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Output one character in form =XX\n\\*-------------------------------------------------------------------------*/\nstatic void qpquote(UC c, luaL_Buffer *buffer)\n{\n    luaL_addchar(buffer, '=');\n    luaL_addchar(buffer, qpbase[c >> 4]);\n    luaL_addchar(buffer, qpbase[c & 0x0F]);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Accumulate characters until we are sure about how to deal with them.\n* Once we are sure, output to the buffer, in the correct form. \n\\*-------------------------------------------------------------------------*/\nstatic size_t qpencode(UC c, UC *input, size_t size, \n        const char *marker, luaL_Buffer *buffer)\n{\n    input[size++] = c;\n    /* deal with all characters we can have */\n    while (size > 0) {\n        switch (qpclass[input[0]]) {\n            /* might be the CR of a CRLF sequence */\n            case QP_CR:\n                if (size < 2) return size;\n                if (input[1] == '\\n') {\n                    luaL_addstring(buffer, marker);\n                    return 0;\n                } else qpquote(input[0], buffer);\n                break;\n            /* might be a space and that has to be quoted if last in line */\n            case QP_IF_LAST:\n                if (size < 3) return size;\n                /* if it is the last, quote it and we are done */\n                if (input[1] == '\\r' && input[2] == '\\n') {\n                    qpquote(input[0], buffer);\n                    luaL_addstring(buffer, marker);\n                    return 0;\n                } else luaL_addchar(buffer, input[0]);\n                break;\n                /* might have to be quoted always */\n            case QP_QUOTED:\n                qpquote(input[0], buffer);\n                break;\n                /* might never have to be quoted */\n            default:\n                luaL_addchar(buffer, input[0]);\n                break;\n        }\n        input[0] = input[1]; input[1] = input[2];\n        size--;\n    }\n    return 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Deal with the final characters \n\\*-------------------------------------------------------------------------*/\nstatic size_t qppad(UC *input, size_t size, luaL_Buffer *buffer)\n{\n    size_t i;\n    for (i = 0; i < size; i++) {\n        if (qpclass[input[i]] == QP_PLAIN) luaL_addchar(buffer, input[i]);\n        else qpquote(input[i], buffer);\n    }\n    if (size > 0) luaL_addstring(buffer, EQCRLF);\n    return 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Incrementally converts a string to quoted-printable\n* A, B = qp(C, D, marker)\n* Marker is the text to be used to replace CRLF sequences found in A.\n* A is the encoded version of the largest prefix of C .. D that \n* can be encoded without doubts. \n* B has the remaining bytes of C .. D, *without* encoding.\n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_qp(lua_State *L)\n{\n\n    size_t asize = 0, isize = 0;\n    UC atom[3];\n    const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);\n    const UC *last = input + isize;\n    const char *marker = luaL_optstring(L, 3, CRLF);\n    luaL_Buffer buffer;\n    /* end-of-input blackhole */\n    if (!input) {\n        lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    }\n    /* make sure we don't confuse buffer stuff with arguments */\n    lua_settop(L, 3);\n    /* process first part of input */\n    luaL_buffinit(L, &buffer);\n    while (input < last)\n        asize = qpencode(*input++, atom, asize, marker, &buffer);\n    input = (UC *) luaL_optlstring(L, 2, NULL, &isize);\n    /* if second part is nil, we are done */\n    if (!input) {\n        asize = qppad(atom, asize, &buffer);\n        luaL_pushresult(&buffer);\n        if (!(*lua_tostring(L, -1))) lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    }\n    /* otherwise process rest of input */\n    last = input + isize;\n    while (input < last)\n        asize = qpencode(*input++, atom, asize, marker, &buffer);\n    luaL_pushresult(&buffer);\n    lua_pushlstring(L, (char *) atom, asize);\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Accumulate characters until we are sure about how to deal with them.\n* Once we are sure, output the to the buffer, in the correct form. \n\\*-------------------------------------------------------------------------*/\nstatic size_t qpdecode(UC c, UC *input, size_t size, luaL_Buffer *buffer) {\n    int d;\n    input[size++] = c;\n    /* deal with all characters we can deal */\n    switch (input[0]) {\n        /* if we have an escape character */\n        case '=': \n            if (size < 3) return size; \n            /* eliminate soft line break */\n            if (input[1] == '\\r' && input[2] == '\\n') return 0;\n            /* decode quoted representation */\n            c = qpunbase[input[1]]; d = qpunbase[input[2]];\n            /* if it is an invalid, do not decode */\n            if (c > 15 || d > 15) luaL_addlstring(buffer, (char *)input, 3);\n            else luaL_addchar(buffer, (char) ((c << 4) + d));\n            return 0;\n        case '\\r':\n            if (size < 2) return size; \n            if (input[1] == '\\n') luaL_addlstring(buffer, (char *)input, 2);\n            return 0;\n        default:\n            if (input[0] == '\\t' || (input[0] > 31 && input[0] < 127))\n                luaL_addchar(buffer, input[0]);\n            return 0;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Incrementally decodes a string in quoted-printable\n* A, B = qp(C, D)\n* A is the decoded version of the largest prefix of C .. D that \n* can be decoded without doubts. \n* B has the remaining bytes of C .. D, *without* decoding.\n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_unqp(lua_State *L)\n{\n    size_t asize = 0, isize = 0;\n    UC atom[3];\n    const UC *input = (UC *) luaL_optlstring(L, 1, NULL, &isize);\n    const UC *last = input + isize;\n    luaL_Buffer buffer;\n    /* end-of-input blackhole */\n    if (!input) {\n        lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    }\n    /* make sure we don't confuse buffer stuff with arguments */\n    lua_settop(L, 2);\n    /* process first part of input */\n    luaL_buffinit(L, &buffer);\n    while (input < last)\n        asize = qpdecode(*input++, atom, asize, &buffer);\n    input = (UC *) luaL_optlstring(L, 2, NULL, &isize);\n    /* if second part is nil, we are done */\n    if (!input) {\n        luaL_pushresult(&buffer);\n        if (!(*lua_tostring(L, -1))) lua_pushnil(L);\n        lua_pushnil(L);\n        return 2;\n    } \n    /* otherwise process rest of input */\n    last = input + isize;\n    while (input < last)\n        asize = qpdecode(*input++, atom, asize, &buffer);\n    luaL_pushresult(&buffer);\n    lua_pushlstring(L, (char *) atom, asize);\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Incrementally breaks a quoted-printed string into lines\n* A, n = qpwrp(l, B, length)\n* A is a copy of B, broken into lines of at most 'length' bytes. \n* 'l' is how many bytes are left for the first line of B. \n* 'n' is the number of bytes left in the last line of A. \n* There are two complications: lines can't be broken in the middle\n* of an encoded =XX, and there might be line breaks already\n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_qpwrp(lua_State *L)\n{\n    size_t size = 0;\n    int left = (int) luaL_checknumber(L, 1);\n    const UC *input = (UC *) luaL_optlstring(L, 2, NULL, &size);\n    const UC *last = input + size;\n    int length = (int) luaL_optnumber(L, 3, 76);\n    luaL_Buffer buffer;\n    /* end-of-input blackhole */\n    if (!input) {\n        if (left < length) lua_pushstring(L, EQCRLF);\n        else lua_pushnil(L);\n        lua_pushnumber(L, length);\n        return 2;\n    }\n    /* process all input */\n    luaL_buffinit(L, &buffer);\n    while (input < last) {\n        switch (*input) {\n            case '\\r':\n                break;\n            case '\\n':\n                left = length;\n                luaL_addstring(&buffer, CRLF);\n                break;\n            case '=':\n                if (left <= 3) {\n                    left = length;\n                    luaL_addstring(&buffer, EQCRLF);\n                } \n                luaL_addchar(&buffer, *input);\n                left--;\n                break;\n            default: \n                if (left <= 1) {\n                    left = length;\n                    luaL_addstring(&buffer, EQCRLF);\n                }\n                luaL_addchar(&buffer, *input);\n                left--;\n                break;\n        }\n        input++;\n    }\n    luaL_pushresult(&buffer);\n    lua_pushnumber(L, left);\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Here is what we do: \\n, and \\r are considered candidates for line\n* break. We issue *one* new line marker if any of them is seen alone, or\n* followed by a different one. That is, \\n\\n and \\r\\r will issue two\n* end of line markers each, but \\r\\n, \\n\\r etc will only issue *one*\n* marker.  This covers Mac OS, Mac OS X, VMS, Unix and DOS, as well as\n* probably other more obscure conventions.\n*\n* c is the current character being processed\n* last is the previous character\n\\*-------------------------------------------------------------------------*/\n#define eolcandidate(c) (c == '\\r' || c == '\\n')\nstatic int eolprocess(int c, int last, const char *marker, \n        luaL_Buffer *buffer)\n{\n    if (eolcandidate(c)) {\n        if (eolcandidate(last)) {\n            if (c == last) luaL_addstring(buffer, marker);\n            return 0;\n        } else {\n            luaL_addstring(buffer, marker);\n            return c;\n        }\n    } else {\n        luaL_addchar(buffer, (char) c);\n        return 0;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Converts a string to uniform EOL convention. \n* A, n = eol(o, B, marker)\n* A is the converted version of the largest prefix of B that can be\n* converted unambiguously. 'o' is the context returned by the previous \n* call. 'n' is the new context.\n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_eol(lua_State *L)\n{\n    int ctx = luaL_checkint(L, 1);\n    size_t isize = 0;\n    const char *input = luaL_optlstring(L, 2, NULL, &isize);\n    const char *last = input + isize;\n    const char *marker = luaL_optstring(L, 3, CRLF);\n    luaL_Buffer buffer;\n    luaL_buffinit(L, &buffer);\n    /* end of input blackhole */\n    if (!input) {\n       lua_pushnil(L);\n       lua_pushnumber(L, 0);\n       return 2;\n    }\n    /* process all input */\n    while (input < last)\n        ctx = eolprocess(*input++, ctx, marker, &buffer);\n    luaL_pushresult(&buffer);\n    lua_pushnumber(L, ctx);\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Takes one byte and stuff it if needed. \n\\*-------------------------------------------------------------------------*/\nstatic size_t dot(int c, size_t state, luaL_Buffer *buffer)\n{\n    luaL_addchar(buffer, (char) c);\n    switch (c) {\n        case '\\r': \n            return 1;\n        case '\\n': \n            return (state == 1)? 2: 0; \n        case '.':  \n            if (state == 2) \n                luaL_addchar(buffer, '.');\n        default:\n            return 0;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Incrementally applies smtp stuffing to a string\n* A, n = dot(l, D)\n\\*-------------------------------------------------------------------------*/\nstatic int mime_global_dot(lua_State *L)\n{\n    size_t isize = 0, state = (size_t) luaL_checknumber(L, 1);\n    const char *input = luaL_optlstring(L, 2, NULL, &isize);\n    const char *last = input + isize;\n    luaL_Buffer buffer;\n    /* end-of-input blackhole */\n    if (!input) {\n        lua_pushnil(L);\n        lua_pushnumber(L, 2);\n        return 2;\n    }\n    /* process all input */\n    luaL_buffinit(L, &buffer);\n    while (input < last) \n        state = dot(*input++, state, &buffer);\n    luaL_pushresult(&buffer);\n    lua_pushnumber(L, (lua_Number) state);\n    return 2;\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/mime.h",
    "content": "#ifndef MIME_H \n#define MIME_H \n/*=========================================================================*\\\n* Core MIME support\n* LuaSocket toolkit\n*\n* This module provides functions to implement transfer content encodings\n* and formatting conforming to RFC 2045. It is used by mime.lua, which\n* provide a higher level interface to this functionality. \n\\*=========================================================================*/\n#include \"lua.h\"\n\n/*-------------------------------------------------------------------------*\\\n* Current MIME library version\n\\*-------------------------------------------------------------------------*/\n#define MIME_VERSION    \"MIME 1.0.3-rc1\"\n#define MIME_COPYRIGHT  \"Copyright (C) 2004-2012 Diego Nehab\"\n#define MIME_AUTHORS    \"Diego Nehab\"\n\n/*-------------------------------------------------------------------------*\\\n* This macro prefixes all exported API functions\n\\*-------------------------------------------------------------------------*/\n#ifndef MIME_API\n#define MIME_API extern\n#endif\n\nMIME_API int luaopen_mime_core(lua_State *L);\n\n#endif /* MIME_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/options.c",
    "content": "/*=========================================================================*\\\n* Common option interface \n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h> \n\n#include \"lauxlib.h\"\n\n#include \"auxiliar.h\"\n#include \"options.h\"\n#include \"inet.h\"\n\n/*=========================================================================*\\\n* Internal functions prototypes\n\\*=========================================================================*/\nstatic int opt_setmembership(lua_State *L, p_socket ps, int level, int name);\nstatic int opt_setboolean(lua_State *L, p_socket ps, int level, int name);\nstatic int opt_getboolean(lua_State *L, p_socket ps, int level, int name);\nstatic int opt_set(lua_State *L, p_socket ps, int level, int name, \n        void *val, int len);\nstatic int opt_get(lua_State *L, p_socket ps, int level, int name, \n        void *val, int* len);\n\n/*=========================================================================*\\\n* Exported functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Calls appropriate option handler\n\\*-------------------------------------------------------------------------*/\nint opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps)\n{\n    const char *name = luaL_checkstring(L, 2);      /* obj, name, ... */\n    while (opt->name && strcmp(name, opt->name))\n        opt++;\n    if (!opt->func) {\n        char msg[45];\n        sprintf(msg, \"unsupported option `%.35s'\", name);\n        luaL_argerror(L, 2, msg);\n    }\n    return opt->func(L, ps);\n}\n\nint opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps)\n{\n    const char *name = luaL_checkstring(L, 2);      /* obj, name, ... */\n    while (opt->name && strcmp(name, opt->name))\n        opt++;\n    if (!opt->func) {\n        char msg[45];\n        sprintf(msg, \"unsupported option `%.35s'\", name);\n        luaL_argerror(L, 2, msg);\n    }\n    return opt->func(L, ps);\n}\n\n/* enables reuse of local address */\nint opt_set_reuseaddr(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, SOL_SOCKET, SO_REUSEADDR); \n}\n\nint opt_get_reuseaddr(lua_State *L, p_socket ps)\n{\n    return opt_getboolean(L, ps, SOL_SOCKET, SO_REUSEADDR); \n}\n\n/* enables reuse of local port */\nint opt_set_reuseport(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, SOL_SOCKET, SO_REUSEPORT); \n}\n\nint opt_get_reuseport(lua_State *L, p_socket ps)\n{\n    return opt_getboolean(L, ps, SOL_SOCKET, SO_REUSEPORT); \n}\n\n/* disables the Naggle algorithm */\nint opt_set_tcp_nodelay(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, IPPROTO_TCP, TCP_NODELAY); \n}\n\nint opt_get_tcp_nodelay(lua_State *L, p_socket ps)\n{\n    return opt_getboolean(L, ps, IPPROTO_TCP, TCP_NODELAY);\n}\n\nint opt_set_keepalive(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, SOL_SOCKET, SO_KEEPALIVE); \n}\n\nint opt_get_keepalive(lua_State *L, p_socket ps)\n{\n    return opt_getboolean(L, ps, SOL_SOCKET, SO_KEEPALIVE); \n}\n\nint opt_set_dontroute(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, SOL_SOCKET, SO_DONTROUTE);\n}\n\nint opt_set_broadcast(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, SOL_SOCKET, SO_BROADCAST);\n}\n\nint opt_set_ip_multicast_loop(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, IPPROTO_IP, IP_MULTICAST_LOOP);\n}\n\nint opt_get_ip_multicast_loop(lua_State *L, p_socket ps)\n{\n    return opt_getboolean(L, ps, IPPROTO_IP, IP_MULTICAST_LOOP);\n}\n\nint opt_set_linger(lua_State *L, p_socket ps)\n{\n    struct linger li;                      /* obj, name, table */\n    if (!lua_istable(L, 3)) auxiliar_typeerror(L,3,lua_typename(L, LUA_TTABLE));\n    lua_pushstring(L, \"on\");\n    lua_gettable(L, 3);\n    if (!lua_isboolean(L, -1)) \n        luaL_argerror(L, 3, \"boolean 'on' field expected\");\n    li.l_onoff = (u_short) lua_toboolean(L, -1);\n    lua_pushstring(L, \"timeout\");\n    lua_gettable(L, 3);\n    if (!lua_isnumber(L, -1)) \n        luaL_argerror(L, 3, \"number 'timeout' field expected\");\n    li.l_linger = (u_short) lua_tonumber(L, -1);\n    return opt_set(L, ps, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(li));\n}\n\nint opt_get_linger(lua_State *L, p_socket ps)\n{\n    struct linger li;                      /* obj, name */\n    int len = sizeof(li);\n    int err = opt_get(L, ps, SOL_SOCKET, SO_LINGER, (char *) &li, &len);\n    if (err)\n        return err;\n    lua_newtable(L);\n    lua_pushboolean(L, li.l_onoff);\n    lua_setfield(L, -2, \"on\");\n    lua_pushinteger(L, li.l_linger);\n    lua_setfield(L, -2, \"timeout\");\n    return 1;\n}\n\nint opt_set_ip_multicast_ttl(lua_State *L, p_socket ps)\n{\n    int val = (int) luaL_checknumber(L, 3);    /* obj, name, int */\n    return opt_set(L, ps, IPPROTO_IP, IP_MULTICAST_TTL, \n        (char *) &val, sizeof(val));\n}\n\nint opt_set_ip_multicast_if(lua_State *L, p_socket ps)\n{\n    const char *address = luaL_checkstring(L, 3);    /* obj, name, ip */\n    struct in_addr val;\n    val.s_addr = htonl(INADDR_ANY);\n    if (strcmp(address, \"*\") && !inet_aton(address, &val))\n        luaL_argerror(L, 3, \"ip expected\");\n    return opt_set(L, ps, IPPROTO_IP, IP_MULTICAST_IF, \n        (char *) &val, sizeof(val));\n}\n\nint opt_get_ip_multicast_if(lua_State *L, p_socket ps)\n{\n    struct in_addr val;\n    socklen_t len = sizeof(val);\n    if (getsockopt(*ps, IPPROTO_IP, IP_MULTICAST_IF, (char *) &val, &len) < 0) {\n        lua_pushnil(L);\n        lua_pushstring(L, \"getsockopt failed\");\n        return 2;\n    }\n    lua_pushstring(L, inet_ntoa(val));\n    return 1;\n}\n\nint opt_set_ip_add_membership(lua_State *L, p_socket ps)\n{\n    return opt_setmembership(L, ps, IPPROTO_IP, IP_ADD_MEMBERSHIP);\n}\n\nint opt_set_ip_drop_membersip(lua_State *L, p_socket ps)\n{\n    return opt_setmembership(L, ps, IPPROTO_IP, IP_DROP_MEMBERSHIP);\n}\n\nint opt_set_ip6_v6only(lua_State *L, p_socket ps)\n{\n    return opt_setboolean(L, ps, IPPROTO_IPV6, IPV6_V6ONLY);\n}\n\n/*=========================================================================*\\\n* Auxiliar functions\n\\*=========================================================================*/\nstatic int opt_setmembership(lua_State *L, p_socket ps, int level, int name)\n{\n    struct ip_mreq val;                   /* obj, name, table */\n    if (!lua_istable(L, 3)) auxiliar_typeerror(L,3,lua_typename(L, LUA_TTABLE));\n    lua_pushstring(L, \"multiaddr\");\n    lua_gettable(L, 3);\n    if (!lua_isstring(L, -1)) \n        luaL_argerror(L, 3, \"string 'multiaddr' field expected\");\n    if (!inet_aton(lua_tostring(L, -1), &val.imr_multiaddr)) \n        luaL_argerror(L, 3, \"invalid 'multiaddr' ip address\");\n    lua_pushstring(L, \"interface\");\n    lua_gettable(L, 3);\n    if (!lua_isstring(L, -1)) \n        luaL_argerror(L, 3, \"string 'interface' field expected\");\n    val.imr_interface.s_addr = htonl(INADDR_ANY);\n    if (strcmp(lua_tostring(L, -1), \"*\") &&\n            !inet_aton(lua_tostring(L, -1), &val.imr_interface)) \n        luaL_argerror(L, 3, \"invalid 'interface' ip address\");\n    return opt_set(L, ps, level, name, (char *) &val, sizeof(val));\n}\n\nstatic \nint opt_get(lua_State *L, p_socket ps, int level, int name, void *val, int* len)\n{\n    socklen_t socklen = *len;\n    if (getsockopt(*ps, level, name, (char *) val, &socklen) < 0) {\n        lua_pushnil(L);\n        lua_pushstring(L, \"getsockopt failed\");\n        return 2;\n    }\n    *len = socklen;\n    return 0;\n}\n\nstatic \nint opt_set(lua_State *L, p_socket ps, int level, int name, void *val, int len)\n{\n    if (setsockopt(*ps, level, name, (char *) val, len) < 0) {\n        lua_pushnil(L);\n        lua_pushstring(L, \"setsockopt failed\");\n        return 2;\n    }\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\nstatic int opt_getboolean(lua_State *L, p_socket ps, int level, int name)\n{\n    int val = 0;\n    int len = sizeof(val);\n    int err = opt_get(L, ps, level, name, (char *) &val, &len);\n    if (err)\n        return err;\n    lua_pushboolean(L, val);\n    return 1;\n}\n\nstatic int opt_setboolean(lua_State *L, p_socket ps, int level, int name)\n{\n    int val = auxiliar_checkboolean(L, 3);             /* obj, name, bool */\n    return opt_set(L, ps, level, name, (char *) &val, sizeof(val));\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/options.h",
    "content": "#ifndef OPTIONS_H\n#define OPTIONS_H\n/*=========================================================================*\\\n* Common option interface \n* LuaSocket toolkit\n*\n* This module provides a common interface to socket options, used mainly by\n* modules UDP and TCP. \n\\*=========================================================================*/\n\n#include \"lua.h\"\n#include \"socket.h\"\n\n/* option registry */\ntypedef struct t_opt {\n  const char *name;\n  int (*func)(lua_State *L, p_socket ps);\n} t_opt;\ntypedef t_opt *p_opt;\n\n/* supported options for setoption */\nint opt_set_dontroute(lua_State *L, p_socket ps);\nint opt_set_broadcast(lua_State *L, p_socket ps);\nint opt_set_reuseaddr(lua_State *L, p_socket ps);\nint opt_set_tcp_nodelay(lua_State *L, p_socket ps);\nint opt_set_keepalive(lua_State *L, p_socket ps);\nint opt_set_linger(lua_State *L, p_socket ps);\nint opt_set_reuseaddr(lua_State *L, p_socket ps);\nint opt_set_reuseport(lua_State *L, p_socket ps);\nint opt_set_ip_multicast_if(lua_State *L, p_socket ps);\nint opt_set_ip_multicast_ttl(lua_State *L, p_socket ps);\nint opt_set_ip_multicast_loop(lua_State *L, p_socket ps);\nint opt_set_ip_add_membership(lua_State *L, p_socket ps);\nint opt_set_ip_drop_membersip(lua_State *L, p_socket ps);\nint opt_set_ip6_v6only(lua_State *L, p_socket ps);\n\n/* supported options for getoption */\nint opt_get_reuseaddr(lua_State *L, p_socket ps);\nint opt_get_tcp_nodelay(lua_State *L, p_socket ps);\nint opt_get_keepalive(lua_State *L, p_socket ps);\nint opt_get_linger(lua_State *L, p_socket ps);\nint opt_get_reuseaddr(lua_State *L, p_socket ps);\nint opt_get_ip_multicast_loop(lua_State *L, p_socket ps);\nint opt_get_ip_multicast_if(lua_State *L, p_socket ps);\n\n/* invokes the appropriate option handler */\nint opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps);\nint opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps);\n\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/select.c",
    "content": "/*=========================================================================*\\\n* Select implementation\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"socket.h\"\n#include \"timeout.h\"\n#include \"select.h\"\n\n/*=========================================================================*\\\n* Internal function prototypes.\n\\*=========================================================================*/\nstatic t_socket getfd(lua_State *L);\nstatic int dirty(lua_State *L);\nstatic void collect_fd(lua_State *L, int tab, int itab, \n        fd_set *set, t_socket *max_fd);\nstatic int check_dirty(lua_State *L, int tab, int dtab, fd_set *set);\nstatic void return_fd(lua_State *L, fd_set *set, t_socket max_fd, \n        int itab, int tab, int start);\nstatic void make_assoc(lua_State *L, int tab);\nstatic int global_select(lua_State *L);\n\n/* functions in library namespace */\nstatic luaL_Reg func[] = {\n    {\"select\", global_select},\n    {NULL,     NULL}\n};\n\n/*=========================================================================*\\\n* Exported functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nint select_open(lua_State *L) {\n    lua_pushstring(L, \"_SETSIZE\");\n    lua_pushnumber(L, FD_SETSIZE);\n    lua_rawset(L, -3);\n    luaL_openlib(L, NULL, func, 0);\n    return 0;\n}\n\n/*=========================================================================*\\\n* Global Lua functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Waits for a set of sockets until a condition is met or timeout.\n\\*-------------------------------------------------------------------------*/\nstatic int global_select(lua_State *L) {\n    int rtab, wtab, itab, ret, ndirty;\n    t_socket max_fd = SOCKET_INVALID;\n    fd_set rset, wset;\n    t_timeout tm;\n    double t = luaL_optnumber(L, 3, -1);\n    FD_ZERO(&rset); FD_ZERO(&wset);\n    lua_settop(L, 3);\n    lua_newtable(L); itab = lua_gettop(L);\n    lua_newtable(L); rtab = lua_gettop(L);\n    lua_newtable(L); wtab = lua_gettop(L);\n    collect_fd(L, 1, itab, &rset, &max_fd);\n    collect_fd(L, 2, itab, &wset, &max_fd);\n    ndirty = check_dirty(L, 1, rtab, &rset);\n    t = ndirty > 0? 0.0: t;\n    timeout_init(&tm, t, -1);\n    timeout_markstart(&tm);\n    ret = socket_select(max_fd+1, &rset, &wset, NULL, &tm);\n    if (ret > 0 || ndirty > 0) {\n        return_fd(L, &rset, max_fd+1, itab, rtab, ndirty);\n        return_fd(L, &wset, max_fd+1, itab, wtab, 0);\n        make_assoc(L, rtab);\n        make_assoc(L, wtab);\n        return 2;\n    } else if (ret == 0) {\n        lua_pushstring(L, \"timeout\");\n        return 3;\n    } else {\n        luaL_error(L, \"select failed\");\n        return 3;\n    }\n}\n\n/*=========================================================================*\\\n* Internal functions\n\\*=========================================================================*/\nstatic t_socket getfd(lua_State *L) {\n    t_socket fd = SOCKET_INVALID;\n    lua_pushstring(L, \"getfd\");\n    lua_gettable(L, -2);\n    if (!lua_isnil(L, -1)) {\n        lua_pushvalue(L, -2);\n        lua_call(L, 1, 1);\n        if (lua_isnumber(L, -1)) {\n            double numfd = lua_tonumber(L, -1); \n            fd = (numfd >= 0.0)? (t_socket) numfd: SOCKET_INVALID;\n        }\n    } \n    lua_pop(L, 1);\n    return fd;\n}\n\nstatic int dirty(lua_State *L) {\n    int is = 0;\n    lua_pushstring(L, \"dirty\");\n    lua_gettable(L, -2);\n    if (!lua_isnil(L, -1)) {\n        lua_pushvalue(L, -2);\n        lua_call(L, 1, 1);\n        is = lua_toboolean(L, -1);\n    } \n    lua_pop(L, 1);\n    return is;\n}\n\nstatic void collect_fd(lua_State *L, int tab, int itab, \n        fd_set *set, t_socket *max_fd) {\n    int i = 1, n = 0;\n    /* nil is the same as an empty table */\n    if (lua_isnil(L, tab)) return;\n    /* otherwise we need it to be a table */\n    luaL_checktype(L, tab, LUA_TTABLE);\n    for ( ;; ) {\n        t_socket fd;\n        lua_pushnumber(L, i);\n        lua_gettable(L, tab);\n        if (lua_isnil(L, -1)) {\n            lua_pop(L, 1);\n            break;\n        }\n        /* getfd figures out if this is a socket */\n        fd = getfd(L);\n        if (fd != SOCKET_INVALID) {\n            /* make sure we don't overflow the fd_set */\n#ifdef _WIN32\n            if (n >= FD_SETSIZE) \n                luaL_argerror(L, tab, \"too many sockets\");\n#else\n            if (fd >= FD_SETSIZE) \n                luaL_argerror(L, tab, \"descriptor too large for set size\");\n#endif\n            FD_SET(fd, set);\n            n++;\n            /* keep track of the largest descriptor so far */\n            if (*max_fd == SOCKET_INVALID || *max_fd < fd) \n                *max_fd = fd;\n            /* make sure we can map back from descriptor to the object */\n            lua_pushnumber(L, (lua_Number) fd);\n            lua_pushvalue(L, -2);\n            lua_settable(L, itab);\n        }\n        lua_pop(L, 1);\n        i = i + 1;\n    }\n}\n\nstatic int check_dirty(lua_State *L, int tab, int dtab, fd_set *set) {\n    int ndirty = 0, i = 1;\n    if (lua_isnil(L, tab)) \n        return 0;\n    for ( ;; ) { \n        t_socket fd;\n        lua_pushnumber(L, i);\n        lua_gettable(L, tab);\n        if (lua_isnil(L, -1)) {\n            lua_pop(L, 1);\n            break;\n        }\n        fd = getfd(L);\n        if (fd != SOCKET_INVALID && dirty(L)) {\n            lua_pushnumber(L, ++ndirty);\n            lua_pushvalue(L, -2);\n            lua_settable(L, dtab);\n            FD_CLR(fd, set);\n        }\n        lua_pop(L, 1);\n        i = i + 1;\n    }\n    return ndirty;\n}\n\nstatic void return_fd(lua_State *L, fd_set *set, t_socket max_fd, \n        int itab, int tab, int start) {\n    t_socket fd;\n    for (fd = 0; fd < max_fd; fd++) {\n        if (FD_ISSET(fd, set)) {\n            lua_pushnumber(L, ++start);\n            lua_pushnumber(L, (lua_Number) fd);\n            lua_gettable(L, itab);\n            lua_settable(L, tab);\n        }\n    }\n}\n\nstatic void make_assoc(lua_State *L, int tab) {\n    int i = 1, atab;\n    lua_newtable(L); atab = lua_gettop(L);\n    for ( ;; ) {\n        lua_pushnumber(L, i);\n        lua_gettable(L, tab);\n        if (!lua_isnil(L, -1)) {\n            lua_pushnumber(L, i);\n            lua_pushvalue(L, -2);\n            lua_settable(L, atab);\n            lua_pushnumber(L, i);\n            lua_settable(L, atab);\n        } else {\n            lua_pop(L, 1);\n            break;\n        }\n        i = i+1;\n    }\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/select.h",
    "content": "#ifndef SELECT_H\n#define SELECT_H\n/*=========================================================================*\\\n* Select implementation\n* LuaSocket toolkit\n*\n* Each object that can be passed to the select function has to export \n* method getfd() which returns the descriptor to be passed to the\n* underlying select function. Another method, dirty(), should return \n* true if there is data ready for reading (required for buffered input).\n\\*=========================================================================*/\n\nint select_open(lua_State *L);\n\n#endif /* SELECT_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/serial.c",
    "content": "/*=========================================================================*\\\n* Serial stream\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h> \n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"auxiliar.h\"\n#include \"socket.h\"\n#include \"options.h\"\n#include \"unix.h\"\n#include <sys/un.h> \n\n/*\nReuses userdata definition from unix.h, since it is useful for all\nstream-like objects.\n\nIf we stored the serial path for use in error messages or userdata\nprinting, we might need our own userdata definition.\n\nGroup usage is semi-inherited from unix.c, but unnecessary since we\nhave only one object type.\n*/\n\n/*=========================================================================*\\\n* Internal function prototypes\n\\*=========================================================================*/\nstatic int global_create(lua_State *L);\nstatic int meth_send(lua_State *L);\nstatic int meth_receive(lua_State *L);\nstatic int meth_close(lua_State *L);\nstatic int meth_settimeout(lua_State *L);\nstatic int meth_getfd(lua_State *L);\nstatic int meth_setfd(lua_State *L);\nstatic int meth_dirty(lua_State *L);\nstatic int meth_getstats(lua_State *L);\nstatic int meth_setstats(lua_State *L);\n\n/* serial object methods */\nstatic luaL_Reg serial_methods[] = {\n    {\"__gc\",        meth_close},\n    {\"__tostring\",  auxiliar_tostring},\n    {\"close\",       meth_close},\n    {\"dirty\",       meth_dirty},\n    {\"getfd\",       meth_getfd},\n    {\"getstats\",    meth_getstats},\n    {\"setstats\",    meth_setstats},\n    {\"receive\",     meth_receive},\n    {\"send\",        meth_send},\n    {\"setfd\",       meth_setfd},\n    {\"settimeout\",  meth_settimeout},\n    {NULL,          NULL}\n};\n\n/* our socket creation function */\nstatic luaL_Reg func[] = {\n    {\"serial\", global_create},\n    {NULL,          NULL}\n};\n\n\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nLUASOCKET_API int luaopen_socket_serial(lua_State *L) {\n    /* create classes */\n    auxiliar_newclass(L, \"serial{client}\", serial_methods);\n    /* create class groups */\n    auxiliar_add2group(L, \"serial{client}\", \"serial{any}\");\n    /* make sure the function ends up in the package table */\n    luaL_openlib(L, \"socket\", func, 0);\n    /* return the function instead of the 'socket' table */\n    lua_pushstring(L, \"serial\");\n    lua_gettable(L, -2);\n    return 1;\n}\n\n/*=========================================================================*\\\n* Lua methods\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Just call buffered IO methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_send(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"serial{client}\", 1);\n    return buffer_meth_send(L, &un->buf);\n}\n\nstatic int meth_receive(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"serial{client}\", 1);\n    return buffer_meth_receive(L, &un->buf);\n}\n\nstatic int meth_getstats(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"serial{client}\", 1);\n    return buffer_meth_getstats(L, &un->buf);\n}\n\nstatic int meth_setstats(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"serial{client}\", 1);\n    return buffer_meth_setstats(L, &un->buf);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Select support methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getfd(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"serial{any}\", 1);\n    lua_pushnumber(L, (int) un->sock);\n    return 1;\n}\n\n/* this is very dangerous, but can be handy for those that are brave enough */\nstatic int meth_setfd(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"serial{any}\", 1);\n    un->sock = (t_socket) luaL_checknumber(L, 2); \n    return 0;\n}\n\nstatic int meth_dirty(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"serial{any}\", 1);\n    lua_pushboolean(L, !buffer_isempty(&un->buf));\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Closes socket used by object \n\\*-------------------------------------------------------------------------*/\nstatic int meth_close(lua_State *L)\n{\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"serial{any}\", 1);\n    socket_destroy(&un->sock);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n\n/*-------------------------------------------------------------------------*\\\n* Just call tm methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_settimeout(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"serial{any}\", 1);\n    return timeout_meth_settimeout(L, &un->tm);\n}\n\n/*=========================================================================*\\\n* Library functions\n\\*=========================================================================*/\n\n\n/*-------------------------------------------------------------------------*\\\n* Creates a serial object \n\\*-------------------------------------------------------------------------*/\nstatic int global_create(lua_State *L) {\n    const char* path = luaL_checkstring(L, 1);\n\n    /* allocate unix object */\n    p_unix un = (p_unix) lua_newuserdata(L, sizeof(t_unix));\n\n    /* open serial device */\n    t_socket sock = open(path, O_NOCTTY|O_RDWR);\n\n    /*printf(\"open %s on %d\\n\", path, sock);*/\n\n    if (sock < 0)  {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_strerror(errno));\n        lua_pushnumber(L, errno);\n        return 3;\n    }\n    /* set its type as client object */\n    auxiliar_setclass(L, \"serial{client}\", -1);\n    /* initialize remaining structure fields */\n    socket_setnonblocking(&sock);\n    un->sock = sock;\n    io_init(&un->io, (p_send) socket_write, (p_recv) socket_read, \n            (p_error) socket_ioerror, &un->sock);\n    timeout_init(&un->tm, -1, -1);\n    buffer_init(&un->buf, &un->io, &un->tm);\n    return 1;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/socket.h",
    "content": "#ifndef SOCKET_H\n#define SOCKET_H\n/*=========================================================================*\\\n* Socket compatibilization module\n* LuaSocket toolkit\n*\n* BSD Sockets and WinSock are similar, but there are a few irritating\n* differences. Also, not all *nix platforms behave the same. This module\n* (and the associated usocket.h and wsocket.h) factor these differences and\n* creates a interface compatible with the io.h module.\n\\*=========================================================================*/\n#include \"luasocket_io.h\"\n\n/*=========================================================================*\\\n* Platform specific compatibilization\n\\*=========================================================================*/\n#ifdef _WIN32\n#include \"wsocket.h\"\n#else\n#include \"usocket.h\"\n#endif\n\n/*=========================================================================*\\\n* The connect and accept functions accept a timeout and their\n* implementations are somewhat complicated. We chose to move\n* the timeout control into this module for these functions in\n* order to simplify the modules that use them. \n\\*=========================================================================*/\n#include \"timeout.h\"\n\n/* we are lazy... */\ntypedef struct sockaddr SA;\n\n/*=========================================================================*\\\n* Functions bellow implement a comfortable platform independent \n* interface to sockets\n\\*=========================================================================*/\nint socket_open(void);\nint socket_close(void);\nvoid socket_destroy(p_socket ps);\nvoid socket_shutdown(p_socket ps, int how); \nint socket_sendto(p_socket ps, const char *data, size_t count, \n        size_t *sent, SA *addr, socklen_t addr_len, p_timeout tm);\nint socket_recvfrom(p_socket ps, char *data, size_t count, \n        size_t *got, SA *addr, socklen_t *addr_len, p_timeout tm);\n\nvoid socket_setnonblocking(p_socket ps);\nvoid socket_setblocking(p_socket ps);\n\nint socket_waitfd(p_socket ps, int sw, p_timeout tm);\nint socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, \n        p_timeout tm);\n\nint socket_connect(p_socket ps, SA *addr, socklen_t addr_len, p_timeout tm); \nint socket_create(p_socket ps, int domain, int type, int protocol);\nint socket_bind(p_socket ps, SA *addr, socklen_t addr_len); \nint socket_listen(p_socket ps, int backlog);\nint socket_accept(p_socket ps, p_socket pa, SA *addr, \n        socklen_t *addr_len, p_timeout tm);\n\nconst char *socket_hoststrerror(int err);\nconst char *socket_gaistrerror(int err);\nconst char *socket_strerror(int err);\n\n/* these are perfect to use with the io abstraction module \n   and the buffered input module */\nint socket_send(p_socket ps, const char *data, size_t count, \n        size_t *sent, p_timeout tm);\nint socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm);\nint socket_write(p_socket ps, const char *data, size_t count, \n        size_t *sent, p_timeout tm);\nint socket_read(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm);\nconst char *socket_ioerror(p_socket ps, int err);\n\nint socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp);\nint socket_gethostbyname(const char *addr, struct hostent **hp);\n\n#endif /* SOCKET_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/socket_scripts.c",
    "content": "\n/* socket_scripts.c */\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"socket_scripts.h\"\n\n/* ltn12, ltn12.lua */\nstatic const char lua_m_ltn12[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0x31,0x00,0x01,0x06,0x03,0x00,0x00,0x09,0x29,0x01,0x00,\n    0x00,0x2b,0x02,0x01,0x00,0x2b,0x03,0x00,0x00,0x10,0x04,0x00,0x00,0x2b,0x05,0x02,\n    0x00,0x3e,0x02,0x04,0x03,0x2c,0x00,0x03,0x00,0x10,0x01,0x02,0x00,0x48,0x01,0x02,\n    0x00,0x01,0x80,0x00,0xc0,0x02,0xc0,0x2d,0x01,0x03,0x05,0x01,0x02,0x00,0x07,0x2b,\n    0x03,0x00,0x00,0x37,0x03,0x00,0x03,0x10,0x04,0x00,0x00,0x3e,0x03,0x02,0x01,0x31,\n    0x03,0x01,0x00,0x30,0x00,0x00,0x80,0x48,0x03,0x02,0x00,0x02,0xc0,0x00,0x0b,0x61,\n    0x73,0x73,0x65,0x72,0x74,0xcd,0x02,0x00,0x01,0x03,0x06,0x03,0x01,0x44,0x0d,0x01,\n    0x00,0x00,0x54,0x01,0x01,0x80,0x2b,0x01,0x00,0x00,0x2c,0x00,0x01,0x00,0x51,0x01,\n    0x3e,0x80,0x2b,0x01,0x01,0x00,0x2b,0x02,0x02,0x00,0x05,0x01,0x02,0x00,0x54,0x01,\n    0x1a,0x80,0x2b,0x01,0x03,0x00,0x2b,0x02,0x01,0x00,0x36,0x01,0x02,0x01,0x10,0x02,\n    0x00,0x00,0x3e,0x01,0x02,0x02,0x10,0x00,0x01,0x00,0x06,0x00,0x00,0x00,0x54,0x01,\n    0x04,0x80,0x2b,0x01,0x02,0x00,0x2b,0x02,0x04,0x00,0x05,0x01,0x02,0x00,0x54,0x01,\n    0x02,0x80,0x48,0x00,0x02,0x00,0x54,0x01,0xed,0x7f,0x0f,0x00,0x00,0x00,0x54,0x01,\n    0x04,0x80,0x2b,0x01,0x01,0x00,0x14,0x01,0x00,0x01,0x2c,0x01,0x01,0x00,0x54,0x01,\n    0xe7,0x7f,0x2b,0x01,0x02,0x00,0x14,0x01,0x00,0x01,0x2c,0x02,0x01,0x00,0x2b,0x01,\n    0x02,0x00,0x2c,0x01,0x01,0x00,0x54,0x01,0xe1,0x7f,0x2b,0x01,0x03,0x00,0x2b,0x02,\n    0x01,0x00,0x36,0x01,0x02,0x01,0x0c,0x02,0x00,0x00,0x54,0x02,0x01,0x80,0x25,0x02,\n    0x00,0x00,0x3e,0x01,0x02,0x02,0x10,0x00,0x01,0x00,0x07,0x00,0x00,0x00,0x54,0x01,\n    0x05,0x80,0x2b,0x01,0x01,0x00,0x15,0x01,0x00,0x01,0x2c,0x01,0x01,0x00,0x2b,0x00,\n    0x00,0x00,0x54,0x01,0xd2,0x7f,0x0f,0x00,0x00,0x00,0x54,0x01,0x0a,0x80,0x2b,0x01,\n    0x01,0x00,0x2b,0x02,0x04,0x00,0x05,0x01,0x02,0x00,0x54,0x01,0x02,0x80,0x48,0x00,\n    0x02,0x00,0x54,0x01,0xca,0x7f,0x2b,0x01,0x01,0x00,0x14,0x01,0x00,0x01,0x2c,0x01,\n    0x01,0x00,0x54,0x01,0xc6,0x7f,0x2b,0x01,0x05,0x00,0x37,0x01,0x01,0x01,0x25,0x02,\n    0x02,0x00,0x3e,0x01,0x02,0x01,0x54,0x01,0xc1,0x7f,0x47,0x00,0x01,0x00,0x04,0x80,\n    0x03,0x80,0x02,0x80,0x00,0xc0,0x01,0xc0,0x00,0x00,0x26,0x66,0x69,0x6c,0x74,0x65,\n    0x72,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x65,0x64,0x20,0x69,0x6e,0x61,0x70,0x70,\n    0x72,0x6f,0x70,0x72,0x69,0x61,0x74,0x65,0x20,0x6e,0x69,0x6c,0x0a,0x65,0x72,0x72,\n    0x6f,0x72,0x05,0x02,0x4e,0x03,0x00,0x06,0x01,0x04,0x01,0x0d,0x32,0x00,0x03,0x00,\n    0x43,0x01,0x00,0x00,0x3c,0x01,0x00,0x00,0x34,0x01,0x00,0x00,0x25,0x02,0x01,0x00,\n    0x43,0x03,0x00,0x00,0x3d,0x01,0x01,0x02,0x27,0x02,0x01,0x00,0x27,0x03,0x01,0x00,\n    0x25,0x04,0x02,0x00,0x31,0x05,0x03,0x00,0x30,0x00,0x00,0x80,0x48,0x05,0x02,0x00,\n    0x02,0xc0,0x00,0x05,0x06,0x23,0x0b,0x73,0x65,0x6c,0x65,0x63,0x74,0x03,0x80,0x80,\n    0xc0,0x99,0x04,0x0f,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x29,0x00,0x00,0x00,0x48,\n    0x00,0x02,0x00,0x11,0x00,0x00,0x01,0x01,0x00,0x00,0x02,0x2b,0x00,0x00,0x00,0x48,\n    0x00,0x02,0x00,0x08,0xc0,0x15,0x00,0x00,0x02,0x01,0x00,0x00,0x03,0x29,0x00,0x00,\n    0x00,0x2b,0x01,0x00,0x00,0x46,0x00,0x03,0x00,0x00,0xc0,0x14,0x01,0x01,0x02,0x00,\n    0x01,0x00,0x03,0x31,0x01,0x00,0x00,0x30,0x00,0x00,0x80,0x48,0x01,0x02,0x00,0x00,\n    0x54,0x00,0x00,0x03,0x02,0x03,0x00,0x0d,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,\n    0x37,0x00,0x00,0x00,0x2b,0x02,0x01,0x00,0x37,0x02,0x01,0x02,0x3e,0x00,0x03,0x02,\n    0x0e,0x00,0x00,0x00,0x54,0x01,0x04,0x80,0x2b,0x01,0x00,0x00,0x10,0x02,0x01,0x00,\n    0x37,0x01,0x02,0x01,0x3e,0x01,0x02,0x01,0x48,0x00,0x02,0x00,0x00,0xc0,0x00,0x00,\n    0x0a,0x63,0x6c,0x6f,0x73,0x65,0x0e,0x42,0x4c,0x4f,0x43,0x4b,0x53,0x49,0x5a,0x45,\n    0x09,0x72,0x65,0x61,0x64,0x62,0x01,0x02,0x04,0x02,0x03,0x00,0x0f,0x0f,0x00,0x00,\n    0x00,0x54,0x02,0x04,0x80,0x31,0x02,0x00,0x00,0x30,0x00,0x00,0x80,0x48,0x02,0x02,\n    0x00,0x54,0x02,0x07,0x80,0x2b,0x02,0x01,0x00,0x37,0x02,0x01,0x02,0x0c,0x03,0x01,\n    0x00,0x54,0x03,0x01,0x80,0x25,0x03,0x02,0x00,0x30,0x00,0x00,0x80,0x40,0x02,0x02,\n    0x00,0x30,0x00,0x00,0x80,0x47,0x00,0x01,0x00,0x03,0xc0,0x05,0xc0,0x18,0x75,0x6e,\n    0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x6f,0x70,0x65,0x6e,0x20,0x66,0x69,0x6c,\n    0x65,0x0a,0x65,0x72,0x72,0x6f,0x72,0x00,0x41,0x00,0x00,0x04,0x01,0x00,0x00,0x0e,\n    0x2b,0x00,0x00,0x00,0x3e,0x00,0x01,0x03,0x0c,0x02,0x01,0x00,0x54,0x02,0x01,0x80,\n    0x2b,0x02,0x00,0x00,0x2c,0x00,0x02,0x00,0x0e,0x00,0x00,0x00,0x54,0x02,0x04,0x80,\n    0x29,0x02,0x00,0x00,0x10,0x03,0x01,0x00,0x46,0x02,0x03,0x00,0x54,0x02,0x01,0x80,\n    0x48,0x00,0x02,0x00,0x47,0x00,0x01,0x00,0x00,0x80,0x2d,0x01,0x01,0x03,0x01,0x02,\n    0x00,0x07,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x3e,0x01,\n    0x02,0x01,0x31,0x01,0x01,0x00,0x30,0x00,0x00,0x80,0x48,0x01,0x02,0x00,0x02,0xc0,\n    0x00,0x0b,0x61,0x73,0x73,0x65,0x72,0x74,0x77,0x00,0x00,0x05,0x04,0x03,0x01,0x16,\n    0x2b,0x00,0x00,0x00,0x37,0x00,0x00,0x00,0x2b,0x01,0x01,0x00,0x2b,0x02,0x02,0x00,\n    0x2b,0x03,0x02,0x00,0x2b,0x04,0x03,0x00,0x37,0x04,0x01,0x04,0x1e,0x03,0x04,0x03,\n    0x15,0x03,0x00,0x03,0x3e,0x00,0x04,0x02,0x2b,0x01,0x02,0x00,0x2b,0x02,0x03,0x00,\n    0x37,0x02,0x01,0x02,0x1e,0x01,0x02,0x01,0x2c,0x02,0x01,0x00,0x06,0x00,0x02,0x00,\n    0x54,0x01,0x02,0x80,0x48,0x00,0x02,0x00,0x54,0x01,0x02,0x80,0x29,0x01,0x00,0x00,\n    0x48,0x01,0x02,0x00,0x47,0x00,0x01,0x00,0x00,0x00,0x00,0xc0,0x01,0x80,0x01,0x00,\n    0x05,0x0e,0x42,0x4c,0x4f,0x43,0x4b,0x53,0x49,0x5a,0x45,0x08,0x73,0x75,0x62,0x02,\n    0x48,0x01,0x01,0x03,0x03,0x02,0x00,0x0d,0x0f,0x00,0x00,0x00,0x54,0x01,0x05,0x80,\n    0x27,0x01,0x01,0x00,0x31,0x02,0x00,0x00,0x30,0x00,0x00,0x80,0x48,0x02,0x02,0x00,\n    0x30,0x01,0x04,0x80,0x2b,0x01,0x02,0x00,0x37,0x01,0x01,0x01,0x30,0x00,0x00,0x80,\n    0x40,0x01,0x01,0x00,0x30,0x00,0x00,0x80,0x47,0x00,0x01,0x00,0x00,0xc0,0x03,0xc0,\n    0x05,0xc0,0x0a,0x65,0x6d,0x70,0x74,0x79,0x00,0x6b,0x00,0x01,0x04,0x03,0x02,0x00,\n    0x14,0x0e,0x00,0x00,0x00,0x54,0x01,0x0c,0x80,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,\n    0x01,0x2b,0x02,0x01,0x00,0x3e,0x01,0x02,0x02,0x10,0x00,0x01,0x00,0x0e,0x00,0x00,\n    0x00,0x54,0x01,0x03,0x80,0x2b,0x01,0x02,0x00,0x40,0x01,0x01,0x00,0x54,0x01,0x07,\n    0x80,0x48,0x00,0x02,0x00,0x54,0x01,0x05,0x80,0x2b,0x01,0x00,0x00,0x37,0x01,0x01,\n    0x01,0x2b,0x02,0x01,0x00,0x10,0x03,0x00,0x00,0x3e,0x01,0x03,0x01,0x47,0x00,0x01,\n    0x00,0x01,0x00,0x01,0xc0,0x00,0xc0,0x0b,0x69,0x6e,0x73,0x65,0x72,0x74,0x0b,0x72,\n    0x65,0x6d,0x6f,0x76,0x65,0x33,0x01,0x01,0x03,0x02,0x02,0x00,0x08,0x2b,0x01,0x00,\n    0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x01,0x32,0x01,0x00,\n    0x00,0x31,0x02,0x01,0x00,0x30,0x00,0x00,0x80,0x48,0x02,0x02,0x00,0x02,0xc0,0x01,\n    0xc0,0x00,0x0b,0x61,0x73,0x73,0x65,0x72,0x74,0xc9,0x03,0x00,0x00,0x03,0x07,0x07,\n    0x00,0x56,0x2b,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x54,0x00,0x05,0x80,0x2b,0x00,\n    0x01,0x00,0x37,0x00,0x00,0x00,0x25,0x01,0x01,0x00,0x27,0x02,0x02,0x00,0x3e,0x00,\n    0x03,0x01,0x51,0x00,0x4c,0x80,0x2b,0x00,0x02,0x00,0x07,0x00,0x02,0x00,0x54,0x00,\n    0x27,0x80,0x2b,0x00,0x05,0x00,0x3e,0x00,0x01,0x03,0x2c,0x04,0x01,0x00,0x2c,0x03,\n    0x00,0x00,0x2b,0x00,0x04,0x00,0x0f,0x00,0x00,0x00,0x54,0x01,0x03,0x80,0x29,0x00,\n    0x00,0x00,0x2b,0x01,0x04,0x00,0x46,0x00,0x03,0x00,0x2b,0x00,0x06,0x00,0x2b,0x01,\n    0x03,0x00,0x3e,0x00,0x02,0x02,0x2c,0x00,0x00,0x00,0x2b,0x00,0x00,0x00,0x0e,0x00,\n    0x00,0x00,0x54,0x00,0x0b,0x80,0x2b,0x00,0x03,0x00,0x0f,0x00,0x00,0x00,0x54,0x01,\n    0x05,0x80,0x2b,0x00,0x01,0x00,0x37,0x00,0x00,0x00,0x25,0x01,0x03,0x00,0x3e,0x00,\n    0x02,0x01,0x54,0x00,0xe3,0x7f,0x29,0x00,0x00,0x00,0x48,0x00,0x02,0x00,0x54,0x00,\n    0xe0,0x7f,0x2b,0x00,0x00,0x00,0x06,0x00,0x04,0x00,0x54,0x00,0xdd,0x7f,0x2d,0x02,\n    0x05,0x00,0x2b,0x00,0x03,0x00,0x0f,0x00,0x00,0x00,0x54,0x01,0x01,0x80,0x2d,0x03,\n    0x04,0x00,0x2b,0x00,0x00,0x00,0x48,0x00,0x02,0x00,0x54,0x00,0xd5,0x7f,0x2b,0x00,\n    0x06,0x00,0x2b,0x01,0x03,0x00,0x3e,0x00,0x02,0x02,0x2c,0x00,0x00,0x00,0x2b,0x00,\n    0x00,0x00,0x07,0x00,0x04,0x00,0x54,0x00,0x0a,0x80,0x2b,0x00,0x03,0x00,0x07,0x00,\n    0x04,0x00,0x54,0x00,0x02,0x80,0x2d,0x02,0x02,0x00,0x54,0x00,0xc9,0x7f,0x2b,0x00,\n    0x01,0x00,0x37,0x00,0x00,0x00,0x25,0x01,0x06,0x00,0x3e,0x00,0x02,0x01,0x54,0x00,\n    0xc4,0x7f,0x2b,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x54,0x00,0x0b,0x80,0x2b,0x00,\n    0x03,0x00,0x0f,0x00,0x00,0x00,0x54,0x01,0x05,0x80,0x2b,0x00,0x01,0x00,0x37,0x00,\n    0x00,0x00,0x25,0x01,0x03,0x00,0x3e,0x00,0x02,0x01,0x54,0x00,0xb9,0x7f,0x29,0x00,\n    0x00,0x00,0x48,0x00,0x02,0x00,0x54,0x00,0xb6,0x7f,0x2b,0x00,0x00,0x00,0x48,0x00,\n    0x02,0x00,0x54,0x00,0xb3,0x7f,0x47,0x00,0x01,0x00,0x03,0x80,0x01,0x00,0x04,0x80,\n    0x02,0x80,0x05,0x80,0x00,0xc0,0x01,0x80,0x17,0x66,0x69,0x6c,0x74,0x65,0x72,0x20,\n    0x72,0x65,0x74,0x75,0x72,0x6e,0x65,0x64,0x20,0x22,0x22,0x0b,0x65,0x61,0x74,0x69,\n    0x6e,0x67,0x05,0x26,0x66,0x69,0x6c,0x74,0x65,0x72,0x20,0x72,0x65,0x74,0x75,0x72,\n    0x6e,0x65,0x64,0x20,0x69,0x6e,0x61,0x70,0x70,0x72,0x6f,0x70,0x72,0x69,0x61,0x74,\n    0x65,0x20,0x6e,0x69,0x6c,0x0c,0x66,0x65,0x65,0x64,0x69,0x6e,0x67,0x15,0x73,0x6f,\n    0x75,0x72,0x63,0x65,0x20,0x69,0x73,0x20,0x65,0x6d,0x70,0x74,0x79,0x21,0x0a,0x65,\n    0x72,0x72,0x6f,0x72,0x7a,0x03,0x02,0x07,0x02,0x05,0x00,0x16,0x43,0x02,0x02,0x02,\n    0x0f,0x00,0x02,0x00,0x54,0x03,0x06,0x80,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,\n    0x10,0x03,0x01,0x00,0x43,0x04,0x02,0x00,0x3d,0x02,0x01,0x02,0x10,0x01,0x02,0x00,\n    0x2b,0x02,0x01,0x00,0x37,0x02,0x01,0x02,0x0d,0x03,0x00,0x00,0x54,0x03,0x01,0x80,\n    0x10,0x03,0x01,0x00,0x3e,0x02,0x02,0x01,0x25,0x02,0x02,0x00,0x25,0x03,0x02,0x00,\n    0x25,0x04,0x03,0x00,0x29,0x05,0x00,0x00,0x31,0x06,0x04,0x00,0x30,0x00,0x00,0x80,\n    0x48,0x06,0x02,0x00,0x04,0xc0,0x02,0xc0,0x00,0x0c,0x66,0x65,0x65,0x64,0x69,0x6e,\n    0x67,0x05,0x0b,0x61,0x73,0x73,0x65,0x72,0x74,0x0a,0x63,0x68,0x61,0x69,0x6e,0x6c,\n    0x00,0x00,0x05,0x03,0x01,0x00,0x16,0x2b,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x54,\n    0x01,0x12,0x80,0x51,0x00,0x11,0x80,0x2b,0x00,0x00,0x00,0x3e,0x00,0x01,0x03,0x0f,\n    0x00,0x00,0x00,0x54,0x02,0x01,0x80,0x48,0x00,0x02,0x00,0x0f,0x00,0x01,0x00,0x54,\n    0x02,0x03,0x80,0x29,0x02,0x00,0x00,0x10,0x03,0x01,0x00,0x46,0x02,0x03,0x00,0x2b,\n    0x02,0x01,0x00,0x37,0x02,0x00,0x02,0x2b,0x03,0x02,0x00,0x27,0x04,0x01,0x00,0x3e,\n    0x02,0x03,0x02,0x2c,0x00,0x02,0x00,0x54,0x00,0xeb,0x7f,0x47,0x00,0x01,0x00,0x01,\n    0x80,0x00,0x00,0x00,0xc0,0x0b,0x72,0x65,0x6d,0x6f,0x76,0x65,0x43,0x03,0x00,0x04,\n    0x01,0x02,0x01,0x0b,0x32,0x00,0x03,0x00,0x43,0x01,0x00,0x00,0x3c,0x01,0x00,0x00,\n    0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x27,0x03,0x01,0x00,\n    0x3e,0x01,0x03,0x02,0x31,0x02,0x01,0x00,0x30,0x00,0x00,0x80,0x48,0x02,0x02,0x00,\n    0x01,0xc0,0x00,0x0b,0x72,0x65,0x6d,0x6f,0x76,0x65,0x03,0x80,0x80,0xc0,0x99,0x04,\n    0x36,0x00,0x02,0x05,0x02,0x01,0x00,0x09,0x0f,0x00,0x00,0x00,0x54,0x02,0x05,0x80,\n    0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,0x2b,0x03,0x01,0x00,0x10,0x04,0x00,0x00,\n    0x3e,0x02,0x03,0x01,0x27,0x02,0x01,0x00,0x48,0x02,0x02,0x00,0x00,0x00,0x00,0x80,\n    0x0b,0x69,0x6e,0x73,0x65,0x72,0x74,0x2a,0x01,0x01,0x04,0x01,0x01,0x00,0x08,0x0e,\n    0x00,0x00,0x00,0x54,0x01,0x01,0x80,0x32,0x00,0x00,0x00,0x31,0x01,0x00,0x00,0x10,\n    0x02,0x01,0x00,0x10,0x03,0x00,0x00,0x30,0x00,0x00,0x80,0x46,0x02,0x03,0x00,0x01,\n    0xc0,0x00,0x45,0x00,0x02,0x06,0x01,0x00,0x00,0x0f,0x2b,0x02,0x00,0x00,0x10,0x03,\n    0x00,0x00,0x10,0x04,0x01,0x00,0x3e,0x02,0x03,0x03,0x0e,0x00,0x02,0x00,0x54,0x04,\n    0x03,0x80,0x29,0x04,0x00,0x00,0x10,0x05,0x03,0x00,0x46,0x04,0x03,0x00,0x0c,0x04,\n    0x03,0x00,0x54,0x04,0x01,0x80,0x2b,0x04,0x00,0x00,0x2c,0x00,0x04,0x00,0x27,0x04,\n    0x01,0x00,0x48,0x04,0x02,0x00,0x00,0x80,0x2d,0x01,0x01,0x03,0x01,0x02,0x00,0x07,\n    0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x01,\n    0x31,0x01,0x01,0x00,0x30,0x00,0x00,0x80,0x48,0x01,0x02,0x00,0x02,0xc0,0x00,0x0b,\n    0x61,0x73,0x73,0x65,0x72,0x74,0x51,0x00,0x02,0x05,0x01,0x02,0x00,0x0f,0x0e,0x00,\n    0x00,0x00,0x54,0x02,0x07,0x80,0x2b,0x02,0x00,0x00,0x10,0x03,0x02,0x00,0x37,0x02,\n    0x00,0x02,0x3e,0x02,0x02,0x01,0x27,0x02,0x01,0x00,0x48,0x02,0x02,0x00,0x54,0x02,\n    0x05,0x80,0x2b,0x02,0x00,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x01,0x02,0x10,0x04,\n    0x00,0x00,0x40,0x02,0x03,0x00,0x47,0x00,0x01,0x00,0x00,0xc0,0x0a,0x77,0x72,0x69,\n    0x74,0x65,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x60,0x01,0x02,0x04,0x01,0x03,0x00,0x0f,\n    0x0f,0x00,0x00,0x00,0x54,0x02,0x04,0x80,0x31,0x02,0x00,0x00,0x30,0x00,0x00,0x80,\n    0x48,0x02,0x02,0x00,0x54,0x02,0x07,0x80,0x2b,0x02,0x00,0x00,0x37,0x02,0x01,0x02,\n    0x0c,0x03,0x01,0x00,0x54,0x03,0x01,0x80,0x25,0x03,0x02,0x00,0x30,0x00,0x00,0x80,\n    0x40,0x02,0x02,0x00,0x30,0x00,0x00,0x80,0x47,0x00,0x01,0x00,0x06,0xc0,0x18,0x75,\n    0x6e,0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x6f,0x70,0x65,0x6e,0x20,0x66,0x69,\n    0x6c,0x65,0x0a,0x65,0x72,0x72,0x6f,0x72,0x00,0x0f,0x00,0x00,0x01,0x00,0x00,0x00,\n    0x02,0x27,0x00,0x01,0x00,0x48,0x00,0x02,0x00,0x11,0x00,0x00,0x01,0x01,0x00,0x00,\n    0x02,0x2b,0x00,0x00,0x00,0x48,0x00,0x02,0x00,0x09,0xc0,0x15,0x00,0x00,0x02,0x01,\n    0x00,0x00,0x03,0x29,0x00,0x00,0x00,0x2b,0x01,0x00,0x00,0x46,0x00,0x03,0x00,0x00,\n    0xc0,0x14,0x01,0x01,0x02,0x00,0x01,0x00,0x03,0x31,0x01,0x00,0x00,0x30,0x00,0x00,\n    0x80,0x48,0x01,0x02,0x00,0x00,0x88,0x01,0x00,0x02,0x08,0x02,0x01,0x00,0x1f,0x06,\n    0x00,0x00,0x00,0x54,0x02,0x1a,0x80,0x2b,0x02,0x00,0x00,0x10,0x03,0x00,0x00,0x3e,\n    0x02,0x02,0x02,0x0d,0x03,0x00,0x00,0x54,0x03,0x01,0x80,0x25,0x03,0x00,0x00,0x51,\n    0x04,0x12,0x80,0x2b,0x04,0x01,0x00,0x10,0x05,0x02,0x00,0x10,0x06,0x01,0x00,0x3e,\n    0x04,0x03,0x03,0x0e,0x00,0x04,0x00,0x54,0x06,0x03,0x80,0x29,0x06,0x00,0x00,0x10,\n    0x07,0x05,0x00,0x46,0x06,0x03,0x00,0x05,0x02,0x03,0x00,0x54,0x06,0x02,0x80,0x27,\n    0x06,0x01,0x00,0x48,0x06,0x02,0x00,0x2b,0x06,0x00,0x00,0x10,0x07,0x03,0x00,0x3e,\n    0x06,0x02,0x02,0x10,0x02,0x06,0x00,0x54,0x04,0xed,0x7f,0x54,0x02,0x02,0x80,0x27,\n    0x02,0x01,0x00,0x48,0x02,0x02,0x00,0x47,0x00,0x01,0x00,0x00,0x80,0x01,0x80,0x05,\n    0xa7,0x01,0x03,0x02,0x06,0x03,0x05,0x01,0x1e,0x43,0x02,0x02,0x02,0x0f,0x00,0x02,\n    0x00,0x54,0x03,0x12,0x80,0x32,0x02,0x04,0x00,0x3b,0x00,0x01,0x02,0x3b,0x01,0x02,\n    0x02,0x43,0x03,0x02,0x00,0x3c,0x03,0x00,0x00,0x2b,0x03,0x00,0x00,0x37,0x03,0x00,\n    0x03,0x10,0x04,0x02,0x00,0x13,0x05,0x02,0x00,0x3e,0x03,0x03,0x02,0x10,0x01,0x03,\n    0x00,0x2b,0x03,0x01,0x00,0x37,0x03,0x01,0x03,0x34,0x04,0x02,0x00,0x10,0x05,0x02,\n    0x00,0x3e,0x04,0x02,0x00,0x3d,0x03,0x00,0x02,0x10,0x00,0x03,0x00,0x2b,0x02,0x02,\n    0x00,0x37,0x02,0x03,0x02,0x0d,0x03,0x00,0x00,0x54,0x03,0x01,0x80,0x10,0x03,0x01,\n    0x00,0x3e,0x02,0x02,0x01,0x31,0x02,0x04,0x00,0x30,0x00,0x00,0x80,0x48,0x02,0x02,\n    0x00,0x01,0xc0,0x04,0xc0,0x02,0xc0,0x00,0x0b,0x61,0x73,0x73,0x65,0x72,0x74,0x0b,\n    0x75,0x6e,0x70,0x61,0x63,0x6b,0x0a,0x63,0x68,0x61,0x69,0x6e,0x0b,0x72,0x65,0x6d,\n    0x6f,0x76,0x65,0x07,0x80,0x80,0xc0,0x99,0x04,0x53,0x00,0x02,0x08,0x00,0x00,0x00,\n    0x13,0x10,0x02,0x00,0x00,0x3e,0x02,0x01,0x03,0x10,0x04,0x01,0x00,0x10,0x05,0x02,\n    0x00,0x10,0x06,0x03,0x00,0x3e,0x04,0x03,0x03,0x0f,0x00,0x02,0x00,0x54,0x06,0x05,\n    0x80,0x0f,0x00,0x04,0x00,0x54,0x06,0x03,0x80,0x27,0x06,0x01,0x00,0x48,0x06,0x02,\n    0x00,0x54,0x06,0x05,0x80,0x29,0x06,0x00,0x00,0x0c,0x07,0x03,0x00,0x54,0x07,0x01,\n    0x80,0x10,0x07,0x05,0x00,0x46,0x06,0x03,0x00,0x47,0x00,0x01,0x00,0x83,0x01,0x00,\n    0x03,0x07,0x02,0x02,0x00,0x1b,0x2b,0x03,0x00,0x00,0x37,0x03,0x00,0x03,0x0d,0x04,\n    0x00,0x00,0x54,0x04,0x01,0x80,0x10,0x04,0x01,0x00,0x3e,0x03,0x02,0x01,0x0e,0x00,\n    0x02,0x00,0x54,0x03,0x02,0x80,0x2b,0x03,0x01,0x00,0x37,0x02,0x01,0x03,0x51,0x03,\n    0x0f,0x80,0x10,0x03,0x02,0x00,0x10,0x04,0x00,0x00,0x10,0x05,0x01,0x00,0x3e,0x03,\n    0x03,0x03,0x0e,0x00,0x03,0x00,0x54,0x05,0xf9,0x7f,0x0f,0x00,0x04,0x00,0x54,0x05,\n    0x04,0x80,0x29,0x05,0x00,0x00,0x10,0x06,0x04,0x00,0x46,0x05,0x03,0x00,0x54,0x05,\n    0xf3,0x7f,0x27,0x05,0x01,0x00,0x48,0x05,0x02,0x00,0x54,0x03,0xf0,0x7f,0x47,0x00,\n    0x01,0x00,0x02,0xc0,0x07,0xc0,0x09,0x73,0x74,0x65,0x70,0x0b,0x61,0x73,0x73,0x65,\n    0x72,0x74,0xb6,0x03,0x03,0x00,0x0b,0x00,0x2c,0x00,0x40,0x34,0x00,0x00,0x00,0x25,\n    0x01,0x01,0x00,0x3e,0x00,0x02,0x02,0x34,0x01,0x00,0x00,0x25,0x02,0x02,0x00,0x3e,\n    0x01,0x02,0x02,0x34,0x02,0x03,0x00,0x32,0x03,0x00,0x00,0x34,0x04,0x04,0x00,0x0f,\n    0x00,0x04,0x00,0x54,0x05,0x01,0x80,0x35,0x03,0x05,0x00,0x32,0x04,0x00,0x00,0x32,\n    0x05,0x00,0x00,0x32,0x06,0x00,0x00,0x32,0x07,0x00,0x00,0x3a,0x04,0x06,0x03,0x3a,\n    0x05,0x07,0x03,0x3a,0x06,0x08,0x03,0x3a,0x07,0x09,0x03,0x27,0x08,0x00,0x08,0x3a,\n    0x08,0x0a,0x03,0x25,0x08,0x0c,0x00,0x3a,0x08,0x0b,0x03,0x31,0x08,0x0e,0x00,0x3a,\n    0x08,0x0d,0x04,0x31,0x08,0x10,0x00,0x3a,0x08,0x0f,0x04,0x31,0x08,0x11,0x00,0x31,\n    0x09,0x13,0x00,0x3a,0x09,0x12,0x05,0x31,0x09,0x15,0x00,0x3a,0x09,0x14,0x05,0x31,\n    0x09,0x17,0x00,0x3a,0x09,0x16,0x05,0x31,0x09,0x19,0x00,0x3a,0x09,0x18,0x05,0x31,\n    0x09,0x1a,0x00,0x3a,0x09,0x01,0x05,0x31,0x09,0x1c,0x00,0x3a,0x09,0x1b,0x05,0x31,\n    0x09,0x1d,0x00,0x3a,0x09,0x0f,0x05,0x31,0x09,0x1f,0x00,0x3a,0x09,0x1e,0x05,0x31,\n    0x09,0x20,0x00,0x3a,0x09,0x02,0x06,0x31,0x09,0x21,0x00,0x3a,0x09,0x18,0x06,0x31,\n    0x09,0x22,0x00,0x3a,0x09,0x16,0x06,0x31,0x09,0x23,0x00,0x31,0x0a,0x25,0x00,0x3a,\n    0x0a,0x24,0x06,0x31,0x0a,0x26,0x00,0x3a,0x0a,0x14,0x06,0x31,0x0a,0x27,0x00,0x3a,\n    0x0a,0x0f,0x06,0x31,0x0a,0x29,0x00,0x3a,0x0a,0x28,0x07,0x31,0x0a,0x2b,0x00,0x3a,\n    0x0a,0x2a,0x07,0x30,0x00,0x00,0x80,0x48,0x03,0x02,0x00,0x00,0x08,0x61,0x6c,0x6c,\n    0x00,0x09,0x73,0x74,0x65,0x70,0x00,0x00,0x00,0x09,0x6e,0x75,0x6c,0x6c,0x00,0x00,\n    0x00,0x00,0x00,0x08,0x63,0x61,0x74,0x00,0x00,0x0b,0x72,0x65,0x77,0x69,0x6e,0x64,\n    0x00,0x00,0x0d,0x73,0x69,0x6d,0x70,0x6c,0x69,0x66,0x79,0x00,0x09,0x66,0x69,0x6c,\n    0x65,0x00,0x0a,0x65,0x72,0x72,0x6f,0x72,0x00,0x0a,0x65,0x6d,0x70,0x74,0x79,0x00,\n    0x00,0x0a,0x63,0x68,0x61,0x69,0x6e,0x00,0x0a,0x63,0x79,0x63,0x6c,0x65,0x10,0x4c,\n    0x54,0x4e,0x31,0x32,0x20,0x31,0x2e,0x30,0x2e,0x33,0x0d,0x5f,0x56,0x45,0x52,0x53,\n    0x49,0x4f,0x4e,0x0e,0x42,0x4c,0x4f,0x43,0x4b,0x53,0x49,0x5a,0x45,0x09,0x70,0x75,\n    0x6d,0x70,0x09,0x73,0x69,0x6e,0x6b,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x0b,0x66,\n    0x69,0x6c,0x74,0x65,0x72,0x0a,0x6c,0x74,0x6e,0x31,0x32,0x0b,0x6d,0x6f,0x64,0x75,\n    0x6c,0x65,0x07,0x5f,0x47,0x0a,0x74,0x61,0x62,0x6c,0x65,0x0b,0x73,0x74,0x72,0x69,\n    0x6e,0x67,0x0c,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x00,\n};\n\n/* mime, mime.lua */\nstatic const char lua_m_mime[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0xce,0x01,0x00,0x03,0x08,0x02,0x08,0x00,0x23,0x2b,0x03,\n    0x00,0x00,0x37,0x03,0x00,0x03,0x10,0x04,0x00,0x00,0x3e,0x03,0x02,0x02,0x06,0x03,\n    0x01,0x00,0x54,0x03,0x05,0x80,0x25,0x03,0x02,0x00,0x10,0x04,0x00,0x00,0x10,0x02,\n    0x01,0x00,0x10,0x01,0x04,0x00,0x10,0x00,0x03,0x00,0x2b,0x03,0x01,0x00,0x0c,0x04,\n    0x00,0x00,0x54,0x04,0x01,0x80,0x25,0x04,0x03,0x00,0x36,0x03,0x04,0x03,0x0e,0x00,\n    0x03,0x00,0x54,0x04,0x0c,0x80,0x2b,0x04,0x00,0x00,0x37,0x04,0x04,0x04,0x25,0x05,\n    0x05,0x00,0x2b,0x06,0x00,0x00,0x37,0x06,0x06,0x06,0x10,0x07,0x00,0x00,0x3e,0x06,\n    0x02,0x02,0x25,0x07,0x07,0x00,0x24,0x05,0x07,0x05,0x27,0x06,0x03,0x00,0x3e,0x04,\n    0x03,0x01,0x54,0x04,0x04,0x80,0x10,0x04,0x03,0x00,0x10,0x05,0x01,0x00,0x10,0x06,\n    0x02,0x00,0x40,0x04,0x03,0x00,0x47,0x00,0x01,0x00,0x00,0x00,0x00,0xc0,0x06,0x29,\n    0x0d,0x74,0x6f,0x73,0x74,0x72,0x69,0x6e,0x67,0x12,0x75,0x6e,0x6b,0x6e,0x6f,0x77,\n    0x6e,0x20,0x6b,0x65,0x79,0x20,0x28,0x0a,0x65,0x72,0x72,0x6f,0x72,0x08,0x6e,0x69,\n    0x6c,0x0c,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,\n    0x09,0x74,0x79,0x70,0x65,0x16,0x01,0x01,0x02,0x01,0x01,0x00,0x03,0x31,0x01,0x00,\n    0x00,0x30,0x00,0x00,0x80,0x48,0x01,0x02,0x00,0x00,0xc0,0x00,0x39,0x00,0x00,0x03,\n    0x02,0x04,0x00,0x07,0x2b,0x00,0x00,0x00,0x37,0x00,0x00,0x00,0x37,0x00,0x01,0x00,\n    0x2b,0x01,0x01,0x00,0x37,0x01,0x02,0x01,0x25,0x02,0x03,0x00,0x40,0x00,0x03,0x00,\n    0x01,0xc0,0x05,0xc0,0x05,0x08,0x62,0x36,0x34,0x0a,0x63,0x79,0x63,0x6c,0x65,0x0b,\n    0x66,0x69,0x6c,0x74,0x65,0x72,0x5d,0x00,0x01,0x05,0x02,0x07,0x00,0x0c,0x2b,0x01,\n    0x00,0x00,0x37,0x01,0x00,0x01,0x37,0x01,0x01,0x01,0x2b,0x02,0x01,0x00,0x37,0x02,\n    0x02,0x02,0x25,0x03,0x03,0x00,0x07,0x00,0x04,0x00,0x54,0x04,0x02,0x80,0x25,0x04,\n    0x05,0x00,0x54,0x05,0x01,0x80,0x25,0x04,0x06,0x00,0x40,0x01,0x04,0x00,0x01,0xc0,\n    0x05,0xc0,0x07,0x0d,0x0a,0x0b,0x3d,0x30,0x44,0x3d,0x30,0x41,0x0b,0x62,0x69,0x6e,\n    0x61,0x72,0x79,0x05,0x07,0x71,0x70,0x0a,0x63,0x79,0x63,0x6c,0x65,0x0b,0x66,0x69,\n    0x6c,0x74,0x65,0x72,0x3b,0x00,0x00,0x03,0x02,0x04,0x00,0x07,0x2b,0x00,0x00,0x00,\n    0x37,0x00,0x00,0x00,0x37,0x00,0x01,0x00,0x2b,0x01,0x01,0x00,0x37,0x01,0x02,0x01,\n    0x25,0x02,0x03,0x00,0x40,0x00,0x03,0x00,0x01,0xc0,0x05,0xc0,0x05,0x0a,0x75,0x6e,\n    0x62,0x36,0x34,0x0a,0x63,0x79,0x63,0x6c,0x65,0x0b,0x66,0x69,0x6c,0x74,0x65,0x72,\n    0x3a,0x00,0x00,0x03,0x02,0x04,0x00,0x07,0x2b,0x00,0x00,0x00,0x37,0x00,0x00,0x00,\n    0x37,0x00,0x01,0x00,0x2b,0x01,0x01,0x00,0x37,0x01,0x02,0x01,0x25,0x02,0x03,0x00,\n    0x40,0x00,0x03,0x00,0x01,0xc0,0x05,0xc0,0x05,0x09,0x75,0x6e,0x71,0x70,0x0a,0x63,\n    0x79,0x63,0x6c,0x65,0x0b,0x66,0x69,0x6c,0x74,0x65,0x72,0x51,0x00,0x01,0x03,0x01,\n    0x04,0x00,0x0f,0x0f,0x00,0x00,0x00,0x54,0x01,0x0a,0x80,0x07,0x00,0x00,0x00,0x54,\n    0x01,0x03,0x80,0x25,0x01,0x01,0x00,0x48,0x01,0x02,0x00,0x54,0x01,0x07,0x80,0x2b,\n    0x01,0x00,0x00,0x37,0x01,0x02,0x01,0x10,0x02,0x00,0x00,0x40,0x01,0x02,0x00,0x54,\n    0x01,0x02,0x80,0x25,0x01,0x03,0x00,0x48,0x01,0x02,0x00,0x47,0x00,0x01,0x00,0x04,\n    0xc0,0x08,0x6e,0x69,0x6c,0x08,0x6c,0x65,0x6e,0x07,0x27,0x27,0x05,0x48,0x00,0x01,\n    0x05,0x02,0x03,0x00,0x0b,0x0e,0x00,0x00,0x00,0x54,0x01,0x01,0x80,0x27,0x00,0x4c,\n    0x00,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x37,0x01,0x01,0x01,0x2b,0x02,0x01,\n    0x00,0x37,0x02,0x02,0x02,0x10,0x03,0x00,0x00,0x10,0x04,0x00,0x00,0x40,0x01,0x04,\n    0x00,0x01,0xc0,0x05,0xc0,0x08,0x77,0x72,0x70,0x0a,0x63,0x79,0x63,0x6c,0x65,0x0b,\n    0x66,0x69,0x6c,0x74,0x65,0x72,0x3e,0x00,0x00,0x04,0x02,0x03,0x00,0x08,0x2b,0x00,\n    0x00,0x00,0x37,0x00,0x00,0x00,0x37,0x00,0x01,0x00,0x2b,0x01,0x01,0x00,0x37,0x01,\n    0x02,0x01,0x27,0x02,0x4c,0x00,0x27,0x03,0x4c,0x00,0x40,0x00,0x04,0x00,0x01,0xc0,\n    0x05,0xc0,0x0a,0x71,0x70,0x77,0x72,0x70,0x0a,0x63,0x79,0x63,0x6c,0x65,0x0b,0x66,\n    0x69,0x6c,0x74,0x65,0x72,0x3c,0x00,0x01,0x05,0x02,0x03,0x00,0x08,0x2b,0x01,0x00,\n    0x00,0x37,0x01,0x00,0x01,0x37,0x01,0x01,0x01,0x2b,0x02,0x01,0x00,0x37,0x02,0x02,\n    0x02,0x27,0x03,0x00,0x00,0x10,0x04,0x00,0x00,0x40,0x01,0x04,0x00,0x01,0xc0,0x05,\n    0xc0,0x08,0x65,0x6f,0x6c,0x0a,0x63,0x79,0x63,0x6c,0x65,0x0b,0x66,0x69,0x6c,0x74,\n    0x65,0x72,0x38,0x00,0x00,0x03,0x02,0x03,0x00,0x07,0x2b,0x00,0x00,0x00,0x37,0x00,\n    0x00,0x00,0x37,0x00,0x01,0x00,0x2b,0x01,0x01,0x00,0x37,0x01,0x02,0x01,0x27,0x02,\n    0x02,0x00,0x40,0x00,0x03,0x00,0x01,0xc0,0x05,0xc0,0x08,0x64,0x6f,0x74,0x0a,0x63,\n    0x79,0x63,0x6c,0x65,0x0b,0x66,0x69,0x6c,0x74,0x65,0x72,0xf4,0x02,0x03,0x00,0x0d,\n    0x00,0x1c,0x00,0x38,0x34,0x00,0x00,0x00,0x34,0x01,0x01,0x00,0x25,0x02,0x02,0x00,\n    0x3e,0x01,0x02,0x02,0x34,0x02,0x01,0x00,0x25,0x03,0x03,0x00,0x3e,0x02,0x02,0x02,\n    0x34,0x03,0x01,0x00,0x25,0x04,0x04,0x00,0x3e,0x03,0x02,0x02,0x34,0x04,0x01,0x00,\n    0x25,0x05,0x05,0x00,0x3e,0x04,0x02,0x02,0x10,0x05,0x02,0x00,0x32,0x06,0x00,0x00,\n    0x32,0x07,0x00,0x00,0x32,0x08,0x00,0x00,0x3a,0x06,0x06,0x05,0x3a,0x07,0x07,0x05,\n    0x3a,0x08,0x08,0x05,0x31,0x09,0x09,0x00,0x31,0x0a,0x0b,0x00,0x3a,0x0a,0x0a,0x06,\n    0x31,0x0a,0x0d,0x00,0x3a,0x0a,0x0c,0x06,0x31,0x0a,0x0e,0x00,0x3a,0x0a,0x0a,0x07,\n    0x31,0x0a,0x0f,0x00,0x3a,0x0a,0x0c,0x07,0x31,0x0a,0x10,0x00,0x31,0x0b,0x12,0x00,\n    0x3a,0x0b,0x11,0x08,0x37,0x0b,0x11,0x08,0x3a,0x0b,0x0a,0x08,0x37,0x0b,0x11,0x08,\n    0x3a,0x0b,0x13,0x08,0x31,0x0b,0x14,0x00,0x3a,0x0b,0x0c,0x08,0x10,0x0b,0x09,0x00,\n    0x10,0x0c,0x06,0x00,0x3e,0x0b,0x02,0x02,0x3a,0x0b,0x15,0x05,0x10,0x0b,0x09,0x00,\n    0x10,0x0c,0x07,0x00,0x3e,0x0b,0x02,0x02,0x3a,0x0b,0x16,0x05,0x10,0x0b,0x09,0x00,\n    0x10,0x0c,0x08,0x00,0x3e,0x0b,0x02,0x02,0x3a,0x0b,0x17,0x05,0x31,0x0b,0x19,0x00,\n    0x3a,0x0b,0x18,0x05,0x31,0x0b,0x1b,0x00,0x3a,0x0b,0x1a,0x05,0x30,0x00,0x00,0x80,\n    0x48,0x05,0x02,0x00,0x00,0x0a,0x73,0x74,0x75,0x66,0x66,0x00,0x0e,0x6e,0x6f,0x72,\n    0x6d,0x61,0x6c,0x69,0x7a,0x65,0x09,0x77,0x72,0x61,0x70,0x0b,0x64,0x65,0x63,0x6f,\n    0x64,0x65,0x0b,0x65,0x6e,0x63,0x6f,0x64,0x65,0x00,0x0c,0x64,0x65,0x66,0x61,0x75,\n    0x6c,0x74,0x00,0x09,0x74,0x65,0x78,0x74,0x00,0x00,0x00,0x00,0x15,0x71,0x75,0x6f,\n    0x74,0x65,0x64,0x2d,0x70,0x72,0x69,0x6e,0x74,0x61,0x62,0x6c,0x65,0x00,0x0b,0x62,\n    0x61,0x73,0x65,0x36,0x34,0x00,0x0a,0x77,0x72,0x61,0x70,0x74,0x0c,0x64,0x65,0x63,\n    0x6f,0x64,0x65,0x74,0x0c,0x65,0x6e,0x63,0x6f,0x64,0x65,0x74,0x0b,0x73,0x74,0x72,\n    0x69,0x6e,0x67,0x07,0x69,0x6f,0x0e,0x6d,0x69,0x6d,0x65,0x2e,0x63,0x6f,0x72,0x65,\n    0x0a,0x6c,0x74,0x6e,0x31,0x32,0x0c,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x07,0x5f,\n    0x47,0x00,\n};\n\n/* socket.ftp, socket/ftp.lua */\nstatic const char lua_m_socket_ftp[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0x23,0x00,0x00,0x02,0x01,0x01,0x00,0x05,0x2b,0x00,0x00,\n    0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x3e,0x00,0x02,0x01,0x47,0x00,0x01,\n    0x00,0x04,0xc0,0x0a,0x63,0x6c,0x6f,0x73,0x65,0xb1,0x01,0x01,0x03,0x09,0x05,0x09,\n    0x00,0x1b,0x2b,0x03,0x00,0x00,0x37,0x03,0x00,0x03,0x2b,0x04,0x01,0x00,0x37,0x04,\n    0x01,0x04,0x10,0x05,0x00,0x00,0x0c,0x06,0x01,0x00,0x54,0x06,0x02,0x80,0x2b,0x06,\n    0x02,0x00,0x37,0x06,0x02,0x06,0x2b,0x07,0x02,0x00,0x37,0x07,0x03,0x07,0x10,0x08,\n    0x02,0x00,0x3e,0x04,0x05,0x00,0x3d,0x03,0x00,0x02,0x2b,0x04,0x03,0x00,0x37,0x04,\n    0x04,0x04,0x33,0x05,0x05,0x00,0x3a,0x03,0x06,0x05,0x2b,0x06,0x04,0x00,0x3e,0x04,\n    0x03,0x02,0x2b,0x05,0x00,0x00,0x37,0x05,0x07,0x05,0x31,0x06,0x08,0x00,0x3e,0x05,\n    0x02,0x02,0x3a,0x05,0x00,0x04,0x30,0x00,0x00,0x80,0x48,0x04,0x02,0x00,0x04,0xc0,\n    0x06,0xc0,0x08,0xc0,0x00,0xc0,0x09,0xc0,0x00,0x0b,0x6e,0x65,0x77,0x74,0x72,0x79,\n    0x07,0x74,0x70,0x01,0x00,0x00,0x11,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,\n    0x62,0x6c,0x65,0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,0x54,0x09,0x50,0x4f,0x52,0x54,\n    0x0c,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x08,0x74,0x72,0x79,0x93,0x01,0x00,0x01,\n    0x05,0x01,0x06,0x00,0x18,0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,0x10,0x03,0x02,\n    0x00,0x37,0x02,0x02,0x02,0x2b,0x04,0x00,0x00,0x37,0x04,0x03,0x04,0x3e,0x02,0x03,\n    0x00,0x3d,0x01,0x00,0x01,0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,0x10,0x03,0x02,\n    0x00,0x37,0x02,0x05,0x02,0x3e,0x02,0x02,0x00,0x3d,0x01,0x00,0x02,0x3a,0x01,0x04,\n    0x00,0x37,0x01,0x00,0x00,0x37,0x02,0x04,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x02,\n    0x02,0x2b,0x04,0x00,0x00,0x37,0x04,0x03,0x04,0x3e,0x02,0x03,0x00,0x3d,0x01,0x00,\n    0x01,0x47,0x00,0x01,0x00,0x08,0xc0,0x0b,0x61,0x63,0x63,0x65,0x70,0x74,0x09,0x64,\n    0x61,0x74,0x61,0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,0x54,0x0f,0x73,0x65,0x74,0x74,\n    0x69,0x6d,0x65,0x6f,0x75,0x74,0x0b,0x73,0x65,0x72,0x76,0x65,0x72,0x08,0x74,0x72,\n    0x79,0xa5,0x01,0x00,0x01,0x06,0x02,0x09,0x00,0x19,0x37,0x01,0x01,0x00,0x2b,0x02,\n    0x00,0x00,0x37,0x02,0x02,0x02,0x3e,0x02,0x01,0x00,0x3d,0x01,0x00,0x02,0x3a,0x01,\n    0x00,0x00,0x37,0x01,0x01,0x00,0x37,0x02,0x00,0x00,0x10,0x03,0x02,0x00,0x37,0x02,\n    0x03,0x02,0x2b,0x04,0x01,0x00,0x37,0x04,0x04,0x04,0x3e,0x02,0x03,0x00,0x3d,0x01,\n    0x00,0x01,0x37,0x01,0x01,0x00,0x37,0x02,0x00,0x00,0x10,0x03,0x02,0x00,0x37,0x02,\n    0x05,0x02,0x37,0x04,0x06,0x00,0x37,0x04,0x07,0x04,0x37,0x05,0x06,0x00,0x37,0x05,\n    0x08,0x05,0x3e,0x02,0x04,0x00,0x3d,0x01,0x00,0x01,0x47,0x00,0x01,0x00,0x04,0xc0,\n    0x08,0xc0,0x09,0x70,0x6f,0x72,0x74,0x07,0x69,0x70,0x0a,0x70,0x61,0x73,0x76,0x74,\n    0x0c,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,0x54,\n    0x0f,0x73,0x65,0x74,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x08,0x74,0x63,0x70,0x08,\n    0x74,0x72,0x79,0x09,0x64,0x61,0x74,0x61,0xe7,0x01,0x00,0x03,0x0a,0x01,0x0a,0x01,\n    0x28,0x37,0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x02,\n    0x04,0x25,0x06,0x03,0x00,0x0c,0x07,0x01,0x00,0x54,0x07,0x02,0x80,0x2b,0x07,0x00,\n    0x00,0x37,0x07,0x04,0x07,0x3e,0x04,0x04,0x00,0x3d,0x03,0x00,0x01,0x37,0x03,0x00,\n    0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x05,0x04,0x33,0x06,0x06,\n    0x00,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x03,0x09,0x03,0x00,0x00,0x54,0x05,0x12,\n    0x80,0x37,0x05,0x00,0x00,0x37,0x06,0x01,0x00,0x10,0x07,0x06,0x00,0x37,0x06,0x02,\n    0x06,0x25,0x08,0x07,0x00,0x0c,0x09,0x02,0x00,0x54,0x09,0x02,0x80,0x2b,0x09,0x00,\n    0x00,0x37,0x09,0x08,0x09,0x3e,0x06,0x04,0x00,0x3d,0x05,0x00,0x01,0x37,0x05,0x00,\n    0x00,0x37,0x06,0x01,0x00,0x10,0x07,0x06,0x00,0x37,0x06,0x05,0x06,0x25,0x08,0x09,\n    0x00,0x3e,0x06,0x03,0x00,0x3d,0x05,0x00,0x01,0x27,0x05,0x01,0x00,0x48,0x05,0x02,\n    0x00,0x08,0xc0,0x08,0x32,0x2e,0x2e,0x0d,0x50,0x41,0x53,0x53,0x57,0x4f,0x52,0x44,\n    0x09,0x70,0x61,0x73,0x73,0x01,0x03,0x00,0x00,0x08,0x32,0x2e,0x2e,0x03,0xcb,0x02,\n    0x0a,0x63,0x68,0x65,0x63,0x6b,0x09,0x55,0x53,0x45,0x52,0x09,0x75,0x73,0x65,0x72,\n    0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x96,\n    0x05,0x97,0x03,0x00,0x01,0x11,0x02,0x11,0x01,0x42,0x37,0x01,0x00,0x00,0x37,0x02,\n    0x01,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x02,0x02,0x25,0x04,0x03,0x00,0x3e,0x02,\n    0x03,0x00,0x3d,0x01,0x00,0x01,0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,0x10,0x03,\n    0x02,0x00,0x37,0x02,0x04,0x02,0x25,0x04,0x05,0x00,0x3e,0x02,0x03,0x00,0x3d,0x01,\n    0x00,0x03,0x25,0x03,0x06,0x00,0x2b,0x04,0x00,0x00,0x37,0x04,0x07,0x04,0x27,0x05,\n    0x02,0x00,0x2b,0x06,0x01,0x00,0x37,0x06,0x08,0x06,0x10,0x07,0x02,0x00,0x10,0x08,\n    0x03,0x00,0x3e,0x06,0x03,0x00,0x3d,0x04,0x01,0x07,0x37,0x0a,0x00,0x00,0x0d,0x0b,\n    0x04,0x00,0x54,0x0b,0x09,0x80,0x0d,0x0b,0x05,0x00,0x54,0x0b,0x07,0x80,0x0d,0x0b,\n    0x06,0x00,0x54,0x0b,0x05,0x80,0x0d,0x0b,0x07,0x00,0x54,0x0b,0x03,0x80,0x0d,0x0b,\n    0x08,0x00,0x54,0x0b,0x01,0x80,0x10,0x0b,0x09,0x00,0x10,0x0c,0x02,0x00,0x3e,0x0a,\n    0x03,0x01,0x33,0x0a,0x0c,0x00,0x2b,0x0b,0x01,0x00,0x37,0x0b,0x0a,0x0b,0x25,0x0c,\n    0x0b,0x00,0x10,0x0d,0x04,0x00,0x10,0x0e,0x05,0x00,0x10,0x0f,0x06,0x00,0x10,0x10,\n    0x07,0x00,0x3e,0x0b,0x06,0x02,0x3a,0x0b,0x0d,0x0a,0x16,0x0b,0x00,0x08,0x1e,0x0b,\n    0x09,0x0b,0x3a,0x0b,0x0e,0x0a,0x3a,0x0a,0x09,0x00,0x37,0x0a,0x0f,0x00,0x0f,0x00,\n    0x0a,0x00,0x54,0x0b,0x06,0x80,0x37,0x0a,0x0f,0x00,0x10,0x0b,0x0a,0x00,0x37,0x0a,\n    0x10,0x0a,0x3e,0x0a,0x02,0x01,0x29,0x0a,0x00,0x00,0x3a,0x0a,0x0f,0x00,0x37,0x0a,\n    0x09,0x00,0x37,0x0a,0x0d,0x0a,0x37,0x0b,0x09,0x00,0x37,0x0b,0x0e,0x0b,0x46,0x0a,\n    0x03,0x00,0x04,0xc0,0x02,0xc0,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x0b,0x73,0x65,0x72,\n    0x76,0x65,0x72,0x09,0x70,0x6f,0x72,0x74,0x07,0x69,0x70,0x01,0x00,0x00,0x10,0x25,\n    0x64,0x2e,0x25,0x64,0x2e,0x25,0x64,0x2e,0x25,0x64,0x0b,0x66,0x6f,0x72,0x6d,0x61,\n    0x74,0x0a,0x70,0x61,0x73,0x76,0x74,0x09,0x66,0x69,0x6e,0x64,0x09,0x73,0x6b,0x69,\n    0x70,0x2d,0x28,0x25,0x64,0x2b,0x29,0x25,0x44,0x28,0x25,0x64,0x2b,0x29,0x25,0x44,\n    0x28,0x25,0x64,0x2b,0x29,0x25,0x44,0x28,0x25,0x64,0x2b,0x29,0x25,0x44,0x28,0x25,\n    0x64,0x2b,0x29,0x25,0x44,0x28,0x25,0x64,0x2b,0x29,0x08,0x32,0x2e,0x2e,0x0a,0x63,\n    0x68,0x65,0x63,0x6b,0x09,0x70,0x61,0x73,0x76,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,\n    0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x80,0x04,0xb5,0x03,0x00,0x03,0x0b,0x04,\n    0x13,0x01,0x4b,0x29,0x03,0x00,0x00,0x3a,0x03,0x00,0x00,0x0e,0x00,0x01,0x00,0x54,\n    0x03,0x23,0x80,0x37,0x03,0x01,0x00,0x37,0x04,0x02,0x00,0x10,0x05,0x04,0x00,0x37,\n    0x04,0x03,0x04,0x3e,0x04,0x02,0x02,0x10,0x05,0x04,0x00,0x37,0x04,0x04,0x04,0x3e,\n    0x04,0x02,0x00,0x3d,0x03,0x00,0x03,0x10,0x02,0x04,0x00,0x10,0x01,0x03,0x00,0x37,\n    0x03,0x01,0x00,0x2b,0x04,0x00,0x00,0x37,0x04,0x06,0x04,0x10,0x05,0x01,0x00,0x27,\n    0x06,0x00,0x00,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x02,0x3a,0x03,0x05,0x00,0x37,\n    0x03,0x01,0x00,0x37,0x04,0x05,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x04,0x04,0x3e,\n    0x04,0x02,0x00,0x3d,0x03,0x00,0x03,0x10,0x02,0x04,0x00,0x10,0x01,0x03,0x00,0x37,\n    0x03,0x01,0x00,0x37,0x04,0x05,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x07,0x04,0x2b,\n    0x06,0x01,0x00,0x37,0x06,0x08,0x06,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x01,0x2b,\n    0x03,0x02,0x00,0x37,0x03,0x09,0x03,0x10,0x04,0x02,0x00,0x27,0x05,0x00,0x01,0x3e,\n    0x03,0x03,0x02,0x1f,0x04,0x03,0x02,0x17,0x04,0x00,0x04,0x2b,0x05,0x03,0x00,0x37,\n    0x05,0x0a,0x05,0x2b,0x06,0x03,0x00,0x37,0x06,0x0b,0x06,0x25,0x07,0x0c,0x00,0x10,\n    0x08,0x01,0x00,0x10,0x09,0x04,0x00,0x10,0x0a,0x03,0x00,0x3e,0x06,0x05,0x02,0x25,\n    0x07,0x0d,0x00,0x25,0x08,0x0e,0x00,0x3e,0x05,0x04,0x02,0x37,0x06,0x01,0x00,0x37,\n    0x07,0x02,0x00,0x10,0x08,0x07,0x00,0x37,0x07,0x0f,0x07,0x25,0x09,0x10,0x00,0x10,\n    0x0a,0x05,0x00,0x3e,0x07,0x04,0x00,0x3d,0x06,0x00,0x01,0x37,0x06,0x01,0x00,0x37,\n    0x07,0x02,0x00,0x10,0x08,0x07,0x00,0x37,0x07,0x11,0x07,0x25,0x09,0x12,0x00,0x3e,\n    0x07,0x03,0x00,0x3d,0x06,0x00,0x01,0x27,0x06,0x01,0x00,0x48,0x06,0x02,0x00,0x04,\n    0xc0,0x08,0xc0,0x03,0xc0,0x02,0xc0,0x08,0x32,0x2e,0x2e,0x0a,0x63,0x68,0x65,0x63,\n    0x6b,0x09,0x70,0x6f,0x72,0x74,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x06,0x2c,\n    0x07,0x25,0x2e,0x0d,0x25,0x73,0x2c,0x25,0x64,0x2c,0x25,0x64,0x0b,0x66,0x6f,0x72,\n    0x6d,0x61,0x74,0x09,0x67,0x73,0x75,0x62,0x08,0x6d,0x6f,0x64,0x0c,0x54,0x49,0x4d,\n    0x45,0x4f,0x55,0x54,0x0f,0x73,0x65,0x74,0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x09,\n    0x62,0x69,0x6e,0x64,0x0b,0x73,0x65,0x72,0x76,0x65,0x72,0x10,0x67,0x65,0x74,0x73,\n    0x6f,0x63,0x6b,0x6e,0x61,0x6d,0x65,0x0f,0x67,0x65,0x74,0x63,0x6f,0x6e,0x74,0x72,\n    0x6f,0x6c,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x0a,0x70,0x61,0x73,0x76,0x74,0x80,\n    0x04,0x8b,0x01,0x00,0x02,0x07,0x06,0x05,0x00,0x18,0x2b,0x02,0x00,0x00,0x37,0x02,\n    0x00,0x02,0x2b,0x03,0x01,0x00,0x29,0x04,0x00,0x00,0x27,0x05,0x00,0x00,0x3e,0x02,\n    0x04,0x02,0x2b,0x03,0x02,0x00,0x36,0x03,0x03,0x02,0x0f,0x00,0x03,0x00,0x54,0x04,\n    0x0a,0x80,0x2b,0x03,0x04,0x00,0x37,0x03,0x01,0x03,0x2b,0x04,0x04,0x00,0x37,0x04,\n    0x02,0x04,0x10,0x05,0x04,0x00,0x37,0x04,0x03,0x04,0x25,0x06,0x04,0x00,0x3e,0x04,\n    0x03,0x00,0x3d,0x03,0x00,0x02,0x2c,0x03,0x03,0x00,0x2b,0x03,0x05,0x00,0x10,0x04,\n    0x00,0x00,0x10,0x05,0x01,0x00,0x40,0x03,0x03,0x00,0x03,0x00,0x07,0xc0,0x04,0x00,\n    0x04,0x80,0x00,0xc0,0x06,0xc0,0x08,0x32,0x2e,0x2e,0x0a,0x63,0x68,0x65,0x63,0x6b,\n    0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x0b,0x73,0x65,0x6c,0x65,0x63,0x74,0xa6,0x05,\n    0x01,0x02,0x0f,0x05,0x20,0x00,0x6f,0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,0x0e,\n    0x00,0x03,0x00,0x54,0x04,0x01,0x80,0x37,0x03,0x02,0x00,0x25,0x04,0x03,0x00,0x3e,\n    0x02,0x03,0x01,0x37,0x02,0x01,0x00,0x0f,0x00,0x02,0x00,0x54,0x03,0x03,0x80,0x10,\n    0x03,0x00,0x00,0x37,0x02,0x04,0x00,0x3e,0x02,0x02,0x01,0x37,0x02,0x05,0x01,0x0e,\n    0x00,0x02,0x00,0x54,0x03,0x0c,0x80,0x2b,0x02,0x00,0x00,0x37,0x02,0x06,0x02,0x2b,\n    0x03,0x01,0x00,0x37,0x03,0x07,0x03,0x37,0x04,0x08,0x01,0x0e,0x00,0x04,0x00,0x54,\n    0x05,0x01,0x80,0x25,0x04,0x09,0x00,0x25,0x05,0x0a,0x00,0x25,0x06,0x09,0x00,0x3e,\n    0x03,0x04,0x00,0x3d,0x02,0x00,0x02,0x07,0x02,0x09,0x00,0x54,0x03,0x01,0x80,0x29,\n    0x02,0x00,0x00,0x37,0x03,0x0b,0x01,0x0e,0x00,0x03,0x00,0x54,0x04,0x01,0x80,0x25,\n    0x03,0x0c,0x00,0x37,0x04,0x00,0x00,0x37,0x05,0x0d,0x00,0x10,0x06,0x05,0x00,0x37,\n    0x05,0x0b,0x05,0x10,0x07,0x03,0x00,0x10,0x08,0x02,0x00,0x3e,0x05,0x04,0x00,0x3d,\n    0x04,0x00,0x01,0x37,0x04,0x00,0x00,0x37,0x05,0x0d,0x00,0x10,0x06,0x05,0x00,0x37,\n    0x05,0x0e,0x05,0x33,0x07,0x0f,0x00,0x3e,0x05,0x03,0x00,0x3d,0x04,0x00,0x03,0x37,\n    0x06,0x01,0x00,0x0e,0x00,0x06,0x00,0x54,0x06,0x03,0x80,0x10,0x07,0x00,0x00,0x37,\n    0x06,0x10,0x00,0x3e,0x06,0x02,0x01,0x37,0x06,0x11,0x01,0x0e,0x00,0x06,0x00,0x54,\n    0x07,0x03,0x80,0x2b,0x06,0x02,0x00,0x37,0x06,0x12,0x06,0x37,0x06,0x11,0x06,0x32,\n    0x07,0x03,0x00,0x37,0x08,0x0d,0x00,0x37,0x08,0x13,0x08,0x3b,0x08,0x01,0x07,0x31,\n    0x08,0x14,0x00,0x2b,0x09,0x03,0x00,0x37,0x09,0x15,0x09,0x25,0x0a,0x16,0x00,0x37,\n    0x0b,0x17,0x00,0x3e,0x09,0x03,0x02,0x37,0x0a,0x00,0x00,0x2b,0x0b,0x02,0x00,0x37,\n    0x0b,0x12,0x0b,0x37,0x0b,0x18,0x0b,0x37,0x0c,0x19,0x01,0x10,0x0d,0x09,0x00,0x10,\n    0x0e,0x08,0x00,0x3e,0x0b,0x04,0x00,0x3d,0x0a,0x00,0x01,0x2b,0x0a,0x01,0x00,0x37,\n    0x0a,0x1a,0x0a,0x10,0x0b,0x04,0x00,0x25,0x0c,0x1b,0x00,0x3e,0x0a,0x03,0x02,0x0f,\n    0x00,0x0a,0x00,0x54,0x0b,0x07,0x80,0x37,0x0a,0x00,0x00,0x37,0x0b,0x0d,0x00,0x10,\n    0x0c,0x0b,0x00,0x37,0x0b,0x0e,0x0b,0x25,0x0d,0x1c,0x00,0x3e,0x0b,0x03,0x00,0x3d,\n    0x0a,0x00,0x01,0x37,0x0a,0x17,0x00,0x10,0x0b,0x0a,0x00,0x37,0x0a,0x1d,0x0a,0x3e,\n    0x0a,0x02,0x01,0x2b,0x0a,0x03,0x00,0x37,0x0a,0x1e,0x0a,0x27,0x0b,0x01,0x00,0x37,\n    0x0c,0x17,0x00,0x10,0x0d,0x0c,0x00,0x37,0x0c,0x1f,0x0c,0x3e,0x0c,0x02,0x00,0x3d,\n    0x0a,0x01,0x02,0x29,0x0b,0x00,0x00,0x3a,0x0b,0x17,0x00,0x30,0x00,0x00,0x80,0x48,\n    0x0a,0x02,0x00,0x05,0xc0,0x02,0xc0,0x07,0xc0,0x04,0xc0,0x06,0xc0,0x0d,0x67,0x65,\n    0x74,0x73,0x74,0x61,0x74,0x73,0x09,0x73,0x6b,0x69,0x70,0x0a,0x63,0x6c,0x6f,0x73,\n    0x65,0x08,0x32,0x2e,0x2e,0x08,0x31,0x2e,0x2e,0x09,0x66,0x69,0x6e,0x64,0x0b,0x73,\n    0x6f,0x75,0x72,0x63,0x65,0x08,0x61,0x6c,0x6c,0x09,0x64,0x61,0x74,0x61,0x14,0x63,\n    0x6c,0x6f,0x73,0x65,0x2d,0x77,0x68,0x65,0x6e,0x2d,0x64,0x6f,0x6e,0x65,0x09,0x73,\n    0x69,0x6e,0x6b,0x00,0x06,0x63,0x09,0x70,0x75,0x6d,0x70,0x09,0x73,0x74,0x65,0x70,\n    0x10,0x70,0x6f,0x72,0x74,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x01,0x03,0x00,0x00,\n    0x08,0x32,0x2e,0x2e,0x08,0x31,0x2e,0x2e,0x0a,0x63,0x68,0x65,0x63,0x6b,0x07,0x74,\n    0x70,0x09,0x73,0x74,0x6f,0x72,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x0a,0x5e,\n    0x5b,0x2f,0x5c,0x5d,0x05,0x09,0x70,0x61,0x74,0x68,0x09,0x67,0x73,0x75,0x62,0x0d,\n    0x75,0x6e,0x65,0x73,0x63,0x61,0x70,0x65,0x0d,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,\n    0x74,0x10,0x70,0x61,0x73,0x76,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x1c,0x6e,0x65,\n    0x65,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x6f,0x72,0x20,0x70,0x61,0x73,0x76,0x20,\n    0x66,0x69,0x72,0x73,0x74,0x0b,0x73,0x65,0x72,0x76,0x65,0x72,0x0a,0x70,0x61,0x73,\n    0x76,0x74,0x08,0x74,0x72,0x79,0x88,0x05,0x00,0x02,0x0d,0x04,0x1c,0x00,0x6d,0x37,\n    0x02,0x00,0x00,0x37,0x03,0x01,0x00,0x0e,0x00,0x03,0x00,0x54,0x04,0x01,0x80,0x37,\n    0x03,0x02,0x00,0x25,0x04,0x03,0x00,0x3e,0x02,0x03,0x01,0x37,0x02,0x01,0x00,0x0f,\n    0x00,0x02,0x00,0x54,0x03,0x03,0x80,0x10,0x03,0x00,0x00,0x37,0x02,0x04,0x00,0x3e,\n    0x02,0x02,0x01,0x37,0x02,0x05,0x01,0x0e,0x00,0x02,0x00,0x54,0x03,0x0c,0x80,0x2b,\n    0x02,0x00,0x00,0x37,0x02,0x06,0x02,0x2b,0x03,0x01,0x00,0x37,0x03,0x07,0x03,0x37,\n    0x04,0x08,0x01,0x0e,0x00,0x04,0x00,0x54,0x05,0x01,0x80,0x25,0x04,0x09,0x00,0x25,\n    0x05,0x0a,0x00,0x25,0x06,0x09,0x00,0x3e,0x03,0x04,0x00,0x3d,0x02,0x00,0x02,0x07,\n    0x02,0x09,0x00,0x54,0x03,0x01,0x80,0x29,0x02,0x00,0x00,0x37,0x03,0x0b,0x01,0x0e,\n    0x00,0x03,0x00,0x54,0x04,0x01,0x80,0x25,0x03,0x0c,0x00,0x37,0x04,0x00,0x00,0x37,\n    0x05,0x0d,0x00,0x10,0x06,0x05,0x00,0x37,0x05,0x0b,0x05,0x10,0x07,0x03,0x00,0x10,\n    0x08,0x02,0x00,0x3e,0x05,0x04,0x00,0x3d,0x04,0x00,0x01,0x37,0x04,0x00,0x00,0x37,\n    0x05,0x0d,0x00,0x10,0x06,0x05,0x00,0x37,0x05,0x0e,0x05,0x33,0x07,0x0f,0x00,0x3e,\n    0x05,0x03,0x00,0x3d,0x04,0x00,0x03,0x27,0x06,0xc8,0x00,0x03,0x06,0x04,0x00,0x54,\n    0x06,0x08,0x80,0x27,0x06,0x2b,0x01,0x03,0x04,0x06,0x00,0x54,0x06,0x05,0x80,0x37,\n    0x06,0x10,0x01,0x10,0x07,0x05,0x00,0x3e,0x06,0x02,0x01,0x27,0x06,0x01,0x00,0x48,\n    0x06,0x02,0x00,0x37,0x06,0x01,0x00,0x0e,0x00,0x06,0x00,0x54,0x06,0x03,0x80,0x10,\n    0x07,0x00,0x00,0x37,0x06,0x11,0x00,0x3e,0x06,0x02,0x01,0x2b,0x06,0x02,0x00,0x37,\n    0x06,0x12,0x06,0x25,0x07,0x13,0x00,0x37,0x08,0x14,0x00,0x3e,0x06,0x03,0x02,0x37,\n    0x07,0x15,0x01,0x0e,0x00,0x07,0x00,0x54,0x08,0x03,0x80,0x2b,0x07,0x03,0x00,0x37,\n    0x07,0x16,0x07,0x37,0x07,0x15,0x07,0x37,0x08,0x00,0x00,0x2b,0x09,0x03,0x00,0x37,\n    0x09,0x16,0x09,0x37,0x09,0x17,0x09,0x10,0x0a,0x06,0x00,0x37,0x0b,0x10,0x01,0x10,\n    0x0c,0x07,0x00,0x3e,0x09,0x04,0x00,0x3d,0x08,0x00,0x01,0x2b,0x08,0x01,0x00,0x37,\n    0x08,0x18,0x08,0x10,0x09,0x04,0x00,0x25,0x0a,0x19,0x00,0x3e,0x08,0x03,0x02,0x0f,\n    0x00,0x08,0x00,0x54,0x09,0x07,0x80,0x37,0x08,0x00,0x00,0x37,0x09,0x0d,0x00,0x10,\n    0x0a,0x09,0x00,0x37,0x09,0x0e,0x09,0x25,0x0b,0x1a,0x00,0x3e,0x09,0x03,0x00,0x3d,\n    0x08,0x00,0x01,0x37,0x08,0x14,0x00,0x10,0x09,0x08,0x00,0x37,0x08,0x1b,0x08,0x3e,\n    0x08,0x02,0x01,0x29,0x08,0x00,0x00,0x3a,0x08,0x14,0x00,0x27,0x08,0x01,0x00,0x48,\n    0x08,0x02,0x00,0x05,0xc0,0x02,0xc0,0x04,0xc0,0x07,0xc0,0x0a,0x63,0x6c,0x6f,0x73,\n    0x65,0x08,0x32,0x2e,0x2e,0x08,0x31,0x2e,0x2e,0x09,0x66,0x69,0x6e,0x64,0x08,0x61,\n    0x6c,0x6c,0x09,0x70,0x75,0x6d,0x70,0x09,0x73,0x74,0x65,0x70,0x09,0x64,0x61,0x74,\n    0x61,0x11,0x75,0x6e,0x74,0x69,0x6c,0x2d,0x63,0x6c,0x6f,0x73,0x65,0x64,0x0b,0x73,\n    0x6f,0x75,0x72,0x63,0x65,0x10,0x70,0x6f,0x72,0x74,0x63,0x6f,0x6e,0x6e,0x65,0x63,\n    0x74,0x09,0x73,0x69,0x6e,0x6b,0x01,0x03,0x00,0x00,0x08,0x31,0x2e,0x2e,0x08,0x32,\n    0x2e,0x2e,0x0a,0x63,0x68,0x65,0x63,0x6b,0x07,0x74,0x70,0x09,0x72,0x65,0x74,0x72,\n    0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x0a,0x5e,0x5b,0x2f,0x5c,0x5d,0x05,0x09,\n    0x70,0x61,0x74,0x68,0x09,0x67,0x73,0x75,0x62,0x0d,0x75,0x6e,0x65,0x73,0x63,0x61,\n    0x70,0x65,0x0d,0x61,0x72,0x67,0x75,0x6d,0x65,0x6e,0x74,0x10,0x70,0x61,0x73,0x76,\n    0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x1c,0x6e,0x65,0x65,0x64,0x20,0x70,0x6f,0x72,\n    0x74,0x20,0x6f,0x72,0x20,0x70,0x61,0x73,0x76,0x20,0x66,0x69,0x72,0x73,0x74,0x0b,\n    0x73,0x65,0x72,0x76,0x65,0x72,0x0a,0x70,0x61,0x73,0x76,0x74,0x08,0x74,0x72,0x79,\n    0x64,0x00,0x02,0x07,0x00,0x05,0x00,0x11,0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,\n    0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x25,0x05,0x03,0x00,0x10,0x06,0x01,0x00,\n    0x3e,0x03,0x04,0x00,0x3d,0x02,0x00,0x01,0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,\n    0x10,0x04,0x03,0x00,0x37,0x03,0x04,0x03,0x27,0x05,0xfa,0x00,0x3e,0x03,0x03,0x00,\n    0x3d,0x02,0x00,0x01,0x27,0x02,0x01,0x00,0x48,0x02,0x02,0x00,0x0a,0x63,0x68,0x65,\n    0x63,0x6b,0x08,0x63,0x77,0x64,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x07,0x74,\n    0x70,0x08,0x74,0x72,0x79,0x65,0x00,0x02,0x07,0x00,0x05,0x00,0x11,0x37,0x02,0x00,\n    0x00,0x37,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x25,0x05,0x03,\n    0x00,0x10,0x06,0x01,0x00,0x3e,0x03,0x04,0x00,0x3d,0x02,0x00,0x01,0x37,0x02,0x00,\n    0x00,0x37,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x04,0x03,0x27,0x05,0xc8,\n    0x00,0x3e,0x03,0x03,0x00,0x3d,0x02,0x00,0x01,0x27,0x02,0x01,0x00,0x48,0x02,0x02,\n    0x00,0x0a,0x63,0x68,0x65,0x63,0x6b,0x09,0x74,0x79,0x70,0x65,0x0c,0x63,0x6f,0x6d,\n    0x6d,0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x8b,0x01,0x00,0x01,0x06,\n    0x01,0x07,0x00,0x17,0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,0x10,0x03,0x02,0x00,\n    0x37,0x02,0x02,0x02,0x33,0x04,0x03,0x00,0x3e,0x02,0x03,0x00,0x3d,0x01,0x00,0x02,\n    0x2b,0x02,0x00,0x00,0x37,0x02,0x04,0x02,0x10,0x03,0x01,0x00,0x25,0x04,0x05,0x00,\n    0x3e,0x02,0x03,0x02,0x0f,0x00,0x02,0x00,0x54,0x03,0x07,0x80,0x37,0x02,0x00,0x00,\n    0x37,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x25,0x05,0x06,0x00,\n    0x3e,0x03,0x03,0x00,0x3d,0x02,0x00,0x01,0x27,0x02,0x01,0x00,0x48,0x02,0x02,0x00,\n    0x02,0xc0,0x08,0x32,0x2e,0x2e,0x08,0x31,0x2e,0x2e,0x09,0x66,0x69,0x6e,0x64,0x01,\n    0x03,0x00,0x00,0x08,0x31,0x2e,0x2e,0x08,0x32,0x2e,0x2e,0x0a,0x63,0x68,0x65,0x63,\n    0x6b,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x65,0x00,0x01,0x05,0x00,0x06,0x00,0x10,\n    0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x02,0x02,\n    0x25,0x04,0x03,0x00,0x3e,0x02,0x03,0x00,0x3d,0x01,0x00,0x01,0x37,0x01,0x00,0x00,\n    0x37,0x02,0x01,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x04,0x02,0x25,0x04,0x05,0x00,\n    0x3e,0x02,0x03,0x00,0x3d,0x01,0x00,0x01,0x27,0x01,0x01,0x00,0x48,0x01,0x02,0x00,\n    0x08,0x32,0x2e,0x2e,0x0a,0x63,0x68,0x65,0x63,0x6b,0x09,0x71,0x75,0x69,0x74,0x0c,\n    0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x64,0x00,\n    0x01,0x03,0x00,0x04,0x00,0x12,0x37,0x01,0x00,0x00,0x0f,0x00,0x01,0x00,0x54,0x02,\n    0x04,0x80,0x37,0x01,0x00,0x00,0x10,0x02,0x01,0x00,0x37,0x01,0x01,0x01,0x3e,0x01,\n    0x02,0x01,0x37,0x01,0x02,0x00,0x0f,0x00,0x01,0x00,0x54,0x02,0x04,0x80,0x37,0x01,\n    0x02,0x00,0x10,0x02,0x01,0x00,0x37,0x01,0x01,0x01,0x3e,0x01,0x02,0x01,0x37,0x01,\n    0x03,0x00,0x10,0x02,0x01,0x00,0x37,0x01,0x01,0x01,0x40,0x01,0x02,0x00,0x07,0x74,\n    0x70,0x0b,0x73,0x65,0x72,0x76,0x65,0x72,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x09,0x64,\n    0x61,0x74,0x61,0x67,0x00,0x01,0x08,0x02,0x03,0x00,0x13,0x37,0x01,0x00,0x00,0x0f,\n    0x00,0x01,0x00,0x54,0x02,0x0e,0x80,0x2b,0x01,0x00,0x00,0x37,0x01,0x01,0x01,0x37,\n    0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x2b,0x02,0x01,0x00,0x37,0x02,0x02,0x02,0x10,\n    0x03,0x00,0x00,0x3e,0x02,0x02,0x04,0x54,0x05,0x01,0x80,0x39,0x06,0x05,0x01,0x41,\n    0x05,0x03,0x03,0x4e,0x05,0xfd,0x7f,0x48,0x01,0x02,0x00,0x54,0x01,0x01,0x80,0x48,\n    0x00,0x02,0x00,0x47,0x00,0x01,0x00,0x05,0xc0,0x00,0xc0,0x0a,0x70,0x61,0x69,0x72,\n    0x73,0x0a,0x70,0x61,0x72,0x73,0x65,0x08,0x75,0x72,0x6c,0x9c,0x02,0x00,0x01,0x06,\n    0x03,0x0f,0x00,0x2c,0x2b,0x01,0x00,0x00,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,\n    0x10,0x00,0x01,0x00,0x2b,0x01,0x01,0x00,0x37,0x01,0x00,0x01,0x37,0x02,0x01,0x00,\n    0x25,0x03,0x02,0x00,0x3e,0x01,0x03,0x01,0x2b,0x01,0x02,0x00,0x37,0x01,0x03,0x01,\n    0x37,0x02,0x01,0x00,0x37,0x03,0x04,0x00,0x37,0x04,0x05,0x00,0x3e,0x01,0x04,0x02,\n    0x10,0x03,0x01,0x00,0x37,0x02,0x06,0x01,0x3e,0x02,0x02,0x01,0x10,0x03,0x01,0x00,\n    0x37,0x02,0x07,0x01,0x37,0x04,0x08,0x00,0x37,0x05,0x09,0x00,0x3e,0x02,0x04,0x01,\n    0x37,0x02,0x0a,0x00,0x0f,0x00,0x02,0x00,0x54,0x03,0x04,0x80,0x10,0x03,0x01,0x00,\n    0x37,0x02,0x0a,0x01,0x37,0x04,0x0a,0x00,0x3e,0x02,0x03,0x01,0x10,0x03,0x01,0x00,\n    0x37,0x02,0x0b,0x01,0x3e,0x02,0x02,0x01,0x10,0x03,0x01,0x00,0x37,0x02,0x0c,0x01,\n    0x10,0x04,0x00,0x00,0x3e,0x02,0x03,0x02,0x10,0x04,0x01,0x00,0x37,0x03,0x0d,0x01,\n    0x3e,0x03,0x02,0x01,0x10,0x04,0x01,0x00,0x37,0x03,0x0e,0x01,0x3e,0x03,0x02,0x01,\n    0x48,0x02,0x02,0x00,0x0a,0xc0,0x04,0xc0,0x08,0xc0,0x0a,0x63,0x6c,0x6f,0x73,0x65,\n    0x09,0x71,0x75,0x69,0x74,0x09,0x73,0x65,0x6e,0x64,0x09,0x70,0x61,0x73,0x76,0x09,\n    0x74,0x79,0x70,0x65,0x0d,0x70,0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0x09,0x75,0x73,\n    0x65,0x72,0x0a,0x6c,0x6f,0x67,0x69,0x6e,0x0a,0x67,0x72,0x65,0x65,0x74,0x0b,0x63,\n    0x72,0x65,0x61,0x74,0x65,0x09,0x70,0x6f,0x72,0x74,0x09,0x6f,0x70,0x65,0x6e,0x15,\n    0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x20,0x68,0x6f,0x73,0x74,0x6e,0x61,0x6d,0x65,\n    0x09,0x68,0x6f,0x73,0x74,0x08,0x74,0x72,0x79,0xe3,0x02,0x00,0x01,0x08,0x04,0x10,\n    0x00,0x39,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x2b,0x02,0x01,0x00,0x37,0x02,\n    0x01,0x02,0x10,0x03,0x00,0x00,0x2b,0x04,0x02,0x00,0x3e,0x02,0x03,0x00,0x3d,0x01,\n    0x00,0x02,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,0x37,0x03,0x02,0x01,0x06,0x03,\n    0x03,0x00,0x54,0x03,0x02,0x80,0x29,0x03,0x01,0x00,0x54,0x04,0x01,0x80,0x29,0x03,\n    0x02,0x00,0x25,0x04,0x04,0x00,0x37,0x05,0x02,0x01,0x25,0x06,0x05,0x00,0x24,0x04,\n    0x06,0x04,0x3e,0x02,0x03,0x01,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,0x37,0x03,\n    0x06,0x01,0x25,0x04,0x07,0x00,0x3e,0x02,0x03,0x01,0x25,0x02,0x08,0x00,0x37,0x03,\n    0x09,0x01,0x0f,0x00,0x03,0x00,0x54,0x04,0x1a,0x80,0x2b,0x03,0x00,0x00,0x37,0x03,\n    0x0b,0x03,0x27,0x04,0x02,0x00,0x2b,0x05,0x03,0x00,0x37,0x05,0x0c,0x05,0x37,0x06,\n    0x09,0x01,0x10,0x07,0x02,0x00,0x3e,0x05,0x03,0x00,0x3d,0x03,0x01,0x02,0x3a,0x03,\n    0x0a,0x01,0x2b,0x03,0x00,0x00,0x37,0x03,0x00,0x03,0x37,0x04,0x0a,0x01,0x06,0x04,\n    0x0d,0x00,0x54,0x04,0x05,0x80,0x37,0x04,0x0a,0x01,0x06,0x04,0x0e,0x00,0x54,0x04,\n    0x02,0x80,0x29,0x04,0x01,0x00,0x54,0x05,0x01,0x80,0x29,0x04,0x02,0x00,0x25,0x05,\n    0x0f,0x00,0x37,0x06,0x0a,0x01,0x25,0x07,0x05,0x00,0x24,0x05,0x07,0x05,0x3e,0x03,\n    0x03,0x01,0x48,0x01,0x02,0x00,0x04,0xc0,0x05,0xc0,0x0c,0xc0,0x02,0xc0,0x13,0x69,\n    0x6e,0x76,0x61,0x6c,0x69,0x64,0x20,0x74,0x79,0x70,0x65,0x20,0x27,0x06,0x69,0x06,\n    0x61,0x09,0x66,0x69,0x6e,0x64,0x09,0x73,0x6b,0x69,0x70,0x09,0x74,0x79,0x70,0x65,\n    0x0b,0x70,0x61,0x72,0x61,0x6d,0x73,0x0f,0x5e,0x74,0x79,0x70,0x65,0x3d,0x28,0x2e,\n    0x29,0x24,0x15,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x20,0x68,0x6f,0x73,0x74,0x6e,\n    0x61,0x6d,0x65,0x09,0x68,0x6f,0x73,0x74,0x06,0x27,0x13,0x77,0x72,0x6f,0x6e,0x67,\n    0x20,0x73,0x63,0x68,0x65,0x6d,0x65,0x20,0x27,0x08,0x66,0x74,0x70,0x0b,0x73,0x63,\n    0x68,0x65,0x6d,0x65,0x0a,0x70,0x61,0x72,0x73,0x65,0x08,0x74,0x72,0x79,0x4b,0x00,\n    0x02,0x05,0x03,0x02,0x00,0x0c,0x2b,0x02,0x00,0x00,0x10,0x03,0x00,0x00,0x3e,0x02,\n    0x02,0x02,0x2b,0x03,0x01,0x00,0x37,0x03,0x00,0x03,0x37,0x03,0x01,0x03,0x10,0x04,\n    0x01,0x00,0x3e,0x03,0x02,0x02,0x3a,0x03,0x00,0x02,0x2b,0x03,0x02,0x00,0x10,0x04,\n    0x02,0x00,0x40,0x03,0x02,0x00,0x0d,0xc0,0x07,0xc0,0x0b,0xc0,0x0b,0x73,0x74,0x72,\n    0x69,0x6e,0x67,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x55,0x00,0x02,0x05,0x03,0x02,\n    0x00,0x0f,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,0x10,0x03,0x00,0x00,0x3e,0x02,\n    0x02,0x02,0x07,0x02,0x01,0x00,0x54,0x02,0x05,0x80,0x2b,0x02,0x01,0x00,0x10,0x03,\n    0x00,0x00,0x10,0x04,0x01,0x00,0x40,0x02,0x03,0x00,0x54,0x02,0x03,0x80,0x2b,0x02,\n    0x02,0x00,0x10,0x03,0x00,0x00,0x40,0x02,0x02,0x00,0x47,0x00,0x01,0x00,0x00,0xc0,\n    0x0e,0xc0,0x0b,0xc0,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x09,0x74,0x79,0x70,0x65,\n    0x9b,0x02,0x00,0x01,0x06,0x03,0x0f,0x00,0x2b,0x2b,0x01,0x00,0x00,0x10,0x02,0x00,\n    0x00,0x3e,0x01,0x02,0x02,0x10,0x00,0x01,0x00,0x2b,0x01,0x01,0x00,0x37,0x01,0x00,\n    0x01,0x37,0x02,0x01,0x00,0x25,0x03,0x02,0x00,0x3e,0x01,0x03,0x01,0x2b,0x01,0x02,\n    0x00,0x37,0x01,0x03,0x01,0x37,0x02,0x01,0x00,0x37,0x03,0x04,0x00,0x37,0x04,0x05,\n    0x00,0x3e,0x01,0x04,0x02,0x10,0x03,0x01,0x00,0x37,0x02,0x06,0x01,0x3e,0x02,0x02,\n    0x01,0x10,0x03,0x01,0x00,0x37,0x02,0x07,0x01,0x37,0x04,0x08,0x00,0x37,0x05,0x09,\n    0x00,0x3e,0x02,0x04,0x01,0x37,0x02,0x0a,0x00,0x0f,0x00,0x02,0x00,0x54,0x03,0x04,\n    0x80,0x10,0x03,0x01,0x00,0x37,0x02,0x0a,0x01,0x37,0x04,0x0a,0x00,0x3e,0x02,0x03,\n    0x01,0x10,0x03,0x01,0x00,0x37,0x02,0x0b,0x01,0x3e,0x02,0x02,0x01,0x10,0x03,0x01,\n    0x00,0x37,0x02,0x0c,0x01,0x10,0x04,0x00,0x00,0x3e,0x02,0x03,0x01,0x10,0x03,0x01,\n    0x00,0x37,0x02,0x0d,0x01,0x3e,0x02,0x02,0x01,0x10,0x03,0x01,0x00,0x37,0x02,0x0e,\n    0x01,0x40,0x02,0x02,0x00,0x0a,0xc0,0x04,0xc0,0x08,0xc0,0x0a,0x63,0x6c,0x6f,0x73,\n    0x65,0x09,0x71,0x75,0x69,0x74,0x0c,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x09,0x70,\n    0x61,0x73,0x76,0x09,0x74,0x79,0x70,0x65,0x0d,0x70,0x61,0x73,0x73,0x77,0x6f,0x72,\n    0x64,0x09,0x75,0x73,0x65,0x72,0x0a,0x6c,0x6f,0x67,0x69,0x6e,0x0a,0x67,0x72,0x65,\n    0x65,0x74,0x0b,0x63,0x72,0x65,0x61,0x74,0x65,0x09,0x70,0x6f,0x72,0x74,0x09,0x6f,\n    0x70,0x65,0x6e,0x15,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x20,0x68,0x6f,0x73,0x74,\n    0x6e,0x61,0x6d,0x65,0x09,0x68,0x6f,0x73,0x74,0x08,0x74,0x72,0x79,0x65,0x00,0x01,\n    0x05,0x04,0x03,0x00,0x11,0x2b,0x01,0x00,0x00,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,\n    0x02,0x32,0x02,0x00,0x00,0x2b,0x03,0x01,0x00,0x37,0x03,0x00,0x03,0x37,0x03,0x01,\n    0x03,0x10,0x04,0x02,0x00,0x3e,0x03,0x02,0x02,0x3a,0x03,0x00,0x01,0x2b,0x03,0x02,\n    0x00,0x10,0x04,0x01,0x00,0x3e,0x03,0x02,0x01,0x2b,0x03,0x03,0x00,0x37,0x03,0x02,\n    0x03,0x10,0x04,0x02,0x00,0x40,0x03,0x02,0x00,0x0d,0xc0,0x07,0xc0,0x0f,0xc0,0x01,\n    0xc0,0x0b,0x63,0x6f,0x6e,0x63,0x61,0x74,0x0a,0x74,0x61,0x62,0x6c,0x65,0x09,0x73,\n    0x69,0x6e,0x6b,0xd1,0x02,0x00,0x01,0x07,0x02,0x11,0x00,0x33,0x2b,0x01,0x00,0x00,\n    0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x10,0x00,0x01,0x00,0x2b,0x01,0x01,0x00,\n    0x37,0x01,0x00,0x01,0x37,0x02,0x01,0x00,0x25,0x03,0x02,0x00,0x3e,0x01,0x03,0x01,\n    0x2b,0x01,0x01,0x00,0x37,0x01,0x00,0x01,0x37,0x02,0x03,0x00,0x25,0x03,0x04,0x00,\n    0x3e,0x01,0x03,0x01,0x34,0x01,0x05,0x00,0x37,0x02,0x01,0x00,0x37,0x03,0x06,0x00,\n    0x37,0x04,0x07,0x00,0x3e,0x01,0x04,0x02,0x10,0x03,0x01,0x00,0x37,0x02,0x08,0x01,\n    0x3e,0x02,0x02,0x01,0x10,0x03,0x01,0x00,0x37,0x02,0x09,0x01,0x37,0x04,0x0a,0x00,\n    0x37,0x05,0x0b,0x00,0x3e,0x02,0x04,0x01,0x37,0x02,0x00,0x01,0x37,0x03,0x0c,0x01,\n    0x10,0x04,0x03,0x00,0x37,0x03,0x03,0x03,0x37,0x05,0x03,0x00,0x37,0x06,0x0d,0x00,\n    0x3e,0x03,0x04,0x00,0x3d,0x02,0x00,0x01,0x37,0x02,0x0e,0x00,0x0f,0x00,0x02,0x00,\n    0x54,0x03,0x07,0x80,0x37,0x02,0x00,0x01,0x37,0x03,0x0c,0x01,0x10,0x04,0x03,0x00,\n    0x37,0x03,0x0e,0x03,0x37,0x05,0x0e,0x00,0x3e,0x03,0x03,0x00,0x3d,0x02,0x00,0x01,\n    0x10,0x03,0x01,0x00,0x37,0x02,0x0f,0x01,0x3e,0x02,0x02,0x01,0x10,0x03,0x01,0x00,\n    0x37,0x02,0x10,0x01,0x40,0x02,0x02,0x00,0x0a,0xc0,0x04,0xc0,0x0a,0x63,0x6c,0x6f,\n    0x73,0x65,0x09,0x71,0x75,0x69,0x74,0x0a,0x63,0x68,0x65,0x63,0x6b,0x0d,0x61,0x72,\n    0x67,0x75,0x6d,0x65,0x6e,0x74,0x07,0x74,0x70,0x0d,0x70,0x61,0x73,0x73,0x77,0x6f,\n    0x72,0x64,0x09,0x75,0x73,0x65,0x72,0x0a,0x6c,0x6f,0x67,0x69,0x6e,0x0a,0x67,0x72,\n    0x65,0x65,0x74,0x0b,0x63,0x72,0x65,0x61,0x74,0x65,0x09,0x70,0x6f,0x72,0x74,0x09,\n    0x6f,0x70,0x65,0x6e,0x14,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x20,0x63,0x6f,0x6d,\n    0x6d,0x61,0x6e,0x64,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x15,0x6d,0x69,0x73,\n    0x73,0x69,0x6e,0x67,0x20,0x68,0x6f,0x73,0x74,0x6e,0x61,0x6d,0x65,0x09,0x68,0x6f,\n    0x73,0x74,0x08,0x74,0x72,0x79,0x51,0x00,0x01,0x03,0x03,0x02,0x00,0x0e,0x2b,0x01,\n    0x00,0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x07,0x01,\n    0x01,0x00,0x54,0x01,0x04,0x80,0x2b,0x01,0x01,0x00,0x10,0x02,0x00,0x00,0x40,0x01,\n    0x02,0x00,0x54,0x01,0x03,0x80,0x2b,0x01,0x02,0x00,0x10,0x02,0x00,0x00,0x40,0x01,\n    0x02,0x00,0x47,0x00,0x01,0x00,0x00,0xc0,0x10,0xc0,0x0f,0xc0,0x0b,0x73,0x74,0x72,\n    0x69,0x6e,0x67,0x09,0x74,0x79,0x70,0x65,0x9b,0x05,0x03,0x00,0x13,0x00,0x39,0x00,\n    0x5f,0x34,0x00,0x00,0x00,0x34,0x01,0x01,0x00,0x25,0x02,0x02,0x00,0x3e,0x01,0x02,\n    0x02,0x34,0x02,0x01,0x00,0x25,0x03,0x03,0x00,0x3e,0x02,0x02,0x02,0x34,0x03,0x01,\n    0x00,0x25,0x04,0x04,0x00,0x3e,0x03,0x02,0x02,0x34,0x04,0x01,0x00,0x25,0x05,0x05,\n    0x00,0x3e,0x04,0x02,0x02,0x34,0x05,0x01,0x00,0x25,0x06,0x06,0x00,0x3e,0x05,0x02,\n    0x02,0x34,0x06,0x01,0x00,0x25,0x07,0x07,0x00,0x3e,0x06,0x02,0x02,0x34,0x07,0x01,\n    0x00,0x25,0x08,0x08,0x00,0x3e,0x07,0x02,0x02,0x32,0x08,0x00,0x00,0x3a,0x08,0x09,\n    0x04,0x37,0x08,0x09,0x04,0x27,0x09,0x3c,0x00,0x3a,0x09,0x0a,0x08,0x27,0x09,0x15,\n    0x00,0x3a,0x09,0x0b,0x08,0x25,0x09,0x09,0x00,0x3a,0x09,0x0c,0x08,0x25,0x09,0x0e,\n    0x00,0x3a,0x09,0x0d,0x08,0x33,0x09,0x0f,0x00,0x32,0x0a,0x00,0x00,0x3a,0x0a,0x10,\n    0x09,0x31,0x0a,0x12,0x00,0x3a,0x0a,0x11,0x08,0x37,0x0a,0x10,0x09,0x31,0x0b,0x14,\n    0x00,0x3a,0x0b,0x13,0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x16,0x00,0x3a,0x0b,0x15,\n    0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x18,0x00,0x3a,0x0b,0x17,0x0a,0x37,0x0a,0x10,\n    0x09,0x31,0x0b,0x1a,0x00,0x3a,0x0b,0x19,0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x1c,\n    0x00,0x3a,0x0b,0x1b,0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x1e,0x00,0x3a,0x0b,0x1d,\n    0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x20,0x00,0x3a,0x0b,0x1f,0x0a,0x37,0x0a,0x10,\n    0x09,0x31,0x0b,0x22,0x00,0x3a,0x0b,0x21,0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x24,\n    0x00,0x3a,0x0b,0x23,0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x26,0x00,0x3a,0x0b,0x25,\n    0x0a,0x37,0x0a,0x10,0x09,0x31,0x0b,0x28,0x00,0x3a,0x0b,0x27,0x0a,0x37,0x0a,0x10,\n    0x09,0x31,0x0b,0x2a,0x00,0x3a,0x0b,0x29,0x0a,0x31,0x0a,0x2b,0x00,0x31,0x0b,0x2c,\n    0x00,0x33,0x0c,0x2d,0x00,0x31,0x0d,0x2e,0x00,0x31,0x0e,0x2f,0x00,0x37,0x0f,0x31,\n    0x04,0x31,0x10,0x32,0x00,0x3e,0x0f,0x02,0x02,0x3a,0x0f,0x30,0x08,0x31,0x0f,0x33,\n    0x00,0x31,0x10,0x34,0x00,0x37,0x11,0x31,0x04,0x31,0x12,0x36,0x00,0x3e,0x11,0x02,\n    0x02,0x3a,0x11,0x35,0x08,0x37,0x11,0x31,0x04,0x31,0x12,0x38,0x00,0x3e,0x11,0x02,\n    0x02,0x3a,0x11,0x37,0x08,0x30,0x00,0x00,0x80,0x48,0x08,0x02,0x00,0x00,0x08,0x67,\n    0x65,0x74,0x00,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x00,0x00,0x00,0x0c,0x70,\n    0x72,0x6f,0x74,0x65,0x63,0x74,0x08,0x70,0x75,0x74,0x00,0x00,0x01,0x00,0x02,0x0b,\n    0x73,0x63,0x68,0x65,0x6d,0x65,0x08,0x66,0x74,0x70,0x09,0x70,0x61,0x74,0x68,0x06,\n    0x2f,0x00,0x00,0x00,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x00,0x09,0x71,0x75,0x69,0x74,\n    0x00,0x0a,0x67,0x72,0x65,0x65,0x74,0x00,0x09,0x74,0x79,0x70,0x65,0x00,0x08,0x63,\n    0x77,0x64,0x00,0x0c,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x00,0x09,0x73,0x65,0x6e,\n    0x64,0x00,0x09,0x70,0x6f,0x72,0x74,0x00,0x09,0x70,0x61,0x73,0x76,0x00,0x0a,0x6c,\n    0x6f,0x67,0x69,0x6e,0x00,0x10,0x70,0x61,0x73,0x76,0x63,0x6f,0x6e,0x6e,0x65,0x63,\n    0x74,0x00,0x10,0x70,0x6f,0x72,0x74,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x00,0x09,\n    0x6f,0x70,0x65,0x6e,0x0c,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x01,0x00,0x00,0x1c,\n    0x61,0x6e,0x6f,0x6e,0x79,0x6d,0x6f,0x75,0x73,0x40,0x61,0x6e,0x6f,0x6e,0x79,0x6d,\n    0x6f,0x75,0x73,0x2e,0x6f,0x72,0x67,0x0d,0x50,0x41,0x53,0x53,0x57,0x4f,0x52,0x44,\n    0x09,0x55,0x53,0x45,0x52,0x09,0x50,0x4f,0x52,0x54,0x0c,0x54,0x49,0x4d,0x45,0x4f,\n    0x55,0x54,0x08,0x66,0x74,0x70,0x0a,0x6c,0x74,0x6e,0x31,0x32,0x0e,0x73,0x6f,0x63,\n    0x6b,0x65,0x74,0x2e,0x74,0x70,0x0f,0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x75,0x72,\n    0x6c,0x0b,0x73,0x6f,0x63,0x6b,0x65,0x74,0x09,0x6d,0x61,0x74,0x68,0x0b,0x73,0x74,\n    0x72,0x69,0x6e,0x67,0x0a,0x74,0x61,0x62,0x6c,0x65,0x0c,0x72,0x65,0x71,0x75,0x69,\n    0x72,0x65,0x07,0x5f,0x47,0x00,\n};\n\n/* socket.headers, socket/headers.lua */\nstatic const char lua_m_socket_headers[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0xc5,0x11,0x02,0x00,0x03,0x00,0x05,0x00,0x09,0x34,0x00,\n    0x00,0x00,0x25,0x01,0x01,0x00,0x3e,0x00,0x02,0x02,0x32,0x01,0x00,0x00,0x3a,0x01,\n    0x02,0x00,0x37,0x01,0x02,0x00,0x33,0x02,0x04,0x00,0x3a,0x02,0x03,0x01,0x48,0x01,\n    0x02,0x00,0x01,0x00,0x5b,0x16,0x6c,0x61,0x73,0x74,0x2d,0x61,0x74,0x74,0x65,0x6d,\n    0x70,0x74,0x2d,0x64,0x61,0x74,0x65,0x16,0x4c,0x61,0x73,0x74,0x2d,0x41,0x74,0x74,\n    0x65,0x6d,0x70,0x74,0x2d,0x44,0x61,0x74,0x65,0x0d,0x72,0x65,0x63,0x65,0x69,0x76,\n    0x65,0x64,0x0d,0x52,0x65,0x63,0x65,0x69,0x76,0x65,0x64,0x11,0x6d,0x69,0x6d,0x65,\n    0x2d,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x11,0x4d,0x49,0x4d,0x45,0x2d,0x56,0x65,\n    0x72,0x73,0x69,0x6f,0x6e,0x0d,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x0d,0x4c,\n    0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x0b,0x61,0x63,0x63,0x65,0x70,0x74,0x0b,0x41,\n    0x63,0x63,0x65,0x70,0x74,0x08,0x62,0x63,0x63,0x08,0x42,0x63,0x63,0x0f,0x72,0x65,\n    0x6d,0x6f,0x74,0x65,0x2d,0x6d,0x74,0x61,0x0f,0x52,0x65,0x6d,0x6f,0x74,0x65,0x2d,\n    0x4d,0x54,0x41,0x0b,0x70,0x72,0x61,0x67,0x6d,0x61,0x0b,0x50,0x72,0x61,0x67,0x6d,\n    0x61,0x0c,0x72,0x65,0x66,0x65,0x72,0x65,0x72,0x0c,0x52,0x65,0x66,0x65,0x72,0x65,\n    0x72,0x0b,0x63,0x6f,0x6f,0x6b,0x69,0x65,0x0b,0x43,0x6f,0x6f,0x6b,0x69,0x65,0x19,\n    0x6f,0x72,0x69,0x67,0x69,0x6e,0x61,0x6c,0x2d,0x65,0x6e,0x76,0x65,0x6c,0x6f,0x70,\n    0x65,0x2d,0x69,0x64,0x19,0x4f,0x72,0x69,0x67,0x69,0x6e,0x61,0x6c,0x2d,0x45,0x6e,\n    0x76,0x65,0x6c,0x6f,0x70,0x65,0x2d,0x49,0x44,0x10,0x72,0x65,0x74,0x72,0x79,0x2d,\n    0x61,0x66,0x74,0x65,0x72,0x10,0x52,0x65,0x74,0x72,0x79,0x2d,0x41,0x66,0x74,0x65,\n    0x72,0x09,0x66,0x72,0x6f,0x6d,0x09,0x46,0x72,0x6f,0x6d,0x12,0x61,0x75,0x74,0x68,\n    0x6f,0x72,0x69,0x7a,0x61,0x74,0x69,0x6f,0x6e,0x12,0x41,0x75,0x74,0x68,0x6f,0x72,\n    0x69,0x7a,0x61,0x74,0x69,0x6f,0x6e,0x12,0x63,0x61,0x63,0x68,0x65,0x2d,0x63,0x6f,\n    0x6e,0x74,0x72,0x6f,0x6c,0x12,0x43,0x61,0x63,0x68,0x65,0x2d,0x43,0x6f,0x6e,0x74,\n    0x72,0x6f,0x6c,0x1e,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x72,0x61,0x6e,\n    0x73,0x66,0x65,0x72,0x2d,0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x1e,0x43,0x6f,\n    0x6e,0x74,0x65,0x6e,0x74,0x2d,0x54,0x72,0x61,0x6e,0x73,0x66,0x65,0x72,0x2d,0x45,\n    0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x0d,0x6b,0x65,0x79,0x77,0x6f,0x72,0x64,0x73,\n    0x0d,0x4b,0x65,0x79,0x77,0x6f,0x72,0x64,0x73,0x10,0x72,0x65,0x74,0x75,0x72,0x6e,\n    0x2d,0x70,0x61,0x74,0x68,0x10,0x52,0x65,0x74,0x75,0x72,0x6e,0x2d,0x50,0x61,0x74,\n    0x68,0x15,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x6c,0x6f,0x63,0x61,0x74,0x69,\n    0x6f,0x6e,0x15,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x6f,0x63,0x61,0x74,\n    0x69,0x6f,0x6e,0x16,0x69,0x66,0x2d,0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,0x64,0x2d,\n    0x73,0x69,0x6e,0x63,0x65,0x16,0x49,0x66,0x2d,0x4d,0x6f,0x64,0x69,0x66,0x69,0x65,\n    0x64,0x2d,0x53,0x69,0x6e,0x63,0x65,0x1a,0x73,0x6d,0x74,0x70,0x2d,0x72,0x65,0x6d,\n    0x6f,0x74,0x65,0x2d,0x72,0x65,0x63,0x69,0x70,0x69,0x65,0x6e,0x74,0x1a,0x53,0x4d,\n    0x54,0x50,0x2d,0x52,0x65,0x6d,0x6f,0x74,0x65,0x2d,0x52,0x65,0x63,0x69,0x70,0x69,\n    0x65,0x6e,0x74,0x14,0x61,0x63,0x63,0x65,0x70,0x74,0x2d,0x65,0x6e,0x63,0x6f,0x64,\n    0x69,0x6e,0x67,0x14,0x41,0x63,0x63,0x65,0x70,0x74,0x2d,0x45,0x6e,0x63,0x6f,0x64,\n    0x69,0x6e,0x67,0x10,0x72,0x65,0x73,0x65,0x6e,0x74,0x2d,0x66,0x72,0x6f,0x6d,0x10,\n    0x52,0x65,0x73,0x65,0x6e,0x74,0x2d,0x46,0x72,0x6f,0x6d,0x12,0x72,0x65,0x73,0x65,\n    0x6e,0x74,0x2d,0x73,0x65,0x6e,0x64,0x65,0x72,0x12,0x52,0x65,0x73,0x65,0x6e,0x74,\n    0x2d,0x53,0x65,0x6e,0x64,0x65,0x72,0x11,0x6d,0x61,0x78,0x2d,0x66,0x6f,0x72,0x77,\n    0x61,0x72,0x64,0x73,0x11,0x4d,0x61,0x78,0x2d,0x46,0x6f,0x72,0x77,0x61,0x72,0x64,\n    0x73,0x18,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x64,0x65,0x73,0x63,0x72,0x69,\n    0x70,0x74,0x69,0x6f,0x6e,0x18,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x44,0x65,\n    0x73,0x63,0x72,0x69,0x70,0x74,0x69,0x6f,0x6e,0x16,0x72,0x65,0x73,0x65,0x6e,0x74,\n    0x2d,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x2d,0x69,0x64,0x16,0x52,0x65,0x73,0x65,\n    0x6e,0x74,0x2d,0x4d,0x65,0x73,0x73,0x61,0x67,0x65,0x2d,0x49,0x44,0x12,0x72,0x65,\n    0x70,0x6f,0x72,0x74,0x69,0x6e,0x67,0x2d,0x6d,0x74,0x61,0x12,0x52,0x65,0x70,0x6f,\n    0x72,0x74,0x69,0x6e,0x67,0x2d,0x4d,0x54,0x41,0x0c,0x65,0x78,0x70,0x69,0x72,0x65,\n    0x73,0x0c,0x45,0x78,0x70,0x69,0x72,0x65,0x73,0x16,0x74,0x72,0x61,0x6e,0x73,0x66,\n    0x65,0x72,0x2d,0x65,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x16,0x54,0x72,0x61,0x6e,\n    0x73,0x66,0x65,0x72,0x2d,0x45,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x0f,0x72,0x65,\n    0x66,0x65,0x72,0x65,0x6e,0x63,0x65,0x73,0x0f,0x52,0x65,0x66,0x65,0x72,0x65,0x6e,\n    0x63,0x65,0x73,0x0b,0x73,0x65,0x6e,0x64,0x65,0x72,0x0b,0x53,0x65,0x6e,0x64,0x65,\n    0x72,0x15,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x65,0x6e,0x63,0x6f,0x64,0x69,\n    0x6e,0x67,0x15,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x45,0x6e,0x63,0x6f,0x64,\n    0x69,0x6e,0x67,0x0c,0x73,0x75,0x62,0x6a,0x65,0x63,0x74,0x0c,0x53,0x75,0x62,0x6a,\n    0x65,0x63,0x74,0x08,0x61,0x67,0x65,0x08,0x41,0x67,0x65,0x07,0x74,0x65,0x07,0x54,\n    0x45,0x07,0x74,0x6f,0x07,0x54,0x6f,0x12,0x6c,0x61,0x73,0x74,0x2d,0x6d,0x6f,0x64,\n    0x69,0x66,0x69,0x65,0x64,0x12,0x4c,0x61,0x73,0x74,0x2d,0x4d,0x6f,0x64,0x69,0x66,\n    0x69,0x65,0x64,0x13,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x6c,0x65,0x6e,0x67,\n    0x74,0x68,0x13,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,\n    0x68,0x07,0x63,0x63,0x07,0x43,0x63,0x15,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,\n    0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x15,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,\n    0x2d,0x4c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x0f,0x75,0x73,0x65,0x72,0x2d,0x61,\n    0x67,0x65,0x6e,0x74,0x0f,0x55,0x73,0x65,0x72,0x2d,0x41,0x67,0x65,0x6e,0x74,0x09,\n    0x76,0x61,0x72,0x79,0x09,0x56,0x61,0x72,0x79,0x11,0x61,0x72,0x72,0x69,0x76,0x61,\n    0x6c,0x2d,0x64,0x61,0x74,0x65,0x11,0x41,0x72,0x72,0x69,0x76,0x61,0x6c,0x2d,0x44,\n    0x61,0x74,0x65,0x0f,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x0f,0x43,\n    0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x18,0x63,0x6f,0x6e,0x74,0x65,0x6e,\n    0x74,0x2d,0x64,0x69,0x73,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x18,0x43,0x6f,\n    0x6e,0x74,0x65,0x6e,0x74,0x2d,0x44,0x69,0x73,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,\n    0x6e,0x12,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x72,0x61,0x6e,0x67,0x65,0x12,\n    0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x52,0x61,0x6e,0x67,0x65,0x0c,0x77,0x61,\n    0x72,0x6e,0x69,0x6e,0x67,0x0c,0x57,0x61,0x72,0x6e,0x69,0x6e,0x67,0x15,0x77,0x69,\n    0x6c,0x6c,0x2d,0x72,0x65,0x74,0x72,0x79,0x2d,0x75,0x6e,0x74,0x69,0x6c,0x15,0x57,\n    0x69,0x6c,0x6c,0x2d,0x52,0x65,0x74,0x72,0x79,0x2d,0x55,0x6e,0x74,0x69,0x6c,0x13,\n    0x61,0x63,0x63,0x65,0x70,0x74,0x2d,0x63,0x68,0x61,0x72,0x73,0x65,0x74,0x13,0x41,\n    0x63,0x63,0x65,0x70,0x74,0x2d,0x43,0x68,0x61,0x72,0x73,0x65,0x74,0x12,0x69,0x66,\n    0x2d,0x6e,0x6f,0x6e,0x65,0x2d,0x6d,0x61,0x74,0x63,0x68,0x12,0x49,0x66,0x2d,0x4e,\n    0x6f,0x6e,0x65,0x2d,0x4d,0x61,0x74,0x63,0x68,0x0d,0x78,0x2d,0x6d,0x61,0x69,0x6c,\n    0x65,0x72,0x0d,0x58,0x2d,0x4d,0x61,0x69,0x6c,0x65,0x72,0x0c,0x75,0x70,0x67,0x72,\n    0x61,0x64,0x65,0x0c,0x55,0x70,0x67,0x72,0x61,0x64,0x65,0x0c,0x74,0x72,0x61,0x69,\n    0x6c,0x65,0x72,0x0c,0x54,0x72,0x61,0x69,0x6c,0x65,0x72,0x0d,0x69,0x66,0x2d,0x6d,\n    0x61,0x74,0x63,0x68,0x0d,0x49,0x66,0x2d,0x4d,0x61,0x74,0x63,0x68,0x09,0x65,0x74,\n    0x61,0x67,0x09,0x45,0x54,0x61,0x67,0x15,0x77,0x77,0x77,0x2d,0x61,0x75,0x74,0x68,\n    0x65,0x6e,0x74,0x69,0x63,0x61,0x74,0x65,0x15,0x57,0x57,0x57,0x2d,0x41,0x75,0x74,\n    0x68,0x65,0x6e,0x74,0x69,0x63,0x61,0x74,0x65,0x09,0x64,0x61,0x74,0x65,0x09,0x44,\n    0x61,0x74,0x65,0x14,0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x2d,0x63,\n    0x6f,0x64,0x65,0x14,0x44,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x2d,0x43,\n    0x6f,0x64,0x65,0x16,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x64,0x2d,0x66,0x72,0x6f,\n    0x6d,0x2d,0x6d,0x74,0x61,0x16,0x52,0x65,0x63,0x65,0x69,0x76,0x65,0x64,0x2d,0x46,\n    0x72,0x6f,0x6d,0x2d,0x4d,0x54,0x41,0x0b,0x73,0x74,0x61,0x74,0x75,0x73,0x0b,0x53,\n    0x74,0x61,0x74,0x75,0x73,0x14,0x61,0x63,0x63,0x65,0x70,0x74,0x2d,0x6c,0x61,0x6e,\n    0x67,0x75,0x61,0x67,0x65,0x14,0x41,0x63,0x63,0x65,0x70,0x74,0x2d,0x4c,0x61,0x6e,\n    0x67,0x75,0x61,0x67,0x65,0x17,0x6f,0x72,0x69,0x67,0x69,0x6e,0x61,0x6c,0x2d,0x72,\n    0x65,0x63,0x69,0x70,0x69,0x65,0x6e,0x74,0x17,0x4f,0x72,0x69,0x67,0x69,0x6e,0x61,\n    0x6c,0x2d,0x52,0x65,0x63,0x69,0x70,0x69,0x65,0x6e,0x74,0x0d,0x63,0x6f,0x6d,0x6d,\n    0x65,0x6e,0x74,0x73,0x0d,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x73,0x0a,0x72,0x61,\n    0x6e,0x67,0x65,0x0a,0x52,0x61,0x6e,0x67,0x65,0x0b,0x65,0x78,0x70,0x65,0x63,0x74,\n    0x0b,0x45,0x78,0x70,0x65,0x63,0x74,0x12,0x61,0x63,0x63,0x65,0x70,0x74,0x2d,0x72,\n    0x61,0x6e,0x67,0x65,0x73,0x12,0x41,0x63,0x63,0x65,0x70,0x74,0x2d,0x52,0x61,0x6e,\n    0x67,0x65,0x73,0x0f,0x72,0x65,0x73,0x65,0x6e,0x74,0x2d,0x62,0x63,0x63,0x0f,0x52,\n    0x65,0x73,0x65,0x6e,0x74,0x2d,0x42,0x63,0x63,0x0f,0x6d,0x65,0x73,0x73,0x61,0x67,\n    0x65,0x2d,0x69,0x64,0x0f,0x4d,0x65,0x73,0x73,0x61,0x67,0x65,0x2d,0x49,0x44,0x18,\n    0x69,0x66,0x2d,0x75,0x6e,0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,0x64,0x2d,0x73,0x69,\n    0x6e,0x63,0x65,0x18,0x49,0x66,0x2d,0x55,0x6e,0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,\n    0x64,0x2d,0x53,0x69,0x6e,0x63,0x65,0x0f,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,\n    0x69,0x64,0x0f,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x49,0x44,0x14,0x72,0x65,\n    0x73,0x65,0x6e,0x74,0x2d,0x72,0x65,0x70,0x6c,0x79,0x2d,0x74,0x6f,0x14,0x52,0x65,\n    0x73,0x65,0x6e,0x74,0x2d,0x52,0x65,0x70,0x6c,0x79,0x2d,0x54,0x6f,0x10,0x63,0x6f,\n    0x6e,0x74,0x65,0x6e,0x74,0x2d,0x6d,0x64,0x35,0x10,0x43,0x6f,0x6e,0x74,0x65,0x6e,\n    0x74,0x2d,0x4d,0x44,0x35,0x0d,0x72,0x65,0x70,0x6c,0x79,0x2d,0x74,0x6f,0x0d,0x52,\n    0x65,0x70,0x6c,0x79,0x2d,0x54,0x6f,0x0d,0x69,0x66,0x2d,0x72,0x61,0x6e,0x67,0x65,\n    0x0d,0x49,0x66,0x2d,0x52,0x61,0x6e,0x67,0x65,0x10,0x64,0x73,0x6e,0x2d,0x67,0x61,\n    0x74,0x65,0x77,0x61,0x79,0x10,0x44,0x53,0x4e,0x2d,0x47,0x61,0x74,0x65,0x77,0x61,\n    0x79,0x08,0x76,0x69,0x61,0x08,0x56,0x69,0x61,0x0a,0x61,0x6c,0x6c,0x6f,0x77,0x0a,\n    0x41,0x6c,0x6c,0x6f,0x77,0x10,0x72,0x65,0x73,0x65,0x6e,0x74,0x2d,0x64,0x61,0x74,\n    0x65,0x10,0x52,0x65,0x73,0x65,0x6e,0x74,0x2d,0x44,0x61,0x74,0x65,0x14,0x66,0x69,\n    0x6e,0x61,0x6c,0x2d,0x72,0x65,0x63,0x69,0x70,0x69,0x65,0x6e,0x74,0x14,0x46,0x69,\n    0x6e,0x61,0x6c,0x2d,0x52,0x65,0x63,0x69,0x70,0x69,0x65,0x6e,0x74,0x11,0x63,0x6f,\n    0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x11,0x43,0x6f,0x6e,0x74,0x65,\n    0x6e,0x74,0x2d,0x54,0x79,0x70,0x65,0x0b,0x61,0x63,0x74,0x69,0x6f,0x6e,0x0b,0x41,\n    0x63,0x74,0x69,0x6f,0x6e,0x17,0x70,0x72,0x6f,0x78,0x79,0x2d,0x61,0x75,0x74,0x68,\n    0x65,0x6e,0x74,0x69,0x63,0x61,0x74,0x65,0x17,0x50,0x72,0x6f,0x78,0x79,0x2d,0x41,\n    0x75,0x74,0x68,0x65,0x6e,0x74,0x69,0x63,0x61,0x74,0x65,0x10,0x69,0x6e,0x2d,0x72,\n    0x65,0x70,0x6c,0x79,0x2d,0x74,0x6f,0x10,0x49,0x6e,0x2d,0x52,0x65,0x70,0x6c,0x79,\n    0x2d,0x54,0x6f,0x0e,0x72,0x65,0x73,0x65,0x6e,0x74,0x2d,0x63,0x63,0x0e,0x52,0x65,\n    0x73,0x65,0x6e,0x74,0x2d,0x43,0x63,0x09,0x68,0x6f,0x73,0x74,0x09,0x48,0x6f,0x73,\n    0x74,0x18,0x70,0x72,0x6f,0x78,0x79,0x2d,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x7a,\n    0x61,0x74,0x69,0x6f,0x6e,0x18,0x50,0x72,0x6f,0x78,0x79,0x2d,0x41,0x75,0x74,0x68,\n    0x6f,0x72,0x69,0x7a,0x61,0x74,0x69,0x6f,0x6e,0x18,0x61,0x6c,0x74,0x65,0x72,0x6e,\n    0x61,0x74,0x65,0x2d,0x72,0x65,0x63,0x69,0x70,0x69,0x65,0x6e,0x74,0x18,0x41,0x6c,\n    0x74,0x65,0x72,0x6e,0x61,0x74,0x65,0x2d,0x52,0x65,0x63,0x69,0x70,0x69,0x65,0x6e,\n    0x74,0x0e,0x72,0x65,0x73,0x65,0x6e,0x74,0x2d,0x74,0x6f,0x0e,0x52,0x65,0x73,0x65,\n    0x6e,0x74,0x2d,0x54,0x6f,0x11,0x66,0x69,0x6e,0x61,0x6c,0x2d,0x6c,0x6f,0x67,0x2d,\n    0x69,0x64,0x11,0x46,0x69,0x6e,0x61,0x6c,0x2d,0x4c,0x6f,0x67,0x2d,0x49,0x44,0x0b,\n    0x73,0x65,0x72,0x76,0x65,0x72,0x0b,0x53,0x65,0x72,0x76,0x65,0x72,0x0c,0x63,0x61,\n    0x6e,0x6f,0x6e,0x69,0x63,0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x0b,0x73,0x6f,\n    0x63,0x6b,0x65,0x74,0x0c,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x00,\n};\n\n/* socket.http, socket/http.lua */\nstatic const char lua_m_socket_http[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0x9f,0x03,0x00,0x02,0x0b,0x02,0x09,0x00,0x53,0x2a,0x02,\n    0x05,0x00,0x0e,0x00,0x01,0x00,0x54,0x06,0x01,0x80,0x32,0x01,0x00,0x00,0x10,0x07,\n    0x00,0x00,0x37,0x06,0x00,0x00,0x3e,0x06,0x02,0x03,0x10,0x05,0x07,0x00,0x10,0x02,\n    0x06,0x00,0x0f,0x00,0x05,0x00,0x54,0x06,0x03,0x80,0x29,0x06,0x00,0x00,0x10,0x07,\n    0x05,0x00,0x46,0x06,0x03,0x00,0x06,0x02,0x01,0x00,0x54,0x06,0x42,0x80,0x51,0x06,\n    0x41,0x80,0x2b,0x06,0x00,0x00,0x37,0x06,0x02,0x06,0x27,0x07,0x02,0x00,0x2b,0x08,\n    0x01,0x00,0x37,0x08,0x03,0x08,0x10,0x09,0x02,0x00,0x25,0x0a,0x04,0x00,0x3e,0x08,\n    0x03,0x00,0x3d,0x06,0x01,0x03,0x10,0x04,0x07,0x00,0x10,0x03,0x06,0x00,0x0f,0x00,\n    0x03,0x00,0x54,0x06,0x02,0x80,0x0e,0x00,0x04,0x00,0x54,0x06,0x03,0x80,0x29,0x06,\n    0x00,0x00,0x25,0x07,0x05,0x00,0x46,0x06,0x03,0x00,0x2b,0x06,0x01,0x00,0x37,0x06,\n    0x06,0x06,0x10,0x07,0x03,0x00,0x3e,0x06,0x02,0x02,0x10,0x03,0x06,0x00,0x10,0x07,\n    0x00,0x00,0x37,0x06,0x00,0x00,0x3e,0x06,0x02,0x03,0x10,0x05,0x07,0x00,0x10,0x02,\n    0x06,0x00,0x0f,0x00,0x05,0x00,0x54,0x06,0x03,0x80,0x29,0x06,0x00,0x00,0x10,0x07,\n    0x05,0x00,0x46,0x06,0x03,0x00,0x2b,0x06,0x01,0x00,0x37,0x06,0x03,0x06,0x10,0x07,\n    0x02,0x00,0x25,0x08,0x07,0x00,0x3e,0x06,0x03,0x02,0x0f,0x00,0x06,0x00,0x54,0x07,\n    0x0e,0x80,0x51,0x06,0x0d,0x80,0x10,0x06,0x04,0x00,0x10,0x07,0x02,0x00,0x24,0x04,\n    0x07,0x06,0x10,0x07,0x00,0x00,0x37,0x06,0x00,0x00,0x3e,0x06,0x02,0x02,0x10,0x02,\n    0x06,0x00,0x0f,0x00,0x05,0x00,0x54,0x06,0xef,0x7f,0x29,0x06,0x00,0x00,0x10,0x07,\n    0x05,0x00,0x46,0x06,0x03,0x00,0x54,0x06,0xeb,0x7f,0x36,0x06,0x03,0x01,0x0f,0x00,\n    0x06,0x00,0x54,0x07,0x06,0x80,0x36,0x06,0x03,0x01,0x25,0x07,0x08,0x00,0x10,0x08,\n    0x04,0x00,0x24,0x06,0x08,0x06,0x39,0x06,0x03,0x01,0x54,0x06,0xbe,0x7f,0x39,0x04,\n    0x03,0x01,0x54,0x06,0xbc,0x7f,0x48,0x01,0x02,0x00,0x00,0xc0,0x04,0xc0,0x07,0x2c,\n    0x20,0x08,0x5e,0x25,0x73,0x0a,0x6c,0x6f,0x77,0x65,0x72,0x1e,0x6d,0x61,0x6c,0x66,\n    0x6f,0x72,0x6d,0x65,0x64,0x20,0x72,0x65,0x70,0x6f,0x6e,0x73,0x65,0x20,0x68,0x65,\n    0x61,0x64,0x65,0x72,0x73,0x12,0x5e,0x28,0x2e,0x2d,0x29,0x3a,0x25,0x73,0x2a,0x28,\n    0x2e,0x2a,0x29,0x09,0x66,0x69,0x6e,0x64,0x09,0x73,0x6b,0x69,0x70,0x05,0x0c,0x72,\n    0x65,0x63,0x65,0x69,0x76,0x65,0x1f,0x00,0x00,0x02,0x01,0x01,0x00,0x04,0x2b,0x00,\n    0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,0x02,0x00,0x00,0xc0,\n    0x0a,0x67,0x65,0x74,0x66,0x64,0x1f,0x00,0x00,0x02,0x01,0x01,0x00,0x04,0x2b,0x00,\n    0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,0x02,0x00,0x00,0xc0,\n    0x0a,0x64,0x69,0x72,0x74,0x79,0x9b,0x02,0x00,0x00,0x08,0x05,0x06,0x00,0x37,0x2b,\n    0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x3e,0x00,0x02,0x03,0x0f,\n    0x00,0x01,0x00,0x54,0x02,0x03,0x80,0x29,0x02,0x00,0x00,0x10,0x03,0x01,0x00,0x46,\n    0x02,0x03,0x00,0x2b,0x02,0x01,0x00,0x37,0x02,0x01,0x02,0x2b,0x03,0x02,0x00,0x37,\n    0x03,0x02,0x03,0x10,0x04,0x00,0x00,0x25,0x05,0x03,0x00,0x25,0x06,0x04,0x00,0x3e,\n    0x03,0x04,0x02,0x27,0x04,0x10,0x00,0x3e,0x02,0x03,0x02,0x0e,0x00,0x02,0x00,0x54,\n    0x03,0x03,0x80,0x29,0x03,0x00,0x00,0x25,0x04,0x05,0x00,0x46,0x03,0x03,0x00,0x27,\n    0x03,0x00,0x00,0x01,0x03,0x02,0x00,0x54,0x03,0x0f,0x80,0x2b,0x03,0x00,0x00,0x10,\n    0x04,0x03,0x00,0x37,0x03,0x00,0x03,0x10,0x05,0x02,0x00,0x3e,0x03,0x03,0x04,0x0f,\n    0x00,0x03,0x00,0x54,0x06,0x04,0x80,0x2b,0x06,0x00,0x00,0x10,0x07,0x06,0x00,0x37,\n    0x06,0x00,0x06,0x3e,0x06,0x02,0x01,0x10,0x06,0x03,0x00,0x10,0x07,0x04,0x00,0x46,\n    0x06,0x03,0x00,0x54,0x03,0x0c,0x80,0x2b,0x03,0x04,0x00,0x2b,0x04,0x00,0x00,0x2b,\n    0x05,0x03,0x00,0x3e,0x03,0x03,0x03,0x10,0x01,0x04,0x00,0x2c,0x03,0x03,0x00,0x2b,\n    0x03,0x03,0x00,0x0e,0x00,0x03,0x00,0x54,0x03,0x03,0x80,0x29,0x03,0x00,0x00,0x10,\n    0x04,0x01,0x00,0x46,0x03,0x03,0x00,0x47,0x00,0x01,0x00,0x00,0xc0,0x00,0x00,0x01,\n    0x00,0x01,0x80,0x02,0x00,0x17,0x69,0x6e,0x76,0x61,0x6c,0x69,0x64,0x20,0x63,0x68,\n    0x75,0x6e,0x6b,0x20,0x73,0x69,0x7a,0x65,0x05,0x08,0x3b,0x2e,0x2a,0x09,0x67,0x73,\n    0x75,0x62,0x0d,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x0c,0x72,0x65,0x63,0x65,\n    0x69,0x76,0x65,0x66,0x01,0x02,0x06,0x03,0x09,0x00,0x0c,0x2b,0x02,0x00,0x00,0x37,\n    0x02,0x00,0x02,0x33,0x03,0x02,0x00,0x31,0x04,0x01,0x00,0x3a,0x04,0x03,0x03,0x31,\n    0x04,0x04,0x00,0x3a,0x04,0x05,0x03,0x33,0x04,0x07,0x00,0x31,0x05,0x06,0x00,0x3a,\n    0x05,0x08,0x04,0x30,0x00,0x00,0x80,0x40,0x02,0x03,0x00,0x06,0xc0,0x04,0xc0,0x09,\n    0xc0,0x0b,0x5f,0x5f,0x63,0x61,0x6c,0x6c,0x01,0x00,0x00,0x00,0x0a,0x64,0x69,0x72,\n    0x74,0x79,0x00,0x0a,0x67,0x65,0x74,0x66,0x64,0x01,0x00,0x00,0x00,0x11,0x73,0x65,\n    0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x1f,0x00,0x00,0x02,0x01,0x01,\n    0x00,0x04,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,\n    0x02,0x00,0x00,0xc0,0x0a,0x67,0x65,0x74,0x66,0x64,0x1f,0x00,0x00,0x02,0x01,0x01,\n    0x00,0x04,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,\n    0x02,0x00,0x00,0xc0,0x0a,0x64,0x69,0x72,0x74,0x79,0x85,0x01,0x00,0x03,0x09,0x02,\n    0x06,0x00,0x17,0x0e,0x00,0x01,0x00,0x54,0x03,0x05,0x80,0x2b,0x03,0x00,0x00,0x10,\n    0x04,0x03,0x00,0x37,0x03,0x00,0x03,0x25,0x05,0x01,0x00,0x40,0x03,0x03,0x00,0x2b,\n    0x03,0x01,0x00,0x37,0x03,0x02,0x03,0x25,0x04,0x03,0x00,0x2b,0x05,0x01,0x00,0x37,\n    0x05,0x04,0x05,0x10,0x06,0x01,0x00,0x3e,0x05,0x02,0x00,0x3d,0x03,0x01,0x02,0x2b,\n    0x04,0x00,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x00,0x04,0x10,0x06,0x03,0x00,0x10,\n    0x07,0x01,0x00,0x25,0x08,0x05,0x00,0x24,0x06,0x08,0x06,0x40,0x04,0x03,0x00,0x00,\n    0xc0,0x01,0x00,0x07,0x0d,0x0a,0x08,0x6c,0x65,0x6e,0x09,0x25,0x58,0x0d,0x0a,0x0b,\n    0x66,0x6f,0x72,0x6d,0x61,0x74,0x0a,0x30,0x0d,0x0a,0x0d,0x0a,0x09,0x73,0x65,0x6e,\n    0x64,0x64,0x01,0x01,0x05,0x02,0x09,0x00,0x0c,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,\n    0x01,0x33,0x02,0x02,0x00,0x31,0x03,0x01,0x00,0x3a,0x03,0x03,0x02,0x31,0x03,0x04,\n    0x00,0x3a,0x03,0x05,0x02,0x33,0x03,0x07,0x00,0x31,0x04,0x06,0x00,0x3a,0x04,0x08,\n    0x03,0x30,0x00,0x00,0x80,0x40,0x01,0x03,0x00,0x06,0xc0,0x04,0xc0,0x0b,0x5f,0x5f,\n    0x63,0x61,0x6c,0x6c,0x01,0x00,0x00,0x00,0x0a,0x64,0x69,0x72,0x74,0x79,0x00,0x0a,\n    0x67,0x65,0x74,0x66,0x64,0x01,0x00,0x00,0x00,0x11,0x73,0x65,0x74,0x6d,0x65,0x74,\n    0x61,0x74,0x61,0x62,0x6c,0x65,0x23,0x00,0x00,0x02,0x01,0x01,0x00,0x05,0x2b,0x00,\n    0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x3e,0x00,0x02,0x01,0x47,0x00,\n    0x01,0x00,0x04,0xc0,0x0a,0x63,0x6c,0x6f,0x73,0x65,0xe9,0x01,0x01,0x03,0x0a,0x04,\n    0x0b,0x00,0x26,0x2b,0x03,0x00,0x00,0x37,0x03,0x00,0x03,0x0c,0x04,0x02,0x00,0x54,\n    0x04,0x02,0x80,0x2b,0x04,0x00,0x00,0x37,0x04,0x01,0x04,0x3e,0x04,0x01,0x00,0x3d,\n    0x03,0x00,0x02,0x2b,0x04,0x01,0x00,0x37,0x04,0x02,0x04,0x33,0x05,0x03,0x00,0x3a,\n    0x03,0x04,0x05,0x2b,0x06,0x02,0x00,0x3e,0x04,0x03,0x02,0x2b,0x05,0x00,0x00,0x37,\n    0x05,0x05,0x05,0x31,0x06,0x06,0x00,0x3e,0x05,0x02,0x02,0x3a,0x05,0x00,0x04,0x37,\n    0x05,0x00,0x04,0x10,0x07,0x03,0x00,0x37,0x06,0x07,0x03,0x2b,0x08,0x03,0x00,0x37,\n    0x08,0x08,0x08,0x3e,0x06,0x03,0x00,0x3d,0x05,0x00,0x01,0x37,0x05,0x00,0x04,0x10,\n    0x07,0x03,0x00,0x37,0x06,0x09,0x03,0x10,0x08,0x00,0x00,0x0c,0x09,0x01,0x00,0x54,\n    0x09,0x02,0x80,0x2b,0x09,0x03,0x00,0x37,0x09,0x0a,0x09,0x3e,0x06,0x04,0x00,0x3d,\n    0x05,0x00,0x01,0x30,0x00,0x00,0x80,0x48,0x04,0x02,0x00,0x00,0xc0,0x06,0xc0,0x0a,\n    0xc0,0x08,0xc0,0x09,0x50,0x4f,0x52,0x54,0x0c,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,\n    0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,0x54,0x0f,0x73,0x65,0x74,0x74,0x69,0x6d,0x65,\n    0x6f,0x75,0x74,0x00,0x0b,0x6e,0x65,0x77,0x74,0x72,0x79,0x06,0x63,0x01,0x00,0x00,\n    0x11,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x08,0x74,0x63,\n    0x70,0x08,0x74,0x72,0x79,0x6c,0x00,0x03,0x08,0x01,0x06,0x00,0x0f,0x2b,0x03,0x00,\n    0x00,0x37,0x03,0x00,0x03,0x25,0x04,0x01,0x00,0x0c,0x05,0x01,0x00,0x54,0x05,0x01,\n    0x80,0x25,0x05,0x02,0x00,0x10,0x06,0x02,0x00,0x3e,0x03,0x04,0x02,0x37,0x04,0x03,\n    0x00,0x37,0x05,0x04,0x00,0x10,0x06,0x05,0x00,0x37,0x05,0x05,0x05,0x10,0x07,0x03,\n    0x00,0x3e,0x05,0x03,0x00,0x3f,0x04,0x00,0x00,0x04,0xc0,0x09,0x73,0x65,0x6e,0x64,\n    0x06,0x63,0x08,0x74,0x72,0x79,0x08,0x47,0x45,0x54,0x15,0x25,0x73,0x20,0x25,0x73,\n    0x20,0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x0d,0x0a,0x0b,0x66,0x6f,0x72,0x6d,\n    0x61,0x74,0x9a,0x01,0x00,0x02,0x0e,0x02,0x07,0x00,0x1c,0x2b,0x02,0x00,0x00,0x37,\n    0x02,0x00,0x02,0x25,0x03,0x01,0x00,0x2b,0x04,0x01,0x00,0x37,0x04,0x02,0x04,0x10,\n    0x05,0x01,0x00,0x3e,0x04,0x02,0x04,0x54,0x07,0x09,0x80,0x36,0x09,0x07,0x02,0x0e,\n    0x00,0x09,0x00,0x54,0x0a,0x01,0x80,0x10,0x09,0x07,0x00,0x25,0x0a,0x03,0x00,0x10,\n    0x0b,0x08,0x00,0x25,0x0c,0x01,0x00,0x10,0x0d,0x03,0x00,0x24,0x03,0x0d,0x09,0x41,\n    0x07,0x03,0x03,0x4e,0x07,0xf5,0x7f,0x37,0x04,0x04,0x00,0x37,0x05,0x05,0x00,0x10,\n    0x06,0x05,0x00,0x37,0x05,0x06,0x05,0x10,0x07,0x03,0x00,0x3e,0x05,0x03,0x00,0x3d,\n    0x04,0x00,0x01,0x27,0x04,0x01,0x00,0x48,0x04,0x02,0x00,0x05,0xc0,0x06,0xc0,0x09,\n    0x73,0x65,0x6e,0x64,0x06,0x63,0x08,0x74,0x72,0x79,0x07,0x3a,0x20,0x0a,0x70,0x61,\n    0x69,0x72,0x73,0x07,0x0d,0x0a,0x0c,0x63,0x61,0x6e,0x6f,0x6e,0x69,0x63,0xcf,0x01,\n    0x00,0x04,0x0b,0x02,0x0b,0x00,0x1e,0x0e,0x00,0x02,0x00,0x54,0x04,0x05,0x80,0x2b,\n    0x04,0x00,0x00,0x37,0x04,0x00,0x04,0x37,0x04,0x01,0x04,0x3e,0x04,0x01,0x02,0x10,\n    0x02,0x04,0x00,0x0e,0x00,0x03,0x00,0x54,0x04,0x03,0x80,0x2b,0x04,0x00,0x00,0x37,\n    0x04,0x02,0x04,0x37,0x03,0x03,0x04,0x25,0x04,0x04,0x00,0x37,0x05,0x05,0x01,0x0f,\n    0x00,0x05,0x00,0x54,0x06,0x01,0x80,0x25,0x04,0x06,0x00,0x37,0x05,0x07,0x00,0x2b,\n    0x06,0x00,0x00,0x37,0x06,0x02,0x06,0x37,0x06,0x08,0x06,0x10,0x07,0x02,0x00,0x2b,\n    0x08,0x01,0x00,0x37,0x08,0x09,0x08,0x10,0x09,0x04,0x00,0x37,0x0a,0x0a,0x00,0x3e,\n    0x08,0x03,0x02,0x10,0x09,0x03,0x00,0x3e,0x06,0x04,0x00,0x3f,0x05,0x00,0x00,0x02,\n    0xc0,0x00,0xc0,0x06,0x63,0x09,0x73,0x69,0x6e,0x6b,0x08,0x61,0x6c,0x6c,0x08,0x74,\n    0x72,0x79,0x0e,0x6b,0x65,0x65,0x70,0x2d,0x6f,0x70,0x65,0x6e,0x13,0x63,0x6f,0x6e,\n    0x74,0x65,0x6e,0x74,0x2d,0x6c,0x65,0x6e,0x67,0x74,0x68,0x11,0x68,0x74,0x74,0x70,\n    0x2d,0x63,0x68,0x75,0x6e,0x6b,0x65,0x64,0x09,0x73,0x74,0x65,0x70,0x09,0x70,0x75,\n    0x6d,0x70,0x0a,0x65,0x6d,0x70,0x74,0x79,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0xe2,\n    0x01,0x00,0x01,0x07,0x03,0x09,0x00,0x25,0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,\n    0x10,0x03,0x02,0x00,0x37,0x02,0x02,0x02,0x27,0x04,0x05,0x00,0x3e,0x02,0x03,0x00,\n    0x3d,0x01,0x00,0x02,0x06,0x01,0x03,0x00,0x54,0x02,0x03,0x80,0x29,0x02,0x00,0x00,\n    0x10,0x03,0x01,0x00,0x46,0x02,0x03,0x00,0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,\n    0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x25,0x05,0x04,0x00,0x10,0x06,0x01,0x00,\n    0x3e,0x03,0x04,0x00,0x3d,0x02,0x00,0x02,0x10,0x01,0x02,0x00,0x2b,0x02,0x00,0x00,\n    0x37,0x02,0x05,0x02,0x27,0x03,0x02,0x00,0x2b,0x04,0x01,0x00,0x37,0x04,0x06,0x04,\n    0x10,0x05,0x01,0x00,0x25,0x06,0x07,0x00,0x3e,0x04,0x03,0x00,0x3d,0x02,0x01,0x02,\n    0x37,0x03,0x00,0x00,0x2b,0x04,0x02,0x00,0x37,0x04,0x08,0x04,0x10,0x05,0x02,0x00,\n    0x3e,0x04,0x02,0x02,0x10,0x05,0x01,0x00,0x40,0x03,0x03,0x00,0x00,0xc0,0x04,0xc0,\n    0x06,0xc0,0x0d,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x1b,0x48,0x54,0x54,0x50,\n    0x2f,0x25,0x64,0x2a,0x25,0x2e,0x25,0x64,0x2a,0x20,0x28,0x25,0x64,0x25,0x64,0x25,\n    0x64,0x29,0x09,0x66,0x69,0x6e,0x64,0x09,0x73,0x6b,0x69,0x70,0x07,0x2a,0x6c,0x0a,\n    0x48,0x54,0x54,0x50,0x2f,0x0c,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x06,0x63,0x08,\n    0x74,0x72,0x79,0x23,0x00,0x01,0x04,0x01,0x02,0x00,0x05,0x37,0x01,0x00,0x00,0x2b,\n    0x02,0x00,0x00,0x37,0x03,0x01,0x00,0x3e,0x02,0x02,0x00,0x3f,0x01,0x00,0x00,0x09,\n    0xc0,0x06,0x63,0x08,0x74,0x72,0x79,0xb8,0x02,0x00,0x04,0x0d,0x03,0x0f,0x00,0x2d,\n    0x0e,0x00,0x02,0x00,0x54,0x04,0x05,0x80,0x2b,0x04,0x00,0x00,0x37,0x04,0x00,0x04,\n    0x37,0x04,0x01,0x04,0x3e,0x04,0x01,0x02,0x10,0x02,0x04,0x00,0x0e,0x00,0x03,0x00,\n    0x54,0x04,0x03,0x80,0x2b,0x04,0x00,0x00,0x37,0x04,0x02,0x04,0x37,0x03,0x03,0x04,\n    0x2b,0x04,0x01,0x00,0x37,0x04,0x04,0x04,0x37,0x05,0x05,0x01,0x3e,0x04,0x02,0x02,\n    0x37,0x05,0x06,0x01,0x25,0x06,0x07,0x00,0x0f,0x00,0x05,0x00,0x54,0x07,0x04,0x80,\n    0x06,0x05,0x08,0x00,0x54,0x07,0x02,0x80,0x25,0x06,0x09,0x00,0x54,0x07,0x07,0x80,\n    0x2b,0x07,0x01,0x00,0x37,0x07,0x04,0x07,0x37,0x08,0x05,0x01,0x3e,0x07,0x02,0x02,\n    0x0f,0x00,0x07,0x00,0x54,0x08,0x01,0x80,0x25,0x06,0x0a,0x00,0x37,0x07,0x0b,0x00,\n    0x2b,0x08,0x00,0x00,0x37,0x08,0x02,0x08,0x37,0x08,0x0c,0x08,0x2b,0x09,0x02,0x00,\n    0x37,0x09,0x0d,0x09,0x10,0x0a,0x06,0x00,0x37,0x0b,0x0e,0x00,0x10,0x0c,0x04,0x00,\n    0x3e,0x09,0x04,0x02,0x10,0x0a,0x02,0x00,0x10,0x0b,0x03,0x00,0x3e,0x08,0x04,0x00,\n    0x3f,0x07,0x00,0x00,0x02,0xc0,0x06,0xc0,0x00,0xc0,0x06,0x63,0x0b,0x73,0x6f,0x75,\n    0x72,0x63,0x65,0x08,0x61,0x6c,0x6c,0x08,0x74,0x72,0x79,0x0e,0x62,0x79,0x2d,0x6c,\n    0x65,0x6e,0x67,0x74,0x68,0x11,0x68,0x74,0x74,0x70,0x2d,0x63,0x68,0x75,0x6e,0x6b,\n    0x65,0x64,0x0d,0x69,0x64,0x65,0x6e,0x74,0x69,0x74,0x79,0x0c,0x64,0x65,0x66,0x61,\n    0x75,0x6c,0x74,0x16,0x74,0x72,0x61,0x6e,0x73,0x66,0x65,0x72,0x2d,0x65,0x6e,0x63,\n    0x6f,0x64,0x69,0x6e,0x67,0x13,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x6c,0x65,\n    0x6e,0x67,0x74,0x68,0x0d,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,0x72,0x09,0x73,0x74,\n    0x65,0x70,0x09,0x70,0x75,0x6d,0x70,0x09,0x6e,0x75,0x6c,0x6c,0x09,0x73,0x69,0x6e,\n    0x6b,0x89,0x01,0x00,0x04,0x0a,0x02,0x07,0x00,0x15,0x2b,0x04,0x00,0x00,0x37,0x04,\n    0x00,0x04,0x37,0x04,0x01,0x04,0x2b,0x05,0x01,0x00,0x37,0x05,0x00,0x05,0x25,0x06,\n    0x02,0x00,0x37,0x07,0x03,0x00,0x3e,0x05,0x03,0x00,0x3d,0x04,0x00,0x02,0x10,0x05,\n    0x04,0x00,0x10,0x06,0x01,0x00,0x3e,0x05,0x02,0x01,0x37,0x05,0x04,0x00,0x2b,0x06,\n    0x00,0x00,0x37,0x06,0x05,0x06,0x37,0x06,0x06,0x06,0x10,0x07,0x04,0x00,0x10,0x08,\n    0x02,0x00,0x10,0x09,0x03,0x00,0x3e,0x06,0x04,0x00,0x3f,0x05,0x00,0x00,0x02,0xc0,\n    0x00,0xc0,0x08,0x61,0x6c,0x6c,0x09,0x70,0x75,0x6d,0x70,0x08,0x74,0x72,0x79,0x06,\n    0x63,0x11,0x75,0x6e,0x74,0x69,0x6c,0x2d,0x63,0x6c,0x6f,0x73,0x65,0x64,0x0b,0x72,\n    0x65,0x77,0x69,0x6e,0x64,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x1f,0x00,0x01,0x03,\n    0x00,0x02,0x00,0x04,0x37,0x01,0x00,0x00,0x10,0x02,0x01,0x00,0x37,0x01,0x01,0x01,\n    0x40,0x01,0x02,0x00,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x06,0x63,0xbc,0x01,0x00,0x01,\n    0x06,0x03,0x0a,0x00,0x1a,0x10,0x01,0x00,0x00,0x37,0x02,0x00,0x00,0x0e,0x00,0x02,\n    0x00,0x54,0x02,0x12,0x80,0x2b,0x02,0x00,0x00,0x37,0x02,0x01,0x02,0x0e,0x00,0x02,\n    0x00,0x54,0x02,0x0e,0x80,0x33,0x02,0x05,0x00,0x2b,0x03,0x01,0x00,0x37,0x03,0x02,\n    0x03,0x37,0x04,0x03,0x00,0x25,0x05,0x04,0x00,0x3e,0x03,0x03,0x02,0x3a,0x03,0x03,\n    0x02,0x37,0x03,0x06,0x00,0x3a,0x03,0x06,0x02,0x37,0x03,0x07,0x00,0x3a,0x03,0x07,\n    0x02,0x37,0x03,0x08,0x00,0x3a,0x03,0x08,0x02,0x10,0x01,0x02,0x00,0x2b,0x02,0x02,\n    0x00,0x37,0x02,0x09,0x02,0x10,0x03,0x01,0x00,0x40,0x02,0x02,0x00,0x08,0xc0,0x00,\n    0xc0,0x01,0xc0,0x0a,0x62,0x75,0x69,0x6c,0x64,0x0d,0x66,0x72,0x61,0x67,0x6d,0x65,\n    0x6e,0x74,0x0a,0x71,0x75,0x65,0x72,0x79,0x0b,0x70,0x61,0x72,0x61,0x6d,0x73,0x01,\n    0x00,0x00,0x17,0x69,0x6e,0x76,0x61,0x6c,0x69,0x64,0x20,0x70,0x61,0x74,0x68,0x20,\n    0x27,0x6e,0x69,0x6c,0x27,0x09,0x70,0x61,0x74,0x68,0x08,0x74,0x72,0x79,0x0a,0x50,\n    0x52,0x4f,0x58,0x59,0x0a,0x70,0x72,0x6f,0x78,0x79,0x83,0x01,0x00,0x01,0x04,0x02,\n    0x05,0x00,0x17,0x37,0x01,0x00,0x00,0x0e,0x00,0x01,0x00,0x54,0x02,0x02,0x80,0x2b,\n    0x01,0x00,0x00,0x37,0x01,0x01,0x01,0x0f,0x00,0x01,0x00,0x54,0x02,0x0c,0x80,0x2b,\n    0x02,0x01,0x00,0x37,0x02,0x02,0x02,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,0x02,0x10,\n    0x01,0x02,0x00,0x37,0x02,0x03,0x01,0x37,0x03,0x04,0x01,0x0e,0x00,0x03,0x00,0x54,\n    0x04,0x01,0x80,0x27,0x03,0x38,0x0c,0x46,0x02,0x03,0x00,0x54,0x02,0x03,0x80,0x37,\n    0x02,0x03,0x00,0x37,0x03,0x04,0x00,0x46,0x02,0x03,0x00,0x47,0x00,0x01,0x00,0x08,\n    0xc0,0x01,0xc0,0x09,0x70,0x6f,0x72,0x74,0x09,0x68,0x6f,0x73,0x74,0x0a,0x70,0x61,\n    0x72,0x73,0x65,0x0a,0x50,0x52,0x4f,0x58,0x59,0x0a,0x70,0x72,0x6f,0x78,0x79,0xc3,\n    0x02,0x00,0x01,0x0a,0x04,0x0e,0x00,0x2d,0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,\n    0x0f,0x00,0x02,0x00,0x54,0x03,0x04,0x80,0x10,0x02,0x01,0x00,0x25,0x03,0x02,0x00,\n    0x37,0x04,0x01,0x00,0x24,0x01,0x04,0x02,0x33,0x02,0x04,0x00,0x2b,0x03,0x00,0x00,\n    0x37,0x03,0x03,0x03,0x3a,0x03,0x05,0x02,0x3a,0x01,0x00,0x02,0x37,0x03,0x06,0x00,\n    0x0f,0x00,0x03,0x00,0x54,0x04,0x0d,0x80,0x37,0x03,0x07,0x00,0x0f,0x00,0x03,0x00,\n    0x54,0x04,0x0a,0x80,0x25,0x03,0x09,0x00,0x2b,0x04,0x01,0x00,0x37,0x04,0x0a,0x04,\n    0x37,0x05,0x06,0x00,0x25,0x06,0x02,0x00,0x37,0x07,0x07,0x00,0x24,0x05,0x07,0x05,\n    0x3e,0x04,0x02,0x02,0x24,0x03,0x04,0x03,0x3a,0x03,0x08,0x02,0x2b,0x03,0x02,0x00,\n    0x37,0x03,0x0b,0x03,0x37,0x04,0x0c,0x00,0x0e,0x00,0x04,0x00,0x54,0x05,0x01,0x80,\n    0x10,0x04,0x02,0x00,0x3e,0x03,0x02,0x04,0x54,0x06,0x05,0x80,0x2b,0x08,0x03,0x00,\n    0x37,0x08,0x0d,0x08,0x10,0x09,0x06,0x00,0x3e,0x08,0x02,0x02,0x39,0x07,0x08,0x02,\n    0x41,0x06,0x03,0x03,0x4e,0x06,0xf9,0x7f,0x48,0x02,0x02,0x00,0x08,0xc0,0x03,0xc0,\n    0x06,0xc0,0x04,0xc0,0x0a,0x6c,0x6f,0x77,0x65,0x72,0x0c,0x68,0x65,0x61,0x64,0x65,\n    0x72,0x73,0x0a,0x70,0x61,0x69,0x72,0x73,0x08,0x62,0x36,0x34,0x0b,0x42,0x61,0x73,\n    0x69,0x63,0x20,0x12,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,0x7a,0x61,0x74,0x69,0x6f,\n    0x6e,0x0d,0x70,0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0x09,0x75,0x73,0x65,0x72,0x0f,\n    0x75,0x73,0x65,0x72,0x2d,0x61,0x67,0x65,0x6e,0x74,0x01,0x00,0x02,0x07,0x74,0x65,\n    0x0d,0x74,0x72,0x61,0x69,0x6c,0x65,0x72,0x73,0x0f,0x63,0x6f,0x6e,0x6e,0x65,0x63,\n    0x74,0x69,0x6f,0x6e,0x0e,0x63,0x6c,0x6f,0x73,0x65,0x2c,0x20,0x54,0x45,0x0e,0x55,\n    0x53,0x45,0x52,0x41,0x47,0x45,0x4e,0x54,0x06,0x3a,0x09,0x70,0x6f,0x72,0x74,0x09,\n    0x68,0x6f,0x73,0x74,0xca,0x02,0x00,0x01,0x08,0x07,0x0c,0x00,0x3c,0x37,0x01,0x00,\n    0x00,0x0f,0x00,0x01,0x00,0x54,0x02,0x07,0x80,0x2b,0x01,0x00,0x00,0x37,0x01,0x01,\n    0x01,0x37,0x02,0x00,0x00,0x2b,0x03,0x01,0x00,0x3e,0x01,0x03,0x02,0x0e,0x00,0x01,\n    0x00,0x54,0x02,0x01,0x80,0x32,0x01,0x00,0x00,0x2b,0x02,0x02,0x00,0x37,0x02,0x02,\n    0x02,0x10,0x03,0x00,0x00,0x3e,0x02,0x02,0x04,0x54,0x05,0x01,0x80,0x39,0x06,0x05,\n    0x01,0x41,0x05,0x03,0x03,0x4e,0x05,0xfd,0x7f,0x37,0x02,0x03,0x01,0x07,0x02,0x04,\n    0x00,0x54,0x02,0x02,0x80,0x27,0x02,0x50,0x00,0x3a,0x02,0x03,0x01,0x2b,0x02,0x03,\n    0x00,0x37,0x02,0x05,0x02,0x37,0x03,0x06,0x01,0x0f,0x00,0x03,0x00,0x54,0x04,0x06,\n    0x80,0x37,0x03,0x06,0x01,0x07,0x03,0x04,0x00,0x54,0x03,0x02,0x80,0x29,0x03,0x01,\n    0x00,0x54,0x04,0x01,0x80,0x29,0x03,0x02,0x00,0x25,0x04,0x07,0x00,0x2b,0x05,0x02,\n    0x00,0x37,0x05,0x08,0x05,0x37,0x06,0x06,0x01,0x3e,0x05,0x02,0x02,0x25,0x06,0x09,\n    0x00,0x24,0x04,0x06,0x04,0x3e,0x02,0x03,0x01,0x37,0x02,0x0a,0x00,0x0e,0x00,0x02,\n    0x00,0x54,0x03,0x03,0x80,0x2b,0x02,0x04,0x00,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,\n    0x02,0x3a,0x02,0x0a,0x01,0x2b,0x02,0x05,0x00,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,\n    0x03,0x3a,0x03,0x03,0x01,0x3a,0x02,0x06,0x01,0x2b,0x02,0x06,0x00,0x10,0x03,0x01,\n    0x00,0x3e,0x02,0x02,0x02,0x3a,0x02,0x0b,0x01,0x48,0x01,0x02,0x00,0x01,0xc0,0x0e,\n    0xc0,0x06,0xc0,0x00,0xc0,0x0b,0xc0,0x0c,0xc0,0x0d,0xc0,0x0c,0x68,0x65,0x61,0x64,\n    0x65,0x72,0x73,0x08,0x75,0x72,0x69,0x06,0x27,0x0d,0x74,0x6f,0x73,0x74,0x72,0x69,\n    0x6e,0x67,0x13,0x69,0x6e,0x76,0x61,0x6c,0x69,0x64,0x20,0x68,0x6f,0x73,0x74,0x20,\n    0x27,0x09,0x68,0x6f,0x73,0x74,0x08,0x74,0x72,0x79,0x05,0x09,0x70,0x6f,0x72,0x74,\n    0x0a,0x70,0x61,0x69,0x72,0x73,0x0a,0x70,0x61,0x72,0x73,0x65,0x08,0x75,0x72,0x6c,\n    0xef,0x01,0x00,0x03,0x07,0x01,0x09,0x04,0x2a,0x37,0x03,0x00,0x02,0x0f,0x00,0x03,\n    0x00,0x54,0x04,0x26,0x80,0x2b,0x03,0x00,0x00,0x37,0x03,0x01,0x03,0x37,0x04,0x00,\n    0x02,0x25,0x05,0x02,0x00,0x25,0x06,0x03,0x00,0x3e,0x03,0x04,0x02,0x06,0x03,0x03,\n    0x00,0x54,0x03,0x1b,0x80,0x37,0x03,0x04,0x00,0x0a,0x03,0x01,0x00,0x54,0x03,0x18,\n    0x80,0x08,0x01,0x00,0x00,0x54,0x03,0x06,0x80,0x08,0x01,0x01,0x00,0x54,0x03,0x04,\n    0x80,0x08,0x01,0x02,0x00,0x54,0x03,0x02,0x80,0x09,0x01,0x03,0x00,0x54,0x03,0x10,\n    0x80,0x37,0x03,0x05,0x00,0x0f,0x00,0x03,0x00,0x54,0x03,0x06,0x80,0x37,0x03,0x05,\n    0x00,0x06,0x03,0x06,0x00,0x54,0x03,0x03,0x80,0x37,0x03,0x05,0x00,0x07,0x03,0x07,\n    0x00,0x54,0x03,0x07,0x80,0x37,0x03,0x08,0x00,0x0f,0x00,0x03,0x00,0x54,0x03,0x06,\n    0x80,0x37,0x03,0x08,0x00,0x27,0x04,0x05,0x00,0x00,0x03,0x04,0x00,0x54,0x03,0x02,\n    0x80,0x29,0x03,0x01,0x00,0x54,0x04,0x01,0x80,0x29,0x03,0x02,0x00,0x48,0x03,0x02,\n    0x00,0x04,0xc0,0x0f,0x6e,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x73,0x09,0x48,\n    0x45,0x41,0x44,0x08,0x47,0x45,0x54,0x0b,0x6d,0x65,0x74,0x68,0x6f,0x64,0x0d,0x72,\n    0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x05,0x07,0x25,0x73,0x09,0x67,0x73,0x75,0x62,\n    0x0d,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0xda,0x04,0xdc,0x04,0xde,0x04,0xe6,\n    0x04,0x6b,0x00,0x02,0x03,0x00,0x02,0x02,0x15,0x37,0x02,0x00,0x00,0x07,0x02,0x01,\n    0x00,0x54,0x02,0x02,0x80,0x29,0x02,0x00,0x00,0x48,0x02,0x02,0x00,0x08,0x01,0x00,\n    0x00,0x54,0x02,0x02,0x80,0x09,0x01,0x01,0x00,0x54,0x02,0x02,0x80,0x29,0x02,0x00,\n    0x00,0x48,0x02,0x02,0x00,0x27,0x02,0x64,0x00,0x03,0x02,0x01,0x00,0x54,0x02,0x05,\n    0x80,0x27,0x02,0xc8,0x00,0x01,0x01,0x02,0x00,0x54,0x02,0x02,0x80,0x29,0x02,0x00,\n    0x00,0x48,0x02,0x02,0x00,0x27,0x02,0x01,0x00,0x48,0x02,0x02,0x00,0x09,0x48,0x45,\n    0x41,0x44,0x0b,0x6d,0x65,0x74,0x68,0x6f,0x64,0x98,0x03,0xe0,0x04,0xe9,0x01,0x00,\n    0x02,0x0a,0x02,0x0a,0x01,0x26,0x2b,0x02,0x00,0x00,0x33,0x03,0x02,0x00,0x2b,0x04,\n    0x01,0x00,0x37,0x04,0x00,0x04,0x37,0x05,0x01,0x00,0x10,0x06,0x01,0x00,0x3e,0x04,\n    0x03,0x02,0x3a,0x04,0x01,0x03,0x37,0x04,0x03,0x00,0x3a,0x04,0x03,0x03,0x37,0x04,\n    0x04,0x00,0x3a,0x04,0x04,0x03,0x37,0x04,0x05,0x00,0x3a,0x04,0x05,0x03,0x37,0x04,\n    0x06,0x00,0x3a,0x04,0x06,0x03,0x37,0x04,0x07,0x00,0x0e,0x00,0x04,0x00,0x54,0x05,\n    0x01,0x80,0x27,0x04,0x00,0x00,0x14,0x04,0x00,0x04,0x3a,0x04,0x07,0x03,0x37,0x04,\n    0x08,0x00,0x3a,0x04,0x08,0x03,0x3e,0x02,0x02,0x05,0x0e,0x00,0x04,0x00,0x54,0x06,\n    0x01,0x80,0x32,0x04,0x00,0x00,0x37,0x06,0x09,0x04,0x0e,0x00,0x06,0x00,0x54,0x07,\n    0x01,0x80,0x10,0x06,0x01,0x00,0x3a,0x06,0x09,0x04,0x10,0x06,0x02,0x00,0x10,0x07,\n    0x03,0x00,0x10,0x08,0x04,0x00,0x10,0x09,0x05,0x00,0x46,0x06,0x05,0x00,0x12,0x80,\n    0x01,0xc0,0x0d,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x0b,0x63,0x72,0x65,0x61,\n    0x74,0x65,0x0f,0x6e,0x72,0x65,0x64,0x69,0x72,0x65,0x63,0x74,0x73,0x0a,0x70,0x72,\n    0x6f,0x78,0x79,0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x09,0x73,0x69,0x6e,0x6b,\n    0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x01,0x00,0x00,0x08,0x75,0x72,0x6c,0x0d,0x61,\n    0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x02,0xbc,0x04,0x00,0x01,0x0b,0x05,0x13,0x01,\n    0x60,0x2b,0x01,0x00,0x00,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x2b,0x02,0x01,\n    0x00,0x37,0x02,0x00,0x02,0x37,0x03,0x01,0x01,0x37,0x04,0x02,0x01,0x37,0x05,0x03,\n    0x01,0x3e,0x02,0x04,0x02,0x10,0x04,0x02,0x00,0x37,0x03,0x04,0x02,0x37,0x05,0x05,\n    0x01,0x37,0x06,0x06,0x01,0x3e,0x03,0x04,0x01,0x10,0x04,0x02,0x00,0x37,0x03,0x07,\n    0x02,0x37,0x05,0x08,0x01,0x3e,0x03,0x03,0x01,0x37,0x03,0x09,0x01,0x0f,0x00,0x03,\n    0x00,0x54,0x04,0x06,0x80,0x10,0x04,0x02,0x00,0x37,0x03,0x0a,0x02,0x37,0x05,0x08,\n    0x01,0x37,0x06,0x09,0x01,0x37,0x07,0x0b,0x01,0x3e,0x03,0x05,0x01,0x10,0x04,0x02,\n    0x00,0x37,0x03,0x0c,0x02,0x3e,0x03,0x02,0x03,0x0e,0x00,0x03,0x00,0x54,0x05,0x09,\n    0x80,0x10,0x06,0x02,0x00,0x37,0x05,0x0d,0x02,0x10,0x07,0x04,0x00,0x37,0x08,0x0e,\n    0x01,0x37,0x09,0x0b,0x01,0x3e,0x05,0x05,0x01,0x27,0x05,0x01,0x00,0x27,0x06,0xc8,\n    0x00,0x46,0x05,0x03,0x00,0x29,0x05,0x00,0x00,0x09,0x03,0x00,0x00,0x54,0x06,0x0b,\n    0x80,0x51,0x06,0x0a,0x80,0x10,0x07,0x02,0x00,0x37,0x06,0x0f,0x02,0x3e,0x06,0x02,\n    0x02,0x10,0x05,0x06,0x00,0x10,0x07,0x02,0x00,0x37,0x06,0x0c,0x02,0x3e,0x06,0x02,\n    0x03,0x10,0x04,0x07,0x00,0x10,0x03,0x06,0x00,0x54,0x06,0xf3,0x7f,0x10,0x07,0x02,\n    0x00,0x37,0x06,0x0f,0x02,0x3e,0x06,0x02,0x02,0x10,0x05,0x06,0x00,0x2b,0x06,0x02,\n    0x00,0x10,0x07,0x01,0x00,0x10,0x08,0x03,0x00,0x10,0x09,0x05,0x00,0x3e,0x06,0x04,\n    0x02,0x0f,0x00,0x06,0x00,0x54,0x07,0x0a,0x80,0x37,0x06,0x09,0x01,0x0e,0x00,0x06,\n    0x00,0x54,0x06,0x07,0x80,0x10,0x07,0x02,0x00,0x37,0x06,0x10,0x02,0x3e,0x06,0x02,\n    0x01,0x2b,0x06,0x03,0x00,0x10,0x07,0x00,0x00,0x37,0x08,0x11,0x05,0x40,0x06,0x03,\n    0x00,0x2b,0x06,0x04,0x00,0x10,0x07,0x01,0x00,0x10,0x08,0x03,0x00,0x3e,0x06,0x03,\n    0x02,0x0f,0x00,0x06,0x00,0x54,0x07,0x06,0x80,0x10,0x07,0x02,0x00,0x37,0x06,0x12,\n    0x02,0x10,0x08,0x05,0x00,0x37,0x09,0x0e,0x01,0x37,0x0a,0x0b,0x01,0x3e,0x06,0x05,\n    0x01,0x10,0x07,0x02,0x00,0x37,0x06,0x10,0x02,0x3e,0x06,0x02,0x01,0x27,0x06,0x01,\n    0x00,0x10,0x07,0x03,0x00,0x10,0x08,0x05,0x00,0x10,0x09,0x04,0x00,0x46,0x06,0x05,\n    0x00,0x0f,0xc0,0x08,0xc0,0x10,0xc0,0x13,0x80,0x11,0xc0,0x10,0x72,0x65,0x63,0x65,\n    0x69,0x76,0x65,0x62,0x6f,0x64,0x79,0x0d,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,\n    0x0a,0x63,0x6c,0x6f,0x73,0x65,0x13,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x68,0x65,\n    0x61,0x64,0x65,0x72,0x73,0x09,0x73,0x69,0x6e,0x6b,0x12,0x72,0x65,0x63,0x65,0x69,\n    0x76,0x65,0x30,0x39,0x62,0x6f,0x64,0x79,0x16,0x72,0x65,0x63,0x65,0x69,0x76,0x65,\n    0x73,0x74,0x61,0x74,0x75,0x73,0x6c,0x69,0x6e,0x65,0x09,0x73,0x74,0x65,0x70,0x0d,\n    0x73,0x65,0x6e,0x64,0x62,0x6f,0x64,0x79,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x0c,\n    0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x10,0x73,0x65,0x6e,0x64,0x68,0x65,0x61,0x64,\n    0x65,0x72,0x73,0x08,0x75,0x72,0x69,0x0b,0x6d,0x65,0x74,0x68,0x6f,0x64,0x14,0x73,\n    0x65,0x6e,0x64,0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x6c,0x69,0x6e,0x65,0x0b,0x63,\n    0x72,0x65,0x61,0x74,0x65,0x09,0x70,0x6f,0x72,0x74,0x09,0x68,0x6f,0x73,0x74,0x09,\n    0x6f,0x70,0x65,0x6e,0xc8,0x01,0xba,0x02,0x00,0x02,0x0b,0x05,0x0e,0x00,0x29,0x32,\n    0x02,0x00,0x00,0x33,0x03,0x00,0x00,0x3a,0x00,0x01,0x03,0x2b,0x04,0x00,0x00,0x37,\n    0x04,0x02,0x04,0x37,0x04,0x03,0x04,0x10,0x05,0x02,0x00,0x3e,0x04,0x02,0x02,0x3a,\n    0x04,0x02,0x03,0x0f,0x00,0x01,0x00,0x54,0x04,0x0f,0x80,0x2b,0x04,0x00,0x00,0x37,\n    0x04,0x04,0x04,0x37,0x04,0x05,0x04,0x10,0x05,0x01,0x00,0x3e,0x04,0x02,0x02,0x3a,\n    0x04,0x04,0x03,0x33,0x04,0x08,0x00,0x2b,0x05,0x01,0x00,0x37,0x05,0x07,0x05,0x10,\n    0x06,0x01,0x00,0x3e,0x05,0x02,0x02,0x3a,0x05,0x09,0x04,0x3a,0x04,0x06,0x03,0x25,\n    0x04,0x0b,0x00,0x3a,0x04,0x0a,0x03,0x2b,0x04,0x02,0x00,0x37,0x04,0x0c,0x04,0x27,\n    0x05,0x01,0x00,0x2b,0x06,0x03,0x00,0x10,0x07,0x03,0x00,0x3e,0x06,0x02,0x00,0x3d,\n    0x04,0x01,0x04,0x2b,0x07,0x04,0x00,0x37,0x07,0x0d,0x07,0x10,0x08,0x02,0x00,0x3e,\n    0x07,0x02,0x02,0x10,0x08,0x04,0x00,0x10,0x09,0x05,0x00,0x10,0x0a,0x06,0x00,0x46,\n    0x07,0x05,0x00,0x02,0xc0,0x04,0xc0,0x00,0xc0,0x12,0x80,0x07,0xc0,0x0b,0x63,0x6f,\n    0x6e,0x63,0x61,0x74,0x09,0x73,0x6b,0x69,0x70,0x09,0x50,0x4f,0x53,0x54,0x0b,0x6d,\n    0x65,0x74,0x68,0x6f,0x64,0x13,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x6c,0x65,\n    0x6e,0x67,0x74,0x68,0x01,0x00,0x01,0x11,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,\n    0x74,0x79,0x70,0x65,0x26,0x61,0x70,0x70,0x6c,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,\n    0x2f,0x78,0x2d,0x77,0x77,0x77,0x2d,0x66,0x6f,0x72,0x6d,0x2d,0x75,0x72,0x6c,0x65,\n    0x6e,0x63,0x6f,0x64,0x65,0x64,0x08,0x6c,0x65,0x6e,0x0c,0x68,0x65,0x61,0x64,0x65,\n    0x72,0x73,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,\n    0x0a,0x74,0x61,0x62,0x6c,0x65,0x09,0x73,0x69,0x6e,0x6b,0x08,0x75,0x72,0x6c,0x01,\n    0x00,0x00,0x55,0x00,0x02,0x05,0x03,0x02,0x00,0x0f,0x2b,0x02,0x00,0x00,0x37,0x02,\n    0x00,0x02,0x10,0x03,0x00,0x00,0x3e,0x02,0x02,0x02,0x07,0x02,0x01,0x00,0x54,0x02,\n    0x05,0x80,0x2b,0x02,0x01,0x00,0x10,0x03,0x00,0x00,0x10,0x04,0x01,0x00,0x40,0x02,\n    0x03,0x00,0x54,0x02,0x03,0x80,0x2b,0x02,0x02,0x00,0x10,0x03,0x00,0x00,0x40,0x02,\n    0x02,0x00,0x47,0x00,0x01,0x00,0x06,0xc0,0x14,0xc0,0x12,0x80,0x0b,0x73,0x74,0x72,\n    0x69,0x6e,0x67,0x09,0x74,0x79,0x70,0x65,0xa0,0x05,0x03,0x00,0x17,0x00,0x36,0x00,\n    0x56,0x34,0x00,0x00,0x00,0x25,0x01,0x01,0x00,0x3e,0x00,0x02,0x02,0x34,0x01,0x00,\n    0x00,0x25,0x02,0x02,0x00,0x3e,0x01,0x02,0x02,0x34,0x02,0x00,0x00,0x25,0x03,0x03,\n    0x00,0x3e,0x02,0x02,0x02,0x34,0x03,0x00,0x00,0x25,0x04,0x04,0x00,0x3e,0x03,0x02,\n    0x02,0x34,0x04,0x00,0x00,0x25,0x05,0x05,0x00,0x3e,0x04,0x02,0x02,0x34,0x05,0x00,\n    0x00,0x25,0x06,0x06,0x00,0x3e,0x05,0x02,0x02,0x34,0x06,0x07,0x00,0x34,0x07,0x00,\n    0x00,0x25,0x08,0x08,0x00,0x3e,0x07,0x02,0x02,0x32,0x08,0x00,0x00,0x3a,0x08,0x09,\n    0x00,0x37,0x08,0x09,0x00,0x27,0x09,0x3c,0x00,0x3a,0x09,0x0a,0x08,0x27,0x09,0x50,\n    0x00,0x3a,0x09,0x0b,0x08,0x37,0x09,0x0d,0x00,0x3a,0x09,0x0c,0x08,0x31,0x09,0x0e,\n    0x00,0x37,0x0a,0x0f,0x00,0x31,0x0b,0x11,0x00,0x3a,0x0b,0x10,0x0a,0x37,0x0a,0x12,\n    0x00,0x31,0x0b,0x13,0x00,0x3a,0x0b,0x10,0x0a,0x33,0x0a,0x14,0x00,0x32,0x0b,0x00,\n    0x00,0x3a,0x0b,0x15,0x0a,0x31,0x0b,0x17,0x00,0x3a,0x0b,0x16,0x08,0x37,0x0b,0x15,\n    0x0a,0x31,0x0c,0x19,0x00,0x3a,0x0c,0x18,0x0b,0x37,0x0b,0x15,0x0a,0x31,0x0c,0x1b,\n    0x00,0x3a,0x0c,0x1a,0x0b,0x37,0x0b,0x15,0x0a,0x31,0x0c,0x1d,0x00,0x3a,0x0c,0x1c,\n    0x0b,0x37,0x0b,0x15,0x0a,0x31,0x0c,0x1f,0x00,0x3a,0x0c,0x1e,0x0b,0x37,0x0b,0x15,\n    0x0a,0x31,0x0c,0x21,0x00,0x3a,0x0c,0x20,0x0b,0x37,0x0b,0x15,0x0a,0x31,0x0c,0x23,\n    0x00,0x3a,0x0c,0x22,0x0b,0x37,0x0b,0x15,0x0a,0x31,0x0c,0x25,0x00,0x3a,0x0c,0x24,\n    0x0b,0x37,0x0b,0x15,0x0a,0x31,0x0c,0x27,0x00,0x3a,0x0c,0x26,0x0b,0x31,0x0b,0x28,\n    0x00,0x31,0x0c,0x29,0x00,0x31,0x0d,0x2a,0x00,0x33,0x0e,0x2b,0x00,0x37,0x0f,0x0b,\n    0x08,0x3a,0x0f,0x2c,0x0e,0x31,0x0f,0x2d,0x00,0x31,0x10,0x2e,0x00,0x31,0x11,0x2f,\n    0x00,0x2a,0x12,0x13,0x00,0x31,0x13,0x30,0x00,0x31,0x12,0x31,0x00,0x31,0x14,0x32,\n    0x00,0x37,0x15,0x34,0x00,0x31,0x16,0x35,0x00,0x3e,0x15,0x02,0x02,0x3a,0x15,0x33,\n    0x08,0x30,0x00,0x00,0x80,0x48,0x08,0x02,0x00,0x00,0x0c,0x70,0x72,0x6f,0x74,0x65,\n    0x63,0x74,0x0c,0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x00,0x00,0x00,0x00,0x00,0x00,\n    0x09,0x70,0x6f,0x72,0x74,0x01,0x00,0x03,0x0b,0x73,0x63,0x68,0x65,0x6d,0x65,0x09,\n    0x68,0x74,0x74,0x70,0x09,0x70,0x61,0x74,0x68,0x06,0x2f,0x09,0x68,0x6f,0x73,0x74,\n    0x05,0x00,0x00,0x00,0x00,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x00,0x12,0x72,0x65,0x63,\n    0x65,0x69,0x76,0x65,0x30,0x39,0x62,0x6f,0x64,0x79,0x00,0x10,0x72,0x65,0x63,0x65,\n    0x69,0x76,0x65,0x62,0x6f,0x64,0x79,0x00,0x13,0x72,0x65,0x63,0x65,0x69,0x76,0x65,\n    0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x00,0x16,0x72,0x65,0x63,0x65,0x69,0x76,0x65,\n    0x73,0x74,0x61,0x74,0x75,0x73,0x6c,0x69,0x6e,0x65,0x00,0x0d,0x73,0x65,0x6e,0x64,\n    0x62,0x6f,0x64,0x79,0x00,0x10,0x73,0x65,0x6e,0x64,0x68,0x65,0x61,0x64,0x65,0x72,\n    0x73,0x00,0x14,0x73,0x65,0x6e,0x64,0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x6c,0x69,\n    0x6e,0x65,0x00,0x09,0x6f,0x70,0x65,0x6e,0x0c,0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,\n    0x01,0x00,0x00,0x00,0x0a,0x73,0x69,0x6e,0x6b,0x74,0x00,0x11,0x68,0x74,0x74,0x70,\n    0x2d,0x63,0x68,0x75,0x6e,0x6b,0x65,0x64,0x0c,0x73,0x6f,0x75,0x72,0x63,0x65,0x74,\n    0x00,0x0d,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x0e,0x55,0x53,0x45,0x52,0x41,\n    0x47,0x45,0x4e,0x54,0x09,0x50,0x4f,0x52,0x54,0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,\n    0x54,0x09,0x68,0x74,0x74,0x70,0x0a,0x74,0x61,0x62,0x6c,0x65,0x07,0x5f,0x47,0x13,\n    0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x0b,0x73,\n    0x74,0x72,0x69,0x6e,0x67,0x09,0x6d,0x69,0x6d,0x65,0x0a,0x6c,0x74,0x6e,0x31,0x32,\n    0x0f,0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x75,0x72,0x6c,0x0b,0x73,0x6f,0x63,0x6b,\n    0x65,0x74,0x0c,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x00,\n};\n\n/* socket.mbox, socket/mbox.lua */\nstatic const char lua_m_socket_mbox[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0x1d,0x00,0x01,0x02,0x01,0x01,0x00,0x03,0x2b,0x01,0x00,\n    0x00,0x3a,0x00,0x00,0x01,0x47,0x00,0x01,0x00,0x01,0xc0,0x0c,0x68,0x65,0x61,0x64,\n    0x65,0x72,0x73,0x1a,0x00,0x01,0x02,0x01,0x01,0x00,0x03,0x2b,0x01,0x00,0x00,0x3a,\n    0x00,0x00,0x01,0x47,0x00,0x01,0x00,0x01,0xc0,0x09,0x62,0x6f,0x64,0x79,0x1a,0x00,\n    0x01,0x02,0x01,0x01,0x00,0x03,0x2b,0x01,0x00,0x00,0x3a,0x00,0x00,0x01,0x47,0x00,\n    0x01,0x00,0x01,0xc0,0x09,0x62,0x6f,0x64,0x79,0xfa,0x01,0x01,0x01,0x06,0x00,0x0d,\n    0x00,0x2e,0x32,0x01,0x00,0x00,0x34,0x02,0x00,0x00,0x37,0x02,0x01,0x02,0x10,0x03,\n    0x00,0x00,0x25,0x04,0x02,0x00,0x25,0x05,0x03,0x00,0x3e,0x02,0x04,0x02,0x10,0x00,\n    0x02,0x00,0x34,0x02,0x00,0x00,0x37,0x02,0x01,0x02,0x10,0x03,0x00,0x00,0x25,0x04,\n    0x04,0x00,0x31,0x05,0x05,0x00,0x3e,0x02,0x04,0x01,0x34,0x02,0x00,0x00,0x37,0x02,\n    0x01,0x02,0x10,0x03,0x00,0x00,0x25,0x04,0x06,0x00,0x31,0x05,0x07,0x00,0x3e,0x02,\n    0x04,0x01,0x37,0x02,0x08,0x01,0x0e,0x00,0x02,0x00,0x54,0x02,0x06,0x80,0x34,0x02,\n    0x00,0x00,0x37,0x02,0x01,0x02,0x10,0x03,0x00,0x00,0x25,0x04,0x09,0x00,0x31,0x05,\n    0x0a,0x00,0x3e,0x02,0x04,0x01,0x37,0x02,0x0b,0x01,0x0e,0x00,0x02,0x00,0x54,0x02,\n    0x04,0x80,0x37,0x02,0x08,0x01,0x0e,0x00,0x02,0x00,0x54,0x02,0x01,0x80,0x3a,0x00,\n    0x0b,0x01,0x37,0x02,0x0b,0x01,0x0e,0x00,0x02,0x00,0x54,0x03,0x01,0x80,0x25,0x02,\n    0x0c,0x00,0x37,0x03,0x08,0x01,0x0e,0x00,0x03,0x00,0x54,0x04,0x01,0x80,0x25,0x03,\n    0x0c,0x00,0x30,0x00,0x00,0x80,0x46,0x02,0x03,0x00,0x05,0x0c,0x68,0x65,0x61,0x64,\n    0x65,0x72,0x73,0x00,0x0b,0x5e,0x0a,0x28,0x2e,0x2a,0x29,0x09,0x62,0x6f,0x64,0x79,\n    0x00,0x0e,0x5e,0x2e,0x2d,0x0a,0x0a,0x28,0x2e,0x2a,0x29,0x00,0x0c,0x5e,0x28,0x2e,\n    0x2d,0x0a,0x29,0x0a,0x06,0x0a,0x07,0x0d,0x0a,0x09,0x67,0x73,0x75,0x62,0x0b,0x73,\n    0x74,0x72,0x69,0x6e,0x67,0x2e,0x00,0x01,0x04,0x01,0x02,0x00,0x06,0x34,0x01,0x00,\n    0x00,0x37,0x01,0x01,0x01,0x2b,0x02,0x00,0x00,0x10,0x03,0x00,0x00,0x3e,0x01,0x03,\n    0x01,0x47,0x00,0x01,0x00,0x01,0xc0,0x0b,0x69,0x6e,0x73,0x65,0x72,0x74,0x0a,0x74,\n    0x61,0x62,0x6c,0x65,0x8e,0x01,0x01,0x01,0x06,0x00,0x08,0x00,0x19,0x32,0x01,0x00,\n    0x00,0x34,0x02,0x00,0x00,0x37,0x02,0x01,0x02,0x10,0x03,0x00,0x00,0x25,0x04,0x02,\n    0x00,0x25,0x05,0x03,0x00,0x3e,0x02,0x04,0x02,0x10,0x00,0x02,0x00,0x34,0x02,0x00,\n    0x00,0x37,0x02,0x01,0x02,0x10,0x03,0x00,0x00,0x25,0x04,0x04,0x00,0x25,0x05,0x05,\n    0x00,0x3e,0x02,0x04,0x02,0x10,0x00,0x02,0x00,0x34,0x02,0x00,0x00,0x37,0x02,0x01,\n    0x02,0x25,0x03,0x03,0x00,0x10,0x04,0x00,0x00,0x24,0x03,0x04,0x03,0x25,0x04,0x06,\n    0x00,0x31,0x05,0x07,0x00,0x3e,0x02,0x04,0x01,0x30,0x00,0x00,0x80,0x48,0x01,0x02,\n    0x00,0x00,0x0d,0x0a,0x28,0x5b,0x5e,0x0a,0x5d,0x2b,0x29,0x06,0x20,0x0a,0x0a,0x5b,\n    0x20,0x5d,0x2b,0x06,0x0a,0x07,0x0d,0x0a,0x09,0x67,0x73,0x75,0x62,0x0b,0x73,0x74,\n    0x72,0x69,0x6e,0x67,0x8e,0x01,0x00,0x01,0x07,0x00,0x08,0x00,0x16,0x34,0x01,0x00,\n    0x00,0x37,0x01,0x01,0x01,0x10,0x02,0x00,0x00,0x25,0x03,0x02,0x00,0x25,0x04,0x03,\n    0x00,0x3e,0x01,0x04,0x02,0x10,0x00,0x01,0x00,0x34,0x01,0x00,0x00,0x37,0x01,0x01,\n    0x01,0x10,0x02,0x00,0x00,0x25,0x03,0x04,0x00,0x25,0x04,0x05,0x00,0x3e,0x01,0x04,\n    0x02,0x10,0x00,0x01,0x00,0x34,0x01,0x00,0x00,0x37,0x01,0x06,0x01,0x10,0x02,0x00,\n    0x00,0x25,0x03,0x07,0x00,0x3e,0x01,0x03,0x05,0x10,0x05,0x03,0x00,0x10,0x06,0x04,\n    0x00,0x46,0x05,0x03,0x00,0x16,0x28,0x5b,0x5e,0x25,0x73,0x3a,0x5d,0x2d,0x29,0x3a,\n    0x25,0x73,0x2a,0x28,0x2e,0x2a,0x29,0x09,0x66,0x69,0x6e,0x64,0x05,0x07,0x0a,0x2b,\n    0x06,0x20,0x0a,0x0a,0x5b,0x20,0x5d,0x2b,0x09,0x67,0x73,0x75,0x62,0x0b,0x73,0x74,\n    0x72,0x69,0x6e,0x67,0xb4,0x01,0x00,0x01,0x0c,0x01,0x05,0x00,0x20,0x2b,0x01,0x00,\n    0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x32,0x02,0x00,\n    0x00,0x27,0x03,0x01,0x00,0x13,0x04,0x01,0x00,0x27,0x05,0x01,0x00,0x49,0x03,0x16,\n    0x80,0x2b,0x07,0x00,0x00,0x37,0x07,0x01,0x07,0x36,0x08,0x06,0x01,0x3e,0x07,0x02,\n    0x03,0x0f,0x00,0x07,0x00,0x54,0x09,0x0f,0x80,0x34,0x09,0x02,0x00,0x37,0x09,0x03,\n    0x09,0x10,0x0a,0x07,0x00,0x3e,0x09,0x02,0x02,0x10,0x07,0x09,0x00,0x36,0x09,0x07,\n    0x02,0x0f,0x00,0x09,0x00,0x54,0x0a,0x06,0x80,0x36,0x09,0x07,0x02,0x25,0x0a,0x04,\n    0x00,0x10,0x0b,0x08,0x00,0x24,0x09,0x0b,0x09,0x39,0x09,0x07,0x02,0x54,0x09,0x01,\n    0x80,0x39,0x08,0x07,0x02,0x4b,0x03,0xea,0x7f,0x48,0x02,0x02,0x00,0x00,0xc0,0x07,\n    0x2c,0x20,0x0a,0x6c,0x6f,0x77,0x65,0x72,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x11,\n    0x70,0x61,0x72,0x73,0x65,0x5f,0x68,0x65,0x61,0x64,0x65,0x72,0x12,0x73,0x70,0x6c,\n    0x69,0x74,0x5f,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0xc2,0x01,0x00,0x01,0x09,0x00,\n    0x07,0x00,0x22,0x34,0x01,0x00,0x00,0x37,0x01,0x01,0x01,0x10,0x02,0x00,0x00,0x25,\n    0x03,0x02,0x00,0x3e,0x01,0x03,0x05,0x0e,0x00,0x04,0x00,0x54,0x05,0x08,0x80,0x34,\n    0x05,0x00,0x00,0x37,0x05,0x01,0x05,0x10,0x06,0x00,0x00,0x25,0x07,0x03,0x00,0x3e,\n    0x05,0x03,0x04,0x10,0x04,0x07,0x00,0x10,0x02,0x06,0x00,0x10,0x01,0x05,0x00,0x0e,\n    0x00,0x03,0x00,0x54,0x05,0x01,0x80,0x25,0x03,0x04,0x00,0x0e,0x00,0x04,0x00,0x54,\n    0x05,0x01,0x80,0x25,0x04,0x04,0x00,0x07,0x03,0x04,0x00,0x54,0x05,0x01,0x80,0x10,\n    0x03,0x04,0x00,0x34,0x05,0x00,0x00,0x37,0x05,0x05,0x05,0x10,0x06,0x03,0x00,0x25,\n    0x07,0x06,0x00,0x25,0x08,0x04,0x00,0x3e,0x05,0x04,0x02,0x10,0x03,0x05,0x00,0x10,\n    0x05,0x03,0x00,0x10,0x06,0x04,0x00,0x46,0x05,0x03,0x00,0x06,0x22,0x09,0x67,0x73,\n    0x75,0x62,0x05,0x0f,0x25,0x73,0x2a,0x28,0x2e,0x2b,0x29,0x25,0x73,0x2a,0x18,0x5e,\n    0x25,0x73,0x2a,0x28,0x2e,0x2d,0x29,0x25,0x73,0x2a,0x25,0x3c,0x28,0x2e,0x2d,0x29,\n    0x25,0x3e,0x09,0x66,0x69,0x6e,0x64,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0xe8,0x01,\n    0x00,0x01,0x08,0x00,0x0b,0x01,0x28,0x32,0x01,0x00,0x00,0x35,0x01,0x00,0x00,0x34,\n    0x01,0x01,0x00,0x37,0x01,0x02,0x01,0x10,0x02,0x00,0x00,0x25,0x03,0x03,0x00,0x25,\n    0x04,0x04,0x00,0x3e,0x01,0x04,0x02,0x25,0x02,0x05,0x00,0x24,0x00,0x02,0x01,0x27,\n    0x01,0x01,0x00,0x27,0x02,0x01,0x00,0x27,0x03,0x01,0x00,0x51,0x04,0x18,0x80,0x34,\n    0x04,0x01,0x00,0x37,0x04,0x06,0x04,0x10,0x05,0x00,0x00,0x25,0x06,0x07,0x00,0x10,\n    0x07,0x03,0x00,0x3e,0x04,0x04,0x03,0x10,0x01,0x05,0x00,0x10,0x02,0x04,0x00,0x0e,\n    0x00,0x02,0x00,0x54,0x04,0x01,0x80,0x54,0x04,0x0d,0x80,0x34,0x04,0x01,0x00,0x37,\n    0x04,0x08,0x04,0x10,0x05,0x00,0x00,0x10,0x06,0x03,0x00,0x15,0x07,0x00,0x02,0x3e,\n    0x04,0x04,0x02,0x34,0x05,0x09,0x00,0x37,0x05,0x0a,0x05,0x34,0x06,0x00,0x00,0x10,\n    0x07,0x04,0x00,0x3e,0x05,0x03,0x01,0x14,0x03,0x00,0x01,0x54,0x04,0xe7,0x7f,0x34,\n    0x04,0x00,0x00,0x48,0x04,0x02,0x00,0x0b,0x69,0x6e,0x73,0x65,0x72,0x74,0x0a,0x74,\n    0x61,0x62,0x6c,0x65,0x08,0x73,0x75,0x62,0x0f,0x0a,0x0a,0x46,0x72,0x6f,0x6d,0x20,\n    0x2e,0x2d,0x0a,0x09,0x66,0x69,0x6e,0x64,0x0d,0x0a,0x0a,0x46,0x72,0x6f,0x6d,0x20,\n    0x0a,0x06,0x0a,0x07,0x0d,0x0a,0x09,0x67,0x73,0x75,0x62,0x0b,0x73,0x74,0x72,0x69,\n    0x6e,0x67,0x09,0x6d,0x62,0x6f,0x78,0x02,0x5e,0x00,0x01,0x08,0x01,0x02,0x00,0x0f,\n    0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,\n    0x27,0x02,0x01,0x00,0x13,0x03,0x01,0x00,0x27,0x04,0x01,0x00,0x49,0x02,0x06,0x80,\n    0x2b,0x06,0x00,0x00,0x37,0x06,0x01,0x06,0x36,0x07,0x05,0x01,0x3e,0x06,0x02,0x02,\n    0x39,0x06,0x05,0x01,0x4b,0x02,0xfa,0x7f,0x48,0x01,0x02,0x00,0x00,0xc0,0x12,0x70,\n    0x61,0x72,0x73,0x65,0x5f,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x0f,0x73,0x70,0x6c,\n    0x69,0x74,0x5f,0x6d,0x62,0x6f,0x78,0x66,0x00,0x01,0x04,0x01,0x04,0x00,0x0d,0x32,\n    0x01,0x00,0x00,0x2b,0x02,0x00,0x00,0x37,0x02,0x02,0x02,0x10,0x03,0x00,0x00,0x3e,\n    0x02,0x02,0x03,0x3a,0x03,0x01,0x01,0x3a,0x02,0x00,0x01,0x2b,0x02,0x00,0x00,0x37,\n    0x02,0x03,0x02,0x37,0x03,0x00,0x01,0x3e,0x02,0x02,0x02,0x3a,0x02,0x00,0x01,0x48,\n    0x01,0x02,0x00,0x00,0xc0,0x12,0x70,0x61,0x72,0x73,0x65,0x5f,0x68,0x65,0x61,0x64,\n    0x65,0x72,0x73,0x12,0x73,0x70,0x6c,0x69,0x74,0x5f,0x6d,0x65,0x73,0x73,0x61,0x67,\n    0x65,0x09,0x62,0x6f,0x64,0x79,0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0xd8,0x01,\n    0x03,0x00,0x02,0x00,0x12,0x00,0x17,0x32,0x00,0x00,0x00,0x34,0x01,0x00,0x00,0x0f,\n    0x00,0x01,0x00,0x54,0x02,0x01,0x80,0x35,0x00,0x01,0x00,0x31,0x01,0x03,0x00,0x3a,\n    0x01,0x02,0x00,0x31,0x01,0x05,0x00,0x3a,0x01,0x04,0x00,0x31,0x01,0x07,0x00,0x3a,\n    0x01,0x06,0x00,0x31,0x01,0x09,0x00,0x3a,0x01,0x08,0x00,0x31,0x01,0x0b,0x00,0x3a,\n    0x01,0x0a,0x00,0x31,0x01,0x0d,0x00,0x3a,0x01,0x0c,0x00,0x31,0x01,0x0f,0x00,0x3a,\n    0x01,0x0e,0x00,0x31,0x01,0x11,0x00,0x3a,0x01,0x10,0x00,0x30,0x00,0x00,0x80,0x48,\n    0x00,0x02,0x00,0x00,0x12,0x70,0x61,0x72,0x73,0x65,0x5f,0x6d,0x65,0x73,0x73,0x61,\n    0x67,0x65,0x00,0x0a,0x70,0x61,0x72,0x73,0x65,0x00,0x0f,0x73,0x70,0x6c,0x69,0x74,\n    0x5f,0x6d,0x62,0x6f,0x78,0x00,0x0f,0x70,0x61,0x72,0x73,0x65,0x5f,0x66,0x72,0x6f,\n    0x6d,0x00,0x12,0x70,0x61,0x72,0x73,0x65,0x5f,0x68,0x65,0x61,0x64,0x65,0x72,0x73,\n    0x00,0x11,0x70,0x61,0x72,0x73,0x65,0x5f,0x68,0x65,0x61,0x64,0x65,0x72,0x00,0x12,\n    0x73,0x70,0x6c,0x69,0x74,0x5f,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x00,0x12,0x73,\n    0x70,0x6c,0x69,0x74,0x5f,0x6d,0x65,0x73,0x73,0x61,0x67,0x65,0x09,0x6d,0x62,0x6f,\n    0x78,0x0b,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x00,\n};\n\n/* socket.smtp, socket/smtp.lua */\nstatic const char lua_m_socket_smtp[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0xa9,0x01,0x00,0x02,0x08,0x02,0x08,0x00,0x1d,0x37,0x02,\n    0x00,0x00,0x37,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x25,0x05,\n    0x03,0x00,0x3e,0x03,0x03,0x00,0x3d,0x02,0x00,0x01,0x37,0x02,0x00,0x00,0x37,0x03,\n    0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x04,0x03,0x25,0x05,0x05,0x00,0x0c,0x06,\n    0x01,0x00,0x54,0x06,0x02,0x80,0x2b,0x06,0x00,0x00,0x37,0x06,0x06,0x06,0x3e,0x03,\n    0x04,0x00,0x3d,0x02,0x00,0x01,0x2b,0x02,0x01,0x00,0x37,0x02,0x07,0x02,0x27,0x03,\n    0x01,0x00,0x37,0x04,0x00,0x00,0x37,0x05,0x01,0x00,0x10,0x06,0x05,0x00,0x37,0x05,\n    0x02,0x05,0x25,0x07,0x03,0x00,0x3e,0x05,0x03,0x00,0x3d,0x04,0x00,0x00,0x3f,0x02,\n    0x01,0x00,0x0a,0xc0,0x05,0xc0,0x09,0x73,0x6b,0x69,0x70,0x0b,0x44,0x4f,0x4d,0x41,\n    0x49,0x4e,0x09,0x45,0x48,0x4c,0x4f,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x08,\n    0x32,0x2e,0x2e,0x0a,0x63,0x68,0x65,0x63,0x6b,0x07,0x74,0x70,0x08,0x74,0x72,0x79,\n    0x6f,0x00,0x02,0x08,0x00,0x07,0x00,0x11,0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,\n    0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x25,0x05,0x03,0x00,0x25,0x06,0x04,0x00,\n    0x10,0x07,0x01,0x00,0x24,0x06,0x07,0x06,0x3e,0x03,0x04,0x00,0x3d,0x02,0x00,0x01,\n    0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x05,0x03,\n    0x25,0x05,0x06,0x00,0x3e,0x03,0x03,0x00,0x3f,0x02,0x00,0x00,0x08,0x32,0x2e,0x2e,\n    0x0a,0x63,0x68,0x65,0x63,0x6b,0x0a,0x46,0x52,0x4f,0x4d,0x3a,0x09,0x4d,0x41,0x49,\n    0x4c,0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,\n    0x6d,0x00,0x02,0x08,0x00,0x07,0x00,0x11,0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,\n    0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x25,0x05,0x03,0x00,0x25,0x06,0x04,0x00,\n    0x10,0x07,0x01,0x00,0x24,0x06,0x07,0x06,0x3e,0x03,0x04,0x00,0x3d,0x02,0x00,0x01,\n    0x37,0x02,0x00,0x00,0x37,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x05,0x03,\n    0x25,0x05,0x06,0x00,0x3e,0x03,0x03,0x00,0x3f,0x02,0x00,0x00,0x08,0x32,0x2e,0x2e,\n    0x0a,0x63,0x68,0x65,0x63,0x6b,0x08,0x54,0x4f,0x3a,0x09,0x52,0x43,0x50,0x54,0x0c,\n    0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0xcb,0x01,\n    0x00,0x03,0x08,0x00,0x0a,0x00,0x24,0x37,0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,\n    0x05,0x04,0x00,0x37,0x04,0x02,0x04,0x25,0x06,0x03,0x00,0x3e,0x04,0x03,0x00,0x3d,\n    0x03,0x00,0x01,0x37,0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,\n    0x04,0x04,0x04,0x25,0x06,0x05,0x00,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x01,0x37,\n    0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x06,0x04,0x10,\n    0x06,0x01,0x00,0x10,0x07,0x02,0x00,0x3e,0x04,0x04,0x00,0x3d,0x03,0x00,0x01,0x37,\n    0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x07,0x04,0x25,\n    0x06,0x08,0x00,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x01,0x37,0x03,0x00,0x00,0x37,\n    0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x04,0x04,0x25,0x06,0x09,0x00,0x3e,\n    0x04,0x03,0x00,0x3f,0x03,0x00,0x00,0x08,0x32,0x2e,0x2e,0x0a,0x0d,0x0a,0x2e,0x0d,\n    0x0a,0x09,0x73,0x65,0x6e,0x64,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x08,0x33,0x2e,\n    0x2e,0x0a,0x63,0x68,0x65,0x63,0x6b,0x09,0x44,0x41,0x54,0x41,0x0c,0x63,0x6f,0x6d,\n    0x6d,0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x5d,0x00,0x01,0x05,0x00,\n    0x06,0x00,0x0e,0x37,0x01,0x00,0x00,0x37,0x02,0x01,0x00,0x10,0x03,0x02,0x00,0x37,\n    0x02,0x02,0x02,0x25,0x04,0x03,0x00,0x3e,0x02,0x03,0x00,0x3d,0x01,0x00,0x01,0x37,\n    0x01,0x00,0x00,0x37,0x02,0x01,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x04,0x02,0x25,\n    0x04,0x05,0x00,0x3e,0x02,0x03,0x00,0x3f,0x01,0x00,0x00,0x08,0x32,0x2e,0x2e,0x0a,\n    0x63,0x68,0x65,0x63,0x6b,0x09,0x51,0x55,0x49,0x54,0x0c,0x63,0x6f,0x6d,0x6d,0x61,\n    0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x20,0x00,0x01,0x03,0x00,0x02,0x00,\n    0x04,0x37,0x01,0x00,0x00,0x10,0x02,0x01,0x00,0x37,0x01,0x01,0x01,0x40,0x01,0x02,\n    0x00,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x07,0x74,0x70,0x91,0x02,0x00,0x03,0x08,0x01,\n    0x0b,0x00,0x35,0x37,0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,\n    0x04,0x02,0x04,0x25,0x06,0x03,0x00,0x25,0x07,0x04,0x00,0x3e,0x04,0x04,0x00,0x3d,\n    0x03,0x00,0x01,0x37,0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,\n    0x04,0x05,0x04,0x25,0x06,0x06,0x00,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x01,0x37,\n    0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x07,0x04,0x2b,\n    0x06,0x00,0x00,0x37,0x06,0x08,0x06,0x10,0x07,0x01,0x00,0x3e,0x06,0x02,0x02,0x25,\n    0x07,0x09,0x00,0x24,0x06,0x07,0x06,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x01,0x37,\n    0x03,0x00,0x00,0x37,0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x05,0x04,0x25,\n    0x06,0x06,0x00,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x01,0x37,0x03,0x00,0x00,0x37,\n    0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x07,0x04,0x2b,0x06,0x00,0x00,0x37,\n    0x06,0x08,0x06,0x10,0x07,0x02,0x00,0x3e,0x06,0x02,0x02,0x25,0x07,0x09,0x00,0x24,\n    0x06,0x07,0x06,0x3e,0x04,0x03,0x00,0x3d,0x03,0x00,0x01,0x37,0x03,0x00,0x00,0x37,\n    0x04,0x01,0x00,0x10,0x05,0x04,0x00,0x37,0x04,0x05,0x04,0x25,0x06,0x0a,0x00,0x3e,\n    0x04,0x03,0x00,0x3f,0x03,0x00,0x00,0x09,0xc0,0x08,0x32,0x2e,0x2e,0x07,0x0d,0x0a,\n    0x08,0x62,0x36,0x34,0x09,0x73,0x65,0x6e,0x64,0x08,0x33,0x2e,0x2e,0x0a,0x63,0x68,\n    0x65,0x63,0x6b,0x0a,0x4c,0x4f,0x47,0x49,0x4e,0x09,0x41,0x55,0x54,0x48,0x0c,0x63,\n    0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x98,0x01,0x00,\n    0x03,0x09,0x01,0x09,0x00,0x19,0x25,0x03,0x00,0x00,0x2b,0x04,0x00,0x00,0x37,0x04,\n    0x01,0x04,0x25,0x05,0x02,0x00,0x10,0x06,0x01,0x00,0x25,0x07,0x02,0x00,0x10,0x08,\n    0x02,0x00,0x24,0x05,0x08,0x05,0x3e,0x04,0x02,0x02,0x24,0x03,0x04,0x03,0x37,0x04,\n    0x03,0x00,0x37,0x05,0x04,0x00,0x10,0x06,0x05,0x00,0x37,0x05,0x05,0x05,0x25,0x07,\n    0x06,0x00,0x10,0x08,0x03,0x00,0x3e,0x05,0x04,0x00,0x3d,0x04,0x00,0x01,0x37,0x04,\n    0x03,0x00,0x37,0x05,0x04,0x00,0x10,0x06,0x05,0x00,0x37,0x05,0x07,0x05,0x25,0x07,\n    0x08,0x00,0x3e,0x05,0x03,0x00,0x3f,0x04,0x00,0x00,0x09,0xc0,0x08,0x32,0x2e,0x2e,\n    0x0a,0x63,0x68,0x65,0x63,0x6b,0x09,0x41,0x55,0x54,0x48,0x0c,0x63,0x6f,0x6d,0x6d,\n    0x61,0x6e,0x64,0x07,0x74,0x70,0x08,0x74,0x72,0x79,0x06,0x00,0x08,0x62,0x36,0x34,\n    0x0b,0x50,0x4c,0x41,0x49,0x4e,0x20,0xed,0x01,0x00,0x04,0x08,0x01,0x07,0x00,0x25,\n    0x0f,0x00,0x01,0x00,0x54,0x04,0x02,0x80,0x0e,0x00,0x02,0x00,0x54,0x04,0x02,0x80,\n    0x27,0x04,0x01,0x00,0x48,0x04,0x02,0x00,0x2b,0x04,0x00,0x00,0x37,0x04,0x00,0x04,\n    0x10,0x05,0x03,0x00,0x25,0x06,0x01,0x00,0x3e,0x04,0x03,0x02,0x0f,0x00,0x04,0x00,\n    0x54,0x05,0x06,0x80,0x10,0x05,0x00,0x00,0x37,0x04,0x02,0x00,0x10,0x06,0x01,0x00,\n    0x10,0x07,0x02,0x00,0x40,0x04,0x04,0x00,0x54,0x04,0x11,0x80,0x2b,0x04,0x00,0x00,\n    0x37,0x04,0x00,0x04,0x10,0x05,0x03,0x00,0x25,0x06,0x03,0x00,0x3e,0x04,0x03,0x02,\n    0x0f,0x00,0x04,0x00,0x54,0x05,0x06,0x80,0x10,0x05,0x00,0x00,0x37,0x04,0x04,0x00,\n    0x10,0x06,0x01,0x00,0x10,0x07,0x02,0x00,0x40,0x04,0x04,0x00,0x54,0x04,0x04,0x80,\n    0x37,0x04,0x05,0x00,0x29,0x05,0x00,0x00,0x25,0x06,0x06,0x00,0x3e,0x04,0x03,0x01,\n    0x47,0x00,0x01,0x00,0x02,0xc0,0x21,0x61,0x75,0x74,0x68,0x65,0x6e,0x74,0x69,0x63,\n    0x61,0x74,0x69,0x6f,0x6e,0x20,0x6e,0x6f,0x74,0x20,0x73,0x75,0x70,0x70,0x6f,0x72,\n    0x74,0x65,0x64,0x08,0x74,0x72,0x79,0x0a,0x70,0x6c,0x61,0x69,0x6e,0x13,0x41,0x55,\n    0x54,0x48,0x5b,0x5e,0x0a,0x5d,0x2b,0x50,0x4c,0x41,0x49,0x4e,0x0a,0x6c,0x6f,0x67,\n    0x69,0x6e,0x13,0x41,0x55,0x54,0x48,0x5b,0x5e,0x0a,0x5d,0x2b,0x4c,0x4f,0x47,0x49,\n    0x4e,0x09,0x66,0x69,0x6e,0x64,0xe7,0x01,0x00,0x02,0x0a,0x03,0x0b,0x00,0x27,0x10,\n    0x03,0x00,0x00,0x37,0x02,0x00,0x00,0x37,0x04,0x01,0x01,0x3e,0x02,0x03,0x01,0x2b,\n    0x02,0x00,0x00,0x37,0x02,0x02,0x02,0x37,0x03,0x03,0x01,0x3e,0x02,0x02,0x02,0x07,\n    0x02,0x04,0x00,0x54,0x02,0x0c,0x80,0x2b,0x02,0x00,0x00,0x37,0x02,0x05,0x02,0x37,\n    0x03,0x03,0x01,0x3e,0x02,0x02,0x04,0x54,0x05,0x04,0x80,0x10,0x08,0x00,0x00,0x37,\n    0x07,0x03,0x00,0x10,0x09,0x06,0x00,0x3e,0x07,0x03,0x01,0x41,0x05,0x03,0x03,0x4e,\n    0x05,0xfa,0x7f,0x54,0x02,0x04,0x80,0x10,0x03,0x00,0x00,0x37,0x02,0x03,0x00,0x37,\n    0x04,0x03,0x01,0x3e,0x02,0x03,0x01,0x10,0x03,0x00,0x00,0x37,0x02,0x06,0x00,0x2b,\n    0x04,0x01,0x00,0x37,0x04,0x07,0x04,0x37,0x04,0x08,0x04,0x37,0x05,0x07,0x01,0x2b,\n    0x06,0x02,0x00,0x37,0x06,0x09,0x06,0x3e,0x06,0x01,0x00,0x3d,0x04,0x01,0x02,0x37,\n    0x05,0x0a,0x01,0x3e,0x02,0x04,0x01,0x47,0x00,0x01,0x00,0x00,0xc0,0x07,0xc0,0x09,\n    0xc0,0x09,0x73,0x74,0x65,0x70,0x0a,0x73,0x74,0x75,0x66,0x66,0x0a,0x63,0x68,0x61,\n    0x69,0x6e,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x09,0x64,0x61,0x74,0x61,0x0b,0x69,\n    0x70,0x61,0x69,0x72,0x73,0x0a,0x74,0x61,0x62,0x6c,0x65,0x09,0x72,0x63,0x70,0x74,\n    0x09,0x74,0x79,0x70,0x65,0x09,0x66,0x72,0x6f,0x6d,0x09,0x6d,0x61,0x69,0x6c,0x23,\n    0x00,0x00,0x02,0x01,0x01,0x00,0x05,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,\n    0x00,0x00,0x00,0x3e,0x00,0x02,0x01,0x47,0x00,0x01,0x00,0x04,0xc0,0x0a,0x63,0x6c,\n    0x6f,0x73,0x65,0xc4,0x01,0x01,0x03,0x09,0x05,0x0a,0x00,0x1e,0x2b,0x03,0x00,0x00,\n    0x37,0x03,0x00,0x03,0x2b,0x04,0x01,0x00,0x37,0x04,0x01,0x04,0x0c,0x05,0x00,0x00,\n    0x54,0x05,0x02,0x80,0x2b,0x05,0x02,0x00,0x37,0x05,0x02,0x05,0x0c,0x06,0x01,0x00,\n    0x54,0x06,0x02,0x80,0x2b,0x06,0x02,0x00,0x37,0x06,0x03,0x06,0x2b,0x07,0x02,0x00,\n    0x37,0x07,0x04,0x07,0x10,0x08,0x02,0x00,0x3e,0x04,0x05,0x00,0x3d,0x03,0x00,0x02,\n    0x2b,0x04,0x03,0x00,0x37,0x04,0x05,0x04,0x33,0x05,0x06,0x00,0x3a,0x03,0x07,0x05,\n    0x2b,0x06,0x04,0x00,0x3e,0x04,0x03,0x02,0x2b,0x05,0x00,0x00,0x37,0x05,0x08,0x05,\n    0x31,0x06,0x09,0x00,0x3e,0x05,0x02,0x02,0x3a,0x05,0x00,0x04,0x30,0x00,0x00,0x80,\n    0x48,0x04,0x02,0x00,0x05,0xc0,0x06,0xc0,0x0a,0xc0,0x00,0xc0,0x0b,0xc0,0x00,0x0b,\n    0x6e,0x65,0x77,0x74,0x72,0x79,0x07,0x74,0x70,0x01,0x00,0x00,0x11,0x73,0x65,0x74,\n    0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,\n    0x54,0x09,0x50,0x4f,0x52,0x54,0x0b,0x53,0x45,0x52,0x56,0x45,0x52,0x0c,0x63,0x6f,\n    0x6e,0x6e,0x65,0x63,0x74,0x08,0x74,0x72,0x79,0x57,0x00,0x01,0x09,0x02,0x02,0x00,\n    0x10,0x32,0x01,0x00,0x00,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,0x0c,0x03,0x00,\n    0x00,0x54,0x03,0x01,0x80,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,0x04,0x54,0x05,0x05,\n    0x80,0x2b,0x07,0x01,0x00,0x37,0x07,0x01,0x07,0x10,0x08,0x05,0x00,0x3e,0x07,0x02,\n    0x02,0x39,0x06,0x07,0x01,0x41,0x05,0x03,0x03,0x4e,0x05,0xf9,0x7f,0x48,0x01,0x02,\n    0x00,0x00,0xc0,0x02,0xc0,0x0a,0x6c,0x6f,0x77,0x65,0x72,0x0a,0x70,0x61,0x69,0x72,\n    0x73,0x84,0x01,0x00,0x00,0x06,0x04,0x05,0x02,0x11,0x2b,0x00,0x00,0x00,0x14,0x00,\n    0x00,0x00,0x2c,0x00,0x00,0x00,0x2b,0x00,0x01,0x00,0x37,0x00,0x00,0x00,0x25,0x01,\n    0x01,0x00,0x2b,0x02,0x02,0x00,0x37,0x02,0x02,0x02,0x25,0x03,0x03,0x00,0x3e,0x02,\n    0x02,0x02,0x2b,0x03,0x03,0x00,0x37,0x03,0x04,0x03,0x27,0x04,0x00,0x00,0x28,0x05,\n    0x01,0x00,0x3e,0x03,0x03,0x02,0x2b,0x04,0x00,0x00,0x40,0x00,0x05,0x00,0x0d,0x80,\n    0x02,0xc0,0x04,0xc0,0x03,0xc0,0x0b,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x11,0x25,0x64,\n    0x25,0x6d,0x25,0x59,0x25,0x48,0x25,0x4d,0x25,0x53,0x09,0x64,0x61,0x74,0x65,0x11,\n    0x25,0x73,0x25,0x30,0x35,0x64,0x3d,0x3d,0x25,0x30,0x35,0x75,0x0b,0x66,0x6f,0x72,\n    0x6d,0x61,0x74,0x02,0xbe,0x9a,0x0c,0x87,0x01,0x00,0x01,0x0d,0x03,0x05,0x00,0x18,\n    0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x25,0x02,0x01,0x00,0x2b,0x03,0x01,0x00,\n    0x37,0x03,0x02,0x03,0x10,0x04,0x00,0x00,0x3e,0x03,0x02,0x04,0x54,0x06,0x09,0x80,\n    0x36,0x08,0x06,0x01,0x0e,0x00,0x08,0x00,0x54,0x09,0x01,0x80,0x10,0x08,0x06,0x00,\n    0x25,0x09,0x03,0x00,0x10,0x0a,0x07,0x00,0x25,0x0b,0x01,0x00,0x10,0x0c,0x02,0x00,\n    0x24,0x02,0x0c,0x08,0x41,0x06,0x03,0x03,0x4e,0x06,0xf5,0x7f,0x2b,0x03,0x02,0x00,\n    0x37,0x03,0x04,0x03,0x10,0x04,0x02,0x00,0x3e,0x03,0x02,0x01,0x47,0x00,0x01,0x00,\n    0x08,0xc0,0x00,0xc0,0x01,0xc0,0x0a,0x79,0x69,0x65,0x6c,0x64,0x07,0x3a,0x20,0x0a,\n    0x70,0x61,0x69,0x72,0x73,0x07,0x0d,0x0a,0x0c,0x63,0x61,0x6e,0x6f,0x6e,0x69,0x63,\n    0x9e,0x03,0x00,0x01,0x0c,0x06,0x0d,0x00,0x49,0x2b,0x01,0x00,0x00,0x3e,0x01,0x01,\n    0x02,0x2b,0x02,0x01,0x00,0x37,0x03,0x00,0x00,0x0e,0x00,0x03,0x00,0x54,0x04,0x01,\n    0x80,0x32,0x03,0x00,0x00,0x3e,0x02,0x02,0x02,0x37,0x03,0x01,0x02,0x0e,0x00,0x03,\n    0x00,0x54,0x04,0x01,0x80,0x25,0x03,0x02,0x00,0x3a,0x03,0x01,0x02,0x37,0x03,0x01,\n    0x02,0x25,0x04,0x03,0x00,0x10,0x05,0x01,0x00,0x25,0x06,0x04,0x00,0x24,0x03,0x06,\n    0x03,0x3a,0x03,0x01,0x02,0x2b,0x03,0x02,0x00,0x10,0x04,0x02,0x00,0x3e,0x03,0x02,\n    0x01,0x37,0x03,0x05,0x00,0x37,0x03,0x06,0x03,0x0f,0x00,0x03,0x00,0x54,0x04,0x09,\n    0x80,0x2b,0x03,0x03,0x00,0x37,0x03,0x07,0x03,0x37,0x04,0x05,0x00,0x37,0x04,0x06,\n    0x04,0x3e,0x03,0x02,0x01,0x2b,0x03,0x03,0x00,0x37,0x03,0x07,0x03,0x25,0x04,0x08,\n    0x00,0x3e,0x03,0x02,0x01,0x2b,0x03,0x04,0x00,0x37,0x03,0x09,0x03,0x37,0x04,0x05,\n    0x00,0x3e,0x03,0x02,0x04,0x54,0x06,0x0a,0x80,0x2b,0x08,0x03,0x00,0x37,0x08,0x07,\n    0x08,0x25,0x09,0x0a,0x00,0x10,0x0a,0x01,0x00,0x25,0x0b,0x08,0x00,0x24,0x09,0x0b,\n    0x09,0x3e,0x08,0x02,0x01,0x2b,0x08,0x05,0x00,0x10,0x09,0x07,0x00,0x3e,0x08,0x02,\n    0x01,0x41,0x06,0x03,0x03,0x4e,0x06,0xf4,0x7f,0x2b,0x03,0x03,0x00,0x37,0x03,0x07,\n    0x03,0x25,0x04,0x0a,0x00,0x10,0x05,0x01,0x00,0x25,0x06,0x0b,0x00,0x24,0x04,0x06,\n    0x04,0x3e,0x03,0x02,0x01,0x37,0x03,0x05,0x00,0x37,0x03,0x0c,0x03,0x0f,0x00,0x03,\n    0x00,0x54,0x04,0x09,0x80,0x2b,0x03,0x03,0x00,0x37,0x03,0x07,0x03,0x37,0x04,0x05,\n    0x00,0x37,0x04,0x0c,0x04,0x3e,0x03,0x02,0x01,0x2b,0x03,0x03,0x00,0x37,0x03,0x07,\n    0x03,0x25,0x04,0x08,0x00,0x3e,0x03,0x02,0x01,0x47,0x00,0x01,0x00,0x0e,0xc0,0x0c,\n    0xc0,0x10,0xc0,0x01,0xc0,0x00,0xc0,0x0f,0x80,0x0d,0x65,0x70,0x69,0x6c,0x6f,0x67,\n    0x75,0x65,0x0b,0x2d,0x2d,0x0d,0x0a,0x0d,0x0a,0x09,0x0d,0x0a,0x2d,0x2d,0x0b,0x69,\n    0x70,0x61,0x69,0x72,0x73,0x07,0x0d,0x0a,0x0a,0x79,0x69,0x65,0x6c,0x64,0x0d,0x70,\n    0x72,0x65,0x61,0x6d,0x62,0x6c,0x65,0x09,0x62,0x6f,0x64,0x79,0x06,0x22,0x11,0x3b,\n    0x20,0x62,0x6f,0x75,0x6e,0x64,0x61,0x72,0x79,0x3d,0x22,0x14,0x6d,0x75,0x6c,0x74,\n    0x69,0x70,0x61,0x72,0x74,0x2f,0x6d,0x69,0x78,0x65,0x64,0x11,0x63,0x6f,0x6e,0x74,\n    0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,\n    0xda,0x01,0x00,0x01,0x07,0x03,0x05,0x00,0x23,0x2b,0x01,0x00,0x00,0x37,0x02,0x00,\n    0x00,0x0e,0x00,0x02,0x00,0x54,0x03,0x01,0x80,0x32,0x02,0x00,0x00,0x3e,0x01,0x02,\n    0x02,0x37,0x02,0x01,0x01,0x0e,0x00,0x02,0x00,0x54,0x03,0x01,0x80,0x25,0x02,0x02,\n    0x00,0x3a,0x02,0x01,0x01,0x2b,0x02,0x01,0x00,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,\n    0x01,0x51,0x02,0x13,0x80,0x37,0x02,0x03,0x00,0x3e,0x02,0x01,0x03,0x0f,0x00,0x03,\n    0x00,0x54,0x04,0x06,0x80,0x2b,0x04,0x02,0x00,0x37,0x04,0x04,0x04,0x29,0x05,0x00,\n    0x00,0x10,0x06,0x03,0x00,0x3e,0x04,0x03,0x01,0x54,0x04,0xf5,0x7f,0x0f,0x00,0x02,\n    0x00,0x54,0x04,0x07,0x80,0x2b,0x04,0x02,0x00,0x37,0x04,0x04,0x04,0x10,0x05,0x02,\n    0x00,0x3e,0x04,0x02,0x01,0x54,0x04,0xee,0x7f,0x54,0x02,0x01,0x80,0x54,0x02,0xec,\n    0x7f,0x47,0x00,0x01,0x00,0x0c,0xc0,0x10,0xc0,0x01,0xc0,0x0a,0x79,0x69,0x65,0x6c,\n    0x64,0x09,0x62,0x6f,0x64,0x79,0x25,0x74,0x65,0x78,0x74,0x2f,0x70,0x6c,0x61,0x69,\n    0x6e,0x3b,0x20,0x63,0x68,0x61,0x72,0x73,0x65,0x74,0x3d,0x22,0x69,0x73,0x6f,0x2d,\n    0x38,0x38,0x35,0x39,0x2d,0x31,0x22,0x11,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,\n    0x74,0x79,0x70,0x65,0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x9a,0x01,0x00,0x01,\n    0x04,0x03,0x05,0x00,0x13,0x2b,0x01,0x00,0x00,0x37,0x02,0x00,0x00,0x0e,0x00,0x02,\n    0x00,0x54,0x03,0x01,0x80,0x32,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x37,0x02,0x01,\n    0x01,0x0e,0x00,0x02,0x00,0x54,0x03,0x01,0x80,0x25,0x02,0x02,0x00,0x3a,0x02,0x01,\n    0x01,0x2b,0x02,0x01,0x00,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,0x01,0x2b,0x02,0x02,\n    0x00,0x37,0x02,0x03,0x02,0x37,0x03,0x04,0x00,0x3e,0x02,0x02,0x01,0x47,0x00,0x01,\n    0x00,0x0c,0xc0,0x10,0xc0,0x01,0xc0,0x09,0x62,0x6f,0x64,0x79,0x0a,0x79,0x69,0x65,\n    0x6c,0x64,0x25,0x74,0x65,0x78,0x74,0x2f,0x70,0x6c,0x61,0x69,0x6e,0x3b,0x20,0x63,\n    0x68,0x61,0x72,0x73,0x65,0x74,0x3d,0x22,0x69,0x73,0x6f,0x2d,0x38,0x38,0x35,0x39,\n    0x2d,0x31,0x22,0x11,0x63,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,\n    0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x88,0x01,0x00,0x01,0x03,0x04,0x04,0x00,\n    0x18,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x37,0x02,0x01,0x00,0x3e,0x01,0x02,\n    0x02,0x07,0x01,0x02,0x00,0x54,0x01,0x04,0x80,0x2b,0x01,0x01,0x00,0x10,0x02,0x00,\n    0x00,0x3e,0x01,0x02,0x01,0x54,0x01,0x0d,0x80,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,\n    0x01,0x37,0x02,0x01,0x00,0x3e,0x01,0x02,0x02,0x07,0x01,0x03,0x00,0x54,0x01,0x04,\n    0x80,0x2b,0x01,0x02,0x00,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x01,0x54,0x01,0x03,\n    0x80,0x2b,0x01,0x03,0x00,0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x01,0x47,0x00,0x01,\n    0x00,0x00,0xc0,0x11,0xc0,0x12,0xc0,0x13,0xc0,0x0d,0x66,0x75,0x6e,0x63,0x74,0x69,\n    0x6f,0x6e,0x0a,0x74,0x61,0x62,0x6c,0x65,0x09,0x62,0x6f,0x64,0x79,0x09,0x74,0x79,\n    0x70,0x65,0xc9,0x01,0x00,0x01,0x04,0x04,0x09,0x00,0x1a,0x2b,0x01,0x00,0x00,0x37,\n    0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x37,0x02,0x01,0x01,0x0e,0x00,0x02,0x00,0x54,\n    0x03,0x0a,0x80,0x2b,0x02,0x01,0x00,0x37,0x02,0x01,0x02,0x25,0x03,0x02,0x00,0x3e,\n    0x02,0x02,0x02,0x37,0x03,0x03,0x00,0x0e,0x00,0x03,0x00,0x54,0x04,0x02,0x80,0x2b,\n    0x03,0x02,0x00,0x37,0x03,0x04,0x03,0x24,0x02,0x03,0x02,0x3a,0x02,0x01,0x01,0x37,\n    0x02,0x05,0x01,0x0e,0x00,0x02,0x00,0x54,0x03,0x02,0x80,0x2b,0x02,0x03,0x00,0x37,\n    0x02,0x06,0x02,0x3a,0x02,0x05,0x01,0x25,0x02,0x08,0x00,0x3a,0x02,0x07,0x01,0x48,\n    0x01,0x02,0x00,0x0c,0xc0,0x04,0xc0,0x0a,0xc0,0x05,0xc0,0x08,0x31,0x2e,0x30,0x11,\n    0x6d,0x69,0x6d,0x65,0x2d,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x0d,0x5f,0x56,0x45,\n    0x52,0x53,0x49,0x4f,0x4e,0x0d,0x78,0x2d,0x6d,0x61,0x69,0x6c,0x65,0x72,0x09,0x5a,\n    0x4f,0x4e,0x45,0x09,0x7a,0x6f,0x6e,0x65,0x1c,0x21,0x25,0x61,0x2c,0x20,0x25,0x64,\n    0x20,0x25,0x62,0x20,0x25,0x59,0x20,0x25,0x48,0x3a,0x25,0x4d,0x3a,0x25,0x53,0x20,\n    0x09,0x64,0x61,0x74,0x65,0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0x1b,0x00,0x00,\n    0x02,0x02,0x00,0x00,0x04,0x2b,0x00,0x00,0x00,0x2b,0x01,0x01,0x00,0x3e,0x00,0x02,\n    0x01,0x47,0x00,0x01,0x00,0x02,0x00,0x00,0xc0,0x4a,0x00,0x00,0x05,0x02,0x01,0x00,\n    0x0e,0x2b,0x00,0x00,0x00,0x37,0x00,0x00,0x00,0x2b,0x01,0x01,0x00,0x3e,0x00,0x02,\n    0x04,0x0f,0x00,0x00,0x00,0x54,0x03,0x04,0x80,0x10,0x03,0x01,0x00,0x10,0x04,0x02,\n    0x00,0x46,0x03,0x03,0x00,0x54,0x03,0x03,0x80,0x29,0x03,0x00,0x00,0x10,0x04,0x01,\n    0x00,0x46,0x03,0x03,0x00,0x47,0x00,0x01,0x00,0x01,0x00,0x01,0xc0,0x0b,0x72,0x65,\n    0x73,0x75,0x6d,0x65,0x4a,0x01,0x01,0x03,0x03,0x04,0x00,0x0b,0x2b,0x01,0x00,0x00,\n    0x10,0x02,0x00,0x00,0x3e,0x01,0x02,0x02,0x3a,0x01,0x00,0x00,0x2b,0x01,0x01,0x00,\n    0x37,0x01,0x01,0x01,0x31,0x02,0x02,0x00,0x3e,0x01,0x02,0x02,0x31,0x02,0x03,0x00,\n    0x30,0x00,0x00,0x80,0x48,0x02,0x02,0x00,0x14,0xc0,0x01,0xc0,0x0f,0x80,0x00,0x00,\n    0x0b,0x63,0x72,0x65,0x61,0x74,0x65,0x0c,0x68,0x65,0x61,0x64,0x65,0x72,0x73,0xb9,\n    0x01,0x00,0x01,0x08,0x01,0x0c,0x00,0x1a,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,\n    0x37,0x02,0x01,0x00,0x37,0x03,0x02,0x00,0x37,0x04,0x03,0x00,0x3e,0x01,0x04,0x02,\n    0x10,0x03,0x01,0x00,0x37,0x02,0x04,0x01,0x37,0x04,0x05,0x00,0x3e,0x02,0x03,0x02,\n    0x10,0x04,0x01,0x00,0x37,0x03,0x06,0x01,0x37,0x05,0x07,0x00,0x37,0x06,0x08,0x00,\n    0x10,0x07,0x02,0x00,0x3e,0x03,0x05,0x01,0x10,0x04,0x01,0x00,0x37,0x03,0x09,0x01,\n    0x10,0x05,0x00,0x00,0x3e,0x03,0x03,0x01,0x10,0x04,0x01,0x00,0x37,0x03,0x0a,0x01,\n    0x3e,0x03,0x02,0x01,0x10,0x04,0x01,0x00,0x37,0x03,0x0b,0x01,0x40,0x03,0x02,0x00,\n    0x0a,0xc0,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x09,0x71,0x75,0x69,0x74,0x09,0x73,0x65,\n    0x6e,0x64,0x0d,0x70,0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0x09,0x75,0x73,0x65,0x72,\n    0x09,0x61,0x75,0x74,0x68,0x0b,0x64,0x6f,0x6d,0x61,0x69,0x6e,0x0a,0x67,0x72,0x65,\n    0x65,0x74,0x0b,0x63,0x72,0x65,0x61,0x74,0x65,0x09,0x70,0x6f,0x72,0x74,0x0b,0x73,\n    0x65,0x72,0x76,0x65,0x72,0x09,0x6f,0x70,0x65,0x6e,0x95,0x05,0x03,0x00,0x17,0x00,\n    0x39,0x00,0x63,0x34,0x00,0x00,0x00,0x34,0x01,0x01,0x00,0x25,0x02,0x02,0x00,0x3e,\n    0x01,0x02,0x02,0x34,0x02,0x01,0x00,0x25,0x03,0x03,0x00,0x3e,0x02,0x02,0x02,0x34,\n    0x03,0x01,0x00,0x25,0x04,0x04,0x00,0x3e,0x03,0x02,0x02,0x34,0x04,0x01,0x00,0x25,\n    0x05,0x05,0x00,0x3e,0x04,0x02,0x02,0x34,0x05,0x01,0x00,0x25,0x06,0x06,0x00,0x3e,\n    0x05,0x02,0x02,0x34,0x06,0x01,0x00,0x25,0x07,0x07,0x00,0x3e,0x06,0x02,0x02,0x34,\n    0x07,0x01,0x00,0x25,0x08,0x08,0x00,0x3e,0x07,0x02,0x02,0x34,0x08,0x01,0x00,0x25,\n    0x09,0x09,0x00,0x3e,0x08,0x02,0x02,0x34,0x09,0x01,0x00,0x25,0x0a,0x0a,0x00,0x3e,\n    0x09,0x02,0x02,0x32,0x0a,0x00,0x00,0x3a,0x0a,0x0b,0x05,0x37,0x0a,0x0b,0x05,0x27,\n    0x0b,0x3c,0x00,0x3a,0x0b,0x0c,0x0a,0x25,0x0b,0x0e,0x00,0x3a,0x0b,0x0d,0x0a,0x27,\n    0x0b,0x19,0x00,0x3a,0x0b,0x0f,0x0a,0x37,0x0b,0x11,0x04,0x25,0x0c,0x12,0x00,0x3e,\n    0x0b,0x02,0x02,0x0e,0x00,0x0b,0x00,0x54,0x0c,0x01,0x80,0x25,0x0b,0x0e,0x00,0x3a,\n    0x0b,0x10,0x0a,0x25,0x0b,0x14,0x00,0x3a,0x0b,0x13,0x0a,0x33,0x0b,0x15,0x00,0x32,\n    0x0c,0x00,0x00,0x3a,0x0c,0x16,0x0b,0x37,0x0c,0x16,0x0b,0x31,0x0d,0x18,0x00,0x3a,\n    0x0d,0x17,0x0c,0x37,0x0c,0x16,0x0b,0x31,0x0d,0x1a,0x00,0x3a,0x0d,0x19,0x0c,0x37,\n    0x0c,0x16,0x0b,0x31,0x0d,0x1c,0x00,0x3a,0x0d,0x1b,0x0c,0x37,0x0c,0x16,0x0b,0x31,\n    0x0d,0x1e,0x00,0x3a,0x0d,0x1d,0x0c,0x37,0x0c,0x16,0x0b,0x31,0x0d,0x20,0x00,0x3a,\n    0x0d,0x1f,0x0c,0x37,0x0c,0x16,0x0b,0x31,0x0d,0x22,0x00,0x3a,0x0d,0x21,0x0c,0x37,\n    0x0c,0x16,0x0b,0x31,0x0d,0x24,0x00,0x3a,0x0d,0x23,0x0c,0x37,0x0c,0x16,0x0b,0x31,\n    0x0d,0x26,0x00,0x3a,0x0d,0x25,0x0c,0x37,0x0c,0x16,0x0b,0x31,0x0d,0x28,0x00,0x3a,\n    0x0d,0x27,0x0c,0x37,0x0c,0x16,0x0b,0x31,0x0d,0x2a,0x00,0x3a,0x0d,0x29,0x0c,0x31,\n    0x0c,0x2c,0x00,0x3a,0x0c,0x2b,0x0a,0x31,0x0c,0x2d,0x00,0x27,0x0d,0x00,0x00,0x31,\n    0x0e,0x2e,0x00,0x29,0x0f,0x00,0x00,0x31,0x10,0x2f,0x00,0x31,0x11,0x30,0x00,0x31,\n    0x12,0x31,0x00,0x31,0x13,0x32,0x00,0x31,0x0f,0x33,0x00,0x31,0x14,0x34,0x00,0x31,\n    0x15,0x36,0x00,0x3a,0x15,0x35,0x0a,0x37,0x15,0x37,0x05,0x31,0x16,0x38,0x00,0x3e,\n    0x15,0x02,0x02,0x3a,0x15,0x29,0x0a,0x30,0x00,0x00,0x80,0x48,0x0a,0x02,0x00,0x00,\n    0x0c,0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x00,0x0c,0x6d,0x65,0x73,0x73,0x61,0x67,\n    0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x6f,0x70,0x65,0x6e,0x00,\n    0x09,0x73,0x65,0x6e,0x64,0x00,0x09,0x61,0x75,0x74,0x68,0x00,0x0a,0x70,0x6c,0x61,\n    0x69,0x6e,0x00,0x0a,0x6c,0x6f,0x67,0x69,0x6e,0x00,0x0a,0x63,0x6c,0x6f,0x73,0x65,\n    0x00,0x09,0x71,0x75,0x69,0x74,0x00,0x09,0x64,0x61,0x74,0x61,0x00,0x09,0x72,0x63,\n    0x70,0x74,0x00,0x09,0x6d,0x61,0x69,0x6c,0x00,0x0a,0x67,0x72,0x65,0x65,0x74,0x0c,\n    0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x01,0x00,0x00,0x0a,0x2d,0x30,0x30,0x30,0x30,\n    0x09,0x5a,0x4f,0x4e,0x45,0x10,0x53,0x45,0x52,0x56,0x45,0x52,0x5f,0x4e,0x41,0x4d,\n    0x45,0x0b,0x67,0x65,0x74,0x65,0x6e,0x76,0x0b,0x44,0x4f,0x4d,0x41,0x49,0x4e,0x09,\n    0x50,0x4f,0x52,0x54,0x0e,0x6c,0x6f,0x63,0x61,0x6c,0x68,0x6f,0x73,0x74,0x0b,0x53,\n    0x45,0x52,0x56,0x45,0x52,0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,0x54,0x09,0x73,0x6d,\n    0x74,0x70,0x09,0x6d,0x69,0x6d,0x65,0x13,0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x68,\n    0x65,0x61,0x64,0x65,0x72,0x73,0x0a,0x6c,0x74,0x6e,0x31,0x32,0x0e,0x73,0x6f,0x63,\n    0x6b,0x65,0x74,0x2e,0x74,0x70,0x0b,0x73,0x6f,0x63,0x6b,0x65,0x74,0x07,0x6f,0x73,\n    0x09,0x6d,0x61,0x74,0x68,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x0e,0x63,0x6f,0x72,\n    0x6f,0x75,0x74,0x69,0x6e,0x65,0x0c,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x07,0x5f,\n    0x47,0x00,\n};\n\n/* socket.tp, socket/tp.lua */\nstatic const char lua_m_socket_tp[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0xba,0x02,0x00,0x01,0x0c,0x02,0x08,0x00,0x3d,0x2a,0x01,\n    0x03,0x00,0x10,0x05,0x00,0x00,0x37,0x04,0x00,0x00,0x3e,0x04,0x02,0x03,0x10,0x06,\n    0x04,0x00,0x0f,0x00,0x05,0x00,0x54,0x07,0x03,0x80,0x29,0x07,0x00,0x00,0x10,0x08,\n    0x05,0x00,0x46,0x07,0x03,0x00,0x2b,0x07,0x00,0x00,0x37,0x07,0x01,0x07,0x27,0x08,\n    0x02,0x00,0x2b,0x09,0x01,0x00,0x37,0x09,0x02,0x09,0x10,0x0a,0x04,0x00,0x25,0x0b,\n    0x03,0x00,0x3e,0x09,0x03,0x00,0x3d,0x07,0x01,0x03,0x10,0x03,0x08,0x00,0x10,0x01,\n    0x07,0x00,0x0e,0x00,0x01,0x00,0x54,0x07,0x03,0x80,0x29,0x07,0x00,0x00,0x25,0x08,\n    0x04,0x00,0x46,0x07,0x03,0x00,0x07,0x03,0x05,0x00,0x54,0x07,0x1e,0x80,0x51,0x07,\n    0x1d,0x80,0x10,0x08,0x00,0x00,0x37,0x07,0x00,0x00,0x3e,0x07,0x02,0x03,0x10,0x05,\n    0x08,0x00,0x10,0x04,0x07,0x00,0x0f,0x00,0x05,0x00,0x54,0x07,0x03,0x80,0x29,0x07,\n    0x00,0x00,0x10,0x08,0x05,0x00,0x46,0x07,0x03,0x00,0x2b,0x07,0x00,0x00,0x37,0x07,\n    0x01,0x07,0x27,0x08,0x02,0x00,0x2b,0x09,0x01,0x00,0x37,0x09,0x02,0x09,0x10,0x0a,\n    0x04,0x00,0x25,0x0b,0x03,0x00,0x3e,0x09,0x03,0x00,0x3d,0x07,0x01,0x03,0x10,0x03,\n    0x08,0x00,0x10,0x02,0x07,0x00,0x10,0x07,0x06,0x00,0x25,0x08,0x06,0x00,0x10,0x09,\n    0x04,0x00,0x24,0x06,0x09,0x07,0x05,0x01,0x02,0x00,0x54,0x07,0xe4,0x7f,0x07,0x03,\n    0x07,0x00,0x54,0x07,0xe2,0x7f,0x10,0x07,0x01,0x00,0x10,0x08,0x06,0x00,0x46,0x07,\n    0x03,0x00,0x02,0xc0,0x01,0xc0,0x06,0x20,0x06,0x0a,0x06,0x2d,0x19,0x69,0x6e,0x76,\n    0x61,0x6c,0x69,0x64,0x20,0x73,0x65,0x72,0x76,0x65,0x72,0x20,0x72,0x65,0x70,0x6c,\n    0x79,0x12,0x5e,0x28,0x25,0x64,0x25,0x64,0x25,0x64,0x29,0x28,0x2e,0x3f,0x29,0x09,\n    0x66,0x69,0x6e,0x64,0x09,0x73,0x6b,0x69,0x70,0x0c,0x72,0x65,0x63,0x65,0x69,0x76,\n    0x65,0xd0,0x02,0x00,0x02,0x0c,0x03,0x07,0x00,0x46,0x2b,0x02,0x00,0x00,0x37,0x03,\n    0x00,0x00,0x3e,0x02,0x02,0x03,0x0e,0x00,0x02,0x00,0x54,0x04,0x03,0x80,0x29,0x04,\n    0x00,0x00,0x10,0x05,0x03,0x00,0x46,0x04,0x03,0x00,0x2b,0x04,0x01,0x00,0x37,0x04,\n    0x01,0x04,0x10,0x05,0x01,0x00,0x3e,0x04,0x02,0x02,0x06,0x04,0x02,0x00,0x54,0x04,\n    0x30,0x80,0x2b,0x04,0x01,0x00,0x37,0x04,0x01,0x04,0x10,0x05,0x01,0x00,0x3e,0x04,\n    0x02,0x02,0x07,0x04,0x03,0x00,0x54,0x04,0x18,0x80,0x2b,0x04,0x01,0x00,0x37,0x04,\n    0x04,0x04,0x10,0x05,0x01,0x00,0x3e,0x04,0x02,0x04,0x54,0x07,0x0d,0x80,0x2b,0x09,\n    0x02,0x00,0x37,0x09,0x05,0x09,0x10,0x0a,0x02,0x00,0x10,0x0b,0x08,0x00,0x3e,0x09,\n    0x03,0x02,0x0f,0x00,0x09,0x00,0x54,0x0a,0x06,0x80,0x2b,0x09,0x01,0x00,0x37,0x09,\n    0x06,0x09,0x10,0x0a,0x02,0x00,0x3e,0x09,0x02,0x02,0x10,0x0a,0x03,0x00,0x46,0x09,\n    0x03,0x00,0x41,0x07,0x03,0x03,0x4e,0x07,0xf1,0x7f,0x29,0x04,0x00,0x00,0x10,0x05,\n    0x03,0x00,0x46,0x04,0x03,0x00,0x54,0x04,0x19,0x80,0x2b,0x04,0x02,0x00,0x37,0x04,\n    0x05,0x04,0x10,0x05,0x02,0x00,0x10,0x06,0x01,0x00,0x3e,0x04,0x03,0x02,0x0f,0x00,\n    0x04,0x00,0x54,0x05,0x07,0x80,0x2b,0x04,0x01,0x00,0x37,0x04,0x06,0x04,0x10,0x05,\n    0x02,0x00,0x3e,0x04,0x02,0x02,0x10,0x05,0x03,0x00,0x46,0x04,0x03,0x00,0x54,0x04,\n    0x0b,0x80,0x29,0x04,0x00,0x00,0x10,0x05,0x03,0x00,0x46,0x04,0x03,0x00,0x54,0x04,\n    0x07,0x80,0x10,0x04,0x01,0x00,0x2b,0x05,0x01,0x00,0x37,0x05,0x06,0x05,0x10,0x06,\n    0x02,0x00,0x3e,0x05,0x02,0x02,0x10,0x06,0x03,0x00,0x40,0x04,0x03,0x00,0x47,0x00,\n    0x01,0x00,0x05,0xc0,0x00,0xc0,0x01,0xc0,0x0d,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,\n    0x72,0x09,0x66,0x69,0x6e,0x64,0x0b,0x69,0x70,0x61,0x69,0x72,0x73,0x0a,0x74,0x61,\n    0x62,0x6c,0x65,0x0d,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x09,0x74,0x79,0x70,\n    0x65,0x06,0x63,0x7f,0x00,0x03,0x09,0x01,0x05,0x00,0x19,0x2b,0x03,0x00,0x00,0x37,\n    0x03,0x00,0x03,0x10,0x04,0x01,0x00,0x3e,0x03,0x02,0x02,0x10,0x01,0x03,0x00,0x0f,\n    0x00,0x02,0x00,0x54,0x03,0x0a,0x80,0x37,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,\n    0x03,0x02,0x03,0x10,0x05,0x01,0x00,0x25,0x06,0x03,0x00,0x10,0x07,0x02,0x00,0x25,\n    0x08,0x04,0x00,0x24,0x05,0x08,0x05,0x40,0x03,0x03,0x00,0x54,0x03,0x07,0x80,0x37,\n    0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x02,0x03,0x10,0x05,0x01,0x00,0x25,\n    0x06,0x04,0x00,0x24,0x05,0x06,0x05,0x40,0x03,0x03,0x00,0x47,0x00,0x01,0x00,0x01,\n    0xc0,0x07,0x0d,0x0a,0x06,0x20,0x09,0x73,0x65,0x6e,0x64,0x06,0x63,0x0a,0x75,0x70,\n    0x70,0x65,0x72,0x35,0x00,0x03,0x08,0x00,0x02,0x00,0x09,0x34,0x03,0x00,0x00,0x10,\n    0x04,0x03,0x00,0x37,0x03,0x01,0x03,0x10,0x05,0x02,0x00,0x3e,0x03,0x03,0x03,0x10,\n    0x05,0x01,0x00,0x10,0x06,0x03,0x00,0x10,0x07,0x04,0x00,0x40,0x05,0x03,0x00,0x0c,\n    0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x06,0x63,0x22,0x00,0x02,0x05,0x00,0x02,0x00,\n    0x05,0x37,0x02,0x00,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x01,0x02,0x10,0x04,0x01,\n    0x00,0x40,0x02,0x03,0x00,0x09,0x73,0x65,0x6e,0x64,0x06,0x63,0x25,0x00,0x02,0x05,\n    0x00,0x02,0x00,0x05,0x37,0x02,0x00,0x00,0x10,0x03,0x02,0x00,0x37,0x02,0x01,0x02,\n    0x10,0x04,0x01,0x00,0x40,0x02,0x03,0x00,0x0c,0x72,0x65,0x63,0x65,0x69,0x76,0x65,\n    0x06,0x63,0x1f,0x00,0x01,0x03,0x00,0x02,0x00,0x04,0x37,0x01,0x00,0x00,0x10,0x02,\n    0x01,0x00,0x37,0x01,0x01,0x01,0x40,0x01,0x02,0x00,0x0a,0x67,0x65,0x74,0x66,0x64,\n    0x06,0x63,0x1f,0x00,0x01,0x03,0x00,0x02,0x00,0x04,0x37,0x01,0x00,0x00,0x10,0x02,\n    0x01,0x00,0x37,0x01,0x01,0x01,0x40,0x01,0x02,0x00,0x0a,0x64,0x69,0x72,0x74,0x79,\n    0x06,0x63,0x11,0x00,0x01,0x02,0x00,0x01,0x00,0x02,0x37,0x01,0x00,0x00,0x48,0x01,\n    0x02,0x00,0x06,0x63,0x76,0x00,0x03,0x08,0x02,0x06,0x00,0x13,0x2b,0x03,0x00,0x00,\n    0x37,0x03,0x00,0x03,0x25,0x04,0x01,0x00,0x37,0x05,0x02,0x00,0x3e,0x03,0x03,0x02,\n    0x2b,0x04,0x01,0x00,0x37,0x04,0x03,0x04,0x37,0x04,0x04,0x04,0x10,0x05,0x01,0x00,\n    0x10,0x06,0x03,0x00,0x0c,0x07,0x02,0x00,0x54,0x07,0x03,0x80,0x2b,0x07,0x01,0x00,\n    0x37,0x07,0x03,0x07,0x37,0x07,0x05,0x07,0x3e,0x04,0x04,0x03,0x10,0x06,0x04,0x00,\n    0x10,0x07,0x05,0x00,0x46,0x06,0x03,0x00,0x02,0xc0,0x03,0xc0,0x09,0x73,0x74,0x65,\n    0x70,0x08,0x61,0x6c,0x6c,0x09,0x70,0x75,0x6d,0x70,0x06,0x63,0x0e,0x6b,0x65,0x65,\n    0x70,0x2d,0x6f,0x70,0x65,0x6e,0x09,0x73,0x69,0x6e,0x6b,0x27,0x00,0x01,0x03,0x00,\n    0x02,0x00,0x06,0x37,0x01,0x00,0x00,0x10,0x02,0x01,0x00,0x37,0x01,0x01,0x01,0x3e,\n    0x01,0x02,0x01,0x27,0x01,0x01,0x00,0x48,0x01,0x02,0x00,0x0a,0x63,0x6c,0x6f,0x73,\n    0x65,0x06,0x63,0xd6,0x01,0x00,0x04,0x0b,0x04,0x08,0x00,0x24,0x0c,0x04,0x03,0x00,\n    0x54,0x04,0x02,0x80,0x2b,0x04,0x00,0x00,0x37,0x04,0x00,0x04,0x3e,0x04,0x01,0x03,\n    0x0e,0x00,0x04,0x00,0x54,0x06,0x03,0x80,0x29,0x06,0x00,0x00,0x10,0x07,0x05,0x00,\n    0x46,0x06,0x03,0x00,0x10,0x07,0x04,0x00,0x37,0x06,0x01,0x04,0x0c,0x08,0x02,0x00,\n    0x54,0x08,0x02,0x80,0x2b,0x08,0x01,0x00,0x37,0x08,0x02,0x08,0x3e,0x06,0x03,0x01,\n    0x10,0x07,0x04,0x00,0x37,0x06,0x03,0x04,0x10,0x08,0x00,0x00,0x10,0x09,0x01,0x00,\n    0x3e,0x06,0x04,0x03,0x0e,0x00,0x06,0x00,0x54,0x08,0x06,0x80,0x10,0x09,0x04,0x00,\n    0x37,0x08,0x04,0x04,0x3e,0x08,0x02,0x01,0x29,0x08,0x00,0x00,0x10,0x09,0x07,0x00,\n    0x46,0x08,0x03,0x00,0x2b,0x08,0x02,0x00,0x37,0x08,0x05,0x08,0x33,0x09,0x06,0x00,\n    0x3a,0x04,0x07,0x09,0x2b,0x0a,0x03,0x00,0x40,0x08,0x03,0x00,0x02,0xc0,0x04,0xc0,\n    0x00,0xc0,0x06,0xc0,0x06,0x63,0x01,0x00,0x00,0x11,0x73,0x65,0x74,0x6d,0x65,0x74,\n    0x61,0x74,0x61,0x62,0x6c,0x65,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x0c,0x63,0x6f,0x6e,\n    0x6e,0x65,0x63,0x74,0x0c,0x54,0x49,0x4d,0x45,0x4f,0x55,0x54,0x0f,0x73,0x65,0x74,\n    0x74,0x69,0x6d,0x65,0x6f,0x75,0x74,0x08,0x74,0x63,0x70,0xe8,0x02,0x03,0x00,0x09,\n    0x00,0x20,0x00,0x35,0x34,0x00,0x00,0x00,0x34,0x01,0x01,0x00,0x25,0x02,0x02,0x00,\n    0x3e,0x01,0x02,0x02,0x34,0x02,0x01,0x00,0x25,0x03,0x03,0x00,0x3e,0x02,0x02,0x02,\n    0x34,0x03,0x01,0x00,0x25,0x04,0x04,0x00,0x3e,0x03,0x02,0x02,0x32,0x04,0x00,0x00,\n    0x3a,0x04,0x05,0x02,0x37,0x04,0x05,0x02,0x27,0x05,0x3c,0x00,0x3a,0x05,0x06,0x04,\n    0x31,0x05,0x07,0x00,0x33,0x06,0x08,0x00,0x32,0x07,0x00,0x00,0x3a,0x07,0x09,0x06,\n    0x37,0x07,0x09,0x06,0x31,0x08,0x0b,0x00,0x3a,0x08,0x0a,0x07,0x37,0x07,0x09,0x06,\n    0x31,0x08,0x0d,0x00,0x3a,0x08,0x0c,0x07,0x37,0x07,0x09,0x06,0x31,0x08,0x0f,0x00,\n    0x3a,0x08,0x0e,0x07,0x37,0x07,0x09,0x06,0x31,0x08,0x11,0x00,0x3a,0x08,0x10,0x07,\n    0x37,0x07,0x09,0x06,0x31,0x08,0x13,0x00,0x3a,0x08,0x12,0x07,0x37,0x07,0x09,0x06,\n    0x31,0x08,0x15,0x00,0x3a,0x08,0x14,0x07,0x37,0x07,0x09,0x06,0x31,0x08,0x17,0x00,\n    0x3a,0x08,0x16,0x07,0x37,0x07,0x09,0x06,0x31,0x08,0x19,0x00,0x3a,0x08,0x18,0x07,\n    0x37,0x07,0x09,0x06,0x31,0x08,0x1b,0x00,0x3a,0x08,0x1a,0x07,0x37,0x07,0x09,0x06,\n    0x31,0x08,0x1d,0x00,0x3a,0x08,0x1c,0x07,0x31,0x07,0x1f,0x00,0x3a,0x07,0x1e,0x04,\n    0x30,0x00,0x00,0x80,0x48,0x04,0x02,0x00,0x00,0x0c,0x63,0x6f,0x6e,0x6e,0x65,0x63,\n    0x74,0x00,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x00,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,\n    0x00,0x0f,0x67,0x65,0x74,0x63,0x6f,0x6e,0x74,0x72,0x6f,0x6c,0x00,0x0a,0x64,0x69,\n    0x72,0x74,0x79,0x00,0x0a,0x67,0x65,0x74,0x66,0x64,0x00,0x0c,0x72,0x65,0x63,0x65,\n    0x69,0x76,0x65,0x00,0x09,0x73,0x65,0x6e,0x64,0x00,0x09,0x73,0x69,0x6e,0x6b,0x00,\n    0x0c,0x63,0x6f,0x6d,0x6d,0x61,0x6e,0x64,0x00,0x0a,0x63,0x68,0x65,0x63,0x6b,0x0c,\n    0x5f,0x5f,0x69,0x6e,0x64,0x65,0x78,0x01,0x00,0x00,0x00,0x0c,0x54,0x49,0x4d,0x45,\n    0x4f,0x55,0x54,0x07,0x74,0x70,0x0a,0x6c,0x74,0x6e,0x31,0x32,0x0b,0x73,0x6f,0x63,\n    0x6b,0x65,0x74,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x0c,0x72,0x65,0x71,0x75,0x69,\n    0x72,0x65,0x07,0x5f,0x47,0x00,\n};\n\n/* socket.url, socket/url.lua */\nstatic const char lua_m_socket_url[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0x3c,0x00,0x01,0x05,0x01,0x03,0x00,0x08,0x2b,0x01,0x00,\n    0x00,0x37,0x01,0x00,0x01,0x25,0x02,0x01,0x00,0x2b,0x03,0x00,0x00,0x37,0x03,0x02,\n    0x03,0x10,0x04,0x00,0x00,0x3e,0x03,0x02,0x00,0x3f,0x01,0x01,0x00,0x00,0x00,0x09,\n    0x62,0x79,0x74,0x65,0x0b,0x25,0x25,0x25,0x30,0x32,0x78,0x0b,0x66,0x6f,0x72,0x6d,\n    0x61,0x74,0x3f,0x01,0x01,0x05,0x01,0x03,0x00,0x08,0x2b,0x01,0x00,0x00,0x37,0x01,\n    0x00,0x01,0x10,0x02,0x00,0x00,0x25,0x03,0x01,0x00,0x31,0x04,0x02,0x00,0x3e,0x01,\n    0x04,0x02,0x30,0x00,0x00,0x80,0x48,0x01,0x02,0x00,0x00,0xc0,0x00,0x14,0x28,0x5b,\n    0x5e,0x41,0x2d,0x5a,0x61,0x2d,0x7a,0x30,0x2d,0x39,0x5f,0x5d,0x29,0x09,0x67,0x73,\n    0x75,0x62,0x40,0x00,0x01,0x09,0x01,0x01,0x00,0x0c,0x32,0x01,0x00,0x00,0x2b,0x02,\n    0x00,0x00,0x37,0x02,0x00,0x02,0x10,0x03,0x00,0x00,0x3e,0x02,0x02,0x04,0x54,0x05,\n    0x03,0x80,0x36,0x07,0x05,0x00,0x27,0x08,0x01,0x00,0x39,0x08,0x07,0x01,0x41,0x05,\n    0x03,0x03,0x4e,0x05,0xfb,0x7f,0x48,0x01,0x02,0x00,0x01,0xc0,0x0b,0x69,0x70,0x61,\n    0x69,0x72,0x73,0x5a,0x00,0x01,0x05,0x02,0x03,0x00,0x0f,0x2b,0x01,0x00,0x00,0x36,\n    0x01,0x00,0x01,0x0f,0x00,0x01,0x00,0x54,0x02,0x02,0x80,0x48,0x00,0x02,0x00,0x54,\n    0x01,0x08,0x80,0x2b,0x01,0x01,0x00,0x37,0x01,0x00,0x01,0x25,0x02,0x01,0x00,0x2b,\n    0x03,0x01,0x00,0x37,0x03,0x02,0x03,0x10,0x04,0x00,0x00,0x3e,0x03,0x02,0x00,0x3f,\n    0x01,0x01,0x00,0x47,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x09,0x62,0x79,0x74,0x65,\n    0x0b,0x25,0x25,0x25,0x30,0x32,0x78,0x0b,0x66,0x6f,0x72,0x6d,0x61,0x74,0x3d,0x01,\n    0x01,0x05,0x02,0x03,0x00,0x07,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x10,0x02,\n    0x00,0x00,0x25,0x03,0x01,0x00,0x31,0x04,0x02,0x00,0x30,0x00,0x00,0x80,0x40,0x01,\n    0x04,0x00,0x00,0xc0,0x06,0xc0,0x00,0x14,0x28,0x5b,0x5e,0x41,0x2d,0x5a,0x61,0x2d,\n    0x7a,0x30,0x2d,0x39,0x5f,0x5d,0x29,0x09,0x67,0x73,0x75,0x62,0x39,0x00,0x01,0x05,\n    0x02,0x02,0x00,0x08,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x2b,0x02,0x01,0x00,\n    0x37,0x02,0x01,0x02,0x10,0x03,0x00,0x00,0x27,0x04,0x10,0x00,0x3e,0x02,0x03,0x00,\n    0x3f,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x0d,0x74,0x6f,0x6e,0x75,0x6d,0x62,0x65,\n    0x72,0x09,0x63,0x68,0x61,0x72,0x3a,0x01,0x01,0x05,0x02,0x03,0x00,0x08,0x2b,0x01,\n    0x00,0x00,0x37,0x01,0x00,0x01,0x10,0x02,0x00,0x00,0x25,0x03,0x01,0x00,0x31,0x04,\n    0x02,0x00,0x3e,0x01,0x04,0x02,0x30,0x00,0x00,0x80,0x48,0x01,0x02,0x00,0x00,0xc0,\n    0x01,0xc0,0x00,0x0d,0x25,0x25,0x28,0x25,0x78,0x25,0x78,0x29,0x09,0x67,0x73,0x75,\n    0x62,0x27,0x00,0x01,0x02,0x00,0x02,0x00,0x07,0x06,0x00,0x00,0x00,0x54,0x01,0x02,\n    0x80,0x48,0x00,0x02,0x00,0x54,0x01,0x02,0x80,0x25,0x01,0x01,0x00,0x48,0x01,0x02,\n    0x00,0x47,0x00,0x01,0x00,0x05,0x07,0x2e,0x2f,0x2b,0x00,0x01,0x02,0x00,0x02,0x00,\n    0x07,0x06,0x00,0x00,0x00,0x54,0x01,0x03,0x80,0x25,0x01,0x01,0x00,0x48,0x01,0x02,\n    0x00,0x54,0x01,0x01,0x80,0x48,0x00,0x02,0x00,0x47,0x00,0x01,0x00,0x05,0x0b,0x2e,\n    0x2e,0x2f,0x2e,0x2e,0x2f,0x2a,0x00,0x01,0x02,0x00,0x02,0x00,0x07,0x06,0x00,0x00,\n    0x00,0x54,0x01,0x03,0x80,0x25,0x01,0x01,0x00,0x48,0x01,0x02,0x00,0x54,0x01,0x01,\n    0x80,0x48,0x00,0x02,0x00,0x47,0x00,0x01,0x00,0x05,0x0a,0x2e,0x2e,0x2f,0x2e,0x2e,\n    0xa7,0x02,0x01,0x02,0x08,0x01,0x0c,0x00,0x37,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,\n    0x02,0x10,0x03,0x01,0x00,0x27,0x04,0x01,0x00,0x27,0x05,0x01,0x00,0x3e,0x02,0x04,\n    0x02,0x07,0x02,0x01,0x00,0x54,0x02,0x01,0x80,0x30,0x00,0x2d,0x80,0x2b,0x02,0x00,\n    0x00,0x37,0x02,0x02,0x02,0x10,0x03,0x00,0x00,0x25,0x04,0x03,0x00,0x25,0x05,0x04,\n    0x00,0x3e,0x02,0x04,0x02,0x10,0x03,0x02,0x00,0x10,0x04,0x01,0x00,0x24,0x02,0x04,\n    0x03,0x2b,0x03,0x00,0x00,0x37,0x03,0x02,0x03,0x10,0x04,0x02,0x00,0x25,0x05,0x05,\n    0x00,0x31,0x06,0x06,0x00,0x3e,0x03,0x04,0x02,0x10,0x02,0x03,0x00,0x2b,0x03,0x00,\n    0x00,0x37,0x03,0x02,0x03,0x10,0x04,0x02,0x00,0x25,0x05,0x07,0x00,0x25,0x06,0x01,\n    0x00,0x3e,0x03,0x04,0x02,0x10,0x02,0x03,0x00,0x29,0x03,0x00,0x00,0x04,0x03,0x02,\n    0x00,0x54,0x04,0x0a,0x80,0x51,0x04,0x09,0x80,0x10,0x03,0x02,0x00,0x2b,0x04,0x00,\n    0x00,0x37,0x04,0x02,0x04,0x10,0x05,0x03,0x00,0x25,0x06,0x08,0x00,0x31,0x07,0x09,\n    0x00,0x3e,0x04,0x04,0x02,0x10,0x02,0x04,0x00,0x54,0x04,0xf4,0x7f,0x2b,0x04,0x00,\n    0x00,0x37,0x04,0x02,0x04,0x10,0x05,0x03,0x00,0x25,0x06,0x0a,0x00,0x31,0x07,0x0b,\n    0x00,0x3e,0x04,0x04,0x02,0x10,0x02,0x04,0x00,0x30,0x00,0x00,0x80,0x48,0x02,0x02,\n    0x00,0x48,0x01,0x02,0x00,0x00,0xc0,0x00,0x12,0x28,0x5b,0x5e,0x2f,0x5d,0x2a,0x2f,\n    0x25,0x2e,0x25,0x2e,0x29,0x24,0x00,0x12,0x28,0x5b,0x5e,0x2f,0x5d,0x2a,0x2f,0x25,\n    0x2e,0x25,0x2e,0x2f,0x29,0x09,0x2f,0x25,0x2e,0x24,0x00,0x0f,0x28,0x5b,0x5e,0x2f,\n    0x5d,0x2a,0x25,0x2e,0x2f,0x29,0x05,0x0b,0x5b,0x5e,0x2f,0x5d,0x2a,0x24,0x09,0x67,\n    0x73,0x75,0x62,0x06,0x2f,0x08,0x73,0x75,0x62,0x23,0x00,0x01,0x02,0x01,0x02,0x00,\n    0x04,0x2b,0x01,0x00,0x00,0x3a,0x00,0x00,0x01,0x25,0x01,0x01,0x00,0x48,0x01,0x02,\n    0x00,0x02,0xc0,0x05,0x0d,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x21,0x00,0x01,\n    0x02,0x01,0x02,0x00,0x04,0x2b,0x01,0x00,0x00,0x3a,0x00,0x00,0x01,0x25,0x01,0x01,\n    0x00,0x48,0x01,0x02,0x00,0x02,0xc0,0x05,0x0b,0x73,0x63,0x68,0x65,0x6d,0x65,0x24,\n    0x00,0x01,0x02,0x01,0x02,0x00,0x04,0x2b,0x01,0x00,0x00,0x3a,0x00,0x00,0x01,0x25,\n    0x01,0x01,0x00,0x48,0x01,0x02,0x00,0x02,0xc0,0x05,0x0e,0x61,0x75,0x74,0x68,0x6f,\n    0x72,0x69,0x74,0x79,0x20,0x00,0x01,0x02,0x01,0x02,0x00,0x04,0x2b,0x01,0x00,0x00,\n    0x3a,0x00,0x00,0x01,0x25,0x01,0x01,0x00,0x48,0x01,0x02,0x00,0x02,0xc0,0x05,0x0a,\n    0x71,0x75,0x65,0x72,0x79,0x21,0x00,0x01,0x02,0x01,0x02,0x00,0x04,0x2b,0x01,0x00,\n    0x00,0x3a,0x00,0x00,0x01,0x25,0x01,0x01,0x00,0x48,0x01,0x02,0x00,0x02,0xc0,0x05,\n    0x0b,0x70,0x61,0x72,0x61,0x6d,0x73,0x23,0x00,0x01,0x02,0x01,0x02,0x00,0x04,0x2b,\n    0x01,0x00,0x00,0x3a,0x00,0x00,0x01,0x25,0x01,0x01,0x00,0x48,0x01,0x02,0x00,0x02,\n    0xc0,0x05,0x0d,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x1f,0x00,0x01,0x02,0x01,\n    0x02,0x00,0x04,0x2b,0x01,0x00,0x00,0x3a,0x00,0x00,0x01,0x25,0x01,0x01,0x00,0x48,\n    0x01,0x02,0x00,0x02,0xc0,0x05,0x09,0x70,0x6f,0x72,0x74,0x23,0x00,0x01,0x02,0x01,\n    0x02,0x00,0x04,0x2b,0x01,0x00,0x00,0x3a,0x00,0x00,0x01,0x25,0x01,0x01,0x00,0x48,\n    0x01,0x02,0x00,0x02,0xc0,0x05,0x0d,0x70,0x61,0x73,0x73,0x77,0x6f,0x72,0x64,0xcb,\n    0x04,0x01,0x02,0x09,0x02,0x1b,0x00,0x66,0x32,0x02,0x00,0x00,0x2b,0x03,0x00,0x00,\n    0x37,0x03,0x00,0x03,0x0c,0x04,0x01,0x00,0x54,0x04,0x01,0x80,0x10,0x04,0x02,0x00,\n    0x3e,0x03,0x02,0x04,0x54,0x06,0x01,0x80,0x39,0x07,0x06,0x02,0x41,0x06,0x03,0x03,\n    0x4e,0x06,0xfd,0x7f,0x0f,0x00,0x00,0x00,0x54,0x03,0x02,0x80,0x07,0x00,0x01,0x00,\n    0x54,0x03,0x03,0x80,0x29,0x03,0x00,0x00,0x25,0x04,0x02,0x00,0x30,0x00,0x53,0x80,\n    0x2b,0x03,0x01,0x00,0x37,0x03,0x03,0x03,0x10,0x04,0x00,0x00,0x25,0x05,0x04,0x00,\n    0x31,0x06,0x05,0x00,0x3e,0x03,0x04,0x02,0x10,0x00,0x03,0x00,0x2b,0x03,0x01,0x00,\n    0x37,0x03,0x03,0x03,0x10,0x04,0x00,0x00,0x25,0x05,0x06,0x00,0x31,0x06,0x07,0x00,\n    0x3e,0x03,0x04,0x02,0x10,0x00,0x03,0x00,0x2b,0x03,0x01,0x00,0x37,0x03,0x03,0x03,\n    0x10,0x04,0x00,0x00,0x25,0x05,0x08,0x00,0x31,0x06,0x09,0x00,0x3e,0x03,0x04,0x02,\n    0x10,0x00,0x03,0x00,0x2b,0x03,0x01,0x00,0x37,0x03,0x03,0x03,0x10,0x04,0x00,0x00,\n    0x25,0x05,0x0a,0x00,0x31,0x06,0x0b,0x00,0x3e,0x03,0x04,0x02,0x10,0x00,0x03,0x00,\n    0x2b,0x03,0x01,0x00,0x37,0x03,0x03,0x03,0x10,0x04,0x00,0x00,0x25,0x05,0x0c,0x00,\n    0x31,0x06,0x0d,0x00,0x3e,0x03,0x04,0x02,0x10,0x00,0x03,0x00,0x06,0x00,0x01,0x00,\n    0x54,0x03,0x01,0x80,0x3a,0x00,0x0e,0x02,0x37,0x03,0x0f,0x02,0x0e,0x00,0x03,0x00,\n    0x54,0x04,0x02,0x80,0x30,0x00,0x00,0x80,0x48,0x02,0x02,0x00,0x2b,0x04,0x01,0x00,\n    0x37,0x04,0x03,0x04,0x10,0x05,0x03,0x00,0x25,0x06,0x10,0x00,0x31,0x07,0x11,0x00,\n    0x3e,0x04,0x04,0x02,0x10,0x03,0x04,0x00,0x2b,0x04,0x01,0x00,0x37,0x04,0x03,0x04,\n    0x10,0x05,0x03,0x00,0x25,0x06,0x12,0x00,0x31,0x07,0x13,0x00,0x3e,0x04,0x04,0x02,\n    0x10,0x03,0x04,0x00,0x06,0x03,0x01,0x00,0x54,0x04,0x09,0x80,0x2b,0x04,0x01,0x00,\n    0x37,0x04,0x15,0x04,0x10,0x05,0x03,0x00,0x25,0x06,0x16,0x00,0x3e,0x04,0x03,0x02,\n    0x0e,0x00,0x04,0x00,0x54,0x05,0x01,0x80,0x10,0x04,0x03,0x00,0x3a,0x04,0x14,0x02,\n    0x37,0x04,0x17,0x02,0x0e,0x00,0x04,0x00,0x54,0x05,0x02,0x80,0x30,0x00,0x00,0x80,\n    0x48,0x02,0x02,0x00,0x2b,0x05,0x01,0x00,0x37,0x05,0x03,0x05,0x10,0x06,0x04,0x00,\n    0x25,0x07,0x18,0x00,0x31,0x08,0x19,0x00,0x3e,0x05,0x04,0x02,0x10,0x04,0x05,0x00,\n    0x3a,0x04,0x1a,0x02,0x30,0x00,0x00,0x80,0x48,0x02,0x02,0x00,0x46,0x03,0x03,0x00,\n    0x01,0xc0,0x00,0xc0,0x09,0x75,0x73,0x65,0x72,0x00,0x0e,0x3a,0x28,0x5b,0x5e,0x3a,\n    0x5d,0x2a,0x29,0x24,0x0d,0x75,0x73,0x65,0x72,0x69,0x6e,0x66,0x6f,0x0f,0x5e,0x25,\n    0x5b,0x28,0x2e,0x2b,0x29,0x25,0x5d,0x24,0x0a,0x6d,0x61,0x74,0x63,0x68,0x09,0x68,\n    0x6f,0x73,0x74,0x00,0x10,0x3a,0x28,0x5b,0x5e,0x3a,0x25,0x5d,0x5d,0x2a,0x29,0x24,\n    0x00,0x0e,0x5e,0x28,0x5b,0x5e,0x40,0x5d,0x2a,0x29,0x40,0x0e,0x61,0x75,0x74,0x68,\n    0x6f,0x72,0x69,0x74,0x79,0x09,0x70,0x61,0x74,0x68,0x00,0x0b,0x25,0x3b,0x28,0x2e,\n    0x2a,0x29,0x00,0x0b,0x25,0x3f,0x28,0x2e,0x2a,0x29,0x00,0x0f,0x5e,0x2f,0x2f,0x28,\n    0x5b,0x5e,0x2f,0x5d,0x2a,0x29,0x00,0x19,0x5e,0x28,0x5b,0x25,0x77,0x5d,0x5b,0x25,\n    0x77,0x25,0x2b,0x25,0x2d,0x25,0x2e,0x5d,0x2a,0x29,0x25,0x3a,0x00,0x0b,0x23,0x28,\n    0x2e,0x2a,0x29,0x24,0x09,0x67,0x73,0x75,0x62,0x10,0x69,0x6e,0x76,0x61,0x6c,0x69,\n    0x64,0x20,0x75,0x72,0x6c,0x05,0x0a,0x70,0x61,0x69,0x72,0x73,0xe1,0x03,0x00,0x01,\n    0x08,0x02,0x17,0x00,0x57,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x37,0x02,0x01,\n    0x00,0x0e,0x00,0x02,0x00,0x54,0x03,0x01,0x80,0x25,0x02,0x02,0x00,0x3e,0x01,0x02,\n    0x02,0x2b,0x02,0x00,0x00,0x37,0x02,0x03,0x02,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,\n    0x02,0x37,0x03,0x04,0x00,0x0f,0x00,0x03,0x00,0x54,0x04,0x04,0x80,0x10,0x03,0x02,\n    0x00,0x25,0x04,0x05,0x00,0x37,0x05,0x04,0x00,0x24,0x02,0x05,0x03,0x37,0x03,0x06,\n    0x00,0x0f,0x00,0x03,0x00,0x54,0x04,0x04,0x80,0x10,0x03,0x02,0x00,0x25,0x04,0x07,\n    0x00,0x37,0x05,0x06,0x00,0x24,0x02,0x05,0x03,0x37,0x03,0x08,0x00,0x37,0x04,0x09,\n    0x00,0x0f,0x00,0x04,0x00,0x54,0x05,0x25,0x80,0x37,0x03,0x09,0x00,0x2b,0x04,0x01,\n    0x00,0x37,0x04,0x0a,0x04,0x10,0x05,0x03,0x00,0x25,0x06,0x0b,0x00,0x3e,0x04,0x03,\n    0x02,0x0f,0x00,0x04,0x00,0x54,0x05,0x04,0x80,0x25,0x04,0x0c,0x00,0x10,0x05,0x03,\n    0x00,0x25,0x06,0x0d,0x00,0x24,0x03,0x06,0x04,0x37,0x04,0x0e,0x00,0x0f,0x00,0x04,\n    0x00,0x54,0x05,0x04,0x80,0x10,0x04,0x03,0x00,0x25,0x05,0x0b,0x00,0x37,0x06,0x0e,\n    0x00,0x24,0x03,0x06,0x04,0x37,0x04,0x0f,0x00,0x37,0x05,0x10,0x00,0x0f,0x00,0x05,\n    0x00,0x54,0x06,0x08,0x80,0x37,0x04,0x10,0x00,0x37,0x05,0x11,0x00,0x0f,0x00,0x05,\n    0x00,0x54,0x06,0x04,0x80,0x10,0x05,0x04,0x00,0x25,0x06,0x0b,0x00,0x37,0x07,0x11,\n    0x00,0x24,0x04,0x07,0x05,0x0f,0x00,0x04,0x00,0x54,0x05,0x04,0x80,0x10,0x05,0x04,\n    0x00,0x25,0x06,0x12,0x00,0x10,0x07,0x03,0x00,0x24,0x03,0x07,0x05,0x0f,0x00,0x03,\n    0x00,0x54,0x04,0x04,0x80,0x25,0x04,0x13,0x00,0x10,0x05,0x03,0x00,0x10,0x06,0x02,\n    0x00,0x24,0x02,0x06,0x04,0x37,0x04,0x14,0x00,0x0f,0x00,0x04,0x00,0x54,0x05,0x04,\n    0x80,0x37,0x04,0x14,0x00,0x25,0x05,0x0b,0x00,0x10,0x06,0x02,0x00,0x24,0x02,0x06,\n    0x04,0x37,0x04,0x15,0x00,0x0f,0x00,0x04,0x00,0x54,0x05,0x04,0x80,0x10,0x04,0x02,\n    0x00,0x25,0x05,0x16,0x00,0x37,0x06,0x15,0x00,0x24,0x02,0x06,0x04,0x48,0x02,0x02,\n    0x00,0x04,0xc0,0x00,0xc0,0x06,0x23,0x0d,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,\n    0x0b,0x73,0x63,0x68,0x65,0x6d,0x65,0x07,0x2f,0x2f,0x06,0x40,0x0d,0x70,0x61,0x73,\n    0x73,0x77,0x6f,0x72,0x64,0x09,0x75,0x73,0x65,0x72,0x0d,0x75,0x73,0x65,0x72,0x69,\n    0x6e,0x66,0x6f,0x09,0x70,0x6f,0x72,0x74,0x06,0x5d,0x06,0x5b,0x06,0x3a,0x09,0x66,\n    0x69,0x6e,0x64,0x09,0x68,0x6f,0x73,0x74,0x0e,0x61,0x75,0x74,0x68,0x6f,0x72,0x69,\n    0x74,0x79,0x06,0x3f,0x0a,0x71,0x75,0x65,0x72,0x79,0x06,0x3b,0x0b,0x70,0x61,0x72,\n    0x61,0x6d,0x73,0x0f,0x62,0x75,0x69,0x6c,0x64,0x5f,0x70,0x61,0x74,0x68,0x05,0x09,\n    0x70,0x61,0x74,0x68,0x0f,0x70,0x61,0x72,0x73,0x65,0x5f,0x70,0x61,0x74,0x68,0x8c,\n    0x03,0x00,0x02,0x06,0x03,0x0b,0x00,0x4e,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,\n    0x10,0x03,0x00,0x00,0x3e,0x02,0x02,0x02,0x07,0x02,0x01,0x00,0x54,0x02,0x07,0x80,\n    0x35,0x00,0x02,0x00,0x2b,0x02,0x01,0x00,0x37,0x02,0x03,0x02,0x34,0x03,0x02,0x00,\n    0x3e,0x02,0x02,0x02,0x10,0x00,0x02,0x00,0x54,0x02,0x05,0x80,0x2b,0x02,0x01,0x00,\n    0x37,0x02,0x04,0x02,0x10,0x03,0x00,0x00,0x3e,0x02,0x02,0x02,0x35,0x02,0x02,0x00,\n    0x2b,0x02,0x01,0x00,0x37,0x02,0x04,0x02,0x10,0x03,0x01,0x00,0x3e,0x02,0x02,0x02,\n    0x34,0x03,0x02,0x00,0x0e,0x00,0x03,0x00,0x54,0x03,0x02,0x80,0x48,0x01,0x02,0x00,\n    0x54,0x03,0x32,0x80,0x0e,0x00,0x02,0x00,0x54,0x03,0x02,0x80,0x48,0x00,0x02,0x00,\n    0x54,0x03,0x2e,0x80,0x37,0x03,0x05,0x02,0x0f,0x00,0x03,0x00,0x54,0x04,0x02,0x80,\n    0x48,0x01,0x02,0x00,0x54,0x03,0x29,0x80,0x34,0x03,0x02,0x00,0x37,0x03,0x05,0x03,\n    0x3a,0x03,0x05,0x02,0x37,0x03,0x06,0x02,0x0e,0x00,0x03,0x00,0x54,0x03,0x1f,0x80,\n    0x34,0x03,0x02,0x00,0x37,0x03,0x06,0x03,0x3a,0x03,0x06,0x02,0x37,0x03,0x07,0x02,\n    0x0e,0x00,0x03,0x00,0x54,0x03,0x10,0x80,0x34,0x03,0x02,0x00,0x37,0x03,0x07,0x03,\n    0x3a,0x03,0x07,0x02,0x37,0x03,0x08,0x02,0x0e,0x00,0x03,0x00,0x54,0x03,0x13,0x80,\n    0x34,0x03,0x02,0x00,0x37,0x03,0x08,0x03,0x3a,0x03,0x08,0x02,0x37,0x03,0x09,0x02,\n    0x0e,0x00,0x03,0x00,0x54,0x03,0x0d,0x80,0x34,0x03,0x02,0x00,0x37,0x03,0x09,0x03,\n    0x3a,0x03,0x09,0x02,0x54,0x03,0x09,0x80,0x2b,0x03,0x02,0x00,0x34,0x04,0x02,0x00,\n    0x37,0x04,0x07,0x04,0x0e,0x00,0x04,0x00,0x54,0x05,0x01,0x80,0x25,0x04,0x0a,0x00,\n    0x37,0x05,0x07,0x02,0x3e,0x03,0x03,0x02,0x3a,0x03,0x07,0x02,0x2b,0x03,0x01,0x00,\n    0x37,0x03,0x03,0x03,0x10,0x04,0x02,0x00,0x40,0x03,0x02,0x00,0x47,0x00,0x01,0x00,\n    0x01,0xc0,0x04,0xc0,0x08,0xc0,0x05,0x0a,0x71,0x75,0x65,0x72,0x79,0x0b,0x70,0x61,\n    0x72,0x61,0x6d,0x73,0x09,0x70,0x61,0x74,0x68,0x0e,0x61,0x75,0x74,0x68,0x6f,0x72,\n    0x69,0x74,0x79,0x0b,0x73,0x63,0x68,0x65,0x6d,0x65,0x0a,0x70,0x61,0x72,0x73,0x65,\n    0x0a,0x62,0x75,0x69,0x6c,0x64,0x10,0x62,0x61,0x73,0x65,0x5f,0x70,0x61,0x72,0x73,\n    0x65,0x64,0x0a,0x74,0x61,0x62,0x6c,0x65,0x09,0x74,0x79,0x70,0x65,0x2a,0x00,0x01,\n    0x04,0x02,0x01,0x00,0x06,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x2b,0x02,0x01,\n    0x00,0x10,0x03,0x00,0x00,0x3e,0x01,0x03,0x01,0x47,0x00,0x01,0x00,0x01,0x00,0x01,\n    0xc0,0x0b,0x69,0x6e,0x73,0x65,0x72,0x74,0xec,0x01,0x01,0x01,0x08,0x03,0x09,0x00,\n    0x2a,0x32,0x01,0x00,0x00,0x0e,0x00,0x00,0x00,0x54,0x02,0x01,0x80,0x25,0x00,0x00,\n    0x00,0x2b,0x02,0x00,0x00,0x37,0x02,0x01,0x02,0x10,0x03,0x00,0x00,0x25,0x04,0x02,\n    0x00,0x31,0x05,0x03,0x00,0x3e,0x02,0x04,0x01,0x27,0x02,0x01,0x00,0x13,0x03,0x01,\n    0x00,0x27,0x04,0x01,0x00,0x49,0x02,0x06,0x80,0x2b,0x06,0x02,0x00,0x37,0x06,0x04,\n    0x06,0x36,0x07,0x05,0x01,0x3e,0x06,0x02,0x02,0x39,0x06,0x05,0x01,0x4b,0x02,0xfa,\n    0x7f,0x2b,0x02,0x00,0x00,0x37,0x02,0x05,0x02,0x10,0x03,0x00,0x00,0x27,0x04,0x01,\n    0x00,0x27,0x05,0x01,0x00,0x3e,0x02,0x04,0x02,0x07,0x02,0x06,0x00,0x54,0x02,0x02,\n    0x80,0x27,0x02,0x01,0x00,0x3a,0x02,0x07,0x01,0x2b,0x02,0x00,0x00,0x37,0x02,0x05,\n    0x02,0x10,0x03,0x00,0x00,0x27,0x04,0xff,0xff,0x27,0x05,0xff,0xff,0x3e,0x02,0x04,\n    0x02,0x07,0x02,0x06,0x00,0x54,0x02,0x02,0x80,0x27,0x02,0x01,0x00,0x3a,0x02,0x08,\n    0x01,0x30,0x00,0x00,0x80,0x48,0x01,0x02,0x00,0x00,0xc0,0x02,0xc0,0x04,0xc0,0x11,\n    0x69,0x73,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,0x72,0x79,0x10,0x69,0x73,0x5f,\n    0x61,0x62,0x73,0x6f,0x6c,0x75,0x74,0x65,0x06,0x2f,0x08,0x73,0x75,0x62,0x0d,0x75,\n    0x6e,0x65,0x73,0x63,0x61,0x70,0x65,0x00,0x0c,0x28,0x5b,0x5e,0x2f,0x5d,0x2b,0x29,\n    0x09,0x67,0x73,0x75,0x62,0x05,0x9e,0x02,0x00,0x02,0x0b,0x01,0x04,0x01,0x3e,0x25,\n    0x02,0x00,0x00,0x13,0x03,0x00,0x00,0x0f,0x00,0x01,0x00,0x54,0x04,0x18,0x80,0x27,\n    0x04,0x01,0x00,0x15,0x05,0x00,0x03,0x27,0x06,0x01,0x00,0x49,0x04,0x07,0x80,0x10,\n    0x08,0x02,0x00,0x36,0x09,0x07,0x00,0x24,0x02,0x09,0x08,0x10,0x08,0x02,0x00,0x25,\n    0x09,0x01,0x00,0x24,0x02,0x09,0x08,0x4b,0x04,0xf9,0x7f,0x27,0x04,0x00,0x00,0x01,\n    0x04,0x03,0x00,0x54,0x04,0x25,0x80,0x10,0x04,0x02,0x00,0x36,0x05,0x03,0x00,0x24,\n    0x02,0x05,0x04,0x37,0x04,0x02,0x00,0x0f,0x00,0x04,0x00,0x54,0x05,0x1f,0x80,0x10,\n    0x04,0x02,0x00,0x25,0x05,0x01,0x00,0x24,0x02,0x05,0x04,0x54,0x04,0x1b,0x80,0x27,\n    0x04,0x01,0x00,0x15,0x05,0x00,0x03,0x27,0x06,0x01,0x00,0x49,0x04,0x09,0x80,0x10,\n    0x08,0x02,0x00,0x2b,0x09,0x00,0x00,0x36,0x0a,0x07,0x00,0x3e,0x09,0x02,0x02,0x24,\n    0x02,0x09,0x08,0x10,0x08,0x02,0x00,0x25,0x09,0x01,0x00,0x24,0x02,0x09,0x08,0x4b,\n    0x04,0xf7,0x7f,0x27,0x04,0x00,0x00,0x01,0x04,0x03,0x00,0x54,0x04,0x0b,0x80,0x10,\n    0x04,0x02,0x00,0x2b,0x05,0x00,0x00,0x36,0x06,0x03,0x00,0x3e,0x05,0x02,0x02,0x24,\n    0x02,0x05,0x04,0x37,0x04,0x02,0x00,0x0f,0x00,0x04,0x00,0x54,0x05,0x03,0x80,0x10,\n    0x04,0x02,0x00,0x25,0x05,0x01,0x00,0x24,0x02,0x05,0x04,0x37,0x04,0x03,0x00,0x0f,\n    0x00,0x04,0x00,0x54,0x05,0x03,0x80,0x25,0x04,0x01,0x00,0x10,0x05,0x02,0x00,0x24,\n    0x02,0x05,0x04,0x48,0x02,0x02,0x00,0x07,0xc0,0x10,0x69,0x73,0x5f,0x61,0x62,0x73,\n    0x6f,0x6c,0x75,0x74,0x65,0x11,0x69,0x73,0x5f,0x64,0x69,0x72,0x65,0x63,0x74,0x6f,\n    0x72,0x79,0x06,0x2f,0x05,0x02,0xba,0x02,0x03,0x00,0x0a,0x00,0x1a,0x00,0x25,0x34,\n    0x00,0x00,0x00,0x25,0x01,0x01,0x00,0x3e,0x00,0x02,0x02,0x34,0x01,0x02,0x00,0x34,\n    0x02,0x00,0x00,0x25,0x03,0x03,0x00,0x3e,0x02,0x02,0x02,0x34,0x03,0x00,0x00,0x25,\n    0x04,0x04,0x00,0x3e,0x03,0x02,0x02,0x32,0x04,0x00,0x00,0x3a,0x04,0x05,0x03,0x37,\n    0x04,0x05,0x03,0x25,0x05,0x07,0x00,0x3a,0x05,0x06,0x04,0x31,0x05,0x09,0x00,0x3a,\n    0x05,0x08,0x04,0x31,0x05,0x0a,0x00,0x10,0x06,0x05,0x00,0x33,0x07,0x0b,0x00,0x3e,\n    0x06,0x02,0x02,0x31,0x07,0x0c,0x00,0x31,0x08,0x0e,0x00,0x3a,0x08,0x0d,0x04,0x31,\n    0x08,0x0f,0x00,0x31,0x09,0x11,0x00,0x3a,0x09,0x10,0x04,0x31,0x09,0x13,0x00,0x3a,\n    0x09,0x12,0x04,0x31,0x09,0x15,0x00,0x3a,0x09,0x14,0x04,0x31,0x09,0x17,0x00,0x3a,\n    0x09,0x16,0x04,0x31,0x09,0x19,0x00,0x3a,0x09,0x18,0x04,0x30,0x00,0x00,0x80,0x48,\n    0x04,0x02,0x00,0x00,0x0f,0x62,0x75,0x69,0x6c,0x64,0x5f,0x70,0x61,0x74,0x68,0x00,\n    0x0f,0x70,0x61,0x72,0x73,0x65,0x5f,0x70,0x61,0x74,0x68,0x00,0x0d,0x61,0x62,0x73,\n    0x6f,0x6c,0x75,0x74,0x65,0x00,0x0a,0x62,0x75,0x69,0x6c,0x64,0x00,0x0a,0x70,0x61,\n    0x72,0x73,0x65,0x00,0x00,0x0d,0x75,0x6e,0x65,0x73,0x63,0x61,0x70,0x65,0x00,0x01,\n    0x11,0x00,0x00,0x06,0x2d,0x06,0x5f,0x06,0x2e,0x06,0x21,0x06,0x7e,0x06,0x2a,0x06,\n    0x27,0x06,0x28,0x06,0x29,0x06,0x3a,0x06,0x40,0x06,0x26,0x06,0x3d,0x06,0x2b,0x06,\n    0x24,0x06,0x2c,0x00,0x00,0x0b,0x65,0x73,0x63,0x61,0x70,0x65,0x0e,0x55,0x52,0x4c,\n    0x20,0x31,0x2e,0x30,0x2e,0x33,0x0d,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x08,\n    0x75,0x72,0x6c,0x0b,0x73,0x6f,0x63,0x6b,0x65,0x74,0x0a,0x74,0x61,0x62,0x6c,0x65,\n    0x07,0x5f,0x47,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x0c,0x72,0x65,0x71,0x75,0x69,\n    0x72,0x65,0x00,\n};\n\n/* socket, socket.lua */\nstatic const char lua_m_socket[] = {\n    0x1b,0x4c,0x4a,0x01,0x02,0x36,0x00,0x04,0x0a,0x01,0x02,0x00,0x08,0x2b,0x04,0x00,\n    0x00,0x37,0x04,0x00,0x04,0x10,0x05,0x00,0x00,0x10,0x06,0x01,0x00,0x10,0x07,0x02,\n    0x00,0x10,0x08,0x03,0x00,0x25,0x09,0x01,0x00,0x40,0x04,0x06,0x00,0x03,0xc0,0x09,\n    0x69,0x6e,0x65,0x74,0x0c,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x37,0x00,0x04,0x0a,\n    0x01,0x02,0x00,0x08,0x2b,0x04,0x00,0x00,0x37,0x04,0x00,0x04,0x10,0x05,0x00,0x00,\n    0x10,0x06,0x01,0x00,0x10,0x07,0x02,0x00,0x10,0x08,0x03,0x00,0x25,0x09,0x01,0x00,\n    0x40,0x04,0x06,0x00,0x03,0xc0,0x0a,0x69,0x6e,0x65,0x74,0x36,0x0c,0x63,0x6f,0x6e,\n    0x6e,0x65,0x63,0x74,0xab,0x03,0x00,0x03,0x10,0x02,0x10,0x00,0x4b,0x07,0x00,0x00,\n    0x00,0x54,0x03,0x01,0x80,0x25,0x00,0x01,0x00,0x2b,0x03,0x00,0x00,0x37,0x03,0x02,\n    0x03,0x37,0x03,0x03,0x03,0x10,0x04,0x00,0x00,0x3e,0x03,0x02,0x03,0x0e,0x00,0x03,\n    0x00,0x54,0x05,0x03,0x80,0x29,0x05,0x00,0x00,0x10,0x06,0x04,0x00,0x46,0x05,0x03,\n    0x00,0x2a,0x05,0x06,0x00,0x25,0x04,0x04,0x00,0x2b,0x07,0x01,0x00,0x37,0x07,0x05,\n    0x07,0x10,0x08,0x03,0x00,0x3e,0x07,0x02,0x04,0x54,0x0a,0x32,0x80,0x37,0x0c,0x06,\n    0x0b,0x07,0x0c,0x07,0x00,0x54,0x0c,0x06,0x80,0x2b,0x0c,0x00,0x00,0x37,0x0c,0x08,\n    0x0c,0x3e,0x0c,0x01,0x03,0x10,0x04,0x0d,0x00,0x10,0x05,0x0c,0x00,0x54,0x0c,0x05,\n    0x80,0x2b,0x0c,0x00,0x00,0x37,0x0c,0x09,0x0c,0x3e,0x0c,0x01,0x03,0x10,0x04,0x0d,\n    0x00,0x10,0x05,0x0c,0x00,0x0e,0x00,0x05,0x00,0x54,0x0c,0x03,0x80,0x29,0x0c,0x00,\n    0x00,0x10,0x0d,0x04,0x00,0x46,0x0c,0x03,0x00,0x10,0x0d,0x05,0x00,0x37,0x0c,0x0a,\n    0x05,0x25,0x0e,0x0b,0x00,0x29,0x0f,0x02,0x00,0x3e,0x0c,0x04,0x01,0x10,0x0d,0x05,\n    0x00,0x37,0x0c,0x0c,0x05,0x37,0x0e,0x0d,0x0b,0x10,0x0f,0x01,0x00,0x3e,0x0c,0x04,\n    0x03,0x10,0x04,0x0d,0x00,0x10,0x06,0x0c,0x00,0x0e,0x00,0x06,0x00,0x54,0x0c,0x04,\n    0x80,0x10,0x0d,0x05,0x00,0x37,0x0c,0x0e,0x05,0x3e,0x0c,0x02,0x01,0x54,0x0c,0x0d,\n    0x80,0x10,0x0d,0x05,0x00,0x37,0x0c,0x0f,0x05,0x10,0x0e,0x02,0x00,0x3e,0x0c,0x03,\n    0x03,0x10,0x04,0x0d,0x00,0x10,0x06,0x0c,0x00,0x0e,0x00,0x06,0x00,0x54,0x0c,0x04,\n    0x80,0x10,0x0d,0x05,0x00,0x37,0x0c,0x0e,0x05,0x3e,0x0c,0x02,0x01,0x54,0x0c,0x01,\n    0x80,0x48,0x05,0x02,0x00,0x41,0x0a,0x03,0x03,0x4e,0x0a,0xcc,0x7f,0x29,0x07,0x00,\n    0x00,0x10,0x08,0x04,0x00,0x46,0x07,0x03,0x00,0x03,0xc0,0x00,0xc0,0x0b,0x6c,0x69,\n    0x73,0x74,0x65,0x6e,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x09,0x61,0x64,0x64,0x72,0x09,\n    0x62,0x69,0x6e,0x64,0x0e,0x72,0x65,0x75,0x73,0x65,0x61,0x64,0x64,0x72,0x0e,0x73,\n    0x65,0x74,0x6f,0x70,0x74,0x69,0x6f,0x6e,0x09,0x74,0x63,0x70,0x36,0x08,0x74,0x63,\n    0x70,0x09,0x69,0x6e,0x65,0x74,0x0b,0x66,0x61,0x6d,0x69,0x6c,0x79,0x0b,0x69,0x70,\n    0x61,0x69,0x72,0x73,0x17,0x6e,0x6f,0x20,0x69,0x6e,0x66,0x6f,0x20,0x6f,0x6e,0x20,\n    0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x10,0x67,0x65,0x74,0x61,0x64,0x64,0x72,0x69,\n    0x6e,0x66,0x6f,0x08,0x64,0x6e,0x73,0x0c,0x30,0x2e,0x30,0x2e,0x30,0x2e,0x30,0x06,\n    0x2a,0xce,0x01,0x00,0x03,0x08,0x02,0x08,0x00,0x23,0x2b,0x03,0x00,0x00,0x37,0x03,\n    0x00,0x03,0x10,0x04,0x00,0x00,0x3e,0x03,0x02,0x02,0x06,0x03,0x01,0x00,0x54,0x03,\n    0x05,0x80,0x25,0x03,0x02,0x00,0x10,0x04,0x00,0x00,0x10,0x02,0x01,0x00,0x10,0x01,\n    0x04,0x00,0x10,0x00,0x03,0x00,0x2b,0x03,0x01,0x00,0x0c,0x04,0x00,0x00,0x54,0x04,\n    0x01,0x80,0x25,0x04,0x03,0x00,0x36,0x03,0x04,0x03,0x0e,0x00,0x03,0x00,0x54,0x04,\n    0x0c,0x80,0x2b,0x04,0x00,0x00,0x37,0x04,0x04,0x04,0x25,0x05,0x05,0x00,0x2b,0x06,\n    0x00,0x00,0x37,0x06,0x06,0x06,0x10,0x07,0x00,0x00,0x3e,0x06,0x02,0x02,0x25,0x07,\n    0x07,0x00,0x24,0x05,0x07,0x05,0x27,0x06,0x03,0x00,0x3e,0x04,0x03,0x01,0x54,0x04,\n    0x04,0x80,0x10,0x04,0x03,0x00,0x10,0x05,0x01,0x00,0x10,0x06,0x02,0x00,0x40,0x04,\n    0x03,0x00,0x47,0x00,0x01,0x00,0x00,0x00,0x00,0xc0,0x06,0x29,0x0d,0x74,0x6f,0x73,\n    0x74,0x72,0x69,0x6e,0x67,0x12,0x75,0x6e,0x6b,0x6e,0x6f,0x77,0x6e,0x20,0x6b,0x65,\n    0x79,0x20,0x28,0x0a,0x65,0x72,0x72,0x6f,0x72,0x08,0x6e,0x69,0x6c,0x0c,0x64,0x65,\n    0x66,0x61,0x75,0x6c,0x74,0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x09,0x74,0x79,0x70,\n    0x65,0x16,0x01,0x01,0x02,0x01,0x01,0x00,0x03,0x31,0x01,0x00,0x00,0x30,0x00,0x00,\n    0x80,0x48,0x01,0x02,0x00,0x00,0xc0,0x00,0x1f,0x00,0x00,0x02,0x01,0x01,0x00,0x04,\n    0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,0x02,0x00,\n    0x00,0xc0,0x0a,0x67,0x65,0x74,0x66,0x64,0x1f,0x00,0x00,0x02,0x01,0x01,0x00,0x04,\n    0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,0x02,0x00,\n    0x00,0xc0,0x0a,0x64,0x69,0x72,0x74,0x79,0x50,0x00,0x03,0x06,0x01,0x02,0x00,0x0f,\n    0x0e,0x00,0x01,0x00,0x54,0x03,0x07,0x80,0x2b,0x03,0x00,0x00,0x10,0x04,0x03,0x00,\n    0x37,0x03,0x00,0x03,0x3e,0x03,0x02,0x01,0x27,0x03,0x01,0x00,0x48,0x03,0x02,0x00,\n    0x54,0x03,0x05,0x80,0x2b,0x03,0x00,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x01,0x03,\n    0x10,0x05,0x01,0x00,0x40,0x03,0x03,0x00,0x47,0x00,0x01,0x00,0x00,0xc0,0x09,0x73,\n    0x65,0x6e,0x64,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x62,0x01,0x01,0x05,0x01,0x09,0x00,\n    0x0c,0x2b,0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x33,0x02,0x02,0x00,0x31,0x03,0x01,\n    0x00,0x3a,0x03,0x03,0x02,0x31,0x03,0x04,0x00,0x3a,0x03,0x05,0x02,0x33,0x03,0x07,\n    0x00,0x31,0x04,0x06,0x00,0x3a,0x04,0x08,0x03,0x30,0x00,0x00,0x80,0x40,0x01,0x03,\n    0x00,0x00,0xc0,0x0b,0x5f,0x5f,0x63,0x61,0x6c,0x6c,0x01,0x00,0x00,0x00,0x0a,0x64,\n    0x69,0x72,0x74,0x79,0x00,0x0a,0x67,0x65,0x74,0x66,0x64,0x01,0x00,0x00,0x00,0x11,\n    0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x1f,0x00,0x00,0x02,\n    0x01,0x01,0x00,0x04,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,\n    0x40,0x00,0x02,0x00,0x00,0xc0,0x0a,0x67,0x65,0x74,0x66,0x64,0x1f,0x00,0x00,0x02,\n    0x01,0x01,0x00,0x04,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,\n    0x40,0x00,0x02,0x00,0x00,0xc0,0x0a,0x64,0x69,0x72,0x74,0x79,0x3a,0x00,0x03,0x06,\n    0x01,0x01,0x00,0x0b,0x0f,0x00,0x01,0x00,0x54,0x03,0x06,0x80,0x2b,0x03,0x00,0x00,\n    0x10,0x04,0x03,0x00,0x37,0x03,0x00,0x03,0x10,0x05,0x01,0x00,0x40,0x03,0x03,0x00,\n    0x54,0x03,0x02,0x80,0x27,0x03,0x01,0x00,0x48,0x03,0x02,0x00,0x47,0x00,0x01,0x00,\n    0x00,0xc0,0x09,0x73,0x65,0x6e,0x64,0x62,0x01,0x01,0x05,0x01,0x09,0x00,0x0c,0x2b,\n    0x01,0x00,0x00,0x37,0x01,0x00,0x01,0x33,0x02,0x02,0x00,0x31,0x03,0x01,0x00,0x3a,\n    0x03,0x03,0x02,0x31,0x03,0x04,0x00,0x3a,0x03,0x05,0x02,0x33,0x03,0x07,0x00,0x31,\n    0x04,0x06,0x00,0x3a,0x04,0x08,0x03,0x30,0x00,0x00,0x80,0x40,0x01,0x03,0x00,0x00,\n    0xc0,0x0b,0x5f,0x5f,0x63,0x61,0x6c,0x6c,0x01,0x00,0x00,0x00,0x0a,0x64,0x69,0x72,\n    0x74,0x79,0x00,0x0a,0x67,0x65,0x74,0x66,0x64,0x01,0x00,0x00,0x00,0x11,0x73,0x65,\n    0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x1f,0x00,0x00,0x02,0x01,0x01,\n    0x00,0x04,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,\n    0x02,0x00,0x00,0xc0,0x0a,0x67,0x65,0x74,0x66,0x64,0x1f,0x00,0x00,0x02,0x01,0x01,\n    0x00,0x04,0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,\n    0x02,0x00,0x00,0xc0,0x0a,0x64,0x69,0x72,0x74,0x79,0xa3,0x01,0x00,0x00,0x06,0x05,\n    0x04,0x00,0x1e,0x2b,0x00,0x00,0x00,0x27,0x01,0x00,0x00,0x03,0x00,0x01,0x00,0x54,\n    0x00,0x02,0x80,0x29,0x00,0x00,0x00,0x48,0x00,0x02,0x00,0x2b,0x00,0x01,0x00,0x37,\n    0x00,0x00,0x00,0x2b,0x01,0x02,0x00,0x37,0x01,0x01,0x01,0x2b,0x02,0x00,0x00,0x3e,\n    0x00,0x03,0x02,0x2b,0x01,0x03,0x00,0x10,0x02,0x01,0x00,0x37,0x01,0x02,0x01,0x10,\n    0x03,0x00,0x00,0x3e,0x01,0x03,0x03,0x0f,0x00,0x02,0x00,0x54,0x03,0x03,0x80,0x29,\n    0x03,0x00,0x00,0x10,0x04,0x02,0x00,0x46,0x03,0x03,0x00,0x2b,0x03,0x00,0x00,0x2b,\n    0x04,0x04,0x00,0x37,0x04,0x03,0x04,0x10,0x05,0x01,0x00,0x3e,0x04,0x02,0x02,0x1f,\n    0x03,0x04,0x03,0x2c,0x00,0x03,0x00,0x48,0x01,0x02,0x00,0x01,0x80,0x01,0x00,0x02,\n    0x00,0x00,0xc0,0x03,0x00,0x08,0x6c,0x65,0x6e,0x0c,0x72,0x65,0x63,0x65,0x69,0x76,\n    0x65,0x0e,0x42,0x4c,0x4f,0x43,0x4b,0x53,0x49,0x5a,0x45,0x08,0x6d,0x69,0x6e,0x68,\n    0x01,0x02,0x06,0x04,0x09,0x00,0x0c,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,0x33,\n    0x03,0x02,0x00,0x31,0x04,0x01,0x00,0x3a,0x04,0x03,0x03,0x31,0x04,0x04,0x00,0x3a,\n    0x04,0x05,0x03,0x33,0x04,0x07,0x00,0x31,0x05,0x06,0x00,0x3a,0x05,0x08,0x04,0x30,\n    0x00,0x00,0x80,0x40,0x02,0x03,0x00,0x00,0xc0,0x02,0xc0,0x03,0xc0,0x01,0xc0,0x0b,\n    0x5f,0x5f,0x63,0x61,0x6c,0x6c,0x01,0x00,0x00,0x00,0x0a,0x64,0x69,0x72,0x74,0x79,\n    0x00,0x0a,0x67,0x65,0x74,0x66,0x64,0x01,0x00,0x00,0x00,0x11,0x73,0x65,0x74,0x6d,\n    0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,0x1f,0x00,0x00,0x02,0x01,0x01,0x00,0x04,\n    0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,0x02,0x00,\n    0x00,0xc0,0x0a,0x67,0x65,0x74,0x66,0x64,0x1f,0x00,0x00,0x02,0x01,0x01,0x00,0x04,\n    0x2b,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,0x00,0x40,0x00,0x02,0x00,\n    0x00,0xc0,0x0a,0x64,0x69,0x72,0x74,0x79,0x9d,0x01,0x00,0x00,0x05,0x03,0x04,0x01,\n    0x1c,0x2b,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x54,0x01,0x02,0x80,0x29,0x00,0x00,\n    0x00,0x48,0x00,0x02,0x00,0x2b,0x00,0x01,0x00,0x10,0x01,0x00,0x00,0x37,0x00,0x00,\n    0x00,0x2b,0x02,0x02,0x00,0x37,0x02,0x01,0x02,0x3e,0x00,0x03,0x04,0x0e,0x00,0x01,\n    0x00,0x54,0x03,0x02,0x80,0x48,0x00,0x02,0x00,0x54,0x03,0x0c,0x80,0x07,0x01,0x02,\n    0x00,0x54,0x03,0x07,0x80,0x2b,0x03,0x01,0x00,0x10,0x04,0x03,0x00,0x37,0x03,0x03,\n    0x03,0x3e,0x03,0x02,0x01,0x2e,0x00,0x00,0x00,0x48,0x02,0x02,0x00,0x54,0x03,0x03,\n    0x80,0x29,0x03,0x00,0x00,0x10,0x04,0x01,0x00,0x46,0x03,0x03,0x00,0x47,0x00,0x01,\n    0x00,0x01,0x80,0x00,0xc0,0x01,0x00,0x0a,0x63,0x6c,0x6f,0x73,0x65,0x0b,0x63,0x6c,\n    0x6f,0x73,0x65,0x64,0x0e,0x42,0x4c,0x4f,0x43,0x4b,0x53,0x49,0x5a,0x45,0x0c,0x72,\n    0x65,0x63,0x65,0x69,0x76,0x65,0x02,0x68,0x01,0x01,0x06,0x02,0x09,0x00,0x0d,0x29,\n    0x01,0x00,0x00,0x2b,0x02,0x00,0x00,0x37,0x02,0x00,0x02,0x33,0x03,0x02,0x00,0x31,\n    0x04,0x01,0x00,0x3a,0x04,0x03,0x03,0x31,0x04,0x04,0x00,0x3a,0x04,0x05,0x03,0x33,\n    0x04,0x07,0x00,0x31,0x05,0x06,0x00,0x3a,0x05,0x08,0x04,0x30,0x00,0x00,0x80,0x40,\n    0x02,0x03,0x00,0x00,0xc0,0x03,0xc0,0x0b,0x5f,0x5f,0x63,0x61,0x6c,0x6c,0x01,0x00,\n    0x00,0x00,0x0a,0x64,0x69,0x72,0x74,0x79,0x00,0x0a,0x67,0x65,0x74,0x66,0x64,0x01,\n    0x00,0x00,0x00,0x11,0x73,0x65,0x74,0x6d,0x65,0x74,0x61,0x74,0x61,0x62,0x6c,0x65,\n    0x80,0x03,0x03,0x00,0x09,0x00,0x1d,0x00,0x32,0x34,0x00,0x00,0x00,0x34,0x01,0x01,\n    0x00,0x25,0x02,0x02,0x00,0x3e,0x01,0x02,0x02,0x34,0x02,0x01,0x00,0x25,0x03,0x03,\n    0x00,0x3e,0x02,0x02,0x02,0x34,0x03,0x01,0x00,0x25,0x04,0x04,0x00,0x3e,0x03,0x02,\n    0x02,0x10,0x04,0x03,0x00,0x31,0x05,0x06,0x00,0x3a,0x05,0x05,0x04,0x31,0x05,0x08,\n    0x00,0x3a,0x05,0x07,0x04,0x31,0x05,0x0a,0x00,0x3a,0x05,0x09,0x04,0x37,0x05,0x0c,\n    0x04,0x3e,0x05,0x01,0x02,0x3a,0x05,0x0b,0x04,0x31,0x05,0x0e,0x00,0x3a,0x05,0x0d,\n    0x04,0x32,0x05,0x00,0x00,0x32,0x06,0x00,0x00,0x3a,0x05,0x0f,0x04,0x3a,0x06,0x10,\n    0x04,0x27,0x07,0x00,0x08,0x3a,0x07,0x11,0x04,0x31,0x07,0x13,0x00,0x3a,0x07,0x12,\n    0x06,0x31,0x07,0x15,0x00,0x3a,0x07,0x14,0x06,0x37,0x07,0x14,0x06,0x3a,0x07,0x16,\n    0x06,0x37,0x07,0x0d,0x04,0x10,0x08,0x06,0x00,0x3e,0x07,0x02,0x02,0x3a,0x07,0x17,\n    0x04,0x31,0x07,0x19,0x00,0x3a,0x07,0x18,0x05,0x31,0x07,0x1b,0x00,0x3a,0x07,0x1a,\n    0x05,0x37,0x07,0x1a,0x05,0x3a,0x07,0x16,0x05,0x37,0x07,0x0d,0x04,0x10,0x08,0x05,\n    0x00,0x3e,0x07,0x02,0x02,0x3a,0x07,0x1c,0x04,0x30,0x00,0x00,0x80,0x48,0x04,0x02,\n    0x00,0x0b,0x73,0x6f,0x75,0x72,0x63,0x65,0x00,0x11,0x75,0x6e,0x74,0x69,0x6c,0x2d,\n    0x63,0x6c,0x6f,0x73,0x65,0x64,0x00,0x0e,0x62,0x79,0x2d,0x6c,0x65,0x6e,0x67,0x74,\n    0x68,0x09,0x73,0x69,0x6e,0x6b,0x0c,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x00,0x0e,\n    0x6b,0x65,0x65,0x70,0x2d,0x6f,0x70,0x65,0x6e,0x00,0x14,0x63,0x6c,0x6f,0x73,0x65,\n    0x2d,0x77,0x68,0x65,0x6e,0x2d,0x64,0x6f,0x6e,0x65,0x0e,0x42,0x4c,0x4f,0x43,0x4b,\n    0x53,0x49,0x5a,0x45,0x0a,0x73,0x69,0x6e,0x6b,0x74,0x0c,0x73,0x6f,0x75,0x72,0x63,\n    0x65,0x74,0x00,0x0b,0x63,0x68,0x6f,0x6f,0x73,0x65,0x0b,0x6e,0x65,0x77,0x74,0x72,\n    0x79,0x08,0x74,0x72,0x79,0x00,0x09,0x62,0x69,0x6e,0x64,0x00,0x0d,0x63,0x6f,0x6e,\n    0x6e,0x65,0x63,0x74,0x36,0x00,0x0d,0x63,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x34,0x10,\n    0x73,0x6f,0x63,0x6b,0x65,0x74,0x2e,0x63,0x6f,0x72,0x65,0x09,0x6d,0x61,0x74,0x68,\n    0x0b,0x73,0x74,0x72,0x69,0x6e,0x67,0x0c,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x07,\n    0x5f,0x47,0x00,\n};\n\n\n\nint luaopen_lua_m_ltn12(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_ltn12,\n                    sizeof(lua_m_ltn12),\n                    \"ltn12\");\n    return 1;\n}\n\n\nint luaopen_lua_m_mime(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_mime,\n                    sizeof(lua_m_mime),\n                    \"mime\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket_ftp(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket_ftp,\n                    sizeof(lua_m_socket_ftp),\n                    \"socket/ftp\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket_headers(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket_headers,\n                    sizeof(lua_m_socket_headers),\n                    \"socket/headers\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket_http(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket_http,\n                    sizeof(lua_m_socket_http),\n                    \"socket/http\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket_mbox(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket_mbox,\n                    sizeof(lua_m_socket_mbox),\n                    \"socket/mbox\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket_smtp(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket_smtp,\n                    sizeof(lua_m_socket_smtp),\n                    \"socket/smtp\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket_tp(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket_tp,\n                    sizeof(lua_m_socket_tp),\n                    \"socket/tp\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket_url(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket_url,\n                    sizeof(lua_m_socket_url),\n                    \"socket/url\");\n    return 1;\n}\n\n\nint luaopen_lua_m_socket(lua_State *L) {\n    luaL_loadbuffer(L,\n                    (const char*)lua_m_socket,\n                    sizeof(lua_m_socket),\n                    \"socket\");\n    return 1;\n}\n\n\nstatic luaL_Reg socket_scripts_modules[] = {\n    {\"ltn12\", luaopen_lua_m_ltn12},\n    {\"mime\", luaopen_lua_m_mime},\n    {\"socket.ftp\", luaopen_lua_m_socket_ftp},\n    {\"socket.headers\", luaopen_lua_m_socket_headers},\n    {\"socket.http\", luaopen_lua_m_socket_http},\n    {\"socket.mbox\", luaopen_lua_m_socket_mbox},\n    {\"socket.smtp\", luaopen_lua_m_socket_smtp},\n    {\"socket.tp\", luaopen_lua_m_socket_tp},\n    {\"socket.url\", luaopen_lua_m_socket_url},\n    {\"socket\", luaopen_lua_m_socket},\n    {NULL, NULL}\n};\n\nvoid luaopen_socket_scripts(lua_State* L)\n{\n    luaL_Reg* lib = socket_scripts_modules;\n    lua_getglobal(L, \"package\");\n    lua_getfield(L, -1, \"preload\");\n    for (; lib->func; lib++)\n    {\n        lib->func(L);\n        lua_setfield(L, -2, lib->name);\n    }\n    lua_pop(L, 2);\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/socket_scripts.h",
    "content": "\n/* socket_scripts.h */\n\n#ifndef __LUA_MODULES_E58C07CB2FBAF5B178B7E1836DC22849_H_\n#define __LUA_MODULES_E58C07CB2FBAF5B178B7E1836DC22849_H_\n\n#if __cplusplus\nextern \"C\" {\n#endif\n\n#include \"lua.h\"\n\nvoid luaopen_socket_scripts(lua_State* L);\n\n/*\nint luaopen_lua_m_ltn12(lua_State* L);\nint luaopen_lua_m_mime(lua_State* L);\nint luaopen_lua_m_socket_ftp(lua_State* L);\nint luaopen_lua_m_socket_headers(lua_State* L);\nint luaopen_lua_m_socket_http(lua_State* L);\nint luaopen_lua_m_socket_mbox(lua_State* L);\nint luaopen_lua_m_socket_smtp(lua_State* L);\nint luaopen_lua_m_socket_tp(lua_State* L);\nint luaopen_lua_m_socket_url(lua_State* L);\nint luaopen_lua_m_socket(lua_State* L);\n*/\n\n#if __cplusplus\n}\n#endif\n\n#endif /* __LUA_MODULES_E58C07CB2FBAF5B178B7E1836DC22849_H_ */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/tcp.c",
    "content": "/*=========================================================================*\\\n* TCP object\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"auxiliar.h\"\n#include \"socket.h\"\n#include \"inet.h\"\n#include \"options.h\"\n#include \"tcp.h\"\n\n/*=========================================================================*\\\n* Internal function prototypes\n\\*=========================================================================*/\nstatic int global_create(lua_State *L);\nstatic int global_create6(lua_State *L);\nstatic int global_connect(lua_State *L);\nstatic int meth_connect(lua_State *L);\nstatic int meth_listen(lua_State *L);\nstatic int meth_getfamily(lua_State *L);\nstatic int meth_bind(lua_State *L);\nstatic int meth_send(lua_State *L);\nstatic int meth_getstats(lua_State *L);\nstatic int meth_setstats(lua_State *L);\nstatic int meth_getsockname(lua_State *L);\nstatic int meth_getpeername(lua_State *L);\nstatic int meth_shutdown(lua_State *L);\nstatic int meth_receive(lua_State *L);\nstatic int meth_accept(lua_State *L);\nstatic int meth_close(lua_State *L);\nstatic int meth_getoption(lua_State *L);\nstatic int meth_setoption(lua_State *L);\nstatic int meth_settimeout(lua_State *L);\nstatic int meth_getfd(lua_State *L);\nstatic int meth_setfd(lua_State *L);\nstatic int meth_dirty(lua_State *L);\n\n/* tcp object methods */\nstatic luaL_Reg tcp_methods[] = {\n    {\"__gc\",        meth_close},\n    {\"__tostring\",  auxiliar_tostring},\n    {\"accept\",      meth_accept},\n    {\"bind\",        meth_bind},\n    {\"close\",       meth_close},\n    {\"connect\",     meth_connect},\n    {\"dirty\",       meth_dirty},\n    {\"getfamily\",   meth_getfamily},\n    {\"getfd\",       meth_getfd},\n    {\"getoption\",   meth_getoption},\n    {\"getpeername\", meth_getpeername},\n    {\"getsockname\", meth_getsockname},\n    {\"getstats\",    meth_getstats},\n    {\"setstats\",    meth_setstats},\n    {\"listen\",      meth_listen},\n    {\"receive\",     meth_receive},\n    {\"send\",        meth_send},\n    {\"setfd\",       meth_setfd},\n    {\"setoption\",   meth_setoption},\n    {\"setpeername\", meth_connect},\n    {\"setsockname\", meth_bind},\n    {\"settimeout\",  meth_settimeout},\n    {\"shutdown\",    meth_shutdown},\n    {NULL,          NULL}\n};\n\n/* socket option handlers */\nstatic t_opt optget[] = {\n    {\"keepalive\",   opt_get_keepalive},\n    {\"reuseaddr\",   opt_get_reuseaddr},\n    {\"tcp-nodelay\", opt_get_tcp_nodelay},\n    {\"linger\",      opt_get_linger},\n    {NULL,          NULL}\n};\n\nstatic t_opt optset[] = {\n    {\"keepalive\",   opt_set_keepalive},\n    {\"reuseaddr\",   opt_set_reuseaddr},\n    {\"tcp-nodelay\", opt_set_tcp_nodelay},\n    {\"ipv6-v6only\", opt_set_ip6_v6only},\n    {\"linger\",      opt_set_linger},\n    {NULL,          NULL}\n};\n\n/* functions in library namespace */\nstatic luaL_Reg func[] = {\n    {\"tcp\", global_create},\n    {\"tcp6\", global_create6},\n    {\"connect\", global_connect},\n    {NULL, NULL}\n};\n\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nint tcp_open(lua_State *L)\n{\n    /* create classes */\n    auxiliar_newclass(L, \"tcp{master}\", tcp_methods);\n    auxiliar_newclass(L, \"tcp{client}\", tcp_methods);\n    auxiliar_newclass(L, \"tcp{server}\", tcp_methods);\n    /* create class groups */\n    auxiliar_add2group(L, \"tcp{master}\", \"tcp{any}\");\n    auxiliar_add2group(L, \"tcp{client}\", \"tcp{any}\");\n    auxiliar_add2group(L, \"tcp{server}\", \"tcp{any}\");\n    /* define library functions */\n    luaL_openlib(L, NULL, func, 0);\n    return 0;\n}\n\n/*=========================================================================*\\\n* Lua methods\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Just call buffered IO methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_send(lua_State *L) {\n    p_tcp tcp = (p_tcp) auxiliar_checkclass(L, \"tcp{client}\", 1);\n    return buffer_meth_send(L, &tcp->buf);\n}\n\nstatic int meth_receive(lua_State *L) {\n    p_tcp tcp = (p_tcp) auxiliar_checkclass(L, \"tcp{client}\", 1);\n    return buffer_meth_receive(L, &tcp->buf);\n}\n\nstatic int meth_getstats(lua_State *L) {\n    p_tcp tcp = (p_tcp) auxiliar_checkclass(L, \"tcp{client}\", 1);\n    return buffer_meth_getstats(L, &tcp->buf);\n}\n\nstatic int meth_setstats(lua_State *L) {\n    p_tcp tcp = (p_tcp) auxiliar_checkclass(L, \"tcp{client}\", 1);\n    return buffer_meth_setstats(L, &tcp->buf);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call option handler\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getoption(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    return opt_meth_getoption(L, optget, &tcp->sock);\n}\n\nstatic int meth_setoption(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    return opt_meth_setoption(L, optset, &tcp->sock);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Select support methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getfd(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    lua_pushnumber(L, (int) tcp->sock);\n    return 1;\n}\n\n/* this is very dangerous, but can be handy for those that are brave enough */\nstatic int meth_setfd(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    tcp->sock = (t_socket) luaL_checknumber(L, 2);\n    return 0;\n}\n\nstatic int meth_dirty(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    lua_pushboolean(L, !buffer_isempty(&tcp->buf));\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Waits for and returns a client object attempting connection to the\n* server object\n\\*-------------------------------------------------------------------------*/\nstatic int meth_accept(lua_State *L)\n{\n    p_tcp server = (p_tcp) auxiliar_checkclass(L, \"tcp{server}\", 1);\n    p_timeout tm = timeout_markstart(&server->tm);\n    t_socket sock;\n    const char *err = inet_tryaccept(&server->sock, server->family, &sock, tm);\n    /* if successful, push client socket */\n    if (err == NULL) {\n        p_tcp clnt = (p_tcp) lua_newuserdata(L, sizeof(t_tcp));\n        auxiliar_setclass(L, \"tcp{client}\", -1);\n        /* initialize structure fields */\n        memset(clnt, 0, sizeof(t_tcp));\n        socket_setnonblocking(&sock);\n        clnt->sock = sock;\n        io_init(&clnt->io, (p_send) socket_send, (p_recv) socket_recv,\n                (p_error) socket_ioerror, &clnt->sock);\n        timeout_init(&clnt->tm, -1, -1);\n        buffer_init(&clnt->buf, &clnt->io, &clnt->tm);\n        clnt->family = server->family;\n        return 1;\n    } else {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Binds an object to an address\n\\*-------------------------------------------------------------------------*/\nstatic int meth_bind(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkclass(L, \"tcp{master}\", 1);\n    const char *address =  luaL_checkstring(L, 2);\n    const char *port = luaL_checkstring(L, 3);\n    const char *err;\n    struct addrinfo bindhints;\n    memset(&bindhints, 0, sizeof(bindhints));\n    bindhints.ai_socktype = SOCK_STREAM;\n    bindhints.ai_family = tcp->family;\n    bindhints.ai_flags = AI_PASSIVE;\n    address = strcmp(address, \"*\")? address: NULL;\n    err = inet_trybind(&tcp->sock, address, port, &bindhints);\n    if (err) {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Turns a master tcp object into a client object.\n\\*-------------------------------------------------------------------------*/\nstatic int meth_connect(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    const char *address =  luaL_checkstring(L, 2);\n    const char *port = luaL_checkstring(L, 3);\n    struct addrinfo connecthints;\n    const char *err;\n    memset(&connecthints, 0, sizeof(connecthints));\n    connecthints.ai_socktype = SOCK_STREAM;\n    /* make sure we try to connect only to the same family */\n    connecthints.ai_family = tcp->family;\n    timeout_markstart(&tcp->tm);\n    err = inet_tryconnect(&tcp->sock, address, port, &tcp->tm, &connecthints);\n    /* have to set the class even if it failed due to non-blocking connects */\n    auxiliar_setclass(L, \"tcp{client}\", 1);\n    if (err) {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Closes socket used by object\n\\*-------------------------------------------------------------------------*/\nstatic int meth_close(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    socket_destroy(&tcp->sock);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Returns family as string\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getfamily(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    if (tcp->family == PF_INET6) {\n        lua_pushliteral(L, \"inet6\");\n        return 1;\n    } else {\n        lua_pushliteral(L, \"inet4\");\n        return 1;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Puts the sockt in listen mode\n\\*-------------------------------------------------------------------------*/\nstatic int meth_listen(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkclass(L, \"tcp{master}\", 1);\n    int backlog = (int) luaL_optnumber(L, 2, 32);\n    int err = socket_listen(&tcp->sock, backlog);\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_strerror(err));\n        return 2;\n    }\n    /* turn master object into a server object */\n    auxiliar_setclass(L, \"tcp{server}\", 1);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Shuts the connection down partially\n\\*-------------------------------------------------------------------------*/\nstatic int meth_shutdown(lua_State *L)\n{\n    /* SHUT_RD,  SHUT_WR,  SHUT_RDWR  have  the value 0, 1, 2, so we can use method index directly */\n    static const char* methods[] = { \"receive\", \"send\", \"both\", NULL };\n    p_tcp tcp = (p_tcp) auxiliar_checkclass(L, \"tcp{client}\", 1);\n    int how = luaL_checkoption(L, 2, \"both\", methods);\n    socket_shutdown(&tcp->sock, how);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call inet methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getpeername(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    return inet_meth_getpeername(L, &tcp->sock, tcp->family);\n}\n\nstatic int meth_getsockname(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    return inet_meth_getsockname(L, &tcp->sock, tcp->family);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call tm methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_settimeout(lua_State *L)\n{\n    p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, \"tcp{any}\", 1);\n    return timeout_meth_settimeout(L, &tcp->tm);\n}\n\n/*=========================================================================*\\\n* Library functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Creates a master tcp object\n\\*-------------------------------------------------------------------------*/\nstatic int tcp_create(lua_State *L, int family) {\n    t_socket sock;\n    const char *err = inet_trycreate(&sock, family, SOCK_STREAM);\n    /* try to allocate a system socket */\n    if (!err) {\n        /* allocate tcp object */\n        p_tcp tcp = (p_tcp) lua_newuserdata(L, sizeof(t_tcp));\n        memset(tcp, 0, sizeof(t_tcp));\n        /* set its type as master object */\n        auxiliar_setclass(L, \"tcp{master}\", -1);\n        /* initialize remaining structure fields */\n        socket_setnonblocking(&sock);\n        if (family == PF_INET6) {\n            int yes = 1;\n            setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,\n                (void *)&yes, sizeof(yes));\n        }\n        tcp->sock = sock;\n        io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,\n                (p_error) socket_ioerror, &tcp->sock);\n        timeout_init(&tcp->tm, -1, -1);\n        buffer_init(&tcp->buf, &tcp->io, &tcp->tm);\n        tcp->family = family;\n        return 1;\n    } else {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n}\n\nstatic int global_create(lua_State *L) {\n    return tcp_create(L, AF_INET);\n}\n\nstatic int global_create6(lua_State *L) {\n    return tcp_create(L, AF_INET6);\n}\n\nstatic const char *tryconnect6(const char *remoteaddr, const char *remoteserv,\n    struct addrinfo *connecthints, p_tcp tcp) {\n    struct addrinfo *iterator = NULL, *resolved = NULL;\n    const char *err = NULL;\n    /* try resolving */\n    err = socket_gaistrerror(getaddrinfo(remoteaddr, remoteserv,\n                connecthints, &resolved));\n    if (err != NULL) {\n        if (resolved) freeaddrinfo(resolved);\n        return err;\n    }\n    /* iterate over all returned addresses trying to connect */\n    for (iterator = resolved; iterator; iterator = iterator->ai_next) {\n        p_timeout tm = timeout_markstart(&tcp->tm);\n        /* create new socket if one wasn't created by the bind stage */\n        if (tcp->sock == SOCKET_INVALID) {\n            err = socket_strerror(socket_create(&tcp->sock,\n                iterator->ai_family, iterator->ai_socktype,\n                iterator->ai_protocol));\n            if (err != NULL) {\n                freeaddrinfo(resolved);\n                return err;\n            }\n            tcp->family = iterator->ai_family;\n            /* all sockets initially non-blocking */\n            socket_setnonblocking(&tcp->sock);\n        }\n        /* finally try connecting to remote address */\n        err = socket_strerror(socket_connect(&tcp->sock,\n            (SA *) iterator->ai_addr,\n            (socklen_t) iterator->ai_addrlen, tm));\n        /* if success, break out of loop */\n        if (err == NULL) break;\n    }\n\n    freeaddrinfo(resolved);\n    /* here, if err is set, we failed */\n    return err;\n}\n\nstatic int global_connect(lua_State *L) {\n    const char *remoteaddr = luaL_checkstring(L, 1);\n    const char *remoteserv = luaL_checkstring(L, 2);\n    const char *localaddr  = luaL_optstring(L, 3, NULL);\n    const char *localserv  = luaL_optstring(L, 4, \"0\");\n    int family = inet_optfamily(L, 5, \"unspec\");\n    p_tcp tcp = (p_tcp) lua_newuserdata(L, sizeof(t_tcp));\n    struct addrinfo bindhints, connecthints;\n    const char *err = NULL;\n    /* initialize tcp structure */\n    memset(tcp, 0, sizeof(t_tcp));\n    io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,\n            (p_error) socket_ioerror, &tcp->sock);\n    timeout_init(&tcp->tm, -1, -1);\n    buffer_init(&tcp->buf, &tcp->io, &tcp->tm);\n    tcp->sock = SOCKET_INVALID;\n    /* allow user to pick local address and port */\n    memset(&bindhints, 0, sizeof(bindhints));\n    bindhints.ai_socktype = SOCK_STREAM;\n    bindhints.ai_family = family;\n    bindhints.ai_flags = AI_PASSIVE;\n    if (localaddr) {\n        err = inet_trybind(&tcp->sock, localaddr, localserv, &bindhints);\n        if (err) {\n            lua_pushnil(L);\n            lua_pushstring(L, err);\n            return 2;\n        }\n        tcp->family = bindhints.ai_family;\n    }\n    /* try to connect to remote address and port */\n    memset(&connecthints, 0, sizeof(connecthints));\n    connecthints.ai_socktype = SOCK_STREAM;\n    /* make sure we try to connect only to the same family */\n    connecthints.ai_family = bindhints.ai_family;\n    err = tryconnect6(remoteaddr, remoteserv, &connecthints, tcp);\n    if (err) {\n        socket_destroy(&tcp->sock);\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n    auxiliar_setclass(L, \"tcp{client}\", -1);\n    return 1;\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/tcp.h",
    "content": "#ifndef TCP_H\n#define TCP_H\n/*=========================================================================*\\\n* TCP object\n* LuaSocket toolkit\n*\n* The tcp.h module is basicly a glue that puts together modules buffer.h,\n* timeout.h socket.h and inet.h to provide the LuaSocket TCP (AF_INET,\n* SOCK_STREAM) support.\n*\n* Three classes are defined: master, client and server. The master class is\n* a newly created tcp object, that has not been bound or connected. Server\n* objects are tcp objects bound to some local address. Client objects are\n* tcp objects either connected to some address or returned by the accept\n* method of a server object.\n\\*=========================================================================*/\n#include \"lua.h\"\n\n#include \"luasocket_buffer.h\"\n#include \"timeout.h\"\n#include \"socket.h\"\n\ntypedef struct t_tcp_ {\n    t_socket sock;\n    t_io io;\n    t_buffer buf;\n    t_timeout tm;\n    int family;\n} t_tcp;\n\ntypedef t_tcp *p_tcp;\n\nint tcp_open(lua_State *L);\n\n#endif /* TCP_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/timeout.c",
    "content": "/*=========================================================================*\\\n* Timeout management functions\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <stdio.h>\n#include <limits.h>\n#include <float.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"auxiliar.h\"\n#include \"timeout.h\"\n\n#ifdef _WIN32\n#include <windows.h>\n#else\n#include <time.h>\n#include <sys/time.h>\n#endif\n\n/* min and max macros */\n#ifndef MIN\n#define MIN(x, y) ((x) < (y) ? x : y)\n#endif\n#ifndef MAX\n#define MAX(x, y) ((x) > (y) ? x : y)\n#endif\n\n/*=========================================================================*\\\n* Internal function prototypes\n\\*=========================================================================*/\nstatic int timeout_lua_gettime(lua_State *L);\nstatic int timeout_lua_sleep(lua_State *L);\n\nstatic luaL_Reg func[] = {\n    { \"gettime\", timeout_lua_gettime },\n    { \"sleep\", timeout_lua_sleep },\n    { NULL, NULL }\n};\n\n/*=========================================================================*\\\n* Exported functions.\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Initialize structure\n\\*-------------------------------------------------------------------------*/\nvoid timeout_init(p_timeout tm, double block, double total) {\n    tm->block = block;\n    tm->total = total;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Determines how much time we have left for the next system call,\n* if the previous call was successful \n* Input\n*   tm: timeout control structure\n* Returns\n*   the number of ms left or -1 if there is no time limit\n\\*-------------------------------------------------------------------------*/\ndouble timeout_get(p_timeout tm) {\n    if (tm->block < 0.0 && tm->total < 0.0) {\n        return -1;\n    } else if (tm->block < 0.0) {\n        double t = tm->total - timeout_gettime() + tm->start;\n        return MAX(t, 0.0);\n    } else if (tm->total < 0.0) {\n        return tm->block;\n    } else {\n        double t = tm->total - timeout_gettime() + tm->start;\n        return MIN(tm->block, MAX(t, 0.0));\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Returns time since start of operation\n* Input\n*   tm: timeout control structure\n* Returns\n*   start field of structure\n\\*-------------------------------------------------------------------------*/\ndouble timeout_getstart(p_timeout tm) {\n    return tm->start;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Determines how much time we have left for the next system call,\n* if the previous call was a failure\n* Input\n*   tm: timeout control structure\n* Returns\n*   the number of ms left or -1 if there is no time limit\n\\*-------------------------------------------------------------------------*/\ndouble timeout_getretry(p_timeout tm) {\n    if (tm->block < 0.0 && tm->total < 0.0) {\n        return -1;\n    } else if (tm->block < 0.0) {\n        double t = tm->total - timeout_gettime() + tm->start;\n        return MAX(t, 0.0);\n    } else if (tm->total < 0.0) {\n        double t = tm->block - timeout_gettime() + tm->start;\n        return MAX(t, 0.0);\n    } else {\n        double t = tm->total - timeout_gettime() + tm->start;\n        return MIN(tm->block, MAX(t, 0.0));\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Marks the operation start time in structure \n* Input\n*   tm: timeout control structure\n\\*-------------------------------------------------------------------------*/\np_timeout timeout_markstart(p_timeout tm) {\n    tm->start = timeout_gettime();\n    return tm;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Gets time in s, relative to January 1, 1970 (UTC) \n* Returns\n*   time in s.\n\\*-------------------------------------------------------------------------*/\n#ifdef _WIN32\ndouble timeout_gettime(void) {\n    FILETIME ft;\n    double t;\n    GetSystemTimeAsFileTime(&ft);\n    /* Windows file time (time since January 1, 1601 (UTC)) */\n    t  = ft.dwLowDateTime/1.0e7 + ft.dwHighDateTime*(4294967296.0/1.0e7);\n    /* convert to Unix Epoch time (time since January 1, 1970 (UTC)) */\n    return (t - 11644473600.0);\n}\n#else\ndouble timeout_gettime(void) {\n    struct timeval v;\n    gettimeofday(&v, (struct timezone *) NULL);\n    /* Unix Epoch time (time since January 1, 1970 (UTC)) */\n    return v.tv_sec + v.tv_usec/1.0e6;\n}\n#endif\n\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nint timeout_open(lua_State *L) {\n    luaL_openlib(L, NULL, func, 0);\n    return 0;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Sets timeout values for IO operations\n* Lua Input: base, time [, mode]\n*   time: time out value in seconds\n*   mode: \"b\" for block timeout, \"t\" for total timeout. (default: b)\n\\*-------------------------------------------------------------------------*/\nint timeout_meth_settimeout(lua_State *L, p_timeout tm) {\n    double t = luaL_optnumber(L, 2, -1);\n    const char *mode = luaL_optstring(L, 3, \"b\");\n    switch (*mode) {\n        case 'b':\n            tm->block = t; \n            break;\n        case 'r': case 't':\n            tm->total = t;\n            break;\n        default:\n            luaL_argcheck(L, 0, 3, \"invalid timeout mode\");\n            break;\n    }\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*=========================================================================*\\\n* Test support functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Returns the time the system has been up, in secconds.\n\\*-------------------------------------------------------------------------*/\nstatic int timeout_lua_gettime(lua_State *L)\n{\n    lua_pushnumber(L, timeout_gettime());\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Sleep for n seconds.\n\\*-------------------------------------------------------------------------*/\n#ifdef _WIN32\nint timeout_lua_sleep(lua_State *L)\n{\n    double n = luaL_checknumber(L, 1);\n    if (n < 0.0) n = 0.0;\n    if (n < DBL_MAX/1000.0) n *= 1000.0;\n    if (n > INT_MAX) n = INT_MAX;\n    Sleep((int)n);\n    return 0;\n}\n#else\nint timeout_lua_sleep(lua_State *L)\n{\n    double n = luaL_checknumber(L, 1);\n    struct timespec t, r;\n    if (n < 0.0) n = 0.0;\n    if (n > INT_MAX) n = INT_MAX;\n    t.tv_sec = (int) n;\n    n -= t.tv_sec;\n    t.tv_nsec = (int) (n * 1000000000);\n    if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999;\n    while (nanosleep(&t, &r) != 0) {\n        t.tv_sec = r.tv_sec;\n        t.tv_nsec = r.tv_nsec;\n    }\n    return 0;\n}\n#endif\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/timeout.h",
    "content": "#ifndef TIMEOUT_H\n#define TIMEOUT_H\n/*=========================================================================*\\\n* Timeout management functions\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include \"lua.h\"\n\n/* timeout control structure */\ntypedef struct t_timeout_ {\n    double block;          /* maximum time for blocking calls */\n    double total;          /* total number of miliseconds for operation */\n    double start;          /* time of start of operation */\n} t_timeout;\ntypedef t_timeout *p_timeout;\n\nint timeout_open(lua_State *L);\nvoid timeout_init(p_timeout tm, double block, double total);\ndouble timeout_get(p_timeout tm);\ndouble timeout_getretry(p_timeout tm);\np_timeout timeout_markstart(p_timeout tm);\ndouble timeout_getstart(p_timeout tm);\ndouble timeout_gettime(void);\nint timeout_meth_settimeout(lua_State *L, p_timeout tm);\n\n#define timeout_iszero(tm)   ((tm)->block == 0.0)\n\n#endif /* TIMEOUT_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/udp.c",
    "content": "/*=========================================================================*\\\n* UDP object\n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"auxiliar.h\"\n#include \"socket.h\"\n#include \"inet.h\"\n#include \"options.h\"\n#include \"udp.h\"\n\n/* min and max macros */\n#ifndef MIN\n#define MIN(x, y) ((x) < (y) ? x : y)\n#endif\n#ifndef MAX\n#define MAX(x, y) ((x) > (y) ? x : y)\n#endif\n\n/*=========================================================================*\\\n* Internal function prototypes\n\\*=========================================================================*/\nstatic int global_create(lua_State *L);\nstatic int global_create6(lua_State *L);\nstatic int meth_send(lua_State *L);\nstatic int meth_sendto(lua_State *L);\nstatic int meth_receive(lua_State *L);\nstatic int meth_receivefrom(lua_State *L);\nstatic int meth_getfamily(lua_State *L);\nstatic int meth_getsockname(lua_State *L);\nstatic int meth_getpeername(lua_State *L);\nstatic int meth_setsockname(lua_State *L);\nstatic int meth_setpeername(lua_State *L);\nstatic int meth_close(lua_State *L);\nstatic int meth_setoption(lua_State *L);\nstatic int meth_getoption(lua_State *L);\nstatic int meth_settimeout(lua_State *L);\nstatic int meth_getfd(lua_State *L);\nstatic int meth_setfd(lua_State *L);\nstatic int meth_dirty(lua_State *L);\n\n/* udp object methods */\nstatic luaL_Reg udp_methods[] = {\n    {\"__gc\",        meth_close},\n    {\"__tostring\",  auxiliar_tostring},\n    {\"close\",       meth_close},\n    {\"dirty\",       meth_dirty},\n    {\"getfamily\",   meth_getfamily},\n    {\"getfd\",       meth_getfd},\n    {\"getpeername\", meth_getpeername},\n    {\"getsockname\", meth_getsockname},\n    {\"receive\",     meth_receive},\n    {\"receivefrom\", meth_receivefrom},\n    {\"send\",        meth_send},\n    {\"sendto\",      meth_sendto},\n    {\"setfd\",       meth_setfd},\n    {\"setoption\",   meth_setoption},\n    {\"getoption\",   meth_getoption},\n    {\"setpeername\", meth_setpeername},\n    {\"setsockname\", meth_setsockname},\n    {\"settimeout\",  meth_settimeout},\n    {NULL,          NULL}\n};\n\n/* socket options for setoption */\nstatic t_opt optset[] = {\n    {\"dontroute\",          opt_set_dontroute},\n    {\"broadcast\",          opt_set_broadcast},\n    {\"reuseaddr\",          opt_set_reuseaddr},\n    {\"reuseport\",          opt_set_reuseport},\n    {\"ip-multicast-if\",    opt_set_ip_multicast_if},\n    {\"ip-multicast-ttl\",   opt_set_ip_multicast_ttl},\n    {\"ip-multicast-loop\",  opt_set_ip_multicast_loop},\n    {\"ip-add-membership\",  opt_set_ip_add_membership},\n    {\"ip-drop-membership\", opt_set_ip_drop_membersip},\n    {\"ipv6-v6only\",        opt_set_ip6_v6only},\n    {NULL,                 NULL}\n};\n\n/* socket options for getoption */\nstatic t_opt optget[] = {\n    {\"ip-multicast-if\",    opt_get_ip_multicast_if},\n    {\"ip-multicast-loop\",  opt_get_ip_multicast_loop},\n    {NULL,                 NULL}\n};\n\n/* functions in library namespace */\nstatic luaL_Reg func[] = {\n    {\"udp\", global_create},\n    {\"udp6\", global_create6},\n    {NULL, NULL}\n};\n\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nint udp_open(lua_State *L)\n{\n    /* create classes */\n    auxiliar_newclass(L, \"udp{connected}\", udp_methods);\n    auxiliar_newclass(L, \"udp{unconnected}\", udp_methods);\n    /* create class groups */\n    auxiliar_add2group(L, \"udp{connected}\",   \"udp{any}\");\n    auxiliar_add2group(L, \"udp{unconnected}\", \"udp{any}\");\n    auxiliar_add2group(L, \"udp{connected}\",   \"select{able}\");\n    auxiliar_add2group(L, \"udp{unconnected}\", \"select{able}\");\n    /* define library functions */\n    luaL_openlib(L, NULL, func, 0);\n    return 0;\n}\n\n/*=========================================================================*\\\n* Lua methods\n\\*=========================================================================*/\nconst char *udp_strerror(int err) {\n    /* a 'closed' error on an unconnected means the target address was not\n     * accepted by the transport layer */\n    if (err == IO_CLOSED) return \"refused\";\n    else return socket_strerror(err);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Send data through connected udp socket\n\\*-------------------------------------------------------------------------*/\nstatic int meth_send(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkclass(L, \"udp{connected}\", 1);\n    p_timeout tm = &udp->tm;\n    size_t count, sent = 0;\n    int err;\n    const char *data = luaL_checklstring(L, 2, &count);\n    timeout_markstart(tm);\n    err = socket_send(&udp->sock, data, count, &sent, tm);\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, udp_strerror(err));\n        return 2;\n    }\n    lua_pushnumber(L, (lua_Number) sent);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Send data through unconnected udp socket\n\\*-------------------------------------------------------------------------*/\nstatic int meth_sendto(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkclass(L, \"udp{unconnected}\", 1);\n    size_t count, sent = 0;\n    const char *data = luaL_checklstring(L, 2, &count);\n    const char *ip = luaL_checkstring(L, 3);\n    unsigned short port = (unsigned short) luaL_checknumber(L, 4);\n    p_timeout tm = &udp->tm;\n    int err;\n    switch (udp->family) {\n\tcase PF_INET: {\n\t    struct sockaddr_in addr;\n\t    memset(&addr, 0, sizeof(addr));\n\t    if (!my_inet_pton(AF_INET, ip, &addr.sin_addr))\n\t\tluaL_argerror(L, 3, \"invalid ip address\");\n\t    addr.sin_family = AF_INET;\n\t    addr.sin_port = htons(port);\n\t    timeout_markstart(tm);\n\t    err = socket_sendto(&udp->sock, data, count, &sent,\n\t\t    (SA *) &addr, sizeof(addr), tm);\n\t    break;\n\t}\n\tcase PF_INET6: {\n\t    struct sockaddr_in6 addr;\n\t    memset(&addr, 0, sizeof(addr));\n\t    if (!my_inet_pton(AF_INET6, ip, &addr.sin6_addr))\n\t\tluaL_argerror(L, 3, \"invalid ip address\");\n\t    addr.sin6_family = AF_INET6;\n\t    addr.sin6_port = htons(port);\n\t    timeout_markstart(tm);\n\t    err = socket_sendto(&udp->sock, data, count, &sent,\n\t\t    (SA *) &addr, sizeof(addr), tm);\n\t    break;\n\t}\n\tdefault:\n            lua_pushnil(L);\n            lua_pushfstring(L, \"unknown family %d\", udp->family);\n            return 2;\n    }\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, udp_strerror(err));\n        return 2;\n    }\n    lua_pushnumber(L, (lua_Number) sent);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Receives data from a UDP socket\n\\*-------------------------------------------------------------------------*/\nstatic int meth_receive(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    char buffer[UDP_DATAGRAMSIZE];\n    size_t got, count = (size_t) luaL_optnumber(L, 2, sizeof(buffer));\n    int err;\n    p_timeout tm = &udp->tm;\n    count = MIN(count, sizeof(buffer));\n    timeout_markstart(tm);\n    err = socket_recv(&udp->sock, buffer, count, &got, tm);\n    /* Unlike TCP, recv() of zero is not closed, but a zero-length packet. */\n    if (err == IO_CLOSED)\n        err = IO_DONE;\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, udp_strerror(err));\n        return 2;\n    }\n    lua_pushlstring(L, buffer, got);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Receives data and sender from a UDP socket\n\\*-------------------------------------------------------------------------*/\nstatic int meth_receivefrom(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkclass(L, \"udp{unconnected}\", 1);\n    char buffer[UDP_DATAGRAMSIZE];\n    size_t got, count = (size_t) luaL_optnumber(L, 2, sizeof(buffer));\n    int err;\n    p_timeout tm = &udp->tm;\n    timeout_markstart(tm);\n    count = MIN(count, sizeof(buffer));\n    switch (udp->family) {\n\tcase PF_INET: {\n\t    struct sockaddr_in addr;\n\t    socklen_t addr_len = sizeof(addr);\n\t    err = socket_recvfrom(&udp->sock, buffer, count, &got,\n\t\t    (SA *) &addr, &addr_len, tm);\n\t    /* Unlike TCP, recv() of zero is not closed, but a zero-length packet. */\n\t    if (err == IO_CLOSED)\n\t\terr = IO_DONE;\n\t    if (err == IO_DONE) {\n\t\tchar addrstr[INET_ADDRSTRLEN];\n\t\tlua_pushlstring(L, buffer, got);\n\t\tif (!my_inet_ntop(AF_INET, &addr.sin_addr,\n\t\t\taddrstr, sizeof(addrstr))) {\n\t\t    lua_pushnil(L);\n\t\t    lua_pushstring(L, \"invalid source address\");\n\t\t    return 2;\n\t\t}\n\t\tlua_pushstring(L, addrstr);\n\t\tlua_pushnumber(L, ntohs(addr.sin_port));\n\t\treturn 3;\n\t    }\n\t    break;\n\t}\n\tcase PF_INET6: {\n\t    struct sockaddr_in6 addr;\n\t    socklen_t addr_len = sizeof(addr);\n\t    err = socket_recvfrom(&udp->sock, buffer, count, &got,\n\t\t    (SA *) &addr, &addr_len, tm);\n\t    /* Unlike TCP, recv() of zero is not closed, but a zero-length packet. */\n\t    if (err == IO_CLOSED)\n\t\terr = IO_DONE;\n\t    if (err == IO_DONE) {\n\t\tchar addrstr[INET6_ADDRSTRLEN];\n\t\tlua_pushlstring(L, buffer, got);\n\t\tif (!my_inet_ntop(AF_INET6, &addr.sin6_addr,\n\t\t\taddrstr, sizeof(addrstr))) {\n\t\t    lua_pushnil(L);\n\t\t    lua_pushstring(L, \"invalid source address\");\n\t\t    return 2;\n\t\t}\n\t\tlua_pushstring(L, addrstr);\n\t\tlua_pushnumber(L, ntohs(addr.sin6_port));\n\t\treturn 3;\n\t    }\n\t    break;\n\t}\n    default:\n        lua_pushnil(L);\n        lua_pushfstring(L, \"unknown family %d\", udp->family);\n        return 2;\n    }\n    lua_pushnil(L);\n    lua_pushstring(L, udp_strerror(err));\n    return 2;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Returns family as string\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getfamily(lua_State *L)\n{\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    if (udp->family == PF_INET6) {\n        lua_pushliteral(L, \"inet6\");\n        return 1;\n    } else {\n        lua_pushliteral(L, \"inet4\");\n        return 1;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Select support methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getfd(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    lua_pushnumber(L, (int) udp->sock);\n    return 1;\n}\n\n/* this is very dangerous, but can be handy for those that are brave enough */\nstatic int meth_setfd(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    udp->sock = (t_socket) luaL_checknumber(L, 2);\n    return 0;\n}\n\nstatic int meth_dirty(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    (void) udp;\n    lua_pushboolean(L, 0);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call inet methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getpeername(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkclass(L, \"udp{connected}\", 1);\n    return inet_meth_getpeername(L, &udp->sock, udp->family);\n}\n\nstatic int meth_getsockname(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    return inet_meth_getsockname(L, &udp->sock, udp->family);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call option handler\n\\*-------------------------------------------------------------------------*/\nstatic int meth_setoption(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    return opt_meth_setoption(L, optset, &udp->sock);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call option handler\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getoption(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    return opt_meth_getoption(L, optget, &udp->sock);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call tm methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_settimeout(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    return timeout_meth_settimeout(L, &udp->tm);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Turns a master udp object into a client object.\n\\*-------------------------------------------------------------------------*/\nstatic int meth_setpeername(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    p_timeout tm = &udp->tm;\n    const char *address = luaL_checkstring(L, 2);\n    int connecting = strcmp(address, \"*\");\n    const char *port = connecting? luaL_checkstring(L, 3): \"0\";\n    struct addrinfo connecthints;\n    const char *err;\n    memset(&connecthints, 0, sizeof(connecthints));\n    connecthints.ai_socktype = SOCK_DGRAM;\n    /* make sure we try to connect only to the same family */\n    connecthints.ai_family = udp->family;\n    if (connecting) {\n        err = inet_tryconnect(&udp->sock, address, port, tm, &connecthints);\n        if (err) {\n            lua_pushnil(L);\n            lua_pushstring(L, err);\n            return 2;\n        }\n        auxiliar_setclass(L, \"udp{connected}\", 1);\n    } else {\n        /* we ignore possible errors because Mac OS X always\n         * returns EAFNOSUPPORT */\n        inet_trydisconnect(&udp->sock, udp->family, tm);\n        auxiliar_setclass(L, \"udp{unconnected}\", 1);\n    }\n    /* change class to connected or unconnected depending on address */\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Closes socket used by object\n\\*-------------------------------------------------------------------------*/\nstatic int meth_close(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkgroup(L, \"udp{any}\", 1);\n    socket_destroy(&udp->sock);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Turns a master object into a server object\n\\*-------------------------------------------------------------------------*/\nstatic int meth_setsockname(lua_State *L) {\n    p_udp udp = (p_udp) auxiliar_checkclass(L, \"udp{unconnected}\", 1);\n    const char *address =  luaL_checkstring(L, 2);\n    const char *port = luaL_checkstring(L, 3);\n    const char *err;\n\tstruct addrinfo bindhints;\n    memset(&bindhints, 0, sizeof(bindhints));\n    bindhints.ai_socktype = SOCK_DGRAM;\n    bindhints.ai_family = udp->family;\n    bindhints.ai_flags = AI_PASSIVE;\n    err = inet_trybind(&udp->sock, address, port, &bindhints);\n    if (err) {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*=========================================================================*\\\n* Library functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Creates a master udp object\n\\*-------------------------------------------------------------------------*/\nstatic int udp_create(lua_State *L, int family) {\n    t_socket sock;\n    const char *err = inet_trycreate(&sock, family, SOCK_DGRAM);\n    /* try to allocate a system socket */\n    if (!err) {\n        /* allocate udp object */\n        p_udp udp = (p_udp) lua_newuserdata(L, sizeof(t_udp));\n        auxiliar_setclass(L, \"udp{unconnected}\", -1);\n        /* initialize remaining structure fields */\n        socket_setnonblocking(&sock);\n        if (family == PF_INET6) {\n            int yes = 1;\n            setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,\n                (void *)&yes, sizeof(yes));\n        }\n        udp->sock = sock;\n        timeout_init(&udp->tm, -1, -1);\n        udp->family = family;\n        return 1;\n    } else {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n}\n\nstatic int global_create(lua_State *L) {\n\treturn udp_create(L, AF_INET);\n}\n\nstatic int global_create6(lua_State *L) {\n\treturn udp_create(L, AF_INET6);\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/udp.h",
    "content": "#ifndef UDP_H\n#define UDP_H\n/*=========================================================================*\\\n* UDP object\n* LuaSocket toolkit\n*\n* The udp.h module provides LuaSocket with support for UDP protocol\n* (AF_INET, SOCK_DGRAM).\n*\n* Two classes are defined: connected and unconnected. UDP objects are\n* originally unconnected. They can be \"connected\" to a given address \n* with a call to the setpeername function. The same function can be used to\n* break the connection.\n\\*=========================================================================*/\n#include \"lua.h\"\n\n#include \"timeout.h\"\n#include \"socket.h\"\n\n/* can't be larger than wsocket.c MAXCHUNK!!! */\n#define UDP_DATAGRAMSIZE 8192\n\ntypedef struct t_udp_ {\n    t_socket sock;\n    t_timeout tm;\n    int family;\n} t_udp;\ntypedef t_udp *p_udp;\n\nint udp_open(lua_State *L);\n\n#endif /* UDP_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/unix.c",
    "content": "/*=========================================================================*\\\n* Unix domain socket \n* LuaSocket toolkit\n\\*=========================================================================*/\n#include <string.h> \n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"auxiliar.h\"\n#include \"socket.h\"\n#include \"options.h\"\n#include \"unix.h\"\n#include <sys/un.h> \n\n/*=========================================================================*\\\n* Internal function prototypes\n\\*=========================================================================*/\nstatic int global_create(lua_State *L);\nstatic int meth_connect(lua_State *L);\nstatic int meth_listen(lua_State *L);\nstatic int meth_bind(lua_State *L);\nstatic int meth_send(lua_State *L);\nstatic int meth_shutdown(lua_State *L);\nstatic int meth_receive(lua_State *L);\nstatic int meth_accept(lua_State *L);\nstatic int meth_close(lua_State *L);\nstatic int meth_setoption(lua_State *L);\nstatic int meth_settimeout(lua_State *L);\nstatic int meth_getfd(lua_State *L);\nstatic int meth_setfd(lua_State *L);\nstatic int meth_dirty(lua_State *L);\nstatic int meth_getstats(lua_State *L);\nstatic int meth_setstats(lua_State *L);\n\nstatic const char *unix_tryconnect(p_unix un, const char *path);\nstatic const char *unix_trybind(p_unix un, const char *path);\n\n/* unix object methods */\nstatic luaL_Reg unix_methods[] = {\n    {\"__gc\",        meth_close},\n    {\"__tostring\",  auxiliar_tostring},\n    {\"accept\",      meth_accept},\n    {\"bind\",        meth_bind},\n    {\"close\",       meth_close},\n    {\"connect\",     meth_connect},\n    {\"dirty\",       meth_dirty},\n    {\"getfd\",       meth_getfd},\n    {\"getstats\",    meth_getstats},\n    {\"setstats\",    meth_setstats},\n    {\"listen\",      meth_listen},\n    {\"receive\",     meth_receive},\n    {\"send\",        meth_send},\n    {\"setfd\",       meth_setfd},\n    {\"setoption\",   meth_setoption},\n    {\"setpeername\", meth_connect},\n    {\"setsockname\", meth_bind},\n    {\"settimeout\",  meth_settimeout},\n    {\"shutdown\",    meth_shutdown},\n    {NULL,          NULL}\n};\n\n/* socket option handlers */\nstatic t_opt optset[] = {\n    {\"keepalive\",   opt_set_keepalive},\n    {\"reuseaddr\",   opt_set_reuseaddr},\n    {\"linger\",      opt_set_linger},\n    {NULL,          NULL}\n};\n\n/* our socket creation function */\nstatic luaL_Reg func[] = {\n    {\"unix\", global_create},\n    {NULL,          NULL}\n};\n\n\n/*-------------------------------------------------------------------------*\\\n* Initializes module\n\\*-------------------------------------------------------------------------*/\nint luaopen_socket_unix(lua_State *L) {\n    /* create classes */\n    auxiliar_newclass(L, \"unix{master}\", unix_methods);\n    auxiliar_newclass(L, \"unix{client}\", unix_methods);\n    auxiliar_newclass(L, \"unix{server}\", unix_methods);\n    /* create class groups */\n    auxiliar_add2group(L, \"unix{master}\", \"unix{any}\");\n    auxiliar_add2group(L, \"unix{client}\", \"unix{any}\");\n    auxiliar_add2group(L, \"unix{server}\", \"unix{any}\");\n    /* make sure the function ends up in the package table */\n    luaL_openlib(L, \"socket\", func, 0);\n    /* return the function instead of the 'socket' table */\n    lua_pushstring(L, \"unix\");\n    lua_gettable(L, -2);\n    return 1;\n}\n\n/*=========================================================================*\\\n* Lua methods\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Just call buffered IO methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_send(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"unix{client}\", 1);\n    return buffer_meth_send(L, &un->buf);\n}\n\nstatic int meth_receive(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"unix{client}\", 1);\n    return buffer_meth_receive(L, &un->buf);\n}\n\nstatic int meth_getstats(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"unix{client}\", 1);\n    return buffer_meth_getstats(L, &un->buf);\n}\n\nstatic int meth_setstats(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"unix{client}\", 1);\n    return buffer_meth_setstats(L, &un->buf);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call option handler\n\\*-------------------------------------------------------------------------*/\nstatic int meth_setoption(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"unix{any}\", 1);\n    return opt_meth_setoption(L, optset, &un->sock);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Select support methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_getfd(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"unix{any}\", 1);\n    lua_pushnumber(L, (int) un->sock);\n    return 1;\n}\n\n/* this is very dangerous, but can be handy for those that are brave enough */\nstatic int meth_setfd(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"unix{any}\", 1);\n    un->sock = (t_socket) luaL_checknumber(L, 2); \n    return 0;\n}\n\nstatic int meth_dirty(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"unix{any}\", 1);\n    lua_pushboolean(L, !buffer_isempty(&un->buf));\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Waits for and returns a client object attempting connection to the \n* server object \n\\*-------------------------------------------------------------------------*/\nstatic int meth_accept(lua_State *L) {\n    p_unix server = (p_unix) auxiliar_checkclass(L, \"unix{server}\", 1);\n    p_timeout tm = timeout_markstart(&server->tm);\n    t_socket sock;\n    int err = socket_accept(&server->sock, &sock, NULL, NULL, tm);\n    /* if successful, push client socket */\n    if (err == IO_DONE) {\n        p_unix clnt = (p_unix) lua_newuserdata(L, sizeof(t_unix));\n        auxiliar_setclass(L, \"unix{client}\", -1);\n        /* initialize structure fields */\n        socket_setnonblocking(&sock);\n        clnt->sock = sock;\n        io_init(&clnt->io, (p_send)socket_send, (p_recv)socket_recv, \n                (p_error) socket_ioerror, &clnt->sock);\n        timeout_init(&clnt->tm, -1, -1);\n        buffer_init(&clnt->buf, &clnt->io, &clnt->tm);\n        return 1;\n    } else {\n        lua_pushnil(L); \n        lua_pushstring(L, socket_strerror(err));\n        return 2;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Binds an object to an address \n\\*-------------------------------------------------------------------------*/\nstatic const char *unix_trybind(p_unix un, const char *path) {\n    struct sockaddr_un local;\n    size_t len = strlen(path);\n    int err;\n    if (len >= sizeof(local.sun_path)) return \"path too long\";\n    memset(&local, 0, sizeof(local));\n    strcpy(local.sun_path, path);\n    local.sun_family = AF_UNIX;\n#ifdef UNIX_HAS_SUN_LEN\n    local.sun_len = sizeof(local.sun_family) + sizeof(local.sun_len) \n        + len + 1;\n    err = socket_bind(&un->sock, (SA *) &local, local.sun_len);\n\n#else \n    err = socket_bind(&un->sock, (SA *) &local, \n            (socklen_t)(sizeof(local.sun_family) + len));\n#endif\n    if (err != IO_DONE) socket_destroy(&un->sock);\n    return socket_strerror(err); \n}\n\nstatic int meth_bind(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"unix{master}\", 1);\n    const char *path =  luaL_checkstring(L, 2);\n    const char *err = unix_trybind(un, path);\n    if (err) {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Turns a master unix object into a client object.\n\\*-------------------------------------------------------------------------*/\nstatic const char *unix_tryconnect(p_unix un, const char *path)\n{\n    struct sockaddr_un remote;\n    int err;\n    size_t len = strlen(path);\n    if (len >= sizeof(remote.sun_path)) return \"path too long\";\n    memset(&remote, 0, sizeof(remote));\n    strcpy(remote.sun_path, path);\n    remote.sun_family = AF_UNIX;\n    timeout_markstart(&un->tm);\n#ifdef UNIX_HAS_SUN_LEN\n    remote.sun_len = sizeof(remote.sun_family) + sizeof(remote.sun_len) \n        + len + 1;\n    err = socket_connect(&un->sock, (SA *) &remote, remote.sun_len, &un->tm);\n#else\n    err = socket_connect(&un->sock, (SA *) &remote, \n            (socklen_t)(sizeof(remote.sun_family) + len), &un->tm);\n#endif\n    if (err != IO_DONE) socket_destroy(&un->sock);\n    return socket_strerror(err);\n}\n\nstatic int meth_connect(lua_State *L)\n{\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"unix{master}\", 1);\n    const char *path =  luaL_checkstring(L, 2);\n    const char *err = unix_tryconnect(un, path);\n    if (err) {\n        lua_pushnil(L);\n        lua_pushstring(L, err);\n        return 2;\n    }\n    /* turn master object into a client object */\n    auxiliar_setclass(L, \"unix{client}\", 1);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Closes socket used by object \n\\*-------------------------------------------------------------------------*/\nstatic int meth_close(lua_State *L)\n{\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"unix{any}\", 1);\n    socket_destroy(&un->sock);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Puts the sockt in listen mode\n\\*-------------------------------------------------------------------------*/\nstatic int meth_listen(lua_State *L)\n{\n    p_unix un = (p_unix) auxiliar_checkclass(L, \"unix{master}\", 1);\n    int backlog = (int) luaL_optnumber(L, 2, 32);\n    int err = socket_listen(&un->sock, backlog);\n    if (err != IO_DONE) {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_strerror(err));\n        return 2;\n    }\n    /* turn master object into a server object */\n    auxiliar_setclass(L, \"unix{server}\", 1);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Shuts the connection down partially\n\\*-------------------------------------------------------------------------*/\nstatic int meth_shutdown(lua_State *L)\n{\n    /* SHUT_RD,  SHUT_WR,  SHUT_RDWR  have  the value 0, 1, 2, so we can use method index directly */\n    static const char* methods[] = { \"receive\", \"send\", \"both\", NULL };\n    p_unix tcp = (p_unix) auxiliar_checkclass(L, \"unix{client}\", 1);\n    int how = luaL_checkoption(L, 2, \"both\", methods);\n    socket_shutdown(&tcp->sock, how);\n    lua_pushnumber(L, 1);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Just call tm methods\n\\*-------------------------------------------------------------------------*/\nstatic int meth_settimeout(lua_State *L) {\n    p_unix un = (p_unix) auxiliar_checkgroup(L, \"unix{any}\", 1);\n    return timeout_meth_settimeout(L, &un->tm);\n}\n\n/*=========================================================================*\\\n* Library functions\n\\*=========================================================================*/\n/*-------------------------------------------------------------------------*\\\n* Creates a master unix object \n\\*-------------------------------------------------------------------------*/\nstatic int global_create(lua_State *L) {\n    t_socket sock;\n    int err = socket_create(&sock, AF_UNIX, SOCK_STREAM, 0);\n    /* try to allocate a system socket */\n    if (err == IO_DONE) { \n        /* allocate unix object */\n        p_unix un = (p_unix) lua_newuserdata(L, sizeof(t_unix));\n        /* set its type as master object */\n        auxiliar_setclass(L, \"unix{master}\", -1);\n        /* initialize remaining structure fields */\n        socket_setnonblocking(&sock);\n        un->sock = sock;\n        io_init(&un->io, (p_send) socket_send, (p_recv) socket_recv, \n                (p_error) socket_ioerror, &un->sock);\n        timeout_init(&un->tm, -1, -1);\n        buffer_init(&un->buf, &un->io, &un->tm);\n        return 1;\n    } else {\n        lua_pushnil(L);\n        lua_pushstring(L, socket_strerror(err));\n        return 2;\n    }\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/unix.h",
    "content": "#ifndef UNIX_H\n#define UNIX_H\n/*=========================================================================*\\\n* Unix domain object\n* LuaSocket toolkit\n*\n* This module is just an example of how to extend LuaSocket with a new \n* domain.\n\\*=========================================================================*/\n#include \"lua.h\"\n#include \"luasocket.h\"\n#include \"luasocket_buffer.h\"\n#include \"timeout.h\"\n#include \"socket.h\"\n\ntypedef struct t_unix_ {\n    t_socket sock;\n    t_io io;\n    t_buffer buf;\n    t_timeout tm;\n} t_unix;\ntypedef t_unix *p_unix;\n\nLUASOCKET_API int luaopen_socket_unix(lua_State *L);\n\n#endif /* UNIX_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/usocket.c",
    "content": "/*=========================================================================*\\\n* Socket compatibilization module for Unix\n* LuaSocket toolkit\n*\n* The code is now interrupt-safe.\n* The penalty of calling select to avoid busy-wait is only paid when\n* the I/O call fail in the first place. \n\\*=========================================================================*/\n#include <string.h> \n#include <signal.h>\n\n#include \"socket.h\"\n\n/*-------------------------------------------------------------------------*\\\n* Wait for readable/writable/connected socket with timeout\n\\*-------------------------------------------------------------------------*/\n#ifndef SOCKET_SELECT\n#include <sys/poll.h>\n\n#define WAITFD_R        POLLIN\n#define WAITFD_W        POLLOUT\n#define WAITFD_C        (POLLIN|POLLOUT)\nint socket_waitfd(p_socket ps, int sw, p_timeout tm) {\n    int ret;\n    struct pollfd pfd;\n    pfd.fd = *ps;\n    pfd.events = sw;\n    pfd.revents = 0;\n    if (timeout_iszero(tm)) return IO_TIMEOUT;  /* optimize timeout == 0 case */\n    do {\n        int t = (int)(timeout_getretry(tm)*1e3);\n        ret = poll(&pfd, 1, t >= 0? t: -1);\n    } while (ret == -1 && errno == EINTR);\n    if (ret == -1) return errno;\n    if (ret == 0) return IO_TIMEOUT;\n    if (sw == WAITFD_C && (pfd.revents & (POLLIN|POLLERR))) return IO_CLOSED;\n    return IO_DONE;\n}\n#else\n\n#define WAITFD_R        1\n#define WAITFD_W        2\n#define WAITFD_C        (WAITFD_R|WAITFD_W)\n\nint socket_waitfd(p_socket ps, int sw, p_timeout tm) {\n    int ret;\n    fd_set rfds, wfds, *rp, *wp;\n    struct timeval tv, *tp;\n    double t;\n    if (*ps >= FD_SETSIZE) return EINVAL;\n    if (timeout_iszero(tm)) return IO_TIMEOUT;  /* optimize timeout == 0 case */\n    do {\n        /* must set bits within loop, because select may have modifed them */\n        rp = wp = NULL;\n        if (sw & WAITFD_R) { FD_ZERO(&rfds); FD_SET(*ps, &rfds); rp = &rfds; }\n        if (sw & WAITFD_W) { FD_ZERO(&wfds); FD_SET(*ps, &wfds); wp = &wfds; }\n        t = timeout_getretry(tm);\n        tp = NULL;\n        if (t >= 0.0) {\n            tv.tv_sec = (int)t;\n            tv.tv_usec = (int)((t-tv.tv_sec)*1.0e6);\n            tp = &tv;\n        }\n        ret = select(*ps+1, rp, wp, NULL, tp);\n    } while (ret == -1 && errno == EINTR);\n    if (ret == -1) return errno;\n    if (ret == 0) return IO_TIMEOUT;\n    if (sw == WAITFD_C && FD_ISSET(*ps, &rfds)) return IO_CLOSED;\n    return IO_DONE;\n}\n#endif\n\n\n/*-------------------------------------------------------------------------*\\\n* Initializes module \n\\*-------------------------------------------------------------------------*/\nint socket_open(void) {\n    /* instals a handler to ignore sigpipe or it will crash us */\n    signal(SIGPIPE, SIG_IGN);\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Close module \n\\*-------------------------------------------------------------------------*/\nint socket_close(void) {\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Close and inutilize socket\n\\*-------------------------------------------------------------------------*/\nvoid socket_destroy(p_socket ps) {\n    if (*ps != SOCKET_INVALID) {\n        socket_setblocking(ps);\n        close(*ps);\n        *ps = SOCKET_INVALID;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Select with timeout control\n\\*-------------------------------------------------------------------------*/\nint socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, \n        p_timeout tm) {\n    int ret;\n    do {\n        struct timeval tv;\n        double t = timeout_getretry(tm);\n        tv.tv_sec = (int) t;\n        tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);\n        /* timeout = 0 means no wait */\n        ret = select(n, rfds, wfds, efds, t >= 0.0 ? &tv: NULL);\n    } while (ret < 0 && errno == EINTR);\n    return ret;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Creates and sets up a socket\n\\*-------------------------------------------------------------------------*/\nint socket_create(p_socket ps, int domain, int type, int protocol) {\n    *ps = socket(domain, type, protocol);\n    if (*ps != SOCKET_INVALID) return IO_DONE; \n    else return errno; \n}\n\n/*-------------------------------------------------------------------------*\\\n* Binds or returns error message\n\\*-------------------------------------------------------------------------*/\nint socket_bind(p_socket ps, SA *addr, socklen_t len) {\n    int err = IO_DONE;\n    socket_setblocking(ps);\n    if (bind(*ps, addr, len) < 0) err = errno; \n    socket_setnonblocking(ps);\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* \n\\*-------------------------------------------------------------------------*/\nint socket_listen(p_socket ps, int backlog) {\n    int err = IO_DONE; \n    socket_setblocking(ps);\n    if (listen(*ps, backlog)) err = errno; \n    socket_setnonblocking(ps);\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* \n\\*-------------------------------------------------------------------------*/\nvoid socket_shutdown(p_socket ps, int how) {\n    socket_setblocking(ps);\n    shutdown(*ps, how);\n    socket_setnonblocking(ps);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Connects or returns error message\n\\*-------------------------------------------------------------------------*/\nint socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) {\n    int err;\n    /* avoid calling on closed sockets */\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    /* call connect until done or failed without being interrupted */\n    do if (connect(*ps, addr, len) == 0) return IO_DONE;\n    while ((err = errno) == EINTR);\n    /* if connection failed immediately, return error code */\n    if (err != EINPROGRESS && err != EAGAIN) return err; \n    /* zero timeout case optimization */\n    if (timeout_iszero(tm)) return IO_TIMEOUT;\n    /* wait until we have the result of the connection attempt or timeout */\n    err = socket_waitfd(ps, WAITFD_C, tm);\n    if (err == IO_CLOSED) {\n        if (recv(*ps, (char *) &err, 0, 0) == 0) return IO_DONE;\n        else return errno;\n    } else return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Accept with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len, p_timeout tm) {\n    if (*ps == SOCKET_INVALID) return IO_CLOSED; \n    for ( ;; ) {\n        int err;\n        if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID) return IO_DONE;\n        err = errno;\n        if (err == EINTR) continue;\n        if (err != EAGAIN && err != ECONNABORTED) return err;\n        if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;\n    }\n    /* can't reach here */\n    return IO_UNKNOWN;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Send with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_send(p_socket ps, const char *data, size_t count, \n        size_t *sent, p_timeout tm)\n{\n    int err;\n    *sent = 0;\n    /* avoid making system calls on closed sockets */\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    /* loop until we send something or we give up on error */\n    for ( ;; ) {\n        long put = (long) send(*ps, data, count, 0);\n        /* if we sent anything, we are done */\n        if (put >= 0) {\n            *sent = put;\n            return IO_DONE;\n        }\n        err = errno;\n        /* EPIPE means the connection was closed */\n        if (err == EPIPE) return IO_CLOSED;\n        /* we call was interrupted, just try again */\n        if (err == EINTR) continue;\n        /* if failed fatal reason, report error */\n        if (err != EAGAIN) return err;\n        /* wait until we can send something or we timeout */\n        if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;\n    }\n    /* can't reach here */\n    return IO_UNKNOWN;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Sendto with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent, \n        SA *addr, socklen_t len, p_timeout tm)\n{\n    int err;\n    *sent = 0;\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        long put = (long) sendto(*ps, data, count, 0, addr, len);  \n        if (put >= 0) {\n            *sent = put;\n            return IO_DONE;\n        }\n        err = errno;\n        if (err == EPIPE) return IO_CLOSED;\n        if (err == EINTR) continue;\n        if (err != EAGAIN) return err;\n        if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;\n    }\n    return IO_UNKNOWN;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Receive with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm) {\n    int err;\n    *got = 0;\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        long taken = (long) recv(*ps, data, count, 0);\n        if (taken > 0) {\n            *got = taken;\n            return IO_DONE;\n        }\n        err = errno;\n        if (taken == 0) return IO_CLOSED;\n        if (err == EINTR) continue;\n        if (err != EAGAIN) return err; \n        if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; \n    }\n    return IO_UNKNOWN;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Recvfrom with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, \n        SA *addr, socklen_t *len, p_timeout tm) {\n    int err;\n    *got = 0;\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        long taken = (long) recvfrom(*ps, data, count, 0, addr, len);\n        if (taken > 0) {\n            *got = taken;\n            return IO_DONE;\n        }\n        err = errno;\n        if (taken == 0) return IO_CLOSED;\n        if (err == EINTR) continue;\n        if (err != EAGAIN) return err; \n        if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; \n    }\n    return IO_UNKNOWN;\n}\n\n\n/*-------------------------------------------------------------------------*\\\n* Write with timeout\n*\n* socket_read and socket_write are cut-n-paste of socket_send and socket_recv,\n* with send/recv replaced with write/read. We can't just use write/read\n* in the socket version, because behaviour when size is zero is different.\n\\*-------------------------------------------------------------------------*/\nint socket_write(p_socket ps, const char *data, size_t count, \n        size_t *sent, p_timeout tm)\n{\n    int err;\n    *sent = 0;\n    /* avoid making system calls on closed sockets */\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    /* loop until we send something or we give up on error */\n    for ( ;; ) {\n        long put = (long) write(*ps, data, count);\n        /* if we sent anything, we are done */\n        if (put >= 0) {\n            *sent = put;\n            return IO_DONE;\n        }\n        err = errno;\n        /* EPIPE means the connection was closed */\n        if (err == EPIPE) return IO_CLOSED;\n        /* we call was interrupted, just try again */\n        if (err == EINTR) continue;\n        /* if failed fatal reason, report error */\n        if (err != EAGAIN) return err;\n        /* wait until we can send something or we timeout */\n        if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;\n    }\n    /* can't reach here */\n    return IO_UNKNOWN;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Read with timeout\n* See note for socket_write\n\\*-------------------------------------------------------------------------*/\nint socket_read(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm) {\n    int err;\n    *got = 0;\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        long taken = (long) read(*ps, data, count);\n        if (taken > 0) {\n            *got = taken;\n            return IO_DONE;\n        }\n        err = errno;\n        if (taken == 0) return IO_CLOSED;\n        if (err == EINTR) continue;\n        if (err != EAGAIN) return err; \n        if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err; \n    }\n    return IO_UNKNOWN;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Put socket into blocking mode\n\\*-------------------------------------------------------------------------*/\nvoid socket_setblocking(p_socket ps) {\n    int flags = fcntl(*ps, F_GETFL, 0);\n    flags &= (~(O_NONBLOCK));\n    fcntl(*ps, F_SETFL, flags);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Put socket into non-blocking mode\n\\*-------------------------------------------------------------------------*/\nvoid socket_setnonblocking(p_socket ps) {\n    int flags = fcntl(*ps, F_GETFL, 0);\n    flags |= O_NONBLOCK;\n    fcntl(*ps, F_SETFL, flags);\n}\n\n/*-------------------------------------------------------------------------*\\\n* DNS helpers \n\\*-------------------------------------------------------------------------*/\nint socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp) {\n    *hp = gethostbyaddr(addr, len, AF_INET);\n    if (*hp) return IO_DONE;\n    else if (h_errno) return h_errno;\n    else if (errno) return errno;\n    else return IO_UNKNOWN;\n}\n\nint socket_gethostbyname(const char *addr, struct hostent **hp) {\n    *hp = gethostbyname(addr);\n    if (*hp) return IO_DONE;\n    else if (h_errno) return h_errno;\n    else if (errno) return errno;\n    else return IO_UNKNOWN;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Error translation functions\n* Make sure important error messages are standard\n\\*-------------------------------------------------------------------------*/\nconst char *socket_hoststrerror(int err) {\n    if (err <= 0) return io_strerror(err);\n    switch (err) {\n        case HOST_NOT_FOUND: return \"host not found\";\n        default: return hstrerror(err);\n    }\n}\n\nconst char *socket_strerror(int err) {\n    if (err <= 0) return io_strerror(err);\n    switch (err) {\n        case EADDRINUSE: return \"address already in use\";\n        case EISCONN: return \"already connected\";\n        case EACCES: return \"permission denied\";\n        case ECONNREFUSED: return \"connection refused\";\n        case ECONNABORTED: return \"closed\";\n        case ECONNRESET: return \"closed\";\n        case ETIMEDOUT: return \"timeout\";\n        default: return strerror(err);\n    }\n}\n\nconst char *socket_ioerror(p_socket ps, int err) {\n    (void) ps;\n    return socket_strerror(err);\n} \n\nconst char *socket_gaistrerror(int err) {\n    if (err == 0) return NULL; \n    switch (err) {\n        case EAI_AGAIN: return \"temporary failure in name resolution\";\n        case EAI_BADFLAGS: return \"invalid value for ai_flags\";\n#ifdef EAI_BADHINTS\n        case EAI_BADHINTS: return \"invalid value for hints\";\n#endif\n        case EAI_FAIL: return \"non-recoverable failure in name resolution\";\n        case EAI_FAMILY: return \"ai_family not supported\";\n        case EAI_MEMORY: return \"memory allocation failure\";\n        case EAI_NONAME: \n            return \"host or service not provided, or not known\";\n        case EAI_OVERFLOW: return \"argument buffer overflow\";\n#ifdef EAI_PROTOCOL\n        case EAI_PROTOCOL: return \"resolved protocol is unknown\";\n#endif\n        case EAI_SERVICE: return \"service not supported for socket type\";\n        case EAI_SOCKTYPE: return \"ai_socktype not supported\";\n        case EAI_SYSTEM: return strerror(errno); \n        default: return gai_strerror(err);\n    }\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/usocket.h",
    "content": "#ifndef USOCKET_H\n#define USOCKET_H\n/*=========================================================================*\\\n* Socket compatibilization module for Unix\n* LuaSocket toolkit\n\\*=========================================================================*/\n\n/*=========================================================================*\\\n* BSD include files\n\\*=========================================================================*/\n/* error codes */\n#include <errno.h>\n/* close function */\n#include <unistd.h>\n/* fnctnl function and associated constants */\n#include <fcntl.h>\n/* struct sockaddr */\n#include <sys/types.h>\n/* socket function */\n#include <sys/socket.h>\n/* struct timeval */\n#include <sys/time.h>\n/* gethostbyname and gethostbyaddr functions */\n#include <netdb.h>\n/* sigpipe handling */\n#include <signal.h>\n/* IP stuff*/\n#include <netinet/in.h>\n#include <arpa/inet.h>\n/* TCP options (nagle algorithm disable) */\n#include <netinet/tcp.h>\n\n#ifndef SO_REUSEPORT\n#define SO_REUSEPORT SO_REUSEADDR\n#endif\n\ntypedef int t_socket;\ntypedef t_socket *p_socket;\ntypedef struct sockaddr_storage t_sockaddr_storage;\n\n#define SOCKET_INVALID (-1)\n\n#endif /* USOCKET_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/wsocket.c",
    "content": "/*=========================================================================*\\\n* Socket compatibilization module for Win32\n* LuaSocket toolkit\n*\n* The penalty of calling select to avoid busy-wait is only paid when\n* the I/O call fail in the first place. \n\\*=========================================================================*/\n#include <string.h>\n\n#include \"socket.h\"\n\n/* WinSock doesn't have a strerror... */\nstatic const char *wstrerror(int err);\n\n/*-------------------------------------------------------------------------*\\\n* Initializes module \n\\*-------------------------------------------------------------------------*/\nint socket_open(void) {\n    WSADATA wsaData;\n    WORD wVersionRequested = MAKEWORD(2, 0); \n    int err = WSAStartup(wVersionRequested, &wsaData );\n    if (err != 0) return 0;\n    if ((LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 0) &&\n        (LOBYTE(wsaData.wVersion) != 1 || HIBYTE(wsaData.wVersion) != 1)) {\n        WSACleanup();\n        return 0; \n    }\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Close module \n\\*-------------------------------------------------------------------------*/\nint socket_close(void) {\n    WSACleanup();\n    return 1;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Wait for readable/writable/connected socket with timeout\n\\*-------------------------------------------------------------------------*/\n#define WAITFD_R        1\n#define WAITFD_W        2\n#define WAITFD_E        4\n#define WAITFD_C        (WAITFD_E|WAITFD_W)\n\nint socket_waitfd(p_socket ps, int sw, p_timeout tm) {\n    int ret;\n    fd_set rfds, wfds, efds, *rp = NULL, *wp = NULL, *ep = NULL;\n    struct timeval tv, *tp = NULL;\n    double t;\n    if (timeout_iszero(tm)) return IO_TIMEOUT;  /* optimize timeout == 0 case */\n    if (sw & WAITFD_R) { \n        FD_ZERO(&rfds); \n        FD_SET(*ps, &rfds);\n        rp = &rfds; \n    }\n    if (sw & WAITFD_W) { FD_ZERO(&wfds); FD_SET(*ps, &wfds); wp = &wfds; }\n    if (sw & WAITFD_C) { FD_ZERO(&efds); FD_SET(*ps, &efds); ep = &efds; }\n    if ((t = timeout_get(tm)) >= 0.0) {\n        tv.tv_sec = (int) t;\n        tv.tv_usec = (int) ((t-tv.tv_sec)*1.0e6);\n        tp = &tv;\n    }\n    ret = select(0, rp, wp, ep, tp);\n    if (ret == -1) return WSAGetLastError();\n    if (ret == 0) return IO_TIMEOUT;\n    if (sw == WAITFD_C && FD_ISSET(*ps, &efds)) return IO_CLOSED;\n    return IO_DONE;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Select with int timeout in ms\n\\*-------------------------------------------------------------------------*/\nint socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, \n        p_timeout tm) {\n    struct timeval tv; \n    double t = timeout_get(tm);\n    tv.tv_sec = (int) t;\n    tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);\n    if (n <= 0) {\n        Sleep((DWORD) (1000*t));\n        return 0;\n    } else return select(0, rfds, wfds, efds, t >= 0.0? &tv: NULL);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Close and inutilize socket\n\\*-------------------------------------------------------------------------*/\nvoid socket_destroy(p_socket ps) {\n    if (*ps != SOCKET_INVALID) {\n        socket_setblocking(ps); /* close can take a long time on WIN32 */\n        closesocket(*ps);\n        *ps = SOCKET_INVALID;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* \n\\*-------------------------------------------------------------------------*/\nvoid socket_shutdown(p_socket ps, int how) {\n    socket_setblocking(ps);\n    shutdown(*ps, how);\n    socket_setnonblocking(ps);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Creates and sets up a socket\n\\*-------------------------------------------------------------------------*/\nint socket_create(p_socket ps, int domain, int type, int protocol) {\n    *ps = socket(domain, type, protocol);\n    if (*ps != SOCKET_INVALID) return IO_DONE;\n    else return WSAGetLastError();\n}\n\n/*-------------------------------------------------------------------------*\\\n* Connects or returns error message\n\\*-------------------------------------------------------------------------*/\nint socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) {\n    int err;\n    /* don't call on closed socket */\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    /* ask system to connect */\n    if (connect(*ps, addr, len) == 0) return IO_DONE;\n    /* make sure the system is trying to connect */\n    err = WSAGetLastError();\n    if (err != WSAEWOULDBLOCK && err != WSAEINPROGRESS) return err;\n    /* zero timeout case optimization */\n    if (timeout_iszero(tm)) return IO_TIMEOUT;\n    /* we wait until something happens */\n    err = socket_waitfd(ps, WAITFD_C, tm);\n    if (err == IO_CLOSED) {\n        int len = sizeof(err);\n        /* give windows time to set the error (yes, disgusting) */\n        Sleep(10);\n        /* find out why we failed */\n        getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &len); \n        /* we KNOW there was an error. if 'why' is 0, we will return\n        * \"unknown error\", but it's not really our fault */\n        return err > 0? err: IO_UNKNOWN; \n    } else return err;\n\n}\n\n/*-------------------------------------------------------------------------*\\\n* Binds or returns error message\n\\*-------------------------------------------------------------------------*/\nint socket_bind(p_socket ps, SA *addr, socklen_t len) {\n    int err = IO_DONE;\n    socket_setblocking(ps);\n    if (bind(*ps, addr, len) < 0) err = WSAGetLastError();\n    socket_setnonblocking(ps);\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* \n\\*-------------------------------------------------------------------------*/\nint socket_listen(p_socket ps, int backlog) {\n    int err = IO_DONE;\n    socket_setblocking(ps);\n    if (listen(*ps, backlog) < 0) err = WSAGetLastError();\n    socket_setnonblocking(ps);\n    return err;\n}\n\n/*-------------------------------------------------------------------------*\\\n* Accept with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *len, \n        p_timeout tm) {\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        int err;\n        /* try to get client socket */\n        if ((*pa = accept(*ps, addr, len)) != SOCKET_INVALID) return IO_DONE;\n        /* find out why we failed */\n        err = WSAGetLastError(); \n        /* if we failed because there was no connectoin, keep trying */\n        if (err != WSAEWOULDBLOCK && err != WSAECONNABORTED) return err;\n        /* call select to avoid busy wait */\n        if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;\n    } \n}\n\n/*-------------------------------------------------------------------------*\\\n* Send with timeout\n* On windows, if you try to send 10MB, the OS will buffer EVERYTHING \n* this can take an awful lot of time and we will end up blocked. \n* Therefore, whoever calls this function should not pass a huge buffer.\n\\*-------------------------------------------------------------------------*/\nint socket_send(p_socket ps, const char *data, size_t count, \n        size_t *sent, p_timeout tm)\n{\n    int err;\n    *sent = 0;\n    /* avoid making system calls on closed sockets */\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    /* loop until we send something or we give up on error */\n    for ( ;; ) {\n        /* try to send something */\n        int put = send(*ps, data, (int) count, 0);\n        /* if we sent something, we are done */\n        if (put > 0) {\n            *sent = put;\n            return IO_DONE;\n        }\n        /* deal with failure */\n        err = WSAGetLastError(); \n        /* we can only proceed if there was no serious error */\n        if (err != WSAEWOULDBLOCK) return err;\n        /* avoid busy wait */\n        if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;\n    } \n}\n\n/*-------------------------------------------------------------------------*\\\n* Sendto with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent, \n        SA *addr, socklen_t len, p_timeout tm)\n{\n    int err;\n    *sent = 0;\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        int put = sendto(*ps, data, (int) count, 0, addr, len);\n        if (put > 0) {\n            *sent = put;\n            return IO_DONE;\n        }\n        err = WSAGetLastError(); \n        if (err != WSAEWOULDBLOCK) return err;\n        if ((err = socket_waitfd(ps, WAITFD_W, tm)) != IO_DONE) return err;\n    } \n}\n\n/*-------------------------------------------------------------------------*\\\n* Receive with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm) {\n    int err;\n    *got = 0;\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        int taken = recv(*ps, data, (int) count, 0);\n        if (taken > 0) {\n            *got = taken;\n            return IO_DONE;\n        }\n        if (taken == 0) return IO_CLOSED;\n        err = WSAGetLastError();\n        if (err != WSAEWOULDBLOCK) return err;\n        if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Recvfrom with timeout\n\\*-------------------------------------------------------------------------*/\nint socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, \n        SA *addr, socklen_t *len, p_timeout tm) {\n    int err;\n    *got = 0;\n    if (*ps == SOCKET_INVALID) return IO_CLOSED;\n    for ( ;; ) {\n        int taken = recvfrom(*ps, data, (int) count, 0, addr, len);\n        if (taken > 0) {\n            *got = taken;\n            return IO_DONE;\n        }\n        if (taken == 0) return IO_CLOSED;\n        err = WSAGetLastError();\n        if (err != WSAEWOULDBLOCK) return err;\n        if ((err = socket_waitfd(ps, WAITFD_R, tm)) != IO_DONE) return err;\n    }\n}\n\n/*-------------------------------------------------------------------------*\\\n* Put socket into blocking mode\n\\*-------------------------------------------------------------------------*/\nvoid socket_setblocking(p_socket ps) {\n    u_long argp = 0;\n    ioctlsocket(*ps, FIONBIO, &argp);\n}\n\n/*-------------------------------------------------------------------------*\\\n* Put socket into non-blocking mode\n\\*-------------------------------------------------------------------------*/\nvoid socket_setnonblocking(p_socket ps) {\n    u_long argp = 1;\n    ioctlsocket(*ps, FIONBIO, &argp);\n}\n\n/*-------------------------------------------------------------------------*\\\n* DNS helpers \n\\*-------------------------------------------------------------------------*/\nint socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp) {\n    *hp = gethostbyaddr(addr, len, AF_INET);\n    if (*hp) return IO_DONE;\n    else return WSAGetLastError();\n}\n\nint socket_gethostbyname(const char *addr, struct hostent **hp) {\n    *hp = gethostbyname(addr);\n    if (*hp) return IO_DONE;\n    else return  WSAGetLastError();\n}\n\n/*-------------------------------------------------------------------------*\\\n* Error translation functions\n\\*-------------------------------------------------------------------------*/\nconst char *socket_hoststrerror(int err) {\n    if (err <= 0) return io_strerror(err);\n    switch (err) {\n        case WSAHOST_NOT_FOUND: return \"host not found\";\n        default: return wstrerror(err); \n    }\n}\n\nconst char *socket_strerror(int err) {\n    if (err <= 0) return io_strerror(err);\n    switch (err) {\n        case WSAEADDRINUSE: return \"address already in use\";\n        case WSAECONNREFUSED: return \"connection refused\";\n        case WSAEISCONN: return \"already connected\";\n        case WSAEACCES: return \"permission denied\";\n        case WSAECONNABORTED: return \"closed\";\n        case WSAECONNRESET: return \"closed\";\n        case WSAETIMEDOUT: return \"timeout\";\n        default: return wstrerror(err);\n    }\n}\n\nconst char *socket_ioerror(p_socket ps, int err) {\n    (void) ps;\n    return socket_strerror(err);\n}\n\nstatic const char *wstrerror(int err) {\n    switch (err) {\n        case WSAEINTR: return \"Interrupted function call\";\n        case WSAEACCES: return \"Permission denied\";\n        case WSAEFAULT: return \"Bad address\";\n        case WSAEINVAL: return \"Invalid argument\";\n        case WSAEMFILE: return \"Too many open files\";\n        case WSAEWOULDBLOCK: return \"Resource temporarily unavailable\";\n        case WSAEINPROGRESS: return \"Operation now in progress\";\n        case WSAEALREADY: return \"Operation already in progress\";\n        case WSAENOTSOCK: return \"Socket operation on nonsocket\";\n        case WSAEDESTADDRREQ: return \"Destination address required\";\n        case WSAEMSGSIZE: return \"Message too long\";\n        case WSAEPROTOTYPE: return \"Protocol wrong type for socket\";\n        case WSAENOPROTOOPT: return \"Bad protocol option\";\n        case WSAEPROTONOSUPPORT: return \"Protocol not supported\";\n        case WSAESOCKTNOSUPPORT: return \"Socket type not supported\";\n        case WSAEOPNOTSUPP: return \"Operation not supported\";\n        case WSAEPFNOSUPPORT: return \"Protocol family not supported\";\n        case WSAEAFNOSUPPORT: \n            return \"Address family not supported by protocol family\"; \n        case WSAEADDRINUSE: return \"Address already in use\";\n        case WSAEADDRNOTAVAIL: return \"Cannot assign requested address\";\n        case WSAENETDOWN: return \"Network is down\";\n        case WSAENETUNREACH: return \"Network is unreachable\";\n        case WSAENETRESET: return \"Network dropped connection on reset\";\n        case WSAECONNABORTED: return \"Software caused connection abort\";\n        case WSAECONNRESET: return \"Connection reset by peer\";\n        case WSAENOBUFS: return \"No buffer space available\";\n        case WSAEISCONN: return \"Socket is already connected\";\n        case WSAENOTCONN: return \"Socket is not connected\";\n        case WSAESHUTDOWN: return \"Cannot send after socket shutdown\";\n        case WSAETIMEDOUT: return \"Connection timed out\";\n        case WSAECONNREFUSED: return \"Connection refused\";\n        case WSAEHOSTDOWN: return \"Host is down\";\n        case WSAEHOSTUNREACH: return \"No route to host\";\n        case WSAEPROCLIM: return \"Too many processes\";\n        case WSASYSNOTREADY: return \"Network subsystem is unavailable\";\n        case WSAVERNOTSUPPORTED: return \"Winsock.dll version out of range\";\n        case WSANOTINITIALISED: \n            return \"Successful WSAStartup not yet performed\";\n        case WSAEDISCON: return \"Graceful shutdown in progress\";\n        case WSAHOST_NOT_FOUND: return \"Host not found\";\n        case WSATRY_AGAIN: return \"Nonauthoritative host not found\";\n        case WSANO_RECOVERY: return \"Nonrecoverable name lookup error\"; \n        case WSANO_DATA: return \"Valid name, no data record of requested type\";\n        default: return \"Unknown error\";\n    }\n}\n\nconst char *socket_gaistrerror(int err) {\n    if (err == 0) return NULL; \n    switch (err) {\n        case EAI_AGAIN: return \"temporary failure in name resolution\";\n        case EAI_BADFLAGS: return \"invalid value for ai_flags\";\n#ifdef EAI_BADHINTS\n        case EAI_BADHINTS: return \"invalid value for hints\";\n#endif\n        case EAI_FAIL: return \"non-recoverable failure in name resolution\";\n        case EAI_FAMILY: return \"ai_family not supported\";\n        case EAI_MEMORY: return \"memory allocation failure\";\n        case EAI_NONAME: \n            return \"host or service not provided, or not known\";\n//        case EAI_OVERFLOW: return \"argument buffer overflow\";\n#ifdef EAI_PROTOCOL\n        case EAI_PROTOCOL: return \"resolved protocol is unknown\";\n#endif\n        case EAI_SERVICE: return \"service not supported for socket type\";\n        case EAI_SOCKTYPE: return \"ai_socktype not supported\";\n//        case EAI_SYSTEM: return strerror(errno); \n        default: return gai_strerrorA(err);\n    }\n}\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/socket/wsocket.h",
    "content": "#ifndef WSOCKET_H\n#define WSOCKET_H\n/*=========================================================================*\\\n* Socket compatibilization module for Win32\n* LuaSocket toolkit\n\\*=========================================================================*/\n\n/*=========================================================================*\\\n* WinSock include files\n\\*=========================================================================*/\n#include <winsock2.h>\n#include <ws2tcpip.h>\n\ntypedef int socklen_t;\ntypedef SOCKADDR_STORAGE t_sockaddr_storage;\ntypedef SOCKET t_socket;\ntypedef t_socket *p_socket;\n\n#define SOCKET_INVALID (INVALID_SOCKET)\n\n#ifndef SO_REUSEPORT\n#define SO_REUSEPORT SO_REUSEADDR\n#endif\n\n#endif /* WSOCKET_H */\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/tolua_fix.c",
    "content": "\n#include \"tolua_fix.h\"\n#include <stdlib.h>\n\nstatic int s_function_ref_id = 0;\n\nTOLUA_API void toluafix_open(lua_State* L)\n{\n    lua_pushstring(L, TOLUA_REFID_PTR_MAPPING);\n    lua_newtable(L);\n    lua_rawset(L, LUA_REGISTRYINDEX);\n\n    lua_pushstring(L, TOLUA_REFID_TYPE_MAPPING);\n    lua_newtable(L);\n    lua_rawset(L, LUA_REGISTRYINDEX);\n\n    lua_pushstring(L, TOLUA_REFID_FUNCTION_MAPPING);\n    lua_newtable(L);\n    lua_rawset(L, LUA_REGISTRYINDEX);\n}\n\nTOLUA_API int toluafix_pushusertype_ccobject(lua_State* L,\n                                             int refid,\n                                             int* p_refid,\n                                             void* ptr,\n                                             const char* type)\n{\n    if (ptr == NULL || p_refid == NULL)\n    {\n        lua_pushnil(L);\n        return -1;\n    }\n\n    if (*p_refid == 0)\n    {\n        *p_refid = refid;\n\n        lua_pushstring(L, TOLUA_REFID_PTR_MAPPING);\n        lua_rawget(L, LUA_REGISTRYINDEX);                           /* stack: refid_ptr */\n        lua_pushinteger(L, refid);                                  /* stack: refid_ptr refid */\n        lua_pushlightuserdata(L, ptr);                              /* stack: refid_ptr refid ptr */\n\n        lua_rawset(L, -3);                  /* refid_ptr[refid] = ptr, stack: refid_ptr */\n        lua_pop(L, 1);                                              /* stack: - */\n\n        lua_pushstring(L, TOLUA_REFID_TYPE_MAPPING);\n        lua_rawget(L, LUA_REGISTRYINDEX);                           /* stack: refid_type */\n        lua_pushinteger(L, refid);                                  /* stack: refid_type refid */\n        lua_pushstring(L, type);                                    /* stack: refid_type refid type */\n        lua_rawset(L, -3);                /* refid_type[refid] = type, stack: refid_type */\n        lua_pop(L, 1);                                              /* stack: - */\n\n        //printf(\"[LUA] push CCObject OK - refid: %d, ptr: %x, type: %s\\n\", *p_refid, (int)ptr, type);\n    }\n\n    tolua_pushusertype_and_addtoroot(L, ptr, type);\n    \n    return 0;\n}\n\nTOLUA_API int toluafix_remove_ccobject_by_refid(lua_State* L, int refid)\n{\n\tvoid* ptr = NULL;\n    const char* type = NULL;\n    void** ud = NULL;\n    if (refid == 0) return -1;\n\n    // get ptr from tolua_refid_ptr_mapping\n    lua_pushstring(L, TOLUA_REFID_PTR_MAPPING);\n    lua_rawget(L, LUA_REGISTRYINDEX);                               /* stack: refid_ptr */\n    lua_pushinteger(L, refid);                                      /* stack: refid_ptr refid */\n    lua_rawget(L, -2);                                              /* stack: refid_ptr ptr */\n    ptr = lua_touserdata(L, -1);\n    lua_pop(L, 1);                                                  /* stack: refid_ptr */\n    if (ptr == NULL)\n    {\n        lua_pop(L, 1);\n        // Lua stack has closed, C++ object not in Lua.\n        // printf(\"[LUA ERROR] remove CCObject with NULL ptr, refid: %d\\n\", refid);\n        return -2;\n    }\n\n    // remove ptr from tolua_refid_ptr_mapping\n    lua_pushinteger(L, refid);                                      /* stack: refid_ptr refid */\n    lua_pushnil(L);                                                 /* stack: refid_ptr refid nil */\n    lua_rawset(L, -3);                     /* delete refid_ptr[refid], stack: refid_ptr */\n    lua_pop(L, 1);                                                  /* stack: - */\n\n\n    // get type from tolua_refid_type_mapping\n    lua_pushstring(L, TOLUA_REFID_TYPE_MAPPING);\n    lua_rawget(L, LUA_REGISTRYINDEX);                               /* stack: refid_type */\n    lua_pushinteger(L, refid);                                      /* stack: refid_type refid */\n    lua_rawget(L, -2);                                              /* stack: refid_type type */\n    if (lua_isnil(L, -1))\n    {\n        lua_pop(L, 2);\n        printf(\"[LUA ERROR] remove CCObject with NULL type, refid: %d, ptr: %p\\n\", refid, ptr);\n        return -1;\n    }\n\n    type = lua_tostring(L, -1);\n    lua_pop(L, 1);                                                  /* stack: refid_type */\n\n    // remove type from tolua_refid_type_mapping\n    lua_pushinteger(L, refid);                                      /* stack: refid_type refid */\n    lua_pushnil(L);                                                 /* stack: refid_type refid nil */\n    lua_rawset(L, -3);                    /* delete refid_type[refid], stack: refid_type */\n    lua_pop(L, 1);                                                  /* stack: - */\n\n    // get ubox\n    luaL_getmetatable(L, type);                                     /* stack: mt */\n    lua_pushstring(L, \"tolua_ubox\");                                /* stack: mt key */\n    lua_rawget(L, -2);                                              /* stack: mt ubox */\n    if (lua_isnil(L, -1))\n    {\n        // use global ubox\n        lua_pop(L, 1);                                              /* stack: mt */\n        lua_pushstring(L, \"tolua_ubox\");                            /* stack: mt key */\n        lua_rawget(L, LUA_REGISTRYINDEX);                           /* stack: mt ubox */\n    };\n    \n    \n    // cleanup root\n    tolua_remove_value_from_root(L, ptr);\n\n    lua_pushlightuserdata(L, ptr);                                  /* stack: mt ubox ptr */\n    lua_rawget(L,-2);                                               /* stack: mt ubox ud */\n    if (lua_isnil(L, -1))\n    {\n        // Lua object has released (GC), C++ object not in ubox.\n        //printf(\"[LUA ERROR] remove CCObject with NULL ubox, refid: %d, ptr: %x, type: %s\\n\", refid, (int)ptr, type);\n        lua_pop(L, 3);\n        return -3;\n    }\n\n    // cleanup peertable\n    lua_pushvalue(L, LUA_REGISTRYINDEX);\n    lua_setfenv(L, -2);\n\n    ud = (void**)lua_touserdata(L, -1);\n    lua_pop(L, 1);                                                  /* stack: mt ubox */\n    if (ud == NULL)\n    {\n        printf(\"[LUA ERROR] remove CCObject with NULL userdata, refid: %d, ptr: %p, type: %s\\n\", refid, ptr, type);\n        lua_pop(L, 2);\n        return -1;\n    }\n\n    // clean userdata\n    *ud = NULL;\n\n    lua_pushlightuserdata(L, ptr);                                  /* stack: mt ubox ptr */\n    lua_pushnil(L);                                                 /* stack: mt ubox ptr nil */\n    lua_rawset(L, -3);                             /* ubox[ptr] = nil, stack: mt ubox */\n\n    lua_pop(L, 2);\n    //printf(\"[LUA] remove CCObject, refid: %d, ptr: %x, type: %s\\n\", refid, (int)ptr, type);\n    return 0;\n}\n\nTOLUA_API int toluafix_ref_function(lua_State* L, int lo, int def)\n{\n    // function at lo\n    if (!lua_isfunction(L, lo)) return 0;\n\n    s_function_ref_id++;\n\n    lua_pushstring(L, TOLUA_REFID_FUNCTION_MAPPING);\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* stack: fun ... refid_fun */\n    lua_pushinteger(L, s_function_ref_id);                      /* stack: fun ... refid_fun refid */\n    lua_pushvalue(L, lo);                                       /* stack: fun ... refid_fun refid fun */\n\n    lua_rawset(L, -3);                  /* refid_fun[refid] = fun, stack: fun ... refid_ptr */\n    lua_pop(L, 1);                                              /* stack: fun ... */\n\n    return s_function_ref_id;\n\n    // lua_pushvalue(L, lo);                                           /* stack: ... func */\n    // return luaL_ref(L, LUA_REGISTRYINDEX);\n}\n\nTOLUA_API void toluafix_get_function_by_refid(lua_State* L, int refid)\n{\n    lua_pushstring(L, TOLUA_REFID_FUNCTION_MAPPING);\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* stack: ... refid_fun */\n    lua_pushinteger(L, refid);                                  /* stack: ... refid_fun refid */\n    lua_rawget(L, -2);                                          /* stack: ... refid_fun fun */\n    lua_remove(L, -2);                                          /* stack: ... fun */\n}\n\nTOLUA_API void toluafix_remove_function_by_refid(lua_State* L, int refid)\n{\n    lua_pushstring(L, TOLUA_REFID_FUNCTION_MAPPING);\n    lua_rawget(L, LUA_REGISTRYINDEX);                           /* stack: ... refid_fun */\n    lua_pushinteger(L, refid);                                  /* stack: ... refid_fun refid */\n    lua_pushnil(L);                                             /* stack: ... refid_fun refid nil */\n    lua_rawset(L, -3);                  /* refid_fun[refid] = fun, stack: ... refid_ptr */\n    lua_pop(L, 1);                                              /* stack: ... */\n\n    // luaL_unref(L, LUA_REGISTRYINDEX, refid);\n}\n\n// check lua value is funciton\nTOLUA_API int toluafix_isfunction(lua_State* L, int lo, const char* type, int def, tolua_Error* err)\n{\n    if (lua_gettop(L) >= abs(lo) && lua_isfunction(L, lo))\n    {\n        return 1;\n    }\n    err->index = lo;\n    err->array = 0;\n    err->type = \"[not function]\";\n    return 0;\n}\n\nTOLUA_API int toluafix_totable(lua_State* L, int lo, int def)\n{\n    return lo;\n}\n\nTOLUA_API int toluafix_istable(lua_State* L, int lo, const char* type, int def, tolua_Error* err)\n{\n    return tolua_istable(L, lo, def, err);\n}\n\nTOLUA_API void toluafix_stack_dump(lua_State* L, const char* label)\n{\n    int i;\n    int top = lua_gettop(L);\n    printf(\"Total [%d] in lua stack: %s\\n\", top, label != 0 ? label : \"\");\n    for (i = -1; i >= -top; i--)\n    {\n        int t = lua_type(L, i);\n        switch (t)\n        {\n            case LUA_TSTRING:\n                printf(\"  [%02d] string %s\\n\", i, lua_tostring(L, i));\n                break;\n            case LUA_TBOOLEAN:\n                printf(\"  [%02d] boolean %s\\n\", i, lua_toboolean(L, i) ? \"true\" : \"false\");\n                break;\n            case LUA_TNUMBER:\n                printf(\"  [%02d] number %g\\n\", i, lua_tonumber(L, i));\n                break;\n            default:\n                printf(\"  [%02d] %s\\n\", i, lua_typename(L, t));\n        }\n    }\n    printf(\"\\n\");\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/bindings/tolua_fix.h",
    "content": "\n#ifndef __TOLUA_FIX_H_\n#define __TOLUA_FIX_H_\n\n#include \"tolua++.h\"\n\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n    \n#define TOLUA_REFID_PTR_MAPPING \"toluafix_refid_ptr_mapping\"\n#define TOLUA_REFID_TYPE_MAPPING \"toluafix_refid_type_mapping\"\n#define TOLUA_REFID_FUNCTION_MAPPING \"toluafix_refid_function_mapping\"\n    \nTOLUA_API void toluafix_open(lua_State* L);\nTOLUA_API int toluafix_pushusertype_ccobject(lua_State* L,\n                                             int uid,\n                                             int* p_refid,\n                                             void* ptr,\n                                             const char* type);\nTOLUA_API int toluafix_remove_ccobject_by_refid(lua_State* L, int refid);\nTOLUA_API int toluafix_ref_function(lua_State* L, int lo, int def);\nTOLUA_API void toluafix_get_function_by_refid(lua_State* L, int refid);\nTOLUA_API void toluafix_remove_function_by_refid(lua_State* L, int refid);\nTOLUA_API int toluafix_isfunction(lua_State* L, int lo, const char* type, int def, tolua_Error* err);\nTOLUA_API int toluafix_totable(lua_State* L, int lo, int def);\nTOLUA_API int toluafix_istable(lua_State* L, int lo, const char* type, int def, tolua_Error* err);\nTOLUA_API void toluafix_stack_dump(lua_State* L, const char* label);\n    \n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#endif // __TOLUA_FIX_H_\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/AudioEngine.lua",
    "content": "--Encapsulate SimpleAudioEngine to AudioEngine,Play music and sound effects. \nlocal M = {}\nlocal audioEngineInstance = cc.SimpleAudioEngine:getInstance()\n\nfunction M.stopAllEffects()\n    audioEngineInstance:stopAllEffects()\nend\n\nfunction M.getMusicVolume()\n    return audioEngineInstance:getMusicVolume()\nend\n\nfunction M.isMusicPlaying()\n    return audioEngineInstance:isMusicPlaying()\nend\n\nfunction M.getEffectsVolume()\n    return audioEngineInstance:getEffectsVolume()\nend\n\nfunction M.setMusicVolume(volume)\n    audioEngineInstance:setMusicVolume(volume)\nend\n\nfunction M.stopEffect(handle)\n    audioEngineInstance:stopEffect(handle)\nend\n\nfunction M.stopMusic(isReleaseData)\n    local releaseDataValue = false\n    if nil ~= isReleaseData then\n        releaseDataValue = isReleaseData\n    end\n    audioEngineInstance:stopMusic(releaseDataValue)\nend\n\nfunction M.playMusic(filename, isLoop)\n    local loopValue = false\n    if nil ~= isLoop then\n        loopValue = isLoop\n    end\n    audioEngineInstance:playMusic(filename, loopValue)\nend\n\nfunction M.pauseAllEffects()\n    audioEngineInstance:pauseAllEffects()\nend\n\nfunction M.preloadMusic(filename)\n    audioEngineInstance:preloadMusic(filename)\nend\n\nfunction M.resumeMusic()\n    audioEngineInstance:resumeMusic()\nend\n\nfunction M.playEffect(filename, isLoop)\n    local loopValue = false\n    if nil ~= isLoop then\n        loopValue = isLoop\n    end\n    return audioEngineInstance:playEffect(filename, loopValue)\nend\n\nfunction M.rewindMusic()\n    audioEngineInstance:rewindMusic()\nend\n\nfunction M.willPlayMusic()\n    return audioEngineInstance:willPlayMusic()\nend\n\nfunction M.unloadEffect(filename)\n    audioEngineInstance:unloadEffect(filename)\nend\n\nfunction M.preloadEffect(filename)\n    audioEngineInstance:preloadEffect(filename)\nend\n\nfunction M.setEffectsVolume(volume)\n    audioEngineInstance:setEffectsVolume(volume)\nend\n\nfunction M.pauseEffect(handle)\n    audioEngineInstance:pauseEffect(handle)\nend\n\nfunction M.resumeAllEffects(handle)\n    audioEngineInstance:resumeAllEffects()\nend\n\nfunction M.pauseMusic()\n    audioEngineInstance:pauseMusic()\nend\n\nfunction M.resumeEffect(handle)\n    audioEngineInstance:resumeEffect(handle)\nend\n\nlocal modename = \"AudioEngine\"\nlocal proxy = {}\nlocal mt    = {\n    __index = M,\n    __newindex =  function (t ,k ,v)\n        print(\"attemp to update a read-only table\")\n    end\n} \nsetmetatable(proxy,mt)\n_G[modename] = proxy\npackage.loaded[modename] = proxy\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/CCBReaderLoad.lua",
    "content": "ccb = ccb or {}\n\nfunction CCBReaderLoad(strFilePath,proxy,owner)\n    if nil == proxy then\n        return nil\n    end\n\n    local ccbReader = proxy:createCCBReader()\n    local node      = ccbReader:load(strFilePath)\n    local rootName  = \"\" \n    --owner set in readCCBFromFile is proxy\n    if nil ~= owner then\n        --Callbacks\n        local ownerCallbackNames = ccbReader:getOwnerCallbackNames() \n        local ownerCallbackNodes = ccbReader:getOwnerCallbackNodes()\n        local ownerCallbackControlEvents = ccbReader:getOwnerCallbackControlEvents()\n        local i = 1\n        for i = 1,table.getn(ownerCallbackNames) do\n            local callbackName =  ownerCallbackNames[i]\n            local callbackNode =  tolua.cast(ownerCallbackNodes[i],\"cc.Node\")\n\n            if \"function\" == type(owner[callbackName]) then\n                proxy:setCallback(callbackNode, owner[callbackName], ownerCallbackControlEvents[i])\n            else\n                print(\"Warning: Cannot find owner's lua function:\" .. \":\" .. callbackName .. \" for ownerVar selector\")\n            end\n\n        end\n\n        --Variables\n        local ownerOutletNames = ccbReader:getOwnerOutletNames() \n        local ownerOutletNodes = ccbReader:getOwnerOutletNodes()\n\n        for i = 1, table.getn(ownerOutletNames) do\n            local outletName = ownerOutletNames[i]\n            local outletNode = tolua.cast(ownerOutletNodes[i],\"cc.Node\")\n            owner[outletName] = outletNode\n        end\n    end\n\n    local nodesWithAnimationManagers = ccbReader:getNodesWithAnimationManagers()\n    local animationManagersForNodes  = ccbReader:getAnimationManagersForNodes()\n\n    for i = 1 , table.getn(nodesWithAnimationManagers) do\n        local innerNode = tolua.cast(nodesWithAnimationManagers[i], \"cc.Node\")\n        local animationManager = tolua.cast(animationManagersForNodes[i], \"cc.CCBAnimationManager\")\n        local documentControllerName = animationManager:getDocumentControllerName()\n        if \"\" == documentControllerName then\n            \n        end\n        if nil ~=  ccb[documentControllerName] then\n            ccb[documentControllerName][\"mAnimationManager\"] = animationManager\n        end\n        \n        --Callbacks\n        local documentCallbackNames = animationManager:getDocumentCallbackNames()\n        local documentCallbackNodes = animationManager:getDocumentCallbackNodes()\n        local documentCallbackControlEvents = animationManager:getDocumentCallbackControlEvents()\n\n        for i = 1,table.getn(documentCallbackNames) do\n            local callbackName = documentCallbackNames[i]\n            local callbackNode = tolua.cast(documentCallbackNodes[i],\"cc.Node\")\n            if \"\" ~= documentControllerName and nil ~= ccb[documentControllerName] then\n                if \"function\" == type(ccb[documentControllerName][callbackName]) then\n                    proxy:setCallback(callbackNode, ccb[documentControllerName][callbackName], documentCallbackControlEvents[i])\n                else\n                    print(\"Warning: Cannot found lua function [\" .. documentControllerName .. \":\" .. callbackName .. \"] for docRoot selector\")\n                end\n            end\n        end\n\n        --Variables\n        local documentOutletNames = animationManager:getDocumentOutletNames()\n        local documentOutletNodes = animationManager:getDocumentOutletNodes()\n\n        for i = 1, table.getn(documentOutletNames) do\n            local outletName = documentOutletNames[i]\n            local outletNode = tolua.cast(documentOutletNodes[i],\"cc.Node\")\n            \n            if nil ~= ccb[documentControllerName] then\n                ccb[documentControllerName][outletName] = tolua.cast(outletNode, proxy:getNodeTypeName(outletNode))\n            end \n        end\n        --[[\n        if (typeof(controller.onDidLoadFromCCB) == \"function\")\n            controller.onDidLoadFromCCB();\n        ]]--\n        --Setup timeline callbacks\n        local keyframeCallbacks = animationManager:getKeyframeCallbacks()\n\n        for i = 1 , table.getn(keyframeCallbacks) do\n            local callbackCombine = keyframeCallbacks[i]\n            local beignIndex,endIndex = string.find(callbackCombine,\":\")\n            local callbackType    = tonumber(string.sub(callbackCombine,1,beignIndex - 1))\n            local callbackName    = string.sub(callbackCombine,endIndex + 1, -1)\n            --Document callback\n\n            if 1 == callbackType and nil ~= ccb[documentControllerName] then\n                local callfunc = cc.CallFunc:create(ccb[documentControllerName][callbackName])\n                animationManager:setCallFuncForLuaCallbackNamed(callfunc, callbackCombine);\n            elseif 2 == callbackType and nil ~= owner then --Owner callback\n                local callfunc = cc.CallFunc:create(owner[callbackName])--need check\n                animationManager:setCallFuncForLuaCallbackNamed(callfunc, callbackCombine)\n            end\n        end\n        --start animation\n        local autoPlaySeqId = animationManager:getAutoPlaySequenceId()\n        if -1 ~= autoPlaySeqId then\n            animationManager:runAnimationsForSequenceIdTweenDuration(autoPlaySeqId, 0)\n        end\n    end\n\n    return node\nend\n\n\nlocal function CCBuilderReaderLoad(strFilePath,proxy,owner)\n    print(\"\\n********** \\n\"..\"CCBuilderReaderLoad(strFilePath,proxy,owner)\"..\" was deprecated please use \".. \"CCBReaderLoad(strFilePath,proxy,owner)\" .. \" instead.\\n**********\")\n    return CCBReaderLoad(strFilePath,proxy,owner)\nend\nrawset(_G,\"CCBuilderReaderLoad\",CCBuilderReaderLoad)"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/CocoStudio.lua",
    "content": "require \"json\"\nrequire \"extern\"\n\nccs = ccs or {}\n\nfunction ccs.sendTriggerEvent(event)\n    local triggerObjArr = ccs.TriggerMng.getInstance():get(event)\n    \n    if nil == triggerObjArr then\n        return\n    end\n\n    for i = 1, table.getn(triggerObjArr) do\n        local triObj = triggerObjArr[i]\n        if nil ~= triObj and triObj.detect then\n            triObj:done()\n        end\n    end\nend\n\nfunction ccs.registerTriggerClass(className, createFunc)\n    ccs.TInfo.new(className,createFunc)\nend\n\nccs.TInfo = class(\"TInfo\")\nccs.TInfo._className = \"\"\nccs.TInfo._fun = nil\n\nfunction ccs.TInfo:ctor(c,f)\n     -- @param {String|ccs.TInfo}c\n     -- @param {Function}f\n    if nil ~= f then\n        self._className = c\n        self._fun       = f\n    else\n        self._className = c._className\n        self._fun       = c._fun\n    end\n\n    ccs.ObjectFactory.getInstance():registerType(self)\nend\n\nccs.ObjectFactory = class(\"ObjectFactory\")\nccs.ObjectFactory._typeMap = nil\nccs.ObjectFactory._instance = nil\n\nfunction ccs.ObjectFactory:ctor()\n    self._typeMap = {}\nend\n\nfunction ccs.ObjectFactory.getInstance()\n    if nil == ccs.ObjectFactory._instance then\n        ccs.ObjectFactory._instance = ccs.ObjectFactory.new()\n    end\n\n    return ccs.ObjectFactory._instance\nend\n\nfunction ccs.ObjectFactory.destroyInstance()\n    ccs.ObjectFactory._instance = nil\nend\n\nfunction ccs.ObjectFactory:createObject(classname)\n    local obj = nil\n    local t   = self._typeMap[classname]\n    if nil ~= t then\n        obj = t._fun()\n    end\n\n    return obj\nend\n\nfunction ccs.ObjectFactory:registerType(t)\n    self._typeMap[t._className] = t\nend\n\nccs.TriggerObj = class(\"TriggerObj\")\nccs.TriggerObj._cons = {}\nccs.TriggerObj._acts = {}\nccs.TriggerObj._enable = false\nccs.TriggerObj._id   = 0\nccs.TriggerObj._vInt = {}\n\nfunction ccs.TriggerObj.extend(target)\n    local t = tolua.getpeer(target)\n    if not t then\n        t = {}\n        tolua.setpeer(target, t)\n    end\n    setmetatable(t, TriggerObj)\n    return target\nend\n\nfunction ccs.TriggerObj:ctor()\n    self:init()\nend\n\nfunction ccs.TriggerObj:init()\n    self._id = 0\n    self._enable = true\n    self._cons = {}\n    self._acts = {}\n    self._vInt = {}\nend\n\nfunction ccs.TriggerObj:detect()\n    if (not self._enable) or (table.getn(self._cons) == 0) then\n        return true\n    end \n\n    local ret = true\n    local obj = nil\n    for i = 1 , table.getn(self._cons) do\n        obj = self._cons[i]\n        if nil ~= obj and obj.detect then\n            ret = ret and obj:detect()\n        end\n    end\n    return ret\nend\n\nfunction ccs.TriggerObj:done()\n    if (not self._enable) or (table.getn(self._acts) == 0) then\n        return\n    end\n\n    local obj = nil\n    for i = 1, table.getn(self._acts) do\n        obj = self._acts[i]\n        if nil ~= obj and obj.done then\n            obj:done()\n        end\n    end\nend\n\nfunction ccs.TriggerObj:removeAll()\n    local obj = nil\n    for i=1, table.getn(self._cons) do\n        obj = self._cons[i]\n        if nil ~= obj then\n            obj:removeAll()\n        end\n    end\n    self._cons = {}\n\n    for i=1, table.getn(self._acts) do\n        obj = self._acts[i]\n        if nil ~= obj then\n            obj:removeAll()\n        end\n    end\n    self._acts = {}\nend\n\nfunction ccs.TriggerObj:serialize(jsonValue)\n    self._id = jsonValue[\"id\"]\n    local count = 0\n\n    --condition\n    local cons = jsonValue[\"conditions\"]\n    if nil ~= cons then\n        count = table.getn(cons)\n        for i = 1, count do\n            local subDict = cons[i]\n            local className = subDict[\"classname\"]\n            if nil ~= className then\n                local obj = ObjectFactory.getInstance():createObject(className)\n                assert(nil ~= obj, string.format(\"class named %s can not implement!\",className))\n                obj:serialize(subDict)\n                obj:init()\n                table.insert(self._cons, obj)\n            end\n        end\n    end\n\n    local actions =  jsonValue[\"actions\"]\n    if nil ~= actions then\n        count = table.getn(actions)\n        for i = 1,count do\n            local  subAction = actions[i]\n            local  className = subAction[\"classname\"]\n            if nil ~= className then\n                local act = ccs.ObjectFactory.getInstance():createObject(className)\n                assert(nil ~= act ,string.format(\"class named %s can not implement!\",className))\n                act:serialize(subAction)\n                act:init()\n                table.insert(self._acts,act)\n            end\n        end\n    end\n\n    local events = jsonValue[\"events\"]\n    if nil ~= events then\n        count = table.getn(events)\n        for i = 1, count do\n            local subEveent = events[i]\n            local eventID   = subEveent[\"id\"]\n            if eventID >= 0 then\n                table.insert(self._vInt,eventID)\n            end\n        end\n    end\nend\n\nfunction ccs.TriggerObj:getId()\n    return self._id\nend\n\nfunction ccs.TriggerObj:setEnable(enable)\n    self._enable = enable\nend\n\nfunction ccs.TriggerObj:getEvents()\n    return self._vInt\nend\n\nccs.TriggerMng = class(\"TriggerMng\")\nccs.TriggerMng._eventTriggers = nil\nccs.TriggerMng._triggerObjs = nil\nccs.TriggerMng._movementDispatches =  nil\nccs.TriggerMng._instance  = nil\n\nfunction ccs.TriggerMng:ctor()\n    self._triggerObjs = {}\n    self._movementDispatches = {}\n    self._eventTriggers = {}\nend\n\nfunction ccs.TriggerMng.getInstance()\n    if ccs.TriggerMng._instance == nil then\n        ccs.TriggerMng._instance = ccs.TriggerMng.new()\n    end\n\n    return ccs.TriggerMng._instance\nend\n\nfunction ccs.TriggerMng.destroyInstance()\n    if ccs.TriggerMng._instance ~= nil then\n        ccs.TriggerMng._instance:removeAll()\n        ccs.TriggerMng._instance = nil\n    end\nend\n\nfunction ccs.TriggerMng:triggerMngVersion()\n    return \"1.0.0.0\"\nend\n\nfunction ccs.TriggerMng:parse(jsonStr)\n    local parseTable = json.decode(jsonStr,1)\n    if nil == parseTable then\n        return\n    end\n\n    local count = table.getn(parseTable)\n    for i = 1, count do\n        local subDict = parseTable[i]\n        local triggerObj = ccs.TriggerObj.new()\n        triggerObj:serialize(subDict)\n        local events = triggerObj:getEvents()\n        for j = 1, table.getn(events) do\n            local event = events[j]\n            self:add(event, triggerObj)\n        end\n\n        self._triggerObjs[triggerObj:getId()] =  triggerObj\n    end\nend\n\nfunction ccs.TriggerMng:get(event)\n    return self._eventTriggers[event]\nend\n\nfunction ccs.TriggerMng:getTriggerObj(id)\n    return self._triggerObjs[id]\nend\n\nfunction ccs.TriggerMng:add(event,triggerObj)\n    local eventTriggers = self._eventTriggers[event]\n    if nil == eventTriggers then\n        eventTriggers = {}\n    end\n\n    local exist = false\n    for i = 1, table.getn(eventTriggers) do\n        if eventTriggers[i] == triggers then\n            exist = true\n            break\n        end\n    end\n\n    if not exist then\n        table.insert(eventTriggers,triggerObj)\n        self._eventTriggers[event] = eventTriggers\n    end\nend\n\nfunction ccs.TriggerMng:removeAll( )\n    for k in pairs(self._eventTriggers) do\n        local triObjArr = self._eventTriggers[k]\n        for j = 1, table.getn(triObjArr) do\n            local  obj = triObjArr[j]\n            obj:removeAll()\n        end\n    end\n    self._eventTriggers = {}\nend\n\nfunction ccs.TriggerMng:remove(event, obj)\n\n    if nil ~= obj then\n        return self:removeObjByEvent(event, obj)\n    end\n\n    assert(event >= 0,\"event must be larger than 0\")\n    if nil == self._eventTriggers then\n        return false\n    end\n\n    local triObjects =  self._eventTriggers[event]\n    if nil == triObjects then\n        return false\n    end\n\n    for i = 1, table.getn(triObjects) do\n        local triObject = triggers[i]\n        if nil ~= triObject then\n            triObject:remvoeAll()\n        end\n    end\n\n    self._eventTriggers[event] = nil\n    return true\nend\n\nfunction ccs.TriggerMng:removeObjByEvent(event, obj)\n    assert(event >= 0,\"event must be larger than 0\")\n    if nil == self._eventTriggers then\n        return false\n    end\n\n    local triObjects = self._eventTriggers[event]\n    if nil == triObjects then\n        return false\n    end\n\n    for i = 1,table.getn(triObjects) do\n        local triObject = triObjects[i]\n        if  nil ~= triObject and triObject == obj then\n            triObject:remvoeAll()\n            table.remove(triObjects, i)\n            return true\n        end\n    end\nend\n\nfunction ccs.TriggerMng:removeTriggerObj(id)\n    local obj = self.getTriggerObj(id)\n    \n    if nil == obj then\n        return false\n    end\n\n    local events = obj:getEvents()\n    for i = 1, table.getn(events) do\n        self:remove(events[i],obj)\n    end\n\n    return true\nend\n\nfunction ccs.TriggerMng:isEmpty()\n    return (not (nil == self._eventTriggers)) or table.getn(self._eventTriggers) <= 0\nend\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/Cocos2d.lua",
    "content": "require \"CocoStudio\"\n\ncc = cc or {}\n\ncc.DIRECTOR_PROJECTION_2D = 0\ncc.DIRECTOR_PROJECTION_3D = 1\n\nfunction cc.clampf(value, min_inclusive, max_inclusive)\n    -- body\n    local temp = 0\n    if min_inclusive > max_inclusive then\n        temp = min_inclusive \n        min_inclusive =  max_inclusive\n        max_inclusive = temp\n    end\n\n    if value < min_inclusive then\n        return min_inclusive\n    elseif value < max_inclusive then\n        return value\n    else\n        return max_inclusive\n    end\nend\n\n--Point\nfunction cc.p(_x,_y)\n    if nil == _y then\n         return { x = _x.x, y = _x.y }\n    else\n         return { x = _x, y = _y }\n    end\nend\n\nfunction cc.pAdd(pt1,pt2)\n    return {x = pt1.x + pt2.x , y = pt1.y + pt2.y }\nend\n\nfunction cc.pSub(pt1,pt2)\n    return {x = pt1.x - pt2.x , y = pt1.y - pt2.y }\nend\n\nfunction cc.pMul(pt1,factor)\n    return { x = pt1.x * factor , y = pt1.y * factor }\nend\n\nfunction cc.pMidpoint(pt1,pt2)\n    return { x = (pt1.x + pt2.x) / 2.0 , y = ( pt1.y + pt2.y) / 2.0 }\nend\n\nfunction cc.pForAngle(a)\n    return { x = math.cos(a), y = math.sin(a) }\nend\n\nfunction cc.pGetLength(pt)\n    return math.sqrt( pt.x * pt.x + pt.y * pt.y )\nend\n\nfunction cc.pNormalize(pt)\n    local length = cc.pGetLength(pt)\n    if 0 == length then\n        return { x = 1.0,y = 0.0 }\n    end\n\n    return { x = pt.x / length, y = pt.y / length }\nend\n\nfunction cc.pCross(self,other)\n    return self.x * other.y - self.y * other.x\nend\n\nfunction cc.pDot(self,other)\n    return self.x * other.x + self.y * other.y\nend\n\nfunction cc.pToAngleSelf(self)\n    return math.atan2(self.y, self.x)\nend\n\nfunction cc.pGetAngle(self,other)\n    local a2 = cc.pNormalize(self)\n    local b2 = cc.pNormalize(other)\n    local angle = math.atan2(cc.pCross(a2, b2), cc.pDot(a2, b2) )\n    if angle < 1.192092896e-7 then\n        return 0.0\n    end\n\n    return angle\nend\n\nfunction cc.pGetDistance(startP,endP)\n    return cc.pGetLength(cc.pSub(startP,endP))\nend\n\nfunction cc.pIsLineIntersect(A, B, C, D, s, t)\n    if ((A.x == B.x) and (A.y == B.y)) or ((C.x == D.x) and (C.y == D.y))then\n        return false, s, t\n    end\n\n    local BAx = B.x - A.x\n    local BAy = B.y - A.y\n    local DCx = D.x - C.x\n    local DCy = D.y - C.y\n    local ACx = A.x - C.x\n    local ACy = A.y - C.y\n\n    local denom = DCy * BAx - DCx * BAy\n    s = DCx * ACy - DCy * ACx\n    t = BAx * ACy - BAy * ACx\n\n    if (denom == 0) then\n        if (s == 0 or t == 0) then\n            return true, s , t\n        end\n\n        return false, s, t\n    end\n    \n    s = s / denom\n    t = t / denom\n\n    return true,s,t\nend\n\nfunction cc.pPerp(pt)\n    return { x = -pt.y, y = pt.x }\nend\n\nfunction cc.RPerp(pt)\n    return { x = pt.y,  y = -pt.x }\nend\n\nfunction cc.pProject(pt1, pt2)\n    return { x = pt2.x * (cc.pDot(pt1,pt2) / cc.pDot(pt2,pt2)) , y = pt2.y * (cc.pDot(pt1,pt2) / cc.pDot(pt2,pt2)) }\nend\n\nfunction cc.pRotate(pt1, pt2)\n    return { x = pt1.x * pt2.x - pt1.y * pt2.y, y = pt1.x * pt2.y + pt1.y * pt2.x }\nend\n\nfunction cc.pUnrotate(pt1, pt2)\n    return { x = pt1.x * pt2.x + pt1.y * pt2.y, pt1.y * pt2.x - pt1.x * pt2.y }\nend\n--Calculates the square length of pt\nfunction cc.pLengthSQ(pt)\n    return cc.pDot(pt,pt)\nend\n--Calculates the square distance between pt1 and pt2\nfunction cc.pDistanceSQ(pt1,pt2)\n    return cc.pLengthSQ(cc.pSub(pt1,pt2))\nend\n\nfunction cc.pGetClampPoint(pt1,pt2,pt3)\n    return { x = cc.clampf(pt1.x, pt2.x, pt3.x), y = cc.clampf(pt1.y, pt2.y, pt3.y) }\nend\n\nfunction cc.pFromSize(sz)\n    return { x = sz.width, y = sz.height }\nend\n\nfunction cc.pLerp(pt1,pt2,alpha) \n    return cc.pAdd(cc.pMul(pt1, 1.0 - alpha), cc.pMul(pt2,alpha) )\nend\n\nfunction cc.pFuzzyEqual(pt1,pt2,variance)\n    if (pt1.x - variance <= pt2.x) and (pt2.x <= pt1.x + variance) and (pt1.y - variance <= pt2.y) and (pt2.y <= pt1.y + variance) then\n        return true\n    else\n        return false\n    end\nend\n\nfunction cc.pRotateByAngle(pt1, pt2, angle)\n    return cc.pAdd(pt2, cc.pRotate( cc.pSub(pt1, pt2),cc.pForAngle(angle)))    \nend\n\nfunction cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4)\n    local s,t,ret = 0,0,false\n    ret,s,t =cc.pIsLineIntersect(pt1, pt2, pt3, pt4,s,t)\n    \n    if ret and  s >= 0.0 and s <= 1.0 and t >= 0.0 and t <= 0.0 then\n        return true;\n    end\n\n    return false\nend\n\nfunction cc.pGetIntersectPoint(pt1,pt2,pt3,pt4)\n    local s,t, ret = 0,0,false\n    ret,s,t = cc.pIsLineIntersect(pt1,pt2,pt3,pt4,s,t) \n    if ret then\n        return cc.p(pt1.x + s * (pt2.x - pt1.x), pt1.y + s * (pt2.y - pt1.y))\n    else\n        return cc.p(0,0)\n    end\nend\n--Size\nfunction cc.size( _width,_height )\n    return { width = _width, height = _height }\nend\n\n--Rect\nfunction cc.rect(_x,_y,_width,_height)\n    return { x = _x, y = _y, width = _width, height = _height }\nend\n\nfunction cc.rectEqualToRect(rect1,rect2)\n    if ((rect1.x >= rect2.x) or (rect1.y >= rect2.y) or\n        ( rect1.x + rect1.width <= rect2.x + rect2.width) or\n        ( rect1.y + rect1.height <= rect2.y + rect2.height)) then\n        return false\n    end\n\n    return true\nend\n\nfunction cc.rectGetMaxX(rect)\n    return rect.x + rect.width\nend\n\nfunction cc.rectGetMidX(rect)\n    return rect.x + rect.width / 2.0\nend\n\nfunction cc.rectGetMinX(rect)\n    return rect.x\nend\n\nfunction cc.rectGetMaxY(rect)\n    return rect.y + rect.height\nend\n\nfunction cc.rectGetMidY(rect)\n    return rect.y + rect.height / 2.0\nend\n\nfunction cc.rectGetMinY(rect)\n    return rect.y\nend\n\nfunction cc.rectContainsPoint( rect, point )\n    local ret = false\n    \n    if (point.x >= rect.x) and (point.x <= rect.x + rect.width) and\n       (point.y >= rect.y) and (point.y <= rect.y + rect.height) then\n        ret = true\n    end\n\n    return ret\nend\n\nfunction cc.rectIntersectsRect( rect1, rect2 )\n    local intersect = not ( rect1.x > rect2.x + rect2.width or\n                    rect1.x + rect1.width < rect2.x         or\n                    rect1.y > rect2.y + rect2.height        or\n                    rect1.y + rect1.height < rect2.y )\n\n    return intersect\nend\n\nfunction cc.rectUnion( rect1, rect2 )\n    local rect = cc.rect(0, 0, 0, 0)\n    rect.x = math.min(rect1.x, rect2.x)\n    rect.y = math.min(rect1.y, rect2.y)\n    rect.width = math.max(rect1.x + rect1.width, rect2.x + rect2.width) - rect.x\n    rect.height = math.max(rect1.y + rect1.height, rect2.y + rect2.height) - rect.y\n    return rect\nend\n\nfunction cc.rectIntersection( rect1, rect2 )\n    local intersection = cc.rect(\n        math.max(rect1.x, rect2.x),\n        math.max(rect1.y, rect2.y),\n        0, 0)\n\n    intersection.width = math.min(rect1.x + rect1.width, rect2.x + rect2.width) - intersection.x\n    intersection.height = math.min(rect1.y + rect1.height, rect2.y + rect2.height) - intersection.y\n    return intersection\nend\n\n--Color3B\nfunction cc.c3b( _r,_g,_b )\n    return { r = _r, g = _g, b = _b }\nend\n\n--Color4B\nfunction cc.c4b( _r,_g,_b,_a )\n    return { r = _r, g = _g, b = _b, a = _a }\nend\n\n--Color4F\nfunction cc.c4f( _r,_g,_b,_a )\n    return { r = _r, g = _g, b = _b, a = _a }\nend\n\n--Vertex2F\nfunction cc.vertex2F(_x,_y)\n    return { x = _x, y = _y }\nend\n\n--Vertex3F\nfunction cc.Vertex3F(_x,_y,_z)\n    return { x = _x, y = _y, z = _z }\nend\n\n--Tex2F\nfunction cc.tex2F(_u,_v)\n    return { u = _u, v = _v }\nend\n\n--PointSprite\nfunction cc.PointSprite(_pos,_color,_size)\n    return { pos = _pos, color = _color, size = _size }\nend\n\n--Quad2\nfunction cc.Quad2(_tl,_tr,_bl,_br)\n    return { tl = _tl, tr = _tr, bl = _bl, br = _br }\nend\n\n--Quad3\nfunction cc.Quad3(_tl, _tr, _bl, _br)\n    return { tl = _tl, tr = _tr, bl = _bl, br = _br }\nend\n\n--V2F_C4B_T2F\nfunction cc.V2F_C4B_T2F(_vertices, _colors, _texCoords)\n    return { vertices = _vertices, colors = _colors, texCoords = _texCoords }\nend\n\n--V2F_C4F_T2F\nfunction cc.V2F_C4F_T2F(_vertices, _colors, _texCoords)\n    return { vertices = _vertices, colors = _colors, texCoords = _texCoords }\nend\n\n--V3F_C4B_T2F\nfunction cc.V3F_C4B_T2F(_vertices, _colors, _texCoords)\n    return { vertices = _vertices, colors = _colors, texCoords = _texCoords }\nend\n\n--V2F_C4B_T2F_Quad\nfunction cc.V2F_C4B_T2F_Quad(_bl, _br, _tl, _tr)\n    return { bl = _bl, br = _br, tl = _tl, tr = _tr }\nend\n\n--V3F_C4B_T2F_Quad\nfunction cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br)\n    return { tl = _tl, bl = _bl, tr = _tr, br = _br }\nend\n\n--V2F_C4F_T2F_Quad\nfunction cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr)\n    return { bl = _bl, br = _br, tl = _tl, tr = _tr }\nend\n\n--T2F_Quad\nfunction cc.T2F_Quad(_bl, _br, _tl, _tr)\n    return { bl = _bl, br = _br, tl = _tl, tr = _tr }\nend\n\n--AnimationFrameData\nfunction cc.AnimationFrameData( _texCoords, _delay, _size)\n    return { texCoords = _texCoords, delay = _delay, size = _size }\nend\n\n--PhysicsMaterial\nfunction cc.PhysicsMaterial(_density, _restitution, _friction)\n\treturn { density = _density, restitution = _restitution, friction = _friction }\nend\n\nlocal ConfigType = \n{\n    NONE = 0,\n    COCOSTUDIO = 1,\n}\n\nfunction __onParseConfig(configType,jasonStr)\n    if configType == ConfigType.COCOSTUDIO then\n        ccs.TriggerMng.getInstance():parse(jasonStr)\n    end\nend\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/Cocos2dConstants.lua",
    "content": "cc = cc or {}\n\ncc.SPRITE_INDEX_NOT_INITIALIZED = 0xffffffff\ncc.TMX_ORIENTATION_HEX  = 0x1\ncc.TMX_ORIENTATION_ISO  = 0x2\ncc.TMX_ORIENTATION_ORTHO    = 0x0\ncc.Z_COMPRESSION_BZIP2  = 0x1\ncc.Z_COMPRESSION_GZIP   = 0x2\ncc.Z_COMPRESSION_NONE   = 0x3\ncc.Z_COMPRESSION_ZLIB   = 0x0\ncc.BLEND_DST    = 0x303\ncc.BLEND_SRC    = 0x1\ncc.DIRECTOR_IOS_USE_BACKGROUND_THREAD   = 0x0\ncc.DIRECTOR_MAC_THREAD  = 0x0\ncc.DIRECTOR_STATS_INTERVAL  = 0.1\ncc.ENABLE_BOX2_D_INTEGRATION    = 0x0\ncc.ENABLE_DEPRECATED    = 0x1\ncc.ENABLE_GL_STATE_CACHE    = 0x1\ncc.ENABLE_PROFILERS = 0x0\ncc.ENABLE_STACKABLE_ACTIONS = 0x1\ncc.FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0x0\ncc.GL_ALL   = 0x0\ncc.LABELATLAS_DEBUG_DRAW    = 0x0\ncc.LABELBMFONT_DEBUG_DRAW   = 0x0\ncc.MAC_USE_DISPLAY_LINK_THREAD  = 0x0\ncc.MAC_USE_MAIN_THREAD  = 0x2\ncc.MAC_USE_OWN_THREAD   = 0x1\ncc.NODE_RENDER_SUBPIXEL = 0x1\ncc.PVRMIPMAP_MAX    = 0x10\ncc.SPRITEBATCHNODE_RENDER_SUBPIXEL  = 0x1\ncc.SPRITE_DEBUG_DRAW    = 0x0\ncc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP = 0x0\ncc.TEXTURE_ATLAS_USE_VAO    = 0x1\ncc.USE_L_A88_LABELS = 0x1\ncc.ACTION_TAG_INVALID   = -1\ncc.DEVICE_MAC   = 0x6\ncc.DEVICE_MAC_RETINA_DISPLAY    = 0x7\ncc.DEVICEI_PAD  = 0x4\ncc.DEVICEI_PAD_RETINA_DISPLAY   = 0x5\ncc.DEVICEI_PHONE    = 0x0\ncc.DEVICEI_PHONE5   = 0x2\ncc.DEVICEI_PHONE5_RETINA_DISPLAY    = 0x3\ncc.DEVICEI_PHONE_RETINA_DISPLAY = 0x1\ncc.DIRECTOR_PROJECTION2_D   = 0x0\ncc.DIRECTOR_PROJECTION3_D   = 0x1\ncc.DIRECTOR_PROJECTION_CUSTOM   = 0x2\ncc.DIRECTOR_PROJECTION_DEFAULT  = 0x1\ncc.FILE_UTILS_SEARCH_DIRECTORY_MODE = 0x1\ncc.FILE_UTILS_SEARCH_SUFFIX_MODE    = 0x0\ncc.FLIPED_ALL   = 0xe0000000\ncc.FLIPPED_MASK = 0x1fffffff\ncc.IMAGE_FORMAT_JPEG    = 0x0\ncc.IMAGE_FORMAT_PNG = 0x1\ncc.ITEM_SIZE    = 0x20\ncc.LABEL_AUTOMATIC_WIDTH    = -1\ncc.LINE_BREAK_MODE_CHARACTER_WRAP   = 0x1\ncc.LINE_BREAK_MODE_CLIP = 0x2\ncc.LINE_BREAK_MODE_HEAD_TRUNCATION  = 0x3\ncc.LINE_BREAK_MODE_MIDDLE_TRUNCATION    = 0x5\ncc.LINE_BREAK_MODE_TAIL_TRUNCATION  = 0x4\ncc.LINE_BREAK_MODE_WORD_WRAP    = 0x0\ncc.MAC_VERSION_10_6 = 0xa060000\ncc.MAC_VERSION_10_7 = 0xa070000\ncc.MAC_VERSION_10_8 = 0xa080000\ncc.MENU_HANDLER_PRIORITY    = -128\ncc.MENU_STATE_TRACKING_TOUCH    = 0x1\ncc.MENU_STATE_WAITING   = 0x0\ncc.NODE_TAG_INVALID = -1\ncc.PARTICLE_DURATION_INFINITY   = -1\ncc.PARTICLE_MODE_GRAVITY    = 0x0\ncc.PARTICLE_MODE_RADIUS = 0x1\ncc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS    = -1\ncc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE    = -1\ncc.POSITION_TYPE_FREE   = 0x0\ncc.POSITION_TYPE_GROUPED    = 0x2\ncc.POSITION_TYPE_RELATIVE   = 0x1\ncc.PRIORITY_NON_SYSTEM_MIN  = -2147483647\ncc.PRIORITY_SYSTEM  = -2147483648\ncc.PROGRESS_TIMER_TYPE_BAR  = 0x1\ncc.PROGRESS_TIMER_TYPE_RADIAL   = 0x0\ncc.REPEAT_FOREVER   = 0xfffffffe\ncc.RESOLUTION_MAC   = 0x1\ncc.RESOLUTION_MAC_RETINA_DISPLAY    = 0x2\ncc.RESOLUTION_UNKNOWN   = 0x0\ncc.TMX_TILE_DIAGONAL_FLAG   = 0x20000000\ncc.TMX_TILE_HORIZONTAL_FLAG = 0x80000000\ncc.TMX_TILE_VERTICAL_FLAG   = 0x40000000\ncc.TEXT_ALIGNMENT_CENTER    = 0x1\ncc.TEXT_ALIGNMENT_LEFT  = 0x0\ncc.TEXT_ALIGNMENT_RIGHT = 0x2\n\ncc.TEXTURE2_D_PIXEL_FORMAT_AUTO = 0x0\ncc.TEXTURE2_D_PIXEL_FORMAT_BGR_A8888 = 0x1\ncc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888 = 0x2\ncc.TEXTURE2_D_PIXEL_FORMAT_RG_B888    = 0x3\ncc.TEXTURE2_D_PIXEL_FORMAT_RG_B565   = 0x4\ncc.TEXTURE2_D_PIXEL_FORMAT_A8        = 0x5\ncc.TEXTURE2_D_PIXEL_FORMAT_I8        = 0x6\ncc.TEXTURE2_D_PIXEL_FORMAT_A_I88     = 0x7\ncc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444     = 0x8\ncc.TEXTURE2_D_PIXEL_FORMAT_RGB5_A1       = 0x9\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4        = 0xa\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4A       = 0xb\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2        = 0xc\ncc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2A       = 0xd\ncc.TEXTURE2_D_PIXEL_FORMAT_ETC           = 0xe\ncc.TEXTURE2_D_PIXEL_FORMAT_S3TC_DXT1     = 0xf\ncc.TEXTURE2_D_PIXEL_FORMAT_S3TC_DXT3     = 0x10\ncc.TEXTURE2_D_PIXEL_FORMAT_S3TC_DXT5     = 0x11\ncc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT       = 0x0\ncc.TOUCHES_ALL_AT_ONCE  = 0x0\ncc.TOUCHES_ONE_BY_ONE   = 0x1\ncc.TRANSITION_ORIENTATION_DOWN_OVER = 0x1\ncc.TRANSITION_ORIENTATION_LEFT_OVER = 0x0\ncc.TRANSITION_ORIENTATION_RIGHT_OVER    = 0x1\ncc.TRANSITION_ORIENTATION_UP_OVER   = 0x0\ncc.UNIFORM_COS_TIME = 0x5\ncc.UNIFORM_MV_MATRIX    = 0x1\ncc.UNIFORM_MVP_MATRIX   = 0x2\ncc.UNIFORM_P_MATRIX = 0x0\ncc.UNIFORM_RANDOM01 = 0x6\ncc.UNIFORM_SAMPLER  = 0x7\ncc.UNIFORM_SIN_TIME = 0x4\ncc.UNIFORM_TIME = 0x3\ncc.UNIFORM_MAX  = 0x8\ncc.VERTEX_ATTRIB_FLAG_COLOR = 0x2\ncc.VERTEX_ATTRIB_FLAG_NONE  = 0x0\ncc.VERTEX_ATTRIB_FLAG_POS_COLOR_TEX = 0x7\ncc.VERTEX_ATTRIB_FLAG_POSITION  = 0x1\ncc.VERTEX_ATTRIB_FLAG_TEX_COORDS    = 0x4\ncc.VERTEX_ATTRIB_COLOR  = 0x1\ncc.VERTEX_ATTRIB_MAX    = 0x3\ncc.VERTEX_ATTRIB_POSITION   = 0x0\ncc.VERTEX_ATTRIB_TEX_COORDS = 0x2\ncc.VERTICAL_TEXT_ALIGNMENT_BOTTOM   = 0x2\ncc.VERTICAL_TEXT_ALIGNMENT_CENTER   = 0x1\ncc.VERTICAL_TEXT_ALIGNMENT_TOP  = 0x0\ncc.OS_VERSION_4_0   = 0x4000000\ncc.OS_VERSION_4_0_1 = 0x4000100\ncc.OS_VERSION_4_1   = 0x4010000\ncc.OS_VERSION_4_2   = 0x4020000\ncc.OS_VERSION_4_2_1 = 0x4020100\ncc.OS_VERSION_4_3   = 0x4030000\ncc.OS_VERSION_4_3_1 = 0x4030100\ncc.OS_VERSION_4_3_2 = 0x4030200\ncc.OS_VERSION_4_3_3 = 0x4030300\ncc.OS_VERSION_4_3_4 = 0x4030400\ncc.OS_VERSION_4_3_5 = 0x4030500\ncc.OS_VERSION_5_0   = 0x5000000\ncc.OS_VERSION_5_0_1 = 0x5000100\ncc.OS_VERSION_5_1_0 = 0x5010000\ncc.OS_VERSION_6_0_0 = 0x6000000\ncc.ANIMATION_FRAME_DISPLAYED_NOTIFICATION   = 'CCAnimationFrameDisplayedNotification'\ncc.CHIPMUNK_IMPORT  = 'chipmunk.h'\ncc.ATTRIBUTE_NAME_COLOR = 'a_color'\ncc.ATTRIBUTE_NAME_POSITION  = 'a_position'\ncc.ATTRIBUTE_NAME_TEX_COORD = 'a_texCoord'\ncc.SHADER_POSITION_COLOR    = 'ShaderPositionColor'\ncc.SHADER_POSITION_LENGTH_TEXURE_COLOR  = 'ShaderPositionLengthTextureColor'\ncc.SHADER_POSITION_TEXTURE  = 'ShaderPositionTexture'\ncc.SHADER_POSITION_TEXTURE_A8_COLOR = 'ShaderPositionTextureA8Color'\ncc.SHADER_POSITION_TEXTURE_COLOR    = 'ShaderPositionTextureColor'\ncc.SHADER_POSITION_TEXTURE_COLOR_ALPHA_TEST = 'ShaderPositionTextureColorAlphaTest'\ncc.SHADER_POSITION_TEXTURE_U_COLOR  = 'ShaderPositionTexture_uColor'\ncc.SHADER_POSITION_U_COLOR  = 'ShaderPosition_uColor'\ncc.UNIFORM_ALPHA_TEST_VALUE_S   = 'CC_AlphaValue'\ncc.UNIFORM_COS_TIME_S   = 'CC_CosTime'\ncc.UNIFORM_MV_MATRIX_S  = 'CC_MVMatrix'\ncc.UNIFORM_MVP_MATRIX_S = 'CC_MVPMatrix'\ncc.UNIFORM_P_MATRIX_S   = 'CC_PMatrix'\ncc.UNIFORM_RANDOM01_S   = 'CC_Random01'\ncc.UNIFORM_SAMPLER_S    = 'CC_Texture0'\ncc.UNIFORM_SIN_TIME_S   = 'CC_SinTime'\ncc.UNIFORM_TIME_S   = 'CC_Time'\n\ncc.PLATFORM_OS_WINDOWS = 0\ncc.PLATFORM_OS_LINUX   = 1\ncc.PLATFORM_OS_MAC     = 2\ncc.PLATFORM_OS_ANDROID = 3\ncc.PLATFORM_OS_IPHONE  = 4\ncc.PLATFORM_OS_IPAD    = 5\ncc.PLATFORM_OS_BLACKBERRY = 6\ncc.PLATFORM_OS_NACL    = 7\ncc.PLATFORM_OS_EMSCRIPTEN = 8\ncc.PLATFORM_OS_TIZEN   = 9\n\ncc.SCROLLVIEW_SCRIPT_SCROLL = 0\ncc.SCROLLVIEW_SCRIPT_ZOOM   = 1\ncc.TABLECELL_TOUCHED        = 2\ncc.TABLECELL_HIGH_LIGHT     = 3\ncc.TABLECELL_UNHIGH_LIGHT   = 4\ncc.TABLECELL_WILL_RECYCLE   = 5\ncc.TABLECELL_SIZE_FOR_INDEX = 6\ncc.TABLECELL_SIZE_AT_INDEX  = 7\ncc.NUMBER_OF_CELLS_IN_TABLEVIEW = 8\n\ncc.SCROLLVIEW_DIRECTION_NONE = -1\ncc.SCROLLVIEW_DIRECTION_HORIZONTAL = 0\ncc.SCROLLVIEW_DIRECTION_VERTICAL = 1\ncc.SCROLLVIEW_DIRECTION_BOTH  = 2\n\ncc.CONTROL_EVENTTYPE_TOUCH_DOWN = 1\ncc.CONTROL_EVENTTYPE_DRAG_INSIDE = 2\ncc.CONTROL_EVENTTYPE_DRAG_OUTSIDE = 4\ncc.CONTROL_EVENTTYPE_DRAG_ENTER = 8\ncc.CONTROL_EVENTTYPE_DRAG_EXIT = 16\ncc.CONTROL_EVENTTYPE_TOUCH_UP_INSIDE = 32\ncc.CONTROL_EVENTTYPE_TOUCH_UP_OUTSIDE = 64\ncc.CONTROL_EVENTTYPE_TOUCH_CANCEL    = 128\ncc.CONTROL_EVENTTYPE_VALUE_CHANGED   = 256\n\ncc.CONTROL_STATE_NORMAL  = 1\ncc.CONTROL_STATE_HIGH_LIGHTED = 2\ncc.CONTROL_STATE_DISABLED = 4\ncc.CONTROL_STATE_SELECTED = 8\n\n\ncc.KEYBOARD_RETURNTYPE_DEFAULT = 0\ncc.KEYBOARD_RETURNTYPE_DONE = 1\ncc.KEYBOARD_RETURNTYPE_SEND = 2\ncc.KEYBOARD_RETURNTYPE_SEARCH = 3\ncc.KEYBOARD_RETURNTYPE_GO = 4\n\n\ncc.EDITBOX_INPUT_MODE_ANY = 0\ncc.EDITBOX_INPUT_MODE_EMAILADDR = 1\ncc.EDITBOX_INPUT_MODE_NUMERIC = 2\ncc.EDITBOX_INPUT_MODE_PHONENUMBER = 3\ncc.EDITBOX_INPUT_MODE_URL = 4\ncc.EDITBOX_INPUT_MODE_DECIMAL = 5\ncc.EDITBOX_INPUT_MODE_SINGLELINE = 6\n\n\ncc.EDITBOX_INPUT_FLAG_PASSWORD = 0\ncc.EDITBOX_INPUT_FLAG_SENSITIVE = 1\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_WORD = 2\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_SENTENCE = 3\ncc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_ALL_CHARACTERS = 4\n\ncc.LANGUAGE_ENGLISH    = 0\ncc.LANGUAGE_CHINESE    = 1\ncc.LANGUAGE_FRENCH     = 2\ncc.LANGUAGE_ITALIAN    = 3\ncc.LANGUAGE_GERMAN     = 4\ncc.LANGUAGE_SPANISH    = 5\ncc.LANGUAGE_RUSSIAN    = 6\ncc.LANGUAGE_KOREAN     = 7\ncc.LANGUAGE_JAPANESE   = 8\ncc.LANGUAGE_HUNGARIAN  = 9\ncc.LANGUAGE_PORTUGUESE = 10\ncc.LANGUAGE_ARABIC     = 11\n\ncc.NODE_ON_ENTER       = 0\ncc.NODE_ON_EXIT        = 1\ncc.NODE_ON_ENTER_TRANSITION_DID_FINISH = 2\ncc.NODE_ON_EXIT_TRANSITION_DID_START   = 3 \ncc.NODE_ON_CLEAN_UP    = 4\n\ncc.CONTROL_STEPPER_PART_MINUS = 0\ncc.CONTROL_STEPPER_PART_PLUS  = 1\ncc.CONTROL_STEPPER_PART_NONE  = 2\n\ncc.TABLEVIEW_FILL_TOPDOWN = 0\ncc.TABLEVIEW_FILL_BOTTOMUP = 1\n\ncc.WEBSOCKET_OPEN     = 0\ncc.WEBSOCKET_MESSAGE  = 1\ncc.WEBSOCKET_CLOSE    = 2\ncc.WEBSOCKET_ERROR    = 3\n\ncc.WEBSOCKET_STATE_CONNECTING = 0\ncc.WEBSOCKET_STATE_OPEN       = 1\ncc.WEBSOCKET_STATE_CLOSING    = 2\ncc.WEBSOCKET_STATE_CLOSED     = 3\n\n\ncc.XMLHTTPREQUEST_RESPONSE_STRING = 0\ncc.XMLHTTPREQUEST_RESPONSE_ARRAY_BUFFER = 1\ncc.XMLHTTPREQUEST_RESPONSE_BLOB   = 2\ncc.XMLHTTPREQUEST_RESPONSE_DOCUMENT = 3\ncc.XMLHTTPREQUEST_RESPONSE_JSON = 4\n\ncc.ASSETSMANAGER_CREATE_FILE  = 0\ncc.ASSETSMANAGER_NETWORK = 1\ncc.ASSETSMANAGER_NO_NEW_VERSION = 2\ncc.ASSETSMANAGER_UNCOMPRESS     = 3\n\ncc.ASSETSMANAGER_PROTOCOL_PROGRESS =  0\ncc.ASSETSMANAGER_PROTOCOL_SUCCESS  =  1\ncc.ASSETSMANAGER_PROTOCOL_ERROR    =  2\n\ncc.Handler = cc.Handler or {}\ncc.Handler.NODE            = 0\ncc.Handler.MENU_CLICKED    = 1\ncc.Handler.CALLFUNC        = 2\ncc.Handler.SCHEDULE        = 3\ncc.Handler.TOUCHES         = 4\ncc.Handler.KEYPAD          = 5\ncc.Handler.ACCELEROMETER   = 6\ncc.Handler.CONTROL_TOUCH_DOWN = 7\ncc.Handler.CONTROL_TOUCH_DRAG_INSIDE = 8\ncc.Handler.CONTROL_TOUCH_DRAG_OUTSIDE = 9\ncc.Handler.CONTROL_TOUCH_DRAG_ENTER = 10\ncc.Handler.CONTROL_TOUCH_DRAG_EXIT  = 11\ncc.Handler.CONTROL_TOUCH_UP_INSIDE  = 12\ncc.Handler.CONTROL_TOUCH_UP_OUTSIDE = 13\ncc.Handler.CONTROL_TOUCH_UP_CANCEL  = 14\ncc.Handler.CONTROL_VALUE_CHANGED    = 15\ncc.Handler.WEBSOCKET_OPEN           = 16\ncc.Handler.WEBSOCKET_MESSAGE        = 17\ncc.Handler.WEBSOCKET_CLOSE          = 18\ncc.Handler.WEBSOCKET_ERROR          = 19\ncc.Handler.GL_NODE_DRAW             = 20\ncc.Handler.SCROLLVIEW_SCROLL        = 21\ncc.Handler.SCROLLVIEW_ZOOM          = 22\ncc.Handler.TABLECELL_TOUCHED        = 23\ncc.Handler.TABLECELL_HIGHLIGHT      = 24\ncc.Handler.TABLECELL_UNHIGHLIGHT    = 25\ncc.Handler.TABLECELL_WILL_RECYCLE   = 26\ncc.Handler.TABLECELL_SIZE_FOR_INDEX = 27\ncc.Handler.TABLECELL_AT_INDEX       = 28\ncc.Handler.TABLEVIEW_NUMS_OF_CELLS  = 29\ncc.Handler.HTTPREQUEST_STATE_CHANGE = 30\ncc.Handler.ASSETSMANAGER_PROGRESS = 31\ncc.Handler.ASSETSMANAGER_SUCCESS  = 32\ncc.Handler.ASSETSMANAGER_ERROR    = 33\ncc.Handler.STUDIO_EVENT_LISTENER  = 34\ncc.Handler.ARMATURE_EVENT         = 35\ncc.Handler.EVENT_ACC              = 36\ncc.Handler.EVENT_CUSTIOM          = 37\ncc.Handler.EVENT_KEYBOARD_PRESSED = 38\ncc.Handler.EVENT_KEYBOARD_RELEASED = 39\ncc.Handler.EVENT_TOUCH_BEGAN      = 40\ncc.Handler.EVENT_TOUCH_MOVED      = 41\ncc.Handler.EVENT_TOUCH_ENDED      = 42\ncc.Handler.EVENT_TOUCH_CANCELLED  = 43\ncc.Handler.EVENT_TOUCHES_BEGAN    = 44\ncc.Handler.EVENT_TOUCHES_MOVED    = 45\ncc.Handler.EVENT_TOUCHES_ENDED    = 46\ncc.Handler.EVENT_TOUCHES_CANCELLED = 47\ncc.Handler.EVENT_MOUSE_DOWN       = 48\ncc.Handler.EVENT_MOUSE_UP         = 49\ncc.Handler.EVENT_MOUSE_MOVE       = 50\ncc.Handler.EVENT_MOUSE_SCROLL     = 51\ncc.Handler.EVENT_SPINE            = 52\ncc.Handler.EVENT_PHYSICS_CONTACT_BEGIN = 53\ncc.Handler.EVENT_PHYSICS_CONTACT_PRESOLVE = 54\ncc.Handler.EVENT_PHYSICS_CONTACT_POSTSOLVE = 55\ncc.Handler.EVENT_PHYSICS_CONTACT_SEPERATE = 56\n\ncc.EVENT_UNKNOWN = 0\ncc.EVENT_TOUCH_ONE_BY_ONE      = 1\ncc.EVENT_TOUCH_ALL_AT_ONCE     = 2\ncc.EVENT_KEYBOARD              = 3\ncc.EVENT_MOUSE                 = 4\ncc.EVENT_ACCELERATION          = 5\ncc.EVENT_CUSTOM                = 6\n\ncc.PHYSICSSHAPE_MATERIAL_DEFAULT = {density = 0.0, restitution = 0.5, friction = 0.5}\ncc.PHYSICSBODY_MATERIAL_DEFAULT = {density = 0.1, restitution = 0.5, friction = 0.5}\ncc.GLYPHCOLLECTION_DYNAMIC = 0\ncc.GLYPHCOLLECTION_NEHE    = 1\ncc.GLYPHCOLLECTION_ASCII   = 2\ncc.GLYPHCOLLECTION_CUSTOM  = 3\n\ncc.LabelEffect = \n{\n    NORMAL  = 0,\n    OUTLINE = 1,\n    SHADOW  = 2,\n    GLOW    = 3,\n}\n\ncc.KeyCode =\n{\n    KEY_NONE              = 0,\n    KEY_PAUSE             = 0x0013,\n    KEY_SCROLL_LOCK       = 0x1014,\n    KEY_PRINT             = 0x1061,\n    KEY_SYSREQ            = 0x106A,\n    KEY_BREAK             = 0x106B,\n    KEY_ESCAPE            = 0x001B,\n    KEY_BACKSPACE         = 0x0008,\n    KEY_TAB               = 0x0009,\n    KEY_BACK_TAB          = 0x0089,\n    KEY_RETURN            = 0x000D,\n    KEY_CAPS_LOCK         = 0x00E5,\n    KEY_SHIFT             = 0x00E1,\n    KEY_CTRL              = 0x00E3,\n    KEY_ALT               = 0x00E9,\n    KEY_MENU              = 0x1067,\n    KEY_HYPER             = 0x10ED,\n    KEY_INSERT            = 0x1063,\n    KEY_HOME              = 0x1050,\n    KEY_PG_UP             = 0x1055,\n    KEY_DELETE            = 0x10FF,\n    KEY_END               = 0x1057,\n    KEY_PG_DOWN           = 0x1056,\n    KEY_LEFT_ARROW        = 0x1051,\n    KEY_RIGHT_ARROW       = 0x1053,\n    KEY_UP_ARROW          = 0x1052,\n    KEY_DOWN_ARROW        = 0x1054,\n    KEY_NUM_LOCK          = 0x107F,\n    KEY_KP_PLUS           = 0x10AB,\n    KEY_KP_MINUS          = 0x10AD,\n    KEY_KP_MULTIPLY       = 0x10AA,\n    KEY_KP_DIVIDE         = 0x10AF,\n    KEY_KP_ENTER          = 0x108D,\n    KEY_KP_HOME           = 0x10B7,\n    KEY_KP_UP             = 0x10B8,\n    KEY_KP_PG_UP          = 0x10B9,\n    KEY_KP_LEFT           = 0x10B4,\n    KEY_KP_FIVE           = 0x10B5,\n    KEY_KP_RIGHT          = 0x10B6,\n    KEY_KP_END            = 0x10B1,\n    KEY_KP_DOWN           = 0x10B2,\n    KEY_KP_PG_DOWN        = 0x10B3,\n    KEY_KP_INSERT         = 0x10B0,\n    KEY_KP_DELETE         = 0x10AE,\n    KEY_F1                = 0x00BE,\n    KEY_F2                = 0x00BF,\n    KEY_F3                = 0x00C0,\n    KEY_F4                = 0x00C1,\n    KEY_F5                = 0x00C2,\n    KEY_F6                = 0x00C3,\n    KEY_F7                = 0x00C4,\n    KEY_F8                = 0x00C5,\n    KEY_F9                = 0x00C6,\n    KEY_F10               = 0x00C7,\n    KEY_F11               = 0x00C8,\n    KEY_F12               = 0x00C9,\n    KEY_SPACE             = ' ',\n    KEY_EXCLAM            = '!',\n    KEY_QUOTE             = '\"',\n    KEY_NUMBER            = '#',\n    KEY_DOLLAR            = '$',\n    KEY_PERCENT           = '%',\n    KEY_CIRCUMFLEX        = '^',\n    KEY_AMPERSAND         = '&',\n    KEY_APOSTROPHE        = '\\'',\n    KEY_LEFT_PARENTHESIS  = '(',\n    KEY_RIGHT_PARENTHESIS = ')',\n    KEY_ASTERISK          = '*',\n    KEY_PLUS              = '+',\n    KEY_COMMA             = ',',\n    KEY_MINUS             = '-',\n    KEY_PERIOD            = '.',\n    KEY_SLASH             = '/',\n    KEY_0                 = '0',\n    KEY_1                 = '1',\n    KEY_2                 = '2',\n    KEY_3                 = '3',\n    KEY_4                 = '4',\n    KEY_5                 = '5',\n    KEY_6                 = '6',\n    KEY_7                 = '7',\n    KEY_8                 = '8',\n    KEY_9                 = '9',\n    KEY_COLON             = ':',\n    KEY_SEMICOLON         = ';',\n    KEY_LESS_THAN         = '<',\n    KEY_EQUAL             = '=',\n    KEY_GREATER_THAN      = '>',\n    KEY_QUESTION          = '?',\n    KEY_AT                = '@',\n    KEY_CAPITAL_A         = 'A',\n    KEY_CAPITAL_B         = 'B',\n    KEY_CAPITAL_C         = 'C',\n    KEY_CAPITAL_D         = 'D',\n    KEY_CAPITAL_E         = 'E',\n    KEY_CAPITAL_F         = 'F',\n    KEY_CAPITAL_G         = 'G',\n    KEY_CAPITAL_H         = 'H',\n    KEY_CAPITAL_I         = 'I',\n    KEY_CAPITAL_J         = 'J',\n    KEY_CAPITAL_K         = 'K',\n    KEY_CAPITAL_L         = 'L',\n    KEY_CAPITAL_M         = 'M',\n    KEY_CAPITAL_N         = 'N',\n    KEY_CAPITAL_O         = 'O',\n    KEY_CAPITAL_P         = 'P',\n    KEY_CAPITAL_Q         = 'Q',\n    KEY_CAPITAL_R         = 'R',\n    KEY_CAPITAL_S         = 'S',\n    KEY_CAPITAL_T         = 'T',\n    KEY_CAPITAL_U         = 'U',\n    KEY_CAPITAL_V         = 'V',\n    KEY_CAPITAL_W         = 'W',\n    KEY_CAPITAL_X         = 'X',\n    KEY_CAPITAL_Y         = 'Y',\n    KEY_CAPITAL_Z         = 'Z',\n    KEY_LEFT_BRACKET      = '[',\n    KEY_BACK_SLASH        = '\\\\',\n    KEY_RIGHT_BRACKET     = ']',\n    KEY_UNDERSCORE        = '_',\n    KEY_GRAVE             = '`',\n    KEY_A                 = 'a',\n    KEY_B                 = 'b',\n    KEY_C                 = 'c',\n    KEY_D                 = 'd',\n    KEY_E                 = 'e',\n    KEY_F                 = 'f',\n    KEY_G                 = 'g',\n    KEY_H                 = 'h',\n    KEY_I                 = 'i',\n    KEY_J                 = 'j',\n    KEY_K                 = 'k',\n    KEY_L                 = 'l',\n    KEY_M                 = 'm',\n    KEY_N                 = 'n',\n    KEY_O                 = 'o',\n    KEY_P                 = 'p',\n    KEY_Q                 = 'q',\n    KEY_R                 = 'r',\n    KEY_S                 = 's',\n    KEY_T                 = 't',\n    KEY_U                 = 'u',\n    KEY_V                 = 'v',\n    KEY_W                 = 'w',\n    KEY_X                 = 'x',\n    KEY_Y                 = 'y',\n    KEY_Z                 = 'z',\n    KEY_LEFT_BRACE        = '{',\n    KEY_BAR               = '|',\n    KEY_RIGHT_BRACE       = '}',\n    KEY_TILDE             = '~',\n    KEY_EURO              = 0x20AC,\n    KEY_POUND             = 0x00A3,\n    KEY_YEN               = 0x00A5,\n    KEY_MIDDLE_DOT        = 0x0095,\n    KEY_SEARCH            = 0xFFAA,\n};\n\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/Deprecated.lua",
    "content": "require \"Cocos2d.lua\"\n--tip\nlocal function deprecatedTip(old_name,new_name)\n    print(\"\\n********** \\n\"..old_name..\" was deprecated please use \".. new_name .. \" instead.\\n**********\")\nend\n\n\n--functions of CCDirector will be deprecated,begin\nlocal CCDirectorDeprecated = { }\nfunction CCDirectorDeprecated.sharedDirector()\n    deprecatedTip(\"CCDirector:sharedDirector\",\"cc.Director:getInstance\")\n    return cc.Director:getInstance()\nend\nrawset(CCDirector,\"sharedDirector\",CCDirectorDeprecated.sharedDirector)\n--functions of CCDirector will be deprecated,end\n\n\n--functions of CCTextureCache will be deprecated begin\nlocal TextureCacheDeprecated = {}\nfunction TextureCacheDeprecated.getInstance(self)\n    deprecatedTip(\"cc.TextureCache:getInstance\",\"cc.Director:getInstance():getTextureCache\")\n    return cc.Director:getInstance():getTextureCache()\nend\nrawset(cc.TextureCache,\"getInstance\",TextureCacheDeprecated.getInstance)\n\nfunction TextureCacheDeprecated.destroyInstance(self)\n    deprecatedTip(\"cc.TextureCache:destroyInstance\",\"cc.Director:getInstance():destroyTextureCache\")\n    return cc.Director:getInstance():destroyTextureCache()\nend\nrawset(cc.TextureCache,\"destroyInstance\",TextureCacheDeprecated.destroyInstance)\n\nfunction TextureCacheDeprecated.dumpCachedTextureInfo(self)\n    deprecatedTip(\"self:dumpCachedTextureInfo\",\"self:getCachedTextureInfo\")\n    return print(self:getCachedTextureInfo())\nend\nrawset(cc.TextureCache,\"dumpCachedTextureInfo\",TextureCacheDeprecated.dumpCachedTextureInfo)\n\nlocal CCTextureCacheDeprecated = { }\nfunction CCTextureCacheDeprecated.sharedTextureCache()\n    deprecatedTip(\"CCTextureCache:sharedTextureCache\",\"CCTextureCache:getInstance\")\n    return cc.TextureCache:getInstance()\nend\nrawset(CCTextureCache,\"sharedTextureCache\",CCTextureCacheDeprecated.sharedTextureCache)\n\nfunction CCTextureCacheDeprecated.purgeSharedTextureCache()\n    deprecatedTip(\"CCTextureCache:purgeSharedTextureCache\",\"CCTextureCache:destroyInstance\")\n    return cc.TextureCache:destroyInstance()\nend\nrawset(CCTextureCache,\"purgeSharedTextureCache\",CCTextureCacheDeprecated.purgeSharedTextureCache)\n\nfunction CCTextureCacheDeprecated.addUIImage(self, image, key)\n    deprecatedTip(\"CCTextureCache:addUIImage\",\"CCTextureCache:addImage\")\n    return self:addImage(image,key)\nend\nrawset(CCTextureCache,\"addUIImage\",CCTextureCacheDeprecated.addUIImage)\n--functions of CCTextureCache will be deprecated end\n\n--functions of CCAnimation will be deprecated begin\nlocal CCAnimationDeprecated = {}\nfunction CCAnimationDeprecated.addSpriteFrameWithFileName(self,...)\n    deprecatedTip(\"CCAnimationDeprecated:addSpriteFrameWithFileName\",\"cc.Animation:addSpriteFrameWithFile\")\n    return self:addSpriteFrameWithFile(...)\nend\nrawset(CCAnimation,\"addSpriteFrameWithFileName\",CCAnimationDeprecated.addSpriteFrameWithFileName)\n--functions of CCAnimation will be deprecated end\n\n\n--functions of CCAnimationCache will be deprecated begin\nlocal CCAnimationCacheDeprecated = { }\nfunction CCAnimationCacheDeprecated.sharedAnimationCache()\n    deprecatedTip(\"CCAnimationCache:sharedAnimationCache\",\"CCAnimationCache:getInstance\")\n    return CCAnimationCache:getInstance()\nend\nrawset(CCAnimationCache,\"sharedAnimationCache\",CCAnimationCacheDeprecated.sharedAnimationCache)\n\nfunction CCAnimationCacheDeprecated.purgeSharedAnimationCache()\n    deprecatedTip(\"CCAnimationCache:purgeSharedAnimationCache\",\"CCAnimationCache:destroyInstance\")\n    return CCAnimationCache:destroyInstance()\nend\nrawset(CCAnimationCache,\"purgeSharedAnimationCache\",CCAnimationCacheDeprecated.purgeSharedAnimationCache)\n\nfunction CCAnimationCacheDeprecated.addAnimationsWithFile(self,...)\n    deprecatedTip(\"CCAnimationCache:addAnimationsWithFile\",\"cc.AnimationCache:addAnimations\")\n    return self:addAnimations(...)\nend\nrawset(CCAnimationCache,\"addAnimationsWithFile\",CCAnimationCacheDeprecated.addAnimationsWithFile)\n\nfunction CCAnimationCacheDeprecated.animationByName(self,...)\n    deprecatedTip(\"CCAnimationCache:animationByName\",\"cc.AnimationCache:getAnimation\")\n    return self:getAnimation(...)\nend\nrawset(CCAnimationCache,\"animationByName\",CCAnimationCacheDeprecated.animationByName)\n\nfunction CCAnimationCacheDeprecated.removeAnimationByName(self)\n    deprecatedTip(\"CCAnimationCache:removeAnimationByName\",\"cc.AnimationCache:removeAnimation\")\n    return self:removeAnimation()\nend\nrawset(CCAnimationCache,\"removeAnimationByName\",CCAnimationCacheDeprecated.removeAnimationByName)\n--functions of CCAnimationCache will be deprecated end\n\n--functions of CCFileUtils will be deprecated end\nlocal CCFileUtilsDeprecated = { }\nfunction CCFileUtilsDeprecated.sharedFileUtils()\n    deprecatedTip(\"CCFileUtils:sharedFileUtils\",\"CCFileUtils:getInstance\")\n    return cc.FileUtils:getInstance()\nend\nrawset(CCFileUtils,\"sharedFileUtils\",CCFileUtilsDeprecated.sharedFileUtils)\n\nfunction CCFileUtilsDeprecated.purgeFileUtils()\n    deprecatedTip(\"CCFileUtils:purgeFileUtils\",\"CCFileUtils:destroyInstance\")\n    return cc.FileUtils:destroyInstance()\nend\nrawset(CCFileUtils,\"purgeFileUtils\",CCFileUtilsDeprecated.purgeFileUtils)\n--functions of CCFileUtils will be deprecated end\n\n\n--functions of SimpleAudioEngine will be deprecated begin\nlocal SimpleAudioEngineDeprecated = { }\nfunction SimpleAudioEngineDeprecated.sharedEngine()\n    deprecatedTip(\"SimpleAudioEngine:sharedEngine\",\"SimpleAudioEngine:getInstance\")\n    return cc.SimpleAudioEngine:getInstance()\nend\nrawset(SimpleAudioEngine,\"sharedEngine\",SimpleAudioEngineDeprecated.sharedEngine)\n\nfunction SimpleAudioEngineDeprecated.playBackgroundMusic(self,...)\n    deprecatedTip(\"SimpleAudioEngine:playBackgroundMusic\",\"SimpleAudioEngine:playMusic\")\n    return self:playMusic(...)\nend\nrawset(SimpleAudioEngine,\"playBackgroundMusic\",SimpleAudioEngineDeprecated.playBackgroundMusic)\n--functions of SimpleAudioEngine will be deprecated end\n\n--functions of CCMenu will be deprecated begin\nlocal CCMenuDeprecated = { }\nfunction CCMenuDeprecated.createWithItem(self,...)\n    deprecatedTip(\"CCMenuDeprecated:createWithItem\",\"cc.Menu:createWithItem\")\n    return self:create(...)\nend\nrawset(CCMenu,\"createWithItem\",CCMenuDeprecated.createWithItem)\n\nfunction CCMenuDeprecated.setHandlerPriority(self)\n    print(\"\\n********** \\n\"..\"setHandlerPriority was deprecated in 3.0. \\n**********\")\nend\nrawset(CCMenu,\"setHandlerPriority\",CCMenuDeprecated.setHandlerPriority)\n--functions of CCMenu will be deprecated end\n\n--functions of CCNode will be deprecated begin\nlocal CCNodeDeprecated = { }\n\nfunction CCNodeDeprecated.boundingBox(self)\n    deprecatedTip(\"CCNode:boundingBox\",\"cc.Node:getBoundingBox\")\n    return self:getBoundingBox()\nend\nrawset(CCNode,\"boundingBox\",CCNodeDeprecated.boundingBox)\n\n\nfunction CCNodeDeprecated.numberOfRunningActions(self)\n    deprecatedTip(\"CCNode:numberOfRunningActions\",\"cc.Node:getNumberOfRunningActions\")\n    return self:getNumberOfRunningActions()\nend\nrawset(CCNode,\"numberOfRunningActions\",CCNodeDeprecated.numberOfRunningActions)\n\n\nfunction CCNodeDeprecated.removeFromParentAndCleanup(self,...)\n    deprecatedTip(\"CCNode:removeFromParentAndCleanup\",\"cc.Node:removeFromParent\")\n    return self:removeFromParent(...)\nend\nrawset(CCNode,\"removeFromParentAndCleanup\",CCNodeDeprecated.removeFromParentAndCleanup)\n--functions of CCNode will be deprecated end\n\n--CCDrawPrimitives will be deprecated begin\nlocal function CCDrawPrimitivesClassDeprecated()\n    deprecatedTip(\"CCDrawPrimitives\",\"cc.DrawPrimitives\")\n    return cc.DrawPrimitives\nend\n_G[\"CCDrawPrimitives\"] = CCDrawPrimitivesClassDeprecated()\n--functions of CCDrawPrimitives will be deprecated begin\nlocal CCDrawPrimitivesDeprecated = { }\nfunction CCDrawPrimitivesDeprecated.ccDrawPoint(pt)\n    deprecatedTip(\"ccDrawPoint\",\"cc.DrawPrimitives.drawPoint\")\n    return cc.DrawPrimitives.drawPoint(pt)\nend\nrawset(_G, \"ccDrawPoint\", CCDrawPrimitivesDeprecated.ccDrawPoint)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawLine(origin,destination)\n    deprecatedTip(\"ccDrawLine\",\"cc.DrawPrimitives.drawLine\")\n    return cc.DrawPrimitives.drawLine(origin,destination)\nend\nrawset(_G, \"ccDrawLine\", CCDrawPrimitivesDeprecated.ccDrawLine)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawRect(origin,destination)\n    deprecatedTip(\"ccDrawRect\",\"cc.DrawPrimitives.drawRect\")\n    return cc.DrawPrimitives.drawRect(origin,destination)\nend\nrawset(_G, \"ccDrawRect\", CCDrawPrimitivesDeprecated.ccDrawRect)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawSolidRect(origin,destination,color)\n    deprecatedTip(\"ccDrawSolidRect\",\"cc.DrawPrimitives.drawSolidRect\")\n    return cc.DrawPrimitives.drawSolidRect(origin,destination,color)\nend\nrawset(_G, \"ccDrawSolidRect\", CCDrawPrimitivesDeprecated.ccDrawSolidRect)\n\n-- params:... may represent two param(xScale,yScale) or nil\nfunction CCDrawPrimitivesDeprecated.ccDrawCircle(center,radius,angle,segments,drawLineToCenter,...)\n    deprecatedTip(\"ccDrawCircle\",\"cc.DrawPrimitives.drawCircle\")\n    return cc.DrawPrimitives.drawCircle(center,radius,angle,segments,drawLineToCenter,...)\nend\nrawset(_G, \"ccDrawCircle\", CCDrawPrimitivesDeprecated.ccDrawCircle)\n\n-- params:... may represent two param(xScale,yScale) or nil\nfunction CCDrawPrimitivesDeprecated.ccDrawSolidCircle(center,radius,angle,segments,...)\n    deprecatedTip(\"ccDrawSolidCircle\",\"cc.DrawPrimitives.drawSolidCircle\")\n    return cc.DrawPrimitives.drawSolidCircle(center,radius,angle,segments,...)\nend\nrawset(_G, \"ccDrawSolidCircle\", CCDrawPrimitivesDeprecated.ccDrawSolidCircle)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawQuadBezier(origin,control,destination,segments)\n    deprecatedTip(\"ccDrawQuadBezier\",\"cc.DrawPrimitives.drawQuadBezier\")\n    return cc.DrawPrimitives.drawQuadBezier(origin,control,destination,segments)\nend\nrawset(_G, \"ccDrawQuadBezier\", CCDrawPrimitivesDeprecated.ccDrawQuadBezier)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawCubicBezier(origin,control1,control2,destination,segments)\n    deprecatedTip(\"ccDrawCubicBezier\",\"cc.DrawPrimitives.drawCubicBezier\")\n    return cc.DrawPrimitives.drawCubicBezier(origin,control1,control2,destination,segments)\nend\nrawset(_G, \"ccDrawCubicBezier\", CCDrawPrimitivesDeprecated.ccDrawCubicBezier)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawCatmullRom(arrayOfControlPoints,segments)\n    deprecatedTip(\"ccDrawCatmullRom\",\"cc.DrawPrimitives.drawCatmullRom\")\n    return cc.DrawPrimitives.drawCatmullRom(arrayOfControlPoints,segments)\nend\nrawset(_G, \"ccDrawCatmullRom\", CCDrawPrimitivesDeprecated.ccDrawCatmullRom)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawCardinalSpline(config,tension,segments)\n    deprecatedTip(\"ccDrawCardinalSpline\",\"cc.DrawPrimitives.drawCardinalSpline\")\n    return cc.DrawPrimitives.drawCardinalSpline(config,tension,segments)\nend\nrawset(_G, \"ccDrawCardinalSpline\", CCDrawPrimitivesDeprecated.ccDrawCardinalSpline)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawColor4B(r,g,b,a)\n    deprecatedTip(\"ccDrawColor4B\",\"cc.DrawPrimitives.drawColor4B\")\n    return cc.DrawPrimitives.drawColor4B(r,g,b,a)\nend\nrawset(_G, \"ccDrawColor4B\", CCDrawPrimitivesDeprecated.ccDrawColor4B)\n\nfunction CCDrawPrimitivesDeprecated.ccDrawColor4F(r,g,b,a)\n    deprecatedTip(\"ccDrawColor4F\",\"cc.DrawPrimitives.drawColor4F\")\n    return cc.DrawPrimitives.drawColor4F(r,g,b,a)\nend\nrawset(_G, \"ccDrawColor4F\", CCDrawPrimitivesDeprecated.ccDrawColor4F)\n\nfunction CCDrawPrimitivesDeprecated.ccPointSize(pointSize)\n    deprecatedTip(\"ccPointSize\",\"cc.DrawPrimitives.setPointSize\")\n    return cc.DrawPrimitives.setPointSize(pointSize)\nend\nrawset(_G, \"ccPointSize\", CCDrawPrimitivesDeprecated.ccPointSize)\n--functions of CCDrawPrimitives will be deprecated end\n--CCDrawPrimitives will be deprecated end\n\nlocal CCProgressTimerDeprecated = {}\nfunction CCProgressTimerDeprecated.setReverseProgress(self,...)\n    deprecatedTip(\"CCProgressTimer\",\"CCProgressTimer:setReverseDirection\")\n    return self:setReverseDirection(...)\nend\nrawset(CCProgressTimer,\"setReverseProgress\",CCProgressTimerDeprecated.setReverseProgress)\n\n--functions of CCSpriteFrameCache will be deprecated begin\nlocal CCSpriteFrameCacheDeprecated = { }\nfunction CCSpriteFrameCacheDeprecated.spriteFrameByName(self,szName)\n    deprecatedTip(\"CCSpriteFrameCache:spriteFrameByName\",\"CCSpriteFrameCache:getSpriteFrameByName\")\n    return self:getSpriteFrameByName(szName)\nend\nrawset(CCSpriteFrameCache,\"spriteFrameByName\",CCSpriteFrameCacheDeprecated.spriteFrameByName)\n\nfunction CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache()\n    deprecatedTip(\"CCSpriteFrameCache:sharedSpriteFrameCache\",\"CCSpriteFrameCache:getInstance\")\n    return CCSpriteFrameCache:getInstance()\nend\nrawset(CCSpriteFrameCache,\"sharedSpriteFrameCache\",CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache)\n\nfunction CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache()\n    deprecatedTip(\"CCSpriteFrameCache:purgeSharedSpriteFrameCache\",\"CCSpriteFrameCache:destroyInstance\")\n    return CCSpriteFrameCache:destroyInstance()\nend\nrawset(CCSpriteFrameCache,\"purgeSharedSpriteFrameCache\",CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache)\n\nfunction CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile(self,...)\n    deprecatedTip(\"CCSpriteFrameCache:addSpriteFramesWithFile\",\"CCSpriteFrameCache:addSpriteFrames\")\n    return self:addSpriteFrames(...)\nend\nrawset(CCSpriteFrameCache,\"addSpriteFramesWithFile\",CCSpriteFrameCacheDeprecated.addSpriteFramesWithFile)\n\nfunction CCSpriteFrameCacheDeprecated.getSpriteFrameByName(self,...)\n    deprecatedTip(\"CCSpriteFrameCache:getSpriteFrameByName\",\"CCSpriteFrameCache:getSpriteFrame\")\n    return self:getSpriteFrame(...)\nend\nrawset(CCSpriteFrameCache,\"getSpriteFrameByName\",CCSpriteFrameCacheDeprecated.getSpriteFrameByName)\n--functions of CCSpriteFrameCache will be deprecated end\n\n--functions of CCLabelAtlas will be deprecated begin\nlocal CCLabelAtlasDeprecated = {}\nfunction CCLabelAtlasDeprecated.create(self,...)\n    deprecatedTip(\"CCLabelAtlas:create\",\"CCLabelAtlas:_create\")\n    return self:_create(...)\nend\nrawset(CCLabelAtlas,\"create\",CCLabelAtlasDeprecated.create)\n--functions of CCLabelAtlas will be deprecated end\n\n\n---------------------------\n--global functions wil be deprecated, begin\nlocal function CCRectMake(x,y,width,height)\n    deprecatedTip(\"CCRectMake(x,y,width,height)\",\"cc.rect(x,y,width,height) in lua\")\n    return cc.rect(x,y,width,height)\nend\nrawset(_G,\"CCRectMake\",CCRectMake)\n\nlocal function ccc3(r,g,b)\n    deprecatedTip(\"ccc3(r,g,b)\",\"cc.c3b(r,g,b)\")\n    return cc.c3b(r,g,b)\nend\nrawset(_G,\"ccc3\",ccc3)\n\nlocal function ccp(x,y)\n    deprecatedTip(\"ccp(x,y)\",\"cc.p(x,y)\")\n    return cc.p(x,y)\nend \nrawset(_G,\"ccp\",ccp)\n\nlocal function CCSizeMake(width,height)\n    deprecatedTip(\"CCSizeMake(width,height)\",\"cc.size(width,height)\")\n    return cc.size(width,height)\nend\nrawset(_G,\"CCSizeMake\",CCSizeMake)\n\nlocal function ccc4(r,g,b,a)\n    deprecatedTip(\"ccc4(r,g,b,a)\",\"cc.c4b(r,g,b,a)\")\n    return cc.c4b(r,g,b,a)\nend\nrawset(_G,\"ccc4\",ccc4)\n\nlocal function ccc4FFromccc3B(color3B)\n    deprecatedTip(\"ccc4FFromccc3B(color3B)\",\"cc.c4f(color3B.r / 255.0,color3B.g / 255.0,color3B.b / 255.0,1.0)\")\n    return cc.c4f(color3B.r/255.0, color3B.g/255.0, color3B.b/255.0, 1.0)\nend\nrawset(_G,\"ccc4FFromccc3B\",ccc4FFromccc3B)\n\nlocal function ccc4f(r,g,b,a)\n    deprecatedTip(\"ccc4f(r,g,b,a)\",\"cc.c4f(r,g,b,a)\")\n    return cc.c4f(r,g,b,a)\nend\nrawset(_G,\"ccc4f\",ccc4f)\n\nlocal function ccc4FFromccc4B(color4B)\n    deprecatedTip(\"ccc4FFromccc4B(color4B)\",\"cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)\")\n    return cc.c4f(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)   \nend\nrawset(_G,\"ccc4FFromccc4B\",ccc4FFromccc4B)\n\nlocal function ccc4FEqual(a,b)\n    deprecatedTip(\"ccc4FEqual(a,b)\",\"a:equals(b)\")\n    return a:equals(b)\nend\nrawset(_G,\"ccc4FEqual\",ccc4FEqual)\n--global functions wil be deprecated, end\n\n\n--functions of _G will be deprecated begin\nlocal function ccpLineIntersect(a,b,c,d,s,t)\n    deprecatedTip(\"ccpLineIntersect\",\"cc.pIsLineIntersect\")\n    return cc.pIsLineIntersect(a,b,c,d,s,t)\nend\nrawset(_G,\"ccpLineIntersect\",ccpLineIntersect)\n\n\nlocal function CCPointMake(x,y)\n    deprecatedTip(\"CCPointMake(x,y)\",\"cc.p(x,y)\")\n    return cc.p(x,y)\nend \nrawset(_G,\"CCPointMake\",CCPointMake)\n\n\n\nlocal function ccpNeg(pt)\n    deprecatedTip(\"ccpNeg\",\"cc.pSub\")\n    return cc.pSub({x = 0,y = 0}, pt)\nend\nrawset(_G,\"ccpNeg\",ccpNeg)\n\nlocal function ccpAdd(pt1,pt2)\n    deprecatedTip(\"ccpAdd\",\"cc.pAdd\")\n    return cc.pAdd(pt1,pt2)\nend\nrawset(_G,\"ccpAdd\",ccpAdd)\n\nlocal function ccpSub(pt1,pt2)\n    deprecatedTip(\"ccpSub\",\"cc.pSub\")\n    return cc.pSub(pt1,pt2)\nend\nrawset(_G,\"ccpSub\",ccpSub)\n\nlocal function ccpMult(pt,factor)\n    deprecatedTip(\"ccpMult\",\"cc.pMul\")\n    return cc.pMul(pt,factor)\nend\nrawset(_G,\"ccpMult\",ccpMult)\n\nlocal function ccpMidpoint(pt1,pt2)\n    deprecatedTip(\"ccpMidpoint\",\"cc.pMidpoint\")\n    return cc.pMidpoint(pt1,pt2)\nend\nrawset(_G,\"ccpMidpoint\",ccpMidpoint)\n\nlocal function ccpDot(pt1,pt2)\n    deprecatedTip(\"ccpDot\",\"cc.pDot\")\n    return cc.pDot(pt1,pt2)\nend\nrawset(_G,\"ccpDot\",ccpDot)\n\nlocal function ccpCross(pt1,pt2)\n    deprecatedTip(\"ccpCross\",\"cc.pCross\")\n    return cc.pCross(pt1, pt2)\nend\nrawset(_G,\"ccpCross\",ccpCross)\n\nlocal function ccpPerp(pt)\n    deprecatedTip(\"ccpPerp\",\"cc.pPerp\")\n    return cc.pPerp(pt)\nend\nrawset(_G,\"ccpPerp\",ccpPerp)\n\nlocal function ccpRPerp(pt)\n    deprecatedTip(\"ccpRPerp\",\"cc.RPerp\")\n    return cc.RPerp(pt)\nend\nrawset(_G,\"ccpRPerp\",ccpRPerp)\n\nlocal function ccpProject(pt1,pt2)\n    deprecatedTip(\"ccpProject\",\"cc.pProject\")\n    return cc.pProject(pt1,pt2)\nend\nrawset(_G,\"ccpProject\",ccpProject)\n\nlocal function ccpRotate(pt1,pt2)\n    deprecatedTip(\"ccpRotate\",\"cc.pRotate\")\n    return cc.pRotate(pt1,pt2)\nend\nrawset(_G,\"ccpRotate\",ccpRotate)\n\nlocal function ccpUnrotate(pt1,pt2)\n    deprecatedTip(\"ccpUnrotate\",\"cc.pUnrotate\")\n    return cc.pUnrotate(pt1,pt2)\nend\nrawset(_G,\"ccpUnrotate\",ccpUnrotate)\n\nlocal function ccpLengthSQ(pt)\n    deprecatedTip(\"ccpLengthSQ\",\"cc.pLengthSQ\")\n    return cc.pLengthSQ(pt)\nend\nrawset(_G,\"ccpLengthSQ\",ccpLengthSQ)\n\nlocal function ccpDistanceSQ(pt1,pt2)\n    deprecatedTip(\"ccpDistanceSQ\",\"cc.pDistanceSQ\")\n    return cc.pDistanceSQ(pt1,pt2)\nend\nrawset(_G,\"ccpDistanceSQ\",ccpDistanceSQ)\n\nlocal function ccpLength(pt)\n    deprecatedTip(\"ccpLength\",\"cc.pGetLength\")\n    return cc.pGetLength(pt)\nend\nrawset(_G,\"ccpLength\",ccpLength)\n\nlocal function ccpDistance(pt1,pt2)\n    deprecatedTip(\"ccpDistance\",\"cc.pGetDistance\")\n    return cc.pGetDistance(pt1, pt2)\nend\nrawset(_G,\"ccpDistance\",ccpDistance)\n\nlocal function ccpNormalize(pt)\n    deprecatedTip(\"ccpNormalize\",\"cc.pNormalize\")\n    return cc.pNormalize(pt)\nend\nrawset(_G,\"ccpNormalize\",ccpNormalize)\n\nlocal function ccpForAngle(angle)\n    deprecatedTip(\"ccpForAngle\",\"cc.pForAngle\")\n    return cc.pForAngle(angle)\nend\nrawset(_G,\"ccpForAngle\",ccpForAngle)\n\nlocal function ccpToAngle(pt)\n    deprecatedTip(\"ccpToAngle\",\"cc.pToAngleSelf\")\n    return cc.pToAngleSelf(pt)\nend\nrawset(_G,\"ccpToAngle\",ccpToAngle)\n\nlocal function ccpClamp(pt1,pt2,pt3)\n    deprecatedTip(\"ccpClamp\",\"cc.pGetClampPoint\")\n    return cc.pGetClampPoint(pt1,pt2,pt3)\nend\nrawset(_G,\"ccpClamp\",ccpClamp)\n\n\nlocal function ccpFromSize(sz)\n    deprecatedTip(\"ccpFromSize(sz)\",\"cc.pFromSize\")\n    return cc.pFromSize(sz)\nend\nrawset(_G,\"ccpFromSize\",ccpFromSize)\n\nlocal function ccpLerp(pt1,pt2,alpha)\n    deprecatedTip(\"ccpLerp\",\"cc.pLerp\")\n    return cc.pLerp(pt1,pt2,alpha) \nend\nrawset(_G,\"ccpLerp\",ccpLerp)\n\nlocal function ccpFuzzyEqual(pt1,pt2,variance)\n    deprecatedTip(\"ccpFuzzyEqual\",\"cc.pFuzzyEqual\")\n    return cc.pFuzzyEqual(pt1,pt2,variance)\nend\nrawset(_G,\"ccpFuzzyEqual\",ccpFuzzyEqual)\n\nlocal function ccpCompMult(pt1,pt2)\n    deprecatedTip(\"ccpCompMult\",\"cc.p\")\n    return cc.p(pt1.x * pt2.x , pt1.y * pt2.y)\nend\nrawset(_G,\"ccpCompMult\",ccpCompMult)\n\nlocal function ccpAngleSigned(pt1,pt2)\n    deprecatedTip(\"ccpAngleSigned\",\"cc.pGetAngle\")\n    return cc.pGetAngle(pt1, pt2)\nend\nrawset(_G,\"ccpAngleSigned\",ccpAngleSigned)\n\nlocal function ccpAngle(pt1,pt2)\n    deprecatedTip(\"ccpAngle\",\"cc.pGetAngle\")\n    return cc.pGetAngle(pt1,ptw)\nend\nrawset(_G,\"ccpAngle\",ccpAngle)\n\nlocal function ccpRotateByAngle(pt1,pt2,angle)\n    deprecatedTip(\"ccpRotateByAngle\",\"cc.pRotateByAngle\")\n    return cc.pRotateByAngle(pt1, pt2, angle)\nend\nrawset(_G,\"ccpRotateByAngle\",ccpRotateByAngle)\n\nlocal function ccpSegmentIntersect(pt1,pt2,pt3,pt4)\n    deprecatedTip(\"ccpSegmentIntersect\",\"cc.pIsSegmentIntersect\")\n    return cc.pIsSegmentIntersect(pt1,pt2,pt3,pt4)\nend\nrawset(_G,\"ccpSegmentIntersect\",ccpSegmentIntersect)\n\nlocal function ccpIntersectPoint(pt1,pt2,pt3,pt4)\n    deprecatedTip(\"ccpIntersectPoint\",\"cc.pGetIntersectPoint\")\n    return cc.pGetIntersectPoint(pt1,pt2,pt3,pt4)\nend\nrawset(_G,\"ccpIntersectPoint\",ccpIntersectPoint)\n\n\nlocal function vertex2(x,y)\n    deprecatedTip(\"vertex2(x,y)\",\"cc.vertex2F(x,y)\")\n    return cc.vertex2F(x,y)\nend\nrawset(_G,\"vertex2\",vertex2)\n\nlocal function vertex3(x,y,z)\n    deprecatedTip(\"vertex3(x,y,z)\",\"cc.Vertex3F(x,y,z)\")\n    return cc.Vertex3F(x,y,z)\nend\nrawset(_G,\"vertex3\",vertex3)\n\nlocal function tex2(u,v)\n    deprecatedTip(\"tex2(u,v)\",\"cc.tex2f(u,v)\")\n    return cc.tex2f(u,v)\nend\nrawset(_G,\"tex2\",tex2) \n\nlocal function ccc4BFromccc4F(color4F)\n    deprecatedTip(\"ccc4BFromccc4F(color4F)\",\"Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)\")\n    return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0) \nend\nrawset(_G,\"ccc4BFromccc4F\",ccc4BFromccc4F)\n\nlocal function ccColor3BDeprecated()\n    deprecatedTip(\"ccColor3B\",\"cc.c3b(0,0,0)\")\n    return cc.c3b(0,0,0)\nend\n_G[\"ccColor3B\"] = ccColor3BDeprecated\n\nlocal function ccColor4BDeprecated()\n    deprecatedTip(\"ccColor4B\",\"cc.c4b(0,0,0,0)\")\n    return cc.c4b(0,0,0,0)\nend\n_G[\"ccColor4B\"] = ccColor4BDeprecated\n\nlocal function ccColor4FDeprecated()\n    deprecatedTip(\"ccColor4F\",\"cc.c4f(0.0,0.0,0.0,0.0)\")\n    return cc.c4f(0.0,0.0,0.0,0.0)\nend\n_G[\"ccColor4F\"] = ccColor4FDeprecated\n\nlocal function ccVertex2FDeprecated()\n    deprecatedTip(\"ccVertex2F\",\"cc.vertex2F(0.0,0.0)\")\n    return cc.vertex2F(0.0,0.0)\nend\n_G[\"ccVertex2F\"] = ccVertex2FDeprecated\n\nlocal function ccVertex3FDeprecated()\n    deprecatedTip(\"ccVertex3F\",\"cc.Vertex3F(0.0, 0.0, 0.0)\")\n    return cc.Vertex3F(0.0, 0.0, 0.0)\nend\n_G[\"ccVertex3F\"] = ccVertex3FDeprecated\n\nlocal function ccTex2FDeprecated()\n    deprecatedTip(\"ccTex2F\",\"cc.tex2F(0.0, 0.0)\")\n    return cc.tex2F(0.0, 0.0)\nend\n_G[\"ccTex2F\"] = ccTex2FDeprecated\n\nlocal function ccPointSpriteDeprecated()\n    deprecatedTip(\"ccPointSprite\",\"cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)\")\n    return cc.PointSprite(cc.vertex2F(0.0, 0.0),cc.c4b(0.0, 0.0, 0.0),0)\nend\n_G[\"ccPointSprite\"] = ccPointSpriteDeprecated\n\nlocal function ccQuad2Deprecated()\n    deprecatedTip(\"ccQuad2\",\"cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0))\")\n    return cc.Quad2(cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0), cc.vertex2F(0.0, 0.0))\nend\n_G[\"ccQuad2\"] = ccQuad2Deprecated\n\nlocal function ccQuad3Deprecated()\n    deprecatedTip(\"ccQuad3\",\"cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0))\")\n    return cc.Quad3(cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0), cc.Vertex3F(0.0, 0.0 ,0.0))\nend\n_G[\"ccQuad3\"] = ccQuad3Deprecated\n\nlocal function ccV2FC4BT2FDeprecated()\n    deprecatedTip(\"ccV2F_C4B_T2F\",\"cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))\")\n    return cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0))\nend\n_G[\"ccV2F_C4B_T2F\"] = ccV2FC4BT2FDeprecated\n\n\nlocal function ccV2FC4FT2FDeprecated()\n    deprecatedTip(\"ccV2F_C4F_T2F\",\"cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0 ), cc.tex2F(0.0, 0.0))\")\n    return cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0 , 0.0 , 0.0), cc.tex2F(0.0, 0.0))\nend\n_G[\"ccV2F_C4F_T2F\"] = ccV2FC4FT2FDeprecated\n\nlocal function ccV3FC4BT2FDeprecated()\n    deprecatedTip(\"ccV3F_C4B_T2F\",\"cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0))\")\n    return cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0 , 0, 0 ), cc.tex2F(0.0, 0.0))\nend\n_G[\"ccV3F_C4B_T2F\"] = ccV3FC4BT2FDeprecated\n\nlocal function ccV2FC4BT2FQuadDeprecated()\n    deprecatedTip(\"ccV2F_C4B_T2F_Quad\",\"cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))\")\n    return cc.V2F_C4B_T2F_Quad(cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))\nend\n_G[\"ccV2F_C4B_T2F_Quad\"] = ccV2FC4BT2FQuadDeprecated\n\nlocal function ccV3FC4BT2FQuadDeprecated()\n    deprecatedTip(\"ccV3F_C4B_T2F_Quad\",\"cc.V3F_C4B_T2F_Quad(_tl, _bl, _tr, _br)\")\n    return cc.V3F_C4B_T2F_Quad(cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex3F(0.0, 0.0, 0.0), cc.c4b(0 , 0, 0, 0 ), cc.tex2F(0.0, 0.0)))\nend\n_G[\"ccV3F_C4B_T2F_Quad\"] = ccV3FC4BT2FQuadDeprecated\n\nlocal function ccV2FC4FT2FQuadDeprecated()\n    deprecatedTip(\"ccV2F_C4F_T2F_Quad\",\"cc.V2F_C4F_T2F_Quad(_bl, _br, _tl, _tr)\")\n    return cc.V2F_C4F_T2F_Quad(cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V3F_C4B_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)), cc.V2F_C4F_T2F(cc.vertex2F(0.0, 0.0), cc.c4f(0.0 , 0.0, 0.0, 0.0 ), cc.tex2F(0.0, 0.0)))\nend\n_G[\"ccV2F_C4F_T2F_Quad\"] = ccV2FC4FT2FQuadDeprecated\n\nlocal function ccT2FQuadDeprecated()\n    deprecatedTip(\"ccT2F_Quad\",\"cc.T2F_Quad(_bl, _br, _tl, _tr)\")\n    return cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0))\nend\n_G[\"ccT2F_Quad\"] = ccT2FQuadDeprecated\n\nlocal function ccAnimationFrameDataDeprecated()\n    deprecatedTip(\"ccAnimationFrameData\",\"cc.AnimationFrameData( _texCoords, _delay, _size)\")\n    return cc.AnimationFrameData(cc.T2F_Quad(cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0), cc.tex2F(0.0,0.0)), 0, cc.size(0,0))\nend\n_G[\"ccAnimationFrameData\"] = ccAnimationFrameDataDeprecated\n\n\n\nlocal function tex2(u,v)\n    deprecatedTip(\"tex2(u,v)\",\"cc.tex2f(u,v)\")\n    return cc.tex2f(u,v)\nend\nrawset(_G,\"tex2\",tex2) \n\n--functions of CCControl will be deprecated end\nlocal CCControlDeprecated = { }\nfunction CCControlDeprecated.addHandleOfControlEvent(self,func,controlEvent)\n    deprecatedTip(\"addHandleOfControlEvent\",\"registerControlEventHandler\")\n    print(\"come in addHandleOfControlEvent\")\n    self:registerControlEventHandler(func,controlEvent)\nend\nrawset(CCControl,\"addHandleOfControlEvent\",CCControlDeprecated.addHandleOfControlEvent)\n--functions of CCControl will be deprecated end\n\n\n--functions of CCEGLView will be deprecated end\nlocal CCEGLViewDeprecated = { }\nfunction CCEGLViewDeprecated.sharedOpenGLView()\n    deprecatedTip(\"CCEGLView:sharedOpenGLView\",\"CCEGLView:getInstance\")\n    return CCEGLView:getInstance()\nend\nrawset(CCEGLView,\"sharedOpenGLView\",CCEGLViewDeprecated.sharedOpenGLView)\n--functions of CCFileUtils will be deprecated end\n\n--Enums of CCTableView will be deprecated begin\nrawset(CCTableView, \"kTableViewScroll\",cc.SCROLLVIEW_SCRIPT_SCROLL)\nrawset(CCTableView,\"kTableViewZoom\",cc.SCROLLVIEW_SCRIPT_ZOOM)\nrawset(CCTableView,\"kTableCellTouched\",cc.TABLECELL_TOUCHED)\nrawset(CCTableView,\"kTableCellSizeForIndex\",cc.TABLECELL_SIZE_FOR_INDEX)\nrawset(CCTableView,\"kTableCellSizeAtIndex\",cc.TABLECELL_SIZE_AT_INDEX)\nrawset(CCTableView,\"kNumberOfCellsInTableView\",cc.NUMBER_OF_CELLS_IN_TABLEVIEW)\n--Enums of CCTableView will be deprecated end\n\n--Enums of CCScrollView will be deprecated begin\nrawset(CCScrollView, \"kScrollViewScroll\",cc.SCROLLVIEW_SCRIPT_SCROLL)\nrawset(CCScrollView,\"kScrollViewZoom\",cc.SCROLLVIEW_SCRIPT_ZOOM)\n--Enums of CCScrollView will be deprecated end\n\n\n\n--functions of CCApplication will be deprecated end\nlocal CCApplicationDeprecated = { }\nfunction CCApplicationDeprecated.sharedApplication()\n    deprecatedTip(\"CCApplication:sharedApplication\",\"CCApplication:getInstance\")\n    return CCApplication:getInstance()\nend\nrawset(CCApplication,\"sharedApplication\",CCApplicationDeprecated.sharedApplication)\n--functions of CCApplication will be deprecated end\n\n\n--functions of CCDirector will be deprecated end\nlocal CCDirectorDeprecated = { }\nfunction CCDirectorDeprecated.sharedDirector()\n    deprecatedTip(\"CCDirector:sharedDirector\",\"CCDirector:getInstance\")\n    return CCDirector:getInstance()\nend\nrawset(CCDirector,\"sharedDirector\",CCDirectorDeprecated.sharedDirector)\n--functions of CCDirector will be deprecated end\n\n\n--functions of CCUserDefault will be deprecated end\nlocal CCUserDefaultDeprecated = { }\nfunction CCUserDefaultDeprecated.sharedUserDefault()\n    deprecatedTip(\"CCUserDefault:sharedUserDefault\",\"CCUserDefault:getInstance\")\n    return CCUserDefault:getInstance()\nend\nrawset(CCUserDefault,\"sharedUserDefault\",CCUserDefaultDeprecated.sharedUserDefault)\n\nfunction CCUserDefaultDeprecated.purgeSharedUserDefault()\n    deprecatedTip(\"CCUserDefault:purgeSharedUserDefault\",\"CCUserDefault:destroyInstance\")\n    return CCUserDefault:destroyInstance()\nend\nrawset(CCUserDefault,\"purgeSharedUserDefault\",CCUserDefaultDeprecated.purgeSharedUserDefault)\n--functions of CCUserDefault will be deprecated end\n\n--functions of CCGrid3DAction will be deprecated begin\nlocal CCGrid3DActionDeprecated = { }\nfunction CCGrid3DActionDeprecated.vertex(self,pt)\n    deprecatedTip(\"vertex\",\"CCGrid3DAction:getVertex\")\n    return self:getVertex(pt)\nend\nrawset(CCGrid3DAction,\"vertex\",CCGrid3DActionDeprecated.vertex)\n\nfunction CCGrid3DActionDeprecated.originalVertex(self,pt)\n    deprecatedTip(\"originalVertex\",\"CCGrid3DAction:getOriginalVertex\")\n    return self:getOriginalVertex(pt)\nend\nrawset(CCGrid3DAction,\"originalVertex\",CCGrid3DActionDeprecated.originalVertex)\n--functions of CCGrid3DAction will be deprecated end\n\n\n--functions of CCTiledGrid3DAction will be deprecated begin\nlocal CCTiledGrid3DActionDeprecated = { }\nfunction CCTiledGrid3DActionDeprecated.tile(self,pt)\n    deprecatedTip(\"tile\",\"CCTiledGrid3DAction:getTile\")\n    return self:getTile(pt)\nend\nrawset(CCTiledGrid3DAction,\"tile\",CCTiledGrid3DActionDeprecated.tile)\n\nfunction CCTiledGrid3DActionDeprecated.originalTile(self,pt)\n    deprecatedTip(\"originalTile\",\"CCTiledGrid3DAction:getOriginalTile\")\n    return self:getOriginalTile(pt)\nend\nrawset(CCTiledGrid3DAction,\"originalTile\",CCTiledGrid3DActionDeprecated.originalTile)\n--functions of CCTiledGrid3DAction will be deprecated end\n\n\n--functions of CCTexture2D will be deprecated begin\nlocal CCTexture2DDeprecated = { }\nfunction CCTexture2DDeprecated.stringForFormat(self)\n    deprecatedTip(\"Texture2D:stringForFormat\",\"Texture2D:getStringForFormat\")\n    return self:getStringForFormat()\nend\nrawset(CCTexture2D,\"stringForFormat\",CCTexture2DDeprecated.stringForFormat)\n\nfunction CCTexture2DDeprecated.bitsPerPixelForFormat(self)\n    deprecatedTip(\"Texture2D:bitsPerPixelForFormat\",\"Texture2D:getBitsPerPixelForFormat\")\n    return self:getBitsPerPixelForFormat()\nend\nrawset(CCTexture2D,\"bitsPerPixelForFormat\",CCTexture2DDeprecated.bitsPerPixelForFormat)\n\nfunction CCTexture2DDeprecated.bitsPerPixelForFormat(self,pixelFormat)\n    deprecatedTip(\"Texture2D:bitsPerPixelForFormat\",\"Texture2D:getBitsPerPixelForFormat\")\n    return self:getBitsPerPixelForFormat(pixelFormat)\nend\nrawset(CCTexture2D,\"bitsPerPixelForFormat\",CCTexture2DDeprecated.bitsPerPixelForFormat)\n\nfunction CCTexture2DDeprecated.defaultAlphaPixelFormat(self)\n    deprecatedTip(\"Texture2D:defaultAlphaPixelFormat\",\"Texture2D:getDefaultAlphaPixelFormat\")\n    return self:getDefaultAlphaPixelFormat()\nend\nrawset(CCTexture2D,\"defaultAlphaPixelFormat\",CCTexture2DDeprecated.defaultAlphaPixelFormat)\n--functions of CCTexture2D will be deprecated end\n\n\n--functions of CCTimer will be deprecated begin\nlocal CCTimerDeprecated = { }\nfunction CCTimerDeprecated.timerWithScriptHandler(handler,seconds)\n    deprecatedTip(\"CCTimer:timerWithScriptHandler\",\"CCTimer:createWithScriptHandler\")\n    return CCTimer:createWithScriptHandler(handler,seconds)\nend\nrawset(CCTimer,\"timerWithScriptHandler\",CCTimerDeprecated.timerWithScriptHandler)\n\nfunction CCTimerDeprecated.numberOfRunningActionsInTarget(self,target)\n    deprecatedTip(\"CCActionManager:numberOfRunningActionsInTarget\",\"CCActionManager:getNumberOfRunningActionsInTarget\")\n    return self:getNumberOfRunningActionsInTarget(target)\nend\nrawset(CCTimer,\"numberOfRunningActionsInTarget\",CCTimerDeprecated.numberOfRunningActionsInTarget)\n--functions of CCTimer will be deprecated end\n\n\n--functions of CCMenuItemFont will be deprecated begin\nlocal CCMenuItemFontDeprecated = { }\nfunction CCMenuItemFontDeprecated.fontSize()\n    deprecatedTip(\"CCMenuItemFont:fontSize\",\"CCMenuItemFont:getFontSize\")\n    return CCMenuItemFont:getFontSize()\nend\nrawset(CCMenuItemFont,\"fontSize\",CCMenuItemFontDeprecated.fontSize)\n\nfunction CCMenuItemFontDeprecated.fontName()\n    deprecatedTip(\"CCMenuItemFont:fontName\",\"CCMenuItemFont:getFontName\")\n    return CCMenuItemFont:getFontName()\nend\nrawset(CCMenuItemFont,\"fontName\",CCMenuItemFontDeprecated.fontName)\n\nfunction CCMenuItemFontDeprecated.fontSizeObj(self)\n    deprecatedTip(\"CCMenuItemFont:fontSizeObj\",\"CCMenuItemFont:getFontSizeObj\")\n    return self:getFontSizeObj()\nend\nrawset(CCMenuItemFont,\"fontSizeObj\",CCMenuItemFontDeprecated.fontSizeObj)\n\nfunction CCMenuItemFontDeprecated.fontNameObj(self)\n    deprecatedTip(\"CCMenuItemFont:fontNameObj\",\"CCMenuItemFont:getFontNameObj\")\n    return self:getFontNameObj()\nend\nrawset(CCMenuItemFont,\"fontNameObj\",CCMenuItemFontDeprecated.fontNameObj)\n--functions of CCMenuItemFont will be deprecated end\n\n\n--functions of CCMenuItemToggle will be deprecated begin\nlocal CCMenuItemToggleDeprecated = { }\nfunction CCMenuItemToggleDeprecated.selectedItem(self)\n    deprecatedTip(\"CCMenuItemToggle:selectedItem\",\"CCMenuItemToggle:getSelectedItem\")\n    return self:getSelectedItem()\nend\nrawset(CCMenuItemToggle,\"selectedItem\",CCMenuItemToggleDeprecated.selectedItem)\n--functions of CCMenuItemToggle will be deprecated end\n\n\n--functions of CCTileMapAtlas will be deprecated begin\nlocal CCTileMapAtlasDeprecated = { }\nfunction CCTileMapAtlasDeprecated.tileAt(self,pos)\n    deprecatedTip(\"CCTileMapAtlas:tileAt\",\"CCTileMapAtlas:getTileAt\")\n    return self:getTileAt(pos)\nend\nrawset(CCTileMapAtlas,\"tileAt\",CCTileMapAtlasDeprecated.tileAt)\n--functions of CCTileMapAtlas will be deprecated end\n\n\n--functions of CCTMXLayer will be deprecated begin\nlocal CCTMXLayerDeprecated = { }\nfunction CCTMXLayerDeprecated.tileAt(self,tileCoordinate)\n    deprecatedTip(\"CCTMXLayer:tileAt\",\"CCTMXLayer:getTileAt\")\n    return self:getTileAt(tileCoordinate)\nend\nrawset(CCTMXLayer,\"tileAt\",CCTMXLayerDeprecated.tileAt)\n\nfunction CCTMXLayerDeprecated.tileGIDAt(self,tileCoordinate)\n    deprecatedTip(\"CCTMXLayer:tileGIDAt\",\"CCTMXLayer:getTileGIDAt\")\n    return self:getTileGIDAt(tileCoordinate)\nend\nrawset(CCTMXLayer,\"tileGIDAt\",CCTMXLayerDeprecated.tileGIDAt)\n\nfunction CCTMXLayerDeprecated.positionAt(self,tileCoordinate)\n    deprecatedTip(\"CCTMXLayer:positionAt\",\"CCTMXLayer:getPositionAt\")\n    return self:getPositionAt(tileCoordinate)\nend\nrawset(CCTMXLayer,\"positionAt\",CCTMXLayerDeprecated.positionAt)\n\nfunction CCTMXLayerDeprecated.propertyNamed(self,propertyName)\n    deprecatedTip(\"CCTMXLayer:propertyNamed\",\"CCTMXLayer:getProperty\")\n    return self:getProperty(propertyName)\nend\nrawset(CCTMXLayer,\"propertyNamed\",CCTMXLayerDeprecated.propertyNamed)\n--functions of CCTMXLayer will be deprecated end\n\n--functions of CCTMXTiledMap will be deprecated begin\nlocal CCTMXTiledMapDeprecated = { }\nfunction CCTMXTiledMapDeprecated.layerNamed(self,layerName)\n    deprecatedTip(\"CCTMXTiledMap:layerNamed\",\"CCTMXTiledMap:getLayer\")\n    return self:getLayer(layerName)\nend\nrawset(CCTMXTiledMap,\"layerNamed\", CCTMXTiledMapDeprecated.layerNamed)\n\nfunction CCTMXTiledMapDeprecated.propertyNamed(self,propertyName)\n    deprecatedTip(\"CCTMXTiledMap:propertyNamed\",\"CCTMXTiledMap:getProperty\")\n    return self:getProperty(propertyName)\nend\nrawset(CCTMXTiledMap,\"propertyNamed\", CCTMXTiledMapDeprecated.propertyNamed )\n\nfunction CCTMXTiledMapDeprecated.propertiesForGID(self,GID)\n    deprecatedTip(\"CCTMXTiledMap:propertiesForGID\",\"CCTMXTiledMap:getPropertiesForGID\")\n    return self:getPropertiesForGID(GID)\nend\nrawset(CCTMXTiledMap,\"propertiesForGID\", CCTMXTiledMapDeprecated.propertiesForGID)\n\nfunction CCTMXTiledMapDeprecated.objectGroupNamed(self,groupName)\n    deprecatedTip(\"CCTMXTiledMap:objectGroupNamed\",\"CCTMXTiledMap:getObjectGroup\")\n    return self:getObjectGroup(groupName)\nend\nrawset(CCTMXTiledMap,\"objectGroupNamed\", CCTMXTiledMapDeprecated.objectGroupNamed)\n--functions of CCTMXTiledMap will be deprecated end\n\n\n--functions of CCTMXMapInfo will be deprecated begin\nlocal CCTMXMapInfoDeprecated = { }\nfunction CCTMXMapInfoDeprecated.getStoringCharacters(self)\n    deprecatedTip(\"CCTMXMapInfo:getStoringCharacters\",\"CCTMXMapInfo:isStoringCharacters\")\n    return self:isStoringCharacters()\nend\nrawset(CCTMXMapInfo,\"getStoringCharacters\", CCTMXMapInfoDeprecated.getStoringCharacters)\n\nfunction CCTMXMapInfoDeprecated.formatWithTMXFile(infoTable,tmxFile)\n    deprecatedTip(\"CCTMXMapInfo:formatWithTMXFile\",\"CCTMXMapInfo:create\")\n    return CCTMXMapInfo:create(tmxFile)\nend\nrawset(CCTMXMapInfo,\"formatWithTMXFile\", CCTMXMapInfoDeprecated.formatWithTMXFile)\n\nfunction CCTMXMapInfoDeprecated.formatWithXML(infoTable,tmxString,resourcePath)\n    deprecatedTip(\"CCTMXMapInfo:formatWithXML\",\"TMXMapInfo:createWithXML\")\n    return CCTMXMapInfo:createWithXML(tmxString,resourcePath)\nend\nrawset(CCTMXMapInfo,\"formatWithXML\", CCTMXMapInfoDeprecated.formatWithXML)\n--functions of CCTMXMapInfo will be deprecated end\n\n\n--functions of CCTMXObject will be deprecated begin\nlocal CCTMXObjectGroupDeprecated = { }\nfunction CCTMXObjectGroupDeprecated.propertyNamed(self,propertyName)\n    deprecatedTip(\"CCTMXObjectGroup:propertyNamed\",\"CCTMXObjectGroup:getProperty\")\n    return self:getProperty(propertyName)\nend\nrawset(CCTMXObjectGroup,\"propertyNamed\", CCTMXObjectGroupDeprecated.propertyNamed)\n\nfunction CCTMXObjectGroupDeprecated.objectNamed(self, objectName)\n    deprecatedTip(\"CCTMXObjectGroup:objectNamed\",\"CCTMXObjectGroup:getObject\")\n    return self:getObject(objectName)\nend\nrawset(CCTMXObjectGroup,\"objectNamed\", CCTMXObjectGroupDeprecated.objectNamed)\n--functions of CCTMXObject will be deprecated end\n\n\n--functions of WebSocket will be deprecated begin\nlocal targetPlatform = CCApplication:getInstance():getTargetPlatform()\nif (kTargetIphone == targetPlatform) or (kTargetIpad == targetPlatform) or (kTargetAndroid == targetPlatform) or (kTargetWindows == targetPlatform) then\n    local WebSocketDeprecated = { }\n    function WebSocketDeprecated.sendTextMsg(self, string)\n        deprecatedTip(\"WebSocket:sendTextMsg\",\"WebSocket:sendString\")\n        return self:sendString(string)\n    end\n    rawset(WebSocket,\"sendTextMsg\", WebSocketDeprecated.sendTextMsg)\n\n    function WebSocketDeprecated.sendBinaryMsg(self, table,tablesize)\n        deprecatedTip(\"WebSocket:sendBinaryMsg\",\"WebSocket:sendString\")\n        string.char(unpack(table))\n        return self:sendString(string.char(unpack(table)))\n    end\n    rawset(WebSocket,\"sendBinaryMsg\", WebSocketDeprecated.sendBinaryMsg)\nend\n--functions of WebSocket will be deprecated end\n\n--functions of CCRenderTexture will be deprecated begin\nlocal CCRenderTextureDeprecated = { }\nfunction CCRenderTextureDeprecated.newCCImage(self)\n    deprecatedTip(\"CCRenderTexture:newCCImage\",\"CCRenderTexture:newImage\")\n    return self:newImage()\nend\nrawset(CCRenderTexture, \"newCCImage\", CCRenderTextureDeprecated.newCCImage)\n--functions of CCRenderTexture will be deprecated end\n\n--functions of Sprite will be deprecated begin\nlocal CCSpriteDeprecated = { }\nfunction CCSpriteDeprecated.setFlipX(self,flag)\n    deprecatedTip(\"CCSpriteDeprecated:setFlipX\",\"CCSpriteDeprecated:setFlippedX\")\n    return self:setFlippedX(flag)\nend\nrawset(cc.Sprite, \"setFlipX\", CCSpriteDeprecated.setFlipX)\n\nfunction CCSpriteDeprecated.setFlipY(self,flag)\n    deprecatedTip(\"CCSpriteDeprecated:setFlipY\",\"CCSpriteDeprecated:setFlippedY\")\n    return self:setFlippedY(flag)\nend\nrawset(cc.Sprite, \"setFlipY\", CCSpriteDeprecated.setFlipY)\n--functions of Sprite will be deprecated end\n\n\n--functions of Layer will be deprecated begin\nlocal CCLayerDeprecated = {}\nfunction CCLayerDeprecated.setKeypadEnabled( self, enabled)\n    return self:setKeyboardEnabled(enabled)\nend\nrawset(cc.Layer, \"setKeypadEnabled\", CCLayerDeprecated.setKeypadEnabled )\n\nfunction CCLayerDeprecated.isKeypadEnabled(self)\n    return self:isKeyboardEnabled()\nend\nrawset(cc.Layer, \"isKeypadEnabled\", CCLayerDeprecated.isKeypadEnabled )\n--functions of Layer will be deprecated end\n\n--functions of ccs.GUIReader will be deprecated begin\nlocal CCSGUIReaderDeprecated = { }\nfunction CCSGUIReaderDeprecated.purgeGUIReader()\n    deprecatedTip(\"ccs.GUIReader:purgeGUIReader\",\"ccs.GUIReader:destroyInstance\")\n    return ccs.GUIReader:destroyInstance()\nend\nrawset(ccs.GUIReader,\"purgeGUIReader\",CCSGUIReaderDeprecated.purgeGUIReader)\n--functions of ccs.GUIReader will be deprecated end\n\n--functions of ccs.ActionManagerEx will be deprecated begin\nlocal CCSActionManagerExDeprecated = { }\nfunction CCSActionManagerExDeprecated.destroyActionManager()\n    deprecatedTip(\"ccs.ActionManagerEx:destroyActionManager\",\"ccs.ActionManagerEx:destroyInstance\")\n    return ccs.ActionManagerEx:destroyInstance()\nend\nrawset(ccs.ActionManagerEx,\"destroyActionManager\",CCSActionManagerExDeprecated.destroyActionManager)\n--functions of ccs.ActionManagerEx will be deprecated end\n\n--functions of ccs.SceneReader will be deprecated begin\nlocal CCSSceneReaderDeprecated = { }\nfunction CCSSceneReaderDeprecated.destroySceneReader(self)\n    deprecatedTip(\"ccs.SceneReader:destroySceneReader\",\"ccs.SceneReader:destroyInstance\")\n    return self:destroyInstance()\nend\nrawset(ccs.SceneReader,\"destroySceneReader\",CCSSceneReaderDeprecated.destroySceneReader)\n--functions of ccs.SceneReader will be deprecated end\n\n--functions of CCArmatureDataManager will be deprecated begin\nlocal CCArmatureDataManagerDeprecated = { }\nfunction CCArmatureDataManagerDeprecated.sharedArmatureDataManager()\n    deprecatedTip(\"CCArmatureDataManager:sharedArmatureDataManager\",\"ccs.ArmatureDataManager:getInstance\")\n    return ccs.ArmatureDataManager:getInstance()\nend\nrawset(CCArmatureDataManager,\"sharedArmatureDataManager\",CCArmatureDataManagerDeprecated.sharedArmatureDataManager)\n\nfunction CCArmatureDataManagerDeprecated.purge()\n    deprecatedTip(\"CCArmatureDataManager:purge\",\"ccs.ArmatureDataManager:destoryInstance\")\n    return ccs.ArmatureDataManager:destoryInstance() \nend\nrawset(CCArmatureDataManager,\"purge\",CCArmatureDataManagerDeprecated.purge)\n--functions of CCArmatureDataManager will be deprecated end\n\n--functions of GUIReader will be deprecated begin\nlocal GUIReaderDeprecated = { }\nfunction GUIReaderDeprecated.shareReader()\n    deprecatedTip(\"GUIReader:shareReader\",\"ccs.GUIReader:getInstance\")\n    return ccs.GUIReader:getInstance()\nend\nrawset(GUIReader,\"shareReader\",GUIReaderDeprecated.shareReader)\n\nfunction GUIReaderDeprecated.purgeGUIReader()\n    deprecatedTip(\"GUIReader:purgeGUIReader\",\"ccs.GUIReader:destroyInstance\")\n    return ccs.GUIReader:destroyInstance()\nend\nrawset(GUIReader,\"purgeGUIReader\",GUIReaderDeprecated.purgeGUIReader)\n--functions of GUIReader will be deprecated end\n\n--functions of SceneReader will be deprecated begin\nlocal SceneReaderDeprecated = { }\nfunction SceneReaderDeprecated.sharedSceneReader()\n    deprecatedTip(\"SceneReader:sharedSceneReader\",\"ccs.SceneReader:getInstance\")\n    return ccs.SceneReader:getInstance()\nend\nrawset(SceneReader,\"sharedSceneReader\",SceneReaderDeprecated.sharedSceneReader)\n\nfunction SceneReaderDeprecated.purgeSceneReader(self)\n    deprecatedTip(\"SceneReader:purgeSceneReader\",\"ccs.SceneReader:destroyInstance\")\n    return self:destroyInstance()\nend\nrawset(SceneReader,\"purgeSceneReader\",SceneReaderDeprecated.purgeSceneReader)\n--functions of SceneReader will be deprecated end\n\n--functions of CCEGLView will be deprecated begin\nlocal CCEGLViewDeprecated = { }\nfunction CCEGLViewDeprecated.sharedOpenGLView()\n    deprecatedTip(\"CCEGLView:sharedOpenGLView\",\"cc.EGLView:getInstance\")\n    return cc.EGLView:getInstance()\nend\nrawset(CCEGLView,\"sharedOpenGLView\",CCEGLViewDeprecated.sharedOpenGLView)\n--functions of CCEGLView will be deprecated end\n\n--functions of cc.Node will be deprecated begin\nlocal NodeDeprecated = { }\nfunction NodeDeprecated.setZOrder(self,zOrder)\n    deprecatedTip(\"cc.Node:setZOrder\",\"cc.Node:setLocalZOrder\")\n    return self:setLocalZOrder(zOrder)\nend\nrawset(cc.Node,\"setZOrder\",NodeDeprecated.setZOrder)\n\nfunction NodeDeprecated.getZOrder(self)\n    deprecatedTip(\"cc.Node:getZOrder\",\"cc.Node:getLocalZOrder\")\n    return self:getLocalZOrder()\nend\nrawset(cc.Node,\"getZOrder\",NodeDeprecated.getZOrder)\n--functions of cc.Node will be deprecated end\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/DeprecatedClass.lua",
    "content": "-- This is the DeprecatedClass\n\nDeprecatedClass = {} or DeprecatedClass\n\n--tip\nlocal function deprecatedTip(old_name,new_name)\n    print(\"\\n********** \\n\"..old_name..\" was deprecated please use \".. new_name .. \" instead.\\n**********\")\nend\n\n--CCProgressTo class will be Deprecated,begin\nfunction DeprecatedClass.CCProgressTo()\n    deprecatedTip(\"CCProgressTo\",\"cc.ProgressTo\")\n    return cc.ProgressTo\nend\n_G[\"CCProgressTo\"] = DeprecatedClass.CCProgressTo()\n--CCProgressTo class will be Deprecated,end\n\n--CCHide class will be Deprecated,begin\nfunction DeprecatedClass.CCHide()\n    deprecatedTip(\"CCHide\",\"cc.Hide\")\n    return cc.Hide\nend\n_G[\"CCHide\"] = DeprecatedClass.CCHide()\n--CCHide class will be Deprecated,end\n\n--CCTransitionMoveInB class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInB()\n    deprecatedTip(\"CCTransitionMoveInB\",\"cc.TransitionMoveInB\")\n    return cc.TransitionMoveInB\nend\n_G[\"CCTransitionMoveInB\"] = DeprecatedClass.CCTransitionMoveInB()\n--CCTransitionMoveInB class will be Deprecated,end\n\n--CCEaseSineIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseSineIn()\n    deprecatedTip(\"CCEaseSineIn\",\"cc.EaseSineIn\")\n    return cc.EaseSineIn\nend\n_G[\"CCEaseSineIn\"] = DeprecatedClass.CCEaseSineIn()\n--CCEaseSineIn class will be Deprecated,end\n\n--CCTransitionMoveInL class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInL()\n    deprecatedTip(\"CCTransitionMoveInL\",\"cc.TransitionMoveInL\")\n    return cc.TransitionMoveInL\nend\n_G[\"CCTransitionMoveInL\"] = DeprecatedClass.CCTransitionMoveInL()\n--CCTransitionMoveInL class will be Deprecated,end\n\n--CCEaseInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseInOut()\n    deprecatedTip(\"CCEaseInOut\",\"cc.EaseInOut\")\n    return cc.EaseInOut\nend\n_G[\"CCEaseInOut\"] = DeprecatedClass.CCEaseInOut()\n--CCEaseInOut class will be Deprecated,end\n\n--SimpleAudioEngine class will be Deprecated,begin\nfunction DeprecatedClass.SimpleAudioEngine()\n    deprecatedTip(\"SimpleAudioEngine\",\"cc.SimpleAudioEngine\")\n    return cc.SimpleAudioEngine\nend\n_G[\"SimpleAudioEngine\"] = DeprecatedClass.SimpleAudioEngine()\n--SimpleAudioEngine class will be Deprecated,end\n\n--CCTransitionMoveInT class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInT()\n    deprecatedTip(\"CCTransitionMoveInT\",\"cc.TransitionMoveInT\")\n    return cc.TransitionMoveInT\nend\n_G[\"CCTransitionMoveInT\"] = DeprecatedClass.CCTransitionMoveInT()\n--CCTransitionMoveInT class will be Deprecated,end\n\n--CCTransitionMoveInR class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionMoveInR()\n    deprecatedTip(\"CCTransitionMoveInR\",\"cc.TransitionMoveInR\")\n    return cc.TransitionMoveInR\nend\n_G[\"CCTransitionMoveInR\"] = DeprecatedClass.CCTransitionMoveInR()\n--CCTransitionMoveInR class will be Deprecated,end\n\n--CCControlHuePicker class will be Deprecated,begin\nfunction DeprecatedClass.CCControlHuePicker()\n    deprecatedTip(\"CCControlHuePicker\",\"cc.ControlHuePicker\")\n    return cc.ControlHuePicker\nend\n_G[\"CCControlHuePicker\"] = DeprecatedClass.CCControlHuePicker()\n--CCControlHuePicker class will be Deprecated,end\n\n--CCParticleSnow class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSnow()\n    deprecatedTip(\"CCParticleSnow\",\"cc.ParticleSnow\")\n    return cc.ParticleSnow\nend\n_G[\"CCParticleSnow\"] = DeprecatedClass.CCParticleSnow()\n--CCParticleSnow class will be Deprecated,end\n\n--CCActionCamera class will be Deprecated,begin\nfunction DeprecatedClass.CCActionCamera()\n    deprecatedTip(\"CCActionCamera\",\"cc.ActionCamera\")\n    return cc.ActionCamera\nend\n_G[\"CCActionCamera\"] = DeprecatedClass.CCActionCamera()\n--CCActionCamera class will be Deprecated,end\n\n--CCProgressFromTo class will be Deprecated,begin\nfunction DeprecatedClass.CCProgressFromTo()\n    deprecatedTip(\"CCProgressFromTo\",\"cc.ProgressFromTo\")\n    return cc.ProgressFromTo\nend\n_G[\"CCProgressFromTo\"] = DeprecatedClass.CCProgressFromTo()\n--CCProgressFromTo class will be Deprecated,end\n\n--CCMoveTo class will be Deprecated,begin\nfunction DeprecatedClass.CCMoveTo()\n    deprecatedTip(\"CCMoveTo\",\"cc.MoveTo\")\n    return cc.MoveTo\nend\n_G[\"CCMoveTo\"] = DeprecatedClass.CCMoveTo()\n--CCMoveTo class will be Deprecated,end\n\n--CCJumpBy class will be Deprecated,begin\nfunction DeprecatedClass.CCJumpBy()\n    deprecatedTip(\"CCJumpBy\",\"cc.JumpBy\")\n    return cc.JumpBy\nend\n_G[\"CCJumpBy\"] = DeprecatedClass.CCJumpBy()\n--CCJumpBy class will be Deprecated,end\n\n--CCObject class will be Deprecated,begin\nfunction DeprecatedClass.CCObject()\n    deprecatedTip(\"CCObject\",\"cc.Object\")\n    return cc.Object\nend\n_G[\"CCObject\"] = DeprecatedClass.CCObject()\n--CCObject class will be Deprecated,end\n\n--CCTransitionRotoZoom class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionRotoZoom()\n    deprecatedTip(\"CCTransitionRotoZoom\",\"cc.TransitionRotoZoom\")\n    return cc.TransitionRotoZoom\nend\n_G[\"CCTransitionRotoZoom\"] = DeprecatedClass.CCTransitionRotoZoom()\n--CCTransitionRotoZoom class will be Deprecated,end\n\n--CCControlColourPicker class will be Deprecated,begin\nfunction DeprecatedClass.CCControlColourPicker()\n    deprecatedTip(\"CCControlColourPicker\",\"cc.ControlColourPicker\")\n    return cc.ControlColourPicker\nend\n_G[\"CCControlColourPicker\"] = DeprecatedClass.CCControlColourPicker()\n--CCControlColourPicker class will be Deprecated,end\n\n--CCDirector class will be Deprecated,begin\nfunction DeprecatedClass.CCDirector()\n    deprecatedTip(\"CCDirector\",\"cc.Director\")\n    return cc.Director\nend\n_G[\"CCDirector\"] = DeprecatedClass.CCDirector()\n--CCDirector class will be Deprecated,end\n\n--CCScheduler class will be Deprecated,begin\nfunction DeprecatedClass.CCScheduler()\n    deprecatedTip(\"CCScheduler\",\"cc.Scheduler\")\n    return cc.Scheduler\nend\n_G[\"CCScheduler\"] = DeprecatedClass.CCScheduler()\n--CCScheduler class will be Deprecated,end\n\n--CCEaseElasticOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElasticOut()\n    deprecatedTip(\"CCEaseElasticOut\",\"cc.EaseElasticOut\")\n    return cc.EaseElasticOut\nend\n_G[\"CCEaseElasticOut\"] = DeprecatedClass.CCEaseElasticOut()\n--CCEaseElasticOut class will be Deprecated,end\n\n--CCTableViewCell class will be Deprecated,begin\nfunction DeprecatedClass.CCTableViewCell()\n    deprecatedTip(\"CCTableViewCell\",\"cc.TableViewCell\")\n    return cc.TableViewCell\nend\n_G[\"CCTableViewCell\"] = DeprecatedClass.CCTableViewCell()\n--CCTableViewCell class will be Deprecated,end\n\n\n--CCEaseBackOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBackOut()\n    deprecatedTip(\"CCEaseBackOut\",\"cc.EaseBackOut\")\n    return cc.EaseBackOut\nend\n_G[\"CCEaseBackOut\"] = DeprecatedClass.CCEaseBackOut()\n--CCEaseBackOut class will be Deprecated,end\n\n--CCParticleSystemQuad class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSystemQuad()\n    deprecatedTip(\"CCParticleSystemQuad\",\"cc.ParticleSystemQuad\")\n    return cc.ParticleSystemQuad\nend\n_G[\"CCParticleSystemQuad\"] = DeprecatedClass.CCParticleSystemQuad()\n--CCParticleSystemQuad class will be Deprecated,end\n\n--CCMenuItemToggle class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemToggle()\n    deprecatedTip(\"CCMenuItemToggle\",\"cc.MenuItemToggle\")\n    return cc.MenuItemToggle\nend\n_G[\"CCMenuItemToggle\"] = DeprecatedClass.CCMenuItemToggle()\n--CCMenuItemToggle class will be Deprecated,end\n\n--CCStopGrid class will be Deprecated,begin\nfunction DeprecatedClass.CCStopGrid()\n    deprecatedTip(\"CCStopGrid\",\"cc.StopGrid\")\n    return cc.StopGrid\nend\n_G[\"CCStopGrid\"] = DeprecatedClass.CCStopGrid()\n--CCStopGrid class will be Deprecated,end\n\n--CCTransitionScene class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionScene()\n    deprecatedTip(\"CCTransitionScene\",\"cc.TransitionScene\")\n    return cc.TransitionScene\nend\n_G[\"CCTransitionScene\"] = DeprecatedClass.CCTransitionScene()\n--CCTransitionScene class will be Deprecated,end\n\n--CCSkewBy class will be Deprecated,begin\nfunction DeprecatedClass.CCSkewBy()\n    deprecatedTip(\"CCSkewBy\",\"cc.SkewBy\")\n    return cc.SkewBy\nend\n_G[\"CCSkewBy\"] = DeprecatedClass.CCSkewBy()\n--CCSkewBy class will be Deprecated,end\n\n--CCLayer class will be Deprecated,begin\nfunction DeprecatedClass.CCLayer()\n    deprecatedTip(\"CCLayer\",\"cc.Layer\")\n    return cc.Layer\nend\n_G[\"CCLayer\"] = DeprecatedClass.CCLayer()\n--CCLayer class will be Deprecated,end\n\n--CCEaseElastic class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElastic()\n    deprecatedTip(\"CCEaseElastic\",\"cc.EaseElastic\")\n    return cc.EaseElastic\nend\n_G[\"CCEaseElastic\"] = DeprecatedClass.CCEaseElastic()\n--CCEaseElastic class will be Deprecated,end\n\n--CCTMXTiledMap class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXTiledMap()\n    deprecatedTip(\"CCTMXTiledMap\",\"cc.TMXTiledMap\")\n    return cc.TMXTiledMap\nend\n_G[\"CCTMXTiledMap\"] = DeprecatedClass.CCTMXTiledMap()\n--CCTMXTiledMap class will be Deprecated,end\n\n--CCGrid3DAction class will be Deprecated,begin\nfunction DeprecatedClass.CCGrid3DAction()\n    deprecatedTip(\"CCGrid3DAction\",\"cc.Grid3DAction\")\n    return cc.Grid3DAction\nend\n_G[\"CCGrid3DAction\"] = DeprecatedClass.CCGrid3DAction()\n--CCGrid3DAction class will be Deprecated,end\n\n--CCFadeIn class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeIn()\n    deprecatedTip(\"CCFadeIn\",\"cc.FadeIn\")\n    return cc.FadeIn\nend\n_G[\"CCFadeIn\"] = DeprecatedClass.CCFadeIn()\n--CCFadeIn class will be Deprecated,end\n\n--CCNodeRGBA class will be Deprecated,begin\nfunction DeprecatedClass.CCNodeRGBA()\n    deprecatedTip(\"CCNodeRGBA\",\"cc.Node\")\n    return cc.Node\nend\n_G[\"CCNodeRGBA\"] = DeprecatedClass.CCNodeRGBA()\n--CCNodeRGBA class will be Deprecated,end\n\n--NodeRGBA class will be Deprecated,begin\nfunction DeprecatedClass.NodeRGBA()\n    deprecatedTip(\"cc.NodeRGBA\",\"cc.Node\")\n    return cc.Node\nend\n_G[\"cc\"][\"NodeRGBA\"] = DeprecatedClass.NodeRGBA()\n--NodeRGBA class will be Deprecated,end\n\n--CCAnimationCache class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimationCache()\n    deprecatedTip(\"CCAnimationCache\",\"cc.AnimationCache\")\n    return cc.AnimationCache\nend\n_G[\"CCAnimationCache\"] = DeprecatedClass.CCAnimationCache()\n--CCAnimationCache class will be Deprecated,end\n\n--CCFlipY3D class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipY3D()\n    deprecatedTip(\"CCFlipY3D\",\"cc.FlipY3D\")\n    return cc.FlipY3D\nend\n_G[\"CCFlipY3D\"] = DeprecatedClass.CCFlipY3D()\n--CCFlipY3D class will be Deprecated,end\n\n--CCEaseSineInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseSineInOut()\n    deprecatedTip(\"CCEaseSineInOut\",\"cc.EaseSineInOut\")\n    return cc.EaseSineInOut\nend\n_G[\"CCEaseSineInOut\"] = DeprecatedClass.CCEaseSineInOut()\n--CCEaseSineInOut class will be Deprecated,end\n\n--CCTransitionFlipAngular class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFlipAngular()\n    deprecatedTip(\"CCTransitionFlipAngular\",\"cc.TransitionFlipAngular\")\n    return cc.TransitionFlipAngular\nend\n_G[\"CCTransitionFlipAngular\"] = DeprecatedClass.CCTransitionFlipAngular()\n--CCTransitionFlipAngular class will be Deprecated,end\n\n--CCControl class will be Deprecated,begin\nfunction DeprecatedClass.CCControl()\n    deprecatedTip(\"CCControl\",\"cc.Control\")\n    return cc.Control\nend\n_G[\"CCControl\"] = DeprecatedClass.CCControl()\n--CCControl class will be Deprecated,end\n\n--CCEaseElasticInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElasticInOut()\n    deprecatedTip(\"CCEaseElasticInOut\",\"cc.EaseElasticInOut\")\n    return cc.EaseElasticInOut\nend\n_G[\"CCEaseElasticInOut\"] = DeprecatedClass.CCEaseElasticInOut()\n--CCEaseElasticInOut class will be Deprecated,end\n\n--CCEaseBounce class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounce()\n    deprecatedTip(\"CCEaseBounce\",\"cc.EaseBounce\")\n    return cc.EaseBounce\nend\n_G[\"CCEaseBounce\"] = DeprecatedClass.CCEaseBounce()\n--CCEaseBounce class will be Deprecated,end\n\n--CCShow class will be Deprecated,begin\nfunction DeprecatedClass.CCShow()\n    deprecatedTip(\"CCShow\",\"cc.Show\")\n    return cc.Show\nend\n_G[\"CCShow\"] = DeprecatedClass.CCShow()\n--CCShow class will be Deprecated,end\n\n--CCEditBox class will be Deprecated,begin\nfunction DeprecatedClass.CCEditBox()\n    deprecatedTip(\"CCEditBox\",\"cc.EditBox\")\n    return cc.EditBox\nend\n_G[\"CCEditBox\"] = DeprecatedClass.CCEditBox()\n--CCEditBox class will be Deprecated,end\n\n--CCFadeOut class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOut()\n    deprecatedTip(\"CCFadeOut\",\"cc.FadeOut\")\n    return cc.FadeOut\nend\n_G[\"CCFadeOut\"] = DeprecatedClass.CCFadeOut()\n--CCFadeOut class will be Deprecated,end\n\n--CCCallFunc class will be Deprecated,begin\nfunction DeprecatedClass.CCCallFunc()\n    deprecatedTip(\"CCCallFunc\",\"cc.CallFunc\")\n    return cc.CallFunc\nend\n_G[\"CCCallFunc\"] = DeprecatedClass.CCCallFunc()\n--CCCallFunc class will be Deprecated,end\n\n--CCWaves3D class will be Deprecated,begin\nfunction DeprecatedClass.CCWaves3D()\n    deprecatedTip(\"CCWaves3D\",\"cc.Waves3D\")\n    return cc.Waves3D\nend\n_G[\"CCWaves3D\"] = DeprecatedClass.CCWaves3D()\n--CCWaves3D class will be Deprecated,end\n\n--CCFlipX3D class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipX3D()\n    deprecatedTip(\"CCFlipX3D\",\"cc.FlipX3D\")\n    return cc.FlipX3D\nend\n_G[\"CCFlipX3D\"] = DeprecatedClass.CCFlipX3D()\n--CCFlipX3D class will be Deprecated,end\n\n--CCParticleFireworks class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleFireworks()\n    deprecatedTip(\"CCParticleFireworks\",\"cc.ParticleFireworks\")\n    return cc.ParticleFireworks\nend\n_G[\"CCParticleFireworks\"] = DeprecatedClass.CCParticleFireworks()\n--CCParticleFireworks class will be Deprecated,end\n\n--CCMenuItemImage class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemImage()\n    deprecatedTip(\"CCMenuItemImage\",\"cc.MenuItemImage\")\n    return cc.MenuItemImage\nend\n_G[\"CCMenuItemImage\"] = DeprecatedClass.CCMenuItemImage()\n--CCMenuItemImage class will be Deprecated,end\n\n--CCParticleFire class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleFire()\n    deprecatedTip(\"CCParticleFire\",\"cc.ParticleFire\")\n    return cc.ParticleFire\nend\n_G[\"CCParticleFire\"] = DeprecatedClass.CCParticleFire()\n--CCParticleFire class will be Deprecated,end\n\n--CCMenuItem class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItem()\n    deprecatedTip(\"CCMenuItem\",\"cc.MenuItem\")\n    return cc.MenuItem\nend\n_G[\"CCMenuItem\"] = DeprecatedClass.CCMenuItem()\n--CCMenuItem class will be Deprecated,end\n\n--CCActionEase class will be Deprecated,begin\nfunction DeprecatedClass.CCActionEase()\n    deprecatedTip(\"CCActionEase\",\"cc.ActionEase\")\n    return cc.ActionEase\nend\n_G[\"CCActionEase\"] = DeprecatedClass.CCActionEase()\n--CCActionEase class will be Deprecated,end\n\n--CCTransitionSceneOriented class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSceneOriented()\n    deprecatedTip(\"CCTransitionSceneOriented\",\"cc.TransitionSceneOriented\")\n    return cc.TransitionSceneOriented\nend\n_G[\"CCTransitionSceneOriented\"] = DeprecatedClass.CCTransitionSceneOriented()\n--CCTransitionSceneOriented class will be Deprecated,end\n\n--CCTransitionZoomFlipAngular class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionZoomFlipAngular()\n    deprecatedTip(\"CCTransitionZoomFlipAngular\",\"cc.TransitionZoomFlipAngular\")\n    return cc.TransitionZoomFlipAngular\nend\n_G[\"CCTransitionZoomFlipAngular\"] = DeprecatedClass.CCTransitionZoomFlipAngular()\n--CCTransitionZoomFlipAngular class will be Deprecated,end\n\n--CCEaseIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseIn()\n    deprecatedTip(\"CCEaseIn\",\"cc.EaseIn\")\n    return cc.EaseIn\nend\n_G[\"CCEaseIn\"] = DeprecatedClass.CCEaseIn()\n--CCEaseIn class will be Deprecated,end\n\n--CCEaseExponentialInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseExponentialInOut()\n    deprecatedTip(\"CCEaseExponentialInOut\",\"cc.EaseExponentialInOut\")\n    return cc.EaseExponentialInOut\nend\n_G[\"CCEaseExponentialInOut\"] = DeprecatedClass.CCEaseExponentialInOut()\n--CCEaseExponentialInOut class will be Deprecated,end\n\n--CCTransitionFlipX class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFlipX()\n    deprecatedTip(\"CCTransitionFlipX\",\"cc.TransitionFlipX\")\n    return cc.TransitionFlipX\nend\n_G[\"CCTransitionFlipX\"] = DeprecatedClass.CCTransitionFlipX()\n--CCTransitionFlipX class will be Deprecated,end\n\n--CCEaseExponentialOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseExponentialOut()\n    deprecatedTip(\"CCEaseExponentialOut\",\"cc.EaseExponentialOut\")\n    return cc.EaseExponentialOut\nend\n_G[\"CCEaseExponentialOut\"] = DeprecatedClass.CCEaseExponentialOut()\n--CCEaseExponentialOut class will be Deprecated,end\n\n--CCLabel class will be Deprecated,begin\nfunction DeprecatedClass.CCLabel()\n    deprecatedTip(\"CCLabel\",\"cc.Label\")\n    return cc.Label\nend\n_G[\"CCLabel\"] = DeprecatedClass.CCLabel()\n--CCLabel class will be Deprecated,end\n\n--CCApplication class will be Deprecated,begin\nfunction DeprecatedClass.CCApplication()\n    deprecatedTip(\"CCApplication\",\"cc.Application\")\n    return cc.Application\nend\n_G[\"CCApplication\"] = DeprecatedClass.CCApplication()\n--CCApplication class will be Deprecated,end\n\n--CCControlSlider class will be Deprecated,begin\nfunction DeprecatedClass.CCControlSlider()\n    deprecatedTip(\"CCControlSlider\",\"cc.ControlSlider\")\n    return cc.ControlSlider\nend\n_G[\"CCControlSlider\"] = DeprecatedClass.CCControlSlider()\n--CCControlSlider class will be Deprecated,end\n\n--CCDelayTime class will be Deprecated,begin\nfunction DeprecatedClass.CCDelayTime()\n    deprecatedTip(\"CCDelayTime\",\"cc.DelayTime\")\n    return cc.DelayTime\nend\n_G[\"CCDelayTime\"] = DeprecatedClass.CCDelayTime()\n--CCDelayTime class will be Deprecated,end\n\n--CCLabelAtlas class will be Deprecated,begin\nfunction DeprecatedClass.CCLabelAtlas()\n    deprecatedTip(\"CCLabelAtlas\",\"cc.LabelAtlas\")\n    return cc.LabelAtlas\nend\n_G[\"CCLabelAtlas\"] = DeprecatedClass.CCLabelAtlas()\n--CCLabelAtlas class will be Deprecated,end\n\n--CCLabelBMFont class will be Deprecated,begin\nfunction DeprecatedClass.CCLabelBMFont()\n    deprecatedTip(\"CCLabelBMFont\",\"cc.LabelBMFont\")\n    return cc.LabelBMFont\nend\n_G[\"CCLabelBMFont\"] = DeprecatedClass.CCLabelBMFont()\n--CCLabelBMFont class will be Deprecated,end\n\n--CCScale9Sprite class will be Deprecated,begin\nfunction DeprecatedClass.CCScale9Sprite()\n    deprecatedTip(\"CCScale9Sprite\",\"cc.Scale9Sprite\")\n    return cc.Scale9Sprite\nend\n_G[\"CCScale9Sprite\"] = DeprecatedClass.CCScale9Sprite()\n--CCScale9Sprite class will be Deprecated,end\n\n--CCFadeOutTRTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutTRTiles()\n    deprecatedTip(\"CCFadeOutTRTiles\",\"cc.FadeOutTRTiles\")\n    return cc.FadeOutTRTiles\nend\n_G[\"CCFadeOutTRTiles\"] = DeprecatedClass.CCFadeOutTRTiles()\n--CCFadeOutTRTiles class will be Deprecated,end\n\n--CCEaseElasticIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseElasticIn()\n    deprecatedTip(\"CCEaseElasticIn\",\"cc.EaseElasticIn\")\n    return cc.EaseElasticIn\nend\n_G[\"CCEaseElasticIn\"] = DeprecatedClass.CCEaseElasticIn()\n--CCEaseElasticIn class will be Deprecated,end\n\n--CCParticleSpiral class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSpiral()\n    deprecatedTip(\"CCParticleSpiral\",\"cc.ParticleSpiral\")\n    return cc.ParticleSpiral\nend\n_G[\"CCParticleSpiral\"] = DeprecatedClass.CCParticleSpiral()\n--CCParticleSpiral class will be Deprecated,end\n\n--CCBReader class will be Deprecated,begin\nfunction DeprecatedClass.CCBReader()\n    deprecatedTip(\"CCBReader\",\"cc.BReader\")\n    return cc.BReader\nend\n_G[\"CCBReader\"] = DeprecatedClass.CCBReader()\n--CCBReader class will be Deprecated,end\n\n--CCFiniteTimeAction class will be Deprecated,begin\nfunction DeprecatedClass.CCFiniteTimeAction()\n    deprecatedTip(\"CCFiniteTimeAction\",\"cc.FiniteTimeAction\")\n    return cc.FiniteTimeAction\nend\n_G[\"CCFiniteTimeAction\"] = DeprecatedClass.CCFiniteTimeAction()\n--CCFiniteTimeAction class will be Deprecated,end\n\n--CCFadeOutDownTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutDownTiles()\n    deprecatedTip(\"CCFadeOutDownTiles\",\"cc.FadeOutDownTiles\")\n    return cc.FadeOutDownTiles\nend\n_G[\"CCFadeOutDownTiles\"] = DeprecatedClass.CCFadeOutDownTiles()\n--CCFadeOutDownTiles class will be Deprecated,end\n\n--CCJumpTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCJumpTiles3D()\n    deprecatedTip(\"CCJumpTiles3D\",\"cc.JumpTiles3D\")\n    return cc.JumpTiles3D\nend\n_G[\"CCJumpTiles3D\"] = DeprecatedClass.CCJumpTiles3D()\n--CCJumpTiles3D class will be Deprecated,end\n\n--CCEaseBackIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBackIn()\n    deprecatedTip(\"CCEaseBackIn\",\"cc.EaseBackIn\")\n    return cc.EaseBackIn\nend\n_G[\"CCEaseBackIn\"] = DeprecatedClass.CCEaseBackIn()\n--CCEaseBackIn class will be Deprecated,end\n\n--CCSpriteBatchNode class will be Deprecated,begin\nfunction DeprecatedClass.CCSpriteBatchNode()\n    deprecatedTip(\"CCSpriteBatchNode\",\"cc.SpriteBatchNode\")\n    return cc.SpriteBatchNode\nend\n_G[\"CCSpriteBatchNode\"] = DeprecatedClass.CCSpriteBatchNode()\n--CCSpriteBatchNode class will be Deprecated,end\n\n--CCParticleSystem class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSystem()\n    deprecatedTip(\"CCParticleSystem\",\"cc.ParticleSystem\")\n    return cc.ParticleSystem\nend\n_G[\"CCParticleSystem\"] = DeprecatedClass.CCParticleSystem()\n--CCParticleSystem class will be Deprecated,end\n\n--CCActionTween class will be Deprecated,begin\nfunction DeprecatedClass.CCActionTween()\n    deprecatedTip(\"CCActionTween\",\"cc.ActionTween\")\n    return cc.ActionTween\nend\n_G[\"CCActionTween\"] = DeprecatedClass.CCActionTween()\n--CCActionTween class will be Deprecated,end\n\n--CCTransitionFadeDown class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeDown()\n    deprecatedTip(\"CCTransitionFadeDown\",\"cc.TransitionFadeDown\")\n    return cc.TransitionFadeDown\nend\n_G[\"CCTransitionFadeDown\"] = DeprecatedClass.CCTransitionFadeDown()\n--CCTransitionFadeDown class will be Deprecated,end\n\n--CCParticleSun class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSun()\n    deprecatedTip(\"CCParticleSun\",\"cc.ParticleSun\")\n    return cc.ParticleSun\nend\n_G[\"CCParticleSun\"] = DeprecatedClass.CCParticleSun()\n--CCParticleSun class will be Deprecated,end\n\n--CCTransitionProgressHorizontal class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressHorizontal()\n    deprecatedTip(\"CCTransitionProgressHorizontal\",\"cc.TransitionProgressHorizontal\")\n    return cc.TransitionProgressHorizontal\nend\n_G[\"CCTransitionProgressHorizontal\"] = DeprecatedClass.CCTransitionProgressHorizontal()\n--CCTransitionProgressHorizontal class will be Deprecated,end\n\n--CCRipple3D class will be Deprecated,begin\nfunction DeprecatedClass.CCRipple3D()\n    deprecatedTip(\"CCRipple3D\",\"cc.Ripple3D\")\n    return cc.Ripple3D\nend\n_G[\"CCRipple3D\"] = DeprecatedClass.CCRipple3D()\n--CCRipple3D class will be Deprecated,end\n\n--CCTMXLayer class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXLayer()\n    deprecatedTip(\"CCTMXLayer\",\"cc.TMXLayer\")\n    return cc.TMXLayer\nend\n_G[\"CCTMXLayer\"] = DeprecatedClass.CCTMXLayer()\n--CCTMXLayer class will be Deprecated,end\n\n--CCFlipX class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipX()\n    deprecatedTip(\"CCFlipX\",\"cc.FlipX\")\n    return cc.FlipX\nend\n_G[\"CCFlipX\"] = DeprecatedClass.CCFlipX()\n--CCFlipX class will be Deprecated,end\n\n--CCFlipY class will be Deprecated,begin\nfunction DeprecatedClass.CCFlipY()\n    deprecatedTip(\"CCFlipY\",\"cc.FlipY\")\n    return cc.FlipY\nend\n_G[\"CCFlipY\"] = DeprecatedClass.CCFlipY()\n--CCFlipY class will be Deprecated,end\n\n--CCTransitionSplitCols class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSplitCols()\n    deprecatedTip(\"CCTransitionSplitCols\",\"cc.TransitionSplitCols\")\n    return cc.TransitionSplitCols\nend\n_G[\"CCTransitionSplitCols\"] = DeprecatedClass.CCTransitionSplitCols()\n--CCTransitionSplitCols class will be Deprecated,end\n\n--CCTimer class will be Deprecated,begin\nfunction DeprecatedClass.CCTimer()\n    deprecatedTip(\"CCTimer\",\"cc.Timer\")\n    return cc.Timer\nend\n_G[\"CCTimer\"] = DeprecatedClass.CCTimer()\n--CCTimer class will be Deprecated,end\n\n--CCFadeTo class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeTo()\n    deprecatedTip(\"CCFadeTo\",\"cc.FadeTo\")\n    return cc.FadeTo\nend\n_G[\"CCFadeTo\"] = DeprecatedClass.CCFadeTo()\n--CCFadeTo class will be Deprecated,end\n\n--CCBAnimationManager class will be Deprecated,begin\nfunction DeprecatedClass.CCBAnimationManager()\n    deprecatedTip(\"CCBAnimationManager\",\"cc.BAnimationManager\")\n    return cc.BAnimationManager\nend\n_G[\"CCBAnimationManager\"] = DeprecatedClass.CCBAnimationManager()\n--CCBAnimationManager class will be Deprecated,end\n\n--CCRepeatForever class will be Deprecated,begin\nfunction DeprecatedClass.CCRepeatForever()\n    deprecatedTip(\"CCRepeatForever\",\"cc.RepeatForever\")\n    return cc.RepeatForever\nend\n_G[\"CCRepeatForever\"] = DeprecatedClass.CCRepeatForever()\n--CCRepeatForever class will be Deprecated,end\n\n--CCPlace class will be Deprecated,begin\nfunction DeprecatedClass.CCPlace()\n    deprecatedTip(\"CCPlace\",\"cc.Place\")\n    return cc.Place\nend\n_G[\"CCPlace\"] = DeprecatedClass.CCPlace()\n--CCPlace class will be Deprecated,end\n\n--CCScrollView class will be Deprecated,begin\nfunction DeprecatedClass.CCScrollView()\n    deprecatedTip(\"CCScrollView\",\"cc.ScrollView\")\n    return cc.ScrollView\nend\n_G[\"CCScrollView\"] = DeprecatedClass.CCScrollView()\n--CCScrollView class will be Deprecated,end\n\n\n--CCGLProgram class will be Deprecated,begin\nfunction DeprecatedClass.CCGLProgram()\n    deprecatedTip(\"CCGLProgram\",\"cc.GLProgram\")\n    return cc.GLProgram\nend\n_G[\"CCGLProgram\"] = DeprecatedClass.CCGLProgram()\n--CCGLProgram class will be Deprecated,end\n\n--CCEaseBounceOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounceOut()\n    deprecatedTip(\"CCEaseBounceOut\",\"cc.EaseBounceOut\")\n    return cc.EaseBounceOut\nend\n_G[\"CCEaseBounceOut\"] = DeprecatedClass.CCEaseBounceOut()\n--CCEaseBounceOut class will be Deprecated,end\n\n--CCCardinalSplineBy class will be Deprecated,begin\nfunction DeprecatedClass.CCCardinalSplineBy()\n    deprecatedTip(\"CCCardinalSplineBy\",\"cc.CardinalSplineBy\")\n    return cc.CardinalSplineBy\nend\n_G[\"CCCardinalSplineBy\"] = DeprecatedClass.CCCardinalSplineBy()\n--CCCardinalSplineBy class will be Deprecated,end\n\n--CCSpriteFrameCache class will be Deprecated,begin\nfunction DeprecatedClass.CCSpriteFrameCache()\n    deprecatedTip(\"CCSpriteFrameCache\",\"cc.SpriteFrameCache\")\n    return cc.SpriteFrameCache\nend\n_G[\"CCSpriteFrameCache\"] = DeprecatedClass.CCSpriteFrameCache()\n--CCSpriteFrameCache class will be Deprecated,end\n\n--CCTransitionShrinkGrow class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionShrinkGrow()\n    deprecatedTip(\"CCTransitionShrinkGrow\",\"cc.TransitionShrinkGrow\")\n    return cc.TransitionShrinkGrow\nend\n_G[\"CCTransitionShrinkGrow\"] = DeprecatedClass.CCTransitionShrinkGrow()\n--CCTransitionShrinkGrow class will be Deprecated,end\n\n--CCSplitCols class will be Deprecated,begin\nfunction DeprecatedClass.CCSplitCols()\n    deprecatedTip(\"CCSplitCols\",\"cc.SplitCols\")\n    return cc.SplitCols\nend\n_G[\"CCSplitCols\"] = DeprecatedClass.CCSplitCols()\n--CCSplitCols class will be Deprecated,end\n\n--CCClippingNode class will be Deprecated,begin\nfunction DeprecatedClass.CCClippingNode()\n    deprecatedTip(\"CCClippingNode\",\"cc.ClippingNode\")\n    return cc.ClippingNode\nend\n_G[\"CCClippingNode\"] = DeprecatedClass.CCClippingNode()\n--CCClippingNode class will be Deprecated,end\n\n--CCEaseBounceInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounceInOut()\n    deprecatedTip(\"CCEaseBounceInOut\",\"cc.EaseBounceInOut\")\n    return cc.EaseBounceInOut\nend\n_G[\"CCEaseBounceInOut\"] = DeprecatedClass.CCEaseBounceInOut()\n--CCEaseBounceInOut class will be Deprecated,end\n\n--CCLiquid class will be Deprecated,begin\nfunction DeprecatedClass.CCLiquid()\n    deprecatedTip(\"CCLiquid\",\"cc.Liquid\")\n    return cc.Liquid\nend\n_G[\"CCLiquid\"] = DeprecatedClass.CCLiquid()\n--CCLiquid class will be Deprecated,end\n\n--CCParticleFlower class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleFlower()\n    deprecatedTip(\"CCParticleFlower\",\"cc.ParticleFlower\")\n    return cc.ParticleFlower\nend\n_G[\"CCParticleFlower\"] = DeprecatedClass.CCParticleFlower()\n--CCParticleFlower class will be Deprecated,end\n\n--CCTableView class will be Deprecated,begin\nfunction DeprecatedClass.CCTableView()\n    deprecatedTip(\"CCTableView\",\"cc.TableView\")\n    return cc.TableView\nend\n_G[\"CCTableView\"] = DeprecatedClass.CCTableView()\n--CCTableView class will be Deprecated,end\n\n\n--CCParticleSmoke class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleSmoke()\n    deprecatedTip(\"CCParticleSmoke\",\"cc.ParticleSmoke\")\n    return cc.ParticleSmoke\nend\n_G[\"CCParticleSmoke\"] = DeprecatedClass.CCParticleSmoke()\n--CCParticleSmoke class will be Deprecated,end\n\n--CCImage class will be Deprecated,begin\nfunction DeprecatedClass.CCImage()\n    deprecatedTip(\"CCImage\",\"cc.Image\")\n    return cc.Image\nend\n_G[\"CCImage\"] = DeprecatedClass.CCImage()\n--CCImage class will be Deprecated,end\n\n--CCTurnOffTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCTurnOffTiles()\n    deprecatedTip(\"CCTurnOffTiles\",\"cc.TurnOffTiles\")\n    return cc.TurnOffTiles\nend\n_G[\"CCTurnOffTiles\"] = DeprecatedClass.CCTurnOffTiles()\n--CCTurnOffTiles class will be Deprecated,end\n\n--CCBlink class will be Deprecated,begin\nfunction DeprecatedClass.CCBlink()\n    deprecatedTip(\"CCBlink\",\"cc.Blink\")\n    return cc.Blink\nend\n_G[\"CCBlink\"] = DeprecatedClass.CCBlink()\n--CCBlink class will be Deprecated,end\n\n--CCShaderCache class will be Deprecated,begin\nfunction DeprecatedClass.CCShaderCache()\n    deprecatedTip(\"CCShaderCache\",\"cc.ShaderCache\")\n    return cc.ShaderCache\nend\n_G[\"CCShaderCache\"] = DeprecatedClass.CCShaderCache()\n--CCShaderCache class will be Deprecated,end\n\n--CCJumpTo class will be Deprecated,begin\nfunction DeprecatedClass.CCJumpTo()\n    deprecatedTip(\"CCJumpTo\",\"cc.JumpTo\")\n    return cc.JumpTo\nend\n_G[\"CCJumpTo\"] = DeprecatedClass.CCJumpTo()\n--CCJumpTo class will be Deprecated,end\n\n--CCAtlasNode class will be Deprecated,begin\nfunction DeprecatedClass.CCAtlasNode()\n    deprecatedTip(\"CCAtlasNode\",\"cc.AtlasNode\")\n    return cc.AtlasNode\nend\n_G[\"CCAtlasNode\"] = DeprecatedClass.CCAtlasNode()\n--CCAtlasNode class will be Deprecated,end\n\n--CCTransitionJumpZoom class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionJumpZoom()\n    deprecatedTip(\"CCTransitionJumpZoom\",\"cc.TransitionJumpZoom\")\n    return cc.TransitionJumpZoom\nend\n_G[\"CCTransitionJumpZoom\"] = DeprecatedClass.CCTransitionJumpZoom()\n--CCTransitionJumpZoom class will be Deprecated,end\n\n--CCTransitionProgressVertical class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressVertical()\n    deprecatedTip(\"CCTransitionProgressVertical\",\"cc.TransitionProgressVertical\")\n    return cc.TransitionProgressVertical\nend\n_G[\"CCTransitionProgressVertical\"] = DeprecatedClass.CCTransitionProgressVertical()\n--CCTransitionProgressVertical class will be Deprecated,end\n\n--CCAnimationFrame class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimationFrame()\n    deprecatedTip(\"CCAnimationFrame\",\"cc.AnimationFrame\")\n    return cc.AnimationFrame\nend\n_G[\"CCAnimationFrame\"] = DeprecatedClass.CCAnimationFrame()\n--CCAnimationFrame class will be Deprecated,end\n\n--CCTintTo class will be Deprecated,begin\nfunction DeprecatedClass.CCTintTo()\n    deprecatedTip(\"CCTintTo\",\"cc.TintTo\")\n    return cc.TintTo\nend\n_G[\"CCTintTo\"] = DeprecatedClass.CCTintTo()\n--CCTintTo class will be Deprecated,end\n\n--CCTiledGrid3DAction class will be Deprecated,begin\nfunction DeprecatedClass.CCTiledGrid3DAction()\n    deprecatedTip(\"CCTiledGrid3DAction\",\"cc.TiledGrid3DAction\")\n    return cc.TiledGrid3DAction\nend\n_G[\"CCTiledGrid3DAction\"] = DeprecatedClass.CCTiledGrid3DAction()\n--CCTiledGrid3DAction class will be Deprecated,end\n\n--CCTMXTilesetInfo class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXTilesetInfo()\n    deprecatedTip(\"CCTMXTilesetInfo\",\"cc.TMXTilesetInfo\")\n    return cc.TMXTilesetInfo\nend\n_G[\"CCTMXTilesetInfo\"] = DeprecatedClass.CCTMXTilesetInfo()\n--CCTMXTilesetInfo class will be Deprecated,end\n\n--CCTMXObjectGroup class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXObjectGroup()\n    deprecatedTip(\"CCTMXObjectGroup\",\"cc.TMXObjectGroup\")\n    return cc.TMXObjectGroup\nend\n_G[\"CCTMXObjectGroup\"] = DeprecatedClass.CCTMXObjectGroup()\n--CCTMXObjectGroup class will be Deprecated,end\n\n--CCParticleGalaxy class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleGalaxy()\n    deprecatedTip(\"CCParticleGalaxy\",\"cc.ParticleGalaxy\")\n    return cc.ParticleGalaxy\nend\n_G[\"CCParticleGalaxy\"] = DeprecatedClass.CCParticleGalaxy()\n--CCParticleGalaxy class will be Deprecated,end\n\n--CCTwirl class will be Deprecated,begin\nfunction DeprecatedClass.CCTwirl()\n    deprecatedTip(\"CCTwirl\",\"cc.Twirl\")\n    return cc.Twirl\nend\n_G[\"CCTwirl\"] = DeprecatedClass.CCTwirl()\n--CCTwirl class will be Deprecated,end\n\n--CCMenuItemLabel class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemLabel()\n    deprecatedTip(\"CCMenuItemLabel\",\"cc.MenuItemLabel\")\n    return cc.MenuItemLabel\nend\n_G[\"CCMenuItemLabel\"] = DeprecatedClass.CCMenuItemLabel()\n--CCMenuItemLabel class will be Deprecated,end\n\n--CCLayerColor class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerColor()\n    deprecatedTip(\"CCLayerColor\",\"cc.LayerColor\")\n    return cc.LayerColor\nend\n_G[\"CCLayerColor\"] = DeprecatedClass.CCLayerColor()\n--CCLayerColor class will be Deprecated,end\n\n--CCFadeOutBLTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutBLTiles()\n    deprecatedTip(\"CCFadeOutBLTiles\",\"cc.FadeOutBLTiles\")\n    return cc.FadeOutBLTiles\nend\n_G[\"CCFadeOutBLTiles\"] = DeprecatedClass.CCFadeOutBLTiles()\n--CCFadeOutBLTiles class will be Deprecated,end\n\n--CCTransitionProgress class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgress()\n    deprecatedTip(\"CCTransitionProgress\",\"cc.TransitionProgress\")\n    return cc.TransitionProgress\nend\n_G[\"CCTransitionProgress\"] = DeprecatedClass.CCTransitionProgress()\n--CCTransitionProgress class will be Deprecated,end\n\n--CCEaseRateAction class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseRateAction()\n    deprecatedTip(\"CCEaseRateAction\",\"cc.EaseRateAction\")\n    return cc.EaseRateAction\nend\n_G[\"CCEaseRateAction\"] = DeprecatedClass.CCEaseRateAction()\n--CCEaseRateAction class will be Deprecated,end\n\n--CCLayerGradient class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerGradient()\n    deprecatedTip(\"CCLayerGradient\",\"cc.LayerGradient\")\n    return cc.LayerGradient\nend\n_G[\"CCLayerGradient\"] = DeprecatedClass.CCLayerGradient()\n--CCLayerGradient class will be Deprecated,end\n\n--CCMenuItemSprite class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemSprite()\n    deprecatedTip(\"CCMenuItemSprite\",\"cc.MenuItemSprite\")\n    return cc.MenuItemSprite\nend\n_G[\"CCMenuItemSprite\"] = DeprecatedClass.CCMenuItemSprite()\n--CCMenuItemSprite class will be Deprecated,end\n\n--CCNode class will be Deprecated,begin\nfunction DeprecatedClass.CCNode()\n    deprecatedTip(\"CCNode\",\"cc.Node\")\n    return cc.Node\nend\n_G[\"CCNode\"] = DeprecatedClass.CCNode()\n--CCNode class will be Deprecated,end\n\n--CCToggleVisibility class will be Deprecated,begin\nfunction DeprecatedClass.CCToggleVisibility()\n    deprecatedTip(\"CCToggleVisibility\",\"cc.ToggleVisibility\")\n    return cc.ToggleVisibility\nend\n_G[\"CCToggleVisibility\"] = DeprecatedClass.CCToggleVisibility()\n--CCToggleVisibility class will be Deprecated,end\n\n--CCRepeat class will be Deprecated,begin\nfunction DeprecatedClass.CCRepeat()\n    deprecatedTip(\"CCRepeat\",\"cc.Repeat\")\n    return cc.Repeat\nend\n_G[\"CCRepeat\"] = DeprecatedClass.CCRepeat()\n--CCRepeat class will be Deprecated,end\n\n--CCRenderTexture class will be Deprecated,begin\nfunction DeprecatedClass.CCRenderTexture()\n    deprecatedTip(\"CCRenderTexture\",\"cc.RenderTexture\")\n    return cc.RenderTexture\nend\n_G[\"CCRenderTexture\"] = DeprecatedClass.CCRenderTexture()\n--CCRenderTexture class will be Deprecated,end\n\n--CCTransitionFlipY class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFlipY()\n    deprecatedTip(\"CCTransitionFlipY\",\"cc.TransitionFlipY\")\n    return cc.TransitionFlipY\nend\n_G[\"CCTransitionFlipY\"] = DeprecatedClass.CCTransitionFlipY()\n--CCTransitionFlipY class will be Deprecated,end\n\n--CCLayerMultiplex class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerMultiplex()\n    deprecatedTip(\"CCLayerMultiplex\",\"cc.LayerMultiplex\")\n    return cc.LayerMultiplex\nend\n_G[\"CCLayerMultiplex\"] = DeprecatedClass.CCLayerMultiplex()\n--CCLayerMultiplex class will be Deprecated,end\n\n--CCTMXLayerInfo class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXLayerInfo()\n    deprecatedTip(\"CCTMXLayerInfo\",\"cc.TMXLayerInfo\")\n    return cc.TMXLayerInfo\nend\n_G[\"CCTMXLayerInfo\"] = DeprecatedClass.CCTMXLayerInfo()\n--CCTMXLayerInfo class will be Deprecated,end\n\n--CCEaseBackInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBackInOut()\n    deprecatedTip(\"CCEaseBackInOut\",\"cc.EaseBackInOut\")\n    return cc.EaseBackInOut\nend\n_G[\"CCEaseBackInOut\"] = DeprecatedClass.CCEaseBackInOut()\n--CCEaseBackInOut class will be Deprecated,end\n\n--CCActionInstant class will be Deprecated,begin\nfunction DeprecatedClass.CCActionInstant()\n    deprecatedTip(\"CCActionInstant\",\"cc.ActionInstant\")\n    return cc.ActionInstant\nend\n_G[\"CCActionInstant\"] = DeprecatedClass.CCActionInstant()\n--CCActionInstant class will be Deprecated,end\n\n--CCTargetedAction class will be Deprecated,begin\nfunction DeprecatedClass.CCTargetedAction()\n    deprecatedTip(\"CCTargetedAction\",\"cc.TargetedAction\")\n    return cc.TargetedAction\nend\n_G[\"CCTargetedAction\"] = DeprecatedClass.CCTargetedAction()\n--CCTargetedAction class will be Deprecated,end\n\n--CCDrawNode class will be Deprecated,begin\nfunction DeprecatedClass.CCDrawNode()\n    deprecatedTip(\"CCDrawNode\",\"cc.DrawNode\")\n    return cc.DrawNode\nend\n_G[\"CCDrawNode\"] = DeprecatedClass.CCDrawNode()\n--CCDrawNode class will be Deprecated,end\n\n--CCTransitionTurnOffTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionTurnOffTiles()\n    deprecatedTip(\"CCTransitionTurnOffTiles\",\"cc.TransitionTurnOffTiles\")\n    return cc.TransitionTurnOffTiles\nend\n_G[\"CCTransitionTurnOffTiles\"] = DeprecatedClass.CCTransitionTurnOffTiles()\n--CCTransitionTurnOffTiles class will be Deprecated,end\n\n--CCRotateTo class will be Deprecated,begin\nfunction DeprecatedClass.CCRotateTo()\n    deprecatedTip(\"CCRotateTo\",\"cc.RotateTo\")\n    return cc.RotateTo\nend\n_G[\"CCRotateTo\"] = DeprecatedClass.CCRotateTo()\n--CCRotateTo class will be Deprecated,end\n\n--CCTransitionSplitRows class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSplitRows()\n    deprecatedTip(\"CCTransitionSplitRows\",\"cc.TransitionSplitRows\")\n    return cc.TransitionSplitRows\nend\n_G[\"CCTransitionSplitRows\"] = DeprecatedClass.CCTransitionSplitRows()\n--CCTransitionSplitRows class will be Deprecated,end\n\n--CCTransitionProgressRadialCCW class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressRadialCCW()\n    deprecatedTip(\"CCTransitionProgressRadialCCW\",\"cc.TransitionProgressRadialCCW\")\n    return cc.TransitionProgressRadialCCW\nend\n_G[\"CCTransitionProgressRadialCCW\"] = DeprecatedClass.CCTransitionProgressRadialCCW()\n--CCTransitionProgressRadialCCW class will be Deprecated,end\n\n--CCScaleTo class will be Deprecated,begin\nfunction DeprecatedClass.CCScaleTo()\n    deprecatedTip(\"CCScaleTo\",\"cc.ScaleTo\")\n    return cc.ScaleTo\nend\n_G[\"CCScaleTo\"] = DeprecatedClass.CCScaleTo()\n--CCScaleTo class will be Deprecated,end\n\n--CCTransitionPageTurn class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionPageTurn()\n    deprecatedTip(\"CCTransitionPageTurn\",\"cc.TransitionPageTurn\")\n    return cc.TransitionPageTurn\nend\n_G[\"CCTransitionPageTurn\"] = DeprecatedClass.CCTransitionPageTurn()\n--CCTransitionPageTurn class will be Deprecated,end\n\n--CCParticleExplosion class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleExplosion()\n    deprecatedTip(\"CCParticleExplosion\",\"cc.ParticleExplosion\")\n    return cc.ParticleExplosion\nend\n_G[\"CCParticleExplosion\"] = DeprecatedClass.CCParticleExplosion()\n--CCParticleExplosion class will be Deprecated,end\n\n--CCMenu class will be Deprecated,begin\nfunction DeprecatedClass.CCMenu()\n    deprecatedTip(\"CCMenu\",\"cc.Menu\")\n    return cc.Menu\nend\n_G[\"CCMenu\"] = DeprecatedClass.CCMenu()\n--CCMenu class will be Deprecated,end\n\n--CCTexture2D class will be Deprecated,begin\nfunction DeprecatedClass.CCTexture2D()\n    deprecatedTip(\"CCTexture2D\",\"cc.Texture2D\")\n    return cc.Texture2D\nend\n_G[\"CCTexture2D\"] = DeprecatedClass.CCTexture2D()\n--CCTexture2D class will be Deprecated,end\n\n--CCActionManager class will be Deprecated,begin\nfunction DeprecatedClass.CCActionManager()\n    deprecatedTip(\"CCActionManager\",\"cc.ActionManager\")\n    return cc.ActionManager\nend\n_G[\"CCActionManager\"] = DeprecatedClass.CCActionManager()\n--CCActionManager class will be Deprecated,end\n\n--CCParticleBatchNode class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleBatchNode()\n    deprecatedTip(\"CCParticleBatchNode\",\"cc.ParticleBatchNode\")\n    return cc.ParticleBatchNode\nend\n_G[\"CCParticleBatchNode\"] = DeprecatedClass.CCParticleBatchNode()\n--CCParticleBatchNode class will be Deprecated,end\n\n--CCTransitionZoomFlipX class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionZoomFlipX()\n    deprecatedTip(\"CCTransitionZoomFlipX\",\"cc.TransitionZoomFlipX\")\n    return cc.TransitionZoomFlipX\nend\n_G[\"CCTransitionZoomFlipX\"] = DeprecatedClass.CCTransitionZoomFlipX()\n--CCTransitionZoomFlipX class will be Deprecated,end\n\n--CCControlPotentiometer class will be Deprecated,begin\nfunction DeprecatedClass.CCControlPotentiometer()\n    deprecatedTip(\"CCControlPotentiometer\",\"cc.ControlPotentiometer\")\n    return cc.ControlPotentiometer\nend\n_G[\"CCControlPotentiometer\"] = DeprecatedClass.CCControlPotentiometer()\n--CCControlPotentiometer class will be Deprecated,end\n\n--CCScaleBy class will be Deprecated,begin\nfunction DeprecatedClass.CCScaleBy()\n    deprecatedTip(\"CCScaleBy\",\"cc.ScaleBy\")\n    return cc.ScaleBy\nend\n_G[\"CCScaleBy\"] = DeprecatedClass.CCScaleBy()\n--CCScaleBy class will be Deprecated,end\n\n--CCTileMapAtlas class will be Deprecated,begin\nfunction DeprecatedClass.CCTileMapAtlas()\n    deprecatedTip(\"CCTileMapAtlas\",\"cc.TileMapAtlas\")\n    return cc.TileMapAtlas\nend\n_G[\"CCTileMapAtlas\"] = DeprecatedClass.CCTileMapAtlas()\n--CCTileMapAtlas class will be Deprecated,end\n\n--CCAction class will be Deprecated,begin\nfunction DeprecatedClass.CCAction()\n    deprecatedTip(\"CCAction\",\"cc.Action\")\n    return cc.Action\nend\n_G[\"CCAction\"] = DeprecatedClass.CCAction()\n--CCAction class will be Deprecated,end\n\n--CCLens3D class will be Deprecated,begin\nfunction DeprecatedClass.CCLens3D()\n    deprecatedTip(\"CCLens3D\",\"cc.Lens3D\")\n    return cc.Lens3D\nend\n_G[\"CCLens3D\"] = DeprecatedClass.CCLens3D()\n--CCLens3D class will be Deprecated,end\n\n--CCAnimation class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimation()\n    deprecatedTip(\"CCAnimation\",\"cc.Animation\")\n    return cc.Animation\nend\n_G[\"CCAnimation\"] = DeprecatedClass.CCAnimation()\n--CCAnimation class will be Deprecated,end\n\n--CCTransitionSlideInT class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInT()\n    deprecatedTip(\"CCTransitionSlideInT\",\"cc.TransitionSlideInT\")\n    return cc.TransitionSlideInT\nend\n_G[\"CCTransitionSlideInT\"] = DeprecatedClass.CCTransitionSlideInT()\n--CCTransitionSlideInT class will be Deprecated,end\n\n--CCSpawn class will be Deprecated,begin\nfunction DeprecatedClass.CCSpawn()\n    deprecatedTip(\"CCSpawn\",\"cc.Spawn\")\n    return cc.Spawn\nend\n_G[\"CCSpawn\"] = DeprecatedClass.CCSpawn()\n--CCSpawn class will be Deprecated,end\n\n--CCSet class will be Deprecated,begin\nfunction DeprecatedClass.CCSet()\n    deprecatedTip(\"CCSet\",\"cc.Set\")\n    return cc.Set\nend\n_G[\"CCSet\"] = DeprecatedClass.CCSet()\n--CCSet class will be Deprecated,end\n\n--CCShakyTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCShakyTiles3D()\n    deprecatedTip(\"CCShakyTiles3D\",\"cc.ShakyTiles3D\")\n    return cc.ShakyTiles3D\nend\n_G[\"CCShakyTiles3D\"] = DeprecatedClass.CCShakyTiles3D()\n--CCShakyTiles3D class will be Deprecated,end\n\n--CCPageTurn3D class will be Deprecated,begin\nfunction DeprecatedClass.CCPageTurn3D()\n    deprecatedTip(\"CCPageTurn3D\",\"cc.PageTurn3D\")\n    return cc.PageTurn3D\nend\n_G[\"CCPageTurn3D\"] = DeprecatedClass.CCPageTurn3D()\n--CCPageTurn3D class will be Deprecated,end\n\n--CCGrid3D class will be Deprecated,begin\nfunction DeprecatedClass.CCGrid3D()\n    deprecatedTip(\"CCGrid3D\",\"cc.Grid3D\")\n    return cc.Grid3D\nend\n_G[\"CCGrid3D\"] = DeprecatedClass.CCGrid3D()\n--CCGrid3D class will be Deprecated,end\n\n--CCTransitionProgressInOut class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressInOut()\n    deprecatedTip(\"CCTransitionProgressInOut\",\"cc.TransitionProgressInOut\")\n    return cc.TransitionProgressInOut\nend\n_G[\"CCTransitionProgressInOut\"] = DeprecatedClass.CCTransitionProgressInOut()\n--CCTransitionProgressInOut class will be Deprecated,end\n\n--CCTransitionFadeBL class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeBL()\n    deprecatedTip(\"CCTransitionFadeBL\",\"cc.TransitionFadeBL\")\n    return cc.TransitionFadeBL\nend\n_G[\"CCTransitionFadeBL\"] = DeprecatedClass.CCTransitionFadeBL()\n--CCTransitionFadeBL class will be Deprecated,end\n\n--CCCamera class will be Deprecated,begin\nfunction DeprecatedClass.CCCamera()\n    deprecatedTip(\"CCCamera\",\"cc.Camera\")\n    return cc.Camera\nend\n_G[\"CCCamera\"] = DeprecatedClass.CCCamera()\n--CCCamera class will be Deprecated,end\n\n--CCLayerRGBA class will be Deprecated,begin\nfunction DeprecatedClass.CCLayerRGBA()\n    deprecatedTip(\"CCLayerRGBA\",\"cc.Layer\")\n    return cc.Layer\nend\n_G[\"CCLayerRGBA\"] = DeprecatedClass.CCLayerRGBA()\n--CCLayerRGBA class will be Deprecated,end\n\n--LayerRGBA class will be Deprecated,begin\nfunction DeprecatedClass.LayerRGBA()\n    deprecatedTip(\"cc.LayerRGBA\",\"cc.Layer\")\n    return cc.Layer\nend\n_G[\"cc\"][\"LayerRGBA\"] = DeprecatedClass.LayerRGBA()\n--LayerRGBA class will be Deprecated,end\n\n--CCBezierTo class will be Deprecated,begin\nfunction DeprecatedClass.CCBezierTo()\n    deprecatedTip(\"CCBezierTo\",\"cc.BezierTo\")\n    return cc.BezierTo\nend\n_G[\"CCBezierTo\"] = DeprecatedClass.CCBezierTo()\n--CCBezierTo class will be Deprecated,end\n\n--CCControlButton class will be Deprecated,begin\nfunction DeprecatedClass.CCControlButton()\n    deprecatedTip(\"CCControlButton\",\"cc.ControlButton\")\n    return cc.ControlButton\nend\n_G[\"CCControlButton\"] = DeprecatedClass.CCControlButton()\n--CCControlButton class will be Deprecated,end\n\n--CCFollow class will be Deprecated,begin\nfunction DeprecatedClass.CCFollow()\n    deprecatedTip(\"CCFollow\",\"cc.Follow\")\n    return cc.Follow\nend\n_G[\"CCFollow\"] = DeprecatedClass.CCFollow()\n--CCFollow class will be Deprecated,end\n\n--CCTintBy class will be Deprecated,begin\nfunction DeprecatedClass.CCTintBy()\n    deprecatedTip(\"CCTintBy\",\"cc.TintBy\")\n    return cc.TintBy\nend\n_G[\"CCTintBy\"] = DeprecatedClass.CCTintBy()\n--CCTintBy class will be Deprecated,end\n\n--CCActionInterval class will be Deprecated,begin\nfunction DeprecatedClass.CCActionInterval()\n    deprecatedTip(\"CCActionInterval\",\"cc.ActionInterval\")\n    return cc.ActionInterval\nend\n_G[\"CCActionInterval\"] = DeprecatedClass.CCActionInterval()\n--CCActionInterval class will be Deprecated,end\n\n--CCAnimate class will be Deprecated,begin\nfunction DeprecatedClass.CCAnimate()\n    deprecatedTip(\"CCAnimate\",\"cc.Animate\")\n    return cc.Animate\nend\n_G[\"CCAnimate\"] = DeprecatedClass.CCAnimate()\n--CCAnimate class will be Deprecated,end\n\n--CCProgressTimer class will be Deprecated,begin\nfunction DeprecatedClass.CCProgressTimer()\n    deprecatedTip(\"CCProgressTimer\",\"cc.ProgressTimer\")\n    return cc.ProgressTimer\nend\n_G[\"CCProgressTimer\"] = DeprecatedClass.CCProgressTimer()\n--CCProgressTimer class will be Deprecated,end\n\n--CCParticleMeteor class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleMeteor()\n    deprecatedTip(\"CCParticleMeteor\",\"cc.ParticleMeteor\")\n    return cc.ParticleMeteor\nend\n_G[\"CCParticleMeteor\"] = DeprecatedClass.CCParticleMeteor()\n--CCParticleMeteor class will be Deprecated,end\n\n--CCTransitionFadeTR class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeTR()\n    deprecatedTip(\"CCTransitionFadeTR\",\"cc.TransitionFadeTR\")\n    return cc.TransitionFadeTR\nend\n_G[\"CCTransitionFadeTR\"] = DeprecatedClass.CCTransitionFadeTR()\n--CCTransitionFadeTR class will be Deprecated,end\n\n--CCCatmullRomTo class will be Deprecated,begin\nfunction DeprecatedClass.CCCatmullRomTo()\n    deprecatedTip(\"CCCatmullRomTo\",\"cc.CatmullRomTo\")\n    return cc.CatmullRomTo\nend\n_G[\"CCCatmullRomTo\"] = DeprecatedClass.CCCatmullRomTo()\n--CCCatmullRomTo class will be Deprecated,end\n\n--CCTransitionZoomFlipY class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionZoomFlipY()\n    deprecatedTip(\"CCTransitionZoomFlipY\",\"cc.TransitionZoomFlipY\")\n    return cc.TransitionZoomFlipY\nend\n_G[\"CCTransitionZoomFlipY\"] = DeprecatedClass.CCTransitionZoomFlipY()\n--CCTransitionZoomFlipY class will be Deprecated,end\n\n--CCTransitionCrossFade class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionCrossFade()\n    deprecatedTip(\"CCTransitionCrossFade\",\"cc.TransitionCrossFade\")\n    return cc.TransitionCrossFade\nend\n_G[\"CCTransitionCrossFade\"] = DeprecatedClass.CCTransitionCrossFade()\n--CCTransitionCrossFade class will be Deprecated,end\n\n--CCGridBase class will be Deprecated,begin\nfunction DeprecatedClass.CCGridBase()\n    deprecatedTip(\"CCGridBase\",\"cc.GridBase\")\n    return cc.GridBase\nend\n_G[\"CCGridBase\"] = DeprecatedClass.CCGridBase()\n--CCGridBase class will be Deprecated,end\n\n--CCSkewTo class will be Deprecated,begin\nfunction DeprecatedClass.CCSkewTo()\n    deprecatedTip(\"CCSkewTo\",\"cc.SkewTo\")\n    return cc.SkewTo\nend\n_G[\"CCSkewTo\"] = DeprecatedClass.CCSkewTo()\n--CCSkewTo class will be Deprecated,end\n\n--CCCardinalSplineTo class will be Deprecated,begin\nfunction DeprecatedClass.CCCardinalSplineTo()\n    deprecatedTip(\"CCCardinalSplineTo\",\"cc.CardinalSplineTo\")\n    return cc.CardinalSplineTo\nend\n_G[\"CCCardinalSplineTo\"] = DeprecatedClass.CCCardinalSplineTo()\n--CCCardinalSplineTo class will be Deprecated,end\n\n--CCTMXMapInfo class will be Deprecated,begin\nfunction DeprecatedClass.CCTMXMapInfo()\n    deprecatedTip(\"CCTMXMapInfo\",\"cc.TMXMapInfo\")\n    return cc.TMXMapInfo\nend\n_G[\"CCTMXMapInfo\"] = DeprecatedClass.CCTMXMapInfo()\n--CCTMXMapInfo class will be Deprecated,end\n\n--CCEaseExponentialIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseExponentialIn()\n    deprecatedTip(\"CCEaseExponentialIn\",\"cc.EaseExponentialIn\")\n    return cc.EaseExponentialIn\nend\n_G[\"CCEaseExponentialIn\"] = DeprecatedClass.CCEaseExponentialIn()\n--CCEaseExponentialIn class will be Deprecated,end\n\n--CCReuseGrid class will be Deprecated,begin\nfunction DeprecatedClass.CCReuseGrid()\n    deprecatedTip(\"CCReuseGrid\",\"cc.ReuseGrid\")\n    return cc.ReuseGrid\nend\n_G[\"CCReuseGrid\"] = DeprecatedClass.CCReuseGrid()\n--CCReuseGrid class will be Deprecated,end\n\n--CCMenuItemAtlasFont class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemAtlasFont()\n    deprecatedTip(\"CCMenuItemAtlasFont\",\"cc.MenuItemAtlasFont\")\n    return cc.MenuItemAtlasFont\nend\n_G[\"CCMenuItemAtlasFont\"] = DeprecatedClass.CCMenuItemAtlasFont()\n--CCMenuItemAtlasFont class will be Deprecated,end\n\n--CCSpriteFrame class will be Deprecated,begin\nfunction DeprecatedClass.CCSpriteFrame()\n    deprecatedTip(\"CCSpriteFrame\",\"cc.SpriteFrame\")\n    return cc.SpriteFrame\nend\n_G[\"CCSpriteFrame\"] = DeprecatedClass.CCSpriteFrame()\n--CCSpriteFrame class will be Deprecated,end\n\n--CCSplitRows class will be Deprecated,begin\nfunction DeprecatedClass.CCSplitRows()\n    deprecatedTip(\"CCSplitRows\",\"cc.SplitRows\")\n    return cc.SplitRows\nend\n_G[\"CCSplitRows\"] = DeprecatedClass.CCSplitRows()\n--CCSplitRows class will be Deprecated,end\n\n--CCControlStepper class will be Deprecated,begin\nfunction DeprecatedClass.CCControlStepper()\n    deprecatedTip(\"CCControlStepper\",\"cc.ControlStepper\")\n    return cc.ControlStepper\nend\n_G[\"CCControlStepper\"] = DeprecatedClass.CCControlStepper()\n--CCControlStepper class will be Deprecated,end\n\n--CCSprite class will be Deprecated,begin\nfunction DeprecatedClass.CCSprite()\n    deprecatedTip(\"CCSprite\",\"cc.Sprite\")\n    return cc.Sprite\nend\n_G[\"CCSprite\"] = DeprecatedClass.CCSprite()\n--CCSprite class will be Deprecated,end\n\n--CCOrbitCamera class will be Deprecated,begin\nfunction DeprecatedClass.CCOrbitCamera()\n    deprecatedTip(\"CCOrbitCamera\",\"cc.OrbitCamera\")\n    return cc.OrbitCamera\nend\n_G[\"CCOrbitCamera\"] = DeprecatedClass.CCOrbitCamera()\n--CCOrbitCamera class will be Deprecated,end\n\n--CCUserDefault class will be Deprecated,begin\nfunction DeprecatedClass.CCUserDefault()\n    deprecatedTip(\"CCUserDefault\",\"cc.UserDefault\")\n    return cc.UserDefault\nend\n_G[\"CCUserDefault\"] = DeprecatedClass.CCUserDefault()\n--CCUserDefault class will be Deprecated,end\n\n--CCFadeOutUpTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCFadeOutUpTiles()\n    deprecatedTip(\"CCFadeOutUpTiles\",\"cc.FadeOutUpTiles\")\n    return cc.FadeOutUpTiles\nend\n_G[\"CCFadeOutUpTiles\"] = DeprecatedClass.CCFadeOutUpTiles()\n--CCFadeOutUpTiles class will be Deprecated,end\n\n--CCParticleRain class will be Deprecated,begin\nfunction DeprecatedClass.CCParticleRain()\n    deprecatedTip(\"CCParticleRain\",\"cc.ParticleRain\")\n    return cc.ParticleRain\nend\n_G[\"CCParticleRain\"] = DeprecatedClass.CCParticleRain()\n--CCParticleRain class will be Deprecated,end\n\n--CCWaves class will be Deprecated,begin\nfunction DeprecatedClass.CCWaves()\n    deprecatedTip(\"CCWaves\",\"cc.Waves\")\n    return cc.Waves\nend\n_G[\"CCWaves\"] = DeprecatedClass.CCWaves()\n--CCWaves class will be Deprecated,end\n\n--CCEaseOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseOut()\n    deprecatedTip(\"CCEaseOut\",\"cc.EaseOut\")\n    return cc.EaseOut\nend\n_G[\"CCEaseOut\"] = DeprecatedClass.CCEaseOut()\n--CCEaseOut class will be Deprecated,end\n\n--CCEaseBounceIn class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseBounceIn()\n    deprecatedTip(\"CCEaseBounceIn\",\"cc.EaseBounceIn\")\n    return cc.EaseBounceIn\nend\n_G[\"CCEaseBounceIn\"] = DeprecatedClass.CCEaseBounceIn()\n--CCEaseBounceIn class will be Deprecated,end\n\n--CCMenuItemFont class will be Deprecated,begin\nfunction DeprecatedClass.CCMenuItemFont()\n    deprecatedTip(\"CCMenuItemFont\",\"cc.MenuItemFont\")\n    return cc.MenuItemFont\nend\n_G[\"CCMenuItemFont\"] = DeprecatedClass.CCMenuItemFont()\n--CCMenuItemFont class will be Deprecated,end\n\n--CCEaseSineOut class will be Deprecated,begin\nfunction DeprecatedClass.CCEaseSineOut()\n    deprecatedTip(\"CCEaseSineOut\",\"cc.EaseSineOut\")\n    return cc.EaseSineOut\nend\n_G[\"CCEaseSineOut\"] = DeprecatedClass.CCEaseSineOut()\n--CCEaseSineOut class will be Deprecated,end\n\n--CCTextureCache class will be Deprecated,begin\nfunction DeprecatedClass.CCTextureCache()\n    deprecatedTip(\"CCTextureCache\",\"cc.TextureCache\")\n    return cc.TextureCache\nend\n_G[\"CCTextureCache\"] = DeprecatedClass.CCTextureCache()\n--CCTextureCache class will be Deprecated,end\n\n--CCTiledGrid3D class will be Deprecated,begin\nfunction DeprecatedClass.CCTiledGrid3D()\n    deprecatedTip(\"CCTiledGrid3D\",\"cc.TiledGrid3D\")\n    return cc.TiledGrid3D\nend\n_G[\"CCTiledGrid3D\"] = DeprecatedClass.CCTiledGrid3D()\n--CCTiledGrid3D class will be Deprecated,end\n\n--CCRemoveSelf class will be Deprecated,begin\nfunction DeprecatedClass.CCRemoveSelf()\n    deprecatedTip(\"CCRemoveSelf\",\"cc.RemoveSelf\")\n    return cc.RemoveSelf\nend\n_G[\"CCRemoveSelf\"] = DeprecatedClass.CCRemoveSelf()\n--CCRemoveSelf class will be Deprecated,end\n\n--CCControlSaturationBrightnessPicker class will be Deprecated,begin\nfunction DeprecatedClass.CCControlSaturationBrightnessPicker()\n    deprecatedTip(\"CCControlSaturationBrightnessPicker\",\"cc.ControlSaturationBrightnessPicker\")\n    return cc.ControlSaturationBrightnessPicker\nend\n_G[\"CCControlSaturationBrightnessPicker\"] = DeprecatedClass.CCControlSaturationBrightnessPicker()\n--CCControlSaturationBrightnessPicker class will be Deprecated,end\n\n--CCLabelTTF class will be Deprecated,begin\nfunction DeprecatedClass.CCLabelTTF()\n    deprecatedTip(\"CCLabelTTF\",\"cc.LabelTTF\")\n    return cc.LabelTTF\nend\n_G[\"CCLabelTTF\"] = DeprecatedClass.CCLabelTTF()\n--CCLabelTTF class will be Deprecated,end\n\n--CCTouch class will be Deprecated,begin\nfunction DeprecatedClass.CCTouch()\n    deprecatedTip(\"CCTouch\",\"cc.Touch\")\n    return cc.Touch\nend\n_G[\"CCTouch\"] = DeprecatedClass.CCTouch()\n--CCTouch class will be Deprecated,end\n\n--CCMoveBy class will be Deprecated,begin\nfunction DeprecatedClass.CCMoveBy()\n    deprecatedTip(\"CCMoveBy\",\"cc.MoveBy\")\n    return cc.MoveBy\nend\n_G[\"CCMoveBy\"] = DeprecatedClass.CCMoveBy()\n--CCMoveBy class will be Deprecated,end\n\n--CCMotionStreak class will be Deprecated,begin\nfunction DeprecatedClass.CCMotionStreak()\n    deprecatedTip(\"CCMotionStreak\",\"cc.MotionStreak\")\n    return cc.MotionStreak\nend\n_G[\"CCMotionStreak\"] = DeprecatedClass.CCMotionStreak()\n--CCMotionStreak class will be Deprecated,end\n\n--CCRotateBy class will be Deprecated,begin\nfunction DeprecatedClass.CCRotateBy()\n    deprecatedTip(\"CCRotateBy\",\"cc.RotateBy\")\n    return cc.RotateBy\nend\n_G[\"CCRotateBy\"] = DeprecatedClass.CCRotateBy()\n--CCRotateBy class will be Deprecated,end\n\n--CCFileUtils class will be Deprecated,begin\nfunction DeprecatedClass.CCFileUtils()\n    deprecatedTip(\"CCFileUtils\",\"cc.FileUtils\")\n    return cc.FileUtils\nend\n_G[\"CCFileUtils\"] = DeprecatedClass.CCFileUtils()\n--CCFileUtils class will be Deprecated,end\n\n--CCBezierBy class will be Deprecated,begin\nfunction DeprecatedClass.CCBezierBy()\n    deprecatedTip(\"CCBezierBy\",\"cc.BezierBy\")\n    return cc.BezierBy\nend\n_G[\"CCBezierBy\"] = DeprecatedClass.CCBezierBy()\n--CCBezierBy class will be Deprecated,end\n\n--CCTransitionFade class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFade()\n    deprecatedTip(\"CCTransitionFade\",\"cc.TransitionFade\")\n    return cc.TransitionFade\nend\n_G[\"CCTransitionFade\"] = DeprecatedClass.CCTransitionFade()\n--CCTransitionFade class will be Deprecated,end\n\n--CCTransitionProgressOutIn class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressOutIn()\n    deprecatedTip(\"CCTransitionProgressOutIn\",\"cc.TransitionProgressOutIn\")\n    return cc.TransitionProgressOutIn\nend\n_G[\"CCTransitionProgressOutIn\"] = DeprecatedClass.CCTransitionProgressOutIn()\n--CCTransitionProgressOutIn class will be Deprecated,end\n\n--CCCatmullRomBy class will be Deprecated,begin\nfunction DeprecatedClass.CCCatmullRomBy()\n    deprecatedTip(\"CCCatmullRomBy\",\"cc.CatmullRomBy\")\n    return cc.CatmullRomBy\nend\n_G[\"CCCatmullRomBy\"] = DeprecatedClass.CCCatmullRomBy()\n--CCCatmullRomBy class will be Deprecated,end\n\n--CCGridAction class will be Deprecated,begin\nfunction DeprecatedClass.CCGridAction()\n    deprecatedTip(\"CCGridAction\",\"cc.GridAction\")\n    return cc.GridAction\nend\n_G[\"CCGridAction\"] = DeprecatedClass.CCGridAction()\n--CCGridAction class will be Deprecated,end\n\n--CCShaky3D class will be Deprecated,begin\nfunction DeprecatedClass.CCShaky3D()\n    deprecatedTip(\"CCShaky3D\",\"cc.Shaky3D\")\n    return cc.Shaky3D\nend\n_G[\"CCShaky3D\"] = DeprecatedClass.CCShaky3D()\n--CCShaky3D class will be Deprecated,end\n\n--CCTransitionEaseScene class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionEaseScene()\n    deprecatedTip(\"CCTransitionEaseScene\",\"cc.TransitionEaseScene\")\n    return cc.TransitionEaseScene\nend\n_G[\"CCTransitionEaseScene\"] = DeprecatedClass.CCTransitionEaseScene()\n--CCTransitionEaseScene class will be Deprecated,end\n\n--CCSequence class will be Deprecated,begin\nfunction DeprecatedClass.CCSequence()\n    deprecatedTip(\"CCSequence\",\"cc.Sequence\")\n    return cc.Sequence\nend\n_G[\"CCSequence\"] = DeprecatedClass.CCSequence()\n--CCSequence class will be Deprecated,end\n\n--CCTransitionFadeUp class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionFadeUp()\n    deprecatedTip(\"CCTransitionFadeUp\",\"cc.TransitionFadeUp\")\n    return cc.TransitionFadeUp\nend\n_G[\"CCTransitionFadeUp\"] = DeprecatedClass.CCTransitionFadeUp()\n--CCTransitionFadeUp class will be Deprecated,end\n\n--CCTransitionProgressRadialCW class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionProgressRadialCW()\n    deprecatedTip(\"CCTransitionProgressRadialCW\",\"cc.TransitionProgressRadialCW\")\n    return cc.TransitionProgressRadialCW\nend\n_G[\"CCTransitionProgressRadialCW\"] = DeprecatedClass.CCTransitionProgressRadialCW()\n--CCTransitionProgressRadialCW class will be Deprecated,end\n\n--CCShuffleTiles class will be Deprecated,begin\nfunction DeprecatedClass.CCShuffleTiles()\n    deprecatedTip(\"CCShuffleTiles\",\"cc.ShuffleTiles\")\n    return cc.ShuffleTiles\nend\n_G[\"CCShuffleTiles\"] = DeprecatedClass.CCShuffleTiles()\n--CCShuffleTiles class will be Deprecated,end\n\n--CCTransitionSlideInR class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInR()\n    deprecatedTip(\"CCTransitionSlideInR\",\"cc.TransitionSlideInR\")\n    return cc.TransitionSlideInR\nend\n_G[\"CCTransitionSlideInR\"] = DeprecatedClass.CCTransitionSlideInR()\n--CCTransitionSlideInR class will be Deprecated,end\n\n--CCScene class will be Deprecated,begin\nfunction DeprecatedClass.CCScene()\n    deprecatedTip(\"CCScene\",\"cc.Scene\")\n    return cc.Scene\nend\n_G[\"CCScene\"] = DeprecatedClass.CCScene()\n--CCScene class will be Deprecated,end\n\n--CCParallaxNode class will be Deprecated,begin\nfunction DeprecatedClass.CCParallaxNode()\n    deprecatedTip(\"CCParallaxNode\",\"cc.ParallaxNode\")\n    return cc.ParallaxNode\nend\n_G[\"CCParallaxNode\"] = DeprecatedClass.CCParallaxNode()\n--CCParallaxNode class will be Deprecated,end\n\n--CCTransitionSlideInL class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInL()\n    deprecatedTip(\"CCTransitionSlideInL\",\"cc.TransitionSlideInL\")\n    return cc.TransitionSlideInL\nend\n_G[\"CCTransitionSlideInL\"] = DeprecatedClass.CCTransitionSlideInL()\n--CCTransitionSlideInL class will be Deprecated,end\n\n--CCControlSwitch class will be Deprecated,begin\nfunction DeprecatedClass.CCControlSwitch()\n    deprecatedTip(\"CCControlSwitch\",\"cc.ControlSwitch\")\n    return cc.ControlSwitch\nend\n_G[\"CCControlSwitch\"] = DeprecatedClass.CCControlSwitch()\n--CCControlSwitch class will be Deprecated,end\n\n--CCWavesTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCWavesTiles3D()\n    deprecatedTip(\"CCWavesTiles3D\",\"cc.WavesTiles3D\")\n    return cc.WavesTiles3D\nend\n_G[\"CCWavesTiles3D\"] = DeprecatedClass.CCWavesTiles3D()\n--CCWavesTiles3D class will be Deprecated,end\n\n--CCTransitionSlideInB class will be Deprecated,begin\nfunction DeprecatedClass.CCTransitionSlideInB()\n    deprecatedTip(\"CCTransitionSlideInB\",\"cc.TransitionSlideInB\")\n    return cc.TransitionSlideInB\nend\n_G[\"CCTransitionSlideInB\"] = DeprecatedClass.CCTransitionSlideInB()\n--CCTransitionSlideInB class will be Deprecated,end\n\n--CCSpeed class will be Deprecated,begin\nfunction DeprecatedClass.CCSpeed()\n    deprecatedTip(\"CCSpeed\",\"cc.Speed\")\n    return cc.Speed\nend\n_G[\"CCSpeed\"] = DeprecatedClass.CCSpeed()\n--CCSpeed class will be Deprecated,end\n\n--CCShatteredTiles3D class will be Deprecated,begin\nfunction DeprecatedClass.CCShatteredTiles3D()\n    deprecatedTip(\"CCShatteredTiles3D\",\"cc.ShatteredTiles3D\")\n    return cc.ShatteredTiles3D\nend\n_G[\"CCShatteredTiles3D\"] = DeprecatedClass.CCShatteredTiles3D()\n--CCShatteredTiles3D class will be Deprecated,end\n\n--CCCallFuncN class will be Deprecated,begin\nfunction DeprecatedClass.CCCallFuncN()\n    deprecatedTip(\"CCCallFuncN\",\"cc.CallFunc\")\n    return cc.CallFunc\nend\n_G[\"CCCallFuncN\"] = DeprecatedClass.CCCallFuncN()\n--CCCallFuncN class will be Deprecated,end\n\n--CCArmature class will be Deprecated,begin\nfunction DeprecatedClass.CCArmature()\n    deprecatedTip(\"CCArmature\",\"ccs.Armature\")\n    return ccs.Armature\nend\n_G[\"CCArmature\"] = DeprecatedClass.CCArmature()\n--CCArmature class will be Deprecated,end\n\n--CCArmatureAnimation class will be Deprecated,begin\nfunction DeprecatedClass.CCArmatureAnimation()\n    deprecatedTip(\"CCArmatureAnimation\",\"ccs.ArmatureAnimation\")\n    return ccs.ArmatureAnimation\nend\n_G[\"CCArmatureAnimation\"] = DeprecatedClass.CCArmatureAnimation()\n--CCArmatureAnimation class will be Deprecated,end\n\n--CCSkin class will be Deprecated,begin\nfunction DeprecatedClass.CCSkin()\n    deprecatedTip(\"CCSkin\",\"ccs.Skin\")\n    return ccs.Skin\nend\n_G[\"CCSkin\"] = DeprecatedClass.CCSkin()\n--CCSkin class will be Deprecated,end\n\n--CCBone class will be Deprecated,begin\nfunction DeprecatedClass.CCBone()\n    deprecatedTip(\"CCBone\",\"ccs.Bone\")\n    return ccs.Bone\nend\n_G[\"CCBone\"] = DeprecatedClass.CCBone()\n--CCBone class will be Deprecated,end\n\n--CCArmatureDataManager class will be Deprecated,begin\nfunction DeprecatedClass.CCArmatureDataManager()\n    deprecatedTip(\"CCArmatureDataManager\",\"ccs.ArmatureDataManager\")\n    return ccs.ArmatureDataManager\nend\n_G[\"CCArmatureDataManager\"] = DeprecatedClass.CCArmatureDataManager()\n--CCArmatureDataManager class will be Deprecated,end\n\n--CCBatchNode class will be Deprecated,begin\nfunction DeprecatedClass.CCBatchNode()\n    deprecatedTip(\"CCBatchNode\",\"ccs.BatchNode\")\n    return ccs.BatchNode\nend\n_G[\"CCBatchNode\"] = DeprecatedClass.CCBatchNode()\n--CCBatchNode class will be Deprecated,end\n\n--CCTween class will be Deprecated,begin\nfunction DeprecatedClass.CCTween()\n    deprecatedTip(\"CCTween\",\"ccs.Tween\")\n    return ccs.Tween\nend\n_G[\"CCTween\"] = DeprecatedClass.CCTween()\n--CCTween class will be Deprecated,end\n\n--CCBaseData class will be Deprecated,begin\nfunction DeprecatedClass.CCBaseData()\n    deprecatedTip(\"CCBaseData\",\"ccs.BaseData\")\n    return ccs.BaseData\nend\n_G[\"CCBaseData\"] = DeprecatedClass.CCBaseData()\n--CCBaseData class will be Deprecated,end\n\n--CCDisplayManager class will be Deprecated,begin\nfunction DeprecatedClass.CCDisplayManager()\n    deprecatedTip(\"CCDisplayManager\",\"ccs.DisplayManager\")\n    return ccs.DisplayManager\nend\n_G[\"CCDisplayManager\"] = DeprecatedClass.CCDisplayManager()\n--CCDisplayManager class will be Deprecated,end\n\n--UIHelper class will be Deprecated,begin\nfunction DeprecatedClass.UIHelper()\n    deprecatedTip(\"UIHelper\",\"ccs.UIHelper\")\n    return ccs.UIHelper\nend\n_G[\"UIHelper\"] = DeprecatedClass.UIHelper()\n--UIHelper class will be Deprecated,end\n\n--UILayout class will be Deprecated,begin\nfunction DeprecatedClass.UILayout()\n    deprecatedTip(\"UILayout\",\"ccs.UILayout\")\n    return ccs.UILayout\nend\n_G[\"UILayout\"] = DeprecatedClass.UILayout()\n--UILayout class will be Deprecated,end\n\n--UIWidget class will be Deprecated,begin\nfunction DeprecatedClass.UIWidget()\n    deprecatedTip(\"UIWidget\",\"ccs.UIWidget\")\n    return ccs.UIWidget\nend\n_G[\"UIWidget\"] = DeprecatedClass.UIWidget()\n--UIWidget class will be Deprecated,end\n\n--UILayer class will be Deprecated,begin\nfunction DeprecatedClass.UILayer()\n    deprecatedTip(\"UILayer\",\"ccs.UILayer\")\n    return ccs.UILayer\nend\n_G[\"UILayer\"] = DeprecatedClass.UILayer()\n--UILayer class will be Deprecated,end\n\n--UIButton class will be Deprecated,begin\nfunction DeprecatedClass.UIButton()\n    deprecatedTip(\"UIButton\",\"ccs.UIButton\")\n    return ccs.UIButton\nend\n_G[\"UIButton\"] = DeprecatedClass.UIButton()\n--UIButton class will be Deprecated,end\n\n--UICheckBox class will be Deprecated,begin\nfunction DeprecatedClass.UICheckBox()\n    deprecatedTip(\"UICheckBox\",\"ccs.UICheckBox\")\n    return ccs.UICheckBox\nend\n_G[\"UICheckBox\"] = DeprecatedClass.UICheckBox()\n--UICheckBox class will be Deprecated,end\n\n--UIImageView class will be Deprecated,begin\nfunction DeprecatedClass.UIImageView()\n    deprecatedTip(\"UIImageView\",\"ccs.UIImageView\")\n    return ccs.UIImageView\nend\n_G[\"UIImageView\"] = DeprecatedClass.UIImageView()\n--UIImageView class will be Deprecated,end\n\n--UILabel class will be Deprecated,begin\nfunction DeprecatedClass.UILabel()\n    deprecatedTip(\"UILabel\",\"ccs.UILabel\")\n    return ccs.UILabel\nend\n_G[\"UILabel\"] = DeprecatedClass.UILabel()\n--UILabel class will be Deprecated,end\n\n--UILabelAtlas class will be Deprecated,begin\nfunction DeprecatedClass.UILabelAtlas()\n    deprecatedTip(\"UILabelAtlas\",\"ccs.UILabelAtlas\")\n    return ccs.UILabelAtlas\nend\n_G[\"UILabelAtlas\"] = DeprecatedClass.UILabelAtlas()\n--UILabelAtlas class will be Deprecated,end\n\n--UILabelBMFont class will be Deprecated,begin\nfunction DeprecatedClass.UILabelBMFont()\n    deprecatedTip(\"UILabelBMFont\",\"ccs.UILabelBMFont\")\n    return ccs.UILabelBMFont\nend\n_G[\"UILabelBMFont\"] = DeprecatedClass.UILabelBMFont()\n--UILabelBMFont class will be Deprecated,end\n\n--UILoadingBar class will be Deprecated,begin\nfunction DeprecatedClass.UILoadingBar()\n    deprecatedTip(\"UILoadingBar\",\"ccs.UILoadingBar\")\n    return ccs.UILoadingBar\nend\n_G[\"UILoadingBar\"] = DeprecatedClass.UILoadingBar()\n--UILoadingBar class will be Deprecated,end\n\n--UISlider class will be Deprecated,begin\nfunction DeprecatedClass.UISlider()\n    deprecatedTip(\"UISlider\",\"ccs.UISlider\")\n    return ccs.UISlider\nend\n_G[\"UISlider\"] = DeprecatedClass.UISlider()\n--UISlider class will be Deprecated,end\n\n--UITextField class will be Deprecated,begin\nfunction DeprecatedClass.UITextField()\n    deprecatedTip(\"UITextField\",\"ccs.UITextField\")\n    return ccs.UITextField\nend\n_G[\"UITextField\"] = DeprecatedClass.UITextField()\n--UITextField class will be Deprecated,end\n\n--UIScrollView class will be Deprecated,begin\nfunction DeprecatedClass.UIScrollView()\n    deprecatedTip(\"UIScrollView\",\"ccs.UIScrollView\")\n    return ccs.UIScrollView\nend\n_G[\"UIScrollView\"] = DeprecatedClass.UIScrollView()\n--UIScrollView class will be Deprecated,end\n\n--UIPageView class will be Deprecated,begin\nfunction DeprecatedClass.UIPageView()\n    deprecatedTip(\"UIPageView\",\"ccs.UIPageView\")\n    return ccs.UIPageView\nend\n_G[\"UIPageView\"] = DeprecatedClass.UIPageView()\n--UIPageView class will be Deprecated,end\n\n--UIListView class will be Deprecated,begin\nfunction DeprecatedClass.UIListView()\n    deprecatedTip(\"UIListView\",\"ccs.UIListView\")\n    return ccs.UIListView\nend\n_G[\"UIListView\"] = DeprecatedClass.UIListView()\n--UIListView class will be Deprecated,end\n\n--UILayoutParameter class will be Deprecated,begin\nfunction DeprecatedClass.UILayoutParameter()\n    deprecatedTip(\"UILayoutParameter\",\"ccs.UILayoutParameter\")\n    return ccs.UILayoutParameter\nend\n_G[\"UILayoutParameter\"] = DeprecatedClass.UILayoutParameter()\n--UILayoutParameter class will be Deprecated,end\n\n--UILinearLayoutParameter class will be Deprecated,begin\nfunction DeprecatedClass.UILinearLayoutParameter()\n    deprecatedTip(\"UILinearLayoutParameter\",\"ccs.UILinearLayoutParameter\")\n    return ccs.UILinearLayoutParameter\nend\n_G[\"UILinearLayoutParameter\"] = DeprecatedClass.UILinearLayoutParameter()\n--UILinearLayoutParameter class will be Deprecated,end\n\n--UIRelativeLayoutParameter class will be Deprecated,begin\nfunction DeprecatedClass.UIRelativeLayoutParameter()\n    deprecatedTip(\"UIRelativeLayoutParameter\",\"ccs.UIRelativeLayoutParameter\")\n    return ccs.UIRelativeLayoutParameter\nend\n_G[\"UIRelativeLayoutParameter\"] = DeprecatedClass.UIRelativeLayoutParameter()\n--UIRelativeLayoutParameter class will be Deprecated,end\n\n--CCComController class will be Deprecated,begin\nfunction DeprecatedClass.CCComController()\n    deprecatedTip(\"CCComController\",\"ccs.ComController\")\n    return ccs.CCComController\nend\n_G[\"CCComController\"] = DeprecatedClass.CCComController()\n--CCComController class will be Deprecated,end\n\n--CCComAudio class will be Deprecated,begin\nfunction DeprecatedClass.CCComAudio()\n    deprecatedTip(\"CCComAudio\",\"ccs.ComAudio\")\n    return ccs.ComAudio\nend\n_G[\"CCComAudio\"] = DeprecatedClass.CCComAudio()\n--CCComAudio class will be Deprecated,end\n\n--CCComAttribute class will be Deprecated,begin\nfunction DeprecatedClass.CCComAttribute()\n    deprecatedTip(\"CCComAttribute\",\"ccs.ComAttribute\")\n    return ccs.ComAttribute\nend\n_G[\"CCComAttribute\"] = DeprecatedClass.CCComAttribute()\n--CCComAttribute class will be Deprecated,end\n\n--CCComRender class will be Deprecated,begin\nfunction DeprecatedClass.CCComRender()\n    deprecatedTip(\"CCComRender\",\"ccs.ComRender\")\n    return ccs.ComRender\nend\n_G[\"CCComRender\"] = DeprecatedClass.CCComRender()\n--CCComRender class will be Deprecated,end\n\n--ActionManager class will be Deprecated,begin\nfunction DeprecatedClass.ActionManager()\n    deprecatedTip(\"ActionManager\",\"ccs.ActionManagerEx\")\n    return ccs.ActionManagerEx\nend\n_G[\"ActionManager\"] = DeprecatedClass.ActionManager()\n--CCComRender class will be Deprecated,end\n\n--SceneReader class will be Deprecated,begin\nfunction DeprecatedClass.SceneReader()\n    deprecatedTip(\"SceneReader\",\"ccs.SceneReader\")\n    return ccs.SceneReader\nend\n_G[\"SceneReader\"] = DeprecatedClass.SceneReader()\n--SceneReader class will be Deprecated,end\n\n--GUIReader class will be Deprecated,begin\nfunction DeprecatedClass.GUIReader()\n    deprecatedTip(\"GUIReader\",\"ccs.GUIReader\")\n    return ccs.GUIReader\nend\n_G[\"GUIReader\"] = DeprecatedClass.GUIReader()\n--GUIReader class will be Deprecated,end\n\n--UIRootWidget class will be Deprecated,begin\nfunction DeprecatedClass.UIRootWidget()\n    deprecatedTip(\"UIRootWidget\",\"ccs.UIRootWidget\")\n    return ccs.UIRootWidget\nend\n_G[\"UIRootWidget\"] = DeprecatedClass.UIRootWidget()\n--UIRootWidget class will be Deprecated,end\n\n--ActionObject class will be Deprecated,begin\nfunction DeprecatedClass.ActionObject()\n    deprecatedTip(\"ActionObject\",\"ccs.ActionObject\")\n    return ccs.ActionObject\nend\n_G[\"ActionObject\"] = DeprecatedClass.ActionObject()\n--ActionObject class will be Deprecated,end\n\n--CCEGLViewProtocol class will be Deprecated,begin\nfunction DeprecatedClass.CCEGLViewProtocol()\n    deprecatedTip(\"CCEGLViewProtocol\",\"cc.EGLViewProtocol\")\n    return cc.EGLViewProtocol\nend\n_G[\"CCEGLViewProtocol\"] = DeprecatedClass.CCEGLViewProtocol()\n--CCEGLViewProtocol class will be Deprecated,end\n\n--CCEGLView class will be Deprecated,begin\nfunction DeprecatedClass.CCEGLView()\n    deprecatedTip(\"CCEGLView\",\"cc.EGLView\")\n    return cc.EGLView\nend\n_G[\"CCEGLView\"] = DeprecatedClass.CCEGLView()\n--CCEGLView class will be Deprecated,end\n\n--CCBProxy class will be Deprecated,begin\nfunction DeprecatedClass.CCBProxy()\n    deprecatedTip(\"CCBProxy\",\"cc.CCBProxy\")\n    return cc.CCBProxy\nend\n_G[\"CCBProxy\"] = DeprecatedClass.CCBProxy()\n--CCBProxy class will be Deprecated,end\n\n--WebSocket class will be Deprecated,begin\nfunction DeprecatedClass.WebSocket()\n    deprecatedTip(\"WebSocket\",\"cc.WebSocket\")\n    return cc.WebSocket\nend\n_G[\"WebSocket\"] = DeprecatedClass.WebSocket()\n--WebSocket class will be Deprecated,end\n\n--XMLHttpRequest class will be Deprecated,begin\nfunction DeprecatedClass.XMLHttpRequest()\n    deprecatedTip(\"XMLHttpRequest\",\"cc.XMLHttpRequest\")\n    return cc.XMLHttpRequest\nend\n_G[\"XMLHttpRequest\"] = DeprecatedClass.XMLHttpRequest()\n--XMLHttpRequest class will be Deprecated,end\n\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/DeprecatedEnum.lua",
    "content": "require \"Cocos2dConstants.lua\"\nrequire \"OpenglConstants.lua\"\nrequire \"StudioConstants.lua\"\n--Enums will be deprecated,begin\n_G.kCCTextAlignmentLeft              = cc.TEXT_ALIGNMENT_LEFT\n_G.kCCTextAlignmentRight             = cc.TEXT_ALIGNMENT_RIGHT\n_G.kCCTextAlignmentCenter            = cc.TEXT_ALIGNMENT_CENTER\n_G.kCCVerticalTextAlignmentTop       = cc.VERTICAL_TEXT_ALIGNMENT_TOP\n_G.kCCVerticalTextAlignmentCenter    = cc.VERTICAL_TEXT_ALIGNMENT_CENTER    \n_G.kCCVerticalTextAlignmentBottom    = cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM\n_G.kCCDirectorProjection3D           = cc.DIRECTOR_PROJECTION3_D \n_G.kCCDirectorProjection2D           = cc.DIRECTOR_PROJECTION2_D\n_G.kCCDirectorProjectionCustom       = cc.DIRECTOR_PROJECTION_CUSTOM\n_G.kCCDirectorProjectionDefault      = cc.DIRECTOR_PROJECTION_DEFAULT\n_G.kCCNodeTagInvalid                 = cc.NODE_TAG_INVALID\n_G.kCCNodeOnEnter                    = cc.NODE_ON_ENTER\n_G.kCCNodeOnExit                     = cc.NODE_ON_EXIT\n_G.kCCTexture2DPixelFormat_RGBA8888  = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A8888\n_G.kCCTexture2DPixelFormat_RGB888    = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B888\n_G.kCCTexture2DPixelFormat_RGB565    = cc.TEXTURE2_D_PIXEL_FORMAT_RG_B565\n_G.kCCTexture2DPixelFormat_A8        = cc.TEXTURE2_D_PIXEL_FORMAT_A8\n_G.kCCTexture2DPixelFormat_I8        = cc.TEXTURE2_D_PIXEL_FORMAT_I8 \n_G.kCCTexture2DPixelFormat_AI88      = cc.TEXTURE2_D_PIXEL_FORMAT_A_I88\n_G.kCCTexture2DPixelFormat_RGBA4444  = cc.TEXTURE2_D_PIXEL_FORMAT_RGB_A4444 \n_G.kCCTexture2DPixelFormat_RGB5A1    = cc.TEXTURE2_D_PIXEL_FORMAT_RGB5_A1 \n_G.kCCTexture2DPixelFormat_PVRTC4    = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC4\n_G.kCCTexture2DPixelFormat_PVRTC2    = cc.TEXTURE2_D_PIXEL_FORMAT_PVRTC2\n_G.kCCTexture2DPixelFormat_Default   = cc.TEXTURE2_D_PIXEL_FORMAT_DEFAULT\n_G.kCCImageFormatPNG                 = cc.IMAGE_FORMAT_PNG \n_G.kCCImageFormatJPEG                = cc.IMAGE_FORMAT_JPEG\n_G.kCCTouchesOneByOne                = cc.TOUCHES_ONE_BY_ONE\n_G.kCCTouchesAllAtOnce               = cc.TOUCHES_ALL_AT_ONCE\n_G.kCCTransitionOrientationLeftOver  = cc.TRANSITION_ORIENTATION_LEFT_OVER\n_G.kCCTransitionOrientationRightOver = cc.TRANSITION_ORIENTATION_RIGHT_OVER\n_G.kCCTransitionOrientationUpOver    = cc.TRANSITION_ORIENTATION_UP_OVER\n_G.kCCTransitionOrientationDownOver  = cc.TRANSITION_ORIENTATION_DOWN_OVER\n_G.kCCActionTagInvalid               = cc.ACTION_TAG_INVALID\n_G.kCCLabelAutomaticWidth            = cc.LABEL_AUTOMATIC_WIDTH\n_G.kCCMenuStateWaiting               = cc.MENU_STATE_WAITING \n_G.kCCMenuStateTrackingTouch         = cc.MENU_STATE_TRACKING_TOUCH\n_G.kCCMenuHandlerPriority            = cc.MENU_HANDLER_PRIORITY\n_G.kCCParticleDurationInfinity       = cc.PARTICLE_DURATION_INFINITY \n_G.kCCParticleStartSizeEqualToEndSize = cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE \n_G.kCCParticleStartRadiusEqualToEndRadius = cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS\n_G.kCCParticleModeGravity            = cc.PARTICLE_MODE_GRAVITY\n_G.kCCParticleModeRadius             = cc.PARTICLE_MODE_RADIUS\n_G.kCCPositionTypeFree               = cc.POSITION_TYPE_FREE \n_G.kCCPositionTypeRelative           = cc.POSITION_TYPE_RELATIVE\n_G.kCCPositionTypeGrouped            = cc.POSITION_TYPE_GROUPED\n_G.kCCProgressTimerTypeRadial        = cc.PROGRESS_TIMER_TYPE_RADIAL \n_G.kCCProgressTimerTypeBar           = cc.PROGRESS_TIMER_TYPE_BAR\n_G.kCCTMXTileHorizontalFlag          = cc.TMX_TILE_HORIZONTAL_FLAG\n_G.kCCTMXTileVerticalFlag            = cc.TMX_TILE_VERTICAL_FLAG\n_G.kCCTMXTileDiagonalFlag            = cc.TMX_TILE_DIAGONAL_FLAG\n_G.kCCFlipedAll                      = cc.FLIPED_ALL\n_G.kCCFlippedMask                    = cc.FLIPPED_MASK\n_G.kCCControlStepperPartMinus        = cc.CONTROL_STEPPER_PART_MINUS\n_G.kCCControlStepperPartPlus         = cc.CONTROL_STEPPER_PART_PLUS\n_G.kCCControlStepperPartNone         = cc.CONTROL_STEPPER_PART_NONE\n\n_G.kLanguageEnglish  = cc.LANGUAGE_ENGLISH \n_G.kLanguageChinese  = cc.LANGUAGE_CHINESE \n_G.kLanguageFrench   = cc.LANGUAGE_FRENCH \n_G.kLanguageItalian  = cc.LANGUAGE_ITALIAN\n_G.kLanguageGerman   = cc.LANGUAGE_GERMAN\n_G.kLanguageSpanish  = cc.LANGUAGE_SPANISH\n_G.kLanguageRussian  = cc.LANGUAGE_RUSSIAN\n_G.kLanguageKorean   = cc.LANGUAGE_KOREAN\n_G.kLanguageJapanese = cc.LANGUAGE_JAPANESE\n_G.kLanguageHungarian = cc.LANGUAGE_HUNGARIAN\n_G.kLanguagePortuguese = cc.LANGUAGE_PORTUGUESE\n_G.kLanguageArabic     = cc.LANGUAGE_ARABIC\n_G.kTargetWindows      = cc.PLATFORM_OS_WINDOWS\n_G.kTargetLinux        = cc.PLATFORM_OS_LINUX \n_G.kTargetMacOS        = cc.PLATFORM_OS_MAC\n_G.kTargetAndroid      = cc.PLATFORM_OS_ANDROID\n_G.kTargetIphone       = cc.PLATFORM_OS_IPHONE\n_G.kTargetIpad         = cc.PLATFORM_OS_IPAD \n_G.kTargetBlackBerry   = cc.PLATFORM_OS_BLACKBERRY\n\n_G.GL_ZERO                           = gl.ZERO\n_G.GL_ONE                            = gl.ONE\n_G.GL_SRC_COLOR                      = gl.SRC_COLOR\n_G.GL_ONE_MINUS_SRC_COLOR            = gl.ONE_MINUS_SRC_COLOR \n_G.GL_SRC_ALPHA                      = gl.SRC_ALPHA \n_G.GL_ONE_MINUS_SRC_ALPHA            = gl.ONE_MINUS_SRC_ALPHA\n_G.GL_DST_ALPHA                      = gl.DST_ALPHA\n_G.GL_ONE_MINUS_DST_ALPHA            = gl.ONE_MINUS_DST_ALPHA \n_G.GL_DST_COLOR                      = gl.DST_COLOR\n_G.GL_ONE_MINUS_DST_COLOR            = gl.ONE_MINUS_DST_COLOR\n_G.GL_RENDERBUFFER_INTERNAL_FORMAT = gl.RENDERBUFFER_INTERNAL_FORMAT\n_G.GL_LINE_WIDTH = gl.LINE_WIDTH\n_G.GL_CONSTANT_ALPHA = gl.CONSTANT_ALPHA\n_G.GL_BLEND_SRC_ALPHA = gl.BLEND_SRC_ALPHA\n_G.GL_GREEN_BITS = gl.GREEN_BITS\n_G.GL_STENCIL_REF = gl.STENCIL_REF\n_G.GL_ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\n_G.GL_CCW = gl.CCW\n_G.GL_MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS\n_G.GL_BACK = gl.BACK\n_G.GL_ACTIVE_ATTRIBUTES = gl.ACTIVE_ATTRIBUTES\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_X = gl.TEXTURE_CUBE_MAP_POSITIVE_X\n_G.GL_STENCIL_BACK_VALUE_MASK = gl.STENCIL_BACK_VALUE_MASK\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Z = gl.TEXTURE_CUBE_MAP_POSITIVE_Z\n_G.GL_ONE = gl.ONE\n_G.GL_TRUE = gl.TRUE\n_G.GL_TEXTURE12 = gl.TEXTURE12\n_G.GL_LINK_STATUS = gl.LINK_STATUS\n_G.GL_BLEND = gl.BLEND\n_G.GL_LESS = gl.LESS\n_G.GL_TEXTURE16 = gl.TEXTURE16\n_G.GL_BOOL_VEC2 = gl.BOOL_VEC2\n_G.GL_KEEP = gl.KEEP\n_G.GL_DST_COLOR = gl.DST_COLOR\n_G.GL_VERTEX_ATTRIB_ARRAY_ENABLED = gl.VERTEX_ATTRIB_ARRAY_ENABLED\n_G.GL_EXTENSIONS = gl.EXTENSIONS\n_G.GL_FRONT = gl.FRONT\n_G.GL_DST_ALPHA = gl.DST_ALPHA\n_G.GL_ATTACHED_SHADERS = gl.ATTACHED_SHADERS\n_G.GL_STENCIL_BACK_FUNC = gl.STENCIL_BACK_FUNC\n_G.GL_ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR\n_G.GL_BLEND_EQUATION = gl.BLEND_EQUATION\n_G.GL_RENDERBUFFER_DEPTH_SIZE = gl.RENDERBUFFER_DEPTH_SIZE\n_G.GL_PACK_ALIGNMENT = gl.PACK_ALIGNMENT\n_G.GL_VENDOR = gl.VENDOR\n_G.GL_NEAREST_MIPMAP_LINEAR = gl.NEAREST_MIPMAP_LINEAR\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Y = gl.TEXTURE_CUBE_MAP_POSITIVE_Y\n_G.GL_NEAREST = gl.NEAREST\n_G.GL_RENDERBUFFER_WIDTH = gl.RENDERBUFFER_WIDTH\n_G.GL_ARRAY_BUFFER_BINDING = gl.ARRAY_BUFFER_BINDING\n_G.GL_ARRAY_BUFFER = gl.ARRAY_BUFFER\n_G.GL_LEQUAL = gl.LEQUAL\n_G.GL_VERSION = gl.VERSION\n_G.GL_COLOR_CLEAR_VALUE = gl.COLOR_CLEAR_VALUE\n_G.GL_RENDERER = gl.RENDERER\n_G.GL_STENCIL_BACK_PASS_DEPTH_PASS = gl.STENCIL_BACK_PASS_DEPTH_PASS\n_G.GL_STENCIL_BACK_PASS_DEPTH_FAIL = gl.STENCIL_BACK_PASS_DEPTH_FAIL\n_G.GL_STENCIL_BACK_WRITEMASK = gl.STENCIL_BACK_WRITEMASK\n_G.GL_BOOL = gl.BOOL\n_G.GL_VIEWPORT = gl.VIEWPORT\n_G.GL_FRAGMENT_SHADER = gl.FRAGMENT_SHADER\n_G.GL_LUMINANCE = gl.LUMINANCE\n_G.GL_DECR_WRAP = gl.DECR_WRAP\n_G.GL_FUNC_ADD = gl.FUNC_ADD\n_G.GL_ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA\n_G.GL_OUT_OF_MEMORY = gl.OUT_OF_MEMORY\n_G.GL_BOOL_VEC4 = gl.BOOL_VEC4\n_G.GL_POLYGON_OFFSET_FACTOR = gl.POLYGON_OFFSET_FACTOR\n_G.GL_STATIC_DRAW = gl.STATIC_DRAW\n_G.GL_DITHER = gl.DITHER\n_G.GL_TEXTURE31 = gl.TEXTURE31\n_G.GL_TEXTURE30 = gl.TEXTURE30\n_G.GL_UNSIGNED_BYTE = gl.UNSIGNED_BYTE\n_G.GL_DEPTH_COMPONENT16 = gl.DEPTH_COMPONENT16\n_G.GL_TEXTURE23 = gl.TEXTURE23\n_G.GL_DEPTH_TEST = gl.DEPTH_TEST\n_G.GL_STENCIL_PASS_DEPTH_FAIL = gl.STENCIL_PASS_DEPTH_FAIL\n_G.GL_BOOL_VEC3 = gl.BOOL_VEC3\n_G.GL_POLYGON_OFFSET_UNITS = gl.POLYGON_OFFSET_UNITS\n_G.GL_TEXTURE_BINDING_2D = gl.TEXTURE_BINDING_2D\n_G.GL_TEXTURE21 = gl.TEXTURE21\n_G.GL_UNPACK_ALIGNMENT = gl.UNPACK_ALIGNMENT\n_G.GL_DONT_CARE = gl.DONT_CARE\n_G.GL_BUFFER_SIZE = gl.BUFFER_SIZE\n_G.GL_FLOAT_MAT3 = gl.FLOAT_MAT3\n_G.GL_UNSIGNED_SHORT_5_6_5 = gl.UNSIGNED_SHORT_5_6_5\n_G.GL_INT_VEC2 = gl.INT_VEC2\n_G.GL_UNSIGNED_SHORT_4_4_4_4 = gl.UNSIGNED_SHORT_4_4_4_4\n_G.GL_NONE = gl.NONE\n_G.GL_BLEND_DST_ALPHA = gl.BLEND_DST_ALPHA\n_G.GL_VERTEX_ATTRIB_ARRAY_SIZE = gl.VERTEX_ATTRIB_ARRAY_SIZE\n_G.GL_SRC_COLOR = gl.SRC_COLOR\n_G.GL_COMPRESSED_TEXTURE_FORMATS = gl.COMPRESSED_TEXTURE_FORMATS\n_G.GL_STENCIL_ATTACHMENT = gl.STENCIL_ATTACHMENT\n_G.GL_MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS\n_G.GL_NUM_COMPRESSED_TEXTURE_FORMATS = gl.NUM_COMPRESSED_TEXTURE_FORMATS\n_G.GL_BLEND_EQUATION_RGB = gl.BLEND_EQUATION_RGB\n_G.GL_TEXTURE = gl.TEXTURE\n_G.GL_LINEAR_MIPMAP_LINEAR = gl.LINEAR_MIPMAP_LINEAR\n_G.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\n_G.GL_CURRENT_PROGRAM = gl.CURRENT_PROGRAM\n_G.GL_COLOR_BUFFER_BIT = gl.COLOR_BUFFER_BIT\n_G.GL_TEXTURE20 = gl.TEXTURE20\n_G.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = gl.ACTIVE_ATTRIBUTE_MAX_LENGTH\n_G.GL_TEXTURE28 = gl.TEXTURE28\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\n_G.GL_TEXTURE22 = gl.TEXTURE22\n_G.GL_ELEMENT_ARRAY_BUFFER_BINDING = gl.ELEMENT_ARRAY_BUFFER_BINDING\n_G.GL_STREAM_DRAW = gl.STREAM_DRAW\n_G.GL_SCISSOR_BOX = gl.SCISSOR_BOX\n_G.GL_TEXTURE26 = gl.TEXTURE26\n_G.GL_TEXTURE27 = gl.TEXTURE27\n_G.GL_TEXTURE24 = gl.TEXTURE24\n_G.GL_TEXTURE25 = gl.TEXTURE25\n_G.GL_NO_ERROR = gl.NO_ERROR\n_G.GL_TEXTURE29 = gl.TEXTURE29\n_G.GL_FLOAT_MAT4 = gl.FLOAT_MAT4\n_G.GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = gl.VERTEX_ATTRIB_ARRAY_NORMALIZED\n_G.GL_SAMPLE_COVERAGE_INVERT = gl.SAMPLE_COVERAGE_INVERT\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\n_G.GL_FLOAT_VEC3 = gl.FLOAT_VEC3\n_G.GL_STENCIL_CLEAR_VALUE = gl.STENCIL_CLEAR_VALUE\n_G.GL_UNSIGNED_SHORT_5_5_5_1 = gl.UNSIGNED_SHORT_5_5_5_1\n_G.GL_ACTIVE_UNIFORMS = gl.ACTIVE_UNIFORMS\n_G.GL_INVALID_OPERATION = gl.INVALID_OPERATION\n_G.GL_DEPTH_ATTACHMENT = gl.DEPTH_ATTACHMENT\n_G.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS\n_G.GL_FRAMEBUFFER_COMPLETE = gl.FRAMEBUFFER_COMPLETE\n_G.GL_ONE_MINUS_CONSTANT_COLOR = gl.ONE_MINUS_CONSTANT_COLOR\n_G.GL_TEXTURE2 = gl.TEXTURE2\n_G.GL_TEXTURE1 = gl.TEXTURE1\n_G.GL_GEQUAL = gl.GEQUAL\n_G.GL_TEXTURE7 = gl.TEXTURE7\n_G.GL_TEXTURE6 = gl.TEXTURE6\n_G.GL_TEXTURE5 = gl.TEXTURE5\n_G.GL_TEXTURE4 = gl.TEXTURE4\n_G.GL_GENERATE_MIPMAP_HINT = gl.GENERATE_MIPMAP_HINT\n_G.GL_ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR\n_G.GL_TEXTURE9 = gl.TEXTURE9\n_G.GL_STENCIL_TEST = gl.STENCIL_TEST\n_G.GL_COLOR_WRITEMASK = gl.COLOR_WRITEMASK\n_G.GL_DEPTH_COMPONENT = gl.DEPTH_COMPONENT\n_G.GL_STENCIL_INDEX8 = gl.STENCIL_INDEX8\n_G.GL_VERTEX_ATTRIB_ARRAY_TYPE = gl.VERTEX_ATTRIB_ARRAY_TYPE\n_G.GL_FLOAT_VEC2 = gl.FLOAT_VEC2\n_G.GL_BLUE_BITS = gl.BLUE_BITS\n_G.GL_VERTEX_SHADER = gl.VERTEX_SHADER\n_G.GL_SUBPIXEL_BITS = gl.SUBPIXEL_BITS\n_G.GL_STENCIL_WRITEMASK = gl.STENCIL_WRITEMASK\n_G.GL_FLOAT_VEC4 = gl.FLOAT_VEC4\n_G.GL_TEXTURE17 = gl.TEXTURE17\n_G.GL_ONE_MINUS_CONSTANT_ALPHA = gl.ONE_MINUS_CONSTANT_ALPHA\n_G.GL_TEXTURE15 = gl.TEXTURE15\n_G.GL_TEXTURE14 = gl.TEXTURE14\n_G.GL_TEXTURE13 = gl.TEXTURE13\n_G.GL_SAMPLES = gl.SAMPLES\n_G.GL_TEXTURE11 = gl.TEXTURE11\n_G.GL_TEXTURE10 = gl.TEXTURE10\n_G.GL_FUNC_SUBTRACT = gl.FUNC_SUBTRACT\n_G.GL_STENCIL_BUFFER_BIT = gl.STENCIL_BUFFER_BIT\n_G.GL_TEXTURE19 = gl.TEXTURE19\n_G.GL_TEXTURE18 = gl.TEXTURE18\n_G.GL_NEAREST_MIPMAP_NEAREST = gl.NEAREST_MIPMAP_NEAREST\n_G.GL_SHORT = gl.SHORT\n_G.GL_RENDERBUFFER_BINDING = gl.RENDERBUFFER_BINDING\n_G.GL_REPEAT = gl.REPEAT\n_G.GL_TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER\n_G.GL_RED_BITS = gl.RED_BITS\n_G.GL_FRONT_FACE = gl.FRONT_FACE\n_G.GL_BLEND_COLOR = gl.BLEND_COLOR\n_G.GL_MIRRORED_REPEAT = gl.MIRRORED_REPEAT\n_G.GL_INT_VEC4 = gl.INT_VEC4\n_G.GL_MAX_CUBE_MAP_TEXTURE_SIZE = gl.MAX_CUBE_MAP_TEXTURE_SIZE\n_G.GL_RENDERBUFFER_BLUE_SIZE = gl.RENDERBUFFER_BLUE_SIZE\n_G.GL_SAMPLE_COVERAGE = gl.SAMPLE_COVERAGE\n_G.GL_SRC_ALPHA = gl.SRC_ALPHA\n_G.GL_FUNC_REVERSE_SUBTRACT = gl.FUNC_REVERSE_SUBTRACT\n_G.GL_DEPTH_WRITEMASK = gl.DEPTH_WRITEMASK\n_G.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT\n_G.GL_POLYGON_OFFSET_FILL = gl.POLYGON_OFFSET_FILL\n_G.GL_STENCIL_FUNC = gl.STENCIL_FUNC\n_G.GL_REPLACE = gl.REPLACE\n_G.GL_LUMINANCE_ALPHA = gl.LUMINANCE_ALPHA\n_G.GL_DEPTH_RANGE = gl.DEPTH_RANGE\n_G.GL_FASTEST = gl.FASTEST\n_G.GL_STENCIL_FAIL = gl.STENCIL_FAIL\n_G.GL_UNSIGNED_SHORT = gl.UNSIGNED_SHORT\n_G.GL_RENDERBUFFER_HEIGHT = gl.RENDERBUFFER_HEIGHT\n_G.GL_STENCIL_BACK_FAIL = gl.STENCIL_BACK_FAIL\n_G.GL_BLEND_SRC_RGB = gl.BLEND_SRC_RGB\n_G.GL_TEXTURE3 = gl.TEXTURE3\n_G.GL_RENDERBUFFER = gl.RENDERBUFFER\n_G.GL_RGB5_A1 = gl.RGB5_A1\n_G.GL_RENDERBUFFER_ALPHA_SIZE = gl.RENDERBUFFER_ALPHA_SIZE\n_G.GL_RENDERBUFFER_STENCIL_SIZE = gl.RENDERBUFFER_STENCIL_SIZE\n_G.GL_NOTEQUAL = gl.NOTEQUAL\n_G.GL_BLEND_DST_RGB = gl.BLEND_DST_RGB\n_G.GL_FRONT_AND_BACK = gl.FRONT_AND_BACK\n_G.GL_TEXTURE_BINDING_CUBE_MAP = gl.TEXTURE_BINDING_CUBE_MAP\n_G.GL_MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE\n_G.GL_ZERO = gl.ZERO\n_G.GL_TEXTURE0 = gl.TEXTURE0\n_G.GL_SAMPLE_ALPHA_TO_COVERAGE = gl.SAMPLE_ALPHA_TO_COVERAGE\n_G.GL_BUFFER_USAGE = gl.BUFFER_USAGE\n_G.GL_ACTIVE_TEXTURE = gl.ACTIVE_TEXTURE\n_G.GL_BYTE = gl.BYTE\n_G.GL_CW = gl.CW\n_G.GL_DYNAMIC_DRAW = gl.DYNAMIC_DRAW\n_G.GL_RENDERBUFFER_RED_SIZE = gl.RENDERBUFFER_RED_SIZE\n_G.GL_FALSE = gl.FALSE\n_G.GL_GREATER = gl.GREATER\n_G.GL_RGBA4 = gl.RGBA4\n_G.GL_VALIDATE_STATUS = gl.VALIDATE_STATUS\n_G.GL_STENCIL_BITS = gl.STENCIL_BITS\n_G.GL_RGB = gl.RGB\n_G.GL_INT = gl.INT\n_G.GL_DEPTH_FUNC = gl.DEPTH_FUNC\n_G.GL_SAMPLER_2D = gl.SAMPLER_2D\n_G.GL_NICEST = gl.NICEST\n_G.GL_MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS\n_G.GL_CULL_FACE = gl.CULL_FACE\n_G.GL_INT_VEC3 = gl.INT_VEC3\n_G.GL_ALIASED_POINT_SIZE_RANGE = gl.ALIASED_POINT_SIZE_RANGE\n_G.GL_INVALID_ENUM = gl.INVALID_ENUM\n_G.GL_INVERT = gl.INVERT\n_G.GL_CULL_FACE_MODE = gl.CULL_FACE_MODE\n_G.GL_TEXTURE8 = gl.TEXTURE8\n_G.GL_VERTEX_ATTRIB_ARRAY_POINTER = gl.VERTEX_ATTRIB_ARRAY_POINTER\n_G.GL_TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S\n_G.GL_VERTEX_ATTRIB_ARRAY_STRIDE = gl.VERTEX_ATTRIB_ARRAY_STRIDE\n_G.GL_LINES = gl.LINES\n_G.GL_EQUAL = gl.EQUAL\n_G.GL_LINE_LOOP = gl.LINE_LOOP\n_G.GL_TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T\n_G.GL_DEPTH_BUFFER_BIT = gl.DEPTH_BUFFER_BIT\n_G.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS\n_G.GL_SHADER_TYPE = gl.SHADER_TYPE\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_X = gl.TEXTURE_CUBE_MAP_NEGATIVE_X\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = gl.TEXTURE_CUBE_MAP_NEGATIVE_Y\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = gl.TEXTURE_CUBE_MAP_NEGATIVE_Z\n_G.GL_DECR = gl.DECR\n_G.GL_DELETE_STATUS = gl.DELETE_STATUS\n_G.GL_DEPTH_BITS = gl.DEPTH_BITS\n_G.GL_INCR = gl.INCR\n_G.GL_SAMPLE_COVERAGE_VALUE = gl.SAMPLE_COVERAGE_VALUE\n_G.GL_ALPHA_BITS = gl.ALPHA_BITS\n_G.GL_FLOAT_MAT2 = gl.FLOAT_MAT2\n_G.GL_LINE_STRIP = gl.LINE_STRIP\n_G.GL_SHADER_SOURCE_LENGTH = gl.SHADER_SOURCE_LENGTH\n_G.GL_INVALID_VALUE = gl.INVALID_VALUE\n_G.GL_NEVER = gl.NEVER\n_G.GL_INCR_WRAP = gl.INCR_WRAP\n_G.GL_BLEND_EQUATION_ALPHA = gl.BLEND_EQUATION_ALPHA\n_G.GL_TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER\n_G.GL_POINTS = gl.POINTS\n_G.GL_COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0\n_G.GL_RGBA = gl.RGBA\n_G.GL_SRC_ALPHA_SATURATE = gl.SRC_ALPHA_SATURATE\n_G.GL_SAMPLER_CUBE = gl.SAMPLER_CUBE\n_G.GL_FRAMEBUFFER = gl.FRAMEBUFFER\n_G.GL_TEXTURE_CUBE_MAP = gl.TEXTURE_CUBE_MAP\n_G.GL_SAMPLE_BUFFERS = gl.SAMPLE_BUFFERS\n_G.GL_LINEAR = gl.LINEAR\n_G.GL_LINEAR_MIPMAP_NEAREST = gl.LINEAR_MIPMAP_NEAREST\n_G.GL_ACTIVE_UNIFORM_MAX_LENGTH = gl.ACTIVE_UNIFORM_MAX_LENGTH\n_G.GL_STENCIL_BACK_REF = gl.STENCIL_BACK_REF\n_G.GL_ELEMENT_ARRAY_BUFFER = gl.ELEMENT_ARRAY_BUFFER\n_G.GL_CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE\n_G.GL_TRIANGLE_STRIP = gl.TRIANGLE_STRIP\n_G.GL_CONSTANT_COLOR = gl.CONSTANT_COLOR\n_G.GL_COMPILE_STATUS = gl.COMPILE_STATUS\n_G.GL_RENDERBUFFER_GREEN_SIZE = gl.RENDERBUFFER_GREEN_SIZE\n_G.GL_UNSIGNED_INT = gl.UNSIGNED_INT\n_G.GL_DEPTH_CLEAR_VALUE = gl.DEPTH_CLEAR_VALUE\n_G.GL_ALIASED_LINE_WIDTH_RANGE = gl.ALIASED_LINE_WIDTH_RANGE\n_G.GL_SHADING_LANGUAGE_VERSION = gl.SHADING_LANGUAGE_VERSION\n_G.GL_FRAMEBUFFER_UNSUPPORTED = gl.FRAMEBUFFER_UNSUPPORTED\n_G.GL_INFO_LOG_LENGTH = gl.INFO_LOG_LENGTH\n_G.GL_STENCIL_PASS_DEPTH_PASS = gl.STENCIL_PASS_DEPTH_PASS\n_G.GL_STENCIL_VALUE_MASK = gl.STENCIL_VALUE_MASK\n_G.GL_ALWAYS = gl.ALWAYS\n_G.GL_MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE\n_G.GL_FLOAT = gl.FLOAT\n_G.GL_FRAMEBUFFER_BINDING = gl.FRAMEBUFFER_BINDING\n_G.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\n_G.GL_TRIANGLE_FAN = gl.TRIANGLE_FAN\n_G.GL_INVALID_FRAMEBUFFER_OPERATION = gl.INVALID_FRAMEBUFFER_OPERATION\n_G.GL_TEXTURE_2D = gl.TEXTURE_2D\n_G.GL_ALPHA = gl.ALPHA\n_G.GL_CURRENT_VERTEX_ATTRIB = gl.CURRENT_VERTEX_ATTRIB\n_G.GL_SCISSOR_TEST = gl.SCISSOR_TEST\n_G.GL_TRIANGLES = gl.TRIANGLES\n\n_G.CCControlEventTouchDown = cc.CONTROL_EVENTTYPE_TOUCH_DOWN\n_G.CCControlEventTouchDragInside = cc.CONTROL_EVENTTYPE_DRAG_INSIDE \n_G.CCControlEventTouchDragOutside = cc.CONTROL_EVENTTYPE_DRAG_OUTSIDE\n_G.CCControlEventTouchDragEnter = cc.CONTROL_EVENTTYPE_DRAG_ENTER\n_G.CCControlEventTouchDragExit  = cc.CONTROL_EVENTTYPE_DRAG_EXIT\n_G.CCControlEventTouchUpInside  = cc.CONTROL_EVENTTYPE_TOUCH_UP_INSIDE\n_G.CCControlEventTouchUpOutside = cc.CONTROL_EVENTTYPE_TOUCH_UP_OUTSIDE\n_G.CCControlEventTouchCancel    = cc.CONTROL_EVENTTYPE_TOUCH_CANCEL\n_G.CCControlEventValueChanged   = cc.CONTROL_EVENTTYPE_VALUE_CHANGED \n_G.CCControlStateNormal         = cc.CONTROL_STATE_NORMAL\n_G.CCControlStateHighlighted    = cc.CONTROL_STATE_HIGH_LIGHTED\n_G.CCControlStateDisabled       = cc.CONTROL_STATE_DISABLED\n_G.CCControlStateSelected       = cc.CONTROL_STATE_SELECTED\n\n_G.kWebSocketScriptHandlerOpen  = cc.WEBSOCKET_OPEN\n_G.kWebSocketScriptHandlerMessage = cc.WEBSOCKET_MESSAGE\n_G.kWebSocketScriptHandlerClose   = cc.WEBSOCKET_CLOSE\n_G.kWebSocketScriptHandlerError   = cc.WEBSOCKET_ERROR\n\n_G.kStateConnecting               = cc.WEBSOCKET_STATE_CONNECTING \n_G.kStateOpen                     = cc.WEBSOCKET_STATE_OPEN \n_G.kStateClosing                  = cc.WEBSOCKET_STATE_CLOSING\n_G.kStateClosed                   = cc.WEBSOCKET_STATE_CLOSED\n\n_G.LAYOUT_COLOR_NONE              = ccs.LayoutBackGroundColorType.none\n_G.LAYOUT_COLOR_SOLID             = ccs.LayoutBackGroundColorType.solid\n_G.LAYOUT_COLOR_GRADIENT          = ccs.LayoutBackGroundColorType.gradient\n\n_G.LAYOUT_ABSOLUTE                = ccs.LayoutType.absolute\n_G.LAYOUT_LINEAR_VERTICAL         = ccs.LayoutType.linearVertical\n_G.LAYOUT_LINEAR_HORIZONTAL       = ccs.LayoutType.linearHorizontal\n_G.LAYOUT_RELATIVE                = ccs.LayoutType.relative\n\n_G.BRIGHT_NONE               = ccs.BrightStyle.none\n_G.BRIGHT_NORMAL             = ccs.BrightStyle.normal\n_G.BRIGHT_HIGHLIGHT          = ccs.BrightStyle.highlight\n\n_G.WidgetTypeWidget                = ccs.WidgetType.widget\n_G.WidgetTypeContainer             = ccs.WidgetType.container\n\n_G.UI_TEX_TYPE_LOCAL               = ccs.TextureResType.UI_TEX_TYPE_LOCAL\n_G.UI_TEX_TYPE_PLIST               = ccs.TextureResType.UI_TEX_TYPE_PLIST\n\n_G.TOUCH_EVENT_BEGAN                = ccs.TouchEventType.began\n_G.TOUCH_EVENT_MOVED                = ccs.TouchEventType.moved\n_G.TOUCH_EVENT_ENDED                = ccs.TouchEventType.ended\n_G.TOUCH_EVENT_CANCELED             = ccs.TouchEventType.canceled\n \n_G.SIZE_ABSOLUTE                = ccs.SizeType.absolute\n_G.SIZE_PERCENT                 = ccs.SizeType.percent\n\n_G.POSITION_ABSOLUTE                = ccs.PositionType.absolute\n_G.POSITION_PERCENT                 = ccs.PositionType.percent\n\n_G.CHECKBOX_STATE_EVENT_SELECTED     = ccs.CheckBoxEventType.selected\n_G.CHECKBOX_STATE_EVENT_UNSELECTED   = ccs.CheckBoxEventType.unselected\n\n_G.CHECKBOX_STATE_EVENT_SELECTED     = ccs.CheckBoxEventType.selected\n_G.CHECKBOX_STATE_EVENT_UNSELECTED   = ccs.CheckBoxEventType.unselected\n\n_G.LoadingBarTypeLeft     = ccs.LoadingBarType.left\n_G.LoadingBarTypeRight   = ccs.LoadingBarType.right\n\n_G.LoadingBarTypeRight   = ccs.SliderEventType.percent_changed\n\n_G.TEXTFIELD_EVENT_ATTACH_WITH_IME                = ccs.TextFiledEventType.attach_with_ime\n_G.TEXTFIELD_EVENT_DETACH_WITH_IME                = ccs.TextFiledEventType.detach_with_ime\n_G.TEXTFIELD_EVENT_INSERT_TEXT                 = ccs.TextFiledEventType.insert_text\n_G.TEXTFIELD_EVENT_DELETE_BACKWARD             = ccs.TextFiledEventType.delete_backward\n\n_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP                = ccs.SCROLLVIEW_DIR.none\n_G.SCROLLVIEW_DIR_VERTICAL                = ccs.SCROLLVIEW_DIR.vertical\n_G.SCROLLVIEW_DIR_HORIZONTAL                 = ccs.SCROLLVIEW_DIR.horizontal\n_G.SCROLLVIEW_DIR_BOTH             = ccs.SCROLLVIEW_DIR.both\n\n_G.SCROLLVIEW_EVENT_SCROLL_TO_TOP                = ccs.ScrollviewEventType.SCROLL_TO_TOP\n_G.SCROLLVIEW_EVENT_SCROLL_TO_BOTTOM             = ccs.ScrollviewEventType.SCROLL_TO_BOTTOM\n_G.SCROLLVIEW_EVENT_SCROLL_TO_LEFT               = ccs.ScrollviewEventType.SCROLL_TO_LEFT\n_G.SCROLLVIEW_EVENT_SCROLL_TO_RIGHT              = ccs.ScrollviewEventType.SCROLL_TO_RIGHT\n_G.SCROLLVIEW_EVENT_SCROLLING                    = ccs.ScrollviewEventType.SCROLLING\n_G.SCROLLVIEW_EVENT_BOUNCE_TOP                   = ccs.ScrollviewEventType.BOUNCE_TOP\n_G.SCROLLVIEW_EVENT_BOUNCE_BOTTOM                = ccs.ScrollviewEventType.BOUNCE_BOTTOM\n_G.SCROLLVIEW_EVENT_BOUNCE_LEFT                  = ccs.ScrollviewEventType.BOUNCE_LEFT\n_G.SCROLLVIEW_EVENT_BOUNCE_RIGHT                 = ccs.ScrollviewEventType.BOUNCE_RIGHT\n\n_G.PAGEVIEW_EVENT_TURNING                 = ccs.PageViewEventType.turning\n\n_G.PAGEVIEW_TOUCHLEFT                  = ccs.PVTouchDir.touch_left\n_G.PAGEVIEW_TOUCHRIGHT                 = ccs.PVTouchDir.touch_right\n\n_G.LISTVIEW_DIR_NONE                      = ccs.ListViewDirection.none\n_G.LISTVIEW_DIR_VERTICAL                  = ccs.ListViewDirection.vertical\n_G.LISTVIEW_DIR_HORIZONTAL                = ccs.ListViewDirection.horizontal\n\n_G.LISTVIEW_MOVE_DIR_NONE                = ccs.ListViewMoveDirection.none\n_G.LISTVIEW_MOVE_DIR_UP                  = ccs.ListViewMoveDirection.up\n_G.LISTVIEW_MOVE_DIR_DOWN                = ccs.ListViewMoveDirection.down\n_G.LISTVIEW_MOVE_DIR_LEFT                = ccs.ListViewMoveDirection.left\n_G.LISTVIEW_MOVE_DIR_RIGHT               = ccs.ListViewMoveDirection.right\n\n_G.LISTVIEW_EVENT_INIT_CHILD                 = ccs.ListViewEventType.init_child\n_G.LISTVIEW_EVENT_UPDATE_CHILD               = ccs.ListViewEventType.update_child\n\n_G.LAYOUT_PARAMETER_NONE                   = ccs.UILayoutParameterType.none\n_G.LAYOUT_PARAMETER_LINEAR                 = ccs.UILayoutParameterType.linear\n_G.LAYOUT_PARAMETER_RELATIVE               = ccs.UILayoutParameterType.relative\n\n_G.kCCScrollViewDirectionHorizontal        = cc.SCROLLVIEW_DIRECTION_HORIZONTAL\n_G.kCCScrollViewDirectionVertical          = cc.SCROLLVIEW_DIRECTION_VERTICAL\n_G.kCCTableViewFillTopDown                 = cc.TABLEVIEW_FILL_TOPDOWN\n_G.kCCTableViewFillBottomUp                = cc.TABLEVIEW_FILL_BOTTOMUP\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/DeprecatedOpenglEnum.lua",
    "content": "-- This is the DeprecatedEnum\n\nDeprecatedClass = {} or DeprecatedClass\n\n_G.GL_RENDERBUFFER_INTERNAL_FORMAT = gl.RENDERBUFFER_INTERNAL_FORMAT\n_G.GL_LINE_WIDTH = gl.LINE_WIDTH\n_G.GL_CONSTANT_ALPHA = gl.CONSTANT_ALPHA\n_G.GL_BLEND_SRC_ALPHA = gl.BLEND_SRC_ALPHA\n_G.GL_GREEN_BITS = gl.GREEN_BITS\n_G.GL_STENCIL_REF = gl.STENCIL_REF\n_G.GL_ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\n_G.GL_CCW = gl.CCW\n_G.GL_MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS\n_G.GL_BACK = gl.BACK\n_G.GL_ACTIVE_ATTRIBUTES = gl.ACTIVE_ATTRIBUTES\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_X = gl.TEXTURE_CUBE_MAP_POSITIVE_X\n_G.GL_STENCIL_BACK_VALUE_MASK = gl.STENCIL_BACK_VALUE_MASK\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Z = gl.TEXTURE_CUBE_MAP_POSITIVE_Z\n_G.GL_ONE = gl.ONE\n_G.GL_TRUE = gl.TRUE\n_G.GL_TEXTURE12 = gl.TEXTURE12\n_G.GL_LINK_STATUS = gl.LINK_STATUS\n_G.GL_BLEND = gl.BLEND\n_G.GL_LESS = gl.LESS\n_G.GL_TEXTURE16 = gl.TEXTURE16\n_G.GL_BOOL_VEC2 = gl.BOOL_VEC2\n_G.GL_KEEP = gl.KEEP\n_G.GL_DST_COLOR = gl.DST_COLOR\n_G.GL_VERTEX_ATTRIB_ARRAY_ENABLED = gl.VERTEX_ATTRIB_ARRAY_ENABLED\n_G.GL_EXTENSIONS = gl.EXTENSIONS\n_G.GL_FRONT = gl.FRONT\n_G.GL_DST_ALPHA = gl.DST_ALPHA\n_G.GL_ATTACHED_SHADERS = gl.ATTACHED_SHADERS\n_G.GL_STENCIL_BACK_FUNC = gl.STENCIL_BACK_FUNC\n_G.GL_ONE_MINUS_DST_COLOR = gl.ONE_MINUS_DST_COLOR\n_G.GL_BLEND_EQUATION = gl.BLEND_EQUATION\n_G.GL_RENDERBUFFER_DEPTH_SIZE = gl.RENDERBUFFER_DEPTH_SIZE\n_G.GL_PACK_ALIGNMENT = gl.PACK_ALIGNMENT\n_G.GL_VENDOR = gl.VENDOR\n_G.GL_NEAREST_MIPMAP_LINEAR = gl.NEAREST_MIPMAP_LINEAR\n_G.GL_TEXTURE_CUBE_MAP_POSITIVE_Y = gl.TEXTURE_CUBE_MAP_POSITIVE_Y\n_G.GL_NEAREST = gl.NEAREST\n_G.GL_RENDERBUFFER_WIDTH = gl.RENDERBUFFER_WIDTH\n_G.GL_ARRAY_BUFFER_BINDING = gl.ARRAY_BUFFER_BINDING\n_G.GL_ARRAY_BUFFER = gl.ARRAY_BUFFER\n_G.GL_LEQUAL = gl.LEQUAL\n_G.GL_VERSION = gl.VERSION\n_G.GL_COLOR_CLEAR_VALUE = gl.COLOR_CLEAR_VALUE\n_G.GL_RENDERER = gl.RENDERER\n_G.GL_STENCIL_BACK_PASS_DEPTH_PASS = gl.STENCIL_BACK_PASS_DEPTH_PASS\n_G.GL_STENCIL_BACK_PASS_DEPTH_FAIL = gl.STENCIL_BACK_PASS_DEPTH_FAIL\n_G.GL_STENCIL_BACK_WRITEMASK = gl.STENCIL_BACK_WRITEMASK\n_G.GL_BOOL = gl.BOOL\n_G.GL_VIEWPORT = gl.VIEWPORT\n_G.GL_FRAGMENT_SHADER = gl.FRAGMENT_SHADER\n_G.GL_LUMINANCE = gl.LUMINANCE\n_G.GL_DECR_WRAP = gl.DECR_WRAP\n_G.GL_FUNC_ADD = gl.FUNC_ADD\n_G.GL_ONE_MINUS_DST_ALPHA = gl.ONE_MINUS_DST_ALPHA\n_G.GL_OUT_OF_MEMORY = gl.OUT_OF_MEMORY\n_G.GL_BOOL_VEC4 = gl.BOOL_VEC4\n_G.GL_POLYGON_OFFSET_FACTOR = gl.POLYGON_OFFSET_FACTOR\n_G.GL_STATIC_DRAW = gl.STATIC_DRAW\n_G.GL_DITHER = gl.DITHER\n_G.GL_TEXTURE31 = gl.TEXTURE31\n_G.GL_TEXTURE30 = gl.TEXTURE30\n_G.GL_UNSIGNED_BYTE = gl.UNSIGNED_BYTE\n_G.GL_DEPTH_COMPONENT16 = gl.DEPTH_COMPONENT16\n_G.GL_TEXTURE23 = gl.TEXTURE23\n_G.GL_DEPTH_TEST = gl.DEPTH_TEST\n_G.GL_STENCIL_PASS_DEPTH_FAIL = gl.STENCIL_PASS_DEPTH_FAIL\n_G.GL_BOOL_VEC3 = gl.BOOL_VEC3\n_G.GL_POLYGON_OFFSET_UNITS = gl.POLYGON_OFFSET_UNITS\n_G.GL_TEXTURE_BINDING_2D = gl.TEXTURE_BINDING_2D\n_G.GL_TEXTURE21 = gl.TEXTURE21\n_G.GL_UNPACK_ALIGNMENT = gl.UNPACK_ALIGNMENT\n_G.GL_DONT_CARE = gl.DONT_CARE\n_G.GL_BUFFER_SIZE = gl.BUFFER_SIZE\n_G.GL_FLOAT_MAT3 = gl.FLOAT_MAT3\n_G.GL_UNSIGNED_SHORT_5_6_5 = gl.UNSIGNED_SHORT_5_6_5\n_G.GL_INT_VEC2 = gl.INT_VEC2\n_G.GL_UNSIGNED_SHORT_4_4_4_4 = gl.UNSIGNED_SHORT_4_4_4_4\n_G.GL_NONE = gl.NONE\n_G.GL_BLEND_DST_ALPHA = gl.BLEND_DST_ALPHA\n_G.GL_VERTEX_ATTRIB_ARRAY_SIZE = gl.VERTEX_ATTRIB_ARRAY_SIZE\n_G.GL_SRC_COLOR = gl.SRC_COLOR\n_G.GL_COMPRESSED_TEXTURE_FORMATS = gl.COMPRESSED_TEXTURE_FORMATS\n_G.GL_STENCIL_ATTACHMENT = gl.STENCIL_ATTACHMENT\n_G.GL_MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS\n_G.GL_NUM_COMPRESSED_TEXTURE_FORMATS = gl.NUM_COMPRESSED_TEXTURE_FORMATS\n_G.GL_BLEND_EQUATION_RGB = gl.BLEND_EQUATION_RGB\n_G.GL_TEXTURE = gl.TEXTURE\n_G.GL_LINEAR_MIPMAP_LINEAR = gl.LINEAR_MIPMAP_LINEAR\n_G.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\n_G.GL_CURRENT_PROGRAM = gl.CURRENT_PROGRAM\n_G.GL_COLOR_BUFFER_BIT = gl.COLOR_BUFFER_BIT\n_G.GL_TEXTURE20 = gl.TEXTURE20\n_G.GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = gl.ACTIVE_ATTRIBUTE_MAX_LENGTH\n_G.GL_TEXTURE28 = gl.TEXTURE28\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\n_G.GL_TEXTURE22 = gl.TEXTURE22\n_G.GL_ELEMENT_ARRAY_BUFFER_BINDING = gl.ELEMENT_ARRAY_BUFFER_BINDING\n_G.GL_STREAM_DRAW = gl.STREAM_DRAW\n_G.GL_SCISSOR_BOX = gl.SCISSOR_BOX\n_G.GL_TEXTURE26 = gl.TEXTURE26\n_G.GL_TEXTURE27 = gl.TEXTURE27\n_G.GL_TEXTURE24 = gl.TEXTURE24\n_G.GL_TEXTURE25 = gl.TEXTURE25\n_G.GL_NO_ERROR = gl.NO_ERROR\n_G.GL_TEXTURE29 = gl.TEXTURE29\n_G.GL_FLOAT_MAT4 = gl.FLOAT_MAT4\n_G.GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = gl.VERTEX_ATTRIB_ARRAY_NORMALIZED\n_G.GL_SAMPLE_COVERAGE_INVERT = gl.SAMPLE_COVERAGE_INVERT\n_G.GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\n_G.GL_FLOAT_VEC3 = gl.FLOAT_VEC3\n_G.GL_STENCIL_CLEAR_VALUE = gl.STENCIL_CLEAR_VALUE\n_G.GL_UNSIGNED_SHORT_5_5_5_1 = gl.UNSIGNED_SHORT_5_5_5_1\n_G.GL_ACTIVE_UNIFORMS = gl.ACTIVE_UNIFORMS\n_G.GL_INVALID_OPERATION = gl.INVALID_OPERATION\n_G.GL_DEPTH_ATTACHMENT = gl.DEPTH_ATTACHMENT\n_G.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS\n_G.GL_FRAMEBUFFER_COMPLETE = gl.FRAMEBUFFER_COMPLETE\n_G.GL_ONE_MINUS_CONSTANT_COLOR = gl.ONE_MINUS_CONSTANT_COLOR\n_G.GL_TEXTURE2 = gl.TEXTURE2\n_G.GL_TEXTURE1 = gl.TEXTURE1\n_G.GL_GEQUAL = gl.GEQUAL\n_G.GL_TEXTURE7 = gl.TEXTURE7\n_G.GL_TEXTURE6 = gl.TEXTURE6\n_G.GL_TEXTURE5 = gl.TEXTURE5\n_G.GL_TEXTURE4 = gl.TEXTURE4\n_G.GL_GENERATE_MIPMAP_HINT = gl.GENERATE_MIPMAP_HINT\n_G.GL_ONE_MINUS_SRC_COLOR = gl.ONE_MINUS_SRC_COLOR\n_G.GL_TEXTURE9 = gl.TEXTURE9\n_G.GL_STENCIL_TEST = gl.STENCIL_TEST\n_G.GL_COLOR_WRITEMASK = gl.COLOR_WRITEMASK\n_G.GL_DEPTH_COMPONENT = gl.DEPTH_COMPONENT\n_G.GL_STENCIL_INDEX8 = gl.STENCIL_INDEX8\n_G.GL_VERTEX_ATTRIB_ARRAY_TYPE = gl.VERTEX_ATTRIB_ARRAY_TYPE\n_G.GL_FLOAT_VEC2 = gl.FLOAT_VEC2\n_G.GL_BLUE_BITS = gl.BLUE_BITS\n_G.GL_VERTEX_SHADER = gl.VERTEX_SHADER\n_G.GL_SUBPIXEL_BITS = gl.SUBPIXEL_BITS\n_G.GL_STENCIL_WRITEMASK = gl.STENCIL_WRITEMASK\n_G.GL_FLOAT_VEC4 = gl.FLOAT_VEC4\n_G.GL_TEXTURE17 = gl.TEXTURE17\n_G.GL_ONE_MINUS_CONSTANT_ALPHA = gl.ONE_MINUS_CONSTANT_ALPHA\n_G.GL_TEXTURE15 = gl.TEXTURE15\n_G.GL_TEXTURE14 = gl.TEXTURE14\n_G.GL_TEXTURE13 = gl.TEXTURE13\n_G.GL_SAMPLES = gl.SAMPLES\n_G.GL_TEXTURE11 = gl.TEXTURE11\n_G.GL_TEXTURE10 = gl.TEXTURE10\n_G.GL_FUNC_SUBTRACT = gl.FUNC_SUBTRACT\n_G.GL_STENCIL_BUFFER_BIT = gl.STENCIL_BUFFER_BIT\n_G.GL_TEXTURE19 = gl.TEXTURE19\n_G.GL_TEXTURE18 = gl.TEXTURE18\n_G.GL_NEAREST_MIPMAP_NEAREST = gl.NEAREST_MIPMAP_NEAREST\n_G.GL_SHORT = gl.SHORT\n_G.GL_RENDERBUFFER_BINDING = gl.RENDERBUFFER_BINDING\n_G.GL_REPEAT = gl.REPEAT\n_G.GL_TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER\n_G.GL_RED_BITS = gl.RED_BITS\n_G.GL_FRONT_FACE = gl.FRONT_FACE\n_G.GL_BLEND_COLOR = gl.BLEND_COLOR\n_G.GL_MIRRORED_REPEAT = gl.MIRRORED_REPEAT\n_G.GL_INT_VEC4 = gl.INT_VEC4\n_G.GL_MAX_CUBE_MAP_TEXTURE_SIZE = gl.MAX_CUBE_MAP_TEXTURE_SIZE\n_G.GL_RENDERBUFFER_BLUE_SIZE = gl.RENDERBUFFER_BLUE_SIZE\n_G.GL_SAMPLE_COVERAGE = gl.SAMPLE_COVERAGE\n_G.GL_SRC_ALPHA = gl.SRC_ALPHA\n_G.GL_FUNC_REVERSE_SUBTRACT = gl.FUNC_REVERSE_SUBTRACT\n_G.GL_DEPTH_WRITEMASK = gl.DEPTH_WRITEMASK\n_G.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT\n_G.GL_POLYGON_OFFSET_FILL = gl.POLYGON_OFFSET_FILL\n_G.GL_STENCIL_FUNC = gl.STENCIL_FUNC\n_G.GL_REPLACE = gl.REPLACE\n_G.GL_LUMINANCE_ALPHA = gl.LUMINANCE_ALPHA\n_G.GL_DEPTH_RANGE = gl.DEPTH_RANGE\n_G.GL_FASTEST = gl.FASTEST\n_G.GL_STENCIL_FAIL = gl.STENCIL_FAIL\n_G.GL_UNSIGNED_SHORT = gl.UNSIGNED_SHORT\n_G.GL_RENDERBUFFER_HEIGHT = gl.RENDERBUFFER_HEIGHT\n_G.GL_STENCIL_BACK_FAIL = gl.STENCIL_BACK_FAIL\n_G.GL_BLEND_SRC_RGB = gl.BLEND_SRC_RGB\n_G.GL_TEXTURE3 = gl.TEXTURE3\n_G.GL_RENDERBUFFER = gl.RENDERBUFFER\n_G.GL_RGB5_A1 = gl.RGB5_A1\n_G.GL_RENDERBUFFER_ALPHA_SIZE = gl.RENDERBUFFER_ALPHA_SIZE\n_G.GL_RENDERBUFFER_STENCIL_SIZE = gl.RENDERBUFFER_STENCIL_SIZE\n_G.GL_NOTEQUAL = gl.NOTEQUAL\n_G.GL_BLEND_DST_RGB = gl.BLEND_DST_RGB\n_G.GL_FRONT_AND_BACK = gl.FRONT_AND_BACK\n_G.GL_TEXTURE_BINDING_CUBE_MAP = gl.TEXTURE_BINDING_CUBE_MAP\n_G.GL_MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE\n_G.GL_ZERO = gl.ZERO\n_G.GL_TEXTURE0 = gl.TEXTURE0\n_G.GL_SAMPLE_ALPHA_TO_COVERAGE = gl.SAMPLE_ALPHA_TO_COVERAGE\n_G.GL_BUFFER_USAGE = gl.BUFFER_USAGE\n_G.GL_ACTIVE_TEXTURE = gl.ACTIVE_TEXTURE\n_G.GL_BYTE = gl.BYTE\n_G.GL_CW = gl.CW\n_G.GL_DYNAMIC_DRAW = gl.DYNAMIC_DRAW\n_G.GL_RENDERBUFFER_RED_SIZE = gl.RENDERBUFFER_RED_SIZE\n_G.GL_FALSE = gl.FALSE\n_G.GL_GREATER = gl.GREATER\n_G.GL_RGBA4 = gl.RGBA4\n_G.GL_VALIDATE_STATUS = gl.VALIDATE_STATUS\n_G.GL_STENCIL_BITS = gl.STENCIL_BITS\n_G.GL_RGB = gl.RGB\n_G.GL_INT = gl.INT\n_G.GL_DEPTH_FUNC = gl.DEPTH_FUNC\n_G.GL_SAMPLER_2D = gl.SAMPLER_2D\n_G.GL_NICEST = gl.NICEST\n_G.GL_MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS\n_G.GL_CULL_FACE = gl.CULL_FACE\n_G.GL_INT_VEC3 = gl.INT_VEC3\n_G.GL_ALIASED_POINT_SIZE_RANGE = gl.ALIASED_POINT_SIZE_RANGE\n_G.GL_INVALID_ENUM = gl.INVALID_ENUM\n_G.GL_INVERT = gl.INVERT\n_G.GL_CULL_FACE_MODE = gl.CULL_FACE_MODE\n_G.GL_TEXTURE8 = gl.TEXTURE8\n_G.GL_VERTEX_ATTRIB_ARRAY_POINTER = gl.VERTEX_ATTRIB_ARRAY_POINTER\n_G.GL_TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S\n_G.GL_VERTEX_ATTRIB_ARRAY_STRIDE = gl.VERTEX_ATTRIB_ARRAY_STRIDE\n_G.GL_LINES = gl.LINES\n_G.GL_EQUAL = gl.EQUAL\n_G.GL_LINE_LOOP = gl.LINE_LOOP\n_G.GL_TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T\n_G.GL_DEPTH_BUFFER_BIT = gl.DEPTH_BUFFER_BIT\n_G.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS\n_G.GL_SHADER_TYPE = gl.SHADER_TYPE\n_G.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_X = gl.TEXTURE_CUBE_MAP_NEGATIVE_X\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = gl.TEXTURE_CUBE_MAP_NEGATIVE_Y\n_G.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = gl.TEXTURE_CUBE_MAP_NEGATIVE_Z\n_G.GL_DECR = gl.DECR\n_G.GL_DELETE_STATUS = gl.DELETE_STATUS\n_G.GL_DEPTH_BITS = gl.DEPTH_BITS\n_G.GL_INCR = gl.INCR\n_G.GL_SAMPLE_COVERAGE_VALUE = gl.SAMPLE_COVERAGE_VALUE\n_G.GL_ALPHA_BITS = gl.ALPHA_BITS\n_G.GL_FLOAT_MAT2 = gl.FLOAT_MAT2\n_G.GL_LINE_STRIP = gl.LINE_STRIP\n_G.GL_SHADER_SOURCE_LENGTH = gl.SHADER_SOURCE_LENGTH\n_G.GL_INVALID_VALUE = gl.INVALID_VALUE\n_G.GL_NEVER = gl.NEVER\n_G.GL_INCR_WRAP = gl.INCR_WRAP\n_G.GL_BLEND_EQUATION_ALPHA = gl.BLEND_EQUATION_ALPHA\n_G.GL_TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER\n_G.GL_POINTS = gl.POINTS\n_G.GL_COLOR_ATTACHMENT0 = gl.COLOR_ATTACHMENT0\n_G.GL_RGBA = gl.RGBA\n_G.GL_SRC_ALPHA_SATURATE = gl.SRC_ALPHA_SATURATE\n_G.GL_SAMPLER_CUBE = gl.SAMPLER_CUBE\n_G.GL_FRAMEBUFFER = gl.FRAMEBUFFER\n_G.GL_TEXTURE_CUBE_MAP = gl.TEXTURE_CUBE_MAP\n_G.GL_SAMPLE_BUFFERS = gl.SAMPLE_BUFFERS\n_G.GL_LINEAR = gl.LINEAR\n_G.GL_LINEAR_MIPMAP_NEAREST = gl.LINEAR_MIPMAP_NEAREST\n_G.GL_ACTIVE_UNIFORM_MAX_LENGTH = gl.ACTIVE_UNIFORM_MAX_LENGTH\n_G.GL_STENCIL_BACK_REF = gl.STENCIL_BACK_REF\n_G.GL_ELEMENT_ARRAY_BUFFER = gl.ELEMENT_ARRAY_BUFFER\n_G.GL_CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE\n_G.GL_TRIANGLE_STRIP = gl.TRIANGLE_STRIP\n_G.GL_CONSTANT_COLOR = gl.CONSTANT_COLOR\n_G.GL_COMPILE_STATUS = gl.COMPILE_STATUS\n_G.GL_RENDERBUFFER_GREEN_SIZE = gl.RENDERBUFFER_GREEN_SIZE\n_G.GL_UNSIGNED_INT = gl.UNSIGNED_INT\n_G.GL_DEPTH_CLEAR_VALUE = gl.DEPTH_CLEAR_VALUE\n_G.GL_ALIASED_LINE_WIDTH_RANGE = gl.ALIASED_LINE_WIDTH_RANGE\n_G.GL_SHADING_LANGUAGE_VERSION = gl.SHADING_LANGUAGE_VERSION\n_G.GL_FRAMEBUFFER_UNSUPPORTED = gl.FRAMEBUFFER_UNSUPPORTED\n_G.GL_INFO_LOG_LENGTH = gl.INFO_LOG_LENGTH\n_G.GL_STENCIL_PASS_DEPTH_PASS = gl.STENCIL_PASS_DEPTH_PASS\n_G.GL_STENCIL_VALUE_MASK = gl.STENCIL_VALUE_MASK\n_G.GL_ALWAYS = gl.ALWAYS\n_G.GL_MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE\n_G.GL_FLOAT = gl.FLOAT\n_G.GL_FRAMEBUFFER_BINDING = gl.FRAMEBUFFER_BINDING\n_G.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\n_G.GL_TRIANGLE_FAN = gl.TRIANGLE_FAN\n_G.GL_INVALID_FRAMEBUFFER_OPERATION = gl.INVALID_FRAMEBUFFER_OPERATION\n_G.GL_TEXTURE_2D = gl.TEXTURE_2D\n_G.GL_ALPHA = gl.ALPHA\n_G.GL_CURRENT_VERTEX_ATTRIB = gl.CURRENT_VERTEX_ATTRIB\n_G.GL_SCISSOR_TEST = gl.SCISSOR_TEST\n_G.GL_TRIANGLES = gl.TRIANGLES\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/DrawPrimitives.lua",
    "content": "local dp_initialized = false\nlocal dp_shader      = nil\nlocal dp_colorLocation = -1\nlocal dp_color = { 1.0, 1.0, 1.0, 1.0 }\nlocal dp_pointSizeLocation = -1\nlocal dp_pointSize = 1.0\n\nlocal SHADER_NAME_POSITION_U_COLOR = \"ShaderPosition_uColor\"\n\nlocal targetPlatform = CCApplication:getInstance():getTargetPlatform()\n\nlocal function lazy_init()\n    if not dp_initialized then\n        dp_shader = CCShaderCache:getInstance():getProgram(SHADER_NAME_POSITION_U_COLOR)\n        --dp_shader:retain()\n        if nil ~= dp_shader then\n            dp_colorLocation = gl.getUniformLocation( dp_shader:getProgram(), \"u_color\")\n            dp_pointSizeLocation = gl.getUniformLocation( dp_shader:getProgram(), \"u_pointSize\")\n            dp_Initialized = true\n        end\n    end\n\n    if nil == dp_shader then\n        print(\"Error:dp_shader is nil!\")\n        return false\n    end\n\n    return true\nend\n\nlocal function setDrawProperty()\n    gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION )\n    dp_shader:use()\n    dp_shader:setUniformsForBuiltins()    \n    dp_shader:setUniformLocationWith4fv(dp_colorLocation, dp_color, 1)\nend\n\nfunction ccDrawInit()\n    lazy_init()\nend\n\nfunction ccDrawFree()\n    dp_initialized = false\nend\n\nfunction ccDrawColor4f(r,g,b,a)\n    dp_color[1] = r\n    dp_color[2] = g\n    dp_color[3] = b\n    dp_color[4] = a\nend\n\nfunction ccPointSize(pointSize)\n    dp_pointSize = pointSize * CCDirector:getInstance():getContentScaleFactor()\nend\n\nfunction ccDrawColor4B(r,g,b,a)\n    dp_color[1] = r / 255.0\n    dp_color[2] = g / 255.0\n    dp_color[3] = b / 255.0\n    dp_color[4] = a / 255.0\nend\n\nfunction ccDrawPoint(point)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n        local vertices = { point.x,point.y}\n        gl.bufferData(gl.ARRAY_BUFFER,2,vertices,gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    dp_shader:setUniformLocationWith1f(dp_pointSizeLocation, dp_pointSize)\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.POINTS,0,1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawPoints(points,numOfPoint)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n    local i = 1\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = {}\n        for i = 1, numOfPoint do\n            vertices[2 * i - 1] = points[i].x\n            vertices[2 * i]     = points[i].y\n        end\n        gl.bufferData(gl.ARRAY_BUFFER, numOfPoint * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    dp_shader:setUniformLocationWith1f(dp_pointSizeLocation, dp_pointSize)\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.POINTS,0,numOfPoint)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawLine(origin,destination)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = { origin.x, origin.y, destination.x, destination.y}\n        gl.bufferData(gl.ARRAY_BUFFER,4,vertices,gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINES ,0,2)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawPoly(points,numOfPoints,closePolygon)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n    local i = 1\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = {}\n        for i = 1, numOfPoints do\n            vertices[2 * i - 1] = points[i].x\n            vertices[2 * i]     = points[i].y\n        end\n        gl.bufferData(gl.ARRAY_BUFFER, numOfPoints * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    if closePolygon then\n        gl.drawArrays(gl.LINE_LOOP , 0, numOfPoints)\n    else\n        gl.drawArrays(gl.LINE_STRIP, 0, numOfPoints)\n    end\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawSolidPoly(points,numOfPoints,color)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = {}\n    local i = 1\n\n    local function initBuffer()\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        local vertices = {}\n        for i = 1, numOfPoints do\n            vertices[2 * i - 1] = points[i].x\n            vertices[2 * i]     = points[i].y\n\n        end\n        gl.bufferData(gl.ARRAY_BUFFER, numOfPoints * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    gl.glEnableVertexAttribs( CCConstants.VERTEX_ATTRIB_FLAG_POSITION )\n    dp_shader:use()\n    dp_shader:setUniformsForBuiltins()    \n    dp_shader:setUniformLocationWith4fv(dp_colorLocation, color, 1)\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.TRIANGLE_FAN , 0, numOfPoints)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawRect(origin,destination)\n    ccDrawLine(CCPoint:__call(origin.x, origin.y), CCPoint:__call(destination.x, origin.y))\n    ccDrawLine(CCPoint:__call(destination.x, origin.y), CCPoint:__call(destination.x, destination.y))\n    ccDrawLine(CCPoint:__call(destination.x, destination.y), CCPoint:__call(origin.x, destination.y))\n    ccDrawLine(CCPoint:__call(origin.x, destination.y), CCPoint:__call(origin.x, origin.y))\nend\n\nfunction ccDrawSolidRect( origin,destination,color )\n    local vertices = { origin, CCPoint:__call(destination.x, origin.y) , destination, CCPoint:__call(origin.x, destination.y) }\n    ccDrawSolidPoly(vertices,4,color)\nend\n\nfunction ccDrawCircleScale( center, radius, angle, segments,drawLineToCenter,scaleX,scaleY)\n    if not lazy_init() then\n        return\n    end\n\n    local additionalSegment = 1\n    if drawLineToCenter then\n        additionalSegment = additionalSegment + 1\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local coef = 2.0 * math.pi / segments\n        local i = 1\n        local vertices = {}\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        for i = 1, segments + 1 do\n            local rads = (i - 1) * coef\n            local j    = radius * math.cos(rads + angle) * scaleX + center.x\n            local k    = radius * math.sin(rads + angle) * scaleY + center.y\n            vertices[i * 2 - 1] = j\n            vertices[i * 2]     = k\n         end\n        vertices[(segments + 2) * 2 - 1] = center.x\n        vertices[(segments + 2) * 2]     = center.y\n\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 2) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINE_STRIP , 0, segments + additionalSegment)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawCircle(center, radius, angle, segments, drawLineToCenter)\n    ccDrawCircleScale(center, radius, angle, segments, drawLineToCenter, 1.0, 1.0)\nend\n\nfunction ccDrawSolidCircle(center, radius, angle, segments,scaleX,scaleY)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local coef = 2.0 * math.pi / segments\n        local i = 1\n        local vertices = {}\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        for i = 1, segments + 1 do\n            local rads = (i - 1) * coef\n            local j    = radius * math.cos(rads + angle) * scaleX + center.x\n            local k    = radius * math.sin(rads + angle) * scaleY + center.y\n            vertices[i * 2 - 1] = j\n            vertices[i * 2]     = k\n         end\n        vertices[(segments + 2) * 2 - 1] = center.x\n        vertices[(segments + 2) * 2]     = center.y\n\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 2) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.TRIANGLE_FAN , 0, segments + 1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawQuadBezier(origin, control, destination, segments)\n    if not lazy_init() then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local vertices = { } \n        local i = 1\n        local t = 0.0\n\n        for i = 1, segments do\n            vertices[2 * i - 1] = math.pow(1 - t,2) * origin.x + 2.0 * (1 - t) * t * control.x + t * t * destination.x\n            vertices[2 * i]     = math.pow(1 - t,2) * origin.y + 2.0 * (1 - t) * t * control.y + t * t * destination.y\n            t = t + 1.0 / segments\n        end\n        \n        vertices[2 * (segments + 1) - 1] = destination.x\n        vertices[2 * (segments + 1)]     = destination.y\n\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 1) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINE_STRIP , 0, segments + 1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n\nfunction ccDrawCubicBezier(origin, control1, control2, destination, segments)\n    if not lazy_init then\n        return\n    end\n\n    local vertexBuffer = { }\n\n    local function initBuffer()\n        local vertices = { } \n        local t = 0\n        local i = 1\n\n        for i = 1, segments do\n            vertices[2 * i - 1] = math.pow(1 - t,3) * origin.x + 3.0 * math.pow(1 - t, 2) * t * control1.x + 3.0 * (1 - t) * t * t * control2.x + t * t * t * destination.x\n            vertices[2 * i]     = math.pow(1 - t,3) * origin.y + 3.0 * math.pow(1 - t, 2) * t * control1.y + 3.0 * (1 - t) * t * t * control2.y + t * t * t * destination.y\n            t = t + 1.0 / segments\n        end\n\n        vertices[2 * (segments + 1) - 1] = destination.x\n        vertices[2 * (segments + 1)]     = destination.y\n\n        vertexBuffer.buffer_id = gl.createBuffer()\n        gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer.buffer_id)\n        gl.bufferData(gl.ARRAY_BUFFER, (segments + 1) * 2, vertices, gl.STATIC_DRAW)\n        gl.bindBuffer(gl.ARRAY_BUFFER, 0)\n    end\n\n    initBuffer()\n\n    setDrawProperty()\n\n    gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer.buffer_id)\n    gl.vertexAttribPointer(CCConstants.VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0)\n    gl.drawArrays(gl.LINE_STRIP , 0, segments + 1)\n    gl.bindBuffer(gl.ARRAY_BUFFER,0)\nend\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/GuiConstants.lua",
    "content": "ccui = ccui or {}\n\nccui.BrightStyle = \n{\n    none = -1,\n    normal = 0,\n    highlight = 1,\n}\n\nccui.WidgetType = \n{\n    widget = 0, --control\n    container = 1, --container\n}\n\nccui.TextureResType = \n{\n    localType = 0,\n    plistType = 1,\n}\n\nccui.TouchEventType = \n{\n    began = 0,\n    moved = 1,\n    ended = 2,\n    canceled = 3,\n}\n\nccui.SizeType = \n{\n    absolute = 0,\n    percent = 1,\n}\n\nccui.PositionType = {\n    absolute = 0,\n    percent = 1,\n}\n\nccui.CheckBoxEventType = \n{\n    selected = 0,\n    unselected = 1,\n}\n\nccui.TextFiledEventType = \n{\n    attach_with_ime = 0,\n    detach_with_ime = 1,\n    insert_text = 2,\n    delete_backward = 3,\n}\n\nccui.LayoutBackGroundColorType = \n{\n    none = 0,\n    solid = 1,\n    gradient = 2,\n}\n\nccui.LayoutType = \n{\n    absolute = 0,\n    linearVertical = 1,\n    linearHorizontal = 2,\n    relative = 3,\n}\n\nccui.LayoutParameterType = \n{\n    none = 0,\n    linear = 1,\n    relative = 2,\n}\n\nccui.LinearGravity = \n{\n    none = 0,\n    left = 1,\n    top = 2,\n    right = 3,\n    bottom = 4,\n    centerVertical = 5,\n    centerHorizontal = 6,\n}\n\nccui.RelativeAlign = \n{\n    alignNone = 0,\n    alignParentTopLeft = 1,\n    alignParentTopCenterHorizontal = 2,\n    alignParentTopRight = 3,\n    alignParentLeftCenterVertical = 4,\n    centerInParent = 5,\n    alignParentRightCenterVertical = 6,\n    alignParentLeftBottom = 7,\n    alignParentBottomCenterHorizontal = 8,\n    alignParentRightBottom = 9,\n    locationAboveLeftAlign = 10,\n    locationAboveCenter = 11,\n    locationAboveRightAlign = 12,\n    locationLeftOfTopAlign = 13,\n    locationLeftOfCenter = 14,\n    locationLeftOfBottomAlign = 15,\n    locationRightOfTopAlign = 16,\n    locationRightOfCenter = 17,\n    locationRightOfBottomAlign = 18,\n    locationBelowLeftAlign = 19,\n    locationBelowCenter = 20,\n    locationBelowRightAlign = 21,\n}\n\nccui.SliderEventType = {percentChanged = 0}\n\nccui.LoadingBarType = { left = 0, right = 1}\n\nccui.ScrollViewDir = {\n    none = 0,\n    vertical = 1,\n    horizontal = 2,\n    both = 3,\n}\n\nccui.ScrollViewMoveDir = {\n    none = 0,\n    up = 1,\n    down = 2,\n    left = 3,\n    right = 4,\n}\n\nccui.ScrollviewEventType = {\n    scrollToTop =  0,\n    scrollToBottom =  1,\n    scrollToLeft = 2,\n    scrollToRight = 3,\n    scrolling = 4,\n    bounceTop = 5,\n    bounceBottom = 6,\n    bounceLeft = 7,\n    bounceRight = 8,\n}\n\nccui.ListViewDirection = {\n    none = 0,\n    vertical = 1,\n    horizontal = 2,\n}\n\nccui.ListViewMoveDirection = {\n    none = 0,\n    up = 1,\n    down = 2,\n    left = 3,\n    right = 4,\n}\n\nccui.ListViewEventType = {\n    onsSelectedItem = 0,\n}\n\nccui.PageViewEventType = {\n   turning = 0,  \n}\n\nccui.PVTouchDir = {\n    touchLeft = 0,\n    touchRight = 1,\n}\n\nccui.ListViewGravity = {\n    left = 0,\n    right = 1,\n    centerHorizontal = 2,\n    top = 3,\n    bottom = 4 ,\n    centerVertical = 5,\n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/Opengl.lua",
    "content": "require \"OpenglConstants\"\n\ngl = gl or {}\n\n--Create functions\nfunction  gl.createTexture()\n    local retTable = {}\n    retTable.texture_id = gl._createTexture()\n    return retTable\nend\n\nfunction gl.createBuffer()\n    local retTable = {}\n    retTable.buffer_id = gl._createBuffer()\n    return retTable\nend\n\nfunction gl.createRenderbuffer()\n    local retTable = {}\n    retTable.renderbuffer_id = gl._createRenderuffer()\n    return retTable\nend\n\nfunction gl.createFramebuffer( )\n    local retTable = {}\n    retTable.framebuffer_id = gl._createFramebuffer()\n    return retTable\nend\n\nfunction gl.createProgram()\n    local retTable = {}\n    retTable.program_id = gl._createProgram()\n    return retTable\nend\n\nfunction gl.createShader(shaderType)\n    local retTable = {}\n    retTable.shader_id = gl._createShader(shaderType)\n    return retTable\nend\n\n--Delete Fun\nfunction gl.deleteTexture(texture)\n    local texture_id = 0\n    if \"number\" == type(texture) then\n        texture_id = texture\n    elseif \"table\" == type(texture) then\n        texture_id = texture.texture_id\n    end\n    gl._deleteTexture(texture_id)\nend\n\nfunction gl.deleteBuffer(buffer)\n    local buffer_id = 0\n    if \"number\" == type(buffer) then\n        buffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n    gl._deleteBuffer(buffer_id)\nend\n\nfunction gl.deleteRenderbuffer(buffer)\n    local renderbuffer_id = 0\n    if \"number\" == type(buffer) then\n        renderbuffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        renderbuffer_id = buffer.renderbuffer_id\n    end\n    gl._deleteRenderbuffer(renderbuffer_id)\nend\n\nfunction gl.deleteFramebuffer(buffer)\n    local framebuffer_id = 0\n    if \"number\" == type(buffer) then\n        framebuffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        framebuffer_id = buffer.framebuffer_id\n    end\n    gl._deleteFramebuffer(framebuffer_id)\nend\n\nfunction gl.deleteProgram( program )\n    local program_id = 0\n    if \"number\" == type(buffer) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._deleteProgram(program_id)\nend\n\nfunction gl.deleteShader(shader)\n    local shader_id = 0\n    if \"number\" == type(shader) then\n        shader_id = shader\n    elseif \"table\" == type(shader) then\n        shader_id = shader.shader_id\n    end\n\n    gl._deleteShader(shader_id)\nend\n\n--Bind Related\nfunction gl.bindTexture(target, texture)\n    local texture_id = 0\n    if \"number\" == type(texture) then\n        texture_id = texture\n    elseif \"table\" == type(texture) then\n        texture_id = texture.texture_id\n    end\n\n    gl._bindTexture(target,texture_id)\nend \n\nfunction gl.bindBuffer( target,buffer )\n    local buffer_id = 0\n    if \"number\" == type(buffer) then\n        buffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n\n    gl._bindBuffer(target, buffer_id)\nend\n\nfunction gl.bindRenderBuffer(target, buffer)\n    local buffer_id = 0\n\n    if \"number\" == type(buffer) then\n        buffer_id = buffer;\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n\n    gl._bindRenderbuffer(target, buffer_id)\nend\n\nfunction gl.bindFramebuffer(target, buffer)\n    local buffer_id = 0\n\n    if \"number\" == type(buffer) then\n        buffer_id = buffer\n    elseif \"table\" == type(buffer) then\n        buffer_id = buffer.buffer_id\n    end\n\n    gl._bindFramebuffer(target, buffer_id)\nend\n\n--Uniform related\nfunction gl.getUniform(program, location)\n    local program_id = 0\n    local location_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    else\n        program_id = program.program_id\n    end\n\n    if \"number\" == type(location) then\n        location_id = location\n    else\n        location_id = location.location_id\n    end\n\n    return gl._getUniform(program_id, location_id)\nend\n\n--shader related\nfunction gl.compileShader(shader)\n    gl._compileShader( shader.shader_id)\nend\n\nfunction gl.shaderSource(shader, source)\n    gl._shaderSource(shader.shader_id, source)\nend\n\nfunction gl.getShaderParameter(shader, e)\n    return gl._getShaderParameter(shader.shader_id,e)\nend\n\nfunction gl.getShaderInfoLog( shader )\n    return gl._getShaderInfoLog(shader.shader_id)\nend\n\n--program related\nfunction gl.attachShader( program, shader )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._attachShader(program_id, shader.shader_id)\nend\n\nfunction gl.linkProgram( program )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._linkProgram(program_id)\nend\n\nfunction gl.getProgramParameter(program, e) \n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getProgramParameter(program_id, e)\nend\n\nfunction gl.useProgram(program)\n    local program_id = 0\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    gl._useProgram (program_id)\nend\n\nfunction gl.getAttribLocation(program, name )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getAttribLocation(program_id, name)\nend\n\nfunction gl.getUniformLocation( program, name )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getUniformLocation(program_id,name)\nend\n\nfunction gl.getActiveAttrib( program, index )\n    local program_id = 0\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getActiveAttrib(program_id, index);\nend\n\nfunction gl.getActiveUniform( program, index )\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getActiveUniform(program_id, index)\nend\n\nfunction gl.getAttachedShaders(program)\n    local program_id = 0\n\n    if \"number\" == type(program) then\n        program_id = program\n    elseif \"table\" == type(program) then\n        program_id = program.program_id\n    end\n\n    return gl._getAttachedShaders(program_id)\nend\n\nfunction gl.glNodeCreate()\n    return cc.GLNode:create()\nend\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/OpenglConstants.lua",
    "content": "--Encapsulate opengl constants. \ngl = gl or {} \n\ngl.GCCSO_SHADER_BINARY_FJ   = 0x9260\ngl._3DC_XY_AMD  = 0x87fa\ngl._3DC_X_AMD   = 0x87f9\ngl.ACTIVE_ATTRIBUTES    = 0x8b89\ngl.ACTIVE_ATTRIBUTE_MAX_LENGTH  = 0x8b8a\ngl.ACTIVE_PROGRAM_EXT   = 0x8259\ngl.ACTIVE_TEXTURE   = 0x84e0\ngl.ACTIVE_UNIFORMS  = 0x8b86\ngl.ACTIVE_UNIFORM_MAX_LENGTH    = 0x8b87\ngl.ALIASED_LINE_WIDTH_RANGE = 0x846e\ngl.ALIASED_POINT_SIZE_RANGE = 0x846d\ngl.ALL_COMPLETED_NV = 0x84f2\ngl.ALL_SHADER_BITS_EXT  = 0xffffffff\ngl.ALPHA    = 0x1906\ngl.ALPHA16F_EXT = 0x881c\ngl.ALPHA32F_EXT = 0x8816\ngl.ALPHA8_EXT   = 0x803c\ngl.ALPHA8_OES   = 0x803c\ngl.ALPHA_BITS   = 0xd55\ngl.ALPHA_TEST_FUNC_QCOM = 0xbc1\ngl.ALPHA_TEST_QCOM  = 0xbc0\ngl.ALPHA_TEST_REF_QCOM  = 0xbc2\ngl.ALREADY_SIGNALED_APPLE   = 0x911a\ngl.ALWAYS   = 0x207\ngl.AMD_compressed_3DC_texture   = 0x1\ngl.AMD_compressed_ATC_texture   = 0x1\ngl.AMD_performance_monitor  = 0x1\ngl.AMD_program_binary_Z400  = 0x1\ngl.ANGLE_depth_texture  = 0x1\ngl.ANGLE_framebuffer_blit   = 0x1\ngl.ANGLE_framebuffer_multisample    = 0x1\ngl.ANGLE_instanced_arrays   = 0x1\ngl.ANGLE_pack_reverse_row_order = 0x1\ngl.ANGLE_program_binary = 0x1\ngl.ANGLE_texture_compression_dxt3   = 0x1\ngl.ANGLE_texture_compression_dxt5   = 0x1\ngl.ANGLE_texture_usage  = 0x1\ngl.ANGLE_translated_shader_source   = 0x1\ngl.ANY_SAMPLES_PASSED_CONSERVATIVE_EXT  = 0x8d6a\ngl.ANY_SAMPLES_PASSED_EXT   = 0x8c2f\ngl.APPLE_copy_texture_levels    = 0x1\ngl.APPLE_framebuffer_multisample    = 0x1\ngl.APPLE_rgb_422    = 0x1\ngl.APPLE_sync   = 0x1\ngl.APPLE_texture_format_BGRA8888    = 0x1\ngl.APPLE_texture_max_level  = 0x1\ngl.ARM_mali_program_binary  = 0x1\ngl.ARM_mali_shader_binary   = 0x1\ngl.ARM_rgba8    = 0x1\ngl.ARRAY_BUFFER = 0x8892\ngl.ARRAY_BUFFER_BINDING = 0x8894\ngl.ATC_RGBA_EXPLICIT_ALPHA_AMD  = 0x8c93\ngl.ATC_RGBA_INTERPOLATED_ALPHA_AMD  = 0x87ee\ngl.ATC_RGB_AMD  = 0x8c92\ngl.ATTACHED_SHADERS = 0x8b85\ngl.BACK = 0x405\ngl.BGRA8_EXT    = 0x93a1\ngl.BGRA_EXT = 0x80e1\ngl.BGRA_IMG = 0x80e1\ngl.BINNING_CONTROL_HINT_QCOM    = 0x8fb0\ngl.BLEND    = 0xbe2\ngl.BLEND_COLOR  = 0x8005\ngl.BLEND_DST_ALPHA  = 0x80ca\ngl.BLEND_DST_RGB    = 0x80c8\ngl.BLEND_EQUATION   = 0x8009\ngl.BLEND_EQUATION_ALPHA = 0x883d\ngl.BLEND_EQUATION_RGB   = 0x8009\ngl.BLEND_SRC_ALPHA  = 0x80cb\ngl.BLEND_SRC_RGB    = 0x80c9\ngl.BLUE_BITS    = 0xd54\ngl.BOOL = 0x8b56\ngl.BOOL_VEC2    = 0x8b57\ngl.BOOL_VEC3    = 0x8b58\ngl.BOOL_VEC4    = 0x8b59\ngl.BUFFER   = 0x82e0\ngl.BUFFER_ACCESS_OES    = 0x88bb\ngl.BUFFER_MAPPED_OES    = 0x88bc\ngl.BUFFER_MAP_POINTER_OES   = 0x88bd\ngl.BUFFER_OBJECT_EXT    = 0x9151\ngl.BUFFER_SIZE  = 0x8764\ngl.BUFFER_USAGE = 0x8765\ngl.BYTE = 0x1400\ngl.CCW  = 0x901\ngl.CLAMP_TO_BORDER_NV   = 0x812d\ngl.CLAMP_TO_EDGE    = 0x812f\ngl.COLOR_ATTACHMENT0    = 0x8ce0\ngl.COLOR_ATTACHMENT0_NV = 0x8ce0\ngl.COLOR_ATTACHMENT10_NV    = 0x8cea\ngl.COLOR_ATTACHMENT11_NV    = 0x8ceb\ngl.COLOR_ATTACHMENT12_NV    = 0x8cec\ngl.COLOR_ATTACHMENT13_NV    = 0x8ced\ngl.COLOR_ATTACHMENT14_NV    = 0x8cee\ngl.COLOR_ATTACHMENT15_NV    = 0x8cef\ngl.COLOR_ATTACHMENT1_NV = 0x8ce1\ngl.COLOR_ATTACHMENT2_NV = 0x8ce2\ngl.COLOR_ATTACHMENT3_NV = 0x8ce3\ngl.COLOR_ATTACHMENT4_NV = 0x8ce4\ngl.COLOR_ATTACHMENT5_NV = 0x8ce5\ngl.COLOR_ATTACHMENT6_NV = 0x8ce6\ngl.COLOR_ATTACHMENT7_NV = 0x8ce7\ngl.COLOR_ATTACHMENT8_NV = 0x8ce8\ngl.COLOR_ATTACHMENT9_NV = 0x8ce9\ngl.COLOR_ATTACHMENT_EXT = 0x90f0\ngl.COLOR_BUFFER_BIT = 0x4000\ngl.COLOR_BUFFER_BIT0_QCOM   = 0x1\ngl.COLOR_BUFFER_BIT1_QCOM   = 0x2\ngl.COLOR_BUFFER_BIT2_QCOM   = 0x4\ngl.COLOR_BUFFER_BIT3_QCOM   = 0x8\ngl.COLOR_BUFFER_BIT4_QCOM   = 0x10\ngl.COLOR_BUFFER_BIT5_QCOM   = 0x20\ngl.COLOR_BUFFER_BIT6_QCOM   = 0x40\ngl.COLOR_BUFFER_BIT7_QCOM   = 0x80\ngl.COLOR_CLEAR_VALUE    = 0xc22\ngl.COLOR_EXT    = 0x1800\ngl.COLOR_WRITEMASK  = 0xc23\ngl.COMPARE_REF_TO_TEXTURE_EXT   = 0x884e\ngl.COMPILE_STATUS   = 0x8b81\ngl.COMPRESSED_RGBA_ASTC_10x10_KHR   = 0x93bb\ngl.COMPRESSED_RGBA_ASTC_10x5_KHR    = 0x93b8\ngl.COMPRESSED_RGBA_ASTC_10x6_KHR    = 0x93b9\ngl.COMPRESSED_RGBA_ASTC_10x8_KHR    = 0x93ba\ngl.COMPRESSED_RGBA_ASTC_12x10_KHR   = 0x93bc\ngl.COMPRESSED_RGBA_ASTC_12x12_KHR   = 0x93bd\ngl.COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93b0\ngl.COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93b1\ngl.COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93b2\ngl.COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93b3\ngl.COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93b4\ngl.COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93b5\ngl.COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93b6\ngl.COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93b7\ngl.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8c03\ngl.COMPRESSED_RGBA_PVRTC_2BPPV2_IMG = 0x9137\ngl.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8c02\ngl.COMPRESSED_RGBA_PVRTC_4BPPV2_IMG = 0x9138\ngl.COMPRESSED_RGBA_S3TC_DXT1_EXT    = 0x83f1\ngl.COMPRESSED_RGBA_S3TC_DXT3_ANGLE  = 0x83f2\ngl.COMPRESSED_RGBA_S3TC_DXT5_ANGLE  = 0x83f3\ngl.COMPRESSED_RGB_PVRTC_2BPPV1_IMG  = 0x8c01\ngl.COMPRESSED_RGB_PVRTC_4BPPV1_IMG  = 0x8c00\ngl.COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83f0\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR   = 0x93db\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR    = 0x93d8\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR    = 0x93d9\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR    = 0x93da\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR   = 0x93dc\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR   = 0x93dd\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93d0\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93d1\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93d2\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93d3\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93d4\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93d5\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93d6\ngl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93d7\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV   = 0x8c4d\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV   = 0x8c4e\ngl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV   = 0x8c4f\ngl.COMPRESSED_SRGB_S3TC_DXT1_NV = 0x8c4c\ngl.COMPRESSED_TEXTURE_FORMATS   = 0x86a3\ngl.CONDITION_SATISFIED_APPLE    = 0x911c\ngl.CONSTANT_ALPHA   = 0x8003\ngl.CONSTANT_COLOR   = 0x8001\ngl.CONTEXT_FLAG_DEBUG_BIT   = 0x2\ngl.CONTEXT_ROBUST_ACCESS_EXT    = 0x90f3\ngl.COUNTER_RANGE_AMD    = 0x8bc1\ngl.COUNTER_TYPE_AMD = 0x8bc0\ngl.COVERAGE_ALL_FRAGMENTS_NV    = 0x8ed5\ngl.COVERAGE_ATTACHMENT_NV   = 0x8ed2\ngl.COVERAGE_AUTOMATIC_NV    = 0x8ed7\ngl.COVERAGE_BUFFERS_NV  = 0x8ed3\ngl.COVERAGE_BUFFER_BIT_NV   = 0x8000\ngl.COVERAGE_COMPONENT4_NV   = 0x8ed1\ngl.COVERAGE_COMPONENT_NV    = 0x8ed0\ngl.COVERAGE_EDGE_FRAGMENTS_NV   = 0x8ed6\ngl.COVERAGE_SAMPLES_NV  = 0x8ed4\ngl.CPU_OPTIMIZED_QCOM   = 0x8fb1\ngl.CULL_FACE    = 0xb44\ngl.CULL_FACE_MODE   = 0xb45\ngl.CURRENT_PROGRAM  = 0x8b8d\ngl.CURRENT_QUERY_EXT    = 0x8865\ngl.CURRENT_VERTEX_ATTRIB    = 0x8626\ngl.CW   = 0x900\ngl.DEBUG_CALLBACK_FUNCTION  = 0x8244\ngl.DEBUG_CALLBACK_USER_PARAM    = 0x8245\ngl.DEBUG_GROUP_STACK_DEPTH  = 0x826d\ngl.DEBUG_LOGGED_MESSAGES    = 0x9145\ngl.DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243\ngl.DEBUG_OUTPUT = 0x92e0\ngl.DEBUG_OUTPUT_SYNCHRONOUS = 0x8242\ngl.DEBUG_SEVERITY_HIGH  = 0x9146\ngl.DEBUG_SEVERITY_LOW   = 0x9148\ngl.DEBUG_SEVERITY_MEDIUM    = 0x9147\ngl.DEBUG_SEVERITY_NOTIFICATION  = 0x826b\ngl.DEBUG_SOURCE_API = 0x8246\ngl.DEBUG_SOURCE_APPLICATION = 0x824a\ngl.DEBUG_SOURCE_OTHER   = 0x824b\ngl.DEBUG_SOURCE_SHADER_COMPILER = 0x8248\ngl.DEBUG_SOURCE_THIRD_PARTY = 0x8249\ngl.DEBUG_SOURCE_WINDOW_SYSTEM   = 0x8247\ngl.DEBUG_TYPE_DEPRECATED_BEHAVIOR   = 0x824d\ngl.DEBUG_TYPE_ERROR = 0x824c\ngl.DEBUG_TYPE_MARKER    = 0x8268\ngl.DEBUG_TYPE_OTHER = 0x8251\ngl.DEBUG_TYPE_PERFORMANCE   = 0x8250\ngl.DEBUG_TYPE_POP_GROUP = 0x826a\ngl.DEBUG_TYPE_PORTABILITY   = 0x824f\ngl.DEBUG_TYPE_PUSH_GROUP    = 0x8269\ngl.DEBUG_TYPE_UNDEFINED_BEHAVIOR    = 0x824e\ngl.DECR = 0x1e03\ngl.DECR_WRAP    = 0x8508\ngl.DELETE_STATUS    = 0x8b80\ngl.DEPTH24_STENCIL8_OES = 0x88f0\ngl.DEPTH_ATTACHMENT = 0x8d00\ngl.DEPTH_BITS   = 0xd56\ngl.DEPTH_BUFFER_BIT = 0x100\ngl.DEPTH_BUFFER_BIT0_QCOM   = 0x100\ngl.DEPTH_BUFFER_BIT1_QCOM   = 0x200\ngl.DEPTH_BUFFER_BIT2_QCOM   = 0x400\ngl.DEPTH_BUFFER_BIT3_QCOM   = 0x800\ngl.DEPTH_BUFFER_BIT4_QCOM   = 0x1000\ngl.DEPTH_BUFFER_BIT5_QCOM   = 0x2000\ngl.DEPTH_BUFFER_BIT6_QCOM   = 0x4000\ngl.DEPTH_BUFFER_BIT7_QCOM   = 0x8000\ngl.DEPTH_CLEAR_VALUE    = 0xb73\ngl.DEPTH_COMPONENT  = 0x1902\ngl.DEPTH_COMPONENT16    = 0x81a5\ngl.DEPTH_COMPONENT16_NONLINEAR_NV   = 0x8e2c\ngl.DEPTH_COMPONENT16_OES    = 0x81a5\ngl.DEPTH_COMPONENT24_OES    = 0x81a6\ngl.DEPTH_COMPONENT32_OES    = 0x81a7\ngl.DEPTH_EXT    = 0x1801\ngl.DEPTH_FUNC   = 0xb74\ngl.DEPTH_RANGE  = 0xb70\ngl.DEPTH_STENCIL_OES    = 0x84f9\ngl.DEPTH_TEST   = 0xb71\ngl.DEPTH_WRITEMASK  = 0xb72\ngl.DITHER   = 0xbd0\ngl.DMP_shader_binary    = 0x1\ngl.DONT_CARE    = 0x1100\ngl.DRAW_BUFFER0_NV  = 0x8825\ngl.DRAW_BUFFER10_NV = 0x882f\ngl.DRAW_BUFFER11_NV = 0x8830\ngl.DRAW_BUFFER12_NV = 0x8831\ngl.DRAW_BUFFER13_NV = 0x8832\ngl.DRAW_BUFFER14_NV = 0x8833\ngl.DRAW_BUFFER15_NV = 0x8834\ngl.DRAW_BUFFER1_NV  = 0x8826\ngl.DRAW_BUFFER2_NV  = 0x8827\ngl.DRAW_BUFFER3_NV  = 0x8828\ngl.DRAW_BUFFER4_NV  = 0x8829\ngl.DRAW_BUFFER5_NV  = 0x882a\ngl.DRAW_BUFFER6_NV  = 0x882b\ngl.DRAW_BUFFER7_NV  = 0x882c\ngl.DRAW_BUFFER8_NV  = 0x882d\ngl.DRAW_BUFFER9_NV  = 0x882e\ngl.DRAW_BUFFER_EXT  = 0xc01\ngl.DRAW_FRAMEBUFFER_ANGLE   = 0x8ca9\ngl.DRAW_FRAMEBUFFER_APPLE   = 0x8ca9\ngl.DRAW_FRAMEBUFFER_BINDING_ANGLE   = 0x8ca6\ngl.DRAW_FRAMEBUFFER_BINDING_APPLE   = 0x8ca6\ngl.DRAW_FRAMEBUFFER_BINDING_NV  = 0x8ca6\ngl.DRAW_FRAMEBUFFER_NV  = 0x8ca9\ngl.DST_ALPHA    = 0x304\ngl.DST_COLOR    = 0x306\ngl.DYNAMIC_DRAW = 0x88e8\ngl.ELEMENT_ARRAY_BUFFER = 0x8893\ngl.ELEMENT_ARRAY_BUFFER_BINDING = 0x8895\ngl.EQUAL    = 0x202\ngl.ES_VERSION_2_0   = 0x1\ngl.ETC1_RGB8_OES    = 0x8d64\ngl.ETC1_SRGB8_NV    = 0x88ee\ngl.EXTENSIONS   = 0x1f03\ngl.EXT_blend_minmax = 0x1\ngl.EXT_color_buffer_half_float  = 0x1\ngl.EXT_debug_label  = 0x1\ngl.EXT_debug_marker = 0x1\ngl.EXT_discard_framebuffer  = 0x1\ngl.EXT_map_buffer_range = 0x1\ngl.EXT_multi_draw_arrays    = 0x1\ngl.EXT_multisampled_render_to_texture   = 0x1\ngl.EXT_multiview_draw_buffers   = 0x1\ngl.EXT_occlusion_query_boolean  = 0x1\ngl.EXT_read_format_bgra = 0x1\ngl.EXT_robustness   = 0x1\ngl.EXT_sRGB = 0x1\ngl.EXT_separate_shader_objects  = 0x1\ngl.EXT_shader_framebuffer_fetch = 0x1\ngl.EXT_shader_texture_lod   = 0x1\ngl.EXT_shadow_samplers  = 0x1\ngl.EXT_texture_compression_dxt1 = 0x1\ngl.EXT_texture_filter_anisotropic   = 0x1\ngl.EXT_texture_format_BGRA8888  = 0x1\ngl.EXT_texture_rg   = 0x1\ngl.EXT_texture_storage  = 0x1\ngl.EXT_texture_type_2_10_10_10_REV  = 0x1\ngl.EXT_unpack_subimage  = 0x1\ngl.FALSE    = 0x0\ngl.FASTEST  = 0x1101\ngl.FENCE_CONDITION_NV   = 0x84f4\ngl.FENCE_STATUS_NV  = 0x84f3\ngl.FIXED    = 0x140c\ngl.FJ_shader_binary_GCCSO   = 0x1\ngl.FLOAT    = 0x1406\ngl.FLOAT_MAT2   = 0x8b5a\ngl.FLOAT_MAT3   = 0x8b5b\ngl.FLOAT_MAT4   = 0x8b5c\ngl.FLOAT_VEC2   = 0x8b50\ngl.FLOAT_VEC3   = 0x8b51\ngl.FLOAT_VEC4   = 0x8b52\ngl.FRAGMENT_SHADER  = 0x8b30\ngl.FRAGMENT_SHADER_BIT_EXT  = 0x2\ngl.FRAGMENT_SHADER_DERIVATIVE_HINT_OES  = 0x8b8b\ngl.FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8a52\ngl.FRAMEBUFFER  = 0x8d40\ngl.FRAMEBUFFER_ATTACHMENT_ANGLE = 0x93a3\ngl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT    = 0x8210\ngl.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT    = 0x8211\ngl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME   = 0x8cd1\ngl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE   = 0x8cd0\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES    = 0x8cd4\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8cd3\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8cd2\ngl.FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT   = 0x8d6c\ngl.FRAMEBUFFER_BINDING  = 0x8ca6\ngl.FRAMEBUFFER_COMPLETE = 0x8cd5\ngl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT    = 0x8cd6\ngl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS    = 0x8cd9\ngl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT    = 0x8cd7\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE = 0x8d56\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE = 0x8d56\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT   = 0x8d56\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG   = 0x9134\ngl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV    = 0x8d56\ngl.FRAMEBUFFER_UNDEFINED_OES    = 0x8219\ngl.FRAMEBUFFER_UNSUPPORTED  = 0x8cdd\ngl.FRONT    = 0x404\ngl.FRONT_AND_BACK   = 0x408\ngl.FRONT_FACE   = 0xb46\ngl.FUNC_ADD = 0x8006\ngl.FUNC_REVERSE_SUBTRACT    = 0x800b\ngl.FUNC_SUBTRACT    = 0x800a\ngl.GENERATE_MIPMAP_HINT = 0x8192\ngl.GEQUAL   = 0x206\ngl.GPU_OPTIMIZED_QCOM   = 0x8fb2\ngl.GREATER  = 0x204\ngl.GREEN_BITS   = 0xd53\ngl.GUILTY_CONTEXT_RESET_EXT = 0x8253\ngl.HALF_FLOAT_OES   = 0x8d61\ngl.HIGH_FLOAT   = 0x8df2\ngl.HIGH_INT = 0x8df5\ngl.IMG_multisampled_render_to_texture   = 0x1\ngl.IMG_program_binary   = 0x1\ngl.IMG_read_format  = 0x1\ngl.IMG_shader_binary    = 0x1\ngl.IMG_texture_compression_pvrtc    = 0x1\ngl.IMG_texture_compression_pvrtc2   = 0x1\ngl.IMPLEMENTATION_COLOR_READ_FORMAT = 0x8b9b\ngl.IMPLEMENTATION_COLOR_READ_TYPE   = 0x8b9a\ngl.INCR = 0x1e02\ngl.INCR_WRAP    = 0x8507\ngl.INFO_LOG_LENGTH  = 0x8b84\ngl.INNOCENT_CONTEXT_RESET_EXT   = 0x8254\ngl.INT  = 0x1404\ngl.INT_10_10_10_2_OES   = 0x8df7\ngl.INT_VEC2 = 0x8b53\ngl.INT_VEC3 = 0x8b54\ngl.INT_VEC4 = 0x8b55\ngl.INVALID_ENUM = 0x500\ngl.INVALID_FRAMEBUFFER_OPERATION    = 0x506\ngl.INVALID_OPERATION    = 0x502\ngl.INVALID_VALUE    = 0x501\ngl.INVERT   = 0x150a\ngl.KEEP = 0x1e00\ngl.KHR_debug    = 0x1\ngl.KHR_texture_compression_astc_ldr = 0x1\ngl.LEQUAL   = 0x203\ngl.LESS = 0x201\ngl.LINEAR   = 0x2601\ngl.LINEAR_MIPMAP_LINEAR = 0x2703\ngl.LINEAR_MIPMAP_NEAREST    = 0x2701\ngl.LINES    = 0x1\ngl.LINE_LOOP    = 0x2\ngl.LINE_STRIP   = 0x3\ngl.LINE_WIDTH   = 0xb21\ngl.LINK_STATUS  = 0x8b82\ngl.LOSE_CONTEXT_ON_RESET_EXT    = 0x8252\ngl.LOW_FLOAT    = 0x8df0\ngl.LOW_INT  = 0x8df3\ngl.LUMINANCE    = 0x1909\ngl.LUMINANCE16F_EXT = 0x881e\ngl.LUMINANCE32F_EXT = 0x8818\ngl.LUMINANCE4_ALPHA4_OES    = 0x8043\ngl.LUMINANCE8_ALPHA8_EXT    = 0x8045\ngl.LUMINANCE8_ALPHA8_OES    = 0x8045\ngl.LUMINANCE8_EXT   = 0x8040\ngl.LUMINANCE8_OES   = 0x8040\ngl.LUMINANCE_ALPHA  = 0x190a\ngl.LUMINANCE_ALPHA16F_EXT   = 0x881f\ngl.LUMINANCE_ALPHA32F_EXT   = 0x8819\ngl.MALI_PROGRAM_BINARY_ARM  = 0x8f61\ngl.MALI_SHADER_BINARY_ARM   = 0x8f60\ngl.MAP_FLUSH_EXPLICIT_BIT_EXT   = 0x10\ngl.MAP_INVALIDATE_BUFFER_BIT_EXT    = 0x8\ngl.MAP_INVALIDATE_RANGE_BIT_EXT = 0x4\ngl.MAP_READ_BIT_EXT = 0x1\ngl.MAP_UNSYNCHRONIZED_BIT_EXT   = 0x20\ngl.MAP_WRITE_BIT_EXT    = 0x2\ngl.MAX_3D_TEXTURE_SIZE_OES  = 0x8073\ngl.MAX_COLOR_ATTACHMENTS_NV = 0x8cdf\ngl.MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8b4d\ngl.MAX_CUBE_MAP_TEXTURE_SIZE    = 0x851c\ngl.MAX_DEBUG_GROUP_STACK_DEPTH  = 0x826c\ngl.MAX_DEBUG_LOGGED_MESSAGES    = 0x9144\ngl.MAX_DEBUG_MESSAGE_LENGTH = 0x9143\ngl.MAX_DRAW_BUFFERS_NV  = 0x8824\ngl.MAX_EXT  = 0x8008\ngl.MAX_FRAGMENT_UNIFORM_VECTORS = 0x8dfd\ngl.MAX_LABEL_LENGTH = 0x82e8\ngl.MAX_MULTIVIEW_BUFFERS_EXT    = 0x90f2\ngl.MAX_RENDERBUFFER_SIZE    = 0x84e8\ngl.MAX_SAMPLES_ANGLE    = 0x8d57\ngl.MAX_SAMPLES_APPLE    = 0x8d57\ngl.MAX_SAMPLES_EXT  = 0x8d57\ngl.MAX_SAMPLES_IMG  = 0x9135\ngl.MAX_SAMPLES_NV   = 0x8d57\ngl.MAX_SERVER_WAIT_TIMEOUT_APPLE    = 0x9111\ngl.MAX_TEXTURE_IMAGE_UNITS  = 0x8872\ngl.MAX_TEXTURE_MAX_ANISOTROPY_EXT   = 0x84ff\ngl.MAX_TEXTURE_SIZE = 0xd33\ngl.MAX_VARYING_VECTORS  = 0x8dfc\ngl.MAX_VERTEX_ATTRIBS   = 0x8869\ngl.MAX_VERTEX_TEXTURE_IMAGE_UNITS   = 0x8b4c\ngl.MAX_VERTEX_UNIFORM_VECTORS   = 0x8dfb\ngl.MAX_VIEWPORT_DIMS    = 0xd3a\ngl.MEDIUM_FLOAT = 0x8df1\ngl.MEDIUM_INT   = 0x8df4\ngl.MIN_EXT  = 0x8007\ngl.MIRRORED_REPEAT  = 0x8370\ngl.MULTISAMPLE_BUFFER_BIT0_QCOM = 0x1000000\ngl.MULTISAMPLE_BUFFER_BIT1_QCOM = 0x2000000\ngl.MULTISAMPLE_BUFFER_BIT2_QCOM = 0x4000000\ngl.MULTISAMPLE_BUFFER_BIT3_QCOM = 0x8000000\ngl.MULTISAMPLE_BUFFER_BIT4_QCOM = 0x10000000\ngl.MULTISAMPLE_BUFFER_BIT5_QCOM = 0x20000000\ngl.MULTISAMPLE_BUFFER_BIT6_QCOM = 0x40000000\ngl.MULTISAMPLE_BUFFER_BIT7_QCOM = 0x80000000\ngl.MULTIVIEW_EXT    = 0x90f1\ngl.NEAREST  = 0x2600\ngl.NEAREST_MIPMAP_LINEAR    = 0x2702\ngl.NEAREST_MIPMAP_NEAREST   = 0x2700\ngl.NEVER    = 0x200\ngl.NICEST   = 0x1102\ngl.NONE = 0x0\ngl.NOTEQUAL = 0x205\ngl.NO_ERROR = 0x0\ngl.NO_RESET_NOTIFICATION_EXT    = 0x8261\ngl.NUM_COMPRESSED_TEXTURE_FORMATS   = 0x86a2\ngl.NUM_PROGRAM_BINARY_FORMATS_OES   = 0x87fe\ngl.NUM_SHADER_BINARY_FORMATS    = 0x8df9\ngl.NV_coverage_sample   = 0x1\ngl.NV_depth_nonlinear   = 0x1\ngl.NV_draw_buffers  = 0x1\ngl.NV_draw_instanced    = 0x1\ngl.NV_fbo_color_attachments = 0x1\ngl.NV_fence = 0x1\ngl.NV_framebuffer_blit  = 0x1\ngl.NV_framebuffer_multisample   = 0x1\ngl.NV_generate_mipmap_sRGB  = 0x1\ngl.NV_instanced_arrays  = 0x1\ngl.NV_read_buffer   = 0x1\ngl.NV_read_buffer_front = 0x1\ngl.NV_read_depth    = 0x1\ngl.NV_read_depth_stencil    = 0x1\ngl.NV_read_stencil  = 0x1\ngl.NV_sRGB_formats  = 0x1\ngl.NV_shadow_samplers_array = 0x1\ngl.NV_shadow_samplers_cube  = 0x1\ngl.NV_texture_border_clamp  = 0x1\ngl.NV_texture_compression_s3tc_update   = 0x1\ngl.NV_texture_npot_2D_mipmap    = 0x1\ngl.OBJECT_TYPE_APPLE    = 0x9112\ngl.OES_EGL_image    = 0x1\ngl.OES_EGL_image_external   = 0x1\ngl.OES_compressed_ETC1_RGB8_texture = 0x1\ngl.OES_compressed_paletted_texture  = 0x1\ngl.OES_depth24  = 0x1\ngl.OES_depth32  = 0x1\ngl.OES_depth_texture    = 0x1\ngl.OES_element_index_uint   = 0x1\ngl.OES_fbo_render_mipmap    = 0x1\ngl.OES_fragment_precision_high  = 0x1\ngl.OES_get_program_binary   = 0x1\ngl.OES_mapbuffer    = 0x1\ngl.OES_packed_depth_stencil = 0x1\ngl.OES_required_internalformat  = 0x1\ngl.OES_rgb8_rgba8   = 0x1\ngl.OES_standard_derivatives = 0x1\ngl.OES_stencil1 = 0x1\ngl.OES_stencil4 = 0x1\ngl.OES_surfaceless_context  = 0x1\ngl.OES_texture_3D   = 0x1\ngl.OES_texture_float    = 0x1\ngl.OES_texture_float_linear = 0x1\ngl.OES_texture_half_float   = 0x1\ngl.OES_texture_half_float_linear    = 0x1\ngl.OES_texture_npot = 0x1\ngl.OES_vertex_array_object  = 0x1\ngl.OES_vertex_half_float    = 0x1\ngl.OES_vertex_type_10_10_10_2   = 0x1\ngl.ONE  = 0x1\ngl.ONE_MINUS_CONSTANT_ALPHA = 0x8004\ngl.ONE_MINUS_CONSTANT_COLOR = 0x8002\ngl.ONE_MINUS_DST_ALPHA  = 0x305\ngl.ONE_MINUS_DST_COLOR  = 0x307\ngl.ONE_MINUS_SRC_ALPHA  = 0x303\ngl.ONE_MINUS_SRC_COLOR  = 0x301\ngl.OUT_OF_MEMORY    = 0x505\ngl.PACK_ALIGNMENT   = 0xd05\ngl.PACK_REVERSE_ROW_ORDER_ANGLE = 0x93a4\ngl.PALETTE4_R5_G6_B5_OES    = 0x8b92\ngl.PALETTE4_RGB5_A1_OES = 0x8b94\ngl.PALETTE4_RGB8_OES    = 0x8b90\ngl.PALETTE4_RGBA4_OES   = 0x8b93\ngl.PALETTE4_RGBA8_OES   = 0x8b91\ngl.PALETTE8_R5_G6_B5_OES    = 0x8b97\ngl.PALETTE8_RGB5_A1_OES = 0x8b99\ngl.PALETTE8_RGB8_OES    = 0x8b95\ngl.PALETTE8_RGBA4_OES   = 0x8b98\ngl.PALETTE8_RGBA8_OES   = 0x8b96\ngl.PERCENTAGE_AMD   = 0x8bc3\ngl.PERFMON_GLOBAL_MODE_QCOM = 0x8fa0\ngl.PERFMON_RESULT_AMD   = 0x8bc6\ngl.PERFMON_RESULT_AVAILABLE_AMD = 0x8bc4\ngl.PERFMON_RESULT_SIZE_AMD  = 0x8bc5\ngl.POINTS   = 0x0\ngl.POLYGON_OFFSET_FACTOR    = 0x8038\ngl.POLYGON_OFFSET_FILL  = 0x8037\ngl.POLYGON_OFFSET_UNITS = 0x2a00\ngl.PROGRAM  = 0x82e2\ngl.PROGRAM_BINARY_ANGLE = 0x93a6\ngl.PROGRAM_BINARY_FORMATS_OES   = 0x87ff\ngl.PROGRAM_BINARY_LENGTH_OES    = 0x8741\ngl.PROGRAM_OBJECT_EXT   = 0x8b40\ngl.PROGRAM_PIPELINE_BINDING_EXT = 0x825a\ngl.PROGRAM_PIPELINE_OBJECT_EXT  = 0x8a4f\ngl.PROGRAM_SEPARABLE_EXT    = 0x8258\ngl.QCOM_alpha_test  = 0x1\ngl.QCOM_binning_control = 0x1\ngl.QCOM_driver_control  = 0x1\ngl.QCOM_extended_get    = 0x1\ngl.QCOM_extended_get2   = 0x1\ngl.QCOM_perfmon_global_mode = 0x1\ngl.QCOM_tiled_rendering = 0x1\ngl.QCOM_writeonly_rendering = 0x1\ngl.QUERY    = 0x82e3\ngl.QUERY_OBJECT_EXT = 0x9153\ngl.QUERY_RESULT_AVAILABLE_EXT   = 0x8867\ngl.QUERY_RESULT_EXT = 0x8866\ngl.R16F_EXT = 0x822d\ngl.R32F_EXT = 0x822e\ngl.R8_EXT   = 0x8229\ngl.READ_BUFFER_EXT  = 0xc02\ngl.READ_BUFFER_NV   = 0xc02\ngl.READ_FRAMEBUFFER_ANGLE   = 0x8ca8\ngl.READ_FRAMEBUFFER_APPLE   = 0x8ca8\ngl.READ_FRAMEBUFFER_BINDING_ANGLE   = 0x8caa\ngl.READ_FRAMEBUFFER_BINDING_APPLE   = 0x8caa\ngl.READ_FRAMEBUFFER_BINDING_NV  = 0x8caa\ngl.READ_FRAMEBUFFER_NV  = 0x8ca8\ngl.RED_BITS = 0xd52\ngl.RED_EXT  = 0x1903\ngl.RENDERBUFFER = 0x8d41\ngl.RENDERBUFFER_ALPHA_SIZE  = 0x8d53\ngl.RENDERBUFFER_BINDING = 0x8ca7\ngl.RENDERBUFFER_BLUE_SIZE   = 0x8d52\ngl.RENDERBUFFER_DEPTH_SIZE  = 0x8d54\ngl.RENDERBUFFER_GREEN_SIZE  = 0x8d51\ngl.RENDERBUFFER_HEIGHT  = 0x8d43\ngl.RENDERBUFFER_INTERNAL_FORMAT = 0x8d44\ngl.RENDERBUFFER_RED_SIZE    = 0x8d50\ngl.RENDERBUFFER_SAMPLES_ANGLE   = 0x8cab\ngl.RENDERBUFFER_SAMPLES_APPLE   = 0x8cab\ngl.RENDERBUFFER_SAMPLES_EXT = 0x8cab\ngl.RENDERBUFFER_SAMPLES_IMG = 0x9133\ngl.RENDERBUFFER_SAMPLES_NV  = 0x8cab\ngl.RENDERBUFFER_STENCIL_SIZE    = 0x8d55\ngl.RENDERBUFFER_WIDTH   = 0x8d42\ngl.RENDERER = 0x1f01\ngl.RENDER_DIRECT_TO_FRAMEBUFFER_QCOM    = 0x8fb3\ngl.REPEAT   = 0x2901\ngl.REPLACE  = 0x1e01\ngl.REQUIRED_TEXTURE_IMAGE_UNITS_OES = 0x8d68\ngl.RESET_NOTIFICATION_STRATEGY_EXT  = 0x8256\ngl.RG16F_EXT    = 0x822f\ngl.RG32F_EXT    = 0x8230\ngl.RG8_EXT  = 0x822b\ngl.RGB  = 0x1907\ngl.RGB10_A2_EXT = 0x8059\ngl.RGB10_EXT    = 0x8052\ngl.RGB16F_EXT   = 0x881b\ngl.RGB32F_EXT   = 0x8815\ngl.RGB565   = 0x8d62\ngl.RGB565_OES   = 0x8d62\ngl.RGB5_A1  = 0x8057\ngl.RGB5_A1_OES  = 0x8057\ngl.RGB8_OES = 0x8051\ngl.RGBA = 0x1908\ngl.RGBA16F_EXT  = 0x881a\ngl.RGBA32F_EXT  = 0x8814\ngl.RGBA4    = 0x8056\ngl.RGBA4_OES    = 0x8056\ngl.RGBA8_OES    = 0x8058\ngl.RGB_422_APPLE    = 0x8a1f\ngl.RG_EXT   = 0x8227\ngl.SAMPLER  = 0x82e6\ngl.SAMPLER_2D   = 0x8b5e\ngl.SAMPLER_2D_ARRAY_SHADOW_NV   = 0x8dc4\ngl.SAMPLER_2D_SHADOW_EXT    = 0x8b62\ngl.SAMPLER_3D_OES   = 0x8b5f\ngl.SAMPLER_CUBE = 0x8b60\ngl.SAMPLER_CUBE_SHADOW_NV   = 0x8dc5\ngl.SAMPLER_EXTERNAL_OES = 0x8d66\ngl.SAMPLES  = 0x80a9\ngl.SAMPLE_ALPHA_TO_COVERAGE = 0x809e\ngl.SAMPLE_BUFFERS   = 0x80a8\ngl.SAMPLE_COVERAGE  = 0x80a0\ngl.SAMPLE_COVERAGE_INVERT   = 0x80ab\ngl.SAMPLE_COVERAGE_VALUE    = 0x80aa\ngl.SCISSOR_BOX  = 0xc10\ngl.SCISSOR_TEST = 0xc11\ngl.SGX_BINARY_IMG   = 0x8c0a\ngl.SGX_PROGRAM_BINARY_IMG   = 0x9130\ngl.SHADER   = 0x82e1\ngl.SHADER_BINARY_DMP    = 0x9250\ngl.SHADER_BINARY_FORMATS    = 0x8df8\ngl.SHADER_BINARY_VIV    = 0x8fc4\ngl.SHADER_COMPILER  = 0x8dfa\ngl.SHADER_OBJECT_EXT    = 0x8b48\ngl.SHADER_SOURCE_LENGTH = 0x8b88\ngl.SHADER_TYPE  = 0x8b4f\ngl.SHADING_LANGUAGE_VERSION = 0x8b8c\ngl.SHORT    = 0x1402\ngl.SIGNALED_APPLE   = 0x9119\ngl.SLUMINANCE8_ALPHA8_NV    = 0x8c45\ngl.SLUMINANCE8_NV   = 0x8c47\ngl.SLUMINANCE_ALPHA_NV  = 0x8c44\ngl.SLUMINANCE_NV    = 0x8c46\ngl.SRC_ALPHA    = 0x302\ngl.SRC_ALPHA_SATURATE   = 0x308\ngl.SRC_COLOR    = 0x300\ngl.SRGB8_ALPHA8_EXT = 0x8c43\ngl.SRGB8_NV = 0x8c41\ngl.SRGB_ALPHA_EXT   = 0x8c42\ngl.SRGB_EXT = 0x8c40\ngl.STACK_OVERFLOW   = 0x503\ngl.STACK_UNDERFLOW  = 0x504\ngl.STATE_RESTORE    = 0x8bdc\ngl.STATIC_DRAW  = 0x88e4\ngl.STENCIL_ATTACHMENT   = 0x8d20\ngl.STENCIL_BACK_FAIL    = 0x8801\ngl.STENCIL_BACK_FUNC    = 0x8800\ngl.STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802\ngl.STENCIL_BACK_PASS_DEPTH_PASS = 0x8803\ngl.STENCIL_BACK_REF = 0x8ca3\ngl.STENCIL_BACK_VALUE_MASK  = 0x8ca4\ngl.STENCIL_BACK_WRITEMASK   = 0x8ca5\ngl.STENCIL_BITS = 0xd57\ngl.STENCIL_BUFFER_BIT   = 0x400\ngl.STENCIL_BUFFER_BIT0_QCOM = 0x10000\ngl.STENCIL_BUFFER_BIT1_QCOM = 0x20000\ngl.STENCIL_BUFFER_BIT2_QCOM = 0x40000\ngl.STENCIL_BUFFER_BIT3_QCOM = 0x80000\ngl.STENCIL_BUFFER_BIT4_QCOM = 0x100000\ngl.STENCIL_BUFFER_BIT5_QCOM = 0x200000\ngl.STENCIL_BUFFER_BIT6_QCOM = 0x400000\ngl.STENCIL_BUFFER_BIT7_QCOM = 0x800000\ngl.STENCIL_CLEAR_VALUE  = 0xb91\ngl.STENCIL_EXT  = 0x1802\ngl.STENCIL_FAIL = 0xb94\ngl.STENCIL_FUNC = 0xb92\ngl.STENCIL_INDEX1_OES   = 0x8d46\ngl.STENCIL_INDEX4_OES   = 0x8d47\ngl.STENCIL_INDEX8   = 0x8d48\ngl.STENCIL_PASS_DEPTH_FAIL  = 0xb95\ngl.STENCIL_PASS_DEPTH_PASS  = 0xb96\ngl.STENCIL_REF  = 0xb97\ngl.STENCIL_TEST = 0xb90\ngl.STENCIL_VALUE_MASK   = 0xb93\ngl.STENCIL_WRITEMASK    = 0xb98\ngl.STREAM_DRAW  = 0x88e0\ngl.SUBPIXEL_BITS    = 0xd50\ngl.SYNC_CONDITION_APPLE = 0x9113\ngl.SYNC_FENCE_APPLE = 0x9116\ngl.SYNC_FLAGS_APPLE = 0x9115\ngl.SYNC_FLUSH_COMMANDS_BIT_APPLE    = 0x1\ngl.SYNC_GPU_COMMANDS_COMPLETE_APPLE = 0x9117\ngl.SYNC_OBJECT_APPLE    = 0x8a53\ngl.SYNC_STATUS_APPLE    = 0x9114\ngl.TEXTURE  = 0x1702\ngl.TEXTURE0 = 0x84c0\ngl.TEXTURE1 = 0x84c1\ngl.TEXTURE10    = 0x84ca\ngl.TEXTURE11    = 0x84cb\ngl.TEXTURE12    = 0x84cc\ngl.TEXTURE13    = 0x84cd\ngl.TEXTURE14    = 0x84ce\ngl.TEXTURE15    = 0x84cf\ngl.TEXTURE16    = 0x84d0\ngl.TEXTURE17    = 0x84d1\ngl.TEXTURE18    = 0x84d2\ngl.TEXTURE19    = 0x84d3\ngl.TEXTURE2 = 0x84c2\ngl.TEXTURE20    = 0x84d4\ngl.TEXTURE21    = 0x84d5\ngl.TEXTURE22    = 0x84d6\ngl.TEXTURE23    = 0x84d7\ngl.TEXTURE24    = 0x84d8\ngl.TEXTURE25    = 0x84d9\ngl.TEXTURE26    = 0x84da\ngl.TEXTURE27    = 0x84db\ngl.TEXTURE28    = 0x84dc\ngl.TEXTURE29    = 0x84dd\ngl.TEXTURE3 = 0x84c3\ngl.TEXTURE30    = 0x84de\ngl.TEXTURE31    = 0x84df\ngl.TEXTURE4 = 0x84c4\ngl.TEXTURE5 = 0x84c5\ngl.TEXTURE6 = 0x84c6\ngl.TEXTURE7 = 0x84c7\ngl.TEXTURE8 = 0x84c8\ngl.TEXTURE9 = 0x84c9\ngl.TEXTURE_2D   = 0xde1\ngl.TEXTURE_3D_OES   = 0x806f\ngl.TEXTURE_BINDING_2D   = 0x8069\ngl.TEXTURE_BINDING_3D_OES   = 0x806a\ngl.TEXTURE_BINDING_CUBE_MAP = 0x8514\ngl.TEXTURE_BINDING_EXTERNAL_OES = 0x8d67\ngl.TEXTURE_BORDER_COLOR_NV  = 0x1004\ngl.TEXTURE_COMPARE_FUNC_EXT = 0x884d\ngl.TEXTURE_COMPARE_MODE_EXT = 0x884c\ngl.TEXTURE_CUBE_MAP = 0x8513\ngl.TEXTURE_CUBE_MAP_NEGATIVE_X  = 0x8516\ngl.TEXTURE_CUBE_MAP_NEGATIVE_Y  = 0x8518\ngl.TEXTURE_CUBE_MAP_NEGATIVE_Z  = 0x851a\ngl.TEXTURE_CUBE_MAP_POSITIVE_X  = 0x8515\ngl.TEXTURE_CUBE_MAP_POSITIVE_Y  = 0x8517\ngl.TEXTURE_CUBE_MAP_POSITIVE_Z  = 0x8519\ngl.TEXTURE_DEPTH_QCOM   = 0x8bd4\ngl.TEXTURE_EXTERNAL_OES = 0x8d65\ngl.TEXTURE_FORMAT_QCOM  = 0x8bd6\ngl.TEXTURE_HEIGHT_QCOM  = 0x8bd3\ngl.TEXTURE_IMAGE_VALID_QCOM = 0x8bd8\ngl.TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912f\ngl.TEXTURE_INTERNAL_FORMAT_QCOM = 0x8bd5\ngl.TEXTURE_MAG_FILTER   = 0x2800\ngl.TEXTURE_MAX_ANISOTROPY_EXT   = 0x84fe\ngl.TEXTURE_MAX_LEVEL_APPLE  = 0x813d\ngl.TEXTURE_MIN_FILTER   = 0x2801\ngl.TEXTURE_NUM_LEVELS_QCOM  = 0x8bd9\ngl.TEXTURE_OBJECT_VALID_QCOM    = 0x8bdb\ngl.TEXTURE_SAMPLES_IMG  = 0x9136\ngl.TEXTURE_TARGET_QCOM  = 0x8bda\ngl.TEXTURE_TYPE_QCOM    = 0x8bd7\ngl.TEXTURE_USAGE_ANGLE  = 0x93a2\ngl.TEXTURE_WIDTH_QCOM   = 0x8bd2\ngl.TEXTURE_WRAP_R_OES   = 0x8072\ngl.TEXTURE_WRAP_S   = 0x2802\ngl.TEXTURE_WRAP_T   = 0x2803\ngl.TIMEOUT_EXPIRED_APPLE    = 0x911b\ngl.TIMEOUT_IGNORED_APPLE    = 0xffffffffffffffff\ngl.TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE    = 0x93a0\ngl.TRIANGLES    = 0x4\ngl.TRIANGLE_FAN = 0x6\ngl.TRIANGLE_STRIP   = 0x5\ngl.TRUE = 0x1\ngl.UNKNOWN_CONTEXT_RESET_EXT    = 0x8255\ngl.UNPACK_ALIGNMENT = 0xcf5\ngl.UNPACK_ROW_LENGTH    = 0xcf2\ngl.UNPACK_SKIP_PIXELS   = 0xcf4\ngl.UNPACK_SKIP_ROWS = 0xcf3\ngl.UNSIGNALED_APPLE = 0x9118\ngl.UNSIGNED_BYTE    = 0x1401\ngl.UNSIGNED_INT = 0x1405\ngl.UNSIGNED_INT64_AMD   = 0x8bc2\ngl.UNSIGNED_INT_10_10_10_2_OES  = 0x8df6\ngl.UNSIGNED_INT_24_8_OES    = 0x84fa\ngl.UNSIGNED_INT_2_10_10_10_REV_EXT  = 0x8368\ngl.UNSIGNED_NORMALIZED_EXT  = 0x8c17\ngl.UNSIGNED_SHORT   = 0x1403\ngl.UNSIGNED_SHORT_1_5_5_5_REV_EXT   = 0x8366\ngl.UNSIGNED_SHORT_4_4_4_4   = 0x8033\ngl.UNSIGNED_SHORT_4_4_4_4_REV_EXT   = 0x8365\ngl.UNSIGNED_SHORT_4_4_4_4_REV_IMG   = 0x8365\ngl.UNSIGNED_SHORT_5_5_5_1   = 0x8034\ngl.UNSIGNED_SHORT_5_6_5 = 0x8363\ngl.UNSIGNED_SHORT_8_8_APPLE = 0x85ba\ngl.UNSIGNED_SHORT_8_8_REV_APPLE = 0x85bb\ngl.VALIDATE_STATUS  = 0x8b83\ngl.VENDOR   = 0x1f00\ngl.VERSION  = 0x1f02\ngl.VERTEX_ARRAY_BINDING_OES = 0x85b5\ngl.VERTEX_ARRAY_OBJECT_EXT  = 0x9154\ngl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING   = 0x889f\ngl.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE    = 0x88fe\ngl.VERTEX_ATTRIB_ARRAY_DIVISOR_NV   = 0x88fe\ngl.VERTEX_ATTRIB_ARRAY_ENABLED  = 0x8622\ngl.VERTEX_ATTRIB_ARRAY_NORMALIZED   = 0x886a\ngl.VERTEX_ATTRIB_ARRAY_POINTER  = 0x8645\ngl.VERTEX_ATTRIB_ARRAY_SIZE = 0x8623\ngl.VERTEX_ATTRIB_ARRAY_STRIDE   = 0x8624\ngl.VERTEX_ATTRIB_ARRAY_TYPE = 0x8625\ngl.VERTEX_SHADER    = 0x8b31\ngl.VERTEX_SHADER_BIT_EXT    = 0x1\ngl.VIEWPORT = 0xba2\ngl.VIV_shader_binary    = 0x1\ngl.WAIT_FAILED_APPLE    = 0x911d\ngl.WRITEONLY_RENDERING_QCOM = 0x8823\ngl.WRITE_ONLY_OES   = 0x88b9\ngl.Z400_BINARY_AMD  = 0x8740\ngl.ZERO = 0x0\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/StudioConstants.lua",
    "content": "ccs = ccs or {}\n\n\nccs.MovementEventType = {\n    start = 0,\n    complete = 1,\n    loopComplete = 2, \n}\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/extern.lua",
    "content": "function clone(object)\n    local lookup_table = {}\n    local function _copy(object)\n        if type(object) ~= \"table\" then\n            return object\n        elseif lookup_table[object] then\n            return lookup_table[object]\n        end\n        local new_table = {}\n        lookup_table[object] = new_table\n        for key, value in pairs(object) do\n            new_table[_copy(key)] = _copy(value)\n        end\n        return setmetatable(new_table, getmetatable(object))\n    end\n    return _copy(object)\nend\n\n--Create an class.\nfunction class(classname, super)\n    local superType = type(super)\n    local cls\n\n    if superType ~= \"function\" and superType ~= \"table\" then\n        superType = nil\n        super = nil\n    end\n\n    if superType == \"function\" or (super and super.__ctype == 1) then\n        -- inherited from native C++ Object\n        cls = {}\n\n        if superType == \"table\" then\n            -- copy fields from super\n            for k,v in pairs(super) do cls[k] = v end\n            cls.__create = super.__create\n            cls.super    = super\n        else\n            cls.__create = super\n        end\n\n        cls.ctor    = function() end\n        cls.__cname = classname\n        cls.__ctype = 1\n\n        function cls.new(...)\n            local instance = cls.__create(...)\n            -- copy fields from class to native object\n            for k,v in pairs(cls) do instance[k] = v end\n            instance.class = cls\n            instance:ctor(...)\n            return instance\n        end\n\n    else\n        -- inherited from Lua Object\n        if super then\n            cls = clone(super)\n            cls.super = super\n        else\n            cls = {ctor = function() end}\n        end\n\n        cls.__cname = classname\n        cls.__ctype = 2 -- lua\n        cls.__index = cls\n\n        function cls.new(...)\n            local instance = setmetatable({}, cls)\n            instance.class = cls\n            instance:ctor(...)\n            return instance\n        end\n    end\n\n    return cls\nend\n\nfunction schedule(node, callback, delay)\n    local delay = cc.DelayTime:create(delay)\n    local sequence = cc.Sequence:create(delay, cc.CallFunc:create(callback))\n    local action = cc.RepeatForever:create(sequence)\n    node:runAction(action)\n    return action\nend\n\nfunction performWithDelay(node, callback, delay)\n    local delay = cc.DelayTime:create(delay)\n    local sequence = cc.Sequence:create(delay, cc.CallFunc:create(callback))\n    node:runAction(sequence)\n    return sequence\nend\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/json.lua",
    "content": "-----------------------------------------------------------------------------\n-- JSON4Lua: JSON encoding / decoding support for the Lua language.\n-- json Module.\n-- Author: Craig Mason-Jones\n-- Homepage: http://json.luaforge.net/\n-- Version: 0.9.40\n-- This module is released under the MIT License (MIT).\n-- Please see LICENCE.txt for details.\n--\n-- USAGE:\n-- This module exposes two functions:\n--   encode(o)\n--     Returns the table / string / boolean / number / nil / json.null value as a JSON-encoded string.\n--   decode(json_string)\n--     Returns a Lua object populated with the data encoded in the JSON string json_string.\n--\n-- REQUIREMENTS:\n--   compat-5.1 if using Lua 5.0\n--\n-- CHANGELOG\n--   0.9.20 Introduction of local Lua functions for private functions (removed _ function prefix). \n--          Fixed Lua 5.1 compatibility issues.\n--   \t\tIntroduced json.null to have null values in associative arrays.\n--          encode() performance improvement (more than 50%) through table.concat rather than ..\n--          Introduced decode ability to ignore /**/ comments in the JSON string.\n--   0.9.10 Fix to array encoding / decoding to correctly manage nil/null values in arrays.\n-----------------------------------------------------------------------------\n\n-----------------------------------------------------------------------------\n-- Imports and dependencies\n-----------------------------------------------------------------------------\nlocal math = require('math')\nlocal string = require(\"string\")\nlocal table = require(\"table\")\n\nlocal base = _G\n\n-----------------------------------------------------------------------------\n-- Module declaration\n-----------------------------------------------------------------------------\nmodule(\"json\")\n\n-- Public functions\n\n-- Private functions\nlocal decode_scanArray\nlocal decode_scanComment\nlocal decode_scanConstant\nlocal decode_scanNumber\nlocal decode_scanObject\nlocal decode_scanString\nlocal decode_scanWhitespace\nlocal encodeString\nlocal isArray\nlocal isEncodable\n\n-----------------------------------------------------------------------------\n-- PUBLIC FUNCTIONS\n-----------------------------------------------------------------------------\n--- Encodes an arbitrary Lua object / variable.\n-- @param v The Lua object / variable to be JSON encoded.\n-- @return String containing the JSON encoding in internal Lua string format (i.e. not unicode)\nfunction encode (v)\n  -- Handle nil values\n  if v==nil then\n    return \"null\"\n  end\n  \n  local vtype = base.type(v)  \n\n  -- Handle strings\n  if vtype=='string' then    \n    return '\"' .. encodeString(v) .. '\"'\t    -- Need to handle encoding in string\n  end\n  \n  -- Handle booleans\n  if vtype=='number' or vtype=='boolean' then\n    return base.tostring(v)\n  end\n  \n  -- Handle tables\n  if vtype=='table' then\n    local rval = {}\n    -- Consider arrays separately\n    local bArray, maxCount = isArray(v)\n    if bArray then\n      for i = 1,maxCount do\n        table.insert(rval, encode(v[i]))\n      end\n    else\t-- An object, not an array\n      for i,j in base.pairs(v) do\n        if isEncodable(i) and isEncodable(j) then\n          table.insert(rval, '\"' .. encodeString(i) .. '\":' .. encode(j))\n        end\n      end\n    end\n    if bArray then\n      return '[' .. table.concat(rval,',') ..']'\n    else\n      return '{' .. table.concat(rval,',') .. '}'\n    end\n  end\n  \n  -- Handle null values\n  if vtype=='function' and v==null then\n    return 'null'\n  end\n  \n  base.assert(false,'encode attempt to encode unsupported type ' .. vtype .. ':' .. base.tostring(v))\nend\n\n\n--- Decodes a JSON string and returns the decoded value as a Lua data structure / value.\n-- @param s The string to scan.\n-- @param [startPos] Optional starting position where the JSON string is located. Defaults to 1.\n-- @param Lua object, number The object that was scanned, as a Lua table / string / number / boolean or nil,\n-- and the position of the first character after\n-- the scanned JSON object.\nfunction decode(s, startPos)\n  startPos = startPos and startPos or 1\n  startPos = decode_scanWhitespace(s,startPos)\n  base.assert(startPos<=string.len(s), 'Unterminated JSON encoded object found at position in [' .. s .. ']')\n  local curChar = string.sub(s,startPos,startPos)\n  -- Object\n  if curChar=='{' then\n    return decode_scanObject(s,startPos)\n  end\n  -- Array\n  if curChar=='[' then\n    return decode_scanArray(s,startPos)\n  end\n  -- Number\n  if string.find(\"+-0123456789.e\", curChar, 1, true) then\n    return decode_scanNumber(s,startPos)\n  end\n  -- String\n  if curChar==[[\"]] or curChar==[[']] then\n    return decode_scanString(s,startPos)\n  end\n  if string.sub(s,startPos,startPos+1)=='/*' then\n    return decode(s, decode_scanComment(s,startPos))\n  end\n  -- Otherwise, it must be a constant\n  return decode_scanConstant(s,startPos)\nend\n\n--- The null function allows one to specify a null value in an associative array (which is otherwise\n-- discarded if you set the value with 'nil' in Lua. Simply set t = { first=json.null }\nfunction null()\n  return null -- so json.null() will also return null ;-)\nend\n-----------------------------------------------------------------------------\n-- Internal, PRIVATE functions.\n-- Following a Python-like convention, I have prefixed all these 'PRIVATE'\n-- functions with an underscore.\n-----------------------------------------------------------------------------\n\n--- Scans an array from JSON into a Lua object\n-- startPos begins at the start of the array.\n-- Returns the array and the next starting position\n-- @param s The string being scanned.\n-- @param startPos The starting position for the scan.\n-- @return table, int The scanned array as a table, and the position of the next character to scan.\nfunction decode_scanArray(s,startPos)\n  local array = {}\t-- The return value\n  local stringLen = string.len(s)\n  base.assert(string.sub(s,startPos,startPos)=='[','decode_scanArray called but array does not start at position ' .. startPos .. ' in string:\\n'..s )\n  startPos = startPos + 1\n  -- Infinite loop for array elements\n  repeat\n    startPos = decode_scanWhitespace(s,startPos)\n    base.assert(startPos<=stringLen,'JSON String ended unexpectedly scanning array.')\n    local curChar = string.sub(s,startPos,startPos)\n    if (curChar==']') then\n      return array, startPos+1\n    end\n    if (curChar==',') then\n      startPos = decode_scanWhitespace(s,startPos+1)\n    end\n    base.assert(startPos<=stringLen, 'JSON String ended unexpectedly scanning array.')\n    object, startPos = decode(s,startPos)\n    table.insert(array,object)\n  until false\nend\n\n--- Scans a comment and discards the comment.\n-- Returns the position of the next character following the comment.\n-- @param string s The JSON string to scan.\n-- @param int startPos The starting position of the comment\nfunction decode_scanComment(s, startPos)\n  base.assert( string.sub(s,startPos,startPos+1)=='/*', \"decode_scanComment called but comment does not start at position \" .. startPos)\n  local endPos = string.find(s,'*/',startPos+2)\n  base.assert(endPos~=nil, \"Unterminated comment in string at \" .. startPos)\n  return endPos+2  \nend\n\n--- Scans for given constants: true, false or null\n-- Returns the appropriate Lua type, and the position of the next character to read.\n-- @param s The string being scanned.\n-- @param startPos The position in the string at which to start scanning.\n-- @return object, int The object (true, false or nil) and the position at which the next character should be \n-- scanned.\nfunction decode_scanConstant(s, startPos)\n  local consts = { [\"true\"] = true, [\"false\"] = false, [\"null\"] = nil }\n  local constNames = {\"true\",\"false\",\"null\"}\n\n  for i,k in base.pairs(constNames) do\n    --print (\"[\" .. string.sub(s,startPos, startPos + string.len(k) -1) ..\"]\", k)\n    if string.sub(s,startPos, startPos + string.len(k) -1 )==k then\n      return consts[k], startPos + string.len(k)\n    end\n  end\n  base.assert(nil, 'Failed to scan constant from string ' .. s .. ' at starting position ' .. startPos)\nend\n\n--- Scans a number from the JSON encoded string.\n-- (in fact, also is able to scan numeric +- eqns, which is not\n-- in the JSON spec.)\n-- Returns the number, and the position of the next character\n-- after the number.\n-- @param s The string being scanned.\n-- @param startPos The position at which to start scanning.\n-- @return number, int The extracted number and the position of the next character to scan.\nfunction decode_scanNumber(s,startPos)\n  local endPos = startPos+1\n  local stringLen = string.len(s)\n  local acceptableChars = \"+-0123456789.e\"\n  while (string.find(acceptableChars, string.sub(s,endPos,endPos), 1, true)\n\tand endPos<=stringLen\n\t) do\n    endPos = endPos + 1\n  end\n  local stringValue = 'return ' .. string.sub(s,startPos, endPos-1)\n  local stringEval = base.loadstring(stringValue)\n  base.assert(stringEval, 'Failed to scan number [ ' .. stringValue .. '] in JSON string at position ' .. startPos .. ' : ' .. endPos)\n  return stringEval(), endPos\nend\n\n--- Scans a JSON object into a Lua object.\n-- startPos begins at the start of the object.\n-- Returns the object and the next starting position.\n-- @param s The string being scanned.\n-- @param startPos The starting position of the scan.\n-- @return table, int The scanned object as a table and the position of the next character to scan.\nfunction decode_scanObject(s,startPos)\n  local object = {}\n  local stringLen = string.len(s)\n  local key, value\n  base.assert(string.sub(s,startPos,startPos)=='{','decode_scanObject called but object does not start at position ' .. startPos .. ' in string:\\n' .. s)\n  startPos = startPos + 1\n  repeat\n    startPos = decode_scanWhitespace(s,startPos)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly while scanning object.')\n    local curChar = string.sub(s,startPos,startPos)\n    if (curChar=='}') then\n      return object,startPos+1\n    end\n    if (curChar==',') then\n      startPos = decode_scanWhitespace(s,startPos+1)\n    end\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly scanning object.')\n    -- Scan the key\n    key, startPos = decode(s,startPos)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly searching for value of key ' .. key)\n    startPos = decode_scanWhitespace(s,startPos)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly searching for value of key ' .. key)\n    base.assert(string.sub(s,startPos,startPos)==':','JSON object key-value assignment mal-formed at ' .. startPos)\n    startPos = decode_scanWhitespace(s,startPos+1)\n    base.assert(startPos<=stringLen, 'JSON string ended unexpectedly searching for value of key ' .. key)\n    value, startPos = decode(s,startPos)\n    object[key]=value\n  until false\t-- infinite loop while key-value pairs are found\nend\n\n--- Scans a JSON string from the opening inverted comma or single quote to the\n-- end of the string.\n-- Returns the string extracted as a Lua string,\n-- and the position of the next non-string character\n-- (after the closing inverted comma or single quote).\n-- @param s The string being scanned.\n-- @param startPos The starting position of the scan.\n-- @return string, int The extracted string as a Lua string, and the next character to parse.\nfunction decode_scanString(s,startPos)\n  base.assert(startPos, 'decode_scanString(..) called without start position')\n  local startChar = string.sub(s,startPos,startPos)\n  base.assert(startChar==[[']] or startChar==[[\"]],'decode_scanString called for a non-string')\n  local escaped = false\n  local endPos = startPos + 1\n  local bEnded = false\n  local stringLen = string.len(s)\n  repeat\n    local curChar = string.sub(s,endPos,endPos)\n    if not escaped then\t\n      if curChar==[[\\]] then\n        escaped = true\n      else\n        bEnded = curChar==startChar\n      end\n    else\n      -- If we're escaped, we accept the current character come what may\n      escaped = false\n    end\n    endPos = endPos + 1\n    base.assert(endPos <= stringLen+1, \"String decoding failed: unterminated string at position \" .. endPos)\n  until bEnded\n  local stringValue = 'return ' .. string.sub(s, startPos, endPos-1)\n  local stringEval = base.loadstring(stringValue)\n  base.assert(stringEval, 'Failed to load string [ ' .. stringValue .. '] in JSON4Lua.decode_scanString at position ' .. startPos .. ' : ' .. endPos)\n  return stringEval(), endPos  \nend\n\n--- Scans a JSON string skipping all whitespace from the current start position.\n-- Returns the position of the first non-whitespace character, or nil if the whole end of string is reached.\n-- @param s The string being scanned\n-- @param startPos The starting position where we should begin removing whitespace.\n-- @return int The first position where non-whitespace was encountered, or string.len(s)+1 if the end of string\n-- was reached.\nfunction decode_scanWhitespace(s,startPos)\n  local whitespace=\" \\n\\r\\t\"\n  local stringLen = string.len(s)\n  while ( string.find(whitespace, string.sub(s,startPos,startPos), 1, true)  and startPos <= stringLen) do\n    startPos = startPos + 1\n  end\n  return startPos\nend\n\n--- Encodes a string to be JSON-compatible.\n-- This just involves back-quoting inverted commas, back-quotes and newlines, I think ;-)\n-- @param s The string to return as a JSON encoded (i.e. backquoted string)\n-- @return The string appropriately escaped.\nfunction encodeString(s)\n  s = string.gsub(s,'\\\\','\\\\\\\\')\n  s = string.gsub(s,'\"','\\\\\"')\n  s = string.gsub(s,\"'\",\"\\\\'\")\n  s = string.gsub(s,'\\n','\\\\n')\n  s = string.gsub(s,'\\t','\\\\t')\n  return s \nend\n\n-- Determines whether the given Lua type is an array or a table / dictionary.\n-- We consider any table an array if it has indexes 1..n for its n items, and no\n-- other data in the table.\n-- I think this method is currently a little 'flaky', but can't think of a good way around it yet...\n-- @param t The table to evaluate as an array\n-- @return boolean, number True if the table can be represented as an array, false otherwise. If true,\n-- the second returned value is the maximum\n-- number of indexed elements in the array. \nfunction isArray(t)\n  -- Next we count all the elements, ensuring that any non-indexed elements are not-encodable \n  -- (with the possible exception of 'n')\n  local maxIndex = 0\n  for k,v in base.pairs(t) do\n    if (base.type(k)=='number' and math.floor(k)==k and 1<=k) then\t-- k,v is an indexed pair\n      if (not isEncodable(v)) then return false end\t-- All array elements must be encodable\n      maxIndex = math.max(maxIndex,k)\n    else\n      if (k=='n') then\n        if v ~= table.getn(t) then return false end  -- False if n does not hold the number of elements\n      else -- Else of (k=='n')\n        if isEncodable(v) then return false end\n      end  -- End of (k~='n')\n    end -- End of k,v not an indexed pair\n  end  -- End of loop across all pairs\n  return true, maxIndex\nend\n\n--- Determines whether the given Lua object / table / variable can be JSON encoded. The only\n-- types that are JSON encodable are: string, boolean, number, nil, table and json.null.\n-- In this implementation, all other types are ignored.\n-- @param o The object to examine.\n-- @return boolean True if the object should be JSON encoded, false if it should be ignored.\nfunction isEncodable(o)\n  local t = base.type(o)\n  return (t=='string' or t=='boolean' or t=='number' or t=='nil' or t=='table') or (t=='function' and o==null) \nend\n\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/luaj.lua",
    "content": "\nlocal luaj = {}\n\nlocal callJavaStaticMethod = LuaJavaBridge.callStaticMethod\n\nlocal function checkArguments(args, sig)\n    if type(args) ~= \"table\" then args = {} end\n    if sig then return args, sig end\n\n    sig = {\"(\"}\n    for i, v in ipairs(args) do\n        local t = type(v)\n        if t == \"number\" then\n            sig[#sig + 1] = \"F\"\n        elseif t == \"boolean\" then\n            sig[#sig + 1] = \"Z\"\n        elseif t == \"function\" then\n            sig[#sig + 1] = \"I\"\n        else\n            sig[#sig + 1] = \"Ljava/lang/String;\"\n        end\n    end\n    sig[#sig + 1] = \")V\"\n\n    return args, table.concat(sig)\nend\n\nfunction luaj.callStaticMethod(className, methodName, args, sig)\n    local args, sig = checkArguments(args, sig)\n    --echoInfo(\"luaj.callStaticMethod(\\\"%s\\\",\\n\\t\\\"%s\\\",\\n\\targs,\\n\\t\\\"%s\\\"\", className, methodName, sig)\n    return callJavaStaticMethod(className, methodName, args, sig)\nend\n\nreturn luaj\n"
  },
  {
    "path": "cocos2d/cocos/scripting/lua/script/luaoc.lua",
    "content": "\nlocal luaoc = {}\n\nlocal callStaticMethod = LuaObjcBridge.callStaticMethod\n\nfunction luaoc.callStaticMethod(className, methodName, args)\n    local ok, ret = callStaticMethod(className, methodName, args)\n    if not ok then\n        local msg = string.format(\"luaoc.callStaticMethod(\\\"%s\\\", \\\"%s\\\", \\\"%s\\\") - error: [%s] \",\n                className, methodName, tostring(args), tostring(ret))\n        if ret == -1 then\n            print(msg .. \"INVALID PARAMETERS\")\n        elseif ret == -2 then\n            print(msg .. \"CLASS NOT FOUND\")\n        elseif ret == -3 then\n            print(msg .. \"METHOD NOT FOUND\")\n        elseif ret == -4 then\n            print(msg .. \"EXCEPTION OCCURRED\")\n        elseif ret == -5 then\n            print(msg .. \"INVALID METHOD SIGNATURE\")\n        else\n            print(msg .. \"UNKNOWN\")\n        end\n    end\n    return ok, ret\nend\n\nreturn luaoc\n"
  },
  {
    "path": "cocos2d/cocos/storage/local-storage/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos_localstorage_static\n\nLOCAL_MODULE_FILENAME := liblocalstorage\n\nLOCAL_SRC_FILES := LocalStorage.cpp \\\nLocalStorageAndroid.cpp \n\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..\n\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../2d\n\nLOCAL_CFLAGS += -Wno-psabi\nLOCAL_EXPORT_CFLAGS += -Wno-psabi\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,2d)\n"
  },
  {
    "path": "cocos2d/cocos/storage/local-storage/LocalStorage.cpp",
    "content": "/*\n \n Copyright (c) 2012 - Zynga Inc.\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n \n */\n\n/*\n Local Storage support for the JS Bindings for iOS.\n Works on cocos2d-iphone and cocos2d-x.\n */\n\n#include \"LocalStorage.h\"\n#include \"CCPlatformMacros.h\"\n\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID)\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <assert.h>\n#include <sqlite3.h>\n\nstatic int _initialized = 0;\nstatic sqlite3 *_db;\nstatic sqlite3_stmt *_stmt_select;\nstatic sqlite3_stmt *_stmt_remove;\nstatic sqlite3_stmt *_stmt_update;\n\n\nstatic void localStorageCreateTable()\n{\n\tconst char *sql_createtable = \"CREATE TABLE IF NOT EXISTS data(key TEXT PRIMARY KEY,value TEXT);\";\n\tsqlite3_stmt *stmt;\n\tint ok=sqlite3_prepare_v2(_db, sql_createtable, -1, &stmt, NULL);\n\tok |= sqlite3_step(stmt);\n\tok |= sqlite3_finalize(stmt);\n\t\n\tif( ok != SQLITE_OK && ok != SQLITE_DONE)\n\t\tprintf(\"Error in CREATE TABLE\\n\");\n}\n\nvoid localStorageInit( const std::string& fullpath/* = \"\" */)\n{\n\tif( ! _initialized ) {\n\n\t\tint ret = 0;\n\t\t\n\t\tif (fullpath.empty())\n\t\t\tret = sqlite3_open(\":memory:\",&_db);\n\t\telse\n\t\t\tret = sqlite3_open(fullpath.c_str(), &_db);\n\n\t\tlocalStorageCreateTable();\n\n\t\t// SELECT\n\t\tconst char *sql_select = \"SELECT value FROM data WHERE key=?;\";\n\t\tret |= sqlite3_prepare_v2(_db, sql_select, -1, &_stmt_select, NULL);\n\n\t\t// REPLACE\n\t\tconst char *sql_update = \"REPLACE INTO data (key, value) VALUES (?,?);\";\n\t\tret |= sqlite3_prepare_v2(_db, sql_update, -1, &_stmt_update, NULL);\n\n\t\t// DELETE\n\t\tconst char *sql_remove = \"DELETE FROM data WHERE key=?;\";\n\t\tret |= sqlite3_prepare_v2(_db, sql_remove, -1, &_stmt_remove, NULL);\n\n\t\tif( ret != SQLITE_OK ) {\n\t\t\tprintf(\"Error initializing DB\\n\");\n\t\t\t// report error\n\t\t}\n\t\t\n\t\t_initialized = 1;\n\t}\n}\n\nvoid localStorageFree()\n{\n\tif( _initialized ) {\n\t\tsqlite3_finalize(_stmt_select);\n\t\tsqlite3_finalize(_stmt_remove);\n\t\tsqlite3_finalize(_stmt_update);\t\t\n\n\t\tsqlite3_close(_db);\n\t\t\n\t\t_initialized = 0;\n\t}\n}\n\n/** sets an item in the LS */\nvoid localStorageSetItem( const std::string& key, const std::string& value)\n{\n\tassert( _initialized );\n\t\n\tint ok = sqlite3_bind_text(_stmt_update, 1, key.c_str(), -1, SQLITE_TRANSIENT);\n\tok |= sqlite3_bind_text(_stmt_update, 2, value.c_str(), -1, SQLITE_TRANSIENT);\n\n\tok |= sqlite3_step(_stmt_update);\n\t\n\tok |= sqlite3_reset(_stmt_update);\n\t\n\tif( ok != SQLITE_OK && ok != SQLITE_DONE)\n\t\tprintf(\"Error in localStorage.setItem()\\n\");\n}\n\n/** gets an item from the LS */\nstd::string localStorageGetItem( const std::string& key )\n{\n\tassert( _initialized );\n\n\tstd::string ret;\n\tint ok = sqlite3_reset(_stmt_select);\n\n\tok |= sqlite3_bind_text(_stmt_select, 1, key.c_str(), -1, SQLITE_TRANSIENT);\n\tok |= sqlite3_step(_stmt_select);\n\tconst unsigned char *text = sqlite3_column_text(_stmt_select, 0);\n\tif (text)\n\t\tret = (const char*)text;\n\n\tif( ok != SQLITE_OK && ok != SQLITE_DONE && ok != SQLITE_ROW)\n\t\tprintf(\"Error in localStorage.getItem()\\n\");\n\n\treturn ret;\n}\n\n/** removes an item from the LS */\nvoid localStorageRemoveItem( const std::string& key )\n{\n\tassert( _initialized );\n\n\tint ok = sqlite3_bind_text(_stmt_remove, 1, key.c_str(), -1, SQLITE_TRANSIENT);\n\t\n\tok |= sqlite3_step(_stmt_remove);\n\t\n\tok |= sqlite3_reset(_stmt_remove);\n\n\tif( ok != SQLITE_OK && ok != SQLITE_DONE)\n\t\tprintf(\"Error in localStorage.removeItem()\\n\");\n}\n\n#endif // #if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID)\n"
  },
  {
    "path": "cocos2d/cocos/storage/local-storage/LocalStorage.h",
    "content": "/*\n\nCopyright (c) 2012 - Zynga Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n*/\n\n/*\n Local Storage support for the JS Bindings for iOS.\n Works on cocos2d-iphone and cocos2d-x.\n */\n\n#ifndef __JSB_LOCALSTORAGE_H\n#define __JSB_LOCALSTORAGE_H\n\n#include <string>\n\n/** Initializes the database. If path is null, it will create an in-memory DB */\nvoid localStorageInit( const std::string& fullpath = \"\");\n\n/** Frees the allocated resources */\nvoid localStorageFree();\n\n/** sets an item in the LS */\nvoid localStorageSetItem( const std::string& key, const std::string& value);\n\n/** gets an item from the LS */\nstd::string localStorageGetItem( const std::string& key );\n\n/** removes an item from the LS */\nvoid localStorageRemoveItem( const std::string& key );\n\n#endif // __JSB_LOCALSTORAGE_H\n"
  },
  {
    "path": "cocos2d/cocos/storage/local-storage/LocalStorageAndroid.cpp",
    "content": "/***************************************************************************\n Copyright (c) 2012 Zynga Inc.\n Copyright (c) 2013 cocos2d-x.org\n Copyright (c) 2013-2014 Chukong Technologic Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n***************************************************************************/\n \n\n/*\n Local Storage support for the JS Bindings for iOS.\n Works on cocos2d-iphone and cocos2d-x.\n */\n\n#include \"LocalStorage.h\"\n#include \"CCPlatformMacros.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <assert.h>\n#include \"jni.h\"\n#include \"jni/JniHelper.h\"\n\nUSING_NS_CC;\nstatic int _initialized = 0;\n\nstatic void splitFilename (std::string& str)\n{\n\tsize_t found = 0;\n\tfound=str.find_last_of(\"/\\\\\");\n\tif (found != std::string::npos)\n\t{\n\t\tstr = str.substr(found+1);\n\t}\n}\n\nvoid localStorageInit( const std::string& fullpath)\n{\n\tif (fullpath.empty())\n        return;\n\n\tif( ! _initialized )\n    {\n        JniMethodInfo t;\n\n        if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxLocalStorage\", \"init\", \"(Ljava/lang/String;Ljava/lang/String;)Z\")) {\n            std::string strDBFilename = fullpath;\n            splitFilename(strDBFilename);\n            jstring jdbName = t.env->NewStringUTF(strDBFilename.c_str());\n            jstring jtableName = t.env->NewStringUTF(\"data\");\n            jboolean ret = t.env->CallStaticBooleanMethod(t.classID, t.methodID, jdbName, jtableName);\n            t.env->DeleteLocalRef(jdbName);\n            t.env->DeleteLocalRef(jtableName);\n            t.env->DeleteLocalRef(t.classID);\n            if (ret) {\n                _initialized = 1;\n            }\n        }\n\t}\n}\n\nvoid localStorageFree()\n{\n\tif( _initialized ) {\n\t\t\n\t\tJniMethodInfo t;\n        \n        if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxLocalStorage\", \"destory\", \"()V\"))\n        {\n            t.env->CallStaticVoidMethod(t.classID, t.methodID);\n        \tt.env->DeleteLocalRef(t.classID); \n        }\n        \n\t\t_initialized = 0;\n\t}\n}\n\n/** sets an item in the LS */\nvoid localStorageSetItem( const std::string& key, const std::string& value)\n{\n\tassert( _initialized );\n\t\n    JniMethodInfo t;\n\n    if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxLocalStorage\", \"setItem\", \"(Ljava/lang/String;Ljava/lang/String;)V\")) {\n        jstring jkey = t.env->NewStringUTF(key.c_str());\n        jstring jvalue = t.env->NewStringUTF(value.c_str());\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, jkey, jvalue);\n        t.env->DeleteLocalRef(jkey);\n        t.env->DeleteLocalRef(jvalue);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\n/** gets an item from the LS */\nstd::string localStorageGetItem( const std::string& key )\n{\n\tassert( _initialized );\n    JniMethodInfo t;\n\n    std::string ret;\n    if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxLocalStorage\", \"getItem\", \"(Ljava/lang/String;)Ljava/lang/String;\")) {\n        jstring jkey = t.env->NewStringUTF(key.c_str());\n        jstring jret = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID, jkey);\n        ret = JniHelper::jstring2string(jret);\n        t.env->DeleteLocalRef(jret);\n        t.env->DeleteLocalRef(jkey);\n        t.env->DeleteLocalRef(t.classID);\n    }\n    return ret;\n}\n\n/** removes an item from the LS */\nvoid localStorageRemoveItem( const std::string& key )\n{\n\tassert( _initialized );\n    JniMethodInfo t;\n\n    if (JniHelper::getStaticMethodInfo(t, \"org/cocos2dx/lib/Cocos2dxLocalStorage\", \"removeItem\", \"(Ljava/lang/String;)V\")) {\n        jstring jkey = t.env->NewStringUTF(key.c_str());\n        t.env->CallStaticVoidMethod(t.classID, t.methodID, jkey);\n        t.env->DeleteLocalRef(jkey);\n        t.env->DeleteLocalRef(t.classID);\n    }\n\n}\n\n#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n"
  },
  {
    "path": "cocos2d/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\LocalStorage.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\LocalStorage.h\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{632A8F38-D0F0-4D22-86B3-D69F5E6BF63A}</ProjectGuid>\n    <RootNamespace>libLocalStorage</RootNamespace>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\..\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <SDLCheck>\n      </SDLCheck>\n      <AdditionalIncludeDirectories>$(EngineRoot)external\\sqlite3\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MinimalRebuild>false</MinimalRebuild>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>\n      </SDLCheck>\n      <AdditionalIncludeDirectories>$(EngineRoot)external\\sqlite3\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_LIB;COCOS2DXWIN32_EXPORTS;GL_GLEXT_PROTOTYPES;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ClCompile>\n    <Link>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{0310200c-b520-4f77-85f6-46f568b10f4d}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{69cfa37c-4b20-409e-ad74-a26314878d8a}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\LocalStorage.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\LocalStorage.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/docs/.gitignore",
    "content": "html/\n.tee-*.txt\n\n"
  },
  {
    "path": "cocos2d/docs/CODING_STYLE.md",
    "content": "# ![][1] C++ coding style\n\n_v0.2 - Last updated November 8, 2013_\n\n_Forked from [Google's C++ coding style](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml) rev. 3.274_\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Header Files](#header-files)\n\t- [The #define Guard](#the-define-guard)\n\t- [Forward Declarations](#forward-declarations)\n\t- [Inline Functions](#inline-functions)\n\t- [The -inl.h Files](#the--inlh-files)\n\t- [Function Parameter Ordering](#function-parameter-ordering)\n\t- [Names and Order of Includes](#names-and-order-of-includes)\n- [Scoping](#scoping)\n\t- [Namespaces](#namespaces)\n\t\t- [Unnamed Namespaces](#unnamed-namespaces)\n\t\t- [Named Namespaces](#named-namespaces)\n\t- [Nested Classes](#nested-classes)\n\t- [Nonmember, Static Member, and Global Functions](#nonmember-static-member-and-global-functions)\n\t- [Local Variables](#local-variables)\n\t- [Static and Global Variables](#static-and-global-variables)\n- [Classes](#classes)\n\t- [Doing Work in Constructors](#doing-work-in-constructors)\n\t- [Initialization](#initialization)\n\t- [Explicit Constructors](#explicit-constructors)\n\t- [Copy Constructors](#copy-constructors)\n\t- [Delegating and inheriting constructors](#delegating-and-inheriting-constructors)\n\t- [Structs vs. Classes](#structs-vs-classes)\n\t- [Inheritance](#inheritance)\n\t- [Multiple Inheritance](#multiple-inheritance)\n\t- [Interfaces](#interfaces)\n\t- [Operator Overloading](#operator-overloading)\n\t- [Access Control](#access-control)\n\t- [Declaration Order](#declaration-order)\n\t- [Write Short Functions](#write-short-functions)\n- [Other C++ Features](#other-c-features)\n\t- [Ownership and Smart Pointers](#ownership-and-smart-pointers)\n\t- [Reference Arguments](#reference-arguments)\n\t- [Rvalue references](#rvalue-references)\n\t- [Function Overloading](#function-overloading)\n\t- [Default Arguments](#default-arguments)\n\t- [Variable-Length Arrays and alloca()](#variable-length-arrays-and-alloca)\n\t- [Friends](#friends)\n\t- [Exceptions](#exceptions)\n\t- [Run-Time Type Information (RTTI)](#run-time-type-information-rtti)\n\t- [Casting](#casting)\n\t- [Streams](#streams)\n\t- [Preincrement and Predecrement](#preincrement-and-predecrement)\n\t- [Use of const](#use-of-const)\n\t- [Use of constexpr](#use-of-constexpr)\n\t- [Use of constexpr](#use-of-constexpr-1)\n\t- [Integer Types](#integer-types)\n\t\t- [On Unsigned Integers](#on-unsigned-integers)\n\t- [64-bit Portability](#64-bit-portability)\n\t- [Preprocessor Macros](#preprocessor-macros)\n\t- [0 and nullptr/NULL](#0-and-nullptrnull)\n\t- [sizeof](#sizeof)\n\t- [auto](#auto)\n\t- [Brace Initialization](#brace-initialization)\n\t- [Lambda expressions](#lambda-expressions)\n\t- [Boost](#boost)\n\t- [C++11](#c11)\n\t- [General Naming Rules](#general-naming-rules)\n\t- [File Names](#file-names)\n\t- [Type Names](#type-names)\n\t- [Variable Names](#variable-names)\n\t\t- [Common Variable names](#common-variable-names)\n\t\t- [Class Data Members](#class-data-members)\n\t\t- [Struct Variables](#struct-variables)\n\t\t- [Global Variables](#global-variables)\n\t- [Constant Names](#constant-names)\n\t- [Function Names](#function-names)\n\t\t- [Regular Functions](#regular-functions)\n\t\t- [Accessors and Mutators](#accessors-and-mutators)\n\t- [Namespace Names](#namespace-names)\n\t- [Enumerator Names](#enumerator-names)\n\t- [Macro Names](#macro-names)\n\t- [Exceptions to Naming Rules](#exceptions-to-naming-rules)\n\t\t- [bigopen()](#bigopen)\n\t\t- [uint](#uint)\n\t\t- [bigpos](#bigpos)\n\t\t- [sparse_hash_map](#sparse_hash_map)\n\t\t- [LONGLONG_MAX](#longlong_max)\n- [Comments](#comments)\n\t- [Doxygen](#doxygen)\n\t- [Comment Style](#comment-style)\n\t- [File Comments](#file-comments)\n\t\t- [Legal Notice and Author Line](#legal-notice-and-author-line)\n\t\t- [File Contents](#file-contents)\n\t- [Class Comments](#class-comments)\n\t- [Function Comments](#function-comments)\n\t\t- [Function Declarations](#function-declarations)\n\t\t- [Function Definitions](#function-definitions)\n\t- [Variable Comments](#variable-comments)\n\t\t- [Class Data Members](#class-data-members-1)\n\t\t- [Global Variables](#global-variables-1)\n\t- [Implementation Comments](#implementation-comments)\n\t\t- [Class Data Members](#class-data-members-2)\n\t\t- [Line Comments](#line-comments)\n\t\t- [nullptr/NULL, true/false, 1, 2, 3...](#nullptrnull-truefalse-1-2-3)\n\t\t- [Don'ts](#donts)\n\t- [Punctuation, Spelling and Grammar](#punctuation-spelling-and-grammar)\n\t- [TODO Comments](#todo-comments)\n\t- [Deprecation Comments](#deprecation-comments)\n- [Formatting](#formatting)\n\t- [Line Length](#line-length)\n\t- [Non-ASCII Characters](#non-ascii-characters)\n\t- [Spaces vs. Tabs](#spaces-vs-tabs)\n\t- [Function Declarations and Definitions](#function-declarations-and-definitions)\n\t- [Function Calls](#function-calls)\n\t- [Braced Initializer Lists](#braced-initializer-lists)\n\t- [Conditionals](#conditionals)\n\t- [Loops and Switch Statements](#loops-and-switch-statements)\n\t- [Pointer and Reference Expressions](#pointer-and-reference-expressions)\n\t- [Boolean Expressions](#boolean-expressions)\n\t- [Return Values](#return-values)\n\t- [Variable and Array Initialization](#variable-and-array-initialization)\n\t- [Preprocessor Directives](#preprocessor-directives)\n\t- [Class Format](#class-format)\n\t- [Constructor Initializer Lists](#constructor-initializer-lists)\n\t- [Namespace Formatting](#namespace-formatting)\n\t- [Horizontal Whitespace](#horizontal-whitespace)\n\t\t- [General](#general)\n\t\t- [Loops and Conditionals](#loops-and-conditionals)\n\t\t- [Operators](#operators)\n\t\t- [Templates and Casts](#templates-and-casts)\n\t- [Vertical Whitespace](#vertical-whitespace)\n- [Exceptions to the Rules](#exceptions-to-the-rules)\n\t- [Existing Non-conformant Code](#existing-non-conformant-code)\n\t- [Windows Code](#windows-code)\n- [Parting Words](#parting-words)\n\n# Header Files\n\nIn general, every `.cpp` file should have an associated `.h` file. There are some common exceptions, such as unittests and small `.cpp` files containing just a `main()` function.\n\nCorrect use of header files can make a huge difference to the readability, size and performance of your code.\n\nThe following rules will guide you through the various pitfalls of using header files.\n\n## The #define Guard\n\nAll header files should have `#define` guards to prevent multiple inclusion. The format of the symbol name should be `<PROJECT>_<PATH>_<FILE>_H_.`\n\nTo guarantee uniqueness, they should be based on the full path in a project's source tree. For example, the file `cocos2dx/sprites_nodes/CCSprite.h` in project foo should have the following guard:\n\n```cpp\n#ifndef COCOS2DX_SPRITE_NODES_CCSPRITE_H_\n#define COCOS2DX_SPRITE_NODES_CCSPRITE_H_\n\n...\n\n#endif  // COCOS2DX_SPRITE_NODES_CCSPRITE_H_\n```\n\n```cpp\n// Pragma once is still open for debate\n#pragma once\n```\n\nWe are cosidering using `#pragma once` as well, although we haven't determined yet if it is supported in all our target platforms.\n\n## Forward Declarations\n\nYou may forward declare ordinary classes in order to avoid unnecessary `#includes`.\n\n**Definition:** A \"forward declaration\" is a declaration of a class, function, or template without an associated definition. #include lines can often be replaced with forward declarations of whatever symbols are actually used by the client code.\n\n**Pros:**\n\n* Unnecessary #includes force the compiler to open more files and process more input.\n* They can also force your code to be recompiled more often, due to changes in the header.\n\n**Cons:**\n\n* It can be difficult to determine the correct form of a forward declaration in the presence of features like templates, typedefs, default parameters, and using declarations.\n* It can be difficult to determine whether a forward declaration or a full #include is needed for a given piece of code, particularly when implicit conversion operations are involved. In extreme cases, replacing an #include with a forward declaration can silently change the meaning of code.\n* Forward declaring multiple symbols from a header can be more verbose than simply #includeing the header.\n* Forward declarations of functions and templates can prevent the header owners from making otherwise-compatible changes to their APIs; for example, widening a parameter type, or adding a template parameter with a default value.\n* Forward declaring symbols from namespace std:: usually yields undefined behavior.\n* Structuring code to enable forward declarations (e.g. using pointer members instead of object members) can make the code slower and more complex.\n* The practical efficiency benefits of forward declarations are unproven.\n\n**Decision:**\n\n* When using a function declared in a header file, always #include that header.\n* When using a class template, prefer to #include its header file.\n* When using an ordinary class, relying on a forward declaration is OK, but be wary of situations where a forward declaration may be insufficient or incorrect; when in doubt, just #include the appropriate header.\n* Do not replace data members with pointers just to avoid an #include.\n\nAlways #include the file that actually provides the declarations/definitions you need; do not rely on the symbol being brought in transitively via headers not directly included. One exception is that `Myfile.cpp` may rely on #includes and forward declarations from its corresponding header file `Myfile.h`.\n\n## Inline Functions\n\nDefine functions inline only when they are small, say, 10 lines or less.\n\n**Definition:**\nYou can declare functions in a way that allows the compiler to expand them inline rather than calling them through the usual function call mechanism.\n\n**Pros:** \nInlining a function can generate more efficient object code, as long as the inlined function is small. Feel free to inline accessors and mutators, and other short, performance-critical functions.\n\n**Cons:** \nOveruse of inlining can actually make programs slower. Depending on a function's size, inlining it can cause the code size to increase or decrease. Inlining a very small accessor function will usually decrease code size while inlining a very large function can dramatically increase code size. On modern processors smaller code usually runs faster due to better use of the instruction cache.\n\n**Decision:**\nA decent rule of thumb is to not inline a function if it is more than 10 lines long. Beware of destructors, which are often longer than they appear because of implicit member- and base-destructor calls!\n\nAnother useful rule of thumb: it's typically not cost effective to inline functions with loops or switch statements (unless, in the common case, the loop or switch statement is never executed).\n\nIt is important to know that functions are not always inlined even if they are declared as such; for example, virtual and recursive functions are not normally inlined. Usually recursive functions should not be inline. The main reason for making a virtual function inline is to place its definition in the class, either for convenience or to document its behavior, e.g., for accessors and mutators.\n\n## The -inl.h Files\n\nYou may use file names with a -inl.h suffix to define complex inline functions when needed.\n\nThe definition of an inline function needs to be in a header file, so that the compiler has the definition available for inlining at the call sites. However, implementation code properly belongs in .cpp files, and we do not like to have much actual code in .h files unless there is a readability or performance advantage.\n\nIf an inline function definition is short, with very little, if any, logic in it, you should put the code in your .h file. For example, accessors and mutators should certainly be inside a class definition. More complex inline functions may also be put in a .h file for the convenience of the implementer and callers, though if this makes the .h file too unwieldy you can instead put that code in a separate -inl.h file. This separates the implementation from the class definition, while still allowing the implementation to be included where necessary.\n\nAnother use of -inl.h files is for definitions of function templates. This can be used to keep your template definitions easy to read.\n\nDo not forget that a -inl.h file requires a #define guard just like any other header file.\n\n## Function Parameter Ordering\n\nWhen defining a function, parameter order is: inputs, then outputs.\n\nParameters to C/C++ functions are either input to the function, output from the function, or both. Input parameters are usually `values` or `const references`, while output and input/output parameters will be `non-const pointers` . When ordering function parameters, put all input-only parameters before any output parameters. In particular, do not add new parameters to the end of the function just because they are new; place new input-only parameters before the output parameters.\n\nThis is not a hard-and-fast rule. Parameters that are both input and output (often classes/structs) muddy the waters, and, as always, consistency with related functions may require you to bend the rule.\n\n## Names and Order of Includes\n\nUse standard order for readability and to avoid hidden dependencies: C library, C++ library, other libraries' .h, your project's .h.\n\nAll of a project's header files should be listed as descendants of the project's source directory without use of UNIX directory shortcuts . (the current directory) or .. (the parent directory). For example, google-awesome-project/src/base/logging.h should be included as\n\n```cpp\n#include \"base/logging.h\"\n```\n\nIn `dir/foo.cpp` or `dir/foo_test.cpp`, whose main purpose is to implement or test the stuff in `dir2/foo2.h`, order your includes as follows:\n\n* dir2/foo2.h (preferred location — see details below).\n* C system files.\n* C++ system files.\n* Other libraries' .h files.\n* Your project's .h files.\n\nWith the preferred ordering, if `dir2/foo2.h` omits any necessary includes, the build of `dir/foo.cpp` or `dir/foo_test.cpp` will break. Thus, this rule ensures that build breaks show up first for the people working on these files, not for innocent people in other packages.\n\n`dir/foo.cpp` and `dir2/foo2.h` are often in the same directory (e.g. `base/basictypes_test.cpp` and `base/basictypes.h`), but can be in different directories too.\n\nWithin each section the includes should be ordered alphabetically. Note that older code might not conform to this rule and should be fixed when convenient.\n\nFor example, the includes in `cocos2dx/sprite_nodes/CCSprite.cpp` might look like this:\n\n```cpp\n#include \"sprite_nodes/CCSprite.h\"  // Preferred location.\n\n#include <sys/types.h>\n#include <unistd.h>\n#include <hash_map>\n#include <vector>\n\n#include \"base/basictypes.h\"\n#include \"base/commandlineflags.h\"\n#include \"foo/public/bar.h\"\n```\n\nException: sometimes, system-specific code needs conditional includes. Such code can put conditional includes after other includes. Of course, keep your system-specific code small and localized. Example:\n\n```cpp\n#include \"foo/public/fooserver.h\"\n\n#include \"base/port.h\" \n\n// For LANG_CXX11.\n#ifdef LANG_CXX11\n#include <initializer_list>\n#endif  // LANG_CXX11\n```\n\n# Scoping\n\n## Namespaces\n\nUnnamed namespaces in `.cpp` files are encouraged. With named namespaces, choose the name based on the project, and possibly its path. Do not use a using-directive. Do not use inline namespaces. \n\n**Definition:**\nNamespaces subdivide the global scope into distinct, named scopes, and so are useful for preventing name collisions in the global scope.\n\n**Pros:**\nNamespaces provide a (hierarchical) axis of naming, in addition to the (also hierarchical) name axis provided by classes.\n\nFor example, if two different projects have a class Foo in the global scope, these symbols may collide at compile time or at runtime. If each project places their code in a namespace, project1::Foo and project2::Foo are now distinct symbols that do not collide.\n\nInline namespaces automatically place their names in the enclosing scope. Consider the following snippet, for example:\n\n```cpp\nnamespace X {\ninline namespace Y {\n  void foo();\n}\n}\n```\nThe expressions `X::Y::foo()` and `X::foo()` are interchangeable. Inline namespaces are primarily intended for ABI compatibility across versions. \n\n**Cons:**\nNamespaces can be confusing, because they provide an additional (hierarchical) axis of naming, in addition to the (also hierarchical) name axis provided by classes.\n\nInline namespaces, in particular, can be confusing because names aren't actually restricted to the namespace where they are declared. They are only useful as part of some larger versioning policy. \n\nUse of unnamed namespaces in header files can easily cause violations of the C++ One Definition Rule (ODR).\n\n**Decision:**\nUse namespaces according to the policy described below. Terminate namespaces with comments as shown in the given examples.\n\n### Unnamed Namespaces\n\nUnnamed namespaces are allowed and even encouraged in .cpp files, to avoid runtime naming conflicts:\n\n```cpp\nnamespace {                           // This is in a .cpp file.\n\n// The content of a namespace is not indented\nenum { UNUSED, EOF, ERROR };         // Commonly used tokens.\nbool atEof() { return _pos == EOF; }  // Uses our namespace's EOF.\n\n}  // namespace\n```\n\nHowever, file-scope declarations that are associated with a particular class may be declared in that class as types, static data members or static member functions rather than as members of an unnamed namespace.\nDo not use unnamed namespaces in .h files.\n\n### Named Namespaces\n\nNamed namespaces should be used as follows:\n\nNamespaces wrap the entire source file after includes, gflags definitions/declarations, and forward declarations of classes from other namespaces:\n\n\n```cpp\n// In the .h file\n// When using the cocos2d namespace\nNS_CC_BEGIN\n\n// All declarations are within the namespace scope.\n// Notice the lack of indentation.\nclass MyClass\n{\npublic:\n    ...\n    void foo();\n};\n\nNS_CC_END\n```\n\n\n```cpp\n// In the .h file\n// When NOT using the cocos2d namespace\nnamespace mynamespace {\n\n// All declarations are within the namespace scope.\n// Notice the lack of indentation.\nclass MyClass\n{\npublic:\n    ...\n    void foo();\n};\n\n}  // namespace mynamespace\n```\n\n```cpp\n// In the .cpp file\nnamespace mynamespace {\n\n// Definition of functions is within scope of the namespace.\nvoid MyClass::foo()\n{\n    ...\n}\n\n}  // namespace mynamespace\n```\n\nThe typical .cpp file might have more complex detail, including the need to reference classes in other namespaces.\n\n```cpp\n#include \"a.h\"\n\nDEFINE_bool(someflag, false, \"dummy flag\");\n\nclass C;  // Forward declaration of class C in the global namespace.\nnamespace a { class A; }  // Forward declaration of a::A.\n\nnamespace b {\n\n...code for b...         // Code goes against the left margin.\n\n}  // namespace b\n```\n\n* Do not declare anything in namespace std, not even forward declarations of standard library classes. Declaring entities in namespace std is undefined behavior, i.e., not portable. To declare entities from the standard library, include the appropriate header file.\nYou may not use a using-directive to make all names from a namespace available.\n\n```cpp\n// Forbidden -- This pollutes the namespace.\nusing namespace foo;\n```\n\n* You may use a using-declaration anywhere in a .cpp file, and in functions, methods or classes in .h files.\n\n```cpp\n// OK in .cpp files.\n// Must be in a function, method or class in .h files.\nusing ::foo::bar;\n```\n\n* Namespace aliases are allowed anywhere in a .cpp file, anywhere inside the named namespace that wraps an entire .h file, and in functions and methods.\n\n```cpp\n// Shorten access to some commonly used names in .cpp files.\nnamespace fbz = ::foo::bar::baz;\n\n// Shorten access to some commonly used names (in a .h file).\nnamespace librarian {\n// The following alias is available to all files including\n// this header (in namespace librarian):\n// alias names should therefore be chosen consistently\n// within a project.\nnamespace pd_s = ::pipeline_diagnostics::sidetable;\n\ninline void myInlineFunction() {\n// namespace alias local to a function (or method).\nnamespace fbz = ::foo::bar::baz;\n...\n}\n}  // namespace librarian\n```\n\nNote that an alias in a .h file is visible to everyone #including that file, so public headers (those available outside a project) and headers transitively #included by them, should avoid defining aliases, as part of the general goal of keeping public APIs as small as possible.\n\n* Do not use inline namespaces.\n\n## Nested Classes\n\nAlthough you may use public nested classes when they are part of an interface, consider a namespace to keep declarations out of the global scope.\n\n**Definition:**\nA class can define another class within it; this is also called a member class.\n\n```cpp\nclass Foo\n{\nprivate:\n    // Bar is a member class, nested within Foo.\n    class Bar\n    {\n       ...\n    };\n};\n```\n\n**Pros:**\nThis is useful when the nested (or member) class is only used by the enclosing class; making it a member puts it in the enclosing class scope rather than polluting the outer scope with the class name. Nested classes can be forward declared within the enclosing class and then defined in the .cpp file to avoid including the nested class definition in the enclosing class declaration, since the nested class definition is usually only relevant to the implementation.\n\n**Cons:**\nNested classes can be forward-declared only within the definition of the enclosing class. Thus, any header file manipulating a Foo::Bar* pointer will have to include the full class declaration for Foo.\n\n**Decision:**\nDo not make nested classes public unless they are actually part of the interface, e.g., a class that holds a set of options for some method.\n\n## Nonmember, Static Member, and Global Functions\n\nPrefer nonmember functions within a namespace or static member functions to global functions; use completely global functions rarely.\n\n**Pros:**\nNonmember and static member functions can be useful in some situations. Putting nonmember functions in a namespace avoids polluting the global namespace.\n\n**Cons:**\nNonmember and static member functions may make more sense as members of a new class, especially if they access external resources or have significant dependencies.\n\n**Decision:**\n\nSometimes it is useful, or even necessary, to define a function not bound to a class instance. Such a function can be either a static member or a nonmember function. Nonmember functions should not depend on external variables, and should nearly always exist in a namespace. Rather than creating classes only to group static member functions which do not share static data, use namespaces instead.\n\nFunctions defined in the same compilation unit as production classes may introduce unnecessary coupling and link-time dependencies when directly called from other compilation units; static member functions are particularly susceptible to this. Consider extracting a new class, or placing the functions in a namespace possibly in a separate library.\n\nIf you must define a nonmember function and it is only needed in its .cpp file, use an unnamed namespace or static linkage (eg static int Foo() {...}) to limit its scope.\n\n## Local Variables\n\nPlace a function's variables in the narrowest scope possible, and initialize variables in the declaration.\n\nC++ allows you to declare variables anywhere in a function. We encourage you to declare them in as local a scope as possible, and as close to the first use as possible. This makes it easier for the reader to find the declaration and see what type the variable is and what it was initialized to. In particular, initialization should be used instead of declaration and assignment, e.g.\n\n```cpp\nint i;\ni = f();      // Bad -- initialization separate from declaration.\n\nint j = g();  // Good -- declaration has initialization.\n\nvector<int> v;\nv.push_back(1);  // Prefer initializing using brace initialization.\nv.push_back(2);\n\nvector<int> v = {1, 2};  // Good -- v starts initialized.\n```\n\nNote that gcc implements `for (int i = 0; i < 10; ++i)` correctly (the scope of i is only the scope of the for loop), so you can then reuse i in another for loop in the same scope. It also correctly scopes declarations in if and while statements, e.g.\n\n```cpp\nwhile (const char* p = strchr(str, '/')) str = p + 1;\n```\n\nThere is one caveat: if the variable is an object, its constructor is invoked every time it enters scope and is created, and its destructor is invoked every time it goes out of scope.\n\n```cpp\n// Inefficient implementation:\nfor (int i = 0; i < 1000000; ++i) {\n    Foo f;  // My ctor and dtor get called 1000000 times each.\n    f.doSomething(i);\n}\n\nIt may be more efficient to declare such a variable used in a loop outside that loop:\n\nFoo f;  // My ctor and dtor get called once each.\nfor (int i = 0; i < 1000000; ++i) {\n    f.doSomething(i);\n}\n```\n\n## Static and Global Variables\n\nStatic or global variables of class type are forbidden: they cause hard-to-find bugs due to indeterminate order of construction and destruction. However, such variables are allowed if they are `constexpr`: they have no dynamic initialization or destruction. \n\nObjects with static storage duration, including global variables, static variables, static class member variables, and function static variables, must be Plain Old Data (POD): only ints, chars, floats, or pointers, or arrays/structs of POD.\n\nThe order in which class constructors and initializers for static variables are called is only partially specified in C++ and can even change from build to build, which can cause bugs that are difficult to find. Therefore in addition to banning globals of class type, we do not allow static POD variables to be initialized with the result of a function, unless that function (such as getenv(), or getpid()) does not itself depend on any other globals.\n\nLikewise, global and static variables are destroyed when the program terminates, regardless of whether the termination is by returning from `main()` or by calling `exit()`. The order in which destructors are called is defined to be the reverse of the order in which the constructors were called. Since constructor order is indeterminate, so is destructor order. For example, at program-end time a static variable might have been destroyed, but code still running — perhaps in another thread — tries to access it and fails. Or the destructor for a static `string` variable might be run prior to the destructor for another variable that contains a reference to that string. \n\nOne way to alleviate the destructor problem is to terminate the program by calling `quick_exit()` instead of `exit()`. The difference is that `quick_exit()` does not invoke destructors and does not invoke any handlers that were registered by calling `atexit()`. If you have a handler that needs to run when a program terminates via `quick_exit()` (flushing logs, for example), you can register it `using at_quick_exit()`. (If you have a handler that needs to run at both exit() and quick_exit(), you need to register it in both places.) \n\nAs a result we only allow static variables to contain POD data. This rule completely disallows vector (use C arrays instead), or string (use const char []).\n\nIf you need a static or global variable of a class type, consider initializing a pointer (which will never be freed), from either your main() function or from pthread_once(). Note that this must be a raw pointer, not a \"smart\" pointer, since the smart pointer's destructor will have the order-of-destructor issue that we are trying to avoid.\n\n# Classes\n\nClasses are the fundamental unit of code in C++. Naturally, we use them extensively. This section lists the main dos and don'ts you should follow when writing a class.\n\n## Doing Work in Constructors\n\nAvoid doing complex initialization in constructors (in particular, initialization that can fail or that requires virtual method calls).\n\n**Definition:**\nIt is possible to perform initialization in the body of the constructor.\n\n**Pros:**\nConvenience in typing. No need to worry about whether the class has been initialized or not.\n\n**Cons:**\nThe problems with doing work in constructors are:\n\n* There is no easy way for constructors to signal errors, short of using exceptions (which are forbidden).\n* If the work fails, we now have an object whose initialization code failed, so it may be an indeterminate state.\n* If the work calls virtual functions, these calls will not get dispatched to the subclass implementations. Future modification to your class can quietly introduce this problem even if your class is not currently subclassed, causing much confusion.\n* If someone creates a global variable of this type (which is against the rules, but still), the constructor code will be called before main(), possibly breaking some implicit assumptions in the constructor code. For instance, gflags will not yet have been initialized.\n\n**Decision:** Constructors should never call virtual functions or attempt to raise non-fatal failures. If your object requires non-trivial initialization, consider using a factory function or Init() method.\n\n## Initialization\n\nIf your class defines member variables, you must provide an in-class initializer for every member variable or write a constructor (which can be a default constructor). If you do not declare any constructors yourself then the compiler will generate a default constructor for you, which may leave some fields uninitialized or initialized to inappropriate values.\n\n**Definition:** The default constructor is called when we new a class object with no arguments. It is always called when calling `new[]` (for arrays). In-class member initialization means declaring a member variable using a construction like `int _count = 17;` or `string name_{\"abc\"};`, as opposed to just `int _count;` or `string _name;`.\n\n**Pros:**\n\nA user defined default constructor is used to initialize an object if no initializer is provided. It can ensure that an object is always in a valid and usable state as soon as it's constructed; it can also ensure that an object is initially created in an obviously \"impossible\" state, to aid debugging.\n\nIn-class member initialization ensures that a member variable will be initialized appropriately without having to duplicate the initialization code in multiple constructors. This can reduce bugs where you add a new member variable, initialize it in one constructor, and forget to put that initialization code in another constructor.\n\n**Cons:**\n\nExplicitly defining a default constructor is extra work for you, the code writer.\n\nIn-class member initialization is potentially confusing if a member variable is initialized as part of its declaration and also initialized in a constructor, since the value in the constructor will override the value in the declaration.\n\n**Decision:**\n\nUse in-class member initialization for simple initializations, especially when a member variable must be initialized the same way in more than one constructor.\n\nIf your class defines member variables that aren't initialized in-class, and if it has no other constructors, you must define a default constructor (one that takes no arguments). It should preferably initialize the object in such a way that its internal state is consistent and valid.\n\nThe reason for this is that if you have no other constructors and do not define a default constructor, the compiler will generate one for you. This compiler generated constructor may not initialize your object sensibly.\n\nIf your class inherits from an existing class but you add no new member variables, you are not required to have a default constructor.\n\n\nThe reason for this is that if you have no other constructors and do not define a default constructor, the compiler will generate one for you. This compiler generated constructor may not initialize your object sensibly.\n\nIf your class inherits from an existing class but you add no new member variables, you are not required to have a default constructor.\n\n## Explicit Constructors\n\nUse the C++ keyword explicit for constructors with one argument.\n\n**Definition:**\n Normally, if a constructor takes one argument, it can be used as a conversion. For instance, if you define Foo::Foo(string name) and then pass a string to a function that expects a Foo, the constructor will be called to convert the string into a Foo and will pass the Foo to your function for you. This can be convenient but is also a source of trouble when things get converted and new objects created without you meaning them to. Declaring a constructor explicit prevents it from being invoked implicitly as a conversion.\n\n**Pros:**\nAvoids undesirable conversions.\n\n**Cons:**\nNone.\n\n**Decision:**\nWe require all single argument constructors to be explicit. Always put explicit in front of one-argument constructors in the class definition: explicit Foo(string name);\n\nThe exception is copy constructors, which, in the rare cases when we allow them, should probably not be explicit. Classes that are intended to be transparent wrappers around other classes are also exceptions. Such exceptions should be clearly marked with comments.\n\nFinally, constructors that take only an initializer_list may be non-explicit. This is to permit construction of your type using the assigment form for brace init lists (i.e. `MyType m = {1, 2}` ).\n\n## Copy Constructors\n\nProvide a copy constructor and assignment operator only when necessary. Otherwise, disable them with `DISALLOW_COPY_AND_ASSIGN`.\n\n**Definition:**\nThe copy constructor and assignment operator are used to create copies of objects. The copy constructor is implicitly invoked by the compiler in some situations, e.g. passing objects by value.\n\n**Pros:**\nCopy constructors make it easy to copy objects. STL containers require that all contents be copyable and assignable. Copy constructors can be more efficient than CopyFrom()-style workarounds because they combine construction with copying, the compiler can elide them in some contexts, and they make it easier to avoid heap allocation.\n\n**Cons:**\nImplicit copying of objects in C++ is a rich source of bugs and of performance problems. It also reduces readability, as it becomes hard to track which objects are being passed around by value as opposed to by reference, and therefore where changes to an object are reflected.\n\n**Decision:**\nFew classes need to be copyable. Most should have neither a copy constructor nor an assignment operator. In many situations, a pointer or reference will work just as well as a copied value, with better performance. For example, you can pass function parameters by reference or pointer instead of by value, and you can store pointers rather than objects in an STL container.\n\nIf your class needs to be copyable, prefer providing a copy method, such as `clone()`, rather than a copy constructor, because such methods cannot be invoked implicitly. If a copy method is insufficient in your situation (e.g. for performance reasons, or because your class needs to be stored by value in an STL container), provide both a copy constructor and assignment operator.\n\nIf your class does not need a copy constructor or assignment operator, you must explicitly disable them. To do so, add dummy declarations for the copy constructor and assignment operator in the private: section of your class, but do not provide any corresponding definition (so that any attempt to use them results in a link error).\n\nFor convenience, a `DISALLOW_COPY_AND_ASSIGN` macro can be used:\n\n```cpp\n// A macro to disallow the copy constructor and operator= functions\n// This should be used in the private: declarations for a class\n#define DISALLOW_COPY_AND_ASSIGN(TypeName) \\\n  TypeName(const TypeName&);               \\\n  void operator=(const TypeName&)\n```\n\nThen, in class Foo:\n\n```cpp\nclass Foo\n{\npublic:\n    Foo(int f);\n    ~Foo();\n\nprivate:\n    DISALLOW_COPY_AND_ASSIGN(Foo);\n};\n```\n\n## Delegating and inheriting constructors\n\nUse delegating and inheriting constructors when they reduce code duplication.\n\n**Definition:**\n\nDelegating and inheriting constructors are two different features, both introduced in C++11, for reducing code duplication in constructors. Delegating constructors allow one of a class's constructors to forward work to one of the class's other constructors, using a special variant of the initialization list syntax. For example:\n\n```cpp\nX::X(const string& name) : name_(name) {\n  ...\n}\n\nX::X() : X(\"\") { }\n```\n\nInheriting constructors allow a derived class to have its base class's constructors available directly, just as with any of the base class's other member functions, instead of having to redeclare them. This is especially useful if the base has multiple constructors. For example:\n\n```cpp\nclass Base {\npublic:\n\tBase();\n\tBase(int n);\n\tBase(const string& s);\n\t...\n};\n\nclass Derived : public Base {\npublic:\n\tusing Base::Base;  // Base's constructors are redeclared here.\n};\n```\n\nThis is especially useful when Derived's constructors don't have to do anything more than calling Base's constructors.\n\n**Pros:**\n\nDelegating and inheriting constructors reduce verbosity and boilerplate, which can improve readability.\n\nDelegating constructors are familiar to Java programmers.\n\n**Cons:**\n\nIt's possible to approximate the behavior of delegating constructors by using a helper function.\n\nInheriting constructors may be confusing if a derived class introduces new member variables, since the base class constructor doesn't know about them.\n\n**Decision:**\n\nUse delegating and inheriting constructors when they reduce boilerplate and improve readability. Be cautious about inheriting constructors when your derived class has new member variables. Inheriting constructors may still be appropriate in that case if you can use in-class member initialization for the derived class's member variables.\n\n\n## Structs vs. Classes\n\nUse a struct only for passive objects that carry data; everything else is a class.\n\nThe struct and class keywords behave almost identically in C++. We add our own semantic meanings to each keyword, so you should use the appropriate keyword for the data-type you're defining.\n\nstructs should be used for passive objects that carry data, and may have associated constants, but lack any functionality other than access/setting the data members. The accessing/setting of fields is done by directly accessing the fields rather than through method invocations. Methods should not provide behavior but should only be used to set up the data members, e.g., constructor, destructor, Initialize(), Reset(), Validate().\n\nIf more functionality is required, a class is more appropriate. If in doubt, make it a class.\n\nFor consistency with STL, you can use struct instead of class for functors and traits.\n\nNote that member variables in structs and classes have different naming rules.\n\n## Inheritance\n\nComposition is often more appropriate than inheritance. When using inheritance, make it public.\n\n**Definition:**\nWhen a sub-class inherits from a base class, it includes the definitions of all the data and operations that the parent base class defines. In practice, inheritance is used in two major ways in C++: implementation inheritance, in which actual code is inherited by the child, and interface inheritance, in which only method names are inherited.\n\n**Pros:**\nImplementation inheritance reduces code size by re-using the base class code as it specializes an existing type. Because inheritance is a compile-time declaration, you and the compiler can understand the operation and detect errors. Interface inheritance can be used to programmatically enforce that a class expose a particular API. Again, the compiler can detect errors, in this case, when a class does not define a necessary method of the API.\n\n**Cons:**\nFor implementation inheritance, because the code implementing a sub-class is spread between the base and the sub-class, it can be more difficult to understand an implementation. The sub-class cannot override functions that are not virtual, so the sub-class cannot change implementation. The base class may also define some data members, so that specifies physical layout of the base class.\n\n**Decision:**\nAll inheritance should be public. If you want to do private inheritance, you should be including an instance of the base class as a member instead.\n\nDo not overuse implementation inheritance. Composition is often more appropriate. Try to restrict use of inheritance to the \"is-a\" case: Bar subclasses Foo if it can reasonably be said that Bar \"is a kind of\" Foo.\n\nMake your destructor virtual if necessary. If your class has virtual methods, its destructor should be virtual.\n\nLimit the use of protected to those member functions that might need to be accessed from subclasses. Note that data members should be private.\n\nWhen redefining an inherited virtual function, explicitly declare it virtual in the declaration of the derived class. Rationale: If virtual is omitted, the reader has to check all ancestors of the class in question to determine if the function is virtual or not.\n\n## Multiple Inheritance\n\nOnly very rarely is multiple implementation inheritance actually useful. We allow multiple inheritance only when at most one of the base classes has an implementation; all other base classes must be pure interface classes tagged with the Interface suffix.\n\n**Definition:** Multiple inheritance allows a sub-class to have more than one base class. We distinguish between base classes that are pure interfaces and those that have an implementation.\n\n**Pros:** Multiple implementation inheritance may let you re-use even more code than single inheritance (see Inheritance).\n\n**Cons:** Only very rarely is multiple implementation inheritance actually useful. When multiple implementation inheritance seems like the solution, you can usually find a different, more explicit, and cleaner solution.\n\n**Decision:** Multiple inheritance is allowed only when all superclasses, with the possible exception of the first one, are pure interfaces. In order to ensure that they remain pure interfaces, they must end with the Interface suffix.\n\nNote: There is an exception to this rule on Windows.\n\n## Interfaces\n\nClasses that satisfy certain conditions are allowed, but not required, to end with an `Interface` suffix.\n\n**Definition:**\n\nA class is a pure interface if it meets the following requirements:\n\n* It has only public pure virtual (\"= 0\") methods and static methods (but see below for destructor).\n* It may not have non-static data members.\n* It need not have any constructors defined. If a constructor is provided, it must take no arguments and it must be protected.\n* If it is a subclass, it may only be derived from classes that satisfy these conditions and are tagged with the Interface suffix.\n\nAn interface class can never be directly instantiated because of the pure virtual method(s) it declares. To make sure all implementations of the interface can be destroyed correctly, the interface must also declare a virtual destructor (in an exception to the first rule, this should not be pure). See Stroustrup, The C++ Programming Language, 3rd edition, section 12.4 for details.\n\n**Pros:**\nTagging a class with the `Interface` suffix lets others know that they must not add implemented methods or non static data members. This is particularly important in the case of multiple inheritance. Additionally, the interface concept is already well-understood by Java programmers.\n\n**Cons:**\nThe `Interface` suffix lengthens the class name, which can make it harder to read and understand. Also, the interface property may be considered an implementation detail that shouldn't be exposed to clients.\n\n**Decision:**\nA class may end with `Interface` only if it meets the above requirements. We do not require the converse, however: classes that meet the above requirements are not required to end with `Interface`.\n\n## Operator Overloading\n\nDo not overload operators except in rare, special circumstances.\n\n**Definition:**\nA class can define that operators such as + and / operate on the class as if it were a built-in type. An overload of `operator\"\"` allows the built-in literal syntax to be used to create objects of class types. \n\n**Pros:**\nOperator overloading can make code appear more intuitive because a class will behave in the same way as built-in types (such as int). Overloaded operators are more playful names for functions that are less-colorfully named, such as `Equals()` or `Add()`.\n\nFor some template functions to work correctly, you may need to define operators.\n\nUser-defined literals are a very concise notation for creating objects of user-defined types.\n\n**Cons:**\nWhile operator overloading can make code more intuitive, it has several drawbacks:\n\n* It can fool our intuition into thinking that expensive operations are cheap, built-in operations.\n* It is much harder to find the call sites for overloaded operators. Searching for `equals()` is much easier than searching for relevant invocations of `==`.\n* Some operators work on pointers too, making it easy to introduce bugs. Foo + 4 may do one thing, while &Foo + 4 does something totally different. The compiler does not complain for either of these, making this very hard to debug.\n* User-defined literals allow creating new syntactic forms that are unfamiliar even to experienced C++ programmers. \n\nOverloading also has surprising ramifications. For instance, if a class overloads unary operator&, it cannot safely be forward-declared.\n\n**Decision:**\nIn general, do not overload operators. The assignment operator (`operator=`), in particular, is insidious and should be avoided. You can define functions like `equals()` and `clone()` if you need them. Likewise, avoid the dangerous unary operator& at all costs, if there's any possibility the class might be forward-declared.\n\nDo not overload `operator\"\"`, i.e. do not introduce user-defined literals. \n\nHowever, there may be rare cases where you need to overload an operator to interoperate with templates or \"standard\" C++ classes (such as `operator<< (ostream&, const T&)` for logging). These are acceptable if fully justified, but you should try to avoid these whenever possible. In particular, do not overload `operator==` or `operator<` just so that your class can be used as a key in an STL container; instead, you should create equality and comparison functor types when declaring the container.\n\nSome of the STL algorithms do require you to overload `operator==`, and you may do so in these cases, provided you document why.\n\nSee also Copy Constructors and Function Overloading.\n\n## Access Control\n\nMake data members private, and provide access to them through accessor functions as needed (for technical reasons, we allow data members of a test fixture class to be protected when using Google Test). Typically a variable would be called `_foo` and the accessor function `getFoo()` . You may also want a mutator function `setFoo()` . Exception: static const data members (typically called FOO) need not be private.\n\nThe definitions of accessors are usually inlined in the header file.\n\nSee also Inheritance and Function Names.\n\n## Declaration Order\n\nUse the specified order of declarations within a class: public: before private:, methods before data members (variables), etc.\n\nYour class definition should start with its public: section, followed by its protected: section and then its private: section. If any of these sections are empty, omit them.\n\nWithin each section, the declarations generally should be in the following order:\n\n* Typedefs and Enums\n* Constants (`static const` data members)\n* Creators (`createXXX` methods)\n* Constructors\n* Destructor\n* Methods, including static methods\n* overriden methods (must have the `override` keyword as suffix)\n* Data Members (except `static const` data members)\n\nFriend declarations should always be in the private section, and the `DISALLOW_COPY_AND_ASSIGN` macro invocation should be at the end of the private: section. It should be the last thing in the class. See Copy Constructors.\n\nMethod definitions in the corresponding .cpp file should be the same as the declaration order, as much as possible.\n\nDo not put large method definitions inline in the class definition. Usually, only trivial or performance-critical, and very short, methods may be defined inline. See Inline Functions for more details.\n\nExample:\n```cpp\nclass MyNode : public Node\n{\n// public first\npublic:\n    // \"creator\" methods first\n    static MyNode *create();\n    static MyNode *createWithParam(const something& arg);\n\n    // If applicable, then Constructors and the Destructor    \n    MyNode();\n    virtual ~MyNode();\n\n    // Then the init methods\n    bool init();\n    bool initWithParam(const something& arg);\n    \n\n    // Then methods of the instance\n    void addColor( const Color& color );\n    void addBackgroundImage( const char* filepath );\n\n    // Then the overrides\n    virtual void visit(void) override;\n    virtual void addChild(Node * child, int zOrder, int tag) override;\n\n// then protected\nprotected:\n    Point absolutePosition();\n\n// then private\nprivate:\n    Point    _lastPosition;\n};\n\n}\n```\n\n## Write Short Functions\n\nPrefer small and focused functions.\n\nWe recognize that long functions are sometimes appropriate, so no hard limit is placed on functions length. If a function exceeds about 40 lines, think about whether it can be broken up without harming the structure of the program.\n\nEven if your long function works perfectly now, someone modifying it in a few months may add new behavior. This could result in bugs that are hard to find. Keeping your functions short and simple makes it easier for other people to read and modify your code.\n\nYou could find long and complicated functions when working with some code. Do not be intimidated by modifying existing code: if working with such a function proves to be difficult, you find that errors are hard to debug, or you want to use a piece of it in several different contexts, consider breaking up the function into smaller and more manageable pieces.\n\n# Other C++ Features\n\n## Ownership and Smart Pointers\n\nPrefer to have single, fixed owners for dynamically allocated objects. Prefer to transfer ownership with smart pointers.\n\n**Definition:**\n\n\"Ownership\" is a bookkeeping technique for managing dynamically allocated memory (and other resources). The owner of a dynamically allocated object is an object or function that is responsible for ensuring that it is deleted when no longer needed. Ownership can sometimes be shared, in which case the last owner is typically responsible for deleting it. Even when ownership is not shared, it can be transferred from one piece of code to another.\n\n\"Smart\" pointers are classes that act like pointers, e.g. by overloading the * and -> operators. Some smart pointer types can be used to automate ownership bookkeeping, to ensure these responsibilities are met. `std::unique_ptr` is a smart pointer type introduced in C++11, which expresses exclusive ownership of a dynamically allocated object; the object is deleted when the `std::unique_ptr` goes out of scope. It cannot be copied, but can be moved to represent ownership transfer. shared_ptr is a smart pointer type which expresses shared ownership of a dynamically allocated object. `shared_ptrs` can be copied; ownership of the object is shared among all copies, and the object is deleted when the last `shared_ptr` is destroyed.\n\n**Pros:**\n\n* It's virtually impossible to manage dynamically allocated memory without some sort of ownership logic.\n* Transferring ownership of an object can be cheaper than copying it (if copying it is even possible).\n* Transferring ownership can be simpler than 'borrowing' a pointer or reference, because it reduces the need to coordinate the lifetime of the object between the two users.\n* Smart pointers can improve readability by making ownership logic explicit, self-documenting, and unambiguous.\n* Smart pointers can eliminate manual ownership bookkeeping, simplifying the code and ruling out large classes of errors.\n* For const objects, shared ownership can be a simple and efficient alternative to deep copying.\n\n**Cons:**\n\n* Ownership must be represented and transferred via pointers (whether smart or plain). Pointer semantics are more complicated than value semantics, especially in APIs: you have to worry not just about ownership, but also aliasing, lifetime, and mutability, among other issues.\n* The performance costs of value semantics are often overestimated, so the performance benefits of ownership transfer might not justify the readability and complexity costs.\n* APIs that transfer ownership force their clients into a single memory management model.\n* Code using smart pointers is less explicit about where the resource releases take place.\n* `std::unique_ptr` expresses ownership transfer using C++11's move semantics, which are generally forbidden in Google code, and may confuse some programmers.\n* Shared ownership can be a tempting alternative to careful ownership design, obfuscating the design of a system.\n* Shared ownership requires explicit bookkeeping at run-time, which can be costly.\n* In some cases (e.g. cyclic references), objects with shared ownership may never be deleted.\n* Smart pointers are not perfect substitutes for plain pointers.\n\n**Decision:**\n\nIf dynamic allocation is necessary, prefer to keep ownership with the code that allocated it. If other code needs access to the object, consider passing it a copy, or passing a pointer or reference without transferring ownership. Prefer to use `std::unique_ptr` to make ownership transfer explicit. For example:\n\n```cpp\nstd::unique_ptr<Foo> FooFactory();\nvoid FooConsumer(std::unique_ptr<Foo> ptr);\n```\n\nDo not design your code to use shared ownership without a very good reason. One such reason is to avoid expensive copy operations, but you should only do this if the performance benefits are significant, and the underlying object is immutable (i.e. `shared_ptr<const Foo>`). If you do use shared ownership, prefer to use shared_ptr.\n\nDo not use `scoped_ptr` in new code unless you need to be compatible with older versions of C++. Never use `linked_ptr` or `std::auto_ptr`. In all three cases, use `std::unique_ptr` instead.\n\n\n## Reference Arguments\n\nAll parameters passed by reference must be labeled `const`.\n\n**Definition:**\nIn C, if a function needs to modify a variable, the parameter must use a pointer, eg int foo(int *pval). In C++, the function can alternatively declare a reference parameter: int foo(int &val).\n\n**Pros:**\nDefining a parameter as reference avoids ugly code like (*pval)++. Necessary for some applications like copy constructors. Makes it clear, unlike with pointers, that a null pointer is not a possible value.\n\n**Cons:**\nReferences can be confusing, as they have value syntax but pointer semantics.\n\n**Decision:**\n\nWithin function parameter lists all references must be const:\n\n```cpp\nvoid foo(const string &in, string *out);\n```\n\nIt is a very strong convention that input arguments are values or const references while output arguments are pointers. Input parameters may be const pointers, but we never allow non-const reference parameters except when required by convention, e.g., `swap()` .\n\nHowever, there are some instances where using `const T*` is preferable to `const T&` for input parameters. For example:\n\n* You want to pass in a null pointer.\n* The function saves a pointer or reference to the input.\n* Passing `const char*` for strings\n\nRemember that most of the time input parameters are going to be specified as `const T&` . Using `const T*` instead communicates to the reader that the input is somehow treated differently. So if you choose `const T*` rather than `const T&` , do so for a concrete reason; otherwise it will likely confuse readers by making them look for an explanation that doesn't exist.\n\n## Rvalue references\n\nDo not use rvalue references, `std::forward`, `std::move_iterator`, or `std::move_if_noexcept`. Use the single-argument form of `std::move` only with non-copyable arguments.\n\n**Definition:** Rvalue references are a type of reference that can only bind to temporary objects. The syntax is similar to traditional reference syntax. For example, void f(string&& s); declares a function whose argument is an rvalue reference to a string.\n\n**Pros:**\n\n* Defining a move constructor (a constructor taking an rvalue reference to the class type) makes it possible to move a value instead of copying it. If `v1` is a `vector<string>`, for example, then `auto v2(std::move(v1))` will probably just result in some simple pointer manipulation instead of copying a large amount of data. In some cases this can result in a major performance improvement.\n* Rvalue references make it possible to write a generic function wrapper that forwards its arguments to another function, and works whether or not its arguments are temporary objects.\n* Rvalue references make it possible to implement types that are moveable but not copyable, which can be useful for types that have no sensible definition of copying but where you might still want to pass them as function arguments, put them in containers, etc.\n* `std::move` is necessary to make effective use of some standard-library types, such as `std::unique_ptr`.\n\n**Cons:**\n\n* Rvalue references are a relatively new feature (introduced as part of C++11), and not yet widely understood. Rules like reference collapsing, and automatic synthesis of move constructors, are complicated.\n* Rvalue references encourage a programming style that makes heavier use of value semantics. This style is unfamiliar to many developers, and its performance characteristics can be hard to reason about.\n\n**Decision:**\n\nDo not use rvalue references, and do not use the `std::forward` or `std::move_if_noexcept` utility functions (which are essentially just casts to rvalue reference types), or `std::move_iterator`. Use single-argument `std::move` only with objects that are not copyable (e.g. `std::unique_ptr`), or in templated code with objects that might not be copyable.\n\n## Function Overloading\n\nUse overloaded functions (including constructors) only if a reader looking at a call site can get a good idea of what is happening without having to first figure out exactly which overload is being called.\n\n**Definition:**\n\nYou may write a function that takes a `const string&` and overload it with another that takes `const char*` .\n\n```cpp\nclass MyClass\n{\npublic:\n    void analyze(const string &text);\n    void analyze(const char *text, size_t textlen);\n};\n```\n\n**Pros:** Overloading can make code more intuitive by allowing an identically-named function to take different arguments. It may be necessary for templatized code, and it can be convenient for Visitors.\n\n**Cons:** If a function is overloaded by the argument types alone, a reader may have to understand C++'s complex matching rules in order to tell what's going on. Also many people are confused by the semantics of inheritance if a derived class overrides only some of the variants of a function.\n\n**Decision:** If you want to overload a function, consider qualifying the name with some information about the arguments, e.g., `appendString()` , `appendInt()` rather than just `append()` .\n\n## Default Arguments\n\nWe do not allow default function parameters, except in limited situations as explained below. Simulate them with function overloading instead, if appropriate.\n\n**Pros:** Often you have a function that uses default values, but occasionally you want to override the defaults. Default parameters allow an easy way to do this without having to define many functions for the rare exceptions. Compared to overloading the function, default arguments have a cleaner syntax, with less boilerplate and a clearer distinction between 'required' and 'optional' arguments.\n\n**Cons:** Function pointers are confusing in the presence of default arguments, since the function signature often doesn't match the call signature. Adding a default argument to an existing function changes its type, which can cause problems with code taking its address. Adding function overloads avoids these problems. In addition, default parameters may result in bulkier code since they are replicated at every call-site -- as opposed to overloaded functions, where \"the default\" appears only in the function definition.\n\n**Decision:**\n\nWhile the cons above are not that onerous, they still outweigh the (small) benefits of default arguments over function overloading. So except as described below, we require all arguments to be explicitly specified.\n\nOne specific exception is when the function is a static function (or in an unnamed namespace) in a .cpp file. In this case, the cons don't apply since the function's use is so localized.\n\nIn particular, the `createXXX` and `initXXX` methods in cocos2dx are allowed to use default arguments.\n\nAnother specific exception is when default arguments are used to simulate variable-length argument lists. Example:\n\n```cpp\n// Support up to 4 params by using a default empty AlphaNum.\nstring strCat(const AlphaNum &a,\n              const AlphaNum &b = gEmptyAlphaNum,\n              const AlphaNum &c = gEmptyAlphaNum,\n              const AlphaNum &d = gEmptyAlphaNum);\n```\n\n## Variable-Length Arrays and alloca()\n\nWe do not allow variable-length arrays or alloca().\n\n**Pros:** Variable-length arrays have natural-looking syntax. Both variable-length arrays and alloca() are very efficient.\n\n**Cons:** Variable-length arrays and alloca are not part of Standard C++. More importantly, they allocate a data-dependent amount of stack space that can trigger difficult-to-find memory overwriting bugs: \"It ran fine on my machine, but dies mysteriously in production\".\n\n**Decision:** Use a safe allocator instead, such as scoped_ptr/scoped_array.\n\n## Friends\n\nWe allow use of friend classes and functions, within reason.\n\nFriends should usually be defined in the same file so that the reader does not have to look in another file to find uses of the private members of a class. A common use of friend is to have a FooBuilder class be a friend of Foo so that it can construct the inner state of Foo correctly, without exposing this state to the world. In some cases it may be useful to make a unittest class a friend of the class it tests.\n\nFriends extend, but do not break, the encapsulation boundary of a class. In some cases this is better than making a member public when you want to give only one other class access to it. However, most classes should interact with other classes solely through their public members.\n\n## Exceptions\n\nWe do not use C++ exceptions.\n\n**Pros:**\n\n* Exceptions allow higher levels of an application to decide how to handle \"can't happen\" failures in deeply nested functions, without the obscuring and error-prone bookkeeping of error codes.\n* Exceptions are used by most other modern languages. Using them in C++ would make it more consistent with Python, Java, and the C++ that others are familiar with.\n* Some third-party C++ libraries use exceptions, and turning them off internally makes it harder to integrate with those libraries.\n* Exceptions are the only way for a constructor to fail. We can simulate this with a factory function or an `init()` method, but these require heap allocation or a new \"invalid\" state, respectively.\n* Exceptions are really handy in testing frameworks.\n\n**Cons:**\n\n* When you add a throw statement to an existing function, you must examine all of its transitive callers. Either they must make at least the basic exception safety guarantee, or they must never catch the exception and be happy with the program terminating as a result. For instance, if f() calls g() calls h(), and h throws an exception that f catches, g has to be careful or it may not clean up properly.\n* More generally, exceptions make the control flow of programs difficult to evaluate by looking at code: functions may return in places you don't expect. This causes maintainability and debugging difficulties. You can minimize this cost via some rules on how and where exceptions can be used, but at the cost of more that a developer needs to know and understand.\n* Exception safety requires both RAII and different coding practices. Lots of supporting machinery is needed to make writing correct exception-safe code easy. Further, to avoid requiring readers to understand the entire call graph, exception-safe code must isolate logic that writes to persistent state into a \"commit\" phase. This will have both benefits and costs (perhaps where you're forced to obfuscate code to isolate the commit). Allowing exceptions would force us to always pay those costs even when they're not worth it.\n* Turning on exceptions adds data to each binary produced, increasing compile time (probably slightly) and possibly increasing address space pressure.\n* The availability of exceptions may encourage developers to throw them when they are not appropriate or recover from them when it's not safe to do so. For example, invalid user input should not cause exceptions to be thrown. We would need to make the style guide even longer to document these restrictions!\n\n**Decision:**\n\nOn their face, the benefits of using exceptions outweigh the costs, especially in new projects. However, for existing code, the introduction of exceptions has implications on all dependent code. If exceptions can be propagated beyond a new project, it also becomes problematic to integrate the new project into existing exception-free code. Because most existing C++ code at Google is not prepared to deal with exceptions, it is comparatively difficult to adopt new code that generates exceptions.\n\nGiven that Google's existing code is not exception-tolerant, the costs of using exceptions are somewhat greater than the costs in a new project. The conversion process would be slow and error-prone. We don't believe that the available alternatives to exceptions, such as error codes and assertions, introduce a significant burden.\n\nOur advice against using exceptions is not predicated on philosophical or moral grounds, but practical ones. Because we'd like to use our open-source projects at Google and it's difficult to do so if those projects use exceptions, we need to advise against exceptions in Google open-source projects as well. Things would probably be different if we had to do it all over again from scratch.\n\nThis prohibition also applies to the exception-related features added in C++11, such as noexcept, `std::exception_ptr`, and `std::nested_exception`. \n\nThere is an exception to this rule (no pun intended) for Windows code.\n\n## Run-Time Type Information (RTTI)\n\ncocos2dx requires Run Time Type Information (RTTI) in order to compile and run. That being said, you should be careful and not abuse the RTTI features.\n\n**Definition:** RTTI allows a programmer to query the C++ class of an object at run time. This is done by use of typeid or dynamic_cast.\n\n**Cons:**\n\nQuerying the type of an object at run-time frequently means a design problem. Needing to know the type of an object at runtime is often an indication that the design of your class hierarchy is flawed.\n\nUndisciplined use of RTTI makes code hard to maintain. It can lead to type-based decision trees or switch statements scattered throughout the code, all of which must be examined when making further changes.\n\n**Pros:**\n\nThe standard alternatives to RTTI (described below) require modification or redesign of the class hierarchy in question. Sometimes such modifications are infeasible or undesirable, particularly in widely-used or mature code.\n\nRTTI can be useful in some unit tests. For example, it is useful in tests of factory classes where the test has to verify that a newly created object has the expected dynamic type. It is also useful in managing the relationship between objects and their mocks.\n\nRTTI is useful when considering multiple abstract objects. Consider\n\n```cpp\nbool Base::equal(Base* other) = 0;\nbool Derived::equal(Base* other)\n{\n    Derived* that = dynamic_cast<Derived*>(other);\n    if (that == NULL)\n        return false;\n    ...\n}\n```\n\n**Decision:**\n\nRTTI has legitimate uses but is prone to abuse, so you must be careful when using it. You may use it freely in unittests, but avoid it when possible in other code. In particular, think twice before using RTTI in new code. If you find yourself needing to write code that behaves differently based on the class of an object, consider one of the following alternatives to querying the type:\n\n* Virtual methods are the preferred way of executing different code paths depending on a specific subclass type. This puts the work within the object itself.\n* If the work belongs outside the object and instead in some processing code, consider a double-dispatch solution, such as the Visitor design pattern. This allows a facility outside the object itself to determine the type of class using the built-in type system.\n\nWhen the logic of a program guarantees that a given instance of a base class is in fact an instance of a particular derived class, then a `dynamic_cast` may be used freely on the object. Usually one can use a `static_cast` as an alternative in such situations.\n\nDecision trees based on type are a strong indication that your code is on the wrong track.\n\n```cpp\nif (typeid(*data) == typeid(D1)) {\n    ...\n} else if (typeid(*data) == typeid(D2)) {\n    ...\n} else if (typeid(*data) == typeid(D3)) {\n    ...\n```\n\nCode such as this usually breaks when additional subclasses are added to the class hierarchy. Moreover, when properties of a subclass change, it is difficult to find and modify all the affected code segments.\n\nDo not hand-implement an RTTI-like workaround. The arguments against RTTI apply just as much to workarounds like class hierarchies with type tags. Moreover, workarounds disguise your true intent.\n\n## Casting\n\nUse C++ casts like `static_cast<>()`. Do not use other cast formats like `int y = (int)x; or int y = int(x);`.\n\n**Definition:** C++ introduced a different cast system from C that distinguishes the types of cast operations.\n\n**Pros:** The problem with C casts is the ambiguity of the operation; sometimes you are doing a conversion (e.g., (int)3.5) and sometimes you are doing a cast (e.g., (int)\"hello\"); C++ casts avoid this. Additionally C++ casts are more visible when searching for them.\n\n**Cons:** The syntax is nasty.\n\n**Decision:**\n\nDo not use C-style casts. Instead, use these C++-style casts.\n\n* Use `static_cast` as the equivalent of a C-style cast that does value conversion, or when you need to explicitly up-cast a pointer from a class to its superclass.\n* Use `const_cast` to remove the const qualifier (see const).\n* Use `reinterpret_cast` to do unsafe conversions of pointer types to and from integer and other pointer types. Use this only if you know what you are doing and you understand the aliasing issues.\n\nSee the RTTI section for guidance on the use of dynamic_cast.\n\n## Streams\n\nUse streams only for logging.\n\n**Definition:** Streams are a replacement for printf() and scanf().\n\n**Pros:** With streams, you do not need to know the type of the object you are printing. You do not have problems with format strings not matching the argument list. (Though with gcc, you do not have that problem with printf either.) Streams have automatic constructors and destructors that open and close the relevant files.\n\n**Cons:** Streams make it difficult to do functionality like pread(). Some formatting (particularly the common format string idiom %.*s) is difficult if not impossible to do efficiently using streams without using printf-like hacks. Streams do not support operator reordering (the %1s directive), which is helpful for internationalization.\n\n**Decision:**\n\nDo not use streams, except where required by a logging interface. Use printf-like routines instead.\n\nThere are various pros and cons to using streams, but in this case, as in many other cases, consistency trumps the debate. Do not use streams in your code.\n\n**Extended Discussion**\n\nThere has been debate on this issue, so this explains the reasoning in greater depth. Recall the Only One Way guiding principle: we want to make sure that whenever we do a certain type of I/O, the code looks the same in all those places. Because of this, we do not want to allow users to decide between using streams or using printf plus Read/Write/etc. Instead, we should settle on one or the other. We made an exception for logging because it is a pretty specialized application, and for historical reasons.\n\nProponents of streams have argued that streams are the obvious choice of the two, but the issue is not actually so clear. For every advantage of streams they point out, there is an equivalent disadvantage. The biggest advantage is that you do not need to know the type of the object to be printing. This is a fair point. But, there is a downside: you can easily use the wrong type, and the compiler will not warn you. It is easy to make this kind of mistake without knowing when using streams.\n\n```cpp\ncout << this;  // Prints the address\ncout << *this;  // Prints the contents\n```\n\nThe compiler does not generate an error because << has been overloaded. We discourage overloading for just this reason.\n\nSome say `printf` formatting is ugly and hard to read, but streams are often no better. Consider the following two fragments, both with the same typo. Which is easier to discover?\n\n```cpp\ncerr << \"Error connecting to '\" << foo->bar()->hostname.first\n     << \":\" << foo->bar()->hostname.second << \": \" << strerror(errno);\n\nfprintf(stderr, \"Error connecting to '%s:%u: %s\",\n        foo->bar()->hostname.first, foo->bar()->hostname.second,\n        strerror(errno));\n```\n\nAnd so on and so forth for any issue you might bring up. (You could argue, \"Things would be better with the right wrappers,\" but if it is true for one scheme, is it not also true for the other? Also, remember the goal is to make the language smaller, not add yet more machinery that someone has to learn.)\n\nEither path would yield different advantages and disadvantages, and there is not a clearly superior solution. The simplicity doctrine mandates we settle on one of them though, and the majority decision was on printf + read/write.\n\n## Preincrement and Predecrement\n\nUse prefix form (++i) of the increment and decrement operators with iterators and other template objects.\n\n**Definition:** When a variable is incremented (++i or i++) or decremented (--i or i--) and the value of the expression is not used, one must decide whether to preincrement (decrement) or postincrement (decrement).\n\n**Pros:** When the return value is ignored, the \"pre\" form (++i) is never less efficient than the \"post\" form (i++), and is often more efficient. This is because post-increment (or decrement) requires a copy of i to be made, which is the value of the expression. If i is an iterator or other non-scalar type, copying i could be expensive. Since the two types of increment behave the same when the value is ignored, why not just always pre-increment?\n\n**Cons:** The tradition developed, in C, of using post-increment when the expression value is not used, especially in for loops. Some find post-increment easier to read, since the \"subject\" (i) precedes the \"verb\" (++), just like in English.\n\n**Decision:** For simple scalar (non-object) values there is no reason to prefer one form and we allow either. For iterators and other template types, use pre-increment.\n\n## Use of const\n\nUse `const` whenever it makes sense. With C++11, `constexpr` is a better choice for some uses of `const`. \n\n**Definition:** Declared variables and parameters can be preceded by the keyword const to indicate the variables are not changed (e.g., `const int foo`). Class functions can have the `const` qualifier to indicate the function does not change the state of the class member variables (e.g., `class Foo { int Bar(char c) const; };`).\n\n**Pros:** Easier for people to understand how variables are being used. Allows the compiler to do better type checking, and, conceivably, generate better code. Helps people convince themselves of program correctness because they know the functions they call are limited in how they can modify your variables. Helps people know what functions are safe to use without locks in multi-threaded programs.\n\n**Cons:** `const` is viral: if you pass a const variable to a function, that function must have `const` in its prototype (or the variable will need a `const_cast`). This can be a particular problem when calling library functions.\n\n**Decision:**\n\n`const` variables, data members, methods and arguments add a level of compile-time type checking; it is better to detect errors as soon as possible. Therefore we strongly recommend that you use `const` whenever it makes sense to do so:\n\n* If a function does not modify an argument passed by reference or by pointer, that argument should be `const`.\n* Declare methods to be `const` whenever possible. Accessors should almost always be `const`. Other methods should be `const` if they do not modify any data members, do not call any non-const methods, and do not return a non-const pointer or non-const reference to a data member.\n* Consider making data members `const` whenever they do not need to be modified after construction.\n\nThe `mutable` keyword is allowed but is unsafe when used with threads, so thread safety should be carefully considered first.\n\n** Where to put the `const` **\n\nSome people favor the form `int const *foo` to `const int* foo`. They argue that this is more readable because it's more consistent: it keeps the rule that `const` always follows the object it's describing. However, this consistency argument doesn't apply in codebases with few deeply-nested pointer expressions since most `const` expressions have only one `const`, and it applies to the underlying value. In such cases, there's no consistency to maintain. Putting the `const` first is arguably more readable, since it follows English in putting the \"adjective\" (const) before the \"noun\" (int).\n\nThat said, while we encourage putting `const` first, we do not require it. But be consistent with the code around you!\n\n## Use of constexpr\n\nIn C++11, use `constexpr` to define true constants or to ensure constant initialization.\n\n**Definition:** Some variables can be declared `constexpr` to indicate the variables are true constants, i.e. fixed at compilation/link time. Some functions and constructors can be declared constexpr which enables them to be used in defining a constexpr variable.\n\n**Pros:** Use of `constexpr` enables definition of constants with floating-point expressions rather than just literals; definition of constants of user-defined types; and definition of constants with function calls.\n\n**Cons:** Prematurely marking something as constexpr may cause migration problems if later on it has to be downgraded. Current restrictions on what is allowed in constexpr functions and constructors may invite obscure workarounds in these definitions.\n\n**Decision:**\n\n`constexpr` definitions enable a more robust specification of the constant parts of an interface. Use `constexpr` to specify true constants and the functions that support their definitions. Avoid complexifying function definitions to enable their use with constexpr. Do not use constexpr to force inlining.\n\n## Use of constexpr\n\nIn C++11, use `constexpr` to define true constants or to ensure constant initialization.\n\n**Definition:** Some variables can be declared constexpr to indicate the variables are true constants, i.e. fixed at compilation/link time. Some functions and constructors can be declared constexpr which enables them to be used in defining a constexpr variable.\n\n**Pros:** Use of constexpr enables definition of constants with floating-point expressions rather than just literals; definition of constants of user-defined types; and definition of constants with function calls.\n\n**Cons:** Prematurely marking something as `constexpr` may cause migration problems if later on it has to be downgraded. Current restrictions on what is allowed in constexpr functions and constructors may invite obscure workarounds in these definitions.\n\n**Decision:**\n\n`constexpr` definitions enable a more robust specification of the constant parts of an interface. Use constexpr to specify true constants and the functions that support their definitions. Avoid complexifying function definitions to enable their use with constexpr. Do not use constexpr to force inlining.\n\n\n## Integer Types\n\nOf the built-in C++ integer types, the only one used is `int`. If a program needs a variable of a different size, use a precise-width integer type from `<stdint.h>`, such as `int16_t`. If your variable represents a value that could ever be greater than or equal to 2^31 (2GiB), use a 64-bit type such as `int64_t`. Keep in mind that even if your value won't ever be too large for an `int`, it may be used in intermediate calculations which may require a larger type. When in doubt, choose a larger type.\n\n**Definition:** C++ does not specify the sizes of its integer types. Typically people assume that `short` is 16 bits, `int` is 32 bits, `long` is 32 bits and `long long` is 64 bits.\n\n**Pros:** Uniformity of declaration.\n\n**Cons:** The sizes of integral types in C++ can vary based on compiler and architecture.\n\n**Decision:**\n\n`<stdint.h>` defines types like `int16_t` , `uint32_t` , `int64_t` , etc. You should always use those in preference to `short`, `unsigned long long` and the like, when you need a guarantee on the size of an integer. Of the C integer types, only int should be used. When appropriate, you are welcome to use standard types like `size_t` and `ptrdiff_t` .\n\nWe use `int` very often, for integers we know are not going to be too big, e.g., loop counters. Use plain old `int` for such things. You should assume that an `int` is at least 32 bits, but don't assume that it has more than 32 bits. If you need a 64-bit integer type, use `int64_t` or `uint64_t` .\n\nFor integers we know can be \"big\", use `int64_t` .\n\nYou should not use the unsigned integer types such as `uint32_t`, unless there is a valid reason such as representing a bit pattern rather than a number, or you need defined overflow modulo 2^N. In particular, do not use unsigned types to say a number will never be negative. Instead, use assertions for this.\n\nIf your code is a container that returns a size, be sure to use a type that will accommodate any possible usage of your container. When in doubt, use a larger type rather than a smaller type.\n\nUse care when converting integer types. Integer conversions and promotions can cause non-intuitive behavior.\n\n### On Unsigned Integers\n\nSome people, including some textbook authors, recommend using unsigned types to represent numbers that are never negative. This is intended as a form of self-documentation. However, in C, the advantages of such documentation are outweighed by the real bugs it can introduce. Consider:\n\n```cpp\n// buggy code\nfor (unsigned int i = foo.Length()-1; i >= 0; --i) ...\n```\n\nThis code will never terminate! Sometimes gcc will notice this bug and warn you, but often it will not. Equally bad bugs can occur when comparing signed and unsigned variables. Basically, C's type-promotion scheme causes unsigned types to behave differently than one might expect.\n\nSo, document that a variable is non-negative using assertions. Don't use an unsigned type.\n\n## 64-bit Portability\n\nCode should be 64-bit and 32-bit friendly. Bear in mind problems of printing, comparisons, and structure alignment.\n\n* `printf()` specifiers for some types are not cleanly portable between 32-bit and 64-bit systems. C99 defines some portable format specifiers. Unfortunately, MSVC 7.1 does not understand some of these specifiers and the standard is missing a few, so we have to define our own ugly versions in some cases (in the style of the standard include file inttypes.h):\n\n```cpp\n// printf macros for size_t, in the style of inttypes.h\n#ifdef _LP64\n#define __PRIS_PREFIX \"z\"\n#else\n#define __PRIS_PREFIX\n#endif\n\n// Use these macros after a % in a printf format string\n// to get correct 32/64 bit behavior, like this:\n// size_t size = records.size();\n// printf(\"%\"PRIuS\"\\n\", size);\n\n#define PRIdS __PRIS_PREFIX \"d\"\n#define PRIxS __PRIS_PREFIX \"x\"\n#define PRIuS __PRIS_PREFIX \"u\"\n#define PRIXS __PRIS_PREFIX \"X\"\n#define PRIoS __PRIS_PREFIX \"o\"\n```\n\n* For `void *` (or any pointer) DO NOT USE `%lx`. Instead USE  `%p`\n* For `int64_t` DO NOT USE `%qd, %lld`. Instead USE `%\"PRId64\"`\n* For `uint64_t` DO NOT USE `%qu, %llu, %llx`. Instead USE `%\"PRIu64\", %\"PRIx64\"`\n* For `size_t` DO NOT USE `%u`. Instead USE `%\"PRIuS\", %\"PRIxS`.  C99 specifies `%zu`\n* For `ptrdiff_t` DO NOT USE `%d`. Instead USE `%\"PRIdS\"`. C99 specifies `%td`\n\nNote that the `PRI*` macros expand to independent strings which are concatenated by the compiler. Hence if you are using a non-constant format string, you need to insert the value of the macro into the format, rather than the name. It is still possible, as usual, to include length specifiers, etc., after the % when using the PRI* macros. So, e.g. `printf(\"x = %30\"PRIuS\"\\n\", x)` would expand on 32-bit Linux to `printf(\"x = %30\" \"u\" \"\\n\", x)`, which the compiler will treat as `printf(\"x = %30u\\n\", x)`.\n\n* Remember that `sizeof(void *) != sizeof(int)`. Use `intptr_t` if you want a pointer-sized integer.\n* You may need to be careful with structure alignments, particularly for structures being stored on disk. Any class/structure with a int64_t/uint64_t member will by default end up being 8-byte aligned on a 64-bit system. If you have such structures being shared on disk between 32-bit and 64-bit code, you will need to ensure that they are packed the same on both architectures. Most compilers offer a way to alter structure alignment. For gcc, you can use `__attribute__((packed))`. MSVC offers `#pragma pack()` and `__declspec(align())`.\n* Use the `LL` or `ULL` suffixes as needed to create 64-bit constants. For example:\n\n```cpp\nint64_t my_value = 0x123456789LL;\nuint64_t my_mask = 3ULL << 48;\n```\n\n    If you really need different code on 32-bit and 64-bit systems, use #ifdef _LP64 to choose between the code variants. (But please avoid this if possible, and keep any such changes localized.)\n\n## Preprocessor Macros\n\nBe very cautious with macros. Prefer inline functions, enums, and const variables to macros.\n\nMacros mean that the code you see is not the same as the code the compiler sees. This can introduce unexpected behavior, especially since macros have global scope.\n\nLuckily, macros are not nearly as necessary in C++ as they are in C. Instead of using a macro to inline performance-critical code, use an inline function. Instead of using a macro to store a constant, use a const variable. Instead of using a macro to \"abbreviate\" a long variable name, use a reference. Instead of using a macro to conditionally compile code ... well, don't do that at all (except, of course, for the #define guards to prevent double inclusion of header files). It makes testing much more difficult.\n\nMacros can do things these other techniques cannot, and you do see them in the codebase, especially in the lower-level libraries. And some of their special features (like stringifying, concatenation, and so forth) are not available through the language proper. But before using a macro, consider carefully whether there's a non-macro way to achieve the same result.\n\nThe following usage pattern will avoid many problems with macros; if you use macros, follow it whenever possible:\n\n* Don't define macros in a .h file.\n* `#define` macros right before you use them, and `#undef` them right after.\n* Do not just #undef an existing macro before replacing it with your own; instead, pick a name that's likely to be unique.\n* Try not to use macros that expand to unbalanced C++ constructs, or at least document that behavior well.\n* Prefer not using ## to generate function/class/variable names.\n\n## 0 and nullptr/NULL\n\nUse 0 for integers, 0.0 for reals, nullptr (or NULL) for pointers, and '\\0' for chars.\n\nUse 0 for integers and 0.0 for reals. This is not controversial.\n\nFor pointers (address values), there is a choice between `0`, `NULL`, and `nullptr`. For projects that allow C++11 features, use `nullptr`. For C++03 projects, we prefer `NULL` because it looks like a pointer. In fact, some C++ compilers provide special definitions of `NULL` which enable them to give useful warnings, particularly in situations where `sizeof(NULL)` is not equal to `sizeof(0)`.\n\nUse `'\\0'` for chars. This is the correct type and also makes code more readable.\n\n## sizeof\n\nPrefer `sizeof(varname)` to `sizeof(type)`.\n\nUse `sizeof(varname)` when you take the size of a particular variable. `sizeof(varname)` will update appropriately if someone changes the variable type either now or later. You may use `sizeof(type)` for code unrelated to any particular variable, such as code that manages an external or internal data format where a variable of an appropriate C++ type is not convenient.\n\n```cpp\nStruct data;\nmemset(&data, 0, sizeof(data)); // GOOD\n\nmemset(&data, 0, sizeof(Struct)); // BAD\n\nif (raw_size < sizeof(int)) {\n    LOG(ERROR) << \"compressed record not big enough for count: \" << raw_size;\n    return false;\n}\n```\n\n## auto\n\nUse `auto` to avoid type names that are just clutter. Continue to use manifest type declarations when it helps readability, and never use `auto` for anything but local variables.\n\n**Definition:** In C++11, a variable whose type is given as `auto` will be given a type that matches that of the expression used to initialize it. You can use `auto` either to initialize a variable by copying, or to bind a reference.\n\n```cpp\nvector<string> v;\n...\nauto s1 = v[0];  // Makes a copy of v[0].\nconst auto& s2 = v[0];  // s2 is a reference to v[0].\n```\n\n**Pros:**\n\nC++ type names can sometimes be long and cumbersome, especially when they involve templates or namespaces. In a statement like\n\n```cpp\nsparse_hash_map<string, int>::iterator iter = m.find(val);\n```\n\nthe return type is hard to read, and obscures the primary purpose of the statement. Changing it to\n\n```cpp\nauto iter = m.find(val);\n```\n\nmakes it more readable.\n\nWithout `auto` we are sometimes forced to write a type name twice in the same expression, adding no value for the reader, as in\n\n```cpp\ndiagnostics::ErrorStatus* status = new diagnostics::ErrorStatus(\"xyz\");\n```\n\nUsing `auto` makes it easier to use intermediate variables when appropriate, by reducing the burden of writing their types explicitly.\n\n**Cons:**\n\nSometimes code is clearer when types are manifest, especially when a variable's initialization depends on things that were declared far away. In an expression like\n\n```cpp\nauto i = x.Lookup(key);\n```\n\nit may not be obvious what i's type is, if x was declared hundreds of lines earlier.\n\nProgrammers have to understand the difference between `auto` and `const auto&` or they'll get copies when they didn't mean to.\n\nThe interaction between auto and C++11 brace-initialization can be confusing. The declarations\n\n```cpp\nauto x(3);  // Note: parentheses.\nauto y{3};  // Note: curly braces.\n```\n\nmean different things — x is an int, while y is an initializer_list. The same applies to other normally-invisible proxy types.\n\nIf an `auto` variable is used as part of an interface, e.g. as a constant in a header, then a programmer might change its type while only intending to change its value, leading to a more radical API change than intended.\n\n**Decision:**\n\n`auto` is permitted, for local variables only. Do not use `auto` for file-scope or namespace-scope variables, or for class members. Never assign a braced initializer list to an auto-typed variable.\n\nThe `auto` keyword is also used in an unrelated C++11 feature: it's part of the syntax for a new kind of function declaration with a trailing return type. Function declarations with trailing return types are not permitted.\n\n## Brace Initialization\n\nYou may use brace initialization.\n\nIn C++03, aggregate types (arrays and structs with no constructor) could be initialized using braces.\n\n```cpp\nstruct Point { int x; int y; };\nPoint p = {1, 2};\n```\n\nIn C++11, this syntax has been expanded for use with all other datatypes. The brace initialization form is called braced-init-list. Here are a few examples of its use.\n\n```cpp\n// Vector takes lists of elements.\nvector<string> v{\"foo\", \"bar\"};\n\n// The same, except this form cannot be used if the initializer_list\n// constructor is explicit. You may choose to use either form.\nvector<string> v = {\"foo\", \"bar\"};\n\n// Maps take lists of pairs. Nested braced-init-lists work.\nmap<int, string> m = {{1, \"one\"}, {2, \"2\"}};\n\n// braced-init-lists can be implicitly converted to return types.\nvector<int> testFunction() {\n  return {1, 2, 3};\n}\n\n// Iterate over a braced-init-list.\nfor (int i : {-1, -2, -3}) {}\n\n// Call a function using a braced-init-list.\nvoid testFunction2(vector<int> v) {}\ntestFunction2({1, 2, 3});\n```\n\nUser data types can also define constructors that take initializer_list, which is automatically created from braced-init-list:\n\n```cpp\nclass MyType\n{\npublic:\n    // initializer_list is a reference to the underlying init list,\n    // so it can be passed by value.\n    MyType(initializer_list<int> init_list) {\n      for (int element : init_list) {}\n    }\n};\nMyType m{2, 3, 5, 7};\n```\n\nFinally, brace initialization can also call ordinary constructors of data types that do not have initializer_list constructors.\n\n```cpp\ndouble d{1.23};\n// Calls ordinary constructor as long as MyOtherType has no\n// initializer_list constructor.\nclass MyOtherType\n{\npublic:\n    explicit MyOtherType(string);\n    MyOtherType(int, string);\n};\nMyOtherType m = {1, \"b\"};\n// If the constructor is explicit, you can't use the \"= {}\" form.\nMyOtherType m{\"b\"};\n```\n\nNever assign a braced-init-list to an auto local variable. In the single element case, what this means can be confusing.\n\n```cpp\nauto d = {1.23};        // d is an initializer_list<double>\n\nauto d = double{1.23};  // Good -- d is a double, not an initializer_list.\n```\n\n## Lambda expressions\n\nUse lambda expressions, or the related `std::function` or `std::bind` utilities only in special places like cocos2d callbacks.\n\n**Definition:** Lambda expressions are a concise way of creating anonymous function objects. They're often useful when passing functions as arguments. For example: `std::sort(v.begin(), v.end(), [](string x, string y) { return x[1] < y[1]; });` Lambdas were introduced in C++11 along with a set of utilities for working with function objects, such as the polymorphic wrapper `std::function`.\n\n**Pros:**\n\n* Lambdas are much more concise than other ways of defining function objects to be passed to STL algorithms, which can be a readability improvement.\n* Lambdas, `std::function`, and `std::bind` can be used in combination as a general purpose callback mechanism; they make it easy to write functions that take bound functions as arguments.\n\n**Cons:**\n\n* Variable capture in lambdas can be tricky, and might be a new source of dangling-pointer bugs.\n* It's possible for use of lambdas to get out of hand; very long nested anonymous functions can make code harder to understand.\n\nDecision:\n\nUse lambda expressions, or the related `std::function` or `std::bind` utilities only in special places like cocos2d callbacks.\n\n## Boost\n\nDo not use boost.\n\n**Definition:** The Boost library collection is a popular collection of peer-reviewed, free, open-source C++ libraries.\n\n**Pros:** Boost code is generally very high-quality, is widely portable, and fills many important gaps in the C++ standard library, such as type traits, better binders, and better smart pointers. It also provides an implementation of the TR1 extension to the standard library.\n\n**Cons:** Some Boost libraries encourage coding practices which can hamper readability, such as metaprogramming and other advanced template techniques, and an excessively \"functional\" style of programming. It also adds more dependencies in cocos2d-x.\n\n**Decision:**\nIn order to maintain a high level of readability for all contributors who might read and maintain code, and also in order to keep the dependencies as minimal as possible, we do not use Boost.\n\n## C++11\n\nUse libraries and language extensions from C++11 (formerly known as C++0x) when appropriate. Consider portability to other environments before using C++11 features in your project.\n\n**Definition:** C++11 is the latest ISO C++ standard. It contains significant changes both to the language and libraries.\n\n**Pros:** C++11 has become the official standard, and eventually will be supported by most C++ compilers. It standardizes some common C++ extensions that we use already, allows shorthands for some operations, and has some performance and safety improvements.\n\n**Cons:**\n\nThe C++11 standard is substantially more complex than its predecessor (1,300 pages versus 800 pages), and is unfamiliar to many developers. The long-term effects of some features on code readability and maintenance are unknown. We cannot predict when its various features will be implemented uniformly by tools that may be of interest, particularly in the case of projects that are forced to use older versions of tools.\n\nAs with Boost, some C++11 extensions encourage coding practices that hamper readability—for example by removing checked redundancy (such as type names) that may be helpful to readers, or by encouraging template metaprogramming. Other extensions duplicate functionality available through existing mechanisms, which may lead to confusion and conversion costs.\n\n**Decision:**\n\nC++11 features may be used unless specified otherwise. In addition to what's described in the rest of the style guide, the following C++11 features may not be used:\n\n* Functions with trailing return types, e.g. writing `auto foo() -> int;` instead of `int foo();`, because of a desire to preserve stylistic consistency with the many existing function declarations.\n* Compile-time rational numbers (`<ratio>`), because of concerns that it's tied to a more template-heavy interface style.\n* The `<cfenv>` and `<fenv.h>` headers, because many compilers do not support those features reliably.\n\nAdditionaly, any C++11 features that is used, must work on the following compilers:\n\n* Xcode 5.0.2 or newer\n* gcc 4.8 or newer\n* VS 2012 or newer\n\n## General Naming Rules\n\nFunction names, variable names, and filenames should be descriptive; eschew abbreviation.\n\nGive as descriptive a name as possible, within reason. Do not worry about saving horizontal space as it is far more important to make your code immediately understandable by a new reader. Do not use abbreviations that are ambiguous or unfamiliar to readers outside your project, and do not abbreviate by deleting letters within a word.\n\n```cpp\n// OK\nint priceCountReader;     // No abbreviation.\nint numErrors;            // \"num\" is a widespread convention.\nint numDNSConnections;    // Most people know what \"DNS\" stands for.\n```\n\n```cpp\n// BAD\nint n;                     // Meaningless.\nint nerr;                  // Ambiguous abbreviation.\nint nCompConns;            // Ambiguous abbreviation.\nint wgcConnections;        // Only your group knows what this stands for.\nint pcReader;              // Lots of things can be abbreviated \"pc\".\nint cstmrId;               // Deletes internal letters.\n```\n\n## File Names\n\nFilenames should be all in CamelCasel, and for cocos2d specific files, they should start with the `CC` prefix as well.\n\nExamples of acceptable file names:\n\n\n\tCCSprite.cpp\n\tCCTextureCache.cpp\n\tCCTexture2D.cpp\n\nC++ files should end in `.cpp` and header files should end in `.h`.\n\nDo not use filenames that already exist in /usr/include, such as db.h.\n\nIn general, make your filenames very specific. For example, use `CCTexture2D.h` rather than `Texture.h`. A very common case is to have a pair of files called, e.g., `FooBar.h` and `FooBar.cpp` , defining a class called `FooBar` .\n\nInline functions must be in a `.h` file. If your inline functions are very short, they should go directly into your .h file. However, if your inline functions include a lot of code, they may go into a third file that ends in `-inl.h` . In a class with a lot of inline code, your class could have three files:\n\n```cpp\nUrlTable.h       // The class declaration.\nUrlTable.cpp     // The class definition.\nUrlTable-inl.h   // Inline functions that include lots of code.\n```\n\nSee also the section -inl.h Files\n\n## Type Names\n\nType names start with a capital letter and have a capital letter for each new word, with no underscores: `MyExcitingClass`, `MyExcitingEnum`.\n\nThe names of all types — classes, structs, typedefs, and enums — have the same naming convention. Type names should start with a capital letter and have a capital letter for each new word. No underscores. For example:\n\n```cpp\n// classes and structs\nclass UrlTable { ...\nclass UrlTableTester { ...\nstruct UrlTableProperties { ...\n\n// typedefs\ntypedef hash_map<UrlTableProperties *, string> PropertiesMap;\n\n// enums\nenum UrlTableErrors { ...\n```\n\n## Variable Names\n\nVariable names are all camelCase (they start with lowercase). Class member variables have an underscore as prefix. For instance: `myExcitingLocalVariable` , `_myExcitingLocalVariable` .\nAll lowercase variables are accepted as well.\n\n### Common Variable names\n\nFor example:\n\n```cpp\nstring tableName;  // OK - uses camelcase\nstring tablename;   // OK - all lowercase.\n\nstring table_name;   // Bad - uses underscore.\nstring TableNname;   // Bad - starts with Uppercase\n```\n\n### Class Data Members\n\nData members (also called instance variables or member variables) are lowercase with optional underscores like regular variable names, but always end with a trailing underscore.\n\n```cpp\nstring _tableName;   // OK\nstring _tablename;   // OK\n```\n\n### Struct Variables\n\nData members in structs should be named like regular variables without the underscores as prefix that data members in classes have.\n\n```cpp\nstruct UrlTableProperties {\n  string name;\n  int numEntries;\n}\n```\n\nSee Structs vs. Classes for a discussion of when to use a struct versus a class.\n\n### Global Variables\n\nThere are no special requirements for global variables, which should be rare in any case, but if you use one, consider prefixing it with `g_` or some other marker to easily distinguish it from local variables.\n\n## Constant Names\n\nConstant names should all be in UPPERCASE with underscores to separate the words.\n\nDo not use `#define` for consts.\n\nPrefer strongly typed enums over `const` variables, whenever it makes sense.\n\nAll compile-time constants, whether they are declared locally, globally, or as part of a class, follow a slightly different naming convention from other variables. They should be declared in UPPERCASE and use underscore to separate the different words:\n\n```cpp\nconst int MENU_DEFAULT_VALUE = 10;\nconst float GRAVITY = -9.8;\n\nenum class Projection {\n  ORTHOGONAL,\n  PERSPECTIVE\n};\n\nenum class PixelFormat {\n  RGBA_8888,\n  RGBA_4444,\n  RGBA_5551,\n  RGB_565,\n};\n```\n\n## Function Names\n\nRegular functions have mixed case; accessors and mutators match the name of the variable: `myExcitingFunction()`, `myExcitingMethod()`, `getMyExcitingMemberVariable()`, `setMyExcitingMemberVariable`.\n\n### Regular Functions\n\nFunctions should start with lowercase and have a capital letter for each new word. No underscores.\n\nIf your function crashes upon an error, you should append OrDie to the function name. This only applies to functions which could be used by production code and to errors that are reasonably likely to occur during normal operation.\n\n```cpp\naddTableEntry()\ndeleteUrl()\nopenFileOrDie()\n```\n\n### Accessors and Mutators\n\nAccessors and mutators ( `get` and `set` functions) should match the name of the variable they are getting and setting. This shows an excerpt of a class whose instance variable is `_numEntries` .\n\n```cpp\nclass MyClass {\n public:\n  ...\n  int getNumEntries() const { return _numEntries; }\n  void setNumEntries(int numEntries) { _numEntries = numEntries; }\n\n private:\n  int _numEntries;\n};\n```\n\n## Namespace Names\n\nNamespace names are all lower-case, and based on project names and possibly their directory structure: google_awesome_project.\n\nSee Namespaces for a discussion of namespaces and how to name them.\n\n## Enumerator Names\n\nEnumerators should be named either like constants: `ENUM_NAME`.\n\nPrefer strongly typed enums over non-strongly typed enums.\n\n```cpp\nenum class UrlTableErrors {\n  OK = 0,\n  ERROR_OUT_OF_MEMORY,\n  ERROR_MALFORMED_INPUT,\n};\n```\n\n## Macro Names\n\nYou're not really going to define a macro, are you? If you do, they're like this: CC_MY_MACRO_THAT_SCARES_SMALL_CHILDREN.\n\nPlease see the description of macros; in general macros should not be used. However, if they are absolutely needed, then they should be named with all capitals and underscores, and they should be prefixed with `CC_` or `CC`\n\n```cpp\n#define CC_ROUND(x) ...\n#define CC_PI_ROUNDED 3.0\n#define CCLOG(x) ...\n```\n\n## Exceptions to Naming Rules\n\nIf you are naming something that is analogous to an existing C or C++ entity then you can follow the existing naming convention scheme.\n\n### `bigopen()`\n    \nfunction name, follows form of open() \n\n### `uint`\n\ntypedef \n\n### `bigpos`\n\nstruct or class, follows form of pos \n\n### `sparse_hash_map`\n\nSTL-like entity; follows STL naming conventions \n\n### `LONGLONG_MAX`\n\na constant, as in INT_MAX \n\n# Comments\n\nThough a pain to write, comments are absolutely vital to keeping our code readable. The following rules describe what you should comment and where. But remember: while comments are very important, the best code is self-documenting. Giving sensible names to types and variables is much better than using obscure names that you must then explain through comments.\n\nWhen writing your comments, write for your audience: the next contributor who will need to understand your code. Be generous — the next one may be you!\n\n## Doxygen\n\n* Use Doxygen strings in the header files. Doxygen comments on the implementation file are not required.\n* All public `class` objects MUST have a Doxygen comment that explains what it does.\n* All `public` methods of the class, with the exception of overridden methods, MUST be documented using Doxygen comments.\n* `protected` and `private` methods are suggested to have Doxygen comments, but are not mandatory.\n* Instance variables should NOT have Doxygen comments, unless they are public.\n* Markdown systax is allowed within your Doxygen comments\n\nExample:\n```cpp\n/** `WorldPeace` extends `Node` by adding enough power to create world peace.\n *\n * `WorldPeace` should be used only when the world is about to collapse.\n * Do not create an instance of `WorldPeace` if the `Scene` has a peace level of 5.\n * \n */\nclass WorldPeace : public Node\n{\n\npublic:\n    /** creates a `WorldPeace` with a predefined number of preachers\n     */\n    static WorldPeace* create(int numberOfPreachers);\n\n    /** sets the number of preachers that will try to create the world peace.\n    The more the better. But be aware that corruption might appear if the number if higher than the 20% of the population.\n    */\n    void setNumberOfPreachers(int numberOfPreachers);\n\n    /** displays an aura around the WorldPeace object \n    @see See all `displaySuperAura()`\n    */\n    void displayAura();\n\n    // Overrides\n    virtual void addChild(Node * child) override;\n    virtual void removeChild(Node* child, bool cleanup) override;\n\nprotected:\n    WorldPeace();\n    virtual ~WorldPeace();\n    bool init(int nubmerOfPreachers);\n    \n    int _nubmerOfPreachers;\n};\n```\n\n## Comment Style\n\nUse either the `//` or `/* */` syntax, as long as you are consistent.\n\nYou can use either the `//` or the `/* */` syntax; however, `//` is much more common. Be consistent with how you comment and what style you use where.\n\n## File Comments\n\nStart each file with license boilerplate, followed by a description of its contents.\n\n### Legal Notice and Author Line\n\nEvery file should contain license boilerplate. Choose the appropriate boilerplate for the license used by the project (for example, Apache 2.0, BSD, MIT, etc).\n\nThe license must be compatible for the different App Stores, so GPL and LGPL code cannot be used in cocos2d-x.\n\nIf you make significant changes to a file with an author line, consider deleting the author line.\n\n### File Contents\n\nEvery file should have a comment at the top describing its contents.\n\nGenerally a .h file will describe the classes that are declared in the file with an overview of what they are for and how they are used. A .cpp file should contain more information about implementation details or discussions of tricky algorithms. If you feel the implementation details or a discussion of the algorithms would be useful for someone reading the .h, feel free to put it there instead, but mention in the .cpp that the documentation is in the .h file.\n\nDo not duplicate comments in both the .h and the .cpp. Duplicated comments diverge.\n\n## Class Comments\n\nEvery class definition should have an accompanying comment that describes what it is for and how it should be used. If the class is public (exposed to the users), it should use Doxygen comments.\n\n```cpp\n// Iterates over the contents of a GargantuanTable.  Sample usage:\n//    GargantuanTableIterator* iter = table->NewIterator();\n//    for (iter->Seek(\"foo\"); !iter->done(); iter->Next()) {\n//      process(iter->key(), iter->value());\n//    }\n//    delete iter;\nclass GargantuanTableIterator {\n  ...\n};\n```\n\nIf you have already described a class in detail in the comments at the top of your file feel free to simply state \"See comment at top of file for a complete description\", but be sure to have some sort of comment.\n\nDocument the synchronization assumptions the class makes, if any. If an instance of the class can be accessed by multiple threads, take extra care to document the rules and invariants surrounding multithreaded use.\n\n## Function Comments\n\nDeclaration comments describe use of the function; comments at the definition of a function describe operation.\n\nIf the function is public (exposed to the users), it should be documented using Doxygen comments.\n\n### Function Declarations\n\nEvery function declaration should have comments immediately preceding it that describe what the function does and how to use it. These comments should be descriptive (\"Opens the file\") rather than imperative (\"Open the file\"); the comment describes the function, it does not tell the function what to do. In general, these comments do not describe how the function performs its task. Instead, that should be left to comments in the function definition.\n\nTypes of things to mention in comments at the function declaration:\n\n* What the inputs and outputs are.\n* For class member functions: whether the object remembers reference arguments beyond the duration of the method call, and whether it will free them or not.\n* If the function allocates memory that the caller must free.\n* Whether any of the arguments can be a null pointer.\n* If there are any performance implications of how a function is used.\n* If the function is re-entrant. What are its synchronization assumptions?\n\nHere is an example:\n\n```cpp\n// Returns an iterator for this table.  It is the client's\n// responsibility to delete the iterator when it is done with it,\n// and it must not use the iterator once the GargantuanTable object\n// on which the iterator was created has been deleted.\n//\n// The iterator is initially positioned at the beginning of the table.\n//\n// This method is equivalent to:\n//    Iterator* iter = table->NewIterator();\n//    iter->Seek(\"\");\n//    return iter;\n// If you are going to immediately seek to another place in the\n// returned iterator, it will be faster to use NewIterator()\n// and avoid the extra seek.\nIterator* getIterator() const;\n```\n\nHowever, do not be unnecessarily verbose or state the completely obvious. Notice below that it is not necessary to say \"returns false otherwise\" because this is implied.\n\n```cpp\n/// Returns true if the table cannot hold any more entries.\nbool isTableFull();\n```\n\nWhen commenting constructors and destructors, remember that the person reading your code knows what constructors and destructors are for, so comments that just say something like \"destroys this object\" are not useful. Document what constructors do with their arguments (for example, if they take ownership of pointers), and what cleanup the destructor does. If this is trivial, just skip the comment. It is quite common for destructors not to have a header comment.\n\n### Function Definitions\n\nIf there is anything tricky about how a function does its job, the function definition should have an explanatory comment. For example, in the definition comment you might describe any coding tricks you use, give an overview of the steps you go through, or explain why you chose to implement the function in the way you did rather than using a viable alternative. For instance, you might mention why it must acquire a lock for the first half of the function but why it is not needed for the second half.\n\nNote you should not just repeat the comments given with the function declaration, in the .h file or wherever. It's okay to recapitulate briefly what the function does, but the focus of the comments should be on how it does it.\n\n## Variable Comments\n\nIn general the actual name of the variable should be descriptive enough to give a good idea of what the variable is used for. In certain cases, more comments are required.\n\n### Class Data Members\n\nEach class data member (also called an instance variable or member variable) should have a comment describing what it is used for. If the variable can take sentinel values with special meanings, such as a null pointer or -1, document this. For example:\n\n```cpp\nprivate:\n // Keeps track of the total number of entries in the table.\n // Used to ensure we do not go over the limit. -1 means\n // that we don't yet know how many entries the table has.\n int _numTotalEntries;\n```\n\n### Global Variables\n\nAs with data members, all global variables should have a comment describing what they are and what they are used for. For example:\n\n```cpp\n// The total number of tests cases that we run through in this regression test.\nconst int NUM_TEST_CASES = 6;\n```\n\n## Implementation Comments\n\nIn your implementation you should have comments in tricky, non-obvious, interesting, or important parts of your code.\n\n### Class Data Members\n\nTricky or complicated code blocks should have comments before them. Example:\n\n```cpp\n// Divide result by two, taking into account that x\n// contains the carry from the add.\nfor (int i = 0; i < result->size(); i++) {\n    x = (x << 8) + (*result)[i];\n    (*result)[i] = x >> 1;\n    x &= 1;\n}\n```\n\n### Line Comments\n\nAlso, lines that are non-obvious should get a comment at the end of the line. These end-of-line comments should be separated from the code by 2 spaces. Example:\n\n```cpp\n// If we have enough memory, mmap the data portion too.\nmmap_budget = max<int64>(0, mmap_budget - index_->length());\nif (mmap_budget >= data_size_ && !MmapData(mmap_chunk_bytes, mlock))\n    return;  // Error already logged.\n```\n\nNote that there are both comments that describe what the code is doing, and comments that mention that an error has already been logged when the function returns.\n\nIf you have several comments on subsequent lines, it can often be more readable to line them up:\n\n```cpp\ndoSomething();                  // Comment here so the comments line up.\ndoSomethingElseThatIsLonger();  // Comment here so there are two spaces between\n                                // the code and the comment.\n{ // One space before comment when opening a new scope is allowed,\n  // thus the comment lines up with the following comments and code.\n    doSomethingElse();  // Two spaces before line comments normally.\n}\ndoSomething(); /* For trailing block comments, one space is fine. */\n```\n\n### nullptr/NULL, true/false, 1, 2, 3...\n\nWhen you pass in a null pointer, boolean, or literal integer values to functions, you should consider adding a comment about what they are, or make your code self-documenting by using constants. For example, compare:\n\n```cpp\nbool success = calculateSomething(interesting_value,\n                                  10,\n                                  false,\n                                  NULL);  // What are these arguments??\n```\n\nversus:\n\n```cpp\nbool success = calculateSomething(interesting_value,\n                                  10,     // Default base value.\n                                  false,  // Not the first time we're calling this.\n                                  NULL);  // No callback.\n```\n\nOr alternatively, constants or self-describing variables:\n\n```cpp\nconst int DEFAULT_BASE_VALUE = 10;\nconst bool FIRST_TIME_CALLING = false;\nCallback *nullCallback = NULL;\nbool success = CalculateSomething(interestingValue,\n                                  DEFAULT_BASE_VALUE,\n                                  FIRST_TIME_CALLING,\n                                  nullCallback);\n```\n\n### Don'ts\n\nNote that you should never describe the code itself. Assume that the person reading the code knows C++ better than you do, even though he or she does not know what you are trying to do:\n\n```cpp\n// Now go through the b array and make sure that if i occurs,\n// the next element is i+1.\n...        // Geez.  What a useless comment.\n```\n\n## Punctuation, Spelling and Grammar\n\nPay attention to punctuation, spelling, and grammar; it is easier to read well-written comments than badly written ones.\n\nComments should be as readable as narrative text, with proper capitalization and punctuation. In many cases, complete sentences are more readable than sentence fragments. Shorter comments, such as comments at the end of a line of code, can sometimes be less formal, but you should be consistent with your style.\n\nAlthough it can be frustrating to have a code reviewer point out that you are using a comma when you should be using a semicolon, it is very important that source code maintain a high level of clarity and readability. Proper punctuation, spelling, and grammar help with that goal.\n\n## TODO Comments\n\nUse TODO comments for code that is temporary, a short-term solution, or good-enough but not perfect.\n\nTODOs should include the string TODO in all caps, followed by the name, e-mail address, or other identifier of the person who can best provide context about the problem referenced by the TODO. A colon is optional. The main purpose is to have a consistent TODO format that can be searched to find the person who can provide more details upon request. A TODO is not a commitment that the person referenced will fix the problem. Thus when you create a TODO, it is almost always your name that is given.\n\n```cpp\n// TODO(kl`gmail.com): Use a \"*\" here for concatenation operator.\n// TODO(Zeke) change this to use relations.\n```\n\nIf your TODO is of the form \"At a future date do something\" make sure that you either include a very specific date (\"Fix by November 2005\") or a very specific event (\"Remove this code when all clients can handle XML responses.\").\n\n## Deprecation Comments\n\nUse the `CC_DEPRECATED_ATTRIBUTE` macro to mark an methods as deprecated.\n\nAlso use the ` ``deprecated ` doxygen docstring to mark it as deprecated in the documentation.\n\nA deprecation comment must include simple, clear directions for people to fix their callsites. In C++, you can implement a deprecated function as an inline function that calls the new interface point.\n\nMarking an interface point DEPRECATED will not magically cause any callsites to change. If you want people to actually stop using the deprecated facility, you will have to fix the callsites yourself or recruit a crew to help you.\n\nNew code should not contain calls to deprecated interface points. Use the new interface point instead. If you cannot understand the directions, find the person who created the deprecation and ask them for help using the new interface point.\n\n# Formatting\n\nCoding style and formatting are pretty arbitrary, but a project is much easier to follow if everyone uses the same style. Individuals may not agree with every aspect of the formatting rules, and some of the rules may take some getting used to, but it is important that all project contributors follow the style rules so that they can all read and understand everyone's code easily.\n\nTo help you format code correctly, we've created a settings file for emacs.\n\n## Line Length\n\nEach line of text in your code should be at most 80 characters long.\n\nWe recognize that this rule is controversial, but so much existing code already adheres to it, and we feel that consistency is important.\n\n**Pros:** Those who favor this rule argue that it is rude to force them to resize their windows and there is no need for anything longer. Some folks are used to having several code windows side-by-side, and thus don't have room to widen their windows in any case. People set up their work environment assuming a particular maximum window width, and 80 columns has been the traditional standard. Why change it?\n\n**Cons:** Proponents of change argue that a wider line can make code more readable. The 80-column limit is an hidebound throwback to 1960s mainframes; modern equipment has wide screens that can easily show longer lines.\n\n**Decision:**\n\n80 characters is the maximum.\n\nException: if a comment line contains an example command or a literal URL longer than 80 characters, that line may be longer than 80 characters for ease of cut and paste.\n\nException: an #include statement with a long path may exceed 80 columns. Try to avoid situations where this becomes necessary.\n\nException: you needn't be concerned about header guards that exceed the maximum length.\n\n## Non-ASCII Characters\n\nNon-ASCII characters should be rare, and must use UTF-8 formatting.\n\nYou shouldn't hard-code user-facing text in source, even English, so use of non-ASCII characters should be rare. However, in certain cases it is appropriate to include such words in your code. For example, if your code parses data files from foreign sources, it may be appropriate to hard-code the non-ASCII string(s) used in those data files as delimiters. More commonly, unittest code (which does not need to be localized) might contain non-ASCII strings. In such cases, you should use UTF-8, since that is an encoding understood by most tools able to handle more than just ASCII.\n\nHex encoding is also OK, and encouraged where it enhances readability — for example, `\"\\xEF\\xBB\\xBF\"`, or, even more simply, `u8\"\\uFEFF\"`, is the Unicode zero-width no-break space character, which would be invisible if included in the source as straight UTF-8.\n\nUse the `u8` prefix to guarantee that a string literal containing `\\uXXXX` escape sequences is encoded as UTF-8. Do not use it for strings containing non-ASCII characters encoded as UTF-8, because that will produce incorrect output if the compiler does not interpret the source file as UTF-8.\n\nYou shouldn't use the C++11 `char16_t` and `char32_t` character types, since they're for non-UTF-8 text. For similar reasons you also shouldn't use `wchar_t` (unless you're writing code that interacts with the Windows API, which uses `wchar_t` extensively).\n\n\n## Spaces vs. Tabs\n\nUse only spaces, and indent 4 spaces at a time.\n\nWe use spaces for indentation. Do not use tabs in your code. You should set your editor to emit spaces when you hit the tab key.\n\n## Function Declarations and Definitions\n\nReturn type on the same line as function name, parameters on the same line if they fit.\n\nFunctions look like this:\n\n```cpp\nReturnType ClassName::FunctionName(Type par_name1, Type par_name2)\n{\n    DoSomething();\n    ...\n}\n```\n\nIf you have too much text to fit on one line:\n\n```cpp\nReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,\n                                             Type par_name3)\n{\n    DoSomething();\n    ...\n}\n```\n\nor if you cannot fit even the first parameter:\n\n```cpp\nReturnType LongClassName::ReallyReallyReallyLongFunctionName(\n    Type par_name1,  // 4 space indent\n    Type par_name2,\n    Type par_name3)\n{\n    DoSomething();  // 4 space indent\n    ...\n}\n```\n\nSome points to note:\n\n\n* If you cannot fit the return type and the function name on a single line, break between them.\n* If you break after the return type of a function definition, do not indent.\n* The open parenthesis is always on the same line as the function name.\n* There is never a space between the function name and the open parenthesis.\n* There is never a space between the parentheses and the parameters.\n* The open curly brace is always at the end of the same line as the last parameter.\n* The close curly brace is either on the last line by itself or (if other style rules permit) on the same line as the open curly brace.\n* There should be a space between the close parenthesis and the open curly brace.\n* All parameters should be named, with identical names in the declaration and implementation.\n* All parameters should be aligned if possible.\n* Default indentation is 4 spaces.\n* Wrapped parameters have a 4 space indent.\n\nIf some parameters are unused, comment out the variable name in the function definition:\n\n```cpp\n// Always have named parameters in interfaces.\nclass Shape\n{\npublic:\n    virtual void rotate(double radians) = 0;\n}\n\n// Always have named parameters in the declaration.\nclass Circle : public Shape\n{\npublic:\n    virtual void rotate(double radians);\n}\n\n// Comment out unused named parameters in definitions.\nvoid Circle::rotate(double /*radians*/)\n{}\n\n// Bad - if someone wants to implement later, it's not clear what the\n// variable means.\nvoid Circle::rotate(double)\n{}\n```\n\n## Function Calls\n\nOn one line if it fits; otherwise, wrap arguments at the parenthesis.\n\nFunction calls have the following format:\n\n```cpp\nbool retval = doSomething(argument1, argument2, argument3);\n```\n\nIf the arguments do not all fit on one line, they should be broken up onto multiple lines, with each subsequent line aligned with the first argument. Do not add spaces after the open paren or before the close paren:\n\n```cpp\nbool retval = doSomething(averyveryveryverylongargument1,\n                          argument2, argument3);\n```\n\nIf the function has many arguments, consider having one per line if this makes the code more readable:\n\n```cpp\nbool retval = doSomething(argument1,\n                          argument2,\n                          argument3,\n                          argument4);\n```\n\nArguments may optionally all be placed on subsequent lines, with one line per argument:\n\n```cpp\nif (...) {\n    ...\n    ...\n    if (...) {\n        doSomething(\n            argument1,  // 4 space indent\n            argument2,\n            argument3,\n            argument4);\n    }\n```\n\nIn particular, this should be done if the function signature is so long that it cannot fit within the maximum line length.\n\n## Braced Initializer Lists\n\nFormat a braced list exactly like you would format a function call in its place.\n\nIf the braced list follows a name (e.g. a type or variable name), format as if the `{}` were the parentheses of a function call with that name. If there is no name, assume a zero-length name.\n\n```cpp\n// Examples of braced init list on a single line.\nreturn {foo, bar};\nfunctioncall({foo, bar});\npair<int, int> p{foo, bar};\n\n// When you have to wrap.\nSomeFunction(\n    {\"assume a zero-length name before {\"},\n    some_other_function_parameter);\nSomeType variable{\n    some, other, values,\n    {\"assume a zero-length name before {\"},\n    SomeOtherType{\n        \"Very long string requiring the surrounding breaks.\",\n        some, other values},\n    SomeOtherType{\"Slightly shorter string\",\n                  some, other, values}};\nSomeType variable{\n    \"This is too long to fit all in one line\"};\nMyType m = {  // Here, you could also break before {.\n    superlongvariablename1,\n    superlongvariablename2,\n    {short, interior, list},\n    {interiorwrappinglist,\n     interiorwrappinglist2}};\n```\n\n\n## Conditionals\n\nPrefer no spaces inside parentheses. The else keyword belongs on a new line.\n\nThere are two acceptable formats for a basic conditional statement. One includes spaces between the parentheses and the condition, and one does not.\n\nThe most common form is without spaces. Either is fine, but be consistent. If you are modifying a file, use the format that is already present. If you are writing new code, use the format that the other files in that directory or project use. If in doubt and you have no personal preference, do not add the spaces.\n\n```cpp\nif (condition) {  // no spaces inside parentheses\n    ...  // 4 space indent.\n} else if (...) {  // The else goes on the same line as the closing brace.\n    ...\n} else {\n    ...\n}\n```\n\nIf you prefer you may add spaces inside the parentheses:\n\n```cpp\nif ( condition ) {  // spaces inside parentheses - rare\n    ...  // 4 space indent.\n} else {  // The else goes on the same line as the closing brace.\n    ...\n}\n```\n\nNote that in all cases you must have a space between the `if` and the open parenthesis. You must also have a space between the close parenthesis and the curly brace, if you're using one.\n\n```cpp\nif(condition)     // Bad - space missing after IF.\nif (condition){   // Bad - space missing before {.\nif(condition){    // Doubly bad.\n\nif (condition) {  // Good - proper space after IF and before {.\n```\n\nShort conditional statements may be written on one line if this enhances readability. You may use this only when the line is brief and the statement does not use the else clause.\n\n```cpp\nif (x == FOO) return new Foo();\nif (x == BAR) return new Bar();\n```\n\nThis is not allowed when the if statement has an `else`:\n\n```cpp\n// Not allowed - IF statement on one line when there is an ELSE clause\nif (x) doThis();\nelse doThat();\n```\n\nIn general, curly braces are not required for single-line statements, but they are allowed if you like them; conditional or loop statements with complex conditions or statements may be more readable with curly braces. Some projects require that an if must always always have an accompanying brace.\n\n```cpp\nif (condition)\n    doSomething();  // 4 space indent.\n\nif (condition) {\n    doSomething();  // 4 space indent.\n}\n```\n\nHowever, if one part of an if-else statement uses curly braces, the other part must too:\n\n```cpp\n// Not allowed - curly on IF but not ELSE\nif (condition) {\n    foo;\n} else\n    bar;\n\n// Not allowed - curly on ELSE but not IF\nif (condition)\n    foo;\nelse {\n    bar;\n}\n\n// Curly braces around both IF and ELSE required because\n// one of the clauses used braces.\nif (condition) {\n    foo;\n} else {\n    bar;\n}\n```\n\n## Loops and Switch Statements\n\nSwitch statements may use braces for blocks. Annotate non-trivial fall-through between cases. Empty loop bodies should use {} or continue.\n\ncase blocks in switch statements can have curly braces or not, depending on your preference. If you do include curly braces they should be placed as shown below.\n\nIf not conditional on an enumerated value, switch statements should always have a default case (in the case of an enumerated value, the compiler will warn you if any values are not handled). If the default case should never execute, simply assert:\n\n```cpp\nswitch (var) {\n    case 0: {    // 4 space indent\n        ...      // 4 space indent\n        break;\n    }\n    case 1: {\n        ...\n        break;\n    }\n    default: {\n       assert(false);\n    }\n}\n```\n\nEmpty loop bodies should use `{}` or `continue`, but not a single semicolon.\n\n```cpp\nwhile (condition) {\n    // Repeat test until it returns false.\n}\nfor (int i = 0; i < SOME_NUMBER; ++i) {}  // Good - empty body.\nwhile (condition) continue;  // Good - continue indicates no logic.\n\nwhile (condition);  // Bad - looks like part of do/while loop.\n```\n\n## Pointer and Reference Expressions\n\nNo spaces around period or arrow. Pointer operators do not have trailing spaces.\n\nThe following are examples of correctly-formatted pointer and reference expressions:\n\n```cpp\nx = *p;\np = &x;\nx = r.y;\nx = r->y;\n```\n\nNote that:\n\n* There are no spaces around the period or arrow when accessing a member.\n* Pointer operators have no space after the * or &.\n\nWhen declaring a pointer variable or argument, you may place the asterisk adjacent to either the type or to the variable name:\n\n```cpp\n// These are fine, space preceding.\nchar *c;\nconst string &str;\n\n// These are fine, space following.\nchar* c;    // but remember to do \"char* c, *d, *e, ...;\"!\nconst string& str;\n\nchar * c;  // Bad - spaces on both sides of *\nconst string & str;  // Bad - spaces on both sides of &\n```\n\nYou should do this consistently within a single file, so, when modifying an existing file, use the style in that file.\n\n## Boolean Expressions\n\nWhen you have a boolean expression that is longer than the standard line length, be consistent in how you break up the lines.\n\nIn this example, the logical AND operator is always at the end of the lines:\n\n```cpp\nif (thisOneThing > thisOtherThing &&\n    aThirdThing == aFourthThing &&\n    yetAnother && lastOne) {\n    ...\n}\n```\n\nNote that when the code wraps in this example, both of the && logical AND operators are at the end of the line. This is more common in Google code, though wrapping all operators at the beginning of the line is also allowed. Feel free to insert extra parentheses judiciously because they can be very helpful in increasing readability when used appropriately. Also note that you should always use the punctuation operators, such as && and ~, rather than the word operators, such as and and compl.\n\n## Return Values\n\nDo not needlessly surround the return expression with parentheses.\n\nUse parentheses in `return expr;` only where you would use them in `x = expr;`.\n\n```cpp\nreturn result;                  // No parentheses in the simple case.\nreturn (someLongCondition &&    // Parentheses ok to make a complex\n        anotherCondition);      //     expression more readable.\n\nreturn (value);                // You wouldn't write var = (value);\nreturn(result);                // return is not a function!\n```\n\n## Variable and Array Initialization\n\nYour choice of `=`, `()`, or `{}`.\n\nYou may choose between `=`, `()`, and `{}`; the following are all correct:\n\n```cpp\nint x = 3;\nint x(3);\nint x{3};\nstring name = \"Some Name\";\nstring name(\"Some Name\");\nstring name{\"Some Name\"};\n```\n\nBe careful when using the `{}` on a type that takes an initializer_list in one of its constructors. The `{}` syntax prefers the initializer_list constructor whenever possible. To get the non- initializer_list constructor, use `()`.\n\n```cpp\nvector<int> v(100, 1);  // A vector of 100 1s.\nvector<int> v{100, 1};  // A vector of 100, 1.\n```\n\nAlso, the brace form prevents narrowing of integral types. This can prevent some types of programming errors.\n\n```cpp\nint pi(3.14);  // OK -- pi == 3.\nint pi{3.14};  // Compile error: narrowing conversion.\n```\n\n## Preprocessor Directives\n\nThe hash mark that starts a preprocessor directive should always be at the beginning of the line.\n\nEven when preprocessor directives are within the body of indented code, the directives should start at the beginning of the line.\n\n```cpp\n// Good - directives at beginning of line\n  if (lopsidedScore) {\n#if DISASTER_PENDING      // Correct -- Starts at beginning of line\n    dropEverything();\n# if NOTIFY               // OK but not required -- Spaces after #\n    notifyClient();\n# endif\n#endif\n    backToNormal();\n  }\n```\n\n```cpp\n// Bad - indented directives\n  if (lopsidedScore) {\n    #if DISASTER_PENDING  // Wrong!  The \"#if\" should be at beginning of line\n    dropEverything();\n    #endif                // Wrong!  Do not indent \"#endif\"\n    backToNormal();\n  }\n```\n\n## Class Format\n\nSections in public, protected and private order, each indented one space.\n\nThe basic format for a class declaration (lacking the comments, see Class Comments for a discussion of what comments are needed) is:\n\n```cpp\nclass MyClass : public OtherClass\n{\npublic:      // Note the 0 space indent!\n    MyClass();  // Regular 4 space indent.\n    explicit MyClass(int var);\n    ~MyClass() {}\n\n    void someFunction();\n    void someFunctionThatDoesNothing() {\n    }\n\n    void setSomeVar(int var) { _someVar = var; }\n    int getSomeVar() const { return _someVar; }\n\nprivate:\n    bool someInternalFunction();\n\n    int _someVar;\n    int _someOtherVar;\n    DISALLOW_COPY_AND_ASSIGN(MyClass);\n};\n```\n\nThings to note:\n\n* Any base class name should be on the same line as the subclass name, subject to the 80-column limit.\n* The `public:`, `protected:`, and `private:` keywords should not be indented.\n* Except for the first instance, these keywords should be preceded by a blank line. This rule is optional in small classes.\n* Do not leave a blank line after these keywords.\n* The `public:` section should be first, followed by the `protected:` and finally the `private:` section.\n* See Declaration Order for rules on ordering declarations within each of these sections.\n\n\n## Constructor Initializer Lists\n\nConstructor initializer lists can be all on one line or with subsequent lines indented zero spaces.\n\nThere are two acceptable formats for initializer lists:\n\n```cpp\n// When it all fits on one line:\nMyClass::MyClass(int var) : _someVar(var), _someOtherVar(var + 1) {}\n```\n\nor\n\n```cpp\n// When it requires multiple lines, indent zero spaces, putting the colon on\n// the first initializer line, and commas in new lines if needed:\nMyClass::MyClass(int var)\n: _someVar(var)             // 0 space indent\n, _someOtherVar(var + 1)    // lined up\n{\n    ...\n    doSomething();\n    ...\n}\n```\n\n## Namespace Formatting\n\nThe contents of namespaces are not indented.\n\nNamespaces do not add an extra level of indentation. For example, use:\n\n```cpp\nnamespace {\n\nvoid foo() {  // Correct.  No extra indentation within namespace.\n  ...\n}\n\n}  // namespace\n```\n\nDo not indent within a namespace:\n\n```cpp\nnamespace {\n\n  // Wrong.  Indented when it should not be.\n  void foo() {\n    ...\n  }\n\n}  // namespace\n```\n\nWhen declaring nested namespaces, put each namespace on its own line.\n\n```cpp\nnamespace foo {\nnamespace bar {\n```\n\n## Horizontal Whitespace\n\nUse of horizontal whitespace depends on location. Never put trailing whitespace at the end of a line.\n\n### General\n\n```cpp\nvoid f(bool b) {  // Open braces should always have a space before them.\n    ...\nint i = 0;  // Semicolons usually have no space before them.\nint x[] = { 0 };  // Spaces inside braces for braced-init-list are\nint x[] = {0};    // optional.  If you use them, put them on both sides!\n\n// Spaces around the colon in inheritance and initializer lists.\nclass Foo : public Bar {\npublic:\n    // For inline function implementations, put spaces between the braces\n    // and the implementation itself.\n    Foo(int b) : Bar(), baz_(b) {}  // No spaces inside empty braces.\n    void Reset() { baz_ = 0; }  // Spaces separating braces from implementation.\n    ...\n```\n\nAdding trailing whitespace can cause extra work for others editing the same file, when they merge, as can removing existing trailing whitespace. So: Don't introduce trailing whitespace. Remove it if you're already changing that line, or do it in a separate clean-up operation (preferably when no-one else is working on the file).\n\n### Loops and Conditionals\n\n```cpp\nif (b) {          // Space after the keyword in conditions and loops.\n} else {          // Spaces around else.\n}\nwhile (test) {}   // There is usually no space inside parentheses.\nswitch (i) {\nfor (int i = 0; i < 5; ++i) {\nswitch ( i ) {    // Loops and conditions may have spaces inside\nif ( test ) {     // parentheses, but this is rare.  Be consistent.\nfor ( int i = 0; i < 5; ++i ) {\nfor ( ; i < 5 ; ++i) {  // For loops always have a space after the\n    ...                 // semicolon, and may have a space before the\n                        // semicolon.\nfor (auto x : counts) {  // Range-based for loops always have a\n    ...                  // space before and after the colon.\n}\nswitch (i) {\n    case 1:         // No space before colon in a switch case.\n    ...\n    case 2: break;  // Use a space after a colon if there's code after it.\n```\n\n### Operators\n\n```cpp\nx = 0;              // Assignment operators always have spaces around\n                    // them.\nx = -5;             // No spaces separating unary operators and their\n++x;                // arguments.\nif (x && !y)\n    ...\nv = w * x + y / z;  // Binary operators usually have spaces around them,\nv = w*x + y/z;      // but it's okay to remove spaces around factors.\nv = w * (x + z);    // Parentheses should have no spaces inside them.\n```\n\n### Templates and Casts\n\n```cpp\nvector<string> x;           // No spaces inside the angle\ny = static_cast<char*>(x);  // brackets (< and >), before\n                            // <, or between >( in a cast.\nvector<char *> x;           // Spaces between type and pointer are\n                            // okay, but be consistent.\nset<list<string>> x;        // Permitted in C++11 code.\nset<list<string> > x;       // C++03 required a space in > >.\nset< list<string> > x;      // You may optionally use\n                            // symmetric spacing in < <.\n```\n\n## Vertical Whitespace\n\nMinimize use of vertical whitespace.\n\nThis is more a principle than a rule: don't use blank lines when you don't have to. In particular, don't put more than one or two blank lines between functions, resist starting functions with a blank line, don't end functions with a blank line, and be discriminating with your use of blank lines inside functions.\n\nThe basic principle is: The more code that fits on one screen, the easier it is to follow and understand the control flow of the program. Of course, readability can suffer from code being too dense as well as too spread out, so use your judgement. But in general, minimize use of vertical whitespace.\n\nSome rules of thumb to help when blank lines may be useful:\n\n* Blank lines at the beginning or end of a function very rarely help readability.\n* Blank lines inside a chain of if-else blocks may well help readability.\n\n# Exceptions to the Rules\n\nThe coding conventions described above are mandatory. However, like all good rules, these sometimes have exceptions, which we discuss here.\n\n## Existing Non-conformant Code\n\nYou may diverge from the rules when dealing with code that does not conform to this style guide.\n\nIf you find yourself modifying code that was written to specifications other than those presented by this guide, you may have to diverge from these rules in order to stay consistent with the local conventions in that code. If you are in doubt about how to do this, ask the original author or the person currently responsible for the code. Remember that consistency includes local consistency, too.\n\n## Windows Code\n\nWindows programmers have developed their own set of coding conventions, mainly derived from the conventions in Windows headers and other Microsoft code. We want to make it easy for anyone to understand your code, so we have a single set of guidelines for everyone writing C++ on any platform.\n\nIt is worth reiterating a few of the guidelines that you might forget if you are used to the prevalent Windows style:\n\n* Do not use Hungarian notation (for example, naming an integer iNum). Use the Google naming conventions, including the .cpp extension for source files.\n* Windows defines many of its own synonyms for primitive types, such as DWORD, HANDLE, etc. It is perfectly acceptable, and encouraged, that you use these types when calling Windows API functions. Even so, keep as close as you can to the underlying C++ types. For example, use const TCHAR * instead of LPCTSTR.\n* When compiling with Microsoft Visual C++, set the compiler to warning level 3 or higher, and treat all warnings as errors.\n* Do not use #pragma once; instead use the standard Google include guards. The path in the include guards should be relative to the top of your project tree.\n* In fact, do not use any nonstandard extensions, like #pragma and __declspec, unless you absolutely must. Using `__declspec(dllimport)` and `__declspec(dllexport)` is allowed; however, you must use them through macros such as `DLLIMPORT` and `DLLEXPORT` or `CC_DLL`, so that someone can easily disable the extensions if they share the code.\n\nHowever, there are just a few rules that we occasionally need to break on Windows:\n\n* Normally we forbid the use of multiple implementation inheritance; however, it is required when using COM and some ATL/WTL classes. You may use multiple implementation inheritance to implement COM or ATL/WTL classes and interfaces.\n* Although you should not use exceptions in your own code, they are used extensively in the ATL and some STLs, including the one that comes with Visual C++. When using the ATL, you should define _ATL_NO_EXCEPTIONS to disable exceptions. You should investigate whether you can also disable exceptions in your STL, but if not, it is OK to turn on exceptions in the compiler. (Note that this is only to get the STL to compile. You should still not write exception handling code yourself.)\n* The usual way of working with precompiled headers is to include a header file at the top of each source file, typically with a name like StdAfx.h or precompile.h. To make your code easier to share with other projects, avoid including this file explicitly (except in precompile.cpp), and use the /FI compiler option to include the file automatically.\n* Resource headers, which are usually named resource.h and contain only macros, do not need to conform to these style guidelines.\n\n# Parting Words\n\nUse common sense and **BE CONSISTENT**.\n\nIf you are editing code, take a few minutes to look at the code around you and determine its style. If they use spaces around their if clauses, you should, too. If their comments have little boxes of stars around them, make your comments have little boxes of stars around them too.\n\nThe point of having style guidelines is to have a common vocabulary of coding so people can concentrate on what you are saying, rather than on how you are saying it. We present global style rules here so people know the vocabulary. But local style is also important. If code you add to a file looks drastically different from the existing code around it, the discontinuity throws readers out of their rhythm when they go to read it. Try to avoid this.\n\nOK, enough writing about writing code; the code itself is much more interesting. Have fun!\n\n\n[1]: https://lh3.googleusercontent.com/-glwwzmFyUmk/UQgPnlx40uI/AAAAAAAArzg/WPRW10kkecM/s144/cocos2d-x-logo.png\n\n"
  },
  {
    "path": "cocos2d/docs/Groups.h",
    "content": "/**\n@defgroup actions           Actions\n@defgroup data_structures   Data Structures\n@defgroup base_nodes        Base Nodes\n@defgroup effects           Effects\n@defgroup cocosbuilder      CocosBuilder Support\n@defgroup global            Global\n@defgroup input             Human Machine Interation\n@defgroup data_storage      Data Storage\n@defgroup layer             Layer\n@defgroup scene             Scene\n@defgroup transition        Transition\n@defgroup GUI               GUI\n@defgroup label             Label\n@defgroup menu              Menu, MenuItem\n@defgroup control_extension Control Exntension\n@defgroup misc_nodes        Misc Nodes\n@defgroup particle_nodes    Particle System\n@defgroup platform          Platform Adaptor\n@defgroup script_support    Script Support\n@defgroup shaders           Shaders\n@defgroup sprite_nodes      Sprite Nodes        \n@defgroup textures          Textures\n@defgroup tilemap_parallax_nodes    TileMap, Parallax\n */"
  },
  {
    "path": "cocos2d/docs/MainPage.h",
    "content": "/*! \n@mainpage cocos2d-x\n\n@image html cocos2dx_portrait.png\n\n@section sec1 About cocos2d-x\ncocos2d-x open source project is designed to be a cross-platform 2D game engine for building 2D games, demos and other graphical/interactive mobile applications.\nIt runs on OpenGL ES 1.1, and is written in C++ language, provides C++ API.\\n\nThis project is based on the famous <A HREF=\"http://www.cocos2d-iphone.org\">\"cocos2d-iphone\"</A> project, and will keep pace with it. \\n\n\n- website:                          http://www.cocos2d-x.org/\n- forum:                            http://forum.cocos2d-x.org/\n- twitter:                          http://twitter.com/cocos2dx/\n- weibo:                            http://weibo.com/cocos2dx/\n- wiki:                             http://wiki.cocos2d-x.org/\n- show cases:                       http://www.cocos2d-x.org/games\n\n- <A HREF=\"http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Tutorials\">Tutorials of Cocos2dxSimpleGame</A>\n- <A HREF=\"http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Installation_and_First_run\">Installation and First run</A>\n- <A HREF=\"http://www.cocos2d-x.org/boards/6/topics/567\">DEVELOP FAQ</A>\n\n\\n\n\n@section sec2 License\nCopyright (c) 2010-2012 cocos2d-x.org \\n\n\\n\nPermission is hereby granted, free of charge, to any person obtaining a copy \\n\nof this software and associated documentation files (the \"Software\"), to deal \\n\nin the Software without restriction, including without limitation the rights \\n\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell \\n\ncopies of the Software, and to permit persons to whom the Software is \\n\nfurnished to do so, subject to the following conditions: \\n\n\\n\nThe above copyright notice and this permission notice shall be included in \\n\nall copies or substantial portions of the Software. \\n\n\\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \\n\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \\n\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \\n\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \\n\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \\n\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \\n\nTHE SOFTWARE. \\n\n\\n\n\n@section sec3 Get the source code\n- Stable version: \\n\n    - publish at http://download.cocos2d-x.org/\n- Last code: \\n\n    - http://github.com/cocos2d/cocos2d-x/\n\n@section sec4 How to contribute\n- Fork our repository on github, commit your changes, and send a \"pull request\" to us. We will merge your contribution to master\n- Any suggestion, bug fix, improvment will be appreciated. \n\n*/"
  },
  {
    "path": "cocos2d/docs/RELEASE_NOTES.md",
    "content": "# cocos2d-x v3.0 Release Notes #\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [cocos2d-x v3.0 Release Notes](#cocos2d-x-v30-release-notes)\n- [Misc Information](#misc-information)\n- [Requirements](#requirements)\n\t- [Runtime Requirements](#runtime-requirements)\n\t- [Compiler Requirements](#compiler-requirements)\n- [Highlights of v3.0.0](#highlights-of-v300)\n- [Features in detail](#features-in-detail)\n\t- [C++11 features](#c++11-features)\n\t\t- [std::function](#stdfunction)\n\t\t- [strongly typed enums](#strongly-typed-enums)\n\t\t- [override](#override)\n\t- [Removed Objective-C patterns](#removed-objective-c-patterns)\n\t\t- [No more 'CC' prefix for C++ classes and free functions](#no-more-'cc'-prefix-for-c++-classes-and-free-functions)\n\t\t- [clone() instead of copy()](#clone-instead-of-copy)\n\t\t- [Singletons use getInstance() and destroyInstance()](#singletons-use-getinstance-and-destroyinstance)\n\t\t- [getters](#getters)\n\t\t- [POD types](#pod-types)\n\t- [New renderer](#new-renderer)\n\t- [Improved LabelTTF / LabelBMFont](#improved-labelttf--labelbmfont)\n\t- [New EventDispatcher](#new-eventdispatcher)\n\t\t- [Adding Touch Event Listener](#adding-touch-event-listener)\n\t\t- [Adding Mouse Event Listener](#adding-mouse-event-listener)\n\t\t- [Adding A Keyboard Event Listener](#adding-a-keyboard-event-listener)\n\t\t- [Adding An Acceleration Event Listener](#adding-an-acceleration-event-listener)\n\t\t- [Adding A Custom Event Listener](#adding-a-custom-event-listener)\n\t\t- [Dispatching A Custom Event](#dispatching-a-custom-event)\n\t\t- [Setting Fixed Priority For A Listener](#setting-fixed-priority-for-a-listener)\n\t\t- [Removing Event Listener](#removing-event-listener)\n\t\t\t- [Removing A Specified Event Listener](#removing-a-specified-event-listener)\n\t\t\t- [Removing Custom Event Listener](#removing-custom-event-listener)\n\t\t\t- [Removing All Listeners For Specified Event Listener Type](#removing-all-listeners-for-specified-event-listener-type)\n\t\t\t- [Removing All Listeners](#removing-all-listeners)\n\n\t- [Physics Integration](#physics-integration)\n\t\t- [PhysicsWorld](#physicsworld)\n\t\t- [PhysicsBody](#physicsbody)\n\t\t- [PhysicsShape](#physicsshape)\n\t\t- [PhysicsJoint](#physicsjoint)\n\t\t- [PhysicsContact](#physicscontact)\n- [Misc API Changes](#misc-api-changes)\n\t- [`ccTypes.h`](#cctypesh)\n\t- [deprecated functions and  global variables](#deprecated-functions-and--global-variables)\n\t- [Changes in the Lua bindings](#changes-in-the-lua-bindings)\n\t\t- [Use bindings-generator tool for lua binding](#use-bindings-generator-tool-for-lua-binding)\n\t\t- [Bind the classes with namespace to lua](#bind-the-classes-with-namespace-to-lua)\n\t\t- [Use ScriptHandlerMgr to manage the register and unregister of lua function](#use-scripthandlermgr-to-manage-the-register-and-unregister-of-lua-function)\n\t\t- [Use \"cc\" and \"ccs\" as module name](#use-cc-and-ccs-as-module-name)\n\t\t- [Deprecated funtions, tables and classes](#deprecated-funtions-tables-and-classes)\n\t\t- [Use the lua table instead of the some structs and classes binding](#use-the-lua-table-instead-of-the-some-structs-and-classes-binding)\n\t\t- [Integrate more modules into lua](#integrate-more-modules-into-lua)\n\t- [Known issues](#known-issues)\n\n# Misc Information\n\n* Download: http://cdn.cocos2d-x.org/cocos2d-x-3.0beta.zip\n* Full Changelog: https://github.com/cocos2d/cocos2d-x/blob/cocos2d-x-3.0beta/CHANGELOG\n* API Reference: http://www.cocos2d-x.org/reference/native-cpp/V3.0beta/index.html\n\n# Requirements\n\n## Runtime Requirements\n\n* Android 2.3 or newer\n* iOS 5.0 or newer\n* OS X 10.7 or newer\n* Windows 7 or newer\n* ~~Windows Phone 8 or newer~~ N/A for the moment\n* Linux Ubuntu 12.04 (or newer)\n* ~~Browsers via Emscripten~~ N/A for the moment\n* ~~Marmalade~~ N/A for the moment\n* ~~BlackBerry~~ N/A for the moment\n\n## Compiler Requirements\n\n* Xcode 4.6 (for iOS or Mac)\n* gcc 4.7 for Linux or Android. For Android ndk-r9 or newer is required.\n* Visual Studio 2012 (for Windows)\n\n# Highlights of v3.0\n\n* Replaced Objective-C patters with C++ (C++11) patterns and best practices\n* Improved Labels\n* Improved renderer\n* New Event Dispatcher\n* Physics integration\n* New GUI\n* JavaScript remote debugger\n* Remote Console support\n* Refactor Image - release memory in time and uniform the api of supported file format\n* Automatically generated Lua bindings, add LuaJavaBridge and LuaObjcBridge\n* Templated containers\n\n# Features in detail\n\n## C++11 features\n\n_Feature added in v3.0-pre-alpha0_\n\nA subset of C++11 features are being used in cocos2d-x:\n\n* `std::function`, including lambda objects for callbacks\n* strongly typed enums, for most of the cocos2d-x enums and constants\n* `std::thread` for threading\n* `override` context keyword, for overriden methods\n\n\n### std::function\n\n* `CallFunc` can be created with an `std::function<void()>`\n* `CallFuncN` can be created with an `std::function<void(Node*)>`\n* `CallFuncND` and `CallFuncO` were removed since it can be created with simulated with `CallFuncN` and `CallFunc`. See ActionsTest.cpp for more examples\n* `MenuItem` supports `std::function<void(Node*)>` as callbacks\n\n`CallFunc` example:\n\n```cpp\n// in v2.1\nCCCallFunc *action1 = CCCallFunc::create( this, callfunc_selector( MyClass::callback_0 ) );\n\n// in v3.0 (short version)\nauto action1 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_0,this));\nauto action2 = CallFunc::create( CC_CALLBACK_0(MyClass::callback_1,this, additional_parameters));\n\n// in v3.0 (long version)\nauto action1 = CallFunc::create( std::bind( &MyClass::callback_0, this));\nauto action2 = CallFunc::create( std::bind( &MyClass::callback_1, this, additional_parameters));\n\n// in v3.0 you can also use lambdas or any other \"Function\" object\nauto action1 = CallFunc::create(\n                 [&](){\n                     auto s = Director::sharedDirector()->getWinSize();\n                     auto label = LabelTTF::create(\"called:lambda callback\", \"Marker Felt\", 16);\n                     label->setPosition(ccp( s.width/4*1,s.height/2-40));\n                     this->addChild(label);\n                 }  );\n```\n\n`MenuItem` example:\n```c++\n// in v2.1\nCCMenuItemLabel *item = CCMenuItemLabel::create(label, this, menu_selector(MyClass::callback));\n\n// in v3.0 (short version)\nauto item = MenuItemLabel::create(label, CC_CALLBACK_1(MyClass::callback, this));\n\n// in v3.0 (long version)\nauto item = MenuItemLabel::create(label, std::bind(&MyClass::callback, this, std::placeholders::_1));\n\n// in v3.0 you can use lambdas or any other \"Function\" object\nauto item = MenuItemLabel::create(label,\n                 [&](Object *sender) {\n                     // do something. Item \"sender\" clicked\n                  });\n```\n\n### strongly typed enums\n\n_Feature added in v3.0-pre-alpha0_\n\nConstants and enums that started with `k`, and that usually were defined as `int` or as simple `enum` where replaced with strongly typed enums ( `enum class` ) to prevent collisions and type errors.\nThe new format is:\n\n    | v2.1       | v3.0        |\n    | kTypeValue | Type::VALUE |\n\nExamples:\n\n\t| v2.1                             | v3.0                             |\n\t| kCCTexture2DPixelFormat_RGBA8888 | Texture2D::PixelFormat::RGBA8888 |\n\t| kCCDirectorProjectionCustom      | Director::Projection::CUSTOM     |\n\t| ccGREEN                          | Color3B::GREEN                   |\n\t| CCPointZero                      | Point::ZERO                      |\n\t| CCSizeZero                       | Size::ZERO                       |\n\nThe old values can still be used, but are not deprecated.\n\n### override\n\nTo catch possible errors while overriding methods, subclasses with override methods have the `override` context keyword.\nExample:\n```c++\nclass Sprite : public Node {\n    bool isFlipY(void) const;\n    void setFlipY(bool bFlipY);\n\n    // Overrides\n    virtual void setTexture(Texture2D *texture) override;\n    virtual Texture2D* getTexture() const override;\n    inline void setBlendFunc(const BlendFunc &blendFunc) override;\n    inline const BlendFunc& getBlendFunc() const override;\n}\n```\n\n## Removed Objective-C patterns\n\n_Feature added in v3.0-pre-alpha0_\n\n### No more 'CC' prefix for C++ classes and free functions\n\n*Changes in classes*\n\nSince cocos2d-x already uses the `cocos2d` namespace, there is not need to add the prefix `CC` to all its classes.\n\nExamples:\n\n\t| v2.1       | v3.0     |\n\t| CCSprite   | Sprite   |\n\t| CCNode     | Node     |\n\t| CCDirector | Director |\n\t| etc...                |\n\nv2.1 class names are still available, but they were tagged as deprecated.\n\n*Changes in free functions*\n\nFor the *drawing primitives*:\n* They were added in the `DrawPrimitives` namespace\n* The `cc` prefix was removed\n\nFor the *gl proxy functions*:\n* They were added in the `GL` namespace\n* The `ccGL` prefix was removed\n\nExamples:\n\n\t| v2.1                | v3.0                         |\n\t| ccDrawPoint()       | DrawPrimitives::drawPoint()  |\n\t| ccDrawCircle()      | DrawPrimitives::drawCircle() |\n\t| ccGLBlendFunc()     | GL::blendFunc()              |\n\t| ccGLBindTexture2D() | GL::bindTexture2D()          |\n\t| etc...                       \t\t\t\t\t\t |\n\nv2.1 free functions are still available, but they were tagged as deprecated.\n\n\n### clone() instead of copy()\n\n`clone()` returns an autoreleased version of the copy.\n\n`copy()` is no longer supported. If you use it, it will compile, but the code will crash.\n\nExample:\n```c++\n// v2.1\nCCMoveBy *action = (CCMoveBy*) move->copy();\naction->autorelease();\n\n// v3.0\n// No need to do autorelease, no need to do casting.\nauto action = move->clone();\n```\n\n### Singletons use getInstance() and destroyInstance()\n\nAll singletons use `getInstance()` and `destroyInstance()` (if applicable) to get and destroy the instance.\n\nExamples:\n\n\t| v2.1                          | v3.0                        |\n\t| CCDirector->sharedDirector()  | Director->getInstance()     |\n\t| CCDirector->endDirector()     | Director->destroyInstance() |\n\t| etc...                                                      |\n\n\nv2.1 methods are still available, but they were tagged as deprecated.\n\n### getters\n\nGetters now use the `get` prefix.\n\nExamples:\n\n\t| v2.1                            | v3.0* \t\t\t\t \t\t       |\n\t| node->boundingBox()             | node->getBoundingBox() \t\t\t   |\n\t| sprite->nodeToParentTransform() | sprite->getNodeToParentTransform() |\n\t| etc...                                                               |\n\nAnd getters were also tagged as `const` in their declaration. Example:\n\n```c++\n// v2.1\nvirtual float getScale();\n\n// v3.0\nvirtual float getScale() const;\n```\n\nv2.1 methods are still available, but they were tagged as deprecated.\n\n### POD types\n\nMethods that were receiving POD types as arguments (eg: `TexParams`, `Point`, `Size`, etc.) are being passed as `const` reference.\n\nExample:\n```c++\n// v2.1\nvoid setTexParameters(ccTexParams* texParams);\n\n// v3.0\nvoid setTexParameters(const ccTexParams& texParams);\n```\n\n\n## New Renderer\n\n_Feature added in v3.0-beta and improved in v3.0-beta2_\n\nThe renderer functionality has been decoupled from the Scene graph / Node logic. A new object called `Renderer` is responsible for rendering the object.\n\nAuto-batching ~~and auto-culling~~ support has been added.\n\nPlease, see this document for detail information about its internal funcitonality: [Renderer Specification document](https://docs.google.com/document/d/17zjC55vbP_PYTftTZEuvqXuMb9PbYNxRFu0EGTULPK8/edit)\n\n### Renderer features\n\n#### Auto-batching\n\nTODO\n\n#### Auto-culling\n\nTODO\n\n#### Global Z order\n\nA new method called `setGlobalZOrder()` / `getGlobalZOrder()` was added to `Node`, and the old  methods `setZOrder()` / `getZOrder()` were renamed to `setLocalZOrder()` / `getLocalZOrder()`.\n\n`globalZOrder` receives a `float` (and not an `int`) as argument. And this value is used to sort the Nodes in the Renderer. Lower values have higher priority over higher values. That means that a Node with a `globalZOrder` of `-10` is going to be drawn BEFORE a Node with `globalZOrder` of `10`.\n\nNodes that have a `globalZOrder` of `0` (default value) will be drawn according to the Scene Graph order.\n\nSo, if the `globalZOrder` is not changed, cocos2d-x v3.0 will behave exaclty as cocos2d-x v2.2. \n\n__`globalZOrder()` vs. `localZOrder()`__:\n\n* `globalZOrder` is used to sort the \"draw commands\" in the Renderer\n* `localZOrder` is used to sort the Node in its parent's children Array\n\n__Exceptions__:\n\nTODO\n\n\n## Improved LabelTTF / LabelBMFont\n\n_Feature added in v3.0-alpha0_\n\n## New EventDispatcher\n\n_Feature added in v3.0-alpha0_\n\nAll events like touch event, keyboard event, acceleration event and custom event are dispatched by `EventDispatcher`.\n`TouchDispatcher`, `KeypadDispatcher`, `KeyboardDispatcher`, `AccelerometerDispatcher` were removed.\n\n### Adding Touch Event Listener\n\nFor TouchOneByOne:\n```c++\nauto sprite = Sprite::create(\"file.png\");\n...\nauto listener = EventListenerTouchOneByOne::create();\nlistener->setSwallowTouch(true);\nlistener->onTouchBegan     = [](Touch* touch, Event* event) { do_some_thing();  return true;  };\nlistener->onTouchMoved     = [](Touch* touch, Event* event) { do_some_thing();  };\nlistener->onTouchEnded     = [](Touch* touch, Event* event) { do_some_thing();  };\nlistener->onTouchCancelled = [](Touch* touch, Event* event) { do_some_thing();  };\n// The priority of the touch listener is based on the draw order of sprite\nEventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, sprite);\n// Or the priority of the touch listener is a fixed value\nEventDispatcher::getInstance()->addEventListenerWithFixedPriority(listener, 100); // 100 is a fixed value\n```\n\nFor TouchAllAtOnce\n```c++\nauto sprite = Sprite::create(\"file.png\");\n...\nauto listener = EventListenerTouchAllAtOnce::create();\nlistener->onTouchesBegan     = [](const std::vector<Touch*>& touches, Event* event) { do_some_thing();  };\nlistener->onTouchesMoved     = [](const std::vector<Touch*>& touches, Event* event) { do_some_thing();  };\nlistener->onTouchesEnded     = [](const std::vector<Touch*>& touches, Event* event) { do_some_thing();  };\nlistener->onTouchesCancelled = [](const std::vector<Touch*>& touches, Event* event) { do_some_thing();  };\n// The priority of the touch listener is based on the draw order of sprite\nEventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, sprite);\n// Or the priority of the touch listener is a fixed value\nEventDispatcher::getInstance()->addEventListenerWithFixedPriority(listener, 100); // 100 is a fixed value\n```\n\n### Adding Mouse Event Listener  ###\n```c++\nauto mouseListener = EventListenerMouse::create();\nmouseListener->onMouseScroll = [](Event* event) { EventMouse* e = static_cast<EventMouse*>(event); do_some_thing(); };\nmouseListener->onMouseUp     = [](Event* event) { EventMouse* e = static_cast<EventMouse*>(event); do_some_thing(); };\nmouseListener->onMouseDown   = [](Event* event) { EventMouse* e = static_cast<EventMouse*>(event); do_some_thing(); };\ndispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this);\n```\n\n### Adding A Keyboard Event Listener\n\n```c++\nauto listener = EventListenerKeyboard::create();\nlistener->onKeyPressed = CC_CALLBACK_2(SomeClass::onKeyPressed, this);\nlistener->onKeyReleased = CC_CALLBACK_2(SomeClass::onKeyReleased, this);\nEventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, this);\n```\n\n### Adding An Acceleration Event Listener\n\n```c++\nauto listener = EventListenerAcceleration::create(CC_CALLBACK_2(SomeClass::onAcceleration, this));\nEventDispatcher::getInstance()->addEventListenerWithSceneGraphPriority(listener, this);\n```\n\n### Adding A Custom Event Listener\n\n```c++\nauto listener = EventListenerCustom::create(\"game_custom_event\", [=](EventCustom* event){\n    void* userData= event->getUserData();\n    do_some_with_user_data();\n});\ndispatcher->addEventListenerWithFixedPriority(listener, 1);\n```\n\n### Dispatching A Custom Event\n\n```c++\nEventCustom event(\"game_custom_event\");\nevent.setUserData(some_data);\ndispatcher->dispatchEvent(&event);\n```\n\n### Setting Fixed Priority For A Listener\n\n```c++\ndispatcher->setPriority(fixedPriorityListener, 200);\n```\n\n### Removing Event Listener\n\n#### Removing A Specified Event Listener\n\n```c++\ndispatcher->removeEventListener(listener);\n```\n\n#### Removing Custom Event Listener ####\n\n```c++\ndispatcher->removeCustomEventListener(\"my_custom_event_listener_name\");\n```\n\n#### Removing All Listeners For An Event Listener Type\n\n```c++\ndispatcher->removeEventListeners(EventListener::Type::TOUCH_ONE_BY_ONE);\n```\n\n#### Removing All Listeners\n\n```c++\ndispatcher->removeAllListeners();\n```\n\n## Physics Integration\n\n_Feature added in v3.0-pre-alpha0_\n\nPhysics integration have five concepts: `PhysicsWorld`, `PhysicsBody`, `PhysicsShape`, `PhysicsJoint` and `PhysicsContact`.\nYou must define `CC_USE_PHYSICS` macro in `ccConfig.h` to use the physics API.\n\n### PhysicsWorld\n\nA `PhysicsWorld` object simulates collisions and other physical properties, you do not create it directly, you can get it from scene which create with physics.\n```c++\nScene* scene = Scene::createWithPhysics();\nPhysicsWorld* world = scene->getPhysicsWorld();\n```\n\n### PhysicsBody\n\nA `PhysicsBody` object is used to add physics simulation to a node. If you create a `PhysicsBody` and set it to a node, and add the node the a scene which create with physics, it will perform the physics simulation when update.\n```c++\nPhysicsBody* body = PhysicsBody::createCircle(5.0f);\nNode* node = Node::create();\nnode->setPhysicsBody(body);\nscene->addChild(node);\n```\n\n### PhysicsShape\n\nA `PhysicsShape` object is a shape that make the body can have collisions. you can add one or more `PhysicsShape` to a `PhysicsBody`.\nShape classes: `PhysicsShapeCircle`, `PhysicsShapeBox`, `PhysicsShapePolygon`, `PhysicsShapeEdgeSegment`, `PhysicsShapeEdgeBox`, `PhysicsShapeEdgePolygon`, `PhysicsShapeEdgeChain`.\n```c++\nPhysicsShape* shape = PhysicsShapeBox::create(Size(5.0f, 10.0f);\nbody->addShape(shape);\n```\n\n### PhysicsJoint\n\nA `PhysicsJoint` object connects two physics bodies together so that they are simulated together by the physics world.\nJoint classes: `PhysicsJointFixed`, `PhysicsJointLimit`, `PhysicsJointPin`, `PhysicsJointDistance`, `PhysicsJointSpring`, `PhysicsJointGroove`, `PhysicsJointRotarySpring`, `PhysicsJointRotaryLimit`, `PhysicsJointRatchet`, `PhysicsJointGear`, `PhysicsJointMotor`.\n```c++\nPhysicsJoint* joint = PhysicsJointDistance::construct(bodyA, bodyB, Point::ZERO, Point::ZERO);\nworld->addJoint(joint);\n```\n\n### PhysicsContact\n\nA `PhysicsContact` object is created automatically to describes a contact between two physical bodies in a `PhysicsWorld`. you can control the contact behavior from the physics contact event listener.\nOther classes contain the contact information: `PhysicsContactPreSolve`, `PhysicsContactPostSolve`.\nThe event listener for physics: `EventListenerPhysicsContact`, `EventListenerPhysicsContactWithBodies`, `EventListenerPhysicsContactWithShapes`, `EventListenerPhysicsContactWithGroup`.\n```c++\nauto contactListener = EventListenerPhysicsContactWithBodies::create(bodyA, bodyB);\ncontactListener->onContactBegin = [](EventCustom* event, const PhysicsContact& contact) -> bool\n{\ndoSomething();\nreturn true;\n};\n_eventDispatcher->addEventListenerWithSceneGraphPriority(contactListener, this);\n```\n\n\n# Misc API Changes\n\n## `ccTypes.h`\n\nRemove *cc* prefix for structure names in ccTypes.h, move global functions into static member functions, and move global constants into const static member variables.\n\n\t| v2.1 struct names | v3.0 struct names |\n\t| ccColor3B \t    | Color3B |\n\t| ccColor4B \t\t| Color4B |\n\t| ccColor4F \t\t| Color4F |\n\t| ccVertex2F \t\t| Vertex2F |\n\t| ccVertex3F \t\t| Vertex3F |\n\t| ccTex2F \t\t\t| Tex2F |\n\t| ccPointSprite \t| PointSprite |\n\t| ccQuad2 \t\t\t| Quad2 |\n\t| ccQuad3 \t\t\t| Quad3 |\n\t| ccV2F_C4B_T2F \t| V2F_C4B_T2F |\n\t| ccV2F_C4F_T2F \t| V2F_C4F_T2F |\n\t| ccV3F_C4B_T2F \t| V3F_C4B_T2F |\n\t| ccV2F_C4B_T2F_Triangle | V2F_C4B_T2F_Triangle |\n\t| ccV2F_C4B_T2F_Quad | V2F_C4B_T2F_Quad |\n\t| ccV3F_C4B_T2F_Quad | V3F_C4B_T2F_Quad |\n\t| ccV2F_C4F_T2F_Quad | V2F_C4F_T2F_Quad |\n\t| ccBlendFunc \t\t| BlendFunc |\n\t| ccT2F_Quad \t\t| T2F_Quad |\n\t| ccAnimationFrameData | AnimationFrameData |\n\nGlobal functions changed example\n```c++\n// in v2.1\nccColor3B color3B = ccc3(0, 0, 0);\nccc3BEqual(color3B, ccc3(1, 1, 1));\nccColor4B color4B = ccc4(0, 0, 0, 0);\nccColor4F color4F = ccc4f(0, 0, 0, 0);\ncolor4F = ccc4FFromccc3B(color3B);\ncolor4F = ccc4FFromccc4B(color4B);\nccc4FEqual(color4F, ccc4F(1, 1, 1, 1));\ncolor4B = ccc4BFromccc4F(color4F);\n\ncolor3B = ccWHITE;\n\n// in v3.0\nColor3B color3B = Color3B(0, 0, 0);\ncolor3B.equals(Color3B(1, 1, 1));\nColor4B color4B = Color4B(0, 0, 0, 0);\nColor4F color4F = Color4F(0, 0, 0, 0);\ncolor4F = Color4F(color3B);\ncolor4F = Color4F(color4B);\ncolor4F.equals(Color4F(1, 1, 1, 1));\ncolor4B = Color4B(color4F);\n\ncolor3B = Color3B::WHITE;\n```\n\n## deprecated functions and  global variables\n\n\t| v2.1 names \t| v3.0 names |\n\t| ccp \t\t\t| Point |\n\t| ccpNeg \t\t| Point::- |\n\t| ccpAdd \t\t| Point::+ |\n\t| ccpSub \t\t| Point::- |\n\t| ccpMult \t\t| Point::* |\n\t| ccpMidpoint \t| Point::getMidpoint |\n\t| ccpDot \t\t| Point::dot |\n\t| ccpCrosss \t| Point::cross |\n\t| ccpPerp \t\t| Point::getPerp |\n\t| ccpRPerp \t\t| Point::getRPerp |\n\t| ccpProject \t| Point::project |\n\t| ccpRotate \t| Point::rotate |\n\t| ccpUnrotate \t| Point::unrotate |\n\t| ccpLengthSQ \t| Point::getLengthSq() |\n\t| ccpDistanceSQ | Point::getDistanceSq |\n\t| ccpLength \t| Point::getLength |\n\t| ccpDistance \t| Point::getDistance |\n\t| ccpNormalize \t| Point::normalize |\n\t| ccpForAngle \t| Point::forAngle |\n\t| ccpToAngle \t| Point::getAngle |\n\t| ccpClamp \t\t| Point::getClampPoint |\n\t| ccpFromSize \t| Point::Point |\n\t| ccpCompOp\t\t| Point::compOp |\n\t| ccpLerp \t\t| Point::lerp |\n\t| ccpFuzzyEqual | Point::fuzzyEqual |\n\t| ccpCompMult \t| Point::Point |\n\t| ccpAngleSigned | Point::getAngle |\n\t| ccpAngle \t\t| Point::getAngle |\n\t| ccpRotateByAngle | Point::rotateByAngle |\n\t| ccpLineInersect | Point::isLineIntersect |\n\t| ccpSegmentIntersect | Point::isSegmentIntersect |\n\t| ccpIntersectPoint | Point::getIntersectPoint |\n\t| CCPointMake\t| Point::Point |\n\t| CCSizeMake\t| Size::Size |\n\t| CCRectMake \t| Rect::Rect |\n\t| PointZero \t| Point::ZERO |\n\t| SizeZero \t\t| Size::ZERO |\n\t| RectZero \t\t| Rect::ZERO |\n\t| TiledGrid3DAction::tile | TiledGrid3DAction::getTile |\n\t| TiledGrid3DAction::originalTile | TiledGrid3DAction::getOriginalTile |\n\t| TiledGrid3D::tile | TiledGrid3D::getTile |\n\t| TiledGrid3D::originalTile | TiledGrid3D::getOriginalTile |\n\t| Grid3DAction::vertex | Grid3DAction::getVertex |\n\t| Grid3DAction::originalVertex | Grid3DAction::getOriginalVertex |\n\t| Grid3D::vertex | Grid3D::getVertex |\n\t| Grid3D::originalVertex | Grid3D::getOriginalVertex |\n\t| Configuration::sharedConfiguration | Configuration::getInstance |\n\t| Configuration::purgeConfiguration | Configuration::destroyInstance() |\n\t| Director::sharedDirector() | Director::getInstance() |\n\t| FileUtils::sharedFileUtils | FileUtils::getInstance |\n\t| FileUtils::purgeFileUtils | FileUtils::destroyInstance |\n\t| EGLView::sharedOpenGLView | EGLView::getInstance |\n\t| ShaderCache::sharedShaderCache | ShaderCache::getInstance |\n\t| ShaderCache::purgeSharedShaderCache | ShaderCache::destroyInstance |\n\t| AnimationCache::sharedAnimationCache | AnimationCache::getInstance |\n\t| AnimationCache::purgeSharedAnimationCache | AnimationCache::destroyInstance |\n\t| SpriteFrameCache::sharedSpriteFrameCache | SpriteFrameCache::getInstance |\n\t| SpriteFrameCache:: purgeSharedSpriteFrameCache | SpriteFrameCache::destroyInstance |\n\t| NotificationCenter::sharedNotificationCenter | NotificationCenter::getInstance |\n\t| NotificationCenter:: purgeNotificationCenter | NotificationCenter::destroyInstance |\n\t| Profiler::sharedProfiler | Profiler::getInstance |\n\t| UserDefault::sharedUserDefault | UserDefault::getInstance |\n\t| UserDefault::purgeSharedUserDefault | UserDefault::destroyInstance |\n\t| Application::sharedApplication | Application::getInstance |\n\t| ccc3() \t\t| Color3B() |\n\t| ccc3BEqual() \t| Color3B::equals() |\n\t| ccc4() \t\t| Color4B() |\n\t| ccc4FFromccc3B() | Color4F() |\n\t| ccc4f() \t\t| Color4F() |\n\t| ccc4FFromccc4B() | Color4F() |\n\t| ccc4BFromccc4F() | Color4B() |\n\t| ccc4FEqual() \t| Color4F::equals() |\n\t| ccWHITE \t\t| Color3B::WHITE |\n\t| ccYELLOW \t\t| Color3B::YELLOW |\n\t| ccBLUE \t\t| Color3B::BLUE |\n\t| ccGREEN \t\t| Color3B::GREEN |\n\t| ccRED \t\t| Color3B::RED |\n\t| ccMAGENTA \t| Color3B::MAGENTA |\n\t| ccBLACK \t\t| Color3B::BLACK |\n\t| ccORANGE \t\t| Color3B::ORANGE |\n\t| ccGRAY \t\t| Color3B::GRAY |\n\t| kBlendFuncDisable | BlendFunc::BLEND_FUNC_DISABLE |\n\n## Changes in the Lua bindings\n\n### Use bindings-generator tool for lua binding\n\nOnly have to write an ini file for a module, don't have to write a lot of .pkg files\n\n### Bind the classes with namespace to lua\n\nIn previous, the lua binding can not bind classes that have the same class name but different namespaces. In order to resolve this issue, now the metatable name of a class is changed. For example, `CCNode` will be changed to `cc.Node`. This modification will affect some APIs as follows:\n\n\t|           v2.x                   |                  v3.0             |\n\t| tolua_usertype(tolua_S,\"CCNode\") | tolua_usertype(tolua_S,\"cc.Node\") |\n\t| tolua_isusertable(tolua_S,1,\"CCNode\",0,&tolua_err \t\t| tolua_isusertable(tolua_S,1,\"cc.Node\",0,&tolua_err  |\n\t| tolua_isusertype(tolua_S,1,\"CCNode\",0,&tolua_err) \t\t| tolua_isusertype(tolua_S,1,\"cc.Node\",0,&tolua_err)  |\n\t| toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"CCNode\") \t\t| toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,\"cc.Node\")  |\n\t| tolua_pushusertype(tolua_S,(void*)tolua_ret,\"CCFileUtils\") \t\t| tolua_pushusertype(tolua_S,(void*)tolua_ret,\"cc.FileUtils\")  |\n\t| tolua.cast(pChildren[i + 1], \"CCNode\") \t\t\t| tolua.cast(pChildren[i + 1], \"cc.Node\") |\n\n### Use ScriptHandlerMgr to manage the register and unregister of Lua function\n\nWhen we want to add register and unregister functions of Lua function for class, we need to change the declarative and defined files and then bind to Lua.\nIn v3.0, we use the `ScriptHandlerMgr`. As an example, lets see the `MenuItem` class:\nIn the 2.x version, we needed to add a declaration in the MenuItem header file:\n```c++\n virtual void registerScriptTapHandler(int nHandler);\n virtual void unregisterScriptTapHandler(void);\n```\nthen implement them in the .cpp file. In the Lua script ,we use it as follow:\n```lua\nmenuItem:registerScriptTapHandler(luafunction)\n```\n\nIn v3.0 version, we only need to add the `HandlerType` enum in the `ScriptHandlerMgr`, and the implementation in luascript as follow:\n```lua\nScriptHandlerMgr:getInstance():registerScriptHandler(menuItem, luafunction,cc.HANDLERTYPE_MENU_CLICKED)\n```\n\n### Use \"cc\"、\"ccs\"、\"ccui\" and \"sp\" as module name\nThe classes in the `cocos2d`、`cocos2d::extension`、`CocosDenshion` and `cocosbuilder` namespace were bound to lua in the `cc` module;\nThe classes in the `cocos2d::gui` namespace were bound to lua in the `ccui` module;\nThe classes in the `spine` namespace were bound to lua in the `sp` module;\nThe classes in the `cocostudio` namespace were bound to lua in the `ccs` module.\n\nThe main differences in the script are as follows:\n```lua\n// v2.x\nCCSprite:create(s_pPathGrossini)\nCCEaseIn:create(createSimpleMoveBy(), 2.5)\n\nCCArmature:create(\"bear\")\n\nImageView:create()\n\n// v3.0\ncc.Director:getInstance():getWinSize()\ncc.EaseIn:create(createSimpleMoveBy(), 2.5)\n\nccs.Armature:create(\"bear\")\n\nccui.ImageView:create()\n```\n\n### Deprecated funtions, tables and classes\n\nAdd a lot of deprecate funtions、table and classes to support 2.x version as far as possible\nNote: `Rect does not support the origin and size member variables`\n\n### Use the Lua table instead of the some structs and classes binding\n\nPoint、Size、Rect、Color3b、Color4b、Color4F、AffineTransform、FontDefinition、Array、Dictionary、PointArray are not bound.\nThe difference is as follow:\n```lua\n// v2.x\nlocal pt = CCPoint(0 , 0)\nlocal rect = CCRect(0, 0, 0, 0)\n// v3.0\nlocal pt = cc.p(0, 0)\nlocal rect = cc.rect(0,0,0,0)\n```\n\nGlobal functions about these classes are changed as follow:\n```lua\n// in v2.x\nlocal pt = ccp(0,0)\nlocal color3B = ccc3(0, 0, 0)\nlocal color4B = ccc4(0, 0, 0, 0)\n\n// in v3.0\nlocal pt  = cc.p(0,0)\nlocal color3B = cc.c3b(0,0,0)\nlocal color4B = cc.c4b(0,0,0,0)\n```\n\nThrough the funtions of the LuaBasicConversion file,they can be converted the Lua table when they are as a parameter in the bindings generator.\n\n### Integrate more modules into lua\nIn the version 3.0,more modules were bound to lua,specific as follows:\n\n```\n1.physics\n2.spine\n3.XMLHttpRequest\n``` \nThe XMLHttpRequest and physics are in the \"cc\" module,and the spine is in the \"sp\" module.\nThe related test cases located in:\n\n```\nphysics   ---> TestLua/PhysicsTest\nspine     ---> TestLua/SpineTest\nXMLHttpRequest ---> TestLua/XMLHttpRequestTest\n```  \n\n\n\n## Known issues\n\nYou can find all the known issues \"here\":http://www.cocos2d-x.org/projects/native/issues\n"
  },
  {
    "path": "cocos2d/docs/doxygen.config",
    "content": "# Doxyfile 1.8.5\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n# \n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n# \n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file\n# that follow. The default is UTF-8 which is also the encoding used for all text\n# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv\n# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv\n# for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = cocos2d-x\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         = 3.0\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \n\n# With the PROJECT_LOGO tag one can specify an logo or icon that is included in\n# the documentation. The maximum height of the logo should not exceed 55 pixels\n# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo\n# to the output directory.\n\nPROJECT_LOGO           = \n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = ./\n\n# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-\n# directories (in 2 levels) under the output directory of each output format and\n# will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = YES\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-\n# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi,\n# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en,\n# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish,\n# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,\n# Turkish, Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief\n# description of a member or function before the detailed description\n# \n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = YES\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = YES\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n# \n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        = \n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    = \n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = YES\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = YES\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n# \n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a\n# new page for each member. If set to NO, the documentation of a member will be\n# part of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 4\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:\\n\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". You can put \\n's in the value part of an alias to insert\n# newlines.\n\nALIASES                = \n\n# This tag can be used to specify a number of word-keyword mappings (TCL only).\n# A mapping has the form \"name=value\". For example adding \"class=itcl::class\"\n# will allow you to use the command class in the itcl::class meaning.\n\nTCL_SUBST              = \n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = NO\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\n# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make\n# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C\n# (default is Fortran), use: inc=Fortran f=C.\n# \n# Note For files without extension you can use no_extension as a placeholder.\n# \n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen.\n\nEXTENSION_MAPPING      = \n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See http://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by by putting a % sign in front of the word\n# or globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = YES\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES, then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n# \n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = YES\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = YES\n\n# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = NO\n\n# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = NO\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = NO\n\n# This flag is only useful for Objective-C code. When set to YES local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = YES\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO these classes will be included in the various overviews. This option has\n# no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = YES\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# (class|struct|union) declarations. If set to NO these declarations will be\n# included in the documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\n# names in lower-case letters. If set to YES upper-case letters are also\n# allowed. This is useful if you have classes or files whose names only differ\n# in case and if your file system supports case sensitive file names. Windows\n# and Mac users are advised to set this option to NO.\n# The default value is: system dependent.\n\nCASE_SENSE_NAMES       = NO\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = YES\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO the members will appear in declaration order.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = YES\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the\n# todo list. This list is created by putting \\todo commands in the\n# documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the\n# test list. This list is created by putting \\test commands in the\n# documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       = \n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES the list\n# will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    = \n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file.\n# \n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            = \n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. Do not use file names with spaces, bibtex cannot handle them. See\n# also \\cite for info how to create references.\n\nCITE_BIB_FILES         = \n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n# \n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as not documenting some parameters\n# in a documented function, or documenting parameters that don't exist or using\n# markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO doxygen will only warn about wrong or incomplete parameter\n# documentation, but not about the absence of documentation.\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr).\n\nWARN_LOGFILE           = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces.\n# Note: If this tag is empty the current directory is searched.\n\nINPUT                  = ../cocos \\\n                         ../cocos/2d/platform \\\n\t\t\t ../docs \\\n\t\t\t ../extensions \\\n\t\t\t ../cocos/scripting/lua/bindings\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see: http://www.gnu.org/software/libiconv) for the list of\n# possible encodings.\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank the\n# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,\n# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,\n# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,\n# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,\n# *.qsf, *.as and *.js.\n\nFILE_PATTERNS          = *.h\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n# \n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                = ../cocos2dx/platform/third_party\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n# \n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       = .svn \\\n                         kazmath \\\n                         FontLabel \\\n                         proj.ios \\\n                         data_support \\\n                         image_support \\\n                         zip_support\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# AClass::ANamespace, ANamespace::*Test\n# \n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories use the pattern */test/*\n\nEXCLUDE_SYMBOLS        = ccArray \\\n                         ccCArray\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           = \n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             = ./\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n# \n# <filter> <input-file>\n# \n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n# \n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n\nINPUT_FILTER           = \n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n\nFILTER_PATTERNS        = \n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER ) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS = \n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE = \n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n# \n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\nSOURCE_BROWSER         = NO\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# classes and enums directly into the documentation.\n# The default value is: NO.\n\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# function all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = NO\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = NO\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES, then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see http://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n# \n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the config file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n# \n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n# \n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = NO\n\n# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the\n# clang parser (see: http://clang.llvm.org/) for more acurate parsing at the\n# cost of reduced performance. This can be particularly helpful with template\n# rich C++ code for which doxygen's built-in parser lacks the necessary type\n# information.\n# Note: The availability of this option depends on whether or not doxygen was\n# compiled with the --with-libclang option.\n# The default value is: NO.\n\nCLANG_ASSISTED_PARSING = NO\n\n# If clang assisted parsing is enabled you can provide the compiler with command\n# line options that you would normally use when invoking the compiler. Note that\n# the include paths will already be set by doxygen for the files and directories\n# specified with INPUT and INCLUDE_PATH.\n# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.\n\nCLANG_OPTIONS          = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\n# which the alphabetical index list will be split.\n# Minimum value: 1, maximum value: 20, default value: 5.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all classes will\n# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\n# can be used to specify a prefix (or a list of prefixes) that should be ignored\n# while generating the index headers.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n# \n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            = \n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            = \n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        = \n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-\n# defined cascading style sheet that is included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefor more robust against future updates.\n# Doxygen will copy the style sheet file to the output directory. For an example\n# see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  = \n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       = \n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the stylesheet and background images according to\n# this color. Hue is specified as an angle on a colorwheel, see\n# http://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use grayscales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n# page will contain the date and time when the page was generated. Setting this\n# to NO can help when comparing the output of multiple runs.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = NO\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see: http://developer.apple.com/tools/xcode/), introduced with\n# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a\n# Makefile in the HTML output directory. Running make will produce the docset in\n# that directory and running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html\n# for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.doxygen.Project\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.doxygen.Publisher\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on\n# Windows.\n# \n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = NO\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               = \n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler ( hhc.exe). If non-empty\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           = \n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated (\n# YES) or that it should be included in the master .chm file ( NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     = \n\n# The BINARY_TOC flag controls whether a binary table of contents is generated (\n# YES) or a normal table of contents ( NO) in the .chm file.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               = \n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-\n# folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   = \n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  = \n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  = \n\n# The QHG_LOCATION tag can be used to specify the location of Qt's\n# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\n# generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           = \n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine-tune the look of the index. As an example, the default style\n# sheet generated by doxygen has an example that shows how to put an image at\n# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\n# the same information as the tab index, you could consider setting\n# DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = YES\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n# \n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = NO\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images\n# generated for formulas are transparent PNGs. Transparent PNGs are not\n# supported properly for IE 6.0, but are supported on all modern browsers.\n# \n# Note that when changing this option you need to delete any form_*.png files in\n# the HTML output directory before the changes have effect.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# http://www.mathjax.org) which uses client side Javascript for the rendering\n# instead of using prerendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. See the MathJax site (see:\n# http://docs.mathjax.org/en/latest/output.html) for more details.\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility), NativeMML (i.e. MathML) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from http://www.mathjax.org before deployment.\n# The default value is: http://cdn.mathjax.org/mathjax/latest.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        = http://www.mathjax.org/mathjax\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     = \n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       = \n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using Javascript. There\n# are two flavours of web server based searching depending on the\n# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for\n# searching and an index file used by the script. When EXTERNAL_SEARCH is\n# enabled the indexing and searching needs to be provided by external tools. See\n# the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n# \n# Doxygen ships with an example indexer ( doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/).\n# \n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n# \n# Doxygen ships with an example indexer ( doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/). See the section \"External Indexing and\n# Searching\" for details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       = \n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     = \n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n# \n# Note that when enabling USE_PDFLATEX this option is only used for generating\n# bitmaps for formulas in the HTML output, but not in the Makefile that is\n# written to the output directory.\n# The default file is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = a4wide\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. To get the times font for\n# instance you can specify\n# EXTRA_PACKAGES=times\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         = \n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\n# generated LaTeX document. The header should contain everything until the first\n# chapter. If it is left blank doxygen will generate a standard header. See\n# section \"Doxygen usage\" for information on how to let doxygen write the\n# default header to a separate file.\n# \n# Note: Only use a user-defined header if you know what you are doing! The\n# following commands have a special meaning inside the header: $title,\n# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will\n# replace them by respectively the title of the page, the current date and time,\n# only the current date, the version number of doxygen, the project name (see\n# PROJECT_NAME), or the project number (see PROJECT_NUMBER).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           = \n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\n# generated LaTeX document. The footer should contain everything after the last\n# chapter. If it is left blank doxygen will generate a standard footer.\n# \n# Note: Only use a user-defined footer if you know what you are doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           = \n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      = \n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = YES\n\n# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\n# the PDF file directly from the LaTeX files. Set this option to YES to get a\n# higher quality PDF documentation.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode\n# command to the generated LaTeX files. This will instruct LaTeX to keep running\n# if errors occur, instead of asking the user for help. This option is also used\n# when generating formulas in HTML.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\n# code with syntax highlighting in the LaTeX output.\n# \n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_SOURCE_CODE      = NO\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# http://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n# \n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's config\n# file, i.e. a series of assignments. You only have to provide replacements,\n# missing definitions are set to their default value.\n# \n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    = \n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's config file. A template extensions file can be generated\n# using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a\n# validating XML parser to check the syntax of the XML files.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_SCHEMA             = \n\n# The XML_DTD tag can be used to specify a XML DTD, which can be used by a\n# validating XML parser to check the syntax of the XML files.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_DTD                = \n\n# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen\n# Definitions (see http://autogen.sf.net) file that captures the structure of\n# the code including all documentation. Note that this feature is still\n# experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n# \n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX = \n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names\n# in the source code. If set to NO only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = YES\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES the includes files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           = \n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  = \n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             = \"CC_PROPERTY_READONLY(varType, varName, funName)=protected: varType varName;\\n /** get##funName*/\\n public: virtual varType get##funName(void);\" \\\n                         \"CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\\n /** get##funName*/\\n public: virtual const varType& get##funName(void);\" \\\n                         \"CC_PROPERTY(varType, varName, funName)=protected: varType varName;\\n /** get##funName*/\\n public: virtual varType get##funName(void);\\n/** set##funName*/\\n public: virtual void set##funName(varType var);\" \\\n                         \"CC_PROPERTY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\\n /** get##funName*/\\n public: virtual const varType& get##funName(void);\\n/** set##funName*/\\n public: virtual void set##funName(const varType& var);\" \\\n                         \"CC_SYNTHESIZE(varType, varName, funName)=protected: varType varName;\\n /** get##funName */\\n public: virtual varType get##funName(void)\\n /** set##funName */ \\n public: virtual void set##funName(varType var);\" \\\n                         \"CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\\n /** get##funName */\\n public: virtual const varType& get##funName(void);\\n /** set#funName */\\n public: virtual void set##funName(const varType& var);\" \\\n                         \"CC_SYNTHESIZE_RETAIN(varType, varName, funName)=protected: varType varName;\\n /** get##funName */\\n public: virtual varType get##funName(void);\\n /** set##funName */\\n public: virtual void set##funName(varType var);\" \\\n                         \"CC_SYNTHESIZE_READONLY(varType, varName, funName)=protected: varType varName;\\n /** get##funName */\\n public: virtual varType get##funName(void);\" \\\n                         \"CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\\n /** get##funName */ \\n public: virtual const varType& get##funName(void);\" \\\n                         \"NS_CC_BEGIN=namespace cocos2d {\" \\\n                         \"NS_CC_END=}\" \\\n                         \"USING_NS_CC=using namsspace cocos2d\" \\\n                         \"NS_CC_EXT_BEGIN=namespace cocos2d { namespace extension {\" \\\n                         \"NS_CC_EXT_END=}}\" \\\n                         \"USING_NS_CC_EXT=using namespace cocos2d::extension\"\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      = \n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all refrences to function-like macros that are alone on a line, have an\n# all uppercase name, and do not end with a semicolon. Such function macros are\n# typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have an unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               = \n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       = \n\n# If the ALLEXTERNALS tag is set to YES all external class will be listed in the\n# class index. If set to NO only the inherited external classes will be listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in\n# the modules index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script\n# interpreter (i.e. the result of 'which perl').\n# The default file (with absolute path) is: /usr/bin/perl.\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram\n# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\n# NO turns the diagrams off. Note that this option also works with HAVE_DOT\n# disabled, but it is recommended to install and use dot, since it yields more\n# powerful graphs.\n# The default value is: YES.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. Doxygen will then run the mscgen tool (see:\n# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\n# documentation. The MSCGEN_PATH tag allows you to specify the directory where\n# the mscgen tool resides. If left empty the tool is assumed to be found in the\n# default search path.\n\nMSCGEN_PATH            = \n\n# If set to YES, the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: NO.\n\nHAVE_DOT               = NO\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# When you want a differently looking font n the dot files that doxygen\n# generates you can specify the font name using DOT_FONTNAME. You need to make\n# sure dot is able to find the font, which can be done by putting it in a\n# standard location or by setting the DOTFONTPATH environment variable or by\n# setting DOT_FONTPATH to the directory containing the font.\n# The default value is: Helvetica.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTNAME           = FreeSans.ttf\n\n# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\n# dot graphs.\n# Minimum value: 4, maximum value: 24, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the default font as specified with\n# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\n# the path where dot can find it using this tag.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           = \n\n# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\n# each documented class showing the direct and indirect inheritance relations.\n# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n# \n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = NO\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n# \n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = NO\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot.\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, jpg, gif and svg.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = png\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n# \n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = NO\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               = \n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           = \n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           = \n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\n# background. This is disabled by default, because dot on Windows does not seem\n# to support this out of the box.\n# \n# Warning: Depending on the platform used, enabling this option may lead to\n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\n# read).\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot\n# files that are used to generate the various graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "cocos2d/extensions/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE    := cocos_extension_static\n\nLOCAL_MODULE_FILENAME := libextension\n\nLOCAL_SRC_FILES := \\\nassets-manager/AssetsManager.cpp \\\nGUI/CCControlExtension/CCControl.cpp \\\nGUI/CCControlExtension/CCControlButton.cpp \\\nGUI/CCControlExtension/CCControlColourPicker.cpp \\\nGUI/CCControlExtension/CCControlHuePicker.cpp \\\nGUI/CCControlExtension/CCControlPotentiometer.cpp \\\nGUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp \\\nGUI/CCControlExtension/CCControlSlider.cpp \\\nGUI/CCControlExtension/CCControlStepper.cpp \\\nGUI/CCControlExtension/CCControlSwitch.cpp \\\nGUI/CCControlExtension/CCControlUtils.cpp \\\nGUI/CCControlExtension/CCInvocation.cpp \\\nGUI/CCControlExtension/CCScale9Sprite.cpp \\\nGUI/CCEditBox/CCEditBox.cpp \\\nGUI/CCEditBox/CCEditBoxImplAndroid.cpp \\\nGUI/CCEditBox/CCEditBoxImplNone.cpp \\\nGUI/CCEditBox/CCEditBoxImplTizen.cpp \\\nGUI/CCEditBox/CCEditBoxImplWin.cpp \\\nGUI/CCScrollView/CCScrollView.cpp \\\nGUI/CCScrollView/CCTableView.cpp \\\nGUI/CCScrollView/CCTableViewCell.cpp \\\nphysics-nodes/CCPhysicsDebugNode.cpp \\\nphysics-nodes/CCPhysicsSprite.cpp\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos_curl_static\nLOCAL_WHOLE_STATIC_LIBRARIES += box2d_static\nLOCAL_WHOLE_STATIC_LIBRARIES += libwebsockets_static\n\nLOCAL_CXXFLAGS += -fexceptions\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/..\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \\\n                           $(LOCAL_PATH)/GUI/CCControlExtension \\\n                           $(LOCAL_PATH)/GUI/CCScrollView \n                    \ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,2d)\n$(call import-module,audio/android)\n$(call import-module,curl/prebuilt/android)\n$(call import-module,Box2D)\n$(call import-module,websockets/prebuilt/android)\n\n"
  },
  {
    "path": "cocos2d/extensions/CMakeLists.txt",
    "content": "set(EXTENSIONS_SRC\n  assets-manager/AssetsManager.cpp\n  GUI/CCControlExtension/CCControl.cpp\n  GUI/CCControlExtension/CCControlButton.cpp\n  GUI/CCControlExtension/CCControlColourPicker.cpp\n  GUI/CCControlExtension/CCControlHuePicker.cpp\n  GUI/CCControlExtension/CCControlPotentiometer.cpp\n  GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp\n  GUI/CCControlExtension/CCControlSlider.cpp\n  GUI/CCControlExtension/CCControlStepper.cpp\n  GUI/CCControlExtension/CCControlSwitch.cpp\n  GUI/CCControlExtension/CCControlUtils.cpp\n  GUI/CCControlExtension/CCInvocation.cpp\n  GUI/CCControlExtension/CCScale9Sprite.cpp\n  GUI/CCEditBox/CCEditBox.cpp\n  GUI/CCEditBox/CCEditBoxImplAndroid.cpp\n  GUI/CCEditBox/CCEditBoxImplNone.cpp\n  GUI/CCEditBox/CCEditBoxImplTizen.cpp\n  GUI/CCEditBox/CCEditBoxImplWin.cpp\n  GUI/CCScrollView/CCScrollView.cpp\n  GUI/CCScrollView/CCTableView.cpp\n  GUI/CCScrollView/CCTableViewCell.cpp\n  physics-nodes/CCPhysicsDebugNode.cpp\n  physics-nodes/CCPhysicsSprite.cpp\n)\n\nif(WIN32)\n  ADD_DEFINITIONS(-DUNICODE -D_UNICODE)\n\n  set(PLATFORM_EXTENSIONS_SRC\n    proj.win32/Win32InputBox.cpp\n  )\nelseif(APPLE)\n\nelse()\n\nendif()\n\ninclude_directories(\n  ..\n)\n\nadd_library(extensions STATIC\n  ${EXTENSIONS_SRC}\n  ${PLATFORM_EXTENSIONS_SRC}\n)\n\nset_target_properties(extensions\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/extensions/ExtensionMacros.h",
    "content": "/****************************************************************************\n Copyright (c) 2012 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __EXTENSIONMARCROS_H__\n#define __EXTENSIONMARCROS_H__\n\n#define NS_CC_EXT_BEGIN                     namespace cocos2d { namespace extension {\n#define NS_CC_EXT_END                       }}\n#define USING_NS_CC_EXT                     using namespace cocos2d::extension\n\n\n#endif /* __EXTENSIONMARCROS_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControl.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2011 Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n *\n * converted to c++ / cocos2d-x by Angus C\n */\n\n#include \"CCControl.h\"\n#include \"CCDirector.h\"\n#include \"CCMenu.h\"\n#include \"CCTouch.h\"\n#include \"CCInvocation.h\"\n#include \"CCEventDispatcher.h\"\n#include \"CCEventListenerTouch.h\"\n\nNS_CC_EXT_BEGIN\n\nControl::Control()\n: _enabled(false)\n, _selected(false)\n, _highlighted(false)\n, _hasVisibleParents(false)\n, _isOpacityModifyRGB(false)\n, _state(State::NORMAL)\n{\n\n}\n\nControl* Control::create()\n{\n    Control* pRet = new Control();\n    if (pRet && pRet->init())\n    {\n        pRet->autorelease();\n        return pRet;\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n        return NULL;\n    }\n}\n\nbool Control::init()\n{\n    if (Layer::init())\n    {\n        // Initialise instance variables\n        _state=Control::State::NORMAL;\n        setEnabled(true);\n        setSelected(false);\n        setHighlighted(false);\n\n        auto dispatcher = Director::getInstance()->getEventDispatcher();\n        auto touchListener = EventListenerTouchOneByOne::create();\n        touchListener->onTouchBegan = CC_CALLBACK_2(Control::onTouchBegan, this);\n        touchListener->onTouchMoved = CC_CALLBACK_2(Control::onTouchMoved, this);\n        touchListener->onTouchEnded = CC_CALLBACK_2(Control::onTouchEnded, this);\n        touchListener->onTouchCancelled = CC_CALLBACK_2(Control::onTouchCancelled, this);\n        \n        dispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);\n        \n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\nControl::~Control()\n{\n    for (auto iter = _dispatchTable.begin(); iter != _dispatchTable.end(); ++iter)\n    {\n        delete iter->second;\n    }\n    \n    _dispatchTable.clear();\n}\n\nvoid Control::sendActionsForControlEvents(EventType controlEvents)\n{\n    // For each control events\n    for (int i = 0; i < kControlEventTotalNumber; i++)\n    {\n        // If the given controlEvents bitmask contains the curent event\n        if (((int)controlEvents & (1 << i)))\n        {\n            // Call invocations\n            const auto& invocationList = this->dispatchListforControlEvent((Control::EventType)(1<<i));\n\n            for(const auto &invocation : invocationList) {\n                invocation->invoke(this);\n            }\n\n            //Call ScriptFunc\n            if (kScriptTypeLua == _scriptType)\n            {\n                cocos2d::BasicScriptData data(this,(void*)&controlEvents);\n                cocos2d::ScriptEvent event(cocos2d::kControlEvent,(void*)&data);\n                cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n            }\n        }\n    }\n}\nvoid Control::addTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents)\n{\n    // For each control events\n    for (int i = 0; i < kControlEventTotalNumber; i++)\n    {\n        // If the given controlEvents bitmask contains the curent event\n        if (((int)controlEvents & (1 << i)))\n        {\n            this->addTargetWithActionForControlEvent(target, action, (EventType)(1<<i));\n        }\n    }\n}\n\n\n\n/**\n * Adds a target and action for a particular event to an internal dispatch \n * table.\n * The action message may optionnaly include the sender and the event as \n * parameters, in that order.\n * When you call this method, target is not retained.\n *\n * @param target The target object that is, the object to which the action \n * message is sent. It cannot be nil. The target is not retained.\n * @param action A selector identifying an action message. It cannot be NULL.\n * @param controlEvent A control event for which the action message is sent.\n * See \"CCControlEvent\" for constants.\n */\nvoid Control::addTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent)\n{    \n    // Create the invocation object\n    Invocation *invocation = Invocation::create(target, action, controlEvent);\n\n    // Add the invocation into the dispatch list for the given control event\n    auto& eventInvocationList = this->dispatchListforControlEvent(controlEvent);\n    eventInvocationList.pushBack(invocation);\n}\n\nvoid Control::removeTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents)\n{\n     // For each control events\n    for (int i = 0; i < kControlEventTotalNumber; i++)\n    {\n        // If the given controlEvents bitmask contains the curent event\n        if (((int)controlEvents & (1 << i)))\n        {\n            this->removeTargetWithActionForControlEvent(target, action, (EventType)(1 << i));\n        }\n    }\n}\n\nvoid Control::removeTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent)\n{\n    // Retrieve all invocations for the given control event\n    //<Invocation*>\n    auto& eventInvocationList = this->dispatchListforControlEvent(controlEvent);\n    \n    //remove all invocations if the target and action are null\n    //TODO: should the invocations be deleted, or just removed from the array? Won't that cause issues if you add a single invocation for multiple events?\n    bool bDeleteObjects=true;\n    if (!target && !action)\n    {\n        //remove objects\n        eventInvocationList.clear();\n    } \n    else\n    {\n        std::vector<Invocation*> tobeRemovedInvocations;\n        \n        //normally we would use a predicate, but this won't work here. Have to do it manually\n        for(const auto &invocation : eventInvocationList) {\n            bool shouldBeRemoved=true;\n            if (target)\n            {\n                shouldBeRemoved=(target==invocation->getTarget());\n            }\n            if (action)\n            {\n                shouldBeRemoved=(shouldBeRemoved && (action==invocation->getAction()));\n            }\n            // Remove the corresponding invocation object\n            if (shouldBeRemoved)\n            {\n                tobeRemovedInvocations.push_back(invocation);\n            }\n        }\n\n        for(const auto &invocation : tobeRemovedInvocations) {\n            eventInvocationList.eraseObject(invocation, bDeleteObjects);\n        }\n    }\n}\n\n\n//CRGBA protocol\nvoid Control::setOpacityModifyRGB(bool bOpacityModifyRGB)\n{\n    _isOpacityModifyRGB=bOpacityModifyRGB;\n    \n    for(auto child : _children){\n        child->setOpacityModifyRGB(bOpacityModifyRGB);\n    }\n}\n\nbool Control::isOpacityModifyRGB() const\n{\n    return _isOpacityModifyRGB;\n}\n\n\nPoint Control::getTouchLocation(Touch* touch)\n{\n    Point touchLocation = touch->getLocation();            // Get the touch position\n    touchLocation = this->convertToNodeSpace(touchLocation);  // Convert to the node space of this class\n    \n    return touchLocation;\n}\n\nbool Control::isTouchInside(Touch* touch)\n{\n    Point touchLocation = touch->getLocation(); // Get the touch position\n    touchLocation = this->getParent()->convertToNodeSpace(touchLocation);\n    Rect bBox = getBoundingBox();\n    return bBox.containsPoint(touchLocation);\n}\n\nVector<Invocation*>& Control::dispatchListforControlEvent(EventType controlEvent)\n{\n    Vector<Invocation*>* invocationList = nullptr;\n    auto iter = _dispatchTable.find((int)controlEvent);\n    \n    // If the invocation list does not exist for the  dispatch table, we create it\n    if (iter == _dispatchTable.end())\n    {\n        invocationList = new Vector<Invocation*>();\n        _dispatchTable[(int)controlEvent] = invocationList;\n    }\n    else\n    {\n        invocationList = iter->second;\n    }\n    return *invocationList;\n}\n\nvoid Control::needsLayout()\n{\n}\n\nvoid Control::setEnabled(bool bEnabled)\n{\n    _enabled = bEnabled;\n    if(_enabled) {\n        _state = Control::State::NORMAL;\n    } else {\n        _state = Control::State::DISABLED;\n    }\n\n    this->needsLayout();\n}\n\nbool Control::isEnabled() const\n{\n    return _enabled;\n}\n\nvoid Control::setSelected(bool bSelected)\n{\n    _selected = bSelected;\n    this->needsLayout();\n}\n\nbool Control::isSelected() const\n{\n    return _selected;\n}\n\nvoid Control::setHighlighted(bool bHighlighted)\n{\n    _highlighted = bHighlighted;\n    this->needsLayout();\n}\n\nbool Control::isHighlighted() const\n{\n    return _highlighted;\n}\n\nbool Control::hasVisibleParents() const\n{\n    auto parent = this->getParent();\n    for( auto c = parent; c != NULL; c = c->getParent() )\n    {\n        if( !c->isVisible() )\n        {\n            return false;\n        }\n    }\n    return true;\n}\n\nControl::EventType operator|(Control::EventType a, Control::EventType b) {\n    return static_cast<Control::EventType>(static_cast<int>(a) | static_cast<int>(b));\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControl.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2011 Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n\n#ifndef __CCCONTROL_H__\n#define __CCCONTROL_H__\n\n#include \"CCControlUtils.h\"\n#include \"CCLayer.h\"\n\nNS_CC_EXT_BEGIN\n\n\nclass Invocation;\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\n/** Number of kinds of control event. */\n#define kControlEventTotalNumber 9\n\n\n/*\n * @class\n * Control is inspired by the UIControl API class from the UIKit library of \n * CocoaTouch. It provides a base class for control Sprites such as Button \n * or Slider that convey user intent to the application.\n *\n * The goal of Control is to define an interface and base implementation for \n * preparing action messages and initially dispatching them to their targets when\n * certain events occur.\n *\n * To use the Control you have to subclass it.\n */\nclass Control : public Layer\n{\npublic:\n    /** Kinds of possible events for the control objects. */\n    enum class EventType\n    {\n        TOUCH_DOWN           = 1 << 0,    // A touch-down event in the control.\n        DRAG_INSIDE          = 1 << 1,    // An event where a finger is dragged inside the bounds of the control.\n        DRAG_OUTSIDE         = 1 << 2,    // An event where a finger is dragged just outside the bounds of the control.\n        DRAG_ENTER           = 1 << 3,    // An event where a finger is dragged into the bounds of the control.\n        DRAG_EXIT            = 1 << 4,    // An event where a finger is dragged from within a control to outside its bounds.\n        TOUCH_UP_INSIDE      = 1 << 5,    // A touch-up event in the control where the finger is inside the bounds of the control.\n        TOUCH_UP_OUTSIDE     = 1 << 6,    // A touch-up event in the control where the finger is outside the bounds of the control.\n        TOUCH_CANCEL         = 1 << 7,    // A system event canceling the current touches for the control.\n        VALUE_CHANGED        = 1 << 8      // A touch dragging or otherwise manipulating a control, causing it to emit a series of different values.\n    };\n    \n    typedef void (Object::*Handler)(Object*, EventType);\n    \n    /** The possible state for a control.  */\n    enum class State\n    {\n        NORMAL         = 1 << 0, // The normal, or default state of a controlthat is, enabled but neither selected nor highlighted.\n        HIGH_LIGHTED   = 1 << 1, // Highlighted state of a control. A control enters this state when a touch down, drag inside or drag enter is performed. You can retrieve and set this value through the highlighted property.\n        DISABLED       = 1 << 2, // Disabled state of a control. This state indicates that the control is currently disabled. You can retrieve and set this value through the enabled property.\n        SELECTED       = 1 << 3  // Selected state of a control. This state indicates that the control is currently selected. You can retrieve and set this value through the selected property.\n    };\n\n    /** Creates a Control object */\n    static Control* create();\n\n    /** Tells whether the control is enabled. */\n    virtual void setEnabled(bool bEnabled);\n    virtual bool isEnabled() const;\n\n    /** A Boolean value that determines the control selected state. */\n    virtual void setSelected(bool bSelected);\n    virtual bool isSelected() const;\n\n    /** A Boolean value that determines whether the control is highlighted. */\n    virtual void setHighlighted(bool bHighlighted);\n    virtual bool isHighlighted() const;\n\n    bool hasVisibleParents() const;\n    /**\n     * Updates the control layout using its current internal state.\n     */\n    virtual void needsLayout();\n\n    /**\n     * Sends action messages for the given control events.\n     *\n     * @param controlEvents A bitmask whose set flags specify the control events for\n     * which action messages are sent. See \"CCControlEvent\" for bitmask constants.\n     */\n    virtual void sendActionsForControlEvents(EventType controlEvents);\n\n    /**\n     * Adds a target and action for a particular event (or events) to an internal\n     * dispatch table.\n     * The action message may optionnaly include the sender and the event as\n     * parameters, in that order.\n     * When you call this method, target is not retained.\n     *\n     * @param target The target object that is, the object to which the action\n     * message is sent. It cannot be nil. The target is not retained.\n     * @param action A selector identifying an action message. It cannot be NULL.\n     * @param controlEvents A bitmask specifying the control events for which the\n     * action message is sent. See \"CCControlEvent\" for bitmask constants.\n     */\n    virtual void addTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents);\n\n    /**\n     * Removes a target and action for a particular event (or events) from an\n     * internal dispatch table.\n     *\n     * @param target The target objectthat is, the object to which the action\n     * message is sent. Pass nil to remove all targets paired with action and the\n     * specified control events.\n     * @param action A selector identifying an action message. Pass NULL to remove\n     * all action messages paired with target.\n     * @param controlEvents A bitmask specifying the control events associated with\n     * target and action. See \"CCControlEvent\" for bitmask constants.\n     */\n    virtual void removeTargetWithActionForControlEvents(Object* target, Handler action, EventType controlEvents);\n\n    /**\n     * Returns a point corresponding to the touh location converted into the\n     * control space coordinates.\n     * @param touch A Touch object that represents a touch.\n     */\n    virtual Point getTouchLocation(Touch* touch);\n\n    virtual bool onTouchBegan(Touch *touch, Event *event) { return false; };\n    virtual void onTouchMoved(Touch *touch, Event *event) {};\n    virtual void onTouchEnded(Touch *touch, Event *event) {};\n    virtual void onTouchCancelled(Touch *touch, Event *event) {};\n    \n    /**\n     * Returns a boolean value that indicates whether a touch is inside the bounds\n     * of the receiver. The given touch must be relative to the world.\n     *\n     * @param touch A Touch object that represents a touch.\n     *\n     * @return Whether a touch is inside the receiver's rect.\n     */\n    virtual bool isTouchInside(Touch * touch);\n\n    // Overrides\n    virtual bool isOpacityModifyRGB() const override;\n    virtual void setOpacityModifyRGB(bool bOpacityModifyRGB) override;\n\nprotected:\n    /**\n     * @js ctor\n     */\n    Control();\n    virtual bool init(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Control();\n\n    /**\n     * Returns an Invocation object able to construct messages using a given \n     * target-action pair. (The invocation may optionnaly include the sender and\n     * the event as parameters, in that order)\n     *\n     * @param target The target object.\n     * @param action A selector identifying an action message.\n     * @param controlEvent A control events for which the action message is sent.\n     * See \"CCControlEvent\" for constants.\n     *\n     * @return an Invocation object able to construct messages using a given \n     * target-action pair.\n     */\n    Invocation* invocationWithTargetAndActionForControlEvent(Object* target, Handler action, EventType controlEvent);\n\n    /**\n    * Returns the Invocation list for the given control event. If the list does\n    * not exist, it'll create an empty array before returning it.\n    *\n    * @param controlEvent A control events for which the action message is sent.\n    * See \"CCControlEvent\" for constants.\n    *\n    * @return the Invocation list for the given control event.\n    */\n    Vector<Invocation*>& dispatchListforControlEvent(EventType controlEvent);\n\n    /**\n     * Adds a target and action for a particular event to an internal dispatch \n     * table.\n     * The action message may optionnaly include the sender and the event as \n     * parameters, in that order.\n     * When you call this method, target is not retained.\n     *\n     * @param target The target objectthat is, the object to which the action \n     * message is sent. It cannot be nil. The target is not retained.\n     * @param action A selector identifying an action message. It cannot be NULL.\n     * @param controlEvent A control event for which the action message is sent.\n     * See \"CCControlEvent\" for constants.\n     */\n    void addTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent);\n    \n    /**\n     * Removes a target and action for a particular event from an internal dispatch\n     * table.\n     *\n     * @param target The target objectthat is, the object to which the action \n     * message is sent. Pass nil to remove all targets paired with action and the\n     * specified control events.\n     * @param action A selector identifying an action message. Pass NULL to remove\n     * all action messages paired with target.\n     * @param controlEvent A control event for which the action message is sent.\n     * See \"CCControlEvent\" for constants.\n     */\n    void removeTargetWithActionForControlEvent(Object* target, Handler action, EventType controlEvent);\n\n    bool _enabled;\n    bool _selected;\n    bool _highlighted;\n\n    /** True if all of the controls parents are visible */\n    bool _hasVisibleParents;\n\n    /**\n     * Table of connection between the ControlEvents and their associated\n     * target-actions pairs. For each ButtonEvents a list of NSInvocation\n     * (which contains the target-action pair) is linked.\n     */\n    std::unordered_map<int, Vector<Invocation*>*> _dispatchTable;\n\n    //CCRGBAProtocol\n    bool _isOpacityModifyRGB;\n\n    /** The current control state constant. */\n    CC_SYNTHESIZE_READONLY(State, _state, State);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(Control);\n};\n\nControl::EventType operator|(Control::EventType a, Control::EventType b);\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlButton.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2011 Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#include \"CCControlButton.h\"\n#include \"CCScale9Sprite.h\"\n#include \"CCLabelTTF.h\"\n#include \"CCLabelBMFont.h\"\n#include \"CCAction.h\"\n#include \"CCActionInterval.h\"\n\nusing namespace std;\n\nNS_CC_EXT_BEGIN\n\nenum\n{\n    kZoomActionTag = 0xCCCB0001,\n};\n\nControlButton::ControlButton()\n: _isPushed(false)\n, _parentInited(false)\n, _doesAdjustBackgroundImage(false)\n, _currentTitleColor(Color3B::WHITE)\n, _titleLabel(nullptr)\n, _backgroundSprite(nullptr)\n, _zoomOnTouchDown(false)\n, _marginV(ControlButtonMarginTB)\n, _marginH(ControlButtonMarginLR)\n{\n\n}\n\nControlButton::~ControlButton()\n{\n    CC_SAFE_RELEASE(_titleLabel);\n    CC_SAFE_RELEASE(_backgroundSprite);\n}\n\n//initialisers\n\nbool ControlButton::init()\n{\n    return this->initWithLabelAndBackgroundSprite(LabelTTF::create(\"\", \"Helvetica\", 12), Scale9Sprite::create());\n}\n\nbool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* backgroundSprite)\n{\n    if (Control::init())\n    {\n        CCASSERT(node != nullptr, \"Label must not be nil.\");\n        LabelProtocol* label = dynamic_cast<LabelProtocol*>(node);\n        CCASSERT(backgroundSprite != nullptr, \"Background sprite must not be nil.\");\n        CCASSERT(label != nullptr || backgroundSprite != nullptr, \"\");\n        \n        _parentInited = true;\n\n        _isPushed = false;\n\n        // Adjust the background image by default\n        setAdjustBackgroundImage(true);\n        setPreferredSize(Size::ZERO);\n        // Zooming button by default\n        _zoomOnTouchDown = true;\n        _scaleRatio = 1.1f;\n        \n        // Set the default anchor point\n        ignoreAnchorPointForPosition(false);\n        setAnchorPoint(Point(0.5f, 0.5f));\n        \n        // Set the nodes\n        setTitleLabel(node);\n        setBackgroundSprite(backgroundSprite);\n\n        // Set the default color and opacity\n        setColor(Color3B(255.0f, 255.0f, 255.0f));\n        setOpacity(255.0f);\n        setOpacityModifyRGB(true);\n        \n        // Initialize the dispatch table\n        \n        setTitleForState(label->getString(), Control::State::NORMAL);\n        setTitleColorForState(node->getColor(), Control::State::NORMAL);\n        setTitleLabelForState(node, Control::State::NORMAL);\n        setBackgroundSpriteForState(backgroundSprite, Control::State::NORMAL);\n        \n        setLabelAnchorPoint(Point(0.5f, 0.5f));\n\n        // Layout update\n        needsLayout();\n\n        return true;\n    }\n    //couldn't init the Control\n    else\n    {\n        return false;\n    }\n}\n\nControlButton* ControlButton::create(Node* label, Scale9Sprite* backgroundSprite)\n{\n    ControlButton *pRet = new ControlButton();\n    pRet->initWithLabelAndBackgroundSprite(label, backgroundSprite);\n    pRet->autorelease();\n    return pRet;\n}\n\nbool ControlButton::initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize)\n{\n    LabelTTF *label = LabelTTF::create(title, fontName, fontSize);\n    return initWithLabelAndBackgroundSprite(label, Scale9Sprite::create());\n}\n\nControlButton* ControlButton::create(const std::string& title, const std::string& fontName, float fontSize)\n{\n    ControlButton *pRet = new ControlButton();\n    pRet->initWithTitleAndFontNameAndFontSize(title, fontName, fontSize);\n    pRet->autorelease();\n    return pRet;\n}\n\nbool ControlButton::initWithBackgroundSprite(Scale9Sprite* sprite)\n{\n    LabelTTF *label = LabelTTF::create(\"\", \"Arial\", 30);//\n    return initWithLabelAndBackgroundSprite(label, sprite);\n}\n\nControlButton* ControlButton::create(Scale9Sprite* sprite)\n{\n    ControlButton *pRet = new ControlButton();\n    pRet->initWithBackgroundSprite(sprite);\n    pRet->autorelease();\n    return pRet;\n}\n\n\nvoid ControlButton::setMargins(int marginH, int marginV)\n{\n    _marginV = marginV;\n    _marginH = marginH;\n    needsLayout();\n}\n\nvoid ControlButton::setEnabled(bool enabled)\n{\n    Control::setEnabled(enabled);\n    needsLayout();\n}\n\nvoid ControlButton::setSelected(bool enabled)\n{\n    Control::setSelected(enabled);\n    needsLayout();\n}\n\nvoid ControlButton::setHighlighted(bool enabled)\n{\n    if (enabled == true)\n    {\n        _state = Control::State::HIGH_LIGHTED;\n    }\n    else\n    {\n        _state = Control::State::NORMAL;\n    }\n    \n    Control::setHighlighted(enabled);\n\n    Action *action = getActionByTag(kZoomActionTag);\n    if (action)\n    {\n        stopAction(action);        \n    }\n    needsLayout();\n    if( _zoomOnTouchDown )\n    {\n        float scaleValue = (isHighlighted() && isEnabled() && !isSelected()) ? _scaleRatio : 1.0f;\n        Action *zoomAction = ScaleTo::create(0.05f, scaleValue);\n        zoomAction->setTag(kZoomActionTag);\n        runAction(zoomAction);\n    }\n}\n\nvoid ControlButton::setZoomOnTouchDown(bool zoomOnTouchDown)\n{\n    _zoomOnTouchDown = zoomOnTouchDown;\n}\n\nbool ControlButton::getZoomOnTouchDown()\n{\n    return _zoomOnTouchDown;\n}\n\nvoid ControlButton::setPreferredSize(const Size& size)\n{\n    if(size.width == 0 && size.height == 0)\n    {\n        _doesAdjustBackgroundImage = true;\n    }\n    else\n    {\n        _doesAdjustBackgroundImage = false;\n        \n        for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter)\n        {\n            iter->second->setPreferredSize(size);\n        }\n    }\n\n    _preferredSize = size;\n    needsLayout();\n}\n\nconst Size& ControlButton::getPreferredSize() const\n{\n    return _preferredSize;\n}\n\nvoid ControlButton::setAdjustBackgroundImage(bool adjustBackgroundImage)\n{\n    _doesAdjustBackgroundImage=adjustBackgroundImage;\n    needsLayout();\n}\n\nbool ControlButton::doesAdjustBackgroundImage()\n{\n    return _doesAdjustBackgroundImage;\n}\n\nconst Point& ControlButton::getLabelAnchorPoint() const\n{\n    return this->_labelAnchorPoint;\n}\n\nvoid ControlButton::setLabelAnchorPoint(const Point& labelAnchorPoint)\n{\n    this->_labelAnchorPoint = labelAnchorPoint;\n    if (_titleLabel != nullptr)\n    {\n        this->_titleLabel->setAnchorPoint(labelAnchorPoint);\n    }\n}\n\nstd::string ControlButton::getTitleForState(State state)\n{\n    auto iter = _titleDispatchTable.find((int)state);\n    if (iter != _titleDispatchTable.end())\n    {\n        return iter->second;\n    }\n    \n    iter = _titleDispatchTable.find((int)Control::State::NORMAL);\n    \n    return iter != _titleDispatchTable.end() ? iter->second : \"\";\n}\n\nvoid ControlButton::setTitleForState(const std::string& title, State state)\n{\n    _titleDispatchTable.erase((int)state);\n\n    if (!title.empty())\n    {\n        _titleDispatchTable[(int)state] = title;\n    }\n    \n    // If the current state if equal to the given state we update the layout\n    if (getState() == state)\n    {\n        needsLayout();\n    }\n}\n\n\nColor3B ControlButton::getTitleColorForState(State state) const\n{\n    Color3B returnColor = Color3B::WHITE;\n\n    auto iter = _titleColorDispatchTable.find((int)state);\n    if (iter != _titleColorDispatchTable.end())\n    {\n        returnColor = iter->second;\n    }\n    else\n    {\n        iter = _titleColorDispatchTable.find((int)Control::State::NORMAL);\n        if (iter != _titleColorDispatchTable.end())\n        {\n            returnColor = iter->second;\n        }\n    }\n\n    return returnColor;\n}\n\nvoid ControlButton::setTitleColorForState(const Color3B& color, State state)\n{\n    _titleColorDispatchTable.erase((int)state);\n    _titleColorDispatchTable[(int)state] = color;\n      \n    // If the current state if equal to the given state we update the layout\n    if (getState() == state)\n    {\n        needsLayout();\n    }\n}\n\nNode* ControlButton::getTitleLabelForState(State state)\n{\n    Node* titleLabel = _titleLabelDispatchTable.at((int)state);\n    if (titleLabel)\n    {\n        return titleLabel;\n    }\n    return _titleLabelDispatchTable.at((int)Control::State::NORMAL);\n}\n\nvoid ControlButton::setTitleLabelForState(Node* titleLabel, State state)\n{\n    Node* previousLabel = _titleLabelDispatchTable.at((int)state);\n    if (previousLabel)\n    {\n        removeChild(previousLabel, true);\n        _titleLabelDispatchTable.erase((int)state);\n    }\n\n    _titleLabelDispatchTable.insert((int)state, titleLabel);\n    titleLabel->setVisible(false);\n    titleLabel->setAnchorPoint(Point(0.5f, 0.5f));\n    addChild(titleLabel, 1);\n\n    // If the current state if equal to the given state we update the layout\n    if (getState() == state)\n    {\n        needsLayout();\n    }\n}\n\nvoid ControlButton::setTitleTTFForState(const std::string& fntFile, State state)\n{\n    std::string title = this->getTitleForState(state);\n    this->setTitleLabelForState(LabelTTF::create(title, fntFile, 12), state);\n}\n\nconst std::string& ControlButton::getTitleTTFForState(State state)\n{\n    LabelProtocol* label = dynamic_cast<LabelProtocol*>(this->getTitleLabelForState(state));\n    LabelTTF* labelTTF = dynamic_cast<LabelTTF*>(label);\n    if(labelTTF != 0)\n    {\n        return labelTTF->getFontName();\n    }\n\n    static std::string ret(\"\");\n    return ret;\n}\n\nvoid ControlButton::setTitleTTFSizeForState(float size, State state)\n{\n    LabelProtocol* label = dynamic_cast<LabelProtocol*>(this->getTitleLabelForState(state));\n    if(label)\n    {\n        LabelTTF* labelTTF = dynamic_cast<LabelTTF*>(label);\n        if(labelTTF != 0)\n        {\n            return labelTTF->setFontSize(size);\n        }\n    }\n}\n\nfloat ControlButton::getTitleTTFSizeForState(State state)\n{\n    LabelProtocol* label = dynamic_cast<LabelProtocol*>(this->getTitleLabelForState(state));\n    LabelTTF* labelTTF = dynamic_cast<LabelTTF*>(label);\n    if(labelTTF != 0)\n    {\n        return labelTTF->getFontSize();\n    }\n    else\n    {\n        return 0;\n    }\n}\n\nvoid ControlButton::setTitleBMFontForState(const std::string& fntFile, State state)\n{\n    std::string title = this->getTitleForState(state);\n    this->setTitleLabelForState(LabelBMFont::create(title, fntFile), state);\n}\n\nconst std::string& ControlButton::getTitleBMFontForState(State state)\n{\n    LabelProtocol* label = dynamic_cast<LabelProtocol*>(this->getTitleLabelForState(state));\n    LabelBMFont* labelBMFont = dynamic_cast<LabelBMFont*>(label);\n    if(labelBMFont != 0)\n    {\n        return labelBMFont->getFntFile();\n    }\n\n    static std::string ret(\"\");\n    return ret;\n}\n\n\nScale9Sprite* ControlButton::getBackgroundSpriteForState(State state)\n{\n    auto backgroundSprite = _backgroundSpriteDispatchTable.at((int)state);\n    if (backgroundSprite)\n    {\n        return backgroundSprite;\n    }\n    return _backgroundSpriteDispatchTable.at((int)Control::State::NORMAL);\n}\n\n\nvoid ControlButton::setBackgroundSpriteForState(Scale9Sprite* sprite, State state)\n{\n    Size oldPreferredSize = _preferredSize;\n\n    auto previousBackgroundSprite = _backgroundSpriteDispatchTable.at((int)state);\n    if (previousBackgroundSprite)\n    {\n        removeChild(previousBackgroundSprite, true);\n        _backgroundSpriteDispatchTable.erase((int)state);\n    }\n\n    _backgroundSpriteDispatchTable.insert((int)state, sprite);\n    sprite->setVisible(false);\n    sprite->setAnchorPoint(Point(0.5f, 0.5f));\n    addChild(sprite);\n\n    if (this->_preferredSize.width != 0 || this->_preferredSize.height != 0)\n    {\n        if (oldPreferredSize.equals(_preferredSize))\n        {\n            // Force update of preferred size\n            sprite->setPreferredSize(Size(oldPreferredSize.width+1, oldPreferredSize.height+1));\n        }\n        \n        sprite->setPreferredSize(this->_preferredSize);\n    }\n\n    // If the current state if equal to the given state we update the layout\n    if (getState() == state)\n    {\n        needsLayout();\n    }\n}\n\nvoid ControlButton::setBackgroundSpriteFrameForState(SpriteFrame * spriteFrame, State state)\n{\n    Scale9Sprite * sprite = Scale9Sprite::createWithSpriteFrame(spriteFrame);\n    this->setBackgroundSpriteForState(sprite, state);\n}\n\n\nvoid ControlButton::needsLayout()\n{\n    if (!_parentInited) {\n        return;\n    }\n    // Hide the background and the label\n    if (_titleLabel != nullptr) {\n        _titleLabel->setVisible(false);\n    }\n    if (_backgroundSprite) {\n        _backgroundSprite->setVisible(false);\n    }\n    // Update anchor of all labels\n    this->setLabelAnchorPoint(this->_labelAnchorPoint);\n    \n    // Update the label to match with the current state\n    _currentTitle = getTitleForState(_state);\n\n    _currentTitleColor = getTitleColorForState(_state);\n\n    this->setTitleLabel(getTitleLabelForState(_state));\n\n    LabelProtocol* label = dynamic_cast<LabelProtocol*>(_titleLabel);\n    if (label && !_currentTitle.empty())\n    {\n        label->setString(_currentTitle);\n    }\n\n    if (_titleLabel)\n    {\n        _titleLabel->setColor(_currentTitleColor);\n    }\n    if (_titleLabel != nullptr)\n    {\n        _titleLabel->setPosition(Point (getContentSize().width / 2, getContentSize().height / 2));\n    }\n    \n    // Update the background sprite\n    this->setBackgroundSprite(this->getBackgroundSpriteForState(_state));\n    if (_backgroundSprite != nullptr)\n    {\n        _backgroundSprite->setPosition(Point (getContentSize().width / 2, getContentSize().height / 2));\n    }\n   \n    // Get the title label size\n    Size titleLabelSize;\n    if (_titleLabel != nullptr)\n    {\n        titleLabelSize = _titleLabel->getBoundingBox().size;\n    }\n    \n    // Adjust the background image if necessary\n    if (_doesAdjustBackgroundImage)\n    {\n        // Add the margins\n        if (_backgroundSprite != nullptr)\n        {\n            _backgroundSprite->setContentSize(Size(titleLabelSize.width + _marginH * 2, titleLabelSize.height + _marginV * 2));\n        }\n    } \n    else\n    {        \n        //TODO: should this also have margins if one of the preferred sizes is relaxed?\n        if (_backgroundSprite != nullptr)\n        {\n            Size preferredSize = _backgroundSprite->getPreferredSize();\n            if (preferredSize.width <= 0)\n            {\n                preferredSize.width = titleLabelSize.width;\n            }\n            if (preferredSize.height <= 0)\n            {\n                preferredSize.height = titleLabelSize.height;\n            }\n\n            _backgroundSprite->setContentSize(preferredSize);\n        }\n    }\n    \n    // Set the content size\n    Rect rectTitle;\n    if (_titleLabel != nullptr)\n    {\n        rectTitle = _titleLabel->getBoundingBox();\n    }\n    Rect rectBackground;\n    if (_backgroundSprite != nullptr)\n    {\n        rectBackground = _backgroundSprite->getBoundingBox();\n    }\n\n    Rect maxRect = ControlUtils::RectUnion(rectTitle, rectBackground);\n    setContentSize(Size(maxRect.size.width, maxRect.size.height));        \n    \n    if (_titleLabel != nullptr)\n    {\n        _titleLabel->setPosition(Point(getContentSize().width/2, getContentSize().height/2));\n        // Make visible the background and the label\n        _titleLabel->setVisible(true);\n    }\n  \n    if (_backgroundSprite != nullptr)\n    {\n        _backgroundSprite->setPosition(Point(getContentSize().width/2, getContentSize().height/2));\n        _backgroundSprite->setVisible(true);   \n    }   \n}\n\n\n\nbool ControlButton::onTouchBegan(Touch *pTouch, Event *pEvent)\n{\n    if (!isTouchInside(pTouch) || !isEnabled() || !isVisible() || !hasVisibleParents() )\n    {\n        return false;\n    }\n    \n    for (Node *c = this->_parent; c != nullptr; c = c->getParent())\n    {\n        if (c->isVisible() == false)\n        {\n            return false;\n        }\n    }\n    \n    _isPushed = true;\n    this->setHighlighted(true);\n    sendActionsForControlEvents(Control::EventType::TOUCH_DOWN);\n    return true;\n}\n\nvoid ControlButton::onTouchMoved(Touch *pTouch, Event *pEvent)\n{    \n    if (!isEnabled() || !isPushed() || isSelected())\n    {\n        if (isHighlighted())\n        {\n            setHighlighted(false);\n        }\n        return;\n    }\n    \n    bool isTouchMoveInside = isTouchInside(pTouch);\n    if (isTouchMoveInside && !isHighlighted())\n    {\n        setHighlighted(true);\n        sendActionsForControlEvents(Control::EventType::DRAG_ENTER);\n    }\n    else if (isTouchMoveInside && isHighlighted())\n    {\n        sendActionsForControlEvents(Control::EventType::DRAG_INSIDE);\n    }\n    else if (!isTouchMoveInside && isHighlighted())\n    {\n        setHighlighted(false);\n        \n        sendActionsForControlEvents(Control::EventType::DRAG_EXIT);        \n    }\n    else if (!isTouchMoveInside && !isHighlighted())\n    {\n        sendActionsForControlEvents(Control::EventType::DRAG_OUTSIDE);        \n    }\n}\nvoid ControlButton::onTouchEnded(Touch *pTouch, Event *pEvent)\n{\n    _isPushed = false;\n    setHighlighted(false);\n    \n    \n    if (isTouchInside(pTouch))\n    {\n        sendActionsForControlEvents(Control::EventType::TOUCH_UP_INSIDE);        \n    }\n    else\n    {\n        sendActionsForControlEvents(Control::EventType::TOUCH_UP_OUTSIDE);        \n    }\n}\n\nvoid ControlButton::setOpacity(GLubyte opacity)\n{\n    // XXX fixed me if not correct\n    Control::setOpacity(opacity);\n//    _opacity = opacity;\n//    \n//    Object* child;\n//    Array* children=getChildren();\n//    CCARRAY_FOREACH(children, child)\n//    {\n//        RGBAProtocol* pNode = dynamic_cast<RGBAProtocol*>(child);        \n//        if (pNode)\n//        {\n//            pNode->setOpacity(opacity);\n//        }\n//    }\n    \n    for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter)\n    {\n        iter->second->setOpacity(opacity);\n    }\n}\n\nGLubyte ControlButton::getOpacity() const\n{\n    return _realOpacity;\n}\n\nvoid ControlButton::setColor(const Color3B & color)\n{\n\tControl::setColor(color);\n\t\n    for (auto iter = _backgroundSpriteDispatchTable.begin(); iter != _backgroundSpriteDispatchTable.end(); ++iter)\n    {\n        iter->second->setColor(color);\n    }\n}\n\nconst Color3B& ControlButton::getColor() const\n{\n\treturn _realColor;\n}\n\nvoid ControlButton::onTouchCancelled(Touch *pTouch, Event *pEvent)\n{\n    _isPushed = false;\n    setHighlighted(false);\n    sendActionsForControlEvents(Control::EventType::TOUCH_CANCEL);\n}\n\nControlButton* ControlButton::create()\n{\n    ControlButton *pControlButton = new ControlButton();\n    if (pControlButton && pControlButton->init())\n    {\n        pControlButton->autorelease();\n        return pControlButton;\n    }\n    CC_SAFE_DELETE(pControlButton);\n    return nullptr;\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlButton.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2011 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n\n#ifndef __CCCONTROL_BUTTON_H__\n#define __CCCONTROL_BUTTON_H__\n\n#include \"CCControl.h\"\n#include \"CCInvocation.h\"\n#include \"CCScale9Sprite.h\"\n#include \"CCMap.h\"\n\nNS_CC_EXT_BEGIN\n\n/* Define the button margin for Left/Right edge */\n#define ControlButtonMarginLR 8 // px\n/* Define the button margin for Top/Bottom edge */\n#define ControlButtonMarginTB 2 // px\n\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\n/** @class ControlButton Button control for Cocos2D. */\nclass ControlButton : public Control\n{        \npublic:\n    static ControlButton* create();\n    static ControlButton* create(Scale9Sprite* sprite);\n    static ControlButton* create(Node* label, Scale9Sprite* backgroundSprite);\n    static ControlButton* create(const std::string& title, const std::string& fontName, float fontSize);\n\n    virtual void needsLayout(void);\n\n    virtual void setEnabled(bool enabled);\n    virtual void setSelected(bool enabled);\n    virtual void setHighlighted(bool enabled);\n\n    bool isPushed() const { return _isPushed; }\n\n    /**\n     * Returns the title used for a state.\n     *\n     * @param state The state that uses the title. Possible values are described in\n     * \"CCControlState\".\n     *\n     * @return The title for the specified state.\n     */\n    virtual std::string getTitleForState(State state);\n\n    /**\n     * Sets the title string to use for the specified state.\n     * If a property is not specified for a state, the default is to use\n     * the ButtonStateNormal value.\n     *\n     * @param title The title string to use for the specified state.\n     * @param state The state that uses the specified title. The values are described\n     * in \"CCControlState\".\n     */\n    virtual void setTitleForState(const std::string& title, State state);\n\n    /**\n     * Returns the title color used for a state.\n     *\n     * @param state The state that uses the specified color. The values are described\n     * in \"CCControlState\".\n     *\n     * @return The color of the title for the specified state.\n     */\n\n    virtual Color3B getTitleColorForState(State state) const;\n\n    /**\n     * Sets the color of the title to use for the specified state.\n     *\n     * @param color The color of the title to use for the specified state.\n     * @param state The state that uses the specified color. The values are described\n     * in \"CCControlState\".\n     */\n    virtual void setTitleColorForState(const Color3B& color, State state);\n\n    /**\n     * Returns the title label used for a state.\n     *\n     * @param state The state that uses the title label. Possible values are described\n     * in \"CCControlState\".\n     */\n    virtual Node* getTitleLabelForState(State state);\n\n    /**\n     * Sets the title label to use for the specified state.\n     * If a property is not specified for a state, the default is to use\n     * the ButtonStateNormal value.\n     *\n     * @param label The title label to use for the specified state.\n     * @param state The state that uses the specified title. The values are described\n     * in \"CCControlState\".\n     */\n    virtual void setTitleLabelForState(Node* label, State state);\n\n    virtual void setTitleTTFForState(const std::string& fntFile, State state);\n    virtual const std::string& getTitleTTFForState(State state);\n\n    virtual void setTitleTTFSizeForState(float size, State state);\n    virtual float getTitleTTFSizeForState(State state);\n\n    /**\n     * Sets the font of the label, changes the label to a LabelBMFont if neccessary.\n     * @param fntFile The name of the font to change to\n     * @param state The state that uses the specified fntFile. The values are described\n     * in \"CCControlState\".\n     */\n    virtual void setTitleBMFontForState(const std::string& fntFile, State state);\n    virtual const std::string& getTitleBMFontForState(State state);\n\n    /**\n     * Returns the background sprite used for a state.\n     *\n     * @param state The state that uses the background sprite. Possible values are\n     * described in \"CCControlState\".\n     */\n    virtual Scale9Sprite* getBackgroundSpriteForState(State state);\n\n    /**\n     * Sets the background sprite to use for the specified button state.\n     *\n     * @param sprite The background sprite to use for the specified state.\n     * @param state The state that uses the specified image. The values are described\n     * in \"CCControlState\".\n     */\n    virtual void setBackgroundSpriteForState(Scale9Sprite* sprite, State state);\n\n    /**\n     * Sets the background spriteFrame to use for the specified button state.\n     *\n     * @param spriteFrame The background spriteFrame to use for the specified state.\n     * @param state The state that uses the specified image. The values are described\n     * in \"CCControlState\".\n     */\n    virtual void setBackgroundSpriteFrameForState(SpriteFrame * spriteFrame, State state);\n\n    //set the margins at once (so we only have to do one call of needsLayout)\n    virtual void setMargins(int marginH, int marginV);\n\n    /** Adjust the background image. YES by default. If the property is set to NO, the\n     background will use the prefered size of the background image. */\n    bool doesAdjustBackgroundImage();\n    void setAdjustBackgroundImage(bool adjustBackgroundImage);\n\n    // Overrides\n    virtual bool onTouchBegan(Touch *touch, Event *event) override;\n    virtual void onTouchMoved(Touch *touch, Event *event) override;\n    virtual void onTouchEnded(Touch *touch, Event *event) override;\n    virtual void onTouchCancelled(Touch *touch, Event *event) override;\n    virtual GLubyte getOpacity(void) const override;\n    virtual void setOpacity(GLubyte var) override;\n\tvirtual const Color3B& getColor(void) const override;\n\tvirtual void setColor(const Color3B&) override;\n\n\n    const std::string& getCurrentTitle() const { return _currentTitle; };\n    std::string getCurrentTitle() { return _currentTitle; };\n    \nprotected:\n    /**\n     * @js ctor\n     */\n    ControlButton();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlButton();\n\n    virtual bool init();\n    virtual bool initWithLabelAndBackgroundSprite(Node* label, Scale9Sprite* backgroundSprite);\n    virtual bool initWithBackgroundSprite(Scale9Sprite* sprite);\n    virtual bool initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize);\n\n    bool _isPushed;\n    bool _parentInited;\n    bool _doesAdjustBackgroundImage;\n\n    /** The current title that is displayed on the button. */\n    std::string _currentTitle;\n\n    /** The current color used to display the title. */\n    CC_SYNTHESIZE_READONLY_PASS_BY_REF(Color3B, _currentTitleColor, CurrentTitleColor);\n\n    /** The current title label. */\n    CC_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel);\n\n    /** The current background sprite. */\n    CC_SYNTHESIZE_RETAIN(Scale9Sprite*, _backgroundSprite, BackgroundSprite);\n\n    /** The prefered size of the button, if label is larger it will be expanded. */\n    CC_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize);\n\n    /** Adjust the button zooming on touchdown. Default value is YES. */\n    CC_PROPERTY(bool, _zoomOnTouchDown, ZoomOnTouchDown);\n    /** Scale ratio button on touchdown. Default value 1.1f */\n    CC_SYNTHESIZE(float, _scaleRatio, ScaleRatio);\n\n    CC_PROPERTY_PASS_BY_REF(Point, _labelAnchorPoint, LabelAnchorPoint);\n\n    std::unordered_map<int, std::string> _titleDispatchTable;\n    std::unordered_map<int, Color3B> _titleColorDispatchTable;\n\n    Map<int, Node*> _titleLabelDispatchTable;\n    Map<int, Scale9Sprite*> _backgroundSpriteDispatchTable;\n\n    /* Define the button margin for Top/Bottom edge */\n    CC_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin);\n    /* Define the button margin for Left/Right edge */\n    CC_SYNTHESIZE_READONLY(int, _marginH, HorizontalOrigin);\n\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ControlButton);\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Stewart Hamilton-Arrandale.\n * http://creativewax.co.uk\n *\n * Modified by Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * converted to c++ / cocos2d-x by Angus C\n */\n\n#include \"CCControlColourPicker.h\"\n#include \"CCSpriteFrameCache.h\"\n#include \"CCSpriteBatchNode.h\"\n\nNS_CC_EXT_BEGIN\n\nControlColourPicker::ControlColourPicker()\n: _colourPicker(NULL)\n, _huePicker(NULL)\n, _background(NULL)\n{\n\n}\n\nControlColourPicker::~ControlColourPicker()\n{\n    CC_SAFE_RELEASE(_background);\n    CC_SAFE_RELEASE(_huePicker);\n    CC_SAFE_RELEASE(_colourPicker);\n}\n\nbool ControlColourPicker::init()\n{\n    if (Control::init())\n    {\n        // Cache the sprites\n        SpriteFrameCache::getInstance()->addSpriteFramesWithFile(\"extensions/CCControlColourPickerSpriteSheet.plist\");\n        \n        // Create the sprite batch node\n        SpriteBatchNode *spriteSheet  = SpriteBatchNode::create(\"extensions/CCControlColourPickerSpriteSheet.png\");\n        addChild(spriteSheet);\n        \n        // MIPMAP\n//        ccTexParams params  = {GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_REPEAT, GL_REPEAT};\n\t\t/* Comment next line to avoid something like mosaic in 'ControlExtensionTest',\n\t\t   especially the display of 'huePickerBackground.png' when in 800*480 window size with 480*320 design resolution and hd(960*640) resources.\n\t    */\n//        spriteSheet->getTexture()->setAliasTexParameters();\n//         spriteSheet->getTexture()->setTexParameters(&params);\n//         spriteSheet->getTexture()->generateMipmap();\n\n        // Init default color\n        _hsv.h = 0;\n        _hsv.s = 0;\n        _hsv.v = 0;\n        \n        // Add image\n        _background=ControlUtils::addSpriteToTargetWithPosAndAnchor(\"menuColourPanelBackground.png\", spriteSheet, Point::ZERO, Point(0.5f, 0.5f));\n        CC_SAFE_RETAIN(_background);\n        \n        Point backgroundPointZero = _background->getPosition() - Point(_background->getContentSize().width / 2, _background->getContentSize().height / 2);\n        \n        // Setup panels\n        float hueShift                = 8;\n        float colourShift             = 28;\n        \n        _huePicker = new ControlHuePicker();\n        _huePicker->initWithTargetAndPos(spriteSheet, Point(backgroundPointZero.x + hueShift, backgroundPointZero.y + hueShift));\n        _colourPicker = new ControlSaturationBrightnessPicker();\n        _colourPicker->initWithTargetAndPos(spriteSheet, Point(backgroundPointZero.x + colourShift, backgroundPointZero.y + colourShift));\n        \n        // Setup events\n        _huePicker->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlColourPicker::hueSliderValueChanged), Control::EventType::VALUE_CHANGED);\n        _colourPicker->addTargetWithActionForControlEvents(this, cccontrol_selector(ControlColourPicker::colourSliderValueChanged), Control::EventType::VALUE_CHANGED);\n       \n        // Set defaults\n        updateHueAndControlPicker();\n        addChild(_huePicker);\n        addChild(_colourPicker);\n\n        // Set content size\n        setContentSize(_background->getContentSize());\n        return true;\n    }\n    else\n        return false;\n}\n\nControlColourPicker* ControlColourPicker::create()\n{\n    ControlColourPicker *pRet = new ControlColourPicker();\n    pRet->init();\n    pRet->autorelease();\n    return pRet;\n}\n\n\nvoid ControlColourPicker::setColor(const Color3B& color)\n{\n    // XXX fixed me if not correct\n    Control::setColor(color);\n    \n    RGBA rgba;\n    rgba.r      = color.r / 255.0f;\n    rgba.g      = color.g / 255.0f;\n    rgba.b      = color.b / 255.0f;\n    rgba.a      = 1.0f;\n    \n    _hsv=ControlUtils::HSVfromRGB(rgba);\n    updateHueAndControlPicker();\n}\n\nvoid ControlColourPicker::setEnabled(bool enabled)\n{\n    Control::setEnabled(enabled);\n    if (_huePicker != NULL)\n    {\n        _huePicker->setEnabled(enabled);\n    }\n    if (_colourPicker)\n    {\n        _colourPicker->setEnabled(enabled);\n    } \n}\n\n\n//need two events to prevent an infinite loop! (can't update huePicker when the huePicker triggers the callback due to Control::EventType::VALUE_CHANGED)\nvoid ControlColourPicker::updateControlPicker()\n{\n    _huePicker->setHue(_hsv.h);\n    _colourPicker->updateWithHSV(_hsv);\n}\n\nvoid ControlColourPicker::updateHueAndControlPicker()\n{\n    _huePicker->setHue(_hsv.h);\n    _colourPicker->updateWithHSV(_hsv);\n    _colourPicker->updateDraggerWithHSV(_hsv);\n}\n\n\nvoid ControlColourPicker::hueSliderValueChanged(Object * sender, Control::EventType controlEvent)\n{\n    _hsv.h      = ((ControlHuePicker*)sender)->getHue();\n\n    // Update the value\n    RGBA rgb    = ControlUtils::RGBfromHSV(_hsv);\n    // XXX fixed me if not correct\n    Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f)));\n    \n    // Send Control callback\n    sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n    updateControlPicker();\n}\n\nvoid ControlColourPicker::colourSliderValueChanged(Object * sender, Control::EventType controlEvent)\n{\n    _hsv.s=((ControlSaturationBrightnessPicker*)sender)->getSaturation();\n    _hsv.v=((ControlSaturationBrightnessPicker*)sender)->getBrightness();\n\n\n     // Update the value\n    RGBA rgb    = ControlUtils::RGBfromHSV(_hsv);\n    // XXX fixed me if not correct\n    Control::setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f)));\n    \n    // Send Control callback\n    sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n}\n\n//ignore all touches, handled by children\nbool ControlColourPicker::onTouchBegan(Touch* touch, Event* pEvent)\n{\n    return false;\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlColourPicker.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Stewart Hamilton-Arrandale.\n * http://creativewax.co.uk\n *\n * Modified by Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n#ifndef __CCCONTROL_COLOUR_PICKER_H__\n#define __CCCONTROL_COLOUR_PICKER_H__\n\n\n#include \"CCControl.h\"\n#include \"CCControlUtils.h\"\n#include \"CCControlHuePicker.h\"\n#include \"CCControlSaturationBrightnessPicker.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\nclass ControlColourPicker: public Control\n{\npublic:\n    static ControlColourPicker* create();\n    /**\n     * @js ctor\n     */\n    ControlColourPicker();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlColourPicker();\n\n    virtual bool init();\n\n    virtual void setColor(const Color3B& colorValue);\n    virtual void setEnabled(bool bEnabled);\n\n    //virtual ~ControlColourPicker();\n    void hueSliderValueChanged(Object * sender, Control::EventType controlEvent);\n    void colourSliderValueChanged(Object * sender, Control::EventType controlEvent);\n\nprotected:\n    void updateControlPicker();\n    void updateHueAndControlPicker();\n    virtual bool onTouchBegan(Touch* touch, Event* pEvent);\n\n    HSV _hsv;\n    CC_SYNTHESIZE_RETAIN(ControlSaturationBrightnessPicker*, _colourPicker, colourPicker)\n    CC_SYNTHESIZE_RETAIN(ControlHuePicker*, _huePicker, HuePicker)\n    CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background)\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlExtensions.h",
    "content": "/****************************************************************************\nCopyright (c) 2012 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCCONTROL_EXTENSIONS_H__\n#define __CCCONTROL_EXTENSIONS_H__\n\n#include \"CCScale9Sprite.h\"\n#include \"CCControl.h\"\n#include \"CCControlButton.h\"\n#include \"CCControlColourPicker.h\"\n#include \"CCControlPotentiometer.h\"\n#include \"CCControlSlider.h\"\n#include \"CCControlStepper.h\"\n#include \"CCControlSwitch.h\"\n\n#endif"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Stewart Hamilton-Arrandale.\n * http://creativewax.co.uk\n *\n * Modified by Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n#include \"CCControlHuePicker.h\"\n\nNS_CC_EXT_BEGIN\n\nControlHuePicker::ControlHuePicker()\n: _hue(0.0f)\n, _huePercentage(0.0f)\n, _background(NULL)\n, _slider(NULL)\n{\n\n}\n\nControlHuePicker::~ControlHuePicker()\n{\n    removeAllChildrenWithCleanup(true);\n    CC_SAFE_RELEASE(_background);\n    CC_SAFE_RELEASE(_slider);\n}\n\nControlHuePicker* ControlHuePicker::create(Node* target, Point pos)\n{\n    ControlHuePicker *pRet = new ControlHuePicker();\n    pRet->initWithTargetAndPos(target, pos);\n    pRet->autorelease();\n    return pRet;\n}\n\n\nbool ControlHuePicker::initWithTargetAndPos(Node* target, Point pos)\n{\n    if (Control::init())\n    {\n        // Add background and slider sprites\n        this->setBackground(ControlUtils::addSpriteToTargetWithPosAndAnchor(\"huePickerBackground.png\", target, pos, Point(0.0f, 0.0f)));\n        this->setSlider(ControlUtils::addSpriteToTargetWithPosAndAnchor(\"colourPicker.png\", target, pos, Point(0.5f, 0.5f)));\n        \n        _slider->setPosition(Point(pos.x, pos.y + _background->getBoundingBox().size.height * 0.5f));\n        _startPos=pos;\n\n        // Sets the default value\n        _hue=0.0f;\n        _huePercentage=0.0f;\n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\nvoid ControlHuePicker::setHue(float hueValue)\n{\n    _hue=hueValue;\n    // Set the position of the slider to the correct hue\n    // We need to divide it by 360 as its taken as an angle in degrees\n    float huePercentage\t= hueValue / 360.0f;\n    setHuePercentage(huePercentage);\n}\n\nvoid ControlHuePicker::setHuePercentage(float hueValueInPercent)\n{\n    _huePercentage=hueValueInPercent;\n    _hue=_huePercentage*360.0f;\n\n    // Clamp the position of the icon within the circle\n    Rect backgroundBox=_background->getBoundingBox();\n\n    // Get the center point of the background image\n    float centerX           = _startPos.x + backgroundBox.size.width * 0.5f;\n    float centerY           = _startPos.y + backgroundBox.size.height * 0.5f;\n    \n    // Work out the limit to the distance of the picker when moving around the hue bar\n    float limit             = backgroundBox.size.width * 0.5f - 15.0f;\n    \n    // Update angle\n    float angleDeg          = _huePercentage * 360.0f - 180.0f;\n    float angle             = CC_DEGREES_TO_RADIANS(angleDeg);\n    \n    // Set new position of the slider\n    float x                 = centerX + limit * cosf(angle);\n    float y                 = centerY + limit * sinf(angle);\n    _slider->setPosition(Point(x, y));\n\n}\n\nvoid ControlHuePicker::setEnabled(bool enabled)\n{\n    Control::setEnabled(enabled);\n    if (_slider != NULL)\n    {\n        _slider->setOpacity(enabled ? 255 : 128);\n    }\n}\n\nvoid ControlHuePicker::updateSliderPosition(Point location)\n{\n\n    // Clamp the position of the icon within the circle\n    Rect backgroundBox=_background->getBoundingBox();\n    \n    // Get the center point of the background image\n    float centerX           = _startPos.x + backgroundBox.size.width * 0.5f;\n    float centerY           = _startPos.y + backgroundBox.size.height * 0.5f;\n\n    // Work out the distance difference between the location and center\n    float dx                = location.x - centerX;\n    float dy                = location.y - centerY;\n    \n    // Update angle by using the direction of the location\n    float angle             = atan2f(dy, dx);\n    float angleDeg          = CC_RADIANS_TO_DEGREES(angle) + 180.0f;\n    \n    // use the position / slider width to determin the percentage the dragger is at\n    setHue(angleDeg);\n    \n    // send Control callback\n    sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n}\n\nbool ControlHuePicker::checkSliderPosition(Point location)\n{\n    // compute the distance between the current location and the center\n    double distance = sqrt(pow (location.x + 10, 2) + pow(location.y, 2));\n\n    // check that the touch location is within the circle\n    if (80 > distance && distance > 59)\n    {\n        updateSliderPosition(location);\n        return true;\n    }\n    return false;\n}\n\nbool ControlHuePicker::onTouchBegan(Touch* touch, Event* event)\n{\n    if (!isEnabled() || !isVisible())\n    {\n        return false;\n    }\n    \n    // Get the touch location\n    Point touchLocation=getTouchLocation(touch);\n\n    // Check the touch position on the slider\n    return checkSliderPosition(touchLocation);\n}\n\n\nvoid ControlHuePicker::onTouchMoved(Touch* touch, Event* event)\n{\n    // Get the touch location\n    Point touchLocation=getTouchLocation(touch);\n\n    //small modification: this allows changing of the colour, even if the touch leaves the bounding area\n//     updateSliderPosition(touchLocation);\n//     sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n    // Check the touch position on the slider\n    checkSliderPosition(touchLocation);\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlHuePicker.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Stewart Hamilton-Arrandale.\n * http://creativewax.co.uk\n *\n * Modified by Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n\n#ifndef __CCCONTROL_HUE_PICKER_H__\n#define __CCCONTROL_HUE_PICKER_H__\n\n#include \"CCControl.h\"\n#include \"CCInvocation.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\nclass ControlHuePicker : public Control\n{\npublic:\n    static ControlHuePicker* create(Node* target, Point pos);\n    /**\n     * @js ctor\n     */\n    ControlHuePicker();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlHuePicker();\n    virtual bool initWithTargetAndPos(Node* target, Point pos);\n\n    virtual void setEnabled(bool enabled);\n\n    // overrides\n    virtual bool onTouchBegan(Touch* touch, Event* pEvent) override;\n    virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override;\n\nprotected:\n    void updateSliderPosition(Point location);\n    bool checkSliderPosition(Point location);\n\n    //maunally put in the setters\n    CC_SYNTHESIZE_READONLY(float, _hue, Hue);\n    virtual void setHue(float val);\n    CC_SYNTHESIZE_READONLY(float, _huePercentage, HuePercentage);\n    virtual void setHuePercentage(float val);\n\n    //not sure if these need to be there actually. I suppose someone might want to access the sprite?\n    CC_SYNTHESIZE_RETAIN(Sprite*, _background, Background);\n    CC_SYNTHESIZE_RETAIN(Sprite*, _slider, Slider);\n    CC_SYNTHESIZE_READONLY(Point, _startPos, StartPos);\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#include \"CCControlPotentiometer.h\"\n\nNS_CC_EXT_BEGIN\n\nControlPotentiometer::ControlPotentiometer()\n: _value(0.0f)\n, _minimumValue(0.0f)\n, _maximumValue(0.0f)\n, _thumbSprite(NULL)\n, _progressTimer(NULL)\n{\n\n}\n\nControlPotentiometer::~ControlPotentiometer()\n{\n    CC_SAFE_RELEASE(_thumbSprite);\n    CC_SAFE_RELEASE(_progressTimer);\n}\n\nControlPotentiometer* ControlPotentiometer::create(const char* backgroundFile, const char* progressFile, const char* thumbFile)\n{\n    ControlPotentiometer* pRet = new ControlPotentiometer();\n    if (pRet != NULL)\n    {\n        // Prepare track for potentiometer\n        Sprite *backgroundSprite      = Sprite::create(backgroundFile);\n\n        // Prepare thumb for potentiometer\n        Sprite *thumbSprite           = Sprite::create(thumbFile);\n\n        // Prepare progress for potentiometer\n        ProgressTimer *progressTimer  = ProgressTimer::create(Sprite::create(progressFile));\n        //progressTimer.type              = ProgressTimer::RADIALCW;\n        if (pRet->initWithTrackSprite_ProgressTimer_ThumbSprite(backgroundSprite, progressTimer, thumbSprite))\n        {\n            pRet->autorelease();\n        }\n        else\n        {\n            CC_SAFE_DELETE(pRet);\n        }\n    }\n    return pRet;\n}\n\nbool ControlPotentiometer::initWithTrackSprite_ProgressTimer_ThumbSprite(Sprite* trackSprite, ProgressTimer* progressTimer, Sprite* thumbSprite)\n{\n    if (Control::init())\n    {\n        setProgressTimer(progressTimer);\n        setThumbSprite(thumbSprite);\n        thumbSprite->setPosition(progressTimer->getPosition());\n        \n        addChild(thumbSprite, 2);\n        addChild(progressTimer, 1);\n        addChild(trackSprite);\n        \n        setContentSize(trackSprite->getContentSize());\n        \n        // Init default values\n        _minimumValue           = 0.0f;\n        _maximumValue           = 1.0f;\n        setValue(_minimumValue);\n        return true;\n    }\n    return false;\n}\n\nvoid ControlPotentiometer::setEnabled(bool enabled)\n{\n    Control::setEnabled(enabled);\n    if (_thumbSprite != NULL)\n    {\n        _thumbSprite->setOpacity((enabled) ? 255 : 128);\n    }\n}\n\nvoid ControlPotentiometer::setValue(float value)\n{\n    // set new value with sentinel\n    if (value < _minimumValue)\n    {\n        value                   = _minimumValue;\n    }\n\t\n    if (value > _maximumValue) \n    {\n        value                   = _maximumValue;\n    }\n    \n    _value                      = value;\n    \n    // Update thumb and progress position for new value\n    float percent               = (value - _minimumValue) / (_maximumValue - _minimumValue);\n    _progressTimer->setPercentage(percent * 100.0f);\n    _thumbSprite->setRotation(percent * 360.0f);\n    \n    sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);    \n}\n\nfloat ControlPotentiometer::getValue()\n{\n    return _value;\n}\n\nvoid ControlPotentiometer::setMinimumValue(float minimumValue)\n{\n    _minimumValue       = minimumValue;\n    \n    if (_minimumValue >= _maximumValue)\n    {\n        _maximumValue   = _minimumValue + 1.0f;\n    }\n    \n    setValue(_maximumValue);\n}\n\nfloat ControlPotentiometer::getMinimumValue()\n{\n    return _minimumValue;\n}\n\nvoid ControlPotentiometer::setMaximumValue(float maximumValue)\n{\n    _maximumValue       = maximumValue;\n    \n    if (_maximumValue <= _minimumValue)\n    {\n        _minimumValue   = _maximumValue - 1.0f;\n    }\n    \n    setValue(_minimumValue);\n}\n\nfloat ControlPotentiometer::getMaximumValue()\n{\n    return _maximumValue;\n}\n\nbool ControlPotentiometer::isTouchInside(Touch * touch)\n{\n    Point touchLocation   = this->getTouchLocation(touch);\n    \n    float distance          = this->distanceBetweenPointAndPoint(_progressTimer->getPosition(), touchLocation);\n\n    return distance < MIN(getContentSize().width / 2, getContentSize().height / 2);\n}\n\nbool ControlPotentiometer::onTouchBegan(Touch *pTouch, Event *pEvent)\n{\n    if (!this->isTouchInside(pTouch) || !this->isEnabled() || !isVisible())\n    {\n        return false;\n    }\n    \n    _previousLocation    = this->getTouchLocation(pTouch);\n    \n    this->potentiometerBegan(_previousLocation);\n    \n    return true;\n}\n\nvoid ControlPotentiometer::onTouchMoved(Touch *pTouch, Event *pEvent)\n{\n    Point location    = this->getTouchLocation(pTouch);\n\n    this->potentiometerMoved(location);\n}\n\nvoid ControlPotentiometer::onTouchEnded(Touch *pTouch, Event *pEvent)\n{\n    this->potentiometerEnded(Point::ZERO);\n}\n\nfloat ControlPotentiometer::distanceBetweenPointAndPoint(Point point1, Point point2)\n{\n    float dx = point1.x - point2.x;\n    float dy = point1.y - point2.y;\n    return sqrt(dx*dx + dy*dy);\n}\n\nfloat ControlPotentiometer::angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(\n    Point beginLineA, \n    Point endLineA,\n    Point beginLineB,\n    Point endLineB)\n{\n    float a = endLineA.x - beginLineA.x;\n    float b = endLineA.y - beginLineA.y;\n    float c = endLineB.x - beginLineB.x;\n    float d = endLineB.y - beginLineB.y;\n    \n    float atanA = atan2(a, b);\n    float atanB = atan2(c, d);\n    \n    // convert radiants to degrees\n    return (atanA - atanB) * 180 / M_PI;\n}\n\nvoid ControlPotentiometer::potentiometerBegan(Point location)\n{\n    setSelected(true);\n    getThumbSprite()->setColor(Color3B::GRAY);\n}\n\nvoid ControlPotentiometer::potentiometerMoved(Point location)\n{\n    float angle       = this->angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(\n        _progressTimer->getPosition(),\n        location,\n        _progressTimer->getPosition(),\n        _previousLocation);\n    \n    // fix value, if the 12 o'clock position is between location and previousLocation\n    if (angle > 180)\n    {\n        angle -= 360;\n    }\n    else if (angle < -180)\n    {\n        angle += 360;\n    }\n\n    setValue(_value + angle / 360.0f * (_maximumValue - _minimumValue));\n    \n    _previousLocation    = location;\n}\n\nvoid ControlPotentiometer::potentiometerEnded(Point location)\n{\n    getThumbSprite()->setColor(Color3B::WHITE);\n    setSelected(false);\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlPotentiometer.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n#ifndef __CCCONTROLPOTENTIOMETER_H__\n#define __CCCONTROLPOTENTIOMETER_H__\n\n#include \"CCControl.h\"\n#include \"CCProgressTimer.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\n/** @class ControlPotentiometer Potentiometer control for Cocos2D. */\nclass ControlPotentiometer : public Control\n{\npublic:\n    /**\n     * Creates potentiometer with a track filename and a progress filename.\n     */\n    static ControlPotentiometer* create(const char* backgroundFile, const char* progressFile, const char* thumbFile);\n    /**\n     * @js ctor\n     */\n    ControlPotentiometer();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlPotentiometer();\n\n    /** \n     * Initializes a potentiometer with a track sprite and a progress bar.\n     *\n     * @param trackSprite   Sprite, that is used as a background.\n     * @param progressTimer ProgressTimer, that is used as a progress bar.\n     */\n    bool initWithTrackSprite_ProgressTimer_ThumbSprite(Sprite* trackSprite, ProgressTimer* progressTimer, Sprite* thumbSprite);\n\n    void setValue(float value);\n    float getValue();\n     \n    void setMinimumValue(float minimumValue);\n    float getMinimumValue();\n\n    void setMaximumValue(float maximumValue);\n    float getMaximumValue();\n\n    // Overrides\n    virtual bool isTouchInside(Touch * touch) override;\n    void setEnabled(bool enabled) override;\n    virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override;\n\n    /** Factorize the event dispath into these methods. */\n    void potentiometerBegan(Point location);\n    void potentiometerMoved(Point location);\n    void potentiometerEnded(Point location);\n\n    /** Returns the distance between the point1 and point2. */\n    float distanceBetweenPointAndPoint(Point point1, Point point2);\n    /** Returns the angle in degree between line1 and line2. */\n    float angleInDegreesBetweenLineFromPoint_toPoint_toLineFromPoint_toPoint(\n        Point beginLineA, \n        Point endLineA,\n        Point beginLineB,\n        Point endLineB);\n\nprotected:\n    /** Contains the receiver’s current value. */\n    float           _value;\n    /** Contains the minimum value of the receiver.\n     * The default value of this property is 0.0. */\n    float           _minimumValue;\n    /** Contains the maximum value of the receiver.\n     * The default value of this property is 1.0. */\n    float           _maximumValue;\n\n    CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite)\n    CC_SYNTHESIZE_RETAIN(ProgressTimer*, _progressTimer, ProgressTimer)\n    CC_SYNTHESIZE(Point, _previousLocation, PreviousLocation)\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif /* __CCCONTROLPOTENTIOMETER_H__ */\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Stewart Hamilton-Arrandale.\n * http://creativewax.co.uk\n *\n * Modified by Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n#include \"CCControlSaturationBrightnessPicker.h\"\n\nNS_CC_EXT_BEGIN\n\nControlSaturationBrightnessPicker::ControlSaturationBrightnessPicker()\n: _saturation(0.0f)\n, _brightness(0.0f)\n, _background(NULL)\n, _overlay(NULL)\n, _shadow(NULL)\n, _slider(NULL)\n, boxPos(0)\n, boxSize(0)\n{\n\n}\n\nControlSaturationBrightnessPicker::~ControlSaturationBrightnessPicker()\n{\n    removeAllChildrenWithCleanup(true);\n\n    _background = NULL;\n    _overlay    = NULL;\n    _shadow     = NULL;\n    _slider     = NULL;\n}\n    \nbool ControlSaturationBrightnessPicker::initWithTargetAndPos(Node* target, Point pos)\n{\n    if (Control::init())\n    {\n        // Add background and slider sprites\n        _background=ControlUtils::addSpriteToTargetWithPosAndAnchor(\"colourPickerBackground.png\", target, pos, Point(0.0f, 0.0f));\n        _overlay=ControlUtils::addSpriteToTargetWithPosAndAnchor(\"colourPickerOverlay.png\", target, pos, Point(0.0f, 0.0f));\n        _shadow=ControlUtils::addSpriteToTargetWithPosAndAnchor(\"colourPickerShadow.png\", target, pos, Point(0.0f, 0.0f));\n        _slider=ControlUtils::addSpriteToTargetWithPosAndAnchor(\"colourPicker.png\", target, pos, Point(0.5f, 0.5f));\n                \n        _startPos=pos; // starting position of the colour picker        \n        boxPos          = 35;    // starting position of the virtual box area for picking a colour\n        boxSize         = _background->getContentSize().width / 2;;    // the size (width and height) of the virtual box for picking a colour from\n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\nControlSaturationBrightnessPicker* ControlSaturationBrightnessPicker::create(Node* target, Point pos)\n{\n    ControlSaturationBrightnessPicker *pRet = new ControlSaturationBrightnessPicker();\n    pRet->initWithTargetAndPos(target, pos);\n    pRet->autorelease();\n    return pRet;\n}\n\nvoid ControlSaturationBrightnessPicker::setEnabled(bool enabled)\n{\n    Control::setEnabled(enabled);\n    if (_slider != NULL)\n    {\n        _slider->setOpacity(enabled ? 255 : 128);\n    }\n}\n\nvoid ControlSaturationBrightnessPicker::updateWithHSV(HSV hsv)\n{\n    HSV hsvTemp;\n    hsvTemp.s = 1;\n    hsvTemp.h = hsv.h;\n    hsvTemp.v = 1;\n    \n    RGBA rgb = ControlUtils::RGBfromHSV(hsvTemp);\n    _background->setColor(Color3B((GLubyte)(rgb.r * 255.0f), (GLubyte)(rgb.g * 255.0f), (GLubyte)(rgb.b * 255.0f)));\n}\n\nvoid ControlSaturationBrightnessPicker::updateDraggerWithHSV(HSV hsv)\n{\n    // Set the position of the slider to the correct saturation and brightness\n    Point pos = Point(_startPos.x + boxPos + (boxSize*(1 - hsv.s)),\n                              _startPos.y + boxPos + (boxSize*hsv.v));\n    \n    // update\n    updateSliderPosition(pos);\n}\n\nvoid ControlSaturationBrightnessPicker::updateSliderPosition(Point sliderPosition)\n{\n    // Clamp the position of the icon within the circle\n    \n    // Get the center point of the bkgd image\n    float centerX           = _startPos.x + _background->getBoundingBox().size.width*0.5f;\n    float centerY           = _startPos.y + _background->getBoundingBox().size.height*0.5f;\n    \n    // Work out the distance difference between the location and center\n    float dx                = sliderPosition.x - centerX;\n    float dy                = sliderPosition.y - centerY;\n    float dist              = sqrtf(dx * dx + dy * dy);\n    \n    // Update angle by using the direction of the location\n    float angle             = atan2f(dy, dx);\n    \n    // Set the limit to the slider movement within the colour picker\n    float limit             = _background->getBoundingBox().size.width*0.5f;\n    \n    // Check distance doesn't exceed the bounds of the circle\n    if (dist > limit)\n    {\n        sliderPosition.x    = centerX + limit * cosf(angle);\n        sliderPosition.y    = centerY + limit * sinf(angle);\n    }\n    \n    // Set the position of the dragger\n    _slider->setPosition(sliderPosition);\n    \n    \n    // Clamp the position within the virtual box for colour selection\n    if (sliderPosition.x < _startPos.x + boxPos)                        sliderPosition.x = _startPos.x + boxPos;\n    else if (sliderPosition.x > _startPos.x + boxPos + boxSize - 1)    sliderPosition.x = _startPos.x + boxPos + boxSize - 1;\n    if (sliderPosition.y < _startPos.y + boxPos)                        sliderPosition.y = _startPos.y + boxPos;\n    else if (sliderPosition.y > _startPos.y + boxPos + boxSize)        sliderPosition.y = _startPos.y + boxPos + boxSize;\n    \n    // Use the position / slider width to determin the percentage the dragger is at\n    _saturation = 1.0f - fabs((_startPos.x + (float)boxPos - sliderPosition.x)/(float)boxSize);\n    _brightness = fabs((_startPos.y + (float)boxPos - sliderPosition.y)/(float)boxSize);\n}\n\nbool ControlSaturationBrightnessPicker::checkSliderPosition(Point location)\n{\n    // Clamp the position of the icon within the circle\n    \n    // get the center point of the bkgd image\n    float centerX           = _startPos.x + _background->getBoundingBox().size.width*0.5f;\n    float centerY           = _startPos.y + _background->getBoundingBox().size.height*0.5f;\n    \n    // work out the distance difference between the location and center\n    float dx                = location.x - centerX;\n    float dy                = location.y - centerY;\n    float dist              = sqrtf(dx*dx+dy*dy);\n    \n    // check that the touch location is within the bounding rectangle before sending updates\n    if (dist <= _background->getBoundingBox().size.width*0.5f)\n    {\n        updateSliderPosition(location);\n        sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n        return true;\n    }\n    return false;\n}\n\n\nbool ControlSaturationBrightnessPicker::onTouchBegan(Touch* touch, Event* event)\n{\n    if (!isEnabled() || !isVisible())\n    {\n        return false;\n    }\n    \n    // Get the touch location\n    Point touchLocation=getTouchLocation(touch);\n\n    // Check the touch position on the slider\n    return checkSliderPosition(touchLocation);\n}\n\n\nvoid ControlSaturationBrightnessPicker::onTouchMoved(Touch* touch, Event* event)\n{\n    // Get the touch location\n    Point touchLocation=getTouchLocation(touch);\n\n    //small modification: this allows changing of the colour, even if the touch leaves the bounding area\n//     updateSliderPosition(touchLocation);\n//     sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n    // Check the touch position on the slider\n    checkSliderPosition(touchLocation);\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Stewart Hamilton-Arrandale.\n * http://creativewax.co.uk\n *\n * Modified by Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n\n#ifndef __CCCONTROL_SATURATION_PICKER_H__\n#define __CCCONTROL_SATURATION_PICKER_H__\n\n#include \"CCControl.h\"\n#include \"CCInvocation.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\nclass ControlSaturationBrightnessPicker : public Control\n{\n    /** Contains the receiver's current saturation value. */\n    CC_SYNTHESIZE_READONLY(float, _saturation, Saturation);\n    /** Contains the receiver's current brightness value. */\n    CC_SYNTHESIZE_READONLY(float, _brightness, Brightness);\n\n    //not sure if these need to be there actually. I suppose someone might want to access the sprite?\n    CC_SYNTHESIZE_READONLY(Sprite*, _background, Background);\n    CC_SYNTHESIZE_READONLY(Sprite*, _overlay, Overlay);\n    CC_SYNTHESIZE_READONLY(Sprite*, _shadow, Shadow);\n    CC_SYNTHESIZE_READONLY(Sprite*, _slider, Slider);\n    CC_SYNTHESIZE_READONLY(Point, _startPos, StartPos);\n\nprotected:\n    int         boxPos;\n    int         boxSize;\n    \npublic:\n    /**\n     * @js ctor\n     */\n    ControlSaturationBrightnessPicker();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlSaturationBrightnessPicker();\n    virtual bool initWithTargetAndPos(Node* target, Point pos);\n\n    static ControlSaturationBrightnessPicker* create(Node* target, Point pos);\n\n    virtual void setEnabled(bool enabled);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void updateWithHSV(HSV hsv);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void updateDraggerWithHSV(HSV hsv);\n\nprotected:    \n    void updateSliderPosition(Point location);\n    bool checkSliderPosition(Point location);\n\n    virtual bool onTouchBegan(Touch* touch, Event* pEvent);\n    virtual void onTouchMoved(Touch *pTouch, Event *pEvent);\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlSlider.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2011 Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n*\n */\n\n#include \"CCControlSlider.h\"\n#include \"CCTouch.h\"\n#include \"CCDirector.h\"\n\nNS_CC_EXT_BEGIN\n\nControlSlider::ControlSlider()\n: _value(0.0f)\n, _minimumValue(0.0f)\n, _maximumValue(0.0f)\n, _minimumAllowedValue(0.0f)\n, _maximumAllowedValue(0.0f)\n, _thumbSprite(NULL)\n, _selectedThumbSprite(NULL)\n, _progressSprite(NULL)\n, _backgroundSprite(NULL)\n{\n\n}\n\nControlSlider::~ControlSlider()\n{\n    CC_SAFE_RELEASE(_thumbSprite);\n    CC_SAFE_RELEASE(_selectedThumbSprite);\n    CC_SAFE_RELEASE(_progressSprite);\n    CC_SAFE_RELEASE(_backgroundSprite);\n}\n\nControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile)\n{\n    // Prepare background for slider\n    Sprite *backgroundSprite      = Sprite::create(bgFile);\n\n    // Prepare progress for slider\n    Sprite *progressSprite        = Sprite::create(progressFile);\n\n    // Prepare thumb (menuItem) for slider\n    Sprite *thumbSprite           = Sprite::create(thumbFile);\n\n    return ControlSlider::create(backgroundSprite, progressSprite, thumbSprite);\n}\n\nControlSlider* ControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile,\n\t\tconst char* selectedThumbSpriteFile)\n{\n    // Prepare background for slider\n    Sprite *backgroundSprite      = Sprite::create(bgFile);\n    \n    // Prepare progress for slider\n    Sprite *progressSprite        = Sprite::create(progressFile);\n    \n    // Prepare thumb (menuItem) for slider\n    Sprite *thumbSprite           = Sprite::create(thumbFile);\n    \n    // Prepare selected thumb (menuItem) for slider\n    Sprite *selectedThumbSprite   = Sprite::create(selectedThumbSpriteFile);\n\n    return ControlSlider::create(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite);\n}\n\nControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite)\n{\n    ControlSlider *pRet = new ControlSlider();\n    pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite);\n    pRet->autorelease();\n    return pRet;\n}\n\nControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite,\n        Sprite* selectedThumbSprite)\n{\n    ControlSlider *pRet = new ControlSlider();\n    pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite, selectedThumbSprite);\n    pRet->autorelease();\n    return pRet;\n}\n\nbool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite)\n{\n    Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(),\n        thumbSprite->getTextureRect());\n    selectedThumbSprite->setColor(Color3B::GRAY);\n    return this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite);\n}\n\n bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite,\n        Sprite* selectedThumbSprite)\n {\n     if (Control::init())\n     {\n        CCASSERT(backgroundSprite,      \"Background sprite must be not nil\");\n        CCASSERT(progressSprite,        \"Progress sprite must be not nil\");\n        CCASSERT(thumbSprite,           \"Thumb sprite must be not nil\");\n        CCASSERT(selectedThumbSprite,   \"Thumb sprite must be not nil\");\n\n        ignoreAnchorPointForPosition(false);\n\n        this->setBackgroundSprite(backgroundSprite);\n        this->setProgressSprite(progressSprite);\n        this->setThumbSprite(thumbSprite);\n        this->setSelectedThumbSprite(selectedThumbSprite);\n\n        // Defines the content size\n        Rect maxRect   = ControlUtils::RectUnion(backgroundSprite->getBoundingBox(), thumbSprite->getBoundingBox());\n\n        setContentSize(Size(maxRect.size.width, maxRect.size.height));\n        \n        // Add the slider background\n        _backgroundSprite->setAnchorPoint(Point(0.5f, 0.5f));\n        _backgroundSprite->setPosition(Point(this->getContentSize().width / 2, this->getContentSize().height / 2));\n        addChild(_backgroundSprite);\n\n        // Add the progress bar\n        _progressSprite->setAnchorPoint(Point(0.0f, 0.5f));\n        _progressSprite->setPosition(Point(0.0f, this->getContentSize().height / 2));\n        addChild(_progressSprite);\n\n        // Add the slider thumb  \n        _thumbSprite->setPosition(Point(0.0f, this->getContentSize().height / 2));\n        addChild(_thumbSprite);\n        \n        _selectedThumbSprite->setPosition(Point(0.0f, this->getContentSize().height / 2));\n        _selectedThumbSprite->setVisible(false);\n        addChild(_selectedThumbSprite);\n\n        // Init default values\n        _minimumValue                   = 0.0f;\n        _maximumValue                   = 1.0f;\n\n        setValue(_minimumValue);\n        return true;\n     }\n     else\n     {\n         return false;\n     }\n }\n\n\nvoid ControlSlider::setEnabled(bool enabled)\n{\n    Control::setEnabled(enabled);\n    if (_thumbSprite != NULL) \n    {\n        _thumbSprite->setOpacity((enabled) ? 255 : 128);\n    }\n}\n\n void ControlSlider::setValue(float value)\n {\n     // set new value with sentinel\n     if (value < _minimumValue)\n     {\n         value = _minimumValue;\n     }\n\n     if (value > _maximumValue) \n     {\n         value = _maximumValue;\n     }\n\n     _value = value;\n\n     this->needsLayout();\n\n     this->sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n }\n\n void ControlSlider::setMinimumValue(float minimumValue)\n {\n     _minimumValue=minimumValue;\n     _minimumAllowedValue = minimumValue;\n     if (_minimumValue >= _maximumValue)    \n     {\n        _maximumValue   = _minimumValue + 1.0f;\n     }\n     setValue(_value);\n }\n\n void ControlSlider::setMaximumValue(float maximumValue)\n {\n     _maximumValue=maximumValue;\n     _maximumAllowedValue = maximumValue;\n     if (_maximumValue <= _minimumValue)   \n     {\n        _minimumValue   = _maximumValue - 1.0f;\n     }\n     setValue(_value);\n }\n\nbool ControlSlider::isTouchInside(Touch * touch)\n{\n  Point touchLocation   = touch->getLocation();\n  touchLocation           = this->getParent()->convertToNodeSpace(touchLocation);\n\n  Rect rect             = this->getBoundingBox();\n  rect.size.width         += _thumbSprite->getContentSize().width;\n  rect.origin.x           -= _thumbSprite->getContentSize().width / 2;\n\n  return rect.containsPoint(touchLocation);\n}\n\nPoint ControlSlider::locationFromTouch(Touch* touch)\n{\n  Point touchLocation   = touch->getLocation();                      // Get the touch position\n  touchLocation           = this->convertToNodeSpace(touchLocation);                  // Convert to the node space of this class\n\n  if (touchLocation.x < 0)\n  {\n      touchLocation.x     = 0;\n  } else if (touchLocation.x > _backgroundSprite->getContentSize().width)\n  {\n      touchLocation.x     = _backgroundSprite->getContentSize().width;\n  }\n\n  return touchLocation;\n}\n\n\nbool ControlSlider::onTouchBegan(Touch* touch, Event* pEvent)\n{\n    if (!isTouchInside(touch) || !isEnabled() || !isVisible())\n    {\n        return false;\n    }\n\n    Point location = locationFromTouch(touch);\n    sliderBegan(location);\n    return true;\n}\n\nvoid ControlSlider::onTouchMoved(Touch *pTouch, Event *pEvent)\n{\n    Point location = locationFromTouch(pTouch);\n    sliderMoved(location);\n}\n\nvoid ControlSlider::onTouchEnded(Touch *pTouch, Event *pEvent)\n{\n    sliderEnded(Point::ZERO);\n}\n\nvoid ControlSlider::needsLayout()\n{\n    if (NULL == _thumbSprite || NULL == _selectedThumbSprite || NULL == _backgroundSprite\n    \t\t|| NULL == _progressSprite)\n    {\n        return;\n    }\n    // Update thumb position for new value\n    float percent               = (_value - _minimumValue) / (_maximumValue - _minimumValue);\n\n    Point pos                 = _thumbSprite->getPosition();\n    pos.x                       = percent * _backgroundSprite->getContentSize().width;\n    _thumbSprite->setPosition(pos);\n    _selectedThumbSprite->setPosition(pos);\n\n    // Stretches content proportional to newLevel\n    Rect textureRect          = _progressSprite->getTextureRect();\n    textureRect                 = Rect(textureRect.origin.x, textureRect.origin.y, pos.x, textureRect.size.height);\n    _progressSprite->setTextureRect(textureRect, _progressSprite->isTextureRectRotated(), textureRect.size);\n}\n\nvoid ControlSlider::sliderBegan(Point location)\n{\n    this->setSelected(true);\n    _thumbSprite->setVisible(false);\n    _selectedThumbSprite->setVisible(true);\n    setValue(valueForLocation(location));\n}\n\nvoid ControlSlider::sliderMoved(Point location)\n{\n    setValue(valueForLocation(location));\n}\n\nvoid ControlSlider::sliderEnded(Point location)\n{\n    if (this->isSelected())\n    {\n        setValue(valueForLocation(_thumbSprite->getPosition()));\n    }\n    _thumbSprite->setVisible(true);\n    _selectedThumbSprite->setVisible(false);\n    this->setSelected(false);\n}\n\nfloat ControlSlider::valueForLocation(Point location)\n{\n    float percent = location.x/ _backgroundSprite->getContentSize().width;\n    return MAX(MIN(_minimumValue + percent * (_maximumValue - _minimumValue), _maximumAllowedValue), _minimumAllowedValue);\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlSlider.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2011 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n\n#ifndef __CCCONTROL_SLIDER_H__\n#define __CCCONTROL_SLIDER_H__\n\n#include \"CCControl.h\"\n#include \"CCInvocation.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\nclass ControlSlider: public Control\n{\npublic:\n    /**\n     * Creates slider with a background filename, a progress filename and a\n     * thumb image filename.\n     */\n    static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile);\n\n    /**\n     * Creates a slider with a given background sprite and a progress bar and a\n     * thumb item.\n     *\n     * @see initWithSprites\n     */\n    static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite);\n\n    /**\n     * Creates slider with a background filename, a progress filename, a thumb\n     * and a selected thumb image filename.\n     */\n    static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile,\n            const char* selectedThumbSpriteFile);\n\n    /**\n     * Creates a slider with a given background sprite and a progress bar, a thumb\n     * and a selected thumb .\n     *\n     * @see initWithSprites\n     */\n    static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite,\n            Sprite* selectedThumbSprite);\n    /**\n     * @js ctor\n     */\n    ControlSlider();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlSlider();\n\n    /**\n    * Initializes a slider with a background sprite, a progress bar and a thumb\n    * item.\n    *\n    * @param backgroundSprite          Sprite, that is used as a background.\n    * @param progressSprite            Sprite, that is used as a progress bar.\n    * @param thumbSprite               Sprite, that is used as a thumb.\n    */\n    virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite);\n\n    /** \n    * Initializes a slider with a background sprite, a progress bar and a thumb\n    * item.\n    *\n    * @param backgroundSprite          Sprite, that is used as a background.\n    * @param progressSprite            Sprite, that is used as a progress bar.\n    * @param thumbSprite               Sprite, that is used as a thumb.\n    * @param selectedThumbSprite       Sprite, that is used as a selected thumb.\n    */\n    virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite,\n            Sprite* selectedThumbSprite);\n\n    virtual void needsLayout();\n\n    virtual void setMaximumValue(float val);\n    virtual void setEnabled(bool enabled);\n    virtual bool isTouchInside(Touch * touch);\n    Point locationFromTouch(Touch* touch);\n    virtual void setValue(float val);\n    virtual void setMinimumValue(float val);\n\nprotected:\n    void sliderBegan(Point location);\n    void sliderMoved(Point location);\n    void sliderEnded(Point location);\n\n    virtual bool onTouchBegan(Touch* touch, Event* pEvent);\n    virtual void onTouchMoved(Touch *pTouch, Event *pEvent);\n    virtual void onTouchEnded(Touch *pTouch, Event *pEvent);\n\n    /** Returns the value for the given location. */\n    float valueForLocation(Point location);\n\n    //maunally put in the setters\n    /** Contains the receiver's current value. */\n    CC_SYNTHESIZE_READONLY(float, _value, Value);\n\n    /** Contains the minimum value of the receiver.\n     * The default value of this property is 0.0. */\n    CC_SYNTHESIZE_READONLY(float, _minimumValue, MinimumValue);\n\n    /** Contains the maximum value of the receiver.\n     * The default value of this property is 1.0. */\n    CC_SYNTHESIZE_READONLY(float, _maximumValue, MaximumValue);\n\n    CC_SYNTHESIZE(float, _minimumAllowedValue, MinimumAllowedValue);\n    CC_SYNTHESIZE(float, _maximumAllowedValue, MaximumAllowedValue);\n\n    // maybe this should be read-only\n    CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite);\n    CC_SYNTHESIZE_RETAIN(Sprite*, _selectedThumbSprite, SelectedThumbSprite);\n    CC_SYNTHESIZE_RETAIN(Sprite*, _progressSprite, ProgressSprite);\n    CC_SYNTHESIZE_RETAIN(Sprite*, _backgroundSprite, BackgroundSprite);\n\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlStepper.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT falseT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND falseNINFRINGEMENT. IN false EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#include \"CCControlStepper.h\"\n\nNS_CC_EXT_BEGIN\n\n#define ControlStepperLabelColorEnabled   Color3B(55, 55, 55)\n#define ControlStepperLabelColorDisabled  Color3B(147, 147, 147)\n\n#define ControlStepperLabelFont           \"CourierNewPSMT\"\n\n\n#define kAutorepeatDeltaTime                0.15f\n#define kAutorepeatIncreaseTimeIncrement    12\n\nControlStepper::ControlStepper()\n: _value(0.0)\n, _continuous(false)\n, _autorepeat(false)\n, _wraps(false)\n, _minimumValue(0.0)\n, _maximumValue(0.0)\n, _stepValue(0.0)\n, _touchInsideFlag(false)\n, _touchedPart(Part::NONE)\n, _autorepeatCount(0)\n, _minusSprite(NULL)\n, _plusSprite(NULL)\n, _minusLabel(NULL)\n, _plusLabel(NULL)\n{\n\n}\n\nControlStepper::~ControlStepper()\n{\n    unscheduleAllSelectors();\n    \n    CC_SAFE_RELEASE(_minusSprite);\n    CC_SAFE_RELEASE(_plusSprite);\n    CC_SAFE_RELEASE(_minusLabel);\n    CC_SAFE_RELEASE(_plusLabel);\n}\n\nbool ControlStepper::initWithMinusSpriteAndPlusSprite(Sprite *minusSprite, Sprite *plusSprite)\n{\n    if (Control::init())\n    {\n        CCASSERT(minusSprite,   \"Minus sprite must be not nil\");\n        CCASSERT(plusSprite,    \"Plus sprite must be not nil\");\n        \n        // Set the default values\n        _autorepeat                         = true;\n        _continuous                         = true;\n        _minimumValue                       = 0;\n        _maximumValue                       = 100;\n        _value                              = 0;\n        _stepValue                          = 1;\n        _wraps                              = false;\n        this->ignoreAnchorPointForPosition( false );\n    \n        // Add the minus components\n        this->setMinusSprite(minusSprite);\n\t\t_minusSprite->setPosition( Point(minusSprite->getContentSize().width / 2, minusSprite->getContentSize().height / 2) );\n\t\tthis->addChild(_minusSprite);\n        \n        this->setMinusLabel( LabelTTF::create(\"-\", ControlStepperLabelFont, 40));\n        _minusLabel->setColor(ControlStepperLabelColorDisabled);\n        _minusLabel->setPosition(Point(_minusSprite->getContentSize().width / 2, _minusSprite->getContentSize().height / 2) );\n        _minusSprite->addChild(_minusLabel);\n        \n        // Add the plus components \n        this->setPlusSprite( plusSprite );\n\t\t_plusSprite->setPosition( Point(minusSprite->getContentSize().width + plusSprite->getContentSize().width / 2, \n                                                  minusSprite->getContentSize().height / 2) );\n\t\tthis->addChild(_plusSprite);\n        \n        this->setPlusLabel( LabelTTF::create(\"+\", ControlStepperLabelFont, 40 ));\n        _plusLabel->setColor( ControlStepperLabelColorEnabled );\n        _plusLabel->setPosition( Point(_plusSprite->getContentSize().width / 2, _plusSprite->getContentSize().height / 2) );\n        _plusSprite->addChild(_plusLabel);\n        \n        // Defines the content size\n        Rect maxRect = ControlUtils::RectUnion(_minusSprite->getBoundingBox(), _plusSprite->getBoundingBox());\n        this->setContentSize( Size(_minusSprite->getContentSize().width + _plusSprite->getContentSize().height, maxRect.size.height) );\n        return true;\n    }\n    return false;\n}\n\nControlStepper* ControlStepper::create(Sprite *minusSprite, Sprite *plusSprite)\n{\n    ControlStepper* pRet = new ControlStepper();\n    if (pRet != NULL && pRet->initWithMinusSpriteAndPlusSprite(minusSprite, plusSprite))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    return pRet;\n}\n\n//#pragma mark Properties\n\nvoid ControlStepper::setWraps(bool wraps)\n{\n    _wraps = wraps;\n    \n    if (_wraps)\n    {\n        _minusLabel->setColor( ControlStepperLabelColorEnabled );\n        _plusLabel->setColor(ControlStepperLabelColorEnabled );\n    }\n    \n    this->setValue( _value );\n}\n\nvoid ControlStepper::setMinimumValue(double minimumValue)\n{\n    if (minimumValue >= _maximumValue)\n    {\n        CCASSERT(0, \"Must be numerically less than maximumValue.\");\n    }\n    \n    _minimumValue   = minimumValue;\n    this->setValue( _value );\n}\n\nvoid ControlStepper::setMaximumValue(double maximumValue)\n{\n    if (maximumValue <= _minimumValue)\n    {\n        CCASSERT(0, \"Must be numerically greater than minimumValue.\");\n    }\n    \n    _maximumValue   = maximumValue;\n    this->setValue(_value);\n}\n\nvoid ControlStepper::setValue(double value)\n{\n    this->setValueWithSendingEvent(value, true);\n}\n\ndouble ControlStepper::getValue() const\n{\n    return _value;\n}\n\nvoid ControlStepper::setStepValue(double stepValue)\n{\n    if (stepValue <= 0)\n    {\n        CCASSERT(0,\"Must be numerically greater than 0.\");\n    }\n\n    _stepValue  = stepValue;\n}\n\nbool ControlStepper::isContinuous() const\n{\n    return _continuous;\n}\n//#pragma mark -\n//#pragma mark ControlStepper Public Methods\n\nvoid ControlStepper::setValueWithSendingEvent(double value, bool send)\n{\n    if (value < _minimumValue)\n    {\n        value = _wraps ? _maximumValue : _minimumValue;\n    } else if (value > _maximumValue)\n    {\n        value = _wraps ? _minimumValue : _maximumValue;\n    }\n    \n    _value = value;\n    \n    if (!_wraps)\n    {\n        _minusLabel->setColor((value == _minimumValue) ? ControlStepperLabelColorDisabled : ControlStepperLabelColorEnabled);\n        _plusLabel->setColor((value == _maximumValue) ? ControlStepperLabelColorDisabled : ControlStepperLabelColorEnabled);\n    }\n    \n    if (send)\n    {\n        this->sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n    }\n}\n\nvoid ControlStepper::startAutorepeat()\n{\n    _autorepeatCount    = -1;\n    \n    this->schedule(schedule_selector(ControlStepper::update), kAutorepeatDeltaTime, kRepeatForever, kAutorepeatDeltaTime * 3);\n}\n\n/** Stop the autorepeat. */\nvoid ControlStepper::stopAutorepeat()\n{\n    this->unschedule(schedule_selector(ControlStepper::update));\n}\n\nvoid ControlStepper::update(float dt)\n{\n    _autorepeatCount++;\n    \n    if ((_autorepeatCount < kAutorepeatIncreaseTimeIncrement) && (_autorepeatCount % 3) != 0)\n        return;\n    \n    if (_touchedPart == Part::MINUS)\n    {\n        this->setValueWithSendingEvent(_value - _stepValue, _continuous);\n    } else if (_touchedPart == Part::PLUS)\n    {\n        this->setValueWithSendingEvent(_value + _stepValue, _continuous);\n    }\n}\n\n//#pragma mark ControlStepper Private Methods\n\nvoid ControlStepper::updateLayoutUsingTouchLocation(Point location)\n{\n    if (location.x < _minusSprite->getContentSize().width\n        && _value > _minimumValue)\n    {\n        _touchedPart        = Part::MINUS;\n        \n        _minusSprite->setColor(Color3B::GRAY);\n        _plusSprite->setColor(Color3B::WHITE);\n    } else if (location.x >= _minusSprite->getContentSize().width\n               && _value < _maximumValue)\n    {\n        _touchedPart        = Part::PLUS;\n        \n        _minusSprite->setColor(Color3B::WHITE);\n        _plusSprite->setColor(Color3B::GRAY);\n    } else\n    {\n        _touchedPart        = Part::NONE;\n        \n        _minusSprite->setColor(Color3B::WHITE);\n        _plusSprite->setColor(Color3B::WHITE);\n    }\n}\n\n\nbool ControlStepper::onTouchBegan(Touch *pTouch, Event *pEvent)\n{\n    if (!isTouchInside(pTouch) || !isEnabled() || !isVisible())\n    {\n        return false;\n    }\n    \n    Point location    = this->getTouchLocation(pTouch);\n    this->updateLayoutUsingTouchLocation(location);\n    \n    _touchInsideFlag = true;\n    \n    if (_autorepeat)\n    {\n        this->startAutorepeat();\n    }\n    \n    return true;\n}\n\nvoid ControlStepper::onTouchMoved(Touch *pTouch, Event *pEvent)\n{\n    if (this->isTouchInside(pTouch))\n    {\n        Point location    = this->getTouchLocation(pTouch);\n        this->updateLayoutUsingTouchLocation(location);\n        \n        if (!_touchInsideFlag)\n        {\n            _touchInsideFlag    = true;\n            \n            if (_autorepeat)\n            {\n                this->startAutorepeat();\n            }\n        }\n    }\n    else\n    {\n        _touchInsideFlag    = false;\n        \n        _touchedPart        = Part::NONE;\n        \n        _minusSprite->setColor(Color3B::WHITE);\n        _plusSprite->setColor(Color3B::WHITE);\n        \n        if (_autorepeat)\n        {\n            this->stopAutorepeat();\n        }\n    }\n}\n\nvoid ControlStepper::onTouchEnded(Touch *pTouch, Event *pEvent)\n{\n    _minusSprite->setColor(Color3B::WHITE);\n    _plusSprite->setColor(Color3B::WHITE);\n    \n    if (_autorepeat)\n    {\n        this->stopAutorepeat();\n    }\n    \n    if (this->isTouchInside(pTouch))\n    {\n        Point location    = this->getTouchLocation(pTouch);\n        \n        this->setValue(_value + ((location.x < _minusSprite->getContentSize().width) ? (0.0-_stepValue) : _stepValue));\n    }\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlStepper.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#ifndef __CCCONTROLSTEPPER_H__\n#define __CCCONTROLSTEPPER_H__\n\n#include \"CCControl.h\"\n#include \"CCLabelTTF.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\nclass ControlStepper : public Control\n{\npublic:\n    enum class Part\n    {\n        MINUS,\n        PLUS,\n        NONE\n    };\n    \n    static ControlStepper* create(Sprite *minusSprite, Sprite *plusSprite);\n    /**\n     * @js ctor\n     */\n    ControlStepper();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlStepper();\n\n    bool initWithMinusSpriteAndPlusSprite(Sprite *minusSprite, Sprite *plusSprite);\n\n    virtual void setWraps(bool wraps);\n    virtual void setMinimumValue(double minimumValue);\n    virtual void setMaximumValue(double maximumValue);\n    virtual void setValue(double value);\n\n    virtual double getValue() const;\n    virtual void setStepValue(double stepValue);\n    /** Set the numeric value of the stepper. If send is true, the Control::EventType::VALUE_CHANGED is sent. */\n    virtual void setValueWithSendingEvent(double value, bool send);\n    virtual bool isContinuous() const;\n\n    // Overrides\n    virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override;\n    void update(float dt);\n\n    /** Update the layout of the stepper with the given touch location. */\n    void updateLayoutUsingTouchLocation(Point location);\n\n    /** Start the autorepeat increment/decrement. */\n    void startAutorepeat();\n\n    /** Stop the autorepeat. */\n    void stopAutorepeat();\n\nprotected:\n    /** The numeric value of the stepper. */\n    double                  _value;\n    /** The continuous vs. noncontinuous state of the stepper. */\n    bool                    _continuous;\n    /** The automatic vs. nonautomatic repeat state of the stepper. */\n    bool                    _autorepeat;\n    /** The wrap vs. no-wrap state of the stepper. */\n    bool                    _wraps;\n    /** The lowest possible numeric value for the stepper. */\n    double                  _minimumValue;\n    /** The highest possible numeric value for the stepper. */\n    double                  _maximumValue;\n    /** The step, or increment, value for the stepper. */\n    double                  _stepValue;\n    bool                    _touchInsideFlag;\n    Part                    _touchedPart;\n    int                     _autorepeatCount;\n\n    // Weak links to children\n\tCC_SYNTHESIZE_RETAIN(Sprite*, _minusSprite, MinusSprite)\n    CC_SYNTHESIZE_RETAIN(Sprite*, _plusSprite, PlusSprite)\n    CC_SYNTHESIZE_RETAIN(LabelTTF*, _minusLabel, MinusLabel)\n    CC_SYNTHESIZE_RETAIN(LabelTTF*, _plusLabel, PlusLabel)\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif /* __CCCONTROLSTEPPER_H__ */\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlSwitch.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#include \"CCControlSwitch.h\"\n#include \"CCSprite.h\"\n#include \"CCActionTween.h\"\n#include \"CCLabelTTF.h\"\n#include \"CCClippingNode.h\"\n#include \"ccShaders.h\"\n#include \"CCRenderTexture.h\"\n\nNS_CC_EXT_BEGIN\n// ControlSwitchSprite\n\nclass ControlSwitchSprite : public Sprite, public ActionTweenDelegate\n{\npublic:\n    /** creates an autorelease instance of ControlSwitchSprite */\n    static ControlSwitchSprite* create(\n                            Sprite *maskSprite,\n                            Sprite *onSprite,\n                            Sprite *offSprite,\n                            Sprite *thumbSprite,\n                            LabelTTF* onLabel,\n                            LabelTTF* offLabel);\n\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void needsLayout();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void setSliderXPosition(float sliderXPosition);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    float getSliderXPosition() {return _sliderXPosition;}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    float onSideWidth();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    float offSideWidth();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void updateTweenAction(float value, const std::string& key) override;\n\n/** Contains the position (in x-axis) of the slider inside the receiver. */\n    float _sliderXPosition;\n    CC_SYNTHESIZE(float, _onPosition, OnPosition)\n    CC_SYNTHESIZE(float, _offPosition, OffPosition)\n    \n    CC_SYNTHESIZE_RETAIN(Texture2D*, _maskTexture, MaskTexture)\n    CC_SYNTHESIZE(GLuint, _textureLocation, TextureLocation)\n    CC_SYNTHESIZE(GLuint, _maskLocation, MaskLocation)\n    \n    CC_SYNTHESIZE_RETAIN(Sprite*, _onSprite, OnSprite)\n    CC_SYNTHESIZE_RETAIN(Sprite*, _offSprite, OffSprite)\n    CC_SYNTHESIZE_RETAIN(Sprite*, _thumbSprite, ThumbSprite)\n    CC_SYNTHESIZE_RETAIN(LabelTTF*, _onLabel, OnLabel)\n    CC_SYNTHESIZE_RETAIN(LabelTTF*, _offLabel, OffLabel)\n    \n    Sprite* _clipperStencil;\n\nprotected:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ControlSwitchSprite();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlSwitchSprite();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    bool initWithMaskSprite(\n                            Sprite *maskSprite,\n                            Sprite *onSprite,\n                            Sprite *offSprite,\n                            Sprite *thumbSprite,\n                            LabelTTF* onLabel, \n                            LabelTTF* offLabel);\nprivate:\n    CC_DISALLOW_COPY_AND_ASSIGN(ControlSwitchSprite);\n};\n\nControlSwitchSprite* ControlSwitchSprite::create(Sprite *maskSprite,\n                                            Sprite *onSprite,\n                                            Sprite *offSprite,\n                                            Sprite *thumbSprite,\n                                            LabelTTF* onLabel,\n                                            LabelTTF* offLabel)\n{\n    auto ret = new ControlSwitchSprite();\n    ret->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, onLabel, offLabel);\n    ret->autorelease();\n    return ret;\n}\n\nControlSwitchSprite::ControlSwitchSprite()\n: _sliderXPosition(0.0f)\n, _onPosition(0.0f)\n, _offPosition(0.0f)\n, _maskTexture(NULL)\n, _textureLocation(0)\n, _maskLocation(0)\n, _onSprite(NULL)\n, _offSprite(NULL)\n, _thumbSprite(NULL)\n, _onLabel(NULL)\n, _offLabel(NULL)\n, _clipperStencil(nullptr)\n{\n\n}\n\nControlSwitchSprite::~ControlSwitchSprite()\n{\n    CC_SAFE_RELEASE(_onSprite);\n    CC_SAFE_RELEASE(_offSprite);\n    CC_SAFE_RELEASE(_thumbSprite);\n    CC_SAFE_RELEASE(_onLabel);\n    CC_SAFE_RELEASE(_offLabel);\n    CC_SAFE_RELEASE(_maskTexture);\n    CC_SAFE_RELEASE(_clipperStencil);\n}\n\nbool ControlSwitchSprite::initWithMaskSprite(\n    Sprite *maskSprite, \n    Sprite *onSprite, \n    Sprite *offSprite,\n    Sprite *thumbSprite,\n    LabelTTF* onLabel, \n    LabelTTF* offLabel)\n{\n    if (Sprite::initWithTexture(maskSprite->getTexture()))\n    {\n        // Sets the default values\n        _onPosition             = 0;\n        _offPosition            = -onSprite->getContentSize().width + thumbSprite->getContentSize().width / 2;\n        _sliderXPosition        = _onPosition; \n\n        setOnSprite(onSprite);\n        setOffSprite(offSprite);\n        setThumbSprite(thumbSprite);\n        setOnLabel(onLabel);\n        setOffLabel(offLabel);\n        //setOnSprite(nullptr);\n        //setOffSprite(nullptr);\n        //setOnLabel(nullptr);\n        //setOffLabel(nullptr);\n        ClippingNode* clipper = ClippingNode::create();\n        _clipperStencil = Sprite::createWithTexture(maskSprite->getTexture());\n        _clipperStencil->retain();\n        clipper->setAlphaThreshold(0.1f);\n        \n        clipper->setStencil(_clipperStencil);\n        \n        clipper->addChild(thumbSprite);\n        clipper->addChild(onSprite);\n        clipper->addChild(offSprite);\n        clipper->addChild(onLabel);\n        clipper->addChild(offLabel);\n        \n        addChild(clipper);\n\n        // Set up the mask with the Mask shader\n        setMaskTexture(maskSprite->getTexture());\n        GLProgram* pProgram = new GLProgram();\n        pProgram->initWithVertexShaderByteArray(ccPositionTextureColor_vert, ccExSwitchMask_frag);\n        setShaderProgram(pProgram);\n        pProgram->release();\n\n        CHECK_GL_ERROR_DEBUG();\n\n        getShaderProgram()->addAttribute(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION);\n        getShaderProgram()->addAttribute(GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR);\n        getShaderProgram()->addAttribute(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS);\n        CHECK_GL_ERROR_DEBUG();\n\n        getShaderProgram()->link();\n        CHECK_GL_ERROR_DEBUG();\n\n        getShaderProgram()->updateUniforms();\n        CHECK_GL_ERROR_DEBUG();                \n\n        _textureLocation    = glGetUniformLocation( getShaderProgram()->getProgram(), \"u_texture\");\n        _maskLocation       = glGetUniformLocation( getShaderProgram()->getProgram(), \"u_mask\");\n        CHECK_GL_ERROR_DEBUG();\n\n        setContentSize(_maskTexture->getContentSize());\n\n        needsLayout();\n        return true;\n    }\n    return false;\n}\n\nvoid ControlSwitchSprite::updateTweenAction(float value, const std::string& key)\n{\n    CCLOG(\"key = %s, value = %f\", key.c_str(), value);\n    setSliderXPosition(value);\n}\n\nvoid ControlSwitchSprite::needsLayout()\n{\n    _onSprite->setPosition(Point(_onSprite->getContentSize().width / 2 + _sliderXPosition,\n        _onSprite->getContentSize().height / 2));\n    _offSprite->setPosition(Point(_onSprite->getContentSize().width + _offSprite->getContentSize().width / 2 + _sliderXPosition, \n        _offSprite->getContentSize().height / 2));\n    _thumbSprite->setPosition(Point(_onSprite->getContentSize().width + _sliderXPosition,\n        _maskTexture->getContentSize().height / 2));\n\n    _clipperStencil->setPosition(Point(_maskTexture->getContentSize().width/2,\n                                    _maskTexture->getContentSize().height / 2));\n\n    if (_onLabel)\n    {\n        _onLabel->setPosition(Point(_onSprite->getPosition().x - _thumbSprite->getContentSize().width / 6,\n            _onSprite->getContentSize().height / 2));\n    }\n    if (_offLabel)\n    {\n        _offLabel->setPosition(Point(_offSprite->getPosition().x + _thumbSprite->getContentSize().width / 6,\n            _offSprite->getContentSize().height / 2));\n    }\n\n    RenderTexture *rt = RenderTexture::create((int)_maskTexture->getContentSize().width, (int)_maskTexture->getContentSize().height);\n\n    rt->begin();\n    _onSprite->visit();\n    _offSprite->visit();\n\n    if (_onLabel)\n    {\n        _onLabel->visit();\n    }\n    if (_offLabel)\n    {\n        _offLabel->visit();\n    }\n\n    rt->end();\n\n    setTexture(rt->getSprite()->getTexture());\n    setFlippedY(true);\n}\n\nvoid ControlSwitchSprite::setSliderXPosition(float sliderXPosition)\n{\n    if (sliderXPosition <= _offPosition)\n    {\n        // Off\n        sliderXPosition = _offPosition;\n    } else if (sliderXPosition >= _onPosition)\n    {\n        // On\n        sliderXPosition = _onPosition;\n    }\n\n    _sliderXPosition    = sliderXPosition;\n\n    needsLayout();\n}\n\n\nfloat ControlSwitchSprite::onSideWidth()\n{\n    return _onSprite->getContentSize().width;\n}\n\nfloat ControlSwitchSprite::offSideWidth()\n{\n    return _offSprite->getContentSize().height;\n}\n\n\n// ControlSwitch\n\nControlSwitch::ControlSwitch()\n: _switchSprite(NULL)\n, _initialTouchXPosition(0.0f)\n, _moved(false)\n, _on(false)\n{\n\n}\n\nControlSwitch::~ControlSwitch()\n{\n    CC_SAFE_RELEASE(_switchSprite);\n}\n\nbool ControlSwitch::initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite)\n{\n    return initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, NULL, NULL);\n}\n\nControlSwitch* ControlSwitch::create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite)\n{\n    ControlSwitch* pRet = new ControlSwitch();\n    if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, NULL, NULL))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    return pRet;\n}\n\nbool ControlSwitch::initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, LabelTTF* onLabel, LabelTTF* offLabel)\n{\n    if (Control::init())\n    {\n        CCASSERT(maskSprite,    \"Mask must not be nil.\");\n        CCASSERT(onSprite,      \"onSprite must not be nil.\");\n        CCASSERT(offSprite,     \"offSprite must not be nil.\");\n        CCASSERT(thumbSprite,   \"thumbSprite must not be nil.\");\n        \n        _on = true;\n\n        _switchSprite = ControlSwitchSprite::create(maskSprite,\n                                        onSprite,\n                                        offSprite,\n                                        thumbSprite,\n                                        onLabel,\n                                        offLabel);\n        _switchSprite->retain();\n        _switchSprite->setPosition(Point(_switchSprite->getContentSize().width / 2, _switchSprite->getContentSize().height / 2));\n        addChild(_switchSprite);\n        \n        ignoreAnchorPointForPosition(false);\n        setAnchorPoint(Point(0.5f, 0.5f));\n        setContentSize(_switchSprite->getContentSize());\n        return true;\n    }\n    return false;\n}\n\nControlSwitch* ControlSwitch::create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, LabelTTF* onLabel, LabelTTF* offLabel)\n{\n    ControlSwitch* pRet = new ControlSwitch();\n    if (pRet && pRet->initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, onLabel, offLabel))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    return pRet;\n}\n\nvoid ControlSwitch::setOn(bool isOn)\n{\n    setOn(isOn, false);\n}\n\nvoid ControlSwitch::setOn(bool isOn, bool animated)\n{\n    _on     = isOn;\n    \n    if (animated) {\n        _switchSprite->runAction\n        (\n            ActionTween::create\n                (\n                    0.2f,\n                    \"sliderXPosition\",\n                    _switchSprite->getSliderXPosition(),\n                    (_on) ? _switchSprite->getOnPosition() : _switchSprite->getOffPosition()\n                )\n         );\n    }\n    else {\n        _switchSprite->setSliderXPosition((_on) ? _switchSprite->getOnPosition() : _switchSprite->getOffPosition());\n    }\n    \n    sendActionsForControlEvents(Control::EventType::VALUE_CHANGED);\n}\n\nvoid ControlSwitch::setEnabled(bool enabled)\n{\n    _enabled = enabled;\n    if (_switchSprite != NULL)\n    {\n        _switchSprite->setOpacity((enabled) ? 255 : 128);\n    } \n}\n\nPoint ControlSwitch::locationFromTouch(Touch* pTouch)\n{\n    Point touchLocation   = pTouch->getLocation();                      // Get the touch position\n    touchLocation           = this->convertToNodeSpace(touchLocation);                  // Convert to the node space of this class\n    \n    return touchLocation;\n}\n\nbool ControlSwitch::onTouchBegan(Touch *pTouch, Event *pEvent)\n{\n    if (!isTouchInside(pTouch) || !isEnabled() || !isVisible())\n    {\n        return false;\n    }\n    \n    _moved = false;\n    \n    Point location = this->locationFromTouch(pTouch);\n    \n    _initialTouchXPosition = location.x - _switchSprite->getSliderXPosition();\n    \n    _switchSprite->getThumbSprite()->setColor(Color3B::GRAY);\n    _switchSprite->needsLayout();\n    \n    return true;\n}\n\nvoid ControlSwitch::onTouchMoved(Touch *pTouch, Event *pEvent)\n{\n    Point location    = this->locationFromTouch(pTouch);\n    location            = Point(location.x - _initialTouchXPosition, 0);\n    \n    _moved              = true;\n    \n    _switchSprite->setSliderXPosition(location.x);\n}\n\nvoid ControlSwitch::onTouchEnded(Touch *pTouch, Event *pEvent)\n{\n    Point location   = this->locationFromTouch(pTouch);\n    \n    _switchSprite->getThumbSprite()->setColor(Color3B::WHITE);\n    \n    if (hasMoved())\n    {\n        setOn(!(location.x < _switchSprite->getContentSize().width / 2), true);\n    } \n    else\n    {\n        setOn(!_on, true);\n    }\n}\n\nvoid ControlSwitch::onTouchCancelled(Touch *pTouch, Event *pEvent)\n{\n    Point location   = this->locationFromTouch(pTouch);\n    \n    _switchSprite->getThumbSprite()->setColor(Color3B::WHITE);\n    \n    if (hasMoved())\n    {\n        setOn(!(location.x < _switchSprite->getContentSize().width / 2), true);\n    } else\n    {\n        setOn(!_on, true);\n    }\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlSwitch.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n * Copyright 2012 Yannick Loriot. All rights reserved.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n#ifndef __CCCONTROLSWITCH_H__\n#define __CCCONTROLSWITCH_H__\n\n#include \"CCControl.h\"\n\n\nnamespace cocos2d { class Sprite; }\nnamespace cocos2d { class LabelTTF; }\n\nNS_CC_EXT_BEGIN\n\nclass ControlSwitchSprite;\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\n/** @class ControlSwitch Switch control for Cocos2D. */\nclass ControlSwitch : public Control\n{\npublic:\n    /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */\n    static ControlSwitch* create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, LabelTTF* onLabel, LabelTTF* offLabel);\n    /** Creates a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. */\n    static ControlSwitch* create(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite);\n    /**\n     * @js ctor\n     */\n    ControlSwitch();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ControlSwitch();\n\n    /** Initializes a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. */\n    bool initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite);\n    /** Initializes a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */\n    bool initWithMaskSprite(Sprite *maskSprite, Sprite * onSprite, Sprite * offSprite, Sprite * thumbSprite, LabelTTF* onLabel, LabelTTF* offLabel);\n\n    /**\n     * Set the state of the switch to On or Off, optionally animating the transition.\n     *\n     * @param isOn YES if the switch should be turned to the On position; NO if it \n     * should be turned to the Off position. If the switch is already in the \n     * designated position, nothing happens.\n     * @param animated YES to animate the \"flipping\" of the switch; otherwise NO.\n     */\n    void setOn(bool isOn, bool animated);\n    void setOn(bool isOn);\n    bool isOn(void) const { return _on; }\n    bool hasMoved() const { return _moved; }\n    virtual void setEnabled(bool enabled);\n\n    Point locationFromTouch(Touch* touch);\n\n    // Overrides\n    virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchCancelled(Touch *pTouch, Event *pEvent) override;\n\nprotected:\n    /** Sprite which represents the view. */\n    ControlSwitchSprite* _switchSprite;\n    float _initialTouchXPosition;\n    \n    bool _moved;\n    /** A Boolean value that determines the off/on state of the switch. */\n    bool _on;\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif /* __CCCONTROLSWITCH_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlUtils.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCControlUtils.h\"\n\nNS_CC_EXT_BEGIN\n\nSprite* ControlUtils::addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, Point pos, Point anchor)\n{\n    Sprite *sprite =Sprite::createWithSpriteFrameName(spriteName);\n    \n    if (!sprite)\n        return NULL;\n\n    sprite->setPosition(pos);\n    sprite->setAnchorPoint(anchor);\n    target->addChild(sprite);\n\n    return sprite;\n}\n\n\nHSV ControlUtils::HSVfromRGB(RGBA value)\n{\n    HSV         out;\n    double      min, max, delta;\n    \n    min = value.r < value.g ? value.r : value.g;\n    min = min  < value.b ? min  : value.b;\n    \n    max = value.r > value.g ? value.r : value.g;\n    max = max  > value.b ? max  : value.b;\n    \n    out.v = max;                                // v\n    delta = max - min;\n    if( max > 0.0 )\n    {\n        out.s = (delta / max);                  // s\n    } else\n    {\n        // r = g = b = 0                        // s = 0, v is undefined\n        out.s = 0.0;\n        out.h = -1;                            // its now undefined (don't know if setting to NAN is a good idea)\n        return out;\n    }\n    if( value.r >= max )                        // > is bogus, just keeps compilor happy\n    {\n        out.h = ( value.g - value.b ) / delta;        // between yellow & magenta\n    } else\n    {\n        if( value.g >= max )\n            out.h = 2.0 + ( value.b - value.r ) / delta;  // between cyan & yellow\n        else\n            out.h = 4.0 + ( value.r - value.g ) / delta;  // between magenta & cyan\n    }\n    \n    out.h *= 60.0;                              // degrees\n    \n    if( out.h < 0.0 )\n        out.h += 360.0;\n    \n    return out;\n}\n\nRGBA ControlUtils::RGBfromHSV(HSV value)\n{\n    double      hh, p, q, t, ff;\n    long        i;\n    RGBA        out;\n    out.a        = 1;\n    \n    if (value.s <= 0.0) // < is bogus, just shuts up warnings\n    {       \n        if (isnan(value.h)) // value.h == NAN\n        {   \n            out.r = value.v;\n            out.g = value.v;\n            out.b = value.v;\n            return out;\n        }\n        \n        // error - should never happen\n        out.r = 0.0;\n        out.g = 0.0;\n        out.b = 0.0;\n        return out;\n    }\n    \n    hh = value.h;\n    if(hh >= 360.0) hh = 0.0;\n    hh /= 60.0;\n    i = (long)hh;\n    ff = hh - i;\n    p = value.v * (1.0 - value.s);\n    q = value.v * (1.0 - (value.s * ff));\n    t = value.v * (1.0 - (value.s * (1.0 - ff)));\n    \n    switch(i)\n    {\n        case 0:\n            out.r = value.v;\n            out.g = t;\n            out.b = p;\n            break;\n        case 1:\n            out.r = q;\n            out.g = value.v;\n            out.b = p;\n            break;\n        case 2:\n            out.r = p;\n            out.g = value.v;\n            out.b = t;\n            break;\n            \n        case 3:\n            out.r = p;\n            out.g = q;\n            out.b = value.v;\n            break;\n        case 4:\n            out.r = t;\n            out.g = p;\n            out.b = value.v;\n            break;\n        case 5:\n        default:\n            out.r = value.v;\n            out.g = p;\n            out.b = q;\n            break;\n    }\n    return out;     \n}\n\nRect ControlUtils::RectUnion(const Rect& src1, const Rect& src2) \n{\n    Rect result;\n    \n    float x1 = MIN(src1.getMinX(), src2.getMinX());\n    float y1 = MIN(src1.getMinY(), src2.getMinY());\n    float x2 = MAX(src1.getMaxX(), src2.getMaxX());\n    float y2 = MAX(src1.getMaxY(), src2.getMaxY());\n    \n    result.origin=Point(x1,y1);\n    result.size=Size(x2-x1, y2-y1);\n    return result;\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCControlUtils.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n *\n *\n * Copyright 2012 Stewart Hamilton-Arrandale.\n * http://creativewax.co.uk\n *\n * Modified by Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n#ifndef __CCCONTROL_UTILS_H__\n#define __CCCONTROL_UTILS_H__\n\n#include \"CCSprite.h\"\n#include \"../../ExtensionMacros.h\"\n\nNS_CC_EXT_BEGIN\n\ntypedef struct\n{\n    double r;       // percent\n    double g;       // percent\n    double b;       // percent\n    double a;       // percent\n} RGBA;\n\ntypedef struct\n{\n    double h;       // angle in degrees\n    double s;       // percent\n    double v;       // percent\n} HSV;\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\n//helper class to store Color3B's in mutable arrays\nclass Color3bObject : public Object\n{\npublic:\n    Color3B value;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Color3bObject(Color3B s_value):value(s_value){}\n};\n\nclass ControlUtils\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static Sprite* addSpriteToTargetWithPosAndAnchor(const char* spriteName, Node * target, Point pos, Point anchor);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static HSV HSVfromRGB(RGBA value);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static RGBA RGBfromHSV(HSV value);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static Rect RectUnion(const Rect& src1, const Rect& src2);\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCInvocation.cpp",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n\n#include \"CCInvocation.h\"\n\nNS_CC_EXT_BEGIN\n\nInvocation* Invocation::create(Object* target, Control::Handler action, Control::EventType controlEvent)\n{\n    Invocation* pRet = new Invocation(target, action, controlEvent);\n    if (pRet != NULL)\n    {\n        pRet->autorelease();\n    }\n    return pRet;\n}\n\nInvocation::Invocation(Object* target, Control::Handler action, Control::EventType controlEvent)\n{\n    _target=target;\n    _action=action;\n    _controlEvent=controlEvent;\n}\n\nvoid Invocation::invoke(Object* sender)\n{\n    if (_target && _action)\n    {\n        (_target->*_action)(sender, _controlEvent);\n    }                \n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCInvocation.h",
    "content": "/*\n * Copyright (c) 2012 cocos2d-x.org\n * http://www.cocos2d-x.org\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n *\n * Converted to c++ / cocos2d-x by Angus C\n */\n/*\n *\n * Helper class to store targets and selectors (and eventually, params?) in the same MutableArray. Basically a very crude form of a NSInvocation\n */\n#ifndef __CCINVOCATION_H__\n#define __CCINVOCATION_H__\n\n#include \"CCObject.h\"\n#include \"../../ExtensionMacros.h\"\n#include \"CCControl.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\n#define cccontrol_selector(_SELECTOR) static_cast<cocos2d::extension::Control::Handler>(&_SELECTOR)\n\nclass Invocation : public Object\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    static Invocation* create(Object* target, Control::Handler action, Control::EventType controlEvent);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    Invocation(Object* target, Control::Handler action, Control::EventType controlEvent);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    void invoke(Object* sender);\n\nprotected:\n    CC_SYNTHESIZE_READONLY(Control::Handler, _action, Action);\n    CC_SYNTHESIZE_READONLY(Object*, _target, Target);\n    CC_SYNTHESIZE_READONLY(Control::EventType, _controlEvent, ControlEvent);\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nCreated by Jung Sang-Taik on 12. 3. 16..\nCopyright (c) 2012 Neofect. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"CCScale9Sprite.h\"\n#include \"CCPlatformMacros.h\"\n#include \"CCSprite.h\"\n#include \"CCSpriteFrameCache.h\"\n\nNS_CC_EXT_BEGIN\n\nenum positions\n{\n    pCentre = 0,\n    pTop,\n    pLeft,\n    pRight,\n    pBottom,\n    pTopRight,\n    pTopLeft,\n    pBottomRight,\n    pBottomLeft\n};\n\nScale9Sprite::Scale9Sprite()\n: _spritesGenerated(false)\n, _spriteFrameRotated(false)\n, _positionsAreDirty(false)\n, _scale9Image(NULL)\n, _topLeft(NULL)\n, _top(NULL)\n, _topRight(NULL)\n, _left(NULL)\n, _centre(NULL)\n, _right(NULL)\n, _bottomLeft(NULL)\n, _bottom(NULL)\n, _bottomRight(NULL)\n, _opacityModifyRGB(false)\n, _insetLeft(0)\n, _insetTop(0)\n, _insetRight(0)\n, _insetBottom(0)\n{\n\n}\n\nScale9Sprite::~Scale9Sprite()\n{\n    CC_SAFE_RELEASE(_topLeft);\n    CC_SAFE_RELEASE(_top);\n    CC_SAFE_RELEASE(_topRight);\n    CC_SAFE_RELEASE(_left);\n    CC_SAFE_RELEASE(_centre);\n    CC_SAFE_RELEASE(_right);\n    CC_SAFE_RELEASE(_bottomLeft);\n    CC_SAFE_RELEASE(_bottom);\n    CC_SAFE_RELEASE(_bottomRight);\n    CC_SAFE_RELEASE(_scale9Image);\n}\n\nbool Scale9Sprite::init()\n{\n    return this->initWithBatchNode(NULL, Rect::ZERO, Rect::ZERO);\n}\n\nbool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets)\n{\n    return this->initWithBatchNode(batchnode, rect, false, capInsets);\n}\n\nbool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets)\n{\n    if(batchnode)\n    {\n        this->updateWithBatchNode(batchnode, rect, rotated, capInsets);\n    }\n    \n    this->setAnchorPoint(Point(0.5f, 0.5f));\n    this->_positionsAreDirty = true;\n    \n    return true;\n}\n\n#define    TRANSLATE_X(x, y, xtranslate) \\\n    x+=xtranslate;                       \\\n\n#define    TRANSLATE_Y(x, y, ytranslate) \\\n    y+=ytranslate;                       \\\n\nbool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& originalRect, bool rotated, const Rect& capInsets)\n{\n    GLubyte opacity = getOpacity();\n    Color3B color = getColor();\n    Rect rect(originalRect);\n\n    // Release old sprites\n    this->removeAllChildrenWithCleanup(true);\n\n    CC_SAFE_RELEASE(this->_centre);\n    CC_SAFE_RELEASE(this->_top);\n    CC_SAFE_RELEASE(this->_topLeft);\n    CC_SAFE_RELEASE(this->_topRight);\n    CC_SAFE_RELEASE(this->_left);\n    CC_SAFE_RELEASE(this->_right);\n    CC_SAFE_RELEASE(this->_bottomLeft);\n    CC_SAFE_RELEASE(this->_bottom);\n    CC_SAFE_RELEASE(this->_bottomRight);\n\n    \n    if(this->_scale9Image != batchnode)\n    {\n        CC_SAFE_RELEASE(this->_scale9Image);\n        _scale9Image = batchnode;\n        CC_SAFE_RETAIN(_scale9Image);\n    }\n    \n    if (!_scale9Image)\n    {\n        return false;\n    }\n\n    _scale9Image->removeAllChildrenWithCleanup(true);\n\n    _capInsets = capInsets;\n    _spriteFrameRotated = rotated;\n    \n    // If there is no given rect\n    if ( rect.equals(Rect::ZERO) )\n    {\n        // Get the texture size as original\n        Size textureSize = _scale9Image->getTextureAtlas()->getTexture()->getContentSize();\n    \n        rect = Rect(0, 0, textureSize.width, textureSize.height);\n    }\n    \n    // Set the given rect's size as original size\n    _spriteRect = rect;\n    _originalSize = rect.size;\n    _preferredSize = _originalSize;\n    _capInsetsInternal = capInsets;\n    \n    float w = rect.size.width;\n    float h = rect.size.height;\n\n    // If there is no specified center region\n    if ( _capInsetsInternal.equals(Rect::ZERO) )\n    {\n        // log(\"... cap insets not specified : using default cap insets ...\");\n        _capInsetsInternal = Rect(w/3, h/3, w/3, h/3);\n    }\n\n    float left_w = _capInsetsInternal.origin.x;\n    float center_w = _capInsetsInternal.size.width;\n    float right_w = rect.size.width - (left_w + center_w);\n\n    float top_h = _capInsetsInternal.origin.y;\n    float center_h = _capInsetsInternal.size.height;\n    float bottom_h = rect.size.height - (top_h + center_h);\n\n    // calculate rects\n\n    // ... top row\n    float x = 0.0;\n    float y = 0.0;\n\n    // top left\n    Rect lefttopbounds = Rect(x, y, left_w, top_h);\n\n    // top center\n    TRANSLATE_X(x, y, left_w);\n    Rect centertopbounds = Rect(x, y, center_w, top_h);\n        \n    // top right\n    TRANSLATE_X(x, y, center_w);\n    Rect righttopbounds = Rect(x, y, right_w, top_h);\n\n    // ... center row\n    x = 0.0;\n    y = 0.0;\n    TRANSLATE_Y(x, y, top_h);\n\n    // center left\n    Rect leftcenterbounds = Rect(x, y, left_w, center_h);\n\n    // center center\n    TRANSLATE_X(x, y, left_w);\n    Rect centerbounds = Rect(x, y, center_w, center_h);\n\n    // center right\n    TRANSLATE_X(x, y, center_w);\n    Rect rightcenterbounds = Rect(x, y, right_w, center_h);\n\n    // ... bottom row\n    x = 0.0;\n    y = 0.0;\n    TRANSLATE_Y(x, y, top_h);\n    TRANSLATE_Y(x, y, center_h);\n\n    // bottom left\n    Rect leftbottombounds = Rect(x, y, left_w, bottom_h);\n\n    // bottom center\n    TRANSLATE_X(x, y, left_w);\n    Rect centerbottombounds = Rect(x, y, center_w, bottom_h);\n\n    // bottom right\n    TRANSLATE_X(x, y, center_w);\n    Rect rightbottombounds = Rect(x, y, right_w, bottom_h);\n\n    if (!rotated) {\n        // log(\"!rotated\");\n\n        AffineTransform t = AffineTransform::IDENTITY;\n        t = AffineTransformTranslate(t, rect.origin.x, rect.origin.y);\n\n        centerbounds = RectApplyAffineTransform(centerbounds, t);\n        rightbottombounds = RectApplyAffineTransform(rightbottombounds, t);\n        leftbottombounds = RectApplyAffineTransform(leftbottombounds, t);\n        righttopbounds = RectApplyAffineTransform(righttopbounds, t);\n        lefttopbounds = RectApplyAffineTransform(lefttopbounds, t);\n        rightcenterbounds = RectApplyAffineTransform(rightcenterbounds, t);\n        leftcenterbounds = RectApplyAffineTransform(leftcenterbounds, t);\n        centerbottombounds = RectApplyAffineTransform(centerbottombounds, t);\n        centertopbounds = RectApplyAffineTransform(centertopbounds, t);\n\n        // Centre\n        _centre = Sprite::createWithTexture(_scale9Image->getTexture(), centerbounds);\n        _centre->retain();\n        _scale9Image->addChild(_centre, 0, pCentre);\n\n        \n        // Top\n        _top = Sprite::createWithTexture(_scale9Image->getTexture(), centertopbounds);\n        _top->retain();\n        _scale9Image->addChild(_top, 1, pTop);\n        \n        // Bottom\n        _bottom = Sprite::createWithTexture(_scale9Image->getTexture(), centerbottombounds);\n        _bottom->retain();\n        _scale9Image->addChild(_bottom, 1, pBottom);\n        \n        // Left\n        _left = Sprite::createWithTexture(_scale9Image->getTexture(), leftcenterbounds);\n        _left->retain();\n        _scale9Image->addChild(_left, 1, pLeft);\n        \n        // Right\n        _right = Sprite::createWithTexture(_scale9Image->getTexture(), rightcenterbounds);\n        _right->retain();\n        _scale9Image->addChild(_right, 1, pRight);\n        \n        // Top left\n        _topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), lefttopbounds);\n        _topLeft->retain();\n        _scale9Image->addChild(_topLeft, 2, pTopLeft);\n        \n        // Top right\n        _topRight = Sprite::createWithTexture(_scale9Image->getTexture(), righttopbounds);\n        _topRight->retain();\n        _scale9Image->addChild(_topRight, 2, pTopRight);\n        \n        // Bottom left\n        _bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), leftbottombounds);\n        _bottomLeft->retain();\n        _scale9Image->addChild(_bottomLeft, 2, pBottomLeft);\n        \n        // Bottom right\n        _bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rightbottombounds);\n        _bottomRight->retain();\n        _scale9Image->addChild(_bottomRight, 2, pBottomRight);\n    } else {\n        // set up transformation of coordinates\n        // to handle the case where the sprite is stored rotated\n        // in the spritesheet\n        // log(\"rotated\");\n\n        AffineTransform t = AffineTransform::IDENTITY;\n\n        Rect rotatedcenterbounds = centerbounds;\n        Rect rotatedrightbottombounds = rightbottombounds;\n        Rect rotatedleftbottombounds = leftbottombounds;\n        Rect rotatedrighttopbounds = righttopbounds;\n        Rect rotatedlefttopbounds = lefttopbounds;\n        Rect rotatedrightcenterbounds = rightcenterbounds;\n        Rect rotatedleftcenterbounds = leftcenterbounds;\n        Rect rotatedcenterbottombounds = centerbottombounds;\n        Rect rotatedcentertopbounds = centertopbounds;\n        \n        t = AffineTransformTranslate(t, rect.size.height+rect.origin.x, rect.origin.y);\n        t = AffineTransformRotate(t, 1.57079633f);\n        \n        centerbounds = RectApplyAffineTransform(centerbounds, t);\n        rightbottombounds = RectApplyAffineTransform(rightbottombounds, t);\n        leftbottombounds = RectApplyAffineTransform(leftbottombounds, t);\n        righttopbounds = RectApplyAffineTransform(righttopbounds, t);\n        lefttopbounds = RectApplyAffineTransform(lefttopbounds, t);\n        rightcenterbounds = RectApplyAffineTransform(rightcenterbounds, t);\n        leftcenterbounds = RectApplyAffineTransform(leftcenterbounds, t);\n        centerbottombounds = RectApplyAffineTransform(centerbottombounds, t);\n        centertopbounds = RectApplyAffineTransform(centertopbounds, t);\n\n        rotatedcenterbounds.origin = centerbounds.origin;\n        rotatedrightbottombounds.origin = rightbottombounds.origin;\n        rotatedleftbottombounds.origin = leftbottombounds.origin;\n        rotatedrighttopbounds.origin = righttopbounds.origin;\n        rotatedlefttopbounds.origin = lefttopbounds.origin;\n        rotatedrightcenterbounds.origin = rightcenterbounds.origin;\n        rotatedleftcenterbounds.origin = leftcenterbounds.origin;\n        rotatedcenterbottombounds.origin = centerbottombounds.origin;\n        rotatedcentertopbounds.origin = centertopbounds.origin;\n\n        // Centre\n        _centre = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbounds, true);\n        _centre->retain();\n        _scale9Image->addChild(_centre, 0, pCentre);\n        \n        // Top\n        _top = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcentertopbounds, true);\n        _top->retain();\n        _scale9Image->addChild(_top, 1, pTop);\n        \n        // Bottom\n        _bottom = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbottombounds, true);\n        _bottom->retain();\n        _scale9Image->addChild(_bottom, 1, pBottom);\n        \n        // Left\n        _left = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftcenterbounds, true);\n        _left->retain();\n        _scale9Image->addChild(_left, 1, pLeft);\n        \n        // Right\n        _right = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightcenterbounds, true);\n        _right->retain();\n        _scale9Image->addChild(_right, 1, pRight);\n        \n        // Top left\n        _topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedlefttopbounds, true);\n        _topLeft->retain();\n        _scale9Image->addChild(_topLeft, 2, pTopLeft);\n        \n        // Top right\n        _topRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrighttopbounds, true);\n        _topRight->retain();\n        _scale9Image->addChild(_topRight, 2, pTopRight);\n        \n        // Bottom left\n        _bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftbottombounds, true);\n        _bottomLeft->retain();\n        _scale9Image->addChild(_bottomLeft, 2, pBottomLeft);\n        \n        // Bottom right\n        _bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightbottombounds, true);\n        _bottomRight->retain();\n        _scale9Image->addChild(_bottomRight, 2, pBottomRight);\n    }\n\n    this->setContentSize(rect.size);\n    this->addChild(_scale9Image);\n    \n    if (_spritesGenerated)\n    {\n        // Restore color and opacity\n        this->setOpacity(opacity);\n        this->setColor(color);\n    }\n    _spritesGenerated = true;\n\n    return true;\n}\n\nvoid Scale9Sprite::setContentSize(const Size &size)\n{\n    Node::setContentSize(size);\n    this->_positionsAreDirty = true;\n}\n\nvoid Scale9Sprite::updatePositions()\n{\n    // Check that instances are non-NULL\n    if(!((_topLeft) &&\n         (_topRight) &&\n         (_bottomRight) &&\n         (_bottomLeft) &&\n         (_centre))) {\n        // if any of the above sprites are NULL, return\n        return;\n    }\n\n    Size size = this->_contentSize;\n\n    float sizableWidth = size.width - _topLeft->getContentSize().width - _topRight->getContentSize().width;\n    float sizableHeight = size.height - _topLeft->getContentSize().height - _bottomRight->getContentSize().height;\n    \n    float horizontalScale = sizableWidth/_centre->getContentSize().width;\n    float verticalScale = sizableHeight/_centre->getContentSize().height;\n\n    _centre->setScaleX(horizontalScale);\n    _centre->setScaleY(verticalScale);\n\n    float rescaledWidth = _centre->getContentSize().width * horizontalScale;\n    float rescaledHeight = _centre->getContentSize().height * verticalScale;\n\n    float leftWidth = _bottomLeft->getContentSize().width;\n    float bottomHeight = _bottomLeft->getContentSize().height;\n\n    _bottomLeft->setAnchorPoint(Point(0,0));\n    _bottomRight->setAnchorPoint(Point(0,0));\n    _topLeft->setAnchorPoint(Point(0,0));\n    _topRight->setAnchorPoint(Point(0,0));\n    _left->setAnchorPoint(Point(0,0));\n    _right->setAnchorPoint(Point(0,0));\n    _top->setAnchorPoint(Point(0,0));\n    _bottom->setAnchorPoint(Point(0,0));\n    _centre->setAnchorPoint(Point(0,0));\n\n    // Position corners\n    _bottomLeft->setPosition(Point(0,0));\n    _bottomRight->setPosition(Point(leftWidth+rescaledWidth,0));\n    _topLeft->setPosition(Point(0, bottomHeight+rescaledHeight));\n    _topRight->setPosition(Point(leftWidth+rescaledWidth, bottomHeight+rescaledHeight));\n\n    // Scale and position borders\n    _left->setPosition(Point(0, bottomHeight));\n    _left->setScaleY(verticalScale);\n    _right->setPosition(Point(leftWidth+rescaledWidth,bottomHeight));\n    _right->setScaleY(verticalScale);\n    _bottom->setPosition(Point(leftWidth,0));\n    _bottom->setScaleX(horizontalScale);\n    _top->setPosition(Point(leftWidth,bottomHeight+rescaledHeight));\n    _top->setScaleX(horizontalScale);\n\n    // Position centre\n    _centre->setPosition(Point(leftWidth, bottomHeight));\n}\n\nbool Scale9Sprite::initWithFile(const char* file, const Rect& rect,  const Rect& capInsets)\n{\n    CCASSERT(file != NULL, \"Invalid file for sprite\");\n    \n    SpriteBatchNode *batchnode = SpriteBatchNode::create(file, 9);\n    bool pReturn = this->initWithBatchNode(batchnode, rect, capInsets);\n    return pReturn;\n}\n\nScale9Sprite* Scale9Sprite::create(const char* file, const Rect& rect,  const Rect& capInsets)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithFile(file, rect, capInsets) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\nbool Scale9Sprite::initWithFile(const char* file, const Rect& rect)\n{\n    CCASSERT(file != NULL, \"Invalid file for sprite\");\n    bool pReturn = this->initWithFile(file, rect, Rect::ZERO);\n    return pReturn;\n}\n\nScale9Sprite* Scale9Sprite::create(const char* file, const Rect& rect)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithFile(file, rect) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\n\nbool Scale9Sprite::initWithFile(const Rect& capInsets, const char* file)\n{\n    bool pReturn = this->initWithFile(file, Rect::ZERO, capInsets);\n    return pReturn;\n}\n\nScale9Sprite* Scale9Sprite::create(const Rect& capInsets, const char* file)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithFile(capInsets, file) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\nbool Scale9Sprite::initWithFile(const char* file)\n{\n    bool pReturn = this->initWithFile(file, Rect::ZERO);\n    return pReturn;\n    \n}\n\nScale9Sprite* Scale9Sprite::create(const char* file)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithFile(file) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\nbool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets)\n{\n    Texture2D* texture = spriteFrame->getTexture();\n    CCASSERT(texture != NULL, \"CCTexture must be not nil\");\n\n    SpriteBatchNode *batchnode = SpriteBatchNode::createWithTexture(texture, 9);\n    CCASSERT(batchnode != NULL, \"CCSpriteBatchNode must be not nil\");\n\n    bool pReturn = this->initWithBatchNode(batchnode, spriteFrame->getRect(), spriteFrame->isRotated(), capInsets);\n    return pReturn;\n}\n\nScale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame, capInsets) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\nbool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame)\n{\n    CCASSERT(spriteFrame != NULL, \"Invalid spriteFrame for sprite\");\n    bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO);\n    return pReturn;\n}\n\nScale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\nbool Scale9Sprite::initWithSpriteFrameName(const char* spriteFrameName, const Rect& capInsets)\n{\n    CCASSERT((SpriteFrameCache::getInstance()) != NULL, \"SpriteFrameCache::getInstance() must be non-NULL\");\n\n    SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);\n    CCASSERT(frame != NULL, \"CCSpriteFrame must be non-NULL\");\n\n    if (NULL == frame) return false;\n\n    bool pReturn = this->initWithSpriteFrame(frame, capInsets);\n    return pReturn;\n}\n\nScale9Sprite* Scale9Sprite::createWithSpriteFrameName(const char* spriteFrameName, const Rect& capInsets)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\nbool Scale9Sprite::initWithSpriteFrameName(const char* spriteFrameName)\n{\n    bool pReturn = this->initWithSpriteFrameName(spriteFrameName, Rect::ZERO);\n    return pReturn;\n}\n\nScale9Sprite* Scale9Sprite::createWithSpriteFrameName(const char* spriteFrameName)\n{\n    CCASSERT(spriteFrameName != NULL, \"spriteFrameName must be non-NULL\");\n\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n\n    log(\"Could not allocate Scale9Sprite()\");\n    return NULL;\n    \n}\n\nScale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets)\n{\n    Scale9Sprite* pReturn = new Scale9Sprite();\n    if ( pReturn && pReturn->initWithBatchNode(_scale9Image, _spriteRect, capInsets) )\n    {\n        pReturn->autorelease();\n        return pReturn;\n    }\n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\nScale9Sprite* Scale9Sprite::create()\n{ \n    Scale9Sprite *pReturn = new Scale9Sprite();\n    if (pReturn && pReturn->init())\n    { \n        pReturn->autorelease();   \n        return pReturn;\n    } \n    CC_SAFE_DELETE(pReturn);\n    return NULL;\n}\n\n/** sets the opacity.\n @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed.\n Values goes from 0 to 255, where 255 means fully opaque.\n */\n\nvoid Scale9Sprite::setPreferredSize(Size preferedSize)\n{\n    this->setContentSize(preferedSize);\n    this->_preferredSize = preferedSize;\n}\n\nSize Scale9Sprite::getPreferredSize()\n{\n    return this->_preferredSize;\n}\n\nvoid Scale9Sprite::setCapInsets(Rect capInsets)\n{\n    Size contentSize = this->_contentSize;\n    this->updateWithBatchNode(this->_scale9Image, this->_spriteRect, _spriteFrameRotated, capInsets);\n    this->setContentSize(contentSize);\n}\n\nRect Scale9Sprite::getCapInsets()\n{\n    return _capInsets;\n}\n\nvoid Scale9Sprite::updateCapInset()\n{\n    Rect insets;\n    if (this->_insetLeft == 0 && this->_insetTop == 0 && this->_insetRight == 0 && this->_insetBottom == 0)\n    {\n        insets = Rect::ZERO;\n    }\n    else\n    {\n        insets = Rect(_insetLeft,\n            _insetTop,\n            _spriteRect.size.width-_insetLeft-_insetRight,\n            _spriteRect.size.height-_insetTop-_insetBottom);\n    }\n    this->setCapInsets(insets);\n}\n\nvoid Scale9Sprite::setOpacityModifyRGB(bool var)\n{\n    if (!_scale9Image)\n    {\n        return;\n    }\n    _opacityModifyRGB = var;\n    \n    for(auto child : _scale9Image->getChildren()){\n        child->setOpacityModifyRGB(_opacityModifyRGB);\n    }\n}\n\nbool Scale9Sprite::isOpacityModifyRGB() const\n{\n    return _opacityModifyRGB;\n}\n\nvoid Scale9Sprite::setSpriteFrame(SpriteFrame * spriteFrame)\n{\n    SpriteBatchNode * batchnode = SpriteBatchNode::createWithTexture(spriteFrame->getTexture(), 9);\n    this->updateWithBatchNode(batchnode, spriteFrame->getRect(), spriteFrame->isRotated(), Rect::ZERO);\n\n    // Reset insets\n    this->_insetLeft = 0;\n    this->_insetTop = 0;\n    this->_insetRight = 0;\n    this->_insetBottom = 0;\n}\n\nfloat Scale9Sprite::getInsetLeft()\n{\n    return this->_insetLeft;\n}\n\nfloat Scale9Sprite::getInsetTop()\n{\n    return this->_insetTop;\n}\n\nfloat Scale9Sprite::getInsetRight()\n{\n    return this->_insetRight;\n}\n\nfloat Scale9Sprite::getInsetBottom()\n{\n    return this->_insetBottom;\n}\n\nvoid Scale9Sprite::setInsetLeft(float insetLeft)\n{\n    this->_insetLeft = insetLeft;\n    this->updateCapInset();\n}\n\nvoid Scale9Sprite::setInsetTop(float insetTop)\n{\n    this->_insetTop = insetTop;\n    this->updateCapInset();\n}\n\nvoid Scale9Sprite::setInsetRight(float insetRight)\n{\n    this->_insetRight = insetRight;\n    this->updateCapInset();\n}\n\nvoid Scale9Sprite::setInsetBottom(float insetBottom)\n{\n    this->_insetBottom = insetBottom;\n    this->updateCapInset();\n}\n\nvoid Scale9Sprite::visit()\n{\n    if(this->_positionsAreDirty)\n    {\n        this->updatePositions();\n        this->_positionsAreDirty = false;\n    }\n    Node::visit();\n}\n\nvoid Scale9Sprite::setColor(const Color3B& color)\n{\n    if (!_scale9Image)\n    {\n        return;\n    }\n    \n    Node::setColor(color);\n    \n    for(auto child : _scale9Image->getChildren()){\n        child->setColor(color);\n    }\n}\n\nvoid Scale9Sprite::setOpacity(GLubyte opacity)\n{\n    if (!_scale9Image)\n    {\n        return;\n    }\n    Node::setOpacity(opacity);\n    \n    for(auto child : _scale9Image->getChildren()){\n        child->setOpacity(opacity);\n    }\n}\n\nvoid Scale9Sprite::updateDisplayedColor(const cocos2d::Color3B &parentColor)\n{\n    if (!_scale9Image)\n    {\n        return;\n    }\n    Node::updateDisplayedColor(parentColor);\n\n    for(auto child : _scale9Image->getChildren()){\n        child->updateDisplayedColor(parentColor);\n    }\n}\n\nvoid Scale9Sprite::updateDisplayedOpacity(GLubyte parentOpacity)\n{\n    if (!_scale9Image)\n    {\n        return;\n    }\n    Node::updateDisplayedOpacity(parentOpacity);\n    \n    for(auto child : _scale9Image->getChildren()){\n        child->updateDisplayedOpacity(parentOpacity);\n    }\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCControlExtension/CCScale9Sprite.h",
    "content": "/****************************************************************************\nCopyright (c) 2012 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nCreated by Jung Sang-Taik on 12. 3. 16..\nCopyright (c) 2012 Neofect. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCScale9Sprite_H__\n#define __CCScale9Sprite_H__\n\n#include \"CCNode.h\"\n#include \"CCSpriteFrame.h\"\n#include \"CCSpriteBatchNode.h\"\n\n#include \"../../ExtensionMacros.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n * @addtogroup control_extension\n * @{\n */\n\n/**\n * A 9-slice sprite for cocos2d.\n *\n * 9-slice scaling allows you to specify how scaling is applied\n * to specific areas of a sprite. With 9-slice scaling (3x3 grid),\n * you can ensure that the sprite does not become distorted when\n * scaled.\n *\n * @see http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCScale9Sprite.html\n */\nclass Scale9Sprite : public Node\n{\npublic:\n    /**\n     * @js ctor\n     */\n    Scale9Sprite();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~Scale9Sprite();\n\npublic:\n    static Scale9Sprite* create();\n\n    /**\n     * Creates a 9-slice sprite with a texture file, a delimitation zone and\n     * with the specified cap insets.\n     *\n     * @see initWithFile(const char *file, const Rect& rect, const Rect& capInsets)\n     */\n    static Scale9Sprite* create(const char* file, const Rect& rect,  const Rect& capInsets);\n\n    /**\n     * Creates a 9-slice sprite with a texture file. The whole texture will be\n     * broken down into a 3×3 grid of equal blocks.\n     *\n     * @see initWithFile(const Rect& capInsets, const char *file)\n     */\n    static Scale9Sprite* create(const Rect& capInsets, const char* file);\n\n    /**\n     * Creates a 9-slice sprite with a texture file and a delimitation zone. The\n     * texture will be broken down into a 3×3 grid of equal blocks.\n     *\n     * @see initWithFile(const char *file, const Rect& rect)\n     */\n    static Scale9Sprite* create(const char* file, const Rect& rect);\n\n    /**\n     * Creates a 9-slice sprite with a texture file. The whole texture will be\n     * broken down into a 3×3 grid of equal blocks.\n     *\n     * @see initWithFile(const char *file)\n     */\n    static Scale9Sprite* create(const char* file);\n\n    /**\n     * Creates a 9-slice sprite with an sprite frame.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @see initWithSpriteFrame(SpriteFrame *spriteFrame)\n     */\n    static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame);\n\n    /**\n     * Creates a 9-slice sprite with an sprite frame and the centre of its zone.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @see initWithSpriteFrame(SpriteFrame *spriteFrame, const Rect& capInsets)\n     */\n    static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets);\n\n    /**\n     * Creates a 9-slice sprite with an sprite frame name.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @see initWithSpriteFrameName(const char *spriteFrameName)\n     */\n    static Scale9Sprite* createWithSpriteFrameName(const char*spriteFrameName);\n\n    /**\n     * Creates a 9-slice sprite with an sprite frame name and the centre of its\n     * zone.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @see initWithSpriteFrameName(const char *spriteFrameName, const Rect& capInsets)\n     */\n    static Scale9Sprite* createWithSpriteFrameName(const char*spriteFrameName, const Rect& capInsets);\n\n    /**\n     * Initializes a 9-slice sprite with a texture file, a delimitation zone and\n     * with the specified cap insets.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param file The name of the texture file.\n     * @param rect The rectangle that describes the sub-part of the texture that\n     * is the whole image. If the shape is the whole texture, set this to the \n     * texture's full rect.\n     * @param capInsets The values to use for the cap insets.\n     */\n    virtual bool initWithFile(const char* file, const Rect& rect,  const Rect& capInsets);\n    \n    /**\n     * Initializes a 9-slice sprite with a texture file and a delimitation zone. The\n     * texture will be broken down into a 3×3 grid of equal blocks.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param file The name of the texture file.\n     * @param rect The rectangle that describes the sub-part of the texture that\n     * is the whole image. If the shape is the whole texture, set this to the \n     * texture's full rect.\n     */\n    virtual bool initWithFile(const char* file, const Rect& rect);\n    \n    /**\n     * Initializes a 9-slice sprite with a texture file and with the specified cap\n     * insets.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param file The name of the texture file.\n     * @param capInsets The values to use for the cap insets.\n     */\n    virtual bool initWithFile(const Rect& capInsets, const char* file);\n    \n    /**\n     * Initializes a 9-slice sprite with a texture file. The whole texture will be\n     * broken down into a 3×3 grid of equal blocks.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param file The name of the texture file.\n     */\n    virtual bool initWithFile(const char* file);\n    \n    /**\n     * Initializes a 9-slice sprite with an sprite frame and with the specified \n     * cap insets.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param spriteFrame The sprite frame object.\n     * @param capInsets The values to use for the cap insets.\n     */\n    virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets);\n\n    /**\n     * Initializes a 9-slice sprite with an sprite frame.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param spriteFrame The sprite frame object.\n     */\n    virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame);\n\n    /**\n     * Initializes a 9-slice sprite with an sprite frame name and with the specified \n     * cap insets.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param spriteFrameName The sprite frame name.\n     * @param capInsets The values to use for the cap insets.\n     */\n    virtual bool initWithSpriteFrameName(const char*spriteFrameName, const Rect& capInsets);\n\n    /**\n     * Initializes a 9-slice sprite with an sprite frame name.\n     * Once the sprite is created, you can then call its \"setContentSize:\" method\n     * to resize the sprite will all it's 9-slice goodness intract.\n     * It respects the anchorPoint too.\n     *\n     * @param spriteFrameName The sprite frame name.\n     */\n    virtual bool initWithSpriteFrameName(const char*spriteFrameName);\n\n    virtual bool init();\n    virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets);\n    virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets);\n\n    /**\n     * Creates and returns a new sprite object with the specified cap insets.\n     * You use this method to add cap insets to a sprite or to change the existing\n     * cap insets of a sprite. In both cases, you get back a new image and the \n     * original sprite remains untouched.\n     *\n     * @param capInsets The values to use for the cap insets.\n     */\n    Scale9Sprite* resizableSpriteWithCapInsets(const Rect& capInsets);\n    \n    virtual bool updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets);\n    virtual void setSpriteFrame(SpriteFrame * spriteFrame);\n\n    // overrides\n    virtual void setContentSize(const Size & size) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit() override;\n    virtual void setOpacityModifyRGB(bool bValue) override;\n    virtual bool isOpacityModifyRGB(void) const override;\n    virtual void setOpacity(GLubyte opacity) override;\n    virtual void setColor(const Color3B& color) override;\n    virtual void updateDisplayedOpacity(GLubyte parentOpacity) override;\n    virtual void updateDisplayedColor(const Color3B& parentColor) override;\n\nprotected:\n    void updateCapInset();\n    void updatePositions();\n\n    bool _spritesGenerated;\n    Rect _spriteRect;\n    bool   _spriteFrameRotated;\n    Rect _capInsetsInternal;\n    bool _positionsAreDirty;\n\n    SpriteBatchNode* _scale9Image;\n    Sprite* _topLeft;\n    Sprite* _top;\n    Sprite* _topRight;\n    Sprite* _left;\n    Sprite* _centre;\n    Sprite* _right;\n    Sprite* _bottomLeft;\n    Sprite* _bottom;\n    Sprite* _bottomRight;\n\n    bool _opacityModifyRGB;\n\n    /** Original sprite's size. */\n    CC_SYNTHESIZE_READONLY(Size, _originalSize, OriginalSize);\n    /** Prefered sprite's size. By default the prefered size is the original size. */\n\n    //if the preferredSize component is given as -1, it is ignored\n    CC_PROPERTY(Size, _preferredSize, PreferredSize);\n    /**\n     * The end-cap insets.\n     * On a non-resizeable sprite, this property is set to CGRect::ZERO; the sprite\n     * does not use end caps and the entire sprite is subject to stretching.\n     */\n    CC_PROPERTY(Rect, _capInsets, CapInsets);\n    /** Sets the left side inset */\n    CC_PROPERTY(float, _insetLeft, InsetLeft);\n    /** Sets the top side inset */\n    CC_PROPERTY(float, _insetTop, InsetTop);\n    /** Sets the right side inset */\n    CC_PROPERTY(float, _insetRight, InsetRight);\n    /** Sets the bottom side inset */\n    CC_PROPERTY(float, _insetBottom, InsetBottom);\n};\n\n// end of GUI group\n/// @}\n/// @}\n\nNS_CC_EXT_END\n\n#endif // __CCScale9Sprite_H__\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBox.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEditBox.h\"\n#include \"CCEditBoxImpl.h\"\n\nNS_CC_EXT_BEGIN\n\nEditBox::EditBox(void)\n: _editBoxImpl(NULL)\n, _delegate(NULL)\n, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE)\n, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS)\n, _keyboardReturnType(KeyboardReturnType::DEFAULT)\n, _fontSize(-1)\n, _placeholderFontSize(-1)\n, _colText(Color3B::WHITE)\n, _colPlaceHolder(Color3B::GRAY)\n, _maxLength(0)\n, _adjustHeight(0.0f)\n, _scriptEditBoxHandler(0)\n{\n}\n\nEditBox::~EditBox(void)\n{\n    CC_SAFE_DELETE(_editBoxImpl);\n    unregisterScriptEditBoxHandler();\n}\n\n\nvoid EditBox::touchDownAction(Object *sender, Control::EventType controlEvent)\n{\n    _editBoxImpl->openKeyboard();\n}\n\nEditBox* EditBox::create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg/* = NULL*/, Scale9Sprite* pDisabled9SpriteBg/* = NULL*/)\n{\n    EditBox* pRet = new EditBox();\n    \n    if (pRet != NULL && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg))\n    {\n        if (pPressed9SpriteBg != NULL)\n        {\n            pRet->setBackgroundSpriteForState(pPressed9SpriteBg, Control::State::HIGH_LIGHTED);\n        }\n        \n        if (pDisabled9SpriteBg != NULL)\n        {\n            pRet->setBackgroundSpriteForState(pDisabled9SpriteBg, Control::State::DISABLED);\n        }\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    \n    return pRet;\n}\n\nbool EditBox::initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pPressed9SpriteBg)\n{\n    if (ControlButton::initWithBackgroundSprite(pPressed9SpriteBg))\n    {\n        _editBoxImpl = __createSystemEditBox(this);\n        _editBoxImpl->initWithSize(size);\n        _editBoxImpl->setInputMode(EditBox::InputMode::ANY);\n        \n        this->setZoomOnTouchDown(false);\n        this->setPreferredSize(size);\n        this->setPosition(Point(0, 0));\n        this->addTargetWithActionForControlEvent(this, cccontrol_selector(EditBox::touchDownAction), Control::EventType::TOUCH_UP_INSIDE);\n        \n        return true;\n    }\n    return false;\n}\n\nvoid EditBox::setDelegate(EditBoxDelegate* pDelegate)\n{\n    _delegate = pDelegate;\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setDelegate(pDelegate);\n    }\n}\n\nEditBoxDelegate* EditBox::getDelegate()\n{\n    return _delegate;\n}\n\nvoid EditBox::setText(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _text = pText;\n        if (_editBoxImpl != NULL)\n        {\n            _editBoxImpl->setText(pText);\n        }\n    }\n}\n\nconst char* EditBox::getText(void)\n{\n    if (_editBoxImpl != NULL)\n    {\n\t\tconst char* pText = _editBoxImpl->getText();\n\t\tif(pText != NULL)\n\t\t\treturn pText;\n    }\n    \n    return \"\";\n}\n\nvoid EditBox::setFont(const char* pFontName, int fontSize)\n{\n    _fontName = pFontName;\n    _fontSize = fontSize;\n    if (pFontName != NULL)\n    {\n        if (_editBoxImpl != NULL)\n        {\n            _editBoxImpl->setFont(pFontName, fontSize);\n        }\n    }\n}\n\nvoid EditBox::setFontName(const char* pFontName)\n{\n    _fontName = pFontName;\n    if (_editBoxImpl != NULL && _fontSize != -1)\n    {\n        _editBoxImpl->setFont(pFontName, _fontSize);\n    }\n}\n\nvoid EditBox::setFontSize(int fontSize)\n{\n    _fontSize = fontSize;\n    if (_editBoxImpl != NULL && _fontName.length() > 0)\n    {\n        _editBoxImpl->setFont(_fontName.c_str(), _fontSize);\n    }\n}\n\nvoid EditBox::setFontColor(const Color3B& color)\n{\n    _colText = color;\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setFontColor(color);\n    }\n}\n\nvoid EditBox::setPlaceholderFont(const char* pFontName, int fontSize)\n{\n    _placeholderFontName = pFontName;\n    _placeholderFontSize = fontSize;\n    if (pFontName != NULL)\n    {\n        if (_editBoxImpl != NULL)\n        {\n            _editBoxImpl->setPlaceholderFont(pFontName, fontSize);\n        }\n    }\n}\n\nvoid EditBox::setPlaceholderFontName(const char* pFontName)\n{\n    _placeholderFontName = pFontName;\n    if (_editBoxImpl != NULL && _placeholderFontSize != -1)\n    {\n        _editBoxImpl->setPlaceholderFont(pFontName, _fontSize);\n    }\n}\n\nvoid EditBox::setPlaceholderFontSize(int fontSize)\n{\n    _placeholderFontSize = fontSize;\n    if (_editBoxImpl != NULL && _placeholderFontName.length() > 0)\n    {\n        _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), _fontSize);\n    }\n}\n\nvoid EditBox::setPlaceholderFontColor(const Color3B& color)\n{\n    _colText = color;\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setPlaceholderFontColor(color);\n    }\n}\n\nvoid EditBox::setPlaceHolder(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _placeHolder = pText;\n        if (_editBoxImpl != NULL)\n        {\n            _editBoxImpl->setPlaceHolder(pText);\n        }\n    }\n}\n\nconst char* EditBox::getPlaceHolder(void)\n{\n    return _placeHolder.c_str();\n}\n\nvoid EditBox::setInputMode(EditBox::InputMode inputMode)\n{\n    _editBoxInputMode = inputMode;\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setInputMode(inputMode);\n    }\n}\n\nvoid EditBox::setMaxLength(int maxLength)\n{\n    _maxLength = maxLength;\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setMaxLength(maxLength);\n    }\n}\n\n\nint EditBox::getMaxLength()\n{\n    return _maxLength;\n}\n\nvoid EditBox::setInputFlag(EditBox::InputFlag inputFlag)\n{\n    _editBoxInputFlag = inputFlag;\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setInputFlag(inputFlag);\n    }\n}\n\nvoid EditBox::setReturnType(EditBox::KeyboardReturnType returnType)\n{\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setReturnType(returnType);\n    }\n}\n\n/* override function */\nvoid EditBox::setPosition(const Point& pos)\n{\n    ControlButton::setPosition(pos);\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setPosition(pos);\n    }\n}\n\nvoid EditBox::setVisible(bool visible)\n{\n    ControlButton::setVisible(visible);\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setVisible(visible);\n    }\n}\n\nvoid EditBox::setContentSize(const Size& size)\n{\n    ControlButton::setContentSize(size);\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setContentSize(size);\n    }\n}\n\nvoid EditBox::setAnchorPoint(const Point& anchorPoint)\n{\n    ControlButton::setAnchorPoint(anchorPoint);\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->setAnchorPoint(anchorPoint);\n    }\n}\n\nvoid EditBox::visit(void)\n{\n    ControlButton::visit();\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->visit();\n    }\n}\n\nvoid EditBox::onEnter(void)\n{\n    ControlButton::onEnter();\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->onEnter();\n    }\n}\n\nvoid EditBox::onExit(void)\n{\n    ControlButton::onExit();\n    if (_editBoxImpl != NULL)\n    {\n        // remove system edit control\n        _editBoxImpl->closeKeyboard();\n    }\n}\n\nstatic Rect getRect(Node * pNode)\n{\n\tSize contentSize = pNode->getContentSize();\n\tRect rect = Rect(0, 0, contentSize.width, contentSize.height);\n\treturn RectApplyTransform(rect, pNode->getNodeToWorldTransform());\n}\n\nvoid EditBox::keyboardWillShow(IMEKeyboardNotificationInfo& info)\n{\n    // CCLOG(\"CCEditBox::keyboardWillShow\");\n    Rect rectTracked = getRect(this);\n\t// some adjustment for margin between the keyboard and the edit box.\n\trectTracked.origin.y -= 4;\n\n    // if the keyboard area doesn't intersect with the tracking node area, nothing needs to be done.\n    if (!rectTracked.intersectsRect(info.end))\n    {\n        CCLOG(\"needn't to adjust view layout.\");\n        return;\n    }\n    \n    // assume keyboard at the bottom of screen, calculate the vertical adjustment.\n    _adjustHeight = info.end.getMaxY() - rectTracked.getMinY();\n    // CCLOG(\"CCEditBox:needAdjustVerticalPosition(%f)\", _adjustHeight);\n    \n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, _adjustHeight);\n    }\n}\n\nvoid EditBox::keyboardDidShow(IMEKeyboardNotificationInfo& info)\n{\n\t\n}\n\nvoid EditBox::keyboardWillHide(IMEKeyboardNotificationInfo& info)\n{\n    // CCLOG(\"CCEditBox::keyboardWillHide\");\n    if (_editBoxImpl != NULL)\n    {\n        _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, -_adjustHeight);\n    }\n}\n\nvoid EditBox::keyboardDidHide(IMEKeyboardNotificationInfo& info)\n{\n\t\n}\n\nvoid EditBox::registerScriptEditBoxHandler(int handler)\n{\n    unregisterScriptEditBoxHandler();\n    _scriptEditBoxHandler = handler;\n}\n\nvoid EditBox::unregisterScriptEditBoxHandler(void)\n{\n    if (0 != _scriptEditBoxHandler)\n    {\n        ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_scriptEditBoxHandler);\n        _scriptEditBoxHandler = 0;\n    }\n}\n\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBox.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEDITTEXT_H__\n#define __CCEDITTEXT_H__\n\n#include \"CCIMEDelegate.h\"\n#include \"extensions/ExtensionMacros.h\"\n#include \"../CCControlExtension/CCControlExtensions.h\"\n\nNS_CC_EXT_BEGIN\n\nclass EditBox;\nclass EditBoxImpl;\n\n\nclass EditBoxDelegate \n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBoxDelegate() {};\n    \n    /**\n     * This method is called when an edit box gains focus after keyboard is shown.\n     * @param editBox The edit box object that generated the event.\n     * @js NA\n     * @lua NA\n     */\n    virtual void editBoxEditingDidBegin(EditBox* editBox) {};\n    \n    \n    /**\n     * This method is called when an edit box loses focus after keyboard is hidden.\n     * @param editBox The edit box object that generated the event.\n     * @js NA\n     * @lua NA\n     */\n    virtual void editBoxEditingDidEnd(EditBox* editBox) {};\n    \n    /**\n     * This method is called when the edit box text was changed.\n     * @param editBox The edit box object that generated the event.\n     * @param text The new text.\n     * @js NA\n     * @lua NA\n     */\n    virtual void editBoxTextChanged(EditBox* editBox, const std::string& text) {};\n    \n    /**\n     * This method is called when the return button was pressed or the outside area of keyboard was touched.\n     * @param editBox The edit box object that generated the event.\n     * @js NA\n     * @lua NA\n     */\n    virtual void editBoxReturn(EditBox* editBox) = 0;\n    \n};\n\n/**\n * \\brief Class for edit box.\n *\n * You can use this widget to gather small amounts of text from the user.\n * \n */\n \nclass EditBox\n: public ControlButton\n, public IMEDelegate\n{\npublic:\n    enum class KeyboardReturnType\n    {\n        DEFAULT,\n        DONE,\n        SEND,\n        SEARCH,\n        GO\n    };\n    \n    /**\n     * \\brief The EditBox::InputMode defines the type of text that the user is allowed\n     * to enter.\n     */\n    enum class InputMode\n    {\n        /**\n         * The user is allowed to enter any text, including line breaks.\n         */\n        ANY,\n        \n        /**\n         * The user is allowed to enter an e-mail address.\n         */\n        EMAIL_ADDRESS,\n        \n        /**\n         * The user is allowed to enter an integer value.\n         */\n        NUMERIC,\n        \n        /**\n         * The user is allowed to enter a phone number.\n         */\n        PHONE_NUMBER,\n        \n        /**\n         * The user is allowed to enter a URL.\n         */\n        URL,\n        \n        /**\n         * The user is allowed to enter a real number value.\n         * This extends kEditBoxInputModeNumeric by allowing a decimal point.\n         */\n        DECIMAL,\n        \n        /**\n         * The user is allowed to enter any text, except for line breaks.\n         */\n        SINGLE_LINE,\n    };\n    \n    /**\n     * \\brief The EditBox::InputFlag defines how the input text is displayed/formatted.\n     */\n    enum class InputFlag\n    {\n        /**\n         * Indicates that the text entered is confidential data that should be\n         * obscured whenever possible. This implies EDIT_BOX_INPUT_FLAG_SENSITIVE.\n         */\n        PASSWORD,\n        \n        /**\n         * Indicates that the text entered is sensitive data that the\n         * implementation must never store into a dictionary or table for use\n         * in predictive, auto-completing, or other accelerated input schemes.\n         * A credit card number is an example of sensitive data.\n         */\n        SENSITIVE,\n        \n        /**\n         * This flag is a hint to the implementation that during text editing,\n         * the initial letter of each word should be capitalized.\n         */\n        INITIAL_CAPS_WORD,\n        \n        /**\n         * This flag is a hint to the implementation that during text editing,\n         * the initial letter of each sentence should be capitalized.\n         */\n        INITIAL_CAPS_SENTENCE,\n        \n        /**\n         * Capitalize all characters automatically.\n         */\n        INTIAL_CAPS_ALL_CHARACTERS,\n    };\n    \n    /**\n     * create a edit box with size.\n     * @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again.\n     */\n    static EditBox* create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg = NULL, Scale9Sprite* pDisabled9SpriteBg = NULL);\n\n    /**\n     * Constructor.\n     * @js ctor\n     */\n    EditBox(void);\n    \n    /**\n     * Destructor.\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBox(void);\n\n    /**\n     * Init edit box with specified size. This method should be invoked right after constructor.\n     * @param size The size of edit box.\n     */\n    bool initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pNormal9SpriteBg);\n    \n    /**\n     * Gets/Sets the delegate for edit box.\n     * @lua NA\n     */\n    void setDelegate(EditBoxDelegate* pDelegate);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    EditBoxDelegate* getDelegate();\n    /**\n     * Registers a script function that will be called for EditBox events.\n     *\n     * This handler will be removed automatically after onExit() called.\n     * @code\n     * -- lua sample\n     * local function editboxEventHandler(eventType)\n     *     if eventType == \"began\" then\n     *         -- triggered when an edit box gains focus after keyboard is shown\n     *     elseif eventType == \"ended\" then\n     *         -- triggered when an edit box loses focus after keyboard is hidden.\n     *     elseif eventType == \"changed\" then\n     *         -- triggered when the edit box text was changed.\n     *     elseif eventType == \"return\" then\n     *         -- triggered when the return button was pressed or the outside area of keyboard was touched.\n     *     end\n     * end\n     *\n     * local editbox = EditBox:create(Size(...), Scale9Sprite:create(...))\n     * editbox = registerScriptEditBoxHandler(editboxEventHandler)\n     * @endcode\n     *\n     * @param handler A number that indicates a lua function.\n     * @js NA\n     * @lua NA\n     */\n    void registerScriptEditBoxHandler(int handler);\n    \n    /**\n     * Unregisters a script function that will be called for EditBox events.\n     * @js NA\n     * @lua NA\n     */\n    void unregisterScriptEditBoxHandler(void);\n    /**\n     * get a script Handler\n     * @js NA\n     * @lua NA\n     */\n    int  getScriptEditBoxHandler(void){ return _scriptEditBoxHandler ;}\n    /**\n     * Set the text entered in the edit box.\n     * @param pText The given text.\n     */\n    void setText(const char* pText);\n    \n    /**\n     * Get the text entered in the edit box.\n     * @return The text entered in the edit box.\n     */\n    const char* getText(void);\n\t\n\t/**\n\t * Set the font.\n\t * @param pFontName The font name.\n\t * @param fontSize The font size.\n\t */\n\tvoid setFont(const char* pFontName, int fontSize);\n    \n\t/**\n\t * Set the font name.\n\t * @param pFontName The font name.\n\t */\n\tvoid setFontName(const char* pFontName);\n    \n    /**\n\t * Set the font size.\n\t * @param fontSize The font size.\n\t */\n\tvoid setFontSize(int fontSize);\n    \n    /**\n     * Set the font color of the widget's text.\n     */\n    void setFontColor(const Color3B& color);\n    \n\t/**\n\t * Set the placeholder's font.\n\t * @param pFontName The font name.\n\t * @param fontSize The font size.\n\t */\n\tvoid setPlaceholderFont(const char* pFontName, int fontSize);\n    \n    /**\n\t * Set the placeholder's font name.\n\t * @param pFontName The font name.\n\t */\n\tvoid setPlaceholderFontName(const char* pFontName);\n    \n    /**\n\t * Set the placeholder's font size.\n\t * @param fontSize The font size.\n\t */\n\tvoid setPlaceholderFontSize(int fontSize);\n    \n    /**\n     * Set the font color of the placeholder text when the edit box is empty.\n     * Not supported on IOS.\n     */\n    void setPlaceholderFontColor(const Color3B& color);\n    \n    /**\n     * Set a text in the edit box that acts as a placeholder when an\n     * edit box is empty.\n     * @param pText The given text.\n     */\n    void setPlaceHolder(const char* pText);\n    \n    /**\n     * Get a text in the edit box that acts as a placeholder when an\n     * edit box is empty.\n     */\n    const char* getPlaceHolder(void);\n    \n    /**\n     * Set the input mode of the edit box.\n     * @param inputMode One of the EditBox::InputMode constants.\n     */\n    void setInputMode(InputMode inputMode);\n    \n    /**\n     * Sets the maximum input length of the edit box.\n     * Setting this value enables multiline input mode by default.\n     * Available on Android, iOS and Windows Phone.\n     *\n     * @param maxLength The maximum length.\n     */\n    void setMaxLength(int maxLength);\n    \n    /**\n     * Gets the maximum input length of the edit box.\n     *\n     * @return Maximum input length.\n     */\n    int getMaxLength();\n    \n    /**\n     * Set the input flags that are to be applied to the edit box.\n     * @param inputFlag One of the EditBox::InputFlag constants.\n     */\n    void setInputFlag(InputFlag inputFlag);\n    \n    /**\n     * Set the return type that are to be applied to the edit box.\n     * @param returnType One of the EditBox::KeyboardReturnType constants.\n     */\n    void setReturnType(EditBox::KeyboardReturnType returnType);\n    \n    /* override functions */\n    virtual void setPosition(const Point& pos) override;\n    virtual void setVisible(bool visible) override;\n    virtual void setContentSize(const Size& size) override;\n\tvirtual void setAnchorPoint(const Point& anchorPoint) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit(void) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n\tvirtual void onEnter(void) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onExit(void) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardDidShow(IMEKeyboardNotificationInfo& info) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardWillHide(IMEKeyboardNotificationInfo& info) override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void keyboardDidHide(IMEKeyboardNotificationInfo& info) override;\n    \n    /* callback funtions\n     * @js NA\n     * @lua NA\n     */\n    void touchDownAction(Object *sender, Control::EventType controlEvent);\n    \nprotected:\n    EditBoxImpl*      _editBoxImpl;\n    EditBoxDelegate*  _delegate;\n    \n    InputMode    _editBoxInputMode;\n    InputFlag    _editBoxInputFlag;\n    EditBox::KeyboardReturnType  _keyboardReturnType;\n    \n    std::string _text;\n    std::string _placeHolder;\n    \n    std::string _fontName;\n    std::string _placeholderFontName;\n    \n    int _fontSize;\n    int _placeholderFontSize;\n    \n    Color3B _colText;\n    Color3B _colPlaceHolder;\n    \n    int   _maxLength;\n    float _adjustHeight;\n    int   _scriptEditBoxHandler;\n};\n\nNS_CC_EXT_END\n\n#endif /* __CCEDITTEXT_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImpl.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEditBoxIMPL_H__\n#define __CCEditBoxIMPL_H__\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCEditBox.h\"\n\nNS_CC_EXT_BEGIN\n\n\nclass EditBoxImpl\n{\npublic:\n    /**\n     * @js NA\n     */\n    EditBoxImpl(EditBox* pEditBox) : _delegate(NULL),_editBox(pEditBox) {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBoxImpl() {}\n    \n    virtual bool initWithSize(const Size& size) = 0;\n    virtual void setFont(const char* pFontName, int fontSize) = 0;\n    virtual void setFontColor(const Color3B& color) = 0;\n    virtual void setPlaceholderFont(const char* pFontName, int fontSize) = 0;\n    virtual void setPlaceholderFontColor(const Color3B& color) = 0;\n    virtual void setInputMode(EditBox::InputMode inputMode) = 0;\n    virtual void setInputFlag(EditBox::InputFlag inputFlag) = 0;\n    virtual void setMaxLength(int maxLength) = 0;\n    virtual int  getMaxLength() = 0;\n    virtual void setReturnType(EditBox::KeyboardReturnType returnType) = 0;\n    virtual bool isEditing() = 0;\n    \n    virtual void setText(const char* pText) = 0;\n    virtual const char* getText(void) = 0;\n    virtual void setPlaceHolder(const char* pText) = 0;\n    virtual void doAnimationWhenKeyboardMove(float duration, float distance) = 0;\n    \n    virtual void openKeyboard() = 0;\n    virtual void closeKeyboard() = 0;\n    \n    virtual void setPosition(const Point& pos) = 0;\n    virtual void setVisible(bool visible) = 0;\n    virtual void setContentSize(const Size& size) = 0;\n\tvirtual void setAnchorPoint(const Point& anchorPoint) = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit(void) = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter(void) = 0;\n    \n    \n    void setDelegate(EditBoxDelegate* pDelegate) { _delegate = pDelegate; };\n    EditBoxDelegate* getDelegate() { return _delegate; };\n    EditBox* getEditBox() { return _editBox; };\nprotected:\n    EditBoxDelegate* _delegate;\n    EditBox* _editBox;\n};\n\n// This method must be implemented at each subclass of EditBoxImpl.\nextern EditBoxImpl* __createSystemEditBox(EditBox* pEditBox);\n\n\nNS_CC_EXT_END\n\n#endif /* __CCEditBoxIMPL_H__ */\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEditBoxImplAndroid.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n\n#include \"CCEditBox.h\"\n#include \"jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h\"\n#include \"jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\"\n\n\nNS_CC_EXT_BEGIN\n\nEditBoxImpl* __createSystemEditBox(EditBox* pEditBox)\n{\n    return new EditBoxImplAndroid(pEditBox);\n}\n\nEditBoxImplAndroid::EditBoxImplAndroid(EditBox* pEditText)\n: EditBoxImpl(pEditText)\n, _label(NULL)\n, _labelPlaceHolder(NULL)\n, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE)\n, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS)\n, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT)\n, _colText(Color3B::WHITE)\n, _colPlaceHolder(Color3B::GRAY)\n, _maxLength(-1)\n{\n    \n}\n\nEditBoxImplAndroid::~EditBoxImplAndroid()\n{\n\t\n}\n\nvoid EditBoxImplAndroid::doAnimationWhenKeyboardMove(float duration, float distance)\n{ // don't need to be implemented on android platform.\n\t\n}\n\nstatic const int CC_EDIT_BOX_PADDING = 5;\n\nbool EditBoxImplAndroid::initWithSize(const Size& size)\n{\n    int fontSize = getFontSizeAccordingHeightJni(size.height-12);\n    _label = LabelTTF::create(\"\", \"\", size.height-12);\n\t// align the text vertically center\n    _label->setAnchorPoint(Point(0, 0.5f));\n    _label->setPosition(Point(CC_EDIT_BOX_PADDING, size.height / 2.0f));\n    _label->setColor(_colText);\n    _editBox->addChild(_label);\n\t\n    _labelPlaceHolder = LabelTTF::create(\"\", \"\", size.height-12);\n\t// align the text vertically center\n    _labelPlaceHolder->setAnchorPoint(Point(0, 0.5f));\n    _labelPlaceHolder->setPosition(Point(CC_EDIT_BOX_PADDING, size.height / 2.0f));\n    _labelPlaceHolder->setVisible(false);\n    _labelPlaceHolder->setColor(_colPlaceHolder);\n    _editBox->addChild(_labelPlaceHolder);\n    \n    _editSize = size;\n    return true;\n}\n\nvoid EditBoxImplAndroid::setFont(const char* pFontName, int fontSize)\n{\n\tif(_label != NULL) {\n\t\t_label->setFontName(pFontName);\n\t\t_label->setFontSize(fontSize);\n\t}\n\t\n\tif(_labelPlaceHolder != NULL) {\n\t\t_labelPlaceHolder->setFontName(pFontName);\n\t\t_labelPlaceHolder->setFontSize(fontSize);\n\t}\n}\n\nvoid EditBoxImplAndroid::setFontColor(const Color3B& color)\n{\n    _colText = color;\n    _label->setColor(color);\n}\n\nvoid EditBoxImplAndroid::setPlaceholderFont(const char* pFontName, int fontSize)\n{\n\tif(_labelPlaceHolder != NULL) {\n\t\t_labelPlaceHolder->setFontName(pFontName);\n\t\t_labelPlaceHolder->setFontSize(fontSize);\n\t}\n}\n\nvoid EditBoxImplAndroid::setPlaceholderFontColor(const Color3B& color)\n{\n    _colPlaceHolder = color;\n    _labelPlaceHolder->setColor(color);\n}\n\nvoid EditBoxImplAndroid::setInputMode(EditBox::InputMode inputMode)\n{\n    _editBoxInputMode = inputMode;\n}\n\nvoid EditBoxImplAndroid::setMaxLength(int maxLength)\n{\n    _maxLength = maxLength;\n}\n\nint EditBoxImplAndroid::getMaxLength()\n{\n    return _maxLength;\n}\n\nvoid EditBoxImplAndroid::setInputFlag(EditBox::InputFlag inputFlag)\n{\n    _editBoxInputFlag = inputFlag;\n}\n\nvoid EditBoxImplAndroid::setReturnType(EditBox::KeyboardReturnType returnType)\n{\n    _keyboardReturnType = returnType;\n}\n\nbool EditBoxImplAndroid::isEditing()\n{\n    return false;\n}\n\nvoid EditBoxImplAndroid::setText(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _text = pText;\n\t\t\n        if (_text.length() > 0)\n        {\n            _labelPlaceHolder->setVisible(false);\n\t\t\t\n            std::string strToShow;\n\t\t\t\n            if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag)\n            {\n                long length = cc_utf8_strlen(_text.c_str(), -1);\n                for (long i = 0; i < length; i++)\n                {\n                    strToShow.append(\"\\u25CF\");\n                }\n            }\n            else\n            {\n                strToShow = _text;\n            }\n\n\t\t\t_label->setString(strToShow.c_str());\n\n\t\t\t// Clip the text width to fit to the text box\n\t\t\tfloat fMaxWidth = _editSize.width - CC_EDIT_BOX_PADDING * 2;\n\t\t\tRect clippingRect = _label->getTextureRect();\n\t\t\tif(clippingRect.size.width > fMaxWidth) {\n\t\t\t\tclippingRect.size.width = fMaxWidth;\n\t\t\t\t_label->setTextureRect(clippingRect);\n\t\t\t}\n\n        }\n        else\n        {\n            _labelPlaceHolder->setVisible(true);\n            _label->setString(\"\");\n        }\n\t\t\n    }\n}\n\nconst char*  EditBoxImplAndroid::getText(void)\n{\n    return _text.c_str();\n}\n\nvoid EditBoxImplAndroid::setPlaceHolder(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _placeHolder = pText;\n        if (_placeHolder.length() > 0 && _text.length() == 0)\n        {\n            _labelPlaceHolder->setVisible(true);\n        }\n\t\t\n        _labelPlaceHolder->setString(_placeHolder.c_str());\n    }\n}\n\nvoid EditBoxImplAndroid::setPosition(const Point& pos)\n{ // don't need to be implemented on android platform.\n\t\n}\n\nvoid EditBoxImplAndroid::setVisible(bool visible)\n{ // don't need to be implemented on android platform.\n\n}\n\nvoid EditBoxImplAndroid::setContentSize(const Size& size)\n{ // don't need to be implemented on android platform.\n\t\n}\n\nvoid EditBoxImplAndroid::setAnchorPoint(const Point& anchorPoint)\n{ // don't need to be implemented on android platform.\n\t\n}\n\nvoid EditBoxImplAndroid::visit(void)\n{ // don't need to be implemented on android platform.\n    \n}\n\nvoid EditBoxImplAndroid::onEnter(void)\n{ // don't need to be implemented on android platform.\n    \n}\n\nstatic void editBoxCallbackFunc(const char* pText, void* ctx)\n{\n    EditBoxImplAndroid* thiz = (EditBoxImplAndroid*)ctx;\n    thiz->setText(pText);\n\t\n    if (thiz->getDelegate() != NULL)\n    {\n        thiz->getDelegate()->editBoxTextChanged(thiz->getEditBox(), thiz->getText());\n        thiz->getDelegate()->editBoxEditingDidEnd(thiz->getEditBox());\n        thiz->getDelegate()->editBoxReturn(thiz->getEditBox());\n    }\n    \n    EditBox* pEditBox = thiz->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {        \n        CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"changed\",pEditBox);\n        ScriptEvent event(kCommonEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"ended\",64);\n        event.data = (void*)&data;\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"return\",64);\n        event.data = (void*)&data;\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n}\n\nvoid EditBoxImplAndroid::openKeyboard()\n{\n    if (_delegate != NULL)\n    {\n        _delegate->editBoxEditingDidBegin(_editBox);\n    }\n    EditBox* pEditBox = this->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {        \n        CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"began\",pEditBox);\n        ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n\t\n    showEditTextDialogJNI(  _placeHolder.c_str(),\n\t\t\t\t\t\t  _text.c_str(),\n\t\t\t\t\t\t  (int)_editBoxInputMode,\n\t\t\t\t\t\t  (int)_editBoxInputFlag,\n\t\t\t\t\t\t  (int)_keyboardReturnType,\n\t\t\t\t\t\t  _maxLength,\n\t\t\t\t\t\t  editBoxCallbackFunc,\n\t\t\t\t\t\t  (void*)this  );\n\t\n}\n\nvoid EditBoxImplAndroid::closeKeyboard()\n{\n\t\n}\n\nNS_CC_EXT_END\n\n#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEDITBOXIMPLANDROID_H__\n#define __CCEDITBOXIMPLANDROID_H__\n\n#include \"cocos2d.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCEditBoxImpl.h\"\n\nNS_CC_EXT_BEGIN\n\nclass EditBox;\n\nclass EditBoxImplAndroid : public EditBoxImpl\n{\npublic:\n    /**\n     * @js NA\n     */\n    EditBoxImplAndroid(EditBox* pEditText);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBoxImplAndroid();\n    \n    virtual bool initWithSize(const Size& size);\n    virtual void setFont(const char* pFontName, int fontSize);\n    virtual void setFontColor(const Color3B& color);\n    virtual void setPlaceholderFont(const char* pFontName, int fontSize);\n    virtual void setPlaceholderFontColor(const Color3B& color);\n    virtual void setInputMode(EditBox::InputMode inputMode);\n    virtual void setInputFlag(EditBox::InputFlag inputFlag);\n    virtual void setMaxLength(int maxLength);\n    virtual int  getMaxLength();\n    virtual void setReturnType(EditBox::KeyboardReturnType returnType);\n    virtual bool isEditing();\n    \n    virtual void setText(const char* pText);\n    virtual const char* getText(void);\n    virtual void setPlaceHolder(const char* pText);\n    virtual void setPosition(const Point& pos);\n    virtual void setVisible(bool visible);\n    virtual void setContentSize(const Size& size);\n\tvirtual void setAnchorPoint(const Point& anchorPoint);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n\tvirtual void onEnter(void);\n    virtual void doAnimationWhenKeyboardMove(float duration, float distance);\n    virtual void openKeyboard();\n    virtual void closeKeyboard();\n    \nprivate:\n    LabelTTF* _label;\n    LabelTTF* _labelPlaceHolder;\n    EditBox::InputMode    _editBoxInputMode;\n    EditBox::InputFlag    _editBoxInputFlag;\n    EditBox::KeyboardReturnType  _keyboardReturnType;\n    \n    std::string _text;\n    std::string _placeHolder;\n    \n    Color3B _colText;\n    Color3B _colPlaceHolder;\n\n    int   _maxLength;\n    Size _editSize;\n};\n\n\nNS_CC_EXT_END\n\n#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */\n\n#endif /* __CCEDITBOXIMPLANDROID_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEditBoxIMPLIOS_H__\n#define __CCEditBoxIMPLIOS_H__\n\n#include \"cocos2d.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCEditBoxImpl.h\"\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n\n@interface CCCustomUITextField : UITextField\n{\n}\n\n@end\n\n\n@interface CCEditBoxImplIOS_objc : NSObject <UITextFieldDelegate>\n{\n    CCCustomUITextField* textField_;\n    void* editBox_;\n    BOOL editState_;\n}\n\n@property(nonatomic, retain) UITextField* textField;\n@property(nonatomic, readonly, getter = isEditState) BOOL editState;\n@property(nonatomic, assign) void* editBox;\n\n-(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox;\n-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance;\n-(void) setPosition:(CGPoint) pos;\n-(void) setContentSize:(CGSize) size;\n-(void) visit;\n-(void) openKeyboard;\n-(void) closeKeyboard;\n\n@end\n\nNS_CC_EXT_BEGIN\n\nclass EditBox;\n\nclass EditBoxImplIOS : public EditBoxImpl\n{\npublic:\n    /**\n     * @js NA\n     */\n    EditBoxImplIOS(EditBox* pEditText);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBoxImplIOS();\n    \n    virtual bool initWithSize(const Size& size);\n    virtual void setFont(const char* pFontName, int fontSize);\n    virtual void setFontColor(const Color3B& color);\n    virtual void setPlaceholderFont(const char* pFontName, int fontSize);\n    virtual void setPlaceholderFontColor(const Color3B& color);\n    virtual void setInputMode(EditBox::InputMode inputMode);\n    virtual void setInputFlag(EditBox::InputFlag inputFlag);\n    virtual void setMaxLength(int maxLength);\n    virtual int  getMaxLength();\n    virtual void setReturnType(EditBox::KeyboardReturnType returnType);\n    virtual bool isEditing();\n    \n    virtual void setText(const char* pText);\n    virtual const char* getText(void);\n    virtual void setPlaceHolder(const char* pText);\n    virtual void setPosition(const Point& pos);\n    virtual void setVisible(bool visible);\n    virtual void setContentSize(const Size& size);\n\tvirtual void setAnchorPoint(const Point& anchorPoint);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n\tvirtual void onEnter(void);\n    virtual void doAnimationWhenKeyboardMove(float duration, float distance);\n    virtual void openKeyboard();\n    virtual void closeKeyboard();\n\t\n\tvirtual void onEndEditing();\n    \nprivate:\n\tvoid\t\t\tinitInactiveLabels(const Size& size);\n\tvoid\t\t\tsetInactiveText(const char* pText);\n\tvoid\t\t\tadjustTextFieldPosition();\n    void            placeInactiveLabels();\n\t\n    LabelTTF*     _label;\n    LabelTTF*     _labelPlaceHolder;\n    Size          _contentSize;\n    Point         _position;\n    Point         _anchorPoint;\n    CCEditBoxImplIOS_objc* _systemControl;\n    int             _maxTextLength;\n    bool            _inRetinaMode;\n};\n\n\nNS_CC_EXT_END\n\n\n#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */\n\n#endif /* __CCEditBoxIMPLIOS_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"CCEditBoxImplIOS.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n\n#define kLabelZOrder  9999\n\n#include \"CCEditBox.h\"\n#import \"EAGLView.h\"\n\n#define getEditBoxImplIOS() ((cocos2d::extension::EditBoxImplIOS*)editBox_)\n\nstatic const int CC_EDIT_BOX_PADDING = 5;\n\n@implementation CCCustomUITextField\n- (CGRect)textRectForBounds:(CGRect)bounds {\n    float padding = CC_EDIT_BOX_PADDING * cocos2d::EGLView::getInstance()->getScaleX() / [[CCEAGLView sharedEGLView] contentScaleFactor ];\n    return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding,\n                      bounds.size.width - padding*2, bounds.size.height - padding*2);\n}\n- (CGRect)editingRectForBounds:(CGRect)bounds {\n    return [self textRectForBounds:bounds];\n}\n@end\n\n\n@implementation CCEditBoxImplIOS_objc\n\n@synthesize textField = textField_;\n@synthesize editState = editState_;\n@synthesize editBox = editBox_;\n\n- (void)dealloc\n{\n    [textField_ resignFirstResponder];\n    [textField_ removeFromSuperview];\n    self.textField = NULL;\n    [super dealloc];\n}\n\n-(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox\n{\n    self = [super init];\n    \n    do\n    {\n        if (self == nil) break;\n        editState_ = NO;\n        self.textField = [[[CCCustomUITextField alloc] initWithFrame: frameRect] autorelease];\n        if (!textField_) break;\n        [textField_ setTextColor:[UIColor whiteColor]];\n        textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here.\n\t\ttextField_.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;\n        textField_.backgroundColor = [UIColor clearColor];\n        textField_.borderStyle = UITextBorderStyleNone;\n        textField_.delegate = self;\n        textField_.hidden = true;\n\t\ttextField_.returnKeyType = UIReturnKeyDefault;\n        [textField_ addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged];\n        self.editBox = editBox;\n        \n\t\t\n        \n        return self;\n    }while(0);\n    \n    return nil;\n}\n\n-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance\n{\n    id eglView = [CCEAGLView sharedEGLView];\n    [eglView doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];\n}\n\n-(void) setPosition:(CGPoint) pos\n{\n    CGRect frame = [textField_ frame];\n    frame.origin = pos;\n    [textField_ setFrame:frame];\n}\n\n-(void) setContentSize:(CGSize) size\n{\n    CGRect frame = [textField_ frame];\n    frame.size = size;\n    [textField_ setFrame:frame];\n}\n\n-(void) visit\n{\n    \n}\n\n-(void) openKeyboard\n{\n    [[CCEAGLView sharedEGLView] addSubview:textField_];\n    [textField_ becomeFirstResponder];\n}\n\n-(void) closeKeyboard\n{\n    [textField_ resignFirstResponder];\n    [textField_ removeFromSuperview];\n}\n\n- (BOOL)textFieldShouldReturn:(UITextField *)sender\n{\n    if (sender == textField_) {\n        [sender resignFirstResponder];\n    }\n    return NO;\n}\n\n-(void)animationSelector\n{\n    id eglView = [CCEAGLView sharedEGLView];\n    [eglView doAnimationWhenAnotherEditBeClicked];\n}\n\n- (BOOL)textFieldShouldBeginEditing:(UITextField *)sender        // return NO to disallow editing.\n{\n    CCLOG(\"textFieldShouldBeginEditing...\");\n    editState_ = YES;\n    id eglView = [CCEAGLView sharedEGLView];\n    if ([eglView isKeyboardShown])\n    {\n        [self performSelector:@selector(animationSelector) withObject:nil afterDelay:0.0f];\n    }\n    cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate();\n    if (pDelegate != NULL)\n    {\n        pDelegate->editBoxEditingDidBegin(getEditBoxImplIOS()->getEditBox());\n    }\n    \n    cocos2d::extension::EditBox*  pEditBox= getEditBoxImplIOS()->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {        \n        cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"began\",pEditBox);\n        cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n    return YES;\n}\n\n- (BOOL)textFieldShouldEndEditing:(UITextField *)sender\n{\n    CCLOG(\"textFieldShouldEndEditing...\");\n    editState_ = NO;\n    getEditBoxImplIOS()->setText(getEditBoxImplIOS()->getText());\n    \n    cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate();\n    if (pDelegate != NULL)\n    {\n        pDelegate->editBoxEditingDidEnd(getEditBoxImplIOS()->getEditBox());\n        pDelegate->editBoxReturn(getEditBoxImplIOS()->getEditBox());\n    }\n    \n    cocos2d::extension::EditBox*  pEditBox= getEditBoxImplIOS()->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"ended\",pEditBox);\n        cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"return\",64);\n        event.data = (void*)&data;\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n\t\n\tif(editBox_ != nil)\n\t{\n\t\tgetEditBoxImplIOS()->onEndEditing();\n\t}\n    return YES;\n}\n\n/**\n * Delegate method called before the text has been changed.\n * @param textField The text field containing the text.\n * @param range The range of characters to be replaced.\n * @param string The replacement string.\n * @return YES if the specified text range should be replaced; otherwise, NO to keep the old text.\n */\n- (BOOL)textField:(UITextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string\n{\n    if (getEditBoxImplIOS()->getMaxLength() < 0)\n    {\n        return YES;\n    }\n    \n    NSUInteger oldLength = [textField.text length];\n    NSUInteger replacementLength = [string length];\n    NSUInteger rangeLength = range.length;\n    \n    NSUInteger newLength = oldLength - rangeLength + replacementLength;\n    \n    return newLength <= getEditBoxImplIOS()->getMaxLength();\n}\n\n/**\n * Called each time when the text field's text has changed.\n */\n- (void) textChanged\n{\n    // NSLog(@\"text is %@\", self.textField.text);\n    cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate();\n    if (pDelegate != NULL)\n    {\n        pDelegate->editBoxTextChanged(getEditBoxImplIOS()->getEditBox(), getEditBoxImplIOS()->getText());\n    }\n    \n    cocos2d::extension::EditBox*  pEditBox= getEditBoxImplIOS()->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"changed\",pEditBox);\n        cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n\n}\n\n@end\n\n\nNS_CC_EXT_BEGIN\n\nEditBoxImpl* __createSystemEditBox(EditBox* pEditBox)\n{\n    return new EditBoxImplIOS(pEditBox);\n}\n\nEditBoxImplIOS::EditBoxImplIOS(EditBox* pEditText)\n: EditBoxImpl(pEditText)\n, _label(NULL)\n, _labelPlaceHolder(NULL)\n, _anchorPoint(Point(0.5f, 0.5f))\n, _systemControl(NULL)\n, _maxTextLength(-1)\n{\n    _inRetinaMode = [[CCEAGLView sharedEGLView] contentScaleFactor] == 2.0f ? true : false;\n}\n\nEditBoxImplIOS::~EditBoxImplIOS()\n{\n    [_systemControl release];\n}\n\nvoid EditBoxImplIOS::doAnimationWhenKeyboardMove(float duration, float distance)\n{\n    if ([_systemControl isEditState] || distance < 0.0f)\n    {\n        [_systemControl doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];\n    }\n}\n\nbool EditBoxImplIOS::initWithSize(const Size& size)\n{\n    do \n    {\n        EGLViewProtocol* eglView = EGLView::getInstance();\n\n        CGRect rect = CGRectMake(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY());\n\n        if (_inRetinaMode)\n        {\n            rect.size.width /= 2.0f;\n            rect.size.height /= 2.0f;\n        }\n        \n        _systemControl = [[CCEditBoxImplIOS_objc alloc] initWithFrame:rect editBox:this];\n        if (!_systemControl) break;\n        \n\t\tinitInactiveLabels(size);\n        setContentSize(size);\n\t\t\n        return true;\n    }while (0);\n    \n    return false;\n}\n\nvoid EditBoxImplIOS::initInactiveLabels(const Size& size)\n{\n\tconst char* pDefaultFontName = [[_systemControl.textField.font fontName] UTF8String];\n\n\t_label = LabelTTF::create(\"\", \"\", 0.0f);\n    _label->setAnchorPoint(Point(0, 0.5f));\n    _label->setColor(Color3B::WHITE);\n    _label->setVisible(false);\n    _editBox->addChild(_label, kLabelZOrder);\n\t\n    _labelPlaceHolder = LabelTTF::create(\"\", \"\", 0.0f);\n\t// align the text vertically center\n    _labelPlaceHolder->setAnchorPoint(Point(0, 0.5f));\n    _labelPlaceHolder->setColor(Color3B::GRAY);\n    _editBox->addChild(_labelPlaceHolder, kLabelZOrder);\n    \n    setFont(pDefaultFontName, size.height*2/3);\n    setPlaceholderFont(pDefaultFontName, size.height*2/3);\n}\n\nvoid EditBoxImplIOS::placeInactiveLabels() {\n    _label->setPosition(Point(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f));\n    _labelPlaceHolder->setPosition(Point(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f));\n}\n\nvoid EditBoxImplIOS::setInactiveText(const char* pText)\n{\n\tif(_systemControl.textField.secureTextEntry == YES)\n\t{\n\t\tstd::string passwordString;\n\t\tfor(int i = 0; i < strlen(pText); ++i)\n\t\t\tpasswordString.append(\"\\u25CF\");\n\t\t_label->setString(passwordString.c_str());\n\t}\n\telse\n\t\t_label->setString(getText());\n\t\n\t// Clip the text width to fit to the text box\n\tfloat fMaxWidth = _editBox->getContentSize().width - CC_EDIT_BOX_PADDING * 2;\n\tRect clippingRect = _label->getTextureRect();\n\tif(clippingRect.size.width > fMaxWidth) {\n\t\tclippingRect.size.width = fMaxWidth;\n\t\t_label->setTextureRect(clippingRect);\n\t}\n}\n\nvoid EditBoxImplIOS::setFont(const char* pFontName, int fontSize)\n{\n    bool isValidFontName = true;\n\tif(pFontName == NULL || strlen(pFontName) == 0) {\n        isValidFontName = false;\n    }\n\n    float retinaFactor = _inRetinaMode ? 2.0f : 1.0f;\n\tNSString * fntName = [NSString stringWithUTF8String:pFontName];\n    float scaleFactor = EGLView::getInstance()->getScaleX();\n    UIFont *textFont = nil;\n    if (isValidFontName) {\n        textFont = [UIFont fontWithName:fntName size:fontSize * scaleFactor / retinaFactor];\n    }\n    \n    if (!isValidFontName || textFont == nil){\n        textFont = [UIFont systemFontOfSize:fontSize * scaleFactor / retinaFactor];\n    }\n\n\tif(textFont != nil) {\n\t\t[_systemControl.textField setFont:textFont];\n    }\n\n\t_label->setFontName(pFontName);\n\t_label->setFontSize(fontSize);\n\t_labelPlaceHolder->setFontName(pFontName);\n\t_labelPlaceHolder->setFontSize(fontSize);\n}\n\nvoid EditBoxImplIOS::setFontColor(const Color3B& color)\n{\n    _systemControl.textField.textColor = [UIColor colorWithRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f];\n\t_label->setColor(color);\n}\n\nvoid EditBoxImplIOS::setPlaceholderFont(const char* pFontName, int fontSize)\n{\n\t// TODO need to be implemented.\n}\n\nvoid EditBoxImplIOS::setPlaceholderFontColor(const Color3B& color)\n{\n\t_labelPlaceHolder->setColor(color);\n}\n\nvoid EditBoxImplIOS::setInputMode(EditBox::InputMode inputMode)\n{\n    // FIX ME: this is a temporary fix for issue #2920: IPA packed by Xcode5 may crash on iOS7 when switching to voice recognition input method.\n    // This temporary fix is only for ios version aboves 7.0.\n    // I don't know how to fix it, so I changed the keyboard type to hide the dictation button to avoid crash.\n    // Issue #2920 url: http://www.cocos2d-x.org/issues/2920\n    Boolean above7 = NO;\n    NSString *currSysVer = [[UIDevice currentDevice] systemVersion];\n    \n    if ([currSysVer compare:@\"7\" options:NSNumericSearch range:NSMakeRange(0, 1)] == 0)\n    {\n        above7 = YES;\n    }\n    \n    switch (inputMode)\n    {\n        case EditBox::InputMode::EMAIL_ADDRESS:\n            _systemControl.textField.keyboardType = UIKeyboardTypeEmailAddress;\n            break;\n        case EditBox::InputMode::NUMERIC:\n            _systemControl.textField.keyboardType = (above7 ? UIKeyboardTypeDecimalPad : UIKeyboardTypeNumberPad);\n            break;\n        case EditBox::InputMode::PHONE_NUMBER:\n            _systemControl.textField.keyboardType = UIKeyboardTypePhonePad;\n            break;\n        case EditBox::InputMode::URL:\n            _systemControl.textField.keyboardType = UIKeyboardTypeURL;\n            break;\n        case EditBox::InputMode::DECIMAL:\n            _systemControl.textField.keyboardType = UIKeyboardTypeDecimalPad;\n            break;\n        case EditBox::InputMode::SINGLE_LINE:\n            _systemControl.textField.keyboardType = (above7 ? UIKeyboardTypeEmailAddress : UIKeyboardTypeDefault);\n            break;\n        default:\n            _systemControl.textField.keyboardType = (above7 ? UIKeyboardTypeEmailAddress : UIKeyboardTypeDefault);\n            break;\n    }\n}\n\nvoid EditBoxImplIOS::setMaxLength(int maxLength)\n{\n    _maxTextLength = maxLength;\n}\n\nint EditBoxImplIOS::getMaxLength()\n{\n    return _maxTextLength;\n}\n\nvoid EditBoxImplIOS::setInputFlag(EditBox::InputFlag inputFlag)\n{\n    switch (inputFlag)\n    {\n        case EditBox::InputFlag::PASSWORD:\n            _systemControl.textField.secureTextEntry = YES;\n            break;\n        case EditBox::InputFlag::INITIAL_CAPS_WORD:\n            _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeWords;\n            break;\n        case EditBox::InputFlag::INITIAL_CAPS_SENTENCE:\n            _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeSentences;\n            break;\n        case EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS:\n            _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;\n            break;\n        case EditBox::InputFlag::SENSITIVE:\n            _systemControl.textField.autocorrectionType = UITextAutocorrectionTypeNo;\n            break;\n        default:\n            break;\n    }\n}\n\nvoid EditBoxImplIOS::setReturnType(EditBox::KeyboardReturnType returnType)\n{\n    switch (returnType) {\n        case EditBox::KeyboardReturnType::DEFAULT:\n            _systemControl.textField.returnKeyType = UIReturnKeyDefault;\n            break;\n        case EditBox::KeyboardReturnType::DONE:\n            _systemControl.textField.returnKeyType = UIReturnKeyDone;\n            break;\n        case EditBox::KeyboardReturnType::SEND:\n            _systemControl.textField.returnKeyType = UIReturnKeySend;\n            break;\n        case EditBox::KeyboardReturnType::SEARCH:\n            _systemControl.textField.returnKeyType = UIReturnKeySearch;\n            break;\n        case EditBox::KeyboardReturnType::GO:\n            _systemControl.textField.returnKeyType = UIReturnKeyGo;\n            break;\n        default:\n            _systemControl.textField.returnKeyType = UIReturnKeyDefault;\n            break;\n    }\n}\n\nbool EditBoxImplIOS::isEditing()\n{\n    return [_systemControl isEditState] ? true : false;\n}\n\nvoid EditBoxImplIOS::setText(const char* pText)\n{\n    _systemControl.textField.text = [NSString stringWithUTF8String:pText];\n\tif(_systemControl.textField.hidden == YES) {\n\t\tsetInactiveText(pText);\n\t\tif(strlen(pText) == 0)\n\t\t{\n\t\t\t_label->setVisible(false);\n\t\t\t_labelPlaceHolder->setVisible(true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_label->setVisible(true);\n\t\t\t_labelPlaceHolder->setVisible(false);\n\t\t}\n\t}\n}\n\nconst char*  EditBoxImplIOS::getText(void)\n{\n    return [_systemControl.textField.text UTF8String];\n}\n\nvoid EditBoxImplIOS::setPlaceHolder(const char* pText)\n{\n    _systemControl.textField.placeholder = [NSString stringWithUTF8String:pText];\n\t_labelPlaceHolder->setString(pText);\n}\n\nstatic CGPoint convertDesignCoordToScreenCoord(const Point& designCoord, bool bInRetinaMode)\n{\n    EGLViewProtocol* eglView = EGLView::getInstance();\n    float viewH = (float)[[CCEAGLView sharedEGLView] getHeight];\n    \n    Point visiblePos = Point(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY());\n    Point screenGLPos = visiblePos + eglView->getViewPortRect().origin;\n    \n    CGPoint screenPos = CGPointMake(screenGLPos.x, viewH - screenGLPos.y);\n    \n    if (bInRetinaMode)\n    {\n        screenPos.x = screenPos.x / 2.0f;\n        screenPos.y = screenPos.y / 2.0f;\n    }\n    CCLOG(\"[EditBox] pos x = %f, y = %f\", screenGLPos.x, screenGLPos.y);\n    return screenPos;\n}\n\nvoid EditBoxImplIOS::setPosition(const Point& pos)\n{\n\t_position = pos;\n\tadjustTextFieldPosition();\n}\n\nvoid EditBoxImplIOS::setVisible(bool visible)\n{\n//    _systemControl.textField.hidden = !visible;\n}\n\nvoid EditBoxImplIOS::setContentSize(const Size& size)\n{\n    _contentSize = size;\n    CCLOG(\"[Edit text] content size = (%f, %f)\", size.width, size.height);\n    placeInactiveLabels();\n    EGLViewProtocol* eglView = EGLView::getInstance();\n    CGSize controlSize = CGSizeMake(size.width * eglView->getScaleX(),size.height * eglView->getScaleY());\n    \n    if (_inRetinaMode)\n    {\n        controlSize.width /= 2.0f;\n        controlSize.height /= 2.0f;\n    }\n    [_systemControl setContentSize:controlSize];\n}\n\nvoid EditBoxImplIOS::setAnchorPoint(const Point& anchorPoint)\n{\n    CCLOG(\"[Edit text] anchor point = (%f, %f)\", anchorPoint.x, anchorPoint.y);\n\t_anchorPoint = anchorPoint;\n\tsetPosition(_position);\n}\n\nvoid EditBoxImplIOS::visit(void)\n{\n    \n}\n\nvoid EditBoxImplIOS::onEnter(void)\n{\n    adjustTextFieldPosition();\n    const char* pText = getText();\n    if (pText) {\n        setInactiveText(pText);\n    }\n}\n\nvoid EditBoxImplIOS::adjustTextFieldPosition()\n{\n\tSize contentSize = _editBox->getContentSize();\n\tRect rect = Rect(0, 0, contentSize.width, contentSize.height);\n    rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform());\n\t\n\tPoint designCoord = Point(rect.origin.x, rect.origin.y + rect.size.height);\n    [_systemControl setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)];\n}\n\nvoid EditBoxImplIOS::openKeyboard()\n{\n\t_label->setVisible(false);\n\t_labelPlaceHolder->setVisible(false);\n\n\t_systemControl.textField.hidden = NO;\n    [_systemControl openKeyboard];\n}\n\nvoid EditBoxImplIOS::closeKeyboard()\n{\n    [_systemControl closeKeyboard];\n}\n\nvoid EditBoxImplIOS::onEndEditing()\n{\n\t_systemControl.textField.hidden = YES;\n\tif(strlen(getText()) == 0)\n\t{\n\t\t_label->setVisible(false);\n\t\t_labelPlaceHolder->setVisible(true);\n\t}\n\telse\n\t{\n\t\t_label->setVisible(true);\n\t\t_labelPlaceHolder->setVisible(false);\n\t\tsetInactiveText(getText());\n\t}\n}\n\nNS_CC_EXT_END\n\n#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */\n\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplMac.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 Jozef Pridavok\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEditBoxIMPLMAC_H__\n#define __CCEditBoxIMPLMAC_H__\n\n#include \"cocos2d.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n\n#import <Foundation/Foundation.h>\n#import <AppKit/AppKit.h>\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCEditBoxImpl.h\"\n\n@interface CCCustomNSTextField : NSTextField\n{\n}\n\n@end\n\n@interface CCEditBoxImplMac : NSObject <NSTextFieldDelegate>\n{\n    CCCustomNSTextField* textField_;\n    void* editBox_;\n    BOOL editState_;\n}\n\n@property(nonatomic, retain) NSTextField* textField;\n@property(nonatomic, readonly, getter = isEditState) BOOL editState;\n@property(nonatomic, assign) void* editBox;\n\n-(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox;\n-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance;\n-(void) setPosition:(NSPoint) pos;\n-(void) setContentSize:(NSSize) size;\n-(void) visit;\n-(void) openKeyboard;\n-(void) closeKeyboard;\n\n@end\n\nNS_CC_EXT_BEGIN\n\nclass EditBox;\n\nclass EditBoxImplMac : public EditBoxImpl\n{\npublic:\n    /**\n     * @js NA\n     */\n    EditBoxImplMac(EditBox* pEditText);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBoxImplMac();\n    \n    virtual bool initWithSize(const Size& size);\n    virtual void setFont(const char* pFontName, int fontSize);\n    virtual void setFontColor(const Color3B& color);\n    virtual void setPlaceholderFont(const char* pFontName, int fontSize);\n    virtual void setPlaceholderFontColor(const Color3B& color);\n    virtual void setInputMode(EditBox::InputMode inputMode);\n    virtual void setInputFlag(EditBox::InputFlag inputFlag);\n    virtual void setMaxLength(int maxLength);\n    virtual int  getMaxLength();\n    virtual void setReturnType(EditBox::KeyboardReturnType returnType);\n    virtual bool isEditing();\n    \n    virtual void setText(const char* pText);\n    virtual const char* getText(void);\n    virtual void setPlaceHolder(const char* pText);\n    virtual void setPosition(const Point& pos);\n    virtual void setVisible(bool visible);\n    virtual void setContentSize(const Size& size);\n    virtual void setAnchorPoint(const Point& anchorPoint);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit(void);\n    virtual void doAnimationWhenKeyboardMove(float duration, float distance);\n    virtual void openKeyboard();\n    virtual void closeKeyboard();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter(void);\nprivate:\n    NSPoint    convertDesignCoordToScreenCoord(const Point& designCoord, bool bInRetinaMode);\n    void       adjustTextFieldPosition();\n    Size     _contentSize;\n    Point    _position;\n    Point    _anchorPoint;\n    int        _maxTextLength;\n    bool       _inRetinaMode;\n    CCEditBoxImplMac*  _sysEdit;\n};\n\n\nNS_CC_EXT_END\n\n#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n\n#endif /* __CCEditBoxIMPLMAC_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 Jozef Pridavok\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEditBoxImplMac.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n\n#include \"CCEditBox.h\"\n#define GLFW_EXPOSE_NATIVE_NSGL\n#define GLFW_EXPOSE_NATIVE_COCOA\n#include \"glfw3native.h\"\n\n\n#define getEditBoxImplMac() ((cocos2d::extension::EditBoxImplMac*)editBox_)\n\n\n\n@implementation CCCustomNSTextField\n\n- (CGRect)textRectForBounds:(CGRect)bounds {\n    float padding = 5.0f;\n    return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding,\n                      bounds.size.width - padding*2, bounds.size.height - padding*2);\n}\n- (CGRect)editingRectForBounds:(CGRect)bounds {\n    return [self textRectForBounds:bounds];\n}\n\n- (void)setup {\n    [self setBordered:NO];\n    [self setHidden:NO];\n    [self setWantsLayer:YES];\n}\n\n@end\n\n\n@implementation CCEditBoxImplMac\n\n@synthesize textField = textField_;\n@synthesize editState = editState_;\n@synthesize editBox = editBox_;\n\n- (id) getNSWindow {\n    return glfwGetCocoaWindow(cocos2d::EGLView::getInstance()->getWindow());\n}\n\n- (void)dealloc\n{\n    [textField_ resignFirstResponder];\n    [textField_ removeFromSuperview];\n    self.textField = NULL;\n    [super dealloc];\n}\n\n-(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox\n{\n    self = [super init];\n    \n    do\n    {\n        if (self == nil) break;\n        editState_ = NO;\n        self.textField = [[[CCCustomNSTextField alloc] initWithFrame: frameRect] autorelease];\n        if (!textField_) break;\n        [textField_ setTextColor:[NSColor whiteColor]];\n        textField_.font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here.\n        textField_.backgroundColor = [NSColor clearColor];\n        [textField_ setup];\n        textField_.delegate = self;\n        [textField_ setDelegate:self];\n        self.editBox = editBox;\n        \n        [[[self getNSWindow] contentView] addSubview:textField_];\n        \n        return self;\n    }while(0);\n    \n    return nil;\n}\n\n-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance\n{\n    [[[self getNSWindow] contentView] doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];\n}\n\n-(void) setPosition:(NSPoint) pos\n{\n    NSRect frame = [textField_ frame];\n    frame.origin = pos;\n    [textField_ setFrame:frame];\n}\n\n-(void) setContentSize:(NSSize) size\n{\n    \n}\n\n-(void) visit\n{\n    \n}\n\n-(void) openKeyboard\n{\n    [textField_ becomeFirstResponder];\n}\n\n-(void) closeKeyboard\n{\n    [textField_ resignFirstResponder];\n    [textField_ removeFromSuperview];\n}\n\n- (BOOL)textFieldShouldReturn:(NSTextField *)sender\n{\n    if (sender == textField_) {\n        [sender resignFirstResponder];\n    }\n    return NO;\n}\n\n-(void)animationSelector\n{\n}\n\n- (BOOL)textFieldShouldBeginEditing:(NSTextField *)sender        // return NO to disallow editing.\n{\n    editState_ = YES;\n    cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();\n    if (pDelegate != NULL)\n    {\n        pDelegate->editBoxEditingDidBegin(getEditBoxImplMac()->getEditBox());\n    }\n    \n    cocos2d::extension::EditBox*  pEditBox= getEditBoxImplMac()->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"began\",pEditBox);\n        cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n    return YES;\n}\n\n- (BOOL)textFieldShouldEndEditing:(NSTextField *)sender\n{\n    editState_ = NO;\n    cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();\n    if (pDelegate != NULL)\n    {\n        pDelegate->editBoxEditingDidEnd(getEditBoxImplMac()->getEditBox());\n        pDelegate->editBoxReturn(getEditBoxImplMac()->getEditBox());\n    }\n    \n    cocos2d::extension::EditBox*  pEditBox= getEditBoxImplMac()->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"ended\",pEditBox);\n        cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"return\",64);\n        event.data = (void*)&data;\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n    return YES;\n}\n\n/**\n * Delegate method called before the text has been changed.\n * @param textField The text field containing the text.\n * @param range The range of characters to be replaced.\n * @param string The replacement string.\n * @return YES if the specified text range should be replaced; otherwise, NO to keep the old text.\n */\n- (BOOL)textField:(NSTextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string\n{\n    if (getEditBoxImplMac()->getMaxLength() < 0)\n    {\n        return YES;\n    }\n    \n    NSUInteger oldLength = [[textField stringValue] length];\n    NSUInteger replacementLength = [string length];\n    NSUInteger rangeLength = range.length;\n    \n    NSUInteger newLength = oldLength - rangeLength + replacementLength;\n    \n    return newLength <= getEditBoxImplMac()->getMaxLength();\n}\n\n/**\n * Called each time when the text field's text has changed.\n */\n- (void)controlTextDidChange:(NSNotification *)notification\n{\n    cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate();\n    if (pDelegate != NULL)\n    {\n        pDelegate->editBoxTextChanged(getEditBoxImplMac()->getEditBox(), getEditBoxImplMac()->getText());\n    }\n    \n    cocos2d::extension::EditBox*  pEditBox= getEditBoxImplMac()->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"changed\",pEditBox);\n        cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data);\n        cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n}\n\n@end\n\nNS_CC_EXT_BEGIN\n\nEditBoxImpl* __createSystemEditBox(EditBox* pEditBox)\n{\n    return new EditBoxImplMac(pEditBox);\n}\n\nEditBoxImplMac::EditBoxImplMac(EditBox* pEditText)\n: EditBoxImpl(pEditText)\n, _anchorPoint(Point(0.5f, 0.5f))\n, _maxTextLength(-1)\n, _sysEdit(NULL)\n{\n    //! TODO: Retina on Mac\n    //! _inRetinaMode = [[CCEAGLView sharedEGLView] contentScaleFactor] == 2.0f ? true : false;\n    _inRetinaMode = false;\n}\n\nEditBoxImplMac::~EditBoxImplMac()\n{\n    [_sysEdit release];\n}\n\nvoid EditBoxImplMac::doAnimationWhenKeyboardMove(float duration, float distance)\n{\n    if ([_sysEdit isEditState] || distance < 0.0f)\n        [_sysEdit doAnimationWhenKeyboardMoveWithDuration:duration distance:distance];\n}\n\nbool EditBoxImplMac::initWithSize(const Size& size)\n{\n    EGLViewProtocol* eglView = EGLView::getInstance();\n\n    NSRect rect = NSMakeRect(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY());\n\n    if (_inRetinaMode) {\n         rect.size.width /= 2.0f;\n         rect.size.height /= 2.0f;\n    }\n    \n    _sysEdit = [[CCEditBoxImplMac alloc] initWithFrame:rect editBox:this];\n    \n    if (!_sysEdit)\n        return false;\n    \n    return true;\n}\n\nvoid EditBoxImplMac::setFont(const char* pFontName, int fontSize)\n{\n    //TODO:\n//\tif(pFontName == NULL)\n//\t\treturn;\n//\tNSString * fntName = [NSString stringWithUTF8String:pFontName];\n//\tUIFont *textFont = [UIFont fontWithName:fntName size:fontSize];\n//\tif(textFont != nil)\n//\t\t[_sysEdit.textField setFont:textFont];\n}\n\nvoid EditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize)\n{\n\t// TODO need to be implemented.\n}\n\nvoid EditBoxImplMac::setFontColor(const Color3B& color)\n{\n    _sysEdit.textField.textColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f];\n}\n\nvoid EditBoxImplMac::setPlaceholderFontColor(const Color3B& color)\n{\n    // TODO need to be implemented.\n}\n\nvoid EditBoxImplMac::setInputMode(EditBox::InputMode inputMode)\n{\n}\n\nvoid EditBoxImplMac::setMaxLength(int maxLength)\n{\n    _maxTextLength = maxLength;\n}\n\nint EditBoxImplMac::getMaxLength()\n{\n    return _maxTextLength;\n}\n\nvoid EditBoxImplMac::setInputFlag(EditBox::InputFlag inputFlag)\n{\n    // TODO: NSSecureTextField\n}\n\nvoid EditBoxImplMac::setReturnType(EditBox::KeyboardReturnType returnType)\n{\n}\n\nbool EditBoxImplMac::isEditing()\n{\n    return [_sysEdit isEditState] ? true : false;\n}\n\nvoid EditBoxImplMac::setText(const char* pText)\n{\n    _sysEdit.textField.stringValue = [NSString stringWithUTF8String:pText];\n}\n\nconst char*  EditBoxImplMac::getText(void)\n{\n    return [_sysEdit.textField.stringValue UTF8String];\n}\n\nvoid EditBoxImplMac::setPlaceHolder(const char* pText)\n{\n    [[_sysEdit.textField cell] setPlaceholderString:[NSString stringWithUTF8String:pText]];\n}\n\nNSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Point& designCoord, bool bInRetinaMode)\n{\n    NSRect frame = [_sysEdit.textField frame];\n    CGFloat height = frame.size.height;\n    \n    EGLViewProtocol* eglView = EGLView::getInstance();\n\n    Point visiblePos = Point(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY());\n    Point screenGLPos = visiblePos + eglView->getViewPortRect().origin;\n    \n    //TODO: I don't know why here needs to substract `height`.\n    NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height);\n    \n    if (bInRetinaMode) {\n        screenPos.x = screenPos.x / 2.0f;\n        screenPos.y = screenPos.y / 2.0f;\n    }\n    \n    CCLOG(\"[EditBox] pos x = %f, y = %f\", screenGLPos.x, screenGLPos.y);\n    return screenPos;\n}\n\nvoid EditBoxImplMac::adjustTextFieldPosition()\n{\n\tSize contentSize = _editBox->getContentSize();\n\tRect rect = Rect(0, 0, contentSize.width, contentSize.height);\n\n    rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform());\n\t\n\tPoint designCoord = Point(rect.origin.x, rect.origin.y + rect.size.height);\n    [_sysEdit setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)];\n}\n\nvoid EditBoxImplMac::setPosition(const Point& pos)\n{\n    _position = pos;\n    adjustTextFieldPosition();\n}\n\nvoid EditBoxImplMac::setVisible(bool visible)\n{\n    [_sysEdit.textField setHidden:!visible];\n}\n\nvoid EditBoxImplMac::setContentSize(const Size& size)\n{\n    _contentSize = size;\n    CCLOG(\"[Edit text] content size = (%f, %f)\", size.width, size.height);\n}\n\nvoid EditBoxImplMac::setAnchorPoint(const Point& anchorPoint)\n{\n    CCLOG(\"[Edit text] anchor point = (%f, %f)\", anchorPoint.x, anchorPoint.y);\n\t_anchorPoint = anchorPoint;\n\tsetPosition(_position);\n}\n\nvoid EditBoxImplMac::visit(void)\n{\n    \n}\n\nvoid EditBoxImplMac::openKeyboard()\n{\n    [_sysEdit openKeyboard];\n}\n\nvoid EditBoxImplMac::closeKeyboard()\n{\n    [_sysEdit closeKeyboard];\n}\n\nvoid EditBoxImplMac::onEnter(void)\n{\n    adjustTextFieldPosition();\n}\n\nNS_CC_EXT_END\n\n#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)\n\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp",
    "content": "#include \"CCEditBox.h\"\n\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID ) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS ) && (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN)\n\nNS_CC_EXT_BEGIN\n\nEditBoxImpl* __createSystemEditBox(EditBox* pEditBox)\n{\n    return NULL;\n}\n\nNS_CC_EXT_END\n\n#endif /* #if (..) */\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplTizen.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n Copyright (c) 2013 Lee, Jae-Hong\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCEditBoxImplTizen.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN)\n\n#include \"CCEditBox.h\"\n#include \"platform/tizen/CCOspForm.h\"\n\nusing namespace Tizen::Ui::Controls;\n\nNS_CC_EXT_BEGIN\n\nEditBoxImpl* __createSystemEditBox(EditBox* pEditBox)\n{\n    return new EditBoxImplTizen(pEditBox);\n}\n\nEditBoxImplTizen::EditBoxImplTizen(EditBox* pEditText)\n: EditBoxImpl(pEditText)\n, _label(NULL)\n, _labelPlaceHolder(NULL)\n, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE)\n, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS)\n, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT)\n, _colText(Color3B::WHITE)\n, _colPlaceHolder(Color3B::GRAY)\n, _maxLength(-1)\n{\n}\n\nEditBoxImplTizen::~EditBoxImplTizen()\n{\n}\n\nvoid EditBoxImplTizen::doAnimationWhenKeyboardMove(float duration, float distance)\n{\n}\n\nstatic const int CC_EDIT_BOX_PADDING = 5;\n\nbool EditBoxImplTizen::initWithSize(const Size& size)\n{\n//    int fontSize = (int)size.height-12;\n    _label = LabelTTF::create(\"\", \"\", size.height-12);\n    // align the text vertically center\n    _label->setAnchorPoint(Point(0, 0.5f));\n    _label->setPosition(Point(CC_EDIT_BOX_PADDING, size.height / 2.0f));\n    _label->setColor(_colText);\n    _editBox->addChild(_label);\n\n    _labelPlaceHolder = LabelTTF::create(\"\", \"\", size.height-12);\n    // align the text vertically center\n    _labelPlaceHolder->setAnchorPoint(Point(0, 0.5f));\n    _labelPlaceHolder->setPosition(Point(CC_EDIT_BOX_PADDING, size.height / 2.0f));\n    _labelPlaceHolder->setVisible(false);\n    _labelPlaceHolder->setColor(_colPlaceHolder);\n    _editBox->addChild(_labelPlaceHolder);\n\n    _editSize = size;\n    return true;\n}\n\nvoid EditBoxImplTizen::setFont(const char* pFontName, int fontSize)\n{\n    if(_label != NULL) {\n        _label->setFontName(pFontName);\n        _label->setFontSize(fontSize);\n    }\n    \n    if(_labelPlaceHolder != NULL) {\n        _labelPlaceHolder->setFontName(pFontName);\n        _labelPlaceHolder->setFontSize(fontSize);\n    }\n}\n\nvoid EditBoxImplTizen::setFontColor(const Color3B& color)\n{\n    _colText = color;\n    _label->setColor(color);\n}\n\nvoid EditBoxImplTizen::setPlaceholderFont(const char* pFontName, int fontSize)\n{\n    if(_labelPlaceHolder != NULL) {\n        _labelPlaceHolder->setFontName(pFontName);\n        _labelPlaceHolder->setFontSize(fontSize);\n    }\n}\n\nvoid EditBoxImplTizen::setPlaceholderFontColor(const Color3B& color)\n{\n    _colPlaceHolder = color;\n    _labelPlaceHolder->setColor(color);\n}\n\nvoid EditBoxImplTizen::setInputMode(EditBox::InputMode inputMode)\n{\n    _editBoxInputMode = inputMode;\n}\n\nvoid EditBoxImplTizen::setMaxLength(int maxLength)\n{\n    _maxLength = maxLength;\n}\n\nint EditBoxImplTizen::getMaxLength()\n{\n    return _maxLength;\n}\n\nvoid EditBoxImplTizen::setInputFlag(EditBox::InputFlag inputFlag)\n{\n    _editBoxInputFlag = inputFlag;\n}\n\nvoid EditBoxImplTizen::setReturnType(EditBox::KeyboardReturnType returnType)\n{\n    _keyboardReturnType = returnType;\n}\n\nbool EditBoxImplTizen::isEditing()\n{\n    return false;\n}\n\nvoid EditBoxImplTizen::setText(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _text = pText;\n\n        if (_text.length() > 0)\n        {\n            _labelPlaceHolder->setVisible(false);\n\n            std::string strToShow;\n\n            if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag)\n            {\n                long length = cc_utf8_strlen(_text.c_str(), -1);\n                for (long i = 0; i < length; i++)\n                {\n                    strToShow.append(\"*\");\n                }\n            }\n            else\n            {\n                strToShow = _text;\n            }\n\n            _label->setString(strToShow.c_str());\n\n            // Clip the text width to fit to the text box\n            float fMaxWidth = _editSize.width - CC_EDIT_BOX_PADDING * 2;\n            Rect clippingRect = _label->getTextureRect();\n            if(clippingRect.size.width > fMaxWidth) {\n                clippingRect.size.width = fMaxWidth;\n                _label->setTextureRect(clippingRect);\n            }\n\n        }\n        else\n        {\n            _labelPlaceHolder->setVisible(true);\n            _label->setString(\"\");\n        }\n\n    }\n}\n\nconst char*  EditBoxImplTizen::getText(void)\n{\n    return _text.c_str();\n}\n\nvoid EditBoxImplTizen::setPlaceHolder(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _placeHolder = pText;\n        if (_placeHolder.length() > 0 && _text.length() == 0)\n        {\n            _labelPlaceHolder->setVisible(true);\n        }\n\n        _labelPlaceHolder->setString(_placeHolder.c_str());\n    }\n}\n\nvoid EditBoxImplTizen::setPosition(const Point& pos)\n{\n}\n\nvoid EditBoxImplTizen::setVisible(bool visible)\n{\n}\n\nvoid EditBoxImplTizen::setContentSize(const Size& size)\n{\n}\n\nvoid EditBoxImplTizen::setAnchorPoint(const Point& anchorPoint)\n{\n}\n\nvoid EditBoxImplTizen::visit(void)\n{\n}\n\nvoid EditBoxImplTizen::onEnter(void)\n{\n}\n\nstatic void editBoxCallbackFunc(const char* pText, void* ctx)\n{\n    EditBoxImplTizen* thiz = (EditBoxImplTizen*)ctx;\n    thiz->setText(pText);\n\n    if (thiz->getDelegate() != NULL)\n    {\n        thiz->getDelegate()->editBoxTextChanged(thiz->getEditBox(), thiz->getText());\n        thiz->getDelegate()->editBoxEditingDidEnd(thiz->getEditBox());\n        thiz->getDelegate()->editBoxReturn(thiz->getEditBox());\n    }\n    \n    EditBox* pEditBox = thiz->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {       \n        CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"changed\",pEditBox);\n        ScriptEvent event(kCommonEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"ended\",64);\n        event.data = (void*)&data;\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"return\",64);\n        event.data = (void*)&data;\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n}\n\nvoid EditBoxImplTizen::openKeyboard()\n{\n    if (_delegate != NULL)\n    {\n        _delegate->editBoxEditingDidBegin(_editBox);\n    }\n    EditBox* pEditBox = this->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"began\",pEditBox);\n        ScriptEvent event(kCommonEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n\n    KeypadStyle keypadStyle = KEYPAD_STYLE_NORMAL;\n    KeypadInputModeCategory keypadCategory = KEYPAD_MODE_ALPHA;\n    bool bSingleLineEnabled = false;\n    switch (_editBoxInputMode)\n    {\n    case EditBox::InputMode::ANY:\n        keypadStyle = KEYPAD_STYLE_NORMAL;\n        break;\n    case EditBox::InputMode::EMAIL_ADDRESS:\n        keypadStyle = KEYPAD_STYLE_EMAIL;\n        break;\n    case EditBox::InputMode::NUMERIC:\n    case EditBox::InputMode::DECIMAL:\n        keypadStyle = KEYPAD_STYLE_NUMBER;\n        keypadCategory = KEYPAD_MODE_NUMERIC;\n        break;\n    case EditBox::InputMode::PHONE_NUMBER:\n        keypadStyle = KEYPAD_STYLE_PHONE_NUMBER;\n        break;\n    case EditBox::InputMode::URL:\n        keypadStyle = KEYPAD_STYLE_URL;\n        break;\n    case EditBox::InputMode::SINGLE_LINE:\n        bSingleLineEnabled = true;\n        break;\n    default:\n        keypadStyle = KEYPAD_STYLE_NORMAL;\n        break;\n    }\n\n    bool bTextPrediction = true;\n    switch (_editBoxInputFlag)\n    {\n    case EditBox::InputFlag::PASSWORD:\n        keypadStyle = KEYPAD_STYLE_PASSWORD;\n        break;\n    case EditBox::InputFlag::SENSITIVE:\n        bTextPrediction = false;\n        break;\n    default:\n        break;\n    }\n\n    ((OspForm *)OspApplication::GetInstance()->getOspForm())->ShowKeypad(\n        _text.c_str(),\n        keypadStyle,\n        keypadCategory,\n        bSingleLineEnabled,\n        bTextPrediction,\n        _maxLength,\n        editBoxCallbackFunc,\n        (void*)this);\n}\n\nvoid EditBoxImplTizen::closeKeyboard()\n{\n    ((OspForm *)OspApplication::GetInstance()->getOspForm())->CloseKeypad();\n}\n\nNS_CC_EXT_END\n\n#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplTizen.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2012 James Chen\n Copyright (c) 2013 Lee, Jae-Hong\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEDITBOXIMPLTIZEN_H__\n#define __CCEDITBOXIMPLTIZEN_H__\n\n#include \"cocos2d.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN)\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCEditBoxImpl.h\"\n\nNS_CC_EXT_BEGIN\n\nclass EditBox;\n\nclass EditBoxImplTizen : public EditBoxImpl\n{\npublic:\n    /**\n     * @js NA\n     */\n    EditBoxImplTizen(EditBox* pEditText);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBoxImplTizen();\n\n    virtual bool initWithSize(const Size& size);\n    virtual void setFont(const char* pFontName, int fontSize);\n    virtual void setFontColor(const Color3B& color);\n    virtual void setPlaceholderFont(const char* pFontName, int fontSize);\n    virtual void setPlaceholderFontColor(const Color3B& color);\n    virtual void setInputMode(EditBox::InputMode inputMode);\n    virtual void setInputFlag(EditBox::InputFlag inputFlag);\n    virtual void setMaxLength(int maxLength);\n    virtual int  getMaxLength();\n    virtual void setReturnType(EditBox::KeyboardReturnType returnType);\n    virtual bool isEditing();\n\n    virtual void setText(const char* pText);\n    virtual const char* getText(void);\n    virtual void setPlaceHolder(const char* pText);\n    virtual void setPosition(const Point& pos);\n    virtual void setVisible(bool visible);\n    virtual void setContentSize(const Size& size);\n    virtual void setAnchorPoint(const Point& anchorPoint);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit(void);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter(void);\n    virtual void doAnimationWhenKeyboardMove(float duration, float distance);\n    virtual void openKeyboard();\n    virtual void closeKeyboard();\n\nprivate:\n    LabelTTF* _label;\n    LabelTTF* _labelPlaceHolder;\n    EditBox::InputMode    _editBoxInputMode;\n    EditBox::InputFlag    _editBoxInputFlag;\n    EditBox::KeyboardReturnType  _keyboardReturnType;\n\n    std::string _text;\n    std::string _placeHolder;\n\n    Color3B _colText;\n    Color3B _colPlaceHolder;\n\n    int   _maxLength;\n    Size _editSize;\n};\n\n\nNS_CC_EXT_END\n\n#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) */\n\n#endif /* __CCEDITBOXIMPLTIZEN_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013 Jozef Pridavok\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"CCEditBoxImplWin.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n\n#include \"CCEditBox.h\"\n#include \"proj.win32/Win32InputBox.h\"\n\nNS_CC_EXT_BEGIN\n\nEditBoxImpl* __createSystemEditBox(EditBox* pEditBox)\n{\n    return new EditBoxImplWin(pEditBox);\n}\n\nEditBoxImplWin::EditBoxImplWin(EditBox* pEditText)\n: EditBoxImpl(pEditText)\n, _label(NULL)\n, _labelPlaceHolder(NULL)\n, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE)\n, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS)\n, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT)\n, _colText(Color3B::WHITE)\n, _colPlaceHolder(Color3B::GRAY)\n, _maxLength(-1)\n{\n    \n}\n\nEditBoxImplWin::~EditBoxImplWin()\n{\n}\n\nvoid EditBoxImplWin::doAnimationWhenKeyboardMove(float duration, float distance)\n{\n}\n\nbool EditBoxImplWin::initWithSize(const Size& size)\n{\n    //! int fontSize = getFontSizeAccordingHeightJni(size.height-12);\n    _label = LabelTTF::create(\"\", \"\", size.height-12);\n\t// align the text vertically center\n    _label->setAnchorPoint(Point(0, 0.5f));\n    _label->setPosition(Point(5, size.height / 2.0f));\n    _label->setColor(_colText);\n    _editBox->addChild(_label);\n\n    _labelPlaceHolder = LabelTTF::create(\"\", \"\", size.height-12);\n\t// align the text vertically center\n    _labelPlaceHolder->setAnchorPoint(Point(0, 0.5f));\n    _labelPlaceHolder->setPosition(Point(5, size.height / 2.0f));\n    _labelPlaceHolder->setVisible(false);\n    _labelPlaceHolder->setColor(_colPlaceHolder);\n    _editBox->addChild(_labelPlaceHolder);\n    \n    _editSize = size;\n    return true;\n}\n\nvoid EditBoxImplWin::setFont(const char* pFontName, int fontSize)\n{\n\tif(_label != NULL) {\n\t\t_label->setFontName(pFontName);\n\t\t_label->setFontSize(fontSize);\n\t}\n\t\n\tif(_labelPlaceHolder != NULL) {\n\t\t_labelPlaceHolder->setFontName(pFontName);\n\t\t_labelPlaceHolder->setFontSize(fontSize);\n\t}\n}\n\nvoid EditBoxImplWin::setFontColor(const Color3B& color)\n{\n    _colText = color;\n    _label->setColor(color);\n}\n\nvoid EditBoxImplWin::setPlaceholderFont(const char* pFontName, int fontSize)\n{\n\tif(_labelPlaceHolder != NULL) {\n\t\t_labelPlaceHolder->setFontName(pFontName);\n\t\t_labelPlaceHolder->setFontSize(fontSize);\n\t}\n}\n\nvoid EditBoxImplWin::setPlaceholderFontColor(const Color3B& color)\n{\n    _colPlaceHolder = color;\n    _labelPlaceHolder->setColor(color);\n}\n\nvoid EditBoxImplWin::setInputMode(EditBox::InputMode inputMode)\n{\n    _editBoxInputMode = inputMode;\n}\n\nvoid EditBoxImplWin::setMaxLength(int maxLength)\n{\n    _maxLength = maxLength;\n}\n\nint EditBoxImplWin::getMaxLength()\n{\n    return _maxLength;\n}\n\nvoid EditBoxImplWin::setInputFlag(EditBox::InputFlag inputFlag)\n{\n    _editBoxInputFlag = inputFlag;\n}\n\nvoid EditBoxImplWin::setReturnType(EditBox::KeyboardReturnType returnType)\n{\n    _keyboardReturnType = returnType;\n}\n\nbool EditBoxImplWin::isEditing()\n{\n    return false;\n}\n\nvoid EditBoxImplWin::setText(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _text = pText;\n\n        if (_text.length() > 0)\n        {\n            _labelPlaceHolder->setVisible(false);\n\n            std::string strToShow;\n\n\t\t\tif (EditBox::InputFlag::PASSWORD == _editBoxInputFlag)\n            {\n                long length = cc_utf8_strlen(_text.c_str(), -1);\n                for (long i = 0; i < length; i++)\n                {\n                    strToShow.append(\"*\");\n                }\n            }\n            else\n            {\n                strToShow = _text;\n            }\n\n            //! std::string strWithEllipsis = getStringWithEllipsisJni(strToShow.c_str(), _editSize.width, _editSize.height-12);\n            //! _label->setString(strWithEllipsis.c_str());\n\t\t\t_label->setString(strToShow.c_str());\n        }\n        else\n        {\n            _labelPlaceHolder->setVisible(true);\n            _label->setString(\"\");\n        }\n\n    }\n}\n\nconst char*  EditBoxImplWin::getText(void)\n{\n    return _text.c_str();\n}\n\nvoid EditBoxImplWin::setPlaceHolder(const char* pText)\n{\n    if (pText != NULL)\n    {\n        _placeHolder = pText;\n        if (_placeHolder.length() > 0 && _text.length() == 0)\n        {\n            _labelPlaceHolder->setVisible(true);\n        }\n\n        _labelPlaceHolder->setString(_placeHolder.c_str());\n    }\n}\n\nvoid EditBoxImplWin::setPosition(const Point& pos)\n{\n\t//_label->setPosition(pos);\n\t//_labelPlaceHolder->setPosition(pos);\n}\n\nvoid EditBoxImplWin::setVisible(bool visible)\n{ // don't need to be implemented on win32 platform.\n}\n\nvoid EditBoxImplWin::setContentSize(const Size& size)\n{\n}\n\nvoid EditBoxImplWin::setAnchorPoint(const Point& anchorPoint)\n{ // don't need to be implemented on win32 platform.\n\t\n}\n\nvoid EditBoxImplWin::visit(void)\n{   \n}\n\nstatic void editBoxCallbackFunc(const char* pText, void* ctx)\n{\n    EditBoxImplWin* thiz = (EditBoxImplWin*)ctx;\n    thiz->setText(pText);\n\n    if (thiz->getDelegate() != NULL)\n    {\n        thiz->getDelegate()->editBoxTextChanged(thiz->getEditBox(), thiz->getText());\n        thiz->getDelegate()->editBoxEditingDidEnd(thiz->getEditBox());\n        thiz->getDelegate()->editBoxReturn(thiz->getEditBox());\n    }\n    \n    EditBox* pEditBox = thiz->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"changed\",pEditBox);\n        ScriptEvent event(kCommonEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"ended\",64);\n        event.data = (void*)&data;\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n        memset(data.eventName,0,64*sizeof(char));\n        strncpy(data.eventName,\"return\",64);\n        event.data = (void*)&data;\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n}\n\nvoid EditBoxImplWin::openKeyboard()\n{\n    if (_delegate != NULL)\n    {\n        _delegate->editBoxEditingDidBegin(_editBox);\n    }\n    \n    EditBox* pEditBox = this->getEditBox();\n    if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())\n    {\n        CommonScriptData data(pEditBox->getScriptEditBoxHandler(), \"began\",pEditBox);\n        ScriptEvent event(kCommonEvent,(void*)&data);\n        ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);\n    }\n    \n\tstd::string placeHolder = _labelPlaceHolder->getString();\n\tif (placeHolder.length() == 0)\n\t\tplaceHolder = \"Enter value\";\n\n\tchar pText[100]= {0};\n\tstd::string text = getText();\n\tif (text.length())\n\t\tstrncpy(pText, text.c_str(), 100);\n\tbool didChange = CWin32InputBox::InputBox(\"Input\", placeHolder.c_str(), pText, 100, false) == IDOK;\n\t\n\tif (didChange) \t\n\t\tsetText(pText);\n\n\tif (_delegate != NULL) {\n\t\tif (didChange)\n\t\t\t_delegate->editBoxTextChanged(_editBox, getText());\n\t\t_delegate->editBoxEditingDidEnd(_editBox);\n\t\t_delegate->editBoxReturn(_editBox);\n\t}\n}\n\nvoid EditBoxImplWin::closeKeyboard()\n{\n\n}\n\nvoid EditBoxImplWin::onEnter(void)\n{\n\n}\n\nNS_CC_EXT_END\n\n#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCEditBox/CCEditBoxImplWin.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2013 Jozef Pridavok\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCEditBoxIMPLWIN_H__\n#define __CCEditBoxIMPLWIN_H__\n\n#include \"cocos2d.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCEditBoxImpl.h\"\n\nNS_CC_EXT_BEGIN\n\nclass EditBox;\n\nclass EditBoxImplWin : public EditBoxImpl\n{\npublic:\n    /**\n     * @js NA\n     */\n    EditBoxImplWin(EditBox* pEditText);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~EditBoxImplWin();\n    \n    virtual bool initWithSize(const Size& size);\n\tvirtual void setFont(const char* pFontName, int fontSize);\n    virtual void setFontColor(const Color3B& color);\n    virtual void setPlaceholderFont(const char* pFontName, int fontSize);\n    virtual void setPlaceholderFontColor(const Color3B& color);\n    virtual void setInputMode(EditBox::InputMode inputMode);\n    virtual void setInputFlag(EditBox::InputFlag inputFlag);\n    virtual void setMaxLength(int maxLength);\n    virtual int  getMaxLength();\n    virtual void setReturnType(EditBox::KeyboardReturnType returnType);\n    virtual bool isEditing();\n    \n    virtual void setText(const char* pText);\n    virtual const char* getText(void);\n    virtual void setPlaceHolder(const char* pText);\n    virtual void setPosition(const Point& pos);\n\tvirtual void setVisible(bool visible);\n    virtual void setContentSize(const Size& size);\n    virtual void setAnchorPoint(const Point& anchorPoint);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit(void);\n    virtual void doAnimationWhenKeyboardMove(float duration, float distance);\n    virtual void openKeyboard();\n    virtual void closeKeyboard();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void onEnter(void);\nprivate:\n\n    LabelTTF* _label;\n    LabelTTF* _labelPlaceHolder;\n    EditBox::InputMode    _editBoxInputMode;\n    EditBox::InputFlag    _editBoxInputFlag;\n    EditBox::KeyboardReturnType  _keyboardReturnType;\n    \n    std::string _text;\n    std::string _placeHolder;\n    \n    Color3B _colText;\n    Color3B _colPlaceHolder;\n\n    int   _maxLength;\n    Size _editSize;\n\n\t/*\n    Size     _contentSize;\n    HWND       _sysEdit;\n    int        _maxTextLength;\n\t*/\n};\n\n\nNS_CC_EXT_END\n\n#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */\n\n#endif /* __CCEditBoxIMPLWIN_H__ */\n\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCScrollView/CCScrollView.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2012 cocos2d-x.org\n Copyright (c) 2010 Sangwoo Im\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCScrollView.h\"\n#include \"CCEGLView.h\"\n#include \"platform/CCDevice.h\"\n#include \"CCActionInstant.h\"\n#include \"CCActionInterval.h\"\n#include \"CCActionTween.h\"\n#include \"CCDirector.h\"\n#include \"renderer/CCRenderer.h\"\n\n#include <algorithm>\n\nNS_CC_EXT_BEGIN\n\n#define SCROLL_DEACCEL_RATE  0.95f\n#define SCROLL_DEACCEL_DIST  1.0f\n#define BOUNCE_DURATION      0.15f\n#define INSET_RATIO          0.2f\n#define MOVE_INCH            7.0f/160.0f\n\nstatic float convertDistanceFromPointToInch(float pointDis)\n{\n    float factor = ( EGLView::getInstance()->getScaleX() + EGLView::getInstance()->getScaleY() ) / 2;\n    return pointDis * factor / Device::getDPI();\n}\n\n\nScrollView::ScrollView()\n: _zoomScale(0.0f)\n, _minZoomScale(0.0f)\n, _maxZoomScale(0.0f)\n, _delegate(nullptr)\n, _direction(Direction::BOTH)\n, _dragging(false)\n, _container(nullptr)\n, _touchMoved(false)\n, _bounceable(false)\n, _clippingToBounds(false)\n, _touchLength(0.0f)\n, _minScale(0.0f)\n, _maxScale(0.0f)\n, _touchListener(nullptr)\n{\n\n}\n\nScrollView::~ScrollView()\n{\n\n}\n\nScrollView* ScrollView::create(Size size, Node* container/* = NULL*/)\n{\n    ScrollView* pRet = new ScrollView();\n    if (pRet && pRet->initWithViewSize(size, container))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    return pRet;\n}\n\nScrollView* ScrollView::create()\n{\n    ScrollView* pRet = new ScrollView();\n    if (pRet && pRet->init())\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    return pRet;\n}\n\n\nbool ScrollView::initWithViewSize(Size size, Node *container/* = NULL*/)\n{\n    if (Layer::init())\n    {\n        _container = container;\n        \n        if (!this->_container)\n        {\n            _container = Layer::create();\n            _container->ignoreAnchorPointForPosition(false);\n            _container->setAnchorPoint(Point(0.0f, 0.0f));\n        }\n\n        this->setViewSize(size);\n\n        setTouchEnabled(true);\n        \n        _touches.reserve(EventTouch::MAX_TOUCHES);\n        \n        _delegate = NULL;\n        _bounceable = true;\n        _clippingToBounds = true;\n        //_container->setContentSize(Size::ZERO);\n        _direction  = Direction::BOTH;\n        _container->setPosition(Point(0.0f, 0.0f));\n        _touchLength = 0.0f;\n        \n        this->addChild(_container);\n        _minScale = _maxScale = 1.0f;\n\n        \n        return true;\n    }\n    return false;\n}\n\nbool ScrollView::init()\n{\n    return this->initWithViewSize(Size(200, 200), NULL);\n}\n\nbool ScrollView::isNodeVisible(Node* node)\n{\n    const Point offset = this->getContentOffset();\n    const Size  size   = this->getViewSize();\n    const float   scale  = this->getZoomScale();\n    \n    Rect viewRect;\n    \n    viewRect = Rect(-offset.x/scale, -offset.y/scale, size.width/scale, size.height/scale); \n    \n    return viewRect.intersectsRect(node->getBoundingBox());\n}\n\nvoid ScrollView::pause(Object* sender)\n{\n    _container->pause();\n\n    auto& children = _container->getChildren();\n    for(const auto &child : children) {\n        child->pause();\n    }\n}\n\nvoid ScrollView::resume(Object* sender)\n{\n    auto& children = _container->getChildren();\n    for(const auto &child : children) {\n        child->resume();\n    }\n\n    _container->resume();\n}\n\nbool ScrollView::isTouchEnabled() const\n{\n\treturn _touchListener != nullptr;\n}\n\nvoid ScrollView::setTouchEnabled(bool enabled)\n{\n    _eventDispatcher->removeEventListener(_touchListener);\n    _touchListener = nullptr;\n\n    if (enabled)\n    {\n        _touchListener = EventListenerTouchOneByOne::create();\n        _touchListener->onTouchBegan = CC_CALLBACK_2(ScrollView::onTouchBegan, this);\n        _touchListener->onTouchMoved = CC_CALLBACK_2(ScrollView::onTouchMoved, this);\n        _touchListener->onTouchEnded = CC_CALLBACK_2(ScrollView::onTouchEnded, this);\n        _touchListener->onTouchCancelled = CC_CALLBACK_2(ScrollView::onTouchCancelled, this);\n        \n        _eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener, this);\n    }\n    else\n    {\n        _dragging = false;\n        _touchMoved = false;\n        _touches.clear();\n    }\n}\n\nvoid ScrollView::setContentOffset(Point offset, bool animated/* = false*/)\n{\n    if (animated)\n    { //animate scrolling\n        this->setContentOffsetInDuration(offset, BOUNCE_DURATION);\n    } \n    else\n    { //set the container position directly\n        if (!_bounceable)\n        {\n            const Point minOffset = this->minContainerOffset();\n            const Point maxOffset = this->maxContainerOffset();\n            \n            offset.x = MAX(minOffset.x, MIN(maxOffset.x, offset.x));\n            offset.y = MAX(minOffset.y, MIN(maxOffset.y, offset.y));\n        }\n\n        _container->setPosition(offset);\n\n        if (_delegate != NULL)\n        {\n            _delegate->scrollViewDidScroll(this);   \n        }\n    }\n}\n\nvoid ScrollView::setContentOffsetInDuration(Point offset, float dt)\n{\n    FiniteTimeAction *scroll, *expire;\n    \n    scroll = MoveTo::create(dt, offset);\n    expire = CallFuncN::create(CC_CALLBACK_1(ScrollView::stoppedAnimatedScroll,this));\n    _container->runAction(Sequence::create(scroll, expire, NULL));\n    this->schedule(schedule_selector(ScrollView::performedAnimatedScroll));\n}\n\nPoint ScrollView::getContentOffset()\n{\n    return _container->getPosition();\n}\n\nvoid ScrollView::setZoomScale(float s)\n{\n    if (_container->getScale() != s)\n    {\n        Point oldCenter, newCenter;\n        Point center;\n        \n        if (_touchLength == 0.0f) \n        {\n            center = Point(_viewSize.width*0.5f, _viewSize.height*0.5f);\n            center = this->convertToWorldSpace(center);\n        }\n        else\n        {\n            center = _touchPoint;\n        }\n        \n        oldCenter = _container->convertToNodeSpace(center);\n        _container->setScale(MAX(_minScale, MIN(_maxScale, s)));\n        newCenter = _container->convertToWorldSpace(oldCenter);\n        \n        const Point offset = center - newCenter;\n        if (_delegate != NULL)\n        {\n            _delegate->scrollViewDidZoom(this);\n        }\n        this->setContentOffset(_container->getPosition() + offset);\n    }\n}\n\nfloat ScrollView::getZoomScale()\n{\n    return _container->getScale();\n}\n\nvoid ScrollView::setZoomScale(float s, bool animated)\n{\n    if (animated)\n    {\n        this->setZoomScaleInDuration(s, BOUNCE_DURATION);\n    }\n    else\n    {\n        this->setZoomScale(s);\n    }\n}\n\nvoid ScrollView::setZoomScaleInDuration(float s, float dt)\n{\n    if (dt > 0)\n    {\n        if (_container->getScale() != s)\n        {\n            ActionTween *scaleAction;\n            scaleAction = ActionTween::create(dt, \"zoomScale\", _container->getScale(), s);\n            this->runAction(scaleAction);\n        }\n    }\n    else\n    {\n        this->setZoomScale(s);\n    }\n}\n\nvoid ScrollView::setViewSize(Size size)\n{\n    _viewSize = size;\n    Layer::setContentSize(size);\n}\n\nNode * ScrollView::getContainer()\n{\n    return this->_container;\n}\n\nvoid ScrollView::setContainer(Node * pContainer)\n{\n    // Make sure that '_container' has a non-NULL value since there are\n    // lots of logic that use '_container'.\n    if (NULL == pContainer)\n        return;\n\n    this->removeAllChildrenWithCleanup(true);\n    this->_container = pContainer;\n\n    this->_container->ignoreAnchorPointForPosition(false);\n    this->_container->setAnchorPoint(Point(0.0f, 0.0f));\n\n    this->addChild(this->_container);\n\n    this->setViewSize(this->_viewSize);\n}\n\nvoid ScrollView::relocateContainer(bool animated)\n{\n    Point oldPoint, min, max;\n    float newX, newY;\n    \n    min = this->minContainerOffset();\n    max = this->maxContainerOffset();\n    \n    oldPoint = _container->getPosition();\n\n    newX     = oldPoint.x;\n    newY     = oldPoint.y;\n    if (_direction == Direction::BOTH || _direction == Direction::HORIZONTAL)\n    {\n        newX     = MAX(newX, min.x);\n        newX     = MIN(newX, max.x);\n    }\n\n    if (_direction == Direction::BOTH || _direction == Direction::VERTICAL)\n    {\n        newY     = MIN(newY, max.y);\n        newY     = MAX(newY, min.y);\n    }\n\n    if (newY != oldPoint.y || newX != oldPoint.x)\n    {\n        this->setContentOffset(Point(newX, newY), animated);\n    }\n}\n\nPoint ScrollView::maxContainerOffset()\n{\n    return Point(0.0f, 0.0f);\n}\n\nPoint ScrollView::minContainerOffset()\n{\n    return Point(_viewSize.width - _container->getContentSize().width*_container->getScaleX(), \n               _viewSize.height - _container->getContentSize().height*_container->getScaleY());\n}\n\nvoid ScrollView::deaccelerateScrolling(float dt)\n{\n    if (_dragging)\n    {\n        this->unschedule(schedule_selector(ScrollView::deaccelerateScrolling));\n        return;\n    }\n    \n    float newX, newY;\n    Point maxInset, minInset;\n    \n    _container->setPosition(_container->getPosition() + _scrollDistance);\n    \n    if (_bounceable)\n    {\n        maxInset = _maxInset;\n        minInset = _minInset;\n    }\n    else\n    {\n        maxInset = this->maxContainerOffset();\n        minInset = this->minContainerOffset();\n    }\n    \n    //check to see if offset lies within the inset bounds\n    newX     = MIN(_container->getPosition().x, maxInset.x);\n    newX     = MAX(newX, minInset.x);\n    newY     = MIN(_container->getPosition().y, maxInset.y);\n    newY     = MAX(newY, minInset.y);\n    \n    newX = _container->getPosition().x;\n    newY = _container->getPosition().y;\n    \n    _scrollDistance     = _scrollDistance - Point(newX - _container->getPosition().x, newY - _container->getPosition().y);\n    _scrollDistance     = _scrollDistance * SCROLL_DEACCEL_RATE;\n    this->setContentOffset(Point(newX,newY));\n    \n    if ((fabsf(_scrollDistance.x) <= SCROLL_DEACCEL_DIST &&\n         fabsf(_scrollDistance.y) <= SCROLL_DEACCEL_DIST) ||\n        newY > maxInset.y || newY < minInset.y ||\n        newX > maxInset.x || newX < minInset.x ||\n        newX == maxInset.x || newX == minInset.x ||\n        newY == maxInset.y || newY == minInset.y)\n    {\n        this->unschedule(schedule_selector(ScrollView::deaccelerateScrolling));\n        this->relocateContainer(true);\n    }\n}\n\nvoid ScrollView::stoppedAnimatedScroll(Node * node)\n{\n    this->unschedule(schedule_selector(ScrollView::performedAnimatedScroll));\n    // After the animation stopped, \"scrollViewDidScroll\" should be invoked, this could fix the bug of lack of tableview cells.\n    if (_delegate != NULL)\n    {\n        _delegate->scrollViewDidScroll(this);\n    }\n}\n\nvoid ScrollView::performedAnimatedScroll(float dt)\n{\n    if (_dragging)\n    {\n        this->unschedule(schedule_selector(ScrollView::performedAnimatedScroll));\n        return;\n    }\n\n    if (_delegate != NULL)\n    {\n        _delegate->scrollViewDidScroll(this);\n    }\n}\n\n\nconst Size& ScrollView::getContentSize() const\n{\n\treturn _container->getContentSize();\n}\n\nvoid ScrollView::setContentSize(const Size & size)\n{\n    if (this->getContainer() != NULL)\n    {\n        this->getContainer()->setContentSize(size);\n\t\tthis->updateInset();\n    }\n}\n\nvoid ScrollView::updateInset()\n{\n\tif (this->getContainer() != NULL)\n\t{\n\t\t_maxInset = this->maxContainerOffset();\n\t\t_maxInset = Point(_maxInset.x + _viewSize.width * INSET_RATIO,\n\t\t\t_maxInset.y + _viewSize.height * INSET_RATIO);\n\t\t_minInset = this->minContainerOffset();\n\t\t_minInset = Point(_minInset.x - _viewSize.width * INSET_RATIO,\n\t\t\t_minInset.y - _viewSize.height * INSET_RATIO);\n\t}\n}\n\n/**\n * make sure all children go to the container\n */\nvoid ScrollView::addChild(Node * child, int zOrder, int tag)\n{\n    if (_container != child) {\n        _container->addChild(child, zOrder, tag);\n    } else {\n        Layer::addChild(child, zOrder, tag);\n    }\n}\n\nvoid ScrollView::beforeDraw()\n{\n    _beforeDrawCommand.init(_globalZOrder);\n    _beforeDrawCommand.func = CC_CALLBACK_0(ScrollView::onBeforeDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_beforeDrawCommand);\n}\n\n/**\n * clip this view so that outside of the visible bounds can be hidden.\n */\nvoid ScrollView::onBeforeDraw()\n{\n    if (_clippingToBounds)\n    {\n\t\t_scissorRestored = false;\n        Rect frame = getViewRect();\n        if (EGLView::getInstance()->isScissorEnabled()) {\n            _scissorRestored = true;\n            _parentScissorRect = EGLView::getInstance()->getScissorRect();\n            //set the intersection of _parentScissorRect and frame as the new scissor rect\n            if (frame.intersectsRect(_parentScissorRect)) {\n                float x = MAX(frame.origin.x, _parentScissorRect.origin.x);\n                float y = MAX(frame.origin.y, _parentScissorRect.origin.y);\n                float xx = MIN(frame.origin.x+frame.size.width, _parentScissorRect.origin.x+_parentScissorRect.size.width);\n                float yy = MIN(frame.origin.y+frame.size.height, _parentScissorRect.origin.y+_parentScissorRect.size.height);\n                EGLView::getInstance()->setScissorInPoints(x, y, xx-x, yy-y);\n            }\n        }\n        else {\n            glEnable(GL_SCISSOR_TEST);\n            EGLView::getInstance()->setScissorInPoints(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);\n        }\n    }\n}\n\nvoid ScrollView::afterDraw()\n{\n    _afterDrawCommand.init(_globalZOrder);\n    _afterDrawCommand.func = CC_CALLBACK_0(ScrollView::onAfterDraw, this);\n    Director::getInstance()->getRenderer()->addCommand(&_afterDrawCommand);\n}\n\n/**\n * retract what's done in beforeDraw so that there's no side effect to\n * other nodes.\n */\nvoid ScrollView::onAfterDraw()\n{\n    if (_clippingToBounds)\n    {\n        if (_scissorRestored) {//restore the parent's scissor rect\n            EGLView::getInstance()->setScissorInPoints(_parentScissorRect.origin.x, _parentScissorRect.origin.y, _parentScissorRect.size.width, _parentScissorRect.size.height);\n        }\n        else {\n            glDisable(GL_SCISSOR_TEST);\n        }\n    }\n}\n\nvoid ScrollView::visit()\n{\n\t// quick return if not visible\n\tif (!isVisible())\n    {\n\t\treturn;\n    }\n\n\tkmGLPushMatrix();\n\n\tthis->transform();\n    this->beforeDraw();\n\n\tif (!_children.empty())\n    {\n\t\tint i=0;\n\t\t\n\t\t// draw children zOrder < 0\n\t\tfor( ; i < _children.size(); i++ )\n        {\n\t\t\tNode *child = _children.at(i);\n\t\t\tif ( child->getLocalZOrder() < 0 )\n            {\n\t\t\t\tchild->visit();\n\t\t\t}\n            else\n            {\n\t\t\t\tbreak;\n            }\n\t\t}\n\t\t\n\t\t// this draw\n\t\tthis->draw();\n        \n\t\t// draw children zOrder >= 0\n\t\tfor( ; i < _children.size(); i++ )\n        {\n\t\t\tNode *child = _children.at(i);\n\t\t\tchild->visit();\n\t\t}\n        \n\t}\n    else\n    {\n\t\tthis->draw();\n    }\n\n    this->afterDraw();\n\n\tkmGLPopMatrix();\n}\n\nbool ScrollView::onTouchBegan(Touch* touch, Event* event)\n{\n    if (!this->isVisible())\n    {\n        return false;\n    }\n    \n    Rect frame = getViewRect();\n\n    //dispatcher does not know about clipping. reject touches outside visible bounds.\n    if (_touches.size() > 2 ||\n        _touchMoved          ||\n        !frame.containsPoint(touch->getLocation()))\n    {\n        return false;\n    }\n\n    if (std::find(_touches.begin(), _touches.end(), touch) == _touches.end())\n    {\n        _touches.push_back(touch);\n    }\n\n    if (_touches.size() == 1)\n    { // scrolling\n        _touchPoint     = this->convertTouchToNodeSpace(touch);\n        _touchMoved     = false;\n        _dragging     = true; //dragging started\n        _scrollDistance = Point(0.0f, 0.0f);\n        _touchLength    = 0.0f;\n    }\n    else if (_touches.size() == 2)\n    {\n        _touchPoint = (this->convertTouchToNodeSpace(_touches[0]).getMidpoint(\n                        this->convertTouchToNodeSpace(_touches[1])));\n        \n        _touchLength = _container->convertTouchToNodeSpace(_touches[0]).getDistance(\n                       _container->convertTouchToNodeSpace(_touches[1]));\n        \n        _dragging  = false;\n    } \n    return true;\n}\n\nvoid ScrollView::onTouchMoved(Touch* touch, Event* event)\n{\n    if (!this->isVisible())\n    {\n        return;\n    }\n\n    if (std::find(_touches.begin(), _touches.end(), touch) != _touches.end())\n    {\n        if (_touches.size() == 1 && _dragging)\n        { // scrolling\n            Point moveDistance, newPoint, maxInset, minInset;\n            Rect  frame;\n            float newX, newY;\n            \n            frame = getViewRect();\n\n            newPoint     = this->convertTouchToNodeSpace(_touches[0]);\n            moveDistance = newPoint - _touchPoint;\n            \n            float dis = 0.0f;\n            if (_direction == Direction::VERTICAL)\n            {\n                dis = moveDistance.y;\n            }\n            else if (_direction == Direction::HORIZONTAL)\n            {\n                dis = moveDistance.x;\n            }\n            else\n            {\n                dis = sqrtf(moveDistance.x*moveDistance.x + moveDistance.y*moveDistance.y);\n            }\n\n            if (!_touchMoved && fabs(convertDistanceFromPointToInch(dis)) < MOVE_INCH )\n            {\n                //CCLOG(\"Invalid movement, distance = [%f, %f], disInch = %f\", moveDistance.x, moveDistance.y);\n                return;\n            }\n            \n            if (!_touchMoved)\n            {\n                moveDistance = Point::ZERO;\n            }\n            \n            _touchPoint = newPoint;\n            _touchMoved = true;\n            \n            if (frame.containsPoint(this->convertToWorldSpace(newPoint)))\n            {\n                switch (_direction)\n                {\n                    case Direction::VERTICAL:\n                        moveDistance = Point(0.0f, moveDistance.y);\n                        break;\n                    case Direction::HORIZONTAL:\n                        moveDistance = Point(moveDistance.x, 0.0f);\n                        break;\n                    default:\n                        break;\n                }\n                \n                maxInset = _maxInset;\n                minInset = _minInset;\n\n                newX     = _container->getPosition().x + moveDistance.x;\n                newY     = _container->getPosition().y + moveDistance.y;\n\n                _scrollDistance = moveDistance;\n                this->setContentOffset(Point(newX, newY));\n            }\n        }\n        else if (_touches.size() == 2 && !_dragging)\n        {\n            const float len = _container->convertTouchToNodeSpace(_touches[0]).getDistance(\n                                            _container->convertTouchToNodeSpace(_touches[1]));\n            this->setZoomScale(this->getZoomScale()*len/_touchLength);\n        }\n    }\n}\n\nvoid ScrollView::onTouchEnded(Touch* touch, Event* event)\n{\n    if (!this->isVisible())\n    {\n        return;\n    }\n    \n    auto touchIter = std::find(_touches.begin(), _touches.end(), touch);\n    \n    if (touchIter != _touches.end())\n    {\n        if (_touches.size() == 1 && _touchMoved)\n        {\n            this->schedule(schedule_selector(ScrollView::deaccelerateScrolling));\n        }\n        _touches.erase(touchIter);\n    } \n\n    if (_touches.size() == 0)\n    {\n        _dragging = false;    \n        _touchMoved = false;\n    }\n}\n\nvoid ScrollView::onTouchCancelled(Touch* touch, Event* event)\n{\n    if (!this->isVisible())\n    {\n        return;\n    }\n    \n    auto touchIter = std::find(_touches.begin(), _touches.end(), touch);\n    _touches.erase(touchIter);\n    \n    if (_touches.size() == 0)\n    {\n        _dragging = false;    \n        _touchMoved = false;\n    }\n}\n\nRect ScrollView::getViewRect()\n{\n    Point screenPos = this->convertToWorldSpace(Point::ZERO);\n    \n    float scaleX = this->getScaleX();\n    float scaleY = this->getScaleY();\n    \n    for (Node *p = _parent; p != NULL; p = p->getParent()) {\n        scaleX *= p->getScaleX();\n        scaleY *= p->getScaleY();\n    }\n\n    // Support negative scaling. Not doing so causes intersectsRect calls\n    // (eg: to check if the touch was within the bounds) to return false.\n    // Note, Node::getScale will assert if X and Y scales are different.\n    if(scaleX<0.f) {\n        screenPos.x += _viewSize.width*scaleX;\n        scaleX = -scaleX;\n    }\n    if(scaleY<0.f) {\n        screenPos.y += _viewSize.height*scaleY;\n        scaleY = -scaleY;\n    }\n\n    return Rect(screenPos.x, screenPos.y, _viewSize.width*scaleX, _viewSize.height*scaleY);\n}\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCScrollView/CCScrollView.h",
    "content": "/****************************************************************************\n Copyright (c) 2012 cocos2d-x.org\n Copyright (c) 2010 Sangwoo Im\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCSCROLLVIEW_H__\n#define __CCSCROLLVIEW_H__\n\n#include \"CCLayer.h\"\n#include \"CCEventListenerTouch.h\"\n\n#include \"extensions/ExtensionMacros.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * @addtogroup GUI\n * @{\n */\n\nclass ScrollView;\n\nclass ScrollViewDelegate\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ScrollViewDelegate() {}\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void scrollViewDidScroll(ScrollView* view) = 0;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void scrollViewDidZoom(ScrollView* view) = 0;\n};\n\n\n/**\n * ScrollView support for cocos2d-x.\n * It provides scroll view functionalities to cocos2d projects natively.\n */\nclass ScrollView : public Layer\n{\npublic:\n    enum class Direction\n    {\n        NONE = -1,\n        HORIZONTAL = 0,\n        VERTICAL,\n        BOTH\n    };\n    /**\n     * Returns an autoreleased scroll view object.\n     *\n     * @param size view size\n     * @param container parent object\n     * @return autoreleased scroll view object\n     */\n    static ScrollView* create(Size size, Node* container = NULL);\n\n    /**\n     * Returns an autoreleased scroll view object.\n     *\n     * @return autoreleased scroll view object\n     */\n    static ScrollView* create();\n    /**\n     * @js ctor\n     */\n    ScrollView();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~ScrollView();\n\n    bool init();\n    /**\n     * Returns a scroll view object\n     *\n     * @param size view size\n     * @param container parent object\n     * @return scroll view object\n     */\n    bool initWithViewSize(Size size, Node* container = NULL);\n\n    /**\n     * Sets a new content offset. It ignores max/min offset. It just sets what's given. (just like UIKit's UIScrollView)\n     *\n     * @param offset    The new offset.\n     * @param animated  If true, the view will scroll to the new offset.\n     */\n    void setContentOffset(Point offset, bool animated = false);\n    Point getContentOffset();\n    /**\n     * Sets a new content offset. It ignores max/min offset. It just sets what's given. (just like UIKit's UIScrollView)\n     * You can override the animation duration with this method.\n     *\n     * @param offset    The new offset.\n     * @param dt        The animation duration.\n     */\n    void setContentOffsetInDuration(Point offset, float dt); \n\n    void setZoomScale(float s);\n    /**\n     * Sets a new scale and does that for a predefined duration.\n     *\n     * @param s         The new scale vale\n     * @param animated  If true, scaling is animated\n     */\n    void setZoomScale(float s, bool animated);\n\n    float getZoomScale();\n\n    /**\n     * Sets a new scale for container in a given duration.\n     *\n     * @param s     The new scale value\n     * @param dt    The animation duration\n     */\n    void setZoomScaleInDuration(float s, float dt);\n    /**\n     * Returns the current container's minimum offset. You may want this while you animate scrolling by yourself\n     */\n    Point minContainerOffset();\n    /**\n     * Returns the current container's maximum offset. You may want this while you animate scrolling by yourself\n     */\n    Point maxContainerOffset(); \n    /**\n     * Determines if a given node's bounding box is in visible bounds\n     *\n     * @returns true if it is in visible bounds\n     */\n    bool isNodeVisible(Node * node);\n    /**\n     * Provided to make scroll view compatible with SWLayer's pause method\n     */\n    void pause(Object* sender);\n    /**\n     * Provided to make scroll view compatible with SWLayer's resume method\n     */\n    void resume(Object* sender);\n\n    void setTouchEnabled(bool enabled);\n\tbool isTouchEnabled() const;\n    bool isDragging() const {return _dragging;}\n    bool isTouchMoved() const { return _touchMoved; }\n    bool isBounceable() const { return _bounceable; }\n    void setBounceable(bool bBounceable) { _bounceable = bBounceable; }\n\n    /**\n     * size to clip. Node boundingBox uses contentSize directly.\n     * It's semantically different what it actually means to common scroll views.\n     * Hence, this scroll view will use a separate size property.\n     */\n    Size getViewSize() const { return _viewSize; }\n    void setViewSize(Size size);\n\n    Node * getContainer();\n    void setContainer(Node * pContainer);\n\n    /**\n     * direction allowed to scroll. ScrollViewDirectionBoth by default.\n     */\n    Direction getDirection() const { return _direction; }\n    virtual void setDirection(Direction eDirection) { _direction = eDirection; }\n    /**\n     * @js NA\n     * @lua NA\n     */\n    ScrollViewDelegate* getDelegate() { return _delegate; }\n    /**\n     * @code\n     * when this function bound to js or lua,the input param are changed\n     * in js: var setDelegate(var jsObject)\n     * in lua: local setDelegate()\n     * @endcode\n     */\n    void setDelegate(ScrollViewDelegate* pDelegate) { _delegate = pDelegate; }\n\n\tvoid updateInset();\n\n    /**\n     * Determines whether it clips its children or not.\n     */\n    bool isClippingToBounds() { return _clippingToBounds; }\n    void setClippingToBounds(bool bClippingToBounds) { _clippingToBounds = bClippingToBounds; }\n\n    virtual bool onTouchBegan(Touch *touch, Event *event);\n    virtual void onTouchMoved(Touch *touch, Event *event);\n    virtual void onTouchEnded(Touch *touch, Event *event);\n    virtual void onTouchCancelled(Touch *touch, Event *event);\n    \n    // Overrides\n    virtual void setContentSize(const Size & size) override;\n    virtual const Size& getContentSize() const override;\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual void visit() override;\n    \n    using Node::addChild;\n    virtual void addChild(Node * child, int zOrder, int tag) override;\n\nprotected:\n    /**\n     * Relocates the container at the proper offset, in bounds of max/min offsets.\n     *\n     * @param animated If true, relocation is animated\n     */\n    void relocateContainer(bool animated);\n    /**\n     * implements auto-scrolling behavior. change SCROLL_DEACCEL_RATE as needed to choose\n     * deacceleration speed. it must be less than 1.0f.\n     *\n     * @param dt delta\n     */\n    void deaccelerateScrolling(float dt);\n    /**\n     * This method makes sure auto scrolling causes delegate to invoke its method\n     */\n    void performedAnimatedScroll(float dt);\n    /**\n     * Expire animated scroll delegate calls\n     */\n    void stoppedAnimatedScroll(Node* node);\n    /**\n     * clip this view so that outside of the visible bounds can be hidden.\n     */\n    void beforeDraw();\n    void onBeforeDraw();\n    /**\n     * retract what's done in beforeDraw so that there's no side effect to\n     * other nodes.\n     */\n    void afterDraw();\n    void onAfterDraw();\n    /**\n     * Zoom handling\n     */\n    void handleZoom();\n\n    Rect getViewRect();\n    \n    /**\n     * current zoom scale\n     */\n    float _zoomScale;\n    /**\n     * min zoom scale\n     */\n    float _minZoomScale;\n    /**\n     * max zoom scale\n     */\n    float _maxZoomScale;\n    /**\n     * scroll view delegate\n     */\n    ScrollViewDelegate* _delegate;\n\n    Direction _direction;\n    /**\n     * If YES, the view is being dragged.\n     */\n    bool _dragging;\n\n    /**\n     * Content offset. Note that left-bottom point is the origin\n     */\n    Point _contentOffset;\n\n    /**\n     * Container holds scroll view contents, Sets the scrollable container object of the scroll view\n     */\n    Node* _container;\n    /**\n     * Determiens whether user touch is moved after begin phase.\n     */\n    bool _touchMoved;\n    /**\n     * max inset point to limit scrolling by touch\n     */\n    Point _maxInset;\n    /**\n     * min inset point to limit scrolling by touch\n     */\n    Point _minInset;\n    /**\n     * Determines whether the scroll view is allowed to bounce or not.\n     */\n    bool _bounceable;\n\n    bool _clippingToBounds;\n\n    /**\n     * scroll speed\n     */\n    Point _scrollDistance;\n    /**\n     * Touch point\n     */\n    Point _touchPoint;\n    /**\n     * length between two fingers\n     */\n    float _touchLength;\n    /**\n     * Touch objects to detect multitouch\n     */\n    std::vector<Touch*> _touches;\n    /**\n     * size to clip. Node boundingBox uses contentSize directly.\n     * It's semantically different what it actually means to common scroll views.\n     * Hence, this scroll view will use a separate size property.\n     */\n    Size _viewSize;\n    /**\n     * max and min scale\n     */\n    float _minScale, _maxScale;\n    /**\n     * scissor rect for parent, just for restoring GL_SCISSOR_BOX\n     */\n    Rect _parentScissorRect;\n    bool _scissorRestored;\n    \n    /** Touch listener */\n    EventListenerTouchOneByOne* _touchListener;\n    \n    CustomCommand _beforeDrawCommand;\n    CustomCommand _afterDrawCommand;\n};\n\n// end of GUI group\n/// @}\n\nNS_CC_EXT_END\n\n#endif /* __CCSCROLLVIEW_H__ */\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCScrollView/CCTableView.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2012 cocos2d-x.org\n Copyright (c) 2010 Sangwoo Im\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCTableView.h\"\n#include \"CCTableViewCell.h\"\n\nNS_CC_EXT_BEGIN\n\nTableView* TableView::create()\n{\n    return TableView::create(nullptr, Size::ZERO);\n}\n\nTableView* TableView::create(TableViewDataSource* dataSource, Size size)\n{\n    return TableView::create(dataSource, size, NULL);\n}\n\nTableView* TableView::create(TableViewDataSource* dataSource, Size size, Node *container)\n{\n    TableView *table = new TableView();\n    table->initWithViewSize(size, container);\n    table->autorelease();\n    table->setDataSource(dataSource);\n    table->_updateCellPositions();\n    table->_updateContentSize();\n\n    return table;\n}\n\nbool TableView::initWithViewSize(Size size, Node* container/* = NULL*/)\n{\n    if (ScrollView::initWithViewSize(size,container))\n    {\n        CC_SAFE_DELETE(_indices);\n        _indices        = new std::set<ssize_t>();\n        _vordering      = VerticalFillOrder::BOTTOM_UP;\n        this->setDirection(Direction::VERTICAL);\n\n        ScrollView::setDelegate(this);\n        return true;\n    }\n    return false;\n}\n\nTableView::TableView()\n: _touchedCell(nullptr)\n, _indices(nullptr)\n, _dataSource(nullptr)\n, _tableViewDelegate(nullptr)\n, _oldDirection(Direction::NONE)\n, _isUsedCellsDirty(false)\n{\n\n}\n\nTableView::~TableView()\n{\n    CC_SAFE_DELETE(_indices);\n}\n\nvoid TableView::setVerticalFillOrder(VerticalFillOrder fillOrder)\n{\n    if (_vordering != fillOrder)\n    {\n        _vordering = fillOrder;\n        if (!_cellsUsed.empty())\n        {\n            this->reloadData();\n        }\n    }\n}\n\nTableView::VerticalFillOrder TableView::getVerticalFillOrder()\n{\n    return _vordering;\n}\n\nvoid TableView::reloadData()\n{\n    _oldDirection = Direction::NONE;\n\n    for(const auto &cell : _cellsUsed) {\n        if(_tableViewDelegate != NULL) {\n            _tableViewDelegate->tableCellWillRecycle(this, cell);\n        }\n\n        _cellsFreed.pushBack(cell);\n        \n        cell->reset();\n        if (cell->getParent() == this->getContainer())\n        {\n            this->getContainer()->removeChild(cell, true);\n        }\n    }\n\n    _indices->clear();\n    _cellsUsed.clear();\n    \n    this->_updateCellPositions();\n    this->_updateContentSize();\n    if (_dataSource->numberOfCellsInTableView(this) > 0)\n    {\n        this->scrollViewDidScroll(this);\n    }\n}\n\nTableViewCell *TableView::cellAtIndex(ssize_t idx)\n{\n    if (_indices->find(idx) != _indices->end())\n    {\n        for (const auto& cell : _cellsUsed)\n        {\n            if (cell->getIdx() == idx)\n            {\n                return cell;\n            }\n        }\n    }\n\n    return nullptr;\n}\n\nvoid TableView::updateCellAtIndex(ssize_t idx)\n{\n    if (idx == CC_INVALID_INDEX)\n    {\n        return;\n    }\n    long countOfItems = _dataSource->numberOfCellsInTableView(this);\n    if (0 == countOfItems || idx > countOfItems-1)\n    {\n        return;\n    }\n\n    TableViewCell* cell = this->cellAtIndex(idx);\n    if (cell)\n    {\n        this->_moveCellOutOfSight(cell);\n    }\n    cell = _dataSource->tableCellAtIndex(this, idx);\n    this->_setIndexForCell(idx, cell);\n    this->_addCellIfNecessary(cell);\n}\n\nvoid TableView::insertCellAtIndex(ssize_t idx)\n{\n    if (idx == CC_INVALID_INDEX)\n    {\n        return;\n    }\n\n    long countOfItems = _dataSource->numberOfCellsInTableView(this);\n    if (0 == countOfItems || idx > countOfItems-1)\n    {\n        return;\n    }\n\n    long newIdx = 0;\n\n    auto cell = cellAtIndex(idx);\n    if (cell)\n    {\n        newIdx = _cellsUsed.getIndex(cell);\n        // Move all cells behind the inserted position\n        for (long i = newIdx; i < _cellsUsed.size(); i++)\n        {\n            cell = _cellsUsed.at(i);\n            this->_setIndexForCell(cell->getIdx()+1, cell);\n        }\n    }\n\n    //insert a new cell\n    cell = _dataSource->tableCellAtIndex(this, idx);\n    this->_setIndexForCell(idx, cell);\n    this->_addCellIfNecessary(cell);\n\n    this->_updateCellPositions();\n    this->_updateContentSize();\n}\n\nvoid TableView::removeCellAtIndex(ssize_t idx)\n{\n    if (idx == CC_INVALID_INDEX)\n    {\n        return;\n    }\n\n    long uCountOfItems = _dataSource->numberOfCellsInTableView(this);\n    if (0 == uCountOfItems || idx > uCountOfItems-1)\n    {\n        return;\n    }\n\n    ssize_t newIdx = 0;\n\n    TableViewCell* cell = this->cellAtIndex(idx);\n    if (!cell)\n    {\n        return;\n    }\n\n    newIdx = _cellsUsed.getIndex(cell);\n\n    //remove first\n    this->_moveCellOutOfSight(cell);\n\n    _indices->erase(idx);\n    this->_updateCellPositions();\n\n    for (ssize_t i = _cellsUsed.size()-1; i > newIdx; i--)\n    {\n        cell = _cellsUsed.at(i);\n        this->_setIndexForCell(cell->getIdx()-1, cell);\n    }\n}\n\nTableViewCell *TableView::dequeueCell()\n{\n    TableViewCell *cell;\n\n    if (_cellsFreed.empty()) {\n        cell = NULL;\n    } else {\n        cell = _cellsFreed.at(0);\n        cell->retain();\n        _cellsFreed.erase(0);\n        cell->autorelease();\n    }\n    return cell;\n}\n\nvoid TableView::_addCellIfNecessary(TableViewCell * cell)\n{\n    if (cell->getParent() != this->getContainer())\n    {\n        this->getContainer()->addChild(cell);\n    }\n    _cellsUsed.pushBack(cell);\n    _indices->insert(cell->getIdx());\n    _isUsedCellsDirty = true;\n}\n\nvoid TableView::_updateContentSize()\n{\n    Size size = Size::ZERO;\n    ssize_t cellsCount = _dataSource->numberOfCellsInTableView(this);\n\n    if (cellsCount > 0)\n    {\n        float maxPosition = _vCellsPositions[cellsCount];\n\n        switch (this->getDirection())\n        {\n            case Direction::HORIZONTAL:\n                size = Size(maxPosition, _viewSize.height);\n                break;\n            default:\n                size = Size(_viewSize.width, maxPosition);\n                break;\n        }\n    }\n\n    this->setContentSize(size);\n\n\tif (_oldDirection != _direction)\n\t{\n\t\tif (_direction == Direction::HORIZONTAL)\n\t\t{\n\t\t\tthis->setContentOffset(Point(0,0));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis->setContentOffset(Point(0,this->minContainerOffset().y));\n\t\t}\n\t\t_oldDirection = _direction;\n\t}\n\n}\n\nPoint TableView::_offsetFromIndex(ssize_t index)\n{\n    Point offset = this->__offsetFromIndex(index);\n\n    const Size cellSize = _dataSource->tableCellSizeForIndex(this, index);\n    if (_vordering == VerticalFillOrder::TOP_DOWN)\n    {\n        offset.y = this->getContainer()->getContentSize().height - offset.y - cellSize.height;\n    }\n    return offset;\n}\n\nPoint TableView::__offsetFromIndex(ssize_t index)\n{\n    Point offset;\n    Size  cellSize;\n\n    switch (this->getDirection())\n    {\n        case Direction::HORIZONTAL:\n            offset = Point(_vCellsPositions[index], 0.0f);\n            break;\n        default:\n            offset = Point(0.0f, _vCellsPositions[index]);\n            break;\n    }\n\n    return offset;\n}\n\nlong TableView::_indexFromOffset(Point offset)\n{\n    long index = 0;\n    const long maxIdx = _dataSource->numberOfCellsInTableView(this) - 1;\n\n    if (_vordering == VerticalFillOrder::TOP_DOWN)\n    {\n        offset.y = this->getContainer()->getContentSize().height - offset.y;\n    }\n    index = this->__indexFromOffset(offset);\n    if (index != -1)\n    {\n        index = MAX(0, index);\n        if (index > maxIdx)\n        {\n            index = CC_INVALID_INDEX;\n        }\n    }\n\n    return index;\n}\n\nlong TableView::__indexFromOffset(Point offset)\n{\n    long low = 0;\n    long high = _dataSource->numberOfCellsInTableView(this) - 1;\n    float search;\n    switch (this->getDirection())\n    {\n        case Direction::HORIZONTAL:\n            search = offset.x;\n            break;\n        default:\n            search = offset.y;\n            break;\n    }\n\n    while (high >= low)\n    {\n        long index = low + (high - low) / 2;\n        float cellStart = _vCellsPositions[index];\n        float cellEnd = _vCellsPositions[index + 1];\n\n        if (search >= cellStart && search <= cellEnd)\n        {\n            return index;\n        }\n        else if (search < cellStart)\n        {\n            high = index - 1;\n        }\n        else\n        {\n            low = index + 1;\n        }\n    }\n\n    if (low <= 0) {\n        return 0;\n    }\n\n    return -1;\n}\n\nvoid TableView::_moveCellOutOfSight(TableViewCell *cell)\n{\n    if(_tableViewDelegate != NULL) {\n        _tableViewDelegate->tableCellWillRecycle(this, cell);\n    }\n\n    _cellsFreed.pushBack(cell);\n    _cellsUsed.eraseObject(cell);\n    _isUsedCellsDirty = true;\n    \n    _indices->erase(cell->getIdx());\n    cell->reset();\n    \n    if (cell->getParent() == this->getContainer())\n    {\n        this->getContainer()->removeChild(cell, true);;\n    }\n}\n\nvoid TableView::_setIndexForCell(ssize_t index, TableViewCell *cell)\n{\n    cell->setAnchorPoint(Point(0.0f, 0.0f));\n    cell->setPosition(this->_offsetFromIndex(index));\n    cell->setIdx(index);\n}\n\nvoid TableView::_updateCellPositions()\n{\n    long cellsCount = _dataSource->numberOfCellsInTableView(this);\n    _vCellsPositions.resize(cellsCount + 1, 0.0);\n\n    if (cellsCount > 0)\n    {\n        float currentPos = 0;\n        Size cellSize;\n        for (int i=0; i < cellsCount; i++)\n        {\n            _vCellsPositions[i] = currentPos;\n            cellSize = _dataSource->tableCellSizeForIndex(this, i);\n            switch (this->getDirection())\n            {\n                case Direction::HORIZONTAL:\n                    currentPos += cellSize.width;\n                    break;\n                default:\n                    currentPos += cellSize.height;\n                    break;\n            }\n        }\n        _vCellsPositions[cellsCount] = currentPos;//1 extra value allows us to get right/bottom of the last cell\n    }\n\n}\n\nvoid TableView::scrollViewDidScroll(ScrollView* view)\n{\n    long countOfItems = _dataSource->numberOfCellsInTableView(this);\n    if (0 == countOfItems)\n    {\n        return;\n    }\n\n    if (_isUsedCellsDirty)\n    {\n        _isUsedCellsDirty = false;\n        std::sort(_cellsUsed.begin(), _cellsUsed.end(), [](TableViewCell *a, TableViewCell *b) -> bool{\n            return a->getIdx() < b->getIdx();\n        });\n    }\n    \n    if(_tableViewDelegate != NULL) {\n        _tableViewDelegate->scrollViewDidScroll(this);\n    }\n\n    ssize_t startIdx = 0, endIdx = 0, idx = 0, maxIdx = 0;\n    Point offset = this->getContentOffset() * -1;\n    maxIdx = MAX(countOfItems-1, 0);\n\n    if (_vordering == VerticalFillOrder::TOP_DOWN)\n    {\n        offset.y = offset.y + _viewSize.height/this->getContainer()->getScaleY();\n    }\n    startIdx = this->_indexFromOffset(offset);\n\tif (startIdx == CC_INVALID_INDEX)\n\t{\n\t\tstartIdx = countOfItems - 1;\n\t}\n\n    if (_vordering == VerticalFillOrder::TOP_DOWN)\n    {\n        offset.y -= _viewSize.height/this->getContainer()->getScaleY();\n    }\n    else\n    {\n        offset.y += _viewSize.height/this->getContainer()->getScaleY();\n    }\n    offset.x += _viewSize.width/this->getContainer()->getScaleX();\n\n    endIdx   = this->_indexFromOffset(offset);\n    if (endIdx == CC_INVALID_INDEX)\n\t{\n\t\tendIdx = countOfItems - 1;\n\t}\n\n#if 0 // For Testing.\n    Object* pObj;\n    int i = 0;\n    CCARRAY_FOREACH(_cellsUsed, pObj)\n    {\n        TableViewCell* pCell = static_cast<TableViewCell*>(pObj);\n        log(\"cells Used index %d, value = %d\", i, pCell->getIdx());\n        i++;\n    }\n    log(\"---------------------------------------\");\n    i = 0;\n    CCARRAY_FOREACH(_cellsFreed, pObj)\n    {\n        TableViewCell* pCell = static_cast<TableViewCell*>(pObj);\n        log(\"cells freed index %d, value = %d\", i, pCell->getIdx());\n        i++;\n    }\n    log(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n#endif\n\n    if (!_cellsUsed.empty())\n    {\n        auto cell = _cellsUsed.at(0);\n        idx = cell->getIdx();\n        \n        while(idx < startIdx)\n        {\n            this->_moveCellOutOfSight(cell);\n            if (!_cellsUsed.empty())\n            {\n                cell = _cellsUsed.at(0);\n                idx = cell->getIdx();\n            }\n            else\n            {\n                break;\n            }\n        }\n    }\n    if (!_cellsUsed.empty())\n    {\n        auto cell = _cellsUsed.back();\n        idx = cell->getIdx();\n\n        while(idx <= maxIdx && idx > endIdx)\n        {\n            this->_moveCellOutOfSight(cell);\n            if (!_cellsUsed.empty())\n            {\n                cell = _cellsUsed.back();\n                idx = cell->getIdx();\n            }\n            else\n            {\n                break;\n            }\n        }\n    }\n\n    for (long i = startIdx; i <= endIdx; i++)\n    {\n        if (_indices->find(i) != _indices->end())\n        {\n            continue;\n        }\n        this->updateCellAtIndex(i);\n    }\n}\n\nvoid TableView::onTouchEnded(Touch *pTouch, Event *pEvent)\n{\n    if (!this->isVisible()) {\n        return;\n    }\n\n    if (_touchedCell){\n\t\tRect bb = this->getBoundingBox();\n\t\tbb.origin = _parent->convertToWorldSpace(bb.origin);\n\n\t\tif (bb.containsPoint(pTouch->getLocation()) && _tableViewDelegate != NULL)\n        {\n            _tableViewDelegate->tableCellUnhighlight(this, _touchedCell);\n            _tableViewDelegate->tableCellTouched(this, _touchedCell);\n        }\n\n        _touchedCell = NULL;\n    }\n\n    ScrollView::onTouchEnded(pTouch, pEvent);\n}\n\nbool TableView::onTouchBegan(Touch *pTouch, Event *pEvent)\n{\n    if (!this->isVisible())\n    {\n        return false;\n    }\n\n    bool touchResult = ScrollView::onTouchBegan(pTouch, pEvent);\n\n    if(_touches.size() == 1)\n    {\n        long index;\n        Point point;\n\n        point = this->getContainer()->convertTouchToNodeSpace(pTouch);\n\n        index = this->_indexFromOffset(point);\n\t\tif (index == CC_INVALID_INDEX)\n\t\t{\n\t\t\t_touchedCell = NULL;\n\t\t}\n        else\n\t\t{\n\t\t\t_touchedCell  = this->cellAtIndex(index);\n\t\t}\n\n        if (_touchedCell && _tableViewDelegate != NULL)\n        {\n            _tableViewDelegate->tableCellHighlight(this, _touchedCell);\n        }\n    }\n    else if (_touchedCell)\n    {\n        if(_tableViewDelegate != NULL)\n        {\n            _tableViewDelegate->tableCellUnhighlight(this, _touchedCell);\n        }\n\n        _touchedCell = NULL;\n    }\n\n    return touchResult;\n}\n\nvoid TableView::onTouchMoved(Touch *pTouch, Event *pEvent)\n{\n    ScrollView::onTouchMoved(pTouch, pEvent);\n\n    if (_touchedCell && isTouchMoved())\n    {\n        if(_tableViewDelegate != NULL)\n        {\n            _tableViewDelegate->tableCellUnhighlight(this, _touchedCell);\n        }\n\n        _touchedCell = NULL;\n    }\n}\n\nvoid TableView::onTouchCancelled(Touch *pTouch, Event *pEvent)\n{\n    ScrollView::onTouchCancelled(pTouch, pEvent);\n\n    if (_touchedCell)\n    {\n        if(_tableViewDelegate != NULL)\n        {\n            _tableViewDelegate->tableCellUnhighlight(this, _touchedCell);\n        }\n\n        _touchedCell = NULL;\n    }\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCScrollView/CCTableView.h",
    "content": "/****************************************************************************\n Copyright (c) 2012 cocos2d-x.org\n Copyright (c) 2010 Sangwoo Im\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCTABLEVIEW_H__\n#define __CCTABLEVIEW_H__\n\n#include \"CCScrollView.h\"\n#include \"CCTableViewCell.h\"\n\n#include <set>\n#include <vector>\n\nNS_CC_EXT_BEGIN\n\nclass TableView;\n\n/**\n * Sole purpose of this delegate is to single touch event in this version.\n */\nclass TableViewDelegate : public ScrollViewDelegate\n{\npublic:\n    /**\n     * Delegate to respond touch event\n     *\n     * @param table table contains the given cell\n     * @param cell  cell that is touched\n     * @js NA\n     * @lua NA\n     */\n    virtual void tableCellTouched(TableView* table, TableViewCell* cell) = 0;\n\n    /**\n     * Delegate to respond a table cell press event.\n     *\n     * @param table table contains the given cell\n     * @param cell  cell that is pressed\n     * @js NA\n     * @lua NA\n     */\n    virtual void tableCellHighlight(TableView* table, TableViewCell* cell){};\n\n    /**\n     * Delegate to respond a table cell release event\n     *\n     * @param table table contains the given cell\n     * @param cell  cell that is pressed\n     * @js NA\n     * @lua NA\n     */\n    virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell){};\n\n    /**\n     * Delegate called when the cell is about to be recycled. Immediately\n     * after this call the cell will be removed from the scene graph and\n     * recycled.\n     *\n     * @param table table contains the given cell\n     * @param cell  cell that is pressed\n     * @js NA\n     * @lua NA\n     */\n    virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell){};\n\n};\n\n\n/**\n * Data source that governs table backend data.\n */\nclass TableViewDataSource\n{\npublic:\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TableViewDataSource() {}\n\n    /**\n     * cell size for a given index\n     *\n     * @param idx the index of a cell to get a size\n     * @return size of a cell at given index\n     */\n    virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) {\n        return cellSizeForTable(table);\n    };\n    /**\n     * cell height for a given table.\n     *\n     * @param table table to hold the instances of Class\n     * @return cell size\n     */\n    virtual Size cellSizeForTable(TableView *table) {\n        return Size::ZERO;\n    };\n    /**\n     * a cell instance at a given index\n     *\n     * @param idx index to search for a cell\n     * @return cell found at idx\n     */\n    virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) = 0;\n    /**\n     * Returns number of cells in a given table view.\n     *\n     * @return number of cells\n     */\n    virtual ssize_t numberOfCellsInTableView(TableView *table) = 0;\n\n};\n\n\n/**\n * UITableView support for cocos2d-x.\n *\n * This is a very basic, minimal implementation to bring UITableView-like component into cocos2d world.\n */\nclass TableView : public ScrollView, public ScrollViewDelegate\n{\npublic:\n    \n    enum class VerticalFillOrder\n    {\n        TOP_DOWN,\n        BOTTOM_UP\n    };\n    \n    /** Empty contructor of TableView */\n    static TableView* create();\n    \n    /**\n     * An intialized table view object\n     *\n     * @param dataSource data source\n     * @param size view size\n     * @return table view\n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js:var create(var jsObject,var size)\n     * in lua:local create(var size)\n     * in lua:\n     * @endcode\n     */\n    static TableView* create(TableViewDataSource* dataSource, Size size);\n    /**\n     * An initialized table view object\n     *\n     * @param dataSource data source;\n     * @param size view size\n     * @param container parent object for cells\n     * @return table view\n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js:var create(var jsObject,var size,var container)\n     * in lua:local create(var size, var container)\n     * in lua:\n     * @endcode\n     */\n    static TableView* create(TableViewDataSource* dataSource, Size size, Node *container);\n    /**\n     * @js ctor\n     */\n    TableView();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~TableView();\n\n    bool initWithViewSize(Size size, Node* container = NULL);\n\n    /**\n     * data source\n     * @js NA\n     * @lua NA\n     */\n    TableViewDataSource* getDataSource() { return _dataSource; }\n    /**\n     * when this function bound to js or lua,the input params are changed\n     * in js:var setDataSource(var jsSource)\n     * in lua:local setDataSource()\n     * @endcode\n     */\n    void setDataSource(TableViewDataSource* source) { _dataSource = source; }\n    /**\n     * delegate\n     * @js NA\n     * @lua NA\n     */\n    TableViewDelegate* getDelegate() { return _tableViewDelegate; }\n    /**\n     * @code\n     * when this function bound to js or lua,the input params are changed\n     * in js:var setDelegate(var jsDelegate)\n     * in lua:local setDelegate()\n     * @endcode\n     */\n    void setDelegate(TableViewDelegate* pDelegate) { _tableViewDelegate = pDelegate; }\n\n    /**\n     * determines how cell is ordered and filled in the view.\n     */\n    void setVerticalFillOrder(VerticalFillOrder order);\n    VerticalFillOrder getVerticalFillOrder();\n\n    /**\n     * Updates the content of the cell at a given index.\n     *\n     * @param idx index to find a cell\n     */\n    void updateCellAtIndex(ssize_t idx);\n    /**\n     * Inserts a new cell at a given index\n     *\n     * @param idx location to insert\n     */\n    void insertCellAtIndex(ssize_t idx);\n    /**\n     * Removes a cell at a given index\n     *\n     * @param idx index to find a cell\n     */\n    void removeCellAtIndex(ssize_t idx);\n    /**\n     * reloads data from data source.  the view will be refreshed.\n     */\n    void reloadData();\n    /**\n     * Dequeues a free cell if available. nil if not.\n     *\n     * @return free cell\n     */\n    TableViewCell *dequeueCell();\n\n    /**\n     * Returns an existing cell at a given index. Returns nil if a cell is nonexistent at the moment of query.\n     *\n     * @param idx index\n     * @return a cell at a given index\n     */\n    TableViewCell *cellAtIndex(ssize_t idx);\n\n    // Overrides\n    virtual void scrollViewDidScroll(ScrollView* view) override;\n    virtual void scrollViewDidZoom(ScrollView* view)  override {}\n    virtual bool onTouchBegan(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchMoved(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchEnded(Touch *pTouch, Event *pEvent) override;\n    virtual void onTouchCancelled(Touch *pTouch, Event *pEvent) override;\n\nprotected:\n    long __indexFromOffset(Point offset);\n    long _indexFromOffset(Point offset);\n    Point __offsetFromIndex(ssize_t index);\n    Point _offsetFromIndex(ssize_t index);\n\n    void _moveCellOutOfSight(TableViewCell *cell);\n    void _setIndexForCell(ssize_t index, TableViewCell *cell);\n    void _addCellIfNecessary(TableViewCell * cell);\n\n    void _updateCellPositions();\n\n\n    TableViewCell *_touchedCell;\n    /**\n     * vertical direction of cell filling\n     */\n    VerticalFillOrder _vordering;\n\n    /**\n     * index set to query the indexes of the cells used.\n     */\n    std::set<ssize_t>* _indices;\n\n    /**\n     * vector with all cell positions\n     */\n    std::vector<float> _vCellsPositions;\n    //NSMutableIndexSet *indices_;\n    /**\n     * cells that are currently in the table\n     */\n    Vector<TableViewCell*> _cellsUsed;\n    /**\n     * free list of cells\n     */\n    Vector<TableViewCell*> _cellsFreed;\n    /**\n     * weak link to the data source object\n     */\n    TableViewDataSource* _dataSource;\n    /**\n     * weak link to the delegate object\n     */\n    TableViewDelegate* _tableViewDelegate;\n\n    Direction _oldDirection;\n\n    bool _isUsedCellsDirty;\n\npublic:\n    void _updateContentSize();\n\n};\n\n\nNS_CC_EXT_END\n\n#endif /* __CCTABLEVIEW_H__ */\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCScrollView/CCTableViewCell.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2012 cocos2d-x.org\n Copyright (c) 2010 Sangwoo Im\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"CCTableViewCell.h\"\n#include \"ccCArray.h\"\n\nNS_CC_EXT_BEGIN\n\nvoid TableViewCell::reset()\n{\n    _idx = CC_INVALID_INDEX;\n}\n\nssize_t TableViewCell::getIdx() const\n{\n    return _idx;\n}\n\nvoid TableViewCell::setIdx(ssize_t idx)\n{\n    _idx = idx;\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/GUI/CCScrollView/CCTableViewCell.h",
    "content": "/****************************************************************************\n Copyright (c) 2012 cocos2d-x.org\n Copyright (c) 2010 Sangwoo Im\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __CCTABLEVIEWCELL_H__\n#define __CCTABLEVIEWCELL_H__\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCNode.h\"\n\nNS_CC_EXT_BEGIN\n\n/**\n * Abstract class for SWTableView cell node\n */\nclass TableViewCell: public Node\n{\npublic:\n    CREATE_FUNC(TableViewCell);\n    \n    TableViewCell() {}\n    /**\n     * The index used internally by SWTableView and its subclasses\n     */\n    ssize_t getIdx() const;\n    void setIdx(ssize_t uIdx);\n    /**\n     * Cleans up any resources linked to this cell and resets <code>idx</code> property.\n     */\n    void reset();\n\nprivate:\n    ssize_t _idx;\n};\n\nNS_CC_EXT_END\n\n#endif /* __CCTABLEVIEWCELL_H__ */\n"
  },
  {
    "path": "cocos2d/extensions/assets-manager/AssetsManager.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"AssetsManager.h\"\n#include \"cocos2d.h\"\n\n#include <curl/curl.h>\n#include <curl/easy.h>\n#include <stdio.h>\n#include <vector>\n#include <thread>\n\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <errno.h>\n#include <dirent.h>\n#endif\n\n\n#include \"unzip.h\"\n\nusing namespace cocos2d;\nusing namespace std;\n\nNS_CC_EXT_BEGIN;\n\n#define KEY_OF_VERSION   \"current-version-code\"\n#define KEY_OF_DOWNLOADED_VERSION    \"downloaded-version-code\"\n#define TEMP_PACKAGE_FILE_NAME    \"cocos2dx-update-temp-package.zip\"\n#define BUFFER_SIZE    8192\n#define MAX_FILENAME   512\n\n#define LOW_SPEED_LIMIT 1L\n#define LOW_SPEED_TIME 5L\n\n\n// Message type\n#define ASSETSMANAGER_MESSAGE_UPDATE_SUCCEED                0\n#define ASSETSMANAGER_MESSAGE_RECORD_DOWNLOADED_VERSION     1\n#define ASSETSMANAGER_MESSAGE_PROGRESS                      2\n#define ASSETSMANAGER_MESSAGE_ERROR                         3\n\n// Some data struct for sending messages\n\nstruct ErrorMessage\n{\n    AssetsManager::ErrorCode code;\n    AssetsManager* manager;\n};\n\nstruct ProgressMessage\n{\n    int percent;\n    AssetsManager* manager;\n};\n\n// Implementation of AssetsManager\n\nAssetsManager::AssetsManager(const char* packageUrl/* =NULL */, const char* versionFileUrl/* =NULL */, const char* storagePath/* =NULL */)\n:  _storagePath(storagePath)\n, _version(\"\")\n, _packageUrl(packageUrl)\n, _versionFileUrl(versionFileUrl)\n, _downloadedVersion(\"\")\n, _curl(NULL)\n, _connectionTimeout(0)\n, _delegate(NULL)\n, _isDownloading(false)\n, _shouldDeleteDelegateWhenExit(false)\n{\n    checkStoragePath();\n}\n\nAssetsManager::~AssetsManager()\n{\n    if (_shouldDeleteDelegateWhenExit)\n    {\n        delete _delegate;\n    }\n}\n\nvoid AssetsManager::checkStoragePath()\n{\n    if (_storagePath.size() > 0 && _storagePath[_storagePath.size() - 1] != '/')\n    {\n        _storagePath.append(\"/\");\n    }\n}\n\n// Multiple key names\nstatic std::string keyWithHash( const char* prefix, const std::string& url )\n{\n    char buf[256];\n    sprintf(buf,\"%s%zd\",prefix,std::hash<std::string>()(url));\n    return buf;\n}\n\n// hashed version\nstd::string AssetsManager::keyOfVersion() const\n{\n    return keyWithHash(KEY_OF_VERSION,_packageUrl);\n}\n\n// hashed version\nstd::string AssetsManager::keyOfDownloadedVersion() const\n{\n    return keyWithHash(KEY_OF_DOWNLOADED_VERSION,_packageUrl);\n}\n\nstatic size_t getVersionCode(void *ptr, size_t size, size_t nmemb, void *userdata)\n{\n    string *version = (string*)userdata;\n    version->append((char*)ptr, size * nmemb);\n    \n    return (size * nmemb);\n}\n\nbool AssetsManager::checkUpdate()\n{\n    if (_versionFileUrl.size() == 0) return false;\n    \n    _curl = curl_easy_init();\n    if (! _curl)\n    {\n        CCLOG(\"can not init curl\");\n        return false;\n    }\n    \n    // Clear _version before assign new value.\n    _version.clear();\n    \n    CURLcode res;\n    curl_easy_setopt(_curl, CURLOPT_URL, _versionFileUrl.c_str());\n    curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYPEER, 0L);\n    curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, getVersionCode);\n    curl_easy_setopt(_curl, CURLOPT_WRITEDATA, &_version);\n    if (_connectionTimeout) curl_easy_setopt(_curl, CURLOPT_CONNECTTIMEOUT, _connectionTimeout);\n    curl_easy_setopt(_curl, CURLOPT_NOSIGNAL, 1L);\n    curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_LIMIT, LOW_SPEED_LIMIT);\n    curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_TIME, LOW_SPEED_TIME);\n    res = curl_easy_perform(_curl);\n    \n    if (res != 0)\n    {\n        Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this]{\n            if (this->_delegate)\n                this->_delegate->onError(ErrorCode::NETWORK);\n        });\n        CCLOG(\"can not get version file content, error code is %d\", res);\n        curl_easy_cleanup(_curl);\n        return false;\n    }\n    \n    string recordedVersion = UserDefault::getInstance()->getStringForKey(keyOfVersion().c_str());\n    if (recordedVersion == _version)\n    {\n        Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this]{\n            if (this->_delegate)\n                this->_delegate->onError(ErrorCode::NO_NEW_VERSION);\n        });\n        CCLOG(\"there is not new version\");\n        // Set resource search path.\n        setSearchPath();\n        return false;\n    }\n    \n    CCLOG(\"there is a new version: %s\", _version.c_str());\n    \n    return true;\n}\n\nvoid AssetsManager::downloadAndUncompress()\n{\n    do\n    {\n        if (_downloadedVersion != _version)\n        {\n            if (! downLoad()) break;\n            \n            Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this]{\n                UserDefault::getInstance()->setStringForKey(this->keyOfDownloadedVersion().c_str(),\n                                                            this->_version.c_str());\n                UserDefault::getInstance()->flush();\n            });\n        }\n        \n        // Uncompress zip file.\n        if (! uncompress())\n        {\n            Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this]{\n                if (this->_delegate)\n                    this->_delegate->onError(ErrorCode::UNCOMPRESS);\n            });\n            break;\n        }\n        \n        Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this] {\n            \n            // Record new version code.\n            UserDefault::getInstance()->setStringForKey(this->keyOfVersion().c_str(), this->_version.c_str());\n            \n            // Unrecord downloaded version code.\n            UserDefault::getInstance()->setStringForKey(this->keyOfDownloadedVersion().c_str(), \"\");\n            UserDefault::getInstance()->flush();\n            \n            // Set resource search path.\n            this->setSearchPath();\n            \n            // Delete unloaded zip file.\n            string zipfileName = this->_storagePath + TEMP_PACKAGE_FILE_NAME;\n            if (remove(zipfileName.c_str()) != 0)\n            {\n                CCLOG(\"can not remove downloaded zip file %s\", zipfileName.c_str());\n            }\n            \n            if (this->_delegate) this->_delegate->onSuccess();\n        });\n       \n    } while (0);\n    \n    _isDownloading = false;\n}\n\nvoid AssetsManager::update()\n{\n    if (_isDownloading) return;\n    \n    _isDownloading = true;\n    \n    // 1. Urls of package and version should be valid;\n    // 2. Package should be a zip file.\n    if (_versionFileUrl.size() == 0 ||\n        _packageUrl.size() == 0 ||\n        std::string::npos == _packageUrl.find(\".zip\"))\n    {\n        CCLOG(\"no version file url, or no package url, or the package is not a zip file\");\n        _isDownloading = false;\n        return;\n    }\n    \n    // Check if there is a new version.\n    if (! checkUpdate())\n    {\n        _isDownloading = false;\n        return;\n    }\n    \n    // Is package already downloaded?\n    _downloadedVersion = UserDefault::getInstance()->getStringForKey(keyOfDownloadedVersion().c_str());\n    \n    auto t = std::thread(&AssetsManager::downloadAndUncompress, this);\n    t.detach();\n}\n\nbool AssetsManager::uncompress()\n{\n    // Open the zip file\n    string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME;\n    unzFile zipfile = unzOpen(outFileName.c_str());\n    if (! zipfile)\n    {\n        CCLOG(\"can not open downloaded zip file %s\", outFileName.c_str());\n        return false;\n    }\n    \n    // Get info about the zip file\n    unz_global_info global_info;\n    if (unzGetGlobalInfo(zipfile, &global_info) != UNZ_OK)\n    {\n        CCLOG(\"can not read file global info of %s\", outFileName.c_str());\n        unzClose(zipfile);\n        return false;\n    }\n    \n    // Buffer to hold data read from the zip file\n    char readBuffer[BUFFER_SIZE];\n    \n    CCLOG(\"start uncompressing\");\n    \n    // Loop to extract all files.\n    uLong i;\n    for (i = 0; i < global_info.number_entry; ++i)\n    {\n        // Get info about current file.\n        unz_file_info fileInfo;\n        char fileName[MAX_FILENAME];\n        if (unzGetCurrentFileInfo(zipfile,\n                                  &fileInfo,\n                                  fileName,\n                                  MAX_FILENAME,\n                                  NULL,\n                                  0,\n                                  NULL,\n                                  0) != UNZ_OK)\n        {\n            CCLOG(\"can not read file info\");\n            unzClose(zipfile);\n            return false;\n        }\n        \n        const string fullPath = _storagePath + fileName;\n        \n        // Check if this entry is a directory or a file.\n        const size_t filenameLength = strlen(fileName);\n        if (fileName[filenameLength-1] == '/')\n        {\n            // Entry is a direcotry, so create it.\n            // If the directory exists, it will failed scilently.\n            if (!createDirectory(fullPath.c_str()))\n            {\n                CCLOG(\"can not create directory %s\", fullPath.c_str());\n                unzClose(zipfile);\n                return false;\n            }\n        }\n        else\n        {\n            //There are not directory entry in some case.\n            //So we need to test whether the file directory exists when uncompressing file entry\n            //, if does not exist then create directory\n            const string fileNameStr(fileName);\n            \n            size_t startIndex=0;\n            \n            size_t index=fileNameStr.find(\"/\",startIndex);\n            \n            while(index != std::string::npos)\n            {\n                const string dir=_storagePath+fileNameStr.substr(0,index);\n                \n                FILE *out = fopen(dir.c_str(), \"r\");\n                \n                if(!out)\n                {\n                    if (!createDirectory(dir.c_str()))\n                    {\n                        CCLOG(\"can not create directory %s\", dir.c_str());\n                        unzClose(zipfile);\n                        return false;\n                    }\n                    else\n                    {\n                        CCLOG(\"create directory %s\",dir.c_str());\n                    }\n                }\n                else\n                {\n                    fclose(out);\n                }\n                \n                startIndex=index+1;\n                \n                index=fileNameStr.find(\"/\",startIndex);\n                \n            }\n            \n            \n            \n            // Entry is a file, so extract it.\n            \n            // Open current file.\n            if (unzOpenCurrentFile(zipfile) != UNZ_OK)\n            {\n                CCLOG(\"can not open file %s\", fileName);\n                unzClose(zipfile);\n                return false;\n            }\n            \n            // Create a file to store current file.\n            FILE *out = fopen(fullPath.c_str(), \"wb\");\n            if (! out)\n            {\n                CCLOG(\"can not open destination file %s\", fullPath.c_str());\n                unzCloseCurrentFile(zipfile);\n                unzClose(zipfile);\n                return false;\n            }\n            \n            // Write current file content to destinate file.\n            int error = UNZ_OK;\n            do\n            {\n                error = unzReadCurrentFile(zipfile, readBuffer, BUFFER_SIZE);\n                if (error < 0)\n                {\n                    CCLOG(\"can not read zip file %s, error code is %d\", fileName, error);\n                    unzCloseCurrentFile(zipfile);\n                    unzClose(zipfile);\n                    return false;\n                }\n                \n                if (error > 0)\n                {\n                    fwrite(readBuffer, error, 1, out);\n                }\n            } while(error > 0);\n            \n            fclose(out);\n        }\n        \n        unzCloseCurrentFile(zipfile);\n        \n        // Goto next entry listed in the zip file.\n        if ((i+1) < global_info.number_entry)\n        {\n            if (unzGoToNextFile(zipfile) != UNZ_OK)\n            {\n                CCLOG(\"can not read next file\");\n                unzClose(zipfile);\n                return false;\n            }\n        }\n    }\n    \n    CCLOG(\"end uncompressing\");\n    \n    return true;\n}\n\n/*\n * Create a direcotry is platform depended.\n */\nbool AssetsManager::createDirectory(const char *path)\n{\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)\n    mode_t processMask = umask(0);\n    int ret = mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO);\n    umask(processMask);\n    if (ret != 0 && (errno != EEXIST))\n    {\n        return false;\n    }\n    \n    return true;\n#else\n    BOOL ret = CreateDirectoryA(path, NULL);\n\tif (!ret && ERROR_ALREADY_EXISTS != GetLastError())\n\t{\n\t\treturn false;\n\t}\n    return true;\n#endif\n}\n\nvoid AssetsManager::setSearchPath()\n{\n    vector<string> searchPaths = FileUtils::getInstance()->getSearchPaths();\n    vector<string>::iterator iter = searchPaths.begin();\n    searchPaths.insert(iter, _storagePath);\n    FileUtils::getInstance()->setSearchPaths(searchPaths);\n}\n\nstatic size_t downLoadPackage(void *ptr, size_t size, size_t nmemb, void *userdata)\n{\n    FILE *fp = (FILE*)userdata;\n    size_t written = fwrite(ptr, size, nmemb, fp);\n    return written;\n}\n\nint assetsManagerProgressFunc(void *ptr, double totalToDownload, double nowDownloaded, double totalToUpLoad, double nowUpLoaded)\n{\n    static int percent = 0;\n    int tmp = (int)(nowDownloaded / totalToDownload * 100);\n    \n    if (percent != tmp)\n    {\n        percent = tmp;\n        Director::getInstance()->getScheduler()->performFunctionInCocosThread([=]{\n            auto manager = static_cast<AssetsManager*>(ptr);\n            if (manager->_delegate)\n                manager->_delegate->onProgress(percent);\n        });\n        \n        CCLOG(\"downloading... %d%%\", percent);\n    }\n    \n    return 0;\n}\n\nbool AssetsManager::downLoad()\n{\n    // Create a file to save package.\n    const string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME;\n    FILE *fp = fopen(outFileName.c_str(), \"wb\");\n    if (! fp)\n    {\n        Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this]{\n            if (this->_delegate)\n                this->_delegate->onError(ErrorCode::CREATE_FILE);\n        });\n        CCLOG(\"can not create file %s\", outFileName.c_str());\n        return false;\n    }\n    \n    // Download pacakge\n    CURLcode res;\n    curl_easy_setopt(_curl, CURLOPT_URL, _packageUrl.c_str());\n    curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, downLoadPackage);\n    curl_easy_setopt(_curl, CURLOPT_WRITEDATA, fp);\n    curl_easy_setopt(_curl, CURLOPT_NOPROGRESS, false);\n    curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, assetsManagerProgressFunc);\n    curl_easy_setopt(_curl, CURLOPT_PROGRESSDATA, this);\n    curl_easy_setopt(_curl, CURLOPT_NOSIGNAL, 1L);\n    curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_LIMIT, LOW_SPEED_LIMIT);\n    curl_easy_setopt(_curl, CURLOPT_LOW_SPEED_TIME, LOW_SPEED_TIME);\n\n    res = curl_easy_perform(_curl);\n    curl_easy_cleanup(_curl);\n    if (res != 0)\n    {\n        Director::getInstance()->getScheduler()->performFunctionInCocosThread([&, this]{\n            if (this->_delegate)\n                this->_delegate->onError(ErrorCode::NETWORK);\n        });\n        CCLOG(\"error when download package\");\n        fclose(fp);\n        return false;\n    }\n    \n    CCLOG(\"succeed downloading package %s\", _packageUrl.c_str());\n    \n    fclose(fp);\n    return true;\n}\n\nconst char* AssetsManager::getPackageUrl() const\n{\n    return _packageUrl.c_str();\n}\n\nvoid AssetsManager::setPackageUrl(const char *packageUrl)\n{\n    _packageUrl = packageUrl;\n}\n\nconst char* AssetsManager::getStoragePath() const\n{\n    return _storagePath.c_str();\n}\n\nvoid AssetsManager::setStoragePath(const char *storagePath)\n{\n    _storagePath = storagePath;\n    checkStoragePath();\n}\n\nconst char* AssetsManager::getVersionFileUrl() const\n{\n    return _versionFileUrl.c_str();\n}\n\nvoid AssetsManager::setVersionFileUrl(const char *versionFileUrl)\n{\n    _versionFileUrl = versionFileUrl;\n}\n\nstring AssetsManager::getVersion()\n{\n    return UserDefault::getInstance()->getStringForKey(keyOfVersion().c_str());\n}\n\nvoid AssetsManager::deleteVersion()\n{\n    UserDefault::getInstance()->setStringForKey(keyOfVersion().c_str(), \"\");\n}\n\nvoid AssetsManager::setDelegate(AssetsManagerDelegateProtocol *delegate)\n{\n    _delegate = delegate;\n}\n\nvoid AssetsManager::setConnectionTimeout(unsigned int timeout)\n{\n    _connectionTimeout = timeout;\n}\n\nunsigned int AssetsManager::getConnectionTimeout()\n{\n    return _connectionTimeout;\n}\n\nAssetsManager* AssetsManager::create(const char* packageUrl, const char* versionFileUrl, const char* storagePath, ErrorCallback errorCallback, ProgressCallback progressCallback, SuccessCallback successCallback )\n{\n    class DelegateProtocolImpl : public AssetsManagerDelegateProtocol \n    {\n    public :\n        DelegateProtocolImpl(ErrorCallback aErrorCallback, ProgressCallback aProgressCallback, SuccessCallback aSuccessCallback)\n        : errorCallback(aErrorCallback), progressCallback(aProgressCallback), successCallback(aSuccessCallback)\n        {}\n\n        virtual void onError(AssetsManager::ErrorCode errorCode) { errorCallback(int(errorCode)); }\n        virtual void onProgress(int percent) { progressCallback(percent); }\n        virtual void onSuccess() { successCallback(); }\n\n    private :\n        ErrorCallback errorCallback;\n        ProgressCallback progressCallback;\n        SuccessCallback successCallback;\n    };\n\n    auto* manager = new AssetsManager(packageUrl,versionFileUrl,storagePath);\n    auto* delegate = new DelegateProtocolImpl(errorCallback,progressCallback,successCallback);\n    manager->setDelegate(delegate);\n    manager->_shouldDeleteDelegateWhenExit = true;\n    manager->autorelease();\n    return manager;\n}\n\nvoid AssetsManager::createStoragePath()\n{\n    // Remove downloaded files\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)\n    DIR *dir = NULL;\n    \n    dir = opendir (_storagePath.c_str());\n    if (!dir)\n    {\n        mkdir(_storagePath.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);\n    }\n#else    \n    if ((GetFileAttributesA(_storagePath.c_str())) == INVALID_FILE_ATTRIBUTES)\n    {\n        CreateDirectoryA(_storagePath.c_str(), 0);\n    }\n#endif\n}\n\nvoid AssetsManager::destroyStoragePath()\n{\n    // Delete recorded version codes.\n    deleteVersion();\n    \n    // Remove downloaded files\n#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)\n    string command = \"rm -r \";\n    // Path may include space.\n    command += \"\\\"\" + _storagePath + \"\\\"\";\n    system(command.c_str());    \n#else\n    string command = \"rd /s /q \";\n    // Path may include space.\n    command += \"\\\"\" + _storagePath + \"\\\"\";\n    system(command.c_str());\n#endif\n}\n\nNS_CC_EXT_END;\n"
  },
  {
    "path": "cocos2d/extensions/assets-manager/AssetsManager.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#ifndef __AssetsManager__\n#define __AssetsManager__\n\n#include <string>\n\n#include <mutex>\n\n#include \"cocos2d.h\"\n#include \"extensions/ExtensionMacros.h\"\n\nNS_CC_EXT_BEGIN\n\nclass AssetsManagerDelegateProtocol;\n\n/*\n *  This class is used to auto update resources, such as pictures or scripts.\n *  The updated package should be a zip file. And there should be a file named\n *  version in the server, which contains version code.\n */\nclass AssetsManager : public Node\n{\npublic:\n    enum class ErrorCode\n    {\n        // Error caused by creating a file to store downloaded data\n        CREATE_FILE,\n        /** Error caused by network\n         -- network unavaivable\n         -- timeout\n         -- ...\n         */\n        NETWORK,\n        /** There is not a new version\n         */\n        NO_NEW_VERSION,\n        /** Error caused in uncompressing stage\n         -- can not open zip file\n         -- can not read file global information\n         -- can not read file information\n         -- can not create a directory\n         -- ...\n         */\n        UNCOMPRESS,\n    };\n    \n    /* @brief Creates a AssetsManager with new package url, version code url and storage path.\n     *\n     * @param packageUrl URL of new package, the package should be a zip file.\n     * @param versionFileUrl URL of version file. It should contain version code of new package.\n     * @param storagePath The path to store downloaded resources.\n     * @js NA\n     */\n    AssetsManager(const char* packageUrl = NULL, const char* versionFileUrl = NULL, const char* storagePath = NULL);\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~AssetsManager();\n    \n    typedef std::function<void(int)> ErrorCallback;\n    typedef std::function<void(int)> ProgressCallback;\n    typedef std::function<void(void)> SuccessCallback;\n\n    /* @brief To access within scripting environment\n     */\n    static AssetsManager* create(const char* packageUrl, const char* versionFileUrl, const char* storagePath, ErrorCallback errorCallback, ProgressCallback progressCallback, SuccessCallback successCallback );\n\n    /* @brief Check out if there is a new version resource.\n     *        You may use this method before updating, then let user determine whether\n     *        he wants to update resources.\n     */\n    virtual bool checkUpdate();\n    \n    using Node::update;\n    /* @brief Download new package if there is a new version, and uncompress downloaded zip file.\n     *        Ofcourse it will set search path that stores downloaded files.\n     */\n    virtual void update();\n    \n    /* @brief Gets url of package.\n     */\n    const char* getPackageUrl() const;\n    \n    /* @brief Sets package url.\n     */\n    void setPackageUrl(const char* packageUrl);\n    \n    /* @brief Gets version file url.\n     */\n    const char* getVersionFileUrl() const;\n    \n    /* @brief Gets version file url.\n     */\n    void setVersionFileUrl(const char* versionFileUrl);\n    \n    /* @brief Gets current version code.\n     */\n    std::string getVersion();\n    \n    /* @brief Deletes recorded version code.\n     */\n    void deleteVersion();\n    \n    /* @brief Gets storage path.\n     */\n    const char* getStoragePath() const;\n    \n    /* @brief Sets storage path.\n     *\n     * @param storagePath The path to store downloaded resources.\n     * @warm The path should be a valid path.\n     */\n    void setStoragePath(const char* storagePath);\n    \n    /** @brief Sets delegate, the delegate will receive messages\n     * @js NA\n     * @lua NA\n     */\n    void setDelegate(AssetsManagerDelegateProtocol *delegate);\n    \n    /**\n     * @js NA\n     * @lua NA\n     */\n    AssetsManagerDelegateProtocol* getDelegate() const { return _delegate ;}\n    \n    /** @brief Sets connection time out in seconds\n     */\n    void setConnectionTimeout(unsigned int timeout);\n    \n    /** @brief Gets connection time out in secondes\n     */\n    unsigned int getConnectionTimeout();\n    \n    /* downloadAndUncompress is the entry of a new thread \n     */\n    friend int assetsManagerProgressFunc(void *, double, double, double, double);\n\nprotected:\n    bool downLoad();\n    void checkStoragePath();\n    bool uncompress();\n    bool createDirectory(const char *path);\n    void setSearchPath();\n    void downloadAndUncompress();\n\nprivate:\n    /** @brief Initializes storage path.\n     */\n    void createStoragePath();\n    \n    /** @brief Destroys storage path.\n     */\n    void destroyStoragePath();\n    \nprivate:\n    //! The path to store downloaded resources.\n    std::string _storagePath;\n    \n    //! The version of downloaded resources.\n    std::string _version;\n    \n    std::string _packageUrl;\n    std::string _versionFileUrl;\n    \n    std::string _downloadedVersion;\n    \n    void *_curl;\n\n    unsigned int _connectionTimeout;\n    \n    AssetsManagerDelegateProtocol *_delegate; \n    \n    bool _isDownloading;\n    bool _shouldDeleteDelegateWhenExit;\n    \n    std::string keyOfVersion() const;\n    std::string keyOfDownloadedVersion() const;\n};\n\nclass AssetsManagerDelegateProtocol\n{\npublic:\n    virtual ~AssetsManagerDelegateProtocol(){};\npublic:\n    /* @brief Call back function for error\n       @param errorCode Type of error\n     * @js NA\n     * @lua NA\n     */\n    virtual void onError(AssetsManager::ErrorCode errorCode) {};\n    /** @brief Call back function for recording downloading percent\n        @param percent How much percent downloaded\n        @warning    This call back function just for recording downloading percent.\n              AssetsManager will do some other thing after downloading, you should\n              write code in onSuccess() after downloading. \n     * @js NA\n     * @lua NA\n     */\n    virtual void onProgress(int percent) {};\n    /** @brief Call back function for success\n     * @js NA\n     * @lua NA\n     */\n    virtual void onSuccess() {};\n};\n\n// Deprecated declaration\nCC_DEPRECATED_ATTRIBUTE typedef AssetsManager CCAssetsManager;\nCC_DEPRECATED_ATTRIBUTE typedef AssetsManagerDelegateProtocol CCAssetsManagerDelegateProtocol;\n\nNS_CC_EXT_END;\n\n#endif /* defined(__AssetsManager__) */\n"
  },
  {
    "path": "cocos2d/extensions/cocos-ext.h",
    "content": "#ifndef __COCOS2D_EXT_H__\n#define __COCOS2D_EXT_H__\n\n#include \"ExtensionMacros.h\"\n\n\n#include \"GUI/CCControlExtension/CCControlExtensions.h\"\n#include \"GUI/CCScrollView/CCScrollView.h\"\n#include \"GUI/CCScrollView/CCTableView.h\"\n#include \"GUI/CCEditBox/CCEditBox.h\"\n\n// Physics integration\n#include \"physics-nodes/CCPhysicsDebugNode.h\"\n#include \"physics-nodes/CCPhysicsSprite.h\"\n\n#include \"assets-manager/AssetsManager.h\"\n\n#endif /* __COCOS2D_EXT_H__ */\n"
  },
  {
    "path": "cocos2d/extensions/physics-nodes/CCPhysicsDebugNode.cpp",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * Copyright (c) 2012 cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n#include \"CCPhysicsDebugNode.h\"\n\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n#include \"chipmunk.h\"\n#endif\n\n#include \"ccTypes.h\"\n#include \"CCGeometry.h\"\n\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <math.h>\n#include <limits.h>\n#include <string.h>\n\nNS_CC_EXT_BEGIN\n\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n/*\n IMPORTANT - READ ME!\n \n This file sets pokes around in the private API a lot to provide efficient\n debug rendering given nothing more than reference to a Chipmunk space.\n It is not recommended to write rendering code like this in your own games\n as the private API may change with little or no warning.\n */\n\nstatic Color4F ColorForBody(cpBody *body)\n{\n\tif (cpBodyIsRogue(body) || cpBodyIsSleeping(body))\n    {\n\t\treturn Color4F(0.5f, 0.5f, 0.5f ,0.5f);\n\t}\n    else if (body->CP_PRIVATE(node).idleTime > body->CP_PRIVATE(space)->sleepTimeThreshold)\n    {\n\t\treturn Color4F(0.33f, 0.33f, 0.33f, 0.5f);\n\t}\n    else\n    {\n\t\treturn Color4F(1.0f, 0.0f, 0.0f, 0.5f);\n\t}\n}\n\nstatic Point cpVert2Point(const cpVect &vert)\n{\n    return Point(vert.x, vert.y);\n}\n\nstatic Point* cpVertArray2ccpArrayN(const cpVect* cpVertArray, unsigned int count)\n{\n    if (count == 0) return NULL;\n    Point* pPoints = new Point[count];\n    \n    for (unsigned int i = 0; i < count; ++i)\n    {\n        pPoints[i].x = cpVertArray[i].x;\n        pPoints[i].y = cpVertArray[i].y;\n    }\n    return pPoints;\n}\n\nstatic void DrawShape(cpShape *shape, DrawNode *renderer)\n{\n\tcpBody *body = shape->body;\n\tColor4F color = ColorForBody(body);\n    \n\tswitch (shape->CP_PRIVATE(klass)->type)\n    {\n\t\tcase CP_CIRCLE_SHAPE:\n        {\n            cpCircleShape *circle = (cpCircleShape *)shape;\n            cpVect center = circle->tc;\n            cpFloat radius = circle->r;\n            renderer->drawDot(cpVert2Point(center), cpfmax(radius, 1.0), color);\n            renderer->drawSegment(cpVert2Point(center), cpVert2Point(cpvadd(center, cpvmult(body->rot, radius))), 1.0, color);\n        }\n             break;\n\t\tcase CP_SEGMENT_SHAPE:\n        {\n            cpSegmentShape *seg = (cpSegmentShape *)shape;\n            renderer->drawSegment(cpVert2Point(seg->ta), cpVert2Point(seg->tb), cpfmax(seg->r, 2.0), color);\n        }\n            break;\n\t\tcase CP_POLY_SHAPE:\n        {\n            cpPolyShape *poly = (cpPolyShape *)shape;\n            Color4F line = color;\n            line.a = cpflerp(color.a, 1.0, 0.5);\n            Point* pPoints = cpVertArray2ccpArrayN(poly->tVerts, poly->numVerts);\n            renderer->drawPolygon(pPoints, poly->numVerts, color, 1.0, line);\n            CC_SAFE_DELETE_ARRAY(pPoints);\n        }\n            break;\n\t\tdefault:\n\t\t\tcpAssertHard(false, \"Bad assertion in DrawShape()\");\n\t}\n}\n\nstatic Color4F CONSTRAINT_COLOR(0, 1, 0, 0.5);\n\nstatic void DrawConstraint(cpConstraint *constraint, DrawNode *renderer)\n{\n\tcpBody *body_a = constraint->a;\n\tcpBody *body_b = constraint->b;\n    \n\tconst cpConstraintClass *klass = constraint->CP_PRIVATE(klass);\n\tif (klass == cpPinJointGetClass())\n    {\n\t\tcpPinJoint *joint = (cpPinJoint *)constraint;\n\t\t\n\t\tcpVect a = cpBodyLocal2World(body_a, joint->anchr1);\n\t\tcpVect b = cpBodyLocal2World(body_b, joint->anchr2);\n\t\t\n        renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR);\n        renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR);\n        renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR);\n\t}\n    else if (klass == cpSlideJointGetClass())\n    {\n\t\tcpSlideJoint *joint = (cpSlideJoint *)constraint;\n        \n\t\tcpVect a = cpBodyLocal2World(body_a, joint->anchr1);\n\t\tcpVect b = cpBodyLocal2World(body_b, joint->anchr2);\n        \n        renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR);\n        renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR);\n        renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR);\n\t}\n    else if (klass == cpPivotJointGetClass())\n    {\n\t\tcpPivotJoint *joint = (cpPivotJoint *)constraint;\n        \n\t\tcpVect a = cpBodyLocal2World(body_a, joint->anchr1);\n\t\tcpVect b = cpBodyLocal2World(body_b, joint->anchr2);\n        \n        renderer->drawDot(cpVert2Point(a), 3.0, CONSTRAINT_COLOR);\n        renderer->drawDot(cpVert2Point(b), 3.0, CONSTRAINT_COLOR);\n\t}\n    else if (klass == cpGrooveJointGetClass())\n    {\n\t\tcpGrooveJoint *joint = (cpGrooveJoint *)constraint;\n        \n\t\tcpVect a = cpBodyLocal2World(body_a, joint->grv_a);\n\t\tcpVect b = cpBodyLocal2World(body_a, joint->grv_b);\n\t\tcpVect c = cpBodyLocal2World(body_b, joint->anchr2);\n        \n        renderer->drawDot(cpVert2Point(c), 3.0, CONSTRAINT_COLOR);\n        renderer->drawSegment(cpVert2Point(a), cpVert2Point(b), 1.0, CONSTRAINT_COLOR);\n\t}\n    else if (klass == cpDampedSpringGetClass())\n    {\n\t\t// TODO\n\t}\n    else\n    {\n        //\t\tprintf(\"Cannot draw constraint\\n\");\n\t}\n}\n#endif // #if CC_ENABLE_CHIPMUNK_INTEGRATION\n\n// implementation of PhysicsDebugNode\n\nvoid PhysicsDebugNode::draw()\n{\n    if (! _spacePtr)\n    {\n        return;\n    }\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n    cpSpaceEachShape(_spacePtr, (cpSpaceShapeIteratorFunc)DrawShape, this);\n\tcpSpaceEachConstraint(_spacePtr, (cpSpaceConstraintIteratorFunc)DrawConstraint, this);\n    \n    DrawNode::draw();\n    DrawNode::clear();\n#endif\n}\n\nPhysicsDebugNode::PhysicsDebugNode()\n: _spacePtr(nullptr)\n{}\n\nPhysicsDebugNode* PhysicsDebugNode::create(cpSpace *space)\n{\n    PhysicsDebugNode *node = new PhysicsDebugNode();\n    if (node)\n    {\n        node->init();\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n        node->_spacePtr = space;\n#else\n        CCASSERT(false, \"CC_ENABLE_CHIPMUNK_INTEGRATION was not enabled!\");\n#endif\n        node->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(node);\n    }\n    \n    return node;\n}\n\nPhysicsDebugNode::~PhysicsDebugNode()\n{\n}\n\ncpSpace* PhysicsDebugNode::getSpace() const\n{\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n    return _spacePtr;\n#else\n    CCASSERT(false, \"Can't call chipmunk methods when Chipmunk is disabled\");\n    return nullptr;\n#endif\n}\n\nvoid PhysicsDebugNode::setSpace(cpSpace *space)\n{\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n    _spacePtr = space;\n#else\n    CCASSERT(false, \"Can't call chipmunk methods when Chipmunk is disabled\");\n#endif\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/physics-nodes/CCPhysicsDebugNode.h",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * Copyright (c) 2012 cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#ifndef __PHYSICSNODES_DEBUGNODE_H__\n#define __PHYSICSNODES_DEBUGNODE_H__\n\n#include \"extensions/ExtensionMacros.h\"\n#include \"CCDrawNode.h\"\n\nstruct cpSpace;\n\nNS_CC_EXT_BEGIN\n\n/**\n A BaseData that draws the components of a physics engine.\n \n Supported physics engines:\n - Chipmunk\n - Objective-Chipmunk\n \n @since v2.1\n */\n\nclass PhysicsDebugNode : public DrawNode\n{\n\npublic:\n    /** Create a debug node for a regular Chipmunk space. */\n    static PhysicsDebugNode* create(cpSpace *space);\n    /**\n     * @js ctor\n     */\n    PhysicsDebugNode();\n    /**\n     * @js NA\n     * @lua NA\n     */\n    virtual ~PhysicsDebugNode();\n    \n\n    cpSpace* getSpace() const;\n    void setSpace(cpSpace *space);\n    \n    // Overrides\n    virtual void draw() override;\n\nprotected:\n    cpSpace *_spacePtr;\n\n};\n\nNS_CC_EXT_END\n\n#endif // __PHYSICSNODES_DEBUGNODE_H__\n"
  },
  {
    "path": "cocos2d/extensions/physics-nodes/CCPhysicsSprite.cpp",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * Copyright (c) 2012 cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"CCPhysicsSprite.h\"\n\n#if (CC_ENABLE_CHIPMUNK_INTEGRATION && CC_ENABLE_BOX2D_INTEGRATION)\n#error \"Either Chipmunk or Box2d should be enabled, but not both at the same time\"\n#endif\n\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n#include \"chipmunk.h\"\n#elif CC_ENABLE_BOX2D_INTEGRATION\n#include \"Box2D/Box2D.h\"\n#endif\n\nNS_CC_EXT_BEGIN\n\nPhysicsSprite::PhysicsSprite()\n: _ignoreBodyRotation(false)\n, _CPBody(nullptr)\n, _pB2Body(nullptr)\n, _PTMRatio(0.0f)\n{}\n\nPhysicsSprite* PhysicsSprite::create()\n{\n    PhysicsSprite* pRet = new PhysicsSprite();\n    if (pRet && pRet->init())\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n    \n    return pRet;\n}\n\nPhysicsSprite* PhysicsSprite::createWithTexture(Texture2D *pTexture)\n{\n    PhysicsSprite* pRet = new PhysicsSprite();\n    if (pRet && pRet->initWithTexture(pTexture))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\n    return pRet;\n}\n\nPhysicsSprite* PhysicsSprite::createWithTexture(Texture2D *pTexture, const Rect& rect)\n{\n    PhysicsSprite* pRet = new PhysicsSprite();\n    if (pRet && pRet->initWithTexture(pTexture, rect))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\n    return pRet;\n}\n\nPhysicsSprite* PhysicsSprite::createWithSpriteFrame(SpriteFrame *pSpriteFrame)\n{\n    PhysicsSprite* pRet = new PhysicsSprite();\n    if (pRet && pRet->initWithSpriteFrame(pSpriteFrame))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\n    return pRet;\n}\n\nPhysicsSprite* PhysicsSprite::createWithSpriteFrameName(const char *pszSpriteFrameName)\n{\n    PhysicsSprite* pRet = new PhysicsSprite();\n    if (pRet && pRet->initWithSpriteFrameName(pszSpriteFrameName))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\n    return pRet;\n}\n\nPhysicsSprite* PhysicsSprite::create(const char *pszFileName)\n{\n    PhysicsSprite* pRet = new PhysicsSprite();\n    if (pRet && pRet->initWithFile(pszFileName))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\n    return pRet;\n}\n\nPhysicsSprite* PhysicsSprite::create(const char *pszFileName, const Rect& rect)\n{\n    PhysicsSprite* pRet = new PhysicsSprite();\n    if (pRet && pRet->initWithFile(pszFileName, rect))\n    {\n        pRet->autorelease();\n    }\n    else\n    {\n        CC_SAFE_DELETE(pRet);\n    }\n\n    return pRet;\n}\n\n// this method will only get called if the sprite is batched.\n// return YES if the physic's values (angles, position ) changed.\n// If you return NO, then getNodeToParentTransform won't be called.\nbool PhysicsSprite::isDirty() const\n{\n    return true;\n}\n\nbool PhysicsSprite::isIgnoreBodyRotation() const\n{\n    return _ignoreBodyRotation;\n}\n\nvoid PhysicsSprite::setIgnoreBodyRotation(bool bIgnoreBodyRotation)\n{\n    _ignoreBodyRotation = bIgnoreBodyRotation;\n}\n\n// Override the setters and getters to always reflect the body's properties.\nconst Point& PhysicsSprite::getPosition() const\n{\n    return getPosFromPhysics();\n}\n\nvoid PhysicsSprite::getPosition(float* x, float* y) const\n{\n    if (x == NULL || y == NULL) {\n        return;\n    }\n    const Point& pos = getPosFromPhysics();\n    *x = pos.x;\n    *y = pos.y;\n}\n\nfloat PhysicsSprite::getPositionX() const\n{\n    return getPosFromPhysics().x;\n}\n\nfloat PhysicsSprite::getPositionY() const\n{\n    return getPosFromPhysics().y;\n}\n\n//\n// Chipmunk only\n//\n\n\n\ncpBody* PhysicsSprite::getCPBody() const\n{\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n    return _CPBody;\n#else\n    CCASSERT(false, \"Can't call chipmunk methods when Chipmunk is disabled\");\n    return nullptr;\n#endif\n}\n\nvoid PhysicsSprite::setCPBody(cpBody *pBody)\n{\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n    _CPBody = pBody;\n#else\n    CCASSERT(false, \"Can't call chipmunk methods when Chipmunk is disabled\");\n#endif\n}\n\nb2Body* PhysicsSprite::getB2Body() const\n{\n#if CC_ENABLE_BOX2D_INTEGRATION\n    return _pB2Body;\n#else\n    CCASSERT(false, \"Can't call box2d methods when Box2d is disabled\");\n    return nullptr;\n#endif\n}\n\nvoid PhysicsSprite::setB2Body(b2Body *pBody)\n{\n#if CC_ENABLE_BOX2D_INTEGRATION\n    _pB2Body = pBody;\n#else\n    CCASSERT(false, \"Can't call box2d methods when Box2d is disabled\");\n#endif\n}\n\nfloat PhysicsSprite::getPTMRatio() const\n{\n#if CC_ENABLE_BOX2D_INTEGRATION\n    return _PTMRatio;\n#else\n    CCASSERT(false, \"Can't call box2d methods when Box2d is disabled\");\n    return 0;\n#endif\n}\n\nvoid PhysicsSprite::setPTMRatio(float fRatio)\n{\n#if CC_ENABLE_BOX2D_INTEGRATION\n     _PTMRatio = fRatio;\n#else\n    CCASSERT(false, \"Can't call box2d methods when Box2d is disabled\");\n#endif\n}\n\n//\n// Common to Box2d and Chipmunk\n//\n\nconst Point& PhysicsSprite::getPosFromPhysics() const\n{\n    static Point s_physicPosion;\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n\n    cpVect cpPos = cpBodyGetPos(_CPBody);\n    s_physicPosion = Point(cpPos.x, cpPos.y);\n\n#elif CC_ENABLE_BOX2D_INTEGRATION\n\n    b2Vec2 pos = _pB2Body->GetPosition();\n    float x = pos.x * _PTMRatio;\n    float y = pos.y * _PTMRatio;\n    s_physicPosion = Point(x,y);\n#endif\n    return s_physicPosion;\n}\n\nvoid PhysicsSprite::setPosition(const Point &pos)\n{\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n\n    cpVect cpPos = cpv(pos.x, pos.y);\n    cpBodySetPos(_CPBody, cpPos);\n\n#elif CC_ENABLE_BOX2D_INTEGRATION\n\n    float angle = _pB2Body->GetAngle();\n    _pB2Body->SetTransform(b2Vec2(pos.x / _PTMRatio, pos.y / _PTMRatio), angle);\n#endif\n\n}\n\nfloat PhysicsSprite::getRotation() const\n{\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n\n    return (_ignoreBodyRotation ? Sprite::getRotation() : -CC_RADIANS_TO_DEGREES(cpBodyGetAngle(_CPBody)));\n\n#elif CC_ENABLE_BOX2D_INTEGRATION\n    \n    return (_ignoreBodyRotation ? Sprite::getRotation() :\n            CC_RADIANS_TO_DEGREES(_pB2Body->GetAngle()));\n#endif\n\n}\n\nvoid PhysicsSprite::setRotation(float fRotation)\n{\n    if (_ignoreBodyRotation)\n    {\n        Sprite::setRotation(fRotation);\n    }\n\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n    else\n    {\n        cpBodySetAngle(_CPBody, -CC_DEGREES_TO_RADIANS(fRotation));\n    }\n\n#elif CC_ENABLE_BOX2D_INTEGRATION\n    else\n    {\n        b2Vec2 p = _pB2Body->GetPosition();\n        float radians = CC_DEGREES_TO_RADIANS(fRotation);\n        _pB2Body->SetTransform(p, radians);\n    }\n#endif\n\n}\n\n// returns the transform matrix according the Chipmunk Body values\nconst kmMat4& PhysicsSprite::getNodeToParentTransform() const\n{\n    // Although scale is not used by physics engines, it is calculated just in case\n\t// the sprite is animated (scaled up/down) using actions.\n\t// For more info see: http://www.cocos2d-iphone.org/forum/topic/68990\n\n#if CC_ENABLE_CHIPMUNK_INTEGRATION\n\n\tcpVect rot = (_ignoreBodyRotation ? cpvforangle(-CC_DEGREES_TO_RADIANS(_rotationX)) : _CPBody->rot);\n\tfloat x = _CPBody->p.x + rot.x * -_anchorPointInPoints.x * _scaleX - rot.y * -_anchorPointInPoints.y * _scaleY;\n\tfloat y = _CPBody->p.y + rot.y * -_anchorPointInPoints.x * _scaleX + rot.x * -_anchorPointInPoints.y * _scaleY;\n\n\tif (_ignoreAnchorPointForPosition)\n    {\n\t\tx += _anchorPointInPoints.x;\n\t\ty += _anchorPointInPoints.y;\n\t}\n\n    \n    kmScalar mat[] = {  (kmScalar)rot.x * _scaleX, (kmScalar)rot.y * _scaleX, 0,  0,\n                        (kmScalar)-rot.y * _scaleY, (kmScalar)rot.x * _scaleY,  0,  0,\n                        0,  0,  1,  0,\n                        x,\ty,  0,  1};\n\n\n    kmMat4Fill(&_transform, mat);\n    \n    return _transform;\n\n\n#elif CC_ENABLE_BOX2D_INTEGRATION\n\n    b2Vec2 pos  = _pB2Body->GetPosition();\n\n\tfloat x = pos.x * _PTMRatio;\n\tfloat y = pos.y * _PTMRatio;\n\n\tif (_ignoreAnchorPointForPosition)\n    {\n\t\tx += _anchorPointInPoints.x;\n\t\ty += _anchorPointInPoints.y;\n\t}\n\n\t// Make matrix\n\tfloat radians = _pB2Body->GetAngle();\n\tfloat c = cosf(radians);\n\tfloat s = sinf(radians);\n\n\tif (!_anchorPointInPoints.equals(Point::ZERO))\n    {\n\t\tx += ((c * -_anchorPointInPoints.x * _scaleX) + (-s * -_anchorPointInPoints.y * _scaleY));\n\t\ty += ((s * -_anchorPointInPoints.x * _scaleX) + (c * -_anchorPointInPoints.y * _scaleY));\n\t}\n\n\t// Rot, Translate Matrix\n    \n    kmScalar mat[] = {  (kmScalar)c * _scaleX, (kmScalar)s * _scaleX, 0,  0,\n        (kmScalar)-s * _scaleY, (kmScalar)c * _scaleY,  0,  0,\n        0,  0,  1,  0,\n        x,\ty,  0,  1};\n    \n    \n    kmMat4Fill(&_transform, mat);\n\n\treturn _transform;\n#endif\n}\n\nNS_CC_EXT_END\n"
  },
  {
    "path": "cocos2d/extensions/physics-nodes/CCPhysicsSprite.h",
    "content": "/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software\n * Copyright (c) 2012 cocos2d-x.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#ifndef __PHYSICSNODES_CCPHYSICSSPRITE_H__\n#define __PHYSICSNODES_CCPHYSICSSPRITE_H__\n\n#include \"CCSprite.h\"\n#include \"extensions/ExtensionMacros.h\"\n\nstruct cpBody;\nclass b2Body;\n\nNS_CC_EXT_BEGIN\n/** A Sprite subclass that is bound to a physics body.\n It works with:\n - Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined\n - Objective-Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined\n - Box2d: Preprocessor macro CC_ENABLE_BOX2D_INTEGRATION should be defined\n\n Features and Limitations:\n - Scale and Skew properties are ignored.\n - Position and rotation are going to updated from the physics body\n - If you update the rotation or position manually, the physics body will be updated\n - You can't enble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time\n */\nclass PhysicsSprite : public Sprite\n{\npublic:\n\n    static PhysicsSprite* create();\n    /** Creates an sprite with a texture.\n     The rect used will be the size of the texture.\n     The offset will be (0,0).\n     */\n    static PhysicsSprite* createWithTexture(Texture2D *pTexture);\n\n    /** Creates an sprite with a texture and a rect.\n     The offset will be (0,0).\n     */\n    static PhysicsSprite* createWithTexture(Texture2D *pTexture, const Rect& rect);\n\n    /** Creates an sprite with an sprite frame. */\n    static PhysicsSprite* createWithSpriteFrame(SpriteFrame *pSpriteFrame);\n\n    /** Creates an sprite with an sprite frame name.\n     An SpriteFrame will be fetched from the SpriteFrameCache by name.\n     If the SpriteFrame doesn't exist it will raise an exception.\n     @since v0.9\n     */\n    static PhysicsSprite* createWithSpriteFrameName(const char *pszSpriteFrameName);\n\n    /** Creates an sprite with an image filename.\n     The rect used will be the size of the image.\n     The offset will be (0,0).\n     */\n    static PhysicsSprite* create(const char *pszFileName);\n\n    /** Creates an sprite with an image filename and a rect.\n     The offset will be (0,0).\n     */\n    static PhysicsSprite* create(const char *pszFileName, const Rect& rect);\n\n    PhysicsSprite();\n\n    virtual bool isDirty() const;\n\n    /** Keep the sprite's rotation separate from the body. */\n    bool isIgnoreBodyRotation() const;\n    void setIgnoreBodyRotation(bool bIgnoreBodyRotation);\n\n    //\n    // Chipmunk specific\n    //\n    /** Body accessor when using regular Chipmunk */\n    cpBody* getCPBody() const;\n    void setCPBody(cpBody *pBody);\n\n    //\n    // Box2d specific\n    //\n    /** Body accessor when using box2d */\n    b2Body* getB2Body() const;\n    void setB2Body(b2Body *pBody);\n\n    float getPTMRatio() const;\n    void setPTMRatio(float fPTMRatio);\n\n    // overrides\n    virtual const Point& getPosition() const override;\n    virtual void getPosition(float* x, float* y) const override;\n    virtual float getPositionX() const override;\n    virtual float getPositionY() const override;\n    virtual void setPosition(const Point &position) override;\n    virtual float getRotation() const override;\n    virtual void setRotation(float fRotation) override;\n    virtual const kmMat4& getNodeToParentTransform() const override;\n\nprotected:\n    const Point& getPosFromPhysics() const;\n\nprotected:\n    bool    _ignoreBodyRotation;\n\n    // chipmunk specific\n    cpBody  *_CPBody;\n\n    // box2d specific\n    b2Body  *_pB2Body;\n    float   _PTMRatio;\n};\n\nNS_CC_EXT_END\n\n#endif // __PHYSICSNODES_CCPHYSICSSPRITE_H__\n"
  },
  {
    "path": "cocos2d/extensions/proj.win32/Win32InputBox.cpp",
    "content": "#include \"Win32InputBox.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n\n#include <stdio.h>\n\n#pragma warning (disable: 4312)\n\ntypedef struct _MSDN_DLGTEMPLATEEX \n{\n  WORD dlgVer;\n  WORD signature;\n  DWORD helpID;\n  DWORD exStyle;\n  DWORD style;\n  WORD cDlgItems;\n  short x;\n  short y;\n  short cx;\n  short cy;\n  BYTE  _rest[1]; // rest of structure\n} MSDN_DLGTEMPLATEEX;\n\nstatic bool IsDlgTemplateExtended(DLGTEMPLATE *dlgTemplate)\n{\n  MSDN_DLGTEMPLATEEX *dgExTemplate = (MSDN_DLGTEMPLATEEX *) dlgTemplate;\n\n  // MSDN excerpt:\n  //* dlgVer\n  //  Specifies the version number of the extended dialog box template. This member must be 1. \n  //* signature\n  //  Indicates whether a template is an extended dialog box template. \n  // If signature is 0xFFFF, this is an extended dialog box template. \n  // In this case, the dlgVer member specifies the template version number. \n  // If signature is any value other than 0xFFFF, this is a standard dialog box template that uses the DLGTEMPLATE and DLGITEMTEMPLATE structures. \n\n  return (dgExTemplate->dlgVer == 1) && (dgExTemplate->signature == 0xFFFF);\n}\n\n// Use alignment if supported by the compiler\n#ifdef _MSC_VER\n  #if _MSC_VER > 1200\n    __declspec(align(4)) \n  #endif\n#endif\n\n// per the MSDN, the DLGTEMPLATE must be DWORD aligned\n// this was generated by the DlgResToDlgTemplate tool\nstatic unsigned char definputbox_dlg[] =\n{\n  0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0xc8,0x00,0x06,\n    0x00,0x16,0x00,0x11,0x00,0xe7,0x00,0x6d,0x00,0x00,0x00,0x00,0x00,0x57,0x00,0x69,\n    0x00,0x6e,0x00,0x33,0x00,0x32,0x00,0x49,0x00,0x6e,0x00,0x70,0x00,0x75,0x00,0x74,\n    0x00,0x42,0x00,0x6f,0x00,0x78,0x00,0x00,0x00,0x08,0x00,0xbc,0x02,0x00,0x00,0x4d,\n    0x00,0x53,0x00,0x20,0x00,0x53,0x00,0x68,0x00,0x65,0x00,0x6c,0x00,0x6c,0x00,0x20,\n    0x00,0x44,0x00,0x6c,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n    0x00,0x00,0x00,0x80,0x00,0x02,0x50,0x06,0x00,0x04,0x00,0x9d,0x00,0x21,0x00,0xe8,\n    0x03,0x00,0x00,0xff,0xff,0x82,0x00,0x50,0x00,0x72,0x00,0x6f,0x00,0x6d,0x00,0x70,\n    0x00,0x74,0x00,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n    0x00,0x00,0x00,0x80,0x00,0x81,0x50,0x06,0x00,0x25,0x00,0xd8,0x00,0x0e,0x00,0xe9,\n    0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n    0x00,0x00,0x00,0x84,0x10,0xa1,0x50,0x06,0x00,0x37,0x00,0xd8,0x00,0x31,0x00,0xea,\n    0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n    0x00,0x00,0x00,0x01,0x00,0x03,0x50,0xab,0x00,0x04,0x00,0x33,0x00,0x0e,0x00,0x01,\n    0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x4f,0x00,0x4b,0x00,0x00,0x00,0x00,0x00,0x00,\n    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x50,0xab,0x00,0x15,0x00,0x33,\n    0x00,0x0e,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x43,0x00,0x41,0x00,0x4e,\n    0x00,0x43,0x00,0x45,0x00,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\n    0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x27,0x00,0x08,0x00,0x08,0x00,0xff,\n    0xff,0xff,0xff,0xff,0xff,0x82,0x00,0x00,0x00,0x00,0x00\n};\n\nstatic LPCTSTR definputbox_buttonnames[] = { _T(\"OK\"), _T(\"CANCEL\") };\nstatic const INT_PTR definputbox_buttonids[] = { IDOK, IDCANCEL };\n\nstatic const INT \n  definputbox_id_prompt = 1000,\n  definputbox_id_edit1 = 1001,\n  definputbox_id_edit2 = 1002;\n\nWIN32INPUTBOX_PARAM::WIN32INPUTBOX_PARAM()\n{\n  bMultiline = false;\n  hwndOwner = 0;\n  DlgTemplateName = 0;\n  hInstance = (HINSTANCE) ::GetModuleHandle(0);\n  DlgTemplateData = definputbox_dlg;\n\n  bCenter = true;\n\n  dwStylesPlus = 0;\n  dwExStylesPlus = 0;\n  dwStylesMinus = 0xFFFFFFFF;\n  dwExStylesMinus = 0xFFFFFFFF;\n\n  xPos = yPos = -1;\n\n  szResult = 0;\n  nResultSize = 0;\n}\n\nCWin32InputBox::CWin32InputBox(WIN32INPUTBOX_PARAM *param)\n{\n  _param = param;\n}\n\nCWin32InputBox::~CWin32InputBox()\n{\n\n}\n\nvoid CWin32InputBox::SetParam(WIN32INPUTBOX_PARAM *param)\n{\n  _param = param;\n}\n\nWIN32INPUTBOX_PARAM *CWin32InputBox::GetParam()\n{\n  return _param;\n}\n\nINT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param)\n{\n  // Check mandatory parameters\n  if (param->szResult == 0)\n  {\n    ::SetLastError(ERROR_INVALID_PARAMETER);\n    return 0;\n  }\n\n  LPDLGTEMPLATE dlgTemplate;\n\n  if (param->DlgTemplateName != 0)\n  {\n    HMODULE hModule = (HMODULE)param->hInstance;\n#ifdef __MINGW32__\n    HRSRC rcDlg = ::FindResource(hModule, (LPWSTR)(ULONG_PTR)(size_t)(param->DlgTemplateName), RT_DIALOG);\n#else\n    HRSRC rcDlg = ::FindResource(hModule, MAKEINTRESOURCE(param->DlgTemplateName), RT_DIALOG);\n#endif\n    if (rcDlg == NULL)\n      return 0;\n\n    HGLOBAL hglobalDlg = ::LoadResource(hModule, rcDlg);\n    if (hglobalDlg == NULL)\n      return 0;\n\n    dlgTemplate = (LPDLGTEMPLATE) hglobalDlg;\n  }\n  else if (param->DlgTemplateData != 0)\n  {\n    dlgTemplate = (LPDLGTEMPLATE) param->DlgTemplateData;\n  }\n\n  MSDN_DLGTEMPLATEEX *dlgTemplateEx = \n    IsDlgTemplateExtended((LPDLGTEMPLATE) dlgTemplate) ? (MSDN_DLGTEMPLATEEX *) dlgTemplate : 0;\n\n  if (dlgTemplateEx != 0)\n  {\n    dlgTemplateEx->exStyle |= param->dwExStylesPlus;\n    dlgTemplateEx->style   |= param->dwStylesPlus;\n    dlgTemplateEx->exStyle &= param->dwExStylesMinus;\n    dlgTemplateEx->style   &= param->dwStylesMinus;\n\n    if (param->bCenter)\n      dlgTemplateEx->style |= DS_CENTER;\n\n    if (param->xPos != -1)\n      dlgTemplateEx->x = param->xPos;\n    if (param->yPos != -1)\n      dlgTemplateEx->y = param->yPos;\n  }\n  else\n  {\n    dlgTemplate->dwExtendedStyle  |= param->dwExStylesPlus;\n    dlgTemplate->style            |= param->dwStylesPlus;\n    dlgTemplate->dwExtendedStyle  &= param->dwExStylesMinus;\n    dlgTemplate->style            &= param->dwStylesMinus;\n\n    if (param->bCenter)\n      dlgTemplate->style |= DS_CENTER;\n\n    if (param->xPos != -1)\n      dlgTemplate->x = param->xPos;\n\n    if (param->yPos != -1)\n      dlgTemplate->y = param->yPos;\n  }\n\n  CWin32InputBox inputbox(param);\n\n  // Resize dialog and SHOW or HIDE multiline\n  INT_PTR r = ::DialogBoxIndirectParam(param->hInstance, dlgTemplate, param->hwndOwner, (DLGPROC)DlgProc, (LPARAM)&inputbox);\n\n  return r;\n}\n\nINT_PTR CWin32InputBox::InputBox(\n  LPCSTR szTitle, \n  LPCSTR szPrompt, \n  LPSTR szResult, \n  DWORD nResultSize,\n  bool bMultiLine,\n  HWND hwndParent)\n{\n  WIN32INPUTBOX_PARAM param;\n\n  param.szTitle = szTitle;\n  param.szPrompt = szPrompt;\n  param.szResult = szResult;\n  param.nResultSize = nResultSize;\n  param.bMultiline = bMultiLine;\n\n  return InputBoxEx(&param);\n}\n\nvoid CWin32InputBox::InitDialog()\n{\n  // Set the button captions\n  for (size_t i=0;i<sizeof(definputbox_buttonids)/sizeof(definputbox_buttonids[0]);i++)\n    ::SetDlgItemText(_param->hDlg, (int) definputbox_buttonids[i], definputbox_buttonnames[i]);\n\n  // Set other controls\n  ::SetWindowTextA(_param->hDlg, Utf8ToAnsi(_param->szTitle).c_str());\n  ::SetDlgItemTextA(_param->hDlg, definputbox_id_prompt, Utf8ToAnsi(_param->szPrompt).c_str());\n\n  HWND hwndEdit1 = ::GetDlgItem(_param->hDlg, definputbox_id_edit1);\n  HWND hwndEdit2 = ::GetDlgItem(_param->hDlg, definputbox_id_edit2);\n\n  if (_param->bMultiline)\n    _hwndEditCtrl = hwndEdit2;\n  else\n    _hwndEditCtrl = hwndEdit1;\n\n  ::SetWindowTextA(_hwndEditCtrl, Utf8ToAnsi(_param->szResult).c_str());\n\n  RECT rectDlg, rectEdit1, rectEdit2;\n\n  ::GetWindowRect(_param->hDlg, &rectDlg);\n  ::GetWindowRect(hwndEdit1, &rectEdit1);\n  ::GetWindowRect(hwndEdit2, &rectEdit2);\n\n  if (_param->bMultiline)\n  {\n    ::ShowWindow(hwndEdit1, SW_HIDE);\n    ::SetWindowPos(\n      hwndEdit2, \n      HWND_NOTOPMOST, \n      rectEdit1.left - rectDlg.left, \n      (rectEdit1.top - rectDlg.top) - (rectEdit1.bottom - rectEdit1.top), \n      0, \n      0, \n      SWP_NOSIZE | SWP_NOZORDER);\n\n    ::SetWindowPos(\n      _param->hDlg, \n      HWND_NOTOPMOST, \n      0, \n      0, \n      rectDlg.right - rectDlg.left, \n      rectDlg.bottom - rectDlg.top - (rectEdit1.bottom - rectEdit1.top), \n      SWP_NOMOVE);\n\n  }\n  else\n  {\n    ::SetWindowPos(\n      _param->hDlg, \n      HWND_NOTOPMOST, \n      0, \n      0, \n      rectDlg.right - rectDlg.left, \n      rectEdit1.bottom - rectDlg.top + 5,\n      SWP_NOMOVE);\n\n    ::ShowWindow(hwndEdit2, SW_HIDE);\n  }\n}\n\n// Message handler for about box.\nLRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\n{\n  CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLongPtr(hDlg, GWLP_USERDATA);\n  WIN32INPUTBOX_PARAM *param = _this ? _this->GetParam() : 0;\n\n  switch (message)\n  {\n    case WM_INITDIALOG:\n    {\n      SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR) lParam);\n      \n      _this = (CWin32InputBox *)  lParam;\n      _this->_param->hDlg = hDlg;\n      _this->InitDialog();\n      return TRUE;\n    }\n\n    case WM_COMMAND:\n    {\n#ifdef _MY_DEBUG\n      CHAR buf[1024];\n      static int i=0;\n      sprintf(buf, \"WM_COMMAND: %09d wParam=%08X lParam=%08X\\n\", i++, wParam, lParam);\n      OutputDebugString(buf);\n#endif\n      INT_PTR buttonId = LOWORD(wParam);\n      for (size_t i=0;\n           i<sizeof(definputbox_buttonids)/sizeof(definputbox_buttonids[0]);\n           i++)\n      {\n        if (buttonId == definputbox_buttonids[i]) \n        {\n          ::GetWindowTextA(\n            _this->_hwndEditCtrl, \n            _this->_param->szResult, \n            _this->_param->nResultSize);\n\n\t\t  std::string strUtf8 = AnsiToUtf8(_this->_param->szResult);\n\n\t\t  memset(_this->_param->szResult, 0, _this->_param->nResultSize);\n\t\t  strncpy(_this->_param->szResult, strUtf8.c_str(), _this->_param->nResultSize-1);\n\n          ::EndDialog(hDlg, buttonId);\n          return TRUE;\n        }\n      }\n    }\n    break;\n  }\n  return FALSE;\n}\n\n\nstd::string CWin32InputBox::AnsiToUtf8(std::string strAnsi)\n{\n\tstd::string ret;\n\tif (strAnsi.length() > 0)\n\t{\t\n\t\tint nWideStrLength = MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, NULL, 0);\n\t\tWCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR));\n\t\tmemset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR));\n\t\tMultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR));\n\n\t\tint nUtf8Length = WideCharToMultiByte( CP_UTF8,0,pwszBuf,-1,NULL,0,NULL,FALSE );\n\t\tchar* pszUtf8Buf = (char*)malloc((nUtf8Length+1)*sizeof(char));\n\t\tmemset(pszUtf8Buf, 0, (nUtf8Length+1)*sizeof(char));\n\n\t\tWideCharToMultiByte(CP_UTF8, 0, pwszBuf, -1, pszUtf8Buf, (nUtf8Length+1)*sizeof(char), NULL, FALSE);\n\t\tret = pszUtf8Buf;\n\n\t\tfree(pszUtf8Buf);\n\t\tfree(pwszBuf);\n\t}\n\treturn ret;\n}\n\nstd::string CWin32InputBox::Utf8ToAnsi(std::string strUTF8)\n{\n\tstd::string ret;\n\tif (strUTF8.length() > 0)\n\t{\n\t\tint nWideStrLength = MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, NULL, 0);\n\t\tWCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR));\n\t\tmemset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR));\n\t\tMultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR));\n\n\t\tint nAnsiStrLength = WideCharToMultiByte( CP_ACP,0,pwszBuf,-1,NULL,0,NULL,FALSE );\n\t\tchar* pszAnsiBuf = (char*)malloc((nAnsiStrLength+1)*sizeof(char));\n\t\tmemset(pszAnsiBuf, 0, (nAnsiStrLength+1)*sizeof(char));\n\n\t\tWideCharToMultiByte(CP_ACP, 0, pwszBuf, -1, pszAnsiBuf, (nAnsiStrLength+1)*sizeof(char), NULL, FALSE);\n\t\tret = pszAnsiBuf;\n\n\t\tfree(pszAnsiBuf);\n\t\tfree(pwszBuf);\n\t}\n\n\treturn ret;\n}\n\n\n\n#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */\n"
  },
  {
    "path": "cocos2d/extensions/proj.win32/Win32InputBox.h",
    "content": "#ifndef __03022006__WIN32INPUTBOX__\n#define __03022006__WIN32INPUTBOX__\n\n#include \"cocos2d.h\"\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)\n/*\n\nThis library is (c) Elias Bachaalany aka lallous <lallousx86@yahoo.com>\nYou may use this library under the following license agreement:\n\nThe zlib/libpng License.\n---------------------------\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, \nand to alter it and redistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; \n   you must not claim that you wrote the original software. \n   If you use this software in a product, an acknowledgment in the product \n   documentation would be appreciated but is not required.\n2. Altered source versions must be plainly marked as such, \n   and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution. \n\n*/\n\n#include <windows.h>\n#include <tchar.h>\n\nclass CWin32InputBox;\n\n// Structure used to orient the inputbox behavior\nstruct WIN32INPUTBOX_PARAM\n{\n  friend class CWin32InputBox;\n\n  //\n  IN OPTIONAL bool bMultiline;\n\n  // Pass this as none zero so to use this memory dlg template\n  IN OPTIONAL LPVOID DlgTemplateData;\n\n  // Pass this as none ZERO so to load DLGTEMPLATE from resources\n  IN OPTIONAL LPCSTR DlgTemplateName;\n\n  // passing both \"DlgTemplateName\" and \"DlgTemplateData\" ZERO will cause\n  // the dialog to use his default embedded resource\n\n  // Center on monitor or owner window?\n  IN OPTIONAL bool bCenter;\n\n  // Want to add more styles to the dialog?\n  IN OPTIONAL DWORD dwStylesPlus, dwStylesMinus;\n  IN OPTIONAL DWORD dwExStylesPlus, dwExStylesMinus;\n\n  IN LPCSTR szTitle, szPrompt;\n\n  // Return buffer\n  OUT LPSTR szResult;\n  IN DWORD nResultSize;\n\n  // Owner window\n  HWND hwndOwner;\n  HINSTANCE hInstance;\n\n  short xPos, yPos;\n\n  WIN32INPUTBOX_PARAM();\nprivate:\n  HWND hDlg;\n};\n\nclass CWin32InputBox\n{\nprivate:\n  WIN32INPUTBOX_PARAM *_param;\n  static LRESULT CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);\n  HWND _hwndEditCtrl;\n\n  void InitDialog();\n  void SetParam(WIN32INPUTBOX_PARAM *);\n  WIN32INPUTBOX_PARAM * GetParam();\n\npublic:\n\n  CWin32InputBox(WIN32INPUTBOX_PARAM *);\n  ~CWin32InputBox();\n\n  static INT_PTR InputBoxEx(WIN32INPUTBOX_PARAM *);\n  static INT_PTR InputBox(\n    LPCSTR szTitle, \n    LPCSTR szPrompt, \n    LPSTR szResult, \n    DWORD nResultSize,\n    bool bMultiLine = false,\n    HWND hwndParent = 0);\n\n  static std::string AnsiToUtf8(std::string strAnsi);\n  static std::string Utf8ToAnsi(std::string strUTF8);\n};\n\n#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */\n\n#endif"
  },
  {
    "path": "cocos2d/extensions/proj.win32/libExtensions.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{21B2C324-891F-48EA-AD1A-5AE13DE12E28}</ProjectGuid>\n    <RootNamespace>Extensions.win32</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\cocos\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\..\\cocos\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(Configuration).win32\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration).win32\\</IntDir>\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;$(EngineRoot);$(EngineRoot)cocos\\audio\\include;$(EngineRoot)external;$(EngineRoot)external\\unzip;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)external\\curl\\include\\win32;$(EngineRoot)external\\sqlite3\\include;$(EngineRoot)external\\libwebsockets\\win32\\include;$(EngineRoot)external\\win32-specific\\zlib\\include;..\\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;COCOS2D_DEBUG=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>false</MinimalRebuild>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>OldStyle</DebugInformationFormat>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <Optimization>MaxSpeed</Optimization>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;$(EngineRoot);$(EngineRoot)cocos\\audio\\include;$(EngineRoot)external;$(EngineRoot)external\\unzip;$(EngineRoot)external\\chipmunk\\include\\chipmunk;$(EngineRoot)external\\curl\\include\\win32;$(EngineRoot)external\\sqlite3\\include;$(EngineRoot)external\\libwebsockets\\win32\\include;$(EngineRoot)external\\win32-specific\\zlib\\include;..\\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\assets-manager\\AssetsManager.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControl.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlButton.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlColourPicker.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlHuePicker.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlPotentiometer.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlSaturationBrightnessPicker.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlSlider.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlStepper.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlSwitch.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlUtils.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCInvocation.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCScale9Sprite.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCEditBox\\CCEditBox.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCEditBox\\CCEditBoxImplWin.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCScrollView\\CCScrollView.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCScrollView\\CCTableView.cpp\" />\n    <ClCompile Include=\"..\\GUI\\CCScrollView\\CCTableViewCell.cpp\" />\n    <ClCompile Include=\"..\\physics-nodes\\CCPhysicsDebugNode.cpp\" />\n    <ClCompile Include=\"..\\physics-nodes\\CCPhysicsSprite.cpp\" />\n    <ClCompile Include=\"Win32InputBox.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\assets-manager\\AssetsManager.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControl.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlButton.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlColourPicker.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlExtensions.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlHuePicker.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlPotentiometer.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlSaturationBrightnessPicker.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlSlider.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlStepper.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlSwitch.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlUtils.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCInvocation.h\" />\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCScale9Sprite.h\" />\n    <ClInclude Include=\"..\\GUI\\CCEditBox\\CCEditBox.h\" />\n    <ClInclude Include=\"..\\GUI\\CCEditBox\\CCEditBoxImpl.h\" />\n    <ClInclude Include=\"..\\GUI\\CCEditBox\\CCEditBoxImplWin.h\" />\n    <ClInclude Include=\"..\\GUI\\CCScrollView\\CCScrollView.h\" />\n    <ClInclude Include=\"..\\cocos-ext.h\" />\n    <ClInclude Include=\"..\\ExtensionMacros.h\" />\n    <ClInclude Include=\"..\\GUI\\CCScrollView\\CCTableView.h\" />\n    <ClInclude Include=\"..\\GUI\\CCScrollView\\CCTableViewCell.h\" />\n    <ClInclude Include=\"..\\physics-nodes\\CCPhysicsDebugNode.h\" />\n    <ClInclude Include=\"..\\physics-nodes\\CCPhysicsSprite.h\" />\n    <ClInclude Include=\"Win32InputBox.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/extensions/proj.win32/libExtensions.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"GUI\">\n      <UniqueIdentifier>{202b519b-b5e0-499f-b3b8-ed5da144b248}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"GUI\\CCControlExtension\">\n      <UniqueIdentifier>{c07abd14-e9dd-4e2d-85c4-a180070161b4}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"GUI\\CCScrollView\">\n      <UniqueIdentifier>{46797895-f71d-4ddb-b381-d0884e678d39}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"physics_nodes\">\n      <UniqueIdentifier>{d5806151-7ae1-4fef-af5a-2fa1d1c7377b}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"GUI\\CCEditBox\">\n      <UniqueIdentifier>{5d186e3d-0aaf-4904-a5d8-e5cb0f35f4cc}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"AssetsManager\">\n      <UniqueIdentifier>{49487dbe-5758-436a-b014-8e2edc6b33ae}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\GUI\\CCScrollView\\CCScrollView.cpp\">\n      <Filter>GUI\\CCScrollView</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCScrollView\\CCTableView.cpp\">\n      <Filter>GUI\\CCScrollView</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCScrollView\\CCTableViewCell.cpp\">\n      <Filter>GUI\\CCScrollView</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlColourPicker.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlHuePicker.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlPotentiometer.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlSaturationBrightnessPicker.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlSlider.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlStepper.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlSwitch.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlUtils.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCInvocation.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCScale9Sprite.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControl.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCControlExtension\\CCControlButton.cpp\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCEditBox\\CCEditBoxImplWin.cpp\">\n      <Filter>GUI\\CCEditBox</Filter>\n    </ClCompile>\n    <ClCompile Include=\"Win32InputBox.cpp\">\n      <Filter>GUI\\CCEditBox</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\GUI\\CCEditBox\\CCEditBox.cpp\">\n      <Filter>GUI\\CCEditBox</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\assets-manager\\AssetsManager.cpp\">\n      <Filter>AssetsManager</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics-nodes\\CCPhysicsDebugNode.cpp\">\n      <Filter>physics_nodes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\physics-nodes\\CCPhysicsSprite.cpp\">\n      <Filter>physics_nodes</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\GUI\\CCScrollView\\CCScrollView.h\">\n      <Filter>GUI\\CCScrollView</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\cocos-ext.h\" />\n    <ClInclude Include=\"..\\ExtensionMacros.h\" />\n    <ClInclude Include=\"..\\GUI\\CCScrollView\\CCTableView.h\">\n      <Filter>GUI\\CCScrollView</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCScrollView\\CCTableViewCell.h\">\n      <Filter>GUI\\CCScrollView</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlButton.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlColourPicker.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlExtensions.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlHuePicker.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlPotentiometer.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlSaturationBrightnessPicker.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlSlider.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlStepper.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlSwitch.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControlUtils.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCInvocation.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCScale9Sprite.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCControlExtension\\CCControl.h\">\n      <Filter>GUI\\CCControlExtension</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCEditBox\\CCEditBoxImplWin.h\">\n      <Filter>GUI\\CCEditBox</Filter>\n    </ClInclude>\n    <ClInclude Include=\"Win32InputBox.h\">\n      <Filter>GUI\\CCEditBox</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCEditBox\\CCEditBox.h\">\n      <Filter>GUI\\CCEditBox</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\GUI\\CCEditBox\\CCEditBoxImpl.h\">\n      <Filter>GUI\\CCEditBox</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\assets-manager\\AssetsManager.h\">\n      <Filter>AssetsManager</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics-nodes\\CCPhysicsDebugNode.h\">\n      <Filter>physics_nodes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\physics-nodes\\CCPhysicsSprite.h\">\n      <Filter>physics_nodes</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/external/Box2D/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := box2d_static\n\nLOCAL_MODULE_FILENAME := libbox2d\n\nLOCAL_SRC_FILES := \\\nCollision/b2BroadPhase.cpp \\\nCollision/b2CollideCircle.cpp \\\nCollision/b2CollideEdge.cpp \\\nCollision/b2CollidePolygon.cpp \\\nCollision/b2Collision.cpp \\\nCollision/b2Distance.cpp \\\nCollision/b2DynamicTree.cpp \\\nCollision/b2TimeOfImpact.cpp \\\nCollision/Shapes/b2ChainShape.cpp \\\nCollision/Shapes/b2CircleShape.cpp \\\nCollision/Shapes/b2EdgeShape.cpp \\\nCollision/Shapes/b2PolygonShape.cpp \\\nCommon/b2BlockAllocator.cpp \\\nCommon/b2Draw.cpp \\\nCommon/b2Math.cpp \\\nCommon/b2Settings.cpp \\\nCommon/b2StackAllocator.cpp \\\nCommon/b2Timer.cpp \\\nDynamics/b2Body.cpp \\\nDynamics/b2ContactManager.cpp \\\nDynamics/b2Fixture.cpp \\\nDynamics/b2Island.cpp \\\nDynamics/b2World.cpp \\\nDynamics/b2WorldCallbacks.cpp \\\nDynamics/Contacts/b2ChainAndCircleContact.cpp \\\nDynamics/Contacts/b2ChainAndPolygonContact.cpp \\\nDynamics/Contacts/b2CircleContact.cpp \\\nDynamics/Contacts/b2Contact.cpp \\\nDynamics/Contacts/b2ContactSolver.cpp \\\nDynamics/Contacts/b2EdgeAndCircleContact.cpp \\\nDynamics/Contacts/b2EdgeAndPolygonContact.cpp \\\nDynamics/Contacts/b2PolygonAndCircleContact.cpp \\\nDynamics/Contacts/b2PolygonContact.cpp \\\nDynamics/Joints/b2DistanceJoint.cpp \\\nDynamics/Joints/b2FrictionJoint.cpp \\\nDynamics/Joints/b2GearJoint.cpp \\\nDynamics/Joints/b2Joint.cpp \\\nDynamics/Joints/b2MotorJoint.cpp \\\nDynamics/Joints/b2MouseJoint.cpp \\\nDynamics/Joints/b2PrismaticJoint.cpp \\\nDynamics/Joints/b2PulleyJoint.cpp \\\nDynamics/Joints/b2RevoluteJoint.cpp \\\nDynamics/Joints/b2RopeJoint.cpp \\\nDynamics/Joints/b2WeldJoint.cpp \\\nDynamics/Joints/b2WheelJoint.cpp \\\nRope/b2Rope.cpp\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/..\n                                 \ninclude $(BUILD_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/Box2D/Box2D.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef BOX2D_H\n#define BOX2D_H\n\n/**\n\\mainpage Box2D API Documentation\n\n\\section intro_sec Getting Started\n\nFor documentation please see http://box2d.org/documentation.html\n\nFor discussion please visit http://box2d.org/forum\n*/\n\n// These include files constitute the main Box2D API\n\n#include <Box2D/Common/b2Settings.h>\n#include <Box2D/Common/b2Draw.h>\n#include <Box2D/Common/b2Timer.h>\n\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n#include <Box2D/Collision/Shapes/b2ChainShape.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n\n#include <Box2D/Collision/b2BroadPhase.h>\n#include <Box2D/Collision/b2Distance.h>\n#include <Box2D/Collision/b2DynamicTree.h>\n#include <Box2D/Collision/b2TimeOfImpact.h>\n\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2WorldCallbacks.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n#include <Box2D/Dynamics/b2World.h>\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\n#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>\n#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>\n#include <Box2D/Dynamics/Joints/b2GearJoint.h>\n#include <Box2D/Dynamics/Joints/b2MotorJoint.h>\n#include <Box2D/Dynamics/Joints/b2MouseJoint.h>\n#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>\n#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>\n#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>\n#include <Box2D/Dynamics/Joints/b2RopeJoint.h>\n#include <Box2D/Dynamics/Joints/b2WeldJoint.h>\n#include <Box2D/Dynamics/Joints/b2WheelJoint.h>\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/CMakeLists.txt",
    "content": "set(BOX2D_SRC\n  Collision/Shapes/b2ChainShape.cpp\n  Collision/Shapes/b2CircleShape.cpp\n  Collision/Shapes/b2EdgeShape.cpp\n  Collision/Shapes/b2PolygonShape.cpp\n  Collision/b2BroadPhase.cpp\n  Collision/b2CollideCircle.cpp\n  Collision/b2CollideEdge.cpp\n  Collision/b2CollidePolygon.cpp\n  Collision/b2Collision.cpp\n  Collision/b2Distance.cpp\n  Collision/b2DynamicTree.cpp\n  Collision/b2TimeOfImpact.cpp\n  Common/b2BlockAllocator.cpp\n  Common/b2Draw.cpp\n  Common/b2Math.cpp\n  Common/b2Settings.cpp\n  Common/b2StackAllocator.cpp\n  Common/b2Timer.cpp\n  Dynamics/Contacts/b2ChainAndCircleContact.cpp\n  Dynamics/Contacts/b2ChainAndPolygonContact.cpp\n  Dynamics/Contacts/b2CircleContact.cpp\n  Dynamics/Contacts/b2Contact.cpp\n  Dynamics/Contacts/b2ContactSolver.cpp\n  Dynamics/Contacts/b2EdgeAndCircleContact.cpp\n  Dynamics/Contacts/b2EdgeAndPolygonContact.cpp\n  Dynamics/Contacts/b2PolygonAndCircleContact.cpp\n  Dynamics/Contacts/b2PolygonContact.cpp\n  Dynamics/Joints/b2DistanceJoint.cpp\n  Dynamics/Joints/b2FrictionJoint.cpp\n  Dynamics/Joints/b2GearJoint.cpp\n  Dynamics/Joints/b2Joint.cpp\n  Dynamics/Joints/b2MouseJoint.cpp\n  Dynamics/Joints/b2MotorJoint.cpp\n  Dynamics/Joints/b2PrismaticJoint.cpp\n  Dynamics/Joints/b2PulleyJoint.cpp\n  Dynamics/Joints/b2RevoluteJoint.cpp\n  Dynamics/Joints/b2RopeJoint.cpp\n  Dynamics/Joints/b2WeldJoint.cpp\n  Dynamics/Joints/b2WheelJoint.cpp\n  Dynamics/b2Body.cpp\n  Dynamics/b2ContactManager.cpp\n  Dynamics/b2Fixture.cpp\n  Dynamics/b2Island.cpp\n  Dynamics/b2World.cpp\n  Dynamics/b2WorldCallbacks.cpp\n  Rope/b2Rope.cpp\n)\n\ninclude_directories(\n  ..\n)\n\nadd_library(box2d STATIC\n  ${BOX2D_SRC}\n)\n\nset_target_properties(box2d\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2ChainShape.cpp",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/Shapes/b2ChainShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n#include <new>\n#include <memory.h>\n#include <string.h>\n\nb2ChainShape::~b2ChainShape()\n{\n\tb2Free(m_vertices);\n\tm_vertices = NULL;\n\tm_count = 0;\n}\n\nvoid b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)\n{\n\tb2Assert(m_vertices == NULL && m_count == 0);\n\tb2Assert(count >= 3);\n\tfor (int32 i = 1; i < count; ++i)\n\t{\n\t\tb2Vec2 v1 = vertices[i-1];\n\t\tb2Vec2 v2 = vertices[i];\n\t\t// If the code crashes here, it means your vertices are too close together.\n\t\tb2Assert(b2DistanceSquared(v1, v2) > b2_linearSlop * b2_linearSlop);\n\t}\n\n\tm_count = count + 1;\n\tm_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2));\n\tmemcpy(m_vertices, vertices, count * sizeof(b2Vec2));\n\tm_vertices[count] = m_vertices[0];\n\tm_prevVertex = m_vertices[m_count - 2];\n\tm_nextVertex = m_vertices[1];\n\tm_hasPrevVertex = true;\n\tm_hasNextVertex = true;\n}\n\nvoid b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count)\n{\n\tb2Assert(m_vertices == NULL && m_count == 0);\n\tb2Assert(count >= 2);\n\tfor (int32 i = 1; i < count; ++i)\n\t{\n\t\tb2Vec2 v1 = vertices[i-1];\n\t\tb2Vec2 v2 = vertices[i];\n\t\t// If the code crashes here, it means your vertices are too close together.\n\t\tb2Assert(b2DistanceSquared(v1, v2) > b2_linearSlop * b2_linearSlop);\n\t}\n\n\tm_count = count;\n\tm_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2));\n\tmemcpy(m_vertices, vertices, m_count * sizeof(b2Vec2));\n\n\tm_hasPrevVertex = false;\n\tm_hasNextVertex = false;\n\n\tm_prevVertex.SetZero();\n\tm_nextVertex.SetZero();\n}\n\nvoid b2ChainShape::SetPrevVertex(const b2Vec2& prevVertex)\n{\n\tm_prevVertex = prevVertex;\n\tm_hasPrevVertex = true;\n}\n\nvoid b2ChainShape::SetNextVertex(const b2Vec2& nextVertex)\n{\n\tm_nextVertex = nextVertex;\n\tm_hasNextVertex = true;\n}\n\nb2Shape* b2ChainShape::Clone(b2BlockAllocator* allocator) const\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2ChainShape));\n\tb2ChainShape* clone = new (mem) b2ChainShape;\n\tclone->CreateChain(m_vertices, m_count);\n\tclone->m_prevVertex = m_prevVertex;\n\tclone->m_nextVertex = m_nextVertex;\n\tclone->m_hasPrevVertex = m_hasPrevVertex;\n\tclone->m_hasNextVertex = m_hasNextVertex;\n\treturn clone;\n}\n\nint32 b2ChainShape::GetChildCount() const\n{\n\t// edge count = vertex count - 1\n\treturn m_count - 1;\n}\n\nvoid b2ChainShape::GetChildEdge(b2EdgeShape* edge, int32 index) const\n{\n\tb2Assert(0 <= index && index < m_count - 1);\n\tedge->m_type = b2Shape::e_edge;\n\tedge->m_radius = m_radius;\n\n\tedge->m_vertex1 = m_vertices[index + 0];\n\tedge->m_vertex2 = m_vertices[index + 1];\n\n\tif (index > 0)\n\t{\n\t\tedge->m_vertex0 = m_vertices[index - 1];\n\t\tedge->m_hasVertex0 = true;\n\t}\n\telse\n\t{\n\t\tedge->m_vertex0 = m_prevVertex;\n\t\tedge->m_hasVertex0 = m_hasPrevVertex;\n\t}\n\n\tif (index < m_count - 2)\n\t{\n\t\tedge->m_vertex3 = m_vertices[index + 2];\n\t\tedge->m_hasVertex3 = true;\n\t}\n\telse\n\t{\n\t\tedge->m_vertex3 = m_nextVertex;\n\t\tedge->m_hasVertex3 = m_hasNextVertex;\n\t}\n}\n\nbool b2ChainShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const\n{\n\tB2_NOT_USED(xf);\n\tB2_NOT_USED(p);\n\treturn false;\n}\n\nbool b2ChainShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\t\t\t\tconst b2Transform& xf, int32 childIndex) const\n{\n\tb2Assert(childIndex < m_count);\n\n\tb2EdgeShape edgeShape;\n\n\tint32 i1 = childIndex;\n\tint32 i2 = childIndex + 1;\n\tif (i2 == m_count)\n\t{\n\t\ti2 = 0;\n\t}\n\n\tedgeShape.m_vertex1 = m_vertices[i1];\n\tedgeShape.m_vertex2 = m_vertices[i2];\n\n\treturn edgeShape.RayCast(output, input, xf, 0);\n}\n\nvoid b2ChainShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const\n{\n\tb2Assert(childIndex < m_count);\n\n\tint32 i1 = childIndex;\n\tint32 i2 = childIndex + 1;\n\tif (i2 == m_count)\n\t{\n\t\ti2 = 0;\n\t}\n\n\tb2Vec2 v1 = b2Mul(xf, m_vertices[i1]);\n\tb2Vec2 v2 = b2Mul(xf, m_vertices[i2]);\n\n\taabb->lowerBound = b2Min(v1, v2);\n\taabb->upperBound = b2Max(v1, v2);\n}\n\nvoid b2ChainShape::ComputeMass(b2MassData* massData, float32 density) const\n{\n\tB2_NOT_USED(density);\n\n\tmassData->mass = 0.0f;\n\tmassData->center.SetZero();\n\tmassData->I = 0.0f;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2ChainShape.h",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CHAIN_SHAPE_H\n#define B2_CHAIN_SHAPE_H\n\n#include <Box2D/Collision/Shapes/b2Shape.h>\n\nclass b2EdgeShape;\n\n/// A chain shape is a free form sequence of line segments.\n/// The chain has two-sided collision, so you can use inside and outside collision.\n/// Therefore, you may use any winding order.\n/// Since there may be many vertices, they are allocated using b2Alloc.\n/// Connectivity information is used to create smooth collisions.\n/// WARNING: The chain will not collide properly if there are self-intersections.\nclass b2ChainShape : public b2Shape\n{\npublic:\n\tb2ChainShape();\n\n\t/// The destructor frees the vertices using b2Free.\n\t~b2ChainShape();\n\n\t/// Create a loop. This automatically adjusts connectivity.\n\t/// @param vertices an array of vertices, these are copied\n\t/// @param count the vertex count\n\tvoid CreateLoop(const b2Vec2* vertices, int32 count);\n\n\t/// Create a chain with isolated end vertices.\n\t/// @param vertices an array of vertices, these are copied\n\t/// @param count the vertex count\n\tvoid CreateChain(const b2Vec2* vertices, int32 count);\n\n\t/// Establish connectivity to a vertex that precedes the first vertex.\n\t/// Don't call this for loops.\n\tvoid SetPrevVertex(const b2Vec2& prevVertex);\n\n\t/// Establish connectivity to a vertex that follows the last vertex.\n\t/// Don't call this for loops.\n\tvoid SetNextVertex(const b2Vec2& nextVertex);\n\n\t/// Implement b2Shape. Vertices are cloned using b2Alloc.\n\tb2Shape* Clone(b2BlockAllocator* allocator) const;\n\n\t/// @see b2Shape::GetChildCount\n\tint32 GetChildCount() const;\n\n\t/// Get a child edge.\n\tvoid GetChildEdge(b2EdgeShape* edge, int32 index) const;\n\n\t/// This always return false.\n\t/// @see b2Shape::TestPoint\n\tbool TestPoint(const b2Transform& transform, const b2Vec2& p) const;\n\n\t/// Implement b2Shape.\n\tbool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\t\tconst b2Transform& transform, int32 childIndex) const;\n\n\t/// @see b2Shape::ComputeAABB\n\tvoid ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;\n\n\t/// Chains have zero mass.\n\t/// @see b2Shape::ComputeMass\n\tvoid ComputeMass(b2MassData* massData, float32 density) const;\n\n\t/// The vertices. Owned by this class.\n\tb2Vec2* m_vertices;\n\n\t/// The vertex count.\n\tint32 m_count;\n\n\tb2Vec2 m_prevVertex, m_nextVertex;\n\tbool m_hasPrevVertex, m_hasNextVertex;\n};\n\ninline b2ChainShape::b2ChainShape()\n{\n\tm_type = e_chain;\n\tm_radius = b2_polygonRadius;\n\tm_vertices = NULL;\n\tm_count = 0;\n\tm_hasPrevVertex = false;\n\tm_hasNextVertex = false;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2CircleShape.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <new>\n\nb2Shape* b2CircleShape::Clone(b2BlockAllocator* allocator) const\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2CircleShape));\n\tb2CircleShape* clone = new (mem) b2CircleShape;\n\t*clone = *this;\n\treturn clone;\n}\n\nint32 b2CircleShape::GetChildCount() const\n{\n\treturn 1;\n}\n\nbool b2CircleShape::TestPoint(const b2Transform& transform, const b2Vec2& p) const\n{\n\tb2Vec2 center = transform.p + b2Mul(transform.q, m_p);\n\tb2Vec2 d = p - center;\n\treturn b2Dot(d, d) <= m_radius * m_radius;\n}\n\n// Collision Detection in Interactive 3D Environments by Gino van den Bergen\n// From Section 3.1.2\n// x = s + a * r\n// norm(x) = radius\nbool b2CircleShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\t\t\t\tconst b2Transform& transform, int32 childIndex) const\n{\n\tB2_NOT_USED(childIndex);\n\n\tb2Vec2 position = transform.p + b2Mul(transform.q, m_p);\n\tb2Vec2 s = input.p1 - position;\n\tfloat32 b = b2Dot(s, s) - m_radius * m_radius;\n\n\t// Solve quadratic equation.\n\tb2Vec2 r = input.p2 - input.p1;\n\tfloat32 c =  b2Dot(s, r);\n\tfloat32 rr = b2Dot(r, r);\n\tfloat32 sigma = c * c - rr * b;\n\n\t// Check for negative discriminant and short segment.\n\tif (sigma < 0.0f || rr < b2_epsilon)\n\t{\n\t\treturn false;\n\t}\n\n\t// Find the point of intersection of the line with the circle.\n\tfloat32 a = -(c + b2Sqrt(sigma));\n\n\t// Is the intersection point on the segment?\n\tif (0.0f <= a && a <= input.maxFraction * rr)\n\t{\n\t\ta /= rr;\n\t\toutput->fraction = a;\n\t\toutput->normal = s + a * r;\n\t\toutput->normal.Normalize();\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nvoid b2CircleShape::ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const\n{\n\tB2_NOT_USED(childIndex);\n\n\tb2Vec2 p = transform.p + b2Mul(transform.q, m_p);\n\taabb->lowerBound.Set(p.x - m_radius, p.y - m_radius);\n\taabb->upperBound.Set(p.x + m_radius, p.y + m_radius);\n}\n\nvoid b2CircleShape::ComputeMass(b2MassData* massData, float32 density) const\n{\n\tmassData->mass = density * b2_pi * m_radius * m_radius;\n\tmassData->center = m_p;\n\n\t// inertia about the local origin\n\tmassData->I = massData->mass * (0.5f * m_radius * m_radius + b2Dot(m_p, m_p));\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2CircleShape.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CIRCLE_SHAPE_H\n#define B2_CIRCLE_SHAPE_H\n\n#include <Box2D/Collision/Shapes/b2Shape.h>\n\n/// A circle shape.\nclass b2CircleShape : public b2Shape\n{\npublic:\n\tb2CircleShape();\n\n\t/// Implement b2Shape.\n\tb2Shape* Clone(b2BlockAllocator* allocator) const;\n\n\t/// @see b2Shape::GetChildCount\n\tint32 GetChildCount() const;\n\n\t/// Implement b2Shape.\n\tbool TestPoint(const b2Transform& transform, const b2Vec2& p) const;\n\n\t/// Implement b2Shape.\n\tbool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\tconst b2Transform& transform, int32 childIndex) const;\n\n\t/// @see b2Shape::ComputeAABB\n\tvoid ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;\n\n\t/// @see b2Shape::ComputeMass\n\tvoid ComputeMass(b2MassData* massData, float32 density) const;\n\n\t/// Get the supporting vertex index in the given direction.\n\tint32 GetSupport(const b2Vec2& d) const;\n\n\t/// Get the supporting vertex in the given direction.\n\tconst b2Vec2& GetSupportVertex(const b2Vec2& d) const;\n\n\t/// Get the vertex count.\n\tint32 GetVertexCount() const { return 1; }\n\n\t/// Get a vertex by index. Used by b2Distance.\n\tconst b2Vec2& GetVertex(int32 index) const;\n\n\t/// Position\n\tb2Vec2 m_p;\n};\n\ninline b2CircleShape::b2CircleShape()\n{\n\tm_type = e_circle;\n\tm_radius = 0.0f;\n\tm_p.SetZero();\n}\n\ninline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const\n{\n\tB2_NOT_USED(d);\n\treturn 0;\n}\n\ninline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const\n{\n\tB2_NOT_USED(d);\n\treturn m_p;\n}\n\ninline const b2Vec2& b2CircleShape::GetVertex(int32 index) const\n{\n\tB2_NOT_USED(index);\n\tb2Assert(index == 0);\n\treturn m_p;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2EdgeShape.cpp",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n#include <new>\n\nvoid b2EdgeShape::Set(const b2Vec2& v1, const b2Vec2& v2)\n{\n\tm_vertex1 = v1;\n\tm_vertex2 = v2;\n\tm_hasVertex0 = false;\n\tm_hasVertex3 = false;\n}\n\nb2Shape* b2EdgeShape::Clone(b2BlockAllocator* allocator) const\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2EdgeShape));\n\tb2EdgeShape* clone = new (mem) b2EdgeShape;\n\t*clone = *this;\n\treturn clone;\n}\n\nint32 b2EdgeShape::GetChildCount() const\n{\n\treturn 1;\n}\n\nbool b2EdgeShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const\n{\n\tB2_NOT_USED(xf);\n\tB2_NOT_USED(p);\n\treturn false;\n}\n\n// p = p1 + t * d\n// v = v1 + s * e\n// p1 + t * d = v1 + s * e\n// s * e - t * d = p1 - v1\nbool b2EdgeShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\t\t\t\tconst b2Transform& xf, int32 childIndex) const\n{\n\tB2_NOT_USED(childIndex);\n\n\t// Put the ray into the edge's frame of reference.\n\tb2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p);\n\tb2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p);\n\tb2Vec2 d = p2 - p1;\n\n\tb2Vec2 v1 = m_vertex1;\n\tb2Vec2 v2 = m_vertex2;\n\tb2Vec2 e = v2 - v1;\n\tb2Vec2 normal(e.y, -e.x);\n\tnormal.Normalize();\n\n\t// q = p1 + t * d\n\t// dot(normal, q - v1) = 0\n\t// dot(normal, p1 - v1) + t * dot(normal, d) = 0\n\tfloat32 numerator = b2Dot(normal, v1 - p1);\n\tfloat32 denominator = b2Dot(normal, d);\n\n\tif (denominator == 0.0f)\n\t{\n\t\treturn false;\n\t}\n\n\tfloat32 t = numerator / denominator;\n\tif (t < 0.0f || input.maxFraction < t)\n\t{\n\t\treturn false;\n\t}\n\n\tb2Vec2 q = p1 + t * d;\n\n\t// q = v1 + s * r\n\t// s = dot(q - v1, r) / dot(r, r)\n\tb2Vec2 r = v2 - v1;\n\tfloat32 rr = b2Dot(r, r);\n\tif (rr == 0.0f)\n\t{\n\t\treturn false;\n\t}\n\n\tfloat32 s = b2Dot(q - v1, r) / rr;\n\tif (s < 0.0f || 1.0f < s)\n\t{\n\t\treturn false;\n\t}\n\n\toutput->fraction = t;\n\tif (numerator > 0.0f)\n\t{\n\t\toutput->normal = -b2Mul(xf.q, normal);\n\t}\n\telse\n\t{\n\t\toutput->normal = b2Mul(xf.q, normal);\n\t}\n\treturn true;\n}\n\nvoid b2EdgeShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const\n{\n\tB2_NOT_USED(childIndex);\n\n\tb2Vec2 v1 = b2Mul(xf, m_vertex1);\n\tb2Vec2 v2 = b2Mul(xf, m_vertex2);\n\n\tb2Vec2 lower = b2Min(v1, v2);\n\tb2Vec2 upper = b2Max(v1, v2);\n\n\tb2Vec2 r(m_radius, m_radius);\n\taabb->lowerBound = lower - r;\n\taabb->upperBound = upper + r;\n}\n\nvoid b2EdgeShape::ComputeMass(b2MassData* massData, float32 density) const\n{\n\tB2_NOT_USED(density);\n\n\tmassData->mass = 0.0f;\n\tmassData->center = 0.5f * (m_vertex1 + m_vertex2);\n\tmassData->I = 0.0f;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2EdgeShape.h",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_EDGE_SHAPE_H\n#define B2_EDGE_SHAPE_H\n\n#include <Box2D/Collision/Shapes/b2Shape.h>\n\n/// A line segment (edge) shape. These can be connected in chains or loops\n/// to other edge shapes. The connectivity information is used to ensure\n/// correct contact normals.\nclass b2EdgeShape : public b2Shape\n{\npublic:\n\tb2EdgeShape();\n\n\t/// Set this as an isolated edge.\n\tvoid Set(const b2Vec2& v1, const b2Vec2& v2);\n\n\t/// Implement b2Shape.\n\tb2Shape* Clone(b2BlockAllocator* allocator) const;\n\n\t/// @see b2Shape::GetChildCount\n\tint32 GetChildCount() const;\n\n\t/// @see b2Shape::TestPoint\n\tbool TestPoint(const b2Transform& transform, const b2Vec2& p) const;\n\n\t/// Implement b2Shape.\n\tbool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\tconst b2Transform& transform, int32 childIndex) const;\n\n\t/// @see b2Shape::ComputeAABB\n\tvoid ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;\n\n\t/// @see b2Shape::ComputeMass\n\tvoid ComputeMass(b2MassData* massData, float32 density) const;\n\t\n\t/// These are the edge vertices\n\tb2Vec2 m_vertex1, m_vertex2;\n\n\t/// Optional adjacent vertices. These are used for smooth collision.\n\tb2Vec2 m_vertex0, m_vertex3;\n\tbool m_hasVertex0, m_hasVertex3;\n};\n\ninline b2EdgeShape::b2EdgeShape()\n{\n\tm_type = e_edge;\n\tm_radius = b2_polygonRadius;\n\tm_vertex0.x = 0.0f;\n\tm_vertex0.y = 0.0f;\n\tm_vertex3.x = 0.0f;\n\tm_vertex3.y = 0.0f;\n\tm_hasVertex0 = false;\n\tm_hasVertex3 = false;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2PolygonShape.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n#include <new>\n\nb2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2PolygonShape));\n\tb2PolygonShape* clone = new (mem) b2PolygonShape;\n\t*clone = *this;\n\treturn clone;\n}\n\nvoid b2PolygonShape::SetAsBox(float32 hx, float32 hy)\n{\n\tm_count = 4;\n\tm_vertices[0].Set(-hx, -hy);\n\tm_vertices[1].Set( hx, -hy);\n\tm_vertices[2].Set( hx,  hy);\n\tm_vertices[3].Set(-hx,  hy);\n\tm_normals[0].Set(0.0f, -1.0f);\n\tm_normals[1].Set(1.0f, 0.0f);\n\tm_normals[2].Set(0.0f, 1.0f);\n\tm_normals[3].Set(-1.0f, 0.0f);\n\tm_centroid.SetZero();\n}\n\nvoid b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle)\n{\n\tm_count = 4;\n\tm_vertices[0].Set(-hx, -hy);\n\tm_vertices[1].Set( hx, -hy);\n\tm_vertices[2].Set( hx,  hy);\n\tm_vertices[3].Set(-hx,  hy);\n\tm_normals[0].Set(0.0f, -1.0f);\n\tm_normals[1].Set(1.0f, 0.0f);\n\tm_normals[2].Set(0.0f, 1.0f);\n\tm_normals[3].Set(-1.0f, 0.0f);\n\tm_centroid = center;\n\n\tb2Transform xf;\n\txf.p = center;\n\txf.q.Set(angle);\n\n\t// Transform vertices and normals.\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tm_vertices[i] = b2Mul(xf, m_vertices[i]);\n\t\tm_normals[i] = b2Mul(xf.q, m_normals[i]);\n\t}\n}\n\nint32 b2PolygonShape::GetChildCount() const\n{\n\treturn 1;\n}\n\nstatic b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count)\n{\n\tb2Assert(count >= 3);\n\n\tb2Vec2 c; c.Set(0.0f, 0.0f);\n\tfloat32 area = 0.0f;\n\n\t// pRef is the reference point for forming triangles.\n\t// It's location doesn't change the result (except for rounding error).\n\tb2Vec2 pRef(0.0f, 0.0f);\n#if 0\n\t// This code would put the reference point inside the polygon.\n\tfor (int32 i = 0; i < count; ++i)\n\t{\n\t\tpRef += vs[i];\n\t}\n\tpRef *= 1.0f / count;\n#endif\n\n\tconst float32 inv3 = 1.0f / 3.0f;\n\n\tfor (int32 i = 0; i < count; ++i)\n\t{\n\t\t// Triangle vertices.\n\t\tb2Vec2 p1 = pRef;\n\t\tb2Vec2 p2 = vs[i];\n\t\tb2Vec2 p3 = i + 1 < count ? vs[i+1] : vs[0];\n\n\t\tb2Vec2 e1 = p2 - p1;\n\t\tb2Vec2 e2 = p3 - p1;\n\n\t\tfloat32 D = b2Cross(e1, e2);\n\n\t\tfloat32 triangleArea = 0.5f * D;\n\t\tarea += triangleArea;\n\n\t\t// Area weighted centroid\n\t\tc += triangleArea * inv3 * (p1 + p2 + p3);\n\t}\n\n\t// Centroid\n\tb2Assert(area > b2_epsilon);\n\tc *= 1.0f / area;\n\treturn c;\n}\n\nvoid b2PolygonShape::Set(const b2Vec2* vertices, int32 count)\n{\n\tb2Assert(3 <= count && count <= b2_maxPolygonVertices);\n\tif (count < 3)\n\t{\n\t\tSetAsBox(1.0f, 1.0f);\n\t\treturn;\n\t}\n\t\n\tint32 n = b2Min(count, b2_maxPolygonVertices);\n\n\t// Perform welding and copy vertices into local buffer.\n\tb2Vec2 ps[b2_maxPolygonVertices];\n\tint32 tempCount = 0;\n\tfor (int32 i = 0; i < n; ++i)\n\t{\n\t\tb2Vec2 v = vertices[i];\n\n\t\tbool unique = true;\n\t\tfor (int32 j = 0; j < tempCount; ++j)\n\t\t{\n\t\t\tif (b2DistanceSquared(v, ps[j]) < 0.5f * b2_linearSlop)\n\t\t\t{\n\t\t\t\tunique = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (unique)\n\t\t{\n\t\t\tps[tempCount++] = v;\n\t\t}\n\t}\n\n\tn = tempCount;\n\tif (n < 3)\n\t{\n\t\t// Polygon is degenerate.\n\t\tb2Assert(false);\n\t\tSetAsBox(1.0f, 1.0f);\n\t\treturn;\n\t}\n\n\t// Create the convex hull using the Gift wrapping algorithm\n\t// http://en.wikipedia.org/wiki/Gift_wrapping_algorithm\n\n\t// Find the right most point on the hull\n\tint32 i0 = 0;\n\tfloat32 x0 = ps[0].x;\n\tfor (int32 i = 1; i < n; ++i)\n\t{\n\t\tfloat32 x = ps[i].x;\n\t\tif (x > x0 || (x == x0 && ps[i].y < ps[i0].y))\n\t\t{\n\t\t\ti0 = i;\n\t\t\tx0 = x;\n\t\t}\n\t}\n\n\tint32 hull[b2_maxPolygonVertices];\n\tint32 m = 0;\n\tint32 ih = i0;\n\n\tfor (;;)\n\t{\n\t\thull[m] = ih;\n\n\t\tint32 ie = 0;\n\t\tfor (int32 j = 1; j < n; ++j)\n\t\t{\n\t\t\tif (ie == ih)\n\t\t\t{\n\t\t\t\tie = j;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tb2Vec2 r = ps[ie] - ps[hull[m]];\n\t\t\tb2Vec2 v = ps[j] - ps[hull[m]];\n\t\t\tfloat32 c = b2Cross(r, v);\n\t\t\tif (c < 0.0f)\n\t\t\t{\n\t\t\t\tie = j;\n\t\t\t}\n\n\t\t\t// Collinearity check\n\t\t\tif (c == 0.0f && v.LengthSquared() > r.LengthSquared())\n\t\t\t{\n\t\t\t\tie = j;\n\t\t\t}\n\t\t}\n\n\t\t++m;\n\t\tih = ie;\n\n\t\tif (ie == i0)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tm_count = m;\n\n\t// Copy vertices.\n\tfor (int32 i = 0; i < m; ++i)\n\t{\n\t\tm_vertices[i] = ps[hull[i]];\n\t}\n\n\t// Compute normals. Ensure the edges have non-zero length.\n\tfor (int32 i = 0; i < m; ++i)\n\t{\n\t\tint32 i1 = i;\n\t\tint32 i2 = i + 1 < m ? i + 1 : 0;\n\t\tb2Vec2 edge = m_vertices[i2] - m_vertices[i1];\n\t\tb2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon);\n\t\tm_normals[i] = b2Cross(edge, 1.0f);\n\t\tm_normals[i].Normalize();\n\t}\n\n\t// Compute the polygon centroid.\n\tm_centroid = ComputeCentroid(m_vertices, m);\n}\n\nbool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const\n{\n\tb2Vec2 pLocal = b2MulT(xf.q, p - xf.p);\n\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tfloat32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]);\n\t\tif (dot > 0.0f)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nbool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\t\t\t\t\tconst b2Transform& xf, int32 childIndex) const\n{\n\tB2_NOT_USED(childIndex);\n\n\t// Put the ray into the polygon's frame of reference.\n\tb2Vec2 p1 = b2MulT(xf.q, input.p1 - xf.p);\n\tb2Vec2 p2 = b2MulT(xf.q, input.p2 - xf.p);\n\tb2Vec2 d = p2 - p1;\n\n\tfloat32 lower = 0.0f, upper = input.maxFraction;\n\n\tint32 index = -1;\n\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\t// p = p1 + a * d\n\t\t// dot(normal, p - v) = 0\n\t\t// dot(normal, p1 - v) + a * dot(normal, d) = 0\n\t\tfloat32 numerator = b2Dot(m_normals[i], m_vertices[i] - p1);\n\t\tfloat32 denominator = b2Dot(m_normals[i], d);\n\n\t\tif (denominator == 0.0f)\n\t\t{\t\n\t\t\tif (numerator < 0.0f)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Note: we want this predicate without division:\n\t\t\t// lower < numerator / denominator, where denominator < 0\n\t\t\t// Since denominator < 0, we have to flip the inequality:\n\t\t\t// lower < numerator / denominator <==> denominator * lower > numerator.\n\t\t\tif (denominator < 0.0f && numerator < lower * denominator)\n\t\t\t{\n\t\t\t\t// Increase lower.\n\t\t\t\t// The segment enters this half-space.\n\t\t\t\tlower = numerator / denominator;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t\telse if (denominator > 0.0f && numerator < upper * denominator)\n\t\t\t{\n\t\t\t\t// Decrease upper.\n\t\t\t\t// The segment exits this half-space.\n\t\t\t\tupper = numerator / denominator;\n\t\t\t}\n\t\t}\n\n\t\t// The use of epsilon here causes the assert on lower to trip\n\t\t// in some cases. Apparently the use of epsilon was to make edge\n\t\t// shapes work, but now those are handled separately.\n\t\t//if (upper < lower - b2_epsilon)\n\t\tif (upper < lower)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tb2Assert(0.0f <= lower && lower <= input.maxFraction);\n\n\tif (index >= 0)\n\t{\n\t\toutput->fraction = lower;\n\t\toutput->normal = b2Mul(xf.q, m_normals[index]);\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nvoid b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const\n{\n\tB2_NOT_USED(childIndex);\n\n\tb2Vec2 lower = b2Mul(xf, m_vertices[0]);\n\tb2Vec2 upper = lower;\n\n\tfor (int32 i = 1; i < m_count; ++i)\n\t{\n\t\tb2Vec2 v = b2Mul(xf, m_vertices[i]);\n\t\tlower = b2Min(lower, v);\n\t\tupper = b2Max(upper, v);\n\t}\n\n\tb2Vec2 r(m_radius, m_radius);\n\taabb->lowerBound = lower - r;\n\taabb->upperBound = upper + r;\n}\n\nvoid b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const\n{\n\t// Polygon mass, centroid, and inertia.\n\t// Let rho be the polygon density in mass per unit area.\n\t// Then:\n\t// mass = rho * int(dA)\n\t// centroid.x = (1/mass) * rho * int(x * dA)\n\t// centroid.y = (1/mass) * rho * int(y * dA)\n\t// I = rho * int((x*x + y*y) * dA)\n\t//\n\t// We can compute these integrals by summing all the integrals\n\t// for each triangle of the polygon. To evaluate the integral\n\t// for a single triangle, we make a change of variables to\n\t// the (u,v) coordinates of the triangle:\n\t// x = x0 + e1x * u + e2x * v\n\t// y = y0 + e1y * u + e2y * v\n\t// where 0 <= u && 0 <= v && u + v <= 1.\n\t//\n\t// We integrate u from [0,1-v] and then v from [0,1].\n\t// We also need to use the Jacobian of the transformation:\n\t// D = cross(e1, e2)\n\t//\n\t// Simplification: triangle centroid = (1/3) * (p1 + p2 + p3)\n\t//\n\t// The rest of the derivation is handled by computer algebra.\n\n\tb2Assert(m_count >= 3);\n\n\tb2Vec2 center; center.Set(0.0f, 0.0f);\n\tfloat32 area = 0.0f;\n\tfloat32 I = 0.0f;\n\n\t// s is the reference point for forming triangles.\n\t// It's location doesn't change the result (except for rounding error).\n\tb2Vec2 s(0.0f, 0.0f);\n\n\t// This code would put the reference point inside the polygon.\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\ts += m_vertices[i];\n\t}\n\ts *= 1.0f / m_count;\n\n\tconst float32 k_inv3 = 1.0f / 3.0f;\n\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\t// Triangle vertices.\n\t\tb2Vec2 e1 = m_vertices[i] - s;\n\t\tb2Vec2 e2 = i + 1 < m_count ? m_vertices[i+1] - s : m_vertices[0] - s;\n\n\t\tfloat32 D = b2Cross(e1, e2);\n\n\t\tfloat32 triangleArea = 0.5f * D;\n\t\tarea += triangleArea;\n\n\t\t// Area weighted centroid\n\t\tcenter += triangleArea * k_inv3 * (e1 + e2);\n\n\t\tfloat32 ex1 = e1.x, ey1 = e1.y;\n\t\tfloat32 ex2 = e2.x, ey2 = e2.y;\n\n\t\tfloat32 intx2 = ex1*ex1 + ex2*ex1 + ex2*ex2;\n\t\tfloat32 inty2 = ey1*ey1 + ey2*ey1 + ey2*ey2;\n\n\t\tI += (0.25f * k_inv3 * D) * (intx2 + inty2);\n\t}\n\n\t// Total mass\n\tmassData->mass = density * area;\n\n\t// Center of mass\n\tb2Assert(area > b2_epsilon);\n\tcenter *= 1.0f / area;\n\tmassData->center = center + s;\n\n\t// Inertia tensor relative to the local origin (point s).\n\tmassData->I = density * I;\n\t\n\t// Shift to center of mass then to original body origin.\n\tmassData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center));\n}\n\nbool b2PolygonShape::Validate() const\n{\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tint32 i1 = i;\n\t\tint32 i2 = i < m_count - 1 ? i1 + 1 : 0;\n\t\tb2Vec2 p = m_vertices[i1];\n\t\tb2Vec2 e = m_vertices[i2] - p;\n\n\t\tfor (int32 j = 0; j < m_count; ++j)\n\t\t{\n\t\t\tif (j == i1 || j == i2)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tb2Vec2 v = m_vertices[j] - p;\n\t\t\tfloat32 c = b2Cross(e, v);\n\t\t\tif (c < 0.0f)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2PolygonShape.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_POLYGON_SHAPE_H\n#define B2_POLYGON_SHAPE_H\n\n#include <Box2D/Collision/Shapes/b2Shape.h>\n\n/// A convex polygon. It is assumed that the interior of the polygon is to\n/// the left of each edge.\n/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices.\n/// In most cases you should not need many vertices for a convex polygon.\nclass b2PolygonShape : public b2Shape\n{\npublic:\n\tb2PolygonShape();\n\n\t/// Implement b2Shape.\n\tb2Shape* Clone(b2BlockAllocator* allocator) const;\n\n\t/// @see b2Shape::GetChildCount\n\tint32 GetChildCount() const;\n\n\t/// Create a convex hull from the given array of local points.\n\t/// The count must be in the range [3, b2_maxPolygonVertices].\n\t/// @warning the points may be re-ordered, even if they form a convex polygon\n\t/// @warning collinear points are handled but not removed. Collinear points\n\t/// may lead to poor stacking behavior.\n\tvoid Set(const b2Vec2* points, int32 count);\n\n\t/// Build vertices to represent an axis-aligned box centered on the local origin.\n\t/// @param hx the half-width.\n\t/// @param hy the half-height.\n\tvoid SetAsBox(float32 hx, float32 hy);\n\n\t/// Build vertices to represent an oriented box.\n\t/// @param hx the half-width.\n\t/// @param hy the half-height.\n\t/// @param center the center of the box in local coordinates.\n\t/// @param angle the rotation of the box in local coordinates.\n\tvoid SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle);\n\n\t/// @see b2Shape::TestPoint\n\tbool TestPoint(const b2Transform& transform, const b2Vec2& p) const;\n\n\t/// Implement b2Shape.\n\tbool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\t\tconst b2Transform& transform, int32 childIndex) const;\n\n\t/// @see b2Shape::ComputeAABB\n\tvoid ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;\n\n\t/// @see b2Shape::ComputeMass\n\tvoid ComputeMass(b2MassData* massData, float32 density) const;\n\n\t/// Get the vertex count.\n\tint32 GetVertexCount() const { return m_count; }\n\n\t/// Get a vertex by index.\n\tconst b2Vec2& GetVertex(int32 index) const;\n\n\t/// Validate convexity. This is a very time consuming operation.\n\t/// @returns true if valid\n\tbool Validate() const;\n\n\tb2Vec2 m_centroid;\n\tb2Vec2 m_vertices[b2_maxPolygonVertices];\n\tb2Vec2 m_normals[b2_maxPolygonVertices];\n\tint32 m_count;\n};\n\ninline b2PolygonShape::b2PolygonShape()\n{\n\tm_type = e_polygon;\n\tm_radius = b2_polygonRadius;\n\tm_count = 0;\n\tm_centroid.SetZero();\n}\n\ninline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const\n{\n\tb2Assert(0 <= index && index < m_count);\n\treturn m_vertices[index];\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/Shapes/b2Shape.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_SHAPE_H\n#define B2_SHAPE_H\n\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Common/b2Math.h>\n#include <Box2D/Collision/b2Collision.h>\n\n/// This holds the mass data computed for a shape.\nstruct b2MassData\n{\n\t/// The mass of the shape, usually in kilograms.\n\tfloat32 mass;\n\n\t/// The position of the shape's centroid relative to the shape's origin.\n\tb2Vec2 center;\n\n\t/// The rotational inertia of the shape about the local origin.\n\tfloat32 I;\n};\n\n/// A shape is used for collision detection. You can create a shape however you like.\n/// Shapes used for simulation in b2World are created automatically when a b2Fixture\n/// is created. Shapes may encapsulate a one or more child shapes.\nclass b2Shape\n{\npublic:\n\t\n\tenum Type\n\t{\n\t\te_circle = 0,\n\t\te_edge = 1,\n\t\te_polygon = 2,\n\t\te_chain = 3,\n\t\te_typeCount = 4\n\t};\n\n\tvirtual ~b2Shape() {}\n\n\t/// Clone the concrete shape using the provided allocator.\n\tvirtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0;\n\n\t/// Get the type of this shape. You can use this to down cast to the concrete shape.\n\t/// @return the shape type.\n\tType GetType() const;\n\n\t/// Get the number of child primitives.\n\tvirtual int32 GetChildCount() const = 0;\n\n\t/// Test a point for containment in this shape. This only works for convex shapes.\n\t/// @param xf the shape world transform.\n\t/// @param p a point in world coordinates.\n\tvirtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0;\n\n\t/// Cast a ray against a child shape.\n\t/// @param output the ray-cast results.\n\t/// @param input the ray-cast input parameters.\n\t/// @param transform the transform to be applied to the shape.\n\t/// @param childIndex the child shape index\n\tvirtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,\n\t\t\t\t\t\tconst b2Transform& transform, int32 childIndex) const = 0;\n\n\t/// Given a transform, compute the associated axis aligned bounding box for a child shape.\n\t/// @param aabb returns the axis aligned box.\n\t/// @param xf the world transform of the shape.\n\t/// @param childIndex the child shape\n\tvirtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0;\n\n\t/// Compute the mass properties of this shape using its dimensions and density.\n\t/// The inertia tensor is computed about the local origin.\n\t/// @param massData returns the mass data for this shape.\n\t/// @param density the density in kilograms per meter squared.\n\tvirtual void ComputeMass(b2MassData* massData, float32 density) const = 0;\n\n\tType m_type;\n\tfloat32 m_radius;\n};\n\ninline b2Shape::Type b2Shape::GetType() const\n{\n\treturn m_type;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2BroadPhase.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2BroadPhase.h>\n\nb2BroadPhase::b2BroadPhase()\n{\n\tm_proxyCount = 0;\n\n\tm_pairCapacity = 16;\n\tm_pairCount = 0;\n\tm_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair));\n\n\tm_moveCapacity = 16;\n\tm_moveCount = 0;\n\tm_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32));\n}\n\nb2BroadPhase::~b2BroadPhase()\n{\n\tb2Free(m_moveBuffer);\n\tb2Free(m_pairBuffer);\n}\n\nint32 b2BroadPhase::CreateProxy(const b2AABB& aabb, void* userData)\n{\n\tint32 proxyId = m_tree.CreateProxy(aabb, userData);\n\t++m_proxyCount;\n\tBufferMove(proxyId);\n\treturn proxyId;\n}\n\nvoid b2BroadPhase::DestroyProxy(int32 proxyId)\n{\n\tUnBufferMove(proxyId);\n\t--m_proxyCount;\n\tm_tree.DestroyProxy(proxyId);\n}\n\nvoid b2BroadPhase::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement)\n{\n\tbool buffer = m_tree.MoveProxy(proxyId, aabb, displacement);\n\tif (buffer)\n\t{\n\t\tBufferMove(proxyId);\n\t}\n}\n\nvoid b2BroadPhase::TouchProxy(int32 proxyId)\n{\n\tBufferMove(proxyId);\n}\n\nvoid b2BroadPhase::BufferMove(int32 proxyId)\n{\n\tif (m_moveCount == m_moveCapacity)\n\t{\n\t\tint32* oldBuffer = m_moveBuffer;\n\t\tm_moveCapacity *= 2;\n\t\tm_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32));\n\t\tmemcpy(m_moveBuffer, oldBuffer, m_moveCount * sizeof(int32));\n\t\tb2Free(oldBuffer);\n\t}\n\n\tm_moveBuffer[m_moveCount] = proxyId;\n\t++m_moveCount;\n}\n\nvoid b2BroadPhase::UnBufferMove(int32 proxyId)\n{\n\tfor (int32 i = 0; i < m_moveCount; ++i)\n\t{\n\t\tif (m_moveBuffer[i] == proxyId)\n\t\t{\n\t\t\tm_moveBuffer[i] = e_nullProxy;\n\t\t}\n\t}\n}\n\n// This is called from b2DynamicTree::Query when we are gathering pairs.\nbool b2BroadPhase::QueryCallback(int32 proxyId)\n{\n\t// A proxy cannot form a pair with itself.\n\tif (proxyId == m_queryProxyId)\n\t{\n\t\treturn true;\n\t}\n\n\t// Grow the pair buffer as needed.\n\tif (m_pairCount == m_pairCapacity)\n\t{\n\t\tb2Pair* oldBuffer = m_pairBuffer;\n\t\tm_pairCapacity *= 2;\n\t\tm_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair));\n\t\tmemcpy(m_pairBuffer, oldBuffer, m_pairCount * sizeof(b2Pair));\n\t\tb2Free(oldBuffer);\n\t}\n\n\tm_pairBuffer[m_pairCount].proxyIdA = b2Min(proxyId, m_queryProxyId);\n\tm_pairBuffer[m_pairCount].proxyIdB = b2Max(proxyId, m_queryProxyId);\n\t++m_pairCount;\n\n\treturn true;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2BroadPhase.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_BROAD_PHASE_H\n#define B2_BROAD_PHASE_H\n\n#include <Box2D/Common/b2Settings.h>\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/b2DynamicTree.h>\n#include <algorithm>\n\nstruct b2Pair\n{\n\tint32 proxyIdA;\n\tint32 proxyIdB;\n};\n\n/// The broad-phase is used for computing pairs and performing volume queries and ray casts.\n/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs.\n/// It is up to the client to consume the new pairs and to track subsequent overlap.\nclass b2BroadPhase\n{\npublic:\n\n\tenum\n\t{\n\t\te_nullProxy = -1\n\t};\n\n\tb2BroadPhase();\n\t~b2BroadPhase();\n\n\t/// Create a proxy with an initial AABB. Pairs are not reported until\n\t/// UpdatePairs is called.\n\tint32 CreateProxy(const b2AABB& aabb, void* userData);\n\n\t/// Destroy a proxy. It is up to the client to remove any pairs.\n\tvoid DestroyProxy(int32 proxyId);\n\n\t/// Call MoveProxy as many times as you like, then when you are done\n\t/// call UpdatePairs to finalized the proxy pairs (for your time step).\n\tvoid MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement);\n\n\t/// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs.\n\tvoid TouchProxy(int32 proxyId);\n\n\t/// Get the fat AABB for a proxy.\n\tconst b2AABB& GetFatAABB(int32 proxyId) const;\n\n\t/// Get user data from a proxy. Returns NULL if the id is invalid.\n\tvoid* GetUserData(int32 proxyId) const;\n\n\t/// Test overlap of fat AABBs.\n\tbool TestOverlap(int32 proxyIdA, int32 proxyIdB) const;\n\n\t/// Get the number of proxies.\n\tint32 GetProxyCount() const;\n\n\t/// Update the pairs. This results in pair callbacks. This can only add pairs.\n\ttemplate <typename T>\n\tvoid UpdatePairs(T* callback);\n\n\t/// Query an AABB for overlapping proxies. The callback class\n\t/// is called for each proxy that overlaps the supplied AABB.\n\ttemplate <typename T>\n\tvoid Query(T* callback, const b2AABB& aabb) const;\n\n\t/// Ray-cast against the proxies in the tree. This relies on the callback\n\t/// to perform a exact ray-cast in the case were the proxy contains a shape.\n\t/// The callback also performs the any collision filtering. This has performance\n\t/// roughly equal to k * log(n), where k is the number of collisions and n is the\n\t/// number of proxies in the tree.\n\t/// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).\n\t/// @param callback a callback class that is called for each proxy that is hit by the ray.\n\ttemplate <typename T>\n\tvoid RayCast(T* callback, const b2RayCastInput& input) const;\n\n\t/// Get the height of the embedded tree.\n\tint32 GetTreeHeight() const;\n\n\t/// Get the balance of the embedded tree.\n\tint32 GetTreeBalance() const;\n\n\t/// Get the quality metric of the embedded tree.\n\tfloat32 GetTreeQuality() const;\n\n\t/// Shift the world origin. Useful for large worlds.\n\t/// The shift formula is: position -= newOrigin\n\t/// @param newOrigin the new origin with respect to the old origin\n\tvoid ShiftOrigin(const b2Vec2& newOrigin);\n\nprivate:\n\n\tfriend class b2DynamicTree;\n\n\tvoid BufferMove(int32 proxyId);\n\tvoid UnBufferMove(int32 proxyId);\n\n\tbool QueryCallback(int32 proxyId);\n\n\tb2DynamicTree m_tree;\n\n\tint32 m_proxyCount;\n\n\tint32* m_moveBuffer;\n\tint32 m_moveCapacity;\n\tint32 m_moveCount;\n\n\tb2Pair* m_pairBuffer;\n\tint32 m_pairCapacity;\n\tint32 m_pairCount;\n\n\tint32 m_queryProxyId;\n};\n\n/// This is used to sort pairs.\ninline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2)\n{\n\tif (pair1.proxyIdA < pair2.proxyIdA)\n\t{\n\t\treturn true;\n\t}\n\n\tif (pair1.proxyIdA == pair2.proxyIdA)\n\t{\n\t\treturn pair1.proxyIdB < pair2.proxyIdB;\n\t}\n\n\treturn false;\n}\n\ninline void* b2BroadPhase::GetUserData(int32 proxyId) const\n{\n\treturn m_tree.GetUserData(proxyId);\n}\n\ninline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const\n{\n\tconst b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA);\n\tconst b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB);\n\treturn b2TestOverlap(aabbA, aabbB);\n}\n\ninline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const\n{\n\treturn m_tree.GetFatAABB(proxyId);\n}\n\ninline int32 b2BroadPhase::GetProxyCount() const\n{\n\treturn m_proxyCount;\n}\n\ninline int32 b2BroadPhase::GetTreeHeight() const\n{\n\treturn m_tree.GetHeight();\n}\n\ninline int32 b2BroadPhase::GetTreeBalance() const\n{\n\treturn m_tree.GetMaxBalance();\n}\n\ninline float32 b2BroadPhase::GetTreeQuality() const\n{\n\treturn m_tree.GetAreaRatio();\n}\n\ntemplate <typename T>\nvoid b2BroadPhase::UpdatePairs(T* callback)\n{\n\t// Reset pair buffer\n\tm_pairCount = 0;\n\n\t// Perform tree queries for all moving proxies.\n\tfor (int32 i = 0; i < m_moveCount; ++i)\n\t{\n\t\tm_queryProxyId = m_moveBuffer[i];\n\t\tif (m_queryProxyId == e_nullProxy)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// We have to query the tree with the fat AABB so that\n\t\t// we don't fail to create a pair that may touch later.\n\t\tconst b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId);\n\n\t\t// Query tree, create pairs and add them pair buffer.\n\t\tm_tree.Query(this, fatAABB);\n\t}\n\n\t// Reset move buffer\n\tm_moveCount = 0;\n\n\t// Sort the pair buffer to expose duplicates.\n\tstd::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan);\n\n\t// Send the pairs back to the client.\n\tint32 i = 0;\n\twhile (i < m_pairCount)\n\t{\n\t\tb2Pair* primaryPair = m_pairBuffer + i;\n\t\tvoid* userDataA = m_tree.GetUserData(primaryPair->proxyIdA);\n\t\tvoid* userDataB = m_tree.GetUserData(primaryPair->proxyIdB);\n\n\t\tcallback->AddPair(userDataA, userDataB);\n\t\t++i;\n\n\t\t// Skip any duplicate pairs.\n\t\twhile (i < m_pairCount)\n\t\t{\n\t\t\tb2Pair* pair = m_pairBuffer + i;\n\t\t\tif (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t++i;\n\t\t}\n\t}\n\n\t// Try to keep the tree balanced.\n\t//m_tree.Rebalance(4);\n}\n\ntemplate <typename T>\ninline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const\n{\n\tm_tree.Query(callback, aabb);\n}\n\ntemplate <typename T>\ninline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const\n{\n\tm_tree.RayCast(callback, input);\n}\n\ninline void b2BroadPhase::ShiftOrigin(const b2Vec2& newOrigin)\n{\n\tm_tree.ShiftOrigin(newOrigin);\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2CollideCircle.cpp",
    "content": "/*\n* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n\nvoid b2CollideCircles(\n\tb2Manifold* manifold,\n\tconst b2CircleShape* circleA, const b2Transform& xfA,\n\tconst b2CircleShape* circleB, const b2Transform& xfB)\n{\n\tmanifold->pointCount = 0;\n\n\tb2Vec2 pA = b2Mul(xfA, circleA->m_p);\n\tb2Vec2 pB = b2Mul(xfB, circleB->m_p);\n\n\tb2Vec2 d = pB - pA;\n\tfloat32 distSqr = b2Dot(d, d);\n\tfloat32 rA = circleA->m_radius, rB = circleB->m_radius;\n\tfloat32 radius = rA + rB;\n\tif (distSqr > radius * radius)\n\t{\n\t\treturn;\n\t}\n\n\tmanifold->type = b2Manifold::e_circles;\n\tmanifold->localPoint = circleA->m_p;\n\tmanifold->localNormal.SetZero();\n\tmanifold->pointCount = 1;\n\n\tmanifold->points[0].localPoint = circleB->m_p;\n\tmanifold->points[0].id.key = 0;\n}\n\nvoid b2CollidePolygonAndCircle(\n\tb2Manifold* manifold,\n\tconst b2PolygonShape* polygonA, const b2Transform& xfA,\n\tconst b2CircleShape* circleB, const b2Transform& xfB)\n{\n\tmanifold->pointCount = 0;\n\n\t// Compute circle position in the frame of the polygon.\n\tb2Vec2 c = b2Mul(xfB, circleB->m_p);\n\tb2Vec2 cLocal = b2MulT(xfA, c);\n\n\t// Find the min separating edge.\n\tint32 normalIndex = 0;\n\tfloat32 separation = -b2_maxFloat;\n\tfloat32 radius = polygonA->m_radius + circleB->m_radius;\n\tint32 vertexCount = polygonA->m_count;\n\tconst b2Vec2* vertices = polygonA->m_vertices;\n\tconst b2Vec2* normals = polygonA->m_normals;\n\n\tfor (int32 i = 0; i < vertexCount; ++i)\n\t{\n\t\tfloat32 s = b2Dot(normals[i], cLocal - vertices[i]);\n\n\t\tif (s > radius)\n\t\t{\n\t\t\t// Early out.\n\t\t\treturn;\n\t\t}\n\n\t\tif (s > separation)\n\t\t{\n\t\t\tseparation = s;\n\t\t\tnormalIndex = i;\n\t\t}\n\t}\n\n\t// Vertices that subtend the incident face.\n\tint32 vertIndex1 = normalIndex;\n\tint32 vertIndex2 = vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0;\n\tb2Vec2 v1 = vertices[vertIndex1];\n\tb2Vec2 v2 = vertices[vertIndex2];\n\n\t// If the center is inside the polygon ...\n\tif (separation < b2_epsilon)\n\t{\n\t\tmanifold->pointCount = 1;\n\t\tmanifold->type = b2Manifold::e_faceA;\n\t\tmanifold->localNormal = normals[normalIndex];\n\t\tmanifold->localPoint = 0.5f * (v1 + v2);\n\t\tmanifold->points[0].localPoint = circleB->m_p;\n\t\tmanifold->points[0].id.key = 0;\n\t\treturn;\n\t}\n\n\t// Compute barycentric coordinates\n\tfloat32 u1 = b2Dot(cLocal - v1, v2 - v1);\n\tfloat32 u2 = b2Dot(cLocal - v2, v1 - v2);\n\tif (u1 <= 0.0f)\n\t{\n\t\tif (b2DistanceSquared(cLocal, v1) > radius * radius)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tmanifold->pointCount = 1;\n\t\tmanifold->type = b2Manifold::e_faceA;\n\t\tmanifold->localNormal = cLocal - v1;\n\t\tmanifold->localNormal.Normalize();\n\t\tmanifold->localPoint = v1;\n\t\tmanifold->points[0].localPoint = circleB->m_p;\n\t\tmanifold->points[0].id.key = 0;\n\t}\n\telse if (u2 <= 0.0f)\n\t{\n\t\tif (b2DistanceSquared(cLocal, v2) > radius * radius)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tmanifold->pointCount = 1;\n\t\tmanifold->type = b2Manifold::e_faceA;\n\t\tmanifold->localNormal = cLocal - v2;\n\t\tmanifold->localNormal.Normalize();\n\t\tmanifold->localPoint = v2;\n\t\tmanifold->points[0].localPoint = circleB->m_p;\n\t\tmanifold->points[0].id.key = 0;\n\t}\n\telse\n\t{\n\t\tb2Vec2 faceCenter = 0.5f * (v1 + v2);\n\t\tfloat32 separation = b2Dot(cLocal - faceCenter, normals[vertIndex1]);\n\t\tif (separation > radius)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tmanifold->pointCount = 1;\n\t\tmanifold->type = b2Manifold::e_faceA;\n\t\tmanifold->localNormal = normals[vertIndex1];\n\t\tmanifold->localPoint = faceCenter;\n\t\tmanifold->points[0].localPoint = circleB->m_p;\n\t\tmanifold->points[0].id.key = 0;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2CollideEdge.cpp",
    "content": "/*\n * Copyright (c) 2007-2009 Erin Catto http://www.box2d.org\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n * 1. The origin of this software must not be misrepresented; you must not\n * claim that you wrote the original software. If you use this software\n * in a product, an acknowledgment in the product documentation would be\n * appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n * misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n\n\n// Compute contact points for edge versus circle.\n// This accounts for edge connectivity.\nvoid b2CollideEdgeAndCircle(b2Manifold* manifold,\n\t\t\t\t\t\t\tconst b2EdgeShape* edgeA, const b2Transform& xfA,\n\t\t\t\t\t\t\tconst b2CircleShape* circleB, const b2Transform& xfB)\n{\n\tmanifold->pointCount = 0;\n\t\n\t// Compute circle in frame of edge\n\tb2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p));\n\t\n\tb2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2;\n\tb2Vec2 e = B - A;\n\t\n\t// Barycentric coordinates\n\tfloat32 u = b2Dot(e, B - Q);\n\tfloat32 v = b2Dot(e, Q - A);\n\t\n\tfloat32 radius = edgeA->m_radius + circleB->m_radius;\n\t\n\tb2ContactFeature cf;\n\tcf.indexB = 0;\n\tcf.typeB = b2ContactFeature::e_vertex;\n\t\n\t// Region A\n\tif (v <= 0.0f)\n\t{\n\t\tb2Vec2 P = A;\n\t\tb2Vec2 d = Q - P;\n\t\tfloat32 dd = b2Dot(d, d);\n\t\tif (dd > radius * radius)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Is there an edge connected to A?\n\t\tif (edgeA->m_hasVertex0)\n\t\t{\n\t\t\tb2Vec2 A1 = edgeA->m_vertex0;\n\t\t\tb2Vec2 B1 = A;\n\t\t\tb2Vec2 e1 = B1 - A1;\n\t\t\tfloat32 u1 = b2Dot(e1, B1 - Q);\n\t\t\t\n\t\t\t// Is the circle in Region AB of the previous edge?\n\t\t\tif (u1 > 0.0f)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcf.indexA = 0;\n\t\tcf.typeA = b2ContactFeature::e_vertex;\n\t\tmanifold->pointCount = 1;\n\t\tmanifold->type = b2Manifold::e_circles;\n\t\tmanifold->localNormal.SetZero();\n\t\tmanifold->localPoint = P;\n\t\tmanifold->points[0].id.key = 0;\n\t\tmanifold->points[0].id.cf = cf;\n\t\tmanifold->points[0].localPoint = circleB->m_p;\n\t\treturn;\n\t}\n\t\n\t// Region B\n\tif (u <= 0.0f)\n\t{\n\t\tb2Vec2 P = B;\n\t\tb2Vec2 d = Q - P;\n\t\tfloat32 dd = b2Dot(d, d);\n\t\tif (dd > radius * radius)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Is there an edge connected to B?\n\t\tif (edgeA->m_hasVertex3)\n\t\t{\n\t\t\tb2Vec2 B2 = edgeA->m_vertex3;\n\t\t\tb2Vec2 A2 = B;\n\t\t\tb2Vec2 e2 = B2 - A2;\n\t\t\tfloat32 v2 = b2Dot(e2, Q - A2);\n\t\t\t\n\t\t\t// Is the circle in Region AB of the next edge?\n\t\t\tif (v2 > 0.0f)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tcf.indexA = 1;\n\t\tcf.typeA = b2ContactFeature::e_vertex;\n\t\tmanifold->pointCount = 1;\n\t\tmanifold->type = b2Manifold::e_circles;\n\t\tmanifold->localNormal.SetZero();\n\t\tmanifold->localPoint = P;\n\t\tmanifold->points[0].id.key = 0;\n\t\tmanifold->points[0].id.cf = cf;\n\t\tmanifold->points[0].localPoint = circleB->m_p;\n\t\treturn;\n\t}\n\t\n\t// Region AB\n\tfloat32 den = b2Dot(e, e);\n\tb2Assert(den > 0.0f);\n\tb2Vec2 P = (1.0f / den) * (u * A + v * B);\n\tb2Vec2 d = Q - P;\n\tfloat32 dd = b2Dot(d, d);\n\tif (dd > radius * radius)\n\t{\n\t\treturn;\n\t}\n\t\n\tb2Vec2 n(-e.y, e.x);\n\tif (b2Dot(n, Q - A) < 0.0f)\n\t{\n\t\tn.Set(-n.x, -n.y);\n\t}\n\tn.Normalize();\n\t\n\tcf.indexA = 0;\n\tcf.typeA = b2ContactFeature::e_face;\n\tmanifold->pointCount = 1;\n\tmanifold->type = b2Manifold::e_faceA;\n\tmanifold->localNormal = n;\n\tmanifold->localPoint = A;\n\tmanifold->points[0].id.key = 0;\n\tmanifold->points[0].id.cf = cf;\n\tmanifold->points[0].localPoint = circleB->m_p;\n}\n\n// This structure is used to keep track of the best separating axis.\nstruct b2EPAxis\n{\n\tenum Type\n\t{\n\t\te_unknown,\n\t\te_edgeA,\n\t\te_edgeB\n\t};\n\t\n\tType type;\n\tint32 index;\n\tfloat32 separation;\n};\n\n// This holds polygon B expressed in frame A.\nstruct b2TempPolygon\n{\n\tb2Vec2 vertices[b2_maxPolygonVertices];\n\tb2Vec2 normals[b2_maxPolygonVertices];\n\tint32 count;\n};\n\n// Reference face used for clipping\nstruct b2ReferenceFace\n{\n\tint32 i1, i2;\n\t\n\tb2Vec2 v1, v2;\n\t\n\tb2Vec2 normal;\n\t\n\tb2Vec2 sideNormal1;\n\tfloat32 sideOffset1;\n\t\n\tb2Vec2 sideNormal2;\n\tfloat32 sideOffset2;\n};\n\n// This class collides and edge and a polygon, taking into account edge adjacency.\nstruct b2EPCollider\n{\n\tvoid Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA,\n\t\t\t\t const b2PolygonShape* polygonB, const b2Transform& xfB);\n\tb2EPAxis ComputeEdgeSeparation();\n\tb2EPAxis ComputePolygonSeparation();\n\t\n\tenum VertexType\n\t{\n\t\te_isolated,\n\t\te_concave,\n\t\te_convex\n\t};\n\t\n\tb2TempPolygon m_polygonB;\n\t\n\tb2Transform m_xf;\n\tb2Vec2 m_centroidB;\n\tb2Vec2 m_v0, m_v1, m_v2, m_v3;\n\tb2Vec2 m_normal0, m_normal1, m_normal2;\n\tb2Vec2 m_normal;\n\tVertexType m_type1, m_type2;\n\tb2Vec2 m_lowerLimit, m_upperLimit;\n\tfloat32 m_radius;\n\tbool m_front;\n};\n\n// Algorithm:\n// 1. Classify v1 and v2\n// 2. Classify polygon centroid as front or back\n// 3. Flip normal if necessary\n// 4. Initialize normal range to [-pi, pi] about face normal\n// 5. Adjust normal range according to adjacent edges\n// 6. Visit each separating axes, only accept axes within the range\n// 7. Return if _any_ axis indicates separation\n// 8. Clip\nvoid b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const b2Transform& xfA,\n\t\t\t\t\t\t   const b2PolygonShape* polygonB, const b2Transform& xfB)\n{\n\tm_xf = b2MulT(xfA, xfB);\n\t\n\tm_centroidB = b2Mul(m_xf, polygonB->m_centroid);\n\t\n\tm_v0 = edgeA->m_vertex0;\n\tm_v1 = edgeA->m_vertex1;\n\tm_v2 = edgeA->m_vertex2;\n\tm_v3 = edgeA->m_vertex3;\n\t\n\tbool hasVertex0 = edgeA->m_hasVertex0;\n\tbool hasVertex3 = edgeA->m_hasVertex3;\n\t\n\tb2Vec2 edge1 = m_v2 - m_v1;\n\tedge1.Normalize();\n\tm_normal1.Set(edge1.y, -edge1.x);\n\tfloat32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1);\n\tfloat32 offset0 = 0.0f, offset2 = 0.0f;\n\tbool convex1 = false, convex2 = false;\n\t\n\t// Is there a preceding edge?\n\tif (hasVertex0)\n\t{\n\t\tb2Vec2 edge0 = m_v1 - m_v0;\n\t\tedge0.Normalize();\n\t\tm_normal0.Set(edge0.y, -edge0.x);\n\t\tconvex1 = b2Cross(edge0, edge1) >= 0.0f;\n\t\toffset0 = b2Dot(m_normal0, m_centroidB - m_v0);\n\t}\n\t\n\t// Is there a following edge?\n\tif (hasVertex3)\n\t{\n\t\tb2Vec2 edge2 = m_v3 - m_v2;\n\t\tedge2.Normalize();\n\t\tm_normal2.Set(edge2.y, -edge2.x);\n\t\tconvex2 = b2Cross(edge1, edge2) > 0.0f;\n\t\toffset2 = b2Dot(m_normal2, m_centroidB - m_v2);\n\t}\n\t\n\t// Determine front or back collision. Determine collision normal limits.\n\tif (hasVertex0 && hasVertex3)\n\t{\n\t\tif (convex1 && convex2)\n\t\t{\n\t\t\tm_front = offset0 >= 0.0f || offset1 >= 0.0f || offset2 >= 0.0f;\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = m_normal0;\n\t\t\t\tm_upperLimit = m_normal2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal1;\n\t\t\t\tm_upperLimit = -m_normal1;\n\t\t\t}\n\t\t}\n\t\telse if (convex1)\n\t\t{\n\t\t\tm_front = offset0 >= 0.0f || (offset1 >= 0.0f && offset2 >= 0.0f);\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = m_normal0;\n\t\t\t\tm_upperLimit = m_normal1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal2;\n\t\t\t\tm_upperLimit = -m_normal1;\n\t\t\t}\n\t\t}\n\t\telse if (convex2)\n\t\t{\n\t\t\tm_front = offset2 >= 0.0f || (offset0 >= 0.0f && offset1 >= 0.0f);\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = m_normal1;\n\t\t\t\tm_upperLimit = m_normal2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal1;\n\t\t\t\tm_upperLimit = -m_normal0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_front = offset0 >= 0.0f && offset1 >= 0.0f && offset2 >= 0.0f;\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = m_normal1;\n\t\t\t\tm_upperLimit = m_normal1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal2;\n\t\t\t\tm_upperLimit = -m_normal0;\n\t\t\t}\n\t\t}\n\t}\n\telse if (hasVertex0)\n\t{\n\t\tif (convex1)\n\t\t{\n\t\t\tm_front = offset0 >= 0.0f || offset1 >= 0.0f;\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = m_normal0;\n\t\t\t\tm_upperLimit = -m_normal1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = m_normal1;\n\t\t\t\tm_upperLimit = -m_normal1;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_front = offset0 >= 0.0f && offset1 >= 0.0f;\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = m_normal1;\n\t\t\t\tm_upperLimit = -m_normal1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = m_normal1;\n\t\t\t\tm_upperLimit = -m_normal0;\n\t\t\t}\n\t\t}\n\t}\n\telse if (hasVertex3)\n\t{\n\t\tif (convex2)\n\t\t{\n\t\t\tm_front = offset1 >= 0.0f || offset2 >= 0.0f;\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal1;\n\t\t\t\tm_upperLimit = m_normal2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal1;\n\t\t\t\tm_upperLimit = m_normal1;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_front = offset1 >= 0.0f && offset2 >= 0.0f;\n\t\t\tif (m_front)\n\t\t\t{\n\t\t\t\tm_normal = m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal1;\n\t\t\t\tm_upperLimit = m_normal1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_normal = -m_normal1;\n\t\t\t\tm_lowerLimit = -m_normal2;\n\t\t\t\tm_upperLimit = m_normal1;\n\t\t\t}\n\t\t}\t\t\n\t}\n\telse\n\t{\n\t\tm_front = offset1 >= 0.0f;\n\t\tif (m_front)\n\t\t{\n\t\t\tm_normal = m_normal1;\n\t\t\tm_lowerLimit = -m_normal1;\n\t\t\tm_upperLimit = -m_normal1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_normal = -m_normal1;\n\t\t\tm_lowerLimit = m_normal1;\n\t\t\tm_upperLimit = m_normal1;\n\t\t}\n\t}\n\t\n\t// Get polygonB in frameA\n\tm_polygonB.count = polygonB->m_count;\n\tfor (int32 i = 0; i < polygonB->m_count; ++i)\n\t{\n\t\tm_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]);\n\t\tm_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]);\n\t}\n\t\n\tm_radius = 2.0f * b2_polygonRadius;\n\t\n\tmanifold->pointCount = 0;\n\t\n\tb2EPAxis edgeAxis = ComputeEdgeSeparation();\n\t\n\t// If no valid normal can be found than this edge should not collide.\n\tif (edgeAxis.type == b2EPAxis::e_unknown)\n\t{\n\t\treturn;\n\t}\n\t\n\tif (edgeAxis.separation > m_radius)\n\t{\n\t\treturn;\n\t}\n\t\n\tb2EPAxis polygonAxis = ComputePolygonSeparation();\n\tif (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius)\n\t{\n\t\treturn;\n\t}\n\t\n\t// Use hysteresis for jitter reduction.\n\tconst float32 k_relativeTol = 0.98f;\n\tconst float32 k_absoluteTol = 0.001f;\n\t\n\tb2EPAxis primaryAxis;\n\tif (polygonAxis.type == b2EPAxis::e_unknown)\n\t{\n\t\tprimaryAxis = edgeAxis;\n\t}\n\telse if (polygonAxis.separation > k_relativeTol * edgeAxis.separation + k_absoluteTol)\n\t{\n\t\tprimaryAxis = polygonAxis;\n\t}\n\telse\n\t{\n\t\tprimaryAxis = edgeAxis;\n\t}\n\t\n\tb2ClipVertex ie[2];\n\tb2ReferenceFace rf;\n\tif (primaryAxis.type == b2EPAxis::e_edgeA)\n\t{\n\t\tmanifold->type = b2Manifold::e_faceA;\n\t\t\n\t\t// Search for the polygon normal that is most anti-parallel to the edge normal.\n\t\tint32 bestIndex = 0;\n\t\tfloat32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]);\n\t\tfor (int32 i = 1; i < m_polygonB.count; ++i)\n\t\t{\n\t\t\tfloat32 value = b2Dot(m_normal, m_polygonB.normals[i]);\n\t\t\tif (value < bestValue)\n\t\t\t{\n\t\t\t\tbestValue = value;\n\t\t\t\tbestIndex = i;\n\t\t\t}\n\t\t}\n\t\t\n\t\tint32 i1 = bestIndex;\n\t\tint32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0;\n\t\t\n\t\tie[0].v = m_polygonB.vertices[i1];\n\t\tie[0].id.cf.indexA = 0;\n\t\tie[0].id.cf.indexB = static_cast<uint8>(i1);\n\t\tie[0].id.cf.typeA = b2ContactFeature::e_face;\n\t\tie[0].id.cf.typeB = b2ContactFeature::e_vertex;\n\t\t\n\t\tie[1].v = m_polygonB.vertices[i2];\n\t\tie[1].id.cf.indexA = 0;\n\t\tie[1].id.cf.indexB = static_cast<uint8>(i2);\n\t\tie[1].id.cf.typeA = b2ContactFeature::e_face;\n\t\tie[1].id.cf.typeB = b2ContactFeature::e_vertex;\n\t\t\n\t\tif (m_front)\n\t\t{\n\t\t\trf.i1 = 0;\n\t\t\trf.i2 = 1;\n\t\t\trf.v1 = m_v1;\n\t\t\trf.v2 = m_v2;\n\t\t\trf.normal = m_normal1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trf.i1 = 1;\n\t\t\trf.i2 = 0;\n\t\t\trf.v1 = m_v2;\n\t\t\trf.v2 = m_v1;\n\t\t\trf.normal = -m_normal1;\n\t\t}\t\t\n\t}\n\telse\n\t{\n\t\tmanifold->type = b2Manifold::e_faceB;\n\t\t\n\t\tie[0].v = m_v1;\n\t\tie[0].id.cf.indexA = 0;\n\t\tie[0].id.cf.indexB = static_cast<uint8>(primaryAxis.index);\n\t\tie[0].id.cf.typeA = b2ContactFeature::e_vertex;\n\t\tie[0].id.cf.typeB = b2ContactFeature::e_face;\n\t\t\n\t\tie[1].v = m_v2;\n\t\tie[1].id.cf.indexA = 0;\n\t\tie[1].id.cf.indexB = static_cast<uint8>(primaryAxis.index);\t\t\n\t\tie[1].id.cf.typeA = b2ContactFeature::e_vertex;\n\t\tie[1].id.cf.typeB = b2ContactFeature::e_face;\n\t\t\n\t\trf.i1 = primaryAxis.index;\n\t\trf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0;\n\t\trf.v1 = m_polygonB.vertices[rf.i1];\n\t\trf.v2 = m_polygonB.vertices[rf.i2];\n\t\trf.normal = m_polygonB.normals[rf.i1];\n\t}\n\t\n\trf.sideNormal1.Set(rf.normal.y, -rf.normal.x);\n\trf.sideNormal2 = -rf.sideNormal1;\n\trf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1);\n\trf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2);\n\t\n\t// Clip incident edge against extruded edge1 side edges.\n\tb2ClipVertex clipPoints1[2];\n\tb2ClipVertex clipPoints2[2];\n\tint32 np;\n\t\n\t// Clip to box side 1\n\tnp = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1);\n\t\n\tif (np < b2_maxManifoldPoints)\n\t{\n\t\treturn;\n\t}\n\t\n\t// Clip to negative box side 1\n\tnp = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2);\n\t\n\tif (np < b2_maxManifoldPoints)\n\t{\n\t\treturn;\n\t}\n\t\n\t// Now clipPoints2 contains the clipped points.\n\tif (primaryAxis.type == b2EPAxis::e_edgeA)\n\t{\n\t\tmanifold->localNormal = rf.normal;\n\t\tmanifold->localPoint = rf.v1;\n\t}\n\telse\n\t{\n\t\tmanifold->localNormal = polygonB->m_normals[rf.i1];\n\t\tmanifold->localPoint = polygonB->m_vertices[rf.i1];\n\t}\n\t\n\tint32 pointCount = 0;\n\tfor (int32 i = 0; i < b2_maxManifoldPoints; ++i)\n\t{\n\t\tfloat32 separation;\n\t\t\n\t\tseparation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1);\n\t\t\n\t\tif (separation <= m_radius)\n\t\t{\n\t\t\tb2ManifoldPoint* cp = manifold->points + pointCount;\n\t\t\t\n\t\t\tif (primaryAxis.type == b2EPAxis::e_edgeA)\n\t\t\t{\n\t\t\t\tcp->localPoint = b2MulT(m_xf, clipPoints2[i].v);\n\t\t\t\tcp->id = clipPoints2[i].id;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcp->localPoint = clipPoints2[i].v;\n\t\t\t\tcp->id.cf.typeA = clipPoints2[i].id.cf.typeB;\n\t\t\t\tcp->id.cf.typeB = clipPoints2[i].id.cf.typeA;\n\t\t\t\tcp->id.cf.indexA = clipPoints2[i].id.cf.indexB;\n\t\t\t\tcp->id.cf.indexB = clipPoints2[i].id.cf.indexA;\n\t\t\t}\n\t\t\t\n\t\t\t++pointCount;\n\t\t}\n\t}\n\t\n\tmanifold->pointCount = pointCount;\n}\n\nb2EPAxis b2EPCollider::ComputeEdgeSeparation()\n{\n\tb2EPAxis axis;\n\taxis.type = b2EPAxis::e_edgeA;\n\taxis.index = m_front ? 0 : 1;\n\taxis.separation = FLT_MAX;\n\t\n\tfor (int32 i = 0; i < m_polygonB.count; ++i)\n\t{\n\t\tfloat32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1);\n\t\tif (s < axis.separation)\n\t\t{\n\t\t\taxis.separation = s;\n\t\t}\n\t}\n\t\n\treturn axis;\n}\n\nb2EPAxis b2EPCollider::ComputePolygonSeparation()\n{\n\tb2EPAxis axis;\n\taxis.type = b2EPAxis::e_unknown;\n\taxis.index = -1;\n\taxis.separation = -FLT_MAX;\n\n\tb2Vec2 perp(-m_normal.y, m_normal.x);\n\n\tfor (int32 i = 0; i < m_polygonB.count; ++i)\n\t{\n\t\tb2Vec2 n = -m_polygonB.normals[i];\n\t\t\n\t\tfloat32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1);\n\t\tfloat32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2);\n\t\tfloat32 s = b2Min(s1, s2);\n\t\t\n\t\tif (s > m_radius)\n\t\t{\n\t\t\t// No collision\n\t\t\taxis.type = b2EPAxis::e_edgeB;\n\t\t\taxis.index = i;\n\t\t\taxis.separation = s;\n\t\t\treturn axis;\n\t\t}\n\t\t\n\t\t// Adjacency\n\t\tif (b2Dot(n, perp) >= 0.0f)\n\t\t{\n\t\t\tif (b2Dot(n - m_upperLimit, m_normal) < -b2_angularSlop)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (b2Dot(n - m_lowerLimit, m_normal) < -b2_angularSlop)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (s > axis.separation)\n\t\t{\n\t\t\taxis.type = b2EPAxis::e_edgeB;\n\t\t\taxis.index = i;\n\t\t\taxis.separation = s;\n\t\t}\n\t}\n\t\n\treturn axis;\n}\n\nvoid b2CollideEdgeAndPolygon(\tb2Manifold* manifold,\n\t\t\t\t\t\t\t const b2EdgeShape* edgeA, const b2Transform& xfA,\n\t\t\t\t\t\t\t const b2PolygonShape* polygonB, const b2Transform& xfB)\n{\n\tb2EPCollider collider;\n\tcollider.Collide(manifold, edgeA, xfA, polygonB, xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2CollidePolygon.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n\n// Find the max separation between poly1 and poly2 using edge normals from poly1.\nstatic float32 b2FindMaxSeparation(int32* edgeIndex,\n\t\t\t\t\t\t\t\t const b2PolygonShape* poly1, const b2Transform& xf1,\n\t\t\t\t\t\t\t\t const b2PolygonShape* poly2, const b2Transform& xf2)\n{\n\tint32 count1 = poly1->m_count;\n\tint32 count2 = poly2->m_count;\n\tconst b2Vec2* n1s = poly1->m_normals;\n\tconst b2Vec2* v1s = poly1->m_vertices;\n\tconst b2Vec2* v2s = poly2->m_vertices;\n\tb2Transform xf = b2MulT(xf2, xf1);\n\n\tint32 bestIndex = 0;\n\tfloat32 maxSeparation = -b2_maxFloat;\n\tfor (int32 i = 0; i < count1; ++i)\n\t{\n\t\t// Get poly1 normal in frame2.\n\t\tb2Vec2 n = b2Mul(xf.q, n1s[i]);\n\t\tb2Vec2 v1 = b2Mul(xf, v1s[i]);\n\n\t\t// Find deepest point for normal i.\n\t\tfloat32 si = b2_maxFloat;\n\t\tfor (int32 j = 0; j < count2; ++j)\n\t\t{\n\t\t\tfloat32 sij = b2Dot(n, v2s[j] - v1);\n\t\t\tif (sij < si)\n\t\t\t{\n\t\t\t\tsi = sij;\n\t\t\t}\n\t\t}\n\n\t\tif (si > maxSeparation)\n\t\t{\n\t\t\tmaxSeparation = si;\n\t\t\tbestIndex = i;\n\t\t}\n\t}\n\n\t*edgeIndex = bestIndex;\n\treturn maxSeparation;\n}\n\nstatic void b2FindIncidentEdge(b2ClipVertex c[2],\n\t\t\t\t\t\t\t const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1,\n\t\t\t\t\t\t\t const b2PolygonShape* poly2, const b2Transform& xf2)\n{\n\tconst b2Vec2* normals1 = poly1->m_normals;\n\n\tint32 count2 = poly2->m_count;\n\tconst b2Vec2* vertices2 = poly2->m_vertices;\n\tconst b2Vec2* normals2 = poly2->m_normals;\n\n\tb2Assert(0 <= edge1 && edge1 < poly1->m_count);\n\n\t// Get the normal of the reference edge in poly2's frame.\n\tb2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1]));\n\n\t// Find the incident edge on poly2.\n\tint32 index = 0;\n\tfloat32 minDot = b2_maxFloat;\n\tfor (int32 i = 0; i < count2; ++i)\n\t{\n\t\tfloat32 dot = b2Dot(normal1, normals2[i]);\n\t\tif (dot < minDot)\n\t\t{\n\t\t\tminDot = dot;\n\t\t\tindex = i;\n\t\t}\n\t}\n\n\t// Build the clip vertices for the incident edge.\n\tint32 i1 = index;\n\tint32 i2 = i1 + 1 < count2 ? i1 + 1 : 0;\n\n\tc[0].v = b2Mul(xf2, vertices2[i1]);\n\tc[0].id.cf.indexA = (uint8)edge1;\n\tc[0].id.cf.indexB = (uint8)i1;\n\tc[0].id.cf.typeA = b2ContactFeature::e_face;\n\tc[0].id.cf.typeB = b2ContactFeature::e_vertex;\n\n\tc[1].v = b2Mul(xf2, vertices2[i2]);\n\tc[1].id.cf.indexA = (uint8)edge1;\n\tc[1].id.cf.indexB = (uint8)i2;\n\tc[1].id.cf.typeA = b2ContactFeature::e_face;\n\tc[1].id.cf.typeB = b2ContactFeature::e_vertex;\n}\n\n// Find edge normal of max separation on A - return if separating axis is found\n// Find edge normal of max separation on B - return if separation axis is found\n// Choose reference edge as min(minA, minB)\n// Find incident edge\n// Clip\n\n// The normal points from 1 to 2\nvoid b2CollidePolygons(b2Manifold* manifold,\n\t\t\t\t\t  const b2PolygonShape* polyA, const b2Transform& xfA,\n\t\t\t\t\t  const b2PolygonShape* polyB, const b2Transform& xfB)\n{\n\tmanifold->pointCount = 0;\n\tfloat32 totalRadius = polyA->m_radius + polyB->m_radius;\n\n\tint32 edgeA = 0;\n\tfloat32 separationA = b2FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB);\n\tif (separationA > totalRadius)\n\t\treturn;\n\n\tint32 edgeB = 0;\n\tfloat32 separationB = b2FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA);\n\tif (separationB > totalRadius)\n\t\treturn;\n\n\tconst b2PolygonShape* poly1;\t// reference polygon\n\tconst b2PolygonShape* poly2;\t// incident polygon\n\tb2Transform xf1, xf2;\n\tint32 edge1;\t\t\t\t\t// reference edge\n\tuint8 flip;\n\tconst float32 k_tol = 0.1f * b2_linearSlop;\n\n\tif (separationB > separationA + k_tol)\n\t{\n\t\tpoly1 = polyB;\n\t\tpoly2 = polyA;\n\t\txf1 = xfB;\n\t\txf2 = xfA;\n\t\tedge1 = edgeB;\n\t\tmanifold->type = b2Manifold::e_faceB;\n\t\tflip = 1;\n\t}\n\telse\n\t{\n\t\tpoly1 = polyA;\n\t\tpoly2 = polyB;\n\t\txf1 = xfA;\n\t\txf2 = xfB;\n\t\tedge1 = edgeA;\n\t\tmanifold->type = b2Manifold::e_faceA;\n\t\tflip = 0;\n\t}\n\n\tb2ClipVertex incidentEdge[2];\n\tb2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);\n\n\tint32 count1 = poly1->m_count;\n\tconst b2Vec2* vertices1 = poly1->m_vertices;\n\n\tint32 iv1 = edge1;\n\tint32 iv2 = edge1 + 1 < count1 ? edge1 + 1 : 0;\n\n\tb2Vec2 v11 = vertices1[iv1];\n\tb2Vec2 v12 = vertices1[iv2];\n\n\tb2Vec2 localTangent = v12 - v11;\n\tlocalTangent.Normalize();\n\t\n\tb2Vec2 localNormal = b2Cross(localTangent, 1.0f);\n\tb2Vec2 planePoint = 0.5f * (v11 + v12);\n\n\tb2Vec2 tangent = b2Mul(xf1.q, localTangent);\n\tb2Vec2 normal = b2Cross(tangent, 1.0f);\n\t\n\tv11 = b2Mul(xf1, v11);\n\tv12 = b2Mul(xf1, v12);\n\n\t// Face offset.\n\tfloat32 frontOffset = b2Dot(normal, v11);\n\n\t// Side offsets, extended by polytope skin thickness.\n\tfloat32 sideOffset1 = -b2Dot(tangent, v11) + totalRadius;\n\tfloat32 sideOffset2 = b2Dot(tangent, v12) + totalRadius;\n\n\t// Clip incident edge against extruded edge1 side edges.\n\tb2ClipVertex clipPoints1[2];\n\tb2ClipVertex clipPoints2[2];\n\tint np;\n\n\t// Clip to box side 1\n\tnp = b2ClipSegmentToLine(clipPoints1, incidentEdge, -tangent, sideOffset1, iv1);\n\n\tif (np < 2)\n\t\treturn;\n\n\t// Clip to negative box side 1\n\tnp = b2ClipSegmentToLine(clipPoints2, clipPoints1,  tangent, sideOffset2, iv2);\n\n\tif (np < 2)\n\t{\n\t\treturn;\n\t}\n\n\t// Now clipPoints2 contains the clipped points.\n\tmanifold->localNormal = localNormal;\n\tmanifold->localPoint = planePoint;\n\n\tint32 pointCount = 0;\n\tfor (int32 i = 0; i < b2_maxManifoldPoints; ++i)\n\t{\n\t\tfloat32 separation = b2Dot(normal, clipPoints2[i].v) - frontOffset;\n\n\t\tif (separation <= totalRadius)\n\t\t{\n\t\t\tb2ManifoldPoint* cp = manifold->points + pointCount;\n\t\t\tcp->localPoint = b2MulT(xf2, clipPoints2[i].v);\n\t\t\tcp->id = clipPoints2[i].id;\n\t\t\tif (flip)\n\t\t\t{\n\t\t\t\t// Swap features\n\t\t\t\tb2ContactFeature cf = cp->id.cf;\n\t\t\t\tcp->id.cf.indexA = cf.indexB;\n\t\t\t\tcp->id.cf.indexB = cf.indexA;\n\t\t\t\tcp->id.cf.typeA = cf.typeB;\n\t\t\t\tcp->id.cf.typeB = cf.typeA;\n\t\t\t}\n\t\t\t++pointCount;\n\t\t}\n\t}\n\n\tmanifold->pointCount = pointCount;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2Collision.cpp",
    "content": "/*\n* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/b2Distance.h>\n\nvoid b2WorldManifold::Initialize(const b2Manifold* manifold,\n\t\t\t\t\t\t  const b2Transform& xfA, float32 radiusA,\n\t\t\t\t\t\t  const b2Transform& xfB, float32 radiusB)\n{\n\tif (manifold->pointCount == 0)\n\t{\n\t\treturn;\n\t}\n\n\tswitch (manifold->type)\n\t{\n\tcase b2Manifold::e_circles:\n\t\t{\n\t\t\tnormal.Set(1.0f, 0.0f);\n\t\t\tb2Vec2 pointA = b2Mul(xfA, manifold->localPoint);\n\t\t\tb2Vec2 pointB = b2Mul(xfB, manifold->points[0].localPoint);\n\t\t\tif (b2DistanceSquared(pointA, pointB) > b2_epsilon * b2_epsilon)\n\t\t\t{\n\t\t\t\tnormal = pointB - pointA;\n\t\t\t\tnormal.Normalize();\n\t\t\t}\n\n\t\t\tb2Vec2 cA = pointA + radiusA * normal;\n\t\t\tb2Vec2 cB = pointB - radiusB * normal;\n\t\t\tpoints[0] = 0.5f * (cA + cB);\n\t\t\tseparations[0] = b2Dot(cB - cA, normal);\n\t\t}\n\t\tbreak;\n\n\tcase b2Manifold::e_faceA:\n\t\t{\n\t\t\tnormal = b2Mul(xfA.q, manifold->localNormal);\n\t\t\tb2Vec2 planePoint = b2Mul(xfA, manifold->localPoint);\n\t\t\t\n\t\t\tfor (int32 i = 0; i < manifold->pointCount; ++i)\n\t\t\t{\n\t\t\t\tb2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint);\n\t\t\t\tb2Vec2 cA = clipPoint + (radiusA - b2Dot(clipPoint - planePoint, normal)) * normal;\n\t\t\t\tb2Vec2 cB = clipPoint - radiusB * normal;\n\t\t\t\tpoints[i] = 0.5f * (cA + cB);\n\t\t\t\tseparations[i] = b2Dot(cB - cA, normal);\n\t\t\t}\n\t\t}\n\t\tbreak;\n\n\tcase b2Manifold::e_faceB:\n\t\t{\n\t\t\tnormal = b2Mul(xfB.q, manifold->localNormal);\n\t\t\tb2Vec2 planePoint = b2Mul(xfB, manifold->localPoint);\n\n\t\t\tfor (int32 i = 0; i < manifold->pointCount; ++i)\n\t\t\t{\n\t\t\t\tb2Vec2 clipPoint = b2Mul(xfA, manifold->points[i].localPoint);\n\t\t\t\tb2Vec2 cB = clipPoint + (radiusB - b2Dot(clipPoint - planePoint, normal)) * normal;\n\t\t\t\tb2Vec2 cA = clipPoint - radiusA * normal;\n\t\t\t\tpoints[i] = 0.5f * (cA + cB);\n\t\t\t\tseparations[i] = b2Dot(cA - cB, normal);\n\t\t\t}\n\n\t\t\t// Ensure normal points from A to B.\n\t\t\tnormal = -normal;\n\t\t}\n\t\tbreak;\n\t}\n}\n\nvoid b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints],\n\t\t\t\t\t  const b2Manifold* manifold1, const b2Manifold* manifold2)\n{\n\tfor (int32 i = 0; i < b2_maxManifoldPoints; ++i)\n\t{\n\t\tstate1[i] = b2_nullState;\n\t\tstate2[i] = b2_nullState;\n\t}\n\n\t// Detect persists and removes.\n\tfor (int32 i = 0; i < manifold1->pointCount; ++i)\n\t{\n\t\tb2ContactID id = manifold1->points[i].id;\n\n\t\tstate1[i] = b2_removeState;\n\n\t\tfor (int32 j = 0; j < manifold2->pointCount; ++j)\n\t\t{\n\t\t\tif (manifold2->points[j].id.key == id.key)\n\t\t\t{\n\t\t\t\tstate1[i] = b2_persistState;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Detect persists and adds.\n\tfor (int32 i = 0; i < manifold2->pointCount; ++i)\n\t{\n\t\tb2ContactID id = manifold2->points[i].id;\n\n\t\tstate2[i] = b2_addState;\n\n\t\tfor (int32 j = 0; j < manifold1->pointCount; ++j)\n\t\t{\n\t\t\tif (manifold1->points[j].id.key == id.key)\n\t\t\t{\n\t\t\t\tstate2[i] = b2_persistState;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n// From Real-time Collision Detection, p179.\nbool b2AABB::RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const\n{\n\tfloat32 tmin = -b2_maxFloat;\n\tfloat32 tmax = b2_maxFloat;\n\n\tb2Vec2 p = input.p1;\n\tb2Vec2 d = input.p2 - input.p1;\n\tb2Vec2 absD = b2Abs(d);\n\n\tb2Vec2 normal;\n\n\tfor (int32 i = 0; i < 2; ++i)\n\t{\n\t\tif (absD(i) < b2_epsilon)\n\t\t{\n\t\t\t// Parallel.\n\t\t\tif (p(i) < lowerBound(i) || upperBound(i) < p(i))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfloat32 inv_d = 1.0f / d(i);\n\t\t\tfloat32 t1 = (lowerBound(i) - p(i)) * inv_d;\n\t\t\tfloat32 t2 = (upperBound(i) - p(i)) * inv_d;\n\n\t\t\t// Sign of the normal vector.\n\t\t\tfloat32 s = -1.0f;\n\n\t\t\tif (t1 > t2)\n\t\t\t{\n\t\t\t\tb2Swap(t1, t2);\n\t\t\t\ts = 1.0f;\n\t\t\t}\n\n\t\t\t// Push the min up\n\t\t\tif (t1 > tmin)\n\t\t\t{\n\t\t\t\tnormal.SetZero();\n\t\t\t\tnormal(i) = s;\n\t\t\t\ttmin = t1;\n\t\t\t}\n\n\t\t\t// Pull the max down\n\t\t\ttmax = b2Min(tmax, t2);\n\n\t\t\tif (tmin > tmax)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Does the ray start inside the box?\n\t// Does the ray intersect beyond the max fraction?\n\tif (tmin < 0.0f || input.maxFraction < tmin)\n\t{\n\t\treturn false;\n\t}\n\n\t// Intersection.\n\toutput->fraction = tmin;\n\toutput->normal = normal;\n\treturn true;\n}\n\n// Sutherland-Hodgman clipping.\nint32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2],\n\t\t\t\t\t\tconst b2Vec2& normal, float32 offset, int32 vertexIndexA)\n{\n\t// Start with no output points\n\tint32 numOut = 0;\n\n\t// Calculate the distance of end points to the line\n\tfloat32 distance0 = b2Dot(normal, vIn[0].v) - offset;\n\tfloat32 distance1 = b2Dot(normal, vIn[1].v) - offset;\n\n\t// If the points are behind the plane\n\tif (distance0 <= 0.0f) vOut[numOut++] = vIn[0];\n\tif (distance1 <= 0.0f) vOut[numOut++] = vIn[1];\n\n\t// If the points are on different sides of the plane\n\tif (distance0 * distance1 < 0.0f)\n\t{\n\t\t// Find intersection point of edge and plane\n\t\tfloat32 interp = distance0 / (distance0 - distance1);\n\t\tvOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v);\n\n\t\t// VertexA is hitting edgeB.\n\t\tvOut[numOut].id.cf.indexA = static_cast<uint8>(vertexIndexA);\n\t\tvOut[numOut].id.cf.indexB = vIn[0].id.cf.indexB;\n\t\tvOut[numOut].id.cf.typeA = b2ContactFeature::e_vertex;\n\t\tvOut[numOut].id.cf.typeB = b2ContactFeature::e_face;\n\t\t++numOut;\n\t}\n\n\treturn numOut;\n}\n\nbool b2TestOverlap(\tconst b2Shape* shapeA, int32 indexA,\n\t\t\t\t\tconst b2Shape* shapeB, int32 indexB,\n\t\t\t\t\tconst b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2DistanceInput input;\n\tinput.proxyA.Set(shapeA, indexA);\n\tinput.proxyB.Set(shapeB, indexB);\n\tinput.transformA = xfA;\n\tinput.transformB = xfB;\n\tinput.useRadii = true;\n\n\tb2SimplexCache cache;\n\tcache.count = 0;\n\n\tb2DistanceOutput output;\n\n\tb2Distance(&output, &cache, &input);\n\n\treturn output.distance < 10.0f * b2_epsilon;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2Collision.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_COLLISION_H\n#define B2_COLLISION_H\n\n#include <Box2D/Common/b2Math.h>\n#include <limits.h>\n\n/// @file\n/// Structures and functions used for computing contact points, distance\n/// queries, and TOI queries.\n\nclass b2Shape;\nclass b2CircleShape;\nclass b2EdgeShape;\nclass b2PolygonShape;\n\nconst uint8 b2_nullFeature = UCHAR_MAX;\n\n/// The features that intersect to form the contact point\n/// This must be 4 bytes or less.\nstruct b2ContactFeature\n{\n\tenum Type\n\t{\n\t\te_vertex = 0,\n\t\te_face = 1\n\t};\n\n\tuint8 indexA;\t\t///< Feature index on shapeA\n\tuint8 indexB;\t\t///< Feature index on shapeB\n\tuint8 typeA;\t\t///< The feature type on shapeA\n\tuint8 typeB;\t\t///< The feature type on shapeB\n};\n\n/// Contact ids to facilitate warm starting.\nunion b2ContactID\n{\n\tb2ContactFeature cf;\n\tuint32 key;\t\t\t\t\t///< Used to quickly compare contact ids.\n};\n\n/// A manifold point is a contact point belonging to a contact\n/// manifold. It holds details related to the geometry and dynamics\n/// of the contact points.\n/// The local point usage depends on the manifold type:\n/// -e_circles: the local center of circleB\n/// -e_faceA: the local center of cirlceB or the clip point of polygonB\n/// -e_faceB: the clip point of polygonA\n/// This structure is stored across time steps, so we keep it small.\n/// Note: the impulses are used for internal caching and may not\n/// provide reliable contact forces, especially for high speed collisions.\nstruct b2ManifoldPoint\n{\n\tb2Vec2 localPoint;\t\t///< usage depends on manifold type\n\tfloat32 normalImpulse;\t///< the non-penetration impulse\n\tfloat32 tangentImpulse;\t///< the friction impulse\n\tb2ContactID id;\t\t\t///< uniquely identifies a contact point between two shapes\n};\n\n/// A manifold for two touching convex shapes.\n/// Box2D supports multiple types of contact:\n/// - clip point versus plane with radius\n/// - point versus point with radius (circles)\n/// The local point usage depends on the manifold type:\n/// -e_circles: the local center of circleA\n/// -e_faceA: the center of faceA\n/// -e_faceB: the center of faceB\n/// Similarly the local normal usage:\n/// -e_circles: not used\n/// -e_faceA: the normal on polygonA\n/// -e_faceB: the normal on polygonB\n/// We store contacts in this way so that position correction can\n/// account for movement, which is critical for continuous physics.\n/// All contact scenarios must be expressed in one of these types.\n/// This structure is stored across time steps, so we keep it small.\nstruct b2Manifold\n{\n\tenum Type\n\t{\n\t\te_circles,\n\t\te_faceA,\n\t\te_faceB\n\t};\n\n\tb2ManifoldPoint points[b2_maxManifoldPoints];\t///< the points of contact\n\tb2Vec2 localNormal;\t\t\t\t\t\t\t\t///< not use for Type::e_points\n\tb2Vec2 localPoint;\t\t\t\t\t\t\t\t///< usage depends on manifold type\n\tType type;\n\tint32 pointCount;\t\t\t\t\t\t\t\t///< the number of manifold points\n};\n\n/// This is used to compute the current state of a contact manifold.\nstruct b2WorldManifold\n{\n\t/// Evaluate the manifold with supplied transforms. This assumes\n\t/// modest motion from the original state. This does not change the\n\t/// point count, impulses, etc. The radii must come from the shapes\n\t/// that generated the manifold.\n\tvoid Initialize(const b2Manifold* manifold,\n\t\t\t\t\tconst b2Transform& xfA, float32 radiusA,\n\t\t\t\t\tconst b2Transform& xfB, float32 radiusB);\n\n\tb2Vec2 normal;\t\t\t\t\t\t\t\t///< world vector pointing from A to B\n\tb2Vec2 points[b2_maxManifoldPoints];\t\t///< world contact point (point of intersection)\n\tfloat32 separations[b2_maxManifoldPoints];\t///< a negative value indicates overlap, in meters\n};\n\n/// This is used for determining the state of contact points.\nenum b2PointState\n{\n\tb2_nullState,\t\t///< point does not exist\n\tb2_addState,\t\t///< point was added in the update\n\tb2_persistState,\t///< point persisted across the update\n\tb2_removeState\t\t///< point was removed in the update\n};\n\n/// Compute the point states given two manifolds. The states pertain to the transition from manifold1\n/// to manifold2. So state1 is either persist or remove while state2 is either add or persist.\nvoid b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints],\n\t\t\t\t\t  const b2Manifold* manifold1, const b2Manifold* manifold2);\n\n/// Used for computing contact manifolds.\nstruct b2ClipVertex\n{\n\tb2Vec2 v;\n\tb2ContactID id;\n};\n\n/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).\nstruct b2RayCastInput\n{\n\tb2Vec2 p1, p2;\n\tfloat32 maxFraction;\n};\n\n/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2\n/// come from b2RayCastInput.\nstruct b2RayCastOutput\n{\n\tb2Vec2 normal;\n\tfloat32 fraction;\n};\n\n/// An axis aligned bounding box.\nstruct b2AABB\n{\n\t/// Verify that the bounds are sorted.\n\tbool IsValid() const;\n\n\t/// Get the center of the AABB.\n\tb2Vec2 GetCenter() const\n\t{\n\t\treturn 0.5f * (lowerBound + upperBound);\n\t}\n\n\t/// Get the extents of the AABB (half-widths).\n\tb2Vec2 GetExtents() const\n\t{\n\t\treturn 0.5f * (upperBound - lowerBound);\n\t}\n\n\t/// Get the perimeter length\n\tfloat32 GetPerimeter() const\n\t{\n\t\tfloat32 wx = upperBound.x - lowerBound.x;\n\t\tfloat32 wy = upperBound.y - lowerBound.y;\n\t\treturn 2.0f * (wx + wy);\n\t}\n\n\t/// Combine an AABB into this one.\n\tvoid Combine(const b2AABB& aabb)\n\t{\n\t\tlowerBound = b2Min(lowerBound, aabb.lowerBound);\n\t\tupperBound = b2Max(upperBound, aabb.upperBound);\n\t}\n\n\t/// Combine two AABBs into this one.\n\tvoid Combine(const b2AABB& aabb1, const b2AABB& aabb2)\n\t{\n\t\tlowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound);\n\t\tupperBound = b2Max(aabb1.upperBound, aabb2.upperBound);\n\t}\n\n\t/// Does this aabb contain the provided AABB.\n\tbool Contains(const b2AABB& aabb) const\n\t{\n\t\tbool result = true;\n\t\tresult = result && lowerBound.x <= aabb.lowerBound.x;\n\t\tresult = result && lowerBound.y <= aabb.lowerBound.y;\n\t\tresult = result && aabb.upperBound.x <= upperBound.x;\n\t\tresult = result && aabb.upperBound.y <= upperBound.y;\n\t\treturn result;\n\t}\n\n\tbool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const;\n\n\tb2Vec2 lowerBound;\t///< the lower vertex\n\tb2Vec2 upperBound;\t///< the upper vertex\n};\n\n/// Compute the collision manifold between two circles.\nvoid b2CollideCircles(b2Manifold* manifold,\n\t\t\t\t\t  const b2CircleShape* circleA, const b2Transform& xfA,\n\t\t\t\t\t  const b2CircleShape* circleB, const b2Transform& xfB);\n\n/// Compute the collision manifold between a polygon and a circle.\nvoid b2CollidePolygonAndCircle(b2Manifold* manifold,\n\t\t\t\t\t\t\t   const b2PolygonShape* polygonA, const b2Transform& xfA,\n\t\t\t\t\t\t\t   const b2CircleShape* circleB, const b2Transform& xfB);\n\n/// Compute the collision manifold between two polygons.\nvoid b2CollidePolygons(b2Manifold* manifold,\n\t\t\t\t\t   const b2PolygonShape* polygonA, const b2Transform& xfA,\n\t\t\t\t\t   const b2PolygonShape* polygonB, const b2Transform& xfB);\n\n/// Compute the collision manifold between an edge and a circle.\nvoid b2CollideEdgeAndCircle(b2Manifold* manifold,\n\t\t\t\t\t\t\t   const b2EdgeShape* polygonA, const b2Transform& xfA,\n\t\t\t\t\t\t\t   const b2CircleShape* circleB, const b2Transform& xfB);\n\n/// Compute the collision manifold between an edge and a circle.\nvoid b2CollideEdgeAndPolygon(b2Manifold* manifold,\n\t\t\t\t\t\t\t   const b2EdgeShape* edgeA, const b2Transform& xfA,\n\t\t\t\t\t\t\t   const b2PolygonShape* circleB, const b2Transform& xfB);\n\n/// Clipping for contact manifolds.\nint32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2],\n\t\t\t\t\t\t\tconst b2Vec2& normal, float32 offset, int32 vertexIndexA);\n\n/// Determine if two generic shapes overlap.\nbool b2TestOverlap(\tconst b2Shape* shapeA, int32 indexA,\n\t\t\t\t\tconst b2Shape* shapeB, int32 indexB,\n\t\t\t\t\tconst b2Transform& xfA, const b2Transform& xfB);\n\n// ---------------- Inline Functions ------------------------------------------\n\ninline bool b2AABB::IsValid() const\n{\n\tb2Vec2 d = upperBound - lowerBound;\n\tbool valid = d.x >= 0.0f && d.y >= 0.0f;\n\tvalid = valid && lowerBound.IsValid() && upperBound.IsValid();\n\treturn valid;\n}\n\ninline bool b2TestOverlap(const b2AABB& a, const b2AABB& b)\n{\n\tb2Vec2 d1, d2;\n\td1 = b.lowerBound - a.upperBound;\n\td2 = a.lowerBound - b.upperBound;\n\n\tif (d1.x > 0.0f || d1.y > 0.0f)\n\t\treturn false;\n\n\tif (d2.x > 0.0f || d2.y > 0.0f)\n\t\treturn false;\n\n\treturn true;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2Distance.cpp",
    "content": "/*\n* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2Distance.h>\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n#include <Box2D/Collision/Shapes/b2ChainShape.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n\n// GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates.\nint32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters;\n\nvoid b2DistanceProxy::Set(const b2Shape* shape, int32 index)\n{\n\tswitch (shape->GetType())\n\t{\n\tcase b2Shape::e_circle:\n\t\t{\n\t\t\tconst b2CircleShape* circle = static_cast<const b2CircleShape*>(shape);\n\t\t\tm_vertices = &circle->m_p;\n\t\t\tm_count = 1;\n\t\t\tm_radius = circle->m_radius;\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_polygon:\n\t\t{\n\t\t\tconst b2PolygonShape* polygon = static_cast<const b2PolygonShape*>(shape);\n\t\t\tm_vertices = polygon->m_vertices;\n\t\t\tm_count = polygon->m_count;\n\t\t\tm_radius = polygon->m_radius;\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_chain:\n\t\t{\n\t\t\tconst b2ChainShape* chain = static_cast<const b2ChainShape*>(shape);\n\t\t\tb2Assert(0 <= index && index < chain->m_count);\n\n\t\t\tm_buffer[0] = chain->m_vertices[index];\n\t\t\tif (index + 1 < chain->m_count)\n\t\t\t{\n\t\t\t\tm_buffer[1] = chain->m_vertices[index + 1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_buffer[1] = chain->m_vertices[0];\n\t\t\t}\n\n\t\t\tm_vertices = m_buffer;\n\t\t\tm_count = 2;\n\t\t\tm_radius = chain->m_radius;\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_edge:\n\t\t{\n\t\t\tconst b2EdgeShape* edge = static_cast<const b2EdgeShape*>(shape);\n\t\t\tm_vertices = &edge->m_vertex1;\n\t\t\tm_count = 2;\n\t\t\tm_radius = edge->m_radius;\n\t\t}\n\t\tbreak;\n\n\tdefault:\n\t\tb2Assert(false);\n\t}\n}\n\n\nstruct b2SimplexVertex\n{\n\tb2Vec2 wA;\t\t// support point in proxyA\n\tb2Vec2 wB;\t\t// support point in proxyB\n\tb2Vec2 w;\t\t// wB - wA\n\tfloat32 a;\t\t// barycentric coordinate for closest point\n\tint32 indexA;\t// wA index\n\tint32 indexB;\t// wB index\n};\n\nstruct b2Simplex\n{\n\tvoid ReadCache(\tconst b2SimplexCache* cache,\n\t\t\t\t\tconst b2DistanceProxy* proxyA, const b2Transform& transformA,\n\t\t\t\t\tconst b2DistanceProxy* proxyB, const b2Transform& transformB)\n\t{\n\t\tb2Assert(cache->count <= 3);\n\t\t\n\t\t// Copy data from cache.\n\t\tm_count = cache->count;\n\t\tb2SimplexVertex* vertices = &m_v1;\n\t\tfor (int32 i = 0; i < m_count; ++i)\n\t\t{\n\t\t\tb2SimplexVertex* v = vertices + i;\n\t\t\tv->indexA = cache->indexA[i];\n\t\t\tv->indexB = cache->indexB[i];\n\t\t\tb2Vec2 wALocal = proxyA->GetVertex(v->indexA);\n\t\t\tb2Vec2 wBLocal = proxyB->GetVertex(v->indexB);\n\t\t\tv->wA = b2Mul(transformA, wALocal);\n\t\t\tv->wB = b2Mul(transformB, wBLocal);\n\t\t\tv->w = v->wB - v->wA;\n\t\t\tv->a = 0.0f;\n\t\t}\n\n\t\t// Compute the new simplex metric, if it is substantially different than\n\t\t// old metric then flush the simplex.\n\t\tif (m_count > 1)\n\t\t{\n\t\t\tfloat32 metric1 = cache->metric;\n\t\t\tfloat32 metric2 = GetMetric();\n\t\t\tif (metric2 < 0.5f * metric1 || 2.0f * metric1 < metric2 || metric2 < b2_epsilon)\n\t\t\t{\n\t\t\t\t// Reset the simplex.\n\t\t\t\tm_count = 0;\n\t\t\t}\n\t\t}\n\n\t\t// If the cache is empty or invalid ...\n\t\tif (m_count == 0)\n\t\t{\n\t\t\tb2SimplexVertex* v = vertices + 0;\n\t\t\tv->indexA = 0;\n\t\t\tv->indexB = 0;\n\t\t\tb2Vec2 wALocal = proxyA->GetVertex(0);\n\t\t\tb2Vec2 wBLocal = proxyB->GetVertex(0);\n\t\t\tv->wA = b2Mul(transformA, wALocal);\n\t\t\tv->wB = b2Mul(transformB, wBLocal);\n\t\t\tv->w = v->wB - v->wA;\n\t\t\tv->a = 1.0f;\n\t\t\tm_count = 1;\n\t\t}\n\t}\n\n\tvoid WriteCache(b2SimplexCache* cache) const\n\t{\n\t\tcache->metric = GetMetric();\n\t\tcache->count = uint16(m_count);\n\t\tconst b2SimplexVertex* vertices = &m_v1;\n\t\tfor (int32 i = 0; i < m_count; ++i)\n\t\t{\n\t\t\tcache->indexA[i] = uint8(vertices[i].indexA);\n\t\t\tcache->indexB[i] = uint8(vertices[i].indexB);\n\t\t}\n\t}\n\n\tb2Vec2 GetSearchDirection() const\n\t{\n\t\tswitch (m_count)\n\t\t{\n\t\tcase 1:\n\t\t\treturn -m_v1.w;\n\n\t\tcase 2:\n\t\t\t{\n\t\t\t\tb2Vec2 e12 = m_v2.w - m_v1.w;\n\t\t\t\tfloat32 sgn = b2Cross(e12, -m_v1.w);\n\t\t\t\tif (sgn > 0.0f)\n\t\t\t\t{\n\t\t\t\t\t// Origin is left of e12.\n\t\t\t\t\treturn b2Cross(1.0f, e12);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Origin is right of e12.\n\t\t\t\t\treturn b2Cross(e12, 1.0f);\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\tb2Assert(false);\n\t\t\treturn b2Vec2_zero;\n\t\t}\n\t}\n\n\tb2Vec2 GetClosestPoint() const\n\t{\n\t\tswitch (m_count)\n\t\t{\n\t\tcase 0:\n\t\t\tb2Assert(false);\n\t\t\treturn b2Vec2_zero;\n\n\t\tcase 1:\n\t\t\treturn m_v1.w;\n\n\t\tcase 2:\n\t\t\treturn m_v1.a * m_v1.w + m_v2.a * m_v2.w;\n\n\t\tcase 3:\n\t\t\treturn b2Vec2_zero;\n\n\t\tdefault:\n\t\t\tb2Assert(false);\n\t\t\treturn b2Vec2_zero;\n\t\t}\n\t}\n\n\tvoid GetWitnessPoints(b2Vec2* pA, b2Vec2* pB) const\n\t{\n\t\tswitch (m_count)\n\t\t{\n\t\tcase 0:\n\t\t\tb2Assert(false);\n\t\t\tbreak;\n\n\t\tcase 1:\n\t\t\t*pA = m_v1.wA;\n\t\t\t*pB = m_v1.wB;\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\t*pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA;\n\t\t\t*pB = m_v1.a * m_v1.wB + m_v2.a * m_v2.wB;\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\t\t*pA = m_v1.a * m_v1.wA + m_v2.a * m_v2.wA + m_v3.a * m_v3.wA;\n\t\t\t*pB = *pA;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tb2Assert(false);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfloat32 GetMetric() const\n\t{\n\t\tswitch (m_count)\n\t\t{\n\t\tcase 0:\n\t\t\tb2Assert(false);\n\t\t\treturn 0.0f;\n\n\t\tcase 1:\n\t\t\treturn 0.0f;\n\n\t\tcase 2:\n\t\t\treturn b2Distance(m_v1.w, m_v2.w);\n\n\t\tcase 3:\n\t\t\treturn b2Cross(m_v2.w - m_v1.w, m_v3.w - m_v1.w);\n\n\t\tdefault:\n\t\t\tb2Assert(false);\n\t\t\treturn 0.0f;\n\t\t}\n\t}\n\n\tvoid Solve2();\n\tvoid Solve3();\n\n\tb2SimplexVertex m_v1, m_v2, m_v3;\n\tint32 m_count;\n};\n\n\n// Solve a line segment using barycentric coordinates.\n//\n// p = a1 * w1 + a2 * w2\n// a1 + a2 = 1\n//\n// The vector from the origin to the closest point on the line is\n// perpendicular to the line.\n// e12 = w2 - w1\n// dot(p, e) = 0\n// a1 * dot(w1, e) + a2 * dot(w2, e) = 0\n//\n// 2-by-2 linear system\n// [1      1     ][a1] = [1]\n// [w1.e12 w2.e12][a2] = [0]\n//\n// Define\n// d12_1 =  dot(w2, e12)\n// d12_2 = -dot(w1, e12)\n// d12 = d12_1 + d12_2\n//\n// Solution\n// a1 = d12_1 / d12\n// a2 = d12_2 / d12\nvoid b2Simplex::Solve2()\n{\n\tb2Vec2 w1 = m_v1.w;\n\tb2Vec2 w2 = m_v2.w;\n\tb2Vec2 e12 = w2 - w1;\n\n\t// w1 region\n\tfloat32 d12_2 = -b2Dot(w1, e12);\n\tif (d12_2 <= 0.0f)\n\t{\n\t\t// a2 <= 0, so we clamp it to 0\n\t\tm_v1.a = 1.0f;\n\t\tm_count = 1;\n\t\treturn;\n\t}\n\n\t// w2 region\n\tfloat32 d12_1 = b2Dot(w2, e12);\n\tif (d12_1 <= 0.0f)\n\t{\n\t\t// a1 <= 0, so we clamp it to 0\n\t\tm_v2.a = 1.0f;\n\t\tm_count = 1;\n\t\tm_v1 = m_v2;\n\t\treturn;\n\t}\n\n\t// Must be in e12 region.\n\tfloat32 inv_d12 = 1.0f / (d12_1 + d12_2);\n\tm_v1.a = d12_1 * inv_d12;\n\tm_v2.a = d12_2 * inv_d12;\n\tm_count = 2;\n}\n\n// Possible regions:\n// - points[2]\n// - edge points[0]-points[2]\n// - edge points[1]-points[2]\n// - inside the triangle\nvoid b2Simplex::Solve3()\n{\n\tb2Vec2 w1 = m_v1.w;\n\tb2Vec2 w2 = m_v2.w;\n\tb2Vec2 w3 = m_v3.w;\n\n\t// Edge12\n\t// [1      1     ][a1] = [1]\n\t// [w1.e12 w2.e12][a2] = [0]\n\t// a3 = 0\n\tb2Vec2 e12 = w2 - w1;\n\tfloat32 w1e12 = b2Dot(w1, e12);\n\tfloat32 w2e12 = b2Dot(w2, e12);\n\tfloat32 d12_1 = w2e12;\n\tfloat32 d12_2 = -w1e12;\n\n\t// Edge13\n\t// [1      1     ][a1] = [1]\n\t// [w1.e13 w3.e13][a3] = [0]\n\t// a2 = 0\n\tb2Vec2 e13 = w3 - w1;\n\tfloat32 w1e13 = b2Dot(w1, e13);\n\tfloat32 w3e13 = b2Dot(w3, e13);\n\tfloat32 d13_1 = w3e13;\n\tfloat32 d13_2 = -w1e13;\n\n\t// Edge23\n\t// [1      1     ][a2] = [1]\n\t// [w2.e23 w3.e23][a3] = [0]\n\t// a1 = 0\n\tb2Vec2 e23 = w3 - w2;\n\tfloat32 w2e23 = b2Dot(w2, e23);\n\tfloat32 w3e23 = b2Dot(w3, e23);\n\tfloat32 d23_1 = w3e23;\n\tfloat32 d23_2 = -w2e23;\n\t\n\t// Triangle123\n\tfloat32 n123 = b2Cross(e12, e13);\n\n\tfloat32 d123_1 = n123 * b2Cross(w2, w3);\n\tfloat32 d123_2 = n123 * b2Cross(w3, w1);\n\tfloat32 d123_3 = n123 * b2Cross(w1, w2);\n\n\t// w1 region\n\tif (d12_2 <= 0.0f && d13_2 <= 0.0f)\n\t{\n\t\tm_v1.a = 1.0f;\n\t\tm_count = 1;\n\t\treturn;\n\t}\n\n\t// e12\n\tif (d12_1 > 0.0f && d12_2 > 0.0f && d123_3 <= 0.0f)\n\t{\n\t\tfloat32 inv_d12 = 1.0f / (d12_1 + d12_2);\n\t\tm_v1.a = d12_1 * inv_d12;\n\t\tm_v2.a = d12_2 * inv_d12;\n\t\tm_count = 2;\n\t\treturn;\n\t}\n\n\t// e13\n\tif (d13_1 > 0.0f && d13_2 > 0.0f && d123_2 <= 0.0f)\n\t{\n\t\tfloat32 inv_d13 = 1.0f / (d13_1 + d13_2);\n\t\tm_v1.a = d13_1 * inv_d13;\n\t\tm_v3.a = d13_2 * inv_d13;\n\t\tm_count = 2;\n\t\tm_v2 = m_v3;\n\t\treturn;\n\t}\n\n\t// w2 region\n\tif (d12_1 <= 0.0f && d23_2 <= 0.0f)\n\t{\n\t\tm_v2.a = 1.0f;\n\t\tm_count = 1;\n\t\tm_v1 = m_v2;\n\t\treturn;\n\t}\n\n\t// w3 region\n\tif (d13_1 <= 0.0f && d23_1 <= 0.0f)\n\t{\n\t\tm_v3.a = 1.0f;\n\t\tm_count = 1;\n\t\tm_v1 = m_v3;\n\t\treturn;\n\t}\n\n\t// e23\n\tif (d23_1 > 0.0f && d23_2 > 0.0f && d123_1 <= 0.0f)\n\t{\n\t\tfloat32 inv_d23 = 1.0f / (d23_1 + d23_2);\n\t\tm_v2.a = d23_1 * inv_d23;\n\t\tm_v3.a = d23_2 * inv_d23;\n\t\tm_count = 2;\n\t\tm_v1 = m_v3;\n\t\treturn;\n\t}\n\n\t// Must be in triangle123\n\tfloat32 inv_d123 = 1.0f / (d123_1 + d123_2 + d123_3);\n\tm_v1.a = d123_1 * inv_d123;\n\tm_v2.a = d123_2 * inv_d123;\n\tm_v3.a = d123_3 * inv_d123;\n\tm_count = 3;\n}\n\nvoid b2Distance(b2DistanceOutput* output,\n\t\t\t\tb2SimplexCache* cache,\n\t\t\t\tconst b2DistanceInput* input)\n{\n\t++b2_gjkCalls;\n\n\tconst b2DistanceProxy* proxyA = &input->proxyA;\n\tconst b2DistanceProxy* proxyB = &input->proxyB;\n\n\tb2Transform transformA = input->transformA;\n\tb2Transform transformB = input->transformB;\n\n\t// Initialize the simplex.\n\tb2Simplex simplex;\n\tsimplex.ReadCache(cache, proxyA, transformA, proxyB, transformB);\n\n\t// Get simplex vertices as an array.\n\tb2SimplexVertex* vertices = &simplex.m_v1;\n\tconst int32 k_maxIters = 20;\n\n\t// These store the vertices of the last simplex so that we\n\t// can check for duplicates and prevent cycling.\n\tint32 saveA[3], saveB[3];\n\tint32 saveCount = 0;\n\n\tfloat32 distanceSqr1 = b2_maxFloat;\n\tfloat32 distanceSqr2 = distanceSqr1;\n\n\t// Main iteration loop.\n\tint32 iter = 0;\n\twhile (iter < k_maxIters)\n\t{\n\t\t// Copy simplex so we can identify duplicates.\n\t\tsaveCount = simplex.m_count;\n\t\tfor (int32 i = 0; i < saveCount; ++i)\n\t\t{\n\t\t\tsaveA[i] = vertices[i].indexA;\n\t\t\tsaveB[i] = vertices[i].indexB;\n\t\t}\n\n\t\tswitch (simplex.m_count)\n\t\t{\n\t\tcase 1:\n\t\t\tbreak;\n\n\t\tcase 2:\n\t\t\tsimplex.Solve2();\n\t\t\tbreak;\n\n\t\tcase 3:\n\t\t\tsimplex.Solve3();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tb2Assert(false);\n\t\t}\n\n\t\t// If we have 3 points, then the origin is in the corresponding triangle.\n\t\tif (simplex.m_count == 3)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\n\t\t// Compute closest point.\n\t\tb2Vec2 p = simplex.GetClosestPoint();\n\t\tdistanceSqr2 = p.LengthSquared();\n\n\t\t// Ensure progress\n\t\tif (distanceSqr2 >= distanceSqr1)\n\t\t{\n\t\t\t//break;\n\t\t}\n\t\tdistanceSqr1 = distanceSqr2;\n\n\t\t// Get search direction.\n\t\tb2Vec2 d = simplex.GetSearchDirection();\n\n\t\t// Ensure the search direction is numerically fit.\n\t\tif (d.LengthSquared() < b2_epsilon * b2_epsilon)\n\t\t{\n\t\t\t// The origin is probably contained by a line segment\n\t\t\t// or triangle. Thus the shapes are overlapped.\n\n\t\t\t// We can't return zero here even though there may be overlap.\n\t\t\t// In case the simplex is a point, segment, or triangle it is difficult\n\t\t\t// to determine if the origin is contained in the CSO or very close to it.\n\t\t\tbreak;\n\t\t}\n\n\t\t// Compute a tentative new simplex vertex using support points.\n\t\tb2SimplexVertex* vertex = vertices + simplex.m_count;\n\t\tvertex->indexA = proxyA->GetSupport(b2MulT(transformA.q, -d));\n\t\tvertex->wA = b2Mul(transformA, proxyA->GetVertex(vertex->indexA));\n\t\tb2Vec2 wBLocal;\n\t\tvertex->indexB = proxyB->GetSupport(b2MulT(transformB.q, d));\n\t\tvertex->wB = b2Mul(transformB, proxyB->GetVertex(vertex->indexB));\n\t\tvertex->w = vertex->wB - vertex->wA;\n\n\t\t// Iteration count is equated to the number of support point calls.\n\t\t++iter;\n\t\t++b2_gjkIters;\n\n\t\t// Check for duplicate support points. This is the main termination criteria.\n\t\tbool duplicate = false;\n\t\tfor (int32 i = 0; i < saveCount; ++i)\n\t\t{\n\t\t\tif (vertex->indexA == saveA[i] && vertex->indexB == saveB[i])\n\t\t\t{\n\t\t\t\tduplicate = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If we found a duplicate support point we must exit to avoid cycling.\n\t\tif (duplicate)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\n\t\t// New vertex is ok and needed.\n\t\t++simplex.m_count;\n\t}\n\n\tb2_gjkMaxIters = b2Max(b2_gjkMaxIters, iter);\n\n\t// Prepare output.\n\tsimplex.GetWitnessPoints(&output->pointA, &output->pointB);\n\toutput->distance = b2Distance(output->pointA, output->pointB);\n\toutput->iterations = iter;\n\n\t// Cache the simplex.\n\tsimplex.WriteCache(cache);\n\n\t// Apply radii if requested.\n\tif (input->useRadii)\n\t{\n\t\tfloat32 rA = proxyA->m_radius;\n\t\tfloat32 rB = proxyB->m_radius;\n\n\t\tif (output->distance > rA + rB && output->distance > b2_epsilon)\n\t\t{\n\t\t\t// Shapes are still no overlapped.\n\t\t\t// Move the witness points to the outer surface.\n\t\t\toutput->distance -= rA + rB;\n\t\t\tb2Vec2 normal = output->pointB - output->pointA;\n\t\t\tnormal.Normalize();\n\t\t\toutput->pointA += rA * normal;\n\t\t\toutput->pointB -= rB * normal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Shapes are overlapped when radii are considered.\n\t\t\t// Move the witness points to the middle.\n\t\t\tb2Vec2 p = 0.5f * (output->pointA + output->pointB);\n\t\t\toutput->pointA = p;\n\t\t\toutput->pointB = p;\n\t\t\toutput->distance = 0.0f;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2Distance.h",
    "content": "\n/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_DISTANCE_H\n#define B2_DISTANCE_H\n\n#include <Box2D/Common/b2Math.h>\n\nclass b2Shape;\n\n/// A distance proxy is used by the GJK algorithm.\n/// It encapsulates any shape.\nstruct b2DistanceProxy\n{\n\tb2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {}\n\n\t/// Initialize the proxy using the given shape. The shape\n\t/// must remain in scope while the proxy is in use.\n\tvoid Set(const b2Shape* shape, int32 index);\n\n\t/// Get the supporting vertex index in the given direction.\n\tint32 GetSupport(const b2Vec2& d) const;\n\n\t/// Get the supporting vertex in the given direction.\n\tconst b2Vec2& GetSupportVertex(const b2Vec2& d) const;\n\n\t/// Get the vertex count.\n\tint32 GetVertexCount() const;\n\n\t/// Get a vertex by index. Used by b2Distance.\n\tconst b2Vec2& GetVertex(int32 index) const;\n\n\tb2Vec2 m_buffer[2];\n\tconst b2Vec2* m_vertices;\n\tint32 m_count;\n\tfloat32 m_radius;\n};\n\n/// Used to warm start b2Distance.\n/// Set count to zero on first call.\nstruct b2SimplexCache\n{\n\tfloat32 metric;\t\t///< length or area\n\tuint16 count;\n\tuint8 indexA[3];\t///< vertices on shape A\n\tuint8 indexB[3];\t///< vertices on shape B\n};\n\n/// Input for b2Distance.\n/// You have to option to use the shape radii\n/// in the computation. Even \nstruct b2DistanceInput\n{\n\tb2DistanceProxy proxyA;\n\tb2DistanceProxy proxyB;\n\tb2Transform transformA;\n\tb2Transform transformB;\n\tbool useRadii;\n};\n\n/// Output for b2Distance.\nstruct b2DistanceOutput\n{\n\tb2Vec2 pointA;\t\t///< closest point on shapeA\n\tb2Vec2 pointB;\t\t///< closest point on shapeB\n\tfloat32 distance;\n\tint32 iterations;\t///< number of GJK iterations used\n};\n\n/// Compute the closest points between two shapes. Supports any combination of:\n/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output.\n/// On the first call set b2SimplexCache.count to zero.\nvoid b2Distance(b2DistanceOutput* output,\n\t\t\t\tb2SimplexCache* cache, \n\t\t\t\tconst b2DistanceInput* input);\n\n\n//////////////////////////////////////////////////////////////////////////\n\ninline int32 b2DistanceProxy::GetVertexCount() const\n{\n\treturn m_count;\n}\n\ninline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const\n{\n\tb2Assert(0 <= index && index < m_count);\n\treturn m_vertices[index];\n}\n\ninline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const\n{\n\tint32 bestIndex = 0;\n\tfloat32 bestValue = b2Dot(m_vertices[0], d);\n\tfor (int32 i = 1; i < m_count; ++i)\n\t{\n\t\tfloat32 value = b2Dot(m_vertices[i], d);\n\t\tif (value > bestValue)\n\t\t{\n\t\t\tbestIndex = i;\n\t\t\tbestValue = value;\n\t\t}\n\t}\n\n\treturn bestIndex;\n}\n\ninline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const\n{\n\tint32 bestIndex = 0;\n\tfloat32 bestValue = b2Dot(m_vertices[0], d);\n\tfor (int32 i = 1; i < m_count; ++i)\n\t{\n\t\tfloat32 value = b2Dot(m_vertices[i], d);\n\t\tif (value > bestValue)\n\t\t{\n\t\t\tbestIndex = i;\n\t\t\tbestValue = value;\n\t\t}\n\t}\n\n\treturn m_vertices[bestIndex];\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2DynamicTree.cpp",
    "content": "/*\n* Copyright (c) 2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2DynamicTree.h>\n#include <memory.h>\n#include <string.h>\n\nb2DynamicTree::b2DynamicTree()\n{\n\tm_root = b2_nullNode;\n\n\tm_nodeCapacity = 16;\n\tm_nodeCount = 0;\n\tm_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));\n\tmemset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode));\n\n\t// Build a linked list for the free list.\n\tfor (int32 i = 0; i < m_nodeCapacity - 1; ++i)\n\t{\n\t\tm_nodes[i].next = i + 1;\n\t\tm_nodes[i].height = -1;\n\t}\n\tm_nodes[m_nodeCapacity-1].next = b2_nullNode;\n\tm_nodes[m_nodeCapacity-1].height = -1;\n\tm_freeList = 0;\n\n\tm_path = 0;\n\n\tm_insertionCount = 0;\n}\n\nb2DynamicTree::~b2DynamicTree()\n{\n\t// This frees the entire tree in one shot.\n\tb2Free(m_nodes);\n}\n\n// Allocate a node from the pool. Grow the pool if necessary.\nint32 b2DynamicTree::AllocateNode()\n{\n\t// Expand the node pool as needed.\n\tif (m_freeList == b2_nullNode)\n\t{\n\t\tb2Assert(m_nodeCount == m_nodeCapacity);\n\n\t\t// The free list is empty. Rebuild a bigger pool.\n\t\tb2TreeNode* oldNodes = m_nodes;\n\t\tm_nodeCapacity *= 2;\n\t\tm_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));\n\t\tmemcpy(m_nodes, oldNodes, m_nodeCount * sizeof(b2TreeNode));\n\t\tb2Free(oldNodes);\n\n\t\t// Build a linked list for the free list. The parent\n\t\t// pointer becomes the \"next\" pointer.\n\t\tfor (int32 i = m_nodeCount; i < m_nodeCapacity - 1; ++i)\n\t\t{\n\t\t\tm_nodes[i].next = i + 1;\n\t\t\tm_nodes[i].height = -1;\n\t\t}\n\t\tm_nodes[m_nodeCapacity-1].next = b2_nullNode;\n\t\tm_nodes[m_nodeCapacity-1].height = -1;\n\t\tm_freeList = m_nodeCount;\n\t}\n\n\t// Peel a node off the free list.\n\tint32 nodeId = m_freeList;\n\tm_freeList = m_nodes[nodeId].next;\n\tm_nodes[nodeId].parent = b2_nullNode;\n\tm_nodes[nodeId].child1 = b2_nullNode;\n\tm_nodes[nodeId].child2 = b2_nullNode;\n\tm_nodes[nodeId].height = 0;\n\tm_nodes[nodeId].userData = NULL;\n\t++m_nodeCount;\n\treturn nodeId;\n}\n\n// Return a node to the pool.\nvoid b2DynamicTree::FreeNode(int32 nodeId)\n{\n\tb2Assert(0 <= nodeId && nodeId < m_nodeCapacity);\n\tb2Assert(0 < m_nodeCount);\n\tm_nodes[nodeId].next = m_freeList;\n\tm_nodes[nodeId].height = -1;\n\tm_freeList = nodeId;\n\t--m_nodeCount;\n}\n\n// Create a proxy in the tree as a leaf node. We return the index\n// of the node instead of a pointer so that we can grow\n// the node pool.\nint32 b2DynamicTree::CreateProxy(const b2AABB& aabb, void* userData)\n{\n\tint32 proxyId = AllocateNode();\n\n\t// Fatten the aabb.\n\tb2Vec2 r(b2_aabbExtension, b2_aabbExtension);\n\tm_nodes[proxyId].aabb.lowerBound = aabb.lowerBound - r;\n\tm_nodes[proxyId].aabb.upperBound = aabb.upperBound + r;\n\tm_nodes[proxyId].userData = userData;\n\tm_nodes[proxyId].height = 0;\n\n\tInsertLeaf(proxyId);\n\n\treturn proxyId;\n}\n\nvoid b2DynamicTree::DestroyProxy(int32 proxyId)\n{\n\tb2Assert(0 <= proxyId && proxyId < m_nodeCapacity);\n\tb2Assert(m_nodes[proxyId].IsLeaf());\n\n\tRemoveLeaf(proxyId);\n\tFreeNode(proxyId);\n}\n\nbool b2DynamicTree::MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement)\n{\n\tb2Assert(0 <= proxyId && proxyId < m_nodeCapacity);\n\n\tb2Assert(m_nodes[proxyId].IsLeaf());\n\n\tif (m_nodes[proxyId].aabb.Contains(aabb))\n\t{\n\t\treturn false;\n\t}\n\n\tRemoveLeaf(proxyId);\n\n\t// Extend AABB.\n\tb2AABB b = aabb;\n\tb2Vec2 r(b2_aabbExtension, b2_aabbExtension);\n\tb.lowerBound = b.lowerBound - r;\n\tb.upperBound = b.upperBound + r;\n\n\t// Predict AABB displacement.\n\tb2Vec2 d = b2_aabbMultiplier * displacement;\n\n\tif (d.x < 0.0f)\n\t{\n\t\tb.lowerBound.x += d.x;\n\t}\n\telse\n\t{\n\t\tb.upperBound.x += d.x;\n\t}\n\n\tif (d.y < 0.0f)\n\t{\n\t\tb.lowerBound.y += d.y;\n\t}\n\telse\n\t{\n\t\tb.upperBound.y += d.y;\n\t}\n\n\tm_nodes[proxyId].aabb = b;\n\n\tInsertLeaf(proxyId);\n\treturn true;\n}\n\nvoid b2DynamicTree::InsertLeaf(int32 leaf)\n{\n\t++m_insertionCount;\n\n\tif (m_root == b2_nullNode)\n\t{\n\t\tm_root = leaf;\n\t\tm_nodes[m_root].parent = b2_nullNode;\n\t\treturn;\n\t}\n\n\t// Find the best sibling for this node\n\tb2AABB leafAABB = m_nodes[leaf].aabb;\n\tint32 index = m_root;\n\twhile (m_nodes[index].IsLeaf() == false)\n\t{\n\t\tint32 child1 = m_nodes[index].child1;\n\t\tint32 child2 = m_nodes[index].child2;\n\n\t\tfloat32 area = m_nodes[index].aabb.GetPerimeter();\n\n\t\tb2AABB combinedAABB;\n\t\tcombinedAABB.Combine(m_nodes[index].aabb, leafAABB);\n\t\tfloat32 combinedArea = combinedAABB.GetPerimeter();\n\n\t\t// Cost of creating a new parent for this node and the new leaf\n\t\tfloat32 cost = 2.0f * combinedArea;\n\n\t\t// Minimum cost of pushing the leaf further down the tree\n\t\tfloat32 inheritanceCost = 2.0f * (combinedArea - area);\n\n\t\t// Cost of descending into child1\n\t\tfloat32 cost1;\n\t\tif (m_nodes[child1].IsLeaf())\n\t\t{\n\t\t\tb2AABB aabb;\n\t\t\taabb.Combine(leafAABB, m_nodes[child1].aabb);\n\t\t\tcost1 = aabb.GetPerimeter() + inheritanceCost;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb2AABB aabb;\n\t\t\taabb.Combine(leafAABB, m_nodes[child1].aabb);\n\t\t\tfloat32 oldArea = m_nodes[child1].aabb.GetPerimeter();\n\t\t\tfloat32 newArea = aabb.GetPerimeter();\n\t\t\tcost1 = (newArea - oldArea) + inheritanceCost;\n\t\t}\n\n\t\t// Cost of descending into child2\n\t\tfloat32 cost2;\n\t\tif (m_nodes[child2].IsLeaf())\n\t\t{\n\t\t\tb2AABB aabb;\n\t\t\taabb.Combine(leafAABB, m_nodes[child2].aabb);\n\t\t\tcost2 = aabb.GetPerimeter() + inheritanceCost;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tb2AABB aabb;\n\t\t\taabb.Combine(leafAABB, m_nodes[child2].aabb);\n\t\t\tfloat32 oldArea = m_nodes[child2].aabb.GetPerimeter();\n\t\t\tfloat32 newArea = aabb.GetPerimeter();\n\t\t\tcost2 = newArea - oldArea + inheritanceCost;\n\t\t}\n\n\t\t// Descend according to the minimum cost.\n\t\tif (cost < cost1 && cost < cost2)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\n\t\t// Descend\n\t\tif (cost1 < cost2)\n\t\t{\n\t\t\tindex = child1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tindex = child2;\n\t\t}\n\t}\n\n\tint32 sibling = index;\n\n\t// Create a new parent.\n\tint32 oldParent = m_nodes[sibling].parent;\n\tint32 newParent = AllocateNode();\n\tm_nodes[newParent].parent = oldParent;\n\tm_nodes[newParent].userData = NULL;\n\tm_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb);\n\tm_nodes[newParent].height = m_nodes[sibling].height + 1;\n\n\tif (oldParent != b2_nullNode)\n\t{\n\t\t// The sibling was not the root.\n\t\tif (m_nodes[oldParent].child1 == sibling)\n\t\t{\n\t\t\tm_nodes[oldParent].child1 = newParent;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_nodes[oldParent].child2 = newParent;\n\t\t}\n\n\t\tm_nodes[newParent].child1 = sibling;\n\t\tm_nodes[newParent].child2 = leaf;\n\t\tm_nodes[sibling].parent = newParent;\n\t\tm_nodes[leaf].parent = newParent;\n\t}\n\telse\n\t{\n\t\t// The sibling was the root.\n\t\tm_nodes[newParent].child1 = sibling;\n\t\tm_nodes[newParent].child2 = leaf;\n\t\tm_nodes[sibling].parent = newParent;\n\t\tm_nodes[leaf].parent = newParent;\n\t\tm_root = newParent;\n\t}\n\n\t// Walk back up the tree fixing heights and AABBs\n\tindex = m_nodes[leaf].parent;\n\twhile (index != b2_nullNode)\n\t{\n\t\tindex = Balance(index);\n\n\t\tint32 child1 = m_nodes[index].child1;\n\t\tint32 child2 = m_nodes[index].child2;\n\n\t\tb2Assert(child1 != b2_nullNode);\n\t\tb2Assert(child2 != b2_nullNode);\n\n\t\tm_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height);\n\t\tm_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb);\n\n\t\tindex = m_nodes[index].parent;\n\t}\n\n\t//Validate();\n}\n\nvoid b2DynamicTree::RemoveLeaf(int32 leaf)\n{\n\tif (leaf == m_root)\n\t{\n\t\tm_root = b2_nullNode;\n\t\treturn;\n\t}\n\n\tint32 parent = m_nodes[leaf].parent;\n\tint32 grandParent = m_nodes[parent].parent;\n\tint32 sibling;\n\tif (m_nodes[parent].child1 == leaf)\n\t{\n\t\tsibling = m_nodes[parent].child2;\n\t}\n\telse\n\t{\n\t\tsibling = m_nodes[parent].child1;\n\t}\n\n\tif (grandParent != b2_nullNode)\n\t{\n\t\t// Destroy parent and connect sibling to grandParent.\n\t\tif (m_nodes[grandParent].child1 == parent)\n\t\t{\n\t\t\tm_nodes[grandParent].child1 = sibling;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_nodes[grandParent].child2 = sibling;\n\t\t}\n\t\tm_nodes[sibling].parent = grandParent;\n\t\tFreeNode(parent);\n\n\t\t// Adjust ancestor bounds.\n\t\tint32 index = grandParent;\n\t\twhile (index != b2_nullNode)\n\t\t{\n\t\t\tindex = Balance(index);\n\n\t\t\tint32 child1 = m_nodes[index].child1;\n\t\t\tint32 child2 = m_nodes[index].child2;\n\n\t\t\tm_nodes[index].aabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb);\n\t\t\tm_nodes[index].height = 1 + b2Max(m_nodes[child1].height, m_nodes[child2].height);\n\n\t\t\tindex = m_nodes[index].parent;\n\t\t}\n\t}\n\telse\n\t{\n\t\tm_root = sibling;\n\t\tm_nodes[sibling].parent = b2_nullNode;\n\t\tFreeNode(parent);\n\t}\n\n\t//Validate();\n}\n\n// Perform a left or right rotation if node A is imbalanced.\n// Returns the new root index.\nint32 b2DynamicTree::Balance(int32 iA)\n{\n\tb2Assert(iA != b2_nullNode);\n\n\tb2TreeNode* A = m_nodes + iA;\n\tif (A->IsLeaf() || A->height < 2)\n\t{\n\t\treturn iA;\n\t}\n\n\tint32 iB = A->child1;\n\tint32 iC = A->child2;\n\tb2Assert(0 <= iB && iB < m_nodeCapacity);\n\tb2Assert(0 <= iC && iC < m_nodeCapacity);\n\n\tb2TreeNode* B = m_nodes + iB;\n\tb2TreeNode* C = m_nodes + iC;\n\n\tint32 balance = C->height - B->height;\n\n\t// Rotate C up\n\tif (balance > 1)\n\t{\n\t\tint32 iF = C->child1;\n\t\tint32 iG = C->child2;\n\t\tb2TreeNode* F = m_nodes + iF;\n\t\tb2TreeNode* G = m_nodes + iG;\n\t\tb2Assert(0 <= iF && iF < m_nodeCapacity);\n\t\tb2Assert(0 <= iG && iG < m_nodeCapacity);\n\n\t\t// Swap A and C\n\t\tC->child1 = iA;\n\t\tC->parent = A->parent;\n\t\tA->parent = iC;\n\n\t\t// A's old parent should point to C\n\t\tif (C->parent != b2_nullNode)\n\t\t{\n\t\t\tif (m_nodes[C->parent].child1 == iA)\n\t\t\t{\n\t\t\t\tm_nodes[C->parent].child1 = iC;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb2Assert(m_nodes[C->parent].child2 == iA);\n\t\t\t\tm_nodes[C->parent].child2 = iC;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_root = iC;\n\t\t}\n\n\t\t// Rotate\n\t\tif (F->height > G->height)\n\t\t{\n\t\t\tC->child2 = iF;\n\t\t\tA->child2 = iG;\n\t\t\tG->parent = iA;\n\t\t\tA->aabb.Combine(B->aabb, G->aabb);\n\t\t\tC->aabb.Combine(A->aabb, F->aabb);\n\n\t\t\tA->height = 1 + b2Max(B->height, G->height);\n\t\t\tC->height = 1 + b2Max(A->height, F->height);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tC->child2 = iG;\n\t\t\tA->child2 = iF;\n\t\t\tF->parent = iA;\n\t\t\tA->aabb.Combine(B->aabb, F->aabb);\n\t\t\tC->aabb.Combine(A->aabb, G->aabb);\n\n\t\t\tA->height = 1 + b2Max(B->height, F->height);\n\t\t\tC->height = 1 + b2Max(A->height, G->height);\n\t\t}\n\n\t\treturn iC;\n\t}\n\t\n\t// Rotate B up\n\tif (balance < -1)\n\t{\n\t\tint32 iD = B->child1;\n\t\tint32 iE = B->child2;\n\t\tb2TreeNode* D = m_nodes + iD;\n\t\tb2TreeNode* E = m_nodes + iE;\n\t\tb2Assert(0 <= iD && iD < m_nodeCapacity);\n\t\tb2Assert(0 <= iE && iE < m_nodeCapacity);\n\n\t\t// Swap A and B\n\t\tB->child1 = iA;\n\t\tB->parent = A->parent;\n\t\tA->parent = iB;\n\n\t\t// A's old parent should point to B\n\t\tif (B->parent != b2_nullNode)\n\t\t{\n\t\t\tif (m_nodes[B->parent].child1 == iA)\n\t\t\t{\n\t\t\t\tm_nodes[B->parent].child1 = iB;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb2Assert(m_nodes[B->parent].child2 == iA);\n\t\t\t\tm_nodes[B->parent].child2 = iB;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_root = iB;\n\t\t}\n\n\t\t// Rotate\n\t\tif (D->height > E->height)\n\t\t{\n\t\t\tB->child2 = iD;\n\t\t\tA->child1 = iE;\n\t\t\tE->parent = iA;\n\t\t\tA->aabb.Combine(C->aabb, E->aabb);\n\t\t\tB->aabb.Combine(A->aabb, D->aabb);\n\n\t\t\tA->height = 1 + b2Max(C->height, E->height);\n\t\t\tB->height = 1 + b2Max(A->height, D->height);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tB->child2 = iE;\n\t\t\tA->child1 = iD;\n\t\t\tD->parent = iA;\n\t\t\tA->aabb.Combine(C->aabb, D->aabb);\n\t\t\tB->aabb.Combine(A->aabb, E->aabb);\n\n\t\t\tA->height = 1 + b2Max(C->height, D->height);\n\t\t\tB->height = 1 + b2Max(A->height, E->height);\n\t\t}\n\n\t\treturn iB;\n\t}\n\n\treturn iA;\n}\n\nint32 b2DynamicTree::GetHeight() const\n{\n\tif (m_root == b2_nullNode)\n\t{\n\t\treturn 0;\n\t}\n\n\treturn m_nodes[m_root].height;\n}\n\n//\nfloat32 b2DynamicTree::GetAreaRatio() const\n{\n\tif (m_root == b2_nullNode)\n\t{\n\t\treturn 0.0f;\n\t}\n\n\tconst b2TreeNode* root = m_nodes + m_root;\n\tfloat32 rootArea = root->aabb.GetPerimeter();\n\n\tfloat32 totalArea = 0.0f;\n\tfor (int32 i = 0; i < m_nodeCapacity; ++i)\n\t{\n\t\tconst b2TreeNode* node = m_nodes + i;\n\t\tif (node->height < 0)\n\t\t{\n\t\t\t// Free node in pool\n\t\t\tcontinue;\n\t\t}\n\n\t\ttotalArea += node->aabb.GetPerimeter();\n\t}\n\n\treturn totalArea / rootArea;\n}\n\n// Compute the height of a sub-tree.\nint32 b2DynamicTree::ComputeHeight(int32 nodeId) const\n{\n\tb2Assert(0 <= nodeId && nodeId < m_nodeCapacity);\n\tb2TreeNode* node = m_nodes + nodeId;\n\n\tif (node->IsLeaf())\n\t{\n\t\treturn 0;\n\t}\n\n\tint32 height1 = ComputeHeight(node->child1);\n\tint32 height2 = ComputeHeight(node->child2);\n\treturn 1 + b2Max(height1, height2);\n}\n\nint32 b2DynamicTree::ComputeHeight() const\n{\n\tint32 height = ComputeHeight(m_root);\n\treturn height;\n}\n\nvoid b2DynamicTree::ValidateStructure(int32 index) const\n{\n\tif (index == b2_nullNode)\n\t{\n\t\treturn;\n\t}\n\n\tif (index == m_root)\n\t{\n\t\tb2Assert(m_nodes[index].parent == b2_nullNode);\n\t}\n\n\tconst b2TreeNode* node = m_nodes + index;\n\n\tint32 child1 = node->child1;\n\tint32 child2 = node->child2;\n\n\tif (node->IsLeaf())\n\t{\n\t\tb2Assert(child1 == b2_nullNode);\n\t\tb2Assert(child2 == b2_nullNode);\n\t\tb2Assert(node->height == 0);\n\t\treturn;\n\t}\n\n\tb2Assert(0 <= child1 && child1 < m_nodeCapacity);\n\tb2Assert(0 <= child2 && child2 < m_nodeCapacity);\n\n\tb2Assert(m_nodes[child1].parent == index);\n\tb2Assert(m_nodes[child2].parent == index);\n\n\tValidateStructure(child1);\n\tValidateStructure(child2);\n}\n\nvoid b2DynamicTree::ValidateMetrics(int32 index) const\n{\n\tif (index == b2_nullNode)\n\t{\n\t\treturn;\n\t}\n\n\tconst b2TreeNode* node = m_nodes + index;\n\n\tint32 child1 = node->child1;\n\tint32 child2 = node->child2;\n\n\tif (node->IsLeaf())\n\t{\n\t\tb2Assert(child1 == b2_nullNode);\n\t\tb2Assert(child2 == b2_nullNode);\n\t\tb2Assert(node->height == 0);\n\t\treturn;\n\t}\n\n\tb2Assert(0 <= child1 && child1 < m_nodeCapacity);\n\tb2Assert(0 <= child2 && child2 < m_nodeCapacity);\n\n\tint32 height1 = m_nodes[child1].height;\n\tint32 height2 = m_nodes[child2].height;\n\tint32 height;\n\theight = 1 + b2Max(height1, height2);\n\tb2Assert(node->height == height);\n\n\tb2AABB aabb;\n\taabb.Combine(m_nodes[child1].aabb, m_nodes[child2].aabb);\n\n\tb2Assert(aabb.lowerBound == node->aabb.lowerBound);\n\tb2Assert(aabb.upperBound == node->aabb.upperBound);\n\n\tValidateMetrics(child1);\n\tValidateMetrics(child2);\n}\n\nvoid b2DynamicTree::Validate() const\n{\n\tValidateStructure(m_root);\n\tValidateMetrics(m_root);\n\n\tint32 freeCount = 0;\n\tint32 freeIndex = m_freeList;\n\twhile (freeIndex != b2_nullNode)\n\t{\n\t\tb2Assert(0 <= freeIndex && freeIndex < m_nodeCapacity);\n\t\tfreeIndex = m_nodes[freeIndex].next;\n\t\t++freeCount;\n\t}\n\n\tb2Assert(GetHeight() == ComputeHeight());\n\n\tb2Assert(m_nodeCount + freeCount == m_nodeCapacity);\n}\n\nint32 b2DynamicTree::GetMaxBalance() const\n{\n\tint32 maxBalance = 0;\n\tfor (int32 i = 0; i < m_nodeCapacity; ++i)\n\t{\n\t\tconst b2TreeNode* node = m_nodes + i;\n\t\tif (node->height <= 1)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tb2Assert(node->IsLeaf() == false);\n\n\t\tint32 child1 = node->child1;\n\t\tint32 child2 = node->child2;\n\t\tint32 balance = b2Abs(m_nodes[child2].height - m_nodes[child1].height);\n\t\tmaxBalance = b2Max(maxBalance, balance);\n\t}\n\n\treturn maxBalance;\n}\n\nvoid b2DynamicTree::RebuildBottomUp()\n{\n\tint32* nodes = (int32*)b2Alloc(m_nodeCount * sizeof(int32));\n\tint32 count = 0;\n\n\t// Build array of leaves. Free the rest.\n\tfor (int32 i = 0; i < m_nodeCapacity; ++i)\n\t{\n\t\tif (m_nodes[i].height < 0)\n\t\t{\n\t\t\t// free node in pool\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (m_nodes[i].IsLeaf())\n\t\t{\n\t\t\tm_nodes[i].parent = b2_nullNode;\n\t\t\tnodes[count] = i;\n\t\t\t++count;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFreeNode(i);\n\t\t}\n\t}\n\n\twhile (count > 1)\n\t{\n\t\tfloat32 minCost = b2_maxFloat;\n\t\tint32 iMin = -1, jMin = -1;\n\t\tfor (int32 i = 0; i < count; ++i)\n\t\t{\n\t\t\tb2AABB aabbi = m_nodes[nodes[i]].aabb;\n\n\t\t\tfor (int32 j = i + 1; j < count; ++j)\n\t\t\t{\n\t\t\t\tb2AABB aabbj = m_nodes[nodes[j]].aabb;\n\t\t\t\tb2AABB b;\n\t\t\t\tb.Combine(aabbi, aabbj);\n\t\t\t\tfloat32 cost = b.GetPerimeter();\n\t\t\t\tif (cost < minCost)\n\t\t\t\t{\n\t\t\t\t\tiMin = i;\n\t\t\t\t\tjMin = j;\n\t\t\t\t\tminCost = cost;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint32 index1 = nodes[iMin];\n\t\tint32 index2 = nodes[jMin];\n\t\tb2TreeNode* child1 = m_nodes + index1;\n\t\tb2TreeNode* child2 = m_nodes + index2;\n\n\t\tint32 parentIndex = AllocateNode();\n\t\tb2TreeNode* parent = m_nodes + parentIndex;\n\t\tparent->child1 = index1;\n\t\tparent->child2 = index2;\n\t\tparent->height = 1 + b2Max(child1->height, child2->height);\n\t\tparent->aabb.Combine(child1->aabb, child2->aabb);\n\t\tparent->parent = b2_nullNode;\n\n\t\tchild1->parent = parentIndex;\n\t\tchild2->parent = parentIndex;\n\n\t\tnodes[jMin] = nodes[count-1];\n\t\tnodes[iMin] = parentIndex;\n\t\t--count;\n\t}\n\n\tm_root = nodes[0];\n\tb2Free(nodes);\n\n\tValidate();\n}\n\nvoid b2DynamicTree::ShiftOrigin(const b2Vec2& newOrigin)\n{\n\t// Build array of leaves. Free the rest.\n\tfor (int32 i = 0; i < m_nodeCapacity; ++i)\n\t{\n\t\tm_nodes[i].aabb.lowerBound -= newOrigin;\n\t\tm_nodes[i].aabb.upperBound -= newOrigin;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2DynamicTree.h",
    "content": "/*\n* Copyright (c) 2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_DYNAMIC_TREE_H\n#define B2_DYNAMIC_TREE_H\n\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Common/b2GrowableStack.h>\n\n#define b2_nullNode (-1)\n\n/// A node in the dynamic tree. The client does not interact with this directly.\nstruct b2TreeNode\n{\n\tbool IsLeaf() const\n\t{\n\t\treturn child1 == b2_nullNode;\n\t}\n\n\t/// Enlarged AABB\n\tb2AABB aabb;\n\n\tvoid* userData;\n\n\tunion\n\t{\n\t\tint32 parent;\n\t\tint32 next;\n\t};\n\n\tint32 child1;\n\tint32 child2;\n\n\t// leaf = 0, free node = -1\n\tint32 height;\n};\n\n/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt.\n/// A dynamic tree arranges data in a binary tree to accelerate\n/// queries such as volume queries and ray casts. Leafs are proxies\n/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor\n/// so that the proxy AABB is bigger than the client object. This allows the client\n/// object to move by small amounts without triggering a tree update.\n///\n/// Nodes are pooled and relocatable, so we use node indices rather than pointers.\nclass b2DynamicTree\n{\npublic:\n\t/// Constructing the tree initializes the node pool.\n\tb2DynamicTree();\n\n\t/// Destroy the tree, freeing the node pool.\n\t~b2DynamicTree();\n\n\t/// Create a proxy. Provide a tight fitting AABB and a userData pointer.\n\tint32 CreateProxy(const b2AABB& aabb, void* userData);\n\n\t/// Destroy a proxy. This asserts if the id is invalid.\n\tvoid DestroyProxy(int32 proxyId);\n\n\t/// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB,\n\t/// then the proxy is removed from the tree and re-inserted. Otherwise\n\t/// the function returns immediately.\n\t/// @return true if the proxy was re-inserted.\n\tbool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement);\n\n\t/// Get proxy user data.\n\t/// @return the proxy user data or 0 if the id is invalid.\n\tvoid* GetUserData(int32 proxyId) const;\n\n\t/// Get the fat AABB for a proxy.\n\tconst b2AABB& GetFatAABB(int32 proxyId) const;\n\n\t/// Query an AABB for overlapping proxies. The callback class\n\t/// is called for each proxy that overlaps the supplied AABB.\n\ttemplate <typename T>\n\tvoid Query(T* callback, const b2AABB& aabb) const;\n\n\t/// Ray-cast against the proxies in the tree. This relies on the callback\n\t/// to perform a exact ray-cast in the case were the proxy contains a shape.\n\t/// The callback also performs the any collision filtering. This has performance\n\t/// roughly equal to k * log(n), where k is the number of collisions and n is the\n\t/// number of proxies in the tree.\n\t/// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).\n\t/// @param callback a callback class that is called for each proxy that is hit by the ray.\n\ttemplate <typename T>\n\tvoid RayCast(T* callback, const b2RayCastInput& input) const;\n\n\t/// Validate this tree. For testing.\n\tvoid Validate() const;\n\n\t/// Compute the height of the binary tree in O(N) time. Should not be\n\t/// called often.\n\tint32 GetHeight() const;\n\n\t/// Get the maximum balance of an node in the tree. The balance is the difference\n\t/// in height of the two children of a node.\n\tint32 GetMaxBalance() const;\n\n\t/// Get the ratio of the sum of the node areas to the root area.\n\tfloat32 GetAreaRatio() const;\n\n\t/// Build an optimal tree. Very expensive. For testing.\n\tvoid RebuildBottomUp();\n\n\t/// Shift the world origin. Useful for large worlds.\n\t/// The shift formula is: position -= newOrigin\n\t/// @param newOrigin the new origin with respect to the old origin\n\tvoid ShiftOrigin(const b2Vec2& newOrigin);\n\nprivate:\n\n\tint32 AllocateNode();\n\tvoid FreeNode(int32 node);\n\n\tvoid InsertLeaf(int32 node);\n\tvoid RemoveLeaf(int32 node);\n\n\tint32 Balance(int32 index);\n\n\tint32 ComputeHeight() const;\n\tint32 ComputeHeight(int32 nodeId) const;\n\n\tvoid ValidateStructure(int32 index) const;\n\tvoid ValidateMetrics(int32 index) const;\n\n\tint32 m_root;\n\n\tb2TreeNode* m_nodes;\n\tint32 m_nodeCount;\n\tint32 m_nodeCapacity;\n\n\tint32 m_freeList;\n\n\t/// This is used to incrementally traverse the tree for re-balancing.\n\tuint32 m_path;\n\n\tint32 m_insertionCount;\n};\n\ninline void* b2DynamicTree::GetUserData(int32 proxyId) const\n{\n\tb2Assert(0 <= proxyId && proxyId < m_nodeCapacity);\n\treturn m_nodes[proxyId].userData;\n}\n\ninline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const\n{\n\tb2Assert(0 <= proxyId && proxyId < m_nodeCapacity);\n\treturn m_nodes[proxyId].aabb;\n}\n\ntemplate <typename T>\ninline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const\n{\n\tb2GrowableStack<int32, 256> stack;\n\tstack.Push(m_root);\n\n\twhile (stack.GetCount() > 0)\n\t{\n\t\tint32 nodeId = stack.Pop();\n\t\tif (nodeId == b2_nullNode)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst b2TreeNode* node = m_nodes + nodeId;\n\n\t\tif (b2TestOverlap(node->aabb, aabb))\n\t\t{\n\t\t\tif (node->IsLeaf())\n\t\t\t{\n\t\t\t\tbool proceed = callback->QueryCallback(nodeId);\n\t\t\t\tif (proceed == false)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstack.Push(node->child1);\n\t\t\t\tstack.Push(node->child2);\n\t\t\t}\n\t\t}\n\t}\n}\n\ntemplate <typename T>\ninline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const\n{\n\tb2Vec2 p1 = input.p1;\n\tb2Vec2 p2 = input.p2;\n\tb2Vec2 r = p2 - p1;\n\tb2Assert(r.LengthSquared() > 0.0f);\n\tr.Normalize();\n\n\t// v is perpendicular to the segment.\n\tb2Vec2 v = b2Cross(1.0f, r);\n\tb2Vec2 abs_v = b2Abs(v);\n\n\t// Separating axis for segment (Gino, p80).\n\t// |dot(v, p1 - c)| > dot(|v|, h)\n\n\tfloat32 maxFraction = input.maxFraction;\n\n\t// Build a bounding box for the segment.\n\tb2AABB segmentAABB;\n\t{\n\t\tb2Vec2 t = p1 + maxFraction * (p2 - p1);\n\t\tsegmentAABB.lowerBound = b2Min(p1, t);\n\t\tsegmentAABB.upperBound = b2Max(p1, t);\n\t}\n\n\tb2GrowableStack<int32, 256> stack;\n\tstack.Push(m_root);\n\n\twhile (stack.GetCount() > 0)\n\t{\n\t\tint32 nodeId = stack.Pop();\n\t\tif (nodeId == b2_nullNode)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst b2TreeNode* node = m_nodes + nodeId;\n\n\t\tif (b2TestOverlap(node->aabb, segmentAABB) == false)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Separating axis for segment (Gino, p80).\n\t\t// |dot(v, p1 - c)| > dot(|v|, h)\n\t\tb2Vec2 c = node->aabb.GetCenter();\n\t\tb2Vec2 h = node->aabb.GetExtents();\n\t\tfloat32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h);\n\t\tif (separation > 0.0f)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (node->IsLeaf())\n\t\t{\n\t\t\tb2RayCastInput subInput;\n\t\t\tsubInput.p1 = input.p1;\n\t\t\tsubInput.p2 = input.p2;\n\t\t\tsubInput.maxFraction = maxFraction;\n\n\t\t\tfloat32 value = callback->RayCastCallback(subInput, nodeId);\n\n\t\t\tif (value == 0.0f)\n\t\t\t{\n\t\t\t\t// The client has terminated the ray cast.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (value > 0.0f)\n\t\t\t{\n\t\t\t\t// Update segment bounding box.\n\t\t\t\tmaxFraction = value;\n\t\t\t\tb2Vec2 t = p1 + maxFraction * (p2 - p1);\n\t\t\t\tsegmentAABB.lowerBound = b2Min(p1, t);\n\t\t\t\tsegmentAABB.upperBound = b2Max(p1, t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstack.Push(node->child1);\n\t\t\tstack.Push(node->child2);\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2TimeOfImpact.cpp",
    "content": "/*\n* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/b2Distance.h>\n#include <Box2D/Collision/b2TimeOfImpact.h>\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n#include <Box2D/Common/b2Timer.h>\n\n#include <stdio.h>\n\nfloat32 b2_toiTime, b2_toiMaxTime;\nint32 b2_toiCalls, b2_toiIters, b2_toiMaxIters;\nint32 b2_toiRootIters, b2_toiMaxRootIters;\n\n//\nstruct b2SeparationFunction\n{\n\tenum Type\n\t{\n\t\te_points,\n\t\te_faceA,\n\t\te_faceB\n\t};\n\n\t// TODO_ERIN might not need to return the separation\n\n\tfloat32 Initialize(const b2SimplexCache* cache,\n\t\tconst b2DistanceProxy* proxyA, const b2Sweep& sweepA,\n\t\tconst b2DistanceProxy* proxyB, const b2Sweep& sweepB,\n\t\tfloat32 t1)\n\t{\n\t\tm_proxyA = proxyA;\n\t\tm_proxyB = proxyB;\n\t\tint32 count = cache->count;\n\t\tb2Assert(0 < count && count < 3);\n\n\t\tm_sweepA = sweepA;\n\t\tm_sweepB = sweepB;\n\n\t\tb2Transform xfA, xfB;\n\t\tm_sweepA.GetTransform(&xfA, t1);\n\t\tm_sweepB.GetTransform(&xfB, t1);\n\n\t\tif (count == 1)\n\t\t{\n\t\t\tm_type = e_points;\n\t\t\tb2Vec2 localPointA = m_proxyA->GetVertex(cache->indexA[0]);\n\t\t\tb2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]);\n\t\t\tb2Vec2 pointA = b2Mul(xfA, localPointA);\n\t\t\tb2Vec2 pointB = b2Mul(xfB, localPointB);\n\t\t\tm_axis = pointB - pointA;\n\t\t\tfloat32 s = m_axis.Normalize();\n\t\t\treturn s;\n\t\t}\n\t\telse if (cache->indexA[0] == cache->indexA[1])\n\t\t{\n\t\t\t// Two points on B and one on A.\n\t\t\tm_type = e_faceB;\n\t\t\tb2Vec2 localPointB1 = proxyB->GetVertex(cache->indexB[0]);\n\t\t\tb2Vec2 localPointB2 = proxyB->GetVertex(cache->indexB[1]);\n\n\t\t\tm_axis = b2Cross(localPointB2 - localPointB1, 1.0f);\n\t\t\tm_axis.Normalize();\n\t\t\tb2Vec2 normal = b2Mul(xfB.q, m_axis);\n\n\t\t\tm_localPoint = 0.5f * (localPointB1 + localPointB2);\n\t\t\tb2Vec2 pointB = b2Mul(xfB, m_localPoint);\n\n\t\t\tb2Vec2 localPointA = proxyA->GetVertex(cache->indexA[0]);\n\t\t\tb2Vec2 pointA = b2Mul(xfA, localPointA);\n\n\t\t\tfloat32 s = b2Dot(pointA - pointB, normal);\n\t\t\tif (s < 0.0f)\n\t\t\t{\n\t\t\t\tm_axis = -m_axis;\n\t\t\t\ts = -s;\n\t\t\t}\n\t\t\treturn s;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Two points on A and one or two points on B.\n\t\t\tm_type = e_faceA;\n\t\t\tb2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]);\n\t\t\tb2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]);\n\t\t\t\n\t\t\tm_axis = b2Cross(localPointA2 - localPointA1, 1.0f);\n\t\t\tm_axis.Normalize();\n\t\t\tb2Vec2 normal = b2Mul(xfA.q, m_axis);\n\n\t\t\tm_localPoint = 0.5f * (localPointA1 + localPointA2);\n\t\t\tb2Vec2 pointA = b2Mul(xfA, m_localPoint);\n\n\t\t\tb2Vec2 localPointB = m_proxyB->GetVertex(cache->indexB[0]);\n\t\t\tb2Vec2 pointB = b2Mul(xfB, localPointB);\n\n\t\t\tfloat32 s = b2Dot(pointB - pointA, normal);\n\t\t\tif (s < 0.0f)\n\t\t\t{\n\t\t\t\tm_axis = -m_axis;\n\t\t\t\ts = -s;\n\t\t\t}\n\t\t\treturn s;\n\t\t}\n\t}\n\n\t//\n\tfloat32 FindMinSeparation(int32* indexA, int32* indexB, float32 t) const\n\t{\n\t\tb2Transform xfA, xfB;\n\t\tm_sweepA.GetTransform(&xfA, t);\n\t\tm_sweepB.GetTransform(&xfB, t);\n\n\t\tswitch (m_type)\n\t\t{\n\t\tcase e_points:\n\t\t\t{\n\t\t\t\tb2Vec2 axisA = b2MulT(xfA.q,  m_axis);\n\t\t\t\tb2Vec2 axisB = b2MulT(xfB.q, -m_axis);\n\n\t\t\t\t*indexA = m_proxyA->GetSupport(axisA);\n\t\t\t\t*indexB = m_proxyB->GetSupport(axisB);\n\n\t\t\t\tb2Vec2 localPointA = m_proxyA->GetVertex(*indexA);\n\t\t\t\tb2Vec2 localPointB = m_proxyB->GetVertex(*indexB);\n\t\t\t\t\n\t\t\t\tb2Vec2 pointA = b2Mul(xfA, localPointA);\n\t\t\t\tb2Vec2 pointB = b2Mul(xfB, localPointB);\n\n\t\t\t\tfloat32 separation = b2Dot(pointB - pointA, m_axis);\n\t\t\t\treturn separation;\n\t\t\t}\n\n\t\tcase e_faceA:\n\t\t\t{\n\t\t\t\tb2Vec2 normal = b2Mul(xfA.q, m_axis);\n\t\t\t\tb2Vec2 pointA = b2Mul(xfA, m_localPoint);\n\n\t\t\t\tb2Vec2 axisB = b2MulT(xfB.q, -normal);\n\t\t\t\t\n\t\t\t\t*indexA = -1;\n\t\t\t\t*indexB = m_proxyB->GetSupport(axisB);\n\n\t\t\t\tb2Vec2 localPointB = m_proxyB->GetVertex(*indexB);\n\t\t\t\tb2Vec2 pointB = b2Mul(xfB, localPointB);\n\n\t\t\t\tfloat32 separation = b2Dot(pointB - pointA, normal);\n\t\t\t\treturn separation;\n\t\t\t}\n\n\t\tcase e_faceB:\n\t\t\t{\n\t\t\t\tb2Vec2 normal = b2Mul(xfB.q, m_axis);\n\t\t\t\tb2Vec2 pointB = b2Mul(xfB, m_localPoint);\n\n\t\t\t\tb2Vec2 axisA = b2MulT(xfA.q, -normal);\n\n\t\t\t\t*indexB = -1;\n\t\t\t\t*indexA = m_proxyA->GetSupport(axisA);\n\n\t\t\t\tb2Vec2 localPointA = m_proxyA->GetVertex(*indexA);\n\t\t\t\tb2Vec2 pointA = b2Mul(xfA, localPointA);\n\n\t\t\t\tfloat32 separation = b2Dot(pointA - pointB, normal);\n\t\t\t\treturn separation;\n\t\t\t}\n\n\t\tdefault:\n\t\t\tb2Assert(false);\n\t\t\t*indexA = -1;\n\t\t\t*indexB = -1;\n\t\t\treturn 0.0f;\n\t\t}\n\t}\n\n\t//\n\tfloat32 Evaluate(int32 indexA, int32 indexB, float32 t) const\n\t{\n\t\tb2Transform xfA, xfB;\n\t\tm_sweepA.GetTransform(&xfA, t);\n\t\tm_sweepB.GetTransform(&xfB, t);\n\n\t\tswitch (m_type)\n\t\t{\n\t\tcase e_points:\n\t\t\t{\n\t\t\t\tb2Vec2 localPointA = m_proxyA->GetVertex(indexA);\n\t\t\t\tb2Vec2 localPointB = m_proxyB->GetVertex(indexB);\n\n\t\t\t\tb2Vec2 pointA = b2Mul(xfA, localPointA);\n\t\t\t\tb2Vec2 pointB = b2Mul(xfB, localPointB);\n\t\t\t\tfloat32 separation = b2Dot(pointB - pointA, m_axis);\n\n\t\t\t\treturn separation;\n\t\t\t}\n\n\t\tcase e_faceA:\n\t\t\t{\n\t\t\t\tb2Vec2 normal = b2Mul(xfA.q, m_axis);\n\t\t\t\tb2Vec2 pointA = b2Mul(xfA, m_localPoint);\n\n\t\t\t\tb2Vec2 localPointB = m_proxyB->GetVertex(indexB);\n\t\t\t\tb2Vec2 pointB = b2Mul(xfB, localPointB);\n\n\t\t\t\tfloat32 separation = b2Dot(pointB - pointA, normal);\n\t\t\t\treturn separation;\n\t\t\t}\n\n\t\tcase e_faceB:\n\t\t\t{\n\t\t\t\tb2Vec2 normal = b2Mul(xfB.q, m_axis);\n\t\t\t\tb2Vec2 pointB = b2Mul(xfB, m_localPoint);\n\n\t\t\t\tb2Vec2 localPointA = m_proxyA->GetVertex(indexA);\n\t\t\t\tb2Vec2 pointA = b2Mul(xfA, localPointA);\n\n\t\t\t\tfloat32 separation = b2Dot(pointA - pointB, normal);\n\t\t\t\treturn separation;\n\t\t\t}\n\n\t\tdefault:\n\t\t\tb2Assert(false);\n\t\t\treturn 0.0f;\n\t\t}\n\t}\n\n\tconst b2DistanceProxy* m_proxyA;\n\tconst b2DistanceProxy* m_proxyB;\n\tb2Sweep m_sweepA, m_sweepB;\n\tType m_type;\n\tb2Vec2 m_localPoint;\n\tb2Vec2 m_axis;\n};\n\n// CCD via the local separating axis method. This seeks progression\n// by computing the largest time at which separation is maintained.\nvoid b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input)\n{\n\tb2Timer timer;\n\n\t++b2_toiCalls;\n\n\toutput->state = b2TOIOutput::e_unknown;\n\toutput->t = input->tMax;\n\n\tconst b2DistanceProxy* proxyA = &input->proxyA;\n\tconst b2DistanceProxy* proxyB = &input->proxyB;\n\n\tb2Sweep sweepA = input->sweepA;\n\tb2Sweep sweepB = input->sweepB;\n\n\t// Large rotations can make the root finder fail, so we normalize the\n\t// sweep angles.\n\tsweepA.Normalize();\n\tsweepB.Normalize();\n\n\tfloat32 tMax = input->tMax;\n\n\tfloat32 totalRadius = proxyA->m_radius + proxyB->m_radius;\n\tfloat32 target = b2Max(b2_linearSlop, totalRadius - 3.0f * b2_linearSlop);\n\tfloat32 tolerance = 0.25f * b2_linearSlop;\n\tb2Assert(target > tolerance);\n\n\tfloat32 t1 = 0.0f;\n\tconst int32 k_maxIterations = 20;\t// TODO_ERIN b2Settings\n\tint32 iter = 0;\n\n\t// Prepare input for distance query.\n\tb2SimplexCache cache;\n\tcache.count = 0;\n\tb2DistanceInput distanceInput;\n\tdistanceInput.proxyA = input->proxyA;\n\tdistanceInput.proxyB = input->proxyB;\n\tdistanceInput.useRadii = false;\n\n\t// The outer loop progressively attempts to compute new separating axes.\n\t// This loop terminates when an axis is repeated (no progress is made).\n\tfor(;;)\n\t{\n\t\tb2Transform xfA, xfB;\n\t\tsweepA.GetTransform(&xfA, t1);\n\t\tsweepB.GetTransform(&xfB, t1);\n\n\t\t// Get the distance between shapes. We can also use the results\n\t\t// to get a separating axis.\n\t\tdistanceInput.transformA = xfA;\n\t\tdistanceInput.transformB = xfB;\n\t\tb2DistanceOutput distanceOutput;\n\t\tb2Distance(&distanceOutput, &cache, &distanceInput);\n\n\t\t// If the shapes are overlapped, we give up on continuous collision.\n\t\tif (distanceOutput.distance <= 0.0f)\n\t\t{\n\t\t\t// Failure!\n\t\t\toutput->state = b2TOIOutput::e_overlapped;\n\t\t\toutput->t = 0.0f;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (distanceOutput.distance < target + tolerance)\n\t\t{\n\t\t\t// Victory!\n\t\t\toutput->state = b2TOIOutput::e_touching;\n\t\t\toutput->t = t1;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Initialize the separating axis.\n\t\tb2SeparationFunction fcn;\n\t\tfcn.Initialize(&cache, proxyA, sweepA, proxyB, sweepB, t1);\n#if 0\n\t\t// Dump the curve seen by the root finder\n\t\t{\n\t\t\tconst int32 N = 100;\n\t\t\tfloat32 dx = 1.0f / N;\n\t\t\tfloat32 xs[N+1];\n\t\t\tfloat32 fs[N+1];\n\n\t\t\tfloat32 x = 0.0f;\n\n\t\t\tfor (int32 i = 0; i <= N; ++i)\n\t\t\t{\n\t\t\t\tsweepA.GetTransform(&xfA, x);\n\t\t\t\tsweepB.GetTransform(&xfB, x);\n\t\t\t\tfloat32 f = fcn.Evaluate(xfA, xfB) - target;\n\n\t\t\t\tprintf(\"%g %g\\n\", x, f);\n\n\t\t\t\txs[i] = x;\n\t\t\t\tfs[i] = f;\n\n\t\t\t\tx += dx;\n\t\t\t}\n\t\t}\n#endif\n\n\t\t// Compute the TOI on the separating axis. We do this by successively\n\t\t// resolving the deepest point. This loop is bounded by the number of vertices.\n\t\tbool done = false;\n\t\tfloat32 t2 = tMax;\n\t\tint32 pushBackIter = 0;\n\t\tfor (;;)\n\t\t{\n\t\t\t// Find the deepest point at t2. Store the witness point indices.\n\t\t\tint32 indexA, indexB;\n\t\t\tfloat32 s2 = fcn.FindMinSeparation(&indexA, &indexB, t2);\n\n\t\t\t// Is the final configuration separated?\n\t\t\tif (s2 > target + tolerance)\n\t\t\t{\n\t\t\t\t// Victory!\n\t\t\t\toutput->state = b2TOIOutput::e_separated;\n\t\t\t\toutput->t = tMax;\n\t\t\t\tdone = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Has the separation reached tolerance?\n\t\t\tif (s2 > target - tolerance)\n\t\t\t{\n\t\t\t\t// Advance the sweeps\n\t\t\t\tt1 = t2;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Compute the initial separation of the witness points.\n\t\t\tfloat32 s1 = fcn.Evaluate(indexA, indexB, t1);\n\n\t\t\t// Check for initial overlap. This might happen if the root finder\n\t\t\t// runs out of iterations.\n\t\t\tif (s1 < target - tolerance)\n\t\t\t{\n\t\t\t\toutput->state = b2TOIOutput::e_failed;\n\t\t\t\toutput->t = t1;\n\t\t\t\tdone = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Check for touching\n\t\t\tif (s1 <= target + tolerance)\n\t\t\t{\n\t\t\t\t// Victory! t1 should hold the TOI (could be 0.0).\n\t\t\t\toutput->state = b2TOIOutput::e_touching;\n\t\t\t\toutput->t = t1;\n\t\t\t\tdone = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Compute 1D root of: f(x) - target = 0\n\t\t\tint32 rootIterCount = 0;\n\t\t\tfloat32 a1 = t1, a2 = t2;\n\t\t\tfor (;;)\n\t\t\t{\n\t\t\t\t// Use a mix of the secant rule and bisection.\n\t\t\t\tfloat32 t;\n\t\t\t\tif (rootIterCount & 1)\n\t\t\t\t{\n\t\t\t\t\t// Secant rule to improve convergence.\n\t\t\t\t\tt = a1 + (target - s1) * (a2 - a1) / (s2 - s1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Bisection to guarantee progress.\n\t\t\t\t\tt = 0.5f * (a1 + a2);\n\t\t\t\t}\n\n\t\t\t\t++rootIterCount;\n\t\t\t\t++b2_toiRootIters;\n\n\t\t\t\tfloat32 s = fcn.Evaluate(indexA, indexB, t);\n\n\t\t\t\tif (b2Abs(s - target) < tolerance)\n\t\t\t\t{\n\t\t\t\t\t// t2 holds a tentative value for t1\n\t\t\t\t\tt2 = t;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Ensure we continue to bracket the root.\n\t\t\t\tif (s > target)\n\t\t\t\t{\n\t\t\t\t\ta1 = t;\n\t\t\t\t\ts1 = s;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ta2 = t;\n\t\t\t\t\ts2 = s;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (rootIterCount == 50)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tb2_toiMaxRootIters = b2Max(b2_toiMaxRootIters, rootIterCount);\n\n\t\t\t++pushBackIter;\n\n\t\t\tif (pushBackIter == b2_maxPolygonVertices)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t++iter;\n\t\t++b2_toiIters;\n\n\t\tif (done)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\n\t\tif (iter == k_maxIterations)\n\t\t{\n\t\t\t// Root finder got stuck. Semi-victory.\n\t\t\toutput->state = b2TOIOutput::e_failed;\n\t\t\toutput->t = t1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tb2_toiMaxIters = b2Max(b2_toiMaxIters, iter);\n\n\tfloat32 time = timer.GetMilliseconds();\n\tb2_toiMaxTime = b2Max(b2_toiMaxTime, time);\n\tb2_toiTime += time;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Collision/b2TimeOfImpact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_TIME_OF_IMPACT_H\n#define B2_TIME_OF_IMPACT_H\n\n#include <Box2D/Common/b2Math.h>\n#include <Box2D/Collision/b2Distance.h>\n\n/// Input parameters for b2TimeOfImpact\nstruct b2TOIInput\n{\n\tb2DistanceProxy proxyA;\n\tb2DistanceProxy proxyB;\n\tb2Sweep sweepA;\n\tb2Sweep sweepB;\n\tfloat32 tMax;\t\t// defines sweep interval [0, tMax]\n};\n\n// Output parameters for b2TimeOfImpact.\nstruct b2TOIOutput\n{\n\tenum State\n\t{\n\t\te_unknown,\n\t\te_failed,\n\t\te_overlapped,\n\t\te_touching,\n\t\te_separated\n\t};\n\n\tState state;\n\tfloat32 t;\n};\n\n/// Compute the upper bound on time before two shapes penetrate. Time is represented as\n/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate,\n/// non-tunneling collision. If you change the time interval, you should call this function\n/// again.\n/// Note: use b2Distance to compute the contact point and normal at the time of impact.\nvoid b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2BlockAllocator.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <limits.h>\n#include <memory.h>\n#include <stddef.h>\n#include <string.h>\n\nint32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = \n{\n\t16,\t\t// 0\n\t32,\t\t// 1\n\t64,\t\t// 2\n\t96,\t\t// 3\n\t128,\t// 4\n\t160,\t// 5\n\t192,\t// 6\n\t224,\t// 7\n\t256,\t// 8\n\t320,\t// 9\n\t384,\t// 10\n\t448,\t// 11\n\t512,\t// 12\n\t640,\t// 13\n};\nuint8 b2BlockAllocator::s_blockSizeLookup[b2_maxBlockSize + 1];\nbool b2BlockAllocator::s_blockSizeLookupInitialized;\n\nstruct b2Chunk\n{\n\tint32 blockSize;\n\tb2Block* blocks;\n};\n\nstruct b2Block\n{\n\tb2Block* next;\n};\n\nb2BlockAllocator::b2BlockAllocator()\n{\n\tb2Assert(b2_blockSizes < UCHAR_MAX);\n\n\tm_chunkSpace = b2_chunkArrayIncrement;\n\tm_chunkCount = 0;\n\tm_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk));\n\t\n\tmemset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk));\n\tmemset(m_freeLists, 0, sizeof(m_freeLists));\n\n\tif (s_blockSizeLookupInitialized == false)\n\t{\n\t\tint32 j = 0;\n\t\tfor (int32 i = 1; i <= b2_maxBlockSize; ++i)\n\t\t{\n\t\t\tb2Assert(j < b2_blockSizes);\n\t\t\tif (i <= s_blockSizes[j])\n\t\t\t{\n\t\t\t\ts_blockSizeLookup[i] = (uint8)j;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t++j;\n\t\t\t\ts_blockSizeLookup[i] = (uint8)j;\n\t\t\t}\n\t\t}\n\n\t\ts_blockSizeLookupInitialized = true;\n\t}\n}\n\nb2BlockAllocator::~b2BlockAllocator()\n{\n\tfor (int32 i = 0; i < m_chunkCount; ++i)\n\t{\n\t\tb2Free(m_chunks[i].blocks);\n\t}\n\n\tb2Free(m_chunks);\n}\n\nvoid* b2BlockAllocator::Allocate(int32 size)\n{\n\tif (size == 0)\n\t\treturn NULL;\n\n\tb2Assert(0 < size);\n\n\tif (size > b2_maxBlockSize)\n\t{\n\t\treturn b2Alloc(size);\n\t}\n\n\tint32 index = s_blockSizeLookup[size];\n\tb2Assert(0 <= index && index < b2_blockSizes);\n\n\tif (m_freeLists[index])\n\t{\n\t\tb2Block* block = m_freeLists[index];\n\t\tm_freeLists[index] = block->next;\n\t\treturn block;\n\t}\n\telse\n\t{\n\t\tif (m_chunkCount == m_chunkSpace)\n\t\t{\n\t\t\tb2Chunk* oldChunks = m_chunks;\n\t\t\tm_chunkSpace += b2_chunkArrayIncrement;\n\t\t\tm_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk));\n\t\t\tmemcpy(m_chunks, oldChunks, m_chunkCount * sizeof(b2Chunk));\n\t\t\tmemset(m_chunks + m_chunkCount, 0, b2_chunkArrayIncrement * sizeof(b2Chunk));\n\t\t\tb2Free(oldChunks);\n\t\t}\n\n\t\tb2Chunk* chunk = m_chunks + m_chunkCount;\n\t\tchunk->blocks = (b2Block*)b2Alloc(b2_chunkSize);\n#if defined(_DEBUG)\n\t\tmemset(chunk->blocks, 0xcd, b2_chunkSize);\n#endif\n\t\tint32 blockSize = s_blockSizes[index];\n\t\tchunk->blockSize = blockSize;\n\t\tint32 blockCount = b2_chunkSize / blockSize;\n\t\tb2Assert(blockCount * blockSize <= b2_chunkSize);\n\t\tfor (int32 i = 0; i < blockCount - 1; ++i)\n\t\t{\n\t\t\tb2Block* block = (b2Block*)((int8*)chunk->blocks + blockSize * i);\n\t\t\tb2Block* next = (b2Block*)((int8*)chunk->blocks + blockSize * (i + 1));\n\t\t\tblock->next = next;\n\t\t}\n\t\tb2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1));\n\t\tlast->next = NULL;\n\n\t\tm_freeLists[index] = chunk->blocks->next;\n\t\t++m_chunkCount;\n\n\t\treturn chunk->blocks;\n\t}\n}\n\nvoid b2BlockAllocator::Free(void* p, int32 size)\n{\n\tif (size == 0)\n\t{\n\t\treturn;\n\t}\n\n\tb2Assert(0 < size);\n\n\tif (size > b2_maxBlockSize)\n\t{\n\t\tb2Free(p);\n\t\treturn;\n\t}\n\n\tint32 index = s_blockSizeLookup[size];\n\tb2Assert(0 <= index && index < b2_blockSizes);\n\n#ifdef _DEBUG\n\t// Verify the memory address and size is valid.\n\tint32 blockSize = s_blockSizes[index];\n\tbool found = false;\n\tfor (int32 i = 0; i < m_chunkCount; ++i)\n\t{\n\t\tb2Chunk* chunk = m_chunks + i;\n\t\tif (chunk->blockSize != blockSize)\n\t\t{\n\t\t\tb2Assert(\t(int8*)p + blockSize <= (int8*)chunk->blocks ||\n\t\t\t\t\t\t(int8*)chunk->blocks + b2_chunkSize <= (int8*)p);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ((int8*)chunk->blocks <= (int8*)p && (int8*)p + blockSize <= (int8*)chunk->blocks + b2_chunkSize)\n\t\t\t{\n\t\t\t\tfound = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tb2Assert(found);\n\n\tmemset(p, 0xfd, blockSize);\n#endif\n\n\tb2Block* block = (b2Block*)p;\n\tblock->next = m_freeLists[index];\n\tm_freeLists[index] = block;\n}\n\nvoid b2BlockAllocator::Clear()\n{\n\tfor (int32 i = 0; i < m_chunkCount; ++i)\n\t{\n\t\tb2Free(m_chunks[i].blocks);\n\t}\n\n\tm_chunkCount = 0;\n\tmemset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk));\n\n\tmemset(m_freeLists, 0, sizeof(m_freeLists));\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2BlockAllocator.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_BLOCK_ALLOCATOR_H\n#define B2_BLOCK_ALLOCATOR_H\n\n#include <Box2D/Common/b2Settings.h>\n\nconst int32 b2_chunkSize = 16 * 1024;\nconst int32 b2_maxBlockSize = 640;\nconst int32 b2_blockSizes = 14;\nconst int32 b2_chunkArrayIncrement = 128;\n\nstruct b2Block;\nstruct b2Chunk;\n\n/// This is a small object allocator used for allocating small\n/// objects that persist for more than one time step.\n/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp\nclass b2BlockAllocator\n{\npublic:\n\tb2BlockAllocator();\n\t~b2BlockAllocator();\n\n\t/// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize.\n\tvoid* Allocate(int32 size);\n\n\t/// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize.\n\tvoid Free(void* p, int32 size);\n\n\tvoid Clear();\n\nprivate:\n\n\tb2Chunk* m_chunks;\n\tint32 m_chunkCount;\n\tint32 m_chunkSpace;\n\n\tb2Block* m_freeLists[b2_blockSizes];\n\n\tstatic int32 s_blockSizes[b2_blockSizes];\n\tstatic uint8 s_blockSizeLookup[b2_maxBlockSize + 1];\n\tstatic bool s_blockSizeLookupInitialized;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Draw.cpp",
    "content": "/*\n* Copyright (c) 2011 Erin Catto http://box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Common/b2Draw.h>\n\nb2Draw::b2Draw()\n{\n\tm_drawFlags = 0;\n}\n\nvoid b2Draw::SetFlags(uint32 flags)\n{\n\tm_drawFlags = flags;\n}\n\nuint32 b2Draw::GetFlags() const\n{\n\treturn m_drawFlags;\n}\n\nvoid b2Draw::AppendFlags(uint32 flags)\n{\n\tm_drawFlags |= flags;\n}\n\nvoid b2Draw::ClearFlags(uint32 flags)\n{\n\tm_drawFlags &= ~flags;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Draw.h",
    "content": "/*\n* Copyright (c) 2011 Erin Catto http://box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_DRAW_H\n#define B2_DRAW_H\n\n#include <Box2D/Common/b2Math.h>\n\n/// Color for debug drawing. Each value has the range [0,1].\nstruct b2Color\n{\n\tb2Color() {}\n\tb2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {}\n\tvoid Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; }\n\tfloat32 r, g, b;\n};\n\n/// Implement and register this class with a b2World to provide debug drawing of physics\n/// entities in your game.\nclass b2Draw\n{\npublic:\n\tb2Draw();\n\n\tvirtual ~b2Draw() {}\n\n\tenum\n\t{\n\t\te_shapeBit\t\t\t\t= 0x0001,\t///< draw shapes\n\t\te_jointBit\t\t\t\t= 0x0002,\t///< draw joint connections\n\t\te_aabbBit\t\t\t\t= 0x0004,\t///< draw axis aligned bounding boxes\n\t\te_pairBit\t\t\t\t= 0x0008,\t///< draw broad-phase pairs\n\t\te_centerOfMassBit\t\t= 0x0010\t///< draw center of mass frame\n\t};\n\n\t/// Set the drawing flags.\n\tvoid SetFlags(uint32 flags);\n\n\t/// Get the drawing flags.\n\tuint32 GetFlags() const;\n\t\n\t/// Append flags to the current flags.\n\tvoid AppendFlags(uint32 flags);\n\n\t/// Clear flags from the current flags.\n\tvoid ClearFlags(uint32 flags);\n\n\t/// Draw a closed polygon provided in CCW order.\n\tvirtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0;\n\n\t/// Draw a solid closed polygon provided in CCW order.\n\tvirtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0;\n\n\t/// Draw a circle.\n\tvirtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0;\n\t\n\t/// Draw a solid circle.\n\tvirtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0;\n\t\n\t/// Draw a line segment.\n\tvirtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0;\n\n\t/// Draw a transform. Choose your own length scale.\n\t/// @param xf a transform.\n\tvirtual void DrawTransform(const b2Transform& xf) = 0;\n\nprotected:\n\tuint32 m_drawFlags;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2GrowableStack.h",
    "content": "/*\n* Copyright (c) 2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_GROWABLE_STACK_H\n#define B2_GROWABLE_STACK_H\n#include <Box2D/Common/b2Settings.h>\n#include <memory.h>\n#include <string.h>\n\n/// This is a growable LIFO stack with an initial capacity of N.\n/// If the stack size exceeds the initial capacity, the heap is used\n/// to increase the size of the stack.\ntemplate <typename T, int32 N>\nclass b2GrowableStack\n{\npublic:\n\tb2GrowableStack()\n\t{\n\t\tm_stack = m_array;\n\t\tm_count = 0;\n\t\tm_capacity = N;\n\t}\n\n\t~b2GrowableStack()\n\t{\n\t\tif (m_stack != m_array)\n\t\t{\n\t\t\tb2Free(m_stack);\n\t\t\tm_stack = NULL;\n\t\t}\n\t}\n\n\tvoid Push(const T& element)\n\t{\n\t\tif (m_count == m_capacity)\n\t\t{\n\t\t\tT* old = m_stack;\n\t\t\tm_capacity *= 2;\n\t\t\tm_stack = (T*)b2Alloc(m_capacity * sizeof(T));\n\t\t\tmemcpy(m_stack, old, m_count * sizeof(T));\n\t\t\tif (old != m_array)\n\t\t\t{\n\t\t\t\tb2Free(old);\n\t\t\t}\n\t\t}\n\n\t\tm_stack[m_count] = element;\n\t\t++m_count;\n\t}\n\n\tT Pop()\n\t{\n\t\tb2Assert(m_count > 0);\n\t\t--m_count;\n\t\treturn m_stack[m_count];\n\t}\n\n\tint32 GetCount()\n\t{\n\t\treturn m_count;\n\t}\n\nprivate:\n\tT* m_stack;\n\tT m_array[N];\n\tint32 m_count;\n\tint32 m_capacity;\n};\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Math.cpp",
    "content": "/*\n* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Common/b2Math.h>\n\nconst b2Vec2 b2Vec2_zero(0.0f, 0.0f);\n\n/// Solve A * x = b, where b is a column vector. This is more efficient\n/// than computing the inverse in one-shot cases.\nb2Vec3 b2Mat33::Solve33(const b2Vec3& b) const\n{\n\tfloat32 det = b2Dot(ex, b2Cross(ey, ez));\n\tif (det != 0.0f)\n\t{\n\t\tdet = 1.0f / det;\n\t}\n\tb2Vec3 x;\n\tx.x = det * b2Dot(b, b2Cross(ey, ez));\n\tx.y = det * b2Dot(ex, b2Cross(b, ez));\n\tx.z = det * b2Dot(ex, b2Cross(ey, b));\n\treturn x;\n}\n\n/// Solve A * x = b, where b is a column vector. This is more efficient\n/// than computing the inverse in one-shot cases.\nb2Vec2 b2Mat33::Solve22(const b2Vec2& b) const\n{\n\tfloat32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y;\n\tfloat32 det = a11 * a22 - a12 * a21;\n\tif (det != 0.0f)\n\t{\n\t\tdet = 1.0f / det;\n\t}\n\tb2Vec2 x;\n\tx.x = det * (a22 * b.x - a12 * b.y);\n\tx.y = det * (a11 * b.y - a21 * b.x);\n\treturn x;\n}\n\n///\nvoid b2Mat33::GetInverse22(b2Mat33* M) const\n{\n\tfloat32 a = ex.x, b = ey.x, c = ex.y, d = ey.y;\n\tfloat32 det = a * d - b * c;\n\tif (det != 0.0f)\n\t{\n\t\tdet = 1.0f / det;\n\t}\n\n\tM->ex.x =  det * d;\tM->ey.x = -det * b; M->ex.z = 0.0f;\n\tM->ex.y = -det * c;\tM->ey.y =  det * a; M->ey.z = 0.0f;\n\tM->ez.x = 0.0f; M->ez.y = 0.0f; M->ez.z = 0.0f;\n}\n\n/// Returns the zero matrix if singular.\nvoid b2Mat33::GetSymInverse33(b2Mat33* M) const\n{\n\tfloat32 det = b2Dot(ex, b2Cross(ey, ez));\n\tif (det != 0.0f)\n\t{\n\t\tdet = 1.0f / det;\n\t}\n\n\tfloat32 a11 = ex.x, a12 = ey.x, a13 = ez.x;\n\tfloat32 a22 = ey.y, a23 = ez.y;\n\tfloat32 a33 = ez.z;\n\n\tM->ex.x = det * (a22 * a33 - a23 * a23);\n\tM->ex.y = det * (a13 * a23 - a12 * a33);\n\tM->ex.z = det * (a12 * a23 - a13 * a22);\n\n\tM->ey.x = M->ex.y;\n\tM->ey.y = det * (a11 * a33 - a13 * a13);\n\tM->ey.z = det * (a13 * a12 - a11 * a23);\n\n\tM->ez.x = M->ex.z;\n\tM->ez.y = M->ey.z;\n\tM->ez.z = det * (a11 * a22 - a12 * a12);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Math.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_MATH_H\n#define B2_MATH_H\n\n#include <Box2D/Common/b2Settings.h>\n#include <math.h>\n\n/// This function is used to ensure that a floating point number is not a NaN or infinity.\ninline bool b2IsValid(float32 x)\n{\n\tint32 ix = *reinterpret_cast<int32*>(&x);\n\treturn (ix & 0x7f800000) != 0x7f800000;\n}\n\n/// This is a approximate yet fast inverse square-root.\ninline float32 b2InvSqrt(float32 x)\n{\n\tunion\n\t{\n\t\tfloat32 x;\n\t\tint32 i;\n\t} convert;\n\n\tconvert.x = x;\n\tfloat32 xhalf = 0.5f * x;\n\tconvert.i = 0x5f3759df - (convert.i >> 1);\n\tx = convert.x;\n\tx = x * (1.5f - xhalf * x * x);\n\treturn x;\n}\n\n#define\tb2Sqrt(x)\tsqrtf(x)\n#define\tb2Atan2(y, x)\tatan2f(y, x)\n\n/// A 2D column vector.\nstruct b2Vec2\n{\n\t/// Default constructor does nothing (for performance).\n\tb2Vec2() {}\n\n\t/// Construct using coordinates.\n\tb2Vec2(float32 x, float32 y) : x(x), y(y) {}\n\n\t/// Set this vector to all zeros.\n\tvoid SetZero() { x = 0.0f; y = 0.0f; }\n\n\t/// Set this vector to some specified coordinates.\n\tvoid Set(float32 x_, float32 y_) { x = x_; y = y_; }\n\n\t/// Negate this vector.\n\tb2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; }\n\t\n\t/// Read from and indexed element.\n\tfloat32 operator () (int32 i) const\n\t{\n\t\treturn (&x)[i];\n\t}\n\n\t/// Write to an indexed element.\n\tfloat32& operator () (int32 i)\n\t{\n\t\treturn (&x)[i];\n\t}\n\n\t/// Add a vector to this vector.\n\tvoid operator += (const b2Vec2& v)\n\t{\n\t\tx += v.x; y += v.y;\n\t}\n\t\n\t/// Subtract a vector from this vector.\n\tvoid operator -= (const b2Vec2& v)\n\t{\n\t\tx -= v.x; y -= v.y;\n\t}\n\n\t/// Multiply this vector by a scalar.\n\tvoid operator *= (float32 a)\n\t{\n\t\tx *= a; y *= a;\n\t}\n\n\t/// Get the length of this vector (the norm).\n\tfloat32 Length() const\n\t{\n\t\treturn b2Sqrt(x * x + y * y);\n\t}\n\n\t/// Get the length squared. For performance, use this instead of\n\t/// b2Vec2::Length (if possible).\n\tfloat32 LengthSquared() const\n\t{\n\t\treturn x * x + y * y;\n\t}\n\n\t/// Convert this vector into a unit vector. Returns the length.\n\tfloat32 Normalize()\n\t{\n\t\tfloat32 length = Length();\n\t\tif (length < b2_epsilon)\n\t\t{\n\t\t\treturn 0.0f;\n\t\t}\n\t\tfloat32 invLength = 1.0f / length;\n\t\tx *= invLength;\n\t\ty *= invLength;\n\n\t\treturn length;\n\t}\n\n\t/// Does this vector contain finite coordinates?\n\tbool IsValid() const\n\t{\n\t\treturn b2IsValid(x) && b2IsValid(y);\n\t}\n\n\t/// Get the skew vector such that dot(skew_vec, other) == cross(vec, other)\n\tb2Vec2 Skew() const\n\t{\n\t\treturn b2Vec2(-y, x);\n\t}\n\n\tfloat32 x, y;\n};\n\n/// A 2D column vector with 3 elements.\nstruct b2Vec3\n{\n\t/// Default constructor does nothing (for performance).\n\tb2Vec3() {}\n\n\t/// Construct using coordinates.\n\tb2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {}\n\n\t/// Set this vector to all zeros.\n\tvoid SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; }\n\n\t/// Set this vector to some specified coordinates.\n\tvoid Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; }\n\n\t/// Negate this vector.\n\tb2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; }\n\n\t/// Add a vector to this vector.\n\tvoid operator += (const b2Vec3& v)\n\t{\n\t\tx += v.x; y += v.y; z += v.z;\n\t}\n\n\t/// Subtract a vector from this vector.\n\tvoid operator -= (const b2Vec3& v)\n\t{\n\t\tx -= v.x; y -= v.y; z -= v.z;\n\t}\n\n\t/// Multiply this vector by a scalar.\n\tvoid operator *= (float32 s)\n\t{\n\t\tx *= s; y *= s; z *= s;\n\t}\n\n\tfloat32 x, y, z;\n};\n\n/// A 2-by-2 matrix. Stored in column-major order.\nstruct b2Mat22\n{\n\t/// The default constructor does nothing (for performance).\n\tb2Mat22() {}\n\n\t/// Construct this matrix using columns.\n\tb2Mat22(const b2Vec2& c1, const b2Vec2& c2)\n\t{\n\t\tex = c1;\n\t\tey = c2;\n\t}\n\n\t/// Construct this matrix using scalars.\n\tb2Mat22(float32 a11, float32 a12, float32 a21, float32 a22)\n\t{\n\t\tex.x = a11; ex.y = a21;\n\t\tey.x = a12; ey.y = a22;\n\t}\n\n\t/// Initialize this matrix using columns.\n\tvoid Set(const b2Vec2& c1, const b2Vec2& c2)\n\t{\n\t\tex = c1;\n\t\tey = c2;\n\t}\n\n\t/// Set this to the identity matrix.\n\tvoid SetIdentity()\n\t{\n\t\tex.x = 1.0f; ey.x = 0.0f;\n\t\tex.y = 0.0f; ey.y = 1.0f;\n\t}\n\n\t/// Set this matrix to all zeros.\n\tvoid SetZero()\n\t{\n\t\tex.x = 0.0f; ey.x = 0.0f;\n\t\tex.y = 0.0f; ey.y = 0.0f;\n\t}\n\n\tb2Mat22 GetInverse() const\n\t{\n\t\tfloat32 a = ex.x, b = ey.x, c = ex.y, d = ey.y;\n\t\tb2Mat22 B;\n\t\tfloat32 det = a * d - b * c;\n\t\tif (det != 0.0f)\n\t\t{\n\t\t\tdet = 1.0f / det;\n\t\t}\n\t\tB.ex.x =  det * d;\tB.ey.x = -det * b;\n\t\tB.ex.y = -det * c;\tB.ey.y =  det * a;\n\t\treturn B;\n\t}\n\n\t/// Solve A * x = b, where b is a column vector. This is more efficient\n\t/// than computing the inverse in one-shot cases.\n\tb2Vec2 Solve(const b2Vec2& b) const\n\t{\n\t\tfloat32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y;\n\t\tfloat32 det = a11 * a22 - a12 * a21;\n\t\tif (det != 0.0f)\n\t\t{\n\t\t\tdet = 1.0f / det;\n\t\t}\n\t\tb2Vec2 x;\n\t\tx.x = det * (a22 * b.x - a12 * b.y);\n\t\tx.y = det * (a11 * b.y - a21 * b.x);\n\t\treturn x;\n\t}\n\n\tb2Vec2 ex, ey;\n};\n\n/// A 3-by-3 matrix. Stored in column-major order.\nstruct b2Mat33\n{\n\t/// The default constructor does nothing (for performance).\n\tb2Mat33() {}\n\n\t/// Construct this matrix using columns.\n\tb2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3)\n\t{\n\t\tex = c1;\n\t\tey = c2;\n\t\tez = c3;\n\t}\n\n\t/// Set this matrix to all zeros.\n\tvoid SetZero()\n\t{\n\t\tex.SetZero();\n\t\tey.SetZero();\n\t\tez.SetZero();\n\t}\n\n\t/// Solve A * x = b, where b is a column vector. This is more efficient\n\t/// than computing the inverse in one-shot cases.\n\tb2Vec3 Solve33(const b2Vec3& b) const;\n\n\t/// Solve A * x = b, where b is a column vector. This is more efficient\n\t/// than computing the inverse in one-shot cases. Solve only the upper\n\t/// 2-by-2 matrix equation.\n\tb2Vec2 Solve22(const b2Vec2& b) const;\n\n\t/// Get the inverse of this matrix as a 2-by-2.\n\t/// Returns the zero matrix if singular.\n\tvoid GetInverse22(b2Mat33* M) const;\n\n\t/// Get the symmetric inverse of this matrix as a 3-by-3.\n\t/// Returns the zero matrix if singular.\n\tvoid GetSymInverse33(b2Mat33* M) const;\n\n\tb2Vec3 ex, ey, ez;\n};\n\n/// Rotation\nstruct b2Rot\n{\n\tb2Rot() {}\n\n\t/// Initialize from an angle in radians\n\texplicit b2Rot(float32 angle)\n\t{\n\t\t/// TODO_ERIN optimize\n\t\ts = sinf(angle);\n\t\tc = cosf(angle);\n\t}\n\n\t/// Set using an angle in radians.\n\tvoid Set(float32 angle)\n\t{\n\t\t/// TODO_ERIN optimize\n\t\ts = sinf(angle);\n\t\tc = cosf(angle);\n\t}\n\n\t/// Set to the identity rotation\n\tvoid SetIdentity()\n\t{\n\t\ts = 0.0f;\n\t\tc = 1.0f;\n\t}\n\n\t/// Get the angle in radians\n\tfloat32 GetAngle() const\n\t{\n\t\treturn b2Atan2(s, c);\n\t}\n\n\t/// Get the x-axis\n\tb2Vec2 GetXAxis() const\n\t{\n\t\treturn b2Vec2(c, s);\n\t}\n\n\t/// Get the u-axis\n\tb2Vec2 GetYAxis() const\n\t{\n\t\treturn b2Vec2(-s, c);\n\t}\n\n\t/// Sine and cosine\n\tfloat32 s, c;\n};\n\n/// A transform contains translation and rotation. It is used to represent\n/// the position and orientation of rigid frames.\nstruct b2Transform\n{\n\t/// The default constructor does nothing.\n\tb2Transform() {}\n\n\t/// Initialize using a position vector and a rotation.\n\tb2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {}\n\n\t/// Set this to the identity transform.\n\tvoid SetIdentity()\n\t{\n\t\tp.SetZero();\n\t\tq.SetIdentity();\n\t}\n\n\t/// Set this based on the position and angle.\n\tvoid Set(const b2Vec2& position, float32 angle)\n\t{\n\t\tp = position;\n\t\tq.Set(angle);\n\t}\n\n\tb2Vec2 p;\n\tb2Rot q;\n};\n\n/// This describes the motion of a body/shape for TOI computation.\n/// Shapes are defined with respect to the body origin, which may\n/// no coincide with the center of mass. However, to support dynamics\n/// we must interpolate the center of mass position.\nstruct b2Sweep\n{\n\t/// Get the interpolated transform at a specific time.\n\t/// @param beta is a factor in [0,1], where 0 indicates alpha0.\n\tvoid GetTransform(b2Transform* xfb, float32 beta) const;\n\n\t/// Advance the sweep forward, yielding a new initial state.\n\t/// @param alpha the new initial time.\n\tvoid Advance(float32 alpha);\n\n\t/// Normalize the angles.\n\tvoid Normalize();\n\n\tb2Vec2 localCenter;\t///< local center of mass position\n\tb2Vec2 c0, c;\t\t///< center world positions\n\tfloat32 a0, a;\t\t///< world angles\n\n\t/// Fraction of the current time step in the range [0,1]\n\t/// c0 and a0 are the positions at alpha0.\n\tfloat32 alpha0;\n};\n\n/// Useful constant\nextern const b2Vec2 b2Vec2_zero;\n\n/// Perform the dot product on two vectors.\ninline float32 b2Dot(const b2Vec2& a, const b2Vec2& b)\n{\n\treturn a.x * b.x + a.y * b.y;\n}\n\n/// Perform the cross product on two vectors. In 2D this produces a scalar.\ninline float32 b2Cross(const b2Vec2& a, const b2Vec2& b)\n{\n\treturn a.x * b.y - a.y * b.x;\n}\n\n/// Perform the cross product on a vector and a scalar. In 2D this produces\n/// a vector.\ninline b2Vec2 b2Cross(const b2Vec2& a, float32 s)\n{\n\treturn b2Vec2(s * a.y, -s * a.x);\n}\n\n/// Perform the cross product on a scalar and a vector. In 2D this produces\n/// a vector.\ninline b2Vec2 b2Cross(float32 s, const b2Vec2& a)\n{\n\treturn b2Vec2(-s * a.y, s * a.x);\n}\n\n/// Multiply a matrix times a vector. If a rotation matrix is provided,\n/// then this transforms the vector from one frame to another.\ninline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v)\n{\n\treturn b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y);\n}\n\n/// Multiply a matrix transpose times a vector. If a rotation matrix is provided,\n/// then this transforms the vector from one frame to another (inverse transform).\ninline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v)\n{\n\treturn b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey));\n}\n\n/// Add two vectors component-wise.\ninline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b)\n{\n\treturn b2Vec2(a.x + b.x, a.y + b.y);\n}\n\n/// Subtract two vectors component-wise.\ninline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b)\n{\n\treturn b2Vec2(a.x - b.x, a.y - b.y);\n}\n\ninline b2Vec2 operator * (float32 s, const b2Vec2& a)\n{\n\treturn b2Vec2(s * a.x, s * a.y);\n}\n\ninline bool operator == (const b2Vec2& a, const b2Vec2& b)\n{\n\treturn a.x == b.x && a.y == b.y;\n}\n\ninline float32 b2Distance(const b2Vec2& a, const b2Vec2& b)\n{\n\tb2Vec2 c = a - b;\n\treturn c.Length();\n}\n\ninline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b)\n{\n\tb2Vec2 c = a - b;\n\treturn b2Dot(c, c);\n}\n\ninline b2Vec3 operator * (float32 s, const b2Vec3& a)\n{\n\treturn b2Vec3(s * a.x, s * a.y, s * a.z);\n}\n\n/// Add two vectors component-wise.\ninline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b)\n{\n\treturn b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z);\n}\n\n/// Subtract two vectors component-wise.\ninline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b)\n{\n\treturn b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z);\n}\n\n/// Perform the dot product on two vectors.\ninline float32 b2Dot(const b2Vec3& a, const b2Vec3& b)\n{\n\treturn a.x * b.x + a.y * b.y + a.z * b.z;\n}\n\n/// Perform the cross product on two vectors.\ninline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b)\n{\n\treturn b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);\n}\n\ninline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B)\n{\n\treturn b2Mat22(A.ex + B.ex, A.ey + B.ey);\n}\n\n// A * B\ninline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B)\n{\n\treturn b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey));\n}\n\n// A^T * B\ninline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B)\n{\n\tb2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex));\n\tb2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey));\n\treturn b2Mat22(c1, c2);\n}\n\n/// Multiply a matrix times a vector.\ninline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v)\n{\n\treturn v.x * A.ex + v.y * A.ey + v.z * A.ez;\n}\n\n/// Multiply a matrix times a vector.\ninline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v)\n{\n\treturn b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y);\n}\n\n/// Multiply two rotations: q * r\ninline b2Rot b2Mul(const b2Rot& q, const b2Rot& r)\n{\n\t// [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc]\n\t// [qs  qc]   [rs  rc]   [qs*rc+qc*rs -qs*rs+qc*rc]\n\t// s = qs * rc + qc * rs\n\t// c = qc * rc - qs * rs\n\tb2Rot qr;\n\tqr.s = q.s * r.c + q.c * r.s;\n\tqr.c = q.c * r.c - q.s * r.s;\n\treturn qr;\n}\n\n/// Transpose multiply two rotations: qT * r\ninline b2Rot b2MulT(const b2Rot& q, const b2Rot& r)\n{\n\t// [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc]\n\t// [-qs qc]   [rs  rc]   [-qs*rc+qc*rs qs*rs+qc*rc]\n\t// s = qc * rs - qs * rc\n\t// c = qc * rc + qs * rs\n\tb2Rot qr;\n\tqr.s = q.c * r.s - q.s * r.c;\n\tqr.c = q.c * r.c + q.s * r.s;\n\treturn qr;\n}\n\n/// Rotate a vector\ninline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v)\n{\n\treturn b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y);\n}\n\n/// Inverse rotate a vector\ninline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v)\n{\n\treturn b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y);\n}\n\ninline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v)\n{\n\tfloat32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x;\n\tfloat32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y;\n\n\treturn b2Vec2(x, y);\n}\n\ninline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v)\n{\n\tfloat32 px = v.x - T.p.x;\n\tfloat32 py = v.y - T.p.y;\n\tfloat32 x = (T.q.c * px + T.q.s * py);\n\tfloat32 y = (-T.q.s * px + T.q.c * py);\n\n\treturn b2Vec2(x, y);\n}\n\n// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p\n//    = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p\ninline b2Transform b2Mul(const b2Transform& A, const b2Transform& B)\n{\n\tb2Transform C;\n\tC.q = b2Mul(A.q, B.q);\n\tC.p = b2Mul(A.q, B.p) + A.p;\n\treturn C;\n}\n\n// v2 = A.q' * (B.q * v1 + B.p - A.p)\n//    = A.q' * B.q * v1 + A.q' * (B.p - A.p)\ninline b2Transform b2MulT(const b2Transform& A, const b2Transform& B)\n{\n\tb2Transform C;\n\tC.q = b2MulT(A.q, B.q);\n\tC.p = b2MulT(A.q, B.p - A.p);\n\treturn C;\n}\n\ntemplate <typename T>\ninline T b2Abs(T a)\n{\n\treturn a > T(0) ? a : -a;\n}\n\ninline b2Vec2 b2Abs(const b2Vec2& a)\n{\n\treturn b2Vec2(b2Abs(a.x), b2Abs(a.y));\n}\n\ninline b2Mat22 b2Abs(const b2Mat22& A)\n{\n\treturn b2Mat22(b2Abs(A.ex), b2Abs(A.ey));\n}\n\ntemplate <typename T>\ninline T b2Min(T a, T b)\n{\n\treturn a < b ? a : b;\n}\n\ninline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b)\n{\n\treturn b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y));\n}\n\ntemplate <typename T>\ninline T b2Max(T a, T b)\n{\n\treturn a > b ? a : b;\n}\n\ninline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b)\n{\n\treturn b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y));\n}\n\ntemplate <typename T>\ninline T b2Clamp(T a, T low, T high)\n{\n\treturn b2Max(low, b2Min(a, high));\n}\n\ninline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high)\n{\n\treturn b2Max(low, b2Min(a, high));\n}\n\ntemplate<typename T> inline void b2Swap(T& a, T& b)\n{\n\tT tmp = a;\n\ta = b;\n\tb = tmp;\n}\n\n/// \"Next Largest Power of 2\n/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm\n/// that recursively \"folds\" the upper bits into the lower bits. This process yields a bit vector with\n/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next\n/// largest power of 2. For a 32-bit value:\"\ninline uint32 b2NextPowerOfTwo(uint32 x)\n{\n\tx |= (x >> 1);\n\tx |= (x >> 2);\n\tx |= (x >> 4);\n\tx |= (x >> 8);\n\tx |= (x >> 16);\n\treturn x + 1;\n}\n\ninline bool b2IsPowerOfTwo(uint32 x)\n{\n\tbool result = x > 0 && (x & (x - 1)) == 0;\n\treturn result;\n}\n\ninline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const\n{\n\txf->p = (1.0f - beta) * c0 + beta * c;\n\tfloat32 angle = (1.0f - beta) * a0 + beta * a;\n\txf->q.Set(angle);\n\n\t// Shift to origin\n\txf->p -= b2Mul(xf->q, localCenter);\n}\n\ninline void b2Sweep::Advance(float32 alpha)\n{\n\tb2Assert(alpha0 < 1.0f);\n\tfloat32 beta = (alpha - alpha0) / (1.0f - alpha0);\n\tc0 += beta * (c - c0);\n\ta0 += beta * (a - a0);\n\talpha0 = alpha;\n}\n\n/// Normalize an angle in radians to be between -pi and pi\ninline void b2Sweep::Normalize()\n{\n\tfloat32 twoPi = 2.0f * b2_pi;\n\tfloat32 d =  twoPi * floorf(a0 / twoPi);\n\ta0 -= d;\n\ta -= d;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Settings.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Common/b2Settings.h>\n#include <stdio.h>\n#include <stdarg.h>\n#include <stdlib.h>\n\nb2Version b2_version = {2, 3, 0};\n\n// Memory allocators. Modify these to use your own allocator.\nvoid* b2Alloc(int32 size)\n{\n\treturn malloc(size);\n}\n\nvoid b2Free(void* mem)\n{\n\tfree(mem);\n}\n\n// You can modify this to use your logging facility.\nvoid b2Log(const char* string, ...)\n{\n\tva_list args;\n\tva_start(args, string);\n\tvprintf(string, args);\n\tva_end(args);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Settings.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_SETTINGS_H\n#define B2_SETTINGS_H\n\n#include <stddef.h>\n#include <assert.h>\n#include <float.h>\n\n#define B2_NOT_USED(x) ((void)(x))\n#define b2Assert(A) assert(A)\n\ntypedef signed char\tint8;\ntypedef signed short int16;\ntypedef signed int int32;\ntypedef unsigned char uint8;\ntypedef unsigned short uint16;\ntypedef unsigned int uint32;\ntypedef float float32;\ntypedef double float64;\n\n#define\tb2_maxFloat\t\tFLT_MAX\n#define\tb2_epsilon\t\tFLT_EPSILON\n#define b2_pi\t\t\t3.14159265359f\n\n/// @file\n/// Global tuning constants based on meters-kilograms-seconds (MKS) units.\n///\n\n// Collision\n\n/// The maximum number of contact points between two convex shapes. Do\n/// not change this value.\n#define b2_maxManifoldPoints\t2\n\n/// The maximum number of vertices on a convex polygon. You cannot increase\n/// this too much because b2BlockAllocator has a maximum object size.\n#define b2_maxPolygonVertices\t8\n\n/// This is used to fatten AABBs in the dynamic tree. This allows proxies\n/// to move by a small amount without triggering a tree adjustment.\n/// This is in meters.\n#define b2_aabbExtension\t\t0.1f\n\n/// This is used to fatten AABBs in the dynamic tree. This is used to predict\n/// the future position based on the current displacement.\n/// This is a dimensionless multiplier.\n#define b2_aabbMultiplier\t\t2.0f\n\n/// A small length used as a collision and constraint tolerance. Usually it is\n/// chosen to be numerically significant, but visually insignificant.\n#define b2_linearSlop\t\t\t0.005f\n\n/// A small angle used as a collision and constraint tolerance. Usually it is\n/// chosen to be numerically significant, but visually insignificant.\n#define b2_angularSlop\t\t\t(2.0f / 180.0f * b2_pi)\n\n/// The radius of the polygon/edge shape skin. This should not be modified. Making\n/// this smaller means polygons will have an insufficient buffer for continuous collision.\n/// Making it larger may create artifacts for vertex collision.\n#define b2_polygonRadius\t\t(2.0f * b2_linearSlop)\n\n/// Maximum number of sub-steps per contact in continuous physics simulation.\n#define b2_maxSubSteps\t\t\t8\n\n\n// Dynamics\n\n/// Maximum number of contacts to be handled to solve a TOI impact.\n#define b2_maxTOIContacts\t\t\t32\n\n/// A velocity threshold for elastic collisions. Any collision with a relative linear\n/// velocity below this threshold will be treated as inelastic.\n#define b2_velocityThreshold\t\t1.0f\n\n/// The maximum linear position correction used when solving constraints. This helps to\n/// prevent overshoot.\n#define b2_maxLinearCorrection\t\t0.2f\n\n/// The maximum angular position correction used when solving constraints. This helps to\n/// prevent overshoot.\n#define b2_maxAngularCorrection\t\t(8.0f / 180.0f * b2_pi)\n\n/// The maximum linear velocity of a body. This limit is very large and is used\n/// to prevent numerical problems. You shouldn't need to adjust this.\n#define b2_maxTranslation\t\t\t2.0f\n#define b2_maxTranslationSquared\t(b2_maxTranslation * b2_maxTranslation)\n\n/// The maximum angular velocity of a body. This limit is very large and is used\n/// to prevent numerical problems. You shouldn't need to adjust this.\n#define b2_maxRotation\t\t\t\t(0.5f * b2_pi)\n#define b2_maxRotationSquared\t\t(b2_maxRotation * b2_maxRotation)\n\n/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so\n/// that overlap is removed in one time step. However using values close to 1 often lead\n/// to overshoot.\n#define b2_baumgarte\t\t\t\t0.2f\n#define b2_toiBaugarte\t\t\t\t0.75f\n\n\n// Sleep\n\n/// The time that a body must be still before it will go to sleep.\n#define b2_timeToSleep\t\t\t\t0.5f\n\n/// A body cannot sleep if its linear velocity is above this tolerance.\n#define b2_linearSleepTolerance\t\t0.01f\n\n/// A body cannot sleep if its angular velocity is above this tolerance.\n#define b2_angularSleepTolerance\t(2.0f / 180.0f * b2_pi)\n\n// Memory Allocation\n\n/// Implement this function to use your own memory allocator.\nvoid* b2Alloc(int32 size);\n\n/// If you implement b2Alloc, you should also implement this function.\nvoid b2Free(void* mem);\n\n/// Logging function.\nvoid b2Log(const char* string, ...);\n\n/// Version numbering scheme.\n/// See http://en.wikipedia.org/wiki/Software_versioning\nstruct b2Version\n{\n\tint32 major;\t\t///< significant changes\n\tint32 minor;\t\t///< incremental changes\n\tint32 revision;\t\t///< bug fixes\n};\n\n/// Current version.\nextern b2Version b2_version;\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2StackAllocator.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Common/b2StackAllocator.h>\n#include <Box2D/Common/b2Math.h>\n\nb2StackAllocator::b2StackAllocator()\n{\n\tm_index = 0;\n\tm_allocation = 0;\n\tm_maxAllocation = 0;\n\tm_entryCount = 0;\n}\n\nb2StackAllocator::~b2StackAllocator()\n{\n\tb2Assert(m_index == 0);\n\tb2Assert(m_entryCount == 0);\n}\n\nvoid* b2StackAllocator::Allocate(int32 size)\n{\n\tb2Assert(m_entryCount < b2_maxStackEntries);\n\n\tb2StackEntry* entry = m_entries + m_entryCount;\n\tentry->size = size;\n\tif (m_index + size > b2_stackSize)\n\t{\n\t\tentry->data = (char*)b2Alloc(size);\n\t\tentry->usedMalloc = true;\n\t}\n\telse\n\t{\n\t\tentry->data = m_data + m_index;\n\t\tentry->usedMalloc = false;\n\t\tm_index += size;\n\t}\n\n\tm_allocation += size;\n\tm_maxAllocation = b2Max(m_maxAllocation, m_allocation);\n\t++m_entryCount;\n\n\treturn entry->data;\n}\n\nvoid b2StackAllocator::Free(void* p)\n{\n\tb2Assert(m_entryCount > 0);\n\tb2StackEntry* entry = m_entries + m_entryCount - 1;\n\tb2Assert(p == entry->data);\n\tif (entry->usedMalloc)\n\t{\n\t\tb2Free(p);\n\t}\n\telse\n\t{\n\t\tm_index -= entry->size;\n\t}\n\tm_allocation -= entry->size;\n\t--m_entryCount;\n\n\tp = NULL;\n}\n\nint32 b2StackAllocator::GetMaxAllocation() const\n{\n\treturn m_maxAllocation;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2StackAllocator.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_STACK_ALLOCATOR_H\n#define B2_STACK_ALLOCATOR_H\n\n#include <Box2D/Common/b2Settings.h>\n\nconst int32 b2_stackSize = 100 * 1024;\t// 100k\nconst int32 b2_maxStackEntries = 32;\n\nstruct b2StackEntry\n{\n\tchar* data;\n\tint32 size;\n\tbool usedMalloc;\n};\n\n// This is a stack allocator used for fast per step allocations.\n// You must nest allocate/free pairs. The code will assert\n// if you try to interleave multiple allocate/free pairs.\nclass b2StackAllocator\n{\npublic:\n\tb2StackAllocator();\n\t~b2StackAllocator();\n\n\tvoid* Allocate(int32 size);\n\tvoid Free(void* p);\n\n\tint32 GetMaxAllocation() const;\n\nprivate:\n\n\tchar m_data[b2_stackSize];\n\tint32 m_index;\n\n\tint32 m_allocation;\n\tint32 m_maxAllocation;\n\n\tb2StackEntry m_entries[b2_maxStackEntries];\n\tint32 m_entryCount;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Timer.cpp",
    "content": "/*\n* Copyright (c) 2011 Erin Catto http://box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Common/b2Timer.h>\n\n#if defined(_WIN32)\n\nfloat64 b2Timer::s_invFrequency = 0.0f;\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\nb2Timer::b2Timer()\n{\n\tLARGE_INTEGER largeInteger;\n\n\tif (s_invFrequency == 0.0f)\n\t{\n\t\tQueryPerformanceFrequency(&largeInteger);\n\t\ts_invFrequency = float64(largeInteger.QuadPart);\n\t\tif (s_invFrequency > 0.0f)\n\t\t{\n\t\t\ts_invFrequency = 1000.0f / s_invFrequency;\n\t\t}\n\t}\n\n\tQueryPerformanceCounter(&largeInteger);\n\tm_start = float64(largeInteger.QuadPart);\n}\n\nvoid b2Timer::Reset()\n{\n\tLARGE_INTEGER largeInteger;\n\tQueryPerformanceCounter(&largeInteger);\n\tm_start = float64(largeInteger.QuadPart);\n}\n\nfloat32 b2Timer::GetMilliseconds() const\n{\n\tLARGE_INTEGER largeInteger;\n\tQueryPerformanceCounter(&largeInteger);\n\tfloat64 count = float64(largeInteger.QuadPart);\n\tfloat32 ms = float32(s_invFrequency * (count - m_start));\n\treturn ms;\n}\n\n#elif defined(__linux__) || defined (__APPLE__)\n\n#include <sys/time.h>\n\nb2Timer::b2Timer()\n{\n    Reset();\n}\n\nvoid b2Timer::Reset()\n{\n    timeval t;\n    gettimeofday(&t, 0);\n    m_start_sec = t.tv_sec;\n    m_start_usec = t.tv_usec;\n}\n\nfloat32 b2Timer::GetMilliseconds() const\n{\n    timeval t;\n    gettimeofday(&t, 0);\n    return 1000.0f * (t.tv_sec - m_start_sec) + 0.001f * (t.tv_usec - m_start_usec);\n}\n\n#else\n\nb2Timer::b2Timer()\n{\n}\n\nvoid b2Timer::Reset()\n{\n}\n\nfloat32 b2Timer::GetMilliseconds() const\n{\n\treturn 0.0f;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Common/b2Timer.h",
    "content": "/*\n* Copyright (c) 2011 Erin Catto http://box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_TIMER_H\n#define B2_TIMER_H\n\n#include <Box2D/Common/b2Settings.h>\n\n/// Timer for profiling. This has platform specific code and may\n/// not work on every platform.\nclass b2Timer\n{\npublic:\n\n\t/// Constructor\n\tb2Timer();\n\n\t/// Reset the timer.\n\tvoid Reset();\n\n\t/// Get the time since construction or the last reset.\n\tfloat32 GetMilliseconds() const;\n\nprivate:\n\n#if defined(_WIN32)\n\tfloat64 m_start;\n\tstatic float64 s_invFrequency;\n#elif defined(__linux__) || defined (__APPLE__)\n\tunsigned long m_start_sec;\n\tunsigned long m_start_usec;\n#endif\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Collision/Shapes/b2ChainShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n\n#include <new>\n\nb2Contact* b2ChainAndCircleContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator)\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2ChainAndCircleContact));\n\treturn new (mem) b2ChainAndCircleContact(fixtureA, indexA, fixtureB, indexB);\n}\n\nvoid b2ChainAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\t((b2ChainAndCircleContact*)contact)->~b2ChainAndCircleContact();\n\tallocator->Free(contact, sizeof(b2ChainAndCircleContact));\n}\n\nb2ChainAndCircleContact::b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB)\n: b2Contact(fixtureA, indexA, fixtureB, indexB)\n{\n\tb2Assert(m_fixtureA->GetType() == b2Shape::e_chain);\n\tb2Assert(m_fixtureB->GetType() == b2Shape::e_circle);\n}\n\nvoid b2ChainAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape();\n\tb2EdgeShape edge;\n\tchain->GetChildEdge(&edge, m_indexA);\n\tb2CollideEdgeAndCircle(\tmanifold, &edge, xfA,\n\t\t\t\t\t\t\t(b2CircleShape*)m_fixtureB->GetShape(), xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H\n#define B2_CHAIN_AND_CIRCLE_CONTACT_H\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nclass b2BlockAllocator;\n\nclass b2ChainAndCircleContact : public b2Contact\n{\npublic:\n\tstatic b2Contact* Create(\tb2Fixture* fixtureA, int32 indexA,\n\t\t\t\t\t\t\t\tb2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB);\n\t~b2ChainAndCircleContact() {}\n\n\tvoid Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Collision/Shapes/b2ChainShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n\n#include <new>\n\nb2Contact* b2ChainAndPolygonContact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator)\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2ChainAndPolygonContact));\n\treturn new (mem) b2ChainAndPolygonContact(fixtureA, indexA, fixtureB, indexB);\n}\n\nvoid b2ChainAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\t((b2ChainAndPolygonContact*)contact)->~b2ChainAndPolygonContact();\n\tallocator->Free(contact, sizeof(b2ChainAndPolygonContact));\n}\n\nb2ChainAndPolygonContact::b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB)\n: b2Contact(fixtureA, indexA, fixtureB, indexB)\n{\n\tb2Assert(m_fixtureA->GetType() == b2Shape::e_chain);\n\tb2Assert(m_fixtureB->GetType() == b2Shape::e_polygon);\n}\n\nvoid b2ChainAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2ChainShape* chain = (b2ChainShape*)m_fixtureA->GetShape();\n\tb2EdgeShape edge;\n\tchain->GetChildEdge(&edge, m_indexA);\n\tb2CollideEdgeAndPolygon(\tmanifold, &edge, xfA,\n\t\t\t\t\t\t\t\t(b2PolygonShape*)m_fixtureB->GetShape(), xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H\n#define B2_CHAIN_AND_POLYGON_CONTACT_H\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nclass b2BlockAllocator;\n\nclass b2ChainAndPolygonContact : public b2Contact\n{\npublic:\n\tstatic b2Contact* Create(\tb2Fixture* fixtureA, int32 indexA,\n\t\t\t\t\t\t\t\tb2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB);\n\t~b2ChainAndPolygonContact() {}\n\n\tvoid Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2CircleContact.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2CircleContact.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2WorldCallbacks.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Collision/b2TimeOfImpact.h>\n\n#include <new>\n\nb2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2CircleContact));\n\treturn new (mem) b2CircleContact(fixtureA, fixtureB);\n}\n\nvoid b2CircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\t((b2CircleContact*)contact)->~b2CircleContact();\n\tallocator->Free(contact, sizeof(b2CircleContact));\n}\n\nb2CircleContact::b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB)\n\t: b2Contact(fixtureA, 0, fixtureB, 0)\n{\n\tb2Assert(m_fixtureA->GetType() == b2Shape::e_circle);\n\tb2Assert(m_fixtureB->GetType() == b2Shape::e_circle);\n}\n\nvoid b2CircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2CollideCircles(manifold,\n\t\t\t\t\t(b2CircleShape*)m_fixtureA->GetShape(), xfA,\n\t\t\t\t\t(b2CircleShape*)m_fixtureB->GetShape(), xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2CircleContact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CIRCLE_CONTACT_H\n#define B2_CIRCLE_CONTACT_H\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nclass b2BlockAllocator;\n\nclass b2CircleContact : public b2Contact\n{\npublic:\n\tstatic b2Contact* Create(\tb2Fixture* fixtureA, int32 indexA,\n\t\t\t\t\t\t\t\tb2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB);\n\t~b2CircleContact() {}\n\n\tvoid Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2Contact.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n#include <Box2D/Dynamics/Contacts/b2CircleContact.h>\n#include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h>\n#include <Box2D/Dynamics/Contacts/b2PolygonContact.h>\n#include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h>\n#include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h>\n#include <Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h>\n#include <Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h>\n#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>\n\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/b2TimeOfImpact.h>\n#include <Box2D/Collision/Shapes/b2Shape.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2World.h>\n\nb2ContactRegister b2Contact::s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount];\nbool b2Contact::s_initialized = false;\n\nvoid b2Contact::InitializeRegisters()\n{\n\tAddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle);\n\tAddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle);\n\tAddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon);\n\tAddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle);\n\tAddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon);\n\tAddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle);\n\tAddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon);\n}\n\nvoid b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destoryFcn,\n\t\t\t\t\t\tb2Shape::Type type1, b2Shape::Type type2)\n{\n\tb2Assert(0 <= type1 && type1 < b2Shape::e_typeCount);\n\tb2Assert(0 <= type2 && type2 < b2Shape::e_typeCount);\n\t\n\ts_registers[type1][type2].createFcn = createFcn;\n\ts_registers[type1][type2].destroyFcn = destoryFcn;\n\ts_registers[type1][type2].primary = true;\n\n\tif (type1 != type2)\n\t{\n\t\ts_registers[type2][type1].createFcn = createFcn;\n\t\ts_registers[type2][type1].destroyFcn = destoryFcn;\n\t\ts_registers[type2][type1].primary = false;\n\t}\n}\n\nb2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator)\n{\n\tif (s_initialized == false)\n\t{\n\t\tInitializeRegisters();\n\t\ts_initialized = true;\n\t}\n\n\tb2Shape::Type type1 = fixtureA->GetType();\n\tb2Shape::Type type2 = fixtureB->GetType();\n\n\tb2Assert(0 <= type1 && type1 < b2Shape::e_typeCount);\n\tb2Assert(0 <= type2 && type2 < b2Shape::e_typeCount);\n\t\n\tb2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn;\n\tif (createFcn)\n\t{\n\t\tif (s_registers[type1][type2].primary)\n\t\t{\n\t\t\treturn createFcn(fixtureA, indexA, fixtureB, indexB, allocator);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn createFcn(fixtureB, indexB, fixtureA, indexA, allocator);\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn NULL;\n\t}\n}\n\nvoid b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\tb2Assert(s_initialized == true);\n\n\tb2Fixture* fixtureA = contact->m_fixtureA;\n\tb2Fixture* fixtureB = contact->m_fixtureB;\n\n\tif (contact->m_manifold.pointCount > 0 &&\n\t\tfixtureA->IsSensor() == false &&\n\t\tfixtureB->IsSensor() == false)\n\t{\n\t\tfixtureA->GetBody()->SetAwake(true);\n\t\tfixtureB->GetBody()->SetAwake(true);\n\t}\n\n\tb2Shape::Type typeA = fixtureA->GetType();\n\tb2Shape::Type typeB = fixtureB->GetType();\n\n\tb2Assert(0 <= typeA && typeB < b2Shape::e_typeCount);\n\tb2Assert(0 <= typeA && typeB < b2Shape::e_typeCount);\n\n\tb2ContactDestroyFcn* destroyFcn = s_registers[typeA][typeB].destroyFcn;\n\tdestroyFcn(contact, allocator);\n}\n\nb2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB)\n{\n\tm_flags = e_enabledFlag;\n\n\tm_fixtureA = fA;\n\tm_fixtureB = fB;\n\n\tm_indexA = indexA;\n\tm_indexB = indexB;\n\n\tm_manifold.pointCount = 0;\n\n\tm_prev = NULL;\n\tm_next = NULL;\n\n\tm_nodeA.contact = NULL;\n\tm_nodeA.prev = NULL;\n\tm_nodeA.next = NULL;\n\tm_nodeA.other = NULL;\n\n\tm_nodeB.contact = NULL;\n\tm_nodeB.prev = NULL;\n\tm_nodeB.next = NULL;\n\tm_nodeB.other = NULL;\n\n\tm_toiCount = 0;\n\n\tm_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction);\n\tm_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution);\n\n\tm_tangentSpeed = 0.0f;\n}\n\n// Update the contact manifold and touching status.\n// Note: do not assume the fixture AABBs are overlapping or are valid.\nvoid b2Contact::Update(b2ContactListener* listener)\n{\n\tb2Manifold oldManifold = m_manifold;\n\n\t// Re-enable this contact.\n\tm_flags |= e_enabledFlag;\n\n\tbool touching = false;\n\tbool wasTouching = (m_flags & e_touchingFlag) == e_touchingFlag;\n\n\tbool sensorA = m_fixtureA->IsSensor();\n\tbool sensorB = m_fixtureB->IsSensor();\n\tbool sensor = sensorA || sensorB;\n\n\tb2Body* bodyA = m_fixtureA->GetBody();\n\tb2Body* bodyB = m_fixtureB->GetBody();\n\tconst b2Transform& xfA = bodyA->GetTransform();\n\tconst b2Transform& xfB = bodyB->GetTransform();\n\n\t// Is this contact a sensor?\n\tif (sensor)\n\t{\n\t\tconst b2Shape* shapeA = m_fixtureA->GetShape();\n\t\tconst b2Shape* shapeB = m_fixtureB->GetShape();\n\t\ttouching = b2TestOverlap(shapeA, m_indexA, shapeB, m_indexB, xfA, xfB);\n\n\t\t// Sensors don't generate manifolds.\n\t\tm_manifold.pointCount = 0;\n\t}\n\telse\n\t{\n\t\tEvaluate(&m_manifold, xfA, xfB);\n\t\ttouching = m_manifold.pointCount > 0;\n\n\t\t// Match old contact ids to new contact ids and copy the\n\t\t// stored impulses to warm start the solver.\n\t\tfor (int32 i = 0; i < m_manifold.pointCount; ++i)\n\t\t{\n\t\t\tb2ManifoldPoint* mp2 = m_manifold.points + i;\n\t\t\tmp2->normalImpulse = 0.0f;\n\t\t\tmp2->tangentImpulse = 0.0f;\n\t\t\tb2ContactID id2 = mp2->id;\n\n\t\t\tfor (int32 j = 0; j < oldManifold.pointCount; ++j)\n\t\t\t{\n\t\t\t\tb2ManifoldPoint* mp1 = oldManifold.points + j;\n\n\t\t\t\tif (mp1->id.key == id2.key)\n\t\t\t\t{\n\t\t\t\t\tmp2->normalImpulse = mp1->normalImpulse;\n\t\t\t\t\tmp2->tangentImpulse = mp1->tangentImpulse;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (touching != wasTouching)\n\t\t{\n\t\t\tbodyA->SetAwake(true);\n\t\t\tbodyB->SetAwake(true);\n\t\t}\n\t}\n\n\tif (touching)\n\t{\n\t\tm_flags |= e_touchingFlag;\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_touchingFlag;\n\t}\n\n\tif (wasTouching == false && touching == true && listener)\n\t{\n\t\tlistener->BeginContact(this);\n\t}\n\n\tif (wasTouching == true && touching == false && listener)\n\t{\n\t\tlistener->EndContact(this);\n\t}\n\n\tif (sensor == false && touching && listener)\n\t{\n\t\tlistener->PreSolve(this, &oldManifold);\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2Contact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CONTACT_H\n#define B2_CONTACT_H\n\n#include <Box2D/Common/b2Math.h>\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/Shapes/b2Shape.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n\nclass b2Body;\nclass b2Contact;\nclass b2Fixture;\nclass b2World;\nclass b2BlockAllocator;\nclass b2StackAllocator;\nclass b2ContactListener;\n\n/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero.\n/// For example, anything slides on ice.\ninline float32 b2MixFriction(float32 friction1, float32 friction2)\n{\n\treturn b2Sqrt(friction1 * friction2);\n}\n\n/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface.\n/// For example, a superball bounces on anything.\ninline float32 b2MixRestitution(float32 restitution1, float32 restitution2)\n{\n\treturn restitution1 > restitution2 ? restitution1 : restitution2;\n}\n\ntypedef b2Contact* b2ContactCreateFcn(\tb2Fixture* fixtureA, int32 indexA,\n\t\t\t\t\t\t\t\t\t\tb2Fixture* fixtureB, int32 indexB,\n\t\t\t\t\t\t\t\t\t\tb2BlockAllocator* allocator);\ntypedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator);\n\nstruct b2ContactRegister\n{\n\tb2ContactCreateFcn* createFcn;\n\tb2ContactDestroyFcn* destroyFcn;\n\tbool primary;\n};\n\n/// A contact edge is used to connect bodies and contacts together\n/// in a contact graph where each body is a node and each contact\n/// is an edge. A contact edge belongs to a doubly linked list\n/// maintained in each attached body. Each contact has two contact\n/// nodes, one for each attached body.\nstruct b2ContactEdge\n{\n\tb2Body* other;\t\t\t///< provides quick access to the other body attached.\n\tb2Contact* contact;\t\t///< the contact\n\tb2ContactEdge* prev;\t///< the previous contact edge in the body's contact list\n\tb2ContactEdge* next;\t///< the next contact edge in the body's contact list\n};\n\n/// The class manages contact between two shapes. A contact exists for each overlapping\n/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist\n/// that has no contact points.\nclass b2Contact\n{\npublic:\n\n\t/// Get the contact manifold. Do not modify the manifold unless you understand the\n\t/// internals of Box2D.\n\tb2Manifold* GetManifold();\n\tconst b2Manifold* GetManifold() const;\n\n\t/// Get the world manifold.\n\tvoid GetWorldManifold(b2WorldManifold* worldManifold) const;\n\n\t/// Is this contact touching?\n\tbool IsTouching() const;\n\n\t/// Enable/disable this contact. This can be used inside the pre-solve\n\t/// contact listener. The contact is only disabled for the current\n\t/// time step (or sub-step in continuous collisions).\n\tvoid SetEnabled(bool flag);\n\n\t/// Has this contact been disabled?\n\tbool IsEnabled() const;\n\n\t/// Get the next contact in the world's contact list.\n\tb2Contact* GetNext();\n\tconst b2Contact* GetNext() const;\n\n\t/// Get fixture A in this contact.\n\tb2Fixture* GetFixtureA();\n\tconst b2Fixture* GetFixtureA() const;\n\n\t/// Get the child primitive index for fixture A.\n\tint32 GetChildIndexA() const;\n\n\t/// Get fixture B in this contact.\n\tb2Fixture* GetFixtureB();\n\tconst b2Fixture* GetFixtureB() const;\n\n\t/// Get the child primitive index for fixture B.\n\tint32 GetChildIndexB() const;\n\n\t/// Override the default friction mixture. You can call this in b2ContactListener::PreSolve.\n\t/// This value persists until set or reset.\n\tvoid SetFriction(float32 friction);\n\n\t/// Get the friction.\n\tfloat32 GetFriction() const;\n\n\t/// Reset the friction mixture to the default value.\n\tvoid ResetFriction();\n\n\t/// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve.\n\t/// The value persists until you set or reset.\n\tvoid SetRestitution(float32 restitution);\n\n\t/// Get the restitution.\n\tfloat32 GetRestitution() const;\n\n\t/// Reset the restitution to the default value.\n\tvoid ResetRestitution();\n\n\t/// Set the desired tangent speed for a conveyor belt behavior. In meters per second.\n\tvoid SetTangentSpeed(float32 speed);\n\n\t/// Get the desired tangent speed. In meters per second.\n\tfloat32 GetTangentSpeed() const;\n\n\t/// Evaluate this contact with your own manifold and transforms.\n\tvirtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0;\n\nprotected:\n\tfriend class b2ContactManager;\n\tfriend class b2World;\n\tfriend class b2ContactSolver;\n\tfriend class b2Body;\n\tfriend class b2Fixture;\n\n\t// Flags stored in m_flags\n\tenum\n\t{\n\t\t// Used when crawling contact graph when forming islands.\n\t\te_islandFlag\t\t= 0x0001,\n\n        // Set when the shapes are touching.\n\t\te_touchingFlag\t\t= 0x0002,\n\n\t\t// This contact can be disabled (by user)\n\t\te_enabledFlag\t\t= 0x0004,\n\n\t\t// This contact needs filtering because a fixture filter was changed.\n\t\te_filterFlag\t\t= 0x0008,\n\n\t\t// This bullet contact had a TOI event\n\t\te_bulletHitFlag\t\t= 0x0010,\n\n\t\t// This contact has a valid TOI in m_toi\n\t\te_toiFlag\t\t\t= 0x0020\n\t};\n\n\t/// Flag this contact for filtering. Filtering will occur the next time step.\n\tvoid FlagForFiltering();\n\n\tstatic void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn,\n\t\t\t\t\t\tb2Shape::Type typeA, b2Shape::Type typeB);\n\tstatic void InitializeRegisters();\n\tstatic b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {}\n\tb2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB);\n\tvirtual ~b2Contact() {}\n\n\tvoid Update(b2ContactListener* listener);\n\n\tstatic b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount];\n\tstatic bool s_initialized;\n\n\tuint32 m_flags;\n\n\t// World pool and list pointers.\n\tb2Contact* m_prev;\n\tb2Contact* m_next;\n\n\t// Nodes for connecting bodies.\n\tb2ContactEdge m_nodeA;\n\tb2ContactEdge m_nodeB;\n\n\tb2Fixture* m_fixtureA;\n\tb2Fixture* m_fixtureB;\n\n\tint32 m_indexA;\n\tint32 m_indexB;\n\n\tb2Manifold m_manifold;\n\n\tint32 m_toiCount;\n\tfloat32 m_toi;\n\n\tfloat32 m_friction;\n\tfloat32 m_restitution;\n\n\tfloat32 m_tangentSpeed;\n};\n\ninline b2Manifold* b2Contact::GetManifold()\n{\n\treturn &m_manifold;\n}\n\ninline const b2Manifold* b2Contact::GetManifold() const\n{\n\treturn &m_manifold;\n}\n\ninline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const\n{\n\tconst b2Body* bodyA = m_fixtureA->GetBody();\n\tconst b2Body* bodyB = m_fixtureB->GetBody();\n\tconst b2Shape* shapeA = m_fixtureA->GetShape();\n\tconst b2Shape* shapeB = m_fixtureB->GetShape();\n\n\tworldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius);\n}\n\ninline void b2Contact::SetEnabled(bool flag)\n{\n\tif (flag)\n\t{\n\t\tm_flags |= e_enabledFlag;\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_enabledFlag;\n\t}\n}\n\ninline bool b2Contact::IsEnabled() const\n{\n\treturn (m_flags & e_enabledFlag) == e_enabledFlag;\n}\n\ninline bool b2Contact::IsTouching() const\n{\n\treturn (m_flags & e_touchingFlag) == e_touchingFlag;\n}\n\ninline b2Contact* b2Contact::GetNext()\n{\n\treturn m_next;\n}\n\ninline const b2Contact* b2Contact::GetNext() const\n{\n\treturn m_next;\n}\n\ninline b2Fixture* b2Contact::GetFixtureA()\n{\n\treturn m_fixtureA;\n}\n\ninline const b2Fixture* b2Contact::GetFixtureA() const\n{\n\treturn m_fixtureA;\n}\n\ninline b2Fixture* b2Contact::GetFixtureB()\n{\n\treturn m_fixtureB;\n}\n\ninline int32 b2Contact::GetChildIndexA() const\n{\n\treturn m_indexA;\n}\n\ninline const b2Fixture* b2Contact::GetFixtureB() const\n{\n\treturn m_fixtureB;\n}\n\ninline int32 b2Contact::GetChildIndexB() const\n{\n\treturn m_indexB;\n}\n\ninline void b2Contact::FlagForFiltering()\n{\n\tm_flags |= e_filterFlag;\n}\n\ninline void b2Contact::SetFriction(float32 friction)\n{\n\tm_friction = friction;\n}\n\ninline float32 b2Contact::GetFriction() const\n{\n\treturn m_friction;\n}\n\ninline void b2Contact::ResetFriction()\n{\n\tm_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction);\n}\n\ninline void b2Contact::SetRestitution(float32 restitution)\n{\n\tm_restitution = restitution;\n}\n\ninline float32 b2Contact::GetRestitution() const\n{\n\treturn m_restitution;\n}\n\ninline void b2Contact::ResetRestitution()\n{\n\tm_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution);\n}\n\ninline void b2Contact::SetTangentSpeed(float32 speed)\n{\n\tm_tangentSpeed = speed;\n}\n\ninline float32 b2Contact::GetTangentSpeed() const\n{\n\treturn m_tangentSpeed;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2World.h>\n#include <Box2D/Common/b2StackAllocator.h>\n\n#define B2_DEBUG_SOLVER 0\n\nstruct b2ContactPositionConstraint\n{\n\tb2Vec2 localPoints[b2_maxManifoldPoints];\n\tb2Vec2 localNormal;\n\tb2Vec2 localPoint;\n\tint32 indexA;\n\tint32 indexB;\n\tfloat32 invMassA, invMassB;\n\tb2Vec2 localCenterA, localCenterB;\n\tfloat32 invIA, invIB;\n\tb2Manifold::Type type;\n\tfloat32 radiusA, radiusB;\n\tint32 pointCount;\n};\n\nb2ContactSolver::b2ContactSolver(b2ContactSolverDef* def)\n{\n\tm_step = def->step;\n\tm_allocator = def->allocator;\n\tm_count = def->count;\n\tm_positionConstraints = (b2ContactPositionConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactPositionConstraint));\n\tm_velocityConstraints = (b2ContactVelocityConstraint*)m_allocator->Allocate(m_count * sizeof(b2ContactVelocityConstraint));\n\tm_positions = def->positions;\n\tm_velocities = def->velocities;\n\tm_contacts = def->contacts;\n\n\t// Initialize position independent portions of the constraints.\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tb2Contact* contact = m_contacts[i];\n\n\t\tb2Fixture* fixtureA = contact->m_fixtureA;\n\t\tb2Fixture* fixtureB = contact->m_fixtureB;\n\t\tb2Shape* shapeA = fixtureA->GetShape();\n\t\tb2Shape* shapeB = fixtureB->GetShape();\n\t\tfloat32 radiusA = shapeA->m_radius;\n\t\tfloat32 radiusB = shapeB->m_radius;\n\t\tb2Body* bodyA = fixtureA->GetBody();\n\t\tb2Body* bodyB = fixtureB->GetBody();\n\t\tb2Manifold* manifold = contact->GetManifold();\n\n\t\tint32 pointCount = manifold->pointCount;\n\t\tb2Assert(pointCount > 0);\n\n\t\tb2ContactVelocityConstraint* vc = m_velocityConstraints + i;\n\t\tvc->friction = contact->m_friction;\n\t\tvc->restitution = contact->m_restitution;\n\t\tvc->tangentSpeed = contact->m_tangentSpeed;\n\t\tvc->indexA = bodyA->m_islandIndex;\n\t\tvc->indexB = bodyB->m_islandIndex;\n\t\tvc->invMassA = bodyA->m_invMass;\n\t\tvc->invMassB = bodyB->m_invMass;\n\t\tvc->invIA = bodyA->m_invI;\n\t\tvc->invIB = bodyB->m_invI;\n\t\tvc->contactIndex = i;\n\t\tvc->pointCount = pointCount;\n\t\tvc->K.SetZero();\n\t\tvc->normalMass.SetZero();\n\n\t\tb2ContactPositionConstraint* pc = m_positionConstraints + i;\n\t\tpc->indexA = bodyA->m_islandIndex;\n\t\tpc->indexB = bodyB->m_islandIndex;\n\t\tpc->invMassA = bodyA->m_invMass;\n\t\tpc->invMassB = bodyB->m_invMass;\n\t\tpc->localCenterA = bodyA->m_sweep.localCenter;\n\t\tpc->localCenterB = bodyB->m_sweep.localCenter;\n\t\tpc->invIA = bodyA->m_invI;\n\t\tpc->invIB = bodyB->m_invI;\n\t\tpc->localNormal = manifold->localNormal;\n\t\tpc->localPoint = manifold->localPoint;\n\t\tpc->pointCount = pointCount;\n\t\tpc->radiusA = radiusA;\n\t\tpc->radiusB = radiusB;\n\t\tpc->type = manifold->type;\n\n\t\tfor (int32 j = 0; j < pointCount; ++j)\n\t\t{\n\t\t\tb2ManifoldPoint* cp = manifold->points + j;\n\t\t\tb2VelocityConstraintPoint* vcp = vc->points + j;\n\t\n\t\t\tif (m_step.warmStarting)\n\t\t\t{\n\t\t\t\tvcp->normalImpulse = m_step.dtRatio * cp->normalImpulse;\n\t\t\t\tvcp->tangentImpulse = m_step.dtRatio * cp->tangentImpulse;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvcp->normalImpulse = 0.0f;\n\t\t\t\tvcp->tangentImpulse = 0.0f;\n\t\t\t}\n\n\t\t\tvcp->rA.SetZero();\n\t\t\tvcp->rB.SetZero();\n\t\t\tvcp->normalMass = 0.0f;\n\t\t\tvcp->tangentMass = 0.0f;\n\t\t\tvcp->velocityBias = 0.0f;\n\n\t\t\tpc->localPoints[j] = cp->localPoint;\n\t\t}\n\t}\n}\n\nb2ContactSolver::~b2ContactSolver()\n{\n\tm_allocator->Free(m_velocityConstraints);\n\tm_allocator->Free(m_positionConstraints);\n}\n\n// Initialize position dependent portions of the velocity constraints.\nvoid b2ContactSolver::InitializeVelocityConstraints()\n{\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tb2ContactVelocityConstraint* vc = m_velocityConstraints + i;\n\t\tb2ContactPositionConstraint* pc = m_positionConstraints + i;\n\n\t\tfloat32 radiusA = pc->radiusA;\n\t\tfloat32 radiusB = pc->radiusB;\n\t\tb2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold();\n\n\t\tint32 indexA = vc->indexA;\n\t\tint32 indexB = vc->indexB;\n\n\t\tfloat32 mA = vc->invMassA;\n\t\tfloat32 mB = vc->invMassB;\n\t\tfloat32 iA = vc->invIA;\n\t\tfloat32 iB = vc->invIB;\n\t\tb2Vec2 localCenterA = pc->localCenterA;\n\t\tb2Vec2 localCenterB = pc->localCenterB;\n\n\t\tb2Vec2 cA = m_positions[indexA].c;\n\t\tfloat32 aA = m_positions[indexA].a;\n\t\tb2Vec2 vA = m_velocities[indexA].v;\n\t\tfloat32 wA = m_velocities[indexA].w;\n\n\t\tb2Vec2 cB = m_positions[indexB].c;\n\t\tfloat32 aB = m_positions[indexB].a;\n\t\tb2Vec2 vB = m_velocities[indexB].v;\n\t\tfloat32 wB = m_velocities[indexB].w;\n\n\t\tb2Assert(manifold->pointCount > 0);\n\n\t\tb2Transform xfA, xfB;\n\t\txfA.q.Set(aA);\n\t\txfB.q.Set(aB);\n\t\txfA.p = cA - b2Mul(xfA.q, localCenterA);\n\t\txfB.p = cB - b2Mul(xfB.q, localCenterB);\n\n\t\tb2WorldManifold worldManifold;\n\t\tworldManifold.Initialize(manifold, xfA, radiusA, xfB, radiusB);\n\n\t\tvc->normal = worldManifold.normal;\n\n\t\tint32 pointCount = vc->pointCount;\n\t\tfor (int32 j = 0; j < pointCount; ++j)\n\t\t{\n\t\t\tb2VelocityConstraintPoint* vcp = vc->points + j;\n\n\t\t\tvcp->rA = worldManifold.points[j] - cA;\n\t\t\tvcp->rB = worldManifold.points[j] - cB;\n\n\t\t\tfloat32 rnA = b2Cross(vcp->rA, vc->normal);\n\t\t\tfloat32 rnB = b2Cross(vcp->rB, vc->normal);\n\n\t\t\tfloat32 kNormal = mA + mB + iA * rnA * rnA + iB * rnB * rnB;\n\n\t\t\tvcp->normalMass = kNormal > 0.0f ? 1.0f / kNormal : 0.0f;\n\n\t\t\tb2Vec2 tangent = b2Cross(vc->normal, 1.0f);\n\n\t\t\tfloat32 rtA = b2Cross(vcp->rA, tangent);\n\t\t\tfloat32 rtB = b2Cross(vcp->rB, tangent);\n\n\t\t\tfloat32 kTangent = mA + mB + iA * rtA * rtA + iB * rtB * rtB;\n\n\t\t\tvcp->tangentMass = kTangent > 0.0f ? 1.0f /  kTangent : 0.0f;\n\n\t\t\t// Setup a velocity bias for restitution.\n\t\t\tvcp->velocityBias = 0.0f;\n\t\t\tfloat32 vRel = b2Dot(vc->normal, vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA));\n\t\t\tif (vRel < -b2_velocityThreshold)\n\t\t\t{\n\t\t\t\tvcp->velocityBias = -vc->restitution * vRel;\n\t\t\t}\n\t\t}\n\n\t\t// If we have two points, then prepare the block solver.\n\t\tif (vc->pointCount == 2)\n\t\t{\n\t\t\tb2VelocityConstraintPoint* vcp1 = vc->points + 0;\n\t\t\tb2VelocityConstraintPoint* vcp2 = vc->points + 1;\n\n\t\t\tfloat32 rn1A = b2Cross(vcp1->rA, vc->normal);\n\t\t\tfloat32 rn1B = b2Cross(vcp1->rB, vc->normal);\n\t\t\tfloat32 rn2A = b2Cross(vcp2->rA, vc->normal);\n\t\t\tfloat32 rn2B = b2Cross(vcp2->rB, vc->normal);\n\n\t\t\tfloat32 k11 = mA + mB + iA * rn1A * rn1A + iB * rn1B * rn1B;\n\t\t\tfloat32 k22 = mA + mB + iA * rn2A * rn2A + iB * rn2B * rn2B;\n\t\t\tfloat32 k12 = mA + mB + iA * rn1A * rn2A + iB * rn1B * rn2B;\n\n\t\t\t// Ensure a reasonable condition number.\n\t\t\tconst float32 k_maxConditionNumber = 1000.0f;\n\t\t\tif (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12))\n\t\t\t{\n\t\t\t\t// K is safe to invert.\n\t\t\t\tvc->K.ex.Set(k11, k12);\n\t\t\t\tvc->K.ey.Set(k12, k22);\n\t\t\t\tvc->normalMass = vc->K.GetInverse();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The constraints are redundant, just use one.\n\t\t\t\t// TODO_ERIN use deepest?\n\t\t\t\tvc->pointCount = 1;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid b2ContactSolver::WarmStart()\n{\n\t// Warm start.\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tb2ContactVelocityConstraint* vc = m_velocityConstraints + i;\n\n\t\tint32 indexA = vc->indexA;\n\t\tint32 indexB = vc->indexB;\n\t\tfloat32 mA = vc->invMassA;\n\t\tfloat32 iA = vc->invIA;\n\t\tfloat32 mB = vc->invMassB;\n\t\tfloat32 iB = vc->invIB;\n\t\tint32 pointCount = vc->pointCount;\n\n\t\tb2Vec2 vA = m_velocities[indexA].v;\n\t\tfloat32 wA = m_velocities[indexA].w;\n\t\tb2Vec2 vB = m_velocities[indexB].v;\n\t\tfloat32 wB = m_velocities[indexB].w;\n\n\t\tb2Vec2 normal = vc->normal;\n\t\tb2Vec2 tangent = b2Cross(normal, 1.0f);\n\n\t\tfor (int32 j = 0; j < pointCount; ++j)\n\t\t{\n\t\t\tb2VelocityConstraintPoint* vcp = vc->points + j;\n\t\t\tb2Vec2 P = vcp->normalImpulse * normal + vcp->tangentImpulse * tangent;\n\t\t\twA -= iA * b2Cross(vcp->rA, P);\n\t\t\tvA -= mA * P;\n\t\t\twB += iB * b2Cross(vcp->rB, P);\n\t\t\tvB += mB * P;\n\t\t}\n\n\t\tm_velocities[indexA].v = vA;\n\t\tm_velocities[indexA].w = wA;\n\t\tm_velocities[indexB].v = vB;\n\t\tm_velocities[indexB].w = wB;\n\t}\n}\n\nvoid b2ContactSolver::SolveVelocityConstraints()\n{\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tb2ContactVelocityConstraint* vc = m_velocityConstraints + i;\n\n\t\tint32 indexA = vc->indexA;\n\t\tint32 indexB = vc->indexB;\n\t\tfloat32 mA = vc->invMassA;\n\t\tfloat32 iA = vc->invIA;\n\t\tfloat32 mB = vc->invMassB;\n\t\tfloat32 iB = vc->invIB;\n\t\tint32 pointCount = vc->pointCount;\n\n\t\tb2Vec2 vA = m_velocities[indexA].v;\n\t\tfloat32 wA = m_velocities[indexA].w;\n\t\tb2Vec2 vB = m_velocities[indexB].v;\n\t\tfloat32 wB = m_velocities[indexB].w;\n\n\t\tb2Vec2 normal = vc->normal;\n\t\tb2Vec2 tangent = b2Cross(normal, 1.0f);\n\t\tfloat32 friction = vc->friction;\n\n\t\tb2Assert(pointCount == 1 || pointCount == 2);\n\n\t\t// Solve tangent constraints first because non-penetration is more important\n\t\t// than friction.\n\t\tfor (int32 j = 0; j < pointCount; ++j)\n\t\t{\n\t\t\tb2VelocityConstraintPoint* vcp = vc->points + j;\n\n\t\t\t// Relative velocity at contact\n\t\t\tb2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA);\n\n\t\t\t// Compute tangent force\n\t\t\tfloat32 vt = b2Dot(dv, tangent) - vc->tangentSpeed;\n\t\t\tfloat32 lambda = vcp->tangentMass * (-vt);\n\n\t\t\t// b2Clamp the accumulated force\n\t\t\tfloat32 maxFriction = friction * vcp->normalImpulse;\n\t\t\tfloat32 newImpulse = b2Clamp(vcp->tangentImpulse + lambda, -maxFriction, maxFriction);\n\t\t\tlambda = newImpulse - vcp->tangentImpulse;\n\t\t\tvcp->tangentImpulse = newImpulse;\n\n\t\t\t// Apply contact impulse\n\t\t\tb2Vec2 P = lambda * tangent;\n\n\t\t\tvA -= mA * P;\n\t\t\twA -= iA * b2Cross(vcp->rA, P);\n\n\t\t\tvB += mB * P;\n\t\t\twB += iB * b2Cross(vcp->rB, P);\n\t\t}\n\n\t\t// Solve normal constraints\n\t\tif (vc->pointCount == 1)\n\t\t{\n\t\t\tb2VelocityConstraintPoint* vcp = vc->points + 0;\n\n\t\t\t// Relative velocity at contact\n\t\t\tb2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA);\n\n\t\t\t// Compute normal impulse\n\t\t\tfloat32 vn = b2Dot(dv, normal);\n\t\t\tfloat32 lambda = -vcp->normalMass * (vn - vcp->velocityBias);\n\n\t\t\t// b2Clamp the accumulated impulse\n\t\t\tfloat32 newImpulse = b2Max(vcp->normalImpulse + lambda, 0.0f);\n\t\t\tlambda = newImpulse - vcp->normalImpulse;\n\t\t\tvcp->normalImpulse = newImpulse;\n\n\t\t\t// Apply contact impulse\n\t\t\tb2Vec2 P = lambda * normal;\n\t\t\tvA -= mA * P;\n\t\t\twA -= iA * b2Cross(vcp->rA, P);\n\n\t\t\tvB += mB * P;\n\t\t\twB += iB * b2Cross(vcp->rB, P);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Block solver developed in collaboration with Dirk Gregorius (back in 01/07 on Box2D_Lite).\n\t\t\t// Build the mini LCP for this contact patch\n\t\t\t//\n\t\t\t// vn = A * x + b, vn >= 0, , vn >= 0, x >= 0 and vn_i * x_i = 0 with i = 1..2\n\t\t\t//\n\t\t\t// A = J * W * JT and J = ( -n, -r1 x n, n, r2 x n )\n\t\t\t// b = vn0 - velocityBias\n\t\t\t//\n\t\t\t// The system is solved using the \"Total enumeration method\" (s. Murty). The complementary constraint vn_i * x_i\n\t\t\t// implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases\n\t\t\t// vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid\n\t\t\t// solution that satisfies the problem is chosen.\n\t\t\t// \n\t\t\t// In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires\n\t\t\t// that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i).\n\t\t\t//\n\t\t\t// Substitute:\n\t\t\t// \n\t\t\t// x = a + d\n\t\t\t// \n\t\t\t// a := old total impulse\n\t\t\t// x := new total impulse\n\t\t\t// d := incremental impulse \n\t\t\t//\n\t\t\t// For the current iteration we extend the formula for the incremental impulse\n\t\t\t// to compute the new total impulse:\n\t\t\t//\n\t\t\t// vn = A * d + b\n\t\t\t//    = A * (x - a) + b\n\t\t\t//    = A * x + b - A * a\n\t\t\t//    = A * x + b'\n\t\t\t// b' = b - A * a;\n\n\t\t\tb2VelocityConstraintPoint* cp1 = vc->points + 0;\n\t\t\tb2VelocityConstraintPoint* cp2 = vc->points + 1;\n\n\t\t\tb2Vec2 a(cp1->normalImpulse, cp2->normalImpulse);\n\t\t\tb2Assert(a.x >= 0.0f && a.y >= 0.0f);\n\n\t\t\t// Relative velocity at contact\n\t\t\tb2Vec2 dv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA);\n\t\t\tb2Vec2 dv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA);\n\n\t\t\t// Compute normal velocity\n\t\t\tfloat32 vn1 = b2Dot(dv1, normal);\n\t\t\tfloat32 vn2 = b2Dot(dv2, normal);\n\n\t\t\tb2Vec2 b;\n\t\t\tb.x = vn1 - cp1->velocityBias;\n\t\t\tb.y = vn2 - cp2->velocityBias;\n\n\t\t\t// Compute b'\n\t\t\tb -= b2Mul(vc->K, a);\n\n\t\t\tconst float32 k_errorTol = 1e-3f;\n\t\t\tB2_NOT_USED(k_errorTol);\n\n\t\t\tfor (;;)\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t// Case 1: vn = 0\n\t\t\t\t//\n\t\t\t\t// 0 = A * x + b'\n\t\t\t\t//\n\t\t\t\t// Solve for x:\n\t\t\t\t//\n\t\t\t\t// x = - inv(A) * b'\n\t\t\t\t//\n\t\t\t\tb2Vec2 x = - b2Mul(vc->normalMass, b);\n\n\t\t\t\tif (x.x >= 0.0f && x.y >= 0.0f)\n\t\t\t\t{\n\t\t\t\t\t// Get the incremental impulse\n\t\t\t\t\tb2Vec2 d = x - a;\n\n\t\t\t\t\t// Apply incremental impulse\n\t\t\t\t\tb2Vec2 P1 = d.x * normal;\n\t\t\t\t\tb2Vec2 P2 = d.y * normal;\n\t\t\t\t\tvA -= mA * (P1 + P2);\n\t\t\t\t\twA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2));\n\n\t\t\t\t\tvB += mB * (P1 + P2);\n\t\t\t\t\twB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2));\n\n\t\t\t\t\t// Accumulate\n\t\t\t\t\tcp1->normalImpulse = x.x;\n\t\t\t\t\tcp2->normalImpulse = x.y;\n\n#if B2_DEBUG_SOLVER == 1\n\t\t\t\t\t// Postconditions\n\t\t\t\t\tdv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA);\n\t\t\t\t\tdv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA);\n\n\t\t\t\t\t// Compute normal velocity\n\t\t\t\t\tvn1 = b2Dot(dv1, normal);\n\t\t\t\t\tvn2 = b2Dot(dv2, normal);\n\n\t\t\t\t\tb2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol);\n\t\t\t\t\tb2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol);\n#endif\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Case 2: vn1 = 0 and x2 = 0\n\t\t\t\t//\n\t\t\t\t//   0 = a11 * x1 + a12 * 0 + b1' \n\t\t\t\t// vn2 = a21 * x1 + a22 * 0 + b2'\n\t\t\t\t//\n\t\t\t\tx.x = - cp1->normalMass * b.x;\n\t\t\t\tx.y = 0.0f;\n\t\t\t\tvn1 = 0.0f;\n\t\t\t\tvn2 = vc->K.ex.y * x.x + b.y;\n\n\t\t\t\tif (x.x >= 0.0f && vn2 >= 0.0f)\n\t\t\t\t{\n\t\t\t\t\t// Get the incremental impulse\n\t\t\t\t\tb2Vec2 d = x - a;\n\n\t\t\t\t\t// Apply incremental impulse\n\t\t\t\t\tb2Vec2 P1 = d.x * normal;\n\t\t\t\t\tb2Vec2 P2 = d.y * normal;\n\t\t\t\t\tvA -= mA * (P1 + P2);\n\t\t\t\t\twA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2));\n\n\t\t\t\t\tvB += mB * (P1 + P2);\n\t\t\t\t\twB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2));\n\n\t\t\t\t\t// Accumulate\n\t\t\t\t\tcp1->normalImpulse = x.x;\n\t\t\t\t\tcp2->normalImpulse = x.y;\n\n#if B2_DEBUG_SOLVER == 1\n\t\t\t\t\t// Postconditions\n\t\t\t\t\tdv1 = vB + b2Cross(wB, cp1->rB) - vA - b2Cross(wA, cp1->rA);\n\n\t\t\t\t\t// Compute normal velocity\n\t\t\t\t\tvn1 = b2Dot(dv1, normal);\n\n\t\t\t\t\tb2Assert(b2Abs(vn1 - cp1->velocityBias) < k_errorTol);\n#endif\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\n\t\t\t\t//\n\t\t\t\t// Case 3: vn2 = 0 and x1 = 0\n\t\t\t\t//\n\t\t\t\t// vn1 = a11 * 0 + a12 * x2 + b1' \n\t\t\t\t//   0 = a21 * 0 + a22 * x2 + b2'\n\t\t\t\t//\n\t\t\t\tx.x = 0.0f;\n\t\t\t\tx.y = - cp2->normalMass * b.y;\n\t\t\t\tvn1 = vc->K.ey.x * x.y + b.x;\n\t\t\t\tvn2 = 0.0f;\n\n\t\t\t\tif (x.y >= 0.0f && vn1 >= 0.0f)\n\t\t\t\t{\n\t\t\t\t\t// Resubstitute for the incremental impulse\n\t\t\t\t\tb2Vec2 d = x - a;\n\n\t\t\t\t\t// Apply incremental impulse\n\t\t\t\t\tb2Vec2 P1 = d.x * normal;\n\t\t\t\t\tb2Vec2 P2 = d.y * normal;\n\t\t\t\t\tvA -= mA * (P1 + P2);\n\t\t\t\t\twA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2));\n\n\t\t\t\t\tvB += mB * (P1 + P2);\n\t\t\t\t\twB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2));\n\n\t\t\t\t\t// Accumulate\n\t\t\t\t\tcp1->normalImpulse = x.x;\n\t\t\t\t\tcp2->normalImpulse = x.y;\n\n#if B2_DEBUG_SOLVER == 1\n\t\t\t\t\t// Postconditions\n\t\t\t\t\tdv2 = vB + b2Cross(wB, cp2->rB) - vA - b2Cross(wA, cp2->rA);\n\n\t\t\t\t\t// Compute normal velocity\n\t\t\t\t\tvn2 = b2Dot(dv2, normal);\n\n\t\t\t\t\tb2Assert(b2Abs(vn2 - cp2->velocityBias) < k_errorTol);\n#endif\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t//\n\t\t\t\t// Case 4: x1 = 0 and x2 = 0\n\t\t\t\t// \n\t\t\t\t// vn1 = b1\n\t\t\t\t// vn2 = b2;\n\t\t\t\tx.x = 0.0f;\n\t\t\t\tx.y = 0.0f;\n\t\t\t\tvn1 = b.x;\n\t\t\t\tvn2 = b.y;\n\n\t\t\t\tif (vn1 >= 0.0f && vn2 >= 0.0f )\n\t\t\t\t{\n\t\t\t\t\t// Resubstitute for the incremental impulse\n\t\t\t\t\tb2Vec2 d = x - a;\n\n\t\t\t\t\t// Apply incremental impulse\n\t\t\t\t\tb2Vec2 P1 = d.x * normal;\n\t\t\t\t\tb2Vec2 P2 = d.y * normal;\n\t\t\t\t\tvA -= mA * (P1 + P2);\n\t\t\t\t\twA -= iA * (b2Cross(cp1->rA, P1) + b2Cross(cp2->rA, P2));\n\n\t\t\t\t\tvB += mB * (P1 + P2);\n\t\t\t\t\twB += iB * (b2Cross(cp1->rB, P1) + b2Cross(cp2->rB, P2));\n\n\t\t\t\t\t// Accumulate\n\t\t\t\t\tcp1->normalImpulse = x.x;\n\t\t\t\t\tcp2->normalImpulse = x.y;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// No solution, give up. This is hit sometimes, but it doesn't seem to matter.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tm_velocities[indexA].v = vA;\n\t\tm_velocities[indexA].w = wA;\n\t\tm_velocities[indexB].v = vB;\n\t\tm_velocities[indexB].w = wB;\n\t}\n}\n\nvoid b2ContactSolver::StoreImpulses()\n{\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tb2ContactVelocityConstraint* vc = m_velocityConstraints + i;\n\t\tb2Manifold* manifold = m_contacts[vc->contactIndex]->GetManifold();\n\n\t\tfor (int32 j = 0; j < vc->pointCount; ++j)\n\t\t{\n\t\t\tmanifold->points[j].normalImpulse = vc->points[j].normalImpulse;\n\t\t\tmanifold->points[j].tangentImpulse = vc->points[j].tangentImpulse;\n\t\t}\n\t}\n}\n\nstruct b2PositionSolverManifold\n{\n\tvoid Initialize(b2ContactPositionConstraint* pc, const b2Transform& xfA, const b2Transform& xfB, int32 index)\n\t{\n\t\tb2Assert(pc->pointCount > 0);\n\n\t\tswitch (pc->type)\n\t\t{\n\t\tcase b2Manifold::e_circles:\n\t\t\t{\n\t\t\t\tb2Vec2 pointA = b2Mul(xfA, pc->localPoint);\n\t\t\t\tb2Vec2 pointB = b2Mul(xfB, pc->localPoints[0]);\n\t\t\t\tnormal = pointB - pointA;\n\t\t\t\tnormal.Normalize();\n\t\t\t\tpoint = 0.5f * (pointA + pointB);\n\t\t\t\tseparation = b2Dot(pointB - pointA, normal) - pc->radiusA - pc->radiusB;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase b2Manifold::e_faceA:\n\t\t\t{\n\t\t\t\tnormal = b2Mul(xfA.q, pc->localNormal);\n\t\t\t\tb2Vec2 planePoint = b2Mul(xfA, pc->localPoint);\n\n\t\t\t\tb2Vec2 clipPoint = b2Mul(xfB, pc->localPoints[index]);\n\t\t\t\tseparation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB;\n\t\t\t\tpoint = clipPoint;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase b2Manifold::e_faceB:\n\t\t\t{\n\t\t\t\tnormal = b2Mul(xfB.q, pc->localNormal);\n\t\t\t\tb2Vec2 planePoint = b2Mul(xfB, pc->localPoint);\n\n\t\t\t\tb2Vec2 clipPoint = b2Mul(xfA, pc->localPoints[index]);\n\t\t\t\tseparation = b2Dot(clipPoint - planePoint, normal) - pc->radiusA - pc->radiusB;\n\t\t\t\tpoint = clipPoint;\n\n\t\t\t\t// Ensure normal points from A to B\n\t\t\t\tnormal = -normal;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tb2Vec2 normal;\n\tb2Vec2 point;\n\tfloat32 separation;\n};\n\n// Sequential solver.\nbool b2ContactSolver::SolvePositionConstraints()\n{\n\tfloat32 minSeparation = 0.0f;\n\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tb2ContactPositionConstraint* pc = m_positionConstraints + i;\n\n\t\tint32 indexA = pc->indexA;\n\t\tint32 indexB = pc->indexB;\n\t\tb2Vec2 localCenterA = pc->localCenterA;\n\t\tfloat32 mA = pc->invMassA;\n\t\tfloat32 iA = pc->invIA;\n\t\tb2Vec2 localCenterB = pc->localCenterB;\n\t\tfloat32 mB = pc->invMassB;\n\t\tfloat32 iB = pc->invIB;\n\t\tint32 pointCount = pc->pointCount;\n\n\t\tb2Vec2 cA = m_positions[indexA].c;\n\t\tfloat32 aA = m_positions[indexA].a;\n\n\t\tb2Vec2 cB = m_positions[indexB].c;\n\t\tfloat32 aB = m_positions[indexB].a;\n\n\t\t// Solve normal constraints\n\t\tfor (int32 j = 0; j < pointCount; ++j)\n\t\t{\n\t\t\tb2Transform xfA, xfB;\n\t\t\txfA.q.Set(aA);\n\t\t\txfB.q.Set(aB);\n\t\t\txfA.p = cA - b2Mul(xfA.q, localCenterA);\n\t\t\txfB.p = cB - b2Mul(xfB.q, localCenterB);\n\n\t\t\tb2PositionSolverManifold psm;\n\t\t\tpsm.Initialize(pc, xfA, xfB, j);\n\t\t\tb2Vec2 normal = psm.normal;\n\n\t\t\tb2Vec2 point = psm.point;\n\t\t\tfloat32 separation = psm.separation;\n\n\t\t\tb2Vec2 rA = point - cA;\n\t\t\tb2Vec2 rB = point - cB;\n\n\t\t\t// Track max constraint error.\n\t\t\tminSeparation = b2Min(minSeparation, separation);\n\n\t\t\t// Prevent large corrections and allow slop.\n\t\t\tfloat32 C = b2Clamp(b2_baumgarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f);\n\n\t\t\t// Compute the effective mass.\n\t\t\tfloat32 rnA = b2Cross(rA, normal);\n\t\t\tfloat32 rnB = b2Cross(rB, normal);\n\t\t\tfloat32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB;\n\n\t\t\t// Compute normal impulse\n\t\t\tfloat32 impulse = K > 0.0f ? - C / K : 0.0f;\n\n\t\t\tb2Vec2 P = impulse * normal;\n\n\t\t\tcA -= mA * P;\n\t\t\taA -= iA * b2Cross(rA, P);\n\n\t\t\tcB += mB * P;\n\t\t\taB += iB * b2Cross(rB, P);\n\t\t}\n\n\t\tm_positions[indexA].c = cA;\n\t\tm_positions[indexA].a = aA;\n\n\t\tm_positions[indexB].c = cB;\n\t\tm_positions[indexB].a = aB;\n\t}\n\n\t// We can't expect minSpeparation >= -b2_linearSlop because we don't\n\t// push the separation above -b2_linearSlop.\n\treturn minSeparation >= -3.0f * b2_linearSlop;\n}\n\n// Sequential position solver for position constraints.\nbool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB)\n{\n\tfloat32 minSeparation = 0.0f;\n\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tb2ContactPositionConstraint* pc = m_positionConstraints + i;\n\n\t\tint32 indexA = pc->indexA;\n\t\tint32 indexB = pc->indexB;\n\t\tb2Vec2 localCenterA = pc->localCenterA;\n\t\tb2Vec2 localCenterB = pc->localCenterB;\n\t\tint32 pointCount = pc->pointCount;\n\n\t\tfloat32 mA = 0.0f;\n\t\tfloat32 iA = 0.0f;\n\t\tif (indexA == toiIndexA || indexA == toiIndexB)\n\t\t{\n\t\t\tmA = pc->invMassA;\n\t\t\tiA = pc->invIA;\n\t\t}\n\n\t\tfloat32 mB = 0.0f;\n\t\tfloat32 iB = 0.;\n\t\tif (indexB == toiIndexA || indexB == toiIndexB)\n\t\t{\n\t\t\tmB = pc->invMassB;\n\t\t\tiB = pc->invIB;\n\t\t}\n\n\t\tb2Vec2 cA = m_positions[indexA].c;\n\t\tfloat32 aA = m_positions[indexA].a;\n\n\t\tb2Vec2 cB = m_positions[indexB].c;\n\t\tfloat32 aB = m_positions[indexB].a;\n\n\t\t// Solve normal constraints\n\t\tfor (int32 j = 0; j < pointCount; ++j)\n\t\t{\n\t\t\tb2Transform xfA, xfB;\n\t\t\txfA.q.Set(aA);\n\t\t\txfB.q.Set(aB);\n\t\t\txfA.p = cA - b2Mul(xfA.q, localCenterA);\n\t\t\txfB.p = cB - b2Mul(xfB.q, localCenterB);\n\n\t\t\tb2PositionSolverManifold psm;\n\t\t\tpsm.Initialize(pc, xfA, xfB, j);\n\t\t\tb2Vec2 normal = psm.normal;\n\n\t\t\tb2Vec2 point = psm.point;\n\t\t\tfloat32 separation = psm.separation;\n\n\t\t\tb2Vec2 rA = point - cA;\n\t\t\tb2Vec2 rB = point - cB;\n\n\t\t\t// Track max constraint error.\n\t\t\tminSeparation = b2Min(minSeparation, separation);\n\n\t\t\t// Prevent large corrections and allow slop.\n\t\t\tfloat32 C = b2Clamp(b2_toiBaugarte * (separation + b2_linearSlop), -b2_maxLinearCorrection, 0.0f);\n\n\t\t\t// Compute the effective mass.\n\t\t\tfloat32 rnA = b2Cross(rA, normal);\n\t\t\tfloat32 rnB = b2Cross(rB, normal);\n\t\t\tfloat32 K = mA + mB + iA * rnA * rnA + iB * rnB * rnB;\n\n\t\t\t// Compute normal impulse\n\t\t\tfloat32 impulse = K > 0.0f ? - C / K : 0.0f;\n\n\t\t\tb2Vec2 P = impulse * normal;\n\n\t\t\tcA -= mA * P;\n\t\t\taA -= iA * b2Cross(rA, P);\n\n\t\t\tcB += mB * P;\n\t\t\taB += iB * b2Cross(rB, P);\n\t\t}\n\n\t\tm_positions[indexA].c = cA;\n\t\tm_positions[indexA].a = aA;\n\n\t\tm_positions[indexB].c = cB;\n\t\tm_positions[indexB].a = aB;\n\t}\n\n\t// We can't expect minSpeparation >= -b2_linearSlop because we don't\n\t// push the separation above -b2_linearSlop.\n\treturn minSeparation >= -1.5f * b2_linearSlop;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2ContactSolver.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CONTACT_SOLVER_H\n#define B2_CONTACT_SOLVER_H\n\n#include <Box2D/Common/b2Math.h>\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\nclass b2Contact;\nclass b2Body;\nclass b2StackAllocator;\nstruct b2ContactPositionConstraint;\n\nstruct b2VelocityConstraintPoint\n{\n\tb2Vec2 rA;\n\tb2Vec2 rB;\n\tfloat32 normalImpulse;\n\tfloat32 tangentImpulse;\n\tfloat32 normalMass;\n\tfloat32 tangentMass;\n\tfloat32 velocityBias;\n};\n\nstruct b2ContactVelocityConstraint\n{\n\tb2VelocityConstraintPoint points[b2_maxManifoldPoints];\n\tb2Vec2 normal;\n\tb2Mat22 normalMass;\n\tb2Mat22 K;\n\tint32 indexA;\n\tint32 indexB;\n\tfloat32 invMassA, invMassB;\n\tfloat32 invIA, invIB;\n\tfloat32 friction;\n\tfloat32 restitution;\n\tfloat32 tangentSpeed;\n\tint32 pointCount;\n\tint32 contactIndex;\n};\n\nstruct b2ContactSolverDef\n{\n\tb2TimeStep step;\n\tb2Contact** contacts;\n\tint32 count;\n\tb2Position* positions;\n\tb2Velocity* velocities;\n\tb2StackAllocator* allocator;\n};\n\nclass b2ContactSolver\n{\npublic:\n\tb2ContactSolver(b2ContactSolverDef* def);\n\t~b2ContactSolver();\n\n\tvoid InitializeVelocityConstraints();\n\n\tvoid WarmStart();\n\tvoid SolveVelocityConstraints();\n\tvoid StoreImpulses();\n\n\tbool SolvePositionConstraints();\n\tbool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB);\n\n\tb2TimeStep m_step;\n\tb2Position* m_positions;\n\tb2Velocity* m_velocities;\n\tb2StackAllocator* m_allocator;\n\tb2ContactPositionConstraint* m_positionConstraints;\n\tb2ContactVelocityConstraint* m_velocityConstraints;\n\tb2Contact** m_contacts;\n\tint m_count;\n};\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n\n#include <new>\n\nb2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact));\n\treturn new (mem) b2EdgeAndCircleContact(fixtureA, fixtureB);\n}\n\nvoid b2EdgeAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\t((b2EdgeAndCircleContact*)contact)->~b2EdgeAndCircleContact();\n\tallocator->Free(contact, sizeof(b2EdgeAndCircleContact));\n}\n\nb2EdgeAndCircleContact::b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB)\n: b2Contact(fixtureA, 0, fixtureB, 0)\n{\n\tb2Assert(m_fixtureA->GetType() == b2Shape::e_edge);\n\tb2Assert(m_fixtureB->GetType() == b2Shape::e_circle);\n}\n\nvoid b2EdgeAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2CollideEdgeAndCircle(\tmanifold,\n\t\t\t\t\t\t\t\t(b2EdgeShape*)m_fixtureA->GetShape(), xfA,\n\t\t\t\t\t\t\t\t(b2CircleShape*)m_fixtureB->GetShape(), xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H\n#define B2_EDGE_AND_CIRCLE_CONTACT_H\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nclass b2BlockAllocator;\n\nclass b2EdgeAndCircleContact : public b2Contact\n{\npublic:\n\tstatic b2Contact* Create(\tb2Fixture* fixtureA, int32 indexA,\n\t\t\t\t\t\t\t\tb2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB);\n\t~b2EdgeAndCircleContact() {}\n\n\tvoid Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp",
    "content": "/*\n* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n\n#include <new>\n\nb2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2EdgeAndPolygonContact));\n\treturn new (mem) b2EdgeAndPolygonContact(fixtureA, fixtureB);\n}\n\nvoid b2EdgeAndPolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\t((b2EdgeAndPolygonContact*)contact)->~b2EdgeAndPolygonContact();\n\tallocator->Free(contact, sizeof(b2EdgeAndPolygonContact));\n}\n\nb2EdgeAndPolygonContact::b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB)\n: b2Contact(fixtureA, 0, fixtureB, 0)\n{\n\tb2Assert(m_fixtureA->GetType() == b2Shape::e_edge);\n\tb2Assert(m_fixtureB->GetType() == b2Shape::e_polygon);\n}\n\nvoid b2EdgeAndPolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2CollideEdgeAndPolygon(\tmanifold,\n\t\t\t\t\t\t\t\t(b2EdgeShape*)m_fixtureA->GetShape(), xfA,\n\t\t\t\t\t\t\t\t(b2PolygonShape*)m_fixtureB->GetShape(), xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_EDGE_AND_POLYGON_CONTACT_H\n#define B2_EDGE_AND_POLYGON_CONTACT_H\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nclass b2BlockAllocator;\n\nclass b2EdgeAndPolygonContact : public b2Contact\n{\npublic:\n\tstatic b2Contact* Create(\tb2Fixture* fixtureA, int32 indexA,\n\t\t\t\t\t\t\t\tb2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB);\n\t~b2EdgeAndPolygonContact() {}\n\n\tvoid Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n\n#include <new>\n\nb2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2PolygonAndCircleContact));\n\treturn new (mem) b2PolygonAndCircleContact(fixtureA, fixtureB);\n}\n\nvoid b2PolygonAndCircleContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\t((b2PolygonAndCircleContact*)contact)->~b2PolygonAndCircleContact();\n\tallocator->Free(contact, sizeof(b2PolygonAndCircleContact));\n}\n\nb2PolygonAndCircleContact::b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB)\n: b2Contact(fixtureA, 0, fixtureB, 0)\n{\n\tb2Assert(m_fixtureA->GetType() == b2Shape::e_polygon);\n\tb2Assert(m_fixtureB->GetType() == b2Shape::e_circle);\n}\n\nvoid b2PolygonAndCircleContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2CollidePolygonAndCircle(\tmanifold,\n\t\t\t\t\t\t\t\t(b2PolygonShape*)m_fixtureA->GetShape(), xfA,\n\t\t\t\t\t\t\t\t(b2CircleShape*)m_fixtureB->GetShape(), xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H\n#define B2_POLYGON_AND_CIRCLE_CONTACT_H\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nclass b2BlockAllocator;\n\nclass b2PolygonAndCircleContact : public b2Contact\n{\npublic:\n\tstatic b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB);\n\t~b2PolygonAndCircleContact() {}\n\n\tvoid Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Contacts/b2PolygonContact.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Collision/b2TimeOfImpact.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2WorldCallbacks.h>\n\n#include <new>\n\nb2Contact* b2PolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)\n{\n\tvoid* mem = allocator->Allocate(sizeof(b2PolygonContact));\n\treturn new (mem) b2PolygonContact(fixtureA, fixtureB);\n}\n\nvoid b2PolygonContact::Destroy(b2Contact* contact, b2BlockAllocator* allocator)\n{\n\t((b2PolygonContact*)contact)->~b2PolygonContact();\n\tallocator->Free(contact, sizeof(b2PolygonContact));\n}\n\nb2PolygonContact::b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB)\n\t: b2Contact(fixtureA, 0, fixtureB, 0)\n{\n\tb2Assert(m_fixtureA->GetType() == b2Shape::e_polygon);\n\tb2Assert(m_fixtureB->GetType() == b2Shape::e_polygon);\n}\n\nvoid b2PolygonContact::Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB)\n{\n\tb2CollidePolygons(\tmanifold,\n\t\t\t\t\t\t(b2PolygonShape*)m_fixtureA->GetShape(), xfA,\n\t\t\t\t\t\t(b2PolygonShape*)m_fixtureB->GetShape(), xfB);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Contacts/b2PolygonContact.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_POLYGON_CONTACT_H\n#define B2_POLYGON_CONTACT_H\n\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nclass b2BlockAllocator;\n\nclass b2PolygonContact : public b2Contact\n{\npublic:\n\tstatic b2Contact* Create(\tb2Fixture* fixtureA, int32 indexA,\n\t\t\t\t\t\t\t\tb2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Contact* contact, b2BlockAllocator* allocator);\n\n\tb2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB);\n\t~b2PolygonContact() {}\n\n\tvoid Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB);\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// 1-D constrained system\n// m (v2 - v1) = lambda\n// v2 + (beta/h) * x1 + gamma * lambda = 0, gamma has units of inverse mass.\n// x2 = x1 + h * v2\n\n// 1-D mass-damper-spring system\n// m (v2 - v1) + h * d * v2 + h * k * \n\n// C = norm(p2 - p1) - L\n// u = (p2 - p1) / norm(p2 - p1)\n// Cdot = dot(u, v2 + cross(w2, r2) - v1 - cross(w1, r1))\n// J = [-u -cross(r1, u) u cross(r2, u)]\n// K = J * invM * JT\n//   = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2\n\nvoid b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2,\n\t\t\t\t\t\t\t\t\tconst b2Vec2& anchor1, const b2Vec2& anchor2)\n{\n\tbodyA = b1;\n\tbodyB = b2;\n\tlocalAnchorA = bodyA->GetLocalPoint(anchor1);\n\tlocalAnchorB = bodyB->GetLocalPoint(anchor2);\n\tb2Vec2 d = anchor2 - anchor1;\n\tlength = d.Length();\n}\n\nb2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def)\n: b2Joint(def)\n{\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\tm_length = def->length;\n\tm_frequencyHz = def->frequencyHz;\n\tm_dampingRatio = def->dampingRatio;\n\tm_impulse = 0.0f;\n\tm_gamma = 0.0f;\n\tm_bias = 0.0f;\n}\n\nvoid b2DistanceJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tm_rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tm_rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tm_u = cB + m_rB - cA - m_rA;\n\n\t// Handle singularity.\n\tfloat32 length = m_u.Length();\n\tif (length > b2_linearSlop)\n\t{\n\t\tm_u *= 1.0f / length;\n\t}\n\telse\n\t{\n\t\tm_u.Set(0.0f, 0.0f);\n\t}\n\n\tfloat32 crAu = b2Cross(m_rA, m_u);\n\tfloat32 crBu = b2Cross(m_rB, m_u);\n\tfloat32 invMass = m_invMassA + m_invIA * crAu * crAu + m_invMassB + m_invIB * crBu * crBu;\n\n\t// Compute the effective mass matrix.\n\tm_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f;\n\n\tif (m_frequencyHz > 0.0f)\n\t{\n\t\tfloat32 C = length - m_length;\n\n\t\t// Frequency\n\t\tfloat32 omega = 2.0f * b2_pi * m_frequencyHz;\n\n\t\t// Damping coefficient\n\t\tfloat32 d = 2.0f * m_mass * m_dampingRatio * omega;\n\n\t\t// Spring stiffness\n\t\tfloat32 k = m_mass * omega * omega;\n\n\t\t// magic formulas\n\t\tfloat32 h = data.step.dt;\n\t\tm_gamma = h * (d + h * k);\n\t\tm_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f;\n\t\tm_bias = C * h * k * m_gamma;\n\n\t\tinvMass += m_gamma;\n\t\tm_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f;\n\t}\n\telse\n\t{\n\t\tm_gamma = 0.0f;\n\t\tm_bias = 0.0f;\n\t}\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Scale the impulse to support a variable time step.\n\t\tm_impulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P = m_impulse * m_u;\n\t\tvA -= m_invMassA * P;\n\t\twA -= m_invIA * b2Cross(m_rA, P);\n\t\tvB += m_invMassB * P;\n\t\twB += m_invIB * b2Cross(m_rB, P);\n\t}\n\telse\n\t{\n\t\tm_impulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2DistanceJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\t// Cdot = dot(u, v + cross(w, r))\n\tb2Vec2 vpA = vA + b2Cross(wA, m_rA);\n\tb2Vec2 vpB = vB + b2Cross(wB, m_rB);\n\tfloat32 Cdot = b2Dot(m_u, vpB - vpA);\n\n\tfloat32 impulse = -m_mass * (Cdot + m_bias + m_gamma * m_impulse);\n\tm_impulse += impulse;\n\n\tb2Vec2 P = impulse * m_u;\n\tvA -= m_invMassA * P;\n\twA -= m_invIA * b2Cross(m_rA, P);\n\tvB += m_invMassB * P;\n\twB += m_invIB * b2Cross(m_rB, P);\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2DistanceJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tif (m_frequencyHz > 0.0f)\n\t{\n\t\t// There is no position correction for soft distance constraints.\n\t\treturn true;\n\t}\n\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tb2Vec2 u = cB + rB - cA - rA;\n\n\tfloat32 length = u.Normalize();\n\tfloat32 C = length - m_length;\n\tC = b2Clamp(C, -b2_maxLinearCorrection, b2_maxLinearCorrection);\n\n\tfloat32 impulse = -m_mass * C;\n\tb2Vec2 P = impulse * u;\n\n\tcA -= m_invMassA * P;\n\taA -= m_invIA * b2Cross(rA, P);\n\tcB += m_invMassB * P;\n\taB += m_invIB * b2Cross(rB, P);\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\n\treturn b2Abs(C) < b2_linearSlop;\n}\n\nb2Vec2 b2DistanceJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2DistanceJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2DistanceJoint::GetReactionForce(float32 inv_dt) const\n{\n\tb2Vec2 F = (inv_dt * m_impulse) * m_u;\n\treturn F;\n}\n\nfloat32 b2DistanceJoint::GetReactionTorque(float32 inv_dt) const\n{\n\tB2_NOT_USED(inv_dt);\n\treturn 0.0f;\n}\n\nvoid b2DistanceJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2DistanceJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.length = %.15lef;\\n\", m_length);\n\tb2Log(\"  jd.frequencyHz = %.15lef;\\n\", m_frequencyHz);\n\tb2Log(\"  jd.dampingRatio = %.15lef;\\n\", m_dampingRatio);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2DistanceJoint.h",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_DISTANCE_JOINT_H\n#define B2_DISTANCE_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Distance joint definition. This requires defining an\n/// anchor point on both bodies and the non-zero length of the\n/// distance joint. The definition uses local anchor points\n/// so that the initial configuration can violate the constraint\n/// slightly. This helps when saving and loading a game.\n/// @warning Do not use a zero or short length.\nstruct b2DistanceJointDef : public b2JointDef\n{\n\tb2DistanceJointDef()\n\t{\n\t\ttype = e_distanceJoint;\n\t\tlocalAnchorA.Set(0.0f, 0.0f);\n\t\tlocalAnchorB.Set(0.0f, 0.0f);\n\t\tlength = 1.0f;\n\t\tfrequencyHz = 0.0f;\n\t\tdampingRatio = 0.0f;\n\t}\n\n\t/// Initialize the bodies, anchors, and length using the world\n\t/// anchors.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB,\n\t\t\t\t\tconst b2Vec2& anchorA, const b2Vec2& anchorB);\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The natural length between the anchor points.\n\tfloat32 length;\n\n\t/// The mass-spring-damper frequency in Hertz. A value of 0\n\t/// disables softness.\n\tfloat32 frequencyHz;\n\n\t/// The damping ratio. 0 = no damping, 1 = critical damping.\n\tfloat32 dampingRatio;\n};\n\n/// A distance joint constrains two points on two bodies\n/// to remain at a fixed distance from each other. You can view\n/// this as a massless, rigid rod.\nclass b2DistanceJoint : public b2Joint\n{\npublic:\n\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\t/// Get the reaction force given the inverse time step.\n\t/// Unit is N.\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\n\t/// Get the reaction torque given the inverse time step.\n\t/// Unit is N*m. This is always zero for a distance joint.\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tconst b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; }\n\n\t/// The local anchor point relative to bodyB's origin.\n\tconst b2Vec2& GetLocalAnchorB() const  { return m_localAnchorB; }\n\n\t/// Set/get the natural length.\n\t/// Manipulating the length can lead to non-physical behavior when the frequency is zero.\n\tvoid SetLength(float32 length);\n\tfloat32 GetLength() const;\n\n\t/// Set/get frequency in Hz.\n\tvoid SetFrequency(float32 hz);\n\tfloat32 GetFrequency() const;\n\n\t/// Set/get damping ratio.\n\tvoid SetDampingRatio(float32 ratio);\n\tfloat32 GetDampingRatio() const;\n\n\t/// Dump joint to dmLog\n\tvoid Dump();\n\nprotected:\n\n\tfriend class b2Joint;\n\tb2DistanceJoint(const b2DistanceJointDef* data);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\tfloat32 m_frequencyHz;\n\tfloat32 m_dampingRatio;\n\tfloat32 m_bias;\n\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tfloat32 m_gamma;\n\tfloat32 m_impulse;\n\tfloat32 m_length;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_u;\n\tb2Vec2 m_rA;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tfloat32 m_mass;\n};\n\ninline void b2DistanceJoint::SetLength(float32 length)\n{\n\tm_length = length;\n}\n\ninline float32 b2DistanceJoint::GetLength() const\n{\n\treturn m_length;\n}\n\ninline void b2DistanceJoint::SetFrequency(float32 hz)\n{\n\tm_frequencyHz = hz;\n}\n\ninline float32 b2DistanceJoint::GetFrequency() const\n{\n\treturn m_frequencyHz;\n}\n\ninline void b2DistanceJoint::SetDampingRatio(float32 ratio)\n{\n\tm_dampingRatio = ratio;\n}\n\ninline float32 b2DistanceJoint::GetDampingRatio() const\n{\n\treturn m_dampingRatio;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Point-to-point constraint\n// Cdot = v2 - v1\n//      = v2 + cross(w2, r2) - v1 - cross(w1, r1)\n// J = [-I -r1_skew I r2_skew ]\n// Identity used:\n// w k % (rx i + ry j) = w * (-ry i + rx j)\n\n// Angle constraint\n// Cdot = w2 - w1\n// J = [0 0 -1 0 0 1]\n// K = invI1 + invI2\n\nvoid b2FrictionJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor)\n{\n\tbodyA = bA;\n\tbodyB = bB;\n\tlocalAnchorA = bodyA->GetLocalPoint(anchor);\n\tlocalAnchorB = bodyB->GetLocalPoint(anchor);\n}\n\nb2FrictionJoint::b2FrictionJoint(const b2FrictionJointDef* def)\n: b2Joint(def)\n{\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\n\tm_linearImpulse.SetZero();\n\tm_angularImpulse = 0.0f;\n\n\tm_maxForce = def->maxForce;\n\tm_maxTorque = def->maxTorque;\n}\n\nvoid b2FrictionJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\t// Compute the effective mass matrix.\n\tm_rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tm_rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\t// J = [-I -r1_skew I r2_skew]\n\t//     [ 0       -1 0       1]\n\t// r_skew = [-ry; rx]\n\n\t// Matlab\n\t// K = [ mA+r1y^2*iA+mB+r2y^2*iB,  -r1y*iA*r1x-r2y*iB*r2x,          -r1y*iA-r2y*iB]\n\t//     [  -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB,           r1x*iA+r2x*iB]\n\t//     [          -r1y*iA-r2y*iB,           r1x*iA+r2x*iB,                   iA+iB]\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tb2Mat22 K;\n\tK.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y;\n\tK.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y;\n\tK.ey.x = K.ex.y;\n\tK.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x;\n\n\tm_linearMass = K.GetInverse();\n\n\tm_angularMass = iA + iB;\n\tif (m_angularMass > 0.0f)\n\t{\n\t\tm_angularMass = 1.0f / m_angularMass;\n\t}\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Scale impulses to support a variable time step.\n\t\tm_linearImpulse *= data.step.dtRatio;\n\t\tm_angularImpulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P(m_linearImpulse.x, m_linearImpulse.y);\n\t\tvA -= mA * P;\n\t\twA -= iA * (b2Cross(m_rA, P) + m_angularImpulse);\n\t\tvB += mB * P;\n\t\twB += iB * (b2Cross(m_rB, P) + m_angularImpulse);\n\t}\n\telse\n\t{\n\t\tm_linearImpulse.SetZero();\n\t\tm_angularImpulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2FrictionJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tfloat32 h = data.step.dt;\n\n\t// Solve angular friction\n\t{\n\t\tfloat32 Cdot = wB - wA;\n\t\tfloat32 impulse = -m_angularMass * Cdot;\n\n\t\tfloat32 oldImpulse = m_angularImpulse;\n\t\tfloat32 maxImpulse = h * m_maxTorque;\n\t\tm_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse);\n\t\timpulse = m_angularImpulse - oldImpulse;\n\n\t\twA -= iA * impulse;\n\t\twB += iB * impulse;\n\t}\n\n\t// Solve linear friction\n\t{\n\t\tb2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA);\n\n\t\tb2Vec2 impulse = -b2Mul(m_linearMass, Cdot);\n\t\tb2Vec2 oldImpulse = m_linearImpulse;\n\t\tm_linearImpulse += impulse;\n\n\t\tfloat32 maxImpulse = h * m_maxForce;\n\n\t\tif (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse)\n\t\t{\n\t\t\tm_linearImpulse.Normalize();\n\t\t\tm_linearImpulse *= maxImpulse;\n\t\t}\n\n\t\timpulse = m_linearImpulse - oldImpulse;\n\n\t\tvA -= mA * impulse;\n\t\twA -= iA * b2Cross(m_rA, impulse);\n\n\t\tvB += mB * impulse;\n\t\twB += iB * b2Cross(m_rB, impulse);\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2FrictionJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tB2_NOT_USED(data);\n\n\treturn true;\n}\n\nb2Vec2 b2FrictionJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2FrictionJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2FrictionJoint::GetReactionForce(float32 inv_dt) const\n{\n\treturn inv_dt * m_linearImpulse;\n}\n\nfloat32 b2FrictionJoint::GetReactionTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_angularImpulse;\n}\n\nvoid b2FrictionJoint::SetMaxForce(float32 force)\n{\n\tb2Assert(b2IsValid(force) && force >= 0.0f);\n\tm_maxForce = force;\n}\n\nfloat32 b2FrictionJoint::GetMaxForce() const\n{\n\treturn m_maxForce;\n}\n\nvoid b2FrictionJoint::SetMaxTorque(float32 torque)\n{\n\tb2Assert(b2IsValid(torque) && torque >= 0.0f);\n\tm_maxTorque = torque;\n}\n\nfloat32 b2FrictionJoint::GetMaxTorque() const\n{\n\treturn m_maxTorque;\n}\n\nvoid b2FrictionJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2FrictionJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.maxForce = %.15lef;\\n\", m_maxForce);\n\tb2Log(\"  jd.maxTorque = %.15lef;\\n\", m_maxTorque);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2FrictionJoint.h",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_FRICTION_JOINT_H\n#define B2_FRICTION_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Friction joint definition.\nstruct b2FrictionJointDef : public b2JointDef\n{\n\tb2FrictionJointDef()\n\t{\n\t\ttype = e_frictionJoint;\n\t\tlocalAnchorA.SetZero();\n\t\tlocalAnchorB.SetZero();\n\t\tmaxForce = 0.0f;\n\t\tmaxTorque = 0.0f;\n\t}\n\n\t/// Initialize the bodies, anchors, axis, and reference angle using the world\n\t/// anchor and world axis.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor);\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The maximum friction force in N.\n\tfloat32 maxForce;\n\n\t/// The maximum friction torque in N-m.\n\tfloat32 maxTorque;\n};\n\n/// Friction joint. This is used for top-down friction.\n/// It provides 2D translational friction and angular friction.\nclass b2FrictionJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tconst b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; }\n\n\t/// The local anchor point relative to bodyB's origin.\n\tconst b2Vec2& GetLocalAnchorB() const  { return m_localAnchorB; }\n\n\t/// Set the maximum friction force in N.\n\tvoid SetMaxForce(float32 force);\n\n\t/// Get the maximum friction force in N.\n\tfloat32 GetMaxForce() const;\n\n\t/// Set the maximum friction torque in N*m.\n\tvoid SetMaxTorque(float32 torque);\n\n\t/// Get the maximum friction torque in N*m.\n\tfloat32 GetMaxTorque() const;\n\n\t/// Dump joint to dmLog\n\tvoid Dump();\n\nprotected:\n\n\tfriend class b2Joint;\n\n\tb2FrictionJoint(const b2FrictionJointDef* def);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\n\t// Solver shared\n\tb2Vec2 m_linearImpulse;\n\tfloat32 m_angularImpulse;\n\tfloat32 m_maxForce;\n\tfloat32 m_maxTorque;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_rA;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tb2Mat22 m_linearMass;\n\tfloat32 m_angularMass;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2GearJoint.cpp",
    "content": "/*\n* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2GearJoint.h>\n#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>\n#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Gear Joint:\n// C0 = (coordinate1 + ratio * coordinate2)_initial\n// C = (coordinate1 + ratio * coordinate2) - C0 = 0\n// J = [J1 ratio * J2]\n// K = J * invM * JT\n//   = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T\n//\n// Revolute:\n// coordinate = rotation\n// Cdot = angularVelocity\n// J = [0 0 1]\n// K = J * invM * JT = invI\n//\n// Prismatic:\n// coordinate = dot(p - pg, ug)\n// Cdot = dot(v + cross(w, r), ug)\n// J = [ug cross(r, ug)]\n// K = J * invM * JT = invMass + invI * cross(r, ug)^2\n\nb2GearJoint::b2GearJoint(const b2GearJointDef* def)\n: b2Joint(def)\n{\n\tm_joint1 = def->joint1;\n\tm_joint2 = def->joint2;\n\n\tm_typeA = m_joint1->GetType();\n\tm_typeB = m_joint2->GetType();\n\n\tb2Assert(m_typeA == e_revoluteJoint || m_typeA == e_prismaticJoint);\n\tb2Assert(m_typeB == e_revoluteJoint || m_typeB == e_prismaticJoint);\n\n\tfloat32 coordinateA, coordinateB;\n\n\t// TODO_ERIN there might be some problem with the joint edges in b2Joint.\n\n\tm_bodyC = m_joint1->GetBodyA();\n\tm_bodyA = m_joint1->GetBodyB();\n\n\t// Get geometry of joint1\n\tb2Transform xfA = m_bodyA->m_xf;\n\tfloat32 aA = m_bodyA->m_sweep.a;\n\tb2Transform xfC = m_bodyC->m_xf;\n\tfloat32 aC = m_bodyC->m_sweep.a;\n\n\tif (m_typeA == e_revoluteJoint)\n\t{\n\t\tb2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint1;\n\t\tm_localAnchorC = revolute->m_localAnchorA;\n\t\tm_localAnchorA = revolute->m_localAnchorB;\n\t\tm_referenceAngleA = revolute->m_referenceAngle;\n\t\tm_localAxisC.SetZero();\n\n\t\tcoordinateA = aA - aC - m_referenceAngleA;\n\t}\n\telse\n\t{\n\t\tb2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint1;\n\t\tm_localAnchorC = prismatic->m_localAnchorA;\n\t\tm_localAnchorA = prismatic->m_localAnchorB;\n\t\tm_referenceAngleA = prismatic->m_referenceAngle;\n\t\tm_localAxisC = prismatic->m_localXAxisA;\n\n\t\tb2Vec2 pC = m_localAnchorC;\n\t\tb2Vec2 pA = b2MulT(xfC.q, b2Mul(xfA.q, m_localAnchorA) + (xfA.p - xfC.p));\n\t\tcoordinateA = b2Dot(pA - pC, m_localAxisC);\n\t}\n\n\tm_bodyD = m_joint2->GetBodyA();\n\tm_bodyB = m_joint2->GetBodyB();\n\n\t// Get geometry of joint2\n\tb2Transform xfB = m_bodyB->m_xf;\n\tfloat32 aB = m_bodyB->m_sweep.a;\n\tb2Transform xfD = m_bodyD->m_xf;\n\tfloat32 aD = m_bodyD->m_sweep.a;\n\n\tif (m_typeB == e_revoluteJoint)\n\t{\n\t\tb2RevoluteJoint* revolute = (b2RevoluteJoint*)def->joint2;\n\t\tm_localAnchorD = revolute->m_localAnchorA;\n\t\tm_localAnchorB = revolute->m_localAnchorB;\n\t\tm_referenceAngleB = revolute->m_referenceAngle;\n\t\tm_localAxisD.SetZero();\n\n\t\tcoordinateB = aB - aD - m_referenceAngleB;\n\t}\n\telse\n\t{\n\t\tb2PrismaticJoint* prismatic = (b2PrismaticJoint*)def->joint2;\n\t\tm_localAnchorD = prismatic->m_localAnchorA;\n\t\tm_localAnchorB = prismatic->m_localAnchorB;\n\t\tm_referenceAngleB = prismatic->m_referenceAngle;\n\t\tm_localAxisD = prismatic->m_localXAxisA;\n\n\t\tb2Vec2 pD = m_localAnchorD;\n\t\tb2Vec2 pB = b2MulT(xfD.q, b2Mul(xfB.q, m_localAnchorB) + (xfB.p - xfD.p));\n\t\tcoordinateB = b2Dot(pB - pD, m_localAxisD);\n\t}\n\n\tm_ratio = def->ratio;\n\n\tm_constant = coordinateA + m_ratio * coordinateB;\n\n\tm_impulse = 0.0f;\n}\n\nvoid b2GearJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_indexC = m_bodyC->m_islandIndex;\n\tm_indexD = m_bodyD->m_islandIndex;\n\tm_lcA = m_bodyA->m_sweep.localCenter;\n\tm_lcB = m_bodyB->m_sweep.localCenter;\n\tm_lcC = m_bodyC->m_sweep.localCenter;\n\tm_lcD = m_bodyD->m_sweep.localCenter;\n\tm_mA = m_bodyA->m_invMass;\n\tm_mB = m_bodyB->m_invMass;\n\tm_mC = m_bodyC->m_invMass;\n\tm_mD = m_bodyD->m_invMass;\n\tm_iA = m_bodyA->m_invI;\n\tm_iB = m_bodyB->m_invI;\n\tm_iC = m_bodyC->m_invI;\n\tm_iD = m_bodyD->m_invI;\n\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tfloat32 aC = data.positions[m_indexC].a;\n\tb2Vec2 vC = data.velocities[m_indexC].v;\n\tfloat32 wC = data.velocities[m_indexC].w;\n\n\tfloat32 aD = data.positions[m_indexD].a;\n\tb2Vec2 vD = data.velocities[m_indexD].v;\n\tfloat32 wD = data.velocities[m_indexD].w;\n\n\tb2Rot qA(aA), qB(aB), qC(aC), qD(aD);\n\n\tm_mass = 0.0f;\n\n\tif (m_typeA == e_revoluteJoint)\n\t{\n\t\tm_JvAC.SetZero();\n\t\tm_JwA = 1.0f;\n\t\tm_JwC = 1.0f;\n\t\tm_mass += m_iA + m_iC;\n\t}\n\telse\n\t{\n\t\tb2Vec2 u = b2Mul(qC, m_localAxisC);\n\t\tb2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC);\n\t\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA);\n\t\tm_JvAC = u;\n\t\tm_JwC = b2Cross(rC, u);\n\t\tm_JwA = b2Cross(rA, u);\n\t\tm_mass += m_mC + m_mA + m_iC * m_JwC * m_JwC + m_iA * m_JwA * m_JwA;\n\t}\n\n\tif (m_typeB == e_revoluteJoint)\n\t{\n\t\tm_JvBD.SetZero();\n\t\tm_JwB = m_ratio;\n\t\tm_JwD = m_ratio;\n\t\tm_mass += m_ratio * m_ratio * (m_iB + m_iD);\n\t}\n\telse\n\t{\n\t\tb2Vec2 u = b2Mul(qD, m_localAxisD);\n\t\tb2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD);\n\t\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB);\n\t\tm_JvBD = m_ratio * u;\n\t\tm_JwD = m_ratio * b2Cross(rD, u);\n\t\tm_JwB = m_ratio * b2Cross(rB, u);\n\t\tm_mass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * m_JwD * m_JwD + m_iB * m_JwB * m_JwB;\n\t}\n\n\t// Compute effective mass.\n\tm_mass = m_mass > 0.0f ? 1.0f / m_mass : 0.0f;\n\n\tif (data.step.warmStarting)\n\t{\n\t\tvA += (m_mA * m_impulse) * m_JvAC;\n\t\twA += m_iA * m_impulse * m_JwA;\n\t\tvB += (m_mB * m_impulse) * m_JvBD;\n\t\twB += m_iB * m_impulse * m_JwB;\n\t\tvC -= (m_mC * m_impulse) * m_JvAC;\n\t\twC -= m_iC * m_impulse * m_JwC;\n\t\tvD -= (m_mD * m_impulse) * m_JvBD;\n\t\twD -= m_iD * m_impulse * m_JwD;\n\t}\n\telse\n\t{\n\t\tm_impulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n\tdata.velocities[m_indexC].v = vC;\n\tdata.velocities[m_indexC].w = wC;\n\tdata.velocities[m_indexD].v = vD;\n\tdata.velocities[m_indexD].w = wD;\n}\n\nvoid b2GearJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\tb2Vec2 vC = data.velocities[m_indexC].v;\n\tfloat32 wC = data.velocities[m_indexC].w;\n\tb2Vec2 vD = data.velocities[m_indexD].v;\n\tfloat32 wD = data.velocities[m_indexD].w;\n\n\tfloat32 Cdot = b2Dot(m_JvAC, vA - vC) + b2Dot(m_JvBD, vB - vD);\n\tCdot += (m_JwA * wA - m_JwC * wC) + (m_JwB * wB - m_JwD * wD);\n\n\tfloat32 impulse = -m_mass * Cdot;\n\tm_impulse += impulse;\n\n\tvA += (m_mA * impulse) * m_JvAC;\n\twA += m_iA * impulse * m_JwA;\n\tvB += (m_mB * impulse) * m_JvBD;\n\twB += m_iB * impulse * m_JwB;\n\tvC -= (m_mC * impulse) * m_JvAC;\n\twC -= m_iC * impulse * m_JwC;\n\tvD -= (m_mD * impulse) * m_JvBD;\n\twD -= m_iD * impulse * m_JwD;\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n\tdata.velocities[m_indexC].v = vC;\n\tdata.velocities[m_indexC].w = wC;\n\tdata.velocities[m_indexD].v = vD;\n\tdata.velocities[m_indexD].w = wD;\n}\n\nbool b2GearJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 cC = data.positions[m_indexC].c;\n\tfloat32 aC = data.positions[m_indexC].a;\n\tb2Vec2 cD = data.positions[m_indexD].c;\n\tfloat32 aD = data.positions[m_indexD].a;\n\n\tb2Rot qA(aA), qB(aB), qC(aC), qD(aD);\n\n\tfloat32 linearError = 0.0f;\n\n\tfloat32 coordinateA, coordinateB;\n\n\tb2Vec2 JvAC, JvBD;\n\tfloat32 JwA, JwB, JwC, JwD;\n\tfloat32 mass = 0.0f;\n\n\tif (m_typeA == e_revoluteJoint)\n\t{\n\t\tJvAC.SetZero();\n\t\tJwA = 1.0f;\n\t\tJwC = 1.0f;\n\t\tmass += m_iA + m_iC;\n\n\t\tcoordinateA = aA - aC - m_referenceAngleA;\n\t}\n\telse\n\t{\n\t\tb2Vec2 u = b2Mul(qC, m_localAxisC);\n\t\tb2Vec2 rC = b2Mul(qC, m_localAnchorC - m_lcC);\n\t\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_lcA);\n\t\tJvAC = u;\n\t\tJwC = b2Cross(rC, u);\n\t\tJwA = b2Cross(rA, u);\n\t\tmass += m_mC + m_mA + m_iC * JwC * JwC + m_iA * JwA * JwA;\n\n\t\tb2Vec2 pC = m_localAnchorC - m_lcC;\n\t\tb2Vec2 pA = b2MulT(qC, rA + (cA - cC));\n\t\tcoordinateA = b2Dot(pA - pC, m_localAxisC);\n\t}\n\n\tif (m_typeB == e_revoluteJoint)\n\t{\n\t\tJvBD.SetZero();\n\t\tJwB = m_ratio;\n\t\tJwD = m_ratio;\n\t\tmass += m_ratio * m_ratio * (m_iB + m_iD);\n\n\t\tcoordinateB = aB - aD - m_referenceAngleB;\n\t}\n\telse\n\t{\n\t\tb2Vec2 u = b2Mul(qD, m_localAxisD);\n\t\tb2Vec2 rD = b2Mul(qD, m_localAnchorD - m_lcD);\n\t\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_lcB);\n\t\tJvBD = m_ratio * u;\n\t\tJwD = m_ratio * b2Cross(rD, u);\n\t\tJwB = m_ratio * b2Cross(rB, u);\n\t\tmass += m_ratio * m_ratio * (m_mD + m_mB) + m_iD * JwD * JwD + m_iB * JwB * JwB;\n\n\t\tb2Vec2 pD = m_localAnchorD - m_lcD;\n\t\tb2Vec2 pB = b2MulT(qD, rB + (cB - cD));\n\t\tcoordinateB = b2Dot(pB - pD, m_localAxisD);\n\t}\n\n\tfloat32 C = (coordinateA + m_ratio * coordinateB) - m_constant;\n\n\tfloat32 impulse = 0.0f;\n\tif (mass > 0.0f)\n\t{\n\t\timpulse = -C / mass;\n\t}\n\n\tcA += m_mA * impulse * JvAC;\n\taA += m_iA * impulse * JwA;\n\tcB += m_mB * impulse * JvBD;\n\taB += m_iB * impulse * JwB;\n\tcC -= m_mC * impulse * JvAC;\n\taC -= m_iC * impulse * JwC;\n\tcD -= m_mD * impulse * JvBD;\n\taD -= m_iD * impulse * JwD;\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\tdata.positions[m_indexC].c = cC;\n\tdata.positions[m_indexC].a = aC;\n\tdata.positions[m_indexD].c = cD;\n\tdata.positions[m_indexD].a = aD;\n\n\t// TODO_ERIN not implemented\n\treturn linearError < b2_linearSlop;\n}\n\nb2Vec2 b2GearJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2GearJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const\n{\n\tb2Vec2 P = m_impulse * m_JvAC;\n\treturn inv_dt * P;\n}\n\nfloat32 b2GearJoint::GetReactionTorque(float32 inv_dt) const\n{\n\tfloat32 L = m_impulse * m_JwA;\n\treturn inv_dt * L;\n}\n\nvoid b2GearJoint::SetRatio(float32 ratio)\n{\n\tb2Assert(b2IsValid(ratio));\n\tm_ratio = ratio;\n}\n\nfloat32 b2GearJoint::GetRatio() const\n{\n\treturn m_ratio;\n}\n\nvoid b2GearJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tint32 index1 = m_joint1->m_index;\n\tint32 index2 = m_joint2->m_index;\n\n\tb2Log(\"  b2GearJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.joint1 = joints[%d];\\n\", index1);\n\tb2Log(\"  jd.joint2 = joints[%d];\\n\", index2);\n\tb2Log(\"  jd.ratio = %.15lef;\\n\", m_ratio);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2GearJoint.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_GEAR_JOINT_H\n#define B2_GEAR_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Gear joint definition. This definition requires two existing\n/// revolute or prismatic joints (any combination will work).\nstruct b2GearJointDef : public b2JointDef\n{\n\tb2GearJointDef()\n\t{\n\t\ttype = e_gearJoint;\n\t\tjoint1 = NULL;\n\t\tjoint2 = NULL;\n\t\tratio = 1.0f;\n\t}\n\n\t/// The first revolute/prismatic joint attached to the gear joint.\n\tb2Joint* joint1;\n\n\t/// The second revolute/prismatic joint attached to the gear joint.\n\tb2Joint* joint2;\n\n\t/// The gear ratio.\n\t/// @see b2GearJoint for explanation.\n\tfloat32 ratio;\n};\n\n/// A gear joint is used to connect two joints together. Either joint\n/// can be a revolute or prismatic joint. You specify a gear ratio\n/// to bind the motions together:\n/// coordinate1 + ratio * coordinate2 = constant\n/// The ratio can be negative or positive. If one joint is a revolute joint\n/// and the other joint is a prismatic joint, then the ratio will have units\n/// of length or units of 1/length.\n/// @warning You have to manually destroy the gear joint if joint1 or joint2\n/// is destroyed.\nclass b2GearJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// Get the first joint.\n\tb2Joint* GetJoint1() { return m_joint1; }\n\n\t/// Get the second joint.\n\tb2Joint* GetJoint2() { return m_joint2; }\n\n\t/// Set/Get the gear ratio.\n\tvoid SetRatio(float32 ratio);\n\tfloat32 GetRatio() const;\n\n\t/// Dump joint to dmLog\n\tvoid Dump();\n\nprotected:\n\n\tfriend class b2Joint;\n\tb2GearJoint(const b2GearJointDef* data);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\tb2Joint* m_joint1;\n\tb2Joint* m_joint2;\n\n\tb2JointType m_typeA;\n\tb2JointType m_typeB;\n\n\t// Body A is connected to body C\n\t// Body B is connected to body D\n\tb2Body* m_bodyC;\n\tb2Body* m_bodyD;\n\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tb2Vec2 m_localAnchorC;\n\tb2Vec2 m_localAnchorD;\n\n\tb2Vec2 m_localAxisC;\n\tb2Vec2 m_localAxisD;\n\n\tfloat32 m_referenceAngleA;\n\tfloat32 m_referenceAngleB;\n\n\tfloat32 m_constant;\n\tfloat32 m_ratio;\n\n\tfloat32 m_impulse;\n\n\t// Solver temp\n\tint32 m_indexA, m_indexB, m_indexC, m_indexD;\n\tb2Vec2 m_lcA, m_lcB, m_lcC, m_lcD;\n\tfloat32 m_mA, m_mB, m_mC, m_mD;\n\tfloat32 m_iA, m_iB, m_iC, m_iD;\n\tb2Vec2 m_JvAC, m_JvBD;\n\tfloat32 m_JwA, m_JwB, m_JwC, m_JwD;\n\tfloat32 m_mass;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2Joint.cpp",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>\n#include <Box2D/Dynamics/Joints/b2WheelJoint.h>\n#include <Box2D/Dynamics/Joints/b2MouseJoint.h>\n#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>\n#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>\n#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>\n#include <Box2D/Dynamics/Joints/b2GearJoint.h>\n#include <Box2D/Dynamics/Joints/b2WeldJoint.h>\n#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>\n#include <Box2D/Dynamics/Joints/b2RopeJoint.h>\n#include <Box2D/Dynamics/Joints/b2MotorJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2World.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n\n#include <new>\n\nb2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator)\n{\n\tb2Joint* joint = NULL;\n\n\tswitch (def->type)\n\t{\n\tcase e_distanceJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2DistanceJoint));\n\t\t\tjoint = new (mem) b2DistanceJoint(static_cast<const b2DistanceJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_mouseJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2MouseJoint));\n\t\t\tjoint = new (mem) b2MouseJoint(static_cast<const b2MouseJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_prismaticJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2PrismaticJoint));\n\t\t\tjoint = new (mem) b2PrismaticJoint(static_cast<const b2PrismaticJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_revoluteJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2RevoluteJoint));\n\t\t\tjoint = new (mem) b2RevoluteJoint(static_cast<const b2RevoluteJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_pulleyJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2PulleyJoint));\n\t\t\tjoint = new (mem) b2PulleyJoint(static_cast<const b2PulleyJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_gearJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2GearJoint));\n\t\t\tjoint = new (mem) b2GearJoint(static_cast<const b2GearJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_wheelJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2WheelJoint));\n\t\t\tjoint = new (mem) b2WheelJoint(static_cast<const b2WheelJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_weldJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2WeldJoint));\n\t\t\tjoint = new (mem) b2WeldJoint(static_cast<const b2WeldJointDef*>(def));\n\t\t}\n\t\tbreak;\n        \n\tcase e_frictionJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2FrictionJoint));\n\t\t\tjoint = new (mem) b2FrictionJoint(static_cast<const b2FrictionJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_ropeJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2RopeJoint));\n\t\t\tjoint = new (mem) b2RopeJoint(static_cast<const b2RopeJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tcase e_motorJoint:\n\t\t{\n\t\t\tvoid* mem = allocator->Allocate(sizeof(b2MotorJoint));\n\t\t\tjoint = new (mem) b2MotorJoint(static_cast<const b2MotorJointDef*>(def));\n\t\t}\n\t\tbreak;\n\n\tdefault:\n\t\tb2Assert(false);\n\t\tbreak;\n\t}\n\n\treturn joint;\n}\n\nvoid b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator)\n{\n\tjoint->~b2Joint();\n\tswitch (joint->m_type)\n\t{\n\tcase e_distanceJoint:\n\t\tallocator->Free(joint, sizeof(b2DistanceJoint));\n\t\tbreak;\n\n\tcase e_mouseJoint:\n\t\tallocator->Free(joint, sizeof(b2MouseJoint));\n\t\tbreak;\n\n\tcase e_prismaticJoint:\n\t\tallocator->Free(joint, sizeof(b2PrismaticJoint));\n\t\tbreak;\n\n\tcase e_revoluteJoint:\n\t\tallocator->Free(joint, sizeof(b2RevoluteJoint));\n\t\tbreak;\n\n\tcase e_pulleyJoint:\n\t\tallocator->Free(joint, sizeof(b2PulleyJoint));\n\t\tbreak;\n\n\tcase e_gearJoint:\n\t\tallocator->Free(joint, sizeof(b2GearJoint));\n\t\tbreak;\n\n\tcase e_wheelJoint:\n\t\tallocator->Free(joint, sizeof(b2WheelJoint));\n\t\tbreak;\n    \n\tcase e_weldJoint:\n\t\tallocator->Free(joint, sizeof(b2WeldJoint));\n\t\tbreak;\n\n\tcase e_frictionJoint:\n\t\tallocator->Free(joint, sizeof(b2FrictionJoint));\n\t\tbreak;\n\n\tcase e_ropeJoint:\n\t\tallocator->Free(joint, sizeof(b2RopeJoint));\n\t\tbreak;\n\n\tcase e_motorJoint:\n\t\tallocator->Free(joint, sizeof(b2MotorJoint));\n\t\tbreak;\n\n\tdefault:\n\t\tb2Assert(false);\n\t\tbreak;\n\t}\n}\n\nb2Joint::b2Joint(const b2JointDef* def)\n{\n\tb2Assert(def->bodyA != def->bodyB);\n\n\tm_type = def->type;\n\tm_prev = NULL;\n\tm_next = NULL;\n\tm_bodyA = def->bodyA;\n\tm_bodyB = def->bodyB;\n\tm_index = 0;\n\tm_collideConnected = def->collideConnected;\n\tm_islandFlag = false;\n\tm_userData = def->userData;\n\n\tm_edgeA.joint = NULL;\n\tm_edgeA.other = NULL;\n\tm_edgeA.prev = NULL;\n\tm_edgeA.next = NULL;\n\n\tm_edgeB.joint = NULL;\n\tm_edgeB.other = NULL;\n\tm_edgeB.prev = NULL;\n\tm_edgeB.next = NULL;\n}\n\nbool b2Joint::IsActive() const\n{\n\treturn m_bodyA->IsActive() && m_bodyB->IsActive();\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2Joint.h",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_JOINT_H\n#define B2_JOINT_H\n\n#include <Box2D/Common/b2Math.h>\n\nclass b2Body;\nclass b2Joint;\nstruct b2SolverData;\nclass b2BlockAllocator;\n\nenum b2JointType\n{\n\te_unknownJoint,\n\te_revoluteJoint,\n\te_prismaticJoint,\n\te_distanceJoint,\n\te_pulleyJoint,\n\te_mouseJoint,\n\te_gearJoint,\n\te_wheelJoint,\n    e_weldJoint,\n\te_frictionJoint,\n\te_ropeJoint,\n\te_motorJoint\n};\n\nenum b2LimitState\n{\n\te_inactiveLimit,\n\te_atLowerLimit,\n\te_atUpperLimit,\n\te_equalLimits\n};\n\nstruct b2Jacobian\n{\n\tb2Vec2 linear;\n\tfloat32 angularA;\n\tfloat32 angularB;\n};\n\n/// A joint edge is used to connect bodies and joints together\n/// in a joint graph where each body is a node and each joint\n/// is an edge. A joint edge belongs to a doubly linked list\n/// maintained in each attached body. Each joint has two joint\n/// nodes, one for each attached body.\nstruct b2JointEdge\n{\n\tb2Body* other;\t\t\t///< provides quick access to the other body attached.\n\tb2Joint* joint;\t\t\t///< the joint\n\tb2JointEdge* prev;\t\t///< the previous joint edge in the body's joint list\n\tb2JointEdge* next;\t\t///< the next joint edge in the body's joint list\n};\n\n/// Joint definitions are used to construct joints.\nstruct b2JointDef\n{\n\tb2JointDef()\n\t{\n\t\ttype = e_unknownJoint;\n\t\tuserData = NULL;\n\t\tbodyA = NULL;\n\t\tbodyB = NULL;\n\t\tcollideConnected = false;\n\t}\n\n\t/// The joint type is set automatically for concrete joint types.\n\tb2JointType type;\n\n\t/// Use this to attach application specific data to your joints.\n\tvoid* userData;\n\n\t/// The first attached body.\n\tb2Body* bodyA;\n\n\t/// The second attached body.\n\tb2Body* bodyB;\n\n\t/// Set this flag to true if the attached bodies should collide.\n\tbool collideConnected;\n};\n\n/// The base joint class. Joints are used to constraint two bodies together in\n/// various fashions. Some joints also feature limits and motors.\nclass b2Joint\n{\npublic:\n\n\t/// Get the type of the concrete joint.\n\tb2JointType GetType() const;\n\n\t/// Get the first body attached to this joint.\n\tb2Body* GetBodyA();\n\n\t/// Get the second body attached to this joint.\n\tb2Body* GetBodyB();\n\n\t/// Get the anchor point on bodyA in world coordinates.\n\tvirtual b2Vec2 GetAnchorA() const = 0;\n\n\t/// Get the anchor point on bodyB in world coordinates.\n\tvirtual b2Vec2 GetAnchorB() const = 0;\n\n\t/// Get the reaction force on bodyB at the joint anchor in Newtons.\n\tvirtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0;\n\n\t/// Get the reaction torque on bodyB in N*m.\n\tvirtual float32 GetReactionTorque(float32 inv_dt) const = 0;\n\n\t/// Get the next joint the world joint list.\n\tb2Joint* GetNext();\n\tconst b2Joint* GetNext() const;\n\n\t/// Get the user data pointer.\n\tvoid* GetUserData() const;\n\n\t/// Set the user data pointer.\n\tvoid SetUserData(void* data);\n\n\t/// Short-cut function to determine if either body is inactive.\n\tbool IsActive() const;\n\n\t/// Get collide connected.\n\t/// Note: modifying the collide connect flag won't work correctly because\n\t/// the flag is only checked when fixture AABBs begin to overlap.\n\tbool GetCollideConnected() const;\n\n\t/// Dump this joint to the log file.\n\tvirtual void Dump() { b2Log(\"// Dump is not supported for this joint type.\\n\"); }\n\n\t/// Shift the origin for any points stored in world coordinates.\n\tvirtual void ShiftOrigin(const b2Vec2& newOrigin) { B2_NOT_USED(newOrigin);  }\n\nprotected:\n\tfriend class b2World;\n\tfriend class b2Body;\n\tfriend class b2Island;\n\tfriend class b2GearJoint;\n\n\tstatic b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator);\n\tstatic void Destroy(b2Joint* joint, b2BlockAllocator* allocator);\n\n\tb2Joint(const b2JointDef* def);\n\tvirtual ~b2Joint() {}\n\n\tvirtual void InitVelocityConstraints(const b2SolverData& data) = 0;\n\tvirtual void SolveVelocityConstraints(const b2SolverData& data) = 0;\n\n\t// This returns true if the position errors are within tolerance.\n\tvirtual bool SolvePositionConstraints(const b2SolverData& data) = 0;\n\n\tb2JointType m_type;\n\tb2Joint* m_prev;\n\tb2Joint* m_next;\n\tb2JointEdge m_edgeA;\n\tb2JointEdge m_edgeB;\n\tb2Body* m_bodyA;\n\tb2Body* m_bodyB;\n\n\tint32 m_index;\n\n\tbool m_islandFlag;\n\tbool m_collideConnected;\n\n\tvoid* m_userData;\n};\n\ninline b2JointType b2Joint::GetType() const\n{\n\treturn m_type;\n}\n\ninline b2Body* b2Joint::GetBodyA()\n{\n\treturn m_bodyA;\n}\n\ninline b2Body* b2Joint::GetBodyB()\n{\n\treturn m_bodyB;\n}\n\ninline b2Joint* b2Joint::GetNext()\n{\n\treturn m_next;\n}\n\ninline const b2Joint* b2Joint::GetNext() const\n{\n\treturn m_next;\n}\n\ninline void* b2Joint::GetUserData() const\n{\n\treturn m_userData;\n}\n\ninline void b2Joint::SetUserData(void* data)\n{\n\tm_userData = data;\n}\n\ninline bool b2Joint::GetCollideConnected() const\n{\n\treturn m_collideConnected;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2MotorJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2012 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2MotorJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Point-to-point constraint\n// Cdot = v2 - v1\n//      = v2 + cross(w2, r2) - v1 - cross(w1, r1)\n// J = [-I -r1_skew I r2_skew ]\n// Identity used:\n// w k % (rx i + ry j) = w * (-ry i + rx j)\n\n// Angle constraint\n// Cdot = w2 - w1\n// J = [0 0 -1 0 0 1]\n// K = invI1 + invI2\n\nvoid b2MotorJointDef::Initialize(b2Body* bA, b2Body* bB)\n{\n\tbodyA = bA;\n\tbodyB = bB;\n\tb2Vec2 xB = bodyB->GetPosition();\n\tlinearOffset = bodyA->GetLocalPoint(xB);\n\n\tfloat32 angleA = bodyA->GetAngle();\n\tfloat32 angleB = bodyB->GetAngle();\n\tangularOffset = angleB - angleA;\n}\n\nb2MotorJoint::b2MotorJoint(const b2MotorJointDef* def)\n: b2Joint(def)\n{\n\tm_linearOffset = def->linearOffset;\n\tm_angularOffset = def->angularOffset;\n\n\tm_linearImpulse.SetZero();\n\tm_angularImpulse = 0.0f;\n\n\tm_maxForce = def->maxForce;\n\tm_maxTorque = def->maxTorque;\n\tm_correctionFactor = def->correctionFactor;\n}\n\nvoid b2MotorJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\t// Compute the effective mass matrix.\n\tm_rA = b2Mul(qA, -m_localCenterA);\n\tm_rB = b2Mul(qB, -m_localCenterB);\n\n\t// J = [-I -r1_skew I r2_skew]\n\t//     [ 0       -1 0       1]\n\t// r_skew = [-ry; rx]\n\n\t// Matlab\n\t// K = [ mA+r1y^2*iA+mB+r2y^2*iB,  -r1y*iA*r1x-r2y*iB*r2x,          -r1y*iA-r2y*iB]\n\t//     [  -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB,           r1x*iA+r2x*iB]\n\t//     [          -r1y*iA-r2y*iB,           r1x*iA+r2x*iB,                   iA+iB]\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tb2Mat22 K;\n\tK.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y;\n\tK.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y;\n\tK.ey.x = K.ex.y;\n\tK.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x;\n\n\tm_linearMass = K.GetInverse();\n\n\tm_angularMass = iA + iB;\n\tif (m_angularMass > 0.0f)\n\t{\n\t\tm_angularMass = 1.0f / m_angularMass;\n\t}\n\n\tm_linearError = cB + m_rB - cA - m_rA - b2Mul(qA, m_linearOffset);\n\tm_angularError = aB - aA - m_angularOffset;\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Scale impulses to support a variable time step.\n\t\tm_linearImpulse *= data.step.dtRatio;\n\t\tm_angularImpulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P(m_linearImpulse.x, m_linearImpulse.y);\n\t\tvA -= mA * P;\n\t\twA -= iA * (b2Cross(m_rA, P) + m_angularImpulse);\n\t\tvB += mB * P;\n\t\twB += iB * (b2Cross(m_rB, P) + m_angularImpulse);\n\t}\n\telse\n\t{\n\t\tm_linearImpulse.SetZero();\n\t\tm_angularImpulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2MotorJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tfloat32 h = data.step.dt;\n\tfloat32 inv_h = data.step.inv_dt;\n\n\t// Solve angular friction\n\t{\n\t\tfloat32 Cdot = wB - wA + inv_h * m_correctionFactor * m_angularError;\n\t\tfloat32 impulse = -m_angularMass * Cdot;\n\n\t\tfloat32 oldImpulse = m_angularImpulse;\n\t\tfloat32 maxImpulse = h * m_maxTorque;\n\t\tm_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse);\n\t\timpulse = m_angularImpulse - oldImpulse;\n\n\t\twA -= iA * impulse;\n\t\twB += iB * impulse;\n\t}\n\n\t// Solve linear friction\n\t{\n\t\tb2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA) + inv_h * m_correctionFactor * m_linearError;\n\n\t\tb2Vec2 impulse = -b2Mul(m_linearMass, Cdot);\n\t\tb2Vec2 oldImpulse = m_linearImpulse;\n\t\tm_linearImpulse += impulse;\n\n\t\tfloat32 maxImpulse = h * m_maxForce;\n\n\t\tif (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse)\n\t\t{\n\t\t\tm_linearImpulse.Normalize();\n\t\t\tm_linearImpulse *= maxImpulse;\n\t\t}\n\n\t\timpulse = m_linearImpulse - oldImpulse;\n\n\t\tvA -= mA * impulse;\n\t\twA -= iA * b2Cross(m_rA, impulse);\n\n\t\tvB += mB * impulse;\n\t\twB += iB * b2Cross(m_rB, impulse);\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2MotorJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tB2_NOT_USED(data);\n\n\treturn true;\n}\n\nb2Vec2 b2MotorJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetPosition();\n}\n\nb2Vec2 b2MotorJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetPosition();\n}\n\nb2Vec2 b2MotorJoint::GetReactionForce(float32 inv_dt) const\n{\n\treturn inv_dt * m_linearImpulse;\n}\n\nfloat32 b2MotorJoint::GetReactionTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_angularImpulse;\n}\n\nvoid b2MotorJoint::SetMaxForce(float32 force)\n{\n\tb2Assert(b2IsValid(force) && force >= 0.0f);\n\tm_maxForce = force;\n}\n\nfloat32 b2MotorJoint::GetMaxForce() const\n{\n\treturn m_maxForce;\n}\n\nvoid b2MotorJoint::SetMaxTorque(float32 torque)\n{\n\tb2Assert(b2IsValid(torque) && torque >= 0.0f);\n\tm_maxTorque = torque;\n}\n\nfloat32 b2MotorJoint::GetMaxTorque() const\n{\n\treturn m_maxTorque;\n}\n\nvoid b2MotorJoint::SetCorrectionFactor(float32 factor)\n{\n\tb2Assert(b2IsValid(factor) && 0.0f <= factor && factor <= 1.0f);\n\tm_correctionFactor = factor;\n}\n\nfloat32 b2MotorJoint::GetCorrectionFactor() const\n{\n\treturn m_correctionFactor;\n}\n\nvoid b2MotorJoint::SetLinearOffset(const b2Vec2& linearOffset)\n{\n\tif (linearOffset.x != m_linearOffset.x || linearOffset.y != m_linearOffset.y)\n\t{\n\t\tm_bodyA->SetAwake(true);\n\t\tm_bodyB->SetAwake(true);\n\t\tm_linearOffset = linearOffset;\n\t}\n}\n\nconst b2Vec2& b2MotorJoint::GetLinearOffset() const\n{\n\treturn m_linearOffset;\n}\n\nvoid b2MotorJoint::SetAngularOffset(float32 angularOffset)\n{\n\tif (angularOffset != m_angularOffset)\n\t{\n\t\tm_bodyA->SetAwake(true);\n\t\tm_bodyB->SetAwake(true);\n\t\tm_angularOffset = angularOffset;\n\t}\n}\n\nfloat32 b2MotorJoint::GetAngularOffset() const\n{\n\treturn m_angularOffset;\n}\n\nvoid b2MotorJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2MotorJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.linearOffset.Set(%.15lef, %.15lef);\\n\", m_linearOffset.x, m_linearOffset.y);\n\tb2Log(\"  jd.angularOffset = %.15lef;\\n\", m_angularOffset);\n\tb2Log(\"  jd.maxForce = %.15lef;\\n\", m_maxForce);\n\tb2Log(\"  jd.maxTorque = %.15lef;\\n\", m_maxTorque);\n\tb2Log(\"  jd.correctionFactor = %.15lef;\\n\", m_correctionFactor);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2MotorJoint.h",
    "content": "/*\n* Copyright (c) 2006-2012 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_MOTOR_JOINT_H\n#define B2_MOTOR_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Motor joint definition.\nstruct b2MotorJointDef : public b2JointDef\n{\n\tb2MotorJointDef()\n\t{\n\t\ttype = e_motorJoint;\n\t\tlinearOffset.SetZero();\n\t\tangularOffset = 0.0f;\n\t\tmaxForce = 1.0f;\n\t\tmaxTorque = 1.0f;\n\t\tcorrectionFactor = 0.3f;\n\t}\n\n\t/// Initialize the bodies and offsets using the current transforms.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB);\n\n\t/// Position of bodyB minus the position of bodyA, in bodyA's frame, in meters.\n\tb2Vec2 linearOffset;\n\n\t/// The bodyB angle minus bodyA angle in radians.\n\tfloat32 angularOffset;\n\t\n\t/// The maximum motor force in N.\n\tfloat32 maxForce;\n\n\t/// The maximum motor torque in N-m.\n\tfloat32 maxTorque;\n\n\t/// Position correction factor in the range [0,1].\n\tfloat32 correctionFactor;\n};\n\n/// A motor joint is used to control the relative motion\n/// between two bodies. A typical usage is to control the movement\n/// of a dynamic body with respect to the ground.\nclass b2MotorJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// Set/get the target linear offset, in frame A, in meters.\n\tvoid SetLinearOffset(const b2Vec2& linearOffset);\n\tconst b2Vec2& GetLinearOffset() const;\n\n\t/// Set/get the target angular offset, in radians.\n\tvoid SetAngularOffset(float32 angularOffset);\n\tfloat32 GetAngularOffset() const;\n\n\t/// Set the maximum friction force in N.\n\tvoid SetMaxForce(float32 force);\n\n\t/// Get the maximum friction force in N.\n\tfloat32 GetMaxForce() const;\n\n\t/// Set the maximum friction torque in N*m.\n\tvoid SetMaxTorque(float32 torque);\n\n\t/// Get the maximum friction torque in N*m.\n\tfloat32 GetMaxTorque() const;\n\n\t/// Set the position correction factor in the range [0,1].\n\tvoid SetCorrectionFactor(float32 factor);\n\n\t/// Get the position correction factor in the range [0,1].\n\tfloat32 GetCorrectionFactor() const;\n\n\t/// Dump to b2Log\n\tvoid Dump();\n\nprotected:\n\n\tfriend class b2Joint;\n\n\tb2MotorJoint(const b2MotorJointDef* def);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\t// Solver shared\n\tb2Vec2 m_linearOffset;\n\tfloat32 m_angularOffset;\n\tb2Vec2 m_linearImpulse;\n\tfloat32 m_angularImpulse;\n\tfloat32 m_maxForce;\n\tfloat32 m_maxTorque;\n\tfloat32 m_correctionFactor;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_rA;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tb2Vec2 m_linearError;\n\tfloat32 m_angularError;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tb2Mat22 m_linearMass;\n\tfloat32 m_angularMass;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2MouseJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2MouseJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// p = attached point, m = mouse point\n// C = p - m\n// Cdot = v\n//      = v + cross(w, r)\n// J = [I r_skew]\n// Identity used:\n// w k % (rx i + ry j) = w * (-ry i + rx j)\n\nb2MouseJoint::b2MouseJoint(const b2MouseJointDef* def)\n: b2Joint(def)\n{\n\tb2Assert(def->target.IsValid());\n\tb2Assert(b2IsValid(def->maxForce) && def->maxForce >= 0.0f);\n\tb2Assert(b2IsValid(def->frequencyHz) && def->frequencyHz >= 0.0f);\n\tb2Assert(b2IsValid(def->dampingRatio) && def->dampingRatio >= 0.0f);\n\n\tm_targetA = def->target;\n\tm_localAnchorB = b2MulT(m_bodyB->GetTransform(), m_targetA);\n\n\tm_maxForce = def->maxForce;\n\tm_impulse.SetZero();\n\n\tm_frequencyHz = def->frequencyHz;\n\tm_dampingRatio = def->dampingRatio;\n\n\tm_beta = 0.0f;\n\tm_gamma = 0.0f;\n}\n\nvoid b2MouseJoint::SetTarget(const b2Vec2& target)\n{\n\tif (m_bodyB->IsAwake() == false)\n\t{\n\t\tm_bodyB->SetAwake(true);\n\t}\n\tm_targetA = target;\n}\n\nconst b2Vec2& b2MouseJoint::GetTarget() const\n{\n\treturn m_targetA;\n}\n\nvoid b2MouseJoint::SetMaxForce(float32 force)\n{\n\tm_maxForce = force;\n}\n\nfloat32 b2MouseJoint::GetMaxForce() const\n{\n\treturn m_maxForce;\n}\n\nvoid b2MouseJoint::SetFrequency(float32 hz)\n{\n\tm_frequencyHz = hz;\n}\n\nfloat32 b2MouseJoint::GetFrequency() const\n{\n\treturn m_frequencyHz;\n}\n\nvoid b2MouseJoint::SetDampingRatio(float32 ratio)\n{\n\tm_dampingRatio = ratio;\n}\n\nfloat32 b2MouseJoint::GetDampingRatio() const\n{\n\treturn m_dampingRatio;\n}\n\nvoid b2MouseJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIB = m_bodyB->m_invI;\n\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qB(aB);\n\n\tfloat32 mass = m_bodyB->GetMass();\n\n\t// Frequency\n\tfloat32 omega = 2.0f * b2_pi * m_frequencyHz;\n\n\t// Damping coefficient\n\tfloat32 d = 2.0f * mass * m_dampingRatio * omega;\n\n\t// Spring stiffness\n\tfloat32 k = mass * (omega * omega);\n\n\t// magic formulas\n\t// gamma has units of inverse mass.\n\t// beta has units of inverse time.\n\tfloat32 h = data.step.dt;\n\tb2Assert(d + h * k > b2_epsilon);\n\tm_gamma = h * (d + h * k);\n\tif (m_gamma != 0.0f)\n\t{\n\t\tm_gamma = 1.0f / m_gamma;\n\t}\n\tm_beta = h * k * m_gamma;\n\n\t// Compute the effective mass matrix.\n\tm_rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\t// K    = [(1/m1 + 1/m2) * eye(2) - skew(r1) * invI1 * skew(r1) - skew(r2) * invI2 * skew(r2)]\n\t//      = [1/m1+1/m2     0    ] + invI1 * [r1.y*r1.y -r1.x*r1.y] + invI2 * [r1.y*r1.y -r1.x*r1.y]\n\t//        [    0     1/m1+1/m2]           [-r1.x*r1.y r1.x*r1.x]           [-r1.x*r1.y r1.x*r1.x]\n\tb2Mat22 K;\n\tK.ex.x = m_invMassB + m_invIB * m_rB.y * m_rB.y + m_gamma;\n\tK.ex.y = -m_invIB * m_rB.x * m_rB.y;\n\tK.ey.x = K.ex.y;\n\tK.ey.y = m_invMassB + m_invIB * m_rB.x * m_rB.x + m_gamma;\n\n\tm_mass = K.GetInverse();\n\n\tm_C = cB + m_rB - m_targetA;\n\tm_C *= m_beta;\n\n\t// Cheat with some damping\n\twB *= 0.98f;\n\n\tif (data.step.warmStarting)\n\t{\n\t\tm_impulse *= data.step.dtRatio;\n\t\tvB += m_invMassB * m_impulse;\n\t\twB += m_invIB * b2Cross(m_rB, m_impulse);\n\t}\n\telse\n\t{\n\t\tm_impulse.SetZero();\n\t}\n\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2MouseJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\t// Cdot = v + cross(w, r)\n\tb2Vec2 Cdot = vB + b2Cross(wB, m_rB);\n\tb2Vec2 impulse = b2Mul(m_mass, -(Cdot + m_C + m_gamma * m_impulse));\n\n\tb2Vec2 oldImpulse = m_impulse;\n\tm_impulse += impulse;\n\tfloat32 maxImpulse = data.step.dt * m_maxForce;\n\tif (m_impulse.LengthSquared() > maxImpulse * maxImpulse)\n\t{\n\t\tm_impulse *= maxImpulse / m_impulse.Length();\n\t}\n\timpulse = m_impulse - oldImpulse;\n\n\tvB += m_invMassB * impulse;\n\twB += m_invIB * b2Cross(m_rB, impulse);\n\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2MouseJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tB2_NOT_USED(data);\n\treturn true;\n}\n\nb2Vec2 b2MouseJoint::GetAnchorA() const\n{\n\treturn m_targetA;\n}\n\nb2Vec2 b2MouseJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2MouseJoint::GetReactionForce(float32 inv_dt) const\n{\n\treturn inv_dt * m_impulse;\n}\n\nfloat32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const\n{\n\treturn inv_dt * 0.0f;\n}\n\nvoid b2MouseJoint::ShiftOrigin(const b2Vec2& newOrigin)\n{\n\tm_targetA -= newOrigin;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2MouseJoint.h",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_MOUSE_JOINT_H\n#define B2_MOUSE_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Mouse joint definition. This requires a world target point,\n/// tuning parameters, and the time step.\nstruct b2MouseJointDef : public b2JointDef\n{\n\tb2MouseJointDef()\n\t{\n\t\ttype = e_mouseJoint;\n\t\ttarget.Set(0.0f, 0.0f);\n\t\tmaxForce = 0.0f;\n\t\tfrequencyHz = 5.0f;\n\t\tdampingRatio = 0.7f;\n\t}\n\n\t/// The initial world target point. This is assumed\n\t/// to coincide with the body anchor initially.\n\tb2Vec2 target;\n\n\t/// The maximum constraint force that can be exerted\n\t/// to move the candidate body. Usually you will express\n\t/// as some multiple of the weight (multiplier * mass * gravity).\n\tfloat32 maxForce;\n\n\t/// The response speed.\n\tfloat32 frequencyHz;\n\n\t/// The damping ratio. 0 = no damping, 1 = critical damping.\n\tfloat32 dampingRatio;\n};\n\n/// A mouse joint is used to make a point on a body track a\n/// specified world point. This a soft constraint with a maximum\n/// force. This allows the constraint to stretch and without\n/// applying huge forces.\n/// NOTE: this joint is not documented in the manual because it was\n/// developed to be used in the testbed. If you want to learn how to\n/// use the mouse joint, look at the testbed.\nclass b2MouseJoint : public b2Joint\n{\npublic:\n\n\t/// Implements b2Joint.\n\tb2Vec2 GetAnchorA() const;\n\n\t/// Implements b2Joint.\n\tb2Vec2 GetAnchorB() const;\n\n\t/// Implements b2Joint.\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\n\t/// Implements b2Joint.\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// Use this to update the target point.\n\tvoid SetTarget(const b2Vec2& target);\n\tconst b2Vec2& GetTarget() const;\n\n\t/// Set/get the maximum force in Newtons.\n\tvoid SetMaxForce(float32 force);\n\tfloat32 GetMaxForce() const;\n\n\t/// Set/get the frequency in Hertz.\n\tvoid SetFrequency(float32 hz);\n\tfloat32 GetFrequency() const;\n\n\t/// Set/get the damping ratio (dimensionless).\n\tvoid SetDampingRatio(float32 ratio);\n\tfloat32 GetDampingRatio() const;\n\n\t/// The mouse joint does not support dumping.\n\tvoid Dump() { b2Log(\"Mouse joint dumping is not supported.\\n\"); }\n\n\t/// Implement b2Joint::ShiftOrigin\n\tvoid ShiftOrigin(const b2Vec2& newOrigin);\n\nprotected:\n\tfriend class b2Joint;\n\n\tb2MouseJoint(const b2MouseJointDef* def);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\tb2Vec2 m_localAnchorB;\n\tb2Vec2 m_targetA;\n\tfloat32 m_frequencyHz;\n\tfloat32 m_dampingRatio;\n\tfloat32 m_beta;\n\t\n\t// Solver shared\n\tb2Vec2 m_impulse;\n\tfloat32 m_maxForce;\n\tfloat32 m_gamma;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIB;\n\tb2Mat22 m_mass;\n\tb2Vec2 m_C;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Linear constraint (point-to-line)\n// d = p2 - p1 = x2 + r2 - x1 - r1\n// C = dot(perp, d)\n// Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1))\n//      = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2)\n// J = [-perp, -cross(d + r1, perp), perp, cross(r2,perp)]\n//\n// Angular constraint\n// C = a2 - a1 + a_initial\n// Cdot = w2 - w1\n// J = [0 0 -1 0 0 1]\n//\n// K = J * invM * JT\n//\n// J = [-a -s1 a s2]\n//     [0  -1  0  1]\n// a = perp\n// s1 = cross(d + r1, a) = cross(p2 - x1, a)\n// s2 = cross(r2, a) = cross(p2 - x2, a)\n\n\n// Motor/Limit linear constraint\n// C = dot(ax1, d)\n// Cdot = = -dot(ax1, v1) - dot(cross(d + r1, ax1), w1) + dot(ax1, v2) + dot(cross(r2, ax1), v2)\n// J = [-ax1 -cross(d+r1,ax1) ax1 cross(r2,ax1)]\n\n// Block Solver\n// We develop a block solver that includes the joint limit. This makes the limit stiff (inelastic) even\n// when the mass has poor distribution (leading to large torques about the joint anchor points).\n//\n// The Jacobian has 3 rows:\n// J = [-uT -s1 uT s2] // linear\n//     [0   -1   0  1] // angular\n//     [-vT -a1 vT a2] // limit\n//\n// u = perp\n// v = axis\n// s1 = cross(d + r1, u), s2 = cross(r2, u)\n// a1 = cross(d + r1, v), a2 = cross(r2, v)\n\n// M * (v2 - v1) = JT * df\n// J * v2 = bias\n//\n// v2 = v1 + invM * JT * df\n// J * (v1 + invM * JT * df) = bias\n// K * df = bias - J * v1 = -Cdot\n// K = J * invM * JT\n// Cdot = J * v1 - bias\n//\n// Now solve for f2.\n// df = f2 - f1\n// K * (f2 - f1) = -Cdot\n// f2 = invK * (-Cdot) + f1\n//\n// Clamp accumulated limit impulse.\n// lower: f2(3) = max(f2(3), 0)\n// upper: f2(3) = min(f2(3), 0)\n//\n// Solve for correct f2(1:2)\n// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:3) * f1\n//                       = -Cdot(1:2) - K(1:2,3) * f2(3) + K(1:2,1:2) * f1(1:2) + K(1:2,3) * f1(3)\n// K(1:2, 1:2) * f2(1:2) = -Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3)) + K(1:2,1:2) * f1(1:2)\n// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2)\n//\n// Now compute impulse to be applied:\n// df = f2 - f1\n\nvoid b2PrismaticJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis)\n{\n\tbodyA = bA;\n\tbodyB = bB;\n\tlocalAnchorA = bodyA->GetLocalPoint(anchor);\n\tlocalAnchorB = bodyB->GetLocalPoint(anchor);\n\tlocalAxisA = bodyA->GetLocalVector(axis);\n\treferenceAngle = bodyB->GetAngle() - bodyA->GetAngle();\n}\n\nb2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def)\n: b2Joint(def)\n{\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\tm_localXAxisA = def->localAxisA;\n\tm_localXAxisA.Normalize();\n\tm_localYAxisA = b2Cross(1.0f, m_localXAxisA);\n\tm_referenceAngle = def->referenceAngle;\n\n\tm_impulse.SetZero();\n\tm_motorMass = 0.0f;\n\tm_motorImpulse = 0.0f;\n\n\tm_lowerTranslation = def->lowerTranslation;\n\tm_upperTranslation = def->upperTranslation;\n\tm_maxMotorForce = def->maxMotorForce;\n\tm_motorSpeed = def->motorSpeed;\n\tm_enableLimit = def->enableLimit;\n\tm_enableMotor = def->enableMotor;\n\tm_limitState = e_inactiveLimit;\n\n\tm_axis.SetZero();\n\tm_perp.SetZero();\n}\n\nvoid b2PrismaticJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\t// Compute the effective masses.\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tb2Vec2 d = (cB - cA) + rB - rA;\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\t// Compute motor Jacobian and effective mass.\n\t{\n\t\tm_axis = b2Mul(qA, m_localXAxisA);\n\t\tm_a1 = b2Cross(d + rA, m_axis);\n\t\tm_a2 = b2Cross(rB, m_axis);\n\n\t\tm_motorMass = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2;\n\t\tif (m_motorMass > 0.0f)\n\t\t{\n\t\t\tm_motorMass = 1.0f / m_motorMass;\n\t\t}\n\t}\n\n\t// Prismatic constraint.\n\t{\n\t\tm_perp = b2Mul(qA, m_localYAxisA);\n\n\t\tm_s1 = b2Cross(d + rA, m_perp);\n\t\tm_s2 = b2Cross(rB, m_perp);\n\n\t\tfloat32 k11 = mA + mB + iA * m_s1 * m_s1 + iB * m_s2 * m_s2;\n\t\tfloat32 k12 = iA * m_s1 + iB * m_s2;\n\t\tfloat32 k13 = iA * m_s1 * m_a1 + iB * m_s2 * m_a2;\n\t\tfloat32 k22 = iA + iB;\n\t\tif (k22 == 0.0f)\n\t\t{\n\t\t\t// For bodies with fixed rotation.\n\t\t\tk22 = 1.0f;\n\t\t}\n\t\tfloat32 k23 = iA * m_a1 + iB * m_a2;\n\t\tfloat32 k33 = mA + mB + iA * m_a1 * m_a1 + iB * m_a2 * m_a2;\n\n\t\tm_K.ex.Set(k11, k12, k13);\n\t\tm_K.ey.Set(k12, k22, k23);\n\t\tm_K.ez.Set(k13, k23, k33);\n\t}\n\n\t// Compute motor and limit terms.\n\tif (m_enableLimit)\n\t{\n\t\tfloat32 jointTranslation = b2Dot(m_axis, d);\n\t\tif (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop)\n\t\t{\n\t\t\tm_limitState = e_equalLimits;\n\t\t}\n\t\telse if (jointTranslation <= m_lowerTranslation)\n\t\t{\n\t\t\tif (m_limitState != e_atLowerLimit)\n\t\t\t{\n\t\t\t\tm_limitState = e_atLowerLimit;\n\t\t\t\tm_impulse.z = 0.0f;\n\t\t\t}\n\t\t}\n\t\telse if (jointTranslation >= m_upperTranslation)\n\t\t{\n\t\t\tif (m_limitState != e_atUpperLimit)\n\t\t\t{\n\t\t\t\tm_limitState = e_atUpperLimit;\n\t\t\t\tm_impulse.z = 0.0f;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_limitState = e_inactiveLimit;\n\t\t\tm_impulse.z = 0.0f;\n\t\t}\n\t}\n\telse\n\t{\n\t\tm_limitState = e_inactiveLimit;\n\t\tm_impulse.z = 0.0f;\n\t}\n\n\tif (m_enableMotor == false)\n\t{\n\t\tm_motorImpulse = 0.0f;\n\t}\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Account for variable time step.\n\t\tm_impulse *= data.step.dtRatio;\n\t\tm_motorImpulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P = m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis;\n\t\tfloat32 LA = m_impulse.x * m_s1 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a1;\n\t\tfloat32 LB = m_impulse.x * m_s2 + m_impulse.y + (m_motorImpulse + m_impulse.z) * m_a2;\n\n\t\tvA -= mA * P;\n\t\twA -= iA * LA;\n\n\t\tvB += mB * P;\n\t\twB += iB * LB;\n\t}\n\telse\n\t{\n\t\tm_impulse.SetZero();\n\t\tm_motorImpulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\t// Solve linear motor constraint.\n\tif (m_enableMotor && m_limitState != e_equalLimits)\n\t{\n\t\tfloat32 Cdot = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA;\n\t\tfloat32 impulse = m_motorMass * (m_motorSpeed - Cdot);\n\t\tfloat32 oldImpulse = m_motorImpulse;\n\t\tfloat32 maxImpulse = data.step.dt * m_maxMotorForce;\n\t\tm_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse);\n\t\timpulse = m_motorImpulse - oldImpulse;\n\n\t\tb2Vec2 P = impulse * m_axis;\n\t\tfloat32 LA = impulse * m_a1;\n\t\tfloat32 LB = impulse * m_a2;\n\n\t\tvA -= mA * P;\n\t\twA -= iA * LA;\n\n\t\tvB += mB * P;\n\t\twB += iB * LB;\n\t}\n\n\tb2Vec2 Cdot1;\n\tCdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA;\n\tCdot1.y = wB - wA;\n\n\tif (m_enableLimit && m_limitState != e_inactiveLimit)\n\t{\n\t\t// Solve prismatic and limit constraint in block form.\n\t\tfloat32 Cdot2;\n\t\tCdot2 = b2Dot(m_axis, vB - vA) + m_a2 * wB - m_a1 * wA;\n\t\tb2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2);\n\n\t\tb2Vec3 f1 = m_impulse;\n\t\tb2Vec3 df =  m_K.Solve33(-Cdot);\n\t\tm_impulse += df;\n\n\t\tif (m_limitState == e_atLowerLimit)\n\t\t{\n\t\t\tm_impulse.z = b2Max(m_impulse.z, 0.0f);\n\t\t}\n\t\telse if (m_limitState == e_atUpperLimit)\n\t\t{\n\t\t\tm_impulse.z = b2Min(m_impulse.z, 0.0f);\n\t\t}\n\n\t\t// f2(1:2) = invK(1:2,1:2) * (-Cdot(1:2) - K(1:2,3) * (f2(3) - f1(3))) + f1(1:2)\n\t\tb2Vec2 b = -Cdot1 - (m_impulse.z - f1.z) * b2Vec2(m_K.ez.x, m_K.ez.y);\n\t\tb2Vec2 f2r = m_K.Solve22(b) + b2Vec2(f1.x, f1.y);\n\t\tm_impulse.x = f2r.x;\n\t\tm_impulse.y = f2r.y;\n\n\t\tdf = m_impulse - f1;\n\n\t\tb2Vec2 P = df.x * m_perp + df.z * m_axis;\n\t\tfloat32 LA = df.x * m_s1 + df.y + df.z * m_a1;\n\t\tfloat32 LB = df.x * m_s2 + df.y + df.z * m_a2;\n\n\t\tvA -= mA * P;\n\t\twA -= iA * LA;\n\n\t\tvB += mB * P;\n\t\twB += iB * LB;\n\t}\n\telse\n\t{\n\t\t// Limit is inactive, just solve the prismatic constraint in block form.\n\t\tb2Vec2 df = m_K.Solve22(-Cdot1);\n\t\tm_impulse.x += df.x;\n\t\tm_impulse.y += df.y;\n\n\t\tb2Vec2 P = df.x * m_perp;\n\t\tfloat32 LA = df.x * m_s1 + df.y;\n\t\tfloat32 LB = df.x * m_s2 + df.y;\n\n\t\tvA -= mA * P;\n\t\twA -= iA * LA;\n\n\t\tvB += mB * P;\n\t\twB += iB * LB;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2PrismaticJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\t// Compute fresh Jacobians\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tb2Vec2 d = cB + rB - cA - rA;\n\n\tb2Vec2 axis = b2Mul(qA, m_localXAxisA);\n\tfloat32 a1 = b2Cross(d + rA, axis);\n\tfloat32 a2 = b2Cross(rB, axis);\n\tb2Vec2 perp = b2Mul(qA, m_localYAxisA);\n\n\tfloat32 s1 = b2Cross(d + rA, perp);\n\tfloat32 s2 = b2Cross(rB, perp);\n\n\tb2Vec3 impulse;\n\tb2Vec2 C1;\n\tC1.x = b2Dot(perp, d);\n\tC1.y = aB - aA - m_referenceAngle;\n\n\tfloat32 linearError = b2Abs(C1.x);\n\tfloat32 angularError = b2Abs(C1.y);\n\n\tbool active = false;\n\tfloat32 C2 = 0.0f;\n\tif (m_enableLimit)\n\t{\n\t\tfloat32 translation = b2Dot(axis, d);\n\t\tif (b2Abs(m_upperTranslation - m_lowerTranslation) < 2.0f * b2_linearSlop)\n\t\t{\n\t\t\t// Prevent large angular corrections\n\t\t\tC2 = b2Clamp(translation, -b2_maxLinearCorrection, b2_maxLinearCorrection);\n\t\t\tlinearError = b2Max(linearError, b2Abs(translation));\n\t\t\tactive = true;\n\t\t}\n\t\telse if (translation <= m_lowerTranslation)\n\t\t{\n\t\t\t// Prevent large linear corrections and allow some slop.\n\t\t\tC2 = b2Clamp(translation - m_lowerTranslation + b2_linearSlop, -b2_maxLinearCorrection, 0.0f);\n\t\t\tlinearError = b2Max(linearError, m_lowerTranslation - translation);\n\t\t\tactive = true;\n\t\t}\n\t\telse if (translation >= m_upperTranslation)\n\t\t{\n\t\t\t// Prevent large linear corrections and allow some slop.\n\t\t\tC2 = b2Clamp(translation - m_upperTranslation - b2_linearSlop, 0.0f, b2_maxLinearCorrection);\n\t\t\tlinearError = b2Max(linearError, translation - m_upperTranslation);\n\t\t\tactive = true;\n\t\t}\n\t}\n\n\tif (active)\n\t{\n\t\tfloat32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2;\n\t\tfloat32 k12 = iA * s1 + iB * s2;\n\t\tfloat32 k13 = iA * s1 * a1 + iB * s2 * a2;\n\t\tfloat32 k22 = iA + iB;\n\t\tif (k22 == 0.0f)\n\t\t{\n\t\t\t// For fixed rotation\n\t\t\tk22 = 1.0f;\n\t\t}\n\t\tfloat32 k23 = iA * a1 + iB * a2;\n\t\tfloat32 k33 = mA + mB + iA * a1 * a1 + iB * a2 * a2;\n\n\t\tb2Mat33 K;\n\t\tK.ex.Set(k11, k12, k13);\n\t\tK.ey.Set(k12, k22, k23);\n\t\tK.ez.Set(k13, k23, k33);\n\n\t\tb2Vec3 C;\n\t\tC.x = C1.x;\n\t\tC.y = C1.y;\n\t\tC.z = C2;\n\n\t\timpulse = K.Solve33(-C);\n\t}\n\telse\n\t{\n\t\tfloat32 k11 = mA + mB + iA * s1 * s1 + iB * s2 * s2;\n\t\tfloat32 k12 = iA * s1 + iB * s2;\n\t\tfloat32 k22 = iA + iB;\n\t\tif (k22 == 0.0f)\n\t\t{\n\t\t\tk22 = 1.0f;\n\t\t}\n\n\t\tb2Mat22 K;\n\t\tK.ex.Set(k11, k12);\n\t\tK.ey.Set(k12, k22);\n\n\t\tb2Vec2 impulse1 = K.Solve(-C1);\n\t\timpulse.x = impulse1.x;\n\t\timpulse.y = impulse1.y;\n\t\timpulse.z = 0.0f;\n\t}\n\n\tb2Vec2 P = impulse.x * perp + impulse.z * axis;\n\tfloat32 LA = impulse.x * s1 + impulse.y + impulse.z * a1;\n\tfloat32 LB = impulse.x * s2 + impulse.y + impulse.z * a2;\n\n\tcA -= mA * P;\n\taA -= iA * LA;\n\tcB += mB * P;\n\taB += iB * LB;\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\n\treturn linearError <= b2_linearSlop && angularError <= b2_angularSlop;\n}\n\nb2Vec2 b2PrismaticJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2PrismaticJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2PrismaticJoint::GetReactionForce(float32 inv_dt) const\n{\n\treturn inv_dt * (m_impulse.x * m_perp + (m_motorImpulse + m_impulse.z) * m_axis);\n}\n\nfloat32 b2PrismaticJoint::GetReactionTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_impulse.y;\n}\n\nfloat32 b2PrismaticJoint::GetJointTranslation() const\n{\n\tb2Vec2 pA = m_bodyA->GetWorldPoint(m_localAnchorA);\n\tb2Vec2 pB = m_bodyB->GetWorldPoint(m_localAnchorB);\n\tb2Vec2 d = pB - pA;\n\tb2Vec2 axis = m_bodyA->GetWorldVector(m_localXAxisA);\n\n\tfloat32 translation = b2Dot(d, axis);\n\treturn translation;\n}\n\nfloat32 b2PrismaticJoint::GetJointSpeed() const\n{\n\tb2Body* bA = m_bodyA;\n\tb2Body* bB = m_bodyB;\n\n\tb2Vec2 rA = b2Mul(bA->m_xf.q, m_localAnchorA - bA->m_sweep.localCenter);\n\tb2Vec2 rB = b2Mul(bB->m_xf.q, m_localAnchorB - bB->m_sweep.localCenter);\n\tb2Vec2 p1 = bA->m_sweep.c + rA;\n\tb2Vec2 p2 = bB->m_sweep.c + rB;\n\tb2Vec2 d = p2 - p1;\n\tb2Vec2 axis = b2Mul(bA->m_xf.q, m_localXAxisA);\n\n\tb2Vec2 vA = bA->m_linearVelocity;\n\tb2Vec2 vB = bB->m_linearVelocity;\n\tfloat32 wA = bA->m_angularVelocity;\n\tfloat32 wB = bB->m_angularVelocity;\n\n\tfloat32 speed = b2Dot(d, b2Cross(wA, axis)) + b2Dot(axis, vB + b2Cross(wB, rB) - vA - b2Cross(wA, rA));\n\treturn speed;\n}\n\nbool b2PrismaticJoint::IsLimitEnabled() const\n{\n\treturn m_enableLimit;\n}\n\nvoid b2PrismaticJoint::EnableLimit(bool flag)\n{\n\tif (flag != m_enableLimit)\n\t{\n\t\tm_bodyA->SetAwake(true);\n\t\tm_bodyB->SetAwake(true);\n\t\tm_enableLimit = flag;\n\t\tm_impulse.z = 0.0f;\n\t}\n}\n\nfloat32 b2PrismaticJoint::GetLowerLimit() const\n{\n\treturn m_lowerTranslation;\n}\n\nfloat32 b2PrismaticJoint::GetUpperLimit() const\n{\n\treturn m_upperTranslation;\n}\n\nvoid b2PrismaticJoint::SetLimits(float32 lower, float32 upper)\n{\n\tb2Assert(lower <= upper);\n\tif (lower != m_lowerTranslation || upper != m_upperTranslation)\n\t{\n\t\tm_bodyA->SetAwake(true);\n\t\tm_bodyB->SetAwake(true);\n\t\tm_lowerTranslation = lower;\n\t\tm_upperTranslation = upper;\n\t\tm_impulse.z = 0.0f;\n\t}\n}\n\nbool b2PrismaticJoint::IsMotorEnabled() const\n{\n\treturn m_enableMotor;\n}\n\nvoid b2PrismaticJoint::EnableMotor(bool flag)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_enableMotor = flag;\n}\n\nvoid b2PrismaticJoint::SetMotorSpeed(float32 speed)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_motorSpeed = speed;\n}\n\nvoid b2PrismaticJoint::SetMaxMotorForce(float32 force)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_maxMotorForce = force;\n}\n\nfloat32 b2PrismaticJoint::GetMotorForce(float32 inv_dt) const\n{\n\treturn inv_dt * m_motorImpulse;\n}\n\nvoid b2PrismaticJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2PrismaticJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.localAxisA.Set(%.15lef, %.15lef);\\n\", m_localXAxisA.x, m_localXAxisA.y);\n\tb2Log(\"  jd.referenceAngle = %.15lef;\\n\", m_referenceAngle);\n\tb2Log(\"  jd.enableLimit = bool(%d);\\n\", m_enableLimit);\n\tb2Log(\"  jd.lowerTranslation = %.15lef;\\n\", m_lowerTranslation);\n\tb2Log(\"  jd.upperTranslation = %.15lef;\\n\", m_upperTranslation);\n\tb2Log(\"  jd.enableMotor = bool(%d);\\n\", m_enableMotor);\n\tb2Log(\"  jd.motorSpeed = %.15lef;\\n\", m_motorSpeed);\n\tb2Log(\"  jd.maxMotorForce = %.15lef;\\n\", m_maxMotorForce);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2PrismaticJoint.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_PRISMATIC_JOINT_H\n#define B2_PRISMATIC_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Prismatic joint definition. This requires defining a line of\n/// motion using an axis and an anchor point. The definition uses local\n/// anchor points and a local axis so that the initial configuration\n/// can violate the constraint slightly. The joint translation is zero\n/// when the local anchor points coincide in world space. Using local\n/// anchors and a local axis helps when saving and loading a game.\nstruct b2PrismaticJointDef : public b2JointDef\n{\n\tb2PrismaticJointDef()\n\t{\n\t\ttype = e_prismaticJoint;\n\t\tlocalAnchorA.SetZero();\n\t\tlocalAnchorB.SetZero();\n\t\tlocalAxisA.Set(1.0f, 0.0f);\n\t\treferenceAngle = 0.0f;\n\t\tenableLimit = false;\n\t\tlowerTranslation = 0.0f;\n\t\tupperTranslation = 0.0f;\n\t\tenableMotor = false;\n\t\tmaxMotorForce = 0.0f;\n\t\tmotorSpeed = 0.0f;\n\t}\n\n\t/// Initialize the bodies, anchors, axis, and reference angle using the world\n\t/// anchor and unit world axis.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis);\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The local translation unit axis in bodyA.\n\tb2Vec2 localAxisA;\n\n\t/// The constrained angle between the bodies: bodyB_angle - bodyA_angle.\n\tfloat32 referenceAngle;\n\n\t/// Enable/disable the joint limit.\n\tbool enableLimit;\n\n\t/// The lower translation limit, usually in meters.\n\tfloat32 lowerTranslation;\n\n\t/// The upper translation limit, usually in meters.\n\tfloat32 upperTranslation;\n\n\t/// Enable/disable the joint motor.\n\tbool enableMotor;\n\n\t/// The maximum motor torque, usually in N-m.\n\tfloat32 maxMotorForce;\n\n\t/// The desired motor speed in radians per second.\n\tfloat32 motorSpeed;\n};\n\n/// A prismatic joint. This joint provides one degree of freedom: translation\n/// along an axis fixed in bodyA. Relative rotation is prevented. You can\n/// use a joint limit to restrict the range of motion and a joint motor to\n/// drive the motion or to model joint friction.\nclass b2PrismaticJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tconst b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; }\n\n\t/// The local anchor point relative to bodyB's origin.\n\tconst b2Vec2& GetLocalAnchorB() const  { return m_localAnchorB; }\n\n\t/// The local joint axis relative to bodyA.\n\tconst b2Vec2& GetLocalAxisA() const { return m_localXAxisA; }\n\n\t/// Get the reference angle.\n\tfloat32 GetReferenceAngle() const { return m_referenceAngle; }\n\n\t/// Get the current joint translation, usually in meters.\n\tfloat32 GetJointTranslation() const;\n\n\t/// Get the current joint translation speed, usually in meters per second.\n\tfloat32 GetJointSpeed() const;\n\n\t/// Is the joint limit enabled?\n\tbool IsLimitEnabled() const;\n\n\t/// Enable/disable the joint limit.\n\tvoid EnableLimit(bool flag);\n\n\t/// Get the lower joint limit, usually in meters.\n\tfloat32 GetLowerLimit() const;\n\n\t/// Get the upper joint limit, usually in meters.\n\tfloat32 GetUpperLimit() const;\n\n\t/// Set the joint limits, usually in meters.\n\tvoid SetLimits(float32 lower, float32 upper);\n\n\t/// Is the joint motor enabled?\n\tbool IsMotorEnabled() const;\n\n\t/// Enable/disable the joint motor.\n\tvoid EnableMotor(bool flag);\n\n\t/// Set the motor speed, usually in meters per second.\n\tvoid SetMotorSpeed(float32 speed);\n\n\t/// Get the motor speed, usually in meters per second.\n\tfloat32 GetMotorSpeed() const;\n\n\t/// Set the maximum motor force, usually in N.\n\tvoid SetMaxMotorForce(float32 force);\n\tfloat32 GetMaxMotorForce() const { return m_maxMotorForce; }\n\n\t/// Get the current motor force given the inverse time step, usually in N.\n\tfloat32 GetMotorForce(float32 inv_dt) const;\n\n\t/// Dump to b2Log\n\tvoid Dump();\n\nprotected:\n\tfriend class b2Joint;\n\tfriend class b2GearJoint;\n\tb2PrismaticJoint(const b2PrismaticJointDef* def);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tb2Vec2 m_localXAxisA;\n\tb2Vec2 m_localYAxisA;\n\tfloat32 m_referenceAngle;\n\tb2Vec3 m_impulse;\n\tfloat32 m_motorImpulse;\n\tfloat32 m_lowerTranslation;\n\tfloat32 m_upperTranslation;\n\tfloat32 m_maxMotorForce;\n\tfloat32 m_motorSpeed;\n\tbool m_enableLimit;\n\tbool m_enableMotor;\n\tb2LimitState m_limitState;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tb2Vec2 m_axis, m_perp;\n\tfloat32 m_s1, m_s2;\n\tfloat32 m_a1, m_a2;\n\tb2Mat33 m_K;\n\tfloat32 m_motorMass;\n};\n\ninline float32 b2PrismaticJoint::GetMotorSpeed() const\n{\n\treturn m_motorSpeed;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp",
    "content": "/*\n* Copyright (c) 2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Pulley:\n// length1 = norm(p1 - s1)\n// length2 = norm(p2 - s2)\n// C0 = (length1 + ratio * length2)_initial\n// C = C0 - (length1 + ratio * length2)\n// u1 = (p1 - s1) / norm(p1 - s1)\n// u2 = (p2 - s2) / norm(p2 - s2)\n// Cdot = -dot(u1, v1 + cross(w1, r1)) - ratio * dot(u2, v2 + cross(w2, r2))\n// J = -[u1 cross(r1, u1) ratio * u2  ratio * cross(r2, u2)]\n// K = J * invM * JT\n//   = invMass1 + invI1 * cross(r1, u1)^2 + ratio^2 * (invMass2 + invI2 * cross(r2, u2)^2)\n\nvoid b2PulleyJointDef::Initialize(b2Body* bA, b2Body* bB,\n\t\t\t\tconst b2Vec2& groundA, const b2Vec2& groundB,\n\t\t\t\tconst b2Vec2& anchorA, const b2Vec2& anchorB,\n\t\t\t\tfloat32 r)\n{\n\tbodyA = bA;\n\tbodyB = bB;\n\tgroundAnchorA = groundA;\n\tgroundAnchorB = groundB;\n\tlocalAnchorA = bodyA->GetLocalPoint(anchorA);\n\tlocalAnchorB = bodyB->GetLocalPoint(anchorB);\n\tb2Vec2 dA = anchorA - groundA;\n\tlengthA = dA.Length();\n\tb2Vec2 dB = anchorB - groundB;\n\tlengthB = dB.Length();\n\tratio = r;\n\tb2Assert(ratio > b2_epsilon);\n}\n\nb2PulleyJoint::b2PulleyJoint(const b2PulleyJointDef* def)\n: b2Joint(def)\n{\n\tm_groundAnchorA = def->groundAnchorA;\n\tm_groundAnchorB = def->groundAnchorB;\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\n\tm_lengthA = def->lengthA;\n\tm_lengthB = def->lengthB;\n\n\tb2Assert(def->ratio != 0.0f);\n\tm_ratio = def->ratio;\n\n\tm_constant = def->lengthA + m_ratio * def->lengthB;\n\n\tm_impulse = 0.0f;\n}\n\nvoid b2PulleyJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tm_rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tm_rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\t// Get the pulley axes.\n\tm_uA = cA + m_rA - m_groundAnchorA;\n\tm_uB = cB + m_rB - m_groundAnchorB;\n\n\tfloat32 lengthA = m_uA.Length();\n\tfloat32 lengthB = m_uB.Length();\n\n\tif (lengthA > 10.0f * b2_linearSlop)\n\t{\n\t\tm_uA *= 1.0f / lengthA;\n\t}\n\telse\n\t{\n\t\tm_uA.SetZero();\n\t}\n\n\tif (lengthB > 10.0f * b2_linearSlop)\n\t{\n\t\tm_uB *= 1.0f / lengthB;\n\t}\n\telse\n\t{\n\t\tm_uB.SetZero();\n\t}\n\n\t// Compute effective mass.\n\tfloat32 ruA = b2Cross(m_rA, m_uA);\n\tfloat32 ruB = b2Cross(m_rB, m_uB);\n\n\tfloat32 mA = m_invMassA + m_invIA * ruA * ruA;\n\tfloat32 mB = m_invMassB + m_invIB * ruB * ruB;\n\n\tm_mass = mA + m_ratio * m_ratio * mB;\n\n\tif (m_mass > 0.0f)\n\t{\n\t\tm_mass = 1.0f / m_mass;\n\t}\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Scale impulses to support variable time steps.\n\t\tm_impulse *= data.step.dtRatio;\n\n\t\t// Warm starting.\n\t\tb2Vec2 PA = -(m_impulse) * m_uA;\n\t\tb2Vec2 PB = (-m_ratio * m_impulse) * m_uB;\n\n\t\tvA += m_invMassA * PA;\n\t\twA += m_invIA * b2Cross(m_rA, PA);\n\t\tvB += m_invMassB * PB;\n\t\twB += m_invIB * b2Cross(m_rB, PB);\n\t}\n\telse\n\t{\n\t\tm_impulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2PulleyJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Vec2 vpA = vA + b2Cross(wA, m_rA);\n\tb2Vec2 vpB = vB + b2Cross(wB, m_rB);\n\n\tfloat32 Cdot = -b2Dot(m_uA, vpA) - m_ratio * b2Dot(m_uB, vpB);\n\tfloat32 impulse = -m_mass * Cdot;\n\tm_impulse += impulse;\n\n\tb2Vec2 PA = -impulse * m_uA;\n\tb2Vec2 PB = -m_ratio * impulse * m_uB;\n\tvA += m_invMassA * PA;\n\twA += m_invIA * b2Cross(m_rA, PA);\n\tvB += m_invMassB * PB;\n\twB += m_invIB * b2Cross(m_rB, PB);\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2PulleyJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\t// Get the pulley axes.\n\tb2Vec2 uA = cA + rA - m_groundAnchorA;\n\tb2Vec2 uB = cB + rB - m_groundAnchorB;\n\n\tfloat32 lengthA = uA.Length();\n\tfloat32 lengthB = uB.Length();\n\n\tif (lengthA > 10.0f * b2_linearSlop)\n\t{\n\t\tuA *= 1.0f / lengthA;\n\t}\n\telse\n\t{\n\t\tuA.SetZero();\n\t}\n\n\tif (lengthB > 10.0f * b2_linearSlop)\n\t{\n\t\tuB *= 1.0f / lengthB;\n\t}\n\telse\n\t{\n\t\tuB.SetZero();\n\t}\n\n\t// Compute effective mass.\n\tfloat32 ruA = b2Cross(rA, uA);\n\tfloat32 ruB = b2Cross(rB, uB);\n\n\tfloat32 mA = m_invMassA + m_invIA * ruA * ruA;\n\tfloat32 mB = m_invMassB + m_invIB * ruB * ruB;\n\n\tfloat32 mass = mA + m_ratio * m_ratio * mB;\n\n\tif (mass > 0.0f)\n\t{\n\t\tmass = 1.0f / mass;\n\t}\n\n\tfloat32 C = m_constant - lengthA - m_ratio * lengthB;\n\tfloat32 linearError = b2Abs(C);\n\n\tfloat32 impulse = -mass * C;\n\n\tb2Vec2 PA = -impulse * uA;\n\tb2Vec2 PB = -m_ratio * impulse * uB;\n\n\tcA += m_invMassA * PA;\n\taA += m_invIA * b2Cross(rA, PA);\n\tcB += m_invMassB * PB;\n\taB += m_invIB * b2Cross(rB, PB);\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\n\treturn linearError < b2_linearSlop;\n}\n\nb2Vec2 b2PulleyJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2PulleyJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2PulleyJoint::GetReactionForce(float32 inv_dt) const\n{\n\tb2Vec2 P = m_impulse * m_uB;\n\treturn inv_dt * P;\n}\n\nfloat32 b2PulleyJoint::GetReactionTorque(float32 inv_dt) const\n{\n\tB2_NOT_USED(inv_dt);\n\treturn 0.0f;\n}\n\nb2Vec2 b2PulleyJoint::GetGroundAnchorA() const\n{\n\treturn m_groundAnchorA;\n}\n\nb2Vec2 b2PulleyJoint::GetGroundAnchorB() const\n{\n\treturn m_groundAnchorB;\n}\n\nfloat32 b2PulleyJoint::GetLengthA() const\n{\n\treturn m_lengthA;\n}\n\nfloat32 b2PulleyJoint::GetLengthB() const\n{\n\treturn m_lengthB;\n}\n\nfloat32 b2PulleyJoint::GetRatio() const\n{\n\treturn m_ratio;\n}\n\nfloat32 b2PulleyJoint::GetCurrentLengthA() const\n{\n\tb2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA);\n\tb2Vec2 s = m_groundAnchorA;\n\tb2Vec2 d = p - s;\n\treturn d.Length();\n}\n\nfloat32 b2PulleyJoint::GetCurrentLengthB() const\n{\n\tb2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB);\n\tb2Vec2 s = m_groundAnchorB;\n\tb2Vec2 d = p - s;\n\treturn d.Length();\n}\n\nvoid b2PulleyJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2PulleyJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.groundAnchorA.Set(%.15lef, %.15lef);\\n\", m_groundAnchorA.x, m_groundAnchorA.y);\n\tb2Log(\"  jd.groundAnchorB.Set(%.15lef, %.15lef);\\n\", m_groundAnchorB.x, m_groundAnchorB.y);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.lengthA = %.15lef;\\n\", m_lengthA);\n\tb2Log(\"  jd.lengthB = %.15lef;\\n\", m_lengthB);\n\tb2Log(\"  jd.ratio = %.15lef;\\n\", m_ratio);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n\nvoid b2PulleyJoint::ShiftOrigin(const b2Vec2& newOrigin)\n{\n\tm_groundAnchorA -= newOrigin;\n\tm_groundAnchorB -= newOrigin;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2PulleyJoint.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_PULLEY_JOINT_H\n#define B2_PULLEY_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\nconst float32 b2_minPulleyLength = 2.0f;\n\n/// Pulley joint definition. This requires two ground anchors,\n/// two dynamic body anchor points, and a pulley ratio.\nstruct b2PulleyJointDef : public b2JointDef\n{\n\tb2PulleyJointDef()\n\t{\n\t\ttype = e_pulleyJoint;\n\t\tgroundAnchorA.Set(-1.0f, 1.0f);\n\t\tgroundAnchorB.Set(1.0f, 1.0f);\n\t\tlocalAnchorA.Set(-1.0f, 0.0f);\n\t\tlocalAnchorB.Set(1.0f, 0.0f);\n\t\tlengthA = 0.0f;\n\t\tlengthB = 0.0f;\n\t\tratio = 1.0f;\n\t\tcollideConnected = true;\n\t}\n\n\t/// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB,\n\t\t\t\t\tconst b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB,\n\t\t\t\t\tconst b2Vec2& anchorA, const b2Vec2& anchorB,\n\t\t\t\t\tfloat32 ratio);\n\n\t/// The first ground anchor in world coordinates. This point never moves.\n\tb2Vec2 groundAnchorA;\n\n\t/// The second ground anchor in world coordinates. This point never moves.\n\tb2Vec2 groundAnchorB;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The a reference length for the segment attached to bodyA.\n\tfloat32 lengthA;\n\n\t/// The a reference length for the segment attached to bodyB.\n\tfloat32 lengthB;\n\n\t/// The pulley ratio, used to simulate a block-and-tackle.\n\tfloat32 ratio;\n};\n\n/// The pulley joint is connected to two bodies and two fixed ground points.\n/// The pulley supports a ratio such that:\n/// length1 + ratio * length2 <= constant\n/// Yes, the force transmitted is scaled by the ratio.\n/// Warning: the pulley joint can get a bit squirrelly by itself. They often\n/// work better when combined with prismatic joints. You should also cover the\n/// the anchor points with static shapes to prevent one side from going to\n/// zero length.\nclass b2PulleyJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// Get the first ground anchor.\n\tb2Vec2 GetGroundAnchorA() const;\n\n\t/// Get the second ground anchor.\n\tb2Vec2 GetGroundAnchorB() const;\n\n\t/// Get the current length of the segment attached to bodyA.\n\tfloat32 GetLengthA() const;\n\n\t/// Get the current length of the segment attached to bodyB.\n\tfloat32 GetLengthB() const;\n\n\t/// Get the pulley ratio.\n\tfloat32 GetRatio() const;\n\n\t/// Get the current length of the segment attached to bodyA.\n\tfloat32 GetCurrentLengthA() const;\n\n\t/// Get the current length of the segment attached to bodyB.\n\tfloat32 GetCurrentLengthB() const;\n\n\t/// Dump joint to dmLog\n\tvoid Dump();\n\n\t/// Implement b2Joint::ShiftOrigin\n\tvoid ShiftOrigin(const b2Vec2& newOrigin);\n\nprotected:\n\n\tfriend class b2Joint;\n\tb2PulleyJoint(const b2PulleyJointDef* data);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\tb2Vec2 m_groundAnchorA;\n\tb2Vec2 m_groundAnchorB;\n\tfloat32 m_lengthA;\n\tfloat32 m_lengthB;\n\t\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tfloat32 m_constant;\n\tfloat32 m_ratio;\n\tfloat32 m_impulse;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_uA;\n\tb2Vec2 m_uB;\n\tb2Vec2 m_rA;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tfloat32 m_mass;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Point-to-point constraint\n// C = p2 - p1\n// Cdot = v2 - v1\n//      = v2 + cross(w2, r2) - v1 - cross(w1, r1)\n// J = [-I -r1_skew I r2_skew ]\n// Identity used:\n// w k % (rx i + ry j) = w * (-ry i + rx j)\n\n// Motor constraint\n// Cdot = w2 - w1\n// J = [0 0 -1 0 0 1]\n// K = invI1 + invI2\n\nvoid b2RevoluteJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor)\n{\n\tbodyA = bA;\n\tbodyB = bB;\n\tlocalAnchorA = bodyA->GetLocalPoint(anchor);\n\tlocalAnchorB = bodyB->GetLocalPoint(anchor);\n\treferenceAngle = bodyB->GetAngle() - bodyA->GetAngle();\n}\n\nb2RevoluteJoint::b2RevoluteJoint(const b2RevoluteJointDef* def)\n: b2Joint(def)\n{\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\tm_referenceAngle = def->referenceAngle;\n\n\tm_impulse.SetZero();\n\tm_motorImpulse = 0.0f;\n\n\tm_lowerAngle = def->lowerAngle;\n\tm_upperAngle = def->upperAngle;\n\tm_maxMotorTorque = def->maxMotorTorque;\n\tm_motorSpeed = def->motorSpeed;\n\tm_enableLimit = def->enableLimit;\n\tm_enableMotor = def->enableMotor;\n\tm_limitState = e_inactiveLimit;\n}\n\nvoid b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tm_rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tm_rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\t// J = [-I -r1_skew I r2_skew]\n\t//     [ 0       -1 0       1]\n\t// r_skew = [-ry; rx]\n\n\t// Matlab\n\t// K = [ mA+r1y^2*iA+mB+r2y^2*iB,  -r1y*iA*r1x-r2y*iB*r2x,          -r1y*iA-r2y*iB]\n\t//     [  -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB,           r1x*iA+r2x*iB]\n\t//     [          -r1y*iA-r2y*iB,           r1x*iA+r2x*iB,                   iA+iB]\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tbool fixedRotation = (iA + iB == 0.0f);\n\n\tm_mass.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB;\n\tm_mass.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB;\n\tm_mass.ez.x = -m_rA.y * iA - m_rB.y * iB;\n\tm_mass.ex.y = m_mass.ey.x;\n\tm_mass.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB;\n\tm_mass.ez.y = m_rA.x * iA + m_rB.x * iB;\n\tm_mass.ex.z = m_mass.ez.x;\n\tm_mass.ey.z = m_mass.ez.y;\n\tm_mass.ez.z = iA + iB;\n\n\tm_motorMass = iA + iB;\n\tif (m_motorMass > 0.0f)\n\t{\n\t\tm_motorMass = 1.0f / m_motorMass;\n\t}\n\n\tif (m_enableMotor == false || fixedRotation)\n\t{\n\t\tm_motorImpulse = 0.0f;\n\t}\n\n\tif (m_enableLimit && fixedRotation == false)\n\t{\n\t\tfloat32 jointAngle = aB - aA - m_referenceAngle;\n\t\tif (b2Abs(m_upperAngle - m_lowerAngle) < 2.0f * b2_angularSlop)\n\t\t{\n\t\t\tm_limitState = e_equalLimits;\n\t\t}\n\t\telse if (jointAngle <= m_lowerAngle)\n\t\t{\n\t\t\tif (m_limitState != e_atLowerLimit)\n\t\t\t{\n\t\t\t\tm_impulse.z = 0.0f;\n\t\t\t}\n\t\t\tm_limitState = e_atLowerLimit;\n\t\t}\n\t\telse if (jointAngle >= m_upperAngle)\n\t\t{\n\t\t\tif (m_limitState != e_atUpperLimit)\n\t\t\t{\n\t\t\t\tm_impulse.z = 0.0f;\n\t\t\t}\n\t\t\tm_limitState = e_atUpperLimit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_limitState = e_inactiveLimit;\n\t\t\tm_impulse.z = 0.0f;\n\t\t}\n\t}\n\telse\n\t{\n\t\tm_limitState = e_inactiveLimit;\n\t}\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Scale impulses to support a variable time step.\n\t\tm_impulse *= data.step.dtRatio;\n\t\tm_motorImpulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P(m_impulse.x, m_impulse.y);\n\n\t\tvA -= mA * P;\n\t\twA -= iA * (b2Cross(m_rA, P) + m_motorImpulse + m_impulse.z);\n\n\t\tvB += mB * P;\n\t\twB += iB * (b2Cross(m_rB, P) + m_motorImpulse + m_impulse.z);\n\t}\n\telse\n\t{\n\t\tm_impulse.SetZero();\n\t\tm_motorImpulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2RevoluteJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tbool fixedRotation = (iA + iB == 0.0f);\n\n\t// Solve motor constraint.\n\tif (m_enableMotor && m_limitState != e_equalLimits && fixedRotation == false)\n\t{\n\t\tfloat32 Cdot = wB - wA - m_motorSpeed;\n\t\tfloat32 impulse = -m_motorMass * Cdot;\n\t\tfloat32 oldImpulse = m_motorImpulse;\n\t\tfloat32 maxImpulse = data.step.dt * m_maxMotorTorque;\n\t\tm_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse);\n\t\timpulse = m_motorImpulse - oldImpulse;\n\n\t\twA -= iA * impulse;\n\t\twB += iB * impulse;\n\t}\n\n\t// Solve limit constraint.\n\tif (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false)\n\t{\n\t\tb2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA);\n\t\tfloat32 Cdot2 = wB - wA;\n\t\tb2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2);\n\n\t\tb2Vec3 impulse = -m_mass.Solve33(Cdot);\n\n\t\tif (m_limitState == e_equalLimits)\n\t\t{\n\t\t\tm_impulse += impulse;\n\t\t}\n\t\telse if (m_limitState == e_atLowerLimit)\n\t\t{\n\t\t\tfloat32 newImpulse = m_impulse.z + impulse.z;\n\t\t\tif (newImpulse < 0.0f)\n\t\t\t{\n\t\t\t\tb2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y);\n\t\t\t\tb2Vec2 reduced = m_mass.Solve22(rhs);\n\t\t\t\timpulse.x = reduced.x;\n\t\t\t\timpulse.y = reduced.y;\n\t\t\t\timpulse.z = -m_impulse.z;\n\t\t\t\tm_impulse.x += reduced.x;\n\t\t\t\tm_impulse.y += reduced.y;\n\t\t\t\tm_impulse.z = 0.0f;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_impulse += impulse;\n\t\t\t}\n\t\t}\n\t\telse if (m_limitState == e_atUpperLimit)\n\t\t{\n\t\t\tfloat32 newImpulse = m_impulse.z + impulse.z;\n\t\t\tif (newImpulse > 0.0f)\n\t\t\t{\n\t\t\t\tb2Vec2 rhs = -Cdot1 + m_impulse.z * b2Vec2(m_mass.ez.x, m_mass.ez.y);\n\t\t\t\tb2Vec2 reduced = m_mass.Solve22(rhs);\n\t\t\t\timpulse.x = reduced.x;\n\t\t\t\timpulse.y = reduced.y;\n\t\t\t\timpulse.z = -m_impulse.z;\n\t\t\t\tm_impulse.x += reduced.x;\n\t\t\t\tm_impulse.y += reduced.y;\n\t\t\t\tm_impulse.z = 0.0f;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tm_impulse += impulse;\n\t\t\t}\n\t\t}\n\n\t\tb2Vec2 P(impulse.x, impulse.y);\n\n\t\tvA -= mA * P;\n\t\twA -= iA * (b2Cross(m_rA, P) + impulse.z);\n\n\t\tvB += mB * P;\n\t\twB += iB * (b2Cross(m_rB, P) + impulse.z);\n\t}\n\telse\n\t{\n\t\t// Solve point-to-point constraint\n\t\tb2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA);\n\t\tb2Vec2 impulse = m_mass.Solve22(-Cdot);\n\n\t\tm_impulse.x += impulse.x;\n\t\tm_impulse.y += impulse.y;\n\n\t\tvA -= mA * impulse;\n\t\twA -= iA * b2Cross(m_rA, impulse);\n\n\t\tvB += mB * impulse;\n\t\twB += iB * b2Cross(m_rB, impulse);\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tfloat32 angularError = 0.0f;\n\tfloat32 positionError = 0.0f;\n\n\tbool fixedRotation = (m_invIA + m_invIB == 0.0f);\n\n\t// Solve angular limit constraint.\n\tif (m_enableLimit && m_limitState != e_inactiveLimit && fixedRotation == false)\n\t{\n\t\tfloat32 angle = aB - aA - m_referenceAngle;\n\t\tfloat32 limitImpulse = 0.0f;\n\n\t\tif (m_limitState == e_equalLimits)\n\t\t{\n\t\t\t// Prevent large angular corrections\n\t\t\tfloat32 C = b2Clamp(angle - m_lowerAngle, -b2_maxAngularCorrection, b2_maxAngularCorrection);\n\t\t\tlimitImpulse = -m_motorMass * C;\n\t\t\tangularError = b2Abs(C);\n\t\t}\n\t\telse if (m_limitState == e_atLowerLimit)\n\t\t{\n\t\t\tfloat32 C = angle - m_lowerAngle;\n\t\t\tangularError = -C;\n\n\t\t\t// Prevent large angular corrections and allow some slop.\n\t\t\tC = b2Clamp(C + b2_angularSlop, -b2_maxAngularCorrection, 0.0f);\n\t\t\tlimitImpulse = -m_motorMass * C;\n\t\t}\n\t\telse if (m_limitState == e_atUpperLimit)\n\t\t{\n\t\t\tfloat32 C = angle - m_upperAngle;\n\t\t\tangularError = C;\n\n\t\t\t// Prevent large angular corrections and allow some slop.\n\t\t\tC = b2Clamp(C - b2_angularSlop, 0.0f, b2_maxAngularCorrection);\n\t\t\tlimitImpulse = -m_motorMass * C;\n\t\t}\n\n\t\taA -= m_invIA * limitImpulse;\n\t\taB += m_invIB * limitImpulse;\n\t}\n\n\t// Solve point-to-point constraint.\n\t{\n\t\tqA.Set(aA);\n\t\tqB.Set(aB);\n\t\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\t\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\t\tb2Vec2 C = cB + rB - cA - rA;\n\t\tpositionError = C.Length();\n\n\t\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\t\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\t\tb2Mat22 K;\n\t\tK.ex.x = mA + mB + iA * rA.y * rA.y + iB * rB.y * rB.y;\n\t\tK.ex.y = -iA * rA.x * rA.y - iB * rB.x * rB.y;\n\t\tK.ey.x = K.ex.y;\n\t\tK.ey.y = mA + mB + iA * rA.x * rA.x + iB * rB.x * rB.x;\n\n\t\tb2Vec2 impulse = -K.Solve(C);\n\n\t\tcA -= mA * impulse;\n\t\taA -= iA * b2Cross(rA, impulse);\n\n\t\tcB += mB * impulse;\n\t\taB += iB * b2Cross(rB, impulse);\n\t}\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\t\n\treturn positionError <= b2_linearSlop && angularError <= b2_angularSlop;\n}\n\nb2Vec2 b2RevoluteJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2RevoluteJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2RevoluteJoint::GetReactionForce(float32 inv_dt) const\n{\n\tb2Vec2 P(m_impulse.x, m_impulse.y);\n\treturn inv_dt * P;\n}\n\nfloat32 b2RevoluteJoint::GetReactionTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_impulse.z;\n}\n\nfloat32 b2RevoluteJoint::GetJointAngle() const\n{\n\tb2Body* bA = m_bodyA;\n\tb2Body* bB = m_bodyB;\n\treturn bB->m_sweep.a - bA->m_sweep.a - m_referenceAngle;\n}\n\nfloat32 b2RevoluteJoint::GetJointSpeed() const\n{\n\tb2Body* bA = m_bodyA;\n\tb2Body* bB = m_bodyB;\n\treturn bB->m_angularVelocity - bA->m_angularVelocity;\n}\n\nbool b2RevoluteJoint::IsMotorEnabled() const\n{\n\treturn m_enableMotor;\n}\n\nvoid b2RevoluteJoint::EnableMotor(bool flag)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_enableMotor = flag;\n}\n\nfloat32 b2RevoluteJoint::GetMotorTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_motorImpulse;\n}\n\nvoid b2RevoluteJoint::SetMotorSpeed(float32 speed)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_motorSpeed = speed;\n}\n\nvoid b2RevoluteJoint::SetMaxMotorTorque(float32 torque)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_maxMotorTorque = torque;\n}\n\nbool b2RevoluteJoint::IsLimitEnabled() const\n{\n\treturn m_enableLimit;\n}\n\nvoid b2RevoluteJoint::EnableLimit(bool flag)\n{\n\tif (flag != m_enableLimit)\n\t{\n\t\tm_bodyA->SetAwake(true);\n\t\tm_bodyB->SetAwake(true);\n\t\tm_enableLimit = flag;\n\t\tm_impulse.z = 0.0f;\n\t}\n}\n\nfloat32 b2RevoluteJoint::GetLowerLimit() const\n{\n\treturn m_lowerAngle;\n}\n\nfloat32 b2RevoluteJoint::GetUpperLimit() const\n{\n\treturn m_upperAngle;\n}\n\nvoid b2RevoluteJoint::SetLimits(float32 lower, float32 upper)\n{\n\tb2Assert(lower <= upper);\n\t\n\tif (lower != m_lowerAngle || upper != m_upperAngle)\n\t{\n\t\tm_bodyA->SetAwake(true);\n\t\tm_bodyB->SetAwake(true);\n\t\tm_impulse.z = 0.0f;\n\t\tm_lowerAngle = lower;\n\t\tm_upperAngle = upper;\n\t}\n}\n\nvoid b2RevoluteJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2RevoluteJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.referenceAngle = %.15lef;\\n\", m_referenceAngle);\n\tb2Log(\"  jd.enableLimit = bool(%d);\\n\", m_enableLimit);\n\tb2Log(\"  jd.lowerAngle = %.15lef;\\n\", m_lowerAngle);\n\tb2Log(\"  jd.upperAngle = %.15lef;\\n\", m_upperAngle);\n\tb2Log(\"  jd.enableMotor = bool(%d);\\n\", m_enableMotor);\n\tb2Log(\"  jd.motorSpeed = %.15lef;\\n\", m_motorSpeed);\n\tb2Log(\"  jd.maxMotorTorque = %.15lef;\\n\", m_maxMotorTorque);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2RevoluteJoint.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_REVOLUTE_JOINT_H\n#define B2_REVOLUTE_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Revolute joint definition. This requires defining an\n/// anchor point where the bodies are joined. The definition\n/// uses local anchor points so that the initial configuration\n/// can violate the constraint slightly. You also need to\n/// specify the initial relative angle for joint limits. This\n/// helps when saving and loading a game.\n/// The local anchor points are measured from the body's origin\n/// rather than the center of mass because:\n/// 1. you might not know where the center of mass will be.\n/// 2. if you add/remove shapes from a body and recompute the mass,\n///    the joints will be broken.\nstruct b2RevoluteJointDef : public b2JointDef\n{\n\tb2RevoluteJointDef()\n\t{\n\t\ttype = e_revoluteJoint;\n\t\tlocalAnchorA.Set(0.0f, 0.0f);\n\t\tlocalAnchorB.Set(0.0f, 0.0f);\n\t\treferenceAngle = 0.0f;\n\t\tlowerAngle = 0.0f;\n\t\tupperAngle = 0.0f;\n\t\tmaxMotorTorque = 0.0f;\n\t\tmotorSpeed = 0.0f;\n\t\tenableLimit = false;\n\t\tenableMotor = false;\n\t}\n\n\t/// Initialize the bodies, anchors, and reference angle using a world\n\t/// anchor point.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor);\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The bodyB angle minus bodyA angle in the reference state (radians).\n\tfloat32 referenceAngle;\n\n\t/// A flag to enable joint limits.\n\tbool enableLimit;\n\n\t/// The lower angle for the joint limit (radians).\n\tfloat32 lowerAngle;\n\n\t/// The upper angle for the joint limit (radians).\n\tfloat32 upperAngle;\n\n\t/// A flag to enable the joint motor.\n\tbool enableMotor;\n\n\t/// The desired motor speed. Usually in radians per second.\n\tfloat32 motorSpeed;\n\n\t/// The maximum motor torque used to achieve the desired motor speed.\n\t/// Usually in N-m.\n\tfloat32 maxMotorTorque;\n};\n\n/// A revolute joint constrains two bodies to share a common point while they\n/// are free to rotate about the point. The relative rotation about the shared\n/// point is the joint angle. You can limit the relative rotation with\n/// a joint limit that specifies a lower and upper angle. You can use a motor\n/// to drive the relative rotation about the shared point. A maximum motor torque\n/// is provided so that infinite forces are not generated.\nclass b2RevoluteJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tconst b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; }\n\n\t/// The local anchor point relative to bodyB's origin.\n\tconst b2Vec2& GetLocalAnchorB() const  { return m_localAnchorB; }\n\n\t/// Get the reference angle.\n\tfloat32 GetReferenceAngle() const { return m_referenceAngle; }\n\n\t/// Get the current joint angle in radians.\n\tfloat32 GetJointAngle() const;\n\n\t/// Get the current joint angle speed in radians per second.\n\tfloat32 GetJointSpeed() const;\n\n\t/// Is the joint limit enabled?\n\tbool IsLimitEnabled() const;\n\n\t/// Enable/disable the joint limit.\n\tvoid EnableLimit(bool flag);\n\n\t/// Get the lower joint limit in radians.\n\tfloat32 GetLowerLimit() const;\n\n\t/// Get the upper joint limit in radians.\n\tfloat32 GetUpperLimit() const;\n\n\t/// Set the joint limits in radians.\n\tvoid SetLimits(float32 lower, float32 upper);\n\n\t/// Is the joint motor enabled?\n\tbool IsMotorEnabled() const;\n\n\t/// Enable/disable the joint motor.\n\tvoid EnableMotor(bool flag);\n\n\t/// Set the motor speed in radians per second.\n\tvoid SetMotorSpeed(float32 speed);\n\n\t/// Get the motor speed in radians per second.\n\tfloat32 GetMotorSpeed() const;\n\n\t/// Set the maximum motor torque, usually in N-m.\n\tvoid SetMaxMotorTorque(float32 torque);\n\tfloat32 GetMaxMotorTorque() const { return m_maxMotorTorque; }\n\n\t/// Get the reaction force given the inverse time step.\n\t/// Unit is N.\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\n\t/// Get the reaction torque due to the joint limit given the inverse time step.\n\t/// Unit is N*m.\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// Get the current motor torque given the inverse time step.\n\t/// Unit is N*m.\n\tfloat32 GetMotorTorque(float32 inv_dt) const;\n\n\t/// Dump to b2Log.\n\tvoid Dump();\n\nprotected:\n\t\n\tfriend class b2Joint;\n\tfriend class b2GearJoint;\n\n\tb2RevoluteJoint(const b2RevoluteJointDef* def);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tb2Vec3 m_impulse;\n\tfloat32 m_motorImpulse;\n\n\tbool m_enableMotor;\n\tfloat32 m_maxMotorTorque;\n\tfloat32 m_motorSpeed;\n\n\tbool m_enableLimit;\n\tfloat32 m_referenceAngle;\n\tfloat32 m_lowerAngle;\n\tfloat32 m_upperAngle;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_rA;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tb2Mat33 m_mass;\t\t\t// effective mass for point-to-point constraint.\n\tfloat32 m_motorMass;\t// effective mass for motor/limit angular constraint.\n\tb2LimitState m_limitState;\n};\n\ninline float32 b2RevoluteJoint::GetMotorSpeed() const\n{\n\treturn m_motorSpeed;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2RopeJoint.cpp",
    "content": "/*\n* Copyright (c) 2007-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2RopeJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n\n// Limit:\n// C = norm(pB - pA) - L\n// u = (pB - pA) / norm(pB - pA)\n// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA))\n// J = [-u -cross(rA, u) u cross(rB, u)]\n// K = J * invM * JT\n//   = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2\n\nb2RopeJoint::b2RopeJoint(const b2RopeJointDef* def)\n: b2Joint(def)\n{\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\n\tm_maxLength = def->maxLength;\n\n\tm_mass = 0.0f;\n\tm_impulse = 0.0f;\n\tm_state = e_inactiveLimit;\n\tm_length = 0.0f;\n}\n\nvoid b2RopeJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tm_rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tm_rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tm_u = cB + m_rB - cA - m_rA;\n\n\tm_length = m_u.Length();\n\n\tfloat32 C = m_length - m_maxLength;\n\tif (C > 0.0f)\n\t{\n\t\tm_state = e_atUpperLimit;\n\t}\n\telse\n\t{\n\t\tm_state = e_inactiveLimit;\n\t}\n\n\tif (m_length > b2_linearSlop)\n\t{\n\t\tm_u *= 1.0f / m_length;\n\t}\n\telse\n\t{\n\t\tm_u.SetZero();\n\t\tm_mass = 0.0f;\n\t\tm_impulse = 0.0f;\n\t\treturn;\n\t}\n\n\t// Compute effective mass.\n\tfloat32 crA = b2Cross(m_rA, m_u);\n\tfloat32 crB = b2Cross(m_rB, m_u);\n\tfloat32 invMass = m_invMassA + m_invIA * crA * crA + m_invMassB + m_invIB * crB * crB;\n\n\tm_mass = invMass != 0.0f ? 1.0f / invMass : 0.0f;\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Scale the impulse to support a variable time step.\n\t\tm_impulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P = m_impulse * m_u;\n\t\tvA -= m_invMassA * P;\n\t\twA -= m_invIA * b2Cross(m_rA, P);\n\t\tvB += m_invMassB * P;\n\t\twB += m_invIB * b2Cross(m_rB, P);\n\t}\n\telse\n\t{\n\t\tm_impulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2RopeJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\t// Cdot = dot(u, v + cross(w, r))\n\tb2Vec2 vpA = vA + b2Cross(wA, m_rA);\n\tb2Vec2 vpB = vB + b2Cross(wB, m_rB);\n\tfloat32 C = m_length - m_maxLength;\n\tfloat32 Cdot = b2Dot(m_u, vpB - vpA);\n\n\t// Predictive constraint.\n\tif (C < 0.0f)\n\t{\n\t\tCdot += data.step.inv_dt * C;\n\t}\n\n\tfloat32 impulse = -m_mass * Cdot;\n\tfloat32 oldImpulse = m_impulse;\n\tm_impulse = b2Min(0.0f, m_impulse + impulse);\n\timpulse = m_impulse - oldImpulse;\n\n\tb2Vec2 P = impulse * m_u;\n\tvA -= m_invMassA * P;\n\twA -= m_invIA * b2Cross(m_rA, P);\n\tvB += m_invMassB * P;\n\twB += m_invIB * b2Cross(m_rB, P);\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2RopeJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tb2Vec2 u = cB + rB - cA - rA;\n\n\tfloat32 length = u.Normalize();\n\tfloat32 C = length - m_maxLength;\n\n\tC = b2Clamp(C, 0.0f, b2_maxLinearCorrection);\n\n\tfloat32 impulse = -m_mass * C;\n\tb2Vec2 P = impulse * u;\n\n\tcA -= m_invMassA * P;\n\taA -= m_invIA * b2Cross(rA, P);\n\tcB += m_invMassB * P;\n\taB += m_invIB * b2Cross(rB, P);\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\n\treturn length - m_maxLength < b2_linearSlop;\n}\n\nb2Vec2 b2RopeJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2RopeJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2RopeJoint::GetReactionForce(float32 inv_dt) const\n{\n\tb2Vec2 F = (inv_dt * m_impulse) * m_u;\n\treturn F;\n}\n\nfloat32 b2RopeJoint::GetReactionTorque(float32 inv_dt) const\n{\n\tB2_NOT_USED(inv_dt);\n\treturn 0.0f;\n}\n\nfloat32 b2RopeJoint::GetMaxLength() const\n{\n\treturn m_maxLength;\n}\n\nb2LimitState b2RopeJoint::GetLimitState() const\n{\n\treturn m_state;\n}\n\nvoid b2RopeJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2RopeJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.maxLength = %.15lef;\\n\", m_maxLength);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2RopeJoint.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_ROPE_JOINT_H\n#define B2_ROPE_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Rope joint definition. This requires two body anchor points and\n/// a maximum lengths.\n/// Note: by default the connected objects will not collide.\n/// see collideConnected in b2JointDef.\nstruct b2RopeJointDef : public b2JointDef\n{\n\tb2RopeJointDef()\n\t{\n\t\ttype = e_ropeJoint;\n\t\tlocalAnchorA.Set(-1.0f, 0.0f);\n\t\tlocalAnchorB.Set(1.0f, 0.0f);\n\t\tmaxLength = 0.0f;\n\t}\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The maximum length of the rope.\n\t/// Warning: this must be larger than b2_linearSlop or\n\t/// the joint will have no effect.\n\tfloat32 maxLength;\n};\n\n/// A rope joint enforces a maximum distance between two points\n/// on two bodies. It has no other effect.\n/// Warning: if you attempt to change the maximum length during\n/// the simulation you will get some non-physical behavior.\n/// A model that would allow you to dynamically modify the length\n/// would have some sponginess, so I chose not to implement it\n/// that way. See b2DistanceJoint if you want to dynamically\n/// control length.\nclass b2RopeJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tconst b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; }\n\n\t/// The local anchor point relative to bodyB's origin.\n\tconst b2Vec2& GetLocalAnchorB() const  { return m_localAnchorB; }\n\n\t/// Set/Get the maximum length of the rope.\n\tvoid SetMaxLength(float32 length) { m_maxLength = length; }\n\tfloat32 GetMaxLength() const;\n\n\tb2LimitState GetLimitState() const;\n\n\t/// Dump joint to dmLog\n\tvoid Dump();\n\nprotected:\n\n\tfriend class b2Joint;\n\tb2RopeJoint(const b2RopeJointDef* data);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tfloat32 m_maxLength;\n\tfloat32 m_length;\n\tfloat32 m_impulse;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_u;\n\tb2Vec2 m_rA;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tfloat32 m_mass;\n\tb2LimitState m_state;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2WeldJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2WeldJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Point-to-point constraint\n// C = p2 - p1\n// Cdot = v2 - v1\n//      = v2 + cross(w2, r2) - v1 - cross(w1, r1)\n// J = [-I -r1_skew I r2_skew ]\n// Identity used:\n// w k % (rx i + ry j) = w * (-ry i + rx j)\n\n// Angle constraint\n// C = angle2 - angle1 - referenceAngle\n// Cdot = w2 - w1\n// J = [0 0 -1 0 0 1]\n// K = invI1 + invI2\n\nvoid b2WeldJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor)\n{\n\tbodyA = bA;\n\tbodyB = bB;\n\tlocalAnchorA = bodyA->GetLocalPoint(anchor);\n\tlocalAnchorB = bodyB->GetLocalPoint(anchor);\n\treferenceAngle = bodyB->GetAngle() - bodyA->GetAngle();\n}\n\nb2WeldJoint::b2WeldJoint(const b2WeldJointDef* def)\n: b2Joint(def)\n{\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\tm_referenceAngle = def->referenceAngle;\n\tm_frequencyHz = def->frequencyHz;\n\tm_dampingRatio = def->dampingRatio;\n\n\tm_impulse.SetZero();\n}\n\nvoid b2WeldJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tm_rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tm_rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\t// J = [-I -r1_skew I r2_skew]\n\t//     [ 0       -1 0       1]\n\t// r_skew = [-ry; rx]\n\n\t// Matlab\n\t// K = [ mA+r1y^2*iA+mB+r2y^2*iB,  -r1y*iA*r1x-r2y*iB*r2x,          -r1y*iA-r2y*iB]\n\t//     [  -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB,           r1x*iA+r2x*iB]\n\t//     [          -r1y*iA-r2y*iB,           r1x*iA+r2x*iB,                   iA+iB]\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tb2Mat33 K;\n\tK.ex.x = mA + mB + m_rA.y * m_rA.y * iA + m_rB.y * m_rB.y * iB;\n\tK.ey.x = -m_rA.y * m_rA.x * iA - m_rB.y * m_rB.x * iB;\n\tK.ez.x = -m_rA.y * iA - m_rB.y * iB;\n\tK.ex.y = K.ey.x;\n\tK.ey.y = mA + mB + m_rA.x * m_rA.x * iA + m_rB.x * m_rB.x * iB;\n\tK.ez.y = m_rA.x * iA + m_rB.x * iB;\n\tK.ex.z = K.ez.x;\n\tK.ey.z = K.ez.y;\n\tK.ez.z = iA + iB;\n\n\tif (m_frequencyHz > 0.0f)\n\t{\n\t\tK.GetInverse22(&m_mass);\n\n\t\tfloat32 invM = iA + iB;\n\t\tfloat32 m = invM > 0.0f ? 1.0f / invM : 0.0f;\n\n\t\tfloat32 C = aB - aA - m_referenceAngle;\n\n\t\t// Frequency\n\t\tfloat32 omega = 2.0f * b2_pi * m_frequencyHz;\n\n\t\t// Damping coefficient\n\t\tfloat32 d = 2.0f * m * m_dampingRatio * omega;\n\n\t\t// Spring stiffness\n\t\tfloat32 k = m * omega * omega;\n\n\t\t// magic formulas\n\t\tfloat32 h = data.step.dt;\n\t\tm_gamma = h * (d + h * k);\n\t\tm_gamma = m_gamma != 0.0f ? 1.0f / m_gamma : 0.0f;\n\t\tm_bias = C * h * k * m_gamma;\n\n\t\tinvM += m_gamma;\n\t\tm_mass.ez.z = invM != 0.0f ? 1.0f / invM : 0.0f;\n\t}\n\telse\n\t{\n\t\tK.GetSymInverse33(&m_mass);\n\t\tm_gamma = 0.0f;\n\t\tm_bias = 0.0f;\n\t}\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Scale impulses to support a variable time step.\n\t\tm_impulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P(m_impulse.x, m_impulse.y);\n\n\t\tvA -= mA * P;\n\t\twA -= iA * (b2Cross(m_rA, P) + m_impulse.z);\n\n\t\tvB += mB * P;\n\t\twB += iB * (b2Cross(m_rB, P) + m_impulse.z);\n\t}\n\telse\n\t{\n\t\tm_impulse.SetZero();\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2WeldJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tif (m_frequencyHz > 0.0f)\n\t{\n\t\tfloat32 Cdot2 = wB - wA;\n\n\t\tfloat32 impulse2 = -m_mass.ez.z * (Cdot2 + m_bias + m_gamma * m_impulse.z);\n\t\tm_impulse.z += impulse2;\n\n\t\twA -= iA * impulse2;\n\t\twB += iB * impulse2;\n\n\t\tb2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA);\n\n\t\tb2Vec2 impulse1 = -b2Mul22(m_mass, Cdot1);\n\t\tm_impulse.x += impulse1.x;\n\t\tm_impulse.y += impulse1.y;\n\n\t\tb2Vec2 P = impulse1;\n\n\t\tvA -= mA * P;\n\t\twA -= iA * b2Cross(m_rA, P);\n\n\t\tvB += mB * P;\n\t\twB += iB * b2Cross(m_rB, P);\n\t}\n\telse\n\t{\n\t\tb2Vec2 Cdot1 = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA);\n\t\tfloat32 Cdot2 = wB - wA;\n\t\tb2Vec3 Cdot(Cdot1.x, Cdot1.y, Cdot2);\n\n\t\tb2Vec3 impulse = -b2Mul(m_mass, Cdot);\n\t\tm_impulse += impulse;\n\n\t\tb2Vec2 P(impulse.x, impulse.y);\n\n\t\tvA -= mA * P;\n\t\twA -= iA * (b2Cross(m_rA, P) + impulse.z);\n\n\t\tvB += mB * P;\n\t\twB += iB * (b2Cross(m_rB, P) + impulse.z);\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\n\tfloat32 positionError, angularError;\n\n\tb2Mat33 K;\n\tK.ex.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB;\n\tK.ey.x = -rA.y * rA.x * iA - rB.y * rB.x * iB;\n\tK.ez.x = -rA.y * iA - rB.y * iB;\n\tK.ex.y = K.ey.x;\n\tK.ey.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB;\n\tK.ez.y = rA.x * iA + rB.x * iB;\n\tK.ex.z = K.ez.x;\n\tK.ey.z = K.ez.y;\n\tK.ez.z = iA + iB;\n\n\tif (m_frequencyHz > 0.0f)\n\t{\n\t\tb2Vec2 C1 =  cB + rB - cA - rA;\n\n\t\tpositionError = C1.Length();\n\t\tangularError = 0.0f;\n\n\t\tb2Vec2 P = -K.Solve22(C1);\n\n\t\tcA -= mA * P;\n\t\taA -= iA * b2Cross(rA, P);\n\n\t\tcB += mB * P;\n\t\taB += iB * b2Cross(rB, P);\n\t}\n\telse\n\t{\n\t\tb2Vec2 C1 =  cB + rB - cA - rA;\n\t\tfloat32 C2 = aB - aA - m_referenceAngle;\n\n\t\tpositionError = C1.Length();\n\t\tangularError = b2Abs(C2);\n\n\t\tb2Vec3 C(C1.x, C1.y, C2);\n\t\n\t\tb2Vec3 impulse = -K.Solve33(C);\n\t\tb2Vec2 P(impulse.x, impulse.y);\n\n\t\tcA -= mA * P;\n\t\taA -= iA * (b2Cross(rA, P) + impulse.z);\n\n\t\tcB += mB * P;\n\t\taB += iB * (b2Cross(rB, P) + impulse.z);\n\t}\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\n\treturn positionError <= b2_linearSlop && angularError <= b2_angularSlop;\n}\n\nb2Vec2 b2WeldJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2WeldJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2WeldJoint::GetReactionForce(float32 inv_dt) const\n{\n\tb2Vec2 P(m_impulse.x, m_impulse.y);\n\treturn inv_dt * P;\n}\n\nfloat32 b2WeldJoint::GetReactionTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_impulse.z;\n}\n\nvoid b2WeldJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2WeldJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.referenceAngle = %.15lef;\\n\", m_referenceAngle);\n\tb2Log(\"  jd.frequencyHz = %.15lef;\\n\", m_frequencyHz);\n\tb2Log(\"  jd.dampingRatio = %.15lef;\\n\", m_dampingRatio);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2WeldJoint.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_WELD_JOINT_H\n#define B2_WELD_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Weld joint definition. You need to specify local anchor points\n/// where they are attached and the relative body angle. The position\n/// of the anchor points is important for computing the reaction torque.\nstruct b2WeldJointDef : public b2JointDef\n{\n\tb2WeldJointDef()\n\t{\n\t\ttype = e_weldJoint;\n\t\tlocalAnchorA.Set(0.0f, 0.0f);\n\t\tlocalAnchorB.Set(0.0f, 0.0f);\n\t\treferenceAngle = 0.0f;\n\t\tfrequencyHz = 0.0f;\n\t\tdampingRatio = 0.0f;\n\t}\n\n\t/// Initialize the bodies, anchors, and reference angle using a world\n\t/// anchor point.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor);\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The bodyB angle minus bodyA angle in the reference state (radians).\n\tfloat32 referenceAngle;\n\t\n\t/// The mass-spring-damper frequency in Hertz. Rotation only.\n\t/// Disable softness with a value of 0.\n\tfloat32 frequencyHz;\n\n\t/// The damping ratio. 0 = no damping, 1 = critical damping.\n\tfloat32 dampingRatio;\n};\n\n/// A weld joint essentially glues two bodies together. A weld joint may\n/// distort somewhat because the island constraint solver is approximate.\nclass b2WeldJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tconst b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; }\n\n\t/// The local anchor point relative to bodyB's origin.\n\tconst b2Vec2& GetLocalAnchorB() const  { return m_localAnchorB; }\n\n\t/// Get the reference angle.\n\tfloat32 GetReferenceAngle() const { return m_referenceAngle; }\n\n\t/// Set/get frequency in Hz.\n\tvoid SetFrequency(float32 hz) { m_frequencyHz = hz; }\n\tfloat32 GetFrequency() const { return m_frequencyHz; }\n\n\t/// Set/get damping ratio.\n\tvoid SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; }\n\tfloat32 GetDampingRatio() const { return m_dampingRatio; }\n\n\t/// Dump to b2Log\n\tvoid Dump();\n\nprotected:\n\n\tfriend class b2Joint;\n\n\tb2WeldJoint(const b2WeldJointDef* def);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\tfloat32 m_frequencyHz;\n\tfloat32 m_dampingRatio;\n\tfloat32 m_bias;\n\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tfloat32 m_referenceAngle;\n\tfloat32 m_gamma;\n\tb2Vec3 m_impulse;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_rA;\n\tb2Vec2 m_rB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\tb2Mat33 m_mass;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2WheelJoint.cpp",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/Joints/b2WheelJoint.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\n// Linear constraint (point-to-line)\n// d = pB - pA = xB + rB - xA - rA\n// C = dot(ay, d)\n// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA))\n//      = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB)\n// J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)]\n\n// Spring linear constraint\n// C = dot(ax, d)\n// Cdot = = -dot(ax, vA) - dot(cross(d + rA, ax), wA) + dot(ax, vB) + dot(cross(rB, ax), vB)\n// J = [-ax -cross(d+rA, ax) ax cross(rB, ax)]\n\n// Motor rotational constraint\n// Cdot = wB - wA\n// J = [0 0 -1 0 0 1]\n\nvoid b2WheelJointDef::Initialize(b2Body* bA, b2Body* bB, const b2Vec2& anchor, const b2Vec2& axis)\n{\n\tbodyA = bA;\n\tbodyB = bB;\n\tlocalAnchorA = bodyA->GetLocalPoint(anchor);\n\tlocalAnchorB = bodyB->GetLocalPoint(anchor);\n\tlocalAxisA = bodyA->GetLocalVector(axis);\n}\n\nb2WheelJoint::b2WheelJoint(const b2WheelJointDef* def)\n: b2Joint(def)\n{\n\tm_localAnchorA = def->localAnchorA;\n\tm_localAnchorB = def->localAnchorB;\n\tm_localXAxisA = def->localAxisA;\n\tm_localYAxisA = b2Cross(1.0f, m_localXAxisA);\n\n\tm_mass = 0.0f;\n\tm_impulse = 0.0f;\n\tm_motorMass = 0.0f;\n\tm_motorImpulse = 0.0f;\n\tm_springMass = 0.0f;\n\tm_springImpulse = 0.0f;\n\n\tm_maxMotorTorque = def->maxMotorTorque;\n\tm_motorSpeed = def->motorSpeed;\n\tm_enableMotor = def->enableMotor;\n\n\tm_frequencyHz = def->frequencyHz;\n\tm_dampingRatio = def->dampingRatio;\n\n\tm_bias = 0.0f;\n\tm_gamma = 0.0f;\n\n\tm_ax.SetZero();\n\tm_ay.SetZero();\n}\n\nvoid b2WheelJoint::InitVelocityConstraints(const b2SolverData& data)\n{\n\tm_indexA = m_bodyA->m_islandIndex;\n\tm_indexB = m_bodyB->m_islandIndex;\n\tm_localCenterA = m_bodyA->m_sweep.localCenter;\n\tm_localCenterB = m_bodyB->m_sweep.localCenter;\n\tm_invMassA = m_bodyA->m_invMass;\n\tm_invMassB = m_bodyB->m_invMass;\n\tm_invIA = m_bodyA->m_invI;\n\tm_invIB = m_bodyB->m_invI;\n\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\tb2Rot qA(aA), qB(aB);\n\n\t// Compute the effective masses.\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tb2Vec2 d = cB + rB - cA - rA;\n\n\t// Point to line constraint\n\t{\n\t\tm_ay = b2Mul(qA, m_localYAxisA);\n\t\tm_sAy = b2Cross(d + rA, m_ay);\n\t\tm_sBy = b2Cross(rB, m_ay);\n\n\t\tm_mass = mA + mB + iA * m_sAy * m_sAy + iB * m_sBy * m_sBy;\n\n\t\tif (m_mass > 0.0f)\n\t\t{\n\t\t\tm_mass = 1.0f / m_mass;\n\t\t}\n\t}\n\n\t// Spring constraint\n\tm_springMass = 0.0f;\n\tm_bias = 0.0f;\n\tm_gamma = 0.0f;\n\tif (m_frequencyHz > 0.0f)\n\t{\n\t\tm_ax = b2Mul(qA, m_localXAxisA);\n\t\tm_sAx = b2Cross(d + rA, m_ax);\n\t\tm_sBx = b2Cross(rB, m_ax);\n\n\t\tfloat32 invMass = mA + mB + iA * m_sAx * m_sAx + iB * m_sBx * m_sBx;\n\n\t\tif (invMass > 0.0f)\n\t\t{\n\t\t\tm_springMass = 1.0f / invMass;\n\n\t\t\tfloat32 C = b2Dot(d, m_ax);\n\n\t\t\t// Frequency\n\t\t\tfloat32 omega = 2.0f * b2_pi * m_frequencyHz;\n\n\t\t\t// Damping coefficient\n\t\t\tfloat32 d = 2.0f * m_springMass * m_dampingRatio * omega;\n\n\t\t\t// Spring stiffness\n\t\t\tfloat32 k = m_springMass * omega * omega;\n\n\t\t\t// magic formulas\n\t\t\tfloat32 h = data.step.dt;\n\t\t\tm_gamma = h * (d + h * k);\n\t\t\tif (m_gamma > 0.0f)\n\t\t\t{\n\t\t\t\tm_gamma = 1.0f / m_gamma;\n\t\t\t}\n\n\t\t\tm_bias = C * h * k * m_gamma;\n\n\t\t\tm_springMass = invMass + m_gamma;\n\t\t\tif (m_springMass > 0.0f)\n\t\t\t{\n\t\t\t\tm_springMass = 1.0f / m_springMass;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tm_springImpulse = 0.0f;\n\t}\n\n\t// Rotational motor\n\tif (m_enableMotor)\n\t{\n\t\tm_motorMass = iA + iB;\n\t\tif (m_motorMass > 0.0f)\n\t\t{\n\t\t\tm_motorMass = 1.0f / m_motorMass;\n\t\t}\n\t}\n\telse\n\t{\n\t\tm_motorMass = 0.0f;\n\t\tm_motorImpulse = 0.0f;\n\t}\n\n\tif (data.step.warmStarting)\n\t{\n\t\t// Account for variable time step.\n\t\tm_impulse *= data.step.dtRatio;\n\t\tm_springImpulse *= data.step.dtRatio;\n\t\tm_motorImpulse *= data.step.dtRatio;\n\n\t\tb2Vec2 P = m_impulse * m_ay + m_springImpulse * m_ax;\n\t\tfloat32 LA = m_impulse * m_sAy + m_springImpulse * m_sAx + m_motorImpulse;\n\t\tfloat32 LB = m_impulse * m_sBy + m_springImpulse * m_sBx + m_motorImpulse;\n\n\t\tvA -= m_invMassA * P;\n\t\twA -= m_invIA * LA;\n\n\t\tvB += m_invMassB * P;\n\t\twB += m_invIB * LB;\n\t}\n\telse\n\t{\n\t\tm_impulse = 0.0f;\n\t\tm_springImpulse = 0.0f;\n\t\tm_motorImpulse = 0.0f;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nvoid b2WheelJoint::SolveVelocityConstraints(const b2SolverData& data)\n{\n\tfloat32 mA = m_invMassA, mB = m_invMassB;\n\tfloat32 iA = m_invIA, iB = m_invIB;\n\n\tb2Vec2 vA = data.velocities[m_indexA].v;\n\tfloat32 wA = data.velocities[m_indexA].w;\n\tb2Vec2 vB = data.velocities[m_indexB].v;\n\tfloat32 wB = data.velocities[m_indexB].w;\n\n\t// Solve spring constraint\n\t{\n\t\tfloat32 Cdot = b2Dot(m_ax, vB - vA) + m_sBx * wB - m_sAx * wA;\n\t\tfloat32 impulse = -m_springMass * (Cdot + m_bias + m_gamma * m_springImpulse);\n\t\tm_springImpulse += impulse;\n\n\t\tb2Vec2 P = impulse * m_ax;\n\t\tfloat32 LA = impulse * m_sAx;\n\t\tfloat32 LB = impulse * m_sBx;\n\n\t\tvA -= mA * P;\n\t\twA -= iA * LA;\n\n\t\tvB += mB * P;\n\t\twB += iB * LB;\n\t}\n\n\t// Solve rotational motor constraint\n\t{\n\t\tfloat32 Cdot = wB - wA - m_motorSpeed;\n\t\tfloat32 impulse = -m_motorMass * Cdot;\n\n\t\tfloat32 oldImpulse = m_motorImpulse;\n\t\tfloat32 maxImpulse = data.step.dt * m_maxMotorTorque;\n\t\tm_motorImpulse = b2Clamp(m_motorImpulse + impulse, -maxImpulse, maxImpulse);\n\t\timpulse = m_motorImpulse - oldImpulse;\n\n\t\twA -= iA * impulse;\n\t\twB += iB * impulse;\n\t}\n\n\t// Solve point to line constraint\n\t{\n\t\tfloat32 Cdot = b2Dot(m_ay, vB - vA) + m_sBy * wB - m_sAy * wA;\n\t\tfloat32 impulse = -m_mass * Cdot;\n\t\tm_impulse += impulse;\n\n\t\tb2Vec2 P = impulse * m_ay;\n\t\tfloat32 LA = impulse * m_sAy;\n\t\tfloat32 LB = impulse * m_sBy;\n\n\t\tvA -= mA * P;\n\t\twA -= iA * LA;\n\n\t\tvB += mB * P;\n\t\twB += iB * LB;\n\t}\n\n\tdata.velocities[m_indexA].v = vA;\n\tdata.velocities[m_indexA].w = wA;\n\tdata.velocities[m_indexB].v = vB;\n\tdata.velocities[m_indexB].w = wB;\n}\n\nbool b2WheelJoint::SolvePositionConstraints(const b2SolverData& data)\n{\n\tb2Vec2 cA = data.positions[m_indexA].c;\n\tfloat32 aA = data.positions[m_indexA].a;\n\tb2Vec2 cB = data.positions[m_indexB].c;\n\tfloat32 aB = data.positions[m_indexB].a;\n\n\tb2Rot qA(aA), qB(aB);\n\n\tb2Vec2 rA = b2Mul(qA, m_localAnchorA - m_localCenterA);\n\tb2Vec2 rB = b2Mul(qB, m_localAnchorB - m_localCenterB);\n\tb2Vec2 d = (cB - cA) + rB - rA;\n\n\tb2Vec2 ay = b2Mul(qA, m_localYAxisA);\n\n\tfloat32 sAy = b2Cross(d + rA, ay);\n\tfloat32 sBy = b2Cross(rB, ay);\n\n\tfloat32 C = b2Dot(d, ay);\n\n\tfloat32 k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy;\n\n\tfloat32 impulse;\n\tif (k != 0.0f)\n\t{\n\t\timpulse = - C / k;\n\t}\n\telse\n\t{\n\t\timpulse = 0.0f;\n\t}\n\n\tb2Vec2 P = impulse * ay;\n\tfloat32 LA = impulse * sAy;\n\tfloat32 LB = impulse * sBy;\n\n\tcA -= m_invMassA * P;\n\taA -= m_invIA * LA;\n\tcB += m_invMassB * P;\n\taB += m_invIB * LB;\n\n\tdata.positions[m_indexA].c = cA;\n\tdata.positions[m_indexA].a = aA;\n\tdata.positions[m_indexB].c = cB;\n\tdata.positions[m_indexB].a = aB;\n\n\treturn b2Abs(C) <= b2_linearSlop;\n}\n\nb2Vec2 b2WheelJoint::GetAnchorA() const\n{\n\treturn m_bodyA->GetWorldPoint(m_localAnchorA);\n}\n\nb2Vec2 b2WheelJoint::GetAnchorB() const\n{\n\treturn m_bodyB->GetWorldPoint(m_localAnchorB);\n}\n\nb2Vec2 b2WheelJoint::GetReactionForce(float32 inv_dt) const\n{\n\treturn inv_dt * (m_impulse * m_ay + m_springImpulse * m_ax);\n}\n\nfloat32 b2WheelJoint::GetReactionTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_motorImpulse;\n}\n\nfloat32 b2WheelJoint::GetJointTranslation() const\n{\n\tb2Body* bA = m_bodyA;\n\tb2Body* bB = m_bodyB;\n\n\tb2Vec2 pA = bA->GetWorldPoint(m_localAnchorA);\n\tb2Vec2 pB = bB->GetWorldPoint(m_localAnchorB);\n\tb2Vec2 d = pB - pA;\n\tb2Vec2 axis = bA->GetWorldVector(m_localXAxisA);\n\n\tfloat32 translation = b2Dot(d, axis);\n\treturn translation;\n}\n\nfloat32 b2WheelJoint::GetJointSpeed() const\n{\n\tfloat32 wA = m_bodyA->m_angularVelocity;\n\tfloat32 wB = m_bodyB->m_angularVelocity;\n\treturn wB - wA;\n}\n\nbool b2WheelJoint::IsMotorEnabled() const\n{\n\treturn m_enableMotor;\n}\n\nvoid b2WheelJoint::EnableMotor(bool flag)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_enableMotor = flag;\n}\n\nvoid b2WheelJoint::SetMotorSpeed(float32 speed)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_motorSpeed = speed;\n}\n\nvoid b2WheelJoint::SetMaxMotorTorque(float32 torque)\n{\n\tm_bodyA->SetAwake(true);\n\tm_bodyB->SetAwake(true);\n\tm_maxMotorTorque = torque;\n}\n\nfloat32 b2WheelJoint::GetMotorTorque(float32 inv_dt) const\n{\n\treturn inv_dt * m_motorImpulse;\n}\n\nvoid b2WheelJoint::Dump()\n{\n\tint32 indexA = m_bodyA->m_islandIndex;\n\tint32 indexB = m_bodyB->m_islandIndex;\n\n\tb2Log(\"  b2WheelJointDef jd;\\n\");\n\tb2Log(\"  jd.bodyA = bodies[%d];\\n\", indexA);\n\tb2Log(\"  jd.bodyB = bodies[%d];\\n\", indexB);\n\tb2Log(\"  jd.collideConnected = bool(%d);\\n\", m_collideConnected);\n\tb2Log(\"  jd.localAnchorA.Set(%.15lef, %.15lef);\\n\", m_localAnchorA.x, m_localAnchorA.y);\n\tb2Log(\"  jd.localAnchorB.Set(%.15lef, %.15lef);\\n\", m_localAnchorB.x, m_localAnchorB.y);\n\tb2Log(\"  jd.localAxisA.Set(%.15lef, %.15lef);\\n\", m_localXAxisA.x, m_localXAxisA.y);\n\tb2Log(\"  jd.enableMotor = bool(%d);\\n\", m_enableMotor);\n\tb2Log(\"  jd.motorSpeed = %.15lef;\\n\", m_motorSpeed);\n\tb2Log(\"  jd.maxMotorTorque = %.15lef;\\n\", m_maxMotorTorque);\n\tb2Log(\"  jd.frequencyHz = %.15lef;\\n\", m_frequencyHz);\n\tb2Log(\"  jd.dampingRatio = %.15lef;\\n\", m_dampingRatio);\n\tb2Log(\"  joints[%d] = m_world->CreateJoint(&jd);\\n\", m_index);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/Joints/b2WheelJoint.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_WHEEL_JOINT_H\n#define B2_WHEEL_JOINT_H\n\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\n/// Wheel joint definition. This requires defining a line of\n/// motion using an axis and an anchor point. The definition uses local\n/// anchor points and a local axis so that the initial configuration\n/// can violate the constraint slightly. The joint translation is zero\n/// when the local anchor points coincide in world space. Using local\n/// anchors and a local axis helps when saving and loading a game.\nstruct b2WheelJointDef : public b2JointDef\n{\n\tb2WheelJointDef()\n\t{\n\t\ttype = e_wheelJoint;\n\t\tlocalAnchorA.SetZero();\n\t\tlocalAnchorB.SetZero();\n\t\tlocalAxisA.Set(1.0f, 0.0f);\n\t\tenableMotor = false;\n\t\tmaxMotorTorque = 0.0f;\n\t\tmotorSpeed = 0.0f;\n\t\tfrequencyHz = 2.0f;\n\t\tdampingRatio = 0.7f;\n\t}\n\n\t/// Initialize the bodies, anchors, axis, and reference angle using the world\n\t/// anchor and world axis.\n\tvoid Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis);\n\n\t/// The local anchor point relative to bodyA's origin.\n\tb2Vec2 localAnchorA;\n\n\t/// The local anchor point relative to bodyB's origin.\n\tb2Vec2 localAnchorB;\n\n\t/// The local translation axis in bodyA.\n\tb2Vec2 localAxisA;\n\n\t/// Enable/disable the joint motor.\n\tbool enableMotor;\n\n\t/// The maximum motor torque, usually in N-m.\n\tfloat32 maxMotorTorque;\n\n\t/// The desired motor speed in radians per second.\n\tfloat32 motorSpeed;\n\n\t/// Suspension frequency, zero indicates no suspension\n\tfloat32 frequencyHz;\n\n\t/// Suspension damping ratio, one indicates critical damping\n\tfloat32 dampingRatio;\n};\n\n/// A wheel joint. This joint provides two degrees of freedom: translation\n/// along an axis fixed in bodyA and rotation in the plane. You can use a\n/// joint limit to restrict the range of motion and a joint motor to drive\n/// the rotation or to model rotational friction.\n/// This joint is designed for vehicle suspensions.\nclass b2WheelJoint : public b2Joint\n{\npublic:\n\tb2Vec2 GetAnchorA() const;\n\tb2Vec2 GetAnchorB() const;\n\n\tb2Vec2 GetReactionForce(float32 inv_dt) const;\n\tfloat32 GetReactionTorque(float32 inv_dt) const;\n\n\t/// The local anchor point relative to bodyA's origin.\n\tconst b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; }\n\n\t/// The local anchor point relative to bodyB's origin.\n\tconst b2Vec2& GetLocalAnchorB() const  { return m_localAnchorB; }\n\n\t/// The local joint axis relative to bodyA.\n\tconst b2Vec2& GetLocalAxisA() const { return m_localXAxisA; }\n\n\t/// Get the current joint translation, usually in meters.\n\tfloat32 GetJointTranslation() const;\n\n\t/// Get the current joint translation speed, usually in meters per second.\n\tfloat32 GetJointSpeed() const;\n\n\t/// Is the joint motor enabled?\n\tbool IsMotorEnabled() const;\n\n\t/// Enable/disable the joint motor.\n\tvoid EnableMotor(bool flag);\n\n\t/// Set the motor speed, usually in radians per second.\n\tvoid SetMotorSpeed(float32 speed);\n\n\t/// Get the motor speed, usually in radians per second.\n\tfloat32 GetMotorSpeed() const;\n\n\t/// Set/Get the maximum motor force, usually in N-m.\n\tvoid SetMaxMotorTorque(float32 torque);\n\tfloat32 GetMaxMotorTorque() const;\n\n\t/// Get the current motor torque given the inverse time step, usually in N-m.\n\tfloat32 GetMotorTorque(float32 inv_dt) const;\n\n\t/// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring.\n\tvoid SetSpringFrequencyHz(float32 hz);\n\tfloat32 GetSpringFrequencyHz() const;\n\n\t/// Set/Get the spring damping ratio\n\tvoid SetSpringDampingRatio(float32 ratio);\n\tfloat32 GetSpringDampingRatio() const;\n\n\t/// Dump to b2Log\n\tvoid Dump();\n\nprotected:\n\n\tfriend class b2Joint;\n\tb2WheelJoint(const b2WheelJointDef* def);\n\n\tvoid InitVelocityConstraints(const b2SolverData& data);\n\tvoid SolveVelocityConstraints(const b2SolverData& data);\n\tbool SolvePositionConstraints(const b2SolverData& data);\n\n\tfloat32 m_frequencyHz;\n\tfloat32 m_dampingRatio;\n\n\t// Solver shared\n\tb2Vec2 m_localAnchorA;\n\tb2Vec2 m_localAnchorB;\n\tb2Vec2 m_localXAxisA;\n\tb2Vec2 m_localYAxisA;\n\n\tfloat32 m_impulse;\n\tfloat32 m_motorImpulse;\n\tfloat32 m_springImpulse;\n\n\tfloat32 m_maxMotorTorque;\n\tfloat32 m_motorSpeed;\n\tbool m_enableMotor;\n\n\t// Solver temp\n\tint32 m_indexA;\n\tint32 m_indexB;\n\tb2Vec2 m_localCenterA;\n\tb2Vec2 m_localCenterB;\n\tfloat32 m_invMassA;\n\tfloat32 m_invMassB;\n\tfloat32 m_invIA;\n\tfloat32 m_invIB;\n\n\tb2Vec2 m_ax, m_ay;\n\tfloat32 m_sAx, m_sBx;\n\tfloat32 m_sAy, m_sBy;\n\n\tfloat32 m_mass;\n\tfloat32 m_motorMass;\n\tfloat32 m_springMass;\n\n\tfloat32 m_bias;\n\tfloat32 m_gamma;\n};\n\ninline float32 b2WheelJoint::GetMotorSpeed() const\n{\n\treturn m_motorSpeed;\n}\n\ninline float32 b2WheelJoint::GetMaxMotorTorque() const\n{\n\treturn m_maxMotorTorque;\n}\n\ninline void b2WheelJoint::SetSpringFrequencyHz(float32 hz)\n{\n\tm_frequencyHz = hz;\n}\n\ninline float32 b2WheelJoint::GetSpringFrequencyHz() const\n{\n\treturn m_frequencyHz;\n}\n\ninline void b2WheelJoint::SetSpringDampingRatio(float32 ratio)\n{\n\tm_dampingRatio = ratio;\n}\n\ninline float32 b2WheelJoint::GetSpringDampingRatio() const\n{\n\treturn m_dampingRatio;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2Body.cpp",
    "content": "/*\n* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2World.h>\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n\nb2Body::b2Body(const b2BodyDef* bd, b2World* world)\n{\n\tb2Assert(bd->position.IsValid());\n\tb2Assert(bd->linearVelocity.IsValid());\n\tb2Assert(b2IsValid(bd->angle));\n\tb2Assert(b2IsValid(bd->angularVelocity));\n\tb2Assert(b2IsValid(bd->angularDamping) && bd->angularDamping >= 0.0f);\n\tb2Assert(b2IsValid(bd->linearDamping) && bd->linearDamping >= 0.0f);\n\n\tm_flags = 0;\n\n\tif (bd->bullet)\n\t{\n\t\tm_flags |= e_bulletFlag;\n\t}\n\tif (bd->fixedRotation)\n\t{\n\t\tm_flags |= e_fixedRotationFlag;\n\t}\n\tif (bd->allowSleep)\n\t{\n\t\tm_flags |= e_autoSleepFlag;\n\t}\n\tif (bd->awake)\n\t{\n\t\tm_flags |= e_awakeFlag;\n\t}\n\tif (bd->active)\n\t{\n\t\tm_flags |= e_activeFlag;\n\t}\n\n\tm_world = world;\n\n\tm_xf.p = bd->position;\n\tm_xf.q.Set(bd->angle);\n\n\tm_sweep.localCenter.SetZero();\n\tm_sweep.c0 = m_xf.p;\n\tm_sweep.c = m_xf.p;\n\tm_sweep.a0 = bd->angle;\n\tm_sweep.a = bd->angle;\n\tm_sweep.alpha0 = 0.0f;\n\n\tm_jointList = NULL;\n\tm_contactList = NULL;\n\tm_prev = NULL;\n\tm_next = NULL;\n\n\tm_linearVelocity = bd->linearVelocity;\n\tm_angularVelocity = bd->angularVelocity;\n\n\tm_linearDamping = bd->linearDamping;\n\tm_angularDamping = bd->angularDamping;\n\tm_gravityScale = bd->gravityScale;\n\n\tm_force.SetZero();\n\tm_torque = 0.0f;\n\n\tm_sleepTime = 0.0f;\n\n\tm_type = bd->type;\n\n\tif (m_type == b2_dynamicBody)\n\t{\n\t\tm_mass = 1.0f;\n\t\tm_invMass = 1.0f;\n\t}\n\telse\n\t{\n\t\tm_mass = 0.0f;\n\t\tm_invMass = 0.0f;\n\t}\n\n\tm_I = 0.0f;\n\tm_invI = 0.0f;\n\n\tm_userData = bd->userData;\n\n\tm_fixtureList = NULL;\n\tm_fixtureCount = 0;\n}\n\nb2Body::~b2Body()\n{\n\t// shapes and joints are destroyed in b2World::Destroy\n}\n\nvoid b2Body::SetType(b2BodyType type)\n{\n\tb2Assert(m_world->IsLocked() == false);\n\tif (m_world->IsLocked() == true)\n\t{\n\t\treturn;\n\t}\n\n\tif (m_type == type)\n\t{\n\t\treturn;\n\t}\n\n\tm_type = type;\n\n\tResetMassData();\n\n\tif (m_type == b2_staticBody)\n\t{\n\t\tm_linearVelocity.SetZero();\n\t\tm_angularVelocity = 0.0f;\n\t\tm_sweep.a0 = m_sweep.a;\n\t\tm_sweep.c0 = m_sweep.c;\n\t\tSynchronizeFixtures();\n\t}\n\n\tSetAwake(true);\n\n\tm_force.SetZero();\n\tm_torque = 0.0f;\n\n\t// Delete the attached contacts.\n\tb2ContactEdge* ce = m_contactList;\n\twhile (ce)\n\t{\n\t\tb2ContactEdge* ce0 = ce;\n\t\tce = ce->next;\n\t\tm_world->m_contactManager.Destroy(ce0->contact);\n\t}\n\tm_contactList = NULL;\n\n\t// Touch the proxies so that new contacts will be created (when appropriate)\n\tb2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;\n\tfor (b2Fixture* f = m_fixtureList; f; f = f->m_next)\n\t{\n\t\tint32 proxyCount = f->m_proxyCount;\n\t\tfor (int32 i = 0; i < proxyCount; ++i)\n\t\t{\n\t\t\tbroadPhase->TouchProxy(f->m_proxies[i].proxyId);\n\t\t}\n\t}\n}\n\nb2Fixture* b2Body::CreateFixture(const b2FixtureDef* def)\n{\n\tb2Assert(m_world->IsLocked() == false);\n\tif (m_world->IsLocked() == true)\n\t{\n\t\treturn NULL;\n\t}\n\n\tb2BlockAllocator* allocator = &m_world->m_blockAllocator;\n\n\tvoid* memory = allocator->Allocate(sizeof(b2Fixture));\n\tb2Fixture* fixture = new (memory) b2Fixture;\n\tfixture->Create(allocator, this, def);\n\n\tif (m_flags & e_activeFlag)\n\t{\n\t\tb2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;\n\t\tfixture->CreateProxies(broadPhase, m_xf);\n\t}\n\n\tfixture->m_next = m_fixtureList;\n\tm_fixtureList = fixture;\n\t++m_fixtureCount;\n\n\tfixture->m_body = this;\n\n\t// Adjust mass properties if needed.\n\tif (fixture->m_density > 0.0f)\n\t{\n\t\tResetMassData();\n\t}\n\n\t// Let the world know we have a new fixture. This will cause new contacts\n\t// to be created at the beginning of the next time step.\n\tm_world->m_flags |= b2World::e_newFixture;\n\n\treturn fixture;\n}\n\nb2Fixture* b2Body::CreateFixture(const b2Shape* shape, float32 density)\n{\n\tb2FixtureDef def;\n\tdef.shape = shape;\n\tdef.density = density;\n\n\treturn CreateFixture(&def);\n}\n\nvoid b2Body::DestroyFixture(b2Fixture* fixture)\n{\n\tb2Assert(m_world->IsLocked() == false);\n\tif (m_world->IsLocked() == true)\n\t{\n\t\treturn;\n\t}\n\n\tb2Assert(fixture->m_body == this);\n\n\t// Remove the fixture from this body's singly linked list.\n\tb2Assert(m_fixtureCount > 0);\n\tb2Fixture** node = &m_fixtureList;\n\tbool found = false;\n\twhile (*node != NULL)\n\t{\n\t\tif (*node == fixture)\n\t\t{\n\t\t\t*node = fixture->m_next;\n\t\t\tfound = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tnode = &(*node)->m_next;\n\t}\n\n\t// You tried to remove a shape that is not attached to this body.\n\tb2Assert(found);\n\n\t// Destroy any contacts associated with the fixture.\n\tb2ContactEdge* edge = m_contactList;\n\twhile (edge)\n\t{\n\t\tb2Contact* c = edge->contact;\n\t\tedge = edge->next;\n\n\t\tb2Fixture* fixtureA = c->GetFixtureA();\n\t\tb2Fixture* fixtureB = c->GetFixtureB();\n\n\t\tif (fixture == fixtureA || fixture == fixtureB)\n\t\t{\n\t\t\t// This destroys the contact and removes it from\n\t\t\t// this body's contact list.\n\t\t\tm_world->m_contactManager.Destroy(c);\n\t\t}\n\t}\n\n\tb2BlockAllocator* allocator = &m_world->m_blockAllocator;\n\n\tif (m_flags & e_activeFlag)\n\t{\n\t\tb2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;\n\t\tfixture->DestroyProxies(broadPhase);\n\t}\n\n\tfixture->Destroy(allocator);\n\tfixture->m_body = NULL;\n\tfixture->m_next = NULL;\n\tfixture->~b2Fixture();\n\tallocator->Free(fixture, sizeof(b2Fixture));\n\n\t--m_fixtureCount;\n\n\t// Reset the mass data.\n\tResetMassData();\n}\n\nvoid b2Body::ResetMassData()\n{\n\t// Compute mass data from shapes. Each shape has its own density.\n\tm_mass = 0.0f;\n\tm_invMass = 0.0f;\n\tm_I = 0.0f;\n\tm_invI = 0.0f;\n\tm_sweep.localCenter.SetZero();\n\n\t// Static and kinematic bodies have zero mass.\n\tif (m_type == b2_staticBody || m_type == b2_kinematicBody)\n\t{\n\t\tm_sweep.c0 = m_xf.p;\n\t\tm_sweep.c = m_xf.p;\n\t\tm_sweep.a0 = m_sweep.a;\n\t\treturn;\n\t}\n\n\tb2Assert(m_type == b2_dynamicBody);\n\n\t// Accumulate mass over all fixtures.\n\tb2Vec2 localCenter = b2Vec2_zero;\n\tfor (b2Fixture* f = m_fixtureList; f; f = f->m_next)\n\t{\n\t\tif (f->m_density == 0.0f)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tb2MassData massData;\n\t\tf->GetMassData(&massData);\n\t\tm_mass += massData.mass;\n\t\tlocalCenter += massData.mass * massData.center;\n\t\tm_I += massData.I;\n\t}\n\n\t// Compute center of mass.\n\tif (m_mass > 0.0f)\n\t{\n\t\tm_invMass = 1.0f / m_mass;\n\t\tlocalCenter *= m_invMass;\n\t}\n\telse\n\t{\n\t\t// Force all dynamic bodies to have a positive mass.\n\t\tm_mass = 1.0f;\n\t\tm_invMass = 1.0f;\n\t}\n\n\tif (m_I > 0.0f && (m_flags & e_fixedRotationFlag) == 0)\n\t{\n\t\t// Center the inertia about the center of mass.\n\t\tm_I -= m_mass * b2Dot(localCenter, localCenter);\n\t\tb2Assert(m_I > 0.0f);\n\t\tm_invI = 1.0f / m_I;\n\n\t}\n\telse\n\t{\n\t\tm_I = 0.0f;\n\t\tm_invI = 0.0f;\n\t}\n\n\t// Move center of mass.\n\tb2Vec2 oldCenter = m_sweep.c;\n\tm_sweep.localCenter = localCenter;\n\tm_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter);\n\n\t// Update center of mass velocity.\n\tm_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter);\n}\n\nvoid b2Body::SetMassData(const b2MassData* massData)\n{\n\tb2Assert(m_world->IsLocked() == false);\n\tif (m_world->IsLocked() == true)\n\t{\n\t\treturn;\n\t}\n\n\tif (m_type != b2_dynamicBody)\n\t{\n\t\treturn;\n\t}\n\n\tm_invMass = 0.0f;\n\tm_I = 0.0f;\n\tm_invI = 0.0f;\n\n\tm_mass = massData->mass;\n\tif (m_mass <= 0.0f)\n\t{\n\t\tm_mass = 1.0f;\n\t}\n\n\tm_invMass = 1.0f / m_mass;\n\n\tif (massData->I > 0.0f && (m_flags & b2Body::e_fixedRotationFlag) == 0)\n\t{\n\t\tm_I = massData->I - m_mass * b2Dot(massData->center, massData->center);\n\t\tb2Assert(m_I > 0.0f);\n\t\tm_invI = 1.0f / m_I;\n\t}\n\n\t// Move center of mass.\n\tb2Vec2 oldCenter = m_sweep.c;\n\tm_sweep.localCenter =  massData->center;\n\tm_sweep.c0 = m_sweep.c = b2Mul(m_xf, m_sweep.localCenter);\n\n\t// Update center of mass velocity.\n\tm_linearVelocity += b2Cross(m_angularVelocity, m_sweep.c - oldCenter);\n}\n\nbool b2Body::ShouldCollide(const b2Body* other) const\n{\n\t// At least one body should be dynamic.\n\tif (m_type != b2_dynamicBody && other->m_type != b2_dynamicBody)\n\t{\n\t\treturn false;\n\t}\n\n\t// Does a joint prevent collision?\n\tfor (b2JointEdge* jn = m_jointList; jn; jn = jn->next)\n\t{\n\t\tif (jn->other == other)\n\t\t{\n\t\t\tif (jn->joint->m_collideConnected == false)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n\nvoid b2Body::SetTransform(const b2Vec2& position, float32 angle)\n{\n\tb2Assert(m_world->IsLocked() == false);\n\tif (m_world->IsLocked() == true)\n\t{\n\t\treturn;\n\t}\n\n\tm_xf.q.Set(angle);\n\tm_xf.p = position;\n\n\tm_sweep.c = b2Mul(m_xf, m_sweep.localCenter);\n\tm_sweep.a = angle;\n\n\tm_sweep.c0 = m_sweep.c;\n\tm_sweep.a0 = angle;\n\n\tb2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;\n\tfor (b2Fixture* f = m_fixtureList; f; f = f->m_next)\n\t{\n\t\tf->Synchronize(broadPhase, m_xf, m_xf);\n\t}\n}\n\nvoid b2Body::SynchronizeFixtures()\n{\n\tb2Transform xf1;\n\txf1.q.Set(m_sweep.a0);\n\txf1.p = m_sweep.c0 - b2Mul(xf1.q, m_sweep.localCenter);\n\n\tb2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;\n\tfor (b2Fixture* f = m_fixtureList; f; f = f->m_next)\n\t{\n\t\tf->Synchronize(broadPhase, xf1, m_xf);\n\t}\n}\n\nvoid b2Body::SetActive(bool flag)\n{\n\tb2Assert(m_world->IsLocked() == false);\n\n\tif (flag == IsActive())\n\t{\n\t\treturn;\n\t}\n\n\tif (flag)\n\t{\n\t\tm_flags |= e_activeFlag;\n\n\t\t// Create all proxies.\n\t\tb2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;\n\t\tfor (b2Fixture* f = m_fixtureList; f; f = f->m_next)\n\t\t{\n\t\t\tf->CreateProxies(broadPhase, m_xf);\n\t\t}\n\n\t\t// Contacts are created the next time step.\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_activeFlag;\n\n\t\t// Destroy all proxies.\n\t\tb2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase;\n\t\tfor (b2Fixture* f = m_fixtureList; f; f = f->m_next)\n\t\t{\n\t\t\tf->DestroyProxies(broadPhase);\n\t\t}\n\n\t\t// Destroy the attached contacts.\n\t\tb2ContactEdge* ce = m_contactList;\n\t\twhile (ce)\n\t\t{\n\t\t\tb2ContactEdge* ce0 = ce;\n\t\t\tce = ce->next;\n\t\t\tm_world->m_contactManager.Destroy(ce0->contact);\n\t\t}\n\t\tm_contactList = NULL;\n\t}\n}\n\nvoid b2Body::SetFixedRotation(bool flag)\n{\n\tbool status = (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag;\n\tif (status == flag)\n\t{\n\t\treturn;\n\t}\n\n\tif (flag)\n\t{\n\t\tm_flags |= e_fixedRotationFlag;\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_fixedRotationFlag;\n\t}\n\n\tm_angularVelocity = 0.0f;\n\n\tResetMassData();\n}\n\nvoid b2Body::Dump()\n{\n\tint32 bodyIndex = m_islandIndex;\n\n\tb2Log(\"{\\n\");\n\tb2Log(\"  b2BodyDef bd;\\n\");\n\tb2Log(\"  bd.type = b2BodyType(%d);\\n\", m_type);\n\tb2Log(\"  bd.position.Set(%.15lef, %.15lef);\\n\", m_xf.p.x, m_xf.p.y);\n\tb2Log(\"  bd.angle = %.15lef;\\n\", m_sweep.a);\n\tb2Log(\"  bd.linearVelocity.Set(%.15lef, %.15lef);\\n\", m_linearVelocity.x, m_linearVelocity.y);\n\tb2Log(\"  bd.angularVelocity = %.15lef;\\n\", m_angularVelocity);\n\tb2Log(\"  bd.linearDamping = %.15lef;\\n\", m_linearDamping);\n\tb2Log(\"  bd.angularDamping = %.15lef;\\n\", m_angularDamping);\n\tb2Log(\"  bd.allowSleep = bool(%d);\\n\", m_flags & e_autoSleepFlag);\n\tb2Log(\"  bd.awake = bool(%d);\\n\", m_flags & e_awakeFlag);\n\tb2Log(\"  bd.fixedRotation = bool(%d);\\n\", m_flags & e_fixedRotationFlag);\n\tb2Log(\"  bd.bullet = bool(%d);\\n\", m_flags & e_bulletFlag);\n\tb2Log(\"  bd.active = bool(%d);\\n\", m_flags & e_activeFlag);\n\tb2Log(\"  bd.gravityScale = %.15lef;\\n\", m_gravityScale);\n\tb2Log(\"  bodies[%d] = m_world->CreateBody(&bd);\\n\", m_islandIndex);\n\tb2Log(\"\\n\");\n\tfor (b2Fixture* f = m_fixtureList; f; f = f->m_next)\n\t{\n\t\tb2Log(\"  {\\n\");\n\t\tf->Dump(bodyIndex);\n\t\tb2Log(\"  }\\n\");\n\t}\n\tb2Log(\"}\\n\");\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2Body.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_BODY_H\n#define B2_BODY_H\n\n#include <Box2D/Common/b2Math.h>\n#include <Box2D/Collision/Shapes/b2Shape.h>\n#include <memory>\n\nclass b2Fixture;\nclass b2Joint;\nclass b2Contact;\nclass b2Controller;\nclass b2World;\nstruct b2FixtureDef;\nstruct b2JointEdge;\nstruct b2ContactEdge;\n\n/// The body type.\n/// static: zero mass, zero velocity, may be manually moved\n/// kinematic: zero mass, non-zero velocity set by user, moved by solver\n/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver\nenum b2BodyType\n{\n\tb2_staticBody = 0,\n\tb2_kinematicBody,\n\tb2_dynamicBody\n\n\t// TODO_ERIN\n\t//b2_bulletBody,\n};\n\n/// A body definition holds all the data needed to construct a rigid body.\n/// You can safely re-use body definitions. Shapes are added to a body after construction.\nstruct b2BodyDef\n{\n\t/// This constructor sets the body definition default values.\n\tb2BodyDef()\n\t{\n\t\tuserData = NULL;\n\t\tposition.Set(0.0f, 0.0f);\n\t\tangle = 0.0f;\n\t\tlinearVelocity.Set(0.0f, 0.0f);\n\t\tangularVelocity = 0.0f;\n\t\tlinearDamping = 0.0f;\n\t\tangularDamping = 0.0f;\n\t\tallowSleep = true;\n\t\tawake = true;\n\t\tfixedRotation = false;\n\t\tbullet = false;\n\t\ttype = b2_staticBody;\n\t\tactive = true;\n\t\tgravityScale = 1.0f;\n\t}\n\n\t/// The body type: static, kinematic, or dynamic.\n\t/// Note: if a dynamic body would have zero mass, the mass is set to one.\n\tb2BodyType type;\n\n\t/// The world position of the body. Avoid creating bodies at the origin\n\t/// since this can lead to many overlapping shapes.\n\tb2Vec2 position;\n\n\t/// The world angle of the body in radians.\n\tfloat32 angle;\n\n\t/// The linear velocity of the body's origin in world co-ordinates.\n\tb2Vec2 linearVelocity;\n\n\t/// The angular velocity of the body.\n\tfloat32 angularVelocity;\n\n\t/// Linear damping is use to reduce the linear velocity. The damping parameter\n\t/// can be larger than 1.0f but the damping effect becomes sensitive to the\n\t/// time step when the damping parameter is large.\n\tfloat32 linearDamping;\n\n\t/// Angular damping is use to reduce the angular velocity. The damping parameter\n\t/// can be larger than 1.0f but the damping effect becomes sensitive to the\n\t/// time step when the damping parameter is large.\n\tfloat32 angularDamping;\n\n\t/// Set this flag to false if this body should never fall asleep. Note that\n\t/// this increases CPU usage.\n\tbool allowSleep;\n\n\t/// Is this body initially awake or sleeping?\n\tbool awake;\n\n\t/// Should this body be prevented from rotating? Useful for characters.\n\tbool fixedRotation;\n\n\t/// Is this a fast moving body that should be prevented from tunneling through\n\t/// other moving bodies? Note that all bodies are prevented from tunneling through\n\t/// kinematic and static bodies. This setting is only considered on dynamic bodies.\n\t/// @warning You should use this flag sparingly since it increases processing time.\n\tbool bullet;\n\n\t/// Does this body start out active?\n\tbool active;\n\n\t/// Use this to store application specific body data.\n\tvoid* userData;\n\n\t/// Scale the gravity applied to this body.\n\tfloat32 gravityScale;\n};\n\n/// A rigid body. These are created via b2World::CreateBody.\nclass b2Body\n{\npublic:\n\t/// Creates a fixture and attach it to this body. Use this function if you need\n\t/// to set some fixture parameters, like friction. Otherwise you can create the\n\t/// fixture directly from a shape.\n\t/// If the density is non-zero, this function automatically updates the mass of the body.\n\t/// Contacts are not created until the next time step.\n\t/// @param def the fixture definition.\n\t/// @warning This function is locked during callbacks.\n\tb2Fixture* CreateFixture(const b2FixtureDef* def);\n\n\t/// Creates a fixture from a shape and attach it to this body.\n\t/// This is a convenience function. Use b2FixtureDef if you need to set parameters\n\t/// like friction, restitution, user data, or filtering.\n\t/// If the density is non-zero, this function automatically updates the mass of the body.\n\t/// @param shape the shape to be cloned.\n\t/// @param density the shape density (set to zero for static bodies).\n\t/// @warning This function is locked during callbacks.\n\tb2Fixture* CreateFixture(const b2Shape* shape, float32 density);\n\n\t/// Destroy a fixture. This removes the fixture from the broad-phase and\n\t/// destroys all contacts associated with this fixture. This will\n\t/// automatically adjust the mass of the body if the body is dynamic and the\n\t/// fixture has positive density.\n\t/// All fixtures attached to a body are implicitly destroyed when the body is destroyed.\n\t/// @param fixture the fixture to be removed.\n\t/// @warning This function is locked during callbacks.\n\tvoid DestroyFixture(b2Fixture* fixture);\n\n\t/// Set the position of the body's origin and rotation.\n\t/// Manipulating a body's transform may cause non-physical behavior.\n\t/// Note: contacts are updated on the next call to b2World::Step.\n\t/// @param position the world position of the body's local origin.\n\t/// @param angle the world rotation in radians.\n\tvoid SetTransform(const b2Vec2& position, float32 angle);\n\n\t/// Get the body transform for the body's origin.\n\t/// @return the world transform of the body's origin.\n\tconst b2Transform& GetTransform() const;\n\n\t/// Get the world body origin position.\n\t/// @return the world position of the body's origin.\n\tconst b2Vec2& GetPosition() const;\n\n\t/// Get the angle in radians.\n\t/// @return the current world rotation angle in radians.\n\tfloat32 GetAngle() const;\n\n\t/// Get the world position of the center of mass.\n\tconst b2Vec2& GetWorldCenter() const;\n\n\t/// Get the local position of the center of mass.\n\tconst b2Vec2& GetLocalCenter() const;\n\n\t/// Set the linear velocity of the center of mass.\n\t/// @param v the new linear velocity of the center of mass.\n\tvoid SetLinearVelocity(const b2Vec2& v);\n\n\t/// Get the linear velocity of the center of mass.\n\t/// @return the linear velocity of the center of mass.\n\tconst b2Vec2& GetLinearVelocity() const;\n\n\t/// Set the angular velocity.\n\t/// @param omega the new angular velocity in radians/second.\n\tvoid SetAngularVelocity(float32 omega);\n\n\t/// Get the angular velocity.\n\t/// @return the angular velocity in radians/second.\n\tfloat32 GetAngularVelocity() const;\n\n\t/// Apply a force at a world point. If the force is not\n\t/// applied at the center of mass, it will generate a torque and\n\t/// affect the angular velocity. This wakes up the body.\n\t/// @param force the world force vector, usually in Newtons (N).\n\t/// @param point the world position of the point of application.\n\t/// @param wake also wake up the body\n\tvoid ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake);\n\n\t/// Apply a force to the center of mass. This wakes up the body.\n\t/// @param force the world force vector, usually in Newtons (N).\n\t/// @param wake also wake up the body\n\tvoid ApplyForceToCenter(const b2Vec2& force, bool wake);\n\n\t/// Apply a torque. This affects the angular velocity\n\t/// without affecting the linear velocity of the center of mass.\n\t/// This wakes up the body.\n\t/// @param torque about the z-axis (out of the screen), usually in N-m.\n\t/// @param wake also wake up the body\n\tvoid ApplyTorque(float32 torque, bool wake);\n\n\t/// Apply an impulse at a point. This immediately modifies the velocity.\n\t/// It also modifies the angular velocity if the point of application\n\t/// is not at the center of mass. This wakes up the body.\n\t/// @param impulse the world impulse vector, usually in N-seconds or kg-m/s.\n\t/// @param point the world position of the point of application.\n\t/// @param wake also wake up the body\n\tvoid ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point, bool wake);\n\n\t/// Apply an angular impulse.\n\t/// @param impulse the angular impulse in units of kg*m*m/s\n\t/// @param wake also wake up the body\n\tvoid ApplyAngularImpulse(float32 impulse, bool wake);\n\n\t/// Get the total mass of the body.\n\t/// @return the mass, usually in kilograms (kg).\n\tfloat32 GetMass() const;\n\n\t/// Get the rotational inertia of the body about the local origin.\n\t/// @return the rotational inertia, usually in kg-m^2.\n\tfloat32 GetInertia() const;\n\n\t/// Get the mass data of the body.\n\t/// @return a struct containing the mass, inertia and center of the body.\n\tvoid GetMassData(b2MassData* data) const;\n\n\t/// Set the mass properties to override the mass properties of the fixtures.\n\t/// Note that this changes the center of mass position.\n\t/// Note that creating or destroying fixtures can also alter the mass.\n\t/// This function has no effect if the body isn't dynamic.\n\t/// @param massData the mass properties.\n\tvoid SetMassData(const b2MassData* data);\n\n\t/// This resets the mass properties to the sum of the mass properties of the fixtures.\n\t/// This normally does not need to be called unless you called SetMassData to override\n\t/// the mass and you later want to reset the mass.\n\tvoid ResetMassData();\n\n\t/// Get the world coordinates of a point given the local coordinates.\n\t/// @param localPoint a point on the body measured relative the the body's origin.\n\t/// @return the same point expressed in world coordinates.\n\tb2Vec2 GetWorldPoint(const b2Vec2& localPoint) const;\n\n\t/// Get the world coordinates of a vector given the local coordinates.\n\t/// @param localVector a vector fixed in the body.\n\t/// @return the same vector expressed in world coordinates.\n\tb2Vec2 GetWorldVector(const b2Vec2& localVector) const;\n\n\t/// Gets a local point relative to the body's origin given a world point.\n\t/// @param a point in world coordinates.\n\t/// @return the corresponding local point relative to the body's origin.\n\tb2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const;\n\n\t/// Gets a local vector given a world vector.\n\t/// @param a vector in world coordinates.\n\t/// @return the corresponding local vector.\n\tb2Vec2 GetLocalVector(const b2Vec2& worldVector) const;\n\n\t/// Get the world linear velocity of a world point attached to this body.\n\t/// @param a point in world coordinates.\n\t/// @return the world velocity of a point.\n\tb2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const;\n\n\t/// Get the world velocity of a local point.\n\t/// @param a point in local coordinates.\n\t/// @return the world velocity of a point.\n\tb2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const;\n\n\t/// Get the linear damping of the body.\n\tfloat32 GetLinearDamping() const;\n\n\t/// Set the linear damping of the body.\n\tvoid SetLinearDamping(float32 linearDamping);\n\n\t/// Get the angular damping of the body.\n\tfloat32 GetAngularDamping() const;\n\n\t/// Set the angular damping of the body.\n\tvoid SetAngularDamping(float32 angularDamping);\n\n\t/// Get the gravity scale of the body.\n\tfloat32 GetGravityScale() const;\n\n\t/// Set the gravity scale of the body.\n\tvoid SetGravityScale(float32 scale);\n\n\t/// Set the type of this body. This may alter the mass and velocity.\n\tvoid SetType(b2BodyType type);\n\n\t/// Get the type of this body.\n\tb2BodyType GetType() const;\n\n\t/// Should this body be treated like a bullet for continuous collision detection?\n\tvoid SetBullet(bool flag);\n\n\t/// Is this body treated like a bullet for continuous collision detection?\n\tbool IsBullet() const;\n\n\t/// You can disable sleeping on this body. If you disable sleeping, the\n\t/// body will be woken.\n\tvoid SetSleepingAllowed(bool flag);\n\n\t/// Is this body allowed to sleep\n\tbool IsSleepingAllowed() const;\n\n\t/// Set the sleep state of the body. A sleeping body has very\n\t/// low CPU cost.\n\t/// @param flag set to true to wake the body, false to put it to sleep.\n\tvoid SetAwake(bool flag);\n\n\t/// Get the sleeping state of this body.\n\t/// @return true if the body is awake.\n\tbool IsAwake() const;\n\n\t/// Set the active state of the body. An inactive body is not\n\t/// simulated and cannot be collided with or woken up.\n\t/// If you pass a flag of true, all fixtures will be added to the\n\t/// broad-phase.\n\t/// If you pass a flag of false, all fixtures will be removed from\n\t/// the broad-phase and all contacts will be destroyed.\n\t/// Fixtures and joints are otherwise unaffected. You may continue\n\t/// to create/destroy fixtures and joints on inactive bodies.\n\t/// Fixtures on an inactive body are implicitly inactive and will\n\t/// not participate in collisions, ray-casts, or queries.\n\t/// Joints connected to an inactive body are implicitly inactive.\n\t/// An inactive body is still owned by a b2World object and remains\n\t/// in the body list.\n\tvoid SetActive(bool flag);\n\n\t/// Get the active state of the body.\n\tbool IsActive() const;\n\n\t/// Set this body to have fixed rotation. This causes the mass\n\t/// to be reset.\n\tvoid SetFixedRotation(bool flag);\n\n\t/// Does this body have fixed rotation?\n\tbool IsFixedRotation() const;\n\n\t/// Get the list of all fixtures attached to this body.\n\tb2Fixture* GetFixtureList();\n\tconst b2Fixture* GetFixtureList() const;\n\n\t/// Get the list of all joints attached to this body.\n\tb2JointEdge* GetJointList();\n\tconst b2JointEdge* GetJointList() const;\n\n\t/// Get the list of all contacts attached to this body.\n\t/// @warning this list changes during the time step and you may\n\t/// miss some collisions if you don't use b2ContactListener.\n\tb2ContactEdge* GetContactList();\n\tconst b2ContactEdge* GetContactList() const;\n\n\t/// Get the next body in the world's body list.\n\tb2Body* GetNext();\n\tconst b2Body* GetNext() const;\n\n\t/// Get the user data pointer that was provided in the body definition.\n\tvoid* GetUserData() const;\n\n\t/// Set the user data. Use this to store your application specific data.\n\tvoid SetUserData(void* data);\n\n\t/// Get the parent world of this body.\n\tb2World* GetWorld();\n\tconst b2World* GetWorld() const;\n\n\t/// Dump this body to a log file\n\tvoid Dump();\n\nprivate:\n\n\tfriend class b2World;\n\tfriend class b2Island;\n\tfriend class b2ContactManager;\n\tfriend class b2ContactSolver;\n\tfriend class b2Contact;\n\t\n\tfriend class b2DistanceJoint;\n\tfriend class b2FrictionJoint;\n\tfriend class b2GearJoint;\n\tfriend class b2MotorJoint;\n\tfriend class b2MouseJoint;\n\tfriend class b2PrismaticJoint;\n\tfriend class b2PulleyJoint;\n\tfriend class b2RevoluteJoint;\n\tfriend class b2RopeJoint;\n\tfriend class b2WeldJoint;\n\tfriend class b2WheelJoint;\n\n\t// m_flags\n\tenum\n\t{\n\t\te_islandFlag\t\t= 0x0001,\n\t\te_awakeFlag\t\t\t= 0x0002,\n\t\te_autoSleepFlag\t\t= 0x0004,\n\t\te_bulletFlag\t\t= 0x0008,\n\t\te_fixedRotationFlag\t= 0x0010,\n\t\te_activeFlag\t\t= 0x0020,\n\t\te_toiFlag\t\t\t= 0x0040\n\t};\n\n\tb2Body(const b2BodyDef* bd, b2World* world);\n\t~b2Body();\n\n\tvoid SynchronizeFixtures();\n\tvoid SynchronizeTransform();\n\n\t// This is used to prevent connected bodies from colliding.\n\t// It may lie, depending on the collideConnected flag.\n\tbool ShouldCollide(const b2Body* other) const;\n\n\tvoid Advance(float32 t);\n\n\tb2BodyType m_type;\n\n\tuint16 m_flags;\n\n\tint32 m_islandIndex;\n\n\tb2Transform m_xf;\t\t// the body origin transform\n\tb2Sweep m_sweep;\t\t// the swept motion for CCD\n\n\tb2Vec2 m_linearVelocity;\n\tfloat32 m_angularVelocity;\n\n\tb2Vec2 m_force;\n\tfloat32 m_torque;\n\n\tb2World* m_world;\n\tb2Body* m_prev;\n\tb2Body* m_next;\n\n\tb2Fixture* m_fixtureList;\n\tint32 m_fixtureCount;\n\n\tb2JointEdge* m_jointList;\n\tb2ContactEdge* m_contactList;\n\n\tfloat32 m_mass, m_invMass;\n\n\t// Rotational inertia about the center of mass.\n\tfloat32 m_I, m_invI;\n\n\tfloat32 m_linearDamping;\n\tfloat32 m_angularDamping;\n\tfloat32 m_gravityScale;\n\n\tfloat32 m_sleepTime;\n\n\tvoid* m_userData;\n};\n\ninline b2BodyType b2Body::GetType() const\n{\n\treturn m_type;\n}\n\ninline const b2Transform& b2Body::GetTransform() const\n{\n\treturn m_xf;\n}\n\ninline const b2Vec2& b2Body::GetPosition() const\n{\n\treturn m_xf.p;\n}\n\ninline float32 b2Body::GetAngle() const\n{\n\treturn m_sweep.a;\n}\n\ninline const b2Vec2& b2Body::GetWorldCenter() const\n{\n\treturn m_sweep.c;\n}\n\ninline const b2Vec2& b2Body::GetLocalCenter() const\n{\n\treturn m_sweep.localCenter;\n}\n\ninline void b2Body::SetLinearVelocity(const b2Vec2& v)\n{\n\tif (m_type == b2_staticBody)\n\t{\n\t\treturn;\n\t}\n\n\tif (b2Dot(v,v) > 0.0f)\n\t{\n\t\tSetAwake(true);\n\t}\n\n\tm_linearVelocity = v;\n}\n\ninline const b2Vec2& b2Body::GetLinearVelocity() const\n{\n\treturn m_linearVelocity;\n}\n\ninline void b2Body::SetAngularVelocity(float32 w)\n{\n\tif (m_type == b2_staticBody)\n\t{\n\t\treturn;\n\t}\n\n\tif (w * w > 0.0f)\n\t{\n\t\tSetAwake(true);\n\t}\n\n\tm_angularVelocity = w;\n}\n\ninline float32 b2Body::GetAngularVelocity() const\n{\n\treturn m_angularVelocity;\n}\n\ninline float32 b2Body::GetMass() const\n{\n\treturn m_mass;\n}\n\ninline float32 b2Body::GetInertia() const\n{\n\treturn m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);\n}\n\ninline void b2Body::GetMassData(b2MassData* data) const\n{\n\tdata->mass = m_mass;\n\tdata->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter);\n\tdata->center = m_sweep.localCenter;\n}\n\ninline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const\n{\n\treturn b2Mul(m_xf, localPoint);\n}\n\ninline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const\n{\n\treturn b2Mul(m_xf.q, localVector);\n}\n\ninline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const\n{\n\treturn b2MulT(m_xf, worldPoint);\n}\n\ninline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const\n{\n\treturn b2MulT(m_xf.q, worldVector);\n}\n\ninline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const\n{\n\treturn m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c);\n}\n\ninline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const\n{\n\treturn GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint));\n}\n\ninline float32 b2Body::GetLinearDamping() const\n{\n\treturn m_linearDamping;\n}\n\ninline void b2Body::SetLinearDamping(float32 linearDamping)\n{\n\tm_linearDamping = linearDamping;\n}\n\ninline float32 b2Body::GetAngularDamping() const\n{\n\treturn m_angularDamping;\n}\n\ninline void b2Body::SetAngularDamping(float32 angularDamping)\n{\n\tm_angularDamping = angularDamping;\n}\n\ninline float32 b2Body::GetGravityScale() const\n{\n\treturn m_gravityScale;\n}\n\ninline void b2Body::SetGravityScale(float32 scale)\n{\n\tm_gravityScale = scale;\n}\n\ninline void b2Body::SetBullet(bool flag)\n{\n\tif (flag)\n\t{\n\t\tm_flags |= e_bulletFlag;\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_bulletFlag;\n\t}\n}\n\ninline bool b2Body::IsBullet() const\n{\n\treturn (m_flags & e_bulletFlag) == e_bulletFlag;\n}\n\ninline void b2Body::SetAwake(bool flag)\n{\n\tif (flag)\n\t{\n\t\tif ((m_flags & e_awakeFlag) == 0)\n\t\t{\n\t\t\tm_flags |= e_awakeFlag;\n\t\t\tm_sleepTime = 0.0f;\n\t\t}\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_awakeFlag;\n\t\tm_sleepTime = 0.0f;\n\t\tm_linearVelocity.SetZero();\n\t\tm_angularVelocity = 0.0f;\n\t\tm_force.SetZero();\n\t\tm_torque = 0.0f;\n\t}\n}\n\ninline bool b2Body::IsAwake() const\n{\n\treturn (m_flags & e_awakeFlag) == e_awakeFlag;\n}\n\ninline bool b2Body::IsActive() const\n{\n\treturn (m_flags & e_activeFlag) == e_activeFlag;\n}\n\ninline bool b2Body::IsFixedRotation() const\n{\n\treturn (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag;\n}\n\ninline void b2Body::SetSleepingAllowed(bool flag)\n{\n\tif (flag)\n\t{\n\t\tm_flags |= e_autoSleepFlag;\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_autoSleepFlag;\n\t\tSetAwake(true);\n\t}\n}\n\ninline bool b2Body::IsSleepingAllowed() const\n{\n\treturn (m_flags & e_autoSleepFlag) == e_autoSleepFlag;\n}\n\ninline b2Fixture* b2Body::GetFixtureList()\n{\n\treturn m_fixtureList;\n}\n\ninline const b2Fixture* b2Body::GetFixtureList() const\n{\n\treturn m_fixtureList;\n}\n\ninline b2JointEdge* b2Body::GetJointList()\n{\n\treturn m_jointList;\n}\n\ninline const b2JointEdge* b2Body::GetJointList() const\n{\n\treturn m_jointList;\n}\n\ninline b2ContactEdge* b2Body::GetContactList()\n{\n\treturn m_contactList;\n}\n\ninline const b2ContactEdge* b2Body::GetContactList() const\n{\n\treturn m_contactList;\n}\n\ninline b2Body* b2Body::GetNext()\n{\n\treturn m_next;\n}\n\ninline const b2Body* b2Body::GetNext() const\n{\n\treturn m_next;\n}\n\ninline void b2Body::SetUserData(void* data)\n{\n\tm_userData = data;\n}\n\ninline void* b2Body::GetUserData() const\n{\n\treturn m_userData;\n}\n\ninline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake)\n{\n\tif (m_type != b2_dynamicBody)\n\t{\n\t\treturn;\n\t}\n\n\tif (wake && (m_flags & e_awakeFlag) == 0)\n\t{\n\t\tSetAwake(true);\n\t}\n\n\t// Don't accumulate a force if the body is sleeping.\n\tif (m_flags & e_awakeFlag)\n\t{\n\t\tm_force += force;\n\t\tm_torque += b2Cross(point - m_sweep.c, force);\n\t}\n}\n\ninline void b2Body::ApplyForceToCenter(const b2Vec2& force, bool wake)\n{\n\tif (m_type != b2_dynamicBody)\n\t{\n\t\treturn;\n\t}\n\n\tif (wake && (m_flags & e_awakeFlag) == 0)\n\t{\n\t\tSetAwake(true);\n\t}\n\n\t// Don't accumulate a force if the body is sleeping\n\tif (m_flags & e_awakeFlag)\n\t{\n\t\tm_force += force;\n\t}\n}\n\ninline void b2Body::ApplyTorque(float32 torque, bool wake)\n{\n\tif (m_type != b2_dynamicBody)\n\t{\n\t\treturn;\n\t}\n\n\tif (wake && (m_flags & e_awakeFlag) == 0)\n\t{\n\t\tSetAwake(true);\n\t}\n\n\t// Don't accumulate a force if the body is sleeping\n\tif (m_flags & e_awakeFlag)\n\t{\n\t\tm_torque += torque;\n\t}\n}\n\ninline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point, bool wake)\n{\n\tif (m_type != b2_dynamicBody)\n\t{\n\t\treturn;\n\t}\n\n\tif (wake && (m_flags & e_awakeFlag) == 0)\n\t{\n\t\tSetAwake(true);\n\t}\n\n\t// Don't accumulate velocity if the body is sleeping\n\tif (m_flags & e_awakeFlag)\n\t{\n\t\tm_linearVelocity += m_invMass * impulse;\n\t\tm_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse);\n\t}\n}\n\ninline void b2Body::ApplyAngularImpulse(float32 impulse, bool wake)\n{\n\tif (m_type != b2_dynamicBody)\n\t{\n\t\treturn;\n\t}\n\n\tif (wake && (m_flags & e_awakeFlag) == 0)\n\t{\n\t\tSetAwake(true);\n\t}\n\n\t// Don't accumulate velocity if the body is sleeping\n\tif (m_flags & e_awakeFlag)\n\t{\n\t\tm_angularVelocity += m_invI * impulse;\n\t}\n}\n\ninline void b2Body::SynchronizeTransform()\n{\n\tm_xf.q.Set(m_sweep.a);\n\tm_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter);\n}\n\ninline void b2Body::Advance(float32 alpha)\n{\n\t// Advance to the new safe time. This doesn't sync the broad-phase.\n\tm_sweep.Advance(alpha);\n\tm_sweep.c = m_sweep.c0;\n\tm_sweep.a = m_sweep.a0;\n\tm_xf.q.Set(m_sweep.a);\n\tm_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter);\n}\n\ninline b2World* b2Body::GetWorld()\n{\n\treturn m_world;\n}\n\ninline const b2World* b2Body::GetWorld() const\n{\n\treturn m_world;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2ContactManager.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/b2ContactManager.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2WorldCallbacks.h>\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n\nb2ContactFilter b2_defaultFilter;\nb2ContactListener b2_defaultListener;\n\nb2ContactManager::b2ContactManager()\n{\n\tm_contactList = NULL;\n\tm_contactCount = 0;\n\tm_contactFilter = &b2_defaultFilter;\n\tm_contactListener = &b2_defaultListener;\n\tm_allocator = NULL;\n}\n\nvoid b2ContactManager::Destroy(b2Contact* c)\n{\n\tb2Fixture* fixtureA = c->GetFixtureA();\n\tb2Fixture* fixtureB = c->GetFixtureB();\n\tb2Body* bodyA = fixtureA->GetBody();\n\tb2Body* bodyB = fixtureB->GetBody();\n\n\tif (m_contactListener && c->IsTouching())\n\t{\n\t\tm_contactListener->EndContact(c);\n\t}\n\n\t// Remove from the world.\n\tif (c->m_prev)\n\t{\n\t\tc->m_prev->m_next = c->m_next;\n\t}\n\n\tif (c->m_next)\n\t{\n\t\tc->m_next->m_prev = c->m_prev;\n\t}\n\n\tif (c == m_contactList)\n\t{\n\t\tm_contactList = c->m_next;\n\t}\n\n\t// Remove from body 1\n\tif (c->m_nodeA.prev)\n\t{\n\t\tc->m_nodeA.prev->next = c->m_nodeA.next;\n\t}\n\n\tif (c->m_nodeA.next)\n\t{\n\t\tc->m_nodeA.next->prev = c->m_nodeA.prev;\n\t}\n\n\tif (&c->m_nodeA == bodyA->m_contactList)\n\t{\n\t\tbodyA->m_contactList = c->m_nodeA.next;\n\t}\n\n\t// Remove from body 2\n\tif (c->m_nodeB.prev)\n\t{\n\t\tc->m_nodeB.prev->next = c->m_nodeB.next;\n\t}\n\n\tif (c->m_nodeB.next)\n\t{\n\t\tc->m_nodeB.next->prev = c->m_nodeB.prev;\n\t}\n\n\tif (&c->m_nodeB == bodyB->m_contactList)\n\t{\n\t\tbodyB->m_contactList = c->m_nodeB.next;\n\t}\n\n\t// Call the factory.\n\tb2Contact::Destroy(c, m_allocator);\n\t--m_contactCount;\n}\n\n// This is the top level collision call for the time step. Here\n// all the narrow phase collision is processed for the world\n// contact list.\nvoid b2ContactManager::Collide()\n{\n\t// Update awake contacts.\n\tb2Contact* c = m_contactList;\n\twhile (c)\n\t{\n\t\tb2Fixture* fixtureA = c->GetFixtureA();\n\t\tb2Fixture* fixtureB = c->GetFixtureB();\n\t\tint32 indexA = c->GetChildIndexA();\n\t\tint32 indexB = c->GetChildIndexB();\n\t\tb2Body* bodyA = fixtureA->GetBody();\n\t\tb2Body* bodyB = fixtureB->GetBody();\n\t\t \n\t\t// Is this contact flagged for filtering?\n\t\tif (c->m_flags & b2Contact::e_filterFlag)\n\t\t{\n\t\t\t// Should these bodies collide?\n\t\t\tif (bodyB->ShouldCollide(bodyA) == false)\n\t\t\t{\n\t\t\t\tb2Contact* cNuke = c;\n\t\t\t\tc = cNuke->GetNext();\n\t\t\t\tDestroy(cNuke);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check user filtering.\n\t\t\tif (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false)\n\t\t\t{\n\t\t\t\tb2Contact* cNuke = c;\n\t\t\t\tc = cNuke->GetNext();\n\t\t\t\tDestroy(cNuke);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Clear the filtering flag.\n\t\t\tc->m_flags &= ~b2Contact::e_filterFlag;\n\t\t}\n\n\t\tbool activeA = bodyA->IsAwake() && bodyA->m_type != b2_staticBody;\n\t\tbool activeB = bodyB->IsAwake() && bodyB->m_type != b2_staticBody;\n\n\t\t// At least one body must be awake and it must be dynamic or kinematic.\n\t\tif (activeA == false && activeB == false)\n\t\t{\n\t\t\tc = c->GetNext();\n\t\t\tcontinue;\n\t\t}\n\n\t\tint32 proxyIdA = fixtureA->m_proxies[indexA].proxyId;\n\t\tint32 proxyIdB = fixtureB->m_proxies[indexB].proxyId;\n\t\tbool overlap = m_broadPhase.TestOverlap(proxyIdA, proxyIdB);\n\n\t\t// Here we destroy contacts that cease to overlap in the broad-phase.\n\t\tif (overlap == false)\n\t\t{\n\t\t\tb2Contact* cNuke = c;\n\t\t\tc = cNuke->GetNext();\n\t\t\tDestroy(cNuke);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// The contact persists.\n\t\tc->Update(m_contactListener);\n\t\tc = c->GetNext();\n\t}\n}\n\nvoid b2ContactManager::FindNewContacts()\n{\n\tm_broadPhase.UpdatePairs(this);\n}\n\nvoid b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB)\n{\n\tb2FixtureProxy* proxyA = (b2FixtureProxy*)proxyUserDataA;\n\tb2FixtureProxy* proxyB = (b2FixtureProxy*)proxyUserDataB;\n\n\tb2Fixture* fixtureA = proxyA->fixture;\n\tb2Fixture* fixtureB = proxyB->fixture;\n\n\tint32 indexA = proxyA->childIndex;\n\tint32 indexB = proxyB->childIndex;\n\n\tb2Body* bodyA = fixtureA->GetBody();\n\tb2Body* bodyB = fixtureB->GetBody();\n\n\t// Are the fixtures on the same body?\n\tif (bodyA == bodyB)\n\t{\n\t\treturn;\n\t}\n\n\t// TODO_ERIN use a hash table to remove a potential bottleneck when both\n\t// bodies have a lot of contacts.\n\t// Does a contact already exist?\n\tb2ContactEdge* edge = bodyB->GetContactList();\n\twhile (edge)\n\t{\n\t\tif (edge->other == bodyA)\n\t\t{\n\t\t\tb2Fixture* fA = edge->contact->GetFixtureA();\n\t\t\tb2Fixture* fB = edge->contact->GetFixtureB();\n\t\t\tint32 iA = edge->contact->GetChildIndexA();\n\t\t\tint32 iB = edge->contact->GetChildIndexB();\n\n\t\t\tif (fA == fixtureA && fB == fixtureB && iA == indexA && iB == indexB)\n\t\t\t{\n\t\t\t\t// A contact already exists.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (fA == fixtureB && fB == fixtureA && iA == indexB && iB == indexA)\n\t\t\t{\n\t\t\t\t// A contact already exists.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tedge = edge->next;\n\t}\n\n\t// Does a joint override collision? Is at least one body dynamic?\n\tif (bodyB->ShouldCollide(bodyA) == false)\n\t{\n\t\treturn;\n\t}\n\n\t// Check user filtering.\n\tif (m_contactFilter && m_contactFilter->ShouldCollide(fixtureA, fixtureB) == false)\n\t{\n\t\treturn;\n\t}\n\n\t// Call the factory.\n\tb2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator);\n\tif (c == NULL)\n\t{\n\t\treturn;\n\t}\n\n\t// Contact creation may swap fixtures.\n\tfixtureA = c->GetFixtureA();\n\tfixtureB = c->GetFixtureB();\n\tindexA = c->GetChildIndexA();\n\tindexB = c->GetChildIndexB();\n\tbodyA = fixtureA->GetBody();\n\tbodyB = fixtureB->GetBody();\n\n\t// Insert into the world.\n\tc->m_prev = NULL;\n\tc->m_next = m_contactList;\n\tif (m_contactList != NULL)\n\t{\n\t\tm_contactList->m_prev = c;\n\t}\n\tm_contactList = c;\n\n\t// Connect to island graph.\n\n\t// Connect to body A\n\tc->m_nodeA.contact = c;\n\tc->m_nodeA.other = bodyB;\n\n\tc->m_nodeA.prev = NULL;\n\tc->m_nodeA.next = bodyA->m_contactList;\n\tif (bodyA->m_contactList != NULL)\n\t{\n\t\tbodyA->m_contactList->prev = &c->m_nodeA;\n\t}\n\tbodyA->m_contactList = &c->m_nodeA;\n\n\t// Connect to body B\n\tc->m_nodeB.contact = c;\n\tc->m_nodeB.other = bodyA;\n\n\tc->m_nodeB.prev = NULL;\n\tc->m_nodeB.next = bodyB->m_contactList;\n\tif (bodyB->m_contactList != NULL)\n\t{\n\t\tbodyB->m_contactList->prev = &c->m_nodeB;\n\t}\n\tbodyB->m_contactList = &c->m_nodeB;\n\n\t// Wake up the bodies\n\tif (fixtureA->IsSensor() == false && fixtureB->IsSensor() == false)\n\t{\n\t\tbodyA->SetAwake(true);\n\t\tbodyB->SetAwake(true);\n\t}\n\n\t++m_contactCount;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2ContactManager.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_CONTACT_MANAGER_H\n#define B2_CONTACT_MANAGER_H\n\n#include <Box2D/Collision/b2BroadPhase.h>\n\nclass b2Contact;\nclass b2ContactFilter;\nclass b2ContactListener;\nclass b2BlockAllocator;\n\n// Delegate of b2World.\nclass b2ContactManager\n{\npublic:\n\tb2ContactManager();\n\n\t// Broad-phase callback.\n\tvoid AddPair(void* proxyUserDataA, void* proxyUserDataB);\n\n\tvoid FindNewContacts();\n\n\tvoid Destroy(b2Contact* c);\n\n\tvoid Collide();\n            \n\tb2BroadPhase m_broadPhase;\n\tb2Contact* m_contactList;\n\tint32 m_contactCount;\n\tb2ContactFilter* m_contactFilter;\n\tb2ContactListener* m_contactListener;\n\tb2BlockAllocator* m_allocator;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2Fixture.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n#include <Box2D/Dynamics/b2World.h>\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n#include <Box2D/Collision/Shapes/b2ChainShape.h>\n#include <Box2D/Collision/b2BroadPhase.h>\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n\nb2Fixture::b2Fixture()\n{\n\tm_userData = NULL;\n\tm_body = NULL;\n\tm_next = NULL;\n\tm_proxies = NULL;\n\tm_proxyCount = 0;\n\tm_shape = NULL;\n\tm_density = 0.0f;\n}\n\nvoid b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def)\n{\n\tm_userData = def->userData;\n\tm_friction = def->friction;\n\tm_restitution = def->restitution;\n\n\tm_body = body;\n\tm_next = NULL;\n\n\tm_filter = def->filter;\n\n\tm_isSensor = def->isSensor;\n\n\tm_shape = def->shape->Clone(allocator);\n\n\t// Reserve proxy space\n\tint32 childCount = m_shape->GetChildCount();\n\tm_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy));\n\tfor (int32 i = 0; i < childCount; ++i)\n\t{\n\t\tm_proxies[i].fixture = NULL;\n\t\tm_proxies[i].proxyId = b2BroadPhase::e_nullProxy;\n\t}\n\tm_proxyCount = 0;\n\n\tm_density = def->density;\n}\n\nvoid b2Fixture::Destroy(b2BlockAllocator* allocator)\n{\n\t// The proxies must be destroyed before calling this.\n\tb2Assert(m_proxyCount == 0);\n\n\t// Free the proxy array.\n\tint32 childCount = m_shape->GetChildCount();\n\tallocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy));\n\tm_proxies = NULL;\n\n\t// Free the child shape.\n\tswitch (m_shape->m_type)\n\t{\n\tcase b2Shape::e_circle:\n\t\t{\n\t\t\tb2CircleShape* s = (b2CircleShape*)m_shape;\n\t\t\ts->~b2CircleShape();\n\t\t\tallocator->Free(s, sizeof(b2CircleShape));\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_edge:\n\t\t{\n\t\t\tb2EdgeShape* s = (b2EdgeShape*)m_shape;\n\t\t\ts->~b2EdgeShape();\n\t\t\tallocator->Free(s, sizeof(b2EdgeShape));\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_polygon:\n\t\t{\n\t\t\tb2PolygonShape* s = (b2PolygonShape*)m_shape;\n\t\t\ts->~b2PolygonShape();\n\t\t\tallocator->Free(s, sizeof(b2PolygonShape));\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_chain:\n\t\t{\n\t\t\tb2ChainShape* s = (b2ChainShape*)m_shape;\n\t\t\ts->~b2ChainShape();\n\t\t\tallocator->Free(s, sizeof(b2ChainShape));\n\t\t}\n\t\tbreak;\n\n\tdefault:\n\t\tb2Assert(false);\n\t\tbreak;\n\t}\n\n\tm_shape = NULL;\n}\n\nvoid b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf)\n{\n\tb2Assert(m_proxyCount == 0);\n\n\t// Create proxies in the broad-phase.\n\tm_proxyCount = m_shape->GetChildCount();\n\n\tfor (int32 i = 0; i < m_proxyCount; ++i)\n\t{\n\t\tb2FixtureProxy* proxy = m_proxies + i;\n\t\tm_shape->ComputeAABB(&proxy->aabb, xf, i);\n\t\tproxy->proxyId = broadPhase->CreateProxy(proxy->aabb, proxy);\n\t\tproxy->fixture = this;\n\t\tproxy->childIndex = i;\n\t}\n}\n\nvoid b2Fixture::DestroyProxies(b2BroadPhase* broadPhase)\n{\n\t// Destroy proxies in the broad-phase.\n\tfor (int32 i = 0; i < m_proxyCount; ++i)\n\t{\n\t\tb2FixtureProxy* proxy = m_proxies + i;\n\t\tbroadPhase->DestroyProxy(proxy->proxyId);\n\t\tproxy->proxyId = b2BroadPhase::e_nullProxy;\n\t}\n\n\tm_proxyCount = 0;\n}\n\nvoid b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2)\n{\n\tif (m_proxyCount == 0)\n\t{\t\n\t\treturn;\n\t}\n\n\tfor (int32 i = 0; i < m_proxyCount; ++i)\n\t{\n\t\tb2FixtureProxy* proxy = m_proxies + i;\n\n\t\t// Compute an AABB that covers the swept shape (may miss some rotation effect).\n\t\tb2AABB aabb1, aabb2;\n\t\tm_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex);\n\t\tm_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex);\n\t\n\t\tproxy->aabb.Combine(aabb1, aabb2);\n\n\t\tb2Vec2 displacement = transform2.p - transform1.p;\n\n\t\tbroadPhase->MoveProxy(proxy->proxyId, proxy->aabb, displacement);\n\t}\n}\n\nvoid b2Fixture::SetFilterData(const b2Filter& filter)\n{\n\tm_filter = filter;\n\n\tRefilter();\n}\n\nvoid b2Fixture::Refilter()\n{\n\tif (m_body == NULL)\n\t{\n\t\treturn;\n\t}\n\n\t// Flag associated contacts for filtering.\n\tb2ContactEdge* edge = m_body->GetContactList();\n\twhile (edge)\n\t{\n\t\tb2Contact* contact = edge->contact;\n\t\tb2Fixture* fixtureA = contact->GetFixtureA();\n\t\tb2Fixture* fixtureB = contact->GetFixtureB();\n\t\tif (fixtureA == this || fixtureB == this)\n\t\t{\n\t\t\tcontact->FlagForFiltering();\n\t\t}\n\n\t\tedge = edge->next;\n\t}\n\n\tb2World* world = m_body->GetWorld();\n\n\tif (world == NULL)\n\t{\n\t\treturn;\n\t}\n\n\t// Touch each proxy so that new pairs may be created\n\tb2BroadPhase* broadPhase = &world->m_contactManager.m_broadPhase;\n\tfor (int32 i = 0; i < m_proxyCount; ++i)\n\t{\n\t\tbroadPhase->TouchProxy(m_proxies[i].proxyId);\n\t}\n}\n\nvoid b2Fixture::SetSensor(bool sensor)\n{\n\tif (sensor != m_isSensor)\n\t{\n\t\tm_body->SetAwake(true);\n\t\tm_isSensor = sensor;\n\t}\n}\n\nvoid b2Fixture::Dump(int32 bodyIndex)\n{\n\tb2Log(\"    b2FixtureDef fd;\\n\");\n\tb2Log(\"    fd.friction = %.15lef;\\n\", m_friction);\n\tb2Log(\"    fd.restitution = %.15lef;\\n\", m_restitution);\n\tb2Log(\"    fd.density = %.15lef;\\n\", m_density);\n\tb2Log(\"    fd.isSensor = bool(%d);\\n\", m_isSensor);\n\tb2Log(\"    fd.filter.categoryBits = uint16(%d);\\n\", m_filter.categoryBits);\n\tb2Log(\"    fd.filter.maskBits = uint16(%d);\\n\", m_filter.maskBits);\n\tb2Log(\"    fd.filter.groupIndex = int16(%d);\\n\", m_filter.groupIndex);\n\n\tswitch (m_shape->m_type)\n\t{\n\tcase b2Shape::e_circle:\n\t\t{\n\t\t\tb2CircleShape* s = (b2CircleShape*)m_shape;\n\t\t\tb2Log(\"    b2CircleShape shape;\\n\");\n\t\t\tb2Log(\"    shape.m_radius = %.15lef;\\n\", s->m_radius);\n\t\t\tb2Log(\"    shape.m_p.Set(%.15lef, %.15lef);\\n\", s->m_p.x, s->m_p.y);\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_edge:\n\t\t{\n\t\t\tb2EdgeShape* s = (b2EdgeShape*)m_shape;\n\t\t\tb2Log(\"    b2EdgeShape shape;\\n\");\n\t\t\tb2Log(\"    shape.m_radius = %.15lef;\\n\", s->m_radius);\n\t\t\tb2Log(\"    shape.m_vertex0.Set(%.15lef, %.15lef);\\n\", s->m_vertex0.x, s->m_vertex0.y);\n\t\t\tb2Log(\"    shape.m_vertex1.Set(%.15lef, %.15lef);\\n\", s->m_vertex1.x, s->m_vertex1.y);\n\t\t\tb2Log(\"    shape.m_vertex2.Set(%.15lef, %.15lef);\\n\", s->m_vertex2.x, s->m_vertex2.y);\n\t\t\tb2Log(\"    shape.m_vertex3.Set(%.15lef, %.15lef);\\n\", s->m_vertex3.x, s->m_vertex3.y);\n\t\t\tb2Log(\"    shape.m_hasVertex0 = bool(%d);\\n\", s->m_hasVertex0);\n\t\t\tb2Log(\"    shape.m_hasVertex3 = bool(%d);\\n\", s->m_hasVertex3);\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_polygon:\n\t\t{\n\t\t\tb2PolygonShape* s = (b2PolygonShape*)m_shape;\n\t\t\tb2Log(\"    b2PolygonShape shape;\\n\");\n\t\t\tb2Log(\"    b2Vec2 vs[%d];\\n\", b2_maxPolygonVertices);\n\t\t\tfor (int32 i = 0; i < s->m_count; ++i)\n\t\t\t{\n\t\t\t\tb2Log(\"    vs[%d].Set(%.15lef, %.15lef);\\n\", i, s->m_vertices[i].x, s->m_vertices[i].y);\n\t\t\t}\n\t\t\tb2Log(\"    shape.Set(vs, %d);\\n\", s->m_count);\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_chain:\n\t\t{\n\t\t\tb2ChainShape* s = (b2ChainShape*)m_shape;\n\t\t\tb2Log(\"    b2ChainShape shape;\\n\");\n\t\t\tb2Log(\"    b2Vec2 vs[%d];\\n\", s->m_count);\n\t\t\tfor (int32 i = 0; i < s->m_count; ++i)\n\t\t\t{\n\t\t\t\tb2Log(\"    vs[%d].Set(%.15lef, %.15lef);\\n\", i, s->m_vertices[i].x, s->m_vertices[i].y);\n\t\t\t}\n\t\t\tb2Log(\"    shape.CreateChain(vs, %d);\\n\", s->m_count);\n\t\t\tb2Log(\"    shape.m_prevVertex.Set(%.15lef, %.15lef);\\n\", s->m_prevVertex.x, s->m_prevVertex.y);\n\t\t\tb2Log(\"    shape.m_nextVertex.Set(%.15lef, %.15lef);\\n\", s->m_nextVertex.x, s->m_nextVertex.y);\n\t\t\tb2Log(\"    shape.m_hasPrevVertex = bool(%d);\\n\", s->m_hasPrevVertex);\n\t\t\tb2Log(\"    shape.m_hasNextVertex = bool(%d);\\n\", s->m_hasNextVertex);\n\t\t}\n\t\tbreak;\n\n\tdefault:\n\t\treturn;\n\t}\n\n\tb2Log(\"\\n\");\n\tb2Log(\"    fd.shape = &shape;\\n\");\n\tb2Log(\"\\n\");\n\tb2Log(\"    bodies[%d]->CreateFixture(&fd);\\n\", bodyIndex);\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2Fixture.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_FIXTURE_H\n#define B2_FIXTURE_H\n\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/Shapes/b2Shape.h>\n\nclass b2BlockAllocator;\nclass b2Body;\nclass b2BroadPhase;\nclass b2Fixture;\n\n/// This holds contact filtering data.\nstruct b2Filter\n{\n\tb2Filter()\n\t{\n\t\tcategoryBits = 0x0001;\n\t\tmaskBits = 0xFFFF;\n\t\tgroupIndex = 0;\n\t}\n\n\t/// The collision category bits. Normally you would just set one bit.\n\tuint16 categoryBits;\n\n\t/// The collision mask bits. This states the categories that this\n\t/// shape would accept for collision.\n\tuint16 maskBits;\n\n\t/// Collision groups allow a certain group of objects to never collide (negative)\n\t/// or always collide (positive). Zero means no collision group. Non-zero group\n\t/// filtering always wins against the mask bits.\n\tint16 groupIndex;\n};\n\n/// A fixture definition is used to create a fixture. This class defines an\n/// abstract fixture definition. You can reuse fixture definitions safely.\nstruct b2FixtureDef\n{\n\t/// The constructor sets the default fixture definition values.\n\tb2FixtureDef()\n\t{\n\t\tshape = NULL;\n\t\tuserData = NULL;\n\t\tfriction = 0.2f;\n\t\trestitution = 0.0f;\n\t\tdensity = 0.0f;\n\t\tisSensor = false;\n\t}\n\n\t/// The shape, this must be set. The shape will be cloned, so you\n\t/// can create the shape on the stack.\n\tconst b2Shape* shape;\n\n\t/// Use this to store application specific fixture data.\n\tvoid* userData;\n\n\t/// The friction coefficient, usually in the range [0,1].\n\tfloat32 friction;\n\n\t/// The restitution (elasticity) usually in the range [0,1].\n\tfloat32 restitution;\n\n\t/// The density, usually in kg/m^2.\n\tfloat32 density;\n\n\t/// A sensor shape collects contact information but never generates a collision\n\t/// response.\n\tbool isSensor;\n\n\t/// Contact filtering data.\n\tb2Filter filter;\n};\n\n/// This proxy is used internally to connect fixtures to the broad-phase.\nstruct b2FixtureProxy\n{\n\tb2AABB aabb;\n\tb2Fixture* fixture;\n\tint32 childIndex;\n\tint32 proxyId;\n};\n\n/// A fixture is used to attach a shape to a body for collision detection. A fixture\n/// inherits its transform from its parent. Fixtures hold additional non-geometric data\n/// such as friction, collision filters, etc.\n/// Fixtures are created via b2Body::CreateFixture.\n/// @warning you cannot reuse fixtures.\nclass b2Fixture\n{\npublic:\n\t/// Get the type of the child shape. You can use this to down cast to the concrete shape.\n\t/// @return the shape type.\n\tb2Shape::Type GetType() const;\n\n\t/// Get the child shape. You can modify the child shape, however you should not change the\n\t/// number of vertices because this will crash some collision caching mechanisms.\n\t/// Manipulating the shape may lead to non-physical behavior.\n\tb2Shape* GetShape();\n\tconst b2Shape* GetShape() const;\n\n\t/// Set if this fixture is a sensor.\n\tvoid SetSensor(bool sensor);\n\n\t/// Is this fixture a sensor (non-solid)?\n\t/// @return the true if the shape is a sensor.\n\tbool IsSensor() const;\n\n\t/// Set the contact filtering data. This will not update contacts until the next time\n\t/// step when either parent body is active and awake.\n\t/// This automatically calls Refilter.\n\tvoid SetFilterData(const b2Filter& filter);\n\n\t/// Get the contact filtering data.\n\tconst b2Filter& GetFilterData() const;\n\n\t/// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide.\n\tvoid Refilter();\n\n\t/// Get the parent body of this fixture. This is NULL if the fixture is not attached.\n\t/// @return the parent body.\n\tb2Body* GetBody();\n\tconst b2Body* GetBody() const;\n\n\t/// Get the next fixture in the parent body's fixture list.\n\t/// @return the next shape.\n\tb2Fixture* GetNext();\n\tconst b2Fixture* GetNext() const;\n\n\t/// Get the user data that was assigned in the fixture definition. Use this to\n\t/// store your application specific data.\n\tvoid* GetUserData() const;\n\n\t/// Set the user data. Use this to store your application specific data.\n\tvoid SetUserData(void* data);\n\n\t/// Test a point for containment in this fixture.\n\t/// @param p a point in world coordinates.\n\tbool TestPoint(const b2Vec2& p) const;\n\n\t/// Cast a ray against this shape.\n\t/// @param output the ray-cast results.\n\t/// @param input the ray-cast input parameters.\n\tbool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const;\n\n\t/// Get the mass data for this fixture. The mass data is based on the density and\n\t/// the shape. The rotational inertia is about the shape's origin. This operation\n\t/// may be expensive.\n\tvoid GetMassData(b2MassData* massData) const;\n\n\t/// Set the density of this fixture. This will _not_ automatically adjust the mass\n\t/// of the body. You must call b2Body::ResetMassData to update the body's mass.\n\tvoid SetDensity(float32 density);\n\n\t/// Get the density of this fixture.\n\tfloat32 GetDensity() const;\n\n\t/// Get the coefficient of friction.\n\tfloat32 GetFriction() const;\n\n\t/// Set the coefficient of friction. This will _not_ change the friction of\n\t/// existing contacts.\n\tvoid SetFriction(float32 friction);\n\n\t/// Get the coefficient of restitution.\n\tfloat32 GetRestitution() const;\n\n\t/// Set the coefficient of restitution. This will _not_ change the restitution of\n\t/// existing contacts.\n\tvoid SetRestitution(float32 restitution);\n\n\t/// Get the fixture's AABB. This AABB may be enlarge and/or stale.\n\t/// If you need a more accurate AABB, compute it using the shape and\n\t/// the body transform.\n\tconst b2AABB& GetAABB(int32 childIndex) const;\n\n\t/// Dump this fixture to the log file.\n\tvoid Dump(int32 bodyIndex);\n\nprotected:\n\n\tfriend class b2Body;\n\tfriend class b2World;\n\tfriend class b2Contact;\n\tfriend class b2ContactManager;\n\n\tb2Fixture();\n\n\t// We need separation create/destroy functions from the constructor/destructor because\n\t// the destructor cannot access the allocator (no destructor arguments allowed by C++).\n\tvoid Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def);\n\tvoid Destroy(b2BlockAllocator* allocator);\n\n\t// These support body activation/deactivation.\n\tvoid CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf);\n\tvoid DestroyProxies(b2BroadPhase* broadPhase);\n\n\tvoid Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2);\n\n\tfloat32 m_density;\n\n\tb2Fixture* m_next;\n\tb2Body* m_body;\n\n\tb2Shape* m_shape;\n\n\tfloat32 m_friction;\n\tfloat32 m_restitution;\n\n\tb2FixtureProxy* m_proxies;\n\tint32 m_proxyCount;\n\n\tb2Filter m_filter;\n\n\tbool m_isSensor;\n\n\tvoid* m_userData;\n};\n\ninline b2Shape::Type b2Fixture::GetType() const\n{\n\treturn m_shape->GetType();\n}\n\ninline b2Shape* b2Fixture::GetShape()\n{\n\treturn m_shape;\n}\n\ninline const b2Shape* b2Fixture::GetShape() const\n{\n\treturn m_shape;\n}\n\ninline bool b2Fixture::IsSensor() const\n{\n\treturn m_isSensor;\n}\n\ninline const b2Filter& b2Fixture::GetFilterData() const\n{\n\treturn m_filter;\n}\n\ninline void* b2Fixture::GetUserData() const\n{\n\treturn m_userData;\n}\n\ninline void b2Fixture::SetUserData(void* data)\n{\n\tm_userData = data;\n}\n\ninline b2Body* b2Fixture::GetBody()\n{\n\treturn m_body;\n}\n\ninline const b2Body* b2Fixture::GetBody() const\n{\n\treturn m_body;\n}\n\ninline b2Fixture* b2Fixture::GetNext()\n{\n\treturn m_next;\n}\n\ninline const b2Fixture* b2Fixture::GetNext() const\n{\n\treturn m_next;\n}\n\ninline void b2Fixture::SetDensity(float32 density)\n{\n\tb2Assert(b2IsValid(density) && density >= 0.0f);\n\tm_density = density;\n}\n\ninline float32 b2Fixture::GetDensity() const\n{\n\treturn m_density;\n}\n\ninline float32 b2Fixture::GetFriction() const\n{\n\treturn m_friction;\n}\n\ninline void b2Fixture::SetFriction(float32 friction)\n{\n\tm_friction = friction;\n}\n\ninline float32 b2Fixture::GetRestitution() const\n{\n\treturn m_restitution;\n}\n\ninline void b2Fixture::SetRestitution(float32 restitution)\n{\n\tm_restitution = restitution;\n}\n\ninline bool b2Fixture::TestPoint(const b2Vec2& p) const\n{\n\treturn m_shape->TestPoint(m_body->GetTransform(), p);\n}\n\ninline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const\n{\n\treturn m_shape->RayCast(output, input, m_body->GetTransform(), childIndex);\n}\n\ninline void b2Fixture::GetMassData(b2MassData* massData) const\n{\n\tm_shape->ComputeMass(massData, m_density);\n}\n\ninline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const\n{\n\tb2Assert(0 <= childIndex && childIndex < m_proxyCount);\n\treturn m_proxies[childIndex].aabb;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2Island.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Collision/b2Distance.h>\n#include <Box2D/Dynamics/b2Island.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2World.h>\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>\n#include <Box2D/Dynamics/Joints/b2Joint.h>\n#include <Box2D/Common/b2StackAllocator.h>\n#include <Box2D/Common/b2Timer.h>\n\n/*\nPosition Correction Notes\n=========================\nI tried the several algorithms for position correction of the 2D revolute joint.\nI looked at these systems:\n- simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s.\n- suspension bridge with 30 1m long planks of length 1m.\n- multi-link chain with 30 1m long links.\n\nHere are the algorithms:\n\nBaumgarte - A fraction of the position error is added to the velocity error. There is no\nseparate position solver.\n\nPseudo Velocities - After the velocity solver and position integration,\nthe position error, Jacobian, and effective mass are recomputed. Then\nthe velocity constraints are solved with pseudo velocities and a fraction\nof the position error is added to the pseudo velocity error. The pseudo\nvelocities are initialized to zero and there is no warm-starting. After\nthe position solver, the pseudo velocities are added to the positions.\nThis is also called the First Order World method or the Position LCP method.\n\nModified Nonlinear Gauss-Seidel (NGS) - Like Pseudo Velocities except the\nposition error is re-computed for each constraint and the positions are updated\nafter the constraint is solved. The radius vectors (aka Jacobians) are\nre-computed too (otherwise the algorithm has horrible instability). The pseudo\nvelocity states are not needed because they are effectively zero at the beginning\nof each iteration. Since we have the current position error, we allow the\niterations to terminate early if the error becomes smaller than b2_linearSlop.\n\nFull NGS or just NGS - Like Modified NGS except the effective mass are re-computed\neach time a constraint is solved.\n\nHere are the results:\nBaumgarte - this is the cheapest algorithm but it has some stability problems,\nespecially with the bridge. The chain links separate easily close to the root\nand they jitter as they struggle to pull together. This is one of the most common\nmethods in the field. The big drawback is that the position correction artificially\naffects the momentum, thus leading to instabilities and false bounce. I used a\nbias factor of 0.2. A larger bias factor makes the bridge less stable, a smaller\nfactor makes joints and contacts more spongy.\n\nPseudo Velocities - the is more stable than the Baumgarte method. The bridge is\nstable. However, joints still separate with large angular velocities. Drag the\nsimple pendulum in a circle quickly and the joint will separate. The chain separates\neasily and does not recover. I used a bias factor of 0.2. A larger value lead to\nthe bridge collapsing when a heavy cube drops on it.\n\nModified NGS - this algorithm is better in some ways than Baumgarte and Pseudo\nVelocities, but in other ways it is worse. The bridge and chain are much more\nstable, but the simple pendulum goes unstable at high angular velocities.\n\nFull NGS - stable in all tests. The joints display good stiffness. The bridge\nstill sags, but this is better than infinite forces.\n\nRecommendations\nPseudo Velocities are not really worthwhile because the bridge and chain cannot\nrecover from joint separation. In other cases the benefit over Baumgarte is small.\n\nModified NGS is not a robust method for the revolute joint due to the violent\ninstability seen in the simple pendulum. Perhaps it is viable with other constraint\ntypes, especially scalar constraints where the effective mass is a scalar.\n\nThis leaves Baumgarte and Full NGS. Baumgarte has small, but manageable instabilities\nand is very fast. I don't think we can escape Baumgarte, especially in highly\ndemanding cases where high constraint fidelity is not needed.\n\nFull NGS is robust and easy on the eyes. I recommend this as an option for\nhigher fidelity simulation and certainly for suspension bridges and long chains.\nFull NGS might be a good choice for ragdolls, especially motorized ragdolls where\njoint separation can be problematic. The number of NGS iterations can be reduced\nfor better performance without harming robustness much.\n\nEach joint in a can be handled differently in the position solver. So I recommend\na system where the user can select the algorithm on a per joint basis. I would\nprobably default to the slower Full NGS and let the user select the faster\nBaumgarte method in performance critical scenarios.\n*/\n\n/*\nCache Performance\n\nThe Box2D solvers are dominated by cache misses. Data structures are designed\nto increase the number of cache hits. Much of misses are due to random access\nto body data. The constraint structures are iterated over linearly, which leads\nto few cache misses.\n\nThe bodies are not accessed during iteration. Instead read only data, such as\nthe mass values are stored with the constraints. The mutable data are the constraint\nimpulses and the bodies velocities/positions. The impulses are held inside the\nconstraint structures. The body velocities/positions are held in compact, temporary\narrays to increase the number of cache hits. Linear and angular velocity are\nstored in a single array since multiple arrays lead to multiple misses.\n*/\n\n/*\n2D Rotation\n\nR = [cos(theta) -sin(theta)]\n    [sin(theta) cos(theta) ]\n\nthetaDot = omega\n\nLet q1 = cos(theta), q2 = sin(theta).\nR = [q1 -q2]\n    [q2  q1]\n\nq1Dot = -thetaDot * q2\nq2Dot = thetaDot * q1\n\nq1_new = q1_old - dt * w * q2\nq2_new = q2_old + dt * w * q1\nthen normalize.\n\nThis might be faster than computing sin+cos.\nHowever, we can compute sin+cos of the same angle fast.\n*/\n\nb2Island::b2Island(\n\tint32 bodyCapacity,\n\tint32 contactCapacity,\n\tint32 jointCapacity,\n\tb2StackAllocator* allocator,\n\tb2ContactListener* listener)\n{\n\tm_bodyCapacity = bodyCapacity;\n\tm_contactCapacity = contactCapacity;\n\tm_jointCapacity\t = jointCapacity;\n\tm_bodyCount = 0;\n\tm_contactCount = 0;\n\tm_jointCount = 0;\n\n\tm_allocator = allocator;\n\tm_listener = listener;\n\n\tm_bodies = (b2Body**)m_allocator->Allocate(bodyCapacity * sizeof(b2Body*));\n\tm_contacts = (b2Contact**)m_allocator->Allocate(contactCapacity\t * sizeof(b2Contact*));\n\tm_joints = (b2Joint**)m_allocator->Allocate(jointCapacity * sizeof(b2Joint*));\n\n\tm_velocities = (b2Velocity*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Velocity));\n\tm_positions = (b2Position*)m_allocator->Allocate(m_bodyCapacity * sizeof(b2Position));\n}\n\nb2Island::~b2Island()\n{\n\t// Warning: the order should reverse the constructor order.\n\tm_allocator->Free(m_positions);\n\tm_allocator->Free(m_velocities);\n\tm_allocator->Free(m_joints);\n\tm_allocator->Free(m_contacts);\n\tm_allocator->Free(m_bodies);\n}\n\nvoid b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep)\n{\n\tb2Timer timer;\n\n\tfloat32 h = step.dt;\n\n\t// Integrate velocities and apply damping. Initialize the body state.\n\tfor (int32 i = 0; i < m_bodyCount; ++i)\n\t{\n\t\tb2Body* b = m_bodies[i];\n\n\t\tb2Vec2 c = b->m_sweep.c;\n\t\tfloat32 a = b->m_sweep.a;\n\t\tb2Vec2 v = b->m_linearVelocity;\n\t\tfloat32 w = b->m_angularVelocity;\n\n\t\t// Store positions for continuous collision.\n\t\tb->m_sweep.c0 = b->m_sweep.c;\n\t\tb->m_sweep.a0 = b->m_sweep.a;\n\n\t\tif (b->m_type == b2_dynamicBody)\n\t\t{\n\t\t\t// Integrate velocities.\n\t\t\tv += h * (b->m_gravityScale * gravity + b->m_invMass * b->m_force);\n\t\t\tw += h * b->m_invI * b->m_torque;\n\n\t\t\t// Apply damping.\n\t\t\t// ODE: dv/dt + c * v = 0\n\t\t\t// Solution: v(t) = v0 * exp(-c * t)\n\t\t\t// Time step: v(t + dt) = v0 * exp(-c * (t + dt)) = v0 * exp(-c * t) * exp(-c * dt) = v * exp(-c * dt)\n\t\t\t// v2 = exp(-c * dt) * v1\n\t\t\t// Pade approximation:\n\t\t\t// v2 = v1 * 1 / (1 + c * dt)\n\t\t\tv *= 1.0f / (1.0f + h * b->m_linearDamping);\n\t\t\tw *= 1.0f / (1.0f + h * b->m_angularDamping);\n\t\t}\n\n\t\tm_positions[i].c = c;\n\t\tm_positions[i].a = a;\n\t\tm_velocities[i].v = v;\n\t\tm_velocities[i].w = w;\n\t}\n\n\ttimer.Reset();\n\n\t// Solver data\n\tb2SolverData solverData;\n\tsolverData.step = step;\n\tsolverData.positions = m_positions;\n\tsolverData.velocities = m_velocities;\n\n\t// Initialize velocity constraints.\n\tb2ContactSolverDef contactSolverDef;\n\tcontactSolverDef.step = step;\n\tcontactSolverDef.contacts = m_contacts;\n\tcontactSolverDef.count = m_contactCount;\n\tcontactSolverDef.positions = m_positions;\n\tcontactSolverDef.velocities = m_velocities;\n\tcontactSolverDef.allocator = m_allocator;\n\n\tb2ContactSolver contactSolver(&contactSolverDef);\n\tcontactSolver.InitializeVelocityConstraints();\n\n\tif (step.warmStarting)\n\t{\n\t\tcontactSolver.WarmStart();\n\t}\n\t\n\tfor (int32 i = 0; i < m_jointCount; ++i)\n\t{\n\t\tm_joints[i]->InitVelocityConstraints(solverData);\n\t}\n\n\tprofile->solveInit = timer.GetMilliseconds();\n\n\t// Solve velocity constraints\n\ttimer.Reset();\n\tfor (int32 i = 0; i < step.velocityIterations; ++i)\n\t{\n\t\tfor (int32 j = 0; j < m_jointCount; ++j)\n\t\t{\n\t\t\tm_joints[j]->SolveVelocityConstraints(solverData);\n\t\t}\n\n\t\tcontactSolver.SolveVelocityConstraints();\n\t}\n\n\t// Store impulses for warm starting\n\tcontactSolver.StoreImpulses();\n\tprofile->solveVelocity = timer.GetMilliseconds();\n\n\t// Integrate positions\n\tfor (int32 i = 0; i < m_bodyCount; ++i)\n\t{\n\t\tb2Vec2 c = m_positions[i].c;\n\t\tfloat32 a = m_positions[i].a;\n\t\tb2Vec2 v = m_velocities[i].v;\n\t\tfloat32 w = m_velocities[i].w;\n\n\t\t// Check for large velocities\n\t\tb2Vec2 translation = h * v;\n\t\tif (b2Dot(translation, translation) > b2_maxTranslationSquared)\n\t\t{\n\t\t\tfloat32 ratio = b2_maxTranslation / translation.Length();\n\t\t\tv *= ratio;\n\t\t}\n\n\t\tfloat32 rotation = h * w;\n\t\tif (rotation * rotation > b2_maxRotationSquared)\n\t\t{\n\t\t\tfloat32 ratio = b2_maxRotation / b2Abs(rotation);\n\t\t\tw *= ratio;\n\t\t}\n\n\t\t// Integrate\n\t\tc += h * v;\n\t\ta += h * w;\n\n\t\tm_positions[i].c = c;\n\t\tm_positions[i].a = a;\n\t\tm_velocities[i].v = v;\n\t\tm_velocities[i].w = w;\n\t}\n\n\t// Solve position constraints\n\ttimer.Reset();\n\tbool positionSolved = false;\n\tfor (int32 i = 0; i < step.positionIterations; ++i)\n\t{\n\t\tbool contactsOkay = contactSolver.SolvePositionConstraints();\n\n\t\tbool jointsOkay = true;\n\t\tfor (int32 i = 0; i < m_jointCount; ++i)\n\t\t{\n\t\t\tbool jointOkay = m_joints[i]->SolvePositionConstraints(solverData);\n\t\t\tjointsOkay = jointsOkay && jointOkay;\n\t\t}\n\n\t\tif (contactsOkay && jointsOkay)\n\t\t{\n\t\t\t// Exit early if the position errors are small.\n\t\t\tpositionSolved = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Copy state buffers back to the bodies\n\tfor (int32 i = 0; i < m_bodyCount; ++i)\n\t{\n\t\tb2Body* body = m_bodies[i];\n\t\tbody->m_sweep.c = m_positions[i].c;\n\t\tbody->m_sweep.a = m_positions[i].a;\n\t\tbody->m_linearVelocity = m_velocities[i].v;\n\t\tbody->m_angularVelocity = m_velocities[i].w;\n\t\tbody->SynchronizeTransform();\n\t}\n\n\tprofile->solvePosition = timer.GetMilliseconds();\n\n\tReport(contactSolver.m_velocityConstraints);\n\n\tif (allowSleep)\n\t{\n\t\tfloat32 minSleepTime = b2_maxFloat;\n\n\t\tconst float32 linTolSqr = b2_linearSleepTolerance * b2_linearSleepTolerance;\n\t\tconst float32 angTolSqr = b2_angularSleepTolerance * b2_angularSleepTolerance;\n\n\t\tfor (int32 i = 0; i < m_bodyCount; ++i)\n\t\t{\n\t\t\tb2Body* b = m_bodies[i];\n\t\t\tif (b->GetType() == b2_staticBody)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ((b->m_flags & b2Body::e_autoSleepFlag) == 0 ||\n\t\t\t\tb->m_angularVelocity * b->m_angularVelocity > angTolSqr ||\n\t\t\t\tb2Dot(b->m_linearVelocity, b->m_linearVelocity) > linTolSqr)\n\t\t\t{\n\t\t\t\tb->m_sleepTime = 0.0f;\n\t\t\t\tminSleepTime = 0.0f;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb->m_sleepTime += h;\n\t\t\t\tminSleepTime = b2Min(minSleepTime, b->m_sleepTime);\n\t\t\t}\n\t\t}\n\n\t\tif (minSleepTime >= b2_timeToSleep && positionSolved)\n\t\t{\n\t\t\tfor (int32 i = 0; i < m_bodyCount; ++i)\n\t\t\t{\n\t\t\t\tb2Body* b = m_bodies[i];\n\t\t\t\tb->SetAwake(false);\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB)\n{\n\tb2Assert(toiIndexA < m_bodyCount);\n\tb2Assert(toiIndexB < m_bodyCount);\n\n\t// Initialize the body state.\n\tfor (int32 i = 0; i < m_bodyCount; ++i)\n\t{\n\t\tb2Body* b = m_bodies[i];\n\t\tm_positions[i].c = b->m_sweep.c;\n\t\tm_positions[i].a = b->m_sweep.a;\n\t\tm_velocities[i].v = b->m_linearVelocity;\n\t\tm_velocities[i].w = b->m_angularVelocity;\n\t}\n\n\tb2ContactSolverDef contactSolverDef;\n\tcontactSolverDef.contacts = m_contacts;\n\tcontactSolverDef.count = m_contactCount;\n\tcontactSolverDef.allocator = m_allocator;\n\tcontactSolverDef.step = subStep;\n\tcontactSolverDef.positions = m_positions;\n\tcontactSolverDef.velocities = m_velocities;\n\tb2ContactSolver contactSolver(&contactSolverDef);\n\n\t// Solve position constraints.\n\tfor (int32 i = 0; i < subStep.positionIterations; ++i)\n\t{\n\t\tbool contactsOkay = contactSolver.SolveTOIPositionConstraints(toiIndexA, toiIndexB);\n\t\tif (contactsOkay)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\n#if 0\n\t// Is the new position really safe?\n\tfor (int32 i = 0; i < m_contactCount; ++i)\n\t{\n\t\tb2Contact* c = m_contacts[i];\n\t\tb2Fixture* fA = c->GetFixtureA();\n\t\tb2Fixture* fB = c->GetFixtureB();\n\n\t\tb2Body* bA = fA->GetBody();\n\t\tb2Body* bB = fB->GetBody();\n\n\t\tint32 indexA = c->GetChildIndexA();\n\t\tint32 indexB = c->GetChildIndexB();\n\n\t\tb2DistanceInput input;\n\t\tinput.proxyA.Set(fA->GetShape(), indexA);\n\t\tinput.proxyB.Set(fB->GetShape(), indexB);\n\t\tinput.transformA = bA->GetTransform();\n\t\tinput.transformB = bB->GetTransform();\n\t\tinput.useRadii = false;\n\n\t\tb2DistanceOutput output;\n\t\tb2SimplexCache cache;\n\t\tcache.count = 0;\n\t\tb2Distance(&output, &cache, &input);\n\n\t\tif (output.distance == 0 || cache.count == 3)\n\t\t{\n\t\t\tcache.count += 0;\n\t\t}\n\t}\n#endif\n\n\t// Leap of faith to new safe state.\n\tm_bodies[toiIndexA]->m_sweep.c0 = m_positions[toiIndexA].c;\n\tm_bodies[toiIndexA]->m_sweep.a0 = m_positions[toiIndexA].a;\n\tm_bodies[toiIndexB]->m_sweep.c0 = m_positions[toiIndexB].c;\n\tm_bodies[toiIndexB]->m_sweep.a0 = m_positions[toiIndexB].a;\n\n\t// No warm starting is needed for TOI events because warm\n\t// starting impulses were applied in the discrete solver.\n\tcontactSolver.InitializeVelocityConstraints();\n\n\t// Solve velocity constraints.\n\tfor (int32 i = 0; i < subStep.velocityIterations; ++i)\n\t{\n\t\tcontactSolver.SolveVelocityConstraints();\n\t}\n\n\t// Don't store the TOI contact forces for warm starting\n\t// because they can be quite large.\n\n\tfloat32 h = subStep.dt;\n\n\t// Integrate positions\n\tfor (int32 i = 0; i < m_bodyCount; ++i)\n\t{\n\t\tb2Vec2 c = m_positions[i].c;\n\t\tfloat32 a = m_positions[i].a;\n\t\tb2Vec2 v = m_velocities[i].v;\n\t\tfloat32 w = m_velocities[i].w;\n\n\t\t// Check for large velocities\n\t\tb2Vec2 translation = h * v;\n\t\tif (b2Dot(translation, translation) > b2_maxTranslationSquared)\n\t\t{\n\t\t\tfloat32 ratio = b2_maxTranslation / translation.Length();\n\t\t\tv *= ratio;\n\t\t}\n\n\t\tfloat32 rotation = h * w;\n\t\tif (rotation * rotation > b2_maxRotationSquared)\n\t\t{\n\t\t\tfloat32 ratio = b2_maxRotation / b2Abs(rotation);\n\t\t\tw *= ratio;\n\t\t}\n\n\t\t// Integrate\n\t\tc += h * v;\n\t\ta += h * w;\n\n\t\tm_positions[i].c = c;\n\t\tm_positions[i].a = a;\n\t\tm_velocities[i].v = v;\n\t\tm_velocities[i].w = w;\n\n\t\t// Sync bodies\n\t\tb2Body* body = m_bodies[i];\n\t\tbody->m_sweep.c = c;\n\t\tbody->m_sweep.a = a;\n\t\tbody->m_linearVelocity = v;\n\t\tbody->m_angularVelocity = w;\n\t\tbody->SynchronizeTransform();\n\t}\n\n\tReport(contactSolver.m_velocityConstraints);\n}\n\nvoid b2Island::Report(const b2ContactVelocityConstraint* constraints)\n{\n\tif (m_listener == NULL)\n\t{\n\t\treturn;\n\t}\n\n\tfor (int32 i = 0; i < m_contactCount; ++i)\n\t{\n\t\tb2Contact* c = m_contacts[i];\n\n\t\tconst b2ContactVelocityConstraint* vc = constraints + i;\n\t\t\n\t\tb2ContactImpulse impulse;\n\t\timpulse.count = vc->pointCount;\n\t\tfor (int32 j = 0; j < vc->pointCount; ++j)\n\t\t{\n\t\t\timpulse.normalImpulses[j] = vc->points[j].normalImpulse;\n\t\t\timpulse.tangentImpulses[j] = vc->points[j].tangentImpulse;\n\t\t}\n\n\t\tm_listener->PostSolve(c, &impulse);\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2Island.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_ISLAND_H\n#define B2_ISLAND_H\n\n#include <Box2D/Common/b2Math.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\nclass b2Contact;\nclass b2Joint;\nclass b2StackAllocator;\nclass b2ContactListener;\nstruct b2ContactVelocityConstraint;\nstruct b2Profile;\n\n/// This is an internal class.\nclass b2Island\n{\npublic:\n\tb2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity,\n\t\t\tb2StackAllocator* allocator, b2ContactListener* listener);\n\t~b2Island();\n\n\tvoid Clear()\n\t{\n\t\tm_bodyCount = 0;\n\t\tm_contactCount = 0;\n\t\tm_jointCount = 0;\n\t}\n\n\tvoid Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep);\n\n\tvoid SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB);\n\n\tvoid Add(b2Body* body)\n\t{\n\t\tb2Assert(m_bodyCount < m_bodyCapacity);\n\t\tbody->m_islandIndex = m_bodyCount;\n\t\tm_bodies[m_bodyCount] = body;\n\t\t++m_bodyCount;\n\t}\n\n\tvoid Add(b2Contact* contact)\n\t{\n\t\tb2Assert(m_contactCount < m_contactCapacity);\n\t\tm_contacts[m_contactCount++] = contact;\n\t}\n\n\tvoid Add(b2Joint* joint)\n\t{\n\t\tb2Assert(m_jointCount < m_jointCapacity);\n\t\tm_joints[m_jointCount++] = joint;\n\t}\n\n\tvoid Report(const b2ContactVelocityConstraint* constraints);\n\n\tb2StackAllocator* m_allocator;\n\tb2ContactListener* m_listener;\n\n\tb2Body** m_bodies;\n\tb2Contact** m_contacts;\n\tb2Joint** m_joints;\n\n\tb2Position* m_positions;\n\tb2Velocity* m_velocities;\n\n\tint32 m_bodyCount;\n\tint32 m_jointCount;\n\tint32 m_contactCount;\n\n\tint32 m_bodyCapacity;\n\tint32 m_contactCapacity;\n\tint32 m_jointCapacity;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2TimeStep.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_TIME_STEP_H\n#define B2_TIME_STEP_H\n\n#include <Box2D/Common/b2Math.h>\n\n/// Profiling data. Times are in milliseconds.\nstruct b2Profile\n{\n\tfloat32 step;\n\tfloat32 collide;\n\tfloat32 solve;\n\tfloat32 solveInit;\n\tfloat32 solveVelocity;\n\tfloat32 solvePosition;\n\tfloat32 broadphase;\n\tfloat32 solveTOI;\n};\n\n/// This is an internal structure.\nstruct b2TimeStep\n{\n\tfloat32 dt;\t\t\t// time step\n\tfloat32 inv_dt;\t\t// inverse time step (0 if dt == 0).\n\tfloat32 dtRatio;\t// dt * inv_dt0\n\tint32 velocityIterations;\n\tint32 positionIterations;\n\tbool warmStarting;\n};\n\n/// This is an internal structure.\nstruct b2Position\n{\n\tb2Vec2 c;\n\tfloat32 a;\n};\n\n/// This is an internal structure.\nstruct b2Velocity\n{\n\tb2Vec2 v;\n\tfloat32 w;\n};\n\n/// Solver Data\nstruct b2SolverData\n{\n\tb2TimeStep step;\n\tb2Position* positions;\n\tb2Velocity* velocities;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2World.cpp",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/b2World.h>\n#include <Box2D/Dynamics/b2Body.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n#include <Box2D/Dynamics/b2Island.h>\n#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>\n#include <Box2D/Dynamics/Contacts/b2Contact.h>\n#include <Box2D/Dynamics/Contacts/b2ContactSolver.h>\n#include <Box2D/Collision/b2Collision.h>\n#include <Box2D/Collision/b2BroadPhase.h>\n#include <Box2D/Collision/Shapes/b2CircleShape.h>\n#include <Box2D/Collision/Shapes/b2EdgeShape.h>\n#include <Box2D/Collision/Shapes/b2ChainShape.h>\n#include <Box2D/Collision/Shapes/b2PolygonShape.h>\n#include <Box2D/Collision/b2TimeOfImpact.h>\n#include <Box2D/Common/b2Draw.h>\n#include <Box2D/Common/b2Timer.h>\n#include <new>\n\nb2World::b2World(const b2Vec2& gravity)\n{\n\tm_destructionListener = NULL;\n\tm_debugDraw = NULL;\n\n\tm_bodyList = NULL;\n\tm_jointList = NULL;\n\n\tm_bodyCount = 0;\n\tm_jointCount = 0;\n\n\tm_warmStarting = true;\n\tm_continuousPhysics = true;\n\tm_subStepping = false;\n\n\tm_stepComplete = true;\n\n\tm_allowSleep = true;\n\tm_gravity = gravity;\n\n\tm_flags = e_clearForces;\n\n\tm_inv_dt0 = 0.0f;\n\n\tm_contactManager.m_allocator = &m_blockAllocator;\n\n\tmemset(&m_profile, 0, sizeof(b2Profile));\n}\n\nb2World::~b2World()\n{\n\t// Some shapes allocate using b2Alloc.\n\tb2Body* b = m_bodyList;\n\twhile (b)\n\t{\n\t\tb2Body* bNext = b->m_next;\n\n\t\tb2Fixture* f = b->m_fixtureList;\n\t\twhile (f)\n\t\t{\n\t\t\tb2Fixture* fNext = f->m_next;\n\t\t\tf->m_proxyCount = 0;\n\t\t\tf->Destroy(&m_blockAllocator);\n\t\t\tf = fNext;\n\t\t}\n\n\t\tb = bNext;\n\t}\n}\n\nvoid b2World::SetDestructionListener(b2DestructionListener* listener)\n{\n\tm_destructionListener = listener;\n}\n\nvoid b2World::SetContactFilter(b2ContactFilter* filter)\n{\n\tm_contactManager.m_contactFilter = filter;\n}\n\nvoid b2World::SetContactListener(b2ContactListener* listener)\n{\n\tm_contactManager.m_contactListener = listener;\n}\n\nvoid b2World::SetDebugDraw(b2Draw* debugDraw)\n{\n\tm_debugDraw = debugDraw;\n}\n\nb2Body* b2World::CreateBody(const b2BodyDef* def)\n{\n\tb2Assert(IsLocked() == false);\n\tif (IsLocked())\n\t{\n\t\treturn NULL;\n\t}\n\n\tvoid* mem = m_blockAllocator.Allocate(sizeof(b2Body));\n\tb2Body* b = new (mem) b2Body(def, this);\n\n\t// Add to world doubly linked list.\n\tb->m_prev = NULL;\n\tb->m_next = m_bodyList;\n\tif (m_bodyList)\n\t{\n\t\tm_bodyList->m_prev = b;\n\t}\n\tm_bodyList = b;\n\t++m_bodyCount;\n\n\treturn b;\n}\n\nvoid b2World::DestroyBody(b2Body* b)\n{\n\tb2Assert(m_bodyCount > 0);\n\tb2Assert(IsLocked() == false);\n\tif (IsLocked())\n\t{\n\t\treturn;\n\t}\n\n\t// Delete the attached joints.\n\tb2JointEdge* je = b->m_jointList;\n\twhile (je)\n\t{\n\t\tb2JointEdge* je0 = je;\n\t\tje = je->next;\n\n\t\tif (m_destructionListener)\n\t\t{\n\t\t\tm_destructionListener->SayGoodbye(je0->joint);\n\t\t}\n\n\t\tDestroyJoint(je0->joint);\n\n\t\tb->m_jointList = je;\n\t}\n\tb->m_jointList = NULL;\n\n\t// Delete the attached contacts.\n\tb2ContactEdge* ce = b->m_contactList;\n\twhile (ce)\n\t{\n\t\tb2ContactEdge* ce0 = ce;\n\t\tce = ce->next;\n\t\tm_contactManager.Destroy(ce0->contact);\n\t}\n\tb->m_contactList = NULL;\n\n\t// Delete the attached fixtures. This destroys broad-phase proxies.\n\tb2Fixture* f = b->m_fixtureList;\n\twhile (f)\n\t{\n\t\tb2Fixture* f0 = f;\n\t\tf = f->m_next;\n\n\t\tif (m_destructionListener)\n\t\t{\n\t\t\tm_destructionListener->SayGoodbye(f0);\n\t\t}\n\n\t\tf0->DestroyProxies(&m_contactManager.m_broadPhase);\n\t\tf0->Destroy(&m_blockAllocator);\n\t\tf0->~b2Fixture();\n\t\tm_blockAllocator.Free(f0, sizeof(b2Fixture));\n\n\t\tb->m_fixtureList = f;\n\t\tb->m_fixtureCount -= 1;\n\t}\n\tb->m_fixtureList = NULL;\n\tb->m_fixtureCount = 0;\n\n\t// Remove world body list.\n\tif (b->m_prev)\n\t{\n\t\tb->m_prev->m_next = b->m_next;\n\t}\n\n\tif (b->m_next)\n\t{\n\t\tb->m_next->m_prev = b->m_prev;\n\t}\n\n\tif (b == m_bodyList)\n\t{\n\t\tm_bodyList = b->m_next;\n\t}\n\n\t--m_bodyCount;\n\tb->~b2Body();\n\tm_blockAllocator.Free(b, sizeof(b2Body));\n}\n\nb2Joint* b2World::CreateJoint(const b2JointDef* def)\n{\n\tb2Assert(IsLocked() == false);\n\tif (IsLocked())\n\t{\n\t\treturn NULL;\n\t}\n\n\tb2Joint* j = b2Joint::Create(def, &m_blockAllocator);\n\n\t// Connect to the world list.\n\tj->m_prev = NULL;\n\tj->m_next = m_jointList;\n\tif (m_jointList)\n\t{\n\t\tm_jointList->m_prev = j;\n\t}\n\tm_jointList = j;\n\t++m_jointCount;\n\n\t// Connect to the bodies' doubly linked lists.\n\tj->m_edgeA.joint = j;\n\tj->m_edgeA.other = j->m_bodyB;\n\tj->m_edgeA.prev = NULL;\n\tj->m_edgeA.next = j->m_bodyA->m_jointList;\n\tif (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA;\n\tj->m_bodyA->m_jointList = &j->m_edgeA;\n\n\tj->m_edgeB.joint = j;\n\tj->m_edgeB.other = j->m_bodyA;\n\tj->m_edgeB.prev = NULL;\n\tj->m_edgeB.next = j->m_bodyB->m_jointList;\n\tif (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB;\n\tj->m_bodyB->m_jointList = &j->m_edgeB;\n\n\tb2Body* bodyA = def->bodyA;\n\tb2Body* bodyB = def->bodyB;\n\n\t// If the joint prevents collisions, then flag any contacts for filtering.\n\tif (def->collideConnected == false)\n\t{\n\t\tb2ContactEdge* edge = bodyB->GetContactList();\n\t\twhile (edge)\n\t\t{\n\t\t\tif (edge->other == bodyA)\n\t\t\t{\n\t\t\t\t// Flag the contact for filtering at the next time step (where either\n\t\t\t\t// body is awake).\n\t\t\t\tedge->contact->FlagForFiltering();\n\t\t\t}\n\n\t\t\tedge = edge->next;\n\t\t}\n\t}\n\n\t// Note: creating a joint doesn't wake the bodies.\n\n\treturn j;\n}\n\nvoid b2World::DestroyJoint(b2Joint* j)\n{\n\tb2Assert(IsLocked() == false);\n\tif (IsLocked())\n\t{\n\t\treturn;\n\t}\n\n\tbool collideConnected = j->m_collideConnected;\n\n\t// Remove from the doubly linked list.\n\tif (j->m_prev)\n\t{\n\t\tj->m_prev->m_next = j->m_next;\n\t}\n\n\tif (j->m_next)\n\t{\n\t\tj->m_next->m_prev = j->m_prev;\n\t}\n\n\tif (j == m_jointList)\n\t{\n\t\tm_jointList = j->m_next;\n\t}\n\n\t// Disconnect from island graph.\n\tb2Body* bodyA = j->m_bodyA;\n\tb2Body* bodyB = j->m_bodyB;\n\n\t// Wake up connected bodies.\n\tbodyA->SetAwake(true);\n\tbodyB->SetAwake(true);\n\n\t// Remove from body 1.\n\tif (j->m_edgeA.prev)\n\t{\n\t\tj->m_edgeA.prev->next = j->m_edgeA.next;\n\t}\n\n\tif (j->m_edgeA.next)\n\t{\n\t\tj->m_edgeA.next->prev = j->m_edgeA.prev;\n\t}\n\n\tif (&j->m_edgeA == bodyA->m_jointList)\n\t{\n\t\tbodyA->m_jointList = j->m_edgeA.next;\n\t}\n\n\tj->m_edgeA.prev = NULL;\n\tj->m_edgeA.next = NULL;\n\n\t// Remove from body 2\n\tif (j->m_edgeB.prev)\n\t{\n\t\tj->m_edgeB.prev->next = j->m_edgeB.next;\n\t}\n\n\tif (j->m_edgeB.next)\n\t{\n\t\tj->m_edgeB.next->prev = j->m_edgeB.prev;\n\t}\n\n\tif (&j->m_edgeB == bodyB->m_jointList)\n\t{\n\t\tbodyB->m_jointList = j->m_edgeB.next;\n\t}\n\n\tj->m_edgeB.prev = NULL;\n\tj->m_edgeB.next = NULL;\n\n\tb2Joint::Destroy(j, &m_blockAllocator);\n\n\tb2Assert(m_jointCount > 0);\n\t--m_jointCount;\n\n\t// If the joint prevents collisions, then flag any contacts for filtering.\n\tif (collideConnected == false)\n\t{\n\t\tb2ContactEdge* edge = bodyB->GetContactList();\n\t\twhile (edge)\n\t\t{\n\t\t\tif (edge->other == bodyA)\n\t\t\t{\n\t\t\t\t// Flag the contact for filtering at the next time step (where either\n\t\t\t\t// body is awake).\n\t\t\t\tedge->contact->FlagForFiltering();\n\t\t\t}\n\n\t\t\tedge = edge->next;\n\t\t}\n\t}\n}\n\n//\nvoid b2World::SetAllowSleeping(bool flag)\n{\n\tif (flag == m_allowSleep)\n\t{\n\t\treturn;\n\t}\n\n\tm_allowSleep = flag;\n\tif (m_allowSleep == false)\n\t{\n\t\tfor (b2Body* b = m_bodyList; b; b = b->m_next)\n\t\t{\n\t\t\tb->SetAwake(true);\n\t\t}\n\t}\n}\n\n// Find islands, integrate and solve constraints, solve position constraints\nvoid b2World::Solve(const b2TimeStep& step)\n{\n\tm_profile.solveInit = 0.0f;\n\tm_profile.solveVelocity = 0.0f;\n\tm_profile.solvePosition = 0.0f;\n\n\t// Size the island for the worst case.\n\tb2Island island(m_bodyCount,\n\t\t\t\t\tm_contactManager.m_contactCount,\n\t\t\t\t\tm_jointCount,\n\t\t\t\t\t&m_stackAllocator,\n\t\t\t\t\tm_contactManager.m_contactListener);\n\n\t// Clear all the island flags.\n\tfor (b2Body* b = m_bodyList; b; b = b->m_next)\n\t{\n\t\tb->m_flags &= ~b2Body::e_islandFlag;\n\t}\n\tfor (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next)\n\t{\n\t\tc->m_flags &= ~b2Contact::e_islandFlag;\n\t}\n\tfor (b2Joint* j = m_jointList; j; j = j->m_next)\n\t{\n\t\tj->m_islandFlag = false;\n\t}\n\n\t// Build and simulate all awake islands.\n\tint32 stackSize = m_bodyCount;\n\tb2Body** stack = (b2Body**)m_stackAllocator.Allocate(stackSize * sizeof(b2Body*));\n\tfor (b2Body* seed = m_bodyList; seed; seed = seed->m_next)\n\t{\n\t\tif (seed->m_flags & b2Body::e_islandFlag)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (seed->IsAwake() == false || seed->IsActive() == false)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// The seed can be dynamic or kinematic.\n\t\tif (seed->GetType() == b2_staticBody)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Reset island and stack.\n\t\tisland.Clear();\n\t\tint32 stackCount = 0;\n\t\tstack[stackCount++] = seed;\n\t\tseed->m_flags |= b2Body::e_islandFlag;\n\n\t\t// Perform a depth first search (DFS) on the constraint graph.\n\t\twhile (stackCount > 0)\n\t\t{\n\t\t\t// Grab the next body off the stack and add it to the island.\n\t\t\tb2Body* b = stack[--stackCount];\n\t\t\tb2Assert(b->IsActive() == true);\n\t\t\tisland.Add(b);\n\n\t\t\t// Make sure the body is awake.\n\t\t\tb->SetAwake(true);\n\n\t\t\t// To keep islands as small as possible, we don't\n\t\t\t// propagate islands across static bodies.\n\t\t\tif (b->GetType() == b2_staticBody)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Search all contacts connected to this body.\n\t\t\tfor (b2ContactEdge* ce = b->m_contactList; ce; ce = ce->next)\n\t\t\t{\n\t\t\t\tb2Contact* contact = ce->contact;\n\n\t\t\t\t// Has this contact already been added to an island?\n\t\t\t\tif (contact->m_flags & b2Contact::e_islandFlag)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Is this contact solid and touching?\n\t\t\t\tif (contact->IsEnabled() == false ||\n\t\t\t\t\tcontact->IsTouching() == false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Skip sensors.\n\t\t\t\tbool sensorA = contact->m_fixtureA->m_isSensor;\n\t\t\t\tbool sensorB = contact->m_fixtureB->m_isSensor;\n\t\t\t\tif (sensorA || sensorB)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tisland.Add(contact);\n\t\t\t\tcontact->m_flags |= b2Contact::e_islandFlag;\n\n\t\t\t\tb2Body* other = ce->other;\n\n\t\t\t\t// Was the other body already added to this island?\n\t\t\t\tif (other->m_flags & b2Body::e_islandFlag)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tb2Assert(stackCount < stackSize);\n\t\t\t\tstack[stackCount++] = other;\n\t\t\t\tother->m_flags |= b2Body::e_islandFlag;\n\t\t\t}\n\n\t\t\t// Search all joints connect to this body.\n\t\t\tfor (b2JointEdge* je = b->m_jointList; je; je = je->next)\n\t\t\t{\n\t\t\t\tif (je->joint->m_islandFlag == true)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tb2Body* other = je->other;\n\n\t\t\t\t// Don't simulate joints connected to inactive bodies.\n\t\t\t\tif (other->IsActive() == false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tisland.Add(je->joint);\n\t\t\t\tje->joint->m_islandFlag = true;\n\n\t\t\t\tif (other->m_flags & b2Body::e_islandFlag)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tb2Assert(stackCount < stackSize);\n\t\t\t\tstack[stackCount++] = other;\n\t\t\t\tother->m_flags |= b2Body::e_islandFlag;\n\t\t\t}\n\t\t}\n\n\t\tb2Profile profile;\n\t\tisland.Solve(&profile, step, m_gravity, m_allowSleep);\n\t\tm_profile.solveInit += profile.solveInit;\n\t\tm_profile.solveVelocity += profile.solveVelocity;\n\t\tm_profile.solvePosition += profile.solvePosition;\n\n\t\t// Post solve cleanup.\n\t\tfor (int32 i = 0; i < island.m_bodyCount; ++i)\n\t\t{\n\t\t\t// Allow static bodies to participate in other islands.\n\t\t\tb2Body* b = island.m_bodies[i];\n\t\t\tif (b->GetType() == b2_staticBody)\n\t\t\t{\n\t\t\t\tb->m_flags &= ~b2Body::e_islandFlag;\n\t\t\t}\n\t\t}\n\t}\n\n\tm_stackAllocator.Free(stack);\n\n\t{\n\t\tb2Timer timer;\n\t\t// Synchronize fixtures, check for out of range bodies.\n\t\tfor (b2Body* b = m_bodyList; b; b = b->GetNext())\n\t\t{\n\t\t\t// If a body was not in an island then it did not move.\n\t\t\tif ((b->m_flags & b2Body::e_islandFlag) == 0)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (b->GetType() == b2_staticBody)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Update fixtures (for broad-phase).\n\t\t\tb->SynchronizeFixtures();\n\t\t}\n\n\t\t// Look for new contacts.\n\t\tm_contactManager.FindNewContacts();\n\t\tm_profile.broadphase = timer.GetMilliseconds();\n\t}\n}\n\n// Find TOI contacts and solve them.\nvoid b2World::SolveTOI(const b2TimeStep& step)\n{\n\tb2Island island(2 * b2_maxTOIContacts, b2_maxTOIContacts, 0, &m_stackAllocator, m_contactManager.m_contactListener);\n\n\tif (m_stepComplete)\n\t{\n\t\tfor (b2Body* b = m_bodyList; b; b = b->m_next)\n\t\t{\n\t\t\tb->m_flags &= ~b2Body::e_islandFlag;\n\t\t\tb->m_sweep.alpha0 = 0.0f;\n\t\t}\n\n\t\tfor (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next)\n\t\t{\n\t\t\t// Invalidate TOI\n\t\t\tc->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag);\n\t\t\tc->m_toiCount = 0;\n\t\t\tc->m_toi = 1.0f;\n\t\t}\n\t}\n\n\t// Find TOI events and solve them.\n\tfor (;;)\n\t{\n\t\t// Find the first TOI.\n\t\tb2Contact* minContact = NULL;\n\t\tfloat32 minAlpha = 1.0f;\n\n\t\tfor (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next)\n\t\t{\n\t\t\t// Is this contact disabled?\n\t\t\tif (c->IsEnabled() == false)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Prevent excessive sub-stepping.\n\t\t\tif (c->m_toiCount > b2_maxSubSteps)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfloat32 alpha = 1.0f;\n\t\t\tif (c->m_flags & b2Contact::e_toiFlag)\n\t\t\t{\n\t\t\t\t// This contact has a valid cached TOI.\n\t\t\t\talpha = c->m_toi;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb2Fixture* fA = c->GetFixtureA();\n\t\t\t\tb2Fixture* fB = c->GetFixtureB();\n\n\t\t\t\t// Is there a sensor?\n\t\t\t\tif (fA->IsSensor() || fB->IsSensor())\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tb2Body* bA = fA->GetBody();\n\t\t\t\tb2Body* bB = fB->GetBody();\n\n\t\t\t\tb2BodyType typeA = bA->m_type;\n\t\t\t\tb2BodyType typeB = bB->m_type;\n\t\t\t\tb2Assert(typeA == b2_dynamicBody || typeB == b2_dynamicBody);\n\n\t\t\t\tbool activeA = bA->IsAwake() && typeA != b2_staticBody;\n\t\t\t\tbool activeB = bB->IsAwake() && typeB != b2_staticBody;\n\n\t\t\t\t// Is at least one body active (awake and dynamic or kinematic)?\n\t\t\t\tif (activeA == false && activeB == false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbool collideA = bA->IsBullet() || typeA != b2_dynamicBody;\n\t\t\t\tbool collideB = bB->IsBullet() || typeB != b2_dynamicBody;\n\n\t\t\t\t// Are these two non-bullet dynamic bodies?\n\t\t\t\tif (collideA == false && collideB == false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Compute the TOI for this contact.\n\t\t\t\t// Put the sweeps onto the same time interval.\n\t\t\t\tfloat32 alpha0 = bA->m_sweep.alpha0;\n\n\t\t\t\tif (bA->m_sweep.alpha0 < bB->m_sweep.alpha0)\n\t\t\t\t{\n\t\t\t\t\talpha0 = bB->m_sweep.alpha0;\n\t\t\t\t\tbA->m_sweep.Advance(alpha0);\n\t\t\t\t}\n\t\t\t\telse if (bB->m_sweep.alpha0 < bA->m_sweep.alpha0)\n\t\t\t\t{\n\t\t\t\t\talpha0 = bA->m_sweep.alpha0;\n\t\t\t\t\tbB->m_sweep.Advance(alpha0);\n\t\t\t\t}\n\n\t\t\t\tb2Assert(alpha0 < 1.0f);\n\n\t\t\t\tint32 indexA = c->GetChildIndexA();\n\t\t\t\tint32 indexB = c->GetChildIndexB();\n\n\t\t\t\t// Compute the time of impact in interval [0, minTOI]\n\t\t\t\tb2TOIInput input;\n\t\t\t\tinput.proxyA.Set(fA->GetShape(), indexA);\n\t\t\t\tinput.proxyB.Set(fB->GetShape(), indexB);\n\t\t\t\tinput.sweepA = bA->m_sweep;\n\t\t\t\tinput.sweepB = bB->m_sweep;\n\t\t\t\tinput.tMax = 1.0f;\n\n\t\t\t\tb2TOIOutput output;\n\t\t\t\tb2TimeOfImpact(&output, &input);\n\n\t\t\t\t// Beta is the fraction of the remaining portion of the .\n\t\t\t\tfloat32 beta = output.t;\n\t\t\t\tif (output.state == b2TOIOutput::e_touching)\n\t\t\t\t{\n\t\t\t\t\talpha = b2Min(alpha0 + (1.0f - alpha0) * beta, 1.0f);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\talpha = 1.0f;\n\t\t\t\t}\n\n\t\t\t\tc->m_toi = alpha;\n\t\t\t\tc->m_flags |= b2Contact::e_toiFlag;\n\t\t\t}\n\n\t\t\tif (alpha < minAlpha)\n\t\t\t{\n\t\t\t\t// This is the minimum TOI found so far.\n\t\t\t\tminContact = c;\n\t\t\t\tminAlpha = alpha;\n\t\t\t}\n\t\t}\n\n\t\tif (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha)\n\t\t{\n\t\t\t// No more TOI events. Done!\n\t\t\tm_stepComplete = true;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Advance the bodies to the TOI.\n\t\tb2Fixture* fA = minContact->GetFixtureA();\n\t\tb2Fixture* fB = minContact->GetFixtureB();\n\t\tb2Body* bA = fA->GetBody();\n\t\tb2Body* bB = fB->GetBody();\n\n\t\tb2Sweep backup1 = bA->m_sweep;\n\t\tb2Sweep backup2 = bB->m_sweep;\n\n\t\tbA->Advance(minAlpha);\n\t\tbB->Advance(minAlpha);\n\n\t\t// The TOI contact likely has some new contact points.\n\t\tminContact->Update(m_contactManager.m_contactListener);\n\t\tminContact->m_flags &= ~b2Contact::e_toiFlag;\n\t\t++minContact->m_toiCount;\n\n\t\t// Is the contact solid?\n\t\tif (minContact->IsEnabled() == false || minContact->IsTouching() == false)\n\t\t{\n\t\t\t// Restore the sweeps.\n\t\t\tminContact->SetEnabled(false);\n\t\t\tbA->m_sweep = backup1;\n\t\t\tbB->m_sweep = backup2;\n\t\t\tbA->SynchronizeTransform();\n\t\t\tbB->SynchronizeTransform();\n\t\t\tcontinue;\n\t\t}\n\n\t\tbA->SetAwake(true);\n\t\tbB->SetAwake(true);\n\n\t\t// Build the island\n\t\tisland.Clear();\n\t\tisland.Add(bA);\n\t\tisland.Add(bB);\n\t\tisland.Add(minContact);\n\n\t\tbA->m_flags |= b2Body::e_islandFlag;\n\t\tbB->m_flags |= b2Body::e_islandFlag;\n\t\tminContact->m_flags |= b2Contact::e_islandFlag;\n\n\t\t// Get contacts on bodyA and bodyB.\n\t\tb2Body* bodies[2] = {bA, bB};\n\t\tfor (int32 i = 0; i < 2; ++i)\n\t\t{\n\t\t\tb2Body* body = bodies[i];\n\t\t\tif (body->m_type == b2_dynamicBody)\n\t\t\t{\n\t\t\t\tfor (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next)\n\t\t\t\t{\n\t\t\t\t\tif (island.m_bodyCount == island.m_bodyCapacity)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (island.m_contactCount == island.m_contactCapacity)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tb2Contact* contact = ce->contact;\n\n\t\t\t\t\t// Has this contact already been added to the island?\n\t\t\t\t\tif (contact->m_flags & b2Contact::e_islandFlag)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only add static, kinematic, or bullet bodies.\n\t\t\t\t\tb2Body* other = ce->other;\n\t\t\t\t\tif (other->m_type == b2_dynamicBody &&\n\t\t\t\t\t\tbody->IsBullet() == false && other->IsBullet() == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Skip sensors.\n\t\t\t\t\tbool sensorA = contact->m_fixtureA->m_isSensor;\n\t\t\t\t\tbool sensorB = contact->m_fixtureB->m_isSensor;\n\t\t\t\t\tif (sensorA || sensorB)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Tentatively advance the body to the TOI.\n\t\t\t\t\tb2Sweep backup = other->m_sweep;\n\t\t\t\t\tif ((other->m_flags & b2Body::e_islandFlag) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tother->Advance(minAlpha);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Update the contact points\n\t\t\t\t\tcontact->Update(m_contactManager.m_contactListener);\n\n\t\t\t\t\t// Was the contact disabled by the user?\n\t\t\t\t\tif (contact->IsEnabled() == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tother->m_sweep = backup;\n\t\t\t\t\t\tother->SynchronizeTransform();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Are there contact points?\n\t\t\t\t\tif (contact->IsTouching() == false)\n\t\t\t\t\t{\n\t\t\t\t\t\tother->m_sweep = backup;\n\t\t\t\t\t\tother->SynchronizeTransform();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add the contact to the island\n\t\t\t\t\tcontact->m_flags |= b2Contact::e_islandFlag;\n\t\t\t\t\tisland.Add(contact);\n\n\t\t\t\t\t// Has the other body already been added to the island?\n\t\t\t\t\tif (other->m_flags & b2Body::e_islandFlag)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add the other body to the island.\n\t\t\t\t\tother->m_flags |= b2Body::e_islandFlag;\n\n\t\t\t\t\tif (other->m_type != b2_staticBody)\n\t\t\t\t\t{\n\t\t\t\t\t\tother->SetAwake(true);\n\t\t\t\t\t}\n\n\t\t\t\t\tisland.Add(other);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tb2TimeStep subStep;\n\t\tsubStep.dt = (1.0f - minAlpha) * step.dt;\n\t\tsubStep.inv_dt = 1.0f / subStep.dt;\n\t\tsubStep.dtRatio = 1.0f;\n\t\tsubStep.positionIterations = 20;\n\t\tsubStep.velocityIterations = step.velocityIterations;\n\t\tsubStep.warmStarting = false;\n\t\tisland.SolveTOI(subStep, bA->m_islandIndex, bB->m_islandIndex);\n\n\t\t// Reset island flags and synchronize broad-phase proxies.\n\t\tfor (int32 i = 0; i < island.m_bodyCount; ++i)\n\t\t{\n\t\t\tb2Body* body = island.m_bodies[i];\n\t\t\tbody->m_flags &= ~b2Body::e_islandFlag;\n\n\t\t\tif (body->m_type != b2_dynamicBody)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbody->SynchronizeFixtures();\n\n\t\t\t// Invalidate all contact TOIs on this displaced body.\n\t\t\tfor (b2ContactEdge* ce = body->m_contactList; ce; ce = ce->next)\n\t\t\t{\n\t\t\t\tce->contact->m_flags &= ~(b2Contact::e_toiFlag | b2Contact::e_islandFlag);\n\t\t\t}\n\t\t}\n\n\t\t// Commit fixture proxy movements to the broad-phase so that new contacts are created.\n\t\t// Also, some contacts can be destroyed.\n\t\tm_contactManager.FindNewContacts();\n\n\t\tif (m_subStepping)\n\t\t{\n\t\t\tm_stepComplete = false;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nvoid b2World::Step(float32 dt, int32 velocityIterations, int32 positionIterations)\n{\n\tb2Timer stepTimer;\n\n\t// If new fixtures were added, we need to find the new contacts.\n\tif (m_flags & e_newFixture)\n\t{\n\t\tm_contactManager.FindNewContacts();\n\t\tm_flags &= ~e_newFixture;\n\t}\n\n\tm_flags |= e_locked;\n\n\tb2TimeStep step;\n\tstep.dt = dt;\n\tstep.velocityIterations\t= velocityIterations;\n\tstep.positionIterations = positionIterations;\n\tif (dt > 0.0f)\n\t{\n\t\tstep.inv_dt = 1.0f / dt;\n\t}\n\telse\n\t{\n\t\tstep.inv_dt = 0.0f;\n\t}\n\n\tstep.dtRatio = m_inv_dt0 * dt;\n\n\tstep.warmStarting = m_warmStarting;\n\t\n\t// Update contacts. This is where some contacts are destroyed.\n\t{\n\t\tb2Timer timer;\n\t\tm_contactManager.Collide();\n\t\tm_profile.collide = timer.GetMilliseconds();\n\t}\n\n\t// Integrate velocities, solve velocity constraints, and integrate positions.\n\tif (m_stepComplete && step.dt > 0.0f)\n\t{\n\t\tb2Timer timer;\n\t\tSolve(step);\n\t\tm_profile.solve = timer.GetMilliseconds();\n\t}\n\n\t// Handle TOI events.\n\tif (m_continuousPhysics && step.dt > 0.0f)\n\t{\n\t\tb2Timer timer;\n\t\tSolveTOI(step);\n\t\tm_profile.solveTOI = timer.GetMilliseconds();\n\t}\n\n\tif (step.dt > 0.0f)\n\t{\n\t\tm_inv_dt0 = step.inv_dt;\n\t}\n\n\tif (m_flags & e_clearForces)\n\t{\n\t\tClearForces();\n\t}\n\n\tm_flags &= ~e_locked;\n\n\tm_profile.step = stepTimer.GetMilliseconds();\n}\n\nvoid b2World::ClearForces()\n{\n\tfor (b2Body* body = m_bodyList; body; body = body->GetNext())\n\t{\n\t\tbody->m_force.SetZero();\n\t\tbody->m_torque = 0.0f;\n\t}\n}\n\nstruct b2WorldQueryWrapper\n{\n\tbool QueryCallback(int32 proxyId)\n\t{\n\t\tb2FixtureProxy* proxy = (b2FixtureProxy*)broadPhase->GetUserData(proxyId);\n\t\treturn callback->ReportFixture(proxy->fixture);\n\t}\n\n\tconst b2BroadPhase* broadPhase;\n\tb2QueryCallback* callback;\n};\n\nvoid b2World::QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const\n{\n\tb2WorldQueryWrapper wrapper;\n\twrapper.broadPhase = &m_contactManager.m_broadPhase;\n\twrapper.callback = callback;\n\tm_contactManager.m_broadPhase.Query(&wrapper, aabb);\n}\n\nstruct b2WorldRayCastWrapper\n{\n\tfloat32 RayCastCallback(const b2RayCastInput& input, int32 proxyId)\n\t{\n\t\tvoid* userData = broadPhase->GetUserData(proxyId);\n\t\tb2FixtureProxy* proxy = (b2FixtureProxy*)userData;\n\t\tb2Fixture* fixture = proxy->fixture;\n\t\tint32 index = proxy->childIndex;\n\t\tb2RayCastOutput output;\n\t\tbool hit = fixture->RayCast(&output, input, index);\n\n\t\tif (hit)\n\t\t{\n\t\t\tfloat32 fraction = output.fraction;\n\t\t\tb2Vec2 point = (1.0f - fraction) * input.p1 + fraction * input.p2;\n\t\t\treturn callback->ReportFixture(fixture, point, output.normal, fraction);\n\t\t}\n\n\t\treturn input.maxFraction;\n\t}\n\n\tconst b2BroadPhase* broadPhase;\n\tb2RayCastCallback* callback;\n};\n\nvoid b2World::RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const\n{\n\tb2WorldRayCastWrapper wrapper;\n\twrapper.broadPhase = &m_contactManager.m_broadPhase;\n\twrapper.callback = callback;\n\tb2RayCastInput input;\n\tinput.maxFraction = 1.0f;\n\tinput.p1 = point1;\n\tinput.p2 = point2;\n\tm_contactManager.m_broadPhase.RayCast(&wrapper, input);\n}\n\nvoid b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color& color)\n{\n\tswitch (fixture->GetType())\n\t{\n\tcase b2Shape::e_circle:\n\t\t{\n\t\t\tb2CircleShape* circle = (b2CircleShape*)fixture->GetShape();\n\n\t\t\tb2Vec2 center = b2Mul(xf, circle->m_p);\n\t\t\tfloat32 radius = circle->m_radius;\n\t\t\tb2Vec2 axis = b2Mul(xf.q, b2Vec2(1.0f, 0.0f));\n\n\t\t\tm_debugDraw->DrawSolidCircle(center, radius, axis, color);\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_edge:\n\t\t{\n\t\t\tb2EdgeShape* edge = (b2EdgeShape*)fixture->GetShape();\n\t\t\tb2Vec2 v1 = b2Mul(xf, edge->m_vertex1);\n\t\t\tb2Vec2 v2 = b2Mul(xf, edge->m_vertex2);\n\t\t\tm_debugDraw->DrawSegment(v1, v2, color);\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_chain:\n\t\t{\n\t\t\tb2ChainShape* chain = (b2ChainShape*)fixture->GetShape();\n\t\t\tint32 count = chain->m_count;\n\t\t\tconst b2Vec2* vertices = chain->m_vertices;\n\n\t\t\tb2Vec2 v1 = b2Mul(xf, vertices[0]);\n\t\t\tfor (int32 i = 1; i < count; ++i)\n\t\t\t{\n\t\t\t\tb2Vec2 v2 = b2Mul(xf, vertices[i]);\n\t\t\t\tm_debugDraw->DrawSegment(v1, v2, color);\n\t\t\t\tm_debugDraw->DrawCircle(v1, 0.05f, color);\n\t\t\t\tv1 = v2;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\n\tcase b2Shape::e_polygon:\n\t\t{\n\t\t\tb2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape();\n\t\t\tint32 vertexCount = poly->m_count;\n\t\t\tb2Assert(vertexCount <= b2_maxPolygonVertices);\n\t\t\tb2Vec2 vertices[b2_maxPolygonVertices];\n\n\t\t\tfor (int32 i = 0; i < vertexCount; ++i)\n\t\t\t{\n\t\t\t\tvertices[i] = b2Mul(xf, poly->m_vertices[i]);\n\t\t\t}\n\n\t\t\tm_debugDraw->DrawSolidPolygon(vertices, vertexCount, color);\n\t\t}\n\t\tbreak;\n            \n    default:\n        break;\n\t}\n}\n\nvoid b2World::DrawJoint(b2Joint* joint)\n{\n\tb2Body* bodyA = joint->GetBodyA();\n\tb2Body* bodyB = joint->GetBodyB();\n\tconst b2Transform& xf1 = bodyA->GetTransform();\n\tconst b2Transform& xf2 = bodyB->GetTransform();\n\tb2Vec2 x1 = xf1.p;\n\tb2Vec2 x2 = xf2.p;\n\tb2Vec2 p1 = joint->GetAnchorA();\n\tb2Vec2 p2 = joint->GetAnchorB();\n\n\tb2Color color(0.5f, 0.8f, 0.8f);\n\n\tswitch (joint->GetType())\n\t{\n\tcase e_distanceJoint:\n\t\tm_debugDraw->DrawSegment(p1, p2, color);\n\t\tbreak;\n\n\tcase e_pulleyJoint:\n\t\t{\n\t\t\tb2PulleyJoint* pulley = (b2PulleyJoint*)joint;\n\t\t\tb2Vec2 s1 = pulley->GetGroundAnchorA();\n\t\t\tb2Vec2 s2 = pulley->GetGroundAnchorB();\n\t\t\tm_debugDraw->DrawSegment(s1, p1, color);\n\t\t\tm_debugDraw->DrawSegment(s2, p2, color);\n\t\t\tm_debugDraw->DrawSegment(s1, s2, color);\n\t\t}\n\t\tbreak;\n\n\tcase e_mouseJoint:\n\t\t// don't draw this\n\t\tbreak;\n\n\tdefault:\n\t\tm_debugDraw->DrawSegment(x1, p1, color);\n\t\tm_debugDraw->DrawSegment(p1, p2, color);\n\t\tm_debugDraw->DrawSegment(x2, p2, color);\n\t}\n}\n\nvoid b2World::DrawDebugData()\n{\n\tif (m_debugDraw == NULL)\n\t{\n\t\treturn;\n\t}\n\n\tuint32 flags = m_debugDraw->GetFlags();\n\n\tif (flags & b2Draw::e_shapeBit)\n\t{\n\t\tfor (b2Body* b = m_bodyList; b; b = b->GetNext())\n\t\t{\n\t\t\tconst b2Transform& xf = b->GetTransform();\n\t\t\tfor (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext())\n\t\t\t{\n\t\t\t\tif (b->IsActive() == false)\n\t\t\t\t{\n\t\t\t\t\tDrawShape(f, xf, b2Color(0.5f, 0.5f, 0.3f));\n\t\t\t\t}\n\t\t\t\telse if (b->GetType() == b2_staticBody)\n\t\t\t\t{\n\t\t\t\t\tDrawShape(f, xf, b2Color(0.5f, 0.9f, 0.5f));\n\t\t\t\t}\n\t\t\t\telse if (b->GetType() == b2_kinematicBody)\n\t\t\t\t{\n\t\t\t\t\tDrawShape(f, xf, b2Color(0.5f, 0.5f, 0.9f));\n\t\t\t\t}\n\t\t\t\telse if (b->IsAwake() == false)\n\t\t\t\t{\n\t\t\t\t\tDrawShape(f, xf, b2Color(0.6f, 0.6f, 0.6f));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tDrawShape(f, xf, b2Color(0.9f, 0.7f, 0.7f));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (flags & b2Draw::e_jointBit)\n\t{\n\t\tfor (b2Joint* j = m_jointList; j; j = j->GetNext())\n\t\t{\n\t\t\tDrawJoint(j);\n\t\t}\n\t}\n\n\tif (flags & b2Draw::e_pairBit)\n\t{\n\t\tb2Color color(0.3f, 0.9f, 0.9f);\n\t\tfor (b2Contact* c = m_contactManager.m_contactList; c; c = c->GetNext())\n\t\t{\n\t\t\t//b2Fixture* fixtureA = c->GetFixtureA();\n\t\t\t//b2Fixture* fixtureB = c->GetFixtureB();\n\n\t\t\t//b2Vec2 cA = fixtureA->GetAABB().GetCenter();\n\t\t\t//b2Vec2 cB = fixtureB->GetAABB().GetCenter();\n\n\t\t\t//m_debugDraw->DrawSegment(cA, cB, color);\n\t\t}\n\t}\n\n\tif (flags & b2Draw::e_aabbBit)\n\t{\n\t\tb2Color color(0.9f, 0.3f, 0.9f);\n\t\tb2BroadPhase* bp = &m_contactManager.m_broadPhase;\n\n\t\tfor (b2Body* b = m_bodyList; b; b = b->GetNext())\n\t\t{\n\t\t\tif (b->IsActive() == false)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (b2Fixture* f = b->GetFixtureList(); f; f = f->GetNext())\n\t\t\t{\n\t\t\t\tfor (int32 i = 0; i < f->m_proxyCount; ++i)\n\t\t\t\t{\n\t\t\t\t\tb2FixtureProxy* proxy = f->m_proxies + i;\n\t\t\t\t\tb2AABB aabb = bp->GetFatAABB(proxy->proxyId);\n\t\t\t\t\tb2Vec2 vs[4];\n\t\t\t\t\tvs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y);\n\t\t\t\t\tvs[1].Set(aabb.upperBound.x, aabb.lowerBound.y);\n\t\t\t\t\tvs[2].Set(aabb.upperBound.x, aabb.upperBound.y);\n\t\t\t\t\tvs[3].Set(aabb.lowerBound.x, aabb.upperBound.y);\n\n\t\t\t\t\tm_debugDraw->DrawPolygon(vs, 4, color);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (flags & b2Draw::e_centerOfMassBit)\n\t{\n\t\tfor (b2Body* b = m_bodyList; b; b = b->GetNext())\n\t\t{\n\t\t\tb2Transform xf = b->GetTransform();\n\t\t\txf.p = b->GetWorldCenter();\n\t\t\tm_debugDraw->DrawTransform(xf);\n\t\t}\n\t}\n}\n\nint32 b2World::GetProxyCount() const\n{\n\treturn m_contactManager.m_broadPhase.GetProxyCount();\n}\n\nint32 b2World::GetTreeHeight() const\n{\n\treturn m_contactManager.m_broadPhase.GetTreeHeight();\n}\n\nint32 b2World::GetTreeBalance() const\n{\n\treturn m_contactManager.m_broadPhase.GetTreeBalance();\n}\n\nfloat32 b2World::GetTreeQuality() const\n{\n\treturn m_contactManager.m_broadPhase.GetTreeQuality();\n}\n\nvoid b2World::ShiftOrigin(const b2Vec2& newOrigin)\n{\n\tb2Assert((m_flags & e_locked) == 0);\n\tif ((m_flags & e_locked) == e_locked)\n\t{\n\t\treturn;\n\t}\n\n\tfor (b2Body* b = m_bodyList; b; b = b->m_next)\n\t{\n\t\tb->m_xf.p -= newOrigin;\n\t\tb->m_sweep.c0 -= newOrigin;\n\t\tb->m_sweep.c -= newOrigin;\n\t}\n\n\tfor (b2Joint* j = m_jointList; j; j = j->m_next)\n\t{\n\t\tj->ShiftOrigin(newOrigin);\n\t}\n\n\tm_contactManager.m_broadPhase.ShiftOrigin(newOrigin);\n}\n\nvoid b2World::Dump()\n{\n\tif ((m_flags & e_locked) == e_locked)\n\t{\n\t\treturn;\n\t}\n\n\tb2Log(\"b2Vec2 g(%.15lef, %.15lef);\\n\", m_gravity.x, m_gravity.y);\n\tb2Log(\"m_world->SetGravity(g);\\n\");\n\n\tb2Log(\"b2Body** bodies = (b2Body**)b2Alloc(%d * sizeof(b2Body*));\\n\", m_bodyCount);\n\tb2Log(\"b2Joint** joints = (b2Joint**)b2Alloc(%d * sizeof(b2Joint*));\\n\", m_jointCount);\n\tint32 i = 0;\n\tfor (b2Body* b = m_bodyList; b; b = b->m_next)\n\t{\n\t\tb->m_islandIndex = i;\n\t\tb->Dump();\n\t\t++i;\n\t}\n\n\ti = 0;\n\tfor (b2Joint* j = m_jointList; j; j = j->m_next)\n\t{\n\t\tj->m_index = i;\n\t\t++i;\n\t}\n\n\t// First pass on joints, skip gear joints.\n\tfor (b2Joint* j = m_jointList; j; j = j->m_next)\n\t{\n\t\tif (j->m_type == e_gearJoint)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tb2Log(\"{\\n\");\n\t\tj->Dump();\n\t\tb2Log(\"}\\n\");\n\t}\n\n\t// Second pass on joints, only gear joints.\n\tfor (b2Joint* j = m_jointList; j; j = j->m_next)\n\t{\n\t\tif (j->m_type != e_gearJoint)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tb2Log(\"{\\n\");\n\t\tj->Dump();\n\t\tb2Log(\"}\\n\");\n\t}\n\n\tb2Log(\"b2Free(joints);\\n\");\n\tb2Log(\"b2Free(bodies);\\n\");\n\tb2Log(\"joints = NULL;\\n\");\n\tb2Log(\"bodies = NULL;\\n\");\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2World.h",
    "content": "/*\n* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_WORLD_H\n#define B2_WORLD_H\n\n#include <Box2D/Common/b2Math.h>\n#include <Box2D/Common/b2BlockAllocator.h>\n#include <Box2D/Common/b2StackAllocator.h>\n#include <Box2D/Dynamics/b2ContactManager.h>\n#include <Box2D/Dynamics/b2WorldCallbacks.h>\n#include <Box2D/Dynamics/b2TimeStep.h>\n\nstruct b2AABB;\nstruct b2BodyDef;\nstruct b2Color;\nstruct b2JointDef;\nclass b2Body;\nclass b2Draw;\nclass b2Fixture;\nclass b2Joint;\n\n/// The world class manages all physics entities, dynamic simulation,\n/// and asynchronous queries. The world also contains efficient memory\n/// management facilities.\nclass b2World\n{\npublic:\n\t/// Construct a world object.\n\t/// @param gravity the world gravity vector.\n\tb2World(const b2Vec2& gravity);\n\n\t/// Destruct the world. All physics entities are destroyed and all heap memory is released.\n\t~b2World();\n\n\t/// Register a destruction listener. The listener is owned by you and must\n\t/// remain in scope.\n\tvoid SetDestructionListener(b2DestructionListener* listener);\n\n\t/// Register a contact filter to provide specific control over collision.\n\t/// Otherwise the default filter is used (b2_defaultFilter). The listener is\n\t/// owned by you and must remain in scope. \n\tvoid SetContactFilter(b2ContactFilter* filter);\n\n\t/// Register a contact event listener. The listener is owned by you and must\n\t/// remain in scope.\n\tvoid SetContactListener(b2ContactListener* listener);\n\n\t/// Register a routine for debug drawing. The debug draw functions are called\n\t/// inside with b2World::DrawDebugData method. The debug draw object is owned\n\t/// by you and must remain in scope.\n\tvoid SetDebugDraw(b2Draw* debugDraw);\n\n\t/// Create a rigid body given a definition. No reference to the definition\n\t/// is retained.\n\t/// @warning This function is locked during callbacks.\n\tb2Body* CreateBody(const b2BodyDef* def);\n\n\t/// Destroy a rigid body given a definition. No reference to the definition\n\t/// is retained. This function is locked during callbacks.\n\t/// @warning This automatically deletes all associated shapes and joints.\n\t/// @warning This function is locked during callbacks.\n\tvoid DestroyBody(b2Body* body);\n\n\t/// Create a joint to constrain bodies together. No reference to the definition\n\t/// is retained. This may cause the connected bodies to cease colliding.\n\t/// @warning This function is locked during callbacks.\n\tb2Joint* CreateJoint(const b2JointDef* def);\n\n\t/// Destroy a joint. This may cause the connected bodies to begin colliding.\n\t/// @warning This function is locked during callbacks.\n\tvoid DestroyJoint(b2Joint* joint);\n\n\t/// Take a time step. This performs collision detection, integration,\n\t/// and constraint solution.\n\t/// @param timeStep the amount of time to simulate, this should not vary.\n\t/// @param velocityIterations for the velocity constraint solver.\n\t/// @param positionIterations for the position constraint solver.\n\tvoid Step(\tfloat32 timeStep,\n\t\t\t\tint32 velocityIterations,\n\t\t\t\tint32 positionIterations);\n\n\t/// Manually clear the force buffer on all bodies. By default, forces are cleared automatically\n\t/// after each call to Step. The default behavior is modified by calling SetAutoClearForces.\n\t/// The purpose of this function is to support sub-stepping. Sub-stepping is often used to maintain\n\t/// a fixed sized time step under a variable frame-rate.\n\t/// When you perform sub-stepping you will disable auto clearing of forces and instead call\n\t/// ClearForces after all sub-steps are complete in one pass of your game loop.\n\t/// @see SetAutoClearForces\n\tvoid ClearForces();\n\n\t/// Call this to draw shapes and other debug draw data. This is intentionally non-const.\n\tvoid DrawDebugData();\n\n\t/// Query the world for all fixtures that potentially overlap the\n\t/// provided AABB.\n\t/// @param callback a user implemented callback class.\n\t/// @param aabb the query box.\n\tvoid QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const;\n\n\t/// Ray-cast the world for all fixtures in the path of the ray. Your callback\n\t/// controls whether you get the closest point, any point, or n-points.\n\t/// The ray-cast ignores shapes that contain the starting point.\n\t/// @param callback a user implemented callback class.\n\t/// @param point1 the ray starting point\n\t/// @param point2 the ray ending point\n\tvoid RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const;\n\n\t/// Get the world body list. With the returned body, use b2Body::GetNext to get\n\t/// the next body in the world list. A NULL body indicates the end of the list.\n\t/// @return the head of the world body list.\n\tb2Body* GetBodyList();\n\tconst b2Body* GetBodyList() const;\n\n\t/// Get the world joint list. With the returned joint, use b2Joint::GetNext to get\n\t/// the next joint in the world list. A NULL joint indicates the end of the list.\n\t/// @return the head of the world joint list.\n\tb2Joint* GetJointList();\n\tconst b2Joint* GetJointList() const;\n\n\t/// Get the world contact list. With the returned contact, use b2Contact::GetNext to get\n\t/// the next contact in the world list. A NULL contact indicates the end of the list.\n\t/// @return the head of the world contact list.\n\t/// @warning contacts are created and destroyed in the middle of a time step.\n\t/// Use b2ContactListener to avoid missing contacts.\n\tb2Contact* GetContactList();\n\tconst b2Contact* GetContactList() const;\n\n\t/// Enable/disable sleep.\n\tvoid SetAllowSleeping(bool flag);\n\tbool GetAllowSleeping() const { return m_allowSleep; }\n\n\t/// Enable/disable warm starting. For testing.\n\tvoid SetWarmStarting(bool flag) { m_warmStarting = flag; }\n\tbool GetWarmStarting() const { return m_warmStarting; }\n\n\t/// Enable/disable continuous physics. For testing.\n\tvoid SetContinuousPhysics(bool flag) { m_continuousPhysics = flag; }\n\tbool GetContinuousPhysics() const { return m_continuousPhysics; }\n\n\t/// Enable/disable single stepped continuous physics. For testing.\n\tvoid SetSubStepping(bool flag) { m_subStepping = flag; }\n\tbool GetSubStepping() const { return m_subStepping; }\n\n\t/// Get the number of broad-phase proxies.\n\tint32 GetProxyCount() const;\n\n\t/// Get the number of bodies.\n\tint32 GetBodyCount() const;\n\n\t/// Get the number of joints.\n\tint32 GetJointCount() const;\n\n\t/// Get the number of contacts (each may have 0 or more contact points).\n\tint32 GetContactCount() const;\n\n\t/// Get the height of the dynamic tree.\n\tint32 GetTreeHeight() const;\n\n\t/// Get the balance of the dynamic tree.\n\tint32 GetTreeBalance() const;\n\n\t/// Get the quality metric of the dynamic tree. The smaller the better.\n\t/// The minimum is 1.\n\tfloat32 GetTreeQuality() const;\n\n\t/// Change the global gravity vector.\n\tvoid SetGravity(const b2Vec2& gravity);\n\t\n\t/// Get the global gravity vector.\n\tb2Vec2 GetGravity() const;\n\n\t/// Is the world locked (in the middle of a time step).\n\tbool IsLocked() const;\n\n\t/// Set flag to control automatic clearing of forces after each time step.\n\tvoid SetAutoClearForces(bool flag);\n\n\t/// Get the flag that controls automatic clearing of forces after each time step.\n\tbool GetAutoClearForces() const;\n\n\t/// Shift the world origin. Useful for large worlds.\n\t/// The body shift formula is: position -= newOrigin\n\t/// @param newOrigin the new origin with respect to the old origin\n\tvoid ShiftOrigin(const b2Vec2& newOrigin);\n\n\t/// Get the contact manager for testing.\n\tconst b2ContactManager& GetContactManager() const;\n\n\t/// Get the current profile.\n\tconst b2Profile& GetProfile() const;\n\n\t/// Dump the world into the log file.\n\t/// @warning this should be called outside of a time step.\n\tvoid Dump();\n\nprivate:\n\n\t// m_flags\n\tenum\n\t{\n\t\te_newFixture\t= 0x0001,\n\t\te_locked\t\t= 0x0002,\n\t\te_clearForces\t= 0x0004\n\t};\n\n\tfriend class b2Body;\n\tfriend class b2Fixture;\n\tfriend class b2ContactManager;\n\tfriend class b2Controller;\n\n\tvoid Solve(const b2TimeStep& step);\n\tvoid SolveTOI(const b2TimeStep& step);\n\n\tvoid DrawJoint(b2Joint* joint);\n\tvoid DrawShape(b2Fixture* shape, const b2Transform& xf, const b2Color& color);\n\n\tb2BlockAllocator m_blockAllocator;\n\tb2StackAllocator m_stackAllocator;\n\n\tint32 m_flags;\n\n\tb2ContactManager m_contactManager;\n\n\tb2Body* m_bodyList;\n\tb2Joint* m_jointList;\n\n\tint32 m_bodyCount;\n\tint32 m_jointCount;\n\n\tb2Vec2 m_gravity;\n\tbool m_allowSleep;\n\n\tb2DestructionListener* m_destructionListener;\n\tb2Draw* m_debugDraw;\n\n\t// This is used to compute the time step ratio to\n\t// support a variable time step.\n\tfloat32 m_inv_dt0;\n\n\t// These are for debugging the solver.\n\tbool m_warmStarting;\n\tbool m_continuousPhysics;\n\tbool m_subStepping;\n\n\tbool m_stepComplete;\n\n\tb2Profile m_profile;\n};\n\ninline b2Body* b2World::GetBodyList()\n{\n\treturn m_bodyList;\n}\n\ninline const b2Body* b2World::GetBodyList() const\n{\n\treturn m_bodyList;\n}\n\ninline b2Joint* b2World::GetJointList()\n{\n\treturn m_jointList;\n}\n\ninline const b2Joint* b2World::GetJointList() const\n{\n\treturn m_jointList;\n}\n\ninline b2Contact* b2World::GetContactList()\n{\n\treturn m_contactManager.m_contactList;\n}\n\ninline const b2Contact* b2World::GetContactList() const\n{\n\treturn m_contactManager.m_contactList;\n}\n\ninline int32 b2World::GetBodyCount() const\n{\n\treturn m_bodyCount;\n}\n\ninline int32 b2World::GetJointCount() const\n{\n\treturn m_jointCount;\n}\n\ninline int32 b2World::GetContactCount() const\n{\n\treturn m_contactManager.m_contactCount;\n}\n\ninline void b2World::SetGravity(const b2Vec2& gravity)\n{\n\tm_gravity = gravity;\n}\n\ninline b2Vec2 b2World::GetGravity() const\n{\n\treturn m_gravity;\n}\n\ninline bool b2World::IsLocked() const\n{\n\treturn (m_flags & e_locked) == e_locked;\n}\n\ninline void b2World::SetAutoClearForces(bool flag)\n{\n\tif (flag)\n\t{\n\t\tm_flags |= e_clearForces;\n\t}\n\telse\n\t{\n\t\tm_flags &= ~e_clearForces;\n\t}\n}\n\n/// Get the flag that controls automatic clearing of forces after each time step.\ninline bool b2World::GetAutoClearForces() const\n{\n\treturn (m_flags & e_clearForces) == e_clearForces;\n}\n\ninline const b2ContactManager& b2World::GetContactManager() const\n{\n\treturn m_contactManager;\n}\n\ninline const b2Profile& b2World::GetProfile() const\n{\n\treturn m_profile;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2WorldCallbacks.cpp",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Dynamics/b2WorldCallbacks.h>\n#include <Box2D/Dynamics/b2Fixture.h>\n\n// Return true if contact calculations should be performed between these two shapes.\n// If you implement your own collision filter you may want to build from this implementation.\nbool b2ContactFilter::ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB)\n{\n\tconst b2Filter& filterA = fixtureA->GetFilterData();\n\tconst b2Filter& filterB = fixtureB->GetFilterData();\n\n\tif (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0)\n\t{\n\t\treturn filterA.groupIndex > 0;\n\t}\n\n\tbool collide = (filterA.maskBits & filterB.categoryBits) != 0 && (filterA.categoryBits & filterB.maskBits) != 0;\n\treturn collide;\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Dynamics/b2WorldCallbacks.h",
    "content": "/*\n* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_WORLD_CALLBACKS_H\n#define B2_WORLD_CALLBACKS_H\n\n#include <Box2D/Common/b2Settings.h>\n\nstruct b2Vec2;\nstruct b2Transform;\nclass b2Fixture;\nclass b2Body;\nclass b2Joint;\nclass b2Contact;\nstruct b2ContactResult;\nstruct b2Manifold;\n\n/// Joints and fixtures are destroyed when their associated\n/// body is destroyed. Implement this listener so that you\n/// may nullify references to these joints and shapes.\nclass b2DestructionListener\n{\npublic:\n\tvirtual ~b2DestructionListener() {}\n\n\t/// Called when any joint is about to be destroyed due\n\t/// to the destruction of one of its attached bodies.\n\tvirtual void SayGoodbye(b2Joint* joint) = 0;\n\n\t/// Called when any fixture is about to be destroyed due\n\t/// to the destruction of its parent body.\n\tvirtual void SayGoodbye(b2Fixture* fixture) = 0;\n};\n\n/// Implement this class to provide collision filtering. In other words, you can implement\n/// this class if you want finer control over contact creation.\nclass b2ContactFilter\n{\npublic:\n\tvirtual ~b2ContactFilter() {}\n\n\t/// Return true if contact calculations should be performed between these two shapes.\n\t/// @warning for performance reasons this is only called when the AABBs begin to overlap.\n\tvirtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB);\n};\n\n/// Contact impulses for reporting. Impulses are used instead of forces because\n/// sub-step forces may approach infinity for rigid body collisions. These\n/// match up one-to-one with the contact points in b2Manifold.\nstruct b2ContactImpulse\n{\n\tfloat32 normalImpulses[b2_maxManifoldPoints];\n\tfloat32 tangentImpulses[b2_maxManifoldPoints];\n\tint32 count;\n};\n\n/// Implement this class to get contact information. You can use these results for\n/// things like sounds and game logic. You can also get contact results by\n/// traversing the contact lists after the time step. However, you might miss\n/// some contacts because continuous physics leads to sub-stepping.\n/// Additionally you may receive multiple callbacks for the same contact in a\n/// single time step.\n/// You should strive to make your callbacks efficient because there may be\n/// many callbacks per time step.\n/// @warning You cannot create/destroy Box2D entities inside these callbacks.\nclass b2ContactListener\n{\npublic:\n\tvirtual ~b2ContactListener() {}\n\n\t/// Called when two fixtures begin to touch.\n\tvirtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); }\n\n\t/// Called when two fixtures cease to touch.\n\tvirtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); }\n\n\t/// This is called after a contact is updated. This allows you to inspect a\n\t/// contact before it goes to the solver. If you are careful, you can modify the\n\t/// contact manifold (e.g. disable contact).\n\t/// A copy of the old manifold is provided so that you can detect changes.\n\t/// Note: this is called only for awake bodies.\n\t/// Note: this is called even when the number of contact points is zero.\n\t/// Note: this is not called for sensors.\n\t/// Note: if you set the number of contact points to zero, you will not\n\t/// get an EndContact callback. However, you may get a BeginContact callback\n\t/// the next step.\n\tvirtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold)\n\t{\n\t\tB2_NOT_USED(contact);\n\t\tB2_NOT_USED(oldManifold);\n\t}\n\n\t/// This lets you inspect a contact after the solver is finished. This is useful\n\t/// for inspecting impulses.\n\t/// Note: the contact manifold does not include time of impact impulses, which can be\n\t/// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly\n\t/// in a separate data structure.\n\t/// Note: this is only called for contacts that are touching, solid, and awake.\n\tvirtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse)\n\t{\n\t\tB2_NOT_USED(contact);\n\t\tB2_NOT_USED(impulse);\n\t}\n};\n\n/// Callback class for AABB queries.\n/// See b2World::Query\nclass b2QueryCallback\n{\npublic:\n\tvirtual ~b2QueryCallback() {}\n\n\t/// Called for each fixture found in the query AABB.\n\t/// @return false to terminate the query.\n\tvirtual bool ReportFixture(b2Fixture* fixture) = 0;\n};\n\n/// Callback class for ray casts.\n/// See b2World::RayCast\nclass b2RayCastCallback\n{\npublic:\n\tvirtual ~b2RayCastCallback() {}\n\n\t/// Called for each fixture found in the query. You control how the ray cast\n\t/// proceeds by returning a float:\n\t/// return -1: ignore this fixture and continue\n\t/// return 0: terminate the ray cast\n\t/// return fraction: clip the ray to this point\n\t/// return 1: don't clip the ray and continue\n\t/// @param fixture the fixture hit by the ray\n\t/// @param point the point of initial intersection\n\t/// @param normal the normal vector at the point of intersection\n\t/// @return -1 to filter, 0 to terminate, fraction to clip the ray for\n\t/// closest hit, 1 to continue\n\tvirtual float32 ReportFixture(\tb2Fixture* fixture, const b2Vec2& point,\n\t\t\t\t\t\t\t\t\tconst b2Vec2& normal, float32 fraction) = 0;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/Rope/b2Rope.cpp",
    "content": "/*\n* Copyright (c) 2011 Erin Catto http://box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#include <Box2D/Rope/b2Rope.h>\n#include <Box2D/Common/b2Draw.h>\n\nb2Rope::b2Rope()\n{\n\tm_count = 0;\n\tm_ps = NULL;\n\tm_p0s = NULL;\n\tm_vs = NULL;\n\tm_ims = NULL;\n\tm_Ls = NULL;\n\tm_as = NULL;\n\tm_gravity.SetZero();\n\tm_k2 = 1.0f;\n\tm_k3 = 0.1f;\n}\n\nb2Rope::~b2Rope()\n{\n\tb2Free(m_ps);\n\tb2Free(m_p0s);\n\tb2Free(m_vs);\n\tb2Free(m_ims);\n\tb2Free(m_Ls);\n\tb2Free(m_as);\n}\n\nvoid b2Rope::Initialize(const b2RopeDef* def)\n{\n\tb2Assert(def->count >= 3);\n\tm_count = def->count;\n\tm_ps = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2));\n\tm_p0s = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2));\n\tm_vs = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2));\n\tm_ims = (float32*)b2Alloc(m_count * sizeof(float32));\n\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tm_ps[i] = def->vertices[i];\n\t\tm_p0s[i] = def->vertices[i];\n\t\tm_vs[i].SetZero();\n\n\t\tfloat32 m = def->masses[i];\n\t\tif (m > 0.0f)\n\t\t{\n\t\t\tm_ims[i] = 1.0f / m;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm_ims[i] = 0.0f;\n\t\t}\n\t}\n\n\tint32 count2 = m_count - 1;\n\tint32 count3 = m_count - 2;\n\tm_Ls = (float32*)b2Alloc(count2 * sizeof(float32));\n\tm_as = (float32*)b2Alloc(count3 * sizeof(float32));\n\n\tfor (int32 i = 0; i < count2; ++i)\n\t{\n\t\tb2Vec2 p1 = m_ps[i];\n\t\tb2Vec2 p2 = m_ps[i+1];\n\t\tm_Ls[i] = b2Distance(p1, p2);\n\t}\n\n\tfor (int32 i = 0; i < count3; ++i)\n\t{\n\t\tb2Vec2 p1 = m_ps[i];\n\t\tb2Vec2 p2 = m_ps[i + 1];\n\t\tb2Vec2 p3 = m_ps[i + 2];\n\n\t\tb2Vec2 d1 = p2 - p1;\n\t\tb2Vec2 d2 = p3 - p2;\n\n\t\tfloat32 a = b2Cross(d1, d2);\n\t\tfloat32 b = b2Dot(d1, d2);\n\n\t\tm_as[i] = b2Atan2(a, b);\n\t}\n\n\tm_gravity = def->gravity;\n\tm_damping = def->damping;\n\tm_k2 = def->k2;\n\tm_k3 = def->k3;\n}\n\nvoid b2Rope::Step(float32 h, int32 iterations)\n{\n\tif (h == 0.0)\n\t{\n\t\treturn;\n\t}\n\n\tfloat32 d = expf(- h * m_damping);\n\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tm_p0s[i] = m_ps[i];\n\t\tif (m_ims[i] > 0.0f)\n\t\t{\n\t\t\tm_vs[i] += h * m_gravity;\n\t\t}\n\t\tm_vs[i] *= d;\n\t\tm_ps[i] += h * m_vs[i];\n\n\t}\n\n\tfor (int32 i = 0; i < iterations; ++i)\n\t{\n\t\tSolveC2();\n\t\tSolveC3();\n\t\tSolveC2();\n\t}\n\n\tfloat32 inv_h = 1.0f / h;\n\tfor (int32 i = 0; i < m_count; ++i)\n\t{\n\t\tm_vs[i] = inv_h * (m_ps[i] - m_p0s[i]);\n\t}\n}\n\nvoid b2Rope::SolveC2()\n{\n\tint32 count2 = m_count - 1;\n\n\tfor (int32 i = 0; i < count2; ++i)\n\t{\n\t\tb2Vec2 p1 = m_ps[i];\n\t\tb2Vec2 p2 = m_ps[i + 1];\n\n\t\tb2Vec2 d = p2 - p1;\n\t\tfloat32 L = d.Normalize();\n\n\t\tfloat32 im1 = m_ims[i];\n\t\tfloat32 im2 = m_ims[i + 1];\n\n\t\tif (im1 + im2 == 0.0f)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tfloat32 s1 = im1 / (im1 + im2);\n\t\tfloat32 s2 = im2 / (im1 + im2);\n\n\t\tp1 -= m_k2 * s1 * (m_Ls[i] - L) * d;\n\t\tp2 += m_k2 * s2 * (m_Ls[i] - L) * d;\n\n\t\tm_ps[i] = p1;\n\t\tm_ps[i + 1] = p2;\n\t}\n}\n\nvoid b2Rope::SetAngle(float32 angle)\n{\n\tint32 count3 = m_count - 2;\n\tfor (int32 i = 0; i < count3; ++i)\n\t{\n\t\tm_as[i] = angle;\n\t}\n}\n\nvoid b2Rope::SolveC3()\n{\n\tint32 count3 = m_count - 2;\n\n\tfor (int32 i = 0; i < count3; ++i)\n\t{\n\t\tb2Vec2 p1 = m_ps[i];\n\t\tb2Vec2 p2 = m_ps[i + 1];\n\t\tb2Vec2 p3 = m_ps[i + 2];\n\n\t\tfloat32 m1 = m_ims[i];\n\t\tfloat32 m2 = m_ims[i + 1];\n\t\tfloat32 m3 = m_ims[i + 2];\n\n\t\tb2Vec2 d1 = p2 - p1;\n\t\tb2Vec2 d2 = p3 - p2;\n\n\t\tfloat32 L1sqr = d1.LengthSquared();\n\t\tfloat32 L2sqr = d2.LengthSquared();\n\n\t\tif (L1sqr * L2sqr == 0.0f)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tfloat32 a = b2Cross(d1, d2);\n\t\tfloat32 b = b2Dot(d1, d2);\n\n\t\tfloat32 angle = b2Atan2(a, b);\n\n\t\tb2Vec2 Jd1 = (-1.0f / L1sqr) * d1.Skew();\n\t\tb2Vec2 Jd2 = (1.0f / L2sqr) * d2.Skew();\n\n\t\tb2Vec2 J1 = -Jd1;\n\t\tb2Vec2 J2 = Jd1 - Jd2;\n\t\tb2Vec2 J3 = Jd2;\n\n\t\tfloat32 mass = m1 * b2Dot(J1, J1) + m2 * b2Dot(J2, J2) + m3 * b2Dot(J3, J3);\n\t\tif (mass == 0.0f)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\n\t\tmass = 1.0f / mass;\n\n\t\tfloat32 C = angle - m_as[i];\n\n\t\twhile (C > b2_pi)\n\t\t{\n\t\t\tangle -= 2 * b2_pi;\n\t\t\tC = angle - m_as[i];\n\t\t}\n\n\t\twhile (C < -b2_pi)\n\t\t{\n\t\t\tangle += 2.0f * b2_pi;\n\t\t\tC = angle - m_as[i];\n\t\t}\n\n\t\tfloat32 impulse = - m_k3 * mass * C;\n\n\t\tp1 += (m1 * impulse) * J1;\n\t\tp2 += (m2 * impulse) * J2;\n\t\tp3 += (m3 * impulse) * J3;\n\n\t\tm_ps[i] = p1;\n\t\tm_ps[i + 1] = p2;\n\t\tm_ps[i + 2] = p3;\n\t}\n}\n\nvoid b2Rope::Draw(b2Draw* draw) const\n{\n\tb2Color c(0.4f, 0.5f, 0.7f);\n\n\tfor (int32 i = 0; i < m_count - 1; ++i)\n\t{\n\t\tdraw->DrawSegment(m_ps[i], m_ps[i+1], c);\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/Box2D/Rope/b2Rope.h",
    "content": "/*\n* Copyright (c) 2011 Erin Catto http://www.box2d.org\n*\n* This software is provided 'as-is', without any express or implied\n* warranty.  In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\n\n#ifndef B2_ROPE_H\n#define B2_ROPE_H\n\n#include <Box2D/Common/b2Math.h>\n\nclass b2Draw;\n\n/// \nstruct b2RopeDef\n{\n\tb2RopeDef()\n\t{\n\t\tvertices = NULL;\n\t\tcount = 0;\n\t\tmasses = NULL;\n\t\tgravity.SetZero();\n\t\tdamping = 0.1f;\n\t\tk2 = 0.9f;\n\t\tk3 = 0.1f;\n\t}\n\n\t///\n\tb2Vec2* vertices;\n\n\t///\n\tint32 count;\n\n\t///\n\tfloat32* masses;\n\n\t///\n\tb2Vec2 gravity;\n\n\t///\n\tfloat32 damping;\n\n\t/// Stretching stiffness\n\tfloat32 k2;\n\n\t/// Bending stiffness. Values above 0.5 can make the simulation blow up.\n\tfloat32 k3;\n};\n\n/// \nclass b2Rope\n{\npublic:\n\tb2Rope();\n\t~b2Rope();\n\n\t///\n\tvoid Initialize(const b2RopeDef* def);\n\n\t///\n\tvoid Step(float32 timeStep, int32 iterations);\n\n\t///\n\tint32 GetVertexCount() const\n\t{\n\t\treturn m_count;\n\t}\n\n\t///\n\tconst b2Vec2* GetVertices() const\n\t{\n\t\treturn m_ps;\n\t}\n\n\t///\n\tvoid Draw(b2Draw* draw) const;\n\n\t///\n\tvoid SetAngle(float32 angle);\n\nprivate:\n\n\tvoid SolveC2();\n\tvoid SolveC3();\n\n\tint32 m_count;\n\tb2Vec2* m_ps;\n\tb2Vec2* m_p0s;\n\tb2Vec2* m_vs;\n\n\tfloat32* m_ims;\n\n\tfloat32* m_Ls;\n\tfloat32* m_as;\n\n\tb2Vec2 m_gravity;\n\tfloat32 m_damping;\n\n\tfloat32 m_k2;\n\tfloat32 m_k3;\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/Box2D/proj.win32/Box2D.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libBox2D</ProjectName>\n    <ProjectGuid>{929480E7-23C0-4DF6-8456-096D71547116}</ProjectGuid>\n    <RootNamespace>Box2D.win32</RootNamespace>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(Configuration).win32\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration).win32\\</IntDir>\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>false</MinimalRebuild>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\Collision\\b2BroadPhase.cpp\" />\n    <ClCompile Include=\"..\\Collision\\b2CollideCircle.cpp\" />\n    <ClCompile Include=\"..\\Collision\\b2CollideEdge.cpp\" />\n    <ClCompile Include=\"..\\Collision\\b2CollidePolygon.cpp\" />\n    <ClCompile Include=\"..\\Collision\\b2Collision.cpp\" />\n    <ClCompile Include=\"..\\Collision\\b2Distance.cpp\" />\n    <ClCompile Include=\"..\\Collision\\b2DynamicTree.cpp\" />\n    <ClCompile Include=\"..\\Collision\\b2TimeOfImpact.cpp\" />\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2ChainShape.cpp\" />\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2CircleShape.cpp\" />\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2EdgeShape.cpp\" />\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2PolygonShape.cpp\" />\n    <ClCompile Include=\"..\\Common\\b2BlockAllocator.cpp\" />\n    <ClCompile Include=\"..\\Common\\b2Draw.cpp\" />\n    <ClCompile Include=\"..\\Common\\b2Math.cpp\" />\n    <ClCompile Include=\"..\\Common\\b2Settings.cpp\" />\n    <ClCompile Include=\"..\\Common\\b2StackAllocator.cpp\" />\n    <ClCompile Include=\"..\\Common\\b2Timer.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\b2Body.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\b2ContactManager.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\b2Fixture.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\b2Island.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\b2World.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\b2WorldCallbacks.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2ChainAndCircleContact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2ChainAndPolygonContact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2CircleContact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2Contact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2ContactSolver.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2EdgeAndCircleContact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2EdgeAndPolygonContact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2PolygonAndCircleContact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2PolygonContact.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2DistanceJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2FrictionJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2GearJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2Joint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2MotorJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2MouseJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2PrismaticJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2PulleyJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2RevoluteJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2RopeJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2WeldJoint.cpp\" />\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2WheelJoint.cpp\" />\n    <ClCompile Include=\"..\\Rope\\b2Rope.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\Collision\\b2BroadPhase.h\" />\n    <ClInclude Include=\"..\\Collision\\b2Collision.h\" />\n    <ClInclude Include=\"..\\Collision\\b2Distance.h\" />\n    <ClInclude Include=\"..\\Collision\\b2DynamicTree.h\" />\n    <ClInclude Include=\"..\\Collision\\b2TimeOfImpact.h\" />\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2ChainShape.h\" />\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2CircleShape.h\" />\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2EdgeShape.h\" />\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2PolygonShape.h\" />\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2Shape.h\" />\n    <ClInclude Include=\"..\\Common\\b2BlockAllocator.h\" />\n    <ClInclude Include=\"..\\Common\\b2Draw.h\" />\n    <ClInclude Include=\"..\\Common\\b2GrowableStack.h\" />\n    <ClInclude Include=\"..\\Common\\b2Math.h\" />\n    <ClInclude Include=\"..\\Common\\b2Settings.h\" />\n    <ClInclude Include=\"..\\Common\\b2StackAllocator.h\" />\n    <ClInclude Include=\"..\\Common\\b2Timer.h\" />\n    <ClInclude Include=\"..\\Dynamics\\b2Body.h\" />\n    <ClInclude Include=\"..\\Dynamics\\b2ContactManager.h\" />\n    <ClInclude Include=\"..\\Dynamics\\b2Fixture.h\" />\n    <ClInclude Include=\"..\\Dynamics\\b2Island.h\" />\n    <ClInclude Include=\"..\\Dynamics\\b2TimeStep.h\" />\n    <ClInclude Include=\"..\\Dynamics\\b2World.h\" />\n    <ClInclude Include=\"..\\Dynamics\\b2WorldCallbacks.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2ChainAndCircleContact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2ChainAndPolygonContact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2CircleContact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2Contact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2ContactSolver.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2EdgeAndCircleContact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2EdgeAndPolygonContact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2PolygonAndCircleContact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2PolygonContact.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2DistanceJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2FrictionJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2GearJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2Joint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2MotorJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2MouseJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2PrismaticJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2PulleyJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2RevoluteJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2RopeJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2WeldJoint.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2WheelJoint.h\" />\n    <ClInclude Include=\"..\\Rope\\b2Rope.h\" />\n    <ClInclude Include=\"..\\Box2D.h\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/external/Box2D/proj.win32/Box2D.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Collision\">\n      <UniqueIdentifier>{bdf099c5-cc32-468b-b53f-ec010d7f823f}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Collision\\Shapes\">\n      <UniqueIdentifier>{92792f88-4e5c-46ee-8d87-002f3b2297ae}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Common\">\n      <UniqueIdentifier>{f41a6fa6-5ac1-4514-9ac0-6f3a38f35b4d}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Dynamics\">\n      <UniqueIdentifier>{0b56913a-34b7-410a-b386-869d6f7a20be}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Dynamics\\Contacts\">\n      <UniqueIdentifier>{f0e7b230-79cc-49b8-9ed7-9dbfa062f2a4}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Dynamics\\Joints\">\n      <UniqueIdentifier>{932f2008-afbe-42f5-993d-a1df0ec67756}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Rope\">\n      <UniqueIdentifier>{f8937e09-93a4-49fa-8f3e-dfc36da764df}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\Collision\\b2BroadPhase.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\b2CollideCircle.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\b2CollideEdge.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\b2CollidePolygon.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\b2Collision.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\b2Distance.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\b2DynamicTree.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\b2TimeOfImpact.cpp\">\n      <Filter>Collision</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2ChainShape.cpp\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2CircleShape.cpp\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2EdgeShape.cpp\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Collision\\Shapes\\b2PolygonShape.cpp\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Common\\b2BlockAllocator.cpp\">\n      <Filter>Common</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Common\\b2Draw.cpp\">\n      <Filter>Common</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Common\\b2Math.cpp\">\n      <Filter>Common</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Common\\b2Settings.cpp\">\n      <Filter>Common</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Common\\b2StackAllocator.cpp\">\n      <Filter>Common</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Common\\b2Timer.cpp\">\n      <Filter>Common</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\b2Body.cpp\">\n      <Filter>Dynamics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\b2ContactManager.cpp\">\n      <Filter>Dynamics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\b2Fixture.cpp\">\n      <Filter>Dynamics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\b2Island.cpp\">\n      <Filter>Dynamics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\b2World.cpp\">\n      <Filter>Dynamics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\b2WorldCallbacks.cpp\">\n      <Filter>Dynamics</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2ChainAndCircleContact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2ChainAndPolygonContact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2CircleContact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2Contact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2ContactSolver.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2EdgeAndCircleContact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2EdgeAndPolygonContact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2PolygonAndCircleContact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Contacts\\b2PolygonContact.cpp\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2DistanceJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2FrictionJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2GearJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2Joint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2MouseJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2PrismaticJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2PulleyJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2RevoluteJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2RopeJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2WeldJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2WheelJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Rope\\b2Rope.cpp\">\n      <Filter>Rope</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Dynamics\\Joints\\b2MotorJoint.cpp\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\Collision\\b2BroadPhase.h\">\n      <Filter>Collision</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\b2Collision.h\">\n      <Filter>Collision</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\b2Distance.h\">\n      <Filter>Collision</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\b2DynamicTree.h\">\n      <Filter>Collision</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\b2TimeOfImpact.h\">\n      <Filter>Collision</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2ChainShape.h\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2CircleShape.h\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2EdgeShape.h\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2PolygonShape.h\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Collision\\Shapes\\b2Shape.h\">\n      <Filter>Collision\\Shapes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Common\\b2BlockAllocator.h\">\n      <Filter>Common</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Common\\b2Draw.h\">\n      <Filter>Common</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Common\\b2GrowableStack.h\">\n      <Filter>Common</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Common\\b2Math.h\">\n      <Filter>Common</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Common\\b2Settings.h\">\n      <Filter>Common</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Common\\b2StackAllocator.h\">\n      <Filter>Common</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Common\\b2Timer.h\">\n      <Filter>Common</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\b2Body.h\">\n      <Filter>Dynamics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\b2ContactManager.h\">\n      <Filter>Dynamics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\b2Fixture.h\">\n      <Filter>Dynamics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\b2Island.h\">\n      <Filter>Dynamics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\b2TimeStep.h\">\n      <Filter>Dynamics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\b2World.h\">\n      <Filter>Dynamics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\b2WorldCallbacks.h\">\n      <Filter>Dynamics</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2ChainAndCircleContact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2ChainAndPolygonContact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2CircleContact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2Contact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2ContactSolver.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2EdgeAndCircleContact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2EdgeAndPolygonContact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2PolygonAndCircleContact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Contacts\\b2PolygonContact.h\">\n      <Filter>Dynamics\\Contacts</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2DistanceJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2FrictionJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2GearJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2Joint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2MouseJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2PrismaticJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2PulleyJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2RevoluteJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2RopeJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2WeldJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2WheelJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Rope\\b2Rope.h\">\n      <Filter>Rope</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Box2D.h\" />\n    <ClInclude Include=\"..\\Dynamics\\Joints\\b2MotorJoint.h\">\n      <Filter>Dynamics\\Joints</Filter>\n    </ClInclude>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/external/chipmunk/.gitignore",
    "content": ".DS_Store\ndoc/index.html\nxcode/Chipmunk6.xcodeproj/*.pbxuser\nxcode/Chipmunk6.xcodeproj/*.perspectivev3\nxcode/Chipmunk6.xcodeproj/xcuserdata\nxcode/Chipmunk6.xcodeproj/project.xcworkspace\nxcode/DerivedData\nbuild\nmsvc\n"
  },
  {
    "path": "cocos2d/external/chipmunk/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := chipmunk_static\n\nLOCAL_MODULE_FILENAME := libchipmunk\n\nLOCAL_SRC_FILES := \\\nsrc/chipmunk.c \\\nsrc/cpArbiter.c \\\nsrc/cpArray.c \\\nsrc/cpBB.c \\\nsrc/cpBBTree.c \\\nsrc/cpBody.c \\\nsrc/cpCollision.c \\\nsrc/cpHashSet.c \\\nsrc/cpPolyShape.c \\\nsrc/cpShape.c \\\nsrc/cpSpace.c \\\nsrc/cpSpaceComponent.c \\\nsrc/cpSpaceHash.c \\\nsrc/cpSpaceQuery.c \\\nsrc/cpSpaceStep.c \\\nsrc/cpSpatialIndex.c \\\nsrc/cpSweep1D.c \\\nsrc/cpVect.c \\\nsrc/constraints/cpConstraint.c \\\nsrc/constraints/cpDampedRotarySpring.c \\\nsrc/constraints/cpDampedSpring.c \\\nsrc/constraints/cpGearJoint.c \\\nsrc/constraints/cpGrooveJoint.c \\\nsrc/constraints/cpPinJoint.c \\\nsrc/constraints/cpPivotJoint.c \\\nsrc/constraints/cpRatchetJoint.c \\\nsrc/constraints/cpRotaryLimitJoint.c \\\nsrc/constraints/cpSimpleMotor.c \\\nsrc/constraints/cpSlideJoint.c\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk\nLOCAL_CFLAGS := -std=c99\n                                 \ninclude $(BUILD_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/chipmunk/LICENSE.txt",
    "content": "Copyright (c) 2007 Scott Lembcke and Howling Moon Software\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "cocos2d/external/chipmunk/README.txt",
    "content": "ABOUT:\nChipmunk is a simple, lightweight and fast 2D rigid body physics library written in C. It's licensed under the unrestrictive, OSI approved MIT license. My aim is to give 2D developers access the same quality of physics you find in newer 3D games. I hope you enjoy using Chipmunk, and please consider donating to help make it worth our time to continue to support Chipmunk with great new features.\n\nCONTRACTING:\nHowling Moon Software (my company) is available for contracting if you want to make the physics in your game really stand out. Given our unique experience with the library, we can help you use Chipmunk to it's fullest potential. Feel free to contact us through our webpage: http://howlingmoonsoftware.com/contracting.php\n\nBUILDING:\nMac OS X: There is an included XCode project file for building the static library and demo application. Alteratively you could use the CMake files.\n\niPhone: The XCode project can build a static library with all the proper compiler settings. Additionally, if you run the iphonestatic.sh script in the macosx/ directory, it will build you a fat library compiled as release for the device and debug for the simulator. After building that, just copy the static lib and include/chipmunk/ directory to your project.\n\nUNIX: A forum user was kind enough to make a set of CMake files for Chipmunk. This will require you to have CMake installed. To build run 'cmake .' then 'make'. This should build a dynamic library, a static library, and the demo application.\n\nWindows: There is an included MSVC project for building the library and demo application. I do not personally maintain the MSVC project and it apparently hasn't worked for a while. If you are a MSVC whiz, consider lending a hand.\n\nRuby: I've been using maintaining a Ruby extension for Chipmunk, but at this time is not up to date with all the latest changes. A forum member has been working on an FFI based extention, and that may be a better way to take advantage of Chipmunk from Ruby. Another forum user has offered to maintain the non-FFI version of the extension. Stay tuned.\n\nGETTING STARTED:\nFirst of all, you can find the C API documentation here: http://code.google.com/p/chipmunk-physics/wiki/Documentation\n\nA good starting point is to take a look at the included Demo application. The demos all just set up a Chipmunk simulation space and the demo app draws the graphics directly out of that. This makes it easy to see how the Chipmunk API works without worrying about the graphics code. You are free to use the demo drawing routines in your own projects, though it is certainly not the recommended way of drawing Chipmunk objects as it pokes around at the undocumented parts of Chipmunk.\n\nFORUM:\nhttp://www.slembcke.net/forums\n\nCONTACT:\nslembcke@gmail.com (also on Google Talk)\n\nCHANGES SINCE 5.0.0:\n* Fixed a NaN issue where raycasts for horizontal or vertical lines would end up in an infinite loop.\n* Fixed a number of memory leaks.\n* Fixed a number of warnings for various compiler/OS combinations.\n* Fixed a number of API issues:\n  * Rejecting a collision from a begin() callback permanently rejects the collision until separation.\n  * Erroneous collision type parameterns removed from cpSpaceDefaulteCollisionHandler().\n* Moved FFI declarations of inlined functions into their own header.\n* Rearranged the project structure to separate out the header files into a separate include/ directory.\n* Added a static library target for the iPhone.\n* Type changes when building on the iPhone to make it friendlier to other APIs.\n* Added an AABB query to complement point and segment queries.\n* Added CP_NO_GROUP and CP_ALL_LAYERS constants.\n\nCHANGES SINCE 4.x:\n* Brand new Joint/Constraint API: New constraints can be added easily and are much more flexible than the old joint system\n* Efficient Segment Queries - Like raycasting, but with line segments.\n* Brand new collision callback API: Collision begin/separate events, API for removal of objects within callbacks, more programable control over collision handling."
  },
  {
    "path": "cocos2d/external/chipmunk/chipmunk-docs.html",
    "content": "\t<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n    <head>\n        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n        <title>Chipmunk Game Dynamics Documentation</title>\n                    <style type=\"text/css\">\n                        h1 {\n                                text-align: center;\n                                font-size: 300%;\n                        }\n\n                        h2, h3 {\n                                background-color: BurlyWood;\n                                padding: 3px;\n                        }\n\n                        p {\n                                margin-left: 1em;\n                        }\n\n                        p.expl {\n                                margin-left: 2em;\n                        }\n\n                        pre {\n                                background-color: lightGrey;\n                                padding: 3px;\n                                margin-left: 1em;\n                        }\n                </style>\n    </head>\n    <body>\n\n\t<h1>Chipmunk Game Dynamics</h1>\n\n\n\t<h2>Introduction</h2>\n\n\n\t<p>First of all, Chipmunk is a 2D rigid body physics library distributed under the <span class=\"caps\">MIT</span> license. Though not yet complete, it is intended to be fast, numerically stable, and easy to use.</p>\n\n\n\t<p>It&#8217;s been a long time in coming, but I&#8217;ve finally made a stable and usable physics implementation. While not feature complete yet, it&#8217;s well on it&#8217;s way. I would like to give a Erin Catto a big thank you, as the most of the ideas for the constraint solver come from his Box2D example code. (<a href=\"http://www.gphysics.com/\">gPhysics Website</a>). His contact persistence idea allows for stable stacks of objects with very few iterations of the contact solution. Couldn&#8217;t have gotten that working without his help.</p>\n\n\n\t<h2>Overview</h2>\n\n\n\t<ul>\n\t<li><strong>rigid bodies:</strong> A rigid body holds the physical properties of an object. (mass, position, rotation, velocity, etc.) It does not have a shape by itself. If you&#8217;ve done physics with particles before, rigid bodies differ mostly in that they are able to rotate.</li>\n\t\t<li><strong>collision shapes:</strong> By attaching shapes to bodies, you can define the a body&#8217;s shape. You can attach many shapes to a single body to define a complex shape, or none if it doesn&#8217;t require a shape.</li>\n\t\t<li><strong>joints:</strong> You can attach joints between two bodies to constrain their behavior.</li>\n\t\t<li><strong>spaces:</strong> Spaces are the basic simulation unit in Chipmunk. You add bodies, shapes and joints to a space, and then update the space as a whole.</li>\n\t</ul>\n\n\n\t<p><strong>Rigid bodies, collision shapes and sprites:</strong></p>\n\n\n\t<p>There is often confusion between rigid bodies and their collision shapes in Chipmunk and how they relate to sprites. A sprite would be a visual representation of an object, the sprite is drawn at the position of the rigid body. The collision shape would be the material representation of the object, and how it should collide with other objects. A sprite and collision shape have little to do with one another other than you probably want the collision shape to match the sprite&#8217;s shape.</p>\n\n\n\t<h2><span class=\"caps\">C API</span> Documentation</h2>\n\n\n\t<h3>Initializing Chipmunk</h3>\n\n\n\t<p>Initializing Chipmunk is an extremely complicated process. The following code snippet steps you through the process:</p>\n\n\n<pre><code>\ncpInitChipmunk(); /* Actually, that's pretty much it */\n</code></pre>\n\n\t<h3>Chipmunk memory management</h3>\n\n\n\t<p>For many of the structures you will use, Chipmunk uses a more or less standard set of memory management functions. For instance:</p>\n\n\n\t<ul>\n\t<li><code>cpSpaceAlloc()</code> allocates but does not initialize a <code>cpSpace</code> struct.</li>\n\t\t<li><code>cpSpaceInit(space, other_args)</code> initializes a <code>cpSpace</code> struct.</li>\n\t\t<li><code>cpSpaceNew(args)</code> allocates and initializes a <code>cpSpace</code> struct using <code>args</code>.</li>\n\t\t<li><code>cpSpaceDestroy(space)</code> frees all dependancies, but does not free the <code>cpSpace</code> struct.</li>\n\t\t<li><code>cpSpaceFree(space)</code> frees all dependancies and the <code>cpSpace</code> struct.</li>\n\t</ul>\n\n\n\t<p>While you will probably use the new/free versions exclusively, the others can be helpful when writing language extensions.</p>\n\n\n\t<p>In general, you are responsible for freeing any structs that you allocate. The only exception is that <code>cpShapeDestroy()</code> also destroys the specific shape struct that was passed to the constructor.</p>\n\n\n\t<h3>Chipmunk floats: <code>cpFloat</code></h3>\n\n\n<pre><code>\ntypedef float cpFloat;\n</code></pre>\n\n\t<p>All Chipmunk code should be <code>double</code> safe, so feel free to redefine this.</p>\n\n\n\t<h3>Chipmunk vectors: <code>cpVect</code></h3>\n\n\n\t<p><strong>User accessible fields:</strong></p>\n\n\n<pre><code>\ntypedef struct cpVect{\n    cpFloat x,y;\n} cpVect\n</code></pre>\n\n\t<p class=\"expl\">Simply a 2D vector packed into a struct. May change in the future to take advantage of <span class=\"caps\">SIMD</span>.</p>\n\n\n<pre><code>\n#define cpvzero ((cpVect){0.0f, 0.0f})\n</code></pre>\n\n\t<p class=\"expl\">Constant for the zero vector.</p>\n\n\n<pre><code>\ncpVect cpv(const cpFloat x, const cpFloat y)\n</code></pre>\n\n\t<p class=\"expl\">Convenience constructor for creating new <code>cpVect</code> structs.</p>\n\n\n<pre><code>\ncpVect cpvadd(const cpVect v1, const cpVect v2)\ncpVect cpvsub(const cpVect v1, const cpVect v2)\n</code></pre>\n\n\t<p class=\"expl\">Add or subtract two vectors.</p>\n\n\n<pre><code>\ncpVect cpvneg(const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Negate a vector.</p>\n\n\n<pre><code>\ncpVect cpvmult(const cpVect v, const cpFloat s)\n</code></pre>\n\n\t<p class=\"expl\">Scalar multiplication.</p>\n\n\n<pre><code>\ncpFloat cpvdot(const cpVect v1, const cpVect v2)\n</code></pre>\n\n\t<p class=\"expl\">Vector dot product.</p>\n\n\n<pre><code>\ncpFloat cpvcross(const cpVect v1, const cpVect v2)\n</code></pre>\n\n\t<p class=\"expl\">2D vector cross product analog. The cross product of 2D vectors exists only in the z component, so only that value is returned.</p>\n\n\n<pre><code>\ncpVect cpvperp(const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns the perpendicular vector. (90 degree rotation)</p>\n\n\n<pre><code>\ncpVect cpvproject(const cpVect v1, const cpVect v2)\n</code></pre>\n\n\t<p class=\"expl\">Returns the vector projection of <code>v1</code> onto <code>v2</code>.</p>\n\n\n<pre><code>\ncpVect cpvrotate(const cpVect v1, const cpVect v2)\n</code></pre>\n\n\t<p class=\"expl\">Uses complex multiplication to rotate (and scale) <code>v1</code> by <code>v2</code>.</p>\n\n\n<pre><code>\ncpVect cpvunrotate(const cpVect v1, const cpVect v2)\n</code></pre>\n\n\t<p class=\"expl\">Inverse of <code>cpvrotate()</code>.</p>\n\n\n<pre><code>\ncpFloat cpvlength(const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns the length of <code>v</code>.</p>\n\n\n<pre><code>\ncpFloat cpvlengthsq(const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns the squared length of <code>v</code>. Faster than <code>cpvlength()</code> when you only need to compare lengths.</p>\n\n\n<pre><code>\ncpVect cpvnormalize(const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns a normalized copy of <code>v</code>.</p>\n\n\n<pre><code>\ncpVect cpvforangle(const cpFloat a)\n</code></pre>\n\n\t<p class=\"expl\">Returns the unit length vector for the given angle (in radians).</p>\n\n\n<pre><code>\ncpFloat cpvtoangle(const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns the angular direction <code>v</code> is pointing in (in radians).</p>\n\n\n<pre><code>\n*cpvstr(const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns a string representation of <code>v</code>. <strong><span class=\"caps\">NOTE</span>:</strong> <em>The string points to a static local and is reset every time the function is called.</em></p>\n\n\n\t<h3>Chipmunk bounding boxes: <code>cpBB</code></h3>\n\n\n\t<p><strong>User accessible fields:</strong></p>\n\n\n<pre><code>\ntypedef struct cpBB{\n    cpFloat l, b, r ,t;\n} cpBB\n</code></pre>\n\n\t<p class=\"expl\">Simple bounding box struct. Stored as left, bottom, right, top values.</p>\n\n\n<pre><code>\ncpBB cpBBNew(const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t)\n</code></pre>\n\n\t<p class=\"expl\">Convenience constructor for <code>cpBB</code> structs.</p>\n\n\n<pre><code>\nint cpBBintersects(const cpBB a, const cpBB b)\n</code></pre>\n\n\t<p class=\"expl\">Returns true if the bounding boxes intersect.</p>\n\n\n<pre><code>\nint cpBBcontainsBB(const cpBB bb, const cpBB other)\n</code></pre>\n\n\t<p class=\"expl\">Returns true if <code>bb</code> completely contains <code>other</code>.</p>\n\n\n<pre><code>\nint cpBBcontainsVect(const cpBB bb, const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns true if <code>bb</code> contains <code>v</code>.</p>\n\n\n<pre><code>\ncpVect cpBBClampVect(const cpBB bb, const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns a copy of <code>v</code> clamped to the bounding box.</p>\n\n\n<pre><code>\ncpVect cpBBWrapVect(const cpBB bb, const cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Returns a copy of <code>v</code> wrapped to the bounding box.</p>\n\n\n\t<h3>Chipmunk spatial hashes: <code>cpSpaceHash</code></h3>\n\n\n\t<p><em>The spatial hash isn&#8217;t yet ready for user use. However, it has been made in a generic manner that would allow it to be used for more than just Chipmunk&#8217;s collision detection needs.</em></p>\n\n\n\t<h3>Chipmunk rigid bodies: <code>cpBody</code></h3>\n\n\n\t<p><strong>User accessible fields:</strong></p>\n\n\n<pre><code>\ntypedef struct cpBody{\n    cpFloat m, m_inv;\n    cpFloat i, i_inv;\n\n    cpVect p, v, f;\n    cpFloat a, w, t;\n    cpVect rot;\n} cpBody\n</code></pre>\n\n\t<ul>\n\t<li><code>m</code>, and <code>m_inv</code> are the mass and its inverse.</li>\n\t\t<li><code>i</code>, and <code>i_inv</code> are the moment of inertia and its inverse.</li>\n\t\t<li><code>p</code>, <code>v</code>, and <code>f</code> are the position, velocity and force respectively.</li>\n\t\t<li><code>a</code>, <code>w</code>, and <code>t</code> are the angle (in radians), angular velocity (rad/sec), and torque respectively.</li>\n\t\t<li><code>rot</code> is the rotation of the body as a unit length vector. (can be used with <code>cpvrotate()</code>)</li>\n\t</ul>\n\n\n<pre><code>\ncpBody *cpBodyAlloc(void)\ncpBody *cpBodyInit(cpBody *body, cpFloat m, cpFloat i)\ncpBody *cpBodyNew(cpFloat m, cpFloat i)\n\nvoid cpBodyDestroy(cpBody *body)\nvoid cpBodyFree(cpBody *body)\n</code></pre>\n\n\t<p class=\"expl\">Uses the standard suite of Chipmunk memory functions. <code>m</code> and <code>i</code> are the mass and moment of inertia for the body.</p>\n\n\n<pre><code>\nvoid cpBodySetMass(cpBody *body, cpFloat m);\nvoid cpBodySetMoment(cpBody *body, cpFloat i);\nvoid cpBodySetAngle(cpBody *body, cpFloat a);\n</code></pre>\n\n\t<p class=\"expl\">Because several of the values are linked, (m/m_inv, i/i_inv, a/rot) don&#8217;t set them explicitly, use these setter functions instead.</p>\n\n\n<pre><code>\ncpVect cpBodyLocal2World(cpBody *body, cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Convert from body local coordinates to world space coordinates.</p>\n\n\n<pre><code>\ncpVect cpBodyWorld2Local(cpBody *body, cpVect v)\n</code></pre>\n\n\t<p class=\"expl\">Convert from world space coordinates to body local coordinates.</p>\n\n\n<pre><code>\nvoid cpBodyApplyImpulse(cpBody *body, cpVect j, cpVect r)\n</code></pre>\n\n\t<p class=\"expl\">Apply the impulse <code>j</code> to <code>body</code> with offset <code>r</code>. Both <code>j</code> and <code>r</code> should be in world coordinates.</p>\n\n\n<pre><code>\nvoid cpBodyResetForces(cpBody *body)\n</code></pre>\n\n\t<p class=\"expl\">Zero both the forces and torques accumulated on <code>body</code>.</p>\n\n\n<pre><code>\nvoid cpBodyApplyForce(cpBody *body, cpVect f, cpVect r)\n</code></pre>\n\n\t<p class=\"expl\">Apply (accumulate) the force <code>f</code> on <code>body</code> with offset <code>r</code>. Both <code>f</code> and <code>r</code> should be in world coordinates.</p>\n\n\n<pre><code>\nvoid cpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt)\n</code></pre>\n\n\t<p class=\"expl\">Updates the velocity of the body using Euler integration. You don&#8217;t need to call this unless you are managing the object manually instead of adding it to a <code>cpSpace</code>.</p>\n\n\n<pre><code>\nvoid cpBodyUpdatePosition(cpBody *body, cpFloat dt)\n</code></pre>\n\n\t<p class=\"expl\">Updates the position of the body using Euler integration. Like <code>cpBodyUpdateVelocity()</code> you shouldn&#8217;t normally need to call this yourself.</p>\n\n\n<pre><code>\nvoid cpDampedSpring(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat rlen, cpFloat k, cpFloat dmp, cpFloat dt)\n</code></pre>\n\n\t<p class=\"expl\">Apply a spring force between bodies <code>a</code> and <code>b</code> at anchors <code>anchr1</code> and <code>anchr2</code> respectively.  <code>k</code> is the spring constant (force/distance),  <code>rlen</code> is the rest length of the spring,  <code>dmp</code> is the damping constant (force/velocity), and <code>dt</code> is the time step to apply the force over. <strong>Note:</strong> <em>not solving the damping forces in the impulse solver causes problems with large damping values. This function will eventually be replaced by a new constraint (joint) type.</em></p>\n\n\n\t<p><strong>Notes:</strong></p>\n\n\n\t<ul>\n\t<li>Use forces to modify the rigid bodies if possible. This is likely to be the most stable.</li>\n\t\t<li>Modifying a body&#8217;s velocity shouldn&#8217;t necessarily be avoided, but applying large changes can cause strange results in the simulation. Experiment freely, but be warned.</li>\n\t\t<li><strong>Don&#8217;t</strong> modify a body&#8217;s position every step unless you really know what you are doing. Otherwise you&#8217;re likely to get the position/velocity badly out of sync.</li>\n\t</ul>\n\n\n\t<h3>Chipmunk collision shapes: <code>cpShape</code></h3>\n\n\n\t<p>There are currently 3 possible collision shapes:</p>\n\n\n\t<ul>\n\t<li><strong>Circles</strong>: Fastest collision shape. They also roll smoothly.</li>\n\t\t<li><strong>Line segments</strong>: Meant mainly as a static shape. They can be attached to moving bodies, but they don&#8217;t generate collisions with other line segments.</li>\n\t\t<li><strong>Convex polygons</strong>: Slowest, but most flexible collision shape.</li>\n\t</ul>\n\n\n\t<p><strong>User accessible fields:</strong></p>\n\n\n<pre><code>\ntypedef struct cpShape{\n    cpBB bb;\n\n    unsigned long collision_type;\n    unsigned long group;\n    unsigned long layers;\n\n    void *data;\n\n    cpBody *body;\n    cpFloat e, u;\n    cpVect surface_v;\n} cpShape;\n</code></pre>\n\n\t<ul>\n\t<li><code>bb</code>: The bounding box of the shape. Only guaranteed to be valid after <code>cpShapeCacheBB()</code> is called.</li>\n\t\t<li><code>collision_type</code>: A user definable field, see the collision pair function section below for more information.</li>\n\t\t<li><code>group</code>: Shapes in the same non-zero group do not generate collisions. Useful when creating an object out of many shapes that you don&#8217;t want to self collide. Defaults to <code>0</code>;</li>\n\t\t<li><code>layers</code>: Shapes only collide if they are in the same bit-planes. i.e. <code>(a-&gt;layers &#38; b-&gt;layers) != 0</code> By default, a shape occupies all 32 bit-planes.</li>\n\t\t<li><code>data</code>: A user definable field.</li>\n\t\t<li><code>body</code>: The rigid body the shape is attached to.</li>\n\t\t<li><code>e</code>: Elasticity of the shape. A value of 0.0 gives no bounce, while a value of 1.0 will give a &#8220;perfect&#8221; bounce. However due to inaccuracies in the simulation using 1.0 or greater is not recommended however. <em>See the notes at the end of the section.</em></li>\n\t\t<li><code>u</code>: Friction coefficient. Chipmunk uses the Coulomb friction model, a value of 0.0 is frictionless. <a href=\"http://www.roymech.co.uk/Useful_Tables/Tribology/co_of_frict.htm\">Tables of friction coefficients</a>. <em>See the notes at the end of the section.</em></li>\n\t\t<li><code>surface_v</code>: The surface velocity of the object. Useful for creating conveyor belts or players that move around. This value is only used when calculating friction, not the collision.</li>\n\t</ul>\n\n\n<pre><code>\nvoid cpShapeDestroy(cpShape *shape)\nvoid cpShapeFree(cpShape *shape)\n</code></pre>\n\n\t<p class=\"expl\"><code>Destroy</code> and <code>Free</code> functions are shared by all shape types.</p>\n\n\n<pre><code>\ncpBB cpShapeCacheBB(cpShape *shape)\n</code></pre>\n\n\t<p class=\"expl\">Updates and returns the bounding box of <code>shape</code>.</p>\n\n\n<pre><code>\nvoid cpResetShapeIdCounter(void)\n</code></pre>\n\n\t<p class=\"expl\">Chipmunk keeps a counter so that every new shape is given a unique hash value to be used in the spatial hash. Because this affects the order in which the collisions are found and handled, you should reset the shape counter every time you populate a space with new shapes. If you don&#8217;t, there might be (very) slight differences in the simulation.</p>\n\n\n<pre><code>\ncpCircleShape *cpCircleShapeAlloc(void)\ncpCircleShape *cpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpVect offset, cpFloat radius)\ncpShape *cpCircleShapeNew(cpBody *body, cpVect offset, cpFloat radius)\n</code></pre>\n\n\t<p class=\"expl\"><code>body</code> is the body to attach the circle to, <code>offset</code> is the offset from the body&#8217;s center of gravity in body local coordinates.</p>\n\n\n<pre><code>\ncpSegmentShape* cpSegmentShapeAlloc(void)\ncpSegmentShape* cpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat radius)\ncpShape* cpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat radius)\n</code></pre>\n\n\t<p class=\"expl\"><code>body</code> is the body to attach the segment to, <code>a</code> and <code>b</code> are the endpoints, and <code>radius</code> is the thickness of the segment.</p>\n\n\n<pre><code>\ncpPolyShape *cpPolyShapeAlloc(void)\ncpPolyShape *cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int numVerts, cpVect *verts, cpVect offset)\ncpShape *cpPolyShapeNew(cpBody *body, int numVerts, cpVect *verts, cpVect offset)\n</code></pre>\n\n\t<p class=\"expl\"><code>body</code> is the body to attach the poly to, <code>verts</code> is an array of <code>cpVect</code>&#8217;s defining a convex hull with a counterclockwise winding, <code>offset</code> is the offset from the body&#8217;s center of gravity in body local coordinates.</p>\n\n\n<strong>Notes:</strong> \n\t<ul>\n\t<li>You can attach multiple collision shapes to a rigid body. This should allow you to create almost any shape you could possibly need.</li>\n\t\t<li>Shapes attached to the same rigid body will never generate collisions. You don&#8217;t have to worry about overlap when attaching multiple shapes to a rigid body.</li>\n\t\t<li>The amount of elasticity applied during a collision is determined by multiplying the elasticity of both shapes together. The same is done for determining the friction.</li>\n\t\t<li>Make sure you add both the body and it&#8217;s collision shapes to a space. The exception is when you want to have a static body or a body that you integrate yourself. In that case, only add the shape.</li>\n\t</ul>\n\n\n\t<h3>Chipmunk joints: <code>cpJoint</code></h3>\n\n\n\t<p>There are currently 4 kinds of joints:</p>\n\n\n\t<ul>\n\t<li><strong>Pin Joints</strong> connect two rigid bodies with a solid pin or rod. It keeps the anchor points at a set distance from one another.</li>\n\t\t<li><strong>Slide Joints</strong> are like pin joints, but have a minimum and maximum distance. A chain could be modeled using this joint. It keeps the anchor points from getting to far apart, but will allow them to get closer together.</li>\n\t\t<li><strong>Pivot Joints</strong> simply allow two objects to pivot about a single point.</li>\n\t\t<li><strong>Groove Joints</strong> attach a point on one body to a groove on the other. Think of it as a sliding pivot joint.</li>\n\t</ul>\n\n\n<pre><code>\nvoid cpJointDestroy(cpJoint *joint)\nvoid cpJointFree(cpJoint *joint)\n</code></pre>\n\n\t<p class=\"expl\"><code>Destroy</code> and <code>Free</code> functions are shared by all joint types.</p>\n\n\n<pre><code>\ncpPinJoint *cpPinJointAlloc(void)\ncpPinJoint *cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)\ncpJoint *cpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)\n</code></pre>\n\n\t<p class=\"expl\"><code>a</code> and <code>b</code> are the two bodies to connect, and <code>anchr1</code> and <code>anchr2</code> are the anchor points on those bodies.</p>\n\n\n<pre><code>\ncpSlideJoint *cpSlideJointAlloc(void)\ncpSlideJoint *cpSlideJointInit(cpSlideJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max)\ncpJoint *cpSlideJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max)\n</code></pre>\n\n\t<p class=\"expl\"><code>a</code> and <code>b</code> are the two bodies to connect, <code>anchr1</code> and <code>anchr2</code> are the anchor points on those bodies, and <code>min</code> and <code>max</code> define the allowed distances of the anchor points.</p>\n\n\n<pre><code>\ncpPivotJoint *cpPivotJointAlloc(void)\ncpPivotJoint *cpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect pivot)\ncpJoint *cpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot)\n</code></pre>\n\n\t<p class=\"expl\"><code>a</code> and <code>b</code> are the two bodies to connect, and <code>pivot</code> is the point in world coordinates of the pivot. Because the pivot location is given in world coordinates, you must have the bodies moved into the correct positions already.</p>\n\n\n<pre><code>\ncpGrooveJoint *cpGrooveJointAlloc(void)\ncpGrooveJoint *cpGrooveJointInit(cpGrooveJoint *joint, cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2)\ncpJoint *cpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2)\n</code></pre>\n\n\t<p class=\"expl\">The groove goes from <em>groov_a</em> to <em>groove_b</em> on body <em>a_, and the pivot is attached to _anchr2</em> on body <em>b</em>. All coordinates are body local.</p>\n\n\n\t<p><strong>Notes:</strong></p>\n\n\n\t<ul>\n\t<li>You can add multiple joints between two bodies, but make sure that they don&#8217;t fight. It can cause the bodies to explode.</li>\n\t\t<li>Make sure you add both of the connected bodies and the joint to a space.</li>\n\t</ul>\n\n\n\t<h3>Chipmunk spaces: <code>cpSpace</code></h3>\n\n\n\t<p><strong>User accessible fields:</strong></p>\n\n\n<pre><code>\ntypedef struct cpSpace{\n    int iterations;\n\n    cpVect gravity;\n    cpFloat damping;\n\n    int stamp;\n} cpSpace;\n</code></pre>\n\n\t<ul>\n\t<li><code>iterations</code>: The number of iterations to use when solving constraints (collisions and joints). Defaults to 10.</li>\n\t\t<li><code>gravity</code>: The amount of gravity applied to the system.</li>\n\t\t<li><code>damping</code>: The amount of viscous damping applied to the system.</li>\n\t\t<li><code>stamp</code>: The tick stamp. Incremented every time <code>cpSpaceStep()</code> is called. <em>read only</em></li>\n\t</ul>\n\n\n<pre><code>\nvoid cpSpaceFreeChildren(cpSpace *space)\n</code></pre>\n\n\t<p class=\"expl\">Frees all bodies, shapes and joints added to the system.</p>\n\n\n<pre><code>\ncpSpace* cpSpaceAlloc(void)\ncpSpace* cpSpaceInit(cpSpace *space, int iterations)\ncpSpace* cpSpaceNew(int iterations)\n\nvoid cpSpaceDestroy(cpSpace *space)\nvoid cpSpaceFree(cpSpace *space)\n</code></pre>\n\n\t<p class=\"expl\">More standard Chipmunk memory functions.</p>\n\n\n<pre><code>\nvoid cpSpaceFreeChildren(cpSpace *space)\n</code></pre>\n\n\t<p class=\"expl\">This function will free all of the shapes, bodies and joints that have been added to <code>space</code>.</p>\n\n\n<pre><code>\nvoid cpSpaceAddShape(cpSpace *space, cpShape *shape)\nvoid cpSpaceAddStaticShape(cpSpace *space, cpShape *shape)\nvoid cpSpaceAddBody(cpSpace *space, cpBody *body)\nvoid cpSpaceAddJoint(cpSpace *space, cpJoint *joint)\n\nvoid cpSpaceRemoveShape(cpSpace *space, cpShape *shape)\nvoid cpSpaceRemoveStaticShape(cpSpace *space, cpShape *shape)\nvoid cpSpaceRemoveBody(cpSpace *space, cpBody *body)\nvoid cpSpaceRemoveJoint(cpSpace *space, cpJoint *joint)\n</code></pre>\n\n\t<p class=\"expl\">These functions add and remove shapes, bodies and joints from <code>space</code>. Shapes added as static are assumed not to move. Static shapes should be be attached to a rigid body with an infinite mass and moment of inertia. Also, don&#8217;t add the rigid body used to the space, as that will cause it to fall under the effects of gravity.</p>\n\n\n<pre><code>\nvoid cpSpaceResizeStaticHash(cpSpace *space, cpFloat dim, int count)\nvoid cpSpaceResizeActiveHash(cpSpace *space, cpFloat dim, int count)\n</code></pre>\n\n\t<p class=\"expl\">The spatial hashes used by Chipmunk&#8217;s collision detection are fairly size sensitive. <code>dim</code> is the size of the hash cells. Setting <code>dim</code> to the average objects size is likely to give the best performance.</p>\n\n\n\t<p class=\"expl\"><code>count</code> is the suggested minimum number of cells in the hash table. Bigger is better, but only to a point. Setting <code>count</code> to ~10x the number of objects in the hash is probably a good starting point.</p>\n\n\n\t<p class=\"expl\">By default, <code>dim</code> is 100.0, and <code>count</code> is 1000.</p>\n\n\n<pre><code>\nvoid cpSpaceRehashStatic(cpSpace *space)\n</code></pre>\n\n\t<p class=\"expl\">Rehashes the shapes in the static spatial hash. You only need to call this if you move one of the static shapes.</p>\n\n\n<pre><code>\nvoid cpSpaceStep(cpSpace *space, cpFloat dt)\n</code></pre>\n\n\t<p class=\"expl\">Update the space for the given time step. Using a fixed time step is <em>highly</em> recommended. Doing so will increase the efficiency of the contact persistence, requiring an order of magnitude fewer iterations to resolve the collisions in the usual case.</p>\n\n\n\t<p><strong>Notes:</strong></p>\n\n\n\t<ul>\n\t<li>When removing objects from the space, make sure you remove any other objects that reference it. For instance, when you remove a body, remove the joints and shapes attached to it.</li>\n\t\t<li>The number of iterations, and the size of the time step determine the quality of the simulation. More iterations, or smaller time steps increase the quality.</li>\n\t\t<li>Because static shapes are only rehashed when you request it, it&#8217;s possible to use a much higher <code>count</code> argument to <code>cpHashResizeStaticHash()</code> than to <code>cpHashResizeStaticHash()</code>. Doing so will use more memory though.</li>\n\t</ul>\n\n\n\t<h3>Miscellaneous.</h3>\n\n\n<pre><code>\ncpFloat cpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset)\n</code></pre>\n\n\t<p class=\"expl\">Calculate the moment of inertia for a circle. Arguments are similar to <code>cpCircleShapeInit()</code>. <em>m_ is the mass, _r1</em> and <em>r2</em> define an inner and outer radius, and <em>offset</em> is the offset of the center from the center of gravity of the rigid body.</p>\n\n\n<pre><code>\ncpFloat cpMomentForPoly(cpFloat m, int numVerts, cpVect *verts, cpVect offset)\n</code></pre>\n\n\t<p class=\"expl\">Calculate the moment of inertia for a poly. Arguments are similar to <code>cpPolyShapeInit()</code> <em>m_ is the mass, _numVerts</em> is the number of vertexes in <em>verts</em>, and <em>offset</em> is the offset of the poly coordinates from the center of gravity of the rigid body.</p>\n\n\n\t<h3>Collision pair functions</h3>\n\n\n\t<p>Collision pair functions allow you to add callbacks for certain collision events. Each <code>cpShape</code> structure has a user definable <code>collision_type</code> field that is used to identify its type. For instance, you could define an enumeration of collision types such as bullets and players, and then register a collision pair function to reduce the players health when a collision is found between the two.</p>\n\n\n\t<p>Additionally, the return value of a collision pair function determines whether or not a collision will be processed. If the function returns false, the collision will be ignored. One use for this functionality is to allow a rock object to break a vase object. If the approximated energy of the collision is above a certain level, flag the vase to be removed from the space, apply an impulse to the rock to slow it down, and return false. After the <code>cpSpaceStep()</code> returns, remove the vase from the space.</p>\n\n\n\t<p><strong><span class=\"caps\">WARNING</span>:</strong> <em>It is not safe for collision pair functions to remove or free shapes or bodies from a space. Doing so will likely end in a segfault as an earlier collision may already be referencing the shape or body. You must wait until after the <code>cpSpaceStep()</code> function returns.</em></p>\n\n\n<pre><code>\ntypedef struct cpContact{\n    cpVect p, n;\n    cpFloat dist;\n\n    cpFloat jnAcc, jtAcc;\n} cpContact;\n</code></pre>\n\n\t<p class=\"expl\">An array of <code>cpContact</code> structs are passed to collision pair functions. Some user accessible fields include:</p>\n\n\n\t<ul>\n\t<li><code>p</code>: position of the collision.</li>\n\t\t<li><code>n</code>: normal of the collision.</li>\n\t\t<li><code>dist</code>: penetration distance of the collision.</li>\n\t\t<li><code>jnAcc</code> and <code>jtAcc</code>: The normal and tangential components of the accumulated (final) impulse applied to resolve the collision. Values will not be valid until after the call to <code>cpSpaceStep()</code> returns.</li>\n\t</ul>\n\n\n<pre><code>\ntypedef int (*cpCollFunc)(cpShape *a, cpShape *b, cpContact *contacts, int numContacts, cpFloat normal_coef, void *data)\n</code></pre>\n\n\t<p class=\"expl\">Prototype for a collision callback function. The two colliding shapes are passed as <code>a</code> and <code>b</code>, along with the contact points, and a user definable pointer are passed as arguments. The shapes are passed in the same order as their types were registered using <code>cpSpaceAddCollisionPairFunc()</code>. Because Chipmunk may swap the shapes to accommodate your collision pair function the normals may be backwards. Always multiply the normals by <em>normal_coef</em> before using the values. The <code>contacts</code> array may be freed on the next call to <code>cpSpaceStep()</code>.</p>\n\n\n<pre><code>\nvoid cpSpaceAddCollisionPairFunc(cpSpace *space, unsigned long a, unsigned long b, cpCollFunc func, void *data)\n</code></pre>\n\n\t<p class=\"expl\">Register <code>func</code> to be called when a collision is found between a shapes with <code>collision_type</code> fields that match <code>a</code> and <code>b</code>. <code>data</code> is passed to <code>func</code> as a parameter. The ordering of the collision types will match the ordering passed to the callback function.</p>\n\n\n\t<p class=\"expl\">Passing <code>NULL</code> for <code>func</code> will reject any collision with the given collision type pair.</p>\n\n\n<pre><code>\nvoid cpSpaceRemoveCollisionPairFunc(cpSpace *space, unsigned long a, unsigned long b)\n</code></pre>\n\n\t<p class=\"expl\">Remove the function for the given collision type pair. The order of <code>a</code> and <code>b</code> must match the original order used with <code>cpSpaceAddCollisionPairFunc()</code>.</p>\n\n\n<pre><code>\nvoid cpSpaceSetDefaultCollisionPairFunc(cpSpace *space, cpCollFunc func, void *data)\n</code></pre>\n\n\t<p class=\"expl\">The default function is called when no collision pair function is specified. By default, the default function simply accepts all collisions. Passing <code>NULL</code> for <code>func</code> will reset the default function back to the default. (You know what I mean.)</p>\n\n\n\t<p class=\"expl\">Passing <code>NULL</code> for <code>func</code> will reject collisions by default.</p>\n\n\n\t<h2>Advanced topics</h2>\n\n\n\t<h3>Advanced collision processing</h3>\n\n\n\t<p>Using collision pair functions, it&#8217;s possible to get information about a collision such as the locations of the contact points and the normals, but you can&#8217;t get the impulse applied to each contact point at the time the callback is called. Because Chipmunk caches the impulses, it is possible to access them after the call to <code>cpSpaceStep()</code> returns.</p>\n\n\n\t<p>The impulse information is stored in the <code>jnAcc</code> and <code>jtAcc</code> fields of the <code>cpContact</code> structures passed to the collision pair function. So you must store a reference to the <code>contacts</code> array in the collision pair function so that you can access it later once the impulses have been calculated.</p>\n\n\n<pre><code>\ncpVect cpContactsSumImpulses(cpContact *contacts, int numContacts);\ncpVect cpContactsSumImpulsesWithFriction(cpContact *contacts, int numContacts);\n</code></pre>\n\n\t<p class=\"expl\">Sums the impulses applied to the the given contact points. <code>cpContactsSumImpulses()</code> sums only the normal components, while <code>cpContactsSumImpulsesWithFriction()</code> sums the normal and tangential componets.</p>\n\n\n\t<p><strong>Notes:</strong></p>\n\n\n\t<ul>\n\t<li>The <code>contact</code> array will either be destroyed or out of date after the next call to <code>cpSpaceStep()</code>. If you need to store the collision information permanently, you&#8217;ll have to copy it.</li>\n\t</ul>\n\n\n\t<h3>Collision pair functions, groups, and layers</h3>\n\n\n\t<p>There are three ways that you can specify which shapes are allowed to collide in Chipmunk: collision pair functions, groups, and layers. What are their intended purposes?</p>\n\n\n\t<p><strong>Collision pair functions:</strong> More than just a callback, collision pair functions can conditionally allow a collision between two shapes. This is the only choice if you need to perform some logic based on the shapes or contact information before deciding to allow the collision.</p>\n\n\n\t<p><strong>Groups:</strong> Groups filter out collisions between objects in the same non-zero groups. A good example of when groups would be useful is to create a multi-body, multi-shape object such as a ragdoll. You don&#8217;t want the parts of the ragdoll to collide with itself, but you do want it to collide with other ragdolls.</p>\n\n\n\t<p><strong>Layers:</strong> Layers are another way of grouping shapes. Collision between shapes that don&#8217;t occupy one or more of the same layers are filtered out. Layers are implemented using a bitmask on an unsigned long, so there are up to 32 layers available.</p>\n\n\n\t<p>To be clear, for a collision to occur, all of the tests have to pass. Additionally, collisions between static shapes are not considered nor are collisions between shapes connected to the same rigid body.</p>\n\n\n\t<h3>Mysteries of <code>cpSpaceStep()</code> explained.</h3>\n\n\n\t<p>The <code>cpSpaceStep()</code> function is really the workhorse of Chipmunk. So what exactly does it do?</p>\n\n\n\t<ul>\n\t<li>Persistent contacts with a stamp that is out of date by more than <code>cp_contact_persistence</code> are filtered out.</li>\n\t\t<li>Velocities of all rigid bodies in the space are integrated using <code>cpBodyUpdateVelocity()</code>.</li>\n\t\t<li>All active shapes have their bounding boxes calculated and cached.</li>\n\t\t<li>Collisions between the active shapes and static shapes are found. (collision pair functions are called)</li>\n\t\t<li>Collisions between the active shapes are found. (collision pair functions are called)</li>\n\t\t<li>Information about all constraints (collisions and joints) is pre-calculated.</li>\n\t\t<li>Impulses are found and applied to solve all constraints (joints and collisions).</li>\n\t\t<li>Positions of all rigid bodies in the space are integrated using <code>cpBodyUpdatePosition()</code>.</li>\n\t</ul>\n\n\n\t<p>Chipmunk does a lot of processing on the shapes in the system in order to provide robust and fast collision detection, but the same is not true of the rigid bodies. Really all <code>cpSpaceStep()</code> does to the bodies in the system is to integrate them and apply impulses to them.</p>\n\n\n\t<p>The integration step is really just for convenience. If you integrate the velocity of your rigid bodies before calling <code>cpSpaceStep()</code> and integrate their positions afterward, you don&#8217;t have to add them to the space at all. In fact, there are good reasons for not doing so. All bodies in the space are integrated using the same gravity and damping, and this prevents you from providing interesting objects such as moving platforms.</p>\n\n\n\t<p>If you are going to do the integration for your rigid bodies manually, I would highly recommend that you use <code>cpBodyUpdatePosition()</code> to integrate the position of the objects and only integrate the velocity. <code>cpBodyUpdatePosition()</code> is a required step for penetration resolution, and weird things could happen if it&#8217;s not called. Chipmunk uses Euler integration, so calculating the velocity required to move a body to a specific position is trivial if that is what you wish to do.</p>\n\n\n\t<h3>Chipmunk globals.</h3>\n\n\n\t<p>Chipmunk was designed with multithreading in mind, so very few globals are used. This shouldn&#8217;t be a problem in most cases as it&#8217;s likely you&#8217;ll only need to set them on a per application basis (if at all).</p>\n\n\n\t<p><code>int cp_contact_persistence</code>: This determines how long contacts should persist. This number should be fairly small as the cached contacts will only be close for a short time. <code>cp_contact_persistence</code> defaults to 3 as it is large enough to help prevent oscillating contacts, but doesn&#8217;t allow stale contact information to be used.</p>\n\n\n\t<p><code>cpFloat cp_collision_slop</code>: The amount that shapes are allowed to penetrate. Setting this to zero will work just fine, but using a small positive amount will help prevent oscillating contacts. <code>cp_collision_slop</code> defaults to 0.1.</p>\n\n\n\t<p><code>cpFloat cp_bias_coef</code>: The amount of penetration to reduce in each step. Values should range from 0 to 1. Using large values will eliminate penetration in fewer steps, but can cause vibration. <code>cp_bias_coef</code> defaults to 0.1.</p>\n\n\n\t<p><code>cpFloat cp_joint_bias_coef</code>: Similar to <code>cp_bias_coef</code>, but for joints. Defaults to 0.1. <em>In the future, joints might have their own bias coefficient instead.</em></p>\n\n\n\t<h2>Known Problems</h2>\n\n\n\t<ul>\n\t<li>Fast moving objects sometimes pass right through one another. This is because I&#8217;m not doing swept volume collisions. Use smaller time steps if this is a problem.</li>\n\t\t<li>Pointy or thin polygons aren&#8217;t handled well. Collision points are generated at the poly&#8217;s vertexes. I haven&#8217;t decided what to do about this yet.</li>\n\t\t<li>Elastic shapes don&#8217;t stack well.</li>\n\t</ul>\n\n\n\t<h2>Performance/Quality tuning</h2>\n\n\n\t<p>There are a number of things you can do to increase the performance of Chipmunk:</p>\n\n\n\t<ul>\n\t<li>Use simpler collision shapes when possible. It&#8217;s easier on the collision detection, you&#8217;ll generate fewer contact points, and require fewer iterations.</li>\n\t\t<li>Make sure you have your spatial hashes tuned properly. It may take some experimenting to find the optimal dim/count parameters.</li>\n\t\t<li>Use fewer iterations.</li>\n\t\t<li>Use a larger time step.</li>\n\t\t<li>Use a fixed time step. This allows contact persistence to work properly, reducing the number of iterations you need by an order of magnitude.</li>\n\t</ul>\n\n\n\t<p>If you have problems with jittery or vibrating objects, you need to do mostly the opposite:</p>\n\n\n\t<ul>\n\t<li>Use simpler shapes. Simpler shapes generate fewer contacts, increasing the efficiency of each iteration.</li>\n\t\t<li>Use more iterations.</li>\n\t\t<li>Use a smaller time step.</li>\n\t\t<li>Use a fixed time step. By allowing the contact persistence to work properly, you can use more iterations without increasing the computational cost.</li>\n\t</ul>\n\n\n\t<h2>To do</h2>\n\n\nThere are a number of things left on my todo list:\n\t<ul>\n\t<li>More joint types.</li>\n\t\t<li>Post collision queries. Being able to query for all the impulses that were applied to an object would be useful.</li>\n\t\t<li>Python binding. (possibly others if I can get help)</li>\n\t</ul>\n\n\n\t<h2>Contact information</h2>\n\n\n\t<p>Drop me a line. Tell me how great you think Chipmunk is or how terribly buggy it is. I&#8217;d love to hear about any project that people are using Chipmunk for.</p>\n\n\n\t<p><strong><span class=\"caps\">AIM</span>:</strong> slembcke@mac.com</p>\n\n\n\t<p><strong>Email:</strong> lemb0029(at)morris(dot)umn(dot)edu or slembcke(at)gmail(dot)com</p>\n\n\n\t<p>I can also be found lurking about the <a href=\"http://www.idevgames.com\">iDevGames</a> forums.</p>\n\n\n\t<h2>License</h2>\n\n\n\t<p>Copyright&#169; 2007 Scott Lembcke</p>\n\n\n\t<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &#8220;Software&#8221;), 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:</p>\n\n\n\t<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>\n\n\n<span class=\"caps\">THE SOFTWARE IS PROVIDED</span> &#8220;AS IS&#8221;, <span class=\"caps\">WITHOUT WARRANTY OF ANY KIND</span>, EXPRESS <span class=\"caps\">OR IMPLIED</span>, INCLUDING <span class=\"caps\">BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY</span>, FITNESS <span class=\"caps\">FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT</span>. IN <span class=\"caps\">NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM</span>, DAMAGES <span class=\"caps\">OR OTHER LIABILITY</span>, WHETHER <span class=\"caps\">IN AN ACTION OF CONTRACT</span>, TORT <span class=\"caps\">OR OTHERWISE</span>, ARISING <span class=\"caps\">FROM</span>, OUT <span class=\"caps\">OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE</span>.\n\n    </body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/chipmunk.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#ifndef CHIPMUNK_HEADER\n#define CHIPMUNK_HEADER\n\n#ifdef _MSC_VER\n\t#ifndef _USE_MATH_DEFINES\n\t#define _USE_MATH_DEFINES\n\t#endif\n#endif\n\n#include <stdlib.h>\n#include <math.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef CP_ALLOW_PRIVATE_ACCESS\n\t#define CP_ALLOW_PRIVATE_ACCESS 0\n#endif\n\n#if CP_ALLOW_PRIVATE_ACCESS == 1\n\t#define CP_PRIVATE(__symbol__) __symbol__\n#else\n\t#define CP_PRIVATE(__symbol__) __symbol__##_private\n#endif\n\nvoid cpMessage(const char *condition, const char *file, int line, int isError, int isHardError, const char *message, ...);\n#ifdef NDEBUG\n\t#define\tcpAssertWarn(__condition__, ...)\n#else\n\t#define cpAssertWarn(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 0, 0, __VA_ARGS__)\n#endif\n\n#ifdef NDEBUG\n\t#define\tcpAssertSoft(__condition__, ...)\n#else\n\t#define cpAssertSoft(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 1, 0, __VA_ARGS__)\n#endif\n\n// Hard assertions are important and cheap to execute. They are not disabled by compiling as debug.\n#define cpAssertHard(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 1, 1, __VA_ARGS__)\n\n\n#include \"chipmunk_types.h\"\n\t\n/// @defgroup misc Misc\n/// @{\n\n/// Allocated size for various Chipmunk buffers\n#ifndef CP_BUFFER_BYTES\n\t#define CP_BUFFER_BYTES (32*1024)\n#endif\n\n#ifndef cpcalloc\n\t/// Chipmunk calloc() alias.\n\t#define cpcalloc calloc\n#endif\n\n#ifndef cprealloc\n\t/// Chipmunk realloc() alias.\n\t#define cprealloc realloc\n#endif\n\n#ifndef cpfree\n\t/// Chipmunk free() alias.\n\t#define cpfree free\n#endif\n\ntypedef struct cpArray cpArray;\ntypedef struct cpHashSet cpHashSet;\n\ntypedef struct cpBody cpBody;\ntypedef struct cpShape cpShape;\ntypedef struct cpConstraint cpConstraint;\n\ntypedef struct cpCollisionHandler cpCollisionHandler;\ntypedef struct cpArbiter cpArbiter;\n\ntypedef struct cpSpace cpSpace;\n\n#include \"cpVect.h\"\n#include \"cpBB.h\"\n#include \"cpSpatialIndex.h\"\n\n#include \"cpBody.h\"\n#include \"cpShape.h\"\n#include \"cpPolyShape.h\"\n\n#include \"cpArbiter.h\"\t\n#include \"constraints/cpConstraint.h\"\n\n#include \"cpSpace.h\"\n\n// Chipmunk 6.1.5\n#define CP_VERSION_MAJOR 6\n#define CP_VERSION_MINOR 1\n#define CP_VERSION_RELEASE 5\n\n/// Version string.\nextern const char *cpVersionString;\n\n/// @deprecated\nvoid cpInitChipmunk(void);\n\n/// Enables segment to segment shape collisions.\nvoid cpEnableSegmentToSegmentCollisions(void);\n\n\n/// Calculate the moment of inertia for a circle.\n/// @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0.\ncpFloat cpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset);\n\n/// Calculate area of a hollow circle.\n/// @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0.\ncpFloat cpAreaForCircle(cpFloat r1, cpFloat r2);\n\n/// Calculate the moment of inertia for a line segment.\n/// Beveling radius is not supported.\ncpFloat cpMomentForSegment(cpFloat m, cpVect a, cpVect b);\n\n/// Calculate the area of a fattened (capsule shaped) line segment.\ncpFloat cpAreaForSegment(cpVect a, cpVect b, cpFloat r);\n\n/// Calculate the moment of inertia for a solid polygon shape assuming it's center of gravity is at it's centroid. The offset is added to each vertex.\ncpFloat cpMomentForPoly(cpFloat m, int numVerts, const cpVect *verts, cpVect offset);\n\n/// Calculate the signed area of a polygon. A Clockwise winding gives positive area.\n/// This is probably backwards from what you expect, but matches Chipmunk's the winding for poly shapes.\ncpFloat cpAreaForPoly(const int numVerts, const cpVect *verts);\n\n/// Calculate the natural centroid of a polygon.\ncpVect cpCentroidForPoly(const int numVerts, const cpVect *verts);\n\n/// Center the polygon on the origin. (Subtracts the centroid of the polygon from each vertex)\nvoid cpRecenterPoly(const int numVerts, cpVect *verts);\n\n/// Calculate the moment of inertia for a solid box.\ncpFloat cpMomentForBox(cpFloat m, cpFloat width, cpFloat height);\n\n/// Calculate the moment of inertia for a solid box.\ncpFloat cpMomentForBox2(cpFloat m, cpBB box);\n\n/// Calculate the convex hull of a given set of points. Returns the count of points in the hull.\n/// @c result must be a pointer to a @c cpVect array with at least @c count elements. If @c result is @c NULL, then @c verts will be reduced instead.\n/// @c first is an optional pointer to an integer to store where the first vertex in the hull came from (i.e. verts[first] == result[0])\n/// @c tol is the allowed amount to shrink the hull when simplifying it. A tolerance of 0.0 creates an exact hull.\nint cpConvexHull(int count, cpVect *verts, cpVect *result, int *first, cpFloat tol);\n\n#ifdef _MSC_VER\n#include \"malloc.h\"\n#endif\n\n/// Convenience macro to work with cpConvexHull.\n/// @c count and @c verts is the input array passed to cpConvexHull().\n/// @c count_var and @c verts_var are the names of the variables the macro creates to store the result.\n/// The output vertex array is allocated on the stack using alloca() so it will be freed automatically, but cannot be returned from the current scope.\n#define CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__) \\\ncpVect *__verts_var__ = (cpVect *)alloca(__count__*sizeof(cpVect)); \\\nint __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0); \\\n\n#if defined(__has_extension)\n#if __has_extension(blocks)\n// Define alternate block based alternatives for a few of the callback heavy functions.\n// Collision handlers are post-step callbacks are not included to avoid memory management issues.\n// If you want to use blocks for those and are aware of how to correctly manage the memory, the implementation is trivial. \n\nvoid cpSpaceEachBody_b(cpSpace *space, void (^block)(cpBody *body));\nvoid cpSpaceEachShape_b(cpSpace *space, void (^block)(cpShape *shape));\nvoid cpSpaceEachConstraint_b(cpSpace *space, void (^block)(cpConstraint *constraint));\n\nvoid cpBodyEachShape_b(cpBody *body, void (^block)(cpShape *shape));\nvoid cpBodyEachConstraint_b(cpBody *body, void (^block)(cpConstraint *constraint));\nvoid cpBodyEachArbiter_b(cpBody *body, void (^block)(cpArbiter *arbiter));\n\ntypedef void (^cpSpaceNearestPointQueryBlock)(cpShape *shape, cpFloat distance, cpVect point);\nvoid cpSpaceNearestPointQuery_b(cpSpace *space, cpVect point, cpFloat maxDistance, cpLayers layers, cpGroup group, cpSpaceNearestPointQueryBlock block);\n\ntypedef void (^cpSpaceSegmentQueryBlock)(cpShape *shape, cpFloat t, cpVect n);\nvoid cpSpaceSegmentQuery_b(cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSpaceSegmentQueryBlock block);\n\ntypedef void (^cpSpaceBBQueryBlock)(cpShape *shape);\nvoid cpSpaceBBQuery_b(cpSpace *space, cpBB bb, cpLayers layers, cpGroup group, cpSpaceBBQueryBlock block);\n\ntypedef void (^cpSpaceShapeQueryBlock)(cpShape *shape, cpContactPointSet *points);\ncpBool cpSpaceShapeQuery_b(cpSpace *space, cpShape *shape, cpSpaceShapeQueryBlock block);\n\n#endif\n#endif\n\n\n//@}\n\n#ifdef __cplusplus\n}\n\nstatic inline cpVect operator *(const cpVect v, const cpFloat s){return cpvmult(v, s);}\nstatic inline cpVect operator +(const cpVect v1, const cpVect v2){return cpvadd(v1, v2);}\nstatic inline cpVect operator -(const cpVect v1, const cpVect v2){return cpvsub(v1, v2);}\nstatic inline cpBool operator ==(const cpVect v1, const cpVect v2){return cpveql(v1, v2);}\nstatic inline cpVect operator -(const cpVect v){return cpvneg(v);}\n\n#endif\n#endif\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/chipmunk_ffi.h",
    "content": "#ifdef CHIPMUNK_FFI\n\n// Create non static inlined copies of Chipmunk functions, useful for working with dynamic FFIs\n// This file should only be included in chipmunk.c\n\n#ifdef _MSC_VER\n #if _MSC_VER >= 1600\n  #define MAKE_REF(name) decltype(name) *_##name = name\n #else\n  #define MAKE_REF(name)\n #endif\n#else\n #define MAKE_REF(name) __typeof__(name) *_##name = name\n#endif\n\n#define MAKE_PROPERTIES_REF(struct, property) \\\n\tMAKE_REF(struct##Get##property); MAKE_REF(struct##Set##property)\n\nMAKE_REF(cpv); // makes a variable named _cpv that contains the function pointer for cpv()\nMAKE_REF(cpveql);\nMAKE_REF(cpvadd);\nMAKE_REF(cpvneg);\nMAKE_REF(cpvsub);\nMAKE_REF(cpvmult);\nMAKE_REF(cpvdot);\nMAKE_REF(cpvcross);\nMAKE_REF(cpvperp);\nMAKE_REF(cpvrperp);\nMAKE_REF(cpvproject);\nMAKE_REF(cpvforangle);\nMAKE_REF(cpvtoangle);\nMAKE_REF(cpvrotate);\nMAKE_REF(cpvunrotate);\nMAKE_REF(cpvlengthsq);\nMAKE_REF(cpvlength);\nMAKE_REF(cpvlerp);\nMAKE_REF(cpvnormalize);\nMAKE_REF(cpvnormalize_safe);\nMAKE_REF(cpvclamp);\nMAKE_REF(cpvlerpconst);\nMAKE_REF(cpvdist);\nMAKE_REF(cpvdistsq);\nMAKE_REF(cpvnear);\n\nMAKE_REF(cpfmax);\nMAKE_REF(cpfmin);\nMAKE_REF(cpfabs);\nMAKE_REF(cpfclamp);\nMAKE_REF(cpflerp);\nMAKE_REF(cpflerpconst);\n\nMAKE_REF(cpBBNew);\nMAKE_REF(cpBBNewForCircle);\nMAKE_REF(cpBBIntersects);\nMAKE_REF(cpBBContainsBB);\nMAKE_REF(cpBBContainsVect);\nMAKE_REF(cpBBMerge);\nMAKE_REF(cpBBExpand);\nMAKE_REF(cpBBArea);\nMAKE_REF(cpBBMergedArea);\nMAKE_REF(cpBBSegmentQuery);\nMAKE_REF(cpBBIntersectsSegment);\nMAKE_REF(cpBBClampVect);\n\nMAKE_REF(cpBodyGetMass);\nMAKE_REF(cpBodyGetMoment);\nMAKE_REF(cpBodyGetPos);\nMAKE_REF(cpBodyGetAngle);\nMAKE_REF(cpBodyGetRot);\nMAKE_PROPERTIES_REF(cpBody, Vel);\nMAKE_PROPERTIES_REF(cpBody, Force);\nMAKE_PROPERTIES_REF(cpBody, AngVel);\nMAKE_PROPERTIES_REF(cpBody, Torque);\nMAKE_PROPERTIES_REF(cpBody, VelLimit);\nMAKE_PROPERTIES_REF(cpBody, AngVelLimit);\nMAKE_PROPERTIES_REF(cpBody, UserData);\nMAKE_REF(cpBodyIsSleeping);\nMAKE_REF(cpBodyIsStatic);\nMAKE_REF(cpBodyIsRogue);\nMAKE_REF(cpBodyLocal2World);\nMAKE_REF(cpBodyWorld2Local);\nMAKE_REF(cpBodyKineticEnergy);\n\nMAKE_REF(cpShapeGetBB);\nMAKE_PROPERTIES_REF(cpShape, Body);\nMAKE_PROPERTIES_REF(cpShape, Sensor);\nMAKE_PROPERTIES_REF(cpShape, Elasticity);\nMAKE_PROPERTIES_REF(cpShape, Friction);\nMAKE_PROPERTIES_REF(cpShape, SurfaceVelocity);\nMAKE_PROPERTIES_REF(cpShape, UserData);\nMAKE_PROPERTIES_REF(cpShape, CollisionType);\nMAKE_PROPERTIES_REF(cpShape, Group);\nMAKE_PROPERTIES_REF(cpShape, Layers);\n\nMAKE_REF(cpArbiterGetShapes);\nMAKE_REF(cpArbiterGetBodies);\nMAKE_REF(cpArbiterIsFirstContact);\nMAKE_REF(cpArbiterGetCount);\n\nMAKE_REF(cpConstraintGetA);\nMAKE_REF(cpConstraintGetB);\nMAKE_PROPERTIES_REF(cpConstraint, MaxForce);\nMAKE_PROPERTIES_REF(cpConstraint, ErrorBias);\nMAKE_PROPERTIES_REF(cpConstraint, MaxBias);\nMAKE_PROPERTIES_REF(cpConstraint, UserData);\nMAKE_REF(cpConstraintGetImpulse);\n\nMAKE_PROPERTIES_REF(cpDampedRotarySpring, RestAngle);\nMAKE_PROPERTIES_REF(cpDampedRotarySpring, Stiffness);\nMAKE_PROPERTIES_REF(cpDampedRotarySpring, Damping);\n//MAKE_PROPERTIES_REF(cpDampedRotarySpring, SpringTorqueFunc);\n\nMAKE_PROPERTIES_REF(cpDampedSpring, Anchr1);\nMAKE_PROPERTIES_REF(cpDampedSpring, Anchr2);\nMAKE_PROPERTIES_REF(cpDampedSpring, RestLength);\nMAKE_PROPERTIES_REF(cpDampedSpring, Stiffness);\nMAKE_PROPERTIES_REF(cpDampedSpring, Damping);\n//MAKE_PROPERTIES_REF(cpDampedSpring, SpringForceFunc);\n\nMAKE_PROPERTIES_REF(cpGearJoint, Phase);\nMAKE_REF(cpGearJointGetRatio);\n\nMAKE_PROPERTIES_REF(cpGrooveJoint, Anchr2);\nMAKE_REF(cpGrooveJointGetGrooveA);\nMAKE_REF(cpGrooveJointGetGrooveB);\n\nMAKE_PROPERTIES_REF(cpPinJoint, Anchr1);\nMAKE_PROPERTIES_REF(cpPinJoint, Anchr2);\nMAKE_PROPERTIES_REF(cpPinJoint, Dist);\n\nMAKE_PROPERTIES_REF(cpPivotJoint, Anchr1);\nMAKE_PROPERTIES_REF(cpPivotJoint, Anchr2);\n\nMAKE_PROPERTIES_REF(cpRatchetJoint, Angle);\nMAKE_PROPERTIES_REF(cpRatchetJoint, Phase);\nMAKE_PROPERTIES_REF(cpRatchetJoint, Ratchet);\n\nMAKE_PROPERTIES_REF(cpRotaryLimitJoint, Min);\nMAKE_PROPERTIES_REF(cpRotaryLimitJoint, Max);\n\nMAKE_PROPERTIES_REF(cpSimpleMotor, Rate);\n\nMAKE_PROPERTIES_REF(cpSlideJoint, Anchr1);\nMAKE_PROPERTIES_REF(cpSlideJoint, Anchr2);\nMAKE_PROPERTIES_REF(cpSlideJoint, Min);\nMAKE_PROPERTIES_REF(cpSlideJoint, Max);\n\nMAKE_REF(cpSegmentQueryHitPoint);\nMAKE_REF(cpSegmentQueryHitDist);\n\nMAKE_REF(cpSpatialIndexDestroy);\nMAKE_REF(cpSpatialIndexCount);\nMAKE_REF(cpSpatialIndexEach);\nMAKE_REF(cpSpatialIndexContains);\nMAKE_REF(cpSpatialIndexInsert);\nMAKE_REF(cpSpatialIndexRemove);\nMAKE_REF(cpSpatialIndexReindex);\nMAKE_REF(cpSpatialIndexReindexObject);\nMAKE_REF(cpSpatialIndexSegmentQuery);\nMAKE_REF(cpSpatialIndexQuery);\nMAKE_REF(cpSpatialIndexReindexQuery);\n\nMAKE_PROPERTIES_REF(cpSpace, Iterations);\nMAKE_PROPERTIES_REF(cpSpace, Gravity);\nMAKE_PROPERTIES_REF(cpSpace, Damping);\nMAKE_PROPERTIES_REF(cpSpace, IdleSpeedThreshold);\nMAKE_PROPERTIES_REF(cpSpace, SleepTimeThreshold);\nMAKE_PROPERTIES_REF(cpSpace, CollisionSlop);\nMAKE_PROPERTIES_REF(cpSpace, CollisionBias);\nMAKE_PROPERTIES_REF(cpSpace, CollisionPersistence);\nMAKE_PROPERTIES_REF(cpSpace, EnableContactGraph);\nMAKE_PROPERTIES_REF(cpSpace, UserData);\nMAKE_REF(cpSpaceGetStaticBody);\nMAKE_REF(cpSpaceGetCurrentTimeStep);\nMAKE_REF(cpSpaceIsLocked);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/chipmunk_private.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#define CP_ALLOW_PRIVATE_ACCESS 1\n#include \"chipmunk.h\"\n\n#define CP_HASH_COEF (3344921057ul)\n#define CP_HASH_PAIR(A, B) ((cpHashValue)(A)*CP_HASH_COEF ^ (cpHashValue)(B)*CP_HASH_COEF)\n\n//MARK: cpArray\n\nstruct cpArray {\n\tint num, max;\n\tvoid **arr;\n};\n\ncpArray *cpArrayNew(int size);\n\nvoid cpArrayFree(cpArray *arr);\n\nvoid cpArrayPush(cpArray *arr, void *object);\nvoid *cpArrayPop(cpArray *arr);\nvoid cpArrayDeleteObj(cpArray *arr, void *obj);\ncpBool cpArrayContains(cpArray *arr, void *ptr);\n\nvoid cpArrayFreeEach(cpArray *arr, void (freeFunc)(void*));\n\n//MARK: Foreach loops\n\nstatic inline cpConstraint *\ncpConstraintNext(cpConstraint *node, cpBody *body)\n{\n\treturn (node->a == body ? node->next_a : node->next_b);\n}\n\n#define CP_BODY_FOREACH_CONSTRAINT(bdy, var)\\\n\tfor(cpConstraint *var = bdy->constraintList; var; var = cpConstraintNext(var, bdy))\n\nstatic inline cpArbiter *\ncpArbiterNext(cpArbiter *node, cpBody *body)\n{\n\treturn (node->body_a == body ? node->thread_a.next : node->thread_b.next);\n}\n\n#define CP_BODY_FOREACH_ARBITER(bdy, var)\\\n\tfor(cpArbiter *var = bdy->arbiterList; var; var = cpArbiterNext(var, bdy))\n\n#define CP_BODY_FOREACH_SHAPE(body, var)\\\n\tfor(cpShape *var = body->shapeList; var; var = var->next)\n\n#define CP_BODY_FOREACH_COMPONENT(root, var)\\\n\tfor(cpBody *var = root; var; var = var->node.next)\n\n//MARK: cpHashSet\n\ntypedef cpBool (*cpHashSetEqlFunc)(void *ptr, void *elt);\ntypedef void *(*cpHashSetTransFunc)(void *ptr, void *data);\n\ncpHashSet *cpHashSetNew(int size, cpHashSetEqlFunc eqlFunc);\nvoid cpHashSetSetDefaultValue(cpHashSet *set, void *default_value);\n\nvoid cpHashSetFree(cpHashSet *set);\n\nint cpHashSetCount(cpHashSet *set);\nvoid *cpHashSetInsert(cpHashSet *set, cpHashValue hash, void *ptr, void *data, cpHashSetTransFunc trans);\nvoid *cpHashSetRemove(cpHashSet *set, cpHashValue hash, void *ptr);\nvoid *cpHashSetFind(cpHashSet *set, cpHashValue hash, void *ptr);\n\ntypedef void (*cpHashSetIteratorFunc)(void *elt, void *data);\nvoid cpHashSetEach(cpHashSet *set, cpHashSetIteratorFunc func, void *data);\n\ntypedef cpBool (*cpHashSetFilterFunc)(void *elt, void *data);\nvoid cpHashSetFilter(cpHashSet *set, cpHashSetFilterFunc func, void *data);\n\n//MARK: Body Functions\n\nvoid cpBodyAddShape(cpBody *body, cpShape *shape);\nvoid cpBodyRemoveShape(cpBody *body, cpShape *shape);\nvoid cpBodyRemoveConstraint(cpBody *body, cpConstraint *constraint);\n\n\n//MARK: Shape/Collision Functions\n\n// TODO should move this to the cpVect API. It's pretty useful.\nstatic inline cpVect\ncpClosetPointOnSegment(const cpVect p, const cpVect a, const cpVect b)\n{\n\tcpVect delta = cpvsub(a, b);\n\tcpFloat t = cpfclamp01(cpvdot(delta, cpvsub(p, b))/cpvlengthsq(delta));\n\treturn cpvadd(b, cpvmult(delta, t));\n}\n\ncpShape* cpShapeInit(cpShape *shape, const cpShapeClass *klass, cpBody *body);\n\nstatic inline cpBool\ncpShapeActive(cpShape *shape)\n{\n\treturn shape->prev || (shape->body && shape->body->shapeList == shape);\n}\n\nint cpCollideShapes(const cpShape *a, const cpShape *b, cpContact *arr);\n\n// TODO doesn't really need to be inline, but need a better place to put this function\nstatic inline cpSplittingPlane\ncpSplittingPlaneNew(cpVect a, cpVect b)\n{\n\tcpVect n = cpvnormalize(cpvperp(cpvsub(b, a)));\n\tcpSplittingPlane plane = {n, cpvdot(n, a)};\n\treturn plane;\n}\n\nstatic inline cpFloat\ncpSplittingPlaneCompare(cpSplittingPlane plane, cpVect v)\n{\n\treturn cpvdot(plane.n, v) - plane.d;\n}\n\nvoid cpLoopIndexes(cpVect *verts, int count, int *start, int *end);\n\nstatic inline cpFloat\ncpPolyShapeValueOnAxis(const cpPolyShape *poly, const cpVect n, const cpFloat d)\n{\n\tcpVect *verts = poly->tVerts;\n\tcpFloat min = cpvdot(n, verts[0]);\n\t\n\tfor(int i=1; i<poly->numVerts; i++){\n\t\tmin = cpfmin(min, cpvdot(n, verts[i]));\n\t}\n\t\n\treturn min - d;\n}\n\nstatic inline cpBool\ncpPolyShapeContainsVert(const cpPolyShape *poly, const cpVect v)\n{\n\tcpSplittingPlane *planes = poly->tPlanes;\n\t\n\tfor(int i=0; i<poly->numVerts; i++){\n\t\tcpFloat dist = cpSplittingPlaneCompare(planes[i], v);\n\t\tif(dist > 0.0f) return cpFalse;\n\t}\n\t\n\treturn cpTrue;\n}\n\nstatic inline cpBool\ncpPolyShapeContainsVertPartial(const cpPolyShape *poly, const cpVect v, const cpVect n)\n{\n\tcpSplittingPlane *planes = poly->tPlanes;\n\t\n\tfor(int i=0; i<poly->numVerts; i++){\n\t\tif(cpvdot(planes[i].n, n) < 0.0f) continue;\n\t\tcpFloat dist = cpSplittingPlaneCompare(planes[i], v);\n\t\tif(dist > 0.0f) return cpFalse;\n\t}\n\t\n\treturn cpTrue;\n}\n\n//MARK: Spatial Index Functions\n\ncpSpatialIndex *cpSpatialIndexInit(cpSpatialIndex *index, cpSpatialIndexClass *klass, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex);\n\n//MARK: Space Functions\n\nextern cpCollisionHandler cpDefaultCollisionHandler;\nvoid cpSpaceProcessComponents(cpSpace *space, cpFloat dt);\n\nvoid cpSpacePushFreshContactBuffer(cpSpace *space);\ncpContact *cpContactBufferGetArray(cpSpace *space);\nvoid cpSpacePushContacts(cpSpace *space, int count);\n\ntypedef struct cpPostStepCallback {\n\tcpPostStepFunc func;\n\tvoid *key;\n\tvoid *data;\n} cpPostStepCallback;\n\ncpPostStepCallback *cpSpaceGetPostStepCallback(cpSpace *space, void *key);\n\ncpBool cpSpaceArbiterSetFilter(cpArbiter *arb, cpSpace *space);\nvoid cpSpaceFilterArbiters(cpSpace *space, cpBody *body, cpShape *filter);\n\nvoid cpSpaceActivateBody(cpSpace *space, cpBody *body);\nvoid cpSpaceLock(cpSpace *space);\nvoid cpSpaceUnlock(cpSpace *space, cpBool runPostStep);\n\nstatic inline cpCollisionHandler *\ncpSpaceLookupHandler(cpSpace *space, cpCollisionType a, cpCollisionType b)\n{\n\tcpCollisionType types[] = {a, b};\n\treturn (cpCollisionHandler *)cpHashSetFind(space->collisionHandlers, CP_HASH_PAIR(a, b), types);\n}\n\nstatic inline void\ncpSpaceUncacheArbiter(cpSpace *space, cpArbiter *arb)\n{\n\tcpShape *a = arb->a, *b = arb->b;\n\tcpShape *shape_pair[] = {a, b};\n\tcpHashValue arbHashID = CP_HASH_PAIR((cpHashValue)a, (cpHashValue)b);\n\tcpHashSetRemove(space->cachedArbiters, arbHashID, shape_pair);\n\tcpArrayDeleteObj(space->arbiters, arb);\n}\n\nvoid cpShapeUpdateFunc(cpShape *shape, void *unused);\nvoid cpSpaceCollideShapes(cpShape *a, cpShape *b, cpSpace *space);\n\n\n\n//MARK: Arbiters\n\nstruct cpContact {\n\tcpVect p, n;\n\tcpFloat dist;\n\t\n\tcpVect r1, r2;\n\tcpFloat nMass, tMass, bounce;\n\n\tcpFloat jnAcc, jtAcc, jBias;\n\tcpFloat bias;\n\t\n\tcpHashValue hash;\n};\n\ncpContact* cpContactInit(cpContact *con, cpVect p, cpVect n, cpFloat dist, cpHashValue hash);\ncpArbiter* cpArbiterInit(cpArbiter *arb, cpShape *a, cpShape *b);\n\nstatic inline void\ncpArbiterCallSeparate(cpArbiter *arb, cpSpace *space)\n{\n\t// The handler needs to be looked up again as the handler cached on the arbiter may have been deleted since the last step.\n\tcpCollisionHandler *handler = cpSpaceLookupHandler(space, arb->a->collision_type, arb->b->collision_type);\n\thandler->separate(arb, space, handler->data);\n}\n\nstatic inline struct cpArbiterThread *\ncpArbiterThreadForBody(cpArbiter *arb, cpBody *body)\n{\n\treturn (arb->body_a == body ? &arb->thread_a : &arb->thread_b);\n}\n\nvoid cpArbiterUnthread(cpArbiter *arb);\n\nvoid cpArbiterUpdate(cpArbiter *arb, cpContact *contacts, int numContacts, struct cpCollisionHandler *handler, cpShape *a, cpShape *b);\nvoid cpArbiterPreStep(cpArbiter *arb, cpFloat dt, cpFloat bias, cpFloat slop);\nvoid cpArbiterApplyCachedImpulse(cpArbiter *arb, cpFloat dt_coef);\nvoid cpArbiterApplyImpulse(cpArbiter *arb);\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/chipmunk_types.h",
    "content": "#include <stdint.h>\n\n#ifdef __APPLE__\n   #include \"TargetConditionals.h\"\n#endif\n\n//#if ((TARGET_OS_IPHONE == 1) || (TARGET_OS_MAC == 1)) && (!defined CP_USE_CGPOINTS)\n//\t#define CP_USE_CGPOINTS 1\n//#endif\n\n#if CP_USE_CGPOINTS == 1\n\t#if TARGET_OS_IPHONE\n\t\t#import <CoreGraphics/CGGeometry.h>\n\t#elif TARGET_OS_MAC\n\t\t#include <ApplicationServices/ApplicationServices.h>\n\t#endif\n\t\n\t#if defined(__LP64__) && __LP64__\n\t\t#define CP_USE_DOUBLES 1\n\t#else\n\t\t#define CP_USE_DOUBLES 0\n\t#endif\n#endif\n\n#ifndef CP_USE_DOUBLES\n\t// use doubles by default for higher precision\n\t#define CP_USE_DOUBLES 1\n#endif\n\n/// @defgroup basicTypes Basic Types\n/// Most of these types can be configured at compile time.\n/// @{\n\n#if CP_USE_DOUBLES\n/// Chipmunk's floating point type.\n/// Can be reconfigured at compile time.\n\ttypedef double cpFloat;\n\t#define cpfsqrt sqrt\n\t#define cpfsin sin\n\t#define cpfcos cos\n\t#define cpfacos acos\n\t#define cpfatan2 atan2\n\t#define cpfmod fmod\n\t#define cpfexp exp\n\t#define cpfpow pow\n\t#define cpffloor floor\n\t#define cpfceil ceil\n#else\n\ttypedef float cpFloat;\n\t#define cpfsqrt sqrtf\n\t#define cpfsin sinf\n\t#define cpfcos cosf\n\t#define cpfacos acosf\n\t#define cpfatan2 atan2f\n\t#define cpfmod fmodf\n\t#define cpfexp expf\n\t#define cpfpow powf\n\t#define cpffloor floorf\n\t#define cpfceil ceilf\n#endif\n\n#ifndef INFINITY\n\t#ifdef _MSC_VER\n\t\tunion MSVC_EVIL_FLOAT_HACK\n\t\t{\n\t\t\tunsigned __int8 Bytes[4];\n\t\t\tfloat Value;\n\t\t};\n\t\tstatic union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}};\n\t\t#define INFINITY (INFINITY_HACK.Value)\n\t#endif\n\t\n\t#ifdef __GNUC__\n\t\t#define INFINITY (__builtin_inf())\n\t#endif\n\t\n\t#ifndef INFINITY\n\t\t#define INFINITY (1e1000)\n\t#endif\n#endif\n\n#ifndef M_PI\n\t#define M_PI 3.14159265358979323846264338327950288\n#endif\n\n#ifndef M_E\n\t#define M_E 2.71828182845904523536028747135266250\n#endif\n\n\n/// Return the max of two cpFloats.\nstatic inline cpFloat cpfmax(cpFloat a, cpFloat b)\n{\n\treturn (a > b) ? a : b;\n}\n\n/// Return the min of two cpFloats.\nstatic inline cpFloat cpfmin(cpFloat a, cpFloat b)\n{\n\treturn (a < b) ? a : b;\n}\n\n/// Return the absolute value of a cpFloat.\nstatic inline cpFloat cpfabs(cpFloat f)\n{\n\treturn (f < 0) ? -f : f;\n}\n\n/// Clamp @c f to be between @c min and @c max.\nstatic inline cpFloat cpfclamp(cpFloat f, cpFloat min, cpFloat max)\n{\n\treturn cpfmin(cpfmax(f, min), max);\n}\n\n/// Clamp @c f to be between 0 and 1.\nstatic inline cpFloat cpfclamp01(cpFloat f)\n{\n\treturn cpfmax(0.0f, cpfmin(f, 1.0f));\n}\n\n\n\n/// Linearly interpolate (or extrapolate) between @c f1 and @c f2 by @c t percent.\nstatic inline cpFloat cpflerp(cpFloat f1, cpFloat f2, cpFloat t)\n{\n\treturn f1*(1.0f - t) + f2*t;\n}\n\n/// Linearly interpolate from @c f1 to @c f2 by no more than @c d.\nstatic inline cpFloat cpflerpconst(cpFloat f1, cpFloat f2, cpFloat d)\n{\n\treturn f1 + cpfclamp(f2 - f1, -d, d);\n}\n\n/// Hash value type.\ntypedef uintptr_t cpHashValue;\n\n// Oh C, how we love to define our own boolean types to get compiler compatibility\n/// Chipmunk's boolean type.\n#ifdef CP_BOOL_TYPE\n\ttypedef CP_BOOL_TYPE cpBool;\n#else\n\ttypedef int cpBool;\n#endif\n\n#ifndef cpTrue\n/// true value.\n\t#define cpTrue 1\n#endif\n\n#ifndef cpFalse\n/// false value.\n\t#define cpFalse 0\n#endif\n\n#ifdef CP_DATA_POINTER_TYPE\n\ttypedef CP_DATA_POINTER_TYPE cpDataPointer;\n#else\n/// Type used for user data pointers.\n\ttypedef void * cpDataPointer;\n#endif\n\n#ifdef CP_COLLISION_TYPE_TYPE\n\ttypedef CP_COLLISION_TYPE_TYPE cpCollisionType;\n#else\n/// Type used for cpSpace.collision_type.\n\ttypedef uintptr_t cpCollisionType;\n#endif\n\n#ifdef CP_GROUP_TYPE\n\ttypedef CP_GROUP_TYPE cpGroup;\n#else\n/// Type used for cpShape.group.\n\ttypedef uintptr_t cpGroup;\n#endif\n\n#ifdef CP_LAYERS_TYPE\n\ttypedef CP_LAYERS_TYPE cpLayers;\n#else\n/// Type used for cpShape.layers.\n\ttypedef unsigned int cpLayers;\n#endif\n\n#ifdef CP_TIMESTAMP_TYPE\n\ttypedef CP_TIMESTAMP_TYPE cpTimestamp;\n#else\n/// Type used for various timestamps in Chipmunk.\n\ttypedef unsigned int cpTimestamp;\n#endif\n\n#ifndef CP_NO_GROUP\n/// Value for cpShape.group signifying that a shape is in no group.\n\t#define CP_NO_GROUP ((cpGroup)0)\n#endif\n\n#ifndef CP_ALL_LAYERS\n/// Value for cpShape.layers signifying that a shape is in every layer.\n\t#define CP_ALL_LAYERS (~(cpLayers)0)\n#endif\n/// @}\n\n// CGPoints are structurally the same, and allow\n// easy interoperability with other Cocoa libraries\n#if CP_USE_CGPOINTS\n\ttypedef CGPoint cpVect;\n#else\n/// Chipmunk's 2D vector type.\n/// @addtogroup cpVect\n\ttypedef struct cpVect{cpFloat x,y;} cpVect;\n#endif\n\ntypedef struct cpMat2x2 {\n\t// Row major [[a, b][c d]]\n\tcpFloat a, b, c, d;\n} cpMat2x2;\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/chipmunk_unsafe.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/* This header defines a number of \"unsafe\" operations on Chipmunk objects.\n * In this case \"unsafe\" is referring to operations which may reduce the\n * physical accuracy or numerical stability of the simulation, but will not\n * cause crashes.\n *\n * The prime example is mutating collision shapes. Chipmunk does not support\n * this directly. Mutating shapes using this API will caused objects in contact\n * to be pushed apart using Chipmunk's overlap solver, but not using real\n * persistent velocities. Probably not what you meant, but perhaps close enough.\n */\n\n/// @defgroup unsafe Chipmunk Unsafe Shape Operations\n/// These functions are used for mutating collision shapes.\n/// Chipmunk does not have any way to get velocity information on changing shapes,\n/// so the results will be unrealistic. You must explicity include the chipmunk_unsafe.h header to use them.\n/// @{\n\n#ifndef CHIPMUNK_UNSAFE_HEADER\n#define CHIPMUNK_UNSAFE_HEADER\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/// Set the radius of a circle shape.\nvoid cpCircleShapeSetRadius(cpShape *shape, cpFloat radius);\n/// Set the offset of a circle shape.\nvoid cpCircleShapeSetOffset(cpShape *shape, cpVect offset);\n\n/// Set the endpoints of a segment shape.\nvoid cpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b);\n/// Set the radius of a segment shape.\nvoid cpSegmentShapeSetRadius(cpShape *shape, cpFloat radius);\n\n/// Set the vertexes of a poly shape.\nvoid cpPolyShapeSetVerts(cpShape *shape, int numVerts, cpVect *verts, cpVect offset);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpConstraint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpConstraint cpConstraint\n/// @{\n\ntypedef struct cpConstraintClass cpConstraintClass;\n\ntypedef void (*cpConstraintPreStepImpl)(cpConstraint *constraint, cpFloat dt);\ntypedef void (*cpConstraintApplyCachedImpulseImpl)(cpConstraint *constraint, cpFloat dt_coef);\ntypedef void (*cpConstraintApplyImpulseImpl)(cpConstraint *constraint, cpFloat dt);\ntypedef cpFloat (*cpConstraintGetImpulseImpl)(cpConstraint *constraint);\n\n/// @private\nstruct cpConstraintClass {\n\tcpConstraintPreStepImpl preStep;\n\tcpConstraintApplyCachedImpulseImpl applyCachedImpulse;\n\tcpConstraintApplyImpulseImpl applyImpulse;\n\tcpConstraintGetImpulseImpl getImpulse;\n};\n\n/// Callback function type that gets called before solving a joint.\ntypedef void (*cpConstraintPreSolveFunc)(cpConstraint *constraint, cpSpace *space);\n/// Callback function type that gets called after solving a joint.\ntypedef void (*cpConstraintPostSolveFunc)(cpConstraint *constraint, cpSpace *space);\n\n\n/// Opaque cpConstraint struct.\nstruct cpConstraint {\n\tCP_PRIVATE(const cpConstraintClass *klass);\n\t\n\t/// The first body connected to this constraint.\n\tcpBody *a;\n\t/// The second body connected to this constraint.\n\tcpBody *b;\n\t\n\tCP_PRIVATE(cpSpace *space);\n\t\n\tCP_PRIVATE(cpConstraint *next_a);\n\tCP_PRIVATE(cpConstraint *next_b);\n\t\n\t/// The maximum force that this constraint is allowed to use.\n\t/// Defaults to infinity.\n\tcpFloat maxForce;\n\t/// The rate at which joint error is corrected.\n\t/// Defaults to pow(1.0 - 0.1, 60.0) meaning that it will\n\t/// correct 10% of the error every 1/60th of a second.\n\tcpFloat errorBias;\n\t/// The maximum rate at which joint error is corrected.\n\t/// Defaults to infinity.\n\tcpFloat maxBias;\n\t\n\t/// Function called before the solver runs.\n\t/// Animate your joint anchors, update your motor torque, etc.\n\tcpConstraintPreSolveFunc preSolve;\n\t\n\t/// Function called after the solver runs.\n\t/// Use the applied impulse to perform effects like breakable joints.\n\tcpConstraintPostSolveFunc postSolve;\n\t\n\t/// User definable data pointer.\n\t/// Generally this points to your the game object class so you can access it\n\t/// when given a cpConstraint reference in a callback.\n\tcpDataPointer data;\n};\n\n/// Destroy a constraint.\nvoid cpConstraintDestroy(cpConstraint *constraint);\n/// Destroy and free a constraint.\nvoid cpConstraintFree(cpConstraint *constraint);\n\n/// @private\nstatic inline void cpConstraintActivateBodies(cpConstraint *constraint)\n{\n\tcpBody *a = constraint->a; if(a) cpBodyActivate(a);\n\tcpBody *b = constraint->b; if(b) cpBodyActivate(b);\n}\n\n/// @private\n#define CP_DefineConstraintStructGetter(type, member, name) \\\nstatic inline type cpConstraint##Get##name(const cpConstraint *constraint){return constraint->member;}\n\n/// @private\n#define CP_DefineConstraintStructSetter(type, member, name) \\\nstatic inline void cpConstraint##Set##name(cpConstraint *constraint, type value){ \\\n\tcpConstraintActivateBodies(constraint); \\\n\tconstraint->member = value; \\\n}\n\n/// @private\n#define CP_DefineConstraintStructProperty(type, member, name) \\\nCP_DefineConstraintStructGetter(type, member, name) \\\nCP_DefineConstraintStructSetter(type, member, name)\n\nCP_DefineConstraintStructGetter(cpSpace*, CP_PRIVATE(space), Space)\n\nCP_DefineConstraintStructGetter(cpBody*, a, A)\nCP_DefineConstraintStructGetter(cpBody*, b, B)\nCP_DefineConstraintStructProperty(cpFloat, maxForce, MaxForce)\nCP_DefineConstraintStructProperty(cpFloat, errorBias, ErrorBias)\nCP_DefineConstraintStructProperty(cpFloat, maxBias, MaxBias)\nCP_DefineConstraintStructProperty(cpConstraintPreSolveFunc, preSolve, PreSolveFunc)\nCP_DefineConstraintStructProperty(cpConstraintPostSolveFunc, postSolve, PostSolveFunc)\nCP_DefineConstraintStructProperty(cpDataPointer, data, UserData)\n\n// Get the last impulse applied by this constraint.\nstatic inline cpFloat cpConstraintGetImpulse(cpConstraint *constraint)\n{\n\treturn constraint->CP_PRIVATE(klass)->getImpulse(constraint);\n}\n\n/// @}\n\n#define cpConstraintCheckCast(constraint, struct) \\\n\tcpAssertHard(constraint->CP_PRIVATE(klass) == struct##GetClass(), \"Constraint is not a \"#struct)\n\n#define CP_DefineConstraintGetter(struct, type, member, name) \\\nstatic inline type struct##Get##name(const cpConstraint *constraint){ \\\n\tcpConstraintCheckCast(constraint, struct); \\\n\treturn ((struct *)constraint)->member; \\\n}\n\n#define CP_DefineConstraintSetter(struct, type, member, name) \\\nstatic inline void struct##Set##name(cpConstraint *constraint, type value){ \\\n\tcpConstraintCheckCast(constraint, struct); \\\n\tcpConstraintActivateBodies(constraint); \\\n\t((struct *)constraint)->member = value; \\\n}\n\n#define CP_DefineConstraintProperty(struct, type, member, name) \\\nCP_DefineConstraintGetter(struct, type, member, name) \\\nCP_DefineConstraintSetter(struct, type, member, name)\n\n#include \"cpPinJoint.h\"\n#include \"cpSlideJoint.h\"\n#include \"cpPivotJoint.h\"\n#include \"cpGrooveJoint.h\"\n#include \"cpDampedSpring.h\"\n#include \"cpDampedRotarySpring.h\"\n#include \"cpRotaryLimitJoint.h\"\n#include \"cpRatchetJoint.h\"\n#include \"cpGearJoint.h\"\n#include \"cpSimpleMotor.h\"\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpDampedRotarySpring.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpDampedRotarySpring cpDampedRotarySpring\n/// @{\n\ntypedef cpFloat (*cpDampedRotarySpringTorqueFunc)(struct cpConstraint *spring, cpFloat relativeAngle);\n\nconst cpConstraintClass *cpDampedRotarySpringGetClass(void);\n\n/// @private\ntypedef struct cpDampedRotarySpring {\n\tcpConstraint constraint;\n\tcpFloat restAngle;\n\tcpFloat stiffness;\n\tcpFloat damping;\n\tcpDampedRotarySpringTorqueFunc springTorqueFunc;\n\t\n\tcpFloat target_wrn;\n\tcpFloat w_coef;\n\t\n\tcpFloat iSum;\n\tcpFloat jAcc;\n} cpDampedRotarySpring;\n\n/// Allocate a damped rotary spring.\ncpDampedRotarySpring* cpDampedRotarySpringAlloc(void);\n/// Initialize a damped rotary spring.\ncpDampedRotarySpring* cpDampedRotarySpringInit(cpDampedRotarySpring *joint, cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping);\n/// Allocate and initialize a damped rotary spring.\ncpConstraint* cpDampedRotarySpringNew(cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping);\n\nCP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, restAngle, RestAngle)\nCP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, stiffness, Stiffness)\nCP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, damping, Damping)\nCP_DefineConstraintProperty(cpDampedRotarySpring, cpDampedRotarySpringTorqueFunc, springTorqueFunc, SpringTorqueFunc)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpDampedSpring.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpDampedSpring cpDampedSpring\n/// @{\n\ntypedef struct cpDampedSpring cpDampedSpring;\n\ntypedef cpFloat (*cpDampedSpringForceFunc)(cpConstraint *spring, cpFloat dist);\n\nconst cpConstraintClass *cpDampedSpringGetClass(void);\n\n/// @private\nstruct cpDampedSpring {\n\tcpConstraint constraint;\n\tcpVect anchr1, anchr2;\n\tcpFloat restLength;\n\tcpFloat stiffness;\n\tcpFloat damping;\n\tcpDampedSpringForceFunc springForceFunc;\n\t\n\tcpFloat target_vrn;\n\tcpFloat v_coef;\n\t\n\tcpVect r1, r2;\n\tcpFloat nMass;\n\tcpVect n;\n\t\n\tcpFloat jAcc;\n};\n\n/// Allocate a damped spring.\ncpDampedSpring* cpDampedSpringAlloc(void);\n/// Initialize a damped spring.\ncpDampedSpring* cpDampedSpringInit(cpDampedSpring *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping);\n/// Allocate and initialize a damped spring.\ncpConstraint* cpDampedSpringNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping);\n\nCP_DefineConstraintProperty(cpDampedSpring, cpVect, anchr1, Anchr1)\nCP_DefineConstraintProperty(cpDampedSpring, cpVect, anchr2, Anchr2)\nCP_DefineConstraintProperty(cpDampedSpring, cpFloat, restLength, RestLength)\nCP_DefineConstraintProperty(cpDampedSpring, cpFloat, stiffness, Stiffness)\nCP_DefineConstraintProperty(cpDampedSpring, cpFloat, damping, Damping)\nCP_DefineConstraintProperty(cpDampedSpring, cpDampedSpringForceFunc, springForceFunc, SpringForceFunc)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpGearJoint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpGearJoint cpGearJoint\n/// @{\n\nconst cpConstraintClass *cpGearJointGetClass(void);\n\n/// @private\ntypedef struct cpGearJoint {\n\tcpConstraint constraint;\n\tcpFloat phase, ratio;\n\tcpFloat ratio_inv;\n\t\n\tcpFloat iSum;\n\t\t\n\tcpFloat bias;\n\tcpFloat jAcc;\n} cpGearJoint;\n\n/// Allocate a gear joint.\ncpGearJoint* cpGearJointAlloc(void);\n/// Initialize a gear joint.\ncpGearJoint* cpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio);\n/// Allocate and initialize a gear joint.\ncpConstraint* cpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio);\n\nCP_DefineConstraintProperty(cpGearJoint, cpFloat, phase, Phase)\nCP_DefineConstraintGetter(cpGearJoint, cpFloat, ratio, Ratio)\n/// Set the ratio of a gear joint.\nvoid cpGearJointSetRatio(cpConstraint *constraint, cpFloat value);\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpGrooveJoint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpGrooveJoint cpGrooveJoint\n/// @{\n\nconst cpConstraintClass *cpGrooveJointGetClass(void);\n\n/// @private\ntypedef struct cpGrooveJoint {\n\tcpConstraint constraint;\n\tcpVect grv_n, grv_a, grv_b;\n\tcpVect  anchr2;\n\t\n\tcpVect grv_tn;\n\tcpFloat clamp;\n\tcpVect r1, r2;\n\tcpMat2x2 k;\n\t\n\tcpVect jAcc;\n\tcpVect bias;\n} cpGrooveJoint;\n\n/// Allocate a groove joint.\ncpGrooveJoint* cpGrooveJointAlloc(void);\n/// Initialize a groove joint.\ncpGrooveJoint* cpGrooveJointInit(cpGrooveJoint *joint, cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2);\n/// Allocate and initialize a groove joint.\ncpConstraint* cpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2);\n\nCP_DefineConstraintGetter(cpGrooveJoint, cpVect, grv_a, GrooveA)\n/// Set endpoint a of a groove joint's groove\nvoid cpGrooveJointSetGrooveA(cpConstraint *constraint, cpVect value);\nCP_DefineConstraintGetter(cpGrooveJoint, cpVect, grv_b, GrooveB)\n/// Set endpoint b of a groove joint's groove\nvoid cpGrooveJointSetGrooveB(cpConstraint *constraint, cpVect value);\nCP_DefineConstraintProperty(cpGrooveJoint, cpVect, anchr2, Anchr2)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpPinJoint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n/// @defgroup cpPinJoint cpPinJoint\n/// @{\n\nconst cpConstraintClass *cpPinJointGetClass(void);\n\n/// @private\ntypedef struct cpPinJoint {\n\tcpConstraint constraint;\n\tcpVect anchr1, anchr2;\n\tcpFloat dist;\n\t\n\tcpVect r1, r2;\n\tcpVect n;\n\tcpFloat nMass;\n\t\n\tcpFloat jnAcc;\n\tcpFloat bias;\n} cpPinJoint;\n\n/// Allocate a pin joint.\ncpPinJoint* cpPinJointAlloc(void);\n/// Initialize a pin joint.\ncpPinJoint* cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2);\n/// Allocate and initialize a pin joint.\ncpConstraint* cpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2);\n\nCP_DefineConstraintProperty(cpPinJoint, cpVect, anchr1, Anchr1)\nCP_DefineConstraintProperty(cpPinJoint, cpVect, anchr2, Anchr2)\nCP_DefineConstraintProperty(cpPinJoint, cpFloat, dist, Dist)\n\n///@}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpPivotJoint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpPivotJoint cpPivotJoint\n/// @{\n\nconst cpConstraintClass *cpPivotJointGetClass(void);\n\n/// @private\ntypedef struct cpPivotJoint {\n\tcpConstraint constraint;\n\tcpVect anchr1, anchr2;\n\t\n\tcpVect r1, r2;\n\tcpMat2x2 k;\n\t\n\tcpVect jAcc;\n\tcpVect bias;\n} cpPivotJoint;\n\n/// Allocate a pivot joint\ncpPivotJoint* cpPivotJointAlloc(void);\n/// Initialize a pivot joint.\ncpPivotJoint* cpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2);\n/// Allocate and initialize a pivot joint.\ncpConstraint* cpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot);\n/// Allocate and initialize a pivot joint with specific anchors.\ncpConstraint* cpPivotJointNew2(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2);\n\nCP_DefineConstraintProperty(cpPivotJoint, cpVect, anchr1, Anchr1)\nCP_DefineConstraintProperty(cpPivotJoint, cpVect, anchr2, Anchr2)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpRatchetJoint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpRatchetJoint cpRatchetJoint\n/// @{\n\nconst cpConstraintClass *cpRatchetJointGetClass(void);\n\n/// @private\ntypedef struct cpRatchetJoint {\n\tcpConstraint constraint;\n\tcpFloat angle, phase, ratchet;\n\t\n\tcpFloat iSum;\n\t\t\n\tcpFloat bias;\n\tcpFloat jAcc;\n} cpRatchetJoint;\n\n/// Allocate a ratchet joint.\ncpRatchetJoint* cpRatchetJointAlloc(void);\n/// Initialize a ratched joint.\ncpRatchetJoint* cpRatchetJointInit(cpRatchetJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet);\n/// Allocate and initialize a ratchet joint.\ncpConstraint* cpRatchetJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet);\n\nCP_DefineConstraintProperty(cpRatchetJoint, cpFloat, angle, Angle)\nCP_DefineConstraintProperty(cpRatchetJoint, cpFloat, phase, Phase)\nCP_DefineConstraintProperty(cpRatchetJoint, cpFloat, ratchet, Ratchet)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpRotaryLimitJoint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpRotaryLimitJoint cpRotaryLimitJoint\n/// @{\n\nconst cpConstraintClass *cpRotaryLimitJointGetClass(void);\n\n/// @private\ntypedef struct cpRotaryLimitJoint {\n\tcpConstraint constraint;\n\tcpFloat min, max;\n\t\n\tcpFloat iSum;\n\t\t\n\tcpFloat bias;\n\tcpFloat jAcc;\n} cpRotaryLimitJoint;\n\n/// Allocate a damped rotary limit joint.\ncpRotaryLimitJoint* cpRotaryLimitJointAlloc(void);\n/// Initialize a damped rotary limit joint.\ncpRotaryLimitJoint* cpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max);\n/// Allocate and initialize a damped rotary limit joint.\ncpConstraint* cpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max);\n\nCP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, min, Min)\nCP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, max, Max)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpSimpleMotor.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpSimpleMotor cpSimpleMotor\n/// @{\n\nconst cpConstraintClass *cpSimpleMotorGetClass(void);\n\n/// @private\ntypedef struct cpSimpleMotor {\n\tcpConstraint constraint;\n\tcpFloat rate;\n\t\n\tcpFloat iSum;\n\t\t\n\tcpFloat jAcc;\n} cpSimpleMotor;\n\n/// Allocate a simple motor.\ncpSimpleMotor* cpSimpleMotorAlloc(void);\n/// initialize a simple motor.\ncpSimpleMotor* cpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate);\n/// Allocate and initialize a simple motor.\ncpConstraint* cpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate);\n\nCP_DefineConstraintProperty(cpSimpleMotor, cpFloat, rate, Rate)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/cpSlideJoint.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpSlideJoint cpSlideJoint\n/// @{\n\nconst cpConstraintClass *cpSlideJointGetClass(void);\n\n/// @private\ntypedef struct cpSlideJoint {\n\tcpConstraint constraint;\n\tcpVect anchr1, anchr2;\n\tcpFloat min, max;\n\t\n\tcpVect r1, r2;\n\tcpVect n;\n\tcpFloat nMass;\n\t\n\tcpFloat jnAcc;\n\tcpFloat bias;\n} cpSlideJoint;\n\n/// Allocate a slide joint.\ncpSlideJoint* cpSlideJointAlloc(void);\n/// Initialize a slide joint.\ncpSlideJoint* cpSlideJointInit(cpSlideJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max);\n/// Allocate and initialize a slide joint.\ncpConstraint* cpSlideJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max);\n\nCP_DefineConstraintProperty(cpSlideJoint, cpVect, anchr1, Anchr1)\nCP_DefineConstraintProperty(cpSlideJoint, cpVect, anchr2, Anchr2)\nCP_DefineConstraintProperty(cpSlideJoint, cpFloat, min, Min)\nCP_DefineConstraintProperty(cpSlideJoint, cpFloat, max, Max)\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/constraints/util.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n// These are utility routines to use when creating custom constraints.\n// I'm not sure if this should be part of the private API or not.\n// I should probably clean up the naming conventions if it is...\n\n#define CP_DefineClassGetter(t) const cpConstraintClass * t##GetClass(void){return (cpConstraintClass *)&klass;}\n\nvoid cpConstraintInit(cpConstraint *constraint, const cpConstraintClass *klass, cpBody *a, cpBody *b);\n\nstatic inline cpVect\nrelative_velocity(cpBody *a, cpBody *b, cpVect r1, cpVect r2){\n\tcpVect v1_sum = cpvadd(a->v, cpvmult(cpvperp(r1), a->w));\n\tcpVect v2_sum = cpvadd(b->v, cpvmult(cpvperp(r2), b->w));\n\t\n\treturn cpvsub(v2_sum, v1_sum);\n}\n\nstatic inline cpFloat\nnormal_relative_velocity(cpBody *a, cpBody *b, cpVect r1, cpVect r2, cpVect n){\n\treturn cpvdot(relative_velocity(a, b, r1, r2), n);\n}\n\nstatic inline void\napply_impulse(cpBody *body, cpVect j, cpVect r){\n\tbody->v = cpvadd(body->v, cpvmult(j, body->m_inv));\n\tbody->w += body->i_inv*cpvcross(r, j);\n}\n\nstatic inline void\napply_impulses(cpBody *a , cpBody *b, cpVect r1, cpVect r2, cpVect j)\n{\n\tapply_impulse(a, cpvneg(j), r1);\n\tapply_impulse(b, j, r2);\n}\n\nstatic inline void\napply_bias_impulse(cpBody *body, cpVect j, cpVect r)\n{\n\tbody->CP_PRIVATE(v_bias) = cpvadd(body->CP_PRIVATE(v_bias), cpvmult(j, body->m_inv));\n\tbody->CP_PRIVATE(w_bias) += body->i_inv*cpvcross(r, j);\n}\n\nstatic inline void\napply_bias_impulses(cpBody *a , cpBody *b, cpVect r1, cpVect r2, cpVect j)\n{\n\tapply_bias_impulse(a, cpvneg(j), r1);\n\tapply_bias_impulse(b, j, r2);\n}\n\nstatic inline cpFloat\nk_scalar_body(cpBody *body, cpVect r, cpVect n)\n{\n\tcpFloat rcn = cpvcross(r, n);\n\treturn body->m_inv + body->i_inv*rcn*rcn;\n}\n\nstatic inline cpFloat\nk_scalar(cpBody *a, cpBody *b, cpVect r1, cpVect r2, cpVect n)\n{\n\tcpFloat value = k_scalar_body(a, r1, n) + k_scalar_body(b, r2, n);\n\tcpAssertSoft(value != 0.0, \"Unsolvable collision or constraint.\");\n\t\n\treturn value;\n}\n\nstatic inline cpMat2x2\nk_tensor(cpBody *a, cpBody *b, cpVect r1, cpVect r2)\n{\n\tcpFloat m_sum = a->m_inv + b->m_inv;\n\t\n\t// start with Identity*m_sum\n\tcpFloat k11 = m_sum, k12 = 0.0f;\n\tcpFloat k21 = 0.0f,  k22 = m_sum;\n\t\n\t// add the influence from r1\n\tcpFloat a_i_inv = a->i_inv;\n\tcpFloat r1xsq =  r1.x * r1.x * a_i_inv;\n\tcpFloat r1ysq =  r1.y * r1.y * a_i_inv;\n\tcpFloat r1nxy = -r1.x * r1.y * a_i_inv;\n\tk11 += r1ysq; k12 += r1nxy;\n\tk21 += r1nxy; k22 += r1xsq;\n\t\n\t// add the influnce from r2\n\tcpFloat b_i_inv = b->i_inv;\n\tcpFloat r2xsq =  r2.x * r2.x * b_i_inv;\n\tcpFloat r2ysq =  r2.y * r2.y * b_i_inv;\n\tcpFloat r2nxy = -r2.x * r2.y * b_i_inv;\n\tk11 += r2ysq; k12 += r2nxy;\n\tk21 += r2nxy; k22 += r2xsq;\n\t\n\t// invert\n\tcpFloat det = k11*k22 - k12*k21;\n\tcpAssertSoft(det != 0.0, \"Unsolvable constraint.\");\n\t\n\tcpFloat det_inv = 1.0f/det;\n\treturn cpMat2x2New(\n\t\t k22*det_inv, -k12*det_inv,\n\t\t-k21*det_inv,  k11*det_inv\n \t);\n}\n\nstatic inline cpFloat\nbias_coef(cpFloat errorBias, cpFloat dt)\n{\n\treturn 1.0f - cpfpow(errorBias, dt);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpArbiter.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpArbiter cpArbiter\n/// The cpArbiter struct controls pairs of colliding shapes.\n/// They are also used in conjuction with collision handler callbacks\n/// allowing you to retrieve information on the collision and control it.\n/// @{\n\n/// Collision begin event function callback type.\n/// Returning false from a begin callback causes the collision to be ignored until\n/// the the separate callback is called when the objects stop colliding.\ntypedef cpBool (*cpCollisionBeginFunc)(cpArbiter *arb, cpSpace *space, void *data);\n/// Collision pre-solve event function callback type.\n/// Returning false from a pre-step callback causes the collision to be ignored until the next step.\ntypedef cpBool (*cpCollisionPreSolveFunc)(cpArbiter *arb, cpSpace *space, void *data);\n/// Collision post-solve event function callback type.\ntypedef void (*cpCollisionPostSolveFunc)(cpArbiter *arb, cpSpace *space, void *data);\n/// Collision separate event function callback type.\ntypedef void (*cpCollisionSeparateFunc)(cpArbiter *arb, cpSpace *space, void *data);\n\n/// @private\nstruct cpCollisionHandler {\n\tcpCollisionType a;\n\tcpCollisionType b;\n\tcpCollisionBeginFunc begin;\n\tcpCollisionPreSolveFunc preSolve;\n\tcpCollisionPostSolveFunc postSolve;\n\tcpCollisionSeparateFunc separate;\n\tvoid *data;\n};\n\ntypedef struct cpContact cpContact;\n\n#define CP_MAX_CONTACTS_PER_ARBITER 4\n\n/// @private\ntypedef enum cpArbiterState {\n\t// Arbiter is active and its the first collision.\n\tcpArbiterStateFirstColl,\n\t// Arbiter is active and its not the first collision.\n\tcpArbiterStateNormal,\n\t// Collision has been explicitly ignored.\n\t// Either by returning false from a begin collision handler or calling cpArbiterIgnore().\n\tcpArbiterStateIgnore,\n\t// Collison is no longer active. A space will cache an arbiter for up to cpSpace.collisionPersistence more steps.\n\tcpArbiterStateCached,\n} cpArbiterState;\n\n/// @private\nstruct cpArbiterThread {\n\t// Links to next and previous arbiters in the contact graph.\n\tstruct cpArbiter *next, *prev;\n};\n\n/// A colliding pair of shapes.\nstruct cpArbiter {\n\t/// Calculated value to use for the elasticity coefficient.\n\t/// Override in a pre-solve collision handler for custom behavior.\n\tcpFloat e;\n\t/// Calculated value to use for the friction coefficient.\n\t/// Override in a pre-solve collision handler for custom behavior.\n\tcpFloat u;\n\t /// Calculated value to use for applying surface velocities.\n\t/// Override in a pre-solve collision handler for custom behavior.\n\tcpVect surface_vr;\n\t\n\t/// User definable data pointer.\n\t/// The value will persist for the pair of shapes until the separate() callback is called.\n\t/// NOTE: If you need to clean up this pointer, you should implement the separate() callback to do it.\n\tcpDataPointer data;\n\t\n\tCP_PRIVATE(cpShape *a);\n\tCP_PRIVATE(cpShape *b);\n\tCP_PRIVATE(cpBody *body_a);\n\tCP_PRIVATE(cpBody *body_b);\n\t\n\tCP_PRIVATE(struct cpArbiterThread thread_a);\n\tCP_PRIVATE(struct cpArbiterThread thread_b);\n\t\n\tCP_PRIVATE(int numContacts);\n\tCP_PRIVATE(cpContact *contacts);\n\t\n\tCP_PRIVATE(cpTimestamp stamp);\n\tCP_PRIVATE(cpCollisionHandler *handler);\n\tCP_PRIVATE(cpBool swappedColl);\n\tCP_PRIVATE(cpArbiterState state);\n};\n\n#define CP_DefineArbiterStructGetter(type, member, name) \\\nstatic inline type cpArbiterGet##name(const cpArbiter *arb){return arb->member;}\n\n#define CP_DefineArbiterStructSetter(type, member, name) \\\nstatic inline void cpArbiterSet##name(cpArbiter *arb, type value){arb->member = value;}\n\n#define CP_DefineArbiterStructProperty(type, member, name) \\\nCP_DefineArbiterStructGetter(type, member, name) \\\nCP_DefineArbiterStructSetter(type, member, name)\n\nCP_DefineArbiterStructProperty(cpFloat, e, Elasticity)\nCP_DefineArbiterStructProperty(cpFloat, u, Friction)\n\n// Get the relative surface velocity of the two shapes in contact.\ncpVect cpArbiterGetSurfaceVelocity(cpArbiter *arb);\n\n// Override the relative surface velocity of the two shapes in contact.\n// By default this is calculated to be the difference of the two\n// surface velocities clamped to the tangent plane.\nvoid cpArbiterSetSurfaceVelocity(cpArbiter *arb, cpVect vr);\n\nCP_DefineArbiterStructProperty(cpDataPointer, data, UserData)\n\n/// Calculate the total impulse that was applied by this arbiter.\n/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback.\ncpVect cpArbiterTotalImpulse(const cpArbiter *arb);\n/// Calculate the total impulse including the friction that was applied by this arbiter.\n/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback.\ncpVect cpArbiterTotalImpulseWithFriction(const cpArbiter *arb);\n/// Calculate the amount of energy lost in a collision including static, but not dynamic friction.\n/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback.\ncpFloat cpArbiterTotalKE(const cpArbiter *arb);\n\n\n/// Causes a collision pair to be ignored as if you returned false from a begin callback.\n/// If called from a pre-step callback, you will still need to return false\n/// if you want it to be ignored in the current step.\nvoid cpArbiterIgnore(cpArbiter *arb);\n\n/// Return the colliding shapes involved for this arbiter.\n/// The order of their cpSpace.collision_type values will match\n/// the order set when the collision handler was registered.\nstatic inline void cpArbiterGetShapes(const cpArbiter *arb, cpShape **a, cpShape **b)\n{\n\tif(arb->CP_PRIVATE(swappedColl)){\n\t\t(*a) = arb->CP_PRIVATE(b), (*b) = arb->CP_PRIVATE(a);\n\t} else {\n\t\t(*a) = arb->CP_PRIVATE(a), (*b) = arb->CP_PRIVATE(b);\n\t}\n}\n/// A macro shortcut for defining and retrieving the shapes from an arbiter.\n#define CP_ARBITER_GET_SHAPES(__arb__, __a__, __b__) cpShape *__a__, *__b__; cpArbiterGetShapes(__arb__, &__a__, &__b__);\n\n/// Return the colliding bodies involved for this arbiter.\n/// The order of the cpSpace.collision_type the bodies are associated with values will match\n/// the order set when the collision handler was registered.\nstatic inline void cpArbiterGetBodies(const cpArbiter *arb, cpBody **a, cpBody **b)\n{\n\tCP_ARBITER_GET_SHAPES(arb, shape_a, shape_b);\n\t(*a) = shape_a->body;\n\t(*b) = shape_b->body;\n}\n/// A macro shortcut for defining and retrieving the bodies from an arbiter.\n#define CP_ARBITER_GET_BODIES(__arb__, __a__, __b__) cpBody *__a__, *__b__; cpArbiterGetBodies(__arb__, &__a__, &__b__);\n\n/// A struct that wraps up the important collision data for an arbiter.\ntypedef struct cpContactPointSet {\n\t/// The number of contact points in the set.\n\tint count;\n\t\n\t/// The array of contact points.\n\tstruct {\n\t\t/// The position of the contact point.\n\t\tcpVect point;\n\t\t/// The normal of the contact point.\n\t\tcpVect normal;\n\t\t/// The depth of the contact point.\n\t\tcpFloat dist;\n\t} points[CP_MAX_CONTACTS_PER_ARBITER];\n} cpContactPointSet;\n\n/// Return a contact set from an arbiter.\ncpContactPointSet cpArbiterGetContactPointSet(const cpArbiter *arb);\n\n/// Replace the contact point set for an arbiter.\n/// This can be a very powerful feature, but use it with caution!\nvoid cpArbiterSetContactPointSet(cpArbiter *arb, cpContactPointSet *set);\n\n/// Returns true if this is the first step a pair of objects started colliding.\ncpBool cpArbiterIsFirstContact(const cpArbiter *arb);\n/// Get the number of contact points for this arbiter.\nint cpArbiterGetCount(const cpArbiter *arb);\n/// Get the normal of the @c ith contact point.\ncpVect cpArbiterGetNormal(const cpArbiter *arb, int i);\n/// Get the position of the @c ith contact point.\ncpVect cpArbiterGetPoint(const cpArbiter *arb, int i);\n/// Get the depth of the @c ith contact point.\ncpFloat cpArbiterGetDepth(const cpArbiter *arb, int i);\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpBB.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpBBB cpBB\n/// Chipmunk's axis-aligned 2D bounding box type along with a few handy routines.\n/// @{\n\n/// Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top)\ntypedef struct cpBB{\n\tcpFloat l, b, r ,t;\n} cpBB;\n\n/// Convenience constructor for cpBB structs.\nstatic inline cpBB cpBBNew(const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t)\n{\n\tcpBB bb = {l, b, r, t};\n\treturn bb;\n}\n\n/// Constructs a cpBB for a circle with the given position and radius.\nstatic inline cpBB cpBBNewForCircle(const cpVect p, const cpFloat r)\n{\n\treturn cpBBNew(p.x - r, p.y - r, p.x + r, p.y + r);\n}\n\n/// Returns true if @c a and @c b intersect.\nstatic inline cpBool cpBBIntersects(const cpBB a, const cpBB b)\n{\n\treturn (a.l <= b.r && b.l <= a.r && a.b <= b.t && b.b <= a.t);\n}\n\n/// Returns true if @c other lies completely within @c bb.\nstatic inline cpBool cpBBContainsBB(const cpBB bb, const cpBB other)\n{\n\treturn (bb.l <= other.l && bb.r >= other.r && bb.b <= other.b && bb.t >= other.t);\n}\n\n/// Returns true if @c bb contains @c v.\nstatic inline cpBool cpBBContainsVect(const cpBB bb, const cpVect v)\n{\n\treturn (bb.l <= v.x && bb.r >= v.x && bb.b <= v.y && bb.t >= v.y);\n}\n\n/// Returns a bounding box that holds both bounding boxes.\nstatic inline cpBB cpBBMerge(const cpBB a, const cpBB b){\n\treturn cpBBNew(\n\t\tcpfmin(a.l, b.l),\n\t\tcpfmin(a.b, b.b),\n\t\tcpfmax(a.r, b.r),\n\t\tcpfmax(a.t, b.t)\n\t);\n}\n\n/// Returns a bounding box that holds both @c bb and @c v.\nstatic inline cpBB cpBBExpand(const cpBB bb, const cpVect v){\n\treturn cpBBNew(\n\t\tcpfmin(bb.l, v.x),\n\t\tcpfmin(bb.b, v.y),\n\t\tcpfmax(bb.r, v.x),\n\t\tcpfmax(bb.t, v.y)\n\t);\n}\n\n/// Returns the area of the bounding box.\nstatic inline cpFloat cpBBArea(cpBB bb)\n{\n\treturn (bb.r - bb.l)*(bb.t - bb.b);\n}\n\n/// Merges @c a and @c b and returns the area of the merged bounding box.\nstatic inline cpFloat cpBBMergedArea(cpBB a, cpBB b)\n{\n\treturn (cpfmax(a.r, b.r) - cpfmin(a.l, b.l))*(cpfmax(a.t, b.t) - cpfmin(a.b, b.b));\n}\n\n/// Returns the fraction along the segment query the cpBB is hit. Returns INFINITY if it doesn't hit.\nstatic inline cpFloat cpBBSegmentQuery(cpBB bb, cpVect a, cpVect b)\n{\n\tcpFloat idx = 1.0f/(b.x - a.x);\n\tcpFloat tx1 = (bb.l == a.x ? -INFINITY : (bb.l - a.x)*idx);\n\tcpFloat tx2 = (bb.r == a.x ?  INFINITY : (bb.r - a.x)*idx);\n\tcpFloat txmin = cpfmin(tx1, tx2);\n\tcpFloat txmax = cpfmax(tx1, tx2);\n\t\n\tcpFloat idy = 1.0f/(b.y - a.y);\n\tcpFloat ty1 = (bb.b == a.y ? -INFINITY : (bb.b - a.y)*idy);\n\tcpFloat ty2 = (bb.t == a.y ?  INFINITY : (bb.t - a.y)*idy);\n\tcpFloat tymin = cpfmin(ty1, ty2);\n\tcpFloat tymax = cpfmax(ty1, ty2);\n\t\n\tif(tymin <= txmax && txmin <= tymax){\n\t\tcpFloat min = cpfmax(txmin, tymin);\n\t\tcpFloat max = cpfmin(txmax, tymax);\n\t\t\n\t\tif(0.0 <= max && min <= 1.0) return cpfmax(min, 0.0);\n\t}\n\t\n\treturn INFINITY;\n}\n\n/// Return true if the bounding box intersects the line segment with ends @c a and @c b.\nstatic inline cpBool cpBBIntersectsSegment(cpBB bb, cpVect a, cpVect b)\n{\n\treturn (cpBBSegmentQuery(bb, a, b) != INFINITY);\n}\n\n/// Clamp a vector to a bounding box.\nstatic inline cpVect\ncpBBClampVect(const cpBB bb, const cpVect v)\n{\n\treturn cpv(cpfclamp(v.x, bb.l, bb.r), cpfclamp(v.y, bb.b, bb.t));\n}\n\n// TODO edge case issue\n/// Wrap a vector to a bounding box.\ncpVect cpBBWrapVect(const cpBB bb, const cpVect v); // wrap a vector to a bbox\n\n///@}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpBody.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpBody cpBody\n/// Chipmunk's rigid body type. Rigid bodies hold the physical properties of an object like\n/// it's mass, and position and velocity of it's center of gravity. They don't have an shape on their own.\n/// They are given a shape by creating collision shapes (cpShape) that point to the body.\n/// @{\n\n/// Rigid body velocity update function type.\ntypedef void (*cpBodyVelocityFunc)(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt);\n/// Rigid body position update function type.\ntypedef void (*cpBodyPositionFunc)(cpBody *body, cpFloat dt);\n\n/// Used internally to track information on the collision graph.\n/// @private\ntypedef struct cpComponentNode {\n\tcpBody *root;\n\tcpBody *next;\n\tcpFloat idleTime;\n} cpComponentNode;\n\n/// Chipmunk's rigid body struct.\nstruct cpBody {\n\t/// Function that is called to integrate the body's velocity. (Defaults to cpBodyUpdateVelocity)\n\tcpBodyVelocityFunc velocity_func;\n\t\n\t/// Function that is called to integrate the body's position. (Defaults to cpBodyUpdatePosition)\n\tcpBodyPositionFunc position_func;\n\t\n\t/// Mass of the body.\n\t/// Must agree with cpBody.m_inv! Use cpBodySetMass() when changing the mass for this reason.\n\tcpFloat m;\n\t/// Mass inverse.\n\tcpFloat m_inv;\n\t\n\t/// Moment of inertia of the body.\n\t/// Must agree with cpBody.i_inv! Use cpBodySetMoment() when changing the moment for this reason.\n\tcpFloat i;\n\t/// Moment of inertia inverse.\n\tcpFloat i_inv;\n\t\n\t/// Position of the rigid body's center of gravity.\n\tcpVect p;\n\t/// Velocity of the rigid body's center of gravity.\n\tcpVect v;\n\t/// Force acting on the rigid body's center of gravity.\n\tcpVect f;\n\t\n\t/// Rotation of the body around it's center of gravity in radians.\n\t/// Must agree with cpBody.rot! Use cpBodySetAngle() when changing the angle for this reason.\n\tcpFloat a;\n\t/// Angular velocity of the body around it's center of gravity in radians/second.\n\tcpFloat w;\n\t/// Torque applied to the body around it's center of gravity.\n\tcpFloat t;\n\t\n\t/// Cached unit length vector representing the angle of the body.\n\t/// Used for fast rotations using cpvrotate().\n\tcpVect rot;\n\t\n\t/// User definable data pointer.\n\t/// Generally this points to your the game object class so you can access it\n\t/// when given a cpBody reference in a callback.\n\tcpDataPointer data;\n\t\n\t/// Maximum velocity allowed when updating the velocity.\n\tcpFloat v_limit;\n\t/// Maximum rotational rate (in radians/second) allowed when updating the angular velocity.\n\tcpFloat w_limit;\n\t\n\tCP_PRIVATE(cpVect v_bias);\n\tCP_PRIVATE(cpFloat w_bias);\n\t\n\tCP_PRIVATE(cpSpace *space);\n\t\n\tCP_PRIVATE(cpShape *shapeList);\n\tCP_PRIVATE(cpArbiter *arbiterList);\n\tCP_PRIVATE(cpConstraint *constraintList);\n\t\n\tCP_PRIVATE(cpComponentNode node);\n};\n\n/// Allocate a cpBody.\ncpBody* cpBodyAlloc(void);\n/// Initialize a cpBody.\ncpBody* cpBodyInit(cpBody *body, cpFloat m, cpFloat i);\n/// Allocate and initialize a cpBody.\ncpBody* cpBodyNew(cpFloat m, cpFloat i);\n\n/// Initialize a static cpBody.\ncpBody* cpBodyInitStatic(cpBody *body);\n/// Allocate and initialize a static cpBody.\ncpBody* cpBodyNewStatic(void);\n\n/// Destroy a cpBody.\nvoid cpBodyDestroy(cpBody *body);\n/// Destroy and free a cpBody.\nvoid cpBodyFree(cpBody *body);\n\n/// Check that the properties of a body is sane. (Only in debug mode)\n#ifdef NDEBUG\n\t#define\tcpBodyAssertSane(body)\n#else\n\tvoid cpBodySanityCheck(cpBody *body);\n\t#define\tcpBodyAssertSane(body) cpBodySanityCheck(body)\n#endif\n\n// Defined in cpSpace.c\n/// Wake up a sleeping or idle body.\nvoid cpBodyActivate(cpBody *body);\n/// Wake up any sleeping or idle bodies touching a static body.\nvoid cpBodyActivateStatic(cpBody *body, cpShape *filter);\n\n/// Force a body to fall asleep immediately.\nvoid cpBodySleep(cpBody *body);\n/// Force a body to fall asleep immediately along with other bodies in a group.\nvoid cpBodySleepWithGroup(cpBody *body, cpBody *group);\n\n/// Returns true if the body is sleeping.\nstatic inline cpBool cpBodyIsSleeping(const cpBody *body)\n{\n\treturn (CP_PRIVATE(body->node).root != ((cpBody*)0));\n}\n\n/// Returns true if the body is static.\nstatic inline cpBool cpBodyIsStatic(const cpBody *body)\n{\n\treturn CP_PRIVATE(body->node).idleTime == INFINITY;\n}\n\n/// Returns true if the body has not been added to a space.\n/// Note: Static bodies are a subtype of rogue bodies.\nstatic inline cpBool cpBodyIsRogue(const cpBody *body)\n{\n\treturn (body->CP_PRIVATE(space) == ((cpSpace*)0));\n}\n\n\n#define CP_DefineBodyStructGetter(type, member, name) \\\nstatic inline type cpBodyGet##name(const cpBody *body){return body->member;}\n\n#define CP_DefineBodyStructSetter(type, member, name) \\\nstatic inline void cpBodySet##name(cpBody *body, const type value){ \\\n\tcpBodyActivate(body); \\\n\tbody->member = value; \\\n\tcpBodyAssertSane(body); \\\n}\n\n#define CP_DefineBodyStructProperty(type, member, name) \\\nCP_DefineBodyStructGetter(type, member, name) \\\nCP_DefineBodyStructSetter(type, member, name)\n\n// TODO add to docs\nCP_DefineBodyStructGetter(cpSpace*, CP_PRIVATE(space), Space)\n\nCP_DefineBodyStructGetter(cpFloat, m, Mass)\n/// Set the mass of a body.\nvoid cpBodySetMass(cpBody *body, cpFloat m);\n\nCP_DefineBodyStructGetter(cpFloat, i, Moment)\n/// Set the moment of a body.\nvoid cpBodySetMoment(cpBody *body, cpFloat i);\n\nCP_DefineBodyStructGetter(cpVect, p, Pos)\n/// Set the position of a body.\nvoid cpBodySetPos(cpBody *body, cpVect pos);\nCP_DefineBodyStructProperty(cpVect, v, Vel)\nCP_DefineBodyStructProperty(cpVect, f, Force)\nCP_DefineBodyStructGetter(cpFloat, a, Angle)\n/// Set the angle of a body.\nvoid cpBodySetAngle(cpBody *body, cpFloat a);\nCP_DefineBodyStructProperty(cpFloat, w, AngVel)\nCP_DefineBodyStructProperty(cpFloat, t, Torque)\nCP_DefineBodyStructGetter(cpVect, rot, Rot)\nCP_DefineBodyStructProperty(cpFloat, v_limit, VelLimit)\nCP_DefineBodyStructProperty(cpFloat, w_limit, AngVelLimit)\nCP_DefineBodyStructProperty(cpDataPointer, data, UserData)\n\n/// Default Integration functions.\nvoid cpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt);\nvoid cpBodyUpdatePosition(cpBody *body, cpFloat dt);\n\n/// Convert body relative/local coordinates to absolute/world coordinates.\nstatic inline cpVect cpBodyLocal2World(const cpBody *body, const cpVect v)\n{\n\treturn cpvadd(body->p, cpvrotate(v, body->rot));\n}\n\n/// Convert body absolute/world coordinates to  relative/local coordinates.\nstatic inline cpVect cpBodyWorld2Local(const cpBody *body, const cpVect v)\n{\n\treturn cpvunrotate(cpvsub(v, body->p), body->rot);\n}\n\n/// Set the forces and torque or a body to zero.\nvoid cpBodyResetForces(cpBody *body);\n/// Apply an force (in world coordinates) to the body at a point relative to the center of gravity (also in world coordinates).\nvoid cpBodyApplyForce(cpBody *body, const cpVect f, const cpVect r);\n/// Apply an impulse (in world coordinates) to the body at a point relative to the center of gravity (also in world coordinates).\nvoid cpBodyApplyImpulse(cpBody *body, const cpVect j, const cpVect r);\n\n/// Get the velocity on a body (in world units) at a point on the body in world coordinates.\ncpVect cpBodyGetVelAtWorldPoint(cpBody *body, cpVect point);\n/// Get the velocity on a body (in world units) at a point on the body in local coordinates.\ncpVect cpBodyGetVelAtLocalPoint(cpBody *body, cpVect point);\n\n\n/// Get the kinetic energy of a body.\nstatic inline cpFloat cpBodyKineticEnergy(const cpBody *body)\n{\n\t// Need to do some fudging to avoid NaNs\n\tcpFloat vsq = cpvdot(body->v, body->v);\n\tcpFloat wsq = body->w*body->w;\n\treturn (vsq ? vsq*body->m : 0.0f) + (wsq ? wsq*body->i : 0.0f);\n}\n\n/// Body/shape iterator callback function type. \ntypedef void (*cpBodyShapeIteratorFunc)(cpBody *body, cpShape *shape, void *data);\n/// Call @c func once for each shape attached to @c body and added to the space.\nvoid cpBodyEachShape(cpBody *body, cpBodyShapeIteratorFunc func, void *data);\n\n/// Body/constraint iterator callback function type. \ntypedef void (*cpBodyConstraintIteratorFunc)(cpBody *body, cpConstraint *constraint, void *data);\n/// Call @c func once for each constraint attached to @c body and added to the space.\nvoid cpBodyEachConstraint(cpBody *body, cpBodyConstraintIteratorFunc func, void *data);\n\n/// Body/arbiter iterator callback function type. \ntypedef void (*cpBodyArbiterIteratorFunc)(cpBody *body, cpArbiter *arbiter, void *data);\n/// Call @c func once for each arbiter that is currently active on the body.\nvoid cpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data);\n\n///@}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpPolyShape.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpPolyShape cpPolyShape\n/// @{\n\n/// @private\ntypedef struct cpSplittingPlane {\n\tcpVect n;\n\tcpFloat d;\n} cpSplittingPlane;\n\n/// @private\ntypedef struct cpPolyShape {\n\tcpShape shape;\n\t\n\tint numVerts;\n\tcpVect *verts, *tVerts;\n\tcpSplittingPlane *planes, *tPlanes;\n} cpPolyShape;\n\n/// Allocate a polygon shape.\ncpPolyShape* cpPolyShapeAlloc(void);\n/// Initialize a polygon shape.\n/// A convex hull will be created from the vertexes.\ncpPolyShape* cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int numVerts, const cpVect *verts, cpVect offset);\n/// Allocate and initialize a polygon shape.\n/// A convex hull will be created from the vertexes.\ncpShape* cpPolyShapeNew(cpBody *body, int numVerts, cpVect *verts, cpVect offset);\n\n/// Initialize a box shaped polygon shape.\ncpPolyShape* cpBoxShapeInit(cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height);\n/// Initialize an offset box shaped polygon shape.\ncpPolyShape* cpBoxShapeInit2(cpPolyShape *poly, cpBody *body, cpBB box);\n/// Allocate and initialize a box shaped polygon shape.\ncpShape* cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height);\n/// Allocate and initialize an offset box shaped polygon shape.\ncpShape* cpBoxShapeNew2(cpBody *body, cpBB box);\n\n/// Check that a set of vertexes is convex and has a clockwise winding.\n/// NOTE: Due to floating point precision issues, hulls created with cpQuickHull() are not guaranteed to validate!\ncpBool cpPolyValidate(const cpVect *verts, const int numVerts);\n\n/// Get the number of verts in a polygon shape.\nint cpPolyShapeGetNumVerts(cpShape *shape);\n/// Get the @c ith vertex of a polygon shape.\ncpVect cpPolyShapeGetVert(cpShape *shape, int idx);\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpShape.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n/// @defgroup cpShape cpShape\n/// The cpShape struct defines the shape of a rigid body.\n/// @{\n\ntypedef struct cpShapeClass cpShapeClass;\n\n/// Nearest point query info struct.\ntypedef struct cpNearestPointQueryInfo {\n\t/// The nearest shape, NULL if no shape was within range.\n\tcpShape *shape;\n\t/// The closest point on the shape's surface. (in world space coordinates)\n\tcpVect p;\n\t/// The distance to the point. The distance is negative if the point is inside the shape.\n\tcpFloat d;\n} cpNearestPointQueryInfo;\n\n/// Segment query info struct.\ntypedef struct cpSegmentQueryInfo {\n\t/// The shape that was hit, NULL if no collision occured.\n\tcpShape *shape;\n\t/// The normalized distance along the query segment in the range [0, 1].\n\tcpFloat t;\n\t/// The normal of the surface hit.\n\tcpVect n;\n} cpSegmentQueryInfo;\n\n/// @private\ntypedef enum cpShapeType{\n\tCP_CIRCLE_SHAPE,\n\tCP_SEGMENT_SHAPE,\n\tCP_POLY_SHAPE,\n\tCP_NUM_SHAPES\n} cpShapeType;\n\ntypedef cpBB (*cpShapeCacheDataImpl)(cpShape *shape, cpVect p, cpVect rot);\ntypedef void (*cpShapeDestroyImpl)(cpShape *shape);\ntypedef void (*cpShapeNearestPointQueryImpl)(cpShape *shape, cpVect p, cpNearestPointQueryInfo *info);\ntypedef void (*cpShapeSegmentQueryImpl)(cpShape *shape, cpVect a, cpVect b, cpSegmentQueryInfo *info);\n\n/// @private\nstruct cpShapeClass {\n\tcpShapeType type;\n\t\n\tcpShapeCacheDataImpl cacheData;\n\tcpShapeDestroyImpl destroy;\n\tcpShapeNearestPointQueryImpl nearestPointQuery;\n\tcpShapeSegmentQueryImpl segmentQuery;\n};\n\n/// Opaque collision shape struct.\nstruct cpShape {\n\tCP_PRIVATE(const cpShapeClass *klass);\n\t\n\t/// The rigid body this collision shape is attached to.\n\tcpBody *body;\n\n\t/// The current bounding box of the shape.\n\tcpBB bb;\n\t\n\t/// Sensor flag.\n\t/// Sensor shapes call collision callbacks but don't produce collisions.\n\tcpBool sensor;\n\t\n\t/// Coefficient of restitution. (elasticity)\n\tcpFloat e;\n\t/// Coefficient of friction.\n\tcpFloat u;\n\t/// Surface velocity used when solving for friction.\n\tcpVect surface_v;\n\n\t/// User definable data pointer.\n\t/// Generally this points to your the game object class so you can access it\n\t/// when given a cpShape reference in a callback.\n\tcpDataPointer data;\n\t\n\t/// Collision type of this shape used when picking collision handlers.\n\tcpCollisionType collision_type;\n\t/// Group of this shape. Shapes in the same group don't collide.\n\tcpGroup group;\n\t// Layer bitmask for this shape. Shapes only collide if the bitwise and of their layers is non-zero.\n\tcpLayers layers;\n\t\n\tCP_PRIVATE(cpSpace *space);\n\t\n\tCP_PRIVATE(cpShape *next);\n\tCP_PRIVATE(cpShape *prev);\n\t\n\tCP_PRIVATE(cpHashValue hashid);\n};\n\n/// Destroy a shape.\nvoid cpShapeDestroy(cpShape *shape);\n/// Destroy and Free a shape.\nvoid cpShapeFree(cpShape *shape);\n\n/// Update, cache and return the bounding box of a shape based on the body it's attached to.\ncpBB cpShapeCacheBB(cpShape *shape);\n/// Update, cache and return the bounding box of a shape with an explicit transformation.\ncpBB cpShapeUpdate(cpShape *shape, cpVect pos, cpVect rot);\n\n/// Test if a point lies within a shape.\ncpBool cpShapePointQuery(cpShape *shape, cpVect p);\n\n/// Perform a nearest point query. It finds the closest point on the surface of shape to a specific point.\n/// The value returned is the distance between the points. A negative distance means the point is inside the shape.\ncpFloat cpShapeNearestPointQuery(cpShape *shape, cpVect p, cpNearestPointQueryInfo *out);\n\n/// Perform a segment query against a shape. @c info must be a pointer to a valid cpSegmentQueryInfo structure.\ncpBool cpShapeSegmentQuery(cpShape *shape, cpVect a, cpVect b, cpSegmentQueryInfo *info);\n\n/// Get the hit point for a segment query.\nstatic inline cpVect cpSegmentQueryHitPoint(const cpVect start, const cpVect end, const cpSegmentQueryInfo info)\n{\n\treturn cpvlerp(start, end, info.t);\n}\n\n/// Get the hit distance for a segment query.\nstatic inline cpFloat cpSegmentQueryHitDist(const cpVect start, const cpVect end, const cpSegmentQueryInfo info)\n{\n\treturn cpvdist(start, end)*info.t;\n}\n\n#define CP_DefineShapeStructGetter(type, member, name) \\\nstatic inline type cpShapeGet##name(const cpShape *shape){return shape->member;}\n\n#define CP_DefineShapeStructSetter(type, member, name, activates) \\\nstatic inline void cpShapeSet##name(cpShape *shape, type value){ \\\n\tif(activates && shape->body) cpBodyActivate(shape->body); \\\n\tshape->member = value; \\\n}\n\n#define CP_DefineShapeStructProperty(type, member, name, activates) \\\nCP_DefineShapeStructGetter(type, member, name) \\\nCP_DefineShapeStructSetter(type, member, name, activates)\n\nCP_DefineShapeStructGetter(cpSpace*, CP_PRIVATE(space), Space)\n\nCP_DefineShapeStructGetter(cpBody*, body, Body)\nvoid cpShapeSetBody(cpShape *shape, cpBody *body);\n\nCP_DefineShapeStructGetter(cpBB, bb, BB)\nCP_DefineShapeStructProperty(cpBool, sensor, Sensor, cpTrue)\nCP_DefineShapeStructProperty(cpFloat, e, Elasticity, cpFalse)\nCP_DefineShapeStructProperty(cpFloat, u, Friction, cpTrue)\nCP_DefineShapeStructProperty(cpVect, surface_v, SurfaceVelocity, cpTrue)\nCP_DefineShapeStructProperty(cpDataPointer, data, UserData, cpFalse)\nCP_DefineShapeStructProperty(cpCollisionType, collision_type, CollisionType, cpTrue)\nCP_DefineShapeStructProperty(cpGroup, group, Group, cpTrue)\nCP_DefineShapeStructProperty(cpLayers, layers, Layers, cpTrue)\n\n/// When initializing a shape, it's hash value comes from a counter.\n/// Because the hash value may affect iteration order, you can reset the shape ID counter\n/// when recreating a space. This will make the simulation be deterministic.\nvoid cpResetShapeIdCounter(void);\n\n#define CP_DeclareShapeGetter(struct, type, name) type struct##Get##name(const cpShape *shape)\n\n/// @}\n/// @defgroup cpCircleShape cpCircleShape\n\n/// @private\ntypedef struct cpCircleShape {\n\tcpShape shape;\n\t\n\tcpVect c, tc;\n\tcpFloat r;\n} cpCircleShape;\n\n/// Allocate a circle shape.\ncpCircleShape* cpCircleShapeAlloc(void);\n/// Initialize a circle shape.\ncpCircleShape* cpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset);\n/// Allocate and initialize a circle shape.\ncpShape* cpCircleShapeNew(cpBody *body, cpFloat radius, cpVect offset);\n\nCP_DeclareShapeGetter(cpCircleShape, cpVect, Offset);\nCP_DeclareShapeGetter(cpCircleShape, cpFloat, Radius);\n\n/// @}\n/// @defgroup cpSegmentShape cpSegmentShape\n\n/// @private\ntypedef struct cpSegmentShape {\n\tcpShape shape;\n\t\n\tcpVect a, b, n;\n\tcpVect ta, tb, tn;\n\tcpFloat r;\n\t\n\tcpVect a_tangent, b_tangent;\n} cpSegmentShape;\n\n/// Allocate a segment shape.\ncpSegmentShape* cpSegmentShapeAlloc(void);\n/// Initialize a segment shape.\ncpSegmentShape* cpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat radius);\n/// Allocate and initialize a segment shape.\ncpShape* cpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat radius);\n\nvoid cpSegmentShapeSetNeighbors(cpShape *shape, cpVect prev, cpVect next);\n\nCP_DeclareShapeGetter(cpSegmentShape, cpVect, A);\nCP_DeclareShapeGetter(cpSegmentShape, cpVect, B);\nCP_DeclareShapeGetter(cpSegmentShape, cpVect, Normal);\nCP_DeclareShapeGetter(cpSegmentShape, cpFloat, Radius);\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpSpace.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpSpace cpSpace\n/// @{\n\ntypedef struct cpContactBufferHeader cpContactBufferHeader;\ntypedef void (*cpSpaceArbiterApplyImpulseFunc)(cpArbiter *arb);\n\n/// Basic Unit of Simulation in Chipmunk\nstruct cpSpace {\n\t/// Number of iterations to use in the impulse solver to solve contacts.\n\tint iterations;\n\t\n\t/// Gravity to pass to rigid bodies when integrating velocity.\n\tcpVect gravity;\n\t\n\t/// Damping rate expressed as the fraction of velocity bodies retain each second.\n\t/// A value of 0.9 would mean that each body's velocity will drop 10% per second.\n\t/// The default value is 1.0, meaning no damping is applied.\n\t/// @note This damping value is different than those of cpDampedSpring and cpDampedRotarySpring.\n\tcpFloat damping;\n\t\n\t/// Speed threshold for a body to be considered idle.\n\t/// The default value of 0 means to let the space guess a good threshold based on gravity.\n\tcpFloat idleSpeedThreshold;\n\t\n\t/// Time a group of bodies must remain idle in order to fall asleep.\n\t/// Enabling sleeping also implicitly enables the the contact graph.\n\t/// The default value of INFINITY disables the sleeping algorithm.\n\tcpFloat sleepTimeThreshold;\n\t\n\t/// Amount of encouraged penetration between colliding shapes.\n\t/// Used to reduce oscillating contacts and keep the collision cache warm.\n\t/// Defaults to 0.1. If you have poor simulation quality,\n\t/// increase this number as much as possible without allowing visible amounts of overlap.\n\tcpFloat collisionSlop;\n\t\n\t/// Determines how fast overlapping shapes are pushed apart.\n\t/// Expressed as a fraction of the error remaining after each second.\n\t/// Defaults to pow(1.0 - 0.1, 60.0) meaning that Chipmunk fixes 10% of overlap each frame at 60Hz.\n\tcpFloat collisionBias;\n\t\n\t/// Number of frames that contact information should persist.\n\t/// Defaults to 3. There is probably never a reason to change this value.\n\tcpTimestamp collisionPersistence;\n\t\n\t/// Rebuild the contact graph during each step. Must be enabled to use the cpBodyEachArbiter() function.\n\t/// Disabled by default for a small performance boost. Enabled implicitly when the sleeping feature is enabled.\n\tcpBool enableContactGraph;\n\t\n\t/// User definable data pointer.\n\t/// Generally this points to your game's controller or game state\n\t/// class so you can access it when given a cpSpace reference in a callback.\n\tcpDataPointer data;\n\t\n\t/// The designated static body for this space.\n\t/// You can modify this body, or replace it with your own static body.\n\t/// By default it points to a statically allocated cpBody in the cpSpace struct.\n\tcpBody *staticBody;\n\t\n\tCP_PRIVATE(cpTimestamp stamp);\n\tCP_PRIVATE(cpFloat curr_dt);\n\n\tCP_PRIVATE(cpArray *bodies);\n\tCP_PRIVATE(cpArray *rousedBodies);\n\tCP_PRIVATE(cpArray *sleepingComponents);\n\t\n\tCP_PRIVATE(cpSpatialIndex *staticShapes);\n\tCP_PRIVATE(cpSpatialIndex *activeShapes);\n\t\n\tCP_PRIVATE(cpArray *arbiters);\n\tCP_PRIVATE(cpContactBufferHeader *contactBuffersHead);\n\tCP_PRIVATE(cpHashSet *cachedArbiters);\n\tCP_PRIVATE(cpArray *pooledArbiters);\n\tCP_PRIVATE(cpArray *constraints);\n\t\n\tCP_PRIVATE(cpArray *allocatedBuffers);\n\tCP_PRIVATE(int locked);\n\t\n\tCP_PRIVATE(cpHashSet *collisionHandlers);\n\tCP_PRIVATE(cpCollisionHandler defaultHandler);\n\t\n\tCP_PRIVATE(cpBool skipPostStep);\n\tCP_PRIVATE(cpArray *postStepCallbacks);\n\t\n\tCP_PRIVATE(cpBody _staticBody);\n};\n\n/// Allocate a cpSpace.\ncpSpace* cpSpaceAlloc(void);\n/// Initialize a cpSpace.\ncpSpace* cpSpaceInit(cpSpace *space);\n/// Allocate and initialize a cpSpace.\ncpSpace* cpSpaceNew(void);\n\n/// Destroy a cpSpace.\nvoid cpSpaceDestroy(cpSpace *space);\n/// Destroy and free a cpSpace.\nvoid cpSpaceFree(cpSpace *space);\n\n#define CP_DefineSpaceStructGetter(type, member, name) \\\nstatic inline type cpSpaceGet##name(const cpSpace *space){return space->member;}\n\n#define CP_DefineSpaceStructSetter(type, member, name) \\\nstatic inline void cpSpaceSet##name(cpSpace *space, type value){space->member = value;}\n\n#define CP_DefineSpaceStructProperty(type, member, name) \\\nCP_DefineSpaceStructGetter(type, member, name) \\\nCP_DefineSpaceStructSetter(type, member, name)\n\nCP_DefineSpaceStructProperty(int, iterations, Iterations)\nCP_DefineSpaceStructProperty(cpVect, gravity, Gravity)\nCP_DefineSpaceStructProperty(cpFloat, damping, Damping)\nCP_DefineSpaceStructProperty(cpFloat, idleSpeedThreshold, IdleSpeedThreshold)\nCP_DefineSpaceStructProperty(cpFloat, sleepTimeThreshold, SleepTimeThreshold)\nCP_DefineSpaceStructProperty(cpFloat, collisionSlop, CollisionSlop)\nCP_DefineSpaceStructProperty(cpFloat, collisionBias, CollisionBias)\nCP_DefineSpaceStructProperty(cpTimestamp, collisionPersistence, CollisionPersistence)\nCP_DefineSpaceStructProperty(cpBool, enableContactGraph, EnableContactGraph)\nCP_DefineSpaceStructProperty(cpDataPointer, data, UserData)\nCP_DefineSpaceStructGetter(cpBody*, staticBody, StaticBody)\nCP_DefineSpaceStructGetter(cpFloat, CP_PRIVATE(curr_dt), CurrentTimeStep)\n\n/// returns true from inside a callback and objects cannot be added/removed.\nstatic inline cpBool\ncpSpaceIsLocked(cpSpace *space)\n{\n\treturn space->CP_PRIVATE(locked);\n}\n\n/// Set a default collision handler for this space.\n/// The default collision handler is invoked for each colliding pair of shapes\n/// that isn't explicitly handled by a specific collision handler.\n/// You can pass NULL for any function you don't want to implement.\nvoid cpSpaceSetDefaultCollisionHandler(\n\tcpSpace *space,\n\tcpCollisionBeginFunc begin,\n\tcpCollisionPreSolveFunc preSolve,\n\tcpCollisionPostSolveFunc postSolve,\n\tcpCollisionSeparateFunc separate,\n\tvoid *data\n);\n\n/// Set a collision handler to be used whenever the two shapes with the given collision types collide.\n/// You can pass NULL for any function you don't want to implement.\nvoid cpSpaceAddCollisionHandler(\n\tcpSpace *space,\n\tcpCollisionType a, cpCollisionType b,\n\tcpCollisionBeginFunc begin,\n\tcpCollisionPreSolveFunc preSolve,\n\tcpCollisionPostSolveFunc postSolve,\n\tcpCollisionSeparateFunc separate,\n\tvoid *data\n);\n\n/// Unset a collision handler.\nvoid cpSpaceRemoveCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b);\n\n/// Add a collision shape to the simulation.\n/// If the shape is attached to a static body, it will be added as a static shape.\ncpShape* cpSpaceAddShape(cpSpace *space, cpShape *shape);\n/// Explicity add a shape as a static shape to the simulation.\ncpShape* cpSpaceAddStaticShape(cpSpace *space, cpShape *shape);\n/// Add a rigid body to the simulation.\ncpBody* cpSpaceAddBody(cpSpace *space, cpBody *body);\n/// Add a constraint to the simulation.\ncpConstraint* cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint);\n\n/// Remove a collision shape from the simulation.\nvoid cpSpaceRemoveShape(cpSpace *space, cpShape *shape);\n/// Remove a collision shape added using cpSpaceAddStaticShape() from the simulation.\nvoid cpSpaceRemoveStaticShape(cpSpace *space, cpShape *shape);\n/// Remove a rigid body from the simulation.\nvoid cpSpaceRemoveBody(cpSpace *space, cpBody *body);\n/// Remove a constraint from the simulation.\nvoid cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint);\n\n/// Test if a collision shape has been added to the space.\ncpBool cpSpaceContainsShape(cpSpace *space, cpShape *shape);\n/// Test if a rigid body has been added to the space.\ncpBool cpSpaceContainsBody(cpSpace *space, cpBody *body);\n/// Test if a constraint has been added to the space.\ncpBool cpSpaceContainsConstraint(cpSpace *space, cpConstraint *constraint);\n\n/// Convert a dynamic rogue body to a static one.\n/// If the body is active, you must remove it from the space first.\nvoid cpSpaceConvertBodyToStatic(cpSpace *space, cpBody *body);\n/// Convert a body to a dynamic rogue body.\n/// If you want the body to be active after the transition, you must add it to the space also.\nvoid cpSpaceConvertBodyToDynamic(cpSpace *space, cpBody *body, cpFloat mass, cpFloat moment);\n\n/// Post Step callback function type.\ntypedef void (*cpPostStepFunc)(cpSpace *space, void *key, void *data);\n/// Schedule a post-step callback to be called when cpSpaceStep() finishes.\n/// You can only register one callback per unique value for @c key.\n/// Returns true only if @c key has never been scheduled before.\n/// It's possible to pass @c NULL for @c func if you only want to mark @c key as being used.\ncpBool cpSpaceAddPostStepCallback(cpSpace *space, cpPostStepFunc func, void *key, void *data);\n\n/// Point query callback function type.\ntypedef void (*cpSpacePointQueryFunc)(cpShape *shape, void *data);\n/// Query the space at a point and call @c func for each shape found.\nvoid cpSpacePointQuery(cpSpace *space, cpVect point, cpLayers layers, cpGroup group, cpSpacePointQueryFunc func, void *data);\n/// Query the space at a point and return the first shape found. Returns NULL if no shapes were found.\ncpShape *cpSpacePointQueryFirst(cpSpace *space, cpVect point, cpLayers layers, cpGroup group);\n\n/// Nearest point query callback function type.\ntypedef void (*cpSpaceNearestPointQueryFunc)(cpShape *shape, cpFloat distance, cpVect point, void *data);\n/// Query the space at a point and call @c func for each shape found.\nvoid cpSpaceNearestPointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpLayers layers, cpGroup group, cpSpaceNearestPointQueryFunc func, void *data);\n/// Query the space at a point and return the nearest shape found. Returns NULL if no shapes were found.\ncpShape *cpSpaceNearestPointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpLayers layers, cpGroup group, cpNearestPointQueryInfo *out);\n\n/// Segment query callback function type.\ntypedef void (*cpSpaceSegmentQueryFunc)(cpShape *shape, cpFloat t, cpVect n, void *data);\n/// Perform a directed line segment query (like a raycast) against the space calling @c func for each shape intersected.\nvoid cpSpaceSegmentQuery(cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSpaceSegmentQueryFunc func, void *data);\n/// Perform a directed line segment query (like a raycast) against the space and return the first shape hit. Returns NULL if no shapes were hit.\ncpShape *cpSpaceSegmentQueryFirst(cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSegmentQueryInfo *out);\n\n/// Rectangle Query callback function type.\ntypedef void (*cpSpaceBBQueryFunc)(cpShape *shape, void *data);\n/// Perform a fast rectangle query on the space calling @c func for each shape found.\n/// Only the shape's bounding boxes are checked for overlap, not their full shape.\nvoid cpSpaceBBQuery(cpSpace *space, cpBB bb, cpLayers layers, cpGroup group, cpSpaceBBQueryFunc func, void *data);\n\n/// Shape query callback function type.\ntypedef void (*cpSpaceShapeQueryFunc)(cpShape *shape, cpContactPointSet *points, void *data);\n/// Query a space for any shapes overlapping the given shape and call @c func for each shape found.\ncpBool cpSpaceShapeQuery(cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data);\n\n/// Call cpBodyActivate() for any shape that is overlaps the given shape.\nvoid cpSpaceActivateShapesTouchingShape(cpSpace *space, cpShape *shape);\n\n\n/// Space/body iterator callback function type.\ntypedef void (*cpSpaceBodyIteratorFunc)(cpBody *body, void *data);\n/// Call @c func for each body in the space.\nvoid cpSpaceEachBody(cpSpace *space, cpSpaceBodyIteratorFunc func, void *data);\n\n/// Space/body iterator callback function type.\ntypedef void (*cpSpaceShapeIteratorFunc)(cpShape *shape, void *data);\n/// Call @c func for each shape in the space.\nvoid cpSpaceEachShape(cpSpace *space, cpSpaceShapeIteratorFunc func, void *data);\n\n/// Space/constraint iterator callback function type.\ntypedef void (*cpSpaceConstraintIteratorFunc)(cpConstraint *constraint, void *data);\n/// Call @c func for each shape in the space.\nvoid cpSpaceEachConstraint(cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data);\n\n/// Update the collision detection info for the static shapes in the space.\nvoid cpSpaceReindexStatic(cpSpace *space);\n/// Update the collision detection data for a specific shape in the space.\nvoid cpSpaceReindexShape(cpSpace *space, cpShape *shape);\n/// Update the collision detection data for all shapes attached to a body.\nvoid cpSpaceReindexShapesForBody(cpSpace *space, cpBody *body);\n\n/// Switch the space to use a spatial has as it's spatial index.\nvoid cpSpaceUseSpatialHash(cpSpace *space, cpFloat dim, int count);\n\n/// Step the space forward in time by @c dt.\nvoid cpSpaceStep(cpSpace *space, cpFloat dt);\n\n/// @}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpSpatialIndex.h",
    "content": "/* Copyright (c) 2010 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n\t@defgroup cpSpatialIndex cpSpatialIndex\n\t\n\tSpatial indexes are data structures that are used to accelerate collision detection\n\tand spatial queries. Chipmunk provides a number of spatial index algorithms to pick from\n\tand they are programmed in a generic way so that you can use them for holding more than\n\tjust cpShape structs.\n\t\n\tIt works by using @c void pointers to the objects you add and using a callback to ask your code\n\tfor bounding boxes when it needs them. Several types of queries can be performed an index as well\n\tas reindexing and full collision information. All communication to the spatial indexes is performed\n\tthrough callback functions.\n\t\n\tSpatial indexes should be treated as opaque structs.\n\tThis meanns you shouldn't be reading any of the struct fields.\n\t@{\n*/\n\n//MARK: Spatial Index\n\n/// Spatial index bounding box callback function type.\n/// The spatial index calls this function and passes you a pointer to an object you added\n/// when it needs to get the bounding box associated with that object.\ntypedef cpBB (*cpSpatialIndexBBFunc)(void *obj);\n/// Spatial index/object iterator callback function type.\ntypedef void (*cpSpatialIndexIteratorFunc)(void *obj, void *data);\n/// Spatial query callback function type.\ntypedef void (*cpSpatialIndexQueryFunc)(void *obj1, void *obj2, void *data);\n/// Spatial segment query callback function type.\ntypedef cpFloat (*cpSpatialIndexSegmentQueryFunc)(void *obj1, void *obj2, void *data);\n\n\ntypedef struct cpSpatialIndexClass cpSpatialIndexClass;\ntypedef struct cpSpatialIndex cpSpatialIndex;\n\n/// @private\nstruct cpSpatialIndex {\n\tcpSpatialIndexClass *klass;\n\t\n\tcpSpatialIndexBBFunc bbfunc;\n\t\n\tcpSpatialIndex *staticIndex, *dynamicIndex;\n};\n\n\n//MARK: Spatial Hash\n\ntypedef struct cpSpaceHash cpSpaceHash;\n\n/// Allocate a spatial hash.\ncpSpaceHash* cpSpaceHashAlloc(void);\n/// Initialize a spatial hash. \ncpSpatialIndex* cpSpaceHashInit(cpSpaceHash *hash, cpFloat celldim, int numcells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex);\n/// Allocate and initialize a spatial hash.\ncpSpatialIndex* cpSpaceHashNew(cpFloat celldim, int cells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex);\n\n/// Change the cell dimensions and table size of the spatial hash to tune it.\n/// The cell dimensions should roughly match the average size of your objects\n/// and the table size should be ~10 larger than the number of objects inserted.\n/// Some trial and error is required to find the optimum numbers for efficiency.\nvoid cpSpaceHashResize(cpSpaceHash *hash, cpFloat celldim, int numcells);\n\n//MARK: AABB Tree\n\ntypedef struct cpBBTree cpBBTree;\n\n/// Allocate a bounding box tree.\ncpBBTree* cpBBTreeAlloc(void);\n/// Initialize a bounding box tree.\ncpSpatialIndex* cpBBTreeInit(cpBBTree *tree, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex);\n/// Allocate and initialize a bounding box tree.\ncpSpatialIndex* cpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex);\n\n/// Perform a static top down optimization of the tree.\nvoid cpBBTreeOptimize(cpSpatialIndex *index);\n\n/// Bounding box tree velocity callback function.\n/// This function should return an estimate for the object's velocity.\ntypedef cpVect (*cpBBTreeVelocityFunc)(void *obj);\n/// Set the velocity function for the bounding box tree to enable temporal coherence.\nvoid cpBBTreeSetVelocityFunc(cpSpatialIndex *index, cpBBTreeVelocityFunc func);\n\n//MARK: Single Axis Sweep\n\ntypedef struct cpSweep1D cpSweep1D;\n\n/// Allocate a 1D sort and sweep broadphase.\ncpSweep1D* cpSweep1DAlloc(void);\n/// Initialize a 1D sort and sweep broadphase.\ncpSpatialIndex* cpSweep1DInit(cpSweep1D *sweep, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex);\n/// Allocate and initialize a 1D sort and sweep broadphase.\ncpSpatialIndex* cpSweep1DNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex);\n\n//MARK: Spatial Index Implementation\n\ntypedef void (*cpSpatialIndexDestroyImpl)(cpSpatialIndex *index);\n\ntypedef int (*cpSpatialIndexCountImpl)(cpSpatialIndex *index);\ntypedef void (*cpSpatialIndexEachImpl)(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data);\n\ntypedef cpBool (*cpSpatialIndexContainsImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid);\ntypedef void (*cpSpatialIndexInsertImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid);\ntypedef void (*cpSpatialIndexRemoveImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid);\n\ntypedef void (*cpSpatialIndexReindexImpl)(cpSpatialIndex *index);\ntypedef void (*cpSpatialIndexReindexObjectImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid);\ntypedef void (*cpSpatialIndexReindexQueryImpl)(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data);\n\ntypedef void (*cpSpatialIndexQueryImpl)(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data);\ntypedef void (*cpSpatialIndexSegmentQueryImpl)(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data);\n\nstruct cpSpatialIndexClass {\n\tcpSpatialIndexDestroyImpl destroy;\n\t\n\tcpSpatialIndexCountImpl count;\n\tcpSpatialIndexEachImpl each;\n\t\n\tcpSpatialIndexContainsImpl contains;\n\tcpSpatialIndexInsertImpl insert;\n\tcpSpatialIndexRemoveImpl remove;\n\t\n\tcpSpatialIndexReindexImpl reindex;\n\tcpSpatialIndexReindexObjectImpl reindexObject;\n\tcpSpatialIndexReindexQueryImpl reindexQuery;\n\t\n\tcpSpatialIndexQueryImpl query;\n\tcpSpatialIndexSegmentQueryImpl segmentQuery;\n};\n\n/// Destroy and free a spatial index.\nvoid cpSpatialIndexFree(cpSpatialIndex *index);\n/// Collide the objects in @c dynamicIndex against the objects in @c staticIndex using the query callback function.\nvoid cpSpatialIndexCollideStatic(cpSpatialIndex *dynamicIndex, cpSpatialIndex *staticIndex, cpSpatialIndexQueryFunc func, void *data);\n\n/// Destroy a spatial index.\nstatic inline void cpSpatialIndexDestroy(cpSpatialIndex *index)\n{\n\tif(index->klass) index->klass->destroy(index);\n}\n\n/// Get the number of objects in the spatial index.\nstatic inline int cpSpatialIndexCount(cpSpatialIndex *index)\n{\n\treturn index->klass->count(index);\n}\n\n/// Iterate the objects in the spatial index. @c func will be called once for each object.\nstatic inline void cpSpatialIndexEach(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data)\n{\n\tindex->klass->each(index, func, data);\n}\n\n/// Returns true if the spatial index contains the given object.\n/// Most spatial indexes use hashed storage, so you must provide a hash value too.\nstatic inline cpBool cpSpatialIndexContains(cpSpatialIndex *index, void *obj, cpHashValue hashid)\n{\n\treturn index->klass->contains(index, obj, hashid);\n}\n\n/// Add an object to a spatial index.\n/// Most spatial indexes use hashed storage, so you must provide a hash value too.\nstatic inline void cpSpatialIndexInsert(cpSpatialIndex *index, void *obj, cpHashValue hashid)\n{\n\tindex->klass->insert(index, obj, hashid);\n}\n\n/// Remove an object from a spatial index.\n/// Most spatial indexes use hashed storage, so you must provide a hash value too.\nstatic inline void cpSpatialIndexRemove(cpSpatialIndex *index, void *obj, cpHashValue hashid)\n{\n\tindex->klass->remove(index, obj, hashid);\n}\n\n/// Perform a full reindex of a spatial index.\nstatic inline void cpSpatialIndexReindex(cpSpatialIndex *index)\n{\n\tindex->klass->reindex(index);\n}\n\n/// Reindex a single object in the spatial index.\nstatic inline void cpSpatialIndexReindexObject(cpSpatialIndex *index, void *obj, cpHashValue hashid)\n{\n\tindex->klass->reindexObject(index, obj, hashid);\n}\n\n/// Perform a rectangle query against the spatial index, calling @c func for each potential match.\nstatic inline void cpSpatialIndexQuery(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data)\n{\n\tindex->klass->query(index, obj, bb, func, data);\n}\n\n/// Perform a segment query against the spatial index, calling @c func for each potential match.\nstatic inline void cpSpatialIndexSegmentQuery(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data)\n{\n\tindex->klass->segmentQuery(index, obj, a, b, t_exit, func, data);\n}\n\n/// Simultaneously reindex and find all colliding objects.\n/// @c func will be called once for each potentially overlapping pair of objects found.\n/// If the spatial index was initialized with a static index, it will collide it's objects against that as well.\nstatic inline void cpSpatialIndexReindexQuery(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data)\n{\n\tindex->klass->reindexQuery(index, func, data);\n}\n\n///@}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/include/chipmunk/cpVect.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/// @defgroup cpVect cpVect\n/// Chipmunk's 2D vector type along with a handy 2D vector math lib.\n/// @{\n\n/// Constant for the zero vector.\nstatic const cpVect cpvzero = {0.0f,0.0f};\n\n/// Convenience constructor for cpVect structs.\nstatic inline cpVect cpv(const cpFloat x, const cpFloat y)\n{\n\tcpVect v = {x, y};\n\treturn v;\n}\n\n/// Spherical linearly interpolate between v1 and v2.\ncpVect cpvslerp(const cpVect v1, const cpVect v2, const cpFloat t);\n\n/// Spherical linearly interpolate between v1 towards v2 by no more than angle a radians\ncpVect cpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a);\n\n///\tReturns a string representation of v. Intended mostly for debugging purposes and not production use.\n///\t@attention The string points to a static local and is reset every time the function is called.\n///\tIf you want to print more than one vector you will have to split up your printing onto separate lines.\nchar* cpvstr(const cpVect v);\n\n/// Check if two vectors are equal. (Be careful when comparing floating point numbers!)\nstatic inline cpBool cpveql(const cpVect v1, const cpVect v2)\n{\n\treturn (v1.x == v2.x && v1.y == v2.y);\n}\n\n/// Add two vectors\nstatic inline cpVect cpvadd(const cpVect v1, const cpVect v2)\n{\n\treturn cpv(v1.x + v2.x, v1.y + v2.y);\n}\n\n/// Subtract two vectors.\nstatic inline cpVect cpvsub(const cpVect v1, const cpVect v2)\n{\n\treturn cpv(v1.x - v2.x, v1.y - v2.y);\n}\n\n/// Negate a vector.\nstatic inline cpVect cpvneg(const cpVect v)\n{\n\treturn cpv(-v.x, -v.y);\n}\n\n/// Scalar multiplication.\nstatic inline cpVect cpvmult(const cpVect v, const cpFloat s)\n{\n\treturn cpv(v.x*s, v.y*s);\n}\n\n/// Vector dot product.\nstatic inline cpFloat cpvdot(const cpVect v1, const cpVect v2)\n{\n\treturn v1.x*v2.x + v1.y*v2.y;\n}\n\n/// 2D vector cross product analog.\n/// The cross product of 2D vectors results in a 3D vector with only a z component.\n/// This function returns the magnitude of the z value.\nstatic inline cpFloat cpvcross(const cpVect v1, const cpVect v2)\n{\n\treturn v1.x*v2.y - v1.y*v2.x;\n}\n\n/// Returns a perpendicular vector. (90 degree rotation)\nstatic inline cpVect cpvperp(const cpVect v)\n{\n\treturn cpv(-v.y, v.x);\n}\n\n/// Returns a perpendicular vector. (-90 degree rotation)\nstatic inline cpVect cpvrperp(const cpVect v)\n{\n\treturn cpv(v.y, -v.x);\n}\n\n/// Returns the vector projection of v1 onto v2.\nstatic inline cpVect cpvproject(const cpVect v1, const cpVect v2)\n{\n\treturn cpvmult(v2, cpvdot(v1, v2)/cpvdot(v2, v2));\n}\n\n/// Returns the unit length vector for the given angle (in radians).\nstatic inline cpVect cpvforangle(const cpFloat a)\n{\n\treturn cpv(cpfcos(a), cpfsin(a));\n}\n\n/// Returns the angular direction v is pointing in (in radians).\nstatic inline cpFloat cpvtoangle(const cpVect v)\n{\n\treturn cpfatan2(v.y, v.x);\n}\n\n/// Uses complex number multiplication to rotate v1 by v2. Scaling will occur if v1 is not a unit vector.\nstatic inline cpVect cpvrotate(const cpVect v1, const cpVect v2)\n{\n\treturn cpv(v1.x*v2.x - v1.y*v2.y, v1.x*v2.y + v1.y*v2.x);\n}\n\n/// Inverse of cpvrotate().\nstatic inline cpVect cpvunrotate(const cpVect v1, const cpVect v2)\n{\n\treturn cpv(v1.x*v2.x + v1.y*v2.y, v1.y*v2.x - v1.x*v2.y);\n}\n\n/// Returns the squared length of v. Faster than cpvlength() when you only need to compare lengths.\nstatic inline cpFloat cpvlengthsq(const cpVect v)\n{\n\treturn cpvdot(v, v);\n}\n\n/// Returns the length of v.\nstatic inline cpFloat cpvlength(const cpVect v)\n{\n\treturn cpfsqrt(cpvdot(v, v));\n}\n\n/// Linearly interpolate between v1 and v2.\nstatic inline cpVect cpvlerp(const cpVect v1, const cpVect v2, const cpFloat t)\n{\n\treturn cpvadd(cpvmult(v1, 1.0f - t), cpvmult(v2, t));\n}\n\n/// Returns a normalized copy of v.\nstatic inline cpVect cpvnormalize(const cpVect v)\n{\n\treturn cpvmult(v, 1.0f/cpvlength(v));\n}\n\n/// Returns a normalized copy of v or cpvzero if v was already cpvzero. Protects against divide by zero errors.\nstatic inline cpVect cpvnormalize_safe(const cpVect v)\n{\n\treturn (v.x == 0.0f && v.y == 0.0f ? cpvzero : cpvnormalize(v));\n}\n\n/// Clamp v to length len.\nstatic inline cpVect cpvclamp(const cpVect v, const cpFloat len)\n{\n\treturn (cpvdot(v,v) > len*len) ? cpvmult(cpvnormalize(v), len) : v;\n}\n\n/// Linearly interpolate between v1 towards v2 by distance d.\nstatic inline cpVect cpvlerpconst(cpVect v1, cpVect v2, cpFloat d)\n{\n\treturn cpvadd(v1, cpvclamp(cpvsub(v2, v1), d));\n}\n\n/// Returns the distance between v1 and v2.\nstatic inline cpFloat cpvdist(const cpVect v1, const cpVect v2)\n{\n\treturn cpvlength(cpvsub(v1, v2));\n}\n\n/// Returns the squared distance between v1 and v2. Faster than cpvdist() when you only need to compare distances.\nstatic inline cpFloat cpvdistsq(const cpVect v1, const cpVect v2)\n{\n\treturn cpvlengthsq(cpvsub(v1, v2));\n}\n\n/// Returns true if the distance between v1 and v2 is less than dist.\nstatic inline cpBool cpvnear(const cpVect v1, const cpVect v2, const cpFloat dist)\n{\n\treturn cpvdistsq(v1, v2) < dist*dist;\n}\n\n/// @}\n\n/// @defgroup cpMat2x2 cpMat2x2\n/// 2x2 matrix type used for tensors and such.\n/// @{\n\nstatic inline cpMat2x2\ncpMat2x2New(cpFloat a, cpFloat b, cpFloat c, cpFloat d)\n{\n\tcpMat2x2 m = {a, b, c, d};\n\treturn m;\n}\n\nstatic inline cpVect\ncpMat2x2Transform(cpMat2x2 m, cpVect v)\n{\n\treturn cpv(v.x*m.a + v.y*m.b, v.x*m.c + v.y*m.d);\n}\n\n///@}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/proj.win32/chipmunk.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectName>libchipmunk</ProjectName>\n    <ProjectGuid>{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>StaticLibrary</ConfigurationType>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup>\n    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(Configuration).win32\\</IntDir>\n    <OutDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(Configuration).win32\\</IntDir>\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" />\n    <CodeAnalysisRuleSet Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">AllRules.ruleset</CodeAnalysisRuleSet>\n    <CodeAnalysisRules Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n    <CodeAnalysisRuleAssemblies Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" />\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <Optimization>Disabled</Optimization>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;..\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <MinimalRebuild>false</MinimalRebuild>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <CompileAs>CompileAsCpp</CompileAs>\n      <DisableSpecificWarnings>4068;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;..\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\n      <CompileAs>CompileAsCpp</CompileAs>\n      <DisableSpecificWarnings>4068;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Lib>\n      <OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>\n    </Lib>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_ffi.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_private.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_types.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_unsafe.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpArbiter.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpBB.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpBody.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpPolyShape.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpShape.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpSpace.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpSpatialIndex.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\cpVect.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpConstraint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpDampedRotarySpring.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpDampedSpring.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpGearJoint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpGrooveJoint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpPinJoint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpPivotJoint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpRatchetJoint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpRotaryLimitJoint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpSimpleMotor.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpSlideJoint.h\" />\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\util.h\" />\n    <ClInclude Include=\"..\\src\\prime.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\src\\chipmunk.c\" />\n    <ClCompile Include=\"..\\src\\cpArbiter.c\" />\n    <ClCompile Include=\"..\\src\\cpArray.c\" />\n    <ClCompile Include=\"..\\src\\cpBB.c\" />\n    <ClCompile Include=\"..\\src\\cpBBTree.c\" />\n    <ClCompile Include=\"..\\src\\cpBody.c\" />\n    <ClCompile Include=\"..\\src\\cpCollision.c\" />\n    <ClCompile Include=\"..\\src\\cpHashSet.c\" />\n    <ClCompile Include=\"..\\src\\cpPolyShape.c\" />\n    <ClCompile Include=\"..\\src\\cpShape.c\" />\n    <ClCompile Include=\"..\\src\\cpSpace.c\" />\n    <ClCompile Include=\"..\\src\\cpSpaceComponent.c\" />\n    <ClCompile Include=\"..\\src\\cpSpaceHash.c\" />\n    <ClCompile Include=\"..\\src\\cpSpaceQuery.c\" />\n    <ClCompile Include=\"..\\src\\cpSpaceStep.c\" />\n    <ClCompile Include=\"..\\src\\cpSpatialIndex.c\" />\n    <ClCompile Include=\"..\\src\\cpSweep1D.c\" />\n    <ClCompile Include=\"..\\src\\cpVect.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpConstraint.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpDampedRotarySpring.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpDampedSpring.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpGearJoint.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpGrooveJoint.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpPinJoint.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpPivotJoint.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpRatchetJoint.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpRotaryLimitJoint.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpSimpleMotor.c\" />\n    <ClCompile Include=\"..\\src\\constraints\\cpSlideJoint.c\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/external/chipmunk/proj.win32/chipmunk.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"include\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"include\\constraints\">\n      <UniqueIdentifier>{4dabab00-1a6f-41ee-be09-a30737358f86}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"src\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"src\\constraints\">\n      <UniqueIdentifier>{e573d383-f016-40f6-999a-d804311ffc62}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_ffi.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_private.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_types.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\chipmunk_unsafe.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpArbiter.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpBB.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpBody.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpPolyShape.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpShape.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpSpace.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpSpatialIndex.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\cpVect.h\">\n      <Filter>include</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpConstraint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpDampedRotarySpring.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpDampedSpring.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpGearJoint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpGrooveJoint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpPinJoint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpPivotJoint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpRatchetJoint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpRotaryLimitJoint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpSimpleMotor.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\cpSlideJoint.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\include\\chipmunk\\constraints\\util.h\">\n      <Filter>include\\constraints</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\src\\prime.h\">\n      <Filter>src</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\src\\chipmunk.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpArbiter.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpArray.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpBB.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpBBTree.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpBody.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpCollision.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpHashSet.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpPolyShape.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpShape.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpSpace.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpSpaceComponent.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpSpaceHash.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpSpaceQuery.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpSpaceStep.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpSpatialIndex.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpSweep1D.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\cpVect.c\">\n      <Filter>src</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpConstraint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpDampedRotarySpring.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpDampedSpring.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpGearJoint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpGrooveJoint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpPinJoint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpPivotJoint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpRatchetJoint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpRotaryLimitJoint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpSimpleMotor.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\src\\constraints\\cpSlideJoint.c\">\n      <Filter>src\\constraints</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/external/chipmunk/src/CMakeLists.txt",
    "content": "set(BUILD_STATIC 1)\n\nfile(GLOB chipmunk_source_files \"*.c\" \"constraints/*.c\")\nfile(GLOB chipmunk_public_header \"${chipmunk_SOURCE_DIR}/include/chipmunk/*.h\")\nfile(GLOB chipmunk_constraint_header \"${chipmunk_SOURCE_DIR}/include/chipmunk/constraints/*.h\")\n\ninclude_directories(${chipmunk_SOURCE_DIR}/include/chipmunk)\n\nif(BUILD_SHARED)\n  add_library(chipmunk SHARED\n    ${chipmunk_source_files}\n  )\n  # Tell MSVC to compile the code as C++.\n  if(MSVC)\n    set_source_files_properties(${chipmunk_source_files} PROPERTIES LANGUAGE CXX)\n    set_target_properties(chipmunk PROPERTIES LINKER_LANGUAGE CXX)\n  endif(MSVC)\n  # set the lib's version number\n  set_target_properties(chipmunk PROPERTIES VERSION 6.1.5)\n  install(TARGETS chipmunk RUNTIME DESTINATION lib LIBRARY DESTINATION lib)\nendif(BUILD_SHARED)\n\nif(BUILD_STATIC)\n  add_library(chipmunk_static STATIC\n    ${chipmunk_source_files}\n  )\n  # Tell MSVC to compile the code as C++.\n  if(MSVC)\n    set_source_files_properties(${chipmunk_source_files} PROPERTIES LANGUAGE CXX)\n    set_target_properties(chipmunk_static PROPERTIES LINKER_LANGUAGE CXX)\n  endif(MSVC)\n  # Sets chipmunk_static to output \"libchipmunk.a\" not \"libchipmunk_static.a\"\n  set_target_properties(chipmunk_static PROPERTIES OUTPUT_NAME chipmunk)\n  if(INSTALL_STATIC)\n    install(TARGETS chipmunk_static ARCHIVE DESTINATION lib)\n  endif(INSTALL_STATIC)\nendif(BUILD_STATIC)\n\nif(BUILD_SHARED OR INSTALL_STATIC)\n  # FIXME: change to PUBLIC_HEADER to allow building frameworks\n  install(FILES ${chipmunk_public_header} DESTINATION include/chipmunk)\n  install(FILES ${chipmunk_constraint_header} DESTINATION include/chipmunk/constraints)\nendif(BUILD_SHARED OR INSTALL_STATIC)\n\nset_target_properties(chipmunk_static\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/chipmunk.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include <stdio.h>\n#include <string.h>\n#include <stdarg.h>\n\n#include \"chipmunk_private.h\"\n\nvoid\ncpMessage(const char *condition, const char *file, int line, cpBool isError, cpBool isHardError, const char *message, ...)\n{\n\tfprintf(stderr, (isError ? \"Aborting due to Chipmunk error: \" : \"Chipmunk warning: \"));\n\t\n\tva_list vargs;\n\tva_start(vargs, message); {\n\t\tvfprintf(stderr, message, vargs);\n\t\tfprintf(stderr, \"\\n\");\n\t} va_end(vargs);\n\t\n\tfprintf(stderr, \"\\tFailed condition: %s\\n\", condition);\n\tfprintf(stderr, \"\\tSource:%s:%d\\n\", file, line);\n\t\n\tif(isError) abort();\n}\n\n#define STR(s) #s\n#define XSTR(s) STR(s)\n\nconst char *cpVersionString = XSTR(CP_VERSION_MAJOR)\".\"XSTR(CP_VERSION_MINOR)\".\"XSTR(CP_VERSION_RELEASE);\n\nvoid\ncpInitChipmunk(void)\n{\n\tcpAssertWarn(cpFalse, \"cpInitChipmunk is deprecated and no longer required. It will be removed in the future.\");\n}\n\n//MARK: Misc Functions\n\ncpFloat\ncpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset)\n{\n\treturn m*(0.5f*(r1*r1 + r2*r2) + cpvlengthsq(offset));\n}\n\ncpFloat\ncpAreaForCircle(cpFloat r1, cpFloat r2)\n{\n\treturn (cpFloat)M_PI*cpfabs(r1*r1 - r2*r2);\n}\n\ncpFloat\ncpMomentForSegment(cpFloat m, cpVect a, cpVect b)\n{\n\tcpVect offset = cpvmult(cpvadd(a, b), 0.5f);\n\treturn m*(cpvdistsq(b, a)/12.0f + cpvlengthsq(offset));\n}\n\ncpFloat\ncpAreaForSegment(cpVect a, cpVect b, cpFloat r)\n{\n\treturn r*((cpFloat)M_PI*r + 2.0f*cpvdist(a, b));\n}\n\ncpFloat\ncpMomentForPoly(cpFloat m, const int numVerts, const cpVect *verts, cpVect offset)\n{\n\tcpFloat sum1 = 0.0f;\n\tcpFloat sum2 = 0.0f;\n\tfor(int i=0; i<numVerts; i++){\n\t\tcpVect v1 = cpvadd(verts[i], offset);\n\t\tcpVect v2 = cpvadd(verts[(i+1)%numVerts], offset);\n\t\t\n\t\tcpFloat a = cpvcross(v2, v1);\n\t\tcpFloat b = cpvdot(v1, v1) + cpvdot(v1, v2) + cpvdot(v2, v2);\n\t\t\n\t\tsum1 += a*b;\n\t\tsum2 += a;\n\t}\n\t\n\treturn (m*sum1)/(6.0f*sum2);\n}\n\ncpFloat\ncpAreaForPoly(const int numVerts, const cpVect *verts)\n{\n\tcpFloat area = 0.0f;\n\tfor(int i=0; i<numVerts; i++){\n\t\tarea += cpvcross(verts[i], verts[(i+1)%numVerts]);\n\t}\n\t\n\treturn -area/2.0f;\n}\n\ncpVect\ncpCentroidForPoly(const int numVerts, const cpVect *verts)\n{\n\tcpFloat sum = 0.0f;\n\tcpVect vsum = cpvzero;\n\t\n\tfor(int i=0; i<numVerts; i++){\n\t\tcpVect v1 = verts[i];\n\t\tcpVect v2 = verts[(i+1)%numVerts];\n\t\tcpFloat cross = cpvcross(v1, v2);\n\t\t\n\t\tsum += cross;\n\t\tvsum = cpvadd(vsum, cpvmult(cpvadd(v1, v2), cross));\n\t}\n\t\n\treturn cpvmult(vsum, 1.0f/(3.0f*sum));\n}\n\nvoid\ncpRecenterPoly(const int numVerts, cpVect *verts){\n\tcpVect centroid = cpCentroidForPoly(numVerts, verts);\n\t\n\tfor(int i=0; i<numVerts; i++){\n\t\tverts[i] = cpvsub(verts[i], centroid);\n\t}\n}\n\ncpFloat\ncpMomentForBox(cpFloat m, cpFloat width, cpFloat height)\n{\n\treturn m*(width*width + height*height)/12.0f;\n}\n\ncpFloat\ncpMomentForBox2(cpFloat m, cpBB box)\n{\n\tcpFloat width = box.r - box.l;\n\tcpFloat height = box.t - box.b;\n\tcpVect offset = cpvmult(cpv(box.l + box.r, box.b + box.t), 0.5f);\n\t\n\t// TODO NaN when offset is 0 and m is INFINITY\n\treturn cpMomentForBox(m, width, height) + m*cpvlengthsq(offset);\n}\n\n//MARK: Quick Hull\n\nvoid\ncpLoopIndexes(cpVect *verts, int count, int *start, int *end)\n{\n\t(*start) = (*end) = 0;\n\tcpVect min = verts[0];\n\tcpVect max = min;\n\t\n  for(int i=1; i<count; i++){\n    cpVect v = verts[i];\n\t\t\n    if(v.x < min.x || (v.x == min.x && v.y < min.y)){\n      min = v;\n      (*start) = i;\n    } else if(v.x > max.x || (v.x == max.x && v.y > max.y)){\n\t\t\tmax = v;\n\t\t\t(*end) = i;\n\t\t}\n\t}\n}\n\n#define SWAP(__A__, __B__) {cpVect __TMP__ = __A__; __A__ = __B__; __B__ = __TMP__;}\n\nstatic int\nQHullPartition(cpVect *verts, int count, cpVect a, cpVect b, cpFloat tol)\n{\n\tif(count == 0) return 0;\n\t\n\tcpFloat max = 0;\n\tint pivot = 0;\n\t\n\tcpVect delta = cpvsub(b, a);\n\tcpFloat valueTol = tol*cpvlength(delta);\n\t\n\tint head = 0;\n\tfor(int tail = count-1; head <= tail;){\n\t\tcpFloat value = cpvcross(delta, cpvsub(verts[head], a));\n\t\tif(value > valueTol){\n\t\t\tif(value > max){\n\t\t\t\tmax = value;\n\t\t\t\tpivot = head;\n\t\t\t}\n\t\t\t\n\t\t\thead++;\n\t\t} else {\n\t\t\tSWAP(verts[head], verts[tail]);\n\t\t\ttail--;\n\t\t}\n\t}\n\t\n\t// move the new pivot to the front if it's not already there.\n\tif(pivot != 0) SWAP(verts[0], verts[pivot]);\n\treturn head;\n}\n\nstatic int\nQHullReduce(cpFloat tol, cpVect *verts, int count, cpVect a, cpVect pivot, cpVect b, cpVect *result)\n{\n\tif(count < 0){\n\t\treturn 0;\n\t} else if(count == 0) {\n\t\tresult[0] = pivot;\n\t\treturn 1;\n\t} else {\n\t\tint left_count = QHullPartition(verts, count, a, pivot, tol);\n\t\tint index = QHullReduce(tol, verts + 1, left_count - 1, a, verts[0], pivot, result);\n\t\t\n\t\tresult[index++] = pivot;\n\t\t\n\t\tint right_count = QHullPartition(verts + left_count, count - left_count, pivot, b, tol);\n\t\treturn index + QHullReduce(tol, verts + left_count + 1, right_count - 1, pivot, verts[left_count], b, result + index);\n\t}\n}\n\n// QuickHull seemed like a neat algorithm, and efficient-ish for large input sets.\n// My implementation performs an in place reduction using the result array as scratch space.\nint\ncpConvexHull(int count, cpVect *verts, cpVect *result, int *first, cpFloat tol)\n{\n\tif(result){\n\t\t// Copy the line vertexes into the empty part of the result polyline to use as a scratch buffer.\n\t\tmemcpy(result, verts, count*sizeof(cpVect));\n\t} else {\n\t\t// If a result array was not specified, reduce the input instead.\n\t\tresult = verts;\n\t}\n\t\n\t// Degenerate case, all poins are the same.\n\tint start, end;\n\tcpLoopIndexes(verts, count, &start, &end);\n\tif(start == end){\n\t\tif(first) (*first) = 0;\n\t\treturn 1;\n\t}\n\t\n\tSWAP(result[0], result[start]);\n\tSWAP(result[1], result[end == 0 ? start : end]);\n\t\n\tcpVect a = result[0];\n\tcpVect b = result[1];\n\t\n\tif(first) (*first) = start;\n\tint resultCount = QHullReduce(tol, result + 2, count - 2, a, b, a, result + 1) + 1;\n\tcpAssertSoft(cpPolyValidate(result, resultCount),\n\t\t\"Internal error: cpConvexHull() and cpPolyValidate() did not agree.\"\n\t\t\"Please report this error with as much info as you can.\");\n\treturn resultCount;\n}\n\n//MARK: Alternate Block Iterators\n\n#if defined(__has_extension)\n#if __has_extension(blocks)\n\nstatic void IteratorFunc(void *ptr, void (^block)(void *ptr)){block(ptr);}\n\nvoid cpSpaceEachBody_b(cpSpace *space, void (^block)(cpBody *body)){\n\tcpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)IteratorFunc, block);\n}\n\nvoid cpSpaceEachShape_b(cpSpace *space, void (^block)(cpShape *shape)){\n\tcpSpaceEachShape(space, (cpSpaceShapeIteratorFunc)IteratorFunc, block);\n}\n\nvoid cpSpaceEachConstraint_b(cpSpace *space, void (^block)(cpConstraint *constraint)){\n\tcpSpaceEachConstraint(space, (cpSpaceConstraintIteratorFunc)IteratorFunc, block);\n}\n\nstatic void BodyIteratorFunc(cpBody *body, void *ptr, void (^block)(void *ptr)){block(ptr);}\n\nvoid cpBodyEachShape_b(cpBody *body, void (^block)(cpShape *shape)){\n\tcpBodyEachShape(body, (cpBodyShapeIteratorFunc)BodyIteratorFunc, block);\n}\n\nvoid cpBodyEachConstraint_b(cpBody *body, void (^block)(cpConstraint *constraint)){\n\tcpBodyEachConstraint(body, (cpBodyConstraintIteratorFunc)BodyIteratorFunc, block);\n}\n\nvoid cpBodyEachArbiter_b(cpBody *body, void (^block)(cpArbiter *arbiter)){\n\tcpBodyEachArbiter(body, (cpBodyArbiterIteratorFunc)BodyIteratorFunc, block);\n}\n\nstatic void NearestPointQueryIteratorFunc(cpShape *shape, cpFloat distance, cpVect point, cpSpaceNearestPointQueryBlock block){block(shape, distance, point);}\nvoid cpSpaceNearestPointQuery_b(cpSpace *space, cpVect point, cpFloat maxDistance, cpLayers layers, cpGroup group, cpSpaceNearestPointQueryBlock block){\n\tcpSpaceNearestPointQuery(space, point, maxDistance, layers, group, (cpSpaceNearestPointQueryFunc)NearestPointQueryIteratorFunc, block);\n}\n\nstatic void SegmentQueryIteratorFunc(cpShape *shape, cpFloat t, cpVect n, cpSpaceSegmentQueryBlock block){block(shape, t, n);}\nvoid cpSpaceSegmentQuery_b(cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSpaceSegmentQueryBlock block){\n\tcpSpaceSegmentQuery(space, start, end, layers, group, (cpSpaceSegmentQueryFunc)SegmentQueryIteratorFunc, block);\n}\n\nvoid cpSpaceBBQuery_b(cpSpace *space, cpBB bb, cpLayers layers, cpGroup group, cpSpaceBBQueryBlock block){\n\tcpSpaceBBQuery(space, bb, layers, group, (cpSpaceBBQueryFunc)IteratorFunc, block);\n}\n\nstatic void ShapeQueryIteratorFunc(cpShape *shape, cpContactPointSet *points, cpSpaceShapeQueryBlock block){block(shape, points);}\ncpBool cpSpaceShapeQuery_b(cpSpace *space, cpShape *shape, cpSpaceShapeQueryBlock block){\n\treturn cpSpaceShapeQuery(space, shape, (cpSpaceShapeQueryFunc)ShapeQueryIteratorFunc, block);\n}\n\n#endif\n#endif\n\n#include \"chipmunk_ffi.h\"\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpConstraint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\n// TODO: Comment me!\n\nvoid cpConstraintDestroy(cpConstraint *constraint){}\n\nvoid\ncpConstraintFree(cpConstraint *constraint)\n{\n\tif(constraint){\n\t\tcpConstraintDestroy(constraint);\n\t\tcpfree(constraint);\n\t}\n}\n\n// *** declared in util.h TODO move declaration to chipmunk_private.h\n\nvoid\ncpConstraintInit(cpConstraint *constraint, const cpConstraintClass *klass, cpBody *a, cpBody *b)\n{\n\tconstraint->klass = klass;\n\t\n\tconstraint->a = a;\n\tconstraint->b = b;\n\tconstraint->space = NULL;\n\t\n\tconstraint->next_a = NULL;\n\tconstraint->next_b = NULL;\n\t\n\tconstraint->maxForce = (cpFloat)INFINITY;\n\tconstraint->errorBias = cpfpow(1.0f - 0.1f, 60.0f);\n\tconstraint->maxBias = (cpFloat)INFINITY;\n\t\n\tconstraint->preSolve = NULL;\n\tconstraint->postSolve = NULL;\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpDampedRotarySpring.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic cpFloat\ndefaultSpringTorque(cpDampedRotarySpring *spring, cpFloat relativeAngle){\n\treturn (relativeAngle - spring->restAngle)*spring->stiffness;\n}\n\nstatic void\npreStep(cpDampedRotarySpring *spring, cpFloat dt)\n{\n\tcpBody *a = spring->constraint.a;\n\tcpBody *b = spring->constraint.b;\n\t\n\tcpFloat moment = a->i_inv + b->i_inv;\n\tcpAssertSoft(moment != 0.0, \"Unsolvable spring.\");\n\tspring->iSum = 1.0f/moment;\n\n\tspring->w_coef = 1.0f - cpfexp(-spring->damping*dt*moment);\n\tspring->target_wrn = 0.0f;\n\n\t// apply spring torque\n\tcpFloat j_spring = spring->springTorqueFunc((cpConstraint *)spring, a->a - b->a)*dt;\n\tspring->jAcc = j_spring;\n\t\n\ta->w -= j_spring*a->i_inv;\n\tb->w += j_spring*b->i_inv;\n}\n\nstatic void applyCachedImpulse(cpDampedRotarySpring *spring, cpFloat dt_coef){}\n\nstatic void\napplyImpulse(cpDampedRotarySpring *spring, cpFloat dt)\n{\n\tcpBody *a = spring->constraint.a;\n\tcpBody *b = spring->constraint.b;\n\t\n\t// compute relative velocity\n\tcpFloat wrn = a->w - b->w;//normal_relative_velocity(a, b, r1, r2, n) - spring->target_vrn;\n\t\n\t// compute velocity loss from drag\n\t// not 100% certain this is derived correctly, though it makes sense\n\tcpFloat w_damp = (spring->target_wrn - wrn)*spring->w_coef;\n\tspring->target_wrn = wrn + w_damp;\n\t\n\t//apply_impulses(a, b, spring->r1, spring->r2, cpvmult(spring->n, v_damp*spring->nMass));\n\tcpFloat j_damp = w_damp*spring->iSum;\n\tspring->jAcc += j_damp;\n\t\n\ta->w += j_damp*a->i_inv;\n\tb->w -= j_damp*b->i_inv;\n}\n\nstatic cpFloat\ngetImpulse(cpDampedRotarySpring *spring)\n{\n\treturn spring->jAcc;\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpDampedRotarySpring)\n\ncpDampedRotarySpring *\ncpDampedRotarySpringAlloc(void)\n{\n\treturn (cpDampedRotarySpring *)cpcalloc(1, sizeof(cpDampedRotarySpring));\n}\n\ncpDampedRotarySpring *\ncpDampedRotarySpringInit(cpDampedRotarySpring *spring, cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping)\n{\n\tcpConstraintInit((cpConstraint *)spring, &klass, a, b);\n\t\n\tspring->restAngle = restAngle;\n\tspring->stiffness = stiffness;\n\tspring->damping = damping;\n\tspring->springTorqueFunc = (cpDampedRotarySpringTorqueFunc)defaultSpringTorque;\n\t\n\tspring->jAcc = 0.0f;\n\t\n\treturn spring;\n}\n\ncpConstraint *\ncpDampedRotarySpringNew(cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping)\n{\n\treturn (cpConstraint *)cpDampedRotarySpringInit(cpDampedRotarySpringAlloc(), a, b, restAngle, stiffness, damping);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpDampedSpring.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic cpFloat\ndefaultSpringForce(cpDampedSpring *spring, cpFloat dist){\n\treturn (spring->restLength - dist)*spring->stiffness;\n}\n\nstatic void\npreStep(cpDampedSpring *spring, cpFloat dt)\n{\n\tcpBody *a = spring->constraint.a;\n\tcpBody *b = spring->constraint.b;\n\t\n\tspring->r1 = cpvrotate(spring->anchr1, a->rot);\n\tspring->r2 = cpvrotate(spring->anchr2, b->rot);\n\t\n\tcpVect delta = cpvsub(cpvadd(b->p, spring->r2), cpvadd(a->p, spring->r1));\n\tcpFloat dist = cpvlength(delta);\n\tspring->n = cpvmult(delta, 1.0f/(dist ? dist : INFINITY));\n\t\n\tcpFloat k = k_scalar(a, b, spring->r1, spring->r2, spring->n);\n\tcpAssertSoft(k != 0.0, \"Unsolvable spring.\");\n\tspring->nMass = 1.0f/k;\n\t\n\tspring->target_vrn = 0.0f;\n\tspring->v_coef = 1.0f - cpfexp(-spring->damping*dt*k);\n\n\t// apply spring force\n\tcpFloat f_spring = spring->springForceFunc((cpConstraint *)spring, dist);\n\tcpFloat j_spring = spring->jAcc = f_spring*dt;\n\tapply_impulses(a, b, spring->r1, spring->r2, cpvmult(spring->n, j_spring));\n}\n\nstatic void applyCachedImpulse(cpDampedSpring *spring, cpFloat dt_coef){}\n\nstatic void\napplyImpulse(cpDampedSpring *spring, cpFloat dt)\n{\n\tcpBody *a = spring->constraint.a;\n\tcpBody *b = spring->constraint.b;\n\t\n\tcpVect n = spring->n;\n\tcpVect r1 = spring->r1;\n\tcpVect r2 = spring->r2;\n\n\t// compute relative velocity\n\tcpFloat vrn = normal_relative_velocity(a, b, r1, r2, n);\n\t\n\t// compute velocity loss from drag\n\tcpFloat v_damp = (spring->target_vrn - vrn)*spring->v_coef;\n\tspring->target_vrn = vrn + v_damp;\n\t\n\tcpFloat j_damp = v_damp*spring->nMass;\n\tspring->jAcc += j_damp;\n\tapply_impulses(a, b, spring->r1, spring->r2, cpvmult(spring->n, j_damp));\n}\n\nstatic cpFloat\ngetImpulse(cpDampedSpring *spring)\n{\n\treturn spring->jAcc;\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpDampedSpring)\n\ncpDampedSpring *\ncpDampedSpringAlloc(void)\n{\n\treturn (cpDampedSpring *)cpcalloc(1, sizeof(cpDampedSpring));\n}\n\ncpDampedSpring *\ncpDampedSpringInit(cpDampedSpring *spring, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping)\n{\n\tcpConstraintInit((cpConstraint *)spring, cpDampedSpringGetClass(), a, b);\n\t\n\tspring->anchr1 = anchr1;\n\tspring->anchr2 = anchr2;\n\t\n\tspring->restLength = restLength;\n\tspring->stiffness = stiffness;\n\tspring->damping = damping;\n\tspring->springForceFunc = (cpDampedSpringForceFunc)defaultSpringForce;\n\t\n\tspring->jAcc = 0.0f;\n\t\n\treturn spring;\n}\n\ncpConstraint *\ncpDampedSpringNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping)\n{\n\treturn (cpConstraint *)cpDampedSpringInit(cpDampedSpringAlloc(), a, b, anchr1, anchr2, restLength, stiffness, damping);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpGearJoint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpGearJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\t// calculate moment of inertia coefficient.\n\tjoint->iSum = 1.0f/(a->i_inv*joint->ratio_inv + joint->ratio*b->i_inv);\n\t\n\t// calculate bias velocity\n\tcpFloat maxBias = joint->constraint.maxBias;\n\tjoint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*(b->a*joint->ratio - a->a - joint->phase)/dt, -maxBias, maxBias);\n}\n\nstatic void\napplyCachedImpulse(cpGearJoint *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpFloat j = joint->jAcc*dt_coef;\n\ta->w -= j*a->i_inv*joint->ratio_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic void\napplyImpulse(cpGearJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\t// compute relative rotational velocity\n\tcpFloat wr = b->w*joint->ratio - a->w;\n\t\n\tcpFloat jMax = joint->constraint.maxForce*dt;\n\t\n\t// compute normal impulse\t\n\tcpFloat j = (joint->bias - wr)*joint->iSum;\n\tcpFloat jOld = joint->jAcc;\n\tjoint->jAcc = cpfclamp(jOld + j, -jMax, jMax);\n\tj = joint->jAcc - jOld;\n\t\n\t// apply impulse\n\ta->w -= j*a->i_inv*joint->ratio_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic cpFloat\ngetImpulse(cpGearJoint *joint)\n{\n\treturn cpfabs(joint->jAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpGearJoint)\n\ncpGearJoint *\ncpGearJointAlloc(void)\n{\n\treturn (cpGearJoint *)cpcalloc(1, sizeof(cpGearJoint));\n}\n\ncpGearJoint *\ncpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->phase = phase;\n\tjoint->ratio = ratio;\n\tjoint->ratio_inv = 1.0f/ratio;\n\t\n\tjoint->jAcc = 0.0f;\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio)\n{\n\treturn (cpConstraint *)cpGearJointInit(cpGearJointAlloc(), a, b, phase, ratio);\n}\n\nvoid\ncpGearJointSetRatio(cpConstraint *constraint, cpFloat value)\n{\n\tcpConstraintCheckCast(constraint, cpGearJoint);\n\t((cpGearJoint *)constraint)->ratio = value;\n\t((cpGearJoint *)constraint)->ratio_inv = 1.0f/value;\n\tcpConstraintActivateBodies(constraint);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpGrooveJoint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpGrooveJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\t// calculate endpoints in worldspace\n\tcpVect ta = cpBodyLocal2World(a, joint->grv_a);\n\tcpVect tb = cpBodyLocal2World(a, joint->grv_b);\n\n\t// calculate axis\n\tcpVect n = cpvrotate(joint->grv_n, a->rot);\n\tcpFloat d = cpvdot(ta, n);\n\t\n\tjoint->grv_tn = n;\n\tjoint->r2 = cpvrotate(joint->anchr2, b->rot);\n\t\n\t// calculate tangential distance along the axis of r2\n\tcpFloat td = cpvcross(cpvadd(b->p, joint->r2), n);\n\t// calculate clamping factor and r2\n\tif(td <= cpvcross(ta, n)){\n\t\tjoint->clamp = 1.0f;\n\t\tjoint->r1 = cpvsub(ta, a->p);\n\t} else if(td >= cpvcross(tb, n)){\n\t\tjoint->clamp = -1.0f;\n\t\tjoint->r1 = cpvsub(tb, a->p);\n\t} else {\n\t\tjoint->clamp = 0.0f;\n\t\tjoint->r1 = cpvsub(cpvadd(cpvmult(cpvperp(n), -td), cpvmult(n, d)), a->p);\n\t}\n\t\n\t// Calculate mass tensor\n\tjoint->k = k_tensor(a, b, joint->r1, joint->r2);\n\t\n\t// calculate bias velocity\n\tcpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1));\n\tjoint->bias = cpvclamp(cpvmult(delta, -bias_coef(joint->constraint.errorBias, dt)/dt), joint->constraint.maxBias);\n}\n\nstatic void\napplyCachedImpulse(cpGrooveJoint *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\t\n\tapply_impulses(a, b, joint->r1, joint->r2, cpvmult(joint->jAcc, dt_coef));\n}\n\nstatic inline cpVect\ngrooveConstrain(cpGrooveJoint *joint, cpVect j, cpFloat dt){\n\tcpVect n = joint->grv_tn;\n\tcpVect jClamp = (joint->clamp*cpvcross(j, n) > 0.0f) ? j : cpvproject(j, n);\n\treturn cpvclamp(jClamp, joint->constraint.maxForce*dt);\n}\n\nstatic void\napplyImpulse(cpGrooveJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpVect r1 = joint->r1;\n\tcpVect r2 = joint->r2;\n\t\n\t// compute impulse\n\tcpVect vr = relative_velocity(a, b, r1, r2);\n\n\tcpVect j = cpMat2x2Transform(joint->k, cpvsub(joint->bias, vr));\n\tcpVect jOld = joint->jAcc;\n\tjoint->jAcc = grooveConstrain(joint, cpvadd(jOld, j), dt);\n\tj = cpvsub(joint->jAcc, jOld);\n\t\n\t// apply impulse\n\tapply_impulses(a, b, joint->r1, joint->r2, j);\n}\n\nstatic cpFloat\ngetImpulse(cpGrooveJoint *joint)\n{\n\treturn cpvlength(joint->jAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpGrooveJoint)\n\ncpGrooveJoint *\ncpGrooveJointAlloc(void)\n{\n\treturn (cpGrooveJoint *)cpcalloc(1, sizeof(cpGrooveJoint));\n}\n\ncpGrooveJoint *\ncpGrooveJointInit(cpGrooveJoint *joint, cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->grv_a = groove_a;\n\tjoint->grv_b = groove_b;\n\tjoint->grv_n = cpvperp(cpvnormalize(cpvsub(groove_b, groove_a)));\n\tjoint->anchr2 = anchr2;\n\t\n\tjoint->jAcc = cpvzero;\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2)\n{\n\treturn (cpConstraint *)cpGrooveJointInit(cpGrooveJointAlloc(), a, b, groove_a, groove_b, anchr2);\n}\n\nvoid\ncpGrooveJointSetGrooveA(cpConstraint *constraint, cpVect value)\n{\n\tcpGrooveJoint *g = (cpGrooveJoint *)constraint;\n\tcpConstraintCheckCast(constraint, cpGrooveJoint);\n\t\n\tg->grv_a = value;\n\tg->grv_n = cpvperp(cpvnormalize(cpvsub(g->grv_b, value)));\n\t\n\tcpConstraintActivateBodies(constraint);\n}\n\nvoid\ncpGrooveJointSetGrooveB(cpConstraint *constraint, cpVect value)\n{\n\tcpGrooveJoint *g = (cpGrooveJoint *)constraint;\n\tcpConstraintCheckCast(constraint, cpGrooveJoint);\n\t\n\tg->grv_b = value;\n\tg->grv_n = cpvperp(cpvnormalize(cpvsub(value, g->grv_a)));\n\t\n\tcpConstraintActivateBodies(constraint);\n}\n\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpPinJoint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpPinJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tjoint->r1 = cpvrotate(joint->anchr1, a->rot);\n\tjoint->r2 = cpvrotate(joint->anchr2, b->rot);\n\t\n\tcpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1));\n\tcpFloat dist = cpvlength(delta);\n\tjoint->n = cpvmult(delta, 1.0f/(dist ? dist : (cpFloat)INFINITY));\n\t\n\t// calculate mass normal\n\tjoint->nMass = 1.0f/k_scalar(a, b, joint->r1, joint->r2, joint->n);\n\t\n\t// calculate bias velocity\n\tcpFloat maxBias = joint->constraint.maxBias;\n\tjoint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*(dist - joint->dist)/dt, -maxBias, maxBias);\n}\n\nstatic void\napplyCachedImpulse(cpPinJoint *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpVect j = cpvmult(joint->n, joint->jnAcc*dt_coef);\n\tapply_impulses(a, b, joint->r1, joint->r2, j);\n}\n\nstatic void\napplyImpulse(cpPinJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\tcpVect n = joint->n;\n\n\t// compute relative velocity\n\tcpFloat vrn = normal_relative_velocity(a, b, joint->r1, joint->r2, n);\n\t\n\tcpFloat jnMax = joint->constraint.maxForce*dt;\n\t\n\t// compute normal impulse\n\tcpFloat jn = (joint->bias - vrn)*joint->nMass;\n\tcpFloat jnOld = joint->jnAcc;\n\tjoint->jnAcc = cpfclamp(jnOld + jn, -jnMax, jnMax);\n\tjn = joint->jnAcc - jnOld;\n\t\n\t// apply impulse\n\tapply_impulses(a, b, joint->r1, joint->r2, cpvmult(n, jn));\n}\n\nstatic cpFloat\ngetImpulse(cpPinJoint *joint)\n{\n\treturn cpfabs(joint->jnAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpPinJoint)\n\n\ncpPinJoint *\ncpPinJointAlloc(void)\n{\n\treturn (cpPinJoint *)cpcalloc(1, sizeof(cpPinJoint));\n}\n\ncpPinJoint *\ncpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->anchr1 = anchr1;\n\tjoint->anchr2 = anchr2;\n\t\n\t// STATIC_BODY_CHECK\n\tcpVect p1 = (a ? cpvadd(a->p, cpvrotate(anchr1, a->rot)) : anchr1);\n\tcpVect p2 = (b ? cpvadd(b->p, cpvrotate(anchr2, b->rot)) : anchr2);\n\tjoint->dist = cpvlength(cpvsub(p2, p1));\n\t\n\tcpAssertWarn(joint->dist > 0.0, \"You created a 0 length pin joint. A pivot joint will be much more stable.\");\n\n\tjoint->jnAcc = 0.0f;\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)\n{\n\treturn (cpConstraint *)cpPinJointInit(cpPinJointAlloc(), a, b, anchr1, anchr2);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpPivotJoint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpPivotJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tjoint->r1 = cpvrotate(joint->anchr1, a->rot);\n\tjoint->r2 = cpvrotate(joint->anchr2, b->rot);\n\t\n\t// Calculate mass tensor\n\tjoint-> k = k_tensor(a, b, joint->r1, joint->r2);\n\t\n\t// calculate bias velocity\n\tcpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1));\n\tjoint->bias = cpvclamp(cpvmult(delta, -bias_coef(joint->constraint.errorBias, dt)/dt), joint->constraint.maxBias);\n}\n\nstatic void\napplyCachedImpulse(cpPivotJoint *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tapply_impulses(a, b, joint->r1, joint->r2, cpvmult(joint->jAcc, dt_coef));\n}\n\nstatic void\napplyImpulse(cpPivotJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpVect r1 = joint->r1;\n\tcpVect r2 = joint->r2;\n\t\t\n\t// compute relative velocity\n\tcpVect vr = relative_velocity(a, b, r1, r2);\n\t\n\t// compute normal impulse\n\tcpVect j = cpMat2x2Transform(joint->k, cpvsub(joint->bias, vr));\n\tcpVect jOld = joint->jAcc;\n\tjoint->jAcc = cpvclamp(cpvadd(joint->jAcc, j), joint->constraint.maxForce*dt);\n\tj = cpvsub(joint->jAcc, jOld);\n\t\n\t// apply impulse\n\tapply_impulses(a, b, joint->r1, joint->r2, j);\n}\n\nstatic cpFloat\ngetImpulse(cpConstraint *joint)\n{\n\treturn cpvlength(((cpPivotJoint *)joint)->jAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpPivotJoint)\n\ncpPivotJoint *\ncpPivotJointAlloc(void)\n{\n\treturn (cpPivotJoint *)cpcalloc(1, sizeof(cpPivotJoint));\n}\n\ncpPivotJoint *\ncpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->anchr1 = anchr1;\n\tjoint->anchr2 = anchr2;\n\t\n\tjoint->jAcc = cpvzero;\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpPivotJointNew2(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)\n{\n\treturn (cpConstraint *)cpPivotJointInit(cpPivotJointAlloc(), a, b, anchr1, anchr2);\n}\n\ncpConstraint *\ncpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot)\n{\n\tcpVect anchr1 = (a ? cpBodyWorld2Local(a, pivot) : pivot);\n\tcpVect anchr2 = (b ? cpBodyWorld2Local(b, pivot) : pivot);\n\treturn cpPivotJointNew2(a, b, anchr1, anchr2);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpRatchetJoint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpRatchetJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpFloat angle = joint->angle;\n\tcpFloat phase = joint->phase;\n\tcpFloat ratchet = joint->ratchet;\n\t\n\tcpFloat delta = b->a - a->a;\n\tcpFloat diff = angle - delta;\n\tcpFloat pdist = 0.0f;\n\t\n\tif(diff*ratchet > 0.0f){\n\t\tpdist = diff;\n\t} else {\n\t\tjoint->angle = cpffloor((delta - phase)/ratchet)*ratchet + phase;\n\t}\n\t\n\t// calculate moment of inertia coefficient.\n\tjoint->iSum = 1.0f/(a->i_inv + b->i_inv);\n\t\n\t// calculate bias velocity\n\tcpFloat maxBias = joint->constraint.maxBias;\n\tjoint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*pdist/dt, -maxBias, maxBias);\n\n\t// If the bias is 0, the joint is not at a limit. Reset the impulse.\n\tif(!joint->bias) joint->jAcc = 0.0f;\n}\n\nstatic void\napplyCachedImpulse(cpRatchetJoint *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpFloat j = joint->jAcc*dt_coef;\n\ta->w -= j*a->i_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic void\napplyImpulse(cpRatchetJoint *joint, cpFloat dt)\n{\n\tif(!joint->bias) return; // early exit\n\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\t// compute relative rotational velocity\n\tcpFloat wr = b->w - a->w;\n\tcpFloat ratchet = joint->ratchet;\n\t\n\tcpFloat jMax = joint->constraint.maxForce*dt;\n\t\n\t// compute normal impulse\t\n\tcpFloat j = -(joint->bias + wr)*joint->iSum;\n\tcpFloat jOld = joint->jAcc;\n\tjoint->jAcc = cpfclamp((jOld + j)*ratchet, 0.0f, jMax*cpfabs(ratchet))/ratchet;\n\tj = joint->jAcc - jOld;\n\t\n\t// apply impulse\n\ta->w -= j*a->i_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic cpFloat\ngetImpulse(cpRatchetJoint *joint)\n{\n\treturn cpfabs(joint->jAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpRatchetJoint)\n\ncpRatchetJoint *\ncpRatchetJointAlloc(void)\n{\n\treturn (cpRatchetJoint *)cpcalloc(1, sizeof(cpRatchetJoint));\n}\n\ncpRatchetJoint *\ncpRatchetJointInit(cpRatchetJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->angle = 0.0f;\n\tjoint->phase = phase;\n\tjoint->ratchet = ratchet;\n\t\n\t// STATIC_BODY_CHECK\n\tjoint->angle = (b ? b->a : 0.0f) - (a ? a->a : 0.0f);\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpRatchetJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet)\n{\n\treturn (cpConstraint *)cpRatchetJointInit(cpRatchetJointAlloc(), a, b, phase, ratchet);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpRotaryLimitJoint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpRotaryLimitJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpFloat dist = b->a - a->a;\n\tcpFloat pdist = 0.0f;\n\tif(dist > joint->max) {\n\t\tpdist = joint->max - dist;\n\t} else if(dist < joint->min) {\n\t\tpdist = joint->min - dist;\n\t}\n\t\n\t// calculate moment of inertia coefficient.\n\tjoint->iSum = 1.0f/(1.0f/a->i + 1.0f/b->i);\n\t\n\t// calculate bias velocity\n\tcpFloat maxBias = joint->constraint.maxBias;\n\tjoint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*pdist/dt, -maxBias, maxBias);\n\n\t// If the bias is 0, the joint is not at a limit. Reset the impulse.\n\tif(!joint->bias) joint->jAcc = 0.0f;\n}\n\nstatic void\napplyCachedImpulse(cpRotaryLimitJoint *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpFloat j = joint->jAcc*dt_coef;\n\ta->w -= j*a->i_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic void\napplyImpulse(cpRotaryLimitJoint *joint, cpFloat dt)\n{\n\tif(!joint->bias) return; // early exit\n\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\t// compute relative rotational velocity\n\tcpFloat wr = b->w - a->w;\n\t\n\tcpFloat jMax = joint->constraint.maxForce*dt;\n\t\n\t// compute normal impulse\t\n\tcpFloat j = -(joint->bias + wr)*joint->iSum;\n\tcpFloat jOld = joint->jAcc;\n\tif(joint->bias < 0.0f){\n\t\tjoint->jAcc = cpfclamp(jOld + j, 0.0f, jMax);\n\t} else {\n\t\tjoint->jAcc = cpfclamp(jOld + j, -jMax, 0.0f);\n\t}\n\tj = joint->jAcc - jOld;\n\t\n\t// apply impulse\n\ta->w -= j*a->i_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic cpFloat\ngetImpulse(cpRotaryLimitJoint *joint)\n{\n\treturn cpfabs(joint->jAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpRotaryLimitJoint)\n\ncpRotaryLimitJoint *\ncpRotaryLimitJointAlloc(void)\n{\n\treturn (cpRotaryLimitJoint *)cpcalloc(1, sizeof(cpRotaryLimitJoint));\n}\n\ncpRotaryLimitJoint *\ncpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->min = min;\n\tjoint->max  = max;\n\t\n\tjoint->jAcc = 0.0f;\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max)\n{\n\treturn (cpConstraint *)cpRotaryLimitJointInit(cpRotaryLimitJointAlloc(), a, b, min, max);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpSimpleMotor.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpSimpleMotor *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\t// calculate moment of inertia coefficient.\n\tjoint->iSum = 1.0f/(a->i_inv + b->i_inv);\n}\n\nstatic void\napplyCachedImpulse(cpSimpleMotor *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpFloat j = joint->jAcc*dt_coef;\n\ta->w -= j*a->i_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic void\napplyImpulse(cpSimpleMotor *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\t// compute relative rotational velocity\n\tcpFloat wr = b->w - a->w + joint->rate;\n\t\n\tcpFloat jMax = joint->constraint.maxForce*dt;\n\t\n\t// compute normal impulse\t\n\tcpFloat j = -wr*joint->iSum;\n\tcpFloat jOld = joint->jAcc;\n\tjoint->jAcc = cpfclamp(jOld + j, -jMax, jMax);\n\tj = joint->jAcc - jOld;\n\t\n\t// apply impulse\n\ta->w -= j*a->i_inv;\n\tb->w += j*b->i_inv;\n}\n\nstatic cpFloat\ngetImpulse(cpSimpleMotor *joint)\n{\n\treturn cpfabs(joint->jAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpSimpleMotor)\n\ncpSimpleMotor *\ncpSimpleMotorAlloc(void)\n{\n\treturn (cpSimpleMotor *)cpcalloc(1, sizeof(cpSimpleMotor));\n}\n\ncpSimpleMotor *\ncpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->rate = rate;\n\t\n\tjoint->jAcc = 0.0f;\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate)\n{\n\treturn (cpConstraint *)cpSimpleMotorInit(cpSimpleMotorAlloc(), a, b, rate);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/constraints/cpSlideJoint.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\nstatic void\npreStep(cpSlideJoint *joint, cpFloat dt)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tjoint->r1 = cpvrotate(joint->anchr1, a->rot);\n\tjoint->r2 = cpvrotate(joint->anchr2, b->rot);\n\t\n\tcpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1));\n\tcpFloat dist = cpvlength(delta);\n\tcpFloat pdist = 0.0f;\n\tif(dist > joint->max) {\n\t\tpdist = dist - joint->max;\n\t\tjoint->n = cpvnormalize_safe(delta);\n\t} else if(dist < joint->min) {\n\t\tpdist = joint->min - dist;\n\t\tjoint->n = cpvneg(cpvnormalize_safe(delta));\n\t} else {\n\t\tjoint->n = cpvzero;\n\t\tjoint->jnAcc = 0.0f;\n\t}\n\t\n\t// calculate mass normal\n\tjoint->nMass = 1.0f/k_scalar(a, b, joint->r1, joint->r2, joint->n);\n\t\n\t// calculate bias velocity\n\tcpFloat maxBias = joint->constraint.maxBias;\n\tjoint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*pdist/dt, -maxBias, maxBias);\n}\n\nstatic void\napplyCachedImpulse(cpSlideJoint *joint, cpFloat dt_coef)\n{\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpVect j = cpvmult(joint->n, joint->jnAcc*dt_coef);\n\tapply_impulses(a, b, joint->r1, joint->r2, j);\n}\n\nstatic void\napplyImpulse(cpSlideJoint *joint, cpFloat dt)\n{\n\tif(cpveql(joint->n, cpvzero)) return;  // early exit\n\n\tcpBody *a = joint->constraint.a;\n\tcpBody *b = joint->constraint.b;\n\t\n\tcpVect n = joint->n;\n\tcpVect r1 = joint->r1;\n\tcpVect r2 = joint->r2;\n\t\t\n\t// compute relative velocity\n\tcpVect vr = relative_velocity(a, b, r1, r2);\n\tcpFloat vrn = cpvdot(vr, n);\n\t\n\t// compute normal impulse\n\tcpFloat jn = (joint->bias - vrn)*joint->nMass;\n\tcpFloat jnOld = joint->jnAcc;\n\tjoint->jnAcc = cpfclamp(jnOld + jn, -joint->constraint.maxForce*dt, 0.0f);\n\tjn = joint->jnAcc - jnOld;\n\t\n\t// apply impulse\n\tapply_impulses(a, b, joint->r1, joint->r2, cpvmult(n, jn));\n}\n\nstatic cpFloat\ngetImpulse(cpConstraint *joint)\n{\n\treturn cpfabs(((cpSlideJoint *)joint)->jnAcc);\n}\n\nstatic const cpConstraintClass klass = {\n\t(cpConstraintPreStepImpl)preStep,\n\t(cpConstraintApplyCachedImpulseImpl)applyCachedImpulse,\n\t(cpConstraintApplyImpulseImpl)applyImpulse,\n\t(cpConstraintGetImpulseImpl)getImpulse,\n};\nCP_DefineClassGetter(cpSlideJoint)\n\ncpSlideJoint *\ncpSlideJointAlloc(void)\n{\n\treturn (cpSlideJoint *)cpcalloc(1, sizeof(cpSlideJoint));\n}\n\ncpSlideJoint *\ncpSlideJointInit(cpSlideJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max)\n{\n\tcpConstraintInit((cpConstraint *)joint, &klass, a, b);\n\t\n\tjoint->anchr1 = anchr1;\n\tjoint->anchr2 = anchr2;\n\tjoint->min = min;\n\tjoint->max = max;\n\t\n\tjoint->jnAcc = 0.0f;\n\t\n\treturn joint;\n}\n\ncpConstraint *\ncpSlideJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max)\n{\n\treturn (cpConstraint *)cpSlideJointInit(cpSlideJointAlloc(), a, b, anchr1, anchr2, min, max);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpArbiter.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\ncpContact*\ncpContactInit(cpContact *con, cpVect p, cpVect n, cpFloat dist, cpHashValue hash)\n{\n\tcon->p = p;\n\tcon->n = n;\n\tcon->dist = dist;\n\t\n\tcon->jnAcc = 0.0f;\n\tcon->jtAcc = 0.0f;\n\tcon->jBias = 0.0f;\n\t\n\tcon->hash = hash;\n\t\t\n\treturn con;\n}\n\n// TODO make this generic so I can reuse it for constraints also.\nstatic inline void\nunthreadHelper(cpArbiter *arb, cpBody *body)\n{\n\tstruct cpArbiterThread *thread = cpArbiterThreadForBody(arb, body);\n\tcpArbiter *prev = thread->prev;\n\tcpArbiter *next = thread->next;\n\t\n\tif(prev){\n\t\tcpArbiterThreadForBody(prev, body)->next = next;\n\t} else if(body->arbiterList == arb) {\n\t\t// IFF prev is NULL and body->arbiterList == arb, is arb at the head of the list.\n\t\t// This function may be called for an arbiter that was never in a list.\n\t\t// In that case, we need to protect it from wiping out the body->arbiterList pointer.\n\t\tbody->arbiterList = next;\n\t}\n\t\n\tif(next) cpArbiterThreadForBody(next, body)->prev = prev;\n\t\n\tthread->prev = NULL;\n\tthread->next = NULL;\n}\n\nvoid\ncpArbiterUnthread(cpArbiter *arb)\n{\n\tunthreadHelper(arb, arb->body_a);\n\tunthreadHelper(arb, arb->body_b);\n}\n\ncpBool cpArbiterIsFirstContact(const cpArbiter *arb)\n{\n\treturn arb->CP_PRIVATE(state) == cpArbiterStateFirstColl;\n}\n\nint cpArbiterGetCount(const cpArbiter *arb)\n{\n\t// Return 0 contacts if we are in a separate callback.\n\treturn (arb->CP_PRIVATE(state) != cpArbiterStateCached ? arb->CP_PRIVATE(numContacts) : 0);\n}\n\ncpVect\ncpArbiterGetNormal(const cpArbiter *arb, int i)\n{\n\tcpAssertHard(0 <= i && i < cpArbiterGetCount(arb), \"Index error: The specified contact index is invalid for this arbiter\");\n\t\n\tcpVect n = arb->contacts[i].n;\n\treturn arb->swappedColl ? cpvneg(n) : n;\n}\n\ncpVect\ncpArbiterGetPoint(const cpArbiter *arb, int i)\n{\n\tcpAssertHard(0 <= i && i < cpArbiterGetCount(arb), \"Index error: The specified contact index is invalid for this arbiter\");\n\t\n\treturn arb->CP_PRIVATE(contacts)[i].CP_PRIVATE(p);\n}\n\ncpFloat\ncpArbiterGetDepth(const cpArbiter *arb, int i)\n{\n\tcpAssertHard(0 <= i && i < cpArbiterGetCount(arb), \"Index error: The specified contact index is invalid for this arbiter\");\n\t\n\treturn arb->CP_PRIVATE(contacts)[i].CP_PRIVATE(dist);\n}\n\ncpContactPointSet\ncpArbiterGetContactPointSet(const cpArbiter *arb)\n{\n\tcpContactPointSet set;\n\tset.count = cpArbiterGetCount(arb);\n\t\n\tfor(int i=0; i<set.count; i++){\n\t\tset.points[i].point = arb->CP_PRIVATE(contacts)[i].CP_PRIVATE(p);\n\t\tset.points[i].normal = arb->CP_PRIVATE(contacts)[i].CP_PRIVATE(n);\n\t\tset.points[i].dist = arb->CP_PRIVATE(contacts)[i].CP_PRIVATE(dist);\n\t}\n\t\n\treturn set;\n}\n\nvoid\ncpArbiterSetContactPointSet(cpArbiter *arb, cpContactPointSet *set)\n{\n\tint count = set->count;\n\tcpAssertHard(count == arb->numContacts, \"The number of contact points cannot be changed.\");\n\t\n\tfor(int i=0; i<count; i++){\n\t\tarb->contacts[i].p = set->points[i].point;\n\t\tarb->contacts[i].n = set->points[i].normal;\n\t\tarb->contacts[i].dist = set->points[i].dist;\n\t}\n}\n\ncpVect\ncpArbiterTotalImpulse(const cpArbiter *arb)\n{\n\tcpContact *contacts = arb->contacts;\n\tcpVect sum = cpvzero;\n\t\n\tfor(int i=0, count=cpArbiterGetCount(arb); i<count; i++){\n\t\tcpContact *con = &contacts[i];\n\t\tsum = cpvadd(sum, cpvmult(con->n, con->jnAcc));\n\t}\n\t\n\treturn (arb->swappedColl ? sum : cpvneg(sum));\n}\n\ncpVect\ncpArbiterTotalImpulseWithFriction(const cpArbiter *arb)\n{\n\tcpContact *contacts = arb->contacts;\n\tcpVect sum = cpvzero;\n\t\n\tfor(int i=0, count=cpArbiterGetCount(arb); i<count; i++){\n\t\tcpContact *con = &contacts[i];\n\t\tsum = cpvadd(sum, cpvrotate(con->n, cpv(con->jnAcc, con->jtAcc)));\n\t}\n\t\t\n\treturn (arb->swappedColl ? sum : cpvneg(sum));\n}\n\ncpFloat\ncpArbiterTotalKE(const cpArbiter *arb)\n{\n\tcpFloat eCoef = (1 - arb->e)/(1 + arb->e);\n\tcpFloat sum = 0.0;\n\t\n\tcpContact *contacts = arb->contacts;\n\tfor(int i=0, count=cpArbiterGetCount(arb); i<count; i++){\n\t\tcpContact *con = &contacts[i];\n\t\tcpFloat jnAcc = con->jnAcc;\n\t\tcpFloat jtAcc = con->jtAcc;\n\t\t\n\t\tsum += eCoef*jnAcc*jnAcc/con->nMass + jtAcc*jtAcc/con->tMass;\n\t}\n\t\n\treturn sum;\n}\n\nvoid\ncpArbiterIgnore(cpArbiter *arb)\n{\n\tarb->state = cpArbiterStateIgnore;\n}\n\ncpVect\ncpArbiterGetSurfaceVelocity(cpArbiter *arb)\n{\n\treturn cpvmult(arb->surface_vr, arb->swappedColl ? -1.0f : 1.0);\n}\n\nvoid\ncpArbiterSetSurfaceVelocity(cpArbiter *arb, cpVect vr)\n{\n\tarb->surface_vr = cpvmult(vr, arb->swappedColl ? -1.0f : 1.0);\n}\n\n\ncpArbiter*\ncpArbiterInit(cpArbiter *arb, cpShape *a, cpShape *b)\n{\n\tarb->handler = NULL;\n\tarb->swappedColl = cpFalse;\n\t\n\tarb->e = 0.0f;\n\tarb->u = 0.0f;\n\tarb->surface_vr = cpvzero;\n\t\n\tarb->numContacts = 0;\n\tarb->contacts = NULL;\n\t\n\tarb->a = a; arb->body_a = a->body;\n\tarb->b = b; arb->body_b = b->body;\n\t\n\tarb->thread_a.next = NULL;\n\tarb->thread_b.next = NULL;\n\tarb->thread_a.prev = NULL;\n\tarb->thread_b.prev = NULL;\n\t\n\tarb->stamp = 0;\n\tarb->state = cpArbiterStateFirstColl;\n\t\n\tarb->data = NULL;\n\t\n\treturn arb;\n}\n\nvoid\ncpArbiterUpdate(cpArbiter *arb, cpContact *contacts, int numContacts, cpCollisionHandler *handler, cpShape *a, cpShape *b)\n{\n\t// Iterate over the possible pairs to look for hash value matches.\n\tfor(int i=0; i<numContacts; i++){\n\t\tcpContact *con = &contacts[i];\n\t\t\n\t\tfor(int j=0; j<arb->numContacts; j++){\n\t\t\tcpContact *old = &arb->contacts[j];\n\t\t\t\n\t\t\t// This could trigger false positives, but is fairly unlikely nor serious if it does.\n\t\t\tif(con->hash == old->hash){\n\t\t\t\t// Copy the persistant contact information.\n\t\t\t\tcon->jnAcc = old->jnAcc;\n\t\t\t\tcon->jtAcc = old->jtAcc;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tarb->contacts = contacts;\n\tarb->numContacts = numContacts;\n\t\n\tarb->handler = handler;\n\tarb->swappedColl = (a->collision_type != handler->a);\n\t\n\tarb->e = a->e * b->e;\n\tarb->u = a->u * b->u;\n\t\n\t// Currently all contacts will have the same normal.\n\t// This may change in the future.\n\tcpVect n = (numContacts ? contacts[0].n : cpvzero);\n\tcpVect surface_vr = cpvsub(a->surface_v, b->surface_v);\n\tarb->surface_vr = cpvsub(surface_vr, cpvmult(n, cpvdot(surface_vr, n)));\n\t\n\t// For collisions between two similar primitive types, the order could have been swapped.\n\tarb->a = a; arb->body_a = a->body;\n\tarb->b = b; arb->body_b = b->body;\n\t\n\t// mark it as new if it's been cached\n\tif(arb->state == cpArbiterStateCached) arb->state = cpArbiterStateFirstColl;\n}\n\nvoid\ncpArbiterPreStep(cpArbiter *arb, cpFloat dt, cpFloat slop, cpFloat bias)\n{\n\tcpBody *a = arb->body_a;\n\tcpBody *b = arb->body_b;\n\t\n\tfor(int i=0; i<arb->numContacts; i++){\n\t\tcpContact *con = &arb->contacts[i];\n\t\t\n\t\t// Calculate the offsets.\n\t\tcon->r1 = cpvsub(con->p, a->p);\n\t\tcon->r2 = cpvsub(con->p, b->p);\n\t\t\n\t\t// Calculate the mass normal and mass tangent.\n\t\tcon->nMass = 1.0f/k_scalar(a, b, con->r1, con->r2, con->n);\n\t\tcon->tMass = 1.0f/k_scalar(a, b, con->r1, con->r2, cpvperp(con->n));\n\t\t\t\t\n\t\t// Calculate the target bias velocity.\n\t\tcon->bias = -bias*cpfmin(0.0f, con->dist + slop)/dt;\n\t\tcon->jBias = 0.0f;\n\t\t\n\t\t// Calculate the target bounce velocity.\n\t\tcon->bounce = normal_relative_velocity(a, b, con->r1, con->r2, con->n)*arb->e;\n\t}\n}\n\nvoid\ncpArbiterApplyCachedImpulse(cpArbiter *arb, cpFloat dt_coef)\n{\n\tif(cpArbiterIsFirstContact(arb)) return;\n\t\n\tcpBody *a = arb->body_a;\n\tcpBody *b = arb->body_b;\n\t\n\tfor(int i=0; i<arb->numContacts; i++){\n\t\tcpContact *con = &arb->contacts[i];\n\t\tcpVect j = cpvrotate(con->n, cpv(con->jnAcc, con->jtAcc));\n\t\tapply_impulses(a, b, con->r1, con->r2, cpvmult(j, dt_coef));\n\t}\n}\n\n// TODO is it worth splitting velocity/position correction?\n\nvoid\ncpArbiterApplyImpulse(cpArbiter *arb)\n{\n\tcpBody *a = arb->body_a;\n\tcpBody *b = arb->body_b;\n\tcpVect surface_vr = arb->surface_vr;\n\tcpFloat friction = arb->u;\n\n\tfor(int i=0; i<arb->numContacts; i++){\n\t\tcpContact *con = &arb->contacts[i];\n\t\tcpFloat nMass = con->nMass;\n\t\tcpVect n = con->n;\n\t\tcpVect r1 = con->r1;\n\t\tcpVect r2 = con->r2;\n\t\t\n\t\tcpVect vb1 = cpvadd(a->v_bias, cpvmult(cpvperp(r1), a->w_bias));\n\t\tcpVect vb2 = cpvadd(b->v_bias, cpvmult(cpvperp(r2), b->w_bias));\n\t\tcpVect vr = cpvadd(relative_velocity(a, b, r1, r2), surface_vr);\n\t\t\n\t\tcpFloat vbn = cpvdot(cpvsub(vb2, vb1), n);\n\t\tcpFloat vrn = cpvdot(vr, n);\n\t\tcpFloat vrt = cpvdot(vr, cpvperp(n));\n\t\t\n\t\tcpFloat jbn = (con->bias - vbn)*nMass;\n\t\tcpFloat jbnOld = con->jBias;\n\t\tcon->jBias = cpfmax(jbnOld + jbn, 0.0f);\n\t\t\n\t\tcpFloat jn = -(con->bounce + vrn)*nMass;\n\t\tcpFloat jnOld = con->jnAcc;\n\t\tcon->jnAcc = cpfmax(jnOld + jn, 0.0f);\n\t\t\n\t\tcpFloat jtMax = friction*con->jnAcc;\n\t\tcpFloat jt = -vrt*con->tMass;\n\t\tcpFloat jtOld = con->jtAcc;\n\t\tcon->jtAcc = cpfclamp(jtOld + jt, -jtMax, jtMax);\n\t\t\n\t\tapply_bias_impulses(a, b, r1, r2, cpvmult(n, con->jBias - jbnOld));\n\t\tapply_impulses(a, b, r1, r2, cpvrotate(n, cpv(con->jnAcc - jnOld, con->jtAcc - jtOld)));\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpArray.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include <string.h>\n\n#include \"chipmunk_private.h\"\n\n\ncpArray *\ncpArrayNew(int size)\n{\n\tcpArray *arr = (cpArray *)cpcalloc(1, sizeof(cpArray));\n\t\n\tarr->num = 0;\n\tarr->max = (size ? size : 4);\n\tarr->arr = (void **)cpcalloc(arr->max, sizeof(void**));\n\t\n\treturn arr;\n}\n\nvoid\ncpArrayFree(cpArray *arr)\n{\n\tif(arr){\n\t\tcpfree(arr->arr);\n\t\tarr->arr = NULL;\n\t\t\n\t\tcpfree(arr);\n\t}\n}\n\nvoid\ncpArrayPush(cpArray *arr, void *object)\n{\n\tif(arr->num == arr->max){\n\t\tarr->max *= 2;\n\t\tarr->arr = (void **)cprealloc(arr->arr, arr->max*sizeof(void**));\n\t}\n\t\n\tarr->arr[arr->num] = object;\n\tarr->num++;\n}\n\nvoid *\ncpArrayPop(cpArray *arr)\n{\n\tarr->num--;\n\t\n\tvoid *value = arr->arr[arr->num];\n\tarr->arr[arr->num] = NULL;\n\t\n\treturn value;\n}\n\n//static void\n//cpArrayDeleteIndex(cpArray *arr, int idx)\n//{\n//\tarr->num--;\n//\t\n//\tarr->arr[idx] = arr->arr[arr->num];\n//\tarr->arr[arr->num] = NULL;\n//}\n\nvoid\ncpArrayDeleteObj(cpArray *arr, void *obj)\n{\n\tfor(int i=0; i<arr->num; i++){\n\t\tif(arr->arr[i] == obj){\n\t\t\tarr->num--;\n\t\t\t\n\t\t\tarr->arr[i] = arr->arr[arr->num];\n\t\t\tarr->arr[arr->num] = NULL;\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t}\n}\n\n//void\n//cpArrayAppend(cpArray *arr, cpArray *other)\n//{\n//\tvoid *tail = &arr->arr[arr->num];\n//\t\n//\tarr->num += other->num;\n//\tif(arr->num >= arr->max){\n//\t\tarr->max = arr->num;\n//\t\tarr->arr = (void **)cprealloc(arr->arr, arr->max*sizeof(void**));\n//\t}\n//\t\n//\tmemcpy(tail, other->arr, other->num*sizeof(void**));\n//}\n\nvoid\ncpArrayFreeEach(cpArray *arr, void (freeFunc)(void*))\n{\n\tfor(int i=0; i<arr->num; i++) freeFunc(arr->arr[i]);\n}\n\ncpBool\ncpArrayContains(cpArray *arr, void *ptr)\n{\n\tfor(int i=0; i<arr->num; i++)\n\t\tif(arr->arr[i] == ptr) return cpTrue;\n\t\n\treturn cpFalse;\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpBB.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include \"chipmunk_private.h\"\n\ncpVect\ncpBBWrapVect(const cpBB bb, const cpVect v)\n{\n\tcpFloat ix = cpfabs(bb.r - bb.l);\n\tcpFloat modx = cpfmod(v.x - bb.l, ix);\n\tcpFloat x = (modx > 0.0f) ? modx : modx + ix;\n\t\n\tcpFloat iy = cpfabs(bb.t - bb.b);\n\tcpFloat mody = cpfmod(v.y - bb.b, iy);\n\tcpFloat y = (mody > 0.0f) ? mody : mody + iy;\n\t\n\treturn cpv(x + bb.l, y + bb.b);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpBBTree.c",
    "content": "/* Copyright (c) 2009 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"stdlib.h\"\n#include \"stdio.h\"\n\n#include \"chipmunk_private.h\"\n\nstatic inline cpSpatialIndexClass *Klass();\n\ntypedef struct Node Node;\ntypedef struct Pair Pair;\n\nstruct cpBBTree {\n\tcpSpatialIndex spatialIndex;\n\tcpBBTreeVelocityFunc velocityFunc;\n\t\n\tcpHashSet *leaves;\n\tNode *root;\n\t\n\tNode *pooledNodes;\n\tPair *pooledPairs;\n\tcpArray *allocatedBuffers;\n\t\n\tcpTimestamp stamp;\n};\n\nstruct Node {\n\tvoid *obj;\n\tcpBB bb;\n\tNode *parent;\n\t\n\tunion {\n\t\t// Internal nodes\n\t\tstruct { Node *a, *b; } children;\n\t\t\n\t\t// Leaves\n\t\tstruct {\n\t\t\tcpTimestamp stamp;\n\t\t\tPair *pairs;\n\t\t} leaf;\n\t} node;\n};\n\n// Can't use anonymous unions and still get good x-compiler compatability\n#define A node.children.a\n#define B node.children.b\n#define STAMP node.leaf.stamp\n#define PAIRS node.leaf.pairs\n\ntypedef struct Thread {\n\tPair *prev;\n\tNode *leaf;\n\tPair *next;\n} Thread;\n\nstruct Pair { Thread a, b; };\n\n//MARK: Misc Functions\n\nstatic inline cpBB\nGetBB(cpBBTree *tree, void *obj)\n{\n\tcpBB bb = tree->spatialIndex.bbfunc(obj);\n\t\n\tcpBBTreeVelocityFunc velocityFunc = tree->velocityFunc;\n\tif(velocityFunc){\n\t\tcpFloat coef = 0.1f;\n\t\tcpFloat x = (bb.r - bb.l)*coef;\n\t\tcpFloat y = (bb.t - bb.b)*coef;\n\t\t\n\t\tcpVect v = cpvmult(velocityFunc(obj), 0.1f);\n\t\treturn cpBBNew(bb.l + cpfmin(-x, v.x), bb.b + cpfmin(-y, v.y), bb.r + cpfmax(x, v.x), bb.t + cpfmax(y, v.y));\n\t} else {\n\t\treturn bb;\n\t}\n}\n\nstatic inline cpBBTree *\nGetTree(cpSpatialIndex *index)\n{\n\treturn (index && index->klass == Klass() ? (cpBBTree *)index : NULL);\n}\n\nstatic inline Node *\nGetRootIfTree(cpSpatialIndex *index){\n\treturn (index && index->klass == Klass() ? ((cpBBTree *)index)->root : NULL);\n}\n\nstatic inline cpBBTree *\nGetMasterTree(cpBBTree *tree)\n{\n\tcpBBTree *dynamicTree = GetTree(tree->spatialIndex.dynamicIndex);\n\treturn (dynamicTree ? dynamicTree : tree);\n}\n\nstatic inline void\nIncrementStamp(cpBBTree *tree)\n{\n\tcpBBTree *dynamicTree = GetTree(tree->spatialIndex.dynamicIndex);\n\tif(dynamicTree){\n\t\tdynamicTree->stamp++;\n\t} else {\n\t\ttree->stamp++;\n\t}\n}\n\n//MARK: Pair/Thread Functions\n\nstatic void\nPairRecycle(cpBBTree *tree, Pair *pair)\n{\n\t// Share the pool of the master tree.\n\t// TODO would be lovely to move the pairs stuff into an external data structure.\n\ttree = GetMasterTree(tree);\n\t\n\tpair->a.next = tree->pooledPairs;\n\ttree->pooledPairs = pair;\n}\n\nstatic Pair *\nPairFromPool(cpBBTree *tree)\n{\n\t// Share the pool of the master tree.\n\t// TODO would be lovely to move the pairs stuff into an external data structure.\n\ttree = GetMasterTree(tree);\n\t\n\tPair *pair = tree->pooledPairs;\n\t\n\tif(pair){\n\t\ttree->pooledPairs = pair->a.next;\n\t\treturn pair;\n\t} else {\n\t\t// Pool is exhausted, make more\n\t\tint count = CP_BUFFER_BYTES/sizeof(Pair);\n\t\tcpAssertHard(count, \"Internal Error: Buffer size is too small.\");\n\t\t\n\t\tPair *buffer = (Pair *)cpcalloc(1, CP_BUFFER_BYTES);\n\t\tcpArrayPush(tree->allocatedBuffers, buffer);\n\t\t\n\t\t// push all but the first one, return the first instead\n\t\tfor(int i=1; i<count; i++) PairRecycle(tree, buffer + i);\n\t\treturn buffer;\n\t}\n}\n\nstatic inline void\nThreadUnlink(Thread thread)\n{\n\tPair *next = thread.next;\n\tPair *prev = thread.prev;\n\t\n\tif(next){\n\t\tif(next->a.leaf == thread.leaf) next->a.prev = prev; else next->b.prev = prev;\n\t}\n\t\n\tif(prev){\n\t\tif(prev->a.leaf == thread.leaf) prev->a.next = next; else prev->b.next = next;\n\t} else {\n\t\tthread.leaf->PAIRS = next;\n\t}\n}\n\nstatic void\nPairsClear(Node *leaf, cpBBTree *tree)\n{\n\tPair *pair = leaf->PAIRS;\n\tleaf->PAIRS = NULL;\n\t\n\twhile(pair){\n\t\tif(pair->a.leaf == leaf){\n\t\t\tPair *next = pair->a.next;\n\t\t\tThreadUnlink(pair->b);\n\t\t\tPairRecycle(tree, pair);\n\t\t\tpair = next;\n\t\t} else {\n\t\t\tPair *next = pair->b.next;\n\t\t\tThreadUnlink(pair->a);\n\t\t\tPairRecycle(tree, pair);\n\t\t\tpair = next;\n\t\t}\n\t}\n}\n\nstatic void\nPairInsert(Node *a, Node *b, cpBBTree *tree)\n{\n\tPair *nextA = a->PAIRS, *nextB = b->PAIRS;\n\tPair *pair = PairFromPool(tree);\n\tPair temp = {{NULL, a, nextA},{NULL, b, nextB}};\n\t\n\ta->PAIRS = b->PAIRS = pair;\n\t*pair = temp;\n\t\n\tif(nextA){\n\t\tif(nextA->a.leaf == a) nextA->a.prev = pair; else nextA->b.prev = pair;\n\t}\n\t\n\tif(nextB){\n\t\tif(nextB->a.leaf == b) nextB->a.prev = pair; else nextB->b.prev = pair;\n\t}\n}\n\n\n//MARK: Node Functions\n\nstatic void\nNodeRecycle(cpBBTree *tree, Node *node)\n{\n\tnode->parent = tree->pooledNodes;\n\ttree->pooledNodes = node;\n}\n\nstatic Node *\nNodeFromPool(cpBBTree *tree)\n{\n\tNode *node = tree->pooledNodes;\n\t\n\tif(node){\n\t\ttree->pooledNodes = node->parent;\n\t\treturn node;\n\t} else {\n\t\t// Pool is exhausted, make more\n\t\tint count = CP_BUFFER_BYTES/sizeof(Node);\n\t\tcpAssertHard(count, \"Internal Error: Buffer size is too small.\");\n\t\t\n\t\tNode *buffer = (Node *)cpcalloc(1, CP_BUFFER_BYTES);\n\t\tcpArrayPush(tree->allocatedBuffers, buffer);\n\t\t\n\t\t// push all but the first one, return the first instead\n\t\tfor(int i=1; i<count; i++) NodeRecycle(tree, buffer + i);\n\t\treturn buffer;\n\t}\n}\n\nstatic inline void\nNodeSetA(Node *node, Node *value)\n{\n\tnode->A = value;\n\tvalue->parent = node;\n}\n\nstatic inline void\nNodeSetB(Node *node, Node *value)\n{\n\tnode->B = value;\n\tvalue->parent = node;\n}\n\nstatic Node *\nNodeNew(cpBBTree *tree, Node *a, Node *b)\n{\n\tNode *node = NodeFromPool(tree);\n\t\n\tnode->obj = NULL;\n\tnode->bb = cpBBMerge(a->bb, b->bb);\n\tnode->parent = NULL;\n\t\n\tNodeSetA(node, a);\n\tNodeSetB(node, b);\n\t\n\treturn node;\n}\n\nstatic inline cpBool\nNodeIsLeaf(Node *node)\n{\n\treturn (node->obj != NULL);\n}\n\nstatic inline Node *\nNodeOther(Node *node, Node *child)\n{\n\treturn (node->A == child ? node->B : node->A);\n}\n\nstatic inline void\nNodeReplaceChild(Node *parent, Node *child, Node *value, cpBBTree *tree)\n{\n\tcpAssertSoft(!NodeIsLeaf(parent), \"Internal Error: Cannot replace child of a leaf.\");\n\tcpAssertSoft(child == parent->A || child == parent->B, \"Internal Error: Node is not a child of parent.\");\n\t\n\tif(parent->A == child){\n\t\tNodeRecycle(tree, parent->A);\n\t\tNodeSetA(parent, value);\n\t} else {\n\t\tNodeRecycle(tree, parent->B);\n\t\tNodeSetB(parent, value);\n\t}\n\t\n\tfor(Node *node=parent; node; node = node->parent){\n\t\tnode->bb = cpBBMerge(node->A->bb, node->B->bb);\n\t}\n}\n\n//MARK: Subtree Functions\n\nstatic inline cpFloat\ncpBBProximity(cpBB a, cpBB b)\n{\n\treturn cpfabs(a.l + a.r - b.l - b.r) + cpfabs(a.b + a.t - b.b - b.t);\n}\n\nstatic Node *\nSubtreeInsert(Node *subtree, Node *leaf, cpBBTree *tree)\n{\n\tif(subtree == NULL){\n\t\treturn leaf;\n\t} else if(NodeIsLeaf(subtree)){\n\t\treturn NodeNew(tree, leaf, subtree);\n\t} else {\n\t\tcpFloat cost_a = cpBBArea(subtree->B->bb) + cpBBMergedArea(subtree->A->bb, leaf->bb);\n\t\tcpFloat cost_b = cpBBArea(subtree->A->bb) + cpBBMergedArea(subtree->B->bb, leaf->bb);\n\t\t\n\t\tif(cost_a == cost_b){\n\t\t\tcost_a = cpBBProximity(subtree->A->bb, leaf->bb);\n\t\t\tcost_b = cpBBProximity(subtree->B->bb, leaf->bb);\n\t\t}\n\t\t\n\t\tif(cost_b < cost_a){\n\t\t\tNodeSetB(subtree, SubtreeInsert(subtree->B, leaf, tree));\n\t\t} else {\n\t\t\tNodeSetA(subtree, SubtreeInsert(subtree->A, leaf, tree));\n\t\t}\n\t\t\n\t\tsubtree->bb = cpBBMerge(subtree->bb, leaf->bb);\n\t\treturn subtree;\n\t}\n}\n\nstatic void\nSubtreeQuery(Node *subtree, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data)\n{\n\tif(cpBBIntersects(subtree->bb, bb)){\n\t\tif(NodeIsLeaf(subtree)){\n\t\t\tfunc(obj, subtree->obj, data);\n\t\t} else {\n\t\t\tSubtreeQuery(subtree->A, obj, bb, func, data);\n\t\t\tSubtreeQuery(subtree->B, obj, bb, func, data);\n\t\t}\n\t}\n}\n\n\nstatic cpFloat\nSubtreeSegmentQuery(Node *subtree, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data)\n{\n\tif(NodeIsLeaf(subtree)){\n\t\treturn func(obj, subtree->obj, data);\n\t} else {\n\t\tcpFloat t_a = cpBBSegmentQuery(subtree->A->bb, a, b);\n\t\tcpFloat t_b = cpBBSegmentQuery(subtree->B->bb, a, b);\n\t\t\n\t\tif(t_a < t_b){\n\t\t\tif(t_a < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->A, obj, a, b, t_exit, func, data));\n\t\t\tif(t_b < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->B, obj, a, b, t_exit, func, data));\n\t\t} else {\n\t\t\tif(t_b < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->B, obj, a, b, t_exit, func, data));\n\t\t\tif(t_a < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->A, obj, a, b, t_exit, func, data));\n\t\t}\n\t\t\n\t\treturn t_exit;\n\t}\n}\n\nstatic void\nSubtreeRecycle(cpBBTree *tree, Node *node)\n{\n\tif(!NodeIsLeaf(node)){\n\t\tSubtreeRecycle(tree, node->A);\n\t\tSubtreeRecycle(tree, node->B);\n\t\tNodeRecycle(tree, node);\n\t}\n}\n\nstatic inline Node *\nSubtreeRemove(Node *subtree, Node *leaf, cpBBTree *tree)\n{\n\tif(leaf == subtree){\n\t\treturn NULL;\n\t} else {\n\t\tNode *parent = leaf->parent;\n\t\tif(parent == subtree){\n\t\t\tNode *other = NodeOther(subtree, leaf);\n\t\t\tother->parent = subtree->parent;\n\t\t\tNodeRecycle(tree, subtree);\n\t\t\treturn other;\n\t\t} else {\n\t\t\tNodeReplaceChild(parent->parent, parent, NodeOther(parent, leaf), tree);\n\t\t\treturn subtree;\n\t\t}\n\t}\n}\n\n//MARK: Marking Functions\n\ntypedef struct MarkContext {\n\tcpBBTree *tree;\n\tNode *staticRoot;\n\tcpSpatialIndexQueryFunc func;\n\tvoid *data;\n} MarkContext;\n\nstatic void\nMarkLeafQuery(Node *subtree, Node *leaf, cpBool left, MarkContext *context)\n{\n\tif(cpBBIntersects(leaf->bb, subtree->bb)){\n\t\tif(NodeIsLeaf(subtree)){\n\t\t\tif(left){\n\t\t\t\tPairInsert(leaf, subtree, context->tree);\n\t\t\t} else {\n\t\t\t\tif(subtree->STAMP < leaf->STAMP) PairInsert(subtree, leaf, context->tree);\n\t\t\t\tcontext->func(leaf->obj, subtree->obj, context->data);\n\t\t\t}\n\t\t} else {\n\t\t\tMarkLeafQuery(subtree->A, leaf, left, context);\n\t\t\tMarkLeafQuery(subtree->B, leaf, left, context);\n\t\t}\n\t}\n}\n\nstatic void\nMarkLeaf(Node *leaf, MarkContext *context)\n{\n\tcpBBTree *tree = context->tree;\n\tif(leaf->STAMP == GetMasterTree(tree)->stamp){\n\t\tNode *staticRoot = context->staticRoot;\n\t\tif(staticRoot) MarkLeafQuery(staticRoot, leaf, cpFalse, context);\n\t\t\n\t\tfor(Node *node = leaf; node->parent; node = node->parent){\n\t\t\tif(node == node->parent->A){\n\t\t\t\tMarkLeafQuery(node->parent->B, leaf, cpTrue, context);\n\t\t\t} else {\n\t\t\t\tMarkLeafQuery(node->parent->A, leaf, cpFalse, context);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tPair *pair = leaf->PAIRS;\n\t\twhile(pair){\n\t\t\tif(leaf == pair->b.leaf){\n\t\t\t\tcontext->func(pair->a.leaf->obj, leaf->obj, context->data);\n\t\t\t\tpair = pair->b.next;\n\t\t\t} else {\n\t\t\t\tpair = pair->a.next;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void\nMarkSubtree(Node *subtree, MarkContext *context)\n{\n\tif(NodeIsLeaf(subtree)){\n\t\tMarkLeaf(subtree, context);\n\t} else {\n\t\tMarkSubtree(subtree->A, context);\n\t\tMarkSubtree(subtree->B, context);\n\t}\n}\n\n//MARK: Leaf Functions\n\nstatic Node *\nLeafNew(cpBBTree *tree, void *obj, cpBB bb)\n{\n\tNode *node = NodeFromPool(tree);\n\tnode->obj = obj;\n\tnode->bb = GetBB(tree, obj);\n\t\n\tnode->parent = NULL;\n\tnode->STAMP = 0;\n\tnode->PAIRS = NULL;\n\t\n\treturn node;\n}\n\nstatic cpBool\nLeafUpdate(Node *leaf, cpBBTree *tree)\n{\n\tNode *root = tree->root;\n\tcpBB bb = tree->spatialIndex.bbfunc(leaf->obj);\n\t\n\tif(!cpBBContainsBB(leaf->bb, bb)){\n\t\tleaf->bb = GetBB(tree, leaf->obj);\n\t\t\n\t\troot = SubtreeRemove(root, leaf, tree);\n\t\ttree->root = SubtreeInsert(root, leaf, tree);\n\t\t\n\t\tPairsClear(leaf, tree);\n\t\tleaf->STAMP = GetMasterTree(tree)->stamp;\n\t\t\n\t\treturn cpTrue;\n\t}\n\t\n\treturn cpFalse;\n}\n\nstatic void VoidQueryFunc(void *obj1, void *obj2, void *data){}\n\nstatic void\nLeafAddPairs(Node *leaf, cpBBTree *tree)\n{\n\tcpSpatialIndex *dynamicIndex = tree->spatialIndex.dynamicIndex;\n\tif(dynamicIndex){\n\t\tNode *dynamicRoot = GetRootIfTree(dynamicIndex);\n\t\tif(dynamicRoot){\n\t\t\tcpBBTree *dynamicTree = GetTree(dynamicIndex);\n\t\t\tMarkContext context = {dynamicTree, NULL, NULL, NULL};\n\t\t\tMarkLeafQuery(dynamicRoot, leaf, cpTrue, &context);\n\t\t}\n\t} else {\n\t\tNode *staticRoot = GetRootIfTree(tree->spatialIndex.staticIndex);\n\t\tMarkContext context = {tree, staticRoot, VoidQueryFunc, NULL};\n\t\tMarkLeaf(leaf, &context);\n\t}\n}\n\n//MARK: Memory Management Functions\n\ncpBBTree *\ncpBBTreeAlloc(void)\n{\n\treturn (cpBBTree *)cpcalloc(1, sizeof(cpBBTree));\n}\n\nstatic int\nleafSetEql(void *obj, Node *node)\n{\n\treturn (obj == node->obj);\n}\n\nstatic void *\nleafSetTrans(void *obj, cpBBTree *tree)\n{\n\treturn LeafNew(tree, obj, tree->spatialIndex.bbfunc(obj));\n}\n\ncpSpatialIndex *\ncpBBTreeInit(cpBBTree *tree, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex)\n{\n\tcpSpatialIndexInit((cpSpatialIndex *)tree, Klass(), bbfunc, staticIndex);\n\t\n\ttree->velocityFunc = NULL;\n\t\n\ttree->leaves = cpHashSetNew(0, (cpHashSetEqlFunc)leafSetEql);\n\ttree->root = NULL;\n\t\n\ttree->pooledNodes = NULL;\n\ttree->allocatedBuffers = cpArrayNew(0);\n\t\n\ttree->stamp = 0;\n\t\n\treturn (cpSpatialIndex *)tree;\n}\n\nvoid\ncpBBTreeSetVelocityFunc(cpSpatialIndex *index, cpBBTreeVelocityFunc func)\n{\n\tif(index->klass != Klass()){\n\t\tcpAssertWarn(cpFalse, \"Ignoring cpBBTreeSetVelocityFunc() call to non-tree spatial index.\");\n\t\treturn;\n\t}\n\t\n\t((cpBBTree *)index)->velocityFunc = func;\n}\n\ncpSpatialIndex *\ncpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex)\n{\n\treturn cpBBTreeInit(cpBBTreeAlloc(), bbfunc, staticIndex);\n}\n\nstatic void\ncpBBTreeDestroy(cpBBTree *tree)\n{\n\tcpHashSetFree(tree->leaves);\n\t\n\tif(tree->allocatedBuffers) cpArrayFreeEach(tree->allocatedBuffers, cpfree);\n\tcpArrayFree(tree->allocatedBuffers);\n}\n\n//MARK: Insert/Remove\n\nstatic void\ncpBBTreeInsert(cpBBTree *tree, void *obj, cpHashValue hashid)\n{\n\tNode *leaf = (Node *)cpHashSetInsert(tree->leaves, hashid, obj, tree, (cpHashSetTransFunc)leafSetTrans);\n\t\n\tNode *root = tree->root;\n\ttree->root = SubtreeInsert(root, leaf, tree);\n\t\n\tleaf->STAMP = GetMasterTree(tree)->stamp;\n\tLeafAddPairs(leaf, tree);\n\tIncrementStamp(tree);\n}\n\nstatic void\ncpBBTreeRemove(cpBBTree *tree, void *obj, cpHashValue hashid)\n{\n\tNode *leaf = (Node *)cpHashSetRemove(tree->leaves, hashid, obj);\n\t\n\ttree->root = SubtreeRemove(tree->root, leaf, tree);\n\tPairsClear(leaf, tree);\n\tNodeRecycle(tree, leaf);\n}\n\nstatic cpBool\ncpBBTreeContains(cpBBTree *tree, void *obj, cpHashValue hashid)\n{\n\treturn (cpHashSetFind(tree->leaves, hashid, obj) != NULL);\n}\n\n//MARK: Reindex\n\nstatic void\ncpBBTreeReindexQuery(cpBBTree *tree, cpSpatialIndexQueryFunc func, void *data)\n{\n\tif(!tree->root) return;\n\t\n\t// LeafUpdate() may modify tree->root. Don't cache it.\n\tcpHashSetEach(tree->leaves, (cpHashSetIteratorFunc)LeafUpdate, tree);\n\t\n\tcpSpatialIndex *staticIndex = tree->spatialIndex.staticIndex;\n\tNode *staticRoot = (staticIndex && staticIndex->klass == Klass() ? ((cpBBTree *)staticIndex)->root : NULL);\n\t\n\tMarkContext context = {tree, staticRoot, func, data};\n\tMarkSubtree(tree->root, &context);\n\tif(staticIndex && !staticRoot) cpSpatialIndexCollideStatic((cpSpatialIndex *)tree, staticIndex, func, data);\n\t\n\tIncrementStamp(tree);\n}\n\nstatic void\ncpBBTreeReindex(cpBBTree *tree)\n{\n\tcpBBTreeReindexQuery(tree, VoidQueryFunc, NULL);\n}\n\nstatic void\ncpBBTreeReindexObject(cpBBTree *tree, void *obj, cpHashValue hashid)\n{\n\tNode *leaf = (Node *)cpHashSetFind(tree->leaves, hashid, obj);\n\tif(leaf){\n\t\tif(LeafUpdate(leaf, tree)) LeafAddPairs(leaf, tree);\n\t\tIncrementStamp(tree);\n\t}\n}\n\n//MARK: Query\n\nstatic void\ncpBBTreeSegmentQuery(cpBBTree *tree, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data)\n{\n\tNode *root = tree->root;\n\tif(root) SubtreeSegmentQuery(root, obj, a, b, t_exit, func, data);\n}\n\nstatic void\ncpBBTreeQuery(cpBBTree *tree, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data)\n{\n\tif(tree->root) SubtreeQuery(tree->root, obj, bb, func, data);\n}\n\n//MARK: Misc\n\nstatic int\ncpBBTreeCount(cpBBTree *tree)\n{\n\treturn cpHashSetCount(tree->leaves);\n}\n\ntypedef struct eachContext {\n\tcpSpatialIndexIteratorFunc func;\n\tvoid *data;\n} eachContext;\n\nstatic void each_helper(Node *node, eachContext *context){context->func(node->obj, context->data);}\n\nstatic void\ncpBBTreeEach(cpBBTree *tree, cpSpatialIndexIteratorFunc func, void *data)\n{\n\teachContext context = {func, data};\n\tcpHashSetEach(tree->leaves, (cpHashSetIteratorFunc)each_helper, &context);\n}\n\nstatic cpSpatialIndexClass klass = {\n\t(cpSpatialIndexDestroyImpl)cpBBTreeDestroy,\n\t\n\t(cpSpatialIndexCountImpl)cpBBTreeCount,\n\t(cpSpatialIndexEachImpl)cpBBTreeEach,\n\t\n\t(cpSpatialIndexContainsImpl)cpBBTreeContains,\n\t(cpSpatialIndexInsertImpl)cpBBTreeInsert,\n\t(cpSpatialIndexRemoveImpl)cpBBTreeRemove,\n\t\n\t(cpSpatialIndexReindexImpl)cpBBTreeReindex,\n\t(cpSpatialIndexReindexObjectImpl)cpBBTreeReindexObject,\n\t(cpSpatialIndexReindexQueryImpl)cpBBTreeReindexQuery,\n\t\n\t(cpSpatialIndexQueryImpl)cpBBTreeQuery,\n\t(cpSpatialIndexSegmentQueryImpl)cpBBTreeSegmentQuery,\n};\n\nstatic inline cpSpatialIndexClass *Klass(){return &klass;}\n\n\n//MARK: Tree Optimization\n\nstatic int\ncpfcompare(const cpFloat *a, const cpFloat *b){\n\treturn (*a < *b ? -1 : (*b < *a ? 1 : 0));\n}\n\nstatic void\nfillNodeArray(Node *node, Node ***cursor){\n\t(**cursor) = node;\n\t(*cursor)++;\n}\n\nstatic Node *\npartitionNodes(cpBBTree *tree, Node **nodes, int count)\n{\n\tif(count == 1){\n\t\treturn nodes[0];\n\t} else if(count == 2) {\n\t\treturn NodeNew(tree, nodes[0], nodes[1]);\n\t}\n\t\n\t// Find the AABB for these nodes\n\tcpBB bb = nodes[0]->bb;\n\tfor(int i=1; i<count; i++) bb = cpBBMerge(bb, nodes[i]->bb);\n\t\n\t// Split it on it's longest axis\n\tcpBool splitWidth = (bb.r - bb.l > bb.t - bb.b);\n\t\n\t// Sort the bounds and use the median as the splitting point\n\tcpFloat *bounds = (cpFloat *)cpcalloc(count*2, sizeof(cpFloat));\n\tif(splitWidth){\n\t\tfor(int i=0; i<count; i++){\n\t\t\tbounds[2*i + 0] = nodes[i]->bb.l;\n\t\t\tbounds[2*i + 1] = nodes[i]->bb.r;\n\t\t}\n\t} else {\n\t\tfor(int i=0; i<count; i++){\n\t\t\tbounds[2*i + 0] = nodes[i]->bb.b;\n\t\t\tbounds[2*i + 1] = nodes[i]->bb.t;\n\t\t}\n\t}\n\t\n\tqsort(bounds, count*2, sizeof(cpFloat), (int (*)(const void *, const void *))cpfcompare);\n\tcpFloat split = (bounds[count - 1] + bounds[count])*0.5f; // use the medain as the split\n\tcpfree(bounds);\n\n\t// Generate the child BBs\n\tcpBB a = bb, b = bb;\n\tif(splitWidth) a.r = b.l = split; else a.t = b.b = split;\n\t\n\t// Partition the nodes\n\tint right = count;\n\tfor(int left=0; left < right;){\n\t\tNode *node = nodes[left];\n\t\tif(cpBBMergedArea(node->bb, b) < cpBBMergedArea(node->bb, a)){\n//\t\tif(cpBBProximity(node->bb, b) < cpBBProximity(node->bb, a)){\n\t\t\tright--;\n\t\t\tnodes[left] = nodes[right];\n\t\t\tnodes[right] = node;\n\t\t} else {\n\t\t\tleft++;\n\t\t}\n\t}\n\t\n\tif(right == count){\n\t\tNode *node = NULL;\n\t\tfor(int i=0; i<count; i++) node = SubtreeInsert(node, nodes[i], tree);\n\t\treturn node;\n\t}\n\t\n\t// Recurse and build the node!\n\treturn NodeNew(tree,\n\t\tpartitionNodes(tree, nodes, right),\n\t\tpartitionNodes(tree, nodes + right, count - right)\n\t);\n}\n\n//static void\n//cpBBTreeOptimizeIncremental(cpBBTree *tree, int passes)\n//{\n//\tfor(int i=0; i<passes; i++){\n//\t\tNode *root = tree->root;\n//\t\tNode *node = root;\n//\t\tint bit = 0;\n//\t\tunsigned int path = tree->opath;\n//\t\t\n//\t\twhile(!NodeIsLeaf(node)){\n//\t\t\tnode = (path&(1<<bit) ? node->a : node->b);\n//\t\t\tbit = (bit + 1)&(sizeof(unsigned int)*8 - 1);\n//\t\t}\n//\t\t\n//\t\troot = subtreeRemove(root, node, tree);\n//\t\ttree->root = subtreeInsert(root, node, tree);\n//\t}\n//}\n\nvoid\ncpBBTreeOptimize(cpSpatialIndex *index)\n{\n\tif(index->klass != &klass){\n\t\tcpAssertWarn(cpFalse, \"Ignoring cpBBTreeOptimize() call to non-tree spatial index.\");\n\t\treturn;\n\t}\n\t\n\tcpBBTree *tree = (cpBBTree *)index;\n\tNode *root = tree->root;\n\tif(!root) return;\n\t\n\tint count = cpBBTreeCount(tree);\n\tNode **nodes = (Node **)cpcalloc(count, sizeof(Node *));\n\tNode **cursor = nodes;\n\t\n\tcpHashSetEach(tree->leaves, (cpHashSetIteratorFunc)fillNodeArray, &cursor);\n\t\n\tSubtreeRecycle(tree, root);\n\ttree->root = partitionNodes(tree, nodes, count);\n\tcpfree(nodes);\n}\n\n//MARK: Debug Draw\n\n//#define CP_BBTREE_DEBUG_DRAW\n#ifdef CP_BBTREE_DEBUG_DRAW\n#include \"OpenGL/gl.h\"\n#include \"OpenGL/glu.h\"\n#include <GLUT/glut.h>\n\nstatic void\nNodeRender(Node *node, int depth)\n{\n\tif(!NodeIsLeaf(node) && depth <= 10){\n\t\tNodeRender(node->a, depth + 1);\n\t\tNodeRender(node->b, depth + 1);\n\t}\n\t\n\tcpBB bb = node->bb;\n\t\n//\tGLfloat v = depth/2.0f;\t\n//\tglColor3f(1.0f - v, v, 0.0f);\n\tglLineWidth(cpfmax(5.0f - depth, 1.0f));\n\tglBegin(GL_LINES); {\n\t\tglVertex2F(bb.l, bb.b);\n\t\tglVertex2F(bb.l, bb.t);\n\t\t\n\t\tglVertex2F(bb.l, bb.t);\n\t\tglVertex2F(bb.r, bb.t);\n\t\t\n\t\tglVertex2F(bb.r, bb.t);\n\t\tglVertex2F(bb.r, bb.b);\n\t\t\n\t\tglVertex2F(bb.r, bb.b);\n\t\tglVertex2F(bb.l, bb.b);\n\t}; glEnd();\n}\n\nvoid\ncpBBTreeRenderDebug(cpSpatialIndex *index){\n\tif(index->klass != &klass){\n\t\tcpAssertWarn(cpFalse, \"Ignoring cpBBTreeRenderDebug() call to non-tree spatial index.\");\n\t\treturn;\n\t}\n\t\n\tcpBBTree *tree = (cpBBTree *)index;\n\tif(tree->root) NodeRender(tree->root, 0);\n}\n#endif\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpBody.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include <float.h>\n\n#include \"chipmunk_private.h\"\n#include \"constraints/util.h\"\n\n// initialized in cpInitChipmunk()\ncpBody cpStaticBodySingleton;\n\ncpBody*\ncpBodyAlloc(void)\n{\n\treturn (cpBody *)cpcalloc(1, sizeof(cpBody));\n}\n\ncpBody *\ncpBodyInit(cpBody *body, cpFloat m, cpFloat i)\n{\n\tbody->space = NULL;\n\tbody->shapeList = NULL;\n\tbody->arbiterList = NULL;\n\tbody->constraintList = NULL;\n\t\n\tbody->velocity_func = cpBodyUpdateVelocity;\n\tbody->position_func = cpBodyUpdatePosition;\n\t\n\tcpComponentNode node = {NULL, NULL, 0.0f};\n\tbody->node = node;\n\t\n\tbody->p = cpvzero;\n\tbody->v = cpvzero;\n\tbody->f = cpvzero;\n\t\n\tbody->w = 0.0f;\n\tbody->t = 0.0f;\n\t\n\tbody->v_bias = cpvzero;\n\tbody->w_bias = 0.0f;\n\t\n\tbody->v_limit = (cpFloat)INFINITY;\n\tbody->w_limit = (cpFloat)INFINITY;\n\t\n\tbody->data = NULL;\n\t\n\t// Setters must be called after full initialization so the sanity checks don't assert on garbage data.\n\tcpBodySetMass(body, m);\n\tcpBodySetMoment(body, i);\n\tcpBodySetAngle(body, 0.0f);\n\t\n\treturn body;\n}\n\ncpBody*\ncpBodyNew(cpFloat m, cpFloat i)\n{\n\treturn cpBodyInit(cpBodyAlloc(), m, i);\n}\n\ncpBody *\ncpBodyInitStatic(cpBody *body)\n{\n\tcpBodyInit(body, (cpFloat)INFINITY, (cpFloat)INFINITY);\n\tbody->node.idleTime = (cpFloat)INFINITY;\n\t\n\treturn body;\n}\n\ncpBody *\ncpBodyNewStatic(void)\n{\n\treturn cpBodyInitStatic(cpBodyAlloc());\n}\n\nvoid cpBodyDestroy(cpBody *body){}\n\nvoid\ncpBodyFree(cpBody *body)\n{\n\tif(body){\n\t\tcpBodyDestroy(body);\n\t\tcpfree(body);\n\t}\n}\n\nstatic void cpv_assert_nan(cpVect v, char *message){cpAssertSoft(v.x == v.x && v.y == v.y, message);}\nstatic void cpv_assert_infinite(cpVect v, char *message){cpAssertSoft(cpfabs(v.x) != INFINITY && cpfabs(v.y) != INFINITY, message);}\nstatic void cpv_assert_sane(cpVect v, char *message){cpv_assert_nan(v, message); cpv_assert_infinite(v, message);}\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nvoid\ncpBodySanityCheck(cpBody *body)\n{\n\tcpAssertSoft(body->m == body->m && body->m_inv == body->m_inv, \"Body's mass is invalid.\");\n\tcpAssertSoft(body->i == body->i && body->i_inv == body->i_inv, \"Body's moment is invalid.\");\n\t\n\tcpv_assert_sane(body->p, \"Body's position is invalid.\");\n\tcpv_assert_sane(body->v, \"Body's velocity is invalid.\");\n\tcpv_assert_sane(body->f, \"Body's force is invalid.\");\n\n\tcpAssertSoft(body->a == body->a && cpfabs(body->a) != INFINITY, \"Body's angle is invalid.\");\n\tcpAssertSoft(body->w == body->w && cpfabs(body->w) != INFINITY, \"Body's angular velocity is invalid.\");\n\tcpAssertSoft(body->t == body->t && cpfabs(body->t) != INFINITY, \"Body's torque is invalid.\");\n\t\n\tcpv_assert_sane(body->rot, \"Body's rotation vector is invalid.\");\n\t\n\tcpAssertSoft(body->v_limit == body->v_limit, \"Body's velocity limit is invalid.\");\n\tcpAssertSoft(body->w_limit == body->w_limit, \"Body's angular velocity limit is invalid.\");\n}\n\n#ifdef __cplusplus\n}\n#endif\n\nvoid\ncpBodySetMass(cpBody *body, cpFloat mass)\n{\n\tcpAssertHard(mass > 0.0f, \"Mass must be positive and non-zero.\");\n\t\n\tcpBodyActivate(body);\n\tbody->m = mass;\n\tbody->m_inv = 1.0f/mass;\n\tcpBodyAssertSane(body);\n}\n\nvoid\ncpBodySetMoment(cpBody *body, cpFloat moment)\n{\n\tcpAssertHard(moment > 0.0f, \"Moment of Inertia must be positive and non-zero.\");\n\t\n\tcpBodyActivate(body);\n\tbody->i = moment;\n\tbody->i_inv = 1.0f/moment;\n\tcpBodyAssertSane(body);\n}\n\nvoid\ncpBodyAddShape(cpBody *body, cpShape *shape)\n{\n\tcpShape *next = body->shapeList;\n\tif(next) next->prev = shape;\n\t\n\tshape->next = next;\n\tbody->shapeList = shape;\n}\n\nvoid\ncpBodyRemoveShape(cpBody *body, cpShape *shape)\n{\n  cpShape *prev = shape->prev;\n  cpShape *next = shape->next;\n  \n  if(prev){\n\t\tprev->next = next;\n  } else {\n\t\tbody->shapeList = next;\n  }\n  \n  if(next){\n\t\tnext->prev = prev;\n\t}\n  \n  shape->prev = NULL;\n  shape->next = NULL;\n}\n\nstatic cpConstraint *\nfilterConstraints(cpConstraint *node, cpBody *body, cpConstraint *filter)\n{\n\tif(node == filter){\n\t\treturn cpConstraintNext(node, body);\n\t} else if(node->a == body){\n\t\tnode->next_a = filterConstraints(node->next_a, body, filter);\n\t} else {\n\t\tnode->next_b = filterConstraints(node->next_b, body, filter);\n\t}\n\t\n\treturn node;\n}\n\nvoid\ncpBodyRemoveConstraint(cpBody *body, cpConstraint *constraint)\n{\n\tbody->constraintList = filterConstraints(body->constraintList, body, constraint);\n}\n\nvoid\ncpBodySetPos(cpBody *body, cpVect pos)\n{\n\tcpBodyActivate(body);\n\tbody->p = pos;\n\tcpBodyAssertSane(body);\n}\n\nstatic inline void\nsetAngle(cpBody *body, cpFloat angle)\n{\n\tbody->a = angle;//fmod(a, (cpFloat)M_PI*2.0f);\n\tbody->rot = cpvforangle(angle);\n\tcpBodyAssertSane(body);\n}\n\nvoid\ncpBodySetAngle(cpBody *body, cpFloat angle)\n{\n\tcpBodyActivate(body);\n\tsetAngle(body, angle);\n}\n\nvoid\ncpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt)\n{\n\tbody->v = cpvclamp(cpvadd(cpvmult(body->v, damping), cpvmult(cpvadd(gravity, cpvmult(body->f, body->m_inv)), dt)), body->v_limit);\n\t\n\tcpFloat w_limit = body->w_limit;\n\tbody->w = cpfclamp(body->w*damping + body->t*body->i_inv*dt, -w_limit, w_limit);\n\t\n\tcpBodySanityCheck(body);\n}\n\nvoid\ncpBodyUpdatePosition(cpBody *body, cpFloat dt)\n{\n\tbody->p = cpvadd(body->p, cpvmult(cpvadd(body->v, body->v_bias), dt));\n\tsetAngle(body, body->a + (body->w + body->w_bias)*dt);\n\t\n\tbody->v_bias = cpvzero;\n\tbody->w_bias = 0.0f;\n\t\n\tcpBodySanityCheck(body);\n}\n\nvoid\ncpBodyResetForces(cpBody *body)\n{\n\tcpBodyActivate(body);\n\tbody->f = cpvzero;\n\tbody->t = 0.0f;\n}\n\nvoid\ncpBodyApplyForce(cpBody *body, cpVect force, cpVect r)\n{\n\tcpBodyActivate(body);\n\tbody->f = cpvadd(body->f, force);\n\tbody->t += cpvcross(r, force);\n}\n\nvoid\ncpBodyApplyImpulse(cpBody *body, const cpVect j, const cpVect r)\n{\n\tcpBodyActivate(body);\n\tapply_impulse(body, j, r);\n}\n\nstatic inline cpVect\ncpBodyGetVelAtPoint(cpBody *body, cpVect r)\n{\n\treturn cpvadd(body->v, cpvmult(cpvperp(r), body->w));\n}\n\ncpVect\ncpBodyGetVelAtWorldPoint(cpBody *body, cpVect point)\n{\n\treturn cpBodyGetVelAtPoint(body, cpvsub(point, body->p));\n}\n\ncpVect\ncpBodyGetVelAtLocalPoint(cpBody *body, cpVect point)\n{\n\treturn cpBodyGetVelAtPoint(body, cpvrotate(point, body->rot));\n}\n\nvoid\ncpBodyEachShape(cpBody *body, cpBodyShapeIteratorFunc func, void *data)\n{\n\tcpShape *shape = body->shapeList;\n\twhile(shape){\n\t\tcpShape *next = shape->next;\n\t\tfunc(body, shape, data);\n\t\tshape = next;\n\t}\n}\n\nvoid\ncpBodyEachConstraint(cpBody *body, cpBodyConstraintIteratorFunc func, void *data)\n{\n\tcpConstraint *constraint = body->constraintList;\n\twhile(constraint){\n\t\tcpConstraint *next = cpConstraintNext(constraint, body);\n\t\tfunc(body, constraint, data);\n\t\tconstraint = next;\n\t}\n}\n\nvoid\ncpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data)\n{\n\tcpArbiter *arb = body->arbiterList;\n\twhile(arb){\n\t\tcpArbiter *next = cpArbiterNext(arb, body);\n\t\t\n\t\tarb->swappedColl = (body == arb->body_b);\n\t\tfunc(body, arb, data);\n\t\t\n\t\tarb = next;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpCollision.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include \"chipmunk_private.h\"\n\ntypedef int (*collisionFunc)(const cpShape *, const cpShape *, cpContact *);\n\n// Add contact points for circle to circle collisions.\n// Used by several collision tests.\nstatic int\ncircle2circleQuery(const cpVect p1, const cpVect p2, const cpFloat r1, const cpFloat r2, cpContact *con)\n{\n\tcpFloat mindist = r1 + r2;\n\tcpVect delta = cpvsub(p2, p1);\n\tcpFloat distsq = cpvlengthsq(delta);\n\tif(distsq >= mindist*mindist) return 0;\n\t\n\tcpFloat dist = cpfsqrt(distsq);\n\n\t// Allocate and initialize the contact.\n\tcpContactInit(\n\t\tcon,\n\t\tcpvadd(p1, cpvmult(delta, 0.5f + (r1 - 0.5f*mindist)/(dist ? dist : INFINITY))),\n\t\t(dist ? cpvmult(delta, 1.0f/dist) : cpv(1.0f, 0.0f)),\n\t\tdist - mindist,\n\t\t0\n\t);\n\t\n\treturn 1;\n}\n\n// Collide circle shapes.\nstatic int\ncircle2circle(const cpShape *shape1, const cpShape *shape2, cpContact *arr)\n{\n\tcpCircleShape *circ1 = (cpCircleShape *)shape1; //TODO\n\tcpCircleShape *circ2 = (cpCircleShape *)shape2;\n\t\n\treturn circle2circleQuery(circ1->tc, circ2->tc, circ1->r, circ2->r, arr);\n}\n\nstatic int\ncircle2segment(const cpCircleShape *circleShape, const cpSegmentShape *segmentShape, cpContact *con)\n{\n\tcpVect seg_a = segmentShape->ta;\n\tcpVect seg_b = segmentShape->tb;\n\tcpVect center = circleShape->tc;\n\t\n\tcpVect seg_delta = cpvsub(seg_b, seg_a);\n\tcpFloat closest_t = cpfclamp01(cpvdot(seg_delta, cpvsub(center, seg_a))/cpvlengthsq(seg_delta));\n\tcpVect closest = cpvadd(seg_a, cpvmult(seg_delta, closest_t));\n\t\n\tif(circle2circleQuery(center, closest, circleShape->r, segmentShape->r, con)){\n\t\tcpVect n = con[0].n;\n\t\t\n\t\t// Reject endcap collisions if tangents are provided.\n\t\tif(\n\t\t\t(closest_t == 0.0f && cpvdot(n, segmentShape->a_tangent) < 0.0) ||\n\t\t\t(closest_t == 1.0f && cpvdot(n, segmentShape->b_tangent) < 0.0)\n\t\t) return 0;\n\t\t\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\n}\n\n// Helper function for working with contact buffers\n// This used to malloc/realloc memory on the fly but was repurposed.\nstatic cpContact *\nnextContactPoint(cpContact *arr, int *numPtr)\n{\n\tint index = *numPtr;\n\t\n\tif(index < CP_MAX_CONTACTS_PER_ARBITER){\n\t\t(*numPtr) = index + 1;\n\t\treturn &arr[index];\n\t} else {\n\t\treturn &arr[CP_MAX_CONTACTS_PER_ARBITER - 1];\n\t}\n}\n\n// Find the minimum separating axis for the give poly and axis list.\nstatic inline int\nfindMSA(const cpPolyShape *poly, const cpSplittingPlane *planes, const int num, cpFloat *min_out)\n{\n\tint min_index = 0;\n\tcpFloat min = cpPolyShapeValueOnAxis(poly, planes->n, planes->d);\n\tif(min > 0.0f) return -1;\n\t\n\tfor(int i=1; i<num; i++){\n\t\tcpFloat dist = cpPolyShapeValueOnAxis(poly, planes[i].n, planes[i].d);\n\t\tif(dist > 0.0f) {\n\t\t\treturn -1;\n\t\t} else if(dist > min){\n\t\t\tmin = dist;\n\t\t\tmin_index = i;\n\t\t}\n\t}\n\t\n\t(*min_out) = min;\n\treturn min_index;\n}\n\n// Add contacts for probably penetrating vertexes.\n// This handles the degenerate case where an overlap was detected, but no vertexes fall inside\n// the opposing polygon. (like a star of david)\nstatic inline int\nfindVertsFallback(cpContact *arr, const cpPolyShape *poly1, const cpPolyShape *poly2, const cpVect n, const cpFloat dist)\n{\n\tint num = 0;\n\t\n\tfor(int i=0; i<poly1->numVerts; i++){\n\t\tcpVect v = poly1->tVerts[i];\n\t\tif(cpPolyShapeContainsVertPartial(poly2, v, cpvneg(n)))\n\t\t\tcpContactInit(nextContactPoint(arr, &num), v, n, dist, CP_HASH_PAIR(poly1->shape.hashid, i));\n\t}\n\t\n\tfor(int i=0; i<poly2->numVerts; i++){\n\t\tcpVect v = poly2->tVerts[i];\n\t\tif(cpPolyShapeContainsVertPartial(poly1, v, n))\n\t\t\tcpContactInit(nextContactPoint(arr, &num), v, n, dist, CP_HASH_PAIR(poly2->shape.hashid, i));\n\t}\n\t\n\treturn num;\n}\n\n// Add contacts for penetrating vertexes.\nstatic inline int\nfindVerts(cpContact *arr, const cpPolyShape *poly1, const cpPolyShape *poly2, const cpVect n, const cpFloat dist)\n{\n\tint num = 0;\n\t\n\tfor(int i=0; i<poly1->numVerts; i++){\n\t\tcpVect v = poly1->tVerts[i];\n\t\tif(cpPolyShapeContainsVert(poly2, v))\n\t\t\tcpContactInit(nextContactPoint(arr, &num), v, n, dist, CP_HASH_PAIR(poly1->shape.hashid, i));\n\t}\n\t\n\tfor(int i=0; i<poly2->numVerts; i++){\n\t\tcpVect v = poly2->tVerts[i];\n\t\tif(cpPolyShapeContainsVert(poly1, v))\n\t\t\tcpContactInit(nextContactPoint(arr, &num), v, n, dist, CP_HASH_PAIR(poly2->shape.hashid, i));\n\t}\n\t\n\treturn (num ? num : findVertsFallback(arr, poly1, poly2, n, dist));\n}\n\n// Collide poly shapes together.\nstatic int\npoly2poly(const cpShape *shape1, const cpShape *shape2, cpContact *arr)\n{\n\tcpPolyShape *poly1 = (cpPolyShape *)shape1;\n\tcpPolyShape *poly2 = (cpPolyShape *)shape2;\n\t\n\tcpFloat min1;\n\tint mini1 = findMSA(poly2, poly1->tPlanes, poly1->numVerts, &min1);\n\tif(mini1 == -1) return 0;\n\t\n\tcpFloat min2;\n\tint mini2 = findMSA(poly1, poly2->tPlanes, poly2->numVerts, &min2);\n\tif(mini2 == -1) return 0;\n\t\n\t// There is overlap, find the penetrating verts\n\tif(min1 > min2)\n\t\treturn findVerts(arr, poly1, poly2, poly1->tPlanes[mini1].n, min1);\n\telse\n\t\treturn findVerts(arr, poly1, poly2, cpvneg(poly2->tPlanes[mini2].n), min2);\n}\n\n// Like cpPolyValueOnAxis(), but for segments.\nstatic inline cpFloat\nsegValueOnAxis(const cpSegmentShape *seg, const cpVect n, const cpFloat d)\n{\n\tcpFloat a = cpvdot(n, seg->ta) - seg->r;\n\tcpFloat b = cpvdot(n, seg->tb) - seg->r;\n\treturn cpfmin(a, b) - d;\n}\n\n// Identify vertexes that have penetrated the segment.\nstatic inline void\nfindPointsBehindSeg(cpContact *arr, int *num, const cpSegmentShape *seg, const cpPolyShape *poly, const cpFloat pDist, const cpFloat coef) \n{\n\tcpFloat dta = cpvcross(seg->tn, seg->ta);\n\tcpFloat dtb = cpvcross(seg->tn, seg->tb);\n\tcpVect n = cpvmult(seg->tn, coef);\n\t\n\tfor(int i=0; i<poly->numVerts; i++){\n\t\tcpVect v = poly->tVerts[i];\n\t\tif(cpvdot(v, n) < cpvdot(seg->tn, seg->ta)*coef + seg->r){\n\t\t\tcpFloat dt = cpvcross(seg->tn, v);\n\t\t\tif(dta >= dt && dt >= dtb){\n\t\t\t\tcpContactInit(nextContactPoint(arr, num), v, n, pDist, CP_HASH_PAIR(poly->shape.hashid, i));\n\t\t\t}\n\t\t}\n\t}\n}\n\n// This one is complicated and gross. Just don't go there...\n// TODO: Comment me!\nstatic int\nseg2poly(const cpShape *shape1, const cpShape *shape2, cpContact *arr)\n{\n\tcpSegmentShape *seg = (cpSegmentShape *)shape1;\n\tcpPolyShape *poly = (cpPolyShape *)shape2;\n\tcpSplittingPlane *planes = poly->tPlanes;\n\t\n\tcpFloat segD = cpvdot(seg->tn, seg->ta);\n\tcpFloat minNorm = cpPolyShapeValueOnAxis(poly, seg->tn, segD) - seg->r;\n\tcpFloat minNeg = cpPolyShapeValueOnAxis(poly, cpvneg(seg->tn), -segD) - seg->r;\n\tif(minNeg > 0.0f || minNorm > 0.0f) return 0;\n\t\n\tint mini = 0;\n\tcpFloat poly_min = segValueOnAxis(seg, planes->n, planes->d);\n\tif(poly_min > 0.0f) return 0;\n\tfor(int i=0; i<poly->numVerts; i++){\n\t\tcpFloat dist = segValueOnAxis(seg, planes[i].n, planes[i].d);\n\t\tif(dist > 0.0f){\n\t\t\treturn 0;\n\t\t} else if(dist > poly_min){\n\t\t\tpoly_min = dist;\n\t\t\tmini = i;\n\t\t}\n\t}\n\t\n\tint num = 0;\n\t\n\tcpVect poly_n = cpvneg(planes[mini].n);\n\t\n\tcpVect va = cpvadd(seg->ta, cpvmult(poly_n, seg->r));\n\tcpVect vb = cpvadd(seg->tb, cpvmult(poly_n, seg->r));\n\tif(cpPolyShapeContainsVert(poly, va))\n\t\tcpContactInit(nextContactPoint(arr, &num), va, poly_n, poly_min, CP_HASH_PAIR(seg->shape.hashid, 0));\n\tif(cpPolyShapeContainsVert(poly, vb))\n\t\tcpContactInit(nextContactPoint(arr, &num), vb, poly_n, poly_min, CP_HASH_PAIR(seg->shape.hashid, 1));\n\t\n\t// Floating point precision problems here.\n\t// This will have to do for now.\n//\tpoly_min -= cp_collision_slop; // TODO is this needed anymore?\n\t\n\tif(minNorm >= poly_min || minNeg >= poly_min) {\n\t\tif(minNorm > minNeg)\n\t\t\tfindPointsBehindSeg(arr, &num, seg, poly, minNorm, 1.0f);\n\t\telse\n\t\t\tfindPointsBehindSeg(arr, &num, seg, poly, minNeg, -1.0f);\n\t}\n\t\n\t// If no other collision points are found, try colliding endpoints.\n\tif(num == 0){\n\t\tcpVect poly_a = poly->tVerts[mini];\n\t\tcpVect poly_b = poly->tVerts[(mini + 1)%poly->numVerts];\n\t\t\n\t\tif(circle2circleQuery(seg->ta, poly_a, seg->r, 0.0f, arr)) return 1;\n\t\tif(circle2circleQuery(seg->tb, poly_a, seg->r, 0.0f, arr)) return 1;\n\t\tif(circle2circleQuery(seg->ta, poly_b, seg->r, 0.0f, arr)) return 1;\n\t\tif(circle2circleQuery(seg->tb, poly_b, seg->r, 0.0f, arr)) return 1;\n\t}\n\n\treturn num;\n}\n\n// This one is less gross, but still gross.\n// TODO: Comment me!\nstatic int\ncircle2poly(const cpShape *shape1, const cpShape *shape2, cpContact *con)\n{\n\tcpCircleShape *circ = (cpCircleShape *)shape1;\n\tcpPolyShape *poly = (cpPolyShape *)shape2;\n\tcpSplittingPlane *planes = poly->tPlanes;\n\t\n\tint mini = 0;\n\tcpFloat min = cpSplittingPlaneCompare(planes[0], circ->tc) - circ->r;\n\tfor(int i=0; i<poly->numVerts; i++){\n\t\tcpFloat dist = cpSplittingPlaneCompare(planes[i], circ->tc) - circ->r;\n\t\tif(dist > 0.0f){\n\t\t\treturn 0;\n\t\t} else if(dist > min) {\n\t\t\tmin = dist;\n\t\t\tmini = i;\n\t\t}\n\t}\n\t\n\tcpVect n = planes[mini].n;\n\tcpVect a = poly->tVerts[mini];\n\tcpVect b = poly->tVerts[(mini + 1)%poly->numVerts];\n\tcpFloat dta = cpvcross(n, a);\n\tcpFloat dtb = cpvcross(n, b);\n\tcpFloat dt = cpvcross(n, circ->tc);\n\t\t\n\tif(dt < dtb){\n\t\treturn circle2circleQuery(circ->tc, b, circ->r, 0.0f, con);\n\t} else if(dt < dta) {\n\t\tcpContactInit(\n\t\t\tcon,\n\t\t\tcpvsub(circ->tc, cpvmult(n, circ->r + min/2.0f)),\n\t\t\tcpvneg(n),\n\t\t\tmin,\n\t\t\t0\t\t\t\t \n\t\t);\n\t\n\t\treturn 1;\n\t} else {\n\t\treturn circle2circleQuery(circ->tc, a, circ->r, 0.0f, con);\n\t}\n}\n\n// Submitted by LegoCyclon\nstatic int\nseg2seg(const cpShape* shape1, const cpShape* shape2, cpContact* con)\n{\n\tcpSegmentShape* seg1 = (cpSegmentShape *)shape1;\n\tcpSegmentShape* seg2 = (cpSegmentShape *)shape2;\n\t\n\tcpVect v1 = cpvsub(seg1->tb, seg1->ta);\n\tcpVect v2 = cpvsub(seg2->tb, seg2->ta);\n\tcpFloat v1lsq = cpvlengthsq(v1);\n\tcpFloat v2lsq = cpvlengthsq(v2);\n\t// project seg2 onto seg1\n\tcpVect p1a = cpvproject(cpvsub(seg2->ta, seg1->ta), v1);\n\tcpVect p1b = cpvproject(cpvsub(seg2->tb, seg1->ta), v1);\n\t// project seg1 onto seg2\n\tcpVect p2a = cpvproject(cpvsub(seg1->ta, seg2->ta), v2);\n\tcpVect p2b = cpvproject(cpvsub(seg1->tb, seg2->ta), v2);\n\t\n\t// clamp projections to segment endcaps\n\tif (cpvdot(p1a, v1) < 0.0f)\n\t p1a = cpvzero;\n\telse if (cpvdot(p1a, v1) > 0.0f && cpvlengthsq(p1a) > v1lsq)\n\t p1a = v1;\n\tif (cpvdot(p1b, v1) < 0.0f)\n\t p1b = cpvzero;\n\telse if (cpvdot(p1b, v1) > 0.0f && cpvlengthsq(p1b) > v1lsq)\n\t p1b = v1;\n\tif (cpvdot(p2a, v2) < 0.0f)\n\t p2a = cpvzero;\n\telse if (cpvdot(p2a, v2) > 0.0f && cpvlengthsq(p2a) > v2lsq)\n\t p2a = v2;\n\tif (cpvdot(p2b, v2) < 0.0f)\n\t p2b = cpvzero;\n\telse if (cpvdot(p2b, v2) > 0.0f && cpvlengthsq(p2b) > v2lsq)\n\t p2b = v2;\n\t\n\tp1a = cpvadd(p1a, seg1->ta);\n\tp1b = cpvadd(p1b, seg1->ta);\n\tp2a = cpvadd(p2a, seg2->ta);\n\tp2b = cpvadd(p2b, seg2->ta);\n\t\n\tint num = 0;\n\t\n\tif (!circle2circleQuery(p1a, p2a, seg1->r, seg2->r, nextContactPoint(con, &num)))\n\t --num;\n\t\n\tif (!circle2circleQuery(p1b, p2b, seg1->r, seg2->r, nextContactPoint(con, &num)))\n\t --num;\n\t\n\tif (!circle2circleQuery(p1a, p2b, seg1->r, seg2->r, nextContactPoint(con, &num)))\n\t --num;\n\t\n\tif (!circle2circleQuery(p1b, p2a, seg1->r, seg2->r, nextContactPoint(con, &num)))\n\t --num;\n\t\n\treturn num;\n}\n\nstatic const collisionFunc builtinCollisionFuncs[9] = {\n\tcircle2circle,\n\tNULL,\n\tNULL,\n\t(collisionFunc)circle2segment,\n\tNULL,\n\tNULL,\n\tcircle2poly,\n\tseg2poly,\n\tpoly2poly,\n};\nstatic const collisionFunc *colfuncs = builtinCollisionFuncs;\n\nstatic const collisionFunc segmentCollisions[9] = {\n\tcircle2circle,\n\tNULL,\n\tNULL,\n\t(collisionFunc)circle2segment,\n\tseg2seg,\n\tNULL,\n\tcircle2poly,\n\tseg2poly,\n\tpoly2poly,\n};\n\nvoid\ncpEnableSegmentToSegmentCollisions(void)\n{\n\tcolfuncs = segmentCollisions;\n}\n\nint\ncpCollideShapes(const cpShape *a, const cpShape *b, cpContact *arr)\n{\n\t// Their shape types must be in order.\n\tcpAssertSoft(a->klass->type <= b->klass->type, \"Collision shapes passed to cpCollideShapes() are not sorted.\");\n\t\n\tcollisionFunc cfunc = colfuncs[a->klass->type + b->klass->type*CP_NUM_SHAPES];\n\treturn (cfunc) ? cfunc(a, b, arr) : 0;\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpHashSet.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include \"chipmunk_private.h\"\n#include \"prime.h\"\n\ntypedef struct cpHashSetBin {\n\tvoid *elt;\n\tcpHashValue hash;\n\tstruct cpHashSetBin *next;\n} cpHashSetBin;\n\nstruct cpHashSet {\n\tunsigned int entries, size;\n\t\n\tcpHashSetEqlFunc eql;\n\tvoid *default_value;\n\t\n\tcpHashSetBin **table;\n\tcpHashSetBin *pooledBins;\n\t\n\tcpArray *allocatedBuffers;\n};\n\nvoid\ncpHashSetFree(cpHashSet *set)\n{\n\tif(set){\n\t\tcpfree(set->table);\n\t\t\n\t\tcpArrayFreeEach(set->allocatedBuffers, cpfree);\n\t\tcpArrayFree(set->allocatedBuffers);\n\t\t\n\t\tcpfree(set);\n\t}\n}\n\ncpHashSet *\ncpHashSetNew(int size, cpHashSetEqlFunc eqlFunc)\n{\n\tcpHashSet *set = (cpHashSet *)cpcalloc(1, sizeof(cpHashSet));\n\t\n\tset->size = next_prime(size);\n\tset->entries = 0;\n\t\n\tset->eql = eqlFunc;\n\tset->default_value = NULL;\n\t\n\tset->table = (cpHashSetBin **)cpcalloc(set->size, sizeof(cpHashSetBin *));\n\tset->pooledBins = NULL;\n\t\n\tset->allocatedBuffers = cpArrayNew(0);\n\t\n\treturn set;\n}\n\nvoid\ncpHashSetSetDefaultValue(cpHashSet *set, void *default_value)\n{\n\tset->default_value = default_value;\n}\n\nstatic int\nsetIsFull(cpHashSet *set)\n{\n\treturn (set->entries >= set->size);\n}\n\nstatic void\ncpHashSetResize(cpHashSet *set)\n{\n\t// Get the next approximate doubled prime.\n\tunsigned int newSize = next_prime(set->size + 1);\n\t// Allocate a new table.\n\tcpHashSetBin **newTable = (cpHashSetBin **)cpcalloc(newSize, sizeof(cpHashSetBin *));\n\t\n\t// Iterate over the chains.\n\tfor(unsigned int i=0; i<set->size; i++){\n\t\t// Rehash the bins into the new table.\n\t\tcpHashSetBin *bin = set->table[i];\n\t\twhile(bin){\n\t\t\tcpHashSetBin *next = bin->next;\n\t\t\t\n\t\t\tcpHashValue idx = bin->hash%newSize;\n\t\t\tbin->next = newTable[idx];\n\t\t\tnewTable[idx] = bin;\n\t\t\t\n\t\t\tbin = next;\n\t\t}\n\t}\n\t\n\tcpfree(set->table);\n\t\n\tset->table = newTable;\n\tset->size = newSize;\n}\n\nstatic inline void\nrecycleBin(cpHashSet *set, cpHashSetBin *bin)\n{\n\tbin->next = set->pooledBins;\n\tset->pooledBins = bin;\n\tbin->elt = NULL;\n}\n\nstatic cpHashSetBin *\ngetUnusedBin(cpHashSet *set)\n{\n\tcpHashSetBin *bin = set->pooledBins;\n\t\n\tif(bin){\n\t\tset->pooledBins = bin->next;\n\t\treturn bin;\n\t} else {\n\t\t// Pool is exhausted, make more\n\t\tint count = CP_BUFFER_BYTES/sizeof(cpHashSetBin);\n\t\tcpAssertHard(count, \"Internal Error: Buffer size is too small.\");\n\t\t\n\t\tcpHashSetBin *buffer = (cpHashSetBin *)cpcalloc(1, CP_BUFFER_BYTES);\n\t\tcpArrayPush(set->allocatedBuffers, buffer);\n\t\t\n\t\t// push all but the first one, return it instead\n\t\tfor(int i=1; i<count; i++) recycleBin(set, buffer + i);\n\t\treturn buffer;\n\t}\n}\n\nint\ncpHashSetCount(cpHashSet *set)\n{\n\treturn set->entries;\n}\n\nvoid *\ncpHashSetInsert(cpHashSet *set, cpHashValue hash, void *ptr, void *data, cpHashSetTransFunc trans)\n{\n\tcpHashValue idx = hash%set->size;\n\t\n\t// Find the bin with the matching element.\n\tcpHashSetBin *bin = set->table[idx];\n\twhile(bin && !set->eql(ptr, bin->elt))\n\t\tbin = bin->next;\n\t\n\t// Create it if necessary.\n\tif(!bin){\n\t\tbin = getUnusedBin(set);\n\t\tbin->hash = hash;\n\t\tbin->elt = (trans ? trans(ptr, data) : data);\n\t\t\n\t\tbin->next = set->table[idx];\n\t\tset->table[idx] = bin;\n\t\t\n\t\tset->entries++;\n\t\tif(setIsFull(set)) cpHashSetResize(set);\n\t}\n\t\n\treturn bin->elt;\n}\n\nvoid *\ncpHashSetRemove(cpHashSet *set, cpHashValue hash, void *ptr)\n{\n\tcpHashValue idx = hash%set->size;\n\t\n\tcpHashSetBin **prev_ptr = &set->table[idx];\n\tcpHashSetBin *bin = set->table[idx];\n\t\n\t// Find the bin\n\twhile(bin && !set->eql(ptr, bin->elt)){\n\t\tprev_ptr = &bin->next;\n\t\tbin = bin->next;\n\t}\n\t\n\t// Remove it if it exists.\n\tif(bin){\n\t\t// Update the previous linked list pointer\n\t\t(*prev_ptr) = bin->next;\n\t\tset->entries--;\n\t\t\n\t\tvoid *elt = bin->elt;\n\t\trecycleBin(set, bin);\n\t\t\n\t\treturn elt;\n\t}\n\t\n\treturn NULL;\n}\n\nvoid *\ncpHashSetFind(cpHashSet *set, cpHashValue hash, void *ptr)\n{\t\n\tcpHashValue idx = hash%set->size;\n\tcpHashSetBin *bin = set->table[idx];\n\twhile(bin && !set->eql(ptr, bin->elt))\n\t\tbin = bin->next;\n\t\t\n\treturn (bin ? bin->elt : set->default_value);\n}\n\nvoid\ncpHashSetEach(cpHashSet *set, cpHashSetIteratorFunc func, void *data)\n{\n\tfor(unsigned int i=0; i<set->size; i++){\n\t\tcpHashSetBin *bin = set->table[i];\n\t\twhile(bin){\n\t\t\tcpHashSetBin *next = bin->next;\n\t\t\tfunc(bin->elt, data);\n\t\t\tbin = next;\n\t\t}\n\t}\n}\n\nvoid\ncpHashSetFilter(cpHashSet *set, cpHashSetFilterFunc func, void *data)\n{\n\tfor(unsigned int i=0; i<set->size; i++){\n\t\t// The rest works similarly to cpHashSetRemove() above.\n\t\tcpHashSetBin **prev_ptr = &set->table[i];\n\t\tcpHashSetBin *bin = set->table[i];\n\t\twhile(bin){\n\t\t\tcpHashSetBin *next = bin->next;\n\t\t\t\n\t\t\tif(func(bin->elt, data)){\n\t\t\t\tprev_ptr = &bin->next;\n\t\t\t} else {\n\t\t\t\t(*prev_ptr) = next;\n\n\t\t\t\tset->entries--;\n\t\t\t\trecycleBin(set, bin);\n\t\t\t}\n\t\t\t\n\t\t\tbin = next;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpPolyShape.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include \"chipmunk_private.h\"\n#include \"chipmunk_unsafe.h\"\n\ncpPolyShape *\ncpPolyShapeAlloc(void)\n{\n\treturn (cpPolyShape *)cpcalloc(1, sizeof(cpPolyShape));\n}\n\nstatic cpBB\ncpPolyShapeTransformVerts(cpPolyShape *poly, cpVect p, cpVect rot)\n{\n\tcpVect *src = poly->verts;\n\tcpVect *dst = poly->tVerts;\n\t\n\tcpFloat l = (cpFloat)INFINITY, r = -(cpFloat)INFINITY;\n\tcpFloat b = (cpFloat)INFINITY, t = -(cpFloat)INFINITY;\n\t\n\tfor(int i=0; i<poly->numVerts; i++){\n\t\tcpVect v = cpvadd(p, cpvrotate(src[i], rot));\n\t\t\n\t\tdst[i] = v;\n\t\tl = cpfmin(l, v.x);\n\t\tr = cpfmax(r, v.x);\n\t\tb = cpfmin(b, v.y);\n\t\tt = cpfmax(t, v.y);\n\t}\n\t\n\treturn cpBBNew(l, b, r, t);\n}\n\nstatic void\ncpPolyShapeTransformAxes(cpPolyShape *poly, cpVect p, cpVect rot)\n{\n\tcpSplittingPlane *src = poly->planes;\n\tcpSplittingPlane *dst = poly->tPlanes;\n\t\n\tfor(int i=0; i<poly->numVerts; i++){\n\t\tcpVect n = cpvrotate(src[i].n, rot);\n\t\tdst[i].n = n;\n\t\tdst[i].d = cpvdot(p, n) + src[i].d;\n\t}\n}\n\nstatic cpBB\ncpPolyShapeCacheData(cpPolyShape *poly, cpVect p, cpVect rot)\n{\n\tcpPolyShapeTransformAxes(poly, p, rot);\n\tcpBB bb = poly->shape.bb = cpPolyShapeTransformVerts(poly, p, rot);\n\t\n\treturn bb;\n}\n\nstatic void\ncpPolyShapeDestroy(cpPolyShape *poly)\n{\n\tcpfree(poly->verts);\n\tcpfree(poly->planes);\n}\n\nstatic void\ncpPolyShapeNearestPointQuery(cpPolyShape *poly, cpVect p, cpNearestPointQueryInfo *info){\n\tint count = poly->numVerts;\n\tcpSplittingPlane *planes = poly->tPlanes;\n\tcpVect *verts = poly->tVerts;\n\t\n\tcpVect v0 = verts[count - 1];\n\tcpFloat minDist = INFINITY;\n\tcpVect closestPoint = cpvzero;\n\tcpBool outside = cpFalse;\n\t\n\tfor(int i=0; i<count; i++){\n\t\tif(cpSplittingPlaneCompare(planes[i], p) > 0.0f) outside = cpTrue;\n\t\t\n\t\tcpVect v1 = verts[i];\n\t\tcpVect closest = cpClosetPointOnSegment(p, v0, v1);\n\t\t\n\t\tcpFloat dist = cpvdist(p, closest);\n\t\tif(dist < minDist){\n\t\t\tminDist = dist;\n\t\t\tclosestPoint = closest;\n\t\t}\n\t\t\n\t\tv0 = v1;\n\t}\n\t\n\tinfo->shape = (cpShape *)poly;\n\tinfo->p = closestPoint; // TODO div/0\n\tinfo->d = (outside ? minDist : -minDist);\n}\n\nstatic void\ncpPolyShapeSegmentQuery(cpPolyShape *poly, cpVect a, cpVect b, cpSegmentQueryInfo *info)\n{\n\tcpSplittingPlane *axes = poly->tPlanes;\n\tcpVect *verts = poly->tVerts;\n\tint numVerts = poly->numVerts;\n\t\n\tfor(int i=0; i<numVerts; i++){\n\t\tcpVect n = axes[i].n;\n\t\tcpFloat an = cpvdot(a, n);\n\t\tif(axes[i].d > an) continue;\n\t\t\n\t\tcpFloat bn = cpvdot(b, n);\n\t\tcpFloat t = (axes[i].d - an)/(bn - an);\n\t\tif(t < 0.0f || 1.0f < t) continue;\n\t\t\n\t\tcpVect point = cpvlerp(a, b, t);\n\t\tcpFloat dt = -cpvcross(n, point);\n\t\tcpFloat dtMin = -cpvcross(n, verts[i]);\n\t\tcpFloat dtMax = -cpvcross(n, verts[(i+1)%numVerts]);\n\t\t\n\t\tif(dtMin <= dt && dt <= dtMax){\n\t\t\tinfo->shape = (cpShape *)poly;\n\t\t\tinfo->t = t;\n\t\t\tinfo->n = n;\n\t\t}\n\t}\n}\n\nstatic const cpShapeClass polyClass = {\n\tCP_POLY_SHAPE,\n\t(cpShapeCacheDataImpl)cpPolyShapeCacheData,\n\t(cpShapeDestroyImpl)cpPolyShapeDestroy,\n\t(cpShapeNearestPointQueryImpl)cpPolyShapeNearestPointQuery,\n\t(cpShapeSegmentQueryImpl)cpPolyShapeSegmentQuery,\n};\n\ncpBool\ncpPolyValidate(const cpVect *verts, const int numVerts)\n{\n\tfor(int i=0; i<numVerts; i++){\n\t\tcpVect a = verts[i];\n\t\tcpVect b = verts[(i+1)%numVerts];\n\t\tcpVect c = verts[(i+2)%numVerts];\n\t\t\n\t\tif(cpvcross(cpvsub(b, a), cpvsub(c, a)) > 0.0f){\n\t\t\treturn cpFalse;\n\t\t}\n\t}\n\t\n\treturn cpTrue;\n}\n\nint\ncpPolyShapeGetNumVerts(cpShape *shape)\n{\n\tcpAssertHard(shape->klass == &polyClass, \"Shape is not a poly shape.\");\n\treturn ((cpPolyShape *)shape)->numVerts;\n}\n\ncpVect\ncpPolyShapeGetVert(cpShape *shape, int idx)\n{\n\tcpAssertHard(shape->klass == &polyClass, \"Shape is not a poly shape.\");\n\tcpAssertHard(0 <= idx && idx < cpPolyShapeGetNumVerts(shape), \"Index out of range.\");\n\t\n\treturn ((cpPolyShape *)shape)->verts[idx];\n}\n\n\nstatic void\nsetUpVerts(cpPolyShape *poly, int numVerts, const cpVect *verts, cpVect offset)\n{\n\t// Fail if the user attempts to pass a concave poly, or a bad winding.\n\tcpAssertHard(cpPolyValidate(verts, numVerts), \"Polygon is concave or has a reversed winding. Consider using cpConvexHull() or CP_CONVEX_HULL().\");\n\t\n\tpoly->numVerts = numVerts;\n\tpoly->verts = (cpVect *)cpcalloc(2*numVerts, sizeof(cpVect));\n\tpoly->planes = (cpSplittingPlane *)cpcalloc(2*numVerts, sizeof(cpSplittingPlane));\n\tpoly->tVerts = poly->verts + numVerts;\n\tpoly->tPlanes = poly->planes + numVerts;\n\t\n\tfor(int i=0; i<numVerts; i++){\n\t\tcpVect a = cpvadd(offset, verts[i]);\n\t\tcpVect b = cpvadd(offset, verts[(i+1)%numVerts]);\n\t\tcpVect n = cpvnormalize(cpvperp(cpvsub(b, a)));\n\n\t\tpoly->verts[i] = a;\n\t\tpoly->planes[i].n = n;\n\t\tpoly->planes[i].d = cpvdot(n, a);\n\t}\n\t\n}\n\ncpPolyShape *\ncpPolyShapeInit(cpPolyShape *poly, cpBody *body, int numVerts, const cpVect *verts, cpVect offset)\n{\n\tsetUpVerts(poly, numVerts, verts, offset);\n\tcpShapeInit((cpShape *)poly, &polyClass, body);\n\n\treturn poly;\n}\n\ncpShape *\ncpPolyShapeNew(cpBody *body, int numVerts, cpVect *verts, cpVect offset)\n{\n\treturn (cpShape *)cpPolyShapeInit(cpPolyShapeAlloc(), body, numVerts, verts, offset);\n}\n\ncpPolyShape *\ncpBoxShapeInit(cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height)\n{\n\tcpFloat hw = width/2.0f;\n\tcpFloat hh = height/2.0f;\n\t\n\treturn cpBoxShapeInit2(poly, body, cpBBNew(-hw, -hh, hw, hh));\n}\n\ncpPolyShape *\ncpBoxShapeInit2(cpPolyShape *poly, cpBody *body, cpBB box)\n{\n\tcpVect verts[] = {\n\t\tcpv(box.l, box.b),\n\t\tcpv(box.l, box.t),\n\t\tcpv(box.r, box.t),\n\t\tcpv(box.r, box.b),\n\t};\n\t\n\treturn cpPolyShapeInit(poly, body, 4, verts, cpvzero);\n}\n\ncpShape *\ncpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height)\n{\n\treturn (cpShape *)cpBoxShapeInit(cpPolyShapeAlloc(), body, width, height);\n}\n\ncpShape *\ncpBoxShapeNew2(cpBody *body, cpBB box)\n{\n\treturn (cpShape *)cpBoxShapeInit2(cpPolyShapeAlloc(), body, box);\n}\n\n// Unsafe API (chipmunk_unsafe.h)\n\nvoid\ncpPolyShapeSetVerts(cpShape *shape, int numVerts, cpVect *verts, cpVect offset)\n{\n\tcpAssertHard(shape->klass == &polyClass, \"Shape is not a poly shape.\");\n\tcpPolyShapeDestroy((cpPolyShape *)shape);\n\tsetUpVerts((cpPolyShape *)shape, numVerts, verts, offset);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpShape.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include \"chipmunk_private.h\"\n#include \"chipmunk_unsafe.h\"\n\n#define CP_DefineShapeGetter(struct, type, member, name) \\\nCP_DeclareShapeGetter(struct, type, name){ \\\n\tcpAssertHard(shape->klass == &struct##Class, \"shape is not a \"#struct); \\\n\treturn ((struct *)shape)->member; \\\n}\n\nstatic cpHashValue cpShapeIDCounter = 0;\n\nvoid\ncpResetShapeIdCounter(void)\n{\n\tcpShapeIDCounter = 0;\n}\n\n\ncpShape*\ncpShapeInit(cpShape *shape, const cpShapeClass *klass, cpBody *body)\n{\n\tshape->klass = klass;\n\t\n\tshape->hashid = cpShapeIDCounter;\n\tcpShapeIDCounter++;\n\t\n\tshape->body = body;\n\tshape->sensor = 0;\n\t\n\tshape->e = 0.0f;\n\tshape->u = 0.0f;\n\tshape->surface_v = cpvzero;\n\t\n\tshape->collision_type = 0;\n\tshape->group = CP_NO_GROUP;\n\tshape->layers = CP_ALL_LAYERS;\n\t\n\tshape->data = NULL;\n\t\n\tshape->space = NULL;\n\t\n\tshape->next = NULL;\n\tshape->prev = NULL;\n\t\n\treturn shape;\n}\n\nvoid\ncpShapeDestroy(cpShape *shape)\n{\n\tif(shape->klass && shape->klass->destroy) shape->klass->destroy(shape);\n}\n\nvoid\ncpShapeFree(cpShape *shape)\n{\n\tif(shape){\n\t\tcpShapeDestroy(shape);\n\t\tcpfree(shape);\n\t}\n}\n\nvoid\ncpShapeSetBody(cpShape *shape, cpBody *body)\n{\n\tcpAssertHard(!cpShapeActive(shape), \"You cannot change the body on an active shape. You must remove the shape from the space before changing the body.\");\n\tshape->body = body;\n}\n\ncpBB\ncpShapeCacheBB(cpShape *shape)\n{\n\tcpBody *body = shape->body;\n\treturn cpShapeUpdate(shape, body->p, body->rot);\n}\n\ncpBB\ncpShapeUpdate(cpShape *shape, cpVect pos, cpVect rot)\n{\n\treturn (shape->bb = shape->klass->cacheData(shape, pos, rot));\n}\n\ncpBool\ncpShapePointQuery(cpShape *shape, cpVect p){\n\tcpNearestPointQueryInfo info = {NULL, cpvzero, INFINITY};\n\tcpShapeNearestPointQuery(shape, p, &info);\n\t\n\treturn (info.d < 0.0f);\n}\n\ncpFloat\ncpShapeNearestPointQuery(cpShape *shape, cpVect p, cpNearestPointQueryInfo *info)\n{\n\tcpNearestPointQueryInfo blank = {NULL, cpvzero, INFINITY};\n\tif(info){\n\t\t(*info) = blank;\n\t} else {\n\t\tinfo = &blank;\n\t}\n\t\n\tshape->klass->nearestPointQuery(shape, p, info);\n\treturn info->d;\n}\n\n\ncpBool\ncpShapeSegmentQuery(cpShape *shape, cpVect a, cpVect b, cpSegmentQueryInfo *info){\n\tcpSegmentQueryInfo blank = {NULL, 0.0f, cpvzero};\n\tif(info){\n\t\t(*info) = blank;\n\t} else {\n\t\tinfo = &blank;\n\t}\n\t\n\tcpNearestPointQueryInfo nearest;\n\tshape->klass->nearestPointQuery(shape, a, &nearest);\n\tif(nearest.d <= 0.0){\n\t\tinfo->shape = shape;\n\t\tinfo->t = 0.0;\n\t\tinfo->n = cpvnormalize(cpvsub(a, nearest.p));\n\t} else {\n\t\tshape->klass->segmentQuery(shape, a, b, info);\n\t}\n\t\n\treturn (info->shape != NULL);\n}\n\ncpCircleShape *\ncpCircleShapeAlloc(void)\n{\n\treturn (cpCircleShape *)cpcalloc(1, sizeof(cpCircleShape));\n}\n\nstatic cpBB\ncpCircleShapeCacheData(cpCircleShape *circle, cpVect p, cpVect rot)\n{\n\tcpVect c = circle->tc = cpvadd(p, cpvrotate(circle->c, rot));\n\treturn cpBBNewForCircle(c, circle->r);\n}\n\nstatic void\ncpCicleShapeNearestPointQuery(cpCircleShape *circle, cpVect p, cpNearestPointQueryInfo *info)\n{\n\tcpVect delta = cpvsub(p, circle->tc);\n\tcpFloat d = cpvlength(delta);\n\tcpFloat r = circle->r;\n\t\n\tinfo->shape = (cpShape *)circle;\n\tinfo->p = cpvadd(circle->tc, cpvmult(delta, r/d)); // TODO div/0\n\tinfo->d = d - r;\n}\n\nstatic void\ncircleSegmentQuery(cpShape *shape, cpVect center, cpFloat r, cpVect a, cpVect b, cpSegmentQueryInfo *info)\n{\n\tcpVect da = cpvsub(a, center);\n\tcpVect db = cpvsub(b, center);\n\t\n\tcpFloat qa = cpvdot(da, da) - 2.0f*cpvdot(da, db) + cpvdot(db, db);\n\tcpFloat qb = -2.0f*cpvdot(da, da) + 2.0f*cpvdot(da, db);\n\tcpFloat qc = cpvdot(da, da) - r*r;\n\t\n\tcpFloat det = qb*qb - 4.0f*qa*qc;\n\t\n\tif(det >= 0.0f){\n\t\tcpFloat t = (-qb - cpfsqrt(det))/(2.0f*qa);\n\t\tif(0.0f<= t && t <= 1.0f){\n\t\t\tinfo->shape = shape;\n\t\t\tinfo->t = t;\n\t\t\tinfo->n = cpvnormalize(cpvlerp(da, db, t));\n\t\t}\n\t}\n}\n\nstatic void\ncpCircleShapeSegmentQuery(cpCircleShape *circle, cpVect a, cpVect b, cpSegmentQueryInfo *info)\n{\n\tcircleSegmentQuery((cpShape *)circle, circle->tc, circle->r, a, b, info);\n}\n\nstatic const cpShapeClass cpCircleShapeClass = {\n\tCP_CIRCLE_SHAPE,\n\t(cpShapeCacheDataImpl)cpCircleShapeCacheData,\n\tNULL,\n\t(cpShapeNearestPointQueryImpl)cpCicleShapeNearestPointQuery,\n\t(cpShapeSegmentQueryImpl)cpCircleShapeSegmentQuery,\n};\n\ncpCircleShape *\ncpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset)\n{\n\tcircle->c = offset;\n\tcircle->r = radius;\n\t\n\tcpShapeInit((cpShape *)circle, &cpCircleShapeClass, body);\n\t\n\treturn circle;\n}\n\ncpShape *\ncpCircleShapeNew(cpBody *body, cpFloat radius, cpVect offset)\n{\n\treturn (cpShape *)cpCircleShapeInit(cpCircleShapeAlloc(), body, radius, offset);\n}\n\nCP_DefineShapeGetter(cpCircleShape, cpVect, c, Offset)\nCP_DefineShapeGetter(cpCircleShape, cpFloat, r, Radius)\n\ncpSegmentShape *\ncpSegmentShapeAlloc(void)\n{\n\treturn (cpSegmentShape *)cpcalloc(1, sizeof(cpSegmentShape));\n}\n\nstatic cpBB\ncpSegmentShapeCacheData(cpSegmentShape *seg, cpVect p, cpVect rot)\n{\n\tseg->ta = cpvadd(p, cpvrotate(seg->a, rot));\n\tseg->tb = cpvadd(p, cpvrotate(seg->b, rot));\n\tseg->tn = cpvrotate(seg->n, rot);\n\t\n\tcpFloat l,r,b,t;\n\t\n\tif(seg->ta.x < seg->tb.x){\n\t\tl = seg->ta.x;\n\t\tr = seg->tb.x;\n\t} else {\n\t\tl = seg->tb.x;\n\t\tr = seg->ta.x;\n\t}\n\t\n\tif(seg->ta.y < seg->tb.y){\n\t\tb = seg->ta.y;\n\t\tt = seg->tb.y;\n\t} else {\n\t\tb = seg->tb.y;\n\t\tt = seg->ta.y;\n\t}\n\t\n\tcpFloat rad = seg->r;\n\treturn cpBBNew(l - rad, b - rad, r + rad, t + rad);\n}\n\nstatic void\ncpSegmentShapeNearestPointQuery(cpSegmentShape *seg, cpVect p, cpNearestPointQueryInfo *info)\n{\n\tcpVect closest = cpClosetPointOnSegment(p, seg->ta, seg->tb);\n\t\n\tcpVect delta = cpvsub(p, closest);\n\tcpFloat d = cpvlength(delta);\n\tcpFloat r = seg->r;\n\t\n\tinfo->shape = (cpShape *)seg;\n\tinfo->p = (d ? cpvadd(closest, cpvmult(delta, r/d)) : closest);\n\tinfo->d = d - r;\n}\n\nstatic void\ncpSegmentShapeSegmentQuery(cpSegmentShape *seg, cpVect a, cpVect b, cpSegmentQueryInfo *info)\n{\n\tcpVect n = seg->tn;\n\tcpFloat d = cpvdot(cpvsub(seg->ta, a), n);\n\tcpFloat r = seg->r;\n\t\n\tcpVect flipped_n = (d > 0.0f ? cpvneg(n) : n);\n\tcpVect seg_offset = cpvsub(cpvmult(flipped_n, r), a);\n\t\n\t// Make the endpoints relative to 'a' and move them by the thickness of the segment.\n\tcpVect seg_a = cpvadd(seg->ta, seg_offset);\n\tcpVect seg_b = cpvadd(seg->tb, seg_offset);\n\tcpVect delta = cpvsub(b, a);\n\t\n\tif(cpvcross(delta, seg_a)*cpvcross(delta, seg_b) <= 0.0f){\n\t\tcpFloat d_offset = d + (d > 0.0f ? -r : r);\n\t\tcpFloat ad = -d_offset;\n\t\tcpFloat bd = cpvdot(delta, n) - d_offset;\n\t\t\n\t\tif(ad*bd < 0.0f){\n\t\t\tinfo->shape = (cpShape *)seg;\n\t\t\tinfo->t = ad/(ad - bd);\n\t\t\tinfo->n = flipped_n;\n\t\t}\n\t} else if(r != 0.0f){\n\t\tcpSegmentQueryInfo info1 = {NULL, 1.0f, cpvzero};\n\t\tcpSegmentQueryInfo info2 = {NULL, 1.0f, cpvzero};\n\t\tcircleSegmentQuery((cpShape *)seg, seg->ta, seg->r, a, b, &info1);\n\t\tcircleSegmentQuery((cpShape *)seg, seg->tb, seg->r, a, b, &info2);\n\t\t\n\t\tif(info1.t < info2.t){\n\t\t\t(*info) = info1;\n\t\t} else {\n\t\t\t(*info) = info2;\n\t\t}\n\t}\n}\n\nstatic const cpShapeClass cpSegmentShapeClass = {\n\tCP_SEGMENT_SHAPE,\n\t(cpShapeCacheDataImpl)cpSegmentShapeCacheData,\n\tNULL,\n\t(cpShapeNearestPointQueryImpl)cpSegmentShapeNearestPointQuery,\n\t(cpShapeSegmentQueryImpl)cpSegmentShapeSegmentQuery,\n};\n\ncpSegmentShape *\ncpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat r)\n{\n\tseg->a = a;\n\tseg->b = b;\n\tseg->n = cpvperp(cpvnormalize(cpvsub(b, a)));\n\t\n\tseg->r = r;\n\t\n\tseg->a_tangent = cpvzero;\n\tseg->b_tangent = cpvzero;\n\t\n\tcpShapeInit((cpShape *)seg, &cpSegmentShapeClass, body);\n\t\n\treturn seg;\n}\n\ncpShape*\ncpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat r)\n{\n\treturn (cpShape *)cpSegmentShapeInit(cpSegmentShapeAlloc(), body, a, b, r);\n}\n\nCP_DefineShapeGetter(cpSegmentShape, cpVect, a, A)\nCP_DefineShapeGetter(cpSegmentShape, cpVect, b, B)\nCP_DefineShapeGetter(cpSegmentShape, cpVect, n, Normal)\nCP_DefineShapeGetter(cpSegmentShape, cpFloat, r, Radius)\n\nvoid\ncpSegmentShapeSetNeighbors(cpShape *shape, cpVect prev, cpVect next)\n{\n\tcpAssertHard(shape->klass == &cpSegmentShapeClass, \"Shape is not a segment shape.\");\n\tcpSegmentShape *seg = (cpSegmentShape *)shape;\n\t\n\tseg->a_tangent = cpvsub(prev, seg->a);\n\tseg->b_tangent = cpvsub(next, seg->b);\n}\n\n// Unsafe API (chipmunk_unsafe.h)\n\nvoid\ncpCircleShapeSetRadius(cpShape *shape, cpFloat radius)\n{\n\tcpAssertHard(shape->klass == &cpCircleShapeClass, \"Shape is not a circle shape.\");\n\tcpCircleShape *circle = (cpCircleShape *)shape;\n\t\n\tcircle->r = radius;\n}\n\nvoid\ncpCircleShapeSetOffset(cpShape *shape, cpVect offset)\n{\n\tcpAssertHard(shape->klass == &cpCircleShapeClass, \"Shape is not a circle shape.\");\n\tcpCircleShape *circle = (cpCircleShape *)shape;\n\t\n\tcircle->c = offset;\n}\n\nvoid\ncpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b)\n{\n\tcpAssertHard(shape->klass == &cpSegmentShapeClass, \"Shape is not a segment shape.\");\n\tcpSegmentShape *seg = (cpSegmentShape *)shape;\n\t\n\tseg->a = a;\n\tseg->b = b;\n\tseg->n = cpvperp(cpvnormalize(cpvsub(b, a)));\n}\n\nvoid\ncpSegmentShapeSetRadius(cpShape *shape, cpFloat radius)\n{\n\tcpAssertHard(shape->klass == &cpSegmentShapeClass, \"Shape is not a segment shape.\");\n\tcpSegmentShape *seg = (cpSegmentShape *)shape;\n\t\n\tseg->r = radius;\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpSpace.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include <stdio.h>\n#include <string.h>\n\n#include \"chipmunk_private.h\"\n\n//MARK: Contact Set Helpers\n\n// Equal function for arbiterSet.\nstatic cpBool\narbiterSetEql(cpShape **shapes, cpArbiter *arb)\n{\n\tcpShape *a = shapes[0];\n\tcpShape *b = shapes[1];\n\t\n\treturn ((a == arb->a && b == arb->b) || (b == arb->a && a == arb->b));\n}\n\n//MARK: Collision Handler Set HelperFunctions\n\n// Equals function for collisionHandlers.\nstatic cpBool\nhandlerSetEql(cpCollisionHandler *check, cpCollisionHandler *pair)\n{\n\treturn ((check->a == pair->a && check->b == pair->b) || (check->b == pair->a && check->a == pair->b));\n}\n\n// Transformation function for collisionHandlers.\nstatic void *\nhandlerSetTrans(cpCollisionHandler *handler, void *unused)\n{\n\tcpCollisionHandler *copy = (cpCollisionHandler *)cpcalloc(1, sizeof(cpCollisionHandler));\n\t(*copy) = (*handler);\n\t\n\treturn copy;\n}\n\n//MARK: Misc Helper Funcs\n\n// Default collision functions.\nstatic cpBool alwaysCollide(cpArbiter *arb, cpSpace *space, void *data){return 1;}\nstatic void nothing(cpArbiter *arb, cpSpace *space, void *data){}\n\n// function to get the estimated velocity of a shape for the cpBBTree.\nstatic cpVect shapeVelocityFunc(cpShape *shape){return shape->body->v;}\n\nstatic void freeWrap(void *ptr, void *unused){cpfree(ptr);}\n\n//MARK: Memory Management Functions\n\ncpSpace *\ncpSpaceAlloc(void)\n{\n\treturn (cpSpace *)cpcalloc(1, sizeof(cpSpace));\n}\n\ncpCollisionHandler cpDefaultCollisionHandler = {0, 0, alwaysCollide, alwaysCollide, nothing, nothing, NULL};\n\ncpSpace*\ncpSpaceInit(cpSpace *space)\n{\n#ifndef NDEBUG\n\tstatic cpBool done = cpFalse;\n\tif(!done){\n\t\tprintf(\"Initializing cpSpace - Chipmunk v%s (Debug Enabled)\\n\", cpVersionString);\n\t\tprintf(\"Compile with -DNDEBUG defined to disable debug mode and runtime assertion checks\\n\");\n\t\tdone = cpTrue;\n\t}\n#endif\n\n\tspace->iterations = 10;\n\t\n\tspace->gravity = cpvzero;\n\tspace->damping = 1.0f;\n\t\n\tspace->collisionSlop = 0.1f;\n\tspace->collisionBias = cpfpow(1.0f - 0.1f, 60.0f);\n\tspace->collisionPersistence = 3;\n\t\n\tspace->locked = 0;\n\tspace->stamp = 0;\n\n\tspace->staticShapes = cpBBTreeNew((cpSpatialIndexBBFunc)cpShapeGetBB, NULL);\n\tspace->activeShapes = cpBBTreeNew((cpSpatialIndexBBFunc)cpShapeGetBB, space->staticShapes);\n\tcpBBTreeSetVelocityFunc(space->activeShapes, (cpBBTreeVelocityFunc)shapeVelocityFunc);\n\t\n\tspace->allocatedBuffers = cpArrayNew(0);\n\t\n\tspace->bodies = cpArrayNew(0);\n\tspace->sleepingComponents = cpArrayNew(0);\n\tspace->rousedBodies = cpArrayNew(0);\n\t\n\tspace->sleepTimeThreshold = INFINITY;\n\tspace->idleSpeedThreshold = 0.0f;\n\tspace->enableContactGraph = cpFalse;\n\t\n\tspace->arbiters = cpArrayNew(0);\n\tspace->pooledArbiters = cpArrayNew(0);\n\t\n\tspace->contactBuffersHead = NULL;\n\tspace->cachedArbiters = cpHashSetNew(0, (cpHashSetEqlFunc)arbiterSetEql);\n\t\n\tspace->constraints = cpArrayNew(0);\n\t\n\tspace->defaultHandler = cpDefaultCollisionHandler;\n\tspace->collisionHandlers = cpHashSetNew(0, (cpHashSetEqlFunc)handlerSetEql);\n\tcpHashSetSetDefaultValue(space->collisionHandlers, &cpDefaultCollisionHandler);\n\t\n\tspace->postStepCallbacks = cpArrayNew(0);\n\tspace->skipPostStep = cpFalse;\n\t\n\tcpBodyInitStatic(&space->_staticBody);\n\tspace->staticBody = &space->_staticBody;\n\t\n\treturn space;\n}\n\ncpSpace*\ncpSpaceNew(void)\n{\n\treturn cpSpaceInit(cpSpaceAlloc());\n}\n\nvoid\ncpSpaceDestroy(cpSpace *space)\n{\n\tcpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)cpBodyActivate, NULL);\n\t\n\tcpSpatialIndexFree(space->staticShapes);\n\tcpSpatialIndexFree(space->activeShapes);\n\t\n\tcpArrayFree(space->bodies);\n\tcpArrayFree(space->sleepingComponents);\n\tcpArrayFree(space->rousedBodies);\n\t\n\tcpArrayFree(space->constraints);\n\t\n\tcpHashSetFree(space->cachedArbiters);\n\t\n\tcpArrayFree(space->arbiters);\n\tcpArrayFree(space->pooledArbiters);\n\t\n\tif(space->allocatedBuffers){\n\t\tcpArrayFreeEach(space->allocatedBuffers, cpfree);\n\t\tcpArrayFree(space->allocatedBuffers);\n\t}\n\t\n\tif(space->postStepCallbacks){\n\t\tcpArrayFreeEach(space->postStepCallbacks, cpfree);\n\t\tcpArrayFree(space->postStepCallbacks);\n\t}\n\t\n\tif(space->collisionHandlers) cpHashSetEach(space->collisionHandlers, freeWrap, NULL);\n\tcpHashSetFree(space->collisionHandlers);\n}\n\nvoid\ncpSpaceFree(cpSpace *space)\n{\n\tif(space){\n\t\tcpSpaceDestroy(space);\n\t\tcpfree(space);\n\t}\n}\n\n#define cpAssertSpaceUnlocked(space) \\\n\tcpAssertHard(!space->locked, \\\n\t\t\"This operation cannot be done safely during a call to cpSpaceStep() or during a query. \" \\\n\t\t\"Put these calls into a post-step callback.\" \\\n\t);\n\n//MARK: Collision Handler Function Management\n\nvoid\ncpSpaceAddCollisionHandler(\n\tcpSpace *space,\n\tcpCollisionType a, cpCollisionType b,\n\tcpCollisionBeginFunc begin,\n\tcpCollisionPreSolveFunc preSolve,\n\tcpCollisionPostSolveFunc postSolve,\n\tcpCollisionSeparateFunc separate,\n\tvoid *data\n){\n\tcpAssertSpaceUnlocked(space);\n\t\n\t// Remove any old function so the new one will get added.\n\tcpSpaceRemoveCollisionHandler(space, a, b);\n\t\n\tcpCollisionHandler handler = {\n\t\ta, b,\n\t\tbegin ? begin : alwaysCollide,\n\t\tpreSolve ? preSolve : alwaysCollide,\n\t\tpostSolve ? postSolve : nothing,\n\t\tseparate ? separate : nothing,\n\t\tdata\n\t};\n\t\n\tcpHashSetInsert(space->collisionHandlers, CP_HASH_PAIR(a, b), &handler, NULL, (cpHashSetTransFunc)handlerSetTrans);\n}\n\nvoid\ncpSpaceRemoveCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b)\n{\n\tcpAssertSpaceUnlocked(space);\n\t\n\tstruct { cpCollisionType a, b; } ids = {a, b};\n\tcpCollisionHandler *old_handler = (cpCollisionHandler *) cpHashSetRemove(space->collisionHandlers, CP_HASH_PAIR(a, b), &ids);\n\tcpfree(old_handler);\n}\n\nvoid\ncpSpaceSetDefaultCollisionHandler(\n\tcpSpace *space,\n\tcpCollisionBeginFunc begin,\n\tcpCollisionPreSolveFunc preSolve,\n\tcpCollisionPostSolveFunc postSolve,\n\tcpCollisionSeparateFunc separate,\n\tvoid *data\n){\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpCollisionHandler handler = {\n\t\t0, 0,\n\t\tbegin ? begin : alwaysCollide,\n\t\tpreSolve ? preSolve : alwaysCollide,\n\t\tpostSolve ? postSolve : nothing,\n\t\tseparate ? separate : nothing,\n\t\tdata\n\t};\n\t\n\tspace->defaultHandler = handler;\n\tcpHashSetSetDefaultValue(space->collisionHandlers, &space->defaultHandler);\n}\n\n//MARK: Body, Shape, and Joint Management\ncpShape *\ncpSpaceAddShape(cpSpace *space, cpShape *shape)\n{\n\tcpBody *body = shape->body;\n\tif(cpBodyIsStatic(body)) return cpSpaceAddStaticShape(space, shape);\n\t\n\tcpAssertHard(shape->space != space, \"You have already added this shape to this space. You must not add it a second time.\");\n\tcpAssertHard(!shape->space, \"You have already added this shape to another space. You cannot add it to a second.\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBodyActivate(body);\n\tcpBodyAddShape(body, shape);\n\t\n\tcpShapeUpdate(shape, body->p, body->rot);\n\tcpSpatialIndexInsert(space->activeShapes, shape, shape->hashid);\n\tshape->space = space;\n\t\t\n\treturn shape;\n}\n\ncpShape *\ncpSpaceAddStaticShape(cpSpace *space, cpShape *shape)\n{\n\tcpAssertHard(shape->space != space, \"You have already added this shape to this space. You must not add it a second time.\");\n\tcpAssertHard(!shape->space, \"You have already added this shape to another space. You cannot add it to a second.\");\n\tcpAssertHard(cpBodyIsRogue(shape->body), \"You are adding a static shape to a dynamic body. Did you mean to attach it to a static or rogue body? See the documentation for more information.\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBody *body = shape->body;\n\tcpBodyAddShape(body, shape);\n\tcpShapeUpdate(shape, body->p, body->rot);\n\tcpSpatialIndexInsert(space->staticShapes, shape, shape->hashid);\n\tshape->space = space;\n\t\n\treturn shape;\n}\n\ncpBody *\ncpSpaceAddBody(cpSpace *space, cpBody *body)\n{\n\tcpAssertHard(!cpBodyIsStatic(body), \"Do not add static bodies to a space. Static bodies do not move and should not be simulated.\");\n\tcpAssertHard(body->space != space, \"You have already added this body to this space. You must not add it a second time.\");\n\tcpAssertHard(!body->space, \"You have already added this body to another space. You cannot add it to a second.\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpArrayPush(space->bodies, body);\n\tbody->space = space;\n\t\n\treturn body;\n}\n\ncpConstraint *\ncpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint)\n{\n\tcpAssertHard(constraint->space != space, \"You have already added this constraint to this space. You must not add it a second time.\");\n\tcpAssertHard(!constraint->space, \"You have already added this constraint to another space. You cannot add it to a second.\");\n\tcpAssertHard(constraint->a && constraint->b, \"Constraint is attached to a NULL body.\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBodyActivate(constraint->a);\n\tcpBodyActivate(constraint->b);\n\tcpArrayPush(space->constraints, constraint);\n\t\n\t// Push onto the heads of the bodies' constraint lists\n\tcpBody *a = constraint->a, *b = constraint->b;\n\tconstraint->next_a = a->constraintList; a->constraintList = constraint;\n\tconstraint->next_b = b->constraintList; b->constraintList = constraint;\n\tconstraint->space = space;\n\t\n\treturn constraint;\n}\n\nstruct arbiterFilterContext {\n\tcpSpace *space;\n\tcpBody *body;\n\tcpShape *shape;\n};\n\nstatic cpBool\ncachedArbitersFilter(cpArbiter *arb, struct arbiterFilterContext *context)\n{\n\tcpShape *shape = context->shape;\n\tcpBody *body = context->body;\n\t\n\t\n\t// Match on the filter shape, or if it's NULL the filter body\n\tif(\n\t\t(body == arb->body_a && (shape == arb->a || shape == NULL)) ||\n\t\t(body == arb->body_b && (shape == arb->b || shape == NULL))\n\t){\n\t\t// Call separate when removing shapes.\n\t\tif(shape && arb->state != cpArbiterStateCached) cpArbiterCallSeparate(arb, context->space);\n\t\t\n\t\tcpArbiterUnthread(arb);\n\t\tcpArrayDeleteObj(context->space->arbiters, arb);\n\t\tcpArrayPush(context->space->pooledArbiters, arb);\n\t\t\n\t\treturn cpFalse;\n\t}\n\t\n\treturn cpTrue;\n}\n\nvoid\ncpSpaceFilterArbiters(cpSpace *space, cpBody *body, cpShape *filter)\n{\n\tcpSpaceLock(space); {\n\t\tstruct arbiterFilterContext context = {space, body, filter};\n\t\tcpHashSetFilter(space->cachedArbiters, (cpHashSetFilterFunc)cachedArbitersFilter, &context);\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\nvoid\ncpSpaceRemoveShape(cpSpace *space, cpShape *shape)\n{\n\tcpBody *body = shape->body;\n\tif(cpBodyIsStatic(body)){\n\t\tcpSpaceRemoveStaticShape(space, shape);\n\t} else {\n\t\tcpAssertHard(cpSpaceContainsShape(space, shape), \"Cannot remove a shape that was not added to the space. (Removed twice maybe?)\");\n\t\tcpAssertSpaceUnlocked(space);\n\t\t\n\t\tcpBodyActivate(body);\n\t\tcpBodyRemoveShape(body, shape);\n\t\tcpSpaceFilterArbiters(space, body, shape);\n\t\tcpSpatialIndexRemove(space->activeShapes, shape, shape->hashid);\n\t\tshape->space = NULL;\n\t}\n}\n\nvoid\ncpSpaceRemoveStaticShape(cpSpace *space, cpShape *shape)\n{\n\tcpAssertHard(cpSpaceContainsShape(space, shape), \"Cannot remove a static or sleeping shape that was not added to the space. (Removed twice maybe?)\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBody *body = shape->body;\n\tif(cpBodyIsStatic(body)) cpBodyActivateStatic(body, shape);\n\tcpBodyRemoveShape(body, shape);\n\tcpSpaceFilterArbiters(space, body, shape);\n\tcpSpatialIndexRemove(space->staticShapes, shape, shape->hashid);\n\tshape->space = NULL;\n}\n\nvoid\ncpSpaceRemoveBody(cpSpace *space, cpBody *body)\n{\n\tcpAssertHard(cpSpaceContainsBody(space, body), \"Cannot remove a body that was not added to the space. (Removed twice maybe?)\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBodyActivate(body);\n//\tcpSpaceFilterArbiters(space, body, NULL);\n\tcpArrayDeleteObj(space->bodies, body);\n\tbody->space = NULL;\n}\n\nvoid\ncpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint)\n{\n\tcpAssertHard(cpSpaceContainsConstraint(space, constraint), \"Cannot remove a constraint that was not added to the space. (Removed twice maybe?)\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBodyActivate(constraint->a);\n\tcpBodyActivate(constraint->b);\n\tcpArrayDeleteObj(space->constraints, constraint);\n\t\n\tcpBodyRemoveConstraint(constraint->a, constraint);\n\tcpBodyRemoveConstraint(constraint->b, constraint);\n\tconstraint->space = NULL;\n}\n\ncpBool cpSpaceContainsShape(cpSpace *space, cpShape *shape)\n{\n\treturn (shape->space == space);\n}\n\ncpBool cpSpaceContainsBody(cpSpace *space, cpBody *body)\n{\n\treturn (body->space == space);\n}\n\ncpBool cpSpaceContainsConstraint(cpSpace *space, cpConstraint *constraint)\n{\n\treturn (constraint->space == space);\n}\n\n//MARK: Static/rogue body conversion.\n\nvoid\ncpSpaceConvertBodyToStatic(cpSpace *space, cpBody *body)\n{\n\tcpAssertHard(!cpBodyIsStatic(body), \"Body is already static.\");\n\tcpAssertHard(cpBodyIsRogue(body), \"Remove the body from the space before calling this function.\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBodySetMass(body, INFINITY);\n\tcpBodySetMoment(body, INFINITY);\n\t\n\tcpBodySetVel(body, cpvzero);\n\tcpBodySetAngVel(body, 0.0f);\n\t\n\tbody->node.idleTime = INFINITY;\n\tCP_BODY_FOREACH_SHAPE(body, shape){\n\t\tcpSpatialIndexRemove(space->activeShapes, shape, shape->hashid);\n\t\tcpSpatialIndexInsert(space->staticShapes, shape, shape->hashid);\n\t}\n}\n\nvoid\ncpSpaceConvertBodyToDynamic(cpSpace *space, cpBody *body, cpFloat m, cpFloat i)\n{\n\tcpAssertHard(cpBodyIsStatic(body), \"Body is already dynamic.\");\n\tcpAssertSpaceUnlocked(space);\n\t\n\tcpBodyActivateStatic(body, NULL);\n\t\n\tcpBodySetMass(body, m);\n\tcpBodySetMoment(body, i);\n\t\n\tbody->node.idleTime = 0.0f;\n\tCP_BODY_FOREACH_SHAPE(body, shape){\n\t\tcpSpatialIndexRemove(space->staticShapes, shape, shape->hashid);\n\t\tcpSpatialIndexInsert(space->activeShapes, shape, shape->hashid);\n\t}\n}\n\n//MARK: Iteration\n\nvoid\ncpSpaceEachBody(cpSpace *space, cpSpaceBodyIteratorFunc func, void *data)\n{\n\tcpSpaceLock(space); {\n\t\tcpArray *bodies = space->bodies;\n\t\t\n\t\tfor(int i=0; i<bodies->num; i++){\n\t\t\tfunc((cpBody *)bodies->arr[i], data);\n\t\t}\n\t\t\n\t\tcpArray *components = space->sleepingComponents;\n\t\tfor(int i=0; i<components->num; i++){\n\t\t\tcpBody *root = (cpBody *)components->arr[i];\n\t\t\t\n\t\t\tcpBody *body = root;\n\t\t\twhile(body){\n\t\t\t\tcpBody *next = body->node.next;\n\t\t\t\tfunc(body, data);\n\t\t\t\tbody = next;\n\t\t\t}\n\t\t}\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\ntypedef struct spaceShapeContext {\n\tcpSpaceShapeIteratorFunc func;\n\tvoid *data;\n} spaceShapeContext;\n\nstatic void\nspaceEachShapeIterator(cpShape *shape, spaceShapeContext *context)\n{\n\tcontext->func(shape, context->data);\n}\n\nvoid\ncpSpaceEachShape(cpSpace *space, cpSpaceShapeIteratorFunc func, void *data)\n{\n\tcpSpaceLock(space); {\n\t\tspaceShapeContext context = {func, data};\n\t\tcpSpatialIndexEach(space->activeShapes, (cpSpatialIndexIteratorFunc)spaceEachShapeIterator, &context);\n\t\tcpSpatialIndexEach(space->staticShapes, (cpSpatialIndexIteratorFunc)spaceEachShapeIterator, &context);\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\nvoid\ncpSpaceEachConstraint(cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data)\n{\n\tcpSpaceLock(space); {\n\t\tcpArray *constraints = space->constraints;\n\t\t\n\t\tfor(int i=0; i<constraints->num; i++){\n\t\t\tfunc((cpConstraint *)constraints->arr[i], data);\n\t\t}\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\n//MARK: Spatial Index Management\n\nstatic void\nupdateBBCache(cpShape *shape, void *unused)\n{\n\tcpBody *body = shape->body;\n\tcpShapeUpdate(shape, body->p, body->rot);\n}\n\nvoid \ncpSpaceReindexStatic(cpSpace *space)\n{\n\tcpAssertHard(!space->locked, \"You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete.\");\n\t\n\tcpSpatialIndexEach(space->staticShapes, (cpSpatialIndexIteratorFunc)&updateBBCache, NULL);\n\tcpSpatialIndexReindex(space->staticShapes);\n}\n\nvoid\ncpSpaceReindexShape(cpSpace *space, cpShape *shape)\n{\n\tcpAssertHard(!space->locked, \"You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete.\");\n\t\n\tcpBody *body = shape->body;\n\tcpShapeUpdate(shape, body->p, body->rot);\n\t\n\t// attempt to rehash the shape in both hashes\n\tcpSpatialIndexReindexObject(space->activeShapes, shape, shape->hashid);\n\tcpSpatialIndexReindexObject(space->staticShapes, shape, shape->hashid);\n}\n\nvoid\ncpSpaceReindexShapesForBody(cpSpace *space, cpBody *body)\n{\n\tCP_BODY_FOREACH_SHAPE(body, shape) cpSpaceReindexShape(space, shape);\n}\n\n\nstatic void\ncopyShapes(cpShape *shape, cpSpatialIndex *index)\n{\n\tcpSpatialIndexInsert(index, shape, shape->hashid);\n}\n\nvoid\ncpSpaceUseSpatialHash(cpSpace *space, cpFloat dim, int count)\n{\n\tcpSpatialIndex *staticShapes = cpSpaceHashNew(dim, count, (cpSpatialIndexBBFunc)cpShapeGetBB, NULL);\n\tcpSpatialIndex *activeShapes = cpSpaceHashNew(dim, count, (cpSpatialIndexBBFunc)cpShapeGetBB, staticShapes);\n\t\n\tcpSpatialIndexEach(space->staticShapes, (cpSpatialIndexIteratorFunc)copyShapes, staticShapes);\n\tcpSpatialIndexEach(space->activeShapes, (cpSpatialIndexIteratorFunc)copyShapes, activeShapes);\n\t\n\tcpSpatialIndexFree(space->staticShapes);\n\tcpSpatialIndexFree(space->activeShapes);\n\t\n\tspace->staticShapes = staticShapes;\n\tspace->activeShapes = activeShapes;\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpSpaceComponent.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include <string.h>\n\n#include \"chipmunk_private.h\"\n\n//MARK: Sleeping Functions\n\nvoid\ncpSpaceActivateBody(cpSpace *space, cpBody *body)\n{\n\tcpAssertHard(!cpBodyIsRogue(body), \"Internal error: Attempting to activate a rogue body.\");\n\t\t\n\tif(space->locked){\n\t\t// cpSpaceActivateBody() is called again once the space is unlocked\n\t\tif(!cpArrayContains(space->rousedBodies, body)) cpArrayPush(space->rousedBodies, body);\n\t} else {\n\t\tcpAssertSoft(body->node.root == NULL && body->node.next == NULL, \"Internal error: Activating body non-NULL node pointers.\");\n\t\tcpArrayPush(space->bodies, body);\n\n\t\tCP_BODY_FOREACH_SHAPE(body, shape){\n\t\t\tcpSpatialIndexRemove(space->staticShapes, shape, shape->hashid);\n\t\t\tcpSpatialIndexInsert(space->activeShapes, shape, shape->hashid);\n\t\t}\n\t\t\n\t\tCP_BODY_FOREACH_ARBITER(body, arb){\n\t\t\tcpBody *bodyA = arb->body_a;\n\t\t\t\n\t\t\t// Arbiters are shared between two bodies that are always woken up together.\n\t\t\t// You only want to restore the arbiter once, so bodyA is arbitrarily chosen to own the arbiter.\n\t\t\t// The edge case is when static bodies are involved as the static bodies never actually sleep.\n\t\t\t// If the static body is bodyB then all is good. If the static body is bodyA, that can easily be checked.\n\t\t\tif(body == bodyA || cpBodyIsStatic(bodyA)){\n\t\t\t\tint numContacts = arb->numContacts;\n\t\t\t\tcpContact *contacts = arb->contacts;\n\t\t\t\t\n\t\t\t\t// Restore contact values back to the space's contact buffer memory\n\t\t\t\tarb->contacts = cpContactBufferGetArray(space);\n\t\t\t\tmemcpy(arb->contacts, contacts, numContacts*sizeof(cpContact));\n\t\t\t\tcpSpacePushContacts(space, numContacts);\n\t\t\t\t\n\t\t\t\t// Reinsert the arbiter into the arbiter cache\n\t\t\t\tcpShape *a = arb->a, *b = arb->b;\n\t\t\t\tcpShape *shape_pair[] = {a, b};\n\t\t\t\tcpHashValue arbHashID = CP_HASH_PAIR((cpHashValue)a, (cpHashValue)b);\n\t\t\t\tcpHashSetInsert(space->cachedArbiters, arbHashID, shape_pair, arb, NULL);\n\t\t\t\t\n\t\t\t\t// Update the arbiter's state\n\t\t\t\tarb->stamp = space->stamp;\n\t\t\t\tarb->handler = cpSpaceLookupHandler(space, a->collision_type, b->collision_type);\n\t\t\t\tcpArrayPush(space->arbiters, arb);\n\t\t\t\t\n\t\t\t\tcpfree(contacts);\n\t\t\t}\n\t\t}\n\t\t\n\t\tCP_BODY_FOREACH_CONSTRAINT(body, constraint){\n\t\t\tcpBody *bodyA = constraint->a;\n\t\t\tif(body == bodyA || cpBodyIsStatic(bodyA)) cpArrayPush(space->constraints, constraint);\n\t\t}\n\t}\n}\n\nstatic void\ncpSpaceDeactivateBody(cpSpace *space, cpBody *body)\n{\n\tcpAssertHard(!cpBodyIsRogue(body), \"Internal error: Attempting to deactivate a rouge body.\");\n\t\n\tcpArrayDeleteObj(space->bodies, body);\n\t\n\tCP_BODY_FOREACH_SHAPE(body, shape){\n\t\tcpSpatialIndexRemove(space->activeShapes, shape, shape->hashid);\n\t\tcpSpatialIndexInsert(space->staticShapes, shape, shape->hashid);\n\t}\n\t\n\tCP_BODY_FOREACH_ARBITER(body, arb){\n\t\tcpBody *bodyA = arb->body_a;\n\t\tif(body == bodyA || cpBodyIsStatic(bodyA)){\n\t\t\tcpSpaceUncacheArbiter(space, arb);\n\t\t\t\n\t\t\t// Save contact values to a new block of memory so they won't time out\n\t\t\tsize_t bytes = arb->numContacts*sizeof(cpContact);\n\t\t\tcpContact *contacts = (cpContact *)cpcalloc(1, bytes);\n\t\t\tmemcpy(contacts, arb->contacts, bytes);\n\t\t\tarb->contacts = contacts;\n\t\t}\n\t}\n\t\t\n\tCP_BODY_FOREACH_CONSTRAINT(body, constraint){\n\t\tcpBody *bodyA = constraint->a;\n\t\tif(body == bodyA || cpBodyIsStatic(bodyA)) cpArrayDeleteObj(space->constraints, constraint);\n\t}\n}\n\nstatic inline cpBody *\nComponentRoot(cpBody *body)\n{\n\treturn (body ? body->node.root : NULL);\n}\n\nstatic inline void\nComponentActivate(cpBody *root)\n{\n\tif(!root || !cpBodyIsSleeping(root)) return;\n\tcpAssertHard(!cpBodyIsRogue(root), \"Internal Error: ComponentActivate() called on a rogue body.\");\n\t\n\tcpSpace *space = root->space;\n\tcpBody *body = root;\n\twhile(body){\n\t\tcpBody *next = body->node.next;\n\t\t\n\t\tbody->node.idleTime = 0.0f;\n\t\tbody->node.root = NULL;\n\t\tbody->node.next = NULL;\n\t\tcpSpaceActivateBody(space, body);\n\t\t\n\t\tbody = next;\n\t}\n\t\n\tcpArrayDeleteObj(space->sleepingComponents, root);\n}\n\nvoid\ncpBodyActivate(cpBody *body)\n{\n\tif(!cpBodyIsRogue(body)){\n\t\tbody->node.idleTime = 0.0f;\n\t\tComponentActivate(ComponentRoot(body));\n\t}\n\t\n\tCP_BODY_FOREACH_ARBITER(body, arb){\n\t\t// Reset the idle timer of things the body is touching as well.\n\t\t// That way things don't get left hanging in the air.\n\t\tcpBody *other = (arb->body_a == body ? arb->body_b : arb->body_a);\n\t\tif(!cpBodyIsStatic(other)) other->node.idleTime = 0.0f;\n\t}\n}\n\nvoid\ncpBodyActivateStatic(cpBody *body, cpShape *filter)\n{\n\tcpAssertHard(cpBodyIsStatic(body), \"cpBodyActivateStatic() called on a non-static body.\");\n\t\n\tCP_BODY_FOREACH_ARBITER(body, arb){\n\t\tif(!filter || filter == arb->a || filter == arb->b){\n\t\t\tcpBodyActivate(arb->body_a == body ? arb->body_b : arb->body_a);\n\t\t}\n\t}\n\t\n\t// TODO should also activate joints?\n}\n\nstatic inline void\ncpBodyPushArbiter(cpBody *body, cpArbiter *arb)\n{\n\tcpAssertSoft(cpArbiterThreadForBody(arb, body)->next == NULL, \"Internal Error: Dangling contact graph pointers detected. (A)\");\n\tcpAssertSoft(cpArbiterThreadForBody(arb, body)->prev == NULL, \"Internal Error: Dangling contact graph pointers detected. (B)\");\n\t\n\tcpArbiter *next = body->arbiterList;\n\tcpAssertSoft(next == NULL || cpArbiterThreadForBody(next, body)->prev == NULL, \"Internal Error: Dangling contact graph pointers detected. (C)\");\n\tcpArbiterThreadForBody(arb, body)->next = next;\n\t\n\tif(next) cpArbiterThreadForBody(next, body)->prev = arb;\n\tbody->arbiterList = arb;\n}\n\nstatic inline void\nComponentAdd(cpBody *root, cpBody *body){\n\tbody->node.root = root;\n\n\tif(body != root){\n\t\tbody->node.next = root->node.next;\n\t\troot->node.next = body;\n\t}\n}\n\nstatic inline void\nFloodFillComponent(cpBody *root, cpBody *body)\n{\n\t// Rogue bodies cannot be put to sleep and prevent bodies they are touching from sleepining anyway.\n\t// Static bodies (which are a type of rogue body) are effectively sleeping all the time.\n\tif(!cpBodyIsRogue(body)){\n\t\tcpBody *other_root = ComponentRoot(body);\n\t\tif(other_root == NULL){\n\t\t\tComponentAdd(root, body);\n\t\t\tCP_BODY_FOREACH_ARBITER(body, arb) FloodFillComponent(root, (body == arb->body_a ? arb->body_b : arb->body_a));\n\t\t\tCP_BODY_FOREACH_CONSTRAINT(body, constraint) FloodFillComponent(root, (body == constraint->a ? constraint->b : constraint->a));\n\t\t} else {\n\t\t\tcpAssertSoft(other_root == root, \"Internal Error: Inconsistency dectected in the contact graph.\");\n\t\t}\n\t}\n}\n\nstatic inline cpBool\nComponentActive(cpBody *root, cpFloat threshold)\n{\n\tCP_BODY_FOREACH_COMPONENT(root, body){\n\t\tif(body->node.idleTime < threshold) return cpTrue;\n\t}\n\t\n\treturn cpFalse;\n}\n\nvoid\ncpSpaceProcessComponents(cpSpace *space, cpFloat dt)\n{\n\tcpBool sleep = (space->sleepTimeThreshold != INFINITY);\n\tcpArray *bodies = space->bodies;\n\t\n#ifndef NDEBUG\n\tfor(int i=0; i<bodies->num; i++){\n\t\tcpBody *body = (cpBody*)bodies->arr[i];\n\t\t\n\t\tcpAssertSoft(body->node.next == NULL, \"Internal Error: Dangling next pointer detected in contact graph.\");\n\t\tcpAssertSoft(body->node.root == NULL, \"Internal Error: Dangling root pointer detected in contact graph.\");\n\t}\n#endif\n\t\n\t// Calculate the kinetic energy of all the bodies.\n\tif(sleep){\n\t\tcpFloat dv = space->idleSpeedThreshold;\n\t\tcpFloat dvsq = (dv ? dv*dv : cpvlengthsq(space->gravity)*dt*dt);\n\t\t\n\t\t// update idling and reset component nodes\n\t\tfor(int i=0; i<bodies->num; i++){\n\t\t\tcpBody *body = (cpBody*)bodies->arr[i];\n\t\t\t\n\t\t\t// Need to deal with infinite mass objects\n\t\t\tcpFloat keThreshold = (dvsq ? body->m*dvsq : 0.0f);\n\t\t\tbody->node.idleTime = (cpBodyKineticEnergy(body) > keThreshold ? 0.0f : body->node.idleTime + dt);\n\t\t}\n\t}\n\t\n\t// Awaken any sleeping bodies found and then push arbiters to the bodies' lists.\n\tcpArray *arbiters = space->arbiters;\n\tfor(int i=0, count=arbiters->num; i<count; i++){\n\t\tcpArbiter *arb = (cpArbiter*)arbiters->arr[i];\n\t\tcpBody *a = arb->body_a, *b = arb->body_b;\n\t\t\n\t\tif(sleep){\n\t\t\tif((cpBodyIsRogue(b) && !cpBodyIsStatic(b)) || cpBodyIsSleeping(a)) cpBodyActivate(a);\n\t\t\tif((cpBodyIsRogue(a) && !cpBodyIsStatic(a)) || cpBodyIsSleeping(b)) cpBodyActivate(b);\n\t\t}\n\t\t\n\t\tcpBodyPushArbiter(a, arb);\n\t\tcpBodyPushArbiter(b, arb);\n\t}\n\t\n\tif(sleep){\n\t\t// Bodies should be held active if connected by a joint to a non-static rouge body.\n\t\tcpArray *constraints = space->constraints;\n\t\tfor(int i=0; i<constraints->num; i++){\n\t\t\tcpConstraint *constraint = (cpConstraint *)constraints->arr[i];\n\t\t\tcpBody *a = constraint->a, *b = constraint->b;\n\t\t\t\n\t\t\tif(cpBodyIsRogue(b) && !cpBodyIsStatic(b)) cpBodyActivate(a);\n\t\t\tif(cpBodyIsRogue(a) && !cpBodyIsStatic(a)) cpBodyActivate(b);\n\t\t}\n\t\t\n\t\t// Generate components and deactivate sleeping ones\n\t\tfor(int i=0; i<bodies->num;){\n\t\t\tcpBody *body = (cpBody*)bodies->arr[i];\n\t\t\t\n\t\t\tif(ComponentRoot(body) == NULL){\n\t\t\t\t// Body not in a component yet. Perform a DFS to flood fill mark \n\t\t\t\t// the component in the contact graph using this body as the root.\n\t\t\t\tFloodFillComponent(body, body);\n\t\t\t\t\n\t\t\t\t// Check if the component should be put to sleep.\n\t\t\t\tif(!ComponentActive(body, space->sleepTimeThreshold)){\n\t\t\t\t\tcpArrayPush(space->sleepingComponents, body);\n\t\t\t\t\tCP_BODY_FOREACH_COMPONENT(body, other) cpSpaceDeactivateBody(space, other);\n\t\t\t\t\t\n\t\t\t\t\t// cpSpaceDeactivateBody() removed the current body from the list.\n\t\t\t\t\t// Skip incrementing the index counter.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ti++;\n\t\t\t\n\t\t\t// Only sleeping bodies retain their component node pointers.\n\t\t\tbody->node.root = NULL;\n\t\t\tbody->node.next = NULL;\n\t\t}\n\t}\n}\n\nvoid\ncpBodySleep(cpBody *body)\n{\n\tcpBodySleepWithGroup(body, NULL);\n}\n\nvoid\ncpBodySleepWithGroup(cpBody *body, cpBody *group){\n\tcpAssertHard(!cpBodyIsRogue(body), \"Rogue (and static) bodies cannot be put to sleep.\");\n\t\n\tcpSpace *space = body->space;\n\tcpAssertHard(!space->locked, \"Bodies cannot be put to sleep during a query or a call to cpSpaceStep(). Put these calls into a post-step callback.\");\n\tcpAssertHard(group == NULL || cpBodyIsSleeping(group), \"Cannot use a non-sleeping body as a group identifier.\");\n\t\n\tif(cpBodyIsSleeping(body)){\n\t\tcpAssertHard(ComponentRoot(body) == ComponentRoot(group), \"The body is already sleeping and it's group cannot be reassigned.\");\n\t\treturn;\n\t}\n\t\n\tCP_BODY_FOREACH_SHAPE(body, shape) cpShapeUpdate(shape, body->p, body->rot);\n\tcpSpaceDeactivateBody(space, body);\n\t\n\tif(group){\n\t\tcpBody *root = ComponentRoot(group);\n\t\t\n\t\tcpComponentNode node = {root, root->node.next, 0.0f};\n\t\tbody->node = node;\n\t\t\n\t\troot->node.next = body;\n\t} else {\n\t\tcpComponentNode node = {body, NULL, 0.0f};\n\t\tbody->node = node;\n\t\t\n\t\tcpArrayPush(space->sleepingComponents, body);\n\t}\n\t\n\tcpArrayDeleteObj(space->bodies, body);\n}\n\nstatic void\nactivateTouchingHelper(cpShape *shape, cpContactPointSet *points, cpShape *other){\n\tcpBodyActivate(shape->body);\n}\n\nvoid\ncpSpaceActivateShapesTouchingShape(cpSpace *space, cpShape *shape){\n\tif(space->sleepTimeThreshold != INFINITY){\n\t\tcpSpaceShapeQuery(space, shape, (cpSpaceShapeQueryFunc)activateTouchingHelper, shape);\n\t}\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpSpaceHash.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n#include \"prime.h\"\n\ntypedef struct cpSpaceHashBin cpSpaceHashBin;\ntypedef struct cpHandle cpHandle;\n\nstruct cpSpaceHash {\n\tcpSpatialIndex spatialIndex;\n\t\n\tint numcells;\n\tcpFloat celldim;\n\t\n\tcpSpaceHashBin **table;\n\tcpHashSet *handleSet;\n\t\n\tcpSpaceHashBin *pooledBins;\n\tcpArray *pooledHandles;\n\tcpArray *allocatedBuffers;\n\t\n\tcpTimestamp stamp;\n};\n\n\n//MARK: Handle Functions\n\nstruct cpHandle {\n\tvoid *obj;\n\tint retain;\n\tcpTimestamp stamp;\n};\n\nstatic cpHandle*\ncpHandleInit(cpHandle *hand, void *obj)\n{\n\thand->obj = obj;\n\thand->retain = 0;\n\thand->stamp = 0;\n\t\n\treturn hand;\n}\n\nstatic inline void cpHandleRetain(cpHandle *hand){hand->retain++;}\n\nstatic inline void\ncpHandleRelease(cpHandle *hand, cpArray *pooledHandles)\n{\n\thand->retain--;\n\tif(hand->retain == 0) cpArrayPush(pooledHandles, hand);\n}\n\nstatic int handleSetEql(void *obj, cpHandle *hand){return (obj == hand->obj);}\n\nstatic void *\nhandleSetTrans(void *obj, cpSpaceHash *hash)\n{\n\tif(hash->pooledHandles->num == 0){\n\t\t// handle pool is exhausted, make more\n\t\tint count = CP_BUFFER_BYTES/sizeof(cpHandle);\n\t\tcpAssertHard(count, \"Internal Error: Buffer size is too small.\");\n\t\t\n\t\tcpHandle *buffer = (cpHandle *)cpcalloc(1, CP_BUFFER_BYTES);\n\t\tcpArrayPush(hash->allocatedBuffers, buffer);\n\t\t\n\t\tfor(int i=0; i<count; i++) cpArrayPush(hash->pooledHandles, buffer + i);\n\t}\n\t\n\tcpHandle *hand = cpHandleInit((cpHandle *)cpArrayPop(hash->pooledHandles), obj);\n\tcpHandleRetain(hand);\n\t\n\treturn hand;\n}\n\n//MARK: Bin Functions\n\nstruct cpSpaceHashBin {\n\tcpHandle *handle;\n\tcpSpaceHashBin *next;\n};\n\nstatic inline void\nrecycleBin(cpSpaceHash *hash, cpSpaceHashBin *bin)\n{\n\tbin->next = hash->pooledBins;\n\thash->pooledBins = bin;\n}\n\nstatic inline void\nclearTableCell(cpSpaceHash *hash, int idx)\n{\n\tcpSpaceHashBin *bin = hash->table[idx];\n\twhile(bin){\n\t\tcpSpaceHashBin *next = bin->next;\n\t\t\n\t\tcpHandleRelease(bin->handle, hash->pooledHandles);\n\t\trecycleBin(hash, bin);\n\t\t\n\t\tbin = next;\n\t}\n\t\n\thash->table[idx] = NULL;\n}\n\nstatic void\nclearTable(cpSpaceHash *hash)\n{\n\tfor(int i=0; i<hash->numcells; i++) clearTableCell(hash, i);\n}\n\n// Get a recycled or new bin.\nstatic inline cpSpaceHashBin *\ngetEmptyBin(cpSpaceHash *hash)\n{\n\tcpSpaceHashBin *bin = hash->pooledBins;\n\t\n\tif(bin){\n\t\thash->pooledBins = bin->next;\n\t\treturn bin;\n\t} else {\n\t\t// Pool is exhausted, make more\n\t\tint count = CP_BUFFER_BYTES/sizeof(cpSpaceHashBin);\n\t\tcpAssertHard(count, \"Internal Error: Buffer size is too small.\");\n\t\t\n\t\tcpSpaceHashBin *buffer = (cpSpaceHashBin *)cpcalloc(1, CP_BUFFER_BYTES);\n\t\tcpArrayPush(hash->allocatedBuffers, buffer);\n\t\t\n\t\t// push all but the first one, return the first instead\n\t\tfor(int i=1; i<count; i++) recycleBin(hash, buffer + i);\n\t\treturn buffer;\n\t}\n}\n\n//MARK: Memory Management Functions\n\ncpSpaceHash *\ncpSpaceHashAlloc(void)\n{\n\treturn (cpSpaceHash *)cpcalloc(1, sizeof(cpSpaceHash));\n}\n\n// Frees the old table, and allocate a new one.\nstatic void\ncpSpaceHashAllocTable(cpSpaceHash *hash, int numcells)\n{\n\tcpfree(hash->table);\n\t\n\thash->numcells = numcells;\n\thash->table = (cpSpaceHashBin **)cpcalloc(numcells, sizeof(cpSpaceHashBin *));\n}\n\nstatic inline cpSpatialIndexClass *Klass();\n\ncpSpatialIndex *\ncpSpaceHashInit(cpSpaceHash *hash, cpFloat celldim, int numcells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex)\n{\n\tcpSpatialIndexInit((cpSpatialIndex *)hash, Klass(), bbfunc, staticIndex);\n\t\n\tcpSpaceHashAllocTable(hash, next_prime(numcells));\n\thash->celldim = celldim;\n\t\n\thash->handleSet = cpHashSetNew(0, (cpHashSetEqlFunc)handleSetEql);\n\t\n\thash->pooledHandles = cpArrayNew(0);\n\t\n\thash->pooledBins = NULL;\n\thash->allocatedBuffers = cpArrayNew(0);\n\t\n\thash->stamp = 1;\n\t\n\treturn (cpSpatialIndex *)hash;\n}\n\ncpSpatialIndex *\ncpSpaceHashNew(cpFloat celldim, int cells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex)\n{\n\treturn cpSpaceHashInit(cpSpaceHashAlloc(), celldim, cells, bbfunc, staticIndex);\n}\n\nstatic void\ncpSpaceHashDestroy(cpSpaceHash *hash)\n{\n\tif(hash->table) clearTable(hash);\n\tcpfree(hash->table);\n\t\n\tcpHashSetFree(hash->handleSet);\n\t\n\tcpArrayFreeEach(hash->allocatedBuffers, cpfree);\n\tcpArrayFree(hash->allocatedBuffers);\n\tcpArrayFree(hash->pooledHandles);\n}\n\n//MARK: Helper Functions\n\nstatic inline cpBool\ncontainsHandle(cpSpaceHashBin *bin, cpHandle *hand)\n{\n\twhile(bin){\n\t\tif(bin->handle == hand) return cpTrue;\n\t\tbin = bin->next;\n\t}\n\t\n\treturn cpFalse;\n}\n\n// The hash function itself.\nstatic inline cpHashValue\nhash_func(cpHashValue x, cpHashValue y, cpHashValue n)\n{\n\treturn (x*1640531513ul ^ y*2654435789ul) % n;\n}\n\n// Much faster than (int)floor(f)\n// Profiling showed floor() to be a sizable performance hog\nstatic inline int\nfloor_int(cpFloat f)\n{\n\tint i = (int)f;\n\treturn (f < 0.0f && f != i ? i - 1 : i);\n}\n\nstatic inline void\nhashHandle(cpSpaceHash *hash, cpHandle *hand, cpBB bb)\n{\n\t// Find the dimensions in cell coordinates.\n\tcpFloat dim = hash->celldim;\n\tint l = floor_int(bb.l/dim); // Fix by ShiftZ\n\tint r = floor_int(bb.r/dim);\n\tint b = floor_int(bb.b/dim);\n\tint t = floor_int(bb.t/dim);\n\t\n\tint n = hash->numcells;\n\tfor(int i=l; i<=r; i++){\n\t\tfor(int j=b; j<=t; j++){\n\t\t\tcpHashValue idx = hash_func(i,j,n);\n\t\t\tcpSpaceHashBin *bin = hash->table[idx];\n\t\t\t\n\t\t\t// Don't add an object twice to the same cell.\n\t\t\tif(containsHandle(bin, hand)) continue;\n\n\t\t\tcpHandleRetain(hand);\n\t\t\t// Insert a new bin for the handle in this cell.\n\t\t\tcpSpaceHashBin *newBin = getEmptyBin(hash);\n\t\t\tnewBin->handle = hand;\n\t\t\tnewBin->next = bin;\n\t\t\thash->table[idx] = newBin;\n\t\t}\n\t}\n}\n\n//MARK: Basic Operations\n\nstatic void\ncpSpaceHashInsert(cpSpaceHash *hash, void *obj, cpHashValue hashid)\n{\n\tcpHandle *hand = (cpHandle *)cpHashSetInsert(hash->handleSet, hashid, obj, hash, (cpHashSetTransFunc)handleSetTrans);\n\thashHandle(hash, hand, hash->spatialIndex.bbfunc(obj));\n}\n\nstatic void\ncpSpaceHashRehashObject(cpSpaceHash *hash, void *obj, cpHashValue hashid)\n{\n\tcpHandle *hand = (cpHandle *)cpHashSetRemove(hash->handleSet, hashid, obj);\n\t\n\tif(hand){\n\t\thand->obj = NULL;\n\t\tcpHandleRelease(hand, hash->pooledHandles);\n\t\t\n\t\tcpSpaceHashInsert(hash, obj, hashid);\n\t}\n}\n\nstatic void\nrehash_helper(cpHandle *hand, cpSpaceHash *hash)\n{\n\thashHandle(hash, hand, hash->spatialIndex.bbfunc(hand->obj));\n}\n\nstatic void\ncpSpaceHashRehash(cpSpaceHash *hash)\n{\n\tclearTable(hash);\n\tcpHashSetEach(hash->handleSet, (cpHashSetIteratorFunc)rehash_helper, hash);\n}\n\nstatic void\ncpSpaceHashRemove(cpSpaceHash *hash, void *obj, cpHashValue hashid)\n{\n\tcpHandle *hand = (cpHandle *)cpHashSetRemove(hash->handleSet, hashid, obj);\n\t\n\tif(hand){\n\t\thand->obj = NULL;\n\t\tcpHandleRelease(hand, hash->pooledHandles);\n\t}\n}\n\ntypedef struct eachContext {\n\tcpSpatialIndexIteratorFunc func;\n\tvoid *data;\n} eachContext;\n\nstatic void eachHelper(cpHandle *hand, eachContext *context){context->func(hand->obj, context->data);}\n\nstatic void\ncpSpaceHashEach(cpSpaceHash *hash, cpSpatialIndexIteratorFunc func, void *data)\n{\n\teachContext context = {func, data};\n\tcpHashSetEach(hash->handleSet, (cpHashSetIteratorFunc)eachHelper, &context);\n}\n\nstatic void\nremove_orphaned_handles(cpSpaceHash *hash, cpSpaceHashBin **bin_ptr)\n{\n\tcpSpaceHashBin *bin = *bin_ptr;\n\twhile(bin){\n\t\tcpHandle *hand = bin->handle;\n\t\tcpSpaceHashBin *next = bin->next;\n\t\t\n\t\tif(!hand->obj){\n\t\t\t// orphaned handle, unlink and recycle the bin\n\t\t\t(*bin_ptr) = bin->next;\n\t\t\trecycleBin(hash, bin);\n\t\t\t\n\t\t\tcpHandleRelease(hand, hash->pooledHandles);\n\t\t} else {\n\t\t\tbin_ptr = &bin->next;\n\t\t}\n\t\t\n\t\tbin = next;\n\t}\n}\n\n//MARK: Query Functions\n\nstatic inline void\nquery_helper(cpSpaceHash *hash, cpSpaceHashBin **bin_ptr, void *obj, cpSpatialIndexQueryFunc func, void *data)\n{\n\trestart:\n\tfor(cpSpaceHashBin *bin = *bin_ptr; bin; bin = bin->next){\n\t\tcpHandle *hand = bin->handle;\n\t\tvoid *other = hand->obj;\n\t\t\n\t\tif(hand->stamp == hash->stamp || obj == other){\n\t\t\tcontinue;\n\t\t} else if(other){\n\t\t\tfunc(obj, other, data);\n\t\t\thand->stamp = hash->stamp;\n\t\t} else {\n\t\t\t// The object for this handle has been removed\n\t\t\t// cleanup this cell and restart the query\n\t\t\tremove_orphaned_handles(hash, bin_ptr);\n\t\t\tgoto restart; // GCC not smart enough/able to tail call an inlined function.\n\t\t}\n\t}\n}\n\nstatic void\ncpSpaceHashQuery(cpSpaceHash *hash, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data)\n{\n\t// Get the dimensions in cell coordinates.\n\tcpFloat dim = hash->celldim;\n\tint l = floor_int(bb.l/dim);  // Fix by ShiftZ\n\tint r = floor_int(bb.r/dim);\n\tint b = floor_int(bb.b/dim);\n\tint t = floor_int(bb.t/dim);\n\t\n\tint n = hash->numcells;\n\tcpSpaceHashBin **table = hash->table;\n\t\n\t// Iterate over the cells and query them.\n\tfor(int i=l; i<=r; i++){\n\t\tfor(int j=b; j<=t; j++){\n\t\t\tquery_helper(hash, &table[hash_func(i,j,n)], obj, func, data);\n\t\t}\n\t}\n\t\n\thash->stamp++;\n}\n\n// Similar to struct eachPair above.\ntypedef struct queryRehashContext {\n\tcpSpaceHash *hash;\n\tcpSpatialIndexQueryFunc func;\n\tvoid *data;\n} queryRehashContext;\n\n// Hashset iterator func used with cpSpaceHashQueryRehash().\nstatic void\nqueryRehash_helper(cpHandle *hand, queryRehashContext *context)\n{\n\tcpSpaceHash *hash = context->hash;\n\tcpSpatialIndexQueryFunc func = context->func;\n\tvoid *data = context->data;\n\n\tcpFloat dim = hash->celldim;\n\tint n = hash->numcells;\n\n\tvoid *obj = hand->obj;\n\tcpBB bb = hash->spatialIndex.bbfunc(obj);\n\n\tint l = floor_int(bb.l/dim);\n\tint r = floor_int(bb.r/dim);\n\tint b = floor_int(bb.b/dim);\n\tint t = floor_int(bb.t/dim);\n\t\n\tcpSpaceHashBin **table = hash->table;\n\n\tfor(int i=l; i<=r; i++){\n\t\tfor(int j=b; j<=t; j++){\n\t\t\tcpHashValue idx = hash_func(i,j,n);\n\t\t\tcpSpaceHashBin *bin = table[idx];\n\t\t\t\n\t\t\tif(containsHandle(bin, hand)) continue;\n\t\t\t\n\t\t\tcpHandleRetain(hand); // this MUST be done first in case the object is removed in func()\n\t\t\tquery_helper(hash, &bin, obj, func, data);\n\t\t\t\n\t\t\tcpSpaceHashBin *newBin = getEmptyBin(hash);\n\t\t\tnewBin->handle = hand;\n\t\t\tnewBin->next = bin;\n\t\t\ttable[idx] = newBin;\n\t\t}\n\t}\n\t\n\t// Increment the stamp for each object hashed.\n\thash->stamp++;\n}\n\nstatic void\ncpSpaceHashReindexQuery(cpSpaceHash *hash, cpSpatialIndexQueryFunc func, void *data)\n{\n\tclearTable(hash);\n\t\n\tqueryRehashContext context = {hash, func, data};\n\tcpHashSetEach(hash->handleSet, (cpHashSetIteratorFunc)queryRehash_helper, &context);\n\t\n\tcpSpatialIndexCollideStatic((cpSpatialIndex *)hash, hash->spatialIndex.staticIndex, func, data);\n}\n\nstatic inline cpFloat\nsegmentQuery_helper(cpSpaceHash *hash, cpSpaceHashBin **bin_ptr, void *obj, cpSpatialIndexSegmentQueryFunc func, void *data)\n{\n\tcpFloat t = 1.0f;\n\t \n\trestart:\n\tfor(cpSpaceHashBin *bin = *bin_ptr; bin; bin = bin->next){\n\t\tcpHandle *hand = bin->handle;\n\t\tvoid *other = hand->obj;\n\t\t\n\t\t// Skip over certain conditions\n\t\tif(hand->stamp == hash->stamp){\n\t\t\tcontinue;\n\t\t} else if(other){\n\t\t\tt = cpfmin(t, func(obj, other, data));\n\t\t\thand->stamp = hash->stamp;\n\t\t} else {\n\t\t\t// The object for this handle has been removed\n\t\t\t// cleanup this cell and restart the query\n\t\t\tremove_orphaned_handles(hash, bin_ptr);\n\t\t\tgoto restart; // GCC not smart enough/able to tail call an inlined function.\n\t\t}\n\t}\n\t\n\treturn t;\n}\n\n// modified from http://playtechs.blogspot.com/2007/03/raytracing-on-grid.html\nstatic void\ncpSpaceHashSegmentQuery(cpSpaceHash *hash, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data)\n{\n\ta = cpvmult(a, 1.0f/hash->celldim);\n\tb = cpvmult(b, 1.0f/hash->celldim);\n\t\n\tint cell_x = floor_int(a.x), cell_y = floor_int(a.y);\n\n\tcpFloat t = 0;\n\n\tint x_inc, y_inc;\n\tcpFloat temp_v, temp_h;\n\n\tif (b.x > a.x){\n\t\tx_inc = 1;\n\t\ttemp_h = (cpffloor(a.x + 1.0f) - a.x);\n\t} else {\n\t\tx_inc = -1;\n\t\ttemp_h = (a.x - cpffloor(a.x));\n\t}\n\n\tif (b.y > a.y){\n\t\ty_inc = 1;\n\t\ttemp_v = (cpffloor(a.y + 1.0f) - a.y);\n\t} else {\n\t\ty_inc = -1;\n\t\ttemp_v = (a.y - cpffloor(a.y));\n\t}\n\t\n\t// Division by zero is *very* slow on ARM\n\tcpFloat dx = cpfabs(b.x - a.x), dy = cpfabs(b.y - a.y);\n\tcpFloat dt_dx = (dx ? 1.0f/dx : INFINITY), dt_dy = (dy ? 1.0f/dy : INFINITY);\n\t\n\t// fix NANs in horizontal directions\n\tcpFloat next_h = (temp_h ? temp_h*dt_dx : dt_dx);\n\tcpFloat next_v = (temp_v ? temp_v*dt_dy : dt_dy);\n\t\n\tint n = hash->numcells;\n\tcpSpaceHashBin **table = hash->table;\n\n\twhile(t < t_exit){\n\t\tcpHashValue idx = hash_func(cell_x, cell_y, n);\n\t\tt_exit = cpfmin(t_exit, segmentQuery_helper(hash, &table[idx], obj, func, data));\n\n\t\tif (next_v < next_h){\n\t\t\tcell_y += y_inc;\n\t\t\tt = next_v;\n\t\t\tnext_v += dt_dy;\n\t\t} else {\n\t\t\tcell_x += x_inc;\n\t\t\tt = next_h;\n\t\t\tnext_h += dt_dx;\n\t\t}\n\t}\n\t\n\thash->stamp++;\n}\n\n//MARK: Misc\n\nvoid\ncpSpaceHashResize(cpSpaceHash *hash, cpFloat celldim, int numcells)\n{\n\tif(hash->spatialIndex.klass != Klass()){\n\t\tcpAssertWarn(cpFalse, \"Ignoring cpSpaceHashResize() call to non-cpSpaceHash spatial index.\");\n\t\treturn;\n\t}\n\t\n\tclearTable(hash);\n\t\n\thash->celldim = celldim;\n\tcpSpaceHashAllocTable(hash, next_prime(numcells));\n}\n\nstatic int\ncpSpaceHashCount(cpSpaceHash *hash)\n{\n\treturn cpHashSetCount(hash->handleSet);\n}\n\nstatic int\ncpSpaceHashContains(cpSpaceHash *hash, void *obj, cpHashValue hashid)\n{\n\treturn cpHashSetFind(hash->handleSet, hashid, obj) != NULL;\n}\n\nstatic cpSpatialIndexClass klass = {\n\t(cpSpatialIndexDestroyImpl)cpSpaceHashDestroy,\n\t\n\t(cpSpatialIndexCountImpl)cpSpaceHashCount,\n\t(cpSpatialIndexEachImpl)cpSpaceHashEach,\n\t(cpSpatialIndexContainsImpl)cpSpaceHashContains,\n\t\n\t(cpSpatialIndexInsertImpl)cpSpaceHashInsert,\n\t(cpSpatialIndexRemoveImpl)cpSpaceHashRemove,\n\t\n\t(cpSpatialIndexReindexImpl)cpSpaceHashRehash,\n\t(cpSpatialIndexReindexObjectImpl)cpSpaceHashRehashObject,\n\t(cpSpatialIndexReindexQueryImpl)cpSpaceHashReindexQuery,\n\t\n\t(cpSpatialIndexQueryImpl)cpSpaceHashQuery,\n\t(cpSpatialIndexSegmentQueryImpl)cpSpaceHashSegmentQuery,\n};\n\nstatic inline cpSpatialIndexClass *Klass(){return &klass;}\n\n//MARK: Debug Drawing\n\n//#define CP_BBTREE_DEBUG_DRAW\n#ifdef CP_BBTREE_DEBUG_DRAW\n#include \"OpenGL/gl.h\"\n#include \"OpenGL/glu.h\"\n#include <GLUT/glut.h>\n\nvoid\ncpSpaceHashRenderDebug(cpSpatialIndex *index)\n{\n\tif(index->klass != &klass){\n\t\tcpAssertWarn(cpFalse, \"Ignoring cpSpaceHashRenderDebug() call to non-spatial hash spatial index.\");\n\t\treturn;\n\t}\n\t\n\tcpSpaceHash *hash = (cpSpaceHash *)index;\n\tcpBB bb = cpBBNew(-320, -240, 320, 240);\n\t\n\tcpFloat dim = hash->celldim;\n\tint n = hash->numcells;\n\t\n\tint l = (int)floor(bb.l/dim);\n\tint r = (int)floor(bb.r/dim);\n\tint b = (int)floor(bb.b/dim);\n\tint t = (int)floor(bb.t/dim);\n\t\n\tfor(int i=l; i<=r; i++){\n\t\tfor(int j=b; j<=t; j++){\n\t\t\tint cell_count = 0;\n\t\t\t\n\t\t\tint index = hash_func(i,j,n);\n\t\t\tfor(cpSpaceHashBin *bin = hash->table[index]; bin; bin = bin->next)\n\t\t\t\tcell_count++;\n\t\t\t\n\t\t\tGLfloat v = 1.0f - (GLfloat)cell_count/10.0f;\n\t\t\tglColor3f(v,v,v);\n\t\t\tglRectf(i*dim, j*dim, (i + 1)*dim, (j + 1)*dim);\n\t\t}\n\t}\n}\n#endif\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpSpaceQuery.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include \"chipmunk_private.h\"\n\n//MARK: Point Query Functions\n\nstruct PointQueryContext {\n\tcpVect point;\n\tcpLayers layers;\n\tcpGroup group;\n\tcpSpacePointQueryFunc func;\n\tvoid *data;\n};\n\nstatic void \nPointQuery(struct PointQueryContext *context, cpShape *shape, void *data)\n{\n\tif(\n\t\t!(shape->group && context->group == shape->group) && (context->layers&shape->layers) &&\n\t\tcpShapePointQuery(shape, context->point)\n\t){\n\t\tcontext->func(shape, context->data);\n\t}\n}\n\nvoid\ncpSpacePointQuery(cpSpace *space, cpVect point, cpLayers layers, cpGroup group, cpSpacePointQueryFunc func, void *data)\n{\n\tstruct PointQueryContext context = {point, layers, group, func, data};\n\tcpBB bb = cpBBNewForCircle(point, 0.0f);\n\t\n\tcpSpaceLock(space); {\n    cpSpatialIndexQuery(space->activeShapes, &context, bb, (cpSpatialIndexQueryFunc)PointQuery, data);\n    cpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)PointQuery, data);\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\nstatic void\nPointQueryFirst(cpShape *shape, cpShape **outShape)\n{\n\tif(!shape->sensor) *outShape = shape;\n}\n\ncpShape *\ncpSpacePointQueryFirst(cpSpace *space, cpVect point, cpLayers layers, cpGroup group)\n{\n\tcpShape *shape = NULL;\n\tcpSpacePointQuery(space, point, layers, group, (cpSpacePointQueryFunc)PointQueryFirst, &shape);\n\t\n\treturn shape;\n}\n\n//MARK: Nearest Point Query Functions\n\nstruct NearestPointQueryContext {\n\tcpVect point;\n\tcpFloat maxDistance;\n\tcpLayers layers;\n\tcpGroup group;\n\tcpSpaceNearestPointQueryFunc func;\n};\n\nstatic void \nNearestPointQuery(struct NearestPointQueryContext *context, cpShape *shape, void *data)\n{\n\tif(\n\t\t!(shape->group && context->group == shape->group) && (context->layers&shape->layers)\n\t){\n\t\tcpNearestPointQueryInfo info;\n\t\tcpShapeNearestPointQuery(shape, context->point, &info);\n\t\t\n\t\tif(info.shape && info.d < context->maxDistance) context->func(shape, info.d, info.p, data);\n\t}\n}\n\nvoid\ncpSpaceNearestPointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpLayers layers, cpGroup group, cpSpaceNearestPointQueryFunc func, void *data)\n{\n\tstruct NearestPointQueryContext context = {point, maxDistance, layers, group, func};\n\tcpBB bb = cpBBNewForCircle(point, cpfmax(maxDistance, 0.0f));\n\t\n\tcpSpaceLock(space); {\n\t\tcpSpatialIndexQuery(space->activeShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQuery, data);\n\t\tcpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQuery, data);\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\nstatic void\nNearestPointQueryNearest(struct NearestPointQueryContext *context, cpShape *shape, cpNearestPointQueryInfo *out)\n{\n\tif(\n\t\t!(shape->group && context->group == shape->group) && (context->layers&shape->layers) && !shape->sensor\n\t){\n\t\tcpNearestPointQueryInfo info;\n\t\tcpShapeNearestPointQuery(shape, context->point, &info);\n\t\t\n\t\tif(info.d < out->d) (*out) = info;\n\t}\n}\n\ncpShape *\ncpSpaceNearestPointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpLayers layers, cpGroup group, cpNearestPointQueryInfo *out)\n{\n\tcpNearestPointQueryInfo info = {NULL, cpvzero, maxDistance};\n\tif(out){\n\t\t(*out) = info;\n  } else {\n\t\tout = &info;\n\t}\n\t\n\tstruct NearestPointQueryContext context = {\n\t\tpoint, maxDistance,\n\t\tlayers, group,\n\t\tNULL\n\t};\n\t\n\tcpBB bb = cpBBNewForCircle(point, cpfmax(maxDistance, 0.0f));\n\tcpSpatialIndexQuery(space->activeShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQueryNearest, out);\n\tcpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQueryNearest, out);\n\t\n\treturn out->shape;\n}\n\n\n//MARK: Segment Query Functions\n\nstruct SegmentQueryContext {\n\tcpVect start, end;\n\tcpLayers layers;\n\tcpGroup group;\n\tcpSpaceSegmentQueryFunc func;\n};\n\nstatic cpFloat\nSegmentQuery(struct SegmentQueryContext *context, cpShape *shape, void *data)\n{\n\tcpSegmentQueryInfo info;\n\t\n\tif(\n\t\t!(shape->group && context->group == shape->group) && (context->layers&shape->layers) &&\n\t\tcpShapeSegmentQuery(shape, context->start, context->end, &info)\n\t){\n\t\tcontext->func(shape, info.t, info.n, data);\n\t}\n\t\n\treturn 1.0f;\n}\n\nvoid\ncpSpaceSegmentQuery(cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSpaceSegmentQueryFunc func, void *data)\n{\n\tstruct SegmentQueryContext context = {\n\t\tstart, end,\n\t\tlayers, group,\n\t\tfunc,\n\t};\n\t\n\tcpSpaceLock(space); {\n    cpSpatialIndexSegmentQuery(space->staticShapes, &context, start, end, 1.0f, (cpSpatialIndexSegmentQueryFunc)SegmentQuery, data);\n    cpSpatialIndexSegmentQuery(space->activeShapes, &context, start, end, 1.0f, (cpSpatialIndexSegmentQueryFunc)SegmentQuery, data);\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\nstatic cpFloat\nSegmentQueryFirst(struct SegmentQueryContext *context, cpShape *shape, cpSegmentQueryInfo *out)\n{\n\tcpSegmentQueryInfo info;\n\t\n\tif(\n\t\t!(shape->group && context->group == shape->group) && (context->layers&shape->layers) &&\n\t\t!shape->sensor &&\n\t\tcpShapeSegmentQuery(shape, context->start, context->end, &info) &&\n\t\tinfo.t < out->t\n\t){\n\t\t(*out) = info;\n\t}\n\t\n\treturn out->t;\n}\n\ncpShape *\ncpSpaceSegmentQueryFirst(cpSpace *space, cpVect start, cpVect end, cpLayers layers, cpGroup group, cpSegmentQueryInfo *out)\n{\n\tcpSegmentQueryInfo info = {NULL, 1.0f, cpvzero};\n\tif(out){\n\t\t(*out) = info;\n  } else {\n\t\tout = &info;\n\t}\n\t\n\tstruct SegmentQueryContext context = {\n\t\tstart, end,\n\t\tlayers, group,\n\t\tNULL\n\t};\n\t\n\tcpSpatialIndexSegmentQuery(space->staticShapes, &context, start, end, 1.0f, (cpSpatialIndexSegmentQueryFunc)SegmentQueryFirst, out);\n\tcpSpatialIndexSegmentQuery(space->activeShapes, &context, start, end, out->t, (cpSpatialIndexSegmentQueryFunc)SegmentQueryFirst, out);\n\t\n\treturn out->shape;\n}\n\n//MARK: BB Query Functions\n\nstruct BBQueryContext {\n\tcpBB bb;\n\tcpLayers layers;\n\tcpGroup group;\n\tcpSpaceBBQueryFunc func;\n};\n\nstatic void \nBBQuery(struct BBQueryContext *context, cpShape *shape, void *data)\n{\n\tif(\n\t\t!(shape->group && context->group == shape->group) && (context->layers&shape->layers) &&\n\t\tcpBBIntersects(context->bb, shape->bb)\n\t){\n\t\tcontext->func(shape, data);\n\t}\n}\n\nvoid\ncpSpaceBBQuery(cpSpace *space, cpBB bb, cpLayers layers, cpGroup group, cpSpaceBBQueryFunc func, void *data)\n{\n\tstruct BBQueryContext context = {bb, layers, group, func};\n\t\n\tcpSpaceLock(space); {\n    cpSpatialIndexQuery(space->activeShapes, &context, bb, (cpSpatialIndexQueryFunc)BBQuery, data);\n    cpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)BBQuery, data);\n\t} cpSpaceUnlock(space, cpTrue);\n}\n\n//MARK: Shape Query Functions\n\nstruct ShapeQueryContext {\n\tcpSpaceShapeQueryFunc func;\n\tvoid *data;\n\tcpBool anyCollision;\n};\n\n// Callback from the spatial hash.\nstatic void\nShapeQuery(cpShape *a, cpShape *b, struct ShapeQueryContext *context)\n{\n\t// Reject any of the simple cases\n\tif(\n\t\t(a->group && a->group == b->group) ||\n\t\t!(a->layers & b->layers) ||\n\t\ta == b\n\t) return;\n\t\n\tcpContact contacts[CP_MAX_CONTACTS_PER_ARBITER];\n\tint numContacts = 0;\n\t\n\t// Shape 'a' should have the lower shape type. (required by cpCollideShapes() )\n\tif(a->klass->type <= b->klass->type){\n\t\tnumContacts = cpCollideShapes(a, b, contacts);\n\t} else {\n\t\tnumContacts = cpCollideShapes(b, a, contacts);\n\t\tfor(int i=0; i<numContacts; i++) contacts[i].n = cpvneg(contacts[i].n);\n\t}\n\t\n\tif(numContacts){\n\t\tcontext->anyCollision = !(a->sensor || b->sensor);\n\t\t\n\t\tif(context->func){\n\t\t\tcpContactPointSet set;\n\t\t\tset.count = numContacts;\n\t\t\t\n\t\t\tfor(int i=0; i<set.count; i++){\n\t\t\t\tset.points[i].point = contacts[i].p;\n\t\t\t\tset.points[i].normal = contacts[i].n;\n\t\t\t\tset.points[i].dist = contacts[i].dist;\n\t\t\t}\n\t\t\t\n\t\t\tcontext->func(b, &set, context->data);\n\t\t}\n\t}\n}\n\ncpBool\ncpSpaceShapeQuery(cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data)\n{\n\tcpBody *body = shape->body;\n\tcpBB bb = (body ? cpShapeUpdate(shape, body->p, body->rot) : shape->bb);\n\tstruct ShapeQueryContext context = {func, data, cpFalse};\n\t\n\tcpSpaceLock(space); {\n    cpSpatialIndexQuery(space->activeShapes, shape, bb, (cpSpatialIndexQueryFunc)ShapeQuery, &context);\n    cpSpatialIndexQuery(space->staticShapes, shape, bb, (cpSpatialIndexQueryFunc)ShapeQuery, &context);\n\t} cpSpaceUnlock(space, cpTrue);\n\t\n\treturn context.anyCollision;\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpSpaceStep.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include \"chipmunk_private.h\"\n\n//MARK: Post Step Callback Functions\n\ncpPostStepCallback *\ncpSpaceGetPostStepCallback(cpSpace *space, void *key)\n{\n\tcpArray *arr = space->postStepCallbacks;\n\tfor(int i=0; i<arr->num; i++){\n\t\tcpPostStepCallback *callback = (cpPostStepCallback *)arr->arr[i];\n\t\tif(callback && callback->key == key) return callback;\n\t}\n\t\n\treturn NULL;\n}\n\nstatic void PostStepDoNothing(cpSpace *space, void *obj, void *data){}\n\ncpBool\ncpSpaceAddPostStepCallback(cpSpace *space, cpPostStepFunc func, void *key, void *data)\n{\n\tcpAssertWarn(space->locked,\n\t\t\"Adding a post-step callback when the space is not locked is unnecessary. \"\n\t\t\"Post-step callbacks will not called until the end of the next call to cpSpaceStep() or the next query.\");\n\t\n\tif(!cpSpaceGetPostStepCallback(space, key)){\n\t\tcpPostStepCallback *callback = (cpPostStepCallback *)cpcalloc(1, sizeof(cpPostStepCallback));\n\t\tcallback->func = (func ? func : PostStepDoNothing);\n\t\tcallback->key = key;\n\t\tcallback->data = data;\n\t\t\n\t\tcpArrayPush(space->postStepCallbacks, callback);\n\t\treturn cpTrue;\n\t} else {\n\t\treturn cpFalse;\n\t}\n}\n\n//MARK: Locking Functions\n\nvoid\ncpSpaceLock(cpSpace *space)\n{\n\tspace->locked++;\n}\n\nvoid\ncpSpaceUnlock(cpSpace *space, cpBool runPostStep)\n{\n\tspace->locked--;\n\tcpAssertHard(space->locked >= 0, \"Internal Error: Space lock underflow.\");\n\t\n\tif(space->locked == 0){\n\t\tcpArray *waking = space->rousedBodies;\n\t\t\n\t\tfor(int i=0, count=waking->num; i<count; i++){\n\t\t\tcpSpaceActivateBody(space, (cpBody *)waking->arr[i]);\n\t\t\twaking->arr[i] = NULL;\n\t\t}\n\t\t\n\t\twaking->num = 0;\n\t\t\n\t\tif(space->locked == 0 && runPostStep && !space->skipPostStep){\n\t\t\tspace->skipPostStep = cpTrue;\n\t\t\t\n\t\t\tcpArray *arr = space->postStepCallbacks;\n\t\t\tfor(int i=0; i<arr->num; i++){\n\t\t\t\tcpPostStepCallback *callback = (cpPostStepCallback *)arr->arr[i];\n\t\t\t\tcpPostStepFunc func = callback->func;\n\t\t\t\t\n\t\t\t\t// Mark the func as NULL in case calling it calls cpSpaceRunPostStepCallbacks() again.\n\t\t\t\t// TODO need more tests around this case I think.\n\t\t\t\tcallback->func = NULL;\n\t\t\t\tif(func) func(space, callback->key, callback->data);\n\t\t\t\t\n\t\t\t\tarr->arr[i] = NULL;\n\t\t\t\tcpfree(callback);\n\t\t\t}\n\t\t\t\n\t\t\tarr->num = 0;\n\t\t\tspace->skipPostStep = cpFalse;\n\t\t}\n\t}\n}\n\n//MARK: Contact Buffer Functions\n\nstruct cpContactBufferHeader {\n\tcpTimestamp stamp;\n\tcpContactBufferHeader *next;\n\tunsigned int numContacts;\n};\n\n#define CP_CONTACTS_BUFFER_SIZE ((CP_BUFFER_BYTES - sizeof(cpContactBufferHeader))/sizeof(cpContact))\ntypedef struct cpContactBuffer {\n\tcpContactBufferHeader header;\n\tcpContact contacts[CP_CONTACTS_BUFFER_SIZE];\n} cpContactBuffer;\n\nstatic cpContactBufferHeader *\ncpSpaceAllocContactBuffer(cpSpace *space)\n{\n\tcpContactBuffer *buffer = (cpContactBuffer *)cpcalloc(1, sizeof(cpContactBuffer));\n\tcpArrayPush(space->allocatedBuffers, buffer);\n\treturn (cpContactBufferHeader *)buffer;\n}\n\nstatic cpContactBufferHeader *\ncpContactBufferHeaderInit(cpContactBufferHeader *header, cpTimestamp stamp, cpContactBufferHeader *splice)\n{\n\theader->stamp = stamp;\n\theader->next = (splice ? splice->next : header);\n\theader->numContacts = 0;\n\t\n\treturn header;\n}\n\nvoid\ncpSpacePushFreshContactBuffer(cpSpace *space)\n{\n\tcpTimestamp stamp = space->stamp;\n\t\n\tcpContactBufferHeader *head = space->contactBuffersHead;\n\t\n\tif(!head){\n\t\t// No buffers have been allocated, make one\n\t\tspace->contactBuffersHead = cpContactBufferHeaderInit(cpSpaceAllocContactBuffer(space), stamp, NULL);\n\t} else if(stamp - head->next->stamp > space->collisionPersistence){\n\t\t// The tail buffer is available, rotate the ring\n\tcpContactBufferHeader *tail = head->next;\n\t\tspace->contactBuffersHead = cpContactBufferHeaderInit(tail, stamp, tail);\n\t} else {\n\t\t// Allocate a new buffer and push it into the ring\n\t\tcpContactBufferHeader *buffer = cpContactBufferHeaderInit(cpSpaceAllocContactBuffer(space), stamp, head);\n\t\tspace->contactBuffersHead = head->next = buffer;\n\t}\n}\n\n\ncpContact *\ncpContactBufferGetArray(cpSpace *space)\n{\n\tif(space->contactBuffersHead->numContacts + CP_MAX_CONTACTS_PER_ARBITER > CP_CONTACTS_BUFFER_SIZE){\n\t\t// contact buffer could overflow on the next collision, push a fresh one.\n\t\tcpSpacePushFreshContactBuffer(space);\n\t}\n\t\n\tcpContactBufferHeader *head = space->contactBuffersHead;\n\treturn ((cpContactBuffer *)head)->contacts + head->numContacts;\n}\n\nvoid\ncpSpacePushContacts(cpSpace *space, int count)\n{\n\tcpAssertHard(count <= CP_MAX_CONTACTS_PER_ARBITER, \"Internal Error: Contact buffer overflow!\");\n\tspace->contactBuffersHead->numContacts += count;\n}\n\nstatic void\ncpSpacePopContacts(cpSpace *space, int count){\n\tspace->contactBuffersHead->numContacts -= count;\n}\n\n//MARK: Collision Detection Functions\n\nstatic void *\ncpSpaceArbiterSetTrans(cpShape **shapes, cpSpace *space)\n{\n\tif(space->pooledArbiters->num == 0){\n\t\t// arbiter pool is exhausted, make more\n\t\tint count = CP_BUFFER_BYTES/sizeof(cpArbiter);\n\t\tcpAssertHard(count, \"Internal Error: Buffer size too small.\");\n\t\t\n\t\tcpArbiter *buffer = (cpArbiter *)cpcalloc(1, CP_BUFFER_BYTES);\n\t\tcpArrayPush(space->allocatedBuffers, buffer);\n\t\t\n\t\tfor(int i=0; i<count; i++) cpArrayPush(space->pooledArbiters, buffer + i);\n\t}\n\t\n\treturn cpArbiterInit((cpArbiter *)cpArrayPop(space->pooledArbiters), shapes[0], shapes[1]);\n}\n\nstatic inline cpBool\nqueryReject(cpShape *a, cpShape *b)\n{\n\treturn (\n\t\t// BBoxes must overlap\n\t\t!cpBBIntersects(a->bb, b->bb)\n\t\t// Don't collide shapes attached to the same body.\n\t\t|| a->body == b->body\n\t\t// Don't collide objects in the same non-zero group\n\t\t|| (a->group && a->group == b->group)\n\t\t// Don't collide objects that don't share at least on layer.\n\t\t|| !(a->layers & b->layers)\n\t\t// Don't collide infinite mass objects\n\t\t|| (a->body->m == INFINITY && b->body->m == INFINITY)\n\t);\n}\n\n// Callback from the spatial hash.\nvoid\ncpSpaceCollideShapes(cpShape *a, cpShape *b, cpSpace *space)\n{\n\t// Reject any of the simple cases\n\tif(queryReject(a,b)) return;\n\t\n\tcpCollisionHandler *handler = cpSpaceLookupHandler(space, a->collision_type, b->collision_type);\n\t\n\tcpBool sensor = a->sensor || b->sensor;\n\tif(sensor && handler == &cpDefaultCollisionHandler) return;\n\t\n\t// Shape 'a' should have the lower shape type. (required by cpCollideShapes() )\n\tif(a->klass->type > b->klass->type){\n\t\tcpShape *temp = a;\n\t\ta = b;\n\t\tb = temp;\n\t}\n\t\n\t// Narrow-phase collision detection.\n\tcpContact *contacts = cpContactBufferGetArray(space);\n\tint numContacts = cpCollideShapes(a, b, contacts);\n\tif(!numContacts) return; // Shapes are not colliding.\n\tcpSpacePushContacts(space, numContacts);\n\t\n\t// Get an arbiter from space->arbiterSet for the two shapes.\n\t// This is where the persistant contact magic comes from.\n\tcpShape *shape_pair[] = {a, b};\n\tcpHashValue arbHashID = CP_HASH_PAIR((cpHashValue)a, (cpHashValue)b);\n\tcpArbiter *arb = (cpArbiter *)cpHashSetInsert(space->cachedArbiters, arbHashID, shape_pair, space, (cpHashSetTransFunc)cpSpaceArbiterSetTrans);\n\tcpArbiterUpdate(arb, contacts, numContacts, handler, a, b);\n\t\n\t// Call the begin function first if it's the first step\n\tif(arb->state == cpArbiterStateFirstColl && !handler->begin(arb, space, handler->data)){\n\t\tcpArbiterIgnore(arb); // permanently ignore the collision until separation\n\t}\n\t\n\tif(\n\t\t// Ignore the arbiter if it has been flagged\n\t\t(arb->state != cpArbiterStateIgnore) && \n\t\t// Call preSolve\n\t\thandler->preSolve(arb, space, handler->data) &&\n\t\t// Process, but don't add collisions for sensors.\n\t\t!sensor\n\t){\n\t\tcpArrayPush(space->arbiters, arb);\n\t} else {\n\t\tcpSpacePopContacts(space, numContacts);\n\t\t\n\t\tarb->contacts = NULL;\n\t\tarb->numContacts = 0;\n\t\t\n\t\t// Normally arbiters are set as used after calling the post-solve callback.\n\t\t// However, post-solve callbacks are not called for sensors or arbiters rejected from pre-solve.\n\t\tif(arb->state != cpArbiterStateIgnore) arb->state = cpArbiterStateNormal;\n\t}\n\t\n\t// Time stamp the arbiter so we know it was used recently.\n\tarb->stamp = space->stamp;\n}\n\n// Hashset filter func to throw away old arbiters.\ncpBool\ncpSpaceArbiterSetFilter(cpArbiter *arb, cpSpace *space)\n{\n\tcpTimestamp ticks = space->stamp - arb->stamp;\n\t\n\tcpBody *a = arb->body_a, *b = arb->body_b;\n\t\n\t// TODO should make an arbiter state for this so it doesn't require filtering arbiters for dangling body pointers on body removal.\n\t// Preserve arbiters on sensors and rejected arbiters for sleeping objects.\n\t// This prevents errant separate callbacks from happenening.\n\tif(\n\t\t(cpBodyIsStatic(a) || cpBodyIsSleeping(a)) &&\n\t\t(cpBodyIsStatic(b) || cpBodyIsSleeping(b))\n\t){\n\t\treturn cpTrue;\n\t}\n\t\n\t// Arbiter was used last frame, but not this one\n\tif(ticks >= 1 && arb->state != cpArbiterStateCached){\n\t\tarb->state = cpArbiterStateCached;\n\t\tcpArbiterCallSeparate(arb, space);\n\t}\n\t\n\tif(ticks >= space->collisionPersistence){\n\t\tarb->contacts = NULL;\n\t\tarb->numContacts = 0;\n\t\t\n\t\tcpArrayPush(space->pooledArbiters, arb);\n\t\treturn cpFalse;\n\t}\n\t\n\treturn cpTrue;\n}\n\n//MARK: All Important cpSpaceStep() Function\n\nvoid\ncpShapeUpdateFunc(cpShape *shape, void *unused)\n{\n\tcpBody *body = shape->body;\n\tcpShapeUpdate(shape, body->p, body->rot);\n}\n\nvoid\ncpSpaceStep(cpSpace *space, cpFloat dt)\n{\n\t// don't step if the timestep is 0!\n\tif(dt == 0.0f) return;\n\t\n\tspace->stamp++;\n\t\n\tcpFloat prev_dt = space->curr_dt;\n\tspace->curr_dt = dt;\n\t\t\n\tcpArray *bodies = space->bodies;\n\tcpArray *constraints = space->constraints;\n\tcpArray *arbiters = space->arbiters;\n\t\n\t// Reset and empty the arbiter lists.\n\tfor(int i=0; i<arbiters->num; i++){\n\t\tcpArbiter *arb = (cpArbiter *)arbiters->arr[i];\n\t\tarb->state = cpArbiterStateNormal;\n\t\t\n\t\t// If both bodies are awake, unthread the arbiter from the contact graph.\n\t\tif(!cpBodyIsSleeping(arb->body_a) && !cpBodyIsSleeping(arb->body_b)){\n\t\t\tcpArbiterUnthread(arb);\n\t\t}\n\t}\n\tarbiters->num = 0;\n\n\tcpSpaceLock(space); {\n\t\t// Integrate positions\n\t\tfor(int i=0; i<bodies->num; i++){\n\t\t\tcpBody *body = (cpBody *)bodies->arr[i];\n\t\t\tbody->position_func(body, dt);\n\t\t}\n\t\t\n\t\t// Find colliding pairs.\n\t\tcpSpacePushFreshContactBuffer(space);\n\t\tcpSpatialIndexEach(space->activeShapes, (cpSpatialIndexIteratorFunc)cpShapeUpdateFunc, NULL);\n\t\tcpSpatialIndexReindexQuery(space->activeShapes, (cpSpatialIndexQueryFunc)cpSpaceCollideShapes, space);\n\t} cpSpaceUnlock(space, cpFalse);\n\t\n\t// Rebuild the contact graph (and detect sleeping components if sleeping is enabled)\n\tcpSpaceProcessComponents(space, dt);\n\t\n\tcpSpaceLock(space); {\n\t\t// Clear out old cached arbiters and call separate callbacks\n\t\tcpHashSetFilter(space->cachedArbiters, (cpHashSetFilterFunc)cpSpaceArbiterSetFilter, space);\n\n\t\t// Prestep the arbiters and constraints.\n\t\tcpFloat slop = space->collisionSlop;\n\t\tcpFloat biasCoef = 1.0f - cpfpow(space->collisionBias, dt);\n\t\tfor(int i=0; i<arbiters->num; i++){\n\t\t\tcpArbiterPreStep((cpArbiter *)arbiters->arr[i], dt, slop, biasCoef);\n\t\t}\n\n\t\tfor(int i=0; i<constraints->num; i++){\n\t\t\tcpConstraint *constraint = (cpConstraint *)constraints->arr[i];\n\t\t\t\n\t\t\tcpConstraintPreSolveFunc preSolve = constraint->preSolve;\n\t\t\tif(preSolve) preSolve(constraint, space);\n\t\t\t\n\t\t\tconstraint->klass->preStep(constraint, dt);\n\t\t}\n\t\n\t\t// Integrate velocities.\n\t\tcpFloat damping = cpfpow(space->damping, dt);\n\t\tcpVect gravity = space->gravity;\n\t\tfor(int i=0; i<bodies->num; i++){\n\t\t\tcpBody *body = (cpBody *)bodies->arr[i];\n\t\t\tbody->velocity_func(body, gravity, damping, dt);\n\t\t}\n\t\t\n\t\t// Apply cached impulses\n\t\tcpFloat dt_coef = (prev_dt == 0.0f ? 0.0f : dt/prev_dt);\n\t\tfor(int i=0; i<arbiters->num; i++){\n\t\t\tcpArbiterApplyCachedImpulse((cpArbiter *)arbiters->arr[i], dt_coef);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<constraints->num; i++){\n\t\t\tcpConstraint *constraint = (cpConstraint *)constraints->arr[i];\n\t\t\tconstraint->klass->applyCachedImpulse(constraint, dt_coef);\n\t\t}\n\t\t\n\t\t// Run the impulse solver.\n\t\tfor(int i=0; i<space->iterations; i++){\n\t\t\tfor(int j=0; j<arbiters->num; j++){\n\t\t\t\tcpArbiterApplyImpulse((cpArbiter *)arbiters->arr[j]);\n\t\t\t}\n\t\t\t\t\n\t\t\tfor(int j=0; j<constraints->num; j++){\n\t\t\t\tcpConstraint *constraint = (cpConstraint *)constraints->arr[j];\n\t\t\t\tconstraint->klass->applyImpulse(constraint, dt);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Run the constraint post-solve callbacks\n\t\tfor(int i=0; i<constraints->num; i++){\n\t\t\tcpConstraint *constraint = (cpConstraint *)constraints->arr[i];\n\t\t\t\n\t\t\tcpConstraintPostSolveFunc postSolve = constraint->postSolve;\n\t\t\tif(postSolve) postSolve(constraint, space);\n\t\t}\n\t\t\n\t\t// run the post-solve callbacks\n\t\tfor(int i=0; i<arbiters->num; i++){\n\t\t\tcpArbiter *arb = (cpArbiter *) arbiters->arr[i];\n\t\t\t\n\t\t\tcpCollisionHandler *handler = arb->handler;\n\t\t\thandler->postSolve(arb, space, handler->data);\n\t\t}\n\t} cpSpaceUnlock(space, cpTrue);\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpSpatialIndex.c",
    "content": "/* Copyright (c) 2010 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n\nvoid\ncpSpatialIndexFree(cpSpatialIndex *index)\n{\n\tif(index){\n\t\tcpSpatialIndexDestroy(index);\n\t\tcpfree(index);\n\t}\n}\n\ncpSpatialIndex *\ncpSpatialIndexInit(cpSpatialIndex *index, cpSpatialIndexClass *klass, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex)\n{\n\tindex->klass = klass;\n\tindex->bbfunc = bbfunc;\n\tindex->staticIndex = staticIndex;\n\t\n\tif(staticIndex){\n\t\tcpAssertHard(!staticIndex->dynamicIndex, \"This static index is already associated with a dynamic index.\");\n\t\tstaticIndex->dynamicIndex = index;\n\t}\n\t\n\treturn index;\n}\n\ntypedef struct dynamicToStaticContext {\n\tcpSpatialIndexBBFunc bbfunc;\n\tcpSpatialIndex *staticIndex;\n\tcpSpatialIndexQueryFunc queryFunc;\n\tvoid *data;\n} dynamicToStaticContext;\n\nstatic void\ndynamicToStaticIter(void *obj, dynamicToStaticContext *context)\n{\n\tcpSpatialIndexQuery(context->staticIndex, obj, context->bbfunc(obj), context->queryFunc, context->data);\n}\n\nvoid\ncpSpatialIndexCollideStatic(cpSpatialIndex *dynamicIndex, cpSpatialIndex *staticIndex, cpSpatialIndexQueryFunc func, void *data)\n{\n\tif(staticIndex && cpSpatialIndexCount(staticIndex) > 0){\n\t\tdynamicToStaticContext context = {dynamicIndex->bbfunc, staticIndex, func, data};\n\t\tcpSpatialIndexEach(dynamicIndex, (cpSpatialIndexIteratorFunc)dynamicToStaticIter, &context);\n\t}\n}\n\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpSweep1D.c",
    "content": "/* Copyright (c) 2010 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n#include \"chipmunk_private.h\"\n\nstatic inline cpSpatialIndexClass *Klass();\n\n//MARK: Basic Structures\n\ntypedef struct Bounds {\n\tcpFloat min, max;\n} Bounds;\n\ntypedef struct TableCell {\n\tvoid *obj;\n\tBounds bounds;\n} TableCell;\n\nstruct cpSweep1D\n{\n\tcpSpatialIndex spatialIndex;\n\t\n\tint num;\n\tint max;\n\tTableCell *table;\n};\n\nstatic inline cpBool\nBoundsOverlap(Bounds a, Bounds b)\n{\n\treturn (a.min <= b.max && b.min <= a.max);\n}\n\nstatic inline Bounds\nBBToBounds(cpSweep1D *sweep, cpBB bb)\n{\n\tBounds bounds = {bb.l, bb.r};\n\treturn bounds;\n}\n\nstatic inline TableCell\nMakeTableCell(cpSweep1D *sweep, void *obj)\n{\n\tTableCell cell = {obj, BBToBounds(sweep, sweep->spatialIndex.bbfunc(obj))};\n\treturn cell;\n}\n\n//MARK: Memory Management Functions\n\ncpSweep1D *\ncpSweep1DAlloc(void)\n{\n\treturn (cpSweep1D *)cpcalloc(1, sizeof(cpSweep1D));\n}\n\nstatic void\nResizeTable(cpSweep1D *sweep, int size)\n{\n\tsweep->max = size;\n\tsweep->table = (TableCell *)cprealloc(sweep->table, size*sizeof(TableCell));\n}\n\ncpSpatialIndex *\ncpSweep1DInit(cpSweep1D *sweep, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex)\n{\n\tcpSpatialIndexInit((cpSpatialIndex *)sweep, Klass(), bbfunc, staticIndex);\n\t\n\tsweep->num = 0;\n\tResizeTable(sweep, 32);\n\t\n\treturn (cpSpatialIndex *)sweep;\n}\n\ncpSpatialIndex *\ncpSweep1DNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex)\n{\n\treturn cpSweep1DInit(cpSweep1DAlloc(), bbfunc, staticIndex);\n}\n\nstatic void\ncpSweep1DDestroy(cpSweep1D *sweep)\n{\n\tcpfree(sweep->table);\n\tsweep->table = NULL;\n}\n\n//MARK: Misc\n\nstatic int\ncpSweep1DCount(cpSweep1D *sweep)\n{\n\treturn sweep->num;\n}\n\nstatic void\ncpSweep1DEach(cpSweep1D *sweep, cpSpatialIndexIteratorFunc func, void *data)\n{\n\tTableCell *table = sweep->table;\n\tfor(int i=0, count=sweep->num; i<count; i++) func(table[i].obj, data);\n}\n\nstatic int\ncpSweep1DContains(cpSweep1D *sweep, void *obj, cpHashValue hashid)\n{\n\tTableCell *table = sweep->table;\n\tfor(int i=0, count=sweep->num; i<count; i++){\n\t\tif(table[i].obj == obj) return cpTrue;\n\t}\n\t\n\treturn cpFalse;\n}\n\n//MARK: Basic Operations\n\nstatic void\ncpSweep1DInsert(cpSweep1D *sweep, void *obj, cpHashValue hashid)\n{\n\tif(sweep->num == sweep->max) ResizeTable(sweep, sweep->max*2);\n\t\n\tsweep->table[sweep->num] = MakeTableCell(sweep, obj);\n\tsweep->num++;\n}\n\nstatic void\ncpSweep1DRemove(cpSweep1D *sweep, void *obj, cpHashValue hashid)\n{\n\tTableCell *table = sweep->table;\n\tfor(int i=0, count=sweep->num; i<count; i++){\n\t\tif(table[i].obj == obj){\n\t\t\tint num = --sweep->num;\n\t\t\t\n\t\t\ttable[i] = table[num];\n\t\t\ttable[num].obj = NULL;\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t}\n}\n\n//MARK: Reindexing Functions\n\nstatic void\ncpSweep1DReindexObject(cpSweep1D *sweep, void *obj, cpHashValue hashid)\n{\n\t// Nothing to do here\n}\n\nstatic void\ncpSweep1DReindex(cpSweep1D *sweep)\n{\n\t// Nothing to do here\n\t// Could perform a sort, but queries are not accelerated anyway.\n}\n\n//MARK: Query Functions\n\nstatic void\ncpSweep1DQuery(cpSweep1D *sweep, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data)\n{\n\t// Implementing binary search here would allow you to find an upper limit\n\t// but not a lower limit. Probably not worth the hassle.\n\t\n\tBounds bounds = BBToBounds(sweep, bb);\n\t\n\tTableCell *table = sweep->table;\n\tfor(int i=0, count=sweep->num; i<count; i++){\n\t\tTableCell cell = table[i];\n\t\tif(BoundsOverlap(bounds, cell.bounds) && obj != cell.obj) func(obj, cell.obj, data);\n\t}\n}\n\nstatic void\ncpSweep1DSegmentQuery(cpSweep1D *sweep, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data)\n{\n\tcpBB bb = cpBBExpand(cpBBNew(a.x, a.y, a.x, a.y), b);\n\tBounds bounds = BBToBounds(sweep, bb);\n\t\n\tTableCell *table = sweep->table;\n\tfor(int i=0, count=sweep->num; i<count; i++){\n\t\tTableCell cell = table[i];\n\t\tif(BoundsOverlap(bounds, cell.bounds)) func(obj, cell.obj, data);\n\t}\n}\n\n//MARK: Reindex/Query\n\nstatic int\nTableSort(TableCell *a, TableCell *b)\n{\n\treturn (a->bounds.min < b->bounds.min ? -1 : (a->bounds.min > b->bounds.min ? 1 : 0));\n}\n\nstatic void\ncpSweep1DReindexQuery(cpSweep1D *sweep, cpSpatialIndexQueryFunc func, void *data)\n{\n\tTableCell *table = sweep->table;\n\tint count = sweep->num;\n\t\n\t// Update bounds and sort\n\tfor(int i=0; i<count; i++) table[i] = MakeTableCell(sweep, table[i].obj);\n\tqsort(table, count, sizeof(TableCell), (int (*)(const void *, const void *))TableSort); // TODO use insertion sort instead\n\t\n\tfor(int i=0; i<count; i++){\n\t\tTableCell cell = table[i];\n\t\tcpFloat max = cell.bounds.max;\n\t\t\n\t\tfor(int j=i+1; table[j].bounds.min < max && j<count; j++){\n\t\t\tfunc(cell.obj, table[j].obj, data);\n\t\t}\n\t}\n\t\n\t// Reindex query is also responsible for colliding against the static index.\n\t// Fortunately there is a helper function for that.\n\tcpSpatialIndexCollideStatic((cpSpatialIndex *)sweep, sweep->spatialIndex.staticIndex, func, data);\n}\n\nstatic cpSpatialIndexClass klass = {\n\t(cpSpatialIndexDestroyImpl)cpSweep1DDestroy,\n\t\n\t(cpSpatialIndexCountImpl)cpSweep1DCount,\n\t(cpSpatialIndexEachImpl)cpSweep1DEach,\n\t(cpSpatialIndexContainsImpl)cpSweep1DContains,\n\t\n\t(cpSpatialIndexInsertImpl)cpSweep1DInsert,\n\t(cpSpatialIndexRemoveImpl)cpSweep1DRemove,\n\t\n\t(cpSpatialIndexReindexImpl)cpSweep1DReindex,\n\t(cpSpatialIndexReindexObjectImpl)cpSweep1DReindexObject,\n\t(cpSpatialIndexReindexQueryImpl)cpSweep1DReindexQuery,\n\t\n\t(cpSpatialIndexQueryImpl)cpSweep1DQuery,\n\t(cpSpatialIndexSegmentQueryImpl)cpSweep1DSegmentQuery,\n};\n\nstatic inline cpSpatialIndexClass *Klass(){return &klass;}\n\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/cpVect.c",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n#include <stdio.h>\n\n#include \"chipmunk_private.h\"\n\ncpVect\ncpvslerp(const cpVect v1, const cpVect v2, const cpFloat t)\n{\n\tcpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2));\n\tcpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f));\n\t\n\tif(omega < 1e-3){\n\t\t// If the angle between two vectors is very small, lerp instead to avoid precision issues.\n\t\treturn cpvlerp(v1, v2, t);\n\t} else {\n\t\tcpFloat denom = 1.0f/cpfsin(omega);\n\t\treturn cpvadd(cpvmult(v1, cpfsin((1.0f - t)*omega)*denom), cpvmult(v2, cpfsin(t*omega)*denom));\n\t}\n}\n\ncpVect\ncpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a)\n{\n\tcpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2));\n\tcpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f));\n\t\n\treturn cpvslerp(v1, v2, cpfmin(a, omega)/omega);\n}\n\nchar*\ncpvstr(const cpVect v)\n{\n\tstatic char str[256];\n\tsprintf(str, \"(% .3f, % .3f)\", v.x, v.y);\n\treturn str;\n}\n"
  },
  {
    "path": "cocos2d/external/chipmunk/src/prime.h",
    "content": "/* Copyright (c) 2007 Scott Lembcke\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n \n// Used for resizing hash tables.\n// Values approximately double.\n// http://planetmath.org/encyclopedia/GoodHashTablePrimes.html\nstatic int primes[] = {\n\t5,\n\t13,\n\t23,\n\t47,\n\t97,\n\t193,\n\t389,\n\t769,\n\t1543,\n\t3079,\n\t6151,\n\t12289,\n\t24593,\n\t49157,\n\t98317,\n\t196613,\n\t393241,\n\t786433,\n\t1572869,\n\t3145739,\n\t6291469,\n\t12582917,\n\t25165843,\n\t50331653,\n\t100663319,\n\t201326611,\n\t402653189,\n\t805306457,\n\t1610612741,\n\t0,\n};\n\nstatic inline int\nnext_prime(int n)\n{\n\tint i = 0;\n\twhile(n > primes[i]){\n\t\ti++;\n\t\tcpAssertHard(primes[i], \"Tried to resize a hash table to a size greater than 1610612741 O_o\"); // realistically this should never happen\n\t}\n\t\n\treturn primes[i];\n}\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/curl.h",
    "content": "#ifndef __CURL_CURL_H\n#define __CURL_CURL_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/*\n * If you have libcurl problems, all docs and details are found here:\n *   http://curl.haxx.se/libcurl/\n *\n * curl-library mailing list subscription and unsubscription web interface:\n *   http://cool.haxx.se/mailman/listinfo/curl-library/\n */\n\n#include \"curlver.h\"         /* libcurl version defines   */\n#include \"curlbuild.h\"       /* libcurl build definitions */\n#include \"curlrules.h\"       /* libcurl rules enforcement */\n\n/*\n * Define WIN32 when build target is Win32 API\n */\n\n#if (defined(_WIN32) || defined(__WIN32__)) && \\\n     !defined(WIN32) && !defined(__SYMBIAN32__)\n#define WIN32\n#endif\n\n#include <stdio.h>\n#include <limits.h>\n\n#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)\n/* Needed for __FreeBSD_version symbol definition */\n#include <osreldate.h>\n#endif\n\n/* The include stuff here below is mainly for time_t! */\n#include <sys/types.h>\n#include <time.h>\n\n#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)\n#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))\n/* The check above prevents the winsock2 inclusion if winsock.h already was\n   included, since they can't co-exist without problems */\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#endif\n#endif\n\n/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish\n   libc5-based Linux systems. Only include it on systems that are known to\n   require it! */\n#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \\\n    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \\\n    defined(ANDROID) || defined(__ANDROID__) || \\\n   (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))\n#include <sys/select.h>\n#endif\n\n#if !defined(WIN32) && !defined(_WIN32_WCE)\n#include <sys/socket.h>\n#endif\n\n#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)\n#include <sys/time.h>\n#endif\n\n#ifdef __BEOS__\n#include <support/SupportDefs.h>\n#endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURL;\n\n/*\n * Decorate exportable functions for Win32 and Symbian OS DLL linking.\n * This avoids using a .def file for building libcurl.dll.\n */\n#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \\\n     !defined(CURL_STATICLIB)\n#if defined(BUILDING_LIBCURL)\n#define CURL_EXTERN  __declspec(dllexport)\n#else\n#define CURL_EXTERN  __declspec(dllimport)\n#endif\n#else\n\n#ifdef CURL_HIDDEN_SYMBOLS\n/*\n * This definition is used to make external definitions visible in the\n * shared library when symbols are hidden by default.  It makes no\n * difference when compiling applications whether this is set or not,\n * only when compiling the library.\n */\n#define CURL_EXTERN CURL_EXTERN_SYMBOL\n#else\n#define CURL_EXTERN\n#endif\n#endif\n\n#ifndef curl_socket_typedef\n/* socket typedef */\n#if defined(WIN32) && !defined(__LWIP_OPT_H__)\ntypedef SOCKET curl_socket_t;\n#define CURL_SOCKET_BAD INVALID_SOCKET\n#else\ntypedef int curl_socket_t;\n#define CURL_SOCKET_BAD -1\n#endif\n#define curl_socket_typedef\n#endif /* curl_socket_typedef */\n\nstruct curl_httppost {\n  struct curl_httppost *next;       /* next entry in the list */\n  char *name;                       /* pointer to allocated name */\n  long namelength;                  /* length of name length */\n  char *contents;                   /* pointer to allocated data contents */\n  long contentslength;              /* length of contents field */\n  char *buffer;                     /* pointer to allocated buffer contents */\n  long bufferlength;                /* length of buffer field */\n  char *contenttype;                /* Content-Type */\n  struct curl_slist* contentheader; /* list of extra headers for this form */\n  struct curl_httppost *more;       /* if one field name has more than one\n                                       file, this link should link to following\n                                       files */\n  long flags;                       /* as defined below */\n#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */\n#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */\n#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */\n#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */\n#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the\n                                       regular read callback to get the data\n                                       and pass the given pointer as custom\n                                       pointer */\n\n  char *showfilename;               /* The file name to show. If not set, the\n                                       actual file name will be used (if this\n                                       is a file part) */\n  void *userp;                      /* custom pointer used for\n                                       HTTPPOST_CALLBACK posts */\n};\n\ntypedef int (*curl_progress_callback)(void *clientp,\n                                      double dltotal,\n                                      double dlnow,\n                                      double ultotal,\n                                      double ulnow);\n\n#ifndef CURL_MAX_WRITE_SIZE\n  /* Tests have proven that 20K is a very bad buffer size for uploads on\n     Windows, while 16K for some odd reason performed a lot better.\n     We do the ifndef check to allow this value to easier be changed at build\n     time for those who feel adventurous. The practical minimum is about\n     400 bytes since libcurl uses a buffer of this size as a scratch area\n     (unrelated to network send operations). */\n#define CURL_MAX_WRITE_SIZE 16384\n#endif\n\n#ifndef CURL_MAX_HTTP_HEADER\n/* The only reason to have a max limit for this is to avoid the risk of a bad\n   server feeding libcurl with a never-ending header that will cause reallocs\n   infinitely */\n#define CURL_MAX_HTTP_HEADER (100*1024)\n#endif\n\n/* This is a magic return code for the write callback that, when returned,\n   will signal libcurl to pause receiving on the current transfer. */\n#define CURL_WRITEFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_write_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *outstream);\n\n\n\n/* enumeration of file types */\ntypedef enum {\n  CURLFILETYPE_FILE = 0,\n  CURLFILETYPE_DIRECTORY,\n  CURLFILETYPE_SYMLINK,\n  CURLFILETYPE_DEVICE_BLOCK,\n  CURLFILETYPE_DEVICE_CHAR,\n  CURLFILETYPE_NAMEDPIPE,\n  CURLFILETYPE_SOCKET,\n  CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */\n\n  CURLFILETYPE_UNKNOWN /* should never occur */\n} curlfiletype;\n\n#define CURLFINFOFLAG_KNOWN_FILENAME    (1<<0)\n#define CURLFINFOFLAG_KNOWN_FILETYPE    (1<<1)\n#define CURLFINFOFLAG_KNOWN_TIME        (1<<2)\n#define CURLFINFOFLAG_KNOWN_PERM        (1<<3)\n#define CURLFINFOFLAG_KNOWN_UID         (1<<4)\n#define CURLFINFOFLAG_KNOWN_GID         (1<<5)\n#define CURLFINFOFLAG_KNOWN_SIZE        (1<<6)\n#define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1<<7)\n\n/* Content of this structure depends on information which is known and is\n   achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man\n   page for callbacks returning this structure -- some fields are mandatory,\n   some others are optional. The FLAG field has special meaning. */\nstruct curl_fileinfo {\n  char *filename;\n  curlfiletype filetype;\n  time_t time;\n  unsigned int perm;\n  int uid;\n  int gid;\n  curl_off_t size;\n  long int hardlinks;\n\n  struct {\n    /* If some of these fields is not NULL, it is a pointer to b_data. */\n    char *time;\n    char *perm;\n    char *user;\n    char *group;\n    char *target; /* pointer to the target filename of a symlink */\n  } strings;\n\n  unsigned int flags;\n\n  /* used internally */\n  char * b_data;\n  size_t b_size;\n  size_t b_used;\n};\n\n/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */\n#define CURL_CHUNK_BGN_FUNC_OK      0\n#define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */\n#define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */\n\n/* if splitting of data transfer is enabled, this callback is called before\n   download of an individual chunk started. Note that parameter \"remains\" works\n   only for FTP wildcard downloading (for now), otherwise is not used */\ntypedef long (*curl_chunk_bgn_callback)(const void *transfer_info,\n                                        void *ptr,\n                                        int remains);\n\n/* return codes for CURLOPT_CHUNK_END_FUNCTION */\n#define CURL_CHUNK_END_FUNC_OK      0\n#define CURL_CHUNK_END_FUNC_FAIL    1 /* tell the lib to end the task */\n\n/* If splitting of data transfer is enabled this callback is called after\n   download of an individual chunk finished.\n   Note! After this callback was set then it have to be called FOR ALL chunks.\n   Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.\n   This is the reason why we don't need \"transfer_info\" parameter in this\n   callback and we are not interested in \"remains\" parameter too. */\ntypedef long (*curl_chunk_end_callback)(void *ptr);\n\n/* return codes for FNMATCHFUNCTION */\n#define CURL_FNMATCHFUNC_MATCH    0 /* string corresponds to the pattern */\n#define CURL_FNMATCHFUNC_NOMATCH  1 /* pattern doesn't match the string */\n#define CURL_FNMATCHFUNC_FAIL     2 /* an error occurred */\n\n/* callback type for wildcard downloading pattern matching. If the\n   string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */\ntypedef int (*curl_fnmatch_callback)(void *ptr,\n                                     const char *pattern,\n                                     const char *string);\n\n/* These are the return codes for the seek callbacks */\n#define CURL_SEEKFUNC_OK       0\n#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */\n#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so\n                                    libcurl might try other means instead */\ntypedef int (*curl_seek_callback)(void *instream,\n                                  curl_off_t offset,\n                                  int origin); /* 'whence' */\n\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to immediately abort the current transfer. */\n#define CURL_READFUNC_ABORT 0x10000000\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to pause sending data on the current transfer. */\n#define CURL_READFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_read_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *instream);\n\ntypedef enum  {\n  CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */\n  CURLSOCKTYPE_LAST   /* never use */\n} curlsocktype;\n\n/* The return code from the sockopt_callback can signal information back\n   to libcurl: */\n#define CURL_SOCKOPT_OK 0\n#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return\n                                CURLE_ABORTED_BY_CALLBACK */\n#define CURL_SOCKOPT_ALREADY_CONNECTED 2\n\ntypedef int (*curl_sockopt_callback)(void *clientp,\n                                     curl_socket_t curlfd,\n                                     curlsocktype purpose);\n\nstruct curl_sockaddr {\n  int family;\n  int socktype;\n  int protocol;\n  unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it\n                           turned really ugly and painful on the systems that\n                           lack this type */\n  struct sockaddr addr;\n};\n\ntypedef curl_socket_t\n(*curl_opensocket_callback)(void *clientp,\n                            curlsocktype purpose,\n                            struct curl_sockaddr *address);\n\ntypedef int\n(*curl_closesocket_callback)(void *clientp, curl_socket_t item);\n\ntypedef enum {\n  CURLIOE_OK,            /* I/O operation successful */\n  CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */\n  CURLIOE_FAILRESTART,   /* failed to restart the read */\n  CURLIOE_LAST           /* never use */\n} curlioerr;\n\ntypedef enum  {\n  CURLIOCMD_NOP,         /* no operation */\n  CURLIOCMD_RESTARTREAD, /* restart the read stream from start */\n  CURLIOCMD_LAST         /* never use */\n} curliocmd;\n\ntypedef curlioerr (*curl_ioctl_callback)(CURL *handle,\n                                         int cmd,\n                                         void *clientp);\n\n/*\n * The following typedef's are signatures of malloc, free, realloc, strdup and\n * calloc respectively.  Function pointers of these types can be passed to the\n * curl_global_init_mem() function to set user defined memory management\n * callback routines.\n */\ntypedef void *(*curl_malloc_callback)(size_t size);\ntypedef void (*curl_free_callback)(void *ptr);\ntypedef void *(*curl_realloc_callback)(void *ptr, size_t size);\ntypedef char *(*curl_strdup_callback)(const char *str);\ntypedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);\n\n/* the kind of data that is passed to information_callback*/\ntypedef enum {\n  CURLINFO_TEXT = 0,\n  CURLINFO_HEADER_IN,    /* 1 */\n  CURLINFO_HEADER_OUT,   /* 2 */\n  CURLINFO_DATA_IN,      /* 3 */\n  CURLINFO_DATA_OUT,     /* 4 */\n  CURLINFO_SSL_DATA_IN,  /* 5 */\n  CURLINFO_SSL_DATA_OUT, /* 6 */\n  CURLINFO_END\n} curl_infotype;\n\ntypedef int (*curl_debug_callback)\n       (CURL *handle,      /* the handle/transfer this concerns */\n        curl_infotype type, /* what kind of data */\n        char *data,        /* points to the data */\n        size_t size,       /* size of the data pointed to */\n        void *userptr);    /* whatever the user please */\n\n/* All possible error codes from all sorts of curl functions. Future versions\n   may return other values, stay prepared.\n\n   Always add new return codes last. Never *EVER* remove any. The return\n   codes must remain the same!\n */\n\ntypedef enum {\n  CURLE_OK = 0,\n  CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */\n  CURLE_FAILED_INIT,             /* 2 */\n  CURLE_URL_MALFORMAT,           /* 3 */\n  CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for\n                                    7.17.0, reused in April 2011 for 7.21.5] */\n  CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */\n  CURLE_COULDNT_RESOLVE_HOST,    /* 6 */\n  CURLE_COULDNT_CONNECT,         /* 7 */\n  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */\n  CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server\n                                    due to lack of access - when login fails\n                                    this is not returned. */\n  CURLE_FTP_ACCEPT_FAILED,       /* 10 - [was obsoleted in April 2006 for\n                                    7.15.4, reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */\n  CURLE_FTP_ACCEPT_TIMEOUT,      /* 12 - timeout occurred accepting server\n                                    [was obsoleted in August 2007 for 7.17.0,\n                                    reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */\n  CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */\n  CURLE_FTP_CANT_GET_HOST,       /* 15 */\n  CURLE_OBSOLETE16,              /* 16 - NOT USED */\n  CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */\n  CURLE_PARTIAL_FILE,            /* 18 */\n  CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */\n  CURLE_OBSOLETE20,              /* 20 - NOT USED */\n  CURLE_QUOTE_ERROR,             /* 21 - quote command failure */\n  CURLE_HTTP_RETURNED_ERROR,     /* 22 */\n  CURLE_WRITE_ERROR,             /* 23 */\n  CURLE_OBSOLETE24,              /* 24 - NOT USED */\n  CURLE_UPLOAD_FAILED,           /* 25 - failed upload \"command\" */\n  CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */\n  CURLE_OUT_OF_MEMORY,           /* 27 */\n  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error\n           instead of a memory allocation error if CURL_DOES_CONVERSIONS\n           is defined\n  */\n  CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */\n  CURLE_OBSOLETE29,              /* 29 - NOT USED */\n  CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */\n  CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */\n  CURLE_OBSOLETE32,              /* 32 - NOT USED */\n  CURLE_RANGE_ERROR,             /* 33 - RANGE \"command\" didn't work */\n  CURLE_HTTP_POST_ERROR,         /* 34 */\n  CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */\n  CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */\n  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */\n  CURLE_LDAP_CANNOT_BIND,        /* 38 */\n  CURLE_LDAP_SEARCH_FAILED,      /* 39 */\n  CURLE_OBSOLETE40,              /* 40 - NOT USED */\n  CURLE_FUNCTION_NOT_FOUND,      /* 41 */\n  CURLE_ABORTED_BY_CALLBACK,     /* 42 */\n  CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */\n  CURLE_OBSOLETE44,              /* 44 - NOT USED */\n  CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */\n  CURLE_OBSOLETE46,              /* 46 - NOT USED */\n  CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */\n  CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */\n  CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */\n  CURLE_OBSOLETE50,              /* 50 - NOT USED */\n  CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint\n                                     wasn't verified fine */\n  CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */\n  CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */\n  CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as\n                                    default */\n  CURLE_SEND_ERROR,              /* 55 - failed sending network data */\n  CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */\n  CURLE_OBSOLETE57,              /* 57 - NOT IN USE */\n  CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */\n  CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */\n  CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */\n  CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */\n  CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */\n  CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */\n  CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */\n  CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind\n                                    that failed */\n  CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */\n  CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not\n                                    accepted and we failed to login */\n  CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */\n  CURLE_TFTP_PERM,               /* 69 - permission problem on server */\n  CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */\n  CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */\n  CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */\n  CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */\n  CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */\n  CURLE_CONV_FAILED,             /* 75 - conversion failed */\n  CURLE_CONV_REQD,               /* 76 - caller must register conversion\n                                    callbacks using curl_easy_setopt options\n                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,\n                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and\n                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */\n  CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing\n                                    or wrong format */\n  CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */\n  CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat\n                                    generic so the error message will be of\n                                    interest when this has happened */\n\n  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL\n                                    connection */\n  CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,\n                                    wait till it's ready and try again (Added\n                                    in 7.18.2) */\n  CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or\n                                    wrong format (Added in 7.19.0) */\n  CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in\n                                    7.19.0) */\n  CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */\n  CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */\n  CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */\n  CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */\n  CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */\n  CURL_LAST /* never use! */\n} CURLcode;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Previously obsoletes error codes re-used in 7.24.0 */\n#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED\n#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT\n\n/*  compatibility with older names */\n#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING\n\n/* The following were added in 7.21.5, April 2011 */\n#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION\n\n/* The following were added in 7.17.1 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION\n\n/* The following were added in 7.17.0 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */\n#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46\n#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44\n#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10\n#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16\n#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32\n#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29\n#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12\n#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20\n#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40\n#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24\n#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57\n#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN\n\n#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED\n#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE\n#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR\n#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL\n#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS\n#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR\n#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED\n\n/* The following were added earlier */\n\n#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT\n\n#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR\n#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED\n#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED\n\n#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE\n#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME\n\n/* This was the error code 50 in 7.7.3 and a few earlier versions, this\n   is no longer used by libcurl but is instead #defined here only to not\n   make programs break */\n#define CURLE_ALREADY_COMPLETE 99999\n\n#endif /*!CURL_NO_OLDIES*/\n\n/* This prototype applies to all conversion callbacks */\ntypedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);\n\ntypedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */\n                                          void *ssl_ctx, /* actually an\n                                                            OpenSSL SSL_CTX */\n                                          void *userptr);\n\ntypedef enum {\n  CURLPROXY_HTTP = 0,   /* added in 7.10, new in 7.19.4 default is to use\n                           CONNECT HTTP/1.1 */\n  CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT\n                               HTTP/1.0  */\n  CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already\n                           in 7.10 */\n  CURLPROXY_SOCKS5 = 5, /* added in 7.10 */\n  CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */\n  CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the\n                                   host name rather than the IP address. added\n                                   in 7.18.0 */\n} curl_proxytype;  /* this enum was added in 7.10 */\n\n/*\n * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:\n *\n * CURLAUTH_NONE         - No HTTP authentication\n * CURLAUTH_BASIC        - HTTP Basic authentication (default)\n * CURLAUTH_DIGEST       - HTTP Digest authentication\n * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication\n * CURLAUTH_NTLM         - HTTP NTLM authentication\n * CURLAUTH_DIGEST_IE    - HTTP Digest authentication with IE flavour\n * CURLAUTH_NTLM_WB      - HTTP NTLM authentication delegated to winbind helper\n * CURLAUTH_ONLY         - Use together with a single other type to force no\n *                         authentication or just that single type\n * CURLAUTH_ANY          - All fine types set\n * CURLAUTH_ANYSAFE      - All fine types except Basic\n */\n\n#define CURLAUTH_NONE         ((unsigned long)0)\n#define CURLAUTH_BASIC        (((unsigned long)1)<<0)\n#define CURLAUTH_DIGEST       (((unsigned long)1)<<1)\n#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)\n#define CURLAUTH_NTLM         (((unsigned long)1)<<3)\n#define CURLAUTH_DIGEST_IE    (((unsigned long)1)<<4)\n#define CURLAUTH_NTLM_WB      (((unsigned long)1)<<5)\n#define CURLAUTH_ONLY         (((unsigned long)1)<<31)\n#define CURLAUTH_ANY          (~CURLAUTH_DIGEST_IE)\n#define CURLAUTH_ANYSAFE      (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))\n\n#define CURLSSH_AUTH_ANY       ~0     /* all types supported by the server */\n#define CURLSSH_AUTH_NONE      0      /* none allowed, silly but complete */\n#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */\n#define CURLSSH_AUTH_PASSWORD  (1<<1) /* password */\n#define CURLSSH_AUTH_HOST      (1<<2) /* host key files */\n#define CURLSSH_AUTH_KEYBOARD  (1<<3) /* keyboard interactive */\n#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY\n\n#define CURLGSSAPI_DELEGATION_NONE        0      /* no delegation (default) */\n#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */\n#define CURLGSSAPI_DELEGATION_FLAG        (1<<1) /* delegate always */\n\n#define CURL_ERROR_SIZE 256\n\nstruct curl_khkey {\n  const char *key; /* points to a zero-terminated string encoded with base64\n                      if len is zero, otherwise to the \"raw\" data */\n  size_t len;\n  enum type {\n    CURLKHTYPE_UNKNOWN,\n    CURLKHTYPE_RSA1,\n    CURLKHTYPE_RSA,\n    CURLKHTYPE_DSS\n  } keytype;\n};\n\n/* this is the set of return values expected from the curl_sshkeycallback\n   callback */\nenum curl_khstat {\n  CURLKHSTAT_FINE_ADD_TO_FILE,\n  CURLKHSTAT_FINE,\n  CURLKHSTAT_REJECT, /* reject the connection, return an error */\n  CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now so\n                        this causes a CURLE_DEFER error but otherwise the\n                        connection will be left intact etc */\n  CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */\n};\n\n/* this is the set of status codes pass in to the callback */\nenum curl_khmatch {\n  CURLKHMATCH_OK,       /* match */\n  CURLKHMATCH_MISMATCH, /* host found, key mismatch! */\n  CURLKHMATCH_MISSING,  /* no matching host/key found */\n  CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */\n};\n\ntypedef int\n  (*curl_sshkeycallback) (CURL *easy,     /* easy handle */\n                          const struct curl_khkey *knownkey, /* known */\n                          const struct curl_khkey *foundkey, /* found */\n                          enum curl_khmatch, /* libcurl's view on the keys */\n                          void *clientp); /* custom pointer passed from app */\n\n/* parameter for the CURLOPT_USE_SSL option */\ntypedef enum {\n  CURLUSESSL_NONE,    /* do not attempt to use SSL */\n  CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */\n  CURLUSESSL_CONTROL, /* SSL for the control connection or fail */\n  CURLUSESSL_ALL,     /* SSL for all communication or fail */\n  CURLUSESSL_LAST     /* not an option, never use */\n} curl_usessl;\n\n/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */\n\n/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the\n   name of improving interoperability with older servers. Some SSL libraries\n   have introduced work-arounds for this flaw but those work-arounds sometimes\n   make the SSL communication fail. To regain functionality with those broken\n   servers, a user can this way allow the vulnerability back. */\n#define CURLSSLOPT_ALLOW_BEAST (1<<0)\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2009 */\n\n#define CURLFTPSSL_NONE CURLUSESSL_NONE\n#define CURLFTPSSL_TRY CURLUSESSL_TRY\n#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL\n#define CURLFTPSSL_ALL CURLUSESSL_ALL\n#define CURLFTPSSL_LAST CURLUSESSL_LAST\n#define curl_ftpssl curl_usessl\n#endif /*!CURL_NO_OLDIES*/\n\n/* parameter for the CURLOPT_FTP_SSL_CCC option */\ntypedef enum {\n  CURLFTPSSL_CCC_NONE,    /* do not send CCC */\n  CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */\n  CURLFTPSSL_CCC_ACTIVE,  /* Initiate the shutdown */\n  CURLFTPSSL_CCC_LAST     /* not an option, never use */\n} curl_ftpccc;\n\n/* parameter for the CURLOPT_FTPSSLAUTH option */\ntypedef enum {\n  CURLFTPAUTH_DEFAULT, /* let libcurl decide */\n  CURLFTPAUTH_SSL,     /* use \"AUTH SSL\" */\n  CURLFTPAUTH_TLS,     /* use \"AUTH TLS\" */\n  CURLFTPAUTH_LAST /* not an option, never use */\n} curl_ftpauth;\n\n/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */\ntypedef enum {\n  CURLFTP_CREATE_DIR_NONE,  /* do NOT create missing dirs! */\n  CURLFTP_CREATE_DIR,       /* (FTP/SFTP) if CWD fails, try MKD and then CWD\n                               again if MKD succeeded, for SFTP this does\n                               similar magic */\n  CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD\n                               again even if MKD failed! */\n  CURLFTP_CREATE_DIR_LAST   /* not an option, never use */\n} curl_ftpcreatedir;\n\n/* parameter for the CURLOPT_FTP_FILEMETHOD option */\ntypedef enum {\n  CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */\n  CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */\n  CURLFTPMETHOD_NOCWD,     /* no CWD at all */\n  CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */\n  CURLFTPMETHOD_LAST       /* not an option, never use */\n} curl_ftpmethod;\n\n/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */\n#define CURLPROTO_HTTP   (1<<0)\n#define CURLPROTO_HTTPS  (1<<1)\n#define CURLPROTO_FTP    (1<<2)\n#define CURLPROTO_FTPS   (1<<3)\n#define CURLPROTO_SCP    (1<<4)\n#define CURLPROTO_SFTP   (1<<5)\n#define CURLPROTO_TELNET (1<<6)\n#define CURLPROTO_LDAP   (1<<7)\n#define CURLPROTO_LDAPS  (1<<8)\n#define CURLPROTO_DICT   (1<<9)\n#define CURLPROTO_FILE   (1<<10)\n#define CURLPROTO_TFTP   (1<<11)\n#define CURLPROTO_IMAP   (1<<12)\n#define CURLPROTO_IMAPS  (1<<13)\n#define CURLPROTO_POP3   (1<<14)\n#define CURLPROTO_POP3S  (1<<15)\n#define CURLPROTO_SMTP   (1<<16)\n#define CURLPROTO_SMTPS  (1<<17)\n#define CURLPROTO_RTSP   (1<<18)\n#define CURLPROTO_RTMP   (1<<19)\n#define CURLPROTO_RTMPT  (1<<20)\n#define CURLPROTO_RTMPE  (1<<21)\n#define CURLPROTO_RTMPTE (1<<22)\n#define CURLPROTO_RTMPS  (1<<23)\n#define CURLPROTO_RTMPTS (1<<24)\n#define CURLPROTO_GOPHER (1<<25)\n#define CURLPROTO_ALL    (~0) /* enable everything */\n\n/* long may be 32 or 64 bits, but we should never depend on anything else\n   but 32 */\n#define CURLOPTTYPE_LONG          0\n#define CURLOPTTYPE_OBJECTPOINT   10000\n#define CURLOPTTYPE_FUNCTIONPOINT 20000\n#define CURLOPTTYPE_OFF_T         30000\n\n/* name is uppercase CURLOPT_<name>,\n   type is one of the defined CURLOPTTYPE_<type>\n   number is unique identifier */\n#ifdef CINIT\n#undef CINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLOPT_/**/name = type + number\n#endif\n\n/*\n * This macro-mania below setups the CURLOPT_[what] enum, to be used with\n * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]\n * word.\n */\n\ntypedef enum {\n  /* This is the FILE * or void * the regular output should be written to. */\n  CINIT(FILE, OBJECTPOINT, 1),\n\n  /* The full URL to get/put */\n  CINIT(URL,  OBJECTPOINT, 2),\n\n  /* Port number to connect to, if other than default. */\n  CINIT(PORT, LONG, 3),\n\n  /* Name of proxy to use. */\n  CINIT(PROXY, OBJECTPOINT, 4),\n\n  /* \"name:password\" to use when fetching. */\n  CINIT(USERPWD, OBJECTPOINT, 5),\n\n  /* \"name:password\" to use with proxy. */\n  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),\n\n  /* Range to get, specified as an ASCII string. */\n  CINIT(RANGE, OBJECTPOINT, 7),\n\n  /* not used */\n\n  /* Specified file stream to upload from (use as input): */\n  CINIT(INFILE, OBJECTPOINT, 9),\n\n  /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE\n   * bytes big. If this is not used, error messages go to stderr instead: */\n  CINIT(ERRORBUFFER, OBJECTPOINT, 10),\n\n  /* Function that will be called to store the output (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),\n\n  /* Function that will be called to read the input (instead of fread). The\n   * parameters will use fread() syntax, make sure to follow them. */\n  CINIT(READFUNCTION, FUNCTIONPOINT, 12),\n\n  /* Time-out the read operation after this amount of seconds */\n  CINIT(TIMEOUT, LONG, 13),\n\n  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about\n   * how large the file being sent really is. That allows better error\n   * checking and better verifies that the upload was successful. -1 means\n   * unknown size.\n   *\n   * For large file support, there is also a _LARGE version of the key\n   * which takes an off_t type, allowing platforms with larger off_t\n   * sizes to handle larger files.  See below for INFILESIZE_LARGE.\n   */\n  CINIT(INFILESIZE, LONG, 14),\n\n  /* POST static input fields. */\n  CINIT(POSTFIELDS, OBJECTPOINT, 15),\n\n  /* Set the referrer page (needed by some CGIs) */\n  CINIT(REFERER, OBJECTPOINT, 16),\n\n  /* Set the FTP PORT string (interface name, named or numerical IP address)\n     Use i.e '-' to use default address. */\n  CINIT(FTPPORT, OBJECTPOINT, 17),\n\n  /* Set the User-Agent string (examined by some CGIs) */\n  CINIT(USERAGENT, OBJECTPOINT, 18),\n\n  /* If the download receives less than \"low speed limit\" bytes/second\n   * during \"low speed time\" seconds, the operations is aborted.\n   * You could i.e if you have a pretty high speed connection, abort if\n   * it is less than 2000 bytes/sec during 20 seconds.\n   */\n\n  /* Set the \"low speed limit\" */\n  CINIT(LOW_SPEED_LIMIT, LONG, 19),\n\n  /* Set the \"low speed time\" */\n  CINIT(LOW_SPEED_TIME, LONG, 20),\n\n  /* Set the continuation offset.\n   *\n   * Note there is also a _LARGE version of this key which uses\n   * off_t types, allowing for large file offsets on platforms which\n   * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.\n   */\n  CINIT(RESUME_FROM, LONG, 21),\n\n  /* Set cookie in request: */\n  CINIT(COOKIE, OBJECTPOINT, 22),\n\n  /* This points to a linked list of headers, struct curl_slist kind */\n  CINIT(HTTPHEADER, OBJECTPOINT, 23),\n\n  /* This points to a linked list of post entries, struct curl_httppost */\n  CINIT(HTTPPOST, OBJECTPOINT, 24),\n\n  /* name of the file keeping your private SSL-certificate */\n  CINIT(SSLCERT, OBJECTPOINT, 25),\n\n  /* password for the SSL or SSH private key */\n  CINIT(KEYPASSWD, OBJECTPOINT, 26),\n\n  /* send TYPE parameter? */\n  CINIT(CRLF, LONG, 27),\n\n  /* send linked-list of QUOTE commands */\n  CINIT(QUOTE, OBJECTPOINT, 28),\n\n  /* send FILE * or void * to store headers to, if you use a callback it\n     is simply passed to the callback unmodified */\n  CINIT(WRITEHEADER, OBJECTPOINT, 29),\n\n  /* point to a file to read the initial cookies from, also enables\n     \"cookie awareness\" */\n  CINIT(COOKIEFILE, OBJECTPOINT, 31),\n\n  /* What version to specifically try to use.\n     See CURL_SSLVERSION defines below. */\n  CINIT(SSLVERSION, LONG, 32),\n\n  /* What kind of HTTP time condition to use, see defines */\n  CINIT(TIMECONDITION, LONG, 33),\n\n  /* Time to use with the above condition. Specified in number of seconds\n     since 1 Jan 1970 */\n  CINIT(TIMEVALUE, LONG, 34),\n\n  /* 35 = OBSOLETE */\n\n  /* Custom request, for customizing the get command like\n     HTTP: DELETE, TRACE and others\n     FTP: to use a different list command\n     */\n  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),\n\n  /* HTTP request, for odd commands like DELETE, TRACE and others */\n  CINIT(STDERR, OBJECTPOINT, 37),\n\n  /* 38 is not used */\n\n  /* send linked-list of post-transfer QUOTE commands */\n  CINIT(POSTQUOTE, OBJECTPOINT, 39),\n\n  CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */\n\n  CINIT(VERBOSE, LONG, 41),      /* talk a lot */\n  CINIT(HEADER, LONG, 42),       /* throw the header out too */\n  CINIT(NOPROGRESS, LONG, 43),   /* shut off the progress meter */\n  CINIT(NOBODY, LONG, 44),       /* use HEAD to get http document */\n  CINIT(FAILONERROR, LONG, 45),  /* no output on http error codes >= 300 */\n  CINIT(UPLOAD, LONG, 46),       /* this is an upload */\n  CINIT(POST, LONG, 47),         /* HTTP POST method */\n  CINIT(DIRLISTONLY, LONG, 48),  /* bare names when listing directories */\n\n  CINIT(APPEND, LONG, 50),       /* Append instead of overwrite on upload! */\n\n  /* Specify whether to read the user+password from the .netrc or the URL.\n   * This must be one of the CURL_NETRC_* enums below. */\n  CINIT(NETRC, LONG, 51),\n\n  CINIT(FOLLOWLOCATION, LONG, 52),  /* use Location: Luke! */\n\n  CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */\n  CINIT(PUT, LONG, 54),          /* HTTP PUT */\n\n  /* 55 = OBSOLETE */\n\n  /* Function that will be called instead of the internal progress display\n   * function. This function should be defined as the curl_progress_callback\n   * prototype defines. */\n  CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),\n\n  /* Data passed to the progress callback */\n  CINIT(PROGRESSDATA, OBJECTPOINT, 57),\n\n  /* We want the referrer field set automatically when following locations */\n  CINIT(AUTOREFERER, LONG, 58),\n\n  /* Port of the proxy, can be set in the proxy string as well with:\n     \"[host]:[port]\" */\n  CINIT(PROXYPORT, LONG, 59),\n\n  /* size of the POST input data, if strlen() is not good to use */\n  CINIT(POSTFIELDSIZE, LONG, 60),\n\n  /* tunnel non-http operations through a HTTP proxy */\n  CINIT(HTTPPROXYTUNNEL, LONG, 61),\n\n  /* Set the interface string to use as outgoing network interface */\n  CINIT(INTERFACE, OBJECTPOINT, 62),\n\n  /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This\n   * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string\n   * is set but doesn't match one of these, 'private' will be used.  */\n  CINIT(KRBLEVEL, OBJECTPOINT, 63),\n\n  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */\n  CINIT(SSL_VERIFYPEER, LONG, 64),\n\n  /* The CApath or CAfile used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAINFO, OBJECTPOINT, 65),\n\n  /* 66 = OBSOLETE */\n  /* 67 = OBSOLETE */\n\n  /* Maximum number of http redirects to follow */\n  CINIT(MAXREDIRS, LONG, 68),\n\n  /* Pass a long set to 1 to get the date of the requested document (if\n     possible)! Pass a zero to shut it off. */\n  CINIT(FILETIME, LONG, 69),\n\n  /* This points to a linked list of telnet options */\n  CINIT(TELNETOPTIONS, OBJECTPOINT, 70),\n\n  /* Max amount of cached alive connections */\n  CINIT(MAXCONNECTS, LONG, 71),\n\n  CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */\n\n  /* 73 = OBSOLETE */\n\n  /* Set to explicitly use a new connection for the upcoming transfer.\n     Do not use this unless you're absolutely sure of this, as it makes the\n     operation slower and is less friendly for the network. */\n  CINIT(FRESH_CONNECT, LONG, 74),\n\n  /* Set to explicitly forbid the upcoming transfer's connection to be re-used\n     when done. Do not use this unless you're absolutely sure of this, as it\n     makes the operation slower and is less friendly for the network. */\n  CINIT(FORBID_REUSE, LONG, 75),\n\n  /* Set to a file name that contains random data for libcurl to use to\n     seed the random engine when doing SSL connects. */\n  CINIT(RANDOM_FILE, OBJECTPOINT, 76),\n\n  /* Set to the Entropy Gathering Daemon socket pathname */\n  CINIT(EGDSOCKET, OBJECTPOINT, 77),\n\n  /* Time-out connect operations after this amount of seconds, if connects\n     are OK within this time, then fine... This only aborts the connect\n     phase. [Only works on unix-style/SIGALRM operating systems] */\n  CINIT(CONNECTTIMEOUT, LONG, 78),\n\n  /* Function that will be called to store headers (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),\n\n  /* Set this to force the HTTP request to get back to GET. Only really usable\n     if POST, PUT or a custom request have been used first.\n   */\n  CINIT(HTTPGET, LONG, 80),\n\n  /* Set if we should verify the Common name from the peer certificate in ssl\n   * handshake, set 1 to check existence, 2 to ensure that it matches the\n   * provided hostname. */\n  CINIT(SSL_VERIFYHOST, LONG, 81),\n\n  /* Specify which file name to write all known cookies in after completed\n     operation. Set file name to \"-\" (dash) to make it go to stdout. */\n  CINIT(COOKIEJAR, OBJECTPOINT, 82),\n\n  /* Specify which SSL ciphers to use */\n  CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),\n\n  /* Specify which HTTP version to use! This must be set to one of the\n     CURL_HTTP_VERSION* enums set below. */\n  CINIT(HTTP_VERSION, LONG, 84),\n\n  /* Specifically switch on or off the FTP engine's use of the EPSV command. By\n     default, that one will always be attempted before the more traditional\n     PASV command. */\n  CINIT(FTP_USE_EPSV, LONG, 85),\n\n  /* type of the file keeping your SSL-certificate (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLCERTTYPE, OBJECTPOINT, 86),\n\n  /* name of the file keeping your private SSL-key */\n  CINIT(SSLKEY, OBJECTPOINT, 87),\n\n  /* type of the file keeping your private SSL-key (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLKEYTYPE, OBJECTPOINT, 88),\n\n  /* crypto engine for the SSL-sub system */\n  CINIT(SSLENGINE, OBJECTPOINT, 89),\n\n  /* set the crypto engine for the SSL-sub system as default\n     the param has no meaning...\n   */\n  CINIT(SSLENGINE_DEFAULT, LONG, 90),\n\n  /* Non-zero value means to use the global dns cache */\n  CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */\n\n  /* DNS cache timeout */\n  CINIT(DNS_CACHE_TIMEOUT, LONG, 92),\n\n  /* send linked-list of pre-transfer QUOTE commands */\n  CINIT(PREQUOTE, OBJECTPOINT, 93),\n\n  /* set the debug function */\n  CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),\n\n  /* set the data for the debug function */\n  CINIT(DEBUGDATA, OBJECTPOINT, 95),\n\n  /* mark this as start of a cookie session */\n  CINIT(COOKIESESSION, LONG, 96),\n\n  /* The CApath directory used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAPATH, OBJECTPOINT, 97),\n\n  /* Instruct libcurl to use a smaller receive buffer */\n  CINIT(BUFFERSIZE, LONG, 98),\n\n  /* Instruct libcurl to not use any signal/alarm handlers, even when using\n     timeouts. This option is useful for multi-threaded applications.\n     See libcurl-the-guide for more background information. */\n  CINIT(NOSIGNAL, LONG, 99),\n\n  /* Provide a CURLShare for mutexing non-ts data */\n  CINIT(SHARE, OBJECTPOINT, 100),\n\n  /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),\n     CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */\n  CINIT(PROXYTYPE, LONG, 101),\n\n  /* Set the Accept-Encoding string. Use this to tell a server you would like\n     the response to be compressed. Before 7.21.6, this was known as\n     CURLOPT_ENCODING */\n  CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),\n\n  /* Set pointer to private data */\n  CINIT(PRIVATE, OBJECTPOINT, 103),\n\n  /* Set aliases for HTTP 200 in the HTTP Response header */\n  CINIT(HTTP200ALIASES, OBJECTPOINT, 104),\n\n  /* Continue to send authentication (user+password) when following locations,\n     even when hostname changed. This can potentially send off the name\n     and password to whatever host the server decides. */\n  CINIT(UNRESTRICTED_AUTH, LONG, 105),\n\n  /* Specifically switch on or off the FTP engine's use of the EPRT command (\n     it also disables the LPRT attempt). By default, those ones will always be\n     attempted before the good old traditional PORT command. */\n  CINIT(FTP_USE_EPRT, LONG, 106),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_USERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(HTTPAUTH, LONG, 107),\n\n  /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx\n     in second argument. The function must be matching the\n     curl_ssl_ctx_callback proto. */\n  CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),\n\n  /* Set the userdata for the ssl context callback function's third\n     argument */\n  CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),\n\n  /* FTP Option that causes missing dirs to be created on the remote server.\n     In 7.19.4 we introduced the convenience enums for this option using the\n     CURLFTP_CREATE_DIR prefix.\n  */\n  CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(PROXYAUTH, LONG, 111),\n\n  /* FTP option that changes the timeout, in seconds, associated with\n     getting a response.  This is different from transfer timeout time and\n     essentially places a demand on the FTP server to acknowledge commands\n     in a timely manner. */\n  CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),\n#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT\n\n  /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to\n     tell libcurl to resolve names to those IP versions only. This only has\n     affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */\n  CINIT(IPRESOLVE, LONG, 113),\n\n  /* Set this option to limit the size of a file that will be downloaded from\n     an HTTP or FTP server.\n\n     Note there is also _LARGE version which adds large file support for\n     platforms which have larger off_t sizes.  See MAXFILESIZE_LARGE below. */\n  CINIT(MAXFILESIZE, LONG, 114),\n\n  /* See the comment for INFILESIZE above, but in short, specifies\n   * the size of the file being uploaded.  -1 means unknown.\n   */\n  CINIT(INFILESIZE_LARGE, OFF_T, 115),\n\n  /* Sets the continuation offset.  There is also a LONG version of this;\n   * look above for RESUME_FROM.\n   */\n  CINIT(RESUME_FROM_LARGE, OFF_T, 116),\n\n  /* Sets the maximum size of data that will be downloaded from\n   * an HTTP or FTP server.  See MAXFILESIZE above for the LONG version.\n   */\n  CINIT(MAXFILESIZE_LARGE, OFF_T, 117),\n\n  /* Set this option to the file name of your .netrc file you want libcurl\n     to parse (using the CURLOPT_NETRC option). If not set, libcurl will do\n     a poor attempt to find the user's home directory and check for a .netrc\n     file in there. */\n  CINIT(NETRC_FILE, OBJECTPOINT, 118),\n\n  /* Enable SSL/TLS for FTP, pick one of:\n     CURLFTPSSL_TRY     - try using SSL, proceed anyway otherwise\n     CURLFTPSSL_CONTROL - SSL for the control connection or fail\n     CURLFTPSSL_ALL     - SSL for all communication or fail\n  */\n  CINIT(USE_SSL, LONG, 119),\n\n  /* The _LARGE version of the standard POSTFIELDSIZE option */\n  CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),\n\n  /* Enable/disable the TCP Nagle algorithm */\n  CINIT(TCP_NODELAY, LONG, 121),\n\n  /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 123 OBSOLETE. Gone in 7.16.0 */\n  /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 127 OBSOLETE. Gone in 7.16.0 */\n  /* 128 OBSOLETE. Gone in 7.16.0 */\n\n  /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option\n     can be used to change libcurl's default action which is to first try\n     \"AUTH SSL\" and then \"AUTH TLS\" in this order, and proceed when a OK\n     response has been received.\n\n     Available parameters are:\n     CURLFTPAUTH_DEFAULT - let libcurl decide\n     CURLFTPAUTH_SSL     - try \"AUTH SSL\" first, then TLS\n     CURLFTPAUTH_TLS     - try \"AUTH TLS\" first, then SSL\n  */\n  CINIT(FTPSSLAUTH, LONG, 129),\n\n  CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),\n  CINIT(IOCTLDATA, OBJECTPOINT, 131),\n\n  /* 132 OBSOLETE. Gone in 7.16.0 */\n  /* 133 OBSOLETE. Gone in 7.16.0 */\n\n  /* zero terminated string for pass on to the FTP server when asked for\n     \"account\" info */\n  CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),\n\n  /* feed cookies into cookie engine */\n  CINIT(COOKIELIST, OBJECTPOINT, 135),\n\n  /* ignore Content-Length */\n  CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),\n\n  /* Set to non-zero to skip the IP address received in a 227 PASV FTP server\n     response. Typically used for FTP-SSL purposes but is not restricted to\n     that. libcurl will then instead use the same IP address it used for the\n     control connection. */\n  CINIT(FTP_SKIP_PASV_IP, LONG, 137),\n\n  /* Select \"file method\" to use when doing FTP, see the curl_ftpmethod\n     above. */\n  CINIT(FTP_FILEMETHOD, LONG, 138),\n\n  /* Local port number to bind the socket to */\n  CINIT(LOCALPORT, LONG, 139),\n\n  /* Number of ports to try, including the first one set with LOCALPORT.\n     Thus, setting it to 1 will make no additional attempts but the first.\n  */\n  CINIT(LOCALPORTRANGE, LONG, 140),\n\n  /* no transfer, set up connection and let application use the socket by\n     extracting it with CURLINFO_LASTSOCKET */\n  CINIT(CONNECT_ONLY, LONG, 141),\n\n  /* Function that will be called to convert from the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),\n\n  /* Function that will be called to convert to the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),\n\n  /* Function that will be called to convert from UTF8\n     (instead of using the iconv calls in libcurl)\n     Note that this is used only for SSL certificate processing */\n  CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),\n\n  /* if the connection proceeds too quickly then need to slow it down */\n  /* limit-rate: maximum number of bytes per second to send or receive */\n  CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),\n  CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),\n\n  /* Pointer to command string to send if USER/PASS fails. */\n  CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),\n\n  /* callback function for setting socket options */\n  CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),\n  CINIT(SOCKOPTDATA, OBJECTPOINT, 149),\n\n  /* set to 0 to disable session ID re-use for this transfer, default is\n     enabled (== 1) */\n  CINIT(SSL_SESSIONID_CACHE, LONG, 150),\n\n  /* allowed SSH authentication methods */\n  CINIT(SSH_AUTH_TYPES, LONG, 151),\n\n  /* Used by scp/sftp to do public/private key authentication */\n  CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),\n  CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),\n\n  /* Send CCC (Clear Command Channel) after authentication */\n  CINIT(FTP_SSL_CCC, LONG, 154),\n\n  /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */\n  CINIT(TIMEOUT_MS, LONG, 155),\n  CINIT(CONNECTTIMEOUT_MS, LONG, 156),\n\n  /* set to zero to disable the libcurl's decoding and thus pass the raw body\n     data to the application even when it is encoded/compressed */\n  CINIT(HTTP_TRANSFER_DECODING, LONG, 157),\n  CINIT(HTTP_CONTENT_DECODING, LONG, 158),\n\n  /* Permission used when creating new files and directories on the remote\n     server for protocols that support it, SFTP/SCP/FILE */\n  CINIT(NEW_FILE_PERMS, LONG, 159),\n  CINIT(NEW_DIRECTORY_PERMS, LONG, 160),\n\n  /* Set the behaviour of POST when redirecting. Values must be set to one\n     of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */\n  CINIT(POSTREDIR, LONG, 161),\n\n  /* used by scp/sftp to verify the host's public key */\n  CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),\n\n  /* Callback function for opening socket (instead of socket(2)). Optionally,\n     callback is able change the address or refuse to connect returning\n     CURL_SOCKET_BAD.  The callback should have type\n     curl_opensocket_callback */\n  CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),\n  CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),\n\n  /* POST volatile input fields. */\n  CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),\n\n  /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */\n  CINIT(PROXY_TRANSFER_MODE, LONG, 166),\n\n  /* Callback function for seeking in the input stream */\n  CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),\n  CINIT(SEEKDATA, OBJECTPOINT, 168),\n\n  /* CRL file */\n  CINIT(CRLFILE, OBJECTPOINT, 169),\n\n  /* Issuer certificate */\n  CINIT(ISSUERCERT, OBJECTPOINT, 170),\n\n  /* (IPv6) Address scope */\n  CINIT(ADDRESS_SCOPE, LONG, 171),\n\n  /* Collect certificate chain info and allow it to get retrievable with\n     CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only\n     working with OpenSSL-powered builds. */\n  CINIT(CERTINFO, LONG, 172),\n\n  /* \"name\" and \"pwd\" to use when fetching. */\n  CINIT(USERNAME, OBJECTPOINT, 173),\n  CINIT(PASSWORD, OBJECTPOINT, 174),\n\n    /* \"name\" and \"pwd\" to use with Proxy when fetching. */\n  CINIT(PROXYUSERNAME, OBJECTPOINT, 175),\n  CINIT(PROXYPASSWORD, OBJECTPOINT, 176),\n\n  /* Comma separated list of hostnames defining no-proxy zones. These should\n     match both hostnames directly, and hostnames within a domain. For\n     example, local.com will match local.com and www.local.com, but NOT\n     notlocal.com or www.notlocal.com. For compatibility with other\n     implementations of this, .local.com will be considered to be the same as\n     local.com. A single * is the only valid wildcard, and effectively\n     disables the use of proxy. */\n  CINIT(NOPROXY, OBJECTPOINT, 177),\n\n  /* block size for TFTP transfers */\n  CINIT(TFTP_BLKSIZE, LONG, 178),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),\n\n  /* set the bitmask for the protocols that are allowed to be used for the\n     transfer, which thus helps the app which takes URLs from users or other\n     external inputs and want to restrict what protocol(s) to deal\n     with. Defaults to CURLPROTO_ALL. */\n  CINIT(PROTOCOLS, LONG, 181),\n\n  /* set the bitmask for the protocols that libcurl is allowed to follow to,\n     as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs\n     to be set in both bitmasks to be allowed to get redirected to. Defaults\n     to all protocols except FILE and SCP. */\n  CINIT(REDIR_PROTOCOLS, LONG, 182),\n\n  /* set the SSH knownhost file name to use */\n  CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),\n\n  /* set the SSH host key callback, must point to a curl_sshkeycallback\n     function */\n  CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),\n\n  /* set the SSH host key callback custom pointer */\n  CINIT(SSH_KEYDATA, OBJECTPOINT, 185),\n\n  /* set the SMTP mail originator */\n  CINIT(MAIL_FROM, OBJECTPOINT, 186),\n\n  /* set the SMTP mail receiver(s) */\n  CINIT(MAIL_RCPT, OBJECTPOINT, 187),\n\n  /* FTP: send PRET before PASV */\n  CINIT(FTP_USE_PRET, LONG, 188),\n\n  /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */\n  CINIT(RTSP_REQUEST, LONG, 189),\n\n  /* The RTSP session identifier */\n  CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190),\n\n  /* The RTSP stream URI */\n  CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191),\n\n  /* The Transport: header to use in RTSP requests */\n  CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192),\n\n  /* Manually initialize the client RTSP CSeq for this handle */\n  CINIT(RTSP_CLIENT_CSEQ, LONG, 193),\n\n  /* Manually initialize the server RTSP CSeq for this handle */\n  CINIT(RTSP_SERVER_CSEQ, LONG, 194),\n\n  /* The stream to pass to INTERLEAVEFUNCTION. */\n  CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),\n\n  /* Let the application define a custom write method for RTP data */\n  CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),\n\n  /* Turn on wildcard matching */\n  CINIT(WILDCARDMATCH, LONG, 197),\n\n  /* Directory matching callback called before downloading of an\n     individual file (chunk) started */\n  CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),\n\n  /* Directory matching callback called after the file (chunk)\n     was downloaded, or skipped */\n  CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),\n\n  /* Change match (fnmatch-like) callback for wildcard matching */\n  CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),\n\n  /* Let the application define custom chunk data pointer */\n  CINIT(CHUNK_DATA, OBJECTPOINT, 201),\n\n  /* FNMATCH_FUNCTION user pointer */\n  CINIT(FNMATCH_DATA, OBJECTPOINT, 202),\n\n  /* send linked-list of name:port:address sets */\n  CINIT(RESOLVE, OBJECTPOINT, 203),\n\n  /* Set a username for authenticated TLS */\n  CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204),\n\n  /* Set a password for authenticated TLS */\n  CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205),\n\n  /* Set authentication type for authenticated TLS */\n  CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),\n\n  /* Set to 1 to enable the \"TE:\" header in HTTP requests to ask for\n     compressed transfer-encoded responses. Set to 0 to disable the use of TE:\n     in outgoing requests. The current default is 0, but it might change in a\n     future libcurl release.\n\n     libcurl will ask for the compressed methods it knows of, and if that\n     isn't any, it will not ask for transfer-encoding at all even if this\n     option is set to 1.\n\n  */\n  CINIT(TRANSFER_ENCODING, LONG, 207),\n\n  /* Callback function for closing socket (instead of close(2)). The callback\n     should have type curl_closesocket_callback */\n  CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),\n  CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),\n\n  /* allow GSSAPI credential delegation */\n  CINIT(GSSAPI_DELEGATION, LONG, 210),\n\n  /* Set the name servers to use for DNS resolution */\n  CINIT(DNS_SERVERS, OBJECTPOINT, 211),\n\n  /* Time-out accept operations (currently for FTP only) after this amount\n     of miliseconds. */\n  CINIT(ACCEPTTIMEOUT_MS, LONG, 212),\n\n  /* Set TCP keepalive */\n  CINIT(TCP_KEEPALIVE, LONG, 213),\n\n  /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */\n  CINIT(TCP_KEEPIDLE, LONG, 214),\n  CINIT(TCP_KEEPINTVL, LONG, 215),\n\n  /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */\n  CINIT(SSL_OPTIONS, LONG, 216),\n\n  /* set the SMTP auth originator */\n  CINIT(MAIL_AUTH, OBJECTPOINT, 217),\n\n  CURLOPT_LASTENTRY /* the last unused */\n} CURLoption;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2011 */\n\n/* This was added in version 7.19.1 */\n#define CURLOPT_POST301 CURLOPT_POSTREDIR\n\n/* These are scheduled to disappear by 2009 */\n\n/* The following were added in 7.17.0 */\n#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_FTPAPPEND CURLOPT_APPEND\n#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY\n#define CURLOPT_FTP_SSL CURLOPT_USE_SSL\n\n/* The following were added earlier */\n\n#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL\n\n#else\n/* This is set if CURL_NO_OLDIES is defined at compile-time */\n#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */\n#endif\n\n\n  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host\n     name resolves addresses using more than one IP protocol version, this\n     option might be handy to force libcurl to use a specific IP version. */\n#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP\n                                     versions that your system allows */\n#define CURL_IPRESOLVE_V4       1 /* resolve to ipv4 addresses */\n#define CURL_IPRESOLVE_V6       2 /* resolve to ipv6 addresses */\n\n  /* three convenient \"aliases\" that follow the name scheme better */\n#define CURLOPT_WRITEDATA CURLOPT_FILE\n#define CURLOPT_READDATA  CURLOPT_INFILE\n#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER\n#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER\n\n  /* These enums are for use with the CURLOPT_HTTP_VERSION option. */\nenum {\n  CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd\n                             like the library to choose the best possible\n                             for us! */\n  CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */\n  CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */\n\n  CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */\n};\n\n/*\n * Public API enums for RTSP requests\n */\nenum {\n    CURL_RTSPREQ_NONE, /* first in list */\n    CURL_RTSPREQ_OPTIONS,\n    CURL_RTSPREQ_DESCRIBE,\n    CURL_RTSPREQ_ANNOUNCE,\n    CURL_RTSPREQ_SETUP,\n    CURL_RTSPREQ_PLAY,\n    CURL_RTSPREQ_PAUSE,\n    CURL_RTSPREQ_TEARDOWN,\n    CURL_RTSPREQ_GET_PARAMETER,\n    CURL_RTSPREQ_SET_PARAMETER,\n    CURL_RTSPREQ_RECORD,\n    CURL_RTSPREQ_RECEIVE,\n    CURL_RTSPREQ_LAST /* last in list */\n};\n\n  /* These enums are for use with the CURLOPT_NETRC option. */\nenum CURL_NETRC_OPTION {\n  CURL_NETRC_IGNORED,     /* The .netrc will never be read.\n                           * This is the default. */\n  CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred\n                           * to one in the .netrc. */\n  CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.\n                           * Unless one is set programmatically, the .netrc\n                           * will be queried. */\n  CURL_NETRC_LAST\n};\n\nenum {\n  CURL_SSLVERSION_DEFAULT,\n  CURL_SSLVERSION_TLSv1,\n  CURL_SSLVERSION_SSLv2,\n  CURL_SSLVERSION_SSLv3,\n\n  CURL_SSLVERSION_LAST /* never use, keep last */\n};\n\nenum CURL_TLSAUTH {\n  CURL_TLSAUTH_NONE,\n  CURL_TLSAUTH_SRP,\n  CURL_TLSAUTH_LAST /* never use, keep last */\n};\n\n/* symbols to use with CURLOPT_POSTREDIR.\n   CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303\n   can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302\n   | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */\n\n#define CURL_REDIR_GET_ALL  0\n#define CURL_REDIR_POST_301 1\n#define CURL_REDIR_POST_302 2\n#define CURL_REDIR_POST_303 4\n#define CURL_REDIR_POST_ALL \\\n    (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)\n\ntypedef enum {\n  CURL_TIMECOND_NONE,\n\n  CURL_TIMECOND_IFMODSINCE,\n  CURL_TIMECOND_IFUNMODSINCE,\n  CURL_TIMECOND_LASTMOD,\n\n  CURL_TIMECOND_LAST\n} curl_TimeCond;\n\n\n/* curl_strequal() and curl_strnequal() are subject for removal in a future\n   libcurl, see lib/README.curlx for details */\nCURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);\nCURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);\n\n/* name is uppercase CURLFORM_<name> */\n#ifdef CFINIT\n#undef CFINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CFINIT(name) CURLFORM_ ## name\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define CFINIT(name) CURLFORM_/**/name\n#endif\n\ntypedef enum {\n  CFINIT(NOTHING),        /********* the first one is unused ************/\n\n  /*  */\n  CFINIT(COPYNAME),\n  CFINIT(PTRNAME),\n  CFINIT(NAMELENGTH),\n  CFINIT(COPYCONTENTS),\n  CFINIT(PTRCONTENTS),\n  CFINIT(CONTENTSLENGTH),\n  CFINIT(FILECONTENT),\n  CFINIT(ARRAY),\n  CFINIT(OBSOLETE),\n  CFINIT(FILE),\n\n  CFINIT(BUFFER),\n  CFINIT(BUFFERPTR),\n  CFINIT(BUFFERLENGTH),\n\n  CFINIT(CONTENTTYPE),\n  CFINIT(CONTENTHEADER),\n  CFINIT(FILENAME),\n  CFINIT(END),\n  CFINIT(OBSOLETE2),\n\n  CFINIT(STREAM),\n\n  CURLFORM_LASTENTRY /* the last unused */\n} CURLformoption;\n\n#undef CFINIT /* done */\n\n/* structure to be used as parameter for CURLFORM_ARRAY */\nstruct curl_forms {\n  CURLformoption option;\n  const char     *value;\n};\n\n/* use this for multipart formpost building */\n/* Returns code for curl_formadd()\n *\n * Returns:\n * CURL_FORMADD_OK             on success\n * CURL_FORMADD_MEMORY         if the FormInfo allocation fails\n * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form\n * CURL_FORMADD_NULL           if a null pointer was given for a char\n * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed\n * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used\n * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)\n * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated\n * CURL_FORMADD_MEMORY         if some allocation for string copying failed.\n * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array\n *\n ***************************************************************************/\ntypedef enum {\n  CURL_FORMADD_OK, /* first, no error */\n\n  CURL_FORMADD_MEMORY,\n  CURL_FORMADD_OPTION_TWICE,\n  CURL_FORMADD_NULL,\n  CURL_FORMADD_UNKNOWN_OPTION,\n  CURL_FORMADD_INCOMPLETE,\n  CURL_FORMADD_ILLEGAL_ARRAY,\n  CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */\n\n  CURL_FORMADD_LAST /* last */\n} CURLFORMcode;\n\n/*\n * NAME curl_formadd()\n *\n * DESCRIPTION\n *\n * Pretty advanced function for building multi-part formposts. Each invoke\n * adds one part that together construct a full post. Then use\n * CURLOPT_HTTPPOST to send it off to libcurl.\n */\nCURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,\n                                      struct curl_httppost **last_post,\n                                      ...);\n\n/*\n * callback function for curl_formget()\n * The void *arg pointer will be the one passed as second argument to\n *   curl_formget().\n * The character buffer passed to it must not be freed.\n * Should return the buffer length passed to it as the argument \"len\" on\n *   success.\n */\ntypedef size_t (*curl_formget_callback)(void *arg, const char *buf,\n                                        size_t len);\n\n/*\n * NAME curl_formget()\n *\n * DESCRIPTION\n *\n * Serialize a curl_httppost struct built with curl_formadd().\n * Accepts a void pointer as second argument which will be passed to\n * the curl_formget_callback function.\n * Returns 0 on success.\n */\nCURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,\n                             curl_formget_callback append);\n/*\n * NAME curl_formfree()\n *\n * DESCRIPTION\n *\n * Free a multipart formpost previously built with curl_formadd().\n */\nCURL_EXTERN void curl_formfree(struct curl_httppost *form);\n\n/*\n * NAME curl_getenv()\n *\n * DESCRIPTION\n *\n * Returns a malloc()'ed string that MUST be curl_free()ed after usage is\n * complete. DEPRECATED - see lib/README.curlx\n */\nCURL_EXTERN char *curl_getenv(const char *variable);\n\n/*\n * NAME curl_version()\n *\n * DESCRIPTION\n *\n * Returns a static ascii string of the libcurl version.\n */\nCURL_EXTERN char *curl_version(void);\n\n/*\n * NAME curl_easy_escape()\n *\n * DESCRIPTION\n *\n * Escapes URL strings (converts all letters consider illegal in URLs to their\n * %XX versions). This function returns a new allocated string or NULL if an\n * error occurred.\n */\nCURL_EXTERN char *curl_easy_escape(CURL *handle,\n                                   const char *string,\n                                   int length);\n\n/* the previous version: */\nCURL_EXTERN char *curl_escape(const char *string,\n                              int length);\n\n\n/*\n * NAME curl_easy_unescape()\n *\n * DESCRIPTION\n *\n * Unescapes URL encoding in strings (converts all %XX codes to their 8bit\n * versions). This function returns a new allocated string or NULL if an error\n * occurred.\n * Conversion Note: On non-ASCII platforms the ASCII %XX codes are\n * converted into the host encoding.\n */\nCURL_EXTERN char *curl_easy_unescape(CURL *handle,\n                                     const char *string,\n                                     int length,\n                                     int *outlength);\n\n/* the previous version */\nCURL_EXTERN char *curl_unescape(const char *string,\n                                int length);\n\n/*\n * NAME curl_free()\n *\n * DESCRIPTION\n *\n * Provided for de-allocation in the same translation unit that did the\n * allocation. Added in libcurl 7.10\n */\nCURL_EXTERN void curl_free(void *p);\n\n/*\n * NAME curl_global_init()\n *\n * DESCRIPTION\n *\n * curl_global_init() should be invoked exactly once for each application that\n * uses libcurl and before any call of other libcurl functions.\n *\n * This function is not thread-safe!\n */\nCURL_EXTERN CURLcode curl_global_init(long flags);\n\n/*\n * NAME curl_global_init_mem()\n *\n * DESCRIPTION\n *\n * curl_global_init() or curl_global_init_mem() should be invoked exactly once\n * for each application that uses libcurl.  This function can be used to\n * initialize libcurl and set user defined memory management callback\n * functions.  Users can implement memory management routines to check for\n * memory leaks, check for mis-use of the curl library etc.  User registered\n * callback routines with be invoked by this library instead of the system\n * memory management routines like malloc, free etc.\n */\nCURL_EXTERN CURLcode curl_global_init_mem(long flags,\n                                          curl_malloc_callback m,\n                                          curl_free_callback f,\n                                          curl_realloc_callback r,\n                                          curl_strdup_callback s,\n                                          curl_calloc_callback c);\n\n/*\n * NAME curl_global_cleanup()\n *\n * DESCRIPTION\n *\n * curl_global_cleanup() should be invoked exactly once for each application\n * that uses libcurl\n */\nCURL_EXTERN void curl_global_cleanup(void);\n\n/* linked-list structure for the CURLOPT_QUOTE option (and other) */\nstruct curl_slist {\n  char *data;\n  struct curl_slist *next;\n};\n\n/*\n * NAME curl_slist_append()\n *\n * DESCRIPTION\n *\n * Appends a string to a linked list. If no list exists, it will be created\n * first. Returns the new list, after appending.\n */\nCURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,\n                                                 const char *);\n\n/*\n * NAME curl_slist_free_all()\n *\n * DESCRIPTION\n *\n * free a previously built curl_slist.\n */\nCURL_EXTERN void curl_slist_free_all(struct curl_slist *);\n\n/*\n * NAME curl_getdate()\n *\n * DESCRIPTION\n *\n * Returns the time, in seconds since 1 Jan 1970 of the time string given in\n * the first argument. The time argument in the second parameter is unused\n * and should be set to NULL.\n */\nCURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);\n\n/* info about the certificate chain, only for OpenSSL builds. Asked\n   for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */\nstruct curl_certinfo {\n  int num_of_certs;             /* number of certificates with information */\n  struct curl_slist **certinfo; /* for each index in this array, there's a\n                                   linked list with textual information in the\n                                   format \"name: value\" */\n};\n\n#define CURLINFO_STRING   0x100000\n#define CURLINFO_LONG     0x200000\n#define CURLINFO_DOUBLE   0x300000\n#define CURLINFO_SLIST    0x400000\n#define CURLINFO_MASK     0x0fffff\n#define CURLINFO_TYPEMASK 0xf00000\n\ntypedef enum {\n  CURLINFO_NONE, /* first, never use this */\n  CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,\n  CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,\n  CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,\n  CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,\n  CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,\n  CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,\n  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,\n  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,\n  CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,\n  CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,\n  CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,\n  CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,\n  CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,\n  CURLINFO_FILETIME         = CURLINFO_LONG   + 14,\n  CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,\n  CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,\n  CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,\n  CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,\n  CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,\n  CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,\n  CURLINFO_PRIVATE          = CURLINFO_STRING + 21,\n  CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,\n  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,\n  CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,\n  CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,\n  CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,\n  CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,\n  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,\n  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,\n  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,\n  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,\n  CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,\n  CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,\n  CURLINFO_CERTINFO         = CURLINFO_SLIST  + 34,\n  CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,\n  CURLINFO_RTSP_SESSION_ID  = CURLINFO_STRING + 36,\n  CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG   + 37,\n  CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG   + 38,\n  CURLINFO_RTSP_CSEQ_RECV   = CURLINFO_LONG   + 39,\n  CURLINFO_PRIMARY_PORT     = CURLINFO_LONG   + 40,\n  CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,\n  CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,\n  /* Fill in new entries below here! */\n\n  CURLINFO_LASTONE          = 42\n} CURLINFO;\n\n/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as\n   CURLINFO_HTTP_CODE */\n#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE\n\ntypedef enum {\n  CURLCLOSEPOLICY_NONE, /* first, never use this */\n\n  CURLCLOSEPOLICY_OLDEST,\n  CURLCLOSEPOLICY_LEAST_RECENTLY_USED,\n  CURLCLOSEPOLICY_LEAST_TRAFFIC,\n  CURLCLOSEPOLICY_SLOWEST,\n  CURLCLOSEPOLICY_CALLBACK,\n\n  CURLCLOSEPOLICY_LAST /* last, never use this */\n} curl_closepolicy;\n\n#define CURL_GLOBAL_SSL (1<<0)\n#define CURL_GLOBAL_WIN32 (1<<1)\n#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)\n#define CURL_GLOBAL_NOTHING 0\n#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL\n\n\n/*****************************************************************************\n * Setup defines, protos etc for the sharing stuff.\n */\n\n/* Different data locks for a single share */\ntypedef enum {\n  CURL_LOCK_DATA_NONE = 0,\n  /*  CURL_LOCK_DATA_SHARE is used internally to say that\n   *  the locking is just made to change the internal state of the share\n   *  itself.\n   */\n  CURL_LOCK_DATA_SHARE,\n  CURL_LOCK_DATA_COOKIE,\n  CURL_LOCK_DATA_DNS,\n  CURL_LOCK_DATA_SSL_SESSION,\n  CURL_LOCK_DATA_CONNECT,\n  CURL_LOCK_DATA_LAST\n} curl_lock_data;\n\n/* Different lock access types */\ntypedef enum {\n  CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */\n  CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */\n  CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */\n  CURL_LOCK_ACCESS_LAST        /* never use */\n} curl_lock_access;\n\ntypedef void (*curl_lock_function)(CURL *handle,\n                                   curl_lock_data data,\n                                   curl_lock_access locktype,\n                                   void *userptr);\ntypedef void (*curl_unlock_function)(CURL *handle,\n                                     curl_lock_data data,\n                                     void *userptr);\n\ntypedef void CURLSH;\n\ntypedef enum {\n  CURLSHE_OK,  /* all is fine */\n  CURLSHE_BAD_OPTION, /* 1 */\n  CURLSHE_IN_USE,     /* 2 */\n  CURLSHE_INVALID,    /* 3 */\n  CURLSHE_NOMEM,      /* 4 out of memory */\n  CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */\n  CURLSHE_LAST        /* never use */\n} CURLSHcode;\n\ntypedef enum {\n  CURLSHOPT_NONE,  /* don't use */\n  CURLSHOPT_SHARE,   /* specify a data type to share */\n  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */\n  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */\n  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */\n  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock\n                           callback functions */\n  CURLSHOPT_LAST  /* never use */\n} CURLSHoption;\n\nCURL_EXTERN CURLSH *curl_share_init(void);\nCURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);\nCURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);\n\n/****************************************************************************\n * Structures for querying information about the curl library at runtime.\n */\n\ntypedef enum {\n  CURLVERSION_FIRST,\n  CURLVERSION_SECOND,\n  CURLVERSION_THIRD,\n  CURLVERSION_FOURTH,\n  CURLVERSION_LAST /* never actually use this */\n} CURLversion;\n\n/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by\n   basically all programs ever that want to get version information. It is\n   meant to be a built-in version number for what kind of struct the caller\n   expects. If the struct ever changes, we redefine the NOW to another enum\n   from above. */\n#define CURLVERSION_NOW CURLVERSION_FOURTH\n\ntypedef struct {\n  CURLversion age;          /* age of the returned struct */\n  const char *version;      /* LIBCURL_VERSION */\n  unsigned int version_num; /* LIBCURL_VERSION_NUM */\n  const char *host;         /* OS/host/cpu/machine when configured */\n  int features;             /* bitmask, see defines below */\n  const char *ssl_version;  /* human readable string */\n  long ssl_version_num;     /* not used anymore, always 0 */\n  const char *libz_version; /* human readable string */\n  /* protocols is terminated by an entry with a NULL protoname */\n  const char * const *protocols;\n\n  /* The fields below this were added in CURLVERSION_SECOND */\n  const char *ares;\n  int ares_num;\n\n  /* This field was added in CURLVERSION_THIRD */\n  const char *libidn;\n\n  /* These field were added in CURLVERSION_FOURTH */\n\n  /* Same as '_libiconv_version' if built with HAVE_ICONV */\n  int iconv_ver_num;\n\n  const char *libssh_version; /* human readable string */\n\n} curl_version_info_data;\n\n#define CURL_VERSION_IPV6      (1<<0)  /* IPv6-enabled */\n#define CURL_VERSION_KERBEROS4 (1<<1)  /* kerberos auth is supported */\n#define CURL_VERSION_SSL       (1<<2)  /* SSL options are present */\n#define CURL_VERSION_LIBZ      (1<<3)  /* libz features are present */\n#define CURL_VERSION_NTLM      (1<<4)  /* NTLM auth is supported */\n#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */\n#define CURL_VERSION_DEBUG     (1<<6)  /* built with debug capabilities */\n#define CURL_VERSION_ASYNCHDNS (1<<7)  /* asynchronous dns resolves */\n#define CURL_VERSION_SPNEGO    (1<<8)  /* SPNEGO auth */\n#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */\n#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */\n#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */\n#define CURL_VERSION_CONV      (1<<12) /* character conversions supported */\n#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */\n#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */\n#define CURL_VERSION_NTLM_WB   (1<<15) /* NTLM delegating to winbind helper */\n\n /*\n * NAME curl_version_info()\n *\n * DESCRIPTION\n *\n * This function returns a pointer to a static copy of the version info\n * struct. See above.\n */\nCURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);\n\n/*\n * NAME curl_easy_strerror()\n *\n * DESCRIPTION\n *\n * The curl_easy_strerror function may be used to turn a CURLcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_easy_strerror(CURLcode);\n\n/*\n * NAME curl_share_strerror()\n *\n * DESCRIPTION\n *\n * The curl_share_strerror function may be used to turn a CURLSHcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_share_strerror(CURLSHcode);\n\n/*\n * NAME curl_easy_pause()\n *\n * DESCRIPTION\n *\n * The curl_easy_pause function pauses or unpauses transfers. Select the new\n * state by setting the bitmask, use the convenience defines below.\n *\n */\nCURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);\n\n#define CURLPAUSE_RECV      (1<<0)\n#define CURLPAUSE_RECV_CONT (0)\n\n#define CURLPAUSE_SEND      (1<<2)\n#define CURLPAUSE_SEND_CONT (0)\n\n#define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)\n#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)\n\n#ifdef  __cplusplus\n}\n#endif\n\n/* unfortunately, the easy.h and multi.h include files need options and info\n  stuff before they can be included! */\n#include \"easy.h\" /* nothing in curl is fun without the easy stuff */\n#include \"multi.h\"\n\n/* the typechecker doesn't work in C++ (yet) */\n#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \\\n    ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \\\n    !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)\n#include \"typecheck-gcc.h\"\n#else\n#if defined(__STDC__) && (__STDC__ >= 1)\n/* This preprocessor magic that replaces a call with the exact same call is\n   only done to make sure application authors pass exactly three arguments\n   to these functions. */\n#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)\n#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n#endif /* __STDC__ >= 1 */\n#endif /* gcc >= 4.3 && !__cplusplus */\n\n#endif /* __CURL_CURL_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/curlbuild.h",
    "content": "/* include/curl/curlbuild.h.  Generated from curlbuild.h.in by configure.  */\n#ifndef __CURL_CURLBUILD_H\n#define __CURL_CURLBUILD_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * If you think that something actually needs to be changed, adjusted\n * or fixed in this file, then, report it on the libcurl development\n * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * This header file shall only export symbols which are 'curl' or 'CURL'\n * prefixed, otherwise public name space would be polluted.\n *\n * NOTE 2:\n * -------\n *\n * Right now you might be staring at file include/curl/curlbuild.h.in or\n * at file include/curl/curlbuild.h, this is due to the following reason:\n *\n * On systems capable of running the configure script, the configure process\n * will overwrite the distributed include/curl/curlbuild.h file with one that\n * is suitable and specific to the library being configured and built, which\n * is generated from the include/curl/curlbuild.h.in template file.\n *\n */\n\n/* ================================================================ */\n/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */\n/* ================================================================ */\n\n#ifdef CURL_SIZEOF_LONG\n#error \"CURL_SIZEOF_LONG shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_SOCKLEN_T\n#error \"CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_SOCKLEN_T\n#error \"CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_OFF_T\n#error \"CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_T\n#error \"CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_TU\n#error \"CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined\n#endif\n\n#ifdef CURL_FORMAT_OFF_T\n#error \"CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_OFF_T\n#error \"CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_T\n#error \"CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_TU\n#error \"CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined\n#endif\n\n/* ================================================================ */\n/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */\n/* ================================================================ */\n\n/* Configure process defines this to 1 when it finds out that system  */\n/* header file ws2tcpip.h must be included by the external interface. */\n/* #undef CURL_PULL_WS2TCPIP_H */\n#ifdef CURL_PULL_WS2TCPIP_H\n#  ifndef WIN32_LEAN_AND_MEAN\n#    define WIN32_LEAN_AND_MEAN\n#  endif\n#  include <windows.h>\n#  include <winsock2.h>\n#  include <ws2tcpip.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system   */\n/* header file sys/types.h must be included by the external interface. */\n#define CURL_PULL_SYS_TYPES_H 1\n#ifdef CURL_PULL_SYS_TYPES_H\n#  include <sys/types.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system */\n/* header file stdint.h must be included by the external interface.  */\n#define CURL_PULL_STDINT_H 1\n#ifdef CURL_PULL_STDINT_H\n#  include <stdint.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system  */\n/* header file inttypes.h must be included by the external interface. */\n#define CURL_PULL_INTTYPES_H 1\n#ifdef CURL_PULL_INTTYPES_H\n#  include <inttypes.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system    */\n/* header file sys/socket.h must be included by the external interface. */\n#define CURL_PULL_SYS_SOCKET_H 1\n#ifdef CURL_PULL_SYS_SOCKET_H\n#  include <sys/socket.h>\n#endif\n\n/* The size of `long', as computed by sizeof. */\n#define CURL_SIZEOF_LONG 4\n\n/* Integral data type used for curl_socklen_t. */\n#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n\n/* The size of `curl_socklen_t', as computed by sizeof. */\n#define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n/* Data type definition of curl_socklen_t. */\ntypedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;\n\n/* Signed integral data type used for curl_off_t. */\n#define CURL_TYPEOF_CURL_OFF_T int64_t\n\n/* Data type definition of curl_off_t. */\ntypedef CURL_TYPEOF_CURL_OFF_T curl_off_t;\n\n/* curl_off_t formatting string directive without \"%\" conversion specifier. */\n#define CURL_FORMAT_CURL_OFF_T \"lld\"\n\n/* unsigned curl_off_t formatting string without \"%\" conversion specifier. */\n#define CURL_FORMAT_CURL_OFF_TU \"llu\"\n\n/* curl_off_t formatting string directive with \"%\" conversion specifier. */\n#define CURL_FORMAT_OFF_T \"%lld\"\n\n/* The size of `curl_off_t', as computed by sizeof. */\n#define CURL_SIZEOF_CURL_OFF_T 8\n\n/* curl_off_t constant suffix. */\n#define CURL_SUFFIX_CURL_OFF_T LL\n\n/* unsigned curl_off_t constant suffix. */\n#define CURL_SUFFIX_CURL_OFF_TU ULL\n\n#endif /* __CURL_CURLBUILD_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/curlrules.h",
    "content": "#ifndef __CURL_CURLRULES_H\n#define __CURL_CURLRULES_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*                    COMPILE TIME SANITY CHECKS                    */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * All checks done in this file are intentionally placed in a public\n * header file which is pulled by curl/curl.h when an application is\n * being built using an already built libcurl library. Additionally\n * this file is also included and used when building the library.\n *\n * If compilation fails on this file it is certainly sure that the\n * problem is elsewhere. It could be a problem in the curlbuild.h\n * header file, or simply that you are using different compilation\n * settings than those used to build the library.\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * Do not deactivate any check, these are done to make sure that the\n * library is properly built and used.\n *\n * You can find further help on the libcurl development mailing list:\n * http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * NOTE 2\n * ------\n *\n * Some of the following compile time checks are based on the fact\n * that the dimension of a constant array can not be a negative one.\n * In this way if the compile time verification fails, the compilation\n * will fail issuing an error. The error description wording is compiler\n * dependent but it will be quite similar to one of the following:\n *\n *   \"negative subscript or subscript is too large\"\n *   \"array must have at least one element\"\n *   \"-1 is an illegal array size\"\n *   \"size of array is negative\"\n *\n * If you are building an application which tries to use an already\n * built libcurl library and you are getting this kind of errors on\n * this file, it is a clear indication that there is a mismatch between\n * how the library was built and how you are trying to use it for your\n * application. Your already compiled or binary library provider is the\n * only one who can give you the details you need to properly use it.\n */\n\n/*\n * Verify that some macros are actually defined.\n */\n\n#ifndef CURL_SIZEOF_LONG\n#  error \"CURL_SIZEOF_LONG definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_SOCKLEN_T\n#  error \"CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_SOCKLEN_T\n#  error \"CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_OFF_T\n#  error \"CURL_TYPEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_T\n#  error \"CURL_FORMAT_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_TU\n#  error \"CURL_FORMAT_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing\n#endif\n\n#ifndef CURL_FORMAT_OFF_T\n#  error \"CURL_FORMAT_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_OFF_T\n#  error \"CURL_SIZEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_T\n#  error \"CURL_SUFFIX_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_TU\n#  error \"CURL_SUFFIX_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing\n#endif\n\n/*\n * Macros private to this header file.\n */\n\n#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1\n\n#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1\n\n/*\n * Verify that the size previously defined and expected for long\n * is the same as the one reported by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_01__\n    [CurlchkszEQ(long, CURL_SIZEOF_LONG)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_off_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_02__\n    [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];\n\n/*\n * Verify at compile time that the size of curl_off_t as reported\n * by sizeof() is greater or equal than the one reported for long\n * for the current compilation.\n */\n\ntypedef char\n  __curl_rule_03__\n    [CurlchkszGE(curl_off_t, long)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_socklen_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_04__\n    [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];\n\n/*\n * Verify at compile time that the size of curl_socklen_t as reported\n * by sizeof() is greater or equal than the one reported for int for\n * the current compilation.\n */\n\ntypedef char\n  __curl_rule_05__\n    [CurlchkszGE(curl_socklen_t, int)];\n\n/* ================================================================ */\n/*          EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS           */\n/* ================================================================ */\n\n/*\n * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow\n * these to be visible and exported by the external libcurl interface API,\n * while also making them visible to the library internals, simply including\n * setup.h, without actually needing to include curl.h internally.\n * If some day this section would grow big enough, all this should be moved\n * to its own header file.\n */\n\n/*\n * Figure out if we can use the ## preprocessor operator, which is supported\n * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__\n * or  __cplusplus so we need to carefully check for them too.\n */\n\n#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \\\n  defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \\\n  defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \\\n  defined(__ILEC400__)\n  /* This compiler is believed to have an ISO compatible preprocessor */\n#define CURL_ISOCPP\n#else\n  /* This compiler is believed NOT to have an ISO compatible preprocessor */\n#undef CURL_ISOCPP\n#endif\n\n/*\n * Macros for minimum-width signed and unsigned curl_off_t integer constants.\n */\n\n#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)\n#  define __CURL_OFF_T_C_HLPR2(x) x\n#  define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)\n#else\n#  ifdef CURL_ISOCPP\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix\n#  else\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix\n#  endif\n#  define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)\n#endif\n\n/*\n * Get rid of macros private to this header file.\n */\n\n#undef CurlchkszEQ\n#undef CurlchkszGE\n\n/*\n * Get rid of macros not intended to exist beyond this point.\n */\n\n#undef CURL_PULL_WS2TCPIP_H\n#undef CURL_PULL_SYS_TYPES_H\n#undef CURL_PULL_SYS_SOCKET_H\n#undef CURL_PULL_STDINT_H\n#undef CURL_PULL_INTTYPES_H\n\n#undef CURL_TYPEOF_CURL_SOCKLEN_T\n#undef CURL_TYPEOF_CURL_OFF_T\n\n#ifdef CURL_NO_OLDIES\n#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */\n#endif\n\n#endif /* __CURL_CURLRULES_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/curlver.h",
    "content": "#ifndef __CURL_CURLVER_H\n#define __CURL_CURLVER_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* This header file contains nothing but libcurl version info, generated by\n   a script at release-time. This was made its own header file in 7.11.2 */\n\n/* This is the global package copyright */\n#define LIBCURL_COPYRIGHT \"1996 - 2012 Daniel Stenberg, <daniel@haxx.se>.\"\n\n/* This is the version number of the libcurl package from which this header\n   file origins: */\n#define LIBCURL_VERSION \"7.26.0\"\n\n/* The numeric version number is also available \"in parts\" by using these\n   defines: */\n#define LIBCURL_VERSION_MAJOR 7\n#define LIBCURL_VERSION_MINOR 26\n#define LIBCURL_VERSION_PATCH 0\n\n/* This is the numeric version of the libcurl version number, meant for easier\n   parsing and comparions by programs. The LIBCURL_VERSION_NUM define will\n   always follow this syntax:\n\n         0xXXYYZZ\n\n   Where XX, YY and ZZ are the main version, release and patch numbers in\n   hexadecimal (using 8 bits each). All three numbers are always represented\n   using two digits.  1.2 would appear as \"0x010200\" while version 9.11.7\n   appears as \"0x090b07\".\n\n   This 6-digit (24 bits) hexadecimal number does not show pre-release number,\n   and it is always a greater number in a more recent release. It makes\n   comparisons with greater than and less than work.\n*/\n#define LIBCURL_VERSION_NUM 0x071a00\n\n/*\n * This is the date and time when the full source package was created. The\n * timestamp is not stored in git, as the timestamp is properly set in the\n * tarballs by the maketgz script.\n *\n * The format of the date should follow this template:\n *\n * \"Mon Feb 12 11:35:33 UTC 2007\"\n */\n#define LIBCURL_TIMESTAMP \"Thu May 24 16:05:42 UTC 2012\"\n\n#endif /* __CURL_CURLVER_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/easy.h",
    "content": "#ifndef __CURL_EASY_H\n#define __CURL_EASY_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN CURL *curl_easy_init(void);\nCURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);\nCURL_EXTERN CURLcode curl_easy_perform(CURL *curl);\nCURL_EXTERN void curl_easy_cleanup(CURL *curl);\n\n/*\n * NAME curl_easy_getinfo()\n *\n * DESCRIPTION\n *\n * Request internal information from the curl session with this function.  The\n * third argument MUST be a pointer to a long, a pointer to a char * or a\n * pointer to a double (as the documentation describes elsewhere).  The data\n * pointed to will be filled in accordingly and can be relied upon only if the\n * function returns CURLE_OK.  This function is intended to get used *AFTER* a\n * performed transfer, all results from this function are undefined until the\n * transfer is completed.\n */\nCURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);\n\n\n/*\n * NAME curl_easy_duphandle()\n *\n * DESCRIPTION\n *\n * Creates a new curl session handle with the same options set for the handle\n * passed in. Duplicating a handle could only be a matter of cloning data and\n * options, internal state info and things like persistent connections cannot\n * be transferred. It is useful in multithreaded applications when you can run\n * curl_easy_duphandle() for each new thread to avoid a series of identical\n * curl_easy_setopt() invokes in every thread.\n */\nCURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);\n\n/*\n * NAME curl_easy_reset()\n *\n * DESCRIPTION\n *\n * Re-initializes a CURL handle to the default values. This puts back the\n * handle to the same state as it was in when it was just created.\n *\n * It does keep: live connections, the Session ID cache, the DNS cache and the\n * cookies.\n */\nCURL_EXTERN void curl_easy_reset(CURL *curl);\n\n/*\n * NAME curl_easy_recv()\n *\n * DESCRIPTION\n *\n * Receives data from the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,\n                                    size_t *n);\n\n/*\n * NAME curl_easy_send()\n *\n * DESCRIPTION\n *\n * Sends data over the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,\n                                    size_t buflen, size_t *n);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/mprintf.h",
    "content": "#ifndef __CURL_MPRINTF_H\n#define __CURL_MPRINTF_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <stdarg.h>\n#include <stdio.h> /* needed for FILE */\n\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN int curl_mprintf(const char *format, ...);\nCURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);\nCURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);\nCURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,\n                               const char *format, ...);\nCURL_EXTERN int curl_mvprintf(const char *format, va_list args);\nCURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);\nCURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);\nCURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,\n                                const char *format, va_list args);\nCURL_EXTERN char *curl_maprintf(const char *format, ...);\nCURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);\n\n#ifdef _MPRINTF_REPLACE\n# undef printf\n# undef fprintf\n# undef sprintf\n# undef vsprintf\n# undef snprintf\n# undef vprintf\n# undef vfprintf\n# undef vsnprintf\n# undef aprintf\n# undef vaprintf\n# define printf curl_mprintf\n# define fprintf curl_mfprintf\n#ifdef CURLDEBUG\n/* When built with CURLDEBUG we define away the sprintf() functions since we\n   don't want internal code to be using them */\n# define sprintf sprintf_was_used\n# define vsprintf vsprintf_was_used\n#else\n# define sprintf curl_msprintf\n# define vsprintf curl_mvsprintf\n#endif\n# define snprintf curl_msnprintf\n# define vprintf curl_mvprintf\n# define vfprintf curl_mvfprintf\n# define vsnprintf curl_mvsnprintf\n# define aprintf curl_maprintf\n# define vaprintf curl_mvaprintf\n#endif\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif /* __CURL_MPRINTF_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/multi.h",
    "content": "#ifndef __CURL_MULTI_H\n#define __CURL_MULTI_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n/*\n  This is an \"external\" header file. Don't give away any internals here!\n\n  GOALS\n\n  o Enable a \"pull\" interface. The application that uses libcurl decides where\n    and when to ask libcurl to get/send data.\n\n  o Enable multiple simultaneous transfers in the same thread without making it\n    complicated for the application.\n\n  o Enable the application to select() on its own file descriptors and curl's\n    file descriptors simultaneous easily.\n\n*/\n\n/*\n * This header file should not really need to include \"curl.h\" since curl.h\n * itself includes this file and we expect user applications to do #include\n * <curl/curl.h> without the need for especially including multi.h.\n *\n * For some reason we added this include here at one point, and rather than to\n * break existing (wrongly written) libcurl applications, we leave it as-is\n * but with this warning attached.\n */\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURLM;\n\ntypedef enum {\n  CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or\n                                    curl_multi_socket*() soon */\n  CURLM_OK,\n  CURLM_BAD_HANDLE,      /* the passed-in handle is not a valid CURLM handle */\n  CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */\n  CURLM_OUT_OF_MEMORY,   /* if you ever get this, you're in deep sh*t */\n  CURLM_INTERNAL_ERROR,  /* this is a libcurl bug */\n  CURLM_BAD_SOCKET,      /* the passed in socket argument did not match */\n  CURLM_UNKNOWN_OPTION,  /* curl_multi_setopt() with unsupported option */\n  CURLM_LAST\n} CURLMcode;\n\n/* just to make code nicer when using curl_multi_socket() you can now check\n   for CURLM_CALL_MULTI_SOCKET too in the same style it works for\n   curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */\n#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM\n\ntypedef enum {\n  CURLMSG_NONE, /* first, not used */\n  CURLMSG_DONE, /* This easy handle has completed. 'result' contains\n                   the CURLcode of the transfer */\n  CURLMSG_LAST /* last, not used */\n} CURLMSG;\n\nstruct CURLMsg {\n  CURLMSG msg;       /* what this message means */\n  CURL *easy_handle; /* the handle it concerns */\n  union {\n    void *whatever;    /* message-specific data */\n    CURLcode result;   /* return code for transfer */\n  } data;\n};\ntypedef struct CURLMsg CURLMsg;\n\n/*\n * Name:    curl_multi_init()\n *\n * Desc:    inititalize multi-style curl usage\n *\n * Returns: a new CURLM handle to use in all 'curl_multi' functions.\n */\nCURL_EXTERN CURLM *curl_multi_init(void);\n\n/*\n * Name:    curl_multi_add_handle()\n *\n * Desc:    add a standard curl handle to the multi stack\n *\n * Returns: CURLMcode type, general multi error code.\n */\nCURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,\n                                            CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_remove_handle()\n  *\n  * Desc:    removes a curl handle from the multi stack again\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,\n                                               CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_fdset()\n  *\n  * Desc:    Ask curl for its fd_set sets. The app can use these to select() or\n  *          poll() on. We want curl_multi_perform() called as soon as one of\n  *          them are ready.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,\n                                       fd_set *read_fd_set,\n                                       fd_set *write_fd_set,\n                                       fd_set *exc_fd_set,\n                                       int *max_fd);\n\n /*\n  * Name:    curl_multi_perform()\n  *\n  * Desc:    When the app thinks there's data available for curl it calls this\n  *          function to read/write whatever there is right now. This returns\n  *          as soon as the reads and writes are done. This function does not\n  *          require that there actually is data available for reading or that\n  *          data can be written, it can be called just in case. It returns\n  *          the number of handles that still transfer data in the second\n  *          argument's integer-pointer.\n  *\n  * Returns: CURLMcode type, general multi error code. *NOTE* that this only\n  *          returns errors etc regarding the whole multi stack. There might\n  *          still have occurred problems on invidual transfers even when this\n  *          returns OK.\n  */\nCURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,\n                                         int *running_handles);\n\n /*\n  * Name:    curl_multi_cleanup()\n  *\n  * Desc:    Cleans up and removes a whole multi stack. It does not free or\n  *          touch any individual easy handles in any way. We need to define\n  *          in what state those handles will be if this function is called\n  *          in the middle of a transfer.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);\n\n/*\n * Name:    curl_multi_info_read()\n *\n * Desc:    Ask the multi handle if there's any messages/informationals from\n *          the individual transfers. Messages include informationals such as\n *          error code from the transfer or just the fact that a transfer is\n *          completed. More details on these should be written down as well.\n *\n *          Repeated calls to this function will return a new struct each\n *          time, until a special \"end of msgs\" struct is returned as a signal\n *          that there is no more to get at this point.\n *\n *          The data the returned pointer points to will not survive calling\n *          curl_multi_cleanup().\n *\n *          The 'CURLMsg' struct is meant to be very simple and only contain\n *          very basic informations. If more involved information is wanted,\n *          we will provide the particular \"transfer handle\" in that struct\n *          and that should/could/would be used in subsequent\n *          curl_easy_getinfo() calls (or similar). The point being that we\n *          must never expose complex structs to applications, as then we'll\n *          undoubtably get backwards compatibility problems in the future.\n *\n * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out\n *          of structs. It also writes the number of messages left in the\n *          queue (after this read) in the integer the second argument points\n *          to.\n */\nCURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,\n                                          int *msgs_in_queue);\n\n/*\n * Name:    curl_multi_strerror()\n *\n * Desc:    The curl_multi_strerror function may be used to turn a CURLMcode\n *          value into the equivalent human readable error string.  This is\n *          useful for printing meaningful error messages.\n *\n * Returns: A pointer to a zero-terminated error message.\n */\nCURL_EXTERN const char *curl_multi_strerror(CURLMcode);\n\n/*\n * Name:    curl_multi_socket() and\n *          curl_multi_socket_all()\n *\n * Desc:    An alternative version of curl_multi_perform() that allows the\n *          application to pass in one of the file descriptors that have been\n *          detected to have \"action\" on them and let libcurl perform.\n *          See man page for details.\n */\n#define CURL_POLL_NONE   0\n#define CURL_POLL_IN     1\n#define CURL_POLL_OUT    2\n#define CURL_POLL_INOUT  3\n#define CURL_POLL_REMOVE 4\n\n#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD\n\n#define CURL_CSELECT_IN   0x01\n#define CURL_CSELECT_OUT  0x02\n#define CURL_CSELECT_ERR  0x04\n\ntypedef int (*curl_socket_callback)(CURL *easy,      /* easy handle */\n                                    curl_socket_t s, /* socket */\n                                    int what,        /* see above */\n                                    void *userp,     /* private callback\n                                                        pointer */\n                                    void *socketp);  /* private socket\n                                                        pointer */\n/*\n * Name:    curl_multi_timer_callback\n *\n * Desc:    Called by libcurl whenever the library detects a change in the\n *          maximum number of milliseconds the app is allowed to wait before\n *          curl_multi_socket() or curl_multi_perform() must be called\n *          (to allow libcurl's timed events to take place).\n *\n * Returns: The callback should return zero.\n */\ntypedef int (*curl_multi_timer_callback)(CURLM *multi,    /* multi handle */\n                                         long timeout_ms, /* see above */\n                                         void *userp);    /* private callback\n                                                             pointer */\n\nCURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,\n                                        int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,\n                                               curl_socket_t s,\n                                               int ev_bitmask,\n                                               int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,\n                                            int *running_handles);\n\n#ifndef CURL_ALLOW_OLD_MULTI_SOCKET\n/* This macro below was added in 7.16.3 to push users who recompile to use\n   the new curl_multi_socket_action() instead of the old curl_multi_socket()\n*/\n#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)\n#endif\n\n/*\n * Name:    curl_multi_timeout()\n *\n * Desc:    Returns the maximum number of milliseconds the app is allowed to\n *          wait before curl_multi_socket() or curl_multi_perform() must be\n *          called (to allow libcurl's timed events to take place).\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,\n                                         long *milliseconds);\n\n#undef CINIT /* re-using the same name as in curl.h */\n\n#ifdef CURL_ISOCPP\n#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLMOPT_/**/name = type + number\n#endif\n\ntypedef enum {\n  /* This is the socket callback function pointer */\n  CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),\n\n  /* This is the argument passed to the socket callback */\n  CINIT(SOCKETDATA, OBJECTPOINT, 2),\n\n    /* set to 1 to enable pipelining for this multi handle */\n  CINIT(PIPELINING, LONG, 3),\n\n   /* This is the timer callback function pointer */\n  CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),\n\n  /* This is the argument passed to the timer callback */\n  CINIT(TIMERDATA, OBJECTPOINT, 5),\n\n  /* maximum number of entries in the connection cache */\n  CINIT(MAXCONNECTS, LONG, 6),\n\n  CURLMOPT_LASTENTRY /* the last unused */\n} CURLMoption;\n\n\n/*\n * Name:    curl_multi_setopt()\n *\n * Desc:    Sets options for the multi handle.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,\n                                        CURLMoption option, ...);\n\n\n/*\n * Name:    curl_multi_assign()\n *\n * Desc:    This function sets an association in the multi handle between the\n *          given socket and a private pointer of the application. This is\n *          (only) useful for curl_multi_socket uses.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,\n                                        curl_socket_t sockfd, void *sockp);\n\n#ifdef __cplusplus\n} /* end of extern \"C\" */\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/stdcheaders.h",
    "content": "#ifndef __STDC_HEADERS_H\n#define __STDC_HEADERS_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <sys/types.h>\n\nsize_t fread (void *, size_t, size_t, FILE *);\nsize_t fwrite (const void *, size_t, size_t, FILE *);\n\nint strcasecmp(const char *, const char *);\nint strncasecmp(const char *, const char *, size_t);\n\n#endif /* __STDC_HEADERS_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/typecheck-gcc.h",
    "content": "#ifndef __CURL_TYPECHECK_GCC_H\n#define __CURL_TYPECHECK_GCC_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* wraps curl_easy_setopt() with typechecking */\n\n/* To add a new kind of warning, add an\n *   if(_curl_is_sometype_option(_curl_opt))\n *     if(!_curl_is_sometype(value))\n *       _curl_easy_setopt_err_sometype();\n * block and define _curl_is_sometype_option, _curl_is_sometype and\n * _curl_easy_setopt_err_sometype below\n *\n * NOTE: We use two nested 'if' statements here instead of the && operator, in\n *       order to work around gcc bug #32061.  It affects only gcc 4.3.x/4.4.x\n *       when compiling with -Wlogical-op.\n *\n * To add an option that uses the same type as an existing option, you'll just\n * need to extend the appropriate _curl_*_option macro\n */\n#define curl_easy_setopt(handle, option, value)                               \\\n__extension__ ({                                                              \\\n  __typeof__ (option) _curl_opt = option;                                     \\\n  if(__builtin_constant_p(_curl_opt)) {                                       \\\n    if(_curl_is_long_option(_curl_opt))                                       \\\n      if(!_curl_is_long(value))                                               \\\n        _curl_easy_setopt_err_long();                                         \\\n    if(_curl_is_off_t_option(_curl_opt))                                      \\\n      if(!_curl_is_off_t(value))                                              \\\n        _curl_easy_setopt_err_curl_off_t();                                   \\\n    if(_curl_is_string_option(_curl_opt))                                     \\\n      if(!_curl_is_string(value))                                             \\\n        _curl_easy_setopt_err_string();                                       \\\n    if(_curl_is_write_cb_option(_curl_opt))                                   \\\n      if(!_curl_is_write_cb(value))                                           \\\n        _curl_easy_setopt_err_write_callback();                               \\\n    if((_curl_opt) == CURLOPT_READFUNCTION)                                   \\\n      if(!_curl_is_read_cb(value))                                            \\\n        _curl_easy_setopt_err_read_cb();                                      \\\n    if((_curl_opt) == CURLOPT_IOCTLFUNCTION)                                  \\\n      if(!_curl_is_ioctl_cb(value))                                           \\\n        _curl_easy_setopt_err_ioctl_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION)                                \\\n      if(!_curl_is_sockopt_cb(value))                                         \\\n        _curl_easy_setopt_err_sockopt_cb();                                   \\\n    if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION)                             \\\n      if(!_curl_is_opensocket_cb(value))                                      \\\n        _curl_easy_setopt_err_opensocket_cb();                                \\\n    if((_curl_opt) == CURLOPT_PROGRESSFUNCTION)                               \\\n      if(!_curl_is_progress_cb(value))                                        \\\n        _curl_easy_setopt_err_progress_cb();                                  \\\n    if((_curl_opt) == CURLOPT_DEBUGFUNCTION)                                  \\\n      if(!_curl_is_debug_cb(value))                                           \\\n        _curl_easy_setopt_err_debug_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION)                               \\\n      if(!_curl_is_ssl_ctx_cb(value))                                         \\\n        _curl_easy_setopt_err_ssl_ctx_cb();                                   \\\n    if(_curl_is_conv_cb_option(_curl_opt))                                    \\\n      if(!_curl_is_conv_cb(value))                                            \\\n        _curl_easy_setopt_err_conv_cb();                                      \\\n    if((_curl_opt) == CURLOPT_SEEKFUNCTION)                                   \\\n      if(!_curl_is_seek_cb(value))                                            \\\n        _curl_easy_setopt_err_seek_cb();                                      \\\n    if(_curl_is_cb_data_option(_curl_opt))                                    \\\n      if(!_curl_is_cb_data(value))                                            \\\n        _curl_easy_setopt_err_cb_data();                                      \\\n    if((_curl_opt) == CURLOPT_ERRORBUFFER)                                    \\\n      if(!_curl_is_error_buffer(value))                                       \\\n        _curl_easy_setopt_err_error_buffer();                                 \\\n    if((_curl_opt) == CURLOPT_STDERR)                                         \\\n      if(!_curl_is_FILE(value))                                               \\\n        _curl_easy_setopt_err_FILE();                                         \\\n    if(_curl_is_postfields_option(_curl_opt))                                 \\\n      if(!_curl_is_postfields(value))                                         \\\n        _curl_easy_setopt_err_postfields();                                   \\\n    if((_curl_opt) == CURLOPT_HTTPPOST)                                       \\\n      if(!_curl_is_arr((value), struct curl_httppost))                        \\\n        _curl_easy_setopt_err_curl_httpost();                                 \\\n    if(_curl_is_slist_option(_curl_opt))                                      \\\n      if(!_curl_is_arr((value), struct curl_slist))                           \\\n        _curl_easy_setopt_err_curl_slist();                                   \\\n    if((_curl_opt) == CURLOPT_SHARE)                                          \\\n      if(!_curl_is_ptr((value), CURLSH))                                      \\\n        _curl_easy_setopt_err_CURLSH();                                       \\\n  }                                                                           \\\n  curl_easy_setopt(handle, _curl_opt, value);                                 \\\n})\n\n/* wraps curl_easy_getinfo() with typechecking */\n/* FIXME: don't allow const pointers */\n#define curl_easy_getinfo(handle, info, arg)                                  \\\n__extension__ ({                                                              \\\n  __typeof__ (info) _curl_info = info;                                        \\\n  if(__builtin_constant_p(_curl_info)) {                                      \\\n    if(_curl_is_string_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), char *))                                        \\\n        _curl_easy_getinfo_err_string();                                      \\\n    if(_curl_is_long_info(_curl_info))                                        \\\n      if(!_curl_is_arr((arg), long))                                          \\\n        _curl_easy_getinfo_err_long();                                        \\\n    if(_curl_is_double_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), double))                                        \\\n        _curl_easy_getinfo_err_double();                                      \\\n    if(_curl_is_slist_info(_curl_info))                                       \\\n      if(!_curl_is_arr((arg), struct curl_slist *))                           \\\n        _curl_easy_getinfo_err_curl_slist();                                  \\\n  }                                                                           \\\n  curl_easy_getinfo(handle, _curl_info, arg);                                 \\\n})\n\n/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),\n * for now just make sure that the functions are called with three\n * arguments\n */\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n\n\n/* the actual warnings, triggered by calling the _curl_easy_setopt_err*\n * functions */\n\n/* To define a new warning, use _CURL_WARNING(identifier, \"message\") */\n#define _CURL_WARNING(id, message)                                            \\\n  static void __attribute__((__warning__(message)))                           \\\n  __attribute__((__unused__)) __attribute__((__noinline__))                   \\\n  id(void) { __asm__(\"\"); }\n\n_CURL_WARNING(_curl_easy_setopt_err_long,\n  \"curl_easy_setopt expects a long argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,\n  \"curl_easy_setopt expects a curl_off_t argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_string,\n              \"curl_easy_setopt expects a \"\n              \"string (char* or char[]) argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_write_callback,\n  \"curl_easy_setopt expects a curl_write_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_read_cb,\n  \"curl_easy_setopt expects a curl_read_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,\n  \"curl_easy_setopt expects a curl_ioctl_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,\n  \"curl_easy_setopt expects a curl_sockopt_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,\n              \"curl_easy_setopt expects a \"\n              \"curl_opensocket_callback argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_progress_cb,\n  \"curl_easy_setopt expects a curl_progress_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_debug_cb,\n  \"curl_easy_setopt expects a curl_debug_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,\n  \"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_conv_cb,\n  \"curl_easy_setopt expects a curl_conv_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_seek_cb,\n  \"curl_easy_setopt expects a curl_seek_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_cb_data,\n              \"curl_easy_setopt expects a \"\n              \"private data pointer as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_error_buffer,\n              \"curl_easy_setopt expects a \"\n              \"char buffer of CURL_ERROR_SIZE as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_FILE,\n  \"curl_easy_setopt expects a FILE* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_postfields,\n  \"curl_easy_setopt expects a void* or char* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,\n  \"curl_easy_setopt expects a struct curl_httppost* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_slist,\n  \"curl_easy_setopt expects a struct curl_slist* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_CURLSH,\n  \"curl_easy_setopt expects a CURLSH* argument for this option\")\n\n_CURL_WARNING(_curl_easy_getinfo_err_string,\n  \"curl_easy_getinfo expects a pointer to char * for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_long,\n  \"curl_easy_getinfo expects a pointer to long for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_double,\n  \"curl_easy_getinfo expects a pointer to double for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,\n  \"curl_easy_getinfo expects a pointer to struct curl_slist * for this info\")\n\n/* groups of curl_easy_setops options that take the same type of argument */\n\n/* To add a new option to one of the groups, just add\n *   (option) == CURLOPT_SOMETHING\n * to the or-expression. If the option takes a long or curl_off_t, you don't\n * have to do anything\n */\n\n/* evaluates to true if option takes a long argument */\n#define _curl_is_long_option(option)                                          \\\n  (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)\n\n#define _curl_is_off_t_option(option)                                         \\\n  ((option) > CURLOPTTYPE_OFF_T)\n\n/* evaluates to true if option takes a char* argument */\n#define _curl_is_string_option(option)                                        \\\n  ((option) == CURLOPT_URL ||                                                 \\\n   (option) == CURLOPT_PROXY ||                                               \\\n   (option) == CURLOPT_INTERFACE ||                                           \\\n   (option) == CURLOPT_NETRC_FILE ||                                          \\\n   (option) == CURLOPT_USERPWD ||                                             \\\n   (option) == CURLOPT_USERNAME ||                                            \\\n   (option) == CURLOPT_PASSWORD ||                                            \\\n   (option) == CURLOPT_PROXYUSERPWD ||                                        \\\n   (option) == CURLOPT_PROXYUSERNAME ||                                       \\\n   (option) == CURLOPT_PROXYPASSWORD ||                                       \\\n   (option) == CURLOPT_NOPROXY ||                                             \\\n   (option) == CURLOPT_ACCEPT_ENCODING ||                                     \\\n   (option) == CURLOPT_REFERER ||                                             \\\n   (option) == CURLOPT_USERAGENT ||                                           \\\n   (option) == CURLOPT_COOKIE ||                                              \\\n   (option) == CURLOPT_COOKIEFILE ||                                          \\\n   (option) == CURLOPT_COOKIEJAR ||                                           \\\n   (option) == CURLOPT_COOKIELIST ||                                          \\\n   (option) == CURLOPT_FTPPORT ||                                             \\\n   (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER ||                             \\\n   (option) == CURLOPT_FTP_ACCOUNT ||                                         \\\n   (option) == CURLOPT_RANGE ||                                               \\\n   (option) == CURLOPT_CUSTOMREQUEST ||                                       \\\n   (option) == CURLOPT_SSLCERT ||                                             \\\n   (option) == CURLOPT_SSLCERTTYPE ||                                         \\\n   (option) == CURLOPT_SSLKEY ||                                              \\\n   (option) == CURLOPT_SSLKEYTYPE ||                                          \\\n   (option) == CURLOPT_KEYPASSWD ||                                           \\\n   (option) == CURLOPT_SSLENGINE ||                                           \\\n   (option) == CURLOPT_CAINFO ||                                              \\\n   (option) == CURLOPT_CAPATH ||                                              \\\n   (option) == CURLOPT_RANDOM_FILE ||                                         \\\n   (option) == CURLOPT_EGDSOCKET ||                                           \\\n   (option) == CURLOPT_SSL_CIPHER_LIST ||                                     \\\n   (option) == CURLOPT_KRBLEVEL ||                                            \\\n   (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 ||                             \\\n   (option) == CURLOPT_SSH_PUBLIC_KEYFILE ||                                  \\\n   (option) == CURLOPT_SSH_PRIVATE_KEYFILE ||                                 \\\n   (option) == CURLOPT_CRLFILE ||                                             \\\n   (option) == CURLOPT_ISSUERCERT ||                                          \\\n   (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE ||                               \\\n   (option) == CURLOPT_SSH_KNOWNHOSTS ||                                      \\\n   (option) == CURLOPT_MAIL_FROM ||                                           \\\n   (option) == CURLOPT_RTSP_SESSION_ID ||                                     \\\n   (option) == CURLOPT_RTSP_STREAM_URI ||                                     \\\n   (option) == CURLOPT_RTSP_TRANSPORT ||                                      \\\n   0)\n\n/* evaluates to true if option takes a curl_write_callback argument */\n#define _curl_is_write_cb_option(option)                                      \\\n  ((option) == CURLOPT_HEADERFUNCTION ||                                      \\\n   (option) == CURLOPT_WRITEFUNCTION)\n\n/* evaluates to true if option takes a curl_conv_callback argument */\n#define _curl_is_conv_cb_option(option)                                       \\\n  ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION ||                            \\\n   (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION ||                          \\\n   (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)\n\n/* evaluates to true if option takes a data argument to pass to a callback */\n#define _curl_is_cb_data_option(option)                                       \\\n  ((option) == CURLOPT_WRITEDATA ||                                           \\\n   (option) == CURLOPT_READDATA ||                                            \\\n   (option) == CURLOPT_IOCTLDATA ||                                           \\\n   (option) == CURLOPT_SOCKOPTDATA ||                                         \\\n   (option) == CURLOPT_OPENSOCKETDATA ||                                      \\\n   (option) == CURLOPT_PROGRESSDATA ||                                        \\\n   (option) == CURLOPT_WRITEHEADER ||                                         \\\n   (option) == CURLOPT_DEBUGDATA ||                                           \\\n   (option) == CURLOPT_SSL_CTX_DATA ||                                        \\\n   (option) == CURLOPT_SEEKDATA ||                                            \\\n   (option) == CURLOPT_PRIVATE ||                                             \\\n   (option) == CURLOPT_SSH_KEYDATA ||                                         \\\n   (option) == CURLOPT_INTERLEAVEDATA ||                                      \\\n   (option) == CURLOPT_CHUNK_DATA ||                                          \\\n   (option) == CURLOPT_FNMATCH_DATA ||                                        \\\n   0)\n\n/* evaluates to true if option takes a POST data argument (void* or char*) */\n#define _curl_is_postfields_option(option)                                    \\\n  ((option) == CURLOPT_POSTFIELDS ||                                          \\\n   (option) == CURLOPT_COPYPOSTFIELDS ||                                      \\\n   0)\n\n/* evaluates to true if option takes a struct curl_slist * argument */\n#define _curl_is_slist_option(option)                                         \\\n  ((option) == CURLOPT_HTTPHEADER ||                                          \\\n   (option) == CURLOPT_HTTP200ALIASES ||                                      \\\n   (option) == CURLOPT_QUOTE ||                                               \\\n   (option) == CURLOPT_POSTQUOTE ||                                           \\\n   (option) == CURLOPT_PREQUOTE ||                                            \\\n   (option) == CURLOPT_TELNETOPTIONS ||                                       \\\n   (option) == CURLOPT_MAIL_RCPT ||                                           \\\n   0)\n\n/* groups of curl_easy_getinfo infos that take the same type of argument */\n\n/* evaluates to true if info expects a pointer to char * argument */\n#define _curl_is_string_info(info)                                            \\\n  (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)\n\n/* evaluates to true if info expects a pointer to long argument */\n#define _curl_is_long_info(info)                                              \\\n  (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)\n\n/* evaluates to true if info expects a pointer to double argument */\n#define _curl_is_double_info(info)                                            \\\n  (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)\n\n/* true if info expects a pointer to struct curl_slist * argument */\n#define _curl_is_slist_info(info)                                             \\\n  (CURLINFO_SLIST < (info))\n\n\n/* typecheck helpers -- check whether given expression has requested type*/\n\n/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,\n * otherwise define a new macro. Search for __builtin_types_compatible_p\n * in the GCC manual.\n * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is\n * the actual expression passed to the curl_easy_setopt macro. This\n * means that you can only apply the sizeof and __typeof__ operators, no\n * == or whatsoever.\n */\n\n/* XXX: should evaluate to true iff expr is a pointer */\n#define _curl_is_any_ptr(expr)                                                \\\n  (sizeof(expr) == sizeof(void*))\n\n/* evaluates to true if expr is NULL */\n/* XXX: must not evaluate expr, so this check is not accurate */\n#define _curl_is_NULL(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))\n\n/* evaluates to true if expr is type*, const type* or NULL */\n#define _curl_is_ptr(expr, type)                                              \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), type *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), const type *))\n\n/* evaluates to true if expr is one of type[], type*, NULL or const type* */\n#define _curl_is_arr(expr, type)                                              \\\n  (_curl_is_ptr((expr), type) ||                                              \\\n   __builtin_types_compatible_p(__typeof__(expr), type []))\n\n/* evaluates to true if expr is a string */\n#define _curl_is_string(expr)                                                 \\\n  (_curl_is_arr((expr), char) ||                                              \\\n   _curl_is_arr((expr), signed char) ||                                       \\\n   _curl_is_arr((expr), unsigned char))\n\n/* evaluates to true if expr is a long (no matter the signedness)\n * XXX: for now, int is also accepted (and therefore short and char, which\n * are promoted to int when passed to a variadic function) */\n#define _curl_is_long(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), long) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed long) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned long) ||           \\\n   __builtin_types_compatible_p(__typeof__(expr), int) ||                     \\\n   __builtin_types_compatible_p(__typeof__(expr), signed int) ||              \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned int) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), short) ||                   \\\n   __builtin_types_compatible_p(__typeof__(expr), signed short) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned short) ||          \\\n   __builtin_types_compatible_p(__typeof__(expr), char) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed char) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned char))\n\n/* evaluates to true if expr is of type curl_off_t */\n#define _curl_is_off_t(expr)                                                  \\\n  (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))\n\n/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */\n/* XXX: also check size of an char[] array? */\n#define _curl_is_error_buffer(expr)                                           \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), char *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), char[]))\n\n/* evaluates to true if expr is of type (const) void* or (const) FILE* */\n#if 0\n#define _curl_is_cb_data(expr)                                                \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_ptr((expr), FILE))\n#else /* be less strict */\n#define _curl_is_cb_data(expr)                                                \\\n  _curl_is_any_ptr(expr)\n#endif\n\n/* evaluates to true if expr is of type FILE* */\n#define _curl_is_FILE(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), FILE *))\n\n/* evaluates to true if expr can be passed as POST data (void* or char*) */\n#define _curl_is_postfields(expr)                                             \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_arr((expr), char))\n\n/* FIXME: the whole callback checking is messy...\n * The idea is to tolerate char vs. void and const vs. not const\n * pointers in arguments at least\n */\n/* helper: __builtin_types_compatible_p distinguishes between functions and\n * function pointers, hide it */\n#define _curl_callback_compatible(func, type)                                 \\\n  (__builtin_types_compatible_p(__typeof__(func), type) ||                    \\\n   __builtin_types_compatible_p(__typeof__(func), type*))\n\n/* evaluates to true if expr is of type curl_read_callback or \"similar\" */\n#define _curl_is_read_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) ||       \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_read_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback4) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback5) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback6))\ntypedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_write_callback or \"similar\" */\n#define _curl_is_write_cb(expr)                                               \\\n  (_curl_is_read_cb(expr) ||                                            \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) ||      \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_write_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback6))\ntypedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback2)(const char *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback5)(const void *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_ioctl_callback or \"similar\" */\n#define _curl_is_ioctl_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback4))\ntypedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);\ntypedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);\ntypedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);\ntypedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);\n\n/* evaluates to true if expr is of type curl_sockopt_callback or \"similar\" */\n#define _curl_is_sockopt_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback2))\ntypedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);\ntypedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,\n                                      curlsocktype);\n\n/* evaluates to true if expr is of type curl_opensocket_callback or\n   \"similar\" */\n#define _curl_is_opensocket_cb(expr)                                    \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\\\n   _curl_callback_compatible((expr), _curl_opensocket_callback1) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback2) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback3) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback4))\ntypedef curl_socket_t (_curl_opensocket_callback1)\n  (void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback2)\n  (void *, curlsocktype, const struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback3)\n  (const void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback4)\n  (const void *, curlsocktype, const struct curl_sockaddr *);\n\n/* evaluates to true if expr is of type curl_progress_callback or \"similar\" */\n#define _curl_is_progress_cb(expr)                                      \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) ||  \\\n   _curl_callback_compatible((expr), _curl_progress_callback1) ||             \\\n   _curl_callback_compatible((expr), _curl_progress_callback2))\ntypedef int (_curl_progress_callback1)(void *,\n    double, double, double, double);\ntypedef int (_curl_progress_callback2)(const void *,\n    double, double, double, double);\n\n/* evaluates to true if expr is of type curl_debug_callback or \"similar\" */\n#define _curl_is_debug_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_debug_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback6) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback7) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback8))\ntypedef int (_curl_debug_callback1) (CURL *,\n    curl_infotype, char *, size_t, void *);\ntypedef int (_curl_debug_callback2) (CURL *,\n    curl_infotype, char *, size_t, const void *);\ntypedef int (_curl_debug_callback3) (CURL *,\n    curl_infotype, const char *, size_t, void *);\ntypedef int (_curl_debug_callback4) (CURL *,\n    curl_infotype, const char *, size_t, const void *);\ntypedef int (_curl_debug_callback5) (CURL *,\n    curl_infotype, unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback6) (CURL *,\n    curl_infotype, unsigned char *, size_t, const void *);\ntypedef int (_curl_debug_callback7) (CURL *,\n    curl_infotype, const unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback8) (CURL *,\n    curl_infotype, const unsigned char *, size_t, const void *);\n\n/* evaluates to true if expr is of type curl_ssl_ctx_callback or \"similar\" */\n/* this is getting even messier... */\n#define _curl_is_ssl_ctx_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))\ntypedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);\n#ifdef HEADER_SSL_H\n/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX\n * this will of course break if we're included before OpenSSL headers...\n */\ntypedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,\n                                           const void *);\n#else\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;\n#endif\n\n/* evaluates to true if expr is of type curl_conv_callback or \"similar\" */\n#define _curl_is_conv_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_conv_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback4))\ntypedef CURLcode (*_curl_conv_callback1)(char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback3)(void *, size_t length);\ntypedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);\n\n/* evaluates to true if expr is of type curl_seek_callback or \"similar\" */\n#define _curl_is_seek_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_seek_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_seek_callback2))\ntypedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);\ntypedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);\n\n\n#endif /* __CURL_TYPECHECK_GCC_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/android/curl/types.h",
    "content": "/* not used */\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/curl.h",
    "content": "#ifndef __CURL_CURL_H\n#define __CURL_CURL_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/*\n * If you have libcurl problems, all docs and details are found here:\n *   http://curl.haxx.se/libcurl/\n *\n * curl-library mailing list subscription and unsubscription web interface:\n *   http://cool.haxx.se/mailman/listinfo/curl-library/\n */\n\n#include \"curlver.h\"         /* libcurl version defines   */\n#include \"curlbuild.h\"       /* libcurl build definitions */\n#include \"curlrules.h\"       /* libcurl rules enforcement */\n\n/*\n * Define WIN32 when build target is Win32 API\n */\n\n#if (defined(_WIN32) || defined(__WIN32__)) && \\\n     !defined(WIN32) && !defined(__SYMBIAN32__)\n#define WIN32\n#endif\n\n#include <stdio.h>\n#include <limits.h>\n\n#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)\n/* Needed for __FreeBSD_version symbol definition */\n#include <osreldate.h>\n#endif\n\n/* The include stuff here below is mainly for time_t! */\n#include <sys/types.h>\n#include <time.h>\n\n#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)\n#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))\n/* The check above prevents the winsock2 inclusion if winsock.h already was\n   included, since they can't co-exist without problems */\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#endif\n#endif\n\n/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish\n   libc5-based Linux systems. Only include it on systems that are known to\n   require it! */\n#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \\\n    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \\\n    defined(ANDROID) || defined(__ANDROID__) || \\\n   (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))\n#include <sys/select.h>\n#endif\n\n#if !defined(WIN32) && !defined(_WIN32_WCE)\n#include <sys/socket.h>\n#endif\n\n#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)\n#include <sys/time.h>\n#endif\n\n#ifdef __BEOS__\n#include <support/SupportDefs.h>\n#endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURL;\n\n/*\n * Decorate exportable functions for Win32 and Symbian OS DLL linking.\n * This avoids using a .def file for building libcurl.dll.\n */\n#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \\\n     !defined(CURL_STATICLIB)\n#if defined(BUILDING_LIBCURL)\n#define CURL_EXTERN  __declspec(dllexport)\n#else\n#define CURL_EXTERN  __declspec(dllimport)\n#endif\n#else\n\n#ifdef CURL_HIDDEN_SYMBOLS\n/*\n * This definition is used to make external definitions visible in the\n * shared library when symbols are hidden by default.  It makes no\n * difference when compiling applications whether this is set or not,\n * only when compiling the library.\n */\n#define CURL_EXTERN CURL_EXTERN_SYMBOL\n#else\n#define CURL_EXTERN\n#endif\n#endif\n\n#ifndef curl_socket_typedef\n/* socket typedef */\n#if defined(WIN32) && !defined(__LWIP_OPT_H__)\ntypedef SOCKET curl_socket_t;\n#define CURL_SOCKET_BAD INVALID_SOCKET\n#else\ntypedef int curl_socket_t;\n#define CURL_SOCKET_BAD -1\n#endif\n#define curl_socket_typedef\n#endif /* curl_socket_typedef */\n\nstruct curl_httppost {\n  struct curl_httppost *next;       /* next entry in the list */\n  char *name;                       /* pointer to allocated name */\n  long namelength;                  /* length of name length */\n  char *contents;                   /* pointer to allocated data contents */\n  long contentslength;              /* length of contents field */\n  char *buffer;                     /* pointer to allocated buffer contents */\n  long bufferlength;                /* length of buffer field */\n  char *contenttype;                /* Content-Type */\n  struct curl_slist* contentheader; /* list of extra headers for this form */\n  struct curl_httppost *more;       /* if one field name has more than one\n                                       file, this link should link to following\n                                       files */\n  long flags;                       /* as defined below */\n#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */\n#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */\n#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */\n#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */\n#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the\n                                       regular read callback to get the data\n                                       and pass the given pointer as custom\n                                       pointer */\n\n  char *showfilename;               /* The file name to show. If not set, the\n                                       actual file name will be used (if this\n                                       is a file part) */\n  void *userp;                      /* custom pointer used for\n                                       HTTPPOST_CALLBACK posts */\n};\n\ntypedef int (*curl_progress_callback)(void *clientp,\n                                      double dltotal,\n                                      double dlnow,\n                                      double ultotal,\n                                      double ulnow);\n\n#ifndef CURL_MAX_WRITE_SIZE\n  /* Tests have proven that 20K is a very bad buffer size for uploads on\n     Windows, while 16K for some odd reason performed a lot better.\n     We do the ifndef check to allow this value to easier be changed at build\n     time for those who feel adventurous. The practical minimum is about\n     400 bytes since libcurl uses a buffer of this size as a scratch area\n     (unrelated to network send operations). */\n#define CURL_MAX_WRITE_SIZE 16384\n#endif\n\n#ifndef CURL_MAX_HTTP_HEADER\n/* The only reason to have a max limit for this is to avoid the risk of a bad\n   server feeding libcurl with a never-ending header that will cause reallocs\n   infinitely */\n#define CURL_MAX_HTTP_HEADER (100*1024)\n#endif\n\n/* This is a magic return code for the write callback that, when returned,\n   will signal libcurl to pause receiving on the current transfer. */\n#define CURL_WRITEFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_write_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *outstream);\n\n\n\n/* enumeration of file types */\ntypedef enum {\n  CURLFILETYPE_FILE = 0,\n  CURLFILETYPE_DIRECTORY,\n  CURLFILETYPE_SYMLINK,\n  CURLFILETYPE_DEVICE_BLOCK,\n  CURLFILETYPE_DEVICE_CHAR,\n  CURLFILETYPE_NAMEDPIPE,\n  CURLFILETYPE_SOCKET,\n  CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */\n\n  CURLFILETYPE_UNKNOWN /* should never occur */\n} curlfiletype;\n\n#define CURLFINFOFLAG_KNOWN_FILENAME    (1<<0)\n#define CURLFINFOFLAG_KNOWN_FILETYPE    (1<<1)\n#define CURLFINFOFLAG_KNOWN_TIME        (1<<2)\n#define CURLFINFOFLAG_KNOWN_PERM        (1<<3)\n#define CURLFINFOFLAG_KNOWN_UID         (1<<4)\n#define CURLFINFOFLAG_KNOWN_GID         (1<<5)\n#define CURLFINFOFLAG_KNOWN_SIZE        (1<<6)\n#define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1<<7)\n\n/* Content of this structure depends on information which is known and is\n   achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man\n   page for callbacks returning this structure -- some fields are mandatory,\n   some others are optional. The FLAG field has special meaning. */\nstruct curl_fileinfo {\n  char *filename;\n  curlfiletype filetype;\n  time_t time;\n  unsigned int perm;\n  int uid;\n  int gid;\n  curl_off_t size;\n  long int hardlinks;\n\n  struct {\n    /* If some of these fields is not NULL, it is a pointer to b_data. */\n    char *time;\n    char *perm;\n    char *user;\n    char *group;\n    char *target; /* pointer to the target filename of a symlink */\n  } strings;\n\n  unsigned int flags;\n\n  /* used internally */\n  char * b_data;\n  size_t b_size;\n  size_t b_used;\n};\n\n/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */\n#define CURL_CHUNK_BGN_FUNC_OK      0\n#define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */\n#define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */\n\n/* if splitting of data transfer is enabled, this callback is called before\n   download of an individual chunk started. Note that parameter \"remains\" works\n   only for FTP wildcard downloading (for now), otherwise is not used */\ntypedef long (*curl_chunk_bgn_callback)(const void *transfer_info,\n                                        void *ptr,\n                                        int remains);\n\n/* return codes for CURLOPT_CHUNK_END_FUNCTION */\n#define CURL_CHUNK_END_FUNC_OK      0\n#define CURL_CHUNK_END_FUNC_FAIL    1 /* tell the lib to end the task */\n\n/* If splitting of data transfer is enabled this callback is called after\n   download of an individual chunk finished.\n   Note! After this callback was set then it have to be called FOR ALL chunks.\n   Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.\n   This is the reason why we don't need \"transfer_info\" parameter in this\n   callback and we are not interested in \"remains\" parameter too. */\ntypedef long (*curl_chunk_end_callback)(void *ptr);\n\n/* return codes for FNMATCHFUNCTION */\n#define CURL_FNMATCHFUNC_MATCH    0 /* string corresponds to the pattern */\n#define CURL_FNMATCHFUNC_NOMATCH  1 /* pattern doesn't match the string */\n#define CURL_FNMATCHFUNC_FAIL     2 /* an error occurred */\n\n/* callback type for wildcard downloading pattern matching. If the\n   string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */\ntypedef int (*curl_fnmatch_callback)(void *ptr,\n                                     const char *pattern,\n                                     const char *string);\n\n/* These are the return codes for the seek callbacks */\n#define CURL_SEEKFUNC_OK       0\n#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */\n#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so\n                                    libcurl might try other means instead */\ntypedef int (*curl_seek_callback)(void *instream,\n                                  curl_off_t offset,\n                                  int origin); /* 'whence' */\n\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to immediately abort the current transfer. */\n#define CURL_READFUNC_ABORT 0x10000000\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to pause sending data on the current transfer. */\n#define CURL_READFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_read_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *instream);\n\ntypedef enum  {\n  CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */\n  CURLSOCKTYPE_LAST   /* never use */\n} curlsocktype;\n\n/* The return code from the sockopt_callback can signal information back\n   to libcurl: */\n#define CURL_SOCKOPT_OK 0\n#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return\n                                CURLE_ABORTED_BY_CALLBACK */\n#define CURL_SOCKOPT_ALREADY_CONNECTED 2\n\ntypedef int (*curl_sockopt_callback)(void *clientp,\n                                     curl_socket_t curlfd,\n                                     curlsocktype purpose);\n\nstruct curl_sockaddr {\n  int family;\n  int socktype;\n  int protocol;\n  unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it\n                           turned really ugly and painful on the systems that\n                           lack this type */\n  struct sockaddr addr;\n};\n\ntypedef curl_socket_t\n(*curl_opensocket_callback)(void *clientp,\n                            curlsocktype purpose,\n                            struct curl_sockaddr *address);\n\ntypedef int\n(*curl_closesocket_callback)(void *clientp, curl_socket_t item);\n\ntypedef enum {\n  CURLIOE_OK,            /* I/O operation successful */\n  CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */\n  CURLIOE_FAILRESTART,   /* failed to restart the read */\n  CURLIOE_LAST           /* never use */\n} curlioerr;\n\ntypedef enum  {\n  CURLIOCMD_NOP,         /* no operation */\n  CURLIOCMD_RESTARTREAD, /* restart the read stream from start */\n  CURLIOCMD_LAST         /* never use */\n} curliocmd;\n\ntypedef curlioerr (*curl_ioctl_callback)(CURL *handle,\n                                         int cmd,\n                                         void *clientp);\n\n/*\n * The following typedef's are signatures of malloc, free, realloc, strdup and\n * calloc respectively.  Function pointers of these types can be passed to the\n * curl_global_init_mem() function to set user defined memory management\n * callback routines.\n */\ntypedef void *(*curl_malloc_callback)(size_t size);\ntypedef void (*curl_free_callback)(void *ptr);\ntypedef void *(*curl_realloc_callback)(void *ptr, size_t size);\ntypedef char *(*curl_strdup_callback)(const char *str);\ntypedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);\n\n/* the kind of data that is passed to information_callback*/\ntypedef enum {\n  CURLINFO_TEXT = 0,\n  CURLINFO_HEADER_IN,    /* 1 */\n  CURLINFO_HEADER_OUT,   /* 2 */\n  CURLINFO_DATA_IN,      /* 3 */\n  CURLINFO_DATA_OUT,     /* 4 */\n  CURLINFO_SSL_DATA_IN,  /* 5 */\n  CURLINFO_SSL_DATA_OUT, /* 6 */\n  CURLINFO_END\n} curl_infotype;\n\ntypedef int (*curl_debug_callback)\n       (CURL *handle,      /* the handle/transfer this concerns */\n        curl_infotype type, /* what kind of data */\n        char *data,        /* points to the data */\n        size_t size,       /* size of the data pointed to */\n        void *userptr);    /* whatever the user please */\n\n/* All possible error codes from all sorts of curl functions. Future versions\n   may return other values, stay prepared.\n\n   Always add new return codes last. Never *EVER* remove any. The return\n   codes must remain the same!\n */\n\ntypedef enum {\n  CURLE_OK = 0,\n  CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */\n  CURLE_FAILED_INIT,             /* 2 */\n  CURLE_URL_MALFORMAT,           /* 3 */\n  CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for\n                                    7.17.0, reused in April 2011 for 7.21.5] */\n  CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */\n  CURLE_COULDNT_RESOLVE_HOST,    /* 6 */\n  CURLE_COULDNT_CONNECT,         /* 7 */\n  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */\n  CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server\n                                    due to lack of access - when login fails\n                                    this is not returned. */\n  CURLE_FTP_ACCEPT_FAILED,       /* 10 - [was obsoleted in April 2006 for\n                                    7.15.4, reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */\n  CURLE_FTP_ACCEPT_TIMEOUT,      /* 12 - timeout occurred accepting server\n                                    [was obsoleted in August 2007 for 7.17.0,\n                                    reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */\n  CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */\n  CURLE_FTP_CANT_GET_HOST,       /* 15 */\n  CURLE_OBSOLETE16,              /* 16 - NOT USED */\n  CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */\n  CURLE_PARTIAL_FILE,            /* 18 */\n  CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */\n  CURLE_OBSOLETE20,              /* 20 - NOT USED */\n  CURLE_QUOTE_ERROR,             /* 21 - quote command failure */\n  CURLE_HTTP_RETURNED_ERROR,     /* 22 */\n  CURLE_WRITE_ERROR,             /* 23 */\n  CURLE_OBSOLETE24,              /* 24 - NOT USED */\n  CURLE_UPLOAD_FAILED,           /* 25 - failed upload \"command\" */\n  CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */\n  CURLE_OUT_OF_MEMORY,           /* 27 */\n  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error\n           instead of a memory allocation error if CURL_DOES_CONVERSIONS\n           is defined\n  */\n  CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */\n  CURLE_OBSOLETE29,              /* 29 - NOT USED */\n  CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */\n  CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */\n  CURLE_OBSOLETE32,              /* 32 - NOT USED */\n  CURLE_RANGE_ERROR,             /* 33 - RANGE \"command\" didn't work */\n  CURLE_HTTP_POST_ERROR,         /* 34 */\n  CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */\n  CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */\n  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */\n  CURLE_LDAP_CANNOT_BIND,        /* 38 */\n  CURLE_LDAP_SEARCH_FAILED,      /* 39 */\n  CURLE_OBSOLETE40,              /* 40 - NOT USED */\n  CURLE_FUNCTION_NOT_FOUND,      /* 41 */\n  CURLE_ABORTED_BY_CALLBACK,     /* 42 */\n  CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */\n  CURLE_OBSOLETE44,              /* 44 - NOT USED */\n  CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */\n  CURLE_OBSOLETE46,              /* 46 - NOT USED */\n  CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */\n  CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */\n  CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */\n  CURLE_OBSOLETE50,              /* 50 - NOT USED */\n  CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint\n                                     wasn't verified fine */\n  CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */\n  CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */\n  CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as\n                                    default */\n  CURLE_SEND_ERROR,              /* 55 - failed sending network data */\n  CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */\n  CURLE_OBSOLETE57,              /* 57 - NOT IN USE */\n  CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */\n  CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */\n  CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */\n  CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */\n  CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */\n  CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */\n  CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */\n  CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind\n                                    that failed */\n  CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */\n  CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not\n                                    accepted and we failed to login */\n  CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */\n  CURLE_TFTP_PERM,               /* 69 - permission problem on server */\n  CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */\n  CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */\n  CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */\n  CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */\n  CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */\n  CURLE_CONV_FAILED,             /* 75 - conversion failed */\n  CURLE_CONV_REQD,               /* 76 - caller must register conversion\n                                    callbacks using curl_easy_setopt options\n                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,\n                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and\n                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */\n  CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing\n                                    or wrong format */\n  CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */\n  CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat\n                                    generic so the error message will be of\n                                    interest when this has happened */\n\n  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL\n                                    connection */\n  CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,\n                                    wait till it's ready and try again (Added\n                                    in 7.18.2) */\n  CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or\n                                    wrong format (Added in 7.19.0) */\n  CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in\n                                    7.19.0) */\n  CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */\n  CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */\n  CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */\n  CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */\n  CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */\n  CURL_LAST /* never use! */\n} CURLcode;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Previously obsoletes error codes re-used in 7.24.0 */\n#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED\n#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT\n\n/*  compatibility with older names */\n#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING\n\n/* The following were added in 7.21.5, April 2011 */\n#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION\n\n/* The following were added in 7.17.1 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION\n\n/* The following were added in 7.17.0 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */\n#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46\n#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44\n#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10\n#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16\n#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32\n#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29\n#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12\n#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20\n#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40\n#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24\n#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57\n#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN\n\n#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED\n#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE\n#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR\n#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL\n#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS\n#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR\n#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED\n\n/* The following were added earlier */\n\n#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT\n\n#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR\n#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED\n#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED\n\n#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE\n#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME\n\n/* This was the error code 50 in 7.7.3 and a few earlier versions, this\n   is no longer used by libcurl but is instead #defined here only to not\n   make programs break */\n#define CURLE_ALREADY_COMPLETE 99999\n\n#endif /*!CURL_NO_OLDIES*/\n\n/* This prototype applies to all conversion callbacks */\ntypedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);\n\ntypedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */\n                                          void *ssl_ctx, /* actually an\n                                                            OpenSSL SSL_CTX */\n                                          void *userptr);\n\ntypedef enum {\n  CURLPROXY_HTTP = 0,   /* added in 7.10, new in 7.19.4 default is to use\n                           CONNECT HTTP/1.1 */\n  CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT\n                               HTTP/1.0  */\n  CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already\n                           in 7.10 */\n  CURLPROXY_SOCKS5 = 5, /* added in 7.10 */\n  CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */\n  CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the\n                                   host name rather than the IP address. added\n                                   in 7.18.0 */\n} curl_proxytype;  /* this enum was added in 7.10 */\n\n/*\n * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:\n *\n * CURLAUTH_NONE         - No HTTP authentication\n * CURLAUTH_BASIC        - HTTP Basic authentication (default)\n * CURLAUTH_DIGEST       - HTTP Digest authentication\n * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication\n * CURLAUTH_NTLM         - HTTP NTLM authentication\n * CURLAUTH_DIGEST_IE    - HTTP Digest authentication with IE flavour\n * CURLAUTH_NTLM_WB      - HTTP NTLM authentication delegated to winbind helper\n * CURLAUTH_ONLY         - Use together with a single other type to force no\n *                         authentication or just that single type\n * CURLAUTH_ANY          - All fine types set\n * CURLAUTH_ANYSAFE      - All fine types except Basic\n */\n\n#define CURLAUTH_NONE         ((unsigned long)0)\n#define CURLAUTH_BASIC        (((unsigned long)1)<<0)\n#define CURLAUTH_DIGEST       (((unsigned long)1)<<1)\n#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)\n#define CURLAUTH_NTLM         (((unsigned long)1)<<3)\n#define CURLAUTH_DIGEST_IE    (((unsigned long)1)<<4)\n#define CURLAUTH_NTLM_WB      (((unsigned long)1)<<5)\n#define CURLAUTH_ONLY         (((unsigned long)1)<<31)\n#define CURLAUTH_ANY          (~CURLAUTH_DIGEST_IE)\n#define CURLAUTH_ANYSAFE      (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))\n\n#define CURLSSH_AUTH_ANY       ~0     /* all types supported by the server */\n#define CURLSSH_AUTH_NONE      0      /* none allowed, silly but complete */\n#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */\n#define CURLSSH_AUTH_PASSWORD  (1<<1) /* password */\n#define CURLSSH_AUTH_HOST      (1<<2) /* host key files */\n#define CURLSSH_AUTH_KEYBOARD  (1<<3) /* keyboard interactive */\n#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY\n\n#define CURLGSSAPI_DELEGATION_NONE        0      /* no delegation (default) */\n#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */\n#define CURLGSSAPI_DELEGATION_FLAG        (1<<1) /* delegate always */\n\n#define CURL_ERROR_SIZE 256\n\nstruct curl_khkey {\n  const char *key; /* points to a zero-terminated string encoded with base64\n                      if len is zero, otherwise to the \"raw\" data */\n  size_t len;\n  enum type {\n    CURLKHTYPE_UNKNOWN,\n    CURLKHTYPE_RSA1,\n    CURLKHTYPE_RSA,\n    CURLKHTYPE_DSS\n  } keytype;\n};\n\n/* this is the set of return values expected from the curl_sshkeycallback\n   callback */\nenum curl_khstat {\n  CURLKHSTAT_FINE_ADD_TO_FILE,\n  CURLKHSTAT_FINE,\n  CURLKHSTAT_REJECT, /* reject the connection, return an error */\n  CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now so\n                        this causes a CURLE_DEFER error but otherwise the\n                        connection will be left intact etc */\n  CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */\n};\n\n/* this is the set of status codes pass in to the callback */\nenum curl_khmatch {\n  CURLKHMATCH_OK,       /* match */\n  CURLKHMATCH_MISMATCH, /* host found, key mismatch! */\n  CURLKHMATCH_MISSING,  /* no matching host/key found */\n  CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */\n};\n\ntypedef int\n  (*curl_sshkeycallback) (CURL *easy,     /* easy handle */\n                          const struct curl_khkey *knownkey, /* known */\n                          const struct curl_khkey *foundkey, /* found */\n                          enum curl_khmatch, /* libcurl's view on the keys */\n                          void *clientp); /* custom pointer passed from app */\n\n/* parameter for the CURLOPT_USE_SSL option */\ntypedef enum {\n  CURLUSESSL_NONE,    /* do not attempt to use SSL */\n  CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */\n  CURLUSESSL_CONTROL, /* SSL for the control connection or fail */\n  CURLUSESSL_ALL,     /* SSL for all communication or fail */\n  CURLUSESSL_LAST     /* not an option, never use */\n} curl_usessl;\n\n/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */\n\n/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the\n   name of improving interoperability with older servers. Some SSL libraries\n   have introduced work-arounds for this flaw but those work-arounds sometimes\n   make the SSL communication fail. To regain functionality with those broken\n   servers, a user can this way allow the vulnerability back. */\n#define CURLSSLOPT_ALLOW_BEAST (1<<0)\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2009 */\n\n#define CURLFTPSSL_NONE CURLUSESSL_NONE\n#define CURLFTPSSL_TRY CURLUSESSL_TRY\n#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL\n#define CURLFTPSSL_ALL CURLUSESSL_ALL\n#define CURLFTPSSL_LAST CURLUSESSL_LAST\n#define curl_ftpssl curl_usessl\n#endif /*!CURL_NO_OLDIES*/\n\n/* parameter for the CURLOPT_FTP_SSL_CCC option */\ntypedef enum {\n  CURLFTPSSL_CCC_NONE,    /* do not send CCC */\n  CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */\n  CURLFTPSSL_CCC_ACTIVE,  /* Initiate the shutdown */\n  CURLFTPSSL_CCC_LAST     /* not an option, never use */\n} curl_ftpccc;\n\n/* parameter for the CURLOPT_FTPSSLAUTH option */\ntypedef enum {\n  CURLFTPAUTH_DEFAULT, /* let libcurl decide */\n  CURLFTPAUTH_SSL,     /* use \"AUTH SSL\" */\n  CURLFTPAUTH_TLS,     /* use \"AUTH TLS\" */\n  CURLFTPAUTH_LAST /* not an option, never use */\n} curl_ftpauth;\n\n/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */\ntypedef enum {\n  CURLFTP_CREATE_DIR_NONE,  /* do NOT create missing dirs! */\n  CURLFTP_CREATE_DIR,       /* (FTP/SFTP) if CWD fails, try MKD and then CWD\n                               again if MKD succeeded, for SFTP this does\n                               similar magic */\n  CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD\n                               again even if MKD failed! */\n  CURLFTP_CREATE_DIR_LAST   /* not an option, never use */\n} curl_ftpcreatedir;\n\n/* parameter for the CURLOPT_FTP_FILEMETHOD option */\ntypedef enum {\n  CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */\n  CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */\n  CURLFTPMETHOD_NOCWD,     /* no CWD at all */\n  CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */\n  CURLFTPMETHOD_LAST       /* not an option, never use */\n} curl_ftpmethod;\n\n/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */\n#define CURLPROTO_HTTP   (1<<0)\n#define CURLPROTO_HTTPS  (1<<1)\n#define CURLPROTO_FTP    (1<<2)\n#define CURLPROTO_FTPS   (1<<3)\n#define CURLPROTO_SCP    (1<<4)\n#define CURLPROTO_SFTP   (1<<5)\n#define CURLPROTO_TELNET (1<<6)\n#define CURLPROTO_LDAP   (1<<7)\n#define CURLPROTO_LDAPS  (1<<8)\n#define CURLPROTO_DICT   (1<<9)\n#define CURLPROTO_FILE   (1<<10)\n#define CURLPROTO_TFTP   (1<<11)\n#define CURLPROTO_IMAP   (1<<12)\n#define CURLPROTO_IMAPS  (1<<13)\n#define CURLPROTO_POP3   (1<<14)\n#define CURLPROTO_POP3S  (1<<15)\n#define CURLPROTO_SMTP   (1<<16)\n#define CURLPROTO_SMTPS  (1<<17)\n#define CURLPROTO_RTSP   (1<<18)\n#define CURLPROTO_RTMP   (1<<19)\n#define CURLPROTO_RTMPT  (1<<20)\n#define CURLPROTO_RTMPE  (1<<21)\n#define CURLPROTO_RTMPTE (1<<22)\n#define CURLPROTO_RTMPS  (1<<23)\n#define CURLPROTO_RTMPTS (1<<24)\n#define CURLPROTO_GOPHER (1<<25)\n#define CURLPROTO_ALL    (~0) /* enable everything */\n\n/* long may be 32 or 64 bits, but we should never depend on anything else\n   but 32 */\n#define CURLOPTTYPE_LONG          0\n#define CURLOPTTYPE_OBJECTPOINT   10000\n#define CURLOPTTYPE_FUNCTIONPOINT 20000\n#define CURLOPTTYPE_OFF_T         30000\n\n/* name is uppercase CURLOPT_<name>,\n   type is one of the defined CURLOPTTYPE_<type>\n   number is unique identifier */\n#ifdef CINIT\n#undef CINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLOPT_/**/name = type + number\n#endif\n\n/*\n * This macro-mania below setups the CURLOPT_[what] enum, to be used with\n * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]\n * word.\n */\n\ntypedef enum {\n  /* This is the FILE * or void * the regular output should be written to. */\n  CINIT(FILE, OBJECTPOINT, 1),\n\n  /* The full URL to get/put */\n  CINIT(URL,  OBJECTPOINT, 2),\n\n  /* Port number to connect to, if other than default. */\n  CINIT(PORT, LONG, 3),\n\n  /* Name of proxy to use. */\n  CINIT(PROXY, OBJECTPOINT, 4),\n\n  /* \"name:password\" to use when fetching. */\n  CINIT(USERPWD, OBJECTPOINT, 5),\n\n  /* \"name:password\" to use with proxy. */\n  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),\n\n  /* Range to get, specified as an ASCII string. */\n  CINIT(RANGE, OBJECTPOINT, 7),\n\n  /* not used */\n\n  /* Specified file stream to upload from (use as input): */\n  CINIT(INFILE, OBJECTPOINT, 9),\n\n  /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE\n   * bytes big. If this is not used, error messages go to stderr instead: */\n  CINIT(ERRORBUFFER, OBJECTPOINT, 10),\n\n  /* Function that will be called to store the output (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),\n\n  /* Function that will be called to read the input (instead of fread). The\n   * parameters will use fread() syntax, make sure to follow them. */\n  CINIT(READFUNCTION, FUNCTIONPOINT, 12),\n\n  /* Time-out the read operation after this amount of seconds */\n  CINIT(TIMEOUT, LONG, 13),\n\n  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about\n   * how large the file being sent really is. That allows better error\n   * checking and better verifies that the upload was successful. -1 means\n   * unknown size.\n   *\n   * For large file support, there is also a _LARGE version of the key\n   * which takes an off_t type, allowing platforms with larger off_t\n   * sizes to handle larger files.  See below for INFILESIZE_LARGE.\n   */\n  CINIT(INFILESIZE, LONG, 14),\n\n  /* POST static input fields. */\n  CINIT(POSTFIELDS, OBJECTPOINT, 15),\n\n  /* Set the referrer page (needed by some CGIs) */\n  CINIT(REFERER, OBJECTPOINT, 16),\n\n  /* Set the FTP PORT string (interface name, named or numerical IP address)\n     Use i.e '-' to use default address. */\n  CINIT(FTPPORT, OBJECTPOINT, 17),\n\n  /* Set the User-Agent string (examined by some CGIs) */\n  CINIT(USERAGENT, OBJECTPOINT, 18),\n\n  /* If the download receives less than \"low speed limit\" bytes/second\n   * during \"low speed time\" seconds, the operations is aborted.\n   * You could i.e if you have a pretty high speed connection, abort if\n   * it is less than 2000 bytes/sec during 20 seconds.\n   */\n\n  /* Set the \"low speed limit\" */\n  CINIT(LOW_SPEED_LIMIT, LONG, 19),\n\n  /* Set the \"low speed time\" */\n  CINIT(LOW_SPEED_TIME, LONG, 20),\n\n  /* Set the continuation offset.\n   *\n   * Note there is also a _LARGE version of this key which uses\n   * off_t types, allowing for large file offsets on platforms which\n   * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.\n   */\n  CINIT(RESUME_FROM, LONG, 21),\n\n  /* Set cookie in request: */\n  CINIT(COOKIE, OBJECTPOINT, 22),\n\n  /* This points to a linked list of headers, struct curl_slist kind */\n  CINIT(HTTPHEADER, OBJECTPOINT, 23),\n\n  /* This points to a linked list of post entries, struct curl_httppost */\n  CINIT(HTTPPOST, OBJECTPOINT, 24),\n\n  /* name of the file keeping your private SSL-certificate */\n  CINIT(SSLCERT, OBJECTPOINT, 25),\n\n  /* password for the SSL or SSH private key */\n  CINIT(KEYPASSWD, OBJECTPOINT, 26),\n\n  /* send TYPE parameter? */\n  CINIT(CRLF, LONG, 27),\n\n  /* send linked-list of QUOTE commands */\n  CINIT(QUOTE, OBJECTPOINT, 28),\n\n  /* send FILE * or void * to store headers to, if you use a callback it\n     is simply passed to the callback unmodified */\n  CINIT(WRITEHEADER, OBJECTPOINT, 29),\n\n  /* point to a file to read the initial cookies from, also enables\n     \"cookie awareness\" */\n  CINIT(COOKIEFILE, OBJECTPOINT, 31),\n\n  /* What version to specifically try to use.\n     See CURL_SSLVERSION defines below. */\n  CINIT(SSLVERSION, LONG, 32),\n\n  /* What kind of HTTP time condition to use, see defines */\n  CINIT(TIMECONDITION, LONG, 33),\n\n  /* Time to use with the above condition. Specified in number of seconds\n     since 1 Jan 1970 */\n  CINIT(TIMEVALUE, LONG, 34),\n\n  /* 35 = OBSOLETE */\n\n  /* Custom request, for customizing the get command like\n     HTTP: DELETE, TRACE and others\n     FTP: to use a different list command\n     */\n  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),\n\n  /* HTTP request, for odd commands like DELETE, TRACE and others */\n  CINIT(STDERR, OBJECTPOINT, 37),\n\n  /* 38 is not used */\n\n  /* send linked-list of post-transfer QUOTE commands */\n  CINIT(POSTQUOTE, OBJECTPOINT, 39),\n\n  CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */\n\n  CINIT(VERBOSE, LONG, 41),      /* talk a lot */\n  CINIT(HEADER, LONG, 42),       /* throw the header out too */\n  CINIT(NOPROGRESS, LONG, 43),   /* shut off the progress meter */\n  CINIT(NOBODY, LONG, 44),       /* use HEAD to get http document */\n  CINIT(FAILONERROR, LONG, 45),  /* no output on http error codes >= 300 */\n  CINIT(UPLOAD, LONG, 46),       /* this is an upload */\n  CINIT(POST, LONG, 47),         /* HTTP POST method */\n  CINIT(DIRLISTONLY, LONG, 48),  /* bare names when listing directories */\n\n  CINIT(APPEND, LONG, 50),       /* Append instead of overwrite on upload! */\n\n  /* Specify whether to read the user+password from the .netrc or the URL.\n   * This must be one of the CURL_NETRC_* enums below. */\n  CINIT(NETRC, LONG, 51),\n\n  CINIT(FOLLOWLOCATION, LONG, 52),  /* use Location: Luke! */\n\n  CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */\n  CINIT(PUT, LONG, 54),          /* HTTP PUT */\n\n  /* 55 = OBSOLETE */\n\n  /* Function that will be called instead of the internal progress display\n   * function. This function should be defined as the curl_progress_callback\n   * prototype defines. */\n  CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),\n\n  /* Data passed to the progress callback */\n  CINIT(PROGRESSDATA, OBJECTPOINT, 57),\n\n  /* We want the referrer field set automatically when following locations */\n  CINIT(AUTOREFERER, LONG, 58),\n\n  /* Port of the proxy, can be set in the proxy string as well with:\n     \"[host]:[port]\" */\n  CINIT(PROXYPORT, LONG, 59),\n\n  /* size of the POST input data, if strlen() is not good to use */\n  CINIT(POSTFIELDSIZE, LONG, 60),\n\n  /* tunnel non-http operations through a HTTP proxy */\n  CINIT(HTTPPROXYTUNNEL, LONG, 61),\n\n  /* Set the interface string to use as outgoing network interface */\n  CINIT(INTERFACE, OBJECTPOINT, 62),\n\n  /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This\n   * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string\n   * is set but doesn't match one of these, 'private' will be used.  */\n  CINIT(KRBLEVEL, OBJECTPOINT, 63),\n\n  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */\n  CINIT(SSL_VERIFYPEER, LONG, 64),\n\n  /* The CApath or CAfile used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAINFO, OBJECTPOINT, 65),\n\n  /* 66 = OBSOLETE */\n  /* 67 = OBSOLETE */\n\n  /* Maximum number of http redirects to follow */\n  CINIT(MAXREDIRS, LONG, 68),\n\n  /* Pass a long set to 1 to get the date of the requested document (if\n     possible)! Pass a zero to shut it off. */\n  CINIT(FILETIME, LONG, 69),\n\n  /* This points to a linked list of telnet options */\n  CINIT(TELNETOPTIONS, OBJECTPOINT, 70),\n\n  /* Max amount of cached alive connections */\n  CINIT(MAXCONNECTS, LONG, 71),\n\n  CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */\n\n  /* 73 = OBSOLETE */\n\n  /* Set to explicitly use a new connection for the upcoming transfer.\n     Do not use this unless you're absolutely sure of this, as it makes the\n     operation slower and is less friendly for the network. */\n  CINIT(FRESH_CONNECT, LONG, 74),\n\n  /* Set to explicitly forbid the upcoming transfer's connection to be re-used\n     when done. Do not use this unless you're absolutely sure of this, as it\n     makes the operation slower and is less friendly for the network. */\n  CINIT(FORBID_REUSE, LONG, 75),\n\n  /* Set to a file name that contains random data for libcurl to use to\n     seed the random engine when doing SSL connects. */\n  CINIT(RANDOM_FILE, OBJECTPOINT, 76),\n\n  /* Set to the Entropy Gathering Daemon socket pathname */\n  CINIT(EGDSOCKET, OBJECTPOINT, 77),\n\n  /* Time-out connect operations after this amount of seconds, if connects\n     are OK within this time, then fine... This only aborts the connect\n     phase. [Only works on unix-style/SIGALRM operating systems] */\n  CINIT(CONNECTTIMEOUT, LONG, 78),\n\n  /* Function that will be called to store headers (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),\n\n  /* Set this to force the HTTP request to get back to GET. Only really usable\n     if POST, PUT or a custom request have been used first.\n   */\n  CINIT(HTTPGET, LONG, 80),\n\n  /* Set if we should verify the Common name from the peer certificate in ssl\n   * handshake, set 1 to check existence, 2 to ensure that it matches the\n   * provided hostname. */\n  CINIT(SSL_VERIFYHOST, LONG, 81),\n\n  /* Specify which file name to write all known cookies in after completed\n     operation. Set file name to \"-\" (dash) to make it go to stdout. */\n  CINIT(COOKIEJAR, OBJECTPOINT, 82),\n\n  /* Specify which SSL ciphers to use */\n  CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),\n\n  /* Specify which HTTP version to use! This must be set to one of the\n     CURL_HTTP_VERSION* enums set below. */\n  CINIT(HTTP_VERSION, LONG, 84),\n\n  /* Specifically switch on or off the FTP engine's use of the EPSV command. By\n     default, that one will always be attempted before the more traditional\n     PASV command. */\n  CINIT(FTP_USE_EPSV, LONG, 85),\n\n  /* type of the file keeping your SSL-certificate (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLCERTTYPE, OBJECTPOINT, 86),\n\n  /* name of the file keeping your private SSL-key */\n  CINIT(SSLKEY, OBJECTPOINT, 87),\n\n  /* type of the file keeping your private SSL-key (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLKEYTYPE, OBJECTPOINT, 88),\n\n  /* crypto engine for the SSL-sub system */\n  CINIT(SSLENGINE, OBJECTPOINT, 89),\n\n  /* set the crypto engine for the SSL-sub system as default\n     the param has no meaning...\n   */\n  CINIT(SSLENGINE_DEFAULT, LONG, 90),\n\n  /* Non-zero value means to use the global dns cache */\n  CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */\n\n  /* DNS cache timeout */\n  CINIT(DNS_CACHE_TIMEOUT, LONG, 92),\n\n  /* send linked-list of pre-transfer QUOTE commands */\n  CINIT(PREQUOTE, OBJECTPOINT, 93),\n\n  /* set the debug function */\n  CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),\n\n  /* set the data for the debug function */\n  CINIT(DEBUGDATA, OBJECTPOINT, 95),\n\n  /* mark this as start of a cookie session */\n  CINIT(COOKIESESSION, LONG, 96),\n\n  /* The CApath directory used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAPATH, OBJECTPOINT, 97),\n\n  /* Instruct libcurl to use a smaller receive buffer */\n  CINIT(BUFFERSIZE, LONG, 98),\n\n  /* Instruct libcurl to not use any signal/alarm handlers, even when using\n     timeouts. This option is useful for multi-threaded applications.\n     See libcurl-the-guide for more background information. */\n  CINIT(NOSIGNAL, LONG, 99),\n\n  /* Provide a CURLShare for mutexing non-ts data */\n  CINIT(SHARE, OBJECTPOINT, 100),\n\n  /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),\n     CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */\n  CINIT(PROXYTYPE, LONG, 101),\n\n  /* Set the Accept-Encoding string. Use this to tell a server you would like\n     the response to be compressed. Before 7.21.6, this was known as\n     CURLOPT_ENCODING */\n  CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),\n\n  /* Set pointer to private data */\n  CINIT(PRIVATE, OBJECTPOINT, 103),\n\n  /* Set aliases for HTTP 200 in the HTTP Response header */\n  CINIT(HTTP200ALIASES, OBJECTPOINT, 104),\n\n  /* Continue to send authentication (user+password) when following locations,\n     even when hostname changed. This can potentially send off the name\n     and password to whatever host the server decides. */\n  CINIT(UNRESTRICTED_AUTH, LONG, 105),\n\n  /* Specifically switch on or off the FTP engine's use of the EPRT command (\n     it also disables the LPRT attempt). By default, those ones will always be\n     attempted before the good old traditional PORT command. */\n  CINIT(FTP_USE_EPRT, LONG, 106),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_USERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(HTTPAUTH, LONG, 107),\n\n  /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx\n     in second argument. The function must be matching the\n     curl_ssl_ctx_callback proto. */\n  CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),\n\n  /* Set the userdata for the ssl context callback function's third\n     argument */\n  CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),\n\n  /* FTP Option that causes missing dirs to be created on the remote server.\n     In 7.19.4 we introduced the convenience enums for this option using the\n     CURLFTP_CREATE_DIR prefix.\n  */\n  CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(PROXYAUTH, LONG, 111),\n\n  /* FTP option that changes the timeout, in seconds, associated with\n     getting a response.  This is different from transfer timeout time and\n     essentially places a demand on the FTP server to acknowledge commands\n     in a timely manner. */\n  CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),\n#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT\n\n  /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to\n     tell libcurl to resolve names to those IP versions only. This only has\n     affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */\n  CINIT(IPRESOLVE, LONG, 113),\n\n  /* Set this option to limit the size of a file that will be downloaded from\n     an HTTP or FTP server.\n\n     Note there is also _LARGE version which adds large file support for\n     platforms which have larger off_t sizes.  See MAXFILESIZE_LARGE below. */\n  CINIT(MAXFILESIZE, LONG, 114),\n\n  /* See the comment for INFILESIZE above, but in short, specifies\n   * the size of the file being uploaded.  -1 means unknown.\n   */\n  CINIT(INFILESIZE_LARGE, OFF_T, 115),\n\n  /* Sets the continuation offset.  There is also a LONG version of this;\n   * look above for RESUME_FROM.\n   */\n  CINIT(RESUME_FROM_LARGE, OFF_T, 116),\n\n  /* Sets the maximum size of data that will be downloaded from\n   * an HTTP or FTP server.  See MAXFILESIZE above for the LONG version.\n   */\n  CINIT(MAXFILESIZE_LARGE, OFF_T, 117),\n\n  /* Set this option to the file name of your .netrc file you want libcurl\n     to parse (using the CURLOPT_NETRC option). If not set, libcurl will do\n     a poor attempt to find the user's home directory and check for a .netrc\n     file in there. */\n  CINIT(NETRC_FILE, OBJECTPOINT, 118),\n\n  /* Enable SSL/TLS for FTP, pick one of:\n     CURLFTPSSL_TRY     - try using SSL, proceed anyway otherwise\n     CURLFTPSSL_CONTROL - SSL for the control connection or fail\n     CURLFTPSSL_ALL     - SSL for all communication or fail\n  */\n  CINIT(USE_SSL, LONG, 119),\n\n  /* The _LARGE version of the standard POSTFIELDSIZE option */\n  CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),\n\n  /* Enable/disable the TCP Nagle algorithm */\n  CINIT(TCP_NODELAY, LONG, 121),\n\n  /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 123 OBSOLETE. Gone in 7.16.0 */\n  /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 127 OBSOLETE. Gone in 7.16.0 */\n  /* 128 OBSOLETE. Gone in 7.16.0 */\n\n  /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option\n     can be used to change libcurl's default action which is to first try\n     \"AUTH SSL\" and then \"AUTH TLS\" in this order, and proceed when a OK\n     response has been received.\n\n     Available parameters are:\n     CURLFTPAUTH_DEFAULT - let libcurl decide\n     CURLFTPAUTH_SSL     - try \"AUTH SSL\" first, then TLS\n     CURLFTPAUTH_TLS     - try \"AUTH TLS\" first, then SSL\n  */\n  CINIT(FTPSSLAUTH, LONG, 129),\n\n  CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),\n  CINIT(IOCTLDATA, OBJECTPOINT, 131),\n\n  /* 132 OBSOLETE. Gone in 7.16.0 */\n  /* 133 OBSOLETE. Gone in 7.16.0 */\n\n  /* zero terminated string for pass on to the FTP server when asked for\n     \"account\" info */\n  CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),\n\n  /* feed cookies into cookie engine */\n  CINIT(COOKIELIST, OBJECTPOINT, 135),\n\n  /* ignore Content-Length */\n  CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),\n\n  /* Set to non-zero to skip the IP address received in a 227 PASV FTP server\n     response. Typically used for FTP-SSL purposes but is not restricted to\n     that. libcurl will then instead use the same IP address it used for the\n     control connection. */\n  CINIT(FTP_SKIP_PASV_IP, LONG, 137),\n\n  /* Select \"file method\" to use when doing FTP, see the curl_ftpmethod\n     above. */\n  CINIT(FTP_FILEMETHOD, LONG, 138),\n\n  /* Local port number to bind the socket to */\n  CINIT(LOCALPORT, LONG, 139),\n\n  /* Number of ports to try, including the first one set with LOCALPORT.\n     Thus, setting it to 1 will make no additional attempts but the first.\n  */\n  CINIT(LOCALPORTRANGE, LONG, 140),\n\n  /* no transfer, set up connection and let application use the socket by\n     extracting it with CURLINFO_LASTSOCKET */\n  CINIT(CONNECT_ONLY, LONG, 141),\n\n  /* Function that will be called to convert from the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),\n\n  /* Function that will be called to convert to the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),\n\n  /* Function that will be called to convert from UTF8\n     (instead of using the iconv calls in libcurl)\n     Note that this is used only for SSL certificate processing */\n  CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),\n\n  /* if the connection proceeds too quickly then need to slow it down */\n  /* limit-rate: maximum number of bytes per second to send or receive */\n  CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),\n  CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),\n\n  /* Pointer to command string to send if USER/PASS fails. */\n  CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),\n\n  /* callback function for setting socket options */\n  CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),\n  CINIT(SOCKOPTDATA, OBJECTPOINT, 149),\n\n  /* set to 0 to disable session ID re-use for this transfer, default is\n     enabled (== 1) */\n  CINIT(SSL_SESSIONID_CACHE, LONG, 150),\n\n  /* allowed SSH authentication methods */\n  CINIT(SSH_AUTH_TYPES, LONG, 151),\n\n  /* Used by scp/sftp to do public/private key authentication */\n  CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),\n  CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),\n\n  /* Send CCC (Clear Command Channel) after authentication */\n  CINIT(FTP_SSL_CCC, LONG, 154),\n\n  /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */\n  CINIT(TIMEOUT_MS, LONG, 155),\n  CINIT(CONNECTTIMEOUT_MS, LONG, 156),\n\n  /* set to zero to disable the libcurl's decoding and thus pass the raw body\n     data to the application even when it is encoded/compressed */\n  CINIT(HTTP_TRANSFER_DECODING, LONG, 157),\n  CINIT(HTTP_CONTENT_DECODING, LONG, 158),\n\n  /* Permission used when creating new files and directories on the remote\n     server for protocols that support it, SFTP/SCP/FILE */\n  CINIT(NEW_FILE_PERMS, LONG, 159),\n  CINIT(NEW_DIRECTORY_PERMS, LONG, 160),\n\n  /* Set the behaviour of POST when redirecting. Values must be set to one\n     of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */\n  CINIT(POSTREDIR, LONG, 161),\n\n  /* used by scp/sftp to verify the host's public key */\n  CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),\n\n  /* Callback function for opening socket (instead of socket(2)). Optionally,\n     callback is able change the address or refuse to connect returning\n     CURL_SOCKET_BAD.  The callback should have type\n     curl_opensocket_callback */\n  CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),\n  CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),\n\n  /* POST volatile input fields. */\n  CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),\n\n  /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */\n  CINIT(PROXY_TRANSFER_MODE, LONG, 166),\n\n  /* Callback function for seeking in the input stream */\n  CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),\n  CINIT(SEEKDATA, OBJECTPOINT, 168),\n\n  /* CRL file */\n  CINIT(CRLFILE, OBJECTPOINT, 169),\n\n  /* Issuer certificate */\n  CINIT(ISSUERCERT, OBJECTPOINT, 170),\n\n  /* (IPv6) Address scope */\n  CINIT(ADDRESS_SCOPE, LONG, 171),\n\n  /* Collect certificate chain info and allow it to get retrievable with\n     CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only\n     working with OpenSSL-powered builds. */\n  CINIT(CERTINFO, LONG, 172),\n\n  /* \"name\" and \"pwd\" to use when fetching. */\n  CINIT(USERNAME, OBJECTPOINT, 173),\n  CINIT(PASSWORD, OBJECTPOINT, 174),\n\n    /* \"name\" and \"pwd\" to use with Proxy when fetching. */\n  CINIT(PROXYUSERNAME, OBJECTPOINT, 175),\n  CINIT(PROXYPASSWORD, OBJECTPOINT, 176),\n\n  /* Comma separated list of hostnames defining no-proxy zones. These should\n     match both hostnames directly, and hostnames within a domain. For\n     example, local.com will match local.com and www.local.com, but NOT\n     notlocal.com or www.notlocal.com. For compatibility with other\n     implementations of this, .local.com will be considered to be the same as\n     local.com. A single * is the only valid wildcard, and effectively\n     disables the use of proxy. */\n  CINIT(NOPROXY, OBJECTPOINT, 177),\n\n  /* block size for TFTP transfers */\n  CINIT(TFTP_BLKSIZE, LONG, 178),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),\n\n  /* set the bitmask for the protocols that are allowed to be used for the\n     transfer, which thus helps the app which takes URLs from users or other\n     external inputs and want to restrict what protocol(s) to deal\n     with. Defaults to CURLPROTO_ALL. */\n  CINIT(PROTOCOLS, LONG, 181),\n\n  /* set the bitmask for the protocols that libcurl is allowed to follow to,\n     as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs\n     to be set in both bitmasks to be allowed to get redirected to. Defaults\n     to all protocols except FILE and SCP. */\n  CINIT(REDIR_PROTOCOLS, LONG, 182),\n\n  /* set the SSH knownhost file name to use */\n  CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),\n\n  /* set the SSH host key callback, must point to a curl_sshkeycallback\n     function */\n  CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),\n\n  /* set the SSH host key callback custom pointer */\n  CINIT(SSH_KEYDATA, OBJECTPOINT, 185),\n\n  /* set the SMTP mail originator */\n  CINIT(MAIL_FROM, OBJECTPOINT, 186),\n\n  /* set the SMTP mail receiver(s) */\n  CINIT(MAIL_RCPT, OBJECTPOINT, 187),\n\n  /* FTP: send PRET before PASV */\n  CINIT(FTP_USE_PRET, LONG, 188),\n\n  /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */\n  CINIT(RTSP_REQUEST, LONG, 189),\n\n  /* The RTSP session identifier */\n  CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190),\n\n  /* The RTSP stream URI */\n  CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191),\n\n  /* The Transport: header to use in RTSP requests */\n  CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192),\n\n  /* Manually initialize the client RTSP CSeq for this handle */\n  CINIT(RTSP_CLIENT_CSEQ, LONG, 193),\n\n  /* Manually initialize the server RTSP CSeq for this handle */\n  CINIT(RTSP_SERVER_CSEQ, LONG, 194),\n\n  /* The stream to pass to INTERLEAVEFUNCTION. */\n  CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),\n\n  /* Let the application define a custom write method for RTP data */\n  CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),\n\n  /* Turn on wildcard matching */\n  CINIT(WILDCARDMATCH, LONG, 197),\n\n  /* Directory matching callback called before downloading of an\n     individual file (chunk) started */\n  CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),\n\n  /* Directory matching callback called after the file (chunk)\n     was downloaded, or skipped */\n  CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),\n\n  /* Change match (fnmatch-like) callback for wildcard matching */\n  CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),\n\n  /* Let the application define custom chunk data pointer */\n  CINIT(CHUNK_DATA, OBJECTPOINT, 201),\n\n  /* FNMATCH_FUNCTION user pointer */\n  CINIT(FNMATCH_DATA, OBJECTPOINT, 202),\n\n  /* send linked-list of name:port:address sets */\n  CINIT(RESOLVE, OBJECTPOINT, 203),\n\n  /* Set a username for authenticated TLS */\n  CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204),\n\n  /* Set a password for authenticated TLS */\n  CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205),\n\n  /* Set authentication type for authenticated TLS */\n  CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),\n\n  /* Set to 1 to enable the \"TE:\" header in HTTP requests to ask for\n     compressed transfer-encoded responses. Set to 0 to disable the use of TE:\n     in outgoing requests. The current default is 0, but it might change in a\n     future libcurl release.\n\n     libcurl will ask for the compressed methods it knows of, and if that\n     isn't any, it will not ask for transfer-encoding at all even if this\n     option is set to 1.\n\n  */\n  CINIT(TRANSFER_ENCODING, LONG, 207),\n\n  /* Callback function for closing socket (instead of close(2)). The callback\n     should have type curl_closesocket_callback */\n  CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),\n  CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),\n\n  /* allow GSSAPI credential delegation */\n  CINIT(GSSAPI_DELEGATION, LONG, 210),\n\n  /* Set the name servers to use for DNS resolution */\n  CINIT(DNS_SERVERS, OBJECTPOINT, 211),\n\n  /* Time-out accept operations (currently for FTP only) after this amount\n     of miliseconds. */\n  CINIT(ACCEPTTIMEOUT_MS, LONG, 212),\n\n  /* Set TCP keepalive */\n  CINIT(TCP_KEEPALIVE, LONG, 213),\n\n  /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */\n  CINIT(TCP_KEEPIDLE, LONG, 214),\n  CINIT(TCP_KEEPINTVL, LONG, 215),\n\n  /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */\n  CINIT(SSL_OPTIONS, LONG, 216),\n\n  /* set the SMTP auth originator */\n  CINIT(MAIL_AUTH, OBJECTPOINT, 217),\n\n  CURLOPT_LASTENTRY /* the last unused */\n} CURLoption;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2011 */\n\n/* This was added in version 7.19.1 */\n#define CURLOPT_POST301 CURLOPT_POSTREDIR\n\n/* These are scheduled to disappear by 2009 */\n\n/* The following were added in 7.17.0 */\n#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_FTPAPPEND CURLOPT_APPEND\n#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY\n#define CURLOPT_FTP_SSL CURLOPT_USE_SSL\n\n/* The following were added earlier */\n\n#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL\n\n#else\n/* This is set if CURL_NO_OLDIES is defined at compile-time */\n#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */\n#endif\n\n\n  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host\n     name resolves addresses using more than one IP protocol version, this\n     option might be handy to force libcurl to use a specific IP version. */\n#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP\n                                     versions that your system allows */\n#define CURL_IPRESOLVE_V4       1 /* resolve to ipv4 addresses */\n#define CURL_IPRESOLVE_V6       2 /* resolve to ipv6 addresses */\n\n  /* three convenient \"aliases\" that follow the name scheme better */\n#define CURLOPT_WRITEDATA CURLOPT_FILE\n#define CURLOPT_READDATA  CURLOPT_INFILE\n#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER\n#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER\n\n  /* These enums are for use with the CURLOPT_HTTP_VERSION option. */\nenum {\n  CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd\n                             like the library to choose the best possible\n                             for us! */\n  CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */\n  CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */\n\n  CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */\n};\n\n/*\n * Public API enums for RTSP requests\n */\nenum {\n    CURL_RTSPREQ_NONE, /* first in list */\n    CURL_RTSPREQ_OPTIONS,\n    CURL_RTSPREQ_DESCRIBE,\n    CURL_RTSPREQ_ANNOUNCE,\n    CURL_RTSPREQ_SETUP,\n    CURL_RTSPREQ_PLAY,\n    CURL_RTSPREQ_PAUSE,\n    CURL_RTSPREQ_TEARDOWN,\n    CURL_RTSPREQ_GET_PARAMETER,\n    CURL_RTSPREQ_SET_PARAMETER,\n    CURL_RTSPREQ_RECORD,\n    CURL_RTSPREQ_RECEIVE,\n    CURL_RTSPREQ_LAST /* last in list */\n};\n\n  /* These enums are for use with the CURLOPT_NETRC option. */\nenum CURL_NETRC_OPTION {\n  CURL_NETRC_IGNORED,     /* The .netrc will never be read.\n                           * This is the default. */\n  CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred\n                           * to one in the .netrc. */\n  CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.\n                           * Unless one is set programmatically, the .netrc\n                           * will be queried. */\n  CURL_NETRC_LAST\n};\n\nenum {\n  CURL_SSLVERSION_DEFAULT,\n  CURL_SSLVERSION_TLSv1,\n  CURL_SSLVERSION_SSLv2,\n  CURL_SSLVERSION_SSLv3,\n\n  CURL_SSLVERSION_LAST /* never use, keep last */\n};\n\nenum CURL_TLSAUTH {\n  CURL_TLSAUTH_NONE,\n  CURL_TLSAUTH_SRP,\n  CURL_TLSAUTH_LAST /* never use, keep last */\n};\n\n/* symbols to use with CURLOPT_POSTREDIR.\n   CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303\n   can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302\n   | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */\n\n#define CURL_REDIR_GET_ALL  0\n#define CURL_REDIR_POST_301 1\n#define CURL_REDIR_POST_302 2\n#define CURL_REDIR_POST_303 4\n#define CURL_REDIR_POST_ALL \\\n    (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)\n\ntypedef enum {\n  CURL_TIMECOND_NONE,\n\n  CURL_TIMECOND_IFMODSINCE,\n  CURL_TIMECOND_IFUNMODSINCE,\n  CURL_TIMECOND_LASTMOD,\n\n  CURL_TIMECOND_LAST\n} curl_TimeCond;\n\n\n/* curl_strequal() and curl_strnequal() are subject for removal in a future\n   libcurl, see lib/README.curlx for details */\nCURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);\nCURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);\n\n/* name is uppercase CURLFORM_<name> */\n#ifdef CFINIT\n#undef CFINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CFINIT(name) CURLFORM_ ## name\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define CFINIT(name) CURLFORM_/**/name\n#endif\n\ntypedef enum {\n  CFINIT(NOTHING),        /********* the first one is unused ************/\n\n  /*  */\n  CFINIT(COPYNAME),\n  CFINIT(PTRNAME),\n  CFINIT(NAMELENGTH),\n  CFINIT(COPYCONTENTS),\n  CFINIT(PTRCONTENTS),\n  CFINIT(CONTENTSLENGTH),\n  CFINIT(FILECONTENT),\n  CFINIT(ARRAY),\n  CFINIT(OBSOLETE),\n  CFINIT(FILE),\n\n  CFINIT(BUFFER),\n  CFINIT(BUFFERPTR),\n  CFINIT(BUFFERLENGTH),\n\n  CFINIT(CONTENTTYPE),\n  CFINIT(CONTENTHEADER),\n  CFINIT(FILENAME),\n  CFINIT(END),\n  CFINIT(OBSOLETE2),\n\n  CFINIT(STREAM),\n\n  CURLFORM_LASTENTRY /* the last unused */\n} CURLformoption;\n\n#undef CFINIT /* done */\n\n/* structure to be used as parameter for CURLFORM_ARRAY */\nstruct curl_forms {\n  CURLformoption option;\n  const char     *value;\n};\n\n/* use this for multipart formpost building */\n/* Returns code for curl_formadd()\n *\n * Returns:\n * CURL_FORMADD_OK             on success\n * CURL_FORMADD_MEMORY         if the FormInfo allocation fails\n * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form\n * CURL_FORMADD_NULL           if a null pointer was given for a char\n * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed\n * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used\n * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)\n * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated\n * CURL_FORMADD_MEMORY         if some allocation for string copying failed.\n * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array\n *\n ***************************************************************************/\ntypedef enum {\n  CURL_FORMADD_OK, /* first, no error */\n\n  CURL_FORMADD_MEMORY,\n  CURL_FORMADD_OPTION_TWICE,\n  CURL_FORMADD_NULL,\n  CURL_FORMADD_UNKNOWN_OPTION,\n  CURL_FORMADD_INCOMPLETE,\n  CURL_FORMADD_ILLEGAL_ARRAY,\n  CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */\n\n  CURL_FORMADD_LAST /* last */\n} CURLFORMcode;\n\n/*\n * NAME curl_formadd()\n *\n * DESCRIPTION\n *\n * Pretty advanced function for building multi-part formposts. Each invoke\n * adds one part that together construct a full post. Then use\n * CURLOPT_HTTPPOST to send it off to libcurl.\n */\nCURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,\n                                      struct curl_httppost **last_post,\n                                      ...);\n\n/*\n * callback function for curl_formget()\n * The void *arg pointer will be the one passed as second argument to\n *   curl_formget().\n * The character buffer passed to it must not be freed.\n * Should return the buffer length passed to it as the argument \"len\" on\n *   success.\n */\ntypedef size_t (*curl_formget_callback)(void *arg, const char *buf,\n                                        size_t len);\n\n/*\n * NAME curl_formget()\n *\n * DESCRIPTION\n *\n * Serialize a curl_httppost struct built with curl_formadd().\n * Accepts a void pointer as second argument which will be passed to\n * the curl_formget_callback function.\n * Returns 0 on success.\n */\nCURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,\n                             curl_formget_callback append);\n/*\n * NAME curl_formfree()\n *\n * DESCRIPTION\n *\n * Free a multipart formpost previously built with curl_formadd().\n */\nCURL_EXTERN void curl_formfree(struct curl_httppost *form);\n\n/*\n * NAME curl_getenv()\n *\n * DESCRIPTION\n *\n * Returns a malloc()'ed string that MUST be curl_free()ed after usage is\n * complete. DEPRECATED - see lib/README.curlx\n */\nCURL_EXTERN char *curl_getenv(const char *variable);\n\n/*\n * NAME curl_version()\n *\n * DESCRIPTION\n *\n * Returns a static ascii string of the libcurl version.\n */\nCURL_EXTERN char *curl_version(void);\n\n/*\n * NAME curl_easy_escape()\n *\n * DESCRIPTION\n *\n * Escapes URL strings (converts all letters consider illegal in URLs to their\n * %XX versions). This function returns a new allocated string or NULL if an\n * error occurred.\n */\nCURL_EXTERN char *curl_easy_escape(CURL *handle,\n                                   const char *string,\n                                   int length);\n\n/* the previous version: */\nCURL_EXTERN char *curl_escape(const char *string,\n                              int length);\n\n\n/*\n * NAME curl_easy_unescape()\n *\n * DESCRIPTION\n *\n * Unescapes URL encoding in strings (converts all %XX codes to their 8bit\n * versions). This function returns a new allocated string or NULL if an error\n * occurred.\n * Conversion Note: On non-ASCII platforms the ASCII %XX codes are\n * converted into the host encoding.\n */\nCURL_EXTERN char *curl_easy_unescape(CURL *handle,\n                                     const char *string,\n                                     int length,\n                                     int *outlength);\n\n/* the previous version */\nCURL_EXTERN char *curl_unescape(const char *string,\n                                int length);\n\n/*\n * NAME curl_free()\n *\n * DESCRIPTION\n *\n * Provided for de-allocation in the same translation unit that did the\n * allocation. Added in libcurl 7.10\n */\nCURL_EXTERN void curl_free(void *p);\n\n/*\n * NAME curl_global_init()\n *\n * DESCRIPTION\n *\n * curl_global_init() should be invoked exactly once for each application that\n * uses libcurl and before any call of other libcurl functions.\n *\n * This function is not thread-safe!\n */\nCURL_EXTERN CURLcode curl_global_init(long flags);\n\n/*\n * NAME curl_global_init_mem()\n *\n * DESCRIPTION\n *\n * curl_global_init() or curl_global_init_mem() should be invoked exactly once\n * for each application that uses libcurl.  This function can be used to\n * initialize libcurl and set user defined memory management callback\n * functions.  Users can implement memory management routines to check for\n * memory leaks, check for mis-use of the curl library etc.  User registered\n * callback routines with be invoked by this library instead of the system\n * memory management routines like malloc, free etc.\n */\nCURL_EXTERN CURLcode curl_global_init_mem(long flags,\n                                          curl_malloc_callback m,\n                                          curl_free_callback f,\n                                          curl_realloc_callback r,\n                                          curl_strdup_callback s,\n                                          curl_calloc_callback c);\n\n/*\n * NAME curl_global_cleanup()\n *\n * DESCRIPTION\n *\n * curl_global_cleanup() should be invoked exactly once for each application\n * that uses libcurl\n */\nCURL_EXTERN void curl_global_cleanup(void);\n\n/* linked-list structure for the CURLOPT_QUOTE option (and other) */\nstruct curl_slist {\n  char *data;\n  struct curl_slist *next;\n};\n\n/*\n * NAME curl_slist_append()\n *\n * DESCRIPTION\n *\n * Appends a string to a linked list. If no list exists, it will be created\n * first. Returns the new list, after appending.\n */\nCURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,\n                                                 const char *);\n\n/*\n * NAME curl_slist_free_all()\n *\n * DESCRIPTION\n *\n * free a previously built curl_slist.\n */\nCURL_EXTERN void curl_slist_free_all(struct curl_slist *);\n\n/*\n * NAME curl_getdate()\n *\n * DESCRIPTION\n *\n * Returns the time, in seconds since 1 Jan 1970 of the time string given in\n * the first argument. The time argument in the second parameter is unused\n * and should be set to NULL.\n */\nCURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);\n\n/* info about the certificate chain, only for OpenSSL builds. Asked\n   for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */\nstruct curl_certinfo {\n  int num_of_certs;             /* number of certificates with information */\n  struct curl_slist **certinfo; /* for each index in this array, there's a\n                                   linked list with textual information in the\n                                   format \"name: value\" */\n};\n\n#define CURLINFO_STRING   0x100000\n#define CURLINFO_LONG     0x200000\n#define CURLINFO_DOUBLE   0x300000\n#define CURLINFO_SLIST    0x400000\n#define CURLINFO_MASK     0x0fffff\n#define CURLINFO_TYPEMASK 0xf00000\n\ntypedef enum {\n  CURLINFO_NONE, /* first, never use this */\n  CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,\n  CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,\n  CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,\n  CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,\n  CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,\n  CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,\n  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,\n  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,\n  CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,\n  CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,\n  CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,\n  CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,\n  CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,\n  CURLINFO_FILETIME         = CURLINFO_LONG   + 14,\n  CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,\n  CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,\n  CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,\n  CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,\n  CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,\n  CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,\n  CURLINFO_PRIVATE          = CURLINFO_STRING + 21,\n  CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,\n  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,\n  CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,\n  CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,\n  CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,\n  CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,\n  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,\n  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,\n  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,\n  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,\n  CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,\n  CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,\n  CURLINFO_CERTINFO         = CURLINFO_SLIST  + 34,\n  CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,\n  CURLINFO_RTSP_SESSION_ID  = CURLINFO_STRING + 36,\n  CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG   + 37,\n  CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG   + 38,\n  CURLINFO_RTSP_CSEQ_RECV   = CURLINFO_LONG   + 39,\n  CURLINFO_PRIMARY_PORT     = CURLINFO_LONG   + 40,\n  CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,\n  CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,\n  /* Fill in new entries below here! */\n\n  CURLINFO_LASTONE          = 42\n} CURLINFO;\n\n/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as\n   CURLINFO_HTTP_CODE */\n#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE\n\ntypedef enum {\n  CURLCLOSEPOLICY_NONE, /* first, never use this */\n\n  CURLCLOSEPOLICY_OLDEST,\n  CURLCLOSEPOLICY_LEAST_RECENTLY_USED,\n  CURLCLOSEPOLICY_LEAST_TRAFFIC,\n  CURLCLOSEPOLICY_SLOWEST,\n  CURLCLOSEPOLICY_CALLBACK,\n\n  CURLCLOSEPOLICY_LAST /* last, never use this */\n} curl_closepolicy;\n\n#define CURL_GLOBAL_SSL (1<<0)\n#define CURL_GLOBAL_WIN32 (1<<1)\n#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)\n#define CURL_GLOBAL_NOTHING 0\n#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL\n\n\n/*****************************************************************************\n * Setup defines, protos etc for the sharing stuff.\n */\n\n/* Different data locks for a single share */\ntypedef enum {\n  CURL_LOCK_DATA_NONE = 0,\n  /*  CURL_LOCK_DATA_SHARE is used internally to say that\n   *  the locking is just made to change the internal state of the share\n   *  itself.\n   */\n  CURL_LOCK_DATA_SHARE,\n  CURL_LOCK_DATA_COOKIE,\n  CURL_LOCK_DATA_DNS,\n  CURL_LOCK_DATA_SSL_SESSION,\n  CURL_LOCK_DATA_CONNECT,\n  CURL_LOCK_DATA_LAST\n} curl_lock_data;\n\n/* Different lock access types */\ntypedef enum {\n  CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */\n  CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */\n  CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */\n  CURL_LOCK_ACCESS_LAST        /* never use */\n} curl_lock_access;\n\ntypedef void (*curl_lock_function)(CURL *handle,\n                                   curl_lock_data data,\n                                   curl_lock_access locktype,\n                                   void *userptr);\ntypedef void (*curl_unlock_function)(CURL *handle,\n                                     curl_lock_data data,\n                                     void *userptr);\n\ntypedef void CURLSH;\n\ntypedef enum {\n  CURLSHE_OK,  /* all is fine */\n  CURLSHE_BAD_OPTION, /* 1 */\n  CURLSHE_IN_USE,     /* 2 */\n  CURLSHE_INVALID,    /* 3 */\n  CURLSHE_NOMEM,      /* 4 out of memory */\n  CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */\n  CURLSHE_LAST        /* never use */\n} CURLSHcode;\n\ntypedef enum {\n  CURLSHOPT_NONE,  /* don't use */\n  CURLSHOPT_SHARE,   /* specify a data type to share */\n  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */\n  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */\n  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */\n  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock\n                           callback functions */\n  CURLSHOPT_LAST  /* never use */\n} CURLSHoption;\n\nCURL_EXTERN CURLSH *curl_share_init(void);\nCURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);\nCURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);\n\n/****************************************************************************\n * Structures for querying information about the curl library at runtime.\n */\n\ntypedef enum {\n  CURLVERSION_FIRST,\n  CURLVERSION_SECOND,\n  CURLVERSION_THIRD,\n  CURLVERSION_FOURTH,\n  CURLVERSION_LAST /* never actually use this */\n} CURLversion;\n\n/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by\n   basically all programs ever that want to get version information. It is\n   meant to be a built-in version number for what kind of struct the caller\n   expects. If the struct ever changes, we redefine the NOW to another enum\n   from above. */\n#define CURLVERSION_NOW CURLVERSION_FOURTH\n\ntypedef struct {\n  CURLversion age;          /* age of the returned struct */\n  const char *version;      /* LIBCURL_VERSION */\n  unsigned int version_num; /* LIBCURL_VERSION_NUM */\n  const char *host;         /* OS/host/cpu/machine when configured */\n  int features;             /* bitmask, see defines below */\n  const char *ssl_version;  /* human readable string */\n  long ssl_version_num;     /* not used anymore, always 0 */\n  const char *libz_version; /* human readable string */\n  /* protocols is terminated by an entry with a NULL protoname */\n  const char * const *protocols;\n\n  /* The fields below this were added in CURLVERSION_SECOND */\n  const char *ares;\n  int ares_num;\n\n  /* This field was added in CURLVERSION_THIRD */\n  const char *libidn;\n\n  /* These field were added in CURLVERSION_FOURTH */\n\n  /* Same as '_libiconv_version' if built with HAVE_ICONV */\n  int iconv_ver_num;\n\n  const char *libssh_version; /* human readable string */\n\n} curl_version_info_data;\n\n#define CURL_VERSION_IPV6      (1<<0)  /* IPv6-enabled */\n#define CURL_VERSION_KERBEROS4 (1<<1)  /* kerberos auth is supported */\n#define CURL_VERSION_SSL       (1<<2)  /* SSL options are present */\n#define CURL_VERSION_LIBZ      (1<<3)  /* libz features are present */\n#define CURL_VERSION_NTLM      (1<<4)  /* NTLM auth is supported */\n#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */\n#define CURL_VERSION_DEBUG     (1<<6)  /* built with debug capabilities */\n#define CURL_VERSION_ASYNCHDNS (1<<7)  /* asynchronous dns resolves */\n#define CURL_VERSION_SPNEGO    (1<<8)  /* SPNEGO auth */\n#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */\n#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */\n#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */\n#define CURL_VERSION_CONV      (1<<12) /* character conversions supported */\n#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */\n#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */\n#define CURL_VERSION_NTLM_WB   (1<<15) /* NTLM delegating to winbind helper */\n\n /*\n * NAME curl_version_info()\n *\n * DESCRIPTION\n *\n * This function returns a pointer to a static copy of the version info\n * struct. See above.\n */\nCURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);\n\n/*\n * NAME curl_easy_strerror()\n *\n * DESCRIPTION\n *\n * The curl_easy_strerror function may be used to turn a CURLcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_easy_strerror(CURLcode);\n\n/*\n * NAME curl_share_strerror()\n *\n * DESCRIPTION\n *\n * The curl_share_strerror function may be used to turn a CURLSHcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_share_strerror(CURLSHcode);\n\n/*\n * NAME curl_easy_pause()\n *\n * DESCRIPTION\n *\n * The curl_easy_pause function pauses or unpauses transfers. Select the new\n * state by setting the bitmask, use the convenience defines below.\n *\n */\nCURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);\n\n#define CURLPAUSE_RECV      (1<<0)\n#define CURLPAUSE_RECV_CONT (0)\n\n#define CURLPAUSE_SEND      (1<<2)\n#define CURLPAUSE_SEND_CONT (0)\n\n#define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)\n#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)\n\n#ifdef  __cplusplus\n}\n#endif\n\n/* unfortunately, the easy.h and multi.h include files need options and info\n  stuff before they can be included! */\n#include \"easy.h\" /* nothing in curl is fun without the easy stuff */\n#include \"multi.h\"\n\n/* the typechecker doesn't work in C++ (yet) */\n#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \\\n    ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \\\n    !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)\n#include \"typecheck-gcc.h\"\n#else\n#if defined(__STDC__) && (__STDC__ >= 1)\n/* This preprocessor magic that replaces a call with the exact same call is\n   only done to make sure application authors pass exactly three arguments\n   to these functions. */\n#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)\n#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n#endif /* __STDC__ >= 1 */\n#endif /* gcc >= 4.3 && !__cplusplus */\n\n#endif /* __CURL_CURL_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/curlbuild.h",
    "content": "/* include/curl/curlbuild.h.  Generated from curlbuild.h.in by configure.  */\n#ifndef __CURL_CURLBUILD_H\n#define __CURL_CURLBUILD_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * If you think that something actually needs to be changed, adjusted\n * or fixed in this file, then, report it on the libcurl development\n * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * This header file shall only export symbols which are 'curl' or 'CURL'\n * prefixed, otherwise public name space would be polluted.\n *\n * NOTE 2:\n * -------\n *\n * Right now you might be staring at file include/curl/curlbuild.h.in or\n * at file include/curl/curlbuild.h, this is due to the following reason:\n *\n * On systems capable of running the configure script, the configure process\n * will overwrite the distributed include/curl/curlbuild.h file with one that\n * is suitable and specific to the library being configured and built, which\n * is generated from the include/curl/curlbuild.h.in template file.\n *\n */\n\n/* ================================================================ */\n/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */\n/* ================================================================ */\n\n#ifdef CURL_SIZEOF_LONG\n#error \"CURL_SIZEOF_LONG shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_SOCKLEN_T\n#error \"CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_SOCKLEN_T\n#error \"CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_OFF_T\n#error \"CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_T\n#error \"CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_TU\n#error \"CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined\n#endif\n\n#ifdef CURL_FORMAT_OFF_T\n#error \"CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_OFF_T\n#error \"CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_T\n#error \"CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_TU\n#error \"CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined\n#endif\n\n/* ================================================================ */\n/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */\n/* ================================================================ */\n\n/* Configure process defines this to 1 when it finds out that system  */\n/* header file ws2tcpip.h must be included by the external interface. */\n/* #undef CURL_PULL_WS2TCPIP_H */\n#ifdef CURL_PULL_WS2TCPIP_H\n#  ifndef WIN32_LEAN_AND_MEAN\n#    define WIN32_LEAN_AND_MEAN\n#  endif\n#  include <windows.h>\n#  include <winsock2.h>\n#  include <ws2tcpip.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system   */\n/* header file sys/types.h must be included by the external interface. */\n#define CURL_PULL_SYS_TYPES_H 1\n#ifdef CURL_PULL_SYS_TYPES_H\n#  include <sys/types.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system */\n/* header file stdint.h must be included by the external interface.  */\n#define CURL_PULL_STDINT_H 1\n#ifdef CURL_PULL_STDINT_H\n#  include <stdint.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system  */\n/* header file inttypes.h must be included by the external interface. */\n#define CURL_PULL_INTTYPES_H 1\n#ifdef CURL_PULL_INTTYPES_H\n#  include <inttypes.h>\n#endif\n\n/* Configure process defines this to 1 when it finds out that system    */\n/* header file sys/socket.h must be included by the external interface. */\n#define CURL_PULL_SYS_SOCKET_H 1\n#ifdef CURL_PULL_SYS_SOCKET_H\n#  include <sys/socket.h>\n#endif\n\n/* The size of `long', as computed by sizeof. */\n#define CURL_SIZEOF_LONG sizeof(long)\n\n/* Integral data type used for curl_socklen_t. */\n#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n\n/* The size of `curl_socklen_t', as computed by sizeof. */\n#define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n/* Data type definition of curl_socklen_t. */\ntypedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;\n\n/* Signed integral data type used for curl_off_t. */\n#define CURL_TYPEOF_CURL_OFF_T int64_t\n\n/* Data type definition of curl_off_t. */\ntypedef CURL_TYPEOF_CURL_OFF_T curl_off_t;\n\n/* curl_off_t formatting string directive without \"%\" conversion specifier. */\n#define CURL_FORMAT_CURL_OFF_T \"lld\"\n\n/* unsigned curl_off_t formatting string without \"%\" conversion specifier. */\n#define CURL_FORMAT_CURL_OFF_TU \"llu\"\n\n/* curl_off_t formatting string directive with \"%\" conversion specifier. */\n#define CURL_FORMAT_OFF_T \"%lld\"\n\n/* The size of `curl_off_t', as computed by sizeof. */\n#define CURL_SIZEOF_CURL_OFF_T 8\n\n/* curl_off_t constant suffix. */\n#define CURL_SUFFIX_CURL_OFF_T LL\n\n/* unsigned curl_off_t constant suffix. */\n#define CURL_SUFFIX_CURL_OFF_TU ULL\n\n#endif /* __CURL_CURLBUILD_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/curlrules.h",
    "content": "#ifndef __CURL_CURLRULES_H\n#define __CURL_CURLRULES_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*                    COMPILE TIME SANITY CHECKS                    */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * All checks done in this file are intentionally placed in a public\n * header file which is pulled by curl/curl.h when an application is\n * being built using an already built libcurl library. Additionally\n * this file is also included and used when building the library.\n *\n * If compilation fails on this file it is certainly sure that the\n * problem is elsewhere. It could be a problem in the curlbuild.h\n * header file, or simply that you are using different compilation\n * settings than those used to build the library.\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * Do not deactivate any check, these are done to make sure that the\n * library is properly built and used.\n *\n * You can find further help on the libcurl development mailing list:\n * http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * NOTE 2\n * ------\n *\n * Some of the following compile time checks are based on the fact\n * that the dimension of a constant array can not be a negative one.\n * In this way if the compile time verification fails, the compilation\n * will fail issuing an error. The error description wording is compiler\n * dependent but it will be quite similar to one of the following:\n *\n *   \"negative subscript or subscript is too large\"\n *   \"array must have at least one element\"\n *   \"-1 is an illegal array size\"\n *   \"size of array is negative\"\n *\n * If you are building an application which tries to use an already\n * built libcurl library and you are getting this kind of errors on\n * this file, it is a clear indication that there is a mismatch between\n * how the library was built and how you are trying to use it for your\n * application. Your already compiled or binary library provider is the\n * only one who can give you the details you need to properly use it.\n */\n\n/*\n * Verify that some macros are actually defined.\n */\n\n#ifndef CURL_SIZEOF_LONG\n#  error \"CURL_SIZEOF_LONG definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_SOCKLEN_T\n#  error \"CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_SOCKLEN_T\n#  error \"CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_OFF_T\n#  error \"CURL_TYPEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_T\n#  error \"CURL_FORMAT_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_TU\n#  error \"CURL_FORMAT_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing\n#endif\n\n#ifndef CURL_FORMAT_OFF_T\n#  error \"CURL_FORMAT_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_OFF_T\n#  error \"CURL_SIZEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_T\n#  error \"CURL_SUFFIX_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_TU\n#  error \"CURL_SUFFIX_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing\n#endif\n\n/*\n * Macros private to this header file.\n */\n\n#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1\n\n#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1\n\n/*\n * Verify that the size previously defined and expected for long\n * is the same as the one reported by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_01__\n    [CurlchkszEQ(long, CURL_SIZEOF_LONG)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_off_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_02__\n    [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];\n\n/*\n * Verify at compile time that the size of curl_off_t as reported\n * by sizeof() is greater or equal than the one reported for long\n * for the current compilation.\n */\n\ntypedef char\n  __curl_rule_03__\n    [CurlchkszGE(curl_off_t, long)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_socklen_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_04__\n    [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];\n\n/*\n * Verify at compile time that the size of curl_socklen_t as reported\n * by sizeof() is greater or equal than the one reported for int for\n * the current compilation.\n */\n\ntypedef char\n  __curl_rule_05__\n    [CurlchkszGE(curl_socklen_t, int)];\n\n/* ================================================================ */\n/*          EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS           */\n/* ================================================================ */\n\n/*\n * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow\n * these to be visible and exported by the external libcurl interface API,\n * while also making them visible to the library internals, simply including\n * setup.h, without actually needing to include curl.h internally.\n * If some day this section would grow big enough, all this should be moved\n * to its own header file.\n */\n\n/*\n * Figure out if we can use the ## preprocessor operator, which is supported\n * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__\n * or  __cplusplus so we need to carefully check for them too.\n */\n\n#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \\\n  defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \\\n  defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \\\n  defined(__ILEC400__)\n  /* This compiler is believed to have an ISO compatible preprocessor */\n#define CURL_ISOCPP\n#else\n  /* This compiler is believed NOT to have an ISO compatible preprocessor */\n#undef CURL_ISOCPP\n#endif\n\n/*\n * Macros for minimum-width signed and unsigned curl_off_t integer constants.\n */\n\n#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)\n#  define __CURL_OFF_T_C_HLPR2(x) x\n#  define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)\n#else\n#  ifdef CURL_ISOCPP\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix\n#  else\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix\n#  endif\n#  define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)\n#endif\n\n/*\n * Get rid of macros private to this header file.\n */\n\n#undef CurlchkszEQ\n#undef CurlchkszGE\n\n/*\n * Get rid of macros not intended to exist beyond this point.\n */\n\n#undef CURL_PULL_WS2TCPIP_H\n#undef CURL_PULL_SYS_TYPES_H\n#undef CURL_PULL_SYS_SOCKET_H\n#undef CURL_PULL_STDINT_H\n#undef CURL_PULL_INTTYPES_H\n\n#undef CURL_TYPEOF_CURL_SOCKLEN_T\n#undef CURL_TYPEOF_CURL_OFF_T\n\n#ifdef CURL_NO_OLDIES\n#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */\n#endif\n\n#endif /* __CURL_CURLRULES_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/curlver.h",
    "content": "#ifndef __CURL_CURLVER_H\n#define __CURL_CURLVER_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* This header file contains nothing but libcurl version info, generated by\n   a script at release-time. This was made its own header file in 7.11.2 */\n\n/* This is the global package copyright */\n#define LIBCURL_COPYRIGHT \"1996 - 2012 Daniel Stenberg, <daniel@haxx.se>.\"\n\n/* This is the version number of the libcurl package from which this header\n   file origins: */\n#define LIBCURL_VERSION \"7.26.0\"\n\n/* The numeric version number is also available \"in parts\" by using these\n   defines: */\n#define LIBCURL_VERSION_MAJOR 7\n#define LIBCURL_VERSION_MINOR 26\n#define LIBCURL_VERSION_PATCH 0\n\n/* This is the numeric version of the libcurl version number, meant for easier\n   parsing and comparions by programs. The LIBCURL_VERSION_NUM define will\n   always follow this syntax:\n\n         0xXXYYZZ\n\n   Where XX, YY and ZZ are the main version, release and patch numbers in\n   hexadecimal (using 8 bits each). All three numbers are always represented\n   using two digits.  1.2 would appear as \"0x010200\" while version 9.11.7\n   appears as \"0x090b07\".\n\n   This 6-digit (24 bits) hexadecimal number does not show pre-release number,\n   and it is always a greater number in a more recent release. It makes\n   comparisons with greater than and less than work.\n*/\n#define LIBCURL_VERSION_NUM 0x071a00\n\n/*\n * This is the date and time when the full source package was created. The\n * timestamp is not stored in git, as the timestamp is properly set in the\n * tarballs by the maketgz script.\n *\n * The format of the date should follow this template:\n *\n * \"Mon Feb 12 11:35:33 UTC 2007\"\n */\n#define LIBCURL_TIMESTAMP \"Thu May 24 16:05:42 UTC 2012\"\n\n#endif /* __CURL_CURLVER_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/easy.h",
    "content": "#ifndef __CURL_EASY_H\n#define __CURL_EASY_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN CURL *curl_easy_init(void);\nCURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);\nCURL_EXTERN CURLcode curl_easy_perform(CURL *curl);\nCURL_EXTERN void curl_easy_cleanup(CURL *curl);\n\n/*\n * NAME curl_easy_getinfo()\n *\n * DESCRIPTION\n *\n * Request internal information from the curl session with this function.  The\n * third argument MUST be a pointer to a long, a pointer to a char * or a\n * pointer to a double (as the documentation describes elsewhere).  The data\n * pointed to will be filled in accordingly and can be relied upon only if the\n * function returns CURLE_OK.  This function is intended to get used *AFTER* a\n * performed transfer, all results from this function are undefined until the\n * transfer is completed.\n */\nCURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);\n\n\n/*\n * NAME curl_easy_duphandle()\n *\n * DESCRIPTION\n *\n * Creates a new curl session handle with the same options set for the handle\n * passed in. Duplicating a handle could only be a matter of cloning data and\n * options, internal state info and things like persistent connections cannot\n * be transferred. It is useful in multithreaded applications when you can run\n * curl_easy_duphandle() for each new thread to avoid a series of identical\n * curl_easy_setopt() invokes in every thread.\n */\nCURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);\n\n/*\n * NAME curl_easy_reset()\n *\n * DESCRIPTION\n *\n * Re-initializes a CURL handle to the default values. This puts back the\n * handle to the same state as it was in when it was just created.\n *\n * It does keep: live connections, the Session ID cache, the DNS cache and the\n * cookies.\n */\nCURL_EXTERN void curl_easy_reset(CURL *curl);\n\n/*\n * NAME curl_easy_recv()\n *\n * DESCRIPTION\n *\n * Receives data from the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,\n                                    size_t *n);\n\n/*\n * NAME curl_easy_send()\n *\n * DESCRIPTION\n *\n * Sends data over the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,\n                                    size_t buflen, size_t *n);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/mprintf.h",
    "content": "#ifndef __CURL_MPRINTF_H\n#define __CURL_MPRINTF_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <stdarg.h>\n#include <stdio.h> /* needed for FILE */\n\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN int curl_mprintf(const char *format, ...);\nCURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);\nCURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);\nCURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,\n                               const char *format, ...);\nCURL_EXTERN int curl_mvprintf(const char *format, va_list args);\nCURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);\nCURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);\nCURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,\n                                const char *format, va_list args);\nCURL_EXTERN char *curl_maprintf(const char *format, ...);\nCURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);\n\n#ifdef _MPRINTF_REPLACE\n# undef printf\n# undef fprintf\n# undef sprintf\n# undef vsprintf\n# undef snprintf\n# undef vprintf\n# undef vfprintf\n# undef vsnprintf\n# undef aprintf\n# undef vaprintf\n# define printf curl_mprintf\n# define fprintf curl_mfprintf\n#ifdef CURLDEBUG\n/* When built with CURLDEBUG we define away the sprintf() functions since we\n   don't want internal code to be using them */\n# define sprintf sprintf_was_used\n# define vsprintf vsprintf_was_used\n#else\n# define sprintf curl_msprintf\n# define vsprintf curl_mvsprintf\n#endif\n# define snprintf curl_msnprintf\n# define vprintf curl_mvprintf\n# define vfprintf curl_mvfprintf\n# define vsnprintf curl_mvsnprintf\n# define aprintf curl_maprintf\n# define vaprintf curl_mvaprintf\n#endif\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif /* __CURL_MPRINTF_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/multi.h",
    "content": "#ifndef __CURL_MULTI_H\n#define __CURL_MULTI_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n/*\n  This is an \"external\" header file. Don't give away any internals here!\n\n  GOALS\n\n  o Enable a \"pull\" interface. The application that uses libcurl decides where\n    and when to ask libcurl to get/send data.\n\n  o Enable multiple simultaneous transfers in the same thread without making it\n    complicated for the application.\n\n  o Enable the application to select() on its own file descriptors and curl's\n    file descriptors simultaneous easily.\n\n*/\n\n/*\n * This header file should not really need to include \"curl.h\" since curl.h\n * itself includes this file and we expect user applications to do #include\n * <curl/curl.h> without the need for especially including multi.h.\n *\n * For some reason we added this include here at one point, and rather than to\n * break existing (wrongly written) libcurl applications, we leave it as-is\n * but with this warning attached.\n */\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURLM;\n\ntypedef enum {\n  CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or\n                                    curl_multi_socket*() soon */\n  CURLM_OK,\n  CURLM_BAD_HANDLE,      /* the passed-in handle is not a valid CURLM handle */\n  CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */\n  CURLM_OUT_OF_MEMORY,   /* if you ever get this, you're in deep sh*t */\n  CURLM_INTERNAL_ERROR,  /* this is a libcurl bug */\n  CURLM_BAD_SOCKET,      /* the passed in socket argument did not match */\n  CURLM_UNKNOWN_OPTION,  /* curl_multi_setopt() with unsupported option */\n  CURLM_LAST\n} CURLMcode;\n\n/* just to make code nicer when using curl_multi_socket() you can now check\n   for CURLM_CALL_MULTI_SOCKET too in the same style it works for\n   curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */\n#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM\n\ntypedef enum {\n  CURLMSG_NONE, /* first, not used */\n  CURLMSG_DONE, /* This easy handle has completed. 'result' contains\n                   the CURLcode of the transfer */\n  CURLMSG_LAST /* last, not used */\n} CURLMSG;\n\nstruct CURLMsg {\n  CURLMSG msg;       /* what this message means */\n  CURL *easy_handle; /* the handle it concerns */\n  union {\n    void *whatever;    /* message-specific data */\n    CURLcode result;   /* return code for transfer */\n  } data;\n};\ntypedef struct CURLMsg CURLMsg;\n\n/*\n * Name:    curl_multi_init()\n *\n * Desc:    inititalize multi-style curl usage\n *\n * Returns: a new CURLM handle to use in all 'curl_multi' functions.\n */\nCURL_EXTERN CURLM *curl_multi_init(void);\n\n/*\n * Name:    curl_multi_add_handle()\n *\n * Desc:    add a standard curl handle to the multi stack\n *\n * Returns: CURLMcode type, general multi error code.\n */\nCURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,\n                                            CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_remove_handle()\n  *\n  * Desc:    removes a curl handle from the multi stack again\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,\n                                               CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_fdset()\n  *\n  * Desc:    Ask curl for its fd_set sets. The app can use these to select() or\n  *          poll() on. We want curl_multi_perform() called as soon as one of\n  *          them are ready.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,\n                                       fd_set *read_fd_set,\n                                       fd_set *write_fd_set,\n                                       fd_set *exc_fd_set,\n                                       int *max_fd);\n\n /*\n  * Name:    curl_multi_perform()\n  *\n  * Desc:    When the app thinks there's data available for curl it calls this\n  *          function to read/write whatever there is right now. This returns\n  *          as soon as the reads and writes are done. This function does not\n  *          require that there actually is data available for reading or that\n  *          data can be written, it can be called just in case. It returns\n  *          the number of handles that still transfer data in the second\n  *          argument's integer-pointer.\n  *\n  * Returns: CURLMcode type, general multi error code. *NOTE* that this only\n  *          returns errors etc regarding the whole multi stack. There might\n  *          still have occurred problems on invidual transfers even when this\n  *          returns OK.\n  */\nCURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,\n                                         int *running_handles);\n\n /*\n  * Name:    curl_multi_cleanup()\n  *\n  * Desc:    Cleans up and removes a whole multi stack. It does not free or\n  *          touch any individual easy handles in any way. We need to define\n  *          in what state those handles will be if this function is called\n  *          in the middle of a transfer.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);\n\n/*\n * Name:    curl_multi_info_read()\n *\n * Desc:    Ask the multi handle if there's any messages/informationals from\n *          the individual transfers. Messages include informationals such as\n *          error code from the transfer or just the fact that a transfer is\n *          completed. More details on these should be written down as well.\n *\n *          Repeated calls to this function will return a new struct each\n *          time, until a special \"end of msgs\" struct is returned as a signal\n *          that there is no more to get at this point.\n *\n *          The data the returned pointer points to will not survive calling\n *          curl_multi_cleanup().\n *\n *          The 'CURLMsg' struct is meant to be very simple and only contain\n *          very basic informations. If more involved information is wanted,\n *          we will provide the particular \"transfer handle\" in that struct\n *          and that should/could/would be used in subsequent\n *          curl_easy_getinfo() calls (or similar). The point being that we\n *          must never expose complex structs to applications, as then we'll\n *          undoubtably get backwards compatibility problems in the future.\n *\n * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out\n *          of structs. It also writes the number of messages left in the\n *          queue (after this read) in the integer the second argument points\n *          to.\n */\nCURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,\n                                          int *msgs_in_queue);\n\n/*\n * Name:    curl_multi_strerror()\n *\n * Desc:    The curl_multi_strerror function may be used to turn a CURLMcode\n *          value into the equivalent human readable error string.  This is\n *          useful for printing meaningful error messages.\n *\n * Returns: A pointer to a zero-terminated error message.\n */\nCURL_EXTERN const char *curl_multi_strerror(CURLMcode);\n\n/*\n * Name:    curl_multi_socket() and\n *          curl_multi_socket_all()\n *\n * Desc:    An alternative version of curl_multi_perform() that allows the\n *          application to pass in one of the file descriptors that have been\n *          detected to have \"action\" on them and let libcurl perform.\n *          See man page for details.\n */\n#define CURL_POLL_NONE   0\n#define CURL_POLL_IN     1\n#define CURL_POLL_OUT    2\n#define CURL_POLL_INOUT  3\n#define CURL_POLL_REMOVE 4\n\n#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD\n\n#define CURL_CSELECT_IN   0x01\n#define CURL_CSELECT_OUT  0x02\n#define CURL_CSELECT_ERR  0x04\n\ntypedef int (*curl_socket_callback)(CURL *easy,      /* easy handle */\n                                    curl_socket_t s, /* socket */\n                                    int what,        /* see above */\n                                    void *userp,     /* private callback\n                                                        pointer */\n                                    void *socketp);  /* private socket\n                                                        pointer */\n/*\n * Name:    curl_multi_timer_callback\n *\n * Desc:    Called by libcurl whenever the library detects a change in the\n *          maximum number of milliseconds the app is allowed to wait before\n *          curl_multi_socket() or curl_multi_perform() must be called\n *          (to allow libcurl's timed events to take place).\n *\n * Returns: The callback should return zero.\n */\ntypedef int (*curl_multi_timer_callback)(CURLM *multi,    /* multi handle */\n                                         long timeout_ms, /* see above */\n                                         void *userp);    /* private callback\n                                                             pointer */\n\nCURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,\n                                        int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,\n                                               curl_socket_t s,\n                                               int ev_bitmask,\n                                               int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,\n                                            int *running_handles);\n\n#ifndef CURL_ALLOW_OLD_MULTI_SOCKET\n/* This macro below was added in 7.16.3 to push users who recompile to use\n   the new curl_multi_socket_action() instead of the old curl_multi_socket()\n*/\n#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)\n#endif\n\n/*\n * Name:    curl_multi_timeout()\n *\n * Desc:    Returns the maximum number of milliseconds the app is allowed to\n *          wait before curl_multi_socket() or curl_multi_perform() must be\n *          called (to allow libcurl's timed events to take place).\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,\n                                         long *milliseconds);\n\n#undef CINIT /* re-using the same name as in curl.h */\n\n#ifdef CURL_ISOCPP\n#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLMOPT_/**/name = type + number\n#endif\n\ntypedef enum {\n  /* This is the socket callback function pointer */\n  CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),\n\n  /* This is the argument passed to the socket callback */\n  CINIT(SOCKETDATA, OBJECTPOINT, 2),\n\n    /* set to 1 to enable pipelining for this multi handle */\n  CINIT(PIPELINING, LONG, 3),\n\n   /* This is the timer callback function pointer */\n  CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),\n\n  /* This is the argument passed to the timer callback */\n  CINIT(TIMERDATA, OBJECTPOINT, 5),\n\n  /* maximum number of entries in the connection cache */\n  CINIT(MAXCONNECTS, LONG, 6),\n\n  CURLMOPT_LASTENTRY /* the last unused */\n} CURLMoption;\n\n\n/*\n * Name:    curl_multi_setopt()\n *\n * Desc:    Sets options for the multi handle.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,\n                                        CURLMoption option, ...);\n\n\n/*\n * Name:    curl_multi_assign()\n *\n * Desc:    This function sets an association in the multi handle between the\n *          given socket and a private pointer of the application. This is\n *          (only) useful for curl_multi_socket uses.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,\n                                        curl_socket_t sockfd, void *sockp);\n\n#ifdef __cplusplus\n} /* end of extern \"C\" */\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/stdcheaders.h",
    "content": "#ifndef __STDC_HEADERS_H\n#define __STDC_HEADERS_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <sys/types.h>\n\nsize_t fread (void *, size_t, size_t, FILE *);\nsize_t fwrite (const void *, size_t, size_t, FILE *);\n\nint strcasecmp(const char *, const char *);\nint strncasecmp(const char *, const char *, size_t);\n\n#endif /* __STDC_HEADERS_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/ios/curl/typecheck-gcc.h",
    "content": "#ifndef __CURL_TYPECHECK_GCC_H\n#define __CURL_TYPECHECK_GCC_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* wraps curl_easy_setopt() with typechecking */\n\n/* To add a new kind of warning, add an\n *   if(_curl_is_sometype_option(_curl_opt))\n *     if(!_curl_is_sometype(value))\n *       _curl_easy_setopt_err_sometype();\n * block and define _curl_is_sometype_option, _curl_is_sometype and\n * _curl_easy_setopt_err_sometype below\n *\n * NOTE: We use two nested 'if' statements here instead of the && operator, in\n *       order to work around gcc bug #32061.  It affects only gcc 4.3.x/4.4.x\n *       when compiling with -Wlogical-op.\n *\n * To add an option that uses the same type as an existing option, you'll just\n * need to extend the appropriate _curl_*_option macro\n */\n#define curl_easy_setopt(handle, option, value)                               \\\n__extension__ ({                                                              \\\n  __typeof__ (option) _curl_opt = option;                                     \\\n  if(__builtin_constant_p(_curl_opt)) {                                       \\\n    if(_curl_is_long_option(_curl_opt))                                       \\\n      if(!_curl_is_long(value))                                               \\\n        _curl_easy_setopt_err_long();                                         \\\n    if(_curl_is_off_t_option(_curl_opt))                                      \\\n      if(!_curl_is_off_t(value))                                              \\\n        _curl_easy_setopt_err_curl_off_t();                                   \\\n    if(_curl_is_string_option(_curl_opt))                                     \\\n      if(!_curl_is_string(value))                                             \\\n        _curl_easy_setopt_err_string();                                       \\\n    if(_curl_is_write_cb_option(_curl_opt))                                   \\\n      if(!_curl_is_write_cb(value))                                           \\\n        _curl_easy_setopt_err_write_callback();                               \\\n    if((_curl_opt) == CURLOPT_READFUNCTION)                                   \\\n      if(!_curl_is_read_cb(value))                                            \\\n        _curl_easy_setopt_err_read_cb();                                      \\\n    if((_curl_opt) == CURLOPT_IOCTLFUNCTION)                                  \\\n      if(!_curl_is_ioctl_cb(value))                                           \\\n        _curl_easy_setopt_err_ioctl_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION)                                \\\n      if(!_curl_is_sockopt_cb(value))                                         \\\n        _curl_easy_setopt_err_sockopt_cb();                                   \\\n    if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION)                             \\\n      if(!_curl_is_opensocket_cb(value))                                      \\\n        _curl_easy_setopt_err_opensocket_cb();                                \\\n    if((_curl_opt) == CURLOPT_PROGRESSFUNCTION)                               \\\n      if(!_curl_is_progress_cb(value))                                        \\\n        _curl_easy_setopt_err_progress_cb();                                  \\\n    if((_curl_opt) == CURLOPT_DEBUGFUNCTION)                                  \\\n      if(!_curl_is_debug_cb(value))                                           \\\n        _curl_easy_setopt_err_debug_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION)                               \\\n      if(!_curl_is_ssl_ctx_cb(value))                                         \\\n        _curl_easy_setopt_err_ssl_ctx_cb();                                   \\\n    if(_curl_is_conv_cb_option(_curl_opt))                                    \\\n      if(!_curl_is_conv_cb(value))                                            \\\n        _curl_easy_setopt_err_conv_cb();                                      \\\n    if((_curl_opt) == CURLOPT_SEEKFUNCTION)                                   \\\n      if(!_curl_is_seek_cb(value))                                            \\\n        _curl_easy_setopt_err_seek_cb();                                      \\\n    if(_curl_is_cb_data_option(_curl_opt))                                    \\\n      if(!_curl_is_cb_data(value))                                            \\\n        _curl_easy_setopt_err_cb_data();                                      \\\n    if((_curl_opt) == CURLOPT_ERRORBUFFER)                                    \\\n      if(!_curl_is_error_buffer(value))                                       \\\n        _curl_easy_setopt_err_error_buffer();                                 \\\n    if((_curl_opt) == CURLOPT_STDERR)                                         \\\n      if(!_curl_is_FILE(value))                                               \\\n        _curl_easy_setopt_err_FILE();                                         \\\n    if(_curl_is_postfields_option(_curl_opt))                                 \\\n      if(!_curl_is_postfields(value))                                         \\\n        _curl_easy_setopt_err_postfields();                                   \\\n    if((_curl_opt) == CURLOPT_HTTPPOST)                                       \\\n      if(!_curl_is_arr((value), struct curl_httppost))                        \\\n        _curl_easy_setopt_err_curl_httpost();                                 \\\n    if(_curl_is_slist_option(_curl_opt))                                      \\\n      if(!_curl_is_arr((value), struct curl_slist))                           \\\n        _curl_easy_setopt_err_curl_slist();                                   \\\n    if((_curl_opt) == CURLOPT_SHARE)                                          \\\n      if(!_curl_is_ptr((value), CURLSH))                                      \\\n        _curl_easy_setopt_err_CURLSH();                                       \\\n  }                                                                           \\\n  curl_easy_setopt(handle, _curl_opt, value);                                 \\\n})\n\n/* wraps curl_easy_getinfo() with typechecking */\n/* FIXME: don't allow const pointers */\n#define curl_easy_getinfo(handle, info, arg)                                  \\\n__extension__ ({                                                              \\\n  __typeof__ (info) _curl_info = info;                                        \\\n  if(__builtin_constant_p(_curl_info)) {                                      \\\n    if(_curl_is_string_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), char *))                                        \\\n        _curl_easy_getinfo_err_string();                                      \\\n    if(_curl_is_long_info(_curl_info))                                        \\\n      if(!_curl_is_arr((arg), long))                                          \\\n        _curl_easy_getinfo_err_long();                                        \\\n    if(_curl_is_double_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), double))                                        \\\n        _curl_easy_getinfo_err_double();                                      \\\n    if(_curl_is_slist_info(_curl_info))                                       \\\n      if(!_curl_is_arr((arg), struct curl_slist *))                           \\\n        _curl_easy_getinfo_err_curl_slist();                                  \\\n  }                                                                           \\\n  curl_easy_getinfo(handle, _curl_info, arg);                                 \\\n})\n\n/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),\n * for now just make sure that the functions are called with three\n * arguments\n */\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n\n\n/* the actual warnings, triggered by calling the _curl_easy_setopt_err*\n * functions */\n\n/* To define a new warning, use _CURL_WARNING(identifier, \"message\") */\n#define _CURL_WARNING(id, message)                                            \\\n  static void __attribute__((__warning__(message)))                           \\\n  __attribute__((__unused__)) __attribute__((__noinline__))                   \\\n  id(void) { __asm__(\"\"); }\n\n_CURL_WARNING(_curl_easy_setopt_err_long,\n  \"curl_easy_setopt expects a long argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,\n  \"curl_easy_setopt expects a curl_off_t argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_string,\n              \"curl_easy_setopt expects a \"\n              \"string (char* or char[]) argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_write_callback,\n  \"curl_easy_setopt expects a curl_write_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_read_cb,\n  \"curl_easy_setopt expects a curl_read_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,\n  \"curl_easy_setopt expects a curl_ioctl_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,\n  \"curl_easy_setopt expects a curl_sockopt_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,\n              \"curl_easy_setopt expects a \"\n              \"curl_opensocket_callback argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_progress_cb,\n  \"curl_easy_setopt expects a curl_progress_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_debug_cb,\n  \"curl_easy_setopt expects a curl_debug_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,\n  \"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_conv_cb,\n  \"curl_easy_setopt expects a curl_conv_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_seek_cb,\n  \"curl_easy_setopt expects a curl_seek_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_cb_data,\n              \"curl_easy_setopt expects a \"\n              \"private data pointer as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_error_buffer,\n              \"curl_easy_setopt expects a \"\n              \"char buffer of CURL_ERROR_SIZE as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_FILE,\n  \"curl_easy_setopt expects a FILE* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_postfields,\n  \"curl_easy_setopt expects a void* or char* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,\n  \"curl_easy_setopt expects a struct curl_httppost* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_slist,\n  \"curl_easy_setopt expects a struct curl_slist* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_CURLSH,\n  \"curl_easy_setopt expects a CURLSH* argument for this option\")\n\n_CURL_WARNING(_curl_easy_getinfo_err_string,\n  \"curl_easy_getinfo expects a pointer to char * for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_long,\n  \"curl_easy_getinfo expects a pointer to long for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_double,\n  \"curl_easy_getinfo expects a pointer to double for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,\n  \"curl_easy_getinfo expects a pointer to struct curl_slist * for this info\")\n\n/* groups of curl_easy_setops options that take the same type of argument */\n\n/* To add a new option to one of the groups, just add\n *   (option) == CURLOPT_SOMETHING\n * to the or-expression. If the option takes a long or curl_off_t, you don't\n * have to do anything\n */\n\n/* evaluates to true if option takes a long argument */\n#define _curl_is_long_option(option)                                          \\\n  (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)\n\n#define _curl_is_off_t_option(option)                                         \\\n  ((option) > CURLOPTTYPE_OFF_T)\n\n/* evaluates to true if option takes a char* argument */\n#define _curl_is_string_option(option)                                        \\\n  ((option) == CURLOPT_URL ||                                                 \\\n   (option) == CURLOPT_PROXY ||                                               \\\n   (option) == CURLOPT_INTERFACE ||                                           \\\n   (option) == CURLOPT_NETRC_FILE ||                                          \\\n   (option) == CURLOPT_USERPWD ||                                             \\\n   (option) == CURLOPT_USERNAME ||                                            \\\n   (option) == CURLOPT_PASSWORD ||                                            \\\n   (option) == CURLOPT_PROXYUSERPWD ||                                        \\\n   (option) == CURLOPT_PROXYUSERNAME ||                                       \\\n   (option) == CURLOPT_PROXYPASSWORD ||                                       \\\n   (option) == CURLOPT_NOPROXY ||                                             \\\n   (option) == CURLOPT_ACCEPT_ENCODING ||                                     \\\n   (option) == CURLOPT_REFERER ||                                             \\\n   (option) == CURLOPT_USERAGENT ||                                           \\\n   (option) == CURLOPT_COOKIE ||                                              \\\n   (option) == CURLOPT_COOKIEFILE ||                                          \\\n   (option) == CURLOPT_COOKIEJAR ||                                           \\\n   (option) == CURLOPT_COOKIELIST ||                                          \\\n   (option) == CURLOPT_FTPPORT ||                                             \\\n   (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER ||                             \\\n   (option) == CURLOPT_FTP_ACCOUNT ||                                         \\\n   (option) == CURLOPT_RANGE ||                                               \\\n   (option) == CURLOPT_CUSTOMREQUEST ||                                       \\\n   (option) == CURLOPT_SSLCERT ||                                             \\\n   (option) == CURLOPT_SSLCERTTYPE ||                                         \\\n   (option) == CURLOPT_SSLKEY ||                                              \\\n   (option) == CURLOPT_SSLKEYTYPE ||                                          \\\n   (option) == CURLOPT_KEYPASSWD ||                                           \\\n   (option) == CURLOPT_SSLENGINE ||                                           \\\n   (option) == CURLOPT_CAINFO ||                                              \\\n   (option) == CURLOPT_CAPATH ||                                              \\\n   (option) == CURLOPT_RANDOM_FILE ||                                         \\\n   (option) == CURLOPT_EGDSOCKET ||                                           \\\n   (option) == CURLOPT_SSL_CIPHER_LIST ||                                     \\\n   (option) == CURLOPT_KRBLEVEL ||                                            \\\n   (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 ||                             \\\n   (option) == CURLOPT_SSH_PUBLIC_KEYFILE ||                                  \\\n   (option) == CURLOPT_SSH_PRIVATE_KEYFILE ||                                 \\\n   (option) == CURLOPT_CRLFILE ||                                             \\\n   (option) == CURLOPT_ISSUERCERT ||                                          \\\n   (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE ||                               \\\n   (option) == CURLOPT_SSH_KNOWNHOSTS ||                                      \\\n   (option) == CURLOPT_MAIL_FROM ||                                           \\\n   (option) == CURLOPT_RTSP_SESSION_ID ||                                     \\\n   (option) == CURLOPT_RTSP_STREAM_URI ||                                     \\\n   (option) == CURLOPT_RTSP_TRANSPORT ||                                      \\\n   0)\n\n/* evaluates to true if option takes a curl_write_callback argument */\n#define _curl_is_write_cb_option(option)                                      \\\n  ((option) == CURLOPT_HEADERFUNCTION ||                                      \\\n   (option) == CURLOPT_WRITEFUNCTION)\n\n/* evaluates to true if option takes a curl_conv_callback argument */\n#define _curl_is_conv_cb_option(option)                                       \\\n  ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION ||                            \\\n   (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION ||                          \\\n   (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)\n\n/* evaluates to true if option takes a data argument to pass to a callback */\n#define _curl_is_cb_data_option(option)                                       \\\n  ((option) == CURLOPT_WRITEDATA ||                                           \\\n   (option) == CURLOPT_READDATA ||                                            \\\n   (option) == CURLOPT_IOCTLDATA ||                                           \\\n   (option) == CURLOPT_SOCKOPTDATA ||                                         \\\n   (option) == CURLOPT_OPENSOCKETDATA ||                                      \\\n   (option) == CURLOPT_PROGRESSDATA ||                                        \\\n   (option) == CURLOPT_WRITEHEADER ||                                         \\\n   (option) == CURLOPT_DEBUGDATA ||                                           \\\n   (option) == CURLOPT_SSL_CTX_DATA ||                                        \\\n   (option) == CURLOPT_SEEKDATA ||                                            \\\n   (option) == CURLOPT_PRIVATE ||                                             \\\n   (option) == CURLOPT_SSH_KEYDATA ||                                         \\\n   (option) == CURLOPT_INTERLEAVEDATA ||                                      \\\n   (option) == CURLOPT_CHUNK_DATA ||                                          \\\n   (option) == CURLOPT_FNMATCH_DATA ||                                        \\\n   0)\n\n/* evaluates to true if option takes a POST data argument (void* or char*) */\n#define _curl_is_postfields_option(option)                                    \\\n  ((option) == CURLOPT_POSTFIELDS ||                                          \\\n   (option) == CURLOPT_COPYPOSTFIELDS ||                                      \\\n   0)\n\n/* evaluates to true if option takes a struct curl_slist * argument */\n#define _curl_is_slist_option(option)                                         \\\n  ((option) == CURLOPT_HTTPHEADER ||                                          \\\n   (option) == CURLOPT_HTTP200ALIASES ||                                      \\\n   (option) == CURLOPT_QUOTE ||                                               \\\n   (option) == CURLOPT_POSTQUOTE ||                                           \\\n   (option) == CURLOPT_PREQUOTE ||                                            \\\n   (option) == CURLOPT_TELNETOPTIONS ||                                       \\\n   (option) == CURLOPT_MAIL_RCPT ||                                           \\\n   0)\n\n/* groups of curl_easy_getinfo infos that take the same type of argument */\n\n/* evaluates to true if info expects a pointer to char * argument */\n#define _curl_is_string_info(info)                                            \\\n  (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)\n\n/* evaluates to true if info expects a pointer to long argument */\n#define _curl_is_long_info(info)                                              \\\n  (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)\n\n/* evaluates to true if info expects a pointer to double argument */\n#define _curl_is_double_info(info)                                            \\\n  (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)\n\n/* true if info expects a pointer to struct curl_slist * argument */\n#define _curl_is_slist_info(info)                                             \\\n  (CURLINFO_SLIST < (info))\n\n\n/* typecheck helpers -- check whether given expression has requested type*/\n\n/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,\n * otherwise define a new macro. Search for __builtin_types_compatible_p\n * in the GCC manual.\n * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is\n * the actual expression passed to the curl_easy_setopt macro. This\n * means that you can only apply the sizeof and __typeof__ operators, no\n * == or whatsoever.\n */\n\n/* XXX: should evaluate to true iff expr is a pointer */\n#define _curl_is_any_ptr(expr)                                                \\\n  (sizeof(expr) == sizeof(void*))\n\n/* evaluates to true if expr is NULL */\n/* XXX: must not evaluate expr, so this check is not accurate */\n#define _curl_is_NULL(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))\n\n/* evaluates to true if expr is type*, const type* or NULL */\n#define _curl_is_ptr(expr, type)                                              \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), type *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), const type *))\n\n/* evaluates to true if expr is one of type[], type*, NULL or const type* */\n#define _curl_is_arr(expr, type)                                              \\\n  (_curl_is_ptr((expr), type) ||                                              \\\n   __builtin_types_compatible_p(__typeof__(expr), type []))\n\n/* evaluates to true if expr is a string */\n#define _curl_is_string(expr)                                                 \\\n  (_curl_is_arr((expr), char) ||                                              \\\n   _curl_is_arr((expr), signed char) ||                                       \\\n   _curl_is_arr((expr), unsigned char))\n\n/* evaluates to true if expr is a long (no matter the signedness)\n * XXX: for now, int is also accepted (and therefore short and char, which\n * are promoted to int when passed to a variadic function) */\n#define _curl_is_long(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), long) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed long) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned long) ||           \\\n   __builtin_types_compatible_p(__typeof__(expr), int) ||                     \\\n   __builtin_types_compatible_p(__typeof__(expr), signed int) ||              \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned int) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), short) ||                   \\\n   __builtin_types_compatible_p(__typeof__(expr), signed short) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned short) ||          \\\n   __builtin_types_compatible_p(__typeof__(expr), char) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed char) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned char))\n\n/* evaluates to true if expr is of type curl_off_t */\n#define _curl_is_off_t(expr)                                                  \\\n  (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))\n\n/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */\n/* XXX: also check size of an char[] array? */\n#define _curl_is_error_buffer(expr)                                           \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), char *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), char[]))\n\n/* evaluates to true if expr is of type (const) void* or (const) FILE* */\n#if 0\n#define _curl_is_cb_data(expr)                                                \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_ptr((expr), FILE))\n#else /* be less strict */\n#define _curl_is_cb_data(expr)                                                \\\n  _curl_is_any_ptr(expr)\n#endif\n\n/* evaluates to true if expr is of type FILE* */\n#define _curl_is_FILE(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), FILE *))\n\n/* evaluates to true if expr can be passed as POST data (void* or char*) */\n#define _curl_is_postfields(expr)                                             \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_arr((expr), char))\n\n/* FIXME: the whole callback checking is messy...\n * The idea is to tolerate char vs. void and const vs. not const\n * pointers in arguments at least\n */\n/* helper: __builtin_types_compatible_p distinguishes between functions and\n * function pointers, hide it */\n#define _curl_callback_compatible(func, type)                                 \\\n  (__builtin_types_compatible_p(__typeof__(func), type) ||                    \\\n   __builtin_types_compatible_p(__typeof__(func), type*))\n\n/* evaluates to true if expr is of type curl_read_callback or \"similar\" */\n#define _curl_is_read_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) ||       \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_read_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback4) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback5) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback6))\ntypedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_write_callback or \"similar\" */\n#define _curl_is_write_cb(expr)                                               \\\n  (_curl_is_read_cb(expr) ||                                            \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) ||      \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_write_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback6))\ntypedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback2)(const char *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback5)(const void *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_ioctl_callback or \"similar\" */\n#define _curl_is_ioctl_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback4))\ntypedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);\ntypedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);\ntypedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);\ntypedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);\n\n/* evaluates to true if expr is of type curl_sockopt_callback or \"similar\" */\n#define _curl_is_sockopt_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback2))\ntypedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);\ntypedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,\n                                      curlsocktype);\n\n/* evaluates to true if expr is of type curl_opensocket_callback or\n   \"similar\" */\n#define _curl_is_opensocket_cb(expr)                                    \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\\\n   _curl_callback_compatible((expr), _curl_opensocket_callback1) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback2) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback3) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback4))\ntypedef curl_socket_t (_curl_opensocket_callback1)\n  (void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback2)\n  (void *, curlsocktype, const struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback3)\n  (const void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback4)\n  (const void *, curlsocktype, const struct curl_sockaddr *);\n\n/* evaluates to true if expr is of type curl_progress_callback or \"similar\" */\n#define _curl_is_progress_cb(expr)                                      \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) ||  \\\n   _curl_callback_compatible((expr), _curl_progress_callback1) ||             \\\n   _curl_callback_compatible((expr), _curl_progress_callback2))\ntypedef int (_curl_progress_callback1)(void *,\n    double, double, double, double);\ntypedef int (_curl_progress_callback2)(const void *,\n    double, double, double, double);\n\n/* evaluates to true if expr is of type curl_debug_callback or \"similar\" */\n#define _curl_is_debug_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_debug_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback6) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback7) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback8))\ntypedef int (_curl_debug_callback1) (CURL *,\n    curl_infotype, char *, size_t, void *);\ntypedef int (_curl_debug_callback2) (CURL *,\n    curl_infotype, char *, size_t, const void *);\ntypedef int (_curl_debug_callback3) (CURL *,\n    curl_infotype, const char *, size_t, void *);\ntypedef int (_curl_debug_callback4) (CURL *,\n    curl_infotype, const char *, size_t, const void *);\ntypedef int (_curl_debug_callback5) (CURL *,\n    curl_infotype, unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback6) (CURL *,\n    curl_infotype, unsigned char *, size_t, const void *);\ntypedef int (_curl_debug_callback7) (CURL *,\n    curl_infotype, const unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback8) (CURL *,\n    curl_infotype, const unsigned char *, size_t, const void *);\n\n/* evaluates to true if expr is of type curl_ssl_ctx_callback or \"similar\" */\n/* this is getting even messier... */\n#define _curl_is_ssl_ctx_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))\ntypedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);\n#ifdef HEADER_SSL_H\n/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX\n * this will of course break if we're included before OpenSSL headers...\n */\ntypedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,\n                                           const void *);\n#else\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;\n#endif\n\n/* evaluates to true if expr is of type curl_conv_callback or \"similar\" */\n#define _curl_is_conv_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_conv_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback4))\ntypedef CURLcode (*_curl_conv_callback1)(char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback3)(void *, size_t length);\ntypedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);\n\n/* evaluates to true if expr is of type curl_seek_callback or \"similar\" */\n#define _curl_is_seek_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_seek_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_seek_callback2))\ntypedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);\ntypedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);\n\n\n#endif /* __CURL_TYPECHECK_GCC_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/curl.h",
    "content": "#ifndef __CURL_CURL_H\n#define __CURL_CURL_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/*\n * If you have libcurl problems, all docs and details are found here:\n *   http://curl.haxx.se/libcurl/\n *\n * curl-library mailing list subscription and unsubscription web interface:\n *   http://cool.haxx.se/mailman/listinfo/curl-library/\n */\n\n#include \"curlver.h\"         /* libcurl version defines   */\n#include \"curlbuild.h\"       /* libcurl build definitions */\n#include \"curlrules.h\"       /* libcurl rules enforcement */\n\n/*\n * Define WIN32 when build target is Win32 API\n */\n\n#if (defined(_WIN32) || defined(__WIN32__)) && \\\n     !defined(WIN32) && !defined(__SYMBIAN32__)\n#define WIN32\n#endif\n\n#include <stdio.h>\n#include <limits.h>\n\n#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)\n/* Needed for __FreeBSD_version symbol definition */\n#include <osreldate.h>\n#endif\n\n/* The include stuff here below is mainly for time_t! */\n#include <sys/types.h>\n#include <time.h>\n\n#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)\n#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))\n/* The check above prevents the winsock2 inclusion if winsock.h already was\n   included, since they can't co-exist without problems */\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#endif\n#endif\n\n/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish\n   libc5-based Linux systems. Only include it on systems that are known to\n   require it! */\n#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \\\n    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \\\n    defined(ANDROID) || defined(__ANDROID__) || \\\n   (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))\n#include <sys/select.h>\n#endif\n\n#if !defined(WIN32) && !defined(_WIN32_WCE)\n#include <sys/socket.h>\n#endif\n\n#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)\n#include <sys/time.h>\n#endif\n\n#ifdef __BEOS__\n#include <support/SupportDefs.h>\n#endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURL;\n\n/*\n * Decorate exportable functions for Win32 and Symbian OS DLL linking.\n * This avoids using a .def file for building libcurl.dll.\n */\n#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \\\n     !defined(CURL_STATICLIB)\n#if defined(BUILDING_LIBCURL)\n#define CURL_EXTERN  __declspec(dllexport)\n#else\n#define CURL_EXTERN  __declspec(dllimport)\n#endif\n#else\n\n#ifdef CURL_HIDDEN_SYMBOLS\n/*\n * This definition is used to make external definitions visible in the\n * shared library when symbols are hidden by default.  It makes no\n * difference when compiling applications whether this is set or not,\n * only when compiling the library.\n */\n#define CURL_EXTERN CURL_EXTERN_SYMBOL\n#else\n#define CURL_EXTERN\n#endif\n#endif\n\n#ifndef curl_socket_typedef\n/* socket typedef */\n#if defined(WIN32) && !defined(__LWIP_OPT_H__)\ntypedef SOCKET curl_socket_t;\n#define CURL_SOCKET_BAD INVALID_SOCKET\n#else\ntypedef int curl_socket_t;\n#define CURL_SOCKET_BAD -1\n#endif\n#define curl_socket_typedef\n#endif /* curl_socket_typedef */\n\nstruct curl_httppost {\n  struct curl_httppost *next;       /* next entry in the list */\n  char *name;                       /* pointer to allocated name */\n  long namelength;                  /* length of name length */\n  char *contents;                   /* pointer to allocated data contents */\n  long contentslength;              /* length of contents field */\n  char *buffer;                     /* pointer to allocated buffer contents */\n  long bufferlength;                /* length of buffer field */\n  char *contenttype;                /* Content-Type */\n  struct curl_slist* contentheader; /* list of extra headers for this form */\n  struct curl_httppost *more;       /* if one field name has more than one\n                                       file, this link should link to following\n                                       files */\n  long flags;                       /* as defined below */\n#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */\n#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */\n#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */\n#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */\n#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the\n                                       regular read callback to get the data\n                                       and pass the given pointer as custom\n                                       pointer */\n\n  char *showfilename;               /* The file name to show. If not set, the\n                                       actual file name will be used (if this\n                                       is a file part) */\n  void *userp;                      /* custom pointer used for\n                                       HTTPPOST_CALLBACK posts */\n};\n\ntypedef int (*curl_progress_callback)(void *clientp,\n                                      double dltotal,\n                                      double dlnow,\n                                      double ultotal,\n                                      double ulnow);\n\n#ifndef CURL_MAX_WRITE_SIZE\n  /* Tests have proven that 20K is a very bad buffer size for uploads on\n     Windows, while 16K for some odd reason performed a lot better.\n     We do the ifndef check to allow this value to easier be changed at build\n     time for those who feel adventurous. The practical minimum is about\n     400 bytes since libcurl uses a buffer of this size as a scratch area\n     (unrelated to network send operations). */\n#define CURL_MAX_WRITE_SIZE 16384\n#endif\n\n#ifndef CURL_MAX_HTTP_HEADER\n/* The only reason to have a max limit for this is to avoid the risk of a bad\n   server feeding libcurl with a never-ending header that will cause reallocs\n   infinitely */\n#define CURL_MAX_HTTP_HEADER (100*1024)\n#endif\n\n/* This is a magic return code for the write callback that, when returned,\n   will signal libcurl to pause receiving on the current transfer. */\n#define CURL_WRITEFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_write_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *outstream);\n\n\n\n/* enumeration of file types */\ntypedef enum {\n  CURLFILETYPE_FILE = 0,\n  CURLFILETYPE_DIRECTORY,\n  CURLFILETYPE_SYMLINK,\n  CURLFILETYPE_DEVICE_BLOCK,\n  CURLFILETYPE_DEVICE_CHAR,\n  CURLFILETYPE_NAMEDPIPE,\n  CURLFILETYPE_SOCKET,\n  CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */\n\n  CURLFILETYPE_UNKNOWN /* should never occur */\n} curlfiletype;\n\n#define CURLFINFOFLAG_KNOWN_FILENAME    (1<<0)\n#define CURLFINFOFLAG_KNOWN_FILETYPE    (1<<1)\n#define CURLFINFOFLAG_KNOWN_TIME        (1<<2)\n#define CURLFINFOFLAG_KNOWN_PERM        (1<<3)\n#define CURLFINFOFLAG_KNOWN_UID         (1<<4)\n#define CURLFINFOFLAG_KNOWN_GID         (1<<5)\n#define CURLFINFOFLAG_KNOWN_SIZE        (1<<6)\n#define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1<<7)\n\n/* Content of this structure depends on information which is known and is\n   achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man\n   page for callbacks returning this structure -- some fields are mandatory,\n   some others are optional. The FLAG field has special meaning. */\nstruct curl_fileinfo {\n  char *filename;\n  curlfiletype filetype;\n  time_t time;\n  unsigned int perm;\n  int uid;\n  int gid;\n  curl_off_t size;\n  long int hardlinks;\n\n  struct {\n    /* If some of these fields is not NULL, it is a pointer to b_data. */\n    char *time;\n    char *perm;\n    char *user;\n    char *group;\n    char *target; /* pointer to the target filename of a symlink */\n  } strings;\n\n  unsigned int flags;\n\n  /* used internally */\n  char * b_data;\n  size_t b_size;\n  size_t b_used;\n};\n\n/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */\n#define CURL_CHUNK_BGN_FUNC_OK      0\n#define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */\n#define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */\n\n/* if splitting of data transfer is enabled, this callback is called before\n   download of an individual chunk started. Note that parameter \"remains\" works\n   only for FTP wildcard downloading (for now), otherwise is not used */\ntypedef long (*curl_chunk_bgn_callback)(const void *transfer_info,\n                                        void *ptr,\n                                        int remains);\n\n/* return codes for CURLOPT_CHUNK_END_FUNCTION */\n#define CURL_CHUNK_END_FUNC_OK      0\n#define CURL_CHUNK_END_FUNC_FAIL    1 /* tell the lib to end the task */\n\n/* If splitting of data transfer is enabled this callback is called after\n   download of an individual chunk finished.\n   Note! After this callback was set then it have to be called FOR ALL chunks.\n   Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.\n   This is the reason why we don't need \"transfer_info\" parameter in this\n   callback and we are not interested in \"remains\" parameter too. */\ntypedef long (*curl_chunk_end_callback)(void *ptr);\n\n/* return codes for FNMATCHFUNCTION */\n#define CURL_FNMATCHFUNC_MATCH    0 /* string corresponds to the pattern */\n#define CURL_FNMATCHFUNC_NOMATCH  1 /* pattern doesn't match the string */\n#define CURL_FNMATCHFUNC_FAIL     2 /* an error occurred */\n\n/* callback type for wildcard downloading pattern matching. If the\n   string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */\ntypedef int (*curl_fnmatch_callback)(void *ptr,\n                                     const char *pattern,\n                                     const char *string);\n\n/* These are the return codes for the seek callbacks */\n#define CURL_SEEKFUNC_OK       0\n#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */\n#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so\n                                    libcurl might try other means instead */\ntypedef int (*curl_seek_callback)(void *instream,\n                                  curl_off_t offset,\n                                  int origin); /* 'whence' */\n\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to immediately abort the current transfer. */\n#define CURL_READFUNC_ABORT 0x10000000\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to pause sending data on the current transfer. */\n#define CURL_READFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_read_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *instream);\n\ntypedef enum  {\n  CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */\n  CURLSOCKTYPE_LAST   /* never use */\n} curlsocktype;\n\n/* The return code from the sockopt_callback can signal information back\n   to libcurl: */\n#define CURL_SOCKOPT_OK 0\n#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return\n                                CURLE_ABORTED_BY_CALLBACK */\n#define CURL_SOCKOPT_ALREADY_CONNECTED 2\n\ntypedef int (*curl_sockopt_callback)(void *clientp,\n                                     curl_socket_t curlfd,\n                                     curlsocktype purpose);\n\nstruct curl_sockaddr {\n  int family;\n  int socktype;\n  int protocol;\n  unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it\n                           turned really ugly and painful on the systems that\n                           lack this type */\n  struct sockaddr addr;\n};\n\ntypedef curl_socket_t\n(*curl_opensocket_callback)(void *clientp,\n                            curlsocktype purpose,\n                            struct curl_sockaddr *address);\n\ntypedef int\n(*curl_closesocket_callback)(void *clientp, curl_socket_t item);\n\ntypedef enum {\n  CURLIOE_OK,            /* I/O operation successful */\n  CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */\n  CURLIOE_FAILRESTART,   /* failed to restart the read */\n  CURLIOE_LAST           /* never use */\n} curlioerr;\n\ntypedef enum  {\n  CURLIOCMD_NOP,         /* no operation */\n  CURLIOCMD_RESTARTREAD, /* restart the read stream from start */\n  CURLIOCMD_LAST         /* never use */\n} curliocmd;\n\ntypedef curlioerr (*curl_ioctl_callback)(CURL *handle,\n                                         int cmd,\n                                         void *clientp);\n\n/*\n * The following typedef's are signatures of malloc, free, realloc, strdup and\n * calloc respectively.  Function pointers of these types can be passed to the\n * curl_global_init_mem() function to set user defined memory management\n * callback routines.\n */\ntypedef void *(*curl_malloc_callback)(size_t size);\ntypedef void (*curl_free_callback)(void *ptr);\ntypedef void *(*curl_realloc_callback)(void *ptr, size_t size);\ntypedef char *(*curl_strdup_callback)(const char *str);\ntypedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);\n\n/* the kind of data that is passed to information_callback*/\ntypedef enum {\n  CURLINFO_TEXT = 0,\n  CURLINFO_HEADER_IN,    /* 1 */\n  CURLINFO_HEADER_OUT,   /* 2 */\n  CURLINFO_DATA_IN,      /* 3 */\n  CURLINFO_DATA_OUT,     /* 4 */\n  CURLINFO_SSL_DATA_IN,  /* 5 */\n  CURLINFO_SSL_DATA_OUT, /* 6 */\n  CURLINFO_END\n} curl_infotype;\n\ntypedef int (*curl_debug_callback)\n       (CURL *handle,      /* the handle/transfer this concerns */\n        curl_infotype type, /* what kind of data */\n        char *data,        /* points to the data */\n        size_t size,       /* size of the data pointed to */\n        void *userptr);    /* whatever the user please */\n\n/* All possible error codes from all sorts of curl functions. Future versions\n   may return other values, stay prepared.\n\n   Always add new return codes last. Never *EVER* remove any. The return\n   codes must remain the same!\n */\n\ntypedef enum {\n  CURLE_OK = 0,\n  CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */\n  CURLE_FAILED_INIT,             /* 2 */\n  CURLE_URL_MALFORMAT,           /* 3 */\n  CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for\n                                    7.17.0, reused in April 2011 for 7.21.5] */\n  CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */\n  CURLE_COULDNT_RESOLVE_HOST,    /* 6 */\n  CURLE_COULDNT_CONNECT,         /* 7 */\n  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */\n  CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server\n                                    due to lack of access - when login fails\n                                    this is not returned. */\n  CURLE_FTP_ACCEPT_FAILED,       /* 10 - [was obsoleted in April 2006 for\n                                    7.15.4, reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */\n  CURLE_FTP_ACCEPT_TIMEOUT,      /* 12 - timeout occurred accepting server\n                                    [was obsoleted in August 2007 for 7.17.0,\n                                    reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */\n  CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */\n  CURLE_FTP_CANT_GET_HOST,       /* 15 */\n  CURLE_OBSOLETE16,              /* 16 - NOT USED */\n  CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */\n  CURLE_PARTIAL_FILE,            /* 18 */\n  CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */\n  CURLE_OBSOLETE20,              /* 20 - NOT USED */\n  CURLE_QUOTE_ERROR,             /* 21 - quote command failure */\n  CURLE_HTTP_RETURNED_ERROR,     /* 22 */\n  CURLE_WRITE_ERROR,             /* 23 */\n  CURLE_OBSOLETE24,              /* 24 - NOT USED */\n  CURLE_UPLOAD_FAILED,           /* 25 - failed upload \"command\" */\n  CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */\n  CURLE_OUT_OF_MEMORY,           /* 27 */\n  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error\n           instead of a memory allocation error if CURL_DOES_CONVERSIONS\n           is defined\n  */\n  CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */\n  CURLE_OBSOLETE29,              /* 29 - NOT USED */\n  CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */\n  CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */\n  CURLE_OBSOLETE32,              /* 32 - NOT USED */\n  CURLE_RANGE_ERROR,             /* 33 - RANGE \"command\" didn't work */\n  CURLE_HTTP_POST_ERROR,         /* 34 */\n  CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */\n  CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */\n  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */\n  CURLE_LDAP_CANNOT_BIND,        /* 38 */\n  CURLE_LDAP_SEARCH_FAILED,      /* 39 */\n  CURLE_OBSOLETE40,              /* 40 - NOT USED */\n  CURLE_FUNCTION_NOT_FOUND,      /* 41 */\n  CURLE_ABORTED_BY_CALLBACK,     /* 42 */\n  CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */\n  CURLE_OBSOLETE44,              /* 44 - NOT USED */\n  CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */\n  CURLE_OBSOLETE46,              /* 46 - NOT USED */\n  CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */\n  CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */\n  CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */\n  CURLE_OBSOLETE50,              /* 50 - NOT USED */\n  CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint\n                                     wasn't verified fine */\n  CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */\n  CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */\n  CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as\n                                    default */\n  CURLE_SEND_ERROR,              /* 55 - failed sending network data */\n  CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */\n  CURLE_OBSOLETE57,              /* 57 - NOT IN USE */\n  CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */\n  CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */\n  CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */\n  CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */\n  CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */\n  CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */\n  CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */\n  CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind\n                                    that failed */\n  CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */\n  CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not\n                                    accepted and we failed to login */\n  CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */\n  CURLE_TFTP_PERM,               /* 69 - permission problem on server */\n  CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */\n  CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */\n  CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */\n  CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */\n  CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */\n  CURLE_CONV_FAILED,             /* 75 - conversion failed */\n  CURLE_CONV_REQD,               /* 76 - caller must register conversion\n                                    callbacks using curl_easy_setopt options\n                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,\n                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and\n                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */\n  CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing\n                                    or wrong format */\n  CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */\n  CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat\n                                    generic so the error message will be of\n                                    interest when this has happened */\n\n  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL\n                                    connection */\n  CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,\n                                    wait till it's ready and try again (Added\n                                    in 7.18.2) */\n  CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or\n                                    wrong format (Added in 7.19.0) */\n  CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in\n                                    7.19.0) */\n  CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */\n  CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */\n  CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */\n  CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */\n  CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */\n  CURL_LAST /* never use! */\n} CURLcode;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Previously obsoletes error codes re-used in 7.24.0 */\n#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED\n#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT\n\n/*  compatibility with older names */\n#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING\n\n/* The following were added in 7.21.5, April 2011 */\n#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION\n\n/* The following were added in 7.17.1 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION\n\n/* The following were added in 7.17.0 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */\n#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46\n#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44\n#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10\n#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16\n#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32\n#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29\n#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12\n#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20\n#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40\n#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24\n#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57\n#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN\n\n#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED\n#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE\n#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR\n#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL\n#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS\n#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR\n#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED\n\n/* The following were added earlier */\n\n#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT\n\n#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR\n#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED\n#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED\n\n#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE\n#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME\n\n/* This was the error code 50 in 7.7.3 and a few earlier versions, this\n   is no longer used by libcurl but is instead #defined here only to not\n   make programs break */\n#define CURLE_ALREADY_COMPLETE 99999\n\n#endif /*!CURL_NO_OLDIES*/\n\n/* This prototype applies to all conversion callbacks */\ntypedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);\n\ntypedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */\n                                          void *ssl_ctx, /* actually an\n                                                            OpenSSL SSL_CTX */\n                                          void *userptr);\n\ntypedef enum {\n  CURLPROXY_HTTP = 0,   /* added in 7.10, new in 7.19.4 default is to use\n                           CONNECT HTTP/1.1 */\n  CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT\n                               HTTP/1.0  */\n  CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already\n                           in 7.10 */\n  CURLPROXY_SOCKS5 = 5, /* added in 7.10 */\n  CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */\n  CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the\n                                   host name rather than the IP address. added\n                                   in 7.18.0 */\n} curl_proxytype;  /* this enum was added in 7.10 */\n\n/*\n * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:\n *\n * CURLAUTH_NONE         - No HTTP authentication\n * CURLAUTH_BASIC        - HTTP Basic authentication (default)\n * CURLAUTH_DIGEST       - HTTP Digest authentication\n * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication\n * CURLAUTH_NTLM         - HTTP NTLM authentication\n * CURLAUTH_DIGEST_IE    - HTTP Digest authentication with IE flavour\n * CURLAUTH_NTLM_WB      - HTTP NTLM authentication delegated to winbind helper\n * CURLAUTH_ONLY         - Use together with a single other type to force no\n *                         authentication or just that single type\n * CURLAUTH_ANY          - All fine types set\n * CURLAUTH_ANYSAFE      - All fine types except Basic\n */\n\n#define CURLAUTH_NONE         ((unsigned long)0)\n#define CURLAUTH_BASIC        (((unsigned long)1)<<0)\n#define CURLAUTH_DIGEST       (((unsigned long)1)<<1)\n#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)\n#define CURLAUTH_NTLM         (((unsigned long)1)<<3)\n#define CURLAUTH_DIGEST_IE    (((unsigned long)1)<<4)\n#define CURLAUTH_NTLM_WB      (((unsigned long)1)<<5)\n#define CURLAUTH_ONLY         (((unsigned long)1)<<31)\n#define CURLAUTH_ANY          (~CURLAUTH_DIGEST_IE)\n#define CURLAUTH_ANYSAFE      (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))\n\n#define CURLSSH_AUTH_ANY       ~0     /* all types supported by the server */\n#define CURLSSH_AUTH_NONE      0      /* none allowed, silly but complete */\n#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */\n#define CURLSSH_AUTH_PASSWORD  (1<<1) /* password */\n#define CURLSSH_AUTH_HOST      (1<<2) /* host key files */\n#define CURLSSH_AUTH_KEYBOARD  (1<<3) /* keyboard interactive */\n#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY\n\n#define CURLGSSAPI_DELEGATION_NONE        0      /* no delegation (default) */\n#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */\n#define CURLGSSAPI_DELEGATION_FLAG        (1<<1) /* delegate always */\n\n#define CURL_ERROR_SIZE 256\n\nstruct curl_khkey {\n  const char *key; /* points to a zero-terminated string encoded with base64\n                      if len is zero, otherwise to the \"raw\" data */\n  size_t len;\n  enum type {\n    CURLKHTYPE_UNKNOWN,\n    CURLKHTYPE_RSA1,\n    CURLKHTYPE_RSA,\n    CURLKHTYPE_DSS\n  } keytype;\n};\n\n/* this is the set of return values expected from the curl_sshkeycallback\n   callback */\nenum curl_khstat {\n  CURLKHSTAT_FINE_ADD_TO_FILE,\n  CURLKHSTAT_FINE,\n  CURLKHSTAT_REJECT, /* reject the connection, return an error */\n  CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now so\n                        this causes a CURLE_DEFER error but otherwise the\n                        connection will be left intact etc */\n  CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */\n};\n\n/* this is the set of status codes pass in to the callback */\nenum curl_khmatch {\n  CURLKHMATCH_OK,       /* match */\n  CURLKHMATCH_MISMATCH, /* host found, key mismatch! */\n  CURLKHMATCH_MISSING,  /* no matching host/key found */\n  CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */\n};\n\ntypedef int\n  (*curl_sshkeycallback) (CURL *easy,     /* easy handle */\n                          const struct curl_khkey *knownkey, /* known */\n                          const struct curl_khkey *foundkey, /* found */\n                          enum curl_khmatch, /* libcurl's view on the keys */\n                          void *clientp); /* custom pointer passed from app */\n\n/* parameter for the CURLOPT_USE_SSL option */\ntypedef enum {\n  CURLUSESSL_NONE,    /* do not attempt to use SSL */\n  CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */\n  CURLUSESSL_CONTROL, /* SSL for the control connection or fail */\n  CURLUSESSL_ALL,     /* SSL for all communication or fail */\n  CURLUSESSL_LAST     /* not an option, never use */\n} curl_usessl;\n\n/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */\n\n/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the\n   name of improving interoperability with older servers. Some SSL libraries\n   have introduced work-arounds for this flaw but those work-arounds sometimes\n   make the SSL communication fail. To regain functionality with those broken\n   servers, a user can this way allow the vulnerability back. */\n#define CURLSSLOPT_ALLOW_BEAST (1<<0)\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2009 */\n\n#define CURLFTPSSL_NONE CURLUSESSL_NONE\n#define CURLFTPSSL_TRY CURLUSESSL_TRY\n#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL\n#define CURLFTPSSL_ALL CURLUSESSL_ALL\n#define CURLFTPSSL_LAST CURLUSESSL_LAST\n#define curl_ftpssl curl_usessl\n#endif /*!CURL_NO_OLDIES*/\n\n/* parameter for the CURLOPT_FTP_SSL_CCC option */\ntypedef enum {\n  CURLFTPSSL_CCC_NONE,    /* do not send CCC */\n  CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */\n  CURLFTPSSL_CCC_ACTIVE,  /* Initiate the shutdown */\n  CURLFTPSSL_CCC_LAST     /* not an option, never use */\n} curl_ftpccc;\n\n/* parameter for the CURLOPT_FTPSSLAUTH option */\ntypedef enum {\n  CURLFTPAUTH_DEFAULT, /* let libcurl decide */\n  CURLFTPAUTH_SSL,     /* use \"AUTH SSL\" */\n  CURLFTPAUTH_TLS,     /* use \"AUTH TLS\" */\n  CURLFTPAUTH_LAST /* not an option, never use */\n} curl_ftpauth;\n\n/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */\ntypedef enum {\n  CURLFTP_CREATE_DIR_NONE,  /* do NOT create missing dirs! */\n  CURLFTP_CREATE_DIR,       /* (FTP/SFTP) if CWD fails, try MKD and then CWD\n                               again if MKD succeeded, for SFTP this does\n                               similar magic */\n  CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD\n                               again even if MKD failed! */\n  CURLFTP_CREATE_DIR_LAST   /* not an option, never use */\n} curl_ftpcreatedir;\n\n/* parameter for the CURLOPT_FTP_FILEMETHOD option */\ntypedef enum {\n  CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */\n  CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */\n  CURLFTPMETHOD_NOCWD,     /* no CWD at all */\n  CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */\n  CURLFTPMETHOD_LAST       /* not an option, never use */\n} curl_ftpmethod;\n\n/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */\n#define CURLPROTO_HTTP   (1<<0)\n#define CURLPROTO_HTTPS  (1<<1)\n#define CURLPROTO_FTP    (1<<2)\n#define CURLPROTO_FTPS   (1<<3)\n#define CURLPROTO_SCP    (1<<4)\n#define CURLPROTO_SFTP   (1<<5)\n#define CURLPROTO_TELNET (1<<6)\n#define CURLPROTO_LDAP   (1<<7)\n#define CURLPROTO_LDAPS  (1<<8)\n#define CURLPROTO_DICT   (1<<9)\n#define CURLPROTO_FILE   (1<<10)\n#define CURLPROTO_TFTP   (1<<11)\n#define CURLPROTO_IMAP   (1<<12)\n#define CURLPROTO_IMAPS  (1<<13)\n#define CURLPROTO_POP3   (1<<14)\n#define CURLPROTO_POP3S  (1<<15)\n#define CURLPROTO_SMTP   (1<<16)\n#define CURLPROTO_SMTPS  (1<<17)\n#define CURLPROTO_RTSP   (1<<18)\n#define CURLPROTO_RTMP   (1<<19)\n#define CURLPROTO_RTMPT  (1<<20)\n#define CURLPROTO_RTMPE  (1<<21)\n#define CURLPROTO_RTMPTE (1<<22)\n#define CURLPROTO_RTMPS  (1<<23)\n#define CURLPROTO_RTMPTS (1<<24)\n#define CURLPROTO_GOPHER (1<<25)\n#define CURLPROTO_ALL    (~0) /* enable everything */\n\n/* long may be 32 or 64 bits, but we should never depend on anything else\n   but 32 */\n#define CURLOPTTYPE_LONG          0\n#define CURLOPTTYPE_OBJECTPOINT   10000\n#define CURLOPTTYPE_FUNCTIONPOINT 20000\n#define CURLOPTTYPE_OFF_T         30000\n\n/* name is uppercase CURLOPT_<name>,\n   type is one of the defined CURLOPTTYPE_<type>\n   number is unique identifier */\n#ifdef CINIT\n#undef CINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLOPT_/**/name = type + number\n#endif\n\n/*\n * This macro-mania below setups the CURLOPT_[what] enum, to be used with\n * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]\n * word.\n */\n\ntypedef enum {\n  /* This is the FILE * or void * the regular output should be written to. */\n  CINIT(FILE, OBJECTPOINT, 1),\n\n  /* The full URL to get/put */\n  CINIT(URL,  OBJECTPOINT, 2),\n\n  /* Port number to connect to, if other than default. */\n  CINIT(PORT, LONG, 3),\n\n  /* Name of proxy to use. */\n  CINIT(PROXY, OBJECTPOINT, 4),\n\n  /* \"name:password\" to use when fetching. */\n  CINIT(USERPWD, OBJECTPOINT, 5),\n\n  /* \"name:password\" to use with proxy. */\n  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),\n\n  /* Range to get, specified as an ASCII string. */\n  CINIT(RANGE, OBJECTPOINT, 7),\n\n  /* not used */\n\n  /* Specified file stream to upload from (use as input): */\n  CINIT(INFILE, OBJECTPOINT, 9),\n\n  /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE\n   * bytes big. If this is not used, error messages go to stderr instead: */\n  CINIT(ERRORBUFFER, OBJECTPOINT, 10),\n\n  /* Function that will be called to store the output (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),\n\n  /* Function that will be called to read the input (instead of fread). The\n   * parameters will use fread() syntax, make sure to follow them. */\n  CINIT(READFUNCTION, FUNCTIONPOINT, 12),\n\n  /* Time-out the read operation after this amount of seconds */\n  CINIT(TIMEOUT, LONG, 13),\n\n  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about\n   * how large the file being sent really is. That allows better error\n   * checking and better verifies that the upload was successful. -1 means\n   * unknown size.\n   *\n   * For large file support, there is also a _LARGE version of the key\n   * which takes an off_t type, allowing platforms with larger off_t\n   * sizes to handle larger files.  See below for INFILESIZE_LARGE.\n   */\n  CINIT(INFILESIZE, LONG, 14),\n\n  /* POST static input fields. */\n  CINIT(POSTFIELDS, OBJECTPOINT, 15),\n\n  /* Set the referrer page (needed by some CGIs) */\n  CINIT(REFERER, OBJECTPOINT, 16),\n\n  /* Set the FTP PORT string (interface name, named or numerical IP address)\n     Use i.e '-' to use default address. */\n  CINIT(FTPPORT, OBJECTPOINT, 17),\n\n  /* Set the User-Agent string (examined by some CGIs) */\n  CINIT(USERAGENT, OBJECTPOINT, 18),\n\n  /* If the download receives less than \"low speed limit\" bytes/second\n   * during \"low speed time\" seconds, the operations is aborted.\n   * You could i.e if you have a pretty high speed connection, abort if\n   * it is less than 2000 bytes/sec during 20 seconds.\n   */\n\n  /* Set the \"low speed limit\" */\n  CINIT(LOW_SPEED_LIMIT, LONG, 19),\n\n  /* Set the \"low speed time\" */\n  CINIT(LOW_SPEED_TIME, LONG, 20),\n\n  /* Set the continuation offset.\n   *\n   * Note there is also a _LARGE version of this key which uses\n   * off_t types, allowing for large file offsets on platforms which\n   * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.\n   */\n  CINIT(RESUME_FROM, LONG, 21),\n\n  /* Set cookie in request: */\n  CINIT(COOKIE, OBJECTPOINT, 22),\n\n  /* This points to a linked list of headers, struct curl_slist kind */\n  CINIT(HTTPHEADER, OBJECTPOINT, 23),\n\n  /* This points to a linked list of post entries, struct curl_httppost */\n  CINIT(HTTPPOST, OBJECTPOINT, 24),\n\n  /* name of the file keeping your private SSL-certificate */\n  CINIT(SSLCERT, OBJECTPOINT, 25),\n\n  /* password for the SSL or SSH private key */\n  CINIT(KEYPASSWD, OBJECTPOINT, 26),\n\n  /* send TYPE parameter? */\n  CINIT(CRLF, LONG, 27),\n\n  /* send linked-list of QUOTE commands */\n  CINIT(QUOTE, OBJECTPOINT, 28),\n\n  /* send FILE * or void * to store headers to, if you use a callback it\n     is simply passed to the callback unmodified */\n  CINIT(WRITEHEADER, OBJECTPOINT, 29),\n\n  /* point to a file to read the initial cookies from, also enables\n     \"cookie awareness\" */\n  CINIT(COOKIEFILE, OBJECTPOINT, 31),\n\n  /* What version to specifically try to use.\n     See CURL_SSLVERSION defines below. */\n  CINIT(SSLVERSION, LONG, 32),\n\n  /* What kind of HTTP time condition to use, see defines */\n  CINIT(TIMECONDITION, LONG, 33),\n\n  /* Time to use with the above condition. Specified in number of seconds\n     since 1 Jan 1970 */\n  CINIT(TIMEVALUE, LONG, 34),\n\n  /* 35 = OBSOLETE */\n\n  /* Custom request, for customizing the get command like\n     HTTP: DELETE, TRACE and others\n     FTP: to use a different list command\n     */\n  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),\n\n  /* HTTP request, for odd commands like DELETE, TRACE and others */\n  CINIT(STDERR, OBJECTPOINT, 37),\n\n  /* 38 is not used */\n\n  /* send linked-list of post-transfer QUOTE commands */\n  CINIT(POSTQUOTE, OBJECTPOINT, 39),\n\n  CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */\n\n  CINIT(VERBOSE, LONG, 41),      /* talk a lot */\n  CINIT(HEADER, LONG, 42),       /* throw the header out too */\n  CINIT(NOPROGRESS, LONG, 43),   /* shut off the progress meter */\n  CINIT(NOBODY, LONG, 44),       /* use HEAD to get http document */\n  CINIT(FAILONERROR, LONG, 45),  /* no output on http error codes >= 300 */\n  CINIT(UPLOAD, LONG, 46),       /* this is an upload */\n  CINIT(POST, LONG, 47),         /* HTTP POST method */\n  CINIT(DIRLISTONLY, LONG, 48),  /* bare names when listing directories */\n\n  CINIT(APPEND, LONG, 50),       /* Append instead of overwrite on upload! */\n\n  /* Specify whether to read the user+password from the .netrc or the URL.\n   * This must be one of the CURL_NETRC_* enums below. */\n  CINIT(NETRC, LONG, 51),\n\n  CINIT(FOLLOWLOCATION, LONG, 52),  /* use Location: Luke! */\n\n  CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */\n  CINIT(PUT, LONG, 54),          /* HTTP PUT */\n\n  /* 55 = OBSOLETE */\n\n  /* Function that will be called instead of the internal progress display\n   * function. This function should be defined as the curl_progress_callback\n   * prototype defines. */\n  CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),\n\n  /* Data passed to the progress callback */\n  CINIT(PROGRESSDATA, OBJECTPOINT, 57),\n\n  /* We want the referrer field set automatically when following locations */\n  CINIT(AUTOREFERER, LONG, 58),\n\n  /* Port of the proxy, can be set in the proxy string as well with:\n     \"[host]:[port]\" */\n  CINIT(PROXYPORT, LONG, 59),\n\n  /* size of the POST input data, if strlen() is not good to use */\n  CINIT(POSTFIELDSIZE, LONG, 60),\n\n  /* tunnel non-http operations through a HTTP proxy */\n  CINIT(HTTPPROXYTUNNEL, LONG, 61),\n\n  /* Set the interface string to use as outgoing network interface */\n  CINIT(INTERFACE, OBJECTPOINT, 62),\n\n  /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This\n   * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string\n   * is set but doesn't match one of these, 'private' will be used.  */\n  CINIT(KRBLEVEL, OBJECTPOINT, 63),\n\n  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */\n  CINIT(SSL_VERIFYPEER, LONG, 64),\n\n  /* The CApath or CAfile used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAINFO, OBJECTPOINT, 65),\n\n  /* 66 = OBSOLETE */\n  /* 67 = OBSOLETE */\n\n  /* Maximum number of http redirects to follow */\n  CINIT(MAXREDIRS, LONG, 68),\n\n  /* Pass a long set to 1 to get the date of the requested document (if\n     possible)! Pass a zero to shut it off. */\n  CINIT(FILETIME, LONG, 69),\n\n  /* This points to a linked list of telnet options */\n  CINIT(TELNETOPTIONS, OBJECTPOINT, 70),\n\n  /* Max amount of cached alive connections */\n  CINIT(MAXCONNECTS, LONG, 71),\n\n  CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */\n\n  /* 73 = OBSOLETE */\n\n  /* Set to explicitly use a new connection for the upcoming transfer.\n     Do not use this unless you're absolutely sure of this, as it makes the\n     operation slower and is less friendly for the network. */\n  CINIT(FRESH_CONNECT, LONG, 74),\n\n  /* Set to explicitly forbid the upcoming transfer's connection to be re-used\n     when done. Do not use this unless you're absolutely sure of this, as it\n     makes the operation slower and is less friendly for the network. */\n  CINIT(FORBID_REUSE, LONG, 75),\n\n  /* Set to a file name that contains random data for libcurl to use to\n     seed the random engine when doing SSL connects. */\n  CINIT(RANDOM_FILE, OBJECTPOINT, 76),\n\n  /* Set to the Entropy Gathering Daemon socket pathname */\n  CINIT(EGDSOCKET, OBJECTPOINT, 77),\n\n  /* Time-out connect operations after this amount of seconds, if connects\n     are OK within this time, then fine... This only aborts the connect\n     phase. [Only works on unix-style/SIGALRM operating systems] */\n  CINIT(CONNECTTIMEOUT, LONG, 78),\n\n  /* Function that will be called to store headers (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),\n\n  /* Set this to force the HTTP request to get back to GET. Only really usable\n     if POST, PUT or a custom request have been used first.\n   */\n  CINIT(HTTPGET, LONG, 80),\n\n  /* Set if we should verify the Common name from the peer certificate in ssl\n   * handshake, set 1 to check existence, 2 to ensure that it matches the\n   * provided hostname. */\n  CINIT(SSL_VERIFYHOST, LONG, 81),\n\n  /* Specify which file name to write all known cookies in after completed\n     operation. Set file name to \"-\" (dash) to make it go to stdout. */\n  CINIT(COOKIEJAR, OBJECTPOINT, 82),\n\n  /* Specify which SSL ciphers to use */\n  CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),\n\n  /* Specify which HTTP version to use! This must be set to one of the\n     CURL_HTTP_VERSION* enums set below. */\n  CINIT(HTTP_VERSION, LONG, 84),\n\n  /* Specifically switch on or off the FTP engine's use of the EPSV command. By\n     default, that one will always be attempted before the more traditional\n     PASV command. */\n  CINIT(FTP_USE_EPSV, LONG, 85),\n\n  /* type of the file keeping your SSL-certificate (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLCERTTYPE, OBJECTPOINT, 86),\n\n  /* name of the file keeping your private SSL-key */\n  CINIT(SSLKEY, OBJECTPOINT, 87),\n\n  /* type of the file keeping your private SSL-key (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLKEYTYPE, OBJECTPOINT, 88),\n\n  /* crypto engine for the SSL-sub system */\n  CINIT(SSLENGINE, OBJECTPOINT, 89),\n\n  /* set the crypto engine for the SSL-sub system as default\n     the param has no meaning...\n   */\n  CINIT(SSLENGINE_DEFAULT, LONG, 90),\n\n  /* Non-zero value means to use the global dns cache */\n  CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */\n\n  /* DNS cache timeout */\n  CINIT(DNS_CACHE_TIMEOUT, LONG, 92),\n\n  /* send linked-list of pre-transfer QUOTE commands */\n  CINIT(PREQUOTE, OBJECTPOINT, 93),\n\n  /* set the debug function */\n  CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),\n\n  /* set the data for the debug function */\n  CINIT(DEBUGDATA, OBJECTPOINT, 95),\n\n  /* mark this as start of a cookie session */\n  CINIT(COOKIESESSION, LONG, 96),\n\n  /* The CApath directory used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAPATH, OBJECTPOINT, 97),\n\n  /* Instruct libcurl to use a smaller receive buffer */\n  CINIT(BUFFERSIZE, LONG, 98),\n\n  /* Instruct libcurl to not use any signal/alarm handlers, even when using\n     timeouts. This option is useful for multi-threaded applications.\n     See libcurl-the-guide for more background information. */\n  CINIT(NOSIGNAL, LONG, 99),\n\n  /* Provide a CURLShare for mutexing non-ts data */\n  CINIT(SHARE, OBJECTPOINT, 100),\n\n  /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),\n     CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */\n  CINIT(PROXYTYPE, LONG, 101),\n\n  /* Set the Accept-Encoding string. Use this to tell a server you would like\n     the response to be compressed. Before 7.21.6, this was known as\n     CURLOPT_ENCODING */\n  CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),\n\n  /* Set pointer to private data */\n  CINIT(PRIVATE, OBJECTPOINT, 103),\n\n  /* Set aliases for HTTP 200 in the HTTP Response header */\n  CINIT(HTTP200ALIASES, OBJECTPOINT, 104),\n\n  /* Continue to send authentication (user+password) when following locations,\n     even when hostname changed. This can potentially send off the name\n     and password to whatever host the server decides. */\n  CINIT(UNRESTRICTED_AUTH, LONG, 105),\n\n  /* Specifically switch on or off the FTP engine's use of the EPRT command (\n     it also disables the LPRT attempt). By default, those ones will always be\n     attempted before the good old traditional PORT command. */\n  CINIT(FTP_USE_EPRT, LONG, 106),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_USERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(HTTPAUTH, LONG, 107),\n\n  /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx\n     in second argument. The function must be matching the\n     curl_ssl_ctx_callback proto. */\n  CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),\n\n  /* Set the userdata for the ssl context callback function's third\n     argument */\n  CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),\n\n  /* FTP Option that causes missing dirs to be created on the remote server.\n     In 7.19.4 we introduced the convenience enums for this option using the\n     CURLFTP_CREATE_DIR prefix.\n  */\n  CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(PROXYAUTH, LONG, 111),\n\n  /* FTP option that changes the timeout, in seconds, associated with\n     getting a response.  This is different from transfer timeout time and\n     essentially places a demand on the FTP server to acknowledge commands\n     in a timely manner. */\n  CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),\n#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT\n\n  /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to\n     tell libcurl to resolve names to those IP versions only. This only has\n     affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */\n  CINIT(IPRESOLVE, LONG, 113),\n\n  /* Set this option to limit the size of a file that will be downloaded from\n     an HTTP or FTP server.\n\n     Note there is also _LARGE version which adds large file support for\n     platforms which have larger off_t sizes.  See MAXFILESIZE_LARGE below. */\n  CINIT(MAXFILESIZE, LONG, 114),\n\n  /* See the comment for INFILESIZE above, but in short, specifies\n   * the size of the file being uploaded.  -1 means unknown.\n   */\n  CINIT(INFILESIZE_LARGE, OFF_T, 115),\n\n  /* Sets the continuation offset.  There is also a LONG version of this;\n   * look above for RESUME_FROM.\n   */\n  CINIT(RESUME_FROM_LARGE, OFF_T, 116),\n\n  /* Sets the maximum size of data that will be downloaded from\n   * an HTTP or FTP server.  See MAXFILESIZE above for the LONG version.\n   */\n  CINIT(MAXFILESIZE_LARGE, OFF_T, 117),\n\n  /* Set this option to the file name of your .netrc file you want libcurl\n     to parse (using the CURLOPT_NETRC option). If not set, libcurl will do\n     a poor attempt to find the user's home directory and check for a .netrc\n     file in there. */\n  CINIT(NETRC_FILE, OBJECTPOINT, 118),\n\n  /* Enable SSL/TLS for FTP, pick one of:\n     CURLFTPSSL_TRY     - try using SSL, proceed anyway otherwise\n     CURLFTPSSL_CONTROL - SSL for the control connection or fail\n     CURLFTPSSL_ALL     - SSL for all communication or fail\n  */\n  CINIT(USE_SSL, LONG, 119),\n\n  /* The _LARGE version of the standard POSTFIELDSIZE option */\n  CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),\n\n  /* Enable/disable the TCP Nagle algorithm */\n  CINIT(TCP_NODELAY, LONG, 121),\n\n  /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 123 OBSOLETE. Gone in 7.16.0 */\n  /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 127 OBSOLETE. Gone in 7.16.0 */\n  /* 128 OBSOLETE. Gone in 7.16.0 */\n\n  /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option\n     can be used to change libcurl's default action which is to first try\n     \"AUTH SSL\" and then \"AUTH TLS\" in this order, and proceed when a OK\n     response has been received.\n\n     Available parameters are:\n     CURLFTPAUTH_DEFAULT - let libcurl decide\n     CURLFTPAUTH_SSL     - try \"AUTH SSL\" first, then TLS\n     CURLFTPAUTH_TLS     - try \"AUTH TLS\" first, then SSL\n  */\n  CINIT(FTPSSLAUTH, LONG, 129),\n\n  CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),\n  CINIT(IOCTLDATA, OBJECTPOINT, 131),\n\n  /* 132 OBSOLETE. Gone in 7.16.0 */\n  /* 133 OBSOLETE. Gone in 7.16.0 */\n\n  /* zero terminated string for pass on to the FTP server when asked for\n     \"account\" info */\n  CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),\n\n  /* feed cookies into cookie engine */\n  CINIT(COOKIELIST, OBJECTPOINT, 135),\n\n  /* ignore Content-Length */\n  CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),\n\n  /* Set to non-zero to skip the IP address received in a 227 PASV FTP server\n     response. Typically used for FTP-SSL purposes but is not restricted to\n     that. libcurl will then instead use the same IP address it used for the\n     control connection. */\n  CINIT(FTP_SKIP_PASV_IP, LONG, 137),\n\n  /* Select \"file method\" to use when doing FTP, see the curl_ftpmethod\n     above. */\n  CINIT(FTP_FILEMETHOD, LONG, 138),\n\n  /* Local port number to bind the socket to */\n  CINIT(LOCALPORT, LONG, 139),\n\n  /* Number of ports to try, including the first one set with LOCALPORT.\n     Thus, setting it to 1 will make no additional attempts but the first.\n  */\n  CINIT(LOCALPORTRANGE, LONG, 140),\n\n  /* no transfer, set up connection and let application use the socket by\n     extracting it with CURLINFO_LASTSOCKET */\n  CINIT(CONNECT_ONLY, LONG, 141),\n\n  /* Function that will be called to convert from the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),\n\n  /* Function that will be called to convert to the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),\n\n  /* Function that will be called to convert from UTF8\n     (instead of using the iconv calls in libcurl)\n     Note that this is used only for SSL certificate processing */\n  CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),\n\n  /* if the connection proceeds too quickly then need to slow it down */\n  /* limit-rate: maximum number of bytes per second to send or receive */\n  CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),\n  CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),\n\n  /* Pointer to command string to send if USER/PASS fails. */\n  CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),\n\n  /* callback function for setting socket options */\n  CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),\n  CINIT(SOCKOPTDATA, OBJECTPOINT, 149),\n\n  /* set to 0 to disable session ID re-use for this transfer, default is\n     enabled (== 1) */\n  CINIT(SSL_SESSIONID_CACHE, LONG, 150),\n\n  /* allowed SSH authentication methods */\n  CINIT(SSH_AUTH_TYPES, LONG, 151),\n\n  /* Used by scp/sftp to do public/private key authentication */\n  CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),\n  CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),\n\n  /* Send CCC (Clear Command Channel) after authentication */\n  CINIT(FTP_SSL_CCC, LONG, 154),\n\n  /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */\n  CINIT(TIMEOUT_MS, LONG, 155),\n  CINIT(CONNECTTIMEOUT_MS, LONG, 156),\n\n  /* set to zero to disable the libcurl's decoding and thus pass the raw body\n     data to the application even when it is encoded/compressed */\n  CINIT(HTTP_TRANSFER_DECODING, LONG, 157),\n  CINIT(HTTP_CONTENT_DECODING, LONG, 158),\n\n  /* Permission used when creating new files and directories on the remote\n     server for protocols that support it, SFTP/SCP/FILE */\n  CINIT(NEW_FILE_PERMS, LONG, 159),\n  CINIT(NEW_DIRECTORY_PERMS, LONG, 160),\n\n  /* Set the behaviour of POST when redirecting. Values must be set to one\n     of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */\n  CINIT(POSTREDIR, LONG, 161),\n\n  /* used by scp/sftp to verify the host's public key */\n  CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),\n\n  /* Callback function for opening socket (instead of socket(2)). Optionally,\n     callback is able change the address or refuse to connect returning\n     CURL_SOCKET_BAD.  The callback should have type\n     curl_opensocket_callback */\n  CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),\n  CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),\n\n  /* POST volatile input fields. */\n  CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),\n\n  /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */\n  CINIT(PROXY_TRANSFER_MODE, LONG, 166),\n\n  /* Callback function for seeking in the input stream */\n  CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),\n  CINIT(SEEKDATA, OBJECTPOINT, 168),\n\n  /* CRL file */\n  CINIT(CRLFILE, OBJECTPOINT, 169),\n\n  /* Issuer certificate */\n  CINIT(ISSUERCERT, OBJECTPOINT, 170),\n\n  /* (IPv6) Address scope */\n  CINIT(ADDRESS_SCOPE, LONG, 171),\n\n  /* Collect certificate chain info and allow it to get retrievable with\n     CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only\n     working with OpenSSL-powered builds. */\n  CINIT(CERTINFO, LONG, 172),\n\n  /* \"name\" and \"pwd\" to use when fetching. */\n  CINIT(USERNAME, OBJECTPOINT, 173),\n  CINIT(PASSWORD, OBJECTPOINT, 174),\n\n    /* \"name\" and \"pwd\" to use with Proxy when fetching. */\n  CINIT(PROXYUSERNAME, OBJECTPOINT, 175),\n  CINIT(PROXYPASSWORD, OBJECTPOINT, 176),\n\n  /* Comma separated list of hostnames defining no-proxy zones. These should\n     match both hostnames directly, and hostnames within a domain. For\n     example, local.com will match local.com and www.local.com, but NOT\n     notlocal.com or www.notlocal.com. For compatibility with other\n     implementations of this, .local.com will be considered to be the same as\n     local.com. A single * is the only valid wildcard, and effectively\n     disables the use of proxy. */\n  CINIT(NOPROXY, OBJECTPOINT, 177),\n\n  /* block size for TFTP transfers */\n  CINIT(TFTP_BLKSIZE, LONG, 178),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),\n\n  /* set the bitmask for the protocols that are allowed to be used for the\n     transfer, which thus helps the app which takes URLs from users or other\n     external inputs and want to restrict what protocol(s) to deal\n     with. Defaults to CURLPROTO_ALL. */\n  CINIT(PROTOCOLS, LONG, 181),\n\n  /* set the bitmask for the protocols that libcurl is allowed to follow to,\n     as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs\n     to be set in both bitmasks to be allowed to get redirected to. Defaults\n     to all protocols except FILE and SCP. */\n  CINIT(REDIR_PROTOCOLS, LONG, 182),\n\n  /* set the SSH knownhost file name to use */\n  CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),\n\n  /* set the SSH host key callback, must point to a curl_sshkeycallback\n     function */\n  CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),\n\n  /* set the SSH host key callback custom pointer */\n  CINIT(SSH_KEYDATA, OBJECTPOINT, 185),\n\n  /* set the SMTP mail originator */\n  CINIT(MAIL_FROM, OBJECTPOINT, 186),\n\n  /* set the SMTP mail receiver(s) */\n  CINIT(MAIL_RCPT, OBJECTPOINT, 187),\n\n  /* FTP: send PRET before PASV */\n  CINIT(FTP_USE_PRET, LONG, 188),\n\n  /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */\n  CINIT(RTSP_REQUEST, LONG, 189),\n\n  /* The RTSP session identifier */\n  CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190),\n\n  /* The RTSP stream URI */\n  CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191),\n\n  /* The Transport: header to use in RTSP requests */\n  CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192),\n\n  /* Manually initialize the client RTSP CSeq for this handle */\n  CINIT(RTSP_CLIENT_CSEQ, LONG, 193),\n\n  /* Manually initialize the server RTSP CSeq for this handle */\n  CINIT(RTSP_SERVER_CSEQ, LONG, 194),\n\n  /* The stream to pass to INTERLEAVEFUNCTION. */\n  CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),\n\n  /* Let the application define a custom write method for RTP data */\n  CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),\n\n  /* Turn on wildcard matching */\n  CINIT(WILDCARDMATCH, LONG, 197),\n\n  /* Directory matching callback called before downloading of an\n     individual file (chunk) started */\n  CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),\n\n  /* Directory matching callback called after the file (chunk)\n     was downloaded, or skipped */\n  CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),\n\n  /* Change match (fnmatch-like) callback for wildcard matching */\n  CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),\n\n  /* Let the application define custom chunk data pointer */\n  CINIT(CHUNK_DATA, OBJECTPOINT, 201),\n\n  /* FNMATCH_FUNCTION user pointer */\n  CINIT(FNMATCH_DATA, OBJECTPOINT, 202),\n\n  /* send linked-list of name:port:address sets */\n  CINIT(RESOLVE, OBJECTPOINT, 203),\n\n  /* Set a username for authenticated TLS */\n  CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204),\n\n  /* Set a password for authenticated TLS */\n  CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205),\n\n  /* Set authentication type for authenticated TLS */\n  CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),\n\n  /* Set to 1 to enable the \"TE:\" header in HTTP requests to ask for\n     compressed transfer-encoded responses. Set to 0 to disable the use of TE:\n     in outgoing requests. The current default is 0, but it might change in a\n     future libcurl release.\n\n     libcurl will ask for the compressed methods it knows of, and if that\n     isn't any, it will not ask for transfer-encoding at all even if this\n     option is set to 1.\n\n  */\n  CINIT(TRANSFER_ENCODING, LONG, 207),\n\n  /* Callback function for closing socket (instead of close(2)). The callback\n     should have type curl_closesocket_callback */\n  CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),\n  CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),\n\n  /* allow GSSAPI credential delegation */\n  CINIT(GSSAPI_DELEGATION, LONG, 210),\n\n  /* Set the name servers to use for DNS resolution */\n  CINIT(DNS_SERVERS, OBJECTPOINT, 211),\n\n  /* Time-out accept operations (currently for FTP only) after this amount\n     of miliseconds. */\n  CINIT(ACCEPTTIMEOUT_MS, LONG, 212),\n\n  /* Set TCP keepalive */\n  CINIT(TCP_KEEPALIVE, LONG, 213),\n\n  /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */\n  CINIT(TCP_KEEPIDLE, LONG, 214),\n  CINIT(TCP_KEEPINTVL, LONG, 215),\n\n  /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */\n  CINIT(SSL_OPTIONS, LONG, 216),\n\n  /* set the SMTP auth originator */\n  CINIT(MAIL_AUTH, OBJECTPOINT, 217),\n\n  CURLOPT_LASTENTRY /* the last unused */\n} CURLoption;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2011 */\n\n/* This was added in version 7.19.1 */\n#define CURLOPT_POST301 CURLOPT_POSTREDIR\n\n/* These are scheduled to disappear by 2009 */\n\n/* The following were added in 7.17.0 */\n#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_FTPAPPEND CURLOPT_APPEND\n#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY\n#define CURLOPT_FTP_SSL CURLOPT_USE_SSL\n\n/* The following were added earlier */\n\n#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL\n\n#else\n/* This is set if CURL_NO_OLDIES is defined at compile-time */\n#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */\n#endif\n\n\n  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host\n     name resolves addresses using more than one IP protocol version, this\n     option might be handy to force libcurl to use a specific IP version. */\n#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP\n                                     versions that your system allows */\n#define CURL_IPRESOLVE_V4       1 /* resolve to ipv4 addresses */\n#define CURL_IPRESOLVE_V6       2 /* resolve to ipv6 addresses */\n\n  /* three convenient \"aliases\" that follow the name scheme better */\n#define CURLOPT_WRITEDATA CURLOPT_FILE\n#define CURLOPT_READDATA  CURLOPT_INFILE\n#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER\n#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER\n\n  /* These enums are for use with the CURLOPT_HTTP_VERSION option. */\nenum {\n  CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd\n                             like the library to choose the best possible\n                             for us! */\n  CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */\n  CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */\n\n  CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */\n};\n\n/*\n * Public API enums for RTSP requests\n */\nenum {\n    CURL_RTSPREQ_NONE, /* first in list */\n    CURL_RTSPREQ_OPTIONS,\n    CURL_RTSPREQ_DESCRIBE,\n    CURL_RTSPREQ_ANNOUNCE,\n    CURL_RTSPREQ_SETUP,\n    CURL_RTSPREQ_PLAY,\n    CURL_RTSPREQ_PAUSE,\n    CURL_RTSPREQ_TEARDOWN,\n    CURL_RTSPREQ_GET_PARAMETER,\n    CURL_RTSPREQ_SET_PARAMETER,\n    CURL_RTSPREQ_RECORD,\n    CURL_RTSPREQ_RECEIVE,\n    CURL_RTSPREQ_LAST /* last in list */\n};\n\n  /* These enums are for use with the CURLOPT_NETRC option. */\nenum CURL_NETRC_OPTION {\n  CURL_NETRC_IGNORED,     /* The .netrc will never be read.\n                           * This is the default. */\n  CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred\n                           * to one in the .netrc. */\n  CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.\n                           * Unless one is set programmatically, the .netrc\n                           * will be queried. */\n  CURL_NETRC_LAST\n};\n\nenum {\n  CURL_SSLVERSION_DEFAULT,\n  CURL_SSLVERSION_TLSv1,\n  CURL_SSLVERSION_SSLv2,\n  CURL_SSLVERSION_SSLv3,\n\n  CURL_SSLVERSION_LAST /* never use, keep last */\n};\n\nenum CURL_TLSAUTH {\n  CURL_TLSAUTH_NONE,\n  CURL_TLSAUTH_SRP,\n  CURL_TLSAUTH_LAST /* never use, keep last */\n};\n\n/* symbols to use with CURLOPT_POSTREDIR.\n   CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303\n   can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302\n   | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */\n\n#define CURL_REDIR_GET_ALL  0\n#define CURL_REDIR_POST_301 1\n#define CURL_REDIR_POST_302 2\n#define CURL_REDIR_POST_303 4\n#define CURL_REDIR_POST_ALL \\\n    (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)\n\ntypedef enum {\n  CURL_TIMECOND_NONE,\n\n  CURL_TIMECOND_IFMODSINCE,\n  CURL_TIMECOND_IFUNMODSINCE,\n  CURL_TIMECOND_LASTMOD,\n\n  CURL_TIMECOND_LAST\n} curl_TimeCond;\n\n\n/* curl_strequal() and curl_strnequal() are subject for removal in a future\n   libcurl, see lib/README.curlx for details */\nCURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);\nCURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);\n\n/* name is uppercase CURLFORM_<name> */\n#ifdef CFINIT\n#undef CFINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CFINIT(name) CURLFORM_ ## name\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define CFINIT(name) CURLFORM_/**/name\n#endif\n\ntypedef enum {\n  CFINIT(NOTHING),        /********* the first one is unused ************/\n\n  /*  */\n  CFINIT(COPYNAME),\n  CFINIT(PTRNAME),\n  CFINIT(NAMELENGTH),\n  CFINIT(COPYCONTENTS),\n  CFINIT(PTRCONTENTS),\n  CFINIT(CONTENTSLENGTH),\n  CFINIT(FILECONTENT),\n  CFINIT(ARRAY),\n  CFINIT(OBSOLETE),\n  CFINIT(FILE),\n\n  CFINIT(BUFFER),\n  CFINIT(BUFFERPTR),\n  CFINIT(BUFFERLENGTH),\n\n  CFINIT(CONTENTTYPE),\n  CFINIT(CONTENTHEADER),\n  CFINIT(FILENAME),\n  CFINIT(END),\n  CFINIT(OBSOLETE2),\n\n  CFINIT(STREAM),\n\n  CURLFORM_LASTENTRY /* the last unused */\n} CURLformoption;\n\n#undef CFINIT /* done */\n\n/* structure to be used as parameter for CURLFORM_ARRAY */\nstruct curl_forms {\n  CURLformoption option;\n  const char     *value;\n};\n\n/* use this for multipart formpost building */\n/* Returns code for curl_formadd()\n *\n * Returns:\n * CURL_FORMADD_OK             on success\n * CURL_FORMADD_MEMORY         if the FormInfo allocation fails\n * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form\n * CURL_FORMADD_NULL           if a null pointer was given for a char\n * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed\n * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used\n * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)\n * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated\n * CURL_FORMADD_MEMORY         if some allocation for string copying failed.\n * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array\n *\n ***************************************************************************/\ntypedef enum {\n  CURL_FORMADD_OK, /* first, no error */\n\n  CURL_FORMADD_MEMORY,\n  CURL_FORMADD_OPTION_TWICE,\n  CURL_FORMADD_NULL,\n  CURL_FORMADD_UNKNOWN_OPTION,\n  CURL_FORMADD_INCOMPLETE,\n  CURL_FORMADD_ILLEGAL_ARRAY,\n  CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */\n\n  CURL_FORMADD_LAST /* last */\n} CURLFORMcode;\n\n/*\n * NAME curl_formadd()\n *\n * DESCRIPTION\n *\n * Pretty advanced function for building multi-part formposts. Each invoke\n * adds one part that together construct a full post. Then use\n * CURLOPT_HTTPPOST to send it off to libcurl.\n */\nCURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,\n                                      struct curl_httppost **last_post,\n                                      ...);\n\n/*\n * callback function for curl_formget()\n * The void *arg pointer will be the one passed as second argument to\n *   curl_formget().\n * The character buffer passed to it must not be freed.\n * Should return the buffer length passed to it as the argument \"len\" on\n *   success.\n */\ntypedef size_t (*curl_formget_callback)(void *arg, const char *buf,\n                                        size_t len);\n\n/*\n * NAME curl_formget()\n *\n * DESCRIPTION\n *\n * Serialize a curl_httppost struct built with curl_formadd().\n * Accepts a void pointer as second argument which will be passed to\n * the curl_formget_callback function.\n * Returns 0 on success.\n */\nCURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,\n                             curl_formget_callback append);\n/*\n * NAME curl_formfree()\n *\n * DESCRIPTION\n *\n * Free a multipart formpost previously built with curl_formadd().\n */\nCURL_EXTERN void curl_formfree(struct curl_httppost *form);\n\n/*\n * NAME curl_getenv()\n *\n * DESCRIPTION\n *\n * Returns a malloc()'ed string that MUST be curl_free()ed after usage is\n * complete. DEPRECATED - see lib/README.curlx\n */\nCURL_EXTERN char *curl_getenv(const char *variable);\n\n/*\n * NAME curl_version()\n *\n * DESCRIPTION\n *\n * Returns a static ascii string of the libcurl version.\n */\nCURL_EXTERN char *curl_version(void);\n\n/*\n * NAME curl_easy_escape()\n *\n * DESCRIPTION\n *\n * Escapes URL strings (converts all letters consider illegal in URLs to their\n * %XX versions). This function returns a new allocated string or NULL if an\n * error occurred.\n */\nCURL_EXTERN char *curl_easy_escape(CURL *handle,\n                                   const char *string,\n                                   int length);\n\n/* the previous version: */\nCURL_EXTERN char *curl_escape(const char *string,\n                              int length);\n\n\n/*\n * NAME curl_easy_unescape()\n *\n * DESCRIPTION\n *\n * Unescapes URL encoding in strings (converts all %XX codes to their 8bit\n * versions). This function returns a new allocated string or NULL if an error\n * occurred.\n * Conversion Note: On non-ASCII platforms the ASCII %XX codes are\n * converted into the host encoding.\n */\nCURL_EXTERN char *curl_easy_unescape(CURL *handle,\n                                     const char *string,\n                                     int length,\n                                     int *outlength);\n\n/* the previous version */\nCURL_EXTERN char *curl_unescape(const char *string,\n                                int length);\n\n/*\n * NAME curl_free()\n *\n * DESCRIPTION\n *\n * Provided for de-allocation in the same translation unit that did the\n * allocation. Added in libcurl 7.10\n */\nCURL_EXTERN void curl_free(void *p);\n\n/*\n * NAME curl_global_init()\n *\n * DESCRIPTION\n *\n * curl_global_init() should be invoked exactly once for each application that\n * uses libcurl and before any call of other libcurl functions.\n *\n * This function is not thread-safe!\n */\nCURL_EXTERN CURLcode curl_global_init(long flags);\n\n/*\n * NAME curl_global_init_mem()\n *\n * DESCRIPTION\n *\n * curl_global_init() or curl_global_init_mem() should be invoked exactly once\n * for each application that uses libcurl.  This function can be used to\n * initialize libcurl and set user defined memory management callback\n * functions.  Users can implement memory management routines to check for\n * memory leaks, check for mis-use of the curl library etc.  User registered\n * callback routines with be invoked by this library instead of the system\n * memory management routines like malloc, free etc.\n */\nCURL_EXTERN CURLcode curl_global_init_mem(long flags,\n                                          curl_malloc_callback m,\n                                          curl_free_callback f,\n                                          curl_realloc_callback r,\n                                          curl_strdup_callback s,\n                                          curl_calloc_callback c);\n\n/*\n * NAME curl_global_cleanup()\n *\n * DESCRIPTION\n *\n * curl_global_cleanup() should be invoked exactly once for each application\n * that uses libcurl\n */\nCURL_EXTERN void curl_global_cleanup(void);\n\n/* linked-list structure for the CURLOPT_QUOTE option (and other) */\nstruct curl_slist {\n  char *data;\n  struct curl_slist *next;\n};\n\n/*\n * NAME curl_slist_append()\n *\n * DESCRIPTION\n *\n * Appends a string to a linked list. If no list exists, it will be created\n * first. Returns the new list, after appending.\n */\nCURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,\n                                                 const char *);\n\n/*\n * NAME curl_slist_free_all()\n *\n * DESCRIPTION\n *\n * free a previously built curl_slist.\n */\nCURL_EXTERN void curl_slist_free_all(struct curl_slist *);\n\n/*\n * NAME curl_getdate()\n *\n * DESCRIPTION\n *\n * Returns the time, in seconds since 1 Jan 1970 of the time string given in\n * the first argument. The time argument in the second parameter is unused\n * and should be set to NULL.\n */\nCURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);\n\n/* info about the certificate chain, only for OpenSSL builds. Asked\n   for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */\nstruct curl_certinfo {\n  int num_of_certs;             /* number of certificates with information */\n  struct curl_slist **certinfo; /* for each index in this array, there's a\n                                   linked list with textual information in the\n                                   format \"name: value\" */\n};\n\n#define CURLINFO_STRING   0x100000\n#define CURLINFO_LONG     0x200000\n#define CURLINFO_DOUBLE   0x300000\n#define CURLINFO_SLIST    0x400000\n#define CURLINFO_MASK     0x0fffff\n#define CURLINFO_TYPEMASK 0xf00000\n\ntypedef enum {\n  CURLINFO_NONE, /* first, never use this */\n  CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,\n  CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,\n  CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,\n  CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,\n  CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,\n  CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,\n  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,\n  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,\n  CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,\n  CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,\n  CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,\n  CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,\n  CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,\n  CURLINFO_FILETIME         = CURLINFO_LONG   + 14,\n  CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,\n  CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,\n  CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,\n  CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,\n  CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,\n  CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,\n  CURLINFO_PRIVATE          = CURLINFO_STRING + 21,\n  CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,\n  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,\n  CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,\n  CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,\n  CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,\n  CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,\n  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,\n  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,\n  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,\n  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,\n  CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,\n  CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,\n  CURLINFO_CERTINFO         = CURLINFO_SLIST  + 34,\n  CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,\n  CURLINFO_RTSP_SESSION_ID  = CURLINFO_STRING + 36,\n  CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG   + 37,\n  CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG   + 38,\n  CURLINFO_RTSP_CSEQ_RECV   = CURLINFO_LONG   + 39,\n  CURLINFO_PRIMARY_PORT     = CURLINFO_LONG   + 40,\n  CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,\n  CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,\n  /* Fill in new entries below here! */\n\n  CURLINFO_LASTONE          = 42\n} CURLINFO;\n\n/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as\n   CURLINFO_HTTP_CODE */\n#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE\n\ntypedef enum {\n  CURLCLOSEPOLICY_NONE, /* first, never use this */\n\n  CURLCLOSEPOLICY_OLDEST,\n  CURLCLOSEPOLICY_LEAST_RECENTLY_USED,\n  CURLCLOSEPOLICY_LEAST_TRAFFIC,\n  CURLCLOSEPOLICY_SLOWEST,\n  CURLCLOSEPOLICY_CALLBACK,\n\n  CURLCLOSEPOLICY_LAST /* last, never use this */\n} curl_closepolicy;\n\n#define CURL_GLOBAL_SSL (1<<0)\n#define CURL_GLOBAL_WIN32 (1<<1)\n#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)\n#define CURL_GLOBAL_NOTHING 0\n#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL\n\n\n/*****************************************************************************\n * Setup defines, protos etc for the sharing stuff.\n */\n\n/* Different data locks for a single share */\ntypedef enum {\n  CURL_LOCK_DATA_NONE = 0,\n  /*  CURL_LOCK_DATA_SHARE is used internally to say that\n   *  the locking is just made to change the internal state of the share\n   *  itself.\n   */\n  CURL_LOCK_DATA_SHARE,\n  CURL_LOCK_DATA_COOKIE,\n  CURL_LOCK_DATA_DNS,\n  CURL_LOCK_DATA_SSL_SESSION,\n  CURL_LOCK_DATA_CONNECT,\n  CURL_LOCK_DATA_LAST\n} curl_lock_data;\n\n/* Different lock access types */\ntypedef enum {\n  CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */\n  CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */\n  CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */\n  CURL_LOCK_ACCESS_LAST        /* never use */\n} curl_lock_access;\n\ntypedef void (*curl_lock_function)(CURL *handle,\n                                   curl_lock_data data,\n                                   curl_lock_access locktype,\n                                   void *userptr);\ntypedef void (*curl_unlock_function)(CURL *handle,\n                                     curl_lock_data data,\n                                     void *userptr);\n\ntypedef void CURLSH;\n\ntypedef enum {\n  CURLSHE_OK,  /* all is fine */\n  CURLSHE_BAD_OPTION, /* 1 */\n  CURLSHE_IN_USE,     /* 2 */\n  CURLSHE_INVALID,    /* 3 */\n  CURLSHE_NOMEM,      /* 4 out of memory */\n  CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */\n  CURLSHE_LAST        /* never use */\n} CURLSHcode;\n\ntypedef enum {\n  CURLSHOPT_NONE,  /* don't use */\n  CURLSHOPT_SHARE,   /* specify a data type to share */\n  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */\n  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */\n  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */\n  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock\n                           callback functions */\n  CURLSHOPT_LAST  /* never use */\n} CURLSHoption;\n\nCURL_EXTERN CURLSH *curl_share_init(void);\nCURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);\nCURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);\n\n/****************************************************************************\n * Structures for querying information about the curl library at runtime.\n */\n\ntypedef enum {\n  CURLVERSION_FIRST,\n  CURLVERSION_SECOND,\n  CURLVERSION_THIRD,\n  CURLVERSION_FOURTH,\n  CURLVERSION_LAST /* never actually use this */\n} CURLversion;\n\n/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by\n   basically all programs ever that want to get version information. It is\n   meant to be a built-in version number for what kind of struct the caller\n   expects. If the struct ever changes, we redefine the NOW to another enum\n   from above. */\n#define CURLVERSION_NOW CURLVERSION_FOURTH\n\ntypedef struct {\n  CURLversion age;          /* age of the returned struct */\n  const char *version;      /* LIBCURL_VERSION */\n  unsigned int version_num; /* LIBCURL_VERSION_NUM */\n  const char *host;         /* OS/host/cpu/machine when configured */\n  int features;             /* bitmask, see defines below */\n  const char *ssl_version;  /* human readable string */\n  long ssl_version_num;     /* not used anymore, always 0 */\n  const char *libz_version; /* human readable string */\n  /* protocols is terminated by an entry with a NULL protoname */\n  const char * const *protocols;\n\n  /* The fields below this were added in CURLVERSION_SECOND */\n  const char *ares;\n  int ares_num;\n\n  /* This field was added in CURLVERSION_THIRD */\n  const char *libidn;\n\n  /* These field were added in CURLVERSION_FOURTH */\n\n  /* Same as '_libiconv_version' if built with HAVE_ICONV */\n  int iconv_ver_num;\n\n  const char *libssh_version; /* human readable string */\n\n} curl_version_info_data;\n\n#define CURL_VERSION_IPV6      (1<<0)  /* IPv6-enabled */\n#define CURL_VERSION_KERBEROS4 (1<<1)  /* kerberos auth is supported */\n#define CURL_VERSION_SSL       (1<<2)  /* SSL options are present */\n#define CURL_VERSION_LIBZ      (1<<3)  /* libz features are present */\n#define CURL_VERSION_NTLM      (1<<4)  /* NTLM auth is supported */\n#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */\n#define CURL_VERSION_DEBUG     (1<<6)  /* built with debug capabilities */\n#define CURL_VERSION_ASYNCHDNS (1<<7)  /* asynchronous dns resolves */\n#define CURL_VERSION_SPNEGO    (1<<8)  /* SPNEGO auth */\n#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */\n#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */\n#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */\n#define CURL_VERSION_CONV      (1<<12) /* character conversions supported */\n#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */\n#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */\n#define CURL_VERSION_NTLM_WB   (1<<15) /* NTLM delegating to winbind helper */\n\n /*\n * NAME curl_version_info()\n *\n * DESCRIPTION\n *\n * This function returns a pointer to a static copy of the version info\n * struct. See above.\n */\nCURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);\n\n/*\n * NAME curl_easy_strerror()\n *\n * DESCRIPTION\n *\n * The curl_easy_strerror function may be used to turn a CURLcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_easy_strerror(CURLcode);\n\n/*\n * NAME curl_share_strerror()\n *\n * DESCRIPTION\n *\n * The curl_share_strerror function may be used to turn a CURLSHcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_share_strerror(CURLSHcode);\n\n/*\n * NAME curl_easy_pause()\n *\n * DESCRIPTION\n *\n * The curl_easy_pause function pauses or unpauses transfers. Select the new\n * state by setting the bitmask, use the convenience defines below.\n *\n */\nCURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);\n\n#define CURLPAUSE_RECV      (1<<0)\n#define CURLPAUSE_RECV_CONT (0)\n\n#define CURLPAUSE_SEND      (1<<2)\n#define CURLPAUSE_SEND_CONT (0)\n\n#define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)\n#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)\n\n#ifdef  __cplusplus\n}\n#endif\n\n/* unfortunately, the easy.h and multi.h include files need options and info\n  stuff before they can be included! */\n#include \"easy.h\" /* nothing in curl is fun without the easy stuff */\n#include \"multi.h\"\n\n/* the typechecker doesn't work in C++ (yet) */\n#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \\\n    ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \\\n    !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)\n#include \"typecheck-gcc.h\"\n#else\n#if defined(__STDC__) && (__STDC__ >= 1)\n/* This preprocessor magic that replaces a call with the exact same call is\n   only done to make sure application authors pass exactly three arguments\n   to these functions. */\n#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)\n#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n#endif /* __STDC__ >= 1 */\n#endif /* gcc >= 4.3 && !__cplusplus */\n\n#endif /* __CURL_CURL_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/curlbuild.h",
    "content": "#ifndef __CURL_CURLBUILD_H\n#define __CURL_CURLBUILD_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * See file include/curl/curlbuild.h.in, run configure, and forget\n * that this file exists it is only used for non-configure systems.\n * But you can keep reading if you want ;-)\n *\n */\n\n/* ================================================================ */\n/*                 NOTES FOR NON-CONFIGURE SYSTEMS                  */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * If you think that something actually needs to be changed, adjusted\n * or fixed in this file, then, report it on the libcurl development\n * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * Try to keep one section per platform, compiler and architecture,\n * otherwise, if an existing section is reused for a different one and\n * later on the original is adjusted, probably the piggybacking one can\n * be adversely changed.\n *\n * In order to differentiate between platforms/compilers/architectures\n * use only compiler built in predefined preprocessor symbols.\n *\n * This header file shall only export symbols which are 'curl' or 'CURL'\n * prefixed, otherwise public name space would be polluted.\n *\n * NOTE 2:\n * -------\n *\n * For any given platform/compiler curl_off_t must be typedef'ed to a\n * 64-bit wide signed integral data type. The width of this data type\n * must remain constant and independent of any possible large file\n * support settings.\n *\n * As an exception to the above, curl_off_t shall be typedef'ed to a\n * 32-bit wide signed integral data type if there is no 64-bit type.\n *\n * As a general rule, curl_off_t shall not be mapped to off_t. This\n * rule shall only be violated if off_t is the only 64-bit data type\n * available and the size of off_t is independent of large file support\n * settings. Keep your build on the safe side avoiding an off_t gating.\n * If you have a 64-bit off_t then take for sure that another 64-bit\n * data type exists, dig deeper and you will find it.\n *\n * NOTE 3:\n * -------\n *\n * Right now you might be staring at file include/curl/curlbuild.h.dist or\n * at file include/curl/curlbuild.h, this is due to the following reason:\n * file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h\n * when the libcurl source code distribution archive file is created.\n *\n * File include/curl/curlbuild.h.dist is not included in the distribution\n * archive. File include/curl/curlbuild.h is not present in the git tree.\n *\n * The distributed include/curl/curlbuild.h file is only intended to be used\n * on systems which can not run the also distributed configure script.\n *\n * On systems capable of running the configure script, the configure process\n * will overwrite the distributed include/curl/curlbuild.h file with one that\n * is suitable and specific to the library being configured and built, which\n * is generated from the include/curl/curlbuild.h.in template file.\n *\n * If you check out from git on a non-configure platform, you must run the\n * appropriate buildconf* script to set up curlbuild.h and other local files.\n *\n */\n\n/* ================================================================ */\n/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */\n/* ================================================================ */\n\n#ifdef CURL_SIZEOF_LONG\n#  error \"CURL_SIZEOF_LONG shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_SOCKLEN_T\n#  error \"CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_SOCKLEN_T\n#  error \"CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_OFF_T\n#  error \"CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_T\n#  error \"CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_TU\n#  error \"CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined\n#endif\n\n#ifdef CURL_FORMAT_OFF_T\n#  error \"CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_OFF_T\n#  error \"CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_T\n#  error \"CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_TU\n#  error \"CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined\n#endif\n\n/* ================================================================ */\n/*    EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY    */\n/* ================================================================ */\n\n#if defined(__DJGPP__) || defined(__GO32__)\n#  if defined(__DJGPP__) && (__DJGPP__ > 1)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__SALFORDC__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     4\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__BORLANDC__)\n#  if (__BORLANDC__ < 0x520)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__TURBOC__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     4\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__WATCOMC__)\n#  if defined(__386__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__POCC__)\n#  if (__POCC__ < 280)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  elif defined(_MSC_VER)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__LCC__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     4\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__SYMBIAN32__)\n#  if defined(__EABI__)  /* Treat all ARM compilers equally */\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  elif defined(__CW32__)\n#    pragma longlong on\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  elif defined(__VC32__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__MWERKS__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long long\n#  define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#  define CURL_FORMAT_OFF_T          \"%lld\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     LL\n#  define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(_WIN32_WCE)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     __int64\n#  define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#  define CURL_FORMAT_OFF_T          \"%I64d\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     i64\n#  define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__MINGW32__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long long\n#  define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#  define CURL_FORMAT_OFF_T          \"%I64d\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     LL\n#  define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__VMS)\n#  if defined(__VAX)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__OS400__)\n#  if defined(__ILEC400__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#    define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#    define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#    define CURL_PULL_SYS_TYPES_H      1\n#    define CURL_PULL_SYS_SOCKET_H     1\n#  endif\n\n#elif defined(__MVS__)\n#  if defined(__IBMC__) || defined(__IBMCPP__)\n#    if defined(_ILP32)\n#      define CURL_SIZEOF_LONG           4\n#    elif defined(_LP64)\n#      define CURL_SIZEOF_LONG           8\n#    endif\n#    if defined(_LONG_LONG)\n#      define CURL_TYPEOF_CURL_OFF_T     long long\n#      define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#      define CURL_FORMAT_OFF_T          \"%lld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     LL\n#      define CURL_SUFFIX_CURL_OFF_TU    ULL\n#    elif defined(_LP64)\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    else\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     4\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    endif\n#    define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#    define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#    define CURL_PULL_SYS_TYPES_H      1\n#    define CURL_PULL_SYS_SOCKET_H     1\n#  endif\n\n#elif defined(__370__)\n#  if defined(__IBMC__) || defined(__IBMCPP__)\n#    if defined(_ILP32)\n#      define CURL_SIZEOF_LONG           4\n#    elif defined(_LP64)\n#      define CURL_SIZEOF_LONG           8\n#    endif\n#    if defined(_LONG_LONG)\n#      define CURL_TYPEOF_CURL_OFF_T     long long\n#      define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#      define CURL_FORMAT_OFF_T          \"%lld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     LL\n#      define CURL_SUFFIX_CURL_OFF_TU    ULL\n#    elif defined(_LP64)\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    else\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     4\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    endif\n#    define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#    define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#    define CURL_PULL_SYS_TYPES_H      1\n#    define CURL_PULL_SYS_SOCKET_H     1\n#  endif\n\n#elif defined(TPF)\n#  define CURL_SIZEOF_LONG           8\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n/* ===================================== */\n/*    KEEP MSVC THE PENULTIMATE ENTRY    */\n/* ===================================== */\n\n#elif defined(_MSC_VER)\n#  if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n/* ===================================== */\n/*    KEEP GENERIC GCC THE LAST ENTRY    */\n/* ===================================== */\n\n#elif defined(__GNUC__)\n#  if defined(__i386__) || defined(__ppc__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  elif defined(__x86_64__) || defined(__ppc64__)\n#    define CURL_SIZEOF_LONG           8\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#  define CURL_PULL_SYS_TYPES_H      1\n#  define CURL_PULL_SYS_SOCKET_H     1\n\n#else\n#  error \"Unknown non-configure build target!\"\n   Error Compilation_aborted_Unknown_non_configure_build_target\n#endif\n\n/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file  */\n/* sys/types.h is required here to properly make type definitions below. */\n#ifdef CURL_PULL_SYS_TYPES_H\n#  include <sys/types.h>\n#endif\n\n/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */\n/* sys/socket.h is required here to properly make type definitions below. */\n#ifdef CURL_PULL_SYS_SOCKET_H\n#  include <sys/socket.h>\n#endif\n\n/* Data type definition of curl_socklen_t. */\n\n#ifdef CURL_TYPEOF_CURL_SOCKLEN_T\n  typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;\n#endif\n\n/* Data type definition of curl_off_t. */\n\n#ifdef CURL_TYPEOF_CURL_OFF_T\n  typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;\n#endif\n\n#endif /* __CURL_CURLBUILD_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/curlrules.h",
    "content": "#ifndef __CURL_CURLRULES_H\n#define __CURL_CURLRULES_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*                    COMPILE TIME SANITY CHECKS                    */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * All checks done in this file are intentionally placed in a public\n * header file which is pulled by curl/curl.h when an application is\n * being built using an already built libcurl library. Additionally\n * this file is also included and used when building the library.\n *\n * If compilation fails on this file it is certainly sure that the\n * problem is elsewhere. It could be a problem in the curlbuild.h\n * header file, or simply that you are using different compilation\n * settings than those used to build the library.\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * Do not deactivate any check, these are done to make sure that the\n * library is properly built and used.\n *\n * You can find further help on the libcurl development mailing list:\n * http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * NOTE 2\n * ------\n *\n * Some of the following compile time checks are based on the fact\n * that the dimension of a constant array can not be a negative one.\n * In this way if the compile time verification fails, the compilation\n * will fail issuing an error. The error description wording is compiler\n * dependent but it will be quite similar to one of the following:\n *\n *   \"negative subscript or subscript is too large\"\n *   \"array must have at least one element\"\n *   \"-1 is an illegal array size\"\n *   \"size of array is negative\"\n *\n * If you are building an application which tries to use an already\n * built libcurl library and you are getting this kind of errors on\n * this file, it is a clear indication that there is a mismatch between\n * how the library was built and how you are trying to use it for your\n * application. Your already compiled or binary library provider is the\n * only one who can give you the details you need to properly use it.\n */\n\n/*\n * Verify that some macros are actually defined.\n */\n\n#ifndef CURL_SIZEOF_LONG\n#  error \"CURL_SIZEOF_LONG definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_SOCKLEN_T\n#  error \"CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_SOCKLEN_T\n#  error \"CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_OFF_T\n#  error \"CURL_TYPEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_T\n#  error \"CURL_FORMAT_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_TU\n#  error \"CURL_FORMAT_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing\n#endif\n\n#ifndef CURL_FORMAT_OFF_T\n#  error \"CURL_FORMAT_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_OFF_T\n#  error \"CURL_SIZEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_T\n#  error \"CURL_SUFFIX_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_TU\n#  error \"CURL_SUFFIX_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing\n#endif\n\n/*\n * Macros private to this header file.\n */\n\n#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1\n\n#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1\n\n/*\n * Verify that the size previously defined and expected for long\n * is the same as the one reported by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_01__\n    [CurlchkszEQ(long, CURL_SIZEOF_LONG)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_off_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_02__\n    [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];\n\n/*\n * Verify at compile time that the size of curl_off_t as reported\n * by sizeof() is greater or equal than the one reported for long\n * for the current compilation.\n */\n\ntypedef char\n  __curl_rule_03__\n    [CurlchkszGE(curl_off_t, long)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_socklen_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_04__\n    [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];\n\n/*\n * Verify at compile time that the size of curl_socklen_t as reported\n * by sizeof() is greater or equal than the one reported for int for\n * the current compilation.\n */\n\ntypedef char\n  __curl_rule_05__\n    [CurlchkszGE(curl_socklen_t, int)];\n\n/* ================================================================ */\n/*          EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS           */\n/* ================================================================ */\n\n/*\n * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow\n * these to be visible and exported by the external libcurl interface API,\n * while also making them visible to the library internals, simply including\n * setup.h, without actually needing to include curl.h internally.\n * If some day this section would grow big enough, all this should be moved\n * to its own header file.\n */\n\n/*\n * Figure out if we can use the ## preprocessor operator, which is supported\n * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__\n * or  __cplusplus so we need to carefully check for them too.\n */\n\n#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \\\n  defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \\\n  defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \\\n  defined(__ILEC400__)\n  /* This compiler is believed to have an ISO compatible preprocessor */\n#define CURL_ISOCPP\n#else\n  /* This compiler is believed NOT to have an ISO compatible preprocessor */\n#undef CURL_ISOCPP\n#endif\n\n/*\n * Macros for minimum-width signed and unsigned curl_off_t integer constants.\n */\n\n#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)\n#  define __CURL_OFF_T_C_HLPR2(x) x\n#  define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)\n#else\n#  ifdef CURL_ISOCPP\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix\n#  else\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix\n#  endif\n#  define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)\n#endif\n\n/*\n * Get rid of macros private to this header file.\n */\n\n#undef CurlchkszEQ\n#undef CurlchkszGE\n\n/*\n * Get rid of macros not intended to exist beyond this point.\n */\n\n#undef CURL_PULL_WS2TCPIP_H\n#undef CURL_PULL_SYS_TYPES_H\n#undef CURL_PULL_SYS_SOCKET_H\n#undef CURL_PULL_STDINT_H\n#undef CURL_PULL_INTTYPES_H\n\n#undef CURL_TYPEOF_CURL_SOCKLEN_T\n#undef CURL_TYPEOF_CURL_OFF_T\n\n#ifdef CURL_NO_OLDIES\n#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */\n#endif\n\n#endif /* __CURL_CURLRULES_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/curlver.h",
    "content": "#ifndef __CURL_CURLVER_H\n#define __CURL_CURLVER_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* This header file contains nothing but libcurl version info, generated by\n   a script at release-time. This was made its own header file in 7.11.2 */\n\n/* This is the global package copyright */\n#define LIBCURL_COPYRIGHT \"1996 - 2012 Daniel Stenberg, <daniel@haxx.se>.\"\n\n/* This is the version number of the libcurl package from which this header\n   file origins: */\n#define LIBCURL_VERSION \"7.26.0\"\n\n/* The numeric version number is also available \"in parts\" by using these\n   defines: */\n#define LIBCURL_VERSION_MAJOR 7\n#define LIBCURL_VERSION_MINOR 26\n#define LIBCURL_VERSION_PATCH 0\n\n/* This is the numeric version of the libcurl version number, meant for easier\n   parsing and comparions by programs. The LIBCURL_VERSION_NUM define will\n   always follow this syntax:\n\n         0xXXYYZZ\n\n   Where XX, YY and ZZ are the main version, release and patch numbers in\n   hexadecimal (using 8 bits each). All three numbers are always represented\n   using two digits.  1.2 would appear as \"0x010200\" while version 9.11.7\n   appears as \"0x090b07\".\n\n   This 6-digit (24 bits) hexadecimal number does not show pre-release number,\n   and it is always a greater number in a more recent release. It makes\n   comparisons with greater than and less than work.\n*/\n#define LIBCURL_VERSION_NUM 0x071a00\n\n/*\n * This is the date and time when the full source package was created. The\n * timestamp is not stored in git, as the timestamp is properly set in the\n * tarballs by the maketgz script.\n *\n * The format of the date should follow this template:\n *\n * \"Mon Feb 12 11:35:33 UTC 2007\"\n */\n#define LIBCURL_TIMESTAMP \"Thu May 24 16:05:42 UTC 2012\"\n\n#endif /* __CURL_CURLVER_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/easy.h",
    "content": "#ifndef __CURL_EASY_H\n#define __CURL_EASY_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN CURL *curl_easy_init(void);\nCURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);\nCURL_EXTERN CURLcode curl_easy_perform(CURL *curl);\nCURL_EXTERN void curl_easy_cleanup(CURL *curl);\n\n/*\n * NAME curl_easy_getinfo()\n *\n * DESCRIPTION\n *\n * Request internal information from the curl session with this function.  The\n * third argument MUST be a pointer to a long, a pointer to a char * or a\n * pointer to a double (as the documentation describes elsewhere).  The data\n * pointed to will be filled in accordingly and can be relied upon only if the\n * function returns CURLE_OK.  This function is intended to get used *AFTER* a\n * performed transfer, all results from this function are undefined until the\n * transfer is completed.\n */\nCURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);\n\n\n/*\n * NAME curl_easy_duphandle()\n *\n * DESCRIPTION\n *\n * Creates a new curl session handle with the same options set for the handle\n * passed in. Duplicating a handle could only be a matter of cloning data and\n * options, internal state info and things like persistent connections cannot\n * be transferred. It is useful in multithreaded applications when you can run\n * curl_easy_duphandle() for each new thread to avoid a series of identical\n * curl_easy_setopt() invokes in every thread.\n */\nCURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);\n\n/*\n * NAME curl_easy_reset()\n *\n * DESCRIPTION\n *\n * Re-initializes a CURL handle to the default values. This puts back the\n * handle to the same state as it was in when it was just created.\n *\n * It does keep: live connections, the Session ID cache, the DNS cache and the\n * cookies.\n */\nCURL_EXTERN void curl_easy_reset(CURL *curl);\n\n/*\n * NAME curl_easy_recv()\n *\n * DESCRIPTION\n *\n * Receives data from the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,\n                                    size_t *n);\n\n/*\n * NAME curl_easy_send()\n *\n * DESCRIPTION\n *\n * Sends data over the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,\n                                    size_t buflen, size_t *n);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/mprintf.h",
    "content": "#ifndef __CURL_MPRINTF_H\n#define __CURL_MPRINTF_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <stdarg.h>\n#include <stdio.h> /* needed for FILE */\n\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN int curl_mprintf(const char *format, ...);\nCURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);\nCURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);\nCURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,\n                               const char *format, ...);\nCURL_EXTERN int curl_mvprintf(const char *format, va_list args);\nCURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);\nCURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);\nCURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,\n                                const char *format, va_list args);\nCURL_EXTERN char *curl_maprintf(const char *format, ...);\nCURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);\n\n#ifdef _MPRINTF_REPLACE\n# undef printf\n# undef fprintf\n# undef sprintf\n# undef vsprintf\n# undef snprintf\n# undef vprintf\n# undef vfprintf\n# undef vsnprintf\n# undef aprintf\n# undef vaprintf\n# define printf curl_mprintf\n# define fprintf curl_mfprintf\n#ifdef CURLDEBUG\n/* When built with CURLDEBUG we define away the sprintf() functions since we\n   don't want internal code to be using them */\n# define sprintf sprintf_was_used\n# define vsprintf vsprintf_was_used\n#else\n# define sprintf curl_msprintf\n# define vsprintf curl_mvsprintf\n#endif\n# define snprintf curl_msnprintf\n# define vprintf curl_mvprintf\n# define vfprintf curl_mvfprintf\n# define vsnprintf curl_mvsnprintf\n# define aprintf curl_maprintf\n# define vaprintf curl_mvaprintf\n#endif\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif /* __CURL_MPRINTF_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/multi.h",
    "content": "#ifndef __CURL_MULTI_H\n#define __CURL_MULTI_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n/*\n  This is an \"external\" header file. Don't give away any internals here!\n\n  GOALS\n\n  o Enable a \"pull\" interface. The application that uses libcurl decides where\n    and when to ask libcurl to get/send data.\n\n  o Enable multiple simultaneous transfers in the same thread without making it\n    complicated for the application.\n\n  o Enable the application to select() on its own file descriptors and curl's\n    file descriptors simultaneous easily.\n\n*/\n\n/*\n * This header file should not really need to include \"curl.h\" since curl.h\n * itself includes this file and we expect user applications to do #include\n * <curl/curl.h> without the need for especially including multi.h.\n *\n * For some reason we added this include here at one point, and rather than to\n * break existing (wrongly written) libcurl applications, we leave it as-is\n * but with this warning attached.\n */\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURLM;\n\ntypedef enum {\n  CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or\n                                    curl_multi_socket*() soon */\n  CURLM_OK,\n  CURLM_BAD_HANDLE,      /* the passed-in handle is not a valid CURLM handle */\n  CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */\n  CURLM_OUT_OF_MEMORY,   /* if you ever get this, you're in deep sh*t */\n  CURLM_INTERNAL_ERROR,  /* this is a libcurl bug */\n  CURLM_BAD_SOCKET,      /* the passed in socket argument did not match */\n  CURLM_UNKNOWN_OPTION,  /* curl_multi_setopt() with unsupported option */\n  CURLM_LAST\n} CURLMcode;\n\n/* just to make code nicer when using curl_multi_socket() you can now check\n   for CURLM_CALL_MULTI_SOCKET too in the same style it works for\n   curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */\n#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM\n\ntypedef enum {\n  CURLMSG_NONE, /* first, not used */\n  CURLMSG_DONE, /* This easy handle has completed. 'result' contains\n                   the CURLcode of the transfer */\n  CURLMSG_LAST /* last, not used */\n} CURLMSG;\n\nstruct CURLMsg {\n  CURLMSG msg;       /* what this message means */\n  CURL *easy_handle; /* the handle it concerns */\n  union {\n    void *whatever;    /* message-specific data */\n    CURLcode result;   /* return code for transfer */\n  } data;\n};\ntypedef struct CURLMsg CURLMsg;\n\n/*\n * Name:    curl_multi_init()\n *\n * Desc:    inititalize multi-style curl usage\n *\n * Returns: a new CURLM handle to use in all 'curl_multi' functions.\n */\nCURL_EXTERN CURLM *curl_multi_init(void);\n\n/*\n * Name:    curl_multi_add_handle()\n *\n * Desc:    add a standard curl handle to the multi stack\n *\n * Returns: CURLMcode type, general multi error code.\n */\nCURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,\n                                            CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_remove_handle()\n  *\n  * Desc:    removes a curl handle from the multi stack again\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,\n                                               CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_fdset()\n  *\n  * Desc:    Ask curl for its fd_set sets. The app can use these to select() or\n  *          poll() on. We want curl_multi_perform() called as soon as one of\n  *          them are ready.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,\n                                       fd_set *read_fd_set,\n                                       fd_set *write_fd_set,\n                                       fd_set *exc_fd_set,\n                                       int *max_fd);\n\n /*\n  * Name:    curl_multi_perform()\n  *\n  * Desc:    When the app thinks there's data available for curl it calls this\n  *          function to read/write whatever there is right now. This returns\n  *          as soon as the reads and writes are done. This function does not\n  *          require that there actually is data available for reading or that\n  *          data can be written, it can be called just in case. It returns\n  *          the number of handles that still transfer data in the second\n  *          argument's integer-pointer.\n  *\n  * Returns: CURLMcode type, general multi error code. *NOTE* that this only\n  *          returns errors etc regarding the whole multi stack. There might\n  *          still have occurred problems on invidual transfers even when this\n  *          returns OK.\n  */\nCURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,\n                                         int *running_handles);\n\n /*\n  * Name:    curl_multi_cleanup()\n  *\n  * Desc:    Cleans up and removes a whole multi stack. It does not free or\n  *          touch any individual easy handles in any way. We need to define\n  *          in what state those handles will be if this function is called\n  *          in the middle of a transfer.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);\n\n/*\n * Name:    curl_multi_info_read()\n *\n * Desc:    Ask the multi handle if there's any messages/informationals from\n *          the individual transfers. Messages include informationals such as\n *          error code from the transfer or just the fact that a transfer is\n *          completed. More details on these should be written down as well.\n *\n *          Repeated calls to this function will return a new struct each\n *          time, until a special \"end of msgs\" struct is returned as a signal\n *          that there is no more to get at this point.\n *\n *          The data the returned pointer points to will not survive calling\n *          curl_multi_cleanup().\n *\n *          The 'CURLMsg' struct is meant to be very simple and only contain\n *          very basic informations. If more involved information is wanted,\n *          we will provide the particular \"transfer handle\" in that struct\n *          and that should/could/would be used in subsequent\n *          curl_easy_getinfo() calls (or similar). The point being that we\n *          must never expose complex structs to applications, as then we'll\n *          undoubtably get backwards compatibility problems in the future.\n *\n * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out\n *          of structs. It also writes the number of messages left in the\n *          queue (after this read) in the integer the second argument points\n *          to.\n */\nCURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,\n                                          int *msgs_in_queue);\n\n/*\n * Name:    curl_multi_strerror()\n *\n * Desc:    The curl_multi_strerror function may be used to turn a CURLMcode\n *          value into the equivalent human readable error string.  This is\n *          useful for printing meaningful error messages.\n *\n * Returns: A pointer to a zero-terminated error message.\n */\nCURL_EXTERN const char *curl_multi_strerror(CURLMcode);\n\n/*\n * Name:    curl_multi_socket() and\n *          curl_multi_socket_all()\n *\n * Desc:    An alternative version of curl_multi_perform() that allows the\n *          application to pass in one of the file descriptors that have been\n *          detected to have \"action\" on them and let libcurl perform.\n *          See man page for details.\n */\n#define CURL_POLL_NONE   0\n#define CURL_POLL_IN     1\n#define CURL_POLL_OUT    2\n#define CURL_POLL_INOUT  3\n#define CURL_POLL_REMOVE 4\n\n#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD\n\n#define CURL_CSELECT_IN   0x01\n#define CURL_CSELECT_OUT  0x02\n#define CURL_CSELECT_ERR  0x04\n\ntypedef int (*curl_socket_callback)(CURL *easy,      /* easy handle */\n                                    curl_socket_t s, /* socket */\n                                    int what,        /* see above */\n                                    void *userp,     /* private callback\n                                                        pointer */\n                                    void *socketp);  /* private socket\n                                                        pointer */\n/*\n * Name:    curl_multi_timer_callback\n *\n * Desc:    Called by libcurl whenever the library detects a change in the\n *          maximum number of milliseconds the app is allowed to wait before\n *          curl_multi_socket() or curl_multi_perform() must be called\n *          (to allow libcurl's timed events to take place).\n *\n * Returns: The callback should return zero.\n */\ntypedef int (*curl_multi_timer_callback)(CURLM *multi,    /* multi handle */\n                                         long timeout_ms, /* see above */\n                                         void *userp);    /* private callback\n                                                             pointer */\n\nCURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,\n                                        int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,\n                                               curl_socket_t s,\n                                               int ev_bitmask,\n                                               int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,\n                                            int *running_handles);\n\n#ifndef CURL_ALLOW_OLD_MULTI_SOCKET\n/* This macro below was added in 7.16.3 to push users who recompile to use\n   the new curl_multi_socket_action() instead of the old curl_multi_socket()\n*/\n#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)\n#endif\n\n/*\n * Name:    curl_multi_timeout()\n *\n * Desc:    Returns the maximum number of milliseconds the app is allowed to\n *          wait before curl_multi_socket() or curl_multi_perform() must be\n *          called (to allow libcurl's timed events to take place).\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,\n                                         long *milliseconds);\n\n#undef CINIT /* re-using the same name as in curl.h */\n\n#ifdef CURL_ISOCPP\n#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLMOPT_/**/name = type + number\n#endif\n\ntypedef enum {\n  /* This is the socket callback function pointer */\n  CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),\n\n  /* This is the argument passed to the socket callback */\n  CINIT(SOCKETDATA, OBJECTPOINT, 2),\n\n    /* set to 1 to enable pipelining for this multi handle */\n  CINIT(PIPELINING, LONG, 3),\n\n   /* This is the timer callback function pointer */\n  CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),\n\n  /* This is the argument passed to the timer callback */\n  CINIT(TIMERDATA, OBJECTPOINT, 5),\n\n  /* maximum number of entries in the connection cache */\n  CINIT(MAXCONNECTS, LONG, 6),\n\n  CURLMOPT_LASTENTRY /* the last unused */\n} CURLMoption;\n\n\n/*\n * Name:    curl_multi_setopt()\n *\n * Desc:    Sets options for the multi handle.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,\n                                        CURLMoption option, ...);\n\n\n/*\n * Name:    curl_multi_assign()\n *\n * Desc:    This function sets an association in the multi handle between the\n *          given socket and a private pointer of the application. This is\n *          (only) useful for curl_multi_socket uses.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,\n                                        curl_socket_t sockfd, void *sockp);\n\n#ifdef __cplusplus\n} /* end of extern \"C\" */\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/stdcheaders.h",
    "content": "#ifndef __STDC_HEADERS_H\n#define __STDC_HEADERS_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <sys/types.h>\n\nsize_t fread (void *, size_t, size_t, FILE *);\nsize_t fwrite (const void *, size_t, size_t, FILE *);\n\nint strcasecmp(const char *, const char *);\nint strncasecmp(const char *, const char *, size_t);\n\n#endif /* __STDC_HEADERS_H */\n"
  },
  {
    "path": "cocos2d/external/curl/include/win32/curl/typecheck-gcc.h",
    "content": "#ifndef __CURL_TYPECHECK_GCC_H\n#define __CURL_TYPECHECK_GCC_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* wraps curl_easy_setopt() with typechecking */\n\n/* To add a new kind of warning, add an\n *   if(_curl_is_sometype_option(_curl_opt))\n *     if(!_curl_is_sometype(value))\n *       _curl_easy_setopt_err_sometype();\n * block and define _curl_is_sometype_option, _curl_is_sometype and\n * _curl_easy_setopt_err_sometype below\n *\n * NOTE: We use two nested 'if' statements here instead of the && operator, in\n *       order to work around gcc bug #32061.  It affects only gcc 4.3.x/4.4.x\n *       when compiling with -Wlogical-op.\n *\n * To add an option that uses the same type as an existing option, you'll just\n * need to extend the appropriate _curl_*_option macro\n */\n#define curl_easy_setopt(handle, option, value)                               \\\n__extension__ ({                                                              \\\n  __typeof__ (option) _curl_opt = option;                                     \\\n  if(__builtin_constant_p(_curl_opt)) {                                       \\\n    if(_curl_is_long_option(_curl_opt))                                       \\\n      if(!_curl_is_long(value))                                               \\\n        _curl_easy_setopt_err_long();                                         \\\n    if(_curl_is_off_t_option(_curl_opt))                                      \\\n      if(!_curl_is_off_t(value))                                              \\\n        _curl_easy_setopt_err_curl_off_t();                                   \\\n    if(_curl_is_string_option(_curl_opt))                                     \\\n      if(!_curl_is_string(value))                                             \\\n        _curl_easy_setopt_err_string();                                       \\\n    if(_curl_is_write_cb_option(_curl_opt))                                   \\\n      if(!_curl_is_write_cb(value))                                           \\\n        _curl_easy_setopt_err_write_callback();                               \\\n    if((_curl_opt) == CURLOPT_READFUNCTION)                                   \\\n      if(!_curl_is_read_cb(value))                                            \\\n        _curl_easy_setopt_err_read_cb();                                      \\\n    if((_curl_opt) == CURLOPT_IOCTLFUNCTION)                                  \\\n      if(!_curl_is_ioctl_cb(value))                                           \\\n        _curl_easy_setopt_err_ioctl_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION)                                \\\n      if(!_curl_is_sockopt_cb(value))                                         \\\n        _curl_easy_setopt_err_sockopt_cb();                                   \\\n    if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION)                             \\\n      if(!_curl_is_opensocket_cb(value))                                      \\\n        _curl_easy_setopt_err_opensocket_cb();                                \\\n    if((_curl_opt) == CURLOPT_PROGRESSFUNCTION)                               \\\n      if(!_curl_is_progress_cb(value))                                        \\\n        _curl_easy_setopt_err_progress_cb();                                  \\\n    if((_curl_opt) == CURLOPT_DEBUGFUNCTION)                                  \\\n      if(!_curl_is_debug_cb(value))                                           \\\n        _curl_easy_setopt_err_debug_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION)                               \\\n      if(!_curl_is_ssl_ctx_cb(value))                                         \\\n        _curl_easy_setopt_err_ssl_ctx_cb();                                   \\\n    if(_curl_is_conv_cb_option(_curl_opt))                                    \\\n      if(!_curl_is_conv_cb(value))                                            \\\n        _curl_easy_setopt_err_conv_cb();                                      \\\n    if((_curl_opt) == CURLOPT_SEEKFUNCTION)                                   \\\n      if(!_curl_is_seek_cb(value))                                            \\\n        _curl_easy_setopt_err_seek_cb();                                      \\\n    if(_curl_is_cb_data_option(_curl_opt))                                    \\\n      if(!_curl_is_cb_data(value))                                            \\\n        _curl_easy_setopt_err_cb_data();                                      \\\n    if((_curl_opt) == CURLOPT_ERRORBUFFER)                                    \\\n      if(!_curl_is_error_buffer(value))                                       \\\n        _curl_easy_setopt_err_error_buffer();                                 \\\n    if((_curl_opt) == CURLOPT_STDERR)                                         \\\n      if(!_curl_is_FILE(value))                                               \\\n        _curl_easy_setopt_err_FILE();                                         \\\n    if(_curl_is_postfields_option(_curl_opt))                                 \\\n      if(!_curl_is_postfields(value))                                         \\\n        _curl_easy_setopt_err_postfields();                                   \\\n    if((_curl_opt) == CURLOPT_HTTPPOST)                                       \\\n      if(!_curl_is_arr((value), struct curl_httppost))                        \\\n        _curl_easy_setopt_err_curl_httpost();                                 \\\n    if(_curl_is_slist_option(_curl_opt))                                      \\\n      if(!_curl_is_arr((value), struct curl_slist))                           \\\n        _curl_easy_setopt_err_curl_slist();                                   \\\n    if((_curl_opt) == CURLOPT_SHARE)                                          \\\n      if(!_curl_is_ptr((value), CURLSH))                                      \\\n        _curl_easy_setopt_err_CURLSH();                                       \\\n  }                                                                           \\\n  curl_easy_setopt(handle, _curl_opt, value);                                 \\\n})\n\n/* wraps curl_easy_getinfo() with typechecking */\n/* FIXME: don't allow const pointers */\n#define curl_easy_getinfo(handle, info, arg)                                  \\\n__extension__ ({                                                              \\\n  __typeof__ (info) _curl_info = info;                                        \\\n  if(__builtin_constant_p(_curl_info)) {                                      \\\n    if(_curl_is_string_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), char *))                                        \\\n        _curl_easy_getinfo_err_string();                                      \\\n    if(_curl_is_long_info(_curl_info))                                        \\\n      if(!_curl_is_arr((arg), long))                                          \\\n        _curl_easy_getinfo_err_long();                                        \\\n    if(_curl_is_double_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), double))                                        \\\n        _curl_easy_getinfo_err_double();                                      \\\n    if(_curl_is_slist_info(_curl_info))                                       \\\n      if(!_curl_is_arr((arg), struct curl_slist *))                           \\\n        _curl_easy_getinfo_err_curl_slist();                                  \\\n  }                                                                           \\\n  curl_easy_getinfo(handle, _curl_info, arg);                                 \\\n})\n\n/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),\n * for now just make sure that the functions are called with three\n * arguments\n */\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n\n\n/* the actual warnings, triggered by calling the _curl_easy_setopt_err*\n * functions */\n\n/* To define a new warning, use _CURL_WARNING(identifier, \"message\") */\n#define _CURL_WARNING(id, message)                                            \\\n  static void __attribute__((__warning__(message)))                           \\\n  __attribute__((__unused__)) __attribute__((__noinline__))                   \\\n  id(void) { __asm__(\"\"); }\n\n_CURL_WARNING(_curl_easy_setopt_err_long,\n  \"curl_easy_setopt expects a long argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,\n  \"curl_easy_setopt expects a curl_off_t argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_string,\n              \"curl_easy_setopt expects a \"\n              \"string (char* or char[]) argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_write_callback,\n  \"curl_easy_setopt expects a curl_write_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_read_cb,\n  \"curl_easy_setopt expects a curl_read_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,\n  \"curl_easy_setopt expects a curl_ioctl_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,\n  \"curl_easy_setopt expects a curl_sockopt_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,\n              \"curl_easy_setopt expects a \"\n              \"curl_opensocket_callback argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_progress_cb,\n  \"curl_easy_setopt expects a curl_progress_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_debug_cb,\n  \"curl_easy_setopt expects a curl_debug_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,\n  \"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_conv_cb,\n  \"curl_easy_setopt expects a curl_conv_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_seek_cb,\n  \"curl_easy_setopt expects a curl_seek_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_cb_data,\n              \"curl_easy_setopt expects a \"\n              \"private data pointer as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_error_buffer,\n              \"curl_easy_setopt expects a \"\n              \"char buffer of CURL_ERROR_SIZE as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_FILE,\n  \"curl_easy_setopt expects a FILE* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_postfields,\n  \"curl_easy_setopt expects a void* or char* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,\n  \"curl_easy_setopt expects a struct curl_httppost* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_slist,\n  \"curl_easy_setopt expects a struct curl_slist* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_CURLSH,\n  \"curl_easy_setopt expects a CURLSH* argument for this option\")\n\n_CURL_WARNING(_curl_easy_getinfo_err_string,\n  \"curl_easy_getinfo expects a pointer to char * for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_long,\n  \"curl_easy_getinfo expects a pointer to long for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_double,\n  \"curl_easy_getinfo expects a pointer to double for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,\n  \"curl_easy_getinfo expects a pointer to struct curl_slist * for this info\")\n\n/* groups of curl_easy_setops options that take the same type of argument */\n\n/* To add a new option to one of the groups, just add\n *   (option) == CURLOPT_SOMETHING\n * to the or-expression. If the option takes a long or curl_off_t, you don't\n * have to do anything\n */\n\n/* evaluates to true if option takes a long argument */\n#define _curl_is_long_option(option)                                          \\\n  (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)\n\n#define _curl_is_off_t_option(option)                                         \\\n  ((option) > CURLOPTTYPE_OFF_T)\n\n/* evaluates to true if option takes a char* argument */\n#define _curl_is_string_option(option)                                        \\\n  ((option) == CURLOPT_URL ||                                                 \\\n   (option) == CURLOPT_PROXY ||                                               \\\n   (option) == CURLOPT_INTERFACE ||                                           \\\n   (option) == CURLOPT_NETRC_FILE ||                                          \\\n   (option) == CURLOPT_USERPWD ||                                             \\\n   (option) == CURLOPT_USERNAME ||                                            \\\n   (option) == CURLOPT_PASSWORD ||                                            \\\n   (option) == CURLOPT_PROXYUSERPWD ||                                        \\\n   (option) == CURLOPT_PROXYUSERNAME ||                                       \\\n   (option) == CURLOPT_PROXYPASSWORD ||                                       \\\n   (option) == CURLOPT_NOPROXY ||                                             \\\n   (option) == CURLOPT_ACCEPT_ENCODING ||                                     \\\n   (option) == CURLOPT_REFERER ||                                             \\\n   (option) == CURLOPT_USERAGENT ||                                           \\\n   (option) == CURLOPT_COOKIE ||                                              \\\n   (option) == CURLOPT_COOKIEFILE ||                                          \\\n   (option) == CURLOPT_COOKIEJAR ||                                           \\\n   (option) == CURLOPT_COOKIELIST ||                                          \\\n   (option) == CURLOPT_FTPPORT ||                                             \\\n   (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER ||                             \\\n   (option) == CURLOPT_FTP_ACCOUNT ||                                         \\\n   (option) == CURLOPT_RANGE ||                                               \\\n   (option) == CURLOPT_CUSTOMREQUEST ||                                       \\\n   (option) == CURLOPT_SSLCERT ||                                             \\\n   (option) == CURLOPT_SSLCERTTYPE ||                                         \\\n   (option) == CURLOPT_SSLKEY ||                                              \\\n   (option) == CURLOPT_SSLKEYTYPE ||                                          \\\n   (option) == CURLOPT_KEYPASSWD ||                                           \\\n   (option) == CURLOPT_SSLENGINE ||                                           \\\n   (option) == CURLOPT_CAINFO ||                                              \\\n   (option) == CURLOPT_CAPATH ||                                              \\\n   (option) == CURLOPT_RANDOM_FILE ||                                         \\\n   (option) == CURLOPT_EGDSOCKET ||                                           \\\n   (option) == CURLOPT_SSL_CIPHER_LIST ||                                     \\\n   (option) == CURLOPT_KRBLEVEL ||                                            \\\n   (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 ||                             \\\n   (option) == CURLOPT_SSH_PUBLIC_KEYFILE ||                                  \\\n   (option) == CURLOPT_SSH_PRIVATE_KEYFILE ||                                 \\\n   (option) == CURLOPT_CRLFILE ||                                             \\\n   (option) == CURLOPT_ISSUERCERT ||                                          \\\n   (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE ||                               \\\n   (option) == CURLOPT_SSH_KNOWNHOSTS ||                                      \\\n   (option) == CURLOPT_MAIL_FROM ||                                           \\\n   (option) == CURLOPT_RTSP_SESSION_ID ||                                     \\\n   (option) == CURLOPT_RTSP_STREAM_URI ||                                     \\\n   (option) == CURLOPT_RTSP_TRANSPORT ||                                      \\\n   0)\n\n/* evaluates to true if option takes a curl_write_callback argument */\n#define _curl_is_write_cb_option(option)                                      \\\n  ((option) == CURLOPT_HEADERFUNCTION ||                                      \\\n   (option) == CURLOPT_WRITEFUNCTION)\n\n/* evaluates to true if option takes a curl_conv_callback argument */\n#define _curl_is_conv_cb_option(option)                                       \\\n  ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION ||                            \\\n   (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION ||                          \\\n   (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)\n\n/* evaluates to true if option takes a data argument to pass to a callback */\n#define _curl_is_cb_data_option(option)                                       \\\n  ((option) == CURLOPT_WRITEDATA ||                                           \\\n   (option) == CURLOPT_READDATA ||                                            \\\n   (option) == CURLOPT_IOCTLDATA ||                                           \\\n   (option) == CURLOPT_SOCKOPTDATA ||                                         \\\n   (option) == CURLOPT_OPENSOCKETDATA ||                                      \\\n   (option) == CURLOPT_PROGRESSDATA ||                                        \\\n   (option) == CURLOPT_WRITEHEADER ||                                         \\\n   (option) == CURLOPT_DEBUGDATA ||                                           \\\n   (option) == CURLOPT_SSL_CTX_DATA ||                                        \\\n   (option) == CURLOPT_SEEKDATA ||                                            \\\n   (option) == CURLOPT_PRIVATE ||                                             \\\n   (option) == CURLOPT_SSH_KEYDATA ||                                         \\\n   (option) == CURLOPT_INTERLEAVEDATA ||                                      \\\n   (option) == CURLOPT_CHUNK_DATA ||                                          \\\n   (option) == CURLOPT_FNMATCH_DATA ||                                        \\\n   0)\n\n/* evaluates to true if option takes a POST data argument (void* or char*) */\n#define _curl_is_postfields_option(option)                                    \\\n  ((option) == CURLOPT_POSTFIELDS ||                                          \\\n   (option) == CURLOPT_COPYPOSTFIELDS ||                                      \\\n   0)\n\n/* evaluates to true if option takes a struct curl_slist * argument */\n#define _curl_is_slist_option(option)                                         \\\n  ((option) == CURLOPT_HTTPHEADER ||                                          \\\n   (option) == CURLOPT_HTTP200ALIASES ||                                      \\\n   (option) == CURLOPT_QUOTE ||                                               \\\n   (option) == CURLOPT_POSTQUOTE ||                                           \\\n   (option) == CURLOPT_PREQUOTE ||                                            \\\n   (option) == CURLOPT_TELNETOPTIONS ||                                       \\\n   (option) == CURLOPT_MAIL_RCPT ||                                           \\\n   0)\n\n/* groups of curl_easy_getinfo infos that take the same type of argument */\n\n/* evaluates to true if info expects a pointer to char * argument */\n#define _curl_is_string_info(info)                                            \\\n  (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)\n\n/* evaluates to true if info expects a pointer to long argument */\n#define _curl_is_long_info(info)                                              \\\n  (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)\n\n/* evaluates to true if info expects a pointer to double argument */\n#define _curl_is_double_info(info)                                            \\\n  (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)\n\n/* true if info expects a pointer to struct curl_slist * argument */\n#define _curl_is_slist_info(info)                                             \\\n  (CURLINFO_SLIST < (info))\n\n\n/* typecheck helpers -- check whether given expression has requested type*/\n\n/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,\n * otherwise define a new macro. Search for __builtin_types_compatible_p\n * in the GCC manual.\n * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is\n * the actual expression passed to the curl_easy_setopt macro. This\n * means that you can only apply the sizeof and __typeof__ operators, no\n * == or whatsoever.\n */\n\n/* XXX: should evaluate to true iff expr is a pointer */\n#define _curl_is_any_ptr(expr)                                                \\\n  (sizeof(expr) == sizeof(void*))\n\n/* evaluates to true if expr is NULL */\n/* XXX: must not evaluate expr, so this check is not accurate */\n#define _curl_is_NULL(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))\n\n/* evaluates to true if expr is type*, const type* or NULL */\n#define _curl_is_ptr(expr, type)                                              \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), type *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), const type *))\n\n/* evaluates to true if expr is one of type[], type*, NULL or const type* */\n#define _curl_is_arr(expr, type)                                              \\\n  (_curl_is_ptr((expr), type) ||                                              \\\n   __builtin_types_compatible_p(__typeof__(expr), type []))\n\n/* evaluates to true if expr is a string */\n#define _curl_is_string(expr)                                                 \\\n  (_curl_is_arr((expr), char) ||                                              \\\n   _curl_is_arr((expr), signed char) ||                                       \\\n   _curl_is_arr((expr), unsigned char))\n\n/* evaluates to true if expr is a long (no matter the signedness)\n * XXX: for now, int is also accepted (and therefore short and char, which\n * are promoted to int when passed to a variadic function) */\n#define _curl_is_long(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), long) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed long) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned long) ||           \\\n   __builtin_types_compatible_p(__typeof__(expr), int) ||                     \\\n   __builtin_types_compatible_p(__typeof__(expr), signed int) ||              \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned int) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), short) ||                   \\\n   __builtin_types_compatible_p(__typeof__(expr), signed short) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned short) ||          \\\n   __builtin_types_compatible_p(__typeof__(expr), char) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed char) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned char))\n\n/* evaluates to true if expr is of type curl_off_t */\n#define _curl_is_off_t(expr)                                                  \\\n  (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))\n\n/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */\n/* XXX: also check size of an char[] array? */\n#define _curl_is_error_buffer(expr)                                           \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), char *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), char[]))\n\n/* evaluates to true if expr is of type (const) void* or (const) FILE* */\n#if 0\n#define _curl_is_cb_data(expr)                                                \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_ptr((expr), FILE))\n#else /* be less strict */\n#define _curl_is_cb_data(expr)                                                \\\n  _curl_is_any_ptr(expr)\n#endif\n\n/* evaluates to true if expr is of type FILE* */\n#define _curl_is_FILE(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), FILE *))\n\n/* evaluates to true if expr can be passed as POST data (void* or char*) */\n#define _curl_is_postfields(expr)                                             \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_arr((expr), char))\n\n/* FIXME: the whole callback checking is messy...\n * The idea is to tolerate char vs. void and const vs. not const\n * pointers in arguments at least\n */\n/* helper: __builtin_types_compatible_p distinguishes between functions and\n * function pointers, hide it */\n#define _curl_callback_compatible(func, type)                                 \\\n  (__builtin_types_compatible_p(__typeof__(func), type) ||                    \\\n   __builtin_types_compatible_p(__typeof__(func), type*))\n\n/* evaluates to true if expr is of type curl_read_callback or \"similar\" */\n#define _curl_is_read_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) ||       \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_read_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback4) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback5) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback6))\ntypedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_write_callback or \"similar\" */\n#define _curl_is_write_cb(expr)                                               \\\n  (_curl_is_read_cb(expr) ||                                            \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) ||      \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_write_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback6))\ntypedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback2)(const char *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback5)(const void *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_ioctl_callback or \"similar\" */\n#define _curl_is_ioctl_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback4))\ntypedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);\ntypedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);\ntypedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);\ntypedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);\n\n/* evaluates to true if expr is of type curl_sockopt_callback or \"similar\" */\n#define _curl_is_sockopt_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback2))\ntypedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);\ntypedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,\n                                      curlsocktype);\n\n/* evaluates to true if expr is of type curl_opensocket_callback or\n   \"similar\" */\n#define _curl_is_opensocket_cb(expr)                                    \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\\\n   _curl_callback_compatible((expr), _curl_opensocket_callback1) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback2) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback3) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback4))\ntypedef curl_socket_t (_curl_opensocket_callback1)\n  (void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback2)\n  (void *, curlsocktype, const struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback3)\n  (const void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback4)\n  (const void *, curlsocktype, const struct curl_sockaddr *);\n\n/* evaluates to true if expr is of type curl_progress_callback or \"similar\" */\n#define _curl_is_progress_cb(expr)                                      \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) ||  \\\n   _curl_callback_compatible((expr), _curl_progress_callback1) ||             \\\n   _curl_callback_compatible((expr), _curl_progress_callback2))\ntypedef int (_curl_progress_callback1)(void *,\n    double, double, double, double);\ntypedef int (_curl_progress_callback2)(const void *,\n    double, double, double, double);\n\n/* evaluates to true if expr is of type curl_debug_callback or \"similar\" */\n#define _curl_is_debug_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_debug_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback6) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback7) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback8))\ntypedef int (_curl_debug_callback1) (CURL *,\n    curl_infotype, char *, size_t, void *);\ntypedef int (_curl_debug_callback2) (CURL *,\n    curl_infotype, char *, size_t, const void *);\ntypedef int (_curl_debug_callback3) (CURL *,\n    curl_infotype, const char *, size_t, void *);\ntypedef int (_curl_debug_callback4) (CURL *,\n    curl_infotype, const char *, size_t, const void *);\ntypedef int (_curl_debug_callback5) (CURL *,\n    curl_infotype, unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback6) (CURL *,\n    curl_infotype, unsigned char *, size_t, const void *);\ntypedef int (_curl_debug_callback7) (CURL *,\n    curl_infotype, const unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback8) (CURL *,\n    curl_infotype, const unsigned char *, size_t, const void *);\n\n/* evaluates to true if expr is of type curl_ssl_ctx_callback or \"similar\" */\n/* this is getting even messier... */\n#define _curl_is_ssl_ctx_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))\ntypedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);\n#ifdef HEADER_SSL_H\n/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX\n * this will of course break if we're included before OpenSSL headers...\n */\ntypedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,\n                                           const void *);\n#else\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;\n#endif\n\n/* evaluates to true if expr is of type curl_conv_callback or \"similar\" */\n#define _curl_is_conv_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_conv_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback4))\ntypedef CURLcode (*_curl_conv_callback1)(char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback3)(void *, size_t length);\ntypedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);\n\n/* evaluates to true if expr is of type curl_seek_callback or \"similar\" */\n#define _curl_is_seek_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_seek_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_seek_callback2))\ntypedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);\ntypedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);\n\n\n#endif /* __CURL_TYPECHECK_GCC_H */\n"
  },
  {
    "path": "cocos2d/external/curl/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE := cocos_curl_static\nLOCAL_MODULE_FILENAME := curl\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libcurl.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/edtaa3func/edtaa3func.cpp",
    "content": "/*\n * edtaa3()\n *\n * Sweep-and-update Euclidean distance transform of an\n * image. Positive pixels are treated as object pixels,\n * zero or negative pixels are treated as background.\n * An attempt is made to treat antialiased edges correctly.\n * The input image must have pixels in the range [0,1],\n * and the antialiased image should be a box-filter\n * sampling of the ideal, crisp edge.\n * If the antialias region is more than 1 pixel wide,\n * the result from this transform will be inaccurate.\n *\n * By Stefan Gustavson (stefan.gustavson@gmail.com).\n *\n * Originally written in 1994, based on a verbal\n * description of Per-Erik Danielsson's SSED8 algorithm\n * as presented in the PhD dissertation of Ingemar\n * Ragnemalm. This is Per-Erik Danielsson's scanline\n * scheme from 1979 - I only implemented it in C.\n *\n * Updated in 2004 to treat border pixels correctly,\n * and cleaned up the code to improve readability.\n *\n * Updated in 2009 to handle anti-aliased edges,\n * as published in the article \"Anti-aliased Euclidean\n * distance transform\" by Stefan Gustavson and Robin Strand,\n * Pattern Recognition Letters 32 (2011) 252C257.\n *\n * Updated in 2011 to avoid a corner case causing an\n * infinite loop for some input data.\n *\n*/\n\n/*\n Copyright (C) 2009-2011 Stefan Gustavson (stefan.gustavson@gmail.com)\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation; either version 3 of the License, or (at your\noption) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\nfor more details.\n\nThe GNU General Public License is available on <http://www.gnu.org/licenses/>.\n */\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#include <math.h>\n\n/*\n * Compute the local gradient at edge pixels using convolution filters.\n * The gradient is computed only at edge pixels. At other places in the\n * image, it is never used, and it's mostly zero anyway.\n */\nvoid computegradient(double *img, int w, int h, double *gx, double *gy)\n{\n    int i,j,k;\n    double glength;\n#define SQRT2 1.4142136\n    for(i = 1; i < h-1; i++) { // Avoid edges where the kernels would spill over\n        for(j = 1; j < w-1; j++) {\n            k = i*w + j;\n            if((img[k]>0.0) && (img[k]<1.0)) { // Compute gradient for edge pixels only\n                gx[k] = -img[k-w-1] - SQRT2*img[k-1] - img[k+w-1] + img[k-w+1] + SQRT2*img[k+1] + img[k+w+1];\n                gy[k] = -img[k-w-1] - SQRT2*img[k-w] - img[k+w-1] + img[k-w+1] + SQRT2*img[k+w] + img[k+w+1];\n                glength = gx[k]*gx[k] + gy[k]*gy[k];\n                if(glength > 0.0) { // Avoid division by zero\n                    glength = sqrt(glength);\n                    gx[k]=gx[k]/glength;\n                    gy[k]=gy[k]/glength;\n                }\n            }\n        }\n    }\n    // TODO: Compute reasonable values for gx, gy also around the image edges.\n    // (These are zero now, which reduces the accuracy for a 1-pixel wide region\n\t// around the image edge.) 2x2 kernels would be suitable for this.\n}\n\n/*\n * A somewhat tricky function to approximate the distance to an edge in a\n * certain pixel, with consideration to either the local gradient (gx,gy)\n * or the direction to the pixel (dx,dy) and the pixel greyscale value a.\n * The latter alternative, using (dx,dy), is the metric used by edtaa2().\n * Using a local estimate of the edge gradient (gx,gy) yields much better\n * accuracy at and near edges, and reduces the error even at distant pixels\n * provided that the gradient direction is accurately estimated.\n */\ndouble edgedf(double gx, double gy, double a)\n{\n    double df, glength, temp, a1;\n\n    if ((gx == 0) || (gy == 0)) { // Either A) gu or gv are zero, or B) both\n        df = 0.5-a;  // Linear approximation is A) correct or B) a fair guess\n    } else {\n        glength = sqrt(gx*gx + gy*gy);\n        if(glength>0) {\n            gx = gx/glength;\n            gy = gy/glength;\n        }\n        /* Everything is symmetric wrt sign and transposition,\n         * so move to first octant (gx>=0, gy>=0, gx>=gy) to\n         * avoid handling all possible edge directions.\n         */\n        gx = fabs(gx);\n        gy = fabs(gy);\n        if(gx<gy) {\n            temp = gx;\n            gx = gy;\n            gy = temp;\n        }\n        a1 = 0.5*gy/gx;\n        if (a < a1) { // 0 <= a < a1\n            df = 0.5*(gx + gy) - sqrt(2.0*gx*gy*a);\n        } else if (a < (1.0-a1)) { // a1 <= a <= 1-a1\n            df = (0.5-a)*gx;\n        } else { // 1-a1 < a <= 1\n            df = -0.5*(gx + gy) + sqrt(2.0*gx*gy*(1.0-a));\n        }\n    }    \n    return df;\n}\n\ndouble distaa3(double *img, double *gximg, double *gyimg, int w, int c, int xc, int yc, int xi, int yi)\n{\n  double di, df, dx, dy, gx, gy, a;\n  int closest;\n  \n  closest = c-xc-yc*w; // Index to the edge pixel pointed to from c\n  a = img[closest];    // Grayscale value at the edge pixel\n  gx = gximg[closest]; // X gradient component at the edge pixel\n  gy = gyimg[closest]; // Y gradient component at the edge pixel\n  \n  if(a > 1.0) a = 1.0;\n  if(a < 0.0) a = 0.0; // Clip grayscale values outside the range [0,1]\n  if(a == 0.0) return 1000000.0; // Not an object pixel, return \"very far\" (\"don't know yet\")\n\n  dx = (double)xi;\n  dy = (double)yi;\n  di = sqrt(dx*dx + dy*dy); // Length of integer vector, like a traditional EDT\n  if(di==0) { // Use local gradient only at edges\n      // Estimate based on local gradient only\n      df = edgedf(gx, gy, a);\n  } else {\n      // Estimate gradient based on direction to edge (accurate for large di)\n      df = edgedf(dx, dy, a);\n  }\n  return di + df; // Same metric as edtaa2, except at edges (where di=0)\n}\n\n// Shorthand macro: add ubiquitous parameters img, gx, gy and w and call distaa3()\n#define DISTAA(c,xc,yc,xi,yi) (distaa3(img, gx, gy, w, c, xc, yc, xi, yi))\n\nvoid edtaa3(double *img, double *gx, double *gy, int w, int h, short *distx, short *disty, double *dist)\n{\n  int x, y, i, c;\n  int offset_u, offset_ur, offset_r, offset_rd,\n  offset_d, offset_dl, offset_l, offset_lu;\n  double olddist, newdist;\n  int cdistx, cdisty, newdistx, newdisty;\n  int changed;\n  double epsilon = 1e-3; // Safeguard against errors due to limited precision\n\n  /* Initialize index offsets for the current image width */\n  offset_u = -w;\n  offset_ur = -w+1;\n  offset_r = 1;\n  offset_rd = w+1;\n  offset_d = w;\n  offset_dl = w-1;\n  offset_l = -1;\n  offset_lu = -w-1;\n\n  /* Initialize the distance images */\n  for(i=0; i<w*h; i++) {\n    distx[i] = 0; // At first, all pixels point to\n    disty[i] = 0; // themselves as the closest known.\n    if(img[i] <= 0.0)\n      {\n\tdist[i]= 1000000.0; // Big value, means \"not set yet\"\n      }\n    else if (img[i]<1.0) {\n      dist[i] = edgedf(gx[i], gy[i], img[i]); // Gradient-assisted estimate\n    }\n    else {\n      dist[i]= 0.0; // Inside the object\n    }\n  }\n\n  /* Perform the transformation */\n  do\n    {\n      changed = 0;\n\n      /* Scan rows, except first row */\n      for(y=1; y<h; y++)\n        {\n\n          /* move index to leftmost pixel of current row */\n          i = y*w;\n\n          /* scan right, propagate distances from above & left */\n\n          /* Leftmost pixel is special, has no left neighbors */\n          olddist = dist[i];\n          if(olddist > 0) // If non-zero distance or not set yet\n            {\n\t      c = i + offset_u; // Index of candidate for testing\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx;\n              newdisty = cdisty+1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_ur;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx-1;\n              newdisty = cdisty+1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n          i++;\n\n          /* Middle pixels have all neighbors */\n          for(x=1; x<w-1; x++, i++)\n            {\n              olddist = dist[i];\n              if(olddist <= 0) continue; // No need to update further\n\n\t      c = i+offset_l;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx+1;\n              newdisty = cdisty;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_lu;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx+1;\n              newdisty = cdisty+1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_u;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx;\n              newdisty = cdisty+1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_ur;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx-1;\n              newdisty = cdisty+1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n\n          /* Rightmost pixel of row is special, has no right neighbors */\n          olddist = dist[i];\n          if(olddist > 0) // If not already zero distance\n            {\n\t      c = i+offset_l;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx+1;\n              newdisty = cdisty;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_lu;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx+1;\n              newdisty = cdisty+1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_u;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx;\n              newdisty = cdisty+1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n\n          /* Move index to second rightmost pixel of current row. */\n          /* Rightmost pixel is skipped, it has no right neighbor. */\n          i = y*w + w-2;\n\n          /* scan left, propagate distance from right */\n          for(x=w-2; x>=0; x--, i--)\n            {\n              olddist = dist[i];\n              if(olddist <= 0) continue; // Already zero distance\n\n\t      c = i+offset_r;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx-1;\n              newdisty = cdisty;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n        }\n      \n      /* Scan rows in reverse order, except last row */\n      for(y=h-2; y>=0; y--)\n        {\n          /* move index to rightmost pixel of current row */\n          i = y*w + w-1;\n\n          /* Scan left, propagate distances from below & right */\n\n          /* Rightmost pixel is special, has no right neighbors */\n          olddist = dist[i];\n          if(olddist > 0) // If not already zero distance\n            {\n\t      c = i+offset_d;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx;\n              newdisty = cdisty-1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_dl;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx+1;\n              newdisty = cdisty-1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n          i--;\n\n          /* Middle pixels have all neighbors */\n          for(x=w-2; x>0; x--, i--)\n            {\n              olddist = dist[i];\n              if(olddist <= 0) continue; // Already zero distance\n\n\t      c = i+offset_r;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx-1;\n              newdisty = cdisty;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_rd;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx-1;\n              newdisty = cdisty-1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_d;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx;\n              newdisty = cdisty-1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_dl;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx+1;\n              newdisty = cdisty-1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n          /* Leftmost pixel is special, has no left neighbors */\n          olddist = dist[i];\n          if(olddist > 0) // If not already zero distance\n            {\n\t      c = i+offset_r;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx-1;\n              newdisty = cdisty;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_rd;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx-1;\n              newdisty = cdisty-1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  olddist=newdist;\n                  changed = 1;\n                }\n\n\t      c = i+offset_d;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx;\n              newdisty = cdisty-1;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n\n          /* Move index to second leftmost pixel of current row. */\n          /* Leftmost pixel is skipped, it has no left neighbor. */\n          i = y*w + 1;\n          for(x=1; x<w; x++, i++)\n            {\n              /* scan right, propagate distance from left */\n              olddist = dist[i];\n              if(olddist <= 0) continue; // Already zero distance\n\n\t      c = i+offset_l;\n\t      cdistx = distx[c];\n\t      cdisty = disty[c];\n              newdistx = cdistx+1;\n              newdisty = cdisty;\n              newdist = DISTAA(c, cdistx, cdisty, newdistx, newdisty);\n              if(newdist < olddist-epsilon)\n                {\n                  distx[i]=newdistx;\n                  disty[i]=newdisty;\n                  dist[i]=newdist;\n                  changed = 1;\n                }\n            }\n        }\n    }\n  while(changed); // Sweep until no more updates are made\n\n  /* The transformation is completed. */\n\n}\n#ifdef __cplusplus\n}\n#endif"
  },
  {
    "path": "cocos2d/external/edtaa3func/edtaa3func.h",
    "content": "/*\n * Copyright 2009 Stefan Gustavson (stefan.gustavson@gmail.com)\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n *  1. Redistributions of source code must retain the above copyright notice,\n *     this list of conditions and the following disclaimer.\n *\n *  2. Redistributions in binary form must reproduce the above copyright\n *     notice, this list of conditions and the following disclaimer in the\n *     documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY STEFAN GUSTAVSON ''AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL STEFAN GUSTAVSON OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are\n * those of the authors and should not be interpreted as representing official\n * policies, either expressed or implied, of Stefan Gustavson.\n *\n *\n * edtaa3()\n *\n * Sweep-and-update Euclidean distance transform of an\n * image. Positive pixels are treated as object pixels,\n * zero or negative pixels are treated as background.\n * An attempt is made to treat antialiased edges correctly.\n * The input image must have pixels in the range [0,1],\n * and the antialiased image should be a box-filter\n * sampling of the ideal, crisp edge.\n * If the antialias region is more than 1 pixel wide,\n * the result from this transform will be inaccurate.\n *\n * By Stefan Gustavson (stefan.gustavson@gmail.com).\n *\n * Originally written in 1994, based on a verbal\n * description of the SSED8 algorithm published in the\n * PhD dissertation of Ingemar Ragnemalm. This is his\n * algorithm, I only implemented it in C.\n *\n * Updated in 2004 to treat border pixels correctly,\n * and cleaned up the code to improve readability.\n *\n * Updated in 2009 to handle anti-aliased edges.\n *\n * Updated in 2011 to avoid a corner case infinite loop.\n *\n */\n#ifndef __EDTAA3FUNC_H__\n#define __EDTAA3FUNC_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n#include <math.h>\n\n\n/*\n * Compute the local gradient at edge pixels using convolution filters.\n * The gradient is computed only at edge pixels. At other places in the\n * image, it is never used, and it's mostly zero anyway.\n */\nvoid computegradient(double *img, int w, int h, double *gx, double *gy);\n\n/*\n * A somewhat tricky function to approximate the distance to an edge in a\n * certain pixel, with consideration to either the local gradient (gx,gy)\n * or the direction to the pixel (dx,dy) and the pixel greyscale value a.\n * The latter alternative, using (dx,dy), is the metric used by edtaa2().\n * Using a local estimate of the edge gradient (gx,gy) yields much better\n * accuracy at and near edges, and reduces the error even at distant pixels\n * provided that the gradient direction is accurately estimated.\n */\ndouble edgedf(double gx, double gy, double a);\n\n\ndouble distaa3(double *img, double *gximg, double *gyimg, int w, int c, int xc, int yc, int xi, int yi);\n\n// Shorthand macro: add ubiquitous parameters dist, gx, gy, img and w and call distaa3()\n#define DISTAA(c,xc,yc,xi,yi) (distaa3(img, gx, gy, w, c, xc, yc, xi, yi))\n\nvoid edtaa3(double *img, double *gx, double *gy, int w, int h, short *distx, short *disty, double *dist);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // __EDTAA3FUNC_H__\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/config/ftconfig.h",
    "content": "/* ftconfig.h.  Generated from ftconfig.in by configure.  */\n/***************************************************************************/\n/*                                                                         */\n/*  ftconfig.in                                                            */\n/*                                                                         */\n/*    UNIX-specific configuration file (specification only).               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2009, 2011, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This header file contains a number of macro definitions that are used */\n  /* by the rest of the engine.  Most of the macros here are automatically */\n  /* determined at compile time, and you should not need to change it to   */\n  /* port FreeType, except to compile the library with a non-ANSI          */\n  /* compiler.                                                             */\n  /*                                                                       */\n  /* Note however that if some specific modifications are needed, we       */\n  /* advise you to place a modified copy in your build directory.          */\n  /*                                                                       */\n  /* The build directory is usually `freetype/builds/<system>', and        */\n  /* contains system-specific files that are always included first when    */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTCONFIG_H__\n#define __FTCONFIG_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_OPTIONS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* These macros can be toggled to suit a specific system.  The current   */\n  /* ones are defaults used to compile FreeType in an ANSI C environment   */\n  /* (16bit compilers are also supported).  Copy this file to your own     */\n  /* `freetype/builds/<system>' directory, and edit it to port the engine. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define HAVE_UNISTD_H 1\n#define HAVE_FCNTL_H 1\n#define HAVE_STDINT_H 1\n\n\n  /* There are systems (like the Texas Instruments 'C54x) where a `char' */\n  /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */\n  /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */\n  /* is probably unexpected.                                             */\n  /*                                                                     */\n  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */\n  /* `char' type.                                                        */\n\n#ifndef FT_CHAR_BIT\n#define FT_CHAR_BIT  CHAR_BIT\n#endif\n\n\n/* #undef FT_USE_AUTOCONF_SIZEOF_TYPES */\n#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES\n\n#define SIZEOF_INT 4\n#define SIZEOF_LONG 4\n#define FT_SIZEOF_INT  SIZEOF_INT\n#define FT_SIZEOF_LONG SIZEOF_LONG\n\n#else /* !FT_USE_AUTOCONF_SIZEOF_TYPES */\n\n  /* Following cpp computation of the bit length of int and long */\n  /* is copied from default include/freetype/config/ftconfig.h.  */\n  /* If any improvement is required for this file, it should be  */\n  /* applied to the original header file for the builders that   */\n  /* does not use configure script.                              */\n\n  /* The size of an `int' type.  */\n#if                                 FT_UINT_MAX == 0xFFFFUL\n#define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)\n#elif                               FT_UINT_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)\n#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `int' type!\"\n#endif\n\n  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */\n  /* DM642) is recognized but avoided.                                   */\n#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `long' type!\"\n#endif\n\n#endif /* !FT_USE_AUTOCONF_SIZEOF_TYPES */\n\n\n  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */\n  /* used -- this is only used to get rid of unpleasant compiler warnings */\n#ifndef FT_UNUSED\n#define FT_UNUSED( arg )  ( (arg) = (arg) )\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     AUTOMATIC CONFIGURATION MACROS                    */\n  /*                                                                       */\n  /* These macros are computed from the ones defined above.  Don't touch   */\n  /* their definition, unless you know precisely what you are doing.  No   */\n  /* porter should need to mess with them.                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Mac support                                                           */\n  /*                                                                       */\n  /*   This is the only necessary change, so it is defined here instead    */\n  /*   providing a new configuration file.                                 */\n  /*                                                                       */\n#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )\n  /* no Carbon frameworks for 64bit 10.4.x */\n  /* AvailabilityMacros.h is available since Mac OS X 10.2,        */\n  /* so guess the system version by maximum errno before inclusion */\n#include <errno.h>\n#ifdef ECANCELED /* defined since 10.2 */\n#include \"AvailabilityMacros.h\"\n#endif\n#if defined( __LP64__ ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )\n#undef FT_MACINTOSH\n#endif\n\n#elif defined( __SC__ ) || defined( __MRC__ )\n  /* Classic MacOS compilers */\n#include \"ConditionalMacros.h\"\n#if TARGET_OS_MAC\n#define FT_MACINTOSH 1\n#endif\n\n#endif\n\n\n  /* Fix compiler warning with sgi compiler */\n#if defined( __sgi ) && !defined( __GNUC__ )\n#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )\n#pragma set woff 3505\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int16                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit signed integer type.                         */\n  /*                                                                       */\n  typedef signed short  FT_Int16;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt16                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit unsigned integer type.                       */\n  /*                                                                       */\n  typedef unsigned short  FT_UInt16;\n\n  /* */\n\n\n  /* this #if 0 ... #endif clause is for documentation purposes */\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int32                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 32bit signed integer type.  The size depends on    */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef signed XXX  FT_Int32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt32                                                          */\n  /*                                                                       */\n  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int64                                                           */\n  /*                                                                       */\n  /*    A typedef for a 64bit signed integer type.  The size depends on    */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef signed XXX  FT_Int64;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt64                                                          */\n  /*                                                                       */\n  /*    A typedef for a 64bit unsigned integer type.  The size depends on  */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt64;\n\n  /* */\n\n#endif\n\n#if FT_SIZEOF_INT == 4\n\n  typedef signed int      FT_Int32;\n  typedef unsigned int    FT_UInt32;\n\n#elif FT_SIZEOF_LONG == 4\n\n  typedef signed long     FT_Int32;\n  typedef unsigned long   FT_UInt32;\n\n#else\n#error \"no 32bit type found -- please check your configuration files\"\n#endif\n\n\n  /* look up an integer type that is at least 32 bits */\n#if FT_SIZEOF_INT >= 4\n\n  typedef int            FT_Fast;\n  typedef unsigned int   FT_UFast;\n\n#elif FT_SIZEOF_LONG >= 4\n\n  typedef long           FT_Fast;\n  typedef unsigned long  FT_UFast;\n\n#endif\n\n\n  /* determine whether we have a 64-bit int type for platforms without */\n  /* Autoconf                                                          */\n#if FT_SIZEOF_LONG == 8\n\n  /* FT_LONG64 must be defined if a 64-bit type is available */\n#define FT_LONG64\n#define FT_INT64  long\n\n#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64  __int64\n\n#elif defined( __BORLANDC__ )  /* Borland C++ */\n\n  /* XXXX: We should probably check the value of __BORLANDC__ in order */\n  /*       to test the compiler version.                               */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64  __int64\n\n#elif defined( __WATCOMC__ )   /* Watcom C++ */\n\n  /* Watcom doesn't provide 64-bit data types */\n\n#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */\n\n#define FT_LONG64\n#define FT_INT64  long long int\n\n#elif defined( __GNUC__ )\n\n  /* GCC provides the `long long' type */\n#define FT_LONG64\n#define FT_INT64  long long int\n\n#endif /* FT_SIZEOF_LONG == 8 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A 64-bit data type will create compilation problems if you compile    */\n  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */\n  /* is defined.  You can however ignore this rule by defining the         */\n  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */\n  /*                                                                       */\n#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )\n\n#ifdef __STDC__\n\n  /* Undefine the 64-bit macros in strict ANSI compilation mode.  */\n  /* Since `#undef' doesn't survive in configuration header files */\n  /* we use the postprocessing facility of AC_CONFIG_HEADERS to   */\n  /* replace the leading `/' with `#'.                            */\n#undef FT_LONG64\n#undef FT_INT64\n\n#endif /* __STDC__ */\n\n#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */\n\n#ifdef FT_LONG64\n  typedef FT_INT64   FT_Int64;\n  typedef FT_UINT64  FT_UInt64;\n#endif\n\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT\n\n\n#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER\n  /* Provide assembler fragments for performance-critical functions. */\n  /* These must be defined `static __inline__' with GCC.             */\n\n#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm\n    {\n      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */\n      mov   a,  t,  asr #31         /* a   = (hi >> 31) */\n      add   a,  a,  #0x8000         /* a  += 0x8000 */\n      adds  t2, t2, a               /* t2 += a */\n      adc   t,  t,  #0              /* t  += carry */\n      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */\n      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */\n    }\n    return a;\n  }\n\n#endif /* __CC_ARM || __ARMCC__ */\n\n\n#ifdef __GNUC__\n\n#if defined( __arm__ ) && !defined( __thumb__ )    && \\\n    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm__ __volatile__ (\n      \"smull  %1, %2, %4, %3\\n\\t\"       /* (lo=%1,hi=%2) = a*b */\n      \"mov    %0, %2, asr #31\\n\\t\"      /* %0  = (hi >> 31) */\n      \"add    %0, %0, #0x8000\\n\\t\"      /* %0 += 0x8000 */\n      \"adds   %1, %1, %0\\n\\t\"           /* %1 += %0 */\n      \"adc    %2, %2, #0\\n\\t\"           /* %2 += carry */\n      \"mov    %0, %1, lsr #16\\n\\t\"      /* %0  = %1 >> 16 */\n      \"orr    %0, %0, %2, lsl #16\\n\\t\"  /* %0 |= %2 << 16 */\n      : \"=r\"(a), \"=&r\"(t2), \"=&r\"(t)\n      : \"r\"(a), \"r\"(b)\n      : \"cc\" );\n    return a;\n  }\n\n#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */\n\n#if defined( __i386__ )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n\n    __asm__ __volatile__ (\n      \"imul  %%edx\\n\"\n      \"movl  %%edx, %%ecx\\n\"\n      \"sarl  $31, %%ecx\\n\"\n      \"addl  $0x8000, %%ecx\\n\"\n      \"addl  %%ecx, %%eax\\n\"\n      \"adcl  $0, %%edx\\n\"\n      \"shrl  $16, %%eax\\n\"\n      \"shll  $16, %%edx\\n\"\n      \"addl  %%edx, %%eax\\n\"\n      : \"=a\"(result), \"=d\"(b)\n      : \"a\"(a), \"d\"(b)\n      : \"%ecx\", \"cc\" );\n    return result;\n  }\n\n#endif /* i386 */\n\n#endif /* __GNUC__ */\n\n\n#ifdef _MSC_VER /* Visual C++ */\n\n#ifdef _M_IX86\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n    __asm\n    {\n      mov eax, a\n      mov edx, b\n      imul edx\n      mov ecx, edx\n      sar ecx, 31\n      add ecx, 8000h\n      add eax, ecx\n      adc edx, 0\n      shr eax, 16\n      shl edx, 16\n      add eax, edx\n      mov result, eax\n    }\n    return result;\n  }\n\n#endif /* _M_IX86 */\n\n#endif /* _MSC_VER */\n\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n#ifdef FT_CONFIG_OPTION_INLINE_MULFIX\n#ifdef FT_MULFIX_ASSEMBLER\n#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER\n#endif\n#endif\n\n\n#ifdef FT_MAKE_OPTION_SINGLE_OBJECT\n\n#define FT_LOCAL( x )      static  x\n#define FT_LOCAL_DEF( x )  static  x\n\n#else\n\n#ifdef __cplusplus\n#define FT_LOCAL( x )      extern \"C\"  x\n#define FT_LOCAL_DEF( x )  extern \"C\"  x\n#else\n#define FT_LOCAL( x )      extern  x\n#define FT_LOCAL_DEF( x )  x\n#endif\n\n#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */\n\n\n#ifndef FT_BASE\n\n#ifdef __cplusplus\n#define FT_BASE( x )  extern \"C\"  x\n#else\n#define FT_BASE( x )  extern  x\n#endif\n\n#endif /* !FT_BASE */\n\n\n#ifndef FT_BASE_DEF\n\n#ifdef __cplusplus\n#define FT_BASE_DEF( x )  x\n#else\n#define FT_BASE_DEF( x )  x\n#endif\n\n#endif /* !FT_BASE_DEF */\n\n\n#ifndef FT_EXPORT\n\n#ifdef __cplusplus\n#define FT_EXPORT( x )  extern \"C\"  x\n#else\n#define FT_EXPORT( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT */\n\n\n#ifndef FT_EXPORT_DEF\n\n#ifdef __cplusplus\n#define FT_EXPORT_DEF( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_DEF( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_DEF */\n\n\n#ifndef FT_EXPORT_VAR\n\n#ifdef __cplusplus\n#define FT_EXPORT_VAR( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_VAR */\n\n  /* The following macros are needed to compile the library with a   */\n  /* C++ compiler and with 16bit compilers.                          */\n  /*                                                                 */\n\n  /* This is special.  Within C++, you must specify `extern \"C\"' for */\n  /* functions which are used via function pointers, and you also    */\n  /* must do that for structures which contain function pointers to  */\n  /* assure C linkage -- it's not possible to have (local) anonymous */\n  /* functions which are accessed by (global) function pointers.     */\n  /*                                                                 */\n  /*                                                                 */\n  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */\n  /* contains pointers to callback functions.                        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */\n  /* that contains pointers to callback functions.                   */\n  /*                                                                 */\n  /*                                                                 */\n  /* Some 16bit compilers have to redefine these macros to insert    */\n  /* the infamous `_cdecl' or `__fastcall' declarations.             */\n  /*                                                                 */\n#ifndef FT_CALLBACK_DEF\n#ifdef __cplusplus\n#define FT_CALLBACK_DEF( x )  extern \"C\"  x\n#else\n#define FT_CALLBACK_DEF( x )  static  x\n#endif\n#endif /* FT_CALLBACK_DEF */\n\n#ifndef FT_CALLBACK_TABLE\n#ifdef __cplusplus\n#define FT_CALLBACK_TABLE      extern \"C\"\n#define FT_CALLBACK_TABLE_DEF  extern \"C\"\n#else\n#define FT_CALLBACK_TABLE      extern\n#define FT_CALLBACK_TABLE_DEF  /* nothing */\n#endif\n#endif /* FT_CALLBACK_TABLE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCONFIG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/config/ftheader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftheader.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_HEADER_H__\n#define __FT_HEADER_H__\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_BEGIN_HEADER                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_END_HEADER in header    */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_BEGIN_HEADER  extern \"C\" {\n#else\n#define FT_BEGIN_HEADER  /* nothing */\n#endif\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_END_HEADER                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_BEGIN_HEADER in header  */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_END_HEADER  }\n#else\n#define FT_END_HEADER  /* nothing */\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Aliases for the FreeType 2 public and configuration files.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_file_macros                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Header File Macros                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Macro definitions used to #include specific header files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following macros are defined to the name of specific           */\n  /*    FreeType~2 header files.  They can be used directly in #include    */\n  /*    statements as in:                                                  */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_MULTIPLE_MASTERS_H                                   */\n  /*      #include FT_GLYPH_H                                              */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    There are several reasons why we are now using macros to name      */\n  /*    public header files.  The first one is that such macros are not    */\n  /*    limited to the infamous 8.3~naming rule required by DOS (and       */\n  /*    `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').   */\n  /*                                                                       */\n  /*    The second reason is that it allows for more flexibility in the    */\n  /*    way FreeType~2 is installed on a given system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* configuration files */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_CONFIG_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 configuration data.\n   *\n   */\n#ifndef FT_CONFIG_CONFIG_H\n#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_STANDARD_LIBRARY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 interface to the standard C library functions.\n   *\n   */\n#ifndef FT_CONFIG_STANDARD_LIBRARY_H\n#define FT_CONFIG_STANDARD_LIBRARY_H  <freetype/config/ftstdlib.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_OPTIONS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 project-specific configuration options.\n   *\n   */\n#ifndef FT_CONFIG_OPTIONS_H\n#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_MODULES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 modules that are statically linked to new library\n   *   instances in @FT_Init_FreeType.\n   *\n   */\n#ifndef FT_CONFIG_MODULES_H\n#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>\n#endif\n\n  /* */\n\n  /* public headers */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_FREETYPE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   base FreeType~2 API.\n   *\n   */\n#define FT_FREETYPE_H  <freetype/freetype.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 error codes (and messages).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_ERRORS_H  <freetype/fterrors.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 module error offsets (and messages).\n   *\n   */\n#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYSTEM_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 interface to low-level operations (i.e., memory management\n   *   and stream i/o).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_SYSTEM_H  <freetype/ftsystem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing type\n   *   definitions related to glyph images (i.e., bitmaps, outlines,\n   *   scan-converter parameters).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_IMAGE_H  <freetype/ftimage.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   basic data types defined by FreeType~2.\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_TYPES_H  <freetype/fttypes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LIST_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list management API of FreeType~2.\n   *\n   *   (Most applications will never need to include this file.)\n   *\n   */\n#define FT_LIST_H  <freetype/ftlist.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OUTLINE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   scalable outline management API of FreeType~2.\n   *\n   */\n#define FT_OUTLINE_H  <freetype/ftoutln.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SIZES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API which manages multiple @FT_Size objects per face.\n   *\n   */\n#define FT_SIZES_H  <freetype/ftsizes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   module management API of FreeType~2.\n   *\n   */\n#define FT_MODULE_H  <freetype/ftmodapi.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_RENDER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   renderer module management API of FreeType~2.\n   *\n   */\n#define FT_RENDER_H  <freetype/ftrender.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_AUTOHINTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the auto-hinting module.\n   *\n   */\n#define FT_AUTOHINTER_H  <freetype/ftautoh.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CFF_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the CFF driver module.\n   *\n   */\n#define FT_CFF_DRIVER_H  <freetype/ftcffdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the TrueType driver module.\n   *\n   */\n#define FT_TRUETYPE_DRIVER_H  <freetype/ftttdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPE1_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the Type~1 format.\n   *\n   */\n#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_IDS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   enumeration values which identify name strings, languages, encodings,\n   *   etc.  This file really contains a _large_ set of constant macro\n   *   definitions, taken from the TrueType and OpenType specifications.\n   *\n   */\n#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the TrueType (as well as OpenType) format.\n   *\n   */\n#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TAGS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of TrueType four-byte `tags' which identify blocks in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BDF_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which accesses BDF-specific strings from a\n   *   face.\n   *\n   */\n#define FT_BDF_H  <freetype/ftbdf.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CID_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which access CID font information from a\n   *   face.\n   *\n   */\n#define FT_CID_H  <freetype/ftcid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GZIP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports gzip-compressed files.\n   *\n   */\n#define FT_GZIP_H  <freetype/ftgzip.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LZW_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports LZW-compressed files.\n   *\n   */\n#define FT_LZW_H  <freetype/ftlzw.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BZIP2_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports bzip2-compressed files.\n   *\n   */\n#define FT_BZIP2_H  <freetype/ftbzip2.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_WINFONTS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports Windows FNT files.\n   *\n   */\n#define FT_WINFONTS_H   <freetype/ftwinfnt.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GLYPH_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional glyph management component.\n   *\n   */\n#define FT_GLYPH_H  <freetype/ftglyph.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BITMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional bitmap conversion component.\n   *\n   */\n#define FT_BITMAP_H  <freetype/ftbitmap.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BBOX_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional exact bounding box computation routines.\n   *\n   */\n#define FT_BBOX_H  <freetype/ftbbox.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional FreeType~2 cache sub-system.\n   *\n   */\n#define FT_CACHE_H  <freetype/ftcache.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `glyph image' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for @FT_Glyph elements.  You can also\n   *   use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to\n   *   store small glyph bitmaps, as it will use less memory.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   glyph image-related cache declarations.\n   *\n   */\n#define FT_CACHE_IMAGE_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_SMALL_BITMAPS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `small bitmaps' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for small glyph bitmaps in a relatively\n   *   memory-efficient way.  You can also use the API defined in\n   *   @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,\n   *   including scalable outlines.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   small bitmaps-related cache declarations.\n   *\n   */\n#define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_CHARMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `charmap' API of the FreeType~2 cache sub-system.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   charmap-based cache declarations.\n   *\n   */\n#define FT_CACHE_CHARMAP_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MAC_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   Macintosh-specific FreeType~2 API.  The latter is used to access\n   *   fonts embedded in resource forks.\n   *\n   *   This header file must be explicitly included by client applications\n   *   compiled on the Mac (note that the base API still works though).\n   *\n   */\n#define FT_MAC_H  <freetype/ftmac.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MULTIPLE_MASTERS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional multiple-masters management API of FreeType~2.\n   *\n   */\n#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SFNT_NAMES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which accesses embedded `name' strings in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OPENTYPE_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates OpenType tables (BASE, GDEF,\n   *   GPOS, GSUB, JSTF).\n   *\n   */\n#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GX_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,\n   *   mort, morx, bsln, just, kern, opbd, trak, prop).\n   *\n   */\n#define FT_GX_VALIDATE_H  <freetype/ftgxval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_PFR_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which accesses PFR-specific data.\n   *\n   */\n#define FT_PFR_H  <freetype/ftpfr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_STROKER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions to stroke outline paths.\n   */\n#define FT_STROKER_H  <freetype/ftstroke.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYNTHESIS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs artificial obliquing and emboldening.\n   */\n#define FT_SYNTHESIS_H  <freetype/ftsynth.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_XFREE86_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions specific to the XFree86 and\n   *   X.Org X11 servers.\n   */\n#define FT_XFREE86_H  <freetype/ftxf86.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRIGONOMETRY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs trigonometric computations (e.g.,\n   *   cosines and arc tangents).\n   */\n#define FT_TRIGONOMETRY_H  <freetype/fttrigon.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LCD_FILTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_LCD_FILTER_H  <freetype/ftlcdfil.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_UNPATENTED_HINTING_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_UNPATENTED_HINTING_H  <freetype/ttunpat.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_INCREMENTAL_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_INCREMENTAL_H  <freetype/ftincrem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GASP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns entries from the TrueType GASP table.\n   */\n#define FT_GASP_H  <freetype/ftgasp.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ADVANCES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns individual and ranged glyph advances.\n   */\n#define FT_ADVANCES_H  <freetype/ftadvanc.h>\n\n\n  /* */\n\n#define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>\n\n\n  /* The internals of the cache sub-system are no longer exposed.  We */\n  /* default to FT_CACHE_H at the moment just in case, but we know of */\n  /* no rogue client that uses them.                                  */\n  /*                                                                  */\n#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>\n\n\n#define FT_INCREMENTAL_H          <freetype/ftincrem.h>\n\n#define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>\n\n\n  /*\n   * Include internal headers definitions from <freetype/internal/...>\n   * only when building the library.\n   */\n#ifdef FT2_BUILD_LIBRARY\n#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>\n#include FT_INTERNAL_INTERNAL_H\n#endif /* FT2_BUILD_LIBRARY */\n\n\n#endif /* __FT2_BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/config/ftmodule.h",
    "content": "/* This is a generated file. */\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\n/* EOF */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/config/ftoption.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoption.h                                                             */\n/*                                                                         */\n/*    User-selectable configuration macros (specification only).           */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOPTION_H__\n#define __FTOPTION_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* This file contains the default configuration macro definitions for    */\n  /* a standard build of the FreeType library.  There are three ways to    */\n  /* use this file to build project-specific versions of the library:      */\n  /*                                                                       */\n  /*  - You can modify this file by hand, but this is not recommended in   */\n  /*    cases where you would like to build several versions of the        */\n  /*    library from a single source directory.                            */\n  /*                                                                       */\n  /*  - You can put a copy of this file in your build directory, more      */\n  /*    precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD'   */\n  /*    is the name of a directory that is included _before_ the FreeType  */\n  /*    include path during compilation.                                   */\n  /*                                                                       */\n  /*    The default FreeType Makefiles and Jamfiles use the build          */\n  /*    directory `builds/<system>' by default, but you can easily change  */\n  /*    that for your own projects.                                        */\n  /*                                                                       */\n  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */\n  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */\n  /*    locate this file during the build.  For example,                   */\n  /*                                                                       */\n  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */\n  /*      #include <freetype/config/ftheader.h>                            */\n  /*                                                                       */\n  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */\n  /*    definitions.                                                       */\n  /*                                                                       */\n  /*    Note also that you can similarly pre-define the macro              */\n  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */\n  /*    that are statically linked to the library at compile time.  By     */\n  /*    default, this file is <freetype/config/ftmodule.h>.                */\n  /*                                                                       */\n  /*  We highly recommend using the third method whenever possible.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the line below if you want to activate sub-pixel rendering  */\n  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */\n  /*                                                                       */\n  /* Note that this feature is covered by several Microsoft patents        */\n  /* and should not be activated in any default build of the library.      */\n  /*                                                                       */\n  /* This macro has no impact on the FreeType API, only on its             */\n  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */\n  /* FT_Render_Glyph still generates a bitmap that is 3 times wider than   */\n  /* the original size in case this macro isn't defined; however, each     */\n  /* triplet of subpixels has R=G=B.                                       */\n  /*                                                                       */\n  /* This is done to allow FreeType clients to run unmodified, forcing     */\n  /* them to display normal gray-level anti-aliased glyphs.                */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */\n  /* by FreeType to speed up some computations.  However, this will create */\n  /* some problems when compiling the library in strict ANSI mode.         */\n  /*                                                                       */\n  /* For this reason, the use of 64-bit integers is normally disabled when */\n  /* the __STDC__ macro is defined.  You can however disable this by       */\n  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */\n  /*                                                                       */\n  /* For most compilers, this will only create compilation warnings when   */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* ObNote: The compiler-specific 64-bit integers are detected in the     */\n  /*         file `ftconfig.h' either statically or through the            */\n  /*         `configure' script on supported platforms.                    */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_FORCE_INT64\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, do not try to use an assembler version of   */\n  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */\n  /* that to verify that the assembler function works properly, or to      */\n  /* execute benchmark tests of the various implementations.               */\n/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, try to use an inlined assembler version of  */\n  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */\n  /* hinting glyphs, and which should be executed as fast as possible.     */\n  /*                                                                       */\n  /* Note that if your compiler or CPU is not supported, this will default */\n  /* to the standard and portable implementation found in `ftcalc.c'.      */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INLINE_MULFIX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LZW-compressed file support.                                          */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `compress' program.  This is mostly used to parse many of the PCF   */\n  /*   files that come with various X11 distributions.  The implementation */\n  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */\n  /*   (see src/lzw/ftgzip.c).                                             */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_LZW\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Gzip-compressed file support.                                         */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `gzip' program.  This is mostly used to parse many of the PCF files */\n  /*   that come with XFree86.  The implementation uses `zlib' to          */\n  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.  See also   */\n  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_ZLIB\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ZLib library selection                                                */\n  /*                                                                       */\n  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */\n  /*   It allows FreeType's `ftgzip' component to link to the system's     */\n  /*   installation of the ZLib library.  This is useful on systems like   */\n  /*   Unix or VMS where it generally is already available.                */\n  /*                                                                       */\n  /*   If you let it undefined, the component will use its own copy        */\n  /*   of the zlib sources instead.  These have been modified to be        */\n  /*   included directly within the component and *not* export external    */\n  /*   function names.  This allows you to link any program with FreeType  */\n  /*   _and_ ZLib without linking conflicts.                               */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bzip2-compressed file support.                                        */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `bzip2' program.  This is mostly used to parse many of the PCF      */\n  /*   files that come with XFree86.  The implementation uses `libbz2' to  */\n  /*   partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */\n  /*   Contrary to gzip, bzip2 currently is not included and need to use   */\n  /*   the system available bzip2 implementation.                          */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_BZIP2 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define to disable the use of file stream functions and types, FILE,   */\n  /* fopen() etc.  Enables the use of smaller system libraries on embedded */\n  /* systems that have multiple system libraries, some with or without     */\n  /* file stream support, in the cases where file stream support is not    */\n  /* necessary such as memory loading of font files.                       */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  PNG bitmap support.                                                  */\n  /*                                                                       */\n  /*   FreeType now handles loading color bitmap glyphs in the PNG format. */\n  /*   This requires help from the external libpng library.  Uncompressed  */\n  /*   color bitmaps do not need any external libraries and will be        */\n  /*   supported regardless of this configuration.                         */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_PNG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DLL export compilation                                                */\n  /*                                                                       */\n  /*   When compiling FreeType as a DLL, some systems/compilers need a     */\n  /*   special keyword in front OR after the return type of function       */\n  /*   declarations.                                                       */\n  /*                                                                       */\n  /*   Two macros are used within the FreeType source code to define       */\n  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */\n  /*                                                                       */\n  /*     FT_EXPORT( return_type )                                          */\n  /*                                                                       */\n  /*       is used in a function declaration, as in                        */\n  /*                                                                       */\n  /*         FT_EXPORT( FT_Error )                                         */\n  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */\n  /*                                                                       */\n  /*                                                                       */\n  /*     FT_EXPORT_DEF( return_type )                                      */\n  /*                                                                       */\n  /*       is used in a function definition, as in                         */\n  /*                                                                       */\n  /*         FT_EXPORT_DEF( FT_Error )                                     */\n  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */\n  /*         {                                                             */\n  /*           ... some code ...                                           */\n  /*           return FT_Err_Ok;                                           */\n  /*         }                                                             */\n  /*                                                                       */\n  /*   You can provide your own implementation of FT_EXPORT and            */\n  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */\n  /*   will be later automatically defined as `extern return_type' to      */\n  /*   allow normal compilation.                                           */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_EXPORT(x)      extern x */\n/* #define FT_EXPORT_DEF(x)  x */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Glyph Postscript Names handling                                       */\n  /*                                                                       */\n  /*   By default, FreeType 2 is compiled with the `psnames' module.  This */\n  /*   module is in charge of converting a glyph name string into a        */\n  /*   Unicode value, or return a Macintosh standard glyph name for the    */\n  /*   use with the TrueType `post' table.                                 */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want `psnames' compiled in your   */\n  /*   build of FreeType.  This has the following effects:                 */\n  /*                                                                       */\n  /*   - The TrueType driver will provide its own set of glyph names,      */\n  /*     if you build it to support postscript names in the TrueType       */\n  /*     `post' table.                                                     */\n  /*                                                                       */\n  /*   - The Type 1 driver will not be able to synthesize a Unicode        */\n  /*     charmap out of the glyphs found in the fonts.                     */\n  /*                                                                       */\n  /*   You would normally undefine this configuration macro when building  */\n  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Postscript Names to Unicode Values support                            */\n  /*                                                                       */\n  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */\n  /*   in.  Among other things, the module is used to convert a glyph name */\n  /*   into a Unicode value.  This is especially useful in order to        */\n  /*   synthesize on the fly a Unicode charmap from the CFF/Type 1 driver  */\n  /*   through a big table named the `Adobe Glyph List' (AGL).             */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want the Adobe Glyph List         */\n  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */\n  /*   able to synthesize a Unicode charmap out of the glyphs found in the */\n  /*   fonts.                                                              */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for Mac fonts                                                 */\n  /*                                                                       */\n  /*   Define this macro if you want support for outline fonts in Mac      */\n  /*   format (mac dfont, mac resource, macbinary containing a mac         */\n  /*   resource) on non-Mac platforms.                                     */\n  /*                                                                       */\n  /*   Note that the `FOND' resource isn't checked.                        */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_MAC_FONTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Guessing methods to access embedded resource forks                    */\n  /*                                                                       */\n  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */\n  /*   GNU/Linux).                                                         */\n  /*                                                                       */\n  /*   Resource forks which include fonts data are stored sometimes in     */\n  /*   locations which users or developers don't expected.  In some cases, */\n  /*   resource forks start with some offset from the head of a file.  In  */\n  /*   other cases, the actual resource fork is stored in file different   */\n  /*   from what the user specifies.  If this option is activated,         */\n  /*   FreeType tries to guess whether such offsets or different file      */\n  /*   names must be used.                                                 */\n  /*                                                                       */\n  /*   Note that normal, direct access of resource forks is controlled via */\n  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */\n  /*                                                                       */\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Allow the use of FT_Incremental_Interface to load typefaces that      */\n  /* contain no glyph data, but supply it via a callback function.         */\n  /* This is required by clients supporting document formats which         */\n  /* supply font data incrementally as the document is parsed, such        */\n  /* as the Ghostscript interpreter for the PostScript language.           */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INCREMENTAL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The size in bytes of the render pool used by the scan-line converter  */\n  /* to do all of its work.                                                */\n  /*                                                                       */\n  /* This must be greater than 4KByte if you use FreeType to rasterize     */\n  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */\n  /* allocation of the render pool.                                        */\n  /*                                                                       */\n#define FT_RENDER_POOL_SIZE  16384L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MAX_MODULES                                                        */\n  /*                                                                       */\n  /*   The maximum number of modules that can be registered in a single    */\n  /*   FreeType library object.  32 is the default.                        */\n  /*                                                                       */\n#define FT_MAX_MODULES  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Debug level                                                           */\n  /*                                                                       */\n  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */\n  /*   errors are reported through the `ftdebug' component.  In trace      */\n  /*   mode, additional messages are sent to the standard output during    */\n  /*   execution.                                                          */\n  /*                                                                       */\n  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */\n  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */\n  /*                                                                       */\n  /*   Don't define any of these macros to compile in `release' mode!      */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_LEVEL_ERROR */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Autofitter debugging                                                  */\n  /*                                                                       */\n  /*   If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to     */\n  /*   control the autofitter behaviour for debugging purposes with global */\n  /*   boolean variables (consequently, you should *never* enable this     */\n  /*   while compiling in `release' mode):                                 */\n  /*                                                                       */\n  /*     _af_debug_disable_horz_hints                                      */\n  /*     _af_debug_disable_vert_hints                                      */\n  /*     _af_debug_disable_blue_hints                                      */\n  /*                                                                       */\n  /*   Additionally, the following functions provide dumps of various      */\n  /*   internal autofit structures to stdout (using `printf'):             */\n  /*                                                                       */\n  /*     af_glyph_hints_dump_points                                        */\n  /*     af_glyph_hints_dump_segments                                      */\n  /*     af_glyph_hints_dump_edges                                         */\n  /*                                                                       */\n  /*   As an argument, they use another global variable:                   */\n  /*                                                                       */\n  /*     _af_debug_hints                                                   */\n  /*                                                                       */\n  /*   Please have a look at the `ftgrid' demo program to see how those    */\n  /*   variables and macros should be used.                                */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_AUTOFIT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Memory Debugging                                                      */\n  /*                                                                       */\n  /*   FreeType now comes with an integrated memory debugger that is       */\n  /*   capable of detecting simple errors like memory leaks or double      */\n  /*   deletes.  To compile it within your build of the library, you       */\n  /*   should define FT_DEBUG_MEMORY here.                                 */\n  /*                                                                       */\n  /*   Note that the memory debugger is only activated at runtime when     */\n  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_DEBUG_MEMORY */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Module errors                                                         */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), the higher byte  */\n  /*   of an error code gives the module in which the error has occurred,  */\n  /*   while the lower byte is the real error code.                        */\n  /*                                                                       */\n  /*   Setting this macro makes sense for debugging purposes only, since   */\n  /*   it would break source compatibility of certain programs that use    */\n  /*   FreeType 2.                                                         */\n  /*                                                                       */\n  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Position Independent Code                                             */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), FreeType2 will   */\n  /*   avoid creating constants that require address fixups.  Instead the  */\n  /*   constants will be moved into a struct and additional intialization  */\n  /*   code will be used.                                                  */\n  /*                                                                       */\n  /*   Setting this macro is needed for systems that prohibit address      */\n  /*   fixups, such as BREW.                                               */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */\n  /* embedded bitmaps in all formats using the SFNT module (namely         */\n  /* TrueType & OpenType).                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */\n  /* load and enumerate the glyph Postscript names in a TrueType or        */\n  /* OpenType file.                                                        */\n  /*                                                                       */\n  /* Note that when you do not compile the `PSNames' module by undefining  */\n  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */\n  /* contain additional code used to read the PS Names table from a font.  */\n  /*                                                                       */\n  /* (By default, the module uses `PSNames' to extract glyph names.)       */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */\n  /* access the internal name table in a SFNT-based format like TrueType   */\n  /* or OpenType.  The name table contains various strings used to         */\n  /* describe the font, like family name, copyright, version, etc.  It     */\n  /* does not contain any glyph name though.                               */\n  /*                                                                       */\n  /* Accessing SFNT names is done through the functions declared in        */\n  /* `freetype/ftsnames.h'.                                                */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType CMap support                                                 */\n  /*                                                                       */\n  /*   Here you can fine-tune which TrueType CMap table format shall be    */\n  /*   supported.                                                          */\n#define TT_CONFIG_CMAP_FORMAT_0\n#define TT_CONFIG_CMAP_FORMAT_2\n#define TT_CONFIG_CMAP_FORMAT_4\n#define TT_CONFIG_CMAP_FORMAT_6\n#define TT_CONFIG_CMAP_FORMAT_8\n#define TT_CONFIG_CMAP_FORMAT_10\n#define TT_CONFIG_CMAP_FORMAT_12\n#define TT_CONFIG_CMAP_FORMAT_13\n#define TT_CONFIG_CMAP_FORMAT_14\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */\n  /* a bytecode interpreter in the TrueType driver.                        */\n  /*                                                                       */\n  /* By undefining this, you will only compile the code necessary to load  */\n  /* TrueType glyphs without hinting.                                      */\n  /*                                                                       */\n  /*   Do not #undef this macro here, since the build system might         */\n  /*   define it for certain configurations only.                          */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile       */\n  /* EXPERIMENTAL subpixel hinting support into the TrueType driver.  This */\n  /* replaces the native TrueType hinting mechanism when anything but      */\n  /* FT_RENDER_MODE_MONO is requested.                                     */\n  /*                                                                       */\n  /* Enabling this causes the TrueType driver to ignore instructions under */\n  /* certain conditions.  This is done in accordance with the guide here,  */\n  /* with some minor differences:                                          */\n  /*                                                                       */\n  /*  http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */\n  /*                                                                       */\n  /* By undefining this, you only compile the code necessary to hint       */\n  /* TrueType glyphs with native TT hinting.                               */\n  /*                                                                       */\n  /*   This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */\n  /*   defined.                                                            */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */\n  /* of the TrueType bytecode interpreter is used that doesn't implement   */\n  /* any of the patented opcodes and algorithms.  The patents related to   */\n  /* TrueType hinting have expired worldwide since May 2010; this option   */\n  /* is now deprecated.                                                    */\n  /*                                                                       */\n  /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored*  */\n  /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words,  */\n  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */\n  /*                                                                       */\n  /* This macro is only useful for a small number of font files (mostly    */\n  /* for Asian scripts) that require bytecode interpretation to properly   */\n  /* load glyphs.  For all other fonts, this produces unpleasant results,  */\n  /* thus the unpatented interpreter is never used to load glyphs from     */\n  /* TrueType fonts unless one of the following two options is used.       */\n  /*                                                                       */\n  /*   - The unpatented interpreter is explicitly activated by the user    */\n  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */\n  /*     when opening the FT_Face.                                         */\n  /*                                                                       */\n  /*   - FreeType detects that the FT_Face corresponds to one of the       */\n  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */\n  /*     contains a hard-coded list of font names and other matching       */\n  /*     parameters (see function `tt_face_init' in file                   */\n  /*     `src/truetype/ttobjs.c').                                         */\n  /*                                                                       */\n  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     FT_Parameter  parameter;                                          */\n  /*     FT_Open_Args  open_args;                                          */\n  /*                                                                       */\n  /*                                                                       */\n  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */\n  /*                                                                       */\n  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */\n  /*     open_args.pathname   = my_font_pathname;                          */\n  /*     open_args.num_params = 1;                                         */\n  /*     open_args.params     = &parameter;                                */\n  /*                                                                       */\n  /*     error = FT_Open_Face( library, &open_args, index, &face );        */\n  /*     ...                                                               */\n  /*   }                                                                   */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */\n  /* bytecode interpreter with a huge switch statement, rather than a call */\n  /* table.  This results in smaller and faster code for a number of       */\n  /* architectures.                                                        */\n  /*                                                                       */\n  /* Note however that on some compiler/processor combinations, undefining */\n  /* this macro will generate faster, though larger, code.                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */\n  /* TrueType glyph loader to use Apple's definition of how to handle      */\n  /* component offsets in composite glyphs.                                */\n  /*                                                                       */\n  /* Apple and MS disagree on the default behavior of component offsets    */\n  /* in composites.  Apple says that they should be scaled by the scaling  */\n  /* factors in the transformation matrix (roughly, it's more complex)     */\n  /* while MS says they should not.  OpenType defines two bits in the      */\n  /* composite flags array which can be used to disambiguate, but old      */\n  /* fonts will not have them.                                             */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/otspec/glyf.htm                 */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */\n  /*                                                                       */\n#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */\n  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */\n  /* and avar tables).  This has many similarities to Type 1 Multiple      */\n  /* Masters support.                                                      */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */\n  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BDF\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and       */\n  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */\n  /* required.                                                             */\n  /*                                                                       */\n#define T1_MAX_DICT_DEPTH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  256\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */\n  /* files into an existing face.  Note that if set, the T1 driver will be */\n  /* unable to produce kerning distances.                                  */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_AFM\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of the Multiple Masters font support in the Type 1        */\n  /* driver.                                                               */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF       */\n  /* engine gets compiled into FreeType.  If defined, it is possible to    */\n  /* switch between the two engines using the `hinting-engine' property of */\n  /* the cff driver module.                                                */\n  /*                                                                       */\n/* #define CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with CJK (Chinese, Japanese, Korean) script    */\n  /* support.                                                              */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_CJK\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with Indic script support.                     */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_INDIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with warp hinting.  The idea of the warping    */\n  /* code is to slightly scale and shift a glyph within a single dimension */\n  /* so that as much of its segments are aligned (more or less) on the     */\n  /* grid.  To find out the optimal scaling and shifting value, various    */\n  /* parameter combinations are tried and scored.                          */\n  /*                                                                       */\n  /* This experimental option is only active if the render mode is         */\n  /* FT_RENDER_MODE_LIGHT.                                                 */\n  /*                                                                       */\n/* #define AF_CONFIG_OPTION_USE_WARPER */\n\n  /* */\n\n\n  /*\n   *  This macro is obsolete.  Support has been removed in FreeType\n   *  version 2.5.\n   */\n/* #define FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*\n   * This macro is defined if either unpatented or native TrueType\n   * hinting is requested by the definitions above.\n   */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n#define  TT_USE_BYTECODE_INTERPRETER\n#undef   TT_CONFIG_OPTION_UNPATENTED_HINTING\n#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define  TT_USE_BYTECODE_INTERPRETER\n#endif\n\nFT_END_HEADER\n\n\n#endif /* __FTOPTION_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/config/ftstdlib.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstdlib.h                                                             */\n/*                                                                         */\n/*    ANSI-specific library and header configuration file (specification   */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2002-2007, 2009, 2011-2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to group all #includes to the ANSI C library that   */\n  /* FreeType normally requires.  It also defines macros to rename the     */\n  /* standard functions within the FreeType source code.                   */\n  /*                                                                       */\n  /* Load a file which defines __FTSTDLIB_H__ before this one to override  */\n  /* it.                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSTDLIB_H__\n#define __FTSTDLIB_H__\n\n\n#include <stddef.h>\n\n#define ft_ptrdiff_t  ptrdiff_t\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           integer limits                           */\n  /*                                                                    */\n  /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */\n  /* of `int' and `long' in bytes at compile-time.  So far, this works  */\n  /* for all platforms the library has been tested on.                  */\n  /*                                                                    */\n  /* Note that on the extremely rare platforms that do not provide      */\n  /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */\n  /* old Crays where `int' is 36 bits), we do not make any guarantee    */\n  /* about the correct behaviour of FT2 with all fonts.                 */\n  /*                                                                    */\n  /* In these case, `ftconfig.h' will refuse to compile anyway with a   */\n  /* message like `couldn't find 32-bit type' or something similar.     */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <limits.h>\n\n#define FT_CHAR_BIT    CHAR_BIT\n#define FT_USHORT_MAX  USHRT_MAX\n#define FT_INT_MAX     INT_MAX\n#define FT_INT_MIN     INT_MIN\n#define FT_UINT_MAX    UINT_MAX\n#define FT_ULONG_MAX   ULONG_MAX\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                 character and string processing                    */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <string.h>\n\n#define ft_memchr   memchr\n#define ft_memcmp   memcmp\n#define ft_memcpy   memcpy\n#define ft_memmove  memmove\n#define ft_memset   memset\n#define ft_strcat   strcat\n#define ft_strcmp   strcmp\n#define ft_strcpy   strcpy\n#define ft_strlen   strlen\n#define ft_strncmp  strncmp\n#define ft_strncpy  strncpy\n#define ft_strrchr  strrchr\n#define ft_strstr   strstr\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           file handling                            */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdio.h>\n\n#define FT_FILE     FILE\n#define ft_fclose   fclose\n#define ft_fopen    fopen\n#define ft_fread    fread\n#define ft_fseek    fseek\n#define ft_ftell    ftell\n#define ft_sprintf  sprintf\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                             sorting                                */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdlib.h>\n\n#define ft_qsort  qsort\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                        memory allocation                           */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_scalloc   calloc\n#define ft_sfree     free\n#define ft_smalloc   malloc\n#define ft_srealloc  realloc\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                          miscellaneous                             */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_atol   atol\n#define ft_labs   labs\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                         execution control                          */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <setjmp.h>\n\n#define ft_jmp_buf     jmp_buf  /* note: this cannot be a typedef since */\n                                /*       jmp_buf is defined as a macro  */\n                                /*       on certain platforms           */\n\n#define ft_longjmp     longjmp\n#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */\n\n\n  /* the following is only used for debugging purposes, i.e., if */\n  /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined    */\n\n#include <stdarg.h>\n\n\n#endif /* __FTSTDLIB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/freetype.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  freetype.h                                                             */\n/*                                                                         */\n/*    FreeType high-level API and common types (specification only).       */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FREETYPE_H__\n#define __FREETYPE_H__\n\n\n#ifndef FT_FREETYPE_H\n#error \"`ft2build.h' hasn't been included yet!\"\n#error \"Please always use macros to include FreeType header files.\"\n#error \"Example:\"\n#error \"  #include <ft2build.h>\"\n#error \"  #include FT_FREETYPE_H\"\n#endif\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n#include FT_ERRORS_H\n\n\nFT_BEGIN_HEADER\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    user_allocation                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    User allocation                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should allocate FreeType data structures.  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType assumes that structures allocated by the user and passed  */\n  /*    as arguments are zeroed out except for the actual data.  In other  */\n  /*    words, it is recommended to use `calloc' (or variants of it)       */\n  /*    instead of `malloc' for allocation.                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        B A S I C   T Y P E S                          */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Base Interface                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 base font interface.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section describes the public high-level API of FreeType~2.    */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library                                                         */\n  /*    FT_Face                                                            */\n  /*    FT_Size                                                            */\n  /*    FT_GlyphSlot                                                       */\n  /*    FT_CharMap                                                         */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SCALABLE                                              */\n  /*    FT_FACE_FLAG_FIXED_SIZES                                           */\n  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */\n  /*    FT_FACE_FLAG_HORIZONTAL                                            */\n  /*    FT_FACE_FLAG_VERTICAL                                              */\n  /*    FT_FACE_FLAG_SFNT                                                  */\n  /*    FT_FACE_FLAG_KERNING                                               */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */\n  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */\n  /*    FT_FACE_FLAG_HINTER                                                */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD                                                 */\n  /*    FT_STYLE_FLAG_ITALIC                                               */\n  /*                                                                       */\n  /*    FT_SizeRec                                                         */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /*    FT_GlyphSlotRec                                                    */\n  /*    FT_Glyph_Metrics                                                   */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /*    FT_Init_FreeType                                                   */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /*    FT_New_Face                                                        */\n  /*    FT_Done_Face                                                       */\n  /*    FT_New_Memory_Face                                                 */\n  /*    FT_Open_Face                                                       */\n  /*    FT_Open_Args                                                       */\n  /*    FT_Parameter                                                       */\n  /*    FT_Attach_File                                                     */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /*    FT_Set_Char_Size                                                   */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*    FT_Request_Size                                                    */\n  /*    FT_Select_Size                                                     */\n  /*    FT_Size_Request_Type                                               */\n  /*    FT_Size_Request                                                    */\n  /*    FT_Set_Transform                                                   */\n  /*    FT_Load_Glyph                                                      */\n  /*    FT_Get_Char_Index                                                  */\n  /*    FT_Get_Name_Index                                                  */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /*    FT_OPEN_MEMORY                                                     */\n  /*    FT_OPEN_STREAM                                                     */\n  /*    FT_OPEN_PATHNAME                                                   */\n  /*    FT_OPEN_DRIVER                                                     */\n  /*    FT_OPEN_PARAMS                                                     */\n  /*                                                                       */\n  /*    FT_LOAD_DEFAULT                                                    */\n  /*    FT_LOAD_RENDER                                                     */\n  /*    FT_LOAD_MONOCHROME                                                 */\n  /*    FT_LOAD_LINEAR_DESIGN                                              */\n  /*    FT_LOAD_NO_SCALE                                                   */\n  /*    FT_LOAD_NO_HINTING                                                 */\n  /*    FT_LOAD_NO_BITMAP                                                  */\n  /*    FT_LOAD_CROP_BITMAP                                                */\n  /*                                                                       */\n  /*    FT_LOAD_VERTICAL_LAYOUT                                            */\n  /*    FT_LOAD_IGNORE_TRANSFORM                                           */\n  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */\n  /*    FT_LOAD_FORCE_AUTOHINT                                             */\n  /*    FT_LOAD_NO_RECURSE                                                 */\n  /*    FT_LOAD_PEDANTIC                                                   */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_NORMAL                                              */\n  /*    FT_LOAD_TARGET_LIGHT                                               */\n  /*    FT_LOAD_TARGET_MONO                                                */\n  /*    FT_LOAD_TARGET_LCD                                                 */\n  /*    FT_LOAD_TARGET_LCD_V                                               */\n  /*                                                                       */\n  /*    FT_Render_Glyph                                                    */\n  /*    FT_Render_Mode                                                     */\n  /*    FT_Get_Kerning                                                     */\n  /*    FT_Kerning_Mode                                                    */\n  /*    FT_Get_Track_Kerning                                               */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /*    FT_CharMapRec                                                      */\n  /*    FT_Select_Charmap                                                  */\n  /*    FT_Set_Charmap                                                     */\n  /*    FT_Get_Charmap_Index                                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING                                    */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING                             */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING                              */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING                                            */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY                                    */\n  /*                                                                       */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Glyph_Metrics                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the metrics of a single glyph.  The      */\n  /*    values are expressed in 26.6 fractional pixel format; if the flag  */\n  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */\n  /*    are expressed in font units instead.                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width ::                                                           */\n  /*      The glyph's width.                                               */\n  /*                                                                       */\n  /*    height ::                                                          */\n  /*      The glyph's height.                                              */\n  /*                                                                       */\n  /*    horiBearingX ::                                                    */\n  /*      Left side bearing for horizontal layout.                         */\n  /*                                                                       */\n  /*    horiBearingY ::                                                    */\n  /*      Top side bearing for horizontal layout.                          */\n  /*                                                                       */\n  /*    horiAdvance ::                                                     */\n  /*      Advance width for horizontal layout.                             */\n  /*                                                                       */\n  /*    vertBearingX ::                                                    */\n  /*      Left side bearing for vertical layout.                           */\n  /*                                                                       */\n  /*    vertBearingY ::                                                    */\n  /*      Top side bearing for vertical layout.  Larger positive values    */\n  /*      mean further below the vertical glyph origin.                    */\n  /*                                                                       */\n  /*    vertAdvance ::                                                     */\n  /*      Advance height for vertical layout.  Positive values mean the    */\n  /*      glyph has a positive advance downward.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */\n  /*    dimensions of the hinted glyph (in case hinting is applicable).    */\n  /*                                                                       */\n  /*    Stroking a glyph with an outside border does not increase          */\n  /*    `horiAdvance' or `vertAdvance'; you have to manually adjust these  */\n  /*    values to account for the added width and height.                  */\n  /*                                                                       */\n  typedef struct  FT_Glyph_Metrics_\n  {\n    FT_Pos  width;\n    FT_Pos  height;\n\n    FT_Pos  horiBearingX;\n    FT_Pos  horiBearingY;\n    FT_Pos  horiAdvance;\n\n    FT_Pos  vertBearingX;\n    FT_Pos  vertBearingY;\n    FT_Pos  vertAdvance;\n\n  } FT_Glyph_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure models the metrics of a bitmap strike (i.e., a set  */\n  /*    of glyphs for a given point size and resolution) in a bitmap font. */\n  /*    It is used for the `available_sizes' field of @FT_Face.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height :: The vertical distance, in pixels, between two            */\n  /*              consecutive baselines.  It is always positive.           */\n  /*                                                                       */\n  /*    width  :: The average width, in pixels, of all glyphs in the       */\n  /*              strike.                                                  */\n  /*                                                                       */\n  /*    size   :: The nominal size of the strike in 26.6 fractional        */\n  /*              points.  This field is not very useful.                  */\n  /*                                                                       */\n  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Windows FNT:                                                       */\n  /*      The nominal size given in a FNT font is not reliable.  Thus when */\n  /*      the driver finds it incorrect, it sets `size' to some calculated */\n  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */\n  /*      height given in the font, respectively.                          */\n  /*                                                                       */\n  /*    TrueType embedded bitmaps:                                         */\n  /*      `size', `width', and `height' values are not contained in the    */\n  /*      bitmap strike itself.  They are computed from the global font    */\n  /*      parameters.                                                      */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_Size_\n  {\n    FT_Short  height;\n    FT_Short  width;\n\n    FT_Pos    size;\n\n    FT_Pos    x_ppem;\n    FT_Pos    y_ppem;\n\n  } FT_Bitmap_Size;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     O B J E C T   C L A S S E S                       */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Library                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a FreeType library instance.  Each `library' is        */\n  /*    completely independent from the others; it is the `root' of a set  */\n  /*    of objects like fonts, faces, sizes, etc.                          */\n  /*                                                                       */\n  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */\n  /*    scan-line converter object (see @FT_Raster).                       */\n  /*                                                                       */\n  /*    In multi-threaded applications, make sure that the same FT_Library */\n  /*    object or any of its children doesn't get accessed in parallel.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Library objects are normally created by @FT_Init_FreeType, and     */\n  /*    destroyed with @FT_Done_FreeType.  If you need reference-counting  */\n  /*    (cf. @FT_Reference_Library), use @FT_New_Library and               */\n  /*    @FT_Done_Library.                                                  */\n  /*                                                                       */\n  typedef struct FT_LibraryRec_  *FT_Library;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Module                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType module object.  Each module can be a  */\n  /*    font driver, a renderer, or anything else that provides services   */\n  /*    to the formers.                                                    */\n  /*                                                                       */\n  typedef struct FT_ModuleRec_*  FT_Module;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType font driver object.  Each font driver */\n  /*    is a special module capable of creating faces from font files.     */\n  /*                                                                       */\n  typedef struct FT_DriverRec_*  FT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Renderer                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType renderer.  A renderer is a special    */\n  /*    module in charge of converting a glyph image to a bitmap, when     */\n  /*    necessary.  Each renderer supports a given glyph image format, and */\n  /*    one or more target surface depths.                                 */\n  /*                                                                       */\n  typedef struct FT_RendererRec_*  FT_Renderer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given typographic face object.  A face object models */\n  /*    a given typeface, in a given style.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */\n  /*    as one or more @FT_Size objects.                                   */\n  /*                                                                       */\n  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */\n  /*    a given filepathname or a custom input stream.                     */\n  /*                                                                       */\n  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_FaceRec for the publicly accessible fields of a given face */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_FaceRec_*  FT_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a face scaled to a given       */\n  /*    character size.                                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */\n  /*    functions like @FT_Load_Glyph to determine the scaling             */\n  /*    transformation which is used to load and hint glyphs and metrics.  */\n  /*                                                                       */\n  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */\n  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */\n  /*    (i.e., the scaling values) of the active @FT_Size.                 */\n  /*                                                                       */\n  /*    You can use @FT_New_Size to create additional size objects for a   */\n  /*    given @FT_Face, but they won't be used by other functions until    */\n  /*    you activate it through @FT_Activate_Size.  Only one size can be   */\n  /*    activated at any given time per face.                              */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_SizeRec for the publicly accessible fields of a given size */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_SizeRec_*  FT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given `glyph slot'.  A slot is a container where it  */\n  /*    is possible to load any of the glyphs contained in its parent      */\n  /*    face.                                                              */\n  /*                                                                       */\n  /*    In other words, each time you call @FT_Load_Glyph or               */\n  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */\n  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */\n  /*    other control information.                                         */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_GlyphSlotRec for the publicly accessible glyph fields.     */\n  /*                                                                       */\n  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given character map.  A charmap is used to translate */\n  /*    character codes in a given encoding into glyph indexes for its     */\n  /*    parent's face.  Some font formats may provide several charmaps per */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    Each face object owns zero or more charmaps, but only one of them  */\n  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */\n  /*                                                                       */\n  /*    The list of available charmaps in a face is available through the  */\n  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    The currently active charmap is available as `face->charmap'.      */\n  /*    You should call @FT_Set_Charmap to change it.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When a new face is created (either through @FT_New_Face or         */\n  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */\n  /*    the list and automatically activates it.                           */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_CharMapRec for the publicly accessible fields of a given   */\n  /*    character map.                                                     */\n  /*                                                                       */\n  typedef struct FT_CharMapRec_*  FT_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags into an unsigned long.  It is */\n  /*    used to define `encoding' identifiers (see @FT_Encoding).          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n\n#ifndef FT_ENC_TAG\n#define FT_ENC_TAG( value, a, b, c, d )         \\\n          value = ( ( (FT_UInt32)(a) << 24 ) |  \\\n                    ( (FT_UInt32)(b) << 16 ) |  \\\n                    ( (FT_UInt32)(c) <<  8 ) |  \\\n                      (FT_UInt32)(d)         )\n\n#endif /* FT_ENC_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify character sets supported by         */\n  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Despite the name, this enumeration lists specific character        */\n  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */\n  /*    UTF-8, UTF-16, etc.).                                              */\n  /*                                                                       */\n  /*    Other encodings might be defined in the future.                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_ENCODING_NONE ::                                                */\n  /*      The encoding value~0 is reserved.                                */\n  /*                                                                       */\n  /*    FT_ENCODING_UNICODE ::                                             */\n  /*      Corresponds to the Unicode character set.  This value covers     */\n  /*      all versions of the Unicode repertoire, including ASCII and      */\n  /*      Latin-1.  Most fonts include a Unicode charmap, but not all      */\n  /*      of them.                                                         */\n  /*                                                                       */\n  /*      For example, if you want to access Unicode value U+1F028 (and    */\n  /*      the font contains it), use value 0x1F028 as the input value for  */\n  /*      @FT_Get_Char_Index.                                              */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SYMBOL ::                                           */\n  /*      Corresponds to the Microsoft Symbol encoding, used to encode     */\n  /*      mathematical symbols in the 32..255 character code range.  For   */\n  /*      more information, see `http://www.ceviz.net/symbol.htm'.         */\n  /*                                                                       */\n  /*    FT_ENCODING_SJIS ::                                                */\n  /*      Corresponds to Japanese SJIS encoding.  More info at             */\n  /*      at `http://langsupport.japanreference.com/encoding.shtml'.       */\n  /*      See note on multi-byte encodings below.                          */\n  /*                                                                       */\n  /*    FT_ENCODING_GB2312 ::                                              */\n  /*      Corresponds to an encoding system for Simplified Chinese as used */\n  /*      used in mainland China.                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_BIG5 ::                                                */\n  /*      Corresponds to an encoding system for Traditional Chinese as     */\n  /*      used in Taiwan and Hong Kong.                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_WANSUNG ::                                             */\n  /*      Corresponds to the Korean encoding system known as Wansung.      */\n  /*      For more information see                                         */\n  /*      `http://www.microsoft.com/typography/unicode/949.txt'.           */\n  /*                                                                       */\n  /*    FT_ENCODING_JOHAB ::                                               */\n  /*      The Korean standard character set (KS~C 5601-1992), which        */\n  /*      corresponds to MS Windows code page 1361.  This character set    */\n  /*      includes all possible Hangeul character combinations.            */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_LATIN_1 ::                                       */\n  /*      Corresponds to a Latin-1 encoding as defined in a Type~1         */\n  /*      PostScript font.  It is limited to 256 character codes.          */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_STANDARD ::                                      */\n  /*      Corresponds to the Adobe Standard encoding, as found in Type~1,  */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_EXPERT ::                                        */\n  /*      Corresponds to the Adobe Expert encoding, as found in Type~1,    */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_CUSTOM ::                                        */\n  /*      Corresponds to a custom encoding, as found in Type~1, CFF, and   */\n  /*      OpenType/CFF fonts.  It is limited to 256 character codes.       */\n  /*                                                                       */\n  /*    FT_ENCODING_APPLE_ROMAN ::                                         */\n  /*      Corresponds to the 8-bit Apple roman encoding.  Many TrueType    */\n  /*      and OpenType fonts contain a charmap for this encoding, since    */\n  /*      older versions of Mac OS are able to use it.                     */\n  /*                                                                       */\n  /*    FT_ENCODING_OLD_LATIN_2 ::                                         */\n  /*      This value is deprecated and was never used nor reported by      */\n  /*      FreeType.  Don't use or test for it.                             */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SJIS ::                                             */\n  /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_GB2312 ::                                           */\n  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_BIG5 ::                                             */\n  /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_WANSUNG ::                                          */\n  /*      Same as FT_ENCODING_WANSUNG.  Deprecated.                        */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_JOHAB ::                                            */\n  /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    By default, FreeType automatically synthesizes a Unicode charmap   */\n  /*    for PostScript fonts, using their glyph names dictionaries.        */\n  /*    However, it also reports the encodings defined explicitly in the   */\n  /*    font file, for the cases when they are needed, with the Adobe      */\n  /*    values as well.                                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */\n  /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */\n  /*    FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out      */\n  /*    which encoding is really present.  If, for example, the            */\n  /*    `cs_registry' field is `KOI8' and the `cs_encoding' field is `R',  */\n  /*    the font is encoded in KOI8-R.                                     */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is always set (with a single exception) by the    */\n  /*    winfonts driver.  Use @FT_Get_WinFNT_Header and examine the        */\n  /*    `charset' field of the @FT_WinFNT_HeaderRec structure to find out  */\n  /*    which encoding is really present.  For example,                    */\n  /*    @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for       */\n  /*    Russian).                                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */\n  /*    and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to  */\n  /*    FT_ENCODING_APPLE_ROMAN).                                          */\n  /*                                                                       */\n  /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */\n  /*    @FT_Get_CMap_Language_ID  to query the Mac language ID which may   */\n  /*    be needed to be able to distinguish Apple encoding variants.  See  */\n  /*                                                                       */\n  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT  */\n  /*                                                                       */\n  /*    to get an idea how to do that.  Basically, if the language ID      */\n  /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */\n  /*    Then examine `encoding_id'.  If, for example, `encoding_id' is     */\n  /*    @TT_MAC_ID_ROMAN and the language ID (minus~1) is                  */\n  /*    `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.        */\n  /*    @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi       */\n  /*    variant the Arabic encoding.                                       */\n  /*                                                                       */\n  typedef enum  FT_Encoding_\n  {\n    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),\n\n    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),\n    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),\n\n    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),\n    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),\n    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),\n    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),\n    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),\n\n    /* for backwards compatibility */\n    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,\n    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,\n    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,\n    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,\n    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,\n\n    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),\n\n    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),\n\n    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )\n\n  } FT_Encoding;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_encoding_xxx                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated; use the corresponding @FT_Encoding */\n  /*    values instead.                                                    */\n  /*                                                                       */\n#define ft_encoding_none            FT_ENCODING_NONE\n#define ft_encoding_unicode         FT_ENCODING_UNICODE\n#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL\n#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1\n#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2\n#define ft_encoding_sjis            FT_ENCODING_SJIS\n#define ft_encoding_gb2312          FT_ENCODING_GB2312\n#define ft_encoding_big5            FT_ENCODING_BIG5\n#define ft_encoding_wansung         FT_ENCODING_WANSUNG\n#define ft_encoding_johab           FT_ENCODING_JOHAB\n\n#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD\n#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT\n#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM\n#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_CharMapRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The base charmap structure.                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face        :: A handle to the parent face object.                 */\n  /*                                                                       */\n  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */\n  /*                   this with @FT_Select_Charmap.                       */\n  /*                                                                       */\n  /*    platform_id :: An ID number describing the platform for the        */\n  /*                   following encoding ID.  This comes directly from    */\n  /*                   the TrueType specification and should be emulated   */\n  /*                   for other formats.                                  */\n  /*                                                                       */\n  /*    encoding_id :: A platform specific encoding number.  This also     */\n  /*                   comes from the TrueType specification and should be */\n  /*                   emulated similarly.                                 */\n  /*                                                                       */\n  typedef struct  FT_CharMapRec_\n  {\n    FT_Face      face;\n    FT_Encoding  encoding;\n    FT_UShort    platform_id;\n    FT_UShort    encoding_id;\n\n  } FT_CharMapRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 B A S E   O B J E C T   C L A S S E S                 */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Face object.                     */\n  /*                                                                       */\n  /*    This structure might change between releases of FreeType~2 and is  */\n  /*    not generally available to client applications.                    */\n  /*                                                                       */\n  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root face class structure.  A face object models a        */\n  /*    typeface in a font file.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_faces           :: The number of faces in the font file.  Some */\n  /*                           font formats can have multiple faces in     */\n  /*                           a font file.                                */\n  /*                                                                       */\n  /*    face_index          :: The index of the face in the font file.  It */\n  /*                           is set to~0 if there is only one face in    */\n  /*                           the font file.                              */\n  /*                                                                       */\n  /*    face_flags          :: A set of bit flags that give important      */\n  /*                           information about the face; see             */\n  /*                           @FT_FACE_FLAG_XXX for the details.          */\n  /*                                                                       */\n  /*    style_flags         :: A set of bit flags indicating the style of  */\n  /*                           the face; see @FT_STYLE_FLAG_XXX for the    */\n  /*                           details.                                    */\n  /*                                                                       */\n  /*    num_glyphs          :: The number of glyphs in the face.  If the   */\n  /*                           face is scalable and has sbits (see         */\n  /*                           `num_fixed_sizes'), it is set to the number */\n  /*                           of outline glyphs.                          */\n  /*                                                                       */\n  /*                           For CID-keyed fonts, this value gives the   */\n  /*                           highest CID used in the font.               */\n  /*                                                                       */\n  /*    family_name         :: The face's family name.  This is an ASCII   */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's family (like `Times New      */\n  /*                           Roman', `Bodoni', `Garamond', etc).  This   */\n  /*                           is a least common denominator used to list  */\n  /*                           fonts.  Some formats (TrueType & OpenType)  */\n  /*                           provide localized and Unicode versions of   */\n  /*                           this string.  Applications should use the   */\n  /*                           format specific interface to access them.   */\n  /*                           Can be NULL (e.g., in fonts embedded in a   */\n  /*                           PDF file).                                  */\n  /*                                                                       */\n  /*    style_name          :: The face's style name.  This is an ASCII    */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's style (like `Italic',        */\n  /*                           `Bold', `Condensed', etc).  Not all font    */\n  /*                           formats provide a style name, so this field */\n  /*                           is optional, and can be set to NULL.  As    */\n  /*                           for `family_name', some formats provide     */\n  /*                           localized and Unicode versions of this      */\n  /*                           string.  Applications should use the format */\n  /*                           specific interface to access them.          */\n  /*                                                                       */\n  /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */\n  /*                           Even if the face is scalable, there might   */\n  /*                           still be bitmap strikes, which are called   */\n  /*                           `sbits' in that case.                       */\n  /*                                                                       */\n  /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */\n  /*                           strikes in the face.  It is set to NULL if  */\n  /*                           there is no bitmap strike.                  */\n  /*                                                                       */\n  /*    num_charmaps        :: The number of charmaps in the face.         */\n  /*                                                                       */\n  /*    charmaps            :: An array of the charmaps of the face.       */\n  /*                                                                       */\n  /*    generic             :: A field reserved for client uses.  See the  */\n  /*                           @FT_Generic type description.               */\n  /*                                                                       */\n  /*    bbox                :: The font bounding box.  Coordinates are     */\n  /*                           expressed in font units (see                */\n  /*                           `units_per_EM').  The box is large enough   */\n  /*                           to contain any glyph from the font.  Thus,  */\n  /*                           `bbox.yMax' can be seen as the `maximum     */\n  /*                           ascender', and `bbox.yMin' as the `minimum  */\n  /*                           descender'.  Only relevant for scalable     */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           Note that the bounding box might be off by  */\n  /*                           (at least) one pixel for hinted fonts.  See */\n  /*                           @FT_Size_Metrics for further discussion.    */\n  /*                                                                       */\n  /*    units_per_EM        :: The number of font units per EM square for  */\n  /*                           this face.  This is typically 2048 for      */\n  /*                           TrueType fonts, and 1000 for Type~1 fonts.  */\n  /*                           Only relevant for scalable formats.         */\n  /*                                                                       */\n  /*    ascender            :: The typographic ascender of the face,       */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMax'.  Only relevant for scalable    */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    descender           :: The typographic descender of the face,      */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMin'.  Note that this field is       */\n  /*                           usually negative.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    height              :: This value is the vertical distance         */\n  /*                           between two consecutive baselines,          */\n  /*                           expressed in font units.  It is always      */\n  /*                           positive.  Only relevant for scalable       */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           If you want the global glyph height, use    */\n  /*                           `ascender - descender'.                     */\n  /*                                                                       */\n  /*    max_advance_width   :: The maximum advance width, in font units,   */\n  /*                           for all glyphs in this face.  This can be   */\n  /*                           used to make word wrapping computations     */\n  /*                           faster.  Only relevant for scalable         */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_height  :: The maximum advance height, in font units,  */\n  /*                           for all glyphs in this face.  This is only  */\n  /*                           relevant for vertical layouts, and is set   */\n  /*                           to `height' for fonts that do not provide   */\n  /*                           vertical metrics.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    underline_position  :: The position, in font units, of the         */\n  /*                           underline line for this face.  It is the    */\n  /*                           center of the underlining stem.  Only       */\n  /*                           relevant for scalable formats.              */\n  /*                                                                       */\n  /*    underline_thickness :: The thickness, in font units, of the        */\n  /*                           underline for this face.  Only relevant for */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    glyph               :: The face's associated glyph slot(s).        */\n  /*                                                                       */\n  /*    size                :: The current active size for this face.      */\n  /*                                                                       */\n  /*    charmap             :: The current active charmap for this face.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Fields may be changed after a call to @FT_Attach_File or           */\n  /*    @FT_Attach_Stream.                                                 */\n  /*                                                                       */\n  typedef struct  FT_FaceRec_\n  {\n    FT_Long           num_faces;\n    FT_Long           face_index;\n\n    FT_Long           face_flags;\n    FT_Long           style_flags;\n\n    FT_Long           num_glyphs;\n\n    FT_String*        family_name;\n    FT_String*        style_name;\n\n    FT_Int            num_fixed_sizes;\n    FT_Bitmap_Size*   available_sizes;\n\n    FT_Int            num_charmaps;\n    FT_CharMap*       charmaps;\n\n    FT_Generic        generic;\n\n    /*# The following member variables (down to `underline_thickness') */\n    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */\n    /*# for bitmap fonts.                                              */\n    FT_BBox           bbox;\n\n    FT_UShort         units_per_EM;\n    FT_Short          ascender;\n    FT_Short          descender;\n    FT_Short          height;\n\n    FT_Short          max_advance_width;\n    FT_Short          max_advance_height;\n\n    FT_Short          underline_position;\n    FT_Short          underline_thickness;\n\n    FT_GlyphSlot      glyph;\n    FT_Size           size;\n    FT_CharMap        charmap;\n\n    /*@private begin */\n\n    FT_Driver         driver;\n    FT_Memory         memory;\n    FT_Stream         stream;\n\n    FT_ListRec        sizes_list;\n\n    FT_Generic        autohint;   /* face-specific auto-hinter data */\n    void*             extensions; /* unused                         */\n\n    FT_Face_Internal  internal;\n\n    /*@private end */\n\n  } FT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `face_flags' field of the          */\n  /*    @FT_FaceRec structure.  They inform client applications of         */\n  /*    properties of the corresponding face.                              */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FACE_FLAG_SCALABLE ::                                           */\n  /*      Indicates that the face contains outline glyphs.  This doesn't   */\n  /*      prevent bitmap strikes, i.e., a face can have both this and      */\n  /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */\n  /*      Indicates that the face contains bitmap strikes.  See also the   */\n  /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */\n  /*      Indicates that the face contains fixed-width characters (like    */\n  /*      Courier, Lucido, MonoType, etc.).                                */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SFNT ::                                               */\n  /*      Indicates that the face uses the `sfnt' storage scheme.  For     */\n  /*      now, this means TrueType and OpenType.                           */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HORIZONTAL ::                                         */\n  /*      Indicates that the face contains horizontal glyph metrics.  This */\n  /*      should be set for all common formats.                            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_VERTICAL ::                                           */\n  /*      Indicates that the face contains vertical glyph metrics.  This   */\n  /*      is only available in some formats, not all of them.              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_KERNING ::                                            */\n  /*      Indicates that the face contains kerning information.  If set,   */\n  /*      the kerning distance can be retrieved through the function       */\n  /*      @FT_Get_Kerning.  Otherwise the function always return the       */\n  /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */\n  /*      from the `GPOS' table (as present in some OpenType fonts).       */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */\n  /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */\n  /*      Indicates that the font contains multiple masters and is capable */\n  /*      of interpolating between them.  See the multiple-masters         */\n  /*      specific API for details.                                        */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */\n  /*      Indicates that the font contains glyph names that can be         */\n  /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */\n  /*      fonts contain broken glyph name tables.  Use the function        */\n  /*      @FT_Has_PS_Glyph_Names when needed.                              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */\n  /*      Used internally by FreeType to indicate that a face's stream was */\n  /*      provided by the client application and should not be destroyed   */\n  /*      when @FT_Done_Face is called.  Don't read or test this flag.     */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HINTER ::                                             */\n  /*      Set if the font driver has a hinting machine of its own.  For    */\n  /*      example, with TrueType fonts, it makes sense to use data from    */\n  /*      the SFNT `gasp' table only if the native TrueType hinting engine */\n  /*      (with the bytecode interpreter) is available and active.         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_CID_KEYED ::                                          */\n  /*      Set if the font is CID-keyed.  In that case, the font is not     */\n  /*      accessed by glyph indices but by CID values.  For subsetted      */\n  /*      CID-keyed fonts this has the consequence that not all index      */\n  /*      values are a valid argument to FT_Load_Glyph.  Only the CID      */\n  /*      values for which corresponding glyphs in the subsetted font      */\n  /*      exist make FT_Load_Glyph return successfully; in all other cases */\n  /*      you get an `FT_Err_Invalid_Argument' error.                      */\n  /*                                                                       */\n  /*      Note that CID-keyed fonts which are in an SFNT wrapper don't     */\n  /*      have this flag set since the glyphs are accessed in the normal   */\n  /*      way (using contiguous indices); the `CID-ness' isn't visible to  */\n  /*      the application.                                                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_TRICKY ::                                             */\n  /*      Set if the font is `tricky', this is, it always needs the        */\n  /*      font format's native hinting engine to get a reasonable result.  */\n  /*      A typical example is the Chinese font `mingli.ttf' which uses    */\n  /*      TrueType bytecode instructions to move and scale all of its      */\n  /*      subglyphs.                                                       */\n  /*                                                                       */\n  /*      It is not possible to autohint such fonts using                  */\n  /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */\n  /*      @FT_LOAD_NO_HINTING.  You have to set both @FT_LOAD_NO_HINTING   */\n  /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */\n  /*      probably never want this except for demonstration purposes.      */\n  /*                                                                       */\n  /*      Currently, there are about a dozen TrueType fonts in the list of */\n  /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */\n  /*                                                                       */\n#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )\n#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )\n#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )\n#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )\n#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )\n#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )\n#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )\n#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )\n#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )\n#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )\n#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )\n#define FT_FACE_FLAG_HINTER            ( 1L << 11 )\n#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )\n#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_HORIZONTAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   horizontal metrics (this is true for all font formats though).\n   *\n   * @also:\n   *   @FT_HAS_VERTICAL can be used to check for vertical metrics.\n   *\n   */\n#define FT_HAS_HORIZONTAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_VERTICAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains real\n   *   vertical metrics (and not only synthesized ones).\n   *\n   */\n#define FT_HAS_VERTICAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_VERTICAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_KERNING( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains kerning\n   *   data that can be accessed with @FT_Get_Kerning.\n   *\n   */\n#define FT_HAS_KERNING( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_KERNING )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SCALABLE( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a scalable\n   *   font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,\n   *   and PFR font formats.\n   *\n   */\n#define FT_IS_SCALABLE( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SCALABLE )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SFNT( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font\n   *   whose format is based on the SFNT storage scheme.  This usually\n   *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded\n   *   bitmap fonts.\n   *\n   *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and\n   *   @FT_TRUETYPE_TABLES_H are available.\n   *\n   */\n#define FT_IS_SFNT( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SFNT )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_FIXED_WIDTH( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font face\n   *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)\n   *   glyphs.\n   *\n   */\n#define FT_IS_FIXED_WIDTH( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FIXED_SIZES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   embedded bitmaps.  See the `available_sizes' field of the\n   *   @FT_FaceRec structure.\n   *\n   */\n#define FT_HAS_FIXED_SIZES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FAST_GLYPHS( face )\n   *\n   * @description:\n   *   Deprecated.\n   *\n   */\n#define FT_HAS_FAST_GLYPHS( face )  0\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_GLYPH_NAMES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some glyph\n   *   names that can be accessed through @FT_Get_Glyph_Name.\n   *\n   */\n#define FT_HAS_GLYPH_NAMES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_MULTIPLE_MASTERS( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H\n   *   are then available to choose the exact design you want.\n   *\n   */\n#define FT_HAS_MULTIPLE_MASTERS( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_CID_KEYED( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a CID-keyed\n   *   font.  See the discussion of @FT_FACE_FLAG_CID_KEYED for more\n   *   details.\n   *\n   *   If this macro is true, all functions defined in @FT_CID_H are\n   *   available.\n   *\n   */\n#define FT_IS_CID_KEYED( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_TRICKY( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face represents a `tricky' font.\n   *   See the discussion of @FT_FACE_FLAG_TRICKY for more details.\n   *\n   */\n#define FT_IS_TRICKY( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_TRICKY )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-flags used to indicate the style of a given face.    */\n  /*    These are used in the `style_flags' field of @FT_FaceRec.          */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_STYLE_FLAG_ITALIC ::                                            */\n  /*      Indicates that a given face style is italic or oblique.          */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD ::                                              */\n  /*      Indicates that a given face is bold.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The style information as provided by FreeType is very basic.  More */\n  /*    details are beyond the scope and should be done on a higher level  */\n  /*    (for example, by analyzing various fields of the `OS/2' table in   */\n  /*    SFNT based fonts).                                                 */\n  /*                                                                       */\n#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )\n#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Size object.                     */\n  /*                                                                       */\n  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The size metrics structure gives the metrics of a size object.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x_ppem       :: The width of the scaled EM square in pixels, hence */\n  /*                    the term `ppem' (pixels per EM).  It is also       */\n  /*                    referred to as `nominal width'.                    */\n  /*                                                                       */\n  /*    y_ppem       :: The height of the scaled EM square in pixels,      */\n  /*                    hence the term `ppem' (pixels per EM).  It is also */\n  /*                    referred to as `nominal height'.                   */\n  /*                                                                       */\n  /*    x_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    horizontal metrics from font units to 26.6         */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    y_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    vertical metrics from font units to 26.6           */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    descender    :: The descender in 26.6 fractional pixels.  See      */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    height       :: The height in 26.6 fractional pixels.  See         */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    max_advance  :: The maximum advance width in 26.6 fractional       */\n  /*                    pixels.  See @FT_FaceRec for the details.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The scaling values, if relevant, are determined first during a     */\n  /*    size changing operation.  The remaining fields are then set by the */\n  /*    driver.  For scalable formats, they are usually set to scaled      */\n  /*    values of the corresponding fields in @FT_FaceRec.                 */\n  /*                                                                       */\n  /*    Note that due to glyph hinting, these values might not be exact    */\n  /*    for certain fonts.  Thus they must be treated as unreliable        */\n  /*    with an error margin of at least one pixel!                        */\n  /*                                                                       */\n  /*    Indeed, the only way to get the exact metrics is to render _all_   */\n  /*    glyphs.  As this would be a definite performance hit, it is up to  */\n  /*    client applications to perform such computations.                  */\n  /*                                                                       */\n  /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */\n  /*                                                                       */\n  typedef struct  FT_Size_Metrics_\n  {\n    FT_UShort  x_ppem;      /* horizontal pixels per EM               */\n    FT_UShort  y_ppem;      /* vertical pixels per EM                 */\n\n    FT_Fixed   x_scale;     /* scaling values used to convert font    */\n    FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */\n\n    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */\n    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */\n    FT_Pos     height;      /* text height in 26.6 frac. pixels       */\n    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */\n\n  } FT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root size class structure.  A size object models a face   */\n  /*    object at a given size.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face    :: Handle to the parent face object.                       */\n  /*                                                                       */\n  /*    generic :: A typeless pointer, which is unused by the FreeType     */\n  /*               library or any of its drivers.  It can be used by       */\n  /*               client applications to link their own data to each size */\n  /*               object.                                                 */\n  /*                                                                       */\n  /*    metrics :: Metrics for this size object.  This field is read-only. */\n  /*                                                                       */\n  typedef struct  FT_SizeRec_\n  {\n    FT_Face           face;      /* parent face object              */\n    FT_Generic        generic;   /* generic pointer for client uses */\n    FT_Size_Metrics   metrics;   /* size metrics                    */\n    FT_Size_Internal  internal;\n\n  } FT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The subglyph structure is an internal object used to describe      */\n  /*    subglyphs (for example, in the case of composites).                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The subglyph implementation is not part of the high-level API,     */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  /*    You can however retrieve subglyph information with                 */\n  /*    @FT_Get_SubGlyph_Info.                                             */\n  /*                                                                       */\n  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_GlyphSlot object.                */\n  /*                                                                       */\n  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root glyph slot class structure.  A glyph slot is a       */\n  /*    container where individual glyphs can be loaded, be they in        */\n  /*    outline or bitmap format.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library           :: A handle to the FreeType library instance     */\n  /*                         this slot belongs to.                         */\n  /*                                                                       */\n  /*    face              :: A handle to the parent face object.           */\n  /*                                                                       */\n  /*    next              :: In some cases (like some font tools), several */\n  /*                         glyph slots per face object can be a good     */\n  /*                         thing.  As this is rare, the glyph slots are  */\n  /*                         listed through a direct, single-linked list   */\n  /*                         using its `next' field.                       */\n  /*                                                                       */\n  /*    generic           :: A typeless pointer which is unused by the     */\n  /*                         FreeType library or any of its drivers.  It   */\n  /*                         can be used by client applications to link    */\n  /*                         their own data to each glyph slot object.     */\n  /*                                                                       */\n  /*    metrics           :: The metrics of the last loaded glyph in the   */\n  /*                         slot.  The returned values depend on the last */\n  /*                         load flags (see the @FT_Load_Glyph API        */\n  /*                         function) and can be expressed either in 26.6 */\n  /*                         fractional pixels or font units.              */\n  /*                                                                       */\n  /*                         Note that even when the glyph image is        */\n  /*                         transformed, the metrics are not.             */\n  /*                                                                       */\n  /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    linearVertAdvance :: The advance height of the unhinted glyph.     */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    advance           :: This shorthand is, depending on               */\n  /*                         @FT_LOAD_IGNORE_TRANSFORM, the transformed    */\n  /*                         advance width for the glyph (in 26.6          */\n  /*                         fractional pixel format).  As specified with  */\n  /*                         @FT_LOAD_VERTICAL_LAYOUT, it uses either the  */\n  /*                         `horiAdvance' or the `vertAdvance' value of   */\n  /*                         `metrics' field.                              */\n  /*                                                                       */\n  /*    format            :: This field indicates the format of the image  */\n  /*                         contained in the glyph slot.  Typically       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP,                      */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */\n  /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */\n  /*                         possible.                                     */\n  /*                                                                       */\n  /*    bitmap            :: This field is used as a bitmap descriptor     */\n  /*                         when the slot format is                       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */\n  /*                         address and content of the bitmap buffer can  */\n  /*                         change between calls of @FT_Load_Glyph and a  */\n  /*                         few other functions.                          */\n  /*                                                                       */\n  /*    bitmap_left       :: This is the bitmap's left bearing expressed   */\n  /*                         in integer pixels.  Of course, this is only   */\n  /*                         valid if the format is                        */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.                      */\n  /*                                                                       */\n  /*    bitmap_top        :: This is the bitmap's top bearing expressed in */\n  /*                         integer pixels.  Remember that this is the    */\n  /*                         distance from the baseline to the top-most    */\n  /*                         glyph scanline, upwards y~coordinates being   */\n  /*                         *positive*.                                   */\n  /*                                                                       */\n  /*    outline           :: The outline descriptor for the current glyph  */\n  /*                         image if its format is                        */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */\n  /*                         loaded, `outline' can be transformed,         */\n  /*                         distorted, embolded, etc.  However, it must   */\n  /*                         not be freed.                                 */\n  /*                                                                       */\n  /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */\n  /*                         This field is only valid for the composite    */\n  /*                         glyph format that should normally only be     */\n  /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */\n  /*                         For now this is internal to FreeType.         */\n  /*                                                                       */\n  /*    subglyphs         :: An array of subglyph descriptors for          */\n  /*                         composite glyphs.  There are `num_subglyphs'  */\n  /*                         elements in there.  Currently internal to     */\n  /*                         FreeType.                                     */\n  /*                                                                       */\n  /*    control_data      :: Certain font drivers can also return the      */\n  /*                         control data for a given glyph image (e.g.    */\n  /*                         TrueType bytecode, Type~1 charstrings, etc.). */\n  /*                         This field is a pointer to such data.         */\n  /*                                                                       */\n  /*    control_len       :: This is the length in bytes of the control    */\n  /*                         data.                                         */\n  /*                                                                       */\n  /*    other             :: Really wicked formats can use this pointer to */\n  /*                         present their own glyph image to client       */\n  /*                         applications.  Note that the application      */\n  /*                         needs to know about the image format.         */\n  /*                                                                       */\n  /*    lsb_delta         :: The difference between hinted and unhinted    */\n  /*                         left side bearing while autohinting is        */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /*    rsb_delta         :: The difference between hinted and unhinted    */\n  /*                         right side bearing while autohinting is       */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If @FT_Load_Glyph is called with default flags (see                */\n  /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */\n  /*    its native format (e.g., an outline glyph for TrueType and Type~1  */\n  /*    formats).                                                          */\n  /*                                                                       */\n  /*    This image can later be converted into a bitmap by calling         */\n  /*    @FT_Render_Glyph.  This function finds the current renderer for    */\n  /*    the native image's format, then invokes it.                        */\n  /*                                                                       */\n  /*    The renderer is in charge of transforming the native image through */\n  /*    the slot's face transformation fields, then converting it into a   */\n  /*    bitmap that is returned in `slot->bitmap'.                         */\n  /*                                                                       */\n  /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */\n  /*    to specify the position of the bitmap relative to the current pen  */\n  /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */\n  /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Here a small pseudo code fragment which shows how to use           */\n  /*    `lsb_delta' and `rsb_delta':                                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Pos  origin_x       = 0;                                      */\n  /*      FT_Pos  prev_rsb_delta = 0;                                      */\n  /*                                                                       */\n  /*                                                                       */\n  /*      for all glyphs do                                                */\n  /*        <compute kern between current and previous glyph and add it to */\n  /*         `origin_x'>                                                   */\n  /*                                                                       */\n  /*        <load glyph with `FT_Load_Glyph'>                              */\n  /*                                                                       */\n  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */\n  /*          origin_x -= 64;                                              */\n  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */\n  /*          origin_x += 64;                                              */\n  /*                                                                       */\n  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */\n  /*                                                                       */\n  /*        <save glyph image, or render glyph, or ...>                    */\n  /*                                                                       */\n  /*        origin_x += face->glyph->advance.x;                            */\n  /*      endfor                                                           */\n  /*    }                                                                  */\n  /*                                                                       */\n  typedef struct  FT_GlyphSlotRec_\n  {\n    FT_Library        library;\n    FT_Face           face;\n    FT_GlyphSlot      next;\n    FT_UInt           reserved;       /* retained for binary compatibility */\n    FT_Generic        generic;\n\n    FT_Glyph_Metrics  metrics;\n    FT_Fixed          linearHoriAdvance;\n    FT_Fixed          linearVertAdvance;\n    FT_Vector         advance;\n\n    FT_Glyph_Format   format;\n\n    FT_Bitmap         bitmap;\n    FT_Int            bitmap_left;\n    FT_Int            bitmap_top;\n\n    FT_Outline        outline;\n\n    FT_UInt           num_subglyphs;\n    FT_SubGlyph       subglyphs;\n\n    void*             control_data;\n    long              control_len;\n\n    FT_Pos            lsb_delta;\n    FT_Pos            rsb_delta;\n\n    void*             other;\n\n    FT_Slot_Internal  internal;\n\n  } FT_GlyphSlotRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         F U N C T I O N S                             */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Init_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new FreeType library object.  The set of modules      */\n  /*    that are registered by this function is determined at build time.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A handle to a new library object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case you want to provide your own memory allocating routines,   */\n  /*    use @FT_New_Library instead, followed by a call to                 */\n  /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */\n  /*                                                                       */\n  /*    For multi-threading applications each thread should have its own   */\n  /*    FT_Library object.                                                 */\n  /*                                                                       */\n  /*    If you need reference-counting (cf. @FT_Reference_Library), use    */\n  /*    @FT_New_Library and @FT_Done_Library.                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given FreeType library object and all of its children,   */\n  /*    including resources, drivers, faces, sizes, etc.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library object.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_FreeType( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OPEN_XXX                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants used within the `flags' field of the */\n  /*    @FT_Open_Args structure.                                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OPEN_MEMORY   :: This is a memory-based stream.                 */\n  /*                                                                       */\n  /*    FT_OPEN_STREAM   :: Copy the stream from the `stream' field.       */\n  /*                                                                       */\n  /*    FT_OPEN_PATHNAME :: Create a new input stream from a C~path        */\n  /*                        name.                                          */\n  /*                                                                       */\n  /*    FT_OPEN_DRIVER   :: Use the `driver' field.                        */\n  /*                                                                       */\n  /*    FT_OPEN_PARAMS   :: Use the `num_params' and `params' fields.      */\n  /*                                                                       */\n  /*    ft_open_memory   :: Deprecated; use @FT_OPEN_MEMORY instead.       */\n  /*                                                                       */\n  /*    ft_open_stream   :: Deprecated; use @FT_OPEN_STREAM instead.       */\n  /*                                                                       */\n  /*    ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead.     */\n  /*                                                                       */\n  /*    ft_open_driver   :: Deprecated; use @FT_OPEN_DRIVER instead.       */\n  /*                                                                       */\n  /*    ft_open_params   :: Deprecated; use @FT_OPEN_PARAMS instead.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */\n  /*    flags are mutually exclusive.                                      */\n  /*                                                                       */\n#define FT_OPEN_MEMORY    0x1\n#define FT_OPEN_STREAM    0x2\n#define FT_OPEN_PATHNAME  0x4\n#define FT_OPEN_DRIVER    0x8\n#define FT_OPEN_PARAMS    0x10\n\n#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */\n#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */\n#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */\n#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */\n#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Parameter                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to pass more or less generic parameters to */\n  /*    @FT_Open_Face.                                                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag  :: A four-byte identification tag.                            */\n  /*                                                                       */\n  /*    data :: A pointer to the parameter data.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The ID and function of parameters are driver-specific.  See the    */\n  /*    various FT_PARAM_TAG_XXX flags for more information.               */\n  /*                                                                       */\n  typedef struct  FT_Parameter_\n  {\n    FT_ULong    tag;\n    FT_Pointer  data;\n\n  } FT_Parameter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Open_Args                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to indicate how to open a new font file or        */\n  /*    stream.  A pointer to such a structure can be used as a parameter  */\n  /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    flags       :: A set of bit flags indicating how to use the        */\n  /*                   structure.                                          */\n  /*                                                                       */\n  /*    memory_base :: The first byte of the file in memory.               */\n  /*                                                                       */\n  /*    memory_size :: The size in bytes of the file in memory.            */\n  /*                                                                       */\n  /*    pathname    :: A pointer to an 8-bit file pathname.                */\n  /*                                                                       */\n  /*    stream      :: A handle to a source stream object.                 */\n  /*                                                                       */\n  /*    driver      :: This field is exclusively used by @FT_Open_Face;    */\n  /*                   it simply specifies the font driver to use to open  */\n  /*                   the face.  If set to~0, FreeType tries to load the  */\n  /*                   face with each one of the drivers in its list.      */\n  /*                                                                       */\n  /*    num_params  :: The number of extra parameters.                     */\n  /*                                                                       */\n  /*    params      :: Extra parameters passed to the font driver when     */\n  /*                   opening a new face.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream type is determined by the contents of `flags' which     */\n  /*    are tested in the following order by @FT_Open_Face:                */\n  /*                                                                       */\n  /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */\n  /*    memory file of `memory_size' bytes, located at `memory_address'.   */\n  /*    The data are are not copied, and the client is responsible for     */\n  /*    releasing and destroying them _after_ the corresponding call to    */\n  /*    @FT_Done_Face.                                                     */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */\n  /*    custom input stream `stream' is used.                              */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this  */\n  /*    is a normal file and use `pathname' to open it.                    */\n  /*                                                                       */\n  /*    If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to    */\n  /*    open the file with the driver whose handler is in `driver'.        */\n  /*                                                                       */\n  /*    If the `FT_OPEN_PARAMS' bit is set, the parameters given by        */\n  /*    `num_params' and `params' is used.  They are ignored otherwise.    */\n  /*                                                                       */\n  /*    Ideally, both the `pathname' and `params' fields should be tagged  */\n  /*    as `const'; this is missing for API backwards compatibility.  In   */\n  /*    other words, applications should treat them as read-only.          */\n  /*                                                                       */\n  typedef struct  FT_Open_Args_\n  {\n    FT_UInt         flags;\n    const FT_Byte*  memory_base;\n    FT_Long         memory_size;\n    FT_String*      pathname;\n    FT_Stream       stream;\n    FT_Module       driver;\n    FT_Int          num_params;\n    FT_Parameter*   params;\n\n  } FT_Open_Args;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font by its pathname.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pathname   :: A path to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Done_Face to destroy the created @FT_Face object (along    */\n  /*    with its slot and sizes).                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  filepathname,\n               FT_Long      face_index,\n               FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory_Face                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font which has been    */\n  /*    loaded into memory.                                                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    file_base  :: A pointer to the beginning of the font data.         */\n  /*                                                                       */\n  /*    file_size  :: The size of the memory chunk used by the font data.  */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You must not deallocate the memory before calling @FT_Done_Face.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Open_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a face object from a given resource described by            */\n  /*    @FT_Open_Args.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    args       :: A pointer to an `FT_Open_Args' structure which must  */\n  /*                  be filled by the caller.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See note below.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Unlike FreeType 1.x, this function automatically creates a glyph   */\n  /*    slot for the face object which can be accessed directly through    */\n  /*    `face->glyph'.                                                     */\n  /*                                                                       */\n  /*    FT_Open_Face can be used to quickly check whether the font         */\n  /*    format of a given font resource is supported by FreeType.  If the  */\n  /*    `face_index' field is negative, the function's return value is~0   */\n  /*    if the font format is recognized, or non-zero otherwise;           */\n  /*    the function returns a more or less empty face handle in `*aface'  */\n  /*    (if `aface' isn't NULL).  The only useful field in this special    */\n  /*    case is `face->num_faces' which gives the number of faces within   */\n  /*    the font file.  After examination, the returned @FT_Face structure */\n  /*    should be deallocated with a call to @FT_Done_Face.                */\n  /*                                                                       */\n  /*    Each new face object created with this function also owns a        */\n  /*    default @FT_Size object, accessible as `face->size'.               */\n  /*                                                                       */\n  /*    One @FT_Library instance can have multiple face objects, this is,  */\n  /*    @FT_Open_Face and its siblings can be called multiple times using  */\n  /*    the same `library' argument.                                       */\n  /*                                                                       */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_File                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Attach_Stream to attach a file.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: The target face object.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    filepathname :: The pathname.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    `Attach' data to a face object.  Normally, this is used to read    */\n  /*    additional information for the face object.  For example, you can  */\n  /*    attach an AFM file that comes with a Type~1 font to get the        */\n  /*    kerning values and other metrics.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The target face object.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    parameters :: A pointer to @FT_Open_Args which must be filled by   */\n  /*                  the caller.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The meaning of the `attach' (i.e., what really happens when the    */\n  /*    new file is read) is not fixed by FreeType itself.  It really      */\n  /*    depends on the font format (and thus the font driver).             */\n  /*                                                                       */\n  /*    Client applications are expected to know what they are doing       */\n  /*    when invoking this function.  Most drivers simply do not implement */\n  /*    file attachments.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Face                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Face structure  */\n  /*    is created.  This function increments the counter.  @FT_Done_Face  */\n  /*    then only destroys a face if the counter is~1, otherwise it simply */\n  /*    decrements the counter.                                            */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Face objects.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given face object, as well as all of its child slots and */\n  /*    sizes.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a bitmap strike.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to a target face object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strike_index :: The index of the bitmap strike in the              */\n  /*                    `available_sizes' field of @FT_FaceRec structure.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Size_Request_Type                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the supported size request types.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SIZE_REQUEST_TYPE_NOMINAL ::                                    */\n  /*      The nominal size.  The `units_per_EM' field of @FT_FaceRec is    */\n  /*      used to determine both scaling values.                           */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */\n  /*      The real dimension.  The sum of the the `ascender' and (minus    */\n  /*      of) the `descender' fields of @FT_FaceRec are used to determine  */\n  /*      both scaling values.                                             */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */\n  /*      The font bounding box.  The width and height of the `bbox' field */\n  /*      of @FT_FaceRec are used to determine the horizontal and vertical */\n  /*      scaling value, respectively.                                     */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_CELL ::                                       */\n  /*      The `max_advance_width' field of @FT_FaceRec is used to          */\n  /*      determine the horizontal scaling value; the vertical scaling     */\n  /*      value is determined the same way as                              */\n  /*      @FT_SIZE_REQUEST_TYPE_REAL_DIM does.  Finally, both scaling      */\n  /*      values are set to the smaller one.  This type is useful if you   */\n  /*      want to specify the font size for, say, a window of a given      */\n  /*      dimension and 80x24 cells.                                       */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_SCALES ::                                     */\n  /*      Specify the scaling values directly.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The above descriptions only apply to scalable formats.  For bitmap */\n  /*    formats, the behaviour is up to the driver.                        */\n  /*                                                                       */\n  /*    See the note section of @FT_Size_Metrics if you wonder how size    */\n  /*    requesting relates to scaling values.                              */\n  /*                                                                       */\n  typedef enum  FT_Size_Request_Type_\n  {\n    FT_SIZE_REQUEST_TYPE_NOMINAL,\n    FT_SIZE_REQUEST_TYPE_REAL_DIM,\n    FT_SIZE_REQUEST_TYPE_BBOX,\n    FT_SIZE_REQUEST_TYPE_CELL,\n    FT_SIZE_REQUEST_TYPE_SCALES,\n\n    FT_SIZE_REQUEST_TYPE_MAX\n\n  } FT_Size_Request_Type;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_RequestRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a size request.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    type           :: See @FT_Size_Request_Type.                       */\n  /*                                                                       */\n  /*    width          :: The desired width.                               */\n  /*                                                                       */\n  /*    height         :: The desired height.                              */\n  /*                                                                       */\n  /*    horiResolution :: The horizontal resolution.  If set to zero,      */\n  /*                      `width' is treated as a 26.6 fractional pixel    */\n  /*                      value.                                           */\n  /*                                                                       */\n  /*    vertResolution :: The vertical resolution.  If set to zero,        */\n  /*                      `height' is treated as a 26.6 fractional pixel   */\n  /*                      value.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `width' is zero, then the horizontal scaling value is set equal */\n  /*    to the vertical scaling value, and vice versa.                     */\n  /*                                                                       */\n  typedef struct  FT_Size_RequestRec_\n  {\n    FT_Size_Request_Type  type;\n    FT_Long               width;\n    FT_Long               height;\n    FT_UInt               horiResolution;\n    FT_UInt               vertResolution;\n\n  } FT_Size_RequestRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Request                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a size request structure.                              */\n  /*                                                                       */\n  typedef struct FT_Size_RequestRec_  *FT_Size_Request;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Request_Size                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Resize the scale of the active @FT_Size object in a face.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    req  :: A pointer to a @FT_Size_RequestRec.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Although drivers may select the bitmap strike matching the         */\n  /*    request, you should not rely on this if you intend to select a     */\n  /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */\n  /*    case.                                                              */\n  /*                                                                       */\n  /*    The relation between the requested size and the resulting glyph    */\n  /*    size is dependent entirely on how the size is defined in the       */\n  /*    source face.  The font designer chooses the final size of each     */\n  /*    glyph relative to this size.  For more information refer to        */\n  /*    `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Char_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in points).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face            :: A handle to a target face object.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_width      :: The nominal width, in 26.6 fractional points.   */\n  /*                                                                       */\n  /*    char_height     :: The nominal height, in 26.6 fractional points.  */\n  /*                                                                       */\n  /*    horz_resolution :: The horizontal resolution in dpi.               */\n  /*                                                                       */\n  /*    vert_resolution :: The vertical resolution in dpi.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If either the character width or height is zero, it is set equal   */\n  /*    to the other value.                                                */\n  /*                                                                       */\n  /*    If either the horizontal or vertical resolution is zero, it is set */\n  /*    equal to the other value.                                          */\n  /*                                                                       */\n  /*    A character width or height smaller than 1pt is set to 1pt; if     */\n  /*    both resolution values are zero, they are set to 72dpi.            */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in pixels).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to the target face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pixel_width  :: The nominal width, in pixels.                      */\n  /*                                                                       */\n  /*    pixel_height :: The nominal height, in pixels.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should not rely on the resulting glyphs matching, or being     */\n  /*    constrained, to this pixel size.  Refer to @FT_Request_Size to     */\n  /*    understand how requested sizes relate to actual sizes.             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to the target face object where the glyph  */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph_index :: The index of the glyph in the font file.  For       */\n  /*                   CID-keyed fonts (either in PS or in CFF format)     */\n  /*                   this argument specifies the CID value.              */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The loaded glyph may be transformed.  See @FT_Set_Transform for    */\n  /*    the details.                                                       */\n  /*                                                                       */\n  /*    For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is        */\n  /*    returned for invalid CID values (this is, for CID values which     */\n  /*    don't have a corresponding glyph in the font).  See the discussion */\n  /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object, according to its character code.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to a target face object where the glyph    */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_code   :: The glyph's character code, according to the        */\n  /*                   current charmap used in the face.                   */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags );\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_XXX\n   *\n   * @description:\n   *   A list of bit-field constants used with @FT_Load_Glyph to indicate\n   *   what kind of operations to perform during glyph loading.\n   *\n   * @values:\n   *   FT_LOAD_DEFAULT ::\n   *     Corresponding to~0, this value is used as the default glyph load\n   *     operation.  In this case, the following happens:\n   *\n   *     1. FreeType looks for a bitmap for the glyph corresponding to the\n   *        face's current size.  If one is found, the function returns.\n   *        The bitmap data can be accessed from the glyph slot (see note\n   *        below).\n   *\n   *     2. If no embedded bitmap is searched or found, FreeType looks for a\n   *        scalable outline.  If one is found, it is loaded from the font\n   *        file, scaled to device pixels, then `hinted' to the pixel grid\n   *        in order to optimize it.  The outline data can be accessed from\n   *        the glyph slot (see note below).\n   *\n   *     Note that by default, the glyph loader doesn't render outlines into\n   *     bitmaps.  The following flags are used to modify this default\n   *     behaviour to more specific and useful cases.\n   *\n   *   FT_LOAD_NO_SCALE ::\n   *     Don't scale the loaded outline glyph but keep it in font units.\n   *\n   *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and\n   *     unsets @FT_LOAD_RENDER.\n   *\n   *     If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using\n   *     FT_LOAD_NO_SCALE usually yields meaningless outlines because the\n   *     subglyphs must be scaled and positioned with hinting instructions.\n   *     This can be solved by loading the font without FT_LOAD_NO_SCALE and\n   *     setting the character size to `font->units_per_EM'.\n   *\n   *   FT_LOAD_NO_HINTING ::\n   *     Disable hinting.  This generally generates `blurrier' bitmap glyphs\n   *     when the glyph are rendered in any of the anti-aliased modes.  See\n   *     also the note below.\n   *\n   *     This flag is implied by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_RENDER ::\n   *     Call @FT_Render_Glyph after the glyph is loaded.  By default, the\n   *     glyph is rendered in @FT_RENDER_MODE_NORMAL mode.  This can be\n   *     overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.\n   *\n   *     This flag is unset by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_NO_BITMAP ::\n   *     Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this\n   *     flag.\n   *\n   *     @FT_LOAD_NO_SCALE always sets this flag.\n   *\n   *   FT_LOAD_VERTICAL_LAYOUT ::\n   *     Load the glyph for vertical text layout.  In particular, the\n   *     `advance' value in the @FT_GlyphSlotRec structure is set to the\n   *     `vertAdvance' value of the `metrics' field.\n   *\n   *     In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use\n   *     this flag currently.  Reason is that in this case vertical metrics\n   *     get synthesized, and those values are not always consistent across\n   *     various font formats.\n   *\n   *   FT_LOAD_FORCE_AUTOHINT ::\n   *     Indicates that the auto-hinter is preferred over the font's native\n   *     hinter.  See also the note below.\n   *\n   *   FT_LOAD_CROP_BITMAP ::\n   *     Indicates that the font driver should crop the loaded bitmap glyph\n   *     (i.e., remove all space around its black bits).  Not all drivers\n   *     implement this.\n   *\n   *   FT_LOAD_PEDANTIC ::\n   *     Indicates that the font driver should perform pedantic verifications\n   *     during glyph loading.  This is mostly used to detect broken glyphs\n   *     in fonts.  By default, FreeType tries to handle broken fonts also.\n   *\n   *     In particular, errors from the TrueType bytecode engine are not\n   *     passed to the application if this flag is not set; this might\n   *     result in partially hinted or distorted glyphs in case a glyph's\n   *     bytecode is buggy.\n   *\n   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::\n   *     Ignored.  Deprecated.\n   *\n   *   FT_LOAD_NO_RECURSE ::\n   *     This flag is only used internally.  It merely indicates that the\n   *     font driver should not load composite glyphs recursively.  Instead,\n   *     it should set the `num_subglyph' and `subglyphs' values of the\n   *     glyph slot accordingly, and set `glyph->format' to\n   *     @FT_GLYPH_FORMAT_COMPOSITE.\n   *\n   *     The description of sub-glyphs is not available to client\n   *     applications for now.\n   *\n   *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.\n   *\n   *   FT_LOAD_IGNORE_TRANSFORM ::\n   *     Indicates that the transform matrix set by @FT_Set_Transform should\n   *     be ignored.\n   *\n   *   FT_LOAD_MONOCHROME ::\n   *     This flag is used with @FT_LOAD_RENDER to indicate that you want to\n   *     render an outline glyph to a 1-bit monochrome bitmap glyph, with\n   *     8~pixels packed into each byte of the bitmap data.\n   *\n   *     Note that this has no effect on the hinting algorithm used.  You\n   *     should rather use @FT_LOAD_TARGET_MONO so that the\n   *     monochrome-optimized hinting algorithm is used.\n   *\n   *   FT_LOAD_LINEAR_DESIGN ::\n   *     Indicates that the `linearHoriAdvance' and `linearVertAdvance'\n   *     fields of @FT_GlyphSlotRec should be kept in font units.  See\n   *     @FT_GlyphSlotRec for details.\n   *\n   *   FT_LOAD_NO_AUTOHINT ::\n   *     Disable auto-hinter.  See also the note below.\n   *\n   *   FT_LOAD_COLOR ::\n   *     This flag is used to request loading of color embedded-bitmap\n   *     images.  The resulting color bitmaps, if available, will have the\n   *     @FT_PIXEL_MODE_BGRA format.  When the flag is not used and color\n   *     bitmaps are found, they will be converted to 256-level gray\n   *     bitmaps transparently.  Those bitmaps will be in the\n   *     @FT_PIXEL_MODE_GRAY format.\n   *\n   * @note:\n   *   By default, hinting is enabled and the font's native hinter (see\n   *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can\n   *   disable hinting by setting @FT_LOAD_NO_HINTING or change the\n   *   precedence by setting @FT_LOAD_FORCE_AUTOHINT.  You can also set\n   *   @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be\n   *   used at all.\n   *\n   *   See the description of @FT_FACE_FLAG_TRICKY for a special exception\n   *   (affecting only a handful of Asian fonts).\n   *\n   *   Besides deciding which hinter to use, you can also decide which\n   *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.\n   *\n   *   Note that the auto-hinter needs a valid Unicode cmap (either a native\n   *   one or synthesized by FreeType) for producing correct results.  If a\n   *   font provides an incorrect mapping (for example, assigning the\n   *   character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a\n   *   mathematical integral sign), the auto-hinter might produce useless\n   *   results.\n   *\n   */\n#define FT_LOAD_DEFAULT                      0x0\n#define FT_LOAD_NO_SCALE                     ( 1L << 0 )\n#define FT_LOAD_NO_HINTING                   ( 1L << 1 )\n#define FT_LOAD_RENDER                       ( 1L << 2 )\n#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )\n#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )\n#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )\n#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )\n#define FT_LOAD_PEDANTIC                     ( 1L << 7 )\n#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )\n#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )\n#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )\n#define FT_LOAD_MONOCHROME                   ( 1L << 12 )\n#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )\n#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )\n  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */\n#define FT_LOAD_COLOR                        ( 1L << 20 )\n\n  /* */\n\n  /* used internally only by certain font drivers! */\n#define FT_LOAD_ADVANCE_ONLY                 ( 1L << 8 )\n#define FT_LOAD_SBITS_ONLY                   ( 1L << 14 )\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_TARGET_XXX\n   *\n   * @description:\n   *   A list of values that are used to select a specific hinting algorithm\n   *   to use by the hinter.  You should OR one of these values to your\n   *   `load_flags' when calling @FT_Load_Glyph.\n   *\n   *   Note that font's native hinters may ignore the hinting algorithm you\n   *   have specified (e.g., the TrueType bytecode interpreter).  You can set\n   *   @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.\n   *\n   *   Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it\n   *   always implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   * @values:\n   *   FT_LOAD_TARGET_NORMAL ::\n   *     This corresponds to the default hinting algorithm, optimized for\n   *     standard gray-level rendering.  For monochrome output, use\n   *     @FT_LOAD_TARGET_MONO instead.\n   *\n   *   FT_LOAD_TARGET_LIGHT ::\n   *     A lighter hinting algorithm for non-monochrome modes.  Many\n   *     generated glyphs are more fuzzy but better resemble its original\n   *     shape.  A bit like rendering on Mac OS~X.\n   *\n   *     As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   *   FT_LOAD_TARGET_MONO ::\n   *     Strong hinting algorithm that should only be used for monochrome\n   *     output.  The result is probably unpleasant if the glyph is rendered\n   *     in non-monochrome modes.\n   *\n   *   FT_LOAD_TARGET_LCD ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally\n   *     decimated LCD displays.\n   *\n   *   FT_LOAD_TARGET_LCD_V ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically\n   *     decimated LCD displays.\n   *\n   * @note:\n   *   You should use only _one_ of the FT_LOAD_TARGET_XXX values in your\n   *   `load_flags'.  They can't be ORed.\n   *\n   *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the\n   *   corresponding mode (i.e., the mode which matches the used algorithm\n   *   best).  An exeption is FT_LOAD_TARGET_MONO since it implies\n   *   @FT_LOAD_MONOCHROME.\n   *\n   *   You can use a hinting algorithm that doesn't correspond to the same\n   *   rendering mode.  As an example, it is possible to use the `light'\n   *   hinting algorithm and have the results rendered in horizontal LCD\n   *   pixel mode, with code like\n   *\n   *     {\n   *       FT_Load_Glyph( face, glyph_index,\n   *                      load_flags | FT_LOAD_TARGET_LIGHT );\n   *\n   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );\n   *     }\n   *\n   */\n#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )\n\n#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )\n#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )\n#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )\n#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )\n#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )\n\n\n  /**************************************************************************\n   *\n   * @macro:\n   *   FT_LOAD_TARGET_MODE\n   *\n   * @description:\n   *   Return the @FT_Render_Mode corresponding to a given\n   *   @FT_LOAD_TARGET_XXX value.\n   *\n   */\n#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Transform                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to set the transformation that is applied to glyph */\n  /*    images when they are loaded into a glyph slot through              */\n  /*    @FT_Load_Glyph.                                                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the transformation's 2x2 matrix.  Use~0 for */\n  /*              the identity matrix.                                     */\n  /*    delta  :: A pointer to the translation vector.  Use~0 for the null */\n  /*              vector.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The transformation is only applied to scalable image formats after */\n  /*    the glyph has been loaded.  It means that hinting is unaltered by  */\n  /*    the transformation and is performed on the character size given in */\n  /*    the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes.         */\n  /*                                                                       */\n  /*    Note that this also transforms the `face.glyph.advance' field, but */\n  /*    *not* the values in `face.glyph.metrics'.                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Render_Mode                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the render modes supported by       */\n  /*    FreeType~2.  Each mode corresponds to a specific type of scanline  */\n  /*    conversion performed on the outline.                               */\n  /*                                                                       */\n  /*    For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode'     */\n  /*    field in the @FT_GlyphSlotRec structure gives the format of the    */\n  /*    returned bitmap.                                                   */\n  /*                                                                       */\n  /*    All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RENDER_MODE_NORMAL ::                                           */\n  /*      This is the default render mode; it corresponds to 8-bit         */\n  /*      anti-aliased bitmaps.                                            */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LIGHT ::                                            */\n  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */\n  /*      defined as a separate value because render modes are also used   */\n  /*      indirectly to define hinting algorithm selectors.  See           */\n  /*      @FT_LOAD_TARGET_XXX for details.                                 */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_MONO ::                                             */\n  /*      This mode corresponds to 1-bit bitmaps (with 2~levels of         */\n  /*      opacity).                                                        */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD ::                                              */\n  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */\n  /*      displays like LCD screens.  It produces 8-bit bitmaps that are   */\n  /*      3~times the width of the original glyph outline in pixels, and   */\n  /*      which use the @FT_PIXEL_MODE_LCD mode.                           */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD_V ::                                            */\n  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */\n  /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */\n  /*      8-bit bitmaps that are 3~times the height of the original        */\n  /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */\n  /*    filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */\n  /*    (not active in the default builds).  It is up to the caller to     */\n  /*    either call @FT_Library_SetLcdFilter (if available) or do the      */\n  /*    filtering itself.                                                  */\n  /*                                                                       */\n  /*    The selected render mode only affects vector glyphs of a font.     */\n  /*    Embedded bitmaps often have a different pixel mode like            */\n  /*    @FT_PIXEL_MODE_MONO.  You can use @FT_Bitmap_Convert to transform  */\n  /*    them into 8-bit pixmaps.                                           */\n  /*                                                                       */\n  typedef enum  FT_Render_Mode_\n  {\n    FT_RENDER_MODE_NORMAL = 0,\n    FT_RENDER_MODE_LIGHT,\n    FT_RENDER_MODE_MONO,\n    FT_RENDER_MODE_LCD,\n    FT_RENDER_MODE_LCD_V,\n\n    FT_RENDER_MODE_MAX\n\n  } FT_Render_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_render_mode_xxx                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Render_Mode values instead.                                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL                */\n  /*    ft_render_mode_mono   :: see @FT_RENDER_MODE_MONO                  */\n  /*                                                                       */\n#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL\n#define ft_render_mode_mono    FT_RENDER_MODE_MONO\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Render_Glyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph image to a bitmap.  It does so by inspecting */\n  /*    the glyph image format, finding the relevant renderer, and         */\n  /*    invoking it.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot        :: A handle to the glyph slot containing the image to  */\n  /*                   convert.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: This is the render mode used to render the glyph    */\n  /*                   image into a bitmap.  See @FT_Render_Mode for a     */\n  /*                   list of possible values.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Kerning_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify which kerning values to return in   */\n  /*    @FT_Get_Kerning.                                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_KERNING_DEFAULT  :: Return scaled and grid-fitted kerning       */\n  /*                           distances (value is~0).                     */\n  /*                                                                       */\n  /*    FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning    */\n  /*                           distances.                                  */\n  /*                                                                       */\n  /*    FT_KERNING_UNSCALED :: Return the kerning vector in original font  */\n  /*                           units.                                      */\n  /*                                                                       */\n  typedef enum  FT_Kerning_Mode_\n  {\n    FT_KERNING_DEFAULT  = 0,\n    FT_KERNING_UNFITTED,\n    FT_KERNING_UNSCALED\n\n  } FT_Kerning_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_default                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_DEFAULT       */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_default   FT_KERNING_DEFAULT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unfitted                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNFITTED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unfitted  FT_KERNING_UNFITTED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unscaled                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNSCALED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unscaled  FT_KERNING_UNSCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the kerning vector between two glyphs of a same face.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /*    kern_mode   :: See @FT_Kerning_Mode for more information.          */\n  /*                   Determines the scale and dimension of the returned  */\n  /*                   kerning vector.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning vector.  This is either in font units   */\n  /*                   or in pixels (26.6 format) for scalable formats,    */\n  /*                   and in pixels for fixed-sizes formats.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this method.  Other layouts, or more sophisticated    */\n  /*    kernings, are out of the scope of this API function -- they can be */\n  /*    implemented through format-specific interfaces.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Track_Kerning                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the track kerning for a given face object at a given size.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to a source face object.                    */\n  /*                                                                       */\n  /*    point_size :: The point size in 16.16 fractional points.           */\n  /*                                                                       */\n  /*    degree     :: The degree of tightness.  Increasingly negative      */\n  /*                  values represent tighter track kerning, while        */\n  /*                  increasingly positive values represent looser track  */\n  /*                  kerning.  Value zero means no track kerning.         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning   :: The kerning in 16.16 fractional points, to be        */\n  /*                  uniformly applied between all glyphs.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, only the Type~1 font driver supports track kerning,     */\n  /*    using data from AFM files (if attached with @FT_Attach_File or     */\n  /*    @FT_Attach_Stream).                                                */\n  /*                                                                       */\n  /*    Only very few AFM files come with track kerning data; please refer */\n  /*    to the Adobe's AFM specification for more details.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII name of a given glyph in a face.  This only     */\n  /*    works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    buffer_max  :: The maximum number of bytes available in the        */\n  /*                   buffer.                                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer      :: A pointer to a target buffer where the name is      */\n  /*                   copied to.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error is returned if the face doesn't provide glyph names or if */\n  /*    the glyph index is invalid.  In all cases of failure, the first    */\n  /*    byte of `buffer' is set to~0 to indicate an empty name.            */\n  /*                                                                       */\n  /*    The glyph name is truncated to fit within the buffer if it is too  */\n  /*    long.  The returned string is always zero-terminated.              */\n  /*                                                                       */\n  /*    Be aware that FreeType reorders glyph indices internally so that   */\n  /*    glyph index~0 always corresponds to the `missing glyph' (called    */\n  /*    `.notdef').                                                        */\n  /*                                                                       */\n  /*    This function is not compiled within the library if the config     */\n  /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */\n  /*    `include/freetype/config/ftoptions.h'.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII PostScript name of a given face, if available.  */\n  /*    This only works with PostScript and TrueType fonts.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the face's PostScript name.  NULL if unavailable.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned pointer is owned by the face and is destroyed with    */\n  /*    it.                                                                */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_Postscript_Name( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Charmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap by its encoding tag (as listed in           */\n  /*    `freetype.h').                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    encoding :: A handle to the selected encoding.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if no charmap in the face           */\n  /*    corresponds to the encoding queried here.                          */\n  /*                                                                       */\n  /*    Because many fonts contain more than a single cmap for Unicode     */\n  /*    encoding, this function has some special code to select the one    */\n  /*    which covers Unicode best (`best' in the sense that a UCS-4 cmap   */\n  /*    is preferred to a UCS-2 cmap).  It is thus preferable to           */\n  /*    @FT_Set_Charmap in this case.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Charmap                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap for character code to glyph index mapping.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap :: A handle to the selected charmap.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if the charmap is not part of       */\n  /*    the face (i.e., if it is not listed in the `face->charmaps'        */\n  /*    table).                                                            */\n  /*                                                                       */\n  /*    It also fails if a type~14 charmap is selected.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Get_Charmap_Index\n   *\n   * @description:\n   *   Retrieve index of a given charmap.\n   *\n   * @input:\n   *   charmap ::\n   *     A handle to a charmap.\n   *\n   * @return:\n   *   The index into the array of character maps within the face to which\n   *   `charmap' belongs.  If an error occurs, -1 is returned.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Char_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code.  This function   */\n  /*    uses a charmap object to do the mapping.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /*    charcode :: The character code.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within the  */\n  /*    file.  This is done to ensure that value~0 always corresponds to   */\n  /*    the `missing glyph'.  If the first glyph is not named `.notdef',   */\n  /*    then for Type~1 and Type~42 fonts, `.notdef' will be moved into    */\n  /*    the glyph ID~0 position, and whatever was there will be moved to   */\n  /*    the position `.notdef' had.  For Type~1 fonts, if there is no      */\n  /*    `.notdef' glyph at all, then one will be created at index~0 and    */\n  /*    whatever was there will be moved to the last index -- Type~42      */\n  /*    fonts are considered invalid under this condition.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_First_Char                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the first character code in the    */\n  /*    current charmap of a given face.  It also returns the              */\n  /*    corresponding glyph index.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex :: Glyph index of first character code.  0~if charmap is   */\n  /*               empty.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's first character code.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_Next_Char to be able to  */\n  /*    parse all character codes available in a given charmap.  The code  */\n  /*    should look like this:                                             */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_ULong  charcode;                                              */\n  /*      FT_UInt   gindex;                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      charcode = FT_Get_First_Char( face, &gindex );                   */\n  /*      while ( gindex != 0 )                                            */\n  /*      {                                                                */\n  /*        ... do something with (charcode,gindex) pair ...               */\n  /*                                                                       */\n  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */\n  /*      }                                                                */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 if the charmap is empty.  The     */\n  /*    result itself can be~0 in two cases: if the charmap is empty or    */\n  /*    if the value~0 is the first valid character code.                  */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Next_Char                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the next character code in the     */\n  /*    current charmap of a given face following the value `char_code',   */\n  /*    as well as the corresponding glyph index.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: A handle to the source face object.                   */\n  /*    char_code :: The starting character code.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex   :: Glyph index of next character code.  0~if charmap     */\n  /*                 is empty.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's next character code.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_First_Char to walk       */\n  /*    over all character codes available in a given charmap.  See the    */\n  /*    note for this function for a simple code example.                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 when there are no more codes in   */\n  /*    the charmap.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_Next_Char( FT_Face    face,\n                    FT_ULong   char_code,\n                    FT_UInt   *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Name_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given glyph name.  This function uses  */\n  /*    driver specific objects to do the translation.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the source face object.                  */\n  /*                                                                       */\n  /*    glyph_name :: The glyph name.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name );\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SUBGLYPH_FLAG_XXX\n   *\n   * @description:\n   *   A list of constants used to describe subglyphs.  Please refer to the\n   *   TrueType specification for the meaning of the various flags.\n   *\n   * @values:\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::\n   *   FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::\n   *   FT_SUBGLYPH_FLAG_SCALE ::\n   *   FT_SUBGLYPH_FLAG_XY_SCALE ::\n   *   FT_SUBGLYPH_FLAG_2X2 ::\n   *   FT_SUBGLYPH_FLAG_USE_MY_METRICS ::\n   *\n   */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_SubGlyph_Info\n   *\n   * @description:\n   *   Retrieve a description of a given subglyph.  Only use it if\n   *   `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is\n   *   returned otherwise.\n   *\n   * @input:\n   *   glyph ::\n   *     The source glyph slot.\n   *\n   *   sub_index ::\n   *     The index of the subglyph.  Must be less than\n   *     `glyph->num_subglyphs'.\n   *\n   * @output:\n   *   p_index ::\n   *     The glyph index of the subglyph.\n   *\n   *   p_flags ::\n   *     The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.\n   *\n   *   p_arg1 ::\n   *     The subglyph's first argument (if any).\n   *\n   *   p_arg2 ::\n   *     The subglyph's second argument (if any).\n   *\n   *   p_transform ::\n   *     The subglyph transformation (if any).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The values of `*p_arg1', `*p_arg2', and `*p_transform' must be\n   *   interpreted depending on the flags returned in `*p_flags'.  See the\n   *   TrueType specification for details.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FSTYPE_XXX                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `fsType' field of the OS/2 table   */\n  /*    in a TrueType or OpenType font and the `FSType' entry in a         */\n  /*    PostScript font.  These bit flags are returned by                  */\n  /*    @FT_Get_FSType_Flags; they inform client applications of embedding */\n  /*    and subsetting restrictions associated with a font.                */\n  /*                                                                       */\n  /*    See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for  */\n  /*    more details.                                                      */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING ::                                 */\n  /*      Fonts with no fsType bit set may be embedded and permanently     */\n  /*      installed on the remote system by an application.                */\n  /*                                                                       */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING ::                          */\n  /*      Fonts that have only this bit set must not be modified, embedded */\n  /*      or exchanged in any manner without first obtaining permission of */\n  /*      the font software copyright owner.                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING ::                           */\n  /*      If this bit is set, the font may be embedded and temporarily     */\n  /*      loaded on the remote system.  Documents containing Preview &     */\n  /*      Print fonts must be opened `read-only'; no edits can be applied  */\n  /*      to the document.                                                 */\n  /*                                                                       */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING ::                                    */\n  /*      If this bit is set, the font may be embedded but must only be    */\n  /*      installed temporarily on other systems.  In contrast to Preview  */\n  /*      & Print fonts, documents containing editable fonts may be opened */\n  /*      for reading, editing is permitted, and changes may be saved.     */\n  /*                                                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING ::                                         */\n  /*      If this bit is set, the font may not be subsetted prior to       */\n  /*      embedding.                                                       */\n  /*                                                                       */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY ::                                 */\n  /*      If this bit is set, only bitmaps contained in the font may be    */\n  /*      embedded; no outline data may be embedded.  If there are no      */\n  /*      bitmaps available in the font, then the font is unembeddable.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    While the fsType flags can indicate that a font may be embedded, a */\n  /*    license with the font vendor may be separately required to use the */\n  /*    font in this way.                                                  */\n  /*                                                                       */\n#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000\n#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002\n#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004\n#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008\n#define FT_FSTYPE_NO_SUBSETTING                 0x0100\n#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the fsType flags for a font.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The fsType flags, @FT_FSTYPE_XXX.                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use this function rather than directly reading the `fs_type' field */\n  /*    in the @PS_FontInfoRec structure which is only guaranteed to       */\n  /*    return the correct results for Type~1 fonts.                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.8                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UShort )\n  FT_Get_FSType_Flags( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_variants                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Variants                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 interface to Unicode Ideographic Variation          */\n  /*    Sequences (IVS), using the SFNT cmap format~14.                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Many CJK characters have variant forms.  They are a sort of grey   */\n  /*    area somewhere between being totally irrelevant and semantically   */\n  /*    distinct; for this reason, the Unicode consortium decided to       */\n  /*    introduce Ideographic Variation Sequences (IVS), consisting of a   */\n  /*    Unicode base character and one of 240 variant selectors            */\n  /*    (U+E0100-U+E01EF), instead of further extending the already huge   */\n  /*    code range for CJK characters.                                     */\n  /*                                                                       */\n  /*    An IVS is registered and unique; for further details please refer  */\n  /*    to Unicode Technical Standard #37, the Ideographic Variation       */\n  /*    Database:                                                          */\n  /*                                                                       */\n  /*      http://www.unicode.org/reports/tr37/                             */\n  /*                                                                       */\n  /*    To date (November 2012), the character with the most variants is   */\n  /*    U+9089, having 31 such IVS.                                        */\n  /*                                                                       */\n  /*    Adobe and MS decided to support IVS with a new cmap subtable       */\n  /*    (format~14).  It is an odd subtable because it is not a mapping of */\n  /*    input code points to glyphs, but contains lists of all variants    */\n  /*    supported by the font.                                             */\n  /*                                                                       */\n  /*    A variant may be either `default' or `non-default'.  A default     */\n  /*    variant is the one you will get for that code point if you look it */\n  /*    up in the standard Unicode cmap.  A non-default variant is a       */\n  /*    different glyph.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIndex                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code as modified by    */\n  /*    the variation selector.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character code point in Unicode.                             */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode code point of the variation selector.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means either `undefined character code', or    */\n  /*    `undefined selector code', or `no variation selector cmap          */\n  /*    subtable', or `current CharMap is not Unicode'.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value~0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  /*    This function is only meaningful if                                */\n  /*      a) the font has a variation selector cmap sub table,             */\n  /*    and                                                                */\n  /*      b) the current charmap has a Unicode encoding.                   */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Face_GetCharVariantIndex( FT_Face   face,\n                               FT_ULong  charcode,\n                               FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIsDefault                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether this variant of this Unicode character is the one to */\n  /*    be found in the `cmap'.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode codepoint of the variation selector.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if found in the standard (Unicode) cmap, 0~if found in the       */\n  /*    variation selector cmap, or -1 if it is not a variant.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is only meaningful if the font has a variation       */\n  /*    selector cmap subtable.                                            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Int )\n  FT_Face_GetCharVariantIsDefault( FT_Face   face,\n                                   FT_ULong  charcode,\n                                   FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantSelectors                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    in the font.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of selector code points, or NULL if there is */\n  /*    no valid variant selector cmap subtable.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantSelectors( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantsOfChar                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    for the specified character code.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of variant selector code points which are    */\n  /*    active for the given character, or NULL if the corresponding list  */\n  /*    is empty.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantsOfChar( FT_Face   face,\n                             FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharsOfVariant                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode character codes found for */\n  /*    the specified variant selector.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The variant selector code point in Unicode.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A list of all the code points which are specified by this selector */\n  /*    (both default and non-default codes are returned) or NULL if there */\n  /*    is no valid cmap or the variant selector is invalid.               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetCharsOfVariant( FT_Face   face,\n                             FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Computations                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Crunching fixed numbers and vectors.                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various functions used to perform            */\n  /*    computations on 16.16 fixed-float numbers or 2d vectors.           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_MulDiv                                                          */\n  /*    FT_MulFix                                                          */\n  /*    FT_DivFix                                                          */\n  /*    FT_RoundFix                                                        */\n  /*    FT_CeilFix                                                         */\n  /*    FT_FloorFix                                                        */\n  /*    FT_Vector_Transform                                                */\n  /*    FT_Matrix_Multiply                                                 */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    with maximum accuracy (it uses a 64-bit intermediate integer       */\n  /*    whenever necessary).                                               */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c );\n\n\n  /* */\n\n  /* The following #if 0 ... #endif is for the documentation formatter, */\n  /* hiding the internal `FT_MULFIX_INLINED' macro.                     */\n\n#if 0\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*b)/0x10000' with maximum accuracy.  Most of the time this is   */\n  /*    used to multiply a given value by a 16.16 fixed-point factor.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/0x10000'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function has been optimized for the case where the absolute   */\n  /*    value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */\n  /*    As this happens mainly when scaling from notional units to         */\n  /*    fractional pixels in FreeType, it resulted in noticeable speed     */\n  /*    improvements between versions 2.x and 1.x.                         */\n  /*                                                                       */\n  /*    As a conclusion, always try to place a 16.16 factor as the         */\n  /*    _second_ argument of this function; this can make a great          */\n  /*    difference.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n\n  /* */\n#endif\n\n#ifdef FT_MULFIX_INLINED\n#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )\n#else\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_DivFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*0x10000)/b' with maximum accuracy.  Most of the time, this is  */\n  /*    used to divide a given value by a 16.16 fixed-point factor.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*0x10000)/b'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The optimization for FT_DivFix() is simple: If (a~<<~16) fits in   */\n  /*    32~bits, then the division is computed directly.  Otherwise, we    */\n  /*    use a specialized version of @FT_MulDiv.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_RoundFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to round a 16.16 fixed number.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number to be rounded.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x8000) & -0x10000'.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_CeilFix                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the ceiling function of a   */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the ceiling function is to be computed.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FloorFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the floor function of a     */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the floor function is to be computed.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `a & -0x10000'.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Vector_Transform                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a single vector through a 2x2 matrix.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    vector :: The target vector to transform.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the source 2x2 matrix.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `vector' or `matrix' is invalid. */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Vector_Transform( FT_Vector*        vec,\n                       const FT_Matrix*  matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    version                                                            */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType Version                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions and macros related to FreeType versions.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Note that those functions and macros are of limited use because    */\n  /*    even a new release of FreeType with only documentation changes     */\n  /*    increases the version number.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FREETYPE_XXX\n   *\n   * @description:\n   *   These three macros identify the FreeType source code version.\n   *   Use @FT_Library_Version to access them at runtime.\n   *\n   * @values:\n   *   FREETYPE_MAJOR :: The major version number.\n   *   FREETYPE_MINOR :: The minor version number.\n   *   FREETYPE_PATCH :: The patch level.\n   *\n   * @note:\n   *   The version number of FreeType if built as a dynamic link library\n   *   with the `libtool' package is _not_ controlled by these three\n   *   macros.\n   *\n   */\n#define FREETYPE_MAJOR  2\n#define FREETYPE_MINOR  5\n#define FREETYPE_PATCH  0\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the version of the FreeType library being used.  This is    */\n  /*    useful when dynamically linking to the library, since one cannot   */\n  /*    use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and               */\n  /*    @FREETYPE_PATCH.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A source library handle.                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amajor  :: The major version number.                               */\n  /*                                                                       */\n  /*    aminor  :: The minor version number.                               */\n  /*                                                                       */\n  /*    apatch  :: The patch version number.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' argument is because */\n  /*    certain programs implement library initialization in a custom way  */\n  /*    that doesn't use @FT_Init_FreeType.                                */\n  /*                                                                       */\n  /*    In such cases, the library version might not be available before   */\n  /*    the library object has been created.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse all bytecode instructions of a TrueType font file to check   */\n  /*    whether any of the patented opcodes are used.  This is only useful */\n  /*    if you want to be able to use the unpatented hinter with           */\n  /*    fonts that do *not* use these opcodes.                             */\n  /*                                                                       */\n  /*    Note that this function parses *all* glyph instructions in the     */\n  /*    font file, which may be slow.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face handle.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if this is a TrueType font that uses one of the patented         */\n  /*    opcodes, 0~otherwise.                                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Enable or disable the unpatented hinter for a given face.          */\n  /*    Only enable it if you have determined that the face doesn't        */\n  /*    use any patented opcodes (see @FT_Face_CheckTrueTypePatents).      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A face handle.                                            */\n  /*                                                                       */\n  /*    value :: New boolean setting.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The old setting value.  This will always be false if this is not   */\n  /*    an SFNT font, or if the unpatented hinter is not compiled in this  */\n  /*    instance of the library.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FREETYPE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftadvanc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftadvanc.h                                                             */\n/*                                                                         */\n/*    Quick computation of advance widths (specification only).            */\n/*                                                                         */\n/*  Copyright 2008, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTADVANC_H__\n#define __FTADVANC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   quick_advance\n   *\n   * @title:\n   *   Quick retrieval of advance values\n   *\n   * @abstract:\n   *   Retrieve horizontal and vertical advance values without processing\n   *   glyph outlines, if possible.\n   *\n   * @description:\n   *   This section contains functions to quickly extract advance values\n   *   without handling glyph outlines, if possible.\n   */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_ADVANCE_FLAG_FAST_ONLY                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A bit-flag to be OR-ed with the `flags' parameter of the           */\n  /*    @FT_Get_Advance and @FT_Get_Advances functions.                    */\n  /*                                                                       */\n  /*    If set, it indicates that you want these functions to fail if the  */\n  /*    corresponding hinting mode or font driver doesn't allow for very   */\n  /*    quick advance computation.                                         */\n  /*                                                                       */\n  /*    Typically, glyphs which are either unscaled, unhinted, bitmapped,  */\n  /*    or light-hinted can have their advance width computed very         */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /*    Normal and bytecode hinted modes, which require loading, scaling,  */\n  /*    and hinting of the glyph outline, are extremely slow by            */\n  /*    comparison.                                                        */\n  /*                                                                       */\n#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advance                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance value of a given glyph outline in an          */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: The source @FT_Face handle.                          */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /*    load_flags :: A set of bit flags similar to those used when        */\n  /*                  calling @FT_Load_Glyph, used to determine what kind  */\n  /*                  of advances you need.                                */\n  /* <Output>                                                              */\n  /*    padvance :: The advance value.  If scaling is performed (based on  */\n  /*                the value of `load_flags'), the advance value is in    */\n  /*                16.16 format.  Otherwise, it is in font units.         */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */\n  /*                vertical advance corresponding to a vertical layout.   */\n  /*                Otherwise, it is the horizontal advance in a           */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    A scaled advance is returned in 16.16 format but isn't transformed */\n  /*    by the affine transformation specified by @FT_Set_Transform.       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advance( FT_Face    face,\n                  FT_UInt    gindex,\n                  FT_Int32   load_flags,\n                  FT_Fixed  *padvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advances                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance values of several glyph outlines in an        */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: The source @FT_Face handle.                         */\n  /*                                                                       */\n  /*    start       :: The first glyph index.                              */\n  /*                                                                       */\n  /*    count       :: The number of advance values you want to retrieve.  */\n  /*                                                                       */\n  /*    load_flags  :: A set of bit flags similar to those used when       */\n  /*                   calling @FT_Load_Glyph.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    padvance :: The advance values.  This array, to be provided by the */\n  /*                caller, must contain at least `count' elements.        */\n  /*                                                                       */\n  /*                If scaling is performed (based on the value of         */\n  /*                `load_flags'), the advance values are in 16.16 format. */\n  /*                Otherwise, they are in font units.                     */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */\n  /*                vertical advances corresponding to a vertical layout.  */\n  /*                Otherwise, they are the horizontal advances in a       */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    Scaled advances are returned in 16.16 format but aren't            */\n  /*    transformed by the affine transformation specified by              */\n  /*    @FT_Set_Transform.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advances( FT_Face    face,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed  *padvances );\n\n/* */\n\n\nFT_END_HEADER\n\n#endif /* __FTADVANC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftautoh.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftautoh.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the auto-hinter (specification only).   */\n/*                                                                         */\n/*  Copyright 2012, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTAUTOH_H__\n#define __FTAUTOH_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   auto_hinter\n   *\n   * @title:\n   *   The auto-hinter\n   *\n   * @abstract:\n   *   Controlling the auto-hinting module.\n   *\n   * @description:\n   *   While FreeType's auto-hinter doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   Note that the auto-hinter's module name is `autofitter' for\n   *   historical reasons.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   glyph-to-script-map\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The auto-hinter provides various script modules to hint glyphs.\n   *   Examples of supported scripts are Latin or CJK.  Before a glyph is\n   *   auto-hinted, the Unicode character map of the font gets examined, and\n   *   the script is then determined based on Unicode character ranges, see\n   *   below.\n   *\n   *   OpenType fonts, however, often provide much more glyphs than\n   *   character codes (small caps, superscripts, ligatures, swashes, etc.),\n   *   to be controlled by so-called `features'.  Handling OpenType features\n   *   can be quite complicated and thus needs a separate library on top of\n   *   FreeType.\n   *\n   *   The mapping between glyph indices and scripts (in the auto-hinter\n   *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an\n   *   array with `num_glyphs' elements, as found in the font's @FT_Face\n   *   structure.  The `glyph-to-script-map' property returns a pointer to\n   *   this array which can be modified as needed.  Note that the\n   *   modification should happen before the first glyph gets processed by\n   *   the auto-hinter so that the global analysis of the font shapes\n   *   actually uses the modified mapping.\n   *\n   *   The following example code demonstrates how to access it (omitting\n   *   the error handling).\n   *\n   *   {\n   *     FT_Library                library;\n   *     FT_Face                   face;\n   *     FT_Prop_GlyphToScriptMap  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *\n   *     prop.face = face;\n   *\n   *     FT_Property_Get( library, \"autofitter\",\n   *                               \"glyph-to-script-map\", &prop );\n   *\n   *     // adjust `prop.map' as needed right here\n   *\n   *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );\n   *   }\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_AUTOHINTER_SCRIPT_XXX\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   A list of constants used for the @glyph-to-script-map property to\n   *   specify the script submodule the auto-hinter should use for hinting a\n   *   particular glyph.\n   *\n   * @values:\n   *   FT_AUTOHINTER_SCRIPT_NONE ::\n   *     Don't auto-hint this glyph.\n   *\n   *   FT_AUTOHINTER_SCRIPT_LATIN ::\n   *     Apply the latin auto-hinter.  For the auto-hinter, `latin' is a\n   *     very broad term, including Cyrillic and Greek also since characters\n   *     from those scripts share the same design constraints.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0020 - U+007F  // Basic Latin (no control characters)\n   *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)\n   *       U+0100 - U+017F  // Latin Extended-A\n   *       U+0180 - U+024F  // Latin Extended-B\n   *       U+0250 - U+02AF  // IPA Extensions\n   *       U+02B0 - U+02FF  // Spacing Modifier Letters\n   *       U+0300 - U+036F  // Combining Diacritical Marks\n   *       U+0370 - U+03FF  // Greek and Coptic\n   *       U+0400 - U+04FF  // Cyrillic\n   *       U+0500 - U+052F  // Cyrillic Supplement\n   *       U+1D00 - U+1D7F  // Phonetic Extensions\n   *       U+1D80 - U+1DBF  // Phonetic Extensions Supplement\n   *       U+1DC0 - U+1DFF  // Combining Diacritical Marks Supplement\n   *       U+1E00 - U+1EFF  // Latin Extended Additional\n   *       U+1F00 - U+1FFF  // Greek Extended\n   *       U+2000 - U+206F  // General Punctuation\n   *       U+2070 - U+209F  // Superscripts and Subscripts\n   *       U+20A0 - U+20CF  // Currency Symbols\n   *       U+2150 - U+218F  // Number Forms\n   *       U+2460 - U+24FF  // Enclosed Alphanumerics\n   *       U+2C60 - U+2C7F  // Latin Extended-C\n   *       U+2DE0 - U+2DFF  // Cyrillic Extended-A\n   *       U+2E00 - U+2E7F  // Supplemental Punctuation\n   *       U+A640 - U+A69F  // Cyrillic Extended-B\n   *       U+A720 - U+A7FF  // Latin Extended-D\n   *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)\n   *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols\n   *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_CJK ::\n   *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old\n   *     Vietnamese, and some other scripts.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+1100 - U+11FF  // Hangul Jamo\n   *       U+2E80 - U+2EFF  // CJK Radicals Supplement\n   *       U+2F00 - U+2FDF  // Kangxi Radicals\n   *       U+2FF0 - U+2FFF  // Ideographic Description Characters\n   *       U+3000 - U+303F  // CJK Symbols and Punctuation\n   *       U+3040 - U+309F  // Hiragana\n   *       U+30A0 - U+30FF  // Katakana\n   *       U+3100 - U+312F  // Bopomofo\n   *       U+3130 - U+318F  // Hangul Compatibility Jamo\n   *       U+3190 - U+319F  // Kanbun\n   *       U+31A0 - U+31BF  // Bopomofo Extended\n   *       U+31C0 - U+31EF  // CJK Strokes\n   *       U+31F0 - U+31FF  // Katakana Phonetic Extensions\n   *       U+3200 - U+32FF  // Enclosed CJK Letters and Months\n   *       U+3300 - U+33FF  // CJK Compatibility\n   *       U+3400 - U+4DBF  // CJK Unified Ideographs Extension A\n   *       U+4DC0 - U+4DFF  // Yijing Hexagram Symbols\n   *       U+4E00 - U+9FFF  // CJK Unified Ideographs\n   *       U+A960 - U+A97F  // Hangul Jamo Extended-A\n   *       U+AC00 - U+D7AF  // Hangul Syllables\n   *       U+D7B0 - U+D7FF  // Hangul Jamo Extended-B\n   *       U+F900 - U+FAFF  // CJK Compatibility Ideographs\n   *       U+FE10 - U+FE1F  // Vertical forms\n   *       U+FE30 - U+FE4F  // CJK Compatibility Forms\n   *       U+FF00 - U+FFEF  // Halfwidth and Fullwidth Forms\n   *      U+1B000 - U+1B0FF // Kana Supplement\n   *      U+1D300 - U+1D35F // Tai Xuan Hing Symbols\n   *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement\n   *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B\n   *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C\n   *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D\n   *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_INDIC ::\n   *     Apply the indic auto-hinter, covering all major scripts from the\n   *     Indian sub-continent and some other related scripts like Thai, Lao,\n   *     or Tibetan.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0900 - U+0DFF  // Indic Range\n   *       U+0F00 - U+0FFF  // Tibetan\n   *       U+1900 - U+194F  // Limbu\n   *       U+1B80 - U+1BBF  // Sundanese\n   *       U+1C80 - U+1CDF  // Meetei Mayak\n   *       U+A800 - U+A82F  // Syloti Nagri\n   *      U+11800 - U+118DF // Sharada\n   *     }\n   *\n   *     Note that currently Indic support is rudimentary only, missing blue\n   *     zone support.\n   *\n   */\n#define FT_AUTOHINTER_SCRIPT_NONE   0\n#define FT_AUTOHINTER_SCRIPT_LATIN  1\n#define FT_AUTOHINTER_SCRIPT_CJK    2\n#define FT_AUTOHINTER_SCRIPT_INDIC  3\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_GlyphToScriptMap\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The data exchange structure for the @glyph-to-script-map property.\n   *\n   */\n   typedef struct  FT_Prop_GlyphToScriptMap_\n   {\n     FT_Face   face;\n     FT_Byte*  map;\n\n   } FT_Prop_GlyphToScriptMap;\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   fallback-script\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   If no auto-hinter script module can be assigned to a glyph, a\n   *   fallback script gets assigned to it (see also the\n   *   @glyph-to-script-map property).  By default, this is\n   *   @FT_AUTOHINTER_SCRIPT_CJK.  Using the `fallback-script' property,\n   *   this fallback value can be changed.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"fallback-script\", &fallback_script );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   It's important to use the right timing for changing this value: The\n   *   creation of the glyph-to-script map which eventually uses the\n   *   fallback script value gets triggered either by setting or reading a\n   *   face-specific property like @glyph-to-script-map, or by auto-hinting\n   *   any glyph from that face.  In particular, if you have already created\n   *   an @FT_Face structure but not loaded any glyph (using the\n   *   auto-hinter), a change of the fallback glyph will affect this face.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   increase-x-height\n   *\n   * @description:\n   *   For ppem values in the range 6~<= ppem <= `increase-x-height', round\n   *   up the font's x~height much more often than normally.  If the value\n   *   is set to~0, which is the default, this feature is switched off.  Use\n   *   this property to improve the legibility of small font sizes if\n   *   necessary.\n   *\n   *   {\n   *     FT_Library               library;\n   *     FT_Face                  face;\n   *     FT_Prop_IncreaseXHeight  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *     FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );\n   *\n   *     prop.face  = face;\n   *     prop.limit = 14;\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"increase-x-height\", &prop );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   Set this value right after calling @FT_Set_Char_Size, but before\n   *   loading any glyph (using the auto-hinter).\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_IncreaseXHeight\n   *\n   * @description:\n   *   The data exchange structure for the @increase-x-height property.\n   *\n   */\n   typedef struct  FT_Prop_IncreaseXHeight_\n   {\n     FT_Face  face;\n     FT_UInt  limit;\n\n   } FT_Prop_IncreaseXHeight;\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTAUTOH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftbbox.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.h                                                               */\n/*                                                                         */\n/*    FreeType exact bbox computation (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /* It is separated from the rest of the engine for various technical     */\n  /* reasons.  It may well be integrated in `ftoutln' later.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTBBOX_H__\n#define __FTBBOX_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the exact bounding box of an outline.  This is slower      */\n  /*    than computing the control box.  However, it uses an advanced      */\n  /*    algorithm which returns _very_ quickly when the two boxes          */\n  /*    coincide.  Otherwise, the outline Bézier arcs are traversed to     */\n  /*    extract their extrema.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abbox   :: The outline's exact bounding box.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get      */\n  /*    reasonable values for the BBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the BBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBBOX_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (specification).     */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2009 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBDF_H__\n#define __FTBDF_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bdf_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BDF and PCF Files                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    BDF and PCF specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions specific to BDF */\n  /*    and PCF fonts.                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @enum:\n   *    FT_PropertyType\n   *\n   * @description:\n   *    A list of BDF property types.\n   *\n   * @values:\n   *    BDF_PROPERTY_TYPE_NONE ::\n   *      Value~0 is used to indicate a missing property.\n   *\n   *    BDF_PROPERTY_TYPE_ATOM ::\n   *      Property is a string atom.\n   *\n   *    BDF_PROPERTY_TYPE_INTEGER ::\n   *      Property is a 32-bit signed integer.\n   *\n   *    BDF_PROPERTY_TYPE_CARDINAL ::\n   *      Property is a 32-bit unsigned integer.\n   */\n  typedef enum  BDF_PropertyType_\n  {\n    BDF_PROPERTY_TYPE_NONE     = 0,\n    BDF_PROPERTY_TYPE_ATOM     = 1,\n    BDF_PROPERTY_TYPE_INTEGER  = 2,\n    BDF_PROPERTY_TYPE_CARDINAL = 3\n\n  } BDF_PropertyType;\n\n\n  /**********************************************************************\n   *\n   * @type:\n   *    BDF_Property\n   *\n   * @description:\n   *    A handle to a @BDF_PropertyRec structure to model a given\n   *    BDF/PCF property.\n   */\n  typedef struct BDF_PropertyRec_*  BDF_Property;\n\n\n /**********************************************************************\n  *\n  * @struct:\n  *    BDF_PropertyRec\n  *\n  * @description:\n  *    This structure models a given BDF/PCF property.\n  *\n  * @fields:\n  *    type ::\n  *      The property type.\n  *\n  *    u.atom ::\n  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.\n  *\n  *    u.integer ::\n  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.\n  *\n  *    u.cardinal ::\n  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.\n  */\n  typedef struct  BDF_PropertyRec_\n  {\n    BDF_PropertyType  type;\n    union {\n      const char*     atom;\n      FT_Int32        integer;\n      FT_UInt32       cardinal;\n\n    } u;\n\n  } BDF_PropertyRec;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Charset_ID\n  *\n  * @description:\n  *    Retrieve a BDF font character set identity, according to\n  *    the BDF specification.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  * @output:\n  *    acharset_encoding ::\n  *       Charset encoding, as a C~string, owned by the face.\n  *\n  *    acharset_registry ::\n  *       Charset registry, as a C~string, owned by the face.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with BDF faces, returning an error otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Property\n  *\n  * @description:\n  *    Retrieve a BDF property from a BDF or PCF font file.\n  *\n  * @input:\n  *    face :: A handle to the input face.\n  *\n  *    name :: The property name.\n  *\n  * @output:\n  *    aproperty :: The property.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function works with BDF _and_ PCF fonts.  It returns an error\n  *   otherwise.  It also returns an error if the property is not in the\n  *   font.\n  *\n  *   A `property' is a either key-value pair within the STARTPROPERTIES\n  *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the\n  *   `info->props' array within a `FontRec' structure of a PCF font.\n  *\n  *   Integer properties are always stored as `signed' within PCF fonts;\n  *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value\n  *   for BDF fonts only.\n  *\n  *   In case of error, `aproperty->type' is always set to\n  *   @BDF_PROPERTY_TYPE_NONE.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftbitmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.h                                                             */\n/*                                                                         */\n/*    FreeType utility functions for bitmaps (specification).              */\n/*                                                                         */\n/*  Copyright 2004-2006, 2008, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBITMAP_H__\n#define __FTBITMAP_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bitmap_handling                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Bitmap Handling                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Handling FT_Bitmap objects.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains functions for converting FT_Bitmap objects.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_New                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a pointer to an @FT_Bitmap structure.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the bitmap structure.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Copy                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy a bitmap into another one.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    source  :: A handle to the source bitmap.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target  :: A handle to the target bitmap.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Embolden                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\n  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\n  /*    borders are kept unchanged.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /*    yStrength :: How strong the glyph is emboldened vertically.        */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    bitmap    :: A handle to the target bitmap.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The current implementation restricts `xStrength' to be less than   */\n  /*    or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\n  /*                                                                       */\n  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */\n  /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Convert                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */\n  /*    to a bitmap object with depth 8bpp, making the number of used      */\n  /*    bytes line (a.k.a. the `pitch') a multiple of `alignment'.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    source    :: The source bitmap.                                    */\n  /*                                                                       */\n  /*    alignment :: The pitch of the bitmap is a multiple of this         */\n  /*                 parameter.  Common values are 1, 2, or 4.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target    :: The target bitmap.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\n  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\n  /*                                                                       */\n  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\n  /*                                                                       */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GlyphSlot_Own_Bitmap                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Make sure that a glyph slot owns `slot->bitmap'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: The glyph slot.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is to be used in combination with                    */\n  /*    @FT_Bitmap_Embolden.                                               */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    bitmap  :: The bitmap object to be freed.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBITMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftbzip2.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbzip2.h                                                              */\n/*                                                                         */\n/*    Bzip2-compressed stream support.                                     */\n/*                                                                         */\n/*  Copyright 2010 by                                                      */\n/*  Joel Klinghed.                                                         */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBZIP2_H__\n#define __FTBZIP2_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bzip2                                                              */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BZIP2 Streams                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using bzip2-compressed font files.                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Bzip2-specific functions. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenBzip2\n  *\n  * @description:\n  *   Open a new stream to parse bzip2-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.bz2' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, bzip2 compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a bzip2 compressed stream\n  *   from it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with bzip2 support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBZIP2_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftcache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.h                                                              */\n/*                                                                         */\n/*    FreeType Cache subsystem (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCACHE_H__\n#define __FTCACHE_H__\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************\n   *\n   * <Section>\n   *    cache_subsystem\n   *\n   * <Title>\n   *    Cache Sub-System\n   *\n   * <Abstract>\n   *    How to cache face, size, and glyph data with FreeType~2.\n   *\n   * <Description>\n   *   This section describes the FreeType~2 cache sub-system, which is used\n   *   to limit the number of concurrently opened @FT_Face and @FT_Size\n   *   objects, as well as caching information like character maps and glyph\n   *   images while limiting their maximum memory usage.\n   *\n   *   Note that all types and functions begin with the `FTC_' prefix.\n   *\n   *   The cache is highly portable and thus doesn't know anything about the\n   *   fonts installed on your system, or how to access them.  This implies\n   *   the following scheme:\n   *\n   *   First, available or installed font faces are uniquely identified by\n   *   @FTC_FaceID values, provided to the cache by the client.  Note that\n   *   the cache only stores and compares these values, and doesn't try to\n   *   interpret them in any way.\n   *\n   *   Second, the cache calls, only when needed, a client-provided function\n   *   to convert an @FTC_FaceID into a new @FT_Face object.  The latter is\n   *   then completely managed by the cache, including its termination\n   *   through @FT_Done_Face.  To monitor termination of face objects, the\n   *   finalizer callback in the `generic' field of the @FT_Face object can\n   *   be used, which might also be used to store the @FTC_FaceID of the\n   *   face.\n   *\n   *   Clients are free to map face IDs to anything else.  The most simple\n   *   usage is to associate them to a (pathname,face_index) pair that is\n   *   used to call @FT_New_Face.  However, more complex schemes are also\n   *   possible.\n   *\n   *   Note that for the cache to work correctly, the face ID values must be\n   *   *persistent*, which means that the contents they point to should not\n   *   change at runtime, or that their value should not become invalid.\n   *\n   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),\n   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let\n   *   the cache get rid of any references to the old @FTC_FaceID it may\n   *   keep internally.  Failure to do so will lead to incorrect behaviour\n   *   or even crashes.\n   *\n   *   To use the cache, start with calling @FTC_Manager_New to create a new\n   *   @FTC_Manager object, which models a single cache instance.  You can\n   *   then look up @FT_Face and @FT_Size objects with\n   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.\n   *\n   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then\n   *   later use @FTC_CMapCache_Lookup to perform the equivalent of\n   *   @FT_Get_Char_Index, only much faster.\n   *\n   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then\n   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding\n   *   @FT_Glyph objects from the cache.\n   *\n   *   If you need lots of small bitmaps, it is much more memory efficient\n   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This\n   *   returns @FTC_SBitRec structures, which are used to store small\n   *   bitmaps directly.  (A small bitmap is one whose metrics and\n   *   dimensions all fit into 8-bit integers).\n   *\n   *   We hope to also provide a kerning cache in the near future.\n   *\n   *\n   * <Order>\n   *   FTC_Manager\n   *   FTC_FaceID\n   *   FTC_Face_Requester\n   *\n   *   FTC_Manager_New\n   *   FTC_Manager_Reset\n   *   FTC_Manager_Done\n   *   FTC_Manager_LookupFace\n   *   FTC_Manager_LookupSize\n   *   FTC_Manager_RemoveFaceID\n   *\n   *   FTC_Node\n   *   FTC_Node_Unref\n   *\n   *   FTC_ImageCache\n   *   FTC_ImageCache_New\n   *   FTC_ImageCache_Lookup\n   *\n   *   FTC_SBit\n   *   FTC_SBitCache\n   *   FTC_SBitCache_New\n   *   FTC_SBitCache_Lookup\n   *\n   *   FTC_CMapCache\n   *   FTC_CMapCache_New\n   *   FTC_CMapCache_Lookup\n   *\n   *************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    BASIC TYPE DEFINITIONS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type: FTC_FaceID\n   *\n   * @description:\n   *   An opaque pointer type that is used to identity face objects.  The\n   *   contents of such objects is application-dependent.\n   *\n   *   These pointers are typically used to point to a user-defined\n   *   structure containing a font file path, and face index.\n   *\n   * @note:\n   *   Never use NULL as a valid @FTC_FaceID.\n   *\n   *   Face IDs are passed by the client to the cache manager, which calls,\n   *   when needed, the @FTC_Face_Requester to translate them into new\n   *   @FT_Face objects.\n   *\n   *   If the content of a given face ID changes at runtime, or if the value\n   *   becomes invalid (e.g., when uninstalling a font), you should\n   *   immediately call @FTC_Manager_RemoveFaceID before any other cache\n   *   function.\n   *\n   *   Failure to do so will result in incorrect behaviour or even\n   *   memory leaks and crashes.\n   */\n  typedef FT_Pointer  FTC_FaceID;\n\n\n  /************************************************************************\n   *\n   * @functype:\n   *   FTC_Face_Requester\n   *\n   * @description:\n   *   A callback function provided by client applications.  It is used by\n   *   the cache manager to translate a given @FTC_FaceID into a new valid\n   *   @FT_Face object, on demand.\n   *\n   * <Input>\n   *   face_id ::\n   *     The face ID to resolve.\n   *\n   *   library ::\n   *     A handle to a FreeType library object.\n   *\n   *   req_data ::\n   *     Application-provided request data (see note below).\n   *\n   * <Output>\n   *   aface ::\n   *     A new @FT_Face handle.\n   *\n   * <Return>\n   *   FreeType error code.  0~means success.\n   *\n   * <Note>\n   *   The third parameter `req_data' is the same as the one passed by the\n   *   client when @FTC_Manager_New is called.\n   *\n   *   The face requester should not perform funny things on the returned\n   *   face object, like creating a new @FT_Size for it, or setting a\n   *   transformation through @FT_Set_Transform!\n   */\n  typedef FT_Error\n  (*FTC_Face_Requester)( FTC_FaceID  face_id,\n                         FT_Library  library,\n                         FT_Pointer  request_data,\n                         FT_Face*    aface );\n\n /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CACHE MANAGER OBJECT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Manager                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This object corresponds to one instance of the cache-subsystem.    */\n  /*    It is used to cache one or more @FT_Face objects, along with       */\n  /*    corresponding @FT_Size objects.                                    */\n  /*                                                                       */\n  /*    The manager intentionally limits the total number of opened        */\n  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */\n  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */\n  /*                                                                       */\n  /*    The manager is also used to cache `nodes' of various types while   */\n  /*    limiting their total memory usage.                                 */\n  /*                                                                       */\n  /*    All limitations are enforced by keeping lists of managed objects   */\n  /*    in most-recently-used order, and flushing old nodes to make room   */\n  /*    for new ones.                                                      */\n  /*                                                                       */\n  typedef struct FTC_ManagerRec_*  FTC_Manager;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Node                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to a cache node object.  Each cache node is       */\n  /*    reference-counted.  A node with a count of~0 might be flushed      */\n  /*    out of a full cache whenever a lookup request is performed.        */\n  /*                                                                       */\n  /*    If you look up nodes, you have the ability to `acquire' them,      */\n  /*    i.e., to increment their reference count.  This will prevent the   */\n  /*    node from being flushed out of the cache until you explicitly      */\n  /*    `release' it (see @FTC_Node_Unref).                                */\n  /*                                                                       */\n  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */\n  /*                                                                       */\n  typedef struct FTC_NodeRec_*  FTC_Node;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_New                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache manager.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: The parent FreeType library handle to use.            */\n  /*                                                                       */\n  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */\n  /*                 Use~0 for defaults.  Note that this value does not    */\n  /*                 account for managed @FT_Face and @FT_Size objects.    */\n  /*                                                                       */\n  /*    requester :: An application-provided callback used to translate    */\n  /*                 face IDs into real @FT_Face objects.                  */\n  /*                                                                       */\n  /*    req_data  :: A generic pointer that is passed to the requester     */\n  /*                 each time it is called (see @FTC_Face_Requester).     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amanager  :: A handle to a new manager object.  0~in case of       */\n  /*                 failure.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Reset                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Empty a given cache manager.  This simply gets rid of all the      */\n  /*    currently cached @FT_Face and @FT_Size objects within the manager. */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the manager.                                */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Reset( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given manager after emptying it.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the target cache manager object.            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Done( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupFace                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Face object that corresponds to a given face ID   */\n  /*    through a cache manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    face_id :: The ID of the face object.                              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface   :: A handle to the face object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Face object is always owned by the manager.  You  */\n  /*    should never try to discard it yourself.                           */\n  /*                                                                       */\n  /*    The @FT_Face object doesn't necessarily have a current size object */\n  /*    (i.e., face->size can be~0).  If you need a specific `font size',  */\n  /*    use @FTC_Manager_LookupSize instead.                               */\n  /*                                                                       */\n  /*    Never change the face's transformation matrix (i.e., never call    */\n  /*    the @FT_Set_Transform function) on a returned face!  If you need   */\n  /*    to transform glyphs, do it yourself after glyph loading.           */\n  /*                                                                       */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory was available */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_ScalerRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a given character size in either      */\n  /*    pixels or points to the cache manager.  See                        */\n  /*    @FTC_Manager_LookupSize.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id :: The source face ID.                                     */\n  /*                                                                       */\n  /*    width   :: The character width.                                    */\n  /*                                                                       */\n  /*    height  :: The character height.                                   */\n  /*                                                                       */\n  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */\n  /*               interpreted as integer pixel character sizes.           */\n  /*               Otherwise, they are expressed as 1/64th of points.      */\n  /*                                                                       */\n  /*    x_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               horizontal resolution in dpi.                           */\n  /*                                                                       */\n  /*    y_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               vertical resolution in dpi.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This type is mainly used to retrieve @FT_Size objects through the  */\n  /*    cache manager.                                                     */\n  /*                                                                       */\n  typedef struct  FTC_ScalerRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     width;\n    FT_UInt     height;\n    FT_Int      pixel;\n    FT_UInt     x_res;\n    FT_UInt     y_res;\n\n  } FTC_ScalerRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_Scaler                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FTC_ScalerRec structure.                           */\n  /*                                                                       */\n  typedef struct FTC_ScalerRec_*  FTC_Scaler;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupSize                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Size object that corresponds to a given           */\n  /*    @FTC_ScalerRec pointer through a cache manager.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    scaler  :: A scaler handle.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize   :: A handle to the size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Size object is always owned by the manager.  You  */\n  /*    should never try to discard it by yourself.                        */\n  /*                                                                       */\n  /*    You can access the parent @FT_Face object simply as `size->face'   */\n  /*    if you need it.  Note that this object is also owned by the        */\n  /*    manager.                                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory is available  */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Node_Unref                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Decrement a cache node's internal reference count.  When the count */\n  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */\n  /*    cache flushes.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node    :: The cache node handle.                                  */\n  /*                                                                       */\n  /*    manager :: The cache manager handle.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_Manager_RemoveFaceID\n   *\n   * @description:\n   *   A special function used to indicate to the cache manager that\n   *   a given @FTC_FaceID is no longer valid, either because its\n   *   content changed, or because it was deallocated or uninstalled.\n   *\n   * @input:\n   *   manager ::\n   *     The cache manager handle.\n   *\n   *   face_id ::\n   *     The @FTC_FaceID to be removed.\n   *\n   * @note:\n   *   This function flushes all nodes from the cache corresponding to this\n   *   `face_id', with the exception of nodes with a non-null reference\n   *   count.\n   *\n   *   Such nodes are however modified internally so as to never appear\n   *   in later lookups with the same `face_id' value, and to be immediately\n   *   destroyed when released by all their users.\n   *\n   */\n  FT_EXPORT( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_CMapCache\n   *\n   * @description:\n   *   An opaque handle used to model a charmap cache.  This cache is to\n   *   hold character codes -> glyph indices mappings.\n   *\n   */\n  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_New\n   *\n   * @description:\n   *   Create a new charmap cache.\n   *\n   * @input:\n   *   manager ::\n   *     A handle to the cache manager.\n   *\n   * @output:\n   *   acache ::\n   *     A new cache handle.  NULL in case of error.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Like all other caches, this one will be destroyed with the cache\n   *   manager.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_Lookup\n   *\n   * @description:\n   *   Translate a character code into a glyph index, using the charmap\n   *   cache.\n   *\n   * @input:\n   *   cache ::\n   *     A charmap cache handle.\n   *\n   *   face_id ::\n   *     The source face ID.\n   *\n   *   cmap_index ::\n   *     The index of the charmap in the source face.  Any negative value\n   *     means to use the cache @FT_Face's default charmap.\n   *\n   *   char_code ::\n   *     The character code (in the corresponding charmap).\n   *\n   * @return:\n   *    Glyph index.  0~means `no glyph'.\n   *\n   */\n  FT_EXPORT( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       IMAGE CACHE OBJECT                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FTC_ImageTypeRec\n   *\n   * @description:\n   *   A structure used to model the type of images in a glyph cache.\n   *\n   * @fields:\n   *   face_id ::\n   *     The face ID.\n   *\n   *   width ::\n   *     The width in pixels.\n   *\n   *   height ::\n   *     The height in pixels.\n   *\n   *   flags ::\n   *     The load flags, as in @FT_Load_Glyph.\n   *\n   */\n  typedef struct  FTC_ImageTypeRec_\n  {\n    FTC_FaceID  face_id;\n    FT_Int      width;\n    FT_Int      height;\n    FT_Int32    flags;\n\n  } FTC_ImageTypeRec;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_ImageType\n   *\n   * @description:\n   *   A handle to an @FTC_ImageTypeRec structure.\n   *\n   */\n  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;\n\n\n  /* */\n\n\n#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \\\n          ( (d1)->face_id == (d2)->face_id && \\\n            (d1)->width   == (d2)->width   && \\\n            (d1)->flags   == (d2)->flags   )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_ImageCache                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a glyph image cache object.  They are designed to      */\n  /*    hold many distinct glyph images while not exceeding a certain      */\n  /*    memory threshold.                                                  */\n  /*                                                                       */\n  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_New                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new glyph image cache.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: The parent manager for the image cache.                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new glyph image cache object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_Lookup                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a given glyph image from a glyph image cache.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source glyph image cache.                */\n  /*                                                                       */\n  /*    type   :: A pointer to a glyph image type descriptor.              */\n  /*                                                                       */\n  /*    gindex :: The glyph index to retrieve.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: The corresponding @FT_Glyph object.  0~in case of        */\n  /*              failure.                                                 */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_LookupScaler                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source glyph image cache.            */\n  /*                                                                       */\n  /*    scaler     :: A pointer to a scaler descriptor.                    */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index to retrieve.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph     :: The corresponding @FT_Glyph object.  0~in case of    */\n  /*                  failure.                                             */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */\n  /*    glyphs; you should always use the FreeType cache API instead.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBit                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */\n  /*    structure for details.                                             */\n  /*                                                                       */\n  typedef struct FTC_SBitRec_*  FTC_SBit;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_SBitRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very compact structure used to describe a small glyph bitmap.    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width     :: The bitmap width in pixels.                           */\n  /*                                                                       */\n  /*    height    :: The bitmap height in pixels.                          */\n  /*                                                                       */\n  /*    left      :: The horizontal distance from the pen position to the  */\n  /*                 left bitmap border (a.k.a. `left side bearing', or    */\n  /*                 `lsb').                                               */\n  /*                                                                       */\n  /*    top       :: The vertical distance from the pen position (on the   */\n  /*                 baseline) to the upper bitmap border (a.k.a. `top     */\n  /*                 side bearing').  The distance is positive for upwards */\n  /*                 y~coordinates.                                        */\n  /*                                                                       */\n  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */\n  /*                                                                       */\n  /*    max_grays :: Maximum gray level value (in the range 1 to~255).     */\n  /*                                                                       */\n  /*    pitch     :: The number of bytes per bitmap line.  May be positive */\n  /*                 or negative.                                          */\n  /*                                                                       */\n  /*    xadvance  :: The horizontal advance width in pixels.               */\n  /*                                                                       */\n  /*    yadvance  :: The vertical advance height in pixels.                */\n  /*                                                                       */\n  /*    buffer    :: A pointer to the bitmap pixels.                       */\n  /*                                                                       */\n  typedef struct  FTC_SBitRec_\n  {\n    FT_Byte   width;\n    FT_Byte   height;\n    FT_Char   left;\n    FT_Char   top;\n\n    FT_Byte   format;\n    FT_Byte   max_grays;\n    FT_Short  pitch;\n    FT_Char   xadvance;\n    FT_Char   yadvance;\n\n    FT_Byte*  buffer;\n\n  } FTC_SBitRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBitCache                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap cache.  These are special cache objects */\n  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */\n  /*    much more efficient way than the traditional glyph image cache     */\n  /*    implemented by @FTC_ImageCache.                                    */\n  /*                                                                       */\n  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_New                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache to store small glyph bitmaps.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the source cache manager.                   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_Lookup                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Look up a given small glyph bitmap in a given sbit cache and       */\n  /*    `lock' it to prevent its flushing from the cache until needed.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source sbit cache.                       */\n  /*                                                                       */\n  /*    type   :: A pointer to the glyph image type descriptor.            */\n  /*                                                                       */\n  /*    gindex :: The glyph index.                                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit   :: A handle to a small bitmap descriptor.                   */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache    cache,\n                        FTC_ImageType    type,\n                        FT_UInt          gindex,\n                        FTC_SBit        *sbit,\n                        FTC_Node        *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_LookupScaler                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source sbit cache.                   */\n  /*                                                                       */\n  /*    scaler     :: A pointer to the scaler descriptor.                  */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit       :: A handle to a small bitmap descriptor.               */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *sbit,\n                              FTC_Node      *anode );\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftcffdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcffdrv.h                                                             */\n/*                                                                         */\n/*    FreeType API for controlling the CFF driver (specification only).    */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCFFDRV_H__\n#define __FTCFFDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   cff_driver\n   *\n   * @title:\n   *   The CFF driver\n   *\n   * @abstract:\n   *   Controlling the CFF driver module.\n   *\n   * @description:\n   *   While FreeType's CFF driver doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The CFF driver's module name is `cff'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   hinting-engine\n   *\n   * @description:\n   *   Thanks to Adobe, which contributed a new hinting (and parsing)\n   *   engine, an application can select between `freetype' and `adobe' if\n   *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration\n   *   macro isn't defined, `hinting-engine' does nothing.\n   *\n   *   The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is\n   *   defined, and `adobe' otherwise.\n   *\n   *   The following example code demonstrates how to select Adobe's hinting\n   *   engine (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"hinting-engine\", &hinting_engine );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_CFF_HINTING_XXX\n   *\n   * @description:\n   *   A list of constants used for the @hinting-engine property to select\n   *   the hinting engine for CFF fonts.\n   *\n   * @values:\n   *   FT_CFF_HINTING_FREETYPE ::\n   *     Use the old FreeType hinting engine.\n   *\n   *   FT_CFF_HINTING_ADOBE ::\n   *     Use the hinting engine contributed by Adobe.\n   *\n   */\n#define FT_CFF_HINTING_FREETYPE  0\n#define FT_CFF_HINTING_ADOBE     1\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   no-stem-darkening\n   *\n   * @description:\n   *   By default, the Adobe CFF engine darkens stems at smaller sizes,\n   *   regardless of hinting, to enhance contrast.  Setting this property,\n   *   stem darkening gets switched off.\n   *\n   *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_Bool     no_stem_darkening = TRUE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"no-stem-darkening\", &no_stem_darkening );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTCFFDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftchapters.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/* This file defines the structure of the FreeType reference.              */\n/* It is used by the python script which generates the HTML files.         */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    general_remarks                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    General Remarks                                                      */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    user_allocation                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    core_api                                                             */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Core API                                                             */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    version                                                              */\n/*    basic_types                                                          */\n/*    base_interface                                                       */\n/*    glyph_variants                                                       */\n/*    glyph_management                                                     */\n/*    mac_specific                                                         */\n/*    sizes_management                                                     */\n/*    header_file_macros                                                   */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    format_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Format-Specific API                                                  */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    multiple_masters                                                     */\n/*    truetype_tables                                                      */\n/*    type1_tables                                                         */\n/*    sfnt_names                                                           */\n/*    bdf_fonts                                                            */\n/*    cid_fonts                                                            */\n/*    pfr_fonts                                                            */\n/*    winfnt_fonts                                                         */\n/*    font_formats                                                         */\n/*    gasp_table                                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    module_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Controlling FreeType Modules                                         */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    auto_hinter                                                          */\n/*    cff_driver                                                           */\n/*    tt_driver                                                            */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Cache Sub-System                                                     */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    support_api                                                          */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Support API                                                          */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    computations                                                         */\n/*    list_processing                                                      */\n/*    outline_processing                                                   */\n/*    quick_advance                                                        */\n/*    bitmap_handling                                                      */\n/*    raster                                                               */\n/*    glyph_stroker                                                        */\n/*    system_interface                                                     */\n/*    module_management                                                    */\n/*    gzip                                                                 */\n/*    lzw                                                                  */\n/*    bzip2                                                                */\n/*    lcd_filtering                                                        */\n/*                                                                         */\n/***************************************************************************/\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcid.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing CID font information (specification).     */\n/*                                                                         */\n/*  Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal.                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCID_H__\n#define __FTCID_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cid_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    CID Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    CID-keyed font specific API.                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of CID-keyed font specific   */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Registry_Ordering_Supplement\n   *\n   * @description:\n   *    Retrieve the Registry/Ordering/Supplement triple (also known as the\n   *    \"R/O/S\") from a CID-keyed font.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    registry ::\n   *       The registry, as a C~string, owned by the face.\n   *\n   *    ordering ::\n   *       The ordering, as a C~string, owned by the face.\n   *\n   *    supplement ::\n   *       The supplement.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces, returning an error\n   *    otherwise.\n   *\n   * @since:\n   *    2.3.6\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,\n                                           const char*  *registry,\n                                           const char*  *ordering,\n                                           FT_Int       *supplement);\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Is_Internally_CID_Keyed\n   *\n   * @description:\n   *    Retrieve the type of the input face, CID keyed or not.  In\n   *    constrast to the @FT_IS_CID_KEYED macro this function returns\n   *    successfully also for CID-keyed fonts in an SNFT wrapper.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    is_cid ::\n   *       The type of the face as an @FT_Bool.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,\n                                      FT_Bool  *is_cid );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_From_Glyph_Index\n   *\n   * @description:\n   *    Retrieve the CID of the input glyph index.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   *    glyph_index ::\n   *       The input glyph index.\n   *\n   * @output:\n   *    cid ::\n   *       The CID as an @FT_UInt.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_From_Glyph_Index( FT_Face   face,\n                               FT_UInt   glyph_index,\n                               FT_UInt  *cid );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/fterrdef.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrdef.h                                                             */\n/*                                                                         */\n/*    FreeType error codes (specification).                                */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2006, 2007, 2010-2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                LIST OF ERROR CODES/MESSAGES             *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n  /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */\n  /* including this file.                                           */\n\n\n  /* generic errors */\n\n  FT_NOERRORDEF_( Ok,                                        0x00, \\\n                  \"no error\" )\n\n  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \\\n                \"cannot open resource\" )\n  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \\\n                \"unknown file format\" )\n  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \\\n                \"broken file\" )\n  FT_ERRORDEF_( Invalid_Version,                             0x04, \\\n                \"invalid FreeType version\" )\n  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \\\n                \"module version is too low\" )\n  FT_ERRORDEF_( Invalid_Argument,                            0x06, \\\n                \"invalid argument\" )\n  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \\\n                \"unimplemented feature\" )\n  FT_ERRORDEF_( Invalid_Table,                               0x08, \\\n                \"broken table\" )\n  FT_ERRORDEF_( Invalid_Offset,                              0x09, \\\n                \"broken offset within table\" )\n  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \\\n                \"array allocation size too large\" )\n  FT_ERRORDEF_( Missing_Module,                              0x0B, \\\n                \"missing module\" )\n  FT_ERRORDEF_( Missing_Property,                            0x0C, \\\n                \"missing property\" )\n\n  /* glyph/character errors */\n\n  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \\\n                \"invalid glyph index\" )\n  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \\\n                \"invalid character code\" )\n  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \\\n                \"unsupported glyph image format\" )\n  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \\\n                \"cannot render this glyph format\" )\n  FT_ERRORDEF_( Invalid_Outline,                             0x14, \\\n                \"invalid outline\" )\n  FT_ERRORDEF_( Invalid_Composite,                           0x15, \\\n                \"invalid composite glyph\" )\n  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \\\n                \"too many hints\" )\n  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \\\n                \"invalid pixel size\" )\n\n  /* handle errors */\n\n  FT_ERRORDEF_( Invalid_Handle,                              0x20, \\\n                \"invalid object handle\" )\n  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \\\n                \"invalid library handle\" )\n  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \\\n                \"invalid module handle\" )\n  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \\\n                \"invalid face handle\" )\n  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \\\n                \"invalid size handle\" )\n  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \\\n                \"invalid glyph slot handle\" )\n  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \\\n                \"invalid charmap handle\" )\n  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \\\n                \"invalid cache manager handle\" )\n  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \\\n                \"invalid stream handle\" )\n\n  /* driver errors */\n\n  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \\\n                \"too many modules\" )\n  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \\\n                \"too many extensions\" )\n\n  /* memory errors */\n\n  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \\\n                \"out of memory\" )\n  FT_ERRORDEF_( Unlisted_Object,                             0x41, \\\n                \"unlisted object\" )\n\n  /* stream errors */\n\n  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \\\n                \"cannot open stream\" )\n  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \\\n                \"invalid stream seek\" )\n  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \\\n                \"invalid stream skip\" )\n  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \\\n                \"invalid stream read\" )\n  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \\\n                \"invalid stream operation\" )\n  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \\\n                \"invalid frame operation\" )\n  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \\\n                \"nested frame access\" )\n  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \\\n                \"invalid frame read\" )\n\n  /* raster errors */\n\n  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \\\n                \"raster uninitialized\" )\n  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \\\n                \"raster corrupted\" )\n  FT_ERRORDEF_( Raster_Overflow,                             0x62, \\\n                \"raster overflow\" )\n  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \\\n                \"negative height while rastering\" )\n\n  /* cache errors */\n\n  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \\\n                \"too many registered caches\" )\n\n  /* TrueType and SFNT errors */\n\n  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \\\n                \"invalid opcode\" )\n  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \\\n                \"too few arguments\" )\n  FT_ERRORDEF_( Stack_Overflow,                              0x82, \\\n                \"stack overflow\" )\n  FT_ERRORDEF_( Code_Overflow,                               0x83, \\\n                \"code overflow\" )\n  FT_ERRORDEF_( Bad_Argument,                                0x84, \\\n                \"bad argument\" )\n  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \\\n                \"division by zero\" )\n  FT_ERRORDEF_( Invalid_Reference,                           0x86, \\\n                \"invalid reference\" )\n  FT_ERRORDEF_( Debug_OpCode,                                0x87, \\\n                \"found debug opcode\" )\n  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \\\n                \"found ENDF opcode in execution stream\" )\n  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \\\n                \"nested DEFS\" )\n  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \\\n                \"invalid code range\" )\n  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \\\n                \"execution context too long\" )\n  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \\\n                \"too many function definitions\" )\n  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \\\n                \"too many instruction definitions\" )\n  FT_ERRORDEF_( Table_Missing,                               0x8E, \\\n                \"SFNT font table missing\" )\n  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \\\n                \"horizontal header (hhea) table missing\" )\n  FT_ERRORDEF_( Locations_Missing,                           0x90, \\\n                \"locations (loca) table missing\" )\n  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \\\n                \"name table missing\" )\n  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \\\n                \"character map (cmap) table missing\" )\n  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \\\n                \"horizontal metrics (hmtx) table missing\" )\n  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \\\n                \"PostScript (post) table missing\" )\n  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \\\n                \"invalid horizontal metrics\" )\n  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \\\n                \"invalid character map (cmap) format\" )\n  FT_ERRORDEF_( Invalid_PPem,                                0x97, \\\n                \"invalid ppem value\" )\n  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \\\n                \"invalid vertical metrics\" )\n  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \\\n                \"could not find context\" )\n  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \\\n                \"invalid PostScript (post) table format\" )\n  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \\\n                \"invalid PostScript (post) table\" )\n\n  /* CFF, CID, and Type 1 errors */\n\n  FT_ERRORDEF_( Syntax_Error,                                0xA0, \\\n                \"opcode syntax error\" )\n  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \\\n                \"argument stack underflow\" )\n  FT_ERRORDEF_( Ignore,                                      0xA2, \\\n                \"ignore\" )\n  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \\\n                \"no Unicode glyph name found\" )\n  FT_ERRORDEF_( Glyph_Too_Big,                               0xA4, \\\n                \"glyph to big for hinting\" )\n\n  /* BDF errors */\n\n  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \\\n                \"`STARTFONT' field missing\" )\n  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \\\n                \"`FONT' field missing\" )\n  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \\\n                \"`SIZE' field missing\" )\n  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3, \\\n                \"`FONTBOUNDINGBOX' field missing\" )\n  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4, \\\n                \"`CHARS' field missing\" )\n  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5, \\\n                \"`STARTCHAR' field missing\" )\n  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6, \\\n                \"`ENCODING' field missing\" )\n  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7, \\\n                \"`BBX' field missing\" )\n  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8, \\\n                \"`BBX' too big\" )\n  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9, \\\n                \"Font header corrupted or missing fields\" )\n  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA, \\\n                \"Font glyphs corrupted or missing fields\" )\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/fterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrors.h                                                             */\n/*                                                                         */\n/*    FreeType error code handling (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2007, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This special header file is used to define the handling of FT2        */\n  /* enumeration constants.  It can also be used to generate error message */\n  /* strings with a small macro trick explained below.                     */\n  /*                                                                       */\n  /* I - Error Formats                                                     */\n  /* -----------------                                                     */\n  /*                                                                       */\n  /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */\n  /*   defined in ftoption.h in order to make the higher byte indicate     */\n  /*   the module where the error has happened (this is not compatible     */\n  /*   with standard builds of FreeType 2).  See the file `ftmoderr.h' for */\n  /*   more details.                                                       */\n  /*                                                                       */\n  /*                                                                       */\n  /* II - Error Message strings                                            */\n  /* --------------------------                                            */\n  /*                                                                       */\n  /*   The error definitions below are made through special macros that    */\n  /*   allow client applications to build a table of error message strings */\n  /*   if they need it.  The strings are not included in a normal build of */\n  /*   FreeType 2 to save space (most client applications do not use       */\n  /*   them).                                                              */\n  /*                                                                       */\n  /*   To do so, you have to define the following macros before including  */\n  /*   this file:                                                          */\n  /*                                                                       */\n  /*   FT_ERROR_START_LIST ::                                              */\n  /*     This macro is called before anything else to define the start of  */\n  /*     the error list.  It is followed by several FT_ERROR_DEF calls     */\n  /*     (see below).                                                      */\n  /*                                                                       */\n  /*   FT_ERROR_DEF( e, v, s ) ::                                          */\n  /*     This macro is called to define one single error.                  */\n  /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */\n  /*     `v' is the error numerical value.                                 */\n  /*     `s' is the corresponding error string.                            */\n  /*                                                                       */\n  /*   FT_ERROR_END_LIST ::                                                */\n  /*     This macro ends the list.                                         */\n  /*                                                                       */\n  /*   Additionally, you have to undefine __FTERRORS_H__ before #including */\n  /*   this file.                                                          */\n  /*                                                                       */\n  /*   Here is a simple example:                                           */\n  /*                                                                       */\n  /*     {                                                                 */\n  /*       #undef __FTERRORS_H__                                           */\n  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */\n  /*       #define FT_ERROR_START_LIST     {                               */\n  /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */\n  /*                                                                       */\n  /*       const struct                                                    */\n  /*       {                                                               */\n  /*         int          err_code;                                        */\n  /*         const char*  err_msg;                                         */\n  /*       } ft_errors[] =                                                 */\n  /*                                                                       */\n  /*       #include FT_ERRORS_H                                            */\n  /*     }                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTERRORS_H__\n#define __FTERRORS_H__\n\n\n  /* include module base error codes */\n#include FT_MODULE_ERRORS_H\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n\n  /* FT_ERR_PREFIX is used as a prefix for error identifiers. */\n  /* By default, we use `FT_Err_'.                            */\n  /*                                                          */\n#ifndef FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FT_Err_\n#endif\n\n\n  /* FT_ERR_BASE is used as the base for module-specific errors. */\n  /*                                                             */\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n#ifndef FT_ERR_BASE\n#define FT_ERR_BASE  FT_Mod_Err_Base\n#endif\n\n#else\n\n#undef FT_ERR_BASE\n#define FT_ERR_BASE  0\n\n#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */\n\n\n  /* If FT_ERRORDEF is not defined, we need to define a simple */\n  /* enumeration type.                                         */\n  /*                                                           */\n#ifndef FT_ERRORDEF\n\n#define FT_ERRORDEF( e, v, s )  e = v,\n#define FT_ERROR_START_LIST     enum {\n#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_ERRORDEF */\n\n\n  /* this macro is used to define an error */\n#define FT_ERRORDEF_( e, v, s )                                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )\n\n  /* this is only used for <module>_Err_Ok, which must be 0! */\n#define FT_NOERRORDEF_( e, v, s )                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )\n\n\n#ifdef FT_ERROR_START_LIST\n  FT_ERROR_START_LIST\n#endif\n\n\n  /* now include the error codes */\n#include FT_ERROR_DEFINITIONS_H\n\n\n#ifdef FT_ERROR_END_LIST\n  FT_ERROR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      SIMPLE CLEANUP                     *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_ERROR_START_LIST\n#undef FT_ERROR_END_LIST\n\n#undef FT_ERRORDEF\n#undef FT_ERRORDEF_\n#undef FT_NOERRORDEF_\n\n#undef FT_NEED_EXTERN_C\n#undef FT_ERR_BASE\n\n  /* FT_ERR_PREFIX is needed internally */\n#ifndef FT2_BUILD_LIBRARY\n#undef FT_ERR_PREFIX\n#endif\n\n#endif /* __FTERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftgasp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.h                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (specification).                   */\n/*                                                                         */\n/*  Copyright 2007, 2008, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef _FT_GASP_H_\n#define _FT_GASP_H_\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\n  /***************************************************************************\n   *\n   * @section:\n   *   gasp_table\n   *\n   * @title:\n   *   Gasp Table\n   *\n   * @abstract:\n   *   Retrieving TrueType `gasp' table entries.\n   *\n   * @description:\n   *   The function @FT_Get_Gasp can be used to query a TrueType or OpenType\n   *   font for specific entries in its `gasp' table, if any.  This is\n   *   mainly useful when implementing native TrueType hinting with the\n   *   bytecode interpreter to duplicate the Windows text rendering results.\n   */\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_GASP_XXX\n   *\n   * @description:\n   *   A list of values and/or bit-flags returned by the @FT_Get_Gasp\n   *   function.\n   *\n   * @values:\n   *   FT_GASP_NO_TABLE ::\n   *     This special value means that there is no GASP table in this face.\n   *     It is up to the client to decide what to do.\n   *\n   *   FT_GASP_DO_GRIDFIT ::\n   *     Grid-fitting and hinting should be performed at the specified ppem.\n   *     This *really* means TrueType bytecode interpretation.  If this bit\n   *     is not set, no hinting gets applied.\n   *\n   *   FT_GASP_DO_GRAY ::\n   *     Anti-aliased rendering should be performed at the specified ppem.\n   *     If not set, do monochrome rendering.\n   *\n   *   FT_GASP_SYMMETRIC_SMOOTHING ::\n   *     If set, smoothing along multiple axes must be used with ClearType.\n   *\n   *   FT_GASP_SYMMETRIC_GRIDFIT ::\n   *     Grid-fitting must be used with ClearType's symmetric smoothing.\n   *\n   * @note:\n   *   The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be\n   *   used for standard font rasterization only.  Independently of that,\n   *   `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to\n   *   be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and\n   *   `FT_GASP_DO_GRAY' are consequently ignored).\n   *\n   *   `ClearType' is Microsoft's implementation of LCD rendering, partly\n   *   protected by patents.\n   *\n   * @since:\n   *   2.3.0\n   */\n#define FT_GASP_NO_TABLE               -1\n#define FT_GASP_DO_GRIDFIT           0x01\n#define FT_GASP_DO_GRAY              0x02\n#define FT_GASP_SYMMETRIC_SMOOTHING  0x08\n#define FT_GASP_SYMMETRIC_GRIDFIT    0x10\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_Gasp\n   *\n   * @description:\n   *   Read the `gasp' table from a TrueType or OpenType font file and\n   *   return the entry corresponding to a given character pixel size.\n   *\n   * @input:\n   *   face :: The source face handle.\n   *   ppem :: The vertical character pixel size.\n   *\n   * @return:\n   *   Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no\n   *   `gasp' table in the face.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem );\n\n/* */\n\n#endif /* _FT_GASP_H_ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.h                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the definition of several convenience functions    */\n  /* that can be used by client applications to easily retrieve glyph      */\n  /* bitmaps and outlines from a given face.                               */\n  /*                                                                       */\n  /* These functions should be optional if you are writing a font server   */\n  /* or text layout engine on top of FreeType.  However, they are pretty   */\n  /* handy for many other simple uses of the library.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTGLYPH_H__\n#define __FTGLYPH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Management                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Generic interface to manage individual glyph data.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains definitions used to manage glyph data        */\n  /*    through generic FT_Glyph objects.  Each of them can contain a      */\n  /*    bitmap, a vector outline, or even images in other formats.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* forward declaration to a private type */\n  typedef struct FT_Glyph_Class_  FT_Glyph_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Glyph                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Handle to an object used to model generic glyph images.  It is a   */\n  /*    pointer to the @FT_GlyphRec structure and can contain a glyph      */\n  /*    bitmap or pointer.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Glyph objects are not owned by the library.  You must thus release */\n  /*    them manually (through @FT_Done_Glyph) _before_ calling            */\n  /*    @FT_Done_FreeType.                                                 */\n  /*                                                                       */\n  typedef struct FT_GlyphRec_*  FT_Glyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root glyph structure contains a given glyph image plus its     */\n  /*    advance width in 16.16 fixed-point format.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library :: A handle to the FreeType library object.                */\n  /*                                                                       */\n  /*    clazz   :: A pointer to the glyph's class.  Private.               */\n  /*                                                                       */\n  /*    format  :: The format of the glyph's image.                        */\n  /*                                                                       */\n  /*    advance :: A 16.16 vector that gives the glyph's advance width.    */\n  /*                                                                       */\n  typedef struct  FT_GlyphRec_\n  {\n    FT_Library             library;\n    const FT_Glyph_Class*  clazz;\n    FT_Glyph_Format        format;\n    FT_Vector              advance;\n\n  } FT_GlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_BitmapGlyph                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a bitmap glyph image.  This is */\n  /*    a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.     */\n  /*                                                                       */\n  typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BitmapGlyphRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for bitmap glyph images.  This really is a        */\n  /*    `sub-class' of @FT_GlyphRec.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root   :: The root @FT_Glyph fields.                               */\n  /*                                                                       */\n  /*    left   :: The left-side bearing, i.e., the horizontal distance     */\n  /*              from the current pen position to the left border of the  */\n  /*              glyph bitmap.                                            */\n  /*                                                                       */\n  /*    top    :: The top-side bearing, i.e., the vertical distance from   */\n  /*              the current pen position to the top border of the glyph  */\n  /*              bitmap.  This distance is positive for upwards~y!        */\n  /*                                                                       */\n  /*    bitmap :: A descriptor for the bitmap.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_BITMAP'.  This lets you access   */\n  /*    the bitmap's contents easily.                                      */\n  /*                                                                       */\n  /*    The corresponding pixel buffer is always owned by @FT_BitmapGlyph  */\n  /*    and is thus created and destroyed with it.                         */\n  /*                                                                       */\n  typedef struct  FT_BitmapGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Int       left;\n    FT_Int       top;\n    FT_Bitmap    bitmap;\n\n  } FT_BitmapGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_OutlineGlyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model an outline glyph image.  This  */\n  /*    is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */\n  /*                                                                       */\n  typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_OutlineGlyphRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for outline (vectorial) glyph images.  This       */\n  /*    really is a `sub-class' of @FT_GlyphRec.                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root    :: The root @FT_Glyph fields.                              */\n  /*                                                                       */\n  /*    outline :: A descriptor for the outline.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have      */\n  /*    `glyph->format == FT_GLYPH_FORMAT_OUTLINE'.  This lets you access  */\n  /*    the outline's content easily.                                      */\n  /*                                                                       */\n  /*    As the outline is extracted from a glyph slot, its coordinates are */\n  /*    expressed normally in 26.6 pixels, unless the flag                 */\n  /*    @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */\n  /*                                                                       */\n  /*    The outline's tables are always owned by the object and are        */\n  /*    destroyed with it.                                                 */\n  /*                                                                       */\n  typedef struct  FT_OutlineGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Outline   outline;\n\n  } FT_OutlineGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to extract a glyph image from a slot.  Note that   */\n  /*    the created @FT_Glyph object must be released with @FT_Done_Glyph. */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot   :: A handle to the source glyph slot.                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: A handle to the glyph object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Copy                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to copy a glyph image.  Note that the created      */\n  /*    @FT_Glyph object must be released with @FT_Done_Glyph.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source glyph object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target glyph object.  0~in case of       */\n  /*              error.                                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Transform                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a glyph image if its format is scalable.                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    glyph  :: A handle to the target glyph object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to a 2x2 matrix to apply.                      */\n  /*                                                                       */\n  /*    delta  :: A pointer to a 2d vector to apply.  Coordinates are      */\n  /*              expressed in 1/64th of a pixel.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code (if not 0, the glyph format is not scalable).  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The 2x2 transformation matrix is also applied to the glyph's       */\n  /*    advance vector.                                                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_BBox_Mode                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The mode how the values of @FT_Glyph_Get_CBox are returned.        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_BBOX_UNSCALED ::                                          */\n  /*      Return unscaled font units.                                      */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_SUBPIXELS ::                                         */\n  /*      Return unfitted 26.6 coordinates.                                */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_GRIDFIT ::                                           */\n  /*      Return grid-fitted 26.6 coordinates.                             */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_TRUNCATE ::                                          */\n  /*      Return coordinates in integer pixels.                            */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_PIXELS ::                                            */\n  /*      Return grid-fitted pixel coordinates.                            */\n  /*                                                                       */\n  typedef enum  FT_Glyph_BBox_Mode_\n  {\n    FT_GLYPH_BBOX_UNSCALED  = 0,\n    FT_GLYPH_BBOX_SUBPIXELS = 0,\n    FT_GLYPH_BBOX_GRIDFIT   = 1,\n    FT_GLYPH_BBOX_TRUNCATE  = 2,\n    FT_GLYPH_BBOX_PIXELS    = 3\n\n  } FT_Glyph_BBox_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_bbox_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Glyph_BBox_Mode values instead.                                */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   ft_glyph_bbox_unscaled  :: See @FT_GLYPH_BBOX_UNSCALED.             */\n  /*   ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS.            */\n  /*   ft_glyph_bbox_gridfit   :: See @FT_GLYPH_BBOX_GRIDFIT.              */\n  /*   ft_glyph_bbox_truncate  :: See @FT_GLYPH_BBOX_TRUNCATE.             */\n  /*   ft_glyph_bbox_pixels    :: See @FT_GLYPH_BBOX_PIXELS.               */\n  /*                                                                       */\n#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED\n#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS\n#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT\n#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE\n#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Get_CBox                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a glyph's `control box'.  The control box encloses all the  */\n  /*    outline's points, including Bézier control points.  Though it      */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the source glyph object.                      */\n  /*                                                                       */\n  /*    mode  :: The mode which indicates how to interpret the returned    */\n  /*             bounding box values.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox :: The glyph coordinate bounding box.  Coordinates are       */\n  /*             expressed in 1/64th of pixels if it is grid-fitted.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Coordinates are relative to the glyph origin, using the y~upwards  */\n  /*    convention.                                                        */\n  /*                                                                       */\n  /*    If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode'   */\n  /*    must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font        */\n  /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */\n  /*    is another name for this constant.                                 */\n  /*                                                                       */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting CBox is meaningless.  To get      */\n  /*    reasonable values for the CBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the CBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  /*    Note that the maximum coordinates are exclusive, which means that  */\n  /*    one can compute the width and height of the glyph image (be it in  */\n  /*    integer or 26.6 pixels) as:                                        */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      width  = bbox.xMax - bbox.xMin;                                  */\n  /*      height = bbox.yMax - bbox.yMin;                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note also that for 26.6 coordinates, if `bbox_mode' is set to      */\n  /*    @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,  */\n  /*    which corresponds to:                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      bbox.xMin = FLOOR(bbox.xMin);                                    */\n  /*      bbox.yMin = FLOOR(bbox.yMin);                                    */\n  /*      bbox.xMax = CEILING(bbox.xMax);                                  */\n  /*      bbox.yMax = CEILING(bbox.yMax);                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get the bbox in pixel coordinates, set `bbox_mode' to           */\n  /*    @FT_GLYPH_BBOX_TRUNCATE.                                           */\n  /*                                                                       */\n  /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */\n  /*    to @FT_GLYPH_BBOX_PIXELS.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_To_Bitmap                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph object to a bitmap glyph object.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    the_glyph   :: A pointer to a handle to the target glyph.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: An enumeration that describes how the data is       */\n  /*                   rendered.                                           */\n  /*                                                                       */\n  /*    origin      :: A pointer to a vector used to translate the glyph   */\n  /*                   image before rendering.  Can be~0 (if no            */\n  /*                   translation).  The origin is expressed in           */\n  /*                   26.6 pixels.                                        */\n  /*                                                                       */\n  /*    destroy     :: A boolean that indicates that the original glyph    */\n  /*                   image should be destroyed by this function.  It is  */\n  /*                   never destroyed in case of error.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does nothing if the glyph format isn't scalable.     */\n  /*                                                                       */\n  /*    The glyph image is translated with the `origin' vector before      */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  /*    The first parameter is a pointer to an @FT_Glyph handle, that will */\n  /*    be _replaced_ by this function (with newly allocated data).        */\n  /*    Typically, you would use (omitting error handling):                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph        glyph;                                         */\n  /*        FT_BitmapGlyph  glyph_bitmap;                                  */\n  /*                                                                       */\n  /*                                                                       */\n  /*        // load glyph                                                  */\n  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */\n  /*                                                                       */\n  /*        // extract glyph image                                         */\n  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */\n  /*                                                                       */\n  /*        // convert to a bitmap (default render mode + destroying old)  */\n  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */\n  /*        {                                                              */\n  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,   */\n  /*                                      0, 1 );                          */\n  /*          if ( error ) // `glyph' unchanged                            */\n  /*            ...                                                        */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        // access bitmap content by typecasting                        */\n  /*        glyph_bitmap = (FT_BitmapGlyph)glyph;                          */\n  /*                                                                       */\n  /*        // do funny stuff with it, like blitting/drawing               */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        // discard glyph image (bitmap or not)                         */\n  /*        FT_Done_Glyph( glyph );                                        */\n  /*      }                                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*    Here another example, again without error handling:                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph  glyphs[MAX_GLYPHS]                                   */\n  /*                                                                       */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       */\n  /*                  FT_Get_Glyph ( face->glyph, &glyph[idx] );           */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*        {                                                              */\n  /*          FT_Glyph  bitmap = glyphs[idx];                              */\n  /*                                                                       */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          // after this call, `bitmap' no longer points into           */\n  /*          // the `glyphs' array (and the old value isn't destroyed)    */\n  /*          FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );    */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          FT_Done_Glyph( bitmap );                                     */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          FT_Done_Glyph( glyphs[idx] );                                */\n  /*      }                                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given glyph.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the target glyph object.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Done_Glyph( FT_Glyph  glyph );\n\n  /* */\n\n\n  /* other helpful functions */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Multiply                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Perform the matrix operation `b = a*b'.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: A pointer to matrix `a'.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    b :: A pointer to matrix `b'.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `a' or `b' is zero.              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix*        b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invert a 2x2 matrix.  Return an error if it can't be inverted.     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    matrix :: A pointer to the target matrix.  Remains untouched in    */\n  /*              case of error.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLYPH_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGXVAL_H__\n#define __FTGXVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gx_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueTypeGX/AAT Validation                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate TrueTypeGX/AAT tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */\n  /*    trak, prop, lcar).                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                                                                       */\n  /* Warning: Use FT_VALIDATE_XXX to validate a table.                     */\n  /*          Following definitions are for gxvalid developers.            */\n  /*                                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_VALIDATE_feat_INDEX     0\n#define FT_VALIDATE_mort_INDEX     1\n#define FT_VALIDATE_morx_INDEX     2\n#define FT_VALIDATE_bsln_INDEX     3\n#define FT_VALIDATE_just_INDEX     4\n#define FT_VALIDATE_kern_INDEX     5\n#define FT_VALIDATE_opbd_INDEX     6\n#define FT_VALIDATE_trak_INDEX     7\n#define FT_VALIDATE_prop_INDEX     8\n#define FT_VALIDATE_lcar_INDEX     9\n#define FT_VALIDATE_GX_LAST_INDEX  FT_VALIDATE_lcar_INDEX\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_VALIDATE_GX_LENGTH\n   *\n   * @description:\n   *   The number of tables checked in this module.  Use it as a parameter\n   *   for the `table-length' argument of function @FT_TrueTypeGX_Validate.\n   */\n#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n  /* */\n\n  /* Up to 0x1000 is used by otvalid.\n     Ox2xxx is reserved for feature OT extension. */\n#define FT_VALIDATE_GX_START 0x4000\n#define FT_VALIDATE_GX_BITFIELD( tag )                  \\\n  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_GXXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_TrueTypeGX_Validate to\n  *    indicate which TrueTypeGX/AAT Type tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_feat ::\n  *      Validate `feat' table.\n  *\n  *    FT_VALIDATE_mort ::\n  *      Validate `mort' table.\n  *\n  *    FT_VALIDATE_morx ::\n  *      Validate `morx' table.\n  *\n  *    FT_VALIDATE_bsln ::\n  *      Validate `bsln' table.\n  *\n  *    FT_VALIDATE_just ::\n  *      Validate `just' table.\n  *\n  *    FT_VALIDATE_kern ::\n  *      Validate `kern' table.\n  *\n  *    FT_VALIDATE_opbd ::\n  *      Validate `opbd' table.\n  *\n  *    FT_VALIDATE_trak ::\n  *      Validate `trak' table.\n  *\n  *    FT_VALIDATE_prop ::\n  *      Validate `prop' table.\n  *\n  *    FT_VALIDATE_lcar ::\n  *      Validate `lcar' table.\n  *\n  *    FT_VALIDATE_GX ::\n  *      Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,\n  *      opbd, trak, prop and lcar).\n  *\n  */\n\n#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )\n#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )\n#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )\n#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )\n#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )\n#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )\n#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )\n#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )\n#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )\n#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \\\n                          FT_VALIDATE_mort | \\\n                          FT_VALIDATE_morx | \\\n                          FT_VALIDATE_bsln | \\\n                          FT_VALIDATE_just | \\\n                          FT_VALIDATE_kern | \\\n                          FT_VALIDATE_opbd | \\\n                          FT_VALIDATE_trak | \\\n                          FT_VALIDATE_prop | \\\n                          FT_VALIDATE_lcar )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Validate\n  *\n  * @description:\n  *    Validate various TrueTypeGX tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_GXXXX for possible values.\n  *\n  *    table_length ::\n  *       The size of the `tables' array.  Normally, @FT_VALIDATE_GX_LENGTH\n  *       should be passed.\n  *\n  * @output:\n  *    tables ::\n  *       The array where all validated sfnt tables are stored.\n  *       The array itself must be allocated by a client.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with TrueTypeGX fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the buffers pointed to by\n  *   each `tables' element, by calling @FT_TrueTypeGX_Free.  A NULL value\n  *   indicates that the table either doesn't exist in the font, the\n  *   application hasn't asked for validation, or the validator doesn't have\n  *   the ability to validate the sfnt table.\n  */\n  FT_EXPORT( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Free\n  *\n  * @description:\n  *    Free the buffer allocated by TrueTypeGX validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer allocated by\n  *       @FT_TrueTypeGX_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_TrueTypeGX_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_CKERNXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_ClassicKern_Validate\n  *    to indicate the classic kern dialect or dialects.  If the selected\n  *    type doesn't fit, @FT_ClassicKern_Validate regards the table as\n  *    invalid.\n  *\n  * @values:\n  *    FT_VALIDATE_MS ::\n  *      Handle the `kern' table as a classic Microsoft kern table.\n  *\n  *    FT_VALIDATE_APPLE ::\n  *      Handle the `kern' table as a classic Apple kern table.\n  *\n  *    FT_VALIDATE_CKERN ::\n  *      Handle the `kern' as either classic Apple or Microsoft kern table.\n  */\n#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )\n#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )\n\n#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Validate\n  *\n  * @description:\n  *    Validate classic (16-bit format) kern table to assure that the offsets\n  *    and indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without error\n  *    checking (which can be quite time consuming).\n  *\n  *    The `kern' table validator in @FT_TrueTypeGX_Validate deals with both\n  *    the new 32-bit format and the classic 16-bit format, while\n  *    FT_ClassicKern_Validate only supports the classic 16-bit format.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the dialect to be validated.  See\n  *       @FT_VALIDATE_CKERNXXX for possible values.\n  *\n  * @output:\n  *    ckern_table ::\n  *       A pointer to the kern table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   After use, the application should deallocate the buffers pointed to by\n  *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value\n  *   indicates that the table doesn't exist in the font.\n  */\n  FT_EXPORT( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Free\n  *\n  * @description:\n  *    Free the buffer allocated by classic Kern validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_ClassicKern_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_ClassicKern_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftgzip.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.h                                                               */\n/*                                                                         */\n/*    Gzip-compressed stream support.                                      */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGZIP_H__\n#define __FTGZIP_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gzip                                                               */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    GZIP Streams                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using gzip-compressed font files.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Gzip-specific functions.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenGzip\n  *\n  * @description:\n  *   Open a new stream to parse gzip-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.gz' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, gzip compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a gzipped stream from\n  *   it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGZIP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftimage.h                                                              */\n/*                                                                         */\n/*    FreeType glyph image formats and default raster interface            */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2010, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Note: A `raster' is simply a scan-line converter, used to render      */\n  /*       FT_Outlines into FT_Bitmaps.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTIMAGE_H__\n#define __FTIMAGE_H__\n\n\n  /* _STANDALONE_ is from ftgrays.c */\n#ifndef _STANDALONE_\n#include <ft2build.h>\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pos                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The type FT_Pos is used to store vectorial coordinates.  Depending */\n  /*    on the context, these can represent distances in integer font      */\n  /*    units, or 16.16, or 26.6 fixed-point pixel coordinates.            */\n  /*                                                                       */\n  typedef signed long  FT_Pos;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Vector                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector; coordinates are of   */\n  /*    the FT_Pos type.                                                   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: The horizontal coordinate.                                    */\n  /*    y :: The vertical coordinate.                                      */\n  /*                                                                       */\n  typedef struct  FT_Vector_\n  {\n    FT_Pos  x;\n    FT_Pos  y;\n\n  } FT_Vector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BBox                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold an outline's bounding box, i.e., the      */\n  /*    coordinates of its extrema in the horizontal and vertical          */\n  /*    directions.                                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xMin :: The horizontal minimum (left-most).                        */\n  /*                                                                       */\n  /*    yMin :: The vertical minimum (bottom-most).                        */\n  /*                                                                       */\n  /*    xMax :: The horizontal maximum (right-most).                       */\n  /*                                                                       */\n  /*    yMax :: The vertical maximum (top-most).                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The bounding box is specified with the coordinates of the lower    */\n  /*    left and the upper right corner.  In PostScript, those values are  */\n  /*    often called (llx,lly) and (urx,ury), respectively.                */\n  /*                                                                       */\n  /*    If `yMin' is negative, this value gives the glyph's descender.     */\n  /*    Otherwise, the glyph doesn't descend below the baseline.           */\n  /*    Similarly, if `ymax' is positive, this value gives the glyph's     */\n  /*    ascender.                                                          */\n  /*                                                                       */\n  /*    `xMin' gives the horizontal distance from the glyph's origin to    */\n  /*    the left edge of the glyph's bounding box.  If `xMin' is negative, */\n  /*    the glyph extends to the left of the origin.                       */\n  /*                                                                       */\n  typedef struct  FT_BBox_\n  {\n    FT_Pos  xMin, yMin;\n    FT_Pos  xMax, yMax;\n\n  } FT_BBox;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Pixel_Mode                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of pixels in a     */\n  /*    given bitmap.  Note that additional formats may be added in the    */\n  /*    future.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_PIXEL_MODE_NONE ::                                              */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_MONO ::                                              */\n  /*      A monochrome bitmap, using 1~bit per pixel.  Note that pixels    */\n  /*      are stored in most-significant order (MSB), which means that     */\n  /*      the left-most pixel in a byte has value 128.                     */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY ::                                              */\n  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */\n  /*      images.  Each pixel is stored in one byte.  Note that the number */\n  /*      of `gray' levels is stored in the `num_grays' field of the       */\n  /*      @FT_Bitmap structure (it generally is 256).                      */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY2 ::                                             */\n  /*      A 2-bit per pixel bitmap, used to represent embedded             */\n  /*      anti-aliased bitmaps in font files according to the OpenType     */\n  /*      specification.  We haven't found a single font using this        */\n  /*      format, however.                                                 */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY4 ::                                             */\n  /*      A 4-bit per pixel bitmap, representing embedded anti-aliased     */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD ::                                               */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on LCD displays; the bitmap is three times      */\n  /*      wider than the original glyph image.  See also                   */\n  /*      @FT_RENDER_MODE_LCD.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD_V ::                                             */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on rotated LCD displays; the bitmap is three    */\n  /*      times taller than the original glyph image.  See also            */\n  /*      @FT_RENDER_MODE_LCD_V.                                           */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_BGRA ::                                              */\n  /*      An image with four 8-bit channels per pixel, representing a      */\n  /*      color image (such as emoticons) with alpha channel.  For each    */\n  /*      pixel, the format is BGRA, which means, the blue channel comes   */\n  /*      first in memory.  The color channels are pre-multiplied and in   */\n  /*      the sRGB colorspace.  For example, full red at half-translucent  */\n  /*      opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */\n  /*      See also @FT_LOAD_COLOR.                                         */\n  /*                                                                       */\n  typedef enum  FT_Pixel_Mode_\n  {\n    FT_PIXEL_MODE_NONE = 0,\n    FT_PIXEL_MODE_MONO,\n    FT_PIXEL_MODE_GRAY,\n    FT_PIXEL_MODE_GRAY2,\n    FT_PIXEL_MODE_GRAY4,\n    FT_PIXEL_MODE_LCD,\n    FT_PIXEL_MODE_LCD_V,\n    FT_PIXEL_MODE_BGRA,\n\n    FT_PIXEL_MODE_MAX      /* do not remove */\n\n  } FT_Pixel_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_pixel_mode_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Pixel_Mode values instead.                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_pixel_mode_none  :: See @FT_PIXEL_MODE_NONE.                    */\n  /*    ft_pixel_mode_mono  :: See @FT_PIXEL_MODE_MONO.                    */\n  /*    ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY.                    */\n  /*    ft_pixel_mode_pal2  :: See @FT_PIXEL_MODE_GRAY2.                   */\n  /*    ft_pixel_mode_pal4  :: See @FT_PIXEL_MODE_GRAY4.                   */\n  /*                                                                       */\n#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE\n#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO\n#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY\n#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2\n#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4\n\n /* */\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Palette_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT!                           */\n  /*                                                                       */\n  /*    An enumeration type to describe the format of a bitmap palette,    */\n  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_palette_mode_rgb  :: The palette is an array of 3-byte RGB      */\n  /*                            records.                                   */\n  /*                                                                       */\n  /*    ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA     */\n  /*                            records.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by       */\n  /*    FreeType, these types are not handled by the library itself.       */\n  /*                                                                       */\n  typedef enum  FT_Palette_Mode_\n  {\n    ft_palette_mode_rgb = 0,\n    ft_palette_mode_rgba,\n\n    ft_palette_mode_max   /* do not remove */\n\n  } FT_Palette_Mode;\n\n  /* */\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a bitmap or pixmap to the raster.     */\n  /*    Note that we now manage pixmaps of various depths through the      */\n  /*    `pixel_mode' field.                                                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    rows         :: The number of bitmap rows.                         */\n  /*                                                                       */\n  /*    width        :: The number of pixels in bitmap row.                */\n  /*                                                                       */\n  /*    pitch        :: The pitch's absolute value is the number of bytes  */\n  /*                    taken by one bitmap row, including padding.        */\n  /*                    However, the pitch is positive when the bitmap has */\n  /*                    a `down' flow, and negative when it has an `up'    */\n  /*                    flow.  In all cases, the pitch is an offset to add */\n  /*                    to a bitmap pointer in order to go down one row.   */\n  /*                                                                       */\n  /*                    Note that `padding' means the alignment of a       */\n  /*                    bitmap to a byte border, and FreeType functions    */\n  /*                    normally align to the smallest possible integer    */\n  /*                    value.                                             */\n  /*                                                                       */\n  /*                    For the B/W rasterizer, `pitch' is always an even  */\n  /*                    number.                                            */\n  /*                                                                       */\n  /*                    To change the pitch of a bitmap (say, to make it a */\n  /*                    multiple of 4), use @FT_Bitmap_Convert.            */\n  /*                    Alternatively, you might use callback functions to */\n  /*                    directly render to the application's surface; see  */\n  /*                    the file `example2.cpp' in the tutorial for a      */\n  /*                    demonstration.                                     */\n  /*                                                                       */\n  /*    buffer       :: A typeless pointer to the bitmap buffer.  This     */\n  /*                    value should be aligned on 32-bit boundaries in    */\n  /*                    most cases.                                        */\n  /*                                                                       */\n  /*    num_grays    :: This field is only used with                       */\n  /*                    @FT_PIXEL_MODE_GRAY; it gives the number of gray   */\n  /*                    levels used in the bitmap.                         */\n  /*                                                                       */\n  /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */\n  /*                    See @FT_Pixel_Mode for possible values.            */\n  /*                                                                       */\n  /*    palette_mode :: This field is intended for paletted pixel modes;   */\n  /*                    it indicates how the palette is stored.  Not       */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /*    palette      :: A typeless pointer to the bitmap palette; this     */\n  /*                    field is intended for paletted pixel modes.  Not   */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   For now, the only pixel modes supported by FreeType are mono and    */\n  /*   grays.  However, drivers might be added in the future to support    */\n  /*   more `colorful' options.                                            */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_\n  {\n    int             rows;\n    int             width;\n    int             pitch;\n    unsigned char*  buffer;\n    short           num_grays;\n    char            pixel_mode;\n    char            palette_mode;\n    void*           palette;\n\n  } FT_Bitmap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure is used to describe an outline to the scan-line     */\n  /*    converter.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    n_contours :: The number of contours in the outline.               */\n  /*                                                                       */\n  /*    n_points   :: The number of points in the outline.                 */\n  /*                                                                       */\n  /*    points     :: A pointer to an array of `n_points' @FT_Vector       */\n  /*                  elements, giving the outline's point coordinates.    */\n  /*                                                                       */\n  /*    tags       :: A pointer to an array of `n_points' chars, giving    */\n  /*                  each outline point's type.                           */\n  /*                                                                       */\n  /*                  If bit~0 is unset, the point is `off' the curve,     */\n  /*                  i.e., a Bézier control point, while it is `on' if    */\n  /*                  set.                                                 */\n  /*                                                                       */\n  /*                  Bit~1 is meaningful for `off' points only.  If set,  */\n  /*                  it indicates a third-order Bézier arc control point; */\n  /*                  and a second-order control point if unset.           */\n  /*                                                                       */\n  /*                  If bit~2 is set, bits 5-7 contain the drop-out mode  */\n  /*                  (as defined in the OpenType specification; the value */\n  /*                  is the same as the argument to the SCANMODE          */\n  /*                  instruction).                                        */\n  /*                                                                       */\n  /*                  Bits 3 and~4 are reserved for internal purposes.     */\n  /*                                                                       */\n  /*    contours   :: An array of `n_contours' shorts, giving the end      */\n  /*                  point of each contour within the outline.  For       */\n  /*                  example, the first contour is defined by the points  */\n  /*                  `0' to `contours[0]', the second one is defined by   */\n  /*                  the points `contours[0]+1' to `contours[1]', etc.    */\n  /*                                                                       */\n  /*    flags      :: A set of bit flags used to characterize the outline  */\n  /*                  and give hints to the scan-converter and hinter on   */\n  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_FLAGS.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The B/W rasterizer only checks bit~2 in the `tags' array for the   */\n  /*    first point of each contour.  The drop-out mode as given with      */\n  /*    @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and       */\n  /*    @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden.           */\n  /*                                                                       */\n  typedef struct  FT_Outline_\n  {\n    short       n_contours;      /* number of contours in glyph        */\n    short       n_points;        /* number of points in the glyph      */\n\n    FT_Vector*  points;          /* the outline's points               */\n    char*       tags;            /* the points flags                   */\n    short*      contours;        /* the contour end points             */\n\n    int         flags;           /* outline masks                      */\n\n  } FT_Outline;\n\n  /* Following limits must be consistent with */\n  /* FT_Outline.{n_contours,n_points}         */\n#define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX\n#define FT_OUTLINE_POINTS_MAX    SHRT_MAX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants use for the flags in an outline's    */\n  /*    `flags' field.                                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OUTLINE_NONE ::                                                 */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_OUTLINE_OWNER ::                                                */\n  /*      If set, this flag indicates that the outline's field arrays      */\n  /*      (i.e., `points', `flags', and `contours') are `owned' by the     */\n  /*      outline object, and should thus be freed when it is destroyed.   */\n  /*                                                                       */\n  /*    FT_OUTLINE_EVEN_ODD_FILL ::                                        */\n  /*      By default, outlines are filled using the non-zero winding rule. */\n  /*      If set to 1, the outline will be filled using the even-odd fill  */\n  /*      rule (only works with the smooth rasterizer).                    */\n  /*                                                                       */\n  /*    FT_OUTLINE_REVERSE_FILL ::                                         */\n  /*      By default, outside contours of an outline are oriented in       */\n  /*      clock-wise direction, as defined in the TrueType specification.  */\n  /*      This flag is set if the outline uses the opposite direction      */\n  /*      (typically for Type~1 fonts).  This flag is ignored by the scan  */\n  /*      converter.                                                       */\n  /*                                                                       */\n  /*    FT_OUTLINE_IGNORE_DROPOUTS ::                                      */\n  /*      By default, the scan converter will try to detect drop-outs in   */\n  /*      an outline and correct the glyph bitmap to ensure consistent     */\n  /*      shape continuity.  If set, this flag hints the scan-line         */\n  /*      converter to ignore such cases.  See below for more information. */\n  /*                                                                       */\n  /*    FT_OUTLINE_SMART_DROPOUTS ::                                       */\n  /*      Select smart dropout control.  If unset, use simple dropout      */\n  /*      control.  Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See    */\n  /*      below for more information.                                      */\n  /*                                                                       */\n  /*    FT_OUTLINE_INCLUDE_STUBS ::                                        */\n  /*      If set, turn pixels on for `stubs', otherwise exclude them.      */\n  /*      Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See below for    */\n  /*      more information.                                                */\n  /*                                                                       */\n  /*    FT_OUTLINE_HIGH_PRECISION ::                                       */\n  /*      This flag indicates that the scan-line converter should try to   */\n  /*      convert this outline to bitmaps with the highest possible        */\n  /*      quality.  It is typically set for small character sizes.  Note   */\n  /*      that this is only a hint that might be completely ignored by a   */\n  /*      given scan-converter.                                            */\n  /*                                                                       */\n  /*    FT_OUTLINE_SINGLE_PASS ::                                          */\n  /*      This flag is set to force a given scan-converter to only use a   */\n  /*      single pass over the outline to render a bitmap glyph image.     */\n  /*      Normally, it is set for very large character sizes.  It is only  */\n  /*      a hint that might be completely ignored by a given               */\n  /*      scan-converter.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */\n  /*    and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth            */\n  /*    rasterizer.                                                        */\n  /*                                                                       */\n  /*    There exists a second mechanism to pass the drop-out mode to the   */\n  /*    B/W rasterizer; see the `tags' field in @FT_Outline.               */\n  /*                                                                       */\n  /*    Please refer to the description of the `SCANTYPE' instruction in   */\n  /*    the OpenType specification (in file `ttinst1.doc') how simple      */\n  /*    drop-outs, smart drop-outs, and stubs are defined.                 */\n  /*                                                                       */\n#define FT_OUTLINE_NONE             0x0\n#define FT_OUTLINE_OWNER            0x1\n#define FT_OUTLINE_EVEN_ODD_FILL    0x2\n#define FT_OUTLINE_REVERSE_FILL     0x4\n#define FT_OUTLINE_IGNORE_DROPOUTS  0x8\n#define FT_OUTLINE_SMART_DROPOUTS   0x10\n#define FT_OUTLINE_INCLUDE_STUBS    0x20\n\n#define FT_OUTLINE_HIGH_PRECISION   0x100\n#define FT_OUTLINE_SINGLE_PASS      0x200\n\n\n /*************************************************************************\n  *\n  * @enum:\n  *   ft_outline_flags\n  *\n  * @description:\n  *   These constants are deprecated.  Please use the corresponding\n  *   @FT_OUTLINE_FLAGS values.\n  *\n  * @values:\n  *   ft_outline_none            :: See @FT_OUTLINE_NONE.\n  *   ft_outline_owner           :: See @FT_OUTLINE_OWNER.\n  *   ft_outline_even_odd_fill   :: See @FT_OUTLINE_EVEN_ODD_FILL.\n  *   ft_outline_reverse_fill    :: See @FT_OUTLINE_REVERSE_FILL.\n  *   ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.\n  *   ft_outline_high_precision  :: See @FT_OUTLINE_HIGH_PRECISION.\n  *   ft_outline_single_pass     :: See @FT_OUTLINE_SINGLE_PASS.\n  */\n#define ft_outline_none             FT_OUTLINE_NONE\n#define ft_outline_owner            FT_OUTLINE_OWNER\n#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL\n#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL\n#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS\n#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION\n#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS\n\n  /* */\n\n#define FT_CURVE_TAG( flag )  ( flag & 3 )\n\n#define FT_CURVE_TAG_ON            1\n#define FT_CURVE_TAG_CONIC         0\n#define FT_CURVE_TAG_CUBIC         2\n\n#define FT_CURVE_TAG_HAS_SCANMODE  4\n\n#define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */\n#define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */\n\n#define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \\\n                                     FT_CURVE_TAG_TOUCH_Y )\n\n#define FT_Curve_Tag_On       FT_CURVE_TAG_ON\n#define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC\n#define FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC\n#define FT_Curve_Tag_Touch_X  FT_CURVE_TAG_TOUCH_X\n#define FT_Curve_Tag_Touch_Y  FT_CURVE_TAG_TOUCH_Y\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `move  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `move to' is emitted to start a new contour in an outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `move to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_LineToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `line  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `line to' is emitted to indicate a segment in the outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `line to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_LineToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `conic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `conic to' is emitted to indicate a second-order Bézier arc in   */\n  /*    the outline.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: An intermediate control point between the last position */\n  /*               and the new target in `to'.                             */\n  /*                                                                       */\n  /*    to      :: A pointer to the target end point of the conic arc.     */\n  /*                                                                       */\n  /*    user    :: A typeless pointer which is passed from the caller of   */\n  /*               the decomposition function.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `cubic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `cubic to' is emitted to indicate a third-order Bézier arc.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first Bézier control point.           */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second Bézier control point.          */\n  /*                                                                       */\n  /*    to       :: A pointer to the target end point.                     */\n  /*                                                                       */\n  /*    user     :: A typeless pointer which is passed from the caller of  */\n  /*                the decomposition function.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,\n                             const FT_Vector*  control2,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline_Funcs                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold various function pointers used during outline  */\n  /*    decomposition in order to emit segments, conic, and cubic Béziers. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    move_to  :: The `move to' emitter.                                 */\n  /*                                                                       */\n  /*    line_to  :: The segment emitter.                                   */\n  /*                                                                       */\n  /*    conic_to :: The second-order Bézier arc emitter.                   */\n  /*                                                                       */\n  /*    cubic_to :: The third-order Bézier arc emitter.                    */\n  /*                                                                       */\n  /*    shift    :: The shift that is applied to coordinates before they   */\n  /*                are sent to the emitter.                               */\n  /*                                                                       */\n  /*    delta    :: The delta that is applied to coordinates before they   */\n  /*                are sent to the emitter, but after the shift.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The point coordinates sent to the emitters are the transformed     */\n  /*    version of the original coordinates (this is important for high    */\n  /*    accuracy during scan-conversion).  The transformation is simple:   */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      x' = (x << shift) - delta                                        */\n  /*      y' = (x << shift) - delta                                        */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Set the values of `shift' and `delta' to~0 to get the original     */\n  /*    point coordinates.                                                 */\n  /*                                                                       */\n  typedef struct  FT_Outline_Funcs_\n  {\n    FT_Outline_MoveToFunc   move_to;\n    FT_Outline_LineToFunc   line_to;\n    FT_Outline_ConicToFunc  conic_to;\n    FT_Outline_CubicToFunc  cubic_to;\n\n    int                     shift;\n    FT_Pos                  delta;\n\n  } FT_Outline_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags to an unsigned long type.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n#ifndef FT_IMAGE_TAG\n#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \\\n          value = ( ( (unsigned long)_x1 << 24 ) | \\\n                    ( (unsigned long)_x2 << 16 ) | \\\n                    ( (unsigned long)_x3 << 8  ) | \\\n                      (unsigned long)_x4         )\n#endif /* FT_IMAGE_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_Format                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of a given glyph   */\n  /*    image.  Note that this version of FreeType only supports two image */\n  /*    formats, even though future font drivers will be able to register  */\n  /*    their own format.                                                  */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_FORMAT_NONE ::                                            */\n  /*      The value~0 is reserved.                                         */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */\n  /*      The glyph image is a composite of several other images.  This    */\n  /*      format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to   */\n  /*      report compound glyphs (like accented characters).               */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_BITMAP ::                                          */\n  /*      The glyph image is a bitmap, and can be described as an          */\n  /*      @FT_Bitmap.  You generally need to access the `bitmap' field of  */\n  /*      the @FT_GlyphSlotRec structure to read it.                       */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_OUTLINE ::                                         */\n  /*      The glyph image is a vectorial outline made of line segments     */\n  /*      and Bézier arcs; it can be described as an @FT_Outline; you      */\n  /*      generally want to access the `outline' field of the              */\n  /*      @FT_GlyphSlotRec structure to read it.                           */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */\n  /*      The glyph image is a vectorial path with no inside and outside   */\n  /*      contours.  Some Type~1 fonts, like those in the Hershey family,  */\n  /*      contain glyphs in this format.  These are described as           */\n  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */\n  /*      them correctly.                                                  */\n  /*                                                                       */\n  typedef enum  FT_Glyph_Format_\n  {\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),\n\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )\n\n  } FT_Glyph_Format;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_format_xxx                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Glyph_Format values instead.                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_glyph_format_none      :: See @FT_GLYPH_FORMAT_NONE.            */\n  /*    ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE.       */\n  /*    ft_glyph_format_bitmap    :: See @FT_GLYPH_FORMAT_BITMAP.          */\n  /*    ft_glyph_format_outline   :: See @FT_GLYPH_FORMAT_OUTLINE.         */\n  /*    ft_glyph_format_plotter   :: See @FT_GLYPH_FORMAT_PLOTTER.         */\n  /*                                                                       */\n#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE\n#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE\n#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP\n#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE\n#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            R A S T E R   D E F I N I T I O N S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A raster is a scan converter, in charge of rendering an outline into  */\n  /* a a bitmap.  This section contains the public API for rasters.        */\n  /*                                                                       */\n  /* Note that in FreeType 2, all rasters are now encapsulated within      */\n  /* specific modules called `renderers'.  See `freetype/ftrender.h' for   */\n  /* more details on renderers.                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    raster                                                             */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Scanline Converter                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How vectorial outlines are converted into bitmaps and pixmaps.     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains technical definitions.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Raster                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle (pointer) to a raster object.  Each object can be used    */\n  /*    independently to convert an outline into a bitmap or pixmap.       */\n  /*                                                                       */\n  typedef struct FT_RasterRec_*  FT_Raster;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Span                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a single span of gray (or black) pixels  */\n  /*    when rendering a monochrome or anti-aliased bitmap.                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x        :: The span's horizontal start position.                  */\n  /*                                                                       */\n  /*    len      :: The span's length in pixels.                           */\n  /*                                                                       */\n  /*    coverage :: The span color/coverage, ranging from 0 (background)   */\n  /*                to 255 (foreground).  Only used for anti-aliased       */\n  /*                rendering.                                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is used by the span drawing callback type named     */\n  /*    @FT_SpanFunc which takes the y~coordinate of the span as a         */\n  /*    a parameter.                                                       */\n  /*                                                                       */\n  /*    The coverage value is always between 0 and 255.  If you want less  */\n  /*    gray values, the callback function has to reduce them.             */\n  /*                                                                       */\n  typedef struct  FT_Span_\n  {\n    short           x;\n    unsigned short  len;\n    unsigned char   coverage;\n\n  } FT_Span;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used as a call-back by the anti-aliased renderer in     */\n  /*    order to let client applications draw themselves the gray pixel    */\n  /*    spans on each scan line.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The scanline's y~coordinate.                              */\n  /*                                                                       */\n  /*    count :: The number of spans to draw on this scanline.             */\n  /*                                                                       */\n  /*    spans :: A table of `count' spans to draw on the scanline.         */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This callback allows client applications to directly render the    */\n  /*    gray spans of the anti-aliased bitmap to any kind of surfaces.     */\n  /*                                                                       */\n  /*    This can be used to write anti-aliased outlines directly to a      */\n  /*    given background bitmap, and even perform translucency.            */\n  /*                                                                       */\n  /*    Note that the `count' field cannot be greater than a fixed value   */\n  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */\n  /*    `ftoption.h'.  By default, this value is set to~32, which means    */\n  /*    that if there are more than 32~spans on a given scanline, the      */\n  /*    callback is called several times with the same `y' parameter in    */\n  /*    order to draw all callbacks.                                       */\n  /*                                                                       */\n  /*    Otherwise, the callback is only called once per scan-line, and     */\n  /*    only for those scanlines that do have `gray' pixels on them.       */\n  /*                                                                       */\n  typedef void\n  (*FT_SpanFunc)( int             y,\n                  int             count,\n                  const FT_Span*  spans,\n                  void*           user );\n\n#define FT_Raster_Span_Func  FT_SpanFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitTest_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to test whether a given target pixel is already set to the drawing */\n  /*    `color'.  These tests are crucial to implement drop-out control    */\n  /*    per-se the TrueType spec.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   1~if the pixel is `set', 0~otherwise.                               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_BitTest_Func)( int    y,\n                             int    x,\n                             void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitSet_Func                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to set an individual target pixel.  This is crucial to implement   */\n  /*    drop-out control according to the TrueType specification.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if the pixel is `set', 0~otherwise.                              */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_BitSet_Func)( int    y,\n                            int    x,\n                            void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flag constants as used in the `flags' field of a     */\n  /*    @FT_Raster_Params structure.                                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RASTER_FLAG_DEFAULT :: This value is 0.                         */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_AA      :: This flag is set to indicate that an     */\n  /*                              anti-aliased glyph image should be       */\n  /*                              generated.  Otherwise, it will be        */\n  /*                              monochrome (1-bit).                      */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct      */\n  /*                              rendering.  In this mode, client         */\n  /*                              applications must provide their own span */\n  /*                              callback.  This lets them directly       */\n  /*                              draw or compose over an existing bitmap. */\n  /*                              If this bit is not set, the target       */\n  /*                              pixmap's buffer _must_ be zeroed before  */\n  /*                              rendering.                               */\n  /*                                                                       */\n  /*                              Note that for now, direct rendering is   */\n  /*                              only possible with anti-aliased glyphs.  */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */\n  /*                              rendering mode.  If set, the output will */\n  /*                              be clipped to a box specified in the     */\n  /*                              `clip_box' field of the                  */\n  /*                              @FT_Raster_Params structure.             */\n  /*                                                                       */\n  /*                              Note that by default, the glyph bitmap   */\n  /*                              is clipped to the target pixmap, except  */\n  /*                              in direct rendering mode where all spans */\n  /*                              are generated if no clipping box is set. */\n  /*                                                                       */\n#define FT_RASTER_FLAG_DEFAULT  0x0\n#define FT_RASTER_FLAG_AA       0x1\n#define FT_RASTER_FLAG_DIRECT   0x2\n#define FT_RASTER_FLAG_CLIP     0x4\n\n  /* deprecated */\n#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT\n#define ft_raster_flag_aa       FT_RASTER_FLAG_AA\n#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT\n#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Params                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold the arguments used by a raster's render        */\n  /*    function.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    target      :: The target bitmap.                                  */\n  /*                                                                       */\n  /*    source      :: A pointer to the source glyph image (e.g., an       */\n  /*                   @FT_Outline).                                       */\n  /*                                                                       */\n  /*    flags       :: The rendering flags.                                */\n  /*                                                                       */\n  /*    gray_spans  :: The gray span drawing callback.                     */\n  /*                                                                       */\n  /*    black_spans :: The black span drawing callback.  UNIMPLEMENTED!    */\n  /*                                                                       */\n  /*    bit_test    :: The bit test callback.  UNIMPLEMENTED!              */\n  /*                                                                       */\n  /*    bit_set     :: The bit set callback.  UNIMPLEMENTED!               */\n  /*                                                                       */\n  /*    user        :: User-supplied data that is passed to each drawing   */\n  /*                   callback.                                           */\n  /*                                                                       */\n  /*    clip_box    :: An optional clipping box.  It is only used in       */\n  /*                   direct rendering mode.  Note that coordinates here  */\n  /*                   should be expressed in _integer_ pixels (and not in */\n  /*                   26.6 fixed-point units).                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA    */\n  /*    bit flag is set in the `flags' field, otherwise a monochrome       */\n  /*    bitmap is generated.                                               */\n  /*                                                                       */\n  /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */\n  /*    raster will call the `gray_spans' callback to draw gray pixel      */\n  /*    spans, in the case of an aa glyph bitmap, it will call             */\n  /*    `black_spans', and `bit_test' and `bit_set' in the case of a       */\n  /*    monochrome bitmap.  This allows direct composition over a          */\n  /*    pre-existing bitmap through user-provided callbacks to perform the */\n  /*    span drawing/composition.                                          */\n  /*                                                                       */\n  /*    Note that the `bit_test' and `bit_set' callbacks are required when */\n  /*    rendering a monochrome bitmap, as they are crucial to implement    */\n  /*    correct drop-out control as defined in the TrueType specification. */\n  /*                                                                       */\n  typedef struct  FT_Raster_Params_\n  {\n    const FT_Bitmap*        target;\n    const void*             source;\n    int                     flags;\n    FT_SpanFunc             gray_spans;\n    FT_SpanFunc             black_spans;  /* doesn't work! */\n    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */\n    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */\n    void*                   user;\n    FT_BBox                 clip_box;\n\n  } FT_Raster_Params;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_NewFunc                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create a new raster object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory allocator.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `memory' parameter is a typeless pointer in order to avoid     */\n  /*    un-wanted dependencies on the rest of the FreeType code.  In       */\n  /*    practice, it is an @FT_Memory object, i.e., a handle to the        */\n  /*    standard FreeType memory allocator.  However, this field can be    */\n  /*    completely ignored by a given raster implementation.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_NewFunc)( void*       memory,\n                        FT_Raster*  raster );\n\n#define FT_Raster_New_Func  FT_Raster_NewFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy a given raster object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_DoneFunc)( FT_Raster  raster );\n\n#define FT_Raster_Done_Func  FT_Raster_DoneFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_ResetFunc                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType provides an area of memory called the `render pool',      */\n  /*    available to all registered rasters.  This pool can be freely used */\n  /*    during a given scan-conversion but is shared by all rasters.  Its  */\n  /*    content is thus transient.                                         */\n  /*                                                                       */\n  /*    This function is called each time the render pool changes, or just */\n  /*    after a new raster object is created.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster    :: A handle to the new raster object.                    */\n  /*                                                                       */\n  /*    pool_base :: The address in memory of the render pool.             */\n  /*                                                                       */\n  /*    pool_size :: The size in bytes of the render pool.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Rasters can ignore the render pool and rely on dynamic memory      */\n  /*    allocation if they want to (a handle to the memory allocator is    */\n  /*    passed to the raster constructor).  However, this is not           */\n  /*    recommended for efficiency purposes.                               */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_ResetFunc)( FT_Raster       raster,\n                          unsigned char*  pool_base,\n                          unsigned long   pool_size );\n\n#define FT_Raster_Reset_Func  FT_Raster_ResetFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is a generic facility to change modes or attributes  */\n  /*    in a given raster.  This can be used for debugging purposes, or    */\n  /*    simply to allow implementation-specific `features' in a given      */\n  /*    raster module.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /*    mode   :: A 4-byte tag used to name the mode or property.          */\n  /*                                                                       */\n  /*    args   :: A pointer to the new mode/property to use.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_SetModeFunc)( FT_Raster      raster,\n                            unsigned long  mode,\n                            void*          args );\n\n#define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_RenderFunc                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invoke a given raster to scan-convert a given glyph image into a   */\n  /*    target bitmap.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  /*    params :: A pointer to an @FT_Raster_Params structure used to      */\n  /*              store the rendering parameters.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The exact format of the source image depends on the raster's glyph */\n  /*    format defined in its @FT_Raster_Funcs structure.  It can be an    */\n  /*    @FT_Outline or anything else in order to support a large array of  */\n  /*    glyph formats.                                                     */\n  /*                                                                       */\n  /*    Note also that the render function can fail and return a           */\n  /*    `FT_Err_Unimplemented_Feature' error code if the raster used does  */\n  /*    not support direct composition.                                    */\n  /*                                                                       */\n  /*    XXX: For now, the standard raster doesn't support direct           */\n  /*         composition but this should change for the final release (see */\n  /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */\n  /*         for examples of distinct implementations which support direct */\n  /*         composition).                                                 */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_RenderFunc)( FT_Raster                raster,\n                           const FT_Raster_Params*  params );\n\n#define FT_Raster_Render_Func  FT_Raster_RenderFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   A structure used to describe a given raster class to the library.   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_format  :: The supported glyph format for this raster.       */\n  /*                                                                       */\n  /*    raster_new    :: The raster constructor.                           */\n  /*                                                                       */\n  /*    raster_reset  :: Used to reset the render pool within the raster.  */\n  /*                                                                       */\n  /*    raster_render :: A function to render a glyph into a given bitmap. */\n  /*                                                                       */\n  /*    raster_done   :: The raster destructor.                            */\n  /*                                                                       */\n  typedef struct  FT_Raster_Funcs_\n  {\n    FT_Glyph_Format        glyph_format;\n    FT_Raster_NewFunc      raster_new;\n    FT_Raster_ResetFunc    raster_reset;\n    FT_Raster_SetModeFunc  raster_set_mode;\n    FT_Raster_RenderFunc   raster_render;\n    FT_Raster_DoneFunc     raster_done;\n\n  } FT_Raster_Funcs;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTIMAGE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftincrem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftincrem.h                                                             */\n/*                                                                         */\n/*    FreeType incremental loading (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007, 2008, 2010 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTINCREM_H__\n#define __FTINCREM_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *    incremental\n   *\n   * @title:\n   *    Incremental Loading\n   *\n   * @abstract:\n   *    Custom Glyph Loading.\n   *\n   * @description:\n   *   This section contains various functions used to perform so-called\n   *   `incremental' glyph loading.  This is a mode where all glyphs loaded\n   *   from a given @FT_Face are provided by the client application,\n   *\n   *   Apart from that, all other tables are loaded normally from the font\n   *   file.  This mode is useful when FreeType is used within another\n   *   engine, e.g., a PostScript Imaging Processor.\n   *\n   *   To enable this mode, you must use @FT_Open_Face, passing an\n   *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\n   *   @FT_Incremental_Interface value.  See the comments for\n   *   @FT_Incremental_InterfaceRec for an example.\n   *\n   */\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental\n   *\n   * @description:\n   *   An opaque type describing a user-provided object used to implement\n   *   `incremental' glyph loading within FreeType.  This is used to support\n   *   embedded fonts in certain environments (e.g., PostScript interpreters),\n   *   where the glyph data isn't in the font file, or must be overridden by\n   *   different values.\n   *\n   * @note:\n   *   It is up to client applications to create and implement @FT_Incremental\n   *   objects, as long as they provide implementations for the methods\n   *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\n   *   and @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   *   See the description of @FT_Incremental_InterfaceRec to understand how\n   *   to use incremental objects with FreeType.\n   *\n   */\n  typedef struct FT_IncrementalRec_*  FT_Incremental;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_MetricsRec\n   *\n   * @description:\n   *   A small structure used to contain the basic glyph metrics returned\n   *   by the @FT_Incremental_GetGlyphMetricsFunc method.\n   *\n   * @fields:\n   *   bearing_x ::\n   *     Left bearing, in font units.\n   *\n   *   bearing_y ::\n   *     Top bearing, in font units.\n   *\n   *   advance ::\n   *     Horizontal component of glyph advance, in font units.\n   *\n   *   advance_v ::\n   *     Vertical component of glyph advance, in font units.\n   *\n   * @note:\n   *   These correspond to horizontal or vertical metrics depending on the\n   *   value of the `vertical' argument to the function\n   *   @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   */\n  typedef struct  FT_Incremental_MetricsRec_\n  {\n    FT_Long  bearing_x;\n    FT_Long  bearing_y;\n    FT_Long  advance;\n    FT_Long  advance_v;     /* since 2.3.12 */\n\n  } FT_Incremental_MetricsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_Metrics\n   *\n   * @description:\n   *   A handle to an @FT_Incremental_MetricsRec structure.\n   *\n   */\n   typedef struct FT_Incremental_MetricsRec_*  FT_Incremental_Metrics;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphDataFunc\n   *\n   * @description:\n   *   A function called by FreeType to access a given glyph's data bytes\n   *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\n   *   enabled.\n   *\n   *   Note that the format of the glyph's data bytes depends on the font\n   *   file format.  For TrueType, it must correspond to the raw bytes within\n   *   the `glyf' table.  For PostScript formats, it must correspond to the\n   *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\n   *   undefined for any other format.\n   *\n   * @input:\n   *   incremental ::\n   *     Handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   * @output:\n   *   adata ::\n   *     A structure describing the returned glyph data bytes (which will be\n   *     accessed as a read-only byte block).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If this function returns successfully the method\n   *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\n   *   the data bytes.\n   *\n   *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\n   *   compound glyphs.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\n                                      FT_UInt         glyph_index,\n                                      FT_Data*        adata );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_FreeGlyphDataFunc\n   *\n   * @description:\n   *   A function used to release the glyph data bytes returned by a\n   *   successful call to @FT_Incremental_GetGlyphDataFunc.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   data ::\n   *     A structure describing the glyph data bytes (which will be accessed\n   *     as a read-only byte block).\n   *\n   */\n  typedef void\n  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\n                                       FT_Data*        data );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphMetricsFunc\n   *\n   * @description:\n   *   A function used to retrieve the basic metrics of a given glyph index\n   *   before accessing its data.  This is necessary because, in certain\n   *   formats like TrueType, the metrics are stored in a different place from\n   *   the glyph images proper.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   *   vertical ::\n   *     If true, return vertical metrics.\n   *\n   *   ametrics ::\n   *     This parameter is used for both input and output.\n   *     The original glyph metrics, if any, in font units.  If metrics are\n   *     not available all the values must be set to zero.\n   *\n   * @output:\n   *   ametrics ::\n   *     The replacement glyph metrics in font units.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphMetricsFunc)\n                      ( FT_Incremental              incremental,\n                        FT_UInt                     glyph_index,\n                        FT_Bool                     vertical,\n                        FT_Incremental_MetricsRec  *ametrics );\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_FuncsRec\n   *\n   * @description:\n   *   A table of functions for accessing fonts that load data\n   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\n   *\n   * @fields:\n   *   get_glyph_data ::\n   *     The function to get glyph data.  Must not be null.\n   *\n   *   free_glyph_data ::\n   *     The function to release glyph data.  Must not be null.\n   *\n   *   get_glyph_metrics ::\n   *     The function to get glyph metrics.  May be null if the font does\n   *     not provide overriding glyph metrics.\n   *\n   */\n  typedef struct  FT_Incremental_FuncsRec_\n  {\n    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\n    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\n    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\n\n  } FT_Incremental_FuncsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_InterfaceRec\n   *\n   * @description:\n   *   A structure to be used with @FT_Open_Face to indicate that the user\n   *   wants to support incremental glyph loading.  You should use it with\n   *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\n   *\n   *     {\n   *       FT_Incremental_InterfaceRec  inc_int;\n   *       FT_Parameter                 parameter;\n   *       FT_Open_Args                 open_args;\n   *\n   *\n   *       // set up incremental descriptor\n   *       inc_int.funcs  = my_funcs;\n   *       inc_int.object = my_object;\n   *\n   *       // set up optional parameter\n   *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\n   *       parameter.data = &inc_int;\n   *\n   *       // set up FT_Open_Args structure\n   *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\n   *       open_args.pathname   = my_font_pathname;\n   *       open_args.num_params = 1;\n   *       open_args.params     = &parameter; // we use one optional argument\n   *\n   *       // open the font\n   *       error = FT_Open_Face( library, &open_args, index, &face );\n   *       ...\n   *     }\n   *\n   */\n  typedef struct  FT_Incremental_InterfaceRec_\n  {\n    const FT_Incremental_FuncsRec*  funcs;\n    FT_Incremental                  object;\n\n  } FT_Incremental_InterfaceRec;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_Interface\n   *\n   * @description:\n   *   A pointer to an @FT_Incremental_InterfaceRec structure.\n   *\n   */\n  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_INCREMENTAL\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to indicate\n   *   an incremental loading object to be used by FreeType.\n   *\n   */\n#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTINCREM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftlcdfil.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.h                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2006, 2007, 2008, 2010 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_LCD_FILTER_H__\n#define __FT_LCD_FILTER_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *   lcd_filtering\n   *\n   * @title:\n   *   LCD Filtering\n   *\n   * @abstract:\n   *   Reduce color fringes of LCD-optimized bitmaps.\n   *\n   * @description:\n   *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass\n   *   filter which is then applied to LCD-optimized bitmaps generated\n   *   through @FT_Render_Glyph.  This is useful to reduce color fringes\n   *   which would occur with unfiltered rendering.\n   *\n   *   Note that no filter is active by default, and that this function is\n   *   *not* implemented in default builds of the library.  You need to\n   *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file\n   *   in order to activate it.\n   *\n   *   FreeType generates alpha coverage maps, which are linear by nature.\n   *   For instance, the value 0x80 in bitmap representation means that\n   *   (within numerical precision) 0x80/0xff fraction of that pixel is\n   *   covered by the glyph's outline.  The blending function for placing\n   *   text over a background is\n   *\n   *   {\n   *     dst = alpha * src + (1 - alpha) * dst    ,\n   *   }\n   *\n   *   which is known as OVER.  However, when calculating the output of the\n   *   OVER operator, the source colors should first be transformed to a\n   *   linear color space, then alpha blended in that space, and transformed\n   *   back to the output color space.\n   *\n   *   When linear light blending is used, the default FIR5 filtering\n   *   weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as\n   *   they have been designed for black on white rendering while lacking\n   *   gamma correction.  To preserve color neutrality, weights for a FIR5\n   *   filter should be chosen according to two free parameters `a' and `c',\n   *   and the FIR weights should be\n   *\n   *   {\n   *     [a - c, a + c, 2 * a, a + c, a - c]    .\n   *   }\n   *\n   *   This formula generates equal weights for all the color primaries\n   *   across the filter kernel, which makes it colorless.  One suggested\n   *   set of weights is\n   *\n   *   {\n   *     [0x10, 0x50, 0x60, 0x50, 0x10]    ,\n   *   }\n   *\n   *   where `a' has value 0x30 and `b' value 0x20.  The weights in filter\n   *   may have a sum larger than 0x100, which increases coloration slightly\n   *   but also improves contrast.\n   */\n\n\n  /****************************************************************************\n   *\n   * @enum:\n   *   FT_LcdFilter\n   *\n   * @description:\n   *   A list of values to identify various types of LCD filters.\n   *\n   * @values:\n   *   FT_LCD_FILTER_NONE ::\n   *     Do not perform filtering.  When used with subpixel rendering, this\n   *     results in sometimes severe color fringes.\n   *\n   *   FT_LCD_FILTER_DEFAULT ::\n   *     The default filter reduces color fringes considerably, at the cost\n   *     of a slight blurriness in the output.\n   *\n   *   FT_LCD_FILTER_LIGHT ::\n   *     The light filter is a variant that produces less blurriness at the\n   *     cost of slightly more color fringes than the default one.  It might\n   *     be better, depending on taste, your monitor, or your personal vision.\n   *\n   *   FT_LCD_FILTER_LEGACY ::\n   *     This filter corresponds to the original libXft color filter.  It\n   *     provides high contrast output but can exhibit really bad color\n   *     fringes if glyphs are not extremely well hinted to the pixel grid.\n   *     In other words, it only works well if the TrueType bytecode\n   *     interpreter is enabled *and* high-quality hinted fonts are used.\n   *\n   *     This filter is only provided for comparison purposes, and might be\n   *     disabled or stay unsupported in the future.\n   *\n   * @since:\n   *   2.3.0\n   */\n  typedef enum  FT_LcdFilter_\n  {\n    FT_LCD_FILTER_NONE    = 0,\n    FT_LCD_FILTER_DEFAULT = 1,\n    FT_LCD_FILTER_LIGHT   = 2,\n    FT_LCD_FILTER_LEGACY  = 16,\n\n    FT_LCD_FILTER_MAX   /* do not remove */\n\n  } FT_LcdFilter;\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilter\n   *\n   * @description:\n   *   This function is used to apply color filtering to LCD decimated\n   *   bitmaps, like the ones used when calling @FT_Render_Glyph with\n   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   filter ::\n   *     The filter type.\n   *\n   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or\n   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work\n   *     well on most LCD screens.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This feature is always disabled by default.  Clients must make an\n   *   explicit call to this function with a `filter' value other than\n   *   @FT_LCD_FILTER_NONE in order to enable it.\n   *\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,\n   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.\n   *\n   *   It does _not_ affect the output of @FT_Outline_Render and\n   *   @FT_Outline_Get_Bitmap.\n   *\n   *   If this feature is activated, the dimensions of LCD glyph bitmaps are\n   *   either larger or taller than the dimensions of the corresponding\n   *   outline with regards to the pixel grid.  For example, for\n   *   @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and\n   *   up to 3~pixels to the right.\n   *\n   *   The bitmap offset values are adjusted correctly, so clients shouldn't\n   *   need to modify their layout and glyph positioning code when enabling\n   *   the filter.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter );\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilterWeights\n   *\n   * @description:\n   *   Use this function to override the filter weights selected by\n   *   @FT_Library_SetLcdFilter.  By default, FreeType uses the quintuple\n   *   (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,\n   *   0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and\n   *   FT_LCD_FILTER_LEGACY.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   weights ::\n   *     A pointer to an array; the function copies the first five bytes and\n   *     uses them to specify the filter weights.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   This function must be called after @FT_Library_SetLcdFilter to have\n   *   any effect.\n   *\n   * @since:\n   *   2.4.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_LCD_FILTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftlist.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlist.h                                                               */\n/*                                                                         */\n/*    Generic list support for FreeType (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file implements functions relative to list processing.  Its     */\n  /*  data structures are defined in `freetype.h'.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTLIST_H__\n#define __FTLIST_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    List Processing                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Simple management of lists.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various definitions related to list          */\n  /*    processing using doubly-linked nodes.                              */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_List                                                            */\n  /*    FT_ListNode                                                        */\n  /*    FT_ListRec                                                         */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /*    FT_List_Add                                                        */\n  /*    FT_List_Insert                                                     */\n  /*    FT_List_Find                                                       */\n  /*    FT_List_Remove                                                     */\n  /*    FT_List_Up                                                         */\n  /*    FT_List_Iterate                                                    */\n  /*    FT_List_Iterator                                                   */\n  /*    FT_List_Finalize                                                   */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Find                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the list node for a given listed object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    data :: The address of the listed object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    List node.  NULL if it wasn't found.                               */\n  /*                                                                       */\n  FT_EXPORT( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Add                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Append an element to the end of a list.                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to append.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Insert                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Insert an element at the head of a list.                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to parent list.                                  */\n  /*    node :: The node to insert.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Remove                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a node from a list.  This function doesn't check whether    */\n  /*    the node is in the list!                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The node to remove.                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Up                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Move a node to the head/top of a list.  Used to maintain LRU       */\n  /*    lists.                                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to move.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Iterator                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An FT_List iterator function which is called during a list parse   */\n  /*    by @FT_List_Iterate.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The current iteration list node.                           */\n  /*                                                                       */\n  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */\n  /*            Can be used to point to the iteration's state.             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_List_Iterator)( FT_ListNode  node,\n                       void*        user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Iterate                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse a list and calls a given iterator function on each element.  */\n  /*    Note that parsing is stopped as soon as one of the iterator calls  */\n  /*    returns a non-zero value.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list     :: A handle to the list.                                  */\n  /*    iterator :: An iterator function, called on each node of the list. */\n  /*    user     :: A user-supplied field which is passed as the second    */\n  /*                argument to the iterator.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result (a FreeType error code) of the last iterator call.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An @FT_List iterator function which is called during a list        */\n  /*    finalization by @FT_List_Finalize to destroy all elements in a     */\n  /*    given list.                                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    system :: The current system object.                               */\n  /*                                                                       */\n  /*    data   :: The current object to destroy.                           */\n  /*                                                                       */\n  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */\n  /*              be used to point to the iteration's state.               */\n  /*                                                                       */\n  typedef void\n  (*FT_List_Destructor)( FT_Memory  memory,\n                         void*      data,\n                         void*      user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Finalize                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy all elements in the list as well as the list itself.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list    :: A handle to the list.                                   */\n  /*                                                                       */\n  /*    destroy :: A list destructor that will be applied to each element  */\n  /*               of the list.                                            */\n  /*                                                                       */\n  /*    memory  :: The current memory object which handles deallocation.   */\n  /*                                                                       */\n  /*    user    :: A user-supplied field which is passed as the last       */\n  /*               argument to the destructor.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function expects that all nodes added by @FT_List_Add or      */\n  /*    @FT_List_Insert have been dynamically allocated.                   */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLIST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftlzw.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.h                                                                */\n/*                                                                         */\n/*    LZW-compressed stream support.                                       */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTLZW_H__\n#define __FTLZW_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    lzw                                                                */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    LZW Streams                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using LZW-compressed font files.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of LZW-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenLZW\n  *\n  * @description:\n  *   Open a new stream to parse LZW-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.Z' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream :: The target embedding stream.\n  *\n  *   source :: The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream\n  *\n  *   In certain builds of the library, LZW compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a LZW stream from it\n  *   and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with LZW support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLZW_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftmac.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.h                                                                */\n/*                                                                         */\n/*    Additional Mac-specific API.                                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2007 by                               */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* NOTE: Include this file after <freetype/freetype.h> and after any       */\n/*       Mac-specific headers (because this header uses Mac types such as  */\n/*       Handle, FSSpec, FSRef, etc.)                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMAC_H__\n#define __FTMAC_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n/* gcc-3.4.1 and later can warn about functions tagged as deprecated */\n#ifndef FT_DEPRECATED_ATTRIBUTE\n#if defined(__GNUC__)                                               && \\\n    ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define FT_DEPRECATED_ATTRIBUTE  __attribute__((deprecated))\n#else\n#define FT_DEPRECATED_ATTRIBUTE\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    mac_specific                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Mac Specific Interface                                             */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Only available on the Macintosh.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following definitions are only available if FreeType is        */\n  /*    compiled on a Macintosh.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FOND                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a FOND resource.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fond       :: A FOND resource.                                     */\n  /*                                                                       */\n  /*    face_index :: Only supported for the -1 `sanity check' special     */\n  /*                  case.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Notes>                                                               */\n  /*    This function can be used to create @FT_Face objects from fonts    */\n  /*    that are installed in the system as follows.                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      fond = GetResource( 'FOND', fontName );                          */\n  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face    *aface )\n                       FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_Name                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */\n  /*                  Bold).                                               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file.  For passing to                  */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face.  For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n                          FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_ATS_Name                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font in ATS framework.            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file. For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face. For passing to                    */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n                              FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFilePath_From_Mac_ATS_Name                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pathname of the disk file and face index for given font   */\n  /*    name which is handled by ATS framework.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName    :: Mac OS name of the font in ATS framework.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    path        :: Buffer to store pathname of the file.  For passing  */\n  /*                   to @FT_New_Face.  The client must allocate this     */\n  /*                   buffer before calling this function.                */\n  /*                                                                       */\n  /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */\n  /*                                                                       */\n  /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index )\n                                  FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSSpec to the font file.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSSpec to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */\n  /*    it accepts an FSSpec instead of a path.                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec  *spec,\n                           FT_Long        face_index,\n                           FT_Face       *aface )\n                         FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSRef to the font file.                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSRef to the font file.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */\n  /*    it accepts an FSRef instead of a path.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef  *ref,\n                          FT_Long       face_index,\n                          FT_Face      *aface )\n                        FT_DEPRECATED_ATTRIBUTE;\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTMAC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.h                                                                 */\n/*                                                                         */\n/*    FreeType Multiple Master font interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMM_H__\n#define __FTMM_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    multiple_masters                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Multiple Masters                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to manage Multiple Masters fonts.                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following types and functions are used to manage Multiple      */\n  /*    Master fonts, i.e., the selection of specific design instances by  */\n  /*    setting design axis coordinates.                                   */\n  /*                                                                       */\n  /*    George Williams has extended this interface to make it work with   */\n  /*    both Type~1 Multiple Masters fonts and GX distortable (var)        */\n  /*    fonts.  Some of these routines only work with MM fonts, others     */\n  /*    will work with both types.  They are similar enough that a         */\n  /*    consistent interface makes sense.                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Axis                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  typedef struct  FT_MM_Axis_\n  {\n    FT_String*  name;\n    FT_Long     minimum;\n    FT_Long     maximum;\n\n  } FT_MM_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Multi_Master                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis    :: Number of axes.  Cannot exceed~4.                   */\n  /*                                                                       */\n  /*    num_designs :: Number of designs; should be normally 2^num_axis    */\n  /*                   even though the Type~1 specification strangely      */\n  /*                   allows for intermediate designs to be present. This */\n  /*                   number cannot exceed~16.                            */\n  /*                                                                       */\n  /*    axis        :: A table of axis descriptors.                        */\n  /*                                                                       */\n  typedef struct  FT_Multi_Master_\n  {\n    FT_UInt     num_axis;\n    FT_UInt     num_designs;\n    FT_MM_Axis  axis[T1_MAX_MM_AXIS];\n\n  } FT_Multi_Master;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Axis                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters and GX var fonts.                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*               Not always meaningful for GX.                           */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    def     :: The axis's default design coordinate.                   */\n  /*               FreeType computes meaningful default values for MM; it  */\n  /*               is then an integer value, not in 16.16 format.          */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  /*    tag     :: The axis's tag (the GX equivalent to `name').           */\n  /*               FreeType provides default values for MM if possible.    */\n  /*                                                                       */\n  /*    strid   :: The entry in `name' table (another GX version of        */\n  /*               `name').                                                */\n  /*               Not meaningful for MM.                                  */\n  /*                                                                       */\n  typedef struct  FT_Var_Axis_\n  {\n    FT_String*  name;\n\n    FT_Fixed    minimum;\n    FT_Fixed    def;\n    FT_Fixed    maximum;\n\n    FT_ULong    tag;\n    FT_UInt     strid;\n\n  } FT_Var_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Named_Style                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a named style in a GX var font.   */\n  /*                                                                       */\n  /*    This structure can't be used for MM fonts.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    coords :: The design coordinates for this style.                   */\n  /*              This is an array with one entry for each axis.           */\n  /*                                                                       */\n  /*    strid  :: The entry in `name' table identifying this style.        */\n  /*                                                                       */\n  typedef struct  FT_Var_Named_Style_\n  {\n    FT_Fixed*  coords;\n    FT_UInt    strid;\n\n  } FT_Var_Named_Style;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Var                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    or GX var distortable font.                                        */\n  /*                                                                       */\n  /*    Some fields are specific to one format and not to the other.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis        :: The number of axes.  The maximum value is~4 for */\n  /*                       MM; no limit in GX.                             */\n  /*                                                                       */\n  /*    num_designs     :: The number of designs; should be normally       */\n  /*                       2^num_axis for MM fonts.  Not meaningful for GX */\n  /*                       (where every glyph could have a different       */\n  /*                       number of designs).                             */\n  /*                                                                       */\n  /*    num_namedstyles :: The number of named styles; only meaningful for */\n  /*                       GX which allows certain design coordinates to   */\n  /*                       have a string ID (in the `name' table)          */\n  /*                       associated with them.  The font can tell the    */\n  /*                       user that, for example, Weight=1.5 is `Bold'.   */\n  /*                                                                       */\n  /*    axis            :: A table of axis descriptors.                    */\n  /*                       GX fonts contain slightly more data than MM.    */\n  /*                                                                       */\n  /*    namedstyles     :: A table of named styles.                        */\n  /*                       Only meaningful with GX.                        */\n  /*                                                                       */\n  typedef struct  FT_MM_Var_\n  {\n    FT_UInt              num_axis;\n    FT_UInt              num_designs;\n    FT_UInt              num_namedstyles;\n    FT_Var_Axis*         axis;\n    FT_Var_Named_Style*  namedstyle;\n\n  } FT_MM_Var;\n\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Multi_Master                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master descriptor of a given font.           */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master/GX var descriptor of a given font.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters/GX var descriptor.                 */\n  /*               Allocates a data structure, which the user must free    */\n  /*               (a single call to FT_FREE will do it).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Design_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters fonts, choose an interpolated font design     */\n  /*    through design coordinates.                                        */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Design_Coordinates                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */\n  /*    design through design coordinates.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Blend_Coordinates                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters and GX var fonts, choose an interpolated font */\n  /*    design through normalized blend coordinates.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: The design coordinates array (each element must be   */\n  /*                  between 0 and 1.0).                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Blend_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftmodapi.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmodapi.h                                                             */\n/*                                                                         */\n/*    FreeType modules public interface (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMODAPI_H__\n#define __FTMODAPI_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Module Management                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to add, upgrade, remove, and control modules from FreeType.    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The definitions below are used to manage modules within FreeType.  */\n  /*    Modules can be added, upgraded, and removed at runtime.            */\n  /*    Additionally, some module properties can be controlled also.       */\n  /*                                                                       */\n  /*    Here is a list of possible values of the `module_name' field in    */\n  /*    the @FT_Module_Class structure.                                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      autofitter                                                       */\n  /*      bdf                                                              */\n  /*      cff                                                              */\n  /*      gxvalid                                                          */\n  /*      otvalid                                                          */\n  /*      pcf                                                              */\n  /*      pfr                                                              */\n  /*      psaux                                                            */\n  /*      pshinter                                                         */\n  /*      psnames                                                          */\n  /*      raster1, raster5                                                 */\n  /*      sfnt                                                             */\n  /*      smooth, smooth-lcd, smooth-lcdv                                  */\n  /*      truetype                                                         */\n  /*      type1                                                            */\n  /*      type42                                                           */\n  /*      t1cid                                                            */\n  /*      winfonts                                                         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that the FreeType Cache sub-system is not a FreeType module.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* module bit flags */\n#define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */\n#define FT_MODULE_RENDERER            2  /* this module is a renderer     */\n#define FT_MODULE_HINTER              4  /* this module is a glyph hinter */\n#define FT_MODULE_STYLER              8  /* this module is a styler       */\n\n#define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */\n                                              /* scalable fonts           */\n#define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */\n                                              /* support vector outlines  */\n#define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */\n                                              /* own hinter               */\n\n\n  /* deprecated values */\n#define ft_module_font_driver         FT_MODULE_FONT_DRIVER\n#define ft_module_renderer            FT_MODULE_RENDERER\n#define ft_module_hinter              FT_MODULE_HINTER\n#define ft_module_styler              FT_MODULE_STYLER\n\n#define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE\n#define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES\n#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER\n\n\n  typedef FT_Pointer  FT_Module_Interface;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Constructor                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to initialize (not create) a new module object.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to initialize.                                */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Constructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destructor                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to finalize (not destroy) a given module object.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to finalize.                                  */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Requester                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to query a given module for a specific interface.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to be searched.                               */\n  /*                                                                       */\n  /*    name ::   The name of the interface in the module.                 */\n  /*                                                                       */\n  typedef FT_Module_Interface\n  (*FT_Module_Requester)( FT_Module    module,\n                          const char*  name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The module class descriptor.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    module_flags    :: Bit flags describing the module.                */\n  /*                                                                       */\n  /*    module_size     :: The size of one module object/instance in       */\n  /*                       bytes.                                          */\n  /*                                                                       */\n  /*    module_name     :: The name of the module.                         */\n  /*                                                                       */\n  /*    module_version  :: The version, as a 16.16 fixed number            */\n  /*                       (major.minor).                                  */\n  /*                                                                       */\n  /*    module_requires :: The version of FreeType this module requires,   */\n  /*                       as a 16.16 fixed number (major.minor).  Starts  */\n  /*                       at version 2.0, i.e., 0x20000.                  */\n  /*                                                                       */\n  /*    module_init     :: The initializing function.                      */\n  /*                                                                       */\n  /*    module_done     :: The finalizing function.                        */\n  /*                                                                       */\n  /*    get_interface   :: The interface requesting function.              */\n  /*                                                                       */\n  typedef struct  FT_Module_Class_\n  {\n    FT_ULong               module_flags;\n    FT_Long                module_size;\n    const FT_String*       module_name;\n    FT_Fixed               module_version;\n    FT_Fixed               module_requires;\n\n    const void*            module_interface;\n\n    FT_Module_Constructor  module_init;\n    FT_Module_Destructor   module_done;\n    FT_Module_Requester    get_interface;\n\n  } FT_Module_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add a new module to a given library instance.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    clazz   :: A pointer to class descriptor for the module.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find a module by its name.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module handle.  0~if none was found.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    FreeType's internal modules aren't documented very well, and you   */\n  /*    should look up the source code for details.                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Remove_Module                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a given module from a library instance.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module  :: A handle to a module object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The module object is destroyed by the function in case of success. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Set\n   *\n   * @description:\n   *    Set a property for a given module.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   *       Note that only a few modules have properties.\n   *\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the new\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example sets property `bar' (a simple integer) in\n   *    module `foo' to value~1.\n   *\n   *    {\n   *      FT_UInt  bar;\n   *\n   *\n   *      bar = 1;\n   *      FT_Property_Set( library, \"foo\", \"bar\", &bar );\n   *    }\n   *\n   *    Note that the FreeType Cache sub-system doesn't recognize module\n   *    property changes.  To avoid glyph lookup confusion within the cache\n   *    you should call @FTC_Manager_Reset to completely flush the cache if\n   *    a module property gets changed after @FTC_Manager_New has been\n   *    called.\n   *\n   *    It is not possible to set properties of the FreeType Cache\n   *    sub-system itself with FT_Property_Set; use @FTC_Property_Set\n   *    instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Set( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   const void*       value );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Get\n   *\n   * @description:\n   *    Get a module's property value.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   * @inout:\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example gets property `baz' (a range) in module `foo'.\n   *\n   *    {\n   *      typedef  range_\n   *      {\n   *        FT_Int32  min;\n   *        FT_Int32  max;\n   *\n   *      } range;\n   *\n   *      range  baz;\n   *\n   *\n   *      FT_Property_Get( library, \"foo\", \"baz\", &baz );\n   *    }\n   *\n   *    It is not possible to retrieve properties of the FreeType Cache\n   *    sub-system with FT_Property_Get; use @FTC_Property_Get instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Get( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   void*             value );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Library                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Library         */\n  /*    structure is created.  This function increments the counter.       */\n  /*    @FT_Done_Library then only destroys a library if the counter is~1, */\n  /*    otherwise it simply decrements the counter.                        */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Library objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a target library object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Library( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Library                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to create a new FreeType library instance    */\n  /*    from a given memory object.  It is thus possible to use libraries  */\n  /*    with distinct memory allocators within the same program.           */\n  /*                                                                       */\n  /*    Normally, you would call this function (followed by a call to      */\n  /*    @FT_Add_Default_Modules or a series of calls to @FT_Add_Module)    */\n  /*    instead of @FT_Init_FreeType to initialize the FreeType library.   */\n  /*                                                                       */\n  /*    Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a      */\n  /*    library instance.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A handle to the original memory object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A pointer to handle of a new library object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Library                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given library object.  This closes all drivers and       */\n  /*    discards all resource objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Library( FT_Library  library );\n\n/* */\n\n  typedef void\n  (*FT_DebugHook_Func)( void*  arg );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set a debug hook function for debugging the interpreter of a font  */\n  /*    format.                                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hook_index :: The index of the debug hook.  You should use the     */\n  /*                  values defined in `ftobjs.h', e.g.,                  */\n  /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */\n  /*                                                                       */\n  /*    debug_hook :: The function used to debug the interpreter.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, four debug hook slots are available, but only two (for  */\n  /*    the TrueType and the Type~1 interpreter) are defined.              */\n  /*                                                                       */\n  /*    Since the internal headers of FreeType are no longer installed,    */\n  /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */\n  /*    This is a bug and will be fixed in a forthcoming release.          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add the set of default drivers to a given library object.          */\n  /*    This is only useful when you create a library object with          */\n  /*    @FT_New_Library (usually to plug a custom memory manager).         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a new library object.                       */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Add_Default_Modules( FT_Library  library );\n\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   truetype_engine\n   *\n   * @title:\n   *   The TrueType Engine\n   *\n   * @abstract:\n   *   TrueType bytecode support.\n   *\n   * @description:\n   *   This section contains a function used to query the level of TrueType\n   *   bytecode support compiled in this version of the library.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   *  @enum:\n   *     FT_TrueTypeEngineType\n   *\n   *  @description:\n   *     A list of values describing which kind of TrueType bytecode\n   *     engine is implemented in a given FT_Library instance.  It is used\n   *     by the @FT_Get_TrueType_Engine_Type function.\n   *\n   *  @values:\n   *     FT_TRUETYPE_ENGINE_TYPE_NONE ::\n   *       The library doesn't implement any kind of bytecode interpreter.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::\n   *       The library implements a bytecode interpreter that doesn't\n   *       support the patented operations of the TrueType virtual machine.\n   *\n   *       Its main use is to load certain Asian fonts which position and\n   *       scale glyph components with bytecode instructions.  It produces\n   *       bad output for most other fonts.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_PATENTED ::\n   *       The library implements a bytecode interpreter that covers\n   *       the full instruction set of the TrueType virtual machine (this\n   *       was governed by patents until May 2010, hence the name).\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  typedef enum  FT_TrueTypeEngineType_\n  {\n    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n\n  } FT_TrueTypeEngineType;\n\n\n  /**************************************************************************\n   *\n   *  @func:\n   *     FT_Get_TrueType_Engine_Type\n   *\n   *  @description:\n   *     Return an @FT_TrueTypeEngineType value to indicate which level of\n   *     the TrueType virtual machine a given library instance supports.\n   *\n   *  @input:\n   *     library ::\n   *       A library instance.\n   *\n   *  @return:\n   *     A value indicating which level is supported.\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  FT_EXPORT( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMODAPI_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftmoderr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmoderr.h                                                             */\n/*                                                                         */\n/*    FreeType module error offsets (specification).                       */\n/*                                                                         */\n/*  Copyright 2001-2005, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the FreeType module error codes.          */\n  /*                                                                       */\n  /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is    */\n  /* set, the lower byte of an error value identifies the error code as    */\n  /* usual.  In addition, the higher byte identifies the module.  For      */\n  /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */\n  /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error        */\n  /* `T1_Err_Invalid_File_Format' has value 0x1403, etc.                   */\n  /*                                                                       */\n  /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero,    */\n  /* including the high byte.                                              */\n  /*                                                                       */\n  /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of   */\n  /* an error value is set to zero.                                        */\n  /*                                                                       */\n  /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */\n  /* provides some macros in `fttypes.h'.                                  */\n  /*                                                                       */\n  /*   FT_ERR( err )                                                       */\n  /*     Add current error module prefix (as defined with the              */\n  /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */\n  /*     the line                                                          */\n  /*                                                                       */\n  /*       error = FT_ERR( Invalid_Outline );                              */\n  /*                                                                       */\n  /*     expands to                                                        */\n  /*                                                                       */\n  /*       error = BDF_Err_Invalid_Outline;                                */\n  /*                                                                       */\n  /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */\n  /*     of `FT_ERR( Ok )'.                                                */\n  /*                                                                       */\n  /*   FT_ERR_EQ( errcode, err )                                           */\n  /*   FT_ERR_NEQ( errcode, err )                                          */\n  /*     Compare error code `errcode' with the error `err' for equality    */\n  /*     and inequality, respectively.  Example:                           */\n  /*                                                                       */\n  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*     Using this macro you don't have to think about error prefixes.    */\n  /*     Of course, if module errors are not active, the above example is  */\n  /*     the same as                                                       */\n  /*                                                                       */\n  /*       if ( error == FT_Err_Invalid_Outline )                          */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*   FT_ERROR_BASE( errcode )                                            */\n  /*   FT_ERROR_MODULE( errcode )                                          */\n  /*     Get base error and module error code, respectively.               */\n  /*                                                                       */\n  /*                                                                       */\n  /* It can also be used to create a module error message table easily     */\n  /* with something like                                                   */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     #undef __FTMODERR_H__                                             */\n  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */\n  /*     #define FT_MODERR_START_LIST     {                                */\n  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */\n  /*                                                                       */\n  /*     const struct                                                      */\n  /*     {                                                                 */\n  /*       int          mod_err_offset;                                    */\n  /*       const char*  mod_err_msg                                        */\n  /*     } ft_mod_errors[] =                                               */\n  /*                                                                       */\n  /*     #include FT_MODULE_ERRORS_H                                       */\n  /*   }                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTMODERR_H__\n#define __FTMODERR_H__\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#ifndef FT_MODERRDEF\n\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,\n#else\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,\n#endif\n\n#define FT_MODERR_START_LIST  enum {\n#define FT_MODERR_END_LIST    FT_Mod_Err_Max };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_MODERRDEF */\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****               LIST MODULE ERROR BASES                   *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_MODERR_START_LIST\n  FT_MODERR_START_LIST\n#endif\n\n\n  FT_MODERRDEF( Base,      0x000, \"base module\" )\n  FT_MODERRDEF( Autofit,   0x100, \"autofitter module\" )\n  FT_MODERRDEF( BDF,       0x200, \"BDF module\" )\n  FT_MODERRDEF( Bzip2,     0x300, \"Bzip2 module\" )\n  FT_MODERRDEF( Cache,     0x400, \"cache module\" )\n  FT_MODERRDEF( CFF,       0x500, \"CFF module\" )\n  FT_MODERRDEF( CID,       0x600, \"CID module\" )\n  FT_MODERRDEF( Gzip,      0x700, \"Gzip module\" )\n  FT_MODERRDEF( LZW,       0x800, \"LZW module\" )\n  FT_MODERRDEF( OTvalid,   0x900, \"OpenType validation module\" )\n  FT_MODERRDEF( PCF,       0xA00, \"PCF module\" )\n  FT_MODERRDEF( PFR,       0xB00, \"PFR module\" )\n  FT_MODERRDEF( PSaux,     0xC00, \"PS auxiliary module\" )\n  FT_MODERRDEF( PShinter,  0xD00, \"PS hinter module\" )\n  FT_MODERRDEF( PSnames,   0xE00, \"PS names module\" )\n  FT_MODERRDEF( Raster,    0xF00, \"raster module\" )\n  FT_MODERRDEF( SFNT,     0x1000, \"SFNT module\" )\n  FT_MODERRDEF( Smooth,   0x1100, \"smooth raster module\" )\n  FT_MODERRDEF( TrueType, 0x1200, \"TrueType module\" )\n  FT_MODERRDEF( Type1,    0x1300, \"Type 1 module\" )\n  FT_MODERRDEF( Type42,   0x1400, \"Type 42 module\" )\n  FT_MODERRDEF( Winfonts, 0x1500, \"Windows FON/FNT module\" )\n  FT_MODERRDEF( GXvalid,  0x1600, \"GX validation module\" )\n\n\n#ifdef FT_MODERR_END_LIST\n  FT_MODERR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      CLEANUP                            *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_MODERR_START_LIST\n#undef FT_MODERR_END_LIST\n#undef FT_MODERRDEF\n#undef FT_NEED_EXTERN_C\n\n\n#endif /* __FTMODERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (specification).         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/*                                                                         */\n/* Warning: This module might be moved to a different library in the       */\n/*          future to avoid a tight dependency between FreeType and the    */\n/*          OpenType specification.                                        */\n/*                                                                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOTVAL_H__\n#define __FTOTVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    ot_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    OpenType Validation                                                */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate OpenType tables.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_OTXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_OpenType_Validate to\n  *    indicate which OpenType tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_BASE ::\n  *      Validate BASE table.\n  *\n  *    FT_VALIDATE_GDEF ::\n  *      Validate GDEF table.\n  *\n  *    FT_VALIDATE_GPOS ::\n  *      Validate GPOS table.\n  *\n  *    FT_VALIDATE_GSUB ::\n  *      Validate GSUB table.\n  *\n  *    FT_VALIDATE_JSTF ::\n  *      Validate JSTF table.\n  *\n  *    FT_VALIDATE_MATH ::\n  *      Validate MATH table.\n  *\n  *    FT_VALIDATE_OT ::\n  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).\n  *\n  */\n#define FT_VALIDATE_BASE  0x0100\n#define FT_VALIDATE_GDEF  0x0200\n#define FT_VALIDATE_GPOS  0x0400\n#define FT_VALIDATE_GSUB  0x0800\n#define FT_VALIDATE_JSTF  0x1000\n#define FT_VALIDATE_MATH  0x2000\n\n#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\\n                        FT_VALIDATE_GDEF | \\\n                        FT_VALIDATE_GPOS | \\\n                        FT_VALIDATE_GSUB | \\\n                        FT_VALIDATE_JSTF | \\\n                        FT_VALIDATE_MATH\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Validate\n  *\n  * @description:\n  *    Validate various OpenType tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_OTXXX for possible values.\n  *\n  * @output:\n  *    BASE_table ::\n  *       A pointer to the BASE table.\n  *\n  *    GDEF_table ::\n  *       A pointer to the GDEF table.\n  *\n  *    GPOS_table ::\n  *       A pointer to the GPOS table.\n  *\n  *    GSUB_table ::\n  *       A pointer to the GSUB table.\n  *\n  *    JSTF_table ::\n  *       A pointer to the JSTF table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with OpenType fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the five tables with\n  *   @FT_OpenType_Free.  A NULL value indicates that the table either\n  *   doesn't exist in the font, or the application hasn't asked for\n  *   validation.\n  */\n  FT_EXPORT( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table );\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Free\n  *\n  * @description:\n  *    Free the buffer allocated by OpenType validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_OpenType_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_OpenType_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftoutln.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.h                                                              */\n/*                                                                         */\n/*    Support for the FT_Outline type used to store glyph shapes of        */\n/*    most scalable font formats (specification).                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOUTLN_H__\n#define __FTOUTLN_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Outline Processing                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions to create, transform, and render vectorial glyph images. */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains routines used to create and destroy scalable */\n  /*    glyph images known as `outlines'.  These can also be measured,     */\n  /*    transformed, and converted into bitmaps and pixmaps.               */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Outline                                                         */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*    FT_Outline_New                                                     */\n  /*    FT_Outline_Done                                                    */\n  /*    FT_Outline_Copy                                                    */\n  /*    FT_Outline_Translate                                               */\n  /*    FT_Outline_Transform                                               */\n  /*    FT_Outline_Embolden                                                */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*    FT_Outline_Reverse                                                 */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /*    FT_Outline_Get_CBox                                                */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /*    FT_Outline_Decompose                                               */\n  /*    FT_Outline_Funcs                                                   */\n  /*    FT_Outline_MoveTo_Func                                             */\n  /*    FT_Outline_LineTo_Func                                             */\n  /*    FT_Outline_ConicTo_Func                                            */\n  /*    FT_Outline_CubicTo_Func                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walk over an outline's structure to decompose it into individual   */\n  /*    segments and Bézier arcs.  This function also emits `move to'      */\n  /*    operations to indicate the start of new contours in the outline.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e., function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer which is passed to each       */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_New                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new outline of a given size.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object from where the       */\n  /*                   outline is allocated.  Note however that the new    */\n  /*                   outline will *not* necessarily be *freed*, when     */\n  /*                   destroying the library, by @FT_Done_FreeType.       */\n  /*                                                                       */\n  /*    numPoints   :: The maximum number of points within the outline.    */\n  /*                   Must be smaller than or equal to 0xFFFF (65535).    */\n  /*                                                                       */\n  /*    numContours :: The maximum number of contours within the outline.  */\n  /*                   This value must be in the range 0 to `numPoints'.   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    anoutline   :: A handle to the new outline.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' parameter is simply */\n  /*    to use the library's memory allocator.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy an outline created with @FT_Outline_New.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle of the library object used to allocate the     */\n  /*               outline.                                                */\n  /*                                                                       */\n  /*    outline :: A pointer to the outline object to be discarded.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the outline's `owner' field is not set, only the outline        */\n  /*    descriptor will be released.                                       */\n  /*                                                                       */\n  /*    The reason why this function takes an `library' parameter is       */\n  /*    simply to use ft_mem_free().                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check the contents of an outline descriptor.                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A handle to a source outline.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_CBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an outline's `control box'.  The control box encloses all   */\n  /*    the outline's points, including Bézier control points.  Though it  */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox   :: The outline's control box.                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Translate                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple translation to the points of an outline.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    xOffset :: The horizontal offset.                                  */\n  /*                                                                       */\n  /*    yOffset :: The vertical offset.                                    */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Copy                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy an outline into another one.  Both objects must have the      */\n  /*    same sizes (number of points & number of contours) when this       */\n  /*    function is called.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source outline.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target outline.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Transform                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple 2x2 matrix to all of an outline's points.  Useful   */\n  /*    for applying rotations, slanting, flipping, etc.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix  :: A pointer to the transformation matrix.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can use @FT_Outline_Translate if you need to translate the     */\n  /*    outline's points.                                                  */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Embolden                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be at most 4~times      */\n  /*    `strength' pixels wider and higher.  You may think of the left and */\n  /*    bottom borders as unchanged.                                       */\n  /*                                                                       */\n  /*    Negative `strength' values to reduce the outline thickness are     */\n  /*    possible also.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline  :: A handle to the target outline.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strength :: How strong the glyph is emboldened.  Expressed in      */\n  /*                26.6 pixel format.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The used algorithm to increase or decrease the thickness of the    */\n  /*    glyph doesn't change the number of points; this means that certain */\n  /*    situations like acute angles or intersections are sometimes        */\n  /*    handled incorrectly.                                               */\n  /*                                                                       */\n  /*    If you need `better' metrics values you should call                */\n  /*    @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.                      */\n  /*                                                                       */\n  /*    Example call:                                                      */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */\n  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */\n  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be `xstrength' pixels   */\n  /*    wider and `ystrength' pixels higher.  Otherwise, it is similar to  */\n  /*    @FT_Outline_Embolden, which uses the same strength in both         */\n  /*    directions.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_EmboldenXY( FT_Outline*  outline,\n                         FT_Pos       xstrength,\n                         FT_Pos       ystrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Reverse                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reverse the drawing direction of an outline.  This is used to      */\n  /*    ensure consistent fill conventions for mirrored glyphs.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in     */\n  /*    the outline's `flags' field.                                       */\n  /*                                                                       */\n  /*    It shouldn't be used by a normal client application, unless it     */\n  /*    knows what it is doing.                                            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Reverse( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap.  The outline's image is simply  */\n  /*    OR-ed to the target bitmap.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the target bitmap descriptor.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT CREATE the bitmap, it only renders an       */\n  /*    outline image within the one you pass to it!  Consequently, the    */\n  /*    various fields in `abitmap' should be set accordingly.             */\n  /*                                                                       */\n  /*    It will use the raster corresponding to the default glyph format.  */\n  /*                                                                       */\n  /*    The value of the `num_grays' field in `abitmap' is ignored.  If    */\n  /*    you select the gray-level rasterizer, and you want less than 256   */\n  /*    gray levels, you have to use @FT_Outline_Render directly.          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap using the current scan-convert.  */\n  /*    This function uses an @FT_Raster_Params structure as an argument,  */\n  /*    allowing advanced features like direct composition, translucency,  */\n  /*    etc.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    params  :: A pointer to an @FT_Raster_Params structure used to     */\n  /*               describe the rendering operation.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should know what you are doing and how @FT_Raster_Params works */\n  /*    to use this function.                                              */\n  /*                                                                       */\n  /*    The field `params.source' will be set to `outline' before the scan */\n  /*    converter is called, which means that the value you give to it is  */\n  /*    actually ignored.                                                  */\n  /*                                                                       */\n  /*    The gray-level rasterizer always uses 256 gray levels.  If you     */\n  /*    want less gray levels, you have to provide your own span callback. */\n  /*    See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the   */\n  /*    @FT_Raster_Params structure for more details.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params );\n\n\n /**************************************************************************\n  *\n  * @enum:\n  *   FT_Orientation\n  *\n  * @description:\n  *   A list of values used to describe an outline's contour orientation.\n  *\n  *   The TrueType and PostScript specifications use different conventions\n  *   to determine whether outline contours should be filled or unfilled.\n  *\n  * @values:\n  *   FT_ORIENTATION_TRUETYPE ::\n  *     According to the TrueType specification, clockwise contours must\n  *     be filled, and counter-clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_POSTSCRIPT ::\n  *     According to the PostScript specification, counter-clockwise contours\n  *     must be filled, and clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_FILL_RIGHT ::\n  *     This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\n  *     remember that in TrueType, everything that is to the right of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_FILL_LEFT ::\n  *     This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\n  *     remember that in PostScript, everything that is to the left of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_NONE ::\n  *     The orientation cannot be determined.  That is, different parts of\n  *     the glyph have different orientation.\n  *\n  */\n  typedef enum  FT_Orientation_\n  {\n    FT_ORIENTATION_TRUETYPE   = 0,\n    FT_ORIENTATION_POSTSCRIPT = 1,\n    FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\n    FT_ORIENTATION_FILL_LEFT  = FT_ORIENTATION_POSTSCRIPT,\n    FT_ORIENTATION_NONE\n\n  } FT_Orientation;\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Outline_Get_Orientation\n  *\n  * @description:\n  *   This function analyzes a glyph outline and tries to compute its\n  *   fill orientation (see @FT_Orientation).  This is done by computing\n  *   the direction of each global horizontal and/or vertical extrema\n  *   within the outline.\n  *\n  *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty\n  *   outlines.\n  *\n  * @input:\n  *   outline ::\n  *     A handle to the source outline.\n  *\n  * @return:\n  *   The orientation.\n  *\n  */\n  FT_EXPORT( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOUTLN_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (specification only).   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2008, 2009 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTPFR_H__\n#define __FTPFR_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    pfr_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    PFR Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    PFR/TrueDoc specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of PFR-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Metrics\n  *\n  * @description:\n  *    Return the outline and metrics resolutions of a given PFR face.\n  *\n  * @input:\n  *    face :: Handle to the input face.  It can be a non-PFR face.\n  *\n  * @output:\n  *    aoutline_resolution ::\n  *      Outline resolution.  This is equivalent to `face->units_per_EM'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_resolution ::\n  *      Metrics resolution.  This is equivalent to `outline_resolution'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_x_scale ::\n  *      A 16.16 fixed-point number used to scale distance expressed\n  *      in metrics units to device sub-pixels.  This is equivalent to\n  *      `face->size->x_scale', but for metrics only.  Optional (parameter\n  *      can be NULL).\n  *\n  *    ametrics_y_scale ::\n  *      Same as `ametrics_x_scale' but for the vertical direction.\n  *      optional (parameter can be NULL).\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If the input face is not a PFR, this function will return an error.\n  *   However, in all cases, it will return valid values.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Kerning\n  *\n  * @description:\n  *    Return the kerning pair corresponding to two glyphs in a PFR face.\n  *    The distance is expressed in metrics units, unlike the result of\n  *    @FT_Get_Kerning.\n  *\n  * @input:\n  *    face  :: A handle to the input face.\n  *\n  *    left  :: Index of the left glyph.\n  *\n  *    right :: Index of the right glyph.\n  *\n  * @output:\n  *    avector :: A kerning vector.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    This function always return distances in original PFR metrics\n  *    units.  This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED\n  *    mode, which always returns distances converted to outline units.\n  *\n  *    You can use the value of the `x_scale' and `y_scale' parameters\n  *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Advance\n  *\n  * @description:\n  *    Return a given glyph advance, expressed in original metrics units,\n  *    from a PFR font.\n  *\n  * @input:\n  *    face   :: A handle to the input face.\n  *\n  *    gindex :: The glyph index.\n  *\n  * @output:\n  *    aadvance :: The glyph advance in metrics units.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics\n  *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftrender.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrender.h                                                             */\n/*                                                                         */\n/*    FreeType renderer modules public interface (specification).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2005, 2006, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRENDER_H__\n#define __FTRENDER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph object */\n  typedef FT_Error\n  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,\n                        FT_GlyphSlot  slot );\n\n  /* destroys a given glyph object */\n  typedef void\n  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );\n\n  typedef void\n  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,\n                             const FT_Matrix*  matrix,\n                             const FT_Vector*  delta );\n\n  typedef void\n  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,\n                           FT_BBox*  abbox );\n\n  typedef FT_Error\n  (*FT_Glyph_CopyFunc)( FT_Glyph   source,\n                        FT_Glyph   target );\n\n  typedef FT_Error\n  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,\n                           FT_GlyphSlot  slot );\n\n/* deprecated */\n#define FT_Glyph_Init_Func       FT_Glyph_InitFunc\n#define FT_Glyph_Done_Func       FT_Glyph_DoneFunc\n#define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc\n#define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc\n#define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc\n#define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc\n\n\n  struct  FT_Glyph_Class_\n  {\n    FT_Long                 glyph_size;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_InitFunc       glyph_init;\n    FT_Glyph_DoneFunc       glyph_done;\n    FT_Glyph_CopyFunc       glyph_copy;\n    FT_Glyph_TransformFunc  glyph_transform;\n    FT_Glyph_GetBBoxFunc    glyph_bbox;\n    FT_Glyph_PrepareFunc    glyph_prepare;\n  };\n\n\n  typedef FT_Error\n  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,\n                             FT_GlyphSlot      slot,\n                             FT_UInt           mode,\n                             const FT_Vector*  origin );\n\n  typedef FT_Error\n  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,\n                                FT_GlyphSlot      slot,\n                                const FT_Matrix*  matrix,\n                                const FT_Vector*  delta );\n\n\n  typedef void\n  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,\n                              FT_GlyphSlot  slot,\n                              FT_BBox*      cbox );\n\n\n  typedef FT_Error\n  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,\n                              FT_ULong     mode_tag,\n                              FT_Pointer   mode_ptr );\n\n/* deprecated identifiers */\n#define FTRenderer_render  FT_Renderer_RenderFunc\n#define FTRenderer_transform  FT_Renderer_TransformFunc\n#define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc\n#define FTRenderer_setMode  FT_Renderer_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The renderer module class descriptor.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root            :: The root @FT_Module_Class fields.               */\n  /*                                                                       */\n  /*    glyph_format    :: The glyph image format this renderer handles.   */\n  /*                                                                       */\n  /*    render_glyph    :: A method used to render the image that is in a  */\n  /*                       given glyph slot into a bitmap.                 */\n  /*                                                                       */\n  /*    transform_glyph :: A method used to transform the image that is in */\n  /*                       a given glyph slot.                             */\n  /*                                                                       */\n  /*    get_glyph_cbox  :: A method used to access the glyph's cbox.       */\n  /*                                                                       */\n  /*    set_mode        :: A method used to pass additional parameters.    */\n  /*                                                                       */\n  /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */\n  /*                       This is a pointer to its raster's class.        */\n  /*                                                                       */\n  typedef struct  FT_Renderer_Class_\n  {\n    FT_Module_Class            root;\n\n    FT_Glyph_Format            glyph_format;\n\n    FT_Renderer_RenderFunc     render_glyph;\n    FT_Renderer_TransformFunc  transform_glyph;\n    FT_Renderer_GetCBoxFunc    get_glyph_cbox;\n    FT_Renderer_SetModeFunc    set_mode;\n\n    FT_Raster_Funcs*           raster_class;\n\n  } FT_Renderer_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the current renderer for a given glyph format.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /*    format  :: The glyph format.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A renderer handle.  0~if none found.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */\n  /*    renderer by its name, use @FT_Get_Module.                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the current renderer to use, and set additional mode.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    renderer   :: A handle to the renderer object.                     */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    parameters :: Additional parameters.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case of success, the renderer will be used to convert glyph     */\n  /*    images in the renderer's known format into bitmaps.                */\n  /*                                                                       */\n  /*    This doesn't change the current renderer for other formats.        */\n  /*                                                                       */\n  /*    Currently, only the B/W renderer, if compiled with                 */\n  /*    FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels               */\n  /*    anti-aliasing mode; this option must be set directly in            */\n  /*    `ftraster.c' and is undefined by default) accepts a single tag     */\n  /*    `pal5' to set its gray palette as a character string with          */\n  /*    5~elements.  Consequently, the third and fourth argument are zero  */\n  /*    normally.                                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTRENDER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftsizes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsizes.h                                                              */\n/*                                                                         */\n/*    FreeType size objects management (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Typical application would normally not need to use these functions.   */\n  /* However, they have been placed in a public API for the rare cases     */\n  /* where they are needed.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSIZES_H__\n#define __FTSIZES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sizes_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Size Management                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Managing multiple sizes per face.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    When creating a new face object (e.g., with @FT_New_Face), an      */\n  /*    @FT_Size object is automatically created and used to store all     */\n  /*    pixel-size dependent information, available in the `face->size'    */\n  /*    field.                                                             */\n  /*                                                                       */\n  /*    It is however possible to create more sizes for a given face,      */\n  /*    mostly in order to manage several character pixel sizes of the     */\n  /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */\n  /*                                                                       */\n  /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */\n  /*    modify the contents of the current `active' size; you thus need    */\n  /*    to use @FT_Activate_Size to change it.                             */\n  /*                                                                       */\n  /*    99% of applications won't need the functions provided here,        */\n  /*    especially if they use the caching sub-system, so be cautious      */\n  /*    when using these.                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Size                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new size object from a given face object.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a parent face object.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize :: A handle to a new size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You need to call @FT_Activate_Size in order to select the new size */\n  /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */\n  /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size*  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Size                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given size object.  Note that @FT_Done_Face              */\n  /*    automatically discards all size objects allocated with             */\n  /*    @FT_New_Size.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Size( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Activate_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Even though it is possible to create several size objects for a    */\n  /*    given face (see @FT_New_Size for details), functions like          */\n  /*    @FT_Load_Glyph or @FT_Load_Char only use the one which has been    */\n  /*    activated last to determine the `current character pixel size'.    */\n  /*                                                                       */\n  /*    This function can be used to `activate' a previously created size  */\n  /*    object.                                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `face' is the size's parent face object, this function changes  */\n  /*    the value of `face->size' to the input size handle.                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Activate_Size( FT_Size  size );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSIZES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftsnames.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.h                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (specification).  */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_SFNT_NAMES_H__\n#define __FT_SFNT_NAMES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sfnt_names                                                         */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    SFNT Names                                                         */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Access the names embedded in TrueType and OpenType files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType and OpenType specifications allow the inclusion of    */\n  /*    a special `names table' in font files.  This table contains        */\n  /*    textual (and internationalized) information regarding the font,    */\n  /*    like family name, copyright, version, etc.                         */\n  /*                                                                       */\n  /*    The definitions below are used to access them if available.        */\n  /*                                                                       */\n  /*    Note that this has nothing to do with glyph names!                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SfntName                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model an SFNT `name' table entry.              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platform_id :: The platform ID for `string'.                       */\n  /*                                                                       */\n  /*    encoding_id :: The encoding ID for `string'.                       */\n  /*                                                                       */\n  /*    language_id :: The language ID for `string'.                       */\n  /*                                                                       */\n  /*    name_id     :: An identifier for `string'.                         */\n  /*                                                                       */\n  /*    string      :: The `name' string.  Note that its format differs    */\n  /*                   depending on the (platform,encoding) pair.  It can  */\n  /*                   be a Pascal String, a UTF-16 one, etc.              */\n  /*                                                                       */\n  /*                   Generally speaking, the string is not               */\n  /*                   zero-terminated.  Please refer to the TrueType      */\n  /*                   specification for details.                          */\n  /*                                                                       */\n  /*    string_len  :: The length of `string' in bytes.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Possible values for `platform_id', `encoding_id', `language_id',   */\n  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */\n  /*    please refer to the TrueType or OpenType specification.            */\n  /*                                                                       */\n  /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */\n  /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */\n  /*                                                                       */\n  typedef struct  FT_SfntName_\n  {\n    FT_UShort  platform_id;\n    FT_UShort  encoding_id;\n    FT_UShort  language_id;\n    FT_UShort  name_id;\n\n    FT_Byte*   string;      /* this string is *not* null-terminated! */\n    FT_UInt    string_len;  /* in bytes */\n\n  } FT_SfntName;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name_Count                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the number of name strings in the SFNT `name' table.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of strings in the `name' table.                         */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a string of the SFNT `name' table for a given index.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to the source face.                              */\n  /*                                                                       */\n  /*    idx   :: The index of the `name' string.                           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aname :: The indexed @FT_SfntName structure.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `string' array returned in the `aname' structure is not        */\n  /*    null-terminated.  The application should deallocate it if it is no */\n  /*    longer in use.                                                     */\n  /*                                                                       */\n  /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */\n  /*    `name' table entries, then do a loop until you get the right       */\n  /*    platform, encoding, and name ID.                                   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname );\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred family subfamily names in `name'\n   *   table since OpenType version 1.4.  For backwards compatibility with\n   *   legacy systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred subfamily names in `name' table since\n   *   OpenType version 1.4.  For backwards compatibility with legacy\n   *   systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_SFNT_NAMES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftstroke.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.h                                                             */\n/*                                                                         */\n/*    FreeType path stroker (specification).                               */\n/*                                                                         */\n/*  Copyright 2002-2006, 2008, 2009, 2011-2012 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_STROKE_H__\n#define __FT_STROKE_H__\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n /************************************************************************\n  *\n  * @section:\n  *    glyph_stroker\n  *\n  * @title:\n  *    Glyph Stroker\n  *\n  * @abstract:\n  *    Generating bordered and stroked glyphs.\n  *\n  * @description:\n  *    This component generates stroked outlines of a given vectorial\n  *    glyph.  It also allows you to retrieve the `outside' and/or the\n  *    `inside' borders of the stroke.\n  *\n  *    This can be useful to generate `bordered' glyph, i.e., glyphs\n  *    displayed with a coloured (and anti-aliased) border around their\n  *    shape.\n  */\n\n\n /**************************************************************\n  *\n  * @type:\n  *   FT_Stroker\n  *\n  * @description:\n  *   Opaque handler to a path stroker object.\n  */\n  typedef struct FT_StrokerRec_*  FT_Stroker;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineJoin\n   *\n   * @description:\n   *   These values determine how two joining lines are rendered\n   *   in a stroker.\n   *\n   * @values:\n   *   FT_STROKER_LINEJOIN_ROUND ::\n   *     Used to render rounded line joins.  Circular arcs are used\n   *     to join two lines smoothly.\n   *\n   *   FT_STROKER_LINEJOIN_BEVEL ::\n   *     Used to render beveled line joins.  The outer corner of\n   *     the joined lines is filled by enclosing the triangular\n   *     region of the corner with a straight line between the\n   *     outer corners of each stroke.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_FIXED ::\n   *     Used to render mitered line joins, with fixed bevels if the\n   *     miter limit is exceeded.  The outer edges of the strokes\n   *     for the two segments are extended until they meet at an\n   *     angle.  If the segments meet at too sharp an angle (such\n   *     that the miter would extend from the intersection of the\n   *     segments a distance greater than the product of the miter\n   *     limit value and the border radius), then a bevel join (see\n   *     above) is used instead.  This prevents long spikes being\n   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter\n   *     line join as used in PostScript and PDF.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::\n   *   FT_STROKER_LINEJOIN_MITER ::\n   *     Used to render mitered line joins, with variable bevels if\n   *     the miter limit is exceeded.  The intersection of the\n   *     strokes is clipped at a line perpendicular to the bisector\n   *     of the angle between the strokes, at the distance from the\n   *     intersection of the segments equal to the product of the\n   *     miter limit value and the border radius.  This prevents\n   *     long spikes being created.\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line\n   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias\n   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for\n   *     backwards compatibility.\n   */\n  typedef enum  FT_Stroker_LineJoin_\n  {\n    FT_STROKER_LINEJOIN_ROUND          = 0,\n    FT_STROKER_LINEJOIN_BEVEL          = 1,\n    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,\n    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,\n    FT_STROKER_LINEJOIN_MITER_FIXED    = 3\n\n  } FT_Stroker_LineJoin;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineCap\n   *\n   * @description:\n   *   These values determine how the end of opened sub-paths are\n   *   rendered in a stroke.\n   *\n   * @values:\n   *   FT_STROKER_LINECAP_BUTT ::\n   *     The end of lines is rendered as a full stop on the last\n   *     point itself.\n   *\n   *   FT_STROKER_LINECAP_ROUND ::\n   *     The end of lines is rendered as a half-circle around the\n   *     last point.\n   *\n   *   FT_STROKER_LINECAP_SQUARE ::\n   *     The end of lines is rendered as a square around the\n   *     last point.\n   */\n  typedef enum  FT_Stroker_LineCap_\n  {\n    FT_STROKER_LINECAP_BUTT = 0,\n    FT_STROKER_LINECAP_ROUND,\n    FT_STROKER_LINECAP_SQUARE\n\n  } FT_Stroker_LineCap;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_StrokerBorder\n   *\n   * @description:\n   *   These values are used to select a given stroke border\n   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.\n   *\n   * @values:\n   *   FT_STROKER_BORDER_LEFT ::\n   *     Select the left border, relative to the drawing direction.\n   *\n   *   FT_STROKER_BORDER_RIGHT ::\n   *     Select the right border, relative to the drawing direction.\n   *\n   * @note:\n   *   Applications are generally interested in the `inside' and `outside'\n   *   borders.  However, there is no direct mapping between these and the\n   *   `left' and `right' ones, since this really depends on the glyph's\n   *   drawing orientation, which varies between font formats.\n   *\n   *   You can however use @FT_Outline_GetInsideBorder and\n   *   @FT_Outline_GetOutsideBorder to get these.\n   */\n  typedef enum  FT_StrokerBorder_\n  {\n    FT_STROKER_BORDER_LEFT = 0,\n    FT_STROKER_BORDER_RIGHT\n\n  } FT_StrokerBorder;\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetInsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `inside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetOutsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `outside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_New\n   *\n   * @description:\n   *   Create a new stroker object.\n   *\n   * @input:\n   *   library ::\n   *     FreeType library handle.\n   *\n   * @output:\n   *   astroker ::\n   *     A new stroker object handle.  NULL in case of error.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Set\n   *\n   * @description:\n   *   Reset a stroker object's attributes.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   radius ::\n   *     The border radius.\n   *\n   *   line_cap ::\n   *     The line cap style.\n   *\n   *   line_join ::\n   *     The line join style.\n   *\n   *   miter_limit ::\n   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,\n   *     expressed as 16.16 fixed-point value.\n   *\n   * @note:\n   *   The radius is expressed in the same units as the outline\n   *   coordinates.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Rewind\n   *\n   * @description:\n   *   Reset a stroker object without changing its attributes.\n   *   You should call this function before beginning a new\n   *   series of calls to @FT_Stroker_BeginSubPath or\n   *   @FT_Stroker_EndSubPath.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ParseOutline\n   *\n   * @description:\n   *   A convenience function used to parse a whole outline with\n   *   the stroker.  The resulting outline(s) can be retrieved\n   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The source outline.\n   *\n   *   opened ::\n   *     A boolean.  If~1, the outline is treated as an open path instead\n   *     of a closed one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If `opened' is~0 (the default), the outline is treated as a closed\n   *   path, and the stroker generates two distinct `border' outlines.\n   *\n   *   If `opened' is~1, the outline is processed as an open path, and the\n   *   stroker generates a single `stroke' outline.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_BeginSubPath\n   *\n   * @description:\n   *   Start a new sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the start vector.\n   *\n   *   open ::\n   *     A boolean.  If~1, the sub-path is treated as an open one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function is useful when you need to stroke a path that is\n   *   not stored as an @FT_Outline object.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_EndSubPath\n   *\n   * @description:\n   *   Close the current sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function after @FT_Stroker_BeginSubPath.\n   *   If the subpath was not `opened', this function `draws' a\n   *   single line segment to the start position when needed.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_LineTo\n   *\n   * @description:\n   *   `Draw' a single line segment in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ConicTo\n   *\n   * @description:\n   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control ::\n   *     A pointer to a Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_CubicTo\n   *\n   * @description:\n   *   `Draw' a single cubic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control1 ::\n   *     A pointer to the first Bézier control point.\n   *\n   *   control2 ::\n   *     A pointer to second Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetBorderCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export one of the `border' or `stroke'\n   *   outlines generated by the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_GetCounts instead if you want to\n   *   retrieve the counts associated to both borders.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ExportBorder\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the corresponding border to your own @FT_Outline\n   *   structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   *   outline ::\n   *     The target outline handle.\n   *\n   * @note:\n   *   Always call this function after @FT_Stroker_GetBorderCounts to\n   *   get sure that there is enough room in your @FT_Outline object to\n   *   receive all new data.\n   *\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps. The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_Export instead if you want to\n   *   retrieve all borders at once.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export all points/borders from the stroked\n   *   outline/path.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Export\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export all borders to your own @FT_Outline structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The target outline handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Done\n   *\n   * @description:\n   *   Destroy a stroker object.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.  Can be NULL.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Done( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_Stroke\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_StrokeBorder\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker, but\n   *   only return either its inside or outside border.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   inside ::\n   *     A Boolean.  If~1, return the inside border, otherwise\n   *     the outside border.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FT_STROKE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftsynth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.h                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting              */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2006, 2008, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********        WARNING, THIS IS ALPHA CODE!  THIS API         *********/\n  /*********    IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE    *********/\n  /*********            FREETYPE DEVELOPMENT TEAM                  *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Main reason for not lifting the functions in this module to a  */\n  /* `standard' API is that the used parameters for emboldening and */\n  /* slanting are not configurable.  Consider the functions as a    */\n  /* code resource which should be copied into the application and  */\n  /* adapted to the particular needs.                               */\n\n\n#ifndef __FTSYNTH_H__\n#define __FTSYNTH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /* Embolden a glyph by a `reasonable' value (which is highly a matter of */\n  /* taste).  This function is actually a convenience function, providing  */\n  /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */\n  /*                                                                       */\n  /* For emboldened outlines the height, width, and advance metrics are    */\n  /* increased by the strength of the emboldening.  You can also call      */\n  /* @FT_Outline_Get_CBox to get precise values.                           */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );\n\n  /* Slant an outline glyph to the right by about 12 degrees. */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTSYNTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftsystem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.h                                                             */\n/*                                                                         */\n/*    FreeType low-level system interface definition (specification).      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSYSTEM_H__\n#define __FTSYSTEM_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   system_interface                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   System Interface                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   How FreeType manages memory and i/o.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This section contains various definitions related to memory         */\n  /*   management and i/o access.  You need to understand this             */\n  /*   information if you want to use a custom memory manager or you own   */\n  /*   i/o streams.                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  M E M O R Y   M A N A G E M E N T                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Memory\n   *\n   * @description:\n   *   A handle to a given memory manager object, defined with an\n   *   @FT_MemoryRec structure.\n   *\n   */\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Alloc_Func\n   *\n   * @description:\n   *   A function used to allocate `size' bytes from `memory'.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   size ::\n   *     The size in bytes to allocate.\n   *\n   * @return:\n   *   Address of new memory block.  0~in case of failure.\n   *\n   */\n  typedef void*\n  (*FT_Alloc_Func)( FT_Memory  memory,\n                    long       size );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Free_Func\n   *\n   * @description:\n   *   A function used to release a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   block ::\n   *     The address of the target memory block.\n   *\n   */\n  typedef void\n  (*FT_Free_Func)( FT_Memory  memory,\n                   void*      block );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Realloc_Func\n   *\n   * @description:\n   *   A function used to re-allocate a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   cur_size ::\n   *     The block's current size in bytes.\n   *\n   *   new_size ::\n   *     The block's requested new size.\n   *\n   *   block ::\n   *     The block's current address.\n   *\n   * @return:\n   *   New block address.  0~in case of memory shortage.\n   *\n   * @note:\n   *   In case of error, the old block must still be available.\n   *\n   */\n  typedef void*\n  (*FT_Realloc_Func)( FT_Memory  memory,\n                      long       cur_size,\n                      long       new_size,\n                      void*      block );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_MemoryRec\n   *\n   * @description:\n   *   A structure used to describe a given memory manager to FreeType~2.\n   *\n   * @fields:\n   *   user ::\n   *     A generic typeless pointer for user data.\n   *\n   *   alloc ::\n   *     A pointer type to an allocation function.\n   *\n   *   free ::\n   *     A pointer type to an memory freeing function.\n   *\n   *   realloc ::\n   *     A pointer type to a reallocation function.\n   *\n   */\n  struct  FT_MemoryRec_\n  {\n    void*            user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       I / O   M A N A G E M E N T                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Stream\n   *\n   * @description:\n   *   A handle to an input stream.\n   *\n   */\n  typedef struct FT_StreamRec_*  FT_Stream;\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamDesc\n   *\n   * @description:\n   *   A union type used to store either a long or a pointer.  This is used\n   *   to store a file descriptor or a `FILE*' in an input stream.\n   *\n   */\n  typedef union  FT_StreamDesc_\n  {\n    long   value;\n    void*  pointer;\n\n  } FT_StreamDesc;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_IoFunc\n   *\n   * @description:\n   *   A function used to seek and read data from a given input stream.\n   *\n   * @input:\n   *   stream ::\n   *     A handle to the source stream.\n   *\n   *   offset ::\n   *     The offset of read in stream (always from start).\n   *\n   *   buffer ::\n   *     The address of the read buffer.\n   *\n   *   count ::\n   *     The number of bytes to read from the stream.\n   *\n   * @return:\n   *   The number of bytes effectively read by the stream.\n   *\n   * @note:\n   *   This function might be called to perform a seek or skip operation\n   *   with a `count' of~0.  A non-zero return value then indicates an\n   *   error.\n   *\n   */\n  typedef unsigned long\n  (*FT_Stream_IoFunc)( FT_Stream       stream,\n                       unsigned long   offset,\n                       unsigned char*  buffer,\n                       unsigned long   count );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_CloseFunc\n   *\n   * @description:\n   *   A function used to close a given input stream.\n   *\n   * @input:\n   *  stream ::\n   *     A handle to the target stream.\n   *\n   */\n  typedef void\n  (*FT_Stream_CloseFunc)( FT_Stream  stream );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamRec\n   *\n   * @description:\n   *   A structure used to describe an input stream.\n   *\n   * @input:\n   *   base ::\n   *     For memory-based streams, this is the address of the first stream\n   *     byte in memory.  This field should always be set to NULL for\n   *     disk-based streams.\n   *\n   *   size ::\n   *     The stream size in bytes.\n   *\n   *   pos ::\n   *     The current position within the stream.\n   *\n   *   descriptor ::\n   *     This field is a union that can hold an integer or a pointer.  It is\n   *     used by stream implementations to store file descriptors or `FILE*'\n   *     pointers.\n   *\n   *   pathname ::\n   *     This field is completely ignored by FreeType.  However, it is often\n   *     useful during debugging to use it to store the stream's filename\n   *     (where available).\n   *\n   *   read ::\n   *     The stream's input function.\n   *\n   *   close ::\n   *     The stream's close function.\n   *\n   *   memory ::\n   *     The memory manager to use to preload frames.  This is set\n   *     internally by FreeType and shouldn't be touched by stream\n   *     implementations.\n   *\n   *   cursor ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   *   limit ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   */\n  typedef struct  FT_StreamRec_\n  {\n    unsigned char*       base;\n    unsigned long        size;\n    unsigned long        pos;\n\n    FT_StreamDesc        descriptor;\n    FT_StreamDesc        pathname;\n    FT_Stream_IoFunc     read;\n    FT_Stream_CloseFunc  close;\n\n    FT_Memory            memory;\n    unsigned char*       cursor;\n    unsigned char*       limit;\n\n  } FT_StreamRec;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSYSTEM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/fttrigon.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.h                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (specification).                    */\n/*                                                                         */\n/*  Copyright 2001, 2003, 2005, 2007, 2013 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTRIGON_H__\n#define __FTTRIGON_H__\n\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   computations                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Angle\n   *\n   * @description:\n   *   This type is used to model angle values in FreeType.  Note that the\n   *   angle is a 16.16 fixed-point value expressed in degrees.\n   *\n   */\n  typedef FT_Fixed  FT_Angle;\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI\n   *\n   * @description:\n   *   The angle pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI  ( 180L << 16 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_2PI\n   *\n   * @description:\n   *   The angle 2*pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI2\n   *\n   * @description:\n   *   The angle pi/2 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI4\n   *\n   * @description:\n   *   The angle pi/4 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Sin\n   *\n   * @description:\n   *   Return the sinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The sinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Sin( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Cos\n   *\n   * @description:\n   *   Return the cosinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The cosinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Cos( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Tan\n   *\n   * @description:\n   *   Return the tangent of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The tangent value.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Tan( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Atan2\n   *\n   * @description:\n   *   Return the arc-tangent corresponding to a given vector (x,y) in\n   *   the 2d plane.\n   *\n   * @input:\n   *   x ::\n   *     The horizontal vector coordinate.\n   *\n   *   y ::\n   *     The vertical vector coordinate.\n   *\n   * @return:\n   *   The arc-tangent value (i.e. angle).\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Atan2( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Angle_Diff\n   *\n   * @description:\n   *   Return the difference between two angles.  The result is always\n   *   constrained to the ]-PI..PI] interval.\n   *\n   * @input:\n   *   angle1 ::\n   *     First angle.\n   *\n   *   angle2 ::\n   *     Second angle.\n   *\n   * @return:\n   *   Constrained value of `value2-value1'.\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Unit\n   *\n   * @description:\n   *   Return the unit vector corresponding to a given angle.  After the\n   *   call, the value of `vec.x' will be `sin(angle)', and the value of\n   *   `vec.y' will be `cos(angle)'.\n   *\n   *   This function is useful to retrieve both the sinus and cosinus of a\n   *   given angle quickly.\n   *\n   * @output:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Rotate\n   *\n   * @description:\n   *   Rotate a vector by a given angle.\n   *\n   * @inout:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Length\n   *\n   * @description:\n   *   Return the length of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @return:\n   *   The vector length, expressed in the same units that the original\n   *   vector coordinates.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Polarize\n   *\n   * @description:\n   *   Compute both the length and angle of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @output:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_From_Polar\n   *\n   * @description:\n   *   Compute vector coordinates from a length and angle.\n   *\n   * @output:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @input:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTTRIGON_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftttdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftttdrv.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the TrueType driver                     */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTTDRV_H__\n#define __FTTTDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   tt_driver\n   *\n   * @title:\n   *   The TrueType driver\n   *\n   * @abstract:\n   *   Controlling the TrueType driver module.\n   *\n   * @description:\n   *   While FreeType's TrueType driver doesn't expose API functions by\n   *   itself, it is possible to control its behaviour with @FT_Property_Set\n   *   and @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The TrueType driver's module name is `truetype'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   interpreter-version\n   *\n   * @description:\n   *   Currently, two versions are available which represent the bytecode\n   *   interpreter with and without subpixel hinting support,\n   *   respectively.  The default is subpixel support if\n   *   TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel\n   *   support otherwise (since it isn't available then).\n   *\n   *   If subpixel hinting is on, many TrueType bytecode instructions\n   *   behave differently compared to B/W or grayscale rendering.  The\n   *   main idea is to render at a much increased horizontal resolution,\n   *   then sampling down the created output to subpixel precision.\n   *   However, many older fonts are not suited to this and must be\n   *   specially taken care of by applying (hardcoded) font-specific\n   *   tweaks.\n   *\n   *   Details on subpixel hinting and some of the necessary tweaks can be\n   *   found in Greg Hitchcock's whitepaper at\n   *   `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.\n   *\n   *   The following example code demonstrates how to activate subpixel\n   *   hinting (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_38;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"truetype\",\n   *                               \"interpreter-version\",\n   *                               &interpreter_version );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   TT_INTERPRETER_VERSION_XXX\n   *\n   * @description:\n   *   A list of constants used for the @interpreter-version property to\n   *   select the hinting engine for Truetype fonts.\n   *\n   *   The numeric value in the constant names represents the version\n   *   number as returned by the `GETINFO' bytecode instruction.\n   *\n   * @values:\n   *   TT_INTERPRETER_VERSION_35 ::\n   *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in\n   *     Windows~98; only grayscale and B/W rasterizing is supported.\n   *\n   *   TT_INTERPRETER_VERSION_38 ::\n   *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly\n   *     equivalent to the hinting provided by DirectWrite ClearType (as\n   *     can be found, for example, in the Internet Explorer~9 running on\n   *     Windows~7).\n   *\n   * @note:\n   *   This property controls the behaviour of the bytecode interpreter\n   *   and thus how outlines get hinted.  It does *not* control how glyph\n   *   get rasterized!  In particular, it does not control subpixel color\n   *   filtering.\n   *\n   *   If FreeType has not been compiled with configuration option\n   *   FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an\n   *   `FT_Err_Unimplemented_Feature' error.\n   *\n   */\n#define TT_INTERPRETER_VERSION_35  35\n#define TT_INTERPRETER_VERSION_38  38\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTTTDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/fttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttypes.h                                                              */\n/*                                                                         */\n/*    FreeType simple types definitions (specification only).              */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTYPES_H__\n#define __FTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_SYSTEM_H\n#include FT_IMAGE_H\n\n#include <stddef.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Basic Data Types                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The basic data types defined by the library.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the basic data types defined by FreeType~2,  */\n  /*    ranging from simple scalar types to bitmap descriptors.  More      */\n  /*    font-specific structures are defined in a different section.       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Byte                                                            */\n  /*    FT_Bytes                                                           */\n  /*    FT_Char                                                            */\n  /*    FT_Int                                                             */\n  /*    FT_UInt                                                            */\n  /*    FT_Int16                                                           */\n  /*    FT_UInt16                                                          */\n  /*    FT_Int32                                                           */\n  /*    FT_UInt32                                                          */\n  /*    FT_Short                                                           */\n  /*    FT_UShort                                                          */\n  /*    FT_Long                                                            */\n  /*    FT_ULong                                                           */\n  /*    FT_Bool                                                            */\n  /*    FT_Offset                                                          */\n  /*    FT_PtrDist                                                         */\n  /*    FT_String                                                          */\n  /*    FT_Tag                                                             */\n  /*    FT_Error                                                           */\n  /*    FT_Fixed                                                           */\n  /*    FT_Pointer                                                         */\n  /*    FT_Pos                                                             */\n  /*    FT_Vector                                                          */\n  /*    FT_BBox                                                            */\n  /*    FT_Matrix                                                          */\n  /*    FT_FWord                                                           */\n  /*    FT_UFWord                                                          */\n  /*    FT_F2Dot14                                                         */\n  /*    FT_UnitVector                                                      */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /*                                                                       */\n  /*    FT_Generic                                                         */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /*    FT_Bitmap                                                          */\n  /*    FT_Pixel_Mode                                                      */\n  /*    FT_Palette_Mode                                                    */\n  /*    FT_Glyph_Format                                                    */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bool                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef of unsigned char, used for simple booleans.  As usual,   */\n  /*    values 1 and~0 represent true and false, respectively.             */\n  /*                                                                       */\n  typedef unsigned char  FT_Bool;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_FWord                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 16-bit integer used to store a distance in original font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  typedef signed short  FT_FWord;   /* distance in FUnits */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UFWord                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An unsigned 16-bit integer used to store a distance in original    */\n  /*    font units.                                                        */\n  /*                                                                       */\n  typedef unsigned short  FT_UFWord;  /* unsigned distance */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Char                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _signed_ char type.                       */\n  /*                                                                       */\n  typedef signed char  FT_Char;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Byte                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _unsigned_ char type.                     */\n  /*                                                                       */\n  typedef unsigned char  FT_Byte;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bytes                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for constant memory areas.                               */\n  /*                                                                       */\n  typedef const FT_Byte*  FT_Bytes;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Tag                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for 32-bit tags (as used in the SFNT format).            */\n  /*                                                                       */\n  typedef FT_UInt32  FT_Tag;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_String                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the char type, usually used for strings.      */\n  /*                                                                       */\n  typedef char  FT_String;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Short                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed short.                                        */\n  /*                                                                       */\n  typedef signed short  FT_Short;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UShort                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned short.                                      */\n  /*                                                                       */\n  typedef unsigned short  FT_UShort;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the int type.                                        */\n  /*                                                                       */\n  typedef signed int  FT_Int;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the unsigned int type.                               */\n  /*                                                                       */\n  typedef unsigned int  FT_UInt;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Long                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed long.                                         */\n  /*                                                                       */\n  typedef signed long  FT_Long;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ULong                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned long.                                       */\n  /*                                                                       */\n  typedef unsigned long  FT_ULong;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F2Dot14                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 2.14 fixed-point type used for unit vectors.              */\n  /*                                                                       */\n  typedef signed short  FT_F2Dot14;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 26.6 fixed-point type used for vectorial pixel            */\n  /*    coordinates.                                                       */\n  /*                                                                       */\n  typedef signed long  FT_F26Dot6;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Fixed                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is used to store 16.16 fixed-point values, like scaling  */\n  /*    values or matrix coefficients.                                     */\n  /*                                                                       */\n  typedef signed long  FT_Fixed;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Error                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType error code type.  A value of~0 is always interpreted  */\n  /*    as a successful operation.                                         */\n  /*                                                                       */\n  typedef int  FT_Error;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pointer                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for a typeless pointer.                           */\n  /*                                                                       */\n  typedef void*  FT_Pointer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Offset                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `size_t' type, i.e., the largest  */\n  /*    _unsigned_ integer type used to express a file size or position,   */\n  /*    or a memory block size.                                            */\n  /*                                                                       */\n  typedef size_t  FT_Offset;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_PtrDist                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the       */\n  /*    largest _signed_ integer type used to express the distance         */\n  /*    between two pointers.                                              */\n  /*                                                                       */\n  typedef ft_ptrdiff_t  FT_PtrDist;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_UnitVector                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector unit vector.  Uses    */\n  /*    FT_F2Dot14 types.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: Horizontal coordinate.                                        */\n  /*                                                                       */\n  /*    y :: Vertical coordinate.                                          */\n  /*                                                                       */\n  typedef struct  FT_UnitVector_\n  {\n    FT_F2Dot14  x;\n    FT_F2Dot14  y;\n\n  } FT_UnitVector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Matrix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */\n  /*    in 16.16 fixed-point format.  The computation performed is:        */\n  /*                                                                       */\n  /*       {                                                               */\n  /*          x' = x*xx + y*xy                                             */\n  /*          y' = x*yx + y*yy                                             */\n  /*       }                                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    xy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  typedef struct  FT_Matrix_\n  {\n    FT_Fixed  xx, xy;\n    FT_Fixed  yx, yy;\n\n  } FT_Matrix;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read-only binary data represented as a pointer and a length.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    pointer :: The data.                                               */\n  /*                                                                       */\n  /*    length  :: The length of the data in bytes.                        */\n  /*                                                                       */\n  typedef struct  FT_Data_\n  {\n    const FT_Byte*  pointer;\n    FT_Int          length;\n\n  } FT_Data;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Describe a function used to destroy the `client' data of any       */\n  /*    FreeType object.  See the description of the @FT_Generic type for  */\n  /*    details of usage.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The address of the FreeType object which is under finalization.    */\n  /*    Its client data is accessed through its `generic' field.           */\n  /*                                                                       */\n  typedef void  (*FT_Generic_Finalizer)(void*  object);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Generic                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Client applications often need to associate their own data to a    */\n  /*    variety of FreeType core objects.  For example, a text layout API  */\n  /*    might want to associate a glyph cache to a given size object.      */\n  /*                                                                       */\n  /*    Some FreeType object contains a `generic' field, of type           */\n  /*    FT_Generic, which usage is left to client applications and font    */\n  /*    servers.                                                           */\n  /*                                                                       */\n  /*    It can be used to store a pointer to client-specific data, as well */\n  /*    as the address of a `finalizer' function, which will be called by  */\n  /*    FreeType when the object is destroyed (for example, the previous   */\n  /*    client example would put the address of the glyph cache destructor */\n  /*    in the `finalizer' field).                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    data      :: A typeless pointer to any client-specified data. This */\n  /*                 field is completely ignored by the FreeType library.  */\n  /*                                                                       */\n  /*    finalizer :: A pointer to a `generic finalizer' function, which    */\n  /*                 will be called when the object is destroyed.  If this */\n  /*                 field is set to NULL, no code will be called.         */\n  /*                                                                       */\n  typedef struct  FT_Generic_\n  {\n    void*                 data;\n    FT_Generic_Finalizer  finalizer;\n\n  } FT_Generic;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags which are used to label       */\n  /*    TrueType tables into an unsigned long to be used within FreeType.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The produced values *must* be 32-bit integers.  Don't redefine     */\n  /*    this macro.                                                        */\n  /*                                                                       */\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          (FT_Tag)                        \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                    L I S T   M A N A G E M E N T                      */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ListNode                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     Many elements and objects in FreeType are listed through an       */\n  /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */\n  /*     FT_ListNode is a handle to a single list element.                 */\n  /*                                                                       */\n  typedef struct FT_ListNodeRec_*  FT_ListNode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_List                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a list record (see @FT_ListRec).                       */\n  /*                                                                       */\n  typedef struct FT_ListRec_*  FT_List;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a single list element.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    prev :: The previous element in the list.  NULL if first.          */\n  /*                                                                       */\n  /*    next :: The next element in the list.  NULL if last.               */\n  /*                                                                       */\n  /*    data :: A typeless pointer to the listed object.                   */\n  /*                                                                       */\n  typedef struct  FT_ListNodeRec_\n  {\n    FT_ListNode  prev;\n    FT_ListNode  next;\n    void*        data;\n\n  } FT_ListNodeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a simple doubly-linked list.  These are   */\n  /*    used in many parts of FreeType.                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    head :: The head (first element) of doubly-linked list.            */\n  /*                                                                       */\n  /*    tail :: The tail (last element) of doubly-linked list.             */\n  /*                                                                       */\n  typedef struct  FT_ListRec_\n  {\n    FT_ListNode  head;\n    FT_ListNode  tail;\n\n  } FT_ListRec;\n\n\n  /* */\n\n#define FT_IS_EMPTY( list )  ( (list).head == 0 )\n#define FT_BOOL( x )  ( (FT_Bool)( x ) )\n\n  /* concatenate C tokens */\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n  /* see `ftmoderr.h' for descriptions of the following macros */\n\n#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#define FT_ERROR_BASE( x )    ( (x) & 0xFF )\n#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )\n\n#define FT_ERR_EQ( x, e )                                        \\\n          ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )\n#define FT_ERR_NEQ( x, e )                                       \\\n          ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.h                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows fnt-specific data.                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2008 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTWINFNT_H__\n#define __FTWINFNT_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    winfnt_fonts                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Window FNT Files                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Windows FNT specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Windows FNT specific      */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_WinFNT_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `charset' byte in\n   *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX\n   *   encodings (except for cp1361) can be found at ftp://ftp.unicode.org\n   *   in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory.  cp1361 is\n   *   roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.\n   *\n   * @values:\n   *   FT_WinFNT_ID_DEFAULT ::\n   *     This is used for font enumeration and font creation as a\n   *     `don't care' value.  Valid font files don't contain this value.\n   *     When querying for information about the character set of the font\n   *     that is currently selected into a specified device context, this\n   *     return value (of the related Windows API) simply denotes failure.\n   *\n   *   FT_WinFNT_ID_SYMBOL ::\n   *     There is no known mapping table available.\n   *\n   *   FT_WinFNT_ID_MAC ::\n   *     Mac Roman encoding.\n   *\n   *   FT_WinFNT_ID_OEM ::\n   *     From Michael Pöttgen <michael@poettgen.de>:\n   *\n   *       The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM\n   *       is used for the charset of vector fonts, like `modern.fon',\n   *       `roman.fon', and `script.fon' on Windows.\n   *\n   *       The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value\n   *       specifies a character set that is operating-system dependent.\n   *\n   *       The `IFIMETRICS' documentation from the `Windows Driver\n   *       Development Kit' says: This font supports an OEM-specific\n   *       character set.  The OEM character set is system dependent.\n   *\n   *       In general OEM, as opposed to ANSI (i.e., cp1252), denotes the\n   *       second default codepage that most international versions of\n   *       Windows have.  It is one of the OEM codepages from\n   *\n   *         http://www.microsoft.com/globaldev/reference/cphome.mspx,\n   *\n   *       and is used for the `DOS boxes', to support legacy applications.\n   *       A German Windows version for example usually uses ANSI codepage\n   *       1252 and OEM codepage 850.\n   *\n   *   FT_WinFNT_ID_CP874 ::\n   *     A superset of Thai TIS 620 and ISO 8859-11.\n   *\n   *   FT_WinFNT_ID_CP932 ::\n   *     A superset of Japanese Shift-JIS (with minor deviations).\n   *\n   *   FT_WinFNT_ID_CP936 ::\n   *     A superset of simplified Chinese GB 2312-1980 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP949 ::\n   *     A superset of Korean Hangul KS~C 5601-1987 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP950 ::\n   *     A superset of traditional Chinese Big~5 ETen (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP1250 ::\n   *     A superset of East European ISO 8859-2 (with slightly different\n   *     ordering).\n   *\n   *   FT_WinFNT_ID_CP1251 ::\n   *     A superset of Russian ISO 8859-5 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1252 ::\n   *     ANSI encoding.  A superset of ISO 8859-1.\n   *\n   *   FT_WinFNT_ID_CP1253 ::\n   *     A superset of Greek ISO 8859-7 (with minor modifications).\n   *\n   *   FT_WinFNT_ID_CP1254 ::\n   *     A superset of Turkish ISO 8859-9.\n   *\n   *   FT_WinFNT_ID_CP1255 ::\n   *     A superset of Hebrew ISO 8859-8 (with some modifications).\n   *\n   *   FT_WinFNT_ID_CP1256 ::\n   *     A superset of Arabic ISO 8859-6 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1257 ::\n   *     A superset of Baltic ISO 8859-13 (with some deviations).\n   *\n   *   FT_WinFNT_ID_CP1258 ::\n   *     For Vietnamese.  This encoding doesn't cover all necessary\n   *     characters.\n   *\n   *   FT_WinFNT_ID_CP1361 ::\n   *     Korean (Johab).\n   */\n\n#define FT_WinFNT_ID_CP1252    0\n#define FT_WinFNT_ID_DEFAULT   1\n#define FT_WinFNT_ID_SYMBOL    2\n#define FT_WinFNT_ID_MAC      77\n#define FT_WinFNT_ID_CP932   128\n#define FT_WinFNT_ID_CP949   129\n#define FT_WinFNT_ID_CP1361  130\n#define FT_WinFNT_ID_CP936   134\n#define FT_WinFNT_ID_CP950   136\n#define FT_WinFNT_ID_CP1253  161\n#define FT_WinFNT_ID_CP1254  162\n#define FT_WinFNT_ID_CP1258  163\n#define FT_WinFNT_ID_CP1255  177\n#define FT_WinFNT_ID_CP1256  178\n#define FT_WinFNT_ID_CP1257  186\n#define FT_WinFNT_ID_CP1251  204\n#define FT_WinFNT_ID_CP874   222\n#define FT_WinFNT_ID_CP1250  238\n#define FT_WinFNT_ID_OEM     255\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_HeaderRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Windows FNT Header info.                                           */\n  /*                                                                       */\n  typedef struct  FT_WinFNT_HeaderRec_\n  {\n    FT_UShort  version;\n    FT_ULong   file_size;\n    FT_Byte    copyright[60];\n    FT_UShort  file_type;\n    FT_UShort  nominal_point_size;\n    FT_UShort  vertical_resolution;\n    FT_UShort  horizontal_resolution;\n    FT_UShort  ascent;\n    FT_UShort  internal_leading;\n    FT_UShort  external_leading;\n    FT_Byte    italic;\n    FT_Byte    underline;\n    FT_Byte    strike_out;\n    FT_UShort  weight;\n    FT_Byte    charset;\n    FT_UShort  pixel_width;\n    FT_UShort  pixel_height;\n    FT_Byte    pitch_and_family;\n    FT_UShort  avg_width;\n    FT_UShort  max_width;\n    FT_Byte    first_char;\n    FT_Byte    last_char;\n    FT_Byte    default_char;\n    FT_Byte    break_char;\n    FT_UShort  bytes_per_row;\n    FT_ULong   device_offset;\n    FT_ULong   face_name_offset;\n    FT_ULong   bits_pointer;\n    FT_ULong   bits_offset;\n    FT_Byte    reserved;\n    FT_ULong   flags;\n    FT_UShort  A_space;\n    FT_UShort  B_space;\n    FT_UShort  C_space;\n    FT_UShort  color_table_offset;\n    FT_ULong   reserved1[4];\n\n  } FT_WinFNT_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_Header                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FT_WinFNT_HeaderRec structure.                     */\n  /*                                                                       */\n  typedef struct FT_WinFNT_HeaderRec_*  FT_WinFNT_Header;\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_WinFNT_Header\n   *\n   * @description:\n   *    Retrieve a Windows FNT font info header.\n   *\n   * @input:\n   *    face    :: A handle to the input face.\n   *\n   * @output:\n   *    aheader :: The WinFNT header.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function only works with Windows FNT faces, returning an error\n   *   otherwise.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *aheader );\n\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTWINFNT_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ftxf86.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.h                                                               */\n/*                                                                         */\n/*    Support functions for X11.                                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2007 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTXF86_H__\n#define __FTXF86_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   font_formats                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   Font Formats                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   Getting the font format.                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   The single function in this section can be used to get the font     */\n  /*   format.  Note that this information is not needed normally;         */\n  /*   however, there are special cases (like in PDF devices) where it is  */\n  /*   important to differentiate, in spite of FreeType's uniform API.     */\n  /*                                                                       */\n  /*   This function is in the X11/xf86 namespace for historical reasons   */\n  /*   and in no way depends on that windowing system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*   FT_Get_X11_Font_Format                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Return a string describing the format of a given face, using values */\n  /*   which can be used as an X11 FONT_PROPERTY.  Possible values are     */\n  /*   `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */\n  /*   `PFR', and `Windows~FNT'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   face ::                                                             */\n  /*     Input face handle.                                                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   Font format string.  NULL in case of error.                         */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTXF86_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/t1tables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tables.h                                                             */\n/*                                                                         */\n/*    Basic Type 1/Type 2 tables definitions and interface (specification  */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TABLES_H__\n#define __T1TABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    type1_tables                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Type 1 Tables                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Type~1 (PostScript) specific font tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of Type 1-specific tables,    */\n  /*    including structures related to other PostScript font formats.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */\n  /* structures in order to support Multiple Master fonts.               */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfoRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 FontInfo dictionary.  */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    FontInfo dictionary.                                               */\n  /*                                                                       */\n  typedef struct  PS_FontInfoRec_\n  {\n    FT_String*  version;\n    FT_String*  notice;\n    FT_String*  full_name;\n    FT_String*  family_name;\n    FT_String*  weight;\n    FT_Long     italic_angle;\n    FT_Bool     is_fixed_pitch;\n    FT_Short    underline_position;\n    FT_UShort   underline_thickness;\n\n  } PS_FontInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_FontInfoRec structure.                           */\n  /*                                                                       */\n  typedef struct PS_FontInfoRec_*  PS_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef PS_FontInfoRec  T1_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_PrivateRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 private dictionary.   */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    Private dictionary.                                                */\n  /*                                                                       */\n  typedef struct  PS_PrivateRec_\n  {\n    FT_Int     unique_id;\n    FT_Int     lenIV;\n\n    FT_Byte    num_blue_values;\n    FT_Byte    num_other_blues;\n    FT_Byte    num_family_blues;\n    FT_Byte    num_family_other_blues;\n\n    FT_Short   blue_values[14];\n    FT_Short   other_blues[10];\n\n    FT_Short   family_blues      [14];\n    FT_Short   family_other_blues[10];\n\n    FT_Fixed   blue_scale;\n    FT_Int     blue_shift;\n    FT_Int     blue_fuzz;\n\n    FT_UShort  standard_width[1];\n    FT_UShort  standard_height[1];\n\n    FT_Byte    num_snap_widths;\n    FT_Byte    num_snap_heights;\n    FT_Bool    force_bold;\n    FT_Bool    round_stem_up;\n\n    FT_Short   snap_widths [13];  /* including std width  */\n    FT_Short   snap_heights[13];  /* including std height */\n\n    FT_Fixed   expansion_factor;\n\n    FT_Long    language_group;\n    FT_Long    password;\n\n    FT_Short   min_feature[2];\n\n  } PS_PrivateRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_PrivateRec structure.                            */\n  /*                                                                       */\n  typedef struct PS_PrivateRec_*  PS_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef PS_PrivateRec  T1_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_Blend_Flags                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of flags used to indicate which fields are present in a      */\n  /*    given blend dictionary (font info or private).  Used to support    */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  typedef enum  T1_Blend_Flags_\n  {\n    /*# required fields in a FontInfo blend dictionary */\n    T1_BLEND_UNDERLINE_POSITION = 0,\n    T1_BLEND_UNDERLINE_THICKNESS,\n    T1_BLEND_ITALIC_ANGLE,\n\n    /*# required fields in a Private blend dictionary */\n    T1_BLEND_BLUE_VALUES,\n    T1_BLEND_OTHER_BLUES,\n    T1_BLEND_STANDARD_WIDTH,\n    T1_BLEND_STANDARD_HEIGHT,\n    T1_BLEND_STEM_SNAP_WIDTHS,\n    T1_BLEND_STEM_SNAP_HEIGHTS,\n    T1_BLEND_BLUE_SCALE,\n    T1_BLEND_BLUE_SHIFT,\n    T1_BLEND_FAMILY_BLUES,\n    T1_BLEND_FAMILY_OTHER_BLUES,\n    T1_BLEND_FORCE_BOLD,\n\n    /*# never remove */\n    T1_BLEND_MAX\n\n  } T1_Blend_Flags;\n\n  /* */\n\n\n  /*# backwards compatible definitions */\n#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION\n#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS\n#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE\n#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES\n#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES\n#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH\n#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT\n#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS\n#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS\n#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE\n#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT\n#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES\n#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES\n#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD\n#define t1_blend_max                  T1_BLEND_MAX\n\n\n  /* maximum number of Multiple Masters designs, as defined in the spec */\n#define T1_MAX_MM_DESIGNS     16\n\n  /* maximum number of Multiple Masters axes, as defined in the spec */\n#define T1_MAX_MM_AXIS        4\n\n  /* maximum number of elements in a design map */\n#define T1_MAX_MM_MAP_POINTS  20\n\n\n  /* this structure is used to store the BlendDesignMap entry for an axis */\n  typedef struct  PS_DesignMap_\n  {\n    FT_Byte    num_points;\n    FT_Long*   design_points;\n    FT_Fixed*  blend_points;\n\n  } PS_DesignMapRec, *PS_DesignMap;\n\n  /* backwards-compatible definition */\n  typedef PS_DesignMapRec  T1_DesignMap;\n\n\n  typedef struct  PS_BlendRec_\n  {\n    FT_UInt          num_designs;\n    FT_UInt          num_axis;\n\n    FT_String*       axis_names[T1_MAX_MM_AXIS];\n    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];\n    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];\n\n    FT_Fixed*        weight_vector;\n    FT_Fixed*        default_weight_vector;\n\n    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];\n    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];\n\n    FT_ULong         blend_bitflags;\n\n    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];\n\n    /* since 2.3.0 */\n\n    /* undocumented, optional: the default design instance;   */\n    /* corresponds to default_weight_vector --                */\n    /* num_default_design_vector == 0 means it is not present */\n    /* in the font and associated metrics files               */\n    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];\n    FT_UInt          num_default_design_vector;\n\n  } PS_BlendRec, *PS_Blend;\n\n\n  /* backwards-compatible definition */\n  typedef PS_BlendRec  T1_Blend;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDictRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent data in a CID top-level dictionary.  */\n  /*                                                                       */\n  typedef struct  CID_FaceDictRec_\n  {\n    PS_PrivateRec  private_dict;\n\n    FT_UInt        len_buildchar;\n    FT_Fixed       forcebold_threshold;\n    FT_Pos         stroke_width;\n    FT_Fixed       expansion_factor;\n\n    FT_Byte        paint_type;\n    FT_Byte        font_type;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n    FT_UInt        num_subrs;\n    FT_ULong       subrmap_offset;\n    FT_Int         sd_bytes;\n\n  } CID_FaceDictRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDict                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceDictRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceDictRec_*  CID_FaceDict;\n\n  /* */\n\n\n  /* backwards-compatible definition */\n  typedef CID_FaceDictRec  CID_FontDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfoRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent CID Face information.                */\n  /*                                                                       */\n  typedef struct  CID_FaceInfoRec_\n  {\n    FT_String*      cid_font_name;\n    FT_Fixed        cid_version;\n    FT_Int          cid_font_type;\n\n    FT_String*      registry;\n    FT_String*      ordering;\n    FT_Int          supplement;\n\n    PS_FontInfoRec  font_info;\n    FT_BBox         font_bbox;\n    FT_ULong        uid_base;\n\n    FT_Int          num_xuid;\n    FT_ULong        xuid[16];\n\n    FT_ULong        cidmap_offset;\n    FT_Int          fd_bytes;\n    FT_Int          gd_bytes;\n    FT_ULong        cid_count;\n\n    FT_Int          num_dicts;\n    CID_FaceDict    font_dicts;\n\n    FT_ULong        data_offset;\n\n  } CID_FaceInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfo                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceInfoRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceInfoRec_*  CID_FaceInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Info                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef CID_FaceInfoRec  CID_Info;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Has_PS_Glyph_Names\n   *\n   * @description:\n   *    Return true if a given face provides reliable PostScript glyph\n   *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,\n   *    except that certain fonts (mostly TrueType) contain incorrect\n   *    glyph name tables.\n   *\n   *    When this function returns true, the caller is sure that the glyph\n   *    names returned by @FT_Get_Glyph_Name are reliable.\n   *\n   * @input:\n   *    face ::\n   *       face handle\n   *\n   * @return:\n   *    Boolean.  True if glyph names are reliable.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Info\n   *\n   * @description:\n   *    Retrieve the @PS_FontInfoRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_info ::\n   *       Output font info structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the font info structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function will\n   *    return the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face      face,\n                       PS_FontInfo  afont_info );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Private\n   *\n   * @description:\n   *    Retrieve the @PS_PrivateRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_private ::\n   *       Output private dictionary structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the @PS_PrivateRec structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face     face,\n                          PS_Private  afont_private );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_EncodingType                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration describing the `Encoding' entry in a Type 1         */\n  /*    dictionary.                                                        */\n  /*                                                                       */\n  typedef enum  T1_EncodingType_\n  {\n    T1_ENCODING_TYPE_NONE = 0,\n    T1_ENCODING_TYPE_ARRAY,\n    T1_ENCODING_TYPE_STANDARD,\n    T1_ENCODING_TYPE_ISOLATIN1,\n    T1_ENCODING_TYPE_EXPERT\n\n  } T1_EncodingType;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    PS_Dict_Keys                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used in calls to @FT_Get_PS_Font_Value to identify  */\n  /*    the Type~1 dictionary entry to retrieve.                           */\n  /*                                                                       */\n  typedef enum  PS_Dict_Keys_\n  {\n    /* conventionally in the font dictionary */\n    PS_DICT_FONT_TYPE,              /* FT_Byte         */\n    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */\n    PS_DICT_FONT_BBOX,              /* FT_Fixed        */\n    PS_DICT_PAINT_TYPE,             /* FT_Byte         */\n    PS_DICT_FONT_NAME,              /* FT_String*      */\n    PS_DICT_UNIQUE_ID,              /* FT_Int          */\n    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */\n    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */\n    PS_DICT_CHAR_STRING,            /* FT_String*      */\n    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */\n    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */\n\n    /* conventionally in the font Private dictionary */\n    PS_DICT_NUM_SUBRS,              /* FT_Int     */\n    PS_DICT_SUBR,                   /* FT_String* */\n    PS_DICT_STD_HW,                 /* FT_UShort  */\n    PS_DICT_STD_VW,                 /* FT_UShort  */\n    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */\n    PS_DICT_BLUE_VALUE,             /* FT_Short   */\n    PS_DICT_BLUE_FUZZ,              /* FT_Int     */\n    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */\n    PS_DICT_OTHER_BLUE,             /* FT_Short   */\n    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */\n    PS_DICT_FAMILY_BLUE,            /* FT_Short   */\n    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */\n    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */\n    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */\n    PS_DICT_BLUE_SHIFT,             /* FT_Int     */\n    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_H,            /* FT_Short   */\n    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_V,            /* FT_Short   */\n    PS_DICT_FORCE_BOLD,             /* FT_Bool    */\n    PS_DICT_RND_STEM_UP,            /* FT_Bool    */\n    PS_DICT_MIN_FEATURE,            /* FT_Short   */\n    PS_DICT_LEN_IV,                 /* FT_Int     */\n    PS_DICT_PASSWORD,               /* FT_Long    */\n    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */\n\n    /* conventionally in the font FontInfo dictionary */\n    PS_DICT_VERSION,                /* FT_String* */\n    PS_DICT_NOTICE,                 /* FT_String* */\n    PS_DICT_FULL_NAME,              /* FT_String* */\n    PS_DICT_FAMILY_NAME,            /* FT_String* */\n    PS_DICT_WEIGHT,                 /* FT_String* */\n    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */\n    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */\n    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */\n    PS_DICT_FS_TYPE,                /* FT_UShort  */\n    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */\n\n    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE\n\n  } PS_Dict_Keys;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Value\n   *\n   * @description:\n   *    Retrieve the value for the supplied key from a PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   *    key ::\n   *       An enumeration value representing the dictionary key to retrieve.\n   *\n   *    idx ::\n   *       For array values, this specifies the index to be returned.\n   *\n   *    value ::\n   *       A pointer to memory into which to write the value.\n   *\n   *    valen_len ::\n   *       The size, in bytes, of the memory supplied for the value.\n   *\n   * @output:\n   *    value ::\n   *       The value matching the above key, if it exists.\n   *\n   * @return:\n   *    The amount of memory (in bytes) required to hold the requested\n   *    value (if it exists, -1 otherwise).\n   *\n   * @note:\n   *    The values returned are not pointers into the internal structures of\n   *    the face, but are `fresh' copies, so that the memory containing them\n   *    belongs to the calling application.  This also enforces the\n   *    `read-only' nature of these values, i.e., this function cannot be\n   *    used to manipulate the face.\n   *\n   *    `value' is a void pointer because the values returned can be of\n   *    various types.\n   *\n   *    If either `value' is NULL or `value_len' is too small, just the\n   *    required memory size for the requested entry is returned.\n   *\n   *    The `idx' parameter is used, not only to retrieve elements of, for\n   *    example, the FontMatrix or FontBBox, but also to retrieve name keys\n   *    from the CharStrings dictionary, and the charstrings themselves.  It\n   *    is ignored for atomic values.\n   *\n   *    PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000.  To\n   *    get the value as in the font stream, you need to divide by\n   *    65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).\n   *\n   *    IMPORTANT: Only key/value pairs read by the FreeType interpreter can\n   *    be retrieved.  So, for example, PostScript procedures such as NP,\n   *    ND, and RD are not available.  Arbitrary keys are, obviously, not be\n   *    available either.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Long )\n  FT_Get_PS_Font_Value( FT_Face       face,\n                        PS_Dict_Keys  key,\n                        FT_UInt       idx,\n                        void         *value,\n                        FT_Long       value_len );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __T1TABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ttnameid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttnameid.h                                                             */\n/*                                                                         */\n/*    TrueType name ID definitions (specification only).                   */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTNAMEID_H__\n#define __TTNAMEID_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values for the `platform' identifier code in the name        */\n  /* records of the TTF `name' table.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_PLATFORM_XXX\n   *\n   * @description:\n   *   A list of valid values for the `platform_id' identifier code in\n   *   @FT_CharMapRec and @FT_SfntName structures.\n   *\n   * @values:\n   *   TT_PLATFORM_APPLE_UNICODE ::\n   *     Used by Apple to indicate a Unicode character map and/or name entry.\n   *     See @TT_APPLE_ID_XXX for corresponding `encoding_id' values.  Note\n   *     that name entries in this format are coded as big-endian UCS-2\n   *     character codes _only_.\n   *\n   *   TT_PLATFORM_MACINTOSH ::\n   *     Used by Apple to indicate a MacOS-specific charmap and/or name entry.\n   *     See @TT_MAC_ID_XXX for corresponding `encoding_id' values.  Note that\n   *     most TrueType fonts contain an Apple roman charmap to be usable on\n   *     MacOS systems (even if they contain a Microsoft charmap as well).\n   *\n   *   TT_PLATFORM_ISO ::\n   *     This value was used to specify ISO/IEC 10646 charmaps.  It is however\n   *     now deprecated.  See @TT_ISO_ID_XXX for a list of corresponding\n   *     `encoding_id' values.\n   *\n   *   TT_PLATFORM_MICROSOFT ::\n   *     Used by Microsoft to indicate Windows-specific charmaps.  See\n   *     @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.\n   *     Note that most fonts contain a Unicode charmap using\n   *     (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).\n   *\n   *   TT_PLATFORM_CUSTOM ::\n   *     Used to indicate application-specific charmaps.\n   *\n   *   TT_PLATFORM_ADOBE ::\n   *     This value isn't part of any font format specification, but is used\n   *     by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec\n   *     structure.  See @TT_ADOBE_ID_XXX.\n   */\n\n#define TT_PLATFORM_APPLE_UNICODE  0\n#define TT_PLATFORM_MACINTOSH      1\n#define TT_PLATFORM_ISO            2 /* deprecated */\n#define TT_PLATFORM_MICROSOFT      3\n#define TT_PLATFORM_CUSTOM         4\n#define TT_PLATFORM_ADOBE          7 /* artificial */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_APPLE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.\n   *\n   * @values:\n   *   TT_APPLE_ID_DEFAULT ::\n   *     Unicode version 1.0.\n   *\n   *   TT_APPLE_ID_UNICODE_1_1 ::\n   *     Unicode 1.1; specifies Hangul characters starting at U+34xx.\n   *\n   *   TT_APPLE_ID_ISO_10646 ::\n   *     Deprecated (identical to preceding).\n   *\n   *   TT_APPLE_ID_UNICODE_2_0 ::\n   *     Unicode 2.0 and beyond (UTF-16 BMP only).\n   *\n   *   TT_APPLE_ID_UNICODE_32 ::\n   *     Unicode 3.1 and beyond, using UTF-32.\n   *\n   *   TT_APPLE_ID_VARIANT_SELECTOR ::\n   *     From Adobe, not Apple.  Not a normal cmap.  Specifies variations\n   *     on a real cmap.\n   */\n\n#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */\n#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */\n#define TT_APPLE_ID_ISO_10646         2 /* deprecated */\n#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */\n#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */\n#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MAC_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MACINTOSH charmaps and name entries.\n   *\n   * @values:\n   *   TT_MAC_ID_ROMAN ::\n   *   TT_MAC_ID_JAPANESE ::\n   *   TT_MAC_ID_TRADITIONAL_CHINESE ::\n   *   TT_MAC_ID_KOREAN ::\n   *   TT_MAC_ID_ARABIC ::\n   *   TT_MAC_ID_HEBREW ::\n   *   TT_MAC_ID_GREEK ::\n   *   TT_MAC_ID_RUSSIAN ::\n   *   TT_MAC_ID_RSYMBOL ::\n   *   TT_MAC_ID_DEVANAGARI ::\n   *   TT_MAC_ID_GURMUKHI ::\n   *   TT_MAC_ID_GUJARATI ::\n   *   TT_MAC_ID_ORIYA ::\n   *   TT_MAC_ID_BENGALI ::\n   *   TT_MAC_ID_TAMIL ::\n   *   TT_MAC_ID_TELUGU ::\n   *   TT_MAC_ID_KANNADA ::\n   *   TT_MAC_ID_MALAYALAM ::\n   *   TT_MAC_ID_SINHALESE ::\n   *   TT_MAC_ID_BURMESE ::\n   *   TT_MAC_ID_KHMER ::\n   *   TT_MAC_ID_THAI ::\n   *   TT_MAC_ID_LAOTIAN ::\n   *   TT_MAC_ID_GEORGIAN ::\n   *   TT_MAC_ID_ARMENIAN ::\n   *   TT_MAC_ID_MALDIVIAN ::\n   *   TT_MAC_ID_SIMPLIFIED_CHINESE ::\n   *   TT_MAC_ID_TIBETAN ::\n   *   TT_MAC_ID_MONGOLIAN ::\n   *   TT_MAC_ID_GEEZ ::\n   *   TT_MAC_ID_SLAVIC ::\n   *   TT_MAC_ID_VIETNAMESE ::\n   *   TT_MAC_ID_SINDHI ::\n   *   TT_MAC_ID_UNINTERP ::\n   */\n\n#define TT_MAC_ID_ROMAN                 0\n#define TT_MAC_ID_JAPANESE              1\n#define TT_MAC_ID_TRADITIONAL_CHINESE   2\n#define TT_MAC_ID_KOREAN                3\n#define TT_MAC_ID_ARABIC                4\n#define TT_MAC_ID_HEBREW                5\n#define TT_MAC_ID_GREEK                 6\n#define TT_MAC_ID_RUSSIAN               7\n#define TT_MAC_ID_RSYMBOL               8\n#define TT_MAC_ID_DEVANAGARI            9\n#define TT_MAC_ID_GURMUKHI             10\n#define TT_MAC_ID_GUJARATI             11\n#define TT_MAC_ID_ORIYA                12\n#define TT_MAC_ID_BENGALI              13\n#define TT_MAC_ID_TAMIL                14\n#define TT_MAC_ID_TELUGU               15\n#define TT_MAC_ID_KANNADA              16\n#define TT_MAC_ID_MALAYALAM            17\n#define TT_MAC_ID_SINHALESE            18\n#define TT_MAC_ID_BURMESE              19\n#define TT_MAC_ID_KHMER                20\n#define TT_MAC_ID_THAI                 21\n#define TT_MAC_ID_LAOTIAN              22\n#define TT_MAC_ID_GEORGIAN             23\n#define TT_MAC_ID_ARMENIAN             24\n#define TT_MAC_ID_MALDIVIAN            25\n#define TT_MAC_ID_SIMPLIFIED_CHINESE   25\n#define TT_MAC_ID_TIBETAN              26\n#define TT_MAC_ID_MONGOLIAN            27\n#define TT_MAC_ID_GEEZ                 28\n#define TT_MAC_ID_SLAVIC               29\n#define TT_MAC_ID_VIETNAMESE           30\n#define TT_MAC_ID_SINDHI               31\n#define TT_MAC_ID_UNINTERP             32\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ISO_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ISO charmaps and name entries.\n   *\n   *   Their use is now deprecated.\n   *\n   * @values:\n   *   TT_ISO_ID_7BIT_ASCII ::\n   *     ASCII.\n   *   TT_ISO_ID_10646 ::\n   *     ISO/10646.\n   *   TT_ISO_ID_8859_1 ::\n   *     Also known as Latin-1.\n   */\n\n#define TT_ISO_ID_7BIT_ASCII  0\n#define TT_ISO_ID_10646       1\n#define TT_ISO_ID_8859_1      2\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MS_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MICROSOFT charmaps and name entries.\n   *\n   * @values:\n   *   TT_MS_ID_SYMBOL_CS ::\n   *     Corresponds to Microsoft symbol encoding. See\n   *     @FT_ENCODING_MS_SYMBOL.\n   *\n   *   TT_MS_ID_UNICODE_CS ::\n   *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See\n   *     @FT_ENCODING_UNICODE.\n   *\n   *   TT_MS_ID_SJIS ::\n   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.\n   *\n   *   TT_MS_ID_GB2312 ::\n   *     Corresponds to Simplified Chinese as used in Mainland China.  See\n   *     @FT_ENCODING_GB2312.\n   *\n   *   TT_MS_ID_BIG_5 ::\n   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.\n   *     See @FT_ENCODING_BIG5.\n   *\n   *   TT_MS_ID_WANSUNG ::\n   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.\n   *\n   *   TT_MS_ID_JOHAB ::\n   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.\n   *\n   *   TT_MS_ID_UCS_4 ::\n   *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to\n   *     the OpenType specification version 1.4 (mid-2001.)\n   */\n\n#define TT_MS_ID_SYMBOL_CS    0\n#define TT_MS_ID_UNICODE_CS   1\n#define TT_MS_ID_SJIS         2\n#define TT_MS_ID_GB2312       3\n#define TT_MS_ID_BIG_5        4\n#define TT_MS_ID_WANSUNG      5\n#define TT_MS_ID_JOHAB        6\n#define TT_MS_ID_UCS_4       10\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ADOBE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ADOBE charmaps.  This is a FreeType-specific extension!\n   *\n   * @values:\n   *   TT_ADOBE_ID_STANDARD ::\n   *     Adobe standard encoding.\n   *   TT_ADOBE_ID_EXPERT ::\n   *     Adobe expert encoding.\n   *   TT_ADOBE_ID_CUSTOM ::\n   *     Adobe custom encoding.\n   *   TT_ADOBE_ID_LATIN_1 ::\n   *     Adobe Latin~1 encoding.\n   */\n\n#define TT_ADOBE_ID_STANDARD  0\n#define TT_ADOBE_ID_EXPERT    1\n#define TT_ADOBE_ID_CUSTOM    2\n#define TT_ADOBE_ID_LATIN_1   3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MACINTOSH.  These values are also used as return values   */\n  /* for function @FT_Get_CMap_Language_ID.                                */\n  /*                                                                       */\n  /* The canonical source for the Apple assigned Language ID's is at       */\n  /*                                                                       */\n  /*   https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html      */\n  /*                                                                       */\n#define TT_MAC_LANGID_ENGLISH                       0\n#define TT_MAC_LANGID_FRENCH                        1\n#define TT_MAC_LANGID_GERMAN                        2\n#define TT_MAC_LANGID_ITALIAN                       3\n#define TT_MAC_LANGID_DUTCH                         4\n#define TT_MAC_LANGID_SWEDISH                       5\n#define TT_MAC_LANGID_SPANISH                       6\n#define TT_MAC_LANGID_DANISH                        7\n#define TT_MAC_LANGID_PORTUGUESE                    8\n#define TT_MAC_LANGID_NORWEGIAN                     9\n#define TT_MAC_LANGID_HEBREW                       10\n#define TT_MAC_LANGID_JAPANESE                     11\n#define TT_MAC_LANGID_ARABIC                       12\n#define TT_MAC_LANGID_FINNISH                      13\n#define TT_MAC_LANGID_GREEK                        14\n#define TT_MAC_LANGID_ICELANDIC                    15\n#define TT_MAC_LANGID_MALTESE                      16\n#define TT_MAC_LANGID_TURKISH                      17\n#define TT_MAC_LANGID_CROATIAN                     18\n#define TT_MAC_LANGID_CHINESE_TRADITIONAL          19\n#define TT_MAC_LANGID_URDU                         20\n#define TT_MAC_LANGID_HINDI                        21\n#define TT_MAC_LANGID_THAI                         22\n#define TT_MAC_LANGID_KOREAN                       23\n#define TT_MAC_LANGID_LITHUANIAN                   24\n#define TT_MAC_LANGID_POLISH                       25\n#define TT_MAC_LANGID_HUNGARIAN                    26\n#define TT_MAC_LANGID_ESTONIAN                     27\n#define TT_MAC_LANGID_LETTISH                      28\n#define TT_MAC_LANGID_SAAMISK                      29\n#define TT_MAC_LANGID_FAEROESE                     30\n#define TT_MAC_LANGID_FARSI                        31\n#define TT_MAC_LANGID_RUSSIAN                      32\n#define TT_MAC_LANGID_CHINESE_SIMPLIFIED           33\n#define TT_MAC_LANGID_FLEMISH                      34\n#define TT_MAC_LANGID_IRISH                        35\n#define TT_MAC_LANGID_ALBANIAN                     36\n#define TT_MAC_LANGID_ROMANIAN                     37\n#define TT_MAC_LANGID_CZECH                        38\n#define TT_MAC_LANGID_SLOVAK                       39\n#define TT_MAC_LANGID_SLOVENIAN                    40\n#define TT_MAC_LANGID_YIDDISH                      41\n#define TT_MAC_LANGID_SERBIAN                      42\n#define TT_MAC_LANGID_MACEDONIAN                   43\n#define TT_MAC_LANGID_BULGARIAN                    44\n#define TT_MAC_LANGID_UKRAINIAN                    45\n#define TT_MAC_LANGID_BYELORUSSIAN                 46\n#define TT_MAC_LANGID_UZBEK                        47\n#define TT_MAC_LANGID_KAZAKH                       48\n#define TT_MAC_LANGID_AZERBAIJANI                  49\n#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT  49\n#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT    50\n#define TT_MAC_LANGID_ARMENIAN                     51\n#define TT_MAC_LANGID_GEORGIAN                     52\n#define TT_MAC_LANGID_MOLDAVIAN                    53\n#define TT_MAC_LANGID_KIRGHIZ                      54\n#define TT_MAC_LANGID_TAJIKI                       55\n#define TT_MAC_LANGID_TURKMEN                      56\n#define TT_MAC_LANGID_MONGOLIAN                    57\n#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT   57\n#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT    58\n#define TT_MAC_LANGID_PASHTO                       59\n#define TT_MAC_LANGID_KURDISH                      60\n#define TT_MAC_LANGID_KASHMIRI                     61\n#define TT_MAC_LANGID_SINDHI                       62\n#define TT_MAC_LANGID_TIBETAN                      63\n#define TT_MAC_LANGID_NEPALI                       64\n#define TT_MAC_LANGID_SANSKRIT                     65\n#define TT_MAC_LANGID_MARATHI                      66\n#define TT_MAC_LANGID_BENGALI                      67\n#define TT_MAC_LANGID_ASSAMESE                     68\n#define TT_MAC_LANGID_GUJARATI                     69\n#define TT_MAC_LANGID_PUNJABI                      70\n#define TT_MAC_LANGID_ORIYA                        71\n#define TT_MAC_LANGID_MALAYALAM                    72\n#define TT_MAC_LANGID_KANNADA                      73\n#define TT_MAC_LANGID_TAMIL                        74\n#define TT_MAC_LANGID_TELUGU                       75\n#define TT_MAC_LANGID_SINHALESE                    76\n#define TT_MAC_LANGID_BURMESE                      77\n#define TT_MAC_LANGID_KHMER                        78\n#define TT_MAC_LANGID_LAO                          79\n#define TT_MAC_LANGID_VIETNAMESE                   80\n#define TT_MAC_LANGID_INDONESIAN                   81\n#define TT_MAC_LANGID_TAGALOG                      82\n#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT           83\n#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT          84\n#define TT_MAC_LANGID_AMHARIC                      85\n#define TT_MAC_LANGID_TIGRINYA                     86\n#define TT_MAC_LANGID_GALLA                        87\n#define TT_MAC_LANGID_SOMALI                       88\n#define TT_MAC_LANGID_SWAHILI                      89\n#define TT_MAC_LANGID_RUANDA                       90\n#define TT_MAC_LANGID_RUNDI                        91\n#define TT_MAC_LANGID_CHEWA                        92\n#define TT_MAC_LANGID_MALAGASY                     93\n#define TT_MAC_LANGID_ESPERANTO                    94\n#define TT_MAC_LANGID_WELSH                       128\n#define TT_MAC_LANGID_BASQUE                      129\n#define TT_MAC_LANGID_CATALAN                     130\n#define TT_MAC_LANGID_LATIN                       131\n#define TT_MAC_LANGID_QUECHUA                     132\n#define TT_MAC_LANGID_GUARANI                     133\n#define TT_MAC_LANGID_AYMARA                      134\n#define TT_MAC_LANGID_TATAR                       135\n#define TT_MAC_LANGID_UIGHUR                      136\n#define TT_MAC_LANGID_DZONGKHA                    137\n#define TT_MAC_LANGID_JAVANESE                    138\n#define TT_MAC_LANGID_SUNDANESE                   139\n\n\n#if 0  /* these seem to be errors that have been dropped */\n\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             140\n#define TT_MAC_LANGID_IRISH_GAELIC                141\n\n#endif\n\n\n  /* The following codes are new as of 2000-03-10 */\n#define TT_MAC_LANGID_GALICIAN                    140\n#define TT_MAC_LANGID_AFRIKAANS                   141\n#define TT_MAC_LANGID_BRETON                      142\n#define TT_MAC_LANGID_INUKTITUT                   143\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             144\n#define TT_MAC_LANGID_MANX_GAELIC                 145\n#define TT_MAC_LANGID_IRISH_GAELIC                146\n#define TT_MAC_LANGID_TONGAN                      147\n#define TT_MAC_LANGID_GREEK_POLYTONIC             148\n#define TT_MAC_LANGID_GREELANDIC                  149\n#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT    150\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MICROSOFT.                                                */\n  /*                                                                       */\n  /* The canonical source for the MS assigned LCIDs is                     */\n  /*                                                                       */\n  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */\n  /*                                                                       */\n\n#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001\n#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401\n#define TT_MS_LANGID_ARABIC_IRAQ                       0x0801\n#define TT_MS_LANGID_ARABIC_EGYPT                      0x0c01\n#define TT_MS_LANGID_ARABIC_LIBYA                      0x1001\n#define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401\n#define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801\n#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1c01\n#define TT_MS_LANGID_ARABIC_OMAN                       0x2001\n#define TT_MS_LANGID_ARABIC_YEMEN                      0x2401\n#define TT_MS_LANGID_ARABIC_SYRIA                      0x2801\n#define TT_MS_LANGID_ARABIC_JORDAN                     0x2c01\n#define TT_MS_LANGID_ARABIC_LEBANON                    0x3001\n#define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401\n#define TT_MS_LANGID_ARABIC_UAE                        0x3801\n#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3c01\n#define TT_MS_LANGID_ARABIC_QATAR                      0x4001\n#define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402\n#define TT_MS_LANGID_CATALAN_SPAIN                     0x0403\n#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004\n#define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404\n#define TT_MS_LANGID_CHINESE_PRC                       0x0804\n#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0c04\n#define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004\n\n#if 1  /* this looks like the correct value */\n#define TT_MS_LANGID_CHINESE_MACAU                     0x1404\n#else  /* but beware, Microsoft may change its mind...\n          the most recent Word reference has the following: */\n#define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG\n#endif\n\n#if 0  /* used only with .NET `cultures'; commented out */\n#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04\n#endif\n\n#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405\n#define TT_MS_LANGID_DANISH_DENMARK                    0x0406\n#define TT_MS_LANGID_GERMAN_GERMANY                    0x0407\n#define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807\n#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0c07\n#define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007\n#define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407\n#define TT_MS_LANGID_GREEK_GREECE                      0x0408\n\n  /* don't ask what this one means... It is commented out currently. */\n#if 0\n#define TT_MS_LANGID_GREEK_GREECE2                     0x2008\n#endif\n\n#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009\n#define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409\n#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809\n#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0c09\n#define TT_MS_LANGID_ENGLISH_CANADA                    0x1009\n#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409\n#define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809\n#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1c09\n#define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009\n#define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409\n#define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809\n#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2c09\n#define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009\n#define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409\n#define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809\n#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3c09\n#define TT_MS_LANGID_ENGLISH_INDIA                     0x4009\n#define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409\n#define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809\n#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040a\n#define TT_MS_LANGID_SPANISH_MEXICO                    0x080a\n#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0c0a\n#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100a\n#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140a\n#define TT_MS_LANGID_SPANISH_PANAMA                    0x180a\n#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1c0a\n#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200a\n#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240a\n#define TT_MS_LANGID_SPANISH_PERU                      0x280a\n#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2c0a\n#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300a\n#define TT_MS_LANGID_SPANISH_CHILE                     0x340a\n#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380a\n#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3c0a\n#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400a\n#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440a\n#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480a\n#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4c0a\n#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500a\n#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a\n  /* The following ID blatantly violate MS specs by using a */\n  /* sublanguage > 0x1F.                                    */\n#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU\n#define TT_MS_LANGID_FINNISH_FINLAND                   0x040b\n#define TT_MS_LANGID_FRENCH_FRANCE                     0x040c\n#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080c\n#define TT_MS_LANGID_FRENCH_CANADA                     0x0c0c\n#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100c\n#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140c\n#define TT_MS_LANGID_FRENCH_MONACO                     0x180c\n#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1c0c\n#define TT_MS_LANGID_FRENCH_REUNION                    0x200c\n#define TT_MS_LANGID_FRENCH_CONGO                      0x240c\n  /* which was formerly: */\n#define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO\n#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280c\n#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2c0c\n#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300c\n#define TT_MS_LANGID_FRENCH_MALI                       0x340c\n#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c\n#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c\n  /* and another violation of the spec (see 0xE40aU) */\n#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU\n#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040d\n#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040e\n#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040f\n#define TT_MS_LANGID_ITALIAN_ITALY                     0x0410\n#define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810\n#define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411\n#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA     0x0412\n#define TT_MS_LANGID_KOREAN_JOHAB_KOREA                0x0812\n#define TT_MS_LANGID_DUTCH_NETHERLANDS                 0x0413\n#define TT_MS_LANGID_DUTCH_BELGIUM                     0x0813\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL           0x0414\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK          0x0814\n#define TT_MS_LANGID_POLISH_POLAND                     0x0415\n#define TT_MS_LANGID_PORTUGUESE_BRAZIL                 0x0416\n#define TT_MS_LANGID_PORTUGUESE_PORTUGAL               0x0816\n#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND        0x0417\n#define TT_MS_LANGID_ROMANIAN_ROMANIA                  0x0418\n#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818\n#define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419\n#define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819\n#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041a\n#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081a\n#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0c1a\n\n#if 0  /* this used to be this value, but it looks like we were wrong */\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a\n#else  /* current sources say */\n#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101a\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141a\n       /* and XPsp2 Platform SDK added (2004-07-26) */\n       /* Names are shortened to be significant within 40 chars. */\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181a\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181a\n#endif\n\n#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041b\n#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041c\n#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041d\n#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081d\n#define TT_MS_LANGID_THAI_THAILAND                     0x041e\n#define TT_MS_LANGID_TURKISH_TURKEY                    0x041f\n#define TT_MS_LANGID_URDU_PAKISTAN                     0x0420\n#define TT_MS_LANGID_URDU_INDIA                        0x0820\n#define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421\n#define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422\n#define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423\n#define TT_MS_LANGID_SLOVENE_SLOVENIA                  0x0424\n#define TT_MS_LANGID_ESTONIAN_ESTONIA                  0x0425\n#define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426\n#define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427\n#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827\n#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428\n#define TT_MS_LANGID_FARSI_IRAN                        0x0429\n#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042a\n#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042b\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042c\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082c\n#define TT_MS_LANGID_BASQUE_SPAIN                      0x042d\n#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042e\n#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042f\n#define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430\n#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431\n#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432\n#define TT_MS_LANGID_VENDA_SOUTH_AFRICA                0x0433\n#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA                0x0434\n#define TT_MS_LANGID_ZULU_SOUTH_AFRICA                 0x0435\n#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA            0x0436\n#define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437\n#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438\n#define TT_MS_LANGID_HINDI_INDIA                       0x0439\n#define TT_MS_LANGID_MALTESE_MALTA                     0x043a\n  /* Added by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043b\n#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083b\n#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3b\n#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103b\n#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143b\n#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183b\n#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3b\n#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203b\n#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243b\n  /* ... and we also keep our old identifier... */\n#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b\n\n#if 0 /* this seems to be a previous inversion */\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#else\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#endif\n\n#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d\n#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043e\n#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083e\n#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043f\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \\\n          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN\n\n#define TT_MS_LANGID_SWAHILI_KENYA                     0x0441\n#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843\n#define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444\n#define TT_MS_LANGID_BENGALI_INDIA                     0x0445\n#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845\n#define TT_MS_LANGID_PUNJABI_INDIA                     0x0446\n#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846\n#define TT_MS_LANGID_GUJARATI_INDIA                    0x0447\n#define TT_MS_LANGID_ORIYA_INDIA                       0x0448\n#define TT_MS_LANGID_TAMIL_INDIA                       0x0449\n#define TT_MS_LANGID_TELUGU_INDIA                      0x044a\n#define TT_MS_LANGID_KANNADA_INDIA                     0x044b\n#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044c\n#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044d\n#define TT_MS_LANGID_MARATHI_INDIA                     0x044e\n#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044f\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850\n#define TT_MS_LANGID_TIBETAN_CHINA                     0x0451\n  /* Don't use the next constant!  It has            */\n  /*   (1) the wrong spelling (Dzonghka)             */\n  /*   (2) Microsoft doesn't officially define it -- */\n  /*       at least it is not in the List of Local   */\n  /*       ID Values.                                */\n  /*   (3) Dzongkha is not the same language as      */\n  /*       Tibetan, so merging it is wrong anyway.   */\n  /*                                                 */\n  /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW.    */\n#define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851\n\n#if 0\n  /* the following used to be defined */\n#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451\n  /* ... but it was changed; */\n#else\n  /* So we will continue to #define it, but with the correct value */\n#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN\n#endif\n\n#define TT_MS_LANGID_WELSH_WALES                       0x0452\n#define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453\n#define TT_MS_LANGID_LAO_LAOS                          0x0454\n#define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455\n#define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456\n#define TT_MS_LANGID_KONKANI_INDIA                     0x0457\n#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458\n#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459\n#define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859\n  /* Missing a LCID for Sindhi in Devanagari script */\n#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045a\n#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045b\n#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045c\n#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045d\n#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045e\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045f\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085f\n  /* Missing a LCID for Tifinagh script */\n#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460\n  /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */\n  /* script is yet unclear... might be Arabic, Nagari or Sharada */\n#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860\n  /* ... and aliased (by MS) for compatibility reasons. */\n#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA\n#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461\n#define TT_MS_LANGID_NEPALI_INDIA                      0x0861\n#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462\n#define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463\n#define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464\n#define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES\n#define TT_MS_LANGID_EDO_NIGERIA                       0x0466\n#define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467\n#define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468\n#define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469\n#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046a\n#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046b\n#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086b\n#define TT_MS_LANGID_QUECHUA_PERU                      0x0c6b\n#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046c\n  /* Also spelled by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \\\n          TT_MS_LANGID_SEPEDI_SOUTH_AFRICA\n  /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */\n#define TT_MS_LANGID_IGBO_NIGERIA                      0x0470\n#define TT_MS_LANGID_KANURI_NIGERIA                    0x0471\n#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472\n#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473\n#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873\n  /* also spelled in the `Passport SDK' list as: */\n#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA\n#define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474\n#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475\n#define TT_MS_LANGID_LATIN                             0x0476\n#define TT_MS_LANGID_SOMALI_SOMALIA                    0x0477\n  /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */\n  /*       not written (but OTOH the peculiar writing system is worth     */\n  /*       studying).                                                     */\n#define TT_MS_LANGID_YI_CHINA                          0x0478\n#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479\n  /* language codes from 0x047a to 0x047f are (still) unknown. */\n#define TT_MS_LANGID_UIGHUR_CHINA                      0x0480\n#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481\n\n#if 0  /* not deemed useful for fonts */\n#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04ff\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the `name' identifier field in the name records of */\n  /* the TTF `name' table.  These values are platform independent.         */\n  /*                                                                       */\n#define TT_NAME_ID_COPYRIGHT            0\n#define TT_NAME_ID_FONT_FAMILY          1\n#define TT_NAME_ID_FONT_SUBFAMILY       2\n#define TT_NAME_ID_UNIQUE_ID            3\n#define TT_NAME_ID_FULL_NAME            4\n#define TT_NAME_ID_VERSION_STRING       5\n#define TT_NAME_ID_PS_NAME              6\n#define TT_NAME_ID_TRADEMARK            7\n\n  /* the following values are from the OpenType spec */\n#define TT_NAME_ID_MANUFACTURER         8\n#define TT_NAME_ID_DESIGNER             9\n#define TT_NAME_ID_DESCRIPTION          10\n#define TT_NAME_ID_VENDOR_URL           11\n#define TT_NAME_ID_DESIGNER_URL         12\n#define TT_NAME_ID_LICENSE              13\n#define TT_NAME_ID_LICENSE_URL          14\n  /* number 15 is reserved */\n#define TT_NAME_ID_PREFERRED_FAMILY     16\n#define TT_NAME_ID_PREFERRED_SUBFAMILY  17\n#define TT_NAME_ID_MAC_FULL_NAME        18\n\n  /* The following code is new as of 2000-01-21 */\n#define TT_NAME_ID_SAMPLE_TEXT          19\n\n  /* This is new in OpenType 1.3 */\n#define TT_NAME_ID_CID_FINDFONT_NAME    20\n\n  /* This is new in OpenType 1.5 */\n#define TT_NAME_ID_WWS_FAMILY           21\n#define TT_NAME_ID_WWS_SUBFAMILY        22\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table.     */\n  /*                                                                       */\n  /* Updated 08-Nov-2008.                                                  */\n  /*                                                                       */\n\n  /* Bit  0   Basic Latin */\n#define TT_UCR_BASIC_LATIN                     (1L <<  0) /* U+0020-U+007E */\n  /* Bit  1   C1 Controls and Latin-1 Supplement */\n#define TT_UCR_LATIN1_SUPPLEMENT               (1L <<  1) /* U+0080-U+00FF */\n  /* Bit  2   Latin Extended-A */\n#define TT_UCR_LATIN_EXTENDED_A                (1L <<  2) /* U+0100-U+017F */\n  /* Bit  3   Latin Extended-B */\n#define TT_UCR_LATIN_EXTENDED_B                (1L <<  3) /* U+0180-U+024F */\n  /* Bit  4   IPA Extensions                 */\n  /*          Phonetic Extensions            */\n  /*          Phonetic Extensions Supplement */\n#define TT_UCR_IPA_EXTENSIONS                  (1L <<  4) /* U+0250-U+02AF */\n                                                          /* U+1D00-U+1D7F */\n                                                          /* U+1D80-U+1DBF */\n  /* Bit  5   Spacing Modifier Letters */\n  /*          Modifier Tone Letters    */\n#define TT_UCR_SPACING_MODIFIER                (1L <<  5) /* U+02B0-U+02FF */\n                                                          /* U+A700-U+A71F */\n  /* Bit  6   Combining Diacritical Marks            */\n  /*          Combining Diacritical Marks Supplement */\n#define TT_UCR_COMBINING_DIACRITICS            (1L <<  6) /* U+0300-U+036F */\n                                                          /* U+1DC0-U+1DFF */\n  /* Bit  7   Greek and Coptic */\n#define TT_UCR_GREEK                           (1L <<  7) /* U+0370-U+03FF */\n  /* Bit  8   Coptic */\n#define TT_UCR_COPTIC                          (1L <<  8) /* U+2C80-U+2CFF */\n  /* Bit  9   Cyrillic            */\n  /*          Cyrillic Supplement */\n  /*          Cyrillic Extended-A */\n  /*          Cyrillic Extended-B */\n#define TT_UCR_CYRILLIC                        (1L <<  9) /* U+0400-U+04FF */\n                                                          /* U+0500-U+052F */\n                                                          /* U+2DE0-U+2DFF */\n                                                          /* U+A640-U+A69F */\n  /* Bit 10   Armenian */\n#define TT_UCR_ARMENIAN                        (1L << 10) /* U+0530-U+058F */\n  /* Bit 11   Hebrew */\n#define TT_UCR_HEBREW                          (1L << 11) /* U+0590-U+05FF */\n  /* Bit 12   Vai */\n#define TT_UCR_VAI                             (1L << 12) /* U+A500-U+A63F */\n  /* Bit 13   Arabic            */\n  /*          Arabic Supplement */\n#define TT_UCR_ARABIC                          (1L << 13) /* U+0600-U+06FF */\n                                                          /* U+0750-U+077F */\n  /* Bit 14   NKo */\n#define TT_UCR_NKO                             (1L << 14) /* U+07C0-U+07FF */\n  /* Bit 15   Devanagari */\n#define TT_UCR_DEVANAGARI                      (1L << 15) /* U+0900-U+097F */\n  /* Bit 16   Bengali */\n#define TT_UCR_BENGALI                         (1L << 16) /* U+0980-U+09FF */\n  /* Bit 17   Gurmukhi */\n#define TT_UCR_GURMUKHI                        (1L << 17) /* U+0A00-U+0A7F */\n  /* Bit 18   Gujarati */\n#define TT_UCR_GUJARATI                        (1L << 18) /* U+0A80-U+0AFF */\n  /* Bit 19   Oriya */\n#define TT_UCR_ORIYA                           (1L << 19) /* U+0B00-U+0B7F */\n  /* Bit 20   Tamil */\n#define TT_UCR_TAMIL                           (1L << 20) /* U+0B80-U+0BFF */\n  /* Bit 21   Telugu */\n#define TT_UCR_TELUGU                          (1L << 21) /* U+0C00-U+0C7F */\n  /* Bit 22   Kannada */\n#define TT_UCR_KANNADA                         (1L << 22) /* U+0C80-U+0CFF */\n  /* Bit 23   Malayalam */\n#define TT_UCR_MALAYALAM                       (1L << 23) /* U+0D00-U+0D7F */\n  /* Bit 24   Thai */\n#define TT_UCR_THAI                            (1L << 24) /* U+0E00-U+0E7F */\n  /* Bit 25   Lao */\n#define TT_UCR_LAO                             (1L << 25) /* U+0E80-U+0EFF */\n  /* Bit 26   Georgian            */\n  /*          Georgian Supplement */\n#define TT_UCR_GEORGIAN                        (1L << 26) /* U+10A0-U+10FF */\n                                                          /* U+2D00-U+2D2F */\n  /* Bit 27   Balinese */\n#define TT_UCR_BALINESE                        (1L << 27) /* U+1B00-U+1B7F */\n  /* Bit 28   Hangul Jamo */\n#define TT_UCR_HANGUL_JAMO                     (1L << 28) /* U+1100-U+11FF */\n  /* Bit 29   Latin Extended Additional */\n  /*          Latin Extended-C          */\n  /*          Latin Extended-D          */\n#define TT_UCR_LATIN_EXTENDED_ADDITIONAL       (1L << 29) /* U+1E00-U+1EFF */\n                                                          /* U+2C60-U+2C7F */\n                                                          /* U+A720-U+A7FF */\n  /* Bit 30   Greek Extended */\n#define TT_UCR_GREEK_EXTENDED                  (1L << 30) /* U+1F00-U+1FFF */\n  /* Bit 31   General Punctuation      */\n  /*          Supplemental Punctuation */\n#define TT_UCR_GENERAL_PUNCTUATION             (1L << 31) /* U+2000-U+206F */\n                                                          /* U+2E00-U+2E7F */\n  /* Bit 32   Superscripts And Subscripts */\n#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS         (1L <<  0) /* U+2070-U+209F */\n  /* Bit 33   Currency Symbols */\n#define TT_UCR_CURRENCY_SYMBOLS                (1L <<  1) /* U+20A0-U+20CF */\n  /* Bit 34   Combining Diacritical Marks For Symbols */\n#define TT_UCR_COMBINING_DIACRITICS_SYMB       (1L <<  2) /* U+20D0-U+20FF */\n  /* Bit 35   Letterlike Symbols */\n#define TT_UCR_LETTERLIKE_SYMBOLS              (1L <<  3) /* U+2100-U+214F */\n  /* Bit 36   Number Forms */\n#define TT_UCR_NUMBER_FORMS                    (1L <<  4) /* U+2150-U+218F */\n  /* Bit 37   Arrows                           */\n  /*          Supplemental Arrows-A            */\n  /*          Supplemental Arrows-B            */\n  /*          Miscellaneous Symbols and Arrows */\n#define TT_UCR_ARROWS                          (1L <<  5) /* U+2190-U+21FF */\n                                                          /* U+27F0-U+27FF */\n                                                          /* U+2900-U+297F */\n                                                          /* U+2B00-U+2BFF */\n  /* Bit 38   Mathematical Operators               */\n  /*          Supplemental Mathematical Operators  */\n  /*          Miscellaneous Mathematical Symbols-A */\n  /*          Miscellaneous Mathematical Symbols-B */\n#define TT_UCR_MATHEMATICAL_OPERATORS          (1L <<  6) /* U+2200-U+22FF */\n                                                          /* U+2A00-U+2AFF */\n                                                          /* U+27C0-U+27EF */\n                                                          /* U+2980-U+29FF */\n  /* Bit 39 Miscellaneous Technical */\n#define TT_UCR_MISCELLANEOUS_TECHNICAL         (1L <<  7) /* U+2300-U+23FF */\n  /* Bit 40   Control Pictures */\n#define TT_UCR_CONTROL_PICTURES                (1L <<  8) /* U+2400-U+243F */\n  /* Bit 41   Optical Character Recognition */\n#define TT_UCR_OCR                             (1L <<  9) /* U+2440-U+245F */\n  /* Bit 42   Enclosed Alphanumerics */\n#define TT_UCR_ENCLOSED_ALPHANUMERICS          (1L << 10) /* U+2460-U+24FF */\n  /* Bit 43   Box Drawing */\n#define TT_UCR_BOX_DRAWING                     (1L << 11) /* U+2500-U+257F */\n  /* Bit 44   Block Elements */\n#define TT_UCR_BLOCK_ELEMENTS                  (1L << 12) /* U+2580-U+259F */\n  /* Bit 45   Geometric Shapes */\n#define TT_UCR_GEOMETRIC_SHAPES                (1L << 13) /* U+25A0-U+25FF */\n  /* Bit 46   Miscellaneous Symbols */\n#define TT_UCR_MISCELLANEOUS_SYMBOLS           (1L << 14) /* U+2600-U+26FF */\n  /* Bit 47   Dingbats */\n#define TT_UCR_DINGBATS                        (1L << 15) /* U+2700-U+27BF */\n  /* Bit 48   CJK Symbols and Punctuation */\n#define TT_UCR_CJK_SYMBOLS                     (1L << 16) /* U+3000-U+303F */\n  /* Bit 49   Hiragana */\n#define TT_UCR_HIRAGANA                        (1L << 17) /* U+3040-U+309F */\n  /* Bit 50   Katakana                     */\n  /*          Katakana Phonetic Extensions */\n#define TT_UCR_KATAKANA                        (1L << 18) /* U+30A0-U+30FF */\n                                                          /* U+31F0-U+31FF */\n  /* Bit 51   Bopomofo          */\n  /*          Bopomofo Extended */\n#define TT_UCR_BOPOMOFO                        (1L << 19) /* U+3100-U+312F */\n                                                          /* U+31A0-U+31BF */\n  /* Bit 52   Hangul Compatibility Jamo */\n#define TT_UCR_HANGUL_COMPATIBILITY_JAMO       (1L << 20) /* U+3130-U+318F */\n  /* Bit 53   Phags-Pa */\n#define TT_UCR_CJK_MISC                        (1L << 21) /* U+A840-U+A87F */\n#define TT_UCR_KANBUN  TT_UCR_CJK_MISC /* deprecated */\n#define TT_UCR_PHAGSPA\n  /* Bit 54   Enclosed CJK Letters and Months */\n#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS     (1L << 22) /* U+3200-U+32FF */\n  /* Bit 55   CJK Compatibility */\n#define TT_UCR_CJK_COMPATIBILITY               (1L << 23) /* U+3300-U+33FF */\n  /* Bit 56   Hangul Syllables */\n#define TT_UCR_HANGUL                          (1L << 24) /* U+AC00-U+D7A3 */\n  /* Bit 57   High Surrogates              */\n  /*          High Private Use Surrogates  */\n  /*          Low Surrogates               */\n  /*                                       */\n  /* According to OpenType specs v.1.3+,   */\n  /* setting bit 57 implies that there is  */\n  /* at least one codepoint beyond the     */\n  /* Basic Multilingual Plane that is      */\n  /* supported by this font.  So it really */\n  /* means >= U+10000                      */\n#define TT_UCR_SURROGATES                      (1L << 25) /* U+D800-U+DB7F */\n                                                          /* U+DB80-U+DBFF */\n                                                          /* U+DC00-U+DFFF */\n#define TT_UCR_NON_PLANE_0  TT_UCR_SURROGATES\n  /* Bit 58  Phoenician */\n#define TT_UCR_PHOENICIAN                      (1L << 26) /*U+10900-U+1091F*/\n  /* Bit 59   CJK Unified Ideographs             */\n  /*          CJK Radicals Supplement            */\n  /*          Kangxi Radicals                    */\n  /*          Ideographic Description Characters */\n  /*          CJK Unified Ideographs Extension A */\n  /*          CJK Unified Ideographs Extension B */\n  /*          Kanbun                             */\n#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS          (1L << 27) /* U+4E00-U+9FFF */\n                                                          /* U+2E80-U+2EFF */\n                                                          /* U+2F00-U+2FDF */\n                                                          /* U+2FF0-U+2FFF */\n                                                          /* U+3400-U+4DB5 */\n                                                          /*U+20000-U+2A6DF*/\n                                                          /* U+3190-U+319F */\n  /* Bit 60   Private Use */\n#define TT_UCR_PRIVATE_USE                     (1L << 28) /* U+E000-U+F8FF */\n  /* Bit 61   CJK Strokes                             */\n  /*          CJK Compatibility Ideographs            */\n  /*          CJK Compatibility Ideographs Supplement */\n#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS    (1L << 29) /* U+31C0-U+31EF */\n                                                          /* U+F900-U+FAFF */\n                                                          /*U+2F800-U+2FA1F*/\n  /* Bit 62   Alphabetic Presentation Forms */\n#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS   (1L << 30) /* U+FB00-U+FB4F */\n  /* Bit 63   Arabic Presentation Forms-A */\n#define TT_UCR_ARABIC_PRESENTATIONS_A          (1L << 31) /* U+FB50-U+FDFF */\n  /* Bit 64   Combining Half Marks */\n#define TT_UCR_COMBINING_HALF_MARKS            (1L <<  0) /* U+FE20-U+FE2F */\n  /* Bit 65   Vertical forms          */\n  /*          CJK Compatibility Forms */\n#define TT_UCR_CJK_COMPATIBILITY_FORMS         (1L <<  1) /* U+FE10-U+FE1F */\n                                                          /* U+FE30-U+FE4F */\n  /* Bit 66   Small Form Variants */\n#define TT_UCR_SMALL_FORM_VARIANTS             (1L <<  2) /* U+FE50-U+FE6F */\n  /* Bit 67   Arabic Presentation Forms-B */\n#define TT_UCR_ARABIC_PRESENTATIONS_B          (1L <<  3) /* U+FE70-U+FEFE */\n  /* Bit 68   Halfwidth and Fullwidth Forms */\n#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS       (1L <<  4) /* U+FF00-U+FFEF */\n  /* Bit 69   Specials */\n#define TT_UCR_SPECIALS                        (1L <<  5) /* U+FFF0-U+FFFD */\n  /* Bit 70   Tibetan */\n#define TT_UCR_TIBETAN                         (1L <<  6) /* U+0F00-U+0FFF */\n  /* Bit 71   Syriac */\n#define TT_UCR_SYRIAC                          (1L <<  7) /* U+0700-U+074F */\n  /* Bit 72   Thaana */\n#define TT_UCR_THAANA                          (1L <<  8) /* U+0780-U+07BF */\n  /* Bit 73   Sinhala */\n#define TT_UCR_SINHALA                         (1L <<  9) /* U+0D80-U+0DFF */\n  /* Bit 74   Myanmar */\n#define TT_UCR_MYANMAR                         (1L << 10) /* U+1000-U+109F */\n  /* Bit 75   Ethiopic            */\n  /*          Ethiopic Supplement */\n  /*          Ethiopic Extended   */\n#define TT_UCR_ETHIOPIC                        (1L << 11) /* U+1200-U+137F */\n                                                          /* U+1380-U+139F */\n                                                          /* U+2D80-U+2DDF */\n  /* Bit 76   Cherokee */\n#define TT_UCR_CHEROKEE                        (1L << 12) /* U+13A0-U+13FF */\n  /* Bit 77   Unified Canadian Aboriginal Syllabics */\n#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS   (1L << 13) /* U+1400-U+167F */\n  /* Bit 78   Ogham */\n#define TT_UCR_OGHAM                           (1L << 14) /* U+1680-U+169F */\n  /* Bit 79   Runic */\n#define TT_UCR_RUNIC                           (1L << 15) /* U+16A0-U+16FF */\n  /* Bit 80   Khmer         */\n  /*          Khmer Symbols */\n#define TT_UCR_KHMER                           (1L << 16) /* U+1780-U+17FF */\n                                                          /* U+19E0-U+19FF */\n  /* Bit 81   Mongolian */\n#define TT_UCR_MONGOLIAN                       (1L << 17) /* U+1800-U+18AF */\n  /* Bit 82   Braille Patterns */\n#define TT_UCR_BRAILLE                         (1L << 18) /* U+2800-U+28FF */\n  /* Bit 83   Yi Syllables */\n  /*          Yi Radicals  */\n#define TT_UCR_YI                              (1L << 19) /* U+A000-U+A48F */\n                                                          /* U+A490-U+A4CF */\n  /* Bit 84   Tagalog  */\n  /*          Hanunoo  */\n  /*          Buhid    */\n  /*          Tagbanwa */\n#define TT_UCR_PHILIPPINE                      (1L << 20) /* U+1700-U+171F */\n                                                          /* U+1720-U+173F */\n                                                          /* U+1740-U+175F */\n                                                          /* U+1760-U+177F */\n  /* Bit 85   Old Italic */\n#define TT_UCR_OLD_ITALIC                      (1L << 21) /*U+10300-U+1032F*/\n  /* Bit 86   Gothic */\n#define TT_UCR_GOTHIC                          (1L << 22) /*U+10330-U+1034F*/\n  /* Bit 87   Deseret */\n#define TT_UCR_DESERET                         (1L << 23) /*U+10400-U+1044F*/\n  /* Bit 88   Byzantine Musical Symbols      */\n  /*          Musical Symbols                */\n  /*          Ancient Greek Musical Notation */\n#define TT_UCR_MUSICAL_SYMBOLS                 (1L << 24) /*U+1D000-U+1D0FF*/\n                                                          /*U+1D100-U+1D1FF*/\n                                                          /*U+1D200-U+1D24F*/\n  /* Bit 89   Mathematical Alphanumeric Symbols */\n#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS       (1L << 25) /*U+1D400-U+1D7FF*/\n  /* Bit 90   Private Use (plane 15) */\n  /*          Private Use (plane 16) */\n#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY       (1L << 26) /*U+F0000-U+FFFFD*/\n                                                        /*U+100000-U+10FFFD*/\n  /* Bit 91   Variation Selectors            */\n  /*          Variation Selectors Supplement */\n#define TT_UCR_VARIATION_SELECTORS             (1L << 27) /* U+FE00-U+FE0F */\n                                                          /*U+E0100-U+E01EF*/\n  /* Bit 92   Tags */\n#define TT_UCR_TAGS                            (1L << 28) /*U+E0000-U+E007F*/\n  /* Bit 93   Limbu */\n#define TT_UCR_LIMBU                           (1L << 29) /* U+1900-U+194F */\n  /* Bit 94   Tai Le */\n#define TT_UCR_TAI_LE                          (1L << 30) /* U+1950-U+197F */\n  /* Bit 95   New Tai Lue */\n#define TT_UCR_NEW_TAI_LUE                     (1L << 31) /* U+1980-U+19DF */\n  /* Bit 96   Buginese */\n#define TT_UCR_BUGINESE                        (1L <<  0) /* U+1A00-U+1A1F */\n  /* Bit 97   Glagolitic */\n#define TT_UCR_GLAGOLITIC                      (1L <<  1) /* U+2C00-U+2C5F */\n  /* Bit 98   Tifinagh */\n#define TT_UCR_TIFINAGH                        (1L <<  2) /* U+2D30-U+2D7F */\n  /* Bit 99   Yijing Hexagram Symbols */\n#define TT_UCR_YIJING                          (1L <<  3) /* U+4DC0-U+4DFF */\n  /* Bit 100  Syloti Nagri */\n#define TT_UCR_SYLOTI_NAGRI                    (1L <<  4) /* U+A800-U+A82F */\n  /* Bit 101  Linear B Syllabary */\n  /*          Linear B Ideograms */\n  /*          Aegean Numbers     */\n#define TT_UCR_LINEAR_B                        (1L <<  5) /*U+10000-U+1007F*/\n                                                          /*U+10080-U+100FF*/\n                                                          /*U+10100-U+1013F*/\n  /* Bit 102  Ancient Greek Numbers */\n#define TT_UCR_ANCIENT_GREEK_NUMBERS           (1L <<  6) /*U+10140-U+1018F*/\n  /* Bit 103  Ugaritic */\n#define TT_UCR_UGARITIC                        (1L <<  7) /*U+10380-U+1039F*/\n  /* Bit 104  Old Persian */\n#define TT_UCR_OLD_PERSIAN                     (1L <<  8) /*U+103A0-U+103DF*/\n  /* Bit 105  Shavian */\n#define TT_UCR_SHAVIAN                         (1L <<  9) /*U+10450-U+1047F*/\n  /* Bit 106  Osmanya */\n#define TT_UCR_OSMANYA                         (1L << 10) /*U+10480-U+104AF*/\n  /* Bit 107  Cypriot Syllabary */\n#define TT_UCR_CYPRIOT_SYLLABARY               (1L << 11) /*U+10800-U+1083F*/\n  /* Bit 108  Kharoshthi */\n#define TT_UCR_KHAROSHTHI                      (1L << 12) /*U+10A00-U+10A5F*/\n  /* Bit 109  Tai Xuan Jing Symbols */\n#define TT_UCR_TAI_XUAN_JING                   (1L << 13) /*U+1D300-U+1D35F*/\n  /* Bit 110  Cuneiform                         */\n  /*          Cuneiform Numbers and Punctuation */\n#define TT_UCR_CUNEIFORM                       (1L << 14) /*U+12000-U+123FF*/\n                                                          /*U+12400-U+1247F*/\n  /* Bit 111  Counting Rod Numerals */\n#define TT_UCR_COUNTING_ROD_NUMERALS           (1L << 15) /*U+1D360-U+1D37F*/\n  /* Bit 112  Sundanese */\n#define TT_UCR_SUNDANESE                       (1L << 16) /* U+1B80-U+1BBF */\n  /* Bit 113  Lepcha */\n#define TT_UCR_LEPCHA                          (1L << 17) /* U+1C00-U+1C4F */\n  /* Bit 114  Ol Chiki */\n#define TT_UCR_OL_CHIKI                        (1L << 18) /* U+1C50-U+1C7F */\n  /* Bit 115  Saurashtra */\n#define TT_UCR_SAURASHTRA                      (1L << 19) /* U+A880-U+A8DF */\n  /* Bit 116  Kayah Li */\n#define TT_UCR_KAYAH_LI                        (1L << 20) /* U+A900-U+A92F */\n  /* Bit 117  Rejang */\n#define TT_UCR_REJANG                          (1L << 21) /* U+A930-U+A95F */\n  /* Bit 118  Cham */\n#define TT_UCR_CHAM                            (1L << 22) /* U+AA00-U+AA5F */\n  /* Bit 119  Ancient Symbols */\n#define TT_UCR_ANCIENT_SYMBOLS                 (1L << 23) /*U+10190-U+101CF*/\n  /* Bit 120  Phaistos Disc */\n#define TT_UCR_PHAISTOS_DISC                   (1L << 24) /*U+101D0-U+101FF*/\n  /* Bit 121  Carian */\n  /*          Lycian */\n  /*          Lydian */\n#define TT_UCR_OLD_ANATOLIAN                   (1L << 25) /*U+102A0-U+102DF*/\n                                                          /*U+10280-U+1029F*/\n                                                          /*U+10920-U+1093F*/\n  /* Bit 122  Domino Tiles  */\n  /*          Mahjong Tiles */\n#define TT_UCR_GAME_TILES                      (1L << 26) /*U+1F030-U+1F09F*/\n                                                          /*U+1F000-U+1F02F*/\n  /* Bit 123-127 Reserved for process-internal usage */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some compilers have a very limited length of identifiers.             */\n  /*                                                                       */\n#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )\n#define HAVE_LIMIT_ON_IDENTS\n#endif\n\n\n#ifndef HAVE_LIMIT_ON_IDENTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here some alias #defines in order to be clearer.                      */\n  /*                                                                       */\n  /* These are not always #defined to stay within the 31~character limit   */\n  /* which some compilers have.                                            */\n  /*                                                                       */\n  /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */\n  /* Borland compilers (read: from BC++ 3.1 on) can increase this limit.   */\n  /* If you get a warning with such a compiler, use the -i40 switch.       */\n  /*                                                                       */\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_A      \\\n         TT_UCR_ARABIC_PRESENTATIONS_A\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_B      \\\n         TT_UCR_ARABIC_PRESENTATIONS_B\n\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS      \\\n         TT_UCR_COMBINING_DIACRITICS\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\\n         TT_UCR_COMBINING_DIACRITICS_SYMB\n\n\n#endif /* !HAVE_LIMIT_ON_IDENTS */\n\n\nFT_END_HEADER\n\n#endif /* __TTNAMEID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/tttables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttables.h                                                             */\n/*                                                                         */\n/*    Basic SFNT/TrueType tables definitions and interface                 */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 1996-2005, 2008-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTABLES_H__\n#define __TTTABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueType Tables                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    TrueType specific table types and functions.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of TrueType-specific tables   */\n  /*    as well as some routines used to access and process them.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Header                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType font header table.  All       */\n  /*    fields follow the TrueType specification.                          */\n  /*                                                                       */\n  typedef struct  TT_Header_\n  {\n    FT_Fixed   Table_Version;\n    FT_Fixed   Font_Revision;\n\n    FT_Long    CheckSum_Adjust;\n    FT_Long    Magic_Number;\n\n    FT_UShort  Flags;\n    FT_UShort  Units_Per_EM;\n\n    FT_Long    Created [2];\n    FT_Long    Modified[2];\n\n    FT_Short   xMin;\n    FT_Short   yMin;\n    FT_Short   xMax;\n    FT_Short   yMax;\n\n    FT_UShort  Mac_Style;\n    FT_UShort  Lowest_Rec_PPEM;\n\n    FT_Short   Font_Direction;\n    FT_Short   Index_To_Loc_Format;\n    FT_Short   Glyph_Data_Format;\n\n  } TT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HoriHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType horizontal header, the `hhea' */\n  /*    table, as well as the corresponding horizontal metrics table,      */\n  /*    i.e., the `hmtx' table.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                :: The table version.                       */\n  /*                                                                       */\n  /*    Ascender               :: The font's ascender, i.e., the distance  */\n  /*                              from the baseline to the top-most of all */\n  /*                              glyph points found in the font.          */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoAscender' field */\n  /*                              of the OS/2 table instead if you want    */\n  /*                              the correct one.                         */\n  /*                                                                       */\n  /*    Descender              :: The font's descender, i.e., the distance */\n  /*                              from the baseline to the bottom-most of  */\n  /*                              all glyph points found in the font.  It  */\n  /*                              is negative.                             */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoDescender'      */\n  /*                              field of the OS/2 table instead if you   */\n  /*                              want the correct one.                    */\n  /*                                                                       */\n  /*    Line_Gap               :: The font's line gap, i.e., the distance  */\n  /*                              to add to the ascender and descender to  */\n  /*                              get the BTB, i.e., the                   */\n  /*                              baseline-to-baseline distance for the    */\n  /*                              font.                                    */\n  /*                                                                       */\n  /*    advance_Width_Max      :: This field is the maximum of all advance */\n  /*                              widths found in the font.  It can be     */\n  /*                              used to compute the maximum width of an  */\n  /*                              arbitrary string of text.                */\n  /*                                                                       */\n  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */\n  /*                              `width' of a glyph's bounding box) for   */\n  /*                              all glyphs in the font.                  */\n  /*                                                                       */\n  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */\n  /*                              slope of the cursor (slope=rise/run).    */\n  /*                                                                       */\n  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */\n  /*                              slope.                                   */\n  /*                                                                       */\n  /*    Reserved               :: 8~reserved bytes.                        */\n  /*                                                                       */\n  /*    metric_Data_Format     :: Always~0.                                */\n  /*                                                                       */\n  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */\n  /*                              table -- this value can be smaller than  */\n  /*                              the total number of glyphs in the font.  */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_HoriHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Width_Max;      /* advance width maximum */\n\n    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */\n    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */\n    FT_Short   xMax_Extent;            /* xmax extents          */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_HMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they are used to connect the metrics header to the relevant    */\n    /* `HMTX' table.                                                      */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_HoriHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_VertHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType vertical header, the `vhea'   */\n  /*    table, as well as the corresponding vertical metrics table, i.e.,  */\n  /*    the `vmtx' table.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                 :: The table version.                      */\n  /*                                                                       */\n  /*    Ascender                :: The font's ascender, i.e., the distance */\n  /*                               from the baseline to the top-most of    */\n  /*                               all glyph points found in the font.     */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoAscender'      */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Descender               :: The font's descender, i.e., the         */\n  /*                               distance from the baseline to the       */\n  /*                               bottom-most of all glyph points found   */\n  /*                               in the font.  It is negative.           */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoDescender'     */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Line_Gap                :: The font's line gap, i.e., the distance */\n  /*                               to add to the ascender and descender to */\n  /*                               get the BTB, i.e., the                  */\n  /*                               baseline-to-baseline distance for the   */\n  /*                               font.                                   */\n  /*                                                                       */\n  /*    advance_Height_Max      :: This field is the maximum of all        */\n  /*                               advance heights found in the font.  It  */\n  /*                               can be used to compute the maximum      */\n  /*                               height of an arbitrary string of text.  */\n  /*                                                                       */\n  /*    min_Top_Side_Bearing    :: The minimum top side bearing of all     */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    min_Bottom_Side_Bearing :: The minimum bottom side bearing of all  */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    yMax_Extent             :: The maximum vertical extent (i.e., the  */\n  /*                               `height' of a glyph's bounding box) for */\n  /*                               all glyphs in the font.                 */\n  /*                                                                       */\n  /*    caret_Slope_Rise        :: The rise coefficient of the cursor's    */\n  /*                               slope of the cursor (slope=rise/run).   */\n  /*                                                                       */\n  /*    caret_Slope_Run         :: The run coefficient of the cursor's     */\n  /*                               slope.                                  */\n  /*                                                                       */\n  /*    caret_Offset            :: The cursor's offset for slanted fonts.  */\n  /*                               This value is `reserved' in vmtx        */\n  /*                               version 1.0.                            */\n  /*                                                                       */\n  /*    Reserved                :: 8~reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format      :: Always~0.                               */\n  /*                                                                       */\n  /*    number_Of_HMetrics      :: Number of VMetrics entries in the       */\n  /*                               `vmtx' table -- this value can be       */\n  /*                               smaller than the total number of glyphs */\n  /*                               in the font.                            */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_VertHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Height_Max;      /* advance height maximum */\n\n    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */\n    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */\n    FT_Short   yMax_Extent;             /* xmax or ymax extents            */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_VMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they're used to connect the metrics header to the relevant     */\n    /* `HMTX' or `VMTX' table.                                            */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_VertHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_OS2                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType OS/2 table. This is the long  */\n  /*    table version.  All fields comply to the TrueType specification.   */\n  /*                                                                       */\n  /*    Note that we now support old Mac fonts which do not include an     */\n  /*    OS/2 table.  In this case, the `version' field is always set to    */\n  /*    0xFFFF.                                                            */\n  /*                                                                       */\n  typedef struct  TT_OS2_\n  {\n    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */\n    FT_Short   xAvgCharWidth;\n    FT_UShort  usWeightClass;\n    FT_UShort  usWidthClass;\n    FT_Short   fsType;\n    FT_Short   ySubscriptXSize;\n    FT_Short   ySubscriptYSize;\n    FT_Short   ySubscriptXOffset;\n    FT_Short   ySubscriptYOffset;\n    FT_Short   ySuperscriptXSize;\n    FT_Short   ySuperscriptYSize;\n    FT_Short   ySuperscriptXOffset;\n    FT_Short   ySuperscriptYOffset;\n    FT_Short   yStrikeoutSize;\n    FT_Short   yStrikeoutPosition;\n    FT_Short   sFamilyClass;\n\n    FT_Byte    panose[10];\n\n    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */\n    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */\n    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */\n    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */\n\n    FT_Char    achVendID[4];\n\n    FT_UShort  fsSelection;\n    FT_UShort  usFirstCharIndex;\n    FT_UShort  usLastCharIndex;\n    FT_Short   sTypoAscender;\n    FT_Short   sTypoDescender;\n    FT_Short   sTypoLineGap;\n    FT_UShort  usWinAscent;\n    FT_UShort  usWinDescent;\n\n    /* only version 1 tables: */\n\n    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */\n    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */\n\n    /* only version 2 tables: */\n\n    FT_Short   sxHeight;\n    FT_Short   sCapHeight;\n    FT_UShort  usDefaultChar;\n    FT_UShort  usBreakChar;\n    FT_UShort  usMaxContext;\n\n  } TT_OS2;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Postscript                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PostScript table.  All fields */\n  /*    comply to the TrueType specification.  This structure does not     */\n  /*    reference the PostScript glyph names, which can be nevertheless    */\n  /*    accessed with the `ttpost' module.                                 */\n  /*                                                                       */\n  typedef struct  TT_Postscript_\n  {\n    FT_Fixed  FormatType;\n    FT_Fixed  italicAngle;\n    FT_Short  underlinePosition;\n    FT_Short  underlineThickness;\n    FT_ULong  isFixedPitch;\n    FT_ULong  minMemType42;\n    FT_ULong  maxMemType42;\n    FT_ULong  minMemType1;\n    FT_ULong  maxMemType1;\n\n    /* Glyph names follow in the file, but we don't   */\n    /* load them by default.  See the ttpost.c file.  */\n\n  } TT_Postscript;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_PCLT                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PCLT table.  All fields       */\n  /*    comply to the TrueType specification.                              */\n  /*                                                                       */\n  typedef struct  TT_PCLT_\n  {\n    FT_Fixed   Version;\n    FT_ULong   FontNumber;\n    FT_UShort  Pitch;\n    FT_UShort  xHeight;\n    FT_UShort  Style;\n    FT_UShort  TypeFamily;\n    FT_UShort  CapHeight;\n    FT_UShort  SymbolSet;\n    FT_Char    TypeFace[16];\n    FT_Char    CharacterComplement[8];\n    FT_Char    FileName[6];\n    FT_Char    StrokeWeight;\n    FT_Char    WidthType;\n    FT_Byte    SerifStyle;\n    FT_Byte    Reserved;\n\n  } TT_PCLT;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The maximum profile is a table containing many max values which    */\n  /*    can be used to pre-allocate arrays.  This ensures that no memory   */\n  /*    allocation occurs during a glyph load.                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version               :: The version number.                       */\n  /*                                                                       */\n  /*    numGlyphs             :: The number of glyphs in this TrueType     */\n  /*                             font.                                     */\n  /*                                                                       */\n  /*    maxPoints             :: The maximum number of points in a         */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositePoints'.                     */\n  /*                                                                       */\n  /*    maxContours           :: The maximum number of contours in a       */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositeContours'.                   */\n  /*                                                                       */\n  /*    maxCompositePoints    :: The maximum number of points in a         */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxPoints'.            */\n  /*                                                                       */\n  /*    maxCompositeContours  :: The maximum number of contours in a       */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxContours'.          */\n  /*                                                                       */\n  /*    maxZones              :: The maximum number of zones used for      */\n  /*                             glyph hinting.                            */\n  /*                                                                       */\n  /*    maxTwilightPoints     :: The maximum number of points in the       */\n  /*                             twilight zone used for glyph hinting.     */\n  /*                                                                       */\n  /*    maxStorage            :: The maximum number of elements in the     */\n  /*                             storage area used for glyph hinting.      */\n  /*                                                                       */\n  /*    maxFunctionDefs       :: The maximum number of function            */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxInstructionDefs    :: The maximum number of instruction         */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxStackElements      :: The maximum number of stack elements used */\n  /*                             during bytecode interpretation.           */\n  /*                                                                       */\n  /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */\n  /*                             used for glyph hinting.                   */\n  /*                                                                       */\n  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */\n  /*                             composite) glyphs in a composite glyph.   */\n  /*                                                                       */\n  /*    maxComponentDepth     :: The maximum nesting depth of composite    */\n  /*                             glyphs.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is only used during font loading.                   */\n  /*                                                                       */\n  typedef struct  TT_MaxProfile_\n  {\n    FT_Fixed   version;\n    FT_UShort  numGlyphs;\n    FT_UShort  maxPoints;\n    FT_UShort  maxContours;\n    FT_UShort  maxCompositePoints;\n    FT_UShort  maxCompositeContours;\n    FT_UShort  maxZones;\n    FT_UShort  maxTwilightPoints;\n    FT_UShort  maxStorage;\n    FT_UShort  maxFunctionDefs;\n    FT_UShort  maxInstructionDefs;\n    FT_UShort  maxStackElements;\n    FT_UShort  maxSizeOfInstructions;\n    FT_UShort  maxComponentElements;\n    FT_UShort  maxComponentDepth;\n\n  } TT_MaxProfile;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Sfnt_Tag                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify the index of an SFNT table.         */\n  /*    Used in the @FT_Get_Sfnt_Table API function.                       */\n  /*                                                                       */\n  typedef enum  FT_Sfnt_Tag_\n  {\n    ft_sfnt_head = 0,    /* TT_Header     */\n    ft_sfnt_maxp = 1,    /* TT_MaxProfile */\n    ft_sfnt_os2  = 2,    /* TT_OS2        */\n    ft_sfnt_hhea = 3,    /* TT_HoriHeader */\n    ft_sfnt_vhea = 4,    /* TT_VertHeader */\n    ft_sfnt_post = 5,    /* TT_Postscript */\n    ft_sfnt_pclt = 6,    /* TT_PCLT       */\n\n    sfnt_max   /* internal end mark */\n\n  } FT_Sfnt_Tag;\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pointer to a given SFNT table within a face.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source.                                    */\n  /*                                                                       */\n  /*    tag  :: The index of the SFNT table.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A type-less pointer to the table.  This will be~0 in case of       */\n  /*    error, or if the corresponding table was not found *OR* loaded     */\n  /*    from the file.                                                     */\n  /*                                                                       */\n  /*    Use a typecast according to `tag' to access the structure          */\n  /*    elements.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The table is owned by the face object and disappears with it.      */\n  /*                                                                       */\n  /*    This function is only useful to access SFNT tables that are loaded */\n  /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */\n  /*    a list.                                                            */\n  /*                                                                       */\n  /*    Here an example how to access the `vhea' table:                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      TT_VertHeader*  vert_header;                                     */\n  /*                                                                       */\n  /*                                                                       */\n  /*      vert_header =                                                    */\n  /*        (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea );       */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Load_Sfnt_Table\n  *\n  * @description:\n  *   Load any font table into client memory.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   tag ::\n  *     The four-byte tag of the table to load.  Use the value~0 if you want\n  *     to access the whole font file.  Otherwise, you can use one of the\n  *     definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new\n  *     one with @FT_MAKE_TAG.\n  *\n  *   offset ::\n  *     The starting offset in the table (or file if tag == 0).\n  *\n  * @output:\n  *   buffer ::\n  *     The target buffer address.  The client must ensure that the memory\n  *     array is big enough to hold the data.\n  *\n  * @inout:\n  *   length ::\n  *     If the `length' parameter is NULL, then try to load the whole table.\n  *     Return an error code if it fails.\n  *\n  *     Else, if `*length' is~0, exit immediately while returning the\n  *     table's (or file) full size in it.\n  *\n  *     Else the number of bytes to read from the table or file, from the\n  *     starting offset.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If you need to determine the table's length you should first call this\n  *   function with `*length' set to~0, as in the following example:\n  *\n  *     {\n  *       FT_ULong  length = 0;\n  *\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );\n  *       if ( error ) { ... table does not exist ... }\n  *\n  *       buffer = malloc( length );\n  *       if ( buffer == NULL ) { ... not enough memory ... }\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );\n  *       if ( error ) { ... could not load table ... }\n  *     }\n  */\n  FT_EXPORT( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Sfnt_Table_Info\n  *\n  * @description:\n  *   Return information on an SFNT table.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   table_index ::\n  *     The index of an SFNT table.  The function returns\n  *     FT_Err_Table_Missing for an invalid value.\n  *\n  * @inout:\n  *   tag ::\n  *     The name tag of the SFNT table.  If the value is NULL, `table_index'\n  *     is ignored, and `length' returns the number of SFNT tables in the\n  *     font.\n  *\n  * @output:\n  *   length ::\n  *     The length of the SFNT table (or the number of SFNT tables, depending\n  *     on `tag').\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   While parsing fonts, FreeType handles SFNT tables with length zero as\n  *   missing.\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */\n  /*    language ID values are in `freetype/ttnameid.h'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */\n  /*    TrueType/sfnt face, just return~0 as the default value.            */\n  /*                                                                       */\n  /*    For a format~14 cmap (to access Unicode IVS), the return value is  */\n  /*    0xFFFFFFFF.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap format.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The format of `charmap'.  If `charmap' doesn't belong to a         */\n  /*    TrueType/sfnt face, return -1.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTTABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/tttags.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttags.h                                                               */\n/*                                                                         */\n/*    Tags for TrueType and OpenType tables (specification only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTAGS_H__\n#define __TTAGS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )\n#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )\n#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )\n#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )\n#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )\n#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )\n#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )\n#define TTAG_CBDT  FT_MAKE_TAG( 'C', 'B', 'D', 'T' )\n#define TTAG_CBLC  FT_MAKE_TAG( 'C', 'B', 'L', 'C' )\n#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )\n#define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )\n#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )\n#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )\n#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )\n#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )\n#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )\n#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )\n#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )\n#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )\n#define TTAG_FOND  FT_MAKE_TAG( 'F', 'O', 'N', 'D' )\n#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )\n#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )\n#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )\n#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )\n#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )\n#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )\n#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )\n#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )\n#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )\n#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )\n#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )\n#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )\n#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )\n#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )\n#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )\n#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )\n#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )\n#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )\n#define TTAG_LWFN  FT_MAKE_TAG( 'L', 'W', 'F', 'N' )\n#define TTAG_MATH  FT_MAKE_TAG( 'M', 'A', 'T', 'H' )\n#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )\n#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )\n#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )\n#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )\n#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )\n#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )\n#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )\n#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )\n#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )\n#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )\n#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )\n#define TTAG_POST  FT_MAKE_TAG( 'P', 'O', 'S', 'T' )\n#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )\n#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )\n#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )\n#define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )\n#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )\n#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )\n#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )\n#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )\n#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )\n#define TTAG_TYP1  FT_MAKE_TAG( 'T', 'Y', 'P', '1' )\n#define TTAG_typ1  FT_MAKE_TAG( 't', 'y', 'p', '1' )\n#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )\n#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )\n#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )\n\n\nFT_END_HEADER\n\n#endif /* __TTAGS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/freetype2/freetype/ttunpat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttunpat.h                                                              */\n/*                                                                         */\n/*    Definitions for the unpatented TrueType hinting system               */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by Graham Asher <graham.asher@btinternet.com>                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTUNPAT_H__\n#define __TTUNPAT_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_UNPATENTED_HINTING\n  *\n  * @description:\n  *   A constant used as the tag of an @FT_Parameter structure to indicate\n  *   that unpatented methods only should be used by the TrueType bytecode\n  *   interpreter for a typeface opened by @FT_Open_Face.\n  *\n  */\n#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __TTUNPAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/android/ft2build.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ft2build.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2006 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This is a Unix-specific version of <ft2build.h> that should be used   */\n  /* exclusively *after* installation of the library.                      */\n  /*                                                                       */\n  /* It assumes that `/usr/local/include/freetype2' (or whatever is        */\n  /* returned by the `freetype-config --cflags' or `pkg-config --cflags'   */\n  /* command) is in your compilation include path.                         */\n  /*                                                                       */\n  /* We don't need to do anything special in this release.  However, for   */\n  /* a future FreeType 2 release, the following installation changes will  */\n  /* be performed:                                                         */\n  /*                                                                       */\n  /*   - The contents of `freetype-2.x/include/freetype' will be installed */\n  /*     to `/usr/local/include/freetype2' instead of                      */\n  /*     `/usr/local/include/freetype2/freetype'.                          */\n  /*                                                                       */\n  /*   - This file will #include <freetype2/config/ftheader.h>, instead    */\n  /*     of <freetype/config/ftheader.h>.                                  */\n  /*                                                                       */\n  /*   - The contents of `ftheader.h' will be processed with `sed' to      */\n  /*     replace all `<freetype/xxx>' with `<freetype2/xxx>'.              */\n  /*                                                                       */\n  /*   - Adding `/usr/local/include/freetype2' to your compilation include */\n  /*     path will not be necessary anymore.                               */\n  /*                                                                       */\n  /* These changes will be transparent to client applications which use    */\n  /* freetype-config (or pkg-config).  No modifications will be necessary  */\n  /* to compile with the new scheme.                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FT2_BUILD_UNIX_H__\n#define __FT2_BUILD_UNIX_H__\n\n  /* `<prefix>/include/freetype2' must be in your current inclusion path */\n#include <freetype/config/ftheader.h>\n\n#endif /* __FT2_BUILD_UNIX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/config/ftconfig.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftconfig.h                                                             */\n/*                                                                         */\n/*    ANSI-specific configuration file (specification only).               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This header file contains a number of macro definitions that are used */\n  /* by the rest of the engine.  Most of the macros here are automatically */\n  /* determined at compile time, and you should not need to change it to   */\n  /* port FreeType, except to compile the library with a non-ANSI          */\n  /* compiler.                                                             */\n  /*                                                                       */\n  /* Note however that if some specific modifications are needed, we       */\n  /* advise you to place a modified copy in your build directory.          */\n  /*                                                                       */\n  /* The build directory is usually `freetype/builds/<system>', and        */\n  /* contains system-specific files that are always included first when    */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* This ANSI version should stay in `include/freetype/config'.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FTCONFIG_H__\n#define __FTCONFIG_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_OPTIONS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* These macros can be toggled to suit a specific system.  The current   */\n  /* ones are defaults used to compile FreeType in an ANSI C environment   */\n  /* (16bit compilers are also supported).  Copy this file to your own     */\n  /* `freetype/builds/<system>' directory, and edit it to port the engine. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* There are systems (like the Texas Instruments 'C54x) where a `char' */\n  /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */\n  /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */\n  /* is probably unexpected.                                             */\n  /*                                                                     */\n  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */\n  /* `char' type.                                                        */\n\n#ifndef FT_CHAR_BIT\n#define FT_CHAR_BIT  CHAR_BIT\n#endif\n\n\n  /* The size of an `int' type.  */\n#if                                 FT_UINT_MAX == 0xFFFFUL\n#define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)\n#elif                               FT_UINT_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)\n#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `int' type!\"\n#endif\n\n  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */\n  /* DM642) is recognized but avoided.                                   */\n#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `long' type!\"\n#endif\n\n\n  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */\n  /* used -- this is only used to get rid of unpleasant compiler warnings */\n#ifndef FT_UNUSED\n#define FT_UNUSED( arg )  ( (arg) = (arg) )\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     AUTOMATIC CONFIGURATION MACROS                    */\n  /*                                                                       */\n  /* These macros are computed from the ones defined above.  Don't touch   */\n  /* their definition, unless you know precisely what you are doing.  No   */\n  /* porter should need to mess with them.                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Mac support                                                           */\n  /*                                                                       */\n  /*   This is the only necessary change, so it is defined here instead    */\n  /*   providing a new configuration file.                                 */\n  /*                                                                       */\n#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )\n  /* no Carbon frameworks for 64bit 10.4.x */\n  /* AvailabilityMacros.h is available since Mac OS X 10.2,        */\n  /* so guess the system version by maximum errno before inclusion */\n#include <errno.h>\n#ifdef ECANCELED /* defined since 10.2 */\n#include \"AvailabilityMacros.h\"\n#endif\n#if defined( __LP64__ ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )\n#undef FT_MACINTOSH\n#endif\n\n#elif defined( __SC__ ) || defined( __MRC__ )\n  /* Classic MacOS compilers */\n#include \"ConditionalMacros.h\"\n#if TARGET_OS_MAC\n#define FT_MACINTOSH 1\n#endif\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int16                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit signed integer type.                         */\n  /*                                                                       */\n  typedef signed short  FT_Int16;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt16                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit unsigned integer type.                       */\n  /*                                                                       */\n  typedef unsigned short  FT_UInt16;\n\n  /* */\n\n\n  /* this #if 0 ... #endif clause is for documentation purposes */\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int32                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 32bit signed integer type.  The size depends on    */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef signed XXX  FT_Int32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt32                                                          */\n  /*                                                                       */\n  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int64                                                           */\n  /*                                                                       */\n  /*    A typedef for a 64bit signed integer type.  The size depends on    */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef signed XXX  FT_Int64;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt64                                                          */\n  /*                                                                       */\n  /*    A typedef for a 64bit unsigned integer type.  The size depends on  */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt64;\n\n  /* */\n\n#endif\n\n#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)\n\n  typedef signed int      FT_Int32;\n  typedef unsigned int    FT_UInt32;\n\n#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)\n\n  typedef signed long     FT_Int32;\n  typedef unsigned long   FT_UInt32;\n\n#else\n#error \"no 32bit type found -- please check your configuration files\"\n#endif\n\n\n  /* look up an integer type that is at least 32 bits */\n#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)\n\n  typedef int            FT_Fast;\n  typedef unsigned int   FT_UFast;\n\n#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)\n\n  typedef long           FT_Fast;\n  typedef unsigned long  FT_UFast;\n\n#endif\n\n\n  /* determine whether we have a 64-bit int type for platforms without */\n  /* Autoconf                                                          */\n#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)\n\n  /* FT_LONG64 must be defined if a 64-bit type is available */\n#define FT_LONG64\n#define FT_INT64   long\n#define FT_UINT64  unsigned long\n\n#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __BORLANDC__ )  /* Borland C++ */\n\n  /* XXXX: We should probably check the value of __BORLANDC__ in order */\n  /*       to test the compiler version.                               */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __WATCOMC__ )   /* Watcom C++ */\n\n  /* Watcom doesn't provide 64-bit data types */\n\n#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */\n\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#elif defined( __GNUC__ )\n\n  /* GCC provides the `long long' type */\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A 64-bit data type will create compilation problems if you compile    */\n  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */\n  /* is defined.  You can however ignore this rule by defining the         */\n  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */\n  /*                                                                       */\n#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )\n\n#ifdef __STDC__\n\n  /* undefine the 64-bit macros in strict ANSI compilation mode */\n#undef FT_LONG64\n#undef FT_INT64\n\n#endif /* __STDC__ */\n\n#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */\n\n#ifdef FT_LONG64\n  typedef FT_INT64   FT_Int64;\n  typedef FT_UINT64  FT_UInt64;\n#endif\n\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT\n\n\n#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER\n  /* Provide assembler fragments for performance-critical functions. */\n  /* These must be defined `static __inline__' with GCC.             */\n\n#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm\n    {\n      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */\n      mov   a,  t,  asr #31         /* a   = (hi >> 31) */\n      add   a,  a,  #0x8000         /* a  += 0x8000 */\n      adds  t2, t2, a               /* t2 += a */\n      adc   t,  t,  #0              /* t  += carry */\n      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */\n      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */\n    }\n    return a;\n  }\n\n#endif /* __CC_ARM || __ARMCC__ */\n\n\n#ifdef __GNUC__\n\n#if defined( __arm__ ) && !defined( __thumb__ )    && \\\n    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm__ __volatile__ (\n      \"smull  %1, %2, %4, %3\\n\\t\"       /* (lo=%1,hi=%2) = a*b */\n      \"mov    %0, %2, asr #31\\n\\t\"      /* %0  = (hi >> 31) */\n      \"add    %0, %0, #0x8000\\n\\t\"      /* %0 += 0x8000 */\n      \"adds   %1, %1, %0\\n\\t\"           /* %1 += %0 */\n      \"adc    %2, %2, #0\\n\\t\"           /* %2 += carry */\n      \"mov    %0, %1, lsr #16\\n\\t\"      /* %0  = %1 >> 16 */\n      \"orr    %0, %0, %2, lsl #16\\n\\t\"  /* %0 |= %2 << 16 */\n      : \"=r\"(a), \"=&r\"(t2), \"=&r\"(t)\n      : \"r\"(a), \"r\"(b)\n      : \"cc\" );\n    return a;\n  }\n\n#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */\n\n#if defined( __i386__ )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n\n    __asm__ __volatile__ (\n      \"imul  %%edx\\n\"\n      \"movl  %%edx, %%ecx\\n\"\n      \"sarl  $31, %%ecx\\n\"\n      \"addl  $0x8000, %%ecx\\n\"\n      \"addl  %%ecx, %%eax\\n\"\n      \"adcl  $0, %%edx\\n\"\n      \"shrl  $16, %%eax\\n\"\n      \"shll  $16, %%edx\\n\"\n      \"addl  %%edx, %%eax\\n\"\n      : \"=a\"(result), \"=d\"(b)\n      : \"a\"(a), \"d\"(b)\n      : \"%ecx\", \"cc\" );\n    return result;\n  }\n\n#endif /* i386 */\n\n#endif /* __GNUC__ */\n\n\n#ifdef _MSC_VER /* Visual C++ */\n\n#ifdef _M_IX86\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n    __asm\n    {\n      mov eax, a\n      mov edx, b\n      imul edx\n      mov ecx, edx\n      sar ecx, 31\n      add ecx, 8000h\n      add eax, ecx\n      adc edx, 0\n      shr eax, 16\n      shl edx, 16\n      add eax, edx\n      mov result, eax\n    }\n    return result;\n  }\n\n#endif /* _M_IX86 */\n\n#endif /* _MSC_VER */\n\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n#ifdef FT_CONFIG_OPTION_INLINE_MULFIX\n#ifdef FT_MULFIX_ASSEMBLER\n#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER\n#endif\n#endif\n\n\n#ifdef FT_MAKE_OPTION_SINGLE_OBJECT\n\n#define FT_LOCAL( x )      static  x\n#define FT_LOCAL_DEF( x )  static  x\n\n#else\n\n#ifdef __cplusplus\n#define FT_LOCAL( x )      extern \"C\"  x\n#define FT_LOCAL_DEF( x )  extern \"C\"  x\n#else\n#define FT_LOCAL( x )      extern  x\n#define FT_LOCAL_DEF( x )  x\n#endif\n\n#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */\n\n\n#ifndef FT_BASE\n\n#ifdef __cplusplus\n#define FT_BASE( x )  extern \"C\"  x\n#else\n#define FT_BASE( x )  extern  x\n#endif\n\n#endif /* !FT_BASE */\n\n\n#ifndef FT_BASE_DEF\n\n#ifdef __cplusplus\n#define FT_BASE_DEF( x )  x\n#else\n#define FT_BASE_DEF( x )  x\n#endif\n\n#endif /* !FT_BASE_DEF */\n\n\n#ifndef FT_EXPORT\n\n#ifdef __cplusplus\n#define FT_EXPORT( x )  extern \"C\"  x\n#else\n#define FT_EXPORT( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT */\n\n\n#ifndef FT_EXPORT_DEF\n\n#ifdef __cplusplus\n#define FT_EXPORT_DEF( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_DEF( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_DEF */\n\n\n#ifndef FT_EXPORT_VAR\n\n#ifdef __cplusplus\n#define FT_EXPORT_VAR( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_VAR */\n\n  /* The following macros are needed to compile the library with a   */\n  /* C++ compiler and with 16bit compilers.                          */\n  /*                                                                 */\n\n  /* This is special.  Within C++, you must specify `extern \"C\"' for */\n  /* functions which are used via function pointers, and you also    */\n  /* must do that for structures which contain function pointers to  */\n  /* assure C linkage -- it's not possible to have (local) anonymous */\n  /* functions which are accessed by (global) function pointers.     */\n  /*                                                                 */\n  /*                                                                 */\n  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */\n  /* contains pointers to callback functions.                        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */\n  /* that contains pointers to callback functions.                   */\n  /*                                                                 */\n  /*                                                                 */\n  /* Some 16bit compilers have to redefine these macros to insert    */\n  /* the infamous `_cdecl' or `__fastcall' declarations.             */\n  /*                                                                 */\n#ifndef FT_CALLBACK_DEF\n#ifdef __cplusplus\n#define FT_CALLBACK_DEF( x )  extern \"C\"  x\n#else\n#define FT_CALLBACK_DEF( x )  static  x\n#endif\n#endif /* FT_CALLBACK_DEF */\n\n#ifndef FT_CALLBACK_TABLE\n#ifdef __cplusplus\n#define FT_CALLBACK_TABLE      extern \"C\"\n#define FT_CALLBACK_TABLE_DEF  extern \"C\"\n#else\n#define FT_CALLBACK_TABLE      extern\n#define FT_CALLBACK_TABLE_DEF  /* nothing */\n#endif\n#endif /* FT_CALLBACK_TABLE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCONFIG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/config/ftheader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftheader.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_HEADER_H__\n#define __FT_HEADER_H__\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_BEGIN_HEADER                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_END_HEADER in header    */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_BEGIN_HEADER  extern \"C\" {\n#else\n#define FT_BEGIN_HEADER  /* nothing */\n#endif\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_END_HEADER                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_BEGIN_HEADER in header  */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_END_HEADER  }\n#else\n#define FT_END_HEADER  /* nothing */\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Aliases for the FreeType 2 public and configuration files.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_file_macros                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Header File Macros                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Macro definitions used to #include specific header files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following macros are defined to the name of specific           */\n  /*    FreeType~2 header files.  They can be used directly in #include    */\n  /*    statements as in:                                                  */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_MULTIPLE_MASTERS_H                                   */\n  /*      #include FT_GLYPH_H                                              */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    There are several reasons why we are now using macros to name      */\n  /*    public header files.  The first one is that such macros are not    */\n  /*    limited to the infamous 8.3~naming rule required by DOS (and       */\n  /*    `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').   */\n  /*                                                                       */\n  /*    The second reason is that it allows for more flexibility in the    */\n  /*    way FreeType~2 is installed on a given system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* configuration files */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_CONFIG_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 configuration data.\n   *\n   */\n#ifndef FT_CONFIG_CONFIG_H\n#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_STANDARD_LIBRARY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 interface to the standard C library functions.\n   *\n   */\n#ifndef FT_CONFIG_STANDARD_LIBRARY_H\n#define FT_CONFIG_STANDARD_LIBRARY_H  <freetype/config/ftstdlib.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_OPTIONS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 project-specific configuration options.\n   *\n   */\n#ifndef FT_CONFIG_OPTIONS_H\n#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_MODULES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 modules that are statically linked to new library\n   *   instances in @FT_Init_FreeType.\n   *\n   */\n#ifndef FT_CONFIG_MODULES_H\n#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>\n#endif\n\n  /* */\n\n  /* public headers */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_FREETYPE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   base FreeType~2 API.\n   *\n   */\n#define FT_FREETYPE_H  <freetype/freetype.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 error codes (and messages).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_ERRORS_H  <freetype/fterrors.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 module error offsets (and messages).\n   *\n   */\n#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYSTEM_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 interface to low-level operations (i.e., memory management\n   *   and stream i/o).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_SYSTEM_H  <freetype/ftsystem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing type\n   *   definitions related to glyph images (i.e., bitmaps, outlines,\n   *   scan-converter parameters).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_IMAGE_H  <freetype/ftimage.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   basic data types defined by FreeType~2.\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_TYPES_H  <freetype/fttypes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LIST_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list management API of FreeType~2.\n   *\n   *   (Most applications will never need to include this file.)\n   *\n   */\n#define FT_LIST_H  <freetype/ftlist.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OUTLINE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   scalable outline management API of FreeType~2.\n   *\n   */\n#define FT_OUTLINE_H  <freetype/ftoutln.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SIZES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API which manages multiple @FT_Size objects per face.\n   *\n   */\n#define FT_SIZES_H  <freetype/ftsizes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   module management API of FreeType~2.\n   *\n   */\n#define FT_MODULE_H  <freetype/ftmodapi.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_RENDER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   renderer module management API of FreeType~2.\n   *\n   */\n#define FT_RENDER_H  <freetype/ftrender.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_AUTOHINTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the auto-hinting module.\n   *\n   */\n#define FT_AUTOHINTER_H  <freetype/ftautoh.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CFF_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the CFF driver module.\n   *\n   */\n#define FT_CFF_DRIVER_H  <freetype/ftcffdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the TrueType driver module.\n   *\n   */\n#define FT_TRUETYPE_DRIVER_H  <freetype/ftttdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPE1_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the Type~1 format.\n   *\n   */\n#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_IDS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   enumeration values which identify name strings, languages, encodings,\n   *   etc.  This file really contains a _large_ set of constant macro\n   *   definitions, taken from the TrueType and OpenType specifications.\n   *\n   */\n#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the TrueType (as well as OpenType) format.\n   *\n   */\n#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TAGS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of TrueType four-byte `tags' which identify blocks in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BDF_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which accesses BDF-specific strings from a\n   *   face.\n   *\n   */\n#define FT_BDF_H  <freetype/ftbdf.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CID_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which access CID font information from a\n   *   face.\n   *\n   */\n#define FT_CID_H  <freetype/ftcid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GZIP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports gzip-compressed files.\n   *\n   */\n#define FT_GZIP_H  <freetype/ftgzip.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LZW_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports LZW-compressed files.\n   *\n   */\n#define FT_LZW_H  <freetype/ftlzw.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BZIP2_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports bzip2-compressed files.\n   *\n   */\n#define FT_BZIP2_H  <freetype/ftbzip2.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_WINFONTS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports Windows FNT files.\n   *\n   */\n#define FT_WINFONTS_H   <freetype/ftwinfnt.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GLYPH_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional glyph management component.\n   *\n   */\n#define FT_GLYPH_H  <freetype/ftglyph.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BITMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional bitmap conversion component.\n   *\n   */\n#define FT_BITMAP_H  <freetype/ftbitmap.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BBOX_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional exact bounding box computation routines.\n   *\n   */\n#define FT_BBOX_H  <freetype/ftbbox.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional FreeType~2 cache sub-system.\n   *\n   */\n#define FT_CACHE_H  <freetype/ftcache.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `glyph image' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for @FT_Glyph elements.  You can also\n   *   use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to\n   *   store small glyph bitmaps, as it will use less memory.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   glyph image-related cache declarations.\n   *\n   */\n#define FT_CACHE_IMAGE_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_SMALL_BITMAPS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `small bitmaps' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for small glyph bitmaps in a relatively\n   *   memory-efficient way.  You can also use the API defined in\n   *   @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,\n   *   including scalable outlines.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   small bitmaps-related cache declarations.\n   *\n   */\n#define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_CHARMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `charmap' API of the FreeType~2 cache sub-system.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   charmap-based cache declarations.\n   *\n   */\n#define FT_CACHE_CHARMAP_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MAC_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   Macintosh-specific FreeType~2 API.  The latter is used to access\n   *   fonts embedded in resource forks.\n   *\n   *   This header file must be explicitly included by client applications\n   *   compiled on the Mac (note that the base API still works though).\n   *\n   */\n#define FT_MAC_H  <freetype/ftmac.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MULTIPLE_MASTERS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional multiple-masters management API of FreeType~2.\n   *\n   */\n#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SFNT_NAMES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which accesses embedded `name' strings in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OPENTYPE_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates OpenType tables (BASE, GDEF,\n   *   GPOS, GSUB, JSTF).\n   *\n   */\n#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GX_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,\n   *   mort, morx, bsln, just, kern, opbd, trak, prop).\n   *\n   */\n#define FT_GX_VALIDATE_H  <freetype/ftgxval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_PFR_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which accesses PFR-specific data.\n   *\n   */\n#define FT_PFR_H  <freetype/ftpfr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_STROKER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions to stroke outline paths.\n   */\n#define FT_STROKER_H  <freetype/ftstroke.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYNTHESIS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs artificial obliquing and emboldening.\n   */\n#define FT_SYNTHESIS_H  <freetype/ftsynth.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_XFREE86_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions specific to the XFree86 and\n   *   X.Org X11 servers.\n   */\n#define FT_XFREE86_H  <freetype/ftxf86.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRIGONOMETRY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs trigonometric computations (e.g.,\n   *   cosines and arc tangents).\n   */\n#define FT_TRIGONOMETRY_H  <freetype/fttrigon.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LCD_FILTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_LCD_FILTER_H  <freetype/ftlcdfil.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_UNPATENTED_HINTING_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_UNPATENTED_HINTING_H  <freetype/ttunpat.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_INCREMENTAL_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_INCREMENTAL_H  <freetype/ftincrem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GASP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns entries from the TrueType GASP table.\n   */\n#define FT_GASP_H  <freetype/ftgasp.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ADVANCES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns individual and ranged glyph advances.\n   */\n#define FT_ADVANCES_H  <freetype/ftadvanc.h>\n\n\n  /* */\n\n#define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>\n\n\n  /* The internals of the cache sub-system are no longer exposed.  We */\n  /* default to FT_CACHE_H at the moment just in case, but we know of */\n  /* no rogue client that uses them.                                  */\n  /*                                                                  */\n#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>\n\n\n#define FT_INCREMENTAL_H          <freetype/ftincrem.h>\n\n#define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>\n\n\n  /*\n   * Include internal headers definitions from <freetype/internal/...>\n   * only when building the library.\n   */\n#ifdef FT2_BUILD_LIBRARY\n#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>\n#include FT_INTERNAL_INTERNAL_H\n#endif /* FT2_BUILD_LIBRARY */\n\n\n#endif /* __FT2_BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/config/ftmodule.h",
    "content": "/*\n *  This file registers the FreeType modules compiled into the library.\n *\n *  If you use GNU make, this file IS NOT USED!  Instead, it is created in\n *  the objects directory (normally `<topdir>/objs/') based on information\n *  from `<topdir>/modules.cfg'.\n *\n *  Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile\n *  FreeType without GNU make.\n *\n */\n\nFT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\nFT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\n\n/* EOF */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/config/ftoption.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoption.h                                                             */\n/*                                                                         */\n/*    User-selectable configuration macros (specification only).           */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOPTION_H__\n#define __FTOPTION_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* This file contains the default configuration macro definitions for    */\n  /* a standard build of the FreeType library.  There are three ways to    */\n  /* use this file to build project-specific versions of the library:      */\n  /*                                                                       */\n  /*  - You can modify this file by hand, but this is not recommended in   */\n  /*    cases where you would like to build several versions of the        */\n  /*    library from a single source directory.                            */\n  /*                                                                       */\n  /*  - You can put a copy of this file in your build directory, more      */\n  /*    precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD'   */\n  /*    is the name of a directory that is included _before_ the FreeType  */\n  /*    include path during compilation.                                   */\n  /*                                                                       */\n  /*    The default FreeType Makefiles and Jamfiles use the build          */\n  /*    directory `builds/<system>' by default, but you can easily change  */\n  /*    that for your own projects.                                        */\n  /*                                                                       */\n  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */\n  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */\n  /*    locate this file during the build.  For example,                   */\n  /*                                                                       */\n  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */\n  /*      #include <freetype/config/ftheader.h>                            */\n  /*                                                                       */\n  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */\n  /*    definitions.                                                       */\n  /*                                                                       */\n  /*    Note also that you can similarly pre-define the macro              */\n  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */\n  /*    that are statically linked to the library at compile time.  By     */\n  /*    default, this file is <freetype/config/ftmodule.h>.                */\n  /*                                                                       */\n  /*  We highly recommend using the third method whenever possible.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the line below if you want to activate sub-pixel rendering  */\n  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */\n  /*                                                                       */\n  /* Note that this feature is covered by several Microsoft patents        */\n  /* and should not be activated in any default build of the library.      */\n  /*                                                                       */\n  /* This macro has no impact on the FreeType API, only on its             */\n  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */\n  /* FT_Render_Glyph still generates a bitmap that is 3 times wider than   */\n  /* the original size in case this macro isn't defined; however, each     */\n  /* triplet of subpixels has R=G=B.                                       */\n  /*                                                                       */\n  /* This is done to allow FreeType clients to run unmodified, forcing     */\n  /* them to display normal gray-level anti-aliased glyphs.                */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */\n  /* by FreeType to speed up some computations.  However, this will create */\n  /* some problems when compiling the library in strict ANSI mode.         */\n  /*                                                                       */\n  /* For this reason, the use of 64-bit integers is normally disabled when */\n  /* the __STDC__ macro is defined.  You can however disable this by       */\n  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */\n  /*                                                                       */\n  /* For most compilers, this will only create compilation warnings when   */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* ObNote: The compiler-specific 64-bit integers are detected in the     */\n  /*         file `ftconfig.h' either statically or through the            */\n  /*         `configure' script on supported platforms.                    */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_FORCE_INT64\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, do not try to use an assembler version of   */\n  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */\n  /* that to verify that the assembler function works properly, or to      */\n  /* execute benchmark tests of the various implementations.               */\n/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, try to use an inlined assembler version of  */\n  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */\n  /* hinting glyphs, and which should be executed as fast as possible.     */\n  /*                                                                       */\n  /* Note that if your compiler or CPU is not supported, this will default */\n  /* to the standard and portable implementation found in `ftcalc.c'.      */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INLINE_MULFIX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LZW-compressed file support.                                          */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `compress' program.  This is mostly used to parse many of the PCF   */\n  /*   files that come with various X11 distributions.  The implementation */\n  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */\n  /*   (see src/lzw/ftgzip.c).                                             */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_LZW\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Gzip-compressed file support.                                         */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `gzip' program.  This is mostly used to parse many of the PCF files */\n  /*   that come with XFree86.  The implementation uses `zlib' to          */\n  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.  See also   */\n  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_ZLIB\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ZLib library selection                                                */\n  /*                                                                       */\n  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */\n  /*   It allows FreeType's `ftgzip' component to link to the system's     */\n  /*   installation of the ZLib library.  This is useful on systems like   */\n  /*   Unix or VMS where it generally is already available.                */\n  /*                                                                       */\n  /*   If you let it undefined, the component will use its own copy        */\n  /*   of the zlib sources instead.  These have been modified to be        */\n  /*   included directly within the component and *not* export external    */\n  /*   function names.  This allows you to link any program with FreeType  */\n  /*   _and_ ZLib without linking conflicts.                               */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bzip2-compressed file support.                                        */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `bzip2' program.  This is mostly used to parse many of the PCF      */\n  /*   files that come with XFree86.  The implementation uses `libbz2' to  */\n  /*   partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */\n  /*   Contrary to gzip, bzip2 currently is not included and need to use   */\n  /*   the system available bzip2 implementation.                          */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_BZIP2 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define to disable the use of file stream functions and types, FILE,   */\n  /* fopen() etc.  Enables the use of smaller system libraries on embedded */\n  /* systems that have multiple system libraries, some with or without     */\n  /* file stream support, in the cases where file stream support is not    */\n  /* necessary such as memory loading of font files.                       */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  PNG bitmap support.                                                  */\n  /*                                                                       */\n  /*   FreeType now handles loading color bitmap glyphs in the PNG format. */\n  /*   This requires help from the external libpng library.  Uncompressed  */\n  /*   color bitmaps do not need any external libraries and will be        */\n  /*   supported regardless of this configuration.                         */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_PNG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DLL export compilation                                                */\n  /*                                                                       */\n  /*   When compiling FreeType as a DLL, some systems/compilers need a     */\n  /*   special keyword in front OR after the return type of function       */\n  /*   declarations.                                                       */\n  /*                                                                       */\n  /*   Two macros are used within the FreeType source code to define       */\n  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */\n  /*                                                                       */\n  /*     FT_EXPORT( return_type )                                          */\n  /*                                                                       */\n  /*       is used in a function declaration, as in                        */\n  /*                                                                       */\n  /*         FT_EXPORT( FT_Error )                                         */\n  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */\n  /*                                                                       */\n  /*                                                                       */\n  /*     FT_EXPORT_DEF( return_type )                                      */\n  /*                                                                       */\n  /*       is used in a function definition, as in                         */\n  /*                                                                       */\n  /*         FT_EXPORT_DEF( FT_Error )                                     */\n  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */\n  /*         {                                                             */\n  /*           ... some code ...                                           */\n  /*           return FT_Err_Ok;                                           */\n  /*         }                                                             */\n  /*                                                                       */\n  /*   You can provide your own implementation of FT_EXPORT and            */\n  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */\n  /*   will be later automatically defined as `extern return_type' to      */\n  /*   allow normal compilation.                                           */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_EXPORT(x)      extern x */\n/* #define FT_EXPORT_DEF(x)  x */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Glyph Postscript Names handling                                       */\n  /*                                                                       */\n  /*   By default, FreeType 2 is compiled with the `psnames' module.  This */\n  /*   module is in charge of converting a glyph name string into a        */\n  /*   Unicode value, or return a Macintosh standard glyph name for the    */\n  /*   use with the TrueType `post' table.                                 */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want `psnames' compiled in your   */\n  /*   build of FreeType.  This has the following effects:                 */\n  /*                                                                       */\n  /*   - The TrueType driver will provide its own set of glyph names,      */\n  /*     if you build it to support postscript names in the TrueType       */\n  /*     `post' table.                                                     */\n  /*                                                                       */\n  /*   - The Type 1 driver will not be able to synthesize a Unicode        */\n  /*     charmap out of the glyphs found in the fonts.                     */\n  /*                                                                       */\n  /*   You would normally undefine this configuration macro when building  */\n  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Postscript Names to Unicode Values support                            */\n  /*                                                                       */\n  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */\n  /*   in.  Among other things, the module is used to convert a glyph name */\n  /*   into a Unicode value.  This is especially useful in order to        */\n  /*   synthesize on the fly a Unicode charmap from the CFF/Type 1 driver  */\n  /*   through a big table named the `Adobe Glyph List' (AGL).             */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want the Adobe Glyph List         */\n  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */\n  /*   able to synthesize a Unicode charmap out of the glyphs found in the */\n  /*   fonts.                                                              */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for Mac fonts                                                 */\n  /*                                                                       */\n  /*   Define this macro if you want support for outline fonts in Mac      */\n  /*   format (mac dfont, mac resource, macbinary containing a mac         */\n  /*   resource) on non-Mac platforms.                                     */\n  /*                                                                       */\n  /*   Note that the `FOND' resource isn't checked.                        */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_MAC_FONTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Guessing methods to access embedded resource forks                    */\n  /*                                                                       */\n  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */\n  /*   GNU/Linux).                                                         */\n  /*                                                                       */\n  /*   Resource forks which include fonts data are stored sometimes in     */\n  /*   locations which users or developers don't expected.  In some cases, */\n  /*   resource forks start with some offset from the head of a file.  In  */\n  /*   other cases, the actual resource fork is stored in file different   */\n  /*   from what the user specifies.  If this option is activated,         */\n  /*   FreeType tries to guess whether such offsets or different file      */\n  /*   names must be used.                                                 */\n  /*                                                                       */\n  /*   Note that normal, direct access of resource forks is controlled via */\n  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */\n  /*                                                                       */\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Allow the use of FT_Incremental_Interface to load typefaces that      */\n  /* contain no glyph data, but supply it via a callback function.         */\n  /* This is required by clients supporting document formats which         */\n  /* supply font data incrementally as the document is parsed, such        */\n  /* as the Ghostscript interpreter for the PostScript language.           */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INCREMENTAL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The size in bytes of the render pool used by the scan-line converter  */\n  /* to do all of its work.                                                */\n  /*                                                                       */\n  /* This must be greater than 4KByte if you use FreeType to rasterize     */\n  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */\n  /* allocation of the render pool.                                        */\n  /*                                                                       */\n#define FT_RENDER_POOL_SIZE  16384L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MAX_MODULES                                                        */\n  /*                                                                       */\n  /*   The maximum number of modules that can be registered in a single    */\n  /*   FreeType library object.  32 is the default.                        */\n  /*                                                                       */\n#define FT_MAX_MODULES  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Debug level                                                           */\n  /*                                                                       */\n  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */\n  /*   errors are reported through the `ftdebug' component.  In trace      */\n  /*   mode, additional messages are sent to the standard output during    */\n  /*   execution.                                                          */\n  /*                                                                       */\n  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */\n  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */\n  /*                                                                       */\n  /*   Don't define any of these macros to compile in `release' mode!      */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_LEVEL_ERROR */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Autofitter debugging                                                  */\n  /*                                                                       */\n  /*   If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to     */\n  /*   control the autofitter behaviour for debugging purposes with global */\n  /*   boolean variables (consequently, you should *never* enable this     */\n  /*   while compiling in `release' mode):                                 */\n  /*                                                                       */\n  /*     _af_debug_disable_horz_hints                                      */\n  /*     _af_debug_disable_vert_hints                                      */\n  /*     _af_debug_disable_blue_hints                                      */\n  /*                                                                       */\n  /*   Additionally, the following functions provide dumps of various      */\n  /*   internal autofit structures to stdout (using `printf'):             */\n  /*                                                                       */\n  /*     af_glyph_hints_dump_points                                        */\n  /*     af_glyph_hints_dump_segments                                      */\n  /*     af_glyph_hints_dump_edges                                         */\n  /*                                                                       */\n  /*   As an argument, they use another global variable:                   */\n  /*                                                                       */\n  /*     _af_debug_hints                                                   */\n  /*                                                                       */\n  /*   Please have a look at the `ftgrid' demo program to see how those    */\n  /*   variables and macros should be used.                                */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_AUTOFIT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Memory Debugging                                                      */\n  /*                                                                       */\n  /*   FreeType now comes with an integrated memory debugger that is       */\n  /*   capable of detecting simple errors like memory leaks or double      */\n  /*   deletes.  To compile it within your build of the library, you       */\n  /*   should define FT_DEBUG_MEMORY here.                                 */\n  /*                                                                       */\n  /*   Note that the memory debugger is only activated at runtime when     */\n  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_DEBUG_MEMORY */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Module errors                                                         */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), the higher byte  */\n  /*   of an error code gives the module in which the error has occurred,  */\n  /*   while the lower byte is the real error code.                        */\n  /*                                                                       */\n  /*   Setting this macro makes sense for debugging purposes only, since   */\n  /*   it would break source compatibility of certain programs that use    */\n  /*   FreeType 2.                                                         */\n  /*                                                                       */\n  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Position Independent Code                                             */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), FreeType2 will   */\n  /*   avoid creating constants that require address fixups.  Instead the  */\n  /*   constants will be moved into a struct and additional intialization  */\n  /*   code will be used.                                                  */\n  /*                                                                       */\n  /*   Setting this macro is needed for systems that prohibit address      */\n  /*   fixups, such as BREW.                                               */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */\n  /* embedded bitmaps in all formats using the SFNT module (namely         */\n  /* TrueType & OpenType).                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */\n  /* load and enumerate the glyph Postscript names in a TrueType or        */\n  /* OpenType file.                                                        */\n  /*                                                                       */\n  /* Note that when you do not compile the `PSNames' module by undefining  */\n  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */\n  /* contain additional code used to read the PS Names table from a font.  */\n  /*                                                                       */\n  /* (By default, the module uses `PSNames' to extract glyph names.)       */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */\n  /* access the internal name table in a SFNT-based format like TrueType   */\n  /* or OpenType.  The name table contains various strings used to         */\n  /* describe the font, like family name, copyright, version, etc.  It     */\n  /* does not contain any glyph name though.                               */\n  /*                                                                       */\n  /* Accessing SFNT names is done through the functions declared in        */\n  /* `freetype/ftsnames.h'.                                                */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType CMap support                                                 */\n  /*                                                                       */\n  /*   Here you can fine-tune which TrueType CMap table format shall be    */\n  /*   supported.                                                          */\n#define TT_CONFIG_CMAP_FORMAT_0\n#define TT_CONFIG_CMAP_FORMAT_2\n#define TT_CONFIG_CMAP_FORMAT_4\n#define TT_CONFIG_CMAP_FORMAT_6\n#define TT_CONFIG_CMAP_FORMAT_8\n#define TT_CONFIG_CMAP_FORMAT_10\n#define TT_CONFIG_CMAP_FORMAT_12\n#define TT_CONFIG_CMAP_FORMAT_13\n#define TT_CONFIG_CMAP_FORMAT_14\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */\n  /* a bytecode interpreter in the TrueType driver.                        */\n  /*                                                                       */\n  /* By undefining this, you will only compile the code necessary to load  */\n  /* TrueType glyphs without hinting.                                      */\n  /*                                                                       */\n  /*   Do not #undef this macro here, since the build system might         */\n  /*   define it for certain configurations only.                          */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile       */\n  /* EXPERIMENTAL subpixel hinting support into the TrueType driver.  This */\n  /* replaces the native TrueType hinting mechanism when anything but      */\n  /* FT_RENDER_MODE_MONO is requested.                                     */\n  /*                                                                       */\n  /* Enabling this causes the TrueType driver to ignore instructions under */\n  /* certain conditions.  This is done in accordance with the guide here,  */\n  /* with some minor differences:                                          */\n  /*                                                                       */\n  /*  http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */\n  /*                                                                       */\n  /* By undefining this, you only compile the code necessary to hint       */\n  /* TrueType glyphs with native TT hinting.                               */\n  /*                                                                       */\n  /*   This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */\n  /*   defined.                                                            */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */\n  /* of the TrueType bytecode interpreter is used that doesn't implement   */\n  /* any of the patented opcodes and algorithms.  The patents related to   */\n  /* TrueType hinting have expired worldwide since May 2010; this option   */\n  /* is now deprecated.                                                    */\n  /*                                                                       */\n  /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored*  */\n  /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words,  */\n  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */\n  /*                                                                       */\n  /* This macro is only useful for a small number of font files (mostly    */\n  /* for Asian scripts) that require bytecode interpretation to properly   */\n  /* load glyphs.  For all other fonts, this produces unpleasant results,  */\n  /* thus the unpatented interpreter is never used to load glyphs from     */\n  /* TrueType fonts unless one of the following two options is used.       */\n  /*                                                                       */\n  /*   - The unpatented interpreter is explicitly activated by the user    */\n  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */\n  /*     when opening the FT_Face.                                         */\n  /*                                                                       */\n  /*   - FreeType detects that the FT_Face corresponds to one of the       */\n  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */\n  /*     contains a hard-coded list of font names and other matching       */\n  /*     parameters (see function `tt_face_init' in file                   */\n  /*     `src/truetype/ttobjs.c').                                         */\n  /*                                                                       */\n  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     FT_Parameter  parameter;                                          */\n  /*     FT_Open_Args  open_args;                                          */\n  /*                                                                       */\n  /*                                                                       */\n  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */\n  /*                                                                       */\n  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */\n  /*     open_args.pathname   = my_font_pathname;                          */\n  /*     open_args.num_params = 1;                                         */\n  /*     open_args.params     = &parameter;                                */\n  /*                                                                       */\n  /*     error = FT_Open_Face( library, &open_args, index, &face );        */\n  /*     ...                                                               */\n  /*   }                                                                   */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */\n  /* bytecode interpreter with a huge switch statement, rather than a call */\n  /* table.  This results in smaller and faster code for a number of       */\n  /* architectures.                                                        */\n  /*                                                                       */\n  /* Note however that on some compiler/processor combinations, undefining */\n  /* this macro will generate faster, though larger, code.                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */\n  /* TrueType glyph loader to use Apple's definition of how to handle      */\n  /* component offsets in composite glyphs.                                */\n  /*                                                                       */\n  /* Apple and MS disagree on the default behavior of component offsets    */\n  /* in composites.  Apple says that they should be scaled by the scaling  */\n  /* factors in the transformation matrix (roughly, it's more complex)     */\n  /* while MS says they should not.  OpenType defines two bits in the      */\n  /* composite flags array which can be used to disambiguate, but old      */\n  /* fonts will not have them.                                             */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/otspec/glyf.htm                 */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */\n  /*                                                                       */\n#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */\n  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */\n  /* and avar tables).  This has many similarities to Type 1 Multiple      */\n  /* Masters support.                                                      */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */\n  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BDF\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and       */\n  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */\n  /* required.                                                             */\n  /*                                                                       */\n#define T1_MAX_DICT_DEPTH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  256\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */\n  /* files into an existing face.  Note that if set, the T1 driver will be */\n  /* unable to produce kerning distances.                                  */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_AFM\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of the Multiple Masters font support in the Type 1        */\n  /* driver.                                                               */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF       */\n  /* engine gets compiled into FreeType.  If defined, it is possible to    */\n  /* switch between the two engines using the `hinting-engine' property of */\n  /* the cff driver module.                                                */\n  /*                                                                       */\n/* #define CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with CJK (Chinese, Japanese, Korean) script    */\n  /* support.                                                              */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_CJK\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with Indic script support.                     */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_INDIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with warp hinting.  The idea of the warping    */\n  /* code is to slightly scale and shift a glyph within a single dimension */\n  /* so that as much of its segments are aligned (more or less) on the     */\n  /* grid.  To find out the optimal scaling and shifting value, various    */\n  /* parameter combinations are tried and scored.                          */\n  /*                                                                       */\n  /* This experimental option is only active if the render mode is         */\n  /* FT_RENDER_MODE_LIGHT.                                                 */\n  /*                                                                       */\n/* #define AF_CONFIG_OPTION_USE_WARPER */\n\n  /* */\n\n\n  /*\n   *  This macro is obsolete.  Support has been removed in FreeType\n   *  version 2.5.\n   */\n/* #define FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*\n   * This macro is defined if either unpatented or native TrueType\n   * hinting is requested by the definitions above.\n   */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n#define  TT_USE_BYTECODE_INTERPRETER\n#undef   TT_CONFIG_OPTION_UNPATENTED_HINTING\n#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define  TT_USE_BYTECODE_INTERPRETER\n#endif\n\nFT_END_HEADER\n\n\n#endif /* __FTOPTION_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/config/ftstdlib.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstdlib.h                                                             */\n/*                                                                         */\n/*    ANSI-specific library and header configuration file (specification   */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2002-2007, 2009, 2011-2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to group all #includes to the ANSI C library that   */\n  /* FreeType normally requires.  It also defines macros to rename the     */\n  /* standard functions within the FreeType source code.                   */\n  /*                                                                       */\n  /* Load a file which defines __FTSTDLIB_H__ before this one to override  */\n  /* it.                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSTDLIB_H__\n#define __FTSTDLIB_H__\n\n\n#include <stddef.h>\n\n#define ft_ptrdiff_t  ptrdiff_t\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           integer limits                           */\n  /*                                                                    */\n  /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */\n  /* of `int' and `long' in bytes at compile-time.  So far, this works  */\n  /* for all platforms the library has been tested on.                  */\n  /*                                                                    */\n  /* Note that on the extremely rare platforms that do not provide      */\n  /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */\n  /* old Crays where `int' is 36 bits), we do not make any guarantee    */\n  /* about the correct behaviour of FT2 with all fonts.                 */\n  /*                                                                    */\n  /* In these case, `ftconfig.h' will refuse to compile anyway with a   */\n  /* message like `couldn't find 32-bit type' or something similar.     */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <limits.h>\n\n#define FT_CHAR_BIT    CHAR_BIT\n#define FT_USHORT_MAX  USHRT_MAX\n#define FT_INT_MAX     INT_MAX\n#define FT_INT_MIN     INT_MIN\n#define FT_UINT_MAX    UINT_MAX\n#define FT_ULONG_MAX   ULONG_MAX\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                 character and string processing                    */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <string.h>\n\n#define ft_memchr   memchr\n#define ft_memcmp   memcmp\n#define ft_memcpy   memcpy\n#define ft_memmove  memmove\n#define ft_memset   memset\n#define ft_strcat   strcat\n#define ft_strcmp   strcmp\n#define ft_strcpy   strcpy\n#define ft_strlen   strlen\n#define ft_strncmp  strncmp\n#define ft_strncpy  strncpy\n#define ft_strrchr  strrchr\n#define ft_strstr   strstr\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           file handling                            */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdio.h>\n\n#define FT_FILE     FILE\n#define ft_fclose   fclose\n#define ft_fopen    fopen\n#define ft_fread    fread\n#define ft_fseek    fseek\n#define ft_ftell    ftell\n#define ft_sprintf  sprintf\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                             sorting                                */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdlib.h>\n\n#define ft_qsort  qsort\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                        memory allocation                           */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_scalloc   calloc\n#define ft_sfree     free\n#define ft_smalloc   malloc\n#define ft_srealloc  realloc\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                          miscellaneous                             */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_atol   atol\n#define ft_labs   labs\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                         execution control                          */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <setjmp.h>\n\n#define ft_jmp_buf     jmp_buf  /* note: this cannot be a typedef since */\n                                /*       jmp_buf is defined as a macro  */\n                                /*       on certain platforms           */\n\n#define ft_longjmp     longjmp\n#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */\n\n\n  /* the following is only used for debugging purposes, i.e., if */\n  /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined    */\n\n#include <stdarg.h>\n\n\n#endif /* __FTSTDLIB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/freetype.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  freetype.h                                                             */\n/*                                                                         */\n/*    FreeType high-level API and common types (specification only).       */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FREETYPE_H__\n#define __FREETYPE_H__\n\n\n#ifndef FT_FREETYPE_H\n#error \"`ft2build.h' hasn't been included yet!\"\n#error \"Please always use macros to include FreeType header files.\"\n#error \"Example:\"\n#error \"  #include <ft2build.h>\"\n#error \"  #include FT_FREETYPE_H\"\n#endif\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n#include FT_ERRORS_H\n\n\nFT_BEGIN_HEADER\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    user_allocation                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    User allocation                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should allocate FreeType data structures.  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType assumes that structures allocated by the user and passed  */\n  /*    as arguments are zeroed out except for the actual data.  In other  */\n  /*    words, it is recommended to use `calloc' (or variants of it)       */\n  /*    instead of `malloc' for allocation.                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        B A S I C   T Y P E S                          */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Base Interface                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 base font interface.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section describes the public high-level API of FreeType~2.    */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library                                                         */\n  /*    FT_Face                                                            */\n  /*    FT_Size                                                            */\n  /*    FT_GlyphSlot                                                       */\n  /*    FT_CharMap                                                         */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SCALABLE                                              */\n  /*    FT_FACE_FLAG_FIXED_SIZES                                           */\n  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */\n  /*    FT_FACE_FLAG_HORIZONTAL                                            */\n  /*    FT_FACE_FLAG_VERTICAL                                              */\n  /*    FT_FACE_FLAG_SFNT                                                  */\n  /*    FT_FACE_FLAG_KERNING                                               */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */\n  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */\n  /*    FT_FACE_FLAG_HINTER                                                */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD                                                 */\n  /*    FT_STYLE_FLAG_ITALIC                                               */\n  /*                                                                       */\n  /*    FT_SizeRec                                                         */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /*    FT_GlyphSlotRec                                                    */\n  /*    FT_Glyph_Metrics                                                   */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /*    FT_Init_FreeType                                                   */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /*    FT_New_Face                                                        */\n  /*    FT_Done_Face                                                       */\n  /*    FT_New_Memory_Face                                                 */\n  /*    FT_Open_Face                                                       */\n  /*    FT_Open_Args                                                       */\n  /*    FT_Parameter                                                       */\n  /*    FT_Attach_File                                                     */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /*    FT_Set_Char_Size                                                   */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*    FT_Request_Size                                                    */\n  /*    FT_Select_Size                                                     */\n  /*    FT_Size_Request_Type                                               */\n  /*    FT_Size_Request                                                    */\n  /*    FT_Set_Transform                                                   */\n  /*    FT_Load_Glyph                                                      */\n  /*    FT_Get_Char_Index                                                  */\n  /*    FT_Get_Name_Index                                                  */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /*    FT_OPEN_MEMORY                                                     */\n  /*    FT_OPEN_STREAM                                                     */\n  /*    FT_OPEN_PATHNAME                                                   */\n  /*    FT_OPEN_DRIVER                                                     */\n  /*    FT_OPEN_PARAMS                                                     */\n  /*                                                                       */\n  /*    FT_LOAD_DEFAULT                                                    */\n  /*    FT_LOAD_RENDER                                                     */\n  /*    FT_LOAD_MONOCHROME                                                 */\n  /*    FT_LOAD_LINEAR_DESIGN                                              */\n  /*    FT_LOAD_NO_SCALE                                                   */\n  /*    FT_LOAD_NO_HINTING                                                 */\n  /*    FT_LOAD_NO_BITMAP                                                  */\n  /*    FT_LOAD_CROP_BITMAP                                                */\n  /*                                                                       */\n  /*    FT_LOAD_VERTICAL_LAYOUT                                            */\n  /*    FT_LOAD_IGNORE_TRANSFORM                                           */\n  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */\n  /*    FT_LOAD_FORCE_AUTOHINT                                             */\n  /*    FT_LOAD_NO_RECURSE                                                 */\n  /*    FT_LOAD_PEDANTIC                                                   */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_NORMAL                                              */\n  /*    FT_LOAD_TARGET_LIGHT                                               */\n  /*    FT_LOAD_TARGET_MONO                                                */\n  /*    FT_LOAD_TARGET_LCD                                                 */\n  /*    FT_LOAD_TARGET_LCD_V                                               */\n  /*                                                                       */\n  /*    FT_Render_Glyph                                                    */\n  /*    FT_Render_Mode                                                     */\n  /*    FT_Get_Kerning                                                     */\n  /*    FT_Kerning_Mode                                                    */\n  /*    FT_Get_Track_Kerning                                               */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /*    FT_CharMapRec                                                      */\n  /*    FT_Select_Charmap                                                  */\n  /*    FT_Set_Charmap                                                     */\n  /*    FT_Get_Charmap_Index                                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING                                    */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING                             */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING                              */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING                                            */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY                                    */\n  /*                                                                       */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Glyph_Metrics                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the metrics of a single glyph.  The      */\n  /*    values are expressed in 26.6 fractional pixel format; if the flag  */\n  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */\n  /*    are expressed in font units instead.                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width ::                                                           */\n  /*      The glyph's width.                                               */\n  /*                                                                       */\n  /*    height ::                                                          */\n  /*      The glyph's height.                                              */\n  /*                                                                       */\n  /*    horiBearingX ::                                                    */\n  /*      Left side bearing for horizontal layout.                         */\n  /*                                                                       */\n  /*    horiBearingY ::                                                    */\n  /*      Top side bearing for horizontal layout.                          */\n  /*                                                                       */\n  /*    horiAdvance ::                                                     */\n  /*      Advance width for horizontal layout.                             */\n  /*                                                                       */\n  /*    vertBearingX ::                                                    */\n  /*      Left side bearing for vertical layout.                           */\n  /*                                                                       */\n  /*    vertBearingY ::                                                    */\n  /*      Top side bearing for vertical layout.  Larger positive values    */\n  /*      mean further below the vertical glyph origin.                    */\n  /*                                                                       */\n  /*    vertAdvance ::                                                     */\n  /*      Advance height for vertical layout.  Positive values mean the    */\n  /*      glyph has a positive advance downward.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */\n  /*    dimensions of the hinted glyph (in case hinting is applicable).    */\n  /*                                                                       */\n  /*    Stroking a glyph with an outside border does not increase          */\n  /*    `horiAdvance' or `vertAdvance'; you have to manually adjust these  */\n  /*    values to account for the added width and height.                  */\n  /*                                                                       */\n  typedef struct  FT_Glyph_Metrics_\n  {\n    FT_Pos  width;\n    FT_Pos  height;\n\n    FT_Pos  horiBearingX;\n    FT_Pos  horiBearingY;\n    FT_Pos  horiAdvance;\n\n    FT_Pos  vertBearingX;\n    FT_Pos  vertBearingY;\n    FT_Pos  vertAdvance;\n\n  } FT_Glyph_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure models the metrics of a bitmap strike (i.e., a set  */\n  /*    of glyphs for a given point size and resolution) in a bitmap font. */\n  /*    It is used for the `available_sizes' field of @FT_Face.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height :: The vertical distance, in pixels, between two            */\n  /*              consecutive baselines.  It is always positive.           */\n  /*                                                                       */\n  /*    width  :: The average width, in pixels, of all glyphs in the       */\n  /*              strike.                                                  */\n  /*                                                                       */\n  /*    size   :: The nominal size of the strike in 26.6 fractional        */\n  /*              points.  This field is not very useful.                  */\n  /*                                                                       */\n  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Windows FNT:                                                       */\n  /*      The nominal size given in a FNT font is not reliable.  Thus when */\n  /*      the driver finds it incorrect, it sets `size' to some calculated */\n  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */\n  /*      height given in the font, respectively.                          */\n  /*                                                                       */\n  /*    TrueType embedded bitmaps:                                         */\n  /*      `size', `width', and `height' values are not contained in the    */\n  /*      bitmap strike itself.  They are computed from the global font    */\n  /*      parameters.                                                      */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_Size_\n  {\n    FT_Short  height;\n    FT_Short  width;\n\n    FT_Pos    size;\n\n    FT_Pos    x_ppem;\n    FT_Pos    y_ppem;\n\n  } FT_Bitmap_Size;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     O B J E C T   C L A S S E S                       */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Library                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a FreeType library instance.  Each `library' is        */\n  /*    completely independent from the others; it is the `root' of a set  */\n  /*    of objects like fonts, faces, sizes, etc.                          */\n  /*                                                                       */\n  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */\n  /*    scan-line converter object (see @FT_Raster).                       */\n  /*                                                                       */\n  /*    In multi-threaded applications, make sure that the same FT_Library */\n  /*    object or any of its children doesn't get accessed in parallel.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Library objects are normally created by @FT_Init_FreeType, and     */\n  /*    destroyed with @FT_Done_FreeType.  If you need reference-counting  */\n  /*    (cf. @FT_Reference_Library), use @FT_New_Library and               */\n  /*    @FT_Done_Library.                                                  */\n  /*                                                                       */\n  typedef struct FT_LibraryRec_  *FT_Library;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Module                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType module object.  Each module can be a  */\n  /*    font driver, a renderer, or anything else that provides services   */\n  /*    to the formers.                                                    */\n  /*                                                                       */\n  typedef struct FT_ModuleRec_*  FT_Module;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType font driver object.  Each font driver */\n  /*    is a special module capable of creating faces from font files.     */\n  /*                                                                       */\n  typedef struct FT_DriverRec_*  FT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Renderer                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType renderer.  A renderer is a special    */\n  /*    module in charge of converting a glyph image to a bitmap, when     */\n  /*    necessary.  Each renderer supports a given glyph image format, and */\n  /*    one or more target surface depths.                                 */\n  /*                                                                       */\n  typedef struct FT_RendererRec_*  FT_Renderer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given typographic face object.  A face object models */\n  /*    a given typeface, in a given style.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */\n  /*    as one or more @FT_Size objects.                                   */\n  /*                                                                       */\n  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */\n  /*    a given filepathname or a custom input stream.                     */\n  /*                                                                       */\n  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_FaceRec for the publicly accessible fields of a given face */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_FaceRec_*  FT_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a face scaled to a given       */\n  /*    character size.                                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */\n  /*    functions like @FT_Load_Glyph to determine the scaling             */\n  /*    transformation which is used to load and hint glyphs and metrics.  */\n  /*                                                                       */\n  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */\n  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */\n  /*    (i.e., the scaling values) of the active @FT_Size.                 */\n  /*                                                                       */\n  /*    You can use @FT_New_Size to create additional size objects for a   */\n  /*    given @FT_Face, but they won't be used by other functions until    */\n  /*    you activate it through @FT_Activate_Size.  Only one size can be   */\n  /*    activated at any given time per face.                              */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_SizeRec for the publicly accessible fields of a given size */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_SizeRec_*  FT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given `glyph slot'.  A slot is a container where it  */\n  /*    is possible to load any of the glyphs contained in its parent      */\n  /*    face.                                                              */\n  /*                                                                       */\n  /*    In other words, each time you call @FT_Load_Glyph or               */\n  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */\n  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */\n  /*    other control information.                                         */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_GlyphSlotRec for the publicly accessible glyph fields.     */\n  /*                                                                       */\n  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given character map.  A charmap is used to translate */\n  /*    character codes in a given encoding into glyph indexes for its     */\n  /*    parent's face.  Some font formats may provide several charmaps per */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    Each face object owns zero or more charmaps, but only one of them  */\n  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */\n  /*                                                                       */\n  /*    The list of available charmaps in a face is available through the  */\n  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    The currently active charmap is available as `face->charmap'.      */\n  /*    You should call @FT_Set_Charmap to change it.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When a new face is created (either through @FT_New_Face or         */\n  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */\n  /*    the list and automatically activates it.                           */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_CharMapRec for the publicly accessible fields of a given   */\n  /*    character map.                                                     */\n  /*                                                                       */\n  typedef struct FT_CharMapRec_*  FT_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags into an unsigned long.  It is */\n  /*    used to define `encoding' identifiers (see @FT_Encoding).          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n\n#ifndef FT_ENC_TAG\n#define FT_ENC_TAG( value, a, b, c, d )         \\\n          value = ( ( (FT_UInt32)(a) << 24 ) |  \\\n                    ( (FT_UInt32)(b) << 16 ) |  \\\n                    ( (FT_UInt32)(c) <<  8 ) |  \\\n                      (FT_UInt32)(d)         )\n\n#endif /* FT_ENC_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify character sets supported by         */\n  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Despite the name, this enumeration lists specific character        */\n  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */\n  /*    UTF-8, UTF-16, etc.).                                              */\n  /*                                                                       */\n  /*    Other encodings might be defined in the future.                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_ENCODING_NONE ::                                                */\n  /*      The encoding value~0 is reserved.                                */\n  /*                                                                       */\n  /*    FT_ENCODING_UNICODE ::                                             */\n  /*      Corresponds to the Unicode character set.  This value covers     */\n  /*      all versions of the Unicode repertoire, including ASCII and      */\n  /*      Latin-1.  Most fonts include a Unicode charmap, but not all      */\n  /*      of them.                                                         */\n  /*                                                                       */\n  /*      For example, if you want to access Unicode value U+1F028 (and    */\n  /*      the font contains it), use value 0x1F028 as the input value for  */\n  /*      @FT_Get_Char_Index.                                              */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SYMBOL ::                                           */\n  /*      Corresponds to the Microsoft Symbol encoding, used to encode     */\n  /*      mathematical symbols in the 32..255 character code range.  For   */\n  /*      more information, see `http://www.ceviz.net/symbol.htm'.         */\n  /*                                                                       */\n  /*    FT_ENCODING_SJIS ::                                                */\n  /*      Corresponds to Japanese SJIS encoding.  More info at             */\n  /*      at `http://langsupport.japanreference.com/encoding.shtml'.       */\n  /*      See note on multi-byte encodings below.                          */\n  /*                                                                       */\n  /*    FT_ENCODING_GB2312 ::                                              */\n  /*      Corresponds to an encoding system for Simplified Chinese as used */\n  /*      used in mainland China.                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_BIG5 ::                                                */\n  /*      Corresponds to an encoding system for Traditional Chinese as     */\n  /*      used in Taiwan and Hong Kong.                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_WANSUNG ::                                             */\n  /*      Corresponds to the Korean encoding system known as Wansung.      */\n  /*      For more information see                                         */\n  /*      `http://www.microsoft.com/typography/unicode/949.txt'.           */\n  /*                                                                       */\n  /*    FT_ENCODING_JOHAB ::                                               */\n  /*      The Korean standard character set (KS~C 5601-1992), which        */\n  /*      corresponds to MS Windows code page 1361.  This character set    */\n  /*      includes all possible Hangeul character combinations.            */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_LATIN_1 ::                                       */\n  /*      Corresponds to a Latin-1 encoding as defined in a Type~1         */\n  /*      PostScript font.  It is limited to 256 character codes.          */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_STANDARD ::                                      */\n  /*      Corresponds to the Adobe Standard encoding, as found in Type~1,  */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_EXPERT ::                                        */\n  /*      Corresponds to the Adobe Expert encoding, as found in Type~1,    */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_CUSTOM ::                                        */\n  /*      Corresponds to a custom encoding, as found in Type~1, CFF, and   */\n  /*      OpenType/CFF fonts.  It is limited to 256 character codes.       */\n  /*                                                                       */\n  /*    FT_ENCODING_APPLE_ROMAN ::                                         */\n  /*      Corresponds to the 8-bit Apple roman encoding.  Many TrueType    */\n  /*      and OpenType fonts contain a charmap for this encoding, since    */\n  /*      older versions of Mac OS are able to use it.                     */\n  /*                                                                       */\n  /*    FT_ENCODING_OLD_LATIN_2 ::                                         */\n  /*      This value is deprecated and was never used nor reported by      */\n  /*      FreeType.  Don't use or test for it.                             */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SJIS ::                                             */\n  /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_GB2312 ::                                           */\n  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_BIG5 ::                                             */\n  /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_WANSUNG ::                                          */\n  /*      Same as FT_ENCODING_WANSUNG.  Deprecated.                        */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_JOHAB ::                                            */\n  /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    By default, FreeType automatically synthesizes a Unicode charmap   */\n  /*    for PostScript fonts, using their glyph names dictionaries.        */\n  /*    However, it also reports the encodings defined explicitly in the   */\n  /*    font file, for the cases when they are needed, with the Adobe      */\n  /*    values as well.                                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */\n  /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */\n  /*    FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out      */\n  /*    which encoding is really present.  If, for example, the            */\n  /*    `cs_registry' field is `KOI8' and the `cs_encoding' field is `R',  */\n  /*    the font is encoded in KOI8-R.                                     */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is always set (with a single exception) by the    */\n  /*    winfonts driver.  Use @FT_Get_WinFNT_Header and examine the        */\n  /*    `charset' field of the @FT_WinFNT_HeaderRec structure to find out  */\n  /*    which encoding is really present.  For example,                    */\n  /*    @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for       */\n  /*    Russian).                                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */\n  /*    and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to  */\n  /*    FT_ENCODING_APPLE_ROMAN).                                          */\n  /*                                                                       */\n  /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */\n  /*    @FT_Get_CMap_Language_ID  to query the Mac language ID which may   */\n  /*    be needed to be able to distinguish Apple encoding variants.  See  */\n  /*                                                                       */\n  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT  */\n  /*                                                                       */\n  /*    to get an idea how to do that.  Basically, if the language ID      */\n  /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */\n  /*    Then examine `encoding_id'.  If, for example, `encoding_id' is     */\n  /*    @TT_MAC_ID_ROMAN and the language ID (minus~1) is                  */\n  /*    `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.        */\n  /*    @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi       */\n  /*    variant the Arabic encoding.                                       */\n  /*                                                                       */\n  typedef enum  FT_Encoding_\n  {\n    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),\n\n    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),\n    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),\n\n    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),\n    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),\n    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),\n    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),\n    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),\n\n    /* for backwards compatibility */\n    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,\n    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,\n    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,\n    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,\n    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,\n\n    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),\n\n    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),\n\n    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )\n\n  } FT_Encoding;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_encoding_xxx                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated; use the corresponding @FT_Encoding */\n  /*    values instead.                                                    */\n  /*                                                                       */\n#define ft_encoding_none            FT_ENCODING_NONE\n#define ft_encoding_unicode         FT_ENCODING_UNICODE\n#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL\n#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1\n#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2\n#define ft_encoding_sjis            FT_ENCODING_SJIS\n#define ft_encoding_gb2312          FT_ENCODING_GB2312\n#define ft_encoding_big5            FT_ENCODING_BIG5\n#define ft_encoding_wansung         FT_ENCODING_WANSUNG\n#define ft_encoding_johab           FT_ENCODING_JOHAB\n\n#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD\n#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT\n#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM\n#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_CharMapRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The base charmap structure.                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face        :: A handle to the parent face object.                 */\n  /*                                                                       */\n  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */\n  /*                   this with @FT_Select_Charmap.                       */\n  /*                                                                       */\n  /*    platform_id :: An ID number describing the platform for the        */\n  /*                   following encoding ID.  This comes directly from    */\n  /*                   the TrueType specification and should be emulated   */\n  /*                   for other formats.                                  */\n  /*                                                                       */\n  /*    encoding_id :: A platform specific encoding number.  This also     */\n  /*                   comes from the TrueType specification and should be */\n  /*                   emulated similarly.                                 */\n  /*                                                                       */\n  typedef struct  FT_CharMapRec_\n  {\n    FT_Face      face;\n    FT_Encoding  encoding;\n    FT_UShort    platform_id;\n    FT_UShort    encoding_id;\n\n  } FT_CharMapRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 B A S E   O B J E C T   C L A S S E S                 */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Face object.                     */\n  /*                                                                       */\n  /*    This structure might change between releases of FreeType~2 and is  */\n  /*    not generally available to client applications.                    */\n  /*                                                                       */\n  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root face class structure.  A face object models a        */\n  /*    typeface in a font file.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_faces           :: The number of faces in the font file.  Some */\n  /*                           font formats can have multiple faces in     */\n  /*                           a font file.                                */\n  /*                                                                       */\n  /*    face_index          :: The index of the face in the font file.  It */\n  /*                           is set to~0 if there is only one face in    */\n  /*                           the font file.                              */\n  /*                                                                       */\n  /*    face_flags          :: A set of bit flags that give important      */\n  /*                           information about the face; see             */\n  /*                           @FT_FACE_FLAG_XXX for the details.          */\n  /*                                                                       */\n  /*    style_flags         :: A set of bit flags indicating the style of  */\n  /*                           the face; see @FT_STYLE_FLAG_XXX for the    */\n  /*                           details.                                    */\n  /*                                                                       */\n  /*    num_glyphs          :: The number of glyphs in the face.  If the   */\n  /*                           face is scalable and has sbits (see         */\n  /*                           `num_fixed_sizes'), it is set to the number */\n  /*                           of outline glyphs.                          */\n  /*                                                                       */\n  /*                           For CID-keyed fonts, this value gives the   */\n  /*                           highest CID used in the font.               */\n  /*                                                                       */\n  /*    family_name         :: The face's family name.  This is an ASCII   */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's family (like `Times New      */\n  /*                           Roman', `Bodoni', `Garamond', etc).  This   */\n  /*                           is a least common denominator used to list  */\n  /*                           fonts.  Some formats (TrueType & OpenType)  */\n  /*                           provide localized and Unicode versions of   */\n  /*                           this string.  Applications should use the   */\n  /*                           format specific interface to access them.   */\n  /*                           Can be NULL (e.g., in fonts embedded in a   */\n  /*                           PDF file).                                  */\n  /*                                                                       */\n  /*    style_name          :: The face's style name.  This is an ASCII    */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's style (like `Italic',        */\n  /*                           `Bold', `Condensed', etc).  Not all font    */\n  /*                           formats provide a style name, so this field */\n  /*                           is optional, and can be set to NULL.  As    */\n  /*                           for `family_name', some formats provide     */\n  /*                           localized and Unicode versions of this      */\n  /*                           string.  Applications should use the format */\n  /*                           specific interface to access them.          */\n  /*                                                                       */\n  /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */\n  /*                           Even if the face is scalable, there might   */\n  /*                           still be bitmap strikes, which are called   */\n  /*                           `sbits' in that case.                       */\n  /*                                                                       */\n  /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */\n  /*                           strikes in the face.  It is set to NULL if  */\n  /*                           there is no bitmap strike.                  */\n  /*                                                                       */\n  /*    num_charmaps        :: The number of charmaps in the face.         */\n  /*                                                                       */\n  /*    charmaps            :: An array of the charmaps of the face.       */\n  /*                                                                       */\n  /*    generic             :: A field reserved for client uses.  See the  */\n  /*                           @FT_Generic type description.               */\n  /*                                                                       */\n  /*    bbox                :: The font bounding box.  Coordinates are     */\n  /*                           expressed in font units (see                */\n  /*                           `units_per_EM').  The box is large enough   */\n  /*                           to contain any glyph from the font.  Thus,  */\n  /*                           `bbox.yMax' can be seen as the `maximum     */\n  /*                           ascender', and `bbox.yMin' as the `minimum  */\n  /*                           descender'.  Only relevant for scalable     */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           Note that the bounding box might be off by  */\n  /*                           (at least) one pixel for hinted fonts.  See */\n  /*                           @FT_Size_Metrics for further discussion.    */\n  /*                                                                       */\n  /*    units_per_EM        :: The number of font units per EM square for  */\n  /*                           this face.  This is typically 2048 for      */\n  /*                           TrueType fonts, and 1000 for Type~1 fonts.  */\n  /*                           Only relevant for scalable formats.         */\n  /*                                                                       */\n  /*    ascender            :: The typographic ascender of the face,       */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMax'.  Only relevant for scalable    */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    descender           :: The typographic descender of the face,      */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMin'.  Note that this field is       */\n  /*                           usually negative.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    height              :: This value is the vertical distance         */\n  /*                           between two consecutive baselines,          */\n  /*                           expressed in font units.  It is always      */\n  /*                           positive.  Only relevant for scalable       */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           If you want the global glyph height, use    */\n  /*                           `ascender - descender'.                     */\n  /*                                                                       */\n  /*    max_advance_width   :: The maximum advance width, in font units,   */\n  /*                           for all glyphs in this face.  This can be   */\n  /*                           used to make word wrapping computations     */\n  /*                           faster.  Only relevant for scalable         */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_height  :: The maximum advance height, in font units,  */\n  /*                           for all glyphs in this face.  This is only  */\n  /*                           relevant for vertical layouts, and is set   */\n  /*                           to `height' for fonts that do not provide   */\n  /*                           vertical metrics.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    underline_position  :: The position, in font units, of the         */\n  /*                           underline line for this face.  It is the    */\n  /*                           center of the underlining stem.  Only       */\n  /*                           relevant for scalable formats.              */\n  /*                                                                       */\n  /*    underline_thickness :: The thickness, in font units, of the        */\n  /*                           underline for this face.  Only relevant for */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    glyph               :: The face's associated glyph slot(s).        */\n  /*                                                                       */\n  /*    size                :: The current active size for this face.      */\n  /*                                                                       */\n  /*    charmap             :: The current active charmap for this face.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Fields may be changed after a call to @FT_Attach_File or           */\n  /*    @FT_Attach_Stream.                                                 */\n  /*                                                                       */\n  typedef struct  FT_FaceRec_\n  {\n    FT_Long           num_faces;\n    FT_Long           face_index;\n\n    FT_Long           face_flags;\n    FT_Long           style_flags;\n\n    FT_Long           num_glyphs;\n\n    FT_String*        family_name;\n    FT_String*        style_name;\n\n    FT_Int            num_fixed_sizes;\n    FT_Bitmap_Size*   available_sizes;\n\n    FT_Int            num_charmaps;\n    FT_CharMap*       charmaps;\n\n    FT_Generic        generic;\n\n    /*# The following member variables (down to `underline_thickness') */\n    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */\n    /*# for bitmap fonts.                                              */\n    FT_BBox           bbox;\n\n    FT_UShort         units_per_EM;\n    FT_Short          ascender;\n    FT_Short          descender;\n    FT_Short          height;\n\n    FT_Short          max_advance_width;\n    FT_Short          max_advance_height;\n\n    FT_Short          underline_position;\n    FT_Short          underline_thickness;\n\n    FT_GlyphSlot      glyph;\n    FT_Size           size;\n    FT_CharMap        charmap;\n\n    /*@private begin */\n\n    FT_Driver         driver;\n    FT_Memory         memory;\n    FT_Stream         stream;\n\n    FT_ListRec        sizes_list;\n\n    FT_Generic        autohint;   /* face-specific auto-hinter data */\n    void*             extensions; /* unused                         */\n\n    FT_Face_Internal  internal;\n\n    /*@private end */\n\n  } FT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `face_flags' field of the          */\n  /*    @FT_FaceRec structure.  They inform client applications of         */\n  /*    properties of the corresponding face.                              */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FACE_FLAG_SCALABLE ::                                           */\n  /*      Indicates that the face contains outline glyphs.  This doesn't   */\n  /*      prevent bitmap strikes, i.e., a face can have both this and      */\n  /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */\n  /*      Indicates that the face contains bitmap strikes.  See also the   */\n  /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */\n  /*      Indicates that the face contains fixed-width characters (like    */\n  /*      Courier, Lucido, MonoType, etc.).                                */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SFNT ::                                               */\n  /*      Indicates that the face uses the `sfnt' storage scheme.  For     */\n  /*      now, this means TrueType and OpenType.                           */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HORIZONTAL ::                                         */\n  /*      Indicates that the face contains horizontal glyph metrics.  This */\n  /*      should be set for all common formats.                            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_VERTICAL ::                                           */\n  /*      Indicates that the face contains vertical glyph metrics.  This   */\n  /*      is only available in some formats, not all of them.              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_KERNING ::                                            */\n  /*      Indicates that the face contains kerning information.  If set,   */\n  /*      the kerning distance can be retrieved through the function       */\n  /*      @FT_Get_Kerning.  Otherwise the function always return the       */\n  /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */\n  /*      from the `GPOS' table (as present in some OpenType fonts).       */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */\n  /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */\n  /*      Indicates that the font contains multiple masters and is capable */\n  /*      of interpolating between them.  See the multiple-masters         */\n  /*      specific API for details.                                        */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */\n  /*      Indicates that the font contains glyph names that can be         */\n  /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */\n  /*      fonts contain broken glyph name tables.  Use the function        */\n  /*      @FT_Has_PS_Glyph_Names when needed.                              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */\n  /*      Used internally by FreeType to indicate that a face's stream was */\n  /*      provided by the client application and should not be destroyed   */\n  /*      when @FT_Done_Face is called.  Don't read or test this flag.     */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HINTER ::                                             */\n  /*      Set if the font driver has a hinting machine of its own.  For    */\n  /*      example, with TrueType fonts, it makes sense to use data from    */\n  /*      the SFNT `gasp' table only if the native TrueType hinting engine */\n  /*      (with the bytecode interpreter) is available and active.         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_CID_KEYED ::                                          */\n  /*      Set if the font is CID-keyed.  In that case, the font is not     */\n  /*      accessed by glyph indices but by CID values.  For subsetted      */\n  /*      CID-keyed fonts this has the consequence that not all index      */\n  /*      values are a valid argument to FT_Load_Glyph.  Only the CID      */\n  /*      values for which corresponding glyphs in the subsetted font      */\n  /*      exist make FT_Load_Glyph return successfully; in all other cases */\n  /*      you get an `FT_Err_Invalid_Argument' error.                      */\n  /*                                                                       */\n  /*      Note that CID-keyed fonts which are in an SFNT wrapper don't     */\n  /*      have this flag set since the glyphs are accessed in the normal   */\n  /*      way (using contiguous indices); the `CID-ness' isn't visible to  */\n  /*      the application.                                                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_TRICKY ::                                             */\n  /*      Set if the font is `tricky', this is, it always needs the        */\n  /*      font format's native hinting engine to get a reasonable result.  */\n  /*      A typical example is the Chinese font `mingli.ttf' which uses    */\n  /*      TrueType bytecode instructions to move and scale all of its      */\n  /*      subglyphs.                                                       */\n  /*                                                                       */\n  /*      It is not possible to autohint such fonts using                  */\n  /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */\n  /*      @FT_LOAD_NO_HINTING.  You have to set both @FT_LOAD_NO_HINTING   */\n  /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */\n  /*      probably never want this except for demonstration purposes.      */\n  /*                                                                       */\n  /*      Currently, there are about a dozen TrueType fonts in the list of */\n  /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */\n  /*                                                                       */\n#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )\n#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )\n#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )\n#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )\n#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )\n#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )\n#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )\n#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )\n#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )\n#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )\n#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )\n#define FT_FACE_FLAG_HINTER            ( 1L << 11 )\n#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )\n#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_HORIZONTAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   horizontal metrics (this is true for all font formats though).\n   *\n   * @also:\n   *   @FT_HAS_VERTICAL can be used to check for vertical metrics.\n   *\n   */\n#define FT_HAS_HORIZONTAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_VERTICAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains real\n   *   vertical metrics (and not only synthesized ones).\n   *\n   */\n#define FT_HAS_VERTICAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_VERTICAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_KERNING( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains kerning\n   *   data that can be accessed with @FT_Get_Kerning.\n   *\n   */\n#define FT_HAS_KERNING( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_KERNING )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SCALABLE( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a scalable\n   *   font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,\n   *   and PFR font formats.\n   *\n   */\n#define FT_IS_SCALABLE( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SCALABLE )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SFNT( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font\n   *   whose format is based on the SFNT storage scheme.  This usually\n   *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded\n   *   bitmap fonts.\n   *\n   *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and\n   *   @FT_TRUETYPE_TABLES_H are available.\n   *\n   */\n#define FT_IS_SFNT( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SFNT )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_FIXED_WIDTH( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font face\n   *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)\n   *   glyphs.\n   *\n   */\n#define FT_IS_FIXED_WIDTH( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FIXED_SIZES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   embedded bitmaps.  See the `available_sizes' field of the\n   *   @FT_FaceRec structure.\n   *\n   */\n#define FT_HAS_FIXED_SIZES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FAST_GLYPHS( face )\n   *\n   * @description:\n   *   Deprecated.\n   *\n   */\n#define FT_HAS_FAST_GLYPHS( face )  0\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_GLYPH_NAMES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some glyph\n   *   names that can be accessed through @FT_Get_Glyph_Name.\n   *\n   */\n#define FT_HAS_GLYPH_NAMES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_MULTIPLE_MASTERS( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H\n   *   are then available to choose the exact design you want.\n   *\n   */\n#define FT_HAS_MULTIPLE_MASTERS( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_CID_KEYED( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a CID-keyed\n   *   font.  See the discussion of @FT_FACE_FLAG_CID_KEYED for more\n   *   details.\n   *\n   *   If this macro is true, all functions defined in @FT_CID_H are\n   *   available.\n   *\n   */\n#define FT_IS_CID_KEYED( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_TRICKY( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face represents a `tricky' font.\n   *   See the discussion of @FT_FACE_FLAG_TRICKY for more details.\n   *\n   */\n#define FT_IS_TRICKY( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_TRICKY )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-flags used to indicate the style of a given face.    */\n  /*    These are used in the `style_flags' field of @FT_FaceRec.          */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_STYLE_FLAG_ITALIC ::                                            */\n  /*      Indicates that a given face style is italic or oblique.          */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD ::                                              */\n  /*      Indicates that a given face is bold.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The style information as provided by FreeType is very basic.  More */\n  /*    details are beyond the scope and should be done on a higher level  */\n  /*    (for example, by analyzing various fields of the `OS/2' table in   */\n  /*    SFNT based fonts).                                                 */\n  /*                                                                       */\n#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )\n#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Size object.                     */\n  /*                                                                       */\n  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The size metrics structure gives the metrics of a size object.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x_ppem       :: The width of the scaled EM square in pixels, hence */\n  /*                    the term `ppem' (pixels per EM).  It is also       */\n  /*                    referred to as `nominal width'.                    */\n  /*                                                                       */\n  /*    y_ppem       :: The height of the scaled EM square in pixels,      */\n  /*                    hence the term `ppem' (pixels per EM).  It is also */\n  /*                    referred to as `nominal height'.                   */\n  /*                                                                       */\n  /*    x_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    horizontal metrics from font units to 26.6         */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    y_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    vertical metrics from font units to 26.6           */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    descender    :: The descender in 26.6 fractional pixels.  See      */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    height       :: The height in 26.6 fractional pixels.  See         */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    max_advance  :: The maximum advance width in 26.6 fractional       */\n  /*                    pixels.  See @FT_FaceRec for the details.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The scaling values, if relevant, are determined first during a     */\n  /*    size changing operation.  The remaining fields are then set by the */\n  /*    driver.  For scalable formats, they are usually set to scaled      */\n  /*    values of the corresponding fields in @FT_FaceRec.                 */\n  /*                                                                       */\n  /*    Note that due to glyph hinting, these values might not be exact    */\n  /*    for certain fonts.  Thus they must be treated as unreliable        */\n  /*    with an error margin of at least one pixel!                        */\n  /*                                                                       */\n  /*    Indeed, the only way to get the exact metrics is to render _all_   */\n  /*    glyphs.  As this would be a definite performance hit, it is up to  */\n  /*    client applications to perform such computations.                  */\n  /*                                                                       */\n  /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */\n  /*                                                                       */\n  typedef struct  FT_Size_Metrics_\n  {\n    FT_UShort  x_ppem;      /* horizontal pixels per EM               */\n    FT_UShort  y_ppem;      /* vertical pixels per EM                 */\n\n    FT_Fixed   x_scale;     /* scaling values used to convert font    */\n    FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */\n\n    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */\n    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */\n    FT_Pos     height;      /* text height in 26.6 frac. pixels       */\n    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */\n\n  } FT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root size class structure.  A size object models a face   */\n  /*    object at a given size.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face    :: Handle to the parent face object.                       */\n  /*                                                                       */\n  /*    generic :: A typeless pointer, which is unused by the FreeType     */\n  /*               library or any of its drivers.  It can be used by       */\n  /*               client applications to link their own data to each size */\n  /*               object.                                                 */\n  /*                                                                       */\n  /*    metrics :: Metrics for this size object.  This field is read-only. */\n  /*                                                                       */\n  typedef struct  FT_SizeRec_\n  {\n    FT_Face           face;      /* parent face object              */\n    FT_Generic        generic;   /* generic pointer for client uses */\n    FT_Size_Metrics   metrics;   /* size metrics                    */\n    FT_Size_Internal  internal;\n\n  } FT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The subglyph structure is an internal object used to describe      */\n  /*    subglyphs (for example, in the case of composites).                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The subglyph implementation is not part of the high-level API,     */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  /*    You can however retrieve subglyph information with                 */\n  /*    @FT_Get_SubGlyph_Info.                                             */\n  /*                                                                       */\n  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_GlyphSlot object.                */\n  /*                                                                       */\n  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root glyph slot class structure.  A glyph slot is a       */\n  /*    container where individual glyphs can be loaded, be they in        */\n  /*    outline or bitmap format.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library           :: A handle to the FreeType library instance     */\n  /*                         this slot belongs to.                         */\n  /*                                                                       */\n  /*    face              :: A handle to the parent face object.           */\n  /*                                                                       */\n  /*    next              :: In some cases (like some font tools), several */\n  /*                         glyph slots per face object can be a good     */\n  /*                         thing.  As this is rare, the glyph slots are  */\n  /*                         listed through a direct, single-linked list   */\n  /*                         using its `next' field.                       */\n  /*                                                                       */\n  /*    generic           :: A typeless pointer which is unused by the     */\n  /*                         FreeType library or any of its drivers.  It   */\n  /*                         can be used by client applications to link    */\n  /*                         their own data to each glyph slot object.     */\n  /*                                                                       */\n  /*    metrics           :: The metrics of the last loaded glyph in the   */\n  /*                         slot.  The returned values depend on the last */\n  /*                         load flags (see the @FT_Load_Glyph API        */\n  /*                         function) and can be expressed either in 26.6 */\n  /*                         fractional pixels or font units.              */\n  /*                                                                       */\n  /*                         Note that even when the glyph image is        */\n  /*                         transformed, the metrics are not.             */\n  /*                                                                       */\n  /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    linearVertAdvance :: The advance height of the unhinted glyph.     */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    advance           :: This shorthand is, depending on               */\n  /*                         @FT_LOAD_IGNORE_TRANSFORM, the transformed    */\n  /*                         advance width for the glyph (in 26.6          */\n  /*                         fractional pixel format).  As specified with  */\n  /*                         @FT_LOAD_VERTICAL_LAYOUT, it uses either the  */\n  /*                         `horiAdvance' or the `vertAdvance' value of   */\n  /*                         `metrics' field.                              */\n  /*                                                                       */\n  /*    format            :: This field indicates the format of the image  */\n  /*                         contained in the glyph slot.  Typically       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP,                      */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */\n  /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */\n  /*                         possible.                                     */\n  /*                                                                       */\n  /*    bitmap            :: This field is used as a bitmap descriptor     */\n  /*                         when the slot format is                       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */\n  /*                         address and content of the bitmap buffer can  */\n  /*                         change between calls of @FT_Load_Glyph and a  */\n  /*                         few other functions.                          */\n  /*                                                                       */\n  /*    bitmap_left       :: This is the bitmap's left bearing expressed   */\n  /*                         in integer pixels.  Of course, this is only   */\n  /*                         valid if the format is                        */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.                      */\n  /*                                                                       */\n  /*    bitmap_top        :: This is the bitmap's top bearing expressed in */\n  /*                         integer pixels.  Remember that this is the    */\n  /*                         distance from the baseline to the top-most    */\n  /*                         glyph scanline, upwards y~coordinates being   */\n  /*                         *positive*.                                   */\n  /*                                                                       */\n  /*    outline           :: The outline descriptor for the current glyph  */\n  /*                         image if its format is                        */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */\n  /*                         loaded, `outline' can be transformed,         */\n  /*                         distorted, embolded, etc.  However, it must   */\n  /*                         not be freed.                                 */\n  /*                                                                       */\n  /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */\n  /*                         This field is only valid for the composite    */\n  /*                         glyph format that should normally only be     */\n  /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */\n  /*                         For now this is internal to FreeType.         */\n  /*                                                                       */\n  /*    subglyphs         :: An array of subglyph descriptors for          */\n  /*                         composite glyphs.  There are `num_subglyphs'  */\n  /*                         elements in there.  Currently internal to     */\n  /*                         FreeType.                                     */\n  /*                                                                       */\n  /*    control_data      :: Certain font drivers can also return the      */\n  /*                         control data for a given glyph image (e.g.    */\n  /*                         TrueType bytecode, Type~1 charstrings, etc.). */\n  /*                         This field is a pointer to such data.         */\n  /*                                                                       */\n  /*    control_len       :: This is the length in bytes of the control    */\n  /*                         data.                                         */\n  /*                                                                       */\n  /*    other             :: Really wicked formats can use this pointer to */\n  /*                         present their own glyph image to client       */\n  /*                         applications.  Note that the application      */\n  /*                         needs to know about the image format.         */\n  /*                                                                       */\n  /*    lsb_delta         :: The difference between hinted and unhinted    */\n  /*                         left side bearing while autohinting is        */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /*    rsb_delta         :: The difference between hinted and unhinted    */\n  /*                         right side bearing while autohinting is       */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If @FT_Load_Glyph is called with default flags (see                */\n  /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */\n  /*    its native format (e.g., an outline glyph for TrueType and Type~1  */\n  /*    formats).                                                          */\n  /*                                                                       */\n  /*    This image can later be converted into a bitmap by calling         */\n  /*    @FT_Render_Glyph.  This function finds the current renderer for    */\n  /*    the native image's format, then invokes it.                        */\n  /*                                                                       */\n  /*    The renderer is in charge of transforming the native image through */\n  /*    the slot's face transformation fields, then converting it into a   */\n  /*    bitmap that is returned in `slot->bitmap'.                         */\n  /*                                                                       */\n  /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */\n  /*    to specify the position of the bitmap relative to the current pen  */\n  /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */\n  /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Here a small pseudo code fragment which shows how to use           */\n  /*    `lsb_delta' and `rsb_delta':                                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Pos  origin_x       = 0;                                      */\n  /*      FT_Pos  prev_rsb_delta = 0;                                      */\n  /*                                                                       */\n  /*                                                                       */\n  /*      for all glyphs do                                                */\n  /*        <compute kern between current and previous glyph and add it to */\n  /*         `origin_x'>                                                   */\n  /*                                                                       */\n  /*        <load glyph with `FT_Load_Glyph'>                              */\n  /*                                                                       */\n  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */\n  /*          origin_x -= 64;                                              */\n  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */\n  /*          origin_x += 64;                                              */\n  /*                                                                       */\n  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */\n  /*                                                                       */\n  /*        <save glyph image, or render glyph, or ...>                    */\n  /*                                                                       */\n  /*        origin_x += face->glyph->advance.x;                            */\n  /*      endfor                                                           */\n  /*    }                                                                  */\n  /*                                                                       */\n  typedef struct  FT_GlyphSlotRec_\n  {\n    FT_Library        library;\n    FT_Face           face;\n    FT_GlyphSlot      next;\n    FT_UInt           reserved;       /* retained for binary compatibility */\n    FT_Generic        generic;\n\n    FT_Glyph_Metrics  metrics;\n    FT_Fixed          linearHoriAdvance;\n    FT_Fixed          linearVertAdvance;\n    FT_Vector         advance;\n\n    FT_Glyph_Format   format;\n\n    FT_Bitmap         bitmap;\n    FT_Int            bitmap_left;\n    FT_Int            bitmap_top;\n\n    FT_Outline        outline;\n\n    FT_UInt           num_subglyphs;\n    FT_SubGlyph       subglyphs;\n\n    void*             control_data;\n    long              control_len;\n\n    FT_Pos            lsb_delta;\n    FT_Pos            rsb_delta;\n\n    void*             other;\n\n    FT_Slot_Internal  internal;\n\n  } FT_GlyphSlotRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         F U N C T I O N S                             */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Init_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new FreeType library object.  The set of modules      */\n  /*    that are registered by this function is determined at build time.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A handle to a new library object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case you want to provide your own memory allocating routines,   */\n  /*    use @FT_New_Library instead, followed by a call to                 */\n  /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */\n  /*                                                                       */\n  /*    For multi-threading applications each thread should have its own   */\n  /*    FT_Library object.                                                 */\n  /*                                                                       */\n  /*    If you need reference-counting (cf. @FT_Reference_Library), use    */\n  /*    @FT_New_Library and @FT_Done_Library.                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given FreeType library object and all of its children,   */\n  /*    including resources, drivers, faces, sizes, etc.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library object.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_FreeType( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OPEN_XXX                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants used within the `flags' field of the */\n  /*    @FT_Open_Args structure.                                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OPEN_MEMORY   :: This is a memory-based stream.                 */\n  /*                                                                       */\n  /*    FT_OPEN_STREAM   :: Copy the stream from the `stream' field.       */\n  /*                                                                       */\n  /*    FT_OPEN_PATHNAME :: Create a new input stream from a C~path        */\n  /*                        name.                                          */\n  /*                                                                       */\n  /*    FT_OPEN_DRIVER   :: Use the `driver' field.                        */\n  /*                                                                       */\n  /*    FT_OPEN_PARAMS   :: Use the `num_params' and `params' fields.      */\n  /*                                                                       */\n  /*    ft_open_memory   :: Deprecated; use @FT_OPEN_MEMORY instead.       */\n  /*                                                                       */\n  /*    ft_open_stream   :: Deprecated; use @FT_OPEN_STREAM instead.       */\n  /*                                                                       */\n  /*    ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead.     */\n  /*                                                                       */\n  /*    ft_open_driver   :: Deprecated; use @FT_OPEN_DRIVER instead.       */\n  /*                                                                       */\n  /*    ft_open_params   :: Deprecated; use @FT_OPEN_PARAMS instead.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */\n  /*    flags are mutually exclusive.                                      */\n  /*                                                                       */\n#define FT_OPEN_MEMORY    0x1\n#define FT_OPEN_STREAM    0x2\n#define FT_OPEN_PATHNAME  0x4\n#define FT_OPEN_DRIVER    0x8\n#define FT_OPEN_PARAMS    0x10\n\n#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */\n#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */\n#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */\n#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */\n#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Parameter                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to pass more or less generic parameters to */\n  /*    @FT_Open_Face.                                                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag  :: A four-byte identification tag.                            */\n  /*                                                                       */\n  /*    data :: A pointer to the parameter data.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The ID and function of parameters are driver-specific.  See the    */\n  /*    various FT_PARAM_TAG_XXX flags for more information.               */\n  /*                                                                       */\n  typedef struct  FT_Parameter_\n  {\n    FT_ULong    tag;\n    FT_Pointer  data;\n\n  } FT_Parameter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Open_Args                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to indicate how to open a new font file or        */\n  /*    stream.  A pointer to such a structure can be used as a parameter  */\n  /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    flags       :: A set of bit flags indicating how to use the        */\n  /*                   structure.                                          */\n  /*                                                                       */\n  /*    memory_base :: The first byte of the file in memory.               */\n  /*                                                                       */\n  /*    memory_size :: The size in bytes of the file in memory.            */\n  /*                                                                       */\n  /*    pathname    :: A pointer to an 8-bit file pathname.                */\n  /*                                                                       */\n  /*    stream      :: A handle to a source stream object.                 */\n  /*                                                                       */\n  /*    driver      :: This field is exclusively used by @FT_Open_Face;    */\n  /*                   it simply specifies the font driver to use to open  */\n  /*                   the face.  If set to~0, FreeType tries to load the  */\n  /*                   face with each one of the drivers in its list.      */\n  /*                                                                       */\n  /*    num_params  :: The number of extra parameters.                     */\n  /*                                                                       */\n  /*    params      :: Extra parameters passed to the font driver when     */\n  /*                   opening a new face.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream type is determined by the contents of `flags' which     */\n  /*    are tested in the following order by @FT_Open_Face:                */\n  /*                                                                       */\n  /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */\n  /*    memory file of `memory_size' bytes, located at `memory_address'.   */\n  /*    The data are are not copied, and the client is responsible for     */\n  /*    releasing and destroying them _after_ the corresponding call to    */\n  /*    @FT_Done_Face.                                                     */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */\n  /*    custom input stream `stream' is used.                              */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this  */\n  /*    is a normal file and use `pathname' to open it.                    */\n  /*                                                                       */\n  /*    If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to    */\n  /*    open the file with the driver whose handler is in `driver'.        */\n  /*                                                                       */\n  /*    If the `FT_OPEN_PARAMS' bit is set, the parameters given by        */\n  /*    `num_params' and `params' is used.  They are ignored otherwise.    */\n  /*                                                                       */\n  /*    Ideally, both the `pathname' and `params' fields should be tagged  */\n  /*    as `const'; this is missing for API backwards compatibility.  In   */\n  /*    other words, applications should treat them as read-only.          */\n  /*                                                                       */\n  typedef struct  FT_Open_Args_\n  {\n    FT_UInt         flags;\n    const FT_Byte*  memory_base;\n    FT_Long         memory_size;\n    FT_String*      pathname;\n    FT_Stream       stream;\n    FT_Module       driver;\n    FT_Int          num_params;\n    FT_Parameter*   params;\n\n  } FT_Open_Args;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font by its pathname.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pathname   :: A path to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Done_Face to destroy the created @FT_Face object (along    */\n  /*    with its slot and sizes).                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  filepathname,\n               FT_Long      face_index,\n               FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory_Face                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font which has been    */\n  /*    loaded into memory.                                                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    file_base  :: A pointer to the beginning of the font data.         */\n  /*                                                                       */\n  /*    file_size  :: The size of the memory chunk used by the font data.  */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You must not deallocate the memory before calling @FT_Done_Face.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Open_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a face object from a given resource described by            */\n  /*    @FT_Open_Args.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    args       :: A pointer to an `FT_Open_Args' structure which must  */\n  /*                  be filled by the caller.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See note below.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Unlike FreeType 1.x, this function automatically creates a glyph   */\n  /*    slot for the face object which can be accessed directly through    */\n  /*    `face->glyph'.                                                     */\n  /*                                                                       */\n  /*    FT_Open_Face can be used to quickly check whether the font         */\n  /*    format of a given font resource is supported by FreeType.  If the  */\n  /*    `face_index' field is negative, the function's return value is~0   */\n  /*    if the font format is recognized, or non-zero otherwise;           */\n  /*    the function returns a more or less empty face handle in `*aface'  */\n  /*    (if `aface' isn't NULL).  The only useful field in this special    */\n  /*    case is `face->num_faces' which gives the number of faces within   */\n  /*    the font file.  After examination, the returned @FT_Face structure */\n  /*    should be deallocated with a call to @FT_Done_Face.                */\n  /*                                                                       */\n  /*    Each new face object created with this function also owns a        */\n  /*    default @FT_Size object, accessible as `face->size'.               */\n  /*                                                                       */\n  /*    One @FT_Library instance can have multiple face objects, this is,  */\n  /*    @FT_Open_Face and its siblings can be called multiple times using  */\n  /*    the same `library' argument.                                       */\n  /*                                                                       */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_File                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Attach_Stream to attach a file.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: The target face object.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    filepathname :: The pathname.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    `Attach' data to a face object.  Normally, this is used to read    */\n  /*    additional information for the face object.  For example, you can  */\n  /*    attach an AFM file that comes with a Type~1 font to get the        */\n  /*    kerning values and other metrics.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The target face object.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    parameters :: A pointer to @FT_Open_Args which must be filled by   */\n  /*                  the caller.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The meaning of the `attach' (i.e., what really happens when the    */\n  /*    new file is read) is not fixed by FreeType itself.  It really      */\n  /*    depends on the font format (and thus the font driver).             */\n  /*                                                                       */\n  /*    Client applications are expected to know what they are doing       */\n  /*    when invoking this function.  Most drivers simply do not implement */\n  /*    file attachments.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Face                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Face structure  */\n  /*    is created.  This function increments the counter.  @FT_Done_Face  */\n  /*    then only destroys a face if the counter is~1, otherwise it simply */\n  /*    decrements the counter.                                            */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Face objects.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given face object, as well as all of its child slots and */\n  /*    sizes.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a bitmap strike.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to a target face object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strike_index :: The index of the bitmap strike in the              */\n  /*                    `available_sizes' field of @FT_FaceRec structure.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Size_Request_Type                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the supported size request types.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SIZE_REQUEST_TYPE_NOMINAL ::                                    */\n  /*      The nominal size.  The `units_per_EM' field of @FT_FaceRec is    */\n  /*      used to determine both scaling values.                           */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */\n  /*      The real dimension.  The sum of the the `ascender' and (minus    */\n  /*      of) the `descender' fields of @FT_FaceRec are used to determine  */\n  /*      both scaling values.                                             */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */\n  /*      The font bounding box.  The width and height of the `bbox' field */\n  /*      of @FT_FaceRec are used to determine the horizontal and vertical */\n  /*      scaling value, respectively.                                     */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_CELL ::                                       */\n  /*      The `max_advance_width' field of @FT_FaceRec is used to          */\n  /*      determine the horizontal scaling value; the vertical scaling     */\n  /*      value is determined the same way as                              */\n  /*      @FT_SIZE_REQUEST_TYPE_REAL_DIM does.  Finally, both scaling      */\n  /*      values are set to the smaller one.  This type is useful if you   */\n  /*      want to specify the font size for, say, a window of a given      */\n  /*      dimension and 80x24 cells.                                       */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_SCALES ::                                     */\n  /*      Specify the scaling values directly.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The above descriptions only apply to scalable formats.  For bitmap */\n  /*    formats, the behaviour is up to the driver.                        */\n  /*                                                                       */\n  /*    See the note section of @FT_Size_Metrics if you wonder how size    */\n  /*    requesting relates to scaling values.                              */\n  /*                                                                       */\n  typedef enum  FT_Size_Request_Type_\n  {\n    FT_SIZE_REQUEST_TYPE_NOMINAL,\n    FT_SIZE_REQUEST_TYPE_REAL_DIM,\n    FT_SIZE_REQUEST_TYPE_BBOX,\n    FT_SIZE_REQUEST_TYPE_CELL,\n    FT_SIZE_REQUEST_TYPE_SCALES,\n\n    FT_SIZE_REQUEST_TYPE_MAX\n\n  } FT_Size_Request_Type;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_RequestRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a size request.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    type           :: See @FT_Size_Request_Type.                       */\n  /*                                                                       */\n  /*    width          :: The desired width.                               */\n  /*                                                                       */\n  /*    height         :: The desired height.                              */\n  /*                                                                       */\n  /*    horiResolution :: The horizontal resolution.  If set to zero,      */\n  /*                      `width' is treated as a 26.6 fractional pixel    */\n  /*                      value.                                           */\n  /*                                                                       */\n  /*    vertResolution :: The vertical resolution.  If set to zero,        */\n  /*                      `height' is treated as a 26.6 fractional pixel   */\n  /*                      value.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `width' is zero, then the horizontal scaling value is set equal */\n  /*    to the vertical scaling value, and vice versa.                     */\n  /*                                                                       */\n  typedef struct  FT_Size_RequestRec_\n  {\n    FT_Size_Request_Type  type;\n    FT_Long               width;\n    FT_Long               height;\n    FT_UInt               horiResolution;\n    FT_UInt               vertResolution;\n\n  } FT_Size_RequestRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Request                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a size request structure.                              */\n  /*                                                                       */\n  typedef struct FT_Size_RequestRec_  *FT_Size_Request;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Request_Size                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Resize the scale of the active @FT_Size object in a face.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    req  :: A pointer to a @FT_Size_RequestRec.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Although drivers may select the bitmap strike matching the         */\n  /*    request, you should not rely on this if you intend to select a     */\n  /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */\n  /*    case.                                                              */\n  /*                                                                       */\n  /*    The relation between the requested size and the resulting glyph    */\n  /*    size is dependent entirely on how the size is defined in the       */\n  /*    source face.  The font designer chooses the final size of each     */\n  /*    glyph relative to this size.  For more information refer to        */\n  /*    `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Char_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in points).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face            :: A handle to a target face object.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_width      :: The nominal width, in 26.6 fractional points.   */\n  /*                                                                       */\n  /*    char_height     :: The nominal height, in 26.6 fractional points.  */\n  /*                                                                       */\n  /*    horz_resolution :: The horizontal resolution in dpi.               */\n  /*                                                                       */\n  /*    vert_resolution :: The vertical resolution in dpi.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If either the character width or height is zero, it is set equal   */\n  /*    to the other value.                                                */\n  /*                                                                       */\n  /*    If either the horizontal or vertical resolution is zero, it is set */\n  /*    equal to the other value.                                          */\n  /*                                                                       */\n  /*    A character width or height smaller than 1pt is set to 1pt; if     */\n  /*    both resolution values are zero, they are set to 72dpi.            */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in pixels).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to the target face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pixel_width  :: The nominal width, in pixels.                      */\n  /*                                                                       */\n  /*    pixel_height :: The nominal height, in pixels.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should not rely on the resulting glyphs matching, or being     */\n  /*    constrained, to this pixel size.  Refer to @FT_Request_Size to     */\n  /*    understand how requested sizes relate to actual sizes.             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to the target face object where the glyph  */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph_index :: The index of the glyph in the font file.  For       */\n  /*                   CID-keyed fonts (either in PS or in CFF format)     */\n  /*                   this argument specifies the CID value.              */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The loaded glyph may be transformed.  See @FT_Set_Transform for    */\n  /*    the details.                                                       */\n  /*                                                                       */\n  /*    For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is        */\n  /*    returned for invalid CID values (this is, for CID values which     */\n  /*    don't have a corresponding glyph in the font).  See the discussion */\n  /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object, according to its character code.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to a target face object where the glyph    */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_code   :: The glyph's character code, according to the        */\n  /*                   current charmap used in the face.                   */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags );\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_XXX\n   *\n   * @description:\n   *   A list of bit-field constants used with @FT_Load_Glyph to indicate\n   *   what kind of operations to perform during glyph loading.\n   *\n   * @values:\n   *   FT_LOAD_DEFAULT ::\n   *     Corresponding to~0, this value is used as the default glyph load\n   *     operation.  In this case, the following happens:\n   *\n   *     1. FreeType looks for a bitmap for the glyph corresponding to the\n   *        face's current size.  If one is found, the function returns.\n   *        The bitmap data can be accessed from the glyph slot (see note\n   *        below).\n   *\n   *     2. If no embedded bitmap is searched or found, FreeType looks for a\n   *        scalable outline.  If one is found, it is loaded from the font\n   *        file, scaled to device pixels, then `hinted' to the pixel grid\n   *        in order to optimize it.  The outline data can be accessed from\n   *        the glyph slot (see note below).\n   *\n   *     Note that by default, the glyph loader doesn't render outlines into\n   *     bitmaps.  The following flags are used to modify this default\n   *     behaviour to more specific and useful cases.\n   *\n   *   FT_LOAD_NO_SCALE ::\n   *     Don't scale the loaded outline glyph but keep it in font units.\n   *\n   *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and\n   *     unsets @FT_LOAD_RENDER.\n   *\n   *     If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using\n   *     FT_LOAD_NO_SCALE usually yields meaningless outlines because the\n   *     subglyphs must be scaled and positioned with hinting instructions.\n   *     This can be solved by loading the font without FT_LOAD_NO_SCALE and\n   *     setting the character size to `font->units_per_EM'.\n   *\n   *   FT_LOAD_NO_HINTING ::\n   *     Disable hinting.  This generally generates `blurrier' bitmap glyphs\n   *     when the glyph are rendered in any of the anti-aliased modes.  See\n   *     also the note below.\n   *\n   *     This flag is implied by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_RENDER ::\n   *     Call @FT_Render_Glyph after the glyph is loaded.  By default, the\n   *     glyph is rendered in @FT_RENDER_MODE_NORMAL mode.  This can be\n   *     overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.\n   *\n   *     This flag is unset by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_NO_BITMAP ::\n   *     Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this\n   *     flag.\n   *\n   *     @FT_LOAD_NO_SCALE always sets this flag.\n   *\n   *   FT_LOAD_VERTICAL_LAYOUT ::\n   *     Load the glyph for vertical text layout.  In particular, the\n   *     `advance' value in the @FT_GlyphSlotRec structure is set to the\n   *     `vertAdvance' value of the `metrics' field.\n   *\n   *     In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use\n   *     this flag currently.  Reason is that in this case vertical metrics\n   *     get synthesized, and those values are not always consistent across\n   *     various font formats.\n   *\n   *   FT_LOAD_FORCE_AUTOHINT ::\n   *     Indicates that the auto-hinter is preferred over the font's native\n   *     hinter.  See also the note below.\n   *\n   *   FT_LOAD_CROP_BITMAP ::\n   *     Indicates that the font driver should crop the loaded bitmap glyph\n   *     (i.e., remove all space around its black bits).  Not all drivers\n   *     implement this.\n   *\n   *   FT_LOAD_PEDANTIC ::\n   *     Indicates that the font driver should perform pedantic verifications\n   *     during glyph loading.  This is mostly used to detect broken glyphs\n   *     in fonts.  By default, FreeType tries to handle broken fonts also.\n   *\n   *     In particular, errors from the TrueType bytecode engine are not\n   *     passed to the application if this flag is not set; this might\n   *     result in partially hinted or distorted glyphs in case a glyph's\n   *     bytecode is buggy.\n   *\n   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::\n   *     Ignored.  Deprecated.\n   *\n   *   FT_LOAD_NO_RECURSE ::\n   *     This flag is only used internally.  It merely indicates that the\n   *     font driver should not load composite glyphs recursively.  Instead,\n   *     it should set the `num_subglyph' and `subglyphs' values of the\n   *     glyph slot accordingly, and set `glyph->format' to\n   *     @FT_GLYPH_FORMAT_COMPOSITE.\n   *\n   *     The description of sub-glyphs is not available to client\n   *     applications for now.\n   *\n   *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.\n   *\n   *   FT_LOAD_IGNORE_TRANSFORM ::\n   *     Indicates that the transform matrix set by @FT_Set_Transform should\n   *     be ignored.\n   *\n   *   FT_LOAD_MONOCHROME ::\n   *     This flag is used with @FT_LOAD_RENDER to indicate that you want to\n   *     render an outline glyph to a 1-bit monochrome bitmap glyph, with\n   *     8~pixels packed into each byte of the bitmap data.\n   *\n   *     Note that this has no effect on the hinting algorithm used.  You\n   *     should rather use @FT_LOAD_TARGET_MONO so that the\n   *     monochrome-optimized hinting algorithm is used.\n   *\n   *   FT_LOAD_LINEAR_DESIGN ::\n   *     Indicates that the `linearHoriAdvance' and `linearVertAdvance'\n   *     fields of @FT_GlyphSlotRec should be kept in font units.  See\n   *     @FT_GlyphSlotRec for details.\n   *\n   *   FT_LOAD_NO_AUTOHINT ::\n   *     Disable auto-hinter.  See also the note below.\n   *\n   *   FT_LOAD_COLOR ::\n   *     This flag is used to request loading of color embedded-bitmap\n   *     images.  The resulting color bitmaps, if available, will have the\n   *     @FT_PIXEL_MODE_BGRA format.  When the flag is not used and color\n   *     bitmaps are found, they will be converted to 256-level gray\n   *     bitmaps transparently.  Those bitmaps will be in the\n   *     @FT_PIXEL_MODE_GRAY format.\n   *\n   * @note:\n   *   By default, hinting is enabled and the font's native hinter (see\n   *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can\n   *   disable hinting by setting @FT_LOAD_NO_HINTING or change the\n   *   precedence by setting @FT_LOAD_FORCE_AUTOHINT.  You can also set\n   *   @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be\n   *   used at all.\n   *\n   *   See the description of @FT_FACE_FLAG_TRICKY for a special exception\n   *   (affecting only a handful of Asian fonts).\n   *\n   *   Besides deciding which hinter to use, you can also decide which\n   *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.\n   *\n   *   Note that the auto-hinter needs a valid Unicode cmap (either a native\n   *   one or synthesized by FreeType) for producing correct results.  If a\n   *   font provides an incorrect mapping (for example, assigning the\n   *   character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a\n   *   mathematical integral sign), the auto-hinter might produce useless\n   *   results.\n   *\n   */\n#define FT_LOAD_DEFAULT                      0x0\n#define FT_LOAD_NO_SCALE                     ( 1L << 0 )\n#define FT_LOAD_NO_HINTING                   ( 1L << 1 )\n#define FT_LOAD_RENDER                       ( 1L << 2 )\n#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )\n#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )\n#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )\n#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )\n#define FT_LOAD_PEDANTIC                     ( 1L << 7 )\n#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )\n#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )\n#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )\n#define FT_LOAD_MONOCHROME                   ( 1L << 12 )\n#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )\n#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )\n  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */\n#define FT_LOAD_COLOR                        ( 1L << 20 )\n\n  /* */\n\n  /* used internally only by certain font drivers! */\n#define FT_LOAD_ADVANCE_ONLY                 ( 1L << 8 )\n#define FT_LOAD_SBITS_ONLY                   ( 1L << 14 )\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_TARGET_XXX\n   *\n   * @description:\n   *   A list of values that are used to select a specific hinting algorithm\n   *   to use by the hinter.  You should OR one of these values to your\n   *   `load_flags' when calling @FT_Load_Glyph.\n   *\n   *   Note that font's native hinters may ignore the hinting algorithm you\n   *   have specified (e.g., the TrueType bytecode interpreter).  You can set\n   *   @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.\n   *\n   *   Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it\n   *   always implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   * @values:\n   *   FT_LOAD_TARGET_NORMAL ::\n   *     This corresponds to the default hinting algorithm, optimized for\n   *     standard gray-level rendering.  For monochrome output, use\n   *     @FT_LOAD_TARGET_MONO instead.\n   *\n   *   FT_LOAD_TARGET_LIGHT ::\n   *     A lighter hinting algorithm for non-monochrome modes.  Many\n   *     generated glyphs are more fuzzy but better resemble its original\n   *     shape.  A bit like rendering on Mac OS~X.\n   *\n   *     As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   *   FT_LOAD_TARGET_MONO ::\n   *     Strong hinting algorithm that should only be used for monochrome\n   *     output.  The result is probably unpleasant if the glyph is rendered\n   *     in non-monochrome modes.\n   *\n   *   FT_LOAD_TARGET_LCD ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally\n   *     decimated LCD displays.\n   *\n   *   FT_LOAD_TARGET_LCD_V ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically\n   *     decimated LCD displays.\n   *\n   * @note:\n   *   You should use only _one_ of the FT_LOAD_TARGET_XXX values in your\n   *   `load_flags'.  They can't be ORed.\n   *\n   *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the\n   *   corresponding mode (i.e., the mode which matches the used algorithm\n   *   best).  An exeption is FT_LOAD_TARGET_MONO since it implies\n   *   @FT_LOAD_MONOCHROME.\n   *\n   *   You can use a hinting algorithm that doesn't correspond to the same\n   *   rendering mode.  As an example, it is possible to use the `light'\n   *   hinting algorithm and have the results rendered in horizontal LCD\n   *   pixel mode, with code like\n   *\n   *     {\n   *       FT_Load_Glyph( face, glyph_index,\n   *                      load_flags | FT_LOAD_TARGET_LIGHT );\n   *\n   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );\n   *     }\n   *\n   */\n#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )\n\n#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )\n#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )\n#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )\n#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )\n#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )\n\n\n  /**************************************************************************\n   *\n   * @macro:\n   *   FT_LOAD_TARGET_MODE\n   *\n   * @description:\n   *   Return the @FT_Render_Mode corresponding to a given\n   *   @FT_LOAD_TARGET_XXX value.\n   *\n   */\n#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Transform                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to set the transformation that is applied to glyph */\n  /*    images when they are loaded into a glyph slot through              */\n  /*    @FT_Load_Glyph.                                                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the transformation's 2x2 matrix.  Use~0 for */\n  /*              the identity matrix.                                     */\n  /*    delta  :: A pointer to the translation vector.  Use~0 for the null */\n  /*              vector.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The transformation is only applied to scalable image formats after */\n  /*    the glyph has been loaded.  It means that hinting is unaltered by  */\n  /*    the transformation and is performed on the character size given in */\n  /*    the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes.         */\n  /*                                                                       */\n  /*    Note that this also transforms the `face.glyph.advance' field, but */\n  /*    *not* the values in `face.glyph.metrics'.                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Render_Mode                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the render modes supported by       */\n  /*    FreeType~2.  Each mode corresponds to a specific type of scanline  */\n  /*    conversion performed on the outline.                               */\n  /*                                                                       */\n  /*    For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode'     */\n  /*    field in the @FT_GlyphSlotRec structure gives the format of the    */\n  /*    returned bitmap.                                                   */\n  /*                                                                       */\n  /*    All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RENDER_MODE_NORMAL ::                                           */\n  /*      This is the default render mode; it corresponds to 8-bit         */\n  /*      anti-aliased bitmaps.                                            */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LIGHT ::                                            */\n  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */\n  /*      defined as a separate value because render modes are also used   */\n  /*      indirectly to define hinting algorithm selectors.  See           */\n  /*      @FT_LOAD_TARGET_XXX for details.                                 */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_MONO ::                                             */\n  /*      This mode corresponds to 1-bit bitmaps (with 2~levels of         */\n  /*      opacity).                                                        */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD ::                                              */\n  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */\n  /*      displays like LCD screens.  It produces 8-bit bitmaps that are   */\n  /*      3~times the width of the original glyph outline in pixels, and   */\n  /*      which use the @FT_PIXEL_MODE_LCD mode.                           */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD_V ::                                            */\n  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */\n  /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */\n  /*      8-bit bitmaps that are 3~times the height of the original        */\n  /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */\n  /*    filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */\n  /*    (not active in the default builds).  It is up to the caller to     */\n  /*    either call @FT_Library_SetLcdFilter (if available) or do the      */\n  /*    filtering itself.                                                  */\n  /*                                                                       */\n  /*    The selected render mode only affects vector glyphs of a font.     */\n  /*    Embedded bitmaps often have a different pixel mode like            */\n  /*    @FT_PIXEL_MODE_MONO.  You can use @FT_Bitmap_Convert to transform  */\n  /*    them into 8-bit pixmaps.                                           */\n  /*                                                                       */\n  typedef enum  FT_Render_Mode_\n  {\n    FT_RENDER_MODE_NORMAL = 0,\n    FT_RENDER_MODE_LIGHT,\n    FT_RENDER_MODE_MONO,\n    FT_RENDER_MODE_LCD,\n    FT_RENDER_MODE_LCD_V,\n\n    FT_RENDER_MODE_MAX\n\n  } FT_Render_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_render_mode_xxx                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Render_Mode values instead.                                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL                */\n  /*    ft_render_mode_mono   :: see @FT_RENDER_MODE_MONO                  */\n  /*                                                                       */\n#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL\n#define ft_render_mode_mono    FT_RENDER_MODE_MONO\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Render_Glyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph image to a bitmap.  It does so by inspecting */\n  /*    the glyph image format, finding the relevant renderer, and         */\n  /*    invoking it.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot        :: A handle to the glyph slot containing the image to  */\n  /*                   convert.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: This is the render mode used to render the glyph    */\n  /*                   image into a bitmap.  See @FT_Render_Mode for a     */\n  /*                   list of possible values.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Kerning_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify which kerning values to return in   */\n  /*    @FT_Get_Kerning.                                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_KERNING_DEFAULT  :: Return scaled and grid-fitted kerning       */\n  /*                           distances (value is~0).                     */\n  /*                                                                       */\n  /*    FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning    */\n  /*                           distances.                                  */\n  /*                                                                       */\n  /*    FT_KERNING_UNSCALED :: Return the kerning vector in original font  */\n  /*                           units.                                      */\n  /*                                                                       */\n  typedef enum  FT_Kerning_Mode_\n  {\n    FT_KERNING_DEFAULT  = 0,\n    FT_KERNING_UNFITTED,\n    FT_KERNING_UNSCALED\n\n  } FT_Kerning_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_default                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_DEFAULT       */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_default   FT_KERNING_DEFAULT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unfitted                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNFITTED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unfitted  FT_KERNING_UNFITTED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unscaled                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNSCALED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unscaled  FT_KERNING_UNSCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the kerning vector between two glyphs of a same face.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /*    kern_mode   :: See @FT_Kerning_Mode for more information.          */\n  /*                   Determines the scale and dimension of the returned  */\n  /*                   kerning vector.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning vector.  This is either in font units   */\n  /*                   or in pixels (26.6 format) for scalable formats,    */\n  /*                   and in pixels for fixed-sizes formats.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this method.  Other layouts, or more sophisticated    */\n  /*    kernings, are out of the scope of this API function -- they can be */\n  /*    implemented through format-specific interfaces.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Track_Kerning                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the track kerning for a given face object at a given size.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to a source face object.                    */\n  /*                                                                       */\n  /*    point_size :: The point size in 16.16 fractional points.           */\n  /*                                                                       */\n  /*    degree     :: The degree of tightness.  Increasingly negative      */\n  /*                  values represent tighter track kerning, while        */\n  /*                  increasingly positive values represent looser track  */\n  /*                  kerning.  Value zero means no track kerning.         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning   :: The kerning in 16.16 fractional points, to be        */\n  /*                  uniformly applied between all glyphs.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, only the Type~1 font driver supports track kerning,     */\n  /*    using data from AFM files (if attached with @FT_Attach_File or     */\n  /*    @FT_Attach_Stream).                                                */\n  /*                                                                       */\n  /*    Only very few AFM files come with track kerning data; please refer */\n  /*    to the Adobe's AFM specification for more details.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII name of a given glyph in a face.  This only     */\n  /*    works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    buffer_max  :: The maximum number of bytes available in the        */\n  /*                   buffer.                                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer      :: A pointer to a target buffer where the name is      */\n  /*                   copied to.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error is returned if the face doesn't provide glyph names or if */\n  /*    the glyph index is invalid.  In all cases of failure, the first    */\n  /*    byte of `buffer' is set to~0 to indicate an empty name.            */\n  /*                                                                       */\n  /*    The glyph name is truncated to fit within the buffer if it is too  */\n  /*    long.  The returned string is always zero-terminated.              */\n  /*                                                                       */\n  /*    Be aware that FreeType reorders glyph indices internally so that   */\n  /*    glyph index~0 always corresponds to the `missing glyph' (called    */\n  /*    `.notdef').                                                        */\n  /*                                                                       */\n  /*    This function is not compiled within the library if the config     */\n  /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */\n  /*    `include/freetype/config/ftoptions.h'.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII PostScript name of a given face, if available.  */\n  /*    This only works with PostScript and TrueType fonts.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the face's PostScript name.  NULL if unavailable.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned pointer is owned by the face and is destroyed with    */\n  /*    it.                                                                */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_Postscript_Name( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Charmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap by its encoding tag (as listed in           */\n  /*    `freetype.h').                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    encoding :: A handle to the selected encoding.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if no charmap in the face           */\n  /*    corresponds to the encoding queried here.                          */\n  /*                                                                       */\n  /*    Because many fonts contain more than a single cmap for Unicode     */\n  /*    encoding, this function has some special code to select the one    */\n  /*    which covers Unicode best (`best' in the sense that a UCS-4 cmap   */\n  /*    is preferred to a UCS-2 cmap).  It is thus preferable to           */\n  /*    @FT_Set_Charmap in this case.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Charmap                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap for character code to glyph index mapping.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap :: A handle to the selected charmap.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if the charmap is not part of       */\n  /*    the face (i.e., if it is not listed in the `face->charmaps'        */\n  /*    table).                                                            */\n  /*                                                                       */\n  /*    It also fails if a type~14 charmap is selected.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Get_Charmap_Index\n   *\n   * @description:\n   *   Retrieve index of a given charmap.\n   *\n   * @input:\n   *   charmap ::\n   *     A handle to a charmap.\n   *\n   * @return:\n   *   The index into the array of character maps within the face to which\n   *   `charmap' belongs.  If an error occurs, -1 is returned.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Char_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code.  This function   */\n  /*    uses a charmap object to do the mapping.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /*    charcode :: The character code.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within the  */\n  /*    file.  This is done to ensure that value~0 always corresponds to   */\n  /*    the `missing glyph'.  If the first glyph is not named `.notdef',   */\n  /*    then for Type~1 and Type~42 fonts, `.notdef' will be moved into    */\n  /*    the glyph ID~0 position, and whatever was there will be moved to   */\n  /*    the position `.notdef' had.  For Type~1 fonts, if there is no      */\n  /*    `.notdef' glyph at all, then one will be created at index~0 and    */\n  /*    whatever was there will be moved to the last index -- Type~42      */\n  /*    fonts are considered invalid under this condition.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_First_Char                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the first character code in the    */\n  /*    current charmap of a given face.  It also returns the              */\n  /*    corresponding glyph index.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex :: Glyph index of first character code.  0~if charmap is   */\n  /*               empty.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's first character code.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_Next_Char to be able to  */\n  /*    parse all character codes available in a given charmap.  The code  */\n  /*    should look like this:                                             */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_ULong  charcode;                                              */\n  /*      FT_UInt   gindex;                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      charcode = FT_Get_First_Char( face, &gindex );                   */\n  /*      while ( gindex != 0 )                                            */\n  /*      {                                                                */\n  /*        ... do something with (charcode,gindex) pair ...               */\n  /*                                                                       */\n  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */\n  /*      }                                                                */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 if the charmap is empty.  The     */\n  /*    result itself can be~0 in two cases: if the charmap is empty or    */\n  /*    if the value~0 is the first valid character code.                  */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Next_Char                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the next character code in the     */\n  /*    current charmap of a given face following the value `char_code',   */\n  /*    as well as the corresponding glyph index.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: A handle to the source face object.                   */\n  /*    char_code :: The starting character code.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex   :: Glyph index of next character code.  0~if charmap     */\n  /*                 is empty.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's next character code.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_First_Char to walk       */\n  /*    over all character codes available in a given charmap.  See the    */\n  /*    note for this function for a simple code example.                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 when there are no more codes in   */\n  /*    the charmap.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_Next_Char( FT_Face    face,\n                    FT_ULong   char_code,\n                    FT_UInt   *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Name_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given glyph name.  This function uses  */\n  /*    driver specific objects to do the translation.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the source face object.                  */\n  /*                                                                       */\n  /*    glyph_name :: The glyph name.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name );\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SUBGLYPH_FLAG_XXX\n   *\n   * @description:\n   *   A list of constants used to describe subglyphs.  Please refer to the\n   *   TrueType specification for the meaning of the various flags.\n   *\n   * @values:\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::\n   *   FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::\n   *   FT_SUBGLYPH_FLAG_SCALE ::\n   *   FT_SUBGLYPH_FLAG_XY_SCALE ::\n   *   FT_SUBGLYPH_FLAG_2X2 ::\n   *   FT_SUBGLYPH_FLAG_USE_MY_METRICS ::\n   *\n   */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_SubGlyph_Info\n   *\n   * @description:\n   *   Retrieve a description of a given subglyph.  Only use it if\n   *   `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is\n   *   returned otherwise.\n   *\n   * @input:\n   *   glyph ::\n   *     The source glyph slot.\n   *\n   *   sub_index ::\n   *     The index of the subglyph.  Must be less than\n   *     `glyph->num_subglyphs'.\n   *\n   * @output:\n   *   p_index ::\n   *     The glyph index of the subglyph.\n   *\n   *   p_flags ::\n   *     The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.\n   *\n   *   p_arg1 ::\n   *     The subglyph's first argument (if any).\n   *\n   *   p_arg2 ::\n   *     The subglyph's second argument (if any).\n   *\n   *   p_transform ::\n   *     The subglyph transformation (if any).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The values of `*p_arg1', `*p_arg2', and `*p_transform' must be\n   *   interpreted depending on the flags returned in `*p_flags'.  See the\n   *   TrueType specification for details.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FSTYPE_XXX                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `fsType' field of the OS/2 table   */\n  /*    in a TrueType or OpenType font and the `FSType' entry in a         */\n  /*    PostScript font.  These bit flags are returned by                  */\n  /*    @FT_Get_FSType_Flags; they inform client applications of embedding */\n  /*    and subsetting restrictions associated with a font.                */\n  /*                                                                       */\n  /*    See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for  */\n  /*    more details.                                                      */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING ::                                 */\n  /*      Fonts with no fsType bit set may be embedded and permanently     */\n  /*      installed on the remote system by an application.                */\n  /*                                                                       */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING ::                          */\n  /*      Fonts that have only this bit set must not be modified, embedded */\n  /*      or exchanged in any manner without first obtaining permission of */\n  /*      the font software copyright owner.                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING ::                           */\n  /*      If this bit is set, the font may be embedded and temporarily     */\n  /*      loaded on the remote system.  Documents containing Preview &     */\n  /*      Print fonts must be opened `read-only'; no edits can be applied  */\n  /*      to the document.                                                 */\n  /*                                                                       */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING ::                                    */\n  /*      If this bit is set, the font may be embedded but must only be    */\n  /*      installed temporarily on other systems.  In contrast to Preview  */\n  /*      & Print fonts, documents containing editable fonts may be opened */\n  /*      for reading, editing is permitted, and changes may be saved.     */\n  /*                                                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING ::                                         */\n  /*      If this bit is set, the font may not be subsetted prior to       */\n  /*      embedding.                                                       */\n  /*                                                                       */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY ::                                 */\n  /*      If this bit is set, only bitmaps contained in the font may be    */\n  /*      embedded; no outline data may be embedded.  If there are no      */\n  /*      bitmaps available in the font, then the font is unembeddable.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    While the fsType flags can indicate that a font may be embedded, a */\n  /*    license with the font vendor may be separately required to use the */\n  /*    font in this way.                                                  */\n  /*                                                                       */\n#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000\n#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002\n#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004\n#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008\n#define FT_FSTYPE_NO_SUBSETTING                 0x0100\n#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the fsType flags for a font.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The fsType flags, @FT_FSTYPE_XXX.                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use this function rather than directly reading the `fs_type' field */\n  /*    in the @PS_FontInfoRec structure which is only guaranteed to       */\n  /*    return the correct results for Type~1 fonts.                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.8                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UShort )\n  FT_Get_FSType_Flags( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_variants                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Variants                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 interface to Unicode Ideographic Variation          */\n  /*    Sequences (IVS), using the SFNT cmap format~14.                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Many CJK characters have variant forms.  They are a sort of grey   */\n  /*    area somewhere between being totally irrelevant and semantically   */\n  /*    distinct; for this reason, the Unicode consortium decided to       */\n  /*    introduce Ideographic Variation Sequences (IVS), consisting of a   */\n  /*    Unicode base character and one of 240 variant selectors            */\n  /*    (U+E0100-U+E01EF), instead of further extending the already huge   */\n  /*    code range for CJK characters.                                     */\n  /*                                                                       */\n  /*    An IVS is registered and unique; for further details please refer  */\n  /*    to Unicode Technical Standard #37, the Ideographic Variation       */\n  /*    Database:                                                          */\n  /*                                                                       */\n  /*      http://www.unicode.org/reports/tr37/                             */\n  /*                                                                       */\n  /*    To date (November 2012), the character with the most variants is   */\n  /*    U+9089, having 31 such IVS.                                        */\n  /*                                                                       */\n  /*    Adobe and MS decided to support IVS with a new cmap subtable       */\n  /*    (format~14).  It is an odd subtable because it is not a mapping of */\n  /*    input code points to glyphs, but contains lists of all variants    */\n  /*    supported by the font.                                             */\n  /*                                                                       */\n  /*    A variant may be either `default' or `non-default'.  A default     */\n  /*    variant is the one you will get for that code point if you look it */\n  /*    up in the standard Unicode cmap.  A non-default variant is a       */\n  /*    different glyph.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIndex                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code as modified by    */\n  /*    the variation selector.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character code point in Unicode.                             */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode code point of the variation selector.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means either `undefined character code', or    */\n  /*    `undefined selector code', or `no variation selector cmap          */\n  /*    subtable', or `current CharMap is not Unicode'.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value~0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  /*    This function is only meaningful if                                */\n  /*      a) the font has a variation selector cmap sub table,             */\n  /*    and                                                                */\n  /*      b) the current charmap has a Unicode encoding.                   */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Face_GetCharVariantIndex( FT_Face   face,\n                               FT_ULong  charcode,\n                               FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIsDefault                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether this variant of this Unicode character is the one to */\n  /*    be found in the `cmap'.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode codepoint of the variation selector.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if found in the standard (Unicode) cmap, 0~if found in the       */\n  /*    variation selector cmap, or -1 if it is not a variant.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is only meaningful if the font has a variation       */\n  /*    selector cmap subtable.                                            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Int )\n  FT_Face_GetCharVariantIsDefault( FT_Face   face,\n                                   FT_ULong  charcode,\n                                   FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantSelectors                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    in the font.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of selector code points, or NULL if there is */\n  /*    no valid variant selector cmap subtable.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantSelectors( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantsOfChar                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    for the specified character code.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of variant selector code points which are    */\n  /*    active for the given character, or NULL if the corresponding list  */\n  /*    is empty.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantsOfChar( FT_Face   face,\n                             FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharsOfVariant                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode character codes found for */\n  /*    the specified variant selector.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The variant selector code point in Unicode.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A list of all the code points which are specified by this selector */\n  /*    (both default and non-default codes are returned) or NULL if there */\n  /*    is no valid cmap or the variant selector is invalid.               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetCharsOfVariant( FT_Face   face,\n                             FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Computations                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Crunching fixed numbers and vectors.                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various functions used to perform            */\n  /*    computations on 16.16 fixed-float numbers or 2d vectors.           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_MulDiv                                                          */\n  /*    FT_MulFix                                                          */\n  /*    FT_DivFix                                                          */\n  /*    FT_RoundFix                                                        */\n  /*    FT_CeilFix                                                         */\n  /*    FT_FloorFix                                                        */\n  /*    FT_Vector_Transform                                                */\n  /*    FT_Matrix_Multiply                                                 */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    with maximum accuracy (it uses a 64-bit intermediate integer       */\n  /*    whenever necessary).                                               */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c );\n\n\n  /* */\n\n  /* The following #if 0 ... #endif is for the documentation formatter, */\n  /* hiding the internal `FT_MULFIX_INLINED' macro.                     */\n\n#if 0\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*b)/0x10000' with maximum accuracy.  Most of the time this is   */\n  /*    used to multiply a given value by a 16.16 fixed-point factor.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/0x10000'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function has been optimized for the case where the absolute   */\n  /*    value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */\n  /*    As this happens mainly when scaling from notional units to         */\n  /*    fractional pixels in FreeType, it resulted in noticeable speed     */\n  /*    improvements between versions 2.x and 1.x.                         */\n  /*                                                                       */\n  /*    As a conclusion, always try to place a 16.16 factor as the         */\n  /*    _second_ argument of this function; this can make a great          */\n  /*    difference.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n\n  /* */\n#endif\n\n#ifdef FT_MULFIX_INLINED\n#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )\n#else\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_DivFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*0x10000)/b' with maximum accuracy.  Most of the time, this is  */\n  /*    used to divide a given value by a 16.16 fixed-point factor.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*0x10000)/b'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The optimization for FT_DivFix() is simple: If (a~<<~16) fits in   */\n  /*    32~bits, then the division is computed directly.  Otherwise, we    */\n  /*    use a specialized version of @FT_MulDiv.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_RoundFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to round a 16.16 fixed number.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number to be rounded.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x8000) & -0x10000'.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_CeilFix                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the ceiling function of a   */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the ceiling function is to be computed.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FloorFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the floor function of a     */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the floor function is to be computed.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `a & -0x10000'.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Vector_Transform                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a single vector through a 2x2 matrix.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    vector :: The target vector to transform.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the source 2x2 matrix.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `vector' or `matrix' is invalid. */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Vector_Transform( FT_Vector*        vec,\n                       const FT_Matrix*  matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    version                                                            */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType Version                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions and macros related to FreeType versions.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Note that those functions and macros are of limited use because    */\n  /*    even a new release of FreeType with only documentation changes     */\n  /*    increases the version number.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FREETYPE_XXX\n   *\n   * @description:\n   *   These three macros identify the FreeType source code version.\n   *   Use @FT_Library_Version to access them at runtime.\n   *\n   * @values:\n   *   FREETYPE_MAJOR :: The major version number.\n   *   FREETYPE_MINOR :: The minor version number.\n   *   FREETYPE_PATCH :: The patch level.\n   *\n   * @note:\n   *   The version number of FreeType if built as a dynamic link library\n   *   with the `libtool' package is _not_ controlled by these three\n   *   macros.\n   *\n   */\n#define FREETYPE_MAJOR  2\n#define FREETYPE_MINOR  5\n#define FREETYPE_PATCH  0\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the version of the FreeType library being used.  This is    */\n  /*    useful when dynamically linking to the library, since one cannot   */\n  /*    use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and               */\n  /*    @FREETYPE_PATCH.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A source library handle.                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amajor  :: The major version number.                               */\n  /*                                                                       */\n  /*    aminor  :: The minor version number.                               */\n  /*                                                                       */\n  /*    apatch  :: The patch version number.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' argument is because */\n  /*    certain programs implement library initialization in a custom way  */\n  /*    that doesn't use @FT_Init_FreeType.                                */\n  /*                                                                       */\n  /*    In such cases, the library version might not be available before   */\n  /*    the library object has been created.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse all bytecode instructions of a TrueType font file to check   */\n  /*    whether any of the patented opcodes are used.  This is only useful */\n  /*    if you want to be able to use the unpatented hinter with           */\n  /*    fonts that do *not* use these opcodes.                             */\n  /*                                                                       */\n  /*    Note that this function parses *all* glyph instructions in the     */\n  /*    font file, which may be slow.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face handle.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if this is a TrueType font that uses one of the patented         */\n  /*    opcodes, 0~otherwise.                                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Enable or disable the unpatented hinter for a given face.          */\n  /*    Only enable it if you have determined that the face doesn't        */\n  /*    use any patented opcodes (see @FT_Face_CheckTrueTypePatents).      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A face handle.                                            */\n  /*                                                                       */\n  /*    value :: New boolean setting.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The old setting value.  This will always be false if this is not   */\n  /*    an SFNT font, or if the unpatented hinter is not compiled in this  */\n  /*    instance of the library.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FREETYPE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftadvanc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftadvanc.h                                                             */\n/*                                                                         */\n/*    Quick computation of advance widths (specification only).            */\n/*                                                                         */\n/*  Copyright 2008, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTADVANC_H__\n#define __FTADVANC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   quick_advance\n   *\n   * @title:\n   *   Quick retrieval of advance values\n   *\n   * @abstract:\n   *   Retrieve horizontal and vertical advance values without processing\n   *   glyph outlines, if possible.\n   *\n   * @description:\n   *   This section contains functions to quickly extract advance values\n   *   without handling glyph outlines, if possible.\n   */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_ADVANCE_FLAG_FAST_ONLY                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A bit-flag to be OR-ed with the `flags' parameter of the           */\n  /*    @FT_Get_Advance and @FT_Get_Advances functions.                    */\n  /*                                                                       */\n  /*    If set, it indicates that you want these functions to fail if the  */\n  /*    corresponding hinting mode or font driver doesn't allow for very   */\n  /*    quick advance computation.                                         */\n  /*                                                                       */\n  /*    Typically, glyphs which are either unscaled, unhinted, bitmapped,  */\n  /*    or light-hinted can have their advance width computed very         */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /*    Normal and bytecode hinted modes, which require loading, scaling,  */\n  /*    and hinting of the glyph outline, are extremely slow by            */\n  /*    comparison.                                                        */\n  /*                                                                       */\n#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advance                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance value of a given glyph outline in an          */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: The source @FT_Face handle.                          */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /*    load_flags :: A set of bit flags similar to those used when        */\n  /*                  calling @FT_Load_Glyph, used to determine what kind  */\n  /*                  of advances you need.                                */\n  /* <Output>                                                              */\n  /*    padvance :: The advance value.  If scaling is performed (based on  */\n  /*                the value of `load_flags'), the advance value is in    */\n  /*                16.16 format.  Otherwise, it is in font units.         */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */\n  /*                vertical advance corresponding to a vertical layout.   */\n  /*                Otherwise, it is the horizontal advance in a           */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    A scaled advance is returned in 16.16 format but isn't transformed */\n  /*    by the affine transformation specified by @FT_Set_Transform.       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advance( FT_Face    face,\n                  FT_UInt    gindex,\n                  FT_Int32   load_flags,\n                  FT_Fixed  *padvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advances                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance values of several glyph outlines in an        */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: The source @FT_Face handle.                         */\n  /*                                                                       */\n  /*    start       :: The first glyph index.                              */\n  /*                                                                       */\n  /*    count       :: The number of advance values you want to retrieve.  */\n  /*                                                                       */\n  /*    load_flags  :: A set of bit flags similar to those used when       */\n  /*                   calling @FT_Load_Glyph.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    padvance :: The advance values.  This array, to be provided by the */\n  /*                caller, must contain at least `count' elements.        */\n  /*                                                                       */\n  /*                If scaling is performed (based on the value of         */\n  /*                `load_flags'), the advance values are in 16.16 format. */\n  /*                Otherwise, they are in font units.                     */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */\n  /*                vertical advances corresponding to a vertical layout.  */\n  /*                Otherwise, they are the horizontal advances in a       */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    Scaled advances are returned in 16.16 format but aren't            */\n  /*    transformed by the affine transformation specified by              */\n  /*    @FT_Set_Transform.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advances( FT_Face    face,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed  *padvances );\n\n/* */\n\n\nFT_END_HEADER\n\n#endif /* __FTADVANC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftautoh.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftautoh.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the auto-hinter (specification only).   */\n/*                                                                         */\n/*  Copyright 2012, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTAUTOH_H__\n#define __FTAUTOH_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   auto_hinter\n   *\n   * @title:\n   *   The auto-hinter\n   *\n   * @abstract:\n   *   Controlling the auto-hinting module.\n   *\n   * @description:\n   *   While FreeType's auto-hinter doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   Note that the auto-hinter's module name is `autofitter' for\n   *   historical reasons.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   glyph-to-script-map\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The auto-hinter provides various script modules to hint glyphs.\n   *   Examples of supported scripts are Latin or CJK.  Before a glyph is\n   *   auto-hinted, the Unicode character map of the font gets examined, and\n   *   the script is then determined based on Unicode character ranges, see\n   *   below.\n   *\n   *   OpenType fonts, however, often provide much more glyphs than\n   *   character codes (small caps, superscripts, ligatures, swashes, etc.),\n   *   to be controlled by so-called `features'.  Handling OpenType features\n   *   can be quite complicated and thus needs a separate library on top of\n   *   FreeType.\n   *\n   *   The mapping between glyph indices and scripts (in the auto-hinter\n   *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an\n   *   array with `num_glyphs' elements, as found in the font's @FT_Face\n   *   structure.  The `glyph-to-script-map' property returns a pointer to\n   *   this array which can be modified as needed.  Note that the\n   *   modification should happen before the first glyph gets processed by\n   *   the auto-hinter so that the global analysis of the font shapes\n   *   actually uses the modified mapping.\n   *\n   *   The following example code demonstrates how to access it (omitting\n   *   the error handling).\n   *\n   *   {\n   *     FT_Library                library;\n   *     FT_Face                   face;\n   *     FT_Prop_GlyphToScriptMap  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *\n   *     prop.face = face;\n   *\n   *     FT_Property_Get( library, \"autofitter\",\n   *                               \"glyph-to-script-map\", &prop );\n   *\n   *     // adjust `prop.map' as needed right here\n   *\n   *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );\n   *   }\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_AUTOHINTER_SCRIPT_XXX\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   A list of constants used for the @glyph-to-script-map property to\n   *   specify the script submodule the auto-hinter should use for hinting a\n   *   particular glyph.\n   *\n   * @values:\n   *   FT_AUTOHINTER_SCRIPT_NONE ::\n   *     Don't auto-hint this glyph.\n   *\n   *   FT_AUTOHINTER_SCRIPT_LATIN ::\n   *     Apply the latin auto-hinter.  For the auto-hinter, `latin' is a\n   *     very broad term, including Cyrillic and Greek also since characters\n   *     from those scripts share the same design constraints.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0020 - U+007F  // Basic Latin (no control characters)\n   *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)\n   *       U+0100 - U+017F  // Latin Extended-A\n   *       U+0180 - U+024F  // Latin Extended-B\n   *       U+0250 - U+02AF  // IPA Extensions\n   *       U+02B0 - U+02FF  // Spacing Modifier Letters\n   *       U+0300 - U+036F  // Combining Diacritical Marks\n   *       U+0370 - U+03FF  // Greek and Coptic\n   *       U+0400 - U+04FF  // Cyrillic\n   *       U+0500 - U+052F  // Cyrillic Supplement\n   *       U+1D00 - U+1D7F  // Phonetic Extensions\n   *       U+1D80 - U+1DBF  // Phonetic Extensions Supplement\n   *       U+1DC0 - U+1DFF  // Combining Diacritical Marks Supplement\n   *       U+1E00 - U+1EFF  // Latin Extended Additional\n   *       U+1F00 - U+1FFF  // Greek Extended\n   *       U+2000 - U+206F  // General Punctuation\n   *       U+2070 - U+209F  // Superscripts and Subscripts\n   *       U+20A0 - U+20CF  // Currency Symbols\n   *       U+2150 - U+218F  // Number Forms\n   *       U+2460 - U+24FF  // Enclosed Alphanumerics\n   *       U+2C60 - U+2C7F  // Latin Extended-C\n   *       U+2DE0 - U+2DFF  // Cyrillic Extended-A\n   *       U+2E00 - U+2E7F  // Supplemental Punctuation\n   *       U+A640 - U+A69F  // Cyrillic Extended-B\n   *       U+A720 - U+A7FF  // Latin Extended-D\n   *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)\n   *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols\n   *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_CJK ::\n   *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old\n   *     Vietnamese, and some other scripts.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+1100 - U+11FF  // Hangul Jamo\n   *       U+2E80 - U+2EFF  // CJK Radicals Supplement\n   *       U+2F00 - U+2FDF  // Kangxi Radicals\n   *       U+2FF0 - U+2FFF  // Ideographic Description Characters\n   *       U+3000 - U+303F  // CJK Symbols and Punctuation\n   *       U+3040 - U+309F  // Hiragana\n   *       U+30A0 - U+30FF  // Katakana\n   *       U+3100 - U+312F  // Bopomofo\n   *       U+3130 - U+318F  // Hangul Compatibility Jamo\n   *       U+3190 - U+319F  // Kanbun\n   *       U+31A0 - U+31BF  // Bopomofo Extended\n   *       U+31C0 - U+31EF  // CJK Strokes\n   *       U+31F0 - U+31FF  // Katakana Phonetic Extensions\n   *       U+3200 - U+32FF  // Enclosed CJK Letters and Months\n   *       U+3300 - U+33FF  // CJK Compatibility\n   *       U+3400 - U+4DBF  // CJK Unified Ideographs Extension A\n   *       U+4DC0 - U+4DFF  // Yijing Hexagram Symbols\n   *       U+4E00 - U+9FFF  // CJK Unified Ideographs\n   *       U+A960 - U+A97F  // Hangul Jamo Extended-A\n   *       U+AC00 - U+D7AF  // Hangul Syllables\n   *       U+D7B0 - U+D7FF  // Hangul Jamo Extended-B\n   *       U+F900 - U+FAFF  // CJK Compatibility Ideographs\n   *       U+FE10 - U+FE1F  // Vertical forms\n   *       U+FE30 - U+FE4F  // CJK Compatibility Forms\n   *       U+FF00 - U+FFEF  // Halfwidth and Fullwidth Forms\n   *      U+1B000 - U+1B0FF // Kana Supplement\n   *      U+1D300 - U+1D35F // Tai Xuan Hing Symbols\n   *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement\n   *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B\n   *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C\n   *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D\n   *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_INDIC ::\n   *     Apply the indic auto-hinter, covering all major scripts from the\n   *     Indian sub-continent and some other related scripts like Thai, Lao,\n   *     or Tibetan.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0900 - U+0DFF  // Indic Range\n   *       U+0F00 - U+0FFF  // Tibetan\n   *       U+1900 - U+194F  // Limbu\n   *       U+1B80 - U+1BBF  // Sundanese\n   *       U+1C80 - U+1CDF  // Meetei Mayak\n   *       U+A800 - U+A82F  // Syloti Nagri\n   *      U+11800 - U+118DF // Sharada\n   *     }\n   *\n   *     Note that currently Indic support is rudimentary only, missing blue\n   *     zone support.\n   *\n   */\n#define FT_AUTOHINTER_SCRIPT_NONE   0\n#define FT_AUTOHINTER_SCRIPT_LATIN  1\n#define FT_AUTOHINTER_SCRIPT_CJK    2\n#define FT_AUTOHINTER_SCRIPT_INDIC  3\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_GlyphToScriptMap\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The data exchange structure for the @glyph-to-script-map property.\n   *\n   */\n   typedef struct  FT_Prop_GlyphToScriptMap_\n   {\n     FT_Face   face;\n     FT_Byte*  map;\n\n   } FT_Prop_GlyphToScriptMap;\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   fallback-script\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   If no auto-hinter script module can be assigned to a glyph, a\n   *   fallback script gets assigned to it (see also the\n   *   @glyph-to-script-map property).  By default, this is\n   *   @FT_AUTOHINTER_SCRIPT_CJK.  Using the `fallback-script' property,\n   *   this fallback value can be changed.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"fallback-script\", &fallback_script );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   It's important to use the right timing for changing this value: The\n   *   creation of the glyph-to-script map which eventually uses the\n   *   fallback script value gets triggered either by setting or reading a\n   *   face-specific property like @glyph-to-script-map, or by auto-hinting\n   *   any glyph from that face.  In particular, if you have already created\n   *   an @FT_Face structure but not loaded any glyph (using the\n   *   auto-hinter), a change of the fallback glyph will affect this face.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   increase-x-height\n   *\n   * @description:\n   *   For ppem values in the range 6~<= ppem <= `increase-x-height', round\n   *   up the font's x~height much more often than normally.  If the value\n   *   is set to~0, which is the default, this feature is switched off.  Use\n   *   this property to improve the legibility of small font sizes if\n   *   necessary.\n   *\n   *   {\n   *     FT_Library               library;\n   *     FT_Face                  face;\n   *     FT_Prop_IncreaseXHeight  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *     FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );\n   *\n   *     prop.face  = face;\n   *     prop.limit = 14;\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"increase-x-height\", &prop );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   Set this value right after calling @FT_Set_Char_Size, but before\n   *   loading any glyph (using the auto-hinter).\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_IncreaseXHeight\n   *\n   * @description:\n   *   The data exchange structure for the @increase-x-height property.\n   *\n   */\n   typedef struct  FT_Prop_IncreaseXHeight_\n   {\n     FT_Face  face;\n     FT_UInt  limit;\n\n   } FT_Prop_IncreaseXHeight;\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTAUTOH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftbbox.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.h                                                               */\n/*                                                                         */\n/*    FreeType exact bbox computation (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /* It is separated from the rest of the engine for various technical     */\n  /* reasons.  It may well be integrated in `ftoutln' later.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTBBOX_H__\n#define __FTBBOX_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the exact bounding box of an outline.  This is slower      */\n  /*    than computing the control box.  However, it uses an advanced      */\n  /*    algorithm which returns _very_ quickly when the two boxes          */\n  /*    coincide.  Otherwise, the outline Bézier arcs are traversed to     */\n  /*    extract their extrema.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abbox   :: The outline's exact bounding box.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get      */\n  /*    reasonable values for the BBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the BBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBBOX_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (specification).     */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2009 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBDF_H__\n#define __FTBDF_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bdf_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BDF and PCF Files                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    BDF and PCF specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions specific to BDF */\n  /*    and PCF fonts.                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @enum:\n   *    FT_PropertyType\n   *\n   * @description:\n   *    A list of BDF property types.\n   *\n   * @values:\n   *    BDF_PROPERTY_TYPE_NONE ::\n   *      Value~0 is used to indicate a missing property.\n   *\n   *    BDF_PROPERTY_TYPE_ATOM ::\n   *      Property is a string atom.\n   *\n   *    BDF_PROPERTY_TYPE_INTEGER ::\n   *      Property is a 32-bit signed integer.\n   *\n   *    BDF_PROPERTY_TYPE_CARDINAL ::\n   *      Property is a 32-bit unsigned integer.\n   */\n  typedef enum  BDF_PropertyType_\n  {\n    BDF_PROPERTY_TYPE_NONE     = 0,\n    BDF_PROPERTY_TYPE_ATOM     = 1,\n    BDF_PROPERTY_TYPE_INTEGER  = 2,\n    BDF_PROPERTY_TYPE_CARDINAL = 3\n\n  } BDF_PropertyType;\n\n\n  /**********************************************************************\n   *\n   * @type:\n   *    BDF_Property\n   *\n   * @description:\n   *    A handle to a @BDF_PropertyRec structure to model a given\n   *    BDF/PCF property.\n   */\n  typedef struct BDF_PropertyRec_*  BDF_Property;\n\n\n /**********************************************************************\n  *\n  * @struct:\n  *    BDF_PropertyRec\n  *\n  * @description:\n  *    This structure models a given BDF/PCF property.\n  *\n  * @fields:\n  *    type ::\n  *      The property type.\n  *\n  *    u.atom ::\n  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.\n  *\n  *    u.integer ::\n  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.\n  *\n  *    u.cardinal ::\n  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.\n  */\n  typedef struct  BDF_PropertyRec_\n  {\n    BDF_PropertyType  type;\n    union {\n      const char*     atom;\n      FT_Int32        integer;\n      FT_UInt32       cardinal;\n\n    } u;\n\n  } BDF_PropertyRec;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Charset_ID\n  *\n  * @description:\n  *    Retrieve a BDF font character set identity, according to\n  *    the BDF specification.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  * @output:\n  *    acharset_encoding ::\n  *       Charset encoding, as a C~string, owned by the face.\n  *\n  *    acharset_registry ::\n  *       Charset registry, as a C~string, owned by the face.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with BDF faces, returning an error otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Property\n  *\n  * @description:\n  *    Retrieve a BDF property from a BDF or PCF font file.\n  *\n  * @input:\n  *    face :: A handle to the input face.\n  *\n  *    name :: The property name.\n  *\n  * @output:\n  *    aproperty :: The property.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function works with BDF _and_ PCF fonts.  It returns an error\n  *   otherwise.  It also returns an error if the property is not in the\n  *   font.\n  *\n  *   A `property' is a either key-value pair within the STARTPROPERTIES\n  *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the\n  *   `info->props' array within a `FontRec' structure of a PCF font.\n  *\n  *   Integer properties are always stored as `signed' within PCF fonts;\n  *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value\n  *   for BDF fonts only.\n  *\n  *   In case of error, `aproperty->type' is always set to\n  *   @BDF_PROPERTY_TYPE_NONE.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftbitmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.h                                                             */\n/*                                                                         */\n/*    FreeType utility functions for bitmaps (specification).              */\n/*                                                                         */\n/*  Copyright 2004-2006, 2008, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBITMAP_H__\n#define __FTBITMAP_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bitmap_handling                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Bitmap Handling                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Handling FT_Bitmap objects.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains functions for converting FT_Bitmap objects.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_New                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a pointer to an @FT_Bitmap structure.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the bitmap structure.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Copy                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy a bitmap into another one.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    source  :: A handle to the source bitmap.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target  :: A handle to the target bitmap.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Embolden                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\n  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\n  /*    borders are kept unchanged.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /*    yStrength :: How strong the glyph is emboldened vertically.        */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    bitmap    :: A handle to the target bitmap.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The current implementation restricts `xStrength' to be less than   */\n  /*    or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\n  /*                                                                       */\n  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */\n  /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Convert                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */\n  /*    to a bitmap object with depth 8bpp, making the number of used      */\n  /*    bytes line (a.k.a. the `pitch') a multiple of `alignment'.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    source    :: The source bitmap.                                    */\n  /*                                                                       */\n  /*    alignment :: The pitch of the bitmap is a multiple of this         */\n  /*                 parameter.  Common values are 1, 2, or 4.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target    :: The target bitmap.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\n  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\n  /*                                                                       */\n  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\n  /*                                                                       */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GlyphSlot_Own_Bitmap                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Make sure that a glyph slot owns `slot->bitmap'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: The glyph slot.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is to be used in combination with                    */\n  /*    @FT_Bitmap_Embolden.                                               */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    bitmap  :: The bitmap object to be freed.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBITMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftbzip2.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbzip2.h                                                              */\n/*                                                                         */\n/*    Bzip2-compressed stream support.                                     */\n/*                                                                         */\n/*  Copyright 2010 by                                                      */\n/*  Joel Klinghed.                                                         */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBZIP2_H__\n#define __FTBZIP2_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bzip2                                                              */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BZIP2 Streams                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using bzip2-compressed font files.                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Bzip2-specific functions. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenBzip2\n  *\n  * @description:\n  *   Open a new stream to parse bzip2-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.bz2' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, bzip2 compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a bzip2 compressed stream\n  *   from it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with bzip2 support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBZIP2_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftcache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.h                                                              */\n/*                                                                         */\n/*    FreeType Cache subsystem (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCACHE_H__\n#define __FTCACHE_H__\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************\n   *\n   * <Section>\n   *    cache_subsystem\n   *\n   * <Title>\n   *    Cache Sub-System\n   *\n   * <Abstract>\n   *    How to cache face, size, and glyph data with FreeType~2.\n   *\n   * <Description>\n   *   This section describes the FreeType~2 cache sub-system, which is used\n   *   to limit the number of concurrently opened @FT_Face and @FT_Size\n   *   objects, as well as caching information like character maps and glyph\n   *   images while limiting their maximum memory usage.\n   *\n   *   Note that all types and functions begin with the `FTC_' prefix.\n   *\n   *   The cache is highly portable and thus doesn't know anything about the\n   *   fonts installed on your system, or how to access them.  This implies\n   *   the following scheme:\n   *\n   *   First, available or installed font faces are uniquely identified by\n   *   @FTC_FaceID values, provided to the cache by the client.  Note that\n   *   the cache only stores and compares these values, and doesn't try to\n   *   interpret them in any way.\n   *\n   *   Second, the cache calls, only when needed, a client-provided function\n   *   to convert an @FTC_FaceID into a new @FT_Face object.  The latter is\n   *   then completely managed by the cache, including its termination\n   *   through @FT_Done_Face.  To monitor termination of face objects, the\n   *   finalizer callback in the `generic' field of the @FT_Face object can\n   *   be used, which might also be used to store the @FTC_FaceID of the\n   *   face.\n   *\n   *   Clients are free to map face IDs to anything else.  The most simple\n   *   usage is to associate them to a (pathname,face_index) pair that is\n   *   used to call @FT_New_Face.  However, more complex schemes are also\n   *   possible.\n   *\n   *   Note that for the cache to work correctly, the face ID values must be\n   *   *persistent*, which means that the contents they point to should not\n   *   change at runtime, or that their value should not become invalid.\n   *\n   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),\n   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let\n   *   the cache get rid of any references to the old @FTC_FaceID it may\n   *   keep internally.  Failure to do so will lead to incorrect behaviour\n   *   or even crashes.\n   *\n   *   To use the cache, start with calling @FTC_Manager_New to create a new\n   *   @FTC_Manager object, which models a single cache instance.  You can\n   *   then look up @FT_Face and @FT_Size objects with\n   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.\n   *\n   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then\n   *   later use @FTC_CMapCache_Lookup to perform the equivalent of\n   *   @FT_Get_Char_Index, only much faster.\n   *\n   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then\n   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding\n   *   @FT_Glyph objects from the cache.\n   *\n   *   If you need lots of small bitmaps, it is much more memory efficient\n   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This\n   *   returns @FTC_SBitRec structures, which are used to store small\n   *   bitmaps directly.  (A small bitmap is one whose metrics and\n   *   dimensions all fit into 8-bit integers).\n   *\n   *   We hope to also provide a kerning cache in the near future.\n   *\n   *\n   * <Order>\n   *   FTC_Manager\n   *   FTC_FaceID\n   *   FTC_Face_Requester\n   *\n   *   FTC_Manager_New\n   *   FTC_Manager_Reset\n   *   FTC_Manager_Done\n   *   FTC_Manager_LookupFace\n   *   FTC_Manager_LookupSize\n   *   FTC_Manager_RemoveFaceID\n   *\n   *   FTC_Node\n   *   FTC_Node_Unref\n   *\n   *   FTC_ImageCache\n   *   FTC_ImageCache_New\n   *   FTC_ImageCache_Lookup\n   *\n   *   FTC_SBit\n   *   FTC_SBitCache\n   *   FTC_SBitCache_New\n   *   FTC_SBitCache_Lookup\n   *\n   *   FTC_CMapCache\n   *   FTC_CMapCache_New\n   *   FTC_CMapCache_Lookup\n   *\n   *************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    BASIC TYPE DEFINITIONS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type: FTC_FaceID\n   *\n   * @description:\n   *   An opaque pointer type that is used to identity face objects.  The\n   *   contents of such objects is application-dependent.\n   *\n   *   These pointers are typically used to point to a user-defined\n   *   structure containing a font file path, and face index.\n   *\n   * @note:\n   *   Never use NULL as a valid @FTC_FaceID.\n   *\n   *   Face IDs are passed by the client to the cache manager, which calls,\n   *   when needed, the @FTC_Face_Requester to translate them into new\n   *   @FT_Face objects.\n   *\n   *   If the content of a given face ID changes at runtime, or if the value\n   *   becomes invalid (e.g., when uninstalling a font), you should\n   *   immediately call @FTC_Manager_RemoveFaceID before any other cache\n   *   function.\n   *\n   *   Failure to do so will result in incorrect behaviour or even\n   *   memory leaks and crashes.\n   */\n  typedef FT_Pointer  FTC_FaceID;\n\n\n  /************************************************************************\n   *\n   * @functype:\n   *   FTC_Face_Requester\n   *\n   * @description:\n   *   A callback function provided by client applications.  It is used by\n   *   the cache manager to translate a given @FTC_FaceID into a new valid\n   *   @FT_Face object, on demand.\n   *\n   * <Input>\n   *   face_id ::\n   *     The face ID to resolve.\n   *\n   *   library ::\n   *     A handle to a FreeType library object.\n   *\n   *   req_data ::\n   *     Application-provided request data (see note below).\n   *\n   * <Output>\n   *   aface ::\n   *     A new @FT_Face handle.\n   *\n   * <Return>\n   *   FreeType error code.  0~means success.\n   *\n   * <Note>\n   *   The third parameter `req_data' is the same as the one passed by the\n   *   client when @FTC_Manager_New is called.\n   *\n   *   The face requester should not perform funny things on the returned\n   *   face object, like creating a new @FT_Size for it, or setting a\n   *   transformation through @FT_Set_Transform!\n   */\n  typedef FT_Error\n  (*FTC_Face_Requester)( FTC_FaceID  face_id,\n                         FT_Library  library,\n                         FT_Pointer  request_data,\n                         FT_Face*    aface );\n\n /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CACHE MANAGER OBJECT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Manager                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This object corresponds to one instance of the cache-subsystem.    */\n  /*    It is used to cache one or more @FT_Face objects, along with       */\n  /*    corresponding @FT_Size objects.                                    */\n  /*                                                                       */\n  /*    The manager intentionally limits the total number of opened        */\n  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */\n  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */\n  /*                                                                       */\n  /*    The manager is also used to cache `nodes' of various types while   */\n  /*    limiting their total memory usage.                                 */\n  /*                                                                       */\n  /*    All limitations are enforced by keeping lists of managed objects   */\n  /*    in most-recently-used order, and flushing old nodes to make room   */\n  /*    for new ones.                                                      */\n  /*                                                                       */\n  typedef struct FTC_ManagerRec_*  FTC_Manager;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Node                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to a cache node object.  Each cache node is       */\n  /*    reference-counted.  A node with a count of~0 might be flushed      */\n  /*    out of a full cache whenever a lookup request is performed.        */\n  /*                                                                       */\n  /*    If you look up nodes, you have the ability to `acquire' them,      */\n  /*    i.e., to increment their reference count.  This will prevent the   */\n  /*    node from being flushed out of the cache until you explicitly      */\n  /*    `release' it (see @FTC_Node_Unref).                                */\n  /*                                                                       */\n  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */\n  /*                                                                       */\n  typedef struct FTC_NodeRec_*  FTC_Node;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_New                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache manager.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: The parent FreeType library handle to use.            */\n  /*                                                                       */\n  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */\n  /*                 Use~0 for defaults.  Note that this value does not    */\n  /*                 account for managed @FT_Face and @FT_Size objects.    */\n  /*                                                                       */\n  /*    requester :: An application-provided callback used to translate    */\n  /*                 face IDs into real @FT_Face objects.                  */\n  /*                                                                       */\n  /*    req_data  :: A generic pointer that is passed to the requester     */\n  /*                 each time it is called (see @FTC_Face_Requester).     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amanager  :: A handle to a new manager object.  0~in case of       */\n  /*                 failure.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Reset                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Empty a given cache manager.  This simply gets rid of all the      */\n  /*    currently cached @FT_Face and @FT_Size objects within the manager. */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the manager.                                */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Reset( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given manager after emptying it.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the target cache manager object.            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Done( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupFace                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Face object that corresponds to a given face ID   */\n  /*    through a cache manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    face_id :: The ID of the face object.                              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface   :: A handle to the face object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Face object is always owned by the manager.  You  */\n  /*    should never try to discard it yourself.                           */\n  /*                                                                       */\n  /*    The @FT_Face object doesn't necessarily have a current size object */\n  /*    (i.e., face->size can be~0).  If you need a specific `font size',  */\n  /*    use @FTC_Manager_LookupSize instead.                               */\n  /*                                                                       */\n  /*    Never change the face's transformation matrix (i.e., never call    */\n  /*    the @FT_Set_Transform function) on a returned face!  If you need   */\n  /*    to transform glyphs, do it yourself after glyph loading.           */\n  /*                                                                       */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory was available */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_ScalerRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a given character size in either      */\n  /*    pixels or points to the cache manager.  See                        */\n  /*    @FTC_Manager_LookupSize.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id :: The source face ID.                                     */\n  /*                                                                       */\n  /*    width   :: The character width.                                    */\n  /*                                                                       */\n  /*    height  :: The character height.                                   */\n  /*                                                                       */\n  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */\n  /*               interpreted as integer pixel character sizes.           */\n  /*               Otherwise, they are expressed as 1/64th of points.      */\n  /*                                                                       */\n  /*    x_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               horizontal resolution in dpi.                           */\n  /*                                                                       */\n  /*    y_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               vertical resolution in dpi.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This type is mainly used to retrieve @FT_Size objects through the  */\n  /*    cache manager.                                                     */\n  /*                                                                       */\n  typedef struct  FTC_ScalerRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     width;\n    FT_UInt     height;\n    FT_Int      pixel;\n    FT_UInt     x_res;\n    FT_UInt     y_res;\n\n  } FTC_ScalerRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_Scaler                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FTC_ScalerRec structure.                           */\n  /*                                                                       */\n  typedef struct FTC_ScalerRec_*  FTC_Scaler;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupSize                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Size object that corresponds to a given           */\n  /*    @FTC_ScalerRec pointer through a cache manager.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    scaler  :: A scaler handle.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize   :: A handle to the size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Size object is always owned by the manager.  You  */\n  /*    should never try to discard it by yourself.                        */\n  /*                                                                       */\n  /*    You can access the parent @FT_Face object simply as `size->face'   */\n  /*    if you need it.  Note that this object is also owned by the        */\n  /*    manager.                                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory is available  */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Node_Unref                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Decrement a cache node's internal reference count.  When the count */\n  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */\n  /*    cache flushes.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node    :: The cache node handle.                                  */\n  /*                                                                       */\n  /*    manager :: The cache manager handle.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_Manager_RemoveFaceID\n   *\n   * @description:\n   *   A special function used to indicate to the cache manager that\n   *   a given @FTC_FaceID is no longer valid, either because its\n   *   content changed, or because it was deallocated or uninstalled.\n   *\n   * @input:\n   *   manager ::\n   *     The cache manager handle.\n   *\n   *   face_id ::\n   *     The @FTC_FaceID to be removed.\n   *\n   * @note:\n   *   This function flushes all nodes from the cache corresponding to this\n   *   `face_id', with the exception of nodes with a non-null reference\n   *   count.\n   *\n   *   Such nodes are however modified internally so as to never appear\n   *   in later lookups with the same `face_id' value, and to be immediately\n   *   destroyed when released by all their users.\n   *\n   */\n  FT_EXPORT( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_CMapCache\n   *\n   * @description:\n   *   An opaque handle used to model a charmap cache.  This cache is to\n   *   hold character codes -> glyph indices mappings.\n   *\n   */\n  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_New\n   *\n   * @description:\n   *   Create a new charmap cache.\n   *\n   * @input:\n   *   manager ::\n   *     A handle to the cache manager.\n   *\n   * @output:\n   *   acache ::\n   *     A new cache handle.  NULL in case of error.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Like all other caches, this one will be destroyed with the cache\n   *   manager.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_Lookup\n   *\n   * @description:\n   *   Translate a character code into a glyph index, using the charmap\n   *   cache.\n   *\n   * @input:\n   *   cache ::\n   *     A charmap cache handle.\n   *\n   *   face_id ::\n   *     The source face ID.\n   *\n   *   cmap_index ::\n   *     The index of the charmap in the source face.  Any negative value\n   *     means to use the cache @FT_Face's default charmap.\n   *\n   *   char_code ::\n   *     The character code (in the corresponding charmap).\n   *\n   * @return:\n   *    Glyph index.  0~means `no glyph'.\n   *\n   */\n  FT_EXPORT( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       IMAGE CACHE OBJECT                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FTC_ImageTypeRec\n   *\n   * @description:\n   *   A structure used to model the type of images in a glyph cache.\n   *\n   * @fields:\n   *   face_id ::\n   *     The face ID.\n   *\n   *   width ::\n   *     The width in pixels.\n   *\n   *   height ::\n   *     The height in pixels.\n   *\n   *   flags ::\n   *     The load flags, as in @FT_Load_Glyph.\n   *\n   */\n  typedef struct  FTC_ImageTypeRec_\n  {\n    FTC_FaceID  face_id;\n    FT_Int      width;\n    FT_Int      height;\n    FT_Int32    flags;\n\n  } FTC_ImageTypeRec;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_ImageType\n   *\n   * @description:\n   *   A handle to an @FTC_ImageTypeRec structure.\n   *\n   */\n  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;\n\n\n  /* */\n\n\n#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \\\n          ( (d1)->face_id == (d2)->face_id && \\\n            (d1)->width   == (d2)->width   && \\\n            (d1)->flags   == (d2)->flags   )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_ImageCache                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a glyph image cache object.  They are designed to      */\n  /*    hold many distinct glyph images while not exceeding a certain      */\n  /*    memory threshold.                                                  */\n  /*                                                                       */\n  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_New                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new glyph image cache.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: The parent manager for the image cache.                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new glyph image cache object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_Lookup                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a given glyph image from a glyph image cache.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source glyph image cache.                */\n  /*                                                                       */\n  /*    type   :: A pointer to a glyph image type descriptor.              */\n  /*                                                                       */\n  /*    gindex :: The glyph index to retrieve.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: The corresponding @FT_Glyph object.  0~in case of        */\n  /*              failure.                                                 */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_LookupScaler                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source glyph image cache.            */\n  /*                                                                       */\n  /*    scaler     :: A pointer to a scaler descriptor.                    */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index to retrieve.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph     :: The corresponding @FT_Glyph object.  0~in case of    */\n  /*                  failure.                                             */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */\n  /*    glyphs; you should always use the FreeType cache API instead.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBit                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */\n  /*    structure for details.                                             */\n  /*                                                                       */\n  typedef struct FTC_SBitRec_*  FTC_SBit;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_SBitRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very compact structure used to describe a small glyph bitmap.    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width     :: The bitmap width in pixels.                           */\n  /*                                                                       */\n  /*    height    :: The bitmap height in pixels.                          */\n  /*                                                                       */\n  /*    left      :: The horizontal distance from the pen position to the  */\n  /*                 left bitmap border (a.k.a. `left side bearing', or    */\n  /*                 `lsb').                                               */\n  /*                                                                       */\n  /*    top       :: The vertical distance from the pen position (on the   */\n  /*                 baseline) to the upper bitmap border (a.k.a. `top     */\n  /*                 side bearing').  The distance is positive for upwards */\n  /*                 y~coordinates.                                        */\n  /*                                                                       */\n  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */\n  /*                                                                       */\n  /*    max_grays :: Maximum gray level value (in the range 1 to~255).     */\n  /*                                                                       */\n  /*    pitch     :: The number of bytes per bitmap line.  May be positive */\n  /*                 or negative.                                          */\n  /*                                                                       */\n  /*    xadvance  :: The horizontal advance width in pixels.               */\n  /*                                                                       */\n  /*    yadvance  :: The vertical advance height in pixels.                */\n  /*                                                                       */\n  /*    buffer    :: A pointer to the bitmap pixels.                       */\n  /*                                                                       */\n  typedef struct  FTC_SBitRec_\n  {\n    FT_Byte   width;\n    FT_Byte   height;\n    FT_Char   left;\n    FT_Char   top;\n\n    FT_Byte   format;\n    FT_Byte   max_grays;\n    FT_Short  pitch;\n    FT_Char   xadvance;\n    FT_Char   yadvance;\n\n    FT_Byte*  buffer;\n\n  } FTC_SBitRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBitCache                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap cache.  These are special cache objects */\n  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */\n  /*    much more efficient way than the traditional glyph image cache     */\n  /*    implemented by @FTC_ImageCache.                                    */\n  /*                                                                       */\n  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_New                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache to store small glyph bitmaps.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the source cache manager.                   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_Lookup                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Look up a given small glyph bitmap in a given sbit cache and       */\n  /*    `lock' it to prevent its flushing from the cache until needed.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source sbit cache.                       */\n  /*                                                                       */\n  /*    type   :: A pointer to the glyph image type descriptor.            */\n  /*                                                                       */\n  /*    gindex :: The glyph index.                                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit   :: A handle to a small bitmap descriptor.                   */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache    cache,\n                        FTC_ImageType    type,\n                        FT_UInt          gindex,\n                        FTC_SBit        *sbit,\n                        FTC_Node        *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_LookupScaler                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source sbit cache.                   */\n  /*                                                                       */\n  /*    scaler     :: A pointer to the scaler descriptor.                  */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit       :: A handle to a small bitmap descriptor.               */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *sbit,\n                              FTC_Node      *anode );\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftcffdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcffdrv.h                                                             */\n/*                                                                         */\n/*    FreeType API for controlling the CFF driver (specification only).    */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCFFDRV_H__\n#define __FTCFFDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   cff_driver\n   *\n   * @title:\n   *   The CFF driver\n   *\n   * @abstract:\n   *   Controlling the CFF driver module.\n   *\n   * @description:\n   *   While FreeType's CFF driver doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The CFF driver's module name is `cff'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   hinting-engine\n   *\n   * @description:\n   *   Thanks to Adobe, which contributed a new hinting (and parsing)\n   *   engine, an application can select between `freetype' and `adobe' if\n   *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration\n   *   macro isn't defined, `hinting-engine' does nothing.\n   *\n   *   The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is\n   *   defined, and `adobe' otherwise.\n   *\n   *   The following example code demonstrates how to select Adobe's hinting\n   *   engine (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"hinting-engine\", &hinting_engine );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_CFF_HINTING_XXX\n   *\n   * @description:\n   *   A list of constants used for the @hinting-engine property to select\n   *   the hinting engine for CFF fonts.\n   *\n   * @values:\n   *   FT_CFF_HINTING_FREETYPE ::\n   *     Use the old FreeType hinting engine.\n   *\n   *   FT_CFF_HINTING_ADOBE ::\n   *     Use the hinting engine contributed by Adobe.\n   *\n   */\n#define FT_CFF_HINTING_FREETYPE  0\n#define FT_CFF_HINTING_ADOBE     1\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   no-stem-darkening\n   *\n   * @description:\n   *   By default, the Adobe CFF engine darkens stems at smaller sizes,\n   *   regardless of hinting, to enhance contrast.  Setting this property,\n   *   stem darkening gets switched off.\n   *\n   *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_Bool     no_stem_darkening = TRUE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"no-stem-darkening\", &no_stem_darkening );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTCFFDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftchapters.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/* This file defines the structure of the FreeType reference.              */\n/* It is used by the python script which generates the HTML files.         */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    general_remarks                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    General Remarks                                                      */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    user_allocation                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    core_api                                                             */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Core API                                                             */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    version                                                              */\n/*    basic_types                                                          */\n/*    base_interface                                                       */\n/*    glyph_variants                                                       */\n/*    glyph_management                                                     */\n/*    mac_specific                                                         */\n/*    sizes_management                                                     */\n/*    header_file_macros                                                   */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    format_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Format-Specific API                                                  */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    multiple_masters                                                     */\n/*    truetype_tables                                                      */\n/*    type1_tables                                                         */\n/*    sfnt_names                                                           */\n/*    bdf_fonts                                                            */\n/*    cid_fonts                                                            */\n/*    pfr_fonts                                                            */\n/*    winfnt_fonts                                                         */\n/*    font_formats                                                         */\n/*    gasp_table                                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    module_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Controlling FreeType Modules                                         */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    auto_hinter                                                          */\n/*    cff_driver                                                           */\n/*    tt_driver                                                            */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Cache Sub-System                                                     */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    support_api                                                          */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Support API                                                          */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    computations                                                         */\n/*    list_processing                                                      */\n/*    outline_processing                                                   */\n/*    quick_advance                                                        */\n/*    bitmap_handling                                                      */\n/*    raster                                                               */\n/*    glyph_stroker                                                        */\n/*    system_interface                                                     */\n/*    module_management                                                    */\n/*    gzip                                                                 */\n/*    lzw                                                                  */\n/*    bzip2                                                                */\n/*    lcd_filtering                                                        */\n/*                                                                         */\n/***************************************************************************/\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcid.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing CID font information (specification).     */\n/*                                                                         */\n/*  Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal.                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCID_H__\n#define __FTCID_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cid_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    CID Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    CID-keyed font specific API.                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of CID-keyed font specific   */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Registry_Ordering_Supplement\n   *\n   * @description:\n   *    Retrieve the Registry/Ordering/Supplement triple (also known as the\n   *    \"R/O/S\") from a CID-keyed font.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    registry ::\n   *       The registry, as a C~string, owned by the face.\n   *\n   *    ordering ::\n   *       The ordering, as a C~string, owned by the face.\n   *\n   *    supplement ::\n   *       The supplement.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces, returning an error\n   *    otherwise.\n   *\n   * @since:\n   *    2.3.6\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,\n                                           const char*  *registry,\n                                           const char*  *ordering,\n                                           FT_Int       *supplement);\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Is_Internally_CID_Keyed\n   *\n   * @description:\n   *    Retrieve the type of the input face, CID keyed or not.  In\n   *    constrast to the @FT_IS_CID_KEYED macro this function returns\n   *    successfully also for CID-keyed fonts in an SNFT wrapper.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    is_cid ::\n   *       The type of the face as an @FT_Bool.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,\n                                      FT_Bool  *is_cid );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_From_Glyph_Index\n   *\n   * @description:\n   *    Retrieve the CID of the input glyph index.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   *    glyph_index ::\n   *       The input glyph index.\n   *\n   * @output:\n   *    cid ::\n   *       The CID as an @FT_UInt.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_From_Glyph_Index( FT_Face   face,\n                               FT_UInt   glyph_index,\n                               FT_UInt  *cid );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/fterrdef.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrdef.h                                                             */\n/*                                                                         */\n/*    FreeType error codes (specification).                                */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2006, 2007, 2010-2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                LIST OF ERROR CODES/MESSAGES             *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n  /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */\n  /* including this file.                                           */\n\n\n  /* generic errors */\n\n  FT_NOERRORDEF_( Ok,                                        0x00, \\\n                  \"no error\" )\n\n  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \\\n                \"cannot open resource\" )\n  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \\\n                \"unknown file format\" )\n  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \\\n                \"broken file\" )\n  FT_ERRORDEF_( Invalid_Version,                             0x04, \\\n                \"invalid FreeType version\" )\n  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \\\n                \"module version is too low\" )\n  FT_ERRORDEF_( Invalid_Argument,                            0x06, \\\n                \"invalid argument\" )\n  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \\\n                \"unimplemented feature\" )\n  FT_ERRORDEF_( Invalid_Table,                               0x08, \\\n                \"broken table\" )\n  FT_ERRORDEF_( Invalid_Offset,                              0x09, \\\n                \"broken offset within table\" )\n  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \\\n                \"array allocation size too large\" )\n  FT_ERRORDEF_( Missing_Module,                              0x0B, \\\n                \"missing module\" )\n  FT_ERRORDEF_( Missing_Property,                            0x0C, \\\n                \"missing property\" )\n\n  /* glyph/character errors */\n\n  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \\\n                \"invalid glyph index\" )\n  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \\\n                \"invalid character code\" )\n  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \\\n                \"unsupported glyph image format\" )\n  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \\\n                \"cannot render this glyph format\" )\n  FT_ERRORDEF_( Invalid_Outline,                             0x14, \\\n                \"invalid outline\" )\n  FT_ERRORDEF_( Invalid_Composite,                           0x15, \\\n                \"invalid composite glyph\" )\n  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \\\n                \"too many hints\" )\n  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \\\n                \"invalid pixel size\" )\n\n  /* handle errors */\n\n  FT_ERRORDEF_( Invalid_Handle,                              0x20, \\\n                \"invalid object handle\" )\n  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \\\n                \"invalid library handle\" )\n  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \\\n                \"invalid module handle\" )\n  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \\\n                \"invalid face handle\" )\n  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \\\n                \"invalid size handle\" )\n  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \\\n                \"invalid glyph slot handle\" )\n  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \\\n                \"invalid charmap handle\" )\n  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \\\n                \"invalid cache manager handle\" )\n  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \\\n                \"invalid stream handle\" )\n\n  /* driver errors */\n\n  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \\\n                \"too many modules\" )\n  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \\\n                \"too many extensions\" )\n\n  /* memory errors */\n\n  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \\\n                \"out of memory\" )\n  FT_ERRORDEF_( Unlisted_Object,                             0x41, \\\n                \"unlisted object\" )\n\n  /* stream errors */\n\n  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \\\n                \"cannot open stream\" )\n  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \\\n                \"invalid stream seek\" )\n  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \\\n                \"invalid stream skip\" )\n  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \\\n                \"invalid stream read\" )\n  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \\\n                \"invalid stream operation\" )\n  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \\\n                \"invalid frame operation\" )\n  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \\\n                \"nested frame access\" )\n  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \\\n                \"invalid frame read\" )\n\n  /* raster errors */\n\n  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \\\n                \"raster uninitialized\" )\n  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \\\n                \"raster corrupted\" )\n  FT_ERRORDEF_( Raster_Overflow,                             0x62, \\\n                \"raster overflow\" )\n  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \\\n                \"negative height while rastering\" )\n\n  /* cache errors */\n\n  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \\\n                \"too many registered caches\" )\n\n  /* TrueType and SFNT errors */\n\n  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \\\n                \"invalid opcode\" )\n  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \\\n                \"too few arguments\" )\n  FT_ERRORDEF_( Stack_Overflow,                              0x82, \\\n                \"stack overflow\" )\n  FT_ERRORDEF_( Code_Overflow,                               0x83, \\\n                \"code overflow\" )\n  FT_ERRORDEF_( Bad_Argument,                                0x84, \\\n                \"bad argument\" )\n  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \\\n                \"division by zero\" )\n  FT_ERRORDEF_( Invalid_Reference,                           0x86, \\\n                \"invalid reference\" )\n  FT_ERRORDEF_( Debug_OpCode,                                0x87, \\\n                \"found debug opcode\" )\n  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \\\n                \"found ENDF opcode in execution stream\" )\n  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \\\n                \"nested DEFS\" )\n  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \\\n                \"invalid code range\" )\n  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \\\n                \"execution context too long\" )\n  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \\\n                \"too many function definitions\" )\n  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \\\n                \"too many instruction definitions\" )\n  FT_ERRORDEF_( Table_Missing,                               0x8E, \\\n                \"SFNT font table missing\" )\n  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \\\n                \"horizontal header (hhea) table missing\" )\n  FT_ERRORDEF_( Locations_Missing,                           0x90, \\\n                \"locations (loca) table missing\" )\n  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \\\n                \"name table missing\" )\n  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \\\n                \"character map (cmap) table missing\" )\n  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \\\n                \"horizontal metrics (hmtx) table missing\" )\n  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \\\n                \"PostScript (post) table missing\" )\n  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \\\n                \"invalid horizontal metrics\" )\n  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \\\n                \"invalid character map (cmap) format\" )\n  FT_ERRORDEF_( Invalid_PPem,                                0x97, \\\n                \"invalid ppem value\" )\n  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \\\n                \"invalid vertical metrics\" )\n  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \\\n                \"could not find context\" )\n  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \\\n                \"invalid PostScript (post) table format\" )\n  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \\\n                \"invalid PostScript (post) table\" )\n\n  /* CFF, CID, and Type 1 errors */\n\n  FT_ERRORDEF_( Syntax_Error,                                0xA0, \\\n                \"opcode syntax error\" )\n  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \\\n                \"argument stack underflow\" )\n  FT_ERRORDEF_( Ignore,                                      0xA2, \\\n                \"ignore\" )\n  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \\\n                \"no Unicode glyph name found\" )\n  FT_ERRORDEF_( Glyph_Too_Big,                               0xA4, \\\n                \"glyph to big for hinting\" )\n\n  /* BDF errors */\n\n  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \\\n                \"`STARTFONT' field missing\" )\n  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \\\n                \"`FONT' field missing\" )\n  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \\\n                \"`SIZE' field missing\" )\n  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3, \\\n                \"`FONTBOUNDINGBOX' field missing\" )\n  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4, \\\n                \"`CHARS' field missing\" )\n  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5, \\\n                \"`STARTCHAR' field missing\" )\n  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6, \\\n                \"`ENCODING' field missing\" )\n  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7, \\\n                \"`BBX' field missing\" )\n  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8, \\\n                \"`BBX' too big\" )\n  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9, \\\n                \"Font header corrupted or missing fields\" )\n  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA, \\\n                \"Font glyphs corrupted or missing fields\" )\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/fterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrors.h                                                             */\n/*                                                                         */\n/*    FreeType error code handling (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2007, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This special header file is used to define the handling of FT2        */\n  /* enumeration constants.  It can also be used to generate error message */\n  /* strings with a small macro trick explained below.                     */\n  /*                                                                       */\n  /* I - Error Formats                                                     */\n  /* -----------------                                                     */\n  /*                                                                       */\n  /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */\n  /*   defined in ftoption.h in order to make the higher byte indicate     */\n  /*   the module where the error has happened (this is not compatible     */\n  /*   with standard builds of FreeType 2).  See the file `ftmoderr.h' for */\n  /*   more details.                                                       */\n  /*                                                                       */\n  /*                                                                       */\n  /* II - Error Message strings                                            */\n  /* --------------------------                                            */\n  /*                                                                       */\n  /*   The error definitions below are made through special macros that    */\n  /*   allow client applications to build a table of error message strings */\n  /*   if they need it.  The strings are not included in a normal build of */\n  /*   FreeType 2 to save space (most client applications do not use       */\n  /*   them).                                                              */\n  /*                                                                       */\n  /*   To do so, you have to define the following macros before including  */\n  /*   this file:                                                          */\n  /*                                                                       */\n  /*   FT_ERROR_START_LIST ::                                              */\n  /*     This macro is called before anything else to define the start of  */\n  /*     the error list.  It is followed by several FT_ERROR_DEF calls     */\n  /*     (see below).                                                      */\n  /*                                                                       */\n  /*   FT_ERROR_DEF( e, v, s ) ::                                          */\n  /*     This macro is called to define one single error.                  */\n  /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */\n  /*     `v' is the error numerical value.                                 */\n  /*     `s' is the corresponding error string.                            */\n  /*                                                                       */\n  /*   FT_ERROR_END_LIST ::                                                */\n  /*     This macro ends the list.                                         */\n  /*                                                                       */\n  /*   Additionally, you have to undefine __FTERRORS_H__ before #including */\n  /*   this file.                                                          */\n  /*                                                                       */\n  /*   Here is a simple example:                                           */\n  /*                                                                       */\n  /*     {                                                                 */\n  /*       #undef __FTERRORS_H__                                           */\n  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */\n  /*       #define FT_ERROR_START_LIST     {                               */\n  /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */\n  /*                                                                       */\n  /*       const struct                                                    */\n  /*       {                                                               */\n  /*         int          err_code;                                        */\n  /*         const char*  err_msg;                                         */\n  /*       } ft_errors[] =                                                 */\n  /*                                                                       */\n  /*       #include FT_ERRORS_H                                            */\n  /*     }                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTERRORS_H__\n#define __FTERRORS_H__\n\n\n  /* include module base error codes */\n#include FT_MODULE_ERRORS_H\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n\n  /* FT_ERR_PREFIX is used as a prefix for error identifiers. */\n  /* By default, we use `FT_Err_'.                            */\n  /*                                                          */\n#ifndef FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FT_Err_\n#endif\n\n\n  /* FT_ERR_BASE is used as the base for module-specific errors. */\n  /*                                                             */\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n#ifndef FT_ERR_BASE\n#define FT_ERR_BASE  FT_Mod_Err_Base\n#endif\n\n#else\n\n#undef FT_ERR_BASE\n#define FT_ERR_BASE  0\n\n#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */\n\n\n  /* If FT_ERRORDEF is not defined, we need to define a simple */\n  /* enumeration type.                                         */\n  /*                                                           */\n#ifndef FT_ERRORDEF\n\n#define FT_ERRORDEF( e, v, s )  e = v,\n#define FT_ERROR_START_LIST     enum {\n#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_ERRORDEF */\n\n\n  /* this macro is used to define an error */\n#define FT_ERRORDEF_( e, v, s )                                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )\n\n  /* this is only used for <module>_Err_Ok, which must be 0! */\n#define FT_NOERRORDEF_( e, v, s )                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )\n\n\n#ifdef FT_ERROR_START_LIST\n  FT_ERROR_START_LIST\n#endif\n\n\n  /* now include the error codes */\n#include FT_ERROR_DEFINITIONS_H\n\n\n#ifdef FT_ERROR_END_LIST\n  FT_ERROR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      SIMPLE CLEANUP                     *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_ERROR_START_LIST\n#undef FT_ERROR_END_LIST\n\n#undef FT_ERRORDEF\n#undef FT_ERRORDEF_\n#undef FT_NOERRORDEF_\n\n#undef FT_NEED_EXTERN_C\n#undef FT_ERR_BASE\n\n  /* FT_ERR_PREFIX is needed internally */\n#ifndef FT2_BUILD_LIBRARY\n#undef FT_ERR_PREFIX\n#endif\n\n#endif /* __FTERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftgasp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.h                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (specification).                   */\n/*                                                                         */\n/*  Copyright 2007, 2008, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef _FT_GASP_H_\n#define _FT_GASP_H_\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\n  /***************************************************************************\n   *\n   * @section:\n   *   gasp_table\n   *\n   * @title:\n   *   Gasp Table\n   *\n   * @abstract:\n   *   Retrieving TrueType `gasp' table entries.\n   *\n   * @description:\n   *   The function @FT_Get_Gasp can be used to query a TrueType or OpenType\n   *   font for specific entries in its `gasp' table, if any.  This is\n   *   mainly useful when implementing native TrueType hinting with the\n   *   bytecode interpreter to duplicate the Windows text rendering results.\n   */\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_GASP_XXX\n   *\n   * @description:\n   *   A list of values and/or bit-flags returned by the @FT_Get_Gasp\n   *   function.\n   *\n   * @values:\n   *   FT_GASP_NO_TABLE ::\n   *     This special value means that there is no GASP table in this face.\n   *     It is up to the client to decide what to do.\n   *\n   *   FT_GASP_DO_GRIDFIT ::\n   *     Grid-fitting and hinting should be performed at the specified ppem.\n   *     This *really* means TrueType bytecode interpretation.  If this bit\n   *     is not set, no hinting gets applied.\n   *\n   *   FT_GASP_DO_GRAY ::\n   *     Anti-aliased rendering should be performed at the specified ppem.\n   *     If not set, do monochrome rendering.\n   *\n   *   FT_GASP_SYMMETRIC_SMOOTHING ::\n   *     If set, smoothing along multiple axes must be used with ClearType.\n   *\n   *   FT_GASP_SYMMETRIC_GRIDFIT ::\n   *     Grid-fitting must be used with ClearType's symmetric smoothing.\n   *\n   * @note:\n   *   The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be\n   *   used for standard font rasterization only.  Independently of that,\n   *   `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to\n   *   be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and\n   *   `FT_GASP_DO_GRAY' are consequently ignored).\n   *\n   *   `ClearType' is Microsoft's implementation of LCD rendering, partly\n   *   protected by patents.\n   *\n   * @since:\n   *   2.3.0\n   */\n#define FT_GASP_NO_TABLE               -1\n#define FT_GASP_DO_GRIDFIT           0x01\n#define FT_GASP_DO_GRAY              0x02\n#define FT_GASP_SYMMETRIC_SMOOTHING  0x08\n#define FT_GASP_SYMMETRIC_GRIDFIT    0x10\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_Gasp\n   *\n   * @description:\n   *   Read the `gasp' table from a TrueType or OpenType font file and\n   *   return the entry corresponding to a given character pixel size.\n   *\n   * @input:\n   *   face :: The source face handle.\n   *   ppem :: The vertical character pixel size.\n   *\n   * @return:\n   *   Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no\n   *   `gasp' table in the face.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem );\n\n/* */\n\n#endif /* _FT_GASP_H_ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.h                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the definition of several convenience functions    */\n  /* that can be used by client applications to easily retrieve glyph      */\n  /* bitmaps and outlines from a given face.                               */\n  /*                                                                       */\n  /* These functions should be optional if you are writing a font server   */\n  /* or text layout engine on top of FreeType.  However, they are pretty   */\n  /* handy for many other simple uses of the library.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTGLYPH_H__\n#define __FTGLYPH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Management                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Generic interface to manage individual glyph data.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains definitions used to manage glyph data        */\n  /*    through generic FT_Glyph objects.  Each of them can contain a      */\n  /*    bitmap, a vector outline, or even images in other formats.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* forward declaration to a private type */\n  typedef struct FT_Glyph_Class_  FT_Glyph_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Glyph                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Handle to an object used to model generic glyph images.  It is a   */\n  /*    pointer to the @FT_GlyphRec structure and can contain a glyph      */\n  /*    bitmap or pointer.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Glyph objects are not owned by the library.  You must thus release */\n  /*    them manually (through @FT_Done_Glyph) _before_ calling            */\n  /*    @FT_Done_FreeType.                                                 */\n  /*                                                                       */\n  typedef struct FT_GlyphRec_*  FT_Glyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root glyph structure contains a given glyph image plus its     */\n  /*    advance width in 16.16 fixed-point format.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library :: A handle to the FreeType library object.                */\n  /*                                                                       */\n  /*    clazz   :: A pointer to the glyph's class.  Private.               */\n  /*                                                                       */\n  /*    format  :: The format of the glyph's image.                        */\n  /*                                                                       */\n  /*    advance :: A 16.16 vector that gives the glyph's advance width.    */\n  /*                                                                       */\n  typedef struct  FT_GlyphRec_\n  {\n    FT_Library             library;\n    const FT_Glyph_Class*  clazz;\n    FT_Glyph_Format        format;\n    FT_Vector              advance;\n\n  } FT_GlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_BitmapGlyph                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a bitmap glyph image.  This is */\n  /*    a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.     */\n  /*                                                                       */\n  typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BitmapGlyphRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for bitmap glyph images.  This really is a        */\n  /*    `sub-class' of @FT_GlyphRec.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root   :: The root @FT_Glyph fields.                               */\n  /*                                                                       */\n  /*    left   :: The left-side bearing, i.e., the horizontal distance     */\n  /*              from the current pen position to the left border of the  */\n  /*              glyph bitmap.                                            */\n  /*                                                                       */\n  /*    top    :: The top-side bearing, i.e., the vertical distance from   */\n  /*              the current pen position to the top border of the glyph  */\n  /*              bitmap.  This distance is positive for upwards~y!        */\n  /*                                                                       */\n  /*    bitmap :: A descriptor for the bitmap.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_BITMAP'.  This lets you access   */\n  /*    the bitmap's contents easily.                                      */\n  /*                                                                       */\n  /*    The corresponding pixel buffer is always owned by @FT_BitmapGlyph  */\n  /*    and is thus created and destroyed with it.                         */\n  /*                                                                       */\n  typedef struct  FT_BitmapGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Int       left;\n    FT_Int       top;\n    FT_Bitmap    bitmap;\n\n  } FT_BitmapGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_OutlineGlyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model an outline glyph image.  This  */\n  /*    is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */\n  /*                                                                       */\n  typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_OutlineGlyphRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for outline (vectorial) glyph images.  This       */\n  /*    really is a `sub-class' of @FT_GlyphRec.                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root    :: The root @FT_Glyph fields.                              */\n  /*                                                                       */\n  /*    outline :: A descriptor for the outline.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have      */\n  /*    `glyph->format == FT_GLYPH_FORMAT_OUTLINE'.  This lets you access  */\n  /*    the outline's content easily.                                      */\n  /*                                                                       */\n  /*    As the outline is extracted from a glyph slot, its coordinates are */\n  /*    expressed normally in 26.6 pixels, unless the flag                 */\n  /*    @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */\n  /*                                                                       */\n  /*    The outline's tables are always owned by the object and are        */\n  /*    destroyed with it.                                                 */\n  /*                                                                       */\n  typedef struct  FT_OutlineGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Outline   outline;\n\n  } FT_OutlineGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to extract a glyph image from a slot.  Note that   */\n  /*    the created @FT_Glyph object must be released with @FT_Done_Glyph. */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot   :: A handle to the source glyph slot.                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: A handle to the glyph object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Copy                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to copy a glyph image.  Note that the created      */\n  /*    @FT_Glyph object must be released with @FT_Done_Glyph.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source glyph object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target glyph object.  0~in case of       */\n  /*              error.                                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Transform                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a glyph image if its format is scalable.                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    glyph  :: A handle to the target glyph object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to a 2x2 matrix to apply.                      */\n  /*                                                                       */\n  /*    delta  :: A pointer to a 2d vector to apply.  Coordinates are      */\n  /*              expressed in 1/64th of a pixel.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code (if not 0, the glyph format is not scalable).  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The 2x2 transformation matrix is also applied to the glyph's       */\n  /*    advance vector.                                                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_BBox_Mode                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The mode how the values of @FT_Glyph_Get_CBox are returned.        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_BBOX_UNSCALED ::                                          */\n  /*      Return unscaled font units.                                      */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_SUBPIXELS ::                                         */\n  /*      Return unfitted 26.6 coordinates.                                */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_GRIDFIT ::                                           */\n  /*      Return grid-fitted 26.6 coordinates.                             */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_TRUNCATE ::                                          */\n  /*      Return coordinates in integer pixels.                            */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_PIXELS ::                                            */\n  /*      Return grid-fitted pixel coordinates.                            */\n  /*                                                                       */\n  typedef enum  FT_Glyph_BBox_Mode_\n  {\n    FT_GLYPH_BBOX_UNSCALED  = 0,\n    FT_GLYPH_BBOX_SUBPIXELS = 0,\n    FT_GLYPH_BBOX_GRIDFIT   = 1,\n    FT_GLYPH_BBOX_TRUNCATE  = 2,\n    FT_GLYPH_BBOX_PIXELS    = 3\n\n  } FT_Glyph_BBox_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_bbox_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Glyph_BBox_Mode values instead.                                */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   ft_glyph_bbox_unscaled  :: See @FT_GLYPH_BBOX_UNSCALED.             */\n  /*   ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS.            */\n  /*   ft_glyph_bbox_gridfit   :: See @FT_GLYPH_BBOX_GRIDFIT.              */\n  /*   ft_glyph_bbox_truncate  :: See @FT_GLYPH_BBOX_TRUNCATE.             */\n  /*   ft_glyph_bbox_pixels    :: See @FT_GLYPH_BBOX_PIXELS.               */\n  /*                                                                       */\n#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED\n#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS\n#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT\n#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE\n#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Get_CBox                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a glyph's `control box'.  The control box encloses all the  */\n  /*    outline's points, including Bézier control points.  Though it      */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the source glyph object.                      */\n  /*                                                                       */\n  /*    mode  :: The mode which indicates how to interpret the returned    */\n  /*             bounding box values.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox :: The glyph coordinate bounding box.  Coordinates are       */\n  /*             expressed in 1/64th of pixels if it is grid-fitted.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Coordinates are relative to the glyph origin, using the y~upwards  */\n  /*    convention.                                                        */\n  /*                                                                       */\n  /*    If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode'   */\n  /*    must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font        */\n  /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */\n  /*    is another name for this constant.                                 */\n  /*                                                                       */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting CBox is meaningless.  To get      */\n  /*    reasonable values for the CBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the CBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  /*    Note that the maximum coordinates are exclusive, which means that  */\n  /*    one can compute the width and height of the glyph image (be it in  */\n  /*    integer or 26.6 pixels) as:                                        */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      width  = bbox.xMax - bbox.xMin;                                  */\n  /*      height = bbox.yMax - bbox.yMin;                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note also that for 26.6 coordinates, if `bbox_mode' is set to      */\n  /*    @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,  */\n  /*    which corresponds to:                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      bbox.xMin = FLOOR(bbox.xMin);                                    */\n  /*      bbox.yMin = FLOOR(bbox.yMin);                                    */\n  /*      bbox.xMax = CEILING(bbox.xMax);                                  */\n  /*      bbox.yMax = CEILING(bbox.yMax);                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get the bbox in pixel coordinates, set `bbox_mode' to           */\n  /*    @FT_GLYPH_BBOX_TRUNCATE.                                           */\n  /*                                                                       */\n  /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */\n  /*    to @FT_GLYPH_BBOX_PIXELS.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_To_Bitmap                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph object to a bitmap glyph object.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    the_glyph   :: A pointer to a handle to the target glyph.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: An enumeration that describes how the data is       */\n  /*                   rendered.                                           */\n  /*                                                                       */\n  /*    origin      :: A pointer to a vector used to translate the glyph   */\n  /*                   image before rendering.  Can be~0 (if no            */\n  /*                   translation).  The origin is expressed in           */\n  /*                   26.6 pixels.                                        */\n  /*                                                                       */\n  /*    destroy     :: A boolean that indicates that the original glyph    */\n  /*                   image should be destroyed by this function.  It is  */\n  /*                   never destroyed in case of error.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does nothing if the glyph format isn't scalable.     */\n  /*                                                                       */\n  /*    The glyph image is translated with the `origin' vector before      */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  /*    The first parameter is a pointer to an @FT_Glyph handle, that will */\n  /*    be _replaced_ by this function (with newly allocated data).        */\n  /*    Typically, you would use (omitting error handling):                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph        glyph;                                         */\n  /*        FT_BitmapGlyph  glyph_bitmap;                                  */\n  /*                                                                       */\n  /*                                                                       */\n  /*        // load glyph                                                  */\n  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */\n  /*                                                                       */\n  /*        // extract glyph image                                         */\n  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */\n  /*                                                                       */\n  /*        // convert to a bitmap (default render mode + destroying old)  */\n  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */\n  /*        {                                                              */\n  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,   */\n  /*                                      0, 1 );                          */\n  /*          if ( error ) // `glyph' unchanged                            */\n  /*            ...                                                        */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        // access bitmap content by typecasting                        */\n  /*        glyph_bitmap = (FT_BitmapGlyph)glyph;                          */\n  /*                                                                       */\n  /*        // do funny stuff with it, like blitting/drawing               */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        // discard glyph image (bitmap or not)                         */\n  /*        FT_Done_Glyph( glyph );                                        */\n  /*      }                                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*    Here another example, again without error handling:                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph  glyphs[MAX_GLYPHS]                                   */\n  /*                                                                       */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       */\n  /*                  FT_Get_Glyph ( face->glyph, &glyph[idx] );           */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*        {                                                              */\n  /*          FT_Glyph  bitmap = glyphs[idx];                              */\n  /*                                                                       */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          // after this call, `bitmap' no longer points into           */\n  /*          // the `glyphs' array (and the old value isn't destroyed)    */\n  /*          FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );    */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          FT_Done_Glyph( bitmap );                                     */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          FT_Done_Glyph( glyphs[idx] );                                */\n  /*      }                                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given glyph.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the target glyph object.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Done_Glyph( FT_Glyph  glyph );\n\n  /* */\n\n\n  /* other helpful functions */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Multiply                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Perform the matrix operation `b = a*b'.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: A pointer to matrix `a'.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    b :: A pointer to matrix `b'.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `a' or `b' is zero.              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix*        b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invert a 2x2 matrix.  Return an error if it can't be inverted.     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    matrix :: A pointer to the target matrix.  Remains untouched in    */\n  /*              case of error.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLYPH_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGXVAL_H__\n#define __FTGXVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gx_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueTypeGX/AAT Validation                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate TrueTypeGX/AAT tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */\n  /*    trak, prop, lcar).                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                                                                       */\n  /* Warning: Use FT_VALIDATE_XXX to validate a table.                     */\n  /*          Following definitions are for gxvalid developers.            */\n  /*                                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_VALIDATE_feat_INDEX     0\n#define FT_VALIDATE_mort_INDEX     1\n#define FT_VALIDATE_morx_INDEX     2\n#define FT_VALIDATE_bsln_INDEX     3\n#define FT_VALIDATE_just_INDEX     4\n#define FT_VALIDATE_kern_INDEX     5\n#define FT_VALIDATE_opbd_INDEX     6\n#define FT_VALIDATE_trak_INDEX     7\n#define FT_VALIDATE_prop_INDEX     8\n#define FT_VALIDATE_lcar_INDEX     9\n#define FT_VALIDATE_GX_LAST_INDEX  FT_VALIDATE_lcar_INDEX\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_VALIDATE_GX_LENGTH\n   *\n   * @description:\n   *   The number of tables checked in this module.  Use it as a parameter\n   *   for the `table-length' argument of function @FT_TrueTypeGX_Validate.\n   */\n#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n  /* */\n\n  /* Up to 0x1000 is used by otvalid.\n     Ox2xxx is reserved for feature OT extension. */\n#define FT_VALIDATE_GX_START 0x4000\n#define FT_VALIDATE_GX_BITFIELD( tag )                  \\\n  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_GXXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_TrueTypeGX_Validate to\n  *    indicate which TrueTypeGX/AAT Type tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_feat ::\n  *      Validate `feat' table.\n  *\n  *    FT_VALIDATE_mort ::\n  *      Validate `mort' table.\n  *\n  *    FT_VALIDATE_morx ::\n  *      Validate `morx' table.\n  *\n  *    FT_VALIDATE_bsln ::\n  *      Validate `bsln' table.\n  *\n  *    FT_VALIDATE_just ::\n  *      Validate `just' table.\n  *\n  *    FT_VALIDATE_kern ::\n  *      Validate `kern' table.\n  *\n  *    FT_VALIDATE_opbd ::\n  *      Validate `opbd' table.\n  *\n  *    FT_VALIDATE_trak ::\n  *      Validate `trak' table.\n  *\n  *    FT_VALIDATE_prop ::\n  *      Validate `prop' table.\n  *\n  *    FT_VALIDATE_lcar ::\n  *      Validate `lcar' table.\n  *\n  *    FT_VALIDATE_GX ::\n  *      Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,\n  *      opbd, trak, prop and lcar).\n  *\n  */\n\n#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )\n#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )\n#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )\n#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )\n#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )\n#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )\n#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )\n#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )\n#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )\n#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \\\n                          FT_VALIDATE_mort | \\\n                          FT_VALIDATE_morx | \\\n                          FT_VALIDATE_bsln | \\\n                          FT_VALIDATE_just | \\\n                          FT_VALIDATE_kern | \\\n                          FT_VALIDATE_opbd | \\\n                          FT_VALIDATE_trak | \\\n                          FT_VALIDATE_prop | \\\n                          FT_VALIDATE_lcar )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Validate\n  *\n  * @description:\n  *    Validate various TrueTypeGX tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_GXXXX for possible values.\n  *\n  *    table_length ::\n  *       The size of the `tables' array.  Normally, @FT_VALIDATE_GX_LENGTH\n  *       should be passed.\n  *\n  * @output:\n  *    tables ::\n  *       The array where all validated sfnt tables are stored.\n  *       The array itself must be allocated by a client.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with TrueTypeGX fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the buffers pointed to by\n  *   each `tables' element, by calling @FT_TrueTypeGX_Free.  A NULL value\n  *   indicates that the table either doesn't exist in the font, the\n  *   application hasn't asked for validation, or the validator doesn't have\n  *   the ability to validate the sfnt table.\n  */\n  FT_EXPORT( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Free\n  *\n  * @description:\n  *    Free the buffer allocated by TrueTypeGX validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer allocated by\n  *       @FT_TrueTypeGX_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_TrueTypeGX_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_CKERNXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_ClassicKern_Validate\n  *    to indicate the classic kern dialect or dialects.  If the selected\n  *    type doesn't fit, @FT_ClassicKern_Validate regards the table as\n  *    invalid.\n  *\n  * @values:\n  *    FT_VALIDATE_MS ::\n  *      Handle the `kern' table as a classic Microsoft kern table.\n  *\n  *    FT_VALIDATE_APPLE ::\n  *      Handle the `kern' table as a classic Apple kern table.\n  *\n  *    FT_VALIDATE_CKERN ::\n  *      Handle the `kern' as either classic Apple or Microsoft kern table.\n  */\n#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )\n#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )\n\n#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Validate\n  *\n  * @description:\n  *    Validate classic (16-bit format) kern table to assure that the offsets\n  *    and indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without error\n  *    checking (which can be quite time consuming).\n  *\n  *    The `kern' table validator in @FT_TrueTypeGX_Validate deals with both\n  *    the new 32-bit format and the classic 16-bit format, while\n  *    FT_ClassicKern_Validate only supports the classic 16-bit format.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the dialect to be validated.  See\n  *       @FT_VALIDATE_CKERNXXX for possible values.\n  *\n  * @output:\n  *    ckern_table ::\n  *       A pointer to the kern table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   After use, the application should deallocate the buffers pointed to by\n  *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value\n  *   indicates that the table doesn't exist in the font.\n  */\n  FT_EXPORT( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Free\n  *\n  * @description:\n  *    Free the buffer allocated by classic Kern validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_ClassicKern_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_ClassicKern_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftgzip.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.h                                                               */\n/*                                                                         */\n/*    Gzip-compressed stream support.                                      */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGZIP_H__\n#define __FTGZIP_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gzip                                                               */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    GZIP Streams                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using gzip-compressed font files.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Gzip-specific functions.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenGzip\n  *\n  * @description:\n  *   Open a new stream to parse gzip-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.gz' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, gzip compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a gzipped stream from\n  *   it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGZIP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftimage.h                                                              */\n/*                                                                         */\n/*    FreeType glyph image formats and default raster interface            */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2010, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Note: A `raster' is simply a scan-line converter, used to render      */\n  /*       FT_Outlines into FT_Bitmaps.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTIMAGE_H__\n#define __FTIMAGE_H__\n\n\n  /* _STANDALONE_ is from ftgrays.c */\n#ifndef _STANDALONE_\n#include <ft2build.h>\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pos                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The type FT_Pos is used to store vectorial coordinates.  Depending */\n  /*    on the context, these can represent distances in integer font      */\n  /*    units, or 16.16, or 26.6 fixed-point pixel coordinates.            */\n  /*                                                                       */\n  typedef signed long  FT_Pos;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Vector                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector; coordinates are of   */\n  /*    the FT_Pos type.                                                   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: The horizontal coordinate.                                    */\n  /*    y :: The vertical coordinate.                                      */\n  /*                                                                       */\n  typedef struct  FT_Vector_\n  {\n    FT_Pos  x;\n    FT_Pos  y;\n\n  } FT_Vector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BBox                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold an outline's bounding box, i.e., the      */\n  /*    coordinates of its extrema in the horizontal and vertical          */\n  /*    directions.                                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xMin :: The horizontal minimum (left-most).                        */\n  /*                                                                       */\n  /*    yMin :: The vertical minimum (bottom-most).                        */\n  /*                                                                       */\n  /*    xMax :: The horizontal maximum (right-most).                       */\n  /*                                                                       */\n  /*    yMax :: The vertical maximum (top-most).                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The bounding box is specified with the coordinates of the lower    */\n  /*    left and the upper right corner.  In PostScript, those values are  */\n  /*    often called (llx,lly) and (urx,ury), respectively.                */\n  /*                                                                       */\n  /*    If `yMin' is negative, this value gives the glyph's descender.     */\n  /*    Otherwise, the glyph doesn't descend below the baseline.           */\n  /*    Similarly, if `ymax' is positive, this value gives the glyph's     */\n  /*    ascender.                                                          */\n  /*                                                                       */\n  /*    `xMin' gives the horizontal distance from the glyph's origin to    */\n  /*    the left edge of the glyph's bounding box.  If `xMin' is negative, */\n  /*    the glyph extends to the left of the origin.                       */\n  /*                                                                       */\n  typedef struct  FT_BBox_\n  {\n    FT_Pos  xMin, yMin;\n    FT_Pos  xMax, yMax;\n\n  } FT_BBox;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Pixel_Mode                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of pixels in a     */\n  /*    given bitmap.  Note that additional formats may be added in the    */\n  /*    future.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_PIXEL_MODE_NONE ::                                              */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_MONO ::                                              */\n  /*      A monochrome bitmap, using 1~bit per pixel.  Note that pixels    */\n  /*      are stored in most-significant order (MSB), which means that     */\n  /*      the left-most pixel in a byte has value 128.                     */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY ::                                              */\n  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */\n  /*      images.  Each pixel is stored in one byte.  Note that the number */\n  /*      of `gray' levels is stored in the `num_grays' field of the       */\n  /*      @FT_Bitmap structure (it generally is 256).                      */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY2 ::                                             */\n  /*      A 2-bit per pixel bitmap, used to represent embedded             */\n  /*      anti-aliased bitmaps in font files according to the OpenType     */\n  /*      specification.  We haven't found a single font using this        */\n  /*      format, however.                                                 */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY4 ::                                             */\n  /*      A 4-bit per pixel bitmap, representing embedded anti-aliased     */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD ::                                               */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on LCD displays; the bitmap is three times      */\n  /*      wider than the original glyph image.  See also                   */\n  /*      @FT_RENDER_MODE_LCD.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD_V ::                                             */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on rotated LCD displays; the bitmap is three    */\n  /*      times taller than the original glyph image.  See also            */\n  /*      @FT_RENDER_MODE_LCD_V.                                           */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_BGRA ::                                              */\n  /*      An image with four 8-bit channels per pixel, representing a      */\n  /*      color image (such as emoticons) with alpha channel.  For each    */\n  /*      pixel, the format is BGRA, which means, the blue channel comes   */\n  /*      first in memory.  The color channels are pre-multiplied and in   */\n  /*      the sRGB colorspace.  For example, full red at half-translucent  */\n  /*      opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */\n  /*      See also @FT_LOAD_COLOR.                                         */\n  /*                                                                       */\n  typedef enum  FT_Pixel_Mode_\n  {\n    FT_PIXEL_MODE_NONE = 0,\n    FT_PIXEL_MODE_MONO,\n    FT_PIXEL_MODE_GRAY,\n    FT_PIXEL_MODE_GRAY2,\n    FT_PIXEL_MODE_GRAY4,\n    FT_PIXEL_MODE_LCD,\n    FT_PIXEL_MODE_LCD_V,\n    FT_PIXEL_MODE_BGRA,\n\n    FT_PIXEL_MODE_MAX      /* do not remove */\n\n  } FT_Pixel_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_pixel_mode_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Pixel_Mode values instead.                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_pixel_mode_none  :: See @FT_PIXEL_MODE_NONE.                    */\n  /*    ft_pixel_mode_mono  :: See @FT_PIXEL_MODE_MONO.                    */\n  /*    ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY.                    */\n  /*    ft_pixel_mode_pal2  :: See @FT_PIXEL_MODE_GRAY2.                   */\n  /*    ft_pixel_mode_pal4  :: See @FT_PIXEL_MODE_GRAY4.                   */\n  /*                                                                       */\n#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE\n#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO\n#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY\n#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2\n#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4\n\n /* */\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Palette_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT!                           */\n  /*                                                                       */\n  /*    An enumeration type to describe the format of a bitmap palette,    */\n  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_palette_mode_rgb  :: The palette is an array of 3-byte RGB      */\n  /*                            records.                                   */\n  /*                                                                       */\n  /*    ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA     */\n  /*                            records.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by       */\n  /*    FreeType, these types are not handled by the library itself.       */\n  /*                                                                       */\n  typedef enum  FT_Palette_Mode_\n  {\n    ft_palette_mode_rgb = 0,\n    ft_palette_mode_rgba,\n\n    ft_palette_mode_max   /* do not remove */\n\n  } FT_Palette_Mode;\n\n  /* */\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a bitmap or pixmap to the raster.     */\n  /*    Note that we now manage pixmaps of various depths through the      */\n  /*    `pixel_mode' field.                                                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    rows         :: The number of bitmap rows.                         */\n  /*                                                                       */\n  /*    width        :: The number of pixels in bitmap row.                */\n  /*                                                                       */\n  /*    pitch        :: The pitch's absolute value is the number of bytes  */\n  /*                    taken by one bitmap row, including padding.        */\n  /*                    However, the pitch is positive when the bitmap has */\n  /*                    a `down' flow, and negative when it has an `up'    */\n  /*                    flow.  In all cases, the pitch is an offset to add */\n  /*                    to a bitmap pointer in order to go down one row.   */\n  /*                                                                       */\n  /*                    Note that `padding' means the alignment of a       */\n  /*                    bitmap to a byte border, and FreeType functions    */\n  /*                    normally align to the smallest possible integer    */\n  /*                    value.                                             */\n  /*                                                                       */\n  /*                    For the B/W rasterizer, `pitch' is always an even  */\n  /*                    number.                                            */\n  /*                                                                       */\n  /*                    To change the pitch of a bitmap (say, to make it a */\n  /*                    multiple of 4), use @FT_Bitmap_Convert.            */\n  /*                    Alternatively, you might use callback functions to */\n  /*                    directly render to the application's surface; see  */\n  /*                    the file `example2.cpp' in the tutorial for a      */\n  /*                    demonstration.                                     */\n  /*                                                                       */\n  /*    buffer       :: A typeless pointer to the bitmap buffer.  This     */\n  /*                    value should be aligned on 32-bit boundaries in    */\n  /*                    most cases.                                        */\n  /*                                                                       */\n  /*    num_grays    :: This field is only used with                       */\n  /*                    @FT_PIXEL_MODE_GRAY; it gives the number of gray   */\n  /*                    levels used in the bitmap.                         */\n  /*                                                                       */\n  /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */\n  /*                    See @FT_Pixel_Mode for possible values.            */\n  /*                                                                       */\n  /*    palette_mode :: This field is intended for paletted pixel modes;   */\n  /*                    it indicates how the palette is stored.  Not       */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /*    palette      :: A typeless pointer to the bitmap palette; this     */\n  /*                    field is intended for paletted pixel modes.  Not   */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   For now, the only pixel modes supported by FreeType are mono and    */\n  /*   grays.  However, drivers might be added in the future to support    */\n  /*   more `colorful' options.                                            */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_\n  {\n    int             rows;\n    int             width;\n    int             pitch;\n    unsigned char*  buffer;\n    short           num_grays;\n    char            pixel_mode;\n    char            palette_mode;\n    void*           palette;\n\n  } FT_Bitmap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure is used to describe an outline to the scan-line     */\n  /*    converter.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    n_contours :: The number of contours in the outline.               */\n  /*                                                                       */\n  /*    n_points   :: The number of points in the outline.                 */\n  /*                                                                       */\n  /*    points     :: A pointer to an array of `n_points' @FT_Vector       */\n  /*                  elements, giving the outline's point coordinates.    */\n  /*                                                                       */\n  /*    tags       :: A pointer to an array of `n_points' chars, giving    */\n  /*                  each outline point's type.                           */\n  /*                                                                       */\n  /*                  If bit~0 is unset, the point is `off' the curve,     */\n  /*                  i.e., a Bézier control point, while it is `on' if    */\n  /*                  set.                                                 */\n  /*                                                                       */\n  /*                  Bit~1 is meaningful for `off' points only.  If set,  */\n  /*                  it indicates a third-order Bézier arc control point; */\n  /*                  and a second-order control point if unset.           */\n  /*                                                                       */\n  /*                  If bit~2 is set, bits 5-7 contain the drop-out mode  */\n  /*                  (as defined in the OpenType specification; the value */\n  /*                  is the same as the argument to the SCANMODE          */\n  /*                  instruction).                                        */\n  /*                                                                       */\n  /*                  Bits 3 and~4 are reserved for internal purposes.     */\n  /*                                                                       */\n  /*    contours   :: An array of `n_contours' shorts, giving the end      */\n  /*                  point of each contour within the outline.  For       */\n  /*                  example, the first contour is defined by the points  */\n  /*                  `0' to `contours[0]', the second one is defined by   */\n  /*                  the points `contours[0]+1' to `contours[1]', etc.    */\n  /*                                                                       */\n  /*    flags      :: A set of bit flags used to characterize the outline  */\n  /*                  and give hints to the scan-converter and hinter on   */\n  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_FLAGS.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The B/W rasterizer only checks bit~2 in the `tags' array for the   */\n  /*    first point of each contour.  The drop-out mode as given with      */\n  /*    @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and       */\n  /*    @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden.           */\n  /*                                                                       */\n  typedef struct  FT_Outline_\n  {\n    short       n_contours;      /* number of contours in glyph        */\n    short       n_points;        /* number of points in the glyph      */\n\n    FT_Vector*  points;          /* the outline's points               */\n    char*       tags;            /* the points flags                   */\n    short*      contours;        /* the contour end points             */\n\n    int         flags;           /* outline masks                      */\n\n  } FT_Outline;\n\n  /* Following limits must be consistent with */\n  /* FT_Outline.{n_contours,n_points}         */\n#define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX\n#define FT_OUTLINE_POINTS_MAX    SHRT_MAX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants use for the flags in an outline's    */\n  /*    `flags' field.                                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OUTLINE_NONE ::                                                 */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_OUTLINE_OWNER ::                                                */\n  /*      If set, this flag indicates that the outline's field arrays      */\n  /*      (i.e., `points', `flags', and `contours') are `owned' by the     */\n  /*      outline object, and should thus be freed when it is destroyed.   */\n  /*                                                                       */\n  /*    FT_OUTLINE_EVEN_ODD_FILL ::                                        */\n  /*      By default, outlines are filled using the non-zero winding rule. */\n  /*      If set to 1, the outline will be filled using the even-odd fill  */\n  /*      rule (only works with the smooth rasterizer).                    */\n  /*                                                                       */\n  /*    FT_OUTLINE_REVERSE_FILL ::                                         */\n  /*      By default, outside contours of an outline are oriented in       */\n  /*      clock-wise direction, as defined in the TrueType specification.  */\n  /*      This flag is set if the outline uses the opposite direction      */\n  /*      (typically for Type~1 fonts).  This flag is ignored by the scan  */\n  /*      converter.                                                       */\n  /*                                                                       */\n  /*    FT_OUTLINE_IGNORE_DROPOUTS ::                                      */\n  /*      By default, the scan converter will try to detect drop-outs in   */\n  /*      an outline and correct the glyph bitmap to ensure consistent     */\n  /*      shape continuity.  If set, this flag hints the scan-line         */\n  /*      converter to ignore such cases.  See below for more information. */\n  /*                                                                       */\n  /*    FT_OUTLINE_SMART_DROPOUTS ::                                       */\n  /*      Select smart dropout control.  If unset, use simple dropout      */\n  /*      control.  Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See    */\n  /*      below for more information.                                      */\n  /*                                                                       */\n  /*    FT_OUTLINE_INCLUDE_STUBS ::                                        */\n  /*      If set, turn pixels on for `stubs', otherwise exclude them.      */\n  /*      Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See below for    */\n  /*      more information.                                                */\n  /*                                                                       */\n  /*    FT_OUTLINE_HIGH_PRECISION ::                                       */\n  /*      This flag indicates that the scan-line converter should try to   */\n  /*      convert this outline to bitmaps with the highest possible        */\n  /*      quality.  It is typically set for small character sizes.  Note   */\n  /*      that this is only a hint that might be completely ignored by a   */\n  /*      given scan-converter.                                            */\n  /*                                                                       */\n  /*    FT_OUTLINE_SINGLE_PASS ::                                          */\n  /*      This flag is set to force a given scan-converter to only use a   */\n  /*      single pass over the outline to render a bitmap glyph image.     */\n  /*      Normally, it is set for very large character sizes.  It is only  */\n  /*      a hint that might be completely ignored by a given               */\n  /*      scan-converter.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */\n  /*    and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth            */\n  /*    rasterizer.                                                        */\n  /*                                                                       */\n  /*    There exists a second mechanism to pass the drop-out mode to the   */\n  /*    B/W rasterizer; see the `tags' field in @FT_Outline.               */\n  /*                                                                       */\n  /*    Please refer to the description of the `SCANTYPE' instruction in   */\n  /*    the OpenType specification (in file `ttinst1.doc') how simple      */\n  /*    drop-outs, smart drop-outs, and stubs are defined.                 */\n  /*                                                                       */\n#define FT_OUTLINE_NONE             0x0\n#define FT_OUTLINE_OWNER            0x1\n#define FT_OUTLINE_EVEN_ODD_FILL    0x2\n#define FT_OUTLINE_REVERSE_FILL     0x4\n#define FT_OUTLINE_IGNORE_DROPOUTS  0x8\n#define FT_OUTLINE_SMART_DROPOUTS   0x10\n#define FT_OUTLINE_INCLUDE_STUBS    0x20\n\n#define FT_OUTLINE_HIGH_PRECISION   0x100\n#define FT_OUTLINE_SINGLE_PASS      0x200\n\n\n /*************************************************************************\n  *\n  * @enum:\n  *   ft_outline_flags\n  *\n  * @description:\n  *   These constants are deprecated.  Please use the corresponding\n  *   @FT_OUTLINE_FLAGS values.\n  *\n  * @values:\n  *   ft_outline_none            :: See @FT_OUTLINE_NONE.\n  *   ft_outline_owner           :: See @FT_OUTLINE_OWNER.\n  *   ft_outline_even_odd_fill   :: See @FT_OUTLINE_EVEN_ODD_FILL.\n  *   ft_outline_reverse_fill    :: See @FT_OUTLINE_REVERSE_FILL.\n  *   ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.\n  *   ft_outline_high_precision  :: See @FT_OUTLINE_HIGH_PRECISION.\n  *   ft_outline_single_pass     :: See @FT_OUTLINE_SINGLE_PASS.\n  */\n#define ft_outline_none             FT_OUTLINE_NONE\n#define ft_outline_owner            FT_OUTLINE_OWNER\n#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL\n#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL\n#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS\n#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION\n#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS\n\n  /* */\n\n#define FT_CURVE_TAG( flag )  ( flag & 3 )\n\n#define FT_CURVE_TAG_ON            1\n#define FT_CURVE_TAG_CONIC         0\n#define FT_CURVE_TAG_CUBIC         2\n\n#define FT_CURVE_TAG_HAS_SCANMODE  4\n\n#define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */\n#define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */\n\n#define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \\\n                                     FT_CURVE_TAG_TOUCH_Y )\n\n#define FT_Curve_Tag_On       FT_CURVE_TAG_ON\n#define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC\n#define FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC\n#define FT_Curve_Tag_Touch_X  FT_CURVE_TAG_TOUCH_X\n#define FT_Curve_Tag_Touch_Y  FT_CURVE_TAG_TOUCH_Y\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `move  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `move to' is emitted to start a new contour in an outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `move to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_LineToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `line  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `line to' is emitted to indicate a segment in the outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `line to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_LineToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `conic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `conic to' is emitted to indicate a second-order Bézier arc in   */\n  /*    the outline.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: An intermediate control point between the last position */\n  /*               and the new target in `to'.                             */\n  /*                                                                       */\n  /*    to      :: A pointer to the target end point of the conic arc.     */\n  /*                                                                       */\n  /*    user    :: A typeless pointer which is passed from the caller of   */\n  /*               the decomposition function.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `cubic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `cubic to' is emitted to indicate a third-order Bézier arc.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first Bézier control point.           */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second Bézier control point.          */\n  /*                                                                       */\n  /*    to       :: A pointer to the target end point.                     */\n  /*                                                                       */\n  /*    user     :: A typeless pointer which is passed from the caller of  */\n  /*                the decomposition function.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,\n                             const FT_Vector*  control2,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline_Funcs                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold various function pointers used during outline  */\n  /*    decomposition in order to emit segments, conic, and cubic Béziers. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    move_to  :: The `move to' emitter.                                 */\n  /*                                                                       */\n  /*    line_to  :: The segment emitter.                                   */\n  /*                                                                       */\n  /*    conic_to :: The second-order Bézier arc emitter.                   */\n  /*                                                                       */\n  /*    cubic_to :: The third-order Bézier arc emitter.                    */\n  /*                                                                       */\n  /*    shift    :: The shift that is applied to coordinates before they   */\n  /*                are sent to the emitter.                               */\n  /*                                                                       */\n  /*    delta    :: The delta that is applied to coordinates before they   */\n  /*                are sent to the emitter, but after the shift.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The point coordinates sent to the emitters are the transformed     */\n  /*    version of the original coordinates (this is important for high    */\n  /*    accuracy during scan-conversion).  The transformation is simple:   */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      x' = (x << shift) - delta                                        */\n  /*      y' = (x << shift) - delta                                        */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Set the values of `shift' and `delta' to~0 to get the original     */\n  /*    point coordinates.                                                 */\n  /*                                                                       */\n  typedef struct  FT_Outline_Funcs_\n  {\n    FT_Outline_MoveToFunc   move_to;\n    FT_Outline_LineToFunc   line_to;\n    FT_Outline_ConicToFunc  conic_to;\n    FT_Outline_CubicToFunc  cubic_to;\n\n    int                     shift;\n    FT_Pos                  delta;\n\n  } FT_Outline_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags to an unsigned long type.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n#ifndef FT_IMAGE_TAG\n#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \\\n          value = ( ( (unsigned long)_x1 << 24 ) | \\\n                    ( (unsigned long)_x2 << 16 ) | \\\n                    ( (unsigned long)_x3 << 8  ) | \\\n                      (unsigned long)_x4         )\n#endif /* FT_IMAGE_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_Format                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of a given glyph   */\n  /*    image.  Note that this version of FreeType only supports two image */\n  /*    formats, even though future font drivers will be able to register  */\n  /*    their own format.                                                  */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_FORMAT_NONE ::                                            */\n  /*      The value~0 is reserved.                                         */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */\n  /*      The glyph image is a composite of several other images.  This    */\n  /*      format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to   */\n  /*      report compound glyphs (like accented characters).               */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_BITMAP ::                                          */\n  /*      The glyph image is a bitmap, and can be described as an          */\n  /*      @FT_Bitmap.  You generally need to access the `bitmap' field of  */\n  /*      the @FT_GlyphSlotRec structure to read it.                       */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_OUTLINE ::                                         */\n  /*      The glyph image is a vectorial outline made of line segments     */\n  /*      and Bézier arcs; it can be described as an @FT_Outline; you      */\n  /*      generally want to access the `outline' field of the              */\n  /*      @FT_GlyphSlotRec structure to read it.                           */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */\n  /*      The glyph image is a vectorial path with no inside and outside   */\n  /*      contours.  Some Type~1 fonts, like those in the Hershey family,  */\n  /*      contain glyphs in this format.  These are described as           */\n  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */\n  /*      them correctly.                                                  */\n  /*                                                                       */\n  typedef enum  FT_Glyph_Format_\n  {\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),\n\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )\n\n  } FT_Glyph_Format;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_format_xxx                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Glyph_Format values instead.                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_glyph_format_none      :: See @FT_GLYPH_FORMAT_NONE.            */\n  /*    ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE.       */\n  /*    ft_glyph_format_bitmap    :: See @FT_GLYPH_FORMAT_BITMAP.          */\n  /*    ft_glyph_format_outline   :: See @FT_GLYPH_FORMAT_OUTLINE.         */\n  /*    ft_glyph_format_plotter   :: See @FT_GLYPH_FORMAT_PLOTTER.         */\n  /*                                                                       */\n#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE\n#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE\n#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP\n#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE\n#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            R A S T E R   D E F I N I T I O N S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A raster is a scan converter, in charge of rendering an outline into  */\n  /* a a bitmap.  This section contains the public API for rasters.        */\n  /*                                                                       */\n  /* Note that in FreeType 2, all rasters are now encapsulated within      */\n  /* specific modules called `renderers'.  See `freetype/ftrender.h' for   */\n  /* more details on renderers.                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    raster                                                             */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Scanline Converter                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How vectorial outlines are converted into bitmaps and pixmaps.     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains technical definitions.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Raster                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle (pointer) to a raster object.  Each object can be used    */\n  /*    independently to convert an outline into a bitmap or pixmap.       */\n  /*                                                                       */\n  typedef struct FT_RasterRec_*  FT_Raster;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Span                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a single span of gray (or black) pixels  */\n  /*    when rendering a monochrome or anti-aliased bitmap.                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x        :: The span's horizontal start position.                  */\n  /*                                                                       */\n  /*    len      :: The span's length in pixels.                           */\n  /*                                                                       */\n  /*    coverage :: The span color/coverage, ranging from 0 (background)   */\n  /*                to 255 (foreground).  Only used for anti-aliased       */\n  /*                rendering.                                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is used by the span drawing callback type named     */\n  /*    @FT_SpanFunc which takes the y~coordinate of the span as a         */\n  /*    a parameter.                                                       */\n  /*                                                                       */\n  /*    The coverage value is always between 0 and 255.  If you want less  */\n  /*    gray values, the callback function has to reduce them.             */\n  /*                                                                       */\n  typedef struct  FT_Span_\n  {\n    short           x;\n    unsigned short  len;\n    unsigned char   coverage;\n\n  } FT_Span;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used as a call-back by the anti-aliased renderer in     */\n  /*    order to let client applications draw themselves the gray pixel    */\n  /*    spans on each scan line.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The scanline's y~coordinate.                              */\n  /*                                                                       */\n  /*    count :: The number of spans to draw on this scanline.             */\n  /*                                                                       */\n  /*    spans :: A table of `count' spans to draw on the scanline.         */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This callback allows client applications to directly render the    */\n  /*    gray spans of the anti-aliased bitmap to any kind of surfaces.     */\n  /*                                                                       */\n  /*    This can be used to write anti-aliased outlines directly to a      */\n  /*    given background bitmap, and even perform translucency.            */\n  /*                                                                       */\n  /*    Note that the `count' field cannot be greater than a fixed value   */\n  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */\n  /*    `ftoption.h'.  By default, this value is set to~32, which means    */\n  /*    that if there are more than 32~spans on a given scanline, the      */\n  /*    callback is called several times with the same `y' parameter in    */\n  /*    order to draw all callbacks.                                       */\n  /*                                                                       */\n  /*    Otherwise, the callback is only called once per scan-line, and     */\n  /*    only for those scanlines that do have `gray' pixels on them.       */\n  /*                                                                       */\n  typedef void\n  (*FT_SpanFunc)( int             y,\n                  int             count,\n                  const FT_Span*  spans,\n                  void*           user );\n\n#define FT_Raster_Span_Func  FT_SpanFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitTest_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to test whether a given target pixel is already set to the drawing */\n  /*    `color'.  These tests are crucial to implement drop-out control    */\n  /*    per-se the TrueType spec.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   1~if the pixel is `set', 0~otherwise.                               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_BitTest_Func)( int    y,\n                             int    x,\n                             void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitSet_Func                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to set an individual target pixel.  This is crucial to implement   */\n  /*    drop-out control according to the TrueType specification.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if the pixel is `set', 0~otherwise.                              */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_BitSet_Func)( int    y,\n                            int    x,\n                            void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flag constants as used in the `flags' field of a     */\n  /*    @FT_Raster_Params structure.                                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RASTER_FLAG_DEFAULT :: This value is 0.                         */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_AA      :: This flag is set to indicate that an     */\n  /*                              anti-aliased glyph image should be       */\n  /*                              generated.  Otherwise, it will be        */\n  /*                              monochrome (1-bit).                      */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct      */\n  /*                              rendering.  In this mode, client         */\n  /*                              applications must provide their own span */\n  /*                              callback.  This lets them directly       */\n  /*                              draw or compose over an existing bitmap. */\n  /*                              If this bit is not set, the target       */\n  /*                              pixmap's buffer _must_ be zeroed before  */\n  /*                              rendering.                               */\n  /*                                                                       */\n  /*                              Note that for now, direct rendering is   */\n  /*                              only possible with anti-aliased glyphs.  */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */\n  /*                              rendering mode.  If set, the output will */\n  /*                              be clipped to a box specified in the     */\n  /*                              `clip_box' field of the                  */\n  /*                              @FT_Raster_Params structure.             */\n  /*                                                                       */\n  /*                              Note that by default, the glyph bitmap   */\n  /*                              is clipped to the target pixmap, except  */\n  /*                              in direct rendering mode where all spans */\n  /*                              are generated if no clipping box is set. */\n  /*                                                                       */\n#define FT_RASTER_FLAG_DEFAULT  0x0\n#define FT_RASTER_FLAG_AA       0x1\n#define FT_RASTER_FLAG_DIRECT   0x2\n#define FT_RASTER_FLAG_CLIP     0x4\n\n  /* deprecated */\n#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT\n#define ft_raster_flag_aa       FT_RASTER_FLAG_AA\n#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT\n#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Params                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold the arguments used by a raster's render        */\n  /*    function.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    target      :: The target bitmap.                                  */\n  /*                                                                       */\n  /*    source      :: A pointer to the source glyph image (e.g., an       */\n  /*                   @FT_Outline).                                       */\n  /*                                                                       */\n  /*    flags       :: The rendering flags.                                */\n  /*                                                                       */\n  /*    gray_spans  :: The gray span drawing callback.                     */\n  /*                                                                       */\n  /*    black_spans :: The black span drawing callback.  UNIMPLEMENTED!    */\n  /*                                                                       */\n  /*    bit_test    :: The bit test callback.  UNIMPLEMENTED!              */\n  /*                                                                       */\n  /*    bit_set     :: The bit set callback.  UNIMPLEMENTED!               */\n  /*                                                                       */\n  /*    user        :: User-supplied data that is passed to each drawing   */\n  /*                   callback.                                           */\n  /*                                                                       */\n  /*    clip_box    :: An optional clipping box.  It is only used in       */\n  /*                   direct rendering mode.  Note that coordinates here  */\n  /*                   should be expressed in _integer_ pixels (and not in */\n  /*                   26.6 fixed-point units).                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA    */\n  /*    bit flag is set in the `flags' field, otherwise a monochrome       */\n  /*    bitmap is generated.                                               */\n  /*                                                                       */\n  /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */\n  /*    raster will call the `gray_spans' callback to draw gray pixel      */\n  /*    spans, in the case of an aa glyph bitmap, it will call             */\n  /*    `black_spans', and `bit_test' and `bit_set' in the case of a       */\n  /*    monochrome bitmap.  This allows direct composition over a          */\n  /*    pre-existing bitmap through user-provided callbacks to perform the */\n  /*    span drawing/composition.                                          */\n  /*                                                                       */\n  /*    Note that the `bit_test' and `bit_set' callbacks are required when */\n  /*    rendering a monochrome bitmap, as they are crucial to implement    */\n  /*    correct drop-out control as defined in the TrueType specification. */\n  /*                                                                       */\n  typedef struct  FT_Raster_Params_\n  {\n    const FT_Bitmap*        target;\n    const void*             source;\n    int                     flags;\n    FT_SpanFunc             gray_spans;\n    FT_SpanFunc             black_spans;  /* doesn't work! */\n    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */\n    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */\n    void*                   user;\n    FT_BBox                 clip_box;\n\n  } FT_Raster_Params;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_NewFunc                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create a new raster object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory allocator.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `memory' parameter is a typeless pointer in order to avoid     */\n  /*    un-wanted dependencies on the rest of the FreeType code.  In       */\n  /*    practice, it is an @FT_Memory object, i.e., a handle to the        */\n  /*    standard FreeType memory allocator.  However, this field can be    */\n  /*    completely ignored by a given raster implementation.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_NewFunc)( void*       memory,\n                        FT_Raster*  raster );\n\n#define FT_Raster_New_Func  FT_Raster_NewFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy a given raster object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_DoneFunc)( FT_Raster  raster );\n\n#define FT_Raster_Done_Func  FT_Raster_DoneFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_ResetFunc                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType provides an area of memory called the `render pool',      */\n  /*    available to all registered rasters.  This pool can be freely used */\n  /*    during a given scan-conversion but is shared by all rasters.  Its  */\n  /*    content is thus transient.                                         */\n  /*                                                                       */\n  /*    This function is called each time the render pool changes, or just */\n  /*    after a new raster object is created.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster    :: A handle to the new raster object.                    */\n  /*                                                                       */\n  /*    pool_base :: The address in memory of the render pool.             */\n  /*                                                                       */\n  /*    pool_size :: The size in bytes of the render pool.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Rasters can ignore the render pool and rely on dynamic memory      */\n  /*    allocation if they want to (a handle to the memory allocator is    */\n  /*    passed to the raster constructor).  However, this is not           */\n  /*    recommended for efficiency purposes.                               */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_ResetFunc)( FT_Raster       raster,\n                          unsigned char*  pool_base,\n                          unsigned long   pool_size );\n\n#define FT_Raster_Reset_Func  FT_Raster_ResetFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is a generic facility to change modes or attributes  */\n  /*    in a given raster.  This can be used for debugging purposes, or    */\n  /*    simply to allow implementation-specific `features' in a given      */\n  /*    raster module.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /*    mode   :: A 4-byte tag used to name the mode or property.          */\n  /*                                                                       */\n  /*    args   :: A pointer to the new mode/property to use.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_SetModeFunc)( FT_Raster      raster,\n                            unsigned long  mode,\n                            void*          args );\n\n#define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_RenderFunc                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invoke a given raster to scan-convert a given glyph image into a   */\n  /*    target bitmap.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  /*    params :: A pointer to an @FT_Raster_Params structure used to      */\n  /*              store the rendering parameters.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The exact format of the source image depends on the raster's glyph */\n  /*    format defined in its @FT_Raster_Funcs structure.  It can be an    */\n  /*    @FT_Outline or anything else in order to support a large array of  */\n  /*    glyph formats.                                                     */\n  /*                                                                       */\n  /*    Note also that the render function can fail and return a           */\n  /*    `FT_Err_Unimplemented_Feature' error code if the raster used does  */\n  /*    not support direct composition.                                    */\n  /*                                                                       */\n  /*    XXX: For now, the standard raster doesn't support direct           */\n  /*         composition but this should change for the final release (see */\n  /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */\n  /*         for examples of distinct implementations which support direct */\n  /*         composition).                                                 */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_RenderFunc)( FT_Raster                raster,\n                           const FT_Raster_Params*  params );\n\n#define FT_Raster_Render_Func  FT_Raster_RenderFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   A structure used to describe a given raster class to the library.   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_format  :: The supported glyph format for this raster.       */\n  /*                                                                       */\n  /*    raster_new    :: The raster constructor.                           */\n  /*                                                                       */\n  /*    raster_reset  :: Used to reset the render pool within the raster.  */\n  /*                                                                       */\n  /*    raster_render :: A function to render a glyph into a given bitmap. */\n  /*                                                                       */\n  /*    raster_done   :: The raster destructor.                            */\n  /*                                                                       */\n  typedef struct  FT_Raster_Funcs_\n  {\n    FT_Glyph_Format        glyph_format;\n    FT_Raster_NewFunc      raster_new;\n    FT_Raster_ResetFunc    raster_reset;\n    FT_Raster_SetModeFunc  raster_set_mode;\n    FT_Raster_RenderFunc   raster_render;\n    FT_Raster_DoneFunc     raster_done;\n\n  } FT_Raster_Funcs;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTIMAGE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftincrem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftincrem.h                                                             */\n/*                                                                         */\n/*    FreeType incremental loading (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007, 2008, 2010 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTINCREM_H__\n#define __FTINCREM_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *    incremental\n   *\n   * @title:\n   *    Incremental Loading\n   *\n   * @abstract:\n   *    Custom Glyph Loading.\n   *\n   * @description:\n   *   This section contains various functions used to perform so-called\n   *   `incremental' glyph loading.  This is a mode where all glyphs loaded\n   *   from a given @FT_Face are provided by the client application,\n   *\n   *   Apart from that, all other tables are loaded normally from the font\n   *   file.  This mode is useful when FreeType is used within another\n   *   engine, e.g., a PostScript Imaging Processor.\n   *\n   *   To enable this mode, you must use @FT_Open_Face, passing an\n   *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\n   *   @FT_Incremental_Interface value.  See the comments for\n   *   @FT_Incremental_InterfaceRec for an example.\n   *\n   */\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental\n   *\n   * @description:\n   *   An opaque type describing a user-provided object used to implement\n   *   `incremental' glyph loading within FreeType.  This is used to support\n   *   embedded fonts in certain environments (e.g., PostScript interpreters),\n   *   where the glyph data isn't in the font file, or must be overridden by\n   *   different values.\n   *\n   * @note:\n   *   It is up to client applications to create and implement @FT_Incremental\n   *   objects, as long as they provide implementations for the methods\n   *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\n   *   and @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   *   See the description of @FT_Incremental_InterfaceRec to understand how\n   *   to use incremental objects with FreeType.\n   *\n   */\n  typedef struct FT_IncrementalRec_*  FT_Incremental;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_MetricsRec\n   *\n   * @description:\n   *   A small structure used to contain the basic glyph metrics returned\n   *   by the @FT_Incremental_GetGlyphMetricsFunc method.\n   *\n   * @fields:\n   *   bearing_x ::\n   *     Left bearing, in font units.\n   *\n   *   bearing_y ::\n   *     Top bearing, in font units.\n   *\n   *   advance ::\n   *     Horizontal component of glyph advance, in font units.\n   *\n   *   advance_v ::\n   *     Vertical component of glyph advance, in font units.\n   *\n   * @note:\n   *   These correspond to horizontal or vertical metrics depending on the\n   *   value of the `vertical' argument to the function\n   *   @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   */\n  typedef struct  FT_Incremental_MetricsRec_\n  {\n    FT_Long  bearing_x;\n    FT_Long  bearing_y;\n    FT_Long  advance;\n    FT_Long  advance_v;     /* since 2.3.12 */\n\n  } FT_Incremental_MetricsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_Metrics\n   *\n   * @description:\n   *   A handle to an @FT_Incremental_MetricsRec structure.\n   *\n   */\n   typedef struct FT_Incremental_MetricsRec_*  FT_Incremental_Metrics;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphDataFunc\n   *\n   * @description:\n   *   A function called by FreeType to access a given glyph's data bytes\n   *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\n   *   enabled.\n   *\n   *   Note that the format of the glyph's data bytes depends on the font\n   *   file format.  For TrueType, it must correspond to the raw bytes within\n   *   the `glyf' table.  For PostScript formats, it must correspond to the\n   *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\n   *   undefined for any other format.\n   *\n   * @input:\n   *   incremental ::\n   *     Handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   * @output:\n   *   adata ::\n   *     A structure describing the returned glyph data bytes (which will be\n   *     accessed as a read-only byte block).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If this function returns successfully the method\n   *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\n   *   the data bytes.\n   *\n   *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\n   *   compound glyphs.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\n                                      FT_UInt         glyph_index,\n                                      FT_Data*        adata );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_FreeGlyphDataFunc\n   *\n   * @description:\n   *   A function used to release the glyph data bytes returned by a\n   *   successful call to @FT_Incremental_GetGlyphDataFunc.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   data ::\n   *     A structure describing the glyph data bytes (which will be accessed\n   *     as a read-only byte block).\n   *\n   */\n  typedef void\n  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\n                                       FT_Data*        data );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphMetricsFunc\n   *\n   * @description:\n   *   A function used to retrieve the basic metrics of a given glyph index\n   *   before accessing its data.  This is necessary because, in certain\n   *   formats like TrueType, the metrics are stored in a different place from\n   *   the glyph images proper.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   *   vertical ::\n   *     If true, return vertical metrics.\n   *\n   *   ametrics ::\n   *     This parameter is used for both input and output.\n   *     The original glyph metrics, if any, in font units.  If metrics are\n   *     not available all the values must be set to zero.\n   *\n   * @output:\n   *   ametrics ::\n   *     The replacement glyph metrics in font units.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphMetricsFunc)\n                      ( FT_Incremental              incremental,\n                        FT_UInt                     glyph_index,\n                        FT_Bool                     vertical,\n                        FT_Incremental_MetricsRec  *ametrics );\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_FuncsRec\n   *\n   * @description:\n   *   A table of functions for accessing fonts that load data\n   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\n   *\n   * @fields:\n   *   get_glyph_data ::\n   *     The function to get glyph data.  Must not be null.\n   *\n   *   free_glyph_data ::\n   *     The function to release glyph data.  Must not be null.\n   *\n   *   get_glyph_metrics ::\n   *     The function to get glyph metrics.  May be null if the font does\n   *     not provide overriding glyph metrics.\n   *\n   */\n  typedef struct  FT_Incremental_FuncsRec_\n  {\n    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\n    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\n    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\n\n  } FT_Incremental_FuncsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_InterfaceRec\n   *\n   * @description:\n   *   A structure to be used with @FT_Open_Face to indicate that the user\n   *   wants to support incremental glyph loading.  You should use it with\n   *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\n   *\n   *     {\n   *       FT_Incremental_InterfaceRec  inc_int;\n   *       FT_Parameter                 parameter;\n   *       FT_Open_Args                 open_args;\n   *\n   *\n   *       // set up incremental descriptor\n   *       inc_int.funcs  = my_funcs;\n   *       inc_int.object = my_object;\n   *\n   *       // set up optional parameter\n   *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\n   *       parameter.data = &inc_int;\n   *\n   *       // set up FT_Open_Args structure\n   *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\n   *       open_args.pathname   = my_font_pathname;\n   *       open_args.num_params = 1;\n   *       open_args.params     = &parameter; // we use one optional argument\n   *\n   *       // open the font\n   *       error = FT_Open_Face( library, &open_args, index, &face );\n   *       ...\n   *     }\n   *\n   */\n  typedef struct  FT_Incremental_InterfaceRec_\n  {\n    const FT_Incremental_FuncsRec*  funcs;\n    FT_Incremental                  object;\n\n  } FT_Incremental_InterfaceRec;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_Interface\n   *\n   * @description:\n   *   A pointer to an @FT_Incremental_InterfaceRec structure.\n   *\n   */\n  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_INCREMENTAL\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to indicate\n   *   an incremental loading object to be used by FreeType.\n   *\n   */\n#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTINCREM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftlcdfil.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.h                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2006, 2007, 2008, 2010 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_LCD_FILTER_H__\n#define __FT_LCD_FILTER_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *   lcd_filtering\n   *\n   * @title:\n   *   LCD Filtering\n   *\n   * @abstract:\n   *   Reduce color fringes of LCD-optimized bitmaps.\n   *\n   * @description:\n   *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass\n   *   filter which is then applied to LCD-optimized bitmaps generated\n   *   through @FT_Render_Glyph.  This is useful to reduce color fringes\n   *   which would occur with unfiltered rendering.\n   *\n   *   Note that no filter is active by default, and that this function is\n   *   *not* implemented in default builds of the library.  You need to\n   *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file\n   *   in order to activate it.\n   *\n   *   FreeType generates alpha coverage maps, which are linear by nature.\n   *   For instance, the value 0x80 in bitmap representation means that\n   *   (within numerical precision) 0x80/0xff fraction of that pixel is\n   *   covered by the glyph's outline.  The blending function for placing\n   *   text over a background is\n   *\n   *   {\n   *     dst = alpha * src + (1 - alpha) * dst    ,\n   *   }\n   *\n   *   which is known as OVER.  However, when calculating the output of the\n   *   OVER operator, the source colors should first be transformed to a\n   *   linear color space, then alpha blended in that space, and transformed\n   *   back to the output color space.\n   *\n   *   When linear light blending is used, the default FIR5 filtering\n   *   weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as\n   *   they have been designed for black on white rendering while lacking\n   *   gamma correction.  To preserve color neutrality, weights for a FIR5\n   *   filter should be chosen according to two free parameters `a' and `c',\n   *   and the FIR weights should be\n   *\n   *   {\n   *     [a - c, a + c, 2 * a, a + c, a - c]    .\n   *   }\n   *\n   *   This formula generates equal weights for all the color primaries\n   *   across the filter kernel, which makes it colorless.  One suggested\n   *   set of weights is\n   *\n   *   {\n   *     [0x10, 0x50, 0x60, 0x50, 0x10]    ,\n   *   }\n   *\n   *   where `a' has value 0x30 and `b' value 0x20.  The weights in filter\n   *   may have a sum larger than 0x100, which increases coloration slightly\n   *   but also improves contrast.\n   */\n\n\n  /****************************************************************************\n   *\n   * @enum:\n   *   FT_LcdFilter\n   *\n   * @description:\n   *   A list of values to identify various types of LCD filters.\n   *\n   * @values:\n   *   FT_LCD_FILTER_NONE ::\n   *     Do not perform filtering.  When used with subpixel rendering, this\n   *     results in sometimes severe color fringes.\n   *\n   *   FT_LCD_FILTER_DEFAULT ::\n   *     The default filter reduces color fringes considerably, at the cost\n   *     of a slight blurriness in the output.\n   *\n   *   FT_LCD_FILTER_LIGHT ::\n   *     The light filter is a variant that produces less blurriness at the\n   *     cost of slightly more color fringes than the default one.  It might\n   *     be better, depending on taste, your monitor, or your personal vision.\n   *\n   *   FT_LCD_FILTER_LEGACY ::\n   *     This filter corresponds to the original libXft color filter.  It\n   *     provides high contrast output but can exhibit really bad color\n   *     fringes if glyphs are not extremely well hinted to the pixel grid.\n   *     In other words, it only works well if the TrueType bytecode\n   *     interpreter is enabled *and* high-quality hinted fonts are used.\n   *\n   *     This filter is only provided for comparison purposes, and might be\n   *     disabled or stay unsupported in the future.\n   *\n   * @since:\n   *   2.3.0\n   */\n  typedef enum  FT_LcdFilter_\n  {\n    FT_LCD_FILTER_NONE    = 0,\n    FT_LCD_FILTER_DEFAULT = 1,\n    FT_LCD_FILTER_LIGHT   = 2,\n    FT_LCD_FILTER_LEGACY  = 16,\n\n    FT_LCD_FILTER_MAX   /* do not remove */\n\n  } FT_LcdFilter;\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilter\n   *\n   * @description:\n   *   This function is used to apply color filtering to LCD decimated\n   *   bitmaps, like the ones used when calling @FT_Render_Glyph with\n   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   filter ::\n   *     The filter type.\n   *\n   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or\n   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work\n   *     well on most LCD screens.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This feature is always disabled by default.  Clients must make an\n   *   explicit call to this function with a `filter' value other than\n   *   @FT_LCD_FILTER_NONE in order to enable it.\n   *\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,\n   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.\n   *\n   *   It does _not_ affect the output of @FT_Outline_Render and\n   *   @FT_Outline_Get_Bitmap.\n   *\n   *   If this feature is activated, the dimensions of LCD glyph bitmaps are\n   *   either larger or taller than the dimensions of the corresponding\n   *   outline with regards to the pixel grid.  For example, for\n   *   @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and\n   *   up to 3~pixels to the right.\n   *\n   *   The bitmap offset values are adjusted correctly, so clients shouldn't\n   *   need to modify their layout and glyph positioning code when enabling\n   *   the filter.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter );\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilterWeights\n   *\n   * @description:\n   *   Use this function to override the filter weights selected by\n   *   @FT_Library_SetLcdFilter.  By default, FreeType uses the quintuple\n   *   (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,\n   *   0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and\n   *   FT_LCD_FILTER_LEGACY.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   weights ::\n   *     A pointer to an array; the function copies the first five bytes and\n   *     uses them to specify the filter weights.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   This function must be called after @FT_Library_SetLcdFilter to have\n   *   any effect.\n   *\n   * @since:\n   *   2.4.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_LCD_FILTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftlist.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlist.h                                                               */\n/*                                                                         */\n/*    Generic list support for FreeType (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file implements functions relative to list processing.  Its     */\n  /*  data structures are defined in `freetype.h'.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTLIST_H__\n#define __FTLIST_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    List Processing                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Simple management of lists.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various definitions related to list          */\n  /*    processing using doubly-linked nodes.                              */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_List                                                            */\n  /*    FT_ListNode                                                        */\n  /*    FT_ListRec                                                         */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /*    FT_List_Add                                                        */\n  /*    FT_List_Insert                                                     */\n  /*    FT_List_Find                                                       */\n  /*    FT_List_Remove                                                     */\n  /*    FT_List_Up                                                         */\n  /*    FT_List_Iterate                                                    */\n  /*    FT_List_Iterator                                                   */\n  /*    FT_List_Finalize                                                   */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Find                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the list node for a given listed object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    data :: The address of the listed object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    List node.  NULL if it wasn't found.                               */\n  /*                                                                       */\n  FT_EXPORT( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Add                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Append an element to the end of a list.                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to append.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Insert                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Insert an element at the head of a list.                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to parent list.                                  */\n  /*    node :: The node to insert.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Remove                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a node from a list.  This function doesn't check whether    */\n  /*    the node is in the list!                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The node to remove.                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Up                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Move a node to the head/top of a list.  Used to maintain LRU       */\n  /*    lists.                                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to move.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Iterator                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An FT_List iterator function which is called during a list parse   */\n  /*    by @FT_List_Iterate.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The current iteration list node.                           */\n  /*                                                                       */\n  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */\n  /*            Can be used to point to the iteration's state.             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_List_Iterator)( FT_ListNode  node,\n                       void*        user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Iterate                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse a list and calls a given iterator function on each element.  */\n  /*    Note that parsing is stopped as soon as one of the iterator calls  */\n  /*    returns a non-zero value.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list     :: A handle to the list.                                  */\n  /*    iterator :: An iterator function, called on each node of the list. */\n  /*    user     :: A user-supplied field which is passed as the second    */\n  /*                argument to the iterator.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result (a FreeType error code) of the last iterator call.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An @FT_List iterator function which is called during a list        */\n  /*    finalization by @FT_List_Finalize to destroy all elements in a     */\n  /*    given list.                                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    system :: The current system object.                               */\n  /*                                                                       */\n  /*    data   :: The current object to destroy.                           */\n  /*                                                                       */\n  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */\n  /*              be used to point to the iteration's state.               */\n  /*                                                                       */\n  typedef void\n  (*FT_List_Destructor)( FT_Memory  memory,\n                         void*      data,\n                         void*      user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Finalize                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy all elements in the list as well as the list itself.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list    :: A handle to the list.                                   */\n  /*                                                                       */\n  /*    destroy :: A list destructor that will be applied to each element  */\n  /*               of the list.                                            */\n  /*                                                                       */\n  /*    memory  :: The current memory object which handles deallocation.   */\n  /*                                                                       */\n  /*    user    :: A user-supplied field which is passed as the last       */\n  /*               argument to the destructor.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function expects that all nodes added by @FT_List_Add or      */\n  /*    @FT_List_Insert have been dynamically allocated.                   */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLIST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftlzw.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.h                                                                */\n/*                                                                         */\n/*    LZW-compressed stream support.                                       */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTLZW_H__\n#define __FTLZW_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    lzw                                                                */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    LZW Streams                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using LZW-compressed font files.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of LZW-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenLZW\n  *\n  * @description:\n  *   Open a new stream to parse LZW-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.Z' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream :: The target embedding stream.\n  *\n  *   source :: The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream\n  *\n  *   In certain builds of the library, LZW compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a LZW stream from it\n  *   and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with LZW support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLZW_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftmac.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.h                                                                */\n/*                                                                         */\n/*    Additional Mac-specific API.                                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2007 by                               */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* NOTE: Include this file after <freetype/freetype.h> and after any       */\n/*       Mac-specific headers (because this header uses Mac types such as  */\n/*       Handle, FSSpec, FSRef, etc.)                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMAC_H__\n#define __FTMAC_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n/* gcc-3.4.1 and later can warn about functions tagged as deprecated */\n#ifndef FT_DEPRECATED_ATTRIBUTE\n#if defined(__GNUC__)                                               && \\\n    ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define FT_DEPRECATED_ATTRIBUTE  __attribute__((deprecated))\n#else\n#define FT_DEPRECATED_ATTRIBUTE\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    mac_specific                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Mac Specific Interface                                             */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Only available on the Macintosh.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following definitions are only available if FreeType is        */\n  /*    compiled on a Macintosh.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FOND                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a FOND resource.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fond       :: A FOND resource.                                     */\n  /*                                                                       */\n  /*    face_index :: Only supported for the -1 `sanity check' special     */\n  /*                  case.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Notes>                                                               */\n  /*    This function can be used to create @FT_Face objects from fonts    */\n  /*    that are installed in the system as follows.                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      fond = GetResource( 'FOND', fontName );                          */\n  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face    *aface )\n                       FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_Name                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */\n  /*                  Bold).                                               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file.  For passing to                  */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face.  For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n                          FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_ATS_Name                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font in ATS framework.            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file. For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face. For passing to                    */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n                              FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFilePath_From_Mac_ATS_Name                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pathname of the disk file and face index for given font   */\n  /*    name which is handled by ATS framework.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName    :: Mac OS name of the font in ATS framework.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    path        :: Buffer to store pathname of the file.  For passing  */\n  /*                   to @FT_New_Face.  The client must allocate this     */\n  /*                   buffer before calling this function.                */\n  /*                                                                       */\n  /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */\n  /*                                                                       */\n  /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index )\n                                  FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSSpec to the font file.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSSpec to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */\n  /*    it accepts an FSSpec instead of a path.                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec  *spec,\n                           FT_Long        face_index,\n                           FT_Face       *aface )\n                         FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSRef to the font file.                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSRef to the font file.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */\n  /*    it accepts an FSRef instead of a path.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef  *ref,\n                          FT_Long       face_index,\n                          FT_Face      *aface )\n                        FT_DEPRECATED_ATTRIBUTE;\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTMAC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.h                                                                 */\n/*                                                                         */\n/*    FreeType Multiple Master font interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMM_H__\n#define __FTMM_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    multiple_masters                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Multiple Masters                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to manage Multiple Masters fonts.                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following types and functions are used to manage Multiple      */\n  /*    Master fonts, i.e., the selection of specific design instances by  */\n  /*    setting design axis coordinates.                                   */\n  /*                                                                       */\n  /*    George Williams has extended this interface to make it work with   */\n  /*    both Type~1 Multiple Masters fonts and GX distortable (var)        */\n  /*    fonts.  Some of these routines only work with MM fonts, others     */\n  /*    will work with both types.  They are similar enough that a         */\n  /*    consistent interface makes sense.                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Axis                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  typedef struct  FT_MM_Axis_\n  {\n    FT_String*  name;\n    FT_Long     minimum;\n    FT_Long     maximum;\n\n  } FT_MM_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Multi_Master                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis    :: Number of axes.  Cannot exceed~4.                   */\n  /*                                                                       */\n  /*    num_designs :: Number of designs; should be normally 2^num_axis    */\n  /*                   even though the Type~1 specification strangely      */\n  /*                   allows for intermediate designs to be present. This */\n  /*                   number cannot exceed~16.                            */\n  /*                                                                       */\n  /*    axis        :: A table of axis descriptors.                        */\n  /*                                                                       */\n  typedef struct  FT_Multi_Master_\n  {\n    FT_UInt     num_axis;\n    FT_UInt     num_designs;\n    FT_MM_Axis  axis[T1_MAX_MM_AXIS];\n\n  } FT_Multi_Master;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Axis                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters and GX var fonts.                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*               Not always meaningful for GX.                           */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    def     :: The axis's default design coordinate.                   */\n  /*               FreeType computes meaningful default values for MM; it  */\n  /*               is then an integer value, not in 16.16 format.          */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  /*    tag     :: The axis's tag (the GX equivalent to `name').           */\n  /*               FreeType provides default values for MM if possible.    */\n  /*                                                                       */\n  /*    strid   :: The entry in `name' table (another GX version of        */\n  /*               `name').                                                */\n  /*               Not meaningful for MM.                                  */\n  /*                                                                       */\n  typedef struct  FT_Var_Axis_\n  {\n    FT_String*  name;\n\n    FT_Fixed    minimum;\n    FT_Fixed    def;\n    FT_Fixed    maximum;\n\n    FT_ULong    tag;\n    FT_UInt     strid;\n\n  } FT_Var_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Named_Style                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a named style in a GX var font.   */\n  /*                                                                       */\n  /*    This structure can't be used for MM fonts.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    coords :: The design coordinates for this style.                   */\n  /*              This is an array with one entry for each axis.           */\n  /*                                                                       */\n  /*    strid  :: The entry in `name' table identifying this style.        */\n  /*                                                                       */\n  typedef struct  FT_Var_Named_Style_\n  {\n    FT_Fixed*  coords;\n    FT_UInt    strid;\n\n  } FT_Var_Named_Style;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Var                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    or GX var distortable font.                                        */\n  /*                                                                       */\n  /*    Some fields are specific to one format and not to the other.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis        :: The number of axes.  The maximum value is~4 for */\n  /*                       MM; no limit in GX.                             */\n  /*                                                                       */\n  /*    num_designs     :: The number of designs; should be normally       */\n  /*                       2^num_axis for MM fonts.  Not meaningful for GX */\n  /*                       (where every glyph could have a different       */\n  /*                       number of designs).                             */\n  /*                                                                       */\n  /*    num_namedstyles :: The number of named styles; only meaningful for */\n  /*                       GX which allows certain design coordinates to   */\n  /*                       have a string ID (in the `name' table)          */\n  /*                       associated with them.  The font can tell the    */\n  /*                       user that, for example, Weight=1.5 is `Bold'.   */\n  /*                                                                       */\n  /*    axis            :: A table of axis descriptors.                    */\n  /*                       GX fonts contain slightly more data than MM.    */\n  /*                                                                       */\n  /*    namedstyles     :: A table of named styles.                        */\n  /*                       Only meaningful with GX.                        */\n  /*                                                                       */\n  typedef struct  FT_MM_Var_\n  {\n    FT_UInt              num_axis;\n    FT_UInt              num_designs;\n    FT_UInt              num_namedstyles;\n    FT_Var_Axis*         axis;\n    FT_Var_Named_Style*  namedstyle;\n\n  } FT_MM_Var;\n\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Multi_Master                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master descriptor of a given font.           */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master/GX var descriptor of a given font.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters/GX var descriptor.                 */\n  /*               Allocates a data structure, which the user must free    */\n  /*               (a single call to FT_FREE will do it).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Design_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters fonts, choose an interpolated font design     */\n  /*    through design coordinates.                                        */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Design_Coordinates                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */\n  /*    design through design coordinates.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Blend_Coordinates                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters and GX var fonts, choose an interpolated font */\n  /*    design through normalized blend coordinates.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: The design coordinates array (each element must be   */\n  /*                  between 0 and 1.0).                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Blend_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftmodapi.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmodapi.h                                                             */\n/*                                                                         */\n/*    FreeType modules public interface (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMODAPI_H__\n#define __FTMODAPI_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Module Management                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to add, upgrade, remove, and control modules from FreeType.    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The definitions below are used to manage modules within FreeType.  */\n  /*    Modules can be added, upgraded, and removed at runtime.            */\n  /*    Additionally, some module properties can be controlled also.       */\n  /*                                                                       */\n  /*    Here is a list of possible values of the `module_name' field in    */\n  /*    the @FT_Module_Class structure.                                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      autofitter                                                       */\n  /*      bdf                                                              */\n  /*      cff                                                              */\n  /*      gxvalid                                                          */\n  /*      otvalid                                                          */\n  /*      pcf                                                              */\n  /*      pfr                                                              */\n  /*      psaux                                                            */\n  /*      pshinter                                                         */\n  /*      psnames                                                          */\n  /*      raster1, raster5                                                 */\n  /*      sfnt                                                             */\n  /*      smooth, smooth-lcd, smooth-lcdv                                  */\n  /*      truetype                                                         */\n  /*      type1                                                            */\n  /*      type42                                                           */\n  /*      t1cid                                                            */\n  /*      winfonts                                                         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that the FreeType Cache sub-system is not a FreeType module.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* module bit flags */\n#define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */\n#define FT_MODULE_RENDERER            2  /* this module is a renderer     */\n#define FT_MODULE_HINTER              4  /* this module is a glyph hinter */\n#define FT_MODULE_STYLER              8  /* this module is a styler       */\n\n#define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */\n                                              /* scalable fonts           */\n#define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */\n                                              /* support vector outlines  */\n#define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */\n                                              /* own hinter               */\n\n\n  /* deprecated values */\n#define ft_module_font_driver         FT_MODULE_FONT_DRIVER\n#define ft_module_renderer            FT_MODULE_RENDERER\n#define ft_module_hinter              FT_MODULE_HINTER\n#define ft_module_styler              FT_MODULE_STYLER\n\n#define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE\n#define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES\n#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER\n\n\n  typedef FT_Pointer  FT_Module_Interface;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Constructor                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to initialize (not create) a new module object.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to initialize.                                */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Constructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destructor                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to finalize (not destroy) a given module object.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to finalize.                                  */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Requester                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to query a given module for a specific interface.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to be searched.                               */\n  /*                                                                       */\n  /*    name ::   The name of the interface in the module.                 */\n  /*                                                                       */\n  typedef FT_Module_Interface\n  (*FT_Module_Requester)( FT_Module    module,\n                          const char*  name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The module class descriptor.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    module_flags    :: Bit flags describing the module.                */\n  /*                                                                       */\n  /*    module_size     :: The size of one module object/instance in       */\n  /*                       bytes.                                          */\n  /*                                                                       */\n  /*    module_name     :: The name of the module.                         */\n  /*                                                                       */\n  /*    module_version  :: The version, as a 16.16 fixed number            */\n  /*                       (major.minor).                                  */\n  /*                                                                       */\n  /*    module_requires :: The version of FreeType this module requires,   */\n  /*                       as a 16.16 fixed number (major.minor).  Starts  */\n  /*                       at version 2.0, i.e., 0x20000.                  */\n  /*                                                                       */\n  /*    module_init     :: The initializing function.                      */\n  /*                                                                       */\n  /*    module_done     :: The finalizing function.                        */\n  /*                                                                       */\n  /*    get_interface   :: The interface requesting function.              */\n  /*                                                                       */\n  typedef struct  FT_Module_Class_\n  {\n    FT_ULong               module_flags;\n    FT_Long                module_size;\n    const FT_String*       module_name;\n    FT_Fixed               module_version;\n    FT_Fixed               module_requires;\n\n    const void*            module_interface;\n\n    FT_Module_Constructor  module_init;\n    FT_Module_Destructor   module_done;\n    FT_Module_Requester    get_interface;\n\n  } FT_Module_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add a new module to a given library instance.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    clazz   :: A pointer to class descriptor for the module.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find a module by its name.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module handle.  0~if none was found.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    FreeType's internal modules aren't documented very well, and you   */\n  /*    should look up the source code for details.                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Remove_Module                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a given module from a library instance.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module  :: A handle to a module object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The module object is destroyed by the function in case of success. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Set\n   *\n   * @description:\n   *    Set a property for a given module.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   *       Note that only a few modules have properties.\n   *\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the new\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example sets property `bar' (a simple integer) in\n   *    module `foo' to value~1.\n   *\n   *    {\n   *      FT_UInt  bar;\n   *\n   *\n   *      bar = 1;\n   *      FT_Property_Set( library, \"foo\", \"bar\", &bar );\n   *    }\n   *\n   *    Note that the FreeType Cache sub-system doesn't recognize module\n   *    property changes.  To avoid glyph lookup confusion within the cache\n   *    you should call @FTC_Manager_Reset to completely flush the cache if\n   *    a module property gets changed after @FTC_Manager_New has been\n   *    called.\n   *\n   *    It is not possible to set properties of the FreeType Cache\n   *    sub-system itself with FT_Property_Set; use @FTC_Property_Set\n   *    instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Set( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   const void*       value );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Get\n   *\n   * @description:\n   *    Get a module's property value.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   * @inout:\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example gets property `baz' (a range) in module `foo'.\n   *\n   *    {\n   *      typedef  range_\n   *      {\n   *        FT_Int32  min;\n   *        FT_Int32  max;\n   *\n   *      } range;\n   *\n   *      range  baz;\n   *\n   *\n   *      FT_Property_Get( library, \"foo\", \"baz\", &baz );\n   *    }\n   *\n   *    It is not possible to retrieve properties of the FreeType Cache\n   *    sub-system with FT_Property_Get; use @FTC_Property_Get instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Get( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   void*             value );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Library                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Library         */\n  /*    structure is created.  This function increments the counter.       */\n  /*    @FT_Done_Library then only destroys a library if the counter is~1, */\n  /*    otherwise it simply decrements the counter.                        */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Library objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a target library object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Library( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Library                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to create a new FreeType library instance    */\n  /*    from a given memory object.  It is thus possible to use libraries  */\n  /*    with distinct memory allocators within the same program.           */\n  /*                                                                       */\n  /*    Normally, you would call this function (followed by a call to      */\n  /*    @FT_Add_Default_Modules or a series of calls to @FT_Add_Module)    */\n  /*    instead of @FT_Init_FreeType to initialize the FreeType library.   */\n  /*                                                                       */\n  /*    Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a      */\n  /*    library instance.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A handle to the original memory object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A pointer to handle of a new library object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Library                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given library object.  This closes all drivers and       */\n  /*    discards all resource objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Library( FT_Library  library );\n\n/* */\n\n  typedef void\n  (*FT_DebugHook_Func)( void*  arg );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set a debug hook function for debugging the interpreter of a font  */\n  /*    format.                                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hook_index :: The index of the debug hook.  You should use the     */\n  /*                  values defined in `ftobjs.h', e.g.,                  */\n  /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */\n  /*                                                                       */\n  /*    debug_hook :: The function used to debug the interpreter.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, four debug hook slots are available, but only two (for  */\n  /*    the TrueType and the Type~1 interpreter) are defined.              */\n  /*                                                                       */\n  /*    Since the internal headers of FreeType are no longer installed,    */\n  /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */\n  /*    This is a bug and will be fixed in a forthcoming release.          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add the set of default drivers to a given library object.          */\n  /*    This is only useful when you create a library object with          */\n  /*    @FT_New_Library (usually to plug a custom memory manager).         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a new library object.                       */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Add_Default_Modules( FT_Library  library );\n\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   truetype_engine\n   *\n   * @title:\n   *   The TrueType Engine\n   *\n   * @abstract:\n   *   TrueType bytecode support.\n   *\n   * @description:\n   *   This section contains a function used to query the level of TrueType\n   *   bytecode support compiled in this version of the library.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   *  @enum:\n   *     FT_TrueTypeEngineType\n   *\n   *  @description:\n   *     A list of values describing which kind of TrueType bytecode\n   *     engine is implemented in a given FT_Library instance.  It is used\n   *     by the @FT_Get_TrueType_Engine_Type function.\n   *\n   *  @values:\n   *     FT_TRUETYPE_ENGINE_TYPE_NONE ::\n   *       The library doesn't implement any kind of bytecode interpreter.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::\n   *       The library implements a bytecode interpreter that doesn't\n   *       support the patented operations of the TrueType virtual machine.\n   *\n   *       Its main use is to load certain Asian fonts which position and\n   *       scale glyph components with bytecode instructions.  It produces\n   *       bad output for most other fonts.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_PATENTED ::\n   *       The library implements a bytecode interpreter that covers\n   *       the full instruction set of the TrueType virtual machine (this\n   *       was governed by patents until May 2010, hence the name).\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  typedef enum  FT_TrueTypeEngineType_\n  {\n    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n\n  } FT_TrueTypeEngineType;\n\n\n  /**************************************************************************\n   *\n   *  @func:\n   *     FT_Get_TrueType_Engine_Type\n   *\n   *  @description:\n   *     Return an @FT_TrueTypeEngineType value to indicate which level of\n   *     the TrueType virtual machine a given library instance supports.\n   *\n   *  @input:\n   *     library ::\n   *       A library instance.\n   *\n   *  @return:\n   *     A value indicating which level is supported.\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  FT_EXPORT( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMODAPI_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftmoderr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmoderr.h                                                             */\n/*                                                                         */\n/*    FreeType module error offsets (specification).                       */\n/*                                                                         */\n/*  Copyright 2001-2005, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the FreeType module error codes.          */\n  /*                                                                       */\n  /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is    */\n  /* set, the lower byte of an error value identifies the error code as    */\n  /* usual.  In addition, the higher byte identifies the module.  For      */\n  /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */\n  /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error        */\n  /* `T1_Err_Invalid_File_Format' has value 0x1403, etc.                   */\n  /*                                                                       */\n  /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero,    */\n  /* including the high byte.                                              */\n  /*                                                                       */\n  /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of   */\n  /* an error value is set to zero.                                        */\n  /*                                                                       */\n  /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */\n  /* provides some macros in `fttypes.h'.                                  */\n  /*                                                                       */\n  /*   FT_ERR( err )                                                       */\n  /*     Add current error module prefix (as defined with the              */\n  /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */\n  /*     the line                                                          */\n  /*                                                                       */\n  /*       error = FT_ERR( Invalid_Outline );                              */\n  /*                                                                       */\n  /*     expands to                                                        */\n  /*                                                                       */\n  /*       error = BDF_Err_Invalid_Outline;                                */\n  /*                                                                       */\n  /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */\n  /*     of `FT_ERR( Ok )'.                                                */\n  /*                                                                       */\n  /*   FT_ERR_EQ( errcode, err )                                           */\n  /*   FT_ERR_NEQ( errcode, err )                                          */\n  /*     Compare error code `errcode' with the error `err' for equality    */\n  /*     and inequality, respectively.  Example:                           */\n  /*                                                                       */\n  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*     Using this macro you don't have to think about error prefixes.    */\n  /*     Of course, if module errors are not active, the above example is  */\n  /*     the same as                                                       */\n  /*                                                                       */\n  /*       if ( error == FT_Err_Invalid_Outline )                          */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*   FT_ERROR_BASE( errcode )                                            */\n  /*   FT_ERROR_MODULE( errcode )                                          */\n  /*     Get base error and module error code, respectively.               */\n  /*                                                                       */\n  /*                                                                       */\n  /* It can also be used to create a module error message table easily     */\n  /* with something like                                                   */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     #undef __FTMODERR_H__                                             */\n  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */\n  /*     #define FT_MODERR_START_LIST     {                                */\n  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */\n  /*                                                                       */\n  /*     const struct                                                      */\n  /*     {                                                                 */\n  /*       int          mod_err_offset;                                    */\n  /*       const char*  mod_err_msg                                        */\n  /*     } ft_mod_errors[] =                                               */\n  /*                                                                       */\n  /*     #include FT_MODULE_ERRORS_H                                       */\n  /*   }                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTMODERR_H__\n#define __FTMODERR_H__\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#ifndef FT_MODERRDEF\n\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,\n#else\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,\n#endif\n\n#define FT_MODERR_START_LIST  enum {\n#define FT_MODERR_END_LIST    FT_Mod_Err_Max };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_MODERRDEF */\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****               LIST MODULE ERROR BASES                   *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_MODERR_START_LIST\n  FT_MODERR_START_LIST\n#endif\n\n\n  FT_MODERRDEF( Base,      0x000, \"base module\" )\n  FT_MODERRDEF( Autofit,   0x100, \"autofitter module\" )\n  FT_MODERRDEF( BDF,       0x200, \"BDF module\" )\n  FT_MODERRDEF( Bzip2,     0x300, \"Bzip2 module\" )\n  FT_MODERRDEF( Cache,     0x400, \"cache module\" )\n  FT_MODERRDEF( CFF,       0x500, \"CFF module\" )\n  FT_MODERRDEF( CID,       0x600, \"CID module\" )\n  FT_MODERRDEF( Gzip,      0x700, \"Gzip module\" )\n  FT_MODERRDEF( LZW,       0x800, \"LZW module\" )\n  FT_MODERRDEF( OTvalid,   0x900, \"OpenType validation module\" )\n  FT_MODERRDEF( PCF,       0xA00, \"PCF module\" )\n  FT_MODERRDEF( PFR,       0xB00, \"PFR module\" )\n  FT_MODERRDEF( PSaux,     0xC00, \"PS auxiliary module\" )\n  FT_MODERRDEF( PShinter,  0xD00, \"PS hinter module\" )\n  FT_MODERRDEF( PSnames,   0xE00, \"PS names module\" )\n  FT_MODERRDEF( Raster,    0xF00, \"raster module\" )\n  FT_MODERRDEF( SFNT,     0x1000, \"SFNT module\" )\n  FT_MODERRDEF( Smooth,   0x1100, \"smooth raster module\" )\n  FT_MODERRDEF( TrueType, 0x1200, \"TrueType module\" )\n  FT_MODERRDEF( Type1,    0x1300, \"Type 1 module\" )\n  FT_MODERRDEF( Type42,   0x1400, \"Type 42 module\" )\n  FT_MODERRDEF( Winfonts, 0x1500, \"Windows FON/FNT module\" )\n  FT_MODERRDEF( GXvalid,  0x1600, \"GX validation module\" )\n\n\n#ifdef FT_MODERR_END_LIST\n  FT_MODERR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      CLEANUP                            *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_MODERR_START_LIST\n#undef FT_MODERR_END_LIST\n#undef FT_MODERRDEF\n#undef FT_NEED_EXTERN_C\n\n\n#endif /* __FTMODERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (specification).         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/*                                                                         */\n/* Warning: This module might be moved to a different library in the       */\n/*          future to avoid a tight dependency between FreeType and the    */\n/*          OpenType specification.                                        */\n/*                                                                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOTVAL_H__\n#define __FTOTVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    ot_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    OpenType Validation                                                */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate OpenType tables.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_OTXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_OpenType_Validate to\n  *    indicate which OpenType tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_BASE ::\n  *      Validate BASE table.\n  *\n  *    FT_VALIDATE_GDEF ::\n  *      Validate GDEF table.\n  *\n  *    FT_VALIDATE_GPOS ::\n  *      Validate GPOS table.\n  *\n  *    FT_VALIDATE_GSUB ::\n  *      Validate GSUB table.\n  *\n  *    FT_VALIDATE_JSTF ::\n  *      Validate JSTF table.\n  *\n  *    FT_VALIDATE_MATH ::\n  *      Validate MATH table.\n  *\n  *    FT_VALIDATE_OT ::\n  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).\n  *\n  */\n#define FT_VALIDATE_BASE  0x0100\n#define FT_VALIDATE_GDEF  0x0200\n#define FT_VALIDATE_GPOS  0x0400\n#define FT_VALIDATE_GSUB  0x0800\n#define FT_VALIDATE_JSTF  0x1000\n#define FT_VALIDATE_MATH  0x2000\n\n#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\\n                        FT_VALIDATE_GDEF | \\\n                        FT_VALIDATE_GPOS | \\\n                        FT_VALIDATE_GSUB | \\\n                        FT_VALIDATE_JSTF | \\\n                        FT_VALIDATE_MATH\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Validate\n  *\n  * @description:\n  *    Validate various OpenType tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_OTXXX for possible values.\n  *\n  * @output:\n  *    BASE_table ::\n  *       A pointer to the BASE table.\n  *\n  *    GDEF_table ::\n  *       A pointer to the GDEF table.\n  *\n  *    GPOS_table ::\n  *       A pointer to the GPOS table.\n  *\n  *    GSUB_table ::\n  *       A pointer to the GSUB table.\n  *\n  *    JSTF_table ::\n  *       A pointer to the JSTF table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with OpenType fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the five tables with\n  *   @FT_OpenType_Free.  A NULL value indicates that the table either\n  *   doesn't exist in the font, or the application hasn't asked for\n  *   validation.\n  */\n  FT_EXPORT( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table );\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Free\n  *\n  * @description:\n  *    Free the buffer allocated by OpenType validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_OpenType_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_OpenType_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftoutln.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.h                                                              */\n/*                                                                         */\n/*    Support for the FT_Outline type used to store glyph shapes of        */\n/*    most scalable font formats (specification).                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOUTLN_H__\n#define __FTOUTLN_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Outline Processing                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions to create, transform, and render vectorial glyph images. */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains routines used to create and destroy scalable */\n  /*    glyph images known as `outlines'.  These can also be measured,     */\n  /*    transformed, and converted into bitmaps and pixmaps.               */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Outline                                                         */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*    FT_Outline_New                                                     */\n  /*    FT_Outline_Done                                                    */\n  /*    FT_Outline_Copy                                                    */\n  /*    FT_Outline_Translate                                               */\n  /*    FT_Outline_Transform                                               */\n  /*    FT_Outline_Embolden                                                */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*    FT_Outline_Reverse                                                 */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /*    FT_Outline_Get_CBox                                                */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /*    FT_Outline_Decompose                                               */\n  /*    FT_Outline_Funcs                                                   */\n  /*    FT_Outline_MoveTo_Func                                             */\n  /*    FT_Outline_LineTo_Func                                             */\n  /*    FT_Outline_ConicTo_Func                                            */\n  /*    FT_Outline_CubicTo_Func                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walk over an outline's structure to decompose it into individual   */\n  /*    segments and Bézier arcs.  This function also emits `move to'      */\n  /*    operations to indicate the start of new contours in the outline.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e., function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer which is passed to each       */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_New                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new outline of a given size.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object from where the       */\n  /*                   outline is allocated.  Note however that the new    */\n  /*                   outline will *not* necessarily be *freed*, when     */\n  /*                   destroying the library, by @FT_Done_FreeType.       */\n  /*                                                                       */\n  /*    numPoints   :: The maximum number of points within the outline.    */\n  /*                   Must be smaller than or equal to 0xFFFF (65535).    */\n  /*                                                                       */\n  /*    numContours :: The maximum number of contours within the outline.  */\n  /*                   This value must be in the range 0 to `numPoints'.   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    anoutline   :: A handle to the new outline.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' parameter is simply */\n  /*    to use the library's memory allocator.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy an outline created with @FT_Outline_New.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle of the library object used to allocate the     */\n  /*               outline.                                                */\n  /*                                                                       */\n  /*    outline :: A pointer to the outline object to be discarded.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the outline's `owner' field is not set, only the outline        */\n  /*    descriptor will be released.                                       */\n  /*                                                                       */\n  /*    The reason why this function takes an `library' parameter is       */\n  /*    simply to use ft_mem_free().                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check the contents of an outline descriptor.                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A handle to a source outline.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_CBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an outline's `control box'.  The control box encloses all   */\n  /*    the outline's points, including Bézier control points.  Though it  */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox   :: The outline's control box.                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Translate                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple translation to the points of an outline.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    xOffset :: The horizontal offset.                                  */\n  /*                                                                       */\n  /*    yOffset :: The vertical offset.                                    */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Copy                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy an outline into another one.  Both objects must have the      */\n  /*    same sizes (number of points & number of contours) when this       */\n  /*    function is called.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source outline.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target outline.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Transform                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple 2x2 matrix to all of an outline's points.  Useful   */\n  /*    for applying rotations, slanting, flipping, etc.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix  :: A pointer to the transformation matrix.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can use @FT_Outline_Translate if you need to translate the     */\n  /*    outline's points.                                                  */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Embolden                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be at most 4~times      */\n  /*    `strength' pixels wider and higher.  You may think of the left and */\n  /*    bottom borders as unchanged.                                       */\n  /*                                                                       */\n  /*    Negative `strength' values to reduce the outline thickness are     */\n  /*    possible also.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline  :: A handle to the target outline.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strength :: How strong the glyph is emboldened.  Expressed in      */\n  /*                26.6 pixel format.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The used algorithm to increase or decrease the thickness of the    */\n  /*    glyph doesn't change the number of points; this means that certain */\n  /*    situations like acute angles or intersections are sometimes        */\n  /*    handled incorrectly.                                               */\n  /*                                                                       */\n  /*    If you need `better' metrics values you should call                */\n  /*    @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.                      */\n  /*                                                                       */\n  /*    Example call:                                                      */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */\n  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */\n  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be `xstrength' pixels   */\n  /*    wider and `ystrength' pixels higher.  Otherwise, it is similar to  */\n  /*    @FT_Outline_Embolden, which uses the same strength in both         */\n  /*    directions.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_EmboldenXY( FT_Outline*  outline,\n                         FT_Pos       xstrength,\n                         FT_Pos       ystrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Reverse                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reverse the drawing direction of an outline.  This is used to      */\n  /*    ensure consistent fill conventions for mirrored glyphs.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in     */\n  /*    the outline's `flags' field.                                       */\n  /*                                                                       */\n  /*    It shouldn't be used by a normal client application, unless it     */\n  /*    knows what it is doing.                                            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Reverse( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap.  The outline's image is simply  */\n  /*    OR-ed to the target bitmap.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the target bitmap descriptor.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT CREATE the bitmap, it only renders an       */\n  /*    outline image within the one you pass to it!  Consequently, the    */\n  /*    various fields in `abitmap' should be set accordingly.             */\n  /*                                                                       */\n  /*    It will use the raster corresponding to the default glyph format.  */\n  /*                                                                       */\n  /*    The value of the `num_grays' field in `abitmap' is ignored.  If    */\n  /*    you select the gray-level rasterizer, and you want less than 256   */\n  /*    gray levels, you have to use @FT_Outline_Render directly.          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap using the current scan-convert.  */\n  /*    This function uses an @FT_Raster_Params structure as an argument,  */\n  /*    allowing advanced features like direct composition, translucency,  */\n  /*    etc.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    params  :: A pointer to an @FT_Raster_Params structure used to     */\n  /*               describe the rendering operation.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should know what you are doing and how @FT_Raster_Params works */\n  /*    to use this function.                                              */\n  /*                                                                       */\n  /*    The field `params.source' will be set to `outline' before the scan */\n  /*    converter is called, which means that the value you give to it is  */\n  /*    actually ignored.                                                  */\n  /*                                                                       */\n  /*    The gray-level rasterizer always uses 256 gray levels.  If you     */\n  /*    want less gray levels, you have to provide your own span callback. */\n  /*    See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the   */\n  /*    @FT_Raster_Params structure for more details.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params );\n\n\n /**************************************************************************\n  *\n  * @enum:\n  *   FT_Orientation\n  *\n  * @description:\n  *   A list of values used to describe an outline's contour orientation.\n  *\n  *   The TrueType and PostScript specifications use different conventions\n  *   to determine whether outline contours should be filled or unfilled.\n  *\n  * @values:\n  *   FT_ORIENTATION_TRUETYPE ::\n  *     According to the TrueType specification, clockwise contours must\n  *     be filled, and counter-clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_POSTSCRIPT ::\n  *     According to the PostScript specification, counter-clockwise contours\n  *     must be filled, and clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_FILL_RIGHT ::\n  *     This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\n  *     remember that in TrueType, everything that is to the right of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_FILL_LEFT ::\n  *     This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\n  *     remember that in PostScript, everything that is to the left of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_NONE ::\n  *     The orientation cannot be determined.  That is, different parts of\n  *     the glyph have different orientation.\n  *\n  */\n  typedef enum  FT_Orientation_\n  {\n    FT_ORIENTATION_TRUETYPE   = 0,\n    FT_ORIENTATION_POSTSCRIPT = 1,\n    FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\n    FT_ORIENTATION_FILL_LEFT  = FT_ORIENTATION_POSTSCRIPT,\n    FT_ORIENTATION_NONE\n\n  } FT_Orientation;\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Outline_Get_Orientation\n  *\n  * @description:\n  *   This function analyzes a glyph outline and tries to compute its\n  *   fill orientation (see @FT_Orientation).  This is done by computing\n  *   the direction of each global horizontal and/or vertical extrema\n  *   within the outline.\n  *\n  *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty\n  *   outlines.\n  *\n  * @input:\n  *   outline ::\n  *     A handle to the source outline.\n  *\n  * @return:\n  *   The orientation.\n  *\n  */\n  FT_EXPORT( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOUTLN_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (specification only).   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2008, 2009 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTPFR_H__\n#define __FTPFR_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    pfr_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    PFR Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    PFR/TrueDoc specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of PFR-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Metrics\n  *\n  * @description:\n  *    Return the outline and metrics resolutions of a given PFR face.\n  *\n  * @input:\n  *    face :: Handle to the input face.  It can be a non-PFR face.\n  *\n  * @output:\n  *    aoutline_resolution ::\n  *      Outline resolution.  This is equivalent to `face->units_per_EM'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_resolution ::\n  *      Metrics resolution.  This is equivalent to `outline_resolution'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_x_scale ::\n  *      A 16.16 fixed-point number used to scale distance expressed\n  *      in metrics units to device sub-pixels.  This is equivalent to\n  *      `face->size->x_scale', but for metrics only.  Optional (parameter\n  *      can be NULL).\n  *\n  *    ametrics_y_scale ::\n  *      Same as `ametrics_x_scale' but for the vertical direction.\n  *      optional (parameter can be NULL).\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If the input face is not a PFR, this function will return an error.\n  *   However, in all cases, it will return valid values.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Kerning\n  *\n  * @description:\n  *    Return the kerning pair corresponding to two glyphs in a PFR face.\n  *    The distance is expressed in metrics units, unlike the result of\n  *    @FT_Get_Kerning.\n  *\n  * @input:\n  *    face  :: A handle to the input face.\n  *\n  *    left  :: Index of the left glyph.\n  *\n  *    right :: Index of the right glyph.\n  *\n  * @output:\n  *    avector :: A kerning vector.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    This function always return distances in original PFR metrics\n  *    units.  This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED\n  *    mode, which always returns distances converted to outline units.\n  *\n  *    You can use the value of the `x_scale' and `y_scale' parameters\n  *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Advance\n  *\n  * @description:\n  *    Return a given glyph advance, expressed in original metrics units,\n  *    from a PFR font.\n  *\n  * @input:\n  *    face   :: A handle to the input face.\n  *\n  *    gindex :: The glyph index.\n  *\n  * @output:\n  *    aadvance :: The glyph advance in metrics units.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics\n  *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftrender.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrender.h                                                             */\n/*                                                                         */\n/*    FreeType renderer modules public interface (specification).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2005, 2006, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRENDER_H__\n#define __FTRENDER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph object */\n  typedef FT_Error\n  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,\n                        FT_GlyphSlot  slot );\n\n  /* destroys a given glyph object */\n  typedef void\n  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );\n\n  typedef void\n  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,\n                             const FT_Matrix*  matrix,\n                             const FT_Vector*  delta );\n\n  typedef void\n  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,\n                           FT_BBox*  abbox );\n\n  typedef FT_Error\n  (*FT_Glyph_CopyFunc)( FT_Glyph   source,\n                        FT_Glyph   target );\n\n  typedef FT_Error\n  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,\n                           FT_GlyphSlot  slot );\n\n/* deprecated */\n#define FT_Glyph_Init_Func       FT_Glyph_InitFunc\n#define FT_Glyph_Done_Func       FT_Glyph_DoneFunc\n#define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc\n#define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc\n#define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc\n#define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc\n\n\n  struct  FT_Glyph_Class_\n  {\n    FT_Long                 glyph_size;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_InitFunc       glyph_init;\n    FT_Glyph_DoneFunc       glyph_done;\n    FT_Glyph_CopyFunc       glyph_copy;\n    FT_Glyph_TransformFunc  glyph_transform;\n    FT_Glyph_GetBBoxFunc    glyph_bbox;\n    FT_Glyph_PrepareFunc    glyph_prepare;\n  };\n\n\n  typedef FT_Error\n  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,\n                             FT_GlyphSlot      slot,\n                             FT_UInt           mode,\n                             const FT_Vector*  origin );\n\n  typedef FT_Error\n  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,\n                                FT_GlyphSlot      slot,\n                                const FT_Matrix*  matrix,\n                                const FT_Vector*  delta );\n\n\n  typedef void\n  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,\n                              FT_GlyphSlot  slot,\n                              FT_BBox*      cbox );\n\n\n  typedef FT_Error\n  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,\n                              FT_ULong     mode_tag,\n                              FT_Pointer   mode_ptr );\n\n/* deprecated identifiers */\n#define FTRenderer_render  FT_Renderer_RenderFunc\n#define FTRenderer_transform  FT_Renderer_TransformFunc\n#define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc\n#define FTRenderer_setMode  FT_Renderer_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The renderer module class descriptor.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root            :: The root @FT_Module_Class fields.               */\n  /*                                                                       */\n  /*    glyph_format    :: The glyph image format this renderer handles.   */\n  /*                                                                       */\n  /*    render_glyph    :: A method used to render the image that is in a  */\n  /*                       given glyph slot into a bitmap.                 */\n  /*                                                                       */\n  /*    transform_glyph :: A method used to transform the image that is in */\n  /*                       a given glyph slot.                             */\n  /*                                                                       */\n  /*    get_glyph_cbox  :: A method used to access the glyph's cbox.       */\n  /*                                                                       */\n  /*    set_mode        :: A method used to pass additional parameters.    */\n  /*                                                                       */\n  /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */\n  /*                       This is a pointer to its raster's class.        */\n  /*                                                                       */\n  typedef struct  FT_Renderer_Class_\n  {\n    FT_Module_Class            root;\n\n    FT_Glyph_Format            glyph_format;\n\n    FT_Renderer_RenderFunc     render_glyph;\n    FT_Renderer_TransformFunc  transform_glyph;\n    FT_Renderer_GetCBoxFunc    get_glyph_cbox;\n    FT_Renderer_SetModeFunc    set_mode;\n\n    FT_Raster_Funcs*           raster_class;\n\n  } FT_Renderer_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the current renderer for a given glyph format.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /*    format  :: The glyph format.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A renderer handle.  0~if none found.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */\n  /*    renderer by its name, use @FT_Get_Module.                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the current renderer to use, and set additional mode.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    renderer   :: A handle to the renderer object.                     */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    parameters :: Additional parameters.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case of success, the renderer will be used to convert glyph     */\n  /*    images in the renderer's known format into bitmaps.                */\n  /*                                                                       */\n  /*    This doesn't change the current renderer for other formats.        */\n  /*                                                                       */\n  /*    Currently, only the B/W renderer, if compiled with                 */\n  /*    FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels               */\n  /*    anti-aliasing mode; this option must be set directly in            */\n  /*    `ftraster.c' and is undefined by default) accepts a single tag     */\n  /*    `pal5' to set its gray palette as a character string with          */\n  /*    5~elements.  Consequently, the third and fourth argument are zero  */\n  /*    normally.                                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTRENDER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftsizes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsizes.h                                                              */\n/*                                                                         */\n/*    FreeType size objects management (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Typical application would normally not need to use these functions.   */\n  /* However, they have been placed in a public API for the rare cases     */\n  /* where they are needed.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSIZES_H__\n#define __FTSIZES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sizes_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Size Management                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Managing multiple sizes per face.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    When creating a new face object (e.g., with @FT_New_Face), an      */\n  /*    @FT_Size object is automatically created and used to store all     */\n  /*    pixel-size dependent information, available in the `face->size'    */\n  /*    field.                                                             */\n  /*                                                                       */\n  /*    It is however possible to create more sizes for a given face,      */\n  /*    mostly in order to manage several character pixel sizes of the     */\n  /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */\n  /*                                                                       */\n  /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */\n  /*    modify the contents of the current `active' size; you thus need    */\n  /*    to use @FT_Activate_Size to change it.                             */\n  /*                                                                       */\n  /*    99% of applications won't need the functions provided here,        */\n  /*    especially if they use the caching sub-system, so be cautious      */\n  /*    when using these.                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Size                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new size object from a given face object.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a parent face object.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize :: A handle to a new size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You need to call @FT_Activate_Size in order to select the new size */\n  /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */\n  /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size*  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Size                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given size object.  Note that @FT_Done_Face              */\n  /*    automatically discards all size objects allocated with             */\n  /*    @FT_New_Size.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Size( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Activate_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Even though it is possible to create several size objects for a    */\n  /*    given face (see @FT_New_Size for details), functions like          */\n  /*    @FT_Load_Glyph or @FT_Load_Char only use the one which has been    */\n  /*    activated last to determine the `current character pixel size'.    */\n  /*                                                                       */\n  /*    This function can be used to `activate' a previously created size  */\n  /*    object.                                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `face' is the size's parent face object, this function changes  */\n  /*    the value of `face->size' to the input size handle.                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Activate_Size( FT_Size  size );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSIZES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftsnames.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.h                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (specification).  */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_SFNT_NAMES_H__\n#define __FT_SFNT_NAMES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sfnt_names                                                         */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    SFNT Names                                                         */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Access the names embedded in TrueType and OpenType files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType and OpenType specifications allow the inclusion of    */\n  /*    a special `names table' in font files.  This table contains        */\n  /*    textual (and internationalized) information regarding the font,    */\n  /*    like family name, copyright, version, etc.                         */\n  /*                                                                       */\n  /*    The definitions below are used to access them if available.        */\n  /*                                                                       */\n  /*    Note that this has nothing to do with glyph names!                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SfntName                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model an SFNT `name' table entry.              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platform_id :: The platform ID for `string'.                       */\n  /*                                                                       */\n  /*    encoding_id :: The encoding ID for `string'.                       */\n  /*                                                                       */\n  /*    language_id :: The language ID for `string'.                       */\n  /*                                                                       */\n  /*    name_id     :: An identifier for `string'.                         */\n  /*                                                                       */\n  /*    string      :: The `name' string.  Note that its format differs    */\n  /*                   depending on the (platform,encoding) pair.  It can  */\n  /*                   be a Pascal String, a UTF-16 one, etc.              */\n  /*                                                                       */\n  /*                   Generally speaking, the string is not               */\n  /*                   zero-terminated.  Please refer to the TrueType      */\n  /*                   specification for details.                          */\n  /*                                                                       */\n  /*    string_len  :: The length of `string' in bytes.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Possible values for `platform_id', `encoding_id', `language_id',   */\n  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */\n  /*    please refer to the TrueType or OpenType specification.            */\n  /*                                                                       */\n  /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */\n  /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */\n  /*                                                                       */\n  typedef struct  FT_SfntName_\n  {\n    FT_UShort  platform_id;\n    FT_UShort  encoding_id;\n    FT_UShort  language_id;\n    FT_UShort  name_id;\n\n    FT_Byte*   string;      /* this string is *not* null-terminated! */\n    FT_UInt    string_len;  /* in bytes */\n\n  } FT_SfntName;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name_Count                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the number of name strings in the SFNT `name' table.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of strings in the `name' table.                         */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a string of the SFNT `name' table for a given index.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to the source face.                              */\n  /*                                                                       */\n  /*    idx   :: The index of the `name' string.                           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aname :: The indexed @FT_SfntName structure.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `string' array returned in the `aname' structure is not        */\n  /*    null-terminated.  The application should deallocate it if it is no */\n  /*    longer in use.                                                     */\n  /*                                                                       */\n  /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */\n  /*    `name' table entries, then do a loop until you get the right       */\n  /*    platform, encoding, and name ID.                                   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname );\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred family subfamily names in `name'\n   *   table since OpenType version 1.4.  For backwards compatibility with\n   *   legacy systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred subfamily names in `name' table since\n   *   OpenType version 1.4.  For backwards compatibility with legacy\n   *   systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_SFNT_NAMES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftstroke.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.h                                                             */\n/*                                                                         */\n/*    FreeType path stroker (specification).                               */\n/*                                                                         */\n/*  Copyright 2002-2006, 2008, 2009, 2011-2012 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_STROKE_H__\n#define __FT_STROKE_H__\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n /************************************************************************\n  *\n  * @section:\n  *    glyph_stroker\n  *\n  * @title:\n  *    Glyph Stroker\n  *\n  * @abstract:\n  *    Generating bordered and stroked glyphs.\n  *\n  * @description:\n  *    This component generates stroked outlines of a given vectorial\n  *    glyph.  It also allows you to retrieve the `outside' and/or the\n  *    `inside' borders of the stroke.\n  *\n  *    This can be useful to generate `bordered' glyph, i.e., glyphs\n  *    displayed with a coloured (and anti-aliased) border around their\n  *    shape.\n  */\n\n\n /**************************************************************\n  *\n  * @type:\n  *   FT_Stroker\n  *\n  * @description:\n  *   Opaque handler to a path stroker object.\n  */\n  typedef struct FT_StrokerRec_*  FT_Stroker;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineJoin\n   *\n   * @description:\n   *   These values determine how two joining lines are rendered\n   *   in a stroker.\n   *\n   * @values:\n   *   FT_STROKER_LINEJOIN_ROUND ::\n   *     Used to render rounded line joins.  Circular arcs are used\n   *     to join two lines smoothly.\n   *\n   *   FT_STROKER_LINEJOIN_BEVEL ::\n   *     Used to render beveled line joins.  The outer corner of\n   *     the joined lines is filled by enclosing the triangular\n   *     region of the corner with a straight line between the\n   *     outer corners of each stroke.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_FIXED ::\n   *     Used to render mitered line joins, with fixed bevels if the\n   *     miter limit is exceeded.  The outer edges of the strokes\n   *     for the two segments are extended until they meet at an\n   *     angle.  If the segments meet at too sharp an angle (such\n   *     that the miter would extend from the intersection of the\n   *     segments a distance greater than the product of the miter\n   *     limit value and the border radius), then a bevel join (see\n   *     above) is used instead.  This prevents long spikes being\n   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter\n   *     line join as used in PostScript and PDF.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::\n   *   FT_STROKER_LINEJOIN_MITER ::\n   *     Used to render mitered line joins, with variable bevels if\n   *     the miter limit is exceeded.  The intersection of the\n   *     strokes is clipped at a line perpendicular to the bisector\n   *     of the angle between the strokes, at the distance from the\n   *     intersection of the segments equal to the product of the\n   *     miter limit value and the border radius.  This prevents\n   *     long spikes being created.\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line\n   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias\n   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for\n   *     backwards compatibility.\n   */\n  typedef enum  FT_Stroker_LineJoin_\n  {\n    FT_STROKER_LINEJOIN_ROUND          = 0,\n    FT_STROKER_LINEJOIN_BEVEL          = 1,\n    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,\n    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,\n    FT_STROKER_LINEJOIN_MITER_FIXED    = 3\n\n  } FT_Stroker_LineJoin;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineCap\n   *\n   * @description:\n   *   These values determine how the end of opened sub-paths are\n   *   rendered in a stroke.\n   *\n   * @values:\n   *   FT_STROKER_LINECAP_BUTT ::\n   *     The end of lines is rendered as a full stop on the last\n   *     point itself.\n   *\n   *   FT_STROKER_LINECAP_ROUND ::\n   *     The end of lines is rendered as a half-circle around the\n   *     last point.\n   *\n   *   FT_STROKER_LINECAP_SQUARE ::\n   *     The end of lines is rendered as a square around the\n   *     last point.\n   */\n  typedef enum  FT_Stroker_LineCap_\n  {\n    FT_STROKER_LINECAP_BUTT = 0,\n    FT_STROKER_LINECAP_ROUND,\n    FT_STROKER_LINECAP_SQUARE\n\n  } FT_Stroker_LineCap;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_StrokerBorder\n   *\n   * @description:\n   *   These values are used to select a given stroke border\n   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.\n   *\n   * @values:\n   *   FT_STROKER_BORDER_LEFT ::\n   *     Select the left border, relative to the drawing direction.\n   *\n   *   FT_STROKER_BORDER_RIGHT ::\n   *     Select the right border, relative to the drawing direction.\n   *\n   * @note:\n   *   Applications are generally interested in the `inside' and `outside'\n   *   borders.  However, there is no direct mapping between these and the\n   *   `left' and `right' ones, since this really depends on the glyph's\n   *   drawing orientation, which varies between font formats.\n   *\n   *   You can however use @FT_Outline_GetInsideBorder and\n   *   @FT_Outline_GetOutsideBorder to get these.\n   */\n  typedef enum  FT_StrokerBorder_\n  {\n    FT_STROKER_BORDER_LEFT = 0,\n    FT_STROKER_BORDER_RIGHT\n\n  } FT_StrokerBorder;\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetInsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `inside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetOutsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `outside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_New\n   *\n   * @description:\n   *   Create a new stroker object.\n   *\n   * @input:\n   *   library ::\n   *     FreeType library handle.\n   *\n   * @output:\n   *   astroker ::\n   *     A new stroker object handle.  NULL in case of error.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Set\n   *\n   * @description:\n   *   Reset a stroker object's attributes.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   radius ::\n   *     The border radius.\n   *\n   *   line_cap ::\n   *     The line cap style.\n   *\n   *   line_join ::\n   *     The line join style.\n   *\n   *   miter_limit ::\n   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,\n   *     expressed as 16.16 fixed-point value.\n   *\n   * @note:\n   *   The radius is expressed in the same units as the outline\n   *   coordinates.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Rewind\n   *\n   * @description:\n   *   Reset a stroker object without changing its attributes.\n   *   You should call this function before beginning a new\n   *   series of calls to @FT_Stroker_BeginSubPath or\n   *   @FT_Stroker_EndSubPath.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ParseOutline\n   *\n   * @description:\n   *   A convenience function used to parse a whole outline with\n   *   the stroker.  The resulting outline(s) can be retrieved\n   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The source outline.\n   *\n   *   opened ::\n   *     A boolean.  If~1, the outline is treated as an open path instead\n   *     of a closed one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If `opened' is~0 (the default), the outline is treated as a closed\n   *   path, and the stroker generates two distinct `border' outlines.\n   *\n   *   If `opened' is~1, the outline is processed as an open path, and the\n   *   stroker generates a single `stroke' outline.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_BeginSubPath\n   *\n   * @description:\n   *   Start a new sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the start vector.\n   *\n   *   open ::\n   *     A boolean.  If~1, the sub-path is treated as an open one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function is useful when you need to stroke a path that is\n   *   not stored as an @FT_Outline object.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_EndSubPath\n   *\n   * @description:\n   *   Close the current sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function after @FT_Stroker_BeginSubPath.\n   *   If the subpath was not `opened', this function `draws' a\n   *   single line segment to the start position when needed.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_LineTo\n   *\n   * @description:\n   *   `Draw' a single line segment in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ConicTo\n   *\n   * @description:\n   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control ::\n   *     A pointer to a Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_CubicTo\n   *\n   * @description:\n   *   `Draw' a single cubic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control1 ::\n   *     A pointer to the first Bézier control point.\n   *\n   *   control2 ::\n   *     A pointer to second Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetBorderCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export one of the `border' or `stroke'\n   *   outlines generated by the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_GetCounts instead if you want to\n   *   retrieve the counts associated to both borders.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ExportBorder\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the corresponding border to your own @FT_Outline\n   *   structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   *   outline ::\n   *     The target outline handle.\n   *\n   * @note:\n   *   Always call this function after @FT_Stroker_GetBorderCounts to\n   *   get sure that there is enough room in your @FT_Outline object to\n   *   receive all new data.\n   *\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps. The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_Export instead if you want to\n   *   retrieve all borders at once.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export all points/borders from the stroked\n   *   outline/path.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Export\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export all borders to your own @FT_Outline structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The target outline handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Done\n   *\n   * @description:\n   *   Destroy a stroker object.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.  Can be NULL.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Done( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_Stroke\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_StrokeBorder\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker, but\n   *   only return either its inside or outside border.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   inside ::\n   *     A Boolean.  If~1, return the inside border, otherwise\n   *     the outside border.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FT_STROKE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftsynth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.h                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting              */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2006, 2008, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********        WARNING, THIS IS ALPHA CODE!  THIS API         *********/\n  /*********    IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE    *********/\n  /*********            FREETYPE DEVELOPMENT TEAM                  *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Main reason for not lifting the functions in this module to a  */\n  /* `standard' API is that the used parameters for emboldening and */\n  /* slanting are not configurable.  Consider the functions as a    */\n  /* code resource which should be copied into the application and  */\n  /* adapted to the particular needs.                               */\n\n\n#ifndef __FTSYNTH_H__\n#define __FTSYNTH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /* Embolden a glyph by a `reasonable' value (which is highly a matter of */\n  /* taste).  This function is actually a convenience function, providing  */\n  /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */\n  /*                                                                       */\n  /* For emboldened outlines the height, width, and advance metrics are    */\n  /* increased by the strength of the emboldening.  You can also call      */\n  /* @FT_Outline_Get_CBox to get precise values.                           */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );\n\n  /* Slant an outline glyph to the right by about 12 degrees. */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTSYNTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftsystem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.h                                                             */\n/*                                                                         */\n/*    FreeType low-level system interface definition (specification).      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSYSTEM_H__\n#define __FTSYSTEM_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   system_interface                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   System Interface                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   How FreeType manages memory and i/o.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This section contains various definitions related to memory         */\n  /*   management and i/o access.  You need to understand this             */\n  /*   information if you want to use a custom memory manager or you own   */\n  /*   i/o streams.                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  M E M O R Y   M A N A G E M E N T                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Memory\n   *\n   * @description:\n   *   A handle to a given memory manager object, defined with an\n   *   @FT_MemoryRec structure.\n   *\n   */\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Alloc_Func\n   *\n   * @description:\n   *   A function used to allocate `size' bytes from `memory'.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   size ::\n   *     The size in bytes to allocate.\n   *\n   * @return:\n   *   Address of new memory block.  0~in case of failure.\n   *\n   */\n  typedef void*\n  (*FT_Alloc_Func)( FT_Memory  memory,\n                    long       size );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Free_Func\n   *\n   * @description:\n   *   A function used to release a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   block ::\n   *     The address of the target memory block.\n   *\n   */\n  typedef void\n  (*FT_Free_Func)( FT_Memory  memory,\n                   void*      block );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Realloc_Func\n   *\n   * @description:\n   *   A function used to re-allocate a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   cur_size ::\n   *     The block's current size in bytes.\n   *\n   *   new_size ::\n   *     The block's requested new size.\n   *\n   *   block ::\n   *     The block's current address.\n   *\n   * @return:\n   *   New block address.  0~in case of memory shortage.\n   *\n   * @note:\n   *   In case of error, the old block must still be available.\n   *\n   */\n  typedef void*\n  (*FT_Realloc_Func)( FT_Memory  memory,\n                      long       cur_size,\n                      long       new_size,\n                      void*      block );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_MemoryRec\n   *\n   * @description:\n   *   A structure used to describe a given memory manager to FreeType~2.\n   *\n   * @fields:\n   *   user ::\n   *     A generic typeless pointer for user data.\n   *\n   *   alloc ::\n   *     A pointer type to an allocation function.\n   *\n   *   free ::\n   *     A pointer type to an memory freeing function.\n   *\n   *   realloc ::\n   *     A pointer type to a reallocation function.\n   *\n   */\n  struct  FT_MemoryRec_\n  {\n    void*            user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       I / O   M A N A G E M E N T                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Stream\n   *\n   * @description:\n   *   A handle to an input stream.\n   *\n   */\n  typedef struct FT_StreamRec_*  FT_Stream;\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamDesc\n   *\n   * @description:\n   *   A union type used to store either a long or a pointer.  This is used\n   *   to store a file descriptor or a `FILE*' in an input stream.\n   *\n   */\n  typedef union  FT_StreamDesc_\n  {\n    long   value;\n    void*  pointer;\n\n  } FT_StreamDesc;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_IoFunc\n   *\n   * @description:\n   *   A function used to seek and read data from a given input stream.\n   *\n   * @input:\n   *   stream ::\n   *     A handle to the source stream.\n   *\n   *   offset ::\n   *     The offset of read in stream (always from start).\n   *\n   *   buffer ::\n   *     The address of the read buffer.\n   *\n   *   count ::\n   *     The number of bytes to read from the stream.\n   *\n   * @return:\n   *   The number of bytes effectively read by the stream.\n   *\n   * @note:\n   *   This function might be called to perform a seek or skip operation\n   *   with a `count' of~0.  A non-zero return value then indicates an\n   *   error.\n   *\n   */\n  typedef unsigned long\n  (*FT_Stream_IoFunc)( FT_Stream       stream,\n                       unsigned long   offset,\n                       unsigned char*  buffer,\n                       unsigned long   count );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_CloseFunc\n   *\n   * @description:\n   *   A function used to close a given input stream.\n   *\n   * @input:\n   *  stream ::\n   *     A handle to the target stream.\n   *\n   */\n  typedef void\n  (*FT_Stream_CloseFunc)( FT_Stream  stream );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamRec\n   *\n   * @description:\n   *   A structure used to describe an input stream.\n   *\n   * @input:\n   *   base ::\n   *     For memory-based streams, this is the address of the first stream\n   *     byte in memory.  This field should always be set to NULL for\n   *     disk-based streams.\n   *\n   *   size ::\n   *     The stream size in bytes.\n   *\n   *   pos ::\n   *     The current position within the stream.\n   *\n   *   descriptor ::\n   *     This field is a union that can hold an integer or a pointer.  It is\n   *     used by stream implementations to store file descriptors or `FILE*'\n   *     pointers.\n   *\n   *   pathname ::\n   *     This field is completely ignored by FreeType.  However, it is often\n   *     useful during debugging to use it to store the stream's filename\n   *     (where available).\n   *\n   *   read ::\n   *     The stream's input function.\n   *\n   *   close ::\n   *     The stream's close function.\n   *\n   *   memory ::\n   *     The memory manager to use to preload frames.  This is set\n   *     internally by FreeType and shouldn't be touched by stream\n   *     implementations.\n   *\n   *   cursor ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   *   limit ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   */\n  typedef struct  FT_StreamRec_\n  {\n    unsigned char*       base;\n    unsigned long        size;\n    unsigned long        pos;\n\n    FT_StreamDesc        descriptor;\n    FT_StreamDesc        pathname;\n    FT_Stream_IoFunc     read;\n    FT_Stream_CloseFunc  close;\n\n    FT_Memory            memory;\n    unsigned char*       cursor;\n    unsigned char*       limit;\n\n  } FT_StreamRec;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSYSTEM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/fttrigon.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.h                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (specification).                    */\n/*                                                                         */\n/*  Copyright 2001, 2003, 2005, 2007, 2013 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTRIGON_H__\n#define __FTTRIGON_H__\n\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   computations                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Angle\n   *\n   * @description:\n   *   This type is used to model angle values in FreeType.  Note that the\n   *   angle is a 16.16 fixed-point value expressed in degrees.\n   *\n   */\n  typedef FT_Fixed  FT_Angle;\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI\n   *\n   * @description:\n   *   The angle pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI  ( 180L << 16 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_2PI\n   *\n   * @description:\n   *   The angle 2*pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI2\n   *\n   * @description:\n   *   The angle pi/2 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI4\n   *\n   * @description:\n   *   The angle pi/4 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Sin\n   *\n   * @description:\n   *   Return the sinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The sinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Sin( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Cos\n   *\n   * @description:\n   *   Return the cosinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The cosinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Cos( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Tan\n   *\n   * @description:\n   *   Return the tangent of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The tangent value.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Tan( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Atan2\n   *\n   * @description:\n   *   Return the arc-tangent corresponding to a given vector (x,y) in\n   *   the 2d plane.\n   *\n   * @input:\n   *   x ::\n   *     The horizontal vector coordinate.\n   *\n   *   y ::\n   *     The vertical vector coordinate.\n   *\n   * @return:\n   *   The arc-tangent value (i.e. angle).\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Atan2( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Angle_Diff\n   *\n   * @description:\n   *   Return the difference between two angles.  The result is always\n   *   constrained to the ]-PI..PI] interval.\n   *\n   * @input:\n   *   angle1 ::\n   *     First angle.\n   *\n   *   angle2 ::\n   *     Second angle.\n   *\n   * @return:\n   *   Constrained value of `value2-value1'.\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Unit\n   *\n   * @description:\n   *   Return the unit vector corresponding to a given angle.  After the\n   *   call, the value of `vec.x' will be `sin(angle)', and the value of\n   *   `vec.y' will be `cos(angle)'.\n   *\n   *   This function is useful to retrieve both the sinus and cosinus of a\n   *   given angle quickly.\n   *\n   * @output:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Rotate\n   *\n   * @description:\n   *   Rotate a vector by a given angle.\n   *\n   * @inout:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Length\n   *\n   * @description:\n   *   Return the length of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @return:\n   *   The vector length, expressed in the same units that the original\n   *   vector coordinates.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Polarize\n   *\n   * @description:\n   *   Compute both the length and angle of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @output:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_From_Polar\n   *\n   * @description:\n   *   Compute vector coordinates from a length and angle.\n   *\n   * @output:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @input:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTTRIGON_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftttdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftttdrv.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the TrueType driver                     */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTTDRV_H__\n#define __FTTTDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   tt_driver\n   *\n   * @title:\n   *   The TrueType driver\n   *\n   * @abstract:\n   *   Controlling the TrueType driver module.\n   *\n   * @description:\n   *   While FreeType's TrueType driver doesn't expose API functions by\n   *   itself, it is possible to control its behaviour with @FT_Property_Set\n   *   and @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The TrueType driver's module name is `truetype'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   interpreter-version\n   *\n   * @description:\n   *   Currently, two versions are available which represent the bytecode\n   *   interpreter with and without subpixel hinting support,\n   *   respectively.  The default is subpixel support if\n   *   TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel\n   *   support otherwise (since it isn't available then).\n   *\n   *   If subpixel hinting is on, many TrueType bytecode instructions\n   *   behave differently compared to B/W or grayscale rendering.  The\n   *   main idea is to render at a much increased horizontal resolution,\n   *   then sampling down the created output to subpixel precision.\n   *   However, many older fonts are not suited to this and must be\n   *   specially taken care of by applying (hardcoded) font-specific\n   *   tweaks.\n   *\n   *   Details on subpixel hinting and some of the necessary tweaks can be\n   *   found in Greg Hitchcock's whitepaper at\n   *   `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.\n   *\n   *   The following example code demonstrates how to activate subpixel\n   *   hinting (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_38;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"truetype\",\n   *                               \"interpreter-version\",\n   *                               &interpreter_version );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   TT_INTERPRETER_VERSION_XXX\n   *\n   * @description:\n   *   A list of constants used for the @interpreter-version property to\n   *   select the hinting engine for Truetype fonts.\n   *\n   *   The numeric value in the constant names represents the version\n   *   number as returned by the `GETINFO' bytecode instruction.\n   *\n   * @values:\n   *   TT_INTERPRETER_VERSION_35 ::\n   *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in\n   *     Windows~98; only grayscale and B/W rasterizing is supported.\n   *\n   *   TT_INTERPRETER_VERSION_38 ::\n   *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly\n   *     equivalent to the hinting provided by DirectWrite ClearType (as\n   *     can be found, for example, in the Internet Explorer~9 running on\n   *     Windows~7).\n   *\n   * @note:\n   *   This property controls the behaviour of the bytecode interpreter\n   *   and thus how outlines get hinted.  It does *not* control how glyph\n   *   get rasterized!  In particular, it does not control subpixel color\n   *   filtering.\n   *\n   *   If FreeType has not been compiled with configuration option\n   *   FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an\n   *   `FT_Err_Unimplemented_Feature' error.\n   *\n   */\n#define TT_INTERPRETER_VERSION_35  35\n#define TT_INTERPRETER_VERSION_38  38\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTTTDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/fttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttypes.h                                                              */\n/*                                                                         */\n/*    FreeType simple types definitions (specification only).              */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTYPES_H__\n#define __FTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_SYSTEM_H\n#include FT_IMAGE_H\n\n#include <stddef.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Basic Data Types                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The basic data types defined by the library.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the basic data types defined by FreeType~2,  */\n  /*    ranging from simple scalar types to bitmap descriptors.  More      */\n  /*    font-specific structures are defined in a different section.       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Byte                                                            */\n  /*    FT_Bytes                                                           */\n  /*    FT_Char                                                            */\n  /*    FT_Int                                                             */\n  /*    FT_UInt                                                            */\n  /*    FT_Int16                                                           */\n  /*    FT_UInt16                                                          */\n  /*    FT_Int32                                                           */\n  /*    FT_UInt32                                                          */\n  /*    FT_Short                                                           */\n  /*    FT_UShort                                                          */\n  /*    FT_Long                                                            */\n  /*    FT_ULong                                                           */\n  /*    FT_Bool                                                            */\n  /*    FT_Offset                                                          */\n  /*    FT_PtrDist                                                         */\n  /*    FT_String                                                          */\n  /*    FT_Tag                                                             */\n  /*    FT_Error                                                           */\n  /*    FT_Fixed                                                           */\n  /*    FT_Pointer                                                         */\n  /*    FT_Pos                                                             */\n  /*    FT_Vector                                                          */\n  /*    FT_BBox                                                            */\n  /*    FT_Matrix                                                          */\n  /*    FT_FWord                                                           */\n  /*    FT_UFWord                                                          */\n  /*    FT_F2Dot14                                                         */\n  /*    FT_UnitVector                                                      */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /*                                                                       */\n  /*    FT_Generic                                                         */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /*    FT_Bitmap                                                          */\n  /*    FT_Pixel_Mode                                                      */\n  /*    FT_Palette_Mode                                                    */\n  /*    FT_Glyph_Format                                                    */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bool                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef of unsigned char, used for simple booleans.  As usual,   */\n  /*    values 1 and~0 represent true and false, respectively.             */\n  /*                                                                       */\n  typedef unsigned char  FT_Bool;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_FWord                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 16-bit integer used to store a distance in original font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  typedef signed short  FT_FWord;   /* distance in FUnits */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UFWord                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An unsigned 16-bit integer used to store a distance in original    */\n  /*    font units.                                                        */\n  /*                                                                       */\n  typedef unsigned short  FT_UFWord;  /* unsigned distance */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Char                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _signed_ char type.                       */\n  /*                                                                       */\n  typedef signed char  FT_Char;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Byte                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _unsigned_ char type.                     */\n  /*                                                                       */\n  typedef unsigned char  FT_Byte;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bytes                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for constant memory areas.                               */\n  /*                                                                       */\n  typedef const FT_Byte*  FT_Bytes;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Tag                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for 32-bit tags (as used in the SFNT format).            */\n  /*                                                                       */\n  typedef FT_UInt32  FT_Tag;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_String                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the char type, usually used for strings.      */\n  /*                                                                       */\n  typedef char  FT_String;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Short                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed short.                                        */\n  /*                                                                       */\n  typedef signed short  FT_Short;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UShort                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned short.                                      */\n  /*                                                                       */\n  typedef unsigned short  FT_UShort;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the int type.                                        */\n  /*                                                                       */\n  typedef signed int  FT_Int;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the unsigned int type.                               */\n  /*                                                                       */\n  typedef unsigned int  FT_UInt;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Long                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed long.                                         */\n  /*                                                                       */\n  typedef signed long  FT_Long;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ULong                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned long.                                       */\n  /*                                                                       */\n  typedef unsigned long  FT_ULong;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F2Dot14                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 2.14 fixed-point type used for unit vectors.              */\n  /*                                                                       */\n  typedef signed short  FT_F2Dot14;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 26.6 fixed-point type used for vectorial pixel            */\n  /*    coordinates.                                                       */\n  /*                                                                       */\n  typedef signed long  FT_F26Dot6;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Fixed                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is used to store 16.16 fixed-point values, like scaling  */\n  /*    values or matrix coefficients.                                     */\n  /*                                                                       */\n  typedef signed long  FT_Fixed;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Error                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType error code type.  A value of~0 is always interpreted  */\n  /*    as a successful operation.                                         */\n  /*                                                                       */\n  typedef int  FT_Error;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pointer                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for a typeless pointer.                           */\n  /*                                                                       */\n  typedef void*  FT_Pointer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Offset                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `size_t' type, i.e., the largest  */\n  /*    _unsigned_ integer type used to express a file size or position,   */\n  /*    or a memory block size.                                            */\n  /*                                                                       */\n  typedef size_t  FT_Offset;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_PtrDist                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the       */\n  /*    largest _signed_ integer type used to express the distance         */\n  /*    between two pointers.                                              */\n  /*                                                                       */\n  typedef ft_ptrdiff_t  FT_PtrDist;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_UnitVector                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector unit vector.  Uses    */\n  /*    FT_F2Dot14 types.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: Horizontal coordinate.                                        */\n  /*                                                                       */\n  /*    y :: Vertical coordinate.                                          */\n  /*                                                                       */\n  typedef struct  FT_UnitVector_\n  {\n    FT_F2Dot14  x;\n    FT_F2Dot14  y;\n\n  } FT_UnitVector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Matrix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */\n  /*    in 16.16 fixed-point format.  The computation performed is:        */\n  /*                                                                       */\n  /*       {                                                               */\n  /*          x' = x*xx + y*xy                                             */\n  /*          y' = x*yx + y*yy                                             */\n  /*       }                                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    xy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  typedef struct  FT_Matrix_\n  {\n    FT_Fixed  xx, xy;\n    FT_Fixed  yx, yy;\n\n  } FT_Matrix;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read-only binary data represented as a pointer and a length.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    pointer :: The data.                                               */\n  /*                                                                       */\n  /*    length  :: The length of the data in bytes.                        */\n  /*                                                                       */\n  typedef struct  FT_Data_\n  {\n    const FT_Byte*  pointer;\n    FT_Int          length;\n\n  } FT_Data;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Describe a function used to destroy the `client' data of any       */\n  /*    FreeType object.  See the description of the @FT_Generic type for  */\n  /*    details of usage.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The address of the FreeType object which is under finalization.    */\n  /*    Its client data is accessed through its `generic' field.           */\n  /*                                                                       */\n  typedef void  (*FT_Generic_Finalizer)(void*  object);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Generic                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Client applications often need to associate their own data to a    */\n  /*    variety of FreeType core objects.  For example, a text layout API  */\n  /*    might want to associate a glyph cache to a given size object.      */\n  /*                                                                       */\n  /*    Some FreeType object contains a `generic' field, of type           */\n  /*    FT_Generic, which usage is left to client applications and font    */\n  /*    servers.                                                           */\n  /*                                                                       */\n  /*    It can be used to store a pointer to client-specific data, as well */\n  /*    as the address of a `finalizer' function, which will be called by  */\n  /*    FreeType when the object is destroyed (for example, the previous   */\n  /*    client example would put the address of the glyph cache destructor */\n  /*    in the `finalizer' field).                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    data      :: A typeless pointer to any client-specified data. This */\n  /*                 field is completely ignored by the FreeType library.  */\n  /*                                                                       */\n  /*    finalizer :: A pointer to a `generic finalizer' function, which    */\n  /*                 will be called when the object is destroyed.  If this */\n  /*                 field is set to NULL, no code will be called.         */\n  /*                                                                       */\n  typedef struct  FT_Generic_\n  {\n    void*                 data;\n    FT_Generic_Finalizer  finalizer;\n\n  } FT_Generic;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags which are used to label       */\n  /*    TrueType tables into an unsigned long to be used within FreeType.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The produced values *must* be 32-bit integers.  Don't redefine     */\n  /*    this macro.                                                        */\n  /*                                                                       */\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          (FT_Tag)                        \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                    L I S T   M A N A G E M E N T                      */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ListNode                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     Many elements and objects in FreeType are listed through an       */\n  /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */\n  /*     FT_ListNode is a handle to a single list element.                 */\n  /*                                                                       */\n  typedef struct FT_ListNodeRec_*  FT_ListNode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_List                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a list record (see @FT_ListRec).                       */\n  /*                                                                       */\n  typedef struct FT_ListRec_*  FT_List;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a single list element.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    prev :: The previous element in the list.  NULL if first.          */\n  /*                                                                       */\n  /*    next :: The next element in the list.  NULL if last.               */\n  /*                                                                       */\n  /*    data :: A typeless pointer to the listed object.                   */\n  /*                                                                       */\n  typedef struct  FT_ListNodeRec_\n  {\n    FT_ListNode  prev;\n    FT_ListNode  next;\n    void*        data;\n\n  } FT_ListNodeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a simple doubly-linked list.  These are   */\n  /*    used in many parts of FreeType.                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    head :: The head (first element) of doubly-linked list.            */\n  /*                                                                       */\n  /*    tail :: The tail (last element) of doubly-linked list.             */\n  /*                                                                       */\n  typedef struct  FT_ListRec_\n  {\n    FT_ListNode  head;\n    FT_ListNode  tail;\n\n  } FT_ListRec;\n\n\n  /* */\n\n#define FT_IS_EMPTY( list )  ( (list).head == 0 )\n#define FT_BOOL( x )  ( (FT_Bool)( x ) )\n\n  /* concatenate C tokens */\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n  /* see `ftmoderr.h' for descriptions of the following macros */\n\n#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#define FT_ERROR_BASE( x )    ( (x) & 0xFF )\n#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )\n\n#define FT_ERR_EQ( x, e )                                        \\\n          ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )\n#define FT_ERR_NEQ( x, e )                                       \\\n          ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.h                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows fnt-specific data.                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2008 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTWINFNT_H__\n#define __FTWINFNT_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    winfnt_fonts                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Window FNT Files                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Windows FNT specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Windows FNT specific      */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_WinFNT_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `charset' byte in\n   *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX\n   *   encodings (except for cp1361) can be found at ftp://ftp.unicode.org\n   *   in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory.  cp1361 is\n   *   roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.\n   *\n   * @values:\n   *   FT_WinFNT_ID_DEFAULT ::\n   *     This is used for font enumeration and font creation as a\n   *     `don't care' value.  Valid font files don't contain this value.\n   *     When querying for information about the character set of the font\n   *     that is currently selected into a specified device context, this\n   *     return value (of the related Windows API) simply denotes failure.\n   *\n   *   FT_WinFNT_ID_SYMBOL ::\n   *     There is no known mapping table available.\n   *\n   *   FT_WinFNT_ID_MAC ::\n   *     Mac Roman encoding.\n   *\n   *   FT_WinFNT_ID_OEM ::\n   *     From Michael Pöttgen <michael@poettgen.de>:\n   *\n   *       The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM\n   *       is used for the charset of vector fonts, like `modern.fon',\n   *       `roman.fon', and `script.fon' on Windows.\n   *\n   *       The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value\n   *       specifies a character set that is operating-system dependent.\n   *\n   *       The `IFIMETRICS' documentation from the `Windows Driver\n   *       Development Kit' says: This font supports an OEM-specific\n   *       character set.  The OEM character set is system dependent.\n   *\n   *       In general OEM, as opposed to ANSI (i.e., cp1252), denotes the\n   *       second default codepage that most international versions of\n   *       Windows have.  It is one of the OEM codepages from\n   *\n   *         http://www.microsoft.com/globaldev/reference/cphome.mspx,\n   *\n   *       and is used for the `DOS boxes', to support legacy applications.\n   *       A German Windows version for example usually uses ANSI codepage\n   *       1252 and OEM codepage 850.\n   *\n   *   FT_WinFNT_ID_CP874 ::\n   *     A superset of Thai TIS 620 and ISO 8859-11.\n   *\n   *   FT_WinFNT_ID_CP932 ::\n   *     A superset of Japanese Shift-JIS (with minor deviations).\n   *\n   *   FT_WinFNT_ID_CP936 ::\n   *     A superset of simplified Chinese GB 2312-1980 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP949 ::\n   *     A superset of Korean Hangul KS~C 5601-1987 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP950 ::\n   *     A superset of traditional Chinese Big~5 ETen (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP1250 ::\n   *     A superset of East European ISO 8859-2 (with slightly different\n   *     ordering).\n   *\n   *   FT_WinFNT_ID_CP1251 ::\n   *     A superset of Russian ISO 8859-5 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1252 ::\n   *     ANSI encoding.  A superset of ISO 8859-1.\n   *\n   *   FT_WinFNT_ID_CP1253 ::\n   *     A superset of Greek ISO 8859-7 (with minor modifications).\n   *\n   *   FT_WinFNT_ID_CP1254 ::\n   *     A superset of Turkish ISO 8859-9.\n   *\n   *   FT_WinFNT_ID_CP1255 ::\n   *     A superset of Hebrew ISO 8859-8 (with some modifications).\n   *\n   *   FT_WinFNT_ID_CP1256 ::\n   *     A superset of Arabic ISO 8859-6 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1257 ::\n   *     A superset of Baltic ISO 8859-13 (with some deviations).\n   *\n   *   FT_WinFNT_ID_CP1258 ::\n   *     For Vietnamese.  This encoding doesn't cover all necessary\n   *     characters.\n   *\n   *   FT_WinFNT_ID_CP1361 ::\n   *     Korean (Johab).\n   */\n\n#define FT_WinFNT_ID_CP1252    0\n#define FT_WinFNT_ID_DEFAULT   1\n#define FT_WinFNT_ID_SYMBOL    2\n#define FT_WinFNT_ID_MAC      77\n#define FT_WinFNT_ID_CP932   128\n#define FT_WinFNT_ID_CP949   129\n#define FT_WinFNT_ID_CP1361  130\n#define FT_WinFNT_ID_CP936   134\n#define FT_WinFNT_ID_CP950   136\n#define FT_WinFNT_ID_CP1253  161\n#define FT_WinFNT_ID_CP1254  162\n#define FT_WinFNT_ID_CP1258  163\n#define FT_WinFNT_ID_CP1255  177\n#define FT_WinFNT_ID_CP1256  178\n#define FT_WinFNT_ID_CP1257  186\n#define FT_WinFNT_ID_CP1251  204\n#define FT_WinFNT_ID_CP874   222\n#define FT_WinFNT_ID_CP1250  238\n#define FT_WinFNT_ID_OEM     255\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_HeaderRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Windows FNT Header info.                                           */\n  /*                                                                       */\n  typedef struct  FT_WinFNT_HeaderRec_\n  {\n    FT_UShort  version;\n    FT_ULong   file_size;\n    FT_Byte    copyright[60];\n    FT_UShort  file_type;\n    FT_UShort  nominal_point_size;\n    FT_UShort  vertical_resolution;\n    FT_UShort  horizontal_resolution;\n    FT_UShort  ascent;\n    FT_UShort  internal_leading;\n    FT_UShort  external_leading;\n    FT_Byte    italic;\n    FT_Byte    underline;\n    FT_Byte    strike_out;\n    FT_UShort  weight;\n    FT_Byte    charset;\n    FT_UShort  pixel_width;\n    FT_UShort  pixel_height;\n    FT_Byte    pitch_and_family;\n    FT_UShort  avg_width;\n    FT_UShort  max_width;\n    FT_Byte    first_char;\n    FT_Byte    last_char;\n    FT_Byte    default_char;\n    FT_Byte    break_char;\n    FT_UShort  bytes_per_row;\n    FT_ULong   device_offset;\n    FT_ULong   face_name_offset;\n    FT_ULong   bits_pointer;\n    FT_ULong   bits_offset;\n    FT_Byte    reserved;\n    FT_ULong   flags;\n    FT_UShort  A_space;\n    FT_UShort  B_space;\n    FT_UShort  C_space;\n    FT_UShort  color_table_offset;\n    FT_ULong   reserved1[4];\n\n  } FT_WinFNT_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_Header                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FT_WinFNT_HeaderRec structure.                     */\n  /*                                                                       */\n  typedef struct FT_WinFNT_HeaderRec_*  FT_WinFNT_Header;\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_WinFNT_Header\n   *\n   * @description:\n   *    Retrieve a Windows FNT font info header.\n   *\n   * @input:\n   *    face    :: A handle to the input face.\n   *\n   * @output:\n   *    aheader :: The WinFNT header.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function only works with Windows FNT faces, returning an error\n   *   otherwise.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *aheader );\n\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTWINFNT_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ftxf86.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.h                                                               */\n/*                                                                         */\n/*    Support functions for X11.                                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2007 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTXF86_H__\n#define __FTXF86_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   font_formats                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   Font Formats                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   Getting the font format.                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   The single function in this section can be used to get the font     */\n  /*   format.  Note that this information is not needed normally;         */\n  /*   however, there are special cases (like in PDF devices) where it is  */\n  /*   important to differentiate, in spite of FreeType's uniform API.     */\n  /*                                                                       */\n  /*   This function is in the X11/xf86 namespace for historical reasons   */\n  /*   and in no way depends on that windowing system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*   FT_Get_X11_Font_Format                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Return a string describing the format of a given face, using values */\n  /*   which can be used as an X11 FONT_PROPERTY.  Possible values are     */\n  /*   `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */\n  /*   `PFR', and `Windows~FNT'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   face ::                                                             */\n  /*     Input face handle.                                                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   Font format string.  NULL in case of error.                         */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTXF86_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/autohint.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  autohint.h                                                             */\n/*                                                                         */\n/*    High-level `autohint' module-specific interface (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2007, 2009, 2012 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The auto-hinter is used to load and automatically hint glyphs if a    */\n  /* format-specific hinter isn't available.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __AUTOHINT_H__\n#define __AUTOHINT_H__\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A small technical note regarding automatic hinting in order to        */\n  /* clarify this module interface.                                        */\n  /*                                                                       */\n  /* An automatic hinter might compute two kinds of data for a given face: */\n  /*                                                                       */\n  /* - global hints: Usually some metrics that describe global properties  */\n  /*                 of the face.  It is computed by scanning more or less */\n  /*                 aggressively the glyphs in the face, and thus can be  */\n  /*                 very slow to compute (even if the size of global      */\n  /*                 hints is really small).                               */\n  /*                                                                       */\n  /* - glyph hints:  These describe some important features of the glyph   */\n  /*                 outline, as well as how to align them.  They are      */\n  /*                 generally much faster to compute than global hints.   */\n  /*                                                                       */\n  /* The current FreeType auto-hinter does a pretty good job while         */\n  /* performing fast computations for both global and glyph hints.         */\n  /* However, we might be interested in introducing more complex and       */\n  /* powerful algorithms in the future, like the one described in the John */\n  /* D. Hobby paper, which unfortunately requires a lot more horsepower.   */\n  /*                                                                       */\n  /* Because a sufficiently sophisticated font management system would     */\n  /* typically implement an LRU cache of opened face objects to reduce     */\n  /* memory usage, it is a good idea to be able to avoid recomputing       */\n  /* global hints every time the same face is re-opened.                   */\n  /*                                                                       */\n  /* We thus provide the ability to cache global hints outside of the face */\n  /* object, in order to speed up font re-opening time.  Of course, this   */\n  /* feature is purely optional, so most client programs won't even notice */\n  /* it.                                                                   */\n  /*                                                                       */\n  /* I initially thought that it would be a good idea to cache the glyph   */\n  /* hints too.  However, my general idea now is that if you really need   */\n  /* to cache these too, you are simply in need of a new font format,      */\n  /* where all this information could be stored within the font file and   */\n  /* decoded on the fly.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct FT_AutoHinterRec_  *FT_AutoHinter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalGetFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the global hints computed for a given face object.  The   */\n  /*    resulting data is dissociated from the face and will survive a     */\n  /*    call to FT_Done_Face().  It must be discarded through the API      */\n  /*    FT_AutoHinter_GlobalDoneFunc().                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter       :: A handle to the source auto-hinter.                */\n  /*                                                                       */\n  /*    face         :: A handle to the source face object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    global_hints :: A typeless pointer to the global hints.            */\n  /*                                                                       */\n  /*    global_len   :: The size in bytes of the global hints.             */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,\n                                  FT_Face        face,\n                                  void**         global_hints,\n                                  long*          global_len );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalDoneFunc                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard the global hints retrieved through                         */\n  /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */\n  /*    are freed from memory.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the auto-hinter module.                      */\n  /*                                                                       */\n  /*    global :: A pointer to retrieved global hints to discard.          */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter  hinter,\n                                   void*          global );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalResetFunc                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to recompute the global metrics in a given   */\n  /*    font.  This is useful when global font data changes (e.g. Multiple */\n  /*    Masters fonts where blend coordinates change).                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the source auto-hinter.                      */\n  /*                                                                       */\n  /*    face   :: A handle to the face.                                    */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter  hinter,\n                                    FT_Face        face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlyphLoadFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to load, scale, and automatically hint a     */\n  /*    glyph from a given face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the face.                               */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    load_flags  :: The load flags.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is capable of loading composite glyphs by hinting    */\n  /*    each sub-glyph independently (which improves quality).             */\n  /*                                                                       */\n  /*    It will call the font driver with @FT_Load_Glyph, with             */\n  /*    @FT_LOAD_NO_SCALE set.                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,\n                                  FT_GlyphSlot   slot,\n                                  FT_Size        size,\n                                  FT_UInt        glyph_index,\n                                  FT_Int32       load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_AutoHinter_InterfaceRec                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The auto-hinter module's interface.                                */\n  /*                                                                       */\n  typedef struct  FT_AutoHinter_InterfaceRec_\n  {\n    FT_AutoHinter_GlobalResetFunc  reset_face;\n    FT_AutoHinter_GlobalGetFunc    get_global_hints;\n    FT_AutoHinter_GlobalDoneFunc   done_global_hints;\n    FT_AutoHinter_GlyphLoadFunc    load_glyph;\n\n  } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(       \\\n          class_,                             \\\n          reset_face_,                        \\\n          get_global_hints_,                  \\\n          done_global_hints_,                 \\\n          load_glyph_ )                       \\\n  FT_CALLBACK_TABLE_DEF                       \\\n  const FT_AutoHinter_InterfaceRec  class_ =  \\\n  {                                           \\\n    reset_face_,                              \\\n    get_global_hints_,                        \\\n    done_global_hints_,                       \\\n    load_glyph_                               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(                            \\\n          class_,                                                  \\\n          reset_face_,                                             \\\n          get_global_hints_,                                       \\\n          done_global_hints_,                                      \\\n          load_glyph_ )                                            \\\n  void                                                             \\\n  FT_Init_Class_ ## class_( FT_Library                   library,  \\\n                            FT_AutoHinter_InterfaceRec*  clazz )   \\\n  {                                                                \\\n    FT_UNUSED( library );                                          \\\n                                                                   \\\n    clazz->reset_face        = reset_face_;                        \\\n    clazz->get_global_hints  = get_global_hints_;                  \\\n    clazz->done_global_hints = done_global_hints_;                 \\\n    clazz->load_glyph        = load_glyph_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __AUTOHINT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftcalc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcalc.h                                                               */\n/*                                                                         */\n/*    Arithmetic computations (specification).                             */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2009, 2012-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCALC_H__\n#define __FTCALC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FixedSqrt                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the square root of a 16.16 fixed-point value.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x :: The value to compute the root for.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `sqrt(x)'.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is not very fast.                                    */\n  /*                                                                       */\n  FT_BASE( FT_Int32 )\n  FT_SqrtFixed( FT_Int32  x );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv_No_Round                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    (without rounding) with maximum accuracy (it uses a 64-bit         */\n  /*    intermediate integer whenever necessary).                          */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_BASE( FT_Long )\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c );\n\n\n  /*\n   *  A variant of FT_Matrix_Multiply which scales its result afterwards.\n   *  The idea is that both `a' and `b' are scaled by factors of 10 so that\n   *  the values are as precise as possible to get a correct result during\n   *  the 64bit multiplication.  Let `sa' and `sb' be the scaling factors of\n   *  `a' and `b', respectively, then the scaling factor of the result is\n   *  `sa*sb'.\n   */\n  FT_BASE( void )\n  FT_Matrix_Multiply_Scaled( const FT_Matrix*  a,\n                             FT_Matrix        *b,\n                             FT_Long           scaling );\n\n\n  /*\n   *  A variant of FT_Vector_Transform.  See comments for\n   *  FT_Matrix_Multiply_Scaled.\n   */\n  FT_BASE( void )\n  FT_Vector_Transform_Scaled( FT_Vector*        vector,\n                              const FT_Matrix*  matrix,\n                              FT_Long           scaling );\n\n\n  /*\n   *  Return -1, 0, or +1, depending on the orientation of a given corner.\n   *  We use the Cartesian coordinate system, with positive vertical values\n   *  going upwards.  The function returns +1 if the corner turns to the\n   *  left, -1 to the right, and 0 for undecidable cases.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_orientation( FT_Pos  in_x,\n                         FT_Pos  in_y,\n                         FT_Pos  out_x,\n                         FT_Pos  out_y );\n\n  /*\n   *  Return TRUE if a corner is flat or nearly flat.  This is equivalent to\n   *  saying that the angle difference between the `in' and `out' vectors is\n   *  very small.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_is_flat( FT_Pos  in_x,\n                     FT_Pos  in_y,\n                     FT_Pos  out_x,\n                     FT_Pos  out_y );\n\n\n  /*\n   *  Return the most significant bit index.\n   */\n  FT_BASE( FT_Int )\n  FT_MSB( FT_UInt32  z );\n\n\n  /*\n   *  Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses\n   *  two fixed-point arguments instead.\n   */\n  FT_BASE( FT_Fixed )\n  FT_Hypot( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n#define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )\n#define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )\n#define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )\n#define F2DOT14_TO_FIXED( x )  ( (FT_Long)(x) << 2  )\n#define FLOAT_TO_FIXED( x )    ( (FT_Long)( x * 65536.0 ) )\n#define FIXED_TO_INT( x )      ( FT_RoundFix( x ) >> 16 )\n\n#define ROUND_F26DOT6( x )     ( x >= 0 ? (    ( (x) + 32 ) & -64 )     \\\n                                        : ( -( ( 32 - (x) ) & -64 ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTCALC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftdebug.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdebug.h                                                              */\n/*                                                                         */\n/*    Debugging and logging component (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/*                                                                         */\n/*  IMPORTANT: A description of FreeType's debugging support can be        */\n/*             found in `docs/DEBUG.TXT'.  Read it if you need to use or   */\n/*             understand this code.                                       */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDEBUG_H__\n#define __FTDEBUG_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */\n  /* is already defined; this simplifies the following #ifdefs            */\n  /*                                                                      */\n#ifdef FT_DEBUG_LEVEL_TRACE\n#undef  FT_DEBUG_LEVEL_ERROR\n#define FT_DEBUG_LEVEL_ERROR\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the trace enums as well as the trace levels array when they    */\n  /* are needed.                                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE_DEF( x )  trace_ ## x ,\n\n  /* defining the enumeration */\n  typedef enum  FT_Trace_\n  {\n#include FT_INTERNAL_TRACE_H\n    trace_count\n\n  } FT_Trace;\n\n\n  /* defining the array of trace levels, provided by `src/base/ftdebug.c' */\n  extern int  ft_trace_levels[trace_count];\n\n#undef FT_TRACE_DEF\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_TRACE macro                                             */\n  /*                                                                       */\n  /* IMPORTANT!                                                            */\n  /*                                                                       */\n  /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */\n  /* value before using any TRACE macro.                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE( level, varformat )                      \\\n          do                                              \\\n          {                                               \\\n            if ( ft_trace_levels[FT_COMPONENT] >= level ) \\\n              FT_Message varformat;                       \\\n          } while ( 0 )\n\n#else /* !FT_DEBUG_LEVEL_TRACE */\n\n#define FT_TRACE( level, varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Count                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the number of available trace components.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of trace components.  0 if FreeType 2 is not built with */\n  /*    FT_DEBUG_LEVEL_TRACE definition.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may be useful if you want to access elements of      */\n  /*    the internal `ft_trace_levels' array by an index.                  */\n  /*                                                                       */\n  FT_BASE( FT_Int )\n  FT_Trace_Get_Count( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the name of a trace component.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The index of the trace component.                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The name of the trace component.  This is a statically allocated   */\n  /*    C string, so do not free it after use.  NULL if FreeType 2 is not  */\n  /*    built with FT_DEBUG_LEVEL_TRACE definition.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Trace_Get_Count to get the number of available trace       */\n  /*    components.                                                        */\n  /*                                                                       */\n  /*    This function may be useful if you want to control FreeType 2's    */\n  /*    debug level in your application.                                   */\n  /*                                                                       */\n  FT_BASE( const char * )\n  FT_Trace_Get_Name( FT_Int  idx );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* You need two opening and closing parentheses!                         */\n  /*                                                                       */\n  /* Example: FT_TRACE0(( \"Value is %i\", foo ))                            */\n  /*                                                                       */\n  /* Output of the FT_TRACEX macros is sent to stderr.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_TRACE0( varformat )  FT_TRACE( 0, varformat )\n#define FT_TRACE1( varformat )  FT_TRACE( 1, varformat )\n#define FT_TRACE2( varformat )  FT_TRACE( 2, varformat )\n#define FT_TRACE3( varformat )  FT_TRACE( 3, varformat )\n#define FT_TRACE4( varformat )  FT_TRACE( 4, varformat )\n#define FT_TRACE5( varformat )  FT_TRACE( 5, varformat )\n#define FT_TRACE6( varformat )  FT_TRACE( 6, varformat )\n#define FT_TRACE7( varformat )  FT_TRACE( 7, varformat )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ERROR macro.                                            */\n  /*                                                                       */\n  /* Output of this macro is sent to stderr.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ERROR( varformat )  FT_Message  varformat\n\n#else  /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ERROR( varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ASSERT and FT_THROW macros.  The call to `FT_Throw'     */\n  /* makes it possible to easily set a breakpoint at this function.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ASSERT( condition )                                      \\\n          do                                                        \\\n          {                                                         \\\n            if ( !( condition ) )                                   \\\n              FT_Panic( \"assertion failed on line %d of file %s\\n\", \\\n                        __LINE__, __FILE__ );                       \\\n          } while ( 0 )\n\n#define FT_THROW( e )                                   \\\n          ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ),   \\\n                      __LINE__,                         \\\n                      __FILE__ )                      | \\\n            FT_ERR_CAT( FT_ERR_PREFIX, e )            )\n\n#else /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ASSERT( condition )  do { } while ( 0 )\n\n#define FT_THROW( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define `FT_Message' and `FT_Panic' when needed.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#include \"stdio.h\"  /* for vfprintf() */\n\n  /* print a message */\n  FT_BASE( void )\n  FT_Message( const char*  fmt,\n              ... );\n\n  /* print a message and exit */\n  FT_BASE( void )\n  FT_Panic( const char*  fmt,\n            ... );\n\n  /* report file name and line number of an error */\n  FT_BASE( int )\n  FT_Throw( FT_Error     error,\n            int          line,\n            const char*  file );\n\n#endif /* FT_DEBUG_LEVEL_ERROR */\n\n\n  FT_BASE( void )\n  ft_debug_init( void );\n\nFT_END_HEADER\n\n#endif /* __FTDEBUG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftdriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdriver.h                                                             */\n/*                                                                         */\n/*    FreeType font driver interface (specification).                      */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2011-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDRIVER_H__\n#define __FTDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef FT_Error\n  (*FT_Face_InitFunc)( FT_Stream      stream,\n                       FT_Face        face,\n                       FT_Int         typeface_index,\n                       FT_Int         num_params,\n                       FT_Parameter*  parameters );\n\n  typedef void\n  (*FT_Face_DoneFunc)( FT_Face  face );\n\n\n  typedef FT_Error\n  (*FT_Size_InitFunc)( FT_Size  size );\n\n  typedef void\n  (*FT_Size_DoneFunc)( FT_Size  size );\n\n\n  typedef FT_Error\n  (*FT_Slot_InitFunc)( FT_GlyphSlot  slot );\n\n  typedef void\n  (*FT_Slot_DoneFunc)( FT_GlyphSlot  slot );\n\n\n  typedef FT_Error\n  (*FT_Size_RequestFunc)( FT_Size          size,\n                          FT_Size_Request  req );\n\n  typedef FT_Error\n  (*FT_Size_SelectFunc)( FT_Size   size,\n                         FT_ULong  size_index );\n\n  typedef FT_Error\n  (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,\n                       FT_Size       size,\n                       FT_UInt       glyph_index,\n                       FT_Int32      load_flags );\n\n\n  typedef FT_UInt\n  (*FT_CharMap_CharIndexFunc)( FT_CharMap  charmap,\n                               FT_Long     charcode );\n\n  typedef FT_Long\n  (*FT_CharMap_CharNextFunc)( FT_CharMap  charmap,\n                              FT_Long     charcode );\n\n\n  typedef FT_Error\n  (*FT_Face_GetKerningFunc)( FT_Face     face,\n                             FT_UInt     left_glyph,\n                             FT_UInt     right_glyph,\n                             FT_Vector*  kerning );\n\n\n  typedef FT_Error\n  (*FT_Face_AttachFunc)( FT_Face    face,\n                         FT_Stream  stream );\n\n\n  typedef FT_Error\n  (*FT_Face_GetAdvancesFunc)( FT_Face    face,\n                              FT_UInt    first,\n                              FT_UInt    count,\n                              FT_Int32   flags,\n                              FT_Fixed*  advances );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Driver_ClassRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The font driver class.  This structure mostly contains pointers to */\n  /*    driver methods.                                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root             :: The parent module.                             */\n  /*                                                                       */\n  /*    face_object_size :: The size of a face object in bytes.            */\n  /*                                                                       */\n  /*    size_object_size :: The size of a size object in bytes.            */\n  /*                                                                       */\n  /*    slot_object_size :: The size of a glyph object in bytes.           */\n  /*                                                                       */\n  /*    init_face        :: The format-specific face constructor.          */\n  /*                                                                       */\n  /*    done_face        :: The format-specific face destructor.           */\n  /*                                                                       */\n  /*    init_size        :: The format-specific size constructor.          */\n  /*                                                                       */\n  /*    done_size        :: The format-specific size destructor.           */\n  /*                                                                       */\n  /*    init_slot        :: The format-specific slot constructor.          */\n  /*                                                                       */\n  /*    done_slot        :: The format-specific slot destructor.           */\n  /*                                                                       */\n  /*                                                                       */\n  /*    load_glyph       :: A function handle to load a glyph to a slot.   */\n  /*                        This field is mandatory!                       */\n  /*                                                                       */\n  /*    get_kerning      :: A function handle to return the unscaled       */\n  /*                        kerning for a given pair of glyphs.  Can be    */\n  /*                        set to 0 if the format doesn't support         */\n  /*                        kerning.                                       */\n  /*                                                                       */\n  /*    attach_file      :: This function handle is used to read           */\n  /*                        additional data for a face from another        */\n  /*                        file/stream.  For example, this can be used to */\n  /*                        add data from AFM or PFM files on a Type 1     */\n  /*                        face, or a CIDMap on a CID-keyed face.         */\n  /*                                                                       */\n  /*    get_advances     :: A function handle used to return advance       */\n  /*                        widths of `count' glyphs (in font units),      */\n  /*                        starting at `first'.  The `vertical' flag must */\n  /*                        be set to get vertical advance heights.  The   */\n  /*                        `advances' buffer is caller-allocated.         */\n  /*                        The idea of this function is to be able to     */\n  /*                        perform device-independent text layout without */\n  /*                        loading a single glyph image.                  */\n  /*                                                                       */\n  /*    request_size     :: A handle to a function used to request the new */\n  /*                        character size.  Can be set to 0 if the        */\n  /*                        scaling done in the base layer suffices.       */\n  /*                                                                       */\n  /*    select_size      :: A handle to a function used to select a new    */\n  /*                        fixed size.  It is used only if                */\n  /*                        @FT_FACE_FLAG_FIXED_SIZES is set.  Can be set  */\n  /*                        to 0 if the scaling done in the base layer     */\n  /*                        suffices.                                      */\n  /* <Note>                                                                */\n  /*    Most function pointers, with the exception of `load_glyph', can be */\n  /*    set to 0 to indicate a default behaviour.                          */\n  /*                                                                       */\n  typedef struct  FT_Driver_ClassRec_\n  {\n    FT_Module_Class          root;\n\n    FT_Long                  face_object_size;\n    FT_Long                  size_object_size;\n    FT_Long                  slot_object_size;\n\n    FT_Face_InitFunc         init_face;\n    FT_Face_DoneFunc         done_face;\n\n    FT_Size_InitFunc         init_size;\n    FT_Size_DoneFunc         done_size;\n\n    FT_Slot_InitFunc         init_slot;\n    FT_Slot_DoneFunc         done_slot;\n\n    FT_Slot_LoadFunc         load_glyph;\n\n    FT_Face_GetKerningFunc   get_kerning;\n    FT_Face_AttachFunc       attach_file;\n    FT_Face_GetAdvancesFunc  get_advances;\n\n    /* since version 2.2 */\n    FT_Size_RequestFunc      request_size;\n    FT_Size_SelectFunc       select_size;\n\n  } FT_Driver_ClassRec, *FT_Driver_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_DRIVER                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of an FT_Driver_ClassRec      */\n  /*    struct instance.                                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_DRIVER                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Driver_ClassRec struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */\n  /*    called with a pointer where the allocated structure is returned.   */\n  /*    And when it is no longer needed a `destroy' function needs to be   */\n  /*    called to release that allocation.                                 */\n  /*                                                                       */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains a   */\n  /*    mechanism to call these functions for the default modules          */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by driver definition calling `FT_DEFINE_DRIVER' in following.      */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_DRIVER( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Driver_ClassRec  class_;\n\n#define FT_DEFINE_DRIVER(                    \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          face_object_size_,                 \\\n          size_object_size_,                 \\\n          slot_object_size_,                 \\\n          init_face_,                        \\\n          done_face_,                        \\\n          init_size_,                        \\\n          done_size_,                        \\\n          init_slot_,                        \\\n          done_slot_,                        \\\n          load_glyph_,                       \\\n          get_kerning_,                      \\\n          attach_file_,                      \\\n          get_advances_,                     \\\n          request_size_,                     \\\n          select_size_ )                     \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Driver_ClassRec  class_ =         \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n                                             \\\n    face_object_size_,                       \\\n    size_object_size_,                       \\\n    slot_object_size_,                       \\\n                                             \\\n    init_face_,                              \\\n    done_face_,                              \\\n                                             \\\n    init_size_,                              \\\n    done_size_,                              \\\n                                             \\\n    init_slot_,                              \\\n    done_slot_,                              \\\n                                             \\\n    load_glyph_,                             \\\n                                             \\\n    get_kerning_,                            \\\n    attach_file_,                            \\\n    get_advances_,                           \\\n                                             \\\n    request_size_,                           \\\n    select_size_                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_DRIVER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_DRIVER(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          face_object_size_,                                     \\\n          size_object_size_,                                     \\\n          slot_object_size_,                                     \\\n          init_face_,                                            \\\n          done_face_,                                            \\\n          init_size_,                                            \\\n          done_size_,                                            \\\n          init_slot_,                                            \\\n          done_slot_,                                            \\\n          load_glyph_,                                           \\\n          get_kerning_,                                          \\\n          attach_file_,                                          \\\n          get_advances_,                                         \\\n          request_size_,                                         \\\n          select_size_ )                                         \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory        memory = library->memory;                   \\\n    FT_Driver_Class  dclazz = (FT_Driver_Class)clazz;            \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( dclazz )                                                \\\n      FT_FREE( dclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Driver_Class  clazz  = NULL;                              \\\n    FT_Error         error;                                      \\\n    FT_Memory        memory = library->memory;                   \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->face_object_size = face_object_size_;                 \\\n    clazz->size_object_size = size_object_size_;                 \\\n    clazz->slot_object_size = slot_object_size_;                 \\\n                                                                 \\\n    clazz->init_face        = init_face_;                        \\\n    clazz->done_face        = done_face_;                        \\\n                                                                 \\\n    clazz->init_size        = init_size_;                        \\\n    clazz->done_size        = done_size_;                        \\\n                                                                 \\\n    clazz->init_slot        = init_slot_;                        \\\n    clazz->done_slot        = done_slot_;                        \\\n                                                                 \\\n    clazz->load_glyph       = load_glyph_;                       \\\n                                                                 \\\n    clazz->get_kerning      = get_kerning_;                      \\\n    clazz->attach_file      = attach_file_;                      \\\n    clazz->get_advances     = get_advances_;                     \\\n                                                                 \\\n    clazz->request_size     = request_size_;                     \\\n    clazz->select_size      = select_size_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __FTDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftgloadr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgloadr.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph loader (specification).                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2005, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGLOADR_H__\n#define __FTGLOADR_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphLoader                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The glyph loader is an internal object used to load several glyphs */\n  /*    together (for example, in the case of composites).                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The glyph loader implementation is not part of the high-level API, */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;\n\n\n#if 0  /* moved to freetype.h in version 2.2 */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n#endif\n\n\n  typedef struct  FT_SubGlyphRec_\n  {\n    FT_Int     index;\n    FT_UShort  flags;\n    FT_Int     arg1;\n    FT_Int     arg2;\n    FT_Matrix  transform;\n\n  } FT_SubGlyphRec;\n\n\n  typedef struct  FT_GlyphLoadRec_\n  {\n    FT_Outline   outline;       /* outline                   */\n    FT_Vector*   extra_points;  /* extra points table        */\n    FT_Vector*   extra_points2; /* second extra points table */\n    FT_UInt      num_subglyphs; /* number of subglyphs       */\n    FT_SubGlyph  subglyphs;     /* subglyphs                 */\n\n  } FT_GlyphLoadRec, *FT_GlyphLoad;\n\n\n  typedef struct  FT_GlyphLoaderRec_\n  {\n    FT_Memory        memory;\n    FT_UInt          max_points;\n    FT_UInt          max_contours;\n    FT_UInt          max_subglyphs;\n    FT_Bool          use_extra;\n\n    FT_GlyphLoadRec  base;\n    FT_GlyphLoadRec  current;\n\n    void*            other;            /* for possible future extension? */\n\n  } FT_GlyphLoaderRec;\n\n\n  /* create new empty glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_New( FT_Memory        memory,\n                      FT_GlyphLoader  *aloader );\n\n  /* add an extra points table to a glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );\n\n  /* destroy a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Done( FT_GlyphLoader  loader );\n\n  /* reset a glyph loader (frees everything int it) */\n  FT_BASE( void )\n  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );\n\n  /* rewind a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );\n\n  /* check that there is enough space to add `n_points' and `n_contours' */\n  /* to the glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,\n                              FT_UInt         n_points,\n                              FT_UInt         n_contours );\n\n\n#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                         \\\n   ( (_count) == 0 || ((_loader)->base.outline.n_points    +              \\\n                       (_loader)->current.outline.n_points +              \\\n                       (unsigned long)(_count)) <= (_loader)->max_points )\n\n#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                          \\\n  ( (_count) == 0 || ((_loader)->base.outline.n_contours    +              \\\n                      (_loader)->current.outline.n_contours +              \\\n                      (unsigned long)(_count)) <= (_loader)->max_contours )\n\n#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \\\n  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \\\n      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \\\n    ? 0                                                                \\\n    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )\n\n\n  /* check that there is enough space to add `n_subs' sub-glyphs to */\n  /* a glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,\n                                 FT_UInt         n_subs );\n\n  /* prepare a glyph loader, i.e. empty the current glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );\n\n  /* add the current glyph to the base glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Add( FT_GlyphLoader  loader );\n\n  /* copy points from one glyph loader to another */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,\n                             FT_GlyphLoader  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLOADR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftmemory.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmemory.h                                                             */\n/*                                                                         */\n/*    The FreeType memory management macros (specification).               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2007, 2010, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMEMORY_H__\n#define __FTMEMORY_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_SET_ERROR                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used to set an implicit `error' variable to a given  */\n  /*    expression's value (usually a function call), and convert it to a  */\n  /*    boolean which is set whenever the value is != 0.                   */\n  /*                                                                       */\n#undef  FT_SET_ERROR\n#define FT_SET_ERROR( expression ) \\\n          ( ( error = (expression) ) != 0 )\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                           M E M O R Y                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*\n   *  C++ refuses to handle statements like p = (void*)anything, with `p' a\n   *  typed pointer.  Since we don't have a `typeof' operator in standard\n   *  C++, we have to use a template to emulate it.\n   */\n\n#ifdef __cplusplus\n\n  extern \"C++\"\n  template <typename T> inline T*\n  cplusplus_typeof(        T*,\n                    void  *v )\n  {\n    return static_cast <T*> ( v );\n  }\n\n#define FT_ASSIGNP( p, val )  (p) = cplusplus_typeof( (p), (val) )\n\n#else\n\n#define FT_ASSIGNP( p, val )  (p) = (val)\n\n#endif\n\n\n\n#ifdef FT_DEBUG_MEMORY\n\n  FT_BASE( const char* )  _ft_debug_file;\n  FT_BASE( long )         _ft_debug_lineno;\n\n#define FT_DEBUG_INNER( exp )  ( _ft_debug_file   = __FILE__, \\\n                                 _ft_debug_lineno = __LINE__, \\\n                                 (exp) )\n\n#define FT_ASSIGNP_INNER( p, exp )  ( _ft_debug_file   = __FILE__, \\\n                                      _ft_debug_lineno = __LINE__, \\\n                                      FT_ASSIGNP( p, exp ) )\n\n#else /* !FT_DEBUG_MEMORY */\n\n#define FT_DEBUG_INNER( exp )       (exp)\n#define FT_ASSIGNP_INNER( p, exp )  FT_ASSIGNP( p, exp )\n\n#endif /* !FT_DEBUG_MEMORY */\n\n\n  /*\n   *  The allocation functions return a pointer, and the error code\n   *  is written to through the `p_error' parameter.  See below for\n   *  for documentation.\n   */\n\n  FT_BASE( FT_Pointer )\n  ft_mem_alloc( FT_Memory  memory,\n                FT_Long    size,\n                FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qalloc( FT_Memory  memory,\n                 FT_Long    size,\n                 FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_realloc( FT_Memory  memory,\n                  FT_Long    item_size,\n                  FT_Long    cur_count,\n                  FT_Long    new_count,\n                  void*      block,\n                  FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qrealloc( FT_Memory  memory,\n                   FT_Long    item_size,\n                   FT_Long    cur_count,\n                   FT_Long    new_count,\n                   void*      block,\n                   FT_Error  *p_error );\n\n  FT_BASE( void )\n  ft_mem_free( FT_Memory    memory,\n               const void*  P );\n\n\n#define FT_MEM_ALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory,          \\\n                                               (FT_Long)(size), \\\n                                               &error ) )\n\n#define FT_MEM_FREE( ptr )                \\\n          FT_BEGIN_STMNT                  \\\n            ft_mem_free( memory, (ptr) ); \\\n            (ptr) = NULL;                 \\\n          FT_END_STMNT\n\n#define FT_MEM_NEW( ptr )                        \\\n          FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_REALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,           \\\n                                                 1,                \\\n                                                 (FT_Long)(cursz), \\\n                                                 (FT_Long)(newsz), \\\n                                                 (ptr),            \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory,          \\\n                                                (FT_Long)(size), \\\n                                                &error ) )\n\n#define FT_MEM_QNEW( ptr )                        \\\n          FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_QREALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,           \\\n                                                  1,                \\\n                                                  (FT_Long)(cursz), \\\n                                                  (FT_Long)(newsz), \\\n                                                  (ptr),            \\\n                                                  &error ) )\n\n#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,               \\\n                                                 (FT_Long)(item_size), \\\n                                                 0,                    \\\n                                                 (FT_Long)(count),     \\\n                                                 NULL,                 \\\n                                                 &error ) )\n\n#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )           \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 (FT_Long)(itmsz),  \\\n                                                 (FT_Long)(oldcnt), \\\n                                                 (FT_Long)(newcnt), \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,               \\\n                                                  (FT_Long)(item_size), \\\n                                                  0,                    \\\n                                                  (FT_Long)(count),     \\\n                                                  NULL,                 \\\n                                                  &error ) )\n\n#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)            \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  (FT_Long)(itmsz),  \\\n                                                  (FT_Long)(oldcnt), \\\n                                                  (FT_Long)(newcnt), \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n\n#define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )\n\n\n#define FT_MEM_SET( dest, byte, count )     ft_memset( dest, byte, count )\n\n#define FT_MEM_COPY( dest, source, count )  ft_memcpy( dest, source, count )\n\n#define FT_MEM_MOVE( dest, source, count )  ft_memmove( dest, source, count )\n\n\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\n\n#define FT_ZERO( p )                FT_MEM_ZERO( p, sizeof ( *(p) ) )\n\n\n#define FT_ARRAY_ZERO( dest, count )                        \\\n          FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_COPY( dest, source, count )                        \\\n          FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_MOVE( dest, source, count )                        \\\n          FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )\n\n\n  /*\n   *  Return the maximum number of addressable elements in an array.\n   *  We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid\n   *  any problems.\n   */\n#define FT_ARRAY_MAX( ptr )           ( FT_INT_MAX / sizeof ( *(ptr) ) )\n\n#define FT_ARRAY_CHECK( ptr, count )  ( (count) <= FT_ARRAY_MAX( ptr ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following functions macros expect that their pointer argument is  */\n  /* _typed_ in order to automatically compute array element sizes.        */\n  /*                                                                       */\n\n#define FT_MEM_NEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 0,                 \\\n                                                 (FT_Long)(count),  \\\n                                                 NULL,              \\\n                                                 &error ) )\n\n#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 (FT_Long)(cursz),  \\\n                                                 (FT_Long)(newsz),  \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QNEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  0,                 \\\n                                                  (FT_Long)(count),  \\\n                                                  NULL,              \\\n                                                  &error ) )\n\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  (FT_Long)(cursz),  \\\n                                                  (FT_Long)(newsz),  \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n#define FT_ALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )\n\n#define FT_REALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )\n\n#define FT_ALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt,      \\\n                                                 newcnt, itmsz ) )\n\n#define FT_QALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )\n\n#define FT_QREALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )\n\n#define FT_QALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt,      \\\n                                                  newcnt, itmsz ) )\n\n#define FT_FREE( ptr )  FT_MEM_FREE( ptr )\n\n#define FT_NEW( ptr )  FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )\n\n#define FT_NEW_ARRAY( ptr, count )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_RENEW_ARRAY( ptr, curcnt, newcnt )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n#define FT_QNEW( ptr )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )\n\n#define FT_QNEW_ARRAY( ptr, count )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n\n  FT_BASE( FT_Pointer )\n  ft_mem_strdup( FT_Memory    memory,\n                 const char*  str,\n                 FT_Error    *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_dup( FT_Memory    memory,\n              const void*  address,\n              FT_ULong     size,\n              FT_Error    *p_error );\n\n\n#define FT_MEM_STRDUP( dst, str )                                            \\\n          (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )\n\n#define FT_STRDUP( dst, str )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )\n\n#define FT_MEM_DUP( dst, address, size )                                    \\\n          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )\n\n#define FT_DUP( dst, address, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )\n\n\n  /* Return >= 1 if a truncation occurs.            */\n  /* Return 0 if the source string fits the buffer. */\n  /* This is *not* the same as strlcpy().           */\n  FT_BASE( FT_Int )\n  ft_mem_strcpyn( char*        dst,\n                  const char*  src,\n                  FT_ULong     size );\n\n#define FT_STRCPYN( dst, src, size )                                         \\\n          ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMEMORY_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftobjs.h                                                               */\n/*                                                                         */\n/*    The FreeType private base classes (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2010, 2012-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file contains the definition of all internal FreeType classes.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTOBJS_H__\n#define __FTOBJS_H__\n\n#include <ft2build.h>\n#include FT_RENDER_H\n#include FT_SIZES_H\n#include FT_LCD_FILTER_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_GLYPH_LOADER_H\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_AUTOHINT_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_PIC_H\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n#include FT_INCREMENTAL_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some generic definitions.                                             */\n  /*                                                                       */\n#ifndef TRUE\n#define TRUE  1\n#endif\n\n#ifndef FALSE\n#define FALSE  0\n#endif\n\n#ifndef NULL\n#define NULL  (void*)0\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The min and max functions missing in C.  As usual, be careful not to  */\n  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */\n  /*                                                                       */\n#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )\n#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )\n\n#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )\n\n\n#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )\n#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )\n#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )\n\n#define FT_PIX_FLOOR( x )     ( (x) & ~63 )\n#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )\n#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )\n\n\n  /*\n   *  Return the highest power of 2 that is <= value; this correspond to\n   *  the highest bit in a given 32-bit value.\n   */\n  FT_BASE( FT_UInt32 )\n  ft_highpow2( FT_UInt32  value );\n\n\n  /*\n   *  character classification functions -- since these are used to parse\n   *  font files, we must not use those in <ctypes.h> which are\n   *  locale-dependent\n   */\n#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )\n\n#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \\\n                             ( (unsigned)(x) - 'a' ) < 6U  || \\\n                             ( (unsigned)(x) - 'A' ) < 6U  )\n\n  /* the next two macros assume ASCII representation */\n#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )\n#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )\n\n#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )\n#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       C H A R M A P S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to internal charmap object */\n  typedef struct FT_CMapRec_*              FT_CMap;\n\n  /* handle to charmap class structure */\n  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;\n\n  /* internal charmap object structure */\n  typedef struct  FT_CMapRec_\n  {\n    FT_CharMapRec  charmap;\n    FT_CMap_Class  clazz;\n\n  } FT_CMapRec;\n\n  /* typecase any pointer to a charmap handle */\n#define FT_CMAP( x )              ((FT_CMap)( x ))\n\n  /* obvious macros */\n#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id\n#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id\n#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding\n#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face\n\n\n  /* class method definitions */\n  typedef FT_Error\n  (*FT_CMap_InitFunc)( FT_CMap     cmap,\n                       FT_Pointer  init_data );\n\n  typedef void\n  (*FT_CMap_DoneFunc)( FT_CMap  cmap );\n\n  typedef FT_UInt\n  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,\n                            FT_UInt32  char_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,\n                           FT_UInt32  *achar_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharVarIndexFunc)( FT_CMap    cmap,\n                               FT_CMap    unicode_cmap,\n                               FT_UInt32  char_code,\n                               FT_UInt32  variant_selector );\n\n  typedef FT_Bool\n  (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap    cmap,\n                                   FT_UInt32  char_code,\n                                   FT_UInt32  variant_selector );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantListFunc)( FT_CMap    cmap,\n                              FT_Memory  mem );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_CharVariantListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  char_code );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantCharListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  variant_selector );\n\n\n  typedef struct  FT_CMap_ClassRec_\n  {\n    FT_ULong               size;\n    FT_CMap_InitFunc       init;\n    FT_CMap_DoneFunc       done;\n    FT_CMap_CharIndexFunc  char_index;\n    FT_CMap_CharNextFunc   char_next;\n\n    /* Subsequent entries are special ones for format 14 -- the variant */\n    /* selector subtable which behaves like no other                    */\n\n    FT_CMap_CharVarIndexFunc      char_var_index;\n    FT_CMap_CharVarIsDefaultFunc  char_var_default;\n    FT_CMap_VariantListFunc       variant_list;\n    FT_CMap_CharVariantListFunc   charvariant_list;\n    FT_CMap_VariantCharListFunc   variantchar_list;\n\n  } FT_CMap_ClassRec;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_CMAP_CLASS( class_ )              \\\n  FT_CALLBACK_TABLE const  FT_CMap_ClassRec class_;\n\n#define FT_DEFINE_CMAP_CLASS(       \\\n          class_,                   \\\n          size_,                    \\\n          init_,                    \\\n          done_,                    \\\n          char_index_,              \\\n          char_next_,               \\\n          char_var_index_,          \\\n          char_var_default_,        \\\n          variant_list_,            \\\n          charvariant_list_,        \\\n          variantchar_list_ )       \\\n  FT_CALLBACK_TABLE_DEF             \\\n  const FT_CMap_ClassRec  class_ =  \\\n  {                                 \\\n    size_,                          \\\n    init_,                          \\\n    done_,                          \\\n    char_index_,                    \\\n    char_next_,                     \\\n    char_var_index_,                \\\n    char_var_default_,              \\\n    variant_list_,                  \\\n    charvariant_list_,              \\\n    variantchar_list_               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_CMAP_CLASS( class_ )                  \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz );\n\n#define FT_DEFINE_CMAP_CLASS(                            \\\n          class_,                                        \\\n          size_,                                         \\\n          init_,                                         \\\n          done_,                                         \\\n          char_index_,                                   \\\n          char_next_,                                    \\\n          char_var_index_,                               \\\n          char_var_default_,                             \\\n          variant_list_,                                 \\\n          charvariant_list_,                             \\\n          variantchar_list_ )                            \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz )   \\\n  {                                                      \\\n    FT_UNUSED( library );                                \\\n                                                         \\\n    clazz->size             = size_;                     \\\n    clazz->init             = init_;                     \\\n    clazz->done             = done_;                     \\\n    clazz->char_index       = char_index_;               \\\n    clazz->char_next        = char_next_;                \\\n    clazz->char_var_index   = char_var_index_;           \\\n    clazz->char_var_default = char_var_default_;         \\\n    clazz->variant_list     = variant_list_;             \\\n    clazz->charvariant_list = charvariant_list_;         \\\n    clazz->variantchar_list = variantchar_list_;         \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* create a new charmap and add it to charmap->face */\n  FT_BASE( FT_Error )\n  FT_CMap_New( FT_CMap_Class  clazz,\n               FT_Pointer     init_data,\n               FT_CharMap     charmap,\n               FT_CMap       *acmap );\n\n  /* destroy a charmap and remove it from face's list */\n  FT_BASE( void )\n  FT_CMap_Done( FT_CMap  cmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Face_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Face        */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    max_points ::                                                      */\n  /*      The maximum number of points used to store the vectorial outline */\n  /*      of any glyph in this face.  If this value cannot be known in     */\n  /*      advance, or if the face isn't scalable, this should be set to 0. */\n  /*      Only relevant for scalable formats.                              */\n  /*                                                                       */\n  /*    max_contours ::                                                    */\n  /*      The maximum number of contours used to store the vectorial       */\n  /*      outline of any glyph in this face.  If this value cannot be      */\n  /*      known in advance, or if the face isn't scalable, this should be  */\n  /*      set to 0.  Only relevant for scalable formats.                   */\n  /*                                                                       */\n  /*    transform_matrix ::                                                */\n  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */\n  /*      outlines after they are loaded from the font.  Only used by the  */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    transform_delta ::                                                 */\n  /*      A translation vector used to transform glyph outlines after they */\n  /*      are loaded from the font.  Only used by the convenience          */\n  /*      functions.                                                       */\n  /*                                                                       */\n  /*    transform_flags ::                                                 */\n  /*      Some flags used to classify the transform.  Only used by the     */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    services ::                                                        */\n  /*      A cache for frequently used services.  It should be only         */\n  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */\n  /*                                                                       */\n  /*    incremental_interface ::                                           */\n  /*      If non-null, the interface through which glyph data and metrics  */\n  /*      are loaded incrementally for faces that do not provide all of    */\n  /*      this data when first opened.  This field exists only if          */\n  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */\n  /*                                                                       */\n  /*    ignore_unpatented_hinter ::                                        */\n  /*      This boolean flag instructs the glyph loader to ignore the       */\n  /*      native font hinter, if one is found.  This is exclusively used   */\n  /*      in the case when the unpatented hinter is compiled within the    */\n  /*      library.                                                         */\n  /*                                                                       */\n  /*    refcount ::                                                        */\n  /*      A counter initialized to~1 at the time an @FT_Face structure is  */\n  /*      created.  @FT_Reference_Face increments this counter, and        */\n  /*      @FT_Done_Face only destroys a face if the counter is~1,          */\n  /*      otherwise it simply decrements it.                               */\n  /*                                                                       */\n  typedef struct  FT_Face_InternalRec_\n  {\n    FT_Matrix           transform_matrix;\n    FT_Vector           transform_delta;\n    FT_Int              transform_flags;\n\n    FT_ServiceCacheRec  services;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Incremental_InterfaceRec*  incremental_interface;\n#endif\n\n    FT_Bool             ignore_unpatented_hinter;\n    FT_Int              refcount;\n\n  } FT_Face_InternalRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Slot_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_GlyphSlot   */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loader            :: The glyph loader object used to load outlines */\n  /*                         into the glyph slot.                          */\n  /*                                                                       */\n  /*    flags             :: Possible values are zero or                   */\n  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */\n  /*                         that the FT_GlyphSlot structure owns the      */\n  /*                         bitmap buffer.                                */\n  /*                                                                       */\n  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */\n  /*                         must be transformed through a specific        */\n  /*                         font transformation.  This is _not_ the same  */\n  /*                         as the face transform set through             */\n  /*                         FT_Set_Transform().                           */\n  /*                                                                       */\n  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */\n  /*                         transformation, if necessary.                 */\n  /*                                                                       */\n  /*    glyph_delta       :: The 2d translation vector corresponding to    */\n  /*                         the glyph transformation, if necessary.       */\n  /*                                                                       */\n  /*    glyph_hints       :: Format-specific glyph hints management.       */\n  /*                                                                       */\n\n#define FT_GLYPH_OWN_BITMAP  0x1\n\n  typedef struct  FT_Slot_InternalRec_\n  {\n    FT_GlyphLoader  loader;\n    FT_UInt         flags;\n    FT_Bool         glyph_transformed;\n    FT_Matrix       glyph_matrix;\n    FT_Vector       glyph_delta;\n    void*           glyph_hints;\n\n  } FT_GlyphSlot_InternalRec;\n\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Size        */\n  /*    object.  Currently, it's empty.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  typedef struct  FT_Size_InternalRec_\n  {\n    /* empty */\n\n  } FT_Size_InternalRec;\n\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                         M O D U L E S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ModuleRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A module object instance.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    clazz   :: A pointer to the module's class.                        */\n  /*                                                                       */\n  /*    library :: A handle to the parent library object.                  */\n  /*                                                                       */\n  /*    memory  :: A handle to the memory manager.                         */\n  /*                                                                       */\n  typedef struct  FT_ModuleRec_\n  {\n    FT_Module_Class*  clazz;\n    FT_Library        library;\n    FT_Memory         memory;\n\n  } FT_ModuleRec;\n\n\n  /* typecast an object to an FT_Module */\n#define FT_MODULE( x )          ((FT_Module)( x ))\n#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz\n#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library\n#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory\n\n\n#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_FONT_DRIVER )\n\n#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_RENDERER )\n\n#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_HINTER )\n\n#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_STYLER )\n\n#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_DRIVER_SCALABLE )\n\n#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \\\n                                         FT_MODULE_DRIVER_NO_OUTLINES )\n\n#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                     FT_MODULE_DRIVER_HAS_HINTER )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module_Interface                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finds a module and returns its specific interface as a typeless    */\n  /*    pointer.                                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module-specific interface if available, 0 otherwise.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should better be familiar with FreeType internals to know      */\n  /*    which module to look for, and what its interface is :-)            */\n  /*                                                                       */\n  FT_BASE( const void* )\n  FT_Get_Module_Interface( FT_Library   library,\n                           const char*  mod_name );\n\n  FT_BASE( FT_Pointer )\n  ft_module_get_service( FT_Module    module,\n                         const char*  service_id );\n\n  /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****   F A C E,   S I Z E   &   G L Y P H   S L O T   O B J E C T S  ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* a few macros used to perform easy typecasts with minimal brain damage */\n\n#define FT_FACE( x )          ((FT_Face)(x))\n#define FT_SIZE( x )          ((FT_Size)(x))\n#define FT_SLOT( x )          ((FT_GlyphSlot)(x))\n\n#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver\n#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library\n#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory\n#define FT_FACE_STREAM( x )   FT_FACE( x )->stream\n\n#define FT_SIZE_FACE( x )     FT_SIZE( x )->face\n#define FT_SLOT_FACE( x )     FT_SLOT( x )->face\n\n#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph\n#define FT_FACE_SIZE( x )     FT_FACE( x )->size\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_GlyphSlot                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    It is sometimes useful to have more than one glyph slot for a      */\n  /*    given face object.  This function is used to create additional     */\n  /*    slots.  All of them are automatically discarded when the face is   */\n  /*    destroyed.                                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to a parent face object.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aslot :: A handle to a new glyph slot object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_New_GlyphSlot( FT_Face        face,\n                    FT_GlyphSlot  *aslot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_GlyphSlot                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given glyph slot.  Remember however that all slots are  */\n  /*    automatically destroyed with its parent.  Using this function is   */\n  /*    not always mandatory.                                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: A handle to a target glyph slot.                           */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_GlyphSlot( FT_GlyphSlot  slot );\n\n /* */\n\n#define FT_REQUEST_WIDTH( req )                                            \\\n          ( (req)->horiResolution                                          \\\n              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \\\n              : (req)->width )\n\n#define FT_REQUEST_HEIGHT( req )                                            \\\n          ( (req)->vertResolution                                           \\\n              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \\\n              : (req)->height )\n\n\n  /* Set the metrics according to a bitmap strike. */\n  FT_BASE( void )\n  FT_Select_Metrics( FT_Face   face,\n                     FT_ULong  strike_index );\n\n\n  /* Set the metrics according to a size request. */\n  FT_BASE( void )\n  FT_Request_Metrics( FT_Face          face,\n                      FT_Size_Request  req );\n\n\n  /* Match a size request against `available_sizes'. */\n  FT_BASE( FT_Error )\n  FT_Match_Size( FT_Face          face,\n                 FT_Size_Request  req,\n                 FT_Bool          ignore_width,\n                 FT_ULong*        size_index );\n\n\n  /* Use the horizontal metrics to synthesize the vertical metrics. */\n  /* If `advance' is zero, it is also synthesized.                  */\n  FT_BASE( void )\n  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,\n                                  FT_Pos             advance );\n\n\n  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */\n  /* was allocated with ft_glyphslot_alloc_bitmap).                       */\n  FT_BASE( void )\n  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );\n\n\n  /* Allocate a new bitmap buffer in a glyph slot. */\n  FT_BASE( FT_Error )\n  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,\n                             FT_ULong      size );\n\n\n  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */\n  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */\n  FT_BASE( void )\n  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,\n                           FT_Byte*      buffer );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                        R E N D E R E R S                        ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#define FT_RENDERER( x )      ((FT_Renderer)( x ))\n#define FT_GLYPH( x )         ((FT_Glyph)( x ))\n#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))\n#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))\n\n\n  typedef struct  FT_RendererRec_\n  {\n    FT_ModuleRec            root;\n    FT_Renderer_Class*      clazz;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_Class          glyph_class;\n\n    FT_Raster               raster;\n    FT_Raster_Render_Func   raster_render;\n    FT_Renderer_RenderFunc  render;\n\n  } FT_RendererRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    F O N T   D R I V E R S                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* typecast a module into a driver easily */\n#define FT_DRIVER( x )        ((FT_Driver)(x))\n\n  /* typecast a module as a driver, and get its driver class */\n#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_DriverRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root font driver class.  A font driver is responsible for      */\n  /*    managing and loading font files of a given format.                 */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     root         :: Contains the fields of the root module class.     */\n  /*                                                                       */\n  /*     clazz        :: A pointer to the font driver's class.  Note that  */\n  /*                     this is NOT root.clazz.  `class' wasn't used      */\n  /*                     as it is a reserved word in C++.                  */\n  /*                                                                       */\n  /*     faces_list   :: The list of faces currently opened by this        */\n  /*                     driver.                                           */\n  /*                                                                       */\n  /*     glyph_loader :: The glyph loader for all faces managed by this    */\n  /*                     driver.  This object isn't defined for unscalable */\n  /*                     formats.                                          */\n  /*                                                                       */\n  typedef struct  FT_DriverRec_\n  {\n    FT_ModuleRec     root;\n    FT_Driver_Class  clazz;\n    FT_ListRec       faces_list;\n    FT_GlyphLoader   glyph_loader;\n\n  } FT_DriverRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       L I B R A R I E S                         ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* This hook is used by the TrueType debugger.  It must be set to an */\n  /* alternate truetype bytecode interpreter function.                 */\n#define FT_DEBUG_HOOK_TRUETYPE            0\n\n\n  /* Set this debug hook to a non-null pointer to force unpatented hinting */\n  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */\n  /* during debugging.                                                     */\n#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1\n\n\n  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,\n                                            FT_Render_Mode  render_mode,\n                                            FT_Library      library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_LibraryRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType library class.  This is the root of all FreeType      */\n  /*    data.  Use FT_New_Library() to create a library object, and        */\n  /*    FT_Done_Library() to discard it and all child objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory           :: The library's memory object.  Manages memory   */\n  /*                        allocation.                                    */\n  /*                                                                       */\n  /*    version_major    :: The major version number of the library.       */\n  /*                                                                       */\n  /*    version_minor    :: The minor version number of the library.       */\n  /*                                                                       */\n  /*    version_patch    :: The current patch level of the library.        */\n  /*                                                                       */\n  /*    num_modules      :: The number of modules currently registered     */\n  /*                        within this library.  This is set to 0 for new */\n  /*                        libraries.  New modules are added through the  */\n  /*                        FT_Add_Module() API function.                  */\n  /*                                                                       */\n  /*    modules          :: A table used to store handles to the currently */\n  /*                        registered modules. Note that each font driver */\n  /*                        contains a list of its opened faces.           */\n  /*                                                                       */\n  /*    renderers        :: The list of renderers currently registered     */\n  /*                        within the library.                            */\n  /*                                                                       */\n  /*    cur_renderer     :: The current outline renderer.  This is a       */\n  /*                        shortcut used to avoid parsing the list on     */\n  /*                        each call to FT_Outline_Render().  It is a     */\n  /*                        handle to the current renderer for the         */\n  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */\n  /*                                                                       */\n  /*    auto_hinter      :: XXX                                            */\n  /*                                                                       */\n  /*    raster_pool      :: The raster object's render pool.  This can     */\n  /*                        ideally be changed dynamically at run-time.    */\n  /*                                                                       */\n  /*    raster_pool_size :: The size of the render pool in bytes.          */\n  /*                                                                       */\n  /*    debug_hooks      :: XXX                                            */\n  /*                                                                       */\n  /*    lcd_filter       :: If subpixel rendering is activated, the        */\n  /*                        selected LCD filter mode.                      */\n  /*                                                                       */\n  /*    lcd_extra        :: If subpixel rendering is activated, the number */\n  /*                        of extra pixels needed for the LCD filter.     */\n  /*                                                                       */\n  /*    lcd_weights      :: If subpixel rendering is activated, the LCD    */\n  /*                        filter weights, if any.                        */\n  /*                                                                       */\n  /*    lcd_filter_func  :: If subpixel rendering is activated, the LCD    */\n  /*                        filtering callback function.                   */\n  /*                                                                       */\n  /*    pic_container    :: Contains global structs and tables, instead    */\n  /*                        of defining them globallly.                    */\n  /*                                                                       */\n  /*    refcount         :: A counter initialized to~1 at the time an      */\n  /*                        @FT_Library structure is created.              */\n  /*                        @FT_Reference_Library increments this counter, */\n  /*                        and @FT_Done_Library only destroys a library   */\n  /*                        if the counter is~1, otherwise it simply       */\n  /*                        decrements it.                                 */\n  /*                                                                       */\n  typedef struct  FT_LibraryRec_\n  {\n    FT_Memory          memory;           /* library's memory manager */\n\n    FT_Int             version_major;\n    FT_Int             version_minor;\n    FT_Int             version_patch;\n\n    FT_UInt            num_modules;\n    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */\n\n    FT_ListRec         renderers;        /* list of renderers        */\n    FT_Renderer        cur_renderer;     /* current outline renderer */\n    FT_Module          auto_hinter;\n\n    FT_Byte*           raster_pool;      /* scan-line conversion */\n                                         /* render pool          */\n    FT_ULong           raster_pool_size; /* size of render pool in bytes */\n\n    FT_DebugHook_Func  debug_hooks[4];\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n    FT_LcdFilter             lcd_filter;\n    FT_Int                   lcd_extra;        /* number of extra pixels */\n    FT_Byte                  lcd_weights[7];   /* filter weights, if any */\n    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */\n#endif\n\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_PIC_Container   pic_container;\n#endif\n\n    FT_Int             refcount;\n\n  } FT_LibraryRec;\n\n\n  FT_BASE( FT_Renderer )\n  FT_Lookup_Renderer( FT_Library       library,\n                      FT_Glyph_Format  format,\n                      FT_ListNode*     node );\n\n  FT_BASE( FT_Error )\n  FT_Render_Glyph_Internal( FT_Library      library,\n                            FT_GlyphSlot    slot,\n                            FT_Render_Mode  render_mode );\n\n  typedef const char*\n  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,\n                                    FT_String*  glyph_name );\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new memory object.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the new memory object.  0 in case of error.           */\n  /*                                                                       */\n  FT_BASE( FT_Memory )\n  FT_New_Memory( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Memory                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discards memory manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_Memory( FT_Memory  memory );\n\n#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* Define default raster's interface.  The default raster is located in  */\n  /* `src/base/ftraster.c'.                                                */\n  /*                                                                       */\n  /* Client applications can register new rasters through the              */\n  /* FT_Set_Raster() API.                                                  */\n\n#ifndef FT_NO_DEFAULT_RASTER\n  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                      P I C   S U P P O R T                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* PIC support macros for ftimage.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_OUTLINE_FUNCS                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Outline_Funcs struct.         */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_OUTLINE_FUNCS(           \\\n          class_,                          \\\n          move_to_,                        \\\n          line_to_,                        \\\n          conic_to_,                       \\\n          cubic_to_,                       \\\n          shift_,                          \\\n          delta_ )                         \\\n  static const  FT_Outline_Funcs class_ =  \\\n  {                                        \\\n    move_to_,                              \\\n    line_to_,                              \\\n    conic_to_,                             \\\n    cubic_to_,                             \\\n    shift_,                                \\\n    delta_                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_OUTLINE_FUNCS(                     \\\n          class_,                                    \\\n          move_to_,                                  \\\n          line_to_,                                  \\\n          conic_to_,                                 \\\n          cubic_to_,                                 \\\n          shift_,                                    \\\n          delta_ )                                   \\\n  static FT_Error                                    \\\n  Init_Class_ ## class_( FT_Outline_Funcs*  clazz )  \\\n  {                                                  \\\n    clazz->move_to  = move_to_;                      \\\n    clazz->line_to  = line_to_;                      \\\n    clazz->conic_to = conic_to_;                     \\\n    clazz->cubic_to = cubic_to_;                     \\\n    clazz->shift    = shift_;                        \\\n    clazz->delta    = delta_;                        \\\n                                                     \\\n    return FT_Err_Ok;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RASTER_FUNCS                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Raster_Funcs struct.          */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_RASTER_FUNCS(    \\\n          class_,                  \\\n          glyph_format_,           \\\n          raster_new_,             \\\n          raster_reset_,           \\\n          raster_set_mode_,        \\\n          raster_render_,          \\\n          raster_done_ )           \\\n  const FT_Raster_Funcs  class_ =  \\\n  {                                \\\n    glyph_format_,                 \\\n    raster_new_,                   \\\n    raster_reset_,                 \\\n    raster_set_mode_,              \\\n    raster_render_,                \\\n    raster_done_                   \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_RASTER_FUNCS(                        \\\n          class_,                                      \\\n          glyph_format_,                               \\\n          raster_new_,                                 \\\n          raster_reset_,                               \\\n          raster_set_mode_,                            \\\n          raster_render_,                              \\\n          raster_done_ )                               \\\n  void                                                 \\\n  FT_Init_Class_ ## class_( FT_Raster_Funcs*  clazz )  \\\n  {                                                    \\\n    clazz->glyph_format    = glyph_format_;            \\\n    clazz->raster_new      = raster_new_;              \\\n    clazz->raster_reset    = raster_reset_;            \\\n    clazz->raster_set_mode = raster_set_mode_;         \\\n    clazz->raster_render   = raster_render_;           \\\n    clazz->raster_done     = raster_done_;             \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftrender.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_GLYPH                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Glyph_Class struct.           */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated stcture to be filled.               */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_GLYPH(          \\\n          class_,                 \\\n          size_,                  \\\n          format_,                \\\n          init_,                  \\\n          done_,                  \\\n          copy_,                  \\\n          transform_,             \\\n          bbox_,                  \\\n          prepare_ )              \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Glyph_Class  class_ =  \\\n  {                               \\\n    size_,                        \\\n    format_,                      \\\n    init_,                        \\\n    done_,                        \\\n    copy_,                        \\\n    transform_,                   \\\n    bbox_,                        \\\n    prepare_                      \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_GLYPH(                              \\\n          class_,                                     \\\n          size_,                                      \\\n          format_,                                    \\\n          init_,                                      \\\n          done_,                                      \\\n          copy_,                                      \\\n          transform_,                                 \\\n          bbox_,                                      \\\n          prepare_ )                                  \\\n  void                                                \\\n  FT_Init_Class_ ## class_( FT_Glyph_Class*  clazz )  \\\n  {                                                   \\\n    clazz->glyph_size      = size_;                   \\\n    clazz->glyph_format    = format_;                 \\\n    clazz->glyph_init      = init_;                   \\\n    clazz->glyph_done      = done_;                   \\\n    clazz->glyph_copy      = copy_;                   \\\n    clazz->glyph_transform = transform_;              \\\n    clazz->glyph_bbox      = bbox_;                   \\\n    clazz->glyph_prepare   = prepare_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_RENDERER                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Renderer_Class struct instance.                                 */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RENDERER                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Renderer_Class struct.        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need  */\n  /*    to be called with a pointer where the allocated structure is       */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the renderer definition calling `FT_DEFINE_RENDERER' in the     */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_RENDERER( class_ )               \\\n  FT_EXPORT_VAR( const FT_Renderer_Class ) class_;\n\n#define FT_DEFINE_RENDERER(                  \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          glyph_format_,                     \\\n          render_glyph_,                     \\\n          transform_glyph_,                  \\\n          get_glyph_cbox_,                   \\\n          set_mode_,                         \\\n          raster_class_ )                    \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Renderer_Class  class_ =          \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n    glyph_format_,                           \\\n                                             \\\n    render_glyph_,                           \\\n    transform_glyph_,                        \\\n    get_glyph_cbox_,                         \\\n    set_mode_,                               \\\n                                             \\\n    raster_class_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_RENDERER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_RENDERER(                                      \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          glyph_format_,                                         \\\n          render_glyph_,                                         \\\n          transform_glyph_,                                      \\\n          get_glyph_cbox_,                                       \\\n          set_mode_,                                             \\\n          raster_class_ )                                        \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Renderer_Class*  rclazz = (FT_Renderer_Class*)clazz;      \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( rclazz )                                                \\\n      FT_FREE( rclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Renderer_Class*  clazz = NULL;                            \\\n    FT_Error            error;                                   \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->glyph_format    = glyph_format_;                      \\\n                                                                 \\\n    clazz->render_glyph    = render_glyph_;                      \\\n    clazz->transform_glyph = transform_glyph_;                   \\\n    clazz->get_glyph_cbox  = get_glyph_cbox_;                    \\\n    clazz->set_mode        = set_mode_;                          \\\n                                                                 \\\n    clazz->raster_class    = raster_class_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftmodapi.h **/\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Creator                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create (allocate) a new module class object.    */\n  /*    The object's members are initialized, but the module itself is     */\n  /*    not.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory       :: A handle to the memory manager.                    */\n  /*    output_class :: Initialized with the newly allocated class.        */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Creator)( FT_Memory          memory,\n                        FT_Module_Class**  output_class );\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destroyer                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy (deallocate) a module class object.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*    clazz  :: Module class to destroy.                                 */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destroyer)( FT_Memory         memory,\n                          FT_Module_Class*  clazz );\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_MODULE                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Module_Class struct instance.                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_MODULE                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to   */\n  /*    be called with a pointer where the allocated structure is          */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the module definition calling `FT_DEFINE_MODULE' in the         */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_ROOT_MODULE                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct inside */\n  /*    another struct that contains it or in a function that initializes  */\n  /*    that containing struct.                                            */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_MODULE( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Module_Class  class_;\n\n#define FT_DEFINE_ROOT_MODULE(  \\\n          flags_,               \\\n          size_,                \\\n          name_,                \\\n          version_,             \\\n          requires_,            \\\n          interface_,           \\\n          init_,                \\\n          done_,                \\\n          get_interface_ )      \\\n  {                             \\\n    flags_,                     \\\n    size_,                      \\\n                                \\\n    name_,                      \\\n    version_,                   \\\n    requires_,                  \\\n                                \\\n    interface_,                 \\\n                                \\\n    init_,                      \\\n    done_,                      \\\n    get_interface_,             \\\n  },\n\n#define FT_DEFINE_MODULE(         \\\n          class_,                 \\\n          flags_,                 \\\n          size_,                  \\\n          name_,                  \\\n          version_,               \\\n          requires_,              \\\n          interface_,             \\\n          init_,                  \\\n          done_,                  \\\n          get_interface_ )        \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Module_Class class_ =  \\\n  {                               \\\n    flags_,                       \\\n    size_,                        \\\n                                  \\\n    name_,                        \\\n    version_,                     \\\n    requires_,                    \\\n                                  \\\n    interface_,                   \\\n                                  \\\n    init_,                        \\\n    done_,                        \\\n    get_interface_,               \\\n  };\n\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_MODULE( class_ )                               \\\n  FT_Error                                                        \\\n  FT_Create_Class_ ## class_( FT_Library         library,         \\\n                              FT_Module_Class**  output_class );  \\\n  void                                                            \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,         \\\n                               FT_Module_Class*  clazz );\n\n#define FT_DEFINE_ROOT_MODULE(                      \\\n          flags_,                                   \\\n          size_,                                    \\\n          name_,                                    \\\n          version_,                                 \\\n          requires_,                                \\\n          interface_,                               \\\n          init_,                                    \\\n          done_,                                    \\\n          get_interface_ )                          \\\n    clazz->root.module_flags     = flags_;          \\\n    clazz->root.module_size      = size_;           \\\n    clazz->root.module_name      = name_;           \\\n    clazz->root.module_version   = version_;        \\\n    clazz->root.module_requires  = requires_;       \\\n                                                    \\\n    clazz->root.module_interface = interface_;      \\\n                                                    \\\n    clazz->root.module_init      = init_;           \\\n    clazz->root.module_done      = done_;           \\\n    clazz->root.get_interface    = get_interface_;\n\n#define FT_DEFINE_MODULE(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_ )                                       \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory memory = library->memory;                          \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( clazz )                                                 \\\n      FT_FREE( clazz );                                          \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Memory         memory = library->memory;                  \\\n    FT_Module_Class*  clazz  = NULL;                             \\\n    FT_Error          error;                                     \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    clazz->module_flags     = flags_;                            \\\n    clazz->module_size      = size_;                             \\\n    clazz->module_name      = name_;                             \\\n    clazz->module_version   = version_;                          \\\n    clazz->module_requires  = requires_;                         \\\n                                                                 \\\n    clazz->module_interface = interface_;                        \\\n                                                                 \\\n    clazz->module_init      = init_;                             \\\n    clazz->module_done      = done_;                             \\\n    clazz->get_interface    = get_interface_;                    \\\n                                                                 \\\n    *output_class = clazz;                                       \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\nFT_END_HEADER\n\n#endif /* __FTOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services (declaration).       */\n/*                                                                         */\n/*  Copyright 2009, 2012 by                                                */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Modules that ordinarily have const global data that need address     */\n  /*  can instead define pointers here.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTPIC_H__\n#define __FTPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  typedef struct  FT_PIC_Container_\n  {\n    /* pic containers for base */\n    void*  base;\n\n    /* pic containers for modules */\n    void*  autofit;\n    void*  cff;\n    void*  pshinter;\n    void*  psnames;\n    void*  raster;\n    void*  sfnt;\n    void*  smooth;\n    void*  truetype;\n\n  } FT_PIC_Container;\n\n\n  /* Initialize the various function tables, structs, etc. */\n  /* stored in the container.                              */\n  FT_BASE( FT_Error )\n  ft_pic_container_init( FT_Library  library );\n\n\n  /* Destroy the contents of the container. */\n  FT_BASE( void )\n  ft_pic_container_destroy( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftrfork.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrfork.h                                                              */\n/*                                                                         */\n/*    Embedded resource forks accessor (specification).                    */\n/*                                                                         */\n/*  Copyright 2004, 2006, 2007, 2012 by                                    */\n/*  Masatake YAMATO and Redhat K.K.                                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/* Development of the code in this file is support of                      */\n/* Information-technology Promotion Agency, Japan.                         */\n/***************************************************************************/\n\n\n#ifndef __FTRFORK_H__\n#define __FTRFORK_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* Number of guessing rules supported in `FT_Raccess_Guess'.            */\n  /* Don't forget to increment the number if you add a new guessing rule. */\n#define FT_RACCESS_N_RULES  9\n\n\n  /* A structure to describe a reference in a resource by its resource ID */\n  /* and internal offset.  The `POST' resource expects to be concatenated */\n  /* by the order of resource IDs instead of its appearance in the file.  */\n\n  typedef struct  FT_RFork_Ref_\n  {\n    FT_UShort  res_id;\n    FT_ULong   offset;\n\n  } FT_RFork_Ref;\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n  typedef FT_Error\n  (*ft_raccess_guess_func)( FT_Library  library,\n                            FT_Stream   stream,\n                            char       *base_file_name,\n                            char      **result_file_name,\n                            FT_Long    *result_offset );\n\n  typedef enum  FT_RFork_Rule_ {\n    FT_RFork_Rule_invalid = -2,\n    FT_RFork_Rule_uknown, /* -1 */\n    FT_RFork_Rule_apple_double,\n    FT_RFork_Rule_apple_single,\n    FT_RFork_Rule_darwin_ufs_export,\n    FT_RFork_Rule_darwin_newvfs,\n    FT_RFork_Rule_darwin_hfsplus,\n    FT_RFork_Rule_vfat,\n    FT_RFork_Rule_linux_cap,\n    FT_RFork_Rule_linux_double,\n    FT_RFork_Rule_linux_netatalk\n  } FT_RFork_Rule;\n\n  /* For fast translation between rule index and rule type,\n   * the macros FT_RFORK_xxx should be kept consistent with\n   * the raccess_guess_funcs table\n   */\n  typedef struct ft_raccess_guess_rec_ {\n    ft_raccess_guess_func  func;\n    FT_RFork_Rule          type;\n  } ft_raccess_guess_rec;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n  /* this array is a storage in non-PIC mode, so ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          const type name[] = {\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          { raccess_guess_ ## func_suffix,                           \\\n            FT_RFork_Rule_ ## type_suffix },\n#define CONST_FT_RFORK_RULE_ARRAY_END  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  /* this array is a function in PIC mode, so no ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          void                                         \\\n          FT_Init_ ## name( type*  storage )           \\\n          {                                            \\\n            type*  local = storage;                    \\\n                                                       \\\n                                                       \\\n            int  i = 0;\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          local[i].func = raccess_guess_ ## func_suffix;             \\\n          local[i].type = FT_RFork_Rule_ ## type_suffix;             \\\n          i++;\n#define CONST_FT_RFORK_RULE_ARRAY_END  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Guess                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Guess a file name and offset where the actual resource fork is     */\n  /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */\n  /*    guessing rules;  the guessed result for the Nth rule is            */\n  /*    represented as a triplet: a new file name (new_names[N]), a file   */\n  /*    offset (offsets[N]), and an error code (errors[N]).                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    base_name ::                                                       */\n  /*      The (base) file name of the resource fork used for some          */\n  /*      guessing rules.                                                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    new_names ::                                                       */\n  /*      An array of guessed file names in which the resource forks may   */\n  /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */\n  /*      equal to `base_name'.                                            */\n  /*                                                                       */\n  /*    offsets ::                                                         */\n  /*      An array of guessed file offsets.  `offsets[N]' holds the file   */\n  /*      offset of the possible start of the resource fork in file        */\n  /*      `new_names[N]'.                                                  */\n  /*                                                                       */\n  /*    errors ::                                                          */\n  /*      An array of FreeType error codes.  `errors[N]' is the error      */\n  /*      code of Nth guessing rule function.  If `errors[N]' is not       */\n  /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Raccess_Guess( FT_Library  library,\n                    FT_Stream   stream,\n                    char*       base_name,\n                    char**      new_names,\n                    FT_Long*    offsets,\n                    FT_Error*   errors );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_HeaderInfo                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the information from the header of resource fork.  The         */\n  /*    information includes the file offset where the resource map        */\n  /*    starts, and the file offset where the resource data starts.        */\n  /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    rfork_offset ::                                                    */\n  /*      The file offset where the resource fork starts.                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_HeaderInfo( FT_Library  library,\n                             FT_Stream   stream,\n                             FT_Long     rfork_offset,\n                             FT_Long    *map_offset,\n                             FT_Long    *rdata_pos );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_DataOffsets                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the data offsets for a tag in a resource fork.  Offsets are    */\n  /*    stored in an array because, in some cases, resources in a resource */\n  /*    fork have the same tag.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /*    tag ::                                                             */\n  /*      The resource tag.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    offsets ::                                                         */\n  /*      The stream offsets for the resource data specified by `tag'.     */\n  /*      This array is allocated by the function, so you have to call     */\n  /*      @ft_mem_free after use.                                          */\n  /*                                                                       */\n  /*    count ::                                                           */\n  /*      The length of offsets array.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */\n  /*    value for `map_offset' and `rdata_pos'.                            */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_DataOffsets( FT_Library  library,\n                              FT_Stream   stream,\n                              FT_Long     map_offset,\n                              FT_Long     rdata_pos,\n                              FT_Long     tag,\n                              FT_Long   **offsets,\n                              FT_Long    *count );\n\n\nFT_END_HEADER\n\n#endif /* __FTRFORK_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftserv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftserv.h                                                               */\n/*                                                                         */\n/*    The FreeType services (specification only).                          */\n/*                                                                         */\n/*  Copyright 2003-2007, 2009, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Each module can export one or more `services'.  Each service is      */\n  /*  identified by a constant string and modeled by a pointer; the latter */\n  /*  generally corresponds to a structure containing function pointers.   */\n  /*                                                                       */\n  /*  Note that a service's data cannot be a mere function pointer because */\n  /*  in C it is possible that function pointers might be implemented      */\n  /*  differently than data pointers (e.g. 48 bits instead of 32).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSERV_H__\n#define __FTSERV_H__\n\n\nFT_BEGIN_HEADER\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from a face's driver module.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );             \\\n    FT_Pointer   _tmp_  = NULL;                                             \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                              \\\n                                                                            \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                                        \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );              \\\n    FT_Pointer  _tmp_  = NULL;                                              \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    ptr = _tmp_;                                                            \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_GLOBAL_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from all modules.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );    \\\n    FT_Pointer   _tmp_;                                            \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                     \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );     \\\n    FT_Pointer  _tmp_;                                             \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    ptr   = _tmp_;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****         S E R V I C E   D E S C R I P T O R S                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  The following structure is used to _describe_ a given service\n   *  to the library.  This is useful to build simple static service lists.\n   */\n  typedef struct  FT_ServiceDescRec_\n  {\n    const char*  serv_id;     /* service name         */\n    const void*  serv_data;   /* service pointer/data */\n\n  } FT_ServiceDescRec;\n\n  typedef const FT_ServiceDescRec*  FT_ServiceDesc;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_SERVICEDESCREC1                                          */\n  /*    FT_DEFINE_SERVICEDESCREC2                                          */\n  /*    FT_DEFINE_SERVICEDESCREC3                                          */\n  /*    FT_DEFINE_SERVICEDESCREC4                                          */\n  /*    FT_DEFINE_SERVICEDESCREC5                                          */\n  /*    FT_DEFINE_SERVICEDESCREC6                                          */\n  /*    FT_DEFINE_SERVICEDESCREC7                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an array of FT_ServiceDescRec structures.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function needs to  */\n  /*    be called with a pointer to return an allocated array.  As soon as */\n  /*    it is no longer needed, a `destroy' function needs to be called to */\n  /*    release that allocation.                                           */\n  /*                                                                       */\n  /*    These functions should be manually called from the `pic_init' and  */\n  /*    `pic_free' functions of your module (see FT_DEFINE_MODULE).        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the array will be         */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { serv_id_7, serv_data_7 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = NULL;                                              \\\n    clazz[1].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = NULL;                                              \\\n    clazz[2].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = NULL;                                              \\\n    clazz[3].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = NULL;                                              \\\n    clazz[4].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = NULL;                                              \\\n    clazz[5].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = NULL;                                              \\\n    clazz[6].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = serv_id_7;                                         \\\n    clazz[6].serv_data = serv_data_7;                                       \\\n    clazz[7].serv_id   = NULL;                                              \\\n    clazz[7].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*\n   *  Parse a list of FT_ServiceDescRec descriptors and look for\n   *  a specific service by ID.  Note that the last element in the\n   *  array must be { NULL, NULL }, and that the function should\n   *  return NULL if the service isn't available.\n   *\n   *  This function can be used by modules to implement their\n   *  `get_service' method.\n   */\n  FT_BASE( FT_Pointer )\n  ft_service_list_lookup( FT_ServiceDesc  service_descriptors,\n                          const char*     service_id );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****             S E R V I C E S   C A C H E                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  This structure is used to store a cache for several frequently used\n   *  services.  It is the type of `face->internal->services'.  You\n   *  should only use FT_FACE_LOOKUP_SERVICE to access it.\n   *\n   *  All fields should have the type FT_Pointer to relax compilation\n   *  dependencies.  We assume the developer isn't completely stupid.\n   *\n   *  Each field must be named `service_XXXX' where `XXX' corresponds to\n   *  the correct FT_SERVICE_ID_XXXX macro.  See the definition of\n   *  FT_FACE_LOOKUP_SERVICE below how this is implemented.\n   *\n   */\n  typedef struct  FT_ServiceCacheRec_\n  {\n    FT_Pointer  service_POSTSCRIPT_FONT_NAME;\n    FT_Pointer  service_MULTI_MASTERS;\n    FT_Pointer  service_GLYPH_DICT;\n    FT_Pointer  service_PFR_METRICS;\n    FT_Pointer  service_WINFNT;\n\n  } FT_ServiceCacheRec, *FT_ServiceCache;\n\n\n  /*\n   *  A magic number used within the services cache.\n   */\n\n  /* ensure that value `1' has the same width as a pointer */\n#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)~(FT_PtrDist)1)\n\n\n  /*\n   * @macro:\n   *   FT_FACE_LOOKUP_SERVICE\n   *\n   * @description:\n   *   This macro is used to lookup a service from a face's driver module\n   *   using its cache.\n   *\n   * @input:\n   *   face::\n   *     The source face handle containing the cache.\n   *\n   *   field ::\n   *     The field name in the cache.\n   *\n   *   id ::\n   *     The service ID.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable receiving the service data.  NULL if not available.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer   svc;                                          \\\n    FT_Pointer*  Pptr = (FT_Pointer*)&(ptr);                   \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    *Pptr = svc;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer  svc;                                           \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    ptr = svc;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n  /*\n   *  A macro used to define new service structure types.\n   */\n\n#define FT_DEFINE_SERVICE( name )            \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    FT_Service_ ## name ## Rec ;             \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    const * FT_Service_ ## name ;            \\\n  struct FT_Service_ ## name ## Rec_\n\n  /* */\n\n  /*\n   *  The header files containing the services.\n   */\n\n#define FT_SERVICE_BDF_H                <freetype/internal/services/svbdf.h>\n#define FT_SERVICE_CID_H                <freetype/internal/services/svcid.h>\n#define FT_SERVICE_GLYPH_DICT_H         <freetype/internal/services/svgldict.h>\n#define FT_SERVICE_GX_VALIDATE_H        <freetype/internal/services/svgxval.h>\n#define FT_SERVICE_KERNING_H            <freetype/internal/services/svkern.h>\n#define FT_SERVICE_MULTIPLE_MASTERS_H   <freetype/internal/services/svmm.h>\n#define FT_SERVICE_OPENTYPE_VALIDATE_H  <freetype/internal/services/svotval.h>\n#define FT_SERVICE_PFR_H                <freetype/internal/services/svpfr.h>\n#define FT_SERVICE_POSTSCRIPT_CMAPS_H   <freetype/internal/services/svpscmap.h>\n#define FT_SERVICE_POSTSCRIPT_INFO_H    <freetype/internal/services/svpsinfo.h>\n#define FT_SERVICE_POSTSCRIPT_NAME_H    <freetype/internal/services/svpostnm.h>\n#define FT_SERVICE_PROPERTIES_H         <freetype/internal/services/svprop.h>\n#define FT_SERVICE_SFNT_H               <freetype/internal/services/svsfnt.h>\n#define FT_SERVICE_TRUETYPE_ENGINE_H    <freetype/internal/services/svtteng.h>\n#define FT_SERVICE_TT_CMAP_H            <freetype/internal/services/svttcmap.h>\n#define FT_SERVICE_WINFNT_H             <freetype/internal/services/svwinfnt.h>\n#define FT_SERVICE_XFREE86_NAME_H       <freetype/internal/services/svxf86nm.h>\n#define FT_SERVICE_TRUETYPE_GLYF_H      <freetype/internal/services/svttglyf.h>\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTSERV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftstream.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstream.h                                                             */\n/*                                                                         */\n/*    Stream handling (specification).                                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2006, 2011, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSTREAM_H__\n#define __FTSTREAM_H__\n\n\n#include <ft2build.h>\n#include FT_SYSTEM_H\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* format of an 8-bit frame_op value:           */\n  /*                                              */\n  /* bit  76543210                                */\n  /*      xxxxxxes                                */\n  /*                                              */\n  /* s is set to 1 if the value is signed.        */\n  /* e is set to 1 if the value is little-endian. */\n  /* xxx is a command.                            */\n\n#define FT_FRAME_OP_SHIFT         2\n#define FT_FRAME_OP_SIGNED        1\n#define FT_FRAME_OP_LITTLE        2\n#define FT_FRAME_OP_COMMAND( x )  ( x >> FT_FRAME_OP_SHIFT )\n\n#define FT_MAKE_FRAME_OP( command, little, sign ) \\\n          ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )\n\n#define FT_FRAME_OP_END    0\n#define FT_FRAME_OP_START  1  /* start a new frame     */\n#define FT_FRAME_OP_BYTE   2  /* read 1-byte value     */\n#define FT_FRAME_OP_SHORT  3  /* read 2-byte value     */\n#define FT_FRAME_OP_LONG   4  /* read 4-byte value     */\n#define FT_FRAME_OP_OFF3   5  /* read 3-byte value     */\n#define FT_FRAME_OP_BYTES  6  /* read a bytes sequence */\n\n\n  typedef enum  FT_Frame_Op_\n  {\n    ft_frame_end       = 0,\n    ft_frame_start     = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),\n\n    ft_frame_byte      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 0 ),\n    ft_frame_schar     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 1 ),\n\n    ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),\n    ft_frame_short_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),\n    ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),\n    ft_frame_short_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),\n\n    ft_frame_ulong_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),\n    ft_frame_long_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),\n    ft_frame_ulong_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),\n    ft_frame_long_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),\n\n    ft_frame_uoff3_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),\n    ft_frame_off3_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),\n    ft_frame_uoff3_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),\n    ft_frame_off3_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),\n\n    ft_frame_bytes     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),\n    ft_frame_skip      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )\n\n  } FT_Frame_Op;\n\n\n  typedef struct  FT_Frame_Field_\n  {\n    FT_Byte    value;\n    FT_Byte    size;\n    FT_UShort  offset;\n\n  } FT_Frame_Field;\n\n\n  /* Construct an FT_Frame_Field out of a structure type and a field name. */\n  /* The structure type must be set in the FT_STRUCTURE macro before       */\n  /* calling the FT_FRAME_START() macro.                                   */\n  /*                                                                       */\n#define FT_FIELD_SIZE( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )\n\n#define FT_FIELD_SIZE_DELTA( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )\n\n#define FT_FIELD_OFFSET( f ) \\\n          (FT_UShort)( offsetof( FT_STRUCTURE, f ) )\n\n#define FT_FRAME_FIELD( frame_op, field ) \\\n          {                               \\\n            frame_op,                     \\\n            FT_FIELD_SIZE( field ),       \\\n            FT_FIELD_OFFSET( field )      \\\n          }\n\n#define FT_MAKE_EMPTY_FIELD( frame_op )  { frame_op, 0, 0 }\n\n#define FT_FRAME_START( size )   { ft_frame_start, 0, size }\n#define FT_FRAME_END             { ft_frame_end, 0, 0 }\n\n#define FT_FRAME_LONG( f )       FT_FRAME_FIELD( ft_frame_long_be, f )\n#define FT_FRAME_ULONG( f )      FT_FRAME_FIELD( ft_frame_ulong_be, f )\n#define FT_FRAME_SHORT( f )      FT_FRAME_FIELD( ft_frame_short_be, f )\n#define FT_FRAME_USHORT( f )     FT_FRAME_FIELD( ft_frame_ushort_be, f )\n#define FT_FRAME_OFF3( f )       FT_FRAME_FIELD( ft_frame_off3_be, f )\n#define FT_FRAME_UOFF3( f )      FT_FRAME_FIELD( ft_frame_uoff3_be, f )\n#define FT_FRAME_BYTE( f )       FT_FRAME_FIELD( ft_frame_byte, f )\n#define FT_FRAME_CHAR( f )       FT_FRAME_FIELD( ft_frame_schar, f )\n\n#define FT_FRAME_LONG_LE( f )    FT_FRAME_FIELD( ft_frame_long_le, f )\n#define FT_FRAME_ULONG_LE( f )   FT_FRAME_FIELD( ft_frame_ulong_le, f )\n#define FT_FRAME_SHORT_LE( f )   FT_FRAME_FIELD( ft_frame_short_le, f )\n#define FT_FRAME_USHORT_LE( f )  FT_FRAME_FIELD( ft_frame_ushort_le, f )\n#define FT_FRAME_OFF3_LE( f )    FT_FRAME_FIELD( ft_frame_off3_le, f )\n#define FT_FRAME_UOFF3_LE( f )   FT_FRAME_FIELD( ft_frame_uoff3_le, f )\n\n#define FT_FRAME_SKIP_LONG       { ft_frame_long_be, 0, 0 }\n#define FT_FRAME_SKIP_SHORT      { ft_frame_short_be, 0, 0 }\n#define FT_FRAME_SKIP_BYTE       { ft_frame_byte, 0, 0 }\n\n#define FT_FRAME_BYTES( field, count ) \\\n          {                            \\\n            ft_frame_bytes,            \\\n            count,                     \\\n            FT_FIELD_OFFSET( field )   \\\n          }\n\n#define FT_FRAME_SKIP_BYTES( count )  { ft_frame_skip, count, 0 }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */\n  /* type `char*' or equivalent (1-byte elements).                         */\n  /*                                                                       */\n\n#define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )\n\n#define FT_INT16( x )   ( (FT_Int16)(x)  )\n#define FT_UINT16( x )  ( (FT_UInt16)(x) )\n#define FT_INT32( x )   ( (FT_Int32)(x)  )\n#define FT_UINT32( x )  ( (FT_UInt32)(x) )\n\n\n#define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )\n#define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )\n\n\n#define FT_PEEK_SHORT( p )  FT_INT16( FT_BYTE_U16( p, 0, 8) | \\\n                                      FT_BYTE_U16( p, 1, 0) )\n\n#define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \\\n                                        FT_BYTE_U16( p, 1, 0 ) )\n\n#define FT_PEEK_LONG( p )  FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                     FT_BYTE_U32( p, 1, 16 ) | \\\n                                     FT_BYTE_U32( p, 2,  8 ) | \\\n                                     FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                       FT_BYTE_U32( p, 1, 16 ) | \\\n                                       FT_BYTE_U32( p, 2,  8 ) | \\\n                                       FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_OFF3( p )  FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                     FT_BYTE_U32( p, 1,  8 ) | \\\n                                     FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                       FT_BYTE_U32( p, 1,  8 ) | \\\n                                       FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \\\n                                         FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \\\n                                           FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                        FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                          FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n\n#define FT_NEXT_CHAR( buffer )       \\\n          ( (signed char)*buffer++ )\n\n#define FT_NEXT_BYTE( buffer )         \\\n          ( (unsigned char)*buffer++ )\n\n#define FT_NEXT_SHORT( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )\n\n\n#define FT_NEXT_SHORT_LE( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT_LE( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3_LE( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG_LE( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each GET_xxxx() macro uses an implicit `stream' variable.             */\n  /*                                                                       */\n#if 0\n#define FT_GET_MACRO( type )    FT_NEXT_ ## type ( stream->cursor )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( CHAR )\n#define FT_GET_BYTE()       FT_GET_MACRO( BYTE )\n#define FT_GET_SHORT()      FT_GET_MACRO( SHORT )\n#define FT_GET_USHORT()     FT_GET_MACRO( USHORT )\n#define FT_GET_OFF3()       FT_GET_MACRO( OFF3 )\n#define FT_GET_UOFF3()      FT_GET_MACRO( UOFF3 )\n#define FT_GET_LONG()       FT_GET_MACRO( LONG )\n#define FT_GET_ULONG()      FT_GET_MACRO( ULONG )\n#define FT_GET_TAG4()       FT_GET_MACRO( ULONG )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( SHORT_LE )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( USHORT_LE )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( LONG_LE )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( ULONG_LE )\n\n#else\n#define FT_GET_MACRO( func, type )        ( (type)func( stream ) )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )\n#define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )\n#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )\n#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )\n#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )\n#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )\n#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetULong, FT_Long )\n#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )\n#endif\n\n#define FT_READ_MACRO( func, type, var )        \\\n          ( var = (type)func( stream, &error ), \\\n            error != FT_Err_Ok )\n\n#define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )\n#define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )\n#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )\n#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )\n#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )\n#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )\n#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )\n#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )\n\n#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )\n#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )\n#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )\n#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /* initialize a stream for reading a regular system stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Open( FT_Stream    stream,\n                  const char*  filepathname );\n\n#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* create a new (input) stream from an FT_Open_Args structure */\n  FT_BASE( FT_Error )\n  FT_Stream_New( FT_Library           library,\n                 const FT_Open_Args*  args,\n                 FT_Stream           *astream );\n\n  /* free a stream */\n  FT_BASE( void )\n  FT_Stream_Free( FT_Stream  stream,\n                  FT_Int     external );\n\n  /* initialize a stream for reading in-memory data */\n  FT_BASE( void )\n  FT_Stream_OpenMemory( FT_Stream       stream,\n                        const FT_Byte*  base,\n                        FT_ULong        size );\n\n  /* close a stream (does not destroy the stream structure) */\n  FT_BASE( void )\n  FT_Stream_Close( FT_Stream  stream );\n\n\n  /* seek within a stream. position is relative to start of stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Seek( FT_Stream  stream,\n                  FT_ULong   pos );\n\n  /* skip bytes in a stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Skip( FT_Stream  stream,\n                  FT_Long    distance );\n\n  /* return current stream position */\n  FT_BASE( FT_Long )\n  FT_Stream_Pos( FT_Stream  stream );\n\n  /* read bytes from a stream into a user-allocated buffer, returns an */\n  /* error if not all bytes could be read.                             */\n  FT_BASE( FT_Error )\n  FT_Stream_Read( FT_Stream  stream,\n                  FT_Byte*   buffer,\n                  FT_ULong   count );\n\n  /* read bytes from a stream at a given position */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadAt( FT_Stream  stream,\n                    FT_ULong   pos,\n                    FT_Byte*   buffer,\n                    FT_ULong   count );\n\n  /* try to read bytes at the end of a stream; return number of bytes */\n  /* really available                                                 */\n  FT_BASE( FT_ULong )\n  FT_Stream_TryRead( FT_Stream  stream,\n                     FT_Byte*   buffer,\n                     FT_ULong   count );\n\n  /* Enter a frame of `count' consecutive bytes in a stream.  Returns an */\n  /* error if the frame could not be read/accessed.  The caller can use  */\n  /* the FT_Stream_Get_XXX functions to retrieve frame data without      */\n  /* error checks.                                                       */\n  /*                                                                     */\n  /* You must _always_ call FT_Stream_ExitFrame() once you have entered  */\n  /* a stream frame!                                                     */\n  /*                                                                     */\n  FT_BASE( FT_Error )\n  FT_Stream_EnterFrame( FT_Stream  stream,\n                        FT_ULong   count );\n\n  /* exit a stream frame */\n  FT_BASE( void )\n  FT_Stream_ExitFrame( FT_Stream  stream );\n\n  /* Extract a stream frame.  If the stream is disk-based, a heap block */\n  /* is allocated and the frame bytes are read into it.  If the stream  */\n  /* is memory-based, this function simply set a pointer to the data.   */\n  /*                                                                    */\n  /* Useful to optimize access to memory-based streams transparently.   */\n  /*                                                                    */\n  /* All extracted frames must be `freed' with a call to the function   */\n  /* FT_Stream_ReleaseFrame().                                          */\n  /*                                                                    */\n  FT_BASE( FT_Error )\n  FT_Stream_ExtractFrame( FT_Stream  stream,\n                          FT_ULong   count,\n                          FT_Byte**  pbytes );\n\n  /* release an extract frame (see FT_Stream_ExtractFrame) */\n  FT_BASE( void )\n  FT_Stream_ReleaseFrame( FT_Stream  stream,\n                          FT_Byte**  pbytes );\n\n  /* read a byte from an entered frame */\n  FT_BASE( FT_Char )\n  FT_Stream_GetChar( FT_Stream  stream );\n\n  /* read a 16-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShort( FT_Stream  stream );\n\n  /* read a 24-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetUOffset( FT_Stream  stream );\n\n  /* read a 32-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULong( FT_Stream  stream );\n\n  /* read a 16-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShortLE( FT_Stream  stream );\n\n  /* read a 32-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULongLE( FT_Stream  stream );\n\n\n  /* read a byte from a stream */\n  FT_BASE( FT_Char )\n  FT_Stream_ReadChar( FT_Stream  stream,\n                      FT_Error*  error );\n\n  /* read a 16-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShort( FT_Stream  stream,\n                        FT_Error*  error );\n\n  /* read a 24-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadUOffset( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* read a 32-bit big-endian integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULong( FT_Stream  stream,\n                       FT_Error*  error );\n\n  /* read a 16-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShortLE( FT_Stream  stream,\n                          FT_Error*  error );\n\n  /* read a 32-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULongLE( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* Read a structure from a stream.  The structure must be described */\n  /* by an array of FT_Frame_Field records.                           */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadFields( FT_Stream              stream,\n                        const FT_Frame_Field*  fields,\n                        void*                  structure );\n\n\n#define FT_STREAM_POS()           \\\n          FT_Stream_Pos( stream )\n\n#define FT_STREAM_SEEK( position )                               \\\n          FT_SET_ERROR( FT_Stream_Seek( stream,                  \\\n                                        (FT_ULong)(position) ) )\n\n#define FT_STREAM_SKIP( distance )                              \\\n          FT_SET_ERROR( FT_Stream_Skip( stream,                 \\\n                                        (FT_Long)(distance) ) )\n\n#define FT_STREAM_READ( buffer, count )                       \\\n          FT_SET_ERROR( FT_Stream_Read( stream,               \\\n                                        (FT_Byte*)(buffer),   \\\n                                        (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_AT( position, buffer, count )            \\\n          FT_SET_ERROR( FT_Stream_ReadAt( stream,               \\\n                                          (FT_ULong)(position), \\\n                                          (FT_Byte*)buffer,     \\\n                                          (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_FIELDS( fields, object )                          \\\n          FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )\n\n\n#define FT_FRAME_ENTER( size )                                           \\\n          FT_SET_ERROR(                                                  \\\n            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream,                \\\n                                                  (FT_ULong)(size) ) ) )\n\n#define FT_FRAME_EXIT()                                   \\\n          FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )\n\n#define FT_FRAME_EXTRACT( size, bytes )                                       \\\n          FT_SET_ERROR(                                                       \\\n            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream,                   \\\n                                                    (FT_ULong)(size),         \\\n                                                    (FT_Byte**)&(bytes) ) ) )\n\n#define FT_FRAME_RELEASE( bytes )                                         \\\n          FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream,                 \\\n                                                  (FT_Byte**)&(bytes) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTSTREAM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/fttrace.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrace.h                                                              */\n/*                                                                         */\n/*    Tracing handling (specification only).                               */\n/*                                                                         */\n/*  Copyright 2002, 2004-2007, 2009, 2011-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* definitions of trace levels for FreeType 2 */\n\n  /* the first level must always be `trace_any' */\nFT_TRACE_DEF( any )\n\n  /* base components */\nFT_TRACE_DEF( calc )      /* calculations            (ftcalc.c)   */\nFT_TRACE_DEF( memory )    /* memory manager          (ftobjs.c)   */\nFT_TRACE_DEF( stream )    /* stream manager          (ftstream.c) */\nFT_TRACE_DEF( io )        /* i/o interface           (ftsystem.c) */\nFT_TRACE_DEF( list )      /* list management         (ftlist.c)   */\nFT_TRACE_DEF( init )      /* initialization          (ftinit.c)   */\nFT_TRACE_DEF( objs )      /* base objects            (ftobjs.c)   */\nFT_TRACE_DEF( outline )   /* outline management      (ftoutln.c)  */\nFT_TRACE_DEF( glyph )     /* glyph management        (ftglyph.c)  */\nFT_TRACE_DEF( gloader )   /* glyph loader            (ftgloadr.c) */\n\nFT_TRACE_DEF( raster )    /* monochrome rasterizer   (ftraster.c) */\nFT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */\nFT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */\nFT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */\nFT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */\nFT_TRACE_DEF( bitmap )    /* bitmap checksum         (ftobjs.c)   */\n\n  /* Cache sub-system */\nFT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */\n\n  /* SFNT driver components */\nFT_TRACE_DEF( sfdriver )  /* SFNT font driver        (sfdriver.c) */\nFT_TRACE_DEF( sfobjs )    /* SFNT object handler     (sfobjs.c)   */\nFT_TRACE_DEF( ttcmap )    /* charmap handler         (ttcmap.c)   */\nFT_TRACE_DEF( ttkern )    /* kerning handler         (ttkern.c)   */\nFT_TRACE_DEF( ttload )    /* basic TrueType tables   (ttload.c)   */\nFT_TRACE_DEF( ttmtx )     /* metrics-related tables  (ttmtx.c)    */\nFT_TRACE_DEF( ttpost )    /* PS table processing     (ttpost.c)   */\nFT_TRACE_DEF( ttsbit )    /* TrueType sbit handling  (ttsbit.c)   */\nFT_TRACE_DEF( ttbdf )     /* TrueType embedded BDF   (ttbdf.c)    */\n\n  /* TrueType driver components */\nFT_TRACE_DEF( ttdriver )  /* TT font driver          (ttdriver.c) */\nFT_TRACE_DEF( ttgload )   /* TT glyph loader         (ttgload.c)  */\nFT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */\nFT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */\nFT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */\nFT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */\n\n  /* Type 1 driver components */\nFT_TRACE_DEF( t1afm )\nFT_TRACE_DEF( t1driver )\nFT_TRACE_DEF( t1gload )\nFT_TRACE_DEF( t1hint )\nFT_TRACE_DEF( t1load )\nFT_TRACE_DEF( t1objs )\nFT_TRACE_DEF( t1parse )\n\n  /* PostScript helper module `psaux' */\nFT_TRACE_DEF( t1decode )\nFT_TRACE_DEF( psobjs )\nFT_TRACE_DEF( psconv )\n\n  /* PostScript hinting module `pshinter' */\nFT_TRACE_DEF( pshrec )\nFT_TRACE_DEF( pshalgo1 )\nFT_TRACE_DEF( pshalgo2 )\n\n  /* Type 2 driver components */\nFT_TRACE_DEF( cffdriver )\nFT_TRACE_DEF( cffgload )\nFT_TRACE_DEF( cffload )\nFT_TRACE_DEF( cffobjs )\nFT_TRACE_DEF( cffparse )\n\nFT_TRACE_DEF( cf2blues )\nFT_TRACE_DEF( cf2hints )\nFT_TRACE_DEF( cf2interp )\n\n  /* Type 42 driver component */\nFT_TRACE_DEF( t42 )\n\n  /* CID driver components */\nFT_TRACE_DEF( cidafm )\nFT_TRACE_DEF( ciddriver )\nFT_TRACE_DEF( cidgload )\nFT_TRACE_DEF( cidload )\nFT_TRACE_DEF( cidobjs )\nFT_TRACE_DEF( cidparse )\n\n  /* Windows font component */\nFT_TRACE_DEF( winfnt )\n\n  /* PCF font components */\nFT_TRACE_DEF( pcfdriver )\nFT_TRACE_DEF( pcfread )\n\n  /* BDF font components */\nFT_TRACE_DEF( bdfdriver )\nFT_TRACE_DEF( bdflib )\n\n  /* PFR font component */\nFT_TRACE_DEF( pfr )\n\n  /* OpenType validation components */\nFT_TRACE_DEF( otvmodule )\nFT_TRACE_DEF( otvcommon )\nFT_TRACE_DEF( otvbase )\nFT_TRACE_DEF( otvgdef )\nFT_TRACE_DEF( otvgpos )\nFT_TRACE_DEF( otvgsub )\nFT_TRACE_DEF( otvjstf )\nFT_TRACE_DEF( otvmath )\n\n  /* TrueTypeGX/AAT validation components */\nFT_TRACE_DEF( gxvmodule )\nFT_TRACE_DEF( gxvcommon )\nFT_TRACE_DEF( gxvfeat )\nFT_TRACE_DEF( gxvmort )\nFT_TRACE_DEF( gxvmorx )\nFT_TRACE_DEF( gxvbsln )\nFT_TRACE_DEF( gxvjust )\nFT_TRACE_DEF( gxvkern )\nFT_TRACE_DEF( gxvopbd )\nFT_TRACE_DEF( gxvtrak )\nFT_TRACE_DEF( gxvprop )\nFT_TRACE_DEF( gxvlcar )\n\n  /* autofit components */\nFT_TRACE_DEF( afmodule )\nFT_TRACE_DEF( afhints )\nFT_TRACE_DEF( afcjk )\nFT_TRACE_DEF( aflatin )\nFT_TRACE_DEF( aflatin2 )\nFT_TRACE_DEF( afwarp )\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/ftvalid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftvalid.h                                                              */\n/*                                                                         */\n/*    FreeType validation support (specification).                         */\n/*                                                                         */\n/*  Copyright 2004, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTVALID_H__\n#define __FTVALID_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    V A L I D A T I O N                          ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to a validation object */\n  typedef struct FT_ValidatorRec_ volatile*  FT_Validator;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* There are three distinct validation levels defined here:              */\n  /*                                                                       */\n  /* FT_VALIDATE_DEFAULT ::                                                */\n  /*   A table that passes this validation level can be used reliably by   */\n  /*   FreeType.  It generally means that all offsets have been checked to */\n  /*   prevent out-of-bound reads, that array counts are correct, etc.     */\n  /*                                                                       */\n  /* FT_VALIDATE_TIGHT ::                                                  */\n  /*   A table that passes this validation level can be used reliably and  */\n  /*   doesn't contain invalid data.  For example, a charmap table that    */\n  /*   returns invalid glyph indices will not pass, even though it can     */\n  /*   be used with FreeType in default mode (the library will simply      */\n  /*   return an error later when trying to load the glyph).               */\n  /*                                                                       */\n  /*   It also checks that fields which must be a multiple of 2, 4, or 8,  */\n  /*   don't have incorrect values, etc.                                   */\n  /*                                                                       */\n  /* FT_VALIDATE_PARANOID ::                                               */\n  /*   Only for font debugging.  Checks that a table follows the           */\n  /*   specification by 100%.  Very few fonts will be able to pass this    */\n  /*   level anyway but it can be useful for certain tools like font       */\n  /*   editors/converters.                                                 */\n  /*                                                                       */\n  typedef enum  FT_ValidationLevel_\n  {\n    FT_VALIDATE_DEFAULT = 0,\n    FT_VALIDATE_TIGHT,\n    FT_VALIDATE_PARANOID\n\n  } FT_ValidationLevel;\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n  /* We disable the warning `structure was padded due to   */\n  /* __declspec(align())' in order to compile cleanly with */\n  /* the maximum level of warnings.                        */\n#pragma warning( push )\n#pragma warning( disable : 4324 )\n#endif /* _MSC_VER */\n\n  /* validator structure */\n  typedef struct  FT_ValidatorRec_\n  {\n    const FT_Byte*      base;        /* address of table in memory       */\n    const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */\n    FT_ValidationLevel  level;       /* validation level                 */\n    FT_Error            error;       /* error returned. 0 means success  */\n\n    ft_jmp_buf          jump_buffer; /* used for exception handling      */\n\n  } FT_ValidatorRec;\n\n#if defined( _MSC_VER )\n#pragma warning( pop )\n#endif\n\n#define FT_VALIDATOR( x )  ( (FT_Validator)( x ) )\n\n\n  FT_BASE( void )\n  ft_validator_init( FT_Validator        valid,\n                     const FT_Byte*      base,\n                     const FT_Byte*      limit,\n                     FT_ValidationLevel  level );\n\n  /* Do not use this. It's broken and will cause your validator to crash */\n  /* if you run it on an invalid font.                                   */\n  FT_BASE( FT_Int )\n  ft_validator_run( FT_Validator  valid );\n\n  /* Sets the error field in a validator, then calls `longjmp' to return */\n  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */\n  /* error checks within the validation routines.                        */\n  /*                                                                     */\n  FT_BASE( void )\n  ft_validator_error( FT_Validator  valid,\n                      FT_Error      error );\n\n\n  /* Calls ft_validate_error.  Assumes that the `valid' local variable */\n  /* holds a pointer to the current validator object.                  */\n  /*                                                                   */\n  /* Use preprocessor prescan to pass FT_ERR_PREFIX.                   */\n  /*                                                                   */\n#define FT_INVALID( _prefix, _error )  FT_INVALID_( _prefix, _error )\n#define FT_INVALID_( _prefix, _error ) \\\n          ft_validator_error( valid, _prefix ## _error )\n\n  /* called when a broken table is detected */\n#define FT_INVALID_TOO_SHORT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid offset is detected */\n#define FT_INVALID_OFFSET \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )\n\n  /* called when an invalid format/value is detected */\n#define FT_INVALID_FORMAT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid glyph index is detected */\n#define FT_INVALID_GLYPH_ID \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )\n\n  /* called when an invalid field value is detected */\n#define FT_INVALID_DATA \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n\nFT_END_HEADER\n\n#endif /* __FTVALID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/internal.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  internal.h                                                             */\n/*                                                                         */\n/*    Internal header files (specification only).                          */\n/*                                                                         */\n/*  Copyright 1996-2004, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is automatically included by `ft2build.h'.                  */\n  /* Do not include it manually!                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define FT_INTERNAL_OBJECTS_H             <freetype/internal/ftobjs.h>\n#define FT_INTERNAL_PIC_H                 <freetype/internal/ftpic.h>\n#define FT_INTERNAL_STREAM_H              <freetype/internal/ftstream.h>\n#define FT_INTERNAL_MEMORY_H              <freetype/internal/ftmemory.h>\n#define FT_INTERNAL_DEBUG_H               <freetype/internal/ftdebug.h>\n#define FT_INTERNAL_CALC_H                <freetype/internal/ftcalc.h>\n#define FT_INTERNAL_DRIVER_H              <freetype/internal/ftdriver.h>\n#define FT_INTERNAL_TRACE_H               <freetype/internal/fttrace.h>\n#define FT_INTERNAL_GLYPH_LOADER_H        <freetype/internal/ftgloadr.h>\n#define FT_INTERNAL_SFNT_H                <freetype/internal/sfnt.h>\n#define FT_INTERNAL_SERVICE_H             <freetype/internal/ftserv.h>\n#define FT_INTERNAL_RFORK_H               <freetype/internal/ftrfork.h>\n#define FT_INTERNAL_VALIDATE_H            <freetype/internal/ftvalid.h>\n\n#define FT_INTERNAL_TRUETYPE_TYPES_H      <freetype/internal/tttypes.h>\n#define FT_INTERNAL_TYPE1_TYPES_H         <freetype/internal/t1types.h>\n\n#define FT_INTERNAL_POSTSCRIPT_AUX_H      <freetype/internal/psaux.h>\n#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <freetype/internal/pshints.h>\n#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <freetype/internal/psglobal.h>\n\n#define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n\n  /* We disable the warning `conditional expression is constant' here */\n  /* in order to compile cleanly with the maximum level of warnings.  */\n  /* In particular, the warning complains about stuff like `while(0)' */\n  /* which is very useful in macro definitions.  There is no benefit  */\n  /* in having it enabled.                                            */\n#pragma warning( disable : 4127 )\n\n#endif /* _MSC_VER */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/psaux.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psaux.h                                                                */\n/*                                                                         */\n/*    Auxiliary functions and data structures related to PostScript fonts  */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSAUX_H__\n#define __PSAUX_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                             T1_TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct PS_TableRec_*              PS_Table;\n  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Table_FuncsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of function pointers to manage PS_Table objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    table_init    :: Used to initialize a table.                       */\n  /*                                                                       */\n  /*    table_done    :: Finalizes resp. destroy a given table.            */\n  /*                                                                       */\n  /*    table_add     :: Adds a new object to a table.                     */\n  /*                                                                       */\n  /*    table_release :: Releases table data, then finalizes it.           */\n  /*                                                                       */\n  typedef struct  PS_Table_FuncsRec_\n  {\n    FT_Error\n    (*init)( PS_Table   table,\n             FT_Int     count,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Table  table );\n\n    FT_Error\n    (*add)( PS_Table    table,\n            FT_Int      idx,\n            void*       object,\n            FT_PtrDist  length );\n\n    void\n    (*release)( PS_Table  table );\n\n  } PS_Table_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Table is a simple object used to store an array of objects in */\n  /*    a single memory block.                                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    block     :: The address in memory of the growheap's block.  This  */\n  /*                 can change between two object adds, due to            */\n  /*                 reallocation.                                         */\n  /*                                                                       */\n  /*    cursor    :: The current top of the grow heap within its block.    */\n  /*                                                                       */\n  /*    capacity  :: The current size of the heap block.  Increments by    */\n  /*                 1kByte chunks.                                        */\n  /*                                                                       */\n  /*    init      :: Set to 0xDEADBEEF if `elements' and `lengths' have    */\n  /*                 been allocated.                                       */\n  /*                                                                       */\n  /*    max_elems :: The maximum number of elements in table.              */\n  /*                                                                       */\n  /*    num_elems :: The current number of elements in table.              */\n  /*                                                                       */\n  /*    elements  :: A table of element addresses within the block.        */\n  /*                                                                       */\n  /*    lengths   :: A table of element sizes within the block.            */\n  /*                                                                       */\n  /*    memory    :: The object used for memory operations                 */\n  /*                 (alloc/realloc).                                      */\n  /*                                                                       */\n  /*    funcs     :: A table of method pointers for this object.           */\n  /*                                                                       */\n  typedef struct  PS_TableRec_\n  {\n    FT_Byte*           block;          /* current memory block           */\n    FT_Offset          cursor;         /* current cursor in memory block */\n    FT_Offset          capacity;       /* current size of memory block   */\n    FT_Long            init;\n\n    FT_Int             max_elems;\n    FT_Int             num_elems;\n    FT_Byte**          elements;       /* addresses of table elements */\n    FT_PtrDist*        lengths;        /* lengths of table elements   */\n\n    FT_Memory          memory;\n    PS_Table_FuncsRec  funcs;\n\n  } PS_TableRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       T1 FIELDS & TOKENS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PS_ParserRec_*  PS_Parser;\n\n  typedef struct T1_TokenRec_*   T1_Token;\n\n  typedef struct T1_FieldRec_*   T1_Field;\n\n\n  /* simple enumeration type used to identify token types */\n  typedef enum  T1_TokenType_\n  {\n    T1_TOKEN_TYPE_NONE = 0,\n    T1_TOKEN_TYPE_ANY,\n    T1_TOKEN_TYPE_STRING,\n    T1_TOKEN_TYPE_ARRAY,\n    T1_TOKEN_TYPE_KEY, /* aka `name' */\n\n    /* do not remove */\n    T1_TOKEN_TYPE_MAX\n\n  } T1_TokenType;\n\n\n  /* a simple structure used to identify tokens */\n  typedef struct  T1_TokenRec_\n  {\n    FT_Byte*      start;   /* first character of token in input stream */\n    FT_Byte*      limit;   /* first character after the token          */\n    T1_TokenType  type;    /* type of token                            */\n\n  } T1_TokenRec;\n\n\n  /* enumeration type used to identify object fields */\n  typedef enum  T1_FieldType_\n  {\n    T1_FIELD_TYPE_NONE = 0,\n    T1_FIELD_TYPE_BOOL,\n    T1_FIELD_TYPE_INTEGER,\n    T1_FIELD_TYPE_FIXED,\n    T1_FIELD_TYPE_FIXED_1000,\n    T1_FIELD_TYPE_STRING,\n    T1_FIELD_TYPE_KEY,\n    T1_FIELD_TYPE_BBOX,\n    T1_FIELD_TYPE_MM_BBOX,\n    T1_FIELD_TYPE_INTEGER_ARRAY,\n    T1_FIELD_TYPE_FIXED_ARRAY,\n    T1_FIELD_TYPE_CALLBACK,\n\n    /* do not remove */\n    T1_FIELD_TYPE_MAX\n\n  } T1_FieldType;\n\n\n  typedef enum  T1_FieldLocation_\n  {\n    T1_FIELD_LOCATION_CID_INFO,\n    T1_FIELD_LOCATION_FONT_DICT,\n    T1_FIELD_LOCATION_FONT_EXTRA,\n    T1_FIELD_LOCATION_FONT_INFO,\n    T1_FIELD_LOCATION_PRIVATE,\n    T1_FIELD_LOCATION_BBOX,\n    T1_FIELD_LOCATION_LOADER,\n    T1_FIELD_LOCATION_FACE,\n    T1_FIELD_LOCATION_BLEND,\n\n    /* do not remove */\n    T1_FIELD_LOCATION_MAX\n\n  } T1_FieldLocation;\n\n\n  typedef void\n  (*T1_Field_ParseFunc)( FT_Face     face,\n                         FT_Pointer  parser );\n\n\n  /* structure type used to model object fields */\n  typedef struct  T1_FieldRec_\n  {\n    const char*         ident;        /* field identifier               */\n    T1_FieldLocation    location;\n    T1_FieldType        type;         /* type of field                  */\n    T1_Field_ParseFunc  reader;\n    FT_UInt             offset;       /* offset of field in object      */\n    FT_Byte             size;         /* size of field in bytes         */\n    FT_UInt             array_max;    /* maximum number of elements for */\n                                      /* array                          */\n    FT_UInt             count_offset; /* offset of element count for    */\n                                      /* arrays; must not be zero if in */\n                                      /* use -- in other words, a       */\n                                      /* `num_FOO' element must not     */\n                                      /* start the used structure if we */\n                                      /* parse a `FOO' array            */\n    FT_UInt             dict;         /* where we expect it             */\n  } T1_FieldRec;\n\n#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */\n#define T1_FIELD_DICT_PRIVATE  ( 1 << 1 )\n\n\n\n#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \\\n          {                                                 \\\n            _ident, T1CODE, _type,                          \\\n            0,                                              \\\n            FT_FIELD_OFFSET( _fname ),                      \\\n            FT_FIELD_SIZE( _fname ),                        \\\n            0, 0,                                           \\\n            _dict                                           \\\n          },\n\n#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \\\n          {                                             \\\n            _ident, T1CODE, T1_FIELD_TYPE_CALLBACK,     \\\n            (T1_Field_ParseFunc)_reader,                \\\n            0, 0,                                       \\\n            0, 0,                                       \\\n            _dict                                       \\\n          },\n\n#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \\\n          {                                                      \\\n            _ident, T1CODE, _type,                               \\\n            0,                                                   \\\n            FT_FIELD_OFFSET( _fname ),                           \\\n            FT_FIELD_SIZE_DELTA( _fname ),                       \\\n            _max,                                                \\\n            FT_FIELD_OFFSET( num_ ## _fname ),                   \\\n            _dict                                                \\\n          },\n\n#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \\\n          {                                                       \\\n            _ident, T1CODE, _type,                                \\\n            0,                                                    \\\n            FT_FIELD_OFFSET( _fname ),                            \\\n            FT_FIELD_SIZE_DELTA( _fname ),                        \\\n            _max, 0,                                              \\\n            _dict                                                 \\\n          },\n\n\n#define T1_FIELD_BOOL( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )\n\n#define T1_FIELD_NUM( _ident, _fname, _dict )                                 \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )\n\n#define T1_FIELD_FIXED( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )\n\n#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )                     \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \\\n                               _dict )\n\n#define T1_FIELD_STRING( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )\n\n#define T1_FIELD_KEY( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )\n\n#define T1_FIELD_BBOX( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )\n\n\n#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_CALLBACK( _ident, _name, _dict )       \\\n          T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 PARSER                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct PS_Parser_FuncsRec_*  PS_Parser_Funcs;\n\n  typedef struct  PS_Parser_FuncsRec_\n  {\n    void\n    (*init)( PS_Parser  parser,\n             FT_Byte*   base,\n             FT_Byte*   limit,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Parser  parser );\n\n    void\n    (*skip_spaces)( PS_Parser  parser );\n    void\n    (*skip_PS_token)( PS_Parser  parser );\n\n    FT_Long\n    (*to_int)( PS_Parser  parser );\n    FT_Fixed\n    (*to_fixed)( PS_Parser  parser,\n                 FT_Int     power_ten );\n\n    FT_Error\n    (*to_bytes)( PS_Parser  parser,\n                 FT_Byte*   bytes,\n                 FT_Offset  max_bytes,\n                 FT_Long*   pnum_bytes,\n                 FT_Bool    delimiters );\n\n    FT_Int\n    (*to_coord_array)( PS_Parser  parser,\n                       FT_Int     max_coords,\n                       FT_Short*  coords );\n    FT_Int\n    (*to_fixed_array)( PS_Parser  parser,\n                       FT_Int     max_values,\n                       FT_Fixed*  values,\n                       FT_Int     power_ten );\n\n    void\n    (*to_token)( PS_Parser  parser,\n                 T1_Token   token );\n    void\n    (*to_token_array)( PS_Parser  parser,\n                       T1_Token   tokens,\n                       FT_UInt    max_tokens,\n                       FT_Int*    pnum_tokens );\n\n    FT_Error\n    (*load_field)( PS_Parser       parser,\n                   const T1_Field  field,\n                   void**          objects,\n                   FT_UInt         max_objects,\n                   FT_ULong*       pflags );\n\n    FT_Error\n    (*load_field_table)( PS_Parser       parser,\n                         const T1_Field  field,\n                         void**          objects,\n                         FT_UInt         max_objects,\n                         FT_ULong*       pflags );\n\n  } PS_Parser_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_ParserRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Parser is an object used to parse a Type 1 font very quickly. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    cursor :: The current position in the text.                        */\n  /*                                                                       */\n  /*    base   :: Start of the processed text.                             */\n  /*                                                                       */\n  /*    limit  :: End of the processed text.                               */\n  /*                                                                       */\n  /*    error  :: The last error returned.                                 */\n  /*                                                                       */\n  /*    memory :: The object used for memory operations (alloc/realloc).   */\n  /*                                                                       */\n  /*    funcs  :: A table of functions for the parser.                     */\n  /*                                                                       */\n  typedef struct  PS_ParserRec_\n  {\n    FT_Byte*   cursor;\n    FT_Byte*   base;\n    FT_Byte*   limit;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    PS_Parser_FuncsRec  funcs;\n\n  } PS_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 BUILDER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_BuilderRec_*  T1_Builder;\n\n\n  typedef FT_Error\n  (*T1_Builder_Check_Points_Func)( T1_Builder  builder,\n                                   FT_Int      count );\n\n  typedef void\n  (*T1_Builder_Add_Point_Func)( T1_Builder  builder,\n                                FT_Pos      x,\n                                FT_Pos      y,\n                                FT_Byte     flag );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Point1_Func)( T1_Builder  builder,\n                                 FT_Pos      x,\n                                 FT_Pos      y );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Contour_Func)( T1_Builder  builder );\n\n  typedef FT_Error\n  (*T1_Builder_Start_Point_Func)( T1_Builder  builder,\n                                  FT_Pos      x,\n                                  FT_Pos      y );\n\n  typedef void\n  (*T1_Builder_Close_Contour_Func)( T1_Builder  builder );\n\n\n  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;\n\n  typedef struct  T1_Builder_FuncsRec_\n  {\n    void\n    (*init)( T1_Builder    builder,\n             FT_Face       face,\n             FT_Size       size,\n             FT_GlyphSlot  slot,\n             FT_Bool       hinting );\n\n    void\n    (*done)( T1_Builder   builder );\n\n    T1_Builder_Check_Points_Func   check_points;\n    T1_Builder_Add_Point_Func      add_point;\n    T1_Builder_Add_Point1_Func     add_point1;\n    T1_Builder_Add_Contour_Func    add_contour;\n    T1_Builder_Start_Point_Func    start_point;\n    T1_Builder_Close_Contour_Func  close_contour;\n\n  } T1_Builder_FuncsRec;\n\n\n  /* an enumeration type to handle charstring parsing states */\n  typedef enum  T1_ParseState_\n  {\n    T1_Parse_Start,\n    T1_Parse_Have_Width,\n    T1_Parse_Have_Moveto,\n    T1_Parse_Have_Path\n\n  } T1_ParseState;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Structure>                                                           */\n  /*    T1_BuilderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     A structure used during glyph loading to store its outline.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory       :: The current memory object.                         */\n  /*                                                                       */\n  /*    face         :: The current face object.                           */\n  /*                                                                       */\n  /*    glyph        :: The current glyph slot.                            */\n  /*                                                                       */\n  /*    loader       :: XXX                                                */\n  /*                                                                       */\n  /*    base         :: The base glyph outline.                            */\n  /*                                                                       */\n  /*    current      :: The current glyph outline.                         */\n  /*                                                                       */\n  /*    max_points   :: maximum points in builder outline                  */\n  /*                                                                       */\n  /*    max_contours :: Maximum number of contours in builder outline.     */\n  /*                                                                       */\n  /*    pos_x        :: The horizontal translation (if composite glyph).   */\n  /*                                                                       */\n  /*    pos_y        :: The vertical translation (if composite glyph).     */\n  /*                                                                       */\n  /*    left_bearing :: The left side bearing point.                       */\n  /*                                                                       */\n  /*    advance      :: The horizontal advance vector.                     */\n  /*                                                                       */\n  /*    bbox         :: Unused.                                            */\n  /*                                                                       */\n  /*    parse_state  :: An enumeration which controls the charstring       */\n  /*                    parsing state.                                     */\n  /*                                                                       */\n  /*    load_points  :: If this flag is not set, no points are loaded.     */\n  /*                                                                       */\n  /*    no_recurse   :: Set but not used.                                  */\n  /*                                                                       */\n  /*    metrics_only :: A boolean indicating that we only want to compute  */\n  /*                    the metrics of a given glyph, not load all of its  */\n  /*                    points.                                            */\n  /*                                                                       */\n  /*    funcs        :: An array of function pointers for the builder.     */\n  /*                                                                       */\n  typedef struct  T1_BuilderRec_\n  {\n    FT_Memory       memory;\n    FT_Face         face;\n    FT_GlyphSlot    glyph;\n    FT_GlyphLoader  loader;\n    FT_Outline*     base;\n    FT_Outline*     current;\n\n    FT_Pos          pos_x;\n    FT_Pos          pos_y;\n\n    FT_Vector       left_bearing;\n    FT_Vector       advance;\n\n    FT_BBox         bbox;          /* bounding box */\n    T1_ParseState   parse_state;\n    FT_Bool         load_points;\n    FT_Bool         no_recurse;\n\n    FT_Bool         metrics_only;\n\n    void*           hints_funcs;    /* hinter-specific */\n    void*           hints_globals;  /* hinter-specific */\n\n    T1_Builder_FuncsRec  funcs;\n\n  } T1_BuilderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 DECODER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  8\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  32\n\n#endif /* 0 */\n\n\n  typedef struct  T1_Decoder_ZoneRec_\n  {\n    FT_Byte*  cursor;\n    FT_Byte*  base;\n    FT_Byte*  limit;\n\n  } T1_Decoder_ZoneRec, *T1_Decoder_Zone;\n\n\n  typedef struct T1_DecoderRec_*              T1_Decoder;\n  typedef const struct T1_Decoder_FuncsRec_*  T1_Decoder_Funcs;\n\n\n  typedef FT_Error\n  (*T1_Decoder_Callback)( T1_Decoder  decoder,\n                          FT_UInt     glyph_index );\n\n\n  typedef struct  T1_Decoder_FuncsRec_\n  {\n    FT_Error\n    (*init)( T1_Decoder           decoder,\n             FT_Face              face,\n             FT_Size              size,\n             FT_GlyphSlot         slot,\n             FT_Byte**            glyph_names,\n             PS_Blend             blend,\n             FT_Bool              hinting,\n             FT_Render_Mode       hint_mode,\n             T1_Decoder_Callback  callback );\n\n    void\n    (*done)( T1_Decoder  decoder );\n\n    FT_Error\n    (*parse_charstrings)( T1_Decoder  decoder,\n                          FT_Byte*    base,\n                          FT_UInt     len );\n\n  } T1_Decoder_FuncsRec;\n\n\n  typedef struct  T1_DecoderRec_\n  {\n    T1_BuilderRec        builder;\n\n    FT_Long              stack[T1_MAX_CHARSTRINGS_OPERANDS];\n    FT_Long*             top;\n\n    T1_Decoder_ZoneRec   zones[T1_MAX_SUBRS_CALLS + 1];\n    T1_Decoder_Zone      zone;\n\n    FT_Service_PsCMaps   psnames;      /* for seac */\n    FT_UInt              num_glyphs;\n    FT_Byte**            glyph_names;\n\n    FT_Int               lenIV;        /* internal for sub routine calls */\n    FT_UInt              num_subrs;\n    FT_Byte**            subrs;\n    FT_PtrDist*          subrs_len;    /* array of subrs length (optional) */\n\n    FT_Matrix            font_matrix;\n    FT_Vector            font_offset;\n\n    FT_Int               flex_state;\n    FT_Int               num_flex_vectors;\n    FT_Vector            flex_vectors[7];\n\n    PS_Blend             blend;       /* for multiple master support */\n\n    FT_Render_Mode       hint_mode;\n\n    T1_Decoder_Callback  parse_callback;\n    T1_Decoder_FuncsRec  funcs;\n\n    FT_Long*             buildchar;\n    FT_UInt              len_buildchar;\n\n    FT_Bool              seac;\n\n  } T1_DecoderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            AFM PARSER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct AFM_ParserRec_*  AFM_Parser;\n\n  typedef struct  AFM_Parser_FuncsRec_\n  {\n    FT_Error\n    (*init)( AFM_Parser  parser,\n             FT_Memory   memory,\n             FT_Byte*    base,\n             FT_Byte*    limit );\n\n    void\n    (*done)( AFM_Parser  parser );\n\n    FT_Error\n    (*parse)( AFM_Parser  parser );\n\n  } AFM_Parser_FuncsRec;\n\n\n  typedef struct AFM_StreamRec_*  AFM_Stream;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    AFM_ParserRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An AFM_Parser is a parser for the AFM files.                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory    :: The object used for memory operations (alloc and      */\n  /*                 realloc).                                             */\n  /*                                                                       */\n  /*    stream    :: This is an opaque object.                             */\n  /*                                                                       */\n  /*    FontInfo  :: The result will be stored here.                       */\n  /*                                                                       */\n  /*    get_index :: A user provided function to get a glyph index by its  */\n  /*                 name.                                                 */\n  /*                                                                       */\n  typedef struct  AFM_ParserRec_\n  {\n    FT_Memory     memory;\n    AFM_Stream    stream;\n\n    AFM_FontInfo  FontInfo;\n\n    FT_Int\n    (*get_index)( const char*  name,\n                  FT_Offset    len,\n                  void*        user_data );\n\n    void*         user_data;\n\n  } AFM_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     TYPE1 CHARMAPS                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct T1_CMap_ClassesRec_*  T1_CMap_Classes;\n\n  typedef struct T1_CMap_ClassesRec_\n  {\n    FT_CMap_Class  standard;\n    FT_CMap_Class  expert;\n    FT_CMap_Class  custom;\n    FT_CMap_Class  unicode;\n\n  } T1_CMap_ClassesRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        PSAux Module Interface                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  PSAux_ServiceRec_\n  {\n    /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */\n    const PS_Table_FuncsRec*    ps_table_funcs;\n    const PS_Parser_FuncsRec*   ps_parser_funcs;\n    const T1_Builder_FuncsRec*  t1_builder_funcs;\n    const T1_Decoder_FuncsRec*  t1_decoder_funcs;\n\n    void\n    (*t1_decrypt)( FT_Byte*   buffer,\n                   FT_Offset  length,\n                   FT_UShort  seed );\n\n    T1_CMap_Classes  t1_cmap_classes;\n\n    /* fields after this comment line were added after version 2.1.10 */\n    const AFM_Parser_FuncsRec*  afm_parser_funcs;\n\n  } PSAux_ServiceRec, *PSAux_Service;\n\n  /* backwards-compatible type definition */\n  typedef PSAux_ServiceRec   PSAux_Interface;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 Some convenience functions                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define IS_PS_NEWLINE( ch ) \\\n  ( (ch) == '\\r' ||         \\\n    (ch) == '\\n' )\n\n#define IS_PS_SPACE( ch )  \\\n  ( (ch) == ' '         || \\\n    IS_PS_NEWLINE( ch ) || \\\n    (ch) == '\\t'        || \\\n    (ch) == '\\f'        || \\\n    (ch) == '\\0' )\n\n#define IS_PS_SPECIAL( ch )       \\\n  ( (ch) == '/'                || \\\n    (ch) == '(' || (ch) == ')' || \\\n    (ch) == '<' || (ch) == '>' || \\\n    (ch) == '[' || (ch) == ']' || \\\n    (ch) == '{' || (ch) == '}' || \\\n    (ch) == '%'                )\n\n#define IS_PS_DELIM( ch )  \\\n  ( IS_PS_SPACE( ch )   || \\\n    IS_PS_SPECIAL( ch ) )\n\n#define IS_PS_DIGIT( ch )        \\\n  ( (ch) >= '0' && (ch) <= '9' )\n\n#define IS_PS_XDIGIT( ch )            \\\n  ( IS_PS_DIGIT( ch )              || \\\n    ( (ch) >= 'A' && (ch) <= 'F' ) || \\\n    ( (ch) >= 'a' && (ch) <= 'f' ) )\n\n#define IS_PS_BASE85( ch )       \\\n  ( (ch) >= '!' && (ch) <= 'u' )\n\n#define IS_PS_TOKEN( cur, limit, token )                                \\\n  ( (char)(cur)[0] == (token)[0]                                     && \\\n    ( (cur) + sizeof ( (token) ) == (limit) ||                          \\\n      ( (cur) + sizeof( (token) ) < (limit)          &&                 \\\n        IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) )             && \\\n    ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )\n\n\nFT_END_HEADER\n\n#endif /* __PSAUX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/pshints.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshints.h                                                              */\n/*                                                                         */\n/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */\n/*    recorders (specification only).  These are used to support native    */\n/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */\n/*                                                                         */\n/*  Copyright 2001-2003, 2005-2007, 2009, 2012 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHINTS_H__\n#define __PSHINTS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PSH_GlobalsRec_*  PSH_Globals;\n\n  typedef FT_Error\n  (*PSH_Globals_NewFunc)( FT_Memory     memory,\n                          T1_Private*   private_dict,\n                          PSH_Globals*  aglobals );\n\n  typedef FT_Error\n  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,\n                               FT_Fixed     x_scale,\n                               FT_Fixed     y_scale,\n                               FT_Fixed     x_delta,\n                               FT_Fixed     y_delta );\n\n  typedef void\n  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );\n\n\n  typedef struct  PSH_Globals_FuncsRec_\n  {\n    PSH_Globals_NewFunc       create;\n    PSH_Globals_SetScaleFunc  set_scale;\n    PSH_Globals_DestroyFunc   destroy;\n\n  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 1 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stem', `stem3', or `reset').  Note that these functions do\n   *     not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   PostScript hinter.\n   *\n   */\n  typedef struct T1_HintsRec_*  T1_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of\n   *   a given @T1_Hints object.\n   *\n   */\n  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to prepare it for a new Type 1\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T1_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T1_Hints_OpenFunc)( T1_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStemFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record a new horizontal or\n   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'\n   *   operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   coords ::\n   *     Array of 2 coordinates in 16.16 format, used as (position,length)\n   *     stem descriptor.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   `coords[0]' is the absolute stem position (lowest coordinate);\n   *   `coords[1]' is the length.\n   *\n   *   The length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   *   If the length is -21 (corresponding to a bottom ghost stem), then\n   *   the real stem position is `coords[0]+coords[1]'.\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStemFunc)( T1_Hints   hints,\n                           FT_UInt    dimension,\n                           FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStem3Func\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record three\n   *   counter-controlled horizontal or vertical stems at once.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems, 1 for vertical ones.\n   *\n   *   coords ::\n   *     An array of 6 values in 16.16 format, holding 3 (position,length)\n   *     pairs for the counter-controlled stems.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   The lengths cannot be negative (ghost stems are never\n   *   counter-controlled).\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStem3Func)( T1_Hints   hints,\n                            FT_UInt    dimension,\n                            FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ResetFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to reset the stems hints in a\n   *   recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph in which the\n   *     previously defined hints apply.\n   *\n   */\n  typedef void\n  (*T1_Hints_ResetFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_CloseFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called once all hints have been\n   *   recorded.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font as the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_ApplyFunc)( T1_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T1_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T1_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T1 Hints recorder.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stem ::\n   *     The function to set a simple stem.\n   *\n   *   stem3 ::\n   *     The function to set counter-controlled stems.\n   *\n   *   reset ::\n   *     The function to reset stem hints.\n   *\n   *   apply ::\n   *     The function to apply the hints to the corresponding glyph outline.\n   *\n   */\n  typedef struct  T1_Hints_FuncsRec_\n  {\n    T1_Hints               hints;\n    T1_Hints_OpenFunc      open;\n    T1_Hints_CloseFunc     close;\n    T1_Hints_SetStemFunc   stem;\n    T1_Hints_SetStem3Func  stem3;\n    T1_Hints_ResetFunc     reset;\n    T1_Hints_ApplyFunc     apply;\n\n  } T1_Hints_FuncsRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 2 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stems', `hintmask', `counters').  Note that these\n   *     functions do not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   Postscript hinter.\n   *\n   */\n  typedef struct T2_HintsRec_*  T2_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of\n   *   a given @T2_Hints object.\n   *\n   */\n  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to prepare it for a new Type 2\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T2_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T2_Hints_OpenFunc)( T2_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_StemsFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set the table of stems in\n   *   either the vertical or horizontal dimension.  Equivalent to the\n   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   count ::\n   *     The number of stems.\n   *\n   *   coords ::\n   *     An array of `count' (position,length) pairs in 16.16 format.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   There are `2*count' elements in the `coords' array.  Each even\n   *   element is an absolute position in font units, each odd element is a\n   *   length in font units.\n   *\n   *   A length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   */\n  typedef void\n  (*T2_Hints_StemsFunc)( T2_Hints   hints,\n                         FT_UInt    dimension,\n                         FT_UInt    count,\n                         FT_Fixed*  coordinates );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_MaskFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given hintmask (this\n   *   corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The glyph index of the last point to which the previously defined\n   *     or activated hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *   The `bytes' array can come directly from the Type 2 charstring and\n   *   respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_MaskFunc)( T2_Hints        hints,\n                        FT_UInt         end_point,\n                        FT_UInt         bit_count,\n                        const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CounterFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given counter mask\n   *   (this corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     A glyph index of the last point to which the previously defined or\n   *     active hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *    The `bytes' array can come directly from the Type 2 charstring and\n   *    respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_CounterFunc)( T2_Hints        hints,\n                           FT_UInt         bit_count,\n                           const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_CloseFunc)( T2_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called after the `close'\n   *   method.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font than the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_ApplyFunc)( T2_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T2_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T2_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T2 hints recorder object.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stems ::\n   *     The function to set the dimension's stems table.\n   *\n   *   hintmask ::\n   *     The function to set hint masks.\n   *\n   *   counter ::\n   *     The function to set counter masks.\n   *\n   *   apply ::\n   *     The function to apply the hints on the corresponding glyph outline.\n   *\n   */\n  typedef struct  T2_Hints_FuncsRec_\n  {\n    T2_Hints              hints;\n    T2_Hints_OpenFunc     open;\n    T2_Hints_CloseFunc    close;\n    T2_Hints_StemsFunc    stems;\n    T2_Hints_MaskFunc     hintmask;\n    T2_Hints_CounterFunc  counter;\n    T2_Hints_ApplyFunc    apply;\n\n  } T2_Hints_FuncsRec;\n\n\n  /* */\n\n\n  typedef struct  PSHinter_Interface_\n  {\n    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );\n    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );\n    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );\n\n  } PSHinter_Interface;\n\n  typedef PSHinter_Interface*  PSHinter_Service;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_PSHINTER_INTERFACE(        \\\n          class_,                            \\\n          get_globals_funcs_,                \\\n          get_t1_funcs_,                     \\\n          get_t2_funcs_ )                    \\\n  static const PSHinter_Interface  class_ =  \\\n  {                                          \\\n    get_globals_funcs_,                      \\\n    get_t1_funcs_,                           \\\n    get_t2_funcs_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_PSHINTER_INTERFACE(                      \\\n          class_,                                          \\\n          get_globals_funcs_,                              \\\n          get_t1_funcs_,                                   \\\n          get_t2_funcs_ )                                  \\\n  void                                                     \\\n  FT_Init_Class_ ## class_( FT_Library           library,  \\\n                            PSHinter_Interface*  clazz )   \\\n  {                                                        \\\n    FT_UNUSED( library );                                  \\\n                                                           \\\n    clazz->get_globals_funcs = get_globals_funcs_;         \\\n    clazz->get_t1_funcs      = get_t1_funcs_;              \\\n    clazz->get_t2_funcs      = get_t2_funcs_;              \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __PSHINTS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svbdf.h                                                                */\n/*                                                                         */\n/*    The FreeType BDF services (specification).                           */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVBDF_H__\n#define __SVBDF_H__\n\n#include FT_BDF_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_BDF  \"bdf\"\n\n  typedef FT_Error\n  (*FT_BDF_GetCharsetIdFunc)( FT_Face       face,\n                              const char*  *acharset_encoding,\n                              const char*  *acharset_registry );\n\n  typedef FT_Error\n  (*FT_BDF_GetPropertyFunc)( FT_Face           face,\n                             const char*       prop_name,\n                             BDF_PropertyRec  *aproperty );\n\n\n  FT_DEFINE_SERVICE( BDF )\n  {\n    FT_BDF_GetCharsetIdFunc  get_charset_id;\n    FT_BDF_GetPropertyFunc   get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  static const FT_Service_BDFRec  class_ =                               \\\n  {                                                                      \\\n    get_charset_id_, get_property_                                       \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  void                                                                   \\\n  FT_Init_Class_ ## class_( FT_Service_BDFRec*  clazz )                  \\\n  {                                                                      \\\n    clazz->get_charset_id = get_charset_id_;                             \\\n    clazz->get_property   = get_property_;                               \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svcid.h                                                                */\n/*                                                                         */\n/*    The FreeType CID font services (specification).                      */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal.            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVCID_H__\n#define __SVCID_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_CID  \"CID\"\n\n  typedef FT_Error\n  (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face       face,\n                                               const char*  *registry,\n                                               const char*  *ordering,\n                                               FT_Int       *supplement );\n  typedef FT_Error\n  (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face   face,\n                                         FT_Bool  *is_cid );\n  typedef FT_Error\n  (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face   face,\n                                      FT_UInt   glyph_index,\n                                      FT_UInt  *cid );\n\n  FT_DEFINE_SERVICE( CID )\n  {\n    FT_CID_GetRegistryOrderingSupplementFunc  get_ros;\n    FT_CID_GetIsInternallyCIDKeyedFunc        get_is_cid;\n    FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  static const FT_Service_CIDRec class_ =                                   \\\n  {                                                                         \\\n    get_ros_, get_is_cid_, get_cid_from_glyph_index_                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library          library,                    \\\n                            FT_Service_CIDRec*  clazz )                     \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->get_ros                  = get_ros_;                             \\\n    clazz->get_is_cid               = get_is_cid_;                          \\\n    clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svgldict.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgldict.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph dictionary services (specification).              */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGLDICT_H__\n#define __SVGLDICT_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to retrieve glyph names, as well as to find the\n   *  index of a given glyph name in a font.\n   *\n   */\n\n#define FT_SERVICE_ID_GLYPH_DICT  \"glyph-dict\"\n\n\n  typedef FT_Error\n  (*FT_GlyphDict_GetNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_GlyphDict_NameIndexFunc)( FT_Face     face,\n                                 FT_String*  glyph_name );\n\n\n  FT_DEFINE_SERVICE( GlyphDict )\n  {\n    FT_GlyphDict_GetNameFunc    get_name;\n    FT_GlyphDict_NameIndexFunc  name_index;  /* optional */\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  static const FT_Service_GlyphDictRec  class_ =                       \\\n  {                                                                    \\\n    get_name_, name_index_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  void                                                                 \\\n  FT_Init_Class_ ## class_( FT_Library                library,         \\\n                            FT_Service_GlyphDictRec*  clazz )          \\\n  {                                                                    \\\n    FT_UNUSED( library );                                              \\\n                                                                       \\\n    clazz->get_name   = get_name_;                                     \\\n    clazz->name_index = name_index_;                                   \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGLDICT_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005 by                                                */\n/*  Masatake YAMATO, Red Hat K.K.,                                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGXVAL_H__\n#define __SVGXVAL_H__\n\n#include FT_GX_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_GX_VALIDATE           \"truetypegx-validate\"\n#define FT_SERVICE_ID_CLASSICKERN_VALIDATE  \"classickern-validate\"\n\n  typedef FT_Error\n  (*gxv_validate_func)( FT_Face   face,\n                        FT_UInt   gx_flags,\n                        FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                        FT_UInt   table_length );\n\n\n  typedef FT_Error\n  (*ckern_validate_func)( FT_Face   face,\n                          FT_UInt   ckern_flags,\n                          FT_Bytes  *ckern_table );\n\n\n  FT_DEFINE_SERVICE( GXvalidate )\n  {\n    gxv_validate_func  validate;\n  };\n\n  FT_DEFINE_SERVICE( CKERNvalidate )\n  {\n    ckern_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svkern.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svkern.h                                                               */\n/*                                                                         */\n/*    The FreeType Kerning service (specification).                        */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVKERN_H__\n#define __SVKERN_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n#define FT_SERVICE_ID_KERNING  \"kerning\"\n\n\n  typedef FT_Error\n  (*FT_Kerning_TrackGetFunc)( FT_Face    face,\n                              FT_Fixed   point_size,\n                              FT_Int     degree,\n                              FT_Fixed*  akerning );\n\n  FT_DEFINE_SERVICE( Kerning )\n  {\n    FT_Kerning_TrackGetFunc  get_track;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVKERN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svmm.h                                                                 */\n/*                                                                         */\n/*    The FreeType Multiple Masters and GX var services (specification).   */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVMM_H__\n#define __SVMM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to manage multiple-masters data in a given face.\n   *\n   *  See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).\n   *\n   */\n\n#define FT_SERVICE_ID_MULTI_MASTERS  \"multi-masters\"\n\n\n  typedef FT_Error\n  (*FT_Get_MM_Func)( FT_Face           face,\n                     FT_Multi_Master*  master );\n\n  typedef FT_Error\n  (*FT_Get_MM_Var_Func)( FT_Face      face,\n                         FT_MM_Var*  *master );\n\n  typedef FT_Error\n  (*FT_Set_MM_Design_Func)( FT_Face   face,\n                            FT_UInt   num_coords,\n                            FT_Long*  coords );\n\n  typedef FT_Error\n  (*FT_Set_Var_Design_Func)( FT_Face    face,\n                             FT_UInt    num_coords,\n                             FT_Fixed*  coords );\n\n  typedef FT_Error\n  (*FT_Set_MM_Blend_Func)( FT_Face   face,\n                           FT_UInt   num_coords,\n                           FT_Long*  coords );\n\n\n  FT_DEFINE_SERVICE( MultiMasters )\n  {\n    FT_Get_MM_Func          get_mm;\n    FT_Set_MM_Design_Func   set_mm_design;\n    FT_Set_MM_Blend_Func    set_mm_blend;\n    FT_Get_MM_Var_Func      get_mm_var;\n    FT_Set_Var_Design_Func  set_var_design;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  static const FT_Service_MultiMastersRec  class_ =                         \\\n  {                                                                         \\\n    get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_    \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Service_MultiMastersRec*  clazz )            \\\n  {                                                                         \\\n    clazz->get_mm         = get_mm_;                                        \\\n    clazz->set_mm_design  = set_mm_design_;                                 \\\n    clazz->set_mm_blend   = set_mm_blend_;                                  \\\n    clazz->get_mm_var     = get_mm_var_;                                    \\\n    clazz->set_var_design = set_var_design_;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svotval.h                                                              */\n/*                                                                         */\n/*    The FreeType OpenType validation service (specification).            */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVOTVAL_H__\n#define __SVOTVAL_H__\n\n#include FT_OPENTYPE_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_OPENTYPE_VALIDATE  \"opentype-validate\"\n\n\n  typedef FT_Error\n  (*otv_validate_func)( FT_Face volatile  face,\n                        FT_UInt           ot_flags,\n                        FT_Bytes         *base,\n                        FT_Bytes         *gdef,\n                        FT_Bytes         *gpos,\n                        FT_Bytes         *gsub,\n                        FT_Bytes         *jstf );\n\n\n  FT_DEFINE_SERVICE( OTvalidate )\n  {\n    otv_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpfr.h                                                                */\n/*                                                                         */\n/*    Internal PFR service functions (specification).                      */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPFR_H__\n#define __SVPFR_H__\n\n#include FT_PFR_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PFR_METRICS  \"pfr-metrics\"\n\n\n  typedef FT_Error\n  (*FT_PFR_GetMetricsFunc)( FT_Face    face,\n                            FT_UInt   *aoutline,\n                            FT_UInt   *ametrics,\n                            FT_Fixed  *ax_scale,\n                            FT_Fixed  *ay_scale );\n\n  typedef FT_Error\n  (*FT_PFR_GetKerningFunc)( FT_Face     face,\n                            FT_UInt     left,\n                            FT_UInt     right,\n                            FT_Vector  *avector );\n\n  typedef FT_Error\n  (*FT_PFR_GetAdvanceFunc)( FT_Face   face,\n                            FT_UInt   gindex,\n                            FT_Pos   *aadvance );\n\n\n  FT_DEFINE_SERVICE( PfrMetrics )\n  {\n    FT_PFR_GetMetricsFunc  get_metrics;\n    FT_PFR_GetKerningFunc  get_kerning;\n    FT_PFR_GetAdvanceFunc  get_advance;\n\n  };\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __SVPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svpostnm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpostnm.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript name services (specification).               */\n/*                                                                         */\n/*  Copyright 2003, 2007, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPOSTNM_H__\n#define __SVPOSTNM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n  /*\n   *  A trivial service used to retrieve the PostScript name of a given\n   *  font when available.  The `get_name' field should never be NULL.\n   *\n   *  The corresponding function can return NULL to indicate that the\n   *  PostScript name is not available.\n   *\n   *  The name is owned by the face and will be destroyed with it.\n   */\n\n#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME  \"postscript-font-name\"\n\n\n  typedef const char*\n  (*FT_PsName_GetFunc)( FT_Face  face );\n\n\n  FT_DEFINE_SERVICE( PsFontName )\n  {\n    FT_PsName_GetFunc  get_ps_font_name;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  static const FT_Service_PsFontNameRec  class_ =                    \\\n  {                                                                  \\\n    get_ps_font_name_                                                \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  void                                                               \\\n  FT_Init_Class_ ## class_( FT_Library                 library,      \\\n                            FT_Service_PsFontNameRec*  clazz )       \\\n  {                                                                  \\\n    FT_UNUSED( library );                                            \\\n                                                                     \\\n    clazz->get_ps_font_name = get_ps_font_name_;                     \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPOSTNM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svprop.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svprop.h                                                               */\n/*                                                                         */\n/*    The FreeType property service (specification).                       */\n/*                                                                         */\n/*  Copyright 2012 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPROP_H__\n#define __SVPROP_H__\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PROPERTIES  \"properties\"\n\n\n  typedef FT_Error\n  (*FT_Properties_SetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            const void*  value );\n\n  typedef FT_Error\n  (*FT_Properties_GetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            void*        value );\n\n\n  FT_DEFINE_SERVICE( Properties )\n  {\n    FT_Properties_SetFunc  set_property;\n    FT_Properties_GetFunc  get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,          \\\n                                         set_property_,   \\\n                                         get_property_ )  \\\n  static const FT_Service_PropertiesRec  class_ =         \\\n  {                                                       \\\n    set_property_,                                        \\\n    get_property_                                         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,                \\\n                                         set_property_,         \\\n                                         get_property_ )        \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Service_PropertiesRec*  clazz )  \\\n  {                                                             \\\n    clazz->set_property = set_property_;                        \\\n    clazz->get_property = get_property_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPROP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svpscmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpscmap.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript charmap service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2006, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSCMAP_H__\n#define __SVPSCMAP_H__\n\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_CMAPS  \"postscript-cmaps\"\n\n\n  /*\n   *  Adobe glyph name to unicode value.\n   */\n  typedef FT_UInt32\n  (*PS_Unicode_ValueFunc)( const char*  glyph_name );\n\n  /*\n   *  Macintosh name id to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Macintosh_NameFunc)( FT_UInt  name_index );\n\n  /*\n   *  Adobe standard string ID to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );\n\n\n  /*\n   *  Simple unicode -> glyph index charmap built from font glyph names\n   *  table.\n   */\n  typedef struct  PS_UniMap_\n  {\n    FT_UInt32  unicode;      /* bit 31 set: is glyph variant */\n    FT_UInt    glyph_index;\n\n  } PS_UniMap;\n\n\n  typedef struct PS_UnicodesRec_*  PS_Unicodes;\n\n  typedef struct  PS_UnicodesRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt     num_maps;\n    PS_UniMap*  maps;\n\n  } PS_UnicodesRec;\n\n\n  /*\n   *  A function which returns a glyph name for a given index.  Returns\n   *  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_GetGlyphNameFunc)( FT_Pointer  data,\n                          FT_UInt     string_index );\n\n  /*\n   *  A function used to release the glyph name returned by\n   *  PS_GetGlyphNameFunc, when needed\n   */\n  typedef void\n  (*PS_FreeGlyphNameFunc)( FT_Pointer  data,\n                           const char*  name );\n\n  typedef FT_Error\n  (*PS_Unicodes_InitFunc)( FT_Memory             memory,\n                           PS_Unicodes           unicodes,\n                           FT_UInt               num_glyphs,\n                           PS_GetGlyphNameFunc   get_glyph_name,\n                           PS_FreeGlyphNameFunc  free_glyph_name,\n                           FT_Pointer            glyph_data );\n\n  typedef FT_UInt\n  (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,\n                                FT_UInt32    unicode );\n\n  typedef FT_UInt32\n  (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,\n                               FT_UInt32   *unicode );\n\n\n  FT_DEFINE_SERVICE( PsCMaps )\n  {\n    PS_Unicode_ValueFunc       unicode_value;\n\n    PS_Unicodes_InitFunc       unicodes_init;\n    PS_Unicodes_CharIndexFunc  unicodes_char_index;\n    PS_Unicodes_CharNextFunc   unicodes_char_next;\n\n    PS_Macintosh_NameFunc      macintosh_name;\n    PS_Adobe_Std_StringsFunc   adobe_std_strings;\n    const unsigned short*      adobe_std_encoding;\n    const unsigned short*      adobe_expert_encoding;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  static const FT_Service_PsCMapsRec  class_ =                              \\\n  {                                                                         \\\n    unicode_value_, unicodes_init_,                                         \\\n    unicodes_char_index_, unicodes_char_next_, macintosh_name_,             \\\n    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library              library,                \\\n                            FT_Service_PsCMapsRec*  clazz )                 \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->unicode_value         = unicode_value_;                          \\\n    clazz->unicodes_init         = unicodes_init_;                          \\\n    clazz->unicodes_char_index   = unicodes_char_index_;                    \\\n    clazz->unicodes_char_next    = unicodes_char_next_;                     \\\n    clazz->macintosh_name        = macintosh_name_;                         \\\n    clazz->adobe_std_strings     = adobe_std_strings_;                      \\\n    clazz->adobe_std_encoding    = adobe_std_encoding_;                     \\\n    clazz->adobe_expert_encoding = adobe_expert_encoding_;                  \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svpsinfo.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpsinfo.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript info service (specification).                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2011, 2012 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSINFO_H__\n#define __SVPSINFO_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_INFO  \"postscript-info\"\n\n\n  typedef FT_Error\n  (*PS_GetFontInfoFunc)( FT_Face          face,\n                         PS_FontInfoRec*  afont_info );\n\n  typedef FT_Error\n  (*PS_GetFontExtraFunc)( FT_Face           face,\n                          PS_FontExtraRec*  afont_extra );\n\n  typedef FT_Int\n  (*PS_HasGlyphNamesFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*PS_GetFontPrivateFunc)( FT_Face         face,\n                            PS_PrivateRec*  afont_private );\n\n  typedef FT_Long\n  (*PS_GetFontValueFunc)( FT_Face       face,\n                          PS_Dict_Keys  key,\n                          FT_UInt       idx,\n                          void         *value,\n                          FT_Long       value_len );\n\n\n  FT_DEFINE_SERVICE( PsInfo )\n  {\n    PS_GetFontInfoFunc     ps_get_font_info;\n    PS_GetFontExtraFunc    ps_get_font_extra;\n    PS_HasGlyphNamesFunc   ps_has_glyph_names;\n    PS_GetFontPrivateFunc  ps_get_font_private;\n    PS_GetFontValueFunc    ps_get_font_value;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  static const FT_Service_PsInfoRec  class_ =                    \\\n  {                                                              \\\n    get_font_info_, ps_get_font_extra_, has_glyph_names_,        \\\n    get_font_private_, get_font_value_                           \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  void                                                           \\\n  FT_Init_Class_ ## class_( FT_Library             library,      \\\n                            FT_Service_PsInfoRec*  clazz )       \\\n  {                                                              \\\n    FT_UNUSED( library );                                        \\\n                                                                 \\\n    clazz->ps_get_font_info    = get_font_info_;                 \\\n    clazz->ps_get_font_extra   = ps_get_font_extra_;             \\\n    clazz->ps_has_glyph_names  = has_glyph_names_;               \\\n    clazz->ps_get_font_private = get_font_private_;              \\\n    clazz->ps_get_font_value   = get_font_value_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSINFO_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svsfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svsfnt.h                                                               */\n/*                                                                         */\n/*    The FreeType SFNT table loading service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVSFNT_H__\n#define __SVSFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_SFNT_TABLE  \"sfnt-table\"\n\n\n  /*\n   * Used to implement FT_Load_Sfnt_Table().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableLoadFunc)( FT_Face    face,\n                            FT_ULong   tag,\n                            FT_Long    offset,\n                            FT_Byte*   buffer,\n                            FT_ULong*  length );\n\n  /*\n   * Used to implement FT_Get_Sfnt_Table().\n   */\n  typedef void*\n  (*FT_SFNT_TableGetFunc)( FT_Face      face,\n                           FT_Sfnt_Tag  tag );\n\n\n  /*\n   * Used to implement FT_Sfnt_Table_Info().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableInfoFunc)( FT_Face    face,\n                            FT_UInt    idx,\n                            FT_ULong  *tag,\n                            FT_ULong  *offset,\n                            FT_ULong  *length );\n\n\n  FT_DEFINE_SERVICE( SFNT_Table )\n  {\n    FT_SFNT_TableLoadFunc  load_table;\n    FT_SFNT_TableGetFunc   get_table;\n    FT_SFNT_TableInfoFunc  table_info;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ )  \\\n  static const FT_Service_SFNT_TableRec  class_ =                      \\\n  {                                                                    \\\n    load_, get_, info_                                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \\\n  void                                                                \\\n  FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec*  clazz )        \\\n  {                                                                   \\\n    clazz->load_table = load_;                                        \\\n    clazz->get_table  = get_;                                         \\\n    clazz->table_info = info_;                                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVSFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svttcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttcmap.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType/sfnt cmap extra information service.           */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  Masatake YAMATO, Redhat K.K.                                           */\n/*                                                                         */\n/*  Copyright 2003, 2008, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/* Development of this service is support of\n   Information-technology Promotion Agency, Japan. */\n\n#ifndef __SVTTCMAP_H__\n#define __SVTTCMAP_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_CMAP  \"tt-cmaps\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_CMapInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to store TrueType/sfnt specific cmap information  */\n  /*    which is not covered by the generic @FT_CharMap structure.  This   */\n  /*    structure can be accessed with the @FT_Get_TT_CMap_Info function.  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    language ::                                                        */\n  /*      The language ID used in Mac fonts.  Definitions of values are in */\n  /*      freetype/ttnameid.h.                                             */\n  /*                                                                       */\n  /*    format ::                                                          */\n  /*      The cmap format.  OpenType 1.5 defines the formats 0 (byte       */\n  /*      encoding table), 2~(high-byte mapping through table), 4~(segment */\n  /*      mapping to delta values), 6~(trimmed table mapping), 8~(mixed    */\n  /*      16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented   */\n  /*      coverage), and 14 (Unicode Variation Sequences).                 */\n  /*                                                                       */\n  typedef struct  TT_CMapInfo_\n  {\n    FT_ULong  language;\n    FT_Long   format;\n\n  } TT_CMapInfo;\n\n\n  typedef FT_Error\n  (*TT_CMap_Info_GetFunc)( FT_CharMap    charmap,\n                           TT_CMapInfo  *cmap_info );\n\n\n  FT_DEFINE_SERVICE( TTCMaps )\n  {\n    TT_CMap_Info_GetFunc  get_cmap_info;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  static const FT_Service_TTCMapsRec  class_ =                  \\\n  {                                                             \\\n    get_cmap_info_                                              \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Library              library,    \\\n                            FT_Service_TTCMapsRec*  clazz )     \\\n  {                                                             \\\n    FT_UNUSED( library );                                       \\\n                                                                \\\n    clazz->get_cmap_info = get_cmap_info_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svtteng.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svtteng.h                                                              */\n/*                                                                         */\n/*    The FreeType TrueType engine query service (specification).          */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVTTENG_H__\n#define __SVTTENG_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_TRUETYPE_ENGINE  \"truetype-engine\"\n\n  /*\n   * Used to implement FT_Get_TrueType_Engine_Type\n   */\n\n  FT_DEFINE_SERVICE( TrueTypeEngine )\n  {\n    FT_TrueTypeEngineType  engine_type;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVTTENG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svttglyf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttglyf.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType glyph service.                                 */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by David Turner.                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __SVTTGLYF_H__\n#define __SVTTGLYF_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_GLYF  \"tt-glyf\"\n\n\n  typedef FT_ULong\n  (*TT_Glyf_GetLocationFunc)( FT_Face    face,\n                              FT_UInt    gindex,\n                              FT_ULong  *psize );\n\n  FT_DEFINE_SERVICE( TTGlyf )\n  {\n    TT_Glyf_GetLocationFunc  get_location;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  static const FT_Service_TTGlyfRec  class_ =                 \\\n  {                                                           \\\n    get_location_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  void                                                        \\\n  FT_Init_Class_ ## class_( FT_Service_TTGlyfRec*  clazz )    \\\n  {                                                           \\\n    clazz->get_location = get_location_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTGLYF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svwinfnt.h                                                             */\n/*                                                                         */\n/*    The FreeType Windows FNT/FONT service (specification).               */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVWINFNT_H__\n#define __SVWINFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_WINFONTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_WINFNT  \"winfonts\"\n\n  typedef FT_Error\n  (*FT_WinFnt_GetHeaderFunc)( FT_Face               face,\n                              FT_WinFNT_HeaderRec  *aheader );\n\n\n  FT_DEFINE_SERVICE( WinFnt )\n  {\n    FT_WinFnt_GetHeaderFunc  get_header;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVWINFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/services/svxf86nm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svxf86nm.h                                                             */\n/*                                                                         */\n/*    The FreeType XFree86 services (specification only).                  */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVXF86NM_H__\n#define __SVXF86NM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A trivial service used to return the name of a face's font driver,\n   *  according to the XFree86 nomenclature.  Note that the service data\n   *  is a simple constant string pointer.\n   */\n\n#define FT_SERVICE_ID_XF86_NAME  \"xf86-driver-name\"\n\n#define FT_XF86_FORMAT_TRUETYPE  \"TrueType\"\n#define FT_XF86_FORMAT_TYPE_1    \"Type 1\"\n#define FT_XF86_FORMAT_BDF       \"BDF\"\n#define FT_XF86_FORMAT_PCF       \"PCF\"\n#define FT_XF86_FORMAT_TYPE_42   \"Type 42\"\n#define FT_XF86_FORMAT_CID       \"CID Type 1\"\n#define FT_XF86_FORMAT_CFF       \"CFF\"\n#define FT_XF86_FORMAT_PFR       \"PFR\"\n#define FT_XF86_FORMAT_WINFNT    \"Windows FNT\"\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVXF86NM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/sfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfnt.h                                                                 */\n/*                                                                         */\n/*    High-level `sfnt' driver interface (specification).                  */\n/*                                                                         */\n/*  Copyright 1996-2006, 2009, 2012-2013 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFNT_H__\n#define __SFNT_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Init_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    First part of the SFNT face object initialization.  This finds     */\n  /*    the face in a SFNT file or collection, and load its format tag in  */\n  /*    face->format_tag.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  /*    This function recognizes fonts embedded in a `TrueType             */\n  /*    collection'.                                                       */\n  /*                                                                       */\n  /*    Once the format tag has been validated by the font driver, it      */\n  /*    should then call the TT_Load_Face_Func() callback to read the rest */\n  /*    of the SFNT tables in the object.                                  */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Init_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Second part of the SFNT face object initialization.  This loads    */\n  /*    the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function must be called after TT_Init_Face_Func().            */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Done_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A callback used to delete the common SFNT data from a face.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT destroy the face object.                    */\n  /*                                                                       */\n  typedef void\n  (*TT_Done_Face_Func)( TT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Any_Func                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load any font table into client memory.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: The face object to look for.                             */\n  /*                                                                       */\n  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */\n  /*              to access the whole font file, else set this parameter   */\n  /*              to a valid TrueType table tag that you can forge with    */\n  /*              the MAKE_TT_TAG macro.                                   */\n  /*                                                                       */\n  /*    offset :: The starting offset in the table (or the file if         */\n  /*              tag == 0).                                               */\n  /*                                                                       */\n  /*    length :: The address of the decision variable:                    */\n  /*                                                                       */\n  /*                If length == NULL:                                     */\n  /*                  Loads the whole table.  Returns an error if          */\n  /*                  `offset' == 0!                                       */\n  /*                                                                       */\n  /*                If *length == 0:                                       */\n  /*                  Exits immediately; returning the length of the given */\n  /*                  table or of the font file, depending on the value of */\n  /*                  `tag'.                                               */\n  /*                                                                       */\n  /*                If *length != 0:                                       */\n  /*                  Loads the next `length' bytes of table or font,      */\n  /*                  starting at offset `offset' (in table or font too).  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer :: The address of target buffer.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    TrueType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Any_Func)( TT_Face    face,\n                       FT_ULong   tag,\n                       FT_Long    offset,\n                       FT_Byte   *buffer,\n                       FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Find_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether an embedded bitmap (an `sbit') exists for a given    */\n  /*    glyph, at a given strike.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    glyph_index   :: The glyph index.                                  */\n  /*                                                                       */\n  /*    strike_index  :: The current strike index.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    arange        :: The SBit range containing the glyph index.        */\n  /*                                                                       */\n  /*    astrike       :: The SBit strike containing the glyph index.       */\n  /*                                                                       */\n  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns                    */\n  /*    SFNT_Err_Invalid_Argument if no sbit exists for the requested      */\n  /*    glyph.                                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Find_SBit_Image_Func)( TT_Face          face,\n                              FT_UInt          glyph_index,\n                              FT_ULong         strike_index,\n                              TT_SBit_Range   *arange,\n                              TT_SBit_Strike  *astrike,\n                              FT_ULong        *aglyph_offset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Metrics_Func                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the big metrics for a given embedded bitmap.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream      :: The input stream.                                   */\n  /*                                                                       */\n  /*    range       :: The SBit range containing the glyph.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    big_metrics :: A big SBit metrics structure for the glyph.         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be positioned at the glyph's offset within  */\n  /*    the `EBDT' table before the call.                                  */\n  /*                                                                       */\n  /*    If the image format uses variable metrics, the stream cursor is    */\n  /*    positioned just after the metrics header in the `EBDT' table on    */\n  /*    function exit.                                                     */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Metrics_Func)( FT_Stream        stream,\n                                TT_SBit_Range    range,\n                                TT_SBit_Metrics  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given glyph sbit image from the font resource.  This also   */\n  /*    returns its metrics.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      The target face object.                                          */\n  /*                                                                       */\n  /*    strike_index ::                                                    */\n  /*      The strike index.                                                */\n  /*                                                                       */\n  /*    glyph_index ::                                                     */\n  /*      The current glyph index.                                         */\n  /*                                                                       */\n  /*    load_flags ::                                                      */\n  /*      The current load flags.                                          */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      The input stream.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amap ::                                                            */\n  /*      The target pixmap.                                               */\n  /*                                                                       */\n  /*    ametrics ::                                                        */\n  /*      A big sbit metrics structure for the glyph image.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    glyph sbit exists for the index.                                   */\n  /*                                                                       */\n  /*  <Note>                                                               */\n  /*    The `map.buffer' field is always freed before the glyph is loaded. */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Image_Func)( TT_Face              face,\n                              FT_ULong             strike_index,\n                              FT_UInt              glyph_index,\n                              FT_UInt              load_flags,\n                              FT_Stream            stream,\n                              FT_Bitmap           *amap,\n                              TT_SBit_MetricsRec  *ametrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Set_SBit_Strike_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select an sbit strike for a given size request.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    req           :: The size request.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    astrike_index :: The index of the sbit strike.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    sbit strike exists for the selected ppem values.                   */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Set_SBit_Strike_Func)( TT_Face          face,\n                              FT_Size_Request  req,\n                              FT_ULong*        astrike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Strike_Metrics_Func                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the metrics of a given strike.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    strike_index  :: The strike index.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    metrics       :: the metrics of the strike.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    such sbit strike exists.                                           */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Strike_Metrics_Func)( TT_Face           face,\n                                  FT_ULong          strike_index,\n                                  FT_Size_Metrics*  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_PS_Name_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the PostScript glyph name of a glyph.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    idx  :: The glyph index.                                           */\n  /*                                                                       */\n  /*    PSname :: The address of a string pointer.  Will be NULL in case   */\n  /*              of error, otherwise it is a pointer to the glyph name.   */\n  /*                                                                       */\n  /*              You must not modify the returned string!                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_PS_Name_Func)( TT_Face      face,\n                          FT_UInt      idx,\n                          FT_String**  PSname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Metrics_Func                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a metrics table, which is a table with a horizontal and a     */\n  /*    vertical version.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load the vertical one.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Metrics_Func)( TT_Face    face,\n                           FT_Stream  stream,\n                           FT_Bool    vertical );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_Metrics_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the horizontal or vertical header in a face object.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load vertical metrics.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_Metrics_Func)( TT_Face     face,\n                          FT_Bool     vertical,\n                          FT_UInt     gindex,\n                          FT_Short*   abearing,\n                          FT_UShort*  aadvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The function uses `face->goto_table' to seek the stream to the     */\n  /*    start of the table, except while loading the font directory.       */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Table_Func)( TT_Face    face,\n                         FT_Stream  stream );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Free_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Free a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  typedef void\n  (*TT_Free_Table_Func)( TT_Face  face );\n\n\n  /*\n   * @functype:\n   *    TT_Face_GetKerningFunc\n   *\n   * @description:\n   *    Return the horizontal kerning value between two glyphs.\n   *\n   * @input:\n   *    face        :: A handle to the source face object.\n   *    left_glyph  :: The left glyph index.\n   *    right_glyph :: The right glyph index.\n   *\n   * @return:\n   *    The kerning value in font units.\n   */\n  typedef FT_Int\n  (*TT_Face_GetKerningFunc)( TT_Face  face,\n                             FT_UInt  left_glyph,\n                             FT_UInt  right_glyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_Interface                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure holds pointers to the functions used to load and    */\n  /*    free the basic tables that are required in a `sfnt' font file.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Check the various xxx_Func() descriptions for details.             */\n  /*                                                                       */\n  typedef struct  SFNT_Interface_\n  {\n    TT_Loader_GotoTableFunc      goto_table;\n\n    TT_Init_Face_Func            init_face;\n    TT_Load_Face_Func            load_face;\n    TT_Done_Face_Func            done_face;\n    FT_Module_Requester          get_interface;\n\n    TT_Load_Any_Func             load_any;\n\n    /* these functions are called by `load_face' but they can also  */\n    /* be called from external modules, if there is a need to do so */\n    TT_Load_Table_Func           load_head;\n    TT_Load_Metrics_Func         load_hhea;\n    TT_Load_Table_Func           load_cmap;\n    TT_Load_Table_Func           load_maxp;\n    TT_Load_Table_Func           load_os2;\n    TT_Load_Table_Func           load_post;\n\n    TT_Load_Table_Func           load_name;\n    TT_Free_Table_Func           free_name;\n\n    /* this field was called `load_kerning' up to version 2.1.10 */\n    TT_Load_Table_Func           load_kern;\n\n    TT_Load_Table_Func           load_gasp;\n    TT_Load_Table_Func           load_pclt;\n\n    /* see `ttload.h'; this field was called `load_bitmap_header' up to */\n    /* version 2.1.10                                                   */\n    TT_Load_Table_Func           load_bhed;\n\n    TT_Load_SBit_Image_Func      load_sbit_image;\n\n    /* see `ttpost.h' */\n    TT_Get_PS_Name_Func          get_psname;\n    TT_Free_Table_Func           free_psnames;\n\n    /* starting here, the structure differs from version 2.1.7 */\n\n    /* this field was introduced in version 2.1.8, named `get_psname' */\n    TT_Face_GetKerningFunc       get_kerning;\n\n    /* new elements introduced after version 2.1.10 */\n\n    /* load the font directory, i.e., the offset table and */\n    /* the table directory                                 */\n    TT_Load_Table_Func           load_font_dir;\n    TT_Load_Metrics_Func         load_hmtx;\n\n    TT_Load_Table_Func           load_eblc;\n    TT_Free_Table_Func           free_eblc;\n\n    TT_Set_SBit_Strike_Func      set_sbit_strike;\n    TT_Load_Strike_Metrics_Func  load_strike_metrics;\n\n    TT_Get_Metrics_Func          get_metrics;\n\n  } SFNT_Interface;\n\n\n  /* transitional */\n  typedef SFNT_Interface*   SFNT_Service;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SFNT_INTERFACE(        \\\n          class_,                        \\\n          goto_table_,                   \\\n          init_face_,                    \\\n          load_face_,                    \\\n          done_face_,                    \\\n          get_interface_,                \\\n          load_any_,                     \\\n          load_head_,                    \\\n          load_hhea_,                    \\\n          load_cmap_,                    \\\n          load_maxp_,                    \\\n          load_os2_,                     \\\n          load_post_,                    \\\n          load_name_,                    \\\n          free_name_,                    \\\n          load_kern_,                    \\\n          load_gasp_,                    \\\n          load_pclt_,                    \\\n          load_bhed_,                    \\\n          load_sbit_image_,              \\\n          get_psname_,                   \\\n          free_psnames_,                 \\\n          get_kerning_,                  \\\n          load_font_dir_,                \\\n          load_hmtx_,                    \\\n          load_eblc_,                    \\\n          free_eblc_,                    \\\n          set_sbit_strike_,              \\\n          load_strike_metrics_,          \\\n          get_metrics_ )                 \\\n  static const SFNT_Interface  class_ =  \\\n  {                                      \\\n    goto_table_,                         \\\n    init_face_,                          \\\n    load_face_,                          \\\n    done_face_,                          \\\n    get_interface_,                      \\\n    load_any_,                           \\\n    load_head_,                          \\\n    load_hhea_,                          \\\n    load_cmap_,                          \\\n    load_maxp_,                          \\\n    load_os2_,                           \\\n    load_post_,                          \\\n    load_name_,                          \\\n    free_name_,                          \\\n    load_kern_,                          \\\n    load_gasp_,                          \\\n    load_pclt_,                          \\\n    load_bhed_,                          \\\n    load_sbit_image_,                    \\\n    get_psname_,                         \\\n    free_psnames_,                       \\\n    get_kerning_,                        \\\n    load_font_dir_,                      \\\n    load_hmtx_,                          \\\n    load_eblc_,                          \\\n    free_eblc_,                          \\\n    set_sbit_strike_,                    \\\n    load_strike_metrics_,                \\\n    get_metrics_,                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_INTERNAL( a, a_ )  \\\n          clazz->a = a_;\n\n#define FT_DEFINE_SFNT_INTERFACE(                       \\\n          class_,                                       \\\n          goto_table_,                                  \\\n          init_face_,                                   \\\n          load_face_,                                   \\\n          done_face_,                                   \\\n          get_interface_,                               \\\n          load_any_,                                    \\\n          load_head_,                                   \\\n          load_hhea_,                                   \\\n          load_cmap_,                                   \\\n          load_maxp_,                                   \\\n          load_os2_,                                    \\\n          load_post_,                                   \\\n          load_name_,                                   \\\n          free_name_,                                   \\\n          load_kern_,                                   \\\n          load_gasp_,                                   \\\n          load_pclt_,                                   \\\n          load_bhed_,                                   \\\n          load_sbit_image_,                             \\\n          get_psname_,                                  \\\n          free_psnames_,                                \\\n          get_kerning_,                                 \\\n          load_font_dir_,                               \\\n          load_hmtx_,                                   \\\n          load_eblc_,                                   \\\n          free_eblc_,                                   \\\n          set_sbit_strike_,                             \\\n          load_strike_metrics_,                         \\\n          get_metrics_ )                                \\\n  void                                                  \\\n  FT_Init_Class_ ## class_( FT_Library       library,   \\\n                            SFNT_Interface*  clazz )    \\\n  {                                                     \\\n    FT_UNUSED( library );                               \\\n                                                        \\\n    clazz->goto_table          = goto_table_;           \\\n    clazz->init_face           = init_face_;            \\\n    clazz->load_face           = load_face_;            \\\n    clazz->done_face           = done_face_;            \\\n    clazz->get_interface       = get_interface_;        \\\n    clazz->load_any            = load_any_;             \\\n    clazz->load_head           = load_head_;            \\\n    clazz->load_hhea           = load_hhea_;            \\\n    clazz->load_cmap           = load_cmap_;            \\\n    clazz->load_maxp           = load_maxp_;            \\\n    clazz->load_os2            = load_os2_;             \\\n    clazz->load_post           = load_post_;            \\\n    clazz->load_name           = load_name_;            \\\n    clazz->free_name           = free_name_;            \\\n    clazz->load_kern           = load_kern_;            \\\n    clazz->load_gasp           = load_gasp_;            \\\n    clazz->load_pclt           = load_pclt_;            \\\n    clazz->load_bhed           = load_bhed_;            \\\n    clazz->load_sbit_image     = load_sbit_image_;      \\\n    clazz->get_psname          = get_psname_;           \\\n    clazz->free_psnames        = free_psnames_;         \\\n    clazz->get_kerning         = get_kerning_;          \\\n    clazz->load_font_dir       = load_font_dir_;        \\\n    clazz->load_hmtx           = load_hmtx_;            \\\n    clazz->load_eblc           = load_eblc_;            \\\n    clazz->free_eblc           = free_eblc_;            \\\n    clazz->set_sbit_strike     = set_sbit_strike_;      \\\n    clazz->load_strike_metrics = load_strike_metrics_;  \\\n    clazz->get_metrics         = get_metrics_;          \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __SFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/t1types.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1types.h                                                              */\n/*                                                                         */\n/*    Basic Type1/Type2 type definitions and interface (specification      */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TYPES_H__\n#define __T1TYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_EncodingRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling a custom encoding.                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_chars  :: The number of character codes in the encoding.       */\n  /*                  Usually 256.                                         */\n  /*                                                                       */\n  /*    code_first :: The lowest valid character code in the encoding.     */\n  /*                                                                       */\n  /*    code_last  :: The highest valid character code in the encoding     */\n  /*                  + 1. When equal to code_first there are no valid     */\n  /*                  character codes.                                     */\n  /*                                                                       */\n  /*    char_index :: An array of corresponding glyph indices.             */\n  /*                                                                       */\n  /*    char_name  :: An array of corresponding glyph names.               */\n  /*                                                                       */\n  typedef struct  T1_EncodingRecRec_\n  {\n    FT_Int       num_chars;\n    FT_Int       code_first;\n    FT_Int       code_last;\n\n    FT_UShort*   char_index;\n    FT_String**  char_name;\n\n  } T1_EncodingRec, *T1_Encoding;\n\n\n  /* used to hold extra data of PS_FontInfoRec that\n   * cannot be stored in the publicly defined structure.\n   *\n   * Note these can't be blended with multiple-masters.\n   */\n  typedef struct  PS_FontExtraRec_\n  {\n    FT_UShort  fs_type;\n\n  } PS_FontExtraRec;\n\n\n  typedef struct  T1_FontRec_\n  {\n    PS_FontInfoRec   font_info;         /* font info dictionary   */\n    PS_FontExtraRec  font_extra;        /* font info extra fields */\n    PS_PrivateRec    private_dict;      /* private dictionary     */\n    FT_String*       font_name;         /* top-level dictionary   */\n\n    T1_EncodingType  encoding_type;\n    T1_EncodingRec   encoding;\n\n    FT_Byte*         subrs_block;\n    FT_Byte*         charstrings_block;\n    FT_Byte*         glyph_names_block;\n\n    FT_Int           num_subrs;\n    FT_Byte**        subrs;\n    FT_PtrDist*      subrs_len;\n\n    FT_Int           num_glyphs;\n    FT_String**      glyph_names;       /* array of glyph names       */\n    FT_Byte**        charstrings;       /* array of glyph charstrings */\n    FT_PtrDist*      charstrings_len;\n\n    FT_Byte          paint_type;\n    FT_Byte          font_type;\n    FT_Matrix        font_matrix;\n    FT_Vector        font_offset;\n    FT_BBox          font_bbox;\n    FT_Long          font_id;\n\n    FT_Fixed         stroke_width;\n\n  } T1_FontRec, *T1_Font;\n\n\n  typedef struct  CID_SubrsRec_\n  {\n    FT_UInt    num_subrs;\n    FT_Byte**  code;\n\n  } CID_SubrsRec, *CID_Subrs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                AFM FONT INFORMATION STRUCTURES                    ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  AFM_TrackKernRec_\n  {\n    FT_Int    degree;\n    FT_Fixed  min_ptsize;\n    FT_Fixed  min_kern;\n    FT_Fixed  max_ptsize;\n    FT_Fixed  max_kern;\n\n  } AFM_TrackKernRec, *AFM_TrackKern;\n\n  typedef struct  AFM_KernPairRec_\n  {\n    FT_Int  index1;\n    FT_Int  index2;\n    FT_Int  x;\n    FT_Int  y;\n\n  } AFM_KernPairRec, *AFM_KernPair;\n\n  typedef struct  AFM_FontInfoRec_\n  {\n    FT_Bool        IsCIDFont;\n    FT_BBox        FontBBox;\n    FT_Fixed       Ascender;\n    FT_Fixed       Descender;\n    AFM_TrackKern  TrackKerns;   /* free if non-NULL */\n    FT_Int         NumTrackKern;\n    AFM_KernPair   KernPairs;    /* free if non-NULL */\n    FT_Int         NumKernPair;\n\n  } AFM_FontInfoRec, *AFM_FontInfo;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_FaceRec_*   T1_Face;\n  typedef struct CID_FaceRec_*  CID_Face;\n\n\n  typedef struct  T1_FaceRec_\n  {\n    FT_FaceRec      root;\n    T1_FontRec      type1;\n    const void*     psnames;\n    const void*     psaux;\n    const void*     afm_data;\n    FT_CharMapRec   charmaprecs[2];\n    FT_CharMap      charmaps[2];\n\n    /* support for Multiple Masters fonts */\n    PS_Blend        blend;\n\n    /* undocumented, optional: indices of subroutines that express      */\n    /* the NormalizeDesignVector and the ConvertDesignVector procedure, */\n    /* respectively, as Type 2 charstrings; -1 if keywords not present  */\n    FT_Int           ndv_idx;\n    FT_Int           cdv_idx;\n\n    /* undocumented, optional: has the same meaning as len_buildchar */\n    /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25    */\n    FT_UInt          len_buildchar;\n    FT_Long*         buildchar;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    const void*     pshinter;\n\n  } T1_FaceRec;\n\n\n  typedef struct  CID_FaceRec_\n  {\n    FT_FaceRec       root;\n    void*            psnames;\n    void*            psaux;\n    CID_FaceInfoRec  cid;\n    PS_FontExtraRec  font_extra;\n#if 0\n    void*            afm_data;\n#endif\n    CID_Subrs        subrs;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    void*            pshinter;\n\n    /* since version 2.1.8, but was originally positioned after `afm_data' */\n    FT_Byte*         binary_data; /* used if hex data has been converted */\n    FT_Stream        cid_stream;\n\n  } CID_FaceRec;\n\n\nFT_END_HEADER\n\n#endif /* __T1TYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/internal/tttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttypes.h                                                              */\n/*                                                                         */\n/*    Basic SFNT/TrueType type definitions and interface (specification    */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2008, 2012-2013 by                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTYPES_H__\n#define __TTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TRUETYPE_TABLES_H\n#include FT_INTERNAL_OBJECTS_H\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include FT_MULTIPLE_MASTERS_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TTC_HeaderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    TrueType collection header.  This table contains the offsets of    */\n  /*    the font headers of each distinct TrueType face in the file.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag     :: Must be `ttc ' to indicate a TrueType collection.       */\n  /*                                                                       */\n  /*    version :: The version number.                                     */\n  /*                                                                       */\n  /*    count   :: The number of faces in the collection.  The             */\n  /*               specification says this should be an unsigned long, but */\n  /*               we use a signed long since we need the value -1 for     */\n  /*               specific purposes.                                      */\n  /*                                                                       */\n  /*    offsets :: The offsets of the font headers, one per face.          */\n  /*                                                                       */\n  typedef struct  TTC_HeaderRec_\n  {\n    FT_ULong   tag;\n    FT_Fixed   version;\n    FT_Long    count;\n    FT_ULong*  offsets;\n\n  } TTC_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_HeaderRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    SFNT file format header.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format_tag     :: The font format tag.                             */\n  /*                                                                       */\n  /*    num_tables     :: The number of tables in file.                    */\n  /*                                                                       */\n  /*    search_range   :: Must be `16 * (max power of 2 <= num_tables)'.   */\n  /*                                                                       */\n  /*    entry_selector :: Must be log2 of `search_range / 16'.             */\n  /*                                                                       */\n  /*    range_shift    :: Must be `num_tables * 16 - search_range'.        */\n  /*                                                                       */\n  typedef struct  SFNT_HeaderRec_\n  {\n    FT_ULong   format_tag;\n    FT_UShort  num_tables;\n    FT_UShort  search_range;\n    FT_UShort  entry_selector;\n    FT_UShort  range_shift;\n\n    FT_ULong   offset;  /* not in file */\n\n  } SFNT_HeaderRec, *SFNT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure describes a given table of a TrueType font.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Tag      :: A four-bytes tag describing the table.                 */\n  /*                                                                       */\n  /*    CheckSum :: The table checksum.  This value can be ignored.        */\n  /*                                                                       */\n  /*    Offset   :: The offset of the table from the start of the TrueType */\n  /*                font in its resource.                                  */\n  /*                                                                       */\n  /*    Length   :: The table length (in bytes).                           */\n  /*                                                                       */\n  typedef struct  TT_TableRec_\n  {\n    FT_ULong  Tag;        /*        table type */\n    FT_ULong  CheckSum;   /*    table checksum */\n    FT_ULong  Offset;     /* table file offset */\n    FT_ULong  Length;     /*      table length */\n\n  } TT_TableRec, *TT_Table;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_LongMetricsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the long metrics of the `hmtx' and `vmtx'     */\n  /*    TrueType tables.  The values are expressed in font units.          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    advance :: The advance width or height for the glyph.              */\n  /*                                                                       */\n  /*    bearing :: The left-side or top-side bearing for the glyph.        */\n  /*                                                                       */\n  typedef struct  TT_LongMetricsRec_\n  {\n    FT_UShort  advance;\n    FT_Short   bearing;\n\n  } TT_LongMetricsRec, *TT_LongMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_ShortMetrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple type to model the short metrics of the `hmtx' and `vmtx'  */\n  /*    tables.                                                            */\n  /*                                                                       */\n  typedef FT_Short  TT_ShortMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameEntryRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling TrueType name records.  Name records are used */\n  /*    to store important strings like family name, style name,           */\n  /*    copyright, etc. in _localized_ versions (i.e., language, encoding, */\n  /*    etc).                                                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platformID   :: The ID of the name's encoding platform.            */\n  /*                                                                       */\n  /*    encodingID   :: The platform-specific ID for the name's encoding.  */\n  /*                                                                       */\n  /*    languageID   :: The platform-specific ID for the name's language.  */\n  /*                                                                       */\n  /*    nameID       :: The ID specifying what kind of name this is.       */\n  /*                                                                       */\n  /*    stringLength :: The length of the string in bytes.                 */\n  /*                                                                       */\n  /*    stringOffset :: The offset to the string in the `name' table.      */\n  /*                                                                       */\n  /*    string       :: A pointer to the string's bytes.  Note that these  */\n  /*                    are usually UTF-16 encoded characters.             */\n  /*                                                                       */\n  typedef struct  TT_NameEntryRec_\n  {\n    FT_UShort  platformID;\n    FT_UShort  encodingID;\n    FT_UShort  languageID;\n    FT_UShort  nameID;\n    FT_UShort  stringLength;\n    FT_ULong   stringOffset;\n\n    /* this last field is not defined in the spec */\n    /* but used by the FreeType engine            */\n\n    FT_Byte*   string;\n\n  } TT_NameEntryRec, *TT_NameEntry;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameTableRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType name table.                      */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format         :: The format of the name table.                    */\n  /*                                                                       */\n  /*    numNameRecords :: The number of names in table.                    */\n  /*                                                                       */\n  /*    storageOffset  :: The offset of the name table in the `name'       */\n  /*                      TrueType table.                                  */\n  /*                                                                       */\n  /*    names          :: An array of name records.                        */\n  /*                                                                       */\n  /*    stream         :: the file's input stream.                         */\n  /*                                                                       */\n  typedef struct  TT_NameTableRec_\n  {\n    FT_UShort         format;\n    FT_UInt           numNameRecords;\n    FT_UInt           storageOffset;\n    TT_NameEntryRec*  names;\n    FT_Stream         stream;\n\n  } TT_NameTableRec, *TT_NameTable;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRangeRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A tiny structure used to model a gasp range according to the       */\n  /*    TrueType specification.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    maxPPEM  :: The maximum ppem value to which `gaspFlag' applies.    */\n  /*                                                                       */\n  /*    gaspFlag :: A flag describing the grid-fitting and anti-aliasing   */\n  /*                modes to be used.                                      */\n  /*                                                                       */\n  typedef struct  TT_GaspRangeRec_\n  {\n    FT_UShort  maxPPEM;\n    FT_UShort  gaspFlag;\n\n  } TT_GaspRangeRec, *TT_GaspRange;\n\n\n#define TT_GASP_GRIDFIT  0x01\n#define TT_GASP_DOGRAY   0x02\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType `gasp' table used to specify     */\n  /*    grid-fitting and anti-aliasing behaviour.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version    :: The version number.                                  */\n  /*                                                                       */\n  /*    numRanges  :: The number of gasp ranges in table.                  */\n  /*                                                                       */\n  /*    gaspRanges :: An array of gasp ranges.                             */\n  /*                                                                       */\n  typedef struct  TT_Gasp_\n  {\n    FT_UShort     version;\n    FT_UShort     numRanges;\n    TT_GaspRange  gaspRanges;\n\n  } TT_GaspRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    EMBEDDED BITMAPS SUPPORT                       ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_MetricsRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the big metrics of a given glyph bitmap   */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or `bloc' (Apple) table.                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height       :: The glyph height in pixels.                        */\n  /*                                                                       */\n  /*    width        :: The glyph width in pixels.                         */\n  /*                                                                       */\n  /*    horiBearingX :: The horizontal left bearing.                       */\n  /*                                                                       */\n  /*    horiBearingY :: The horizontal top bearing.                        */\n  /*                                                                       */\n  /*    horiAdvance  :: The horizontal advance.                            */\n  /*                                                                       */\n  /*    vertBearingX :: The vertical left bearing.                         */\n  /*                                                                       */\n  /*    vertBearingY :: The vertical top bearing.                          */\n  /*                                                                       */\n  /*    vertAdvance  :: The vertical advance.                              */\n  /*                                                                       */\n  typedef struct  TT_SBit_MetricsRec_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  horiBearingX;\n    FT_Char  horiBearingY;\n    FT_Byte  horiAdvance;\n\n    FT_Char  vertBearingX;\n    FT_Char  vertBearingY;\n    FT_Byte  vertAdvance;\n\n  } TT_SBit_MetricsRec, *TT_SBit_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_SmallMetricsRec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the small metrics of a given glyph bitmap */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or the `bdat' (Apple) table.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height   :: The glyph height in pixels.                            */\n  /*                                                                       */\n  /*    width    :: The glyph width in pixels.                             */\n  /*                                                                       */\n  /*    bearingX :: The left-side bearing.                                 */\n  /*                                                                       */\n  /*    bearingY :: The top-side bearing.                                  */\n  /*                                                                       */\n  /*    advance  :: The advance width or height.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_Small_Metrics_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  bearingX;\n    FT_Char  bearingY;\n    FT_Byte  advance;\n\n  } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_LineMetricsRec                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe the text line metrics of a given      */\n  /*    bitmap strike, for either a horizontal or vertical layout.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    ascender                :: The ascender in pixels.                 */\n  /*                                                                       */\n  /*    descender               :: The descender in pixels.                */\n  /*                                                                       */\n  /*    max_width               :: The maximum glyph width in pixels.      */\n  /*                                                                       */\n  /*    caret_slope_enumerator  :: Rise of the caret slope, typically set  */\n  /*                               to 1 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_slope_denominator :: Rise of the caret slope, typically set  */\n  /*                               to 0 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_offset            :: Offset in pixels to move the caret for  */\n  /*                               proper positioning.                     */\n  /*                                                                       */\n  /*    min_origin_SB           :: Minimum of horiBearingX (resp.          */\n  /*                               vertBearingY).                          */\n  /*    min_advance_SB          :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horizontal advance -                  */\n  /*                                   ( horiBearingX + width )            */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertical advance -                    */\n  /*                                   ( vertBearingY + height )           */\n  /*                                                                       */\n  /*    max_before_BL           :: Maximum of horiBearingY (resp.          */\n  /*                               vertBearingY).                          */\n  /*                                                                       */\n  /*    min_after_BL            :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horiBearingY - height                 */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertBearingX - width                  */\n  /*                                                                       */\n  /*    pads                    :: Unused (to make the size of the record  */\n  /*                               a multiple of 32 bits.                  */\n  /*                                                                       */\n  typedef struct  TT_SBit_LineMetricsRec_\n  {\n    FT_Char  ascender;\n    FT_Char  descender;\n    FT_Byte  max_width;\n    FT_Char  caret_slope_numerator;\n    FT_Char  caret_slope_denominator;\n    FT_Char  caret_offset;\n    FT_Char  min_origin_SB;\n    FT_Char  min_advance_SB;\n    FT_Char  max_before_BL;\n    FT_Char  min_after_BL;\n    FT_Char  pads[2];\n\n  } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_RangeRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A TrueType/OpenType subIndexTable as defined in the `EBLC'         */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    first_glyph   :: The first glyph index in the range.               */\n  /*                                                                       */\n  /*    last_glyph    :: The last glyph index in the range.                */\n  /*                                                                       */\n  /*    index_format  :: The format of index table.  Valid values are 1    */\n  /*                     to 5.                                             */\n  /*                                                                       */\n  /*    image_format  :: The format of `EBDT' image data.                  */\n  /*                                                                       */\n  /*    image_offset  :: The offset to image data in `EBDT'.               */\n  /*                                                                       */\n  /*    image_size    :: For index formats 2 and 5.  This is the size in   */\n  /*                     bytes of each glyph bitmap.                       */\n  /*                                                                       */\n  /*    big_metrics   :: For index formats 2 and 5.  This is the big       */\n  /*                     metrics for each glyph bitmap.                    */\n  /*                                                                       */\n  /*    num_glyphs    :: For index formats 4 and 5.  This is the number of */\n  /*                     glyphs in the code array.                         */\n  /*                                                                       */\n  /*    glyph_offsets :: For index formats 1 and 3.                        */\n  /*                                                                       */\n  /*    glyph_codes   :: For index formats 4 and 5.                        */\n  /*                                                                       */\n  /*    table_offset  :: The offset of the index table in the `EBLC'       */\n  /*                     table.  Only used during strike loading.          */\n  /*                                                                       */\n  typedef struct  TT_SBit_RangeRec_\n  {\n    FT_UShort           first_glyph;\n    FT_UShort           last_glyph;\n\n    FT_UShort           index_format;\n    FT_UShort           image_format;\n    FT_ULong            image_offset;\n\n    FT_ULong            image_size;\n    TT_SBit_MetricsRec  metrics;\n    FT_ULong            num_glyphs;\n\n    FT_ULong*           glyph_offsets;\n    FT_UShort*          glyph_codes;\n\n    FT_ULong            table_offset;\n\n  } TT_SBit_RangeRec, *TT_SBit_Range;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_StrikeRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap strike in the `EBLC'      */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*   num_index_ranges :: The number of index ranges.                     */\n  /*                                                                       */\n  /*   index_ranges     :: An array of glyph index ranges.                 */\n  /*                                                                       */\n  /*   color_ref        :: Unused.  `color_ref' is put in for future       */\n  /*                       enhancements, but these fields are already      */\n  /*                       in use by other platforms (e.g. Newton).        */\n  /*                       For details, please see                         */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  /*   hori             :: The line metrics for horizontal layouts.        */\n  /*                                                                       */\n  /*   vert             :: The line metrics for vertical layouts.          */\n  /*                                                                       */\n  /*   start_glyph      :: The lowest glyph index for this strike.         */\n  /*                                                                       */\n  /*   end_glyph        :: The highest glyph index for this strike.        */\n  /*                                                                       */\n  /*   x_ppem           :: The number of horizontal pixels per EM.         */\n  /*                                                                       */\n  /*   y_ppem           :: The number of vertical pixels per EM.           */\n  /*                                                                       */\n  /*   bit_depth        :: The bit depth.  Valid values are 1, 2, 4,       */\n  /*                       and 8.                                          */\n  /*                                                                       */\n  /*   flags            :: Is this a vertical or horizontal strike?  For   */\n  /*                       details, please see                             */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  typedef struct  TT_SBit_StrikeRec_\n  {\n    FT_Int                  num_ranges;\n    TT_SBit_Range           sbit_ranges;\n    FT_ULong                ranges_offset;\n\n    FT_ULong                color_ref;\n\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_UShort               start_glyph;\n    FT_UShort               end_glyph;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 bit_depth;\n    FT_Char                 flags;\n\n  } TT_SBit_StrikeRec, *TT_SBit_Strike;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ComponentRec                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure to describe a compound sbit element.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_code :: The element's glyph index.                           */\n  /*                                                                       */\n  /*    x_offset   :: The element's left bearing.                          */\n  /*                                                                       */\n  /*    y_offset   :: The element's top bearing.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_ComponentRec_\n  {\n    FT_UShort  glyph_code;\n    FT_Char    x_offset;\n    FT_Char    y_offset;\n\n  } TT_SBit_ComponentRec, *TT_SBit_Component;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ScaleRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap scaling table, as defined */\n  /*    in the `EBSC' table.                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    hori              :: The horizontal line metrics.                  */\n  /*                                                                       */\n  /*    vert              :: The vertical line metrics.                    */\n  /*                                                                       */\n  /*    x_ppem            :: The number of horizontal pixels per EM.       */\n  /*                                                                       */\n  /*    y_ppem            :: The number of vertical pixels per EM.         */\n  /*                                                                       */\n  /*    x_ppem_substitute :: Substitution x_ppem value.                    */\n  /*                                                                       */\n  /*    y_ppem_substitute :: Substitution y_ppem value.                    */\n  /*                                                                       */\n  typedef struct  TT_SBit_ScaleRec_\n  {\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 x_ppem_substitute;\n    FT_Byte                 y_ppem_substitute;\n\n  } TT_SBit_ScaleRec, *TT_SBit_Scale;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  POSTSCRIPT GLYPH NAMES SUPPORT                   ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_20Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.0.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs    :: The number of named glyphs in the table.          */\n  /*                                                                       */\n  /*    num_names     :: The number of PS names stored in the table.       */\n  /*                                                                       */\n  /*    glyph_indices :: The indices of the glyphs in the names arrays.    */\n  /*                                                                       */\n  /*    glyph_names   :: The PS names not in Mac Encoding.                 */\n  /*                                                                       */\n  typedef struct  TT_Post_20Rec_\n  {\n    FT_UShort   num_glyphs;\n    FT_UShort   num_names;\n    FT_UShort*  glyph_indices;\n    FT_Char**   glyph_names;\n\n  } TT_Post_20Rec, *TT_Post_20;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_25Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.5.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs :: The number of glyphs in the table.                   */\n  /*                                                                       */\n  /*    offsets    :: An array of signed offsets in a normal Mac           */\n  /*                  Postscript name encoding.                            */\n  /*                                                                       */\n  typedef struct  TT_Post_25_\n  {\n    FT_UShort  num_glyphs;\n    FT_Char*   offsets;\n\n  } TT_Post_25Rec, *TT_Post_25;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_NamesRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names table, either format 2.0 or 2.5.                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loaded    :: A flag to indicate whether the PS names are loaded.   */\n  /*                                                                       */\n  /*    format_20 :: The sub-table used for format 2.0.                    */\n  /*                                                                       */\n  /*    format_25 :: The sub-table used for format 2.5.                    */\n  /*                                                                       */\n  typedef struct  TT_Post_NamesRec_\n  {\n    FT_Bool  loaded;\n\n    union\n    {\n      TT_Post_20Rec  format_20;\n      TT_Post_25Rec  format_25;\n\n    } names;\n\n  } TT_Post_NamesRec, *TT_Post_Names;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    GX VARIATION TABLE SUPPORT                     ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n  typedef struct GX_BlendRec_  *GX_Blend;\n#endif\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              EMBEDDED BDF PROPERTIES TABLE SUPPORT                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   * These types are used to support a `BDF ' table that isn't part of the\n   * official TrueType specification.  It is mainly used in SFNT-based\n   * bitmap fonts that were generated from a set of BDF fonts.\n   *\n   * The format of the table is as follows.\n   *\n   *   USHORT   version      `BDF ' table version number, should be 0x0001.\n   *   USHORT   strikeCount  Number of strikes (bitmap sizes) in this table.\n   *   ULONG    stringTable  Offset (from start of BDF table) to string\n   *                         table.\n   *\n   * This is followed by an array of `strikeCount' descriptors, having the\n   * following format.\n   *\n   *   USHORT   ppem         Vertical pixels per EM for this strike.\n   *   USHORT   numItems     Number of items for this strike (properties and\n   *                         atoms).  Maximum is 255.\n   *\n   * This array in turn is followed by `strikeCount' value sets.  Each\n   * `value set' is an array of `numItems' items with the following format.\n   *\n   *   ULONG    item_name    Offset in string table to item name.\n   *   USHORT   item_type    The item type.  Possible values are\n   *                            0 => string (e.g., COMMENT)\n   *                            1 => atom   (e.g., FONT or even SIZE)\n   *                            2 => int32\n   *                            3 => uint32\n   *                         0x10 => A flag to indicate a properties.  This\n   *                                 is ORed with the above values.\n   *   ULONG    item_value   For strings  => Offset into string table without\n   *                                         the corresponding double quotes.\n   *                         For atoms    => Offset into string table.\n   *                         For integers => Direct value.\n   *\n   * All strings in the string table consist of bytes and are\n   * zero-terminated.\n   *\n   */\n\n#ifdef TT_CONFIG_OPTION_BDF\n\n  typedef struct  TT_BDFRec_\n  {\n    FT_Byte*   table;\n    FT_Byte*   table_end;\n    FT_Byte*   strings;\n    FT_ULong   strings_size;\n    FT_UInt    num_strikes;\n    FT_Bool    loaded;\n\n  } TT_BDFRec, *TT_BDF;\n\n#endif /* TT_CONFIG_OPTION_BDF */\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  ORIGINAL TT_FACE CLASS DEFINITION                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This structure/class is defined here because it is common to the      */\n  /* following formats: TTF, OpenType-TT, and OpenType-CFF.                */\n  /*                                                                       */\n  /* Note, however, that the classes TT_Size and TT_GlyphSlot are not      */\n  /* shared between font drivers, and are thus defined in `ttobjs.h'.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType face/font object.  A TT_Face encapsulates   */\n  /*    the resolution and scaling independent parts of a TrueType font    */\n  /*    resource.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The TT_Face structure is also used as a `parent class' for the     */\n  /*    OpenType-CFF class (T2_Face).                                      */\n  /*                                                                       */\n  typedef struct TT_FaceRec_*  TT_Face;\n\n\n  /* a function type used for the truetype bytecode interpreter hooks */\n  typedef FT_Error\n  (*TT_Interpreter)( void*  exec_context );\n\n  /* forward declaration */\n  typedef struct TT_LoaderRec_*  TT_Loader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_GotoTableFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given TrueType table.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    tag    :: A 4-byte tag used to name the table.                     */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    length :: The length of the table in bytes.  Set to 0 if not       */\n  /*              needed.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_GotoTableFunc)( TT_Face    face,\n                              FT_ULong   tag,\n                              FT_Stream  stream,\n                              FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_StartGlyphFunc                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given glyph element, and opens a  */\n  /*    frame for it.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader      :: The current TrueType glyph loader object.           */\n  /*                                                                       */\n  /*    glyph index :: The index of the glyph to access.                   */\n  /*                                                                       */\n  /*    offset      :: The offset of the glyph according to the            */\n  /*                   `locations' table.                                  */\n  /*                                                                       */\n  /*    byte_count  :: The size of the frame in bytes.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is normally equivalent to FT_STREAM_SEEK(offset)     */\n  /*    followed by FT_FRAME_ENTER(byte_count) with the loader's stream,   */\n  /*    but alternative formats (e.g. compressed ones) might use something */\n  /*    different.                                                         */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_StartGlyphFunc)( TT_Loader  loader,\n                               FT_UInt    glyph_index,\n                               FT_ULong   offset,\n                               FT_UInt    byte_count );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_ReadGlyphFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reads one glyph element (its header, a simple glyph, or a          */\n  /*    composite) from the loader's current stream frame.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_ReadGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_EndGlyphFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Closes the current loader stream frame for the glyph.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  typedef void\n  (*TT_Loader_EndGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         TrueType Face Type                            */\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType face class.  These objects model the resolution and   */\n  /*    point-size independent data found in a TrueType font file.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root                 :: The base FT_Face structure, managed by the */\n  /*                            base layer.                                */\n  /*                                                                       */\n  /*    ttc_header           :: The TrueType collection header, used when  */\n  /*                            the file is a `ttc' rather than a `ttf'.   */\n  /*                            For ordinary font files, the field         */\n  /*                            `ttc_header.count' is set to 0.            */\n  /*                                                                       */\n  /*    format_tag           :: The font format tag.                       */\n  /*                                                                       */\n  /*    num_tables           :: The number of TrueType tables in this font */\n  /*                            file.                                      */\n  /*                                                                       */\n  /*    dir_tables           :: The directory of TrueType tables for this  */\n  /*                            font file.                                 */\n  /*                                                                       */\n  /*    header               :: The font's font header (`head' table).     */\n  /*                            Read on font opening.                      */\n  /*                                                                       */\n  /*    horizontal           :: The font's horizontal header (`hhea'       */\n  /*                            table).  This field also contains the      */\n  /*                            associated horizontal metrics table        */\n  /*                            (`hmtx').                                  */\n  /*                                                                       */\n  /*    max_profile          :: The font's maximum profile table.  Read on */\n  /*                            font opening.  Note that some maximum      */\n  /*                            values cannot be taken directly from this  */\n  /*                            table.  We thus define additional fields   */\n  /*                            below to hold the computed maxima.         */\n  /*                                                                       */\n  /*    vertical_info        :: A boolean which is set when the font file  */\n  /*                            contains vertical metrics.  If not, the    */\n  /*                            value of the `vertical' field is           */\n  /*                            undefined.                                 */\n  /*                                                                       */\n  /*    vertical             :: The font's vertical header (`vhea' table). */\n  /*                            This field also contains the associated    */\n  /*                            vertical metrics table (`vmtx'), if found. */\n  /*                            IMPORTANT: The contents of this field is   */\n  /*                            undefined if the `verticalInfo' field is   */\n  /*                            unset.                                     */\n  /*                                                                       */\n  /*    num_names            :: The number of name records within this     */\n  /*                            TrueType font.                             */\n  /*                                                                       */\n  /*    name_table           :: The table of name records (`name').        */\n  /*                                                                       */\n  /*    os2                  :: The font's OS/2 table (`OS/2').            */\n  /*                                                                       */\n  /*    postscript           :: The font's PostScript table (`post'        */\n  /*                            table).  The PostScript glyph names are    */\n  /*                            not loaded by the driver on face opening.  */\n  /*                            See the `ttpost' module for more details.  */\n  /*                                                                       */\n  /*    cmap_table           :: Address of the face's `cmap' SFNT table    */\n  /*                            in memory (it's an extracted frame).       */\n  /*                                                                       */\n  /*    cmap_size            :: The size in bytes of the `cmap_table'      */\n  /*                            described above.                           */\n  /*                                                                       */\n  /*    goto_table           :: A function called by each TrueType table   */\n  /*                            loader to position a stream's cursor to    */\n  /*                            the start of a given table according to    */\n  /*                            its tag.  It defaults to TT_Goto_Face but  */\n  /*                            can be different for strange formats (e.g. */\n  /*                            Type 42).                                  */\n  /*                                                                       */\n  /*    access_glyph_frame   :: A function used to access the frame of a   */\n  /*                            given glyph within the face's font file.   */\n  /*                                                                       */\n  /*    forget_glyph_frame   :: A function used to forget the frame of a   */\n  /*                            given glyph when all data has been loaded. */\n  /*                                                                       */\n  /*    read_glyph_header    :: A function used to read a glyph header.    */\n  /*                            It must be called between an `access' and  */\n  /*                            `forget'.                                  */\n  /*                                                                       */\n  /*    read_simple_glyph    :: A function used to read a simple glyph.    */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    read_composite_glyph :: A function used to read a composite glyph. */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    sfnt                 :: A pointer to the SFNT service.             */\n  /*                                                                       */\n  /*    psnames              :: A pointer to the PostScript names service. */\n  /*                                                                       */\n  /*    hdmx                 :: The face's horizontal device metrics       */\n  /*                            (`hdmx' table).  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    gasp                 :: The grid-fitting and scaling properties    */\n  /*                            table (`gasp').  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    pclt                 :: The `pclt' SFNT table.                     */\n  /*                                                                       */\n  /*    num_sbit_strikes     :: The number of sbit strikes, i.e., bitmap   */\n  /*                            sizes, embedded in this font.              */\n  /*                                                                       */\n  /*    sbit_strikes         :: An array of sbit strikes embedded in this  */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    num_sbit_scales      :: The number of sbit scales for this font.   */\n  /*                                                                       */\n  /*    sbit_scales          :: Array of sbit scales embedded in this      */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    postscript_names     :: A table used to store the Postscript names */\n  /*                            of  the glyphs for this font.  See the     */\n  /*                            file  `ttconfig.h' for comments on the     */\n  /*                            TT_CONFIG_OPTION_POSTSCRIPT_NAMES option.  */\n  /*                                                                       */\n  /*    num_locations        :: The number of glyph locations in this      */\n  /*                            TrueType file.  This should be             */\n  /*                            identical to the number of glyphs.         */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    glyph_locations      :: An array of longs.  These are offsets to   */\n  /*                            glyph data within the `glyf' table.        */\n  /*                            Ignored for Type 2 font faces.             */\n  /*                                                                       */\n  /*    glyf_len             :: The length of the `glyf' table.  Needed    */\n  /*                            for malformed `loca' tables.               */\n  /*                                                                       */\n  /*    font_program_size    :: Size in bytecodes of the face's font       */\n  /*                            program.  0 if none defined.  Ignored for  */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    font_program         :: The face's font program (bytecode stream)  */\n  /*                            executed at load time, also used during    */\n  /*                            glyph rendering.  Comes from the `fpgm'    */\n  /*                            table.  Ignored for Type 2 font fonts.     */\n  /*                                                                       */\n  /*    cvt_program_size     :: The size in bytecodes of the face's cvt    */\n  /*                            program.  Ignored for Type 2 fonts.        */\n  /*                                                                       */\n  /*    cvt_program          :: The face's cvt program (bytecode stream)   */\n  /*                            executed each time an instance/size is     */\n  /*                            changed/reset.  Comes from the `prep'      */\n  /*                            table.  Ignored for Type 2 fonts.          */\n  /*                                                                       */\n  /*    cvt_size             :: Size of the control value table (in        */\n  /*                            entries).   Ignored for Type 2 fonts.      */\n  /*                                                                       */\n  /*    cvt                  :: The face's original control value table.   */\n  /*                            Coordinates are expressed in unscaled font */\n  /*                            units.  Comes from the `cvt ' table.       */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    num_kern_pairs       :: The number of kerning pairs present in the */\n  /*                            font file.  The engine only loads the      */\n  /*                            first horizontal format 0 kern table it    */\n  /*                            finds in the font file.  Ignored for       */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    kern_table_index     :: The index of the kerning table in the font */\n  /*                            kerning directory.  Ignored for Type 2     */\n  /*                            fonts.                                     */\n  /*                                                                       */\n  /*    interpreter          :: A pointer to the TrueType bytecode         */\n  /*                            interpreters field is also used to hook    */\n  /*                            the debugger in `ttdebug'.                 */\n  /*                                                                       */\n  /*    unpatented_hinting   :: If true, use only unpatented methods in    */\n  /*                            the bytecode interpreter.                  */\n  /*                                                                       */\n  /*    doblend              :: A boolean which is set if the font should  */\n  /*                            be blended (this is for GX var).           */\n  /*                                                                       */\n  /*    blend                :: Contains the data needed to control GX     */\n  /*                            variation tables (rather like Multiple     */\n  /*                            Master data).                              */\n  /*                                                                       */\n  /*    extra                :: Reserved for third-party font drivers.     */\n  /*                                                                       */\n  /*    postscript_name      :: The PS name of the font.  Used by the      */\n  /*                            postscript name service.                   */\n  /*                                                                       */\n  typedef struct  TT_FaceRec_\n  {\n    FT_FaceRec            root;\n\n    TTC_HeaderRec         ttc_header;\n\n    FT_ULong              format_tag;\n    FT_UShort             num_tables;\n    TT_Table              dir_tables;\n\n    TT_Header             header;       /* TrueType header table          */\n    TT_HoriHeader         horizontal;   /* TrueType horizontal header     */\n\n    TT_MaxProfile         max_profile;\n\n    FT_Bool               vertical_info;\n    TT_VertHeader         vertical;     /* TT Vertical header, if present */\n\n    FT_UShort             num_names;    /* number of name records  */\n    TT_NameTableRec       name_table;   /* name table              */\n\n    TT_OS2                os2;          /* TrueType OS/2 table            */\n    TT_Postscript         postscript;   /* TrueType Postscript table      */\n\n    FT_Byte*              cmap_table;   /* extracted `cmap' table */\n    FT_ULong              cmap_size;\n\n    TT_Loader_GotoTableFunc   goto_table;\n\n    TT_Loader_StartGlyphFunc  access_glyph_frame;\n    TT_Loader_EndGlyphFunc    forget_glyph_frame;\n    TT_Loader_ReadGlyphFunc   read_glyph_header;\n    TT_Loader_ReadGlyphFunc   read_simple_glyph;\n    TT_Loader_ReadGlyphFunc   read_composite_glyph;\n\n    /* a typeless pointer to the SFNT_Interface table used to load */\n    /* the basic TrueType tables in the face object                */\n    void*                 sfnt;\n\n    /* a typeless pointer to the FT_Service_PsCMapsRec table used to */\n    /* handle glyph names <-> unicode & Mac values                   */\n    void*                 psnames;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Optional TrueType/OpenType tables                                   */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* grid-fitting and scaling table */\n    TT_GaspRec            gasp;                 /* the `gasp' table */\n\n    /* PCL 5 table */\n    TT_PCLT               pclt;\n\n    /* embedded bitmaps support */\n    FT_ULong              num_sbit_scales;\n    TT_SBit_Scale         sbit_scales;\n\n    /* postscript names table */\n    TT_Post_NamesRec      postscript_names;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* TrueType-specific fields (ignored by the OTF-Type2 driver)          */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* the font program, if any */\n    FT_ULong              font_program_size;\n    FT_Byte*              font_program;\n\n    /* the cvt program, if any */\n    FT_ULong              cvt_program_size;\n    FT_Byte*              cvt_program;\n\n    /* the original, unscaled, control value table */\n    FT_ULong              cvt_size;\n    FT_Short*             cvt;\n\n    /* A pointer to the bytecode interpreter to use.  This is also */\n    /* used to hook the debugger for the `ttdebug' utility.        */\n    TT_Interpreter        interpreter;\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    /* Use unpatented hinting only. */\n    FT_Bool               unpatented_hinting;\n#endif\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Other tables or fields. This is used by derivative formats like     */\n    /* OpenType.                                                           */\n    /*                                                                     */\n    /***********************************************************************/\n\n    FT_Generic            extra;\n\n    const char*           postscript_name;\n\n    FT_ULong              glyf_len;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Bool               doblend;\n    GX_Blend              blend;\n#endif\n\n    /* since version 2.2 */\n\n    FT_Byte*              horz_metrics;\n    FT_ULong              horz_metrics_size;\n\n    FT_Byte*              vert_metrics;\n    FT_ULong              vert_metrics_size;\n\n    FT_ULong              num_locations; /* in broken TTF, gid > 0xFFFF */\n    FT_Byte*              glyph_locations;\n\n    FT_Byte*              hdmx_table;\n    FT_ULong              hdmx_table_size;\n    FT_UInt               hdmx_record_count;\n    FT_ULong              hdmx_record_size;\n    FT_Byte*              hdmx_record_sizes;\n\n    FT_Byte*              sbit_table;\n    FT_ULong              sbit_table_size;\n    FT_UInt               sbit_num_strikes;\n\n    FT_Byte*              kern_table;\n    FT_ULong              kern_table_size;\n    FT_UInt               num_kern_tables;\n    FT_UInt32             kern_avail_bits;\n    FT_UInt32             kern_order_bits;\n\n#ifdef TT_CONFIG_OPTION_BDF\n    TT_BDFRec             bdf;\n#endif /* TT_CONFIG_OPTION_BDF */\n\n    /* since 2.3.0 */\n    FT_ULong              horz_metrics_offset;\n    FT_ULong              vert_metrics_offset;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* since 2.4.12 */\n    FT_ULong              sph_found_func_flags; /* special functions found */\n                                                /* for this face           */\n    FT_Bool               sph_compatibility_mode;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n  } TT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  <Struct>                                                             */\n  /*     TT_GlyphZoneRec                                                   */\n  /*                                                                       */\n  /*  <Description>                                                        */\n  /*     A glyph zone is used to load, scale and hint glyph outline        */\n  /*     coordinates.                                                      */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     memory       :: A handle to the memory manager.                   */\n  /*                                                                       */\n  /*     max_points   :: The maximum size in points of the zone.           */\n  /*                                                                       */\n  /*     max_contours :: Max size in links contours of the zone.           */\n  /*                                                                       */\n  /*     n_points     :: The current number of points in the zone.         */\n  /*                                                                       */\n  /*     n_contours   :: The current number of contours in the zone.       */\n  /*                                                                       */\n  /*     org          :: The original glyph coordinates (font              */\n  /*                     units/scaled).                                    */\n  /*                                                                       */\n  /*     cur          :: The current glyph coordinates (scaled/hinted).    */\n  /*                                                                       */\n  /*     tags         :: The point control tags.                           */\n  /*                                                                       */\n  /*     contours     :: The contours end points.                          */\n  /*                                                                       */\n  /*     first_point  :: Offset of the current subglyph's first point.     */\n  /*                                                                       */\n  typedef struct  TT_GlyphZoneRec_\n  {\n    FT_Memory   memory;\n    FT_UShort   max_points;\n    FT_UShort   max_contours;\n    FT_UShort   n_points;    /* number of points in zone    */\n    FT_Short    n_contours;  /* number of contours          */\n\n    FT_Vector*  org;         /* original point coordinates  */\n    FT_Vector*  cur;         /* current point coordinates   */\n    FT_Vector*  orus;        /* original (unscaled) point coordinates */\n\n    FT_Byte*    tags;        /* current touch flags         */\n    FT_UShort*  contours;    /* contour end points          */\n\n    FT_UShort   first_point; /* offset of first (#0) point  */\n\n  } TT_GlyphZoneRec, *TT_GlyphZone;\n\n\n  /* handle to execution context */\n  typedef struct TT_ExecContextRec_*  TT_ExecContext;\n\n  /* glyph loader structure */\n  typedef struct  TT_LoaderRec_\n  {\n    FT_Face          face;\n    FT_Size          size;\n    FT_GlyphSlot     glyph;\n    FT_GlyphLoader   gloader;\n\n    FT_ULong         load_flags;\n    FT_UInt          glyph_index;\n\n    FT_Stream        stream;\n    FT_Int           byte_len;\n\n    FT_Short         n_contours;\n    FT_BBox          bbox;\n    FT_Int           left_bearing;\n    FT_Int           advance;\n    FT_Int           linear;\n    FT_Bool          linear_def;\n    FT_Bool          preserve_pps;\n    FT_Vector        pp1;\n    FT_Vector        pp2;\n\n    FT_ULong         glyf_offset;\n\n    /* the zone where we load our glyphs */\n    TT_GlyphZoneRec  base;\n    TT_GlyphZoneRec  zone;\n\n    TT_ExecContext   exec;\n    FT_Byte*         instructions;\n    FT_ULong         ins_pos;\n\n    /* for possible extensibility in other formats */\n    void*            other;\n\n    /* since version 2.1.8 */\n    FT_Int           top_bearing;\n    FT_Int           vadvance;\n    FT_Vector        pp3;\n    FT_Vector        pp4;\n\n    /* since version 2.2.1 */\n    FT_Byte*         cursor;\n    FT_Byte*         limit;\n\n  } TT_LoaderRec;\n\n\nFT_END_HEADER\n\n#endif /* __TTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/t1tables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tables.h                                                             */\n/*                                                                         */\n/*    Basic Type 1/Type 2 tables definitions and interface (specification  */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TABLES_H__\n#define __T1TABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    type1_tables                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Type 1 Tables                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Type~1 (PostScript) specific font tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of Type 1-specific tables,    */\n  /*    including structures related to other PostScript font formats.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */\n  /* structures in order to support Multiple Master fonts.               */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfoRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 FontInfo dictionary.  */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    FontInfo dictionary.                                               */\n  /*                                                                       */\n  typedef struct  PS_FontInfoRec_\n  {\n    FT_String*  version;\n    FT_String*  notice;\n    FT_String*  full_name;\n    FT_String*  family_name;\n    FT_String*  weight;\n    FT_Long     italic_angle;\n    FT_Bool     is_fixed_pitch;\n    FT_Short    underline_position;\n    FT_UShort   underline_thickness;\n\n  } PS_FontInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_FontInfoRec structure.                           */\n  /*                                                                       */\n  typedef struct PS_FontInfoRec_*  PS_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef PS_FontInfoRec  T1_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_PrivateRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 private dictionary.   */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    Private dictionary.                                                */\n  /*                                                                       */\n  typedef struct  PS_PrivateRec_\n  {\n    FT_Int     unique_id;\n    FT_Int     lenIV;\n\n    FT_Byte    num_blue_values;\n    FT_Byte    num_other_blues;\n    FT_Byte    num_family_blues;\n    FT_Byte    num_family_other_blues;\n\n    FT_Short   blue_values[14];\n    FT_Short   other_blues[10];\n\n    FT_Short   family_blues      [14];\n    FT_Short   family_other_blues[10];\n\n    FT_Fixed   blue_scale;\n    FT_Int     blue_shift;\n    FT_Int     blue_fuzz;\n\n    FT_UShort  standard_width[1];\n    FT_UShort  standard_height[1];\n\n    FT_Byte    num_snap_widths;\n    FT_Byte    num_snap_heights;\n    FT_Bool    force_bold;\n    FT_Bool    round_stem_up;\n\n    FT_Short   snap_widths [13];  /* including std width  */\n    FT_Short   snap_heights[13];  /* including std height */\n\n    FT_Fixed   expansion_factor;\n\n    FT_Long    language_group;\n    FT_Long    password;\n\n    FT_Short   min_feature[2];\n\n  } PS_PrivateRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_PrivateRec structure.                            */\n  /*                                                                       */\n  typedef struct PS_PrivateRec_*  PS_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef PS_PrivateRec  T1_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_Blend_Flags                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of flags used to indicate which fields are present in a      */\n  /*    given blend dictionary (font info or private).  Used to support    */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  typedef enum  T1_Blend_Flags_\n  {\n    /*# required fields in a FontInfo blend dictionary */\n    T1_BLEND_UNDERLINE_POSITION = 0,\n    T1_BLEND_UNDERLINE_THICKNESS,\n    T1_BLEND_ITALIC_ANGLE,\n\n    /*# required fields in a Private blend dictionary */\n    T1_BLEND_BLUE_VALUES,\n    T1_BLEND_OTHER_BLUES,\n    T1_BLEND_STANDARD_WIDTH,\n    T1_BLEND_STANDARD_HEIGHT,\n    T1_BLEND_STEM_SNAP_WIDTHS,\n    T1_BLEND_STEM_SNAP_HEIGHTS,\n    T1_BLEND_BLUE_SCALE,\n    T1_BLEND_BLUE_SHIFT,\n    T1_BLEND_FAMILY_BLUES,\n    T1_BLEND_FAMILY_OTHER_BLUES,\n    T1_BLEND_FORCE_BOLD,\n\n    /*# never remove */\n    T1_BLEND_MAX\n\n  } T1_Blend_Flags;\n\n  /* */\n\n\n  /*# backwards compatible definitions */\n#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION\n#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS\n#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE\n#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES\n#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES\n#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH\n#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT\n#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS\n#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS\n#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE\n#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT\n#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES\n#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES\n#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD\n#define t1_blend_max                  T1_BLEND_MAX\n\n\n  /* maximum number of Multiple Masters designs, as defined in the spec */\n#define T1_MAX_MM_DESIGNS     16\n\n  /* maximum number of Multiple Masters axes, as defined in the spec */\n#define T1_MAX_MM_AXIS        4\n\n  /* maximum number of elements in a design map */\n#define T1_MAX_MM_MAP_POINTS  20\n\n\n  /* this structure is used to store the BlendDesignMap entry for an axis */\n  typedef struct  PS_DesignMap_\n  {\n    FT_Byte    num_points;\n    FT_Long*   design_points;\n    FT_Fixed*  blend_points;\n\n  } PS_DesignMapRec, *PS_DesignMap;\n\n  /* backwards-compatible definition */\n  typedef PS_DesignMapRec  T1_DesignMap;\n\n\n  typedef struct  PS_BlendRec_\n  {\n    FT_UInt          num_designs;\n    FT_UInt          num_axis;\n\n    FT_String*       axis_names[T1_MAX_MM_AXIS];\n    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];\n    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];\n\n    FT_Fixed*        weight_vector;\n    FT_Fixed*        default_weight_vector;\n\n    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];\n    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];\n\n    FT_ULong         blend_bitflags;\n\n    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];\n\n    /* since 2.3.0 */\n\n    /* undocumented, optional: the default design instance;   */\n    /* corresponds to default_weight_vector --                */\n    /* num_default_design_vector == 0 means it is not present */\n    /* in the font and associated metrics files               */\n    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];\n    FT_UInt          num_default_design_vector;\n\n  } PS_BlendRec, *PS_Blend;\n\n\n  /* backwards-compatible definition */\n  typedef PS_BlendRec  T1_Blend;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDictRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent data in a CID top-level dictionary.  */\n  /*                                                                       */\n  typedef struct  CID_FaceDictRec_\n  {\n    PS_PrivateRec  private_dict;\n\n    FT_UInt        len_buildchar;\n    FT_Fixed       forcebold_threshold;\n    FT_Pos         stroke_width;\n    FT_Fixed       expansion_factor;\n\n    FT_Byte        paint_type;\n    FT_Byte        font_type;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n    FT_UInt        num_subrs;\n    FT_ULong       subrmap_offset;\n    FT_Int         sd_bytes;\n\n  } CID_FaceDictRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDict                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceDictRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceDictRec_*  CID_FaceDict;\n\n  /* */\n\n\n  /* backwards-compatible definition */\n  typedef CID_FaceDictRec  CID_FontDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfoRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent CID Face information.                */\n  /*                                                                       */\n  typedef struct  CID_FaceInfoRec_\n  {\n    FT_String*      cid_font_name;\n    FT_Fixed        cid_version;\n    FT_Int          cid_font_type;\n\n    FT_String*      registry;\n    FT_String*      ordering;\n    FT_Int          supplement;\n\n    PS_FontInfoRec  font_info;\n    FT_BBox         font_bbox;\n    FT_ULong        uid_base;\n\n    FT_Int          num_xuid;\n    FT_ULong        xuid[16];\n\n    FT_ULong        cidmap_offset;\n    FT_Int          fd_bytes;\n    FT_Int          gd_bytes;\n    FT_ULong        cid_count;\n\n    FT_Int          num_dicts;\n    CID_FaceDict    font_dicts;\n\n    FT_ULong        data_offset;\n\n  } CID_FaceInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfo                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceInfoRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceInfoRec_*  CID_FaceInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Info                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef CID_FaceInfoRec  CID_Info;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Has_PS_Glyph_Names\n   *\n   * @description:\n   *    Return true if a given face provides reliable PostScript glyph\n   *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,\n   *    except that certain fonts (mostly TrueType) contain incorrect\n   *    glyph name tables.\n   *\n   *    When this function returns true, the caller is sure that the glyph\n   *    names returned by @FT_Get_Glyph_Name are reliable.\n   *\n   * @input:\n   *    face ::\n   *       face handle\n   *\n   * @return:\n   *    Boolean.  True if glyph names are reliable.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Info\n   *\n   * @description:\n   *    Retrieve the @PS_FontInfoRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_info ::\n   *       Output font info structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the font info structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function will\n   *    return the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face      face,\n                       PS_FontInfo  afont_info );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Private\n   *\n   * @description:\n   *    Retrieve the @PS_PrivateRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_private ::\n   *       Output private dictionary structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the @PS_PrivateRec structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face     face,\n                          PS_Private  afont_private );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_EncodingType                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration describing the `Encoding' entry in a Type 1         */\n  /*    dictionary.                                                        */\n  /*                                                                       */\n  typedef enum  T1_EncodingType_\n  {\n    T1_ENCODING_TYPE_NONE = 0,\n    T1_ENCODING_TYPE_ARRAY,\n    T1_ENCODING_TYPE_STANDARD,\n    T1_ENCODING_TYPE_ISOLATIN1,\n    T1_ENCODING_TYPE_EXPERT\n\n  } T1_EncodingType;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    PS_Dict_Keys                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used in calls to @FT_Get_PS_Font_Value to identify  */\n  /*    the Type~1 dictionary entry to retrieve.                           */\n  /*                                                                       */\n  typedef enum  PS_Dict_Keys_\n  {\n    /* conventionally in the font dictionary */\n    PS_DICT_FONT_TYPE,              /* FT_Byte         */\n    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */\n    PS_DICT_FONT_BBOX,              /* FT_Fixed        */\n    PS_DICT_PAINT_TYPE,             /* FT_Byte         */\n    PS_DICT_FONT_NAME,              /* FT_String*      */\n    PS_DICT_UNIQUE_ID,              /* FT_Int          */\n    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */\n    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */\n    PS_DICT_CHAR_STRING,            /* FT_String*      */\n    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */\n    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */\n\n    /* conventionally in the font Private dictionary */\n    PS_DICT_NUM_SUBRS,              /* FT_Int     */\n    PS_DICT_SUBR,                   /* FT_String* */\n    PS_DICT_STD_HW,                 /* FT_UShort  */\n    PS_DICT_STD_VW,                 /* FT_UShort  */\n    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */\n    PS_DICT_BLUE_VALUE,             /* FT_Short   */\n    PS_DICT_BLUE_FUZZ,              /* FT_Int     */\n    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */\n    PS_DICT_OTHER_BLUE,             /* FT_Short   */\n    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */\n    PS_DICT_FAMILY_BLUE,            /* FT_Short   */\n    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */\n    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */\n    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */\n    PS_DICT_BLUE_SHIFT,             /* FT_Int     */\n    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_H,            /* FT_Short   */\n    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_V,            /* FT_Short   */\n    PS_DICT_FORCE_BOLD,             /* FT_Bool    */\n    PS_DICT_RND_STEM_UP,            /* FT_Bool    */\n    PS_DICT_MIN_FEATURE,            /* FT_Short   */\n    PS_DICT_LEN_IV,                 /* FT_Int     */\n    PS_DICT_PASSWORD,               /* FT_Long    */\n    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */\n\n    /* conventionally in the font FontInfo dictionary */\n    PS_DICT_VERSION,                /* FT_String* */\n    PS_DICT_NOTICE,                 /* FT_String* */\n    PS_DICT_FULL_NAME,              /* FT_String* */\n    PS_DICT_FAMILY_NAME,            /* FT_String* */\n    PS_DICT_WEIGHT,                 /* FT_String* */\n    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */\n    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */\n    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */\n    PS_DICT_FS_TYPE,                /* FT_UShort  */\n    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */\n\n    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE\n\n  } PS_Dict_Keys;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Value\n   *\n   * @description:\n   *    Retrieve the value for the supplied key from a PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   *    key ::\n   *       An enumeration value representing the dictionary key to retrieve.\n   *\n   *    idx ::\n   *       For array values, this specifies the index to be returned.\n   *\n   *    value ::\n   *       A pointer to memory into which to write the value.\n   *\n   *    valen_len ::\n   *       The size, in bytes, of the memory supplied for the value.\n   *\n   * @output:\n   *    value ::\n   *       The value matching the above key, if it exists.\n   *\n   * @return:\n   *    The amount of memory (in bytes) required to hold the requested\n   *    value (if it exists, -1 otherwise).\n   *\n   * @note:\n   *    The values returned are not pointers into the internal structures of\n   *    the face, but are `fresh' copies, so that the memory containing them\n   *    belongs to the calling application.  This also enforces the\n   *    `read-only' nature of these values, i.e., this function cannot be\n   *    used to manipulate the face.\n   *\n   *    `value' is a void pointer because the values returned can be of\n   *    various types.\n   *\n   *    If either `value' is NULL or `value_len' is too small, just the\n   *    required memory size for the requested entry is returned.\n   *\n   *    The `idx' parameter is used, not only to retrieve elements of, for\n   *    example, the FontMatrix or FontBBox, but also to retrieve name keys\n   *    from the CharStrings dictionary, and the charstrings themselves.  It\n   *    is ignored for atomic values.\n   *\n   *    PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000.  To\n   *    get the value as in the font stream, you need to divide by\n   *    65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).\n   *\n   *    IMPORTANT: Only key/value pairs read by the FreeType interpreter can\n   *    be retrieved.  So, for example, PostScript procedures such as NP,\n   *    ND, and RD are not available.  Arbitrary keys are, obviously, not be\n   *    available either.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Long )\n  FT_Get_PS_Font_Value( FT_Face       face,\n                        PS_Dict_Keys  key,\n                        FT_UInt       idx,\n                        void         *value,\n                        FT_Long       value_len );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __T1TABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ttnameid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttnameid.h                                                             */\n/*                                                                         */\n/*    TrueType name ID definitions (specification only).                   */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTNAMEID_H__\n#define __TTNAMEID_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values for the `platform' identifier code in the name        */\n  /* records of the TTF `name' table.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_PLATFORM_XXX\n   *\n   * @description:\n   *   A list of valid values for the `platform_id' identifier code in\n   *   @FT_CharMapRec and @FT_SfntName structures.\n   *\n   * @values:\n   *   TT_PLATFORM_APPLE_UNICODE ::\n   *     Used by Apple to indicate a Unicode character map and/or name entry.\n   *     See @TT_APPLE_ID_XXX for corresponding `encoding_id' values.  Note\n   *     that name entries in this format are coded as big-endian UCS-2\n   *     character codes _only_.\n   *\n   *   TT_PLATFORM_MACINTOSH ::\n   *     Used by Apple to indicate a MacOS-specific charmap and/or name entry.\n   *     See @TT_MAC_ID_XXX for corresponding `encoding_id' values.  Note that\n   *     most TrueType fonts contain an Apple roman charmap to be usable on\n   *     MacOS systems (even if they contain a Microsoft charmap as well).\n   *\n   *   TT_PLATFORM_ISO ::\n   *     This value was used to specify ISO/IEC 10646 charmaps.  It is however\n   *     now deprecated.  See @TT_ISO_ID_XXX for a list of corresponding\n   *     `encoding_id' values.\n   *\n   *   TT_PLATFORM_MICROSOFT ::\n   *     Used by Microsoft to indicate Windows-specific charmaps.  See\n   *     @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.\n   *     Note that most fonts contain a Unicode charmap using\n   *     (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).\n   *\n   *   TT_PLATFORM_CUSTOM ::\n   *     Used to indicate application-specific charmaps.\n   *\n   *   TT_PLATFORM_ADOBE ::\n   *     This value isn't part of any font format specification, but is used\n   *     by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec\n   *     structure.  See @TT_ADOBE_ID_XXX.\n   */\n\n#define TT_PLATFORM_APPLE_UNICODE  0\n#define TT_PLATFORM_MACINTOSH      1\n#define TT_PLATFORM_ISO            2 /* deprecated */\n#define TT_PLATFORM_MICROSOFT      3\n#define TT_PLATFORM_CUSTOM         4\n#define TT_PLATFORM_ADOBE          7 /* artificial */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_APPLE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.\n   *\n   * @values:\n   *   TT_APPLE_ID_DEFAULT ::\n   *     Unicode version 1.0.\n   *\n   *   TT_APPLE_ID_UNICODE_1_1 ::\n   *     Unicode 1.1; specifies Hangul characters starting at U+34xx.\n   *\n   *   TT_APPLE_ID_ISO_10646 ::\n   *     Deprecated (identical to preceding).\n   *\n   *   TT_APPLE_ID_UNICODE_2_0 ::\n   *     Unicode 2.0 and beyond (UTF-16 BMP only).\n   *\n   *   TT_APPLE_ID_UNICODE_32 ::\n   *     Unicode 3.1 and beyond, using UTF-32.\n   *\n   *   TT_APPLE_ID_VARIANT_SELECTOR ::\n   *     From Adobe, not Apple.  Not a normal cmap.  Specifies variations\n   *     on a real cmap.\n   */\n\n#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */\n#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */\n#define TT_APPLE_ID_ISO_10646         2 /* deprecated */\n#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */\n#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */\n#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MAC_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MACINTOSH charmaps and name entries.\n   *\n   * @values:\n   *   TT_MAC_ID_ROMAN ::\n   *   TT_MAC_ID_JAPANESE ::\n   *   TT_MAC_ID_TRADITIONAL_CHINESE ::\n   *   TT_MAC_ID_KOREAN ::\n   *   TT_MAC_ID_ARABIC ::\n   *   TT_MAC_ID_HEBREW ::\n   *   TT_MAC_ID_GREEK ::\n   *   TT_MAC_ID_RUSSIAN ::\n   *   TT_MAC_ID_RSYMBOL ::\n   *   TT_MAC_ID_DEVANAGARI ::\n   *   TT_MAC_ID_GURMUKHI ::\n   *   TT_MAC_ID_GUJARATI ::\n   *   TT_MAC_ID_ORIYA ::\n   *   TT_MAC_ID_BENGALI ::\n   *   TT_MAC_ID_TAMIL ::\n   *   TT_MAC_ID_TELUGU ::\n   *   TT_MAC_ID_KANNADA ::\n   *   TT_MAC_ID_MALAYALAM ::\n   *   TT_MAC_ID_SINHALESE ::\n   *   TT_MAC_ID_BURMESE ::\n   *   TT_MAC_ID_KHMER ::\n   *   TT_MAC_ID_THAI ::\n   *   TT_MAC_ID_LAOTIAN ::\n   *   TT_MAC_ID_GEORGIAN ::\n   *   TT_MAC_ID_ARMENIAN ::\n   *   TT_MAC_ID_MALDIVIAN ::\n   *   TT_MAC_ID_SIMPLIFIED_CHINESE ::\n   *   TT_MAC_ID_TIBETAN ::\n   *   TT_MAC_ID_MONGOLIAN ::\n   *   TT_MAC_ID_GEEZ ::\n   *   TT_MAC_ID_SLAVIC ::\n   *   TT_MAC_ID_VIETNAMESE ::\n   *   TT_MAC_ID_SINDHI ::\n   *   TT_MAC_ID_UNINTERP ::\n   */\n\n#define TT_MAC_ID_ROMAN                 0\n#define TT_MAC_ID_JAPANESE              1\n#define TT_MAC_ID_TRADITIONAL_CHINESE   2\n#define TT_MAC_ID_KOREAN                3\n#define TT_MAC_ID_ARABIC                4\n#define TT_MAC_ID_HEBREW                5\n#define TT_MAC_ID_GREEK                 6\n#define TT_MAC_ID_RUSSIAN               7\n#define TT_MAC_ID_RSYMBOL               8\n#define TT_MAC_ID_DEVANAGARI            9\n#define TT_MAC_ID_GURMUKHI             10\n#define TT_MAC_ID_GUJARATI             11\n#define TT_MAC_ID_ORIYA                12\n#define TT_MAC_ID_BENGALI              13\n#define TT_MAC_ID_TAMIL                14\n#define TT_MAC_ID_TELUGU               15\n#define TT_MAC_ID_KANNADA              16\n#define TT_MAC_ID_MALAYALAM            17\n#define TT_MAC_ID_SINHALESE            18\n#define TT_MAC_ID_BURMESE              19\n#define TT_MAC_ID_KHMER                20\n#define TT_MAC_ID_THAI                 21\n#define TT_MAC_ID_LAOTIAN              22\n#define TT_MAC_ID_GEORGIAN             23\n#define TT_MAC_ID_ARMENIAN             24\n#define TT_MAC_ID_MALDIVIAN            25\n#define TT_MAC_ID_SIMPLIFIED_CHINESE   25\n#define TT_MAC_ID_TIBETAN              26\n#define TT_MAC_ID_MONGOLIAN            27\n#define TT_MAC_ID_GEEZ                 28\n#define TT_MAC_ID_SLAVIC               29\n#define TT_MAC_ID_VIETNAMESE           30\n#define TT_MAC_ID_SINDHI               31\n#define TT_MAC_ID_UNINTERP             32\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ISO_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ISO charmaps and name entries.\n   *\n   *   Their use is now deprecated.\n   *\n   * @values:\n   *   TT_ISO_ID_7BIT_ASCII ::\n   *     ASCII.\n   *   TT_ISO_ID_10646 ::\n   *     ISO/10646.\n   *   TT_ISO_ID_8859_1 ::\n   *     Also known as Latin-1.\n   */\n\n#define TT_ISO_ID_7BIT_ASCII  0\n#define TT_ISO_ID_10646       1\n#define TT_ISO_ID_8859_1      2\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MS_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MICROSOFT charmaps and name entries.\n   *\n   * @values:\n   *   TT_MS_ID_SYMBOL_CS ::\n   *     Corresponds to Microsoft symbol encoding. See\n   *     @FT_ENCODING_MS_SYMBOL.\n   *\n   *   TT_MS_ID_UNICODE_CS ::\n   *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See\n   *     @FT_ENCODING_UNICODE.\n   *\n   *   TT_MS_ID_SJIS ::\n   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.\n   *\n   *   TT_MS_ID_GB2312 ::\n   *     Corresponds to Simplified Chinese as used in Mainland China.  See\n   *     @FT_ENCODING_GB2312.\n   *\n   *   TT_MS_ID_BIG_5 ::\n   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.\n   *     See @FT_ENCODING_BIG5.\n   *\n   *   TT_MS_ID_WANSUNG ::\n   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.\n   *\n   *   TT_MS_ID_JOHAB ::\n   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.\n   *\n   *   TT_MS_ID_UCS_4 ::\n   *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to\n   *     the OpenType specification version 1.4 (mid-2001.)\n   */\n\n#define TT_MS_ID_SYMBOL_CS    0\n#define TT_MS_ID_UNICODE_CS   1\n#define TT_MS_ID_SJIS         2\n#define TT_MS_ID_GB2312       3\n#define TT_MS_ID_BIG_5        4\n#define TT_MS_ID_WANSUNG      5\n#define TT_MS_ID_JOHAB        6\n#define TT_MS_ID_UCS_4       10\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ADOBE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ADOBE charmaps.  This is a FreeType-specific extension!\n   *\n   * @values:\n   *   TT_ADOBE_ID_STANDARD ::\n   *     Adobe standard encoding.\n   *   TT_ADOBE_ID_EXPERT ::\n   *     Adobe expert encoding.\n   *   TT_ADOBE_ID_CUSTOM ::\n   *     Adobe custom encoding.\n   *   TT_ADOBE_ID_LATIN_1 ::\n   *     Adobe Latin~1 encoding.\n   */\n\n#define TT_ADOBE_ID_STANDARD  0\n#define TT_ADOBE_ID_EXPERT    1\n#define TT_ADOBE_ID_CUSTOM    2\n#define TT_ADOBE_ID_LATIN_1   3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MACINTOSH.  These values are also used as return values   */\n  /* for function @FT_Get_CMap_Language_ID.                                */\n  /*                                                                       */\n  /* The canonical source for the Apple assigned Language ID's is at       */\n  /*                                                                       */\n  /*   https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html      */\n  /*                                                                       */\n#define TT_MAC_LANGID_ENGLISH                       0\n#define TT_MAC_LANGID_FRENCH                        1\n#define TT_MAC_LANGID_GERMAN                        2\n#define TT_MAC_LANGID_ITALIAN                       3\n#define TT_MAC_LANGID_DUTCH                         4\n#define TT_MAC_LANGID_SWEDISH                       5\n#define TT_MAC_LANGID_SPANISH                       6\n#define TT_MAC_LANGID_DANISH                        7\n#define TT_MAC_LANGID_PORTUGUESE                    8\n#define TT_MAC_LANGID_NORWEGIAN                     9\n#define TT_MAC_LANGID_HEBREW                       10\n#define TT_MAC_LANGID_JAPANESE                     11\n#define TT_MAC_LANGID_ARABIC                       12\n#define TT_MAC_LANGID_FINNISH                      13\n#define TT_MAC_LANGID_GREEK                        14\n#define TT_MAC_LANGID_ICELANDIC                    15\n#define TT_MAC_LANGID_MALTESE                      16\n#define TT_MAC_LANGID_TURKISH                      17\n#define TT_MAC_LANGID_CROATIAN                     18\n#define TT_MAC_LANGID_CHINESE_TRADITIONAL          19\n#define TT_MAC_LANGID_URDU                         20\n#define TT_MAC_LANGID_HINDI                        21\n#define TT_MAC_LANGID_THAI                         22\n#define TT_MAC_LANGID_KOREAN                       23\n#define TT_MAC_LANGID_LITHUANIAN                   24\n#define TT_MAC_LANGID_POLISH                       25\n#define TT_MAC_LANGID_HUNGARIAN                    26\n#define TT_MAC_LANGID_ESTONIAN                     27\n#define TT_MAC_LANGID_LETTISH                      28\n#define TT_MAC_LANGID_SAAMISK                      29\n#define TT_MAC_LANGID_FAEROESE                     30\n#define TT_MAC_LANGID_FARSI                        31\n#define TT_MAC_LANGID_RUSSIAN                      32\n#define TT_MAC_LANGID_CHINESE_SIMPLIFIED           33\n#define TT_MAC_LANGID_FLEMISH                      34\n#define TT_MAC_LANGID_IRISH                        35\n#define TT_MAC_LANGID_ALBANIAN                     36\n#define TT_MAC_LANGID_ROMANIAN                     37\n#define TT_MAC_LANGID_CZECH                        38\n#define TT_MAC_LANGID_SLOVAK                       39\n#define TT_MAC_LANGID_SLOVENIAN                    40\n#define TT_MAC_LANGID_YIDDISH                      41\n#define TT_MAC_LANGID_SERBIAN                      42\n#define TT_MAC_LANGID_MACEDONIAN                   43\n#define TT_MAC_LANGID_BULGARIAN                    44\n#define TT_MAC_LANGID_UKRAINIAN                    45\n#define TT_MAC_LANGID_BYELORUSSIAN                 46\n#define TT_MAC_LANGID_UZBEK                        47\n#define TT_MAC_LANGID_KAZAKH                       48\n#define TT_MAC_LANGID_AZERBAIJANI                  49\n#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT  49\n#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT    50\n#define TT_MAC_LANGID_ARMENIAN                     51\n#define TT_MAC_LANGID_GEORGIAN                     52\n#define TT_MAC_LANGID_MOLDAVIAN                    53\n#define TT_MAC_LANGID_KIRGHIZ                      54\n#define TT_MAC_LANGID_TAJIKI                       55\n#define TT_MAC_LANGID_TURKMEN                      56\n#define TT_MAC_LANGID_MONGOLIAN                    57\n#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT   57\n#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT    58\n#define TT_MAC_LANGID_PASHTO                       59\n#define TT_MAC_LANGID_KURDISH                      60\n#define TT_MAC_LANGID_KASHMIRI                     61\n#define TT_MAC_LANGID_SINDHI                       62\n#define TT_MAC_LANGID_TIBETAN                      63\n#define TT_MAC_LANGID_NEPALI                       64\n#define TT_MAC_LANGID_SANSKRIT                     65\n#define TT_MAC_LANGID_MARATHI                      66\n#define TT_MAC_LANGID_BENGALI                      67\n#define TT_MAC_LANGID_ASSAMESE                     68\n#define TT_MAC_LANGID_GUJARATI                     69\n#define TT_MAC_LANGID_PUNJABI                      70\n#define TT_MAC_LANGID_ORIYA                        71\n#define TT_MAC_LANGID_MALAYALAM                    72\n#define TT_MAC_LANGID_KANNADA                      73\n#define TT_MAC_LANGID_TAMIL                        74\n#define TT_MAC_LANGID_TELUGU                       75\n#define TT_MAC_LANGID_SINHALESE                    76\n#define TT_MAC_LANGID_BURMESE                      77\n#define TT_MAC_LANGID_KHMER                        78\n#define TT_MAC_LANGID_LAO                          79\n#define TT_MAC_LANGID_VIETNAMESE                   80\n#define TT_MAC_LANGID_INDONESIAN                   81\n#define TT_MAC_LANGID_TAGALOG                      82\n#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT           83\n#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT          84\n#define TT_MAC_LANGID_AMHARIC                      85\n#define TT_MAC_LANGID_TIGRINYA                     86\n#define TT_MAC_LANGID_GALLA                        87\n#define TT_MAC_LANGID_SOMALI                       88\n#define TT_MAC_LANGID_SWAHILI                      89\n#define TT_MAC_LANGID_RUANDA                       90\n#define TT_MAC_LANGID_RUNDI                        91\n#define TT_MAC_LANGID_CHEWA                        92\n#define TT_MAC_LANGID_MALAGASY                     93\n#define TT_MAC_LANGID_ESPERANTO                    94\n#define TT_MAC_LANGID_WELSH                       128\n#define TT_MAC_LANGID_BASQUE                      129\n#define TT_MAC_LANGID_CATALAN                     130\n#define TT_MAC_LANGID_LATIN                       131\n#define TT_MAC_LANGID_QUECHUA                     132\n#define TT_MAC_LANGID_GUARANI                     133\n#define TT_MAC_LANGID_AYMARA                      134\n#define TT_MAC_LANGID_TATAR                       135\n#define TT_MAC_LANGID_UIGHUR                      136\n#define TT_MAC_LANGID_DZONGKHA                    137\n#define TT_MAC_LANGID_JAVANESE                    138\n#define TT_MAC_LANGID_SUNDANESE                   139\n\n\n#if 0  /* these seem to be errors that have been dropped */\n\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             140\n#define TT_MAC_LANGID_IRISH_GAELIC                141\n\n#endif\n\n\n  /* The following codes are new as of 2000-03-10 */\n#define TT_MAC_LANGID_GALICIAN                    140\n#define TT_MAC_LANGID_AFRIKAANS                   141\n#define TT_MAC_LANGID_BRETON                      142\n#define TT_MAC_LANGID_INUKTITUT                   143\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             144\n#define TT_MAC_LANGID_MANX_GAELIC                 145\n#define TT_MAC_LANGID_IRISH_GAELIC                146\n#define TT_MAC_LANGID_TONGAN                      147\n#define TT_MAC_LANGID_GREEK_POLYTONIC             148\n#define TT_MAC_LANGID_GREELANDIC                  149\n#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT    150\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MICROSOFT.                                                */\n  /*                                                                       */\n  /* The canonical source for the MS assigned LCIDs is                     */\n  /*                                                                       */\n  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */\n  /*                                                                       */\n\n#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001\n#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401\n#define TT_MS_LANGID_ARABIC_IRAQ                       0x0801\n#define TT_MS_LANGID_ARABIC_EGYPT                      0x0c01\n#define TT_MS_LANGID_ARABIC_LIBYA                      0x1001\n#define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401\n#define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801\n#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1c01\n#define TT_MS_LANGID_ARABIC_OMAN                       0x2001\n#define TT_MS_LANGID_ARABIC_YEMEN                      0x2401\n#define TT_MS_LANGID_ARABIC_SYRIA                      0x2801\n#define TT_MS_LANGID_ARABIC_JORDAN                     0x2c01\n#define TT_MS_LANGID_ARABIC_LEBANON                    0x3001\n#define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401\n#define TT_MS_LANGID_ARABIC_UAE                        0x3801\n#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3c01\n#define TT_MS_LANGID_ARABIC_QATAR                      0x4001\n#define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402\n#define TT_MS_LANGID_CATALAN_SPAIN                     0x0403\n#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004\n#define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404\n#define TT_MS_LANGID_CHINESE_PRC                       0x0804\n#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0c04\n#define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004\n\n#if 1  /* this looks like the correct value */\n#define TT_MS_LANGID_CHINESE_MACAU                     0x1404\n#else  /* but beware, Microsoft may change its mind...\n          the most recent Word reference has the following: */\n#define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG\n#endif\n\n#if 0  /* used only with .NET `cultures'; commented out */\n#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04\n#endif\n\n#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405\n#define TT_MS_LANGID_DANISH_DENMARK                    0x0406\n#define TT_MS_LANGID_GERMAN_GERMANY                    0x0407\n#define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807\n#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0c07\n#define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007\n#define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407\n#define TT_MS_LANGID_GREEK_GREECE                      0x0408\n\n  /* don't ask what this one means... It is commented out currently. */\n#if 0\n#define TT_MS_LANGID_GREEK_GREECE2                     0x2008\n#endif\n\n#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009\n#define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409\n#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809\n#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0c09\n#define TT_MS_LANGID_ENGLISH_CANADA                    0x1009\n#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409\n#define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809\n#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1c09\n#define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009\n#define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409\n#define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809\n#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2c09\n#define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009\n#define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409\n#define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809\n#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3c09\n#define TT_MS_LANGID_ENGLISH_INDIA                     0x4009\n#define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409\n#define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809\n#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040a\n#define TT_MS_LANGID_SPANISH_MEXICO                    0x080a\n#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0c0a\n#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100a\n#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140a\n#define TT_MS_LANGID_SPANISH_PANAMA                    0x180a\n#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1c0a\n#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200a\n#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240a\n#define TT_MS_LANGID_SPANISH_PERU                      0x280a\n#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2c0a\n#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300a\n#define TT_MS_LANGID_SPANISH_CHILE                     0x340a\n#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380a\n#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3c0a\n#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400a\n#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440a\n#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480a\n#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4c0a\n#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500a\n#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a\n  /* The following ID blatantly violate MS specs by using a */\n  /* sublanguage > 0x1F.                                    */\n#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU\n#define TT_MS_LANGID_FINNISH_FINLAND                   0x040b\n#define TT_MS_LANGID_FRENCH_FRANCE                     0x040c\n#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080c\n#define TT_MS_LANGID_FRENCH_CANADA                     0x0c0c\n#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100c\n#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140c\n#define TT_MS_LANGID_FRENCH_MONACO                     0x180c\n#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1c0c\n#define TT_MS_LANGID_FRENCH_REUNION                    0x200c\n#define TT_MS_LANGID_FRENCH_CONGO                      0x240c\n  /* which was formerly: */\n#define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO\n#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280c\n#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2c0c\n#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300c\n#define TT_MS_LANGID_FRENCH_MALI                       0x340c\n#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c\n#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c\n  /* and another violation of the spec (see 0xE40aU) */\n#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU\n#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040d\n#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040e\n#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040f\n#define TT_MS_LANGID_ITALIAN_ITALY                     0x0410\n#define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810\n#define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411\n#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA     0x0412\n#define TT_MS_LANGID_KOREAN_JOHAB_KOREA                0x0812\n#define TT_MS_LANGID_DUTCH_NETHERLANDS                 0x0413\n#define TT_MS_LANGID_DUTCH_BELGIUM                     0x0813\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL           0x0414\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK          0x0814\n#define TT_MS_LANGID_POLISH_POLAND                     0x0415\n#define TT_MS_LANGID_PORTUGUESE_BRAZIL                 0x0416\n#define TT_MS_LANGID_PORTUGUESE_PORTUGAL               0x0816\n#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND        0x0417\n#define TT_MS_LANGID_ROMANIAN_ROMANIA                  0x0418\n#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818\n#define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419\n#define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819\n#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041a\n#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081a\n#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0c1a\n\n#if 0  /* this used to be this value, but it looks like we were wrong */\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a\n#else  /* current sources say */\n#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101a\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141a\n       /* and XPsp2 Platform SDK added (2004-07-26) */\n       /* Names are shortened to be significant within 40 chars. */\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181a\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181a\n#endif\n\n#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041b\n#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041c\n#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041d\n#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081d\n#define TT_MS_LANGID_THAI_THAILAND                     0x041e\n#define TT_MS_LANGID_TURKISH_TURKEY                    0x041f\n#define TT_MS_LANGID_URDU_PAKISTAN                     0x0420\n#define TT_MS_LANGID_URDU_INDIA                        0x0820\n#define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421\n#define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422\n#define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423\n#define TT_MS_LANGID_SLOVENE_SLOVENIA                  0x0424\n#define TT_MS_LANGID_ESTONIAN_ESTONIA                  0x0425\n#define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426\n#define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427\n#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827\n#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428\n#define TT_MS_LANGID_FARSI_IRAN                        0x0429\n#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042a\n#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042b\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042c\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082c\n#define TT_MS_LANGID_BASQUE_SPAIN                      0x042d\n#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042e\n#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042f\n#define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430\n#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431\n#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432\n#define TT_MS_LANGID_VENDA_SOUTH_AFRICA                0x0433\n#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA                0x0434\n#define TT_MS_LANGID_ZULU_SOUTH_AFRICA                 0x0435\n#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA            0x0436\n#define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437\n#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438\n#define TT_MS_LANGID_HINDI_INDIA                       0x0439\n#define TT_MS_LANGID_MALTESE_MALTA                     0x043a\n  /* Added by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043b\n#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083b\n#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3b\n#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103b\n#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143b\n#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183b\n#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3b\n#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203b\n#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243b\n  /* ... and we also keep our old identifier... */\n#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b\n\n#if 0 /* this seems to be a previous inversion */\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#else\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#endif\n\n#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d\n#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043e\n#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083e\n#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043f\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \\\n          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN\n\n#define TT_MS_LANGID_SWAHILI_KENYA                     0x0441\n#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843\n#define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444\n#define TT_MS_LANGID_BENGALI_INDIA                     0x0445\n#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845\n#define TT_MS_LANGID_PUNJABI_INDIA                     0x0446\n#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846\n#define TT_MS_LANGID_GUJARATI_INDIA                    0x0447\n#define TT_MS_LANGID_ORIYA_INDIA                       0x0448\n#define TT_MS_LANGID_TAMIL_INDIA                       0x0449\n#define TT_MS_LANGID_TELUGU_INDIA                      0x044a\n#define TT_MS_LANGID_KANNADA_INDIA                     0x044b\n#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044c\n#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044d\n#define TT_MS_LANGID_MARATHI_INDIA                     0x044e\n#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044f\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850\n#define TT_MS_LANGID_TIBETAN_CHINA                     0x0451\n  /* Don't use the next constant!  It has            */\n  /*   (1) the wrong spelling (Dzonghka)             */\n  /*   (2) Microsoft doesn't officially define it -- */\n  /*       at least it is not in the List of Local   */\n  /*       ID Values.                                */\n  /*   (3) Dzongkha is not the same language as      */\n  /*       Tibetan, so merging it is wrong anyway.   */\n  /*                                                 */\n  /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW.    */\n#define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851\n\n#if 0\n  /* the following used to be defined */\n#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451\n  /* ... but it was changed; */\n#else\n  /* So we will continue to #define it, but with the correct value */\n#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN\n#endif\n\n#define TT_MS_LANGID_WELSH_WALES                       0x0452\n#define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453\n#define TT_MS_LANGID_LAO_LAOS                          0x0454\n#define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455\n#define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456\n#define TT_MS_LANGID_KONKANI_INDIA                     0x0457\n#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458\n#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459\n#define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859\n  /* Missing a LCID for Sindhi in Devanagari script */\n#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045a\n#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045b\n#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045c\n#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045d\n#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045e\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045f\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085f\n  /* Missing a LCID for Tifinagh script */\n#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460\n  /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */\n  /* script is yet unclear... might be Arabic, Nagari or Sharada */\n#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860\n  /* ... and aliased (by MS) for compatibility reasons. */\n#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA\n#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461\n#define TT_MS_LANGID_NEPALI_INDIA                      0x0861\n#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462\n#define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463\n#define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464\n#define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES\n#define TT_MS_LANGID_EDO_NIGERIA                       0x0466\n#define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467\n#define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468\n#define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469\n#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046a\n#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046b\n#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086b\n#define TT_MS_LANGID_QUECHUA_PERU                      0x0c6b\n#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046c\n  /* Also spelled by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \\\n          TT_MS_LANGID_SEPEDI_SOUTH_AFRICA\n  /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */\n#define TT_MS_LANGID_IGBO_NIGERIA                      0x0470\n#define TT_MS_LANGID_KANURI_NIGERIA                    0x0471\n#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472\n#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473\n#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873\n  /* also spelled in the `Passport SDK' list as: */\n#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA\n#define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474\n#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475\n#define TT_MS_LANGID_LATIN                             0x0476\n#define TT_MS_LANGID_SOMALI_SOMALIA                    0x0477\n  /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */\n  /*       not written (but OTOH the peculiar writing system is worth     */\n  /*       studying).                                                     */\n#define TT_MS_LANGID_YI_CHINA                          0x0478\n#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479\n  /* language codes from 0x047a to 0x047f are (still) unknown. */\n#define TT_MS_LANGID_UIGHUR_CHINA                      0x0480\n#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481\n\n#if 0  /* not deemed useful for fonts */\n#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04ff\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the `name' identifier field in the name records of */\n  /* the TTF `name' table.  These values are platform independent.         */\n  /*                                                                       */\n#define TT_NAME_ID_COPYRIGHT            0\n#define TT_NAME_ID_FONT_FAMILY          1\n#define TT_NAME_ID_FONT_SUBFAMILY       2\n#define TT_NAME_ID_UNIQUE_ID            3\n#define TT_NAME_ID_FULL_NAME            4\n#define TT_NAME_ID_VERSION_STRING       5\n#define TT_NAME_ID_PS_NAME              6\n#define TT_NAME_ID_TRADEMARK            7\n\n  /* the following values are from the OpenType spec */\n#define TT_NAME_ID_MANUFACTURER         8\n#define TT_NAME_ID_DESIGNER             9\n#define TT_NAME_ID_DESCRIPTION          10\n#define TT_NAME_ID_VENDOR_URL           11\n#define TT_NAME_ID_DESIGNER_URL         12\n#define TT_NAME_ID_LICENSE              13\n#define TT_NAME_ID_LICENSE_URL          14\n  /* number 15 is reserved */\n#define TT_NAME_ID_PREFERRED_FAMILY     16\n#define TT_NAME_ID_PREFERRED_SUBFAMILY  17\n#define TT_NAME_ID_MAC_FULL_NAME        18\n\n  /* The following code is new as of 2000-01-21 */\n#define TT_NAME_ID_SAMPLE_TEXT          19\n\n  /* This is new in OpenType 1.3 */\n#define TT_NAME_ID_CID_FINDFONT_NAME    20\n\n  /* This is new in OpenType 1.5 */\n#define TT_NAME_ID_WWS_FAMILY           21\n#define TT_NAME_ID_WWS_SUBFAMILY        22\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table.     */\n  /*                                                                       */\n  /* Updated 08-Nov-2008.                                                  */\n  /*                                                                       */\n\n  /* Bit  0   Basic Latin */\n#define TT_UCR_BASIC_LATIN                     (1L <<  0) /* U+0020-U+007E */\n  /* Bit  1   C1 Controls and Latin-1 Supplement */\n#define TT_UCR_LATIN1_SUPPLEMENT               (1L <<  1) /* U+0080-U+00FF */\n  /* Bit  2   Latin Extended-A */\n#define TT_UCR_LATIN_EXTENDED_A                (1L <<  2) /* U+0100-U+017F */\n  /* Bit  3   Latin Extended-B */\n#define TT_UCR_LATIN_EXTENDED_B                (1L <<  3) /* U+0180-U+024F */\n  /* Bit  4   IPA Extensions                 */\n  /*          Phonetic Extensions            */\n  /*          Phonetic Extensions Supplement */\n#define TT_UCR_IPA_EXTENSIONS                  (1L <<  4) /* U+0250-U+02AF */\n                                                          /* U+1D00-U+1D7F */\n                                                          /* U+1D80-U+1DBF */\n  /* Bit  5   Spacing Modifier Letters */\n  /*          Modifier Tone Letters    */\n#define TT_UCR_SPACING_MODIFIER                (1L <<  5) /* U+02B0-U+02FF */\n                                                          /* U+A700-U+A71F */\n  /* Bit  6   Combining Diacritical Marks            */\n  /*          Combining Diacritical Marks Supplement */\n#define TT_UCR_COMBINING_DIACRITICS            (1L <<  6) /* U+0300-U+036F */\n                                                          /* U+1DC0-U+1DFF */\n  /* Bit  7   Greek and Coptic */\n#define TT_UCR_GREEK                           (1L <<  7) /* U+0370-U+03FF */\n  /* Bit  8   Coptic */\n#define TT_UCR_COPTIC                          (1L <<  8) /* U+2C80-U+2CFF */\n  /* Bit  9   Cyrillic            */\n  /*          Cyrillic Supplement */\n  /*          Cyrillic Extended-A */\n  /*          Cyrillic Extended-B */\n#define TT_UCR_CYRILLIC                        (1L <<  9) /* U+0400-U+04FF */\n                                                          /* U+0500-U+052F */\n                                                          /* U+2DE0-U+2DFF */\n                                                          /* U+A640-U+A69F */\n  /* Bit 10   Armenian */\n#define TT_UCR_ARMENIAN                        (1L << 10) /* U+0530-U+058F */\n  /* Bit 11   Hebrew */\n#define TT_UCR_HEBREW                          (1L << 11) /* U+0590-U+05FF */\n  /* Bit 12   Vai */\n#define TT_UCR_VAI                             (1L << 12) /* U+A500-U+A63F */\n  /* Bit 13   Arabic            */\n  /*          Arabic Supplement */\n#define TT_UCR_ARABIC                          (1L << 13) /* U+0600-U+06FF */\n                                                          /* U+0750-U+077F */\n  /* Bit 14   NKo */\n#define TT_UCR_NKO                             (1L << 14) /* U+07C0-U+07FF */\n  /* Bit 15   Devanagari */\n#define TT_UCR_DEVANAGARI                      (1L << 15) /* U+0900-U+097F */\n  /* Bit 16   Bengali */\n#define TT_UCR_BENGALI                         (1L << 16) /* U+0980-U+09FF */\n  /* Bit 17   Gurmukhi */\n#define TT_UCR_GURMUKHI                        (1L << 17) /* U+0A00-U+0A7F */\n  /* Bit 18   Gujarati */\n#define TT_UCR_GUJARATI                        (1L << 18) /* U+0A80-U+0AFF */\n  /* Bit 19   Oriya */\n#define TT_UCR_ORIYA                           (1L << 19) /* U+0B00-U+0B7F */\n  /* Bit 20   Tamil */\n#define TT_UCR_TAMIL                           (1L << 20) /* U+0B80-U+0BFF */\n  /* Bit 21   Telugu */\n#define TT_UCR_TELUGU                          (1L << 21) /* U+0C00-U+0C7F */\n  /* Bit 22   Kannada */\n#define TT_UCR_KANNADA                         (1L << 22) /* U+0C80-U+0CFF */\n  /* Bit 23   Malayalam */\n#define TT_UCR_MALAYALAM                       (1L << 23) /* U+0D00-U+0D7F */\n  /* Bit 24   Thai */\n#define TT_UCR_THAI                            (1L << 24) /* U+0E00-U+0E7F */\n  /* Bit 25   Lao */\n#define TT_UCR_LAO                             (1L << 25) /* U+0E80-U+0EFF */\n  /* Bit 26   Georgian            */\n  /*          Georgian Supplement */\n#define TT_UCR_GEORGIAN                        (1L << 26) /* U+10A0-U+10FF */\n                                                          /* U+2D00-U+2D2F */\n  /* Bit 27   Balinese */\n#define TT_UCR_BALINESE                        (1L << 27) /* U+1B00-U+1B7F */\n  /* Bit 28   Hangul Jamo */\n#define TT_UCR_HANGUL_JAMO                     (1L << 28) /* U+1100-U+11FF */\n  /* Bit 29   Latin Extended Additional */\n  /*          Latin Extended-C          */\n  /*          Latin Extended-D          */\n#define TT_UCR_LATIN_EXTENDED_ADDITIONAL       (1L << 29) /* U+1E00-U+1EFF */\n                                                          /* U+2C60-U+2C7F */\n                                                          /* U+A720-U+A7FF */\n  /* Bit 30   Greek Extended */\n#define TT_UCR_GREEK_EXTENDED                  (1L << 30) /* U+1F00-U+1FFF */\n  /* Bit 31   General Punctuation      */\n  /*          Supplemental Punctuation */\n#define TT_UCR_GENERAL_PUNCTUATION             (1L << 31) /* U+2000-U+206F */\n                                                          /* U+2E00-U+2E7F */\n  /* Bit 32   Superscripts And Subscripts */\n#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS         (1L <<  0) /* U+2070-U+209F */\n  /* Bit 33   Currency Symbols */\n#define TT_UCR_CURRENCY_SYMBOLS                (1L <<  1) /* U+20A0-U+20CF */\n  /* Bit 34   Combining Diacritical Marks For Symbols */\n#define TT_UCR_COMBINING_DIACRITICS_SYMB       (1L <<  2) /* U+20D0-U+20FF */\n  /* Bit 35   Letterlike Symbols */\n#define TT_UCR_LETTERLIKE_SYMBOLS              (1L <<  3) /* U+2100-U+214F */\n  /* Bit 36   Number Forms */\n#define TT_UCR_NUMBER_FORMS                    (1L <<  4) /* U+2150-U+218F */\n  /* Bit 37   Arrows                           */\n  /*          Supplemental Arrows-A            */\n  /*          Supplemental Arrows-B            */\n  /*          Miscellaneous Symbols and Arrows */\n#define TT_UCR_ARROWS                          (1L <<  5) /* U+2190-U+21FF */\n                                                          /* U+27F0-U+27FF */\n                                                          /* U+2900-U+297F */\n                                                          /* U+2B00-U+2BFF */\n  /* Bit 38   Mathematical Operators               */\n  /*          Supplemental Mathematical Operators  */\n  /*          Miscellaneous Mathematical Symbols-A */\n  /*          Miscellaneous Mathematical Symbols-B */\n#define TT_UCR_MATHEMATICAL_OPERATORS          (1L <<  6) /* U+2200-U+22FF */\n                                                          /* U+2A00-U+2AFF */\n                                                          /* U+27C0-U+27EF */\n                                                          /* U+2980-U+29FF */\n  /* Bit 39 Miscellaneous Technical */\n#define TT_UCR_MISCELLANEOUS_TECHNICAL         (1L <<  7) /* U+2300-U+23FF */\n  /* Bit 40   Control Pictures */\n#define TT_UCR_CONTROL_PICTURES                (1L <<  8) /* U+2400-U+243F */\n  /* Bit 41   Optical Character Recognition */\n#define TT_UCR_OCR                             (1L <<  9) /* U+2440-U+245F */\n  /* Bit 42   Enclosed Alphanumerics */\n#define TT_UCR_ENCLOSED_ALPHANUMERICS          (1L << 10) /* U+2460-U+24FF */\n  /* Bit 43   Box Drawing */\n#define TT_UCR_BOX_DRAWING                     (1L << 11) /* U+2500-U+257F */\n  /* Bit 44   Block Elements */\n#define TT_UCR_BLOCK_ELEMENTS                  (1L << 12) /* U+2580-U+259F */\n  /* Bit 45   Geometric Shapes */\n#define TT_UCR_GEOMETRIC_SHAPES                (1L << 13) /* U+25A0-U+25FF */\n  /* Bit 46   Miscellaneous Symbols */\n#define TT_UCR_MISCELLANEOUS_SYMBOLS           (1L << 14) /* U+2600-U+26FF */\n  /* Bit 47   Dingbats */\n#define TT_UCR_DINGBATS                        (1L << 15) /* U+2700-U+27BF */\n  /* Bit 48   CJK Symbols and Punctuation */\n#define TT_UCR_CJK_SYMBOLS                     (1L << 16) /* U+3000-U+303F */\n  /* Bit 49   Hiragana */\n#define TT_UCR_HIRAGANA                        (1L << 17) /* U+3040-U+309F */\n  /* Bit 50   Katakana                     */\n  /*          Katakana Phonetic Extensions */\n#define TT_UCR_KATAKANA                        (1L << 18) /* U+30A0-U+30FF */\n                                                          /* U+31F0-U+31FF */\n  /* Bit 51   Bopomofo          */\n  /*          Bopomofo Extended */\n#define TT_UCR_BOPOMOFO                        (1L << 19) /* U+3100-U+312F */\n                                                          /* U+31A0-U+31BF */\n  /* Bit 52   Hangul Compatibility Jamo */\n#define TT_UCR_HANGUL_COMPATIBILITY_JAMO       (1L << 20) /* U+3130-U+318F */\n  /* Bit 53   Phags-Pa */\n#define TT_UCR_CJK_MISC                        (1L << 21) /* U+A840-U+A87F */\n#define TT_UCR_KANBUN  TT_UCR_CJK_MISC /* deprecated */\n#define TT_UCR_PHAGSPA\n  /* Bit 54   Enclosed CJK Letters and Months */\n#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS     (1L << 22) /* U+3200-U+32FF */\n  /* Bit 55   CJK Compatibility */\n#define TT_UCR_CJK_COMPATIBILITY               (1L << 23) /* U+3300-U+33FF */\n  /* Bit 56   Hangul Syllables */\n#define TT_UCR_HANGUL                          (1L << 24) /* U+AC00-U+D7A3 */\n  /* Bit 57   High Surrogates              */\n  /*          High Private Use Surrogates  */\n  /*          Low Surrogates               */\n  /*                                       */\n  /* According to OpenType specs v.1.3+,   */\n  /* setting bit 57 implies that there is  */\n  /* at least one codepoint beyond the     */\n  /* Basic Multilingual Plane that is      */\n  /* supported by this font.  So it really */\n  /* means >= U+10000                      */\n#define TT_UCR_SURROGATES                      (1L << 25) /* U+D800-U+DB7F */\n                                                          /* U+DB80-U+DBFF */\n                                                          /* U+DC00-U+DFFF */\n#define TT_UCR_NON_PLANE_0  TT_UCR_SURROGATES\n  /* Bit 58  Phoenician */\n#define TT_UCR_PHOENICIAN                      (1L << 26) /*U+10900-U+1091F*/\n  /* Bit 59   CJK Unified Ideographs             */\n  /*          CJK Radicals Supplement            */\n  /*          Kangxi Radicals                    */\n  /*          Ideographic Description Characters */\n  /*          CJK Unified Ideographs Extension A */\n  /*          CJK Unified Ideographs Extension B */\n  /*          Kanbun                             */\n#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS          (1L << 27) /* U+4E00-U+9FFF */\n                                                          /* U+2E80-U+2EFF */\n                                                          /* U+2F00-U+2FDF */\n                                                          /* U+2FF0-U+2FFF */\n                                                          /* U+3400-U+4DB5 */\n                                                          /*U+20000-U+2A6DF*/\n                                                          /* U+3190-U+319F */\n  /* Bit 60   Private Use */\n#define TT_UCR_PRIVATE_USE                     (1L << 28) /* U+E000-U+F8FF */\n  /* Bit 61   CJK Strokes                             */\n  /*          CJK Compatibility Ideographs            */\n  /*          CJK Compatibility Ideographs Supplement */\n#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS    (1L << 29) /* U+31C0-U+31EF */\n                                                          /* U+F900-U+FAFF */\n                                                          /*U+2F800-U+2FA1F*/\n  /* Bit 62   Alphabetic Presentation Forms */\n#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS   (1L << 30) /* U+FB00-U+FB4F */\n  /* Bit 63   Arabic Presentation Forms-A */\n#define TT_UCR_ARABIC_PRESENTATIONS_A          (1L << 31) /* U+FB50-U+FDFF */\n  /* Bit 64   Combining Half Marks */\n#define TT_UCR_COMBINING_HALF_MARKS            (1L <<  0) /* U+FE20-U+FE2F */\n  /* Bit 65   Vertical forms          */\n  /*          CJK Compatibility Forms */\n#define TT_UCR_CJK_COMPATIBILITY_FORMS         (1L <<  1) /* U+FE10-U+FE1F */\n                                                          /* U+FE30-U+FE4F */\n  /* Bit 66   Small Form Variants */\n#define TT_UCR_SMALL_FORM_VARIANTS             (1L <<  2) /* U+FE50-U+FE6F */\n  /* Bit 67   Arabic Presentation Forms-B */\n#define TT_UCR_ARABIC_PRESENTATIONS_B          (1L <<  3) /* U+FE70-U+FEFE */\n  /* Bit 68   Halfwidth and Fullwidth Forms */\n#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS       (1L <<  4) /* U+FF00-U+FFEF */\n  /* Bit 69   Specials */\n#define TT_UCR_SPECIALS                        (1L <<  5) /* U+FFF0-U+FFFD */\n  /* Bit 70   Tibetan */\n#define TT_UCR_TIBETAN                         (1L <<  6) /* U+0F00-U+0FFF */\n  /* Bit 71   Syriac */\n#define TT_UCR_SYRIAC                          (1L <<  7) /* U+0700-U+074F */\n  /* Bit 72   Thaana */\n#define TT_UCR_THAANA                          (1L <<  8) /* U+0780-U+07BF */\n  /* Bit 73   Sinhala */\n#define TT_UCR_SINHALA                         (1L <<  9) /* U+0D80-U+0DFF */\n  /* Bit 74   Myanmar */\n#define TT_UCR_MYANMAR                         (1L << 10) /* U+1000-U+109F */\n  /* Bit 75   Ethiopic            */\n  /*          Ethiopic Supplement */\n  /*          Ethiopic Extended   */\n#define TT_UCR_ETHIOPIC                        (1L << 11) /* U+1200-U+137F */\n                                                          /* U+1380-U+139F */\n                                                          /* U+2D80-U+2DDF */\n  /* Bit 76   Cherokee */\n#define TT_UCR_CHEROKEE                        (1L << 12) /* U+13A0-U+13FF */\n  /* Bit 77   Unified Canadian Aboriginal Syllabics */\n#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS   (1L << 13) /* U+1400-U+167F */\n  /* Bit 78   Ogham */\n#define TT_UCR_OGHAM                           (1L << 14) /* U+1680-U+169F */\n  /* Bit 79   Runic */\n#define TT_UCR_RUNIC                           (1L << 15) /* U+16A0-U+16FF */\n  /* Bit 80   Khmer         */\n  /*          Khmer Symbols */\n#define TT_UCR_KHMER                           (1L << 16) /* U+1780-U+17FF */\n                                                          /* U+19E0-U+19FF */\n  /* Bit 81   Mongolian */\n#define TT_UCR_MONGOLIAN                       (1L << 17) /* U+1800-U+18AF */\n  /* Bit 82   Braille Patterns */\n#define TT_UCR_BRAILLE                         (1L << 18) /* U+2800-U+28FF */\n  /* Bit 83   Yi Syllables */\n  /*          Yi Radicals  */\n#define TT_UCR_YI                              (1L << 19) /* U+A000-U+A48F */\n                                                          /* U+A490-U+A4CF */\n  /* Bit 84   Tagalog  */\n  /*          Hanunoo  */\n  /*          Buhid    */\n  /*          Tagbanwa */\n#define TT_UCR_PHILIPPINE                      (1L << 20) /* U+1700-U+171F */\n                                                          /* U+1720-U+173F */\n                                                          /* U+1740-U+175F */\n                                                          /* U+1760-U+177F */\n  /* Bit 85   Old Italic */\n#define TT_UCR_OLD_ITALIC                      (1L << 21) /*U+10300-U+1032F*/\n  /* Bit 86   Gothic */\n#define TT_UCR_GOTHIC                          (1L << 22) /*U+10330-U+1034F*/\n  /* Bit 87   Deseret */\n#define TT_UCR_DESERET                         (1L << 23) /*U+10400-U+1044F*/\n  /* Bit 88   Byzantine Musical Symbols      */\n  /*          Musical Symbols                */\n  /*          Ancient Greek Musical Notation */\n#define TT_UCR_MUSICAL_SYMBOLS                 (1L << 24) /*U+1D000-U+1D0FF*/\n                                                          /*U+1D100-U+1D1FF*/\n                                                          /*U+1D200-U+1D24F*/\n  /* Bit 89   Mathematical Alphanumeric Symbols */\n#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS       (1L << 25) /*U+1D400-U+1D7FF*/\n  /* Bit 90   Private Use (plane 15) */\n  /*          Private Use (plane 16) */\n#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY       (1L << 26) /*U+F0000-U+FFFFD*/\n                                                        /*U+100000-U+10FFFD*/\n  /* Bit 91   Variation Selectors            */\n  /*          Variation Selectors Supplement */\n#define TT_UCR_VARIATION_SELECTORS             (1L << 27) /* U+FE00-U+FE0F */\n                                                          /*U+E0100-U+E01EF*/\n  /* Bit 92   Tags */\n#define TT_UCR_TAGS                            (1L << 28) /*U+E0000-U+E007F*/\n  /* Bit 93   Limbu */\n#define TT_UCR_LIMBU                           (1L << 29) /* U+1900-U+194F */\n  /* Bit 94   Tai Le */\n#define TT_UCR_TAI_LE                          (1L << 30) /* U+1950-U+197F */\n  /* Bit 95   New Tai Lue */\n#define TT_UCR_NEW_TAI_LUE                     (1L << 31) /* U+1980-U+19DF */\n  /* Bit 96   Buginese */\n#define TT_UCR_BUGINESE                        (1L <<  0) /* U+1A00-U+1A1F */\n  /* Bit 97   Glagolitic */\n#define TT_UCR_GLAGOLITIC                      (1L <<  1) /* U+2C00-U+2C5F */\n  /* Bit 98   Tifinagh */\n#define TT_UCR_TIFINAGH                        (1L <<  2) /* U+2D30-U+2D7F */\n  /* Bit 99   Yijing Hexagram Symbols */\n#define TT_UCR_YIJING                          (1L <<  3) /* U+4DC0-U+4DFF */\n  /* Bit 100  Syloti Nagri */\n#define TT_UCR_SYLOTI_NAGRI                    (1L <<  4) /* U+A800-U+A82F */\n  /* Bit 101  Linear B Syllabary */\n  /*          Linear B Ideograms */\n  /*          Aegean Numbers     */\n#define TT_UCR_LINEAR_B                        (1L <<  5) /*U+10000-U+1007F*/\n                                                          /*U+10080-U+100FF*/\n                                                          /*U+10100-U+1013F*/\n  /* Bit 102  Ancient Greek Numbers */\n#define TT_UCR_ANCIENT_GREEK_NUMBERS           (1L <<  6) /*U+10140-U+1018F*/\n  /* Bit 103  Ugaritic */\n#define TT_UCR_UGARITIC                        (1L <<  7) /*U+10380-U+1039F*/\n  /* Bit 104  Old Persian */\n#define TT_UCR_OLD_PERSIAN                     (1L <<  8) /*U+103A0-U+103DF*/\n  /* Bit 105  Shavian */\n#define TT_UCR_SHAVIAN                         (1L <<  9) /*U+10450-U+1047F*/\n  /* Bit 106  Osmanya */\n#define TT_UCR_OSMANYA                         (1L << 10) /*U+10480-U+104AF*/\n  /* Bit 107  Cypriot Syllabary */\n#define TT_UCR_CYPRIOT_SYLLABARY               (1L << 11) /*U+10800-U+1083F*/\n  /* Bit 108  Kharoshthi */\n#define TT_UCR_KHAROSHTHI                      (1L << 12) /*U+10A00-U+10A5F*/\n  /* Bit 109  Tai Xuan Jing Symbols */\n#define TT_UCR_TAI_XUAN_JING                   (1L << 13) /*U+1D300-U+1D35F*/\n  /* Bit 110  Cuneiform                         */\n  /*          Cuneiform Numbers and Punctuation */\n#define TT_UCR_CUNEIFORM                       (1L << 14) /*U+12000-U+123FF*/\n                                                          /*U+12400-U+1247F*/\n  /* Bit 111  Counting Rod Numerals */\n#define TT_UCR_COUNTING_ROD_NUMERALS           (1L << 15) /*U+1D360-U+1D37F*/\n  /* Bit 112  Sundanese */\n#define TT_UCR_SUNDANESE                       (1L << 16) /* U+1B80-U+1BBF */\n  /* Bit 113  Lepcha */\n#define TT_UCR_LEPCHA                          (1L << 17) /* U+1C00-U+1C4F */\n  /* Bit 114  Ol Chiki */\n#define TT_UCR_OL_CHIKI                        (1L << 18) /* U+1C50-U+1C7F */\n  /* Bit 115  Saurashtra */\n#define TT_UCR_SAURASHTRA                      (1L << 19) /* U+A880-U+A8DF */\n  /* Bit 116  Kayah Li */\n#define TT_UCR_KAYAH_LI                        (1L << 20) /* U+A900-U+A92F */\n  /* Bit 117  Rejang */\n#define TT_UCR_REJANG                          (1L << 21) /* U+A930-U+A95F */\n  /* Bit 118  Cham */\n#define TT_UCR_CHAM                            (1L << 22) /* U+AA00-U+AA5F */\n  /* Bit 119  Ancient Symbols */\n#define TT_UCR_ANCIENT_SYMBOLS                 (1L << 23) /*U+10190-U+101CF*/\n  /* Bit 120  Phaistos Disc */\n#define TT_UCR_PHAISTOS_DISC                   (1L << 24) /*U+101D0-U+101FF*/\n  /* Bit 121  Carian */\n  /*          Lycian */\n  /*          Lydian */\n#define TT_UCR_OLD_ANATOLIAN                   (1L << 25) /*U+102A0-U+102DF*/\n                                                          /*U+10280-U+1029F*/\n                                                          /*U+10920-U+1093F*/\n  /* Bit 122  Domino Tiles  */\n  /*          Mahjong Tiles */\n#define TT_UCR_GAME_TILES                      (1L << 26) /*U+1F030-U+1F09F*/\n                                                          /*U+1F000-U+1F02F*/\n  /* Bit 123-127 Reserved for process-internal usage */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some compilers have a very limited length of identifiers.             */\n  /*                                                                       */\n#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )\n#define HAVE_LIMIT_ON_IDENTS\n#endif\n\n\n#ifndef HAVE_LIMIT_ON_IDENTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here some alias #defines in order to be clearer.                      */\n  /*                                                                       */\n  /* These are not always #defined to stay within the 31~character limit   */\n  /* which some compilers have.                                            */\n  /*                                                                       */\n  /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */\n  /* Borland compilers (read: from BC++ 3.1 on) can increase this limit.   */\n  /* If you get a warning with such a compiler, use the -i40 switch.       */\n  /*                                                                       */\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_A      \\\n         TT_UCR_ARABIC_PRESENTATIONS_A\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_B      \\\n         TT_UCR_ARABIC_PRESENTATIONS_B\n\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS      \\\n         TT_UCR_COMBINING_DIACRITICS\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\\n         TT_UCR_COMBINING_DIACRITICS_SYMB\n\n\n#endif /* !HAVE_LIMIT_ON_IDENTS */\n\n\nFT_END_HEADER\n\n#endif /* __TTNAMEID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/tttables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttables.h                                                             */\n/*                                                                         */\n/*    Basic SFNT/TrueType tables definitions and interface                 */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 1996-2005, 2008-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTABLES_H__\n#define __TTTABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueType Tables                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    TrueType specific table types and functions.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of TrueType-specific tables   */\n  /*    as well as some routines used to access and process them.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Header                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType font header table.  All       */\n  /*    fields follow the TrueType specification.                          */\n  /*                                                                       */\n  typedef struct  TT_Header_\n  {\n    FT_Fixed   Table_Version;\n    FT_Fixed   Font_Revision;\n\n    FT_Long    CheckSum_Adjust;\n    FT_Long    Magic_Number;\n\n    FT_UShort  Flags;\n    FT_UShort  Units_Per_EM;\n\n    FT_Long    Created [2];\n    FT_Long    Modified[2];\n\n    FT_Short   xMin;\n    FT_Short   yMin;\n    FT_Short   xMax;\n    FT_Short   yMax;\n\n    FT_UShort  Mac_Style;\n    FT_UShort  Lowest_Rec_PPEM;\n\n    FT_Short   Font_Direction;\n    FT_Short   Index_To_Loc_Format;\n    FT_Short   Glyph_Data_Format;\n\n  } TT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HoriHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType horizontal header, the `hhea' */\n  /*    table, as well as the corresponding horizontal metrics table,      */\n  /*    i.e., the `hmtx' table.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                :: The table version.                       */\n  /*                                                                       */\n  /*    Ascender               :: The font's ascender, i.e., the distance  */\n  /*                              from the baseline to the top-most of all */\n  /*                              glyph points found in the font.          */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoAscender' field */\n  /*                              of the OS/2 table instead if you want    */\n  /*                              the correct one.                         */\n  /*                                                                       */\n  /*    Descender              :: The font's descender, i.e., the distance */\n  /*                              from the baseline to the bottom-most of  */\n  /*                              all glyph points found in the font.  It  */\n  /*                              is negative.                             */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoDescender'      */\n  /*                              field of the OS/2 table instead if you   */\n  /*                              want the correct one.                    */\n  /*                                                                       */\n  /*    Line_Gap               :: The font's line gap, i.e., the distance  */\n  /*                              to add to the ascender and descender to  */\n  /*                              get the BTB, i.e., the                   */\n  /*                              baseline-to-baseline distance for the    */\n  /*                              font.                                    */\n  /*                                                                       */\n  /*    advance_Width_Max      :: This field is the maximum of all advance */\n  /*                              widths found in the font.  It can be     */\n  /*                              used to compute the maximum width of an  */\n  /*                              arbitrary string of text.                */\n  /*                                                                       */\n  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */\n  /*                              `width' of a glyph's bounding box) for   */\n  /*                              all glyphs in the font.                  */\n  /*                                                                       */\n  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */\n  /*                              slope of the cursor (slope=rise/run).    */\n  /*                                                                       */\n  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */\n  /*                              slope.                                   */\n  /*                                                                       */\n  /*    Reserved               :: 8~reserved bytes.                        */\n  /*                                                                       */\n  /*    metric_Data_Format     :: Always~0.                                */\n  /*                                                                       */\n  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */\n  /*                              table -- this value can be smaller than  */\n  /*                              the total number of glyphs in the font.  */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_HoriHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Width_Max;      /* advance width maximum */\n\n    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */\n    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */\n    FT_Short   xMax_Extent;            /* xmax extents          */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_HMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they are used to connect the metrics header to the relevant    */\n    /* `HMTX' table.                                                      */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_HoriHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_VertHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType vertical header, the `vhea'   */\n  /*    table, as well as the corresponding vertical metrics table, i.e.,  */\n  /*    the `vmtx' table.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                 :: The table version.                      */\n  /*                                                                       */\n  /*    Ascender                :: The font's ascender, i.e., the distance */\n  /*                               from the baseline to the top-most of    */\n  /*                               all glyph points found in the font.     */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoAscender'      */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Descender               :: The font's descender, i.e., the         */\n  /*                               distance from the baseline to the       */\n  /*                               bottom-most of all glyph points found   */\n  /*                               in the font.  It is negative.           */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoDescender'     */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Line_Gap                :: The font's line gap, i.e., the distance */\n  /*                               to add to the ascender and descender to */\n  /*                               get the BTB, i.e., the                  */\n  /*                               baseline-to-baseline distance for the   */\n  /*                               font.                                   */\n  /*                                                                       */\n  /*    advance_Height_Max      :: This field is the maximum of all        */\n  /*                               advance heights found in the font.  It  */\n  /*                               can be used to compute the maximum      */\n  /*                               height of an arbitrary string of text.  */\n  /*                                                                       */\n  /*    min_Top_Side_Bearing    :: The minimum top side bearing of all     */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    min_Bottom_Side_Bearing :: The minimum bottom side bearing of all  */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    yMax_Extent             :: The maximum vertical extent (i.e., the  */\n  /*                               `height' of a glyph's bounding box) for */\n  /*                               all glyphs in the font.                 */\n  /*                                                                       */\n  /*    caret_Slope_Rise        :: The rise coefficient of the cursor's    */\n  /*                               slope of the cursor (slope=rise/run).   */\n  /*                                                                       */\n  /*    caret_Slope_Run         :: The run coefficient of the cursor's     */\n  /*                               slope.                                  */\n  /*                                                                       */\n  /*    caret_Offset            :: The cursor's offset for slanted fonts.  */\n  /*                               This value is `reserved' in vmtx        */\n  /*                               version 1.0.                            */\n  /*                                                                       */\n  /*    Reserved                :: 8~reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format      :: Always~0.                               */\n  /*                                                                       */\n  /*    number_Of_HMetrics      :: Number of VMetrics entries in the       */\n  /*                               `vmtx' table -- this value can be       */\n  /*                               smaller than the total number of glyphs */\n  /*                               in the font.                            */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_VertHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Height_Max;      /* advance height maximum */\n\n    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */\n    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */\n    FT_Short   yMax_Extent;             /* xmax or ymax extents            */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_VMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they're used to connect the metrics header to the relevant     */\n    /* `HMTX' or `VMTX' table.                                            */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_VertHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_OS2                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType OS/2 table. This is the long  */\n  /*    table version.  All fields comply to the TrueType specification.   */\n  /*                                                                       */\n  /*    Note that we now support old Mac fonts which do not include an     */\n  /*    OS/2 table.  In this case, the `version' field is always set to    */\n  /*    0xFFFF.                                                            */\n  /*                                                                       */\n  typedef struct  TT_OS2_\n  {\n    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */\n    FT_Short   xAvgCharWidth;\n    FT_UShort  usWeightClass;\n    FT_UShort  usWidthClass;\n    FT_Short   fsType;\n    FT_Short   ySubscriptXSize;\n    FT_Short   ySubscriptYSize;\n    FT_Short   ySubscriptXOffset;\n    FT_Short   ySubscriptYOffset;\n    FT_Short   ySuperscriptXSize;\n    FT_Short   ySuperscriptYSize;\n    FT_Short   ySuperscriptXOffset;\n    FT_Short   ySuperscriptYOffset;\n    FT_Short   yStrikeoutSize;\n    FT_Short   yStrikeoutPosition;\n    FT_Short   sFamilyClass;\n\n    FT_Byte    panose[10];\n\n    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */\n    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */\n    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */\n    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */\n\n    FT_Char    achVendID[4];\n\n    FT_UShort  fsSelection;\n    FT_UShort  usFirstCharIndex;\n    FT_UShort  usLastCharIndex;\n    FT_Short   sTypoAscender;\n    FT_Short   sTypoDescender;\n    FT_Short   sTypoLineGap;\n    FT_UShort  usWinAscent;\n    FT_UShort  usWinDescent;\n\n    /* only version 1 tables: */\n\n    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */\n    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */\n\n    /* only version 2 tables: */\n\n    FT_Short   sxHeight;\n    FT_Short   sCapHeight;\n    FT_UShort  usDefaultChar;\n    FT_UShort  usBreakChar;\n    FT_UShort  usMaxContext;\n\n  } TT_OS2;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Postscript                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PostScript table.  All fields */\n  /*    comply to the TrueType specification.  This structure does not     */\n  /*    reference the PostScript glyph names, which can be nevertheless    */\n  /*    accessed with the `ttpost' module.                                 */\n  /*                                                                       */\n  typedef struct  TT_Postscript_\n  {\n    FT_Fixed  FormatType;\n    FT_Fixed  italicAngle;\n    FT_Short  underlinePosition;\n    FT_Short  underlineThickness;\n    FT_ULong  isFixedPitch;\n    FT_ULong  minMemType42;\n    FT_ULong  maxMemType42;\n    FT_ULong  minMemType1;\n    FT_ULong  maxMemType1;\n\n    /* Glyph names follow in the file, but we don't   */\n    /* load them by default.  See the ttpost.c file.  */\n\n  } TT_Postscript;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_PCLT                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PCLT table.  All fields       */\n  /*    comply to the TrueType specification.                              */\n  /*                                                                       */\n  typedef struct  TT_PCLT_\n  {\n    FT_Fixed   Version;\n    FT_ULong   FontNumber;\n    FT_UShort  Pitch;\n    FT_UShort  xHeight;\n    FT_UShort  Style;\n    FT_UShort  TypeFamily;\n    FT_UShort  CapHeight;\n    FT_UShort  SymbolSet;\n    FT_Char    TypeFace[16];\n    FT_Char    CharacterComplement[8];\n    FT_Char    FileName[6];\n    FT_Char    StrokeWeight;\n    FT_Char    WidthType;\n    FT_Byte    SerifStyle;\n    FT_Byte    Reserved;\n\n  } TT_PCLT;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The maximum profile is a table containing many max values which    */\n  /*    can be used to pre-allocate arrays.  This ensures that no memory   */\n  /*    allocation occurs during a glyph load.                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version               :: The version number.                       */\n  /*                                                                       */\n  /*    numGlyphs             :: The number of glyphs in this TrueType     */\n  /*                             font.                                     */\n  /*                                                                       */\n  /*    maxPoints             :: The maximum number of points in a         */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositePoints'.                     */\n  /*                                                                       */\n  /*    maxContours           :: The maximum number of contours in a       */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositeContours'.                   */\n  /*                                                                       */\n  /*    maxCompositePoints    :: The maximum number of points in a         */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxPoints'.            */\n  /*                                                                       */\n  /*    maxCompositeContours  :: The maximum number of contours in a       */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxContours'.          */\n  /*                                                                       */\n  /*    maxZones              :: The maximum number of zones used for      */\n  /*                             glyph hinting.                            */\n  /*                                                                       */\n  /*    maxTwilightPoints     :: The maximum number of points in the       */\n  /*                             twilight zone used for glyph hinting.     */\n  /*                                                                       */\n  /*    maxStorage            :: The maximum number of elements in the     */\n  /*                             storage area used for glyph hinting.      */\n  /*                                                                       */\n  /*    maxFunctionDefs       :: The maximum number of function            */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxInstructionDefs    :: The maximum number of instruction         */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxStackElements      :: The maximum number of stack elements used */\n  /*                             during bytecode interpretation.           */\n  /*                                                                       */\n  /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */\n  /*                             used for glyph hinting.                   */\n  /*                                                                       */\n  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */\n  /*                             composite) glyphs in a composite glyph.   */\n  /*                                                                       */\n  /*    maxComponentDepth     :: The maximum nesting depth of composite    */\n  /*                             glyphs.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is only used during font loading.                   */\n  /*                                                                       */\n  typedef struct  TT_MaxProfile_\n  {\n    FT_Fixed   version;\n    FT_UShort  numGlyphs;\n    FT_UShort  maxPoints;\n    FT_UShort  maxContours;\n    FT_UShort  maxCompositePoints;\n    FT_UShort  maxCompositeContours;\n    FT_UShort  maxZones;\n    FT_UShort  maxTwilightPoints;\n    FT_UShort  maxStorage;\n    FT_UShort  maxFunctionDefs;\n    FT_UShort  maxInstructionDefs;\n    FT_UShort  maxStackElements;\n    FT_UShort  maxSizeOfInstructions;\n    FT_UShort  maxComponentElements;\n    FT_UShort  maxComponentDepth;\n\n  } TT_MaxProfile;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Sfnt_Tag                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify the index of an SFNT table.         */\n  /*    Used in the @FT_Get_Sfnt_Table API function.                       */\n  /*                                                                       */\n  typedef enum  FT_Sfnt_Tag_\n  {\n    ft_sfnt_head = 0,    /* TT_Header     */\n    ft_sfnt_maxp = 1,    /* TT_MaxProfile */\n    ft_sfnt_os2  = 2,    /* TT_OS2        */\n    ft_sfnt_hhea = 3,    /* TT_HoriHeader */\n    ft_sfnt_vhea = 4,    /* TT_VertHeader */\n    ft_sfnt_post = 5,    /* TT_Postscript */\n    ft_sfnt_pclt = 6,    /* TT_PCLT       */\n\n    sfnt_max   /* internal end mark */\n\n  } FT_Sfnt_Tag;\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pointer to a given SFNT table within a face.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source.                                    */\n  /*                                                                       */\n  /*    tag  :: The index of the SFNT table.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A type-less pointer to the table.  This will be~0 in case of       */\n  /*    error, or if the corresponding table was not found *OR* loaded     */\n  /*    from the file.                                                     */\n  /*                                                                       */\n  /*    Use a typecast according to `tag' to access the structure          */\n  /*    elements.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The table is owned by the face object and disappears with it.      */\n  /*                                                                       */\n  /*    This function is only useful to access SFNT tables that are loaded */\n  /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */\n  /*    a list.                                                            */\n  /*                                                                       */\n  /*    Here an example how to access the `vhea' table:                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      TT_VertHeader*  vert_header;                                     */\n  /*                                                                       */\n  /*                                                                       */\n  /*      vert_header =                                                    */\n  /*        (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea );       */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Load_Sfnt_Table\n  *\n  * @description:\n  *   Load any font table into client memory.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   tag ::\n  *     The four-byte tag of the table to load.  Use the value~0 if you want\n  *     to access the whole font file.  Otherwise, you can use one of the\n  *     definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new\n  *     one with @FT_MAKE_TAG.\n  *\n  *   offset ::\n  *     The starting offset in the table (or file if tag == 0).\n  *\n  * @output:\n  *   buffer ::\n  *     The target buffer address.  The client must ensure that the memory\n  *     array is big enough to hold the data.\n  *\n  * @inout:\n  *   length ::\n  *     If the `length' parameter is NULL, then try to load the whole table.\n  *     Return an error code if it fails.\n  *\n  *     Else, if `*length' is~0, exit immediately while returning the\n  *     table's (or file) full size in it.\n  *\n  *     Else the number of bytes to read from the table or file, from the\n  *     starting offset.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If you need to determine the table's length you should first call this\n  *   function with `*length' set to~0, as in the following example:\n  *\n  *     {\n  *       FT_ULong  length = 0;\n  *\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );\n  *       if ( error ) { ... table does not exist ... }\n  *\n  *       buffer = malloc( length );\n  *       if ( buffer == NULL ) { ... not enough memory ... }\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );\n  *       if ( error ) { ... could not load table ... }\n  *     }\n  */\n  FT_EXPORT( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Sfnt_Table_Info\n  *\n  * @description:\n  *   Return information on an SFNT table.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   table_index ::\n  *     The index of an SFNT table.  The function returns\n  *     FT_Err_Table_Missing for an invalid value.\n  *\n  * @inout:\n  *   tag ::\n  *     The name tag of the SFNT table.  If the value is NULL, `table_index'\n  *     is ignored, and `length' returns the number of SFNT tables in the\n  *     font.\n  *\n  * @output:\n  *   length ::\n  *     The length of the SFNT table (or the number of SFNT tables, depending\n  *     on `tag').\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   While parsing fonts, FreeType handles SFNT tables with length zero as\n  *   missing.\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */\n  /*    language ID values are in `freetype/ttnameid.h'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */\n  /*    TrueType/sfnt face, just return~0 as the default value.            */\n  /*                                                                       */\n  /*    For a format~14 cmap (to access Unicode IVS), the return value is  */\n  /*    0xFFFFFFFF.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap format.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The format of `charmap'.  If `charmap' doesn't belong to a         */\n  /*    TrueType/sfnt face, return -1.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTTABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/tttags.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttags.h                                                               */\n/*                                                                         */\n/*    Tags for TrueType and OpenType tables (specification only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTAGS_H__\n#define __TTAGS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )\n#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )\n#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )\n#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )\n#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )\n#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )\n#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )\n#define TTAG_CBDT  FT_MAKE_TAG( 'C', 'B', 'D', 'T' )\n#define TTAG_CBLC  FT_MAKE_TAG( 'C', 'B', 'L', 'C' )\n#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )\n#define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )\n#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )\n#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )\n#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )\n#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )\n#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )\n#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )\n#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )\n#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )\n#define TTAG_FOND  FT_MAKE_TAG( 'F', 'O', 'N', 'D' )\n#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )\n#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )\n#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )\n#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )\n#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )\n#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )\n#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )\n#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )\n#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )\n#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )\n#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )\n#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )\n#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )\n#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )\n#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )\n#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )\n#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )\n#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )\n#define TTAG_LWFN  FT_MAKE_TAG( 'L', 'W', 'F', 'N' )\n#define TTAG_MATH  FT_MAKE_TAG( 'M', 'A', 'T', 'H' )\n#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )\n#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )\n#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )\n#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )\n#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )\n#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )\n#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )\n#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )\n#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )\n#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )\n#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )\n#define TTAG_POST  FT_MAKE_TAG( 'P', 'O', 'S', 'T' )\n#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )\n#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )\n#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )\n#define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )\n#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )\n#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )\n#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )\n#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )\n#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )\n#define TTAG_TYP1  FT_MAKE_TAG( 'T', 'Y', 'P', '1' )\n#define TTAG_typ1  FT_MAKE_TAG( 't', 'y', 'p', '1' )\n#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )\n#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )\n#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )\n\n\nFT_END_HEADER\n\n#endif /* __TTAGS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/freetype/ttunpat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttunpat.h                                                              */\n/*                                                                         */\n/*    Definitions for the unpatented TrueType hinting system               */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by Graham Asher <graham.asher@btinternet.com>                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTUNPAT_H__\n#define __TTUNPAT_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_UNPATENTED_HINTING\n  *\n  * @description:\n  *   A constant used as the tag of an @FT_Parameter structure to indicate\n  *   that unpatented methods only should be used by the TrueType bytecode\n  *   interpreter for a typeface opened by @FT_Open_Face.\n  *\n  */\n#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __TTUNPAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/ios/ft2build.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ft2build.h                                                             */\n/*                                                                         */\n/*    FreeType 2 build and setup macros.                                   */\n/*    (Generic version)                                                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2006 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file corresponds to the default `ft2build.h' file for            */\n  /* FreeType 2.  It uses the `freetype' include root.                     */\n  /*                                                                       */\n  /* Note that specific platforms might use a different configuration.     */\n  /* See builds/unix/ft2unix.h for an example.                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FT2_BUILD_GENERIC_H__\n#define __FT2_BUILD_GENERIC_H__\n\n#include <freetype/config/ftheader.h>\n\n#endif /* __FT2_BUILD_GENERIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/config/ftconfig.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftconfig.h                                                             */\n/*                                                                         */\n/*    ANSI-specific configuration file (specification only).               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2010-2011 by                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This header file contains a number of macro definitions that are used */\n  /* by the rest of the engine.  Most of the macros here are automatically */\n  /* determined at compile time, and you should not need to change it to   */\n  /* port FreeType, except to compile the library with a non-ANSI          */\n  /* compiler.                                                             */\n  /*                                                                       */\n  /* Note however that if some specific modifications are needed, we       */\n  /* advise you to place a modified copy in your build directory.          */\n  /*                                                                       */\n  /* The build directory is usually `freetype/builds/<system>', and        */\n  /* contains system-specific files that are always included first when    */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* This ANSI version should stay in `include/freetype/config'.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FTCONFIG_H__\n#define __FTCONFIG_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_OPTIONS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* These macros can be toggled to suit a specific system.  The current   */\n  /* ones are defaults used to compile FreeType in an ANSI C environment   */\n  /* (16bit compilers are also supported).  Copy this file to your own     */\n  /* `freetype/builds/<system>' directory, and edit it to port the engine. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* There are systems (like the Texas Instruments 'C54x) where a `char' */\n  /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */\n  /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */\n  /* is probably unexpected.                                             */\n  /*                                                                     */\n  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */\n  /* `char' type.                                                        */\n\n#ifndef FT_CHAR_BIT\n#define FT_CHAR_BIT  CHAR_BIT\n#endif\n\n\n  /* The size of an `int' type.  */\n#if                                 FT_UINT_MAX == 0xFFFFUL\n#define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)\n#elif                               FT_UINT_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)\n#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `int' type!\"\n#endif\n\n  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */\n  /* DM642) is recognized but avoided.                                   */\n#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `long' type!\"\n#endif\n\n\n  /* Preferred alignment of data */\n#define FT_ALIGNMENT  8\n\n\n  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */\n  /* used -- this is only used to get rid of unpleasant compiler warnings */\n#ifndef FT_UNUSED\n#define FT_UNUSED( arg )  ( (arg) = (arg) )\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     AUTOMATIC CONFIGURATION MACROS                    */\n  /*                                                                       */\n  /* These macros are computed from the ones defined above.  Don't touch   */\n  /* their definition, unless you know precisely what you are doing.  No   */\n  /* porter should need to mess with them.                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Mac support                                                           */\n  /*                                                                       */\n  /*   This is the only necessary change, so it is defined here instead    */\n  /*   providing a new configuration file.                                 */\n  /*                                                                       */\n#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \\\n    ( defined( __MWERKS__ ) && defined( macintosh )        )\n  /* no Carbon frameworks for 64bit 10.4.x */\n  /* AvailabilityMacros.h is available since Mac OS X 10.2,        */\n  /* so guess the system version by maximum errno before inclusion */\n#include <errno.h>\n#ifdef ECANCELED /* defined since 10.2 */\n#include \"AvailabilityMacros.h\"\n#endif\n#if defined( __LP64__ ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )\n#define DARWIN_NO_CARBON 1\n#else\n#define FT_MACINTOSH 1\n#endif\n\n#elif defined( __SC__ ) || defined( __MRC__ )\n  /* Classic MacOS compilers */\n#include \"ConditionalMacros.h\"\n#if TARGET_OS_MAC\n#define FT_MACINTOSH 1\n#endif\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int16                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit signed integer type.                         */\n  /*                                                                       */\n  typedef signed short  FT_Int16;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt16                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit unsigned integer type.                       */\n  /*                                                                       */\n  typedef unsigned short  FT_UInt16;\n\n  /* */\n\n\n  /* this #if 0 ... #endif clause is for documentation purposes */\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int32                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 32bit signed integer type.  The size depends on    */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef signed XXX  FT_Int32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt32                                                          */\n  /*                                                                       */\n  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt32;\n\n  /* */\n\n#endif\n\n#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)\n\n  typedef signed int      FT_Int32;\n  typedef unsigned int    FT_UInt32;\n\n#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)\n\n  typedef signed long     FT_Int32;\n  typedef unsigned long   FT_UInt32;\n\n#else\n#error \"no 32bit type found -- please check your configuration files\"\n#endif\n\n\n  /* look up an integer type that is at least 32 bits */\n#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)\n\n  typedef int            FT_Fast;\n  typedef unsigned int   FT_UFast;\n\n#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)\n\n  typedef long           FT_Fast;\n  typedef unsigned long  FT_UFast;\n\n#endif\n\n\n  /* determine whether we have a 64-bit int type for platforms without */\n  /* Autoconf                                                          */\n#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)\n\n  /* FT_LONG64 must be defined if a 64-bit type is available */\n#define FT_LONG64\n#define FT_INT64  long\n\n#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64  __int64\n\n#elif defined( __BORLANDC__ )  /* Borland C++ */\n\n  /* XXXX: We should probably check the value of __BORLANDC__ in order */\n  /*       to test the compiler version.                               */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64  __int64\n\n#elif defined( __WATCOMC__ )   /* Watcom C++ */\n\n  /* Watcom doesn't provide 64-bit data types */\n\n#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */\n\n#define FT_LONG64\n#define FT_INT64  long long int\n\n#elif defined( __GNUC__ )\n\n  /* GCC provides the `long long' type */\n#define FT_LONG64\n#define FT_INT64  long long int\n\n#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A 64-bit data type will create compilation problems if you compile    */\n  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */\n  /* is defined.  You can however ignore this rule by defining the         */\n  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */\n  /*                                                                       */\n#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )\n\n#ifdef __STDC__\n\n  /* undefine the 64-bit macros in strict ANSI compilation mode */\n#undef FT_LONG64\n#undef FT_INT64\n\n#endif /* __STDC__ */\n\n#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */\n\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT\n\n\n#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER\n  /* Provide assembler fragments for performance-critical functions. */\n  /* These must be defined `static __inline__' with GCC.             */\n\n#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm\n    {\n      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */\n      mov   a,  t,  asr #31         /* a   = (hi >> 31) */\n      add   a,  a,  #0x8000         /* a  += 0x8000 */\n      adds  t2, t2, a               /* t2 += a */\n      adc   t,  t,  #0              /* t  += carry */\n      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */\n      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */\n    }\n    return a;\n  }\n\n#endif /* __CC_ARM || __ARMCC__ */\n\n\n#ifdef __GNUC__\n\n#if defined( __arm__ ) && !defined( __thumb__ )    && \\\n    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm__ __volatile__ (\n      \"smull  %1, %2, %4, %3\\n\\t\"       /* (lo=%1,hi=%2) = a*b */\n      \"mov    %0, %2, asr #31\\n\\t\"      /* %0  = (hi >> 31) */\n      \"add    %0, %0, #0x8000\\n\\t\"      /* %0 += 0x8000 */\n      \"adds   %1, %1, %0\\n\\t\"           /* %1 += %0 */\n      \"adc    %2, %2, #0\\n\\t\"           /* %2 += carry */\n      \"mov    %0, %1, lsr #16\\n\\t\"      /* %0  = %1 >> 16 */\n      \"orr    %0, %0, %2, lsl #16\\n\\t\"  /* %0 |= %2 << 16 */\n      : \"=r\"(a), \"=&r\"(t2), \"=&r\"(t)\n      : \"r\"(a), \"r\"(b) );\n    return a;\n  }\n\n#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */\n\n#if defined( __i386__ )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n\n    __asm__ __volatile__ (\n      \"imul  %%edx\\n\"\n      \"movl  %%edx, %%ecx\\n\"\n      \"sarl  $31, %%ecx\\n\"\n      \"addl  $0x8000, %%ecx\\n\"\n      \"addl  %%ecx, %%eax\\n\"\n      \"adcl  $0, %%edx\\n\"\n      \"shrl  $16, %%eax\\n\"\n      \"shll  $16, %%edx\\n\"\n      \"addl  %%edx, %%eax\\n\"\n      : \"=a\"(result), \"=d\"(b)\n      : \"a\"(a), \"d\"(b)\n      : \"%ecx\", \"cc\" );\n    return result;\n  }\n\n#endif /* i386 */\n\n#endif /* __GNUC__ */\n\n\n#ifdef _MSC_VER /* Visual C++ */\n\n#ifdef _M_IX86\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n    __asm\n    {\n      mov eax, a\n      mov edx, b\n      imul edx\n      mov ecx, edx\n      sar ecx, 31\n      add ecx, 8000h\n      add eax, ecx\n      adc edx, 0\n      shr eax, 16\n      shl edx, 16\n      add eax, edx\n      mov result, eax\n    }\n    return result;\n  }\n\n#endif /* _M_IX86 */\n\n#endif /* _MSC_VER */\n\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n#ifdef FT_CONFIG_OPTION_INLINE_MULFIX\n#ifdef FT_MULFIX_ASSEMBLER\n#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER\n#endif\n#endif\n\n\n#ifdef FT_MAKE_OPTION_SINGLE_OBJECT\n\n#define FT_LOCAL( x )      static  x\n#define FT_LOCAL_DEF( x )  static  x\n\n#else\n\n#ifdef __cplusplus\n#define FT_LOCAL( x )      extern \"C\"  x\n#define FT_LOCAL_DEF( x )  extern \"C\"  x\n#else\n#define FT_LOCAL( x )      extern  x\n#define FT_LOCAL_DEF( x )  x\n#endif\n\n#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */\n\n\n#ifndef FT_BASE\n\n#ifdef __cplusplus\n#define FT_BASE( x )  extern \"C\"  x\n#else\n#define FT_BASE( x )  extern  x\n#endif\n\n#endif /* !FT_BASE */\n\n\n#ifndef FT_BASE_DEF\n\n#ifdef __cplusplus\n#define FT_BASE_DEF( x )  x\n#else\n#define FT_BASE_DEF( x )  x\n#endif\n\n#endif /* !FT_BASE_DEF */\n\n\n#ifndef FT_EXPORT\n\n#ifdef __cplusplus\n#define FT_EXPORT( x )  extern \"C\"  x\n#else\n#define FT_EXPORT( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT */\n\n\n#ifndef FT_EXPORT_DEF\n\n#ifdef __cplusplus\n#define FT_EXPORT_DEF( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_DEF( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_DEF */\n\n\n#ifndef FT_EXPORT_VAR\n\n#ifdef __cplusplus\n#define FT_EXPORT_VAR( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_VAR */\n\n  /* The following macros are needed to compile the library with a   */\n  /* C++ compiler and with 16bit compilers.                          */\n  /*                                                                 */\n\n  /* This is special.  Within C++, you must specify `extern \"C\"' for */\n  /* functions which are used via function pointers, and you also    */\n  /* must do that for structures which contain function pointers to  */\n  /* assure C linkage -- it's not possible to have (local) anonymous */\n  /* functions which are accessed by (global) function pointers.     */\n  /*                                                                 */\n  /*                                                                 */\n  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */\n  /* contains pointers to callback functions.                        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */\n  /* that contains pointers to callback functions.                   */\n  /*                                                                 */\n  /*                                                                 */\n  /* Some 16bit compilers have to redefine these macros to insert    */\n  /* the infamous `_cdecl' or `__fastcall' declarations.             */\n  /*                                                                 */\n#ifndef FT_CALLBACK_DEF\n#ifdef __cplusplus\n#define FT_CALLBACK_DEF( x )  extern \"C\"  x\n#else\n#define FT_CALLBACK_DEF( x )  static  x\n#endif\n#endif /* FT_CALLBACK_DEF */\n\n#ifndef FT_CALLBACK_TABLE\n#ifdef __cplusplus\n#define FT_CALLBACK_TABLE      extern \"C\"\n#define FT_CALLBACK_TABLE_DEF  extern \"C\"\n#else\n#define FT_CALLBACK_TABLE      extern\n#define FT_CALLBACK_TABLE_DEF  /* nothing */\n#endif\n#endif /* FT_CALLBACK_TABLE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCONFIG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/config/ftheader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftheader.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_HEADER_H__\n#define __FT_HEADER_H__\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_BEGIN_HEADER                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_END_HEADER in header    */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_BEGIN_HEADER  extern \"C\" {\n#else\n#define FT_BEGIN_HEADER  /* nothing */\n#endif\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_END_HEADER                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_BEGIN_HEADER in header  */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_END_HEADER  }\n#else\n#define FT_END_HEADER  /* nothing */\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Aliases for the FreeType 2 public and configuration files.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_file_macros                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Header File Macros                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Macro definitions used to #include specific header files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following macros are defined to the name of specific           */\n  /*    FreeType~2 header files.  They can be used directly in #include    */\n  /*    statements as in:                                                  */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_MULTIPLE_MASTERS_H                                   */\n  /*      #include FT_GLYPH_H                                              */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    There are several reasons why we are now using macros to name      */\n  /*    public header files.  The first one is that such macros are not    */\n  /*    limited to the infamous 8.3~naming rule required by DOS (and       */\n  /*    `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').   */\n  /*                                                                       */\n  /*    The second reason is that it allows for more flexibility in the    */\n  /*    way FreeType~2 is installed on a given system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* configuration files */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_CONFIG_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 configuration data.\n   *\n   */\n#ifndef FT_CONFIG_CONFIG_H\n#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_STANDARD_LIBRARY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 interface to the standard C library functions.\n   *\n   */\n#ifndef FT_CONFIG_STANDARD_LIBRARY_H\n#define FT_CONFIG_STANDARD_LIBRARY_H  <freetype/config/ftstdlib.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_OPTIONS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 project-specific configuration options.\n   *\n   */\n#ifndef FT_CONFIG_OPTIONS_H\n#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_MODULES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 modules that are statically linked to new library\n   *   instances in @FT_Init_FreeType.\n   *\n   */\n#ifndef FT_CONFIG_MODULES_H\n#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>\n#endif\n\n  /* */\n\n  /* public headers */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_FREETYPE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   base FreeType~2 API.\n   *\n   */\n#define FT_FREETYPE_H  <freetype/freetype.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 error codes (and messages).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_ERRORS_H  <freetype/fterrors.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 module error offsets (and messages).\n   *\n   */\n#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYSTEM_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 interface to low-level operations (i.e., memory management\n   *   and stream i/o).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_SYSTEM_H  <freetype/ftsystem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing type\n   *   definitions related to glyph images (i.e., bitmaps, outlines,\n   *   scan-converter parameters).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_IMAGE_H  <freetype/ftimage.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   basic data types defined by FreeType~2.\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_TYPES_H  <freetype/fttypes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LIST_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list management API of FreeType~2.\n   *\n   *   (Most applications will never need to include this file.)\n   *\n   */\n#define FT_LIST_H  <freetype/ftlist.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OUTLINE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   scalable outline management API of FreeType~2.\n   *\n   */\n#define FT_OUTLINE_H  <freetype/ftoutln.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SIZES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API which manages multiple @FT_Size objects per face.\n   *\n   */\n#define FT_SIZES_H  <freetype/ftsizes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   module management API of FreeType~2.\n   *\n   */\n#define FT_MODULE_H  <freetype/ftmodapi.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_RENDER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   renderer module management API of FreeType~2.\n   *\n   */\n#define FT_RENDER_H  <freetype/ftrender.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPE1_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the Type~1 format.\n   *\n   */\n#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_IDS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   enumeration values which identify name strings, languages, encodings,\n   *   etc.  This file really contains a _large_ set of constant macro\n   *   definitions, taken from the TrueType and OpenType specifications.\n   *\n   */\n#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the TrueType (as well as OpenType) format.\n   *\n   */\n#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TAGS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of TrueType four-byte `tags' which identify blocks in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BDF_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which accesses BDF-specific strings from a\n   *   face.\n   *\n   */\n#define FT_BDF_H  <freetype/ftbdf.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CID_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which access CID font information from a\n   *   face.\n   *\n   */\n#define FT_CID_H  <freetype/ftcid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GZIP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports gzip-compressed files.\n   *\n   */\n#define FT_GZIP_H  <freetype/ftgzip.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LZW_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports LZW-compressed files.\n   *\n   */\n#define FT_LZW_H  <freetype/ftlzw.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BZIP2_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports bzip2-compressed files.\n   *\n   */\n#define FT_BZIP2_H  <freetype/ftbzip2.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_WINFONTS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports Windows FNT files.\n   *\n   */\n#define FT_WINFONTS_H   <freetype/ftwinfnt.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GLYPH_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional glyph management component.\n   *\n   */\n#define FT_GLYPH_H  <freetype/ftglyph.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BITMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional bitmap conversion component.\n   *\n   */\n#define FT_BITMAP_H  <freetype/ftbitmap.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BBOX_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional exact bounding box computation routines.\n   *\n   */\n#define FT_BBOX_H  <freetype/ftbbox.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional FreeType~2 cache sub-system.\n   *\n   */\n#define FT_CACHE_H  <freetype/ftcache.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `glyph image' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for @FT_Glyph elements.  You can also\n   *   use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to\n   *   store small glyph bitmaps, as it will use less memory.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   glyph image-related cache declarations.\n   *\n   */\n#define FT_CACHE_IMAGE_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_SMALL_BITMAPS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `small bitmaps' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for small glyph bitmaps in a relatively\n   *   memory-efficient way.  You can also use the API defined in\n   *   @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,\n   *   including scalable outlines.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   small bitmaps-related cache declarations.\n   *\n   */\n#define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_CHARMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `charmap' API of the FreeType~2 cache sub-system.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   charmap-based cache declarations.\n   *\n   */\n#define FT_CACHE_CHARMAP_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MAC_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   Macintosh-specific FreeType~2 API.  The latter is used to access\n   *   fonts embedded in resource forks.\n   *\n   *   This header file must be explicitly included by client applications\n   *   compiled on the Mac (note that the base API still works though).\n   *\n   */\n#define FT_MAC_H  <freetype/ftmac.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MULTIPLE_MASTERS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional multiple-masters management API of FreeType~2.\n   *\n   */\n#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SFNT_NAMES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which accesses embedded `name' strings in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OPENTYPE_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates OpenType tables (BASE, GDEF,\n   *   GPOS, GSUB, JSTF).\n   *\n   */\n#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GX_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,\n   *   mort, morx, bsln, just, kern, opbd, trak, prop).\n   *\n   */\n#define FT_GX_VALIDATE_H  <freetype/ftgxval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_PFR_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which accesses PFR-specific data.\n   *\n   */\n#define FT_PFR_H  <freetype/ftpfr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_STROKER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions to stroke outline paths.\n   */\n#define FT_STROKER_H  <freetype/ftstroke.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYNTHESIS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs artificial obliquing and emboldening.\n   */\n#define FT_SYNTHESIS_H  <freetype/ftsynth.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_XFREE86_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions specific to the XFree86 and\n   *   X.Org X11 servers.\n   */\n#define FT_XFREE86_H  <freetype/ftxf86.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRIGONOMETRY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs trigonometric computations (e.g.,\n   *   cosines and arc tangents).\n   */\n#define FT_TRIGONOMETRY_H  <freetype/fttrigon.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LCD_FILTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_LCD_FILTER_H  <freetype/ftlcdfil.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_UNPATENTED_HINTING_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_UNPATENTED_HINTING_H  <freetype/ttunpat.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_INCREMENTAL_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_INCREMENTAL_H  <freetype/ftincrem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GASP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns entries from the TrueType GASP table.\n   */\n#define FT_GASP_H  <freetype/ftgasp.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ADVANCES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns individual and ranged glyph advances.\n   */\n#define FT_ADVANCES_H  <freetype/ftadvanc.h>\n\n\n  /* */\n\n#define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>\n\n\n  /* The internals of the cache sub-system are no longer exposed.  We */\n  /* default to FT_CACHE_H at the moment just in case, but we know of */\n  /* no rogue client that uses them.                                  */\n  /*                                                                  */\n#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>\n\n\n#define FT_INCREMENTAL_H          <freetype/ftincrem.h>\n\n#define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>\n\n\n  /*\n   * Include internal headers definitions from <freetype/internal/...>\n   * only when building the library.\n   */\n#ifdef FT2_BUILD_LIBRARY\n#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>\n#include FT_INTERNAL_INTERNAL_H\n#endif /* FT2_BUILD_LIBRARY */\n\n\n#endif /* __FT2_BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/config/ftmodule.h",
    "content": "/*\n *  This file registers the FreeType modules compiled into the library.\n *\n *  If you use GNU make, this file IS NOT USED!  Instead, it is created in\n *  the objects directory (normally `<topdir>/objs/') based on information\n *  from `<topdir>/modules.cfg'.\n *\n *  Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile\n *  FreeType without GNU make.\n *\n */\n\nFT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\nFT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\n\n/* EOF */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/config/ftoption.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoption.h                                                             */\n/*                                                                         */\n/*    User-selectable configuration macros (specification only).           */\n/*                                                                         */\n/*  Copyright 1996-2011 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOPTION_H__\n#define __FTOPTION_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* This file contains the default configuration macro definitions for    */\n  /* a standard build of the FreeType library.  There are three ways to    */\n  /* use this file to build project-specific versions of the library:      */\n  /*                                                                       */\n  /*  - You can modify this file by hand, but this is not recommended in   */\n  /*    cases where you would like to build several versions of the        */\n  /*    library from a single source directory.                            */\n  /*                                                                       */\n  /*  - You can put a copy of this file in your build directory, more      */\n  /*    precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD'   */\n  /*    is the name of a directory that is included _before_ the FreeType  */\n  /*    include path during compilation.                                   */\n  /*                                                                       */\n  /*    The default FreeType Makefiles and Jamfiles use the build          */\n  /*    directory `builds/<system>' by default, but you can easily change  */\n  /*    that for your own projects.                                        */\n  /*                                                                       */\n  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */\n  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */\n  /*    locate this file during the build.  For example,                   */\n  /*                                                                       */\n  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */\n  /*      #include <freetype/config/ftheader.h>                            */\n  /*                                                                       */\n  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */\n  /*    definitions.                                                       */\n  /*                                                                       */\n  /*    Note also that you can similarly pre-define the macro              */\n  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */\n  /*    that are statically linked to the library at compile time.  By     */\n  /*    default, this file is <freetype/config/ftmodule.h>.                */\n  /*                                                                       */\n  /*  We highly recommend using the third method whenever possible.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the line below if you want to activate sub-pixel rendering  */\n  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */\n  /*                                                                       */\n  /* Note that this feature is covered by several Microsoft patents        */\n  /* and should not be activated in any default build of the library.      */\n  /*                                                                       */\n  /* This macro has no impact on the FreeType API, only on its             */\n  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */\n  /* FT_Render_Glyph still generates a bitmap that is 3 times wider than   */\n  /* the original size in case this macro isn't defined; however, each     */\n  /* triplet of subpixels has R=G=B.                                       */\n  /*                                                                       */\n  /* This is done to allow FreeType clients to run unmodified, forcing     */\n  /* them to display normal gray-level anti-aliased glyphs.                */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */\n  /* by FreeType to speed up some computations.  However, this will create */\n  /* some problems when compiling the library in strict ANSI mode.         */\n  /*                                                                       */\n  /* For this reason, the use of 64-bit integers is normally disabled when */\n  /* the __STDC__ macro is defined.  You can however disable this by       */\n  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */\n  /*                                                                       */\n  /* For most compilers, this will only create compilation warnings when   */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* ObNote: The compiler-specific 64-bit integers are detected in the     */\n  /*         file `ftconfig.h' either statically or through the            */\n  /*         `configure' script on supported platforms.                    */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_FORCE_INT64\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, do not try to use an assembler version of   */\n  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */\n  /* that to verify that the assembler function works properly, or to      */\n  /* execute benchmark tests of the various implementations.               */\n/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, try to use an inlined assembler version of  */\n  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */\n  /* hinting glyphs, and which should be executed as fast as possible.     */\n  /*                                                                       */\n  /* Note that if your compiler or CPU is not supported, this will default */\n  /* to the standard and portable implementation found in `ftcalc.c'.      */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INLINE_MULFIX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LZW-compressed file support.                                          */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `compress' program.  This is mostly used to parse many of the PCF   */\n  /*   files that come with various X11 distributions.  The implementation */\n  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */\n  /*   (see src/lzw/ftgzip.c).                                             */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_LZW\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Gzip-compressed file support.                                         */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `gzip' program.  This is mostly used to parse many of the PCF files */\n  /*   that come with XFree86.  The implementation uses `zlib' to          */\n  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.  See also   */\n  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_ZLIB\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ZLib library selection                                                */\n  /*                                                                       */\n  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */\n  /*   It allows FreeType's `ftgzip' component to link to the system's     */\n  /*   installation of the ZLib library.  This is useful on systems like   */\n  /*   Unix or VMS where it generally is already available.                */\n  /*                                                                       */\n  /*   If you let it undefined, the component will use its own copy        */\n  /*   of the zlib sources instead.  These have been modified to be        */\n  /*   included directly within the component and *not* export external    */\n  /*   function names.  This allows you to link any program with FreeType  */\n  /*   _and_ ZLib without linking conflicts.                               */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bzip2-compressed file support.                                        */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `bzip2' program.  This is mostly used to parse many of the PCF      */\n  /*   files that come with XFree86.  The implementation uses `libbz2' to  */\n  /*   partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */\n  /*   Contrary to gzip, bzip2 currently is not included and need to use   */\n  /*   the system available bzip2 implementation.                          */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_BZIP2 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define to disable the use of file stream functions and types, FILE,   */\n  /* fopen() etc.  Enables the use of smaller system libraries on embedded */\n  /* systems that have multiple system libraries, some with or without     */\n  /* file stream support, in the cases where file stream support is not    */\n  /* necessary such as memory loading of font files.                       */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DLL export compilation                                                */\n  /*                                                                       */\n  /*   When compiling FreeType as a DLL, some systems/compilers need a     */\n  /*   special keyword in front OR after the return type of function       */\n  /*   declarations.                                                       */\n  /*                                                                       */\n  /*   Two macros are used within the FreeType source code to define       */\n  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */\n  /*                                                                       */\n  /*     FT_EXPORT( return_type )                                          */\n  /*                                                                       */\n  /*       is used in a function declaration, as in                        */\n  /*                                                                       */\n  /*         FT_EXPORT( FT_Error )                                         */\n  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */\n  /*                                                                       */\n  /*                                                                       */\n  /*     FT_EXPORT_DEF( return_type )                                      */\n  /*                                                                       */\n  /*       is used in a function definition, as in                         */\n  /*                                                                       */\n  /*         FT_EXPORT_DEF( FT_Error )                                     */\n  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */\n  /*         {                                                             */\n  /*           ... some code ...                                           */\n  /*           return FT_Err_Ok;                                           */\n  /*         }                                                             */\n  /*                                                                       */\n  /*   You can provide your own implementation of FT_EXPORT and            */\n  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */\n  /*   will be later automatically defined as `extern return_type' to      */\n  /*   allow normal compilation.                                           */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_EXPORT(x)      extern x */\n/* #define FT_EXPORT_DEF(x)  x */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Glyph Postscript Names handling                                       */\n  /*                                                                       */\n  /*   By default, FreeType 2 is compiled with the `psnames' module.  This */\n  /*   module is in charge of converting a glyph name string into a        */\n  /*   Unicode value, or return a Macintosh standard glyph name for the    */\n  /*   use with the TrueType `post' table.                                 */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want `psnames' compiled in your   */\n  /*   build of FreeType.  This has the following effects:                 */\n  /*                                                                       */\n  /*   - The TrueType driver will provide its own set of glyph names,      */\n  /*     if you build it to support postscript names in the TrueType       */\n  /*     `post' table.                                                     */\n  /*                                                                       */\n  /*   - The Type 1 driver will not be able to synthesize a Unicode        */\n  /*     charmap out of the glyphs found in the fonts.                     */\n  /*                                                                       */\n  /*   You would normally undefine this configuration macro when building  */\n  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Postscript Names to Unicode Values support                            */\n  /*                                                                       */\n  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */\n  /*   in.  Among other things, the module is used to convert a glyph name */\n  /*   into a Unicode value.  This is especially useful in order to        */\n  /*   synthesize on the fly a Unicode charmap from the CFF/Type 1 driver  */\n  /*   through a big table named the `Adobe Glyph List' (AGL).             */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want the Adobe Glyph List         */\n  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */\n  /*   able to synthesize a Unicode charmap out of the glyphs found in the */\n  /*   fonts.                                                              */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for Mac fonts                                                 */\n  /*                                                                       */\n  /*   Define this macro if you want support for outline fonts in Mac      */\n  /*   format (mac dfont, mac resource, macbinary containing a mac         */\n  /*   resource) on non-Mac platforms.                                     */\n  /*                                                                       */\n  /*   Note that the `FOND' resource isn't checked.                        */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_MAC_FONTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Guessing methods to access embedded resource forks                    */\n  /*                                                                       */\n  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */\n  /*   GNU/Linux).                                                         */\n  /*                                                                       */\n  /*   Resource forks which include fonts data are stored sometimes in     */\n  /*   locations which users or developers don't expected.  In some cases, */\n  /*   resource forks start with some offset from the head of a file.  In  */\n  /*   other cases, the actual resource fork is stored in file different   */\n  /*   from what the user specifies.  If this option is activated,         */\n  /*   FreeType tries to guess whether such offsets or different file      */\n  /*   names must be used.                                                 */\n  /*                                                                       */\n  /*   Note that normal, direct access of resource forks is controlled via */\n  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */\n  /*                                                                       */\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Allow the use of FT_Incremental_Interface to load typefaces that      */\n  /* contain no glyph data, but supply it via a callback function.         */\n  /* This is required by clients supporting document formats which         */\n  /* supply font data incrementally as the document is parsed, such        */\n  /* as the Ghostscript interpreter for the PostScript language.           */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INCREMENTAL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The size in bytes of the render pool used by the scan-line converter  */\n  /* to do all of its work.                                                */\n  /*                                                                       */\n  /* This must be greater than 4KByte if you use FreeType to rasterize     */\n  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */\n  /* allocation of the render pool.                                        */\n  /*                                                                       */\n#define FT_RENDER_POOL_SIZE  16384L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MAX_MODULES                                                        */\n  /*                                                                       */\n  /*   The maximum number of modules that can be registered in a single    */\n  /*   FreeType library object.  32 is the default.                        */\n  /*                                                                       */\n#define FT_MAX_MODULES  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Debug level                                                           */\n  /*                                                                       */\n  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */\n  /*   errors are reported through the `ftdebug' component.  In trace      */\n  /*   mode, additional messages are sent to the standard output during    */\n  /*   execution.                                                          */\n  /*                                                                       */\n  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */\n  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */\n  /*                                                                       */\n  /*   Don't define any of these macros to compile in `release' mode!      */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_LEVEL_ERROR */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Autofitter debugging                                                  */\n  /*                                                                       */\n  /*   If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to     */\n  /*   control the autofitter behaviour for debugging purposes with global */\n  /*   boolean variables (consequently, you should *never* enable this     */\n  /*   while compiling in `release' mode):                                 */\n  /*                                                                       */\n  /*     _af_debug_disable_horz_hints                                      */\n  /*     _af_debug_disable_vert_hints                                      */\n  /*     _af_debug_disable_blue_hints                                      */\n  /*                                                                       */\n  /*   Additionally, the following functions provide dumps of various      */\n  /*   internal autofit structures to stdout (using `printf'):             */\n  /*                                                                       */\n  /*     af_glyph_hints_dump_points                                        */\n  /*     af_glyph_hints_dump_segments                                      */\n  /*     af_glyph_hints_dump_edges                                         */\n  /*                                                                       */\n  /*   As an argument, they use another global variable:                   */\n  /*                                                                       */\n  /*     _af_debug_hints                                                   */\n  /*                                                                       */\n  /*   Please have a look at the `ftgrid' demo program to see how those    */\n  /*   variables and macros should be used.                                */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_AUTOFIT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Memory Debugging                                                      */\n  /*                                                                       */\n  /*   FreeType now comes with an integrated memory debugger that is       */\n  /*   capable of detecting simple errors like memory leaks or double      */\n  /*   deletes.  To compile it within your build of the library, you       */\n  /*   should define FT_DEBUG_MEMORY here.                                 */\n  /*                                                                       */\n  /*   Note that the memory debugger is only activated at runtime when     */\n  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_DEBUG_MEMORY */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Module errors                                                         */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), the higher byte  */\n  /*   of an error code gives the module in which the error has occurred,  */\n  /*   while the lower byte is the real error code.                        */\n  /*                                                                       */\n  /*   Setting this macro makes sense for debugging purposes only, since   */\n  /*   it would break source compatibility of certain programs that use    */\n  /*   FreeType 2.                                                         */\n  /*                                                                       */\n  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Position Independent Code                                             */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), FreeType2 will   */\n  /*   avoid creating constants that require address fixups.  Instead the  */\n  /*   constants will be moved into a struct and additional intialization  */\n  /*   code will be used.                                                  */\n  /*                                                                       */\n  /*   Setting this macro is needed for systems that prohibit address      */\n  /*   fixups, such as BREW.                                               */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */\n  /* embedded bitmaps in all formats using the SFNT module (namely         */\n  /* TrueType & OpenType).                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */\n  /* load and enumerate the glyph Postscript names in a TrueType or        */\n  /* OpenType file.                                                        */\n  /*                                                                       */\n  /* Note that when you do not compile the `PSNames' module by undefining  */\n  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */\n  /* contain additional code used to read the PS Names table from a font.  */\n  /*                                                                       */\n  /* (By default, the module uses `PSNames' to extract glyph names.)       */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */\n  /* access the internal name table in a SFNT-based format like TrueType   */\n  /* or OpenType.  The name table contains various strings used to         */\n  /* describe the font, like family name, copyright, version, etc.  It     */\n  /* does not contain any glyph name though.                               */\n  /*                                                                       */\n  /* Accessing SFNT names is done through the functions declared in        */\n  /* `freetype/ftsnames.h'.                                                */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType CMap support                                                 */\n  /*                                                                       */\n  /*   Here you can fine-tune which TrueType CMap table format shall be    */\n  /*   supported.                                                          */\n#define TT_CONFIG_CMAP_FORMAT_0\n#define TT_CONFIG_CMAP_FORMAT_2\n#define TT_CONFIG_CMAP_FORMAT_4\n#define TT_CONFIG_CMAP_FORMAT_6\n#define TT_CONFIG_CMAP_FORMAT_8\n#define TT_CONFIG_CMAP_FORMAT_10\n#define TT_CONFIG_CMAP_FORMAT_12\n#define TT_CONFIG_CMAP_FORMAT_13\n#define TT_CONFIG_CMAP_FORMAT_14\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */\n  /* a bytecode interpreter in the TrueType driver.                        */\n  /*                                                                       */\n  /* By undefining this, you will only compile the code necessary to load  */\n  /* TrueType glyphs without hinting.                                      */\n  /*                                                                       */\n  /*   Do not #undef this macro here, since the build system might         */\n  /*   define it for certain configurations only.                          */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */\n  /* of the TrueType bytecode interpreter is used that doesn't implement   */\n  /* any of the patented opcodes and algorithms.  The patents related to   */\n  /* TrueType hinting have expired worldwide since May 2010; this option   */\n  /* is now deprecated.                                                    */\n  /*                                                                       */\n  /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored*  */\n  /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words,  */\n  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */\n  /*                                                                       */\n  /* This macro is only useful for a small number of font files (mostly    */\n  /* for Asian scripts) that require bytecode interpretation to properly   */\n  /* load glyphs.  For all other fonts, this produces unpleasant results,  */\n  /* thus the unpatented interpreter is never used to load glyphs from     */\n  /* TrueType fonts unless one of the following two options is used.       */\n  /*                                                                       */\n  /*   - The unpatented interpreter is explicitly activated by the user    */\n  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */\n  /*     when opening the FT_Face.                                         */\n  /*                                                                       */\n  /*   - FreeType detects that the FT_Face corresponds to one of the       */\n  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */\n  /*     contains a hard-coded list of font names and other matching       */\n  /*     parameters (see function `tt_face_init' in file                   */\n  /*     `src/truetype/ttobjs.c').                                         */\n  /*                                                                       */\n  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     FT_Parameter  parameter;                                          */\n  /*     FT_Open_Args  open_args;                                          */\n  /*                                                                       */\n  /*                                                                       */\n  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */\n  /*                                                                       */\n  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */\n  /*     open_args.pathname   = my_font_pathname;                          */\n  /*     open_args.num_params = 1;                                         */\n  /*     open_args.params     = &parameter;                                */\n  /*                                                                       */\n  /*     error = FT_Open_Face( library, &open_args, index, &face );        */\n  /*     ...                                                               */\n  /*   }                                                                   */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */\n  /* bytecode interpreter with a huge switch statement, rather than a call */\n  /* table.  This results in smaller and faster code for a number of       */\n  /* architectures.                                                        */\n  /*                                                                       */\n  /* Note however that on some compiler/processor combinations, undefining */\n  /* this macro will generate faster, though larger, code.                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */\n  /* TrueType glyph loader to use Apple's definition of how to handle      */\n  /* component offsets in composite glyphs.                                */\n  /*                                                                       */\n  /* Apple and MS disagree on the default behavior of component offsets    */\n  /* in composites.  Apple says that they should be scaled by the scaling  */\n  /* factors in the transformation matrix (roughly, it's more complex)     */\n  /* while MS says they should not.  OpenType defines two bits in the      */\n  /* composite flags array which can be used to disambiguate, but old      */\n  /* fonts will not have them.                                             */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/otspec/glyf.htm                 */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */\n  /*                                                                       */\n#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */\n  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */\n  /* and avar tables).  This has many similarities to Type 1 Multiple      */\n  /* Masters support.                                                      */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */\n  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BDF\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and       */\n  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */\n  /* required.                                                             */\n  /*                                                                       */\n#define T1_MAX_DICT_DEPTH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  256\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */\n  /* files into an existing face.  Note that if set, the T1 driver will be */\n  /* unable to produce kerning distances.                                  */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_AFM\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of the Multiple Masters font support in the Type 1        */\n  /* driver.                                                               */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with CJK (Chinese, Japanese, Korean) script    */\n  /* support.                                                              */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_CJK\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with Indic script support.                     */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_INDIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with warp hinting.  The idea of the warping    */\n  /* code is to slightly scale and shift a glyph within a single dimension */\n  /* so that as much of its segments are aligned (more or less) on the     */\n  /* grid.  To find out the optimal scaling and shifting value, various    */\n  /* parameter combinations are tried and scored.                          */\n  /*                                                                       */\n  /* This experimental option is only active if the render mode is         */\n  /* FT_RENDER_MODE_LIGHT.                                                 */\n  /*                                                                       */\n/* #define AF_CONFIG_OPTION_USE_WARPER */\n\n  /* */\n\n\n  /*\n   * Define this variable if you want to keep the layout of internal\n   * structures that was used prior to FreeType 2.2.  This also compiles in\n   * a few obsolete functions to avoid linking problems on typical Unix\n   * distributions.\n   *\n   * For embedded systems or building a new distribution from scratch, it\n   * is recommended to disable the macro since it reduces the library's code\n   * size and activates a few memory-saving optimizations as well.\n   */\n#define FT_CONFIG_OPTION_OLD_INTERNALS\n\n\n  /*\n   *  To detect legacy cache-lookup call from a rogue client (<= 2.1.7),\n   *  we restrict the number of charmaps in a font.  The current API of\n   *  FTC_CMapCache_Lookup() takes cmap_index & charcode, but old API\n   *  takes charcode only.  To determine the passed value is for cmap_index\n   *  or charcode, the possible cmap_index is restricted not to exceed\n   *  the minimum possible charcode by a rogue client.  It is also very\n   *  unlikely that a rogue client is interested in Unicode values 0 to 15.\n   *\n   *  NOTE: The original threshold was 4 deduced from popular number of\n   *        cmap subtables in UCS-4 TrueType fonts, but now it is not\n   *        irregular for OpenType fonts to have more than 4 subtables,\n   *        because variation selector subtables are available for Apple\n   *        and Microsoft platforms.\n   */\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n#define FT_MAX_CHARMAP_CACHEABLE 15\n#endif\n\n\n  /*\n   * This macro is defined if either unpatented or native TrueType\n   * hinting is requested by the definitions above.\n   */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n#define  TT_USE_BYTECODE_INTERPRETER\n#undef   TT_CONFIG_OPTION_UNPATENTED_HINTING\n#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define  TT_USE_BYTECODE_INTERPRETER\n#endif\n\nFT_END_HEADER\n\n\n#endif /* __FTOPTION_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/config/ftstdlib.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstdlib.h                                                             */\n/*                                                                         */\n/*    ANSI-specific library and header configuration file (specification   */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by                  */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to group all #includes to the ANSI C library that   */\n  /* FreeType normally requires.  It also defines macros to rename the     */\n  /* standard functions within the FreeType source code.                   */\n  /*                                                                       */\n  /* Load a file which defines __FTSTDLIB_H__ before this one to override  */\n  /* it.                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSTDLIB_H__\n#define __FTSTDLIB_H__\n\n\n#include <stddef.h>\n\n#define ft_ptrdiff_t  ptrdiff_t\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           integer limits                           */\n  /*                                                                    */\n  /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */\n  /* of `int' and `long' in bytes at compile-time.  So far, this works  */\n  /* for all platforms the library has been tested on.                  */\n  /*                                                                    */\n  /* Note that on the extremely rare platforms that do not provide      */\n  /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */\n  /* old Crays where `int' is 36 bits), we do not make any guarantee    */\n  /* about the correct behaviour of FT2 with all fonts.                 */\n  /*                                                                    */\n  /* In these case, `ftconfig.h' will refuse to compile anyway with a   */\n  /* message like `couldn't find 32-bit type' or something similar.     */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <limits.h>\n\n#define FT_CHAR_BIT   CHAR_BIT\n#define FT_INT_MAX    INT_MAX\n#define FT_INT_MIN    INT_MIN\n#define FT_UINT_MAX   UINT_MAX\n#define FT_ULONG_MAX  ULONG_MAX\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                 character and string processing                    */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <string.h>\n\n#define ft_memchr   memchr\n#define ft_memcmp   memcmp\n#define ft_memcpy   memcpy\n#define ft_memmove  memmove\n#define ft_memset   memset\n#define ft_strcat   strcat\n#define ft_strcmp   strcmp\n#define ft_strcpy   strcpy\n#define ft_strlen   strlen\n#define ft_strncmp  strncmp\n#define ft_strncpy  strncpy\n#define ft_strrchr  strrchr\n#define ft_strstr   strstr\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           file handling                            */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdio.h>\n\n#define FT_FILE     FILE\n#define ft_fclose   fclose\n#define ft_fopen    fopen\n#define ft_fread    fread\n#define ft_fseek    fseek\n#define ft_ftell    ftell\n#define ft_sprintf  sprintf\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                             sorting                                */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdlib.h>\n\n#define ft_qsort  qsort\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                        memory allocation                           */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_scalloc   calloc\n#define ft_sfree     free\n#define ft_smalloc   malloc\n#define ft_srealloc  realloc\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                          miscellaneous                             */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_atol   atol\n#define ft_labs   labs\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                         execution control                          */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <setjmp.h>\n\n#define ft_jmp_buf     jmp_buf  /* note: this cannot be a typedef since */\n                                /*       jmp_buf is defined as a macro  */\n                                /*       on certain platforms           */\n\n#define ft_longjmp     longjmp\n#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) )    /* same thing here */\n\n\n  /* the following is only used for debugging purposes, i.e., if */\n  /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined    */\n\n#include <stdarg.h>\n\n\n#endif /* __FTSTDLIB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/freetype.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  freetype.h                                                             */\n/*                                                                         */\n/*    FreeType high-level API and common types (specification only).       */\n/*                                                                         */\n/*  Copyright 1996-2011 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef FT_FREETYPE_H\n#error \"`ft2build.h' hasn't been included yet!\"\n#error \"Please always use macros to include FreeType header files.\"\n#error \"Example:\"\n#error \"  #include <ft2build.h>\"\n#error \"  #include FT_FREETYPE_H\"\n#endif\n\n\n#ifndef __FREETYPE_H__\n#define __FREETYPE_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_ERRORS_H\n#include FT_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    user_allocation                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    User allocation                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should allocate FreeType data structures.  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType assumes that structures allocated by the user and passed  */\n  /*    as arguments are zeroed out except for the actual data.  In other  */\n  /*    words, it is recommended to use `calloc' (or variants of it)       */\n  /*    instead of `malloc' for allocation.                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        B A S I C   T Y P E S                          */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Base Interface                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 base font interface.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section describes the public high-level API of FreeType~2.    */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library                                                         */\n  /*    FT_Face                                                            */\n  /*    FT_Size                                                            */\n  /*    FT_GlyphSlot                                                       */\n  /*    FT_CharMap                                                         */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SCALABLE                                              */\n  /*    FT_FACE_FLAG_FIXED_SIZES                                           */\n  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */\n  /*    FT_FACE_FLAG_HORIZONTAL                                            */\n  /*    FT_FACE_FLAG_VERTICAL                                              */\n  /*    FT_FACE_FLAG_SFNT                                                  */\n  /*    FT_FACE_FLAG_KERNING                                               */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */\n  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */\n  /*    FT_FACE_FLAG_HINTER                                                */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD                                                 */\n  /*    FT_STYLE_FLAG_ITALIC                                               */\n  /*                                                                       */\n  /*    FT_SizeRec                                                         */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /*    FT_GlyphSlotRec                                                    */\n  /*    FT_Glyph_Metrics                                                   */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /*    FT_Init_FreeType                                                   */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /*    FT_New_Face                                                        */\n  /*    FT_Done_Face                                                       */\n  /*    FT_New_Memory_Face                                                 */\n  /*    FT_Open_Face                                                       */\n  /*    FT_Open_Args                                                       */\n  /*    FT_Parameter                                                       */\n  /*    FT_Attach_File                                                     */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /*    FT_Set_Char_Size                                                   */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*    FT_Request_Size                                                    */\n  /*    FT_Select_Size                                                     */\n  /*    FT_Size_Request_Type                                               */\n  /*    FT_Size_Request                                                    */\n  /*    FT_Set_Transform                                                   */\n  /*    FT_Load_Glyph                                                      */\n  /*    FT_Get_Char_Index                                                  */\n  /*    FT_Get_Name_Index                                                  */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /*    FT_OPEN_MEMORY                                                     */\n  /*    FT_OPEN_STREAM                                                     */\n  /*    FT_OPEN_PATHNAME                                                   */\n  /*    FT_OPEN_DRIVER                                                     */\n  /*    FT_OPEN_PARAMS                                                     */\n  /*                                                                       */\n  /*    FT_LOAD_DEFAULT                                                    */\n  /*    FT_LOAD_RENDER                                                     */\n  /*    FT_LOAD_MONOCHROME                                                 */\n  /*    FT_LOAD_LINEAR_DESIGN                                              */\n  /*    FT_LOAD_NO_SCALE                                                   */\n  /*    FT_LOAD_NO_HINTING                                                 */\n  /*    FT_LOAD_NO_BITMAP                                                  */\n  /*    FT_LOAD_CROP_BITMAP                                                */\n  /*                                                                       */\n  /*    FT_LOAD_VERTICAL_LAYOUT                                            */\n  /*    FT_LOAD_IGNORE_TRANSFORM                                           */\n  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */\n  /*    FT_LOAD_FORCE_AUTOHINT                                             */\n  /*    FT_LOAD_NO_RECURSE                                                 */\n  /*    FT_LOAD_PEDANTIC                                                   */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_NORMAL                                              */\n  /*    FT_LOAD_TARGET_LIGHT                                               */\n  /*    FT_LOAD_TARGET_MONO                                                */\n  /*    FT_LOAD_TARGET_LCD                                                 */\n  /*    FT_LOAD_TARGET_LCD_V                                               */\n  /*                                                                       */\n  /*    FT_Render_Glyph                                                    */\n  /*    FT_Render_Mode                                                     */\n  /*    FT_Get_Kerning                                                     */\n  /*    FT_Kerning_Mode                                                    */\n  /*    FT_Get_Track_Kerning                                               */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /*    FT_CharMapRec                                                      */\n  /*    FT_Select_Charmap                                                  */\n  /*    FT_Set_Charmap                                                     */\n  /*    FT_Get_Charmap_Index                                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING                                    */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING                             */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING                              */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING                                            */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY                                    */\n  /*                                                                       */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Glyph_Metrics                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the metrics of a single glyph.  The      */\n  /*    values are expressed in 26.6 fractional pixel format; if the flag  */\n  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */\n  /*    are expressed in font units instead.                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width ::                                                           */\n  /*      The glyph's width.                                               */\n  /*                                                                       */\n  /*    height ::                                                          */\n  /*      The glyph's height.                                              */\n  /*                                                                       */\n  /*    horiBearingX ::                                                    */\n  /*      Left side bearing for horizontal layout.                         */\n  /*                                                                       */\n  /*    horiBearingY ::                                                    */\n  /*      Top side bearing for horizontal layout.                          */\n  /*                                                                       */\n  /*    horiAdvance ::                                                     */\n  /*      Advance width for horizontal layout.                             */\n  /*                                                                       */\n  /*    vertBearingX ::                                                    */\n  /*      Left side bearing for vertical layout.                           */\n  /*                                                                       */\n  /*    vertBearingY ::                                                    */\n  /*      Top side bearing for vertical layout.  Larger positive values    */\n  /*      mean further below the vertical glyph origin.                    */\n  /*                                                                       */\n  /*    vertAdvance ::                                                     */\n  /*      Advance height for vertical layout.  Positive values mean the    */\n  /*      glyph has a positive advance downward.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */\n  /*    dimensions of the hinted glyph (in case hinting is applicable).    */\n  /*                                                                       */\n  typedef struct  FT_Glyph_Metrics_\n  {\n    FT_Pos  width;\n    FT_Pos  height;\n\n    FT_Pos  horiBearingX;\n    FT_Pos  horiBearingY;\n    FT_Pos  horiAdvance;\n\n    FT_Pos  vertBearingX;\n    FT_Pos  vertBearingY;\n    FT_Pos  vertAdvance;\n\n  } FT_Glyph_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure models the metrics of a bitmap strike (i.e., a set  */\n  /*    of glyphs for a given point size and resolution) in a bitmap font. */\n  /*    It is used for the `available_sizes' field of @FT_Face.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height :: The vertical distance, in pixels, between two            */\n  /*              consecutive baselines.  It is always positive.           */\n  /*                                                                       */\n  /*    width  :: The average width, in pixels, of all glyphs in the       */\n  /*              strike.                                                  */\n  /*                                                                       */\n  /*    size   :: The nominal size of the strike in 26.6 fractional        */\n  /*              points.  This field is not very useful.                  */\n  /*                                                                       */\n  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Windows FNT:                                                       */\n  /*      The nominal size given in a FNT font is not reliable.  Thus when */\n  /*      the driver finds it incorrect, it sets `size' to some calculated */\n  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */\n  /*      height given in the font, respectively.                          */\n  /*                                                                       */\n  /*    TrueType embedded bitmaps:                                         */\n  /*      `size', `width', and `height' values are not contained in the    */\n  /*      bitmap strike itself.  They are computed from the global font    */\n  /*      parameters.                                                      */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_Size_\n  {\n    FT_Short  height;\n    FT_Short  width;\n\n    FT_Pos    size;\n\n    FT_Pos    x_ppem;\n    FT_Pos    y_ppem;\n\n  } FT_Bitmap_Size;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     O B J E C T   C L A S S E S                       */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Library                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a FreeType library instance.  Each `library' is        */\n  /*    completely independent from the others; it is the `root' of a set  */\n  /*    of objects like fonts, faces, sizes, etc.                          */\n  /*                                                                       */\n  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */\n  /*    scan-line converter object (see @FT_Raster).                       */\n  /*                                                                       */\n  /*    For multi-threading applications each thread should have its own   */\n  /*    FT_Library object.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Library objects are normally created by @FT_Init_FreeType, and     */\n  /*    destroyed with @FT_Done_FreeType.                                  */\n  /*                                                                       */\n  typedef struct FT_LibraryRec_  *FT_Library;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Module                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType module object.  Each module can be a  */\n  /*    font driver, a renderer, or anything else that provides services   */\n  /*    to the formers.                                                    */\n  /*                                                                       */\n  typedef struct FT_ModuleRec_*  FT_Module;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType font driver object.  Each font driver */\n  /*    is a special module capable of creating faces from font files.     */\n  /*                                                                       */\n  typedef struct FT_DriverRec_*  FT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Renderer                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType renderer.  A renderer is a special    */\n  /*    module in charge of converting a glyph image to a bitmap, when     */\n  /*    necessary.  Each renderer supports a given glyph image format, and */\n  /*    one or more target surface depths.                                 */\n  /*                                                                       */\n  typedef struct FT_RendererRec_*  FT_Renderer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given typographic face object.  A face object models */\n  /*    a given typeface, in a given style.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */\n  /*    as one or more @FT_Size objects.                                   */\n  /*                                                                       */\n  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */\n  /*    a given filepathname or a custom input stream.                     */\n  /*                                                                       */\n  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_FaceRec for the publicly accessible fields of a given face */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_FaceRec_*  FT_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a face scaled to a given       */\n  /*    character size.                                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */\n  /*    functions like @FT_Load_Glyph to determine the scaling             */\n  /*    transformation which is used to load and hint glyphs and metrics.  */\n  /*                                                                       */\n  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */\n  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */\n  /*    (i.e., the scaling values) of the active @FT_Size.                 */\n  /*                                                                       */\n  /*    You can use @FT_New_Size to create additional size objects for a   */\n  /*    given @FT_Face, but they won't be used by other functions until    */\n  /*    you activate it through @FT_Activate_Size.  Only one size can be   */\n  /*    activated at any given time per face.                              */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_SizeRec for the publicly accessible fields of a given size */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_SizeRec_*  FT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given `glyph slot'.  A slot is a container where it  */\n  /*    is possible to load any of the glyphs contained in its parent      */\n  /*    face.                                                              */\n  /*                                                                       */\n  /*    In other words, each time you call @FT_Load_Glyph or               */\n  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */\n  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */\n  /*    other control information.                                         */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_GlyphSlotRec for the publicly accessible glyph fields.     */\n  /*                                                                       */\n  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given character map.  A charmap is used to translate */\n  /*    character codes in a given encoding into glyph indexes for its     */\n  /*    parent's face.  Some font formats may provide several charmaps per */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    Each face object owns zero or more charmaps, but only one of them  */\n  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */\n  /*                                                                       */\n  /*    The list of available charmaps in a face is available through the  */\n  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    The currently active charmap is available as `face->charmap'.      */\n  /*    You should call @FT_Set_Charmap to change it.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When a new face is created (either through @FT_New_Face or         */\n  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */\n  /*    the list and automatically activates it.                           */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_CharMapRec for the publicly accessible fields of a given   */\n  /*    character map.                                                     */\n  /*                                                                       */\n  typedef struct FT_CharMapRec_*  FT_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags into an unsigned long.  It is */\n  /*    used to define `encoding' identifiers (see @FT_Encoding).          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n\n#ifndef FT_ENC_TAG\n#define FT_ENC_TAG( value, a, b, c, d )         \\\n          value = ( ( (FT_UInt32)(a) << 24 ) |  \\\n                    ( (FT_UInt32)(b) << 16 ) |  \\\n                    ( (FT_UInt32)(c) <<  8 ) |  \\\n                      (FT_UInt32)(d)         )\n\n#endif /* FT_ENC_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify character sets supported by         */\n  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Despite the name, this enumeration lists specific character        */\n  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */\n  /*    UTF-8, UTF-16, etc.).                                              */\n  /*                                                                       */\n  /*    Other encodings might be defined in the future.                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_ENCODING_NONE ::                                                */\n  /*      The encoding value~0 is reserved.                                */\n  /*                                                                       */\n  /*    FT_ENCODING_UNICODE ::                                             */\n  /*      Corresponds to the Unicode character set.  This value covers     */\n  /*      all versions of the Unicode repertoire, including ASCII and      */\n  /*      Latin-1.  Most fonts include a Unicode charmap, but not all      */\n  /*      of them.                                                         */\n  /*                                                                       */\n  /*      For example, if you want to access Unicode value U+1F028 (and    */\n  /*      the font contains it), use value 0x1F028 as the input value for  */\n  /*      @FT_Get_Char_Index.                                              */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SYMBOL ::                                           */\n  /*      Corresponds to the Microsoft Symbol encoding, used to encode     */\n  /*      mathematical symbols in the 32..255 character code range.  For   */\n  /*      more information, see `http://www.ceviz.net/symbol.htm'.         */\n  /*                                                                       */\n  /*    FT_ENCODING_SJIS ::                                                */\n  /*      Corresponds to Japanese SJIS encoding.  More info at             */\n  /*      at `http://langsupport.japanreference.com/encoding.shtml'.       */\n  /*      See note on multi-byte encodings below.                          */\n  /*                                                                       */\n  /*    FT_ENCODING_GB2312 ::                                              */\n  /*      Corresponds to an encoding system for Simplified Chinese as used */\n  /*      used in mainland China.                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_BIG5 ::                                                */\n  /*      Corresponds to an encoding system for Traditional Chinese as     */\n  /*      used in Taiwan and Hong Kong.                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_WANSUNG ::                                             */\n  /*      Corresponds to the Korean encoding system known as Wansung.      */\n  /*      For more information see                                         */\n  /*      `http://www.microsoft.com/typography/unicode/949.txt'.           */\n  /*                                                                       */\n  /*    FT_ENCODING_JOHAB ::                                               */\n  /*      The Korean standard character set (KS~C 5601-1992), which        */\n  /*      corresponds to MS Windows code page 1361.  This character set    */\n  /*      includes all possible Hangeul character combinations.            */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_LATIN_1 ::                                       */\n  /*      Corresponds to a Latin-1 encoding as defined in a Type~1         */\n  /*      PostScript font.  It is limited to 256 character codes.          */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_STANDARD ::                                      */\n  /*      Corresponds to the Adobe Standard encoding, as found in Type~1,  */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_EXPERT ::                                        */\n  /*      Corresponds to the Adobe Expert encoding, as found in Type~1,    */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_CUSTOM ::                                        */\n  /*      Corresponds to a custom encoding, as found in Type~1, CFF, and   */\n  /*      OpenType/CFF fonts.  It is limited to 256 character codes.       */\n  /*                                                                       */\n  /*    FT_ENCODING_APPLE_ROMAN ::                                         */\n  /*      Corresponds to the 8-bit Apple roman encoding.  Many TrueType    */\n  /*      and OpenType fonts contain a charmap for this encoding, since    */\n  /*      older versions of Mac OS are able to use it.                     */\n  /*                                                                       */\n  /*    FT_ENCODING_OLD_LATIN_2 ::                                         */\n  /*      This value is deprecated and was never used nor reported by      */\n  /*      FreeType.  Don't use or test for it.                             */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SJIS ::                                             */\n  /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_GB2312 ::                                           */\n  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_BIG5 ::                                             */\n  /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_WANSUNG ::                                          */\n  /*      Same as FT_ENCODING_WANSUNG.  Deprecated.                        */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_JOHAB ::                                            */\n  /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    By default, FreeType automatically synthesizes a Unicode charmap   */\n  /*    for PostScript fonts, using their glyph names dictionaries.        */\n  /*    However, it also reports the encodings defined explicitly in the   */\n  /*    font file, for the cases when they are needed, with the Adobe      */\n  /*    values as well.                                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */\n  /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */\n  /*    FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out      */\n  /*    which encoding is really present.  If, for example, the            */\n  /*    `cs_registry' field is `KOI8' and the `cs_encoding' field is `R',  */\n  /*    the font is encoded in KOI8-R.                                     */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is always set (with a single exception) by the    */\n  /*    winfonts driver.  Use @FT_Get_WinFNT_Header and examine the        */\n  /*    `charset' field of the @FT_WinFNT_HeaderRec structure to find out  */\n  /*    which encoding is really present.  For example,                    */\n  /*    @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for       */\n  /*    Russian).                                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */\n  /*    and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to  */\n  /*    FT_ENCODING_APPLE_ROMAN).                                          */\n  /*                                                                       */\n  /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */\n  /*    @FT_Get_CMap_Language_ID  to query the Mac language ID which may   */\n  /*    be needed to be able to distinguish Apple encoding variants.  See  */\n  /*                                                                       */\n  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT  */\n  /*                                                                       */\n  /*    to get an idea how to do that.  Basically, if the language ID      */\n  /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */\n  /*    Then examine `encoding_id'.  If, for example, `encoding_id' is     */\n  /*    @TT_MAC_ID_ROMAN and the language ID (minus~1) is                  */\n  /*    `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.        */\n  /*    @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi       */\n  /*    variant the Arabic encoding.                                       */\n  /*                                                                       */\n  typedef enum  FT_Encoding_\n  {\n    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),\n\n    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),\n    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),\n\n    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),\n    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),\n    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),\n    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),\n    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),\n\n    /* for backwards compatibility */\n    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,\n    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,\n    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,\n    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,\n    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,\n\n    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),\n\n    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),\n\n    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )\n\n  } FT_Encoding;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_encoding_xxx                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated; use the corresponding @FT_Encoding */\n  /*    values instead.                                                    */\n  /*                                                                       */\n#define ft_encoding_none            FT_ENCODING_NONE\n#define ft_encoding_unicode         FT_ENCODING_UNICODE\n#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL\n#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1\n#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2\n#define ft_encoding_sjis            FT_ENCODING_SJIS\n#define ft_encoding_gb2312          FT_ENCODING_GB2312\n#define ft_encoding_big5            FT_ENCODING_BIG5\n#define ft_encoding_wansung         FT_ENCODING_WANSUNG\n#define ft_encoding_johab           FT_ENCODING_JOHAB\n\n#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD\n#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT\n#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM\n#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_CharMapRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The base charmap structure.                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face        :: A handle to the parent face object.                 */\n  /*                                                                       */\n  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */\n  /*                   this with @FT_Select_Charmap.                       */\n  /*                                                                       */\n  /*    platform_id :: An ID number describing the platform for the        */\n  /*                   following encoding ID.  This comes directly from    */\n  /*                   the TrueType specification and should be emulated   */\n  /*                   for other formats.                                  */\n  /*                                                                       */\n  /*    encoding_id :: A platform specific encoding number.  This also     */\n  /*                   comes from the TrueType specification and should be */\n  /*                   emulated similarly.                                 */\n  /*                                                                       */\n  typedef struct  FT_CharMapRec_\n  {\n    FT_Face      face;\n    FT_Encoding  encoding;\n    FT_UShort    platform_id;\n    FT_UShort    encoding_id;\n\n  } FT_CharMapRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 B A S E   O B J E C T   C L A S S E S                 */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Face object.                     */\n  /*                                                                       */\n  /*    This structure might change between releases of FreeType~2 and is  */\n  /*    not generally available to client applications.                    */\n  /*                                                                       */\n  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root face class structure.  A face object models a        */\n  /*    typeface in a font file.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_faces           :: The number of faces in the font file.  Some */\n  /*                           font formats can have multiple faces in     */\n  /*                           a font file.                                */\n  /*                                                                       */\n  /*    face_index          :: The index of the face in the font file.  It */\n  /*                           is set to~0 if there is only one face in    */\n  /*                           the font file.                              */\n  /*                                                                       */\n  /*    face_flags          :: A set of bit flags that give important      */\n  /*                           information about the face; see             */\n  /*                           @FT_FACE_FLAG_XXX for the details.          */\n  /*                                                                       */\n  /*    style_flags         :: A set of bit flags indicating the style of  */\n  /*                           the face; see @FT_STYLE_FLAG_XXX for the    */\n  /*                           details.                                    */\n  /*                                                                       */\n  /*    num_glyphs          :: The number of glyphs in the face.  If the   */\n  /*                           face is scalable and has sbits (see         */\n  /*                           `num_fixed_sizes'), it is set to the number */\n  /*                           of outline glyphs.                          */\n  /*                                                                       */\n  /*                           For CID-keyed fonts, this value gives the   */\n  /*                           highest CID used in the font.               */\n  /*                                                                       */\n  /*    family_name         :: The face's family name.  This is an ASCII   */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's family (like `Times New      */\n  /*                           Roman', `Bodoni', `Garamond', etc).  This   */\n  /*                           is a least common denominator used to list  */\n  /*                           fonts.  Some formats (TrueType & OpenType)  */\n  /*                           provide localized and Unicode versions of   */\n  /*                           this string.  Applications should use the   */\n  /*                           format specific interface to access them.   */\n  /*                           Can be NULL (e.g., in fonts embedded in a   */\n  /*                           PDF file).                                  */\n  /*                                                                       */\n  /*    style_name          :: The face's style name.  This is an ASCII    */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's style (like `Italic',        */\n  /*                           `Bold', `Condensed', etc).  Not all font    */\n  /*                           formats provide a style name, so this field */\n  /*                           is optional, and can be set to NULL.  As    */\n  /*                           for `family_name', some formats provide     */\n  /*                           localized and Unicode versions of this      */\n  /*                           string.  Applications should use the format */\n  /*                           specific interface to access them.          */\n  /*                                                                       */\n  /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */\n  /*                           Even if the face is scalable, there might   */\n  /*                           still be bitmap strikes, which are called   */\n  /*                           `sbits' in that case.                       */\n  /*                                                                       */\n  /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */\n  /*                           strikes in the face.  It is set to NULL if  */\n  /*                           there is no bitmap strike.                  */\n  /*                                                                       */\n  /*    num_charmaps        :: The number of charmaps in the face.         */\n  /*                                                                       */\n  /*    charmaps            :: An array of the charmaps of the face.       */\n  /*                                                                       */\n  /*    generic             :: A field reserved for client uses.  See the  */\n  /*                           @FT_Generic type description.               */\n  /*                                                                       */\n  /*    bbox                :: The font bounding box.  Coordinates are     */\n  /*                           expressed in font units (see                */\n  /*                           `units_per_EM').  The box is large enough   */\n  /*                           to contain any glyph from the font.  Thus,  */\n  /*                           `bbox.yMax' can be seen as the `maximal     */\n  /*                           ascender', and `bbox.yMin' as the `minimal  */\n  /*                           descender'.  Only relevant for scalable     */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           Note that the bounding box might be off by  */\n  /*                           (at least) one pixel for hinted fonts.  See */\n  /*                           @FT_Size_Metrics for further discussion.    */\n  /*                                                                       */\n  /*    units_per_EM        :: The number of font units per EM square for  */\n  /*                           this face.  This is typically 2048 for      */\n  /*                           TrueType fonts, and 1000 for Type~1 fonts.  */\n  /*                           Only relevant for scalable formats.         */\n  /*                                                                       */\n  /*    ascender            :: The typographic ascender of the face,       */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMax'.  Only relevant for scalable    */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    descender           :: The typographic descender of the face,      */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMin'.  Note that this field is       */\n  /*                           usually negative.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    height              :: The height is the vertical distance         */\n  /*                           between two consecutive baselines,          */\n  /*                           expressed in font units.  It is always      */\n  /*                           positive.  Only relevant for scalable       */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_width   :: The maximal advance width, in font units,   */\n  /*                           for all glyphs in this face.  This can be   */\n  /*                           used to make word wrapping computations     */\n  /*                           faster.  Only relevant for scalable         */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_height  :: The maximal advance height, in font units,  */\n  /*                           for all glyphs in this face.  This is only  */\n  /*                           relevant for vertical layouts, and is set   */\n  /*                           to `height' for fonts that do not provide   */\n  /*                           vertical metrics.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    underline_position  :: The position, in font units, of the         */\n  /*                           underline line for this face.  It is the    */\n  /*                           center of the underlining stem.  Only       */\n  /*                           relevant for scalable formats.              */\n  /*                                                                       */\n  /*    underline_thickness :: The thickness, in font units, of the        */\n  /*                           underline for this face.  Only relevant for */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    glyph               :: The face's associated glyph slot(s).        */\n  /*                                                                       */\n  /*    size                :: The current active size for this face.      */\n  /*                                                                       */\n  /*    charmap             :: The current active charmap for this face.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Fields may be changed after a call to @FT_Attach_File or           */\n  /*    @FT_Attach_Stream.                                                 */\n  /*                                                                       */\n  typedef struct  FT_FaceRec_\n  {\n    FT_Long           num_faces;\n    FT_Long           face_index;\n\n    FT_Long           face_flags;\n    FT_Long           style_flags;\n\n    FT_Long           num_glyphs;\n\n    FT_String*        family_name;\n    FT_String*        style_name;\n\n    FT_Int            num_fixed_sizes;\n    FT_Bitmap_Size*   available_sizes;\n\n    FT_Int            num_charmaps;\n    FT_CharMap*       charmaps;\n\n    FT_Generic        generic;\n\n    /*# The following member variables (down to `underline_thickness') */\n    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */\n    /*# for bitmap fonts.                                              */\n    FT_BBox           bbox;\n\n    FT_UShort         units_per_EM;\n    FT_Short          ascender;\n    FT_Short          descender;\n    FT_Short          height;\n\n    FT_Short          max_advance_width;\n    FT_Short          max_advance_height;\n\n    FT_Short          underline_position;\n    FT_Short          underline_thickness;\n\n    FT_GlyphSlot      glyph;\n    FT_Size           size;\n    FT_CharMap        charmap;\n\n    /*@private begin */\n\n    FT_Driver         driver;\n    FT_Memory         memory;\n    FT_Stream         stream;\n\n    FT_ListRec        sizes_list;\n\n    FT_Generic        autohint;\n    void*             extensions;\n\n    FT_Face_Internal  internal;\n\n    /*@private end */\n\n  } FT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `face_flags' field of the          */\n  /*    @FT_FaceRec structure.  They inform client applications of         */\n  /*    properties of the corresponding face.                              */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FACE_FLAG_SCALABLE ::                                           */\n  /*      Indicates that the face contains outline glyphs.  This doesn't   */\n  /*      prevent bitmap strikes, i.e., a face can have both this and      */\n  /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */\n  /*      Indicates that the face contains bitmap strikes.  See also the   */\n  /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */\n  /*      Indicates that the face contains fixed-width characters (like    */\n  /*      Courier, Lucido, MonoType, etc.).                                */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SFNT ::                                               */\n  /*      Indicates that the face uses the `sfnt' storage scheme.  For     */\n  /*      now, this means TrueType and OpenType.                           */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HORIZONTAL ::                                         */\n  /*      Indicates that the face contains horizontal glyph metrics.  This */\n  /*      should be set for all common formats.                            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_VERTICAL ::                                           */\n  /*      Indicates that the face contains vertical glyph metrics.  This   */\n  /*      is only available in some formats, not all of them.              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_KERNING ::                                            */\n  /*      Indicates that the face contains kerning information.  If set,   */\n  /*      the kerning distance can be retrieved through the function       */\n  /*      @FT_Get_Kerning.  Otherwise the function always return the       */\n  /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */\n  /*      from the `GPOS' table (as present in some OpenType fonts).       */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */\n  /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */\n  /*      Indicates that the font contains multiple masters and is capable */\n  /*      of interpolating between them.  See the multiple-masters         */\n  /*      specific API for details.                                        */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */\n  /*      Indicates that the font contains glyph names that can be         */\n  /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */\n  /*      fonts contain broken glyph name tables.  Use the function        */\n  /*      @FT_Has_PS_Glyph_Names when needed.                              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */\n  /*      Used internally by FreeType to indicate that a face's stream was */\n  /*      provided by the client application and should not be destroyed   */\n  /*      when @FT_Done_Face is called.  Don't read or test this flag.     */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HINTER ::                                             */\n  /*      Set if the font driver has a hinting machine of its own.  For    */\n  /*      example, with TrueType fonts, it makes sense to use data from    */\n  /*      the SFNT `gasp' table only if the native TrueType hinting engine */\n  /*      (with the bytecode interpreter) is available and active.         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_CID_KEYED ::                                          */\n  /*      Set if the font is CID-keyed.  In that case, the font is not     */\n  /*      accessed by glyph indices but by CID values.  For subsetted      */\n  /*      CID-keyed fonts this has the consequence that not all index      */\n  /*      values are a valid argument to FT_Load_Glyph.  Only the CID      */\n  /*      values for which corresponding glyphs in the subsetted font      */\n  /*      exist make FT_Load_Glyph return successfully; in all other cases */\n  /*      you get an `FT_Err_Invalid_Argument' error.                      */\n  /*                                                                       */\n  /*      Note that CID-keyed fonts which are in an SFNT wrapper don't     */\n  /*      have this flag set since the glyphs are accessed in the normal   */\n  /*      way (using contiguous indices); the `CID-ness' isn't visible to  */\n  /*      the application.                                                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_TRICKY ::                                             */\n  /*      Set if the font is `tricky', this is, it always needs the        */\n  /*      font format's native hinting engine to get a reasonable result.  */\n  /*      A typical example is the Chinese font `mingli.ttf' which uses    */\n  /*      TrueType bytecode instructions to move and scale all of its      */\n  /*      subglyphs.                                                       */\n  /*                                                                       */\n  /*      It is not possible to autohint such fonts using                  */\n  /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */\n  /*      @FT_LOAD_NO_HINTING.  You have to set both @FT_LOAD_NO_HINTING   */\n  /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */\n  /*      probably never want this except for demonstration purposes.      */\n  /*                                                                       */\n  /*      Currently, there are about a dozen TrueType fonts in the list of */\n  /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */\n  /*                                                                       */\n#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )\n#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )\n#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )\n#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )\n#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )\n#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )\n#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )\n#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )\n#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )\n#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )\n#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )\n#define FT_FACE_FLAG_HINTER            ( 1L << 11 )\n#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )\n#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_HORIZONTAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   horizontal metrics (this is true for all font formats though).\n   *\n   * @also:\n   *   @FT_HAS_VERTICAL can be used to check for vertical metrics.\n   *\n   */\n#define FT_HAS_HORIZONTAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_VERTICAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains vertical\n   *   metrics.\n   *\n   */\n#define FT_HAS_VERTICAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_VERTICAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_KERNING( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains kerning\n   *   data that can be accessed with @FT_Get_Kerning.\n   *\n   */\n#define FT_HAS_KERNING( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_KERNING )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SCALABLE( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a scalable\n   *   font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,\n   *   and PFR font formats.\n   *\n   */\n#define FT_IS_SCALABLE( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SCALABLE )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SFNT( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font\n   *   whose format is based on the SFNT storage scheme.  This usually\n   *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded\n   *   bitmap fonts.\n   *\n   *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and\n   *   @FT_TRUETYPE_TABLES_H are available.\n   *\n   */\n#define FT_IS_SFNT( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SFNT )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_FIXED_WIDTH( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font face\n   *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)\n   *   glyphs.\n   *\n   */\n#define FT_IS_FIXED_WIDTH( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FIXED_SIZES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   embedded bitmaps.  See the `available_sizes' field of the\n   *   @FT_FaceRec structure.\n   *\n   */\n#define FT_HAS_FIXED_SIZES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FAST_GLYPHS( face )\n   *\n   * @description:\n   *   Deprecated.\n   *\n   */\n#define FT_HAS_FAST_GLYPHS( face )  0\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_GLYPH_NAMES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some glyph\n   *   names that can be accessed through @FT_Get_Glyph_Name.\n   *\n   */\n#define FT_HAS_GLYPH_NAMES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_MULTIPLE_MASTERS( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H\n   *   are then available to choose the exact design you want.\n   *\n   */\n#define FT_HAS_MULTIPLE_MASTERS( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_CID_KEYED( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a CID-keyed\n   *   font.  See the discussion of @FT_FACE_FLAG_CID_KEYED for more\n   *   details.\n   *\n   *   If this macro is true, all functions defined in @FT_CID_H are\n   *   available.\n   *\n   */\n#define FT_IS_CID_KEYED( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_TRICKY( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face represents a `tricky' font.\n   *   See the discussion of @FT_FACE_FLAG_TRICKY for more details.\n   *\n   */\n#define FT_IS_TRICKY( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_TRICKY )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-flags used to indicate the style of a given face.    */\n  /*    These are used in the `style_flags' field of @FT_FaceRec.          */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_STYLE_FLAG_ITALIC ::                                            */\n  /*      Indicates that a given face style is italic or oblique.          */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD ::                                              */\n  /*      Indicates that a given face is bold.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The style information as provided by FreeType is very basic.  More */\n  /*    details are beyond the scope and should be done on a higher level  */\n  /*    (for example, by analyzing various fields of the `OS/2' table in   */\n  /*    SFNT based fonts).                                                 */\n  /*                                                                       */\n#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )\n#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Size object.                     */\n  /*                                                                       */\n  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The size metrics structure gives the metrics of a size object.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x_ppem       :: The width of the scaled EM square in pixels, hence */\n  /*                    the term `ppem' (pixels per EM).  It is also       */\n  /*                    referred to as `nominal width'.                    */\n  /*                                                                       */\n  /*    y_ppem       :: The height of the scaled EM square in pixels,      */\n  /*                    hence the term `ppem' (pixels per EM).  It is also */\n  /*                    referred to as `nominal height'.                   */\n  /*                                                                       */\n  /*    x_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    horizontal metrics from font units to 26.6         */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    y_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    vertical metrics from font units to 26.6           */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    descender    :: The descender in 26.6 fractional pixels.  See      */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    height       :: The height in 26.6 fractional pixels.  See         */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    max_advance  :: The maximal advance width in 26.6 fractional       */\n  /*                    pixels.  See @FT_FaceRec for the details.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The scaling values, if relevant, are determined first during a     */\n  /*    size changing operation.  The remaining fields are then set by the */\n  /*    driver.  For scalable formats, they are usually set to scaled      */\n  /*    values of the corresponding fields in @FT_FaceRec.                 */\n  /*                                                                       */\n  /*    Note that due to glyph hinting, these values might not be exact    */\n  /*    for certain fonts.  Thus they must be treated as unreliable        */\n  /*    with an error margin of at least one pixel!                        */\n  /*                                                                       */\n  /*    Indeed, the only way to get the exact metrics is to render _all_   */\n  /*    glyphs.  As this would be a definite performance hit, it is up to  */\n  /*    client applications to perform such computations.                  */\n  /*                                                                       */\n  /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */\n  /*                                                                       */\n  typedef struct  FT_Size_Metrics_\n  {\n    FT_UShort  x_ppem;      /* horizontal pixels per EM               */\n    FT_UShort  y_ppem;      /* vertical pixels per EM                 */\n\n    FT_Fixed   x_scale;     /* scaling values used to convert font    */\n    FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */\n\n    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */\n    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */\n    FT_Pos     height;      /* text height in 26.6 frac. pixels       */\n    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */\n\n  } FT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root size class structure.  A size object models a face   */\n  /*    object at a given size.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face    :: Handle to the parent face object.                       */\n  /*                                                                       */\n  /*    generic :: A typeless pointer, which is unused by the FreeType     */\n  /*               library or any of its drivers.  It can be used by       */\n  /*               client applications to link their own data to each size */\n  /*               object.                                                 */\n  /*                                                                       */\n  /*    metrics :: Metrics for this size object.  This field is read-only. */\n  /*                                                                       */\n  typedef struct  FT_SizeRec_\n  {\n    FT_Face           face;      /* parent face object              */\n    FT_Generic        generic;   /* generic pointer for client uses */\n    FT_Size_Metrics   metrics;   /* size metrics                    */\n    FT_Size_Internal  internal;\n\n  } FT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The subglyph structure is an internal object used to describe      */\n  /*    subglyphs (for example, in the case of composites).                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The subglyph implementation is not part of the high-level API,     */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  /*    You can however retrieve subglyph information with                 */\n  /*    @FT_Get_SubGlyph_Info.                                             */\n  /*                                                                       */\n  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_GlyphSlot object.                */\n  /*                                                                       */\n  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root glyph slot class structure.  A glyph slot is a       */\n  /*    container where individual glyphs can be loaded, be they in        */\n  /*    outline or bitmap format.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library           :: A handle to the FreeType library instance     */\n  /*                         this slot belongs to.                         */\n  /*                                                                       */\n  /*    face              :: A handle to the parent face object.           */\n  /*                                                                       */\n  /*    next              :: In some cases (like some font tools), several */\n  /*                         glyph slots per face object can be a good     */\n  /*                         thing.  As this is rare, the glyph slots are  */\n  /*                         listed through a direct, single-linked list   */\n  /*                         using its `next' field.                       */\n  /*                                                                       */\n  /*    generic           :: A typeless pointer which is unused by the     */\n  /*                         FreeType library or any of its drivers.  It   */\n  /*                         can be used by client applications to link    */\n  /*                         their own data to each glyph slot object.     */\n  /*                                                                       */\n  /*    metrics           :: The metrics of the last loaded glyph in the   */\n  /*                         slot.  The returned values depend on the last */\n  /*                         load flags (see the @FT_Load_Glyph API        */\n  /*                         function) and can be expressed either in 26.6 */\n  /*                         fractional pixels or font units.              */\n  /*                                                                       */\n  /*                         Note that even when the glyph image is        */\n  /*                         transformed, the metrics are not.             */\n  /*                                                                       */\n  /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    linearVertAdvance :: The advance height of the unhinted glyph.     */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    advance           :: This shorthand is, depending on               */\n  /*                         @FT_LOAD_IGNORE_TRANSFORM, the transformed    */\n  /*                         advance width for the glyph (in 26.6          */\n  /*                         fractional pixel format).  As specified with  */\n  /*                         @FT_LOAD_VERTICAL_LAYOUT, it uses either the  */\n  /*                         `horiAdvance' or the `vertAdvance' value of   */\n  /*                         `metrics' field.                              */\n  /*                                                                       */\n  /*    format            :: This field indicates the format of the image  */\n  /*                         contained in the glyph slot.  Typically       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP,                      */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */\n  /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */\n  /*                         possible.                                     */\n  /*                                                                       */\n  /*    bitmap            :: This field is used as a bitmap descriptor     */\n  /*                         when the slot format is                       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */\n  /*                         address and content of the bitmap buffer can  */\n  /*                         change between calls of @FT_Load_Glyph and a  */\n  /*                         few other functions.                          */\n  /*                                                                       */\n  /*    bitmap_left       :: This is the bitmap's left bearing expressed   */\n  /*                         in integer pixels.  Of course, this is only   */\n  /*                         valid if the format is                        */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.                      */\n  /*                                                                       */\n  /*    bitmap_top        :: This is the bitmap's top bearing expressed in */\n  /*                         integer pixels.  Remember that this is the    */\n  /*                         distance from the baseline to the top-most    */\n  /*                         glyph scanline, upwards y~coordinates being   */\n  /*                         *positive*.                                   */\n  /*                                                                       */\n  /*    outline           :: The outline descriptor for the current glyph  */\n  /*                         image if its format is                        */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */\n  /*                         loaded, `outline' can be transformed,         */\n  /*                         distorted, embolded, etc.  However, it must   */\n  /*                         not be freed.                                 */\n  /*                                                                       */\n  /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */\n  /*                         This field is only valid for the composite    */\n  /*                         glyph format that should normally only be     */\n  /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */\n  /*                         For now this is internal to FreeType.         */\n  /*                                                                       */\n  /*    subglyphs         :: An array of subglyph descriptors for          */\n  /*                         composite glyphs.  There are `num_subglyphs'  */\n  /*                         elements in there.  Currently internal to     */\n  /*                         FreeType.                                     */\n  /*                                                                       */\n  /*    control_data      :: Certain font drivers can also return the      */\n  /*                         control data for a given glyph image (e.g.    */\n  /*                         TrueType bytecode, Type~1 charstrings, etc.). */\n  /*                         This field is a pointer to such data.         */\n  /*                                                                       */\n  /*    control_len       :: This is the length in bytes of the control    */\n  /*                         data.                                         */\n  /*                                                                       */\n  /*    other             :: Really wicked formats can use this pointer to */\n  /*                         present their own glyph image to client       */\n  /*                         applications.  Note that the application      */\n  /*                         needs to know about the image format.         */\n  /*                                                                       */\n  /*    lsb_delta         :: The difference between hinted and unhinted    */\n  /*                         left side bearing while autohinting is        */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /*    rsb_delta         :: The difference between hinted and unhinted    */\n  /*                         right side bearing while autohinting is       */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If @FT_Load_Glyph is called with default flags (see                */\n  /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */\n  /*    its native format (e.g., an outline glyph for TrueType and Type~1  */\n  /*    formats).                                                          */\n  /*                                                                       */\n  /*    This image can later be converted into a bitmap by calling         */\n  /*    @FT_Render_Glyph.  This function finds the current renderer for    */\n  /*    the native image's format, then invokes it.                        */\n  /*                                                                       */\n  /*    The renderer is in charge of transforming the native image through */\n  /*    the slot's face transformation fields, then converting it into a   */\n  /*    bitmap that is returned in `slot->bitmap'.                         */\n  /*                                                                       */\n  /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */\n  /*    to specify the position of the bitmap relative to the current pen  */\n  /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */\n  /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Here a small pseudo code fragment which shows how to use           */\n  /*    `lsb_delta' and `rsb_delta':                                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Pos  origin_x       = 0;                                      */\n  /*      FT_Pos  prev_rsb_delta = 0;                                      */\n  /*                                                                       */\n  /*                                                                       */\n  /*      for all glyphs do                                                */\n  /*        <compute kern between current and previous glyph and add it to */\n  /*         `origin_x'>                                                   */\n  /*                                                                       */\n  /*        <load glyph with `FT_Load_Glyph'>                              */\n  /*                                                                       */\n  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */\n  /*          origin_x -= 64;                                              */\n  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */\n  /*          origin_x += 64;                                              */\n  /*                                                                       */\n  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */\n  /*                                                                       */\n  /*        <save glyph image, or render glyph, or ...>                    */\n  /*                                                                       */\n  /*        origin_x += face->glyph->advance.x;                            */\n  /*      endfor                                                           */\n  /*    }                                                                  */\n  /*                                                                       */\n  typedef struct  FT_GlyphSlotRec_\n  {\n    FT_Library        library;\n    FT_Face           face;\n    FT_GlyphSlot      next;\n    FT_UInt           reserved;       /* retained for binary compatibility */\n    FT_Generic        generic;\n\n    FT_Glyph_Metrics  metrics;\n    FT_Fixed          linearHoriAdvance;\n    FT_Fixed          linearVertAdvance;\n    FT_Vector         advance;\n\n    FT_Glyph_Format   format;\n\n    FT_Bitmap         bitmap;\n    FT_Int            bitmap_left;\n    FT_Int            bitmap_top;\n\n    FT_Outline        outline;\n\n    FT_UInt           num_subglyphs;\n    FT_SubGlyph       subglyphs;\n\n    void*             control_data;\n    long              control_len;\n\n    FT_Pos            lsb_delta;\n    FT_Pos            rsb_delta;\n\n    void*             other;\n\n    FT_Slot_Internal  internal;\n\n  } FT_GlyphSlotRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         F U N C T I O N S                             */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Init_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new FreeType library object.  The set of modules      */\n  /*    that are registered by this function is determined at build time.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A handle to a new library object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case you want to provide your own memory allocating routines,   */\n  /*    use @FT_New_Library instead, followed by a call to                 */\n  /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given FreeType library object and all of its children,   */\n  /*    including resources, drivers, faces, sizes, etc.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library object.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_FreeType( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OPEN_XXX                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants used within the `flags' field of the */\n  /*    @FT_Open_Args structure.                                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OPEN_MEMORY   :: This is a memory-based stream.                 */\n  /*                                                                       */\n  /*    FT_OPEN_STREAM   :: Copy the stream from the `stream' field.       */\n  /*                                                                       */\n  /*    FT_OPEN_PATHNAME :: Create a new input stream from a C~path        */\n  /*                        name.                                          */\n  /*                                                                       */\n  /*    FT_OPEN_DRIVER   :: Use the `driver' field.                        */\n  /*                                                                       */\n  /*    FT_OPEN_PARAMS   :: Use the `num_params' and `params' fields.      */\n  /*                                                                       */\n  /*    ft_open_memory   :: Deprecated; use @FT_OPEN_MEMORY instead.       */\n  /*                                                                       */\n  /*    ft_open_stream   :: Deprecated; use @FT_OPEN_STREAM instead.       */\n  /*                                                                       */\n  /*    ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead.     */\n  /*                                                                       */\n  /*    ft_open_driver   :: Deprecated; use @FT_OPEN_DRIVER instead.       */\n  /*                                                                       */\n  /*    ft_open_params   :: Deprecated; use @FT_OPEN_PARAMS instead.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */\n  /*    flags are mutually exclusive.                                      */\n  /*                                                                       */\n#define FT_OPEN_MEMORY    0x1\n#define FT_OPEN_STREAM    0x2\n#define FT_OPEN_PATHNAME  0x4\n#define FT_OPEN_DRIVER    0x8\n#define FT_OPEN_PARAMS    0x10\n\n#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */\n#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */\n#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */\n#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */\n#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Parameter                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to pass more or less generic parameters to */\n  /*    @FT_Open_Face.                                                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag  :: A four-byte identification tag.                            */\n  /*                                                                       */\n  /*    data :: A pointer to the parameter data.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The ID and function of parameters are driver-specific.  See the    */\n  /*    various FT_PARAM_TAG_XXX flags for more information.               */\n  /*                                                                       */\n  typedef struct  FT_Parameter_\n  {\n    FT_ULong    tag;\n    FT_Pointer  data;\n\n  } FT_Parameter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Open_Args                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to indicate how to open a new font file or        */\n  /*    stream.  A pointer to such a structure can be used as a parameter  */\n  /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    flags       :: A set of bit flags indicating how to use the        */\n  /*                   structure.                                          */\n  /*                                                                       */\n  /*    memory_base :: The first byte of the file in memory.               */\n  /*                                                                       */\n  /*    memory_size :: The size in bytes of the file in memory.            */\n  /*                                                                       */\n  /*    pathname    :: A pointer to an 8-bit file pathname.                */\n  /*                                                                       */\n  /*    stream      :: A handle to a source stream object.                 */\n  /*                                                                       */\n  /*    driver      :: This field is exclusively used by @FT_Open_Face;    */\n  /*                   it simply specifies the font driver to use to open  */\n  /*                   the face.  If set to~0, FreeType tries to load the  */\n  /*                   face with each one of the drivers in its list.      */\n  /*                                                                       */\n  /*    num_params  :: The number of extra parameters.                     */\n  /*                                                                       */\n  /*    params      :: Extra parameters passed to the font driver when     */\n  /*                   opening a new face.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream type is determined by the contents of `flags' which     */\n  /*    are tested in the following order by @FT_Open_Face:                */\n  /*                                                                       */\n  /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */\n  /*    memory file of `memory_size' bytes, located at `memory_address'.   */\n  /*    The data are are not copied, and the client is responsible for     */\n  /*    releasing and destroying them _after_ the corresponding call to    */\n  /*    @FT_Done_Face.                                                     */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */\n  /*    custom input stream `stream' is used.                              */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this  */\n  /*    is a normal file and use `pathname' to open it.                    */\n  /*                                                                       */\n  /*    If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to    */\n  /*    open the file with the driver whose handler is in `driver'.        */\n  /*                                                                       */\n  /*    If the `FT_OPEN_PARAMS' bit is set, the parameters given by        */\n  /*    `num_params' and `params' is used.  They are ignored otherwise.    */\n  /*                                                                       */\n  /*    Ideally, both the `pathname' and `params' fields should be tagged  */\n  /*    as `const'; this is missing for API backwards compatibility.  In   */\n  /*    other words, applications should treat them as read-only.          */\n  /*                                                                       */\n  typedef struct  FT_Open_Args_\n  {\n    FT_UInt         flags;\n    const FT_Byte*  memory_base;\n    FT_Long         memory_size;\n    FT_String*      pathname;\n    FT_Stream       stream;\n    FT_Module       driver;\n    FT_Int          num_params;\n    FT_Parameter*   params;\n\n  } FT_Open_Args;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font by its pathname.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pathname   :: A path to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  filepathname,\n               FT_Long      face_index,\n               FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory_Face                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font which has been    */\n  /*    loaded into memory.                                                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    file_base  :: A pointer to the beginning of the font data.         */\n  /*                                                                       */\n  /*    file_size  :: The size of the memory chunk used by the font data.  */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You must not deallocate the memory before calling @FT_Done_Face.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Open_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a face object from a given resource described by            */\n  /*    @FT_Open_Args.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    args       :: A pointer to an `FT_Open_Args' structure which must  */\n  /*                  be filled by the caller.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See note below.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Unlike FreeType 1.x, this function automatically creates a glyph   */\n  /*    slot for the face object which can be accessed directly through    */\n  /*    `face->glyph'.                                                     */\n  /*                                                                       */\n  /*    FT_Open_Face can be used to quickly check whether the font         */\n  /*    format of a given font resource is supported by FreeType.  If the  */\n  /*    `face_index' field is negative, the function's return value is~0   */\n  /*    if the font format is recognized, or non-zero otherwise;           */\n  /*    the function returns a more or less empty face handle in `*aface'  */\n  /*    (if `aface' isn't NULL).  The only useful field in this special    */\n  /*    case is `face->num_faces' which gives the number of faces within   */\n  /*    the font file.  After examination, the returned @FT_Face structure */\n  /*    should be deallocated with a call to @FT_Done_Face.                */\n  /*                                                                       */\n  /*    Each new face object created with this function also owns a        */\n  /*    default @FT_Size object, accessible as `face->size'.               */\n  /*                                                                       */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_File                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Attach_Stream to attach a file.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: The target face object.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    filepathname :: The pathname.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    `Attach' data to a face object.  Normally, this is used to read    */\n  /*    additional information for the face object.  For example, you can  */\n  /*    attach an AFM file that comes with a Type~1 font to get the        */\n  /*    kerning values and other metrics.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The target face object.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    parameters :: A pointer to @FT_Open_Args which must be filled by   */\n  /*                  the caller.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The meaning of the `attach' (i.e., what really happens when the    */\n  /*    new file is read) is not fixed by FreeType itself.  It really      */\n  /*    depends on the font format (and thus the font driver).             */\n  /*                                                                       */\n  /*    Client applications are expected to know what they are doing       */\n  /*    when invoking this function.  Most drivers simply do not implement */\n  /*    file attachments.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Face                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Face structure  */\n  /*    is created.  This function increments the counter.  @FT_Done_Face  */\n  /*    then only destroys a face if the counter is~1, otherwise it simply */\n  /*    decrements the counter.                                            */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Face objects.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given face object, as well as all of its child slots and */\n  /*    sizes.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a bitmap strike.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to a target face object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strike_index :: The index of the bitmap strike in the              */\n  /*                    `available_sizes' field of @FT_FaceRec structure.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Size_Request_Type                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the supported size request types.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SIZE_REQUEST_TYPE_NOMINAL ::                                    */\n  /*      The nominal size.  The `units_per_EM' field of @FT_FaceRec is    */\n  /*      used to determine both scaling values.                           */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */\n  /*      The real dimension.  The sum of the the `ascender' and (minus    */\n  /*      of) the `descender' fields of @FT_FaceRec are used to determine  */\n  /*      both scaling values.                                             */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */\n  /*      The font bounding box.  The width and height of the `bbox' field */\n  /*      of @FT_FaceRec are used to determine the horizontal and vertical */\n  /*      scaling value, respectively.                                     */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_CELL ::                                       */\n  /*      The `max_advance_width' field of @FT_FaceRec is used to          */\n  /*      determine the horizontal scaling value; the vertical scaling     */\n  /*      value is determined the same way as                              */\n  /*      @FT_SIZE_REQUEST_TYPE_REAL_DIM does.  Finally, both scaling      */\n  /*      values are set to the smaller one.  This type is useful if you   */\n  /*      want to specify the font size for, say, a window of a given      */\n  /*      dimension and 80x24 cells.                                       */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_SCALES ::                                     */\n  /*      Specify the scaling values directly.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The above descriptions only apply to scalable formats.  For bitmap */\n  /*    formats, the behaviour is up to the driver.                        */\n  /*                                                                       */\n  /*    See the note section of @FT_Size_Metrics if you wonder how size    */\n  /*    requesting relates to scaling values.                              */\n  /*                                                                       */\n  typedef enum  FT_Size_Request_Type_\n  {\n    FT_SIZE_REQUEST_TYPE_NOMINAL,\n    FT_SIZE_REQUEST_TYPE_REAL_DIM,\n    FT_SIZE_REQUEST_TYPE_BBOX,\n    FT_SIZE_REQUEST_TYPE_CELL,\n    FT_SIZE_REQUEST_TYPE_SCALES,\n\n    FT_SIZE_REQUEST_TYPE_MAX\n\n  } FT_Size_Request_Type;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_RequestRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a size request.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    type           :: See @FT_Size_Request_Type.                       */\n  /*                                                                       */\n  /*    width          :: The desired width.                               */\n  /*                                                                       */\n  /*    height         :: The desired height.                              */\n  /*                                                                       */\n  /*    horiResolution :: The horizontal resolution.  If set to zero,      */\n  /*                      `width' is treated as a 26.6 fractional pixel    */\n  /*                      value.                                           */\n  /*                                                                       */\n  /*    vertResolution :: The vertical resolution.  If set to zero,        */\n  /*                      `height' is treated as a 26.6 fractional pixel   */\n  /*                      value.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `width' is zero, then the horizontal scaling value is set equal */\n  /*    to the vertical scaling value, and vice versa.                     */\n  /*                                                                       */\n  typedef struct  FT_Size_RequestRec_\n  {\n    FT_Size_Request_Type  type;\n    FT_Long               width;\n    FT_Long               height;\n    FT_UInt               horiResolution;\n    FT_UInt               vertResolution;\n\n  } FT_Size_RequestRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Request                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a size request structure.                              */\n  /*                                                                       */\n  typedef struct FT_Size_RequestRec_  *FT_Size_Request;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Request_Size                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Resize the scale of the active @FT_Size object in a face.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    req  :: A pointer to a @FT_Size_RequestRec.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Although drivers may select the bitmap strike matching the         */\n  /*    request, you should not rely on this if you intend to select a     */\n  /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */\n  /*    case.                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Char_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in points).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face            :: A handle to a target face object.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_width      :: The nominal width, in 26.6 fractional points.   */\n  /*                                                                       */\n  /*    char_height     :: The nominal height, in 26.6 fractional points.  */\n  /*                                                                       */\n  /*    horz_resolution :: The horizontal resolution in dpi.               */\n  /*                                                                       */\n  /*    vert_resolution :: The vertical resolution in dpi.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If either the character width or height is zero, it is set equal   */\n  /*    to the other value.                                                */\n  /*                                                                       */\n  /*    If either the horizontal or vertical resolution is zero, it is set */\n  /*    equal to the other value.                                          */\n  /*                                                                       */\n  /*    A character width or height smaller than 1pt is set to 1pt; if     */\n  /*    both resolution values are zero, they are set to 72dpi.            */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in pixels).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to the target face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pixel_width  :: The nominal width, in pixels.                      */\n  /*                                                                       */\n  /*    pixel_height :: The nominal height, in pixels.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to the target face object where the glyph  */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph_index :: The index of the glyph in the font file.  For       */\n  /*                   CID-keyed fonts (either in PS or in CFF format)     */\n  /*                   this argument specifies the CID value.              */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The loaded glyph may be transformed.  See @FT_Set_Transform for    */\n  /*    the details.                                                       */\n  /*                                                                       */\n  /*    For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is        */\n  /*    returned for invalid CID values (this is, for CID values which     */\n  /*    don't have a corresponding glyph in the font).  See the discussion */\n  /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object, according to its character code.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to a target face object where the glyph    */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_code   :: The glyph's character code, according to the        */\n  /*                   current charmap used in the face.                   */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags );\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_XXX\n   *\n   * @description:\n   *   A list of bit-field constants used with @FT_Load_Glyph to indicate\n   *   what kind of operations to perform during glyph loading.\n   *\n   * @values:\n   *   FT_LOAD_DEFAULT ::\n   *     Corresponding to~0, this value is used as the default glyph load\n   *     operation.  In this case, the following happens:\n   *\n   *     1. FreeType looks for a bitmap for the glyph corresponding to the\n   *        face's current size.  If one is found, the function returns.\n   *        The bitmap data can be accessed from the glyph slot (see note\n   *        below).\n   *\n   *     2. If no embedded bitmap is searched or found, FreeType looks for a\n   *        scalable outline.  If one is found, it is loaded from the font\n   *        file, scaled to device pixels, then `hinted' to the pixel grid\n   *        in order to optimize it.  The outline data can be accessed from\n   *        the glyph slot (see note below).\n   *\n   *     Note that by default, the glyph loader doesn't render outlines into\n   *     bitmaps.  The following flags are used to modify this default\n   *     behaviour to more specific and useful cases.\n   *\n   *   FT_LOAD_NO_SCALE ::\n   *     Don't scale the outline glyph loaded, but keep it in font units.\n   *\n   *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and\n   *     unsets @FT_LOAD_RENDER.\n   *\n   *   FT_LOAD_NO_HINTING ::\n   *     Disable hinting.  This generally generates `blurrier' bitmap glyph\n   *     when the glyph is rendered in any of the anti-aliased modes.  See\n   *     also the note below.\n   *\n   *     This flag is implied by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_RENDER ::\n   *     Call @FT_Render_Glyph after the glyph is loaded.  By default, the\n   *     glyph is rendered in @FT_RENDER_MODE_NORMAL mode.  This can be\n   *     overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.\n   *\n   *     This flag is unset by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_NO_BITMAP ::\n   *     Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this\n   *     flag.\n   *\n   *     @FT_LOAD_NO_SCALE always sets this flag.\n   *\n   *   FT_LOAD_VERTICAL_LAYOUT ::\n   *     Load the glyph for vertical text layout.  _Don't_ use it as it is\n   *     problematic currently.\n   *\n   *   FT_LOAD_FORCE_AUTOHINT ::\n   *     Indicates that the auto-hinter is preferred over the font's native\n   *     hinter.  See also the note below.\n   *\n   *   FT_LOAD_CROP_BITMAP ::\n   *     Indicates that the font driver should crop the loaded bitmap glyph\n   *     (i.e., remove all space around its black bits).  Not all drivers\n   *     implement this.\n   *\n   *   FT_LOAD_PEDANTIC ::\n   *     Indicates that the font driver should perform pedantic verifications\n   *     during glyph loading.  This is mostly used to detect broken glyphs\n   *     in fonts.  By default, FreeType tries to handle broken fonts also.\n   *\n   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::\n   *     Ignored.  Deprecated.\n   *\n   *   FT_LOAD_NO_RECURSE ::\n   *     This flag is only used internally.  It merely indicates that the\n   *     font driver should not load composite glyphs recursively.  Instead,\n   *     it should set the `num_subglyph' and `subglyphs' values of the\n   *     glyph slot accordingly, and set `glyph->format' to\n   *     @FT_GLYPH_FORMAT_COMPOSITE.\n   *\n   *     The description of sub-glyphs is not available to client\n   *     applications for now.\n   *\n   *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.\n   *\n   *   FT_LOAD_IGNORE_TRANSFORM ::\n   *     Indicates that the transform matrix set by @FT_Set_Transform should\n   *     be ignored.\n   *\n   *   FT_LOAD_MONOCHROME ::\n   *     This flag is used with @FT_LOAD_RENDER to indicate that you want to\n   *     render an outline glyph to a 1-bit monochrome bitmap glyph, with\n   *     8~pixels packed into each byte of the bitmap data.\n   *\n   *     Note that this has no effect on the hinting algorithm used.  You\n   *     should rather use @FT_LOAD_TARGET_MONO so that the\n   *     monochrome-optimized hinting algorithm is used.\n   *\n   *   FT_LOAD_LINEAR_DESIGN ::\n   *     Indicates that the `linearHoriAdvance' and `linearVertAdvance'\n   *     fields of @FT_GlyphSlotRec should be kept in font units.  See\n   *     @FT_GlyphSlotRec for details.\n   *\n   *   FT_LOAD_NO_AUTOHINT ::\n   *     Disable auto-hinter.  See also the note below.\n   *\n   * @note:\n   *   By default, hinting is enabled and the font's native hinter (see\n   *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can\n   *   disable hinting by setting @FT_LOAD_NO_HINTING or change the\n   *   precedence by setting @FT_LOAD_FORCE_AUTOHINT.  You can also set\n   *   @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be\n   *   used at all.\n   *\n   *   See the description of @FT_FACE_FLAG_TRICKY for a special exception\n   *   (affecting only a handful of Asian fonts).\n   *\n   *   Besides deciding which hinter to use, you can also decide which\n   *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.\n   *\n   */\n#define FT_LOAD_DEFAULT                      0x0\n#define FT_LOAD_NO_SCALE                     0x1\n#define FT_LOAD_NO_HINTING                   0x2\n#define FT_LOAD_RENDER                       0x4\n#define FT_LOAD_NO_BITMAP                    0x8\n#define FT_LOAD_VERTICAL_LAYOUT              0x10\n#define FT_LOAD_FORCE_AUTOHINT               0x20\n#define FT_LOAD_CROP_BITMAP                  0x40\n#define FT_LOAD_PEDANTIC                     0x80\n#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  0x200\n#define FT_LOAD_NO_RECURSE                   0x400\n#define FT_LOAD_IGNORE_TRANSFORM             0x800\n#define FT_LOAD_MONOCHROME                   0x1000\n#define FT_LOAD_LINEAR_DESIGN                0x2000\n#define FT_LOAD_NO_AUTOHINT                  0x8000U\n\n  /* */\n\n  /* used internally only by certain font drivers! */\n#define FT_LOAD_ADVANCE_ONLY                 0x100\n#define FT_LOAD_SBITS_ONLY                   0x4000\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_TARGET_XXX\n   *\n   * @description:\n   *   A list of values that are used to select a specific hinting algorithm\n   *   to use by the hinter.  You should OR one of these values to your\n   *   `load_flags' when calling @FT_Load_Glyph.\n   *\n   *   Note that font's native hinters may ignore the hinting algorithm you\n   *   have specified (e.g., the TrueType bytecode interpreter).  You can set\n   *   @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.\n   *\n   *   Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it\n   *   always implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   * @values:\n   *   FT_LOAD_TARGET_NORMAL ::\n   *     This corresponds to the default hinting algorithm, optimized for\n   *     standard gray-level rendering.  For monochrome output, use\n   *     @FT_LOAD_TARGET_MONO instead.\n   *\n   *   FT_LOAD_TARGET_LIGHT ::\n   *     A lighter hinting algorithm for non-monochrome modes.  Many\n   *     generated glyphs are more fuzzy but better resemble its original\n   *     shape.  A bit like rendering on Mac OS~X.\n   *\n   *     As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   *   FT_LOAD_TARGET_MONO ::\n   *     Strong hinting algorithm that should only be used for monochrome\n   *     output.  The result is probably unpleasant if the glyph is rendered\n   *     in non-monochrome modes.\n   *\n   *   FT_LOAD_TARGET_LCD ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally\n   *     decimated LCD displays.\n   *\n   *   FT_LOAD_TARGET_LCD_V ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically\n   *     decimated LCD displays.\n   *\n   * @note:\n   *   You should use only _one_ of the FT_LOAD_TARGET_XXX values in your\n   *   `load_flags'.  They can't be ORed.\n   *\n   *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the\n   *   corresponding mode (i.e., the mode which matches the used algorithm\n   *   best) unless @FT_LOAD_MONOCHROME is set.\n   *\n   *   You can use a hinting algorithm that doesn't correspond to the same\n   *   rendering mode.  As an example, it is possible to use the `light'\n   *   hinting algorithm and have the results rendered in horizontal LCD\n   *   pixel mode, with code like\n   *\n   *     {\n   *       FT_Load_Glyph( face, glyph_index,\n   *                      load_flags | FT_LOAD_TARGET_LIGHT );\n   *\n   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );\n   *     }\n   *\n   */\n#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )\n\n#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )\n#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )\n#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )\n#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )\n#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )\n\n\n  /**************************************************************************\n   *\n   * @macro:\n   *   FT_LOAD_TARGET_MODE\n   *\n   * @description:\n   *   Return the @FT_Render_Mode corresponding to a given\n   *   @FT_LOAD_TARGET_XXX value.\n   *\n   */\n#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Transform                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to set the transformation that is applied to glyph */\n  /*    images when they are loaded into a glyph slot through              */\n  /*    @FT_Load_Glyph.                                                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the transformation's 2x2 matrix.  Use~0 for */\n  /*              the identity matrix.                                     */\n  /*    delta  :: A pointer to the translation vector.  Use~0 for the null */\n  /*              vector.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The transformation is only applied to scalable image formats after */\n  /*    the glyph has been loaded.  It means that hinting is unaltered by  */\n  /*    the transformation and is performed on the character size given in */\n  /*    the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes.         */\n  /*                                                                       */\n  /*    Note that this also transforms the `face.glyph.advance' field, but */\n  /*    *not* the values in `face.glyph.metrics'.                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Render_Mode                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the render modes supported by       */\n  /*    FreeType~2.  Each mode corresponds to a specific type of scanline  */\n  /*    conversion performed on the outline.                               */\n  /*                                                                       */\n  /*    For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode'     */\n  /*    field in the @FT_GlyphSlotRec structure gives the format of the    */\n  /*    returned bitmap.                                                   */\n  /*                                                                       */\n  /*    All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RENDER_MODE_NORMAL ::                                           */\n  /*      This is the default render mode; it corresponds to 8-bit         */\n  /*      anti-aliased bitmaps.                                            */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LIGHT ::                                            */\n  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */\n  /*      defined as a separate value because render modes are also used   */\n  /*      indirectly to define hinting algorithm selectors.  See           */\n  /*      @FT_LOAD_TARGET_XXX for details.                                 */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_MONO ::                                             */\n  /*      This mode corresponds to 1-bit bitmaps (with 2~levels of         */\n  /*      opacity).                                                        */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD ::                                              */\n  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */\n  /*      displays like LCD screens.  It produces 8-bit bitmaps that are   */\n  /*      3~times the width of the original glyph outline in pixels, and   */\n  /*      which use the @FT_PIXEL_MODE_LCD mode.                           */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD_V ::                                            */\n  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */\n  /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */\n  /*      8-bit bitmaps that are 3~times the height of the original        */\n  /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */\n  /*    filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */\n  /*    (not active in the default builds).  It is up to the caller to     */\n  /*    either call @FT_Library_SetLcdFilter (if available) or do the      */\n  /*    filtering itself.                                                  */\n  /*                                                                       */\n  /*    The selected render mode only affects vector glyphs of a font.     */\n  /*    Embedded bitmaps often have a different pixel mode like            */\n  /*    @FT_PIXEL_MODE_MONO.  You can use @FT_Bitmap_Convert to transform  */\n  /*    them into 8-bit pixmaps.                                           */\n  /*                                                                       */\n  typedef enum  FT_Render_Mode_\n  {\n    FT_RENDER_MODE_NORMAL = 0,\n    FT_RENDER_MODE_LIGHT,\n    FT_RENDER_MODE_MONO,\n    FT_RENDER_MODE_LCD,\n    FT_RENDER_MODE_LCD_V,\n\n    FT_RENDER_MODE_MAX\n\n  } FT_Render_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_render_mode_xxx                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Render_Mode values instead.                                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL                */\n  /*    ft_render_mode_mono   :: see @FT_RENDER_MODE_MONO                  */\n  /*                                                                       */\n#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL\n#define ft_render_mode_mono    FT_RENDER_MODE_MONO\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Render_Glyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph image to a bitmap.  It does so by inspecting */\n  /*    the glyph image format, finding the relevant renderer, and         */\n  /*    invoking it.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot        :: A handle to the glyph slot containing the image to  */\n  /*                   convert.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: This is the render mode used to render the glyph    */\n  /*                   image into a bitmap.  See @FT_Render_Mode for a     */\n  /*                   list of possible values.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Kerning_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify which kerning values to return in   */\n  /*    @FT_Get_Kerning.                                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_KERNING_DEFAULT  :: Return scaled and grid-fitted kerning       */\n  /*                           distances (value is~0).                     */\n  /*                                                                       */\n  /*    FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning    */\n  /*                           distances.                                  */\n  /*                                                                       */\n  /*    FT_KERNING_UNSCALED :: Return the kerning vector in original font  */\n  /*                           units.                                      */\n  /*                                                                       */\n  typedef enum  FT_Kerning_Mode_\n  {\n    FT_KERNING_DEFAULT  = 0,\n    FT_KERNING_UNFITTED,\n    FT_KERNING_UNSCALED\n\n  } FT_Kerning_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_default                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_DEFAULT       */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_default   FT_KERNING_DEFAULT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unfitted                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNFITTED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unfitted  FT_KERNING_UNFITTED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unscaled                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNSCALED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unscaled  FT_KERNING_UNSCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the kerning vector between two glyphs of a same face.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /*    kern_mode   :: See @FT_Kerning_Mode for more information.          */\n  /*                   Determines the scale and dimension of the returned  */\n  /*                   kerning vector.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning vector.  This is either in font units   */\n  /*                   or in pixels (26.6 format) for scalable formats,    */\n  /*                   and in pixels for fixed-sizes formats.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this method.  Other layouts, or more sophisticated    */\n  /*    kernings, are out of the scope of this API function -- they can be */\n  /*    implemented through format-specific interfaces.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Track_Kerning                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the track kerning for a given face object at a given size.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to a source face object.                    */\n  /*                                                                       */\n  /*    point_size :: The point size in 16.16 fractional points.           */\n  /*                                                                       */\n  /*    degree     :: The degree of tightness.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning   :: The kerning in 16.16 fractional points.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII name of a given glyph in a face.  This only     */\n  /*    works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    buffer_max  :: The maximal number of bytes available in the        */\n  /*                   buffer.                                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer      :: A pointer to a target buffer where the name is      */\n  /*                   copied to.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error is returned if the face doesn't provide glyph names or if */\n  /*    the glyph index is invalid.  In all cases of failure, the first    */\n  /*    byte of `buffer' is set to~0 to indicate an empty name.            */\n  /*                                                                       */\n  /*    The glyph name is truncated to fit within the buffer if it is too  */\n  /*    long.  The returned string is always zero-terminated.              */\n  /*                                                                       */\n  /*    Be aware that FreeType reorders glyph indices internally so that   */\n  /*    glyph index~0 always corresponds to the `missing glyph' (called    */\n  /*    `.notdef').                                                        */\n  /*                                                                       */\n  /*    This function is not compiled within the library if the config     */\n  /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */\n  /*    `include/freetype/config/ftoptions.h'.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII PostScript name of a given face, if available.  */\n  /*    This only works with PostScript and TrueType fonts.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the face's PostScript name.  NULL if unavailable.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned pointer is owned by the face and is destroyed with    */\n  /*    it.                                                                */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_Postscript_Name( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Charmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap by its encoding tag (as listed in           */\n  /*    `freetype.h').                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    encoding :: A handle to the selected encoding.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if no charmap in the face           */\n  /*    corresponds to the encoding queried here.                          */\n  /*                                                                       */\n  /*    Because many fonts contain more than a single cmap for Unicode     */\n  /*    encoding, this function has some special code to select the one    */\n  /*    which covers Unicode best (`best' in the sense that a UCS-4 cmap   */\n  /*    is preferred to a UCS-2 cmap).  It is thus preferable to           */\n  /*    @FT_Set_Charmap in this case.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Charmap                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap for character code to glyph index mapping.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap :: A handle to the selected charmap.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if the charmap is not part of       */\n  /*    the face (i.e., if it is not listed in the `face->charmaps'        */\n  /*    table).                                                            */\n  /*                                                                       */\n  /*    It also fails if a type~14 charmap is selected.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Get_Charmap_Index\n   *\n   * @description:\n   *   Retrieve index of a given charmap.\n   *\n   * @input:\n   *   charmap ::\n   *     A handle to a charmap.\n   *\n   * @return:\n   *   The index into the array of character maps within the face to which\n   *   `charmap' belongs.  If an error occurs, -1 is returned.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Char_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code.  This function   */\n  /*    uses a charmap object to do the mapping.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /*    charcode :: The character code.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value~0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_First_Char                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the first character code in the    */\n  /*    current charmap of a given face.  It also returns the              */\n  /*    corresponding glyph index.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex :: Glyph index of first character code.  0~if charmap is   */\n  /*               empty.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's first character code.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_Next_Char to be able to  */\n  /*    parse all character codes available in a given charmap.  The code  */\n  /*    should look like this:                                             */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_ULong  charcode;                                              */\n  /*      FT_UInt   gindex;                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      charcode = FT_Get_First_Char( face, &gindex );                   */\n  /*      while ( gindex != 0 )                                            */\n  /*      {                                                                */\n  /*        ... do something with (charcode,gindex) pair ...               */\n  /*                                                                       */\n  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */\n  /*      }                                                                */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 if the charmap is empty.  The     */\n  /*    result itself can be~0 in two cases: if the charmap is empty or    */\n  /*    if the value~0 is the first valid character code.                  */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Next_Char                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the next character code in the     */\n  /*    current charmap of a given face following the value `char_code',   */\n  /*    as well as the corresponding glyph index.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: A handle to the source face object.                   */\n  /*    char_code :: The starting character code.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex   :: Glyph index of next character code.  0~if charmap     */\n  /*                 is empty.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's next character code.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_First_Char to walk       */\n  /*    over all character codes available in a given charmap.  See the    */\n  /*    note for this function for a simple code example.                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 when there are no more codes in   */\n  /*    the charmap.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_Next_Char( FT_Face    face,\n                    FT_ULong   char_code,\n                    FT_UInt   *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Name_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given glyph name.  This function uses  */\n  /*    driver specific objects to do the translation.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the source face object.                  */\n  /*                                                                       */\n  /*    glyph_name :: The glyph name.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name );\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SUBGLYPH_FLAG_XXX\n   *\n   * @description:\n   *   A list of constants used to describe subglyphs.  Please refer to the\n   *   TrueType specification for the meaning of the various flags.\n   *\n   * @values:\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::\n   *   FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::\n   *   FT_SUBGLYPH_FLAG_SCALE ::\n   *   FT_SUBGLYPH_FLAG_XY_SCALE ::\n   *   FT_SUBGLYPH_FLAG_2X2 ::\n   *   FT_SUBGLYPH_FLAG_USE_MY_METRICS ::\n   *\n   */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_SubGlyph_Info\n   *\n   * @description:\n   *   Retrieve a description of a given subglyph.  Only use it if\n   *   `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is\n   *   returned otherwise.\n   *\n   * @input:\n   *   glyph ::\n   *     The source glyph slot.\n   *\n   *   sub_index ::\n   *     The index of the subglyph.  Must be less than\n   *     `glyph->num_subglyphs'.\n   *\n   * @output:\n   *   p_index ::\n   *     The glyph index of the subglyph.\n   *\n   *   p_flags ::\n   *     The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.\n   *\n   *   p_arg1 ::\n   *     The subglyph's first argument (if any).\n   *\n   *   p_arg2 ::\n   *     The subglyph's second argument (if any).\n   *\n   *   p_transform ::\n   *     The subglyph transformation (if any).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The values of `*p_arg1', `*p_arg2', and `*p_transform' must be\n   *   interpreted depending on the flags returned in `*p_flags'.  See the\n   *   TrueType specification for details.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FSTYPE_XXX                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `fsType' field of the OS/2 table   */\n  /*    in a TrueType or OpenType font and the `FSType' entry in a         */\n  /*    PostScript font.  These bit flags are returned by                  */\n  /*    @FT_Get_FSType_Flags; they inform client applications of embedding */\n  /*    and subsetting restrictions associated with a font.                */\n  /*                                                                       */\n  /*    See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for  */\n  /*    more details.                                                      */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING ::                                 */\n  /*      Fonts with no fsType bit set may be embedded and permanently     */\n  /*      installed on the remote system by an application.                */\n  /*                                                                       */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING ::                          */\n  /*      Fonts that have only this bit set must not be modified, embedded */\n  /*      or exchanged in any manner without first obtaining permission of */\n  /*      the font software copyright owner.                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING ::                           */\n  /*      If this bit is set, the font may be embedded and temporarily     */\n  /*      loaded on the remote system.  Documents containing Preview &     */\n  /*      Print fonts must be opened `read-only'; no edits can be applied  */\n  /*      to the document.                                                 */\n  /*                                                                       */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING ::                                    */\n  /*      If this bit is set, the font may be embedded but must only be    */\n  /*      installed temporarily on other systems.  In contrast to Preview  */\n  /*      & Print fonts, documents containing editable fonts may be opened */\n  /*      for reading, editing is permitted, and changes may be saved.     */\n  /*                                                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING ::                                         */\n  /*      If this bit is set, the font may not be subsetted prior to       */\n  /*      embedding.                                                       */\n  /*                                                                       */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY ::                                 */\n  /*      If this bit is set, only bitmaps contained in the font may be    */\n  /*      embedded; no outline data may be embedded.  If there are no      */\n  /*      bitmaps available in the font, then the font is unembeddable.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    While the fsType flags can indicate that a font may be embedded, a */\n  /*    license with the font vendor may be separately required to use the */\n  /*    font in this way.                                                  */\n  /*                                                                       */\n#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000\n#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002\n#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004\n#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008\n#define FT_FSTYPE_NO_SUBSETTING                 0x0100\n#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the fsType flags for a font.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The fsType flags, @FT_FSTYPE_XXX.                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use this function rather than directly reading the `fs_type' field */\n  /*    in the @PS_FontInfoRec structure which is only guaranteed to       */\n  /*    return the correct results for Type~1 fonts.                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.8                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UShort )\n  FT_Get_FSType_Flags( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_variants                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Variants                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 interface to Unicode Ideographic Variation          */\n  /*    Sequences (IVS), using the SFNT cmap format~14.                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Many CJK characters have variant forms.  They are a sort of grey   */\n  /*    area somewhere between being totally irrelevant and semantically   */\n  /*    distinct; for this reason, the Unicode consortium decided to       */\n  /*    introduce Ideographic Variation Sequences (IVS), consisting of a   */\n  /*    Unicode base character and one of 240 variant selectors            */\n  /*    (U+E0100-U+E01EF), instead of further extending the already huge   */\n  /*    code range for CJK characters.                                     */\n  /*                                                                       */\n  /*    An IVS is registered and unique; for further details please refer  */\n  /*    to Unicode Technical Report #37, the Ideographic Variation         */\n  /*    Database.  To date (October 2007), the character with the most     */\n  /*    variants is U+908A, having 8~such IVS.                             */\n  /*                                                                       */\n  /*    Adobe and MS decided to support IVS with a new cmap subtable       */\n  /*    (format~14).  It is an odd subtable because it is not a mapping of */\n  /*    input code points to glyphs, but contains lists of all variants    */\n  /*    supported by the font.                                             */\n  /*                                                                       */\n  /*    A variant may be either `default' or `non-default'.  A default     */\n  /*    variant is the one you will get for that code point if you look it */\n  /*    up in the standard Unicode cmap.  A non-default variant is a       */\n  /*    different glyph.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIndex                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code as modified by    */\n  /*    the variation selector.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character code point in Unicode.                             */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode code point of the variation selector.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means either `undefined character code', or    */\n  /*    `undefined selector code', or `no variation selector cmap          */\n  /*    subtable', or `current CharMap is not Unicode'.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value~0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  /*    This function is only meaningful if                                */\n  /*      a) the font has a variation selector cmap sub table,             */\n  /*    and                                                                */\n  /*      b) the current charmap has a Unicode encoding.                   */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Face_GetCharVariantIndex( FT_Face   face,\n                               FT_ULong  charcode,\n                               FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIsDefault                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether this variant of this Unicode character is the one to */\n  /*    be found in the `cmap'.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode codepoint of the variation selector.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if found in the standard (Unicode) cmap, 0~if found in the       */\n  /*    variation selector cmap, or -1 if it is not a variant.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is only meaningful if the font has a variation       */\n  /*    selector cmap subtable.                                            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Int )\n  FT_Face_GetCharVariantIsDefault( FT_Face   face,\n                                   FT_ULong  charcode,\n                                   FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantSelectors                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    in the font.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of selector code points, or NULL if there is */\n  /*    no valid variant selector cmap subtable.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantSelectors( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantsOfChar                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    for the specified character code.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of variant selector code points which are    */\n  /*    active for the given character, or NULL if the corresponding list  */\n  /*    is empty.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantsOfChar( FT_Face   face,\n                             FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharsOfVariant                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode character codes found for */\n  /*    the specified variant selector.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The variant selector code point in Unicode.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A list of all the code points which are specified by this selector */\n  /*    (both default and non-default codes are returned) or NULL if there */\n  /*    is no valid cmap or the variant selector is invalid.               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetCharsOfVariant( FT_Face   face,\n                             FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Computations                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Crunching fixed numbers and vectors.                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various functions used to perform            */\n  /*    computations on 16.16 fixed-float numbers or 2d vectors.           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_MulDiv                                                          */\n  /*    FT_MulFix                                                          */\n  /*    FT_DivFix                                                          */\n  /*    FT_RoundFix                                                        */\n  /*    FT_CeilFix                                                         */\n  /*    FT_FloorFix                                                        */\n  /*    FT_Vector_Transform                                                */\n  /*    FT_Matrix_Multiply                                                 */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    with maximal accuracy (it uses a 64-bit intermediate integer       */\n  /*    whenever necessary).                                               */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c );\n\n\n  /* */\n\n  /* The following #if 0 ... #endif is for the documentation formatter, */\n  /* hiding the internal `FT_MULFIX_INLINED' macro.                     */\n\n#if 0\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*b)/0x10000' with maximal accuracy.  Most of the time this is   */\n  /*    used to multiply a given value by a 16.16 fixed float factor.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/0x10000'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function has been optimized for the case where the absolute   */\n  /*    value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */\n  /*    As this happens mainly when scaling from notional units to         */\n  /*    fractional pixels in FreeType, it resulted in noticeable speed     */\n  /*    improvements between versions 2.x and 1.x.                         */\n  /*                                                                       */\n  /*    As a conclusion, always try to place a 16.16 factor as the         */\n  /*    _second_ argument of this function; this can make a great          */\n  /*    difference.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n\n  /* */\n#endif\n\n#ifdef FT_MULFIX_INLINED\n#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )\n#else\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_DivFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*0x10000)/b' with maximal accuracy.  Most of the time, this is  */\n  /*    used to divide a given value by a 16.16 fixed float factor.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*0x10000)/b'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The optimization for FT_DivFix() is simple: If (a~<<~16) fits in   */\n  /*    32~bits, then the division is computed directly.  Otherwise, we    */\n  /*    use a specialized version of @FT_MulDiv.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_RoundFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to round a 16.16 fixed number.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number to be rounded.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x8000) & -0x10000'.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_CeilFix                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the ceiling function of a   */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the ceiling function is to be computed.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FloorFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the floor function of a     */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the floor function is to be computed.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `a & -0x10000'.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Vector_Transform                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a single vector through a 2x2 matrix.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    vector :: The target vector to transform.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the source 2x2 matrix.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `vector' or `matrix' is invalid. */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Vector_Transform( FT_Vector*        vec,\n                       const FT_Matrix*  matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    version                                                            */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType Version                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions and macros related to FreeType versions.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Note that those functions and macros are of limited use because    */\n  /*    even a new release of FreeType with only documentation changes     */\n  /*    increases the version number.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FREETYPE_XXX\n   *\n   * @description:\n   *   These three macros identify the FreeType source code version.\n   *   Use @FT_Library_Version to access them at runtime.\n   *\n   * @values:\n   *   FREETYPE_MAJOR :: The major version number.\n   *   FREETYPE_MINOR :: The minor version number.\n   *   FREETYPE_PATCH :: The patch level.\n   *\n   * @note:\n   *   The version number of FreeType if built as a dynamic link library\n   *   with the `libtool' package is _not_ controlled by these three\n   *   macros.\n   *\n   */\n#define FREETYPE_MAJOR  2\n#define FREETYPE_MINOR  4\n#define FREETYPE_PATCH  6\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the version of the FreeType library being used.  This is    */\n  /*    useful when dynamically linking to the library, since one cannot   */\n  /*    use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and               */\n  /*    @FREETYPE_PATCH.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A source library handle.                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amajor  :: The major version number.                               */\n  /*                                                                       */\n  /*    aminor  :: The minor version number.                               */\n  /*                                                                       */\n  /*    apatch  :: The patch version number.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' argument is because */\n  /*    certain programs implement library initialization in a custom way  */\n  /*    that doesn't use @FT_Init_FreeType.                                */\n  /*                                                                       */\n  /*    In such cases, the library version might not be available before   */\n  /*    the library object has been created.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse all bytecode instructions of a TrueType font file to check   */\n  /*    whether any of the patented opcodes are used.  This is only useful */\n  /*    if you want to be able to use the unpatented hinter with           */\n  /*    fonts that do *not* use these opcodes.                             */\n  /*                                                                       */\n  /*    Note that this function parses *all* glyph instructions in the     */\n  /*    font file, which may be slow.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face handle.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if this is a TrueType font that uses one of the patented         */\n  /*    opcodes, 0~otherwise.                                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Enable or disable the unpatented hinter for a given face.          */\n  /*    Only enable it if you have determined that the face doesn't        */\n  /*    use any patented opcodes (see @FT_Face_CheckTrueTypePatents).      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A face handle.                                            */\n  /*                                                                       */\n  /*    value :: New boolean setting.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The old setting value.  This will always be false if this is not   */\n  /*    an SFNT font, or if the unpatented hinter is not compiled in this  */\n  /*    instance of the library.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FREETYPE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftadvanc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftadvanc.h                                                             */\n/*                                                                         */\n/*    Quick computation of advance widths (specification only).            */\n/*                                                                         */\n/*  Copyright 2008 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTADVANC_H__\n#define __FTADVANC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   quick_advance\n   *\n   * @title:\n   *   Quick retrieval of advance values\n   *\n   * @abstract:\n   *   Retrieve horizontal and vertical advance values without processing\n   *   glyph outlines, if possible.\n   *\n   * @description:\n   *   This section contains functions to quickly extract advance values\n   *   without handling glyph outlines, if possible.\n   */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_ADVANCE_FLAG_FAST_ONLY                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A bit-flag to be OR-ed with the `flags' parameter of the           */\n  /*    @FT_Get_Advance and @FT_Get_Advances functions.                    */\n  /*                                                                       */\n  /*    If set, it indicates that you want these functions to fail if the  */\n  /*    corresponding hinting mode or font driver doesn't allow for very   */\n  /*    quick advance computation.                                         */\n  /*                                                                       */\n  /*    Typically, glyphs which are either unscaled, unhinted, bitmapped,  */\n  /*    or light-hinted can have their advance width computed very         */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /*    Normal and bytecode hinted modes, which require loading, scaling,  */\n  /*    and hinting of the glyph outline, are extremely slow by            */\n  /*    comparison.                                                        */\n  /*                                                                       */\n#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advance                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance value of a given glyph outline in an          */\n  /*    @FT_Face.  By default, the unhinted advance is returned in font    */\n  /*    units.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: The source @FT_Face handle.                          */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /*    load_flags :: A set of bit flags similar to those used when        */\n  /*                  calling @FT_Load_Glyph, used to determine what kind  */\n  /*                  of advances you need.                                */\n  /* <Output>                                                              */\n  /*    padvance :: The advance value, in either font units or 16.16       */\n  /*                format.                                                */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */\n  /*                vertical advance corresponding to a vertical layout.   */\n  /*                Otherwise, it is the horizontal advance in a           */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    A scaled advance is returned in 16.16 format but isn't transformed */\n  /*    by the affine transformation specified by @FT_Set_Transform.       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advance( FT_Face    face,\n                  FT_UInt    gindex,\n                  FT_Int32   load_flags,\n                  FT_Fixed  *padvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advances                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance values of several glyph outlines in an        */\n  /*    @FT_Face.  By default, the unhinted advances are returned in font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: The source @FT_Face handle.                         */\n  /*                                                                       */\n  /*    start       :: The first glyph index.                              */\n  /*                                                                       */\n  /*    count       :: The number of advance values you want to retrieve.  */\n  /*                                                                       */\n  /*    load_flags  :: A set of bit flags similar to those used when       */\n  /*                   calling @FT_Load_Glyph.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    padvance :: The advances, in either font units or 16.16 format.    */\n  /*                This array must contain at least `count' elements.     */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */\n  /*                vertical advances corresponding to a vertical layout.  */\n  /*                Otherwise, they are the horizontal advances in a       */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    Scaled advances are returned in 16.16 format but aren't            */\n  /*    transformed by the affine transformation specified by              */\n  /*    @FT_Set_Transform.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advances( FT_Face    face,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed  *padvances );\n\n/* */\n\n\nFT_END_HEADER\n\n#endif /* __FTADVANC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftbbox.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.h                                                               */\n/*                                                                         */\n/*    FreeType exact bbox computation (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /* It is separated from the rest of the engine for various technical     */\n  /* reasons.  It may well be integrated in `ftoutln' later.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTBBOX_H__\n#define __FTBBOX_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the exact bounding box of an outline.  This is slower      */\n  /*    than computing the control box.  However, it uses an advanced      */\n  /*    algorithm which returns _very_ quickly when the two boxes          */\n  /*    coincide.  Otherwise, the outline Bézier arcs are traversed to     */\n  /*    extract their extrema.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abbox   :: The outline's exact bounding box.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get      */\n  /*    reasonable values for the BBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the BBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBBOX_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (specification).     */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2009 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBDF_H__\n#define __FTBDF_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bdf_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BDF and PCF Files                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    BDF and PCF specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions specific to BDF */\n  /*    and PCF fonts.                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @enum:\n   *    FT_PropertyType\n   *\n   * @description:\n   *    A list of BDF property types.\n   *\n   * @values:\n   *    BDF_PROPERTY_TYPE_NONE ::\n   *      Value~0 is used to indicate a missing property.\n   *\n   *    BDF_PROPERTY_TYPE_ATOM ::\n   *      Property is a string atom.\n   *\n   *    BDF_PROPERTY_TYPE_INTEGER ::\n   *      Property is a 32-bit signed integer.\n   *\n   *    BDF_PROPERTY_TYPE_CARDINAL ::\n   *      Property is a 32-bit unsigned integer.\n   */\n  typedef enum  BDF_PropertyType_\n  {\n    BDF_PROPERTY_TYPE_NONE     = 0,\n    BDF_PROPERTY_TYPE_ATOM     = 1,\n    BDF_PROPERTY_TYPE_INTEGER  = 2,\n    BDF_PROPERTY_TYPE_CARDINAL = 3\n\n  } BDF_PropertyType;\n\n\n  /**********************************************************************\n   *\n   * @type:\n   *    BDF_Property\n   *\n   * @description:\n   *    A handle to a @BDF_PropertyRec structure to model a given\n   *    BDF/PCF property.\n   */\n  typedef struct BDF_PropertyRec_*  BDF_Property;\n\n\n /**********************************************************************\n  *\n  * @struct:\n  *    BDF_PropertyRec\n  *\n  * @description:\n  *    This structure models a given BDF/PCF property.\n  *\n  * @fields:\n  *    type ::\n  *      The property type.\n  *\n  *    u.atom ::\n  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.\n  *\n  *    u.integer ::\n  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.\n  *\n  *    u.cardinal ::\n  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.\n  */\n  typedef struct  BDF_PropertyRec_\n  {\n    BDF_PropertyType  type;\n    union {\n      const char*     atom;\n      FT_Int32        integer;\n      FT_UInt32       cardinal;\n\n    } u;\n\n  } BDF_PropertyRec;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Charset_ID\n  *\n  * @description:\n  *    Retrieve a BDF font character set identity, according to\n  *    the BDF specification.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  * @output:\n  *    acharset_encoding ::\n  *       Charset encoding, as a C~string, owned by the face.\n  *\n  *    acharset_registry ::\n  *       Charset registry, as a C~string, owned by the face.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with BDF faces, returning an error otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Property\n  *\n  * @description:\n  *    Retrieve a BDF property from a BDF or PCF font file.\n  *\n  * @input:\n  *    face :: A handle to the input face.\n  *\n  *    name :: The property name.\n  *\n  * @output:\n  *    aproperty :: The property.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function works with BDF _and_ PCF fonts.  It returns an error\n  *   otherwise.  It also returns an error if the property is not in the\n  *   font.\n  *\n  *   A `property' is a either key-value pair within the STARTPROPERTIES\n  *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the\n  *   `info->props' array within a `FontRec' structure of a PCF font.\n  *\n  *   Integer properties are always stored as `signed' within PCF fonts;\n  *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value\n  *   for BDF fonts only.\n  *\n  *   In case of error, `aproperty->type' is always set to\n  *   @BDF_PROPERTY_TYPE_NONE.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftbitmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.h                                                             */\n/*                                                                         */\n/*    FreeType utility functions for bitmaps (specification).              */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006, 2008 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBITMAP_H__\n#define __FTBITMAP_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bitmap_handling                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Bitmap Handling                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Handling FT_Bitmap objects.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains functions for converting FT_Bitmap objects.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_New                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a pointer to an @FT_Bitmap structure.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the bitmap structure.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Copy                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy a bitmap into another one.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    source  :: A handle to the source bitmap.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target  :: A handle to the target bitmap.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Embolden                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\n  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\n  /*    borders are kept unchanged.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /*    yStrength :: How strong the glyph is emboldened vertically.        */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    bitmap    :: A handle to the target bitmap.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The current implementation restricts `xStrength' to be less than   */\n  /*    or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\n  /*                                                                       */\n  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */\n  /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Convert                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a  */\n  /*    bitmap object with depth 8bpp, making the number of used bytes per */\n  /*    line (a.k.a. the `pitch') a multiple of `alignment'.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    source    :: The source bitmap.                                    */\n  /*                                                                       */\n  /*    alignment :: The pitch of the bitmap is a multiple of this         */\n  /*                 parameter.  Common values are 1, 2, or 4.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target    :: The target bitmap.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\n  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\n  /*                                                                       */\n  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\n  /*                                                                       */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GlyphSlot_Own_Bitmap                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Make sure that a glyph slot owns `slot->bitmap'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: The glyph slot.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is to be used in combination with                    */\n  /*    @FT_Bitmap_Embolden.                                               */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    bitmap  :: The bitmap object to be freed.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBITMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftbzip2.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbzip2.h                                                              */\n/*                                                                         */\n/*    Bzip2-compressed stream support.                                     */\n/*                                                                         */\n/*  Copyright 2010 by                                                      */\n/*  Joel Klinghed.                                                         */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBZIP2_H__\n#define __FTBZIP2_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bzip2                                                              */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BZIP2 Streams                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using bzip2-compressed font files.                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Bzip2-specific functions. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenBzip2\n  *\n  * @description:\n  *   Open a new stream to parse bzip2-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.bz2' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, bzip2 compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a bzip2 compressed stream\n  *   from it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with bzip2 support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBZIP2_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftcache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.h                                                              */\n/*                                                                         */\n/*    FreeType Cache subsystem (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCACHE_H__\n#define __FTCACHE_H__\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************\n   *\n   * <Section>\n   *    cache_subsystem\n   *\n   * <Title>\n   *    Cache Sub-System\n   *\n   * <Abstract>\n   *    How to cache face, size, and glyph data with FreeType~2.\n   *\n   * <Description>\n   *   This section describes the FreeType~2 cache sub-system, which is used\n   *   to limit the number of concurrently opened @FT_Face and @FT_Size\n   *   objects, as well as caching information like character maps and glyph\n   *   images while limiting their maximum memory usage.\n   *\n   *   Note that all types and functions begin with the `FTC_' prefix.\n   *\n   *   The cache is highly portable and thus doesn't know anything about the\n   *   fonts installed on your system, or how to access them.  This implies\n   *   the following scheme:\n   *\n   *   First, available or installed font faces are uniquely identified by\n   *   @FTC_FaceID values, provided to the cache by the client.  Note that\n   *   the cache only stores and compares these values, and doesn't try to\n   *   interpret them in any way.\n   *\n   *   Second, the cache calls, only when needed, a client-provided function\n   *   to convert an @FTC_FaceID into a new @FT_Face object.  The latter is\n   *   then completely managed by the cache, including its termination\n   *   through @FT_Done_Face.  To monitor termination of face objects, the\n   *   finalizer callback in the `generic' field of the @FT_Face object can\n   *   be used, which might also be used to store the @FTC_FaceID of the\n   *   face.\n   *\n   *   Clients are free to map face IDs to anything else.  The most simple\n   *   usage is to associate them to a (pathname,face_index) pair that is\n   *   used to call @FT_New_Face.  However, more complex schemes are also\n   *   possible.\n   *\n   *   Note that for the cache to work correctly, the face ID values must be\n   *   *persistent*, which means that the contents they point to should not\n   *   change at runtime, or that their value should not become invalid.\n   *\n   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),\n   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let\n   *   the cache get rid of any references to the old @FTC_FaceID it may\n   *   keep internally.  Failure to do so will lead to incorrect behaviour\n   *   or even crashes.\n   *\n   *   To use the cache, start with calling @FTC_Manager_New to create a new\n   *   @FTC_Manager object, which models a single cache instance.  You can\n   *   then look up @FT_Face and @FT_Size objects with\n   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.\n   *\n   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then\n   *   later use @FTC_CMapCache_Lookup to perform the equivalent of\n   *   @FT_Get_Char_Index, only much faster.\n   *\n   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then\n   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding\n   *   @FT_Glyph objects from the cache.\n   *\n   *   If you need lots of small bitmaps, it is much more memory efficient\n   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This\n   *   returns @FTC_SBitRec structures, which are used to store small\n   *   bitmaps directly.  (A small bitmap is one whose metrics and\n   *   dimensions all fit into 8-bit integers).\n   *\n   *   We hope to also provide a kerning cache in the near future.\n   *\n   *\n   * <Order>\n   *   FTC_Manager\n   *   FTC_FaceID\n   *   FTC_Face_Requester\n   *\n   *   FTC_Manager_New\n   *   FTC_Manager_Reset\n   *   FTC_Manager_Done\n   *   FTC_Manager_LookupFace\n   *   FTC_Manager_LookupSize\n   *   FTC_Manager_RemoveFaceID\n   *\n   *   FTC_Node\n   *   FTC_Node_Unref\n   *\n   *   FTC_ImageCache\n   *   FTC_ImageCache_New\n   *   FTC_ImageCache_Lookup\n   *\n   *   FTC_SBit\n   *   FTC_SBitCache\n   *   FTC_SBitCache_New\n   *   FTC_SBitCache_Lookup\n   *\n   *   FTC_CMapCache\n   *   FTC_CMapCache_New\n   *   FTC_CMapCache_Lookup\n   *\n   *************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    BASIC TYPE DEFINITIONS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type: FTC_FaceID\n   *\n   * @description:\n   *   An opaque pointer type that is used to identity face objects.  The\n   *   contents of such objects is application-dependent.\n   *\n   *   These pointers are typically used to point to a user-defined\n   *   structure containing a font file path, and face index.\n   *\n   * @note:\n   *   Never use NULL as a valid @FTC_FaceID.\n   *\n   *   Face IDs are passed by the client to the cache manager, which calls,\n   *   when needed, the @FTC_Face_Requester to translate them into new\n   *   @FT_Face objects.\n   *\n   *   If the content of a given face ID changes at runtime, or if the value\n   *   becomes invalid (e.g., when uninstalling a font), you should\n   *   immediately call @FTC_Manager_RemoveFaceID before any other cache\n   *   function.\n   *\n   *   Failure to do so will result in incorrect behaviour or even\n   *   memory leaks and crashes.\n   */\n  typedef FT_Pointer  FTC_FaceID;\n\n\n  /************************************************************************\n   *\n   * @functype:\n   *   FTC_Face_Requester\n   *\n   * @description:\n   *   A callback function provided by client applications.  It is used by\n   *   the cache manager to translate a given @FTC_FaceID into a new valid\n   *   @FT_Face object, on demand.\n   *\n   * <Input>\n   *   face_id ::\n   *     The face ID to resolve.\n   *\n   *   library ::\n   *     A handle to a FreeType library object.\n   *\n   *   req_data ::\n   *     Application-provided request data (see note below).\n   *\n   * <Output>\n   *   aface ::\n   *     A new @FT_Face handle.\n   *\n   * <Return>\n   *   FreeType error code.  0~means success.\n   *\n   * <Note>\n   *   The third parameter `req_data' is the same as the one passed by the\n   *   client when @FTC_Manager_New is called.\n   *\n   *   The face requester should not perform funny things on the returned\n   *   face object, like creating a new @FT_Size for it, or setting a\n   *   transformation through @FT_Set_Transform!\n   */\n  typedef FT_Error\n  (*FTC_Face_Requester)( FTC_FaceID  face_id,\n                         FT_Library  library,\n                         FT_Pointer  request_data,\n                         FT_Face*    aface );\n\n /* */\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /* these macros are incompatible with LLP64, should not be used */\n\n#define FT_POINTER_TO_ULONG( p )  ( (FT_ULong)(FT_Pointer)(p) )\n\n#define FTC_FACE_ID_HASH( i )                                \\\n          ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^   \\\n                       ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CACHE MANAGER OBJECT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Manager                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This object corresponds to one instance of the cache-subsystem.    */\n  /*    It is used to cache one or more @FT_Face objects, along with       */\n  /*    corresponding @FT_Size objects.                                    */\n  /*                                                                       */\n  /*    The manager intentionally limits the total number of opened        */\n  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */\n  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */\n  /*                                                                       */\n  /*    The manager is also used to cache `nodes' of various types while   */\n  /*    limiting their total memory usage.                                 */\n  /*                                                                       */\n  /*    All limitations are enforced by keeping lists of managed objects   */\n  /*    in most-recently-used order, and flushing old nodes to make room   */\n  /*    for new ones.                                                      */\n  /*                                                                       */\n  typedef struct FTC_ManagerRec_*  FTC_Manager;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Node                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to a cache node object.  Each cache node is       */\n  /*    reference-counted.  A node with a count of~0 might be flushed      */\n  /*    out of a full cache whenever a lookup request is performed.        */\n  /*                                                                       */\n  /*    If you look up nodes, you have the ability to `acquire' them,      */\n  /*    i.e., to increment their reference count.  This will prevent the   */\n  /*    node from being flushed out of the cache until you explicitly      */\n  /*    `release' it (see @FTC_Node_Unref).                                */\n  /*                                                                       */\n  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */\n  /*                                                                       */\n  typedef struct FTC_NodeRec_*  FTC_Node;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_New                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache manager.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: The parent FreeType library handle to use.            */\n  /*                                                                       */\n  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */\n  /*                 Use~0 for defaults.  Note that this value does not    */\n  /*                 account for managed @FT_Face and @FT_Size objects.    */\n  /*                                                                       */\n  /*    requester :: An application-provided callback used to translate    */\n  /*                 face IDs into real @FT_Face objects.                  */\n  /*                                                                       */\n  /*    req_data  :: A generic pointer that is passed to the requester     */\n  /*                 each time it is called (see @FTC_Face_Requester).     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amanager  :: A handle to a new manager object.  0~in case of       */\n  /*                 failure.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Reset                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Empty a given cache manager.  This simply gets rid of all the      */\n  /*    currently cached @FT_Face and @FT_Size objects within the manager. */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the manager.                                */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Reset( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given manager after emptying it.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the target cache manager object.            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Done( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupFace                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Face object that corresponds to a given face ID   */\n  /*    through a cache manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    face_id :: The ID of the face object.                              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface   :: A handle to the face object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Face object is always owned by the manager.  You  */\n  /*    should never try to discard it yourself.                           */\n  /*                                                                       */\n  /*    The @FT_Face object doesn't necessarily have a current size object */\n  /*    (i.e., face->size can be 0).  If you need a specific `font size',  */\n  /*    use @FTC_Manager_LookupSize instead.                               */\n  /*                                                                       */\n  /*    Never change the face's transformation matrix (i.e., never call    */\n  /*    the @FT_Set_Transform function) on a returned face!  If you need   */\n  /*    to transform glyphs, do it yourself after glyph loading.           */\n  /*                                                                       */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory was available */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_ScalerRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a given character size in either      */\n  /*    pixels or points to the cache manager.  See                        */\n  /*    @FTC_Manager_LookupSize.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id :: The source face ID.                                     */\n  /*                                                                       */\n  /*    width   :: The character width.                                    */\n  /*                                                                       */\n  /*    height  :: The character height.                                   */\n  /*                                                                       */\n  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */\n  /*               interpreted as integer pixel character sizes.           */\n  /*               Otherwise, they are expressed as 1/64th of points.      */\n  /*                                                                       */\n  /*    x_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               horizontal resolution in dpi.                           */\n  /*                                                                       */\n  /*    y_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               vertical resolution in dpi.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This type is mainly used to retrieve @FT_Size objects through the  */\n  /*    cache manager.                                                     */\n  /*                                                                       */\n  typedef struct  FTC_ScalerRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     width;\n    FT_UInt     height;\n    FT_Int      pixel;\n    FT_UInt     x_res;\n    FT_UInt     y_res;\n\n  } FTC_ScalerRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_Scaler                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FTC_ScalerRec structure.                           */\n  /*                                                                       */\n  typedef struct FTC_ScalerRec_*  FTC_Scaler;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupSize                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Size object that corresponds to a given           */\n  /*    @FTC_ScalerRec pointer through a cache manager.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    scaler  :: A scaler handle.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize   :: A handle to the size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Size object is always owned by the manager.  You  */\n  /*    should never try to discard it by yourself.                        */\n  /*                                                                       */\n  /*    You can access the parent @FT_Face object simply as `size->face'   */\n  /*    if you need it.  Note that this object is also owned by the        */\n  /*    manager.                                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory is available  */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Node_Unref                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Decrement a cache node's internal reference count.  When the count */\n  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */\n  /*    cache flushes.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node    :: The cache node handle.                                  */\n  /*                                                                       */\n  /*    manager :: The cache manager handle.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_Manager_RemoveFaceID\n   *\n   * @description:\n   *   A special function used to indicate to the cache manager that\n   *   a given @FTC_FaceID is no longer valid, either because its\n   *   content changed, or because it was deallocated or uninstalled.\n   *\n   * @input:\n   *   manager ::\n   *     The cache manager handle.\n   *\n   *   face_id ::\n   *     The @FTC_FaceID to be removed.\n   *\n   * @note:\n   *   This function flushes all nodes from the cache corresponding to this\n   *   `face_id', with the exception of nodes with a non-null reference\n   *   count.\n   *\n   *   Such nodes are however modified internally so as to never appear\n   *   in later lookups with the same `face_id' value, and to be immediately\n   *   destroyed when released by all their users.\n   *\n   */\n  FT_EXPORT( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_CMapCache\n   *\n   * @description:\n   *   An opaque handle used to model a charmap cache.  This cache is to\n   *   hold character codes -> glyph indices mappings.\n   *\n   */\n  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_New\n   *\n   * @description:\n   *   Create a new charmap cache.\n   *\n   * @input:\n   *   manager ::\n   *     A handle to the cache manager.\n   *\n   * @output:\n   *   acache ::\n   *     A new cache handle.  NULL in case of error.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Like all other caches, this one will be destroyed with the cache\n   *   manager.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_Lookup\n   *\n   * @description:\n   *   Translate a character code into a glyph index, using the charmap\n   *   cache.\n   *\n   * @input:\n   *   cache ::\n   *     A charmap cache handle.\n   *\n   *   face_id ::\n   *     The source face ID.\n   *\n   *   cmap_index ::\n   *     The index of the charmap in the source face.  Any negative value\n   *     means to use the cache @FT_Face's default charmap.\n   *\n   *   char_code ::\n   *     The character code (in the corresponding charmap).\n   *\n   * @return:\n   *    Glyph index.  0~means `no glyph'.\n   *\n   */\n  FT_EXPORT( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       IMAGE CACHE OBJECT                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FTC_ImageTypeRec\n   *\n   * @description:\n   *   A structure used to model the type of images in a glyph cache.\n   *\n   * @fields:\n   *   face_id ::\n   *     The face ID.\n   *\n   *   width ::\n   *     The width in pixels.\n   *\n   *   height ::\n   *     The height in pixels.\n   *\n   *   flags ::\n   *     The load flags, as in @FT_Load_Glyph.\n   *\n   */\n  typedef struct  FTC_ImageTypeRec_\n  {\n    FTC_FaceID  face_id;\n    FT_Int      width;\n    FT_Int      height;\n    FT_Int32    flags;\n\n  } FTC_ImageTypeRec;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_ImageType\n   *\n   * @description:\n   *   A handle to an @FTC_ImageTypeRec structure.\n   *\n   */\n  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;\n\n\n  /* */\n\n\n#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \\\n          ( (d1)->face_id == (d2)->face_id && \\\n            (d1)->width   == (d2)->width   && \\\n            (d1)->flags   == (d2)->flags   )\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /* this macro is incompatible with LLP64, should not be used */\n\n#define FTC_IMAGE_TYPE_HASH( d )                          \\\n          (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id )  ^ \\\n                      ( (d)->width << 8 ) ^ (d)->height ^ \\\n                      ( (d)->flags << 4 )               )\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_ImageCache                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an glyph image cache object.  They are designed to     */\n  /*    hold many distinct glyph images while not exceeding a certain      */\n  /*    memory threshold.                                                  */\n  /*                                                                       */\n  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_New                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new glyph image cache.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: The parent manager for the image cache.                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new glyph image cache object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_Lookup                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a given glyph image from a glyph image cache.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source glyph image cache.                */\n  /*                                                                       */\n  /*    type   :: A pointer to a glyph image type descriptor.              */\n  /*                                                                       */\n  /*    gindex :: The glyph index to retrieve.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: The corresponding @FT_Glyph object.  0~in case of        */\n  /*              failure.                                                 */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_LookupScaler                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source glyph image cache.            */\n  /*                                                                       */\n  /*    scaler     :: A pointer to a scaler descriptor.                    */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index to retrieve.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph     :: The corresponding @FT_Glyph object.  0~in case of    */\n  /*                  failure.                                             */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */\n  /*    glyphs; you should always use the FreeType cache API instead.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBit                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */\n  /*    structure for details.                                             */\n  /*                                                                       */\n  typedef struct FTC_SBitRec_*  FTC_SBit;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_SBitRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very compact structure used to describe a small glyph bitmap.    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width     :: The bitmap width in pixels.                           */\n  /*                                                                       */\n  /*    height    :: The bitmap height in pixels.                          */\n  /*                                                                       */\n  /*    left      :: The horizontal distance from the pen position to the  */\n  /*                 left bitmap border (a.k.a. `left side bearing', or    */\n  /*                 `lsb').                                               */\n  /*                                                                       */\n  /*    top       :: The vertical distance from the pen position (on the   */\n  /*                 baseline) to the upper bitmap border (a.k.a. `top     */\n  /*                 side bearing').  The distance is positive for upwards */\n  /*                 y~coordinates.                                        */\n  /*                                                                       */\n  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */\n  /*                                                                       */\n  /*    max_grays :: Maximum gray level value (in the range 1 to~255).     */\n  /*                                                                       */\n  /*    pitch     :: The number of bytes per bitmap line.  May be positive */\n  /*                 or negative.                                          */\n  /*                                                                       */\n  /*    xadvance  :: The horizontal advance width in pixels.               */\n  /*                                                                       */\n  /*    yadvance  :: The vertical advance height in pixels.                */\n  /*                                                                       */\n  /*    buffer    :: A pointer to the bitmap pixels.                       */\n  /*                                                                       */\n  typedef struct  FTC_SBitRec_\n  {\n    FT_Byte   width;\n    FT_Byte   height;\n    FT_Char   left;\n    FT_Char   top;\n\n    FT_Byte   format;\n    FT_Byte   max_grays;\n    FT_Short  pitch;\n    FT_Char   xadvance;\n    FT_Char   yadvance;\n\n    FT_Byte*  buffer;\n\n  } FTC_SBitRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBitCache                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap cache.  These are special cache objects */\n  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */\n  /*    much more efficient way than the traditional glyph image cache     */\n  /*    implemented by @FTC_ImageCache.                                    */\n  /*                                                                       */\n  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_New                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache to store small glyph bitmaps.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the source cache manager.                   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_Lookup                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Look up a given small glyph bitmap in a given sbit cache and       */\n  /*    `lock' it to prevent its flushing from the cache until needed.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source sbit cache.                       */\n  /*                                                                       */\n  /*    type   :: A pointer to the glyph image type descriptor.            */\n  /*                                                                       */\n  /*    gindex :: The glyph index.                                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit   :: A handle to a small bitmap descriptor.                   */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache    cache,\n                        FTC_ImageType    type,\n                        FT_UInt          gindex,\n                        FTC_SBit        *sbit,\n                        FTC_Node        *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_LookupScaler                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source sbit cache.                   */\n  /*                                                                       */\n  /*    scaler     :: A pointer to the scaler descriptor.                  */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit       :: A handle to a small bitmap descriptor.               */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *sbit,\n                              FTC_Node      *anode );\n\n\n /* */\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_FontRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to describe a given `font' to the cache    */\n  /*    manager.  Note that a `font' is the combination of a given face    */\n  /*    with a given character size.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id    :: The ID of the face to use.                           */\n  /*                                                                       */\n  /*    pix_width  :: The character width in integer pixels.               */\n  /*                                                                       */\n  /*    pix_height :: The character height in integer pixels.              */\n  /*                                                                       */\n  typedef struct  FTC_FontRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UShort   pix_width;\n    FT_UShort   pix_height;\n\n  } FTC_FontRec;\n\n\n  /* */\n\n\n#define FTC_FONT_COMPARE( f1, f2 )                  \\\n          ( (f1)->face_id    == (f2)->face_id    && \\\n            (f1)->pix_width  == (f2)->pix_width  && \\\n            (f1)->pix_height == (f2)->pix_height )\n\n  /* this macro is incompatible with LLP64, should not be used */\n#define FTC_FONT_HASH( f )                              \\\n          (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \\\n                       ((f)->pix_width << 8)          ^ \\\n                       ((f)->pix_height)              )\n\n  typedef FTC_FontRec*  FTC_Font;\n\n\n  FT_EXPORT( FT_Error )\n  FTC_Manager_Lookup_Face( FTC_Manager  manager,\n                           FTC_FaceID   face_id,\n                           FT_Face     *aface );\n\n  FT_EXPORT( FT_Error )\n  FTC_Manager_Lookup_Size( FTC_Manager  manager,\n                           FTC_Font     font,\n                           FT_Face     *aface,\n                           FT_Size     *asize );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftchapters.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/* This file defines the structure of the FreeType reference.              */\n/* It is used by the python script which generates the HTML files.         */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    general_remarks                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    General Remarks                                                      */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    user_allocation                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    core_api                                                             */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Core API                                                             */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    version                                                              */\n/*    basic_types                                                          */\n/*    base_interface                                                       */\n/*    glyph_variants                                                       */\n/*    glyph_management                                                     */\n/*    mac_specific                                                         */\n/*    sizes_management                                                     */\n/*    header_file_macros                                                   */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    format_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Format-Specific API                                                  */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    multiple_masters                                                     */\n/*    truetype_tables                                                      */\n/*    type1_tables                                                         */\n/*    sfnt_names                                                           */\n/*    bdf_fonts                                                            */\n/*    cid_fonts                                                            */\n/*    pfr_fonts                                                            */\n/*    winfnt_fonts                                                         */\n/*    font_formats                                                         */\n/*    gasp_table                                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Cache Sub-System                                                     */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    support_api                                                          */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Support API                                                          */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    computations                                                         */\n/*    list_processing                                                      */\n/*    outline_processing                                                   */\n/*    quick_advance                                                        */\n/*    bitmap_handling                                                      */\n/*    raster                                                               */\n/*    glyph_stroker                                                        */\n/*    system_interface                                                     */\n/*    module_management                                                    */\n/*    gzip                                                                 */\n/*    lzw                                                                  */\n/*    bzip2                                                                */\n/*    lcd_filtering                                                        */\n/*                                                                         */\n/***************************************************************************/\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcid.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing CID font information (specification).     */\n/*                                                                         */\n/*  Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal.                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCID_H__\n#define __FTCID_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cid_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    CID Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    CID-keyed font specific API.                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of CID-keyed font specific   */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Registry_Ordering_Supplement\n   *\n   * @description:\n   *    Retrieve the Registry/Ordering/Supplement triple (also known as the\n   *    \"R/O/S\") from a CID-keyed font.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    registry ::\n   *       The registry, as a C~string, owned by the face.\n   *\n   *    ordering ::\n   *       The ordering, as a C~string, owned by the face.\n   *\n   *    supplement ::\n   *       The supplement.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces, returning an error\n   *    otherwise.\n   *\n   * @since:\n   *    2.3.6\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,\n                                           const char*  *registry,\n                                           const char*  *ordering,\n                                           FT_Int       *supplement);\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Is_Internally_CID_Keyed\n   *\n   * @description:\n   *    Retrieve the type of the input face, CID keyed or not.  In\n   *    constrast to the @FT_IS_CID_KEYED macro this function returns\n   *    successfully also for CID-keyed fonts in an SNFT wrapper.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    is_cid ::\n   *       The type of the face as an @FT_Bool.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,\n                                      FT_Bool  *is_cid );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_From_Glyph_Index\n   *\n   * @description:\n   *    Retrieve the CID of the input glyph index.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   *    glyph_index ::\n   *       The input glyph index.\n   *\n   * @output:\n   *    cid ::\n   *       The CID as an @FT_UInt.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_From_Glyph_Index( FT_Face   face,\n                               FT_UInt   glyph_index,\n                               FT_UInt  *cid );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/fterrdef.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrdef.h                                                             */\n/*                                                                         */\n/*    FreeType error codes (specification).                                */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2006, 2007, 2010 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                LIST OF ERROR CODES/MESSAGES             *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n  /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */\n  /* including this file.                                           */\n\n\n  /* generic errors */\n\n  FT_NOERRORDEF_( Ok,                                        0x00, \\\n                  \"no error\" )\n\n  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \\\n                \"cannot open resource\" )\n  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \\\n                \"unknown file format\" )\n  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \\\n                \"broken file\" )\n  FT_ERRORDEF_( Invalid_Version,                             0x04, \\\n                \"invalid FreeType version\" )\n  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \\\n                \"module version is too low\" )\n  FT_ERRORDEF_( Invalid_Argument,                            0x06, \\\n                \"invalid argument\" )\n  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \\\n                \"unimplemented feature\" )\n  FT_ERRORDEF_( Invalid_Table,                               0x08, \\\n                \"broken table\" )\n  FT_ERRORDEF_( Invalid_Offset,                              0x09, \\\n                \"broken offset within table\" )\n  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \\\n                \"array allocation size too large\" )\n\n  /* glyph/character errors */\n\n  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \\\n                \"invalid glyph index\" )\n  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \\\n                \"invalid character code\" )\n  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \\\n                \"unsupported glyph image format\" )\n  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \\\n                \"cannot render this glyph format\" )\n  FT_ERRORDEF_( Invalid_Outline,                             0x14, \\\n                \"invalid outline\" )\n  FT_ERRORDEF_( Invalid_Composite,                           0x15, \\\n                \"invalid composite glyph\" )\n  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \\\n                \"too many hints\" )\n  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \\\n                \"invalid pixel size\" )\n\n  /* handle errors */\n\n  FT_ERRORDEF_( Invalid_Handle,                              0x20, \\\n                \"invalid object handle\" )\n  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \\\n                \"invalid library handle\" )\n  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \\\n                \"invalid module handle\" )\n  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \\\n                \"invalid face handle\" )\n  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \\\n                \"invalid size handle\" )\n  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \\\n                \"invalid glyph slot handle\" )\n  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \\\n                \"invalid charmap handle\" )\n  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \\\n                \"invalid cache manager handle\" )\n  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \\\n                \"invalid stream handle\" )\n\n  /* driver errors */\n\n  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \\\n                \"too many modules\" )\n  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \\\n                \"too many extensions\" )\n\n  /* memory errors */\n\n  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \\\n                \"out of memory\" )\n  FT_ERRORDEF_( Unlisted_Object,                             0x41, \\\n                \"unlisted object\" )\n\n  /* stream errors */\n\n  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \\\n                \"cannot open stream\" )\n  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \\\n                \"invalid stream seek\" )\n  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \\\n                \"invalid stream skip\" )\n  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \\\n                \"invalid stream read\" )\n  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \\\n                \"invalid stream operation\" )\n  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \\\n                \"invalid frame operation\" )\n  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \\\n                \"nested frame access\" )\n  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \\\n                \"invalid frame read\" )\n\n  /* raster errors */\n\n  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \\\n                \"raster uninitialized\" )\n  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \\\n                \"raster corrupted\" )\n  FT_ERRORDEF_( Raster_Overflow,                             0x62, \\\n                \"raster overflow\" )\n  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \\\n                \"negative height while rastering\" )\n\n  /* cache errors */\n\n  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \\\n                \"too many registered caches\" )\n\n  /* TrueType and SFNT errors */\n\n  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \\\n                \"invalid opcode\" )\n  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \\\n                \"too few arguments\" )\n  FT_ERRORDEF_( Stack_Overflow,                              0x82, \\\n                \"stack overflow\" )\n  FT_ERRORDEF_( Code_Overflow,                               0x83, \\\n                \"code overflow\" )\n  FT_ERRORDEF_( Bad_Argument,                                0x84, \\\n                \"bad argument\" )\n  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \\\n                \"division by zero\" )\n  FT_ERRORDEF_( Invalid_Reference,                           0x86, \\\n                \"invalid reference\" )\n  FT_ERRORDEF_( Debug_OpCode,                                0x87, \\\n                \"found debug opcode\" )\n  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \\\n                \"found ENDF opcode in execution stream\" )\n  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \\\n                \"nested DEFS\" )\n  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \\\n                \"invalid code range\" )\n  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \\\n                \"execution context too long\" )\n  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \\\n                \"too many function definitions\" )\n  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \\\n                \"too many instruction definitions\" )\n  FT_ERRORDEF_( Table_Missing,                               0x8E, \\\n                \"SFNT font table missing\" )\n  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \\\n                \"horizontal header (hhea) table missing\" )\n  FT_ERRORDEF_( Locations_Missing,                           0x90, \\\n                \"locations (loca) table missing\" )\n  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \\\n                \"name table missing\" )\n  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \\\n                \"character map (cmap) table missing\" )\n  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \\\n                \"horizontal metrics (hmtx) table missing\" )\n  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \\\n                \"PostScript (post) table missing\" )\n  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \\\n                \"invalid horizontal metrics\" )\n  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \\\n                \"invalid character map (cmap) format\" )\n  FT_ERRORDEF_( Invalid_PPem,                                0x97, \\\n                \"invalid ppem value\" )\n  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \\\n                \"invalid vertical metrics\" )\n  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \\\n                \"could not find context\" )\n  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \\\n                \"invalid PostScript (post) table format\" )\n  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \\\n                \"invalid PostScript (post) table\" )\n\n  /* CFF, CID, and Type 1 errors */\n\n  FT_ERRORDEF_( Syntax_Error,                                0xA0, \\\n                \"opcode syntax error\" )\n  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \\\n                \"argument stack underflow\" )\n  FT_ERRORDEF_( Ignore,                                      0xA2, \\\n                \"ignore\" )\n  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \\\n                \"no Unicode glyph name found\" )\n\n  /* BDF errors */\n\n  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \\\n                \"`STARTFONT' field missing\" )\n  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \\\n                \"`FONT' field missing\" )\n  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \\\n                \"`SIZE' field missing\" )\n  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3, \\\n                \"`FONTBOUNDINGBOX' field missing\" )\n  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4, \\\n                \"`CHARS' field missing\" )\n  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5, \\\n                \"`STARTCHAR' field missing\" )\n  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6, \\\n                \"`ENCODING' field missing\" )\n  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7, \\\n                \"`BBX' field missing\" )\n  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8, \\\n                \"`BBX' too big\" )\n  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9, \\\n                \"Font header corrupted or missing fields\" )\n  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA, \\\n                \"Font glyphs corrupted or missing fields\" )\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/fterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrors.h                                                             */\n/*                                                                         */\n/*    FreeType error code handling (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2007 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This special header file is used to define the handling of FT2        */\n  /* enumeration constants.  It can also be used to generate error message */\n  /* strings with a small macro trick explained below.                     */\n  /*                                                                       */\n  /* I - Error Formats                                                     */\n  /* -----------------                                                     */\n  /*                                                                       */\n  /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */\n  /*   defined in ftoption.h in order to make the higher byte indicate     */\n  /*   the module where the error has happened (this is not compatible     */\n  /*   with standard builds of FreeType 2).  You can then use the macro    */\n  /*   FT_ERROR_BASE macro to extract the generic error code from an       */\n  /*   FT_Error value.                                                     */\n  /*                                                                       */\n  /*                                                                       */\n  /* II - Error Message strings                                            */\n  /* --------------------------                                            */\n  /*                                                                       */\n  /*   The error definitions below are made through special macros that    */\n  /*   allow client applications to build a table of error message strings */\n  /*   if they need it.  The strings are not included in a normal build of */\n  /*   FreeType 2 to save space (most client applications do not use       */\n  /*   them).                                                              */\n  /*                                                                       */\n  /*   To do so, you have to define the following macros before including  */\n  /*   this file:                                                          */\n  /*                                                                       */\n  /*   FT_ERROR_START_LIST ::                                              */\n  /*     This macro is called before anything else to define the start of  */\n  /*     the error list.  It is followed by several FT_ERROR_DEF calls     */\n  /*     (see below).                                                      */\n  /*                                                                       */\n  /*   FT_ERROR_DEF( e, v, s ) ::                                          */\n  /*     This macro is called to define one single error.                  */\n  /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */\n  /*     `v' is the error numerical value.                                 */\n  /*     `s' is the corresponding error string.                            */\n  /*                                                                       */\n  /*   FT_ERROR_END_LIST ::                                                */\n  /*     This macro ends the list.                                         */\n  /*                                                                       */\n  /*   Additionally, you have to undefine __FTERRORS_H__ before #including */\n  /*   this file.                                                          */\n  /*                                                                       */\n  /*   Here is a simple example:                                           */\n  /*                                                                       */\n  /*     {                                                                 */\n  /*       #undef __FTERRORS_H__                                           */\n  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */\n  /*       #define FT_ERROR_START_LIST     {                               */\n  /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */\n  /*                                                                       */\n  /*       const struct                                                    */\n  /*       {                                                               */\n  /*         int          err_code;                                        */\n  /*         const char*  err_msg;                                         */\n  /*       } ft_errors[] =                                                 */\n  /*                                                                       */\n  /*       #include FT_ERRORS_H                                            */\n  /*     }                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTERRORS_H__\n#define __FTERRORS_H__\n\n\n  /* include module base error codes */\n#include FT_MODULE_ERRORS_H\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#undef  FT_ERR_XCAT\n#undef  FT_ERR_CAT\n\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n\n  /* FT_ERR_PREFIX is used as a prefix for error identifiers. */\n  /* By default, we use `FT_Err_'.                            */\n  /*                                                          */\n#ifndef FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FT_Err_\n#endif\n\n\n  /* FT_ERR_BASE is used as the base for module-specific errors. */\n  /*                                                             */\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n#ifndef FT_ERR_BASE\n#define FT_ERR_BASE  FT_Mod_Err_Base\n#endif\n\n#else\n\n#undef FT_ERR_BASE\n#define FT_ERR_BASE  0\n\n#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */\n\n\n  /* If FT_ERRORDEF is not defined, we need to define a simple */\n  /* enumeration type.                                         */\n  /*                                                           */\n#ifndef FT_ERRORDEF\n\n#define FT_ERRORDEF( e, v, s )  e = v,\n#define FT_ERROR_START_LIST     enum {\n#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_ERRORDEF */\n\n\n  /* this macro is used to define an error */\n#define FT_ERRORDEF_( e, v, s )   \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )\n\n  /* this is only used for <module>_Err_Ok, which must be 0! */\n#define FT_NOERRORDEF_( e, v, s ) \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )\n\n\n#ifdef FT_ERROR_START_LIST\n  FT_ERROR_START_LIST\n#endif\n\n\n  /* now include the error codes */\n#include FT_ERROR_DEFINITIONS_H\n\n\n#ifdef FT_ERROR_END_LIST\n  FT_ERROR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      SIMPLE CLEANUP                     *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_ERROR_START_LIST\n#undef FT_ERROR_END_LIST\n\n#undef FT_ERRORDEF\n#undef FT_ERRORDEF_\n#undef FT_NOERRORDEF_\n\n#undef FT_NEED_EXTERN_C\n#undef FT_ERR_CONCAT\n#undef FT_ERR_BASE\n\n  /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */\n#ifndef FT_KEEP_ERR_PREFIX\n#undef FT_ERR_PREFIX\n#endif\n\n#endif /* __FTERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftgasp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.h                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (specification).                   */\n/*                                                                         */\n/*  Copyright 2007, 2008, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef _FT_GASP_H_\n#define _FT_GASP_H_\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\n  /***************************************************************************\n   *\n   * @section:\n   *   gasp_table\n   *\n   * @title:\n   *   Gasp Table\n   *\n   * @abstract:\n   *   Retrieving TrueType `gasp' table entries.\n   *\n   * @description:\n   *   The function @FT_Get_Gasp can be used to query a TrueType or OpenType\n   *   font for specific entries in its `gasp' table, if any.  This is\n   *   mainly useful when implementing native TrueType hinting with the\n   *   bytecode interpreter to duplicate the Windows text rendering results.\n   */\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_GASP_XXX\n   *\n   * @description:\n   *   A list of values and/or bit-flags returned by the @FT_Get_Gasp\n   *   function.\n   *\n   * @values:\n   *   FT_GASP_NO_TABLE ::\n   *     This special value means that there is no GASP table in this face.\n   *     It is up to the client to decide what to do.\n   *\n   *   FT_GASP_DO_GRIDFIT ::\n   *     Grid-fitting and hinting should be performed at the specified ppem. \n   *     This *really* means TrueType bytecode interpretation.  If this bit\n   *     is not set, no hinting gets applied.\n   *\n   *   FT_GASP_DO_GRAY ::\n   *     Anti-aliased rendering should be performed at the specified ppem. \n   *     If not set, do monochrome rendering.\n   *\n   *   FT_GASP_SYMMETRIC_SMOOTHING ::\n   *     If set, smoothing along multiple axes must be used with ClearType.\n   *\n   *   FT_GASP_SYMMETRIC_GRIDFIT ::\n   *     Grid-fitting must be used with ClearType's symmetric smoothing.\n   *\n   * @note:\n   *   The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be\n   *   used for standard font rasterization only.  Independently of that,\n   *   `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to\n   *   be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and\n   *   `FT_GASP_DO_GRAY' are consequently ignored).\n   *\n   *   `ClearType' is Microsoft's implementation of LCD rendering, partly\n   *   protected by patents.\n   *\n   * @since:\n   *   2.3.0\n   */\n#define FT_GASP_NO_TABLE               -1\n#define FT_GASP_DO_GRIDFIT           0x01\n#define FT_GASP_DO_GRAY              0x02\n#define FT_GASP_SYMMETRIC_SMOOTHING  0x08\n#define FT_GASP_SYMMETRIC_GRIDFIT    0x10\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_Gasp\n   *\n   * @description:\n   *   Read the `gasp' table from a TrueType or OpenType font file and\n   *   return the entry corresponding to a given character pixel size.\n   *\n   * @input:\n   *   face :: The source face handle.\n   *   ppem :: The vertical character pixel size.\n   *\n   * @return:\n   *   Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no\n   *   `gasp' table in the face.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem );\n\n/* */\n\n#endif /* _FT_GASP_H_ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.h                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the definition of several convenience functions    */\n  /* that can be used by client applications to easily retrieve glyph      */\n  /* bitmaps and outlines from a given face.                               */\n  /*                                                                       */\n  /* These functions should be optional if you are writing a font server   */\n  /* or text layout engine on top of FreeType.  However, they are pretty   */\n  /* handy for many other simple uses of the library.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTGLYPH_H__\n#define __FTGLYPH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Management                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Generic interface to manage individual glyph data.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains definitions used to manage glyph data        */\n  /*    through generic FT_Glyph objects.  Each of them can contain a      */\n  /*    bitmap, a vector outline, or even images in other formats.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* forward declaration to a private type */\n  typedef struct FT_Glyph_Class_  FT_Glyph_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Glyph                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Handle to an object used to model generic glyph images.  It is a   */\n  /*    pointer to the @FT_GlyphRec structure and can contain a glyph      */\n  /*    bitmap or pointer.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Glyph objects are not owned by the library.  You must thus release */\n  /*    them manually (through @FT_Done_Glyph) _before_ calling            */\n  /*    @FT_Done_FreeType.                                                 */\n  /*                                                                       */\n  typedef struct FT_GlyphRec_*  FT_Glyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root glyph structure contains a given glyph image plus its     */\n  /*    advance width in 16.16 fixed float format.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library :: A handle to the FreeType library object.                */\n  /*                                                                       */\n  /*    clazz   :: A pointer to the glyph's class.  Private.               */\n  /*                                                                       */\n  /*    format  :: The format of the glyph's image.                        */\n  /*                                                                       */\n  /*    advance :: A 16.16 vector that gives the glyph's advance width.    */\n  /*                                                                       */\n  typedef struct  FT_GlyphRec_\n  {\n    FT_Library             library;\n    const FT_Glyph_Class*  clazz;\n    FT_Glyph_Format        format;\n    FT_Vector              advance;\n\n  } FT_GlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_BitmapGlyph                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a bitmap glyph image.  This is */\n  /*    a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.     */\n  /*                                                                       */\n  typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BitmapGlyphRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for bitmap glyph images.  This really is a        */\n  /*    `sub-class' of @FT_GlyphRec.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root   :: The root @FT_Glyph fields.                               */\n  /*                                                                       */\n  /*    left   :: The left-side bearing, i.e., the horizontal distance     */\n  /*              from the current pen position to the left border of the  */\n  /*              glyph bitmap.                                            */\n  /*                                                                       */\n  /*    top    :: The top-side bearing, i.e., the vertical distance from   */\n  /*              the current pen position to the top border of the glyph  */\n  /*              bitmap.  This distance is positive for upwards~y!        */\n  /*                                                                       */\n  /*    bitmap :: A descriptor for the bitmap.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_BITMAP'.  This lets you access   */\n  /*    the bitmap's contents easily.                                      */\n  /*                                                                       */\n  /*    The corresponding pixel buffer is always owned by @FT_BitmapGlyph  */\n  /*    and is thus created and destroyed with it.                         */\n  /*                                                                       */\n  typedef struct  FT_BitmapGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Int       left;\n    FT_Int       top;\n    FT_Bitmap    bitmap;\n\n  } FT_BitmapGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_OutlineGlyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model an outline glyph image.  This  */\n  /*    is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */\n  /*                                                                       */\n  typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_OutlineGlyphRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for outline (vectorial) glyph images.  This       */\n  /*    really is a `sub-class' of @FT_GlyphRec.                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root    :: The root @FT_Glyph fields.                              */\n  /*                                                                       */\n  /*    outline :: A descriptor for the outline.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have      */\n  /*    `glyph->format == FT_GLYPH_FORMAT_OUTLINE'.  This lets you access  */\n  /*    the outline's content easily.                                      */\n  /*                                                                       */\n  /*    As the outline is extracted from a glyph slot, its coordinates are */\n  /*    expressed normally in 26.6 pixels, unless the flag                 */\n  /*    @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */\n  /*                                                                       */\n  /*    The outline's tables are always owned by the object and are        */\n  /*    destroyed with it.                                                 */\n  /*                                                                       */\n  typedef struct  FT_OutlineGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Outline   outline;\n\n  } FT_OutlineGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to extract a glyph image from a slot.  Note that   */\n  /*    the created @FT_Glyph object must be released with @FT_Done_Glyph. */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot   :: A handle to the source glyph slot.                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: A handle to the glyph object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Copy                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to copy a glyph image.  Note that the created      */\n  /*    @FT_Glyph object must be released with @FT_Done_Glyph.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source glyph object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target glyph object.  0~in case of       */\n  /*              error.                                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Transform                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a glyph image if its format is scalable.                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    glyph  :: A handle to the target glyph object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to a 2x2 matrix to apply.                      */\n  /*                                                                       */\n  /*    delta  :: A pointer to a 2d vector to apply.  Coordinates are      */\n  /*              expressed in 1/64th of a pixel.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code (if not 0, the glyph format is not scalable).  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The 2x2 transformation matrix is also applied to the glyph's       */\n  /*    advance vector.                                                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_BBox_Mode                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The mode how the values of @FT_Glyph_Get_CBox are returned.        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_BBOX_UNSCALED ::                                          */\n  /*      Return unscaled font units.                                      */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_SUBPIXELS ::                                         */\n  /*      Return unfitted 26.6 coordinates.                                */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_GRIDFIT ::                                           */\n  /*      Return grid-fitted 26.6 coordinates.                             */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_TRUNCATE ::                                          */\n  /*      Return coordinates in integer pixels.                            */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_PIXELS ::                                            */\n  /*      Return grid-fitted pixel coordinates.                            */\n  /*                                                                       */\n  typedef enum  FT_Glyph_BBox_Mode_\n  {\n    FT_GLYPH_BBOX_UNSCALED  = 0,\n    FT_GLYPH_BBOX_SUBPIXELS = 0,\n    FT_GLYPH_BBOX_GRIDFIT   = 1,\n    FT_GLYPH_BBOX_TRUNCATE  = 2,\n    FT_GLYPH_BBOX_PIXELS    = 3\n\n  } FT_Glyph_BBox_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_bbox_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Glyph_BBox_Mode values instead.                                */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   ft_glyph_bbox_unscaled  :: See @FT_GLYPH_BBOX_UNSCALED.             */\n  /*   ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS.            */\n  /*   ft_glyph_bbox_gridfit   :: See @FT_GLYPH_BBOX_GRIDFIT.              */\n  /*   ft_glyph_bbox_truncate  :: See @FT_GLYPH_BBOX_TRUNCATE.             */\n  /*   ft_glyph_bbox_pixels    :: See @FT_GLYPH_BBOX_PIXELS.               */\n  /*                                                                       */\n#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED\n#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS\n#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT\n#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE\n#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Get_CBox                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a glyph's `control box'.  The control box encloses all the  */\n  /*    outline's points, including Bézier control points.  Though it      */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the source glyph object.                      */\n  /*                                                                       */\n  /*    mode  :: The mode which indicates how to interpret the returned    */\n  /*             bounding box values.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox :: The glyph coordinate bounding box.  Coordinates are       */\n  /*             expressed in 1/64th of pixels if it is grid-fitted.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Coordinates are relative to the glyph origin, using the y~upwards  */\n  /*    convention.                                                        */\n  /*                                                                       */\n  /*    If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode'   */\n  /*    must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font        */\n  /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */\n  /*    is another name for this constant.                                 */\n  /*                                                                       */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting CBox is meaningless.  To get      */\n  /*    reasonable values for the CBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the CBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  /*    Note that the maximum coordinates are exclusive, which means that  */\n  /*    one can compute the width and height of the glyph image (be it in  */\n  /*    integer or 26.6 pixels) as:                                        */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      width  = bbox.xMax - bbox.xMin;                                  */\n  /*      height = bbox.yMax - bbox.yMin;                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note also that for 26.6 coordinates, if `bbox_mode' is set to      */\n  /*    @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,  */\n  /*    which corresponds to:                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      bbox.xMin = FLOOR(bbox.xMin);                                    */\n  /*      bbox.yMin = FLOOR(bbox.yMin);                                    */\n  /*      bbox.xMax = CEILING(bbox.xMax);                                  */\n  /*      bbox.yMax = CEILING(bbox.yMax);                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get the bbox in pixel coordinates, set `bbox_mode' to           */\n  /*    @FT_GLYPH_BBOX_TRUNCATE.                                           */\n  /*                                                                       */\n  /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */\n  /*    to @FT_GLYPH_BBOX_PIXELS.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_To_Bitmap                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph object to a bitmap glyph object.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    the_glyph   :: A pointer to a handle to the target glyph.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: An enumeration that describes how the data is       */\n  /*                   rendered.                                           */\n  /*                                                                       */\n  /*    origin      :: A pointer to a vector used to translate the glyph   */\n  /*                   image before rendering.  Can be~0 (if no            */\n  /*                   translation).  The origin is expressed in           */\n  /*                   26.6 pixels.                                        */\n  /*                                                                       */\n  /*    destroy     :: A boolean that indicates that the original glyph    */\n  /*                   image should be destroyed by this function.  It is  */\n  /*                   never destroyed in case of error.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does nothing if the glyph format isn't scalable.     */\n  /*                                                                       */\n  /*    The glyph image is translated with the `origin' vector before      */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  /*    The first parameter is a pointer to an @FT_Glyph handle, that will */\n  /*    be _replaced_ by this function (with newly allocated data).        */\n  /*    Typically, you would use (omitting error handling):                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph        glyph;                                         */\n  /*        FT_BitmapGlyph  glyph_bitmap;                                  */\n  /*                                                                       */\n  /*                                                                       */\n  /*        // load glyph                                                  */\n  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */\n  /*                                                                       */\n  /*        // extract glyph image                                         */\n  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */\n  /*                                                                       */\n  /*        // convert to a bitmap (default render mode + destroying old)  */\n  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */\n  /*        {                                                              */\n  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,   */\n  /*                                      0, 1 );                          */\n  /*          if ( error ) // `glyph' unchanged                            */\n  /*            ...                                                        */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        // access bitmap content by typecasting                        */\n  /*        glyph_bitmap = (FT_BitmapGlyph)glyph;                          */\n  /*                                                                       */\n  /*        // do funny stuff with it, like blitting/drawing               */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        // discard glyph image (bitmap or not)                         */\n  /*        FT_Done_Glyph( glyph );                                        */\n  /*      }                                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*    Here another example, again without error handling:                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph  glyphs[MAX_GLYPHS]                                   */\n  /*                                                                       */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       */\n  /*                  FT_Get_Glyph ( face->glyph, &glyph[idx] );           */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*        {                                                              */\n  /*          FT_Glyph  bitmap = glyphs[idx];                              */\n  /*                                                                       */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          // after this call, `bitmap' no longer points into           */\n  /*          // the `glyphs' array (and the old value isn't destroyed)    */\n  /*          FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );    */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          FT_Done_Glyph( bitmap );                                     */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          FT_Done_Glyph( glyphs[idx] );                                */\n  /*      }                                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given glyph.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the target glyph object.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Done_Glyph( FT_Glyph  glyph );\n\n  /* */\n\n\n  /* other helpful functions */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Multiply                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Perform the matrix operation `b = a*b'.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: A pointer to matrix `a'.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    b :: A pointer to matrix `b'.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `a' or `b' is zero.              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix*        b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invert a 2x2 matrix.  Return an error if it can't be inverted.     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    matrix :: A pointer to the target matrix.  Remains untouched in    */\n  /*              case of error.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLYPH_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGXVAL_H__\n#define __FTGXVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gx_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueTypeGX/AAT Validation                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate TrueTypeGX/AAT tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */\n  /*    trak, prop, lcar).                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                                                                       */\n  /* Warning: Use FT_VALIDATE_XXX to validate a table.                     */\n  /*          Following definitions are for gxvalid developers.            */\n  /*                                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_VALIDATE_feat_INDEX     0\n#define FT_VALIDATE_mort_INDEX     1\n#define FT_VALIDATE_morx_INDEX     2\n#define FT_VALIDATE_bsln_INDEX     3\n#define FT_VALIDATE_just_INDEX     4\n#define FT_VALIDATE_kern_INDEX     5\n#define FT_VALIDATE_opbd_INDEX     6\n#define FT_VALIDATE_trak_INDEX     7\n#define FT_VALIDATE_prop_INDEX     8\n#define FT_VALIDATE_lcar_INDEX     9\n#define FT_VALIDATE_GX_LAST_INDEX  FT_VALIDATE_lcar_INDEX\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_VALIDATE_GX_LENGTH\n   *\n   * @description:\n   *   The number of tables checked in this module.  Use it as a parameter\n   *   for the `table-length' argument of function @FT_TrueTypeGX_Validate.\n   */\n#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n  /* */\n\n  /* Up to 0x1000 is used by otvalid.\n     Ox2xxx is reserved for feature OT extension. */\n#define FT_VALIDATE_GX_START 0x4000\n#define FT_VALIDATE_GX_BITFIELD( tag )                  \\\n  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_GXXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_TrueTypeGX_Validate to\n  *    indicate which TrueTypeGX/AAT Type tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_feat ::\n  *      Validate `feat' table.\n  *\n  *    FT_VALIDATE_mort ::\n  *      Validate `mort' table.\n  *\n  *    FT_VALIDATE_morx ::\n  *      Validate `morx' table.\n  *\n  *    FT_VALIDATE_bsln ::\n  *      Validate `bsln' table.\n  *\n  *    FT_VALIDATE_just ::\n  *      Validate `just' table.\n  *\n  *    FT_VALIDATE_kern ::\n  *      Validate `kern' table.\n  *\n  *    FT_VALIDATE_opbd ::\n  *      Validate `opbd' table.\n  *\n  *    FT_VALIDATE_trak ::\n  *      Validate `trak' table.\n  *\n  *    FT_VALIDATE_prop ::\n  *      Validate `prop' table.\n  *\n  *    FT_VALIDATE_lcar ::\n  *      Validate `lcar' table.\n  *\n  *    FT_VALIDATE_GX ::\n  *      Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,\n  *      opbd, trak, prop and lcar).\n  *\n  */\n\n#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )\n#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )\n#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )\n#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )\n#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )\n#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )\n#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )\n#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )\n#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )\n#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \\\n                          FT_VALIDATE_mort | \\\n                          FT_VALIDATE_morx | \\\n                          FT_VALIDATE_bsln | \\\n                          FT_VALIDATE_just | \\\n                          FT_VALIDATE_kern | \\\n                          FT_VALIDATE_opbd | \\\n                          FT_VALIDATE_trak | \\\n                          FT_VALIDATE_prop | \\\n                          FT_VALIDATE_lcar )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Validate\n  *\n  * @description:\n  *    Validate various TrueTypeGX tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_GXXXX for possible values.\n  *\n  *    table_length ::\n  *       The size of the `tables' array.  Normally, @FT_VALIDATE_GX_LENGTH\n  *       should be passed.\n  *\n  * @output:\n  *    tables ::\n  *       The array where all validated sfnt tables are stored.\n  *       The array itself must be allocated by a client.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with TrueTypeGX fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the buffers pointed to by\n  *   each `tables' element, by calling @FT_TrueTypeGX_Free.  A NULL value\n  *   indicates that the table either doesn't exist in the font, the\n  *   application hasn't asked for validation, or the validator doesn't have\n  *   the ability to validate the sfnt table.\n  */\n  FT_EXPORT( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Free\n  *\n  * @description:\n  *    Free the buffer allocated by TrueTypeGX validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer allocated by\n  *       @FT_TrueTypeGX_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_TrueTypeGX_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_CKERNXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_ClassicKern_Validate\n  *    to indicate the classic kern dialect or dialects.  If the selected\n  *    type doesn't fit, @FT_ClassicKern_Validate regards the table as\n  *    invalid.\n  *\n  * @values:\n  *    FT_VALIDATE_MS ::\n  *      Handle the `kern' table as a classic Microsoft kern table.\n  *\n  *    FT_VALIDATE_APPLE ::\n  *      Handle the `kern' table as a classic Apple kern table.\n  *\n  *    FT_VALIDATE_CKERN ::\n  *      Handle the `kern' as either classic Apple or Microsoft kern table.\n  */\n#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )\n#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )\n\n#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Validate\n  *\n  * @description:\n  *    Validate classic (16-bit format) kern table to assure that the offsets\n  *    and indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without error\n  *    checking (which can be quite time consuming).\n  *\n  *    The `kern' table validator in @FT_TrueTypeGX_Validate deals with both\n  *    the new 32-bit format and the classic 16-bit format, while\n  *    FT_ClassicKern_Validate only supports the classic 16-bit format.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the dialect to be validated.  See\n  *       @FT_VALIDATE_CKERNXXX for possible values.\n  *\n  * @output:\n  *    ckern_table ::\n  *       A pointer to the kern table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   After use, the application should deallocate the buffers pointed to by\n  *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value\n  *   indicates that the table doesn't exist in the font.\n  */\n  FT_EXPORT( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Free\n  *\n  * @description:\n  *    Free the buffer allocated by classic Kern validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_ClassicKern_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_ClassicKern_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftgzip.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.h                                                               */\n/*                                                                         */\n/*    Gzip-compressed stream support.                                      */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGZIP_H__\n#define __FTGZIP_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gzip                                                               */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    GZIP Streams                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using gzip-compressed font files.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Gzip-specific functions.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenGzip\n  *\n  * @description:\n  *   Open a new stream to parse gzip-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.gz' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, gzip compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a gzipped stream from\n  *   it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGZIP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftimage.h                                                              */\n/*                                                                         */\n/*    FreeType glyph image formats and default raster interface            */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,   */\n/*            2010 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Note: A `raster' is simply a scan-line converter, used to render      */\n  /*       FT_Outlines into FT_Bitmaps.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTIMAGE_H__\n#define __FTIMAGE_H__\n\n\n  /* _STANDALONE_ is from ftgrays.c */\n#ifndef _STANDALONE_\n#include <ft2build.h>\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pos                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The type FT_Pos is used to store vectorial coordinates.  Depending */\n  /*    on the context, these can represent distances in integer font      */\n  /*    units, or 16.16, or 26.6 fixed float pixel coordinates.            */\n  /*                                                                       */\n  typedef signed long  FT_Pos;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Vector                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector; coordinates are of   */\n  /*    the FT_Pos type.                                                   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: The horizontal coordinate.                                    */\n  /*    y :: The vertical coordinate.                                      */\n  /*                                                                       */\n  typedef struct  FT_Vector_\n  {\n    FT_Pos  x;\n    FT_Pos  y;\n\n  } FT_Vector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BBox                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold an outline's bounding box, i.e., the      */\n  /*    coordinates of its extrema in the horizontal and vertical          */\n  /*    directions.                                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xMin :: The horizontal minimum (left-most).                        */\n  /*                                                                       */\n  /*    yMin :: The vertical minimum (bottom-most).                        */\n  /*                                                                       */\n  /*    xMax :: The horizontal maximum (right-most).                       */\n  /*                                                                       */\n  /*    yMax :: The vertical maximum (top-most).                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The bounding box is specified with the coordinates of the lower    */\n  /*    left and the upper right corner.  In PostScript, those values are  */\n  /*    often called (llx,lly) and (urx,ury), respectively.                */\n  /*                                                                       */\n  /*    If `yMin' is negative, this value gives the glyph's descender.     */\n  /*    Otherwise, the glyph doesn't descend below the baseline.           */\n  /*    Similarly, if `ymax' is positive, this value gives the glyph's     */\n  /*    ascender.                                                          */\n  /*                                                                       */\n  /*    `xMin' gives the horizontal distance from the glyph's origin to    */\n  /*    the left edge of the glyph's bounding box.  If `xMin' is negative, */\n  /*    the glyph extends to the left of the origin.                       */\n  /*                                                                       */\n  typedef struct  FT_BBox_\n  {\n    FT_Pos  xMin, yMin;\n    FT_Pos  xMax, yMax;\n\n  } FT_BBox;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Pixel_Mode                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of pixels in a     */\n  /*    given bitmap.  Note that additional formats may be added in the    */\n  /*    future.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_PIXEL_MODE_NONE ::                                              */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_MONO ::                                              */\n  /*      A monochrome bitmap, using 1~bit per pixel.  Note that pixels    */\n  /*      are stored in most-significant order (MSB), which means that     */\n  /*      the left-most pixel in a byte has value 128.                     */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY ::                                              */\n  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */\n  /*      images.  Each pixel is stored in one byte.  Note that the number */\n  /*      of `gray' levels is stored in the `num_grays' field of the       */\n  /*      @FT_Bitmap structure (it generally is 256).                      */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY2 ::                                             */\n  /*      A 2-bit per pixel bitmap, used to represent embedded             */\n  /*      anti-aliased bitmaps in font files according to the OpenType     */\n  /*      specification.  We haven't found a single font using this        */\n  /*      format, however.                                                 */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY4 ::                                             */\n  /*      A 4-bit per pixel bitmap, representing embedded anti-aliased     */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD ::                                               */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on LCD displays; the bitmap is three times      */\n  /*      wider than the original glyph image.  See also                   */\n  /*      @FT_RENDER_MODE_LCD.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD_V ::                                             */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on rotated LCD displays; the bitmap is three    */\n  /*      times taller than the original glyph image.  See also            */\n  /*      @FT_RENDER_MODE_LCD_V.                                           */\n  /*                                                                       */\n  typedef enum  FT_Pixel_Mode_\n  {\n    FT_PIXEL_MODE_NONE = 0,\n    FT_PIXEL_MODE_MONO,\n    FT_PIXEL_MODE_GRAY,\n    FT_PIXEL_MODE_GRAY2,\n    FT_PIXEL_MODE_GRAY4,\n    FT_PIXEL_MODE_LCD,\n    FT_PIXEL_MODE_LCD_V,\n\n    FT_PIXEL_MODE_MAX      /* do not remove */\n\n  } FT_Pixel_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_pixel_mode_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Pixel_Mode values instead.                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_pixel_mode_none  :: See @FT_PIXEL_MODE_NONE.                    */\n  /*    ft_pixel_mode_mono  :: See @FT_PIXEL_MODE_MONO.                    */\n  /*    ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY.                    */\n  /*    ft_pixel_mode_pal2  :: See @FT_PIXEL_MODE_GRAY2.                   */\n  /*    ft_pixel_mode_pal4  :: See @FT_PIXEL_MODE_GRAY4.                   */\n  /*                                                                       */\n#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE\n#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO\n#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY\n#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2\n#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4\n\n /* */\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Palette_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT!                           */\n  /*                                                                       */\n  /*    An enumeration type to describe the format of a bitmap palette,    */\n  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_palette_mode_rgb  :: The palette is an array of 3-byte RGB      */\n  /*                            records.                                   */\n  /*                                                                       */\n  /*    ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA     */\n  /*                            records.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by       */\n  /*    FreeType, these types are not handled by the library itself.       */\n  /*                                                                       */\n  typedef enum  FT_Palette_Mode_\n  {\n    ft_palette_mode_rgb = 0,\n    ft_palette_mode_rgba,\n\n    ft_palette_mode_max   /* do not remove */\n\n  } FT_Palette_Mode;\n\n  /* */\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a bitmap or pixmap to the raster.     */\n  /*    Note that we now manage pixmaps of various depths through the      */\n  /*    `pixel_mode' field.                                                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    rows         :: The number of bitmap rows.                         */\n  /*                                                                       */\n  /*    width        :: The number of pixels in bitmap row.                */\n  /*                                                                       */\n  /*    pitch        :: The pitch's absolute value is the number of bytes  */\n  /*                    taken by one bitmap row, including padding.        */\n  /*                    However, the pitch is positive when the bitmap has */\n  /*                    a `down' flow, and negative when it has an `up'    */\n  /*                    flow.  In all cases, the pitch is an offset to add */\n  /*                    to a bitmap pointer in order to go down one row.   */\n  /*                                                                       */\n  /*                    Note that `padding' means the alignment of a       */\n  /*                    bitmap to a byte border, and FreeType functions    */\n  /*                    normally align to the smallest possible integer    */\n  /*                    value.                                             */\n  /*                                                                       */\n  /*                    For the B/W rasterizer, `pitch' is always an even  */\n  /*                    number.                                            */\n  /*                                                                       */\n  /*                    To change the pitch of a bitmap (say, to make it a */\n  /*                    multiple of 4), use @FT_Bitmap_Convert.            */\n  /*                    Alternatively, you might use callback functions to */\n  /*                    directly render to the application's surface; see  */\n  /*                    the file `example2.cpp' in the tutorial for a      */\n  /*                    demonstration.                                     */\n  /*                                                                       */\n  /*    buffer       :: A typeless pointer to the bitmap buffer.  This     */\n  /*                    value should be aligned on 32-bit boundaries in    */\n  /*                    most cases.                                        */\n  /*                                                                       */\n  /*    num_grays    :: This field is only used with                       */\n  /*                    @FT_PIXEL_MODE_GRAY; it gives the number of gray   */\n  /*                    levels used in the bitmap.                         */\n  /*                                                                       */\n  /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */\n  /*                    See @FT_Pixel_Mode for possible values.            */\n  /*                                                                       */\n  /*    palette_mode :: This field is intended for paletted pixel modes;   */\n  /*                    it indicates how the palette is stored.  Not       */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /*    palette      :: A typeless pointer to the bitmap palette; this     */\n  /*                    field is intended for paletted pixel modes.  Not   */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   For now, the only pixel modes supported by FreeType are mono and    */\n  /*   grays.  However, drivers might be added in the future to support    */\n  /*   more `colorful' options.                                            */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_\n  {\n    int             rows;\n    int             width;\n    int             pitch;\n    unsigned char*  buffer;\n    short           num_grays;\n    char            pixel_mode;\n    char            palette_mode;\n    void*           palette;\n\n  } FT_Bitmap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure is used to describe an outline to the scan-line     */\n  /*    converter.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    n_contours :: The number of contours in the outline.               */\n  /*                                                                       */\n  /*    n_points   :: The number of points in the outline.                 */\n  /*                                                                       */\n  /*    points     :: A pointer to an array of `n_points' @FT_Vector       */\n  /*                  elements, giving the outline's point coordinates.    */\n  /*                                                                       */\n  /*    tags       :: A pointer to an array of `n_points' chars, giving    */\n  /*                  each outline point's type.                           */\n  /*                                                                       */\n  /*                  If bit~0 is unset, the point is `off' the curve,     */\n  /*                  i.e., a Bézier control point, while it is `on' if    */\n  /*                  set.                                                 */\n  /*                                                                       */\n  /*                  Bit~1 is meaningful for `off' points only.  If set,  */\n  /*                  it indicates a third-order Bézier arc control point; */\n  /*                  and a second-order control point if unset.           */\n  /*                                                                       */\n  /*                  If bit~2 is set, bits 5-7 contain the drop-out mode  */\n  /*                  (as defined in the OpenType specification; the value */\n  /*                  is the same as the argument to the SCANMODE          */\n  /*                  instruction).                                        */\n  /*                                                                       */\n  /*                  Bits 3 and~4 are reserved for internal purposes.     */\n  /*                                                                       */\n  /*    contours   :: An array of `n_contours' shorts, giving the end      */\n  /*                  point of each contour within the outline.  For       */\n  /*                  example, the first contour is defined by the points  */\n  /*                  `0' to `contours[0]', the second one is defined by   */\n  /*                  the points `contours[0]+1' to `contours[1]', etc.    */\n  /*                                                                       */\n  /*    flags      :: A set of bit flags used to characterize the outline  */\n  /*                  and give hints to the scan-converter and hinter on   */\n  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_FLAGS.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The B/W rasterizer only checks bit~2 in the `tags' array for the   */\n  /*    first point of each contour.  The drop-out mode as given with      */\n  /*    @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and       */\n  /*    @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden.           */\n  /*                                                                       */\n  typedef struct  FT_Outline_\n  {\n    short       n_contours;      /* number of contours in glyph        */\n    short       n_points;        /* number of points in the glyph      */\n\n    FT_Vector*  points;          /* the outline's points               */\n    char*       tags;            /* the points flags                   */\n    short*      contours;        /* the contour end points             */\n\n    int         flags;           /* outline masks                      */\n\n  } FT_Outline;\n\n  /* Following limits must be consistent with */\n  /* FT_Outline.{n_contours,n_points}         */\n#define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX\n#define FT_OUTLINE_POINTS_MAX    SHRT_MAX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants use for the flags in an outline's    */\n  /*    `flags' field.                                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OUTLINE_NONE ::                                                 */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_OUTLINE_OWNER ::                                                */\n  /*      If set, this flag indicates that the outline's field arrays      */\n  /*      (i.e., `points', `flags', and `contours') are `owned' by the     */\n  /*      outline object, and should thus be freed when it is destroyed.   */\n  /*                                                                       */\n  /*    FT_OUTLINE_EVEN_ODD_FILL ::                                        */\n  /*      By default, outlines are filled using the non-zero winding rule. */\n  /*      If set to 1, the outline will be filled using the even-odd fill  */\n  /*      rule (only works with the smooth rasterizer).                    */\n  /*                                                                       */\n  /*    FT_OUTLINE_REVERSE_FILL ::                                         */\n  /*      By default, outside contours of an outline are oriented in       */\n  /*      clock-wise direction, as defined in the TrueType specification.  */\n  /*      This flag is set if the outline uses the opposite direction      */\n  /*      (typically for Type~1 fonts).  This flag is ignored by the scan  */\n  /*      converter.                                                       */\n  /*                                                                       */\n  /*    FT_OUTLINE_IGNORE_DROPOUTS ::                                      */\n  /*      By default, the scan converter will try to detect drop-outs in   */\n  /*      an outline and correct the glyph bitmap to ensure consistent     */\n  /*      shape continuity.  If set, this flag hints the scan-line         */\n  /*      converter to ignore such cases.  See below for more information. */\n  /*                                                                       */\n  /*    FT_OUTLINE_SMART_DROPOUTS ::                                       */\n  /*      Select smart dropout control.  If unset, use simple dropout      */\n  /*      control.  Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See    */\n  /*      below for more information.                                      */\n  /*                                                                       */\n  /*    FT_OUTLINE_INCLUDE_STUBS ::                                        */\n  /*      If set, turn pixels on for `stubs', otherwise exclude them.      */\n  /*      Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See below for    */\n  /*      more information.                                                */\n  /*                                                                       */\n  /*    FT_OUTLINE_HIGH_PRECISION ::                                       */\n  /*      This flag indicates that the scan-line converter should try to   */\n  /*      convert this outline to bitmaps with the highest possible        */\n  /*      quality.  It is typically set for small character sizes.  Note   */\n  /*      that this is only a hint that might be completely ignored by a   */\n  /*      given scan-converter.                                            */\n  /*                                                                       */\n  /*    FT_OUTLINE_SINGLE_PASS ::                                          */\n  /*      This flag is set to force a given scan-converter to only use a   */\n  /*      single pass over the outline to render a bitmap glyph image.     */\n  /*      Normally, it is set for very large character sizes.  It is only  */\n  /*      a hint that might be completely ignored by a given               */\n  /*      scan-converter.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */\n  /*    and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth            */\n  /*    rasterizer.                                                        */\n  /*                                                                       */\n  /*    There exists a second mechanism to pass the drop-out mode to the   */\n  /*    B/W rasterizer; see the `tags' field in @FT_Outline.               */\n  /*                                                                       */\n  /*    Please refer to the description of the `SCANTYPE' instruction in   */\n  /*    the OpenType specification (in file `ttinst1.doc') how simple      */\n  /*    drop-outs, smart drop-outs, and stubs are defined.                 */\n  /*                                                                       */\n#define FT_OUTLINE_NONE             0x0\n#define FT_OUTLINE_OWNER            0x1\n#define FT_OUTLINE_EVEN_ODD_FILL    0x2\n#define FT_OUTLINE_REVERSE_FILL     0x4\n#define FT_OUTLINE_IGNORE_DROPOUTS  0x8\n#define FT_OUTLINE_SMART_DROPOUTS   0x10\n#define FT_OUTLINE_INCLUDE_STUBS    0x20\n\n#define FT_OUTLINE_HIGH_PRECISION   0x100\n#define FT_OUTLINE_SINGLE_PASS      0x200\n\n\n /*************************************************************************\n  *\n  * @enum:\n  *   ft_outline_flags\n  *\n  * @description:\n  *   These constants are deprecated.  Please use the corresponding\n  *   @FT_OUTLINE_FLAGS values.\n  *\n  * @values:\n  *   ft_outline_none            :: See @FT_OUTLINE_NONE.\n  *   ft_outline_owner           :: See @FT_OUTLINE_OWNER.\n  *   ft_outline_even_odd_fill   :: See @FT_OUTLINE_EVEN_ODD_FILL.\n  *   ft_outline_reverse_fill    :: See @FT_OUTLINE_REVERSE_FILL.\n  *   ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.\n  *   ft_outline_high_precision  :: See @FT_OUTLINE_HIGH_PRECISION.\n  *   ft_outline_single_pass     :: See @FT_OUTLINE_SINGLE_PASS.\n  */\n#define ft_outline_none             FT_OUTLINE_NONE\n#define ft_outline_owner            FT_OUTLINE_OWNER\n#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL\n#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL\n#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS\n#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION\n#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS\n\n  /* */\n\n#define FT_CURVE_TAG( flag )  ( flag & 3 )\n\n#define FT_CURVE_TAG_ON            1\n#define FT_CURVE_TAG_CONIC         0\n#define FT_CURVE_TAG_CUBIC         2\n\n#define FT_CURVE_TAG_HAS_SCANMODE  4\n\n#define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */\n#define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */\n\n#define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \\\n                                     FT_CURVE_TAG_TOUCH_Y )\n\n#define FT_Curve_Tag_On       FT_CURVE_TAG_ON\n#define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC\n#define FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC\n#define FT_Curve_Tag_Touch_X  FT_CURVE_TAG_TOUCH_X\n#define FT_Curve_Tag_Touch_Y  FT_CURVE_TAG_TOUCH_Y\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `move  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `move to' is emitted to start a new contour in an outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `move to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_LineToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `line  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `line to' is emitted to indicate a segment in the outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `line to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_LineToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `conic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `conic to' is emitted to indicate a second-order Bézier arc in   */\n  /*    the outline.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: An intermediate control point between the last position */\n  /*               and the new target in `to'.                             */\n  /*                                                                       */\n  /*    to      :: A pointer to the target end point of the conic arc.     */\n  /*                                                                       */\n  /*    user    :: A typeless pointer which is passed from the caller of   */\n  /*               the decomposition function.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `cubic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `cubic to' is emitted to indicate a third-order Bézier arc.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first Bézier control point.           */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second Bézier control point.          */\n  /*                                                                       */\n  /*    to       :: A pointer to the target end point.                     */\n  /*                                                                       */\n  /*    user     :: A typeless pointer which is passed from the caller of  */\n  /*                the decomposition function.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,\n                             const FT_Vector*  control2,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline_Funcs                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold various function pointers used during outline  */\n  /*    decomposition in order to emit segments, conic, and cubic Béziers. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    move_to  :: The `move to' emitter.                                 */\n  /*                                                                       */\n  /*    line_to  :: The segment emitter.                                   */\n  /*                                                                       */\n  /*    conic_to :: The second-order Bézier arc emitter.                   */\n  /*                                                                       */\n  /*    cubic_to :: The third-order Bézier arc emitter.                    */\n  /*                                                                       */\n  /*    shift    :: The shift that is applied to coordinates before they   */\n  /*                are sent to the emitter.                               */\n  /*                                                                       */\n  /*    delta    :: The delta that is applied to coordinates before they   */\n  /*                are sent to the emitter, but after the shift.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The point coordinates sent to the emitters are the transformed     */\n  /*    version of the original coordinates (this is important for high    */\n  /*    accuracy during scan-conversion).  The transformation is simple:   */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      x' = (x << shift) - delta                                        */\n  /*      y' = (x << shift) - delta                                        */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Set the values of `shift' and `delta' to~0 to get the original     */\n  /*    point coordinates.                                                 */\n  /*                                                                       */\n  typedef struct  FT_Outline_Funcs_\n  {\n    FT_Outline_MoveToFunc   move_to;\n    FT_Outline_LineToFunc   line_to;\n    FT_Outline_ConicToFunc  conic_to;\n    FT_Outline_CubicToFunc  cubic_to;\n\n    int                     shift;\n    FT_Pos                  delta;\n\n  } FT_Outline_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags to an unsigned long type.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n#ifndef FT_IMAGE_TAG\n#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \\\n          value = ( ( (unsigned long)_x1 << 24 ) | \\\n                    ( (unsigned long)_x2 << 16 ) | \\\n                    ( (unsigned long)_x3 << 8  ) | \\\n                      (unsigned long)_x4         )\n#endif /* FT_IMAGE_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_Format                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of a given glyph   */\n  /*    image.  Note that this version of FreeType only supports two image */\n  /*    formats, even though future font drivers will be able to register  */\n  /*    their own format.                                                  */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_FORMAT_NONE ::                                            */\n  /*      The value~0 is reserved.                                         */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */\n  /*      The glyph image is a composite of several other images.  This    */\n  /*      format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to   */\n  /*      report compound glyphs (like accented characters).               */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_BITMAP ::                                          */\n  /*      The glyph image is a bitmap, and can be described as an          */\n  /*      @FT_Bitmap.  You generally need to access the `bitmap' field of  */\n  /*      the @FT_GlyphSlotRec structure to read it.                       */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_OUTLINE ::                                         */\n  /*      The glyph image is a vectorial outline made of line segments     */\n  /*      and Bézier arcs; it can be described as an @FT_Outline; you      */\n  /*      generally want to access the `outline' field of the              */\n  /*      @FT_GlyphSlotRec structure to read it.                           */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */\n  /*      The glyph image is a vectorial path with no inside and outside   */\n  /*      contours.  Some Type~1 fonts, like those in the Hershey family,  */\n  /*      contain glyphs in this format.  These are described as           */\n  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */\n  /*      them correctly.                                                  */\n  /*                                                                       */\n  typedef enum  FT_Glyph_Format_\n  {\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),\n\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )\n\n  } FT_Glyph_Format;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_format_xxx                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Glyph_Format values instead.                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_glyph_format_none      :: See @FT_GLYPH_FORMAT_NONE.            */\n  /*    ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE.       */\n  /*    ft_glyph_format_bitmap    :: See @FT_GLYPH_FORMAT_BITMAP.          */\n  /*    ft_glyph_format_outline   :: See @FT_GLYPH_FORMAT_OUTLINE.         */\n  /*    ft_glyph_format_plotter   :: See @FT_GLYPH_FORMAT_PLOTTER.         */\n  /*                                                                       */\n#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE\n#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE\n#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP\n#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE\n#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            R A S T E R   D E F I N I T I O N S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A raster is a scan converter, in charge of rendering an outline into  */\n  /* a a bitmap.  This section contains the public API for rasters.        */\n  /*                                                                       */\n  /* Note that in FreeType 2, all rasters are now encapsulated within      */\n  /* specific modules called `renderers'.  See `freetype/ftrender.h' for   */\n  /* more details on renderers.                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    raster                                                             */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Scanline Converter                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How vectorial outlines are converted into bitmaps and pixmaps.     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains technical definitions.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Raster                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle (pointer) to a raster object.  Each object can be used    */\n  /*    independently to convert an outline into a bitmap or pixmap.       */\n  /*                                                                       */\n  typedef struct FT_RasterRec_*  FT_Raster;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Span                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a single span of gray (or black) pixels  */\n  /*    when rendering a monochrome or anti-aliased bitmap.                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x        :: The span's horizontal start position.                  */\n  /*                                                                       */\n  /*    len      :: The span's length in pixels.                           */\n  /*                                                                       */\n  /*    coverage :: The span color/coverage, ranging from 0 (background)   */\n  /*                to 255 (foreground).  Only used for anti-aliased       */\n  /*                rendering.                                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is used by the span drawing callback type named     */\n  /*    @FT_SpanFunc which takes the y~coordinate of the span as a         */\n  /*    a parameter.                                                       */\n  /*                                                                       */\n  /*    The coverage value is always between 0 and 255.  If you want less  */\n  /*    gray values, the callback function has to reduce them.             */\n  /*                                                                       */\n  typedef struct  FT_Span_\n  {\n    short           x;\n    unsigned short  len;\n    unsigned char   coverage;\n\n  } FT_Span;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used as a call-back by the anti-aliased renderer in     */\n  /*    order to let client applications draw themselves the gray pixel    */\n  /*    spans on each scan line.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The scanline's y~coordinate.                              */\n  /*                                                                       */\n  /*    count :: The number of spans to draw on this scanline.             */\n  /*                                                                       */\n  /*    spans :: A table of `count' spans to draw on the scanline.         */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This callback allows client applications to directly render the    */\n  /*    gray spans of the anti-aliased bitmap to any kind of surfaces.     */\n  /*                                                                       */\n  /*    This can be used to write anti-aliased outlines directly to a      */\n  /*    given background bitmap, and even perform translucency.            */\n  /*                                                                       */\n  /*    Note that the `count' field cannot be greater than a fixed value   */\n  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */\n  /*    `ftoption.h'.  By default, this value is set to~32, which means    */\n  /*    that if there are more than 32~spans on a given scanline, the      */\n  /*    callback is called several times with the same `y' parameter in    */\n  /*    order to draw all callbacks.                                       */\n  /*                                                                       */\n  /*    Otherwise, the callback is only called once per scan-line, and     */\n  /*    only for those scanlines that do have `gray' pixels on them.       */\n  /*                                                                       */\n  typedef void\n  (*FT_SpanFunc)( int             y,\n                  int             count,\n                  const FT_Span*  spans,\n                  void*           user );\n\n#define FT_Raster_Span_Func  FT_SpanFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitTest_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to test whether a given target pixel is already set to the drawing */\n  /*    `color'.  These tests are crucial to implement drop-out control    */\n  /*    per-se the TrueType spec.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   1~if the pixel is `set', 0~otherwise.                               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_BitTest_Func)( int    y,\n                             int    x,\n                             void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitSet_Func                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to set an individual target pixel.  This is crucial to implement   */\n  /*    drop-out control according to the TrueType specification.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if the pixel is `set', 0~otherwise.                              */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_BitSet_Func)( int    y,\n                            int    x,\n                            void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flag constants as used in the `flags' field of a     */\n  /*    @FT_Raster_Params structure.                                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RASTER_FLAG_DEFAULT :: This value is 0.                         */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_AA      :: This flag is set to indicate that an     */\n  /*                              anti-aliased glyph image should be       */\n  /*                              generated.  Otherwise, it will be        */\n  /*                              monochrome (1-bit).                      */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct      */\n  /*                              rendering.  In this mode, client         */\n  /*                              applications must provide their own span */\n  /*                              callback.  This lets them directly       */\n  /*                              draw or compose over an existing bitmap. */\n  /*                              If this bit is not set, the target       */\n  /*                              pixmap's buffer _must_ be zeroed before  */\n  /*                              rendering.                               */\n  /*                                                                       */\n  /*                              Note that for now, direct rendering is   */\n  /*                              only possible with anti-aliased glyphs.  */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */\n  /*                              rendering mode.  If set, the output will */\n  /*                              be clipped to a box specified in the     */\n  /*                              `clip_box' field of the                  */\n  /*                              @FT_Raster_Params structure.             */\n  /*                                                                       */\n  /*                              Note that by default, the glyph bitmap   */\n  /*                              is clipped to the target pixmap, except  */\n  /*                              in direct rendering mode where all spans */\n  /*                              are generated if no clipping box is set. */\n  /*                                                                       */\n#define FT_RASTER_FLAG_DEFAULT  0x0\n#define FT_RASTER_FLAG_AA       0x1\n#define FT_RASTER_FLAG_DIRECT   0x2\n#define FT_RASTER_FLAG_CLIP     0x4\n\n  /* deprecated */\n#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT\n#define ft_raster_flag_aa       FT_RASTER_FLAG_AA\n#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT\n#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Params                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold the arguments used by a raster's render        */\n  /*    function.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    target      :: The target bitmap.                                  */\n  /*                                                                       */\n  /*    source      :: A pointer to the source glyph image (e.g., an       */\n  /*                   @FT_Outline).                                       */\n  /*                                                                       */\n  /*    flags       :: The rendering flags.                                */\n  /*                                                                       */\n  /*    gray_spans  :: The gray span drawing callback.                     */\n  /*                                                                       */\n  /*    black_spans :: The black span drawing callback.  UNIMPLEMENTED!    */\n  /*                                                                       */\n  /*    bit_test    :: The bit test callback.  UNIMPLEMENTED!              */\n  /*                                                                       */\n  /*    bit_set     :: The bit set callback.  UNIMPLEMENTED!               */\n  /*                                                                       */\n  /*    user        :: User-supplied data that is passed to each drawing   */\n  /*                   callback.                                           */\n  /*                                                                       */\n  /*    clip_box    :: An optional clipping box.  It is only used in       */\n  /*                   direct rendering mode.  Note that coordinates here  */\n  /*                   should be expressed in _integer_ pixels (and not in */\n  /*                   26.6 fixed-point units).                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA    */\n  /*    bit flag is set in the `flags' field, otherwise a monochrome       */\n  /*    bitmap is generated.                                               */\n  /*                                                                       */\n  /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */\n  /*    raster will call the `gray_spans' callback to draw gray pixel      */\n  /*    spans, in the case of an aa glyph bitmap, it will call             */\n  /*    `black_spans', and `bit_test' and `bit_set' in the case of a       */\n  /*    monochrome bitmap.  This allows direct composition over a          */\n  /*    pre-existing bitmap through user-provided callbacks to perform the */\n  /*    span drawing/composition.                                          */\n  /*                                                                       */\n  /*    Note that the `bit_test' and `bit_set' callbacks are required when */\n  /*    rendering a monochrome bitmap, as they are crucial to implement    */\n  /*    correct drop-out control as defined in the TrueType specification. */\n  /*                                                                       */\n  typedef struct  FT_Raster_Params_\n  {\n    const FT_Bitmap*        target;\n    const void*             source;\n    int                     flags;\n    FT_SpanFunc             gray_spans;\n    FT_SpanFunc             black_spans;  /* doesn't work! */\n    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */\n    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */\n    void*                   user;\n    FT_BBox                 clip_box;\n\n  } FT_Raster_Params;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_NewFunc                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create a new raster object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory allocator.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `memory' parameter is a typeless pointer in order to avoid     */\n  /*    un-wanted dependencies on the rest of the FreeType code.  In       */\n  /*    practice, it is an @FT_Memory object, i.e., a handle to the        */\n  /*    standard FreeType memory allocator.  However, this field can be    */\n  /*    completely ignored by a given raster implementation.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_NewFunc)( void*       memory,\n                        FT_Raster*  raster );\n\n#define FT_Raster_New_Func  FT_Raster_NewFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy a given raster object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_DoneFunc)( FT_Raster  raster );\n\n#define FT_Raster_Done_Func  FT_Raster_DoneFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_ResetFunc                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType provides an area of memory called the `render pool',      */\n  /*    available to all registered rasters.  This pool can be freely used */\n  /*    during a given scan-conversion but is shared by all rasters.  Its  */\n  /*    content is thus transient.                                         */\n  /*                                                                       */\n  /*    This function is called each time the render pool changes, or just */\n  /*    after a new raster object is created.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster    :: A handle to the new raster object.                    */\n  /*                                                                       */\n  /*    pool_base :: The address in memory of the render pool.             */\n  /*                                                                       */\n  /*    pool_size :: The size in bytes of the render pool.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Rasters can ignore the render pool and rely on dynamic memory      */\n  /*    allocation if they want to (a handle to the memory allocator is    */\n  /*    passed to the raster constructor).  However, this is not           */\n  /*    recommended for efficiency purposes.                               */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_ResetFunc)( FT_Raster       raster,\n                          unsigned char*  pool_base,\n                          unsigned long   pool_size );\n\n#define FT_Raster_Reset_Func  FT_Raster_ResetFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is a generic facility to change modes or attributes  */\n  /*    in a given raster.  This can be used for debugging purposes, or    */\n  /*    simply to allow implementation-specific `features' in a given      */\n  /*    raster module.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /*    mode   :: A 4-byte tag used to name the mode or property.          */\n  /*                                                                       */\n  /*    args   :: A pointer to the new mode/property to use.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_SetModeFunc)( FT_Raster      raster,\n                            unsigned long  mode,\n                            void*          args );\n\n#define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_RenderFunc                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invoke a given raster to scan-convert a given glyph image into a   */\n  /*    target bitmap.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  /*    params :: A pointer to an @FT_Raster_Params structure used to      */\n  /*              store the rendering parameters.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The exact format of the source image depends on the raster's glyph */\n  /*    format defined in its @FT_Raster_Funcs structure.  It can be an    */\n  /*    @FT_Outline or anything else in order to support a large array of  */\n  /*    glyph formats.                                                     */\n  /*                                                                       */\n  /*    Note also that the render function can fail and return a           */\n  /*    `FT_Err_Unimplemented_Feature' error code if the raster used does  */\n  /*    not support direct composition.                                    */\n  /*                                                                       */\n  /*    XXX: For now, the standard raster doesn't support direct           */\n  /*         composition but this should change for the final release (see */\n  /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */\n  /*         for examples of distinct implementations which support direct */\n  /*         composition).                                                 */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_RenderFunc)( FT_Raster                raster,\n                           const FT_Raster_Params*  params );\n\n#define FT_Raster_Render_Func  FT_Raster_RenderFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   A structure used to describe a given raster class to the library.   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_format  :: The supported glyph format for this raster.       */\n  /*                                                                       */\n  /*    raster_new    :: The raster constructor.                           */\n  /*                                                                       */\n  /*    raster_reset  :: Used to reset the render pool within the raster.  */\n  /*                                                                       */\n  /*    raster_render :: A function to render a glyph into a given bitmap. */\n  /*                                                                       */\n  /*    raster_done   :: The raster destructor.                            */\n  /*                                                                       */\n  typedef struct  FT_Raster_Funcs_\n  {\n    FT_Glyph_Format        glyph_format;\n    FT_Raster_NewFunc      raster_new;\n    FT_Raster_ResetFunc    raster_reset;\n    FT_Raster_SetModeFunc  raster_set_mode;\n    FT_Raster_RenderFunc   raster_render;\n    FT_Raster_DoneFunc     raster_done;\n\n  } FT_Raster_Funcs;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTIMAGE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftincrem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftincrem.h                                                             */\n/*                                                                         */\n/*    FreeType incremental loading (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007, 2008, 2010 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTINCREM_H__\n#define __FTINCREM_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *    incremental\n   *\n   * @title:\n   *    Incremental Loading\n   *\n   * @abstract:\n   *    Custom Glyph Loading.\n   *\n   * @description:\n   *   This section contains various functions used to perform so-called\n   *   `incremental' glyph loading.  This is a mode where all glyphs loaded\n   *   from a given @FT_Face are provided by the client application,\n   *\n   *   Apart from that, all other tables are loaded normally from the font\n   *   file.  This mode is useful when FreeType is used within another\n   *   engine, e.g., a PostScript Imaging Processor.\n   *\n   *   To enable this mode, you must use @FT_Open_Face, passing an\n   *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\n   *   @FT_Incremental_Interface value.  See the comments for\n   *   @FT_Incremental_InterfaceRec for an example.\n   *\n   */\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental\n   *\n   * @description:\n   *   An opaque type describing a user-provided object used to implement\n   *   `incremental' glyph loading within FreeType.  This is used to support\n   *   embedded fonts in certain environments (e.g., PostScript interpreters),\n   *   where the glyph data isn't in the font file, or must be overridden by\n   *   different values.\n   *\n   * @note:\n   *   It is up to client applications to create and implement @FT_Incremental\n   *   objects, as long as they provide implementations for the methods\n   *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\n   *   and @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   *   See the description of @FT_Incremental_InterfaceRec to understand how\n   *   to use incremental objects with FreeType.\n   *\n   */\n  typedef struct FT_IncrementalRec_*  FT_Incremental;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_MetricsRec\n   *\n   * @description:\n   *   A small structure used to contain the basic glyph metrics returned\n   *   by the @FT_Incremental_GetGlyphMetricsFunc method.\n   *\n   * @fields:\n   *   bearing_x ::\n   *     Left bearing, in font units.\n   *\n   *   bearing_y ::\n   *     Top bearing, in font units.\n   *\n   *   advance ::\n   *     Horizontal component of glyph advance, in font units.\n   *\n   *   advance_v ::\n   *     Vertical component of glyph advance, in font units.\n   *\n   * @note:\n   *   These correspond to horizontal or vertical metrics depending on the\n   *   value of the `vertical' argument to the function\n   *   @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   */\n  typedef struct  FT_Incremental_MetricsRec_\n  {\n    FT_Long  bearing_x;\n    FT_Long  bearing_y;\n    FT_Long  advance;\n    FT_Long  advance_v;     /* since 2.3.12 */\n\n  } FT_Incremental_MetricsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_Metrics\n   *\n   * @description:\n   *   A handle to an @FT_Incremental_MetricsRec structure.\n   *\n   */\n   typedef struct FT_Incremental_MetricsRec_*  FT_Incremental_Metrics;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphDataFunc\n   *\n   * @description:\n   *   A function called by FreeType to access a given glyph's data bytes\n   *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\n   *   enabled.\n   *\n   *   Note that the format of the glyph's data bytes depends on the font\n   *   file format.  For TrueType, it must correspond to the raw bytes within\n   *   the `glyf' table.  For PostScript formats, it must correspond to the\n   *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\n   *   undefined for any other format.\n   *\n   * @input:\n   *   incremental ::\n   *     Handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   * @output:\n   *   adata ::\n   *     A structure describing the returned glyph data bytes (which will be\n   *     accessed as a read-only byte block).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If this function returns successfully the method\n   *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\n   *   the data bytes.\n   *\n   *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\n   *   compound glyphs.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\n                                      FT_UInt         glyph_index,\n                                      FT_Data*        adata );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_FreeGlyphDataFunc\n   *\n   * @description:\n   *   A function used to release the glyph data bytes returned by a\n   *   successful call to @FT_Incremental_GetGlyphDataFunc.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   data ::\n   *     A structure describing the glyph data bytes (which will be accessed\n   *     as a read-only byte block).\n   *\n   */\n  typedef void\n  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\n                                       FT_Data*        data );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphMetricsFunc\n   *\n   * @description:\n   *   A function used to retrieve the basic metrics of a given glyph index\n   *   before accessing its data.  This is necessary because, in certain\n   *   formats like TrueType, the metrics are stored in a different place from\n   *   the glyph images proper.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   *   vertical ::\n   *     If true, return vertical metrics.\n   *\n   *   ametrics ::\n   *     This parameter is used for both input and output.\n   *     The original glyph metrics, if any, in font units.  If metrics are\n   *     not available all the values must be set to zero.\n   *\n   * @output:\n   *   ametrics ::\n   *     The replacement glyph metrics in font units.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphMetricsFunc)\n                      ( FT_Incremental              incremental,\n                        FT_UInt                     glyph_index,\n                        FT_Bool                     vertical,\n                        FT_Incremental_MetricsRec  *ametrics );\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_FuncsRec\n   *\n   * @description:\n   *   A table of functions for accessing fonts that load data\n   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\n   *\n   * @fields:\n   *   get_glyph_data ::\n   *     The function to get glyph data.  Must not be null.\n   *\n   *   free_glyph_data ::\n   *     The function to release glyph data.  Must not be null.\n   *\n   *   get_glyph_metrics ::\n   *     The function to get glyph metrics.  May be null if the font does\n   *     not provide overriding glyph metrics.\n   *\n   */\n  typedef struct  FT_Incremental_FuncsRec_\n  {\n    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\n    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\n    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\n\n  } FT_Incremental_FuncsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_InterfaceRec\n   *\n   * @description:\n   *   A structure to be used with @FT_Open_Face to indicate that the user\n   *   wants to support incremental glyph loading.  You should use it with\n   *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\n   *\n   *     {\n   *       FT_Incremental_InterfaceRec  inc_int;\n   *       FT_Parameter                 parameter;\n   *       FT_Open_Args                 open_args;\n   *\n   *\n   *       // set up incremental descriptor\n   *       inc_int.funcs  = my_funcs;\n   *       inc_int.object = my_object;\n   *\n   *       // set up optional parameter\n   *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\n   *       parameter.data = &inc_int;\n   *\n   *       // set up FT_Open_Args structure\n   *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\n   *       open_args.pathname   = my_font_pathname;\n   *       open_args.num_params = 1;\n   *       open_args.params     = &parameter; // we use one optional argument\n   *\n   *       // open the font\n   *       error = FT_Open_Face( library, &open_args, index, &face );\n   *       ...\n   *     }\n   *\n   */\n  typedef struct  FT_Incremental_InterfaceRec_\n  {\n    const FT_Incremental_FuncsRec*  funcs;\n    FT_Incremental                  object;\n\n  } FT_Incremental_InterfaceRec;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_Interface\n   *\n   * @description:\n   *   A pointer to an @FT_Incremental_InterfaceRec structure.\n   *\n   */\n  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_INCREMENTAL\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to indicate\n   *   an incremental loading object to be used by FreeType.\n   *\n   */\n#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTINCREM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftlcdfil.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.h                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2006, 2007, 2008, 2010 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_LCD_FILTER_H__\n#define __FT_LCD_FILTER_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *   lcd_filtering\n   *\n   * @title:\n   *   LCD Filtering\n   *\n   * @abstract:\n   *   Reduce color fringes of LCD-optimized bitmaps.\n   *\n   * @description:\n   *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass\n   *   filter which is then applied to LCD-optimized bitmaps generated\n   *   through @FT_Render_Glyph.  This is useful to reduce color fringes\n   *   which would occur with unfiltered rendering.\n   *\n   *   Note that no filter is active by default, and that this function is\n   *   *not* implemented in default builds of the library.  You need to\n   *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file\n   *   in order to activate it.\n   */\n\n\n  /****************************************************************************\n   *\n   * @enum:\n   *   FT_LcdFilter\n   *\n   * @description:\n   *   A list of values to identify various types of LCD filters.\n   *\n   * @values:\n   *   FT_LCD_FILTER_NONE ::\n   *     Do not perform filtering.  When used with subpixel rendering, this\n   *     results in sometimes severe color fringes.\n   *\n   *   FT_LCD_FILTER_DEFAULT ::\n   *     The default filter reduces color fringes considerably, at the cost\n   *     of a slight blurriness in the output.\n   *\n   *   FT_LCD_FILTER_LIGHT ::\n   *     The light filter is a variant that produces less blurriness at the\n   *     cost of slightly more color fringes than the default one.  It might\n   *     be better, depending on taste, your monitor, or your personal vision.\n   *\n   *   FT_LCD_FILTER_LEGACY ::\n   *     This filter corresponds to the original libXft color filter.  It\n   *     provides high contrast output but can exhibit really bad color\n   *     fringes if glyphs are not extremely well hinted to the pixel grid.\n   *     In other words, it only works well if the TrueType bytecode\n   *     interpreter is enabled *and* high-quality hinted fonts are used.\n   *\n   *     This filter is only provided for comparison purposes, and might be\n   *     disabled or stay unsupported in the future.\n   *\n   * @since:\n   *   2.3.0\n   */\n  typedef enum  FT_LcdFilter_\n  {\n    FT_LCD_FILTER_NONE    = 0,\n    FT_LCD_FILTER_DEFAULT = 1,\n    FT_LCD_FILTER_LIGHT   = 2,\n    FT_LCD_FILTER_LEGACY  = 16,\n\n    FT_LCD_FILTER_MAX   /* do not remove */\n\n  } FT_LcdFilter;\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilter\n   *\n   * @description:\n   *   This function is used to apply color filtering to LCD decimated\n   *   bitmaps, like the ones used when calling @FT_Render_Glyph with\n   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   filter ::\n   *     The filter type.\n   *\n   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or\n   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work\n   *     well on most LCD screens.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This feature is always disabled by default.  Clients must make an\n   *   explicit call to this function with a `filter' value other than\n   *   @FT_LCD_FILTER_NONE in order to enable it.\n   *\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,\n   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.\n   *\n   *   It does _not_ affect the output of @FT_Outline_Render and\n   *   @FT_Outline_Get_Bitmap.\n   *\n   *   If this feature is activated, the dimensions of LCD glyph bitmaps are\n   *   either larger or taller than the dimensions of the corresponding\n   *   outline with regards to the pixel grid.  For example, for\n   *   @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and\n   *   up to 3~pixels to the right.\n   *\n   *   The bitmap offset values are adjusted correctly, so clients shouldn't\n   *   need to modify their layout and glyph positioning code when enabling\n   *   the filter.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter );\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilterWeights\n   *\n   * @description:\n   *   Use this function to override the filter weights selected by\n   *   @FT_Library_SetLcdFilter.  By default, FreeType uses the quintuple\n   *   (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,\n   *   0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and\n   *   FT_LCD_FILTER_LEGACY.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   weights ::\n   *     A pointer to an array; the function copies the first five bytes and\n   *     uses them to specify the filter weights.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   This function must be called after @FT_Library_SetLcdFilter to have\n   *   any effect.\n   *\n   * @since:\n   *   2.4.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_LCD_FILTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftlist.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlist.h                                                               */\n/*                                                                         */\n/*    Generic list support for FreeType (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file implements functions relative to list processing.  Its     */\n  /*  data structures are defined in `freetype.h'.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTLIST_H__\n#define __FTLIST_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    List Processing                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Simple management of lists.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various definitions related to list          */\n  /*    processing using doubly-linked nodes.                              */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_List                                                            */\n  /*    FT_ListNode                                                        */\n  /*    FT_ListRec                                                         */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /*    FT_List_Add                                                        */\n  /*    FT_List_Insert                                                     */\n  /*    FT_List_Find                                                       */\n  /*    FT_List_Remove                                                     */\n  /*    FT_List_Up                                                         */\n  /*    FT_List_Iterate                                                    */\n  /*    FT_List_Iterator                                                   */\n  /*    FT_List_Finalize                                                   */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Find                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the list node for a given listed object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    data :: The address of the listed object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    List node.  NULL if it wasn't found.                               */\n  /*                                                                       */\n  FT_EXPORT( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Add                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Append an element to the end of a list.                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to append.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Insert                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Insert an element at the head of a list.                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to parent list.                                  */\n  /*    node :: The node to insert.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Remove                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a node from a list.  This function doesn't check whether    */\n  /*    the node is in the list!                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The node to remove.                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Up                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Move a node to the head/top of a list.  Used to maintain LRU       */\n  /*    lists.                                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to move.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Iterator                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An FT_List iterator function which is called during a list parse   */\n  /*    by @FT_List_Iterate.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The current iteration list node.                           */\n  /*                                                                       */\n  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */\n  /*            Can be used to point to the iteration's state.             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_List_Iterator)( FT_ListNode  node,\n                       void*        user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Iterate                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse a list and calls a given iterator function on each element.  */\n  /*    Note that parsing is stopped as soon as one of the iterator calls  */\n  /*    returns a non-zero value.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list     :: A handle to the list.                                  */\n  /*    iterator :: An iterator function, called on each node of the list. */\n  /*    user     :: A user-supplied field which is passed as the second    */\n  /*                argument to the iterator.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result (a FreeType error code) of the last iterator call.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An @FT_List iterator function which is called during a list        */\n  /*    finalization by @FT_List_Finalize to destroy all elements in a     */\n  /*    given list.                                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    system :: The current system object.                               */\n  /*                                                                       */\n  /*    data   :: The current object to destroy.                           */\n  /*                                                                       */\n  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */\n  /*              be used to point to the iteration's state.               */\n  /*                                                                       */\n  typedef void\n  (*FT_List_Destructor)( FT_Memory  memory,\n                         void*      data,\n                         void*      user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Finalize                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy all elements in the list as well as the list itself.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list    :: A handle to the list.                                   */\n  /*                                                                       */\n  /*    destroy :: A list destructor that will be applied to each element  */\n  /*               of the list.                                            */\n  /*                                                                       */\n  /*    memory  :: The current memory object which handles deallocation.   */\n  /*                                                                       */\n  /*    user    :: A user-supplied field which is passed as the last       */\n  /*               argument to the destructor.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function expects that all nodes added by @FT_List_Add or      */\n  /*    @FT_List_Insert have been dynamically allocated.                   */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLIST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftlzw.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.h                                                                */\n/*                                                                         */\n/*    LZW-compressed stream support.                                       */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTLZW_H__\n#define __FTLZW_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    lzw                                                                */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    LZW Streams                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using LZW-compressed font files.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of LZW-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenLZW\n  *\n  * @description:\n  *   Open a new stream to parse LZW-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.Z' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream :: The target embedding stream.\n  *\n  *   source :: The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream\n  *\n  *   In certain builds of the library, LZW compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a LZW stream from it\n  *   and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with LZW support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLZW_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftmac.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.h                                                                */\n/*                                                                         */\n/*    Additional Mac-specific API.                                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2007 by                               */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* NOTE: Include this file after <freetype/freetype.h> and after any       */\n/*       Mac-specific headers (because this header uses Mac types such as  */\n/*       Handle, FSSpec, FSRef, etc.)                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMAC_H__\n#define __FTMAC_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n/* gcc-3.4.1 and later can warn about functions tagged as deprecated */\n#ifndef FT_DEPRECATED_ATTRIBUTE\n#if defined(__GNUC__)                                               && \\\n    ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define FT_DEPRECATED_ATTRIBUTE  __attribute__((deprecated))\n#else\n#define FT_DEPRECATED_ATTRIBUTE\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    mac_specific                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Mac Specific Interface                                             */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Only available on the Macintosh.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following definitions are only available if FreeType is        */\n  /*    compiled on a Macintosh.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FOND                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a FOND resource.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fond       :: A FOND resource.                                     */\n  /*                                                                       */\n  /*    face_index :: Only supported for the -1 `sanity check' special     */\n  /*                  case.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Notes>                                                               */\n  /*    This function can be used to create @FT_Face objects from fonts    */\n  /*    that are installed in the system as follows.                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      fond = GetResource( 'FOND', fontName );                          */\n  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face    *aface )\n                       FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_Name                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */\n  /*                  Bold).                                               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file.  For passing to                  */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face.  For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n                          FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_ATS_Name                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font in ATS framework.            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file. For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face. For passing to                    */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n                              FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFilePath_From_Mac_ATS_Name                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pathname of the disk file and face index for given font   */\n  /*    name which is handled by ATS framework.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName    :: Mac OS name of the font in ATS framework.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    path        :: Buffer to store pathname of the file.  For passing  */\n  /*                   to @FT_New_Face.  The client must allocate this     */\n  /*                   buffer before calling this function.                */\n  /*                                                                       */\n  /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */\n  /*                                                                       */\n  /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index )\n                                  FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSSpec to the font file.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSSpec to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */\n  /*    it accepts an FSSpec instead of a path.                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec  *spec,\n                           FT_Long        face_index,\n                           FT_Face       *aface )\n                         FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSRef to the font file.                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSRef to the font file.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */\n  /*    it accepts an FSRef instead of a path.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef  *ref,\n                          FT_Long       face_index,\n                          FT_Face      *aface )\n                        FT_DEPRECATED_ATTRIBUTE;\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTMAC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.h                                                                 */\n/*                                                                         */\n/*    FreeType Multiple Master font interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMM_H__\n#define __FTMM_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    multiple_masters                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Multiple Masters                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to manage Multiple Masters fonts.                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following types and functions are used to manage Multiple      */\n  /*    Master fonts, i.e., the selection of specific design instances by  */\n  /*    setting design axis coordinates.                                   */\n  /*                                                                       */\n  /*    George Williams has extended this interface to make it work with   */\n  /*    both Type~1 Multiple Masters fonts and GX distortable (var)        */\n  /*    fonts.  Some of these routines only work with MM fonts, others     */\n  /*    will work with both types.  They are similar enough that a         */\n  /*    consistent interface makes sense.                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Axis                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  typedef struct  FT_MM_Axis_\n  {\n    FT_String*  name;\n    FT_Long     minimum;\n    FT_Long     maximum;\n\n  } FT_MM_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Multi_Master                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis    :: Number of axes.  Cannot exceed~4.                   */\n  /*                                                                       */\n  /*    num_designs :: Number of designs; should be normally 2^num_axis    */\n  /*                   even though the Type~1 specification strangely      */\n  /*                   allows for intermediate designs to be present. This */\n  /*                   number cannot exceed~16.                            */\n  /*                                                                       */\n  /*    axis        :: A table of axis descriptors.                        */\n  /*                                                                       */\n  typedef struct  FT_Multi_Master_\n  {\n    FT_UInt     num_axis;\n    FT_UInt     num_designs;\n    FT_MM_Axis  axis[T1_MAX_MM_AXIS];\n\n  } FT_Multi_Master;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Axis                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters and GX var fonts.                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*               Not always meaningful for GX.                           */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    def     :: The axis's default design coordinate.                   */\n  /*               FreeType computes meaningful default values for MM; it  */\n  /*               is then an integer value, not in 16.16 format.          */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  /*    tag     :: The axis's tag (the GX equivalent to `name').           */\n  /*               FreeType provides default values for MM if possible.    */\n  /*                                                                       */\n  /*    strid   :: The entry in `name' table (another GX version of        */\n  /*               `name').                                                */\n  /*               Not meaningful for MM.                                  */\n  /*                                                                       */\n  typedef struct  FT_Var_Axis_\n  {\n    FT_String*  name;\n\n    FT_Fixed    minimum;\n    FT_Fixed    def;\n    FT_Fixed    maximum;\n\n    FT_ULong    tag;\n    FT_UInt     strid;\n\n  } FT_Var_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Named_Style                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a named style in a GX var font.   */\n  /*                                                                       */\n  /*    This structure can't be used for MM fonts.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    coords :: The design coordinates for this style.                   */\n  /*              This is an array with one entry for each axis.           */\n  /*                                                                       */\n  /*    strid  :: The entry in `name' table identifying this style.        */\n  /*                                                                       */\n  typedef struct  FT_Var_Named_Style_\n  {\n    FT_Fixed*  coords;\n    FT_UInt    strid;\n\n  } FT_Var_Named_Style;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Var                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    or GX var distortable font.                                        */\n  /*                                                                       */\n  /*    Some fields are specific to one format and not to the other.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis        :: The number of axes.  The maximum value is~4 for */\n  /*                       MM; no limit in GX.                             */\n  /*                                                                       */\n  /*    num_designs     :: The number of designs; should be normally       */\n  /*                       2^num_axis for MM fonts.  Not meaningful for GX */\n  /*                       (where every glyph could have a different       */\n  /*                       number of designs).                             */\n  /*                                                                       */\n  /*    num_namedstyles :: The number of named styles; only meaningful for */\n  /*                       GX which allows certain design coordinates to   */\n  /*                       have a string ID (in the `name' table)          */\n  /*                       associated with them.  The font can tell the    */\n  /*                       user that, for example, Weight=1.5 is `Bold'.   */\n  /*                                                                       */\n  /*    axis            :: A table of axis descriptors.                    */\n  /*                       GX fonts contain slightly more data than MM.    */\n  /*                                                                       */\n  /*    namedstyles     :: A table of named styles.                        */\n  /*                       Only meaningful with GX.                        */\n  /*                                                                       */\n  typedef struct  FT_MM_Var_\n  {\n    FT_UInt              num_axis;\n    FT_UInt              num_designs;\n    FT_UInt              num_namedstyles;\n    FT_Var_Axis*         axis;\n    FT_Var_Named_Style*  namedstyle;\n\n  } FT_MM_Var;\n\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Multi_Master                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master descriptor of a given font.           */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master/GX var descriptor of a given font.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters/GX var descriptor.                 */\n  /*               Allocates a data structure, which the user must free    */\n  /*               (a single call to FT_FREE will do it).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Design_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters fonts, choose an interpolated font design     */\n  /*    through design coordinates.                                        */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Design_Coordinates                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */\n  /*    design through design coordinates.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Blend_Coordinates                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters and GX var fonts, choose an interpolated font */\n  /*    design through normalized blend coordinates.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: The design coordinates array (each element must be   */\n  /*                  between 0 and 1.0).                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Blend_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftmodapi.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmodapi.h                                                             */\n/*                                                                         */\n/*    FreeType modules public interface (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMODAPI_H__\n#define __FTMODAPI_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Module Management                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to add, upgrade, and remove modules from FreeType.             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The definitions below are used to manage modules within FreeType.  */\n  /*    Modules can be added, upgraded, and removed at runtime.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* module bit flags */\n#define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */\n#define FT_MODULE_RENDERER            2  /* this module is a renderer     */\n#define FT_MODULE_HINTER              4  /* this module is a glyph hinter */\n#define FT_MODULE_STYLER              8  /* this module is a styler       */\n\n#define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */\n                                              /* scalable fonts           */\n#define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */\n                                              /* support vector outlines  */\n#define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */\n                                              /* own hinter               */\n\n\n  /* deprecated values */\n#define ft_module_font_driver         FT_MODULE_FONT_DRIVER\n#define ft_module_renderer            FT_MODULE_RENDERER\n#define ft_module_hinter              FT_MODULE_HINTER\n#define ft_module_styler              FT_MODULE_STYLER\n\n#define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE\n#define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES\n#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER\n\n\n  typedef FT_Pointer  FT_Module_Interface;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Constructor                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to initialize (not create) a new module object.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to initialize.                                */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Constructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destructor                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to finalize (not destroy) a given module object.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to finalize.                                  */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Requester                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to query a given module for a specific interface.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to finalize.                                  */\n  /*                                                                       */\n  /*    name ::   The name of the interface in the module.                 */\n  /*                                                                       */\n  typedef FT_Module_Interface\n  (*FT_Module_Requester)( FT_Module    module,\n                          const char*  name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The module class descriptor.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    module_flags    :: Bit flags describing the module.                */\n  /*                                                                       */\n  /*    module_size     :: The size of one module object/instance in       */\n  /*                       bytes.                                          */\n  /*                                                                       */\n  /*    module_name     :: The name of the module.                         */\n  /*                                                                       */\n  /*    module_version  :: The version, as a 16.16 fixed number            */\n  /*                       (major.minor).                                  */\n  /*                                                                       */\n  /*    module_requires :: The version of FreeType this module requires,   */\n  /*                       as a 16.16 fixed number (major.minor).  Starts  */\n  /*                       at version 2.0, i.e., 0x20000.                  */\n  /*                                                                       */\n  /*    module_init     :: The initializing function.                      */\n  /*                                                                       */\n  /*    module_done     :: The finalizing function.                        */\n  /*                                                                       */\n  /*    get_interface   :: The interface requesting function.              */\n  /*                                                                       */\n  typedef struct  FT_Module_Class_\n  {\n    FT_ULong               module_flags;\n    FT_Long                module_size;\n    const FT_String*       module_name;\n    FT_Fixed               module_version;\n    FT_Fixed               module_requires;\n\n    const void*            module_interface;\n\n    FT_Module_Constructor  module_init;\n    FT_Module_Destructor   module_done;\n    FT_Module_Requester    get_interface;\n\n  } FT_Module_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add a new module to a given library instance.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    clazz   :: A pointer to class descriptor for the module.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find a module by its name.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module handle.  0~if none was found.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    FreeType's internal modules aren't documented very well, and you   */\n  /*    should look up the source code for details.                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Remove_Module                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a given module from a library instance.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module  :: A handle to a module object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The module object is destroyed by the function in case of success. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Library                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Library         */\n  /*    structure is created.  This function increments the counter.       */\n  /*    @FT_Done_Library then only destroys a library if the counter is~1, */\n  /*    otherwise it simply decrements the counter.                        */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Library objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a target library object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Library( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Library                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to create a new FreeType library instance    */\n  /*    from a given memory object.  It is thus possible to use libraries  */\n  /*    with distinct memory allocators within the same program.           */\n  /*                                                                       */\n  /*    Normally, you would call this function (followed by a call to      */\n  /*    @FT_Add_Default_Modules or a series of calls to @FT_Add_Module)    */\n  /*    instead of @FT_Init_FreeType to initialize the FreeType library.   */\n  /*                                                                       */\n  /*    Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a      */\n  /*    library instance.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A handle to the original memory object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A pointer to handle of a new library object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Library                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given library object.  This closes all drivers and       */\n  /*    discards all resource objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Library( FT_Library  library );\n\n/* */\n\n  typedef void\n  (*FT_DebugHook_Func)( void*  arg );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set a debug hook function for debugging the interpreter of a font  */\n  /*    format.                                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hook_index :: The index of the debug hook.  You should use the     */\n  /*                  values defined in `ftobjs.h', e.g.,                  */\n  /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */\n  /*                                                                       */\n  /*    debug_hook :: The function used to debug the interpreter.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, four debug hook slots are available, but only two (for  */\n  /*    the TrueType and the Type~1 interpreter) are defined.              */\n  /*                                                                       */\n  /*    Since the internal headers of FreeType are no longer installed,    */\n  /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */\n  /*    This is a bug and will be fixed in a forthcoming release.          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add the set of default drivers to a given library object.          */\n  /*    This is only useful when you create a library object with          */\n  /*    @FT_New_Library (usually to plug a custom memory manager).         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a new library object.                       */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Add_Default_Modules( FT_Library  library );\n\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   truetype_engine\n   *\n   * @title:\n   *   The TrueType Engine\n   *\n   * @abstract:\n   *   TrueType bytecode support.\n   *\n   * @description:\n   *   This section contains a function used to query the level of TrueType\n   *   bytecode support compiled in this version of the library.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   *  @enum:\n   *     FT_TrueTypeEngineType\n   *\n   *  @description:\n   *     A list of values describing which kind of TrueType bytecode\n   *     engine is implemented in a given FT_Library instance.  It is used\n   *     by the @FT_Get_TrueType_Engine_Type function.\n   *\n   *  @values:\n   *     FT_TRUETYPE_ENGINE_TYPE_NONE ::\n   *       The library doesn't implement any kind of bytecode interpreter.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::\n   *       The library implements a bytecode interpreter that doesn't\n   *       support the patented operations of the TrueType virtual machine.\n   *\n   *       Its main use is to load certain Asian fonts which position and\n   *       scale glyph components with bytecode instructions.  It produces\n   *       bad output for most other fonts.\n   *\n   *    FT_TRUETYPE_ENGINE_TYPE_PATENTED ::\n   *       The library implements a bytecode interpreter that covers\n   *       the full instruction set of the TrueType virtual machine (this\n   *       was governed by patents until May 2010, hence the name).\n   *\n   *  @since:\n   *       2.2\n   *\n   */\n  typedef enum  FT_TrueTypeEngineType_\n  {\n    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n\n  } FT_TrueTypeEngineType;\n\n\n  /**************************************************************************\n   *\n   *  @func:\n   *     FT_Get_TrueType_Engine_Type\n   *\n   *  @description:\n   *     Return an @FT_TrueTypeEngineType value to indicate which level of\n   *     the TrueType virtual machine a given library instance supports.\n   *\n   *  @input:\n   *     library ::\n   *       A library instance.\n   *\n   *  @return:\n   *     A value indicating which level is supported.\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  FT_EXPORT( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMODAPI_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftmoderr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmoderr.h                                                             */\n/*                                                                         */\n/*    FreeType module error offsets (specification).                       */\n/*                                                                         */\n/*  Copyright 2001, 2002, 2003, 2004, 2005, 2010 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the FreeType module error offsets.        */\n  /*                                                                       */\n  /* The lower byte gives the error code, the higher byte gives the        */\n  /* module.  The base module has error offset 0.  For example, the error  */\n  /* `FT_Err_Invalid_File_Format' has value 0x003, the error               */\n  /* `TT_Err_Invalid_File_Format' has value 0x1103, the error              */\n  /* `T1_Err_Invalid_File_Format' has value 0x1203, etc.                   */\n  /*                                                                       */\n  /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h   */\n  /* to make the higher byte always zero (disabling the module error       */\n  /* mechanism).                                                           */\n  /*                                                                       */\n  /* It can also be used to create a module error message table easily     */\n  /* with something like                                                   */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     #undef __FTMODERR_H__                                             */\n  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */\n  /*     #define FT_MODERR_START_LIST     {                                */\n  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */\n  /*                                                                       */\n  /*     const struct                                                      */\n  /*     {                                                                 */\n  /*       int          mod_err_offset;                                    */\n  /*       const char*  mod_err_msg                                        */\n  /*     } ft_mod_errors[] =                                               */\n  /*                                                                       */\n  /*     #include FT_MODULE_ERRORS_H                                       */\n  /*   }                                                                   */\n  /*                                                                       */\n  /* To use such a table, all errors must be ANDed with 0xFF00 to remove   */\n  /* the error code.                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTMODERR_H__\n#define __FTMODERR_H__\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#ifndef FT_MODERRDEF\n\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,\n#else\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,\n#endif\n\n#define FT_MODERR_START_LIST  enum {\n#define FT_MODERR_END_LIST    FT_Mod_Err_Max };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_MODERRDEF */\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****               LIST MODULE ERROR BASES                   *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_MODERR_START_LIST\n  FT_MODERR_START_LIST\n#endif\n\n\n  FT_MODERRDEF( Base,      0x000, \"base module\" )\n  FT_MODERRDEF( Autofit,   0x100, \"autofitter module\" )\n  FT_MODERRDEF( BDF,       0x200, \"BDF module\" )\n  FT_MODERRDEF( Bzip2,     0x300, \"Bzip2 module\" )\n  FT_MODERRDEF( Cache,     0x400, \"cache module\" )\n  FT_MODERRDEF( CFF,       0x500, \"CFF module\" )\n  FT_MODERRDEF( CID,       0x600, \"CID module\" )\n  FT_MODERRDEF( Gzip,      0x700, \"Gzip module\" )\n  FT_MODERRDEF( LZW,       0x800, \"LZW module\" )\n  FT_MODERRDEF( OTvalid,   0x900, \"OpenType validation module\" )\n  FT_MODERRDEF( PCF,       0xA00, \"PCF module\" )\n  FT_MODERRDEF( PFR,       0xB00, \"PFR module\" )\n  FT_MODERRDEF( PSaux,     0xC00, \"PS auxiliary module\" )\n  FT_MODERRDEF( PShinter,  0xD00, \"PS hinter module\" )\n  FT_MODERRDEF( PSnames,   0xE00, \"PS names module\" )\n  FT_MODERRDEF( Raster,    0xF00, \"raster module\" )\n  FT_MODERRDEF( SFNT,     0x1000, \"SFNT module\" )\n  FT_MODERRDEF( Smooth,   0x1100, \"smooth raster module\" )\n  FT_MODERRDEF( TrueType, 0x1200, \"TrueType module\" )\n  FT_MODERRDEF( Type1,    0x1300, \"Type 1 module\" )\n  FT_MODERRDEF( Type42,   0x1400, \"Type 42 module\" )\n  FT_MODERRDEF( Winfonts, 0x1500, \"Windows FON/FNT module\" )\n\n\n#ifdef FT_MODERR_END_LIST\n  FT_MODERR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      CLEANUP                            *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_MODERR_START_LIST\n#undef FT_MODERR_END_LIST\n#undef FT_MODERRDEF\n#undef FT_NEED_EXTERN_C\n\n\n#endif /* __FTMODERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (specification).         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/*                                                                         */\n/* Warning: This module might be moved to a different library in the       */\n/*          future to avoid a tight dependency between FreeType and the    */\n/*          OpenType specification.                                        */\n/*                                                                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOTVAL_H__\n#define __FTOTVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    ot_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    OpenType Validation                                                */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate OpenType tables.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_OTXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_OpenType_Validate to\n  *    indicate which OpenType tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_BASE ::\n  *      Validate BASE table.\n  *\n  *    FT_VALIDATE_GDEF ::\n  *      Validate GDEF table.\n  *\n  *    FT_VALIDATE_GPOS ::\n  *      Validate GPOS table.\n  *\n  *    FT_VALIDATE_GSUB ::\n  *      Validate GSUB table.\n  *\n  *    FT_VALIDATE_JSTF ::\n  *      Validate JSTF table.\n  *\n  *    FT_VALIDATE_MATH ::\n  *      Validate MATH table.\n  *\n  *    FT_VALIDATE_OT ::\n  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).\n  *\n  */\n#define FT_VALIDATE_BASE  0x0100\n#define FT_VALIDATE_GDEF  0x0200\n#define FT_VALIDATE_GPOS  0x0400\n#define FT_VALIDATE_GSUB  0x0800\n#define FT_VALIDATE_JSTF  0x1000\n#define FT_VALIDATE_MATH  0x2000\n\n#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\\n                        FT_VALIDATE_GDEF | \\\n                        FT_VALIDATE_GPOS | \\\n                        FT_VALIDATE_GSUB | \\\n                        FT_VALIDATE_JSTF | \\\n                        FT_VALIDATE_MATH\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Validate\n  *\n  * @description:\n  *    Validate various OpenType tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_OTXXX for possible values.\n  *\n  * @output:\n  *    BASE_table ::\n  *       A pointer to the BASE table.\n  *\n  *    GDEF_table ::\n  *       A pointer to the GDEF table.\n  *\n  *    GPOS_table ::\n  *       A pointer to the GPOS table.\n  *\n  *    GSUB_table ::\n  *       A pointer to the GSUB table.\n  *\n  *    JSTF_table ::\n  *       A pointer to the JSTF table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with OpenType fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the five tables with\n  *   @FT_OpenType_Free.  A NULL value indicates that the table either\n  *   doesn't exist in the font, or the application hasn't asked for\n  *   validation.\n  */\n  FT_EXPORT( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table );\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Free\n  *\n  * @description:\n  *    Free the buffer allocated by OpenType validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_OpenType_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_OpenType_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftoutln.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.h                                                              */\n/*                                                                         */\n/*    Support for the FT_Outline type used to store glyph shapes of        */\n/*    most scalable font formats (specification).                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005-2011 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOUTLN_H__\n#define __FTOUTLN_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Outline Processing                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions to create, transform, and render vectorial glyph images. */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains routines used to create and destroy scalable */\n  /*    glyph images known as `outlines'.  These can also be measured,     */\n  /*    transformed, and converted into bitmaps and pixmaps.               */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Outline                                                         */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*    FT_Outline_New                                                     */\n  /*    FT_Outline_Done                                                    */\n  /*    FT_Outline_Copy                                                    */\n  /*    FT_Outline_Translate                                               */\n  /*    FT_Outline_Transform                                               */\n  /*    FT_Outline_Embolden                                                */\n  /*    FT_Outline_Reverse                                                 */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /*    FT_Outline_Get_CBox                                                */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /*    FT_Outline_Decompose                                               */\n  /*    FT_Outline_Funcs                                                   */\n  /*    FT_Outline_MoveTo_Func                                             */\n  /*    FT_Outline_LineTo_Func                                             */\n  /*    FT_Outline_ConicTo_Func                                            */\n  /*    FT_Outline_CubicTo_Func                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walk over an outline's structure to decompose it into individual   */\n  /*    segments and Bézier arcs.  This function also emits `move to'      */\n  /*    operations to indicate the start of new contours in the outline.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e., function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer which is passed to each       */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_New                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new outline of a given size.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object from where the       */\n  /*                   outline is allocated.  Note however that the new    */\n  /*                   outline will *not* necessarily be *freed*, when     */\n  /*                   destroying the library, by @FT_Done_FreeType.       */\n  /*                                                                       */\n  /*    numPoints   :: The maximal number of points within the outline.    */\n  /*                                                                       */\n  /*    numContours :: The maximal number of contours within the outline.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    anoutline   :: A handle to the new outline.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' parameter is simply */\n  /*    to use the library's memory allocator.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy an outline created with @FT_Outline_New.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle of the library object used to allocate the     */\n  /*               outline.                                                */\n  /*                                                                       */\n  /*    outline :: A pointer to the outline object to be discarded.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the outline's `owner' field is not set, only the outline        */\n  /*    descriptor will be released.                                       */\n  /*                                                                       */\n  /*    The reason why this function takes an `library' parameter is       */\n  /*    simply to use ft_mem_free().                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check the contents of an outline descriptor.                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A handle to a source outline.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_CBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an outline's `control box'.  The control box encloses all   */\n  /*    the outline's points, including Bézier control points.  Though it  */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox   :: The outline's control box.                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Translate                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple translation to the points of an outline.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    xOffset :: The horizontal offset.                                  */\n  /*                                                                       */\n  /*    yOffset :: The vertical offset.                                    */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Copy                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy an outline into another one.  Both objects must have the      */\n  /*    same sizes (number of points & number of contours) when this       */\n  /*    function is called.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source outline.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target outline.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Transform                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple 2x2 matrix to all of an outline's points.  Useful   */\n  /*    for applying rotations, slanting, flipping, etc.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix  :: A pointer to the transformation matrix.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can use @FT_Outline_Translate if you need to translate the     */\n  /*    outline's points.                                                  */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Embolden                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be at most 4~times      */\n  /*    `strength' pixels wider and higher.  You may think of the left and */\n  /*    bottom borders as unchanged.                                       */\n  /*                                                                       */\n  /*    Negative `strength' values to reduce the outline thickness are     */\n  /*    possible also.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline  :: A handle to the target outline.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strength :: How strong the glyph is emboldened.  Expressed in      */\n  /*                26.6 pixel format.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The used algorithm to increase or decrease the thickness of the    */\n  /*    glyph doesn't change the number of points; this means that certain */\n  /*    situations like acute angles or intersections are sometimes        */\n  /*    handled incorrectly.                                               */\n  /*                                                                       */\n  /*    If you need `better' metrics values you should call                */\n  /*    @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.                      */\n  /*                                                                       */\n  /*    Example call:                                                      */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */\n  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */\n  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Reverse                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reverse the drawing direction of an outline.  This is used to      */\n  /*    ensure consistent fill conventions for mirrored glyphs.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in     */\n  /*    the outline's `flags' field.                                       */\n  /*                                                                       */\n  /*    It shouldn't be used by a normal client application, unless it     */\n  /*    knows what it is doing.                                            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Reverse( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap.  The outline's image is simply  */\n  /*    OR-ed to the target bitmap.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the target bitmap descriptor.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT CREATE the bitmap, it only renders an       */\n  /*    outline image within the one you pass to it!  Consequently, the    */\n  /*    various fields in `abitmap' should be set accordingly.             */\n  /*                                                                       */\n  /*    It will use the raster corresponding to the default glyph format.  */\n  /*                                                                       */\n  /*    The value of the `num_grays' field in `abitmap' is ignored.  If    */\n  /*    you select the gray-level rasterizer, and you want less than 256   */\n  /*    gray levels, you have to use @FT_Outline_Render directly.          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap using the current scan-convert.  */\n  /*    This function uses an @FT_Raster_Params structure as an argument,  */\n  /*    allowing advanced features like direct composition, translucency,  */\n  /*    etc.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    params  :: A pointer to an @FT_Raster_Params structure used to     */\n  /*               describe the rendering operation.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should know what you are doing and how @FT_Raster_Params works */\n  /*    to use this function.                                              */\n  /*                                                                       */\n  /*    The field `params.source' will be set to `outline' before the scan */\n  /*    converter is called, which means that the value you give to it is  */\n  /*    actually ignored.                                                  */\n  /*                                                                       */\n  /*    The gray-level rasterizer always uses 256 gray levels.  If you     */\n  /*    want less gray levels, you have to provide your own span callback. */\n  /*    See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the   */\n  /*    @FT_Raster_Params structure for more details.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params );\n\n\n /**************************************************************************\n  *\n  * @enum:\n  *   FT_Orientation\n  *\n  * @description:\n  *   A list of values used to describe an outline's contour orientation.\n  *\n  *   The TrueType and PostScript specifications use different conventions\n  *   to determine whether outline contours should be filled or unfilled.\n  *\n  * @values:\n  *   FT_ORIENTATION_TRUETYPE ::\n  *     According to the TrueType specification, clockwise contours must\n  *     be filled, and counter-clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_POSTSCRIPT ::\n  *     According to the PostScript specification, counter-clockwise contours\n  *     must be filled, and clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_FILL_RIGHT ::\n  *     This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\n  *     remember that in TrueType, everything that is to the right of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_FILL_LEFT ::\n  *     This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\n  *     remember that in PostScript, everything that is to the left of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_NONE ::\n  *     The orientation cannot be determined.  That is, different parts of\n  *     the glyph have different orientation.\n  *\n  */\n  typedef enum  FT_Orientation_\n  {\n    FT_ORIENTATION_TRUETYPE   = 0,\n    FT_ORIENTATION_POSTSCRIPT = 1,\n    FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\n    FT_ORIENTATION_FILL_LEFT  = FT_ORIENTATION_POSTSCRIPT,\n    FT_ORIENTATION_NONE\n\n  } FT_Orientation;\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Outline_Get_Orientation\n  *\n  * @description:\n  *   This function analyzes a glyph outline and tries to compute its\n  *   fill orientation (see @FT_Orientation).  This is done by computing\n  *   the direction of each global horizontal and/or vertical extrema\n  *   within the outline.\n  *\n  *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty\n  *   outlines.\n  *\n  * @input:\n  *   outline ::\n  *     A handle to the source outline.\n  *\n  * @return:\n  *   The orientation.\n  *\n  */\n  FT_EXPORT( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOUTLN_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (specification only).   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2008, 2009 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTPFR_H__\n#define __FTPFR_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    pfr_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    PFR Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    PFR/TrueDoc specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of PFR-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Metrics\n  *\n  * @description:\n  *    Return the outline and metrics resolutions of a given PFR face.\n  *\n  * @input:\n  *    face :: Handle to the input face.  It can be a non-PFR face.\n  *\n  * @output:\n  *    aoutline_resolution ::\n  *      Outline resolution.  This is equivalent to `face->units_per_EM'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_resolution ::\n  *      Metrics resolution.  This is equivalent to `outline_resolution'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_x_scale ::\n  *      A 16.16 fixed-point number used to scale distance expressed\n  *      in metrics units to device sub-pixels.  This is equivalent to\n  *      `face->size->x_scale', but for metrics only.  Optional (parameter\n  *      can be NULL).\n  *\n  *    ametrics_y_scale ::\n  *      Same as `ametrics_x_scale' but for the vertical direction.\n  *      optional (parameter can be NULL).\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If the input face is not a PFR, this function will return an error.\n  *   However, in all cases, it will return valid values.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Kerning\n  *\n  * @description:\n  *    Return the kerning pair corresponding to two glyphs in a PFR face.\n  *    The distance is expressed in metrics units, unlike the result of\n  *    @FT_Get_Kerning.\n  *\n  * @input:\n  *    face  :: A handle to the input face.\n  *\n  *    left  :: Index of the left glyph.\n  *\n  *    right :: Index of the right glyph.\n  *\n  * @output:\n  *    avector :: A kerning vector.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    This function always return distances in original PFR metrics\n  *    units.  This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED\n  *    mode, which always returns distances converted to outline units.\n  *\n  *    You can use the value of the `x_scale' and `y_scale' parameters\n  *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Advance\n  *\n  * @description:\n  *    Return a given glyph advance, expressed in original metrics units,\n  *    from a PFR font.\n  *\n  * @input:\n  *    face   :: A handle to the input face.\n  *\n  *    gindex :: The glyph index.\n  *\n  * @output:\n  *    aadvance :: The glyph advance in metrics units.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics\n  *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftrender.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrender.h                                                             */\n/*                                                                         */\n/*    FreeType renderer modules public interface (specification).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2005, 2006, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRENDER_H__\n#define __FTRENDER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph object */\n  typedef FT_Error\n  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,\n                        FT_GlyphSlot  slot );\n\n  /* destroys a given glyph object */\n  typedef void\n  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );\n\n  typedef void\n  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,\n                             const FT_Matrix*  matrix,\n                             const FT_Vector*  delta );\n\n  typedef void\n  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,\n                           FT_BBox*  abbox );\n\n  typedef FT_Error\n  (*FT_Glyph_CopyFunc)( FT_Glyph   source,\n                        FT_Glyph   target );\n\n  typedef FT_Error\n  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,\n                           FT_GlyphSlot  slot );\n\n/* deprecated */\n#define FT_Glyph_Init_Func       FT_Glyph_InitFunc\n#define FT_Glyph_Done_Func       FT_Glyph_DoneFunc\n#define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc\n#define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc\n#define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc\n#define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc\n\n\n  struct  FT_Glyph_Class_\n  {\n    FT_Long                 glyph_size;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_InitFunc       glyph_init;\n    FT_Glyph_DoneFunc       glyph_done;\n    FT_Glyph_CopyFunc       glyph_copy;\n    FT_Glyph_TransformFunc  glyph_transform;\n    FT_Glyph_GetBBoxFunc    glyph_bbox;\n    FT_Glyph_PrepareFunc    glyph_prepare;\n  };\n\n\n  typedef FT_Error\n  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,\n                             FT_GlyphSlot      slot,\n                             FT_UInt           mode,\n                             const FT_Vector*  origin );\n\n  typedef FT_Error\n  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,\n                                FT_GlyphSlot      slot,\n                                const FT_Matrix*  matrix,\n                                const FT_Vector*  delta );\n\n\n  typedef void\n  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,\n                              FT_GlyphSlot  slot,\n                              FT_BBox*      cbox );\n\n\n  typedef FT_Error\n  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,\n                              FT_ULong     mode_tag,\n                              FT_Pointer   mode_ptr );\n\n/* deprecated identifiers */\n#define FTRenderer_render  FT_Renderer_RenderFunc\n#define FTRenderer_transform  FT_Renderer_TransformFunc\n#define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc\n#define FTRenderer_setMode  FT_Renderer_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The renderer module class descriptor.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root            :: The root @FT_Module_Class fields.               */\n  /*                                                                       */\n  /*    glyph_format    :: The glyph image format this renderer handles.   */\n  /*                                                                       */\n  /*    render_glyph    :: A method used to render the image that is in a  */\n  /*                       given glyph slot into a bitmap.                 */\n  /*                                                                       */\n  /*    transform_glyph :: A method used to transform the image that is in */\n  /*                       a given glyph slot.                             */\n  /*                                                                       */\n  /*    get_glyph_cbox  :: A method used to access the glyph's cbox.       */\n  /*                                                                       */\n  /*    set_mode        :: A method used to pass additional parameters.    */\n  /*                                                                       */\n  /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */\n  /*                       This is a pointer to its raster's class.        */\n  /*                                                                       */\n  typedef struct  FT_Renderer_Class_\n  {\n    FT_Module_Class            root;\n\n    FT_Glyph_Format            glyph_format;\n\n    FT_Renderer_RenderFunc     render_glyph;\n    FT_Renderer_TransformFunc  transform_glyph;\n    FT_Renderer_GetCBoxFunc    get_glyph_cbox;\n    FT_Renderer_SetModeFunc    set_mode;\n\n    FT_Raster_Funcs*           raster_class;\n\n  } FT_Renderer_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the current renderer for a given glyph format.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /*    format  :: The glyph format.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A renderer handle.  0~if none found.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */\n  /*    renderer by its name, use @FT_Get_Module.                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the current renderer to use, and set additional mode.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    renderer   :: A handle to the renderer object.                     */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    parameters :: Additional parameters.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case of success, the renderer will be used to convert glyph     */\n  /*    images in the renderer's known format into bitmaps.                */\n  /*                                                                       */\n  /*    This doesn't change the current renderer for other formats.        */\n  /*                                                                       */\n  /*    Currently, only the B/W renderer, if compiled with                 */\n  /*    FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels               */\n  /*    anti-aliasing mode; this option must be set directly in            */\n  /*    `ftraster.c' and is undefined by default) accepts a single tag     */\n  /*    `pal5' to set its gray palette as a character string with          */\n  /*    5~elements.  Consequently, the third and fourth argument are zero  */\n  /*    normally.                                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTRENDER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftsizes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsizes.h                                                              */\n/*                                                                         */\n/*    FreeType size objects management (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Typical application would normally not need to use these functions.   */\n  /* However, they have been placed in a public API for the rare cases     */\n  /* where they are needed.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSIZES_H__\n#define __FTSIZES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sizes_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Size Management                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Managing multiple sizes per face.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    When creating a new face object (e.g., with @FT_New_Face), an      */\n  /*    @FT_Size object is automatically created and used to store all     */\n  /*    pixel-size dependent information, available in the `face->size'    */\n  /*    field.                                                             */\n  /*                                                                       */\n  /*    It is however possible to create more sizes for a given face,      */\n  /*    mostly in order to manage several character pixel sizes of the     */\n  /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */\n  /*                                                                       */\n  /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */\n  /*    modify the contents of the current `active' size; you thus need    */\n  /*    to use @FT_Activate_Size to change it.                             */\n  /*                                                                       */\n  /*    99% of applications won't need the functions provided here,        */\n  /*    especially if they use the caching sub-system, so be cautious      */\n  /*    when using these.                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Size                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new size object from a given face object.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a parent face object.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize :: A handle to a new size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You need to call @FT_Activate_Size in order to select the new size */\n  /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */\n  /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size*  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Size                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given size object.  Note that @FT_Done_Face              */\n  /*    automatically discards all size objects allocated with             */\n  /*    @FT_New_Size.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Size( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Activate_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Even though it is possible to create several size objects for a    */\n  /*    given face (see @FT_New_Size for details), functions like          */\n  /*    @FT_Load_Glyph or @FT_Load_Char only use the one which has been    */\n  /*    activated last to determine the `current character pixel size'.    */\n  /*                                                                       */\n  /*    This function can be used to `activate' a previously created size  */\n  /*    object.                                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `face' is the size's parent face object, this function changes  */\n  /*    the value of `face->size' to the input size handle.                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Activate_Size( FT_Size  size );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSIZES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftsnames.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.h                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (specification).  */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_SFNT_NAMES_H__\n#define __FT_SFNT_NAMES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sfnt_names                                                         */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    SFNT Names                                                         */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Access the names embedded in TrueType and OpenType files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType and OpenType specifications allow the inclusion of    */\n  /*    a special `names table' in font files.  This table contains        */\n  /*    textual (and internationalized) information regarding the font,    */\n  /*    like family name, copyright, version, etc.                         */\n  /*                                                                       */\n  /*    The definitions below are used to access them if available.        */\n  /*                                                                       */\n  /*    Note that this has nothing to do with glyph names!                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SfntName                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model an SFNT `name' table entry.              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platform_id :: The platform ID for `string'.                       */\n  /*                                                                       */\n  /*    encoding_id :: The encoding ID for `string'.                       */\n  /*                                                                       */\n  /*    language_id :: The language ID for `string'.                       */\n  /*                                                                       */\n  /*    name_id     :: An identifier for `string'.                         */\n  /*                                                                       */\n  /*    string      :: The `name' string.  Note that its format differs    */\n  /*                   depending on the (platform,encoding) pair.  It can  */\n  /*                   be a Pascal String, a UTF-16 one, etc.              */\n  /*                                                                       */\n  /*                   Generally speaking, the string is not               */\n  /*                   zero-terminated.  Please refer to the TrueType      */\n  /*                   specification for details.                          */\n  /*                                                                       */\n  /*    string_len  :: The length of `string' in bytes.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Possible values for `platform_id', `encoding_id', `language_id',   */\n  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */\n  /*    please refer to the TrueType or OpenType specification.            */\n  /*                                                                       */\n  /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */\n  /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */\n  /*                                                                       */\n  typedef struct  FT_SfntName_\n  {\n    FT_UShort  platform_id;\n    FT_UShort  encoding_id;\n    FT_UShort  language_id;\n    FT_UShort  name_id;\n\n    FT_Byte*   string;      /* this string is *not* null-terminated! */\n    FT_UInt    string_len;  /* in bytes */\n\n  } FT_SfntName;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name_Count                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the number of name strings in the SFNT `name' table.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of strings in the `name' table.                         */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a string of the SFNT `name' table for a given index.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to the source face.                              */\n  /*                                                                       */\n  /*    idx   :: The index of the `name' string.                           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aname :: The indexed @FT_SfntName structure.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `string' array returned in the `aname' structure is not        */\n  /*    null-terminated.  The application should deallocate it if it is no */\n  /*    longer in use.                                                     */\n  /*                                                                       */\n  /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */\n  /*    `name' table entries, then do a loop until you get the right       */\n  /*    platform, encoding, and name ID.                                   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname );\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred family subfamily names in `name'\n   *   table since OpenType version 1.4.  For backwards compatibility with\n   *   legacy systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred subfamily names in `name' table since\n   *   OpenType version 1.4.  For backwards compatibility with legacy\n   *   systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_SFNT_NAMES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftstroke.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.h                                                             */\n/*                                                                         */\n/*    FreeType path stroker (specification).                               */\n/*                                                                         */\n/*  Copyright 2002-2006, 2008, 2009, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_STROKE_H__\n#define __FT_STROKE_H__\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n /************************************************************************\n  *\n  * @section:\n  *    glyph_stroker\n  *\n  * @title:\n  *    Glyph Stroker\n  *\n  * @abstract:\n  *    Generating bordered and stroked glyphs.\n  *\n  * @description:\n  *    This component generates stroked outlines of a given vectorial\n  *    glyph.  It also allows you to retrieve the `outside' and/or the\n  *    `inside' borders of the stroke.\n  *\n  *    This can be useful to generate `bordered' glyph, i.e., glyphs\n  *    displayed with a coloured (and anti-aliased) border around their\n  *    shape.\n  */\n\n\n /**************************************************************\n  *\n  * @type:\n  *   FT_Stroker\n  *\n  * @description:\n  *   Opaque handler to a path stroker object.\n  */\n  typedef struct FT_StrokerRec_*  FT_Stroker;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineJoin\n   *\n   * @description:\n   *   These values determine how two joining lines are rendered\n   *   in a stroker.\n   *\n   * @values:\n   *   FT_STROKER_LINEJOIN_ROUND ::\n   *     Used to render rounded line joins.  Circular arcs are used\n   *     to join two lines smoothly.\n   *\n   *   FT_STROKER_LINEJOIN_BEVEL ::\n   *     Used to render beveled line joins.  The outer corner of\n   *     the joined lines is filled by enclosing the triangular\n   *     region of the corner with a straight line between the\n   *     outer corners of each stroke.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_FIXED ::\n   *     Used to render mitered line joins, with fixed bevels if the\n   *     miter limit is exceeded.  The outer edges of the strokes\n   *     for the two segments are extended until they meet at an\n   *     angle.  If the segments meet at too sharp an angle (such\n   *     that the miter would extend from the intersection of the \n   *     segments a distance greater than the product of the miter \n   *     limit value and the border radius), then a bevel join (see \n   *     above) is used instead.  This prevents long spikes being \n   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter \n   *     line join as used in PostScript and PDF.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::\n   *   FT_STROKER_LINEJOIN_MITER ::\n   *     Used to render mitered line joins, with variable bevels if\n   *     the miter limit is exceeded.  The intersection of the \n   *     strokes is clipped at a line perpendicular to the bisector \n   *     of the angle between the strokes, at the distance from the \n   *     intersection of the segments equal to the product of the \n   *     miter limit value and the border radius.  This prevents \n   *     long spikes being created.  \n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line \n   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias \n   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for \n   *     backwards compatibility.\n   */\n  typedef enum  FT_Stroker_LineJoin_\n  {\n    FT_STROKER_LINEJOIN_ROUND          = 0,\n    FT_STROKER_LINEJOIN_BEVEL          = 1,\n    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,\n    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,\n    FT_STROKER_LINEJOIN_MITER_FIXED    = 3\n\n  } FT_Stroker_LineJoin;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineCap\n   *\n   * @description:\n   *   These values determine how the end of opened sub-paths are\n   *   rendered in a stroke.\n   *\n   * @values:\n   *   FT_STROKER_LINECAP_BUTT ::\n   *     The end of lines is rendered as a full stop on the last\n   *     point itself.\n   *\n   *   FT_STROKER_LINECAP_ROUND ::\n   *     The end of lines is rendered as a half-circle around the\n   *     last point.\n   *\n   *   FT_STROKER_LINECAP_SQUARE ::\n   *     The end of lines is rendered as a square around the\n   *     last point.\n   */\n  typedef enum  FT_Stroker_LineCap_\n  {\n    FT_STROKER_LINECAP_BUTT = 0,\n    FT_STROKER_LINECAP_ROUND,\n    FT_STROKER_LINECAP_SQUARE\n\n  } FT_Stroker_LineCap;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_StrokerBorder\n   *\n   * @description:\n   *   These values are used to select a given stroke border\n   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.\n   *\n   * @values:\n   *   FT_STROKER_BORDER_LEFT ::\n   *     Select the left border, relative to the drawing direction.\n   *\n   *   FT_STROKER_BORDER_RIGHT ::\n   *     Select the right border, relative to the drawing direction.\n   *\n   * @note:\n   *   Applications are generally interested in the `inside' and `outside'\n   *   borders.  However, there is no direct mapping between these and the\n   *   `left' and `right' ones, since this really depends on the glyph's\n   *   drawing orientation, which varies between font formats.\n   *\n   *   You can however use @FT_Outline_GetInsideBorder and\n   *   @FT_Outline_GetOutsideBorder to get these.\n   */\n  typedef enum  FT_StrokerBorder_\n  {\n    FT_STROKER_BORDER_LEFT = 0,\n    FT_STROKER_BORDER_RIGHT\n\n  } FT_StrokerBorder;\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetInsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `inside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetOutsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `outside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_New\n   *\n   * @description:\n   *   Create a new stroker object.\n   *\n   * @input:\n   *   library ::\n   *     FreeType library handle.\n   *\n   * @output:\n   *   astroker ::\n   *     A new stroker object handle.  NULL in case of error.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Set\n   *\n   * @description:\n   *   Reset a stroker object's attributes.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   radius ::\n   *     The border radius.\n   *\n   *   line_cap ::\n   *     The line cap style.\n   *\n   *   line_join ::\n   *     The line join style.\n   *\n   *   miter_limit ::\n   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,\n   *     expressed as 16.16 fixed point value.\n   *\n   * @note:\n   *   The radius is expressed in the same units as the outline\n   *   coordinates.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Rewind\n   *\n   * @description:\n   *   Reset a stroker object without changing its attributes.\n   *   You should call this function before beginning a new\n   *   series of calls to @FT_Stroker_BeginSubPath or\n   *   @FT_Stroker_EndSubPath.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ParseOutline\n   *\n   * @description:\n   *   A convenience function used to parse a whole outline with\n   *   the stroker.  The resulting outline(s) can be retrieved\n   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The source outline.\n   *\n   *   opened ::\n   *     A boolean.  If~1, the outline is treated as an open path instead\n   *     of a closed one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If `opened' is~0 (the default), the outline is treated as a closed\n   *   path, and the stroker generates two distinct `border' outlines.\n   *\n   *   If `opened' is~1, the outline is processed as an open path, and the\n   *   stroker generates a single `stroke' outline.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_BeginSubPath\n   *\n   * @description:\n   *   Start a new sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the start vector.\n   *\n   *   open ::\n   *     A boolean.  If~1, the sub-path is treated as an open one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function is useful when you need to stroke a path that is\n   *   not stored as an @FT_Outline object.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_EndSubPath\n   *\n   * @description:\n   *   Close the current sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function after @FT_Stroker_BeginSubPath.\n   *   If the subpath was not `opened', this function `draws' a\n   *   single line segment to the start position when needed.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_LineTo\n   *\n   * @description:\n   *   `Draw' a single line segment in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ConicTo\n   *\n   * @description:\n   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control ::\n   *     A pointer to a Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_CubicTo\n   *\n   * @description:\n   *   `Draw' a single cubic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control1 ::\n   *     A pointer to the first Bézier control point.\n   *\n   *   control2 ::\n   *     A pointer to second Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetBorderCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export one of the `border' or `stroke'\n   *   outlines generated by the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_GetCounts instead if you want to\n   *   retrieve the counts associated to both borders.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ExportBorder\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the corresponding border to your own @FT_Outline\n   *   structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   *   outline ::\n   *     The target outline handle.\n   *\n   * @note:\n   *   Always call this function after @FT_Stroker_GetBorderCounts to\n   *   get sure that there is enough room in your @FT_Outline object to\n   *   receive all new data.\n   *\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps. The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_Export instead if you want to\n   *   retrieve all borders at once.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export all points/borders from the stroked\n   *   outline/path.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Export\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export all borders to your own @FT_Outline structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The target outline handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Done\n   *\n   * @description:\n   *   Destroy a stroker object.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.  Can be NULL.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Done( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_Stroke\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_StrokeBorder\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker, but\n   *   only return either its inside or outside border.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   inside ::\n   *     A Boolean.  If~1, return the inside border, otherwise\n   *     the outside border.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FT_STROKE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftsynth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.h                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting              */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2006, 2008 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********        WARNING, THIS IS ALPHA CODE!  THIS API         *********/\n  /*********    IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE    *********/\n  /*********            FREETYPE DEVELOPMENT TEAM                  *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Main reason for not lifting the functions in this module to a  */\n  /* `standard' API is that the used parameters for emboldening and */\n  /* slanting are not configurable.  Consider the functions as a    */\n  /* code resource which should be copied into the application and  */\n  /* adapted to the particular needs.                               */\n\n\n#ifndef __FTSYNTH_H__\n#define __FTSYNTH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /* Embolden a glyph by a `reasonable' value (which is highly a matter of */\n  /* taste).  This function is actually a convenience function, providing  */\n  /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */\n  /*                                                                       */\n  /* For emboldened outlines the metrics are estimates only; if you need   */\n  /* precise values you should call @FT_Outline_Get_CBox.                  */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );\n\n  /* Slant an outline glyph to the right by about 12 degrees. */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTSYNTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftsystem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.h                                                             */\n/*                                                                         */\n/*    FreeType low-level system interface definition (specification).      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSYSTEM_H__\n#define __FTSYSTEM_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   system_interface                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   System Interface                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   How FreeType manages memory and i/o.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This section contains various definitions related to memory         */\n  /*   management and i/o access.  You need to understand this             */\n  /*   information if you want to use a custom memory manager or you own   */\n  /*   i/o streams.                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  M E M O R Y   M A N A G E M E N T                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Memory\n   *\n   * @description:\n   *   A handle to a given memory manager object, defined with an\n   *   @FT_MemoryRec structure.\n   *\n   */\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Alloc_Func\n   *\n   * @description:\n   *   A function used to allocate `size' bytes from `memory'.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   size ::\n   *     The size in bytes to allocate.\n   *\n   * @return:\n   *   Address of new memory block.  0~in case of failure.\n   *\n   */\n  typedef void*\n  (*FT_Alloc_Func)( FT_Memory  memory,\n                    long       size );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Free_Func\n   *\n   * @description:\n   *   A function used to release a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   block ::\n   *     The address of the target memory block.\n   *\n   */\n  typedef void\n  (*FT_Free_Func)( FT_Memory  memory,\n                   void*      block );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Realloc_Func\n   *\n   * @description:\n   *   A function used to re-allocate a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   cur_size ::\n   *     The block's current size in bytes.\n   *\n   *   new_size ::\n   *     The block's requested new size.\n   *\n   *   block ::\n   *     The block's current address.\n   *\n   * @return:\n   *   New block address.  0~in case of memory shortage.\n   *\n   * @note:\n   *   In case of error, the old block must still be available.\n   *\n   */\n  typedef void*\n  (*FT_Realloc_Func)( FT_Memory  memory,\n                      long       cur_size,\n                      long       new_size,\n                      void*      block );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_MemoryRec\n   *\n   * @description:\n   *   A structure used to describe a given memory manager to FreeType~2.\n   *\n   * @fields:\n   *   user ::\n   *     A generic typeless pointer for user data.\n   *\n   *   alloc ::\n   *     A pointer type to an allocation function.\n   *\n   *   free ::\n   *     A pointer type to an memory freeing function.\n   *\n   *   realloc ::\n   *     A pointer type to a reallocation function.\n   *\n   */\n  struct  FT_MemoryRec_\n  {\n    void*            user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       I / O   M A N A G E M E N T                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Stream\n   *\n   * @description:\n   *   A handle to an input stream.\n   *\n   */\n  typedef struct FT_StreamRec_*  FT_Stream;\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamDesc\n   *\n   * @description:\n   *   A union type used to store either a long or a pointer.  This is used\n   *   to store a file descriptor or a `FILE*' in an input stream.\n   *\n   */\n  typedef union  FT_StreamDesc_\n  {\n    long   value;\n    void*  pointer;\n\n  } FT_StreamDesc;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_IoFunc\n   *\n   * @description:\n   *   A function used to seek and read data from a given input stream.\n   *\n   * @input:\n   *   stream ::\n   *     A handle to the source stream.\n   *\n   *   offset ::\n   *     The offset of read in stream (always from start).\n   *\n   *   buffer ::\n   *     The address of the read buffer.\n   *\n   *   count ::\n   *     The number of bytes to read from the stream.\n   *\n   * @return:\n   *   The number of bytes effectively read by the stream.\n   *\n   * @note:\n   *   This function might be called to perform a seek or skip operation\n   *   with a `count' of~0.  A non-zero return value then indicates an\n   *   error.\n   *\n   */\n  typedef unsigned long\n  (*FT_Stream_IoFunc)( FT_Stream       stream,\n                       unsigned long   offset,\n                       unsigned char*  buffer,\n                       unsigned long   count );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_CloseFunc\n   *\n   * @description:\n   *   A function used to close a given input stream.\n   *\n   * @input:\n   *  stream ::\n   *     A handle to the target stream.\n   *\n   */\n  typedef void\n  (*FT_Stream_CloseFunc)( FT_Stream  stream );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamRec\n   *\n   * @description:\n   *   A structure used to describe an input stream.\n   *\n   * @input:\n   *   base ::\n   *     For memory-based streams, this is the address of the first stream\n   *     byte in memory.  This field should always be set to NULL for\n   *     disk-based streams.\n   *\n   *   size ::\n   *     The stream size in bytes.\n   *\n   *   pos ::\n   *     The current position within the stream.\n   *\n   *   descriptor ::\n   *     This field is a union that can hold an integer or a pointer.  It is\n   *     used by stream implementations to store file descriptors or `FILE*'\n   *     pointers.\n   *\n   *   pathname ::\n   *     This field is completely ignored by FreeType.  However, it is often\n   *     useful during debugging to use it to store the stream's filename\n   *     (where available).\n   *\n   *   read ::\n   *     The stream's input function.\n   *\n   *   close ::\n   *     The stream's close function.\n   *\n   *   memory ::\n   *     The memory manager to use to preload frames.  This is set\n   *     internally by FreeType and shouldn't be touched by stream\n   *     implementations.\n   *\n   *   cursor ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   *   limit ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   */\n  typedef struct  FT_StreamRec_\n  {\n    unsigned char*       base;\n    unsigned long        size;\n    unsigned long        pos;\n\n    FT_StreamDesc        descriptor;\n    FT_StreamDesc        pathname;\n    FT_Stream_IoFunc     read;\n    FT_Stream_CloseFunc  close;\n\n    FT_Memory            memory;\n    unsigned char*       cursor;\n    unsigned char*       limit;\n\n  } FT_StreamRec;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSYSTEM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/fttrigon.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.h                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (specification).                    */\n/*                                                                         */\n/*  Copyright 2001, 2003, 2005, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTRIGON_H__\n#define __FTTRIGON_H__\n\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   computations                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Angle\n   *\n   * @description:\n   *   This type is used to model angle values in FreeType.  Note that the\n   *   angle is a 16.16 fixed float value expressed in degrees.\n   *\n   */\n  typedef FT_Fixed  FT_Angle;\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI\n   *\n   * @description:\n   *   The angle pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI  ( 180L << 16 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_2PI\n   *\n   * @description:\n   *   The angle 2*pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI2\n   *\n   * @description:\n   *   The angle pi/2 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI4\n   *\n   * @description:\n   *   The angle pi/4 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Sin\n   *\n   * @description:\n   *   Return the sinus of a given angle in fixed point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The sinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Sin( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Cos\n   *\n   * @description:\n   *   Return the cosinus of a given angle in fixed point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The cosinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Cos( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Tan\n   *\n   * @description:\n   *   Return the tangent of a given angle in fixed point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The tangent value.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Tan( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Atan2\n   *\n   * @description:\n   *   Return the arc-tangent corresponding to a given vector (x,y) in\n   *   the 2d plane.\n   *\n   * @input:\n   *   x ::\n   *     The horizontal vector coordinate.\n   *\n   *   y ::\n   *     The vertical vector coordinate.\n   *\n   * @return:\n   *   The arc-tangent value (i.e. angle).\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Atan2( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Angle_Diff\n   *\n   * @description:\n   *   Return the difference between two angles.  The result is always\n   *   constrained to the ]-PI..PI] interval.\n   *\n   * @input:\n   *   angle1 ::\n   *     First angle.\n   *\n   *   angle2 ::\n   *     Second angle.\n   *\n   * @return:\n   *   Constrained value of `value2-value1'.\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Unit\n   *\n   * @description:\n   *   Return the unit vector corresponding to a given angle.  After the\n   *   call, the value of `vec.x' will be `sin(angle)', and the value of\n   *   `vec.y' will be `cos(angle)'.\n   *\n   *   This function is useful to retrieve both the sinus and cosinus of a\n   *   given angle quickly.\n   *\n   * @output:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Rotate\n   *\n   * @description:\n   *   Rotate a vector by a given angle.\n   *\n   * @inout:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Length\n   *\n   * @description:\n   *   Return the length of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @return:\n   *   The vector length, expressed in the same units that the original\n   *   vector coordinates.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Polarize\n   *\n   * @description:\n   *   Compute both the length and angle of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @output:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_From_Polar\n   *\n   * @description:\n   *   Compute vector coordinates from a length and angle.\n   *\n   * @output:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @input:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTTRIGON_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/fttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttypes.h                                                              */\n/*                                                                         */\n/*    FreeType simple types definitions (specification only).              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTYPES_H__\n#define __FTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_SYSTEM_H\n#include FT_IMAGE_H\n\n#include <stddef.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Basic Data Types                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The basic data types defined by the library.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the basic data types defined by FreeType~2,  */\n  /*    ranging from simple scalar types to bitmap descriptors.  More      */\n  /*    font-specific structures are defined in a different section.       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Byte                                                            */\n  /*    FT_Bytes                                                           */\n  /*    FT_Char                                                            */\n  /*    FT_Int                                                             */\n  /*    FT_UInt                                                            */\n  /*    FT_Int16                                                           */\n  /*    FT_UInt16                                                          */\n  /*    FT_Int32                                                           */\n  /*    FT_UInt32                                                          */\n  /*    FT_Short                                                           */\n  /*    FT_UShort                                                          */\n  /*    FT_Long                                                            */\n  /*    FT_ULong                                                           */\n  /*    FT_Bool                                                            */\n  /*    FT_Offset                                                          */\n  /*    FT_PtrDist                                                         */\n  /*    FT_String                                                          */\n  /*    FT_Tag                                                             */\n  /*    FT_Error                                                           */\n  /*    FT_Fixed                                                           */\n  /*    FT_Pointer                                                         */\n  /*    FT_Pos                                                             */\n  /*    FT_Vector                                                          */\n  /*    FT_BBox                                                            */\n  /*    FT_Matrix                                                          */\n  /*    FT_FWord                                                           */\n  /*    FT_UFWord                                                          */\n  /*    FT_F2Dot14                                                         */\n  /*    FT_UnitVector                                                      */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /*                                                                       */\n  /*    FT_Generic                                                         */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /*    FT_Bitmap                                                          */\n  /*    FT_Pixel_Mode                                                      */\n  /*    FT_Palette_Mode                                                    */\n  /*    FT_Glyph_Format                                                    */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bool                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef of unsigned char, used for simple booleans.  As usual,   */\n  /*    values 1 and~0 represent true and false, respectively.             */\n  /*                                                                       */\n  typedef unsigned char  FT_Bool;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_FWord                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 16-bit integer used to store a distance in original font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  typedef signed short  FT_FWord;   /* distance in FUnits */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UFWord                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An unsigned 16-bit integer used to store a distance in original    */\n  /*    font units.                                                        */\n  /*                                                                       */\n  typedef unsigned short  FT_UFWord;  /* unsigned distance */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Char                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _signed_ char type.                       */\n  /*                                                                       */\n  typedef signed char  FT_Char;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Byte                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _unsigned_ char type.                     */\n  /*                                                                       */\n  typedef unsigned char  FT_Byte;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bytes                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for constant memory areas.                               */\n  /*                                                                       */\n  typedef const FT_Byte*  FT_Bytes;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Tag                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for 32-bit tags (as used in the SFNT format).            */\n  /*                                                                       */\n  typedef FT_UInt32  FT_Tag;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_String                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the char type, usually used for strings.      */\n  /*                                                                       */\n  typedef char  FT_String;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Short                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed short.                                        */\n  /*                                                                       */\n  typedef signed short  FT_Short;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UShort                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned short.                                      */\n  /*                                                                       */\n  typedef unsigned short  FT_UShort;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the int type.                                        */\n  /*                                                                       */\n  typedef signed int  FT_Int;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the unsigned int type.                               */\n  /*                                                                       */\n  typedef unsigned int  FT_UInt;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Long                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed long.                                         */\n  /*                                                                       */\n  typedef signed long  FT_Long;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ULong                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned long.                                       */\n  /*                                                                       */\n  typedef unsigned long  FT_ULong;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F2Dot14                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 2.14 fixed float type used for unit vectors.              */\n  /*                                                                       */\n  typedef signed short  FT_F2Dot14;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 26.6 fixed float type used for vectorial pixel            */\n  /*    coordinates.                                                       */\n  /*                                                                       */\n  typedef signed long  FT_F26Dot6;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Fixed                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is used to store 16.16 fixed float values, like scaling  */\n  /*    values or matrix coefficients.                                     */\n  /*                                                                       */\n  typedef signed long  FT_Fixed;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Error                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType error code type.  A value of~0 is always interpreted  */\n  /*    as a successful operation.                                         */\n  /*                                                                       */\n  typedef int  FT_Error;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pointer                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for a typeless pointer.                           */\n  /*                                                                       */\n  typedef void*  FT_Pointer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Offset                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `size_t' type, i.e., the largest  */\n  /*    _unsigned_ integer type used to express a file size or position,   */\n  /*    or a memory block size.                                            */\n  /*                                                                       */\n  typedef size_t  FT_Offset;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_PtrDist                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the       */\n  /*    largest _signed_ integer type used to express the distance         */\n  /*    between two pointers.                                              */\n  /*                                                                       */\n  typedef ft_ptrdiff_t  FT_PtrDist;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_UnitVector                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector unit vector.  Uses    */\n  /*    FT_F2Dot14 types.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: Horizontal coordinate.                                        */\n  /*                                                                       */\n  /*    y :: Vertical coordinate.                                          */\n  /*                                                                       */\n  typedef struct  FT_UnitVector_\n  {\n    FT_F2Dot14  x;\n    FT_F2Dot14  y;\n\n  } FT_UnitVector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Matrix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */\n  /*    in 16.16 fixed float format.  The computation performed is:        */\n  /*                                                                       */\n  /*       {                                                               */\n  /*          x' = x*xx + y*xy                                             */\n  /*          y' = x*yx + y*yy                                             */\n  /*       }                                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    xy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  typedef struct  FT_Matrix_\n  {\n    FT_Fixed  xx, xy;\n    FT_Fixed  yx, yy;\n\n  } FT_Matrix;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read-only binary data represented as a pointer and a length.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    pointer :: The data.                                               */\n  /*                                                                       */\n  /*    length  :: The length of the data in bytes.                        */\n  /*                                                                       */\n  typedef struct  FT_Data_\n  {\n    const FT_Byte*  pointer;\n    FT_Int          length;\n\n  } FT_Data;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Describe a function used to destroy the `client' data of any       */\n  /*    FreeType object.  See the description of the @FT_Generic type for  */\n  /*    details of usage.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The address of the FreeType object which is under finalization.    */\n  /*    Its client data is accessed through its `generic' field.           */\n  /*                                                                       */\n  typedef void  (*FT_Generic_Finalizer)(void*  object);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Generic                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Client applications often need to associate their own data to a    */\n  /*    variety of FreeType core objects.  For example, a text layout API  */\n  /*    might want to associate a glyph cache to a given size object.      */\n  /*                                                                       */\n  /*    Most FreeType object contains a `generic' field, of type           */\n  /*    FT_Generic, which usage is left to client applications and font    */\n  /*    servers.                                                           */\n  /*                                                                       */\n  /*    It can be used to store a pointer to client-specific data, as well */\n  /*    as the address of a `finalizer' function, which will be called by  */\n  /*    FreeType when the object is destroyed (for example, the previous   */\n  /*    client example would put the address of the glyph cache destructor */\n  /*    in the `finalizer' field).                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    data      :: A typeless pointer to any client-specified data. This */\n  /*                 field is completely ignored by the FreeType library.  */\n  /*                                                                       */\n  /*    finalizer :: A pointer to a `generic finalizer' function, which    */\n  /*                 will be called when the object is destroyed.  If this */\n  /*                 field is set to NULL, no code will be called.         */\n  /*                                                                       */\n  typedef struct  FT_Generic_\n  {\n    void*                 data;\n    FT_Generic_Finalizer  finalizer;\n\n  } FT_Generic;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags which are used to label       */\n  /*    TrueType tables into an unsigned long to be used within FreeType.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The produced values *must* be 32-bit integers.  Don't redefine     */\n  /*    this macro.                                                        */\n  /*                                                                       */\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          (FT_Tag)                        \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                    L I S T   M A N A G E M E N T                      */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ListNode                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     Many elements and objects in FreeType are listed through an       */\n  /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */\n  /*     FT_ListNode is a handle to a single list element.                 */\n  /*                                                                       */\n  typedef struct FT_ListNodeRec_*  FT_ListNode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_List                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a list record (see @FT_ListRec).                       */\n  /*                                                                       */\n  typedef struct FT_ListRec_*  FT_List;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a single list element.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    prev :: The previous element in the list.  NULL if first.          */\n  /*                                                                       */\n  /*    next :: The next element in the list.  NULL if last.               */\n  /*                                                                       */\n  /*    data :: A typeless pointer to the listed object.                   */\n  /*                                                                       */\n  typedef struct  FT_ListNodeRec_\n  {\n    FT_ListNode  prev;\n    FT_ListNode  next;\n    void*        data;\n\n  } FT_ListNodeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a simple doubly-linked list.  These are   */\n  /*    used in many parts of FreeType.                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    head :: The head (first element) of doubly-linked list.            */\n  /*                                                                       */\n  /*    tail :: The tail (last element) of doubly-linked list.             */\n  /*                                                                       */\n  typedef struct  FT_ListRec_\n  {\n    FT_ListNode  head;\n    FT_ListNode  tail;\n\n  } FT_ListRec;\n\n\n  /* */\n\n#define FT_IS_EMPTY( list )  ( (list).head == 0 )\n\n  /* return base error code (without module-specific prefix) */\n#define FT_ERROR_BASE( x )    ( (x) & 0xFF )\n\n  /* return module error code */\n#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )\n\n#define FT_BOOL( x )  ( (FT_Bool)( x ) )\n\nFT_END_HEADER\n\n#endif /* __FTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.h                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows fnt-specific data.                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2008 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTWINFNT_H__\n#define __FTWINFNT_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    winfnt_fonts                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Window FNT Files                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Windows FNT specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Windows FNT specific      */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_WinFNT_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `charset' byte in\n   *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX\n   *   encodings (except for cp1361) can be found at ftp://ftp.unicode.org\n   *   in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory.  cp1361 is\n   *   roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.\n   *\n   * @values:\n   *   FT_WinFNT_ID_DEFAULT ::\n   *     This is used for font enumeration and font creation as a\n   *     `don't care' value.  Valid font files don't contain this value.\n   *     When querying for information about the character set of the font\n   *     that is currently selected into a specified device context, this\n   *     return value (of the related Windows API) simply denotes failure.\n   *\n   *   FT_WinFNT_ID_SYMBOL ::\n   *     There is no known mapping table available.\n   *\n   *   FT_WinFNT_ID_MAC ::\n   *     Mac Roman encoding.\n   *\n   *   FT_WinFNT_ID_OEM ::\n   *     From Michael Pöttgen <michael@poettgen.de>:\n   *\n   *       The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM\n   *       is used for the charset of vector fonts, like `modern.fon',\n   *       `roman.fon', and `script.fon' on Windows.\n   *\n   *       The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value\n   *       specifies a character set that is operating-system dependent.\n   *\n   *       The `IFIMETRICS' documentation from the `Windows Driver\n   *       Development Kit' says: This font supports an OEM-specific\n   *       character set.  The OEM character set is system dependent.\n   *\n   *       In general OEM, as opposed to ANSI (i.e., cp1252), denotes the\n   *       second default codepage that most international versions of\n   *       Windows have.  It is one of the OEM codepages from\n   *\n   *         http://www.microsoft.com/globaldev/reference/cphome.mspx,\n   *\n   *       and is used for the `DOS boxes', to support legacy applications.\n   *       A German Windows version for example usually uses ANSI codepage\n   *       1252 and OEM codepage 850.\n   *\n   *   FT_WinFNT_ID_CP874 ::\n   *     A superset of Thai TIS 620 and ISO 8859-11.\n   *\n   *   FT_WinFNT_ID_CP932 ::\n   *     A superset of Japanese Shift-JIS (with minor deviations).\n   *\n   *   FT_WinFNT_ID_CP936 ::\n   *     A superset of simplified Chinese GB 2312-1980 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP949 ::\n   *     A superset of Korean Hangul KS~C 5601-1987 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP950 ::\n   *     A superset of traditional Chinese Big~5 ETen (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP1250 ::\n   *     A superset of East European ISO 8859-2 (with slightly different\n   *     ordering).\n   *\n   *   FT_WinFNT_ID_CP1251 ::\n   *     A superset of Russian ISO 8859-5 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1252 ::\n   *     ANSI encoding.  A superset of ISO 8859-1.\n   *\n   *   FT_WinFNT_ID_CP1253 ::\n   *     A superset of Greek ISO 8859-7 (with minor modifications).\n   *\n   *   FT_WinFNT_ID_CP1254 ::\n   *     A superset of Turkish ISO 8859-9.\n   *\n   *   FT_WinFNT_ID_CP1255 ::\n   *     A superset of Hebrew ISO 8859-8 (with some modifications).\n   *\n   *   FT_WinFNT_ID_CP1256 ::\n   *     A superset of Arabic ISO 8859-6 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1257 ::\n   *     A superset of Baltic ISO 8859-13 (with some deviations).\n   *\n   *   FT_WinFNT_ID_CP1258 ::\n   *     For Vietnamese.  This encoding doesn't cover all necessary\n   *     characters.\n   *\n   *   FT_WinFNT_ID_CP1361 ::\n   *     Korean (Johab).\n   */\n\n#define FT_WinFNT_ID_CP1252    0\n#define FT_WinFNT_ID_DEFAULT   1\n#define FT_WinFNT_ID_SYMBOL    2\n#define FT_WinFNT_ID_MAC      77\n#define FT_WinFNT_ID_CP932   128\n#define FT_WinFNT_ID_CP949   129\n#define FT_WinFNT_ID_CP1361  130\n#define FT_WinFNT_ID_CP936   134\n#define FT_WinFNT_ID_CP950   136\n#define FT_WinFNT_ID_CP1253  161\n#define FT_WinFNT_ID_CP1254  162\n#define FT_WinFNT_ID_CP1258  163\n#define FT_WinFNT_ID_CP1255  177\n#define FT_WinFNT_ID_CP1256  178\n#define FT_WinFNT_ID_CP1257  186\n#define FT_WinFNT_ID_CP1251  204\n#define FT_WinFNT_ID_CP874   222\n#define FT_WinFNT_ID_CP1250  238\n#define FT_WinFNT_ID_OEM     255\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_HeaderRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Windows FNT Header info.                                           */\n  /*                                                                       */\n  typedef struct  FT_WinFNT_HeaderRec_\n  {\n    FT_UShort  version;\n    FT_ULong   file_size;\n    FT_Byte    copyright[60];\n    FT_UShort  file_type;\n    FT_UShort  nominal_point_size;\n    FT_UShort  vertical_resolution;\n    FT_UShort  horizontal_resolution;\n    FT_UShort  ascent;\n    FT_UShort  internal_leading;\n    FT_UShort  external_leading;\n    FT_Byte    italic;\n    FT_Byte    underline;\n    FT_Byte    strike_out;\n    FT_UShort  weight;\n    FT_Byte    charset;\n    FT_UShort  pixel_width;\n    FT_UShort  pixel_height;\n    FT_Byte    pitch_and_family;\n    FT_UShort  avg_width;\n    FT_UShort  max_width;\n    FT_Byte    first_char;\n    FT_Byte    last_char;\n    FT_Byte    default_char;\n    FT_Byte    break_char;\n    FT_UShort  bytes_per_row;\n    FT_ULong   device_offset;\n    FT_ULong   face_name_offset;\n    FT_ULong   bits_pointer;\n    FT_ULong   bits_offset;\n    FT_Byte    reserved;\n    FT_ULong   flags;\n    FT_UShort  A_space;\n    FT_UShort  B_space;\n    FT_UShort  C_space;\n    FT_UShort  color_table_offset;\n    FT_ULong   reserved1[4];\n\n  } FT_WinFNT_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_Header                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FT_WinFNT_HeaderRec structure.                     */\n  /*                                                                       */\n  typedef struct FT_WinFNT_HeaderRec_*  FT_WinFNT_Header;\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_WinFNT_Header\n   *\n   * @description:\n   *    Retrieve a Windows FNT font info header.\n   *\n   * @input:\n   *    face    :: A handle to the input face.\n   *\n   * @output:\n   *    aheader :: The WinFNT header.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function only works with Windows FNT faces, returning an error\n   *   otherwise.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *aheader );\n\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTWINFNT_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ftxf86.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.h                                                               */\n/*                                                                         */\n/*    Support functions for X11.                                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2007 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTXF86_H__\n#define __FTXF86_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   font_formats                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   Font Formats                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   Getting the font format.                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   The single function in this section can be used to get the font     */\n  /*   format.  Note that this information is not needed normally;         */\n  /*   however, there are special cases (like in PDF devices) where it is  */\n  /*   important to differentiate, in spite of FreeType's uniform API.     */\n  /*                                                                       */\n  /*   This function is in the X11/xf86 namespace for historical reasons   */\n  /*   and in no way depends on that windowing system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*   FT_Get_X11_Font_Format                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Return a string describing the format of a given face, using values */\n  /*   which can be used as an X11 FONT_PROPERTY.  Possible values are     */\n  /*   `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */\n  /*   `PFR', and `Windows~FNT'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   face ::                                                             */\n  /*     Input face handle.                                                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   Font format string.  NULL in case of error.                         */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTXF86_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/autohint.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  autohint.h                                                             */\n/*                                                                         */\n/*    High-level `autohint' module-specific interface (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2007 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The auto-hinter is used to load and automatically hint glyphs if a    */\n  /* format-specific hinter isn't available.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __AUTOHINT_H__\n#define __AUTOHINT_H__\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A small technical note regarding automatic hinting in order to        */\n  /* clarify this module interface.                                        */\n  /*                                                                       */\n  /* An automatic hinter might compute two kinds of data for a given face: */\n  /*                                                                       */\n  /* - global hints: Usually some metrics that describe global properties  */\n  /*                 of the face.  It is computed by scanning more or less */\n  /*                 aggressively the glyphs in the face, and thus can be  */\n  /*                 very slow to compute (even if the size of global      */\n  /*                 hints is really small).                               */\n  /*                                                                       */\n  /* - glyph hints:  These describe some important features of the glyph   */\n  /*                 outline, as well as how to align them.  They are      */\n  /*                 generally much faster to compute than global hints.   */\n  /*                                                                       */\n  /* The current FreeType auto-hinter does a pretty good job while         */\n  /* performing fast computations for both global and glyph hints.         */\n  /* However, we might be interested in introducing more complex and       */\n  /* powerful algorithms in the future, like the one described in the John */\n  /* D. Hobby paper, which unfortunately requires a lot more horsepower.   */\n  /*                                                                       */\n  /* Because a sufficiently sophisticated font management system would     */\n  /* typically implement an LRU cache of opened face objects to reduce     */\n  /* memory usage, it is a good idea to be able to avoid recomputing       */\n  /* global hints every time the same face is re-opened.                   */\n  /*                                                                       */\n  /* We thus provide the ability to cache global hints outside of the face */\n  /* object, in order to speed up font re-opening time.  Of course, this   */\n  /* feature is purely optional, so most client programs won't even notice */\n  /* it.                                                                   */\n  /*                                                                       */\n  /* I initially thought that it would be a good idea to cache the glyph   */\n  /* hints too.  However, my general idea now is that if you really need   */\n  /* to cache these too, you are simply in need of a new font format,      */\n  /* where all this information could be stored within the font file and   */\n  /* decoded on the fly.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct FT_AutoHinterRec_  *FT_AutoHinter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalGetFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves the global hints computed for a given face object the    */\n  /*    resulting data is dissociated from the face and will survive a     */\n  /*    call to FT_Done_Face().  It must be discarded through the API      */\n  /*    FT_AutoHinter_GlobalDoneFunc().                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter        :: A handle to the source auto-hinter.               */\n  /*                                                                       */\n  /*    face          :: A handle to the source face object.               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    global_hints  :: A typeless pointer to the global hints.           */\n  /*                                                                       */\n  /*    global_len    :: The size in bytes of the global hints.            */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,\n                                  FT_Face        face,\n                                  void**         global_hints,\n                                  long*          global_len );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalDoneFunc                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discards the global hints retrieved through                        */\n  /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */\n  /*    are freed from memory.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the auto-hinter module.                      */\n  /*                                                                       */\n  /*    global :: A pointer to retrieved global hints to discard.          */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter  hinter,\n                                   void*          global );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalResetFunc                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to recompute the global metrics in a given   */\n  /*    font.  This is useful when global font data changes (e.g. Multiple */\n  /*    Masters fonts where blend coordinates change).                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the source auto-hinter.                      */\n  /*                                                                       */\n  /*    face   :: A handle to the face.                                    */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter  hinter,\n                                    FT_Face        face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlyphLoadFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to load, scale, and automatically hint a     */\n  /*    glyph from a given face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the face.                               */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    load_flags  :: The load flags.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is capable of loading composite glyphs by hinting    */\n  /*    each sub-glyph independently (which improves quality).             */\n  /*                                                                       */\n  /*    It will call the font driver with FT_Load_Glyph(), with            */\n  /*    FT_LOAD_NO_SCALE set.                                              */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,\n                                  FT_GlyphSlot   slot,\n                                  FT_Size        size,\n                                  FT_UInt        glyph_index,\n                                  FT_Int32       load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_AutoHinter_ServiceRec                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The auto-hinter module's interface.                                */\n  /*                                                                       */\n  typedef struct  FT_AutoHinter_ServiceRec_\n  {\n    FT_AutoHinter_GlobalResetFunc  reset_face;\n    FT_AutoHinter_GlobalGetFunc    get_global_hints;\n    FT_AutoHinter_GlobalDoneFunc   done_global_hints;\n    FT_AutoHinter_GlyphLoadFunc    load_glyph;\n\n  } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \\\n                                     done_global_hints_, load_glyph_)        \\\n  FT_CALLBACK_TABLE_DEF                                                      \\\n  const FT_AutoHinter_ServiceRec class_ =                                    \\\n  {                                                                          \\\n    reset_face_, get_global_hints_, done_global_hints_, load_glyph_          \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \\\n                                     done_global_hints_, load_glyph_)        \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Library library,                                \\\n                          FT_AutoHinter_ServiceRec* clazz)                   \\\n  {                                                                          \\\n    FT_UNUSED(library);                                                      \\\n    clazz->reset_face = reset_face_;                                         \\\n    clazz->get_global_hints = get_global_hints_;                             \\\n    clazz->done_global_hints = done_global_hints_;                           \\\n    clazz->load_glyph = load_glyph_;                                         \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\nFT_END_HEADER\n\n#endif /* __AUTOHINT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftcalc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcalc.h                                                               */\n/*                                                                         */\n/*    Arithmetic computations (specification).                             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCALC_H__\n#define __FTCALC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FixedSqrt                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the square root of a 16.16 fixed point value.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x :: The value to compute the root for.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `sqrt(x)'.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is not very fast.                                    */\n  /*                                                                       */\n  FT_BASE( FT_Int32 )\n  FT_SqrtFixed( FT_Int32  x );\n\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Sqrt32                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the square root of an Int32 integer (which will be        */\n  /*    handled as an unsigned long value).                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x :: The value to compute the root for.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `sqrt(x)'.                                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Int32 )\n  FT_Sqrt32( FT_Int32  x );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv_No_Round                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    (without rounding) with maximal accuracy (it uses a 64-bit         */\n  /*    intermediate integer whenever necessary).                          */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_BASE( FT_Long )\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c );\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n\n  /*\n   *  A variant of FT_Matrix_Multiply which scales its result afterwards.\n   *  The idea is that both `a' and `b' are scaled by factors of 10 so that\n   *  the values are as precise as possible to get a correct result during\n   *  the 64bit multiplication.  Let `sa' and `sb' be the scaling factors of\n   *  `a' and `b', respectively, then the scaling factor of the result is\n   *  `sa*sb'.\n   */\n  FT_BASE( void )\n  FT_Matrix_Multiply_Scaled( const FT_Matrix*  a,\n                             FT_Matrix        *b,\n                             FT_Long           scaling );\n\n\n  /*\n   *  A variant of FT_Vector_Transform.  See comments for\n   *  FT_Matrix_Multiply_Scaled.\n   */\n\n  FT_BASE( void )\n  FT_Vector_Transform_Scaled( FT_Vector*        vector,\n                              const FT_Matrix*  matrix,\n                              FT_Long           scaling );\n\n\n  /*\n   *  Return -1, 0, or +1, depending on the orientation of a given corner.\n   *  We use the Cartesian coordinate system, with positive vertical values\n   *  going upwards.  The function returns +1 if the corner turns to the\n   *  left, -1 to the right, and 0 for undecidable cases.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_orientation( FT_Pos  in_x,\n                         FT_Pos  in_y,\n                         FT_Pos  out_x,\n                         FT_Pos  out_y );\n\n  /*\n   *  Return TRUE if a corner is flat or nearly flat.  This is equivalent to\n   *  saying that the angle difference between the `in' and `out' vectors is\n   *  very small.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_is_flat( FT_Pos  in_x,\n                     FT_Pos  in_y,\n                     FT_Pos  out_x,\n                     FT_Pos  out_y );\n\n\n#define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )\n#define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )\n#define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )\n#define F2DOT14_TO_FIXED( x )  ( (FT_Long)(x) << 2  )\n#define FLOAT_TO_FIXED( x )    ( (FT_Long)( x * 65536.0 ) )\n#define FIXED_TO_INT( x )      ( FT_RoundFix( x ) >> 16 )\n\n#define ROUND_F26DOT6( x )     ( x >= 0 ? (    ( (x) + 32 ) & -64 )     \\\n                                        : ( -( ( 32 - (x) ) & -64 ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTCALC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftdebug.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdebug.h                                                              */\n/*                                                                         */\n/*    Debugging and logging component (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/*                                                                         */\n/*  IMPORTANT: A description of FreeType's debugging support can be        */\n/*             found in `docs/DEBUG.TXT'.  Read it if you need to use or   */\n/*             understand this code.                                       */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDEBUG_H__\n#define __FTDEBUG_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */\n  /* is already defined; this simplifies the following #ifdefs            */\n  /*                                                                      */\n#ifdef FT_DEBUG_LEVEL_TRACE\n#undef  FT_DEBUG_LEVEL_ERROR\n#define FT_DEBUG_LEVEL_ERROR\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the trace enums as well as the trace levels array when they    */\n  /* are needed.                                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE_DEF( x )  trace_ ## x ,\n\n  /* defining the enumeration */\n  typedef enum  FT_Trace_\n  {\n#include FT_INTERNAL_TRACE_H\n    trace_count\n\n  } FT_Trace;\n\n\n  /* defining the array of trace levels, provided by `src/base/ftdebug.c' */\n  extern int  ft_trace_levels[trace_count];\n\n#undef FT_TRACE_DEF\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_TRACE macro                                             */\n  /*                                                                       */\n  /* IMPORTANT!                                                            */\n  /*                                                                       */\n  /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */\n  /* value before using any TRACE macro.                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE( level, varformat )                      \\\n          do                                              \\\n          {                                               \\\n            if ( ft_trace_levels[FT_COMPONENT] >= level ) \\\n              FT_Message varformat;                       \\\n          } while ( 0 )\n\n#else /* !FT_DEBUG_LEVEL_TRACE */\n\n#define FT_TRACE( level, varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Count                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the number of available trace components.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of trace components.  0 if FreeType 2 is not built with */\n  /*    FT_DEBUG_LEVEL_TRACE definition.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may be useful if you want to access elements of      */\n  /*    the internal `ft_trace_levels' array by an index.                  */\n  /*                                                                       */\n  FT_BASE( FT_Int )\n  FT_Trace_Get_Count( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the name of a trace component.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The index of the trace component.                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The name of the trace component.  This is a statically allocated   */\n  /*    C string, so do not free it after use.  NULL if FreeType 2 is not  */\n  /*    built with FT_DEBUG_LEVEL_TRACE definition.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Trace_Get_Count to get the number of available trace       */\n  /*    components.                                                        */\n  /*                                                                       */\n  /*    This function may be useful if you want to control FreeType 2's    */\n  /*    debug level in your application.                                   */\n  /*                                                                       */\n  FT_BASE( const char * )\n  FT_Trace_Get_Name( FT_Int  idx );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* You need two opening and closing parentheses!                         */\n  /*                                                                       */\n  /* Example: FT_TRACE0(( \"Value is %i\", foo ))                            */\n  /*                                                                       */\n  /* Output of the FT_TRACEX macros is sent to stderr.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_TRACE0( varformat )  FT_TRACE( 0, varformat )\n#define FT_TRACE1( varformat )  FT_TRACE( 1, varformat )\n#define FT_TRACE2( varformat )  FT_TRACE( 2, varformat )\n#define FT_TRACE3( varformat )  FT_TRACE( 3, varformat )\n#define FT_TRACE4( varformat )  FT_TRACE( 4, varformat )\n#define FT_TRACE5( varformat )  FT_TRACE( 5, varformat )\n#define FT_TRACE6( varformat )  FT_TRACE( 6, varformat )\n#define FT_TRACE7( varformat )  FT_TRACE( 7, varformat )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ERROR macro.                                            */\n  /*                                                                       */\n  /* Output of this macro is sent to stderr.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ERROR( varformat )  FT_Message  varformat\n\n#else  /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ERROR( varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ASSERT macro.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ASSERT( condition )                                      \\\n          do                                                        \\\n          {                                                         \\\n            if ( !( condition ) )                                   \\\n              FT_Panic( \"assertion failed on line %d of file %s\\n\", \\\n                        __LINE__, __FILE__ );                       \\\n          } while ( 0 )\n\n#else /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ASSERT( condition )  do { } while ( 0 )\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define `FT_Message' and `FT_Panic' when needed.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#include \"stdio.h\"  /* for vfprintf() */\n\n  /* print a message */\n  FT_BASE( void )\n  FT_Message( const char*  fmt,\n              ... );\n\n  /* print a message and exit */\n  FT_BASE( void )\n  FT_Panic( const char*  fmt,\n            ... );\n\n#endif /* FT_DEBUG_LEVEL_ERROR */\n\n\n  FT_BASE( void )\n  ft_debug_init( void );\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n\n  /* We disable the warning `conditional expression is constant' here */\n  /* in order to compile cleanly with the maximum level of warnings.  */\n#pragma warning( disable : 4127 )\n\n#endif /* _MSC_VER */\n\n\nFT_END_HEADER\n\n#endif /* __FTDEBUG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftdriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdriver.h                                                             */\n/*                                                                         */\n/*    FreeType font driver interface (specification).                      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2008 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDRIVER_H__\n#define __FTDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef FT_Error\n  (*FT_Face_InitFunc)( FT_Stream      stream,\n                       FT_Face        face,\n                       FT_Int         typeface_index,\n                       FT_Int         num_params,\n                       FT_Parameter*  parameters );\n\n  typedef void\n  (*FT_Face_DoneFunc)( FT_Face  face );\n\n\n  typedef FT_Error\n  (*FT_Size_InitFunc)( FT_Size  size );\n\n  typedef void\n  (*FT_Size_DoneFunc)( FT_Size  size );\n\n\n  typedef FT_Error\n  (*FT_Slot_InitFunc)( FT_GlyphSlot  slot );\n\n  typedef void\n  (*FT_Slot_DoneFunc)( FT_GlyphSlot  slot );\n\n\n  typedef FT_Error\n  (*FT_Size_RequestFunc)( FT_Size          size,\n                          FT_Size_Request  req );\n\n  typedef FT_Error\n  (*FT_Size_SelectFunc)( FT_Size   size,\n                         FT_ULong  size_index );\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  typedef FT_Error\n  (*FT_Size_ResetPointsFunc)( FT_Size     size,\n                              FT_F26Dot6  char_width,\n                              FT_F26Dot6  char_height,\n                              FT_UInt     horz_resolution,\n                              FT_UInt     vert_resolution );\n\n  typedef FT_Error\n  (*FT_Size_ResetPixelsFunc)( FT_Size  size,\n                              FT_UInt  pixel_width,\n                              FT_UInt  pixel_height );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n  typedef FT_Error\n  (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,\n                       FT_Size       size,\n                       FT_UInt       glyph_index,\n                       FT_Int32      load_flags );\n\n\n  typedef FT_UInt\n  (*FT_CharMap_CharIndexFunc)( FT_CharMap  charmap,\n                               FT_Long     charcode );\n\n  typedef FT_Long\n  (*FT_CharMap_CharNextFunc)( FT_CharMap  charmap,\n                              FT_Long     charcode );\n\n\n  typedef FT_Error\n  (*FT_Face_GetKerningFunc)( FT_Face     face,\n                             FT_UInt     left_glyph,\n                             FT_UInt     right_glyph,\n                             FT_Vector*  kerning );\n\n\n  typedef FT_Error\n  (*FT_Face_AttachFunc)( FT_Face    face,\n                         FT_Stream  stream );\n\n\n  typedef FT_Error\n  (*FT_Face_GetAdvancesFunc)( FT_Face    face,\n                              FT_UInt    first,\n                              FT_UInt    count,\n                              FT_Int32   flags,\n                              FT_Fixed*  advances );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Driver_ClassRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The font driver class.  This structure mostly contains pointers to */\n  /*    driver methods.                                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root             :: The parent module.                             */\n  /*                                                                       */\n  /*    face_object_size :: The size of a face object in bytes.            */\n  /*                                                                       */\n  /*    size_object_size :: The size of a size object in bytes.            */\n  /*                                                                       */\n  /*    slot_object_size :: The size of a glyph object in bytes.           */\n  /*                                                                       */\n  /*    init_face        :: The format-specific face constructor.          */\n  /*                                                                       */\n  /*    done_face        :: The format-specific face destructor.           */\n  /*                                                                       */\n  /*    init_size        :: The format-specific size constructor.          */\n  /*                                                                       */\n  /*    done_size        :: The format-specific size destructor.           */\n  /*                                                                       */\n  /*    init_slot        :: The format-specific slot constructor.          */\n  /*                                                                       */\n  /*    done_slot        :: The format-specific slot destructor.           */\n  /*                                                                       */\n  /*                                                                       */\n  /*    load_glyph       :: A function handle to load a glyph to a slot.   */\n  /*                        This field is mandatory!                       */\n  /*                                                                       */\n  /*    get_kerning      :: A function handle to return the unscaled       */\n  /*                        kerning for a given pair of glyphs.  Can be    */\n  /*                        set to 0 if the format doesn't support         */\n  /*                        kerning.                                       */\n  /*                                                                       */\n  /*    attach_file      :: This function handle is used to read           */\n  /*                        additional data for a face from another        */\n  /*                        file/stream.  For example, this can be used to */\n  /*                        add data from AFM or PFM files on a Type 1     */\n  /*                        face, or a CIDMap on a CID-keyed face.         */\n  /*                                                                       */\n  /*    get_advances     :: A function handle used to return advance       */\n  /*                        widths of `count' glyphs (in font units),      */\n  /*                        starting at `first'.  The `vertical' flag must */\n  /*                        be set to get vertical advance heights.  The   */\n  /*                        `advances' buffer is caller-allocated.         */\n  /*                        Currently not implemented.  The idea of this   */\n  /*                        function is to be able to perform              */\n  /*                        device-independent text layout without loading */\n  /*                        a single glyph image.                          */\n  /*                                                                       */\n  /*    request_size     :: A handle to a function used to request the new */\n  /*                        character size.  Can be set to 0 if the        */\n  /*                        scaling done in the base layer suffices.       */\n  /*                                                                       */\n  /*    select_size      :: A handle to a function used to select a new    */\n  /*                        fixed size.  It is used only if                */\n  /*                        @FT_FACE_FLAG_FIXED_SIZES is set.  Can be set  */\n  /*                        to 0 if the scaling done in the base layer     */\n  /*                        suffices.                                      */\n  /* <Note>                                                                */\n  /*    Most function pointers, with the exception of `load_glyph', can be */\n  /*    set to 0 to indicate a default behaviour.                          */\n  /*                                                                       */\n  typedef struct  FT_Driver_ClassRec_\n  {\n    FT_Module_Class           root;\n\n    FT_Long                   face_object_size;\n    FT_Long                   size_object_size;\n    FT_Long                   slot_object_size;\n\n    FT_Face_InitFunc          init_face;\n    FT_Face_DoneFunc          done_face;\n\n    FT_Size_InitFunc          init_size;\n    FT_Size_DoneFunc          done_size;\n\n    FT_Slot_InitFunc          init_slot;\n    FT_Slot_DoneFunc          done_slot;\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n    FT_Size_ResetPointsFunc   set_char_sizes;\n    FT_Size_ResetPixelsFunc   set_pixel_sizes;\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n    FT_Slot_LoadFunc          load_glyph;\n\n    FT_Face_GetKerningFunc    get_kerning;\n    FT_Face_AttachFunc        attach_file;\n    FT_Face_GetAdvancesFunc   get_advances;\n\n    /* since version 2.2 */\n    FT_Size_RequestFunc       request_size;\n    FT_Size_SelectFunc        select_size;\n\n  } FT_Driver_ClassRec, *FT_Driver_Class;\n\n\n  /*\n   *  The following functions are used as stubs for `set_char_sizes' and\n   *  `set_pixel_sizes'; the code uses `request_size' and `select_size'\n   *  functions instead.\n   *\n   *  Implementation is in `src/base/ftobjs.c'.\n   */\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  FT_BASE( FT_Error )\n  ft_stub_set_char_sizes( FT_Size     size,\n                          FT_F26Dot6  width,\n                          FT_F26Dot6  height,\n                          FT_UInt     horz_res,\n                          FT_UInt     vert_res );\n\n  FT_BASE( FT_Error )\n  ft_stub_set_pixel_sizes( FT_Size  size,\n                           FT_UInt  width,\n                           FT_UInt  height );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_DRIVER                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Driver_ClassRec stract instance.                                */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_DRIVER                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Driver_ClassRec struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */\n  /*    to called with a pointer where the allocated stracture is returned.*/\n  /*    And when it is no longer needed a Destroy function needs           */\n  /*    to be called to release that allocation.                           */\n  /*    fcinit.c (ft_create_default_module_classes) already contains       */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in ftmodule.h                                            */\n  /*                                                                       */\n  /*    Notice that the created Create and Destroy functions call          */\n  /*    pic_init and pic_free function to allow you to manually allocate   */\n  /*    and initialize any additional global data, like module specific    */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    ftpic.h. if you don't need them just implement the functions as    */\n  /*    empty to resolve the link error.                                   */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \\\n  a_, b_,\n#else\n  #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)\n#endif\n\n#define FT_DECLARE_DRIVER(class_)    \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Driver_ClassRec  class_;  \n\n#define FT_DEFINE_DRIVER(class_,                                             \\\n                         flags_, size_, name_, version_, requires_,          \\\n                         interface_, init_, done_, get_interface_,           \\\n                         face_object_size_, size_object_size_,               \\\n                         slot_object_size_, init_face_, done_face_,          \\\n                         init_size_, done_size_, init_slot_, done_slot_,     \\\n                         old_set_char_sizes_, old_set_pixel_sizes_,          \\\n                         load_glyph_, get_kerning_, attach_file_,            \\\n                         get_advances_, request_size_, select_size_ )        \\\n  FT_CALLBACK_TABLE_DEF                                                      \\\n  const FT_Driver_ClassRec class_ =                                          \\\n  {                                                                          \\\n    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_,  \\\n                          init_,done_,get_interface_)                        \\\n                                                                             \\\n    face_object_size_,                                                       \\\n    size_object_size_,                                                       \\\n    slot_object_size_,                                                       \\\n                                                                             \\\n    init_face_,                                                              \\\n    done_face_,                                                              \\\n                                                                             \\\n    init_size_,                                                              \\\n    done_size_,                                                              \\\n                                                                             \\\n    init_slot_,                                                              \\\n    done_slot_,                                                              \\\n                                                                             \\\n    FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \\\n                                                                             \\\n    load_glyph_,                                                             \\\n                                                                             \\\n    get_kerning_,                                                            \\\n    attach_file_,                                                            \\\n    get_advances_,                                                           \\\n                                                                             \\\n    request_size_,                                                           \\\n    select_size_                                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \\\n  clazz->set_char_sizes = a_; \\\n  clazz->set_pixel_sizes = b_;\n#else\n  #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)\n#endif\n\n#define FT_DECLARE_DRIVER(class_)    FT_DECLARE_MODULE(class_)\n\n#define FT_DEFINE_DRIVER(class_,                                             \\\n                         flags_, size_, name_, version_, requires_,          \\\n                         interface_, init_, done_, get_interface_,           \\\n                         face_object_size_, size_object_size_,               \\\n                         slot_object_size_, init_face_, done_face_,          \\\n                         init_size_, done_size_, init_slot_, done_slot_,     \\\n                         old_set_char_sizes_, old_set_pixel_sizes_,          \\\n                         load_glyph_, get_kerning_, attach_file_,            \\\n                         get_advances_, request_size_, select_size_ )        \\\n  void class_##_pic_free( FT_Library library );                              \\\n  FT_Error class_##_pic_init( FT_Library library );                          \\\n                                                                             \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library        library,                      \\\n                             FT_Module_Class*  clazz )                       \\\n  {                                                                          \\\n    FT_Memory       memory = library->memory;                                \\\n    FT_Driver_Class dclazz = (FT_Driver_Class)clazz;                         \\\n    class_##_pic_free( library );                                            \\\n    if ( dclazz )                                                            \\\n      FT_FREE( dclazz );                                                     \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library        library,                       \\\n                            FT_Module_Class**  output_class )                \\\n  {                                                                          \\\n    FT_Driver_Class  clazz;                                                  \\\n    FT_Error         error;                                                  \\\n    FT_Memory        memory = library->memory;                               \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \\\n      return error;                                                          \\\n                                                                             \\\n    error = class_##_pic_init( library );                                    \\\n    if(error)                                                                \\\n    {                                                                        \\\n      FT_FREE( clazz );                                                      \\\n      return error;                                                          \\\n    }                                                                        \\\n                                                                             \\\n    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_,  \\\n                          init_,done_,get_interface_)                        \\\n                                                                             \\\n    clazz->face_object_size    = face_object_size_;                          \\\n    clazz->size_object_size    = size_object_size_;                          \\\n    clazz->slot_object_size    = slot_object_size_;                          \\\n                                                                             \\\n    clazz->init_face           = init_face_;                                 \\\n    clazz->done_face           = done_face_;                                 \\\n                                                                             \\\n    clazz->init_size           = init_size_;                                 \\\n    clazz->done_size           = done_size_;                                 \\\n                                                                             \\\n    clazz->init_slot           = init_slot_;                                 \\\n    clazz->done_slot           = done_slot_;                                 \\\n                                                                             \\\n    FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \\\n                                                                             \\\n    clazz->load_glyph          = load_glyph_;                                \\\n                                                                             \\\n    clazz->get_kerning         = get_kerning_;                               \\\n    clazz->attach_file         = attach_file_;                               \\\n    clazz->get_advances        = get_advances_;                              \\\n                                                                             \\\n    clazz->request_size        = request_size_;                              \\\n    clazz->select_size         = select_size_;                               \\\n                                                                             \\\n    *output_class = (FT_Module_Class*)clazz;                                 \\\n    return FT_Err_Ok;                                                        \\\n  }                \n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __FTDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftgloadr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgloadr.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph loader (specification).                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2005, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGLOADR_H__\n#define __FTGLOADR_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphLoader                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The glyph loader is an internal object used to load several glyphs */\n  /*    together (for example, in the case of composites).                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The glyph loader implementation is not part of the high-level API, */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;\n\n\n#if 0  /* moved to freetype.h in version 2.2 */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n#endif\n\n\n  typedef struct  FT_SubGlyphRec_\n  {\n    FT_Int     index;\n    FT_UShort  flags;\n    FT_Int     arg1;\n    FT_Int     arg2;\n    FT_Matrix  transform;\n\n  } FT_SubGlyphRec;\n\n\n  typedef struct  FT_GlyphLoadRec_\n  {\n    FT_Outline   outline;       /* outline                   */\n    FT_Vector*   extra_points;  /* extra points table        */\n    FT_Vector*   extra_points2; /* second extra points table */\n    FT_UInt      num_subglyphs; /* number of subglyphs       */\n    FT_SubGlyph  subglyphs;     /* subglyphs                 */\n\n  } FT_GlyphLoadRec, *FT_GlyphLoad;\n\n\n  typedef struct  FT_GlyphLoaderRec_\n  {\n    FT_Memory        memory;\n    FT_UInt          max_points;\n    FT_UInt          max_contours;\n    FT_UInt          max_subglyphs;\n    FT_Bool          use_extra;\n\n    FT_GlyphLoadRec  base;\n    FT_GlyphLoadRec  current;\n\n    void*            other;            /* for possible future extension? */\n\n  } FT_GlyphLoaderRec;\n\n\n  /* create new empty glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_New( FT_Memory        memory,\n                      FT_GlyphLoader  *aloader );\n\n  /* add an extra points table to a glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );\n\n  /* destroy a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Done( FT_GlyphLoader  loader );\n\n  /* reset a glyph loader (frees everything int it) */\n  FT_BASE( void )\n  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );\n\n  /* rewind a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );\n\n  /* check that there is enough space to add `n_points' and `n_contours' */\n  /* to the glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,\n                              FT_UInt         n_points,\n                              FT_UInt         n_contours );\n\n\n#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                         \\\n   ( (_count) == 0 || ((_loader)->base.outline.n_points    +              \\\n                       (_loader)->current.outline.n_points +              \\\n                       (unsigned long)(_count)) <= (_loader)->max_points )\n\n#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                          \\\n  ( (_count) == 0 || ((_loader)->base.outline.n_contours    +              \\\n                      (_loader)->current.outline.n_contours +              \\\n                      (unsigned long)(_count)) <= (_loader)->max_contours )\n\n#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \\\n  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \\\n      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \\\n    ? 0                                                                \\\n    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )\n\n\n  /* check that there is enough space to add `n_subs' sub-glyphs to */\n  /* a glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,\n                                 FT_UInt         n_subs );\n\n  /* prepare a glyph loader, i.e. empty the current glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );\n\n  /* add the current glyph to the base glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Add( FT_GlyphLoader  loader );\n\n  /* copy points from one glyph loader to another */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,\n                             FT_GlyphLoader  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLOADR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftmemory.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmemory.h                                                             */\n/*                                                                         */\n/*    The FreeType memory management macros (specification).               */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMEMORY_H__\n#define __FTMEMORY_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_SET_ERROR                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used to set an implicit `error' variable to a given  */\n  /*    expression's value (usually a function call), and convert it to a  */\n  /*    boolean which is set whenever the value is != 0.                   */\n  /*                                                                       */\n#undef  FT_SET_ERROR\n#define FT_SET_ERROR( expression ) \\\n          ( ( error = (expression) ) != 0 )\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                           M E M O R Y                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*\n   *  C++ refuses to handle statements like p = (void*)anything, with `p' a\n   *  typed pointer.  Since we don't have a `typeof' operator in standard\n   *  C++, we have to use a template to emulate it.\n   */\n\n#ifdef __cplusplus\n\n  extern \"C++\"\n  template <typename T> inline T*\n  cplusplus_typeof(        T*,\n                    void  *v )\n  {\n    return static_cast <T*> ( v );\n  }\n\n#define FT_ASSIGNP( p, val )  (p) = cplusplus_typeof( (p), (val) )\n\n#else\n\n#define FT_ASSIGNP( p, val )  (p) = (val)\n\n#endif\n\n\n\n#ifdef FT_DEBUG_MEMORY\n\n  FT_BASE( const char* )  _ft_debug_file;\n  FT_BASE( long )         _ft_debug_lineno;\n\n#define FT_DEBUG_INNER( exp )  ( _ft_debug_file   = __FILE__, \\\n                                 _ft_debug_lineno = __LINE__, \\\n                                 (exp) )\n\n#define FT_ASSIGNP_INNER( p, exp )  ( _ft_debug_file   = __FILE__, \\\n                                      _ft_debug_lineno = __LINE__, \\\n                                      FT_ASSIGNP( p, exp ) )\n\n#else /* !FT_DEBUG_MEMORY */\n\n#define FT_DEBUG_INNER( exp )       (exp)\n#define FT_ASSIGNP_INNER( p, exp )  FT_ASSIGNP( p, exp )\n\n#endif /* !FT_DEBUG_MEMORY */\n\n\n  /*\n   *  The allocation functions return a pointer, and the error code\n   *  is written to through the `p_error' parameter.  See below for\n   *  for documentation.\n   */\n\n  FT_BASE( FT_Pointer )\n  ft_mem_alloc( FT_Memory  memory,\n                FT_Long    size,\n                FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qalloc( FT_Memory  memory,\n                 FT_Long    size,\n                 FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_realloc( FT_Memory  memory,\n                  FT_Long    item_size,\n                  FT_Long    cur_count,\n                  FT_Long    new_count,\n                  void*      block,\n                  FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qrealloc( FT_Memory  memory,\n                   FT_Long    item_size,\n                   FT_Long    cur_count,\n                   FT_Long    new_count,\n                   void*      block,\n                   FT_Error  *p_error );\n\n  FT_BASE( void )\n  ft_mem_free( FT_Memory    memory,\n               const void*  P );\n\n\n#define FT_MEM_ALLOC( ptr, size )                                         \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )\n\n#define FT_MEM_FREE( ptr )                \\\n          FT_BEGIN_STMNT                  \\\n            ft_mem_free( memory, (ptr) ); \\\n            (ptr) = NULL;                 \\\n          FT_END_STMNT\n\n#define FT_MEM_NEW( ptr )                        \\\n          FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_REALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1,        \\\n                                                 (cursz), (newsz), \\\n                                                 (ptr), &error ) )\n\n#define FT_MEM_QALLOC( ptr, size )                                         \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )\n\n#define FT_MEM_QNEW( ptr )                        \\\n          FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_QREALLOC( ptr, cursz, newsz )                         \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1,        \\\n                                                  (cursz), (newsz), \\\n                                                  (ptr), &error ) )\n\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                             \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \\\n                                                  (cursz), (newsz),          \\\n                                                  (ptr), &error ) )\n\n#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                    \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \\\n                                                 0, (count),          \\\n                                                 NULL, &error ) )\n\n#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )            \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz),    \\\n                                                 (oldcnt), (newcnt), \\\n                                                 (ptr), &error ) )\n\n#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                    \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \\\n                                                  0, (count),          \\\n                                                  NULL, &error ) )\n\n#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)             \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz),    \\\n                                                  (oldcnt), (newcnt), \\\n                                                  (ptr), &error ) )\n\n\n#define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )\n\n\n#define FT_MEM_SET( dest, byte, count )     ft_memset( dest, byte, count )\n\n#define FT_MEM_COPY( dest, source, count )  ft_memcpy( dest, source, count )\n\n#define FT_MEM_MOVE( dest, source, count )  ft_memmove( dest, source, count )\n\n\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\n\n#define FT_ZERO( p )                FT_MEM_ZERO( p, sizeof ( *(p) ) )\n\n\n#define FT_ARRAY_ZERO( dest, count )                        \\\n          FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_COPY( dest, source, count )                        \\\n          FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_MOVE( dest, source, count )                        \\\n          FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )\n\n\n  /*\n   *  Return the maximum number of addressable elements in an array.\n   *  We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid\n   *  any problems.\n   */\n#define FT_ARRAY_MAX( ptr )           ( FT_INT_MAX / sizeof ( *(ptr) ) )\n\n#define FT_ARRAY_CHECK( ptr, count )  ( (count) <= FT_ARRAY_MAX( ptr ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following functions macros expect that their pointer argument is  */\n  /* _typed_ in order to automatically compute array element sizes.        */\n  /*                                                                       */\n\n#define FT_MEM_NEW_ARRAY( ptr, count )                                      \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \\\n                                                 0, (count),                \\\n                                                 NULL, &error ) )\n\n#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                             \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \\\n                                                 (cursz), (newsz),          \\\n                                                 (ptr), &error ) )\n\n#define FT_MEM_QNEW_ARRAY( ptr, count )                                      \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \\\n                                                  0, (count),                \\\n                                                  NULL, &error ) )\n\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                             \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \\\n                                                  (cursz), (newsz),          \\\n                                                  (ptr), &error ) )\n\n\n#define FT_ALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )\n\n#define FT_REALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )\n\n#define FT_ALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt,      \\\n                                                 newcnt, itmsz ) )\n\n#define FT_QALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )\n\n#define FT_QREALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )\n\n#define FT_QALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt,      \\\n                                                  newcnt, itmsz ) )\n\n#define FT_FREE( ptr )  FT_MEM_FREE( ptr )\n\n#define FT_NEW( ptr )  FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )\n\n#define FT_NEW_ARRAY( ptr, count )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_RENEW_ARRAY( ptr, curcnt, newcnt )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n#define FT_QNEW( ptr )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )\n\n#define FT_QNEW_ARRAY( ptr, count )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  FT_BASE( FT_Error )\n  FT_Alloc( FT_Memory  memory,\n            FT_Long    size,\n            void*     *P );\n\n  FT_BASE( FT_Error )\n  FT_QAlloc( FT_Memory  memory,\n             FT_Long    size,\n             void*     *p );\n\n  FT_BASE( FT_Error )\n  FT_Realloc( FT_Memory  memory,\n              FT_Long    current,\n              FT_Long    size,\n              void*     *P );\n\n  FT_BASE( FT_Error )\n  FT_QRealloc( FT_Memory  memory,\n               FT_Long    current,\n               FT_Long    size,\n               void*     *p );\n\n  FT_BASE( void )\n  FT_Free( FT_Memory  memory,\n           void*     *P );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  FT_BASE( FT_Pointer )\n  ft_mem_strdup( FT_Memory    memory,\n                 const char*  str,\n                 FT_Error    *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_dup( FT_Memory    memory,\n              const void*  address,\n              FT_ULong     size,\n              FT_Error    *p_error );\n\n#define FT_MEM_STRDUP( dst, str )                                            \\\n          (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )\n\n#define FT_STRDUP( dst, str )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )\n\n#define FT_MEM_DUP( dst, address, size )                                    \\\n          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )\n\n#define FT_DUP( dst, address, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )\n\n\n  /* Return >= 1 if a truncation occurs.            */\n  /* Return 0 if the source string fits the buffer. */\n  /* This is *not* the same as strlcpy().           */\n  FT_BASE( FT_Int )\n  ft_mem_strcpyn( char*        dst,\n                  const char*  src,\n                  FT_ULong     size );\n\n#define FT_STRCPYN( dst, src, size )                                         \\\n          ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMEMORY_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftobjs.h                                                               */\n/*                                                                         */\n/*    The FreeType private base classes (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file contains the definition of all internal FreeType classes.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTOBJS_H__\n#define __FTOBJS_H__\n\n#include <ft2build.h>\n#include FT_RENDER_H\n#include FT_SIZES_H\n#include FT_LCD_FILTER_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_GLYPH_LOADER_H\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_AUTOHINT_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_PIC_H\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n#include FT_INCREMENTAL_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some generic definitions.                                             */\n  /*                                                                       */\n#ifndef TRUE\n#define TRUE  1\n#endif\n\n#ifndef FALSE\n#define FALSE  0\n#endif\n\n#ifndef NULL\n#define NULL  (void*)0\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The min and max functions missing in C.  As usual, be careful not to  */\n  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */\n  /*                                                                       */\n#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )\n#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )\n\n#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )\n\n\n#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )\n#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )\n#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )\n\n#define FT_PIX_FLOOR( x )     ( (x) & ~63 )\n#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )\n#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )\n\n\n  /*\n   *  Return the highest power of 2 that is <= value; this correspond to\n   *  the highest bit in a given 32-bit value.\n   */\n  FT_BASE( FT_UInt32 )\n  ft_highpow2( FT_UInt32  value );\n\n\n  /*\n   *  character classification functions -- since these are used to parse\n   *  font files, we must not use those in <ctypes.h> which are\n   *  locale-dependent\n   */\n#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )\n\n#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \\\n                             ( (unsigned)(x) - 'a' ) < 6U  || \\\n                             ( (unsigned)(x) - 'A' ) < 6U  )\n\n  /* the next two macros assume ASCII representation */\n#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )\n#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )\n\n#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )\n#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       C H A R M A P S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to internal charmap object */\n  typedef struct FT_CMapRec_*              FT_CMap;\n\n  /* handle to charmap class structure */\n  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;\n\n  /* internal charmap object structure */\n  typedef struct  FT_CMapRec_\n  {\n    FT_CharMapRec  charmap;\n    FT_CMap_Class  clazz;\n\n  } FT_CMapRec;\n\n  /* typecase any pointer to a charmap handle */\n#define FT_CMAP( x )              ((FT_CMap)( x ))\n\n  /* obvious macros */\n#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id\n#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id\n#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding\n#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face\n\n\n  /* class method definitions */\n  typedef FT_Error\n  (*FT_CMap_InitFunc)( FT_CMap     cmap,\n                       FT_Pointer  init_data );\n\n  typedef void\n  (*FT_CMap_DoneFunc)( FT_CMap  cmap );\n\n  typedef FT_UInt\n  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,\n                            FT_UInt32  char_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,\n                           FT_UInt32  *achar_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharVarIndexFunc)( FT_CMap    cmap,\n                               FT_CMap    unicode_cmap,\n                               FT_UInt32  char_code,\n                               FT_UInt32  variant_selector );\n\n  typedef FT_Bool\n  (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap    cmap,\n                                   FT_UInt32  char_code,\n                                   FT_UInt32  variant_selector );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantListFunc)( FT_CMap    cmap,\n                              FT_Memory  mem );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_CharVariantListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  char_code );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantCharListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  variant_selector );\n\n\n  typedef struct  FT_CMap_ClassRec_\n  {\n    FT_ULong               size;\n    FT_CMap_InitFunc       init;\n    FT_CMap_DoneFunc       done;\n    FT_CMap_CharIndexFunc  char_index;\n    FT_CMap_CharNextFunc   char_next;\n\n    /* Subsequent entries are special ones for format 14 -- the variant */\n    /* selector subtable which behaves like no other                    */\n\n    FT_CMap_CharVarIndexFunc      char_var_index;\n    FT_CMap_CharVarIsDefaultFunc  char_var_default;\n    FT_CMap_VariantListFunc       variant_list;\n    FT_CMap_CharVariantListFunc   charvariant_list;\n    FT_CMap_VariantCharListFunc   variantchar_list;\n\n  } FT_CMap_ClassRec;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_CMAP_CLASS(class_) \\\n    FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;\n\n#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \\\n        char_next_, char_var_index_, char_var_default_, variant_list_,       \\\n        charvariant_list_, variantchar_list_)                                \\\n  FT_CALLBACK_TABLE_DEF                                                      \\\n  const FT_CMap_ClassRec class_ =                                            \\\n  {                                                                          \\\n    size_, init_, done_, char_index_, char_next_, char_var_index_,           \\\n    char_var_default_, variant_list_, charvariant_list_, variantchar_list_   \\\n  };\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_CMAP_CLASS(class_) \\\n    void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec*  clazz);\n\n#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \\\n        char_next_, char_var_index_, char_var_default_, variant_list_,       \\\n        charvariant_list_, variantchar_list_)                                \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Library library,                                \\\n                          FT_CMap_ClassRec*  clazz)                          \\\n  {                                                                          \\\n    FT_UNUSED(library);                                                      \\\n    clazz->size = size_;                                                     \\\n    clazz->init = init_;                                                     \\\n    clazz->done = done_;                                                     \\\n    clazz->char_index = char_index_;                                         \\\n    clazz->char_next = char_next_;                                           \\\n    clazz->char_var_index = char_var_index_;                                 \\\n    clazz->char_var_default = char_var_default_;                             \\\n    clazz->variant_list = variant_list_;                                     \\\n    clazz->charvariant_list = charvariant_list_;                             \\\n    clazz->variantchar_list = variantchar_list_;                             \\\n  } \n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* create a new charmap and add it to charmap->face */\n  FT_BASE( FT_Error )\n  FT_CMap_New( FT_CMap_Class  clazz,\n               FT_Pointer     init_data,\n               FT_CharMap     charmap,\n               FT_CMap       *acmap );\n\n  /* destroy a charmap and remove it from face's list */\n  FT_BASE( void )\n  FT_CMap_Done( FT_CMap  cmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Face_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Face        */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    max_points ::                                                      */\n  /*      The maximal number of points used to store the vectorial outline */\n  /*      of any glyph in this face.  If this value cannot be known in     */\n  /*      advance, or if the face isn't scalable, this should be set to 0. */\n  /*      Only relevant for scalable formats.                              */\n  /*                                                                       */\n  /*    max_contours ::                                                    */\n  /*      The maximal number of contours used to store the vectorial       */\n  /*      outline of any glyph in this face.  If this value cannot be      */\n  /*      known in advance, or if the face isn't scalable, this should be  */\n  /*      set to 0.  Only relevant for scalable formats.                   */\n  /*                                                                       */\n  /*    transform_matrix ::                                                */\n  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */\n  /*      outlines after they are loaded from the font.  Only used by the  */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    transform_delta ::                                                 */\n  /*      A translation vector used to transform glyph outlines after they */\n  /*      are loaded from the font.  Only used by the convenience          */\n  /*      functions.                                                       */\n  /*                                                                       */\n  /*    transform_flags ::                                                 */\n  /*      Some flags used to classify the transform.  Only used by the     */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    services ::                                                        */\n  /*      A cache for frequently used services.  It should be only         */\n  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */\n  /*                                                                       */\n  /*    incremental_interface ::                                           */\n  /*      If non-null, the interface through which glyph data and metrics  */\n  /*      are loaded incrementally for faces that do not provide all of    */\n  /*      this data when first opened.  This field exists only if          */\n  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */\n  /*                                                                       */\n  /*    ignore_unpatented_hinter ::                                        */\n  /*      This boolean flag instructs the glyph loader to ignore the       */\n  /*      native font hinter, if one is found.  This is exclusively used   */\n  /*      in the case when the unpatented hinter is compiled within the    */\n  /*      library.                                                         */\n  /*                                                                       */\n  /*    refcount ::                                                        */\n  /*      A counter initialized to~1 at the time an @FT_Face structure is  */\n  /*      created.  @FT_Reference_Face increments this counter, and        */\n  /*      @FT_Done_Face only destroys a face if the counter is~1,          */\n  /*      otherwise it simply decrements it.                               */\n  /*                                                                       */\n  typedef struct  FT_Face_InternalRec_\n  {\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    FT_UShort           reserved1;\n    FT_Short            reserved2;\n#endif\n    FT_Matrix           transform_matrix;\n    FT_Vector           transform_delta;\n    FT_Int              transform_flags;\n\n    FT_ServiceCacheRec  services;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Incremental_InterfaceRec*  incremental_interface;\n#endif\n\n    FT_Bool             ignore_unpatented_hinter;\n    FT_UInt             refcount;\n\n  } FT_Face_InternalRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Slot_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_GlyphSlot   */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loader            :: The glyph loader object used to load outlines */\n  /*                         into the glyph slot.                          */\n  /*                                                                       */\n  /*    flags             :: Possible values are zero or                   */\n  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */\n  /*                         that the FT_GlyphSlot structure owns the      */\n  /*                         bitmap buffer.                                */\n  /*                                                                       */\n  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */\n  /*                         must be transformed through a specific        */\n  /*                         font transformation.  This is _not_ the same  */\n  /*                         as the face transform set through             */\n  /*                         FT_Set_Transform().                           */\n  /*                                                                       */\n  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */\n  /*                         transformation, if necessary.                 */\n  /*                                                                       */\n  /*    glyph_delta       :: The 2d translation vector corresponding to    */\n  /*                         the glyph transformation, if necessary.       */\n  /*                                                                       */\n  /*    glyph_hints       :: Format-specific glyph hints management.       */\n  /*                                                                       */\n\n#define FT_GLYPH_OWN_BITMAP  0x1\n\n  typedef struct  FT_Slot_InternalRec_\n  {\n    FT_GlyphLoader  loader;\n    FT_UInt         flags;\n    FT_Bool         glyph_transformed;\n    FT_Matrix       glyph_matrix;\n    FT_Vector       glyph_delta;\n    void*           glyph_hints;\n\n  } FT_GlyphSlot_InternalRec;\n\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Size        */\n  /*    object.  Currently, it's empty.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  typedef struct  FT_Size_InternalRec_\n  {\n    /* empty */\n\n  } FT_Size_InternalRec;\n\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                         M O D U L E S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ModuleRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A module object instance.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    clazz   :: A pointer to the module's class.                        */\n  /*                                                                       */\n  /*    library :: A handle to the parent library object.                  */\n  /*                                                                       */\n  /*    memory  :: A handle to the memory manager.                         */\n  /*                                                                       */\n  /*    generic :: A generic structure for user-level extensibility (?).   */\n  /*                                                                       */\n  typedef struct  FT_ModuleRec_\n  {\n    FT_Module_Class*  clazz;\n    FT_Library        library;\n    FT_Memory         memory;\n    FT_Generic        generic;\n\n  } FT_ModuleRec;\n\n\n  /* typecast an object to a FT_Module */\n#define FT_MODULE( x )          ((FT_Module)( x ))\n#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz\n#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library\n#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory\n\n\n#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_FONT_DRIVER )\n\n#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_RENDERER )\n\n#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_HINTER )\n\n#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_STYLER )\n\n#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_DRIVER_SCALABLE )\n\n#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \\\n                                         FT_MODULE_DRIVER_NO_OUTLINES )\n\n#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                     FT_MODULE_DRIVER_HAS_HINTER )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module_Interface                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finds a module and returns its specific interface as a typeless    */\n  /*    pointer.                                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module-specific interface if available, 0 otherwise.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should better be familiar with FreeType internals to know      */\n  /*    which module to look for, and what its interface is :-)            */\n  /*                                                                       */\n  FT_BASE( const void* )\n  FT_Get_Module_Interface( FT_Library   library,\n                           const char*  mod_name );\n\n  FT_BASE( FT_Pointer )\n  ft_module_get_service( FT_Module    module,\n                         const char*  service_id );\n\n /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****               FACE, SIZE & GLYPH SLOT OBJECTS                   ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* a few macros used to perform easy typecasts with minimal brain damage */\n\n#define FT_FACE( x )          ((FT_Face)(x))\n#define FT_SIZE( x )          ((FT_Size)(x))\n#define FT_SLOT( x )          ((FT_GlyphSlot)(x))\n\n#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver\n#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library\n#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory\n#define FT_FACE_STREAM( x )   FT_FACE( x )->stream\n\n#define FT_SIZE_FACE( x )     FT_SIZE( x )->face\n#define FT_SLOT_FACE( x )     FT_SLOT( x )->face\n\n#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph\n#define FT_FACE_SIZE( x )     FT_FACE( x )->size\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_GlyphSlot                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    It is sometimes useful to have more than one glyph slot for a      */\n  /*    given face object.  This function is used to create additional     */\n  /*    slots.  All of them are automatically discarded when the face is   */\n  /*    destroyed.                                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to a parent face object.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aslot :: A handle to a new glyph slot object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_New_GlyphSlot( FT_Face        face,\n                    FT_GlyphSlot  *aslot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_GlyphSlot                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given glyph slot.  Remember however that all slots are  */\n  /*    automatically destroyed with its parent.  Using this function is   */\n  /*    not always mandatory.                                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: A handle to a target glyph slot.                           */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_GlyphSlot( FT_GlyphSlot  slot );\n\n /* */\n\n#define FT_REQUEST_WIDTH( req )                                            \\\n          ( (req)->horiResolution                                          \\\n              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \\\n              : (req)->width )\n\n#define FT_REQUEST_HEIGHT( req )                                            \\\n          ( (req)->vertResolution                                           \\\n              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \\\n              : (req)->height )\n\n\n  /* Set the metrics according to a bitmap strike. */\n  FT_BASE( void )\n  FT_Select_Metrics( FT_Face   face,\n                     FT_ULong  strike_index );\n\n\n  /* Set the metrics according to a size request. */\n  FT_BASE( void )\n  FT_Request_Metrics( FT_Face          face,\n                      FT_Size_Request  req );\n\n\n  /* Match a size request against `available_sizes'. */\n  FT_BASE( FT_Error )\n  FT_Match_Size( FT_Face          face,\n                 FT_Size_Request  req,\n                 FT_Bool          ignore_width,\n                 FT_ULong*        size_index );\n\n\n  /* Use the horizontal metrics to synthesize the vertical metrics. */\n  /* If `advance' is zero, it is also synthesized.                  */\n  FT_BASE( void )\n  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,\n                                  FT_Pos             advance );\n\n\n  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */\n  /* was allocated with ft_glyphslot_alloc_bitmap).                       */\n  FT_BASE( void )\n  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );\n\n\n  /* Allocate a new bitmap buffer in a glyph slot. */\n  FT_BASE( FT_Error )\n  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,\n                             FT_ULong      size );\n\n\n  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */\n  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */\n  FT_BASE( void )\n  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,\n                           FT_Byte*      buffer );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                        R E N D E R E R S                        ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#define FT_RENDERER( x )      ((FT_Renderer)( x ))\n#define FT_GLYPH( x )         ((FT_Glyph)( x ))\n#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))\n#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))\n\n\n  typedef struct  FT_RendererRec_\n  {\n    FT_ModuleRec            root;\n    FT_Renderer_Class*      clazz;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_Class          glyph_class;\n\n    FT_Raster               raster;\n    FT_Raster_Render_Func   raster_render;\n    FT_Renderer_RenderFunc  render;\n\n  } FT_RendererRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    F O N T   D R I V E R S                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* typecast a module into a driver easily */\n#define FT_DRIVER( x )        ((FT_Driver)(x))\n\n  /* typecast a module as a driver, and get its driver class */\n#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_DriverRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root font driver class.  A font driver is responsible for      */\n  /*    managing and loading font files of a given format.                 */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     root         :: Contains the fields of the root module class.     */\n  /*                                                                       */\n  /*     clazz        :: A pointer to the font driver's class.  Note that  */\n  /*                     this is NOT root.clazz.  `class' wasn't used      */\n  /*                     as it is a reserved word in C++.                  */\n  /*                                                                       */\n  /*     faces_list   :: The list of faces currently opened by this        */\n  /*                     driver.                                           */\n  /*                                                                       */\n  /*     extensions   :: A typeless pointer to the driver's extensions     */\n  /*                     registry, if they are supported through the       */\n  /*                     configuration macro FT_CONFIG_OPTION_EXTENSIONS.  */\n  /*                                                                       */\n  /*     glyph_loader :: The glyph loader for all faces managed by this    */\n  /*                     driver.  This object isn't defined for unscalable */\n  /*                     formats.                                          */\n  /*                                                                       */\n  typedef struct  FT_DriverRec_\n  {\n    FT_ModuleRec     root;\n    FT_Driver_Class  clazz;\n\n    FT_ListRec       faces_list;\n    void*            extensions;\n\n    FT_GlyphLoader   glyph_loader;\n\n  } FT_DriverRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       L I B R A R I E S                         ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* This hook is used by the TrueType debugger.  It must be set to an */\n  /* alternate truetype bytecode interpreter function.                 */\n#define FT_DEBUG_HOOK_TRUETYPE            0\n\n\n  /* Set this debug hook to a non-null pointer to force unpatented hinting */\n  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */\n  /* during debugging.                                                     */\n#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1\n\n\n  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,\n                                            FT_Render_Mode  render_mode,\n                                            FT_Library      library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_LibraryRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType library class.  This is the root of all FreeType      */\n  /*    data.  Use FT_New_Library() to create a library object, and        */\n  /*    FT_Done_Library() to discard it and all child objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory           :: The library's memory object.  Manages memory   */\n  /*                        allocation.                                    */\n  /*                                                                       */\n  /*    generic          :: Client data variable.  Used to extend the      */\n  /*                        Library class by higher levels and clients.    */\n  /*                                                                       */\n  /*    version_major    :: The major version number of the library.       */\n  /*                                                                       */\n  /*    version_minor    :: The minor version number of the library.       */\n  /*                                                                       */\n  /*    version_patch    :: The current patch level of the library.        */\n  /*                                                                       */\n  /*    num_modules      :: The number of modules currently registered     */\n  /*                        within this library.  This is set to 0 for new */\n  /*                        libraries.  New modules are added through the  */\n  /*                        FT_Add_Module() API function.                  */\n  /*                                                                       */\n  /*    modules          :: A table used to store handles to the currently */\n  /*                        registered modules. Note that each font driver */\n  /*                        contains a list of its opened faces.           */\n  /*                                                                       */\n  /*    renderers        :: The list of renderers currently registered     */\n  /*                        within the library.                            */\n  /*                                                                       */\n  /*    cur_renderer     :: The current outline renderer.  This is a       */\n  /*                        shortcut used to avoid parsing the list on     */\n  /*                        each call to FT_Outline_Render().  It is a     */\n  /*                        handle to the current renderer for the         */\n  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */\n  /*                                                                       */\n  /*    auto_hinter      :: XXX                                            */\n  /*                                                                       */\n  /*    raster_pool      :: The raster object's render pool.  This can     */\n  /*                        ideally be changed dynamically at run-time.    */\n  /*                                                                       */\n  /*    raster_pool_size :: The size of the render pool in bytes.          */\n  /*                                                                       */\n  /*    debug_hooks      :: XXX                                            */\n  /*                                                                       */\n  /*    lcd_filter       :: If subpixel rendering is activated, the        */\n  /*                        selected LCD filter mode.                      */\n  /*                                                                       */\n  /*    lcd_extra        :: If subpixel rendering is activated, the number */\n  /*                        of extra pixels needed for the LCD filter.     */\n  /*                                                                       */\n  /*    lcd_weights      :: If subpixel rendering is activated, the LCD    */\n  /*                        filter weights, if any.                        */\n  /*                                                                       */\n  /*    lcd_filter_func  :: If subpixel rendering is activated, the LCD    */\n  /*                        filtering callback function.                   */\n  /*                                                                       */\n  /*    pic_container    :: Contains global structs and tables, instead    */\n  /*                        of defining them globallly.                    */\n  /*                                                                       */\n  /*    refcount         :: A counter initialized to~1 at the time an      */\n  /*                        @FT_Library structure is created.              */\n  /*                        @FT_Reference_Library increments this counter, */\n  /*                        and @FT_Done_Library only destroys a library   */\n  /*                        if the counter is~1, otherwise it simply       */\n  /*                        decrements it.                                 */\n  /*                                                                       */\n  typedef struct  FT_LibraryRec_\n  {\n    FT_Memory          memory;           /* library's memory manager */\n\n    FT_Generic         generic;\n\n    FT_Int             version_major;\n    FT_Int             version_minor;\n    FT_Int             version_patch;\n\n    FT_UInt            num_modules;\n    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */\n\n    FT_ListRec         renderers;        /* list of renderers        */\n    FT_Renderer        cur_renderer;     /* current outline renderer */\n    FT_Module          auto_hinter;\n\n    FT_Byte*           raster_pool;      /* scan-line conversion */\n                                         /* render pool          */\n    FT_ULong           raster_pool_size; /* size of render pool in bytes */\n\n    FT_DebugHook_Func  debug_hooks[4];\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n    FT_LcdFilter             lcd_filter;\n    FT_Int                   lcd_extra;        /* number of extra pixels */\n    FT_Byte                  lcd_weights[7];   /* filter weights, if any */\n    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */\n#endif\n\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_PIC_Container   pic_container;\n#endif\n\n    FT_UInt            refcount;\n\n  } FT_LibraryRec;\n\n\n  FT_BASE( FT_Renderer )\n  FT_Lookup_Renderer( FT_Library       library,\n                      FT_Glyph_Format  format,\n                      FT_ListNode*     node );\n\n  FT_BASE( FT_Error )\n  FT_Render_Glyph_Internal( FT_Library      library,\n                            FT_GlyphSlot    slot,\n                            FT_Render_Mode  render_mode );\n\n  typedef const char*\n  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,\n                                    FT_String*  glyph_name );\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new memory object.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the new memory object.  0 in case of error.           */\n  /*                                                                       */\n  FT_BASE( FT_Memory )\n  FT_New_Memory( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Memory                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discards memory manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_Memory( FT_Memory  memory );\n\n#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* Define default raster's interface.  The default raster is located in  */\n  /* `src/base/ftraster.c'.                                                */\n  /*                                                                       */\n  /* Client applications can register new rasters through the              */\n  /* FT_Set_Raster() API.                                                  */\n\n#ifndef FT_NO_DEFAULT_RASTER\n  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;\n#endif\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****              PIC-Support Macros for ftimage.h                   ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_OUTLINE_FUNCS                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Outline_Funcs struct.         */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    called with a pre-allocated stracture to be filled.                */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \\\n                                cubic_to_, shift_, delta_)                   \\\n  static const FT_Outline_Funcs class_ =                                     \\\n  {                                                                          \\\n    move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \\\n                                cubic_to_, shift_, delta_)                   \\\n  static FT_Error                                                            \\\n  Init_Class_##class_( FT_Outline_Funcs*  clazz )                            \\\n  {                                                                          \\\n    clazz->move_to = move_to_;                                               \\\n    clazz->line_to = line_to_;                                               \\\n    clazz->conic_to = conic_to_;                                             \\\n    clazz->cubic_to = cubic_to_;                                             \\\n    clazz->shift = shift_;                                                   \\\n    clazz->delta = delta_;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RASTER_FUNCS                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Raster_Funcs struct.          */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    called with a pre-allocated stracture to be filled.                */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \\\n                               raster_reset_, raster_set_mode_,              \\\n                               raster_render_, raster_done_)                 \\\n  const FT_Raster_Funcs class_ =                                      \\\n  {                                                                          \\\n    glyph_format_, raster_new_, raster_reset_,                               \\\n    raster_set_mode_, raster_render_, raster_done_                           \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \\\n    raster_reset_, raster_set_mode_, raster_render_, raster_done_)           \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Raster_Funcs*  clazz )                          \\\n  {                                                                          \\\n    clazz->glyph_format = glyph_format_;                                     \\\n    clazz->raster_new = raster_new_;                                         \\\n    clazz->raster_reset = raster_reset_;                                     \\\n    clazz->raster_set_mode = raster_set_mode_;                               \\\n    clazz->raster_render = raster_render_;                                   \\\n    clazz->raster_done = raster_done_;                                       \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****              PIC-Support Macros for ftrender.h                  ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_GLYPH                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Glyph_Class struct.           */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    called with a pre-allocated stracture to be filled.                */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \\\n                        transform_, bbox_, prepare_)                         \\\n  FT_CALLBACK_TABLE_DEF                                                      \\\n  const FT_Glyph_Class class_ =                                              \\\n  {                                                                          \\\n    size_, format_, init_, done_, copy_, transform_, bbox_, prepare_         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \\\n                        transform_, bbox_, prepare_)                         \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Glyph_Class*  clazz )                           \\\n  {                                                                          \\\n    clazz->glyph_size = size_;                                               \\\n    clazz->glyph_format = format_;                                           \\\n    clazz->glyph_init = init_;                                               \\\n    clazz->glyph_done = done_;                                               \\\n    clazz->glyph_copy = copy_;                                               \\\n    clazz->glyph_transform = transform_;                                     \\\n    clazz->glyph_bbox = bbox_;                                               \\\n    clazz->glyph_prepare = prepare_;                                         \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_RENDERER                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Renderer_Class stract instance.                                 */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RENDERER                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Renderer_Class struct.        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */\n  /*    to called with a pointer where the allocated stracture is returned.*/\n  /*    And when it is no longer needed a Destroy function needs           */\n  /*    to be called to release that allocation.                           */\n  /*    fcinit.c (ft_create_default_module_classes) already contains       */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in ftmodule.h                                            */\n  /*                                                                       */\n  /*    Notice that the created Create and Destroy functions call          */\n  /*    pic_init and pic_free function to allow you to manually allocate   */\n  /*    and initialize any additional global data, like module specific    */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    ftpic.h. if you don't need them just implement the functions as    */\n  /*    empty to resolve the link error.                                   */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_RENDERER(class_)                                          \\\n    FT_EXPORT_VAR( const FT_Renderer_Class ) class_;\n\n#define FT_DEFINE_RENDERER(class_,                                           \\\n                           flags_, size_, name_, version_, requires_,        \\\n                           interface_, init_, done_, get_interface_,         \\\n                           glyph_format_, render_glyph_, transform_glyph_,   \\\n                           get_glyph_cbox_, set_mode_, raster_class_ )       \\\n  FT_CALLBACK_TABLE_DEF                                                      \\\n  const FT_Renderer_Class  class_ =                                          \\\n  {                                                                          \\\n    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \\\n                          interface_,init_,done_,get_interface_)             \\\n    glyph_format_,                                                           \\\n                                                                             \\\n    render_glyph_,                                                           \\\n    transform_glyph_,                                                        \\\n    get_glyph_cbox_,                                                         \\\n    set_mode_,                                                               \\\n                                                                             \\\n    raster_class_                                                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DECLARE_RENDERER(class_)  FT_DECLARE_MODULE(class_)\n\n#define FT_DEFINE_RENDERER(class_, \\\n                           flags_, size_, name_, version_, requires_,        \\\n                           interface_, init_, done_, get_interface_,         \\\n                           glyph_format_, render_glyph_, transform_glyph_,   \\\n                           get_glyph_cbox_, set_mode_, raster_class_ )       \\\n  void class_##_pic_free( FT_Library library );                              \\\n  FT_Error class_##_pic_init( FT_Library library );                          \\\n                                                                             \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library        library,                      \\\n                        FT_Module_Class*  clazz )                            \\\n  {                                                                          \\\n    FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz;                   \\\n    FT_Memory         memory = library->memory;                              \\\n    class_##_pic_free( library );                                            \\\n    if ( rclazz )                                                            \\\n      FT_FREE( rclazz );                                                     \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library         library,                      \\\n                            FT_Module_Class**  output_class )                \\\n  {                                                                          \\\n    FT_Renderer_Class*  clazz;                                               \\\n    FT_Error            error;                                               \\\n    FT_Memory           memory = library->memory;                            \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \\\n      return error;                                                          \\\n                                                                             \\\n    error = class_##_pic_init( library );                                    \\\n    if(error)                                                                \\\n    {                                                                        \\\n      FT_FREE( clazz );                                                      \\\n      return error;                                                          \\\n    }                                                                        \\\n                                                                             \\\n    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \\\n                          interface_,init_,done_,get_interface_)             \\\n                                                                             \\\n    clazz->glyph_format       = glyph_format_;                               \\\n                                                                             \\\n    clazz->render_glyph       = render_glyph_;                               \\\n    clazz->transform_glyph    = transform_glyph_;                            \\\n    clazz->get_glyph_cbox     = get_glyph_cbox_;                             \\\n    clazz->set_mode           = set_mode_;                                   \\\n                                                                             \\\n    clazz->raster_class       = raster_class_;                               \\\n                                                                             \\\n    *output_class = (FT_Module_Class*)clazz;                                 \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n\n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****              PIC-Support Macros for ftmodapi.h                  ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Creator                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create (allocate) a new module class object.    */\n  /*    The object's members are initialized, but the module itself is     */\n  /*    not.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory       :: A handle to the memory manager.                    */\n  /*    output_class :: Initialized with the newly allocated class.        */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Creator)( FT_Memory          memory,\n                        FT_Module_Class**  output_class );\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destroyer                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy (deallocate) a module class object.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*    clazz  :: Module class to destroy.                                 */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destroyer)( FT_Memory         memory,\n                          FT_Module_Class*  clazz );\n\n#endif\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_MODULE                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Module_Class stract instance.                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_MODULE                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Module_Class struct.          */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */\n  /*    to called with a pointer where the allocated stracture is returned.*/\n  /*    And when it is no longer needed a Destroy function needs           */\n  /*    to be called to release that allocation.                           */\n  /*    fcinit.c (ft_create_default_module_classes) already contains       */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in ftmodule.h                                            */\n  /*                                                                       */\n  /*    Notice that the created Create and Destroy functions call          */\n  /*    pic_init and pic_free function to allow you to manually allocate   */\n  /*    and initialize any additional global data, like module specific    */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    ftpic.h. if you don't need them just implement the functions as    */\n  /*    empty to resolve the link error.                                   */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_ROOT_MODULE                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Module_Class struct inside    */\n  /*    another stract that contains it or in a function that initializes  */\n  /*    that containing stract                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_MODULE(class_)                                            \\\n  FT_CALLBACK_TABLE                                                          \\\n  const FT_Module_Class  class_;                                             \\\n\n#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \\\n                              interface_, init_, done_, get_interface_)      \\\n  {                                                                          \\\n    flags_,                                                                  \\\n    size_,                                                                   \\\n                                                                             \\\n    name_,                                                                   \\\n    version_,                                                                \\\n    requires_,                                                               \\\n                                                                             \\\n    interface_,                                                              \\\n                                                                             \\\n    init_,                                                                   \\\n    done_,                                                                   \\\n    get_interface_,                                                          \\\n  },\n\n#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \\\n                         interface_, init_, done_, get_interface_)           \\\n  FT_CALLBACK_TABLE_DEF                                                      \\\n  const FT_Module_Class class_ =                                             \\\n  {                                                                          \\\n    flags_,                                                                  \\\n    size_,                                                                   \\\n                                                                             \\\n    name_,                                                                   \\\n    version_,                                                                \\\n    requires_,                                                               \\\n                                                                             \\\n    interface_,                                                              \\\n                                                                             \\\n    init_,                                                                   \\\n    done_,                                                                   \\\n    get_interface_,                                                          \\\n  };\n\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_MODULE(class_)                                            \\\n  FT_Error FT_Create_Class_##class_( FT_Library library,                     \\\n                                     FT_Module_Class** output_class );       \\\n  void     FT_Destroy_Class_##class_( FT_Library library,                    \\\n                                      FT_Module_Class*  clazz );\n\n#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \\\n                              interface_, init_, done_, get_interface_)      \\\n    clazz->root.module_flags       = flags_;                                 \\\n    clazz->root.module_size        = size_;                                  \\\n    clazz->root.module_name        = name_;                                  \\\n    clazz->root.module_version     = version_;                               \\\n    clazz->root.module_requires    = requires_;                              \\\n                                                                             \\\n    clazz->root.module_interface   = interface_;                             \\\n                                                                             \\\n    clazz->root.module_init        = init_;                                  \\\n    clazz->root.module_done        = done_;                                  \\\n    clazz->root.get_interface      = get_interface_;               \n\n#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \\\n                         interface_, init_, done_, get_interface_)           \\\n  void class_##_pic_free( FT_Library library );                              \\\n  FT_Error class_##_pic_init( FT_Library library );                          \\\n                                                                             \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library library,                             \\\n                             FT_Module_Class*  clazz )                       \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    class_##_pic_free( library );                                            \\\n    if ( clazz )                                                             \\\n      FT_FREE( clazz );                                                      \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library library,                              \\\n                            FT_Module_Class**  output_class )                \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    FT_Module_Class*  clazz;                                                 \\\n    FT_Error          error;                                                 \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \\\n      return error;                                                          \\\n    error = class_##_pic_init( library );                                    \\\n    if(error)                                                                \\\n    {                                                                        \\\n      FT_FREE( clazz );                                                      \\\n      return error;                                                          \\\n    }                                                                        \\\n                                                                             \\\n    clazz->module_flags       = flags_;                                      \\\n    clazz->module_size        = size_;                                       \\\n    clazz->module_name        = name_;                                       \\\n    clazz->module_version     = version_;                                    \\\n    clazz->module_requires    = requires_;                                   \\\n                                                                             \\\n    clazz->module_interface   = interface_;                                  \\\n                                                                             \\\n    clazz->module_init        = init_;                                       \\\n    clazz->module_done        = done_;                                       \\\n    clazz->get_interface      = get_interface_;                              \\\n                                                                             \\\n    *output_class = clazz;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\nFT_END_HEADER\n\n#endif /* __FTOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services (declaration).       */\n/*                                                                         */\n/*  Copyright 2009 by                                                      */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Modules that ordinarily have const global data that need address     */\n  /*  can instead define pointers here.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTPIC_H__\n#define __FTPIC_H__\n\n  \nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  typedef struct FT_PIC_Container_\n  {\n    /* pic containers for base */\n    void* base;\n    /* pic containers for modules */\n    void* autofit;   \n    void* cff;    \n    void* pshinter;    \n    void* psnames;    \n    void* raster;     \n    void* sfnt;     \n    void* smooth;     \n    void* truetype;     \n  } FT_PIC_Container;\n\n  /* Initialize the various function tables, structs, etc. stored in the container. */\n  FT_BASE( FT_Error )\n  ft_pic_container_init( FT_Library library );\n\n\n  /* Destroy the contents of the container. */\n  FT_BASE( void )\n  ft_pic_container_destroy( FT_Library library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftrfork.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrfork.h                                                              */\n/*                                                                         */\n/*    Embedded resource forks accessor (specification).                    */\n/*                                                                         */\n/*  Copyright 2004, 2006, 2007 by                                          */\n/*  Masatake YAMATO and Redhat K.K.                                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/* Development of the code in this file is support of                      */\n/* Information-technology Promotion Agency, Japan.                         */\n/***************************************************************************/\n\n\n#ifndef __FTRFORK_H__\n#define __FTRFORK_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* Number of guessing rules supported in `FT_Raccess_Guess'.            */\n  /* Don't forget to increment the number if you add a new guessing rule. */\n#define FT_RACCESS_N_RULES  9\n\n\n  /* A structure to describe a reference in a resource by its resource ID */\n  /* and internal offset.  The `POST' resource expects to be concatenated */\n  /* by the order of resource IDs instead of its appearance in the file.  */\n\n  typedef struct  FT_RFork_Ref_\n  {\n    FT_UShort  res_id;\n    FT_ULong   offset;\n\n  } FT_RFork_Ref;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Guess                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Guess a file name and offset where the actual resource fork is     */\n  /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */\n  /*    guessing rules;  the guessed result for the Nth rule is            */\n  /*    represented as a triplet: a new file name (new_names[N]), a file   */\n  /*    offset (offsets[N]), and an error code (errors[N]).                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    base_name ::                                                       */\n  /*      The (base) file name of the resource fork used for some          */\n  /*      guessing rules.                                                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    new_names ::                                                       */\n  /*      An array of guessed file names in which the resource forks may   */\n  /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */\n  /*      equal to `base_name'.                                            */\n  /*                                                                       */\n  /*    offsets ::                                                         */\n  /*      An array of guessed file offsets.  `offsets[N]' holds the file   */\n  /*      offset of the possible start of the resource fork in file        */\n  /*      `new_names[N]'.                                                  */\n  /*                                                                       */\n  /*    errors ::                                                          */\n  /*      An array of FreeType error codes.  `errors[N]' is the error      */\n  /*      code of Nth guessing rule function.  If `errors[N]' is not       */\n  /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Raccess_Guess( FT_Library  library,\n                    FT_Stream   stream,\n                    char*       base_name,\n                    char**      new_names,\n                    FT_Long*    offsets,\n                    FT_Error*   errors );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_HeaderInfo                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the information from the header of resource fork.  The         */\n  /*    information includes the file offset where the resource map        */\n  /*    starts, and the file offset where the resource data starts.        */\n  /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    rfork_offset ::                                                    */\n  /*      The file offset where the resource fork starts.                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_HeaderInfo( FT_Library  library,\n                             FT_Stream   stream,\n                             FT_Long     rfork_offset,\n                             FT_Long    *map_offset,\n                             FT_Long    *rdata_pos );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_DataOffsets                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the data offsets for a tag in a resource fork.  Offsets are    */\n  /*    stored in an array because, in some cases, resources in a resource */\n  /*    fork have the same tag.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /*    tag ::                                                             */\n  /*      The resource tag.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    offsets ::                                                         */\n  /*      The stream offsets for the resource data specified by `tag'.     */\n  /*      This array is allocated by the function, so you have to call     */\n  /*      @ft_mem_free after use.                                          */\n  /*                                                                       */\n  /*    count ::                                                           */\n  /*      The length of offsets array.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */\n  /*    value for `map_offset' and `rdata_pos'.                            */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_DataOffsets( FT_Library  library,\n                              FT_Stream   stream,\n                              FT_Long     map_offset,\n                              FT_Long     rdata_pos,\n                              FT_Long     tag,\n                              FT_Long   **offsets,\n                              FT_Long    *count );\n\n\nFT_END_HEADER\n\n#endif /* __FTRFORK_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftserv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftserv.h                                                               */\n/*                                                                         */\n/*    The FreeType services (specification only).                          */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Each module can export one or more `services'.  Each service is      */\n  /*  identified by a constant string and modeled by a pointer; the latter */\n  /*  generally corresponds to a structure containing function pointers.   */\n  /*                                                                       */\n  /*  Note that a service's data cannot be a mere function pointer because */\n  /*  in C it is possible that function pointers might be implemented      */\n  /*  differently than data pointers (e.g. 48 bits instead of 32).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSERV_H__\n#define __FTSERV_H__\n\n\nFT_BEGIN_HEADER\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n\n  /* we disable the warning `conditional expression is constant' here */\n  /* in order to compile cleanly with the maximum level of warnings   */\n#pragma warning( disable : 4127 )\n\n#endif /* _MSC_VER */\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from a face's driver module.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );             \\\n    FT_Pointer   _tmp_  = NULL;                                             \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                              \\\n                                                                            \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                                        \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );              \\\n    FT_Pointer  _tmp_  = NULL;                                              \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    ptr = _tmp_;                                                            \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_GLOBAL_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from all modules.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );    \\\n    FT_Pointer   _tmp_;                                            \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                     \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );     \\\n    FT_Pointer  _tmp_;                                             \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    ptr   = _tmp_;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****         S E R V I C E   D E S C R I P T O R S                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  The following structure is used to _describe_ a given service\n   *  to the library.  This is useful to build simple static service lists.\n   */\n  typedef struct  FT_ServiceDescRec_\n  {\n    const char*  serv_id;     /* service name         */\n    const void*  serv_data;   /* service pointer/data */\n\n  } FT_ServiceDescRec;\n\n  typedef const FT_ServiceDescRec*  FT_ServiceDesc;\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_SERVICEDESCREC1 .. FT_DEFINE_SERVICEDESCREC6             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an array of FT_ServiceDescRec structs.          */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */\n  /*    to called with a pointer where the allocated array is returned.    */\n  /*    And when it is no longer needed a Destroy function needs           */\n  /*    to be called to release that allocation.                           */\n  /*                                                                       */\n  /*    These functions should be manyally called from the pic_init and    */\n  /*    pic_free functions of your module (see FT_DEFINE_MODULE)           */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the array will be         */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1)            \\\n  static const FT_ServiceDescRec class_[] =                                  \\\n  {                                                                          \\\n  {serv_id_1, serv_data_1},                                                  \\\n  {NULL, NULL}                                                               \\\n  };\n#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2)                                              \\\n  static const FT_ServiceDescRec class_[] =                                  \\\n  {                                                                          \\\n  {serv_id_1, serv_data_1},                                                  \\\n  {serv_id_2, serv_data_2},                                                  \\\n  {NULL, NULL}                                                               \\\n  };\n#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3)                      \\\n  static const FT_ServiceDescRec class_[] =                                  \\\n  {                                                                          \\\n  {serv_id_1, serv_data_1},                                                  \\\n  {serv_id_2, serv_data_2},                                                  \\\n  {serv_id_3, serv_data_3},                                                  \\\n  {NULL, NULL}                                                               \\\n  };\n#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \\\n        serv_id_4, serv_data_4)                                              \\\n  static const FT_ServiceDescRec class_[] =                                  \\\n  {                                                                          \\\n  {serv_id_1, serv_data_1},                                                  \\\n  {serv_id_2, serv_data_2},                                                  \\\n  {serv_id_3, serv_data_3},                                                  \\\n  {serv_id_4, serv_data_4},                                                  \\\n  {NULL, NULL}                                                               \\\n  };\n#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \\\n        serv_id_4, serv_data_4, serv_id_5, serv_data_5)                      \\\n  static const FT_ServiceDescRec class_[] =                                  \\\n  {                                                                          \\\n  {serv_id_1, serv_data_1},                                                  \\\n  {serv_id_2, serv_data_2},                                                  \\\n  {serv_id_3, serv_data_3},                                                  \\\n  {serv_id_4, serv_data_4},                                                  \\\n  {serv_id_5, serv_data_5},                                                  \\\n  {NULL, NULL}                                                               \\\n  };\n#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \\\n        serv_id_4, serv_data_4, serv_id_5, serv_data_5,                      \\\n        serv_id_6, serv_data_6)                                              \\\n  static const FT_ServiceDescRec class_[] =                                  \\\n  {                                                                          \\\n  {serv_id_1, serv_data_1},                                                  \\\n  {serv_id_2, serv_data_2},                                                  \\\n  {serv_id_3, serv_data_3},                                                  \\\n  {serv_id_4, serv_data_4},                                                  \\\n  {serv_id_5, serv_data_5},                                                  \\\n  {serv_id_6, serv_data_6},                                                  \\\n  {NULL, NULL}                                                               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1)            \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library library,                             \\\n                             FT_ServiceDescRec* clazz )                      \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    if ( clazz )                                                             \\\n      FT_FREE( clazz );                                                      \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library library,                              \\\n                            FT_ServiceDescRec** output_class)                \\\n  {                                                                          \\\n    FT_ServiceDescRec*  clazz;                                               \\\n    FT_Error          error;                                                 \\\n    FT_Memory memory = library->memory;                                      \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz)*2 ) )                               \\\n      return error;                                                          \\\n    clazz[0].serv_id = serv_id_1;                                            \\\n    clazz[0].serv_data = serv_data_1;                                        \\\n    clazz[1].serv_id = NULL;                                                 \\\n    clazz[1].serv_data = NULL;                                               \\\n    *output_class = clazz;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n#define FT_DEFINE_SERVICEDESCREC2(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2)                                              \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library library,                             \\\n                             FT_ServiceDescRec* clazz )                      \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    if ( clazz )                                                             \\\n      FT_FREE( clazz );                                                      \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library library,                              \\\n                            FT_ServiceDescRec** output_class)                \\\n  {                                                                          \\\n    FT_ServiceDescRec*  clazz;                                               \\\n    FT_Error          error;                                                 \\\n    FT_Memory memory = library->memory;                                      \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz)*3 ) )                               \\\n      return error;                                                          \\\n    clazz[0].serv_id = serv_id_1;                                            \\\n    clazz[0].serv_data = serv_data_1;                                        \\\n    clazz[1].serv_id = serv_id_2;                                            \\\n    clazz[1].serv_data = serv_data_2;                                        \\\n    clazz[2].serv_id = NULL;                                                 \\\n    clazz[2].serv_data = NULL;                                               \\\n    *output_class = clazz;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n#define FT_DEFINE_SERVICEDESCREC3(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3)                      \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library library,                             \\\n                             FT_ServiceDescRec* clazz )                      \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    if ( clazz )                                                             \\\n      FT_FREE( clazz );                                                      \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library library,                              \\\n                            FT_ServiceDescRec** output_class)                \\\n  {                                                                          \\\n    FT_ServiceDescRec*  clazz;                                               \\\n    FT_Error          error;                                                 \\\n    FT_Memory memory = library->memory;                                      \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz)*4 ) )                               \\\n      return error;                                                          \\\n    clazz[0].serv_id = serv_id_1;                                            \\\n    clazz[0].serv_data = serv_data_1;                                        \\\n    clazz[1].serv_id = serv_id_2;                                            \\\n    clazz[1].serv_data = serv_data_2;                                        \\\n    clazz[2].serv_id = serv_id_3;                                            \\\n    clazz[2].serv_data = serv_data_3;                                        \\\n    clazz[3].serv_id = NULL;                                                 \\\n    clazz[3].serv_data = NULL;                                               \\\n    *output_class = clazz;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n#define FT_DEFINE_SERVICEDESCREC4(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \\\n        serv_id_4, serv_data_4)                                              \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library library,                             \\\n                             FT_ServiceDescRec* clazz )                      \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    if ( clazz )                                                             \\\n      FT_FREE( clazz );                                                      \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library library,                              \\\n                            FT_ServiceDescRec** output_class)                \\\n  {                                                                          \\\n    FT_ServiceDescRec*  clazz;                                               \\\n    FT_Error          error;                                                 \\\n    FT_Memory memory = library->memory;                                      \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz)*5 ) )                               \\\n      return error;                                                          \\\n    clazz[0].serv_id = serv_id_1;                                            \\\n    clazz[0].serv_data = serv_data_1;                                        \\\n    clazz[1].serv_id = serv_id_2;                                            \\\n    clazz[1].serv_data = serv_data_2;                                        \\\n    clazz[2].serv_id = serv_id_3;                                            \\\n    clazz[2].serv_data = serv_data_3;                                        \\\n    clazz[3].serv_id = serv_id_4;                                            \\\n    clazz[3].serv_data = serv_data_4;                                        \\\n    clazz[4].serv_id = NULL;                                                 \\\n    clazz[4].serv_data = NULL;                                               \\\n    *output_class = clazz;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n#define FT_DEFINE_SERVICEDESCREC5(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3, serv_id_4,           \\\n        serv_data_4, serv_id_5, serv_data_5)                                 \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library library,                             \\\n                             FT_ServiceDescRec* clazz )                      \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    if ( clazz )                                                             \\\n      FT_FREE( clazz );                                                      \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library library,                              \\\n                            FT_ServiceDescRec** output_class)                \\\n  {                                                                          \\\n    FT_ServiceDescRec*  clazz;                                               \\\n    FT_Error          error;                                                 \\\n    FT_Memory memory = library->memory;                                      \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz)*6 ) )                               \\\n      return error;                                                          \\\n    clazz[0].serv_id = serv_id_1;                                            \\\n    clazz[0].serv_data = serv_data_1;                                        \\\n    clazz[1].serv_id = serv_id_2;                                            \\\n    clazz[1].serv_data = serv_data_2;                                        \\\n    clazz[2].serv_id = serv_id_3;                                            \\\n    clazz[2].serv_data = serv_data_3;                                        \\\n    clazz[3].serv_id = serv_id_4;                                            \\\n    clazz[3].serv_data = serv_data_4;                                        \\\n    clazz[4].serv_id = serv_id_5;                                            \\\n    clazz[4].serv_data = serv_data_5;                                        \\\n    clazz[5].serv_id = NULL;                                                 \\\n    clazz[5].serv_data = NULL;                                               \\\n    *output_class = clazz;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n\n#define FT_DEFINE_SERVICEDESCREC6(class_, serv_id_1, serv_data_1,            \\\n        serv_id_2, serv_data_2, serv_id_3, serv_data_3,                      \\\n        serv_id_4, serv_data_4, serv_id_5, serv_data_5,                      \\\n        serv_id_6, serv_data_6)                                              \\\n  void                                                                       \\\n  FT_Destroy_Class_##class_( FT_Library library,                             \\\n                             FT_ServiceDescRec* clazz )                      \\\n  {                                                                          \\\n    FT_Memory memory = library->memory;                                      \\\n    if ( clazz )                                                             \\\n      FT_FREE( clazz );                                                      \\\n  }                                                                          \\\n                                                                             \\\n  FT_Error                                                                   \\\n  FT_Create_Class_##class_( FT_Library library,                              \\\n                            FT_ServiceDescRec** output_class)                \\\n  {                                                                          \\\n    FT_ServiceDescRec*  clazz;                                               \\\n    FT_Error          error;                                                 \\\n    FT_Memory memory = library->memory;                                      \\\n                                                                             \\\n    if ( FT_ALLOC( clazz, sizeof(*clazz)*7 ) )                               \\\n      return error;                                                          \\\n    clazz[0].serv_id = serv_id_1;                                            \\\n    clazz[0].serv_data = serv_data_1;                                        \\\n    clazz[1].serv_id = serv_id_2;                                            \\\n    clazz[1].serv_data = serv_data_2;                                        \\\n    clazz[2].serv_id = serv_id_3;                                            \\\n    clazz[2].serv_data = serv_data_3;                                        \\\n    clazz[3].serv_id = serv_id_4;                                            \\\n    clazz[3].serv_data = serv_data_4;                                        \\\n    clazz[4].serv_id = serv_id_5;                                            \\\n    clazz[4].serv_data = serv_data_5;                                        \\\n    clazz[5].serv_id = serv_id_6;                                            \\\n    clazz[5].serv_data = serv_data_6;                                        \\\n    clazz[6].serv_id = NULL;                                                 \\\n    clazz[6].serv_data = NULL;                                               \\\n    *output_class = clazz;                                                   \\\n    return FT_Err_Ok;                                                        \\\n  } \n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /*\n   *  Parse a list of FT_ServiceDescRec descriptors and look for\n   *  a specific service by ID.  Note that the last element in the\n   *  array must be { NULL, NULL }, and that the function should\n   *  return NULL if the service isn't available.\n   *\n   *  This function can be used by modules to implement their\n   *  `get_service' method.\n   */\n  FT_BASE( FT_Pointer )\n  ft_service_list_lookup( FT_ServiceDesc  service_descriptors,\n                          const char*     service_id );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****             S E R V I C E S   C A C H E                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  This structure is used to store a cache for several frequently used\n   *  services.  It is the type of `face->internal->services'.  You\n   *  should only use FT_FACE_LOOKUP_SERVICE to access it.\n   *\n   *  All fields should have the type FT_Pointer to relax compilation\n   *  dependencies.  We assume the developer isn't completely stupid.\n   *\n   *  Each field must be named `service_XXXX' where `XXX' corresponds to\n   *  the correct FT_SERVICE_ID_XXXX macro.  See the definition of\n   *  FT_FACE_LOOKUP_SERVICE below how this is implemented.\n   *\n   */\n  typedef struct  FT_ServiceCacheRec_\n  {\n    FT_Pointer  service_POSTSCRIPT_FONT_NAME;\n    FT_Pointer  service_MULTI_MASTERS;\n    FT_Pointer  service_GLYPH_DICT;\n    FT_Pointer  service_PFR_METRICS;\n    FT_Pointer  service_WINFNT;\n\n  } FT_ServiceCacheRec, *FT_ServiceCache;\n\n\n  /*\n   *  A magic number used within the services cache.\n   */\n#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)-2)  /* magic number */\n\n\n  /*\n   * @macro:\n   *   FT_FACE_LOOKUP_SERVICE\n   *\n   * @description:\n   *   This macro is used to lookup a service from a face's driver module\n   *   using its cache.\n   *\n   * @input:\n   *   face::\n   *     The source face handle containing the cache.\n   *\n   *   field ::\n   *     The field name in the cache.\n   *\n   *   id ::\n   *     The service ID.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable receiving the service data.  NULL if not available.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer   svc;                                          \\\n    FT_Pointer*  Pptr = (FT_Pointer*)&(ptr);                   \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    *Pptr = svc;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer  svc;                                           \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    ptr = svc;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n  /*\n   *  A macro used to define new service structure types.\n   */\n\n#define FT_DEFINE_SERVICE( name )            \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    FT_Service_ ## name ## Rec ;             \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    const * FT_Service_ ## name ;            \\\n  struct FT_Service_ ## name ## Rec_\n\n  /* */\n\n  /*\n   *  The header files containing the services.\n   */\n\n#define FT_SERVICE_BDF_H                <freetype/internal/services/svbdf.h>\n#define FT_SERVICE_CID_H                <freetype/internal/services/svcid.h>\n#define FT_SERVICE_GLYPH_DICT_H         <freetype/internal/services/svgldict.h>\n#define FT_SERVICE_GX_VALIDATE_H        <freetype/internal/services/svgxval.h>\n#define FT_SERVICE_KERNING_H            <freetype/internal/services/svkern.h>\n#define FT_SERVICE_MULTIPLE_MASTERS_H   <freetype/internal/services/svmm.h>\n#define FT_SERVICE_OPENTYPE_VALIDATE_H  <freetype/internal/services/svotval.h>\n#define FT_SERVICE_PFR_H                <freetype/internal/services/svpfr.h>\n#define FT_SERVICE_POSTSCRIPT_CMAPS_H   <freetype/internal/services/svpscmap.h>\n#define FT_SERVICE_POSTSCRIPT_INFO_H    <freetype/internal/services/svpsinfo.h>\n#define FT_SERVICE_POSTSCRIPT_NAME_H    <freetype/internal/services/svpostnm.h>\n#define FT_SERVICE_SFNT_H               <freetype/internal/services/svsfnt.h>\n#define FT_SERVICE_TRUETYPE_ENGINE_H    <freetype/internal/services/svtteng.h>\n#define FT_SERVICE_TT_CMAP_H            <freetype/internal/services/svttcmap.h>\n#define FT_SERVICE_WINFNT_H             <freetype/internal/services/svwinfnt.h>\n#define FT_SERVICE_XFREE86_NAME_H       <freetype/internal/services/svxf86nm.h>\n#define FT_SERVICE_TRUETYPE_GLYF_H      <freetype/internal/services/svttglyf.h>\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTSERV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftstream.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstream.h                                                             */\n/*                                                                         */\n/*    Stream handling (specification).                                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2006, 2011 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSTREAM_H__\n#define __FTSTREAM_H__\n\n\n#include <ft2build.h>\n#include FT_SYSTEM_H\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* format of an 8-bit frame_op value:           */\n  /*                                              */\n  /* bit  76543210                                */\n  /*      xxxxxxes                                */\n  /*                                              */\n  /* s is set to 1 if the value is signed.        */\n  /* e is set to 1 if the value is little-endian. */\n  /* xxx is a command.                            */\n\n#define FT_FRAME_OP_SHIFT         2\n#define FT_FRAME_OP_SIGNED        1\n#define FT_FRAME_OP_LITTLE        2\n#define FT_FRAME_OP_COMMAND( x )  ( x >> FT_FRAME_OP_SHIFT )\n\n#define FT_MAKE_FRAME_OP( command, little, sign ) \\\n          ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )\n\n#define FT_FRAME_OP_END    0\n#define FT_FRAME_OP_START  1  /* start a new frame     */\n#define FT_FRAME_OP_BYTE   2  /* read 1-byte value     */\n#define FT_FRAME_OP_SHORT  3  /* read 2-byte value     */\n#define FT_FRAME_OP_LONG   4  /* read 4-byte value     */\n#define FT_FRAME_OP_OFF3   5  /* read 3-byte value     */\n#define FT_FRAME_OP_BYTES  6  /* read a bytes sequence */\n\n\n  typedef enum  FT_Frame_Op_\n  {\n    ft_frame_end       = 0,\n    ft_frame_start     = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),\n\n    ft_frame_byte      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 0 ),\n    ft_frame_schar     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 1 ),\n\n    ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),\n    ft_frame_short_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),\n    ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),\n    ft_frame_short_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),\n\n    ft_frame_ulong_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),\n    ft_frame_long_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),\n    ft_frame_ulong_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),\n    ft_frame_long_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),\n\n    ft_frame_uoff3_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),\n    ft_frame_off3_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),\n    ft_frame_uoff3_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),\n    ft_frame_off3_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),\n\n    ft_frame_bytes     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),\n    ft_frame_skip      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )\n\n  } FT_Frame_Op;\n\n\n  typedef struct  FT_Frame_Field_\n  {\n    FT_Byte    value;\n    FT_Byte    size;\n    FT_UShort  offset;\n\n  } FT_Frame_Field;\n\n\n  /* Construct an FT_Frame_Field out of a structure type and a field name. */\n  /* The structure type must be set in the FT_STRUCTURE macro before       */\n  /* calling the FT_FRAME_START() macro.                                   */\n  /*                                                                       */\n#define FT_FIELD_SIZE( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )\n\n#define FT_FIELD_SIZE_DELTA( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )\n\n#define FT_FIELD_OFFSET( f ) \\\n          (FT_UShort)( offsetof( FT_STRUCTURE, f ) )\n\n#define FT_FRAME_FIELD( frame_op, field ) \\\n          {                               \\\n            frame_op,                     \\\n            FT_FIELD_SIZE( field ),       \\\n            FT_FIELD_OFFSET( field )      \\\n          }\n\n#define FT_MAKE_EMPTY_FIELD( frame_op )  { frame_op, 0, 0 }\n\n#define FT_FRAME_START( size )   { ft_frame_start, 0, size }\n#define FT_FRAME_END             { ft_frame_end, 0, 0 }\n\n#define FT_FRAME_LONG( f )       FT_FRAME_FIELD( ft_frame_long_be, f )\n#define FT_FRAME_ULONG( f )      FT_FRAME_FIELD( ft_frame_ulong_be, f )\n#define FT_FRAME_SHORT( f )      FT_FRAME_FIELD( ft_frame_short_be, f )\n#define FT_FRAME_USHORT( f )     FT_FRAME_FIELD( ft_frame_ushort_be, f )\n#define FT_FRAME_OFF3( f )       FT_FRAME_FIELD( ft_frame_off3_be, f )\n#define FT_FRAME_UOFF3( f )      FT_FRAME_FIELD( ft_frame_uoff3_be, f )\n#define FT_FRAME_BYTE( f )       FT_FRAME_FIELD( ft_frame_byte, f )\n#define FT_FRAME_CHAR( f )       FT_FRAME_FIELD( ft_frame_schar, f )\n\n#define FT_FRAME_LONG_LE( f )    FT_FRAME_FIELD( ft_frame_long_le, f )\n#define FT_FRAME_ULONG_LE( f )   FT_FRAME_FIELD( ft_frame_ulong_le, f )\n#define FT_FRAME_SHORT_LE( f )   FT_FRAME_FIELD( ft_frame_short_le, f )\n#define FT_FRAME_USHORT_LE( f )  FT_FRAME_FIELD( ft_frame_ushort_le, f )\n#define FT_FRAME_OFF3_LE( f )    FT_FRAME_FIELD( ft_frame_off3_le, f )\n#define FT_FRAME_UOFF3_LE( f )   FT_FRAME_FIELD( ft_frame_uoff3_le, f )\n\n#define FT_FRAME_SKIP_LONG       { ft_frame_long_be, 0, 0 }\n#define FT_FRAME_SKIP_SHORT      { ft_frame_short_be, 0, 0 }\n#define FT_FRAME_SKIP_BYTE       { ft_frame_byte, 0, 0 }\n\n#define FT_FRAME_BYTES( field, count ) \\\n          {                            \\\n            ft_frame_bytes,            \\\n            count,                     \\\n            FT_FIELD_OFFSET( field )   \\\n          }\n\n#define FT_FRAME_SKIP_BYTES( count )  { ft_frame_skip, count, 0 }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */\n  /* type `char*' or equivalent (1-byte elements).                         */\n  /*                                                                       */\n\n#define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )\n#define FT_INT8_( p, i )  ( ((const FT_Char*)(p))[(i)] )\n\n#define FT_INT16( x )   ( (FT_Int16)(x)  )\n#define FT_UINT16( x )  ( (FT_UInt16)(x) )\n#define FT_INT32( x )   ( (FT_Int32)(x)  )\n#define FT_UINT32( x )  ( (FT_UInt32)(x) )\n\n#define FT_BYTE_I16( p, i, s )  ( FT_INT16(  FT_BYTE_( p, i ) ) << (s) )\n#define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )\n#define FT_BYTE_I32( p, i, s )  ( FT_INT32(  FT_BYTE_( p, i ) ) << (s) )\n#define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )\n\n#define FT_INT8_I16( p, i, s )  ( FT_INT16(  FT_INT8_( p, i ) ) << (s) )\n#define FT_INT8_U16( p, i, s )  ( FT_UINT16( FT_INT8_( p, i ) ) << (s) )\n#define FT_INT8_I32( p, i, s )  ( FT_INT32(  FT_INT8_( p, i ) ) << (s) )\n#define FT_INT8_U32( p, i, s )  ( FT_UINT32( FT_INT8_( p, i ) ) << (s) )\n\n\n#define FT_PEEK_SHORT( p )  FT_INT16( FT_INT8_I16( p, 0, 8) | \\\n                                      FT_BYTE_I16( p, 1, 0) )\n\n#define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \\\n                                        FT_BYTE_U16( p, 1, 0 ) )\n\n#define FT_PEEK_LONG( p )  FT_INT32( FT_INT8_I32( p, 0, 24 ) | \\\n                                     FT_BYTE_I32( p, 1, 16 ) | \\\n                                     FT_BYTE_I32( p, 2,  8 ) | \\\n                                     FT_BYTE_I32( p, 3,  0 ) )\n\n#define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                       FT_BYTE_U32( p, 1, 16 ) | \\\n                                       FT_BYTE_U32( p, 2,  8 ) | \\\n                                       FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_OFF3( p )  FT_INT32( FT_INT8_I32( p, 0, 16 ) | \\\n                                     FT_BYTE_I32( p, 1,  8 ) | \\\n                                     FT_BYTE_I32( p, 2,  0 ) )\n\n#define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                       FT_BYTE_U32( p, 1,  8 ) | \\\n                                       FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_INT8_I16( p, 1, 8 ) | \\\n                                         FT_BYTE_I16( p, 0, 0 ) )\n\n#define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \\\n                                           FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_INT8_I32( p, 3, 24 ) | \\\n                                        FT_BYTE_I32( p, 2, 16 ) | \\\n                                        FT_BYTE_I32( p, 1,  8 ) | \\\n                                        FT_BYTE_I32( p, 0,  0 ) )\n\n#define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                          FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_INT8_I32( p, 2, 16 ) | \\\n                                        FT_BYTE_I32( p, 1,  8 ) | \\\n                                        FT_BYTE_I32( p, 0,  0 ) )\n\n#define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n\n#define FT_NEXT_CHAR( buffer )       \\\n          ( (signed char)*buffer++ )\n\n#define FT_NEXT_BYTE( buffer )         \\\n          ( (unsigned char)*buffer++ )\n\n#define FT_NEXT_SHORT( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )\n\n\n#define FT_NEXT_SHORT_LE( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT_LE( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3_LE( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG_LE( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each GET_xxxx() macro uses an implicit `stream' variable.             */\n  /*                                                                       */\n#if 0\n#define FT_GET_MACRO( type )    FT_NEXT_ ## type ( stream->cursor )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( CHAR )\n#define FT_GET_BYTE()       FT_GET_MACRO( BYTE )\n#define FT_GET_SHORT()      FT_GET_MACRO( SHORT )\n#define FT_GET_USHORT()     FT_GET_MACRO( USHORT )\n#define FT_GET_OFF3()       FT_GET_MACRO( OFF3 )\n#define FT_GET_UOFF3()      FT_GET_MACRO( UOFF3 )\n#define FT_GET_LONG()       FT_GET_MACRO( LONG )\n#define FT_GET_ULONG()      FT_GET_MACRO( ULONG )\n#define FT_GET_TAG4()       FT_GET_MACRO( ULONG )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( SHORT_LE )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( USHORT_LE )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( LONG_LE )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( ULONG_LE )\n\n#else\n#define FT_GET_MACRO( func, type )        ( (type)func( stream ) )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )\n#define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )\n#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )\n#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )\n#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )\n#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )\n#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetULong, FT_Long )\n#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )\n#endif\n\n#define FT_READ_MACRO( func, type, var )        \\\n          ( var = (type)func( stream, &error ), \\\n            error != FT_Err_Ok )\n\n#define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )\n#define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )\n#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )\n#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )\n#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )\n#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )\n#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )\n#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )\n\n#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )\n#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )\n#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )\n#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /* initialize a stream for reading a regular system stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Open( FT_Stream    stream,\n                  const char*  filepathname );\n\n#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* create a new (input) stream from an FT_Open_Args structure */\n  FT_BASE( FT_Error )\n  FT_Stream_New( FT_Library           library,\n                 const FT_Open_Args*  args,\n                 FT_Stream           *astream );\n\n  /* free a stream */\n  FT_BASE( void )\n  FT_Stream_Free( FT_Stream  stream,\n                  FT_Int     external );\n\n  /* initialize a stream for reading in-memory data */\n  FT_BASE( void )\n  FT_Stream_OpenMemory( FT_Stream       stream,\n                        const FT_Byte*  base,\n                        FT_ULong        size );\n\n  /* close a stream (does not destroy the stream structure) */\n  FT_BASE( void )\n  FT_Stream_Close( FT_Stream  stream );\n\n\n  /* seek within a stream. position is relative to start of stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Seek( FT_Stream  stream,\n                  FT_ULong   pos );\n\n  /* skip bytes in a stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Skip( FT_Stream  stream,\n                  FT_Long    distance );\n\n  /* return current stream position */\n  FT_BASE( FT_Long )\n  FT_Stream_Pos( FT_Stream  stream );\n\n  /* read bytes from a stream into a user-allocated buffer, returns an */\n  /* error if not all bytes could be read.                             */\n  FT_BASE( FT_Error )\n  FT_Stream_Read( FT_Stream  stream,\n                  FT_Byte*   buffer,\n                  FT_ULong   count );\n\n  /* read bytes from a stream at a given position */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadAt( FT_Stream  stream,\n                    FT_ULong   pos,\n                    FT_Byte*   buffer,\n                    FT_ULong   count );\n\n  /* try to read bytes at the end of a stream; return number of bytes */\n  /* really available                                                 */\n  FT_BASE( FT_ULong )\n  FT_Stream_TryRead( FT_Stream  stream,\n                     FT_Byte*   buffer,\n                     FT_ULong   count );\n\n  /* Enter a frame of `count' consecutive bytes in a stream.  Returns an */\n  /* error if the frame could not be read/accessed.  The caller can use  */\n  /* the FT_Stream_Get_XXX functions to retrieve frame data without      */\n  /* error checks.                                                       */\n  /*                                                                     */\n  /* You must _always_ call FT_Stream_ExitFrame() once you have entered  */\n  /* a stream frame!                                                     */\n  /*                                                                     */\n  FT_BASE( FT_Error )\n  FT_Stream_EnterFrame( FT_Stream  stream,\n                        FT_ULong   count );\n\n  /* exit a stream frame */\n  FT_BASE( void )\n  FT_Stream_ExitFrame( FT_Stream  stream );\n\n  /* Extract a stream frame.  If the stream is disk-based, a heap block */\n  /* is allocated and the frame bytes are read into it.  If the stream  */\n  /* is memory-based, this function simply set a pointer to the data.   */\n  /*                                                                    */\n  /* Useful to optimize access to memory-based streams transparently.   */\n  /*                                                                    */\n  /* All extracted frames must be `freed' with a call to the function   */\n  /* FT_Stream_ReleaseFrame().                                          */\n  /*                                                                    */\n  FT_BASE( FT_Error )\n  FT_Stream_ExtractFrame( FT_Stream  stream,\n                          FT_ULong   count,\n                          FT_Byte**  pbytes );\n\n  /* release an extract frame (see FT_Stream_ExtractFrame) */\n  FT_BASE( void )\n  FT_Stream_ReleaseFrame( FT_Stream  stream,\n                          FT_Byte**  pbytes );\n\n  /* read a byte from an entered frame */\n  FT_BASE( FT_Char )\n  FT_Stream_GetChar( FT_Stream  stream );\n\n  /* read a 16-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShort( FT_Stream  stream );\n\n  /* read a 24-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetUOffset( FT_Stream  stream );\n\n  /* read a 32-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULong( FT_Stream  stream );\n\n  /* read a 16-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShortLE( FT_Stream  stream );\n\n  /* read a 32-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULongLE( FT_Stream  stream );\n\n\n  /* read a byte from a stream */\n  FT_BASE( FT_Char )\n  FT_Stream_ReadChar( FT_Stream  stream,\n                      FT_Error*  error );\n\n  /* read a 16-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShort( FT_Stream  stream,\n                        FT_Error*  error );\n\n  /* read a 24-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadUOffset( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* read a 32-bit big-endian integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULong( FT_Stream  stream,\n                       FT_Error*  error );\n\n  /* read a 16-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShortLE( FT_Stream  stream,\n                          FT_Error*  error );\n\n  /* read a 32-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULongLE( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* Read a structure from a stream.  The structure must be described */\n  /* by an array of FT_Frame_Field records.                           */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadFields( FT_Stream              stream,\n                        const FT_Frame_Field*  fields,\n                        void*                  structure );\n\n\n#define FT_STREAM_POS()           \\\n          FT_Stream_Pos( stream )\n\n#define FT_STREAM_SEEK( position )                           \\\n          FT_SET_ERROR( FT_Stream_Seek( stream, position ) )\n\n#define FT_STREAM_SKIP( distance )                           \\\n          FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )\n\n#define FT_STREAM_READ( buffer, count )                   \\\n          FT_SET_ERROR( FT_Stream_Read( stream,           \\\n                                        (FT_Byte*)buffer, \\\n                                        count ) )\n\n#define FT_STREAM_READ_AT( position, buffer, count )         \\\n          FT_SET_ERROR( FT_Stream_ReadAt( stream,            \\\n                                           position,         \\\n                                           (FT_Byte*)buffer, \\\n                                           count ) )\n\n#define FT_STREAM_READ_FIELDS( fields, object )                          \\\n          FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )\n\n\n#define FT_FRAME_ENTER( size )                                       \\\n          FT_SET_ERROR(                                              \\\n            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )\n\n#define FT_FRAME_EXIT()                 \\\n          FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )\n\n#define FT_FRAME_EXTRACT( size, bytes )                                       \\\n          FT_SET_ERROR(                                                       \\\n            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size,             \\\n                                                    (FT_Byte**)&(bytes) ) ) )\n\n#define FT_FRAME_RELEASE( bytes )                                         \\\n          FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream,                 \\\n                                                  (FT_Byte**)&(bytes) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTSTREAM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/fttrace.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrace.h                                                              */\n/*                                                                         */\n/*    Tracing handling (specification only).                               */\n/*                                                                         */\n/*  Copyright 2002, 2004-2007, 2009, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* definitions of trace levels for FreeType 2 */\n\n  /* the first level must always be `trace_any' */\nFT_TRACE_DEF( any )\n\n  /* base components */\nFT_TRACE_DEF( calc )      /* calculations            (ftcalc.c)   */\nFT_TRACE_DEF( memory )    /* memory manager          (ftobjs.c)   */\nFT_TRACE_DEF( stream )    /* stream manager          (ftstream.c) */\nFT_TRACE_DEF( io )        /* i/o interface           (ftsystem.c) */\nFT_TRACE_DEF( list )      /* list management         (ftlist.c)   */\nFT_TRACE_DEF( init )      /* initialization          (ftinit.c)   */\nFT_TRACE_DEF( objs )      /* base objects            (ftobjs.c)   */\nFT_TRACE_DEF( outline )   /* outline management      (ftoutln.c)  */\nFT_TRACE_DEF( glyph )     /* glyph management        (ftglyph.c)  */\nFT_TRACE_DEF( gloader )   /* glyph loader            (ftgloadr.c) */\n\nFT_TRACE_DEF( raster )    /* monochrome rasterizer   (ftraster.c) */\nFT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */\nFT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */\nFT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */\nFT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */\n\n  /* Cache sub-system */\nFT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */\n\n  /* SFNT driver components */\nFT_TRACE_DEF( sfdriver )  /* SFNT font driver        (sfdriver.c) */\nFT_TRACE_DEF( sfobjs )    /* SFNT object handler     (sfobjs.c)   */\nFT_TRACE_DEF( ttcmap )    /* charmap handler         (ttcmap.c)   */\nFT_TRACE_DEF( ttkern )    /* kerning handler         (ttkern.c)   */\nFT_TRACE_DEF( ttload )    /* basic TrueType tables   (ttload.c)   */\nFT_TRACE_DEF( ttmtx )     /* metrics-related tables  (ttmtx.c)    */\nFT_TRACE_DEF( ttpost )    /* PS table processing     (ttpost.c)   */\nFT_TRACE_DEF( ttsbit )    /* TrueType sbit handling  (ttsbit.c)   */\nFT_TRACE_DEF( ttbdf )     /* TrueType embedded BDF   (ttbdf.c)    */\n\n  /* TrueType driver components */\nFT_TRACE_DEF( ttdriver )  /* TT font driver          (ttdriver.c) */\nFT_TRACE_DEF( ttgload )   /* TT glyph loader         (ttgload.c)  */\nFT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */\nFT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */\nFT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */\nFT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */\n\n  /* Type 1 driver components */\nFT_TRACE_DEF( t1afm )\nFT_TRACE_DEF( t1driver )\nFT_TRACE_DEF( t1gload )\nFT_TRACE_DEF( t1hint )\nFT_TRACE_DEF( t1load )\nFT_TRACE_DEF( t1objs )\nFT_TRACE_DEF( t1parse )\n\n  /* PostScript helper module `psaux' */\nFT_TRACE_DEF( t1decode )\nFT_TRACE_DEF( psobjs )\n\n  /* PostScript hinting module `pshinter' */\nFT_TRACE_DEF( pshrec )\nFT_TRACE_DEF( pshalgo1 )\nFT_TRACE_DEF( pshalgo2 )\n\n  /* Type 2 driver components */\nFT_TRACE_DEF( cffdriver )\nFT_TRACE_DEF( cffgload )\nFT_TRACE_DEF( cffload )\nFT_TRACE_DEF( cffobjs )\nFT_TRACE_DEF( cffparse )\n\n  /* Type 42 driver component */\nFT_TRACE_DEF( t42 )\n\n  /* CID driver components */\nFT_TRACE_DEF( cidafm )\nFT_TRACE_DEF( ciddriver )\nFT_TRACE_DEF( cidgload )\nFT_TRACE_DEF( cidload )\nFT_TRACE_DEF( cidobjs )\nFT_TRACE_DEF( cidparse )\n\n  /* Windows font component */\nFT_TRACE_DEF( winfnt )\n\n  /* PCF font components */\nFT_TRACE_DEF( pcfdriver )\nFT_TRACE_DEF( pcfread )\n\n  /* BDF font components */\nFT_TRACE_DEF( bdfdriver )\nFT_TRACE_DEF( bdflib )\n\n  /* PFR font component */\nFT_TRACE_DEF( pfr )\n\n  /* OpenType validation components */\nFT_TRACE_DEF( otvmodule )\nFT_TRACE_DEF( otvcommon )\nFT_TRACE_DEF( otvbase )\nFT_TRACE_DEF( otvgdef )\nFT_TRACE_DEF( otvgpos )\nFT_TRACE_DEF( otvgsub )\nFT_TRACE_DEF( otvjstf )\nFT_TRACE_DEF( otvmath )\n\n  /* TrueTypeGX/AAT validation components */\nFT_TRACE_DEF( gxvmodule )\nFT_TRACE_DEF( gxvcommon )\nFT_TRACE_DEF( gxvfeat )\nFT_TRACE_DEF( gxvmort )\nFT_TRACE_DEF( gxvmorx )\nFT_TRACE_DEF( gxvbsln )\nFT_TRACE_DEF( gxvjust )\nFT_TRACE_DEF( gxvkern )\nFT_TRACE_DEF( gxvopbd )\nFT_TRACE_DEF( gxvtrak )\nFT_TRACE_DEF( gxvprop )\nFT_TRACE_DEF( gxvlcar )\n\n  /* autofit components */\nFT_TRACE_DEF( afcjk )\nFT_TRACE_DEF( aflatin )\nFT_TRACE_DEF( aflatin2 )\nFT_TRACE_DEF( afwarp )\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/ftvalid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftvalid.h                                                              */\n/*                                                                         */\n/*    FreeType validation support (specification).                         */\n/*                                                                         */\n/*  Copyright 2004 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTVALID_H__\n#define __FTVALID_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    V A L I D A T I O N                          ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to a validation object */\n  typedef struct FT_ValidatorRec_ volatile*  FT_Validator;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* There are three distinct validation levels defined here:              */\n  /*                                                                       */\n  /* FT_VALIDATE_DEFAULT ::                                                */\n  /*   A table that passes this validation level can be used reliably by   */\n  /*   FreeType.  It generally means that all offsets have been checked to */\n  /*   prevent out-of-bound reads, that array counts are correct, etc.     */\n  /*                                                                       */\n  /* FT_VALIDATE_TIGHT ::                                                  */\n  /*   A table that passes this validation level can be used reliably and  */\n  /*   doesn't contain invalid data.  For example, a charmap table that    */\n  /*   returns invalid glyph indices will not pass, even though it can     */\n  /*   be used with FreeType in default mode (the library will simply      */\n  /*   return an error later when trying to load the glyph).               */\n  /*                                                                       */\n  /*   It also checks that fields which must be a multiple of 2, 4, or 8,  */\n  /*   don't have incorrect values, etc.                                   */\n  /*                                                                       */\n  /* FT_VALIDATE_PARANOID ::                                               */\n  /*   Only for font debugging.  Checks that a table follows the           */\n  /*   specification by 100%.  Very few fonts will be able to pass this    */\n  /*   level anyway but it can be useful for certain tools like font       */\n  /*   editors/converters.                                                 */\n  /*                                                                       */\n  typedef enum  FT_ValidationLevel_\n  {\n    FT_VALIDATE_DEFAULT = 0,\n    FT_VALIDATE_TIGHT,\n    FT_VALIDATE_PARANOID\n\n  } FT_ValidationLevel;\n\n\n  /* validator structure */\n  typedef struct  FT_ValidatorRec_\n  {\n    const FT_Byte*      base;        /* address of table in memory       */\n    const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */\n    FT_ValidationLevel  level;       /* validation level                 */\n    FT_Error            error;       /* error returned. 0 means success  */\n\n    ft_jmp_buf          jump_buffer; /* used for exception handling      */\n\n  } FT_ValidatorRec;\n\n\n#define FT_VALIDATOR( x )  ((FT_Validator)( x ))\n\n\n  FT_BASE( void )\n  ft_validator_init( FT_Validator        valid,\n                     const FT_Byte*      base,\n                     const FT_Byte*      limit,\n                     FT_ValidationLevel  level );\n\n  /* Do not use this. It's broken and will cause your validator to crash */\n  /* if you run it on an invalid font.                                   */\n  FT_BASE( FT_Int )\n  ft_validator_run( FT_Validator  valid );\n\n  /* Sets the error field in a validator, then calls `longjmp' to return */\n  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */\n  /* error checks within the validation routines.                        */\n  /*                                                                     */\n  FT_BASE( void )\n  ft_validator_error( FT_Validator  valid,\n                      FT_Error      error );\n\n\n  /* Calls ft_validate_error.  Assumes that the `valid' local variable */\n  /* holds a pointer to the current validator object.                  */\n  /*                                                                   */\n  /* Use preprocessor prescan to pass FT_ERR_PREFIX.                   */\n  /*                                                                   */\n#define FT_INVALID( _prefix, _error )  FT_INVALID_( _prefix, _error )\n#define FT_INVALID_( _prefix, _error ) \\\n          ft_validator_error( valid, _prefix ## _error )\n\n  /* called when a broken table is detected */\n#define FT_INVALID_TOO_SHORT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid offset is detected */\n#define FT_INVALID_OFFSET \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )\n\n  /* called when an invalid format/value is detected */\n#define FT_INVALID_FORMAT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid glyph index is detected */\n#define FT_INVALID_GLYPH_ID \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )\n\n  /* called when an invalid field value is detected */\n#define FT_INVALID_DATA \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n\nFT_END_HEADER\n\n#endif /* __FTVALID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/internal.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  internal.h                                                             */\n/*                                                                         */\n/*    Internal header files (specification only).                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is automatically included by `ft2build.h'.                  */\n  /* Do not include it manually!                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define FT_INTERNAL_OBJECTS_H             <freetype/internal/ftobjs.h>\n#define FT_INTERNAL_PIC_H                 <freetype/internal/ftpic.h>\n#define FT_INTERNAL_STREAM_H              <freetype/internal/ftstream.h>\n#define FT_INTERNAL_MEMORY_H              <freetype/internal/ftmemory.h>\n#define FT_INTERNAL_DEBUG_H               <freetype/internal/ftdebug.h>\n#define FT_INTERNAL_CALC_H                <freetype/internal/ftcalc.h>\n#define FT_INTERNAL_DRIVER_H              <freetype/internal/ftdriver.h>\n#define FT_INTERNAL_TRACE_H               <freetype/internal/fttrace.h>\n#define FT_INTERNAL_GLYPH_LOADER_H        <freetype/internal/ftgloadr.h>\n#define FT_INTERNAL_SFNT_H                <freetype/internal/sfnt.h>\n#define FT_INTERNAL_SERVICE_H             <freetype/internal/ftserv.h>\n#define FT_INTERNAL_RFORK_H               <freetype/internal/ftrfork.h>\n#define FT_INTERNAL_VALIDATE_H            <freetype/internal/ftvalid.h>\n\n#define FT_INTERNAL_TRUETYPE_TYPES_H      <freetype/internal/tttypes.h>\n#define FT_INTERNAL_TYPE1_TYPES_H         <freetype/internal/t1types.h>\n\n#define FT_INTERNAL_POSTSCRIPT_AUX_H      <freetype/internal/psaux.h>\n#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <freetype/internal/pshints.h>\n#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <freetype/internal/psglobal.h>\n\n#define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/psaux.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psaux.h                                                                */\n/*                                                                         */\n/*    Auxiliary functions and data structures related to PostScript fonts  */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSAUX_H__\n#define __PSAUX_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                             T1_TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct PS_TableRec_*              PS_Table;\n  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Table_FuncsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of function pointers to manage PS_Table objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    table_init    :: Used to initialize a table.                       */\n  /*                                                                       */\n  /*    table_done    :: Finalizes resp. destroy a given table.            */\n  /*                                                                       */\n  /*    table_add     :: Adds a new object to a table.                     */\n  /*                                                                       */\n  /*    table_release :: Releases table data, then finalizes it.           */\n  /*                                                                       */\n  typedef struct  PS_Table_FuncsRec_\n  {\n    FT_Error\n    (*init)( PS_Table   table,\n             FT_Int     count,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Table  table );\n\n    FT_Error\n    (*add)( PS_Table    table,\n            FT_Int      idx,\n            void*       object,\n            FT_PtrDist  length );\n\n    void\n    (*release)( PS_Table  table );\n\n  } PS_Table_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Table is a simple object used to store an array of objects in */\n  /*    a single memory block.                                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    block     :: The address in memory of the growheap's block.  This  */\n  /*                 can change between two object adds, due to            */\n  /*                 reallocation.                                         */\n  /*                                                                       */\n  /*    cursor    :: The current top of the grow heap within its block.    */\n  /*                                                                       */\n  /*    capacity  :: The current size of the heap block.  Increments by    */\n  /*                 1kByte chunks.                                        */\n  /*                                                                       */\n  /*    max_elems :: The maximum number of elements in table.              */\n  /*                                                                       */\n  /*    num_elems :: The current number of elements in table.              */\n  /*                                                                       */\n  /*    elements  :: A table of element addresses within the block.        */\n  /*                                                                       */\n  /*    lengths   :: A table of element sizes within the block.            */\n  /*                                                                       */\n  /*    memory    :: The object used for memory operations                 */\n  /*                 (alloc/realloc).                                      */\n  /*                                                                       */\n  /*    funcs     :: A table of method pointers for this object.           */\n  /*                                                                       */\n  typedef struct  PS_TableRec_\n  {\n    FT_Byte*           block;          /* current memory block           */\n    FT_Offset          cursor;         /* current cursor in memory block */\n    FT_Offset          capacity;       /* current size of memory block   */\n    FT_Long            init;\n\n    FT_Int             max_elems;\n    FT_Int             num_elems;\n    FT_Byte**          elements;       /* addresses of table elements */\n    FT_PtrDist*        lengths;        /* lengths of table elements   */\n\n    FT_Memory          memory;\n    PS_Table_FuncsRec  funcs;\n\n  } PS_TableRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       T1 FIELDS & TOKENS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PS_ParserRec_*  PS_Parser;\n\n  typedef struct T1_TokenRec_*   T1_Token;\n\n  typedef struct T1_FieldRec_*   T1_Field;\n\n\n  /* simple enumeration type used to identify token types */\n  typedef enum  T1_TokenType_\n  {\n    T1_TOKEN_TYPE_NONE = 0,\n    T1_TOKEN_TYPE_ANY,\n    T1_TOKEN_TYPE_STRING,\n    T1_TOKEN_TYPE_ARRAY,\n    T1_TOKEN_TYPE_KEY, /* aka `name' */\n\n    /* do not remove */\n    T1_TOKEN_TYPE_MAX\n\n  } T1_TokenType;\n\n\n  /* a simple structure used to identify tokens */\n  typedef struct  T1_TokenRec_\n  {\n    FT_Byte*      start;   /* first character of token in input stream */\n    FT_Byte*      limit;   /* first character after the token          */\n    T1_TokenType  type;    /* type of token                            */\n\n  } T1_TokenRec;\n\n\n  /* enumeration type used to identify object fields */\n  typedef enum  T1_FieldType_\n  {\n    T1_FIELD_TYPE_NONE = 0,\n    T1_FIELD_TYPE_BOOL,\n    T1_FIELD_TYPE_INTEGER,\n    T1_FIELD_TYPE_FIXED,\n    T1_FIELD_TYPE_FIXED_1000,\n    T1_FIELD_TYPE_STRING,\n    T1_FIELD_TYPE_KEY,\n    T1_FIELD_TYPE_BBOX,\n    T1_FIELD_TYPE_INTEGER_ARRAY,\n    T1_FIELD_TYPE_FIXED_ARRAY,\n    T1_FIELD_TYPE_CALLBACK,\n\n    /* do not remove */\n    T1_FIELD_TYPE_MAX\n\n  } T1_FieldType;\n\n\n  typedef enum  T1_FieldLocation_\n  {\n    T1_FIELD_LOCATION_CID_INFO,\n    T1_FIELD_LOCATION_FONT_DICT,\n    T1_FIELD_LOCATION_FONT_EXTRA,\n    T1_FIELD_LOCATION_FONT_INFO,\n    T1_FIELD_LOCATION_PRIVATE,\n    T1_FIELD_LOCATION_BBOX,\n    T1_FIELD_LOCATION_LOADER,\n    T1_FIELD_LOCATION_FACE,\n    T1_FIELD_LOCATION_BLEND,\n\n    /* do not remove */\n    T1_FIELD_LOCATION_MAX\n\n  } T1_FieldLocation;\n\n\n  typedef void\n  (*T1_Field_ParseFunc)( FT_Face     face,\n                         FT_Pointer  parser );\n\n\n  /* structure type used to model object fields */\n  typedef struct  T1_FieldRec_\n  {\n    const char*         ident;        /* field identifier               */\n    T1_FieldLocation    location;\n    T1_FieldType        type;         /* type of field                  */\n    T1_Field_ParseFunc  reader;\n    FT_UInt             offset;       /* offset of field in object      */\n    FT_Byte             size;         /* size of field in bytes         */\n    FT_UInt             array_max;    /* maximal number of elements for */\n                                      /* array                          */\n    FT_UInt             count_offset; /* offset of element count for    */\n                                      /* arrays; must not be zero if in */\n                                      /* use -- in other words, a       */\n                                      /* `num_FOO' element must not     */\n                                      /* start the used structure if we */\n                                      /* parse a `FOO' array            */\n    FT_UInt             dict;         /* where we expect it             */\n  } T1_FieldRec;\n\n#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */\n#define T1_FIELD_DICT_PRIVATE  ( 1 << 1 )\n\n\n\n#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \\\n          {                                                 \\\n            _ident, T1CODE, _type,                          \\\n            0,                                              \\\n            FT_FIELD_OFFSET( _fname ),                      \\\n            FT_FIELD_SIZE( _fname ),                        \\\n            0, 0,                                           \\\n            _dict                                           \\\n          },\n\n#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \\\n          {                                             \\\n            _ident, T1CODE, T1_FIELD_TYPE_CALLBACK,     \\\n            (T1_Field_ParseFunc)_reader,                \\\n            0, 0,                                       \\\n            0, 0,                                       \\\n            _dict                                       \\\n          },\n\n#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \\\n          {                                                      \\\n            _ident, T1CODE, _type,                               \\\n            0,                                                   \\\n            FT_FIELD_OFFSET( _fname ),                           \\\n            FT_FIELD_SIZE_DELTA( _fname ),                       \\\n            _max,                                                \\\n            FT_FIELD_OFFSET( num_ ## _fname ),                   \\\n            _dict                                                \\\n          },\n\n#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \\\n          {                                                       \\\n            _ident, T1CODE, _type,                                \\\n            0,                                                    \\\n            FT_FIELD_OFFSET( _fname ),                            \\\n            FT_FIELD_SIZE_DELTA( _fname ),                        \\\n            _max, 0,                                              \\\n            _dict                                                 \\\n          },\n\n\n#define T1_FIELD_BOOL( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )\n\n#define T1_FIELD_NUM( _ident, _fname, _dict )                                 \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )\n\n#define T1_FIELD_FIXED( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )\n\n#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )                     \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \\\n                               _dict )\n\n#define T1_FIELD_STRING( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )\n\n#define T1_FIELD_KEY( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )\n\n#define T1_FIELD_BBOX( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )\n\n\n#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_CALLBACK( _ident, _name, _dict )       \\\n          T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 PARSER                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct PS_Parser_FuncsRec_*  PS_Parser_Funcs;\n\n  typedef struct  PS_Parser_FuncsRec_\n  {\n    void\n    (*init)( PS_Parser  parser,\n             FT_Byte*   base,\n             FT_Byte*   limit,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Parser  parser );\n\n    void\n    (*skip_spaces)( PS_Parser  parser );\n    void\n    (*skip_PS_token)( PS_Parser  parser );\n\n    FT_Long\n    (*to_int)( PS_Parser  parser );\n    FT_Fixed\n    (*to_fixed)( PS_Parser  parser,\n                 FT_Int     power_ten );\n\n    FT_Error\n    (*to_bytes)( PS_Parser  parser,\n                 FT_Byte*   bytes,\n                 FT_Offset  max_bytes,\n                 FT_Long*   pnum_bytes,\n                 FT_Bool    delimiters );\n\n    FT_Int\n    (*to_coord_array)( PS_Parser  parser,\n                       FT_Int     max_coords,\n                       FT_Short*  coords );\n    FT_Int\n    (*to_fixed_array)( PS_Parser  parser,\n                       FT_Int     max_values,\n                       FT_Fixed*  values,\n                       FT_Int     power_ten );\n\n    void\n    (*to_token)( PS_Parser  parser,\n                 T1_Token   token );\n    void\n    (*to_token_array)( PS_Parser  parser,\n                       T1_Token   tokens,\n                       FT_UInt    max_tokens,\n                       FT_Int*    pnum_tokens );\n\n    FT_Error\n    (*load_field)( PS_Parser       parser,\n                   const T1_Field  field,\n                   void**          objects,\n                   FT_UInt         max_objects,\n                   FT_ULong*       pflags );\n\n    FT_Error\n    (*load_field_table)( PS_Parser       parser,\n                         const T1_Field  field,\n                         void**          objects,\n                         FT_UInt         max_objects,\n                         FT_ULong*       pflags );\n\n  } PS_Parser_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_ParserRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Parser is an object used to parse a Type 1 font very quickly. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    cursor :: The current position in the text.                        */\n  /*                                                                       */\n  /*    base   :: Start of the processed text.                             */\n  /*                                                                       */\n  /*    limit  :: End of the processed text.                               */\n  /*                                                                       */\n  /*    error  :: The last error returned.                                 */\n  /*                                                                       */\n  /*    memory :: The object used for memory operations (alloc/realloc).   */\n  /*                                                                       */\n  /*    funcs  :: A table of functions for the parser.                     */\n  /*                                                                       */\n  typedef struct  PS_ParserRec_\n  {\n    FT_Byte*   cursor;\n    FT_Byte*   base;\n    FT_Byte*   limit;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    PS_Parser_FuncsRec  funcs;\n\n  } PS_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 BUILDER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_BuilderRec_*  T1_Builder;\n\n\n  typedef FT_Error\n  (*T1_Builder_Check_Points_Func)( T1_Builder  builder,\n                                   FT_Int      count );\n\n  typedef void\n  (*T1_Builder_Add_Point_Func)( T1_Builder  builder,\n                                FT_Pos      x,\n                                FT_Pos      y,\n                                FT_Byte     flag );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Point1_Func)( T1_Builder  builder,\n                                 FT_Pos      x,\n                                 FT_Pos      y );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Contour_Func)( T1_Builder  builder );\n\n  typedef FT_Error\n  (*T1_Builder_Start_Point_Func)( T1_Builder  builder,\n                                  FT_Pos      x,\n                                  FT_Pos      y );\n\n  typedef void\n  (*T1_Builder_Close_Contour_Func)( T1_Builder  builder );\n\n\n  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;\n\n  typedef struct  T1_Builder_FuncsRec_\n  {\n    void\n    (*init)( T1_Builder    builder,\n             FT_Face       face,\n             FT_Size       size,\n             FT_GlyphSlot  slot,\n             FT_Bool       hinting );\n\n    void\n    (*done)( T1_Builder   builder );\n\n    T1_Builder_Check_Points_Func   check_points;\n    T1_Builder_Add_Point_Func      add_point;\n    T1_Builder_Add_Point1_Func     add_point1;\n    T1_Builder_Add_Contour_Func    add_contour;\n    T1_Builder_Start_Point_Func    start_point;\n    T1_Builder_Close_Contour_Func  close_contour;\n\n  } T1_Builder_FuncsRec;\n\n\n  /* an enumeration type to handle charstring parsing states */\n  typedef enum  T1_ParseState_\n  {\n    T1_Parse_Start,\n    T1_Parse_Have_Width,\n    T1_Parse_Have_Moveto,\n    T1_Parse_Have_Path\n\n  } T1_ParseState;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Structure>                                                           */\n  /*    T1_BuilderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     A structure used during glyph loading to store its outline.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory       :: The current memory object.                         */\n  /*                                                                       */\n  /*    face         :: The current face object.                           */\n  /*                                                                       */\n  /*    glyph        :: The current glyph slot.                            */\n  /*                                                                       */\n  /*    loader       :: XXX                                                */\n  /*                                                                       */\n  /*    base         :: The base glyph outline.                            */\n  /*                                                                       */\n  /*    current      :: The current glyph outline.                         */\n  /*                                                                       */\n  /*    max_points   :: maximum points in builder outline                  */\n  /*                                                                       */\n  /*    max_contours :: Maximal number of contours in builder outline.     */\n  /*                                                                       */\n  /*    pos_x        :: The horizontal translation (if composite glyph).   */\n  /*                                                                       */\n  /*    pos_y        :: The vertical translation (if composite glyph).     */\n  /*                                                                       */\n  /*    left_bearing :: The left side bearing point.                       */\n  /*                                                                       */\n  /*    advance      :: The horizontal advance vector.                     */\n  /*                                                                       */\n  /*    bbox         :: Unused.                                            */\n  /*                                                                       */\n  /*    parse_state  :: An enumeration which controls the charstring       */\n  /*                    parsing state.                                     */\n  /*                                                                       */\n  /*    load_points  :: If this flag is not set, no points are loaded.     */\n  /*                                                                       */\n  /*    no_recurse   :: Set but not used.                                  */\n  /*                                                                       */\n  /*    metrics_only :: A boolean indicating that we only want to compute  */\n  /*                    the metrics of a given glyph, not load all of its  */\n  /*                    points.                                            */\n  /*                                                                       */\n  /*    funcs        :: An array of function pointers for the builder.     */\n  /*                                                                       */\n  typedef struct  T1_BuilderRec_\n  {\n    FT_Memory       memory;\n    FT_Face         face;\n    FT_GlyphSlot    glyph;\n    FT_GlyphLoader  loader;\n    FT_Outline*     base;\n    FT_Outline*     current;\n\n    FT_Pos          pos_x;\n    FT_Pos          pos_y;\n\n    FT_Vector       left_bearing;\n    FT_Vector       advance;\n\n    FT_BBox         bbox;          /* bounding box */\n    T1_ParseState   parse_state;\n    FT_Bool         load_points;\n    FT_Bool         no_recurse;\n\n    FT_Bool         metrics_only;\n\n    void*           hints_funcs;    /* hinter-specific */\n    void*           hints_globals;  /* hinter-specific */\n\n    T1_Builder_FuncsRec  funcs;\n\n  } T1_BuilderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 DECODER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  8\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  32\n\n#endif /* 0 */\n\n\n  typedef struct  T1_Decoder_ZoneRec_\n  {\n    FT_Byte*  cursor;\n    FT_Byte*  base;\n    FT_Byte*  limit;\n\n  } T1_Decoder_ZoneRec, *T1_Decoder_Zone;\n\n\n  typedef struct T1_DecoderRec_*              T1_Decoder;\n  typedef const struct T1_Decoder_FuncsRec_*  T1_Decoder_Funcs;\n\n\n  typedef FT_Error\n  (*T1_Decoder_Callback)( T1_Decoder  decoder,\n                          FT_UInt     glyph_index );\n\n\n  typedef struct  T1_Decoder_FuncsRec_\n  {\n    FT_Error\n    (*init)( T1_Decoder           decoder,\n             FT_Face              face,\n             FT_Size              size,\n             FT_GlyphSlot         slot,\n             FT_Byte**            glyph_names,\n             PS_Blend             blend,\n             FT_Bool              hinting,\n             FT_Render_Mode       hint_mode,\n             T1_Decoder_Callback  callback );\n\n    void\n    (*done)( T1_Decoder  decoder );\n\n    FT_Error\n    (*parse_charstrings)( T1_Decoder  decoder,\n                          FT_Byte*    base,\n                          FT_UInt     len );\n\n  } T1_Decoder_FuncsRec;\n\n\n  typedef struct  T1_DecoderRec_\n  {\n    T1_BuilderRec        builder;\n\n    FT_Long              stack[T1_MAX_CHARSTRINGS_OPERANDS];\n    FT_Long*             top;\n\n    T1_Decoder_ZoneRec   zones[T1_MAX_SUBRS_CALLS + 1];\n    T1_Decoder_Zone      zone;\n\n    FT_Service_PsCMaps   psnames;      /* for seac */\n    FT_UInt              num_glyphs;\n    FT_Byte**            glyph_names;\n\n    FT_Int               lenIV;        /* internal for sub routine calls */\n    FT_UInt              num_subrs;\n    FT_Byte**            subrs;\n    FT_PtrDist*          subrs_len;    /* array of subrs length (optional) */\n\n    FT_Matrix            font_matrix;\n    FT_Vector            font_offset;\n\n    FT_Int               flex_state;\n    FT_Int               num_flex_vectors;\n    FT_Vector            flex_vectors[7];\n\n    PS_Blend             blend;       /* for multiple master support */\n\n    FT_Render_Mode       hint_mode;\n\n    T1_Decoder_Callback  parse_callback;\n    T1_Decoder_FuncsRec  funcs;\n\n    FT_Long*             buildchar;\n    FT_UInt              len_buildchar;\n\n    FT_Bool              seac;\n\n  } T1_DecoderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            AFM PARSER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct AFM_ParserRec_*  AFM_Parser;\n\n  typedef struct  AFM_Parser_FuncsRec_\n  {\n    FT_Error\n    (*init)( AFM_Parser  parser,\n             FT_Memory   memory,\n             FT_Byte*    base,\n             FT_Byte*    limit );\n\n    void\n    (*done)( AFM_Parser  parser );\n\n    FT_Error\n    (*parse)( AFM_Parser  parser );\n\n  } AFM_Parser_FuncsRec;\n\n\n  typedef struct AFM_StreamRec_*  AFM_Stream;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    AFM_ParserRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An AFM_Parser is a parser for the AFM files.                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory    :: The object used for memory operations (alloc and      */\n  /*                 realloc).                                             */\n  /*                                                                       */\n  /*    stream    :: This is an opaque object.                             */\n  /*                                                                       */\n  /*    FontInfo  :: The result will be stored here.                       */\n  /*                                                                       */\n  /*    get_index :: A user provided function to get a glyph index by its  */\n  /*                 name.                                                 */\n  /*                                                                       */\n  typedef struct  AFM_ParserRec_\n  {\n    FT_Memory     memory;\n    AFM_Stream    stream;\n\n    AFM_FontInfo  FontInfo;\n\n    FT_Int\n    (*get_index)( const char*  name,\n                  FT_Offset    len,\n                  void*        user_data );\n\n    void*         user_data;\n\n  } AFM_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     TYPE1 CHARMAPS                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct T1_CMap_ClassesRec_*  T1_CMap_Classes;\n\n  typedef struct T1_CMap_ClassesRec_\n  {\n    FT_CMap_Class  standard;\n    FT_CMap_Class  expert;\n    FT_CMap_Class  custom;\n    FT_CMap_Class  unicode;\n\n  } T1_CMap_ClassesRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        PSAux Module Interface                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  PSAux_ServiceRec_\n  {\n    /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */\n    const PS_Table_FuncsRec*    ps_table_funcs;\n    const PS_Parser_FuncsRec*   ps_parser_funcs;\n    const T1_Builder_FuncsRec*  t1_builder_funcs;\n    const T1_Decoder_FuncsRec*  t1_decoder_funcs;\n\n    void\n    (*t1_decrypt)( FT_Byte*   buffer,\n                   FT_Offset  length,\n                   FT_UShort  seed );\n\n    T1_CMap_Classes  t1_cmap_classes;\n\n    /* fields after this comment line were added after version 2.1.10 */\n    const AFM_Parser_FuncsRec*  afm_parser_funcs;\n\n  } PSAux_ServiceRec, *PSAux_Service;\n\n  /* backwards-compatible type definition */\n  typedef PSAux_ServiceRec   PSAux_Interface;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 Some convenience functions                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define IS_PS_NEWLINE( ch ) \\\n  ( (ch) == '\\r' ||         \\\n    (ch) == '\\n' )\n\n#define IS_PS_SPACE( ch )  \\\n  ( (ch) == ' '         || \\\n    IS_PS_NEWLINE( ch ) || \\\n    (ch) == '\\t'        || \\\n    (ch) == '\\f'        || \\\n    (ch) == '\\0' )\n\n#define IS_PS_SPECIAL( ch )       \\\n  ( (ch) == '/'                || \\\n    (ch) == '(' || (ch) == ')' || \\\n    (ch) == '<' || (ch) == '>' || \\\n    (ch) == '[' || (ch) == ']' || \\\n    (ch) == '{' || (ch) == '}' || \\\n    (ch) == '%'                )\n\n#define IS_PS_DELIM( ch )  \\\n  ( IS_PS_SPACE( ch )   || \\\n    IS_PS_SPECIAL( ch ) )\n\n#define IS_PS_DIGIT( ch )        \\\n  ( (ch) >= '0' && (ch) <= '9' )\n\n#define IS_PS_XDIGIT( ch )            \\\n  ( IS_PS_DIGIT( ch )              || \\\n    ( (ch) >= 'A' && (ch) <= 'F' ) || \\\n    ( (ch) >= 'a' && (ch) <= 'f' ) )\n\n#define IS_PS_BASE85( ch )       \\\n  ( (ch) >= '!' && (ch) <= 'u' )\n\n#define IS_PS_TOKEN( cur, limit, token )                                \\\n  ( (char)(cur)[0] == (token)[0]                                     && \\\n    ( (cur) + sizeof ( (token) ) == (limit) ||                          \\\n      ( (cur) + sizeof( (token) ) < (limit)          &&                 \\\n        IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) )             && \\\n    ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )\n\n\nFT_END_HEADER\n\n#endif /* __PSAUX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/pshints.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshints.h                                                              */\n/*                                                                         */\n/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */\n/*    recorders (specification only).  These are used to support native    */\n/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */\n/*                                                                         */\n/*  Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 by                  */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHINTS_H__\n#define __PSHINTS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PSH_GlobalsRec_*  PSH_Globals;\n\n  typedef FT_Error\n  (*PSH_Globals_NewFunc)( FT_Memory     memory,\n                          T1_Private*   private_dict,\n                          PSH_Globals*  aglobals );\n\n  typedef FT_Error\n  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,\n                               FT_Fixed     x_scale,\n                               FT_Fixed     y_scale,\n                               FT_Fixed     x_delta,\n                               FT_Fixed     y_delta );\n\n  typedef void\n  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );\n\n\n  typedef struct  PSH_Globals_FuncsRec_\n  {\n    PSH_Globals_NewFunc       create;\n    PSH_Globals_SetScaleFunc  set_scale;\n    PSH_Globals_DestroyFunc   destroy;\n\n  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 1 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stem', `stem3', or `reset').  Note that these functions do\n   *     not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   PostScript hinter.\n   *\n   */\n  typedef struct T1_HintsRec_*  T1_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of\n   *   a given @T1_Hints object.\n   *\n   */\n  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to prepare it for a new Type 1\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T1_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T1_Hints_OpenFunc)( T1_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStemFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record a new horizontal or\n   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'\n   *   operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   coords ::\n   *     Array of 2 coordinates in 16.16 format, used as (position,length)\n   *     stem descriptor.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   `coords[0]' is the absolute stem position (lowest coordinate);\n   *   `coords[1]' is the length.\n   *\n   *   The length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   *   If the length is -21 (corresponding to a bottom ghost stem), then\n   *   the real stem position is `coords[0]+coords[1]'.\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStemFunc)( T1_Hints   hints,\n                           FT_UInt    dimension,\n                           FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStem3Func\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record three\n   *   counter-controlled horizontal or vertical stems at once.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems, 1 for vertical ones.\n   *\n   *   coords ::\n   *     An array of 6 values in 16.16 format, holding 3 (position,length)\n   *     pairs for the counter-controlled stems.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   The lengths cannot be negative (ghost stems are never\n   *   counter-controlled).\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStem3Func)( T1_Hints   hints,\n                            FT_UInt    dimension,\n                            FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ResetFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to reset the stems hints in a\n   *   recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph in which the\n   *     previously defined hints apply.\n   *\n   */\n  typedef void\n  (*T1_Hints_ResetFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_CloseFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called once all hints have been\n   *   recorded.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font as the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_ApplyFunc)( T1_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T1_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T1_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T1 Hints recorder.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stem ::\n   *     The function to set a simple stem.\n   *\n   *   stem3 ::\n   *     The function to set counter-controlled stems.\n   *\n   *   reset ::\n   *     The function to reset stem hints.\n   *\n   *   apply ::\n   *     The function to apply the hints to the corresponding glyph outline.\n   *\n   */\n  typedef struct  T1_Hints_FuncsRec_\n  {\n    T1_Hints               hints;\n    T1_Hints_OpenFunc      open;\n    T1_Hints_CloseFunc     close;\n    T1_Hints_SetStemFunc   stem;\n    T1_Hints_SetStem3Func  stem3;\n    T1_Hints_ResetFunc     reset;\n    T1_Hints_ApplyFunc     apply;\n\n  } T1_Hints_FuncsRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 2 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stems', `hintmask', `counters').  Note that these\n   *     functions do not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   Postscript hinter.\n   *\n   */\n  typedef struct T2_HintsRec_*  T2_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of\n   *   a given @T2_Hints object.\n   *\n   */\n  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to prepare it for a new Type 2\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T2_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T2_Hints_OpenFunc)( T2_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_StemsFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set the table of stems in\n   *   either the vertical or horizontal dimension.  Equivalent to the\n   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   count ::\n   *     The number of stems.\n   *\n   *   coords ::\n   *     An array of `count' (position,length) pairs in 16.16 format.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   There are `2*count' elements in the `coords' array.  Each even\n   *   element is an absolute position in font units, each odd element is a\n   *   length in font units.\n   *\n   *   A length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   */\n  typedef void\n  (*T2_Hints_StemsFunc)( T2_Hints   hints,\n                         FT_UInt    dimension,\n                         FT_UInt    count,\n                         FT_Fixed*  coordinates );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_MaskFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given hintmask (this\n   *   corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The glyph index of the last point to which the previously defined\n   *     or activated hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *   The `bytes' array can come directly from the Type 2 charstring and\n   *   respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_MaskFunc)( T2_Hints        hints,\n                        FT_UInt         end_point,\n                        FT_UInt         bit_count,\n                        const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CounterFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given counter mask\n   *   (this corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     A glyph index of the last point to which the previously defined or\n   *     active hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *    The `bytes' array can come directly from the Type 2 charstring and\n   *    respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_CounterFunc)( T2_Hints        hints,\n                           FT_UInt         bit_count,\n                           const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_CloseFunc)( T2_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called after the `close'\n   *   method.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font than the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_ApplyFunc)( T2_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T2_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T2_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T2 hints recorder object.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stems ::\n   *     The function to set the dimension's stems table.\n   *\n   *   hintmask ::\n   *     The function to set hint masks.\n   *\n   *   counter ::\n   *     The function to set counter masks.\n   *\n   *   apply ::\n   *     The function to apply the hints on the corresponding glyph outline.\n   *\n   */\n  typedef struct  T2_Hints_FuncsRec_\n  {\n    T2_Hints              hints;\n    T2_Hints_OpenFunc     open;\n    T2_Hints_CloseFunc    close;\n    T2_Hints_StemsFunc    stems;\n    T2_Hints_MaskFunc     hintmask;\n    T2_Hints_CounterFunc  counter;\n    T2_Hints_ApplyFunc    apply;\n\n  } T2_Hints_FuncsRec;\n\n\n  /* */\n\n\n  typedef struct  PSHinter_Interface_\n  {\n    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );\n    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );\n    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );\n\n  } PSHinter_Interface;\n\n  typedef PSHinter_Interface*  PSHinter_Service;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_,             \\\n                                     get_t1_funcs_, get_t2_funcs_)           \\\n  static const PSHinter_Interface class_ =                                   \\\n  {                                                                          \\\n    get_globals_funcs_, get_t1_funcs_, get_t2_funcs_                         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_PSHINTER_INTERFACE(class_, get_globals_funcs_,             \\\n                                     get_t1_funcs_, get_t2_funcs_)           \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Library library,                                \\\n                          PSHinter_Interface*  clazz)                        \\\n  {                                                                          \\\n    FT_UNUSED(library);                                                      \\\n    clazz->get_globals_funcs = get_globals_funcs_;                           \\\n    clazz->get_t1_funcs = get_t1_funcs_;                                     \\\n    clazz->get_t2_funcs = get_t2_funcs_;                                     \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\nFT_END_HEADER\n\n#endif /* __PSHINTS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svbdf.h                                                                */\n/*                                                                         */\n/*    The FreeType BDF services (specification).                           */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVBDF_H__\n#define __SVBDF_H__\n\n#include FT_BDF_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_BDF  \"bdf\"\n\n  typedef FT_Error\n  (*FT_BDF_GetCharsetIdFunc)( FT_Face       face,\n                              const char*  *acharset_encoding,\n                              const char*  *acharset_registry );\n\n  typedef FT_Error\n  (*FT_BDF_GetPropertyFunc)( FT_Face           face,\n                             const char*       prop_name,\n                             BDF_PropertyRec  *aproperty );\n\n\n  FT_DEFINE_SERVICE( BDF )\n  {\n    FT_BDF_GetCharsetIdFunc  get_charset_id;\n    FT_BDF_GetPropertyFunc   get_property;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \\\n  static const FT_Service_BDFRec class_ =                                \\\n  {                                                                      \\\n    get_charset_id_, get_property_                                       \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \\\n  void                                                                   \\\n  FT_Init_Class_##class_( FT_Service_BDFRec*  clazz )                    \\\n  {                                                                      \\\n    clazz->get_charset_id = get_charset_id_;                             \\\n    clazz->get_property = get_property_;                                 \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svcid.h                                                                */\n/*                                                                         */\n/*    The FreeType CID font services (specification).                      */\n/*                                                                         */\n/*  Copyright 2007, 2009 by Derek Clegg, Michael Toftdal.                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVCID_H__\n#define __SVCID_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_CID  \"CID\"\n\n  typedef FT_Error\n  (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face       face,\n                                               const char*  *registry,\n                                               const char*  *ordering,\n                                               FT_Int       *supplement );\n  typedef FT_Error\n  (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face   face,\n                                         FT_Bool  *is_cid );\n  typedef FT_Error\n  (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face   face,\n                                      FT_UInt   glyph_index,\n                                      FT_UInt  *cid );\n\n  FT_DEFINE_SERVICE( CID )\n  {\n    FT_CID_GetRegistryOrderingSupplementFunc  get_ros;\n    FT_CID_GetIsInternallyCIDKeyedFunc        get_is_cid;\n    FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_,                           \\\n        get_is_cid_, get_cid_from_glyph_index_ )                             \\\n  static const FT_Service_CIDRec class_ =                                    \\\n  {                                                                          \\\n    get_ros_, get_is_cid_, get_cid_from_glyph_index_                         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_,                           \\\n        get_is_cid_, get_cid_from_glyph_index_ )                             \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Library library,                                \\\n                          FT_Service_CIDRec* clazz)                          \\\n  {                                                                          \\\n    FT_UNUSED(library);                                                      \\\n    clazz->get_ros = get_ros_;                                               \\\n    clazz->get_is_cid = get_is_cid_;                                         \\\n    clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;             \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svgldict.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgldict.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph dictionary services (specification).              */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGLDICT_H__\n#define __SVGLDICT_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to retrieve glyph names, as well as to find the\n   *  index of a given glyph name in a font.\n   *\n   */\n\n#define FT_SERVICE_ID_GLYPH_DICT  \"glyph-dict\"\n\n\n  typedef FT_Error\n  (*FT_GlyphDict_GetNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_GlyphDict_NameIndexFunc)( FT_Face     face,\n                                 FT_String*  glyph_name );\n\n\n  FT_DEFINE_SERVICE( GlyphDict )\n  {\n    FT_GlyphDict_GetNameFunc    get_name;\n    FT_GlyphDict_NameIndexFunc  name_index;  /* optional */\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \\\n  static const FT_Service_GlyphDictRec class_ =                        \\\n  {                                                                    \\\n    get_name_, name_index_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \\\n  void                                                                 \\\n  FT_Init_Class_##class_( FT_Library library,                          \\\n                          FT_Service_GlyphDictRec* clazz)              \\\n  {                                                                    \\\n    FT_UNUSED(library);                                                \\\n    clazz->get_name = get_name_;                                       \\\n    clazz->name_index = name_index_;                                   \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGLDICT_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005 by                                                */\n/*  Masatake YAMATO, Red Hat K.K.,                                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGXVAL_H__\n#define __SVGXVAL_H__\n\n#include FT_GX_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_GX_VALIDATE           \"truetypegx-validate\"\n#define FT_SERVICE_ID_CLASSICKERN_VALIDATE  \"classickern-validate\"\n\n  typedef FT_Error\n  (*gxv_validate_func)( FT_Face   face,\n                        FT_UInt   gx_flags,\n                        FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                        FT_UInt   table_length );\n\n\n  typedef FT_Error\n  (*ckern_validate_func)( FT_Face   face,\n                          FT_UInt   ckern_flags,\n                          FT_Bytes  *ckern_table );\n\n\n  FT_DEFINE_SERVICE( GXvalidate )\n  {\n    gxv_validate_func  validate;\n  };\n\n  FT_DEFINE_SERVICE( CKERNvalidate )\n  {\n    ckern_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svkern.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svkern.h                                                               */\n/*                                                                         */\n/*    The FreeType Kerning service (specification).                        */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVKERN_H__\n#define __SVKERN_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n#define FT_SERVICE_ID_KERNING  \"kerning\"\n\n\n  typedef FT_Error\n  (*FT_Kerning_TrackGetFunc)( FT_Face    face,\n                              FT_Fixed   point_size,\n                              FT_Int     degree,\n                              FT_Fixed*  akerning );\n\n  FT_DEFINE_SERVICE( Kerning )\n  {\n    FT_Kerning_TrackGetFunc  get_track;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVKERN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svmm.h                                                                 */\n/*                                                                         */\n/*    The FreeType Multiple Masters and GX var services (specification).   */\n/*                                                                         */\n/*  Copyright 2003, 2004 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVMM_H__\n#define __SVMM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to manage multiple-masters data in a given face.\n   *\n   *  See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).\n   *\n   */\n\n#define FT_SERVICE_ID_MULTI_MASTERS  \"multi-masters\"\n\n\n  typedef FT_Error\n  (*FT_Get_MM_Func)( FT_Face           face,\n                     FT_Multi_Master*  master );\n\n  typedef FT_Error\n  (*FT_Get_MM_Var_Func)( FT_Face      face,\n                         FT_MM_Var*  *master );\n\n  typedef FT_Error\n  (*FT_Set_MM_Design_Func)( FT_Face   face,\n                            FT_UInt   num_coords,\n                            FT_Long*  coords );\n\n  typedef FT_Error\n  (*FT_Set_Var_Design_Func)( FT_Face    face,\n                             FT_UInt    num_coords,\n                             FT_Fixed*  coords );\n\n  typedef FT_Error\n  (*FT_Set_MM_Blend_Func)( FT_Face   face,\n                           FT_UInt   num_coords,\n                           FT_Long*  coords );\n\n\n  FT_DEFINE_SERVICE( MultiMasters )\n  {\n    FT_Get_MM_Func          get_mm;\n    FT_Set_MM_Design_Func   set_mm_design;\n    FT_Set_MM_Blend_Func    set_mm_blend;\n    FT_Get_MM_Var_Func      get_mm_var;\n    FT_Set_Var_Design_Func  set_var_design;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_,   \\\n        set_mm_blend_, get_mm_var_, set_var_design_)                         \\\n  static const FT_Service_MultiMastersRec class_ =                           \\\n  {                                                                          \\\n    get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_     \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_,   \\\n        set_mm_blend_, get_mm_var_, set_var_design_)                         \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Service_MultiMastersRec*  clazz )               \\\n  {                                                                          \\\n    clazz->get_mm = get_mm_;                                                 \\\n    clazz->set_mm_design = set_mm_design_;                                   \\\n    clazz->set_mm_blend = set_mm_blend_;                                     \\\n    clazz->get_mm_var = get_mm_var_;                                         \\\n    clazz->set_var_design = set_var_design_;                                 \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svotval.h                                                              */\n/*                                                                         */\n/*    The FreeType OpenType validation service (specification).            */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVOTVAL_H__\n#define __SVOTVAL_H__\n\n#include FT_OPENTYPE_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_OPENTYPE_VALIDATE  \"opentype-validate\"\n\n\n  typedef FT_Error\n  (*otv_validate_func)( FT_Face volatile  face,\n                        FT_UInt           ot_flags,\n                        FT_Bytes         *base,\n                        FT_Bytes         *gdef,\n                        FT_Bytes         *gpos,\n                        FT_Bytes         *gsub,\n                        FT_Bytes         *jstf );\n\n\n  FT_DEFINE_SERVICE( OTvalidate )\n  {\n    otv_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpfr.h                                                                */\n/*                                                                         */\n/*    Internal PFR service functions (specification).                      */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPFR_H__\n#define __SVPFR_H__\n\n#include FT_PFR_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PFR_METRICS  \"pfr-metrics\"\n\n\n  typedef FT_Error\n  (*FT_PFR_GetMetricsFunc)( FT_Face    face,\n                            FT_UInt   *aoutline,\n                            FT_UInt   *ametrics,\n                            FT_Fixed  *ax_scale,\n                            FT_Fixed  *ay_scale );\n\n  typedef FT_Error\n  (*FT_PFR_GetKerningFunc)( FT_Face     face,\n                            FT_UInt     left,\n                            FT_UInt     right,\n                            FT_Vector  *avector );\n\n  typedef FT_Error\n  (*FT_PFR_GetAdvanceFunc)( FT_Face   face,\n                            FT_UInt   gindex,\n                            FT_Pos   *aadvance );\n\n\n  FT_DEFINE_SERVICE( PfrMetrics )\n  {\n    FT_PFR_GetMetricsFunc  get_metrics;\n    FT_PFR_GetKerningFunc  get_kerning;\n    FT_PFR_GetAdvanceFunc  get_advance;\n\n  };\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __SVPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svpostnm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpostnm.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript name services (specification).               */\n/*                                                                         */\n/*  Copyright 2003, 2007 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPOSTNM_H__\n#define __SVPOSTNM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n  /*\n   *  A trivial service used to retrieve the PostScript name of a given\n   *  font when available.  The `get_name' field should never be NULL.\n   *\n   *  The corresponding function can return NULL to indicate that the\n   *  PostScript name is not available.\n   *\n   *  The name is owned by the face and will be destroyed with it.\n   */\n\n#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME  \"postscript-font-name\"\n\n\n  typedef const char*\n  (*FT_PsName_GetFunc)( FT_Face  face );\n\n\n  FT_DEFINE_SERVICE( PsFontName )\n  {\n    FT_PsName_GetFunc  get_ps_font_name;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \\\n  static const FT_Service_PsFontNameRec class_ =                   \\\n  {                                                                \\\n    get_ps_font_name_                                              \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \\\n  void                                                             \\\n  FT_Init_Class_##class_( FT_Library library,                      \\\n                          FT_Service_PsFontNameRec* clazz)         \\\n  {                                                                \\\n    FT_UNUSED(library);                                            \\\n    clazz->get_ps_font_name = get_ps_font_name_;                   \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPOSTNM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svpscmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpscmap.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript charmap service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSCMAP_H__\n#define __SVPSCMAP_H__\n\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_CMAPS  \"postscript-cmaps\"\n\n\n  /*\n   *  Adobe glyph name to unicode value.\n   */\n  typedef FT_UInt32\n  (*PS_Unicode_ValueFunc)( const char*  glyph_name );\n\n  /*\n   *  Macintosh name id to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Macintosh_NameFunc)( FT_UInt  name_index );\n\n  /*\n   *  Adobe standard string ID to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );\n\n\n  /*\n   *  Simple unicode -> glyph index charmap built from font glyph names\n   *  table.\n   */\n  typedef struct  PS_UniMap_\n  {\n    FT_UInt32  unicode;      /* bit 31 set: is glyph variant */\n    FT_UInt    glyph_index;\n\n  } PS_UniMap;\n\n\n  typedef struct PS_UnicodesRec_*  PS_Unicodes;\n\n  typedef struct  PS_UnicodesRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt     num_maps;\n    PS_UniMap*  maps;\n\n  } PS_UnicodesRec;\n\n\n  /*\n   *  A function which returns a glyph name for a given index.  Returns\n   *  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_GetGlyphNameFunc)( FT_Pointer  data,\n                          FT_UInt     string_index );\n\n  /*\n   *  A function used to release the glyph name returned by\n   *  PS_GetGlyphNameFunc, when needed\n   */\n  typedef void\n  (*PS_FreeGlyphNameFunc)( FT_Pointer  data,\n                           const char*  name );\n\n  typedef FT_Error\n  (*PS_Unicodes_InitFunc)( FT_Memory             memory,\n                           PS_Unicodes           unicodes,\n                           FT_UInt               num_glyphs,\n                           PS_GetGlyphNameFunc   get_glyph_name,\n                           PS_FreeGlyphNameFunc  free_glyph_name,\n                           FT_Pointer            glyph_data );\n\n  typedef FT_UInt\n  (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,\n                                FT_UInt32    unicode );\n\n  typedef FT_UInt32\n  (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,\n                               FT_UInt32   *unicode );\n\n\n  FT_DEFINE_SERVICE( PsCMaps )\n  {\n    PS_Unicode_ValueFunc       unicode_value;\n\n    PS_Unicodes_InitFunc       unicodes_init;\n    PS_Unicodes_CharIndexFunc  unicodes_char_index;\n    PS_Unicodes_CharNextFunc   unicodes_char_next;\n\n    PS_Macintosh_NameFunc      macintosh_name;\n    PS_Adobe_Std_StringsFunc   adobe_std_strings;\n    const unsigned short*      adobe_std_encoding;\n    const unsigned short*      adobe_expert_encoding;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \\\n        unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \\\n        adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \\\n  static const FT_Service_PsCMapsRec class_ =                                \\\n  {                                                                          \\\n    unicode_value_, unicodes_init_,                                          \\\n    unicodes_char_index_, unicodes_char_next_, macintosh_name_,              \\\n    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_          \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \\\n        unicodes_char_index_, unicodes_char_next_, macintosh_name_,          \\\n        adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)     \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Library library,                                \\\n                          FT_Service_PsCMapsRec* clazz)                      \\\n  {                                                                          \\\n    FT_UNUSED(library);                                                      \\\n    clazz->unicode_value = unicode_value_;                                   \\\n    clazz->unicodes_init = unicodes_init_;                                   \\\n    clazz->unicodes_char_index = unicodes_char_index_;                       \\\n    clazz->unicodes_char_next = unicodes_char_next_;                         \\\n    clazz->macintosh_name = macintosh_name_;                                 \\\n    clazz->adobe_std_strings = adobe_std_strings_;                           \\\n    clazz->adobe_std_encoding = adobe_std_encoding_;                         \\\n    clazz->adobe_expert_encoding = adobe_expert_encoding_;                   \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svpsinfo.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpsinfo.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript info service (specification).                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSINFO_H__\n#define __SVPSINFO_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_INFO  \"postscript-info\"\n\n\n  typedef FT_Error\n  (*PS_GetFontInfoFunc)( FT_Face          face,\n                         PS_FontInfoRec*  afont_info );\n\n  typedef FT_Error\n  (*PS_GetFontExtraFunc)( FT_Face           face,\n                          PS_FontExtraRec*  afont_extra );\n\n  typedef FT_Int\n  (*PS_HasGlyphNamesFunc)( FT_Face   face );\n\n  typedef FT_Error\n  (*PS_GetFontPrivateFunc)( FT_Face         face,\n                            PS_PrivateRec*  afont_private );\n\n\n  FT_DEFINE_SERVICE( PsInfo )\n  {\n    PS_GetFontInfoFunc     ps_get_font_info;\n    PS_GetFontExtraFunc    ps_get_font_extra;\n    PS_HasGlyphNamesFunc   ps_has_glyph_names;\n    PS_GetFontPrivateFunc  ps_get_font_private;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_,      \\\n        ps_get_font_extra_, has_glyph_names_, get_font_private_) \\\n  static const FT_Service_PsInfoRec class_ =                     \\\n  {                                                              \\\n    get_font_info_, ps_get_font_extra_, has_glyph_names_,        \\\n    get_font_private_                                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_,      \\\n        ps_get_font_extra_, has_glyph_names_, get_font_private_) \\\n  void                                                           \\\n  FT_Init_Class_##class_( FT_Library library,                    \\\n                          FT_Service_PsInfoRec*  clazz)          \\\n  {                                                              \\\n    FT_UNUSED(library);                                          \\\n    clazz->ps_get_font_info = get_font_info_;                    \\\n    clazz->ps_get_font_extra = ps_get_font_extra_;               \\\n    clazz->ps_has_glyph_names = has_glyph_names_;                \\\n    clazz->ps_get_font_private = get_font_private_;              \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSINFO_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svsfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svsfnt.h                                                               */\n/*                                                                         */\n/*    The FreeType SFNT table loading service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2004 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVSFNT_H__\n#define __SVSFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_SFNT_TABLE  \"sfnt-table\"\n\n\n  /*\n   * Used to implement FT_Load_Sfnt_Table().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableLoadFunc)( FT_Face    face,\n                            FT_ULong   tag,\n                            FT_Long    offset,\n                            FT_Byte*   buffer,\n                            FT_ULong*  length );\n\n  /*\n   * Used to implement FT_Get_Sfnt_Table().\n   */\n  typedef void*\n  (*FT_SFNT_TableGetFunc)( FT_Face      face,\n                           FT_Sfnt_Tag  tag );\n\n\n  /*\n   * Used to implement FT_Sfnt_Table_Info().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableInfoFunc)( FT_Face    face,\n                            FT_UInt    idx,\n                            FT_ULong  *tag,\n                            FT_ULong  *offset,\n                            FT_ULong  *length );\n\n\n  FT_DEFINE_SERVICE( SFNT_Table )\n  {\n    FT_SFNT_TableLoadFunc  load_table;\n    FT_SFNT_TableGetFunc   get_table;\n    FT_SFNT_TableInfoFunc  table_info;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_)  \\\n  static const FT_Service_SFNT_TableRec class_ =                     \\\n  {                                                                  \\\n    load_, get_, info_                                               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \\\n  void                                                              \\\n  FT_Init_Class_##class_( FT_Service_SFNT_TableRec*  clazz )        \\\n  {                                                                 \\\n    clazz->load_table = load_;                                      \\\n    clazz->get_table = get_;                                        \\\n    clazz->table_info = info_;                                      \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVSFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svttcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttcmap.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType/sfnt cmap extra information service.           */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  Masatake YAMATO, Redhat K.K.                                           */\n/*                                                                         */\n/*  Copyright 2003, 2008 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/* Development of this service is support of\n   Information-technology Promotion Agency, Japan. */\n\n#ifndef __SVTTCMAP_H__\n#define __SVTTCMAP_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_CMAP \"tt-cmaps\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_CMapInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to store TrueType/sfnt specific cmap information  */\n  /*    which is not covered by the generic @FT_CharMap structure.  This   */\n  /*    structure can be accessed with the @FT_Get_TT_CMap_Info function.  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    language ::                                                        */\n  /*      The language ID used in Mac fonts.  Definitions of values are in */\n  /*      freetype/ttnameid.h.                                             */\n  /*                                                                       */\n  /*    format ::                                                          */\n  /*      The cmap format.  OpenType 1.5 defines the formats 0 (byte       */\n  /*      encoding table), 2~(high-byte mapping through table), 4~(segment */\n  /*      mapping to delta values), 6~(trimmed table mapping), 8~(mixed    */\n  /*      16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented   */\n  /*      coverage), and 14 (Unicode Variation Sequences).                 */\n  /*                                                                       */\n  typedef struct  TT_CMapInfo_\n  {\n    FT_ULong language;\n    FT_Long  format;\n\n  } TT_CMapInfo;\n\n\n  typedef FT_Error\n  (*TT_CMap_Info_GetFunc)( FT_CharMap    charmap,\n                           TT_CMapInfo  *cmap_info );\n\n\n  FT_DEFINE_SERVICE( TTCMaps )\n  {\n    TT_CMap_Info_GetFunc  get_cmap_info;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_)  \\\n  static const FT_Service_TTCMapsRec class_ =                 \\\n  {                                                           \\\n    get_cmap_info_                                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \\\n  void                                                       \\\n  FT_Init_Class_##class_( FT_Library library,                \\\n                          FT_Service_TTCMapsRec*  clazz)     \\\n  {                                                          \\\n    FT_UNUSED(library);                                      \\\n    clazz->get_cmap_info = get_cmap_info_;                   \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svtteng.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svtteng.h                                                              */\n/*                                                                         */\n/*    The FreeType TrueType engine query service (specification).          */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVTTENG_H__\n#define __SVTTENG_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_TRUETYPE_ENGINE  \"truetype-engine\"\n\n  /*\n   * Used to implement FT_Get_TrueType_Engine_Type\n   */\n\n  FT_DEFINE_SERVICE( TrueTypeEngine )\n  {\n    FT_TrueTypeEngineType  engine_type;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVTTENG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svttglyf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttglyf.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType glyph service.                                 */\n/*                                                                         */\n/*  Copyright 2007 by David Turner.                                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __SVTTGLYF_H__\n#define __SVTTGLYF_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_GLYF \"tt-glyf\"\n\n\n  typedef FT_ULong\n  (*TT_Glyf_GetLocationFunc)( FT_Face    face,\n                              FT_UInt    gindex,\n                              FT_ULong  *psize );\n\n  FT_DEFINE_SERVICE( TTGlyf )\n  {\n    TT_Glyf_GetLocationFunc  get_location;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ )   \\\n  static const FT_Service_TTGlyfRec class_ =                  \\\n  {                                                           \\\n    get_location_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ )   \\\n  void                                                        \\\n  FT_Init_Class_##class_( FT_Service_TTGlyfRec*  clazz )      \\\n  {                                                           \\\n    clazz->get_location = get_location_;                      \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTGLYF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svwinfnt.h                                                             */\n/*                                                                         */\n/*    The FreeType Windows FNT/FONT service (specification).               */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVWINFNT_H__\n#define __SVWINFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_WINFONTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_WINFNT  \"winfonts\"\n\n  typedef FT_Error\n  (*FT_WinFnt_GetHeaderFunc)( FT_Face               face,\n                              FT_WinFNT_HeaderRec  *aheader );\n\n\n  FT_DEFINE_SERVICE( WinFnt )\n  {\n    FT_WinFnt_GetHeaderFunc  get_header;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVWINFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/services/svxf86nm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svxf86nm.h                                                             */\n/*                                                                         */\n/*    The FreeType XFree86 services (specification only).                  */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVXF86NM_H__\n#define __SVXF86NM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A trivial service used to return the name of a face's font driver,\n   *  according to the XFree86 nomenclature.  Note that the service data\n   *  is a simple constant string pointer.\n   */\n\n#define FT_SERVICE_ID_XF86_NAME  \"xf86-driver-name\"\n\n#define FT_XF86_FORMAT_TRUETYPE  \"TrueType\"\n#define FT_XF86_FORMAT_TYPE_1    \"Type 1\"\n#define FT_XF86_FORMAT_BDF       \"BDF\"\n#define FT_XF86_FORMAT_PCF       \"PCF\"\n#define FT_XF86_FORMAT_TYPE_42   \"Type 42\"\n#define FT_XF86_FORMAT_CID       \"CID Type 1\"\n#define FT_XF86_FORMAT_CFF       \"CFF\"\n#define FT_XF86_FORMAT_PFR       \"PFR\"\n#define FT_XF86_FORMAT_WINFNT    \"Windows FNT\"\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVXF86NM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/sfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfnt.h                                                                 */\n/*                                                                         */\n/*    High-level `sfnt' driver interface (specification).                  */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFNT_H__\n#define __SFNT_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Init_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    First part of the SFNT face object initialization.  This finds     */\n  /*    the face in a SFNT file or collection, and load its format tag in  */\n  /*    face->format_tag.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  /*    This function recognizes fonts embedded in a `TrueType             */\n  /*    collection'.                                                       */\n  /*                                                                       */\n  /*    Once the format tag has been validated by the font driver, it      */\n  /*    should then call the TT_Load_Face_Func() callback to read the rest */\n  /*    of the SFNT tables in the object.                                  */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Init_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Second part of the SFNT face object initialization.  This loads    */\n  /*    the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function must be called after TT_Init_Face_Func().            */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Done_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A callback used to delete the common SFNT data from a face.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT destroy the face object.                    */\n  /*                                                                       */\n  typedef void\n  (*TT_Done_Face_Func)( TT_Face  face );\n\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SFNT_HeaderRec_Func                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the header of a SFNT font file.  Supports collections.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sfnt       :: The SFNT header.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  /*    This function recognizes fonts embedded in a `TrueType             */\n  /*    collection'.                                                       */\n  /*                                                                       */\n  /*    This function checks that the header is valid by looking at the    */\n  /*    values of `search_range', `entry_selector', and `range_shift'.     */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SFNT_HeaderRec_Func)( TT_Face      face,\n                                  FT_Stream    stream,\n                                  FT_Long      face_index,\n                                  SFNT_Header  sfnt );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Directory_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the table directory into a face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /*    sfnt   :: The SFNT header.                                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be on the first byte after the 4-byte font  */\n  /*    format tag.  This is the case just after a call to                 */\n  /*    TT_Load_Format_Tag().                                              */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Directory_Func)( TT_Face      face,\n                             FT_Stream    stream,\n                             SFNT_Header  sfnt );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Any_Func                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load any font table into client memory.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: The face object to look for.                             */\n  /*                                                                       */\n  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */\n  /*              to access the whole font file, else set this parameter   */\n  /*              to a valid TrueType table tag that you can forge with    */\n  /*              the MAKE_TT_TAG macro.                                   */\n  /*                                                                       */\n  /*    offset :: The starting offset in the table (or the file if         */\n  /*              tag == 0).                                               */\n  /*                                                                       */\n  /*    length :: The address of the decision variable:                    */\n  /*                                                                       */\n  /*                If length == NULL:                                     */\n  /*                  Loads the whole table.  Returns an error if          */\n  /*                  `offset' == 0!                                       */\n  /*                                                                       */\n  /*                If *length == 0:                                       */\n  /*                  Exits immediately; returning the length of the given */\n  /*                  table or of the font file, depending on the value of */\n  /*                  `tag'.                                               */\n  /*                                                                       */\n  /*                If *length != 0:                                       */\n  /*                  Loads the next `length' bytes of table or font,      */\n  /*                  starting at offset `offset' (in table or font too).  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer :: The address of target buffer.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    TrueType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Any_Func)( TT_Face    face,\n                       FT_ULong   tag,\n                       FT_Long    offset,\n                       FT_Byte   *buffer,\n                       FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Find_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether an embedded bitmap (an `sbit') exists for a given    */\n  /*    glyph, at a given strike.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    glyph_index   :: The glyph index.                                  */\n  /*                                                                       */\n  /*    strike_index  :: The current strike index.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    arange        :: The SBit range containing the glyph index.        */\n  /*                                                                       */\n  /*    astrike       :: The SBit strike containing the glyph index.       */\n  /*                                                                       */\n  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns                    */\n  /*    SFNT_Err_Invalid_Argument if no sbit exists for the requested      */\n  /*    glyph.                                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Find_SBit_Image_Func)( TT_Face          face,\n                              FT_UInt          glyph_index,\n                              FT_ULong         strike_index,\n                              TT_SBit_Range   *arange,\n                              TT_SBit_Strike  *astrike,\n                              FT_ULong        *aglyph_offset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Metrics_Func                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the big metrics for a given embedded bitmap.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream      :: The input stream.                                   */\n  /*                                                                       */\n  /*    range       :: The SBit range containing the glyph.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    big_metrics :: A big SBit metrics structure for the glyph.         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be positioned at the glyph's offset within  */\n  /*    the `EBDT' table before the call.                                  */\n  /*                                                                       */\n  /*    If the image format uses variable metrics, the stream cursor is    */\n  /*    positioned just after the metrics header in the `EBDT' table on    */\n  /*    function exit.                                                     */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Metrics_Func)( FT_Stream        stream,\n                                TT_SBit_Range    range,\n                                TT_SBit_Metrics  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given glyph sbit image from the font resource.  This also   */\n  /*    returns its metrics.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      The target face object.                                          */\n  /*                                                                       */\n  /*    strike_index ::                                                    */\n  /*      The strike index.                                                */\n  /*                                                                       */\n  /*    glyph_index ::                                                     */\n  /*      The current glyph index.                                         */\n  /*                                                                       */\n  /*    load_flags ::                                                      */\n  /*      The current load flags.                                          */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      The input stream.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amap ::                                                            */\n  /*      The target pixmap.                                               */\n  /*                                                                       */\n  /*    ametrics ::                                                        */\n  /*      A big sbit metrics structure for the glyph image.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    glyph sbit exists for the index.                                   */\n  /*                                                                       */\n  /*  <Note>                                                               */\n  /*    The `map.buffer' field is always freed before the glyph is loaded. */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Image_Func)( TT_Face              face,\n                              FT_ULong             strike_index,\n                              FT_UInt              glyph_index,\n                              FT_UInt              load_flags,\n                              FT_Stream            stream,\n                              FT_Bitmap           *amap,\n                              TT_SBit_MetricsRec  *ametrics );\n\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Set_SBit_Strike_OldFunc                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select an sbit strike for a given size request.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    req           :: The size request.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    astrike_index :: The index of the sbit strike.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    sbit strike exists for the selected ppem values.                   */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Set_SBit_Strike_OldFunc)( TT_Face    face,\n                                 FT_UInt    x_ppem,\n                                 FT_UInt    y_ppem,\n                                 FT_ULong*  astrike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_CharMap_Load_Func                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads a given TrueType character map into memory.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the parent face object.                      */\n  /*                                                                       */\n  /*    stream :: A handle to the current stream object.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    cmap   :: A pointer to a cmap object.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The function assumes that the stream is already in use (i.e.,      */\n  /*    opened).  In case of error, all partially allocated tables are     */\n  /*    released.                                                          */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_CharMap_Load_Func)( TT_Face    face,\n                           void*      cmap,\n                           FT_Stream  input );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_CharMap_Free_Func                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a character mapping table.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the parent face object.                        */\n  /*                                                                       */\n  /*    cmap :: A handle to a cmap object.                                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_CharMap_Free_Func)( TT_Face       face,\n                           void*         cmap );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Set_SBit_Strike_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select an sbit strike for a given size request.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    req           :: The size request.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    astrike_index :: The index of the sbit strike.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    sbit strike exists for the selected ppem values.                   */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Set_SBit_Strike_Func)( TT_Face          face,\n                              FT_Size_Request  req,\n                              FT_ULong*        astrike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Strike_Metrics_Func                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the metrics of a given strike.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    strike_index  :: The strike index.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    metrics       :: the metrics of the strike.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    such sbit strike exists.                                           */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Strike_Metrics_Func)( TT_Face           face,\n                                  FT_ULong          strike_index,\n                                  FT_Size_Metrics*  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_PS_Name_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the PostScript glyph name of a glyph.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    idx  :: The glyph index.                                           */\n  /*                                                                       */\n  /*    PSname :: The address of a string pointer.  Will be NULL in case   */\n  /*              of error, otherwise it is a pointer to the glyph name.   */\n  /*                                                                       */\n  /*              You must not modify the returned string!                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_PS_Name_Func)( TT_Face      face,\n                          FT_UInt      idx,\n                          FT_String**  PSname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Metrics_Func                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a metrics table, which is a table with a horizontal and a     */\n  /*    vertical version.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load the vertical one.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Metrics_Func)( TT_Face    face,\n                           FT_Stream  stream,\n                           FT_Bool    vertical );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_Metrics_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the horizontal or vertical header in a face object.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load vertical metrics.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_Metrics_Func)( TT_Face     face,\n                          FT_Bool     vertical,\n                          FT_UInt     gindex,\n                          FT_Short*   abearing,\n                          FT_UShort*  aadvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The function uses `face->goto_table' to seek the stream to the     */\n  /*    start of the table, except while loading the font directory.       */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Table_Func)( TT_Face    face,\n                         FT_Stream  stream );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Free_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Free a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  typedef void\n  (*TT_Free_Table_Func)( TT_Face  face );\n\n\n  /*\n   * @functype:\n   *    TT_Face_GetKerningFunc\n   *\n   * @description:\n   *    Return the horizontal kerning value between two glyphs.\n   *\n   * @input:\n   *    face        :: A handle to the source face object.\n   *    left_glyph  :: The left glyph index.\n   *    right_glyph :: The right glyph index.\n   *\n   * @return:\n   *    The kerning value in font units.\n   */\n  typedef FT_Int\n  (*TT_Face_GetKerningFunc)( TT_Face  face,\n                             FT_UInt  left_glyph,\n                             FT_UInt  right_glyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_Interface                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure holds pointers to the functions used to load and    */\n  /*    free the basic tables that are required in a `sfnt' font file.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Check the various xxx_Func() descriptions for details.             */\n  /*                                                                       */\n  typedef struct  SFNT_Interface_\n  {\n    TT_Loader_GotoTableFunc      goto_table;\n\n    TT_Init_Face_Func            init_face;\n    TT_Load_Face_Func            load_face;\n    TT_Done_Face_Func            done_face;\n    FT_Module_Requester          get_interface;\n\n    TT_Load_Any_Func             load_any;\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    TT_Load_SFNT_HeaderRec_Func  load_sfnt_header;\n    TT_Load_Directory_Func       load_directory;\n#endif\n\n    /* these functions are called by `load_face' but they can also  */\n    /* be called from external modules, if there is a need to do so */\n    TT_Load_Table_Func           load_head;\n    TT_Load_Metrics_Func         load_hhea;\n    TT_Load_Table_Func           load_cmap;\n    TT_Load_Table_Func           load_maxp;\n    TT_Load_Table_Func           load_os2;\n    TT_Load_Table_Func           load_post;\n\n    TT_Load_Table_Func           load_name;\n    TT_Free_Table_Func           free_name;\n\n    /* optional tables */\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    TT_Load_Table_Func           load_hdmx_stub;\n    TT_Free_Table_Func           free_hdmx_stub;\n#endif\n\n    /* this field was called `load_kerning' up to version 2.1.10 */\n    TT_Load_Table_Func           load_kern;\n\n    TT_Load_Table_Func           load_gasp;\n    TT_Load_Table_Func           load_pclt;\n\n    /* see `ttload.h'; this field was called `load_bitmap_header' up to */\n    /* version 2.1.10                                                   */\n    TT_Load_Table_Func           load_bhed;\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n    /* see `ttsbit.h' */\n    TT_Set_SBit_Strike_OldFunc   set_sbit_strike_stub;\n    TT_Load_Table_Func           load_sbits_stub;\n\n    /*\n     *  The following two fields appeared in version 2.1.8, and were placed\n     *  between `load_sbits' and `load_sbit_image'.  We support them as a\n     *  special exception since they are used by Xfont library within the\n     *  X.Org xserver, and because the probability that other rogue clients\n     *  use the other version 2.1.7 fields below is _extremely_ low.\n     *\n     *  Note that this forces us to disable an interesting memory-saving\n     *  optimization though...\n     */\n\n    TT_Find_SBit_Image_Func      find_sbit_image;\n    TT_Load_SBit_Metrics_Func    load_sbit_metrics;\n\n#endif\n\n    TT_Load_SBit_Image_Func      load_sbit_image;\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    TT_Free_Table_Func           free_sbits_stub;\n#endif\n\n    /* see `ttpost.h' */\n    TT_Get_PS_Name_Func          get_psname;\n    TT_Free_Table_Func           free_psnames;\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    TT_CharMap_Load_Func         load_charmap_stub;\n    TT_CharMap_Free_Func         free_charmap_stub;\n#endif\n\n    /* starting here, the structure differs from version 2.1.7 */\n\n    /* this field was introduced in version 2.1.8, named `get_psname' */\n    TT_Face_GetKerningFunc       get_kerning;\n\n    /* new elements introduced after version 2.1.10 */\n\n    /* load the font directory, i.e., the offset table and */\n    /* the table directory                                 */\n    TT_Load_Table_Func           load_font_dir;\n    TT_Load_Metrics_Func         load_hmtx;\n\n    TT_Load_Table_Func           load_eblc;\n    TT_Free_Table_Func           free_eblc;\n\n    TT_Set_SBit_Strike_Func      set_sbit_strike;\n    TT_Load_Strike_Metrics_Func  load_strike_metrics;\n\n    TT_Get_Metrics_Func          get_metrics;\n\n  } SFNT_Interface;\n\n\n  /* transitional */\n  typedef SFNT_Interface*   SFNT_Service;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a) \\\n  a, \n#else\n  #define FT_DEFINE_DRIVERS_OLD_INTERNAL(a)\n#endif\n#define FT_INTERNAL(a) \\\n  a, \n\n#define FT_DEFINE_SFNT_INTERFACE(class_,                                     \\\n    goto_table_, init_face_, load_face_, done_face_, get_interface_,         \\\n    load_any_, load_sfnt_header_, load_directory_, load_head_,               \\\n    load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_,               \\\n    load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_,                \\\n    load_kern_, load_gasp_, load_pclt_, load_bhed_,                          \\\n    set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_,               \\\n    load_sbit_metrics_, load_sbit_image_, free_sbits_stub_,                  \\\n    get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_,      \\\n    get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_,        \\\n    set_sbit_strike_, load_strike_metrics_, get_metrics_ )                   \\\n  static const SFNT_Interface class_ =                                       \\\n  {                                                                          \\\n    FT_INTERNAL(goto_table_) \\\n    FT_INTERNAL(init_face_) \\\n    FT_INTERNAL(load_face_) \\\n    FT_INTERNAL(done_face_) \\\n    FT_INTERNAL(get_interface_) \\\n    FT_INTERNAL(load_any_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory_) \\\n    FT_INTERNAL(load_head_) \\\n    FT_INTERNAL(load_hhea_) \\\n    FT_INTERNAL(load_cmap_) \\\n    FT_INTERNAL(load_maxp_) \\\n    FT_INTERNAL(load_os2_) \\\n    FT_INTERNAL(load_post_) \\\n    FT_INTERNAL(load_name_) \\\n    FT_INTERNAL(free_name_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub_) \\\n    FT_INTERNAL(load_kern_) \\\n    FT_INTERNAL(load_gasp_) \\\n    FT_INTERNAL(load_pclt_) \\\n    FT_INTERNAL(load_bhed_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics_) \\\n    FT_INTERNAL(load_sbit_image_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub_) \\\n    FT_INTERNAL(get_psname_) \\\n    FT_INTERNAL(free_psnames_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub_) \\\n    FT_INTERNAL(get_kerning_) \\\n    FT_INTERNAL(load_font_dir_) \\\n    FT_INTERNAL(load_hmtx_) \\\n    FT_INTERNAL(load_eblc_) \\\n    FT_INTERNAL(free_eblc_) \\\n    FT_INTERNAL(set_sbit_strike_) \\\n    FT_INTERNAL(load_strike_metrics_) \\\n    FT_INTERNAL(get_metrics_) \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */ \n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n#define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_) \\\n  clazz->a = a_;\n#else\n  #define FT_DEFINE_DRIVERS_OLD_INTERNAL(a, a_)\n#endif\n#define FT_INTERNAL(a, a_) \\\n  clazz->a = a_;\n\n#define FT_DEFINE_SFNT_INTERFACE(class_,                                     \\\n    goto_table_, init_face_, load_face_, done_face_, get_interface_,         \\\n    load_any_, load_sfnt_header_, load_directory_, load_head_,               \\\n    load_hhea_, load_cmap_, load_maxp_, load_os2_, load_post_,               \\\n    load_name_, free_name_, load_hdmx_stub_, free_hdmx_stub_,                \\\n    load_kern_, load_gasp_, load_pclt_, load_bhed_,                          \\\n    set_sbit_strike_stub_, load_sbits_stub_, find_sbit_image_,               \\\n    load_sbit_metrics_, load_sbit_image_, free_sbits_stub_,                  \\\n    get_psname_, free_psnames_, load_charmap_stub_, free_charmap_stub_,      \\\n    get_kerning_, load_font_dir_, load_hmtx_, load_eblc_, free_eblc_,        \\\n    set_sbit_strike_, load_strike_metrics_, get_metrics_ )                   \\\n  void                                                                       \\\n  FT_Init_Class_##class_( FT_Library library, SFNT_Interface*  clazz )       \\\n  {                                                                          \\\n    FT_UNUSED(library);                                                      \\\n    FT_INTERNAL(goto_table,goto_table_) \\\n    FT_INTERNAL(init_face,init_face_) \\\n    FT_INTERNAL(load_face,load_face_) \\\n    FT_INTERNAL(done_face,done_face_) \\\n    FT_INTERNAL(get_interface,get_interface_) \\\n    FT_INTERNAL(load_any,load_any_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sfnt_header,load_sfnt_header_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_directory,load_directory_) \\\n    FT_INTERNAL(load_head,load_head_) \\\n    FT_INTERNAL(load_hhea,load_hhea_) \\\n    FT_INTERNAL(load_cmap,load_cmap_) \\\n    FT_INTERNAL(load_maxp,load_maxp_) \\\n    FT_INTERNAL(load_os2,load_os2_) \\\n    FT_INTERNAL(load_post,load_post_) \\\n    FT_INTERNAL(load_name,load_name_) \\\n    FT_INTERNAL(free_name,free_name_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_hdmx_stub,load_hdmx_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_hdmx_stub,free_hdmx_stub_) \\\n    FT_INTERNAL(load_kern,load_kern_) \\\n    FT_INTERNAL(load_gasp,load_gasp_) \\\n    FT_INTERNAL(load_pclt,load_pclt_) \\\n    FT_INTERNAL(load_bhed,load_bhed_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(set_sbit_strike_stub,set_sbit_strike_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbits_stub,load_sbits_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(find_sbit_image,find_sbit_image_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_sbit_metrics,load_sbit_metrics_) \\\n    FT_INTERNAL(load_sbit_image,load_sbit_image_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_sbits_stub,free_sbits_stub_) \\\n    FT_INTERNAL(get_psname,get_psname_) \\\n    FT_INTERNAL(free_psnames,free_psnames_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(load_charmap_stub,load_charmap_stub_) \\\n    FT_DEFINE_DRIVERS_OLD_INTERNAL(free_charmap_stub,free_charmap_stub_) \\\n    FT_INTERNAL(get_kerning,get_kerning_) \\\n    FT_INTERNAL(load_font_dir,load_font_dir_) \\\n    FT_INTERNAL(load_hmtx,load_hmtx_) \\\n    FT_INTERNAL(load_eblc,load_eblc_) \\\n    FT_INTERNAL(free_eblc,free_eblc_) \\\n    FT_INTERNAL(set_sbit_strike,set_sbit_strike_) \\\n    FT_INTERNAL(load_strike_metrics,load_strike_metrics_) \\\n    FT_INTERNAL(get_metrics,get_metrics_) \\\n  } \n\n#endif /* FT_CONFIG_OPTION_PIC */ \n\nFT_END_HEADER\n\n#endif /* __SFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/t1types.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1types.h                                                              */\n/*                                                                         */\n/*    Basic Type1/Type2 type definitions and interface (specification      */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TYPES_H__\n#define __T1TYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_EncodingRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling a custom encoding.                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_chars  :: The number of character codes in the encoding.       */\n  /*                  Usually 256.                                         */\n  /*                                                                       */\n  /*    code_first :: The lowest valid character code in the encoding.     */\n  /*                                                                       */\n  /*    code_last  :: The highest valid character code in the encoding     */\n  /*                  + 1. When equal to code_first there are no valid     */\n  /*                  character codes.                                     */\n  /*                                                                       */\n  /*    char_index :: An array of corresponding glyph indices.             */\n  /*                                                                       */\n  /*    char_name  :: An array of corresponding glyph names.               */\n  /*                                                                       */\n  typedef struct  T1_EncodingRecRec_\n  {\n    FT_Int       num_chars;\n    FT_Int       code_first;\n    FT_Int       code_last;\n\n    FT_UShort*   char_index;\n    FT_String**  char_name;\n\n  } T1_EncodingRec, *T1_Encoding;\n\n\n  typedef enum  T1_EncodingType_\n  {\n    T1_ENCODING_TYPE_NONE = 0,\n    T1_ENCODING_TYPE_ARRAY,\n    T1_ENCODING_TYPE_STANDARD,\n    T1_ENCODING_TYPE_ISOLATIN1,\n    T1_ENCODING_TYPE_EXPERT\n\n  } T1_EncodingType;\n\n\n  /* used to hold extra data of PS_FontInfoRec that\n   * cannot be stored in the publicly defined structure.\n   *\n   * Note these can't be blended with multiple-masters.\n   */\n  typedef struct  PS_FontExtraRec_\n  {\n    FT_UShort  fs_type;\n\n  } PS_FontExtraRec;\n\n\n  typedef struct  T1_FontRec_\n  {\n    PS_FontInfoRec   font_info;         /* font info dictionary   */\n    PS_FontExtraRec  font_extra;        /* font info extra fields */\n    PS_PrivateRec    private_dict;      /* private dictionary     */\n    FT_String*       font_name;         /* top-level dictionary   */\n\n    T1_EncodingType  encoding_type;\n    T1_EncodingRec   encoding;\n\n    FT_Byte*         subrs_block;\n    FT_Byte*         charstrings_block;\n    FT_Byte*         glyph_names_block;\n\n    FT_Int           num_subrs;\n    FT_Byte**        subrs;\n    FT_PtrDist*      subrs_len;\n\n    FT_Int           num_glyphs;\n    FT_String**      glyph_names;       /* array of glyph names       */\n    FT_Byte**        charstrings;       /* array of glyph charstrings */\n    FT_PtrDist*      charstrings_len;\n\n    FT_Byte          paint_type;\n    FT_Byte          font_type;\n    FT_Matrix        font_matrix;\n    FT_Vector        font_offset;\n    FT_BBox          font_bbox;\n    FT_Long          font_id;\n\n    FT_Fixed         stroke_width;\n\n  } T1_FontRec, *T1_Font;\n\n\n  typedef struct  CID_SubrsRec_\n  {\n    FT_UInt    num_subrs;\n    FT_Byte**  code;\n\n  } CID_SubrsRec, *CID_Subrs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                AFM FONT INFORMATION STRUCTURES                    ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  AFM_TrackKernRec_\n  {\n    FT_Int    degree;\n    FT_Fixed  min_ptsize;\n    FT_Fixed  min_kern;\n    FT_Fixed  max_ptsize;\n    FT_Fixed  max_kern;\n\n  } AFM_TrackKernRec, *AFM_TrackKern;\n\n  typedef struct  AFM_KernPairRec_\n  {\n    FT_Int  index1;\n    FT_Int  index2;\n    FT_Int  x;\n    FT_Int  y;\n\n  } AFM_KernPairRec, *AFM_KernPair;\n\n  typedef struct  AFM_FontInfoRec_\n  {\n    FT_Bool        IsCIDFont;\n    FT_BBox        FontBBox;\n    FT_Fixed       Ascender;\n    FT_Fixed       Descender;\n    AFM_TrackKern  TrackKerns;   /* free if non-NULL */\n    FT_Int         NumTrackKern;\n    AFM_KernPair   KernPairs;    /* free if non-NULL */\n    FT_Int         NumKernPair;\n\n  } AFM_FontInfoRec, *AFM_FontInfo;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_FaceRec_*   T1_Face;\n  typedef struct CID_FaceRec_*  CID_Face;\n\n\n  typedef struct  T1_FaceRec_\n  {\n    FT_FaceRec      root;\n    T1_FontRec      type1;\n    const void*     psnames;\n    const void*     psaux;\n    const void*     afm_data;\n    FT_CharMapRec   charmaprecs[2];\n    FT_CharMap      charmaps[2];\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    PS_Unicodes     unicode_map;\n#endif\n\n    /* support for Multiple Masters fonts */\n    PS_Blend        blend;\n\n    /* undocumented, optional: indices of subroutines that express      */\n    /* the NormalizeDesignVector and the ConvertDesignVector procedure, */\n    /* respectively, as Type 2 charstrings; -1 if keywords not present  */\n    FT_Int           ndv_idx;\n    FT_Int           cdv_idx;\n\n    /* undocumented, optional: has the same meaning as len_buildchar */\n    /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25    */\n    FT_UInt          len_buildchar;\n    FT_Long*         buildchar;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    const void*     pshinter;\n\n  } T1_FaceRec;\n\n\n  typedef struct  CID_FaceRec_\n  {\n    FT_FaceRec       root;\n    void*            psnames;\n    void*            psaux;\n    CID_FaceInfoRec  cid;\n    PS_FontExtraRec  font_extra;\n#if 0\n    void*            afm_data;\n#endif\n    CID_Subrs        subrs;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    void*            pshinter;\n\n    /* since version 2.1.8, but was originally positioned after `afm_data' */\n    FT_Byte*         binary_data; /* used if hex data has been converted */\n    FT_Stream        cid_stream;\n\n  } CID_FaceRec;\n\n\nFT_END_HEADER\n\n#endif /* __T1TYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/internal/tttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttypes.h                                                              */\n/*                                                                         */\n/*    Basic SFNT/TrueType type definitions and interface (specification    */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTYPES_H__\n#define __TTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TRUETYPE_TABLES_H\n#include FT_INTERNAL_OBJECTS_H\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include FT_MULTIPLE_MASTERS_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TTC_HeaderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    TrueType collection header.  This table contains the offsets of    */\n  /*    the font headers of each distinct TrueType face in the file.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag     :: Must be `ttc ' to indicate a TrueType collection.       */\n  /*                                                                       */\n  /*    version :: The version number.                                     */\n  /*                                                                       */\n  /*    count   :: The number of faces in the collection.  The             */\n  /*               specification says this should be an unsigned long, but */\n  /*               we use a signed long since we need the value -1 for     */\n  /*               specific purposes.                                      */\n  /*                                                                       */\n  /*    offsets :: The offsets of the font headers, one per face.          */\n  /*                                                                       */\n  typedef struct  TTC_HeaderRec_\n  {\n    FT_ULong   tag;\n    FT_Fixed   version;\n    FT_Long    count;\n    FT_ULong*  offsets;\n\n  } TTC_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_HeaderRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    SFNT file format header.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format_tag     :: The font format tag.                             */\n  /*                                                                       */\n  /*    num_tables     :: The number of tables in file.                    */\n  /*                                                                       */\n  /*    search_range   :: Must be `16 * (max power of 2 <= num_tables)'.   */\n  /*                                                                       */\n  /*    entry_selector :: Must be log2 of `search_range / 16'.             */\n  /*                                                                       */\n  /*    range_shift    :: Must be `num_tables * 16 - search_range'.        */\n  /*                                                                       */\n  typedef struct  SFNT_HeaderRec_\n  {\n    FT_ULong   format_tag;\n    FT_UShort  num_tables;\n    FT_UShort  search_range;\n    FT_UShort  entry_selector;\n    FT_UShort  range_shift;\n\n    FT_ULong   offset;  /* not in file */\n\n  } SFNT_HeaderRec, *SFNT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure describes a given table of a TrueType font.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Tag      :: A four-bytes tag describing the table.                 */\n  /*                                                                       */\n  /*    CheckSum :: The table checksum.  This value can be ignored.        */\n  /*                                                                       */\n  /*    Offset   :: The offset of the table from the start of the TrueType */\n  /*                font in its resource.                                  */\n  /*                                                                       */\n  /*    Length   :: The table length (in bytes).                           */\n  /*                                                                       */\n  typedef struct  TT_TableRec_\n  {\n    FT_ULong  Tag;        /*        table type */\n    FT_ULong  CheckSum;   /*    table checksum */\n    FT_ULong  Offset;     /* table file offset */\n    FT_ULong  Length;     /*      table length */\n\n  } TT_TableRec, *TT_Table;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_LongMetricsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the long metrics of the `hmtx' and `vmtx'     */\n  /*    TrueType tables.  The values are expressed in font units.          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    advance :: The advance width or height for the glyph.              */\n  /*                                                                       */\n  /*    bearing :: The left-side or top-side bearing for the glyph.        */\n  /*                                                                       */\n  typedef struct  TT_LongMetricsRec_\n  {\n    FT_UShort  advance;\n    FT_Short   bearing;\n\n  } TT_LongMetricsRec, *TT_LongMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_ShortMetrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple type to model the short metrics of the `hmtx' and `vmtx'  */\n  /*    tables.                                                            */\n  /*                                                                       */\n  typedef FT_Short  TT_ShortMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameEntryRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling TrueType name records.  Name records are used */\n  /*    to store important strings like family name, style name,           */\n  /*    copyright, etc. in _localized_ versions (i.e., language, encoding, */\n  /*    etc).                                                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platformID   :: The ID of the name's encoding platform.            */\n  /*                                                                       */\n  /*    encodingID   :: The platform-specific ID for the name's encoding.  */\n  /*                                                                       */\n  /*    languageID   :: The platform-specific ID for the name's language.  */\n  /*                                                                       */\n  /*    nameID       :: The ID specifying what kind of name this is.       */\n  /*                                                                       */\n  /*    stringLength :: The length of the string in bytes.                 */\n  /*                                                                       */\n  /*    stringOffset :: The offset to the string in the `name' table.      */\n  /*                                                                       */\n  /*    string       :: A pointer to the string's bytes.  Note that these  */\n  /*                    are usually UTF-16 encoded characters.             */\n  /*                                                                       */\n  typedef struct  TT_NameEntryRec_\n  {\n    FT_UShort  platformID;\n    FT_UShort  encodingID;\n    FT_UShort  languageID;\n    FT_UShort  nameID;\n    FT_UShort  stringLength;\n    FT_ULong   stringOffset;\n\n    /* this last field is not defined in the spec */\n    /* but used by the FreeType engine            */\n\n    FT_Byte*   string;\n\n  } TT_NameEntryRec, *TT_NameEntry;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameTableRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType name table.                      */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format         :: The format of the name table.                    */\n  /*                                                                       */\n  /*    numNameRecords :: The number of names in table.                    */\n  /*                                                                       */\n  /*    storageOffset  :: The offset of the name table in the `name'       */\n  /*                      TrueType table.                                  */\n  /*                                                                       */\n  /*    names          :: An array of name records.                        */\n  /*                                                                       */\n  /*    stream         :: the file's input stream.                         */\n  /*                                                                       */\n  typedef struct  TT_NameTableRec_\n  {\n    FT_UShort         format;\n    FT_UInt           numNameRecords;\n    FT_UInt           storageOffset;\n    TT_NameEntryRec*  names;\n    FT_Stream         stream;\n\n  } TT_NameTableRec, *TT_NameTable;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRangeRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A tiny structure used to model a gasp range according to the       */\n  /*    TrueType specification.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    maxPPEM  :: The maximum ppem value to which `gaspFlag' applies.    */\n  /*                                                                       */\n  /*    gaspFlag :: A flag describing the grid-fitting and anti-aliasing   */\n  /*                modes to be used.                                      */\n  /*                                                                       */\n  typedef struct  TT_GaspRangeRec_\n  {\n    FT_UShort  maxPPEM;\n    FT_UShort  gaspFlag;\n\n  } TT_GaspRangeRec, *TT_GaspRange;\n\n\n#define TT_GASP_GRIDFIT  0x01\n#define TT_GASP_DOGRAY   0x02\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType `gasp' table used to specify     */\n  /*    grid-fitting and anti-aliasing behaviour.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version    :: The version number.                                  */\n  /*                                                                       */\n  /*    numRanges  :: The number of gasp ranges in table.                  */\n  /*                                                                       */\n  /*    gaspRanges :: An array of gasp ranges.                             */\n  /*                                                                       */\n  typedef struct  TT_Gasp_\n  {\n    FT_UShort     version;\n    FT_UShort     numRanges;\n    TT_GaspRange  gaspRanges;\n\n  } TT_GaspRec;\n\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HdmxEntryRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A small structure used to model the pre-computed widths of a given */\n  /*    size.  They are found in the `hdmx' table.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    ppem      :: The pixels per EM value at which these metrics apply. */\n  /*                                                                       */\n  /*    max_width :: The maximum advance width for this metric.            */\n  /*                                                                       */\n  /*    widths    :: An array of widths.  Note: These are 8-bit bytes.     */\n  /*                                                                       */\n  typedef struct  TT_HdmxEntryRec_\n  {\n    FT_Byte   ppem;\n    FT_Byte   max_width;\n    FT_Byte*  widths;\n\n  } TT_HdmxEntryRec, *TT_HdmxEntry;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HdmxRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the `hdmx' table, which contains         */\n  /*    pre-computed widths for a set of given sizes/dimensions.           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version     :: The version number.                                 */\n  /*                                                                       */\n  /*    num_records :: The number of hdmx records.                         */\n  /*                                                                       */\n  /*    records     :: An array of hdmx records.                           */\n  /*                                                                       */\n  typedef struct  TT_HdmxRec_\n  {\n    FT_UShort     version;\n    FT_Short      num_records;\n    TT_HdmxEntry  records;\n\n  } TT_HdmxRec, *TT_Hdmx;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Kern0_PairRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a kerning pair for the kerning table     */\n  /*    format 0.  The engine now loads this table if it finds one in the  */\n  /*    font file.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    left  :: The index of the left glyph in pair.                      */\n  /*                                                                       */\n  /*    right :: The index of the right glyph in pair.                     */\n  /*                                                                       */\n  /*    value :: The kerning distance.  A positive value spaces the        */\n  /*             glyphs, a negative one makes them closer.                 */\n  /*                                                                       */\n  typedef struct  TT_Kern0_PairRec_\n  {\n    FT_UShort  left;   /* index of left  glyph in pair */\n    FT_UShort  right;  /* index of right glyph in pair */\n    FT_FWord   value;  /* kerning value                */\n\n  } TT_Kern0_PairRec, *TT_Kern0_Pair;\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    EMBEDDED BITMAPS SUPPORT                       ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_MetricsRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the big metrics of a given glyph bitmap   */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or `bloc' (Apple) table.                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height       :: The glyph height in pixels.                        */\n  /*                                                                       */\n  /*    width        :: The glyph width in pixels.                         */\n  /*                                                                       */\n  /*    horiBearingX :: The horizontal left bearing.                       */\n  /*                                                                       */\n  /*    horiBearingY :: The horizontal top bearing.                        */\n  /*                                                                       */\n  /*    horiAdvance  :: The horizontal advance.                            */\n  /*                                                                       */\n  /*    vertBearingX :: The vertical left bearing.                         */\n  /*                                                                       */\n  /*    vertBearingY :: The vertical top bearing.                          */\n  /*                                                                       */\n  /*    vertAdvance  :: The vertical advance.                              */\n  /*                                                                       */\n  typedef struct  TT_SBit_MetricsRec_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  horiBearingX;\n    FT_Char  horiBearingY;\n    FT_Byte  horiAdvance;\n\n    FT_Char  vertBearingX;\n    FT_Char  vertBearingY;\n    FT_Byte  vertAdvance;\n\n  } TT_SBit_MetricsRec, *TT_SBit_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_SmallMetricsRec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the small metrics of a given glyph bitmap */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or the `bdat' (Apple) table.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height   :: The glyph height in pixels.                            */\n  /*                                                                       */\n  /*    width    :: The glyph width in pixels.                             */\n  /*                                                                       */\n  /*    bearingX :: The left-side bearing.                                 */\n  /*                                                                       */\n  /*    bearingY :: The top-side bearing.                                  */\n  /*                                                                       */\n  /*    advance  :: The advance width or height.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_Small_Metrics_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  bearingX;\n    FT_Char  bearingY;\n    FT_Byte  advance;\n\n  } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_LineMetricsRec                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe the text line metrics of a given      */\n  /*    bitmap strike, for either a horizontal or vertical layout.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    ascender                :: The ascender in pixels.                 */\n  /*                                                                       */\n  /*    descender               :: The descender in pixels.                */\n  /*                                                                       */\n  /*    max_width               :: The maximum glyph width in pixels.      */\n  /*                                                                       */\n  /*    caret_slope_enumerator  :: Rise of the caret slope, typically set  */\n  /*                               to 1 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_slope_denominator :: Rise of the caret slope, typically set  */\n  /*                               to 0 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_offset            :: Offset in pixels to move the caret for  */\n  /*                               proper positioning.                     */\n  /*                                                                       */\n  /*    min_origin_SB           :: Minimum of horiBearingX (resp.          */\n  /*                               vertBearingY).                          */\n  /*    min_advance_SB          :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horizontal advance -                  */\n  /*                                   ( horiBearingX + width )            */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertical advance -                    */\n  /*                                   ( vertBearingY + height )           */\n  /*                                                                       */\n  /*    max_before_BL           :: Maximum of horiBearingY (resp.          */\n  /*                               vertBearingY).                          */\n  /*                                                                       */\n  /*    min_after_BL            :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horiBearingY - height                 */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertBearingX - width                  */\n  /*                                                                       */\n  /*    pads                    :: Unused (to make the size of the record  */\n  /*                               a multiple of 32 bits.                  */\n  /*                                                                       */\n  typedef struct  TT_SBit_LineMetricsRec_\n  {\n    FT_Char  ascender;\n    FT_Char  descender;\n    FT_Byte  max_width;\n    FT_Char  caret_slope_numerator;\n    FT_Char  caret_slope_denominator;\n    FT_Char  caret_offset;\n    FT_Char  min_origin_SB;\n    FT_Char  min_advance_SB;\n    FT_Char  max_before_BL;\n    FT_Char  min_after_BL;\n    FT_Char  pads[2];\n\n  } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_RangeRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A TrueType/OpenType subIndexTable as defined in the `EBLC'         */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    first_glyph   :: The first glyph index in the range.               */\n  /*                                                                       */\n  /*    last_glyph    :: The last glyph index in the range.                */\n  /*                                                                       */\n  /*    index_format  :: The format of index table.  Valid values are 1    */\n  /*                     to 5.                                             */\n  /*                                                                       */\n  /*    image_format  :: The format of `EBDT' image data.                  */\n  /*                                                                       */\n  /*    image_offset  :: The offset to image data in `EBDT'.               */\n  /*                                                                       */\n  /*    image_size    :: For index formats 2 and 5.  This is the size in   */\n  /*                     bytes of each glyph bitmap.                       */\n  /*                                                                       */\n  /*    big_metrics   :: For index formats 2 and 5.  This is the big       */\n  /*                     metrics for each glyph bitmap.                    */\n  /*                                                                       */\n  /*    num_glyphs    :: For index formats 4 and 5.  This is the number of */\n  /*                     glyphs in the code array.                         */\n  /*                                                                       */\n  /*    glyph_offsets :: For index formats 1 and 3.                        */\n  /*                                                                       */\n  /*    glyph_codes   :: For index formats 4 and 5.                        */\n  /*                                                                       */\n  /*    table_offset  :: The offset of the index table in the `EBLC'       */\n  /*                     table.  Only used during strike loading.          */\n  /*                                                                       */\n  typedef struct  TT_SBit_RangeRec_\n  {\n    FT_UShort           first_glyph;\n    FT_UShort           last_glyph;\n\n    FT_UShort           index_format;\n    FT_UShort           image_format;\n    FT_ULong            image_offset;\n\n    FT_ULong            image_size;\n    TT_SBit_MetricsRec  metrics;\n    FT_ULong            num_glyphs;\n\n    FT_ULong*           glyph_offsets;\n    FT_UShort*          glyph_codes;\n\n    FT_ULong            table_offset;\n\n  } TT_SBit_RangeRec, *TT_SBit_Range;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_StrikeRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap strike in the `EBLC'      */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*   num_index_ranges :: The number of index ranges.                     */\n  /*                                                                       */\n  /*   index_ranges     :: An array of glyph index ranges.                 */\n  /*                                                                       */\n  /*   color_ref        :: Unused.  `color_ref' is put in for future       */\n  /*                       enhancements, but these fields are already      */\n  /*                       in use by other platforms (e.g. Newton).        */\n  /*                       For details, please see                         */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  /*   hori             :: The line metrics for horizontal layouts.        */\n  /*                                                                       */\n  /*   vert             :: The line metrics for vertical layouts.          */\n  /*                                                                       */\n  /*   start_glyph      :: The lowest glyph index for this strike.         */\n  /*                                                                       */\n  /*   end_glyph        :: The highest glyph index for this strike.        */\n  /*                                                                       */\n  /*   x_ppem           :: The number of horizontal pixels per EM.         */\n  /*                                                                       */\n  /*   y_ppem           :: The number of vertical pixels per EM.           */\n  /*                                                                       */\n  /*   bit_depth        :: The bit depth.  Valid values are 1, 2, 4,       */\n  /*                       and 8.                                          */\n  /*                                                                       */\n  /*   flags            :: Is this a vertical or horizontal strike?  For   */\n  /*                       details, please see                             */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  typedef struct  TT_SBit_StrikeRec_\n  {\n    FT_Int                  num_ranges;\n    TT_SBit_Range           sbit_ranges;\n    FT_ULong                ranges_offset;\n\n    FT_ULong                color_ref;\n\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_UShort               start_glyph;\n    FT_UShort               end_glyph;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 bit_depth;\n    FT_Char                 flags;\n\n  } TT_SBit_StrikeRec, *TT_SBit_Strike;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ComponentRec                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure to describe a compound sbit element.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_code :: The element's glyph index.                           */\n  /*                                                                       */\n  /*    x_offset   :: The element's left bearing.                          */\n  /*                                                                       */\n  /*    y_offset   :: The element's top bearing.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_ComponentRec_\n  {\n    FT_UShort  glyph_code;\n    FT_Char    x_offset;\n    FT_Char    y_offset;\n\n  } TT_SBit_ComponentRec, *TT_SBit_Component;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ScaleRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap scaling table, as defined */\n  /*    in the `EBSC' table.                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    hori              :: The horizontal line metrics.                  */\n  /*                                                                       */\n  /*    vert              :: The vertical line metrics.                    */\n  /*                                                                       */\n  /*    x_ppem            :: The number of horizontal pixels per EM.       */\n  /*                                                                       */\n  /*    y_ppem            :: The number of vertical pixels per EM.         */\n  /*                                                                       */\n  /*    x_ppem_substitute :: Substitution x_ppem value.                    */\n  /*                                                                       */\n  /*    y_ppem_substitute :: Substitution y_ppem value.                    */\n  /*                                                                       */\n  typedef struct  TT_SBit_ScaleRec_\n  {\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 x_ppem_substitute;\n    FT_Byte                 y_ppem_substitute;\n\n  } TT_SBit_ScaleRec, *TT_SBit_Scale;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  POSTSCRIPT GLYPH NAMES SUPPORT                   ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_20Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.0.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs    :: The number of named glyphs in the table.          */\n  /*                                                                       */\n  /*    num_names     :: The number of PS names stored in the table.       */\n  /*                                                                       */\n  /*    glyph_indices :: The indices of the glyphs in the names arrays.    */\n  /*                                                                       */\n  /*    glyph_names   :: The PS names not in Mac Encoding.                 */\n  /*                                                                       */\n  typedef struct  TT_Post_20Rec_\n  {\n    FT_UShort   num_glyphs;\n    FT_UShort   num_names;\n    FT_UShort*  glyph_indices;\n    FT_Char**   glyph_names;\n\n  } TT_Post_20Rec, *TT_Post_20;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_25Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.5.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs :: The number of glyphs in the table.                   */\n  /*                                                                       */\n  /*    offsets    :: An array of signed offsets in a normal Mac           */\n  /*                  Postscript name encoding.                            */\n  /*                                                                       */\n  typedef struct  TT_Post_25_\n  {\n    FT_UShort  num_glyphs;\n    FT_Char*   offsets;\n\n  } TT_Post_25Rec, *TT_Post_25;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_NamesRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names table, either format 2.0 or 2.5.                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loaded    :: A flag to indicate whether the PS names are loaded.   */\n  /*                                                                       */\n  /*    format_20 :: The sub-table used for format 2.0.                    */\n  /*                                                                       */\n  /*    format_25 :: The sub-table used for format 2.5.                    */\n  /*                                                                       */\n  typedef struct  TT_Post_NamesRec_\n  {\n    FT_Bool  loaded;\n\n    union\n    {\n      TT_Post_20Rec  format_20;\n      TT_Post_25Rec  format_25;\n\n    } names;\n\n  } TT_Post_NamesRec, *TT_Post_Names;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    GX VARIATION TABLE SUPPORT                     ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n  typedef struct GX_BlendRec_  *GX_Blend;\n#endif\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              EMBEDDED BDF PROPERTIES TABLE SUPPORT                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   * These types are used to support a `BDF ' table that isn't part of the\n   * official TrueType specification.  It is mainly used in SFNT-based\n   * bitmap fonts that were generated from a set of BDF fonts.\n   *\n   * The format of the table is as follows.\n   *\n   *   USHORT   version      `BDF ' table version number, should be 0x0001.\n   *   USHORT   strikeCount  Number of strikes (bitmap sizes) in this table.\n   *   ULONG    stringTable  Offset (from start of BDF table) to string\n   *                         table.\n   *\n   * This is followed by an array of `strikeCount' descriptors, having the\n   * following format.\n   *\n   *   USHORT   ppem         Vertical pixels per EM for this strike.\n   *   USHORT   numItems     Number of items for this strike (properties and\n   *                         atoms).  Maximum is 255.\n   *\n   * This array in turn is followed by `strikeCount' value sets.  Each\n   * `value set' is an array of `numItems' items with the following format.\n   *\n   *   ULONG    item_name    Offset in string table to item name.\n   *   USHORT   item_type    The item type.  Possible values are\n   *                            0 => string (e.g., COMMENT)\n   *                            1 => atom   (e.g., FONT or even SIZE)\n   *                            2 => int32\n   *                            3 => uint32\n   *                         0x10 => A flag to indicate a properties.  This\n   *                                 is ORed with the above values.\n   *   ULONG    item_value   For strings  => Offset into string table without\n   *                                         the corresponding double quotes.\n   *                         For atoms    => Offset into string table.\n   *                         For integers => Direct value.\n   *\n   * All strings in the string table consist of bytes and are\n   * zero-terminated.\n   *\n   */\n\n#ifdef TT_CONFIG_OPTION_BDF\n\n  typedef struct  TT_BDFRec_\n  {\n    FT_Byte*   table;\n    FT_Byte*   table_end;\n    FT_Byte*   strings;\n    FT_ULong   strings_size;\n    FT_UInt    num_strikes;\n    FT_Bool    loaded;\n\n  } TT_BDFRec, *TT_BDF;\n\n#endif /* TT_CONFIG_OPTION_BDF */\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  ORIGINAL TT_FACE CLASS DEFINITION                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This structure/class is defined here because it is common to the      */\n  /* following formats: TTF, OpenType-TT, and OpenType-CFF.                */\n  /*                                                                       */\n  /* Note, however, that the classes TT_Size and TT_GlyphSlot are not      */\n  /* shared between font drivers, and are thus defined in `ttobjs.h'.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType face/font object.  A TT_Face encapsulates   */\n  /*    the resolution and scaling independent parts of a TrueType font    */\n  /*    resource.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The TT_Face structure is also used as a `parent class' for the     */\n  /*    OpenType-CFF class (T2_Face).                                      */\n  /*                                                                       */\n  typedef struct TT_FaceRec_*  TT_Face;\n\n\n  /* a function type used for the truetype bytecode interpreter hooks */\n  typedef FT_Error\n  (*TT_Interpreter)( void*  exec_context );\n\n  /* forward declaration */\n  typedef struct TT_LoaderRec_*  TT_Loader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_GotoTableFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given TrueType table.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    tag    :: A 4-byte tag used to name the table.                     */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    length :: The length of the table in bytes.  Set to 0 if not       */\n  /*              needed.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_GotoTableFunc)( TT_Face    face,\n                              FT_ULong   tag,\n                              FT_Stream  stream,\n                              FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_StartGlyphFunc                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given glyph element, and opens a  */\n  /*    frame for it.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader      :: The current TrueType glyph loader object.           */\n  /*                                                                       */\n  /*    glyph index :: The index of the glyph to access.                   */\n  /*                                                                       */\n  /*    offset      :: The offset of the glyph according to the            */\n  /*                   `locations' table.                                  */\n  /*                                                                       */\n  /*    byte_count  :: The size of the frame in bytes.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is normally equivalent to FT_STREAM_SEEK(offset)     */\n  /*    followed by FT_FRAME_ENTER(byte_count) with the loader's stream,   */\n  /*    but alternative formats (e.g. compressed ones) might use something */\n  /*    different.                                                         */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_StartGlyphFunc)( TT_Loader  loader,\n                               FT_UInt    glyph_index,\n                               FT_ULong   offset,\n                               FT_UInt    byte_count );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_ReadGlyphFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reads one glyph element (its header, a simple glyph, or a          */\n  /*    composite) from the loader's current stream frame.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_ReadGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_EndGlyphFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Closes the current loader stream frame for the glyph.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  typedef void\n  (*TT_Loader_EndGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         TrueType Face Type                            */\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType face class.  These objects model the resolution and   */\n  /*    point-size independent data found in a TrueType font file.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root                 :: The base FT_Face structure, managed by the */\n  /*                            base layer.                                */\n  /*                                                                       */\n  /*    ttc_header           :: The TrueType collection header, used when  */\n  /*                            the file is a `ttc' rather than a `ttf'.   */\n  /*                            For ordinary font files, the field         */\n  /*                            `ttc_header.count' is set to 0.            */\n  /*                                                                       */\n  /*    format_tag           :: The font format tag.                       */\n  /*                                                                       */\n  /*    num_tables           :: The number of TrueType tables in this font */\n  /*                            file.                                      */\n  /*                                                                       */\n  /*    dir_tables           :: The directory of TrueType tables for this  */\n  /*                            font file.                                 */\n  /*                                                                       */\n  /*    header               :: The font's font header (`head' table).     */\n  /*                            Read on font opening.                      */\n  /*                                                                       */\n  /*    horizontal           :: The font's horizontal header (`hhea'       */\n  /*                            table).  This field also contains the      */\n  /*                            associated horizontal metrics table        */\n  /*                            (`hmtx').                                  */\n  /*                                                                       */\n  /*    max_profile          :: The font's maximum profile table.  Read on */\n  /*                            font opening.  Note that some maximum      */\n  /*                            values cannot be taken directly from this  */\n  /*                            table.  We thus define additional fields   */\n  /*                            below to hold the computed maxima.         */\n  /*                                                                       */\n  /*    vertical_info        :: A boolean which is set when the font file  */\n  /*                            contains vertical metrics.  If not, the    */\n  /*                            value of the `vertical' field is           */\n  /*                            undefined.                                 */\n  /*                                                                       */\n  /*    vertical             :: The font's vertical header (`vhea' table). */\n  /*                            This field also contains the associated    */\n  /*                            vertical metrics table (`vmtx'), if found. */\n  /*                            IMPORTANT: The contents of this field is   */\n  /*                            undefined if the `verticalInfo' field is   */\n  /*                            unset.                                     */\n  /*                                                                       */\n  /*    num_names            :: The number of name records within this     */\n  /*                            TrueType font.                             */\n  /*                                                                       */\n  /*    name_table           :: The table of name records (`name').        */\n  /*                                                                       */\n  /*    os2                  :: The font's OS/2 table (`OS/2').            */\n  /*                                                                       */\n  /*    postscript           :: The font's PostScript table (`post'        */\n  /*                            table).  The PostScript glyph names are    */\n  /*                            not loaded by the driver on face opening.  */\n  /*                            See the `ttpost' module for more details.  */\n  /*                                                                       */\n  /*    cmap_table           :: Address of the face's `cmap' SFNT table    */\n  /*                            in memory (it's an extracted frame).       */\n  /*                                                                       */\n  /*    cmap_size            :: The size in bytes of the `cmap_table'      */\n  /*                            described above.                           */\n  /*                                                                       */\n  /*    goto_table           :: A function called by each TrueType table   */\n  /*                            loader to position a stream's cursor to    */\n  /*                            the start of a given table according to    */\n  /*                            its tag.  It defaults to TT_Goto_Face but  */\n  /*                            can be different for strange formats (e.g. */\n  /*                            Type 42).                                  */\n  /*                                                                       */\n  /*    access_glyph_frame   :: A function used to access the frame of a   */\n  /*                            given glyph within the face's font file.   */\n  /*                                                                       */\n  /*    forget_glyph_frame   :: A function used to forget the frame of a   */\n  /*                            given glyph when all data has been loaded. */\n  /*                                                                       */\n  /*    read_glyph_header    :: A function used to read a glyph header.    */\n  /*                            It must be called between an `access' and  */\n  /*                            `forget'.                                  */\n  /*                                                                       */\n  /*    read_simple_glyph    :: A function used to read a simple glyph.    */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    read_composite_glyph :: A function used to read a composite glyph. */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    sfnt                 :: A pointer to the SFNT service.             */\n  /*                                                                       */\n  /*    psnames              :: A pointer to the PostScript names service. */\n  /*                                                                       */\n  /*    hdmx                 :: The face's horizontal device metrics       */\n  /*                            (`hdmx' table).  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    gasp                 :: The grid-fitting and scaling properties    */\n  /*                            table (`gasp').  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    pclt                 :: The `pclt' SFNT table.                     */\n  /*                                                                       */\n  /*    num_sbit_strikes     :: The number of sbit strikes, i.e., bitmap   */\n  /*                            sizes, embedded in this font.              */\n  /*                                                                       */\n  /*    sbit_strikes         :: An array of sbit strikes embedded in this  */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    num_sbit_scales      :: The number of sbit scales for this font.   */\n  /*                                                                       */\n  /*    sbit_scales          :: Array of sbit scales embedded in this      */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    postscript_names     :: A table used to store the Postscript names */\n  /*                            of  the glyphs for this font.  See the     */\n  /*                            file  `ttconfig.h' for comments on the     */\n  /*                            TT_CONFIG_OPTION_POSTSCRIPT_NAMES option.  */\n  /*                                                                       */\n  /*    num_locations        :: The number of glyph locations in this      */\n  /*                            TrueType file.  This should be             */\n  /*                            identical to the number of glyphs.         */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    glyph_locations      :: An array of longs.  These are offsets to   */\n  /*                            glyph data within the `glyf' table.        */\n  /*                            Ignored for Type 2 font faces.             */\n  /*                                                                       */\n  /*    glyf_len             :: The length of the `glyf' table.  Needed    */\n  /*                            for malformed `loca' tables.               */\n  /*                                                                       */\n  /*    font_program_size    :: Size in bytecodes of the face's font       */\n  /*                            program.  0 if none defined.  Ignored for  */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    font_program         :: The face's font program (bytecode stream)  */\n  /*                            executed at load time, also used during    */\n  /*                            glyph rendering.  Comes from the `fpgm'    */\n  /*                            table.  Ignored for Type 2 font fonts.     */\n  /*                                                                       */\n  /*    cvt_program_size     :: The size in bytecodes of the face's cvt    */\n  /*                            program.  Ignored for Type 2 fonts.        */\n  /*                                                                       */\n  /*    cvt_program          :: The face's cvt program (bytecode stream)   */\n  /*                            executed each time an instance/size is     */\n  /*                            changed/reset.  Comes from the `prep'      */\n  /*                            table.  Ignored for Type 2 fonts.          */\n  /*                                                                       */\n  /*    cvt_size             :: Size of the control value table (in        */\n  /*                            entries).   Ignored for Type 2 fonts.      */\n  /*                                                                       */\n  /*    cvt                  :: The face's original control value table.   */\n  /*                            Coordinates are expressed in unscaled font */\n  /*                            units.  Comes from the `cvt ' table.       */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    num_kern_pairs       :: The number of kerning pairs present in the */\n  /*                            font file.  The engine only loads the      */\n  /*                            first horizontal format 0 kern table it    */\n  /*                            finds in the font file.  Ignored for       */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    kern_table_index     :: The index of the kerning table in the font */\n  /*                            kerning directory.  Ignored for Type 2     */\n  /*                            fonts.                                     */\n  /*                                                                       */\n  /*    interpreter          :: A pointer to the TrueType bytecode         */\n  /*                            interpreters field is also used to hook    */\n  /*                            the debugger in `ttdebug'.                 */\n  /*                                                                       */\n  /*    unpatented_hinting   :: If true, use only unpatented methods in    */\n  /*                            the bytecode interpreter.                  */\n  /*                                                                       */\n  /*    doblend              :: A boolean which is set if the font should  */\n  /*                            be blended (this is for GX var).           */\n  /*                                                                       */\n  /*    blend                :: Contains the data needed to control GX     */\n  /*                            variation tables (rather like Multiple     */\n  /*                            Master data).                              */\n  /*                                                                       */\n  /*    extra                :: Reserved for third-party font drivers.     */\n  /*                                                                       */\n  /*    postscript_name      :: The PS name of the font.  Used by the      */\n  /*                            postscript name service.                   */\n  /*                                                                       */\n  typedef struct  TT_FaceRec_\n  {\n    FT_FaceRec            root;\n\n    TTC_HeaderRec         ttc_header;\n\n    FT_ULong              format_tag;\n    FT_UShort             num_tables;\n    TT_Table              dir_tables;\n\n    TT_Header             header;       /* TrueType header table          */\n    TT_HoriHeader         horizontal;   /* TrueType horizontal header     */\n\n    TT_MaxProfile         max_profile;\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    FT_ULong              max_components;  /* stubbed to 0 */\n#endif\n\n    FT_Bool               vertical_info;\n    TT_VertHeader         vertical;     /* TT Vertical header, if present */\n\n    FT_UShort             num_names;    /* number of name records  */\n    TT_NameTableRec       name_table;   /* name table              */\n\n    TT_OS2                os2;          /* TrueType OS/2 table            */\n    TT_Postscript         postscript;   /* TrueType Postscript table      */\n\n    FT_Byte*              cmap_table;   /* extracted `cmap' table */\n    FT_ULong              cmap_size;\n\n    TT_Loader_GotoTableFunc   goto_table;\n\n    TT_Loader_StartGlyphFunc  access_glyph_frame;\n    TT_Loader_EndGlyphFunc    forget_glyph_frame;\n    TT_Loader_ReadGlyphFunc   read_glyph_header;\n    TT_Loader_ReadGlyphFunc   read_simple_glyph;\n    TT_Loader_ReadGlyphFunc   read_composite_glyph;\n\n    /* a typeless pointer to the SFNT_Interface table used to load */\n    /* the basic TrueType tables in the face object                */\n    void*                 sfnt;\n\n    /* a typeless pointer to the FT_Service_PsCMapsRec table used to */\n    /* handle glyph names <-> unicode & Mac values                   */\n    void*                 psnames;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Optional TrueType/OpenType tables                                   */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* horizontal device metrics */\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    TT_HdmxRec            hdmx;\n#endif\n\n    /* grid-fitting and scaling table */\n    TT_GaspRec            gasp;                 /* the `gasp' table */\n\n    /* PCL 5 table */\n    TT_PCLT               pclt;\n\n    /* embedded bitmaps support */\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    FT_ULong              num_sbit_strikes;\n    TT_SBit_Strike        sbit_strikes;\n#endif\n\n    FT_ULong              num_sbit_scales;\n    TT_SBit_Scale         sbit_scales;\n\n    /* postscript names table */\n    TT_Post_NamesRec      postscript_names;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* TrueType-specific fields (ignored by the OTF-Type2 driver)          */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* the glyph locations */\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    FT_UShort             num_locations_stub;\n    FT_Long*              glyph_locations_stub;\n#endif\n\n    /* the font program, if any */\n    FT_ULong              font_program_size;\n    FT_Byte*              font_program;\n\n    /* the cvt program, if any */\n    FT_ULong              cvt_program_size;\n    FT_Byte*              cvt_program;\n\n    /* the original, unscaled, control value table */\n    FT_ULong              cvt_size;\n    FT_Short*             cvt;\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n    /* the format 0 kerning table, if any */\n    FT_Int                num_kern_pairs;\n    FT_Int                kern_table_index;\n    TT_Kern0_Pair         kern_pairs;\n#endif\n\n    /* A pointer to the bytecode interpreter to use.  This is also */\n    /* used to hook the debugger for the `ttdebug' utility.        */\n    TT_Interpreter        interpreter;\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    /* Use unpatented hinting only. */\n    FT_Bool               unpatented_hinting;\n#endif\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Other tables or fields. This is used by derivative formats like     */\n    /* OpenType.                                                           */\n    /*                                                                     */\n    /***********************************************************************/\n\n    FT_Generic            extra;\n\n    const char*           postscript_name;\n\n    /* since version 2.1.8, but was originally placed after */\n    /* `glyph_locations_stub'                               */\n    FT_ULong              glyf_len;\n\n    /* since version 2.1.8, but was originally placed before `extra' */\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Bool               doblend;\n    GX_Blend              blend;\n#endif\n\n    /* since version 2.2 */\n\n    FT_Byte*              horz_metrics;\n    FT_ULong              horz_metrics_size;\n\n    FT_Byte*              vert_metrics;\n    FT_ULong              vert_metrics_size;\n\n    FT_ULong              num_locations; /* in broken TTF, gid > 0xFFFF */ \n    FT_Byte*              glyph_locations;\n\n    FT_Byte*              hdmx_table;\n    FT_ULong              hdmx_table_size;\n    FT_UInt               hdmx_record_count;\n    FT_ULong              hdmx_record_size;\n    FT_Byte*              hdmx_record_sizes;\n\n    FT_Byte*              sbit_table;\n    FT_ULong              sbit_table_size;\n    FT_UInt               sbit_num_strikes;\n\n    FT_Byte*              kern_table;\n    FT_ULong              kern_table_size;\n    FT_UInt               num_kern_tables;\n    FT_UInt32             kern_avail_bits;\n    FT_UInt32             kern_order_bits;\n\n#ifdef TT_CONFIG_OPTION_BDF\n    TT_BDFRec             bdf;\n#endif /* TT_CONFIG_OPTION_BDF */\n\n    /* since 2.3.0 */\n    FT_ULong              horz_metrics_offset;\n    FT_ULong              vert_metrics_offset;\n\n  } TT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  <Struct>                                                             */\n  /*     TT_GlyphZoneRec                                                   */\n  /*                                                                       */\n  /*  <Description>                                                        */\n  /*     A glyph zone is used to load, scale and hint glyph outline        */\n  /*     coordinates.                                                      */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     memory       :: A handle to the memory manager.                   */\n  /*                                                                       */\n  /*     max_points   :: The maximal size in points of the zone.           */\n  /*                                                                       */\n  /*     max_contours :: Max size in links contours of the zone.           */\n  /*                                                                       */\n  /*     n_points     :: The current number of points in the zone.         */\n  /*                                                                       */\n  /*     n_contours   :: The current number of contours in the zone.       */\n  /*                                                                       */\n  /*     org          :: The original glyph coordinates (font              */\n  /*                     units/scaled).                                    */\n  /*                                                                       */\n  /*     cur          :: The current glyph coordinates (scaled/hinted).    */\n  /*                                                                       */\n  /*     tags         :: The point control tags.                           */\n  /*                                                                       */\n  /*     contours     :: The contours end points.                          */\n  /*                                                                       */\n  /*     first_point  :: Offset of the current subglyph's first point.     */\n  /*                                                                       */\n  typedef struct  TT_GlyphZoneRec_\n  {\n    FT_Memory   memory;\n    FT_UShort   max_points;\n    FT_UShort   max_contours;\n    FT_UShort   n_points;    /* number of points in zone    */\n    FT_Short    n_contours;  /* number of contours          */\n\n    FT_Vector*  org;         /* original point coordinates  */\n    FT_Vector*  cur;         /* current point coordinates   */\n    FT_Vector*  orus;        /* original (unscaled) point coordinates */\n\n    FT_Byte*    tags;        /* current touch flags         */\n    FT_UShort*  contours;    /* contour end points          */\n\n    FT_UShort   first_point; /* offset of first (#0) point  */\n\n  } TT_GlyphZoneRec, *TT_GlyphZone;\n\n\n  /* handle to execution context */\n  typedef struct TT_ExecContextRec_*  TT_ExecContext;\n\n  /* glyph loader structure */\n  typedef struct  TT_LoaderRec_\n  {\n    FT_Face          face;\n    FT_Size          size;\n    FT_GlyphSlot     glyph;\n    FT_GlyphLoader   gloader;\n\n    FT_ULong         load_flags;\n    FT_UInt          glyph_index;\n\n    FT_Stream        stream;\n    FT_Int           byte_len;\n\n    FT_Short         n_contours;\n    FT_BBox          bbox;\n    FT_Int           left_bearing;\n    FT_Int           advance;\n    FT_Int           linear;\n    FT_Bool          linear_def;\n    FT_Bool          preserve_pps;\n    FT_Vector        pp1;\n    FT_Vector        pp2;\n\n    FT_ULong         glyf_offset;\n\n    /* the zone where we load our glyphs */\n    TT_GlyphZoneRec  base;\n    TT_GlyphZoneRec  zone;\n\n    TT_ExecContext   exec;\n    FT_Byte*         instructions;\n    FT_ULong         ins_pos;\n\n    /* for possible extensibility in other formats */\n    void*            other;\n\n    /* since version 2.1.8 */\n    FT_Int           top_bearing;\n    FT_Int           vadvance;\n    FT_Vector        pp3;\n    FT_Vector        pp4;\n\n    /* since version 2.2.1 */\n    FT_Byte*         cursor;\n    FT_Byte*         limit;\n\n  } TT_LoaderRec;\n\n\nFT_END_HEADER\n\n#endif /* __TTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/t1tables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tables.h                                                             */\n/*                                                                         */\n/*    Basic Type 1/Type 2 tables definitions and interface (specification  */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TABLES_H__\n#define __T1TABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    type1_tables                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Type 1 Tables                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Type~1 (PostScript) specific font tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of Type 1-specific tables,    */\n  /*    including structures related to other PostScript font formats.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */\n  /* structures in order to support Multiple Master fonts.               */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfoRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 FontInfo dictionary.  */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    FontInfo dictionary.                                               */\n  /*                                                                       */\n  typedef struct  PS_FontInfoRec_\n  {\n    FT_String*  version;\n    FT_String*  notice;\n    FT_String*  full_name;\n    FT_String*  family_name;\n    FT_String*  weight;\n    FT_Long     italic_angle;\n    FT_Bool     is_fixed_pitch;\n    FT_Short    underline_position;\n    FT_UShort   underline_thickness;\n\n  } PS_FontInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_FontInfoRec structure.                           */\n  /*                                                                       */\n  typedef struct PS_FontInfoRec_*  PS_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef PS_FontInfoRec  T1_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_PrivateRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 private dictionary.   */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    Private dictionary.                                                */\n  /*                                                                       */\n  typedef struct  PS_PrivateRec_\n  {\n    FT_Int     unique_id;\n    FT_Int     lenIV;\n\n    FT_Byte    num_blue_values;\n    FT_Byte    num_other_blues;\n    FT_Byte    num_family_blues;\n    FT_Byte    num_family_other_blues;\n\n    FT_Short   blue_values[14];\n    FT_Short   other_blues[10];\n\n    FT_Short   family_blues      [14];\n    FT_Short   family_other_blues[10];\n\n    FT_Fixed   blue_scale;\n    FT_Int     blue_shift;\n    FT_Int     blue_fuzz;\n\n    FT_UShort  standard_width[1];\n    FT_UShort  standard_height[1];\n\n    FT_Byte    num_snap_widths;\n    FT_Byte    num_snap_heights;\n    FT_Bool    force_bold;\n    FT_Bool    round_stem_up;\n\n    FT_Short   snap_widths [13];  /* including std width  */\n    FT_Short   snap_heights[13];  /* including std height */\n\n    FT_Fixed   expansion_factor;\n\n    FT_Long    language_group;\n    FT_Long    password;\n\n    FT_Short   min_feature[2];\n\n  } PS_PrivateRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_PrivateRec structure.                            */\n  /*                                                                       */\n  typedef struct PS_PrivateRec_*  PS_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef PS_PrivateRec  T1_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_Blend_Flags                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of flags used to indicate which fields are present in a      */\n  /*    given blend dictionary (font info or private).  Used to support    */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  typedef enum  T1_Blend_Flags_\n  {\n    /*# required fields in a FontInfo blend dictionary */\n    T1_BLEND_UNDERLINE_POSITION = 0,\n    T1_BLEND_UNDERLINE_THICKNESS,\n    T1_BLEND_ITALIC_ANGLE,\n\n    /*# required fields in a Private blend dictionary */\n    T1_BLEND_BLUE_VALUES,\n    T1_BLEND_OTHER_BLUES,\n    T1_BLEND_STANDARD_WIDTH,\n    T1_BLEND_STANDARD_HEIGHT,\n    T1_BLEND_STEM_SNAP_WIDTHS,\n    T1_BLEND_STEM_SNAP_HEIGHTS,\n    T1_BLEND_BLUE_SCALE,\n    T1_BLEND_BLUE_SHIFT,\n    T1_BLEND_FAMILY_BLUES,\n    T1_BLEND_FAMILY_OTHER_BLUES,\n    T1_BLEND_FORCE_BOLD,\n\n    /*# never remove */\n    T1_BLEND_MAX\n\n  } T1_Blend_Flags;\n\n  /* */\n\n\n  /*# backwards compatible definitions */\n#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION\n#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS\n#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE\n#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES\n#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES\n#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH\n#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT\n#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS\n#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS\n#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE\n#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT\n#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES\n#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES\n#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD\n#define t1_blend_max                  T1_BLEND_MAX\n\n\n  /* maximum number of Multiple Masters designs, as defined in the spec */\n#define T1_MAX_MM_DESIGNS     16\n\n  /* maximum number of Multiple Masters axes, as defined in the spec */\n#define T1_MAX_MM_AXIS        4\n\n  /* maximum number of elements in a design map */\n#define T1_MAX_MM_MAP_POINTS  20\n\n\n  /* this structure is used to store the BlendDesignMap entry for an axis */\n  typedef struct  PS_DesignMap_\n  {\n    FT_Byte    num_points;\n    FT_Long*   design_points;\n    FT_Fixed*  blend_points;\n\n  } PS_DesignMapRec, *PS_DesignMap;\n\n  /* backwards-compatible definition */\n  typedef PS_DesignMapRec  T1_DesignMap;\n\n\n  typedef struct  PS_BlendRec_\n  {\n    FT_UInt          num_designs;\n    FT_UInt          num_axis;\n\n    FT_String*       axis_names[T1_MAX_MM_AXIS];\n    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];\n    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];\n\n    FT_Fixed*        weight_vector;\n    FT_Fixed*        default_weight_vector;\n\n    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];\n    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];\n\n    FT_ULong         blend_bitflags;\n\n    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];\n\n    /* since 2.3.0 */\n\n    /* undocumented, optional: the default design instance;   */\n    /* corresponds to default_weight_vector --                */\n    /* num_default_design_vector == 0 means it is not present */\n    /* in the font and associated metrics files               */\n    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];\n    FT_UInt          num_default_design_vector;\n\n  } PS_BlendRec, *PS_Blend;\n\n\n  /* backwards-compatible definition */\n  typedef PS_BlendRec  T1_Blend;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDictRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent data in a CID top-level dictionary.  */\n  /*                                                                       */\n  typedef struct  CID_FaceDictRec_\n  {\n    PS_PrivateRec  private_dict;\n\n    FT_UInt        len_buildchar;\n    FT_Fixed       forcebold_threshold;\n    FT_Pos         stroke_width;\n    FT_Fixed       expansion_factor;\n\n    FT_Byte        paint_type;\n    FT_Byte        font_type;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n    FT_UInt        num_subrs;\n    FT_ULong       subrmap_offset;\n    FT_Int         sd_bytes;\n\n  } CID_FaceDictRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDict                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceDictRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceDictRec_*  CID_FaceDict;\n\n  /* */\n\n\n  /* backwards-compatible definition */\n  typedef CID_FaceDictRec  CID_FontDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfoRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent CID Face information.                */\n  /*                                                                       */\n  typedef struct  CID_FaceInfoRec_\n  {\n    FT_String*      cid_font_name;\n    FT_Fixed        cid_version;\n    FT_Int          cid_font_type;\n\n    FT_String*      registry;\n    FT_String*      ordering;\n    FT_Int          supplement;\n\n    PS_FontInfoRec  font_info;\n    FT_BBox         font_bbox;\n    FT_ULong        uid_base;\n\n    FT_Int          num_xuid;\n    FT_ULong        xuid[16];\n\n    FT_ULong        cidmap_offset;\n    FT_Int          fd_bytes;\n    FT_Int          gd_bytes;\n    FT_ULong        cid_count;\n\n    FT_Int          num_dicts;\n    CID_FaceDict    font_dicts;\n\n    FT_ULong        data_offset;\n\n  } CID_FaceInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfo                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceInfoRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceInfoRec_*  CID_FaceInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Info                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef CID_FaceInfoRec  CID_Info;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Has_PS_Glyph_Names\n   *\n   * @description:\n   *    Return true if a given face provides reliable PostScript glyph\n   *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,\n   *    except that certain fonts (mostly TrueType) contain incorrect\n   *    glyph name tables.\n   *\n   *    When this function returns true, the caller is sure that the glyph\n   *    names returned by @FT_Get_Glyph_Name are reliable.\n   *\n   * @input:\n   *    face ::\n   *       face handle\n   *\n   * @return:\n   *    Boolean.  True if glyph names are reliable.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Info\n   *\n   * @description:\n   *    Retrieve the @PS_FontInfoRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_info ::\n   *       Output font info structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the font info structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function will\n   *    return the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face      face,\n                       PS_FontInfo  afont_info );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Private\n   *\n   * @description:\n   *    Retrieve the @PS_PrivateRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_private ::\n   *       Output private dictionary structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the @PS_PrivateRec structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face     face,\n                          PS_Private  afont_private );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __T1TABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ttnameid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttnameid.h                                                             */\n/*                                                                         */\n/*    TrueType name ID definitions (specification only).                   */\n/*                                                                         */\n/*  Copyright 1996-2002, 2003, 2004, 2006, 2007, 2008 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTNAMEID_H__\n#define __TTNAMEID_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values for the `platform' identifier code in the name        */\n  /* records of the TTF `name' table.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_PLATFORM_XXX\n   *\n   * @description:\n   *   A list of valid values for the `platform_id' identifier code in\n   *   @FT_CharMapRec and @FT_SfntName structures.\n   *\n   * @values:\n   *   TT_PLATFORM_APPLE_UNICODE ::\n   *     Used by Apple to indicate a Unicode character map and/or name entry.\n   *     See @TT_APPLE_ID_XXX for corresponding `encoding_id' values.  Note\n   *     that name entries in this format are coded as big-endian UCS-2\n   *     character codes _only_.\n   *\n   *   TT_PLATFORM_MACINTOSH ::\n   *     Used by Apple to indicate a MacOS-specific charmap and/or name entry.\n   *     See @TT_MAC_ID_XXX for corresponding `encoding_id' values.  Note that\n   *     most TrueType fonts contain an Apple roman charmap to be usable on\n   *     MacOS systems (even if they contain a Microsoft charmap as well).\n   *\n   *   TT_PLATFORM_ISO ::\n   *     This value was used to specify ISO/IEC 10646 charmaps.  It is however\n   *     now deprecated.  See @TT_ISO_ID_XXX for a list of corresponding\n   *     `encoding_id' values.\n   *\n   *   TT_PLATFORM_MICROSOFT ::\n   *     Used by Microsoft to indicate Windows-specific charmaps.  See\n   *     @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.\n   *     Note that most fonts contain a Unicode charmap using\n   *     (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).\n   *\n   *   TT_PLATFORM_CUSTOM ::\n   *     Used to indicate application-specific charmaps.\n   *\n   *   TT_PLATFORM_ADOBE ::\n   *     This value isn't part of any font format specification, but is used\n   *     by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec\n   *     structure.  See @TT_ADOBE_ID_XXX.\n   */\n\n#define TT_PLATFORM_APPLE_UNICODE  0\n#define TT_PLATFORM_MACINTOSH      1\n#define TT_PLATFORM_ISO            2 /* deprecated */\n#define TT_PLATFORM_MICROSOFT      3\n#define TT_PLATFORM_CUSTOM         4\n#define TT_PLATFORM_ADOBE          7 /* artificial */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_APPLE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.\n   *\n   * @values:\n   *   TT_APPLE_ID_DEFAULT ::\n   *     Unicode version 1.0.\n   *\n   *   TT_APPLE_ID_UNICODE_1_1 ::\n   *     Unicode 1.1; specifies Hangul characters starting at U+34xx.\n   *\n   *   TT_APPLE_ID_ISO_10646 ::\n   *     Deprecated (identical to preceding).\n   *\n   *   TT_APPLE_ID_UNICODE_2_0 ::\n   *     Unicode 2.0 and beyond (UTF-16 BMP only).\n   *\n   *   TT_APPLE_ID_UNICODE_32 ::\n   *     Unicode 3.1 and beyond, using UTF-32.\n   *\n   *   TT_APPLE_ID_VARIANT_SELECTOR ::\n   *     From Adobe, not Apple.  Not a normal cmap.  Specifies variations\n   *     on a real cmap.\n   */\n\n#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */\n#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */\n#define TT_APPLE_ID_ISO_10646         2 /* deprecated */\n#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */\n#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */\n#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MAC_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MACINTOSH charmaps and name entries.\n   *\n   * @values:\n   *   TT_MAC_ID_ROMAN ::\n   *   TT_MAC_ID_JAPANESE ::\n   *   TT_MAC_ID_TRADITIONAL_CHINESE ::\n   *   TT_MAC_ID_KOREAN ::\n   *   TT_MAC_ID_ARABIC ::\n   *   TT_MAC_ID_HEBREW ::\n   *   TT_MAC_ID_GREEK ::\n   *   TT_MAC_ID_RUSSIAN ::\n   *   TT_MAC_ID_RSYMBOL ::\n   *   TT_MAC_ID_DEVANAGARI ::\n   *   TT_MAC_ID_GURMUKHI ::\n   *   TT_MAC_ID_GUJARATI ::\n   *   TT_MAC_ID_ORIYA ::\n   *   TT_MAC_ID_BENGALI ::\n   *   TT_MAC_ID_TAMIL ::\n   *   TT_MAC_ID_TELUGU ::\n   *   TT_MAC_ID_KANNADA ::\n   *   TT_MAC_ID_MALAYALAM ::\n   *   TT_MAC_ID_SINHALESE ::\n   *   TT_MAC_ID_BURMESE ::\n   *   TT_MAC_ID_KHMER ::\n   *   TT_MAC_ID_THAI ::\n   *   TT_MAC_ID_LAOTIAN ::\n   *   TT_MAC_ID_GEORGIAN ::\n   *   TT_MAC_ID_ARMENIAN ::\n   *   TT_MAC_ID_MALDIVIAN ::\n   *   TT_MAC_ID_SIMPLIFIED_CHINESE ::\n   *   TT_MAC_ID_TIBETAN ::\n   *   TT_MAC_ID_MONGOLIAN ::\n   *   TT_MAC_ID_GEEZ ::\n   *   TT_MAC_ID_SLAVIC ::\n   *   TT_MAC_ID_VIETNAMESE ::\n   *   TT_MAC_ID_SINDHI ::\n   *   TT_MAC_ID_UNINTERP ::\n   */\n\n#define TT_MAC_ID_ROMAN                 0\n#define TT_MAC_ID_JAPANESE              1\n#define TT_MAC_ID_TRADITIONAL_CHINESE   2\n#define TT_MAC_ID_KOREAN                3\n#define TT_MAC_ID_ARABIC                4\n#define TT_MAC_ID_HEBREW                5\n#define TT_MAC_ID_GREEK                 6\n#define TT_MAC_ID_RUSSIAN               7\n#define TT_MAC_ID_RSYMBOL               8\n#define TT_MAC_ID_DEVANAGARI            9\n#define TT_MAC_ID_GURMUKHI             10\n#define TT_MAC_ID_GUJARATI             11\n#define TT_MAC_ID_ORIYA                12\n#define TT_MAC_ID_BENGALI              13\n#define TT_MAC_ID_TAMIL                14\n#define TT_MAC_ID_TELUGU               15\n#define TT_MAC_ID_KANNADA              16\n#define TT_MAC_ID_MALAYALAM            17\n#define TT_MAC_ID_SINHALESE            18\n#define TT_MAC_ID_BURMESE              19\n#define TT_MAC_ID_KHMER                20\n#define TT_MAC_ID_THAI                 21\n#define TT_MAC_ID_LAOTIAN              22\n#define TT_MAC_ID_GEORGIAN             23\n#define TT_MAC_ID_ARMENIAN             24\n#define TT_MAC_ID_MALDIVIAN            25\n#define TT_MAC_ID_SIMPLIFIED_CHINESE   25\n#define TT_MAC_ID_TIBETAN              26\n#define TT_MAC_ID_MONGOLIAN            27\n#define TT_MAC_ID_GEEZ                 28\n#define TT_MAC_ID_SLAVIC               29\n#define TT_MAC_ID_VIETNAMESE           30\n#define TT_MAC_ID_SINDHI               31\n#define TT_MAC_ID_UNINTERP             32\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ISO_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ISO charmaps and name entries.\n   *\n   *   Their use is now deprecated.\n   *\n   * @values:\n   *   TT_ISO_ID_7BIT_ASCII ::\n   *     ASCII.\n   *   TT_ISO_ID_10646 ::\n   *     ISO/10646.\n   *   TT_ISO_ID_8859_1 ::\n   *     Also known as Latin-1.\n   */\n\n#define TT_ISO_ID_7BIT_ASCII  0\n#define TT_ISO_ID_10646       1\n#define TT_ISO_ID_8859_1      2\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MS_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MICROSOFT charmaps and name entries.\n   *\n   * @values:\n   *   TT_MS_ID_SYMBOL_CS ::\n   *     Corresponds to Microsoft symbol encoding. See\n   *     @FT_ENCODING_MS_SYMBOL.\n   *\n   *   TT_MS_ID_UNICODE_CS ::\n   *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See\n   *     @FT_ENCODING_UNICODE.\n   *\n   *   TT_MS_ID_SJIS ::\n   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.\n   *\n   *   TT_MS_ID_GB2312 ::\n   *     Corresponds to Simplified Chinese as used in Mainland China.  See\n   *     @FT_ENCODING_GB2312.\n   *\n   *   TT_MS_ID_BIG_5 ::\n   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.\n   *     See @FT_ENCODING_BIG5.\n   *\n   *   TT_MS_ID_WANSUNG ::\n   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.\n   *\n   *   TT_MS_ID_JOHAB ::\n   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.\n   *\n   *   TT_MS_ID_UCS_4 ::\n   *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to\n   *     the OpenType specification version 1.4 (mid-2001.)\n   */\n\n#define TT_MS_ID_SYMBOL_CS    0\n#define TT_MS_ID_UNICODE_CS   1\n#define TT_MS_ID_SJIS         2\n#define TT_MS_ID_GB2312       3\n#define TT_MS_ID_BIG_5        4\n#define TT_MS_ID_WANSUNG      5\n#define TT_MS_ID_JOHAB        6\n#define TT_MS_ID_UCS_4       10\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ADOBE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ADOBE charmaps.  This is a FreeType-specific extension!\n   *\n   * @values:\n   *   TT_ADOBE_ID_STANDARD ::\n   *     Adobe standard encoding.\n   *   TT_ADOBE_ID_EXPERT ::\n   *     Adobe expert encoding.\n   *   TT_ADOBE_ID_CUSTOM ::\n   *     Adobe custom encoding.\n   *   TT_ADOBE_ID_LATIN_1 ::\n   *     Adobe Latin~1 encoding.\n   */\n\n#define TT_ADOBE_ID_STANDARD  0\n#define TT_ADOBE_ID_EXPERT    1\n#define TT_ADOBE_ID_CUSTOM    2\n#define TT_ADOBE_ID_LATIN_1   3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MACINTOSH.                                                */\n  /*                                                                       */\n  /* The canonical source for the Apple assigned Language ID's is at       */\n  /*                                                                       */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6name.html                 */\n  /*                                                                       */\n#define TT_MAC_LANGID_ENGLISH                       0\n#define TT_MAC_LANGID_FRENCH                        1\n#define TT_MAC_LANGID_GERMAN                        2\n#define TT_MAC_LANGID_ITALIAN                       3\n#define TT_MAC_LANGID_DUTCH                         4\n#define TT_MAC_LANGID_SWEDISH                       5\n#define TT_MAC_LANGID_SPANISH                       6\n#define TT_MAC_LANGID_DANISH                        7\n#define TT_MAC_LANGID_PORTUGUESE                    8\n#define TT_MAC_LANGID_NORWEGIAN                     9\n#define TT_MAC_LANGID_HEBREW                       10\n#define TT_MAC_LANGID_JAPANESE                     11\n#define TT_MAC_LANGID_ARABIC                       12\n#define TT_MAC_LANGID_FINNISH                      13\n#define TT_MAC_LANGID_GREEK                        14\n#define TT_MAC_LANGID_ICELANDIC                    15\n#define TT_MAC_LANGID_MALTESE                      16\n#define TT_MAC_LANGID_TURKISH                      17\n#define TT_MAC_LANGID_CROATIAN                     18\n#define TT_MAC_LANGID_CHINESE_TRADITIONAL          19\n#define TT_MAC_LANGID_URDU                         20\n#define TT_MAC_LANGID_HINDI                        21\n#define TT_MAC_LANGID_THAI                         22\n#define TT_MAC_LANGID_KOREAN                       23\n#define TT_MAC_LANGID_LITHUANIAN                   24\n#define TT_MAC_LANGID_POLISH                       25\n#define TT_MAC_LANGID_HUNGARIAN                    26\n#define TT_MAC_LANGID_ESTONIAN                     27\n#define TT_MAC_LANGID_LETTISH                      28\n#define TT_MAC_LANGID_SAAMISK                      29\n#define TT_MAC_LANGID_FAEROESE                     30\n#define TT_MAC_LANGID_FARSI                        31\n#define TT_MAC_LANGID_RUSSIAN                      32\n#define TT_MAC_LANGID_CHINESE_SIMPLIFIED           33\n#define TT_MAC_LANGID_FLEMISH                      34\n#define TT_MAC_LANGID_IRISH                        35\n#define TT_MAC_LANGID_ALBANIAN                     36\n#define TT_MAC_LANGID_ROMANIAN                     37\n#define TT_MAC_LANGID_CZECH                        38\n#define TT_MAC_LANGID_SLOVAK                       39\n#define TT_MAC_LANGID_SLOVENIAN                    40\n#define TT_MAC_LANGID_YIDDISH                      41\n#define TT_MAC_LANGID_SERBIAN                      42\n#define TT_MAC_LANGID_MACEDONIAN                   43\n#define TT_MAC_LANGID_BULGARIAN                    44\n#define TT_MAC_LANGID_UKRAINIAN                    45\n#define TT_MAC_LANGID_BYELORUSSIAN                 46\n#define TT_MAC_LANGID_UZBEK                        47\n#define TT_MAC_LANGID_KAZAKH                       48\n#define TT_MAC_LANGID_AZERBAIJANI                  49\n#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT  49\n#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT    50\n#define TT_MAC_LANGID_ARMENIAN                     51\n#define TT_MAC_LANGID_GEORGIAN                     52\n#define TT_MAC_LANGID_MOLDAVIAN                    53\n#define TT_MAC_LANGID_KIRGHIZ                      54\n#define TT_MAC_LANGID_TAJIKI                       55\n#define TT_MAC_LANGID_TURKMEN                      56\n#define TT_MAC_LANGID_MONGOLIAN                    57\n#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT   57\n#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT    58\n#define TT_MAC_LANGID_PASHTO                       59\n#define TT_MAC_LANGID_KURDISH                      60\n#define TT_MAC_LANGID_KASHMIRI                     61\n#define TT_MAC_LANGID_SINDHI                       62\n#define TT_MAC_LANGID_TIBETAN                      63\n#define TT_MAC_LANGID_NEPALI                       64\n#define TT_MAC_LANGID_SANSKRIT                     65\n#define TT_MAC_LANGID_MARATHI                      66\n#define TT_MAC_LANGID_BENGALI                      67\n#define TT_MAC_LANGID_ASSAMESE                     68\n#define TT_MAC_LANGID_GUJARATI                     69\n#define TT_MAC_LANGID_PUNJABI                      70\n#define TT_MAC_LANGID_ORIYA                        71\n#define TT_MAC_LANGID_MALAYALAM                    72\n#define TT_MAC_LANGID_KANNADA                      73\n#define TT_MAC_LANGID_TAMIL                        74\n#define TT_MAC_LANGID_TELUGU                       75\n#define TT_MAC_LANGID_SINHALESE                    76\n#define TT_MAC_LANGID_BURMESE                      77\n#define TT_MAC_LANGID_KHMER                        78\n#define TT_MAC_LANGID_LAO                          79\n#define TT_MAC_LANGID_VIETNAMESE                   80\n#define TT_MAC_LANGID_INDONESIAN                   81\n#define TT_MAC_LANGID_TAGALOG                      82\n#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT           83\n#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT          84\n#define TT_MAC_LANGID_AMHARIC                      85\n#define TT_MAC_LANGID_TIGRINYA                     86\n#define TT_MAC_LANGID_GALLA                        87\n#define TT_MAC_LANGID_SOMALI                       88\n#define TT_MAC_LANGID_SWAHILI                      89\n#define TT_MAC_LANGID_RUANDA                       90\n#define TT_MAC_LANGID_RUNDI                        91\n#define TT_MAC_LANGID_CHEWA                        92\n#define TT_MAC_LANGID_MALAGASY                     93\n#define TT_MAC_LANGID_ESPERANTO                    94\n#define TT_MAC_LANGID_WELSH                       128\n#define TT_MAC_LANGID_BASQUE                      129\n#define TT_MAC_LANGID_CATALAN                     130\n#define TT_MAC_LANGID_LATIN                       131\n#define TT_MAC_LANGID_QUECHUA                     132\n#define TT_MAC_LANGID_GUARANI                     133\n#define TT_MAC_LANGID_AYMARA                      134\n#define TT_MAC_LANGID_TATAR                       135\n#define TT_MAC_LANGID_UIGHUR                      136\n#define TT_MAC_LANGID_DZONGKHA                    137\n#define TT_MAC_LANGID_JAVANESE                    138\n#define TT_MAC_LANGID_SUNDANESE                   139\n\n\n#if 0  /* these seem to be errors that have been dropped */\n\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             140\n#define TT_MAC_LANGID_IRISH_GAELIC                141\n\n#endif\n\n\n  /* The following codes are new as of 2000-03-10 */\n#define TT_MAC_LANGID_GALICIAN                    140\n#define TT_MAC_LANGID_AFRIKAANS                   141\n#define TT_MAC_LANGID_BRETON                      142\n#define TT_MAC_LANGID_INUKTITUT                   143\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             144\n#define TT_MAC_LANGID_MANX_GAELIC                 145\n#define TT_MAC_LANGID_IRISH_GAELIC                146\n#define TT_MAC_LANGID_TONGAN                      147\n#define TT_MAC_LANGID_GREEK_POLYTONIC             148\n#define TT_MAC_LANGID_GREELANDIC                  149\n#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT    150\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MICROSOFT.                                                */\n  /*                                                                       */\n  /* The canonical source for the MS assigned LCID's (seems to) be at      */\n  /*                                                                       */\n  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */\n  /*                                                                       */\n  /* It used to be at various places, among them                           */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt              */\n  /*   http://www.microsoft.com/globaldev/reference/loclanghome.asp        */\n  /*   http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP      */\n  /*   http://msdn.microsoft.com/library/en-us/passport25/                 */\n  /*           NET_Passport_VBScript_Documentation/Single_Sign_In/         */\n  /*           Advanced_Single_Sign_In/Localization_and_LCIDs.asp          */\n  /*                                                                       */\n  /* Hopefully, it seems now that the Globaldev site prevails...           */\n  /*                                   (updated by Antoine, 2004-02-17)    */\n\n#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001\n#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401\n#define TT_MS_LANGID_ARABIC_IRAQ                       0x0801\n#define TT_MS_LANGID_ARABIC_EGYPT                      0x0c01\n#define TT_MS_LANGID_ARABIC_LIBYA                      0x1001\n#define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401\n#define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801\n#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1c01\n#define TT_MS_LANGID_ARABIC_OMAN                       0x2001\n#define TT_MS_LANGID_ARABIC_YEMEN                      0x2401\n#define TT_MS_LANGID_ARABIC_SYRIA                      0x2801\n#define TT_MS_LANGID_ARABIC_JORDAN                     0x2c01\n#define TT_MS_LANGID_ARABIC_LEBANON                    0x3001\n#define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401\n#define TT_MS_LANGID_ARABIC_UAE                        0x3801\n#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3c01\n#define TT_MS_LANGID_ARABIC_QATAR                      0x4001\n#define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402\n#define TT_MS_LANGID_CATALAN_SPAIN                     0x0403\n#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004\n#define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404\n#define TT_MS_LANGID_CHINESE_PRC                       0x0804\n#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0c04\n#define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004\n\n#if 1  /* this looks like the correct value */\n#define TT_MS_LANGID_CHINESE_MACAU                     0x1404\n#else  /* but beware, Microsoft may change its mind...\n          the most recent Word reference has the following: */\n#define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG\n#endif\n\n#if 0  /* used only with .NET `cultures'; commented out */\n#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04\n#endif\n\n#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405\n#define TT_MS_LANGID_DANISH_DENMARK                    0x0406\n#define TT_MS_LANGID_GERMAN_GERMANY                    0x0407\n#define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807\n#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0c07\n#define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007\n#define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407\n#define TT_MS_LANGID_GREEK_GREECE                      0x0408\n\n  /* don't ask what this one means... It is commented out currently. */\n#if 0\n#define TT_MS_LANGID_GREEK_GREECE2                     0x2008\n#endif\n\n#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009\n#define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409\n#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809\n#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0c09\n#define TT_MS_LANGID_ENGLISH_CANADA                    0x1009\n#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409\n#define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809\n#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1c09\n#define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009\n#define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409\n#define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809\n#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2c09\n#define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009\n#define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409\n#define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809\n#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3c09\n#define TT_MS_LANGID_ENGLISH_INDIA                     0x4009\n#define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409\n#define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809\n#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040a\n#define TT_MS_LANGID_SPANISH_MEXICO                    0x080a\n#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0c0a\n#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100a\n#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140a\n#define TT_MS_LANGID_SPANISH_PANAMA                    0x180a\n#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1c0a\n#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200a\n#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240a\n#define TT_MS_LANGID_SPANISH_PERU                      0x280a\n#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2c0a\n#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300a\n#define TT_MS_LANGID_SPANISH_CHILE                     0x340a\n#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380a\n#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3c0a\n#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400a\n#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440a\n#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480a\n#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4c0a\n#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500a\n#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a\n  /* The following ID blatantly violate MS specs by using a */\n  /* sublanguage > 0x1F.                                    */\n#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU\n#define TT_MS_LANGID_FINNISH_FINLAND                   0x040b\n#define TT_MS_LANGID_FRENCH_FRANCE                     0x040c\n#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080c\n#define TT_MS_LANGID_FRENCH_CANADA                     0x0c0c\n#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100c\n#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140c\n#define TT_MS_LANGID_FRENCH_MONACO                     0x180c\n#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1c0c\n#define TT_MS_LANGID_FRENCH_REUNION                    0x200c\n#define TT_MS_LANGID_FRENCH_CONGO                      0x240c\n  /* which was formerly: */\n#define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO\n#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280c\n#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2c0c\n#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300c\n#define TT_MS_LANGID_FRENCH_MALI                       0x340c\n#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c\n#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c\n  /* and another violation of the spec (see 0xE40aU) */\n#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU\n#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040d\n#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040e\n#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040f\n#define TT_MS_LANGID_ITALIAN_ITALY                     0x0410\n#define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810\n#define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411\n#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA     0x0412\n#define TT_MS_LANGID_KOREAN_JOHAB_KOREA                0x0812\n#define TT_MS_LANGID_DUTCH_NETHERLANDS                 0x0413\n#define TT_MS_LANGID_DUTCH_BELGIUM                     0x0813\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL           0x0414\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK          0x0814\n#define TT_MS_LANGID_POLISH_POLAND                     0x0415\n#define TT_MS_LANGID_PORTUGUESE_BRAZIL                 0x0416\n#define TT_MS_LANGID_PORTUGUESE_PORTUGAL               0x0816\n#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND        0x0417\n#define TT_MS_LANGID_ROMANIAN_ROMANIA                  0x0418\n#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818\n#define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419\n#define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819\n#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041a\n#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081a\n#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0c1a\n\n#if 0  /* this used to be this value, but it looks like we were wrong */\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a\n#else  /* current sources say */\n#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101a\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141a\n       /* and XPsp2 Platform SDK added (2004-07-26) */\n       /* Names are shortened to be significant within 40 chars. */\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181a\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181a\n#endif\n\n#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041b\n#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041c\n#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041d\n#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081d\n#define TT_MS_LANGID_THAI_THAILAND                     0x041e\n#define TT_MS_LANGID_TURKISH_TURKEY                    0x041f\n#define TT_MS_LANGID_URDU_PAKISTAN                     0x0420\n#define TT_MS_LANGID_URDU_INDIA                        0x0820\n#define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421\n#define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422\n#define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423\n#define TT_MS_LANGID_SLOVENE_SLOVENIA                  0x0424\n#define TT_MS_LANGID_ESTONIAN_ESTONIA                  0x0425\n#define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426\n#define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427\n#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827\n#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428\n#define TT_MS_LANGID_FARSI_IRAN                        0x0429\n#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042a\n#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042b\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042c\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082c\n#define TT_MS_LANGID_BASQUE_SPAIN                      0x042d\n#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042e\n#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042f\n#define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430\n#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431\n#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432\n#define TT_MS_LANGID_VENDA_SOUTH_AFRICA                0x0433\n#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA                0x0434\n#define TT_MS_LANGID_ZULU_SOUTH_AFRICA                 0x0435\n#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA            0x0436\n#define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437\n#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438\n#define TT_MS_LANGID_HINDI_INDIA                       0x0439\n#define TT_MS_LANGID_MALTESE_MALTA                     0x043a\n  /* Added by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043b\n#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083b\n#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3b\n#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103b\n#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143b\n#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183b\n#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3b\n#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203b\n#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243b\n  /* ... and we also keep our old identifier... */\n#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b\n\n#if 0 /* this seems to be a previous inversion */\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#else\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#endif\n\n#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d\n#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043e\n#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083e\n#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043f\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \\\n          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN\n\n#define TT_MS_LANGID_SWAHILI_KENYA                     0x0441\n#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843\n#define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444\n#define TT_MS_LANGID_BENGALI_INDIA                     0x0445\n#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845\n#define TT_MS_LANGID_PUNJABI_INDIA                     0x0446\n#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846\n#define TT_MS_LANGID_GUJARATI_INDIA                    0x0447\n#define TT_MS_LANGID_ORIYA_INDIA                       0x0448\n#define TT_MS_LANGID_TAMIL_INDIA                       0x0449\n#define TT_MS_LANGID_TELUGU_INDIA                      0x044a\n#define TT_MS_LANGID_KANNADA_INDIA                     0x044b\n#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044c\n#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044d\n#define TT_MS_LANGID_MARATHI_INDIA                     0x044e\n#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044f\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850\n#define TT_MS_LANGID_TIBETAN_CHINA                     0x0451\n  /* Don't use the next constant!  It has            */\n  /*   (1) the wrong spelling (Dzonghka)             */\n  /*   (2) Microsoft doesn't officially define it -- */\n  /*       at least it is not in the List of Local   */\n  /*       ID Values.                                */\n  /*   (3) Dzongkha is not the same language as      */\n  /*       Tibetan, so merging it is wrong anyway.   */\n  /*                                                 */\n  /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW.    */\n#define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851\n\n#if 0\n  /* the following used to be defined */\n#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451\n  /* ... but it was changed; */\n#else\n  /* So we will continue to #define it, but with the correct value */\n#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN\n#endif\n\n#define TT_MS_LANGID_WELSH_WALES                       0x0452\n#define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453\n#define TT_MS_LANGID_LAO_LAOS                          0x0454\n#define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455\n#define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456\n#define TT_MS_LANGID_KONKANI_INDIA                     0x0457\n#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458\n#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459\n#define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859\n  /* Missing a LCID for Sindhi in Devanagari script */\n#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045a\n#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045b\n#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045c\n#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045d\n#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045e\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045f\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085f\n  /* Missing a LCID for Tifinagh script */\n#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460\n  /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */\n  /* script is yet unclear... might be Arabic, Nagari or Sharada */\n#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860\n  /* ... and aliased (by MS) for compatibility reasons. */\n#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA\n#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461\n#define TT_MS_LANGID_NEPALI_INDIA                      0x0861\n#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462\n#define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463\n#define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464\n#define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES\n#define TT_MS_LANGID_EDO_NIGERIA                       0x0466\n#define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467\n#define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468\n#define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469\n#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046a\n#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046b\n#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086b\n#define TT_MS_LANGID_QUECHUA_PERU                      0x0c6b\n#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046c\n  /* Also spelled by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \\\n          TT_MS_LANGID_SEPEDI_SOUTH_AFRICA\n  /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */\n#define TT_MS_LANGID_IGBO_NIGERIA                      0x0470\n#define TT_MS_LANGID_KANURI_NIGERIA                    0x0471\n#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472\n#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473\n#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873\n  /* also spelled in the `Passport SDK' list as: */\n#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA\n#define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474\n#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475\n#define TT_MS_LANGID_LATIN                             0x0476\n#define TT_MS_LANGID_SOMALI_SOMALIA                    0x0477\n  /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */\n  /*       not written (but OTOH the peculiar writing system is worth     */\n  /*       studying).                                                     */\n#define TT_MS_LANGID_YI_CHINA                          0x0478\n#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479\n  /* language codes from 0x047a to 0x047f are (still) unknown. */\n#define TT_MS_LANGID_UIGHUR_CHINA                      0x0480\n#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481\n\n#if 0  /* not deemed useful for fonts */\n#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04ff\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the `name' identifier field in the name records of */\n  /* the TTF `name' table.  These values are platform independent.         */\n  /*                                                                       */\n#define TT_NAME_ID_COPYRIGHT            0\n#define TT_NAME_ID_FONT_FAMILY          1\n#define TT_NAME_ID_FONT_SUBFAMILY       2\n#define TT_NAME_ID_UNIQUE_ID            3\n#define TT_NAME_ID_FULL_NAME            4\n#define TT_NAME_ID_VERSION_STRING       5\n#define TT_NAME_ID_PS_NAME              6\n#define TT_NAME_ID_TRADEMARK            7\n\n  /* the following values are from the OpenType spec */\n#define TT_NAME_ID_MANUFACTURER         8\n#define TT_NAME_ID_DESIGNER             9\n#define TT_NAME_ID_DESCRIPTION          10\n#define TT_NAME_ID_VENDOR_URL           11\n#define TT_NAME_ID_DESIGNER_URL         12\n#define TT_NAME_ID_LICENSE              13\n#define TT_NAME_ID_LICENSE_URL          14\n  /* number 15 is reserved */\n#define TT_NAME_ID_PREFERRED_FAMILY     16\n#define TT_NAME_ID_PREFERRED_SUBFAMILY  17\n#define TT_NAME_ID_MAC_FULL_NAME        18\n\n  /* The following code is new as of 2000-01-21 */\n#define TT_NAME_ID_SAMPLE_TEXT          19\n\n  /* This is new in OpenType 1.3 */\n#define TT_NAME_ID_CID_FINDFONT_NAME    20\n\n  /* This is new in OpenType 1.5 */\n#define TT_NAME_ID_WWS_FAMILY           21\n#define TT_NAME_ID_WWS_SUBFAMILY        22\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table.     */\n  /*                                                                       */\n  /* Updated 08-Nov-2008.                                                  */\n  /*                                                                       */\n\n  /* Bit  0   Basic Latin */\n#define TT_UCR_BASIC_LATIN                     (1L <<  0) /* U+0020-U+007E */\n  /* Bit  1   C1 Controls and Latin-1 Supplement */\n#define TT_UCR_LATIN1_SUPPLEMENT               (1L <<  1) /* U+0080-U+00FF */\n  /* Bit  2   Latin Extended-A */\n#define TT_UCR_LATIN_EXTENDED_A                (1L <<  2) /* U+0100-U+017F */\n  /* Bit  3   Latin Extended-B */\n#define TT_UCR_LATIN_EXTENDED_B                (1L <<  3) /* U+0180-U+024F */\n  /* Bit  4   IPA Extensions                 */\n  /*          Phonetic Extensions            */\n  /*          Phonetic Extensions Supplement */\n#define TT_UCR_IPA_EXTENSIONS                  (1L <<  4) /* U+0250-U+02AF */\n                                                          /* U+1D00-U+1D7F */\n                                                          /* U+1D80-U+1DBF */\n  /* Bit  5   Spacing Modifier Letters */\n  /*          Modifier Tone Letters    */\n#define TT_UCR_SPACING_MODIFIER                (1L <<  5) /* U+02B0-U+02FF */\n                                                          /* U+A700-U+A71F */\n  /* Bit  6   Combining Diacritical Marks            */\n  /*          Combining Diacritical Marks Supplement */\n#define TT_UCR_COMBINING_DIACRITICS            (1L <<  6) /* U+0300-U+036F */\n                                                          /* U+1DC0-U+1DFF */\n  /* Bit  7   Greek and Coptic */\n#define TT_UCR_GREEK                           (1L <<  7) /* U+0370-U+03FF */\n  /* Bit  8   Coptic */\n#define TT_UCR_COPTIC                          (1L <<  8) /* U+2C80-U+2CFF */\n  /* Bit  9   Cyrillic            */\n  /*          Cyrillic Supplement */\n  /*          Cyrillic Extended-A */\n  /*          Cyrillic Extended-B */\n#define TT_UCR_CYRILLIC                        (1L <<  9) /* U+0400-U+04FF */\n                                                          /* U+0500-U+052F */\n                                                          /* U+2DE0-U+2DFF */\n                                                          /* U+A640-U+A69F */\n  /* Bit 10   Armenian */\n#define TT_UCR_ARMENIAN                        (1L << 10) /* U+0530-U+058F */\n  /* Bit 11   Hebrew */\n#define TT_UCR_HEBREW                          (1L << 11) /* U+0590-U+05FF */\n  /* Bit 12   Vai */\n#define TT_UCR_VAI                             (1L << 12) /* U+A500-U+A63F */\n  /* Bit 13   Arabic            */\n  /*          Arabic Supplement */\n#define TT_UCR_ARABIC                          (1L << 13) /* U+0600-U+06FF */\n                                                          /* U+0750-U+077F */\n  /* Bit 14   NKo */\n#define TT_UCR_NKO                             (1L << 14) /* U+07C0-U+07FF */\n  /* Bit 15   Devanagari */\n#define TT_UCR_DEVANAGARI                      (1L << 15) /* U+0900-U+097F */\n  /* Bit 16   Bengali */\n#define TT_UCR_BENGALI                         (1L << 16) /* U+0980-U+09FF */\n  /* Bit 17   Gurmukhi */\n#define TT_UCR_GURMUKHI                        (1L << 17) /* U+0A00-U+0A7F */\n  /* Bit 18   Gujarati */\n#define TT_UCR_GUJARATI                        (1L << 18) /* U+0A80-U+0AFF */\n  /* Bit 19   Oriya */\n#define TT_UCR_ORIYA                           (1L << 19) /* U+0B00-U+0B7F */\n  /* Bit 20   Tamil */\n#define TT_UCR_TAMIL                           (1L << 20) /* U+0B80-U+0BFF */\n  /* Bit 21   Telugu */\n#define TT_UCR_TELUGU                          (1L << 21) /* U+0C00-U+0C7F */\n  /* Bit 22   Kannada */\n#define TT_UCR_KANNADA                         (1L << 22) /* U+0C80-U+0CFF */\n  /* Bit 23   Malayalam */\n#define TT_UCR_MALAYALAM                       (1L << 23) /* U+0D00-U+0D7F */\n  /* Bit 24   Thai */\n#define TT_UCR_THAI                            (1L << 24) /* U+0E00-U+0E7F */\n  /* Bit 25   Lao */\n#define TT_UCR_LAO                             (1L << 25) /* U+0E80-U+0EFF */\n  /* Bit 26   Georgian            */\n  /*          Georgian Supplement */\n#define TT_UCR_GEORGIAN                        (1L << 26) /* U+10A0-U+10FF */\n                                                          /* U+2D00-U+2D2F */\n  /* Bit 27   Balinese */\n#define TT_UCR_BALINESE                        (1L << 27) /* U+1B00-U+1B7F */\n  /* Bit 28   Hangul Jamo */\n#define TT_UCR_HANGUL_JAMO                     (1L << 28) /* U+1100-U+11FF */\n  /* Bit 29   Latin Extended Additional */\n  /*          Latin Extended-C          */\n  /*          Latin Extended-D          */\n#define TT_UCR_LATIN_EXTENDED_ADDITIONAL       (1L << 29) /* U+1E00-U+1EFF */\n                                                          /* U+2C60-U+2C7F */\n                                                          /* U+A720-U+A7FF */\n  /* Bit 30   Greek Extended */\n#define TT_UCR_GREEK_EXTENDED                  (1L << 30) /* U+1F00-U+1FFF */\n  /* Bit 31   General Punctuation      */\n  /*          Supplemental Punctuation */\n#define TT_UCR_GENERAL_PUNCTUATION             (1L << 31) /* U+2000-U+206F */\n                                                          /* U+2E00-U+2E7F */\n  /* Bit 32   Superscripts And Subscripts */\n#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS         (1L <<  0) /* U+2070-U+209F */\n  /* Bit 33   Currency Symbols */\n#define TT_UCR_CURRENCY_SYMBOLS                (1L <<  1) /* U+20A0-U+20CF */\n  /* Bit 34   Combining Diacritical Marks For Symbols */\n#define TT_UCR_COMBINING_DIACRITICS_SYMB       (1L <<  2) /* U+20D0-U+20FF */\n  /* Bit 35   Letterlike Symbols */\n#define TT_UCR_LETTERLIKE_SYMBOLS              (1L <<  3) /* U+2100-U+214F */\n  /* Bit 36   Number Forms */\n#define TT_UCR_NUMBER_FORMS                    (1L <<  4) /* U+2150-U+218F */\n  /* Bit 37   Arrows                           */\n  /*          Supplemental Arrows-A            */\n  /*          Supplemental Arrows-B            */\n  /*          Miscellaneous Symbols and Arrows */\n#define TT_UCR_ARROWS                          (1L <<  5) /* U+2190-U+21FF */\n                                                          /* U+27F0-U+27FF */\n                                                          /* U+2900-U+297F */\n                                                          /* U+2B00-U+2BFF */\n  /* Bit 38   Mathematical Operators               */\n  /*          Supplemental Mathematical Operators  */\n  /*          Miscellaneous Mathematical Symbols-A */\n  /*          Miscellaneous Mathematical Symbols-B */\n#define TT_UCR_MATHEMATICAL_OPERATORS          (1L <<  6) /* U+2200-U+22FF */\n                                                          /* U+2A00-U+2AFF */\n                                                          /* U+27C0-U+27EF */\n                                                          /* U+2980-U+29FF */\n  /* Bit 39 Miscellaneous Technical */\n#define TT_UCR_MISCELLANEOUS_TECHNICAL         (1L <<  7) /* U+2300-U+23FF */\n  /* Bit 40   Control Pictures */\n#define TT_UCR_CONTROL_PICTURES                (1L <<  8) /* U+2400-U+243F */\n  /* Bit 41   Optical Character Recognition */\n#define TT_UCR_OCR                             (1L <<  9) /* U+2440-U+245F */\n  /* Bit 42   Enclosed Alphanumerics */\n#define TT_UCR_ENCLOSED_ALPHANUMERICS          (1L << 10) /* U+2460-U+24FF */\n  /* Bit 43   Box Drawing */\n#define TT_UCR_BOX_DRAWING                     (1L << 11) /* U+2500-U+257F */\n  /* Bit 44   Block Elements */\n#define TT_UCR_BLOCK_ELEMENTS                  (1L << 12) /* U+2580-U+259F */\n  /* Bit 45   Geometric Shapes */\n#define TT_UCR_GEOMETRIC_SHAPES                (1L << 13) /* U+25A0-U+25FF */\n  /* Bit 46   Miscellaneous Symbols */\n#define TT_UCR_MISCELLANEOUS_SYMBOLS           (1L << 14) /* U+2600-U+26FF */\n  /* Bit 47   Dingbats */\n#define TT_UCR_DINGBATS                        (1L << 15) /* U+2700-U+27BF */\n  /* Bit 48   CJK Symbols and Punctuation */\n#define TT_UCR_CJK_SYMBOLS                     (1L << 16) /* U+3000-U+303F */\n  /* Bit 49   Hiragana */\n#define TT_UCR_HIRAGANA                        (1L << 17) /* U+3040-U+309F */\n  /* Bit 50   Katakana                     */\n  /*          Katakana Phonetic Extensions */\n#define TT_UCR_KATAKANA                        (1L << 18) /* U+30A0-U+30FF */\n                                                          /* U+31F0-U+31FF */\n  /* Bit 51   Bopomofo          */\n  /*          Bopomofo Extended */\n#define TT_UCR_BOPOMOFO                        (1L << 19) /* U+3100-U+312F */\n                                                          /* U+31A0-U+31BF */\n  /* Bit 52   Hangul Compatibility Jamo */\n#define TT_UCR_HANGUL_COMPATIBILITY_JAMO       (1L << 20) /* U+3130-U+318F */\n  /* Bit 53   Phags-Pa */\n#define TT_UCR_CJK_MISC                        (1L << 21) /* U+A840-U+A87F */\n#define TT_UCR_KANBUN  TT_UCR_CJK_MISC /* deprecated */\n#define TT_UCR_PHAGSPA\n  /* Bit 54   Enclosed CJK Letters and Months */\n#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS     (1L << 22) /* U+3200-U+32FF */\n  /* Bit 55   CJK Compatibility */\n#define TT_UCR_CJK_COMPATIBILITY               (1L << 23) /* U+3300-U+33FF */\n  /* Bit 56   Hangul Syllables */\n#define TT_UCR_HANGUL                          (1L << 24) /* U+AC00-U+D7A3 */\n  /* Bit 57   High Surrogates              */\n  /*          High Private Use Surrogates  */\n  /*          Low Surrogates               */\n  /*                                       */\n  /* According to OpenType specs v.1.3+,   */\n  /* setting bit 57 implies that there is  */\n  /* at least one codepoint beyond the     */\n  /* Basic Multilingual Plane that is      */\n  /* supported by this font.  So it really */\n  /* means >= U+10000                      */\n#define TT_UCR_SURROGATES                      (1L << 25) /* U+D800-U+DB7F */\n                                                          /* U+DB80-U+DBFF */\n                                                          /* U+DC00-U+DFFF */\n#define TT_UCR_NON_PLANE_0  TT_UCR_SURROGATES\n  /* Bit 58  Phoenician */\n#define TT_UCR_PHOENICIAN                      (1L << 26) /*U+10900-U+1091F*/\n  /* Bit 59   CJK Unified Ideographs             */\n  /*          CJK Radicals Supplement            */\n  /*          Kangxi Radicals                    */\n  /*          Ideographic Description Characters */\n  /*          CJK Unified Ideographs Extension A */\n  /*          CJK Unified Ideographs Extension B */\n  /*          Kanbun                             */\n#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS          (1L << 27) /* U+4E00-U+9FFF */\n                                                          /* U+2E80-U+2EFF */\n                                                          /* U+2F00-U+2FDF */\n                                                          /* U+2FF0-U+2FFF */\n                                                          /* U+3400-U+4DB5 */\n                                                          /*U+20000-U+2A6DF*/\n                                                          /* U+3190-U+319F */\n  /* Bit 60   Private Use */\n#define TT_UCR_PRIVATE_USE                     (1L << 28) /* U+E000-U+F8FF */\n  /* Bit 61   CJK Strokes                             */\n  /*          CJK Compatibility Ideographs            */\n  /*          CJK Compatibility Ideographs Supplement */\n#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS    (1L << 29) /* U+31C0-U+31EF */\n                                                          /* U+F900-U+FAFF */\n                                                          /*U+2F800-U+2FA1F*/\n  /* Bit 62   Alphabetic Presentation Forms */\n#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS   (1L << 30) /* U+FB00-U+FB4F */\n  /* Bit 63   Arabic Presentation Forms-A */\n#define TT_UCR_ARABIC_PRESENTATIONS_A          (1L << 31) /* U+FB50-U+FDFF */\n  /* Bit 64   Combining Half Marks */\n#define TT_UCR_COMBINING_HALF_MARKS            (1L <<  0) /* U+FE20-U+FE2F */\n  /* Bit 65   Vertical forms          */\n  /*          CJK Compatibility Forms */\n#define TT_UCR_CJK_COMPATIBILITY_FORMS         (1L <<  1) /* U+FE10-U+FE1F */\n                                                          /* U+FE30-U+FE4F */\n  /* Bit 66   Small Form Variants */\n#define TT_UCR_SMALL_FORM_VARIANTS             (1L <<  2) /* U+FE50-U+FE6F */\n  /* Bit 67   Arabic Presentation Forms-B */\n#define TT_UCR_ARABIC_PRESENTATIONS_B          (1L <<  3) /* U+FE70-U+FEFE */\n  /* Bit 68   Halfwidth and Fullwidth Forms */\n#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS       (1L <<  4) /* U+FF00-U+FFEF */\n  /* Bit 69   Specials */\n#define TT_UCR_SPECIALS                        (1L <<  5) /* U+FFF0-U+FFFD */\n  /* Bit 70   Tibetan */\n#define TT_UCR_TIBETAN                         (1L <<  6) /* U+0F00-U+0FFF */\n  /* Bit 71   Syriac */\n#define TT_UCR_SYRIAC                          (1L <<  7) /* U+0700-U+074F */\n  /* Bit 72   Thaana */\n#define TT_UCR_THAANA                          (1L <<  8) /* U+0780-U+07BF */\n  /* Bit 73   Sinhala */\n#define TT_UCR_SINHALA                         (1L <<  9) /* U+0D80-U+0DFF */\n  /* Bit 74   Myanmar */\n#define TT_UCR_MYANMAR                         (1L << 10) /* U+1000-U+109F */\n  /* Bit 75   Ethiopic            */\n  /*          Ethiopic Supplement */\n  /*          Ethiopic Extended   */\n#define TT_UCR_ETHIOPIC                        (1L << 11) /* U+1200-U+137F */\n                                                          /* U+1380-U+139F */\n                                                          /* U+2D80-U+2DDF */\n  /* Bit 76   Cherokee */\n#define TT_UCR_CHEROKEE                        (1L << 12) /* U+13A0-U+13FF */\n  /* Bit 77   Unified Canadian Aboriginal Syllabics */\n#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS   (1L << 13) /* U+1400-U+167F */\n  /* Bit 78   Ogham */\n#define TT_UCR_OGHAM                           (1L << 14) /* U+1680-U+169F */\n  /* Bit 79   Runic */\n#define TT_UCR_RUNIC                           (1L << 15) /* U+16A0-U+16FF */\n  /* Bit 80   Khmer         */\n  /*          Khmer Symbols */\n#define TT_UCR_KHMER                           (1L << 16) /* U+1780-U+17FF */\n                                                          /* U+19E0-U+19FF */\n  /* Bit 81   Mongolian */\n#define TT_UCR_MONGOLIAN                       (1L << 17) /* U+1800-U+18AF */\n  /* Bit 82   Braille Patterns */\n#define TT_UCR_BRAILLE                         (1L << 18) /* U+2800-U+28FF */\n  /* Bit 83   Yi Syllables */\n  /*          Yi Radicals  */\n#define TT_UCR_YI                              (1L << 19) /* U+A000-U+A48F */\n                                                          /* U+A490-U+A4CF */\n  /* Bit 84   Tagalog  */\n  /*          Hanunoo  */\n  /*          Buhid    */\n  /*          Tagbanwa */\n#define TT_UCR_PHILIPPINE                      (1L << 20) /* U+1700-U+171F */\n                                                          /* U+1720-U+173F */\n                                                          /* U+1740-U+175F */\n                                                          /* U+1760-U+177F */\n  /* Bit 85   Old Italic */\n#define TT_UCR_OLD_ITALIC                      (1L << 21) /*U+10300-U+1032F*/\n  /* Bit 86   Gothic */\n#define TT_UCR_GOTHIC                          (1L << 22) /*U+10330-U+1034F*/\n  /* Bit 87   Deseret */\n#define TT_UCR_DESERET                         (1L << 23) /*U+10400-U+1044F*/\n  /* Bit 88   Byzantine Musical Symbols      */\n  /*          Musical Symbols                */\n  /*          Ancient Greek Musical Notation */\n#define TT_UCR_MUSICAL_SYMBOLS                 (1L << 24) /*U+1D000-U+1D0FF*/\n                                                          /*U+1D100-U+1D1FF*/\n                                                          /*U+1D200-U+1D24F*/\n  /* Bit 89   Mathematical Alphanumeric Symbols */\n#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS       (1L << 25) /*U+1D400-U+1D7FF*/\n  /* Bit 90   Private Use (plane 15) */\n  /*          Private Use (plane 16) */\n#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY       (1L << 26) /*U+F0000-U+FFFFD*/\n                                                        /*U+100000-U+10FFFD*/\n  /* Bit 91   Variation Selectors            */\n  /*          Variation Selectors Supplement */\n#define TT_UCR_VARIATION_SELECTORS             (1L << 27) /* U+FE00-U+FE0F */\n                                                          /*U+E0100-U+E01EF*/\n  /* Bit 92   Tags */\n#define TT_UCR_TAGS                            (1L << 28) /*U+E0000-U+E007F*/\n  /* Bit 93   Limbu */\n#define TT_UCR_LIMBU                           (1L << 29) /* U+1900-U+194F */\n  /* Bit 94   Tai Le */\n#define TT_UCR_TAI_LE                          (1L << 30) /* U+1950-U+197F */\n  /* Bit 95   New Tai Lue */\n#define TT_UCR_NEW_TAI_LUE                     (1L << 31) /* U+1980-U+19DF */\n  /* Bit 96   Buginese */\n#define TT_UCR_BUGINESE                        (1L <<  0) /* U+1A00-U+1A1F */\n  /* Bit 97   Glagolitic */\n#define TT_UCR_GLAGOLITIC                      (1L <<  1) /* U+2C00-U+2C5F */\n  /* Bit 98   Tifinagh */\n#define TT_UCR_TIFINAGH                        (1L <<  2) /* U+2D30-U+2D7F */\n  /* Bit 99   Yijing Hexagram Symbols */\n#define TT_UCR_YIJING                          (1L <<  3) /* U+4DC0-U+4DFF */\n  /* Bit 100  Syloti Nagri */\n#define TT_UCR_SYLOTI_NAGRI                    (1L <<  4) /* U+A800-U+A82F */\n  /* Bit 101  Linear B Syllabary */\n  /*          Linear B Ideograms */\n  /*          Aegean Numbers     */\n#define TT_UCR_LINEAR_B                        (1L <<  5) /*U+10000-U+1007F*/\n                                                          /*U+10080-U+100FF*/\n                                                          /*U+10100-U+1013F*/\n  /* Bit 102  Ancient Greek Numbers */\n#define TT_UCR_ANCIENT_GREEK_NUMBERS           (1L <<  6) /*U+10140-U+1018F*/\n  /* Bit 103  Ugaritic */\n#define TT_UCR_UGARITIC                        (1L <<  7) /*U+10380-U+1039F*/\n  /* Bit 104  Old Persian */\n#define TT_UCR_OLD_PERSIAN                     (1L <<  8) /*U+103A0-U+103DF*/\n  /* Bit 105  Shavian */\n#define TT_UCR_SHAVIAN                         (1L <<  9) /*U+10450-U+1047F*/\n  /* Bit 106  Osmanya */\n#define TT_UCR_OSMANYA                         (1L << 10) /*U+10480-U+104AF*/\n  /* Bit 107  Cypriot Syllabary */\n#define TT_UCR_CYPRIOT_SYLLABARY               (1L << 11) /*U+10800-U+1083F*/\n  /* Bit 108  Kharoshthi */\n#define TT_UCR_KHAROSHTHI                      (1L << 12) /*U+10A00-U+10A5F*/\n  /* Bit 109  Tai Xuan Jing Symbols */\n#define TT_UCR_TAI_XUAN_JING                   (1L << 13) /*U+1D300-U+1D35F*/\n  /* Bit 110  Cuneiform                         */\n  /*          Cuneiform Numbers and Punctuation */\n#define TT_UCR_CUNEIFORM                       (1L << 14) /*U+12000-U+123FF*/\n                                                          /*U+12400-U+1247F*/\n  /* Bit 111  Counting Rod Numerals */\n#define TT_UCR_COUNTING_ROD_NUMERALS           (1L << 15) /*U+1D360-U+1D37F*/\n  /* Bit 112  Sundanese */\n#define TT_UCR_SUNDANESE                       (1L << 16) /* U+1B80-U+1BBF */\n  /* Bit 113  Lepcha */\n#define TT_UCR_LEPCHA                          (1L << 17) /* U+1C00-U+1C4F */\n  /* Bit 114  Ol Chiki */\n#define TT_UCR_OL_CHIKI                        (1L << 18) /* U+1C50-U+1C7F */\n  /* Bit 115  Saurashtra */\n#define TT_UCR_SAURASHTRA                      (1L << 19) /* U+A880-U+A8DF */\n  /* Bit 116  Kayah Li */\n#define TT_UCR_KAYAH_LI                        (1L << 20) /* U+A900-U+A92F */\n  /* Bit 117  Rejang */\n#define TT_UCR_REJANG                          (1L << 21) /* U+A930-U+A95F */\n  /* Bit 118  Cham */\n#define TT_UCR_CHAM                            (1L << 22) /* U+AA00-U+AA5F */\n  /* Bit 119  Ancient Symbols */\n#define TT_UCR_ANCIENT_SYMBOLS                 (1L << 23) /*U+10190-U+101CF*/\n  /* Bit 120  Phaistos Disc */\n#define TT_UCR_PHAISTOS_DISC                   (1L << 24) /*U+101D0-U+101FF*/\n  /* Bit 121  Carian */\n  /*          Lycian */\n  /*          Lydian */\n#define TT_UCR_OLD_ANATOLIAN                   (1L << 25) /*U+102A0-U+102DF*/\n                                                          /*U+10280-U+1029F*/\n                                                          /*U+10920-U+1093F*/\n  /* Bit 122  Domino Tiles  */\n  /*          Mahjong Tiles */\n#define TT_UCR_GAME_TILES                      (1L << 26) /*U+1F030-U+1F09F*/\n                                                          /*U+1F000-U+1F02F*/\n  /* Bit 123-127 Reserved for process-internal usage */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some compilers have a very limited length of identifiers.             */\n  /*                                                                       */\n#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )\n#define HAVE_LIMIT_ON_IDENTS\n#endif\n\n\n#ifndef HAVE_LIMIT_ON_IDENTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here some alias #defines in order to be clearer.                      */\n  /*                                                                       */\n  /* These are not always #defined to stay within the 31~character limit   */\n  /* which some compilers have.                                            */\n  /*                                                                       */\n  /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */\n  /* Borland compilers (read: from BC++ 3.1 on) can increase this limit.   */\n  /* If you get a warning with such a compiler, use the -i40 switch.       */\n  /*                                                                       */\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_A      \\\n         TT_UCR_ARABIC_PRESENTATIONS_A\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_B      \\\n         TT_UCR_ARABIC_PRESENTATIONS_B\n\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS      \\\n         TT_UCR_COMBINING_DIACRITICS\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\\n         TT_UCR_COMBINING_DIACRITICS_SYMB\n\n\n#endif /* !HAVE_LIMIT_ON_IDENTS */\n\n\nFT_END_HEADER\n\n#endif /* __TTNAMEID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/tttables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttables.h                                                             */\n/*                                                                         */\n/*    Basic SFNT/TrueType tables definitions and interface                 */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 1996-2005, 2008-2011 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTABLES_H__\n#define __TTTABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueType Tables                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    TrueType specific table types and functions.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of TrueType-specific tables   */\n  /*    as well as some routines used to access and process them.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Header                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType font header table.  All       */\n  /*    fields follow the TrueType specification.                          */\n  /*                                                                       */\n  typedef struct  TT_Header_\n  {\n    FT_Fixed   Table_Version;\n    FT_Fixed   Font_Revision;\n\n    FT_Long    CheckSum_Adjust;\n    FT_Long    Magic_Number;\n\n    FT_UShort  Flags;\n    FT_UShort  Units_Per_EM;\n\n    FT_Long    Created [2];\n    FT_Long    Modified[2];\n\n    FT_Short   xMin;\n    FT_Short   yMin;\n    FT_Short   xMax;\n    FT_Short   yMax;\n\n    FT_UShort  Mac_Style;\n    FT_UShort  Lowest_Rec_PPEM;\n\n    FT_Short   Font_Direction;\n    FT_Short   Index_To_Loc_Format;\n    FT_Short   Glyph_Data_Format;\n\n  } TT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HoriHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType horizontal header, the `hhea' */\n  /*    table, as well as the corresponding horizontal metrics table,      */\n  /*    i.e., the `hmtx' table.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                :: The table version.                       */\n  /*                                                                       */\n  /*    Ascender               :: The font's ascender, i.e., the distance  */\n  /*                              from the baseline to the top-most of all */\n  /*                              glyph points found in the font.          */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoAscender' field */\n  /*                              of the OS/2 table instead if you want    */\n  /*                              the correct one.                         */\n  /*                                                                       */\n  /*    Descender              :: The font's descender, i.e., the distance */\n  /*                              from the baseline to the bottom-most of  */\n  /*                              all glyph points found in the font.  It  */\n  /*                              is negative.                             */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoDescender'      */\n  /*                              field of the OS/2 table instead if you   */\n  /*                              want the correct one.                    */\n  /*                                                                       */\n  /*    Line_Gap               :: The font's line gap, i.e., the distance  */\n  /*                              to add to the ascender and descender to  */\n  /*                              get the BTB, i.e., the                   */\n  /*                              baseline-to-baseline distance for the    */\n  /*                              font.                                    */\n  /*                                                                       */\n  /*    advance_Width_Max      :: This field is the maximum of all advance */\n  /*                              widths found in the font.  It can be     */\n  /*                              used to compute the maximum width of an  */\n  /*                              arbitrary string of text.                */\n  /*                                                                       */\n  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */\n  /*                              `width' of a glyph's bounding box) for   */\n  /*                              all glyphs in the font.                  */\n  /*                                                                       */\n  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */\n  /*                              slope of the cursor (slope=rise/run).    */\n  /*                                                                       */\n  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */\n  /*                              slope.                                   */\n  /*                                                                       */\n  /*    Reserved               :: 8~reserved bytes.                        */\n  /*                                                                       */\n  /*    metric_Data_Format     :: Always~0.                                */\n  /*                                                                       */\n  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */\n  /*                              table -- this value can be smaller than  */\n  /*                              the total number of glyphs in the font.  */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_HoriHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Width_Max;      /* advance width maximum */\n\n    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */\n    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */\n    FT_Short   xMax_Extent;            /* xmax extents          */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_HMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they are used to connect the metrics header to the relevant    */\n    /* `HMTX' table.                                                      */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_HoriHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_VertHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType vertical header, the `vhea'   */\n  /*    table, as well as the corresponding vertical metrics table, i.e.,  */\n  /*    the `vmtx' table.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                 :: The table version.                      */\n  /*                                                                       */\n  /*    Ascender                :: The font's ascender, i.e., the distance */\n  /*                               from the baseline to the top-most of    */\n  /*                               all glyph points found in the font.     */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoAscender'      */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Descender               :: The font's descender, i.e., the         */\n  /*                               distance from the baseline to the       */\n  /*                               bottom-most of all glyph points found   */\n  /*                               in the font.  It is negative.           */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoDescender'     */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Line_Gap                :: The font's line gap, i.e., the distance */\n  /*                               to add to the ascender and descender to */\n  /*                               get the BTB, i.e., the                  */\n  /*                               baseline-to-baseline distance for the   */\n  /*                               font.                                   */\n  /*                                                                       */\n  /*    advance_Height_Max      :: This field is the maximum of all        */\n  /*                               advance heights found in the font.  It  */\n  /*                               can be used to compute the maximum      */\n  /*                               height of an arbitrary string of text.  */\n  /*                                                                       */\n  /*    min_Top_Side_Bearing    :: The minimum top side bearing of all     */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    min_Bottom_Side_Bearing :: The minimum bottom side bearing of all  */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    yMax_Extent             :: The maximum vertical extent (i.e., the  */\n  /*                               `height' of a glyph's bounding box) for */\n  /*                               all glyphs in the font.                 */\n  /*                                                                       */\n  /*    caret_Slope_Rise        :: The rise coefficient of the cursor's    */\n  /*                               slope of the cursor (slope=rise/run).   */\n  /*                                                                       */\n  /*    caret_Slope_Run         :: The run coefficient of the cursor's     */\n  /*                               slope.                                  */\n  /*                                                                       */\n  /*    caret_Offset            :: The cursor's offset for slanted fonts.  */\n  /*                               This value is `reserved' in vmtx        */\n  /*                               version 1.0.                            */\n  /*                                                                       */\n  /*    Reserved                :: 8~reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format      :: Always~0.                               */\n  /*                                                                       */\n  /*    number_Of_HMetrics      :: Number of VMetrics entries in the       */\n  /*                               `vmtx' table -- this value can be       */\n  /*                               smaller than the total number of glyphs */\n  /*                               in the font.                            */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_VertHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Height_Max;      /* advance height maximum */\n\n    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */\n    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */\n    FT_Short   yMax_Extent;             /* xmax or ymax extents            */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_VMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they're used to connect the metrics header to the relevant     */\n    /* `HMTX' or `VMTX' table.                                            */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_VertHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_OS2                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType OS/2 table. This is the long  */\n  /*    table version.  All fields comply to the TrueType specification.   */\n  /*                                                                       */\n  /*    Note that we now support old Mac fonts which do not include an     */\n  /*    OS/2 table.  In this case, the `version' field is always set to    */\n  /*    0xFFFF.                                                            */\n  /*                                                                       */\n  typedef struct  TT_OS2_\n  {\n    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */\n    FT_Short   xAvgCharWidth;\n    FT_UShort  usWeightClass;\n    FT_UShort  usWidthClass;\n    FT_Short   fsType;\n    FT_Short   ySubscriptXSize;\n    FT_Short   ySubscriptYSize;\n    FT_Short   ySubscriptXOffset;\n    FT_Short   ySubscriptYOffset;\n    FT_Short   ySuperscriptXSize;\n    FT_Short   ySuperscriptYSize;\n    FT_Short   ySuperscriptXOffset;\n    FT_Short   ySuperscriptYOffset;\n    FT_Short   yStrikeoutSize;\n    FT_Short   yStrikeoutPosition;\n    FT_Short   sFamilyClass;\n\n    FT_Byte    panose[10];\n\n    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */\n    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */\n    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */\n    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */\n\n    FT_Char    achVendID[4];\n\n    FT_UShort  fsSelection;\n    FT_UShort  usFirstCharIndex;\n    FT_UShort  usLastCharIndex;\n    FT_Short   sTypoAscender;\n    FT_Short   sTypoDescender;\n    FT_Short   sTypoLineGap;\n    FT_UShort  usWinAscent;\n    FT_UShort  usWinDescent;\n\n    /* only version 1 tables: */\n\n    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */\n    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */\n\n    /* only version 2 tables: */\n\n    FT_Short   sxHeight;\n    FT_Short   sCapHeight;\n    FT_UShort  usDefaultChar;\n    FT_UShort  usBreakChar;\n    FT_UShort  usMaxContext;\n\n  } TT_OS2;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Postscript                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PostScript table.  All fields */\n  /*    comply to the TrueType specification.  This structure does not     */\n  /*    reference the PostScript glyph names, which can be nevertheless    */\n  /*    accessed with the `ttpost' module.                                 */\n  /*                                                                       */\n  typedef struct  TT_Postscript_\n  {\n    FT_Fixed  FormatType;\n    FT_Fixed  italicAngle;\n    FT_Short  underlinePosition;\n    FT_Short  underlineThickness;\n    FT_ULong  isFixedPitch;\n    FT_ULong  minMemType42;\n    FT_ULong  maxMemType42;\n    FT_ULong  minMemType1;\n    FT_ULong  maxMemType1;\n\n    /* Glyph names follow in the file, but we don't   */\n    /* load them by default.  See the ttpost.c file.  */\n\n  } TT_Postscript;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_PCLT                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PCLT table.  All fields       */\n  /*    comply to the TrueType specification.                              */\n  /*                                                                       */\n  typedef struct  TT_PCLT_\n  {\n    FT_Fixed   Version;\n    FT_ULong   FontNumber;\n    FT_UShort  Pitch;\n    FT_UShort  xHeight;\n    FT_UShort  Style;\n    FT_UShort  TypeFamily;\n    FT_UShort  CapHeight;\n    FT_UShort  SymbolSet;\n    FT_Char    TypeFace[16];\n    FT_Char    CharacterComplement[8];\n    FT_Char    FileName[6];\n    FT_Char    StrokeWeight;\n    FT_Char    WidthType;\n    FT_Byte    SerifStyle;\n    FT_Byte    Reserved;\n\n  } TT_PCLT;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The maximum profile is a table containing many max values which    */\n  /*    can be used to pre-allocate arrays.  This ensures that no memory   */\n  /*    allocation occurs during a glyph load.                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version               :: The version number.                       */\n  /*                                                                       */\n  /*    numGlyphs             :: The number of glyphs in this TrueType     */\n  /*                             font.                                     */\n  /*                                                                       */\n  /*    maxPoints             :: The maximum number of points in a         */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositePoints'.                     */\n  /*                                                                       */\n  /*    maxContours           :: The maximum number of contours in a       */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositeContours'.                   */\n  /*                                                                       */\n  /*    maxCompositePoints    :: The maximum number of points in a         */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxPoints'.            */\n  /*                                                                       */\n  /*    maxCompositeContours  :: The maximum number of contours in a       */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxContours'.          */\n  /*                                                                       */\n  /*    maxZones              :: The maximum number of zones used for      */\n  /*                             glyph hinting.                            */\n  /*                                                                       */\n  /*    maxTwilightPoints     :: The maximum number of points in the       */\n  /*                             twilight zone used for glyph hinting.     */\n  /*                                                                       */\n  /*    maxStorage            :: The maximum number of elements in the     */\n  /*                             storage area used for glyph hinting.      */\n  /*                                                                       */\n  /*    maxFunctionDefs       :: The maximum number of function            */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxInstructionDefs    :: The maximum number of instruction         */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxStackElements      :: The maximum number of stack elements used */\n  /*                             during bytecode interpretation.           */\n  /*                                                                       */\n  /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */\n  /*                             used for glyph hinting.                   */\n  /*                                                                       */\n  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */\n  /*                             composite) glyphs in a composite glyph.   */\n  /*                                                                       */\n  /*    maxComponentDepth     :: The maximum nesting depth of composite    */\n  /*                             glyphs.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is only used during font loading.                   */\n  /*                                                                       */\n  typedef struct  TT_MaxProfile_\n  {\n    FT_Fixed   version;\n    FT_UShort  numGlyphs;\n    FT_UShort  maxPoints;\n    FT_UShort  maxContours;\n    FT_UShort  maxCompositePoints;\n    FT_UShort  maxCompositeContours;\n    FT_UShort  maxZones;\n    FT_UShort  maxTwilightPoints;\n    FT_UShort  maxStorage;\n    FT_UShort  maxFunctionDefs;\n    FT_UShort  maxInstructionDefs;\n    FT_UShort  maxStackElements;\n    FT_UShort  maxSizeOfInstructions;\n    FT_UShort  maxComponentElements;\n    FT_UShort  maxComponentDepth;\n\n  } TT_MaxProfile;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Sfnt_Tag                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify the index of an SFNT table.         */\n  /*    Used in the @FT_Get_Sfnt_Table API function.                       */\n  /*                                                                       */\n  typedef enum  FT_Sfnt_Tag_\n  {\n    ft_sfnt_head = 0,    /* TT_Header     */\n    ft_sfnt_maxp = 1,    /* TT_MaxProfile */\n    ft_sfnt_os2  = 2,    /* TT_OS2        */\n    ft_sfnt_hhea = 3,    /* TT_HoriHeader */\n    ft_sfnt_vhea = 4,    /* TT_VertHeader */\n    ft_sfnt_post = 5,    /* TT_Postscript */\n    ft_sfnt_pclt = 6,    /* TT_PCLT       */\n\n    sfnt_max   /* internal end mark */\n\n  } FT_Sfnt_Tag;\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pointer to a given SFNT table within a face.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source.                                    */\n  /*                                                                       */\n  /*    tag  :: The index of the SFNT table.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A type-less pointer to the table.  This will be~0 in case of       */\n  /*    error, or if the corresponding table was not found *OR* loaded     */\n  /*    from the file.                                                     */\n  /*                                                                       */\n  /*    Use a typecast according to `tag' to access the structure          */\n  /*    elements.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The table is owned by the face object and disappears with it.      */\n  /*                                                                       */\n  /*    This function is only useful to access SFNT tables that are loaded */\n  /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */\n  /*    a list.                                                            */\n  /*                                                                       */\n  FT_EXPORT( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Load_Sfnt_Table\n  *\n  * @description:\n  *   Load any font table into client memory.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   tag ::\n  *     The four-byte tag of the table to load.  Use the value~0 if you want\n  *     to access the whole font file.  Otherwise, you can use one of the\n  *     definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new\n  *     one with @FT_MAKE_TAG.\n  *\n  *   offset ::\n  *     The starting offset in the table (or file if tag == 0).\n  *\n  * @output:\n  *   buffer ::\n  *     The target buffer address.  The client must ensure that the memory\n  *     array is big enough to hold the data.\n  *\n  * @inout:\n  *   length ::\n  *     If the `length' parameter is NULL, then try to load the whole table.\n  *     Return an error code if it fails.\n  *\n  *     Else, if `*length' is~0, exit immediately while returning the\n  *     table's (or file) full size in it.\n  *\n  *     Else the number of bytes to read from the table or file, from the\n  *     starting offset.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If you need to determine the table's length you should first call this\n  *   function with `*length' set to~0, as in the following example:\n  *\n  *     {\n  *       FT_ULong  length = 0;\n  *\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );\n  *       if ( error ) { ... table does not exist ... }\n  *\n  *       buffer = malloc( length );\n  *       if ( buffer == NULL ) { ... not enough memory ... }\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );\n  *       if ( error ) { ... could not load table ... }\n  *     }\n  */\n  FT_EXPORT( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Sfnt_Table_Info\n  *\n  * @description:\n  *   Return information on an SFNT table.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   table_index ::\n  *     The index of an SFNT table.  The function returns\n  *     FT_Err_Table_Missing for an invalid value.\n  *\n  * @inout:\n  *   tag ::\n  *     The name tag of the SFNT table.  If the value is NULL, `table_index'\n  *     is ignored, and `length' returns the number of SFNT tables in the\n  *     font.\n  *\n  * @output:\n  *   length ::\n  *     The length of the SFNT table (or the number of SFNT tables, depending\n  *     on `tag').\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   SFNT tables with length zero are treated as missing.\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */\n  /*    language ID values are in `freetype/ttnameid.h'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */\n  /*    TrueType/sfnt face, just return~0 as the default value.            */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap format.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The format of `charmap'.  If `charmap' doesn't belong to a         */\n  /*    TrueType/sfnt face, return -1.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTTABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/tttags.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttags.h                                                               */\n/*                                                                         */\n/*    Tags for TrueType and OpenType tables (specification only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2005, 2007, 2008 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTAGS_H__\n#define __TTAGS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )\n#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )\n#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )\n#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )\n#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )\n#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )\n#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )\n#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )\n#define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )\n#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )\n#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )\n#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )\n#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )\n#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )\n#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )\n#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )\n#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )\n#define TTAG_FOND  FT_MAKE_TAG( 'F', 'O', 'N', 'D' )\n#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )\n#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )\n#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )\n#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )\n#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )\n#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )\n#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )\n#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )\n#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )\n#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )\n#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )\n#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )\n#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )\n#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )\n#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )\n#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )\n#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )\n#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )\n#define TTAG_LWFN  FT_MAKE_TAG( 'L', 'W', 'F', 'N' )\n#define TTAG_MATH  FT_MAKE_TAG( 'M', 'A', 'T', 'H' )\n#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )\n#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )\n#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )\n#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )\n#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )\n#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )\n#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )\n#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )\n#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )\n#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )\n#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )\n#define TTAG_POST  FT_MAKE_TAG( 'P', 'O', 'S', 'T' )\n#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )\n#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )\n#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )\n#define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )\n#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )\n#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )\n#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )\n#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )\n#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )\n#define TTAG_TYP1  FT_MAKE_TAG( 'T', 'Y', 'P', '1' )\n#define TTAG_typ1  FT_MAKE_TAG( 't', 'y', 'p', '1' )\n#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )\n#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )\n#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )\n\n\nFT_END_HEADER\n\n#endif /* __TTAGS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/freetype/ttunpat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttunpat.h                                                              */\n/*                                                                         */\n/*    Definitions for the unpatented TrueType hinting system               */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by Graham Asher <graham.asher@btinternet.com>                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTUNPAT_H__\n#define __TTUNPAT_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_UNPATENTED_HINTING\n  *\n  * @description:\n  *   A constant used as the tag of an @FT_Parameter structure to indicate\n  *   that unpatented methods only should be used by the TrueType bytecode\n  *   interpreter for a typeface opened by @FT_Open_Face.\n  *\n  */\n#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __TTUNPAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/linux/ft2build.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ft2build.h                                                             */\n/*                                                                         */\n/*    FreeType 2 build and setup macros.                                   */\n/*    (Generic version)                                                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2006 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file corresponds to the default `ft2build.h' file for            */\n  /* FreeType 2.  It uses the `freetype' include root.                     */\n  /*                                                                       */\n  /* Note that specific platforms might use a different configuration.     */\n  /* See builds/unix/ft2unix.h for an example.                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FT2_BUILD_GENERIC_H__\n#define __FT2_BUILD_GENERIC_H__\n\n#include <freetype/config/ftheader.h>\n\n#endif /* __FT2_BUILD_GENERIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/config/ftconfig.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftconfig.h                                                             */\n/*                                                                         */\n/*    ANSI-specific configuration file (specification only).               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This header file contains a number of macro definitions that are used */\n  /* by the rest of the engine.  Most of the macros here are automatically */\n  /* determined at compile time, and you should not need to change it to   */\n  /* port FreeType, except to compile the library with a non-ANSI          */\n  /* compiler.                                                             */\n  /*                                                                       */\n  /* Note however that if some specific modifications are needed, we       */\n  /* advise you to place a modified copy in your build directory.          */\n  /*                                                                       */\n  /* The build directory is usually `freetype/builds/<system>', and        */\n  /* contains system-specific files that are always included first when    */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* This ANSI version should stay in `include/freetype/config'.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FTCONFIG_H__\n#define __FTCONFIG_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_OPTIONS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* These macros can be toggled to suit a specific system.  The current   */\n  /* ones are defaults used to compile FreeType in an ANSI C environment   */\n  /* (16bit compilers are also supported).  Copy this file to your own     */\n  /* `freetype/builds/<system>' directory, and edit it to port the engine. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* There are systems (like the Texas Instruments 'C54x) where a `char' */\n  /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */\n  /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */\n  /* is probably unexpected.                                             */\n  /*                                                                     */\n  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */\n  /* `char' type.                                                        */\n\n#ifndef FT_CHAR_BIT\n#define FT_CHAR_BIT  CHAR_BIT\n#endif\n\n\n  /* The size of an `int' type.  */\n#if                                 FT_UINT_MAX == 0xFFFFUL\n#define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)\n#elif                               FT_UINT_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)\n#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `int' type!\"\n#endif\n\n  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */\n  /* DM642) is recognized but avoided.                                   */\n#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `long' type!\"\n#endif\n\n\n  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */\n  /* used -- this is only used to get rid of unpleasant compiler warnings */\n#ifndef FT_UNUSED\n#define FT_UNUSED( arg )  ( (arg) = (arg) )\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     AUTOMATIC CONFIGURATION MACROS                    */\n  /*                                                                       */\n  /* These macros are computed from the ones defined above.  Don't touch   */\n  /* their definition, unless you know precisely what you are doing.  No   */\n  /* porter should need to mess with them.                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Mac support                                                           */\n  /*                                                                       */\n  /*   This is the only necessary change, so it is defined here instead    */\n  /*   providing a new configuration file.                                 */\n  /*                                                                       */\n#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )\n  /* no Carbon frameworks for 64bit 10.4.x */\n  /* AvailabilityMacros.h is available since Mac OS X 10.2,        */\n  /* so guess the system version by maximum errno before inclusion */\n#include <errno.h>\n#ifdef ECANCELED /* defined since 10.2 */\n#include \"AvailabilityMacros.h\"\n#endif\n#if defined( __LP64__ ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )\n#undef FT_MACINTOSH\n#endif\n\n#elif defined( __SC__ ) || defined( __MRC__ )\n  /* Classic MacOS compilers */\n#include \"ConditionalMacros.h\"\n#if TARGET_OS_MAC\n#define FT_MACINTOSH 1\n#endif\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int16                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit signed integer type.                         */\n  /*                                                                       */\n  typedef signed short  FT_Int16;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt16                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit unsigned integer type.                       */\n  /*                                                                       */\n  typedef unsigned short  FT_UInt16;\n\n  /* */\n\n\n  /* this #if 0 ... #endif clause is for documentation purposes */\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int32                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 32bit signed integer type.  The size depends on    */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef signed XXX  FT_Int32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt32                                                          */\n  /*                                                                       */\n  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int64                                                           */\n  /*                                                                       */\n  /*    A typedef for a 64bit signed integer type.  The size depends on    */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef signed XXX  FT_Int64;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt64                                                          */\n  /*                                                                       */\n  /*    A typedef for a 64bit unsigned integer type.  The size depends on  */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt64;\n\n  /* */\n\n#endif\n\n#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)\n\n  typedef signed int      FT_Int32;\n  typedef unsigned int    FT_UInt32;\n\n#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)\n\n  typedef signed long     FT_Int32;\n  typedef unsigned long   FT_UInt32;\n\n#else\n#error \"no 32bit type found -- please check your configuration files\"\n#endif\n\n\n  /* look up an integer type that is at least 32 bits */\n#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)\n\n  typedef int            FT_Fast;\n  typedef unsigned int   FT_UFast;\n\n#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)\n\n  typedef long           FT_Fast;\n  typedef unsigned long  FT_UFast;\n\n#endif\n\n\n  /* determine whether we have a 64-bit int type for platforms without */\n  /* Autoconf                                                          */\n#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)\n\n  /* FT_LONG64 must be defined if a 64-bit type is available */\n#define FT_LONG64\n#define FT_INT64   long\n#define FT_UINT64  unsigned long\n\n#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __BORLANDC__ )  /* Borland C++ */\n\n  /* XXXX: We should probably check the value of __BORLANDC__ in order */\n  /*       to test the compiler version.                               */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __WATCOMC__ )   /* Watcom C++ */\n\n  /* Watcom doesn't provide 64-bit data types */\n\n#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */\n\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#elif defined( __GNUC__ )\n\n  /* GCC provides the `long long' type */\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A 64-bit data type will create compilation problems if you compile    */\n  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */\n  /* is defined.  You can however ignore this rule by defining the         */\n  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */\n  /*                                                                       */\n#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )\n\n#ifdef __STDC__\n\n  /* undefine the 64-bit macros in strict ANSI compilation mode */\n#undef FT_LONG64\n#undef FT_INT64\n\n#endif /* __STDC__ */\n\n#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */\n\n#ifdef FT_LONG64\n  typedef FT_INT64   FT_Int64;\n  typedef FT_UINT64  FT_UInt64;\n#endif\n\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT\n\n\n#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER\n  /* Provide assembler fragments for performance-critical functions. */\n  /* These must be defined `static __inline__' with GCC.             */\n\n#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm\n    {\n      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */\n      mov   a,  t,  asr #31         /* a   = (hi >> 31) */\n      add   a,  a,  #0x8000         /* a  += 0x8000 */\n      adds  t2, t2, a               /* t2 += a */\n      adc   t,  t,  #0              /* t  += carry */\n      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */\n      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */\n    }\n    return a;\n  }\n\n#endif /* __CC_ARM || __ARMCC__ */\n\n\n#ifdef __GNUC__\n\n#if defined( __arm__ ) && !defined( __thumb__ )    && \\\n    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm__ __volatile__ (\n      \"smull  %1, %2, %4, %3\\n\\t\"       /* (lo=%1,hi=%2) = a*b */\n      \"mov    %0, %2, asr #31\\n\\t\"      /* %0  = (hi >> 31) */\n      \"add    %0, %0, #0x8000\\n\\t\"      /* %0 += 0x8000 */\n      \"adds   %1, %1, %0\\n\\t\"           /* %1 += %0 */\n      \"adc    %2, %2, #0\\n\\t\"           /* %2 += carry */\n      \"mov    %0, %1, lsr #16\\n\\t\"      /* %0  = %1 >> 16 */\n      \"orr    %0, %0, %2, lsl #16\\n\\t\"  /* %0 |= %2 << 16 */\n      : \"=r\"(a), \"=&r\"(t2), \"=&r\"(t)\n      : \"r\"(a), \"r\"(b)\n      : \"cc\" );\n    return a;\n  }\n\n#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */\n\n#if defined( __i386__ )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n\n    __asm__ __volatile__ (\n      \"imul  %%edx\\n\"\n      \"movl  %%edx, %%ecx\\n\"\n      \"sarl  $31, %%ecx\\n\"\n      \"addl  $0x8000, %%ecx\\n\"\n      \"addl  %%ecx, %%eax\\n\"\n      \"adcl  $0, %%edx\\n\"\n      \"shrl  $16, %%eax\\n\"\n      \"shll  $16, %%edx\\n\"\n      \"addl  %%edx, %%eax\\n\"\n      : \"=a\"(result), \"=d\"(b)\n      : \"a\"(a), \"d\"(b)\n      : \"%ecx\", \"cc\" );\n    return result;\n  }\n\n#endif /* i386 */\n\n#endif /* __GNUC__ */\n\n\n#ifdef _MSC_VER /* Visual C++ */\n\n#ifdef _M_IX86\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n    __asm\n    {\n      mov eax, a\n      mov edx, b\n      imul edx\n      mov ecx, edx\n      sar ecx, 31\n      add ecx, 8000h\n      add eax, ecx\n      adc edx, 0\n      shr eax, 16\n      shl edx, 16\n      add eax, edx\n      mov result, eax\n    }\n    return result;\n  }\n\n#endif /* _M_IX86 */\n\n#endif /* _MSC_VER */\n\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n#ifdef FT_CONFIG_OPTION_INLINE_MULFIX\n#ifdef FT_MULFIX_ASSEMBLER\n#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER\n#endif\n#endif\n\n\n#ifdef FT_MAKE_OPTION_SINGLE_OBJECT\n\n#define FT_LOCAL( x )      static  x\n#define FT_LOCAL_DEF( x )  static  x\n\n#else\n\n#ifdef __cplusplus\n#define FT_LOCAL( x )      extern \"C\"  x\n#define FT_LOCAL_DEF( x )  extern \"C\"  x\n#else\n#define FT_LOCAL( x )      extern  x\n#define FT_LOCAL_DEF( x )  x\n#endif\n\n#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */\n\n\n#ifndef FT_BASE\n\n#ifdef __cplusplus\n#define FT_BASE( x )  extern \"C\"  x\n#else\n#define FT_BASE( x )  extern  x\n#endif\n\n#endif /* !FT_BASE */\n\n\n#ifndef FT_BASE_DEF\n\n#ifdef __cplusplus\n#define FT_BASE_DEF( x )  x\n#else\n#define FT_BASE_DEF( x )  x\n#endif\n\n#endif /* !FT_BASE_DEF */\n\n\n#ifndef FT_EXPORT\n\n#ifdef __cplusplus\n#define FT_EXPORT( x )  extern \"C\"  x\n#else\n#define FT_EXPORT( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT */\n\n\n#ifndef FT_EXPORT_DEF\n\n#ifdef __cplusplus\n#define FT_EXPORT_DEF( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_DEF( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_DEF */\n\n\n#ifndef FT_EXPORT_VAR\n\n#ifdef __cplusplus\n#define FT_EXPORT_VAR( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_VAR */\n\n  /* The following macros are needed to compile the library with a   */\n  /* C++ compiler and with 16bit compilers.                          */\n  /*                                                                 */\n\n  /* This is special.  Within C++, you must specify `extern \"C\"' for */\n  /* functions which are used via function pointers, and you also    */\n  /* must do that for structures which contain function pointers to  */\n  /* assure C linkage -- it's not possible to have (local) anonymous */\n  /* functions which are accessed by (global) function pointers.     */\n  /*                                                                 */\n  /*                                                                 */\n  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */\n  /* contains pointers to callback functions.                        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */\n  /* that contains pointers to callback functions.                   */\n  /*                                                                 */\n  /*                                                                 */\n  /* Some 16bit compilers have to redefine these macros to insert    */\n  /* the infamous `_cdecl' or `__fastcall' declarations.             */\n  /*                                                                 */\n#ifndef FT_CALLBACK_DEF\n#ifdef __cplusplus\n#define FT_CALLBACK_DEF( x )  extern \"C\"  x\n#else\n#define FT_CALLBACK_DEF( x )  static  x\n#endif\n#endif /* FT_CALLBACK_DEF */\n\n#ifndef FT_CALLBACK_TABLE\n#ifdef __cplusplus\n#define FT_CALLBACK_TABLE      extern \"C\"\n#define FT_CALLBACK_TABLE_DEF  extern \"C\"\n#else\n#define FT_CALLBACK_TABLE      extern\n#define FT_CALLBACK_TABLE_DEF  /* nothing */\n#endif\n#endif /* FT_CALLBACK_TABLE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCONFIG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/config/ftheader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftheader.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_HEADER_H__\n#define __FT_HEADER_H__\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_BEGIN_HEADER                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_END_HEADER in header    */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_BEGIN_HEADER  extern \"C\" {\n#else\n#define FT_BEGIN_HEADER  /* nothing */\n#endif\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_END_HEADER                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_BEGIN_HEADER in header  */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_END_HEADER  }\n#else\n#define FT_END_HEADER  /* nothing */\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Aliases for the FreeType 2 public and configuration files.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_file_macros                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Header File Macros                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Macro definitions used to #include specific header files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following macros are defined to the name of specific           */\n  /*    FreeType~2 header files.  They can be used directly in #include    */\n  /*    statements as in:                                                  */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_MULTIPLE_MASTERS_H                                   */\n  /*      #include FT_GLYPH_H                                              */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    There are several reasons why we are now using macros to name      */\n  /*    public header files.  The first one is that such macros are not    */\n  /*    limited to the infamous 8.3~naming rule required by DOS (and       */\n  /*    `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').   */\n  /*                                                                       */\n  /*    The second reason is that it allows for more flexibility in the    */\n  /*    way FreeType~2 is installed on a given system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* configuration files */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_CONFIG_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 configuration data.\n   *\n   */\n#ifndef FT_CONFIG_CONFIG_H\n#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_STANDARD_LIBRARY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 interface to the standard C library functions.\n   *\n   */\n#ifndef FT_CONFIG_STANDARD_LIBRARY_H\n#define FT_CONFIG_STANDARD_LIBRARY_H  <freetype/config/ftstdlib.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_OPTIONS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 project-specific configuration options.\n   *\n   */\n#ifndef FT_CONFIG_OPTIONS_H\n#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_MODULES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 modules that are statically linked to new library\n   *   instances in @FT_Init_FreeType.\n   *\n   */\n#ifndef FT_CONFIG_MODULES_H\n#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>\n#endif\n\n  /* */\n\n  /* public headers */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_FREETYPE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   base FreeType~2 API.\n   *\n   */\n#define FT_FREETYPE_H  <freetype/freetype.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 error codes (and messages).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_ERRORS_H  <freetype/fterrors.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 module error offsets (and messages).\n   *\n   */\n#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYSTEM_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 interface to low-level operations (i.e., memory management\n   *   and stream i/o).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_SYSTEM_H  <freetype/ftsystem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing type\n   *   definitions related to glyph images (i.e., bitmaps, outlines,\n   *   scan-converter parameters).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_IMAGE_H  <freetype/ftimage.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   basic data types defined by FreeType~2.\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_TYPES_H  <freetype/fttypes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LIST_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list management API of FreeType~2.\n   *\n   *   (Most applications will never need to include this file.)\n   *\n   */\n#define FT_LIST_H  <freetype/ftlist.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OUTLINE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   scalable outline management API of FreeType~2.\n   *\n   */\n#define FT_OUTLINE_H  <freetype/ftoutln.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SIZES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API which manages multiple @FT_Size objects per face.\n   *\n   */\n#define FT_SIZES_H  <freetype/ftsizes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   module management API of FreeType~2.\n   *\n   */\n#define FT_MODULE_H  <freetype/ftmodapi.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_RENDER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   renderer module management API of FreeType~2.\n   *\n   */\n#define FT_RENDER_H  <freetype/ftrender.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_AUTOHINTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the auto-hinting module.\n   *\n   */\n#define FT_AUTOHINTER_H  <freetype/ftautoh.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CFF_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the CFF driver module.\n   *\n   */\n#define FT_CFF_DRIVER_H  <freetype/ftcffdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the TrueType driver module.\n   *\n   */\n#define FT_TRUETYPE_DRIVER_H  <freetype/ftttdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPE1_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the Type~1 format.\n   *\n   */\n#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_IDS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   enumeration values which identify name strings, languages, encodings,\n   *   etc.  This file really contains a _large_ set of constant macro\n   *   definitions, taken from the TrueType and OpenType specifications.\n   *\n   */\n#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the TrueType (as well as OpenType) format.\n   *\n   */\n#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TAGS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of TrueType four-byte `tags' which identify blocks in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BDF_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which accesses BDF-specific strings from a\n   *   face.\n   *\n   */\n#define FT_BDF_H  <freetype/ftbdf.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CID_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which access CID font information from a\n   *   face.\n   *\n   */\n#define FT_CID_H  <freetype/ftcid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GZIP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports gzip-compressed files.\n   *\n   */\n#define FT_GZIP_H  <freetype/ftgzip.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LZW_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports LZW-compressed files.\n   *\n   */\n#define FT_LZW_H  <freetype/ftlzw.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BZIP2_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports bzip2-compressed files.\n   *\n   */\n#define FT_BZIP2_H  <freetype/ftbzip2.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_WINFONTS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports Windows FNT files.\n   *\n   */\n#define FT_WINFONTS_H   <freetype/ftwinfnt.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GLYPH_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional glyph management component.\n   *\n   */\n#define FT_GLYPH_H  <freetype/ftglyph.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BITMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional bitmap conversion component.\n   *\n   */\n#define FT_BITMAP_H  <freetype/ftbitmap.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BBOX_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional exact bounding box computation routines.\n   *\n   */\n#define FT_BBOX_H  <freetype/ftbbox.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional FreeType~2 cache sub-system.\n   *\n   */\n#define FT_CACHE_H  <freetype/ftcache.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `glyph image' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for @FT_Glyph elements.  You can also\n   *   use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to\n   *   store small glyph bitmaps, as it will use less memory.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   glyph image-related cache declarations.\n   *\n   */\n#define FT_CACHE_IMAGE_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_SMALL_BITMAPS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `small bitmaps' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for small glyph bitmaps in a relatively\n   *   memory-efficient way.  You can also use the API defined in\n   *   @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,\n   *   including scalable outlines.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   small bitmaps-related cache declarations.\n   *\n   */\n#define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_CHARMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `charmap' API of the FreeType~2 cache sub-system.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   charmap-based cache declarations.\n   *\n   */\n#define FT_CACHE_CHARMAP_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MAC_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   Macintosh-specific FreeType~2 API.  The latter is used to access\n   *   fonts embedded in resource forks.\n   *\n   *   This header file must be explicitly included by client applications\n   *   compiled on the Mac (note that the base API still works though).\n   *\n   */\n#define FT_MAC_H  <freetype/ftmac.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MULTIPLE_MASTERS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional multiple-masters management API of FreeType~2.\n   *\n   */\n#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SFNT_NAMES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which accesses embedded `name' strings in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OPENTYPE_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates OpenType tables (BASE, GDEF,\n   *   GPOS, GSUB, JSTF).\n   *\n   */\n#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GX_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,\n   *   mort, morx, bsln, just, kern, opbd, trak, prop).\n   *\n   */\n#define FT_GX_VALIDATE_H  <freetype/ftgxval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_PFR_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which accesses PFR-specific data.\n   *\n   */\n#define FT_PFR_H  <freetype/ftpfr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_STROKER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions to stroke outline paths.\n   */\n#define FT_STROKER_H  <freetype/ftstroke.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYNTHESIS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs artificial obliquing and emboldening.\n   */\n#define FT_SYNTHESIS_H  <freetype/ftsynth.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_XFREE86_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions specific to the XFree86 and\n   *   X.Org X11 servers.\n   */\n#define FT_XFREE86_H  <freetype/ftxf86.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRIGONOMETRY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs trigonometric computations (e.g.,\n   *   cosines and arc tangents).\n   */\n#define FT_TRIGONOMETRY_H  <freetype/fttrigon.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LCD_FILTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_LCD_FILTER_H  <freetype/ftlcdfil.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_UNPATENTED_HINTING_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_UNPATENTED_HINTING_H  <freetype/ttunpat.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_INCREMENTAL_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_INCREMENTAL_H  <freetype/ftincrem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GASP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns entries from the TrueType GASP table.\n   */\n#define FT_GASP_H  <freetype/ftgasp.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ADVANCES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns individual and ranged glyph advances.\n   */\n#define FT_ADVANCES_H  <freetype/ftadvanc.h>\n\n\n  /* */\n\n#define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>\n\n\n  /* The internals of the cache sub-system are no longer exposed.  We */\n  /* default to FT_CACHE_H at the moment just in case, but we know of */\n  /* no rogue client that uses them.                                  */\n  /*                                                                  */\n#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>\n\n\n#define FT_INCREMENTAL_H          <freetype/ftincrem.h>\n\n#define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>\n\n\n  /*\n   * Include internal headers definitions from <freetype/internal/...>\n   * only when building the library.\n   */\n#ifdef FT2_BUILD_LIBRARY\n#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>\n#include FT_INTERNAL_INTERNAL_H\n#endif /* FT2_BUILD_LIBRARY */\n\n\n#endif /* __FT2_BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/config/ftmodule.h",
    "content": "/*\n *  This file registers the FreeType modules compiled into the library.\n *\n *  If you use GNU make, this file IS NOT USED!  Instead, it is created in\n *  the objects directory (normally `<topdir>/objs/') based on information\n *  from `<topdir>/modules.cfg'.\n *\n *  Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile\n *  FreeType without GNU make.\n *\n */\n\nFT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\nFT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\n\n/* EOF */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/config/ftoption.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoption.h                                                             */\n/*                                                                         */\n/*    User-selectable configuration macros (specification only).           */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOPTION_H__\n#define __FTOPTION_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* This file contains the default configuration macro definitions for    */\n  /* a standard build of the FreeType library.  There are three ways to    */\n  /* use this file to build project-specific versions of the library:      */\n  /*                                                                       */\n  /*  - You can modify this file by hand, but this is not recommended in   */\n  /*    cases where you would like to build several versions of the        */\n  /*    library from a single source directory.                            */\n  /*                                                                       */\n  /*  - You can put a copy of this file in your build directory, more      */\n  /*    precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD'   */\n  /*    is the name of a directory that is included _before_ the FreeType  */\n  /*    include path during compilation.                                   */\n  /*                                                                       */\n  /*    The default FreeType Makefiles and Jamfiles use the build          */\n  /*    directory `builds/<system>' by default, but you can easily change  */\n  /*    that for your own projects.                                        */\n  /*                                                                       */\n  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */\n  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */\n  /*    locate this file during the build.  For example,                   */\n  /*                                                                       */\n  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */\n  /*      #include <freetype/config/ftheader.h>                            */\n  /*                                                                       */\n  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */\n  /*    definitions.                                                       */\n  /*                                                                       */\n  /*    Note also that you can similarly pre-define the macro              */\n  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */\n  /*    that are statically linked to the library at compile time.  By     */\n  /*    default, this file is <freetype/config/ftmodule.h>.                */\n  /*                                                                       */\n  /*  We highly recommend using the third method whenever possible.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the line below if you want to activate sub-pixel rendering  */\n  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */\n  /*                                                                       */\n  /* Note that this feature is covered by several Microsoft patents        */\n  /* and should not be activated in any default build of the library.      */\n  /*                                                                       */\n  /* This macro has no impact on the FreeType API, only on its             */\n  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */\n  /* FT_Render_Glyph still generates a bitmap that is 3 times wider than   */\n  /* the original size in case this macro isn't defined; however, each     */\n  /* triplet of subpixels has R=G=B.                                       */\n  /*                                                                       */\n  /* This is done to allow FreeType clients to run unmodified, forcing     */\n  /* them to display normal gray-level anti-aliased glyphs.                */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */\n  /* by FreeType to speed up some computations.  However, this will create */\n  /* some problems when compiling the library in strict ANSI mode.         */\n  /*                                                                       */\n  /* For this reason, the use of 64-bit integers is normally disabled when */\n  /* the __STDC__ macro is defined.  You can however disable this by       */\n  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */\n  /*                                                                       */\n  /* For most compilers, this will only create compilation warnings when   */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* ObNote: The compiler-specific 64-bit integers are detected in the     */\n  /*         file `ftconfig.h' either statically or through the            */\n  /*         `configure' script on supported platforms.                    */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_FORCE_INT64\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, do not try to use an assembler version of   */\n  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */\n  /* that to verify that the assembler function works properly, or to      */\n  /* execute benchmark tests of the various implementations.               */\n/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, try to use an inlined assembler version of  */\n  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */\n  /* hinting glyphs, and which should be executed as fast as possible.     */\n  /*                                                                       */\n  /* Note that if your compiler or CPU is not supported, this will default */\n  /* to the standard and portable implementation found in `ftcalc.c'.      */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INLINE_MULFIX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LZW-compressed file support.                                          */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `compress' program.  This is mostly used to parse many of the PCF   */\n  /*   files that come with various X11 distributions.  The implementation */\n  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */\n  /*   (see src/lzw/ftgzip.c).                                             */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_LZW\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Gzip-compressed file support.                                         */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `gzip' program.  This is mostly used to parse many of the PCF files */\n  /*   that come with XFree86.  The implementation uses `zlib' to          */\n  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.  See also   */\n  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_ZLIB\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ZLib library selection                                                */\n  /*                                                                       */\n  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */\n  /*   It allows FreeType's `ftgzip' component to link to the system's     */\n  /*   installation of the ZLib library.  This is useful on systems like   */\n  /*   Unix or VMS where it generally is already available.                */\n  /*                                                                       */\n  /*   If you let it undefined, the component will use its own copy        */\n  /*   of the zlib sources instead.  These have been modified to be        */\n  /*   included directly within the component and *not* export external    */\n  /*   function names.  This allows you to link any program with FreeType  */\n  /*   _and_ ZLib without linking conflicts.                               */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bzip2-compressed file support.                                        */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `bzip2' program.  This is mostly used to parse many of the PCF      */\n  /*   files that come with XFree86.  The implementation uses `libbz2' to  */\n  /*   partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */\n  /*   Contrary to gzip, bzip2 currently is not included and need to use   */\n  /*   the system available bzip2 implementation.                          */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_BZIP2 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define to disable the use of file stream functions and types, FILE,   */\n  /* fopen() etc.  Enables the use of smaller system libraries on embedded */\n  /* systems that have multiple system libraries, some with or without     */\n  /* file stream support, in the cases where file stream support is not    */\n  /* necessary such as memory loading of font files.                       */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  PNG bitmap support.                                                  */\n  /*                                                                       */\n  /*   FreeType now handles loading color bitmap glyphs in the PNG format. */\n  /*   This requires help from the external libpng library.  Uncompressed  */\n  /*   color bitmaps do not need any external libraries and will be        */\n  /*   supported regardless of this configuration.                         */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_PNG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DLL export compilation                                                */\n  /*                                                                       */\n  /*   When compiling FreeType as a DLL, some systems/compilers need a     */\n  /*   special keyword in front OR after the return type of function       */\n  /*   declarations.                                                       */\n  /*                                                                       */\n  /*   Two macros are used within the FreeType source code to define       */\n  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */\n  /*                                                                       */\n  /*     FT_EXPORT( return_type )                                          */\n  /*                                                                       */\n  /*       is used in a function declaration, as in                        */\n  /*                                                                       */\n  /*         FT_EXPORT( FT_Error )                                         */\n  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */\n  /*                                                                       */\n  /*                                                                       */\n  /*     FT_EXPORT_DEF( return_type )                                      */\n  /*                                                                       */\n  /*       is used in a function definition, as in                         */\n  /*                                                                       */\n  /*         FT_EXPORT_DEF( FT_Error )                                     */\n  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */\n  /*         {                                                             */\n  /*           ... some code ...                                           */\n  /*           return FT_Err_Ok;                                           */\n  /*         }                                                             */\n  /*                                                                       */\n  /*   You can provide your own implementation of FT_EXPORT and            */\n  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */\n  /*   will be later automatically defined as `extern return_type' to      */\n  /*   allow normal compilation.                                           */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_EXPORT(x)      extern x */\n/* #define FT_EXPORT_DEF(x)  x */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Glyph Postscript Names handling                                       */\n  /*                                                                       */\n  /*   By default, FreeType 2 is compiled with the `psnames' module.  This */\n  /*   module is in charge of converting a glyph name string into a        */\n  /*   Unicode value, or return a Macintosh standard glyph name for the    */\n  /*   use with the TrueType `post' table.                                 */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want `psnames' compiled in your   */\n  /*   build of FreeType.  This has the following effects:                 */\n  /*                                                                       */\n  /*   - The TrueType driver will provide its own set of glyph names,      */\n  /*     if you build it to support postscript names in the TrueType       */\n  /*     `post' table.                                                     */\n  /*                                                                       */\n  /*   - The Type 1 driver will not be able to synthesize a Unicode        */\n  /*     charmap out of the glyphs found in the fonts.                     */\n  /*                                                                       */\n  /*   You would normally undefine this configuration macro when building  */\n  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Postscript Names to Unicode Values support                            */\n  /*                                                                       */\n  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */\n  /*   in.  Among other things, the module is used to convert a glyph name */\n  /*   into a Unicode value.  This is especially useful in order to        */\n  /*   synthesize on the fly a Unicode charmap from the CFF/Type 1 driver  */\n  /*   through a big table named the `Adobe Glyph List' (AGL).             */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want the Adobe Glyph List         */\n  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */\n  /*   able to synthesize a Unicode charmap out of the glyphs found in the */\n  /*   fonts.                                                              */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for Mac fonts                                                 */\n  /*                                                                       */\n  /*   Define this macro if you want support for outline fonts in Mac      */\n  /*   format (mac dfont, mac resource, macbinary containing a mac         */\n  /*   resource) on non-Mac platforms.                                     */\n  /*                                                                       */\n  /*   Note that the `FOND' resource isn't checked.                        */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_MAC_FONTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Guessing methods to access embedded resource forks                    */\n  /*                                                                       */\n  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */\n  /*   GNU/Linux).                                                         */\n  /*                                                                       */\n  /*   Resource forks which include fonts data are stored sometimes in     */\n  /*   locations which users or developers don't expected.  In some cases, */\n  /*   resource forks start with some offset from the head of a file.  In  */\n  /*   other cases, the actual resource fork is stored in file different   */\n  /*   from what the user specifies.  If this option is activated,         */\n  /*   FreeType tries to guess whether such offsets or different file      */\n  /*   names must be used.                                                 */\n  /*                                                                       */\n  /*   Note that normal, direct access of resource forks is controlled via */\n  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */\n  /*                                                                       */\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Allow the use of FT_Incremental_Interface to load typefaces that      */\n  /* contain no glyph data, but supply it via a callback function.         */\n  /* This is required by clients supporting document formats which         */\n  /* supply font data incrementally as the document is parsed, such        */\n  /* as the Ghostscript interpreter for the PostScript language.           */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INCREMENTAL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The size in bytes of the render pool used by the scan-line converter  */\n  /* to do all of its work.                                                */\n  /*                                                                       */\n  /* This must be greater than 4KByte if you use FreeType to rasterize     */\n  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */\n  /* allocation of the render pool.                                        */\n  /*                                                                       */\n#define FT_RENDER_POOL_SIZE  16384L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MAX_MODULES                                                        */\n  /*                                                                       */\n  /*   The maximum number of modules that can be registered in a single    */\n  /*   FreeType library object.  32 is the default.                        */\n  /*                                                                       */\n#define FT_MAX_MODULES  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Debug level                                                           */\n  /*                                                                       */\n  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */\n  /*   errors are reported through the `ftdebug' component.  In trace      */\n  /*   mode, additional messages are sent to the standard output during    */\n  /*   execution.                                                          */\n  /*                                                                       */\n  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */\n  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */\n  /*                                                                       */\n  /*   Don't define any of these macros to compile in `release' mode!      */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_LEVEL_ERROR */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Autofitter debugging                                                  */\n  /*                                                                       */\n  /*   If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to     */\n  /*   control the autofitter behaviour for debugging purposes with global */\n  /*   boolean variables (consequently, you should *never* enable this     */\n  /*   while compiling in `release' mode):                                 */\n  /*                                                                       */\n  /*     _af_debug_disable_horz_hints                                      */\n  /*     _af_debug_disable_vert_hints                                      */\n  /*     _af_debug_disable_blue_hints                                      */\n  /*                                                                       */\n  /*   Additionally, the following functions provide dumps of various      */\n  /*   internal autofit structures to stdout (using `printf'):             */\n  /*                                                                       */\n  /*     af_glyph_hints_dump_points                                        */\n  /*     af_glyph_hints_dump_segments                                      */\n  /*     af_glyph_hints_dump_edges                                         */\n  /*                                                                       */\n  /*   As an argument, they use another global variable:                   */\n  /*                                                                       */\n  /*     _af_debug_hints                                                   */\n  /*                                                                       */\n  /*   Please have a look at the `ftgrid' demo program to see how those    */\n  /*   variables and macros should be used.                                */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_AUTOFIT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Memory Debugging                                                      */\n  /*                                                                       */\n  /*   FreeType now comes with an integrated memory debugger that is       */\n  /*   capable of detecting simple errors like memory leaks or double      */\n  /*   deletes.  To compile it within your build of the library, you       */\n  /*   should define FT_DEBUG_MEMORY here.                                 */\n  /*                                                                       */\n  /*   Note that the memory debugger is only activated at runtime when     */\n  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_DEBUG_MEMORY */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Module errors                                                         */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), the higher byte  */\n  /*   of an error code gives the module in which the error has occurred,  */\n  /*   while the lower byte is the real error code.                        */\n  /*                                                                       */\n  /*   Setting this macro makes sense for debugging purposes only, since   */\n  /*   it would break source compatibility of certain programs that use    */\n  /*   FreeType 2.                                                         */\n  /*                                                                       */\n  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Position Independent Code                                             */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), FreeType2 will   */\n  /*   avoid creating constants that require address fixups.  Instead the  */\n  /*   constants will be moved into a struct and additional intialization  */\n  /*   code will be used.                                                  */\n  /*                                                                       */\n  /*   Setting this macro is needed for systems that prohibit address      */\n  /*   fixups, such as BREW.                                               */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */\n  /* embedded bitmaps in all formats using the SFNT module (namely         */\n  /* TrueType & OpenType).                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */\n  /* load and enumerate the glyph Postscript names in a TrueType or        */\n  /* OpenType file.                                                        */\n  /*                                                                       */\n  /* Note that when you do not compile the `PSNames' module by undefining  */\n  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */\n  /* contain additional code used to read the PS Names table from a font.  */\n  /*                                                                       */\n  /* (By default, the module uses `PSNames' to extract glyph names.)       */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */\n  /* access the internal name table in a SFNT-based format like TrueType   */\n  /* or OpenType.  The name table contains various strings used to         */\n  /* describe the font, like family name, copyright, version, etc.  It     */\n  /* does not contain any glyph name though.                               */\n  /*                                                                       */\n  /* Accessing SFNT names is done through the functions declared in        */\n  /* `freetype/ftsnames.h'.                                                */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType CMap support                                                 */\n  /*                                                                       */\n  /*   Here you can fine-tune which TrueType CMap table format shall be    */\n  /*   supported.                                                          */\n#define TT_CONFIG_CMAP_FORMAT_0\n#define TT_CONFIG_CMAP_FORMAT_2\n#define TT_CONFIG_CMAP_FORMAT_4\n#define TT_CONFIG_CMAP_FORMAT_6\n#define TT_CONFIG_CMAP_FORMAT_8\n#define TT_CONFIG_CMAP_FORMAT_10\n#define TT_CONFIG_CMAP_FORMAT_12\n#define TT_CONFIG_CMAP_FORMAT_13\n#define TT_CONFIG_CMAP_FORMAT_14\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */\n  /* a bytecode interpreter in the TrueType driver.                        */\n  /*                                                                       */\n  /* By undefining this, you will only compile the code necessary to load  */\n  /* TrueType glyphs without hinting.                                      */\n  /*                                                                       */\n  /*   Do not #undef this macro here, since the build system might         */\n  /*   define it for certain configurations only.                          */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile       */\n  /* EXPERIMENTAL subpixel hinting support into the TrueType driver.  This */\n  /* replaces the native TrueType hinting mechanism when anything but      */\n  /* FT_RENDER_MODE_MONO is requested.                                     */\n  /*                                                                       */\n  /* Enabling this causes the TrueType driver to ignore instructions under */\n  /* certain conditions.  This is done in accordance with the guide here,  */\n  /* with some minor differences:                                          */\n  /*                                                                       */\n  /*  http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */\n  /*                                                                       */\n  /* By undefining this, you only compile the code necessary to hint       */\n  /* TrueType glyphs with native TT hinting.                               */\n  /*                                                                       */\n  /*   This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */\n  /*   defined.                                                            */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */\n  /* of the TrueType bytecode interpreter is used that doesn't implement   */\n  /* any of the patented opcodes and algorithms.  The patents related to   */\n  /* TrueType hinting have expired worldwide since May 2010; this option   */\n  /* is now deprecated.                                                    */\n  /*                                                                       */\n  /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored*  */\n  /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words,  */\n  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */\n  /*                                                                       */\n  /* This macro is only useful for a small number of font files (mostly    */\n  /* for Asian scripts) that require bytecode interpretation to properly   */\n  /* load glyphs.  For all other fonts, this produces unpleasant results,  */\n  /* thus the unpatented interpreter is never used to load glyphs from     */\n  /* TrueType fonts unless one of the following two options is used.       */\n  /*                                                                       */\n  /*   - The unpatented interpreter is explicitly activated by the user    */\n  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */\n  /*     when opening the FT_Face.                                         */\n  /*                                                                       */\n  /*   - FreeType detects that the FT_Face corresponds to one of the       */\n  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */\n  /*     contains a hard-coded list of font names and other matching       */\n  /*     parameters (see function `tt_face_init' in file                   */\n  /*     `src/truetype/ttobjs.c').                                         */\n  /*                                                                       */\n  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     FT_Parameter  parameter;                                          */\n  /*     FT_Open_Args  open_args;                                          */\n  /*                                                                       */\n  /*                                                                       */\n  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */\n  /*                                                                       */\n  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */\n  /*     open_args.pathname   = my_font_pathname;                          */\n  /*     open_args.num_params = 1;                                         */\n  /*     open_args.params     = &parameter;                                */\n  /*                                                                       */\n  /*     error = FT_Open_Face( library, &open_args, index, &face );        */\n  /*     ...                                                               */\n  /*   }                                                                   */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */\n  /* bytecode interpreter with a huge switch statement, rather than a call */\n  /* table.  This results in smaller and faster code for a number of       */\n  /* architectures.                                                        */\n  /*                                                                       */\n  /* Note however that on some compiler/processor combinations, undefining */\n  /* this macro will generate faster, though larger, code.                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */\n  /* TrueType glyph loader to use Apple's definition of how to handle      */\n  /* component offsets in composite glyphs.                                */\n  /*                                                                       */\n  /* Apple and MS disagree on the default behavior of component offsets    */\n  /* in composites.  Apple says that they should be scaled by the scaling  */\n  /* factors in the transformation matrix (roughly, it's more complex)     */\n  /* while MS says they should not.  OpenType defines two bits in the      */\n  /* composite flags array which can be used to disambiguate, but old      */\n  /* fonts will not have them.                                             */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/otspec/glyf.htm                 */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */\n  /*                                                                       */\n#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */\n  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */\n  /* and avar tables).  This has many similarities to Type 1 Multiple      */\n  /* Masters support.                                                      */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */\n  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BDF\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and       */\n  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */\n  /* required.                                                             */\n  /*                                                                       */\n#define T1_MAX_DICT_DEPTH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  256\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */\n  /* files into an existing face.  Note that if set, the T1 driver will be */\n  /* unable to produce kerning distances.                                  */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_AFM\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of the Multiple Masters font support in the Type 1        */\n  /* driver.                                                               */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF       */\n  /* engine gets compiled into FreeType.  If defined, it is possible to    */\n  /* switch between the two engines using the `hinting-engine' property of */\n  /* the cff driver module.                                                */\n  /*                                                                       */\n/* #define CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with CJK (Chinese, Japanese, Korean) script    */\n  /* support.                                                              */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_CJK\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with Indic script support.                     */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_INDIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with warp hinting.  The idea of the warping    */\n  /* code is to slightly scale and shift a glyph within a single dimension */\n  /* so that as much of its segments are aligned (more or less) on the     */\n  /* grid.  To find out the optimal scaling and shifting value, various    */\n  /* parameter combinations are tried and scored.                          */\n  /*                                                                       */\n  /* This experimental option is only active if the render mode is         */\n  /* FT_RENDER_MODE_LIGHT.                                                 */\n  /*                                                                       */\n/* #define AF_CONFIG_OPTION_USE_WARPER */\n\n  /* */\n\n\n  /*\n   *  This macro is obsolete.  Support has been removed in FreeType\n   *  version 2.5.\n   */\n/* #define FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*\n   * This macro is defined if either unpatented or native TrueType\n   * hinting is requested by the definitions above.\n   */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n#define  TT_USE_BYTECODE_INTERPRETER\n#undef   TT_CONFIG_OPTION_UNPATENTED_HINTING\n#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define  TT_USE_BYTECODE_INTERPRETER\n#endif\n\nFT_END_HEADER\n\n\n#endif /* __FTOPTION_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/config/ftstdlib.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstdlib.h                                                             */\n/*                                                                         */\n/*    ANSI-specific library and header configuration file (specification   */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2002-2007, 2009, 2011-2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to group all #includes to the ANSI C library that   */\n  /* FreeType normally requires.  It also defines macros to rename the     */\n  /* standard functions within the FreeType source code.                   */\n  /*                                                                       */\n  /* Load a file which defines __FTSTDLIB_H__ before this one to override  */\n  /* it.                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSTDLIB_H__\n#define __FTSTDLIB_H__\n\n\n#include <stddef.h>\n\n#define ft_ptrdiff_t  ptrdiff_t\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           integer limits                           */\n  /*                                                                    */\n  /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */\n  /* of `int' and `long' in bytes at compile-time.  So far, this works  */\n  /* for all platforms the library has been tested on.                  */\n  /*                                                                    */\n  /* Note that on the extremely rare platforms that do not provide      */\n  /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */\n  /* old Crays where `int' is 36 bits), we do not make any guarantee    */\n  /* about the correct behaviour of FT2 with all fonts.                 */\n  /*                                                                    */\n  /* In these case, `ftconfig.h' will refuse to compile anyway with a   */\n  /* message like `couldn't find 32-bit type' or something similar.     */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <limits.h>\n\n#define FT_CHAR_BIT    CHAR_BIT\n#define FT_USHORT_MAX  USHRT_MAX\n#define FT_INT_MAX     INT_MAX\n#define FT_INT_MIN     INT_MIN\n#define FT_UINT_MAX    UINT_MAX\n#define FT_ULONG_MAX   ULONG_MAX\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                 character and string processing                    */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <string.h>\n\n#define ft_memchr   memchr\n#define ft_memcmp   memcmp\n#define ft_memcpy   memcpy\n#define ft_memmove  memmove\n#define ft_memset   memset\n#define ft_strcat   strcat\n#define ft_strcmp   strcmp\n#define ft_strcpy   strcpy\n#define ft_strlen   strlen\n#define ft_strncmp  strncmp\n#define ft_strncpy  strncpy\n#define ft_strrchr  strrchr\n#define ft_strstr   strstr\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           file handling                            */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdio.h>\n\n#define FT_FILE     FILE\n#define ft_fclose   fclose\n#define ft_fopen    fopen\n#define ft_fread    fread\n#define ft_fseek    fseek\n#define ft_ftell    ftell\n#define ft_sprintf  sprintf\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                             sorting                                */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdlib.h>\n\n#define ft_qsort  qsort\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                        memory allocation                           */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_scalloc   calloc\n#define ft_sfree     free\n#define ft_smalloc   malloc\n#define ft_srealloc  realloc\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                          miscellaneous                             */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_atol   atol\n#define ft_labs   labs\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                         execution control                          */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <setjmp.h>\n\n#define ft_jmp_buf     jmp_buf  /* note: this cannot be a typedef since */\n                                /*       jmp_buf is defined as a macro  */\n                                /*       on certain platforms           */\n\n#define ft_longjmp     longjmp\n#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */\n\n\n  /* the following is only used for debugging purposes, i.e., if */\n  /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined    */\n\n#include <stdarg.h>\n\n\n#endif /* __FTSTDLIB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/freetype.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  freetype.h                                                             */\n/*                                                                         */\n/*    FreeType high-level API and common types (specification only).       */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FREETYPE_H__\n#define __FREETYPE_H__\n\n\n#ifndef FT_FREETYPE_H\n#error \"`ft2build.h' hasn't been included yet!\"\n#error \"Please always use macros to include FreeType header files.\"\n#error \"Example:\"\n#error \"  #include <ft2build.h>\"\n#error \"  #include FT_FREETYPE_H\"\n#endif\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n#include FT_ERRORS_H\n\n\nFT_BEGIN_HEADER\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    user_allocation                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    User allocation                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should allocate FreeType data structures.  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType assumes that structures allocated by the user and passed  */\n  /*    as arguments are zeroed out except for the actual data.  In other  */\n  /*    words, it is recommended to use `calloc' (or variants of it)       */\n  /*    instead of `malloc' for allocation.                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        B A S I C   T Y P E S                          */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Base Interface                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 base font interface.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section describes the public high-level API of FreeType~2.    */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library                                                         */\n  /*    FT_Face                                                            */\n  /*    FT_Size                                                            */\n  /*    FT_GlyphSlot                                                       */\n  /*    FT_CharMap                                                         */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SCALABLE                                              */\n  /*    FT_FACE_FLAG_FIXED_SIZES                                           */\n  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */\n  /*    FT_FACE_FLAG_HORIZONTAL                                            */\n  /*    FT_FACE_FLAG_VERTICAL                                              */\n  /*    FT_FACE_FLAG_SFNT                                                  */\n  /*    FT_FACE_FLAG_KERNING                                               */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */\n  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */\n  /*    FT_FACE_FLAG_HINTER                                                */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD                                                 */\n  /*    FT_STYLE_FLAG_ITALIC                                               */\n  /*                                                                       */\n  /*    FT_SizeRec                                                         */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /*    FT_GlyphSlotRec                                                    */\n  /*    FT_Glyph_Metrics                                                   */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /*    FT_Init_FreeType                                                   */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /*    FT_New_Face                                                        */\n  /*    FT_Done_Face                                                       */\n  /*    FT_New_Memory_Face                                                 */\n  /*    FT_Open_Face                                                       */\n  /*    FT_Open_Args                                                       */\n  /*    FT_Parameter                                                       */\n  /*    FT_Attach_File                                                     */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /*    FT_Set_Char_Size                                                   */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*    FT_Request_Size                                                    */\n  /*    FT_Select_Size                                                     */\n  /*    FT_Size_Request_Type                                               */\n  /*    FT_Size_Request                                                    */\n  /*    FT_Set_Transform                                                   */\n  /*    FT_Load_Glyph                                                      */\n  /*    FT_Get_Char_Index                                                  */\n  /*    FT_Get_Name_Index                                                  */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /*    FT_OPEN_MEMORY                                                     */\n  /*    FT_OPEN_STREAM                                                     */\n  /*    FT_OPEN_PATHNAME                                                   */\n  /*    FT_OPEN_DRIVER                                                     */\n  /*    FT_OPEN_PARAMS                                                     */\n  /*                                                                       */\n  /*    FT_LOAD_DEFAULT                                                    */\n  /*    FT_LOAD_RENDER                                                     */\n  /*    FT_LOAD_MONOCHROME                                                 */\n  /*    FT_LOAD_LINEAR_DESIGN                                              */\n  /*    FT_LOAD_NO_SCALE                                                   */\n  /*    FT_LOAD_NO_HINTING                                                 */\n  /*    FT_LOAD_NO_BITMAP                                                  */\n  /*    FT_LOAD_CROP_BITMAP                                                */\n  /*                                                                       */\n  /*    FT_LOAD_VERTICAL_LAYOUT                                            */\n  /*    FT_LOAD_IGNORE_TRANSFORM                                           */\n  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */\n  /*    FT_LOAD_FORCE_AUTOHINT                                             */\n  /*    FT_LOAD_NO_RECURSE                                                 */\n  /*    FT_LOAD_PEDANTIC                                                   */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_NORMAL                                              */\n  /*    FT_LOAD_TARGET_LIGHT                                               */\n  /*    FT_LOAD_TARGET_MONO                                                */\n  /*    FT_LOAD_TARGET_LCD                                                 */\n  /*    FT_LOAD_TARGET_LCD_V                                               */\n  /*                                                                       */\n  /*    FT_Render_Glyph                                                    */\n  /*    FT_Render_Mode                                                     */\n  /*    FT_Get_Kerning                                                     */\n  /*    FT_Kerning_Mode                                                    */\n  /*    FT_Get_Track_Kerning                                               */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /*    FT_CharMapRec                                                      */\n  /*    FT_Select_Charmap                                                  */\n  /*    FT_Set_Charmap                                                     */\n  /*    FT_Get_Charmap_Index                                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING                                    */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING                             */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING                              */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING                                            */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY                                    */\n  /*                                                                       */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Glyph_Metrics                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the metrics of a single glyph.  The      */\n  /*    values are expressed in 26.6 fractional pixel format; if the flag  */\n  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */\n  /*    are expressed in font units instead.                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width ::                                                           */\n  /*      The glyph's width.                                               */\n  /*                                                                       */\n  /*    height ::                                                          */\n  /*      The glyph's height.                                              */\n  /*                                                                       */\n  /*    horiBearingX ::                                                    */\n  /*      Left side bearing for horizontal layout.                         */\n  /*                                                                       */\n  /*    horiBearingY ::                                                    */\n  /*      Top side bearing for horizontal layout.                          */\n  /*                                                                       */\n  /*    horiAdvance ::                                                     */\n  /*      Advance width for horizontal layout.                             */\n  /*                                                                       */\n  /*    vertBearingX ::                                                    */\n  /*      Left side bearing for vertical layout.                           */\n  /*                                                                       */\n  /*    vertBearingY ::                                                    */\n  /*      Top side bearing for vertical layout.  Larger positive values    */\n  /*      mean further below the vertical glyph origin.                    */\n  /*                                                                       */\n  /*    vertAdvance ::                                                     */\n  /*      Advance height for vertical layout.  Positive values mean the    */\n  /*      glyph has a positive advance downward.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */\n  /*    dimensions of the hinted glyph (in case hinting is applicable).    */\n  /*                                                                       */\n  /*    Stroking a glyph with an outside border does not increase          */\n  /*    `horiAdvance' or `vertAdvance'; you have to manually adjust these  */\n  /*    values to account for the added width and height.                  */\n  /*                                                                       */\n  typedef struct  FT_Glyph_Metrics_\n  {\n    FT_Pos  width;\n    FT_Pos  height;\n\n    FT_Pos  horiBearingX;\n    FT_Pos  horiBearingY;\n    FT_Pos  horiAdvance;\n\n    FT_Pos  vertBearingX;\n    FT_Pos  vertBearingY;\n    FT_Pos  vertAdvance;\n\n  } FT_Glyph_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure models the metrics of a bitmap strike (i.e., a set  */\n  /*    of glyphs for a given point size and resolution) in a bitmap font. */\n  /*    It is used for the `available_sizes' field of @FT_Face.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height :: The vertical distance, in pixels, between two            */\n  /*              consecutive baselines.  It is always positive.           */\n  /*                                                                       */\n  /*    width  :: The average width, in pixels, of all glyphs in the       */\n  /*              strike.                                                  */\n  /*                                                                       */\n  /*    size   :: The nominal size of the strike in 26.6 fractional        */\n  /*              points.  This field is not very useful.                  */\n  /*                                                                       */\n  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Windows FNT:                                                       */\n  /*      The nominal size given in a FNT font is not reliable.  Thus when */\n  /*      the driver finds it incorrect, it sets `size' to some calculated */\n  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */\n  /*      height given in the font, respectively.                          */\n  /*                                                                       */\n  /*    TrueType embedded bitmaps:                                         */\n  /*      `size', `width', and `height' values are not contained in the    */\n  /*      bitmap strike itself.  They are computed from the global font    */\n  /*      parameters.                                                      */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_Size_\n  {\n    FT_Short  height;\n    FT_Short  width;\n\n    FT_Pos    size;\n\n    FT_Pos    x_ppem;\n    FT_Pos    y_ppem;\n\n  } FT_Bitmap_Size;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     O B J E C T   C L A S S E S                       */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Library                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a FreeType library instance.  Each `library' is        */\n  /*    completely independent from the others; it is the `root' of a set  */\n  /*    of objects like fonts, faces, sizes, etc.                          */\n  /*                                                                       */\n  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */\n  /*    scan-line converter object (see @FT_Raster).                       */\n  /*                                                                       */\n  /*    In multi-threaded applications, make sure that the same FT_Library */\n  /*    object or any of its children doesn't get accessed in parallel.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Library objects are normally created by @FT_Init_FreeType, and     */\n  /*    destroyed with @FT_Done_FreeType.  If you need reference-counting  */\n  /*    (cf. @FT_Reference_Library), use @FT_New_Library and               */\n  /*    @FT_Done_Library.                                                  */\n  /*                                                                       */\n  typedef struct FT_LibraryRec_  *FT_Library;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Module                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType module object.  Each module can be a  */\n  /*    font driver, a renderer, or anything else that provides services   */\n  /*    to the formers.                                                    */\n  /*                                                                       */\n  typedef struct FT_ModuleRec_*  FT_Module;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType font driver object.  Each font driver */\n  /*    is a special module capable of creating faces from font files.     */\n  /*                                                                       */\n  typedef struct FT_DriverRec_*  FT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Renderer                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType renderer.  A renderer is a special    */\n  /*    module in charge of converting a glyph image to a bitmap, when     */\n  /*    necessary.  Each renderer supports a given glyph image format, and */\n  /*    one or more target surface depths.                                 */\n  /*                                                                       */\n  typedef struct FT_RendererRec_*  FT_Renderer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given typographic face object.  A face object models */\n  /*    a given typeface, in a given style.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */\n  /*    as one or more @FT_Size objects.                                   */\n  /*                                                                       */\n  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */\n  /*    a given filepathname or a custom input stream.                     */\n  /*                                                                       */\n  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_FaceRec for the publicly accessible fields of a given face */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_FaceRec_*  FT_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a face scaled to a given       */\n  /*    character size.                                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */\n  /*    functions like @FT_Load_Glyph to determine the scaling             */\n  /*    transformation which is used to load and hint glyphs and metrics.  */\n  /*                                                                       */\n  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */\n  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */\n  /*    (i.e., the scaling values) of the active @FT_Size.                 */\n  /*                                                                       */\n  /*    You can use @FT_New_Size to create additional size objects for a   */\n  /*    given @FT_Face, but they won't be used by other functions until    */\n  /*    you activate it through @FT_Activate_Size.  Only one size can be   */\n  /*    activated at any given time per face.                              */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_SizeRec for the publicly accessible fields of a given size */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_SizeRec_*  FT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given `glyph slot'.  A slot is a container where it  */\n  /*    is possible to load any of the glyphs contained in its parent      */\n  /*    face.                                                              */\n  /*                                                                       */\n  /*    In other words, each time you call @FT_Load_Glyph or               */\n  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */\n  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */\n  /*    other control information.                                         */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_GlyphSlotRec for the publicly accessible glyph fields.     */\n  /*                                                                       */\n  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given character map.  A charmap is used to translate */\n  /*    character codes in a given encoding into glyph indexes for its     */\n  /*    parent's face.  Some font formats may provide several charmaps per */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    Each face object owns zero or more charmaps, but only one of them  */\n  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */\n  /*                                                                       */\n  /*    The list of available charmaps in a face is available through the  */\n  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    The currently active charmap is available as `face->charmap'.      */\n  /*    You should call @FT_Set_Charmap to change it.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When a new face is created (either through @FT_New_Face or         */\n  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */\n  /*    the list and automatically activates it.                           */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_CharMapRec for the publicly accessible fields of a given   */\n  /*    character map.                                                     */\n  /*                                                                       */\n  typedef struct FT_CharMapRec_*  FT_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags into an unsigned long.  It is */\n  /*    used to define `encoding' identifiers (see @FT_Encoding).          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n\n#ifndef FT_ENC_TAG\n#define FT_ENC_TAG( value, a, b, c, d )         \\\n          value = ( ( (FT_UInt32)(a) << 24 ) |  \\\n                    ( (FT_UInt32)(b) << 16 ) |  \\\n                    ( (FT_UInt32)(c) <<  8 ) |  \\\n                      (FT_UInt32)(d)         )\n\n#endif /* FT_ENC_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify character sets supported by         */\n  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Despite the name, this enumeration lists specific character        */\n  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */\n  /*    UTF-8, UTF-16, etc.).                                              */\n  /*                                                                       */\n  /*    Other encodings might be defined in the future.                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_ENCODING_NONE ::                                                */\n  /*      The encoding value~0 is reserved.                                */\n  /*                                                                       */\n  /*    FT_ENCODING_UNICODE ::                                             */\n  /*      Corresponds to the Unicode character set.  This value covers     */\n  /*      all versions of the Unicode repertoire, including ASCII and      */\n  /*      Latin-1.  Most fonts include a Unicode charmap, but not all      */\n  /*      of them.                                                         */\n  /*                                                                       */\n  /*      For example, if you want to access Unicode value U+1F028 (and    */\n  /*      the font contains it), use value 0x1F028 as the input value for  */\n  /*      @FT_Get_Char_Index.                                              */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SYMBOL ::                                           */\n  /*      Corresponds to the Microsoft Symbol encoding, used to encode     */\n  /*      mathematical symbols in the 32..255 character code range.  For   */\n  /*      more information, see `http://www.ceviz.net/symbol.htm'.         */\n  /*                                                                       */\n  /*    FT_ENCODING_SJIS ::                                                */\n  /*      Corresponds to Japanese SJIS encoding.  More info at             */\n  /*      at `http://langsupport.japanreference.com/encoding.shtml'.       */\n  /*      See note on multi-byte encodings below.                          */\n  /*                                                                       */\n  /*    FT_ENCODING_GB2312 ::                                              */\n  /*      Corresponds to an encoding system for Simplified Chinese as used */\n  /*      used in mainland China.                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_BIG5 ::                                                */\n  /*      Corresponds to an encoding system for Traditional Chinese as     */\n  /*      used in Taiwan and Hong Kong.                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_WANSUNG ::                                             */\n  /*      Corresponds to the Korean encoding system known as Wansung.      */\n  /*      For more information see                                         */\n  /*      `http://www.microsoft.com/typography/unicode/949.txt'.           */\n  /*                                                                       */\n  /*    FT_ENCODING_JOHAB ::                                               */\n  /*      The Korean standard character set (KS~C 5601-1992), which        */\n  /*      corresponds to MS Windows code page 1361.  This character set    */\n  /*      includes all possible Hangeul character combinations.            */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_LATIN_1 ::                                       */\n  /*      Corresponds to a Latin-1 encoding as defined in a Type~1         */\n  /*      PostScript font.  It is limited to 256 character codes.          */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_STANDARD ::                                      */\n  /*      Corresponds to the Adobe Standard encoding, as found in Type~1,  */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_EXPERT ::                                        */\n  /*      Corresponds to the Adobe Expert encoding, as found in Type~1,    */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_CUSTOM ::                                        */\n  /*      Corresponds to a custom encoding, as found in Type~1, CFF, and   */\n  /*      OpenType/CFF fonts.  It is limited to 256 character codes.       */\n  /*                                                                       */\n  /*    FT_ENCODING_APPLE_ROMAN ::                                         */\n  /*      Corresponds to the 8-bit Apple roman encoding.  Many TrueType    */\n  /*      and OpenType fonts contain a charmap for this encoding, since    */\n  /*      older versions of Mac OS are able to use it.                     */\n  /*                                                                       */\n  /*    FT_ENCODING_OLD_LATIN_2 ::                                         */\n  /*      This value is deprecated and was never used nor reported by      */\n  /*      FreeType.  Don't use or test for it.                             */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SJIS ::                                             */\n  /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_GB2312 ::                                           */\n  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_BIG5 ::                                             */\n  /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_WANSUNG ::                                          */\n  /*      Same as FT_ENCODING_WANSUNG.  Deprecated.                        */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_JOHAB ::                                            */\n  /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    By default, FreeType automatically synthesizes a Unicode charmap   */\n  /*    for PostScript fonts, using their glyph names dictionaries.        */\n  /*    However, it also reports the encodings defined explicitly in the   */\n  /*    font file, for the cases when they are needed, with the Adobe      */\n  /*    values as well.                                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */\n  /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */\n  /*    FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out      */\n  /*    which encoding is really present.  If, for example, the            */\n  /*    `cs_registry' field is `KOI8' and the `cs_encoding' field is `R',  */\n  /*    the font is encoded in KOI8-R.                                     */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is always set (with a single exception) by the    */\n  /*    winfonts driver.  Use @FT_Get_WinFNT_Header and examine the        */\n  /*    `charset' field of the @FT_WinFNT_HeaderRec structure to find out  */\n  /*    which encoding is really present.  For example,                    */\n  /*    @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for       */\n  /*    Russian).                                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */\n  /*    and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to  */\n  /*    FT_ENCODING_APPLE_ROMAN).                                          */\n  /*                                                                       */\n  /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */\n  /*    @FT_Get_CMap_Language_ID  to query the Mac language ID which may   */\n  /*    be needed to be able to distinguish Apple encoding variants.  See  */\n  /*                                                                       */\n  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT  */\n  /*                                                                       */\n  /*    to get an idea how to do that.  Basically, if the language ID      */\n  /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */\n  /*    Then examine `encoding_id'.  If, for example, `encoding_id' is     */\n  /*    @TT_MAC_ID_ROMAN and the language ID (minus~1) is                  */\n  /*    `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.        */\n  /*    @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi       */\n  /*    variant the Arabic encoding.                                       */\n  /*                                                                       */\n  typedef enum  FT_Encoding_\n  {\n    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),\n\n    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),\n    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),\n\n    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),\n    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),\n    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),\n    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),\n    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),\n\n    /* for backwards compatibility */\n    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,\n    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,\n    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,\n    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,\n    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,\n\n    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),\n\n    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),\n\n    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )\n\n  } FT_Encoding;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_encoding_xxx                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated; use the corresponding @FT_Encoding */\n  /*    values instead.                                                    */\n  /*                                                                       */\n#define ft_encoding_none            FT_ENCODING_NONE\n#define ft_encoding_unicode         FT_ENCODING_UNICODE\n#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL\n#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1\n#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2\n#define ft_encoding_sjis            FT_ENCODING_SJIS\n#define ft_encoding_gb2312          FT_ENCODING_GB2312\n#define ft_encoding_big5            FT_ENCODING_BIG5\n#define ft_encoding_wansung         FT_ENCODING_WANSUNG\n#define ft_encoding_johab           FT_ENCODING_JOHAB\n\n#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD\n#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT\n#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM\n#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_CharMapRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The base charmap structure.                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face        :: A handle to the parent face object.                 */\n  /*                                                                       */\n  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */\n  /*                   this with @FT_Select_Charmap.                       */\n  /*                                                                       */\n  /*    platform_id :: An ID number describing the platform for the        */\n  /*                   following encoding ID.  This comes directly from    */\n  /*                   the TrueType specification and should be emulated   */\n  /*                   for other formats.                                  */\n  /*                                                                       */\n  /*    encoding_id :: A platform specific encoding number.  This also     */\n  /*                   comes from the TrueType specification and should be */\n  /*                   emulated similarly.                                 */\n  /*                                                                       */\n  typedef struct  FT_CharMapRec_\n  {\n    FT_Face      face;\n    FT_Encoding  encoding;\n    FT_UShort    platform_id;\n    FT_UShort    encoding_id;\n\n  } FT_CharMapRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 B A S E   O B J E C T   C L A S S E S                 */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Face object.                     */\n  /*                                                                       */\n  /*    This structure might change between releases of FreeType~2 and is  */\n  /*    not generally available to client applications.                    */\n  /*                                                                       */\n  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root face class structure.  A face object models a        */\n  /*    typeface in a font file.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_faces           :: The number of faces in the font file.  Some */\n  /*                           font formats can have multiple faces in     */\n  /*                           a font file.                                */\n  /*                                                                       */\n  /*    face_index          :: The index of the face in the font file.  It */\n  /*                           is set to~0 if there is only one face in    */\n  /*                           the font file.                              */\n  /*                                                                       */\n  /*    face_flags          :: A set of bit flags that give important      */\n  /*                           information about the face; see             */\n  /*                           @FT_FACE_FLAG_XXX for the details.          */\n  /*                                                                       */\n  /*    style_flags         :: A set of bit flags indicating the style of  */\n  /*                           the face; see @FT_STYLE_FLAG_XXX for the    */\n  /*                           details.                                    */\n  /*                                                                       */\n  /*    num_glyphs          :: The number of glyphs in the face.  If the   */\n  /*                           face is scalable and has sbits (see         */\n  /*                           `num_fixed_sizes'), it is set to the number */\n  /*                           of outline glyphs.                          */\n  /*                                                                       */\n  /*                           For CID-keyed fonts, this value gives the   */\n  /*                           highest CID used in the font.               */\n  /*                                                                       */\n  /*    family_name         :: The face's family name.  This is an ASCII   */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's family (like `Times New      */\n  /*                           Roman', `Bodoni', `Garamond', etc).  This   */\n  /*                           is a least common denominator used to list  */\n  /*                           fonts.  Some formats (TrueType & OpenType)  */\n  /*                           provide localized and Unicode versions of   */\n  /*                           this string.  Applications should use the   */\n  /*                           format specific interface to access them.   */\n  /*                           Can be NULL (e.g., in fonts embedded in a   */\n  /*                           PDF file).                                  */\n  /*                                                                       */\n  /*    style_name          :: The face's style name.  This is an ASCII    */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's style (like `Italic',        */\n  /*                           `Bold', `Condensed', etc).  Not all font    */\n  /*                           formats provide a style name, so this field */\n  /*                           is optional, and can be set to NULL.  As    */\n  /*                           for `family_name', some formats provide     */\n  /*                           localized and Unicode versions of this      */\n  /*                           string.  Applications should use the format */\n  /*                           specific interface to access them.          */\n  /*                                                                       */\n  /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */\n  /*                           Even if the face is scalable, there might   */\n  /*                           still be bitmap strikes, which are called   */\n  /*                           `sbits' in that case.                       */\n  /*                                                                       */\n  /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */\n  /*                           strikes in the face.  It is set to NULL if  */\n  /*                           there is no bitmap strike.                  */\n  /*                                                                       */\n  /*    num_charmaps        :: The number of charmaps in the face.         */\n  /*                                                                       */\n  /*    charmaps            :: An array of the charmaps of the face.       */\n  /*                                                                       */\n  /*    generic             :: A field reserved for client uses.  See the  */\n  /*                           @FT_Generic type description.               */\n  /*                                                                       */\n  /*    bbox                :: The font bounding box.  Coordinates are     */\n  /*                           expressed in font units (see                */\n  /*                           `units_per_EM').  The box is large enough   */\n  /*                           to contain any glyph from the font.  Thus,  */\n  /*                           `bbox.yMax' can be seen as the `maximum     */\n  /*                           ascender', and `bbox.yMin' as the `minimum  */\n  /*                           descender'.  Only relevant for scalable     */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           Note that the bounding box might be off by  */\n  /*                           (at least) one pixel for hinted fonts.  See */\n  /*                           @FT_Size_Metrics for further discussion.    */\n  /*                                                                       */\n  /*    units_per_EM        :: The number of font units per EM square for  */\n  /*                           this face.  This is typically 2048 for      */\n  /*                           TrueType fonts, and 1000 for Type~1 fonts.  */\n  /*                           Only relevant for scalable formats.         */\n  /*                                                                       */\n  /*    ascender            :: The typographic ascender of the face,       */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMax'.  Only relevant for scalable    */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    descender           :: The typographic descender of the face,      */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMin'.  Note that this field is       */\n  /*                           usually negative.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    height              :: This value is the vertical distance         */\n  /*                           between two consecutive baselines,          */\n  /*                           expressed in font units.  It is always      */\n  /*                           positive.  Only relevant for scalable       */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           If you want the global glyph height, use    */\n  /*                           `ascender - descender'.                     */\n  /*                                                                       */\n  /*    max_advance_width   :: The maximum advance width, in font units,   */\n  /*                           for all glyphs in this face.  This can be   */\n  /*                           used to make word wrapping computations     */\n  /*                           faster.  Only relevant for scalable         */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_height  :: The maximum advance height, in font units,  */\n  /*                           for all glyphs in this face.  This is only  */\n  /*                           relevant for vertical layouts, and is set   */\n  /*                           to `height' for fonts that do not provide   */\n  /*                           vertical metrics.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    underline_position  :: The position, in font units, of the         */\n  /*                           underline line for this face.  It is the    */\n  /*                           center of the underlining stem.  Only       */\n  /*                           relevant for scalable formats.              */\n  /*                                                                       */\n  /*    underline_thickness :: The thickness, in font units, of the        */\n  /*                           underline for this face.  Only relevant for */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    glyph               :: The face's associated glyph slot(s).        */\n  /*                                                                       */\n  /*    size                :: The current active size for this face.      */\n  /*                                                                       */\n  /*    charmap             :: The current active charmap for this face.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Fields may be changed after a call to @FT_Attach_File or           */\n  /*    @FT_Attach_Stream.                                                 */\n  /*                                                                       */\n  typedef struct  FT_FaceRec_\n  {\n    FT_Long           num_faces;\n    FT_Long           face_index;\n\n    FT_Long           face_flags;\n    FT_Long           style_flags;\n\n    FT_Long           num_glyphs;\n\n    FT_String*        family_name;\n    FT_String*        style_name;\n\n    FT_Int            num_fixed_sizes;\n    FT_Bitmap_Size*   available_sizes;\n\n    FT_Int            num_charmaps;\n    FT_CharMap*       charmaps;\n\n    FT_Generic        generic;\n\n    /*# The following member variables (down to `underline_thickness') */\n    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */\n    /*# for bitmap fonts.                                              */\n    FT_BBox           bbox;\n\n    FT_UShort         units_per_EM;\n    FT_Short          ascender;\n    FT_Short          descender;\n    FT_Short          height;\n\n    FT_Short          max_advance_width;\n    FT_Short          max_advance_height;\n\n    FT_Short          underline_position;\n    FT_Short          underline_thickness;\n\n    FT_GlyphSlot      glyph;\n    FT_Size           size;\n    FT_CharMap        charmap;\n\n    /*@private begin */\n\n    FT_Driver         driver;\n    FT_Memory         memory;\n    FT_Stream         stream;\n\n    FT_ListRec        sizes_list;\n\n    FT_Generic        autohint;   /* face-specific auto-hinter data */\n    void*             extensions; /* unused                         */\n\n    FT_Face_Internal  internal;\n\n    /*@private end */\n\n  } FT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `face_flags' field of the          */\n  /*    @FT_FaceRec structure.  They inform client applications of         */\n  /*    properties of the corresponding face.                              */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FACE_FLAG_SCALABLE ::                                           */\n  /*      Indicates that the face contains outline glyphs.  This doesn't   */\n  /*      prevent bitmap strikes, i.e., a face can have both this and      */\n  /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */\n  /*      Indicates that the face contains bitmap strikes.  See also the   */\n  /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */\n  /*      Indicates that the face contains fixed-width characters (like    */\n  /*      Courier, Lucido, MonoType, etc.).                                */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SFNT ::                                               */\n  /*      Indicates that the face uses the `sfnt' storage scheme.  For     */\n  /*      now, this means TrueType and OpenType.                           */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HORIZONTAL ::                                         */\n  /*      Indicates that the face contains horizontal glyph metrics.  This */\n  /*      should be set for all common formats.                            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_VERTICAL ::                                           */\n  /*      Indicates that the face contains vertical glyph metrics.  This   */\n  /*      is only available in some formats, not all of them.              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_KERNING ::                                            */\n  /*      Indicates that the face contains kerning information.  If set,   */\n  /*      the kerning distance can be retrieved through the function       */\n  /*      @FT_Get_Kerning.  Otherwise the function always return the       */\n  /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */\n  /*      from the `GPOS' table (as present in some OpenType fonts).       */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */\n  /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */\n  /*      Indicates that the font contains multiple masters and is capable */\n  /*      of interpolating between them.  See the multiple-masters         */\n  /*      specific API for details.                                        */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */\n  /*      Indicates that the font contains glyph names that can be         */\n  /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */\n  /*      fonts contain broken glyph name tables.  Use the function        */\n  /*      @FT_Has_PS_Glyph_Names when needed.                              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */\n  /*      Used internally by FreeType to indicate that a face's stream was */\n  /*      provided by the client application and should not be destroyed   */\n  /*      when @FT_Done_Face is called.  Don't read or test this flag.     */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HINTER ::                                             */\n  /*      Set if the font driver has a hinting machine of its own.  For    */\n  /*      example, with TrueType fonts, it makes sense to use data from    */\n  /*      the SFNT `gasp' table only if the native TrueType hinting engine */\n  /*      (with the bytecode interpreter) is available and active.         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_CID_KEYED ::                                          */\n  /*      Set if the font is CID-keyed.  In that case, the font is not     */\n  /*      accessed by glyph indices but by CID values.  For subsetted      */\n  /*      CID-keyed fonts this has the consequence that not all index      */\n  /*      values are a valid argument to FT_Load_Glyph.  Only the CID      */\n  /*      values for which corresponding glyphs in the subsetted font      */\n  /*      exist make FT_Load_Glyph return successfully; in all other cases */\n  /*      you get an `FT_Err_Invalid_Argument' error.                      */\n  /*                                                                       */\n  /*      Note that CID-keyed fonts which are in an SFNT wrapper don't     */\n  /*      have this flag set since the glyphs are accessed in the normal   */\n  /*      way (using contiguous indices); the `CID-ness' isn't visible to  */\n  /*      the application.                                                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_TRICKY ::                                             */\n  /*      Set if the font is `tricky', this is, it always needs the        */\n  /*      font format's native hinting engine to get a reasonable result.  */\n  /*      A typical example is the Chinese font `mingli.ttf' which uses    */\n  /*      TrueType bytecode instructions to move and scale all of its      */\n  /*      subglyphs.                                                       */\n  /*                                                                       */\n  /*      It is not possible to autohint such fonts using                  */\n  /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */\n  /*      @FT_LOAD_NO_HINTING.  You have to set both @FT_LOAD_NO_HINTING   */\n  /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */\n  /*      probably never want this except for demonstration purposes.      */\n  /*                                                                       */\n  /*      Currently, there are about a dozen TrueType fonts in the list of */\n  /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */\n  /*                                                                       */\n#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )\n#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )\n#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )\n#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )\n#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )\n#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )\n#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )\n#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )\n#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )\n#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )\n#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )\n#define FT_FACE_FLAG_HINTER            ( 1L << 11 )\n#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )\n#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_HORIZONTAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   horizontal metrics (this is true for all font formats though).\n   *\n   * @also:\n   *   @FT_HAS_VERTICAL can be used to check for vertical metrics.\n   *\n   */\n#define FT_HAS_HORIZONTAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_VERTICAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains real\n   *   vertical metrics (and not only synthesized ones).\n   *\n   */\n#define FT_HAS_VERTICAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_VERTICAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_KERNING( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains kerning\n   *   data that can be accessed with @FT_Get_Kerning.\n   *\n   */\n#define FT_HAS_KERNING( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_KERNING )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SCALABLE( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a scalable\n   *   font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,\n   *   and PFR font formats.\n   *\n   */\n#define FT_IS_SCALABLE( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SCALABLE )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SFNT( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font\n   *   whose format is based on the SFNT storage scheme.  This usually\n   *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded\n   *   bitmap fonts.\n   *\n   *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and\n   *   @FT_TRUETYPE_TABLES_H are available.\n   *\n   */\n#define FT_IS_SFNT( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SFNT )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_FIXED_WIDTH( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font face\n   *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)\n   *   glyphs.\n   *\n   */\n#define FT_IS_FIXED_WIDTH( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FIXED_SIZES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   embedded bitmaps.  See the `available_sizes' field of the\n   *   @FT_FaceRec structure.\n   *\n   */\n#define FT_HAS_FIXED_SIZES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FAST_GLYPHS( face )\n   *\n   * @description:\n   *   Deprecated.\n   *\n   */\n#define FT_HAS_FAST_GLYPHS( face )  0\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_GLYPH_NAMES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some glyph\n   *   names that can be accessed through @FT_Get_Glyph_Name.\n   *\n   */\n#define FT_HAS_GLYPH_NAMES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_MULTIPLE_MASTERS( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H\n   *   are then available to choose the exact design you want.\n   *\n   */\n#define FT_HAS_MULTIPLE_MASTERS( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_CID_KEYED( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a CID-keyed\n   *   font.  See the discussion of @FT_FACE_FLAG_CID_KEYED for more\n   *   details.\n   *\n   *   If this macro is true, all functions defined in @FT_CID_H are\n   *   available.\n   *\n   */\n#define FT_IS_CID_KEYED( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_TRICKY( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face represents a `tricky' font.\n   *   See the discussion of @FT_FACE_FLAG_TRICKY for more details.\n   *\n   */\n#define FT_IS_TRICKY( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_TRICKY )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-flags used to indicate the style of a given face.    */\n  /*    These are used in the `style_flags' field of @FT_FaceRec.          */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_STYLE_FLAG_ITALIC ::                                            */\n  /*      Indicates that a given face style is italic or oblique.          */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD ::                                              */\n  /*      Indicates that a given face is bold.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The style information as provided by FreeType is very basic.  More */\n  /*    details are beyond the scope and should be done on a higher level  */\n  /*    (for example, by analyzing various fields of the `OS/2' table in   */\n  /*    SFNT based fonts).                                                 */\n  /*                                                                       */\n#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )\n#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Size object.                     */\n  /*                                                                       */\n  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The size metrics structure gives the metrics of a size object.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x_ppem       :: The width of the scaled EM square in pixels, hence */\n  /*                    the term `ppem' (pixels per EM).  It is also       */\n  /*                    referred to as `nominal width'.                    */\n  /*                                                                       */\n  /*    y_ppem       :: The height of the scaled EM square in pixels,      */\n  /*                    hence the term `ppem' (pixels per EM).  It is also */\n  /*                    referred to as `nominal height'.                   */\n  /*                                                                       */\n  /*    x_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    horizontal metrics from font units to 26.6         */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    y_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    vertical metrics from font units to 26.6           */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    descender    :: The descender in 26.6 fractional pixels.  See      */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    height       :: The height in 26.6 fractional pixels.  See         */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    max_advance  :: The maximum advance width in 26.6 fractional       */\n  /*                    pixels.  See @FT_FaceRec for the details.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The scaling values, if relevant, are determined first during a     */\n  /*    size changing operation.  The remaining fields are then set by the */\n  /*    driver.  For scalable formats, they are usually set to scaled      */\n  /*    values of the corresponding fields in @FT_FaceRec.                 */\n  /*                                                                       */\n  /*    Note that due to glyph hinting, these values might not be exact    */\n  /*    for certain fonts.  Thus they must be treated as unreliable        */\n  /*    with an error margin of at least one pixel!                        */\n  /*                                                                       */\n  /*    Indeed, the only way to get the exact metrics is to render _all_   */\n  /*    glyphs.  As this would be a definite performance hit, it is up to  */\n  /*    client applications to perform such computations.                  */\n  /*                                                                       */\n  /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */\n  /*                                                                       */\n  typedef struct  FT_Size_Metrics_\n  {\n    FT_UShort  x_ppem;      /* horizontal pixels per EM               */\n    FT_UShort  y_ppem;      /* vertical pixels per EM                 */\n\n    FT_Fixed   x_scale;     /* scaling values used to convert font    */\n    FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */\n\n    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */\n    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */\n    FT_Pos     height;      /* text height in 26.6 frac. pixels       */\n    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */\n\n  } FT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root size class structure.  A size object models a face   */\n  /*    object at a given size.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face    :: Handle to the parent face object.                       */\n  /*                                                                       */\n  /*    generic :: A typeless pointer, which is unused by the FreeType     */\n  /*               library or any of its drivers.  It can be used by       */\n  /*               client applications to link their own data to each size */\n  /*               object.                                                 */\n  /*                                                                       */\n  /*    metrics :: Metrics for this size object.  This field is read-only. */\n  /*                                                                       */\n  typedef struct  FT_SizeRec_\n  {\n    FT_Face           face;      /* parent face object              */\n    FT_Generic        generic;   /* generic pointer for client uses */\n    FT_Size_Metrics   metrics;   /* size metrics                    */\n    FT_Size_Internal  internal;\n\n  } FT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The subglyph structure is an internal object used to describe      */\n  /*    subglyphs (for example, in the case of composites).                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The subglyph implementation is not part of the high-level API,     */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  /*    You can however retrieve subglyph information with                 */\n  /*    @FT_Get_SubGlyph_Info.                                             */\n  /*                                                                       */\n  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_GlyphSlot object.                */\n  /*                                                                       */\n  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root glyph slot class structure.  A glyph slot is a       */\n  /*    container where individual glyphs can be loaded, be they in        */\n  /*    outline or bitmap format.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library           :: A handle to the FreeType library instance     */\n  /*                         this slot belongs to.                         */\n  /*                                                                       */\n  /*    face              :: A handle to the parent face object.           */\n  /*                                                                       */\n  /*    next              :: In some cases (like some font tools), several */\n  /*                         glyph slots per face object can be a good     */\n  /*                         thing.  As this is rare, the glyph slots are  */\n  /*                         listed through a direct, single-linked list   */\n  /*                         using its `next' field.                       */\n  /*                                                                       */\n  /*    generic           :: A typeless pointer which is unused by the     */\n  /*                         FreeType library or any of its drivers.  It   */\n  /*                         can be used by client applications to link    */\n  /*                         their own data to each glyph slot object.     */\n  /*                                                                       */\n  /*    metrics           :: The metrics of the last loaded glyph in the   */\n  /*                         slot.  The returned values depend on the last */\n  /*                         load flags (see the @FT_Load_Glyph API        */\n  /*                         function) and can be expressed either in 26.6 */\n  /*                         fractional pixels or font units.              */\n  /*                                                                       */\n  /*                         Note that even when the glyph image is        */\n  /*                         transformed, the metrics are not.             */\n  /*                                                                       */\n  /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    linearVertAdvance :: The advance height of the unhinted glyph.     */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    advance           :: This shorthand is, depending on               */\n  /*                         @FT_LOAD_IGNORE_TRANSFORM, the transformed    */\n  /*                         advance width for the glyph (in 26.6          */\n  /*                         fractional pixel format).  As specified with  */\n  /*                         @FT_LOAD_VERTICAL_LAYOUT, it uses either the  */\n  /*                         `horiAdvance' or the `vertAdvance' value of   */\n  /*                         `metrics' field.                              */\n  /*                                                                       */\n  /*    format            :: This field indicates the format of the image  */\n  /*                         contained in the glyph slot.  Typically       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP,                      */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */\n  /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */\n  /*                         possible.                                     */\n  /*                                                                       */\n  /*    bitmap            :: This field is used as a bitmap descriptor     */\n  /*                         when the slot format is                       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */\n  /*                         address and content of the bitmap buffer can  */\n  /*                         change between calls of @FT_Load_Glyph and a  */\n  /*                         few other functions.                          */\n  /*                                                                       */\n  /*    bitmap_left       :: This is the bitmap's left bearing expressed   */\n  /*                         in integer pixels.  Of course, this is only   */\n  /*                         valid if the format is                        */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.                      */\n  /*                                                                       */\n  /*    bitmap_top        :: This is the bitmap's top bearing expressed in */\n  /*                         integer pixels.  Remember that this is the    */\n  /*                         distance from the baseline to the top-most    */\n  /*                         glyph scanline, upwards y~coordinates being   */\n  /*                         *positive*.                                   */\n  /*                                                                       */\n  /*    outline           :: The outline descriptor for the current glyph  */\n  /*                         image if its format is                        */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */\n  /*                         loaded, `outline' can be transformed,         */\n  /*                         distorted, embolded, etc.  However, it must   */\n  /*                         not be freed.                                 */\n  /*                                                                       */\n  /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */\n  /*                         This field is only valid for the composite    */\n  /*                         glyph format that should normally only be     */\n  /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */\n  /*                         For now this is internal to FreeType.         */\n  /*                                                                       */\n  /*    subglyphs         :: An array of subglyph descriptors for          */\n  /*                         composite glyphs.  There are `num_subglyphs'  */\n  /*                         elements in there.  Currently internal to     */\n  /*                         FreeType.                                     */\n  /*                                                                       */\n  /*    control_data      :: Certain font drivers can also return the      */\n  /*                         control data for a given glyph image (e.g.    */\n  /*                         TrueType bytecode, Type~1 charstrings, etc.). */\n  /*                         This field is a pointer to such data.         */\n  /*                                                                       */\n  /*    control_len       :: This is the length in bytes of the control    */\n  /*                         data.                                         */\n  /*                                                                       */\n  /*    other             :: Really wicked formats can use this pointer to */\n  /*                         present their own glyph image to client       */\n  /*                         applications.  Note that the application      */\n  /*                         needs to know about the image format.         */\n  /*                                                                       */\n  /*    lsb_delta         :: The difference between hinted and unhinted    */\n  /*                         left side bearing while autohinting is        */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /*    rsb_delta         :: The difference between hinted and unhinted    */\n  /*                         right side bearing while autohinting is       */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If @FT_Load_Glyph is called with default flags (see                */\n  /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */\n  /*    its native format (e.g., an outline glyph for TrueType and Type~1  */\n  /*    formats).                                                          */\n  /*                                                                       */\n  /*    This image can later be converted into a bitmap by calling         */\n  /*    @FT_Render_Glyph.  This function finds the current renderer for    */\n  /*    the native image's format, then invokes it.                        */\n  /*                                                                       */\n  /*    The renderer is in charge of transforming the native image through */\n  /*    the slot's face transformation fields, then converting it into a   */\n  /*    bitmap that is returned in `slot->bitmap'.                         */\n  /*                                                                       */\n  /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */\n  /*    to specify the position of the bitmap relative to the current pen  */\n  /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */\n  /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Here a small pseudo code fragment which shows how to use           */\n  /*    `lsb_delta' and `rsb_delta':                                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Pos  origin_x       = 0;                                      */\n  /*      FT_Pos  prev_rsb_delta = 0;                                      */\n  /*                                                                       */\n  /*                                                                       */\n  /*      for all glyphs do                                                */\n  /*        <compute kern between current and previous glyph and add it to */\n  /*         `origin_x'>                                                   */\n  /*                                                                       */\n  /*        <load glyph with `FT_Load_Glyph'>                              */\n  /*                                                                       */\n  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */\n  /*          origin_x -= 64;                                              */\n  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */\n  /*          origin_x += 64;                                              */\n  /*                                                                       */\n  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */\n  /*                                                                       */\n  /*        <save glyph image, or render glyph, or ...>                    */\n  /*                                                                       */\n  /*        origin_x += face->glyph->advance.x;                            */\n  /*      endfor                                                           */\n  /*    }                                                                  */\n  /*                                                                       */\n  typedef struct  FT_GlyphSlotRec_\n  {\n    FT_Library        library;\n    FT_Face           face;\n    FT_GlyphSlot      next;\n    FT_UInt           reserved;       /* retained for binary compatibility */\n    FT_Generic        generic;\n\n    FT_Glyph_Metrics  metrics;\n    FT_Fixed          linearHoriAdvance;\n    FT_Fixed          linearVertAdvance;\n    FT_Vector         advance;\n\n    FT_Glyph_Format   format;\n\n    FT_Bitmap         bitmap;\n    FT_Int            bitmap_left;\n    FT_Int            bitmap_top;\n\n    FT_Outline        outline;\n\n    FT_UInt           num_subglyphs;\n    FT_SubGlyph       subglyphs;\n\n    void*             control_data;\n    long              control_len;\n\n    FT_Pos            lsb_delta;\n    FT_Pos            rsb_delta;\n\n    void*             other;\n\n    FT_Slot_Internal  internal;\n\n  } FT_GlyphSlotRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         F U N C T I O N S                             */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Init_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new FreeType library object.  The set of modules      */\n  /*    that are registered by this function is determined at build time.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A handle to a new library object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case you want to provide your own memory allocating routines,   */\n  /*    use @FT_New_Library instead, followed by a call to                 */\n  /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */\n  /*                                                                       */\n  /*    For multi-threading applications each thread should have its own   */\n  /*    FT_Library object.                                                 */\n  /*                                                                       */\n  /*    If you need reference-counting (cf. @FT_Reference_Library), use    */\n  /*    @FT_New_Library and @FT_Done_Library.                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given FreeType library object and all of its children,   */\n  /*    including resources, drivers, faces, sizes, etc.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library object.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_FreeType( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OPEN_XXX                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants used within the `flags' field of the */\n  /*    @FT_Open_Args structure.                                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OPEN_MEMORY   :: This is a memory-based stream.                 */\n  /*                                                                       */\n  /*    FT_OPEN_STREAM   :: Copy the stream from the `stream' field.       */\n  /*                                                                       */\n  /*    FT_OPEN_PATHNAME :: Create a new input stream from a C~path        */\n  /*                        name.                                          */\n  /*                                                                       */\n  /*    FT_OPEN_DRIVER   :: Use the `driver' field.                        */\n  /*                                                                       */\n  /*    FT_OPEN_PARAMS   :: Use the `num_params' and `params' fields.      */\n  /*                                                                       */\n  /*    ft_open_memory   :: Deprecated; use @FT_OPEN_MEMORY instead.       */\n  /*                                                                       */\n  /*    ft_open_stream   :: Deprecated; use @FT_OPEN_STREAM instead.       */\n  /*                                                                       */\n  /*    ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead.     */\n  /*                                                                       */\n  /*    ft_open_driver   :: Deprecated; use @FT_OPEN_DRIVER instead.       */\n  /*                                                                       */\n  /*    ft_open_params   :: Deprecated; use @FT_OPEN_PARAMS instead.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */\n  /*    flags are mutually exclusive.                                      */\n  /*                                                                       */\n#define FT_OPEN_MEMORY    0x1\n#define FT_OPEN_STREAM    0x2\n#define FT_OPEN_PATHNAME  0x4\n#define FT_OPEN_DRIVER    0x8\n#define FT_OPEN_PARAMS    0x10\n\n#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */\n#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */\n#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */\n#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */\n#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Parameter                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to pass more or less generic parameters to */\n  /*    @FT_Open_Face.                                                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag  :: A four-byte identification tag.                            */\n  /*                                                                       */\n  /*    data :: A pointer to the parameter data.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The ID and function of parameters are driver-specific.  See the    */\n  /*    various FT_PARAM_TAG_XXX flags for more information.               */\n  /*                                                                       */\n  typedef struct  FT_Parameter_\n  {\n    FT_ULong    tag;\n    FT_Pointer  data;\n\n  } FT_Parameter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Open_Args                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to indicate how to open a new font file or        */\n  /*    stream.  A pointer to such a structure can be used as a parameter  */\n  /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    flags       :: A set of bit flags indicating how to use the        */\n  /*                   structure.                                          */\n  /*                                                                       */\n  /*    memory_base :: The first byte of the file in memory.               */\n  /*                                                                       */\n  /*    memory_size :: The size in bytes of the file in memory.            */\n  /*                                                                       */\n  /*    pathname    :: A pointer to an 8-bit file pathname.                */\n  /*                                                                       */\n  /*    stream      :: A handle to a source stream object.                 */\n  /*                                                                       */\n  /*    driver      :: This field is exclusively used by @FT_Open_Face;    */\n  /*                   it simply specifies the font driver to use to open  */\n  /*                   the face.  If set to~0, FreeType tries to load the  */\n  /*                   face with each one of the drivers in its list.      */\n  /*                                                                       */\n  /*    num_params  :: The number of extra parameters.                     */\n  /*                                                                       */\n  /*    params      :: Extra parameters passed to the font driver when     */\n  /*                   opening a new face.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream type is determined by the contents of `flags' which     */\n  /*    are tested in the following order by @FT_Open_Face:                */\n  /*                                                                       */\n  /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */\n  /*    memory file of `memory_size' bytes, located at `memory_address'.   */\n  /*    The data are are not copied, and the client is responsible for     */\n  /*    releasing and destroying them _after_ the corresponding call to    */\n  /*    @FT_Done_Face.                                                     */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */\n  /*    custom input stream `stream' is used.                              */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this  */\n  /*    is a normal file and use `pathname' to open it.                    */\n  /*                                                                       */\n  /*    If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to    */\n  /*    open the file with the driver whose handler is in `driver'.        */\n  /*                                                                       */\n  /*    If the `FT_OPEN_PARAMS' bit is set, the parameters given by        */\n  /*    `num_params' and `params' is used.  They are ignored otherwise.    */\n  /*                                                                       */\n  /*    Ideally, both the `pathname' and `params' fields should be tagged  */\n  /*    as `const'; this is missing for API backwards compatibility.  In   */\n  /*    other words, applications should treat them as read-only.          */\n  /*                                                                       */\n  typedef struct  FT_Open_Args_\n  {\n    FT_UInt         flags;\n    const FT_Byte*  memory_base;\n    FT_Long         memory_size;\n    FT_String*      pathname;\n    FT_Stream       stream;\n    FT_Module       driver;\n    FT_Int          num_params;\n    FT_Parameter*   params;\n\n  } FT_Open_Args;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font by its pathname.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pathname   :: A path to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Done_Face to destroy the created @FT_Face object (along    */\n  /*    with its slot and sizes).                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  filepathname,\n               FT_Long      face_index,\n               FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory_Face                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font which has been    */\n  /*    loaded into memory.                                                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    file_base  :: A pointer to the beginning of the font data.         */\n  /*                                                                       */\n  /*    file_size  :: The size of the memory chunk used by the font data.  */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You must not deallocate the memory before calling @FT_Done_Face.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Open_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a face object from a given resource described by            */\n  /*    @FT_Open_Args.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    args       :: A pointer to an `FT_Open_Args' structure which must  */\n  /*                  be filled by the caller.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See note below.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Unlike FreeType 1.x, this function automatically creates a glyph   */\n  /*    slot for the face object which can be accessed directly through    */\n  /*    `face->glyph'.                                                     */\n  /*                                                                       */\n  /*    FT_Open_Face can be used to quickly check whether the font         */\n  /*    format of a given font resource is supported by FreeType.  If the  */\n  /*    `face_index' field is negative, the function's return value is~0   */\n  /*    if the font format is recognized, or non-zero otherwise;           */\n  /*    the function returns a more or less empty face handle in `*aface'  */\n  /*    (if `aface' isn't NULL).  The only useful field in this special    */\n  /*    case is `face->num_faces' which gives the number of faces within   */\n  /*    the font file.  After examination, the returned @FT_Face structure */\n  /*    should be deallocated with a call to @FT_Done_Face.                */\n  /*                                                                       */\n  /*    Each new face object created with this function also owns a        */\n  /*    default @FT_Size object, accessible as `face->size'.               */\n  /*                                                                       */\n  /*    One @FT_Library instance can have multiple face objects, this is,  */\n  /*    @FT_Open_Face and its siblings can be called multiple times using  */\n  /*    the same `library' argument.                                       */\n  /*                                                                       */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_File                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Attach_Stream to attach a file.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: The target face object.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    filepathname :: The pathname.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    `Attach' data to a face object.  Normally, this is used to read    */\n  /*    additional information for the face object.  For example, you can  */\n  /*    attach an AFM file that comes with a Type~1 font to get the        */\n  /*    kerning values and other metrics.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The target face object.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    parameters :: A pointer to @FT_Open_Args which must be filled by   */\n  /*                  the caller.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The meaning of the `attach' (i.e., what really happens when the    */\n  /*    new file is read) is not fixed by FreeType itself.  It really      */\n  /*    depends on the font format (and thus the font driver).             */\n  /*                                                                       */\n  /*    Client applications are expected to know what they are doing       */\n  /*    when invoking this function.  Most drivers simply do not implement */\n  /*    file attachments.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Face                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Face structure  */\n  /*    is created.  This function increments the counter.  @FT_Done_Face  */\n  /*    then only destroys a face if the counter is~1, otherwise it simply */\n  /*    decrements the counter.                                            */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Face objects.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given face object, as well as all of its child slots and */\n  /*    sizes.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a bitmap strike.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to a target face object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strike_index :: The index of the bitmap strike in the              */\n  /*                    `available_sizes' field of @FT_FaceRec structure.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Size_Request_Type                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the supported size request types.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SIZE_REQUEST_TYPE_NOMINAL ::                                    */\n  /*      The nominal size.  The `units_per_EM' field of @FT_FaceRec is    */\n  /*      used to determine both scaling values.                           */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */\n  /*      The real dimension.  The sum of the the `ascender' and (minus    */\n  /*      of) the `descender' fields of @FT_FaceRec are used to determine  */\n  /*      both scaling values.                                             */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */\n  /*      The font bounding box.  The width and height of the `bbox' field */\n  /*      of @FT_FaceRec are used to determine the horizontal and vertical */\n  /*      scaling value, respectively.                                     */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_CELL ::                                       */\n  /*      The `max_advance_width' field of @FT_FaceRec is used to          */\n  /*      determine the horizontal scaling value; the vertical scaling     */\n  /*      value is determined the same way as                              */\n  /*      @FT_SIZE_REQUEST_TYPE_REAL_DIM does.  Finally, both scaling      */\n  /*      values are set to the smaller one.  This type is useful if you   */\n  /*      want to specify the font size for, say, a window of a given      */\n  /*      dimension and 80x24 cells.                                       */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_SCALES ::                                     */\n  /*      Specify the scaling values directly.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The above descriptions only apply to scalable formats.  For bitmap */\n  /*    formats, the behaviour is up to the driver.                        */\n  /*                                                                       */\n  /*    See the note section of @FT_Size_Metrics if you wonder how size    */\n  /*    requesting relates to scaling values.                              */\n  /*                                                                       */\n  typedef enum  FT_Size_Request_Type_\n  {\n    FT_SIZE_REQUEST_TYPE_NOMINAL,\n    FT_SIZE_REQUEST_TYPE_REAL_DIM,\n    FT_SIZE_REQUEST_TYPE_BBOX,\n    FT_SIZE_REQUEST_TYPE_CELL,\n    FT_SIZE_REQUEST_TYPE_SCALES,\n\n    FT_SIZE_REQUEST_TYPE_MAX\n\n  } FT_Size_Request_Type;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_RequestRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a size request.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    type           :: See @FT_Size_Request_Type.                       */\n  /*                                                                       */\n  /*    width          :: The desired width.                               */\n  /*                                                                       */\n  /*    height         :: The desired height.                              */\n  /*                                                                       */\n  /*    horiResolution :: The horizontal resolution.  If set to zero,      */\n  /*                      `width' is treated as a 26.6 fractional pixel    */\n  /*                      value.                                           */\n  /*                                                                       */\n  /*    vertResolution :: The vertical resolution.  If set to zero,        */\n  /*                      `height' is treated as a 26.6 fractional pixel   */\n  /*                      value.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `width' is zero, then the horizontal scaling value is set equal */\n  /*    to the vertical scaling value, and vice versa.                     */\n  /*                                                                       */\n  typedef struct  FT_Size_RequestRec_\n  {\n    FT_Size_Request_Type  type;\n    FT_Long               width;\n    FT_Long               height;\n    FT_UInt               horiResolution;\n    FT_UInt               vertResolution;\n\n  } FT_Size_RequestRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Request                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a size request structure.                              */\n  /*                                                                       */\n  typedef struct FT_Size_RequestRec_  *FT_Size_Request;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Request_Size                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Resize the scale of the active @FT_Size object in a face.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    req  :: A pointer to a @FT_Size_RequestRec.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Although drivers may select the bitmap strike matching the         */\n  /*    request, you should not rely on this if you intend to select a     */\n  /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */\n  /*    case.                                                              */\n  /*                                                                       */\n  /*    The relation between the requested size and the resulting glyph    */\n  /*    size is dependent entirely on how the size is defined in the       */\n  /*    source face.  The font designer chooses the final size of each     */\n  /*    glyph relative to this size.  For more information refer to        */\n  /*    `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Char_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in points).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face            :: A handle to a target face object.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_width      :: The nominal width, in 26.6 fractional points.   */\n  /*                                                                       */\n  /*    char_height     :: The nominal height, in 26.6 fractional points.  */\n  /*                                                                       */\n  /*    horz_resolution :: The horizontal resolution in dpi.               */\n  /*                                                                       */\n  /*    vert_resolution :: The vertical resolution in dpi.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If either the character width or height is zero, it is set equal   */\n  /*    to the other value.                                                */\n  /*                                                                       */\n  /*    If either the horizontal or vertical resolution is zero, it is set */\n  /*    equal to the other value.                                          */\n  /*                                                                       */\n  /*    A character width or height smaller than 1pt is set to 1pt; if     */\n  /*    both resolution values are zero, they are set to 72dpi.            */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in pixels).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to the target face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pixel_width  :: The nominal width, in pixels.                      */\n  /*                                                                       */\n  /*    pixel_height :: The nominal height, in pixels.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should not rely on the resulting glyphs matching, or being     */\n  /*    constrained, to this pixel size.  Refer to @FT_Request_Size to     */\n  /*    understand how requested sizes relate to actual sizes.             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to the target face object where the glyph  */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph_index :: The index of the glyph in the font file.  For       */\n  /*                   CID-keyed fonts (either in PS or in CFF format)     */\n  /*                   this argument specifies the CID value.              */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The loaded glyph may be transformed.  See @FT_Set_Transform for    */\n  /*    the details.                                                       */\n  /*                                                                       */\n  /*    For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is        */\n  /*    returned for invalid CID values (this is, for CID values which     */\n  /*    don't have a corresponding glyph in the font).  See the discussion */\n  /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object, according to its character code.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to a target face object where the glyph    */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_code   :: The glyph's character code, according to the        */\n  /*                   current charmap used in the face.                   */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags );\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_XXX\n   *\n   * @description:\n   *   A list of bit-field constants used with @FT_Load_Glyph to indicate\n   *   what kind of operations to perform during glyph loading.\n   *\n   * @values:\n   *   FT_LOAD_DEFAULT ::\n   *     Corresponding to~0, this value is used as the default glyph load\n   *     operation.  In this case, the following happens:\n   *\n   *     1. FreeType looks for a bitmap for the glyph corresponding to the\n   *        face's current size.  If one is found, the function returns.\n   *        The bitmap data can be accessed from the glyph slot (see note\n   *        below).\n   *\n   *     2. If no embedded bitmap is searched or found, FreeType looks for a\n   *        scalable outline.  If one is found, it is loaded from the font\n   *        file, scaled to device pixels, then `hinted' to the pixel grid\n   *        in order to optimize it.  The outline data can be accessed from\n   *        the glyph slot (see note below).\n   *\n   *     Note that by default, the glyph loader doesn't render outlines into\n   *     bitmaps.  The following flags are used to modify this default\n   *     behaviour to more specific and useful cases.\n   *\n   *   FT_LOAD_NO_SCALE ::\n   *     Don't scale the loaded outline glyph but keep it in font units.\n   *\n   *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and\n   *     unsets @FT_LOAD_RENDER.\n   *\n   *     If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using\n   *     FT_LOAD_NO_SCALE usually yields meaningless outlines because the\n   *     subglyphs must be scaled and positioned with hinting instructions.\n   *     This can be solved by loading the font without FT_LOAD_NO_SCALE and\n   *     setting the character size to `font->units_per_EM'.\n   *\n   *   FT_LOAD_NO_HINTING ::\n   *     Disable hinting.  This generally generates `blurrier' bitmap glyphs\n   *     when the glyph are rendered in any of the anti-aliased modes.  See\n   *     also the note below.\n   *\n   *     This flag is implied by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_RENDER ::\n   *     Call @FT_Render_Glyph after the glyph is loaded.  By default, the\n   *     glyph is rendered in @FT_RENDER_MODE_NORMAL mode.  This can be\n   *     overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.\n   *\n   *     This flag is unset by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_NO_BITMAP ::\n   *     Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this\n   *     flag.\n   *\n   *     @FT_LOAD_NO_SCALE always sets this flag.\n   *\n   *   FT_LOAD_VERTICAL_LAYOUT ::\n   *     Load the glyph for vertical text layout.  In particular, the\n   *     `advance' value in the @FT_GlyphSlotRec structure is set to the\n   *     `vertAdvance' value of the `metrics' field.\n   *\n   *     In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use\n   *     this flag currently.  Reason is that in this case vertical metrics\n   *     get synthesized, and those values are not always consistent across\n   *     various font formats.\n   *\n   *   FT_LOAD_FORCE_AUTOHINT ::\n   *     Indicates that the auto-hinter is preferred over the font's native\n   *     hinter.  See also the note below.\n   *\n   *   FT_LOAD_CROP_BITMAP ::\n   *     Indicates that the font driver should crop the loaded bitmap glyph\n   *     (i.e., remove all space around its black bits).  Not all drivers\n   *     implement this.\n   *\n   *   FT_LOAD_PEDANTIC ::\n   *     Indicates that the font driver should perform pedantic verifications\n   *     during glyph loading.  This is mostly used to detect broken glyphs\n   *     in fonts.  By default, FreeType tries to handle broken fonts also.\n   *\n   *     In particular, errors from the TrueType bytecode engine are not\n   *     passed to the application if this flag is not set; this might\n   *     result in partially hinted or distorted glyphs in case a glyph's\n   *     bytecode is buggy.\n   *\n   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::\n   *     Ignored.  Deprecated.\n   *\n   *   FT_LOAD_NO_RECURSE ::\n   *     This flag is only used internally.  It merely indicates that the\n   *     font driver should not load composite glyphs recursively.  Instead,\n   *     it should set the `num_subglyph' and `subglyphs' values of the\n   *     glyph slot accordingly, and set `glyph->format' to\n   *     @FT_GLYPH_FORMAT_COMPOSITE.\n   *\n   *     The description of sub-glyphs is not available to client\n   *     applications for now.\n   *\n   *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.\n   *\n   *   FT_LOAD_IGNORE_TRANSFORM ::\n   *     Indicates that the transform matrix set by @FT_Set_Transform should\n   *     be ignored.\n   *\n   *   FT_LOAD_MONOCHROME ::\n   *     This flag is used with @FT_LOAD_RENDER to indicate that you want to\n   *     render an outline glyph to a 1-bit monochrome bitmap glyph, with\n   *     8~pixels packed into each byte of the bitmap data.\n   *\n   *     Note that this has no effect on the hinting algorithm used.  You\n   *     should rather use @FT_LOAD_TARGET_MONO so that the\n   *     monochrome-optimized hinting algorithm is used.\n   *\n   *   FT_LOAD_LINEAR_DESIGN ::\n   *     Indicates that the `linearHoriAdvance' and `linearVertAdvance'\n   *     fields of @FT_GlyphSlotRec should be kept in font units.  See\n   *     @FT_GlyphSlotRec for details.\n   *\n   *   FT_LOAD_NO_AUTOHINT ::\n   *     Disable auto-hinter.  See also the note below.\n   *\n   *   FT_LOAD_COLOR ::\n   *     This flag is used to request loading of color embedded-bitmap\n   *     images.  The resulting color bitmaps, if available, will have the\n   *     @FT_PIXEL_MODE_BGRA format.  When the flag is not used and color\n   *     bitmaps are found, they will be converted to 256-level gray\n   *     bitmaps transparently.  Those bitmaps will be in the\n   *     @FT_PIXEL_MODE_GRAY format.\n   *\n   * @note:\n   *   By default, hinting is enabled and the font's native hinter (see\n   *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can\n   *   disable hinting by setting @FT_LOAD_NO_HINTING or change the\n   *   precedence by setting @FT_LOAD_FORCE_AUTOHINT.  You can also set\n   *   @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be\n   *   used at all.\n   *\n   *   See the description of @FT_FACE_FLAG_TRICKY for a special exception\n   *   (affecting only a handful of Asian fonts).\n   *\n   *   Besides deciding which hinter to use, you can also decide which\n   *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.\n   *\n   *   Note that the auto-hinter needs a valid Unicode cmap (either a native\n   *   one or synthesized by FreeType) for producing correct results.  If a\n   *   font provides an incorrect mapping (for example, assigning the\n   *   character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a\n   *   mathematical integral sign), the auto-hinter might produce useless\n   *   results.\n   *\n   */\n#define FT_LOAD_DEFAULT                      0x0\n#define FT_LOAD_NO_SCALE                     ( 1L << 0 )\n#define FT_LOAD_NO_HINTING                   ( 1L << 1 )\n#define FT_LOAD_RENDER                       ( 1L << 2 )\n#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )\n#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )\n#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )\n#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )\n#define FT_LOAD_PEDANTIC                     ( 1L << 7 )\n#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )\n#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )\n#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )\n#define FT_LOAD_MONOCHROME                   ( 1L << 12 )\n#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )\n#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )\n  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */\n#define FT_LOAD_COLOR                        ( 1L << 20 )\n\n  /* */\n\n  /* used internally only by certain font drivers! */\n#define FT_LOAD_ADVANCE_ONLY                 ( 1L << 8 )\n#define FT_LOAD_SBITS_ONLY                   ( 1L << 14 )\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_TARGET_XXX\n   *\n   * @description:\n   *   A list of values that are used to select a specific hinting algorithm\n   *   to use by the hinter.  You should OR one of these values to your\n   *   `load_flags' when calling @FT_Load_Glyph.\n   *\n   *   Note that font's native hinters may ignore the hinting algorithm you\n   *   have specified (e.g., the TrueType bytecode interpreter).  You can set\n   *   @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.\n   *\n   *   Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it\n   *   always implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   * @values:\n   *   FT_LOAD_TARGET_NORMAL ::\n   *     This corresponds to the default hinting algorithm, optimized for\n   *     standard gray-level rendering.  For monochrome output, use\n   *     @FT_LOAD_TARGET_MONO instead.\n   *\n   *   FT_LOAD_TARGET_LIGHT ::\n   *     A lighter hinting algorithm for non-monochrome modes.  Many\n   *     generated glyphs are more fuzzy but better resemble its original\n   *     shape.  A bit like rendering on Mac OS~X.\n   *\n   *     As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   *   FT_LOAD_TARGET_MONO ::\n   *     Strong hinting algorithm that should only be used for monochrome\n   *     output.  The result is probably unpleasant if the glyph is rendered\n   *     in non-monochrome modes.\n   *\n   *   FT_LOAD_TARGET_LCD ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally\n   *     decimated LCD displays.\n   *\n   *   FT_LOAD_TARGET_LCD_V ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically\n   *     decimated LCD displays.\n   *\n   * @note:\n   *   You should use only _one_ of the FT_LOAD_TARGET_XXX values in your\n   *   `load_flags'.  They can't be ORed.\n   *\n   *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the\n   *   corresponding mode (i.e., the mode which matches the used algorithm\n   *   best).  An exeption is FT_LOAD_TARGET_MONO since it implies\n   *   @FT_LOAD_MONOCHROME.\n   *\n   *   You can use a hinting algorithm that doesn't correspond to the same\n   *   rendering mode.  As an example, it is possible to use the `light'\n   *   hinting algorithm and have the results rendered in horizontal LCD\n   *   pixel mode, with code like\n   *\n   *     {\n   *       FT_Load_Glyph( face, glyph_index,\n   *                      load_flags | FT_LOAD_TARGET_LIGHT );\n   *\n   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );\n   *     }\n   *\n   */\n#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )\n\n#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )\n#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )\n#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )\n#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )\n#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )\n\n\n  /**************************************************************************\n   *\n   * @macro:\n   *   FT_LOAD_TARGET_MODE\n   *\n   * @description:\n   *   Return the @FT_Render_Mode corresponding to a given\n   *   @FT_LOAD_TARGET_XXX value.\n   *\n   */\n#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Transform                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to set the transformation that is applied to glyph */\n  /*    images when they are loaded into a glyph slot through              */\n  /*    @FT_Load_Glyph.                                                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the transformation's 2x2 matrix.  Use~0 for */\n  /*              the identity matrix.                                     */\n  /*    delta  :: A pointer to the translation vector.  Use~0 for the null */\n  /*              vector.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The transformation is only applied to scalable image formats after */\n  /*    the glyph has been loaded.  It means that hinting is unaltered by  */\n  /*    the transformation and is performed on the character size given in */\n  /*    the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes.         */\n  /*                                                                       */\n  /*    Note that this also transforms the `face.glyph.advance' field, but */\n  /*    *not* the values in `face.glyph.metrics'.                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Render_Mode                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the render modes supported by       */\n  /*    FreeType~2.  Each mode corresponds to a specific type of scanline  */\n  /*    conversion performed on the outline.                               */\n  /*                                                                       */\n  /*    For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode'     */\n  /*    field in the @FT_GlyphSlotRec structure gives the format of the    */\n  /*    returned bitmap.                                                   */\n  /*                                                                       */\n  /*    All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RENDER_MODE_NORMAL ::                                           */\n  /*      This is the default render mode; it corresponds to 8-bit         */\n  /*      anti-aliased bitmaps.                                            */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LIGHT ::                                            */\n  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */\n  /*      defined as a separate value because render modes are also used   */\n  /*      indirectly to define hinting algorithm selectors.  See           */\n  /*      @FT_LOAD_TARGET_XXX for details.                                 */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_MONO ::                                             */\n  /*      This mode corresponds to 1-bit bitmaps (with 2~levels of         */\n  /*      opacity).                                                        */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD ::                                              */\n  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */\n  /*      displays like LCD screens.  It produces 8-bit bitmaps that are   */\n  /*      3~times the width of the original glyph outline in pixels, and   */\n  /*      which use the @FT_PIXEL_MODE_LCD mode.                           */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD_V ::                                            */\n  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */\n  /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */\n  /*      8-bit bitmaps that are 3~times the height of the original        */\n  /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */\n  /*    filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */\n  /*    (not active in the default builds).  It is up to the caller to     */\n  /*    either call @FT_Library_SetLcdFilter (if available) or do the      */\n  /*    filtering itself.                                                  */\n  /*                                                                       */\n  /*    The selected render mode only affects vector glyphs of a font.     */\n  /*    Embedded bitmaps often have a different pixel mode like            */\n  /*    @FT_PIXEL_MODE_MONO.  You can use @FT_Bitmap_Convert to transform  */\n  /*    them into 8-bit pixmaps.                                           */\n  /*                                                                       */\n  typedef enum  FT_Render_Mode_\n  {\n    FT_RENDER_MODE_NORMAL = 0,\n    FT_RENDER_MODE_LIGHT,\n    FT_RENDER_MODE_MONO,\n    FT_RENDER_MODE_LCD,\n    FT_RENDER_MODE_LCD_V,\n\n    FT_RENDER_MODE_MAX\n\n  } FT_Render_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_render_mode_xxx                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Render_Mode values instead.                                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL                */\n  /*    ft_render_mode_mono   :: see @FT_RENDER_MODE_MONO                  */\n  /*                                                                       */\n#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL\n#define ft_render_mode_mono    FT_RENDER_MODE_MONO\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Render_Glyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph image to a bitmap.  It does so by inspecting */\n  /*    the glyph image format, finding the relevant renderer, and         */\n  /*    invoking it.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot        :: A handle to the glyph slot containing the image to  */\n  /*                   convert.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: This is the render mode used to render the glyph    */\n  /*                   image into a bitmap.  See @FT_Render_Mode for a     */\n  /*                   list of possible values.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Kerning_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify which kerning values to return in   */\n  /*    @FT_Get_Kerning.                                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_KERNING_DEFAULT  :: Return scaled and grid-fitted kerning       */\n  /*                           distances (value is~0).                     */\n  /*                                                                       */\n  /*    FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning    */\n  /*                           distances.                                  */\n  /*                                                                       */\n  /*    FT_KERNING_UNSCALED :: Return the kerning vector in original font  */\n  /*                           units.                                      */\n  /*                                                                       */\n  typedef enum  FT_Kerning_Mode_\n  {\n    FT_KERNING_DEFAULT  = 0,\n    FT_KERNING_UNFITTED,\n    FT_KERNING_UNSCALED\n\n  } FT_Kerning_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_default                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_DEFAULT       */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_default   FT_KERNING_DEFAULT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unfitted                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNFITTED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unfitted  FT_KERNING_UNFITTED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unscaled                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNSCALED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unscaled  FT_KERNING_UNSCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the kerning vector between two glyphs of a same face.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /*    kern_mode   :: See @FT_Kerning_Mode for more information.          */\n  /*                   Determines the scale and dimension of the returned  */\n  /*                   kerning vector.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning vector.  This is either in font units   */\n  /*                   or in pixels (26.6 format) for scalable formats,    */\n  /*                   and in pixels for fixed-sizes formats.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this method.  Other layouts, or more sophisticated    */\n  /*    kernings, are out of the scope of this API function -- they can be */\n  /*    implemented through format-specific interfaces.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Track_Kerning                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the track kerning for a given face object at a given size.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to a source face object.                    */\n  /*                                                                       */\n  /*    point_size :: The point size in 16.16 fractional points.           */\n  /*                                                                       */\n  /*    degree     :: The degree of tightness.  Increasingly negative      */\n  /*                  values represent tighter track kerning, while        */\n  /*                  increasingly positive values represent looser track  */\n  /*                  kerning.  Value zero means no track kerning.         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning   :: The kerning in 16.16 fractional points, to be        */\n  /*                  uniformly applied between all glyphs.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, only the Type~1 font driver supports track kerning,     */\n  /*    using data from AFM files (if attached with @FT_Attach_File or     */\n  /*    @FT_Attach_Stream).                                                */\n  /*                                                                       */\n  /*    Only very few AFM files come with track kerning data; please refer */\n  /*    to the Adobe's AFM specification for more details.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII name of a given glyph in a face.  This only     */\n  /*    works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    buffer_max  :: The maximum number of bytes available in the        */\n  /*                   buffer.                                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer      :: A pointer to a target buffer where the name is      */\n  /*                   copied to.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error is returned if the face doesn't provide glyph names or if */\n  /*    the glyph index is invalid.  In all cases of failure, the first    */\n  /*    byte of `buffer' is set to~0 to indicate an empty name.            */\n  /*                                                                       */\n  /*    The glyph name is truncated to fit within the buffer if it is too  */\n  /*    long.  The returned string is always zero-terminated.              */\n  /*                                                                       */\n  /*    Be aware that FreeType reorders glyph indices internally so that   */\n  /*    glyph index~0 always corresponds to the `missing glyph' (called    */\n  /*    `.notdef').                                                        */\n  /*                                                                       */\n  /*    This function is not compiled within the library if the config     */\n  /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */\n  /*    `include/freetype/config/ftoptions.h'.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII PostScript name of a given face, if available.  */\n  /*    This only works with PostScript and TrueType fonts.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the face's PostScript name.  NULL if unavailable.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned pointer is owned by the face and is destroyed with    */\n  /*    it.                                                                */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_Postscript_Name( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Charmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap by its encoding tag (as listed in           */\n  /*    `freetype.h').                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    encoding :: A handle to the selected encoding.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if no charmap in the face           */\n  /*    corresponds to the encoding queried here.                          */\n  /*                                                                       */\n  /*    Because many fonts contain more than a single cmap for Unicode     */\n  /*    encoding, this function has some special code to select the one    */\n  /*    which covers Unicode best (`best' in the sense that a UCS-4 cmap   */\n  /*    is preferred to a UCS-2 cmap).  It is thus preferable to           */\n  /*    @FT_Set_Charmap in this case.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Charmap                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap for character code to glyph index mapping.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap :: A handle to the selected charmap.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if the charmap is not part of       */\n  /*    the face (i.e., if it is not listed in the `face->charmaps'        */\n  /*    table).                                                            */\n  /*                                                                       */\n  /*    It also fails if a type~14 charmap is selected.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Get_Charmap_Index\n   *\n   * @description:\n   *   Retrieve index of a given charmap.\n   *\n   * @input:\n   *   charmap ::\n   *     A handle to a charmap.\n   *\n   * @return:\n   *   The index into the array of character maps within the face to which\n   *   `charmap' belongs.  If an error occurs, -1 is returned.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Char_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code.  This function   */\n  /*    uses a charmap object to do the mapping.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /*    charcode :: The character code.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within the  */\n  /*    file.  This is done to ensure that value~0 always corresponds to   */\n  /*    the `missing glyph'.  If the first glyph is not named `.notdef',   */\n  /*    then for Type~1 and Type~42 fonts, `.notdef' will be moved into    */\n  /*    the glyph ID~0 position, and whatever was there will be moved to   */\n  /*    the position `.notdef' had.  For Type~1 fonts, if there is no      */\n  /*    `.notdef' glyph at all, then one will be created at index~0 and    */\n  /*    whatever was there will be moved to the last index -- Type~42      */\n  /*    fonts are considered invalid under this condition.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_First_Char                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the first character code in the    */\n  /*    current charmap of a given face.  It also returns the              */\n  /*    corresponding glyph index.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex :: Glyph index of first character code.  0~if charmap is   */\n  /*               empty.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's first character code.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_Next_Char to be able to  */\n  /*    parse all character codes available in a given charmap.  The code  */\n  /*    should look like this:                                             */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_ULong  charcode;                                              */\n  /*      FT_UInt   gindex;                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      charcode = FT_Get_First_Char( face, &gindex );                   */\n  /*      while ( gindex != 0 )                                            */\n  /*      {                                                                */\n  /*        ... do something with (charcode,gindex) pair ...               */\n  /*                                                                       */\n  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */\n  /*      }                                                                */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 if the charmap is empty.  The     */\n  /*    result itself can be~0 in two cases: if the charmap is empty or    */\n  /*    if the value~0 is the first valid character code.                  */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Next_Char                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the next character code in the     */\n  /*    current charmap of a given face following the value `char_code',   */\n  /*    as well as the corresponding glyph index.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: A handle to the source face object.                   */\n  /*    char_code :: The starting character code.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex   :: Glyph index of next character code.  0~if charmap     */\n  /*                 is empty.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's next character code.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_First_Char to walk       */\n  /*    over all character codes available in a given charmap.  See the    */\n  /*    note for this function for a simple code example.                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 when there are no more codes in   */\n  /*    the charmap.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_Next_Char( FT_Face    face,\n                    FT_ULong   char_code,\n                    FT_UInt   *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Name_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given glyph name.  This function uses  */\n  /*    driver specific objects to do the translation.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the source face object.                  */\n  /*                                                                       */\n  /*    glyph_name :: The glyph name.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name );\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SUBGLYPH_FLAG_XXX\n   *\n   * @description:\n   *   A list of constants used to describe subglyphs.  Please refer to the\n   *   TrueType specification for the meaning of the various flags.\n   *\n   * @values:\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::\n   *   FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::\n   *   FT_SUBGLYPH_FLAG_SCALE ::\n   *   FT_SUBGLYPH_FLAG_XY_SCALE ::\n   *   FT_SUBGLYPH_FLAG_2X2 ::\n   *   FT_SUBGLYPH_FLAG_USE_MY_METRICS ::\n   *\n   */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_SubGlyph_Info\n   *\n   * @description:\n   *   Retrieve a description of a given subglyph.  Only use it if\n   *   `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is\n   *   returned otherwise.\n   *\n   * @input:\n   *   glyph ::\n   *     The source glyph slot.\n   *\n   *   sub_index ::\n   *     The index of the subglyph.  Must be less than\n   *     `glyph->num_subglyphs'.\n   *\n   * @output:\n   *   p_index ::\n   *     The glyph index of the subglyph.\n   *\n   *   p_flags ::\n   *     The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.\n   *\n   *   p_arg1 ::\n   *     The subglyph's first argument (if any).\n   *\n   *   p_arg2 ::\n   *     The subglyph's second argument (if any).\n   *\n   *   p_transform ::\n   *     The subglyph transformation (if any).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The values of `*p_arg1', `*p_arg2', and `*p_transform' must be\n   *   interpreted depending on the flags returned in `*p_flags'.  See the\n   *   TrueType specification for details.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FSTYPE_XXX                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `fsType' field of the OS/2 table   */\n  /*    in a TrueType or OpenType font and the `FSType' entry in a         */\n  /*    PostScript font.  These bit flags are returned by                  */\n  /*    @FT_Get_FSType_Flags; they inform client applications of embedding */\n  /*    and subsetting restrictions associated with a font.                */\n  /*                                                                       */\n  /*    See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for  */\n  /*    more details.                                                      */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING ::                                 */\n  /*      Fonts with no fsType bit set may be embedded and permanently     */\n  /*      installed on the remote system by an application.                */\n  /*                                                                       */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING ::                          */\n  /*      Fonts that have only this bit set must not be modified, embedded */\n  /*      or exchanged in any manner without first obtaining permission of */\n  /*      the font software copyright owner.                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING ::                           */\n  /*      If this bit is set, the font may be embedded and temporarily     */\n  /*      loaded on the remote system.  Documents containing Preview &     */\n  /*      Print fonts must be opened `read-only'; no edits can be applied  */\n  /*      to the document.                                                 */\n  /*                                                                       */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING ::                                    */\n  /*      If this bit is set, the font may be embedded but must only be    */\n  /*      installed temporarily on other systems.  In contrast to Preview  */\n  /*      & Print fonts, documents containing editable fonts may be opened */\n  /*      for reading, editing is permitted, and changes may be saved.     */\n  /*                                                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING ::                                         */\n  /*      If this bit is set, the font may not be subsetted prior to       */\n  /*      embedding.                                                       */\n  /*                                                                       */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY ::                                 */\n  /*      If this bit is set, only bitmaps contained in the font may be    */\n  /*      embedded; no outline data may be embedded.  If there are no      */\n  /*      bitmaps available in the font, then the font is unembeddable.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    While the fsType flags can indicate that a font may be embedded, a */\n  /*    license with the font vendor may be separately required to use the */\n  /*    font in this way.                                                  */\n  /*                                                                       */\n#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000\n#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002\n#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004\n#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008\n#define FT_FSTYPE_NO_SUBSETTING                 0x0100\n#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the fsType flags for a font.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The fsType flags, @FT_FSTYPE_XXX.                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use this function rather than directly reading the `fs_type' field */\n  /*    in the @PS_FontInfoRec structure which is only guaranteed to       */\n  /*    return the correct results for Type~1 fonts.                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.8                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UShort )\n  FT_Get_FSType_Flags( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_variants                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Variants                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 interface to Unicode Ideographic Variation          */\n  /*    Sequences (IVS), using the SFNT cmap format~14.                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Many CJK characters have variant forms.  They are a sort of grey   */\n  /*    area somewhere between being totally irrelevant and semantically   */\n  /*    distinct; for this reason, the Unicode consortium decided to       */\n  /*    introduce Ideographic Variation Sequences (IVS), consisting of a   */\n  /*    Unicode base character and one of 240 variant selectors            */\n  /*    (U+E0100-U+E01EF), instead of further extending the already huge   */\n  /*    code range for CJK characters.                                     */\n  /*                                                                       */\n  /*    An IVS is registered and unique; for further details please refer  */\n  /*    to Unicode Technical Standard #37, the Ideographic Variation       */\n  /*    Database:                                                          */\n  /*                                                                       */\n  /*      http://www.unicode.org/reports/tr37/                             */\n  /*                                                                       */\n  /*    To date (November 2012), the character with the most variants is   */\n  /*    U+9089, having 31 such IVS.                                        */\n  /*                                                                       */\n  /*    Adobe and MS decided to support IVS with a new cmap subtable       */\n  /*    (format~14).  It is an odd subtable because it is not a mapping of */\n  /*    input code points to glyphs, but contains lists of all variants    */\n  /*    supported by the font.                                             */\n  /*                                                                       */\n  /*    A variant may be either `default' or `non-default'.  A default     */\n  /*    variant is the one you will get for that code point if you look it */\n  /*    up in the standard Unicode cmap.  A non-default variant is a       */\n  /*    different glyph.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIndex                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code as modified by    */\n  /*    the variation selector.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character code point in Unicode.                             */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode code point of the variation selector.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means either `undefined character code', or    */\n  /*    `undefined selector code', or `no variation selector cmap          */\n  /*    subtable', or `current CharMap is not Unicode'.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value~0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  /*    This function is only meaningful if                                */\n  /*      a) the font has a variation selector cmap sub table,             */\n  /*    and                                                                */\n  /*      b) the current charmap has a Unicode encoding.                   */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Face_GetCharVariantIndex( FT_Face   face,\n                               FT_ULong  charcode,\n                               FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIsDefault                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether this variant of this Unicode character is the one to */\n  /*    be found in the `cmap'.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode codepoint of the variation selector.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if found in the standard (Unicode) cmap, 0~if found in the       */\n  /*    variation selector cmap, or -1 if it is not a variant.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is only meaningful if the font has a variation       */\n  /*    selector cmap subtable.                                            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Int )\n  FT_Face_GetCharVariantIsDefault( FT_Face   face,\n                                   FT_ULong  charcode,\n                                   FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantSelectors                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    in the font.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of selector code points, or NULL if there is */\n  /*    no valid variant selector cmap subtable.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantSelectors( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantsOfChar                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    for the specified character code.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of variant selector code points which are    */\n  /*    active for the given character, or NULL if the corresponding list  */\n  /*    is empty.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantsOfChar( FT_Face   face,\n                             FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharsOfVariant                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode character codes found for */\n  /*    the specified variant selector.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The variant selector code point in Unicode.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A list of all the code points which are specified by this selector */\n  /*    (both default and non-default codes are returned) or NULL if there */\n  /*    is no valid cmap or the variant selector is invalid.               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetCharsOfVariant( FT_Face   face,\n                             FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Computations                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Crunching fixed numbers and vectors.                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various functions used to perform            */\n  /*    computations on 16.16 fixed-float numbers or 2d vectors.           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_MulDiv                                                          */\n  /*    FT_MulFix                                                          */\n  /*    FT_DivFix                                                          */\n  /*    FT_RoundFix                                                        */\n  /*    FT_CeilFix                                                         */\n  /*    FT_FloorFix                                                        */\n  /*    FT_Vector_Transform                                                */\n  /*    FT_Matrix_Multiply                                                 */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    with maximum accuracy (it uses a 64-bit intermediate integer       */\n  /*    whenever necessary).                                               */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c );\n\n\n  /* */\n\n  /* The following #if 0 ... #endif is for the documentation formatter, */\n  /* hiding the internal `FT_MULFIX_INLINED' macro.                     */\n\n#if 0\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*b)/0x10000' with maximum accuracy.  Most of the time this is   */\n  /*    used to multiply a given value by a 16.16 fixed-point factor.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/0x10000'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function has been optimized for the case where the absolute   */\n  /*    value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */\n  /*    As this happens mainly when scaling from notional units to         */\n  /*    fractional pixels in FreeType, it resulted in noticeable speed     */\n  /*    improvements between versions 2.x and 1.x.                         */\n  /*                                                                       */\n  /*    As a conclusion, always try to place a 16.16 factor as the         */\n  /*    _second_ argument of this function; this can make a great          */\n  /*    difference.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n\n  /* */\n#endif\n\n#ifdef FT_MULFIX_INLINED\n#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )\n#else\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_DivFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*0x10000)/b' with maximum accuracy.  Most of the time, this is  */\n  /*    used to divide a given value by a 16.16 fixed-point factor.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*0x10000)/b'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The optimization for FT_DivFix() is simple: If (a~<<~16) fits in   */\n  /*    32~bits, then the division is computed directly.  Otherwise, we    */\n  /*    use a specialized version of @FT_MulDiv.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_RoundFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to round a 16.16 fixed number.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number to be rounded.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x8000) & -0x10000'.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_CeilFix                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the ceiling function of a   */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the ceiling function is to be computed.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FloorFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the floor function of a     */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the floor function is to be computed.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `a & -0x10000'.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Vector_Transform                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a single vector through a 2x2 matrix.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    vector :: The target vector to transform.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the source 2x2 matrix.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `vector' or `matrix' is invalid. */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Vector_Transform( FT_Vector*        vec,\n                       const FT_Matrix*  matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    version                                                            */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType Version                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions and macros related to FreeType versions.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Note that those functions and macros are of limited use because    */\n  /*    even a new release of FreeType with only documentation changes     */\n  /*    increases the version number.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FREETYPE_XXX\n   *\n   * @description:\n   *   These three macros identify the FreeType source code version.\n   *   Use @FT_Library_Version to access them at runtime.\n   *\n   * @values:\n   *   FREETYPE_MAJOR :: The major version number.\n   *   FREETYPE_MINOR :: The minor version number.\n   *   FREETYPE_PATCH :: The patch level.\n   *\n   * @note:\n   *   The version number of FreeType if built as a dynamic link library\n   *   with the `libtool' package is _not_ controlled by these three\n   *   macros.\n   *\n   */\n#define FREETYPE_MAJOR  2\n#define FREETYPE_MINOR  5\n#define FREETYPE_PATCH  0\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the version of the FreeType library being used.  This is    */\n  /*    useful when dynamically linking to the library, since one cannot   */\n  /*    use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and               */\n  /*    @FREETYPE_PATCH.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A source library handle.                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amajor  :: The major version number.                               */\n  /*                                                                       */\n  /*    aminor  :: The minor version number.                               */\n  /*                                                                       */\n  /*    apatch  :: The patch version number.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' argument is because */\n  /*    certain programs implement library initialization in a custom way  */\n  /*    that doesn't use @FT_Init_FreeType.                                */\n  /*                                                                       */\n  /*    In such cases, the library version might not be available before   */\n  /*    the library object has been created.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse all bytecode instructions of a TrueType font file to check   */\n  /*    whether any of the patented opcodes are used.  This is only useful */\n  /*    if you want to be able to use the unpatented hinter with           */\n  /*    fonts that do *not* use these opcodes.                             */\n  /*                                                                       */\n  /*    Note that this function parses *all* glyph instructions in the     */\n  /*    font file, which may be slow.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face handle.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if this is a TrueType font that uses one of the patented         */\n  /*    opcodes, 0~otherwise.                                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Enable or disable the unpatented hinter for a given face.          */\n  /*    Only enable it if you have determined that the face doesn't        */\n  /*    use any patented opcodes (see @FT_Face_CheckTrueTypePatents).      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A face handle.                                            */\n  /*                                                                       */\n  /*    value :: New boolean setting.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The old setting value.  This will always be false if this is not   */\n  /*    an SFNT font, or if the unpatented hinter is not compiled in this  */\n  /*    instance of the library.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FREETYPE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftadvanc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftadvanc.h                                                             */\n/*                                                                         */\n/*    Quick computation of advance widths (specification only).            */\n/*                                                                         */\n/*  Copyright 2008, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTADVANC_H__\n#define __FTADVANC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   quick_advance\n   *\n   * @title:\n   *   Quick retrieval of advance values\n   *\n   * @abstract:\n   *   Retrieve horizontal and vertical advance values without processing\n   *   glyph outlines, if possible.\n   *\n   * @description:\n   *   This section contains functions to quickly extract advance values\n   *   without handling glyph outlines, if possible.\n   */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_ADVANCE_FLAG_FAST_ONLY                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A bit-flag to be OR-ed with the `flags' parameter of the           */\n  /*    @FT_Get_Advance and @FT_Get_Advances functions.                    */\n  /*                                                                       */\n  /*    If set, it indicates that you want these functions to fail if the  */\n  /*    corresponding hinting mode or font driver doesn't allow for very   */\n  /*    quick advance computation.                                         */\n  /*                                                                       */\n  /*    Typically, glyphs which are either unscaled, unhinted, bitmapped,  */\n  /*    or light-hinted can have their advance width computed very         */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /*    Normal and bytecode hinted modes, which require loading, scaling,  */\n  /*    and hinting of the glyph outline, are extremely slow by            */\n  /*    comparison.                                                        */\n  /*                                                                       */\n#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advance                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance value of a given glyph outline in an          */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: The source @FT_Face handle.                          */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /*    load_flags :: A set of bit flags similar to those used when        */\n  /*                  calling @FT_Load_Glyph, used to determine what kind  */\n  /*                  of advances you need.                                */\n  /* <Output>                                                              */\n  /*    padvance :: The advance value.  If scaling is performed (based on  */\n  /*                the value of `load_flags'), the advance value is in    */\n  /*                16.16 format.  Otherwise, it is in font units.         */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */\n  /*                vertical advance corresponding to a vertical layout.   */\n  /*                Otherwise, it is the horizontal advance in a           */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    A scaled advance is returned in 16.16 format but isn't transformed */\n  /*    by the affine transformation specified by @FT_Set_Transform.       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advance( FT_Face    face,\n                  FT_UInt    gindex,\n                  FT_Int32   load_flags,\n                  FT_Fixed  *padvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advances                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance values of several glyph outlines in an        */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: The source @FT_Face handle.                         */\n  /*                                                                       */\n  /*    start       :: The first glyph index.                              */\n  /*                                                                       */\n  /*    count       :: The number of advance values you want to retrieve.  */\n  /*                                                                       */\n  /*    load_flags  :: A set of bit flags similar to those used when       */\n  /*                   calling @FT_Load_Glyph.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    padvance :: The advance values.  This array, to be provided by the */\n  /*                caller, must contain at least `count' elements.        */\n  /*                                                                       */\n  /*                If scaling is performed (based on the value of         */\n  /*                `load_flags'), the advance values are in 16.16 format. */\n  /*                Otherwise, they are in font units.                     */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */\n  /*                vertical advances corresponding to a vertical layout.  */\n  /*                Otherwise, they are the horizontal advances in a       */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    Scaled advances are returned in 16.16 format but aren't            */\n  /*    transformed by the affine transformation specified by              */\n  /*    @FT_Set_Transform.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advances( FT_Face    face,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed  *padvances );\n\n/* */\n\n\nFT_END_HEADER\n\n#endif /* __FTADVANC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftautoh.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftautoh.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the auto-hinter (specification only).   */\n/*                                                                         */\n/*  Copyright 2012, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTAUTOH_H__\n#define __FTAUTOH_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   auto_hinter\n   *\n   * @title:\n   *   The auto-hinter\n   *\n   * @abstract:\n   *   Controlling the auto-hinting module.\n   *\n   * @description:\n   *   While FreeType's auto-hinter doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   Note that the auto-hinter's module name is `autofitter' for\n   *   historical reasons.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   glyph-to-script-map\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The auto-hinter provides various script modules to hint glyphs.\n   *   Examples of supported scripts are Latin or CJK.  Before a glyph is\n   *   auto-hinted, the Unicode character map of the font gets examined, and\n   *   the script is then determined based on Unicode character ranges, see\n   *   below.\n   *\n   *   OpenType fonts, however, often provide much more glyphs than\n   *   character codes (small caps, superscripts, ligatures, swashes, etc.),\n   *   to be controlled by so-called `features'.  Handling OpenType features\n   *   can be quite complicated and thus needs a separate library on top of\n   *   FreeType.\n   *\n   *   The mapping between glyph indices and scripts (in the auto-hinter\n   *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an\n   *   array with `num_glyphs' elements, as found in the font's @FT_Face\n   *   structure.  The `glyph-to-script-map' property returns a pointer to\n   *   this array which can be modified as needed.  Note that the\n   *   modification should happen before the first glyph gets processed by\n   *   the auto-hinter so that the global analysis of the font shapes\n   *   actually uses the modified mapping.\n   *\n   *   The following example code demonstrates how to access it (omitting\n   *   the error handling).\n   *\n   *   {\n   *     FT_Library                library;\n   *     FT_Face                   face;\n   *     FT_Prop_GlyphToScriptMap  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *\n   *     prop.face = face;\n   *\n   *     FT_Property_Get( library, \"autofitter\",\n   *                               \"glyph-to-script-map\", &prop );\n   *\n   *     // adjust `prop.map' as needed right here\n   *\n   *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );\n   *   }\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_AUTOHINTER_SCRIPT_XXX\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   A list of constants used for the @glyph-to-script-map property to\n   *   specify the script submodule the auto-hinter should use for hinting a\n   *   particular glyph.\n   *\n   * @values:\n   *   FT_AUTOHINTER_SCRIPT_NONE ::\n   *     Don't auto-hint this glyph.\n   *\n   *   FT_AUTOHINTER_SCRIPT_LATIN ::\n   *     Apply the latin auto-hinter.  For the auto-hinter, `latin' is a\n   *     very broad term, including Cyrillic and Greek also since characters\n   *     from those scripts share the same design constraints.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0020 - U+007F  // Basic Latin (no control characters)\n   *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)\n   *       U+0100 - U+017F  // Latin Extended-A\n   *       U+0180 - U+024F  // Latin Extended-B\n   *       U+0250 - U+02AF  // IPA Extensions\n   *       U+02B0 - U+02FF  // Spacing Modifier Letters\n   *       U+0300 - U+036F  // Combining Diacritical Marks\n   *       U+0370 - U+03FF  // Greek and Coptic\n   *       U+0400 - U+04FF  // Cyrillic\n   *       U+0500 - U+052F  // Cyrillic Supplement\n   *       U+1D00 - U+1D7F  // Phonetic Extensions\n   *       U+1D80 - U+1DBF  // Phonetic Extensions Supplement\n   *       U+1DC0 - U+1DFF  // Combining Diacritical Marks Supplement\n   *       U+1E00 - U+1EFF  // Latin Extended Additional\n   *       U+1F00 - U+1FFF  // Greek Extended\n   *       U+2000 - U+206F  // General Punctuation\n   *       U+2070 - U+209F  // Superscripts and Subscripts\n   *       U+20A0 - U+20CF  // Currency Symbols\n   *       U+2150 - U+218F  // Number Forms\n   *       U+2460 - U+24FF  // Enclosed Alphanumerics\n   *       U+2C60 - U+2C7F  // Latin Extended-C\n   *       U+2DE0 - U+2DFF  // Cyrillic Extended-A\n   *       U+2E00 - U+2E7F  // Supplemental Punctuation\n   *       U+A640 - U+A69F  // Cyrillic Extended-B\n   *       U+A720 - U+A7FF  // Latin Extended-D\n   *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)\n   *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols\n   *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_CJK ::\n   *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old\n   *     Vietnamese, and some other scripts.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+1100 - U+11FF  // Hangul Jamo\n   *       U+2E80 - U+2EFF  // CJK Radicals Supplement\n   *       U+2F00 - U+2FDF  // Kangxi Radicals\n   *       U+2FF0 - U+2FFF  // Ideographic Description Characters\n   *       U+3000 - U+303F  // CJK Symbols and Punctuation\n   *       U+3040 - U+309F  // Hiragana\n   *       U+30A0 - U+30FF  // Katakana\n   *       U+3100 - U+312F  // Bopomofo\n   *       U+3130 - U+318F  // Hangul Compatibility Jamo\n   *       U+3190 - U+319F  // Kanbun\n   *       U+31A0 - U+31BF  // Bopomofo Extended\n   *       U+31C0 - U+31EF  // CJK Strokes\n   *       U+31F0 - U+31FF  // Katakana Phonetic Extensions\n   *       U+3200 - U+32FF  // Enclosed CJK Letters and Months\n   *       U+3300 - U+33FF  // CJK Compatibility\n   *       U+3400 - U+4DBF  // CJK Unified Ideographs Extension A\n   *       U+4DC0 - U+4DFF  // Yijing Hexagram Symbols\n   *       U+4E00 - U+9FFF  // CJK Unified Ideographs\n   *       U+A960 - U+A97F  // Hangul Jamo Extended-A\n   *       U+AC00 - U+D7AF  // Hangul Syllables\n   *       U+D7B0 - U+D7FF  // Hangul Jamo Extended-B\n   *       U+F900 - U+FAFF  // CJK Compatibility Ideographs\n   *       U+FE10 - U+FE1F  // Vertical forms\n   *       U+FE30 - U+FE4F  // CJK Compatibility Forms\n   *       U+FF00 - U+FFEF  // Halfwidth and Fullwidth Forms\n   *      U+1B000 - U+1B0FF // Kana Supplement\n   *      U+1D300 - U+1D35F // Tai Xuan Hing Symbols\n   *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement\n   *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B\n   *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C\n   *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D\n   *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_INDIC ::\n   *     Apply the indic auto-hinter, covering all major scripts from the\n   *     Indian sub-continent and some other related scripts like Thai, Lao,\n   *     or Tibetan.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0900 - U+0DFF  // Indic Range\n   *       U+0F00 - U+0FFF  // Tibetan\n   *       U+1900 - U+194F  // Limbu\n   *       U+1B80 - U+1BBF  // Sundanese\n   *       U+1C80 - U+1CDF  // Meetei Mayak\n   *       U+A800 - U+A82F  // Syloti Nagri\n   *      U+11800 - U+118DF // Sharada\n   *     }\n   *\n   *     Note that currently Indic support is rudimentary only, missing blue\n   *     zone support.\n   *\n   */\n#define FT_AUTOHINTER_SCRIPT_NONE   0\n#define FT_AUTOHINTER_SCRIPT_LATIN  1\n#define FT_AUTOHINTER_SCRIPT_CJK    2\n#define FT_AUTOHINTER_SCRIPT_INDIC  3\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_GlyphToScriptMap\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The data exchange structure for the @glyph-to-script-map property.\n   *\n   */\n   typedef struct  FT_Prop_GlyphToScriptMap_\n   {\n     FT_Face   face;\n     FT_Byte*  map;\n\n   } FT_Prop_GlyphToScriptMap;\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   fallback-script\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   If no auto-hinter script module can be assigned to a glyph, a\n   *   fallback script gets assigned to it (see also the\n   *   @glyph-to-script-map property).  By default, this is\n   *   @FT_AUTOHINTER_SCRIPT_CJK.  Using the `fallback-script' property,\n   *   this fallback value can be changed.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"fallback-script\", &fallback_script );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   It's important to use the right timing for changing this value: The\n   *   creation of the glyph-to-script map which eventually uses the\n   *   fallback script value gets triggered either by setting or reading a\n   *   face-specific property like @glyph-to-script-map, or by auto-hinting\n   *   any glyph from that face.  In particular, if you have already created\n   *   an @FT_Face structure but not loaded any glyph (using the\n   *   auto-hinter), a change of the fallback glyph will affect this face.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   increase-x-height\n   *\n   * @description:\n   *   For ppem values in the range 6~<= ppem <= `increase-x-height', round\n   *   up the font's x~height much more often than normally.  If the value\n   *   is set to~0, which is the default, this feature is switched off.  Use\n   *   this property to improve the legibility of small font sizes if\n   *   necessary.\n   *\n   *   {\n   *     FT_Library               library;\n   *     FT_Face                  face;\n   *     FT_Prop_IncreaseXHeight  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *     FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );\n   *\n   *     prop.face  = face;\n   *     prop.limit = 14;\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"increase-x-height\", &prop );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   Set this value right after calling @FT_Set_Char_Size, but before\n   *   loading any glyph (using the auto-hinter).\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_IncreaseXHeight\n   *\n   * @description:\n   *   The data exchange structure for the @increase-x-height property.\n   *\n   */\n   typedef struct  FT_Prop_IncreaseXHeight_\n   {\n     FT_Face  face;\n     FT_UInt  limit;\n\n   } FT_Prop_IncreaseXHeight;\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTAUTOH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftbbox.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.h                                                               */\n/*                                                                         */\n/*    FreeType exact bbox computation (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /* It is separated from the rest of the engine for various technical     */\n  /* reasons.  It may well be integrated in `ftoutln' later.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTBBOX_H__\n#define __FTBBOX_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the exact bounding box of an outline.  This is slower      */\n  /*    than computing the control box.  However, it uses an advanced      */\n  /*    algorithm which returns _very_ quickly when the two boxes          */\n  /*    coincide.  Otherwise, the outline Bézier arcs are traversed to     */\n  /*    extract their extrema.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abbox   :: The outline's exact bounding box.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get      */\n  /*    reasonable values for the BBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the BBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBBOX_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (specification).     */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2009 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBDF_H__\n#define __FTBDF_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bdf_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BDF and PCF Files                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    BDF and PCF specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions specific to BDF */\n  /*    and PCF fonts.                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @enum:\n   *    FT_PropertyType\n   *\n   * @description:\n   *    A list of BDF property types.\n   *\n   * @values:\n   *    BDF_PROPERTY_TYPE_NONE ::\n   *      Value~0 is used to indicate a missing property.\n   *\n   *    BDF_PROPERTY_TYPE_ATOM ::\n   *      Property is a string atom.\n   *\n   *    BDF_PROPERTY_TYPE_INTEGER ::\n   *      Property is a 32-bit signed integer.\n   *\n   *    BDF_PROPERTY_TYPE_CARDINAL ::\n   *      Property is a 32-bit unsigned integer.\n   */\n  typedef enum  BDF_PropertyType_\n  {\n    BDF_PROPERTY_TYPE_NONE     = 0,\n    BDF_PROPERTY_TYPE_ATOM     = 1,\n    BDF_PROPERTY_TYPE_INTEGER  = 2,\n    BDF_PROPERTY_TYPE_CARDINAL = 3\n\n  } BDF_PropertyType;\n\n\n  /**********************************************************************\n   *\n   * @type:\n   *    BDF_Property\n   *\n   * @description:\n   *    A handle to a @BDF_PropertyRec structure to model a given\n   *    BDF/PCF property.\n   */\n  typedef struct BDF_PropertyRec_*  BDF_Property;\n\n\n /**********************************************************************\n  *\n  * @struct:\n  *    BDF_PropertyRec\n  *\n  * @description:\n  *    This structure models a given BDF/PCF property.\n  *\n  * @fields:\n  *    type ::\n  *      The property type.\n  *\n  *    u.atom ::\n  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.\n  *\n  *    u.integer ::\n  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.\n  *\n  *    u.cardinal ::\n  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.\n  */\n  typedef struct  BDF_PropertyRec_\n  {\n    BDF_PropertyType  type;\n    union {\n      const char*     atom;\n      FT_Int32        integer;\n      FT_UInt32       cardinal;\n\n    } u;\n\n  } BDF_PropertyRec;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Charset_ID\n  *\n  * @description:\n  *    Retrieve a BDF font character set identity, according to\n  *    the BDF specification.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  * @output:\n  *    acharset_encoding ::\n  *       Charset encoding, as a C~string, owned by the face.\n  *\n  *    acharset_registry ::\n  *       Charset registry, as a C~string, owned by the face.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with BDF faces, returning an error otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Property\n  *\n  * @description:\n  *    Retrieve a BDF property from a BDF or PCF font file.\n  *\n  * @input:\n  *    face :: A handle to the input face.\n  *\n  *    name :: The property name.\n  *\n  * @output:\n  *    aproperty :: The property.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function works with BDF _and_ PCF fonts.  It returns an error\n  *   otherwise.  It also returns an error if the property is not in the\n  *   font.\n  *\n  *   A `property' is a either key-value pair within the STARTPROPERTIES\n  *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the\n  *   `info->props' array within a `FontRec' structure of a PCF font.\n  *\n  *   Integer properties are always stored as `signed' within PCF fonts;\n  *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value\n  *   for BDF fonts only.\n  *\n  *   In case of error, `aproperty->type' is always set to\n  *   @BDF_PROPERTY_TYPE_NONE.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftbitmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.h                                                             */\n/*                                                                         */\n/*    FreeType utility functions for bitmaps (specification).              */\n/*                                                                         */\n/*  Copyright 2004-2006, 2008, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBITMAP_H__\n#define __FTBITMAP_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bitmap_handling                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Bitmap Handling                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Handling FT_Bitmap objects.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains functions for converting FT_Bitmap objects.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_New                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a pointer to an @FT_Bitmap structure.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the bitmap structure.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Copy                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy a bitmap into another one.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    source  :: A handle to the source bitmap.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target  :: A handle to the target bitmap.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Embolden                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\n  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\n  /*    borders are kept unchanged.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /*    yStrength :: How strong the glyph is emboldened vertically.        */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    bitmap    :: A handle to the target bitmap.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The current implementation restricts `xStrength' to be less than   */\n  /*    or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\n  /*                                                                       */\n  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */\n  /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Convert                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */\n  /*    to a bitmap object with depth 8bpp, making the number of used      */\n  /*    bytes line (a.k.a. the `pitch') a multiple of `alignment'.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    source    :: The source bitmap.                                    */\n  /*                                                                       */\n  /*    alignment :: The pitch of the bitmap is a multiple of this         */\n  /*                 parameter.  Common values are 1, 2, or 4.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target    :: The target bitmap.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\n  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\n  /*                                                                       */\n  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\n  /*                                                                       */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GlyphSlot_Own_Bitmap                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Make sure that a glyph slot owns `slot->bitmap'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: The glyph slot.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is to be used in combination with                    */\n  /*    @FT_Bitmap_Embolden.                                               */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    bitmap  :: The bitmap object to be freed.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBITMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftbzip2.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbzip2.h                                                              */\n/*                                                                         */\n/*    Bzip2-compressed stream support.                                     */\n/*                                                                         */\n/*  Copyright 2010 by                                                      */\n/*  Joel Klinghed.                                                         */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBZIP2_H__\n#define __FTBZIP2_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bzip2                                                              */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BZIP2 Streams                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using bzip2-compressed font files.                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Bzip2-specific functions. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenBzip2\n  *\n  * @description:\n  *   Open a new stream to parse bzip2-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.bz2' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, bzip2 compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a bzip2 compressed stream\n  *   from it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with bzip2 support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBZIP2_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftcache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.h                                                              */\n/*                                                                         */\n/*    FreeType Cache subsystem (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCACHE_H__\n#define __FTCACHE_H__\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************\n   *\n   * <Section>\n   *    cache_subsystem\n   *\n   * <Title>\n   *    Cache Sub-System\n   *\n   * <Abstract>\n   *    How to cache face, size, and glyph data with FreeType~2.\n   *\n   * <Description>\n   *   This section describes the FreeType~2 cache sub-system, which is used\n   *   to limit the number of concurrently opened @FT_Face and @FT_Size\n   *   objects, as well as caching information like character maps and glyph\n   *   images while limiting their maximum memory usage.\n   *\n   *   Note that all types and functions begin with the `FTC_' prefix.\n   *\n   *   The cache is highly portable and thus doesn't know anything about the\n   *   fonts installed on your system, or how to access them.  This implies\n   *   the following scheme:\n   *\n   *   First, available or installed font faces are uniquely identified by\n   *   @FTC_FaceID values, provided to the cache by the client.  Note that\n   *   the cache only stores and compares these values, and doesn't try to\n   *   interpret them in any way.\n   *\n   *   Second, the cache calls, only when needed, a client-provided function\n   *   to convert an @FTC_FaceID into a new @FT_Face object.  The latter is\n   *   then completely managed by the cache, including its termination\n   *   through @FT_Done_Face.  To monitor termination of face objects, the\n   *   finalizer callback in the `generic' field of the @FT_Face object can\n   *   be used, which might also be used to store the @FTC_FaceID of the\n   *   face.\n   *\n   *   Clients are free to map face IDs to anything else.  The most simple\n   *   usage is to associate them to a (pathname,face_index) pair that is\n   *   used to call @FT_New_Face.  However, more complex schemes are also\n   *   possible.\n   *\n   *   Note that for the cache to work correctly, the face ID values must be\n   *   *persistent*, which means that the contents they point to should not\n   *   change at runtime, or that their value should not become invalid.\n   *\n   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),\n   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let\n   *   the cache get rid of any references to the old @FTC_FaceID it may\n   *   keep internally.  Failure to do so will lead to incorrect behaviour\n   *   or even crashes.\n   *\n   *   To use the cache, start with calling @FTC_Manager_New to create a new\n   *   @FTC_Manager object, which models a single cache instance.  You can\n   *   then look up @FT_Face and @FT_Size objects with\n   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.\n   *\n   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then\n   *   later use @FTC_CMapCache_Lookup to perform the equivalent of\n   *   @FT_Get_Char_Index, only much faster.\n   *\n   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then\n   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding\n   *   @FT_Glyph objects from the cache.\n   *\n   *   If you need lots of small bitmaps, it is much more memory efficient\n   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This\n   *   returns @FTC_SBitRec structures, which are used to store small\n   *   bitmaps directly.  (A small bitmap is one whose metrics and\n   *   dimensions all fit into 8-bit integers).\n   *\n   *   We hope to also provide a kerning cache in the near future.\n   *\n   *\n   * <Order>\n   *   FTC_Manager\n   *   FTC_FaceID\n   *   FTC_Face_Requester\n   *\n   *   FTC_Manager_New\n   *   FTC_Manager_Reset\n   *   FTC_Manager_Done\n   *   FTC_Manager_LookupFace\n   *   FTC_Manager_LookupSize\n   *   FTC_Manager_RemoveFaceID\n   *\n   *   FTC_Node\n   *   FTC_Node_Unref\n   *\n   *   FTC_ImageCache\n   *   FTC_ImageCache_New\n   *   FTC_ImageCache_Lookup\n   *\n   *   FTC_SBit\n   *   FTC_SBitCache\n   *   FTC_SBitCache_New\n   *   FTC_SBitCache_Lookup\n   *\n   *   FTC_CMapCache\n   *   FTC_CMapCache_New\n   *   FTC_CMapCache_Lookup\n   *\n   *************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    BASIC TYPE DEFINITIONS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type: FTC_FaceID\n   *\n   * @description:\n   *   An opaque pointer type that is used to identity face objects.  The\n   *   contents of such objects is application-dependent.\n   *\n   *   These pointers are typically used to point to a user-defined\n   *   structure containing a font file path, and face index.\n   *\n   * @note:\n   *   Never use NULL as a valid @FTC_FaceID.\n   *\n   *   Face IDs are passed by the client to the cache manager, which calls,\n   *   when needed, the @FTC_Face_Requester to translate them into new\n   *   @FT_Face objects.\n   *\n   *   If the content of a given face ID changes at runtime, or if the value\n   *   becomes invalid (e.g., when uninstalling a font), you should\n   *   immediately call @FTC_Manager_RemoveFaceID before any other cache\n   *   function.\n   *\n   *   Failure to do so will result in incorrect behaviour or even\n   *   memory leaks and crashes.\n   */\n  typedef FT_Pointer  FTC_FaceID;\n\n\n  /************************************************************************\n   *\n   * @functype:\n   *   FTC_Face_Requester\n   *\n   * @description:\n   *   A callback function provided by client applications.  It is used by\n   *   the cache manager to translate a given @FTC_FaceID into a new valid\n   *   @FT_Face object, on demand.\n   *\n   * <Input>\n   *   face_id ::\n   *     The face ID to resolve.\n   *\n   *   library ::\n   *     A handle to a FreeType library object.\n   *\n   *   req_data ::\n   *     Application-provided request data (see note below).\n   *\n   * <Output>\n   *   aface ::\n   *     A new @FT_Face handle.\n   *\n   * <Return>\n   *   FreeType error code.  0~means success.\n   *\n   * <Note>\n   *   The third parameter `req_data' is the same as the one passed by the\n   *   client when @FTC_Manager_New is called.\n   *\n   *   The face requester should not perform funny things on the returned\n   *   face object, like creating a new @FT_Size for it, or setting a\n   *   transformation through @FT_Set_Transform!\n   */\n  typedef FT_Error\n  (*FTC_Face_Requester)( FTC_FaceID  face_id,\n                         FT_Library  library,\n                         FT_Pointer  request_data,\n                         FT_Face*    aface );\n\n /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CACHE MANAGER OBJECT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Manager                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This object corresponds to one instance of the cache-subsystem.    */\n  /*    It is used to cache one or more @FT_Face objects, along with       */\n  /*    corresponding @FT_Size objects.                                    */\n  /*                                                                       */\n  /*    The manager intentionally limits the total number of opened        */\n  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */\n  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */\n  /*                                                                       */\n  /*    The manager is also used to cache `nodes' of various types while   */\n  /*    limiting their total memory usage.                                 */\n  /*                                                                       */\n  /*    All limitations are enforced by keeping lists of managed objects   */\n  /*    in most-recently-used order, and flushing old nodes to make room   */\n  /*    for new ones.                                                      */\n  /*                                                                       */\n  typedef struct FTC_ManagerRec_*  FTC_Manager;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Node                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to a cache node object.  Each cache node is       */\n  /*    reference-counted.  A node with a count of~0 might be flushed      */\n  /*    out of a full cache whenever a lookup request is performed.        */\n  /*                                                                       */\n  /*    If you look up nodes, you have the ability to `acquire' them,      */\n  /*    i.e., to increment their reference count.  This will prevent the   */\n  /*    node from being flushed out of the cache until you explicitly      */\n  /*    `release' it (see @FTC_Node_Unref).                                */\n  /*                                                                       */\n  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */\n  /*                                                                       */\n  typedef struct FTC_NodeRec_*  FTC_Node;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_New                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache manager.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: The parent FreeType library handle to use.            */\n  /*                                                                       */\n  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */\n  /*                 Use~0 for defaults.  Note that this value does not    */\n  /*                 account for managed @FT_Face and @FT_Size objects.    */\n  /*                                                                       */\n  /*    requester :: An application-provided callback used to translate    */\n  /*                 face IDs into real @FT_Face objects.                  */\n  /*                                                                       */\n  /*    req_data  :: A generic pointer that is passed to the requester     */\n  /*                 each time it is called (see @FTC_Face_Requester).     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amanager  :: A handle to a new manager object.  0~in case of       */\n  /*                 failure.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Reset                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Empty a given cache manager.  This simply gets rid of all the      */\n  /*    currently cached @FT_Face and @FT_Size objects within the manager. */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the manager.                                */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Reset( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given manager after emptying it.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the target cache manager object.            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Done( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupFace                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Face object that corresponds to a given face ID   */\n  /*    through a cache manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    face_id :: The ID of the face object.                              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface   :: A handle to the face object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Face object is always owned by the manager.  You  */\n  /*    should never try to discard it yourself.                           */\n  /*                                                                       */\n  /*    The @FT_Face object doesn't necessarily have a current size object */\n  /*    (i.e., face->size can be~0).  If you need a specific `font size',  */\n  /*    use @FTC_Manager_LookupSize instead.                               */\n  /*                                                                       */\n  /*    Never change the face's transformation matrix (i.e., never call    */\n  /*    the @FT_Set_Transform function) on a returned face!  If you need   */\n  /*    to transform glyphs, do it yourself after glyph loading.           */\n  /*                                                                       */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory was available */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_ScalerRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a given character size in either      */\n  /*    pixels or points to the cache manager.  See                        */\n  /*    @FTC_Manager_LookupSize.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id :: The source face ID.                                     */\n  /*                                                                       */\n  /*    width   :: The character width.                                    */\n  /*                                                                       */\n  /*    height  :: The character height.                                   */\n  /*                                                                       */\n  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */\n  /*               interpreted as integer pixel character sizes.           */\n  /*               Otherwise, they are expressed as 1/64th of points.      */\n  /*                                                                       */\n  /*    x_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               horizontal resolution in dpi.                           */\n  /*                                                                       */\n  /*    y_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               vertical resolution in dpi.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This type is mainly used to retrieve @FT_Size objects through the  */\n  /*    cache manager.                                                     */\n  /*                                                                       */\n  typedef struct  FTC_ScalerRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     width;\n    FT_UInt     height;\n    FT_Int      pixel;\n    FT_UInt     x_res;\n    FT_UInt     y_res;\n\n  } FTC_ScalerRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_Scaler                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FTC_ScalerRec structure.                           */\n  /*                                                                       */\n  typedef struct FTC_ScalerRec_*  FTC_Scaler;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupSize                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Size object that corresponds to a given           */\n  /*    @FTC_ScalerRec pointer through a cache manager.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    scaler  :: A scaler handle.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize   :: A handle to the size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Size object is always owned by the manager.  You  */\n  /*    should never try to discard it by yourself.                        */\n  /*                                                                       */\n  /*    You can access the parent @FT_Face object simply as `size->face'   */\n  /*    if you need it.  Note that this object is also owned by the        */\n  /*    manager.                                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory is available  */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Node_Unref                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Decrement a cache node's internal reference count.  When the count */\n  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */\n  /*    cache flushes.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node    :: The cache node handle.                                  */\n  /*                                                                       */\n  /*    manager :: The cache manager handle.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_Manager_RemoveFaceID\n   *\n   * @description:\n   *   A special function used to indicate to the cache manager that\n   *   a given @FTC_FaceID is no longer valid, either because its\n   *   content changed, or because it was deallocated or uninstalled.\n   *\n   * @input:\n   *   manager ::\n   *     The cache manager handle.\n   *\n   *   face_id ::\n   *     The @FTC_FaceID to be removed.\n   *\n   * @note:\n   *   This function flushes all nodes from the cache corresponding to this\n   *   `face_id', with the exception of nodes with a non-null reference\n   *   count.\n   *\n   *   Such nodes are however modified internally so as to never appear\n   *   in later lookups with the same `face_id' value, and to be immediately\n   *   destroyed when released by all their users.\n   *\n   */\n  FT_EXPORT( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_CMapCache\n   *\n   * @description:\n   *   An opaque handle used to model a charmap cache.  This cache is to\n   *   hold character codes -> glyph indices mappings.\n   *\n   */\n  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_New\n   *\n   * @description:\n   *   Create a new charmap cache.\n   *\n   * @input:\n   *   manager ::\n   *     A handle to the cache manager.\n   *\n   * @output:\n   *   acache ::\n   *     A new cache handle.  NULL in case of error.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Like all other caches, this one will be destroyed with the cache\n   *   manager.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_Lookup\n   *\n   * @description:\n   *   Translate a character code into a glyph index, using the charmap\n   *   cache.\n   *\n   * @input:\n   *   cache ::\n   *     A charmap cache handle.\n   *\n   *   face_id ::\n   *     The source face ID.\n   *\n   *   cmap_index ::\n   *     The index of the charmap in the source face.  Any negative value\n   *     means to use the cache @FT_Face's default charmap.\n   *\n   *   char_code ::\n   *     The character code (in the corresponding charmap).\n   *\n   * @return:\n   *    Glyph index.  0~means `no glyph'.\n   *\n   */\n  FT_EXPORT( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       IMAGE CACHE OBJECT                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FTC_ImageTypeRec\n   *\n   * @description:\n   *   A structure used to model the type of images in a glyph cache.\n   *\n   * @fields:\n   *   face_id ::\n   *     The face ID.\n   *\n   *   width ::\n   *     The width in pixels.\n   *\n   *   height ::\n   *     The height in pixels.\n   *\n   *   flags ::\n   *     The load flags, as in @FT_Load_Glyph.\n   *\n   */\n  typedef struct  FTC_ImageTypeRec_\n  {\n    FTC_FaceID  face_id;\n    FT_Int      width;\n    FT_Int      height;\n    FT_Int32    flags;\n\n  } FTC_ImageTypeRec;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_ImageType\n   *\n   * @description:\n   *   A handle to an @FTC_ImageTypeRec structure.\n   *\n   */\n  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;\n\n\n  /* */\n\n\n#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \\\n          ( (d1)->face_id == (d2)->face_id && \\\n            (d1)->width   == (d2)->width   && \\\n            (d1)->flags   == (d2)->flags   )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_ImageCache                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a glyph image cache object.  They are designed to      */\n  /*    hold many distinct glyph images while not exceeding a certain      */\n  /*    memory threshold.                                                  */\n  /*                                                                       */\n  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_New                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new glyph image cache.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: The parent manager for the image cache.                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new glyph image cache object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_Lookup                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a given glyph image from a glyph image cache.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source glyph image cache.                */\n  /*                                                                       */\n  /*    type   :: A pointer to a glyph image type descriptor.              */\n  /*                                                                       */\n  /*    gindex :: The glyph index to retrieve.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: The corresponding @FT_Glyph object.  0~in case of        */\n  /*              failure.                                                 */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_LookupScaler                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source glyph image cache.            */\n  /*                                                                       */\n  /*    scaler     :: A pointer to a scaler descriptor.                    */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index to retrieve.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph     :: The corresponding @FT_Glyph object.  0~in case of    */\n  /*                  failure.                                             */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */\n  /*    glyphs; you should always use the FreeType cache API instead.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBit                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */\n  /*    structure for details.                                             */\n  /*                                                                       */\n  typedef struct FTC_SBitRec_*  FTC_SBit;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_SBitRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very compact structure used to describe a small glyph bitmap.    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width     :: The bitmap width in pixels.                           */\n  /*                                                                       */\n  /*    height    :: The bitmap height in pixels.                          */\n  /*                                                                       */\n  /*    left      :: The horizontal distance from the pen position to the  */\n  /*                 left bitmap border (a.k.a. `left side bearing', or    */\n  /*                 `lsb').                                               */\n  /*                                                                       */\n  /*    top       :: The vertical distance from the pen position (on the   */\n  /*                 baseline) to the upper bitmap border (a.k.a. `top     */\n  /*                 side bearing').  The distance is positive for upwards */\n  /*                 y~coordinates.                                        */\n  /*                                                                       */\n  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */\n  /*                                                                       */\n  /*    max_grays :: Maximum gray level value (in the range 1 to~255).     */\n  /*                                                                       */\n  /*    pitch     :: The number of bytes per bitmap line.  May be positive */\n  /*                 or negative.                                          */\n  /*                                                                       */\n  /*    xadvance  :: The horizontal advance width in pixels.               */\n  /*                                                                       */\n  /*    yadvance  :: The vertical advance height in pixels.                */\n  /*                                                                       */\n  /*    buffer    :: A pointer to the bitmap pixels.                       */\n  /*                                                                       */\n  typedef struct  FTC_SBitRec_\n  {\n    FT_Byte   width;\n    FT_Byte   height;\n    FT_Char   left;\n    FT_Char   top;\n\n    FT_Byte   format;\n    FT_Byte   max_grays;\n    FT_Short  pitch;\n    FT_Char   xadvance;\n    FT_Char   yadvance;\n\n    FT_Byte*  buffer;\n\n  } FTC_SBitRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBitCache                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap cache.  These are special cache objects */\n  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */\n  /*    much more efficient way than the traditional glyph image cache     */\n  /*    implemented by @FTC_ImageCache.                                    */\n  /*                                                                       */\n  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_New                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache to store small glyph bitmaps.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the source cache manager.                   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_Lookup                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Look up a given small glyph bitmap in a given sbit cache and       */\n  /*    `lock' it to prevent its flushing from the cache until needed.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source sbit cache.                       */\n  /*                                                                       */\n  /*    type   :: A pointer to the glyph image type descriptor.            */\n  /*                                                                       */\n  /*    gindex :: The glyph index.                                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit   :: A handle to a small bitmap descriptor.                   */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache    cache,\n                        FTC_ImageType    type,\n                        FT_UInt          gindex,\n                        FTC_SBit        *sbit,\n                        FTC_Node        *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_LookupScaler                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source sbit cache.                   */\n  /*                                                                       */\n  /*    scaler     :: A pointer to the scaler descriptor.                  */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit       :: A handle to a small bitmap descriptor.               */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *sbit,\n                              FTC_Node      *anode );\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftcffdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcffdrv.h                                                             */\n/*                                                                         */\n/*    FreeType API for controlling the CFF driver (specification only).    */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCFFDRV_H__\n#define __FTCFFDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   cff_driver\n   *\n   * @title:\n   *   The CFF driver\n   *\n   * @abstract:\n   *   Controlling the CFF driver module.\n   *\n   * @description:\n   *   While FreeType's CFF driver doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The CFF driver's module name is `cff'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   hinting-engine\n   *\n   * @description:\n   *   Thanks to Adobe, which contributed a new hinting (and parsing)\n   *   engine, an application can select between `freetype' and `adobe' if\n   *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration\n   *   macro isn't defined, `hinting-engine' does nothing.\n   *\n   *   The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is\n   *   defined, and `adobe' otherwise.\n   *\n   *   The following example code demonstrates how to select Adobe's hinting\n   *   engine (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"hinting-engine\", &hinting_engine );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_CFF_HINTING_XXX\n   *\n   * @description:\n   *   A list of constants used for the @hinting-engine property to select\n   *   the hinting engine for CFF fonts.\n   *\n   * @values:\n   *   FT_CFF_HINTING_FREETYPE ::\n   *     Use the old FreeType hinting engine.\n   *\n   *   FT_CFF_HINTING_ADOBE ::\n   *     Use the hinting engine contributed by Adobe.\n   *\n   */\n#define FT_CFF_HINTING_FREETYPE  0\n#define FT_CFF_HINTING_ADOBE     1\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   no-stem-darkening\n   *\n   * @description:\n   *   By default, the Adobe CFF engine darkens stems at smaller sizes,\n   *   regardless of hinting, to enhance contrast.  Setting this property,\n   *   stem darkening gets switched off.\n   *\n   *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_Bool     no_stem_darkening = TRUE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"no-stem-darkening\", &no_stem_darkening );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTCFFDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftchapters.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/* This file defines the structure of the FreeType reference.              */\n/* It is used by the python script which generates the HTML files.         */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    general_remarks                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    General Remarks                                                      */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    user_allocation                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    core_api                                                             */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Core API                                                             */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    version                                                              */\n/*    basic_types                                                          */\n/*    base_interface                                                       */\n/*    glyph_variants                                                       */\n/*    glyph_management                                                     */\n/*    mac_specific                                                         */\n/*    sizes_management                                                     */\n/*    header_file_macros                                                   */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    format_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Format-Specific API                                                  */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    multiple_masters                                                     */\n/*    truetype_tables                                                      */\n/*    type1_tables                                                         */\n/*    sfnt_names                                                           */\n/*    bdf_fonts                                                            */\n/*    cid_fonts                                                            */\n/*    pfr_fonts                                                            */\n/*    winfnt_fonts                                                         */\n/*    font_formats                                                         */\n/*    gasp_table                                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    module_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Controlling FreeType Modules                                         */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    auto_hinter                                                          */\n/*    cff_driver                                                           */\n/*    tt_driver                                                            */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Cache Sub-System                                                     */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    support_api                                                          */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Support API                                                          */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    computations                                                         */\n/*    list_processing                                                      */\n/*    outline_processing                                                   */\n/*    quick_advance                                                        */\n/*    bitmap_handling                                                      */\n/*    raster                                                               */\n/*    glyph_stroker                                                        */\n/*    system_interface                                                     */\n/*    module_management                                                    */\n/*    gzip                                                                 */\n/*    lzw                                                                  */\n/*    bzip2                                                                */\n/*    lcd_filtering                                                        */\n/*                                                                         */\n/***************************************************************************/\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcid.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing CID font information (specification).     */\n/*                                                                         */\n/*  Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal.                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCID_H__\n#define __FTCID_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cid_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    CID Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    CID-keyed font specific API.                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of CID-keyed font specific   */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Registry_Ordering_Supplement\n   *\n   * @description:\n   *    Retrieve the Registry/Ordering/Supplement triple (also known as the\n   *    \"R/O/S\") from a CID-keyed font.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    registry ::\n   *       The registry, as a C~string, owned by the face.\n   *\n   *    ordering ::\n   *       The ordering, as a C~string, owned by the face.\n   *\n   *    supplement ::\n   *       The supplement.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces, returning an error\n   *    otherwise.\n   *\n   * @since:\n   *    2.3.6\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,\n                                           const char*  *registry,\n                                           const char*  *ordering,\n                                           FT_Int       *supplement);\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Is_Internally_CID_Keyed\n   *\n   * @description:\n   *    Retrieve the type of the input face, CID keyed or not.  In\n   *    constrast to the @FT_IS_CID_KEYED macro this function returns\n   *    successfully also for CID-keyed fonts in an SNFT wrapper.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    is_cid ::\n   *       The type of the face as an @FT_Bool.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,\n                                      FT_Bool  *is_cid );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_From_Glyph_Index\n   *\n   * @description:\n   *    Retrieve the CID of the input glyph index.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   *    glyph_index ::\n   *       The input glyph index.\n   *\n   * @output:\n   *    cid ::\n   *       The CID as an @FT_UInt.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_From_Glyph_Index( FT_Face   face,\n                               FT_UInt   glyph_index,\n                               FT_UInt  *cid );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/fterrdef.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrdef.h                                                             */\n/*                                                                         */\n/*    FreeType error codes (specification).                                */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2006, 2007, 2010-2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                LIST OF ERROR CODES/MESSAGES             *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n  /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */\n  /* including this file.                                           */\n\n\n  /* generic errors */\n\n  FT_NOERRORDEF_( Ok,                                        0x00, \\\n                  \"no error\" )\n\n  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \\\n                \"cannot open resource\" )\n  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \\\n                \"unknown file format\" )\n  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \\\n                \"broken file\" )\n  FT_ERRORDEF_( Invalid_Version,                             0x04, \\\n                \"invalid FreeType version\" )\n  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \\\n                \"module version is too low\" )\n  FT_ERRORDEF_( Invalid_Argument,                            0x06, \\\n                \"invalid argument\" )\n  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \\\n                \"unimplemented feature\" )\n  FT_ERRORDEF_( Invalid_Table,                               0x08, \\\n                \"broken table\" )\n  FT_ERRORDEF_( Invalid_Offset,                              0x09, \\\n                \"broken offset within table\" )\n  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \\\n                \"array allocation size too large\" )\n  FT_ERRORDEF_( Missing_Module,                              0x0B, \\\n                \"missing module\" )\n  FT_ERRORDEF_( Missing_Property,                            0x0C, \\\n                \"missing property\" )\n\n  /* glyph/character errors */\n\n  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \\\n                \"invalid glyph index\" )\n  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \\\n                \"invalid character code\" )\n  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \\\n                \"unsupported glyph image format\" )\n  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \\\n                \"cannot render this glyph format\" )\n  FT_ERRORDEF_( Invalid_Outline,                             0x14, \\\n                \"invalid outline\" )\n  FT_ERRORDEF_( Invalid_Composite,                           0x15, \\\n                \"invalid composite glyph\" )\n  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \\\n                \"too many hints\" )\n  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \\\n                \"invalid pixel size\" )\n\n  /* handle errors */\n\n  FT_ERRORDEF_( Invalid_Handle,                              0x20, \\\n                \"invalid object handle\" )\n  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \\\n                \"invalid library handle\" )\n  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \\\n                \"invalid module handle\" )\n  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \\\n                \"invalid face handle\" )\n  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \\\n                \"invalid size handle\" )\n  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \\\n                \"invalid glyph slot handle\" )\n  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \\\n                \"invalid charmap handle\" )\n  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \\\n                \"invalid cache manager handle\" )\n  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \\\n                \"invalid stream handle\" )\n\n  /* driver errors */\n\n  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \\\n                \"too many modules\" )\n  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \\\n                \"too many extensions\" )\n\n  /* memory errors */\n\n  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \\\n                \"out of memory\" )\n  FT_ERRORDEF_( Unlisted_Object,                             0x41, \\\n                \"unlisted object\" )\n\n  /* stream errors */\n\n  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \\\n                \"cannot open stream\" )\n  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \\\n                \"invalid stream seek\" )\n  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \\\n                \"invalid stream skip\" )\n  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \\\n                \"invalid stream read\" )\n  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \\\n                \"invalid stream operation\" )\n  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \\\n                \"invalid frame operation\" )\n  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \\\n                \"nested frame access\" )\n  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \\\n                \"invalid frame read\" )\n\n  /* raster errors */\n\n  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \\\n                \"raster uninitialized\" )\n  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \\\n                \"raster corrupted\" )\n  FT_ERRORDEF_( Raster_Overflow,                             0x62, \\\n                \"raster overflow\" )\n  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \\\n                \"negative height while rastering\" )\n\n  /* cache errors */\n\n  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \\\n                \"too many registered caches\" )\n\n  /* TrueType and SFNT errors */\n\n  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \\\n                \"invalid opcode\" )\n  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \\\n                \"too few arguments\" )\n  FT_ERRORDEF_( Stack_Overflow,                              0x82, \\\n                \"stack overflow\" )\n  FT_ERRORDEF_( Code_Overflow,                               0x83, \\\n                \"code overflow\" )\n  FT_ERRORDEF_( Bad_Argument,                                0x84, \\\n                \"bad argument\" )\n  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \\\n                \"division by zero\" )\n  FT_ERRORDEF_( Invalid_Reference,                           0x86, \\\n                \"invalid reference\" )\n  FT_ERRORDEF_( Debug_OpCode,                                0x87, \\\n                \"found debug opcode\" )\n  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \\\n                \"found ENDF opcode in execution stream\" )\n  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \\\n                \"nested DEFS\" )\n  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \\\n                \"invalid code range\" )\n  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \\\n                \"execution context too long\" )\n  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \\\n                \"too many function definitions\" )\n  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \\\n                \"too many instruction definitions\" )\n  FT_ERRORDEF_( Table_Missing,                               0x8E, \\\n                \"SFNT font table missing\" )\n  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \\\n                \"horizontal header (hhea) table missing\" )\n  FT_ERRORDEF_( Locations_Missing,                           0x90, \\\n                \"locations (loca) table missing\" )\n  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \\\n                \"name table missing\" )\n  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \\\n                \"character map (cmap) table missing\" )\n  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \\\n                \"horizontal metrics (hmtx) table missing\" )\n  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \\\n                \"PostScript (post) table missing\" )\n  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \\\n                \"invalid horizontal metrics\" )\n  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \\\n                \"invalid character map (cmap) format\" )\n  FT_ERRORDEF_( Invalid_PPem,                                0x97, \\\n                \"invalid ppem value\" )\n  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \\\n                \"invalid vertical metrics\" )\n  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \\\n                \"could not find context\" )\n  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \\\n                \"invalid PostScript (post) table format\" )\n  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \\\n                \"invalid PostScript (post) table\" )\n\n  /* CFF, CID, and Type 1 errors */\n\n  FT_ERRORDEF_( Syntax_Error,                                0xA0, \\\n                \"opcode syntax error\" )\n  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \\\n                \"argument stack underflow\" )\n  FT_ERRORDEF_( Ignore,                                      0xA2, \\\n                \"ignore\" )\n  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \\\n                \"no Unicode glyph name found\" )\n  FT_ERRORDEF_( Glyph_Too_Big,                               0xA4, \\\n                \"glyph to big for hinting\" )\n\n  /* BDF errors */\n\n  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \\\n                \"`STARTFONT' field missing\" )\n  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \\\n                \"`FONT' field missing\" )\n  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \\\n                \"`SIZE' field missing\" )\n  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3, \\\n                \"`FONTBOUNDINGBOX' field missing\" )\n  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4, \\\n                \"`CHARS' field missing\" )\n  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5, \\\n                \"`STARTCHAR' field missing\" )\n  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6, \\\n                \"`ENCODING' field missing\" )\n  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7, \\\n                \"`BBX' field missing\" )\n  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8, \\\n                \"`BBX' too big\" )\n  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9, \\\n                \"Font header corrupted or missing fields\" )\n  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA, \\\n                \"Font glyphs corrupted or missing fields\" )\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/fterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrors.h                                                             */\n/*                                                                         */\n/*    FreeType error code handling (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2007, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This special header file is used to define the handling of FT2        */\n  /* enumeration constants.  It can also be used to generate error message */\n  /* strings with a small macro trick explained below.                     */\n  /*                                                                       */\n  /* I - Error Formats                                                     */\n  /* -----------------                                                     */\n  /*                                                                       */\n  /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */\n  /*   defined in ftoption.h in order to make the higher byte indicate     */\n  /*   the module where the error has happened (this is not compatible     */\n  /*   with standard builds of FreeType 2).  See the file `ftmoderr.h' for */\n  /*   more details.                                                       */\n  /*                                                                       */\n  /*                                                                       */\n  /* II - Error Message strings                                            */\n  /* --------------------------                                            */\n  /*                                                                       */\n  /*   The error definitions below are made through special macros that    */\n  /*   allow client applications to build a table of error message strings */\n  /*   if they need it.  The strings are not included in a normal build of */\n  /*   FreeType 2 to save space (most client applications do not use       */\n  /*   them).                                                              */\n  /*                                                                       */\n  /*   To do so, you have to define the following macros before including  */\n  /*   this file:                                                          */\n  /*                                                                       */\n  /*   FT_ERROR_START_LIST ::                                              */\n  /*     This macro is called before anything else to define the start of  */\n  /*     the error list.  It is followed by several FT_ERROR_DEF calls     */\n  /*     (see below).                                                      */\n  /*                                                                       */\n  /*   FT_ERROR_DEF( e, v, s ) ::                                          */\n  /*     This macro is called to define one single error.                  */\n  /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */\n  /*     `v' is the error numerical value.                                 */\n  /*     `s' is the corresponding error string.                            */\n  /*                                                                       */\n  /*   FT_ERROR_END_LIST ::                                                */\n  /*     This macro ends the list.                                         */\n  /*                                                                       */\n  /*   Additionally, you have to undefine __FTERRORS_H__ before #including */\n  /*   this file.                                                          */\n  /*                                                                       */\n  /*   Here is a simple example:                                           */\n  /*                                                                       */\n  /*     {                                                                 */\n  /*       #undef __FTERRORS_H__                                           */\n  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */\n  /*       #define FT_ERROR_START_LIST     {                               */\n  /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */\n  /*                                                                       */\n  /*       const struct                                                    */\n  /*       {                                                               */\n  /*         int          err_code;                                        */\n  /*         const char*  err_msg;                                         */\n  /*       } ft_errors[] =                                                 */\n  /*                                                                       */\n  /*       #include FT_ERRORS_H                                            */\n  /*     }                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTERRORS_H__\n#define __FTERRORS_H__\n\n\n  /* include module base error codes */\n#include FT_MODULE_ERRORS_H\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n\n  /* FT_ERR_PREFIX is used as a prefix for error identifiers. */\n  /* By default, we use `FT_Err_'.                            */\n  /*                                                          */\n#ifndef FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FT_Err_\n#endif\n\n\n  /* FT_ERR_BASE is used as the base for module-specific errors. */\n  /*                                                             */\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n#ifndef FT_ERR_BASE\n#define FT_ERR_BASE  FT_Mod_Err_Base\n#endif\n\n#else\n\n#undef FT_ERR_BASE\n#define FT_ERR_BASE  0\n\n#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */\n\n\n  /* If FT_ERRORDEF is not defined, we need to define a simple */\n  /* enumeration type.                                         */\n  /*                                                           */\n#ifndef FT_ERRORDEF\n\n#define FT_ERRORDEF( e, v, s )  e = v,\n#define FT_ERROR_START_LIST     enum {\n#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_ERRORDEF */\n\n\n  /* this macro is used to define an error */\n#define FT_ERRORDEF_( e, v, s )                                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )\n\n  /* this is only used for <module>_Err_Ok, which must be 0! */\n#define FT_NOERRORDEF_( e, v, s )                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )\n\n\n#ifdef FT_ERROR_START_LIST\n  FT_ERROR_START_LIST\n#endif\n\n\n  /* now include the error codes */\n#include FT_ERROR_DEFINITIONS_H\n\n\n#ifdef FT_ERROR_END_LIST\n  FT_ERROR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      SIMPLE CLEANUP                     *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_ERROR_START_LIST\n#undef FT_ERROR_END_LIST\n\n#undef FT_ERRORDEF\n#undef FT_ERRORDEF_\n#undef FT_NOERRORDEF_\n\n#undef FT_NEED_EXTERN_C\n#undef FT_ERR_BASE\n\n  /* FT_ERR_PREFIX is needed internally */\n#ifndef FT2_BUILD_LIBRARY\n#undef FT_ERR_PREFIX\n#endif\n\n#endif /* __FTERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftgasp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.h                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (specification).                   */\n/*                                                                         */\n/*  Copyright 2007, 2008, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef _FT_GASP_H_\n#define _FT_GASP_H_\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\n  /***************************************************************************\n   *\n   * @section:\n   *   gasp_table\n   *\n   * @title:\n   *   Gasp Table\n   *\n   * @abstract:\n   *   Retrieving TrueType `gasp' table entries.\n   *\n   * @description:\n   *   The function @FT_Get_Gasp can be used to query a TrueType or OpenType\n   *   font for specific entries in its `gasp' table, if any.  This is\n   *   mainly useful when implementing native TrueType hinting with the\n   *   bytecode interpreter to duplicate the Windows text rendering results.\n   */\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_GASP_XXX\n   *\n   * @description:\n   *   A list of values and/or bit-flags returned by the @FT_Get_Gasp\n   *   function.\n   *\n   * @values:\n   *   FT_GASP_NO_TABLE ::\n   *     This special value means that there is no GASP table in this face.\n   *     It is up to the client to decide what to do.\n   *\n   *   FT_GASP_DO_GRIDFIT ::\n   *     Grid-fitting and hinting should be performed at the specified ppem.\n   *     This *really* means TrueType bytecode interpretation.  If this bit\n   *     is not set, no hinting gets applied.\n   *\n   *   FT_GASP_DO_GRAY ::\n   *     Anti-aliased rendering should be performed at the specified ppem.\n   *     If not set, do monochrome rendering.\n   *\n   *   FT_GASP_SYMMETRIC_SMOOTHING ::\n   *     If set, smoothing along multiple axes must be used with ClearType.\n   *\n   *   FT_GASP_SYMMETRIC_GRIDFIT ::\n   *     Grid-fitting must be used with ClearType's symmetric smoothing.\n   *\n   * @note:\n   *   The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be\n   *   used for standard font rasterization only.  Independently of that,\n   *   `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to\n   *   be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and\n   *   `FT_GASP_DO_GRAY' are consequently ignored).\n   *\n   *   `ClearType' is Microsoft's implementation of LCD rendering, partly\n   *   protected by patents.\n   *\n   * @since:\n   *   2.3.0\n   */\n#define FT_GASP_NO_TABLE               -1\n#define FT_GASP_DO_GRIDFIT           0x01\n#define FT_GASP_DO_GRAY              0x02\n#define FT_GASP_SYMMETRIC_SMOOTHING  0x08\n#define FT_GASP_SYMMETRIC_GRIDFIT    0x10\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_Gasp\n   *\n   * @description:\n   *   Read the `gasp' table from a TrueType or OpenType font file and\n   *   return the entry corresponding to a given character pixel size.\n   *\n   * @input:\n   *   face :: The source face handle.\n   *   ppem :: The vertical character pixel size.\n   *\n   * @return:\n   *   Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no\n   *   `gasp' table in the face.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem );\n\n/* */\n\n#endif /* _FT_GASP_H_ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.h                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the definition of several convenience functions    */\n  /* that can be used by client applications to easily retrieve glyph      */\n  /* bitmaps and outlines from a given face.                               */\n  /*                                                                       */\n  /* These functions should be optional if you are writing a font server   */\n  /* or text layout engine on top of FreeType.  However, they are pretty   */\n  /* handy for many other simple uses of the library.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTGLYPH_H__\n#define __FTGLYPH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Management                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Generic interface to manage individual glyph data.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains definitions used to manage glyph data        */\n  /*    through generic FT_Glyph objects.  Each of them can contain a      */\n  /*    bitmap, a vector outline, or even images in other formats.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* forward declaration to a private type */\n  typedef struct FT_Glyph_Class_  FT_Glyph_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Glyph                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Handle to an object used to model generic glyph images.  It is a   */\n  /*    pointer to the @FT_GlyphRec structure and can contain a glyph      */\n  /*    bitmap or pointer.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Glyph objects are not owned by the library.  You must thus release */\n  /*    them manually (through @FT_Done_Glyph) _before_ calling            */\n  /*    @FT_Done_FreeType.                                                 */\n  /*                                                                       */\n  typedef struct FT_GlyphRec_*  FT_Glyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root glyph structure contains a given glyph image plus its     */\n  /*    advance width in 16.16 fixed-point format.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library :: A handle to the FreeType library object.                */\n  /*                                                                       */\n  /*    clazz   :: A pointer to the glyph's class.  Private.               */\n  /*                                                                       */\n  /*    format  :: The format of the glyph's image.                        */\n  /*                                                                       */\n  /*    advance :: A 16.16 vector that gives the glyph's advance width.    */\n  /*                                                                       */\n  typedef struct  FT_GlyphRec_\n  {\n    FT_Library             library;\n    const FT_Glyph_Class*  clazz;\n    FT_Glyph_Format        format;\n    FT_Vector              advance;\n\n  } FT_GlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_BitmapGlyph                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a bitmap glyph image.  This is */\n  /*    a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.     */\n  /*                                                                       */\n  typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BitmapGlyphRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for bitmap glyph images.  This really is a        */\n  /*    `sub-class' of @FT_GlyphRec.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root   :: The root @FT_Glyph fields.                               */\n  /*                                                                       */\n  /*    left   :: The left-side bearing, i.e., the horizontal distance     */\n  /*              from the current pen position to the left border of the  */\n  /*              glyph bitmap.                                            */\n  /*                                                                       */\n  /*    top    :: The top-side bearing, i.e., the vertical distance from   */\n  /*              the current pen position to the top border of the glyph  */\n  /*              bitmap.  This distance is positive for upwards~y!        */\n  /*                                                                       */\n  /*    bitmap :: A descriptor for the bitmap.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_BITMAP'.  This lets you access   */\n  /*    the bitmap's contents easily.                                      */\n  /*                                                                       */\n  /*    The corresponding pixel buffer is always owned by @FT_BitmapGlyph  */\n  /*    and is thus created and destroyed with it.                         */\n  /*                                                                       */\n  typedef struct  FT_BitmapGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Int       left;\n    FT_Int       top;\n    FT_Bitmap    bitmap;\n\n  } FT_BitmapGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_OutlineGlyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model an outline glyph image.  This  */\n  /*    is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */\n  /*                                                                       */\n  typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_OutlineGlyphRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for outline (vectorial) glyph images.  This       */\n  /*    really is a `sub-class' of @FT_GlyphRec.                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root    :: The root @FT_Glyph fields.                              */\n  /*                                                                       */\n  /*    outline :: A descriptor for the outline.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have      */\n  /*    `glyph->format == FT_GLYPH_FORMAT_OUTLINE'.  This lets you access  */\n  /*    the outline's content easily.                                      */\n  /*                                                                       */\n  /*    As the outline is extracted from a glyph slot, its coordinates are */\n  /*    expressed normally in 26.6 pixels, unless the flag                 */\n  /*    @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */\n  /*                                                                       */\n  /*    The outline's tables are always owned by the object and are        */\n  /*    destroyed with it.                                                 */\n  /*                                                                       */\n  typedef struct  FT_OutlineGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Outline   outline;\n\n  } FT_OutlineGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to extract a glyph image from a slot.  Note that   */\n  /*    the created @FT_Glyph object must be released with @FT_Done_Glyph. */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot   :: A handle to the source glyph slot.                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: A handle to the glyph object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Copy                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to copy a glyph image.  Note that the created      */\n  /*    @FT_Glyph object must be released with @FT_Done_Glyph.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source glyph object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target glyph object.  0~in case of       */\n  /*              error.                                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Transform                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a glyph image if its format is scalable.                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    glyph  :: A handle to the target glyph object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to a 2x2 matrix to apply.                      */\n  /*                                                                       */\n  /*    delta  :: A pointer to a 2d vector to apply.  Coordinates are      */\n  /*              expressed in 1/64th of a pixel.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code (if not 0, the glyph format is not scalable).  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The 2x2 transformation matrix is also applied to the glyph's       */\n  /*    advance vector.                                                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_BBox_Mode                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The mode how the values of @FT_Glyph_Get_CBox are returned.        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_BBOX_UNSCALED ::                                          */\n  /*      Return unscaled font units.                                      */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_SUBPIXELS ::                                         */\n  /*      Return unfitted 26.6 coordinates.                                */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_GRIDFIT ::                                           */\n  /*      Return grid-fitted 26.6 coordinates.                             */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_TRUNCATE ::                                          */\n  /*      Return coordinates in integer pixels.                            */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_PIXELS ::                                            */\n  /*      Return grid-fitted pixel coordinates.                            */\n  /*                                                                       */\n  typedef enum  FT_Glyph_BBox_Mode_\n  {\n    FT_GLYPH_BBOX_UNSCALED  = 0,\n    FT_GLYPH_BBOX_SUBPIXELS = 0,\n    FT_GLYPH_BBOX_GRIDFIT   = 1,\n    FT_GLYPH_BBOX_TRUNCATE  = 2,\n    FT_GLYPH_BBOX_PIXELS    = 3\n\n  } FT_Glyph_BBox_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_bbox_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Glyph_BBox_Mode values instead.                                */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   ft_glyph_bbox_unscaled  :: See @FT_GLYPH_BBOX_UNSCALED.             */\n  /*   ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS.            */\n  /*   ft_glyph_bbox_gridfit   :: See @FT_GLYPH_BBOX_GRIDFIT.              */\n  /*   ft_glyph_bbox_truncate  :: See @FT_GLYPH_BBOX_TRUNCATE.             */\n  /*   ft_glyph_bbox_pixels    :: See @FT_GLYPH_BBOX_PIXELS.               */\n  /*                                                                       */\n#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED\n#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS\n#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT\n#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE\n#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Get_CBox                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a glyph's `control box'.  The control box encloses all the  */\n  /*    outline's points, including Bézier control points.  Though it      */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the source glyph object.                      */\n  /*                                                                       */\n  /*    mode  :: The mode which indicates how to interpret the returned    */\n  /*             bounding box values.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox :: The glyph coordinate bounding box.  Coordinates are       */\n  /*             expressed in 1/64th of pixels if it is grid-fitted.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Coordinates are relative to the glyph origin, using the y~upwards  */\n  /*    convention.                                                        */\n  /*                                                                       */\n  /*    If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode'   */\n  /*    must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font        */\n  /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */\n  /*    is another name for this constant.                                 */\n  /*                                                                       */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting CBox is meaningless.  To get      */\n  /*    reasonable values for the CBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the CBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  /*    Note that the maximum coordinates are exclusive, which means that  */\n  /*    one can compute the width and height of the glyph image (be it in  */\n  /*    integer or 26.6 pixels) as:                                        */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      width  = bbox.xMax - bbox.xMin;                                  */\n  /*      height = bbox.yMax - bbox.yMin;                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note also that for 26.6 coordinates, if `bbox_mode' is set to      */\n  /*    @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,  */\n  /*    which corresponds to:                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      bbox.xMin = FLOOR(bbox.xMin);                                    */\n  /*      bbox.yMin = FLOOR(bbox.yMin);                                    */\n  /*      bbox.xMax = CEILING(bbox.xMax);                                  */\n  /*      bbox.yMax = CEILING(bbox.yMax);                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get the bbox in pixel coordinates, set `bbox_mode' to           */\n  /*    @FT_GLYPH_BBOX_TRUNCATE.                                           */\n  /*                                                                       */\n  /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */\n  /*    to @FT_GLYPH_BBOX_PIXELS.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_To_Bitmap                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph object to a bitmap glyph object.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    the_glyph   :: A pointer to a handle to the target glyph.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: An enumeration that describes how the data is       */\n  /*                   rendered.                                           */\n  /*                                                                       */\n  /*    origin      :: A pointer to a vector used to translate the glyph   */\n  /*                   image before rendering.  Can be~0 (if no            */\n  /*                   translation).  The origin is expressed in           */\n  /*                   26.6 pixels.                                        */\n  /*                                                                       */\n  /*    destroy     :: A boolean that indicates that the original glyph    */\n  /*                   image should be destroyed by this function.  It is  */\n  /*                   never destroyed in case of error.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does nothing if the glyph format isn't scalable.     */\n  /*                                                                       */\n  /*    The glyph image is translated with the `origin' vector before      */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  /*    The first parameter is a pointer to an @FT_Glyph handle, that will */\n  /*    be _replaced_ by this function (with newly allocated data).        */\n  /*    Typically, you would use (omitting error handling):                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph        glyph;                                         */\n  /*        FT_BitmapGlyph  glyph_bitmap;                                  */\n  /*                                                                       */\n  /*                                                                       */\n  /*        // load glyph                                                  */\n  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */\n  /*                                                                       */\n  /*        // extract glyph image                                         */\n  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */\n  /*                                                                       */\n  /*        // convert to a bitmap (default render mode + destroying old)  */\n  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */\n  /*        {                                                              */\n  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,   */\n  /*                                      0, 1 );                          */\n  /*          if ( error ) // `glyph' unchanged                            */\n  /*            ...                                                        */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        // access bitmap content by typecasting                        */\n  /*        glyph_bitmap = (FT_BitmapGlyph)glyph;                          */\n  /*                                                                       */\n  /*        // do funny stuff with it, like blitting/drawing               */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        // discard glyph image (bitmap or not)                         */\n  /*        FT_Done_Glyph( glyph );                                        */\n  /*      }                                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*    Here another example, again without error handling:                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph  glyphs[MAX_GLYPHS]                                   */\n  /*                                                                       */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       */\n  /*                  FT_Get_Glyph ( face->glyph, &glyph[idx] );           */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*        {                                                              */\n  /*          FT_Glyph  bitmap = glyphs[idx];                              */\n  /*                                                                       */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          // after this call, `bitmap' no longer points into           */\n  /*          // the `glyphs' array (and the old value isn't destroyed)    */\n  /*          FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );    */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          FT_Done_Glyph( bitmap );                                     */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          FT_Done_Glyph( glyphs[idx] );                                */\n  /*      }                                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given glyph.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the target glyph object.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Done_Glyph( FT_Glyph  glyph );\n\n  /* */\n\n\n  /* other helpful functions */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Multiply                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Perform the matrix operation `b = a*b'.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: A pointer to matrix `a'.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    b :: A pointer to matrix `b'.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `a' or `b' is zero.              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix*        b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invert a 2x2 matrix.  Return an error if it can't be inverted.     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    matrix :: A pointer to the target matrix.  Remains untouched in    */\n  /*              case of error.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLYPH_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGXVAL_H__\n#define __FTGXVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gx_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueTypeGX/AAT Validation                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate TrueTypeGX/AAT tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */\n  /*    trak, prop, lcar).                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                                                                       */\n  /* Warning: Use FT_VALIDATE_XXX to validate a table.                     */\n  /*          Following definitions are for gxvalid developers.            */\n  /*                                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_VALIDATE_feat_INDEX     0\n#define FT_VALIDATE_mort_INDEX     1\n#define FT_VALIDATE_morx_INDEX     2\n#define FT_VALIDATE_bsln_INDEX     3\n#define FT_VALIDATE_just_INDEX     4\n#define FT_VALIDATE_kern_INDEX     5\n#define FT_VALIDATE_opbd_INDEX     6\n#define FT_VALIDATE_trak_INDEX     7\n#define FT_VALIDATE_prop_INDEX     8\n#define FT_VALIDATE_lcar_INDEX     9\n#define FT_VALIDATE_GX_LAST_INDEX  FT_VALIDATE_lcar_INDEX\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_VALIDATE_GX_LENGTH\n   *\n   * @description:\n   *   The number of tables checked in this module.  Use it as a parameter\n   *   for the `table-length' argument of function @FT_TrueTypeGX_Validate.\n   */\n#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n  /* */\n\n  /* Up to 0x1000 is used by otvalid.\n     Ox2xxx is reserved for feature OT extension. */\n#define FT_VALIDATE_GX_START 0x4000\n#define FT_VALIDATE_GX_BITFIELD( tag )                  \\\n  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_GXXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_TrueTypeGX_Validate to\n  *    indicate which TrueTypeGX/AAT Type tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_feat ::\n  *      Validate `feat' table.\n  *\n  *    FT_VALIDATE_mort ::\n  *      Validate `mort' table.\n  *\n  *    FT_VALIDATE_morx ::\n  *      Validate `morx' table.\n  *\n  *    FT_VALIDATE_bsln ::\n  *      Validate `bsln' table.\n  *\n  *    FT_VALIDATE_just ::\n  *      Validate `just' table.\n  *\n  *    FT_VALIDATE_kern ::\n  *      Validate `kern' table.\n  *\n  *    FT_VALIDATE_opbd ::\n  *      Validate `opbd' table.\n  *\n  *    FT_VALIDATE_trak ::\n  *      Validate `trak' table.\n  *\n  *    FT_VALIDATE_prop ::\n  *      Validate `prop' table.\n  *\n  *    FT_VALIDATE_lcar ::\n  *      Validate `lcar' table.\n  *\n  *    FT_VALIDATE_GX ::\n  *      Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,\n  *      opbd, trak, prop and lcar).\n  *\n  */\n\n#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )\n#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )\n#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )\n#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )\n#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )\n#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )\n#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )\n#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )\n#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )\n#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \\\n                          FT_VALIDATE_mort | \\\n                          FT_VALIDATE_morx | \\\n                          FT_VALIDATE_bsln | \\\n                          FT_VALIDATE_just | \\\n                          FT_VALIDATE_kern | \\\n                          FT_VALIDATE_opbd | \\\n                          FT_VALIDATE_trak | \\\n                          FT_VALIDATE_prop | \\\n                          FT_VALIDATE_lcar )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Validate\n  *\n  * @description:\n  *    Validate various TrueTypeGX tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_GXXXX for possible values.\n  *\n  *    table_length ::\n  *       The size of the `tables' array.  Normally, @FT_VALIDATE_GX_LENGTH\n  *       should be passed.\n  *\n  * @output:\n  *    tables ::\n  *       The array where all validated sfnt tables are stored.\n  *       The array itself must be allocated by a client.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with TrueTypeGX fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the buffers pointed to by\n  *   each `tables' element, by calling @FT_TrueTypeGX_Free.  A NULL value\n  *   indicates that the table either doesn't exist in the font, the\n  *   application hasn't asked for validation, or the validator doesn't have\n  *   the ability to validate the sfnt table.\n  */\n  FT_EXPORT( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Free\n  *\n  * @description:\n  *    Free the buffer allocated by TrueTypeGX validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer allocated by\n  *       @FT_TrueTypeGX_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_TrueTypeGX_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_CKERNXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_ClassicKern_Validate\n  *    to indicate the classic kern dialect or dialects.  If the selected\n  *    type doesn't fit, @FT_ClassicKern_Validate regards the table as\n  *    invalid.\n  *\n  * @values:\n  *    FT_VALIDATE_MS ::\n  *      Handle the `kern' table as a classic Microsoft kern table.\n  *\n  *    FT_VALIDATE_APPLE ::\n  *      Handle the `kern' table as a classic Apple kern table.\n  *\n  *    FT_VALIDATE_CKERN ::\n  *      Handle the `kern' as either classic Apple or Microsoft kern table.\n  */\n#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )\n#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )\n\n#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Validate\n  *\n  * @description:\n  *    Validate classic (16-bit format) kern table to assure that the offsets\n  *    and indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without error\n  *    checking (which can be quite time consuming).\n  *\n  *    The `kern' table validator in @FT_TrueTypeGX_Validate deals with both\n  *    the new 32-bit format and the classic 16-bit format, while\n  *    FT_ClassicKern_Validate only supports the classic 16-bit format.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the dialect to be validated.  See\n  *       @FT_VALIDATE_CKERNXXX for possible values.\n  *\n  * @output:\n  *    ckern_table ::\n  *       A pointer to the kern table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   After use, the application should deallocate the buffers pointed to by\n  *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value\n  *   indicates that the table doesn't exist in the font.\n  */\n  FT_EXPORT( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Free\n  *\n  * @description:\n  *    Free the buffer allocated by classic Kern validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_ClassicKern_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_ClassicKern_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftgzip.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.h                                                               */\n/*                                                                         */\n/*    Gzip-compressed stream support.                                      */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGZIP_H__\n#define __FTGZIP_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gzip                                                               */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    GZIP Streams                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using gzip-compressed font files.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Gzip-specific functions.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenGzip\n  *\n  * @description:\n  *   Open a new stream to parse gzip-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.gz' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, gzip compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a gzipped stream from\n  *   it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGZIP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftimage.h                                                              */\n/*                                                                         */\n/*    FreeType glyph image formats and default raster interface            */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2010, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Note: A `raster' is simply a scan-line converter, used to render      */\n  /*       FT_Outlines into FT_Bitmaps.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTIMAGE_H__\n#define __FTIMAGE_H__\n\n\n  /* _STANDALONE_ is from ftgrays.c */\n#ifndef _STANDALONE_\n#include <ft2build.h>\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pos                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The type FT_Pos is used to store vectorial coordinates.  Depending */\n  /*    on the context, these can represent distances in integer font      */\n  /*    units, or 16.16, or 26.6 fixed-point pixel coordinates.            */\n  /*                                                                       */\n  typedef signed long  FT_Pos;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Vector                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector; coordinates are of   */\n  /*    the FT_Pos type.                                                   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: The horizontal coordinate.                                    */\n  /*    y :: The vertical coordinate.                                      */\n  /*                                                                       */\n  typedef struct  FT_Vector_\n  {\n    FT_Pos  x;\n    FT_Pos  y;\n\n  } FT_Vector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BBox                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold an outline's bounding box, i.e., the      */\n  /*    coordinates of its extrema in the horizontal and vertical          */\n  /*    directions.                                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xMin :: The horizontal minimum (left-most).                        */\n  /*                                                                       */\n  /*    yMin :: The vertical minimum (bottom-most).                        */\n  /*                                                                       */\n  /*    xMax :: The horizontal maximum (right-most).                       */\n  /*                                                                       */\n  /*    yMax :: The vertical maximum (top-most).                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The bounding box is specified with the coordinates of the lower    */\n  /*    left and the upper right corner.  In PostScript, those values are  */\n  /*    often called (llx,lly) and (urx,ury), respectively.                */\n  /*                                                                       */\n  /*    If `yMin' is negative, this value gives the glyph's descender.     */\n  /*    Otherwise, the glyph doesn't descend below the baseline.           */\n  /*    Similarly, if `ymax' is positive, this value gives the glyph's     */\n  /*    ascender.                                                          */\n  /*                                                                       */\n  /*    `xMin' gives the horizontal distance from the glyph's origin to    */\n  /*    the left edge of the glyph's bounding box.  If `xMin' is negative, */\n  /*    the glyph extends to the left of the origin.                       */\n  /*                                                                       */\n  typedef struct  FT_BBox_\n  {\n    FT_Pos  xMin, yMin;\n    FT_Pos  xMax, yMax;\n\n  } FT_BBox;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Pixel_Mode                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of pixels in a     */\n  /*    given bitmap.  Note that additional formats may be added in the    */\n  /*    future.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_PIXEL_MODE_NONE ::                                              */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_MONO ::                                              */\n  /*      A monochrome bitmap, using 1~bit per pixel.  Note that pixels    */\n  /*      are stored in most-significant order (MSB), which means that     */\n  /*      the left-most pixel in a byte has value 128.                     */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY ::                                              */\n  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */\n  /*      images.  Each pixel is stored in one byte.  Note that the number */\n  /*      of `gray' levels is stored in the `num_grays' field of the       */\n  /*      @FT_Bitmap structure (it generally is 256).                      */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY2 ::                                             */\n  /*      A 2-bit per pixel bitmap, used to represent embedded             */\n  /*      anti-aliased bitmaps in font files according to the OpenType     */\n  /*      specification.  We haven't found a single font using this        */\n  /*      format, however.                                                 */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY4 ::                                             */\n  /*      A 4-bit per pixel bitmap, representing embedded anti-aliased     */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD ::                                               */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on LCD displays; the bitmap is three times      */\n  /*      wider than the original glyph image.  See also                   */\n  /*      @FT_RENDER_MODE_LCD.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD_V ::                                             */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on rotated LCD displays; the bitmap is three    */\n  /*      times taller than the original glyph image.  See also            */\n  /*      @FT_RENDER_MODE_LCD_V.                                           */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_BGRA ::                                              */\n  /*      An image with four 8-bit channels per pixel, representing a      */\n  /*      color image (such as emoticons) with alpha channel.  For each    */\n  /*      pixel, the format is BGRA, which means, the blue channel comes   */\n  /*      first in memory.  The color channels are pre-multiplied and in   */\n  /*      the sRGB colorspace.  For example, full red at half-translucent  */\n  /*      opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */\n  /*      See also @FT_LOAD_COLOR.                                         */\n  /*                                                                       */\n  typedef enum  FT_Pixel_Mode_\n  {\n    FT_PIXEL_MODE_NONE = 0,\n    FT_PIXEL_MODE_MONO,\n    FT_PIXEL_MODE_GRAY,\n    FT_PIXEL_MODE_GRAY2,\n    FT_PIXEL_MODE_GRAY4,\n    FT_PIXEL_MODE_LCD,\n    FT_PIXEL_MODE_LCD_V,\n    FT_PIXEL_MODE_BGRA,\n\n    FT_PIXEL_MODE_MAX      /* do not remove */\n\n  } FT_Pixel_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_pixel_mode_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Pixel_Mode values instead.                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_pixel_mode_none  :: See @FT_PIXEL_MODE_NONE.                    */\n  /*    ft_pixel_mode_mono  :: See @FT_PIXEL_MODE_MONO.                    */\n  /*    ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY.                    */\n  /*    ft_pixel_mode_pal2  :: See @FT_PIXEL_MODE_GRAY2.                   */\n  /*    ft_pixel_mode_pal4  :: See @FT_PIXEL_MODE_GRAY4.                   */\n  /*                                                                       */\n#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE\n#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO\n#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY\n#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2\n#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4\n\n /* */\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Palette_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT!                           */\n  /*                                                                       */\n  /*    An enumeration type to describe the format of a bitmap palette,    */\n  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_palette_mode_rgb  :: The palette is an array of 3-byte RGB      */\n  /*                            records.                                   */\n  /*                                                                       */\n  /*    ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA     */\n  /*                            records.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by       */\n  /*    FreeType, these types are not handled by the library itself.       */\n  /*                                                                       */\n  typedef enum  FT_Palette_Mode_\n  {\n    ft_palette_mode_rgb = 0,\n    ft_palette_mode_rgba,\n\n    ft_palette_mode_max   /* do not remove */\n\n  } FT_Palette_Mode;\n\n  /* */\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a bitmap or pixmap to the raster.     */\n  /*    Note that we now manage pixmaps of various depths through the      */\n  /*    `pixel_mode' field.                                                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    rows         :: The number of bitmap rows.                         */\n  /*                                                                       */\n  /*    width        :: The number of pixels in bitmap row.                */\n  /*                                                                       */\n  /*    pitch        :: The pitch's absolute value is the number of bytes  */\n  /*                    taken by one bitmap row, including padding.        */\n  /*                    However, the pitch is positive when the bitmap has */\n  /*                    a `down' flow, and negative when it has an `up'    */\n  /*                    flow.  In all cases, the pitch is an offset to add */\n  /*                    to a bitmap pointer in order to go down one row.   */\n  /*                                                                       */\n  /*                    Note that `padding' means the alignment of a       */\n  /*                    bitmap to a byte border, and FreeType functions    */\n  /*                    normally align to the smallest possible integer    */\n  /*                    value.                                             */\n  /*                                                                       */\n  /*                    For the B/W rasterizer, `pitch' is always an even  */\n  /*                    number.                                            */\n  /*                                                                       */\n  /*                    To change the pitch of a bitmap (say, to make it a */\n  /*                    multiple of 4), use @FT_Bitmap_Convert.            */\n  /*                    Alternatively, you might use callback functions to */\n  /*                    directly render to the application's surface; see  */\n  /*                    the file `example2.cpp' in the tutorial for a      */\n  /*                    demonstration.                                     */\n  /*                                                                       */\n  /*    buffer       :: A typeless pointer to the bitmap buffer.  This     */\n  /*                    value should be aligned on 32-bit boundaries in    */\n  /*                    most cases.                                        */\n  /*                                                                       */\n  /*    num_grays    :: This field is only used with                       */\n  /*                    @FT_PIXEL_MODE_GRAY; it gives the number of gray   */\n  /*                    levels used in the bitmap.                         */\n  /*                                                                       */\n  /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */\n  /*                    See @FT_Pixel_Mode for possible values.            */\n  /*                                                                       */\n  /*    palette_mode :: This field is intended for paletted pixel modes;   */\n  /*                    it indicates how the palette is stored.  Not       */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /*    palette      :: A typeless pointer to the bitmap palette; this     */\n  /*                    field is intended for paletted pixel modes.  Not   */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   For now, the only pixel modes supported by FreeType are mono and    */\n  /*   grays.  However, drivers might be added in the future to support    */\n  /*   more `colorful' options.                                            */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_\n  {\n    int             rows;\n    int             width;\n    int             pitch;\n    unsigned char*  buffer;\n    short           num_grays;\n    char            pixel_mode;\n    char            palette_mode;\n    void*           palette;\n\n  } FT_Bitmap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure is used to describe an outline to the scan-line     */\n  /*    converter.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    n_contours :: The number of contours in the outline.               */\n  /*                                                                       */\n  /*    n_points   :: The number of points in the outline.                 */\n  /*                                                                       */\n  /*    points     :: A pointer to an array of `n_points' @FT_Vector       */\n  /*                  elements, giving the outline's point coordinates.    */\n  /*                                                                       */\n  /*    tags       :: A pointer to an array of `n_points' chars, giving    */\n  /*                  each outline point's type.                           */\n  /*                                                                       */\n  /*                  If bit~0 is unset, the point is `off' the curve,     */\n  /*                  i.e., a Bézier control point, while it is `on' if    */\n  /*                  set.                                                 */\n  /*                                                                       */\n  /*                  Bit~1 is meaningful for `off' points only.  If set,  */\n  /*                  it indicates a third-order Bézier arc control point; */\n  /*                  and a second-order control point if unset.           */\n  /*                                                                       */\n  /*                  If bit~2 is set, bits 5-7 contain the drop-out mode  */\n  /*                  (as defined in the OpenType specification; the value */\n  /*                  is the same as the argument to the SCANMODE          */\n  /*                  instruction).                                        */\n  /*                                                                       */\n  /*                  Bits 3 and~4 are reserved for internal purposes.     */\n  /*                                                                       */\n  /*    contours   :: An array of `n_contours' shorts, giving the end      */\n  /*                  point of each contour within the outline.  For       */\n  /*                  example, the first contour is defined by the points  */\n  /*                  `0' to `contours[0]', the second one is defined by   */\n  /*                  the points `contours[0]+1' to `contours[1]', etc.    */\n  /*                                                                       */\n  /*    flags      :: A set of bit flags used to characterize the outline  */\n  /*                  and give hints to the scan-converter and hinter on   */\n  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_FLAGS.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The B/W rasterizer only checks bit~2 in the `tags' array for the   */\n  /*    first point of each contour.  The drop-out mode as given with      */\n  /*    @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and       */\n  /*    @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden.           */\n  /*                                                                       */\n  typedef struct  FT_Outline_\n  {\n    short       n_contours;      /* number of contours in glyph        */\n    short       n_points;        /* number of points in the glyph      */\n\n    FT_Vector*  points;          /* the outline's points               */\n    char*       tags;            /* the points flags                   */\n    short*      contours;        /* the contour end points             */\n\n    int         flags;           /* outline masks                      */\n\n  } FT_Outline;\n\n  /* Following limits must be consistent with */\n  /* FT_Outline.{n_contours,n_points}         */\n#define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX\n#define FT_OUTLINE_POINTS_MAX    SHRT_MAX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants use for the flags in an outline's    */\n  /*    `flags' field.                                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OUTLINE_NONE ::                                                 */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_OUTLINE_OWNER ::                                                */\n  /*      If set, this flag indicates that the outline's field arrays      */\n  /*      (i.e., `points', `flags', and `contours') are `owned' by the     */\n  /*      outline object, and should thus be freed when it is destroyed.   */\n  /*                                                                       */\n  /*    FT_OUTLINE_EVEN_ODD_FILL ::                                        */\n  /*      By default, outlines are filled using the non-zero winding rule. */\n  /*      If set to 1, the outline will be filled using the even-odd fill  */\n  /*      rule (only works with the smooth rasterizer).                    */\n  /*                                                                       */\n  /*    FT_OUTLINE_REVERSE_FILL ::                                         */\n  /*      By default, outside contours of an outline are oriented in       */\n  /*      clock-wise direction, as defined in the TrueType specification.  */\n  /*      This flag is set if the outline uses the opposite direction      */\n  /*      (typically for Type~1 fonts).  This flag is ignored by the scan  */\n  /*      converter.                                                       */\n  /*                                                                       */\n  /*    FT_OUTLINE_IGNORE_DROPOUTS ::                                      */\n  /*      By default, the scan converter will try to detect drop-outs in   */\n  /*      an outline and correct the glyph bitmap to ensure consistent     */\n  /*      shape continuity.  If set, this flag hints the scan-line         */\n  /*      converter to ignore such cases.  See below for more information. */\n  /*                                                                       */\n  /*    FT_OUTLINE_SMART_DROPOUTS ::                                       */\n  /*      Select smart dropout control.  If unset, use simple dropout      */\n  /*      control.  Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See    */\n  /*      below for more information.                                      */\n  /*                                                                       */\n  /*    FT_OUTLINE_INCLUDE_STUBS ::                                        */\n  /*      If set, turn pixels on for `stubs', otherwise exclude them.      */\n  /*      Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See below for    */\n  /*      more information.                                                */\n  /*                                                                       */\n  /*    FT_OUTLINE_HIGH_PRECISION ::                                       */\n  /*      This flag indicates that the scan-line converter should try to   */\n  /*      convert this outline to bitmaps with the highest possible        */\n  /*      quality.  It is typically set for small character sizes.  Note   */\n  /*      that this is only a hint that might be completely ignored by a   */\n  /*      given scan-converter.                                            */\n  /*                                                                       */\n  /*    FT_OUTLINE_SINGLE_PASS ::                                          */\n  /*      This flag is set to force a given scan-converter to only use a   */\n  /*      single pass over the outline to render a bitmap glyph image.     */\n  /*      Normally, it is set for very large character sizes.  It is only  */\n  /*      a hint that might be completely ignored by a given               */\n  /*      scan-converter.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */\n  /*    and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth            */\n  /*    rasterizer.                                                        */\n  /*                                                                       */\n  /*    There exists a second mechanism to pass the drop-out mode to the   */\n  /*    B/W rasterizer; see the `tags' field in @FT_Outline.               */\n  /*                                                                       */\n  /*    Please refer to the description of the `SCANTYPE' instruction in   */\n  /*    the OpenType specification (in file `ttinst1.doc') how simple      */\n  /*    drop-outs, smart drop-outs, and stubs are defined.                 */\n  /*                                                                       */\n#define FT_OUTLINE_NONE             0x0\n#define FT_OUTLINE_OWNER            0x1\n#define FT_OUTLINE_EVEN_ODD_FILL    0x2\n#define FT_OUTLINE_REVERSE_FILL     0x4\n#define FT_OUTLINE_IGNORE_DROPOUTS  0x8\n#define FT_OUTLINE_SMART_DROPOUTS   0x10\n#define FT_OUTLINE_INCLUDE_STUBS    0x20\n\n#define FT_OUTLINE_HIGH_PRECISION   0x100\n#define FT_OUTLINE_SINGLE_PASS      0x200\n\n\n /*************************************************************************\n  *\n  * @enum:\n  *   ft_outline_flags\n  *\n  * @description:\n  *   These constants are deprecated.  Please use the corresponding\n  *   @FT_OUTLINE_FLAGS values.\n  *\n  * @values:\n  *   ft_outline_none            :: See @FT_OUTLINE_NONE.\n  *   ft_outline_owner           :: See @FT_OUTLINE_OWNER.\n  *   ft_outline_even_odd_fill   :: See @FT_OUTLINE_EVEN_ODD_FILL.\n  *   ft_outline_reverse_fill    :: See @FT_OUTLINE_REVERSE_FILL.\n  *   ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.\n  *   ft_outline_high_precision  :: See @FT_OUTLINE_HIGH_PRECISION.\n  *   ft_outline_single_pass     :: See @FT_OUTLINE_SINGLE_PASS.\n  */\n#define ft_outline_none             FT_OUTLINE_NONE\n#define ft_outline_owner            FT_OUTLINE_OWNER\n#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL\n#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL\n#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS\n#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION\n#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS\n\n  /* */\n\n#define FT_CURVE_TAG( flag )  ( flag & 3 )\n\n#define FT_CURVE_TAG_ON            1\n#define FT_CURVE_TAG_CONIC         0\n#define FT_CURVE_TAG_CUBIC         2\n\n#define FT_CURVE_TAG_HAS_SCANMODE  4\n\n#define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */\n#define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */\n\n#define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \\\n                                     FT_CURVE_TAG_TOUCH_Y )\n\n#define FT_Curve_Tag_On       FT_CURVE_TAG_ON\n#define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC\n#define FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC\n#define FT_Curve_Tag_Touch_X  FT_CURVE_TAG_TOUCH_X\n#define FT_Curve_Tag_Touch_Y  FT_CURVE_TAG_TOUCH_Y\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `move  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `move to' is emitted to start a new contour in an outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `move to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_LineToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `line  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `line to' is emitted to indicate a segment in the outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `line to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_LineToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `conic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `conic to' is emitted to indicate a second-order Bézier arc in   */\n  /*    the outline.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: An intermediate control point between the last position */\n  /*               and the new target in `to'.                             */\n  /*                                                                       */\n  /*    to      :: A pointer to the target end point of the conic arc.     */\n  /*                                                                       */\n  /*    user    :: A typeless pointer which is passed from the caller of   */\n  /*               the decomposition function.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `cubic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `cubic to' is emitted to indicate a third-order Bézier arc.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first Bézier control point.           */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second Bézier control point.          */\n  /*                                                                       */\n  /*    to       :: A pointer to the target end point.                     */\n  /*                                                                       */\n  /*    user     :: A typeless pointer which is passed from the caller of  */\n  /*                the decomposition function.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,\n                             const FT_Vector*  control2,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline_Funcs                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold various function pointers used during outline  */\n  /*    decomposition in order to emit segments, conic, and cubic Béziers. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    move_to  :: The `move to' emitter.                                 */\n  /*                                                                       */\n  /*    line_to  :: The segment emitter.                                   */\n  /*                                                                       */\n  /*    conic_to :: The second-order Bézier arc emitter.                   */\n  /*                                                                       */\n  /*    cubic_to :: The third-order Bézier arc emitter.                    */\n  /*                                                                       */\n  /*    shift    :: The shift that is applied to coordinates before they   */\n  /*                are sent to the emitter.                               */\n  /*                                                                       */\n  /*    delta    :: The delta that is applied to coordinates before they   */\n  /*                are sent to the emitter, but after the shift.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The point coordinates sent to the emitters are the transformed     */\n  /*    version of the original coordinates (this is important for high    */\n  /*    accuracy during scan-conversion).  The transformation is simple:   */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      x' = (x << shift) - delta                                        */\n  /*      y' = (x << shift) - delta                                        */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Set the values of `shift' and `delta' to~0 to get the original     */\n  /*    point coordinates.                                                 */\n  /*                                                                       */\n  typedef struct  FT_Outline_Funcs_\n  {\n    FT_Outline_MoveToFunc   move_to;\n    FT_Outline_LineToFunc   line_to;\n    FT_Outline_ConicToFunc  conic_to;\n    FT_Outline_CubicToFunc  cubic_to;\n\n    int                     shift;\n    FT_Pos                  delta;\n\n  } FT_Outline_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags to an unsigned long type.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n#ifndef FT_IMAGE_TAG\n#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \\\n          value = ( ( (unsigned long)_x1 << 24 ) | \\\n                    ( (unsigned long)_x2 << 16 ) | \\\n                    ( (unsigned long)_x3 << 8  ) | \\\n                      (unsigned long)_x4         )\n#endif /* FT_IMAGE_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_Format                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of a given glyph   */\n  /*    image.  Note that this version of FreeType only supports two image */\n  /*    formats, even though future font drivers will be able to register  */\n  /*    their own format.                                                  */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_FORMAT_NONE ::                                            */\n  /*      The value~0 is reserved.                                         */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */\n  /*      The glyph image is a composite of several other images.  This    */\n  /*      format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to   */\n  /*      report compound glyphs (like accented characters).               */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_BITMAP ::                                          */\n  /*      The glyph image is a bitmap, and can be described as an          */\n  /*      @FT_Bitmap.  You generally need to access the `bitmap' field of  */\n  /*      the @FT_GlyphSlotRec structure to read it.                       */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_OUTLINE ::                                         */\n  /*      The glyph image is a vectorial outline made of line segments     */\n  /*      and Bézier arcs; it can be described as an @FT_Outline; you      */\n  /*      generally want to access the `outline' field of the              */\n  /*      @FT_GlyphSlotRec structure to read it.                           */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */\n  /*      The glyph image is a vectorial path with no inside and outside   */\n  /*      contours.  Some Type~1 fonts, like those in the Hershey family,  */\n  /*      contain glyphs in this format.  These are described as           */\n  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */\n  /*      them correctly.                                                  */\n  /*                                                                       */\n  typedef enum  FT_Glyph_Format_\n  {\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),\n\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )\n\n  } FT_Glyph_Format;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_format_xxx                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Glyph_Format values instead.                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_glyph_format_none      :: See @FT_GLYPH_FORMAT_NONE.            */\n  /*    ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE.       */\n  /*    ft_glyph_format_bitmap    :: See @FT_GLYPH_FORMAT_BITMAP.          */\n  /*    ft_glyph_format_outline   :: See @FT_GLYPH_FORMAT_OUTLINE.         */\n  /*    ft_glyph_format_plotter   :: See @FT_GLYPH_FORMAT_PLOTTER.         */\n  /*                                                                       */\n#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE\n#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE\n#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP\n#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE\n#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            R A S T E R   D E F I N I T I O N S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A raster is a scan converter, in charge of rendering an outline into  */\n  /* a a bitmap.  This section contains the public API for rasters.        */\n  /*                                                                       */\n  /* Note that in FreeType 2, all rasters are now encapsulated within      */\n  /* specific modules called `renderers'.  See `freetype/ftrender.h' for   */\n  /* more details on renderers.                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    raster                                                             */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Scanline Converter                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How vectorial outlines are converted into bitmaps and pixmaps.     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains technical definitions.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Raster                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle (pointer) to a raster object.  Each object can be used    */\n  /*    independently to convert an outline into a bitmap or pixmap.       */\n  /*                                                                       */\n  typedef struct FT_RasterRec_*  FT_Raster;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Span                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a single span of gray (or black) pixels  */\n  /*    when rendering a monochrome or anti-aliased bitmap.                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x        :: The span's horizontal start position.                  */\n  /*                                                                       */\n  /*    len      :: The span's length in pixels.                           */\n  /*                                                                       */\n  /*    coverage :: The span color/coverage, ranging from 0 (background)   */\n  /*                to 255 (foreground).  Only used for anti-aliased       */\n  /*                rendering.                                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is used by the span drawing callback type named     */\n  /*    @FT_SpanFunc which takes the y~coordinate of the span as a         */\n  /*    a parameter.                                                       */\n  /*                                                                       */\n  /*    The coverage value is always between 0 and 255.  If you want less  */\n  /*    gray values, the callback function has to reduce them.             */\n  /*                                                                       */\n  typedef struct  FT_Span_\n  {\n    short           x;\n    unsigned short  len;\n    unsigned char   coverage;\n\n  } FT_Span;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used as a call-back by the anti-aliased renderer in     */\n  /*    order to let client applications draw themselves the gray pixel    */\n  /*    spans on each scan line.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The scanline's y~coordinate.                              */\n  /*                                                                       */\n  /*    count :: The number of spans to draw on this scanline.             */\n  /*                                                                       */\n  /*    spans :: A table of `count' spans to draw on the scanline.         */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This callback allows client applications to directly render the    */\n  /*    gray spans of the anti-aliased bitmap to any kind of surfaces.     */\n  /*                                                                       */\n  /*    This can be used to write anti-aliased outlines directly to a      */\n  /*    given background bitmap, and even perform translucency.            */\n  /*                                                                       */\n  /*    Note that the `count' field cannot be greater than a fixed value   */\n  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */\n  /*    `ftoption.h'.  By default, this value is set to~32, which means    */\n  /*    that if there are more than 32~spans on a given scanline, the      */\n  /*    callback is called several times with the same `y' parameter in    */\n  /*    order to draw all callbacks.                                       */\n  /*                                                                       */\n  /*    Otherwise, the callback is only called once per scan-line, and     */\n  /*    only for those scanlines that do have `gray' pixels on them.       */\n  /*                                                                       */\n  typedef void\n  (*FT_SpanFunc)( int             y,\n                  int             count,\n                  const FT_Span*  spans,\n                  void*           user );\n\n#define FT_Raster_Span_Func  FT_SpanFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitTest_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to test whether a given target pixel is already set to the drawing */\n  /*    `color'.  These tests are crucial to implement drop-out control    */\n  /*    per-se the TrueType spec.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   1~if the pixel is `set', 0~otherwise.                               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_BitTest_Func)( int    y,\n                             int    x,\n                             void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitSet_Func                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to set an individual target pixel.  This is crucial to implement   */\n  /*    drop-out control according to the TrueType specification.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if the pixel is `set', 0~otherwise.                              */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_BitSet_Func)( int    y,\n                            int    x,\n                            void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flag constants as used in the `flags' field of a     */\n  /*    @FT_Raster_Params structure.                                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RASTER_FLAG_DEFAULT :: This value is 0.                         */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_AA      :: This flag is set to indicate that an     */\n  /*                              anti-aliased glyph image should be       */\n  /*                              generated.  Otherwise, it will be        */\n  /*                              monochrome (1-bit).                      */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct      */\n  /*                              rendering.  In this mode, client         */\n  /*                              applications must provide their own span */\n  /*                              callback.  This lets them directly       */\n  /*                              draw or compose over an existing bitmap. */\n  /*                              If this bit is not set, the target       */\n  /*                              pixmap's buffer _must_ be zeroed before  */\n  /*                              rendering.                               */\n  /*                                                                       */\n  /*                              Note that for now, direct rendering is   */\n  /*                              only possible with anti-aliased glyphs.  */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */\n  /*                              rendering mode.  If set, the output will */\n  /*                              be clipped to a box specified in the     */\n  /*                              `clip_box' field of the                  */\n  /*                              @FT_Raster_Params structure.             */\n  /*                                                                       */\n  /*                              Note that by default, the glyph bitmap   */\n  /*                              is clipped to the target pixmap, except  */\n  /*                              in direct rendering mode where all spans */\n  /*                              are generated if no clipping box is set. */\n  /*                                                                       */\n#define FT_RASTER_FLAG_DEFAULT  0x0\n#define FT_RASTER_FLAG_AA       0x1\n#define FT_RASTER_FLAG_DIRECT   0x2\n#define FT_RASTER_FLAG_CLIP     0x4\n\n  /* deprecated */\n#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT\n#define ft_raster_flag_aa       FT_RASTER_FLAG_AA\n#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT\n#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Params                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold the arguments used by a raster's render        */\n  /*    function.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    target      :: The target bitmap.                                  */\n  /*                                                                       */\n  /*    source      :: A pointer to the source glyph image (e.g., an       */\n  /*                   @FT_Outline).                                       */\n  /*                                                                       */\n  /*    flags       :: The rendering flags.                                */\n  /*                                                                       */\n  /*    gray_spans  :: The gray span drawing callback.                     */\n  /*                                                                       */\n  /*    black_spans :: The black span drawing callback.  UNIMPLEMENTED!    */\n  /*                                                                       */\n  /*    bit_test    :: The bit test callback.  UNIMPLEMENTED!              */\n  /*                                                                       */\n  /*    bit_set     :: The bit set callback.  UNIMPLEMENTED!               */\n  /*                                                                       */\n  /*    user        :: User-supplied data that is passed to each drawing   */\n  /*                   callback.                                           */\n  /*                                                                       */\n  /*    clip_box    :: An optional clipping box.  It is only used in       */\n  /*                   direct rendering mode.  Note that coordinates here  */\n  /*                   should be expressed in _integer_ pixels (and not in */\n  /*                   26.6 fixed-point units).                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA    */\n  /*    bit flag is set in the `flags' field, otherwise a monochrome       */\n  /*    bitmap is generated.                                               */\n  /*                                                                       */\n  /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */\n  /*    raster will call the `gray_spans' callback to draw gray pixel      */\n  /*    spans, in the case of an aa glyph bitmap, it will call             */\n  /*    `black_spans', and `bit_test' and `bit_set' in the case of a       */\n  /*    monochrome bitmap.  This allows direct composition over a          */\n  /*    pre-existing bitmap through user-provided callbacks to perform the */\n  /*    span drawing/composition.                                          */\n  /*                                                                       */\n  /*    Note that the `bit_test' and `bit_set' callbacks are required when */\n  /*    rendering a monochrome bitmap, as they are crucial to implement    */\n  /*    correct drop-out control as defined in the TrueType specification. */\n  /*                                                                       */\n  typedef struct  FT_Raster_Params_\n  {\n    const FT_Bitmap*        target;\n    const void*             source;\n    int                     flags;\n    FT_SpanFunc             gray_spans;\n    FT_SpanFunc             black_spans;  /* doesn't work! */\n    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */\n    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */\n    void*                   user;\n    FT_BBox                 clip_box;\n\n  } FT_Raster_Params;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_NewFunc                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create a new raster object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory allocator.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `memory' parameter is a typeless pointer in order to avoid     */\n  /*    un-wanted dependencies on the rest of the FreeType code.  In       */\n  /*    practice, it is an @FT_Memory object, i.e., a handle to the        */\n  /*    standard FreeType memory allocator.  However, this field can be    */\n  /*    completely ignored by a given raster implementation.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_NewFunc)( void*       memory,\n                        FT_Raster*  raster );\n\n#define FT_Raster_New_Func  FT_Raster_NewFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy a given raster object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_DoneFunc)( FT_Raster  raster );\n\n#define FT_Raster_Done_Func  FT_Raster_DoneFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_ResetFunc                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType provides an area of memory called the `render pool',      */\n  /*    available to all registered rasters.  This pool can be freely used */\n  /*    during a given scan-conversion but is shared by all rasters.  Its  */\n  /*    content is thus transient.                                         */\n  /*                                                                       */\n  /*    This function is called each time the render pool changes, or just */\n  /*    after a new raster object is created.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster    :: A handle to the new raster object.                    */\n  /*                                                                       */\n  /*    pool_base :: The address in memory of the render pool.             */\n  /*                                                                       */\n  /*    pool_size :: The size in bytes of the render pool.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Rasters can ignore the render pool and rely on dynamic memory      */\n  /*    allocation if they want to (a handle to the memory allocator is    */\n  /*    passed to the raster constructor).  However, this is not           */\n  /*    recommended for efficiency purposes.                               */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_ResetFunc)( FT_Raster       raster,\n                          unsigned char*  pool_base,\n                          unsigned long   pool_size );\n\n#define FT_Raster_Reset_Func  FT_Raster_ResetFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is a generic facility to change modes or attributes  */\n  /*    in a given raster.  This can be used for debugging purposes, or    */\n  /*    simply to allow implementation-specific `features' in a given      */\n  /*    raster module.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /*    mode   :: A 4-byte tag used to name the mode or property.          */\n  /*                                                                       */\n  /*    args   :: A pointer to the new mode/property to use.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_SetModeFunc)( FT_Raster      raster,\n                            unsigned long  mode,\n                            void*          args );\n\n#define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_RenderFunc                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invoke a given raster to scan-convert a given glyph image into a   */\n  /*    target bitmap.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  /*    params :: A pointer to an @FT_Raster_Params structure used to      */\n  /*              store the rendering parameters.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The exact format of the source image depends on the raster's glyph */\n  /*    format defined in its @FT_Raster_Funcs structure.  It can be an    */\n  /*    @FT_Outline or anything else in order to support a large array of  */\n  /*    glyph formats.                                                     */\n  /*                                                                       */\n  /*    Note also that the render function can fail and return a           */\n  /*    `FT_Err_Unimplemented_Feature' error code if the raster used does  */\n  /*    not support direct composition.                                    */\n  /*                                                                       */\n  /*    XXX: For now, the standard raster doesn't support direct           */\n  /*         composition but this should change for the final release (see */\n  /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */\n  /*         for examples of distinct implementations which support direct */\n  /*         composition).                                                 */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_RenderFunc)( FT_Raster                raster,\n                           const FT_Raster_Params*  params );\n\n#define FT_Raster_Render_Func  FT_Raster_RenderFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   A structure used to describe a given raster class to the library.   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_format  :: The supported glyph format for this raster.       */\n  /*                                                                       */\n  /*    raster_new    :: The raster constructor.                           */\n  /*                                                                       */\n  /*    raster_reset  :: Used to reset the render pool within the raster.  */\n  /*                                                                       */\n  /*    raster_render :: A function to render a glyph into a given bitmap. */\n  /*                                                                       */\n  /*    raster_done   :: The raster destructor.                            */\n  /*                                                                       */\n  typedef struct  FT_Raster_Funcs_\n  {\n    FT_Glyph_Format        glyph_format;\n    FT_Raster_NewFunc      raster_new;\n    FT_Raster_ResetFunc    raster_reset;\n    FT_Raster_SetModeFunc  raster_set_mode;\n    FT_Raster_RenderFunc   raster_render;\n    FT_Raster_DoneFunc     raster_done;\n\n  } FT_Raster_Funcs;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTIMAGE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftincrem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftincrem.h                                                             */\n/*                                                                         */\n/*    FreeType incremental loading (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007, 2008, 2010 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTINCREM_H__\n#define __FTINCREM_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *    incremental\n   *\n   * @title:\n   *    Incremental Loading\n   *\n   * @abstract:\n   *    Custom Glyph Loading.\n   *\n   * @description:\n   *   This section contains various functions used to perform so-called\n   *   `incremental' glyph loading.  This is a mode where all glyphs loaded\n   *   from a given @FT_Face are provided by the client application,\n   *\n   *   Apart from that, all other tables are loaded normally from the font\n   *   file.  This mode is useful when FreeType is used within another\n   *   engine, e.g., a PostScript Imaging Processor.\n   *\n   *   To enable this mode, you must use @FT_Open_Face, passing an\n   *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\n   *   @FT_Incremental_Interface value.  See the comments for\n   *   @FT_Incremental_InterfaceRec for an example.\n   *\n   */\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental\n   *\n   * @description:\n   *   An opaque type describing a user-provided object used to implement\n   *   `incremental' glyph loading within FreeType.  This is used to support\n   *   embedded fonts in certain environments (e.g., PostScript interpreters),\n   *   where the glyph data isn't in the font file, or must be overridden by\n   *   different values.\n   *\n   * @note:\n   *   It is up to client applications to create and implement @FT_Incremental\n   *   objects, as long as they provide implementations for the methods\n   *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\n   *   and @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   *   See the description of @FT_Incremental_InterfaceRec to understand how\n   *   to use incremental objects with FreeType.\n   *\n   */\n  typedef struct FT_IncrementalRec_*  FT_Incremental;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_MetricsRec\n   *\n   * @description:\n   *   A small structure used to contain the basic glyph metrics returned\n   *   by the @FT_Incremental_GetGlyphMetricsFunc method.\n   *\n   * @fields:\n   *   bearing_x ::\n   *     Left bearing, in font units.\n   *\n   *   bearing_y ::\n   *     Top bearing, in font units.\n   *\n   *   advance ::\n   *     Horizontal component of glyph advance, in font units.\n   *\n   *   advance_v ::\n   *     Vertical component of glyph advance, in font units.\n   *\n   * @note:\n   *   These correspond to horizontal or vertical metrics depending on the\n   *   value of the `vertical' argument to the function\n   *   @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   */\n  typedef struct  FT_Incremental_MetricsRec_\n  {\n    FT_Long  bearing_x;\n    FT_Long  bearing_y;\n    FT_Long  advance;\n    FT_Long  advance_v;     /* since 2.3.12 */\n\n  } FT_Incremental_MetricsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_Metrics\n   *\n   * @description:\n   *   A handle to an @FT_Incremental_MetricsRec structure.\n   *\n   */\n   typedef struct FT_Incremental_MetricsRec_*  FT_Incremental_Metrics;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphDataFunc\n   *\n   * @description:\n   *   A function called by FreeType to access a given glyph's data bytes\n   *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\n   *   enabled.\n   *\n   *   Note that the format of the glyph's data bytes depends on the font\n   *   file format.  For TrueType, it must correspond to the raw bytes within\n   *   the `glyf' table.  For PostScript formats, it must correspond to the\n   *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\n   *   undefined for any other format.\n   *\n   * @input:\n   *   incremental ::\n   *     Handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   * @output:\n   *   adata ::\n   *     A structure describing the returned glyph data bytes (which will be\n   *     accessed as a read-only byte block).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If this function returns successfully the method\n   *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\n   *   the data bytes.\n   *\n   *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\n   *   compound glyphs.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\n                                      FT_UInt         glyph_index,\n                                      FT_Data*        adata );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_FreeGlyphDataFunc\n   *\n   * @description:\n   *   A function used to release the glyph data bytes returned by a\n   *   successful call to @FT_Incremental_GetGlyphDataFunc.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   data ::\n   *     A structure describing the glyph data bytes (which will be accessed\n   *     as a read-only byte block).\n   *\n   */\n  typedef void\n  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\n                                       FT_Data*        data );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphMetricsFunc\n   *\n   * @description:\n   *   A function used to retrieve the basic metrics of a given glyph index\n   *   before accessing its data.  This is necessary because, in certain\n   *   formats like TrueType, the metrics are stored in a different place from\n   *   the glyph images proper.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   *   vertical ::\n   *     If true, return vertical metrics.\n   *\n   *   ametrics ::\n   *     This parameter is used for both input and output.\n   *     The original glyph metrics, if any, in font units.  If metrics are\n   *     not available all the values must be set to zero.\n   *\n   * @output:\n   *   ametrics ::\n   *     The replacement glyph metrics in font units.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphMetricsFunc)\n                      ( FT_Incremental              incremental,\n                        FT_UInt                     glyph_index,\n                        FT_Bool                     vertical,\n                        FT_Incremental_MetricsRec  *ametrics );\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_FuncsRec\n   *\n   * @description:\n   *   A table of functions for accessing fonts that load data\n   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\n   *\n   * @fields:\n   *   get_glyph_data ::\n   *     The function to get glyph data.  Must not be null.\n   *\n   *   free_glyph_data ::\n   *     The function to release glyph data.  Must not be null.\n   *\n   *   get_glyph_metrics ::\n   *     The function to get glyph metrics.  May be null if the font does\n   *     not provide overriding glyph metrics.\n   *\n   */\n  typedef struct  FT_Incremental_FuncsRec_\n  {\n    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\n    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\n    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\n\n  } FT_Incremental_FuncsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_InterfaceRec\n   *\n   * @description:\n   *   A structure to be used with @FT_Open_Face to indicate that the user\n   *   wants to support incremental glyph loading.  You should use it with\n   *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\n   *\n   *     {\n   *       FT_Incremental_InterfaceRec  inc_int;\n   *       FT_Parameter                 parameter;\n   *       FT_Open_Args                 open_args;\n   *\n   *\n   *       // set up incremental descriptor\n   *       inc_int.funcs  = my_funcs;\n   *       inc_int.object = my_object;\n   *\n   *       // set up optional parameter\n   *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\n   *       parameter.data = &inc_int;\n   *\n   *       // set up FT_Open_Args structure\n   *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\n   *       open_args.pathname   = my_font_pathname;\n   *       open_args.num_params = 1;\n   *       open_args.params     = &parameter; // we use one optional argument\n   *\n   *       // open the font\n   *       error = FT_Open_Face( library, &open_args, index, &face );\n   *       ...\n   *     }\n   *\n   */\n  typedef struct  FT_Incremental_InterfaceRec_\n  {\n    const FT_Incremental_FuncsRec*  funcs;\n    FT_Incremental                  object;\n\n  } FT_Incremental_InterfaceRec;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_Interface\n   *\n   * @description:\n   *   A pointer to an @FT_Incremental_InterfaceRec structure.\n   *\n   */\n  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_INCREMENTAL\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to indicate\n   *   an incremental loading object to be used by FreeType.\n   *\n   */\n#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTINCREM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftlcdfil.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.h                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2006, 2007, 2008, 2010 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_LCD_FILTER_H__\n#define __FT_LCD_FILTER_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *   lcd_filtering\n   *\n   * @title:\n   *   LCD Filtering\n   *\n   * @abstract:\n   *   Reduce color fringes of LCD-optimized bitmaps.\n   *\n   * @description:\n   *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass\n   *   filter which is then applied to LCD-optimized bitmaps generated\n   *   through @FT_Render_Glyph.  This is useful to reduce color fringes\n   *   which would occur with unfiltered rendering.\n   *\n   *   Note that no filter is active by default, and that this function is\n   *   *not* implemented in default builds of the library.  You need to\n   *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file\n   *   in order to activate it.\n   *\n   *   FreeType generates alpha coverage maps, which are linear by nature.\n   *   For instance, the value 0x80 in bitmap representation means that\n   *   (within numerical precision) 0x80/0xff fraction of that pixel is\n   *   covered by the glyph's outline.  The blending function for placing\n   *   text over a background is\n   *\n   *   {\n   *     dst = alpha * src + (1 - alpha) * dst    ,\n   *   }\n   *\n   *   which is known as OVER.  However, when calculating the output of the\n   *   OVER operator, the source colors should first be transformed to a\n   *   linear color space, then alpha blended in that space, and transformed\n   *   back to the output color space.\n   *\n   *   When linear light blending is used, the default FIR5 filtering\n   *   weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as\n   *   they have been designed for black on white rendering while lacking\n   *   gamma correction.  To preserve color neutrality, weights for a FIR5\n   *   filter should be chosen according to two free parameters `a' and `c',\n   *   and the FIR weights should be\n   *\n   *   {\n   *     [a - c, a + c, 2 * a, a + c, a - c]    .\n   *   }\n   *\n   *   This formula generates equal weights for all the color primaries\n   *   across the filter kernel, which makes it colorless.  One suggested\n   *   set of weights is\n   *\n   *   {\n   *     [0x10, 0x50, 0x60, 0x50, 0x10]    ,\n   *   }\n   *\n   *   where `a' has value 0x30 and `b' value 0x20.  The weights in filter\n   *   may have a sum larger than 0x100, which increases coloration slightly\n   *   but also improves contrast.\n   */\n\n\n  /****************************************************************************\n   *\n   * @enum:\n   *   FT_LcdFilter\n   *\n   * @description:\n   *   A list of values to identify various types of LCD filters.\n   *\n   * @values:\n   *   FT_LCD_FILTER_NONE ::\n   *     Do not perform filtering.  When used with subpixel rendering, this\n   *     results in sometimes severe color fringes.\n   *\n   *   FT_LCD_FILTER_DEFAULT ::\n   *     The default filter reduces color fringes considerably, at the cost\n   *     of a slight blurriness in the output.\n   *\n   *   FT_LCD_FILTER_LIGHT ::\n   *     The light filter is a variant that produces less blurriness at the\n   *     cost of slightly more color fringes than the default one.  It might\n   *     be better, depending on taste, your monitor, or your personal vision.\n   *\n   *   FT_LCD_FILTER_LEGACY ::\n   *     This filter corresponds to the original libXft color filter.  It\n   *     provides high contrast output but can exhibit really bad color\n   *     fringes if glyphs are not extremely well hinted to the pixel grid.\n   *     In other words, it only works well if the TrueType bytecode\n   *     interpreter is enabled *and* high-quality hinted fonts are used.\n   *\n   *     This filter is only provided for comparison purposes, and might be\n   *     disabled or stay unsupported in the future.\n   *\n   * @since:\n   *   2.3.0\n   */\n  typedef enum  FT_LcdFilter_\n  {\n    FT_LCD_FILTER_NONE    = 0,\n    FT_LCD_FILTER_DEFAULT = 1,\n    FT_LCD_FILTER_LIGHT   = 2,\n    FT_LCD_FILTER_LEGACY  = 16,\n\n    FT_LCD_FILTER_MAX   /* do not remove */\n\n  } FT_LcdFilter;\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilter\n   *\n   * @description:\n   *   This function is used to apply color filtering to LCD decimated\n   *   bitmaps, like the ones used when calling @FT_Render_Glyph with\n   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   filter ::\n   *     The filter type.\n   *\n   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or\n   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work\n   *     well on most LCD screens.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This feature is always disabled by default.  Clients must make an\n   *   explicit call to this function with a `filter' value other than\n   *   @FT_LCD_FILTER_NONE in order to enable it.\n   *\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,\n   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.\n   *\n   *   It does _not_ affect the output of @FT_Outline_Render and\n   *   @FT_Outline_Get_Bitmap.\n   *\n   *   If this feature is activated, the dimensions of LCD glyph bitmaps are\n   *   either larger or taller than the dimensions of the corresponding\n   *   outline with regards to the pixel grid.  For example, for\n   *   @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and\n   *   up to 3~pixels to the right.\n   *\n   *   The bitmap offset values are adjusted correctly, so clients shouldn't\n   *   need to modify their layout and glyph positioning code when enabling\n   *   the filter.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter );\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilterWeights\n   *\n   * @description:\n   *   Use this function to override the filter weights selected by\n   *   @FT_Library_SetLcdFilter.  By default, FreeType uses the quintuple\n   *   (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,\n   *   0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and\n   *   FT_LCD_FILTER_LEGACY.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   weights ::\n   *     A pointer to an array; the function copies the first five bytes and\n   *     uses them to specify the filter weights.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   This function must be called after @FT_Library_SetLcdFilter to have\n   *   any effect.\n   *\n   * @since:\n   *   2.4.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_LCD_FILTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftlist.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlist.h                                                               */\n/*                                                                         */\n/*    Generic list support for FreeType (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file implements functions relative to list processing.  Its     */\n  /*  data structures are defined in `freetype.h'.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTLIST_H__\n#define __FTLIST_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    List Processing                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Simple management of lists.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various definitions related to list          */\n  /*    processing using doubly-linked nodes.                              */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_List                                                            */\n  /*    FT_ListNode                                                        */\n  /*    FT_ListRec                                                         */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /*    FT_List_Add                                                        */\n  /*    FT_List_Insert                                                     */\n  /*    FT_List_Find                                                       */\n  /*    FT_List_Remove                                                     */\n  /*    FT_List_Up                                                         */\n  /*    FT_List_Iterate                                                    */\n  /*    FT_List_Iterator                                                   */\n  /*    FT_List_Finalize                                                   */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Find                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the list node for a given listed object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    data :: The address of the listed object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    List node.  NULL if it wasn't found.                               */\n  /*                                                                       */\n  FT_EXPORT( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Add                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Append an element to the end of a list.                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to append.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Insert                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Insert an element at the head of a list.                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to parent list.                                  */\n  /*    node :: The node to insert.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Remove                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a node from a list.  This function doesn't check whether    */\n  /*    the node is in the list!                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The node to remove.                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Up                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Move a node to the head/top of a list.  Used to maintain LRU       */\n  /*    lists.                                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to move.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Iterator                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An FT_List iterator function which is called during a list parse   */\n  /*    by @FT_List_Iterate.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The current iteration list node.                           */\n  /*                                                                       */\n  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */\n  /*            Can be used to point to the iteration's state.             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_List_Iterator)( FT_ListNode  node,\n                       void*        user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Iterate                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse a list and calls a given iterator function on each element.  */\n  /*    Note that parsing is stopped as soon as one of the iterator calls  */\n  /*    returns a non-zero value.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list     :: A handle to the list.                                  */\n  /*    iterator :: An iterator function, called on each node of the list. */\n  /*    user     :: A user-supplied field which is passed as the second    */\n  /*                argument to the iterator.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result (a FreeType error code) of the last iterator call.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An @FT_List iterator function which is called during a list        */\n  /*    finalization by @FT_List_Finalize to destroy all elements in a     */\n  /*    given list.                                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    system :: The current system object.                               */\n  /*                                                                       */\n  /*    data   :: The current object to destroy.                           */\n  /*                                                                       */\n  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */\n  /*              be used to point to the iteration's state.               */\n  /*                                                                       */\n  typedef void\n  (*FT_List_Destructor)( FT_Memory  memory,\n                         void*      data,\n                         void*      user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Finalize                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy all elements in the list as well as the list itself.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list    :: A handle to the list.                                   */\n  /*                                                                       */\n  /*    destroy :: A list destructor that will be applied to each element  */\n  /*               of the list.                                            */\n  /*                                                                       */\n  /*    memory  :: The current memory object which handles deallocation.   */\n  /*                                                                       */\n  /*    user    :: A user-supplied field which is passed as the last       */\n  /*               argument to the destructor.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function expects that all nodes added by @FT_List_Add or      */\n  /*    @FT_List_Insert have been dynamically allocated.                   */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLIST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftlzw.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.h                                                                */\n/*                                                                         */\n/*    LZW-compressed stream support.                                       */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTLZW_H__\n#define __FTLZW_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    lzw                                                                */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    LZW Streams                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using LZW-compressed font files.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of LZW-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenLZW\n  *\n  * @description:\n  *   Open a new stream to parse LZW-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.Z' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream :: The target embedding stream.\n  *\n  *   source :: The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream\n  *\n  *   In certain builds of the library, LZW compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a LZW stream from it\n  *   and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with LZW support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLZW_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftmac.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.h                                                                */\n/*                                                                         */\n/*    Additional Mac-specific API.                                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2007 by                               */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* NOTE: Include this file after <freetype/freetype.h> and after any       */\n/*       Mac-specific headers (because this header uses Mac types such as  */\n/*       Handle, FSSpec, FSRef, etc.)                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMAC_H__\n#define __FTMAC_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n/* gcc-3.4.1 and later can warn about functions tagged as deprecated */\n#ifndef FT_DEPRECATED_ATTRIBUTE\n#if defined(__GNUC__)                                               && \\\n    ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define FT_DEPRECATED_ATTRIBUTE  __attribute__((deprecated))\n#else\n#define FT_DEPRECATED_ATTRIBUTE\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    mac_specific                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Mac Specific Interface                                             */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Only available on the Macintosh.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following definitions are only available if FreeType is        */\n  /*    compiled on a Macintosh.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FOND                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a FOND resource.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fond       :: A FOND resource.                                     */\n  /*                                                                       */\n  /*    face_index :: Only supported for the -1 `sanity check' special     */\n  /*                  case.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Notes>                                                               */\n  /*    This function can be used to create @FT_Face objects from fonts    */\n  /*    that are installed in the system as follows.                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      fond = GetResource( 'FOND', fontName );                          */\n  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face    *aface )\n                       FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_Name                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */\n  /*                  Bold).                                               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file.  For passing to                  */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face.  For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n                          FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_ATS_Name                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font in ATS framework.            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file. For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face. For passing to                    */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n                              FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFilePath_From_Mac_ATS_Name                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pathname of the disk file and face index for given font   */\n  /*    name which is handled by ATS framework.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName    :: Mac OS name of the font in ATS framework.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    path        :: Buffer to store pathname of the file.  For passing  */\n  /*                   to @FT_New_Face.  The client must allocate this     */\n  /*                   buffer before calling this function.                */\n  /*                                                                       */\n  /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */\n  /*                                                                       */\n  /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index )\n                                  FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSSpec to the font file.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSSpec to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */\n  /*    it accepts an FSSpec instead of a path.                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec  *spec,\n                           FT_Long        face_index,\n                           FT_Face       *aface )\n                         FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSRef to the font file.                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSRef to the font file.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */\n  /*    it accepts an FSRef instead of a path.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef  *ref,\n                          FT_Long       face_index,\n                          FT_Face      *aface )\n                        FT_DEPRECATED_ATTRIBUTE;\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTMAC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.h                                                                 */\n/*                                                                         */\n/*    FreeType Multiple Master font interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMM_H__\n#define __FTMM_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    multiple_masters                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Multiple Masters                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to manage Multiple Masters fonts.                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following types and functions are used to manage Multiple      */\n  /*    Master fonts, i.e., the selection of specific design instances by  */\n  /*    setting design axis coordinates.                                   */\n  /*                                                                       */\n  /*    George Williams has extended this interface to make it work with   */\n  /*    both Type~1 Multiple Masters fonts and GX distortable (var)        */\n  /*    fonts.  Some of these routines only work with MM fonts, others     */\n  /*    will work with both types.  They are similar enough that a         */\n  /*    consistent interface makes sense.                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Axis                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  typedef struct  FT_MM_Axis_\n  {\n    FT_String*  name;\n    FT_Long     minimum;\n    FT_Long     maximum;\n\n  } FT_MM_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Multi_Master                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis    :: Number of axes.  Cannot exceed~4.                   */\n  /*                                                                       */\n  /*    num_designs :: Number of designs; should be normally 2^num_axis    */\n  /*                   even though the Type~1 specification strangely      */\n  /*                   allows for intermediate designs to be present. This */\n  /*                   number cannot exceed~16.                            */\n  /*                                                                       */\n  /*    axis        :: A table of axis descriptors.                        */\n  /*                                                                       */\n  typedef struct  FT_Multi_Master_\n  {\n    FT_UInt     num_axis;\n    FT_UInt     num_designs;\n    FT_MM_Axis  axis[T1_MAX_MM_AXIS];\n\n  } FT_Multi_Master;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Axis                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters and GX var fonts.                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*               Not always meaningful for GX.                           */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    def     :: The axis's default design coordinate.                   */\n  /*               FreeType computes meaningful default values for MM; it  */\n  /*               is then an integer value, not in 16.16 format.          */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  /*    tag     :: The axis's tag (the GX equivalent to `name').           */\n  /*               FreeType provides default values for MM if possible.    */\n  /*                                                                       */\n  /*    strid   :: The entry in `name' table (another GX version of        */\n  /*               `name').                                                */\n  /*               Not meaningful for MM.                                  */\n  /*                                                                       */\n  typedef struct  FT_Var_Axis_\n  {\n    FT_String*  name;\n\n    FT_Fixed    minimum;\n    FT_Fixed    def;\n    FT_Fixed    maximum;\n\n    FT_ULong    tag;\n    FT_UInt     strid;\n\n  } FT_Var_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Named_Style                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a named style in a GX var font.   */\n  /*                                                                       */\n  /*    This structure can't be used for MM fonts.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    coords :: The design coordinates for this style.                   */\n  /*              This is an array with one entry for each axis.           */\n  /*                                                                       */\n  /*    strid  :: The entry in `name' table identifying this style.        */\n  /*                                                                       */\n  typedef struct  FT_Var_Named_Style_\n  {\n    FT_Fixed*  coords;\n    FT_UInt    strid;\n\n  } FT_Var_Named_Style;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Var                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    or GX var distortable font.                                        */\n  /*                                                                       */\n  /*    Some fields are specific to one format and not to the other.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis        :: The number of axes.  The maximum value is~4 for */\n  /*                       MM; no limit in GX.                             */\n  /*                                                                       */\n  /*    num_designs     :: The number of designs; should be normally       */\n  /*                       2^num_axis for MM fonts.  Not meaningful for GX */\n  /*                       (where every glyph could have a different       */\n  /*                       number of designs).                             */\n  /*                                                                       */\n  /*    num_namedstyles :: The number of named styles; only meaningful for */\n  /*                       GX which allows certain design coordinates to   */\n  /*                       have a string ID (in the `name' table)          */\n  /*                       associated with them.  The font can tell the    */\n  /*                       user that, for example, Weight=1.5 is `Bold'.   */\n  /*                                                                       */\n  /*    axis            :: A table of axis descriptors.                    */\n  /*                       GX fonts contain slightly more data than MM.    */\n  /*                                                                       */\n  /*    namedstyles     :: A table of named styles.                        */\n  /*                       Only meaningful with GX.                        */\n  /*                                                                       */\n  typedef struct  FT_MM_Var_\n  {\n    FT_UInt              num_axis;\n    FT_UInt              num_designs;\n    FT_UInt              num_namedstyles;\n    FT_Var_Axis*         axis;\n    FT_Var_Named_Style*  namedstyle;\n\n  } FT_MM_Var;\n\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Multi_Master                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master descriptor of a given font.           */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master/GX var descriptor of a given font.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters/GX var descriptor.                 */\n  /*               Allocates a data structure, which the user must free    */\n  /*               (a single call to FT_FREE will do it).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Design_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters fonts, choose an interpolated font design     */\n  /*    through design coordinates.                                        */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Design_Coordinates                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */\n  /*    design through design coordinates.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Blend_Coordinates                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters and GX var fonts, choose an interpolated font */\n  /*    design through normalized blend coordinates.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: The design coordinates array (each element must be   */\n  /*                  between 0 and 1.0).                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Blend_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftmodapi.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmodapi.h                                                             */\n/*                                                                         */\n/*    FreeType modules public interface (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMODAPI_H__\n#define __FTMODAPI_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Module Management                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to add, upgrade, remove, and control modules from FreeType.    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The definitions below are used to manage modules within FreeType.  */\n  /*    Modules can be added, upgraded, and removed at runtime.            */\n  /*    Additionally, some module properties can be controlled also.       */\n  /*                                                                       */\n  /*    Here is a list of possible values of the `module_name' field in    */\n  /*    the @FT_Module_Class structure.                                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      autofitter                                                       */\n  /*      bdf                                                              */\n  /*      cff                                                              */\n  /*      gxvalid                                                          */\n  /*      otvalid                                                          */\n  /*      pcf                                                              */\n  /*      pfr                                                              */\n  /*      psaux                                                            */\n  /*      pshinter                                                         */\n  /*      psnames                                                          */\n  /*      raster1, raster5                                                 */\n  /*      sfnt                                                             */\n  /*      smooth, smooth-lcd, smooth-lcdv                                  */\n  /*      truetype                                                         */\n  /*      type1                                                            */\n  /*      type42                                                           */\n  /*      t1cid                                                            */\n  /*      winfonts                                                         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that the FreeType Cache sub-system is not a FreeType module.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* module bit flags */\n#define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */\n#define FT_MODULE_RENDERER            2  /* this module is a renderer     */\n#define FT_MODULE_HINTER              4  /* this module is a glyph hinter */\n#define FT_MODULE_STYLER              8  /* this module is a styler       */\n\n#define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */\n                                              /* scalable fonts           */\n#define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */\n                                              /* support vector outlines  */\n#define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */\n                                              /* own hinter               */\n\n\n  /* deprecated values */\n#define ft_module_font_driver         FT_MODULE_FONT_DRIVER\n#define ft_module_renderer            FT_MODULE_RENDERER\n#define ft_module_hinter              FT_MODULE_HINTER\n#define ft_module_styler              FT_MODULE_STYLER\n\n#define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE\n#define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES\n#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER\n\n\n  typedef FT_Pointer  FT_Module_Interface;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Constructor                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to initialize (not create) a new module object.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to initialize.                                */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Constructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destructor                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to finalize (not destroy) a given module object.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to finalize.                                  */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Requester                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to query a given module for a specific interface.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to be searched.                               */\n  /*                                                                       */\n  /*    name ::   The name of the interface in the module.                 */\n  /*                                                                       */\n  typedef FT_Module_Interface\n  (*FT_Module_Requester)( FT_Module    module,\n                          const char*  name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The module class descriptor.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    module_flags    :: Bit flags describing the module.                */\n  /*                                                                       */\n  /*    module_size     :: The size of one module object/instance in       */\n  /*                       bytes.                                          */\n  /*                                                                       */\n  /*    module_name     :: The name of the module.                         */\n  /*                                                                       */\n  /*    module_version  :: The version, as a 16.16 fixed number            */\n  /*                       (major.minor).                                  */\n  /*                                                                       */\n  /*    module_requires :: The version of FreeType this module requires,   */\n  /*                       as a 16.16 fixed number (major.minor).  Starts  */\n  /*                       at version 2.0, i.e., 0x20000.                  */\n  /*                                                                       */\n  /*    module_init     :: The initializing function.                      */\n  /*                                                                       */\n  /*    module_done     :: The finalizing function.                        */\n  /*                                                                       */\n  /*    get_interface   :: The interface requesting function.              */\n  /*                                                                       */\n  typedef struct  FT_Module_Class_\n  {\n    FT_ULong               module_flags;\n    FT_Long                module_size;\n    const FT_String*       module_name;\n    FT_Fixed               module_version;\n    FT_Fixed               module_requires;\n\n    const void*            module_interface;\n\n    FT_Module_Constructor  module_init;\n    FT_Module_Destructor   module_done;\n    FT_Module_Requester    get_interface;\n\n  } FT_Module_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add a new module to a given library instance.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    clazz   :: A pointer to class descriptor for the module.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find a module by its name.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module handle.  0~if none was found.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    FreeType's internal modules aren't documented very well, and you   */\n  /*    should look up the source code for details.                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Remove_Module                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a given module from a library instance.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module  :: A handle to a module object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The module object is destroyed by the function in case of success. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Set\n   *\n   * @description:\n   *    Set a property for a given module.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   *       Note that only a few modules have properties.\n   *\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the new\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example sets property `bar' (a simple integer) in\n   *    module `foo' to value~1.\n   *\n   *    {\n   *      FT_UInt  bar;\n   *\n   *\n   *      bar = 1;\n   *      FT_Property_Set( library, \"foo\", \"bar\", &bar );\n   *    }\n   *\n   *    Note that the FreeType Cache sub-system doesn't recognize module\n   *    property changes.  To avoid glyph lookup confusion within the cache\n   *    you should call @FTC_Manager_Reset to completely flush the cache if\n   *    a module property gets changed after @FTC_Manager_New has been\n   *    called.\n   *\n   *    It is not possible to set properties of the FreeType Cache\n   *    sub-system itself with FT_Property_Set; use @FTC_Property_Set\n   *    instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Set( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   const void*       value );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Get\n   *\n   * @description:\n   *    Get a module's property value.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   * @inout:\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example gets property `baz' (a range) in module `foo'.\n   *\n   *    {\n   *      typedef  range_\n   *      {\n   *        FT_Int32  min;\n   *        FT_Int32  max;\n   *\n   *      } range;\n   *\n   *      range  baz;\n   *\n   *\n   *      FT_Property_Get( library, \"foo\", \"baz\", &baz );\n   *    }\n   *\n   *    It is not possible to retrieve properties of the FreeType Cache\n   *    sub-system with FT_Property_Get; use @FTC_Property_Get instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Get( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   void*             value );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Library                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Library         */\n  /*    structure is created.  This function increments the counter.       */\n  /*    @FT_Done_Library then only destroys a library if the counter is~1, */\n  /*    otherwise it simply decrements the counter.                        */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Library objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a target library object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Library( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Library                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to create a new FreeType library instance    */\n  /*    from a given memory object.  It is thus possible to use libraries  */\n  /*    with distinct memory allocators within the same program.           */\n  /*                                                                       */\n  /*    Normally, you would call this function (followed by a call to      */\n  /*    @FT_Add_Default_Modules or a series of calls to @FT_Add_Module)    */\n  /*    instead of @FT_Init_FreeType to initialize the FreeType library.   */\n  /*                                                                       */\n  /*    Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a      */\n  /*    library instance.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A handle to the original memory object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A pointer to handle of a new library object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Library                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given library object.  This closes all drivers and       */\n  /*    discards all resource objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Library( FT_Library  library );\n\n/* */\n\n  typedef void\n  (*FT_DebugHook_Func)( void*  arg );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set a debug hook function for debugging the interpreter of a font  */\n  /*    format.                                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hook_index :: The index of the debug hook.  You should use the     */\n  /*                  values defined in `ftobjs.h', e.g.,                  */\n  /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */\n  /*                                                                       */\n  /*    debug_hook :: The function used to debug the interpreter.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, four debug hook slots are available, but only two (for  */\n  /*    the TrueType and the Type~1 interpreter) are defined.              */\n  /*                                                                       */\n  /*    Since the internal headers of FreeType are no longer installed,    */\n  /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */\n  /*    This is a bug and will be fixed in a forthcoming release.          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add the set of default drivers to a given library object.          */\n  /*    This is only useful when you create a library object with          */\n  /*    @FT_New_Library (usually to plug a custom memory manager).         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a new library object.                       */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Add_Default_Modules( FT_Library  library );\n\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   truetype_engine\n   *\n   * @title:\n   *   The TrueType Engine\n   *\n   * @abstract:\n   *   TrueType bytecode support.\n   *\n   * @description:\n   *   This section contains a function used to query the level of TrueType\n   *   bytecode support compiled in this version of the library.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   *  @enum:\n   *     FT_TrueTypeEngineType\n   *\n   *  @description:\n   *     A list of values describing which kind of TrueType bytecode\n   *     engine is implemented in a given FT_Library instance.  It is used\n   *     by the @FT_Get_TrueType_Engine_Type function.\n   *\n   *  @values:\n   *     FT_TRUETYPE_ENGINE_TYPE_NONE ::\n   *       The library doesn't implement any kind of bytecode interpreter.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::\n   *       The library implements a bytecode interpreter that doesn't\n   *       support the patented operations of the TrueType virtual machine.\n   *\n   *       Its main use is to load certain Asian fonts which position and\n   *       scale glyph components with bytecode instructions.  It produces\n   *       bad output for most other fonts.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_PATENTED ::\n   *       The library implements a bytecode interpreter that covers\n   *       the full instruction set of the TrueType virtual machine (this\n   *       was governed by patents until May 2010, hence the name).\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  typedef enum  FT_TrueTypeEngineType_\n  {\n    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n\n  } FT_TrueTypeEngineType;\n\n\n  /**************************************************************************\n   *\n   *  @func:\n   *     FT_Get_TrueType_Engine_Type\n   *\n   *  @description:\n   *     Return an @FT_TrueTypeEngineType value to indicate which level of\n   *     the TrueType virtual machine a given library instance supports.\n   *\n   *  @input:\n   *     library ::\n   *       A library instance.\n   *\n   *  @return:\n   *     A value indicating which level is supported.\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  FT_EXPORT( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMODAPI_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftmoderr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmoderr.h                                                             */\n/*                                                                         */\n/*    FreeType module error offsets (specification).                       */\n/*                                                                         */\n/*  Copyright 2001-2005, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the FreeType module error codes.          */\n  /*                                                                       */\n  /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is    */\n  /* set, the lower byte of an error value identifies the error code as    */\n  /* usual.  In addition, the higher byte identifies the module.  For      */\n  /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */\n  /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error        */\n  /* `T1_Err_Invalid_File_Format' has value 0x1403, etc.                   */\n  /*                                                                       */\n  /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero,    */\n  /* including the high byte.                                              */\n  /*                                                                       */\n  /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of   */\n  /* an error value is set to zero.                                        */\n  /*                                                                       */\n  /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */\n  /* provides some macros in `fttypes.h'.                                  */\n  /*                                                                       */\n  /*   FT_ERR( err )                                                       */\n  /*     Add current error module prefix (as defined with the              */\n  /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */\n  /*     the line                                                          */\n  /*                                                                       */\n  /*       error = FT_ERR( Invalid_Outline );                              */\n  /*                                                                       */\n  /*     expands to                                                        */\n  /*                                                                       */\n  /*       error = BDF_Err_Invalid_Outline;                                */\n  /*                                                                       */\n  /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */\n  /*     of `FT_ERR( Ok )'.                                                */\n  /*                                                                       */\n  /*   FT_ERR_EQ( errcode, err )                                           */\n  /*   FT_ERR_NEQ( errcode, err )                                          */\n  /*     Compare error code `errcode' with the error `err' for equality    */\n  /*     and inequality, respectively.  Example:                           */\n  /*                                                                       */\n  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*     Using this macro you don't have to think about error prefixes.    */\n  /*     Of course, if module errors are not active, the above example is  */\n  /*     the same as                                                       */\n  /*                                                                       */\n  /*       if ( error == FT_Err_Invalid_Outline )                          */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*   FT_ERROR_BASE( errcode )                                            */\n  /*   FT_ERROR_MODULE( errcode )                                          */\n  /*     Get base error and module error code, respectively.               */\n  /*                                                                       */\n  /*                                                                       */\n  /* It can also be used to create a module error message table easily     */\n  /* with something like                                                   */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     #undef __FTMODERR_H__                                             */\n  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */\n  /*     #define FT_MODERR_START_LIST     {                                */\n  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */\n  /*                                                                       */\n  /*     const struct                                                      */\n  /*     {                                                                 */\n  /*       int          mod_err_offset;                                    */\n  /*       const char*  mod_err_msg                                        */\n  /*     } ft_mod_errors[] =                                               */\n  /*                                                                       */\n  /*     #include FT_MODULE_ERRORS_H                                       */\n  /*   }                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTMODERR_H__\n#define __FTMODERR_H__\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#ifndef FT_MODERRDEF\n\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,\n#else\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,\n#endif\n\n#define FT_MODERR_START_LIST  enum {\n#define FT_MODERR_END_LIST    FT_Mod_Err_Max };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_MODERRDEF */\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****               LIST MODULE ERROR BASES                   *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_MODERR_START_LIST\n  FT_MODERR_START_LIST\n#endif\n\n\n  FT_MODERRDEF( Base,      0x000, \"base module\" )\n  FT_MODERRDEF( Autofit,   0x100, \"autofitter module\" )\n  FT_MODERRDEF( BDF,       0x200, \"BDF module\" )\n  FT_MODERRDEF( Bzip2,     0x300, \"Bzip2 module\" )\n  FT_MODERRDEF( Cache,     0x400, \"cache module\" )\n  FT_MODERRDEF( CFF,       0x500, \"CFF module\" )\n  FT_MODERRDEF( CID,       0x600, \"CID module\" )\n  FT_MODERRDEF( Gzip,      0x700, \"Gzip module\" )\n  FT_MODERRDEF( LZW,       0x800, \"LZW module\" )\n  FT_MODERRDEF( OTvalid,   0x900, \"OpenType validation module\" )\n  FT_MODERRDEF( PCF,       0xA00, \"PCF module\" )\n  FT_MODERRDEF( PFR,       0xB00, \"PFR module\" )\n  FT_MODERRDEF( PSaux,     0xC00, \"PS auxiliary module\" )\n  FT_MODERRDEF( PShinter,  0xD00, \"PS hinter module\" )\n  FT_MODERRDEF( PSnames,   0xE00, \"PS names module\" )\n  FT_MODERRDEF( Raster,    0xF00, \"raster module\" )\n  FT_MODERRDEF( SFNT,     0x1000, \"SFNT module\" )\n  FT_MODERRDEF( Smooth,   0x1100, \"smooth raster module\" )\n  FT_MODERRDEF( TrueType, 0x1200, \"TrueType module\" )\n  FT_MODERRDEF( Type1,    0x1300, \"Type 1 module\" )\n  FT_MODERRDEF( Type42,   0x1400, \"Type 42 module\" )\n  FT_MODERRDEF( Winfonts, 0x1500, \"Windows FON/FNT module\" )\n  FT_MODERRDEF( GXvalid,  0x1600, \"GX validation module\" )\n\n\n#ifdef FT_MODERR_END_LIST\n  FT_MODERR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      CLEANUP                            *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_MODERR_START_LIST\n#undef FT_MODERR_END_LIST\n#undef FT_MODERRDEF\n#undef FT_NEED_EXTERN_C\n\n\n#endif /* __FTMODERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (specification).         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/*                                                                         */\n/* Warning: This module might be moved to a different library in the       */\n/*          future to avoid a tight dependency between FreeType and the    */\n/*          OpenType specification.                                        */\n/*                                                                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOTVAL_H__\n#define __FTOTVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    ot_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    OpenType Validation                                                */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate OpenType tables.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_OTXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_OpenType_Validate to\n  *    indicate which OpenType tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_BASE ::\n  *      Validate BASE table.\n  *\n  *    FT_VALIDATE_GDEF ::\n  *      Validate GDEF table.\n  *\n  *    FT_VALIDATE_GPOS ::\n  *      Validate GPOS table.\n  *\n  *    FT_VALIDATE_GSUB ::\n  *      Validate GSUB table.\n  *\n  *    FT_VALIDATE_JSTF ::\n  *      Validate JSTF table.\n  *\n  *    FT_VALIDATE_MATH ::\n  *      Validate MATH table.\n  *\n  *    FT_VALIDATE_OT ::\n  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).\n  *\n  */\n#define FT_VALIDATE_BASE  0x0100\n#define FT_VALIDATE_GDEF  0x0200\n#define FT_VALIDATE_GPOS  0x0400\n#define FT_VALIDATE_GSUB  0x0800\n#define FT_VALIDATE_JSTF  0x1000\n#define FT_VALIDATE_MATH  0x2000\n\n#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\\n                        FT_VALIDATE_GDEF | \\\n                        FT_VALIDATE_GPOS | \\\n                        FT_VALIDATE_GSUB | \\\n                        FT_VALIDATE_JSTF | \\\n                        FT_VALIDATE_MATH\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Validate\n  *\n  * @description:\n  *    Validate various OpenType tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_OTXXX for possible values.\n  *\n  * @output:\n  *    BASE_table ::\n  *       A pointer to the BASE table.\n  *\n  *    GDEF_table ::\n  *       A pointer to the GDEF table.\n  *\n  *    GPOS_table ::\n  *       A pointer to the GPOS table.\n  *\n  *    GSUB_table ::\n  *       A pointer to the GSUB table.\n  *\n  *    JSTF_table ::\n  *       A pointer to the JSTF table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with OpenType fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the five tables with\n  *   @FT_OpenType_Free.  A NULL value indicates that the table either\n  *   doesn't exist in the font, or the application hasn't asked for\n  *   validation.\n  */\n  FT_EXPORT( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table );\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Free\n  *\n  * @description:\n  *    Free the buffer allocated by OpenType validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_OpenType_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_OpenType_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftoutln.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.h                                                              */\n/*                                                                         */\n/*    Support for the FT_Outline type used to store glyph shapes of        */\n/*    most scalable font formats (specification).                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOUTLN_H__\n#define __FTOUTLN_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Outline Processing                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions to create, transform, and render vectorial glyph images. */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains routines used to create and destroy scalable */\n  /*    glyph images known as `outlines'.  These can also be measured,     */\n  /*    transformed, and converted into bitmaps and pixmaps.               */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Outline                                                         */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*    FT_Outline_New                                                     */\n  /*    FT_Outline_Done                                                    */\n  /*    FT_Outline_Copy                                                    */\n  /*    FT_Outline_Translate                                               */\n  /*    FT_Outline_Transform                                               */\n  /*    FT_Outline_Embolden                                                */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*    FT_Outline_Reverse                                                 */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /*    FT_Outline_Get_CBox                                                */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /*    FT_Outline_Decompose                                               */\n  /*    FT_Outline_Funcs                                                   */\n  /*    FT_Outline_MoveTo_Func                                             */\n  /*    FT_Outline_LineTo_Func                                             */\n  /*    FT_Outline_ConicTo_Func                                            */\n  /*    FT_Outline_CubicTo_Func                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walk over an outline's structure to decompose it into individual   */\n  /*    segments and Bézier arcs.  This function also emits `move to'      */\n  /*    operations to indicate the start of new contours in the outline.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e., function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer which is passed to each       */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_New                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new outline of a given size.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object from where the       */\n  /*                   outline is allocated.  Note however that the new    */\n  /*                   outline will *not* necessarily be *freed*, when     */\n  /*                   destroying the library, by @FT_Done_FreeType.       */\n  /*                                                                       */\n  /*    numPoints   :: The maximum number of points within the outline.    */\n  /*                   Must be smaller than or equal to 0xFFFF (65535).    */\n  /*                                                                       */\n  /*    numContours :: The maximum number of contours within the outline.  */\n  /*                   This value must be in the range 0 to `numPoints'.   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    anoutline   :: A handle to the new outline.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' parameter is simply */\n  /*    to use the library's memory allocator.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy an outline created with @FT_Outline_New.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle of the library object used to allocate the     */\n  /*               outline.                                                */\n  /*                                                                       */\n  /*    outline :: A pointer to the outline object to be discarded.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the outline's `owner' field is not set, only the outline        */\n  /*    descriptor will be released.                                       */\n  /*                                                                       */\n  /*    The reason why this function takes an `library' parameter is       */\n  /*    simply to use ft_mem_free().                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check the contents of an outline descriptor.                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A handle to a source outline.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_CBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an outline's `control box'.  The control box encloses all   */\n  /*    the outline's points, including Bézier control points.  Though it  */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox   :: The outline's control box.                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Translate                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple translation to the points of an outline.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    xOffset :: The horizontal offset.                                  */\n  /*                                                                       */\n  /*    yOffset :: The vertical offset.                                    */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Copy                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy an outline into another one.  Both objects must have the      */\n  /*    same sizes (number of points & number of contours) when this       */\n  /*    function is called.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source outline.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target outline.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Transform                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple 2x2 matrix to all of an outline's points.  Useful   */\n  /*    for applying rotations, slanting, flipping, etc.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix  :: A pointer to the transformation matrix.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can use @FT_Outline_Translate if you need to translate the     */\n  /*    outline's points.                                                  */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Embolden                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be at most 4~times      */\n  /*    `strength' pixels wider and higher.  You may think of the left and */\n  /*    bottom borders as unchanged.                                       */\n  /*                                                                       */\n  /*    Negative `strength' values to reduce the outline thickness are     */\n  /*    possible also.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline  :: A handle to the target outline.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strength :: How strong the glyph is emboldened.  Expressed in      */\n  /*                26.6 pixel format.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The used algorithm to increase or decrease the thickness of the    */\n  /*    glyph doesn't change the number of points; this means that certain */\n  /*    situations like acute angles or intersections are sometimes        */\n  /*    handled incorrectly.                                               */\n  /*                                                                       */\n  /*    If you need `better' metrics values you should call                */\n  /*    @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.                      */\n  /*                                                                       */\n  /*    Example call:                                                      */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */\n  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */\n  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be `xstrength' pixels   */\n  /*    wider and `ystrength' pixels higher.  Otherwise, it is similar to  */\n  /*    @FT_Outline_Embolden, which uses the same strength in both         */\n  /*    directions.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_EmboldenXY( FT_Outline*  outline,\n                         FT_Pos       xstrength,\n                         FT_Pos       ystrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Reverse                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reverse the drawing direction of an outline.  This is used to      */\n  /*    ensure consistent fill conventions for mirrored glyphs.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in     */\n  /*    the outline's `flags' field.                                       */\n  /*                                                                       */\n  /*    It shouldn't be used by a normal client application, unless it     */\n  /*    knows what it is doing.                                            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Reverse( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap.  The outline's image is simply  */\n  /*    OR-ed to the target bitmap.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the target bitmap descriptor.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT CREATE the bitmap, it only renders an       */\n  /*    outline image within the one you pass to it!  Consequently, the    */\n  /*    various fields in `abitmap' should be set accordingly.             */\n  /*                                                                       */\n  /*    It will use the raster corresponding to the default glyph format.  */\n  /*                                                                       */\n  /*    The value of the `num_grays' field in `abitmap' is ignored.  If    */\n  /*    you select the gray-level rasterizer, and you want less than 256   */\n  /*    gray levels, you have to use @FT_Outline_Render directly.          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap using the current scan-convert.  */\n  /*    This function uses an @FT_Raster_Params structure as an argument,  */\n  /*    allowing advanced features like direct composition, translucency,  */\n  /*    etc.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    params  :: A pointer to an @FT_Raster_Params structure used to     */\n  /*               describe the rendering operation.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should know what you are doing and how @FT_Raster_Params works */\n  /*    to use this function.                                              */\n  /*                                                                       */\n  /*    The field `params.source' will be set to `outline' before the scan */\n  /*    converter is called, which means that the value you give to it is  */\n  /*    actually ignored.                                                  */\n  /*                                                                       */\n  /*    The gray-level rasterizer always uses 256 gray levels.  If you     */\n  /*    want less gray levels, you have to provide your own span callback. */\n  /*    See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the   */\n  /*    @FT_Raster_Params structure for more details.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params );\n\n\n /**************************************************************************\n  *\n  * @enum:\n  *   FT_Orientation\n  *\n  * @description:\n  *   A list of values used to describe an outline's contour orientation.\n  *\n  *   The TrueType and PostScript specifications use different conventions\n  *   to determine whether outline contours should be filled or unfilled.\n  *\n  * @values:\n  *   FT_ORIENTATION_TRUETYPE ::\n  *     According to the TrueType specification, clockwise contours must\n  *     be filled, and counter-clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_POSTSCRIPT ::\n  *     According to the PostScript specification, counter-clockwise contours\n  *     must be filled, and clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_FILL_RIGHT ::\n  *     This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\n  *     remember that in TrueType, everything that is to the right of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_FILL_LEFT ::\n  *     This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\n  *     remember that in PostScript, everything that is to the left of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_NONE ::\n  *     The orientation cannot be determined.  That is, different parts of\n  *     the glyph have different orientation.\n  *\n  */\n  typedef enum  FT_Orientation_\n  {\n    FT_ORIENTATION_TRUETYPE   = 0,\n    FT_ORIENTATION_POSTSCRIPT = 1,\n    FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\n    FT_ORIENTATION_FILL_LEFT  = FT_ORIENTATION_POSTSCRIPT,\n    FT_ORIENTATION_NONE\n\n  } FT_Orientation;\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Outline_Get_Orientation\n  *\n  * @description:\n  *   This function analyzes a glyph outline and tries to compute its\n  *   fill orientation (see @FT_Orientation).  This is done by computing\n  *   the direction of each global horizontal and/or vertical extrema\n  *   within the outline.\n  *\n  *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty\n  *   outlines.\n  *\n  * @input:\n  *   outline ::\n  *     A handle to the source outline.\n  *\n  * @return:\n  *   The orientation.\n  *\n  */\n  FT_EXPORT( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOUTLN_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (specification only).   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2008, 2009 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTPFR_H__\n#define __FTPFR_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    pfr_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    PFR Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    PFR/TrueDoc specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of PFR-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Metrics\n  *\n  * @description:\n  *    Return the outline and metrics resolutions of a given PFR face.\n  *\n  * @input:\n  *    face :: Handle to the input face.  It can be a non-PFR face.\n  *\n  * @output:\n  *    aoutline_resolution ::\n  *      Outline resolution.  This is equivalent to `face->units_per_EM'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_resolution ::\n  *      Metrics resolution.  This is equivalent to `outline_resolution'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_x_scale ::\n  *      A 16.16 fixed-point number used to scale distance expressed\n  *      in metrics units to device sub-pixels.  This is equivalent to\n  *      `face->size->x_scale', but for metrics only.  Optional (parameter\n  *      can be NULL).\n  *\n  *    ametrics_y_scale ::\n  *      Same as `ametrics_x_scale' but for the vertical direction.\n  *      optional (parameter can be NULL).\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If the input face is not a PFR, this function will return an error.\n  *   However, in all cases, it will return valid values.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Kerning\n  *\n  * @description:\n  *    Return the kerning pair corresponding to two glyphs in a PFR face.\n  *    The distance is expressed in metrics units, unlike the result of\n  *    @FT_Get_Kerning.\n  *\n  * @input:\n  *    face  :: A handle to the input face.\n  *\n  *    left  :: Index of the left glyph.\n  *\n  *    right :: Index of the right glyph.\n  *\n  * @output:\n  *    avector :: A kerning vector.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    This function always return distances in original PFR metrics\n  *    units.  This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED\n  *    mode, which always returns distances converted to outline units.\n  *\n  *    You can use the value of the `x_scale' and `y_scale' parameters\n  *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Advance\n  *\n  * @description:\n  *    Return a given glyph advance, expressed in original metrics units,\n  *    from a PFR font.\n  *\n  * @input:\n  *    face   :: A handle to the input face.\n  *\n  *    gindex :: The glyph index.\n  *\n  * @output:\n  *    aadvance :: The glyph advance in metrics units.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics\n  *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftrender.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrender.h                                                             */\n/*                                                                         */\n/*    FreeType renderer modules public interface (specification).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2005, 2006, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRENDER_H__\n#define __FTRENDER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph object */\n  typedef FT_Error\n  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,\n                        FT_GlyphSlot  slot );\n\n  /* destroys a given glyph object */\n  typedef void\n  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );\n\n  typedef void\n  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,\n                             const FT_Matrix*  matrix,\n                             const FT_Vector*  delta );\n\n  typedef void\n  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,\n                           FT_BBox*  abbox );\n\n  typedef FT_Error\n  (*FT_Glyph_CopyFunc)( FT_Glyph   source,\n                        FT_Glyph   target );\n\n  typedef FT_Error\n  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,\n                           FT_GlyphSlot  slot );\n\n/* deprecated */\n#define FT_Glyph_Init_Func       FT_Glyph_InitFunc\n#define FT_Glyph_Done_Func       FT_Glyph_DoneFunc\n#define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc\n#define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc\n#define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc\n#define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc\n\n\n  struct  FT_Glyph_Class_\n  {\n    FT_Long                 glyph_size;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_InitFunc       glyph_init;\n    FT_Glyph_DoneFunc       glyph_done;\n    FT_Glyph_CopyFunc       glyph_copy;\n    FT_Glyph_TransformFunc  glyph_transform;\n    FT_Glyph_GetBBoxFunc    glyph_bbox;\n    FT_Glyph_PrepareFunc    glyph_prepare;\n  };\n\n\n  typedef FT_Error\n  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,\n                             FT_GlyphSlot      slot,\n                             FT_UInt           mode,\n                             const FT_Vector*  origin );\n\n  typedef FT_Error\n  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,\n                                FT_GlyphSlot      slot,\n                                const FT_Matrix*  matrix,\n                                const FT_Vector*  delta );\n\n\n  typedef void\n  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,\n                              FT_GlyphSlot  slot,\n                              FT_BBox*      cbox );\n\n\n  typedef FT_Error\n  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,\n                              FT_ULong     mode_tag,\n                              FT_Pointer   mode_ptr );\n\n/* deprecated identifiers */\n#define FTRenderer_render  FT_Renderer_RenderFunc\n#define FTRenderer_transform  FT_Renderer_TransformFunc\n#define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc\n#define FTRenderer_setMode  FT_Renderer_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The renderer module class descriptor.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root            :: The root @FT_Module_Class fields.               */\n  /*                                                                       */\n  /*    glyph_format    :: The glyph image format this renderer handles.   */\n  /*                                                                       */\n  /*    render_glyph    :: A method used to render the image that is in a  */\n  /*                       given glyph slot into a bitmap.                 */\n  /*                                                                       */\n  /*    transform_glyph :: A method used to transform the image that is in */\n  /*                       a given glyph slot.                             */\n  /*                                                                       */\n  /*    get_glyph_cbox  :: A method used to access the glyph's cbox.       */\n  /*                                                                       */\n  /*    set_mode        :: A method used to pass additional parameters.    */\n  /*                                                                       */\n  /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */\n  /*                       This is a pointer to its raster's class.        */\n  /*                                                                       */\n  typedef struct  FT_Renderer_Class_\n  {\n    FT_Module_Class            root;\n\n    FT_Glyph_Format            glyph_format;\n\n    FT_Renderer_RenderFunc     render_glyph;\n    FT_Renderer_TransformFunc  transform_glyph;\n    FT_Renderer_GetCBoxFunc    get_glyph_cbox;\n    FT_Renderer_SetModeFunc    set_mode;\n\n    FT_Raster_Funcs*           raster_class;\n\n  } FT_Renderer_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the current renderer for a given glyph format.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /*    format  :: The glyph format.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A renderer handle.  0~if none found.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */\n  /*    renderer by its name, use @FT_Get_Module.                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the current renderer to use, and set additional mode.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    renderer   :: A handle to the renderer object.                     */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    parameters :: Additional parameters.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case of success, the renderer will be used to convert glyph     */\n  /*    images in the renderer's known format into bitmaps.                */\n  /*                                                                       */\n  /*    This doesn't change the current renderer for other formats.        */\n  /*                                                                       */\n  /*    Currently, only the B/W renderer, if compiled with                 */\n  /*    FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels               */\n  /*    anti-aliasing mode; this option must be set directly in            */\n  /*    `ftraster.c' and is undefined by default) accepts a single tag     */\n  /*    `pal5' to set its gray palette as a character string with          */\n  /*    5~elements.  Consequently, the third and fourth argument are zero  */\n  /*    normally.                                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTRENDER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftsizes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsizes.h                                                              */\n/*                                                                         */\n/*    FreeType size objects management (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Typical application would normally not need to use these functions.   */\n  /* However, they have been placed in a public API for the rare cases     */\n  /* where they are needed.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSIZES_H__\n#define __FTSIZES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sizes_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Size Management                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Managing multiple sizes per face.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    When creating a new face object (e.g., with @FT_New_Face), an      */\n  /*    @FT_Size object is automatically created and used to store all     */\n  /*    pixel-size dependent information, available in the `face->size'    */\n  /*    field.                                                             */\n  /*                                                                       */\n  /*    It is however possible to create more sizes for a given face,      */\n  /*    mostly in order to manage several character pixel sizes of the     */\n  /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */\n  /*                                                                       */\n  /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */\n  /*    modify the contents of the current `active' size; you thus need    */\n  /*    to use @FT_Activate_Size to change it.                             */\n  /*                                                                       */\n  /*    99% of applications won't need the functions provided here,        */\n  /*    especially if they use the caching sub-system, so be cautious      */\n  /*    when using these.                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Size                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new size object from a given face object.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a parent face object.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize :: A handle to a new size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You need to call @FT_Activate_Size in order to select the new size */\n  /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */\n  /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size*  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Size                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given size object.  Note that @FT_Done_Face              */\n  /*    automatically discards all size objects allocated with             */\n  /*    @FT_New_Size.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Size( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Activate_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Even though it is possible to create several size objects for a    */\n  /*    given face (see @FT_New_Size for details), functions like          */\n  /*    @FT_Load_Glyph or @FT_Load_Char only use the one which has been    */\n  /*    activated last to determine the `current character pixel size'.    */\n  /*                                                                       */\n  /*    This function can be used to `activate' a previously created size  */\n  /*    object.                                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `face' is the size's parent face object, this function changes  */\n  /*    the value of `face->size' to the input size handle.                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Activate_Size( FT_Size  size );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSIZES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftsnames.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.h                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (specification).  */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_SFNT_NAMES_H__\n#define __FT_SFNT_NAMES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sfnt_names                                                         */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    SFNT Names                                                         */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Access the names embedded in TrueType and OpenType files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType and OpenType specifications allow the inclusion of    */\n  /*    a special `names table' in font files.  This table contains        */\n  /*    textual (and internationalized) information regarding the font,    */\n  /*    like family name, copyright, version, etc.                         */\n  /*                                                                       */\n  /*    The definitions below are used to access them if available.        */\n  /*                                                                       */\n  /*    Note that this has nothing to do with glyph names!                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SfntName                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model an SFNT `name' table entry.              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platform_id :: The platform ID for `string'.                       */\n  /*                                                                       */\n  /*    encoding_id :: The encoding ID for `string'.                       */\n  /*                                                                       */\n  /*    language_id :: The language ID for `string'.                       */\n  /*                                                                       */\n  /*    name_id     :: An identifier for `string'.                         */\n  /*                                                                       */\n  /*    string      :: The `name' string.  Note that its format differs    */\n  /*                   depending on the (platform,encoding) pair.  It can  */\n  /*                   be a Pascal String, a UTF-16 one, etc.              */\n  /*                                                                       */\n  /*                   Generally speaking, the string is not               */\n  /*                   zero-terminated.  Please refer to the TrueType      */\n  /*                   specification for details.                          */\n  /*                                                                       */\n  /*    string_len  :: The length of `string' in bytes.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Possible values for `platform_id', `encoding_id', `language_id',   */\n  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */\n  /*    please refer to the TrueType or OpenType specification.            */\n  /*                                                                       */\n  /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */\n  /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */\n  /*                                                                       */\n  typedef struct  FT_SfntName_\n  {\n    FT_UShort  platform_id;\n    FT_UShort  encoding_id;\n    FT_UShort  language_id;\n    FT_UShort  name_id;\n\n    FT_Byte*   string;      /* this string is *not* null-terminated! */\n    FT_UInt    string_len;  /* in bytes */\n\n  } FT_SfntName;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name_Count                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the number of name strings in the SFNT `name' table.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of strings in the `name' table.                         */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a string of the SFNT `name' table for a given index.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to the source face.                              */\n  /*                                                                       */\n  /*    idx   :: The index of the `name' string.                           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aname :: The indexed @FT_SfntName structure.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `string' array returned in the `aname' structure is not        */\n  /*    null-terminated.  The application should deallocate it if it is no */\n  /*    longer in use.                                                     */\n  /*                                                                       */\n  /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */\n  /*    `name' table entries, then do a loop until you get the right       */\n  /*    platform, encoding, and name ID.                                   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname );\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred family subfamily names in `name'\n   *   table since OpenType version 1.4.  For backwards compatibility with\n   *   legacy systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred subfamily names in `name' table since\n   *   OpenType version 1.4.  For backwards compatibility with legacy\n   *   systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_SFNT_NAMES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftstroke.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.h                                                             */\n/*                                                                         */\n/*    FreeType path stroker (specification).                               */\n/*                                                                         */\n/*  Copyright 2002-2006, 2008, 2009, 2011-2012 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_STROKE_H__\n#define __FT_STROKE_H__\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n /************************************************************************\n  *\n  * @section:\n  *    glyph_stroker\n  *\n  * @title:\n  *    Glyph Stroker\n  *\n  * @abstract:\n  *    Generating bordered and stroked glyphs.\n  *\n  * @description:\n  *    This component generates stroked outlines of a given vectorial\n  *    glyph.  It also allows you to retrieve the `outside' and/or the\n  *    `inside' borders of the stroke.\n  *\n  *    This can be useful to generate `bordered' glyph, i.e., glyphs\n  *    displayed with a coloured (and anti-aliased) border around their\n  *    shape.\n  */\n\n\n /**************************************************************\n  *\n  * @type:\n  *   FT_Stroker\n  *\n  * @description:\n  *   Opaque handler to a path stroker object.\n  */\n  typedef struct FT_StrokerRec_*  FT_Stroker;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineJoin\n   *\n   * @description:\n   *   These values determine how two joining lines are rendered\n   *   in a stroker.\n   *\n   * @values:\n   *   FT_STROKER_LINEJOIN_ROUND ::\n   *     Used to render rounded line joins.  Circular arcs are used\n   *     to join two lines smoothly.\n   *\n   *   FT_STROKER_LINEJOIN_BEVEL ::\n   *     Used to render beveled line joins.  The outer corner of\n   *     the joined lines is filled by enclosing the triangular\n   *     region of the corner with a straight line between the\n   *     outer corners of each stroke.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_FIXED ::\n   *     Used to render mitered line joins, with fixed bevels if the\n   *     miter limit is exceeded.  The outer edges of the strokes\n   *     for the two segments are extended until they meet at an\n   *     angle.  If the segments meet at too sharp an angle (such\n   *     that the miter would extend from the intersection of the\n   *     segments a distance greater than the product of the miter\n   *     limit value and the border radius), then a bevel join (see\n   *     above) is used instead.  This prevents long spikes being\n   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter\n   *     line join as used in PostScript and PDF.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::\n   *   FT_STROKER_LINEJOIN_MITER ::\n   *     Used to render mitered line joins, with variable bevels if\n   *     the miter limit is exceeded.  The intersection of the\n   *     strokes is clipped at a line perpendicular to the bisector\n   *     of the angle between the strokes, at the distance from the\n   *     intersection of the segments equal to the product of the\n   *     miter limit value and the border radius.  This prevents\n   *     long spikes being created.\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line\n   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias\n   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for\n   *     backwards compatibility.\n   */\n  typedef enum  FT_Stroker_LineJoin_\n  {\n    FT_STROKER_LINEJOIN_ROUND          = 0,\n    FT_STROKER_LINEJOIN_BEVEL          = 1,\n    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,\n    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,\n    FT_STROKER_LINEJOIN_MITER_FIXED    = 3\n\n  } FT_Stroker_LineJoin;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineCap\n   *\n   * @description:\n   *   These values determine how the end of opened sub-paths are\n   *   rendered in a stroke.\n   *\n   * @values:\n   *   FT_STROKER_LINECAP_BUTT ::\n   *     The end of lines is rendered as a full stop on the last\n   *     point itself.\n   *\n   *   FT_STROKER_LINECAP_ROUND ::\n   *     The end of lines is rendered as a half-circle around the\n   *     last point.\n   *\n   *   FT_STROKER_LINECAP_SQUARE ::\n   *     The end of lines is rendered as a square around the\n   *     last point.\n   */\n  typedef enum  FT_Stroker_LineCap_\n  {\n    FT_STROKER_LINECAP_BUTT = 0,\n    FT_STROKER_LINECAP_ROUND,\n    FT_STROKER_LINECAP_SQUARE\n\n  } FT_Stroker_LineCap;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_StrokerBorder\n   *\n   * @description:\n   *   These values are used to select a given stroke border\n   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.\n   *\n   * @values:\n   *   FT_STROKER_BORDER_LEFT ::\n   *     Select the left border, relative to the drawing direction.\n   *\n   *   FT_STROKER_BORDER_RIGHT ::\n   *     Select the right border, relative to the drawing direction.\n   *\n   * @note:\n   *   Applications are generally interested in the `inside' and `outside'\n   *   borders.  However, there is no direct mapping between these and the\n   *   `left' and `right' ones, since this really depends on the glyph's\n   *   drawing orientation, which varies between font formats.\n   *\n   *   You can however use @FT_Outline_GetInsideBorder and\n   *   @FT_Outline_GetOutsideBorder to get these.\n   */\n  typedef enum  FT_StrokerBorder_\n  {\n    FT_STROKER_BORDER_LEFT = 0,\n    FT_STROKER_BORDER_RIGHT\n\n  } FT_StrokerBorder;\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetInsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `inside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetOutsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `outside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_New\n   *\n   * @description:\n   *   Create a new stroker object.\n   *\n   * @input:\n   *   library ::\n   *     FreeType library handle.\n   *\n   * @output:\n   *   astroker ::\n   *     A new stroker object handle.  NULL in case of error.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Set\n   *\n   * @description:\n   *   Reset a stroker object's attributes.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   radius ::\n   *     The border radius.\n   *\n   *   line_cap ::\n   *     The line cap style.\n   *\n   *   line_join ::\n   *     The line join style.\n   *\n   *   miter_limit ::\n   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,\n   *     expressed as 16.16 fixed-point value.\n   *\n   * @note:\n   *   The radius is expressed in the same units as the outline\n   *   coordinates.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Rewind\n   *\n   * @description:\n   *   Reset a stroker object without changing its attributes.\n   *   You should call this function before beginning a new\n   *   series of calls to @FT_Stroker_BeginSubPath or\n   *   @FT_Stroker_EndSubPath.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ParseOutline\n   *\n   * @description:\n   *   A convenience function used to parse a whole outline with\n   *   the stroker.  The resulting outline(s) can be retrieved\n   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The source outline.\n   *\n   *   opened ::\n   *     A boolean.  If~1, the outline is treated as an open path instead\n   *     of a closed one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If `opened' is~0 (the default), the outline is treated as a closed\n   *   path, and the stroker generates two distinct `border' outlines.\n   *\n   *   If `opened' is~1, the outline is processed as an open path, and the\n   *   stroker generates a single `stroke' outline.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_BeginSubPath\n   *\n   * @description:\n   *   Start a new sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the start vector.\n   *\n   *   open ::\n   *     A boolean.  If~1, the sub-path is treated as an open one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function is useful when you need to stroke a path that is\n   *   not stored as an @FT_Outline object.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_EndSubPath\n   *\n   * @description:\n   *   Close the current sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function after @FT_Stroker_BeginSubPath.\n   *   If the subpath was not `opened', this function `draws' a\n   *   single line segment to the start position when needed.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_LineTo\n   *\n   * @description:\n   *   `Draw' a single line segment in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ConicTo\n   *\n   * @description:\n   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control ::\n   *     A pointer to a Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_CubicTo\n   *\n   * @description:\n   *   `Draw' a single cubic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control1 ::\n   *     A pointer to the first Bézier control point.\n   *\n   *   control2 ::\n   *     A pointer to second Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetBorderCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export one of the `border' or `stroke'\n   *   outlines generated by the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_GetCounts instead if you want to\n   *   retrieve the counts associated to both borders.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ExportBorder\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the corresponding border to your own @FT_Outline\n   *   structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   *   outline ::\n   *     The target outline handle.\n   *\n   * @note:\n   *   Always call this function after @FT_Stroker_GetBorderCounts to\n   *   get sure that there is enough room in your @FT_Outline object to\n   *   receive all new data.\n   *\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps. The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_Export instead if you want to\n   *   retrieve all borders at once.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export all points/borders from the stroked\n   *   outline/path.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Export\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export all borders to your own @FT_Outline structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The target outline handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Done\n   *\n   * @description:\n   *   Destroy a stroker object.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.  Can be NULL.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Done( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_Stroke\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_StrokeBorder\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker, but\n   *   only return either its inside or outside border.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   inside ::\n   *     A Boolean.  If~1, return the inside border, otherwise\n   *     the outside border.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FT_STROKE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftsynth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.h                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting              */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2006, 2008, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********        WARNING, THIS IS ALPHA CODE!  THIS API         *********/\n  /*********    IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE    *********/\n  /*********            FREETYPE DEVELOPMENT TEAM                  *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Main reason for not lifting the functions in this module to a  */\n  /* `standard' API is that the used parameters for emboldening and */\n  /* slanting are not configurable.  Consider the functions as a    */\n  /* code resource which should be copied into the application and  */\n  /* adapted to the particular needs.                               */\n\n\n#ifndef __FTSYNTH_H__\n#define __FTSYNTH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /* Embolden a glyph by a `reasonable' value (which is highly a matter of */\n  /* taste).  This function is actually a convenience function, providing  */\n  /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */\n  /*                                                                       */\n  /* For emboldened outlines the height, width, and advance metrics are    */\n  /* increased by the strength of the emboldening.  You can also call      */\n  /* @FT_Outline_Get_CBox to get precise values.                           */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );\n\n  /* Slant an outline glyph to the right by about 12 degrees. */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTSYNTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftsystem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.h                                                             */\n/*                                                                         */\n/*    FreeType low-level system interface definition (specification).      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSYSTEM_H__\n#define __FTSYSTEM_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   system_interface                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   System Interface                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   How FreeType manages memory and i/o.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This section contains various definitions related to memory         */\n  /*   management and i/o access.  You need to understand this             */\n  /*   information if you want to use a custom memory manager or you own   */\n  /*   i/o streams.                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  M E M O R Y   M A N A G E M E N T                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Memory\n   *\n   * @description:\n   *   A handle to a given memory manager object, defined with an\n   *   @FT_MemoryRec structure.\n   *\n   */\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Alloc_Func\n   *\n   * @description:\n   *   A function used to allocate `size' bytes from `memory'.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   size ::\n   *     The size in bytes to allocate.\n   *\n   * @return:\n   *   Address of new memory block.  0~in case of failure.\n   *\n   */\n  typedef void*\n  (*FT_Alloc_Func)( FT_Memory  memory,\n                    long       size );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Free_Func\n   *\n   * @description:\n   *   A function used to release a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   block ::\n   *     The address of the target memory block.\n   *\n   */\n  typedef void\n  (*FT_Free_Func)( FT_Memory  memory,\n                   void*      block );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Realloc_Func\n   *\n   * @description:\n   *   A function used to re-allocate a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   cur_size ::\n   *     The block's current size in bytes.\n   *\n   *   new_size ::\n   *     The block's requested new size.\n   *\n   *   block ::\n   *     The block's current address.\n   *\n   * @return:\n   *   New block address.  0~in case of memory shortage.\n   *\n   * @note:\n   *   In case of error, the old block must still be available.\n   *\n   */\n  typedef void*\n  (*FT_Realloc_Func)( FT_Memory  memory,\n                      long       cur_size,\n                      long       new_size,\n                      void*      block );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_MemoryRec\n   *\n   * @description:\n   *   A structure used to describe a given memory manager to FreeType~2.\n   *\n   * @fields:\n   *   user ::\n   *     A generic typeless pointer for user data.\n   *\n   *   alloc ::\n   *     A pointer type to an allocation function.\n   *\n   *   free ::\n   *     A pointer type to an memory freeing function.\n   *\n   *   realloc ::\n   *     A pointer type to a reallocation function.\n   *\n   */\n  struct  FT_MemoryRec_\n  {\n    void*            user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       I / O   M A N A G E M E N T                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Stream\n   *\n   * @description:\n   *   A handle to an input stream.\n   *\n   */\n  typedef struct FT_StreamRec_*  FT_Stream;\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamDesc\n   *\n   * @description:\n   *   A union type used to store either a long or a pointer.  This is used\n   *   to store a file descriptor or a `FILE*' in an input stream.\n   *\n   */\n  typedef union  FT_StreamDesc_\n  {\n    long   value;\n    void*  pointer;\n\n  } FT_StreamDesc;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_IoFunc\n   *\n   * @description:\n   *   A function used to seek and read data from a given input stream.\n   *\n   * @input:\n   *   stream ::\n   *     A handle to the source stream.\n   *\n   *   offset ::\n   *     The offset of read in stream (always from start).\n   *\n   *   buffer ::\n   *     The address of the read buffer.\n   *\n   *   count ::\n   *     The number of bytes to read from the stream.\n   *\n   * @return:\n   *   The number of bytes effectively read by the stream.\n   *\n   * @note:\n   *   This function might be called to perform a seek or skip operation\n   *   with a `count' of~0.  A non-zero return value then indicates an\n   *   error.\n   *\n   */\n  typedef unsigned long\n  (*FT_Stream_IoFunc)( FT_Stream       stream,\n                       unsigned long   offset,\n                       unsigned char*  buffer,\n                       unsigned long   count );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_CloseFunc\n   *\n   * @description:\n   *   A function used to close a given input stream.\n   *\n   * @input:\n   *  stream ::\n   *     A handle to the target stream.\n   *\n   */\n  typedef void\n  (*FT_Stream_CloseFunc)( FT_Stream  stream );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamRec\n   *\n   * @description:\n   *   A structure used to describe an input stream.\n   *\n   * @input:\n   *   base ::\n   *     For memory-based streams, this is the address of the first stream\n   *     byte in memory.  This field should always be set to NULL for\n   *     disk-based streams.\n   *\n   *   size ::\n   *     The stream size in bytes.\n   *\n   *   pos ::\n   *     The current position within the stream.\n   *\n   *   descriptor ::\n   *     This field is a union that can hold an integer or a pointer.  It is\n   *     used by stream implementations to store file descriptors or `FILE*'\n   *     pointers.\n   *\n   *   pathname ::\n   *     This field is completely ignored by FreeType.  However, it is often\n   *     useful during debugging to use it to store the stream's filename\n   *     (where available).\n   *\n   *   read ::\n   *     The stream's input function.\n   *\n   *   close ::\n   *     The stream's close function.\n   *\n   *   memory ::\n   *     The memory manager to use to preload frames.  This is set\n   *     internally by FreeType and shouldn't be touched by stream\n   *     implementations.\n   *\n   *   cursor ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   *   limit ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   */\n  typedef struct  FT_StreamRec_\n  {\n    unsigned char*       base;\n    unsigned long        size;\n    unsigned long        pos;\n\n    FT_StreamDesc        descriptor;\n    FT_StreamDesc        pathname;\n    FT_Stream_IoFunc     read;\n    FT_Stream_CloseFunc  close;\n\n    FT_Memory            memory;\n    unsigned char*       cursor;\n    unsigned char*       limit;\n\n  } FT_StreamRec;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSYSTEM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/fttrigon.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.h                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (specification).                    */\n/*                                                                         */\n/*  Copyright 2001, 2003, 2005, 2007, 2013 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTRIGON_H__\n#define __FTTRIGON_H__\n\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   computations                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Angle\n   *\n   * @description:\n   *   This type is used to model angle values in FreeType.  Note that the\n   *   angle is a 16.16 fixed-point value expressed in degrees.\n   *\n   */\n  typedef FT_Fixed  FT_Angle;\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI\n   *\n   * @description:\n   *   The angle pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI  ( 180L << 16 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_2PI\n   *\n   * @description:\n   *   The angle 2*pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI2\n   *\n   * @description:\n   *   The angle pi/2 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI4\n   *\n   * @description:\n   *   The angle pi/4 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Sin\n   *\n   * @description:\n   *   Return the sinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The sinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Sin( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Cos\n   *\n   * @description:\n   *   Return the cosinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The cosinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Cos( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Tan\n   *\n   * @description:\n   *   Return the tangent of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The tangent value.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Tan( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Atan2\n   *\n   * @description:\n   *   Return the arc-tangent corresponding to a given vector (x,y) in\n   *   the 2d plane.\n   *\n   * @input:\n   *   x ::\n   *     The horizontal vector coordinate.\n   *\n   *   y ::\n   *     The vertical vector coordinate.\n   *\n   * @return:\n   *   The arc-tangent value (i.e. angle).\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Atan2( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Angle_Diff\n   *\n   * @description:\n   *   Return the difference between two angles.  The result is always\n   *   constrained to the ]-PI..PI] interval.\n   *\n   * @input:\n   *   angle1 ::\n   *     First angle.\n   *\n   *   angle2 ::\n   *     Second angle.\n   *\n   * @return:\n   *   Constrained value of `value2-value1'.\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Unit\n   *\n   * @description:\n   *   Return the unit vector corresponding to a given angle.  After the\n   *   call, the value of `vec.x' will be `sin(angle)', and the value of\n   *   `vec.y' will be `cos(angle)'.\n   *\n   *   This function is useful to retrieve both the sinus and cosinus of a\n   *   given angle quickly.\n   *\n   * @output:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Rotate\n   *\n   * @description:\n   *   Rotate a vector by a given angle.\n   *\n   * @inout:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Length\n   *\n   * @description:\n   *   Return the length of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @return:\n   *   The vector length, expressed in the same units that the original\n   *   vector coordinates.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Polarize\n   *\n   * @description:\n   *   Compute both the length and angle of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @output:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_From_Polar\n   *\n   * @description:\n   *   Compute vector coordinates from a length and angle.\n   *\n   * @output:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @input:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTTRIGON_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftttdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftttdrv.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the TrueType driver                     */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTTDRV_H__\n#define __FTTTDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   tt_driver\n   *\n   * @title:\n   *   The TrueType driver\n   *\n   * @abstract:\n   *   Controlling the TrueType driver module.\n   *\n   * @description:\n   *   While FreeType's TrueType driver doesn't expose API functions by\n   *   itself, it is possible to control its behaviour with @FT_Property_Set\n   *   and @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The TrueType driver's module name is `truetype'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   interpreter-version\n   *\n   * @description:\n   *   Currently, two versions are available which represent the bytecode\n   *   interpreter with and without subpixel hinting support,\n   *   respectively.  The default is subpixel support if\n   *   TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel\n   *   support otherwise (since it isn't available then).\n   *\n   *   If subpixel hinting is on, many TrueType bytecode instructions\n   *   behave differently compared to B/W or grayscale rendering.  The\n   *   main idea is to render at a much increased horizontal resolution,\n   *   then sampling down the created output to subpixel precision.\n   *   However, many older fonts are not suited to this and must be\n   *   specially taken care of by applying (hardcoded) font-specific\n   *   tweaks.\n   *\n   *   Details on subpixel hinting and some of the necessary tweaks can be\n   *   found in Greg Hitchcock's whitepaper at\n   *   `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.\n   *\n   *   The following example code demonstrates how to activate subpixel\n   *   hinting (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_38;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"truetype\",\n   *                               \"interpreter-version\",\n   *                               &interpreter_version );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   TT_INTERPRETER_VERSION_XXX\n   *\n   * @description:\n   *   A list of constants used for the @interpreter-version property to\n   *   select the hinting engine for Truetype fonts.\n   *\n   *   The numeric value in the constant names represents the version\n   *   number as returned by the `GETINFO' bytecode instruction.\n   *\n   * @values:\n   *   TT_INTERPRETER_VERSION_35 ::\n   *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in\n   *     Windows~98; only grayscale and B/W rasterizing is supported.\n   *\n   *   TT_INTERPRETER_VERSION_38 ::\n   *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly\n   *     equivalent to the hinting provided by DirectWrite ClearType (as\n   *     can be found, for example, in the Internet Explorer~9 running on\n   *     Windows~7).\n   *\n   * @note:\n   *   This property controls the behaviour of the bytecode interpreter\n   *   and thus how outlines get hinted.  It does *not* control how glyph\n   *   get rasterized!  In particular, it does not control subpixel color\n   *   filtering.\n   *\n   *   If FreeType has not been compiled with configuration option\n   *   FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an\n   *   `FT_Err_Unimplemented_Feature' error.\n   *\n   */\n#define TT_INTERPRETER_VERSION_35  35\n#define TT_INTERPRETER_VERSION_38  38\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTTTDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/fttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttypes.h                                                              */\n/*                                                                         */\n/*    FreeType simple types definitions (specification only).              */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTYPES_H__\n#define __FTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_SYSTEM_H\n#include FT_IMAGE_H\n\n#include <stddef.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Basic Data Types                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The basic data types defined by the library.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the basic data types defined by FreeType~2,  */\n  /*    ranging from simple scalar types to bitmap descriptors.  More      */\n  /*    font-specific structures are defined in a different section.       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Byte                                                            */\n  /*    FT_Bytes                                                           */\n  /*    FT_Char                                                            */\n  /*    FT_Int                                                             */\n  /*    FT_UInt                                                            */\n  /*    FT_Int16                                                           */\n  /*    FT_UInt16                                                          */\n  /*    FT_Int32                                                           */\n  /*    FT_UInt32                                                          */\n  /*    FT_Short                                                           */\n  /*    FT_UShort                                                          */\n  /*    FT_Long                                                            */\n  /*    FT_ULong                                                           */\n  /*    FT_Bool                                                            */\n  /*    FT_Offset                                                          */\n  /*    FT_PtrDist                                                         */\n  /*    FT_String                                                          */\n  /*    FT_Tag                                                             */\n  /*    FT_Error                                                           */\n  /*    FT_Fixed                                                           */\n  /*    FT_Pointer                                                         */\n  /*    FT_Pos                                                             */\n  /*    FT_Vector                                                          */\n  /*    FT_BBox                                                            */\n  /*    FT_Matrix                                                          */\n  /*    FT_FWord                                                           */\n  /*    FT_UFWord                                                          */\n  /*    FT_F2Dot14                                                         */\n  /*    FT_UnitVector                                                      */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /*                                                                       */\n  /*    FT_Generic                                                         */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /*    FT_Bitmap                                                          */\n  /*    FT_Pixel_Mode                                                      */\n  /*    FT_Palette_Mode                                                    */\n  /*    FT_Glyph_Format                                                    */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bool                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef of unsigned char, used for simple booleans.  As usual,   */\n  /*    values 1 and~0 represent true and false, respectively.             */\n  /*                                                                       */\n  typedef unsigned char  FT_Bool;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_FWord                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 16-bit integer used to store a distance in original font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  typedef signed short  FT_FWord;   /* distance in FUnits */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UFWord                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An unsigned 16-bit integer used to store a distance in original    */\n  /*    font units.                                                        */\n  /*                                                                       */\n  typedef unsigned short  FT_UFWord;  /* unsigned distance */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Char                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _signed_ char type.                       */\n  /*                                                                       */\n  typedef signed char  FT_Char;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Byte                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _unsigned_ char type.                     */\n  /*                                                                       */\n  typedef unsigned char  FT_Byte;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bytes                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for constant memory areas.                               */\n  /*                                                                       */\n  typedef const FT_Byte*  FT_Bytes;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Tag                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for 32-bit tags (as used in the SFNT format).            */\n  /*                                                                       */\n  typedef FT_UInt32  FT_Tag;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_String                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the char type, usually used for strings.      */\n  /*                                                                       */\n  typedef char  FT_String;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Short                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed short.                                        */\n  /*                                                                       */\n  typedef signed short  FT_Short;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UShort                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned short.                                      */\n  /*                                                                       */\n  typedef unsigned short  FT_UShort;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the int type.                                        */\n  /*                                                                       */\n  typedef signed int  FT_Int;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the unsigned int type.                               */\n  /*                                                                       */\n  typedef unsigned int  FT_UInt;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Long                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed long.                                         */\n  /*                                                                       */\n  typedef signed long  FT_Long;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ULong                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned long.                                       */\n  /*                                                                       */\n  typedef unsigned long  FT_ULong;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F2Dot14                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 2.14 fixed-point type used for unit vectors.              */\n  /*                                                                       */\n  typedef signed short  FT_F2Dot14;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 26.6 fixed-point type used for vectorial pixel            */\n  /*    coordinates.                                                       */\n  /*                                                                       */\n  typedef signed long  FT_F26Dot6;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Fixed                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is used to store 16.16 fixed-point values, like scaling  */\n  /*    values or matrix coefficients.                                     */\n  /*                                                                       */\n  typedef signed long  FT_Fixed;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Error                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType error code type.  A value of~0 is always interpreted  */\n  /*    as a successful operation.                                         */\n  /*                                                                       */\n  typedef int  FT_Error;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pointer                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for a typeless pointer.                           */\n  /*                                                                       */\n  typedef void*  FT_Pointer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Offset                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `size_t' type, i.e., the largest  */\n  /*    _unsigned_ integer type used to express a file size or position,   */\n  /*    or a memory block size.                                            */\n  /*                                                                       */\n  typedef size_t  FT_Offset;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_PtrDist                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the       */\n  /*    largest _signed_ integer type used to express the distance         */\n  /*    between two pointers.                                              */\n  /*                                                                       */\n  typedef ft_ptrdiff_t  FT_PtrDist;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_UnitVector                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector unit vector.  Uses    */\n  /*    FT_F2Dot14 types.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: Horizontal coordinate.                                        */\n  /*                                                                       */\n  /*    y :: Vertical coordinate.                                          */\n  /*                                                                       */\n  typedef struct  FT_UnitVector_\n  {\n    FT_F2Dot14  x;\n    FT_F2Dot14  y;\n\n  } FT_UnitVector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Matrix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */\n  /*    in 16.16 fixed-point format.  The computation performed is:        */\n  /*                                                                       */\n  /*       {                                                               */\n  /*          x' = x*xx + y*xy                                             */\n  /*          y' = x*yx + y*yy                                             */\n  /*       }                                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    xy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  typedef struct  FT_Matrix_\n  {\n    FT_Fixed  xx, xy;\n    FT_Fixed  yx, yy;\n\n  } FT_Matrix;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read-only binary data represented as a pointer and a length.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    pointer :: The data.                                               */\n  /*                                                                       */\n  /*    length  :: The length of the data in bytes.                        */\n  /*                                                                       */\n  typedef struct  FT_Data_\n  {\n    const FT_Byte*  pointer;\n    FT_Int          length;\n\n  } FT_Data;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Describe a function used to destroy the `client' data of any       */\n  /*    FreeType object.  See the description of the @FT_Generic type for  */\n  /*    details of usage.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The address of the FreeType object which is under finalization.    */\n  /*    Its client data is accessed through its `generic' field.           */\n  /*                                                                       */\n  typedef void  (*FT_Generic_Finalizer)(void*  object);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Generic                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Client applications often need to associate their own data to a    */\n  /*    variety of FreeType core objects.  For example, a text layout API  */\n  /*    might want to associate a glyph cache to a given size object.      */\n  /*                                                                       */\n  /*    Some FreeType object contains a `generic' field, of type           */\n  /*    FT_Generic, which usage is left to client applications and font    */\n  /*    servers.                                                           */\n  /*                                                                       */\n  /*    It can be used to store a pointer to client-specific data, as well */\n  /*    as the address of a `finalizer' function, which will be called by  */\n  /*    FreeType when the object is destroyed (for example, the previous   */\n  /*    client example would put the address of the glyph cache destructor */\n  /*    in the `finalizer' field).                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    data      :: A typeless pointer to any client-specified data. This */\n  /*                 field is completely ignored by the FreeType library.  */\n  /*                                                                       */\n  /*    finalizer :: A pointer to a `generic finalizer' function, which    */\n  /*                 will be called when the object is destroyed.  If this */\n  /*                 field is set to NULL, no code will be called.         */\n  /*                                                                       */\n  typedef struct  FT_Generic_\n  {\n    void*                 data;\n    FT_Generic_Finalizer  finalizer;\n\n  } FT_Generic;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags which are used to label       */\n  /*    TrueType tables into an unsigned long to be used within FreeType.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The produced values *must* be 32-bit integers.  Don't redefine     */\n  /*    this macro.                                                        */\n  /*                                                                       */\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          (FT_Tag)                        \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                    L I S T   M A N A G E M E N T                      */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ListNode                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     Many elements and objects in FreeType are listed through an       */\n  /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */\n  /*     FT_ListNode is a handle to a single list element.                 */\n  /*                                                                       */\n  typedef struct FT_ListNodeRec_*  FT_ListNode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_List                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a list record (see @FT_ListRec).                       */\n  /*                                                                       */\n  typedef struct FT_ListRec_*  FT_List;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a single list element.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    prev :: The previous element in the list.  NULL if first.          */\n  /*                                                                       */\n  /*    next :: The next element in the list.  NULL if last.               */\n  /*                                                                       */\n  /*    data :: A typeless pointer to the listed object.                   */\n  /*                                                                       */\n  typedef struct  FT_ListNodeRec_\n  {\n    FT_ListNode  prev;\n    FT_ListNode  next;\n    void*        data;\n\n  } FT_ListNodeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a simple doubly-linked list.  These are   */\n  /*    used in many parts of FreeType.                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    head :: The head (first element) of doubly-linked list.            */\n  /*                                                                       */\n  /*    tail :: The tail (last element) of doubly-linked list.             */\n  /*                                                                       */\n  typedef struct  FT_ListRec_\n  {\n    FT_ListNode  head;\n    FT_ListNode  tail;\n\n  } FT_ListRec;\n\n\n  /* */\n\n#define FT_IS_EMPTY( list )  ( (list).head == 0 )\n#define FT_BOOL( x )  ( (FT_Bool)( x ) )\n\n  /* concatenate C tokens */\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n  /* see `ftmoderr.h' for descriptions of the following macros */\n\n#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#define FT_ERROR_BASE( x )    ( (x) & 0xFF )\n#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )\n\n#define FT_ERR_EQ( x, e )                                        \\\n          ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )\n#define FT_ERR_NEQ( x, e )                                       \\\n          ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.h                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows fnt-specific data.                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2008 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTWINFNT_H__\n#define __FTWINFNT_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    winfnt_fonts                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Window FNT Files                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Windows FNT specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Windows FNT specific      */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_WinFNT_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `charset' byte in\n   *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX\n   *   encodings (except for cp1361) can be found at ftp://ftp.unicode.org\n   *   in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory.  cp1361 is\n   *   roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.\n   *\n   * @values:\n   *   FT_WinFNT_ID_DEFAULT ::\n   *     This is used for font enumeration and font creation as a\n   *     `don't care' value.  Valid font files don't contain this value.\n   *     When querying for information about the character set of the font\n   *     that is currently selected into a specified device context, this\n   *     return value (of the related Windows API) simply denotes failure.\n   *\n   *   FT_WinFNT_ID_SYMBOL ::\n   *     There is no known mapping table available.\n   *\n   *   FT_WinFNT_ID_MAC ::\n   *     Mac Roman encoding.\n   *\n   *   FT_WinFNT_ID_OEM ::\n   *     From Michael Pöttgen <michael@poettgen.de>:\n   *\n   *       The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM\n   *       is used for the charset of vector fonts, like `modern.fon',\n   *       `roman.fon', and `script.fon' on Windows.\n   *\n   *       The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value\n   *       specifies a character set that is operating-system dependent.\n   *\n   *       The `IFIMETRICS' documentation from the `Windows Driver\n   *       Development Kit' says: This font supports an OEM-specific\n   *       character set.  The OEM character set is system dependent.\n   *\n   *       In general OEM, as opposed to ANSI (i.e., cp1252), denotes the\n   *       second default codepage that most international versions of\n   *       Windows have.  It is one of the OEM codepages from\n   *\n   *         http://www.microsoft.com/globaldev/reference/cphome.mspx,\n   *\n   *       and is used for the `DOS boxes', to support legacy applications.\n   *       A German Windows version for example usually uses ANSI codepage\n   *       1252 and OEM codepage 850.\n   *\n   *   FT_WinFNT_ID_CP874 ::\n   *     A superset of Thai TIS 620 and ISO 8859-11.\n   *\n   *   FT_WinFNT_ID_CP932 ::\n   *     A superset of Japanese Shift-JIS (with minor deviations).\n   *\n   *   FT_WinFNT_ID_CP936 ::\n   *     A superset of simplified Chinese GB 2312-1980 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP949 ::\n   *     A superset of Korean Hangul KS~C 5601-1987 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP950 ::\n   *     A superset of traditional Chinese Big~5 ETen (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP1250 ::\n   *     A superset of East European ISO 8859-2 (with slightly different\n   *     ordering).\n   *\n   *   FT_WinFNT_ID_CP1251 ::\n   *     A superset of Russian ISO 8859-5 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1252 ::\n   *     ANSI encoding.  A superset of ISO 8859-1.\n   *\n   *   FT_WinFNT_ID_CP1253 ::\n   *     A superset of Greek ISO 8859-7 (with minor modifications).\n   *\n   *   FT_WinFNT_ID_CP1254 ::\n   *     A superset of Turkish ISO 8859-9.\n   *\n   *   FT_WinFNT_ID_CP1255 ::\n   *     A superset of Hebrew ISO 8859-8 (with some modifications).\n   *\n   *   FT_WinFNT_ID_CP1256 ::\n   *     A superset of Arabic ISO 8859-6 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1257 ::\n   *     A superset of Baltic ISO 8859-13 (with some deviations).\n   *\n   *   FT_WinFNT_ID_CP1258 ::\n   *     For Vietnamese.  This encoding doesn't cover all necessary\n   *     characters.\n   *\n   *   FT_WinFNT_ID_CP1361 ::\n   *     Korean (Johab).\n   */\n\n#define FT_WinFNT_ID_CP1252    0\n#define FT_WinFNT_ID_DEFAULT   1\n#define FT_WinFNT_ID_SYMBOL    2\n#define FT_WinFNT_ID_MAC      77\n#define FT_WinFNT_ID_CP932   128\n#define FT_WinFNT_ID_CP949   129\n#define FT_WinFNT_ID_CP1361  130\n#define FT_WinFNT_ID_CP936   134\n#define FT_WinFNT_ID_CP950   136\n#define FT_WinFNT_ID_CP1253  161\n#define FT_WinFNT_ID_CP1254  162\n#define FT_WinFNT_ID_CP1258  163\n#define FT_WinFNT_ID_CP1255  177\n#define FT_WinFNT_ID_CP1256  178\n#define FT_WinFNT_ID_CP1257  186\n#define FT_WinFNT_ID_CP1251  204\n#define FT_WinFNT_ID_CP874   222\n#define FT_WinFNT_ID_CP1250  238\n#define FT_WinFNT_ID_OEM     255\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_HeaderRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Windows FNT Header info.                                           */\n  /*                                                                       */\n  typedef struct  FT_WinFNT_HeaderRec_\n  {\n    FT_UShort  version;\n    FT_ULong   file_size;\n    FT_Byte    copyright[60];\n    FT_UShort  file_type;\n    FT_UShort  nominal_point_size;\n    FT_UShort  vertical_resolution;\n    FT_UShort  horizontal_resolution;\n    FT_UShort  ascent;\n    FT_UShort  internal_leading;\n    FT_UShort  external_leading;\n    FT_Byte    italic;\n    FT_Byte    underline;\n    FT_Byte    strike_out;\n    FT_UShort  weight;\n    FT_Byte    charset;\n    FT_UShort  pixel_width;\n    FT_UShort  pixel_height;\n    FT_Byte    pitch_and_family;\n    FT_UShort  avg_width;\n    FT_UShort  max_width;\n    FT_Byte    first_char;\n    FT_Byte    last_char;\n    FT_Byte    default_char;\n    FT_Byte    break_char;\n    FT_UShort  bytes_per_row;\n    FT_ULong   device_offset;\n    FT_ULong   face_name_offset;\n    FT_ULong   bits_pointer;\n    FT_ULong   bits_offset;\n    FT_Byte    reserved;\n    FT_ULong   flags;\n    FT_UShort  A_space;\n    FT_UShort  B_space;\n    FT_UShort  C_space;\n    FT_UShort  color_table_offset;\n    FT_ULong   reserved1[4];\n\n  } FT_WinFNT_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_Header                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FT_WinFNT_HeaderRec structure.                     */\n  /*                                                                       */\n  typedef struct FT_WinFNT_HeaderRec_*  FT_WinFNT_Header;\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_WinFNT_Header\n   *\n   * @description:\n   *    Retrieve a Windows FNT font info header.\n   *\n   * @input:\n   *    face    :: A handle to the input face.\n   *\n   * @output:\n   *    aheader :: The WinFNT header.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function only works with Windows FNT faces, returning an error\n   *   otherwise.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *aheader );\n\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTWINFNT_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ftxf86.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.h                                                               */\n/*                                                                         */\n/*    Support functions for X11.                                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2007 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTXF86_H__\n#define __FTXF86_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   font_formats                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   Font Formats                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   Getting the font format.                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   The single function in this section can be used to get the font     */\n  /*   format.  Note that this information is not needed normally;         */\n  /*   however, there are special cases (like in PDF devices) where it is  */\n  /*   important to differentiate, in spite of FreeType's uniform API.     */\n  /*                                                                       */\n  /*   This function is in the X11/xf86 namespace for historical reasons   */\n  /*   and in no way depends on that windowing system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*   FT_Get_X11_Font_Format                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Return a string describing the format of a given face, using values */\n  /*   which can be used as an X11 FONT_PROPERTY.  Possible values are     */\n  /*   `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */\n  /*   `PFR', and `Windows~FNT'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   face ::                                                             */\n  /*     Input face handle.                                                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   Font format string.  NULL in case of error.                         */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTXF86_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/autohint.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  autohint.h                                                             */\n/*                                                                         */\n/*    High-level `autohint' module-specific interface (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2007, 2009, 2012 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The auto-hinter is used to load and automatically hint glyphs if a    */\n  /* format-specific hinter isn't available.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __AUTOHINT_H__\n#define __AUTOHINT_H__\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A small technical note regarding automatic hinting in order to        */\n  /* clarify this module interface.                                        */\n  /*                                                                       */\n  /* An automatic hinter might compute two kinds of data for a given face: */\n  /*                                                                       */\n  /* - global hints: Usually some metrics that describe global properties  */\n  /*                 of the face.  It is computed by scanning more or less */\n  /*                 aggressively the glyphs in the face, and thus can be  */\n  /*                 very slow to compute (even if the size of global      */\n  /*                 hints is really small).                               */\n  /*                                                                       */\n  /* - glyph hints:  These describe some important features of the glyph   */\n  /*                 outline, as well as how to align them.  They are      */\n  /*                 generally much faster to compute than global hints.   */\n  /*                                                                       */\n  /* The current FreeType auto-hinter does a pretty good job while         */\n  /* performing fast computations for both global and glyph hints.         */\n  /* However, we might be interested in introducing more complex and       */\n  /* powerful algorithms in the future, like the one described in the John */\n  /* D. Hobby paper, which unfortunately requires a lot more horsepower.   */\n  /*                                                                       */\n  /* Because a sufficiently sophisticated font management system would     */\n  /* typically implement an LRU cache of opened face objects to reduce     */\n  /* memory usage, it is a good idea to be able to avoid recomputing       */\n  /* global hints every time the same face is re-opened.                   */\n  /*                                                                       */\n  /* We thus provide the ability to cache global hints outside of the face */\n  /* object, in order to speed up font re-opening time.  Of course, this   */\n  /* feature is purely optional, so most client programs won't even notice */\n  /* it.                                                                   */\n  /*                                                                       */\n  /* I initially thought that it would be a good idea to cache the glyph   */\n  /* hints too.  However, my general idea now is that if you really need   */\n  /* to cache these too, you are simply in need of a new font format,      */\n  /* where all this information could be stored within the font file and   */\n  /* decoded on the fly.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct FT_AutoHinterRec_  *FT_AutoHinter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalGetFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the global hints computed for a given face object.  The   */\n  /*    resulting data is dissociated from the face and will survive a     */\n  /*    call to FT_Done_Face().  It must be discarded through the API      */\n  /*    FT_AutoHinter_GlobalDoneFunc().                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter       :: A handle to the source auto-hinter.                */\n  /*                                                                       */\n  /*    face         :: A handle to the source face object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    global_hints :: A typeless pointer to the global hints.            */\n  /*                                                                       */\n  /*    global_len   :: The size in bytes of the global hints.             */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,\n                                  FT_Face        face,\n                                  void**         global_hints,\n                                  long*          global_len );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalDoneFunc                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard the global hints retrieved through                         */\n  /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */\n  /*    are freed from memory.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the auto-hinter module.                      */\n  /*                                                                       */\n  /*    global :: A pointer to retrieved global hints to discard.          */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter  hinter,\n                                   void*          global );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalResetFunc                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to recompute the global metrics in a given   */\n  /*    font.  This is useful when global font data changes (e.g. Multiple */\n  /*    Masters fonts where blend coordinates change).                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the source auto-hinter.                      */\n  /*                                                                       */\n  /*    face   :: A handle to the face.                                    */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter  hinter,\n                                    FT_Face        face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlyphLoadFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to load, scale, and automatically hint a     */\n  /*    glyph from a given face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the face.                               */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    load_flags  :: The load flags.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is capable of loading composite glyphs by hinting    */\n  /*    each sub-glyph independently (which improves quality).             */\n  /*                                                                       */\n  /*    It will call the font driver with @FT_Load_Glyph, with             */\n  /*    @FT_LOAD_NO_SCALE set.                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,\n                                  FT_GlyphSlot   slot,\n                                  FT_Size        size,\n                                  FT_UInt        glyph_index,\n                                  FT_Int32       load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_AutoHinter_InterfaceRec                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The auto-hinter module's interface.                                */\n  /*                                                                       */\n  typedef struct  FT_AutoHinter_InterfaceRec_\n  {\n    FT_AutoHinter_GlobalResetFunc  reset_face;\n    FT_AutoHinter_GlobalGetFunc    get_global_hints;\n    FT_AutoHinter_GlobalDoneFunc   done_global_hints;\n    FT_AutoHinter_GlyphLoadFunc    load_glyph;\n\n  } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(       \\\n          class_,                             \\\n          reset_face_,                        \\\n          get_global_hints_,                  \\\n          done_global_hints_,                 \\\n          load_glyph_ )                       \\\n  FT_CALLBACK_TABLE_DEF                       \\\n  const FT_AutoHinter_InterfaceRec  class_ =  \\\n  {                                           \\\n    reset_face_,                              \\\n    get_global_hints_,                        \\\n    done_global_hints_,                       \\\n    load_glyph_                               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(                            \\\n          class_,                                                  \\\n          reset_face_,                                             \\\n          get_global_hints_,                                       \\\n          done_global_hints_,                                      \\\n          load_glyph_ )                                            \\\n  void                                                             \\\n  FT_Init_Class_ ## class_( FT_Library                   library,  \\\n                            FT_AutoHinter_InterfaceRec*  clazz )   \\\n  {                                                                \\\n    FT_UNUSED( library );                                          \\\n                                                                   \\\n    clazz->reset_face        = reset_face_;                        \\\n    clazz->get_global_hints  = get_global_hints_;                  \\\n    clazz->done_global_hints = done_global_hints_;                 \\\n    clazz->load_glyph        = load_glyph_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __AUTOHINT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftcalc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcalc.h                                                               */\n/*                                                                         */\n/*    Arithmetic computations (specification).                             */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2009, 2012-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCALC_H__\n#define __FTCALC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FixedSqrt                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the square root of a 16.16 fixed-point value.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x :: The value to compute the root for.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `sqrt(x)'.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is not very fast.                                    */\n  /*                                                                       */\n  FT_BASE( FT_Int32 )\n  FT_SqrtFixed( FT_Int32  x );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv_No_Round                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    (without rounding) with maximum accuracy (it uses a 64-bit         */\n  /*    intermediate integer whenever necessary).                          */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_BASE( FT_Long )\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c );\n\n\n  /*\n   *  A variant of FT_Matrix_Multiply which scales its result afterwards.\n   *  The idea is that both `a' and `b' are scaled by factors of 10 so that\n   *  the values are as precise as possible to get a correct result during\n   *  the 64bit multiplication.  Let `sa' and `sb' be the scaling factors of\n   *  `a' and `b', respectively, then the scaling factor of the result is\n   *  `sa*sb'.\n   */\n  FT_BASE( void )\n  FT_Matrix_Multiply_Scaled( const FT_Matrix*  a,\n                             FT_Matrix        *b,\n                             FT_Long           scaling );\n\n\n  /*\n   *  A variant of FT_Vector_Transform.  See comments for\n   *  FT_Matrix_Multiply_Scaled.\n   */\n  FT_BASE( void )\n  FT_Vector_Transform_Scaled( FT_Vector*        vector,\n                              const FT_Matrix*  matrix,\n                              FT_Long           scaling );\n\n\n  /*\n   *  Return -1, 0, or +1, depending on the orientation of a given corner.\n   *  We use the Cartesian coordinate system, with positive vertical values\n   *  going upwards.  The function returns +1 if the corner turns to the\n   *  left, -1 to the right, and 0 for undecidable cases.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_orientation( FT_Pos  in_x,\n                         FT_Pos  in_y,\n                         FT_Pos  out_x,\n                         FT_Pos  out_y );\n\n  /*\n   *  Return TRUE if a corner is flat or nearly flat.  This is equivalent to\n   *  saying that the angle difference between the `in' and `out' vectors is\n   *  very small.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_is_flat( FT_Pos  in_x,\n                     FT_Pos  in_y,\n                     FT_Pos  out_x,\n                     FT_Pos  out_y );\n\n\n  /*\n   *  Return the most significant bit index.\n   */\n  FT_BASE( FT_Int )\n  FT_MSB( FT_UInt32  z );\n\n\n  /*\n   *  Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses\n   *  two fixed-point arguments instead.\n   */\n  FT_BASE( FT_Fixed )\n  FT_Hypot( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n#define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )\n#define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )\n#define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )\n#define F2DOT14_TO_FIXED( x )  ( (FT_Long)(x) << 2  )\n#define FLOAT_TO_FIXED( x )    ( (FT_Long)( x * 65536.0 ) )\n#define FIXED_TO_INT( x )      ( FT_RoundFix( x ) >> 16 )\n\n#define ROUND_F26DOT6( x )     ( x >= 0 ? (    ( (x) + 32 ) & -64 )     \\\n                                        : ( -( ( 32 - (x) ) & -64 ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTCALC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftdebug.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdebug.h                                                              */\n/*                                                                         */\n/*    Debugging and logging component (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/*                                                                         */\n/*  IMPORTANT: A description of FreeType's debugging support can be        */\n/*             found in `docs/DEBUG.TXT'.  Read it if you need to use or   */\n/*             understand this code.                                       */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDEBUG_H__\n#define __FTDEBUG_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */\n  /* is already defined; this simplifies the following #ifdefs            */\n  /*                                                                      */\n#ifdef FT_DEBUG_LEVEL_TRACE\n#undef  FT_DEBUG_LEVEL_ERROR\n#define FT_DEBUG_LEVEL_ERROR\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the trace enums as well as the trace levels array when they    */\n  /* are needed.                                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE_DEF( x )  trace_ ## x ,\n\n  /* defining the enumeration */\n  typedef enum  FT_Trace_\n  {\n#include FT_INTERNAL_TRACE_H\n    trace_count\n\n  } FT_Trace;\n\n\n  /* defining the array of trace levels, provided by `src/base/ftdebug.c' */\n  extern int  ft_trace_levels[trace_count];\n\n#undef FT_TRACE_DEF\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_TRACE macro                                             */\n  /*                                                                       */\n  /* IMPORTANT!                                                            */\n  /*                                                                       */\n  /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */\n  /* value before using any TRACE macro.                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE( level, varformat )                      \\\n          do                                              \\\n          {                                               \\\n            if ( ft_trace_levels[FT_COMPONENT] >= level ) \\\n              FT_Message varformat;                       \\\n          } while ( 0 )\n\n#else /* !FT_DEBUG_LEVEL_TRACE */\n\n#define FT_TRACE( level, varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Count                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the number of available trace components.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of trace components.  0 if FreeType 2 is not built with */\n  /*    FT_DEBUG_LEVEL_TRACE definition.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may be useful if you want to access elements of      */\n  /*    the internal `ft_trace_levels' array by an index.                  */\n  /*                                                                       */\n  FT_BASE( FT_Int )\n  FT_Trace_Get_Count( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the name of a trace component.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The index of the trace component.                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The name of the trace component.  This is a statically allocated   */\n  /*    C string, so do not free it after use.  NULL if FreeType 2 is not  */\n  /*    built with FT_DEBUG_LEVEL_TRACE definition.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Trace_Get_Count to get the number of available trace       */\n  /*    components.                                                        */\n  /*                                                                       */\n  /*    This function may be useful if you want to control FreeType 2's    */\n  /*    debug level in your application.                                   */\n  /*                                                                       */\n  FT_BASE( const char * )\n  FT_Trace_Get_Name( FT_Int  idx );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* You need two opening and closing parentheses!                         */\n  /*                                                                       */\n  /* Example: FT_TRACE0(( \"Value is %i\", foo ))                            */\n  /*                                                                       */\n  /* Output of the FT_TRACEX macros is sent to stderr.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_TRACE0( varformat )  FT_TRACE( 0, varformat )\n#define FT_TRACE1( varformat )  FT_TRACE( 1, varformat )\n#define FT_TRACE2( varformat )  FT_TRACE( 2, varformat )\n#define FT_TRACE3( varformat )  FT_TRACE( 3, varformat )\n#define FT_TRACE4( varformat )  FT_TRACE( 4, varformat )\n#define FT_TRACE5( varformat )  FT_TRACE( 5, varformat )\n#define FT_TRACE6( varformat )  FT_TRACE( 6, varformat )\n#define FT_TRACE7( varformat )  FT_TRACE( 7, varformat )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ERROR macro.                                            */\n  /*                                                                       */\n  /* Output of this macro is sent to stderr.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ERROR( varformat )  FT_Message  varformat\n\n#else  /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ERROR( varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ASSERT and FT_THROW macros.  The call to `FT_Throw'     */\n  /* makes it possible to easily set a breakpoint at this function.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ASSERT( condition )                                      \\\n          do                                                        \\\n          {                                                         \\\n            if ( !( condition ) )                                   \\\n              FT_Panic( \"assertion failed on line %d of file %s\\n\", \\\n                        __LINE__, __FILE__ );                       \\\n          } while ( 0 )\n\n#define FT_THROW( e )                                   \\\n          ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ),   \\\n                      __LINE__,                         \\\n                      __FILE__ )                      | \\\n            FT_ERR_CAT( FT_ERR_PREFIX, e )            )\n\n#else /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ASSERT( condition )  do { } while ( 0 )\n\n#define FT_THROW( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define `FT_Message' and `FT_Panic' when needed.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#include \"stdio.h\"  /* for vfprintf() */\n\n  /* print a message */\n  FT_BASE( void )\n  FT_Message( const char*  fmt,\n              ... );\n\n  /* print a message and exit */\n  FT_BASE( void )\n  FT_Panic( const char*  fmt,\n            ... );\n\n  /* report file name and line number of an error */\n  FT_BASE( int )\n  FT_Throw( FT_Error     error,\n            int          line,\n            const char*  file );\n\n#endif /* FT_DEBUG_LEVEL_ERROR */\n\n\n  FT_BASE( void )\n  ft_debug_init( void );\n\nFT_END_HEADER\n\n#endif /* __FTDEBUG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftdriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdriver.h                                                             */\n/*                                                                         */\n/*    FreeType font driver interface (specification).                      */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2011-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDRIVER_H__\n#define __FTDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef FT_Error\n  (*FT_Face_InitFunc)( FT_Stream      stream,\n                       FT_Face        face,\n                       FT_Int         typeface_index,\n                       FT_Int         num_params,\n                       FT_Parameter*  parameters );\n\n  typedef void\n  (*FT_Face_DoneFunc)( FT_Face  face );\n\n\n  typedef FT_Error\n  (*FT_Size_InitFunc)( FT_Size  size );\n\n  typedef void\n  (*FT_Size_DoneFunc)( FT_Size  size );\n\n\n  typedef FT_Error\n  (*FT_Slot_InitFunc)( FT_GlyphSlot  slot );\n\n  typedef void\n  (*FT_Slot_DoneFunc)( FT_GlyphSlot  slot );\n\n\n  typedef FT_Error\n  (*FT_Size_RequestFunc)( FT_Size          size,\n                          FT_Size_Request  req );\n\n  typedef FT_Error\n  (*FT_Size_SelectFunc)( FT_Size   size,\n                         FT_ULong  size_index );\n\n  typedef FT_Error\n  (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,\n                       FT_Size       size,\n                       FT_UInt       glyph_index,\n                       FT_Int32      load_flags );\n\n\n  typedef FT_UInt\n  (*FT_CharMap_CharIndexFunc)( FT_CharMap  charmap,\n                               FT_Long     charcode );\n\n  typedef FT_Long\n  (*FT_CharMap_CharNextFunc)( FT_CharMap  charmap,\n                              FT_Long     charcode );\n\n\n  typedef FT_Error\n  (*FT_Face_GetKerningFunc)( FT_Face     face,\n                             FT_UInt     left_glyph,\n                             FT_UInt     right_glyph,\n                             FT_Vector*  kerning );\n\n\n  typedef FT_Error\n  (*FT_Face_AttachFunc)( FT_Face    face,\n                         FT_Stream  stream );\n\n\n  typedef FT_Error\n  (*FT_Face_GetAdvancesFunc)( FT_Face    face,\n                              FT_UInt    first,\n                              FT_UInt    count,\n                              FT_Int32   flags,\n                              FT_Fixed*  advances );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Driver_ClassRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The font driver class.  This structure mostly contains pointers to */\n  /*    driver methods.                                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root             :: The parent module.                             */\n  /*                                                                       */\n  /*    face_object_size :: The size of a face object in bytes.            */\n  /*                                                                       */\n  /*    size_object_size :: The size of a size object in bytes.            */\n  /*                                                                       */\n  /*    slot_object_size :: The size of a glyph object in bytes.           */\n  /*                                                                       */\n  /*    init_face        :: The format-specific face constructor.          */\n  /*                                                                       */\n  /*    done_face        :: The format-specific face destructor.           */\n  /*                                                                       */\n  /*    init_size        :: The format-specific size constructor.          */\n  /*                                                                       */\n  /*    done_size        :: The format-specific size destructor.           */\n  /*                                                                       */\n  /*    init_slot        :: The format-specific slot constructor.          */\n  /*                                                                       */\n  /*    done_slot        :: The format-specific slot destructor.           */\n  /*                                                                       */\n  /*                                                                       */\n  /*    load_glyph       :: A function handle to load a glyph to a slot.   */\n  /*                        This field is mandatory!                       */\n  /*                                                                       */\n  /*    get_kerning      :: A function handle to return the unscaled       */\n  /*                        kerning for a given pair of glyphs.  Can be    */\n  /*                        set to 0 if the format doesn't support         */\n  /*                        kerning.                                       */\n  /*                                                                       */\n  /*    attach_file      :: This function handle is used to read           */\n  /*                        additional data for a face from another        */\n  /*                        file/stream.  For example, this can be used to */\n  /*                        add data from AFM or PFM files on a Type 1     */\n  /*                        face, or a CIDMap on a CID-keyed face.         */\n  /*                                                                       */\n  /*    get_advances     :: A function handle used to return advance       */\n  /*                        widths of `count' glyphs (in font units),      */\n  /*                        starting at `first'.  The `vertical' flag must */\n  /*                        be set to get vertical advance heights.  The   */\n  /*                        `advances' buffer is caller-allocated.         */\n  /*                        The idea of this function is to be able to     */\n  /*                        perform device-independent text layout without */\n  /*                        loading a single glyph image.                  */\n  /*                                                                       */\n  /*    request_size     :: A handle to a function used to request the new */\n  /*                        character size.  Can be set to 0 if the        */\n  /*                        scaling done in the base layer suffices.       */\n  /*                                                                       */\n  /*    select_size      :: A handle to a function used to select a new    */\n  /*                        fixed size.  It is used only if                */\n  /*                        @FT_FACE_FLAG_FIXED_SIZES is set.  Can be set  */\n  /*                        to 0 if the scaling done in the base layer     */\n  /*                        suffices.                                      */\n  /* <Note>                                                                */\n  /*    Most function pointers, with the exception of `load_glyph', can be */\n  /*    set to 0 to indicate a default behaviour.                          */\n  /*                                                                       */\n  typedef struct  FT_Driver_ClassRec_\n  {\n    FT_Module_Class          root;\n\n    FT_Long                  face_object_size;\n    FT_Long                  size_object_size;\n    FT_Long                  slot_object_size;\n\n    FT_Face_InitFunc         init_face;\n    FT_Face_DoneFunc         done_face;\n\n    FT_Size_InitFunc         init_size;\n    FT_Size_DoneFunc         done_size;\n\n    FT_Slot_InitFunc         init_slot;\n    FT_Slot_DoneFunc         done_slot;\n\n    FT_Slot_LoadFunc         load_glyph;\n\n    FT_Face_GetKerningFunc   get_kerning;\n    FT_Face_AttachFunc       attach_file;\n    FT_Face_GetAdvancesFunc  get_advances;\n\n    /* since version 2.2 */\n    FT_Size_RequestFunc      request_size;\n    FT_Size_SelectFunc       select_size;\n\n  } FT_Driver_ClassRec, *FT_Driver_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_DRIVER                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of an FT_Driver_ClassRec      */\n  /*    struct instance.                                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_DRIVER                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Driver_ClassRec struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */\n  /*    called with a pointer where the allocated structure is returned.   */\n  /*    And when it is no longer needed a `destroy' function needs to be   */\n  /*    called to release that allocation.                                 */\n  /*                                                                       */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains a   */\n  /*    mechanism to call these functions for the default modules          */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by driver definition calling `FT_DEFINE_DRIVER' in following.      */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_DRIVER( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Driver_ClassRec  class_;\n\n#define FT_DEFINE_DRIVER(                    \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          face_object_size_,                 \\\n          size_object_size_,                 \\\n          slot_object_size_,                 \\\n          init_face_,                        \\\n          done_face_,                        \\\n          init_size_,                        \\\n          done_size_,                        \\\n          init_slot_,                        \\\n          done_slot_,                        \\\n          load_glyph_,                       \\\n          get_kerning_,                      \\\n          attach_file_,                      \\\n          get_advances_,                     \\\n          request_size_,                     \\\n          select_size_ )                     \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Driver_ClassRec  class_ =         \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n                                             \\\n    face_object_size_,                       \\\n    size_object_size_,                       \\\n    slot_object_size_,                       \\\n                                             \\\n    init_face_,                              \\\n    done_face_,                              \\\n                                             \\\n    init_size_,                              \\\n    done_size_,                              \\\n                                             \\\n    init_slot_,                              \\\n    done_slot_,                              \\\n                                             \\\n    load_glyph_,                             \\\n                                             \\\n    get_kerning_,                            \\\n    attach_file_,                            \\\n    get_advances_,                           \\\n                                             \\\n    request_size_,                           \\\n    select_size_                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_DRIVER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_DRIVER(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          face_object_size_,                                     \\\n          size_object_size_,                                     \\\n          slot_object_size_,                                     \\\n          init_face_,                                            \\\n          done_face_,                                            \\\n          init_size_,                                            \\\n          done_size_,                                            \\\n          init_slot_,                                            \\\n          done_slot_,                                            \\\n          load_glyph_,                                           \\\n          get_kerning_,                                          \\\n          attach_file_,                                          \\\n          get_advances_,                                         \\\n          request_size_,                                         \\\n          select_size_ )                                         \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory        memory = library->memory;                   \\\n    FT_Driver_Class  dclazz = (FT_Driver_Class)clazz;            \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( dclazz )                                                \\\n      FT_FREE( dclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Driver_Class  clazz  = NULL;                              \\\n    FT_Error         error;                                      \\\n    FT_Memory        memory = library->memory;                   \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->face_object_size = face_object_size_;                 \\\n    clazz->size_object_size = size_object_size_;                 \\\n    clazz->slot_object_size = slot_object_size_;                 \\\n                                                                 \\\n    clazz->init_face        = init_face_;                        \\\n    clazz->done_face        = done_face_;                        \\\n                                                                 \\\n    clazz->init_size        = init_size_;                        \\\n    clazz->done_size        = done_size_;                        \\\n                                                                 \\\n    clazz->init_slot        = init_slot_;                        \\\n    clazz->done_slot        = done_slot_;                        \\\n                                                                 \\\n    clazz->load_glyph       = load_glyph_;                       \\\n                                                                 \\\n    clazz->get_kerning      = get_kerning_;                      \\\n    clazz->attach_file      = attach_file_;                      \\\n    clazz->get_advances     = get_advances_;                     \\\n                                                                 \\\n    clazz->request_size     = request_size_;                     \\\n    clazz->select_size      = select_size_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __FTDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftgloadr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgloadr.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph loader (specification).                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2005, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGLOADR_H__\n#define __FTGLOADR_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphLoader                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The glyph loader is an internal object used to load several glyphs */\n  /*    together (for example, in the case of composites).                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The glyph loader implementation is not part of the high-level API, */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;\n\n\n#if 0  /* moved to freetype.h in version 2.2 */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n#endif\n\n\n  typedef struct  FT_SubGlyphRec_\n  {\n    FT_Int     index;\n    FT_UShort  flags;\n    FT_Int     arg1;\n    FT_Int     arg2;\n    FT_Matrix  transform;\n\n  } FT_SubGlyphRec;\n\n\n  typedef struct  FT_GlyphLoadRec_\n  {\n    FT_Outline   outline;       /* outline                   */\n    FT_Vector*   extra_points;  /* extra points table        */\n    FT_Vector*   extra_points2; /* second extra points table */\n    FT_UInt      num_subglyphs; /* number of subglyphs       */\n    FT_SubGlyph  subglyphs;     /* subglyphs                 */\n\n  } FT_GlyphLoadRec, *FT_GlyphLoad;\n\n\n  typedef struct  FT_GlyphLoaderRec_\n  {\n    FT_Memory        memory;\n    FT_UInt          max_points;\n    FT_UInt          max_contours;\n    FT_UInt          max_subglyphs;\n    FT_Bool          use_extra;\n\n    FT_GlyphLoadRec  base;\n    FT_GlyphLoadRec  current;\n\n    void*            other;            /* for possible future extension? */\n\n  } FT_GlyphLoaderRec;\n\n\n  /* create new empty glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_New( FT_Memory        memory,\n                      FT_GlyphLoader  *aloader );\n\n  /* add an extra points table to a glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );\n\n  /* destroy a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Done( FT_GlyphLoader  loader );\n\n  /* reset a glyph loader (frees everything int it) */\n  FT_BASE( void )\n  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );\n\n  /* rewind a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );\n\n  /* check that there is enough space to add `n_points' and `n_contours' */\n  /* to the glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,\n                              FT_UInt         n_points,\n                              FT_UInt         n_contours );\n\n\n#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                         \\\n   ( (_count) == 0 || ((_loader)->base.outline.n_points    +              \\\n                       (_loader)->current.outline.n_points +              \\\n                       (unsigned long)(_count)) <= (_loader)->max_points )\n\n#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                          \\\n  ( (_count) == 0 || ((_loader)->base.outline.n_contours    +              \\\n                      (_loader)->current.outline.n_contours +              \\\n                      (unsigned long)(_count)) <= (_loader)->max_contours )\n\n#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \\\n  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \\\n      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \\\n    ? 0                                                                \\\n    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )\n\n\n  /* check that there is enough space to add `n_subs' sub-glyphs to */\n  /* a glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,\n                                 FT_UInt         n_subs );\n\n  /* prepare a glyph loader, i.e. empty the current glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );\n\n  /* add the current glyph to the base glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Add( FT_GlyphLoader  loader );\n\n  /* copy points from one glyph loader to another */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,\n                             FT_GlyphLoader  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLOADR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftmemory.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmemory.h                                                             */\n/*                                                                         */\n/*    The FreeType memory management macros (specification).               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2007, 2010, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMEMORY_H__\n#define __FTMEMORY_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_SET_ERROR                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used to set an implicit `error' variable to a given  */\n  /*    expression's value (usually a function call), and convert it to a  */\n  /*    boolean which is set whenever the value is != 0.                   */\n  /*                                                                       */\n#undef  FT_SET_ERROR\n#define FT_SET_ERROR( expression ) \\\n          ( ( error = (expression) ) != 0 )\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                           M E M O R Y                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*\n   *  C++ refuses to handle statements like p = (void*)anything, with `p' a\n   *  typed pointer.  Since we don't have a `typeof' operator in standard\n   *  C++, we have to use a template to emulate it.\n   */\n\n#ifdef __cplusplus\n\n  extern \"C++\"\n  template <typename T> inline T*\n  cplusplus_typeof(        T*,\n                    void  *v )\n  {\n    return static_cast <T*> ( v );\n  }\n\n#define FT_ASSIGNP( p, val )  (p) = cplusplus_typeof( (p), (val) )\n\n#else\n\n#define FT_ASSIGNP( p, val )  (p) = (val)\n\n#endif\n\n\n\n#ifdef FT_DEBUG_MEMORY\n\n  FT_BASE( const char* )  _ft_debug_file;\n  FT_BASE( long )         _ft_debug_lineno;\n\n#define FT_DEBUG_INNER( exp )  ( _ft_debug_file   = __FILE__, \\\n                                 _ft_debug_lineno = __LINE__, \\\n                                 (exp) )\n\n#define FT_ASSIGNP_INNER( p, exp )  ( _ft_debug_file   = __FILE__, \\\n                                      _ft_debug_lineno = __LINE__, \\\n                                      FT_ASSIGNP( p, exp ) )\n\n#else /* !FT_DEBUG_MEMORY */\n\n#define FT_DEBUG_INNER( exp )       (exp)\n#define FT_ASSIGNP_INNER( p, exp )  FT_ASSIGNP( p, exp )\n\n#endif /* !FT_DEBUG_MEMORY */\n\n\n  /*\n   *  The allocation functions return a pointer, and the error code\n   *  is written to through the `p_error' parameter.  See below for\n   *  for documentation.\n   */\n\n  FT_BASE( FT_Pointer )\n  ft_mem_alloc( FT_Memory  memory,\n                FT_Long    size,\n                FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qalloc( FT_Memory  memory,\n                 FT_Long    size,\n                 FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_realloc( FT_Memory  memory,\n                  FT_Long    item_size,\n                  FT_Long    cur_count,\n                  FT_Long    new_count,\n                  void*      block,\n                  FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qrealloc( FT_Memory  memory,\n                   FT_Long    item_size,\n                   FT_Long    cur_count,\n                   FT_Long    new_count,\n                   void*      block,\n                   FT_Error  *p_error );\n\n  FT_BASE( void )\n  ft_mem_free( FT_Memory    memory,\n               const void*  P );\n\n\n#define FT_MEM_ALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory,          \\\n                                               (FT_Long)(size), \\\n                                               &error ) )\n\n#define FT_MEM_FREE( ptr )                \\\n          FT_BEGIN_STMNT                  \\\n            ft_mem_free( memory, (ptr) ); \\\n            (ptr) = NULL;                 \\\n          FT_END_STMNT\n\n#define FT_MEM_NEW( ptr )                        \\\n          FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_REALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,           \\\n                                                 1,                \\\n                                                 (FT_Long)(cursz), \\\n                                                 (FT_Long)(newsz), \\\n                                                 (ptr),            \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory,          \\\n                                                (FT_Long)(size), \\\n                                                &error ) )\n\n#define FT_MEM_QNEW( ptr )                        \\\n          FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_QREALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,           \\\n                                                  1,                \\\n                                                  (FT_Long)(cursz), \\\n                                                  (FT_Long)(newsz), \\\n                                                  (ptr),            \\\n                                                  &error ) )\n\n#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,               \\\n                                                 (FT_Long)(item_size), \\\n                                                 0,                    \\\n                                                 (FT_Long)(count),     \\\n                                                 NULL,                 \\\n                                                 &error ) )\n\n#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )           \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 (FT_Long)(itmsz),  \\\n                                                 (FT_Long)(oldcnt), \\\n                                                 (FT_Long)(newcnt), \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,               \\\n                                                  (FT_Long)(item_size), \\\n                                                  0,                    \\\n                                                  (FT_Long)(count),     \\\n                                                  NULL,                 \\\n                                                  &error ) )\n\n#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)            \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  (FT_Long)(itmsz),  \\\n                                                  (FT_Long)(oldcnt), \\\n                                                  (FT_Long)(newcnt), \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n\n#define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )\n\n\n#define FT_MEM_SET( dest, byte, count )     ft_memset( dest, byte, count )\n\n#define FT_MEM_COPY( dest, source, count )  ft_memcpy( dest, source, count )\n\n#define FT_MEM_MOVE( dest, source, count )  ft_memmove( dest, source, count )\n\n\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\n\n#define FT_ZERO( p )                FT_MEM_ZERO( p, sizeof ( *(p) ) )\n\n\n#define FT_ARRAY_ZERO( dest, count )                        \\\n          FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_COPY( dest, source, count )                        \\\n          FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_MOVE( dest, source, count )                        \\\n          FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )\n\n\n  /*\n   *  Return the maximum number of addressable elements in an array.\n   *  We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid\n   *  any problems.\n   */\n#define FT_ARRAY_MAX( ptr )           ( FT_INT_MAX / sizeof ( *(ptr) ) )\n\n#define FT_ARRAY_CHECK( ptr, count )  ( (count) <= FT_ARRAY_MAX( ptr ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following functions macros expect that their pointer argument is  */\n  /* _typed_ in order to automatically compute array element sizes.        */\n  /*                                                                       */\n\n#define FT_MEM_NEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 0,                 \\\n                                                 (FT_Long)(count),  \\\n                                                 NULL,              \\\n                                                 &error ) )\n\n#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 (FT_Long)(cursz),  \\\n                                                 (FT_Long)(newsz),  \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QNEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  0,                 \\\n                                                  (FT_Long)(count),  \\\n                                                  NULL,              \\\n                                                  &error ) )\n\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  (FT_Long)(cursz),  \\\n                                                  (FT_Long)(newsz),  \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n#define FT_ALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )\n\n#define FT_REALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )\n\n#define FT_ALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt,      \\\n                                                 newcnt, itmsz ) )\n\n#define FT_QALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )\n\n#define FT_QREALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )\n\n#define FT_QALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt,      \\\n                                                  newcnt, itmsz ) )\n\n#define FT_FREE( ptr )  FT_MEM_FREE( ptr )\n\n#define FT_NEW( ptr )  FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )\n\n#define FT_NEW_ARRAY( ptr, count )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_RENEW_ARRAY( ptr, curcnt, newcnt )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n#define FT_QNEW( ptr )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )\n\n#define FT_QNEW_ARRAY( ptr, count )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n\n  FT_BASE( FT_Pointer )\n  ft_mem_strdup( FT_Memory    memory,\n                 const char*  str,\n                 FT_Error    *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_dup( FT_Memory    memory,\n              const void*  address,\n              FT_ULong     size,\n              FT_Error    *p_error );\n\n\n#define FT_MEM_STRDUP( dst, str )                                            \\\n          (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )\n\n#define FT_STRDUP( dst, str )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )\n\n#define FT_MEM_DUP( dst, address, size )                                    \\\n          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )\n\n#define FT_DUP( dst, address, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )\n\n\n  /* Return >= 1 if a truncation occurs.            */\n  /* Return 0 if the source string fits the buffer. */\n  /* This is *not* the same as strlcpy().           */\n  FT_BASE( FT_Int )\n  ft_mem_strcpyn( char*        dst,\n                  const char*  src,\n                  FT_ULong     size );\n\n#define FT_STRCPYN( dst, src, size )                                         \\\n          ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMEMORY_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftobjs.h                                                               */\n/*                                                                         */\n/*    The FreeType private base classes (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2010, 2012-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file contains the definition of all internal FreeType classes.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTOBJS_H__\n#define __FTOBJS_H__\n\n#include <ft2build.h>\n#include FT_RENDER_H\n#include FT_SIZES_H\n#include FT_LCD_FILTER_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_GLYPH_LOADER_H\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_AUTOHINT_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_PIC_H\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n#include FT_INCREMENTAL_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some generic definitions.                                             */\n  /*                                                                       */\n#ifndef TRUE\n#define TRUE  1\n#endif\n\n#ifndef FALSE\n#define FALSE  0\n#endif\n\n#ifndef NULL\n#define NULL  (void*)0\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The min and max functions missing in C.  As usual, be careful not to  */\n  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */\n  /*                                                                       */\n#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )\n#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )\n\n#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )\n\n\n#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )\n#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )\n#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )\n\n#define FT_PIX_FLOOR( x )     ( (x) & ~63 )\n#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )\n#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )\n\n\n  /*\n   *  Return the highest power of 2 that is <= value; this correspond to\n   *  the highest bit in a given 32-bit value.\n   */\n  FT_BASE( FT_UInt32 )\n  ft_highpow2( FT_UInt32  value );\n\n\n  /*\n   *  character classification functions -- since these are used to parse\n   *  font files, we must not use those in <ctypes.h> which are\n   *  locale-dependent\n   */\n#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )\n\n#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \\\n                             ( (unsigned)(x) - 'a' ) < 6U  || \\\n                             ( (unsigned)(x) - 'A' ) < 6U  )\n\n  /* the next two macros assume ASCII representation */\n#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )\n#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )\n\n#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )\n#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       C H A R M A P S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to internal charmap object */\n  typedef struct FT_CMapRec_*              FT_CMap;\n\n  /* handle to charmap class structure */\n  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;\n\n  /* internal charmap object structure */\n  typedef struct  FT_CMapRec_\n  {\n    FT_CharMapRec  charmap;\n    FT_CMap_Class  clazz;\n\n  } FT_CMapRec;\n\n  /* typecase any pointer to a charmap handle */\n#define FT_CMAP( x )              ((FT_CMap)( x ))\n\n  /* obvious macros */\n#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id\n#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id\n#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding\n#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face\n\n\n  /* class method definitions */\n  typedef FT_Error\n  (*FT_CMap_InitFunc)( FT_CMap     cmap,\n                       FT_Pointer  init_data );\n\n  typedef void\n  (*FT_CMap_DoneFunc)( FT_CMap  cmap );\n\n  typedef FT_UInt\n  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,\n                            FT_UInt32  char_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,\n                           FT_UInt32  *achar_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharVarIndexFunc)( FT_CMap    cmap,\n                               FT_CMap    unicode_cmap,\n                               FT_UInt32  char_code,\n                               FT_UInt32  variant_selector );\n\n  typedef FT_Bool\n  (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap    cmap,\n                                   FT_UInt32  char_code,\n                                   FT_UInt32  variant_selector );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantListFunc)( FT_CMap    cmap,\n                              FT_Memory  mem );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_CharVariantListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  char_code );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantCharListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  variant_selector );\n\n\n  typedef struct  FT_CMap_ClassRec_\n  {\n    FT_ULong               size;\n    FT_CMap_InitFunc       init;\n    FT_CMap_DoneFunc       done;\n    FT_CMap_CharIndexFunc  char_index;\n    FT_CMap_CharNextFunc   char_next;\n\n    /* Subsequent entries are special ones for format 14 -- the variant */\n    /* selector subtable which behaves like no other                    */\n\n    FT_CMap_CharVarIndexFunc      char_var_index;\n    FT_CMap_CharVarIsDefaultFunc  char_var_default;\n    FT_CMap_VariantListFunc       variant_list;\n    FT_CMap_CharVariantListFunc   charvariant_list;\n    FT_CMap_VariantCharListFunc   variantchar_list;\n\n  } FT_CMap_ClassRec;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_CMAP_CLASS( class_ )              \\\n  FT_CALLBACK_TABLE const  FT_CMap_ClassRec class_;\n\n#define FT_DEFINE_CMAP_CLASS(       \\\n          class_,                   \\\n          size_,                    \\\n          init_,                    \\\n          done_,                    \\\n          char_index_,              \\\n          char_next_,               \\\n          char_var_index_,          \\\n          char_var_default_,        \\\n          variant_list_,            \\\n          charvariant_list_,        \\\n          variantchar_list_ )       \\\n  FT_CALLBACK_TABLE_DEF             \\\n  const FT_CMap_ClassRec  class_ =  \\\n  {                                 \\\n    size_,                          \\\n    init_,                          \\\n    done_,                          \\\n    char_index_,                    \\\n    char_next_,                     \\\n    char_var_index_,                \\\n    char_var_default_,              \\\n    variant_list_,                  \\\n    charvariant_list_,              \\\n    variantchar_list_               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_CMAP_CLASS( class_ )                  \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz );\n\n#define FT_DEFINE_CMAP_CLASS(                            \\\n          class_,                                        \\\n          size_,                                         \\\n          init_,                                         \\\n          done_,                                         \\\n          char_index_,                                   \\\n          char_next_,                                    \\\n          char_var_index_,                               \\\n          char_var_default_,                             \\\n          variant_list_,                                 \\\n          charvariant_list_,                             \\\n          variantchar_list_ )                            \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz )   \\\n  {                                                      \\\n    FT_UNUSED( library );                                \\\n                                                         \\\n    clazz->size             = size_;                     \\\n    clazz->init             = init_;                     \\\n    clazz->done             = done_;                     \\\n    clazz->char_index       = char_index_;               \\\n    clazz->char_next        = char_next_;                \\\n    clazz->char_var_index   = char_var_index_;           \\\n    clazz->char_var_default = char_var_default_;         \\\n    clazz->variant_list     = variant_list_;             \\\n    clazz->charvariant_list = charvariant_list_;         \\\n    clazz->variantchar_list = variantchar_list_;         \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* create a new charmap and add it to charmap->face */\n  FT_BASE( FT_Error )\n  FT_CMap_New( FT_CMap_Class  clazz,\n               FT_Pointer     init_data,\n               FT_CharMap     charmap,\n               FT_CMap       *acmap );\n\n  /* destroy a charmap and remove it from face's list */\n  FT_BASE( void )\n  FT_CMap_Done( FT_CMap  cmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Face_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Face        */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    max_points ::                                                      */\n  /*      The maximum number of points used to store the vectorial outline */\n  /*      of any glyph in this face.  If this value cannot be known in     */\n  /*      advance, or if the face isn't scalable, this should be set to 0. */\n  /*      Only relevant for scalable formats.                              */\n  /*                                                                       */\n  /*    max_contours ::                                                    */\n  /*      The maximum number of contours used to store the vectorial       */\n  /*      outline of any glyph in this face.  If this value cannot be      */\n  /*      known in advance, or if the face isn't scalable, this should be  */\n  /*      set to 0.  Only relevant for scalable formats.                   */\n  /*                                                                       */\n  /*    transform_matrix ::                                                */\n  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */\n  /*      outlines after they are loaded from the font.  Only used by the  */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    transform_delta ::                                                 */\n  /*      A translation vector used to transform glyph outlines after they */\n  /*      are loaded from the font.  Only used by the convenience          */\n  /*      functions.                                                       */\n  /*                                                                       */\n  /*    transform_flags ::                                                 */\n  /*      Some flags used to classify the transform.  Only used by the     */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    services ::                                                        */\n  /*      A cache for frequently used services.  It should be only         */\n  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */\n  /*                                                                       */\n  /*    incremental_interface ::                                           */\n  /*      If non-null, the interface through which glyph data and metrics  */\n  /*      are loaded incrementally for faces that do not provide all of    */\n  /*      this data when first opened.  This field exists only if          */\n  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */\n  /*                                                                       */\n  /*    ignore_unpatented_hinter ::                                        */\n  /*      This boolean flag instructs the glyph loader to ignore the       */\n  /*      native font hinter, if one is found.  This is exclusively used   */\n  /*      in the case when the unpatented hinter is compiled within the    */\n  /*      library.                                                         */\n  /*                                                                       */\n  /*    refcount ::                                                        */\n  /*      A counter initialized to~1 at the time an @FT_Face structure is  */\n  /*      created.  @FT_Reference_Face increments this counter, and        */\n  /*      @FT_Done_Face only destroys a face if the counter is~1,          */\n  /*      otherwise it simply decrements it.                               */\n  /*                                                                       */\n  typedef struct  FT_Face_InternalRec_\n  {\n    FT_Matrix           transform_matrix;\n    FT_Vector           transform_delta;\n    FT_Int              transform_flags;\n\n    FT_ServiceCacheRec  services;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Incremental_InterfaceRec*  incremental_interface;\n#endif\n\n    FT_Bool             ignore_unpatented_hinter;\n    FT_Int              refcount;\n\n  } FT_Face_InternalRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Slot_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_GlyphSlot   */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loader            :: The glyph loader object used to load outlines */\n  /*                         into the glyph slot.                          */\n  /*                                                                       */\n  /*    flags             :: Possible values are zero or                   */\n  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */\n  /*                         that the FT_GlyphSlot structure owns the      */\n  /*                         bitmap buffer.                                */\n  /*                                                                       */\n  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */\n  /*                         must be transformed through a specific        */\n  /*                         font transformation.  This is _not_ the same  */\n  /*                         as the face transform set through             */\n  /*                         FT_Set_Transform().                           */\n  /*                                                                       */\n  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */\n  /*                         transformation, if necessary.                 */\n  /*                                                                       */\n  /*    glyph_delta       :: The 2d translation vector corresponding to    */\n  /*                         the glyph transformation, if necessary.       */\n  /*                                                                       */\n  /*    glyph_hints       :: Format-specific glyph hints management.       */\n  /*                                                                       */\n\n#define FT_GLYPH_OWN_BITMAP  0x1\n\n  typedef struct  FT_Slot_InternalRec_\n  {\n    FT_GlyphLoader  loader;\n    FT_UInt         flags;\n    FT_Bool         glyph_transformed;\n    FT_Matrix       glyph_matrix;\n    FT_Vector       glyph_delta;\n    void*           glyph_hints;\n\n  } FT_GlyphSlot_InternalRec;\n\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Size        */\n  /*    object.  Currently, it's empty.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  typedef struct  FT_Size_InternalRec_\n  {\n    /* empty */\n\n  } FT_Size_InternalRec;\n\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                         M O D U L E S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ModuleRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A module object instance.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    clazz   :: A pointer to the module's class.                        */\n  /*                                                                       */\n  /*    library :: A handle to the parent library object.                  */\n  /*                                                                       */\n  /*    memory  :: A handle to the memory manager.                         */\n  /*                                                                       */\n  typedef struct  FT_ModuleRec_\n  {\n    FT_Module_Class*  clazz;\n    FT_Library        library;\n    FT_Memory         memory;\n\n  } FT_ModuleRec;\n\n\n  /* typecast an object to an FT_Module */\n#define FT_MODULE( x )          ((FT_Module)( x ))\n#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz\n#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library\n#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory\n\n\n#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_FONT_DRIVER )\n\n#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_RENDERER )\n\n#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_HINTER )\n\n#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_STYLER )\n\n#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_DRIVER_SCALABLE )\n\n#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \\\n                                         FT_MODULE_DRIVER_NO_OUTLINES )\n\n#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                     FT_MODULE_DRIVER_HAS_HINTER )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module_Interface                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finds a module and returns its specific interface as a typeless    */\n  /*    pointer.                                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module-specific interface if available, 0 otherwise.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should better be familiar with FreeType internals to know      */\n  /*    which module to look for, and what its interface is :-)            */\n  /*                                                                       */\n  FT_BASE( const void* )\n  FT_Get_Module_Interface( FT_Library   library,\n                           const char*  mod_name );\n\n  FT_BASE( FT_Pointer )\n  ft_module_get_service( FT_Module    module,\n                         const char*  service_id );\n\n  /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****   F A C E,   S I Z E   &   G L Y P H   S L O T   O B J E C T S  ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* a few macros used to perform easy typecasts with minimal brain damage */\n\n#define FT_FACE( x )          ((FT_Face)(x))\n#define FT_SIZE( x )          ((FT_Size)(x))\n#define FT_SLOT( x )          ((FT_GlyphSlot)(x))\n\n#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver\n#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library\n#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory\n#define FT_FACE_STREAM( x )   FT_FACE( x )->stream\n\n#define FT_SIZE_FACE( x )     FT_SIZE( x )->face\n#define FT_SLOT_FACE( x )     FT_SLOT( x )->face\n\n#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph\n#define FT_FACE_SIZE( x )     FT_FACE( x )->size\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_GlyphSlot                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    It is sometimes useful to have more than one glyph slot for a      */\n  /*    given face object.  This function is used to create additional     */\n  /*    slots.  All of them are automatically discarded when the face is   */\n  /*    destroyed.                                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to a parent face object.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aslot :: A handle to a new glyph slot object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_New_GlyphSlot( FT_Face        face,\n                    FT_GlyphSlot  *aslot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_GlyphSlot                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given glyph slot.  Remember however that all slots are  */\n  /*    automatically destroyed with its parent.  Using this function is   */\n  /*    not always mandatory.                                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: A handle to a target glyph slot.                           */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_GlyphSlot( FT_GlyphSlot  slot );\n\n /* */\n\n#define FT_REQUEST_WIDTH( req )                                            \\\n          ( (req)->horiResolution                                          \\\n              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \\\n              : (req)->width )\n\n#define FT_REQUEST_HEIGHT( req )                                            \\\n          ( (req)->vertResolution                                           \\\n              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \\\n              : (req)->height )\n\n\n  /* Set the metrics according to a bitmap strike. */\n  FT_BASE( void )\n  FT_Select_Metrics( FT_Face   face,\n                     FT_ULong  strike_index );\n\n\n  /* Set the metrics according to a size request. */\n  FT_BASE( void )\n  FT_Request_Metrics( FT_Face          face,\n                      FT_Size_Request  req );\n\n\n  /* Match a size request against `available_sizes'. */\n  FT_BASE( FT_Error )\n  FT_Match_Size( FT_Face          face,\n                 FT_Size_Request  req,\n                 FT_Bool          ignore_width,\n                 FT_ULong*        size_index );\n\n\n  /* Use the horizontal metrics to synthesize the vertical metrics. */\n  /* If `advance' is zero, it is also synthesized.                  */\n  FT_BASE( void )\n  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,\n                                  FT_Pos             advance );\n\n\n  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */\n  /* was allocated with ft_glyphslot_alloc_bitmap).                       */\n  FT_BASE( void )\n  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );\n\n\n  /* Allocate a new bitmap buffer in a glyph slot. */\n  FT_BASE( FT_Error )\n  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,\n                             FT_ULong      size );\n\n\n  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */\n  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */\n  FT_BASE( void )\n  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,\n                           FT_Byte*      buffer );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                        R E N D E R E R S                        ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#define FT_RENDERER( x )      ((FT_Renderer)( x ))\n#define FT_GLYPH( x )         ((FT_Glyph)( x ))\n#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))\n#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))\n\n\n  typedef struct  FT_RendererRec_\n  {\n    FT_ModuleRec            root;\n    FT_Renderer_Class*      clazz;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_Class          glyph_class;\n\n    FT_Raster               raster;\n    FT_Raster_Render_Func   raster_render;\n    FT_Renderer_RenderFunc  render;\n\n  } FT_RendererRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    F O N T   D R I V E R S                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* typecast a module into a driver easily */\n#define FT_DRIVER( x )        ((FT_Driver)(x))\n\n  /* typecast a module as a driver, and get its driver class */\n#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_DriverRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root font driver class.  A font driver is responsible for      */\n  /*    managing and loading font files of a given format.                 */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     root         :: Contains the fields of the root module class.     */\n  /*                                                                       */\n  /*     clazz        :: A pointer to the font driver's class.  Note that  */\n  /*                     this is NOT root.clazz.  `class' wasn't used      */\n  /*                     as it is a reserved word in C++.                  */\n  /*                                                                       */\n  /*     faces_list   :: The list of faces currently opened by this        */\n  /*                     driver.                                           */\n  /*                                                                       */\n  /*     glyph_loader :: The glyph loader for all faces managed by this    */\n  /*                     driver.  This object isn't defined for unscalable */\n  /*                     formats.                                          */\n  /*                                                                       */\n  typedef struct  FT_DriverRec_\n  {\n    FT_ModuleRec     root;\n    FT_Driver_Class  clazz;\n    FT_ListRec       faces_list;\n    FT_GlyphLoader   glyph_loader;\n\n  } FT_DriverRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       L I B R A R I E S                         ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* This hook is used by the TrueType debugger.  It must be set to an */\n  /* alternate truetype bytecode interpreter function.                 */\n#define FT_DEBUG_HOOK_TRUETYPE            0\n\n\n  /* Set this debug hook to a non-null pointer to force unpatented hinting */\n  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */\n  /* during debugging.                                                     */\n#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1\n\n\n  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,\n                                            FT_Render_Mode  render_mode,\n                                            FT_Library      library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_LibraryRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType library class.  This is the root of all FreeType      */\n  /*    data.  Use FT_New_Library() to create a library object, and        */\n  /*    FT_Done_Library() to discard it and all child objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory           :: The library's memory object.  Manages memory   */\n  /*                        allocation.                                    */\n  /*                                                                       */\n  /*    version_major    :: The major version number of the library.       */\n  /*                                                                       */\n  /*    version_minor    :: The minor version number of the library.       */\n  /*                                                                       */\n  /*    version_patch    :: The current patch level of the library.        */\n  /*                                                                       */\n  /*    num_modules      :: The number of modules currently registered     */\n  /*                        within this library.  This is set to 0 for new */\n  /*                        libraries.  New modules are added through the  */\n  /*                        FT_Add_Module() API function.                  */\n  /*                                                                       */\n  /*    modules          :: A table used to store handles to the currently */\n  /*                        registered modules. Note that each font driver */\n  /*                        contains a list of its opened faces.           */\n  /*                                                                       */\n  /*    renderers        :: The list of renderers currently registered     */\n  /*                        within the library.                            */\n  /*                                                                       */\n  /*    cur_renderer     :: The current outline renderer.  This is a       */\n  /*                        shortcut used to avoid parsing the list on     */\n  /*                        each call to FT_Outline_Render().  It is a     */\n  /*                        handle to the current renderer for the         */\n  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */\n  /*                                                                       */\n  /*    auto_hinter      :: XXX                                            */\n  /*                                                                       */\n  /*    raster_pool      :: The raster object's render pool.  This can     */\n  /*                        ideally be changed dynamically at run-time.    */\n  /*                                                                       */\n  /*    raster_pool_size :: The size of the render pool in bytes.          */\n  /*                                                                       */\n  /*    debug_hooks      :: XXX                                            */\n  /*                                                                       */\n  /*    lcd_filter       :: If subpixel rendering is activated, the        */\n  /*                        selected LCD filter mode.                      */\n  /*                                                                       */\n  /*    lcd_extra        :: If subpixel rendering is activated, the number */\n  /*                        of extra pixels needed for the LCD filter.     */\n  /*                                                                       */\n  /*    lcd_weights      :: If subpixel rendering is activated, the LCD    */\n  /*                        filter weights, if any.                        */\n  /*                                                                       */\n  /*    lcd_filter_func  :: If subpixel rendering is activated, the LCD    */\n  /*                        filtering callback function.                   */\n  /*                                                                       */\n  /*    pic_container    :: Contains global structs and tables, instead    */\n  /*                        of defining them globallly.                    */\n  /*                                                                       */\n  /*    refcount         :: A counter initialized to~1 at the time an      */\n  /*                        @FT_Library structure is created.              */\n  /*                        @FT_Reference_Library increments this counter, */\n  /*                        and @FT_Done_Library only destroys a library   */\n  /*                        if the counter is~1, otherwise it simply       */\n  /*                        decrements it.                                 */\n  /*                                                                       */\n  typedef struct  FT_LibraryRec_\n  {\n    FT_Memory          memory;           /* library's memory manager */\n\n    FT_Int             version_major;\n    FT_Int             version_minor;\n    FT_Int             version_patch;\n\n    FT_UInt            num_modules;\n    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */\n\n    FT_ListRec         renderers;        /* list of renderers        */\n    FT_Renderer        cur_renderer;     /* current outline renderer */\n    FT_Module          auto_hinter;\n\n    FT_Byte*           raster_pool;      /* scan-line conversion */\n                                         /* render pool          */\n    FT_ULong           raster_pool_size; /* size of render pool in bytes */\n\n    FT_DebugHook_Func  debug_hooks[4];\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n    FT_LcdFilter             lcd_filter;\n    FT_Int                   lcd_extra;        /* number of extra pixels */\n    FT_Byte                  lcd_weights[7];   /* filter weights, if any */\n    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */\n#endif\n\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_PIC_Container   pic_container;\n#endif\n\n    FT_Int             refcount;\n\n  } FT_LibraryRec;\n\n\n  FT_BASE( FT_Renderer )\n  FT_Lookup_Renderer( FT_Library       library,\n                      FT_Glyph_Format  format,\n                      FT_ListNode*     node );\n\n  FT_BASE( FT_Error )\n  FT_Render_Glyph_Internal( FT_Library      library,\n                            FT_GlyphSlot    slot,\n                            FT_Render_Mode  render_mode );\n\n  typedef const char*\n  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,\n                                    FT_String*  glyph_name );\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new memory object.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the new memory object.  0 in case of error.           */\n  /*                                                                       */\n  FT_BASE( FT_Memory )\n  FT_New_Memory( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Memory                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discards memory manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_Memory( FT_Memory  memory );\n\n#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* Define default raster's interface.  The default raster is located in  */\n  /* `src/base/ftraster.c'.                                                */\n  /*                                                                       */\n  /* Client applications can register new rasters through the              */\n  /* FT_Set_Raster() API.                                                  */\n\n#ifndef FT_NO_DEFAULT_RASTER\n  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                      P I C   S U P P O R T                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* PIC support macros for ftimage.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_OUTLINE_FUNCS                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Outline_Funcs struct.         */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_OUTLINE_FUNCS(           \\\n          class_,                          \\\n          move_to_,                        \\\n          line_to_,                        \\\n          conic_to_,                       \\\n          cubic_to_,                       \\\n          shift_,                          \\\n          delta_ )                         \\\n  static const  FT_Outline_Funcs class_ =  \\\n  {                                        \\\n    move_to_,                              \\\n    line_to_,                              \\\n    conic_to_,                             \\\n    cubic_to_,                             \\\n    shift_,                                \\\n    delta_                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_OUTLINE_FUNCS(                     \\\n          class_,                                    \\\n          move_to_,                                  \\\n          line_to_,                                  \\\n          conic_to_,                                 \\\n          cubic_to_,                                 \\\n          shift_,                                    \\\n          delta_ )                                   \\\n  static FT_Error                                    \\\n  Init_Class_ ## class_( FT_Outline_Funcs*  clazz )  \\\n  {                                                  \\\n    clazz->move_to  = move_to_;                      \\\n    clazz->line_to  = line_to_;                      \\\n    clazz->conic_to = conic_to_;                     \\\n    clazz->cubic_to = cubic_to_;                     \\\n    clazz->shift    = shift_;                        \\\n    clazz->delta    = delta_;                        \\\n                                                     \\\n    return FT_Err_Ok;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RASTER_FUNCS                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Raster_Funcs struct.          */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_RASTER_FUNCS(    \\\n          class_,                  \\\n          glyph_format_,           \\\n          raster_new_,             \\\n          raster_reset_,           \\\n          raster_set_mode_,        \\\n          raster_render_,          \\\n          raster_done_ )           \\\n  const FT_Raster_Funcs  class_ =  \\\n  {                                \\\n    glyph_format_,                 \\\n    raster_new_,                   \\\n    raster_reset_,                 \\\n    raster_set_mode_,              \\\n    raster_render_,                \\\n    raster_done_                   \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_RASTER_FUNCS(                        \\\n          class_,                                      \\\n          glyph_format_,                               \\\n          raster_new_,                                 \\\n          raster_reset_,                               \\\n          raster_set_mode_,                            \\\n          raster_render_,                              \\\n          raster_done_ )                               \\\n  void                                                 \\\n  FT_Init_Class_ ## class_( FT_Raster_Funcs*  clazz )  \\\n  {                                                    \\\n    clazz->glyph_format    = glyph_format_;            \\\n    clazz->raster_new      = raster_new_;              \\\n    clazz->raster_reset    = raster_reset_;            \\\n    clazz->raster_set_mode = raster_set_mode_;         \\\n    clazz->raster_render   = raster_render_;           \\\n    clazz->raster_done     = raster_done_;             \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftrender.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_GLYPH                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Glyph_Class struct.           */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated stcture to be filled.               */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_GLYPH(          \\\n          class_,                 \\\n          size_,                  \\\n          format_,                \\\n          init_,                  \\\n          done_,                  \\\n          copy_,                  \\\n          transform_,             \\\n          bbox_,                  \\\n          prepare_ )              \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Glyph_Class  class_ =  \\\n  {                               \\\n    size_,                        \\\n    format_,                      \\\n    init_,                        \\\n    done_,                        \\\n    copy_,                        \\\n    transform_,                   \\\n    bbox_,                        \\\n    prepare_                      \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_GLYPH(                              \\\n          class_,                                     \\\n          size_,                                      \\\n          format_,                                    \\\n          init_,                                      \\\n          done_,                                      \\\n          copy_,                                      \\\n          transform_,                                 \\\n          bbox_,                                      \\\n          prepare_ )                                  \\\n  void                                                \\\n  FT_Init_Class_ ## class_( FT_Glyph_Class*  clazz )  \\\n  {                                                   \\\n    clazz->glyph_size      = size_;                   \\\n    clazz->glyph_format    = format_;                 \\\n    clazz->glyph_init      = init_;                   \\\n    clazz->glyph_done      = done_;                   \\\n    clazz->glyph_copy      = copy_;                   \\\n    clazz->glyph_transform = transform_;              \\\n    clazz->glyph_bbox      = bbox_;                   \\\n    clazz->glyph_prepare   = prepare_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_RENDERER                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Renderer_Class struct instance.                                 */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RENDERER                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Renderer_Class struct.        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need  */\n  /*    to be called with a pointer where the allocated structure is       */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the renderer definition calling `FT_DEFINE_RENDERER' in the     */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_RENDERER( class_ )               \\\n  FT_EXPORT_VAR( const FT_Renderer_Class ) class_;\n\n#define FT_DEFINE_RENDERER(                  \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          glyph_format_,                     \\\n          render_glyph_,                     \\\n          transform_glyph_,                  \\\n          get_glyph_cbox_,                   \\\n          set_mode_,                         \\\n          raster_class_ )                    \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Renderer_Class  class_ =          \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n    glyph_format_,                           \\\n                                             \\\n    render_glyph_,                           \\\n    transform_glyph_,                        \\\n    get_glyph_cbox_,                         \\\n    set_mode_,                               \\\n                                             \\\n    raster_class_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_RENDERER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_RENDERER(                                      \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          glyph_format_,                                         \\\n          render_glyph_,                                         \\\n          transform_glyph_,                                      \\\n          get_glyph_cbox_,                                       \\\n          set_mode_,                                             \\\n          raster_class_ )                                        \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Renderer_Class*  rclazz = (FT_Renderer_Class*)clazz;      \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( rclazz )                                                \\\n      FT_FREE( rclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Renderer_Class*  clazz = NULL;                            \\\n    FT_Error            error;                                   \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->glyph_format    = glyph_format_;                      \\\n                                                                 \\\n    clazz->render_glyph    = render_glyph_;                      \\\n    clazz->transform_glyph = transform_glyph_;                   \\\n    clazz->get_glyph_cbox  = get_glyph_cbox_;                    \\\n    clazz->set_mode        = set_mode_;                          \\\n                                                                 \\\n    clazz->raster_class    = raster_class_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftmodapi.h **/\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Creator                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create (allocate) a new module class object.    */\n  /*    The object's members are initialized, but the module itself is     */\n  /*    not.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory       :: A handle to the memory manager.                    */\n  /*    output_class :: Initialized with the newly allocated class.        */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Creator)( FT_Memory          memory,\n                        FT_Module_Class**  output_class );\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destroyer                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy (deallocate) a module class object.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*    clazz  :: Module class to destroy.                                 */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destroyer)( FT_Memory         memory,\n                          FT_Module_Class*  clazz );\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_MODULE                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Module_Class struct instance.                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_MODULE                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to   */\n  /*    be called with a pointer where the allocated structure is          */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the module definition calling `FT_DEFINE_MODULE' in the         */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_ROOT_MODULE                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct inside */\n  /*    another struct that contains it or in a function that initializes  */\n  /*    that containing struct.                                            */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_MODULE( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Module_Class  class_;\n\n#define FT_DEFINE_ROOT_MODULE(  \\\n          flags_,               \\\n          size_,                \\\n          name_,                \\\n          version_,             \\\n          requires_,            \\\n          interface_,           \\\n          init_,                \\\n          done_,                \\\n          get_interface_ )      \\\n  {                             \\\n    flags_,                     \\\n    size_,                      \\\n                                \\\n    name_,                      \\\n    version_,                   \\\n    requires_,                  \\\n                                \\\n    interface_,                 \\\n                                \\\n    init_,                      \\\n    done_,                      \\\n    get_interface_,             \\\n  },\n\n#define FT_DEFINE_MODULE(         \\\n          class_,                 \\\n          flags_,                 \\\n          size_,                  \\\n          name_,                  \\\n          version_,               \\\n          requires_,              \\\n          interface_,             \\\n          init_,                  \\\n          done_,                  \\\n          get_interface_ )        \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Module_Class class_ =  \\\n  {                               \\\n    flags_,                       \\\n    size_,                        \\\n                                  \\\n    name_,                        \\\n    version_,                     \\\n    requires_,                    \\\n                                  \\\n    interface_,                   \\\n                                  \\\n    init_,                        \\\n    done_,                        \\\n    get_interface_,               \\\n  };\n\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_MODULE( class_ )                               \\\n  FT_Error                                                        \\\n  FT_Create_Class_ ## class_( FT_Library         library,         \\\n                              FT_Module_Class**  output_class );  \\\n  void                                                            \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,         \\\n                               FT_Module_Class*  clazz );\n\n#define FT_DEFINE_ROOT_MODULE(                      \\\n          flags_,                                   \\\n          size_,                                    \\\n          name_,                                    \\\n          version_,                                 \\\n          requires_,                                \\\n          interface_,                               \\\n          init_,                                    \\\n          done_,                                    \\\n          get_interface_ )                          \\\n    clazz->root.module_flags     = flags_;          \\\n    clazz->root.module_size      = size_;           \\\n    clazz->root.module_name      = name_;           \\\n    clazz->root.module_version   = version_;        \\\n    clazz->root.module_requires  = requires_;       \\\n                                                    \\\n    clazz->root.module_interface = interface_;      \\\n                                                    \\\n    clazz->root.module_init      = init_;           \\\n    clazz->root.module_done      = done_;           \\\n    clazz->root.get_interface    = get_interface_;\n\n#define FT_DEFINE_MODULE(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_ )                                       \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory memory = library->memory;                          \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( clazz )                                                 \\\n      FT_FREE( clazz );                                          \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Memory         memory = library->memory;                  \\\n    FT_Module_Class*  clazz  = NULL;                             \\\n    FT_Error          error;                                     \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    clazz->module_flags     = flags_;                            \\\n    clazz->module_size      = size_;                             \\\n    clazz->module_name      = name_;                             \\\n    clazz->module_version   = version_;                          \\\n    clazz->module_requires  = requires_;                         \\\n                                                                 \\\n    clazz->module_interface = interface_;                        \\\n                                                                 \\\n    clazz->module_init      = init_;                             \\\n    clazz->module_done      = done_;                             \\\n    clazz->get_interface    = get_interface_;                    \\\n                                                                 \\\n    *output_class = clazz;                                       \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\nFT_END_HEADER\n\n#endif /* __FTOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services (declaration).       */\n/*                                                                         */\n/*  Copyright 2009, 2012 by                                                */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Modules that ordinarily have const global data that need address     */\n  /*  can instead define pointers here.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTPIC_H__\n#define __FTPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  typedef struct  FT_PIC_Container_\n  {\n    /* pic containers for base */\n    void*  base;\n\n    /* pic containers for modules */\n    void*  autofit;\n    void*  cff;\n    void*  pshinter;\n    void*  psnames;\n    void*  raster;\n    void*  sfnt;\n    void*  smooth;\n    void*  truetype;\n\n  } FT_PIC_Container;\n\n\n  /* Initialize the various function tables, structs, etc. */\n  /* stored in the container.                              */\n  FT_BASE( FT_Error )\n  ft_pic_container_init( FT_Library  library );\n\n\n  /* Destroy the contents of the container. */\n  FT_BASE( void )\n  ft_pic_container_destroy( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftrfork.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrfork.h                                                              */\n/*                                                                         */\n/*    Embedded resource forks accessor (specification).                    */\n/*                                                                         */\n/*  Copyright 2004, 2006, 2007, 2012 by                                    */\n/*  Masatake YAMATO and Redhat K.K.                                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/* Development of the code in this file is support of                      */\n/* Information-technology Promotion Agency, Japan.                         */\n/***************************************************************************/\n\n\n#ifndef __FTRFORK_H__\n#define __FTRFORK_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* Number of guessing rules supported in `FT_Raccess_Guess'.            */\n  /* Don't forget to increment the number if you add a new guessing rule. */\n#define FT_RACCESS_N_RULES  9\n\n\n  /* A structure to describe a reference in a resource by its resource ID */\n  /* and internal offset.  The `POST' resource expects to be concatenated */\n  /* by the order of resource IDs instead of its appearance in the file.  */\n\n  typedef struct  FT_RFork_Ref_\n  {\n    FT_UShort  res_id;\n    FT_ULong   offset;\n\n  } FT_RFork_Ref;\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n  typedef FT_Error\n  (*ft_raccess_guess_func)( FT_Library  library,\n                            FT_Stream   stream,\n                            char       *base_file_name,\n                            char      **result_file_name,\n                            FT_Long    *result_offset );\n\n  typedef enum  FT_RFork_Rule_ {\n    FT_RFork_Rule_invalid = -2,\n    FT_RFork_Rule_uknown, /* -1 */\n    FT_RFork_Rule_apple_double,\n    FT_RFork_Rule_apple_single,\n    FT_RFork_Rule_darwin_ufs_export,\n    FT_RFork_Rule_darwin_newvfs,\n    FT_RFork_Rule_darwin_hfsplus,\n    FT_RFork_Rule_vfat,\n    FT_RFork_Rule_linux_cap,\n    FT_RFork_Rule_linux_double,\n    FT_RFork_Rule_linux_netatalk\n  } FT_RFork_Rule;\n\n  /* For fast translation between rule index and rule type,\n   * the macros FT_RFORK_xxx should be kept consistent with\n   * the raccess_guess_funcs table\n   */\n  typedef struct ft_raccess_guess_rec_ {\n    ft_raccess_guess_func  func;\n    FT_RFork_Rule          type;\n  } ft_raccess_guess_rec;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n  /* this array is a storage in non-PIC mode, so ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          const type name[] = {\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          { raccess_guess_ ## func_suffix,                           \\\n            FT_RFork_Rule_ ## type_suffix },\n#define CONST_FT_RFORK_RULE_ARRAY_END  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  /* this array is a function in PIC mode, so no ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          void                                         \\\n          FT_Init_ ## name( type*  storage )           \\\n          {                                            \\\n            type*  local = storage;                    \\\n                                                       \\\n                                                       \\\n            int  i = 0;\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          local[i].func = raccess_guess_ ## func_suffix;             \\\n          local[i].type = FT_RFork_Rule_ ## type_suffix;             \\\n          i++;\n#define CONST_FT_RFORK_RULE_ARRAY_END  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Guess                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Guess a file name and offset where the actual resource fork is     */\n  /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */\n  /*    guessing rules;  the guessed result for the Nth rule is            */\n  /*    represented as a triplet: a new file name (new_names[N]), a file   */\n  /*    offset (offsets[N]), and an error code (errors[N]).                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    base_name ::                                                       */\n  /*      The (base) file name of the resource fork used for some          */\n  /*      guessing rules.                                                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    new_names ::                                                       */\n  /*      An array of guessed file names in which the resource forks may   */\n  /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */\n  /*      equal to `base_name'.                                            */\n  /*                                                                       */\n  /*    offsets ::                                                         */\n  /*      An array of guessed file offsets.  `offsets[N]' holds the file   */\n  /*      offset of the possible start of the resource fork in file        */\n  /*      `new_names[N]'.                                                  */\n  /*                                                                       */\n  /*    errors ::                                                          */\n  /*      An array of FreeType error codes.  `errors[N]' is the error      */\n  /*      code of Nth guessing rule function.  If `errors[N]' is not       */\n  /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Raccess_Guess( FT_Library  library,\n                    FT_Stream   stream,\n                    char*       base_name,\n                    char**      new_names,\n                    FT_Long*    offsets,\n                    FT_Error*   errors );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_HeaderInfo                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the information from the header of resource fork.  The         */\n  /*    information includes the file offset where the resource map        */\n  /*    starts, and the file offset where the resource data starts.        */\n  /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    rfork_offset ::                                                    */\n  /*      The file offset where the resource fork starts.                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_HeaderInfo( FT_Library  library,\n                             FT_Stream   stream,\n                             FT_Long     rfork_offset,\n                             FT_Long    *map_offset,\n                             FT_Long    *rdata_pos );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_DataOffsets                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the data offsets for a tag in a resource fork.  Offsets are    */\n  /*    stored in an array because, in some cases, resources in a resource */\n  /*    fork have the same tag.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /*    tag ::                                                             */\n  /*      The resource tag.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    offsets ::                                                         */\n  /*      The stream offsets for the resource data specified by `tag'.     */\n  /*      This array is allocated by the function, so you have to call     */\n  /*      @ft_mem_free after use.                                          */\n  /*                                                                       */\n  /*    count ::                                                           */\n  /*      The length of offsets array.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */\n  /*    value for `map_offset' and `rdata_pos'.                            */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_DataOffsets( FT_Library  library,\n                              FT_Stream   stream,\n                              FT_Long     map_offset,\n                              FT_Long     rdata_pos,\n                              FT_Long     tag,\n                              FT_Long   **offsets,\n                              FT_Long    *count );\n\n\nFT_END_HEADER\n\n#endif /* __FTRFORK_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftserv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftserv.h                                                               */\n/*                                                                         */\n/*    The FreeType services (specification only).                          */\n/*                                                                         */\n/*  Copyright 2003-2007, 2009, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Each module can export one or more `services'.  Each service is      */\n  /*  identified by a constant string and modeled by a pointer; the latter */\n  /*  generally corresponds to a structure containing function pointers.   */\n  /*                                                                       */\n  /*  Note that a service's data cannot be a mere function pointer because */\n  /*  in C it is possible that function pointers might be implemented      */\n  /*  differently than data pointers (e.g. 48 bits instead of 32).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSERV_H__\n#define __FTSERV_H__\n\n\nFT_BEGIN_HEADER\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from a face's driver module.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );             \\\n    FT_Pointer   _tmp_  = NULL;                                             \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                              \\\n                                                                            \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                                        \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );              \\\n    FT_Pointer  _tmp_  = NULL;                                              \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    ptr = _tmp_;                                                            \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_GLOBAL_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from all modules.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );    \\\n    FT_Pointer   _tmp_;                                            \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                     \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );     \\\n    FT_Pointer  _tmp_;                                             \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    ptr   = _tmp_;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****         S E R V I C E   D E S C R I P T O R S                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  The following structure is used to _describe_ a given service\n   *  to the library.  This is useful to build simple static service lists.\n   */\n  typedef struct  FT_ServiceDescRec_\n  {\n    const char*  serv_id;     /* service name         */\n    const void*  serv_data;   /* service pointer/data */\n\n  } FT_ServiceDescRec;\n\n  typedef const FT_ServiceDescRec*  FT_ServiceDesc;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_SERVICEDESCREC1                                          */\n  /*    FT_DEFINE_SERVICEDESCREC2                                          */\n  /*    FT_DEFINE_SERVICEDESCREC3                                          */\n  /*    FT_DEFINE_SERVICEDESCREC4                                          */\n  /*    FT_DEFINE_SERVICEDESCREC5                                          */\n  /*    FT_DEFINE_SERVICEDESCREC6                                          */\n  /*    FT_DEFINE_SERVICEDESCREC7                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an array of FT_ServiceDescRec structures.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function needs to  */\n  /*    be called with a pointer to return an allocated array.  As soon as */\n  /*    it is no longer needed, a `destroy' function needs to be called to */\n  /*    release that allocation.                                           */\n  /*                                                                       */\n  /*    These functions should be manually called from the `pic_init' and  */\n  /*    `pic_free' functions of your module (see FT_DEFINE_MODULE).        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the array will be         */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { serv_id_7, serv_data_7 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = NULL;                                              \\\n    clazz[1].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = NULL;                                              \\\n    clazz[2].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = NULL;                                              \\\n    clazz[3].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = NULL;                                              \\\n    clazz[4].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = NULL;                                              \\\n    clazz[5].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = NULL;                                              \\\n    clazz[6].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = serv_id_7;                                         \\\n    clazz[6].serv_data = serv_data_7;                                       \\\n    clazz[7].serv_id   = NULL;                                              \\\n    clazz[7].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*\n   *  Parse a list of FT_ServiceDescRec descriptors and look for\n   *  a specific service by ID.  Note that the last element in the\n   *  array must be { NULL, NULL }, and that the function should\n   *  return NULL if the service isn't available.\n   *\n   *  This function can be used by modules to implement their\n   *  `get_service' method.\n   */\n  FT_BASE( FT_Pointer )\n  ft_service_list_lookup( FT_ServiceDesc  service_descriptors,\n                          const char*     service_id );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****             S E R V I C E S   C A C H E                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  This structure is used to store a cache for several frequently used\n   *  services.  It is the type of `face->internal->services'.  You\n   *  should only use FT_FACE_LOOKUP_SERVICE to access it.\n   *\n   *  All fields should have the type FT_Pointer to relax compilation\n   *  dependencies.  We assume the developer isn't completely stupid.\n   *\n   *  Each field must be named `service_XXXX' where `XXX' corresponds to\n   *  the correct FT_SERVICE_ID_XXXX macro.  See the definition of\n   *  FT_FACE_LOOKUP_SERVICE below how this is implemented.\n   *\n   */\n  typedef struct  FT_ServiceCacheRec_\n  {\n    FT_Pointer  service_POSTSCRIPT_FONT_NAME;\n    FT_Pointer  service_MULTI_MASTERS;\n    FT_Pointer  service_GLYPH_DICT;\n    FT_Pointer  service_PFR_METRICS;\n    FT_Pointer  service_WINFNT;\n\n  } FT_ServiceCacheRec, *FT_ServiceCache;\n\n\n  /*\n   *  A magic number used within the services cache.\n   */\n\n  /* ensure that value `1' has the same width as a pointer */\n#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)~(FT_PtrDist)1)\n\n\n  /*\n   * @macro:\n   *   FT_FACE_LOOKUP_SERVICE\n   *\n   * @description:\n   *   This macro is used to lookup a service from a face's driver module\n   *   using its cache.\n   *\n   * @input:\n   *   face::\n   *     The source face handle containing the cache.\n   *\n   *   field ::\n   *     The field name in the cache.\n   *\n   *   id ::\n   *     The service ID.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable receiving the service data.  NULL if not available.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer   svc;                                          \\\n    FT_Pointer*  Pptr = (FT_Pointer*)&(ptr);                   \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    *Pptr = svc;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer  svc;                                           \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    ptr = svc;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n  /*\n   *  A macro used to define new service structure types.\n   */\n\n#define FT_DEFINE_SERVICE( name )            \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    FT_Service_ ## name ## Rec ;             \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    const * FT_Service_ ## name ;            \\\n  struct FT_Service_ ## name ## Rec_\n\n  /* */\n\n  /*\n   *  The header files containing the services.\n   */\n\n#define FT_SERVICE_BDF_H                <freetype/internal/services/svbdf.h>\n#define FT_SERVICE_CID_H                <freetype/internal/services/svcid.h>\n#define FT_SERVICE_GLYPH_DICT_H         <freetype/internal/services/svgldict.h>\n#define FT_SERVICE_GX_VALIDATE_H        <freetype/internal/services/svgxval.h>\n#define FT_SERVICE_KERNING_H            <freetype/internal/services/svkern.h>\n#define FT_SERVICE_MULTIPLE_MASTERS_H   <freetype/internal/services/svmm.h>\n#define FT_SERVICE_OPENTYPE_VALIDATE_H  <freetype/internal/services/svotval.h>\n#define FT_SERVICE_PFR_H                <freetype/internal/services/svpfr.h>\n#define FT_SERVICE_POSTSCRIPT_CMAPS_H   <freetype/internal/services/svpscmap.h>\n#define FT_SERVICE_POSTSCRIPT_INFO_H    <freetype/internal/services/svpsinfo.h>\n#define FT_SERVICE_POSTSCRIPT_NAME_H    <freetype/internal/services/svpostnm.h>\n#define FT_SERVICE_PROPERTIES_H         <freetype/internal/services/svprop.h>\n#define FT_SERVICE_SFNT_H               <freetype/internal/services/svsfnt.h>\n#define FT_SERVICE_TRUETYPE_ENGINE_H    <freetype/internal/services/svtteng.h>\n#define FT_SERVICE_TT_CMAP_H            <freetype/internal/services/svttcmap.h>\n#define FT_SERVICE_WINFNT_H             <freetype/internal/services/svwinfnt.h>\n#define FT_SERVICE_XFREE86_NAME_H       <freetype/internal/services/svxf86nm.h>\n#define FT_SERVICE_TRUETYPE_GLYF_H      <freetype/internal/services/svttglyf.h>\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTSERV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftstream.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstream.h                                                             */\n/*                                                                         */\n/*    Stream handling (specification).                                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2006, 2011, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSTREAM_H__\n#define __FTSTREAM_H__\n\n\n#include <ft2build.h>\n#include FT_SYSTEM_H\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* format of an 8-bit frame_op value:           */\n  /*                                              */\n  /* bit  76543210                                */\n  /*      xxxxxxes                                */\n  /*                                              */\n  /* s is set to 1 if the value is signed.        */\n  /* e is set to 1 if the value is little-endian. */\n  /* xxx is a command.                            */\n\n#define FT_FRAME_OP_SHIFT         2\n#define FT_FRAME_OP_SIGNED        1\n#define FT_FRAME_OP_LITTLE        2\n#define FT_FRAME_OP_COMMAND( x )  ( x >> FT_FRAME_OP_SHIFT )\n\n#define FT_MAKE_FRAME_OP( command, little, sign ) \\\n          ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )\n\n#define FT_FRAME_OP_END    0\n#define FT_FRAME_OP_START  1  /* start a new frame     */\n#define FT_FRAME_OP_BYTE   2  /* read 1-byte value     */\n#define FT_FRAME_OP_SHORT  3  /* read 2-byte value     */\n#define FT_FRAME_OP_LONG   4  /* read 4-byte value     */\n#define FT_FRAME_OP_OFF3   5  /* read 3-byte value     */\n#define FT_FRAME_OP_BYTES  6  /* read a bytes sequence */\n\n\n  typedef enum  FT_Frame_Op_\n  {\n    ft_frame_end       = 0,\n    ft_frame_start     = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),\n\n    ft_frame_byte      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 0 ),\n    ft_frame_schar     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 1 ),\n\n    ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),\n    ft_frame_short_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),\n    ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),\n    ft_frame_short_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),\n\n    ft_frame_ulong_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),\n    ft_frame_long_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),\n    ft_frame_ulong_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),\n    ft_frame_long_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),\n\n    ft_frame_uoff3_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),\n    ft_frame_off3_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),\n    ft_frame_uoff3_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),\n    ft_frame_off3_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),\n\n    ft_frame_bytes     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),\n    ft_frame_skip      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )\n\n  } FT_Frame_Op;\n\n\n  typedef struct  FT_Frame_Field_\n  {\n    FT_Byte    value;\n    FT_Byte    size;\n    FT_UShort  offset;\n\n  } FT_Frame_Field;\n\n\n  /* Construct an FT_Frame_Field out of a structure type and a field name. */\n  /* The structure type must be set in the FT_STRUCTURE macro before       */\n  /* calling the FT_FRAME_START() macro.                                   */\n  /*                                                                       */\n#define FT_FIELD_SIZE( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )\n\n#define FT_FIELD_SIZE_DELTA( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )\n\n#define FT_FIELD_OFFSET( f ) \\\n          (FT_UShort)( offsetof( FT_STRUCTURE, f ) )\n\n#define FT_FRAME_FIELD( frame_op, field ) \\\n          {                               \\\n            frame_op,                     \\\n            FT_FIELD_SIZE( field ),       \\\n            FT_FIELD_OFFSET( field )      \\\n          }\n\n#define FT_MAKE_EMPTY_FIELD( frame_op )  { frame_op, 0, 0 }\n\n#define FT_FRAME_START( size )   { ft_frame_start, 0, size }\n#define FT_FRAME_END             { ft_frame_end, 0, 0 }\n\n#define FT_FRAME_LONG( f )       FT_FRAME_FIELD( ft_frame_long_be, f )\n#define FT_FRAME_ULONG( f )      FT_FRAME_FIELD( ft_frame_ulong_be, f )\n#define FT_FRAME_SHORT( f )      FT_FRAME_FIELD( ft_frame_short_be, f )\n#define FT_FRAME_USHORT( f )     FT_FRAME_FIELD( ft_frame_ushort_be, f )\n#define FT_FRAME_OFF3( f )       FT_FRAME_FIELD( ft_frame_off3_be, f )\n#define FT_FRAME_UOFF3( f )      FT_FRAME_FIELD( ft_frame_uoff3_be, f )\n#define FT_FRAME_BYTE( f )       FT_FRAME_FIELD( ft_frame_byte, f )\n#define FT_FRAME_CHAR( f )       FT_FRAME_FIELD( ft_frame_schar, f )\n\n#define FT_FRAME_LONG_LE( f )    FT_FRAME_FIELD( ft_frame_long_le, f )\n#define FT_FRAME_ULONG_LE( f )   FT_FRAME_FIELD( ft_frame_ulong_le, f )\n#define FT_FRAME_SHORT_LE( f )   FT_FRAME_FIELD( ft_frame_short_le, f )\n#define FT_FRAME_USHORT_LE( f )  FT_FRAME_FIELD( ft_frame_ushort_le, f )\n#define FT_FRAME_OFF3_LE( f )    FT_FRAME_FIELD( ft_frame_off3_le, f )\n#define FT_FRAME_UOFF3_LE( f )   FT_FRAME_FIELD( ft_frame_uoff3_le, f )\n\n#define FT_FRAME_SKIP_LONG       { ft_frame_long_be, 0, 0 }\n#define FT_FRAME_SKIP_SHORT      { ft_frame_short_be, 0, 0 }\n#define FT_FRAME_SKIP_BYTE       { ft_frame_byte, 0, 0 }\n\n#define FT_FRAME_BYTES( field, count ) \\\n          {                            \\\n            ft_frame_bytes,            \\\n            count,                     \\\n            FT_FIELD_OFFSET( field )   \\\n          }\n\n#define FT_FRAME_SKIP_BYTES( count )  { ft_frame_skip, count, 0 }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */\n  /* type `char*' or equivalent (1-byte elements).                         */\n  /*                                                                       */\n\n#define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )\n\n#define FT_INT16( x )   ( (FT_Int16)(x)  )\n#define FT_UINT16( x )  ( (FT_UInt16)(x) )\n#define FT_INT32( x )   ( (FT_Int32)(x)  )\n#define FT_UINT32( x )  ( (FT_UInt32)(x) )\n\n\n#define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )\n#define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )\n\n\n#define FT_PEEK_SHORT( p )  FT_INT16( FT_BYTE_U16( p, 0, 8) | \\\n                                      FT_BYTE_U16( p, 1, 0) )\n\n#define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \\\n                                        FT_BYTE_U16( p, 1, 0 ) )\n\n#define FT_PEEK_LONG( p )  FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                     FT_BYTE_U32( p, 1, 16 ) | \\\n                                     FT_BYTE_U32( p, 2,  8 ) | \\\n                                     FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                       FT_BYTE_U32( p, 1, 16 ) | \\\n                                       FT_BYTE_U32( p, 2,  8 ) | \\\n                                       FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_OFF3( p )  FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                     FT_BYTE_U32( p, 1,  8 ) | \\\n                                     FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                       FT_BYTE_U32( p, 1,  8 ) | \\\n                                       FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \\\n                                         FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \\\n                                           FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                        FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                          FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n\n#define FT_NEXT_CHAR( buffer )       \\\n          ( (signed char)*buffer++ )\n\n#define FT_NEXT_BYTE( buffer )         \\\n          ( (unsigned char)*buffer++ )\n\n#define FT_NEXT_SHORT( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )\n\n\n#define FT_NEXT_SHORT_LE( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT_LE( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3_LE( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG_LE( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each GET_xxxx() macro uses an implicit `stream' variable.             */\n  /*                                                                       */\n#if 0\n#define FT_GET_MACRO( type )    FT_NEXT_ ## type ( stream->cursor )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( CHAR )\n#define FT_GET_BYTE()       FT_GET_MACRO( BYTE )\n#define FT_GET_SHORT()      FT_GET_MACRO( SHORT )\n#define FT_GET_USHORT()     FT_GET_MACRO( USHORT )\n#define FT_GET_OFF3()       FT_GET_MACRO( OFF3 )\n#define FT_GET_UOFF3()      FT_GET_MACRO( UOFF3 )\n#define FT_GET_LONG()       FT_GET_MACRO( LONG )\n#define FT_GET_ULONG()      FT_GET_MACRO( ULONG )\n#define FT_GET_TAG4()       FT_GET_MACRO( ULONG )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( SHORT_LE )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( USHORT_LE )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( LONG_LE )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( ULONG_LE )\n\n#else\n#define FT_GET_MACRO( func, type )        ( (type)func( stream ) )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )\n#define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )\n#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )\n#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )\n#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )\n#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )\n#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetULong, FT_Long )\n#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )\n#endif\n\n#define FT_READ_MACRO( func, type, var )        \\\n          ( var = (type)func( stream, &error ), \\\n            error != FT_Err_Ok )\n\n#define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )\n#define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )\n#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )\n#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )\n#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )\n#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )\n#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )\n#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )\n\n#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )\n#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )\n#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )\n#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /* initialize a stream for reading a regular system stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Open( FT_Stream    stream,\n                  const char*  filepathname );\n\n#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* create a new (input) stream from an FT_Open_Args structure */\n  FT_BASE( FT_Error )\n  FT_Stream_New( FT_Library           library,\n                 const FT_Open_Args*  args,\n                 FT_Stream           *astream );\n\n  /* free a stream */\n  FT_BASE( void )\n  FT_Stream_Free( FT_Stream  stream,\n                  FT_Int     external );\n\n  /* initialize a stream for reading in-memory data */\n  FT_BASE( void )\n  FT_Stream_OpenMemory( FT_Stream       stream,\n                        const FT_Byte*  base,\n                        FT_ULong        size );\n\n  /* close a stream (does not destroy the stream structure) */\n  FT_BASE( void )\n  FT_Stream_Close( FT_Stream  stream );\n\n\n  /* seek within a stream. position is relative to start of stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Seek( FT_Stream  stream,\n                  FT_ULong   pos );\n\n  /* skip bytes in a stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Skip( FT_Stream  stream,\n                  FT_Long    distance );\n\n  /* return current stream position */\n  FT_BASE( FT_Long )\n  FT_Stream_Pos( FT_Stream  stream );\n\n  /* read bytes from a stream into a user-allocated buffer, returns an */\n  /* error if not all bytes could be read.                             */\n  FT_BASE( FT_Error )\n  FT_Stream_Read( FT_Stream  stream,\n                  FT_Byte*   buffer,\n                  FT_ULong   count );\n\n  /* read bytes from a stream at a given position */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadAt( FT_Stream  stream,\n                    FT_ULong   pos,\n                    FT_Byte*   buffer,\n                    FT_ULong   count );\n\n  /* try to read bytes at the end of a stream; return number of bytes */\n  /* really available                                                 */\n  FT_BASE( FT_ULong )\n  FT_Stream_TryRead( FT_Stream  stream,\n                     FT_Byte*   buffer,\n                     FT_ULong   count );\n\n  /* Enter a frame of `count' consecutive bytes in a stream.  Returns an */\n  /* error if the frame could not be read/accessed.  The caller can use  */\n  /* the FT_Stream_Get_XXX functions to retrieve frame data without      */\n  /* error checks.                                                       */\n  /*                                                                     */\n  /* You must _always_ call FT_Stream_ExitFrame() once you have entered  */\n  /* a stream frame!                                                     */\n  /*                                                                     */\n  FT_BASE( FT_Error )\n  FT_Stream_EnterFrame( FT_Stream  stream,\n                        FT_ULong   count );\n\n  /* exit a stream frame */\n  FT_BASE( void )\n  FT_Stream_ExitFrame( FT_Stream  stream );\n\n  /* Extract a stream frame.  If the stream is disk-based, a heap block */\n  /* is allocated and the frame bytes are read into it.  If the stream  */\n  /* is memory-based, this function simply set a pointer to the data.   */\n  /*                                                                    */\n  /* Useful to optimize access to memory-based streams transparently.   */\n  /*                                                                    */\n  /* All extracted frames must be `freed' with a call to the function   */\n  /* FT_Stream_ReleaseFrame().                                          */\n  /*                                                                    */\n  FT_BASE( FT_Error )\n  FT_Stream_ExtractFrame( FT_Stream  stream,\n                          FT_ULong   count,\n                          FT_Byte**  pbytes );\n\n  /* release an extract frame (see FT_Stream_ExtractFrame) */\n  FT_BASE( void )\n  FT_Stream_ReleaseFrame( FT_Stream  stream,\n                          FT_Byte**  pbytes );\n\n  /* read a byte from an entered frame */\n  FT_BASE( FT_Char )\n  FT_Stream_GetChar( FT_Stream  stream );\n\n  /* read a 16-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShort( FT_Stream  stream );\n\n  /* read a 24-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetUOffset( FT_Stream  stream );\n\n  /* read a 32-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULong( FT_Stream  stream );\n\n  /* read a 16-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShortLE( FT_Stream  stream );\n\n  /* read a 32-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULongLE( FT_Stream  stream );\n\n\n  /* read a byte from a stream */\n  FT_BASE( FT_Char )\n  FT_Stream_ReadChar( FT_Stream  stream,\n                      FT_Error*  error );\n\n  /* read a 16-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShort( FT_Stream  stream,\n                        FT_Error*  error );\n\n  /* read a 24-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadUOffset( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* read a 32-bit big-endian integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULong( FT_Stream  stream,\n                       FT_Error*  error );\n\n  /* read a 16-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShortLE( FT_Stream  stream,\n                          FT_Error*  error );\n\n  /* read a 32-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULongLE( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* Read a structure from a stream.  The structure must be described */\n  /* by an array of FT_Frame_Field records.                           */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadFields( FT_Stream              stream,\n                        const FT_Frame_Field*  fields,\n                        void*                  structure );\n\n\n#define FT_STREAM_POS()           \\\n          FT_Stream_Pos( stream )\n\n#define FT_STREAM_SEEK( position )                               \\\n          FT_SET_ERROR( FT_Stream_Seek( stream,                  \\\n                                        (FT_ULong)(position) ) )\n\n#define FT_STREAM_SKIP( distance )                              \\\n          FT_SET_ERROR( FT_Stream_Skip( stream,                 \\\n                                        (FT_Long)(distance) ) )\n\n#define FT_STREAM_READ( buffer, count )                       \\\n          FT_SET_ERROR( FT_Stream_Read( stream,               \\\n                                        (FT_Byte*)(buffer),   \\\n                                        (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_AT( position, buffer, count )            \\\n          FT_SET_ERROR( FT_Stream_ReadAt( stream,               \\\n                                          (FT_ULong)(position), \\\n                                          (FT_Byte*)buffer,     \\\n                                          (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_FIELDS( fields, object )                          \\\n          FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )\n\n\n#define FT_FRAME_ENTER( size )                                           \\\n          FT_SET_ERROR(                                                  \\\n            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream,                \\\n                                                  (FT_ULong)(size) ) ) )\n\n#define FT_FRAME_EXIT()                                   \\\n          FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )\n\n#define FT_FRAME_EXTRACT( size, bytes )                                       \\\n          FT_SET_ERROR(                                                       \\\n            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream,                   \\\n                                                    (FT_ULong)(size),         \\\n                                                    (FT_Byte**)&(bytes) ) ) )\n\n#define FT_FRAME_RELEASE( bytes )                                         \\\n          FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream,                 \\\n                                                  (FT_Byte**)&(bytes) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTSTREAM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/fttrace.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrace.h                                                              */\n/*                                                                         */\n/*    Tracing handling (specification only).                               */\n/*                                                                         */\n/*  Copyright 2002, 2004-2007, 2009, 2011-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* definitions of trace levels for FreeType 2 */\n\n  /* the first level must always be `trace_any' */\nFT_TRACE_DEF( any )\n\n  /* base components */\nFT_TRACE_DEF( calc )      /* calculations            (ftcalc.c)   */\nFT_TRACE_DEF( memory )    /* memory manager          (ftobjs.c)   */\nFT_TRACE_DEF( stream )    /* stream manager          (ftstream.c) */\nFT_TRACE_DEF( io )        /* i/o interface           (ftsystem.c) */\nFT_TRACE_DEF( list )      /* list management         (ftlist.c)   */\nFT_TRACE_DEF( init )      /* initialization          (ftinit.c)   */\nFT_TRACE_DEF( objs )      /* base objects            (ftobjs.c)   */\nFT_TRACE_DEF( outline )   /* outline management      (ftoutln.c)  */\nFT_TRACE_DEF( glyph )     /* glyph management        (ftglyph.c)  */\nFT_TRACE_DEF( gloader )   /* glyph loader            (ftgloadr.c) */\n\nFT_TRACE_DEF( raster )    /* monochrome rasterizer   (ftraster.c) */\nFT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */\nFT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */\nFT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */\nFT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */\nFT_TRACE_DEF( bitmap )    /* bitmap checksum         (ftobjs.c)   */\n\n  /* Cache sub-system */\nFT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */\n\n  /* SFNT driver components */\nFT_TRACE_DEF( sfdriver )  /* SFNT font driver        (sfdriver.c) */\nFT_TRACE_DEF( sfobjs )    /* SFNT object handler     (sfobjs.c)   */\nFT_TRACE_DEF( ttcmap )    /* charmap handler         (ttcmap.c)   */\nFT_TRACE_DEF( ttkern )    /* kerning handler         (ttkern.c)   */\nFT_TRACE_DEF( ttload )    /* basic TrueType tables   (ttload.c)   */\nFT_TRACE_DEF( ttmtx )     /* metrics-related tables  (ttmtx.c)    */\nFT_TRACE_DEF( ttpost )    /* PS table processing     (ttpost.c)   */\nFT_TRACE_DEF( ttsbit )    /* TrueType sbit handling  (ttsbit.c)   */\nFT_TRACE_DEF( ttbdf )     /* TrueType embedded BDF   (ttbdf.c)    */\n\n  /* TrueType driver components */\nFT_TRACE_DEF( ttdriver )  /* TT font driver          (ttdriver.c) */\nFT_TRACE_DEF( ttgload )   /* TT glyph loader         (ttgload.c)  */\nFT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */\nFT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */\nFT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */\nFT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */\n\n  /* Type 1 driver components */\nFT_TRACE_DEF( t1afm )\nFT_TRACE_DEF( t1driver )\nFT_TRACE_DEF( t1gload )\nFT_TRACE_DEF( t1hint )\nFT_TRACE_DEF( t1load )\nFT_TRACE_DEF( t1objs )\nFT_TRACE_DEF( t1parse )\n\n  /* PostScript helper module `psaux' */\nFT_TRACE_DEF( t1decode )\nFT_TRACE_DEF( psobjs )\nFT_TRACE_DEF( psconv )\n\n  /* PostScript hinting module `pshinter' */\nFT_TRACE_DEF( pshrec )\nFT_TRACE_DEF( pshalgo1 )\nFT_TRACE_DEF( pshalgo2 )\n\n  /* Type 2 driver components */\nFT_TRACE_DEF( cffdriver )\nFT_TRACE_DEF( cffgload )\nFT_TRACE_DEF( cffload )\nFT_TRACE_DEF( cffobjs )\nFT_TRACE_DEF( cffparse )\n\nFT_TRACE_DEF( cf2blues )\nFT_TRACE_DEF( cf2hints )\nFT_TRACE_DEF( cf2interp )\n\n  /* Type 42 driver component */\nFT_TRACE_DEF( t42 )\n\n  /* CID driver components */\nFT_TRACE_DEF( cidafm )\nFT_TRACE_DEF( ciddriver )\nFT_TRACE_DEF( cidgload )\nFT_TRACE_DEF( cidload )\nFT_TRACE_DEF( cidobjs )\nFT_TRACE_DEF( cidparse )\n\n  /* Windows font component */\nFT_TRACE_DEF( winfnt )\n\n  /* PCF font components */\nFT_TRACE_DEF( pcfdriver )\nFT_TRACE_DEF( pcfread )\n\n  /* BDF font components */\nFT_TRACE_DEF( bdfdriver )\nFT_TRACE_DEF( bdflib )\n\n  /* PFR font component */\nFT_TRACE_DEF( pfr )\n\n  /* OpenType validation components */\nFT_TRACE_DEF( otvmodule )\nFT_TRACE_DEF( otvcommon )\nFT_TRACE_DEF( otvbase )\nFT_TRACE_DEF( otvgdef )\nFT_TRACE_DEF( otvgpos )\nFT_TRACE_DEF( otvgsub )\nFT_TRACE_DEF( otvjstf )\nFT_TRACE_DEF( otvmath )\n\n  /* TrueTypeGX/AAT validation components */\nFT_TRACE_DEF( gxvmodule )\nFT_TRACE_DEF( gxvcommon )\nFT_TRACE_DEF( gxvfeat )\nFT_TRACE_DEF( gxvmort )\nFT_TRACE_DEF( gxvmorx )\nFT_TRACE_DEF( gxvbsln )\nFT_TRACE_DEF( gxvjust )\nFT_TRACE_DEF( gxvkern )\nFT_TRACE_DEF( gxvopbd )\nFT_TRACE_DEF( gxvtrak )\nFT_TRACE_DEF( gxvprop )\nFT_TRACE_DEF( gxvlcar )\n\n  /* autofit components */\nFT_TRACE_DEF( afmodule )\nFT_TRACE_DEF( afhints )\nFT_TRACE_DEF( afcjk )\nFT_TRACE_DEF( aflatin )\nFT_TRACE_DEF( aflatin2 )\nFT_TRACE_DEF( afwarp )\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/ftvalid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftvalid.h                                                              */\n/*                                                                         */\n/*    FreeType validation support (specification).                         */\n/*                                                                         */\n/*  Copyright 2004, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTVALID_H__\n#define __FTVALID_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    V A L I D A T I O N                          ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to a validation object */\n  typedef struct FT_ValidatorRec_ volatile*  FT_Validator;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* There are three distinct validation levels defined here:              */\n  /*                                                                       */\n  /* FT_VALIDATE_DEFAULT ::                                                */\n  /*   A table that passes this validation level can be used reliably by   */\n  /*   FreeType.  It generally means that all offsets have been checked to */\n  /*   prevent out-of-bound reads, that array counts are correct, etc.     */\n  /*                                                                       */\n  /* FT_VALIDATE_TIGHT ::                                                  */\n  /*   A table that passes this validation level can be used reliably and  */\n  /*   doesn't contain invalid data.  For example, a charmap table that    */\n  /*   returns invalid glyph indices will not pass, even though it can     */\n  /*   be used with FreeType in default mode (the library will simply      */\n  /*   return an error later when trying to load the glyph).               */\n  /*                                                                       */\n  /*   It also checks that fields which must be a multiple of 2, 4, or 8,  */\n  /*   don't have incorrect values, etc.                                   */\n  /*                                                                       */\n  /* FT_VALIDATE_PARANOID ::                                               */\n  /*   Only for font debugging.  Checks that a table follows the           */\n  /*   specification by 100%.  Very few fonts will be able to pass this    */\n  /*   level anyway but it can be useful for certain tools like font       */\n  /*   editors/converters.                                                 */\n  /*                                                                       */\n  typedef enum  FT_ValidationLevel_\n  {\n    FT_VALIDATE_DEFAULT = 0,\n    FT_VALIDATE_TIGHT,\n    FT_VALIDATE_PARANOID\n\n  } FT_ValidationLevel;\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n  /* We disable the warning `structure was padded due to   */\n  /* __declspec(align())' in order to compile cleanly with */\n  /* the maximum level of warnings.                        */\n#pragma warning( push )\n#pragma warning( disable : 4324 )\n#endif /* _MSC_VER */\n\n  /* validator structure */\n  typedef struct  FT_ValidatorRec_\n  {\n    const FT_Byte*      base;        /* address of table in memory       */\n    const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */\n    FT_ValidationLevel  level;       /* validation level                 */\n    FT_Error            error;       /* error returned. 0 means success  */\n\n    ft_jmp_buf          jump_buffer; /* used for exception handling      */\n\n  } FT_ValidatorRec;\n\n#if defined( _MSC_VER )\n#pragma warning( pop )\n#endif\n\n#define FT_VALIDATOR( x )  ( (FT_Validator)( x ) )\n\n\n  FT_BASE( void )\n  ft_validator_init( FT_Validator        valid,\n                     const FT_Byte*      base,\n                     const FT_Byte*      limit,\n                     FT_ValidationLevel  level );\n\n  /* Do not use this. It's broken and will cause your validator to crash */\n  /* if you run it on an invalid font.                                   */\n  FT_BASE( FT_Int )\n  ft_validator_run( FT_Validator  valid );\n\n  /* Sets the error field in a validator, then calls `longjmp' to return */\n  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */\n  /* error checks within the validation routines.                        */\n  /*                                                                     */\n  FT_BASE( void )\n  ft_validator_error( FT_Validator  valid,\n                      FT_Error      error );\n\n\n  /* Calls ft_validate_error.  Assumes that the `valid' local variable */\n  /* holds a pointer to the current validator object.                  */\n  /*                                                                   */\n  /* Use preprocessor prescan to pass FT_ERR_PREFIX.                   */\n  /*                                                                   */\n#define FT_INVALID( _prefix, _error )  FT_INVALID_( _prefix, _error )\n#define FT_INVALID_( _prefix, _error ) \\\n          ft_validator_error( valid, _prefix ## _error )\n\n  /* called when a broken table is detected */\n#define FT_INVALID_TOO_SHORT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid offset is detected */\n#define FT_INVALID_OFFSET \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )\n\n  /* called when an invalid format/value is detected */\n#define FT_INVALID_FORMAT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid glyph index is detected */\n#define FT_INVALID_GLYPH_ID \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )\n\n  /* called when an invalid field value is detected */\n#define FT_INVALID_DATA \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n\nFT_END_HEADER\n\n#endif /* __FTVALID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/internal.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  internal.h                                                             */\n/*                                                                         */\n/*    Internal header files (specification only).                          */\n/*                                                                         */\n/*  Copyright 1996-2004, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is automatically included by `ft2build.h'.                  */\n  /* Do not include it manually!                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define FT_INTERNAL_OBJECTS_H             <freetype/internal/ftobjs.h>\n#define FT_INTERNAL_PIC_H                 <freetype/internal/ftpic.h>\n#define FT_INTERNAL_STREAM_H              <freetype/internal/ftstream.h>\n#define FT_INTERNAL_MEMORY_H              <freetype/internal/ftmemory.h>\n#define FT_INTERNAL_DEBUG_H               <freetype/internal/ftdebug.h>\n#define FT_INTERNAL_CALC_H                <freetype/internal/ftcalc.h>\n#define FT_INTERNAL_DRIVER_H              <freetype/internal/ftdriver.h>\n#define FT_INTERNAL_TRACE_H               <freetype/internal/fttrace.h>\n#define FT_INTERNAL_GLYPH_LOADER_H        <freetype/internal/ftgloadr.h>\n#define FT_INTERNAL_SFNT_H                <freetype/internal/sfnt.h>\n#define FT_INTERNAL_SERVICE_H             <freetype/internal/ftserv.h>\n#define FT_INTERNAL_RFORK_H               <freetype/internal/ftrfork.h>\n#define FT_INTERNAL_VALIDATE_H            <freetype/internal/ftvalid.h>\n\n#define FT_INTERNAL_TRUETYPE_TYPES_H      <freetype/internal/tttypes.h>\n#define FT_INTERNAL_TYPE1_TYPES_H         <freetype/internal/t1types.h>\n\n#define FT_INTERNAL_POSTSCRIPT_AUX_H      <freetype/internal/psaux.h>\n#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <freetype/internal/pshints.h>\n#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <freetype/internal/psglobal.h>\n\n#define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n\n  /* We disable the warning `conditional expression is constant' here */\n  /* in order to compile cleanly with the maximum level of warnings.  */\n  /* In particular, the warning complains about stuff like `while(0)' */\n  /* which is very useful in macro definitions.  There is no benefit  */\n  /* in having it enabled.                                            */\n#pragma warning( disable : 4127 )\n\n#endif /* _MSC_VER */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/psaux.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psaux.h                                                                */\n/*                                                                         */\n/*    Auxiliary functions and data structures related to PostScript fonts  */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSAUX_H__\n#define __PSAUX_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                             T1_TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct PS_TableRec_*              PS_Table;\n  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Table_FuncsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of function pointers to manage PS_Table objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    table_init    :: Used to initialize a table.                       */\n  /*                                                                       */\n  /*    table_done    :: Finalizes resp. destroy a given table.            */\n  /*                                                                       */\n  /*    table_add     :: Adds a new object to a table.                     */\n  /*                                                                       */\n  /*    table_release :: Releases table data, then finalizes it.           */\n  /*                                                                       */\n  typedef struct  PS_Table_FuncsRec_\n  {\n    FT_Error\n    (*init)( PS_Table   table,\n             FT_Int     count,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Table  table );\n\n    FT_Error\n    (*add)( PS_Table    table,\n            FT_Int      idx,\n            void*       object,\n            FT_PtrDist  length );\n\n    void\n    (*release)( PS_Table  table );\n\n  } PS_Table_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Table is a simple object used to store an array of objects in */\n  /*    a single memory block.                                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    block     :: The address in memory of the growheap's block.  This  */\n  /*                 can change between two object adds, due to            */\n  /*                 reallocation.                                         */\n  /*                                                                       */\n  /*    cursor    :: The current top of the grow heap within its block.    */\n  /*                                                                       */\n  /*    capacity  :: The current size of the heap block.  Increments by    */\n  /*                 1kByte chunks.                                        */\n  /*                                                                       */\n  /*    init      :: Set to 0xDEADBEEF if `elements' and `lengths' have    */\n  /*                 been allocated.                                       */\n  /*                                                                       */\n  /*    max_elems :: The maximum number of elements in table.              */\n  /*                                                                       */\n  /*    num_elems :: The current number of elements in table.              */\n  /*                                                                       */\n  /*    elements  :: A table of element addresses within the block.        */\n  /*                                                                       */\n  /*    lengths   :: A table of element sizes within the block.            */\n  /*                                                                       */\n  /*    memory    :: The object used for memory operations                 */\n  /*                 (alloc/realloc).                                      */\n  /*                                                                       */\n  /*    funcs     :: A table of method pointers for this object.           */\n  /*                                                                       */\n  typedef struct  PS_TableRec_\n  {\n    FT_Byte*           block;          /* current memory block           */\n    FT_Offset          cursor;         /* current cursor in memory block */\n    FT_Offset          capacity;       /* current size of memory block   */\n    FT_Long            init;\n\n    FT_Int             max_elems;\n    FT_Int             num_elems;\n    FT_Byte**          elements;       /* addresses of table elements */\n    FT_PtrDist*        lengths;        /* lengths of table elements   */\n\n    FT_Memory          memory;\n    PS_Table_FuncsRec  funcs;\n\n  } PS_TableRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       T1 FIELDS & TOKENS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PS_ParserRec_*  PS_Parser;\n\n  typedef struct T1_TokenRec_*   T1_Token;\n\n  typedef struct T1_FieldRec_*   T1_Field;\n\n\n  /* simple enumeration type used to identify token types */\n  typedef enum  T1_TokenType_\n  {\n    T1_TOKEN_TYPE_NONE = 0,\n    T1_TOKEN_TYPE_ANY,\n    T1_TOKEN_TYPE_STRING,\n    T1_TOKEN_TYPE_ARRAY,\n    T1_TOKEN_TYPE_KEY, /* aka `name' */\n\n    /* do not remove */\n    T1_TOKEN_TYPE_MAX\n\n  } T1_TokenType;\n\n\n  /* a simple structure used to identify tokens */\n  typedef struct  T1_TokenRec_\n  {\n    FT_Byte*      start;   /* first character of token in input stream */\n    FT_Byte*      limit;   /* first character after the token          */\n    T1_TokenType  type;    /* type of token                            */\n\n  } T1_TokenRec;\n\n\n  /* enumeration type used to identify object fields */\n  typedef enum  T1_FieldType_\n  {\n    T1_FIELD_TYPE_NONE = 0,\n    T1_FIELD_TYPE_BOOL,\n    T1_FIELD_TYPE_INTEGER,\n    T1_FIELD_TYPE_FIXED,\n    T1_FIELD_TYPE_FIXED_1000,\n    T1_FIELD_TYPE_STRING,\n    T1_FIELD_TYPE_KEY,\n    T1_FIELD_TYPE_BBOX,\n    T1_FIELD_TYPE_MM_BBOX,\n    T1_FIELD_TYPE_INTEGER_ARRAY,\n    T1_FIELD_TYPE_FIXED_ARRAY,\n    T1_FIELD_TYPE_CALLBACK,\n\n    /* do not remove */\n    T1_FIELD_TYPE_MAX\n\n  } T1_FieldType;\n\n\n  typedef enum  T1_FieldLocation_\n  {\n    T1_FIELD_LOCATION_CID_INFO,\n    T1_FIELD_LOCATION_FONT_DICT,\n    T1_FIELD_LOCATION_FONT_EXTRA,\n    T1_FIELD_LOCATION_FONT_INFO,\n    T1_FIELD_LOCATION_PRIVATE,\n    T1_FIELD_LOCATION_BBOX,\n    T1_FIELD_LOCATION_LOADER,\n    T1_FIELD_LOCATION_FACE,\n    T1_FIELD_LOCATION_BLEND,\n\n    /* do not remove */\n    T1_FIELD_LOCATION_MAX\n\n  } T1_FieldLocation;\n\n\n  typedef void\n  (*T1_Field_ParseFunc)( FT_Face     face,\n                         FT_Pointer  parser );\n\n\n  /* structure type used to model object fields */\n  typedef struct  T1_FieldRec_\n  {\n    const char*         ident;        /* field identifier               */\n    T1_FieldLocation    location;\n    T1_FieldType        type;         /* type of field                  */\n    T1_Field_ParseFunc  reader;\n    FT_UInt             offset;       /* offset of field in object      */\n    FT_Byte             size;         /* size of field in bytes         */\n    FT_UInt             array_max;    /* maximum number of elements for */\n                                      /* array                          */\n    FT_UInt             count_offset; /* offset of element count for    */\n                                      /* arrays; must not be zero if in */\n                                      /* use -- in other words, a       */\n                                      /* `num_FOO' element must not     */\n                                      /* start the used structure if we */\n                                      /* parse a `FOO' array            */\n    FT_UInt             dict;         /* where we expect it             */\n  } T1_FieldRec;\n\n#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */\n#define T1_FIELD_DICT_PRIVATE  ( 1 << 1 )\n\n\n\n#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \\\n          {                                                 \\\n            _ident, T1CODE, _type,                          \\\n            0,                                              \\\n            FT_FIELD_OFFSET( _fname ),                      \\\n            FT_FIELD_SIZE( _fname ),                        \\\n            0, 0,                                           \\\n            _dict                                           \\\n          },\n\n#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \\\n          {                                             \\\n            _ident, T1CODE, T1_FIELD_TYPE_CALLBACK,     \\\n            (T1_Field_ParseFunc)_reader,                \\\n            0, 0,                                       \\\n            0, 0,                                       \\\n            _dict                                       \\\n          },\n\n#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \\\n          {                                                      \\\n            _ident, T1CODE, _type,                               \\\n            0,                                                   \\\n            FT_FIELD_OFFSET( _fname ),                           \\\n            FT_FIELD_SIZE_DELTA( _fname ),                       \\\n            _max,                                                \\\n            FT_FIELD_OFFSET( num_ ## _fname ),                   \\\n            _dict                                                \\\n          },\n\n#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \\\n          {                                                       \\\n            _ident, T1CODE, _type,                                \\\n            0,                                                    \\\n            FT_FIELD_OFFSET( _fname ),                            \\\n            FT_FIELD_SIZE_DELTA( _fname ),                        \\\n            _max, 0,                                              \\\n            _dict                                                 \\\n          },\n\n\n#define T1_FIELD_BOOL( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )\n\n#define T1_FIELD_NUM( _ident, _fname, _dict )                                 \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )\n\n#define T1_FIELD_FIXED( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )\n\n#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )                     \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \\\n                               _dict )\n\n#define T1_FIELD_STRING( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )\n\n#define T1_FIELD_KEY( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )\n\n#define T1_FIELD_BBOX( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )\n\n\n#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_CALLBACK( _ident, _name, _dict )       \\\n          T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 PARSER                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct PS_Parser_FuncsRec_*  PS_Parser_Funcs;\n\n  typedef struct  PS_Parser_FuncsRec_\n  {\n    void\n    (*init)( PS_Parser  parser,\n             FT_Byte*   base,\n             FT_Byte*   limit,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Parser  parser );\n\n    void\n    (*skip_spaces)( PS_Parser  parser );\n    void\n    (*skip_PS_token)( PS_Parser  parser );\n\n    FT_Long\n    (*to_int)( PS_Parser  parser );\n    FT_Fixed\n    (*to_fixed)( PS_Parser  parser,\n                 FT_Int     power_ten );\n\n    FT_Error\n    (*to_bytes)( PS_Parser  parser,\n                 FT_Byte*   bytes,\n                 FT_Offset  max_bytes,\n                 FT_Long*   pnum_bytes,\n                 FT_Bool    delimiters );\n\n    FT_Int\n    (*to_coord_array)( PS_Parser  parser,\n                       FT_Int     max_coords,\n                       FT_Short*  coords );\n    FT_Int\n    (*to_fixed_array)( PS_Parser  parser,\n                       FT_Int     max_values,\n                       FT_Fixed*  values,\n                       FT_Int     power_ten );\n\n    void\n    (*to_token)( PS_Parser  parser,\n                 T1_Token   token );\n    void\n    (*to_token_array)( PS_Parser  parser,\n                       T1_Token   tokens,\n                       FT_UInt    max_tokens,\n                       FT_Int*    pnum_tokens );\n\n    FT_Error\n    (*load_field)( PS_Parser       parser,\n                   const T1_Field  field,\n                   void**          objects,\n                   FT_UInt         max_objects,\n                   FT_ULong*       pflags );\n\n    FT_Error\n    (*load_field_table)( PS_Parser       parser,\n                         const T1_Field  field,\n                         void**          objects,\n                         FT_UInt         max_objects,\n                         FT_ULong*       pflags );\n\n  } PS_Parser_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_ParserRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Parser is an object used to parse a Type 1 font very quickly. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    cursor :: The current position in the text.                        */\n  /*                                                                       */\n  /*    base   :: Start of the processed text.                             */\n  /*                                                                       */\n  /*    limit  :: End of the processed text.                               */\n  /*                                                                       */\n  /*    error  :: The last error returned.                                 */\n  /*                                                                       */\n  /*    memory :: The object used for memory operations (alloc/realloc).   */\n  /*                                                                       */\n  /*    funcs  :: A table of functions for the parser.                     */\n  /*                                                                       */\n  typedef struct  PS_ParserRec_\n  {\n    FT_Byte*   cursor;\n    FT_Byte*   base;\n    FT_Byte*   limit;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    PS_Parser_FuncsRec  funcs;\n\n  } PS_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 BUILDER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_BuilderRec_*  T1_Builder;\n\n\n  typedef FT_Error\n  (*T1_Builder_Check_Points_Func)( T1_Builder  builder,\n                                   FT_Int      count );\n\n  typedef void\n  (*T1_Builder_Add_Point_Func)( T1_Builder  builder,\n                                FT_Pos      x,\n                                FT_Pos      y,\n                                FT_Byte     flag );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Point1_Func)( T1_Builder  builder,\n                                 FT_Pos      x,\n                                 FT_Pos      y );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Contour_Func)( T1_Builder  builder );\n\n  typedef FT_Error\n  (*T1_Builder_Start_Point_Func)( T1_Builder  builder,\n                                  FT_Pos      x,\n                                  FT_Pos      y );\n\n  typedef void\n  (*T1_Builder_Close_Contour_Func)( T1_Builder  builder );\n\n\n  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;\n\n  typedef struct  T1_Builder_FuncsRec_\n  {\n    void\n    (*init)( T1_Builder    builder,\n             FT_Face       face,\n             FT_Size       size,\n             FT_GlyphSlot  slot,\n             FT_Bool       hinting );\n\n    void\n    (*done)( T1_Builder   builder );\n\n    T1_Builder_Check_Points_Func   check_points;\n    T1_Builder_Add_Point_Func      add_point;\n    T1_Builder_Add_Point1_Func     add_point1;\n    T1_Builder_Add_Contour_Func    add_contour;\n    T1_Builder_Start_Point_Func    start_point;\n    T1_Builder_Close_Contour_Func  close_contour;\n\n  } T1_Builder_FuncsRec;\n\n\n  /* an enumeration type to handle charstring parsing states */\n  typedef enum  T1_ParseState_\n  {\n    T1_Parse_Start,\n    T1_Parse_Have_Width,\n    T1_Parse_Have_Moveto,\n    T1_Parse_Have_Path\n\n  } T1_ParseState;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Structure>                                                           */\n  /*    T1_BuilderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     A structure used during glyph loading to store its outline.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory       :: The current memory object.                         */\n  /*                                                                       */\n  /*    face         :: The current face object.                           */\n  /*                                                                       */\n  /*    glyph        :: The current glyph slot.                            */\n  /*                                                                       */\n  /*    loader       :: XXX                                                */\n  /*                                                                       */\n  /*    base         :: The base glyph outline.                            */\n  /*                                                                       */\n  /*    current      :: The current glyph outline.                         */\n  /*                                                                       */\n  /*    max_points   :: maximum points in builder outline                  */\n  /*                                                                       */\n  /*    max_contours :: Maximum number of contours in builder outline.     */\n  /*                                                                       */\n  /*    pos_x        :: The horizontal translation (if composite glyph).   */\n  /*                                                                       */\n  /*    pos_y        :: The vertical translation (if composite glyph).     */\n  /*                                                                       */\n  /*    left_bearing :: The left side bearing point.                       */\n  /*                                                                       */\n  /*    advance      :: The horizontal advance vector.                     */\n  /*                                                                       */\n  /*    bbox         :: Unused.                                            */\n  /*                                                                       */\n  /*    parse_state  :: An enumeration which controls the charstring       */\n  /*                    parsing state.                                     */\n  /*                                                                       */\n  /*    load_points  :: If this flag is not set, no points are loaded.     */\n  /*                                                                       */\n  /*    no_recurse   :: Set but not used.                                  */\n  /*                                                                       */\n  /*    metrics_only :: A boolean indicating that we only want to compute  */\n  /*                    the metrics of a given glyph, not load all of its  */\n  /*                    points.                                            */\n  /*                                                                       */\n  /*    funcs        :: An array of function pointers for the builder.     */\n  /*                                                                       */\n  typedef struct  T1_BuilderRec_\n  {\n    FT_Memory       memory;\n    FT_Face         face;\n    FT_GlyphSlot    glyph;\n    FT_GlyphLoader  loader;\n    FT_Outline*     base;\n    FT_Outline*     current;\n\n    FT_Pos          pos_x;\n    FT_Pos          pos_y;\n\n    FT_Vector       left_bearing;\n    FT_Vector       advance;\n\n    FT_BBox         bbox;          /* bounding box */\n    T1_ParseState   parse_state;\n    FT_Bool         load_points;\n    FT_Bool         no_recurse;\n\n    FT_Bool         metrics_only;\n\n    void*           hints_funcs;    /* hinter-specific */\n    void*           hints_globals;  /* hinter-specific */\n\n    T1_Builder_FuncsRec  funcs;\n\n  } T1_BuilderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 DECODER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  8\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  32\n\n#endif /* 0 */\n\n\n  typedef struct  T1_Decoder_ZoneRec_\n  {\n    FT_Byte*  cursor;\n    FT_Byte*  base;\n    FT_Byte*  limit;\n\n  } T1_Decoder_ZoneRec, *T1_Decoder_Zone;\n\n\n  typedef struct T1_DecoderRec_*              T1_Decoder;\n  typedef const struct T1_Decoder_FuncsRec_*  T1_Decoder_Funcs;\n\n\n  typedef FT_Error\n  (*T1_Decoder_Callback)( T1_Decoder  decoder,\n                          FT_UInt     glyph_index );\n\n\n  typedef struct  T1_Decoder_FuncsRec_\n  {\n    FT_Error\n    (*init)( T1_Decoder           decoder,\n             FT_Face              face,\n             FT_Size              size,\n             FT_GlyphSlot         slot,\n             FT_Byte**            glyph_names,\n             PS_Blend             blend,\n             FT_Bool              hinting,\n             FT_Render_Mode       hint_mode,\n             T1_Decoder_Callback  callback );\n\n    void\n    (*done)( T1_Decoder  decoder );\n\n    FT_Error\n    (*parse_charstrings)( T1_Decoder  decoder,\n                          FT_Byte*    base,\n                          FT_UInt     len );\n\n  } T1_Decoder_FuncsRec;\n\n\n  typedef struct  T1_DecoderRec_\n  {\n    T1_BuilderRec        builder;\n\n    FT_Long              stack[T1_MAX_CHARSTRINGS_OPERANDS];\n    FT_Long*             top;\n\n    T1_Decoder_ZoneRec   zones[T1_MAX_SUBRS_CALLS + 1];\n    T1_Decoder_Zone      zone;\n\n    FT_Service_PsCMaps   psnames;      /* for seac */\n    FT_UInt              num_glyphs;\n    FT_Byte**            glyph_names;\n\n    FT_Int               lenIV;        /* internal for sub routine calls */\n    FT_UInt              num_subrs;\n    FT_Byte**            subrs;\n    FT_PtrDist*          subrs_len;    /* array of subrs length (optional) */\n\n    FT_Matrix            font_matrix;\n    FT_Vector            font_offset;\n\n    FT_Int               flex_state;\n    FT_Int               num_flex_vectors;\n    FT_Vector            flex_vectors[7];\n\n    PS_Blend             blend;       /* for multiple master support */\n\n    FT_Render_Mode       hint_mode;\n\n    T1_Decoder_Callback  parse_callback;\n    T1_Decoder_FuncsRec  funcs;\n\n    FT_Long*             buildchar;\n    FT_UInt              len_buildchar;\n\n    FT_Bool              seac;\n\n  } T1_DecoderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            AFM PARSER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct AFM_ParserRec_*  AFM_Parser;\n\n  typedef struct  AFM_Parser_FuncsRec_\n  {\n    FT_Error\n    (*init)( AFM_Parser  parser,\n             FT_Memory   memory,\n             FT_Byte*    base,\n             FT_Byte*    limit );\n\n    void\n    (*done)( AFM_Parser  parser );\n\n    FT_Error\n    (*parse)( AFM_Parser  parser );\n\n  } AFM_Parser_FuncsRec;\n\n\n  typedef struct AFM_StreamRec_*  AFM_Stream;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    AFM_ParserRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An AFM_Parser is a parser for the AFM files.                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory    :: The object used for memory operations (alloc and      */\n  /*                 realloc).                                             */\n  /*                                                                       */\n  /*    stream    :: This is an opaque object.                             */\n  /*                                                                       */\n  /*    FontInfo  :: The result will be stored here.                       */\n  /*                                                                       */\n  /*    get_index :: A user provided function to get a glyph index by its  */\n  /*                 name.                                                 */\n  /*                                                                       */\n  typedef struct  AFM_ParserRec_\n  {\n    FT_Memory     memory;\n    AFM_Stream    stream;\n\n    AFM_FontInfo  FontInfo;\n\n    FT_Int\n    (*get_index)( const char*  name,\n                  FT_Offset    len,\n                  void*        user_data );\n\n    void*         user_data;\n\n  } AFM_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     TYPE1 CHARMAPS                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct T1_CMap_ClassesRec_*  T1_CMap_Classes;\n\n  typedef struct T1_CMap_ClassesRec_\n  {\n    FT_CMap_Class  standard;\n    FT_CMap_Class  expert;\n    FT_CMap_Class  custom;\n    FT_CMap_Class  unicode;\n\n  } T1_CMap_ClassesRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        PSAux Module Interface                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  PSAux_ServiceRec_\n  {\n    /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */\n    const PS_Table_FuncsRec*    ps_table_funcs;\n    const PS_Parser_FuncsRec*   ps_parser_funcs;\n    const T1_Builder_FuncsRec*  t1_builder_funcs;\n    const T1_Decoder_FuncsRec*  t1_decoder_funcs;\n\n    void\n    (*t1_decrypt)( FT_Byte*   buffer,\n                   FT_Offset  length,\n                   FT_UShort  seed );\n\n    T1_CMap_Classes  t1_cmap_classes;\n\n    /* fields after this comment line were added after version 2.1.10 */\n    const AFM_Parser_FuncsRec*  afm_parser_funcs;\n\n  } PSAux_ServiceRec, *PSAux_Service;\n\n  /* backwards-compatible type definition */\n  typedef PSAux_ServiceRec   PSAux_Interface;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 Some convenience functions                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define IS_PS_NEWLINE( ch ) \\\n  ( (ch) == '\\r' ||         \\\n    (ch) == '\\n' )\n\n#define IS_PS_SPACE( ch )  \\\n  ( (ch) == ' '         || \\\n    IS_PS_NEWLINE( ch ) || \\\n    (ch) == '\\t'        || \\\n    (ch) == '\\f'        || \\\n    (ch) == '\\0' )\n\n#define IS_PS_SPECIAL( ch )       \\\n  ( (ch) == '/'                || \\\n    (ch) == '(' || (ch) == ')' || \\\n    (ch) == '<' || (ch) == '>' || \\\n    (ch) == '[' || (ch) == ']' || \\\n    (ch) == '{' || (ch) == '}' || \\\n    (ch) == '%'                )\n\n#define IS_PS_DELIM( ch )  \\\n  ( IS_PS_SPACE( ch )   || \\\n    IS_PS_SPECIAL( ch ) )\n\n#define IS_PS_DIGIT( ch )        \\\n  ( (ch) >= '0' && (ch) <= '9' )\n\n#define IS_PS_XDIGIT( ch )            \\\n  ( IS_PS_DIGIT( ch )              || \\\n    ( (ch) >= 'A' && (ch) <= 'F' ) || \\\n    ( (ch) >= 'a' && (ch) <= 'f' ) )\n\n#define IS_PS_BASE85( ch )       \\\n  ( (ch) >= '!' && (ch) <= 'u' )\n\n#define IS_PS_TOKEN( cur, limit, token )                                \\\n  ( (char)(cur)[0] == (token)[0]                                     && \\\n    ( (cur) + sizeof ( (token) ) == (limit) ||                          \\\n      ( (cur) + sizeof( (token) ) < (limit)          &&                 \\\n        IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) )             && \\\n    ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )\n\n\nFT_END_HEADER\n\n#endif /* __PSAUX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/pshints.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshints.h                                                              */\n/*                                                                         */\n/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */\n/*    recorders (specification only).  These are used to support native    */\n/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */\n/*                                                                         */\n/*  Copyright 2001-2003, 2005-2007, 2009, 2012 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHINTS_H__\n#define __PSHINTS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PSH_GlobalsRec_*  PSH_Globals;\n\n  typedef FT_Error\n  (*PSH_Globals_NewFunc)( FT_Memory     memory,\n                          T1_Private*   private_dict,\n                          PSH_Globals*  aglobals );\n\n  typedef FT_Error\n  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,\n                               FT_Fixed     x_scale,\n                               FT_Fixed     y_scale,\n                               FT_Fixed     x_delta,\n                               FT_Fixed     y_delta );\n\n  typedef void\n  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );\n\n\n  typedef struct  PSH_Globals_FuncsRec_\n  {\n    PSH_Globals_NewFunc       create;\n    PSH_Globals_SetScaleFunc  set_scale;\n    PSH_Globals_DestroyFunc   destroy;\n\n  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 1 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stem', `stem3', or `reset').  Note that these functions do\n   *     not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   PostScript hinter.\n   *\n   */\n  typedef struct T1_HintsRec_*  T1_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of\n   *   a given @T1_Hints object.\n   *\n   */\n  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to prepare it for a new Type 1\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T1_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T1_Hints_OpenFunc)( T1_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStemFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record a new horizontal or\n   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'\n   *   operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   coords ::\n   *     Array of 2 coordinates in 16.16 format, used as (position,length)\n   *     stem descriptor.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   `coords[0]' is the absolute stem position (lowest coordinate);\n   *   `coords[1]' is the length.\n   *\n   *   The length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   *   If the length is -21 (corresponding to a bottom ghost stem), then\n   *   the real stem position is `coords[0]+coords[1]'.\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStemFunc)( T1_Hints   hints,\n                           FT_UInt    dimension,\n                           FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStem3Func\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record three\n   *   counter-controlled horizontal or vertical stems at once.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems, 1 for vertical ones.\n   *\n   *   coords ::\n   *     An array of 6 values in 16.16 format, holding 3 (position,length)\n   *     pairs for the counter-controlled stems.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   The lengths cannot be negative (ghost stems are never\n   *   counter-controlled).\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStem3Func)( T1_Hints   hints,\n                            FT_UInt    dimension,\n                            FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ResetFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to reset the stems hints in a\n   *   recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph in which the\n   *     previously defined hints apply.\n   *\n   */\n  typedef void\n  (*T1_Hints_ResetFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_CloseFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called once all hints have been\n   *   recorded.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font as the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_ApplyFunc)( T1_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T1_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T1_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T1 Hints recorder.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stem ::\n   *     The function to set a simple stem.\n   *\n   *   stem3 ::\n   *     The function to set counter-controlled stems.\n   *\n   *   reset ::\n   *     The function to reset stem hints.\n   *\n   *   apply ::\n   *     The function to apply the hints to the corresponding glyph outline.\n   *\n   */\n  typedef struct  T1_Hints_FuncsRec_\n  {\n    T1_Hints               hints;\n    T1_Hints_OpenFunc      open;\n    T1_Hints_CloseFunc     close;\n    T1_Hints_SetStemFunc   stem;\n    T1_Hints_SetStem3Func  stem3;\n    T1_Hints_ResetFunc     reset;\n    T1_Hints_ApplyFunc     apply;\n\n  } T1_Hints_FuncsRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 2 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stems', `hintmask', `counters').  Note that these\n   *     functions do not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   Postscript hinter.\n   *\n   */\n  typedef struct T2_HintsRec_*  T2_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of\n   *   a given @T2_Hints object.\n   *\n   */\n  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to prepare it for a new Type 2\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T2_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T2_Hints_OpenFunc)( T2_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_StemsFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set the table of stems in\n   *   either the vertical or horizontal dimension.  Equivalent to the\n   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   count ::\n   *     The number of stems.\n   *\n   *   coords ::\n   *     An array of `count' (position,length) pairs in 16.16 format.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   There are `2*count' elements in the `coords' array.  Each even\n   *   element is an absolute position in font units, each odd element is a\n   *   length in font units.\n   *\n   *   A length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   */\n  typedef void\n  (*T2_Hints_StemsFunc)( T2_Hints   hints,\n                         FT_UInt    dimension,\n                         FT_UInt    count,\n                         FT_Fixed*  coordinates );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_MaskFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given hintmask (this\n   *   corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The glyph index of the last point to which the previously defined\n   *     or activated hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *   The `bytes' array can come directly from the Type 2 charstring and\n   *   respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_MaskFunc)( T2_Hints        hints,\n                        FT_UInt         end_point,\n                        FT_UInt         bit_count,\n                        const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CounterFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given counter mask\n   *   (this corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     A glyph index of the last point to which the previously defined or\n   *     active hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *    The `bytes' array can come directly from the Type 2 charstring and\n   *    respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_CounterFunc)( T2_Hints        hints,\n                           FT_UInt         bit_count,\n                           const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_CloseFunc)( T2_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called after the `close'\n   *   method.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font than the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_ApplyFunc)( T2_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T2_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T2_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T2 hints recorder object.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stems ::\n   *     The function to set the dimension's stems table.\n   *\n   *   hintmask ::\n   *     The function to set hint masks.\n   *\n   *   counter ::\n   *     The function to set counter masks.\n   *\n   *   apply ::\n   *     The function to apply the hints on the corresponding glyph outline.\n   *\n   */\n  typedef struct  T2_Hints_FuncsRec_\n  {\n    T2_Hints              hints;\n    T2_Hints_OpenFunc     open;\n    T2_Hints_CloseFunc    close;\n    T2_Hints_StemsFunc    stems;\n    T2_Hints_MaskFunc     hintmask;\n    T2_Hints_CounterFunc  counter;\n    T2_Hints_ApplyFunc    apply;\n\n  } T2_Hints_FuncsRec;\n\n\n  /* */\n\n\n  typedef struct  PSHinter_Interface_\n  {\n    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );\n    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );\n    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );\n\n  } PSHinter_Interface;\n\n  typedef PSHinter_Interface*  PSHinter_Service;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_PSHINTER_INTERFACE(        \\\n          class_,                            \\\n          get_globals_funcs_,                \\\n          get_t1_funcs_,                     \\\n          get_t2_funcs_ )                    \\\n  static const PSHinter_Interface  class_ =  \\\n  {                                          \\\n    get_globals_funcs_,                      \\\n    get_t1_funcs_,                           \\\n    get_t2_funcs_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_PSHINTER_INTERFACE(                      \\\n          class_,                                          \\\n          get_globals_funcs_,                              \\\n          get_t1_funcs_,                                   \\\n          get_t2_funcs_ )                                  \\\n  void                                                     \\\n  FT_Init_Class_ ## class_( FT_Library           library,  \\\n                            PSHinter_Interface*  clazz )   \\\n  {                                                        \\\n    FT_UNUSED( library );                                  \\\n                                                           \\\n    clazz->get_globals_funcs = get_globals_funcs_;         \\\n    clazz->get_t1_funcs      = get_t1_funcs_;              \\\n    clazz->get_t2_funcs      = get_t2_funcs_;              \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __PSHINTS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svbdf.h                                                                */\n/*                                                                         */\n/*    The FreeType BDF services (specification).                           */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVBDF_H__\n#define __SVBDF_H__\n\n#include FT_BDF_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_BDF  \"bdf\"\n\n  typedef FT_Error\n  (*FT_BDF_GetCharsetIdFunc)( FT_Face       face,\n                              const char*  *acharset_encoding,\n                              const char*  *acharset_registry );\n\n  typedef FT_Error\n  (*FT_BDF_GetPropertyFunc)( FT_Face           face,\n                             const char*       prop_name,\n                             BDF_PropertyRec  *aproperty );\n\n\n  FT_DEFINE_SERVICE( BDF )\n  {\n    FT_BDF_GetCharsetIdFunc  get_charset_id;\n    FT_BDF_GetPropertyFunc   get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  static const FT_Service_BDFRec  class_ =                               \\\n  {                                                                      \\\n    get_charset_id_, get_property_                                       \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  void                                                                   \\\n  FT_Init_Class_ ## class_( FT_Service_BDFRec*  clazz )                  \\\n  {                                                                      \\\n    clazz->get_charset_id = get_charset_id_;                             \\\n    clazz->get_property   = get_property_;                               \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svcid.h                                                                */\n/*                                                                         */\n/*    The FreeType CID font services (specification).                      */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal.            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVCID_H__\n#define __SVCID_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_CID  \"CID\"\n\n  typedef FT_Error\n  (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face       face,\n                                               const char*  *registry,\n                                               const char*  *ordering,\n                                               FT_Int       *supplement );\n  typedef FT_Error\n  (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face   face,\n                                         FT_Bool  *is_cid );\n  typedef FT_Error\n  (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face   face,\n                                      FT_UInt   glyph_index,\n                                      FT_UInt  *cid );\n\n  FT_DEFINE_SERVICE( CID )\n  {\n    FT_CID_GetRegistryOrderingSupplementFunc  get_ros;\n    FT_CID_GetIsInternallyCIDKeyedFunc        get_is_cid;\n    FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  static const FT_Service_CIDRec class_ =                                   \\\n  {                                                                         \\\n    get_ros_, get_is_cid_, get_cid_from_glyph_index_                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library          library,                    \\\n                            FT_Service_CIDRec*  clazz )                     \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->get_ros                  = get_ros_;                             \\\n    clazz->get_is_cid               = get_is_cid_;                          \\\n    clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svgldict.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgldict.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph dictionary services (specification).              */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGLDICT_H__\n#define __SVGLDICT_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to retrieve glyph names, as well as to find the\n   *  index of a given glyph name in a font.\n   *\n   */\n\n#define FT_SERVICE_ID_GLYPH_DICT  \"glyph-dict\"\n\n\n  typedef FT_Error\n  (*FT_GlyphDict_GetNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_GlyphDict_NameIndexFunc)( FT_Face     face,\n                                 FT_String*  glyph_name );\n\n\n  FT_DEFINE_SERVICE( GlyphDict )\n  {\n    FT_GlyphDict_GetNameFunc    get_name;\n    FT_GlyphDict_NameIndexFunc  name_index;  /* optional */\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  static const FT_Service_GlyphDictRec  class_ =                       \\\n  {                                                                    \\\n    get_name_, name_index_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  void                                                                 \\\n  FT_Init_Class_ ## class_( FT_Library                library,         \\\n                            FT_Service_GlyphDictRec*  clazz )          \\\n  {                                                                    \\\n    FT_UNUSED( library );                                              \\\n                                                                       \\\n    clazz->get_name   = get_name_;                                     \\\n    clazz->name_index = name_index_;                                   \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGLDICT_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005 by                                                */\n/*  Masatake YAMATO, Red Hat K.K.,                                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGXVAL_H__\n#define __SVGXVAL_H__\n\n#include FT_GX_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_GX_VALIDATE           \"truetypegx-validate\"\n#define FT_SERVICE_ID_CLASSICKERN_VALIDATE  \"classickern-validate\"\n\n  typedef FT_Error\n  (*gxv_validate_func)( FT_Face   face,\n                        FT_UInt   gx_flags,\n                        FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                        FT_UInt   table_length );\n\n\n  typedef FT_Error\n  (*ckern_validate_func)( FT_Face   face,\n                          FT_UInt   ckern_flags,\n                          FT_Bytes  *ckern_table );\n\n\n  FT_DEFINE_SERVICE( GXvalidate )\n  {\n    gxv_validate_func  validate;\n  };\n\n  FT_DEFINE_SERVICE( CKERNvalidate )\n  {\n    ckern_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svkern.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svkern.h                                                               */\n/*                                                                         */\n/*    The FreeType Kerning service (specification).                        */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVKERN_H__\n#define __SVKERN_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n#define FT_SERVICE_ID_KERNING  \"kerning\"\n\n\n  typedef FT_Error\n  (*FT_Kerning_TrackGetFunc)( FT_Face    face,\n                              FT_Fixed   point_size,\n                              FT_Int     degree,\n                              FT_Fixed*  akerning );\n\n  FT_DEFINE_SERVICE( Kerning )\n  {\n    FT_Kerning_TrackGetFunc  get_track;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVKERN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svmm.h                                                                 */\n/*                                                                         */\n/*    The FreeType Multiple Masters and GX var services (specification).   */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVMM_H__\n#define __SVMM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to manage multiple-masters data in a given face.\n   *\n   *  See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).\n   *\n   */\n\n#define FT_SERVICE_ID_MULTI_MASTERS  \"multi-masters\"\n\n\n  typedef FT_Error\n  (*FT_Get_MM_Func)( FT_Face           face,\n                     FT_Multi_Master*  master );\n\n  typedef FT_Error\n  (*FT_Get_MM_Var_Func)( FT_Face      face,\n                         FT_MM_Var*  *master );\n\n  typedef FT_Error\n  (*FT_Set_MM_Design_Func)( FT_Face   face,\n                            FT_UInt   num_coords,\n                            FT_Long*  coords );\n\n  typedef FT_Error\n  (*FT_Set_Var_Design_Func)( FT_Face    face,\n                             FT_UInt    num_coords,\n                             FT_Fixed*  coords );\n\n  typedef FT_Error\n  (*FT_Set_MM_Blend_Func)( FT_Face   face,\n                           FT_UInt   num_coords,\n                           FT_Long*  coords );\n\n\n  FT_DEFINE_SERVICE( MultiMasters )\n  {\n    FT_Get_MM_Func          get_mm;\n    FT_Set_MM_Design_Func   set_mm_design;\n    FT_Set_MM_Blend_Func    set_mm_blend;\n    FT_Get_MM_Var_Func      get_mm_var;\n    FT_Set_Var_Design_Func  set_var_design;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  static const FT_Service_MultiMastersRec  class_ =                         \\\n  {                                                                         \\\n    get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_    \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Service_MultiMastersRec*  clazz )            \\\n  {                                                                         \\\n    clazz->get_mm         = get_mm_;                                        \\\n    clazz->set_mm_design  = set_mm_design_;                                 \\\n    clazz->set_mm_blend   = set_mm_blend_;                                  \\\n    clazz->get_mm_var     = get_mm_var_;                                    \\\n    clazz->set_var_design = set_var_design_;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svotval.h                                                              */\n/*                                                                         */\n/*    The FreeType OpenType validation service (specification).            */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVOTVAL_H__\n#define __SVOTVAL_H__\n\n#include FT_OPENTYPE_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_OPENTYPE_VALIDATE  \"opentype-validate\"\n\n\n  typedef FT_Error\n  (*otv_validate_func)( FT_Face volatile  face,\n                        FT_UInt           ot_flags,\n                        FT_Bytes         *base,\n                        FT_Bytes         *gdef,\n                        FT_Bytes         *gpos,\n                        FT_Bytes         *gsub,\n                        FT_Bytes         *jstf );\n\n\n  FT_DEFINE_SERVICE( OTvalidate )\n  {\n    otv_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpfr.h                                                                */\n/*                                                                         */\n/*    Internal PFR service functions (specification).                      */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPFR_H__\n#define __SVPFR_H__\n\n#include FT_PFR_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PFR_METRICS  \"pfr-metrics\"\n\n\n  typedef FT_Error\n  (*FT_PFR_GetMetricsFunc)( FT_Face    face,\n                            FT_UInt   *aoutline,\n                            FT_UInt   *ametrics,\n                            FT_Fixed  *ax_scale,\n                            FT_Fixed  *ay_scale );\n\n  typedef FT_Error\n  (*FT_PFR_GetKerningFunc)( FT_Face     face,\n                            FT_UInt     left,\n                            FT_UInt     right,\n                            FT_Vector  *avector );\n\n  typedef FT_Error\n  (*FT_PFR_GetAdvanceFunc)( FT_Face   face,\n                            FT_UInt   gindex,\n                            FT_Pos   *aadvance );\n\n\n  FT_DEFINE_SERVICE( PfrMetrics )\n  {\n    FT_PFR_GetMetricsFunc  get_metrics;\n    FT_PFR_GetKerningFunc  get_kerning;\n    FT_PFR_GetAdvanceFunc  get_advance;\n\n  };\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __SVPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svpostnm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpostnm.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript name services (specification).               */\n/*                                                                         */\n/*  Copyright 2003, 2007, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPOSTNM_H__\n#define __SVPOSTNM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n  /*\n   *  A trivial service used to retrieve the PostScript name of a given\n   *  font when available.  The `get_name' field should never be NULL.\n   *\n   *  The corresponding function can return NULL to indicate that the\n   *  PostScript name is not available.\n   *\n   *  The name is owned by the face and will be destroyed with it.\n   */\n\n#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME  \"postscript-font-name\"\n\n\n  typedef const char*\n  (*FT_PsName_GetFunc)( FT_Face  face );\n\n\n  FT_DEFINE_SERVICE( PsFontName )\n  {\n    FT_PsName_GetFunc  get_ps_font_name;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  static const FT_Service_PsFontNameRec  class_ =                    \\\n  {                                                                  \\\n    get_ps_font_name_                                                \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  void                                                               \\\n  FT_Init_Class_ ## class_( FT_Library                 library,      \\\n                            FT_Service_PsFontNameRec*  clazz )       \\\n  {                                                                  \\\n    FT_UNUSED( library );                                            \\\n                                                                     \\\n    clazz->get_ps_font_name = get_ps_font_name_;                     \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPOSTNM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svprop.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svprop.h                                                               */\n/*                                                                         */\n/*    The FreeType property service (specification).                       */\n/*                                                                         */\n/*  Copyright 2012 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPROP_H__\n#define __SVPROP_H__\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PROPERTIES  \"properties\"\n\n\n  typedef FT_Error\n  (*FT_Properties_SetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            const void*  value );\n\n  typedef FT_Error\n  (*FT_Properties_GetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            void*        value );\n\n\n  FT_DEFINE_SERVICE( Properties )\n  {\n    FT_Properties_SetFunc  set_property;\n    FT_Properties_GetFunc  get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,          \\\n                                         set_property_,   \\\n                                         get_property_ )  \\\n  static const FT_Service_PropertiesRec  class_ =         \\\n  {                                                       \\\n    set_property_,                                        \\\n    get_property_                                         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,                \\\n                                         set_property_,         \\\n                                         get_property_ )        \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Service_PropertiesRec*  clazz )  \\\n  {                                                             \\\n    clazz->set_property = set_property_;                        \\\n    clazz->get_property = get_property_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPROP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svpscmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpscmap.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript charmap service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2006, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSCMAP_H__\n#define __SVPSCMAP_H__\n\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_CMAPS  \"postscript-cmaps\"\n\n\n  /*\n   *  Adobe glyph name to unicode value.\n   */\n  typedef FT_UInt32\n  (*PS_Unicode_ValueFunc)( const char*  glyph_name );\n\n  /*\n   *  Macintosh name id to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Macintosh_NameFunc)( FT_UInt  name_index );\n\n  /*\n   *  Adobe standard string ID to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );\n\n\n  /*\n   *  Simple unicode -> glyph index charmap built from font glyph names\n   *  table.\n   */\n  typedef struct  PS_UniMap_\n  {\n    FT_UInt32  unicode;      /* bit 31 set: is glyph variant */\n    FT_UInt    glyph_index;\n\n  } PS_UniMap;\n\n\n  typedef struct PS_UnicodesRec_*  PS_Unicodes;\n\n  typedef struct  PS_UnicodesRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt     num_maps;\n    PS_UniMap*  maps;\n\n  } PS_UnicodesRec;\n\n\n  /*\n   *  A function which returns a glyph name for a given index.  Returns\n   *  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_GetGlyphNameFunc)( FT_Pointer  data,\n                          FT_UInt     string_index );\n\n  /*\n   *  A function used to release the glyph name returned by\n   *  PS_GetGlyphNameFunc, when needed\n   */\n  typedef void\n  (*PS_FreeGlyphNameFunc)( FT_Pointer  data,\n                           const char*  name );\n\n  typedef FT_Error\n  (*PS_Unicodes_InitFunc)( FT_Memory             memory,\n                           PS_Unicodes           unicodes,\n                           FT_UInt               num_glyphs,\n                           PS_GetGlyphNameFunc   get_glyph_name,\n                           PS_FreeGlyphNameFunc  free_glyph_name,\n                           FT_Pointer            glyph_data );\n\n  typedef FT_UInt\n  (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,\n                                FT_UInt32    unicode );\n\n  typedef FT_UInt32\n  (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,\n                               FT_UInt32   *unicode );\n\n\n  FT_DEFINE_SERVICE( PsCMaps )\n  {\n    PS_Unicode_ValueFunc       unicode_value;\n\n    PS_Unicodes_InitFunc       unicodes_init;\n    PS_Unicodes_CharIndexFunc  unicodes_char_index;\n    PS_Unicodes_CharNextFunc   unicodes_char_next;\n\n    PS_Macintosh_NameFunc      macintosh_name;\n    PS_Adobe_Std_StringsFunc   adobe_std_strings;\n    const unsigned short*      adobe_std_encoding;\n    const unsigned short*      adobe_expert_encoding;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  static const FT_Service_PsCMapsRec  class_ =                              \\\n  {                                                                         \\\n    unicode_value_, unicodes_init_,                                         \\\n    unicodes_char_index_, unicodes_char_next_, macintosh_name_,             \\\n    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library              library,                \\\n                            FT_Service_PsCMapsRec*  clazz )                 \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->unicode_value         = unicode_value_;                          \\\n    clazz->unicodes_init         = unicodes_init_;                          \\\n    clazz->unicodes_char_index   = unicodes_char_index_;                    \\\n    clazz->unicodes_char_next    = unicodes_char_next_;                     \\\n    clazz->macintosh_name        = macintosh_name_;                         \\\n    clazz->adobe_std_strings     = adobe_std_strings_;                      \\\n    clazz->adobe_std_encoding    = adobe_std_encoding_;                     \\\n    clazz->adobe_expert_encoding = adobe_expert_encoding_;                  \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svpsinfo.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpsinfo.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript info service (specification).                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2011, 2012 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSINFO_H__\n#define __SVPSINFO_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_INFO  \"postscript-info\"\n\n\n  typedef FT_Error\n  (*PS_GetFontInfoFunc)( FT_Face          face,\n                         PS_FontInfoRec*  afont_info );\n\n  typedef FT_Error\n  (*PS_GetFontExtraFunc)( FT_Face           face,\n                          PS_FontExtraRec*  afont_extra );\n\n  typedef FT_Int\n  (*PS_HasGlyphNamesFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*PS_GetFontPrivateFunc)( FT_Face         face,\n                            PS_PrivateRec*  afont_private );\n\n  typedef FT_Long\n  (*PS_GetFontValueFunc)( FT_Face       face,\n                          PS_Dict_Keys  key,\n                          FT_UInt       idx,\n                          void         *value,\n                          FT_Long       value_len );\n\n\n  FT_DEFINE_SERVICE( PsInfo )\n  {\n    PS_GetFontInfoFunc     ps_get_font_info;\n    PS_GetFontExtraFunc    ps_get_font_extra;\n    PS_HasGlyphNamesFunc   ps_has_glyph_names;\n    PS_GetFontPrivateFunc  ps_get_font_private;\n    PS_GetFontValueFunc    ps_get_font_value;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  static const FT_Service_PsInfoRec  class_ =                    \\\n  {                                                              \\\n    get_font_info_, ps_get_font_extra_, has_glyph_names_,        \\\n    get_font_private_, get_font_value_                           \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  void                                                           \\\n  FT_Init_Class_ ## class_( FT_Library             library,      \\\n                            FT_Service_PsInfoRec*  clazz )       \\\n  {                                                              \\\n    FT_UNUSED( library );                                        \\\n                                                                 \\\n    clazz->ps_get_font_info    = get_font_info_;                 \\\n    clazz->ps_get_font_extra   = ps_get_font_extra_;             \\\n    clazz->ps_has_glyph_names  = has_glyph_names_;               \\\n    clazz->ps_get_font_private = get_font_private_;              \\\n    clazz->ps_get_font_value   = get_font_value_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSINFO_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svsfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svsfnt.h                                                               */\n/*                                                                         */\n/*    The FreeType SFNT table loading service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVSFNT_H__\n#define __SVSFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_SFNT_TABLE  \"sfnt-table\"\n\n\n  /*\n   * Used to implement FT_Load_Sfnt_Table().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableLoadFunc)( FT_Face    face,\n                            FT_ULong   tag,\n                            FT_Long    offset,\n                            FT_Byte*   buffer,\n                            FT_ULong*  length );\n\n  /*\n   * Used to implement FT_Get_Sfnt_Table().\n   */\n  typedef void*\n  (*FT_SFNT_TableGetFunc)( FT_Face      face,\n                           FT_Sfnt_Tag  tag );\n\n\n  /*\n   * Used to implement FT_Sfnt_Table_Info().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableInfoFunc)( FT_Face    face,\n                            FT_UInt    idx,\n                            FT_ULong  *tag,\n                            FT_ULong  *offset,\n                            FT_ULong  *length );\n\n\n  FT_DEFINE_SERVICE( SFNT_Table )\n  {\n    FT_SFNT_TableLoadFunc  load_table;\n    FT_SFNT_TableGetFunc   get_table;\n    FT_SFNT_TableInfoFunc  table_info;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ )  \\\n  static const FT_Service_SFNT_TableRec  class_ =                      \\\n  {                                                                    \\\n    load_, get_, info_                                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \\\n  void                                                                \\\n  FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec*  clazz )        \\\n  {                                                                   \\\n    clazz->load_table = load_;                                        \\\n    clazz->get_table  = get_;                                         \\\n    clazz->table_info = info_;                                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVSFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svttcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttcmap.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType/sfnt cmap extra information service.           */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  Masatake YAMATO, Redhat K.K.                                           */\n/*                                                                         */\n/*  Copyright 2003, 2008, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/* Development of this service is support of\n   Information-technology Promotion Agency, Japan. */\n\n#ifndef __SVTTCMAP_H__\n#define __SVTTCMAP_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_CMAP  \"tt-cmaps\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_CMapInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to store TrueType/sfnt specific cmap information  */\n  /*    which is not covered by the generic @FT_CharMap structure.  This   */\n  /*    structure can be accessed with the @FT_Get_TT_CMap_Info function.  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    language ::                                                        */\n  /*      The language ID used in Mac fonts.  Definitions of values are in */\n  /*      freetype/ttnameid.h.                                             */\n  /*                                                                       */\n  /*    format ::                                                          */\n  /*      The cmap format.  OpenType 1.5 defines the formats 0 (byte       */\n  /*      encoding table), 2~(high-byte mapping through table), 4~(segment */\n  /*      mapping to delta values), 6~(trimmed table mapping), 8~(mixed    */\n  /*      16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented   */\n  /*      coverage), and 14 (Unicode Variation Sequences).                 */\n  /*                                                                       */\n  typedef struct  TT_CMapInfo_\n  {\n    FT_ULong  language;\n    FT_Long   format;\n\n  } TT_CMapInfo;\n\n\n  typedef FT_Error\n  (*TT_CMap_Info_GetFunc)( FT_CharMap    charmap,\n                           TT_CMapInfo  *cmap_info );\n\n\n  FT_DEFINE_SERVICE( TTCMaps )\n  {\n    TT_CMap_Info_GetFunc  get_cmap_info;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  static const FT_Service_TTCMapsRec  class_ =                  \\\n  {                                                             \\\n    get_cmap_info_                                              \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Library              library,    \\\n                            FT_Service_TTCMapsRec*  clazz )     \\\n  {                                                             \\\n    FT_UNUSED( library );                                       \\\n                                                                \\\n    clazz->get_cmap_info = get_cmap_info_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svtteng.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svtteng.h                                                              */\n/*                                                                         */\n/*    The FreeType TrueType engine query service (specification).          */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVTTENG_H__\n#define __SVTTENG_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_TRUETYPE_ENGINE  \"truetype-engine\"\n\n  /*\n   * Used to implement FT_Get_TrueType_Engine_Type\n   */\n\n  FT_DEFINE_SERVICE( TrueTypeEngine )\n  {\n    FT_TrueTypeEngineType  engine_type;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVTTENG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svttglyf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttglyf.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType glyph service.                                 */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by David Turner.                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __SVTTGLYF_H__\n#define __SVTTGLYF_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_GLYF  \"tt-glyf\"\n\n\n  typedef FT_ULong\n  (*TT_Glyf_GetLocationFunc)( FT_Face    face,\n                              FT_UInt    gindex,\n                              FT_ULong  *psize );\n\n  FT_DEFINE_SERVICE( TTGlyf )\n  {\n    TT_Glyf_GetLocationFunc  get_location;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  static const FT_Service_TTGlyfRec  class_ =                 \\\n  {                                                           \\\n    get_location_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  void                                                        \\\n  FT_Init_Class_ ## class_( FT_Service_TTGlyfRec*  clazz )    \\\n  {                                                           \\\n    clazz->get_location = get_location_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTGLYF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svwinfnt.h                                                             */\n/*                                                                         */\n/*    The FreeType Windows FNT/FONT service (specification).               */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVWINFNT_H__\n#define __SVWINFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_WINFONTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_WINFNT  \"winfonts\"\n\n  typedef FT_Error\n  (*FT_WinFnt_GetHeaderFunc)( FT_Face               face,\n                              FT_WinFNT_HeaderRec  *aheader );\n\n\n  FT_DEFINE_SERVICE( WinFnt )\n  {\n    FT_WinFnt_GetHeaderFunc  get_header;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVWINFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/services/svxf86nm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svxf86nm.h                                                             */\n/*                                                                         */\n/*    The FreeType XFree86 services (specification only).                  */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVXF86NM_H__\n#define __SVXF86NM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A trivial service used to return the name of a face's font driver,\n   *  according to the XFree86 nomenclature.  Note that the service data\n   *  is a simple constant string pointer.\n   */\n\n#define FT_SERVICE_ID_XF86_NAME  \"xf86-driver-name\"\n\n#define FT_XF86_FORMAT_TRUETYPE  \"TrueType\"\n#define FT_XF86_FORMAT_TYPE_1    \"Type 1\"\n#define FT_XF86_FORMAT_BDF       \"BDF\"\n#define FT_XF86_FORMAT_PCF       \"PCF\"\n#define FT_XF86_FORMAT_TYPE_42   \"Type 42\"\n#define FT_XF86_FORMAT_CID       \"CID Type 1\"\n#define FT_XF86_FORMAT_CFF       \"CFF\"\n#define FT_XF86_FORMAT_PFR       \"PFR\"\n#define FT_XF86_FORMAT_WINFNT    \"Windows FNT\"\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVXF86NM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/sfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfnt.h                                                                 */\n/*                                                                         */\n/*    High-level `sfnt' driver interface (specification).                  */\n/*                                                                         */\n/*  Copyright 1996-2006, 2009, 2012-2013 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFNT_H__\n#define __SFNT_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Init_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    First part of the SFNT face object initialization.  This finds     */\n  /*    the face in a SFNT file or collection, and load its format tag in  */\n  /*    face->format_tag.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  /*    This function recognizes fonts embedded in a `TrueType             */\n  /*    collection'.                                                       */\n  /*                                                                       */\n  /*    Once the format tag has been validated by the font driver, it      */\n  /*    should then call the TT_Load_Face_Func() callback to read the rest */\n  /*    of the SFNT tables in the object.                                  */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Init_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Second part of the SFNT face object initialization.  This loads    */\n  /*    the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function must be called after TT_Init_Face_Func().            */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Done_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A callback used to delete the common SFNT data from a face.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT destroy the face object.                    */\n  /*                                                                       */\n  typedef void\n  (*TT_Done_Face_Func)( TT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Any_Func                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load any font table into client memory.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: The face object to look for.                             */\n  /*                                                                       */\n  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */\n  /*              to access the whole font file, else set this parameter   */\n  /*              to a valid TrueType table tag that you can forge with    */\n  /*              the MAKE_TT_TAG macro.                                   */\n  /*                                                                       */\n  /*    offset :: The starting offset in the table (or the file if         */\n  /*              tag == 0).                                               */\n  /*                                                                       */\n  /*    length :: The address of the decision variable:                    */\n  /*                                                                       */\n  /*                If length == NULL:                                     */\n  /*                  Loads the whole table.  Returns an error if          */\n  /*                  `offset' == 0!                                       */\n  /*                                                                       */\n  /*                If *length == 0:                                       */\n  /*                  Exits immediately; returning the length of the given */\n  /*                  table or of the font file, depending on the value of */\n  /*                  `tag'.                                               */\n  /*                                                                       */\n  /*                If *length != 0:                                       */\n  /*                  Loads the next `length' bytes of table or font,      */\n  /*                  starting at offset `offset' (in table or font too).  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer :: The address of target buffer.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    TrueType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Any_Func)( TT_Face    face,\n                       FT_ULong   tag,\n                       FT_Long    offset,\n                       FT_Byte   *buffer,\n                       FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Find_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether an embedded bitmap (an `sbit') exists for a given    */\n  /*    glyph, at a given strike.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    glyph_index   :: The glyph index.                                  */\n  /*                                                                       */\n  /*    strike_index  :: The current strike index.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    arange        :: The SBit range containing the glyph index.        */\n  /*                                                                       */\n  /*    astrike       :: The SBit strike containing the glyph index.       */\n  /*                                                                       */\n  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns                    */\n  /*    SFNT_Err_Invalid_Argument if no sbit exists for the requested      */\n  /*    glyph.                                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Find_SBit_Image_Func)( TT_Face          face,\n                              FT_UInt          glyph_index,\n                              FT_ULong         strike_index,\n                              TT_SBit_Range   *arange,\n                              TT_SBit_Strike  *astrike,\n                              FT_ULong        *aglyph_offset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Metrics_Func                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the big metrics for a given embedded bitmap.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream      :: The input stream.                                   */\n  /*                                                                       */\n  /*    range       :: The SBit range containing the glyph.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    big_metrics :: A big SBit metrics structure for the glyph.         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be positioned at the glyph's offset within  */\n  /*    the `EBDT' table before the call.                                  */\n  /*                                                                       */\n  /*    If the image format uses variable metrics, the stream cursor is    */\n  /*    positioned just after the metrics header in the `EBDT' table on    */\n  /*    function exit.                                                     */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Metrics_Func)( FT_Stream        stream,\n                                TT_SBit_Range    range,\n                                TT_SBit_Metrics  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given glyph sbit image from the font resource.  This also   */\n  /*    returns its metrics.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      The target face object.                                          */\n  /*                                                                       */\n  /*    strike_index ::                                                    */\n  /*      The strike index.                                                */\n  /*                                                                       */\n  /*    glyph_index ::                                                     */\n  /*      The current glyph index.                                         */\n  /*                                                                       */\n  /*    load_flags ::                                                      */\n  /*      The current load flags.                                          */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      The input stream.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amap ::                                                            */\n  /*      The target pixmap.                                               */\n  /*                                                                       */\n  /*    ametrics ::                                                        */\n  /*      A big sbit metrics structure for the glyph image.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    glyph sbit exists for the index.                                   */\n  /*                                                                       */\n  /*  <Note>                                                               */\n  /*    The `map.buffer' field is always freed before the glyph is loaded. */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Image_Func)( TT_Face              face,\n                              FT_ULong             strike_index,\n                              FT_UInt              glyph_index,\n                              FT_UInt              load_flags,\n                              FT_Stream            stream,\n                              FT_Bitmap           *amap,\n                              TT_SBit_MetricsRec  *ametrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Set_SBit_Strike_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select an sbit strike for a given size request.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    req           :: The size request.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    astrike_index :: The index of the sbit strike.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    sbit strike exists for the selected ppem values.                   */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Set_SBit_Strike_Func)( TT_Face          face,\n                              FT_Size_Request  req,\n                              FT_ULong*        astrike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Strike_Metrics_Func                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the metrics of a given strike.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    strike_index  :: The strike index.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    metrics       :: the metrics of the strike.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    such sbit strike exists.                                           */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Strike_Metrics_Func)( TT_Face           face,\n                                  FT_ULong          strike_index,\n                                  FT_Size_Metrics*  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_PS_Name_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the PostScript glyph name of a glyph.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    idx  :: The glyph index.                                           */\n  /*                                                                       */\n  /*    PSname :: The address of a string pointer.  Will be NULL in case   */\n  /*              of error, otherwise it is a pointer to the glyph name.   */\n  /*                                                                       */\n  /*              You must not modify the returned string!                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_PS_Name_Func)( TT_Face      face,\n                          FT_UInt      idx,\n                          FT_String**  PSname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Metrics_Func                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a metrics table, which is a table with a horizontal and a     */\n  /*    vertical version.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load the vertical one.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Metrics_Func)( TT_Face    face,\n                           FT_Stream  stream,\n                           FT_Bool    vertical );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_Metrics_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the horizontal or vertical header in a face object.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load vertical metrics.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_Metrics_Func)( TT_Face     face,\n                          FT_Bool     vertical,\n                          FT_UInt     gindex,\n                          FT_Short*   abearing,\n                          FT_UShort*  aadvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The function uses `face->goto_table' to seek the stream to the     */\n  /*    start of the table, except while loading the font directory.       */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Table_Func)( TT_Face    face,\n                         FT_Stream  stream );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Free_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Free a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  typedef void\n  (*TT_Free_Table_Func)( TT_Face  face );\n\n\n  /*\n   * @functype:\n   *    TT_Face_GetKerningFunc\n   *\n   * @description:\n   *    Return the horizontal kerning value between two glyphs.\n   *\n   * @input:\n   *    face        :: A handle to the source face object.\n   *    left_glyph  :: The left glyph index.\n   *    right_glyph :: The right glyph index.\n   *\n   * @return:\n   *    The kerning value in font units.\n   */\n  typedef FT_Int\n  (*TT_Face_GetKerningFunc)( TT_Face  face,\n                             FT_UInt  left_glyph,\n                             FT_UInt  right_glyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_Interface                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure holds pointers to the functions used to load and    */\n  /*    free the basic tables that are required in a `sfnt' font file.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Check the various xxx_Func() descriptions for details.             */\n  /*                                                                       */\n  typedef struct  SFNT_Interface_\n  {\n    TT_Loader_GotoTableFunc      goto_table;\n\n    TT_Init_Face_Func            init_face;\n    TT_Load_Face_Func            load_face;\n    TT_Done_Face_Func            done_face;\n    FT_Module_Requester          get_interface;\n\n    TT_Load_Any_Func             load_any;\n\n    /* these functions are called by `load_face' but they can also  */\n    /* be called from external modules, if there is a need to do so */\n    TT_Load_Table_Func           load_head;\n    TT_Load_Metrics_Func         load_hhea;\n    TT_Load_Table_Func           load_cmap;\n    TT_Load_Table_Func           load_maxp;\n    TT_Load_Table_Func           load_os2;\n    TT_Load_Table_Func           load_post;\n\n    TT_Load_Table_Func           load_name;\n    TT_Free_Table_Func           free_name;\n\n    /* this field was called `load_kerning' up to version 2.1.10 */\n    TT_Load_Table_Func           load_kern;\n\n    TT_Load_Table_Func           load_gasp;\n    TT_Load_Table_Func           load_pclt;\n\n    /* see `ttload.h'; this field was called `load_bitmap_header' up to */\n    /* version 2.1.10                                                   */\n    TT_Load_Table_Func           load_bhed;\n\n    TT_Load_SBit_Image_Func      load_sbit_image;\n\n    /* see `ttpost.h' */\n    TT_Get_PS_Name_Func          get_psname;\n    TT_Free_Table_Func           free_psnames;\n\n    /* starting here, the structure differs from version 2.1.7 */\n\n    /* this field was introduced in version 2.1.8, named `get_psname' */\n    TT_Face_GetKerningFunc       get_kerning;\n\n    /* new elements introduced after version 2.1.10 */\n\n    /* load the font directory, i.e., the offset table and */\n    /* the table directory                                 */\n    TT_Load_Table_Func           load_font_dir;\n    TT_Load_Metrics_Func         load_hmtx;\n\n    TT_Load_Table_Func           load_eblc;\n    TT_Free_Table_Func           free_eblc;\n\n    TT_Set_SBit_Strike_Func      set_sbit_strike;\n    TT_Load_Strike_Metrics_Func  load_strike_metrics;\n\n    TT_Get_Metrics_Func          get_metrics;\n\n  } SFNT_Interface;\n\n\n  /* transitional */\n  typedef SFNT_Interface*   SFNT_Service;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SFNT_INTERFACE(        \\\n          class_,                        \\\n          goto_table_,                   \\\n          init_face_,                    \\\n          load_face_,                    \\\n          done_face_,                    \\\n          get_interface_,                \\\n          load_any_,                     \\\n          load_head_,                    \\\n          load_hhea_,                    \\\n          load_cmap_,                    \\\n          load_maxp_,                    \\\n          load_os2_,                     \\\n          load_post_,                    \\\n          load_name_,                    \\\n          free_name_,                    \\\n          load_kern_,                    \\\n          load_gasp_,                    \\\n          load_pclt_,                    \\\n          load_bhed_,                    \\\n          load_sbit_image_,              \\\n          get_psname_,                   \\\n          free_psnames_,                 \\\n          get_kerning_,                  \\\n          load_font_dir_,                \\\n          load_hmtx_,                    \\\n          load_eblc_,                    \\\n          free_eblc_,                    \\\n          set_sbit_strike_,              \\\n          load_strike_metrics_,          \\\n          get_metrics_ )                 \\\n  static const SFNT_Interface  class_ =  \\\n  {                                      \\\n    goto_table_,                         \\\n    init_face_,                          \\\n    load_face_,                          \\\n    done_face_,                          \\\n    get_interface_,                      \\\n    load_any_,                           \\\n    load_head_,                          \\\n    load_hhea_,                          \\\n    load_cmap_,                          \\\n    load_maxp_,                          \\\n    load_os2_,                           \\\n    load_post_,                          \\\n    load_name_,                          \\\n    free_name_,                          \\\n    load_kern_,                          \\\n    load_gasp_,                          \\\n    load_pclt_,                          \\\n    load_bhed_,                          \\\n    load_sbit_image_,                    \\\n    get_psname_,                         \\\n    free_psnames_,                       \\\n    get_kerning_,                        \\\n    load_font_dir_,                      \\\n    load_hmtx_,                          \\\n    load_eblc_,                          \\\n    free_eblc_,                          \\\n    set_sbit_strike_,                    \\\n    load_strike_metrics_,                \\\n    get_metrics_,                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_INTERNAL( a, a_ )  \\\n          clazz->a = a_;\n\n#define FT_DEFINE_SFNT_INTERFACE(                       \\\n          class_,                                       \\\n          goto_table_,                                  \\\n          init_face_,                                   \\\n          load_face_,                                   \\\n          done_face_,                                   \\\n          get_interface_,                               \\\n          load_any_,                                    \\\n          load_head_,                                   \\\n          load_hhea_,                                   \\\n          load_cmap_,                                   \\\n          load_maxp_,                                   \\\n          load_os2_,                                    \\\n          load_post_,                                   \\\n          load_name_,                                   \\\n          free_name_,                                   \\\n          load_kern_,                                   \\\n          load_gasp_,                                   \\\n          load_pclt_,                                   \\\n          load_bhed_,                                   \\\n          load_sbit_image_,                             \\\n          get_psname_,                                  \\\n          free_psnames_,                                \\\n          get_kerning_,                                 \\\n          load_font_dir_,                               \\\n          load_hmtx_,                                   \\\n          load_eblc_,                                   \\\n          free_eblc_,                                   \\\n          set_sbit_strike_,                             \\\n          load_strike_metrics_,                         \\\n          get_metrics_ )                                \\\n  void                                                  \\\n  FT_Init_Class_ ## class_( FT_Library       library,   \\\n                            SFNT_Interface*  clazz )    \\\n  {                                                     \\\n    FT_UNUSED( library );                               \\\n                                                        \\\n    clazz->goto_table          = goto_table_;           \\\n    clazz->init_face           = init_face_;            \\\n    clazz->load_face           = load_face_;            \\\n    clazz->done_face           = done_face_;            \\\n    clazz->get_interface       = get_interface_;        \\\n    clazz->load_any            = load_any_;             \\\n    clazz->load_head           = load_head_;            \\\n    clazz->load_hhea           = load_hhea_;            \\\n    clazz->load_cmap           = load_cmap_;            \\\n    clazz->load_maxp           = load_maxp_;            \\\n    clazz->load_os2            = load_os2_;             \\\n    clazz->load_post           = load_post_;            \\\n    clazz->load_name           = load_name_;            \\\n    clazz->free_name           = free_name_;            \\\n    clazz->load_kern           = load_kern_;            \\\n    clazz->load_gasp           = load_gasp_;            \\\n    clazz->load_pclt           = load_pclt_;            \\\n    clazz->load_bhed           = load_bhed_;            \\\n    clazz->load_sbit_image     = load_sbit_image_;      \\\n    clazz->get_psname          = get_psname_;           \\\n    clazz->free_psnames        = free_psnames_;         \\\n    clazz->get_kerning         = get_kerning_;          \\\n    clazz->load_font_dir       = load_font_dir_;        \\\n    clazz->load_hmtx           = load_hmtx_;            \\\n    clazz->load_eblc           = load_eblc_;            \\\n    clazz->free_eblc           = free_eblc_;            \\\n    clazz->set_sbit_strike     = set_sbit_strike_;      \\\n    clazz->load_strike_metrics = load_strike_metrics_;  \\\n    clazz->get_metrics         = get_metrics_;          \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __SFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/t1types.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1types.h                                                              */\n/*                                                                         */\n/*    Basic Type1/Type2 type definitions and interface (specification      */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TYPES_H__\n#define __T1TYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_EncodingRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling a custom encoding.                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_chars  :: The number of character codes in the encoding.       */\n  /*                  Usually 256.                                         */\n  /*                                                                       */\n  /*    code_first :: The lowest valid character code in the encoding.     */\n  /*                                                                       */\n  /*    code_last  :: The highest valid character code in the encoding     */\n  /*                  + 1. When equal to code_first there are no valid     */\n  /*                  character codes.                                     */\n  /*                                                                       */\n  /*    char_index :: An array of corresponding glyph indices.             */\n  /*                                                                       */\n  /*    char_name  :: An array of corresponding glyph names.               */\n  /*                                                                       */\n  typedef struct  T1_EncodingRecRec_\n  {\n    FT_Int       num_chars;\n    FT_Int       code_first;\n    FT_Int       code_last;\n\n    FT_UShort*   char_index;\n    FT_String**  char_name;\n\n  } T1_EncodingRec, *T1_Encoding;\n\n\n  /* used to hold extra data of PS_FontInfoRec that\n   * cannot be stored in the publicly defined structure.\n   *\n   * Note these can't be blended with multiple-masters.\n   */\n  typedef struct  PS_FontExtraRec_\n  {\n    FT_UShort  fs_type;\n\n  } PS_FontExtraRec;\n\n\n  typedef struct  T1_FontRec_\n  {\n    PS_FontInfoRec   font_info;         /* font info dictionary   */\n    PS_FontExtraRec  font_extra;        /* font info extra fields */\n    PS_PrivateRec    private_dict;      /* private dictionary     */\n    FT_String*       font_name;         /* top-level dictionary   */\n\n    T1_EncodingType  encoding_type;\n    T1_EncodingRec   encoding;\n\n    FT_Byte*         subrs_block;\n    FT_Byte*         charstrings_block;\n    FT_Byte*         glyph_names_block;\n\n    FT_Int           num_subrs;\n    FT_Byte**        subrs;\n    FT_PtrDist*      subrs_len;\n\n    FT_Int           num_glyphs;\n    FT_String**      glyph_names;       /* array of glyph names       */\n    FT_Byte**        charstrings;       /* array of glyph charstrings */\n    FT_PtrDist*      charstrings_len;\n\n    FT_Byte          paint_type;\n    FT_Byte          font_type;\n    FT_Matrix        font_matrix;\n    FT_Vector        font_offset;\n    FT_BBox          font_bbox;\n    FT_Long          font_id;\n\n    FT_Fixed         stroke_width;\n\n  } T1_FontRec, *T1_Font;\n\n\n  typedef struct  CID_SubrsRec_\n  {\n    FT_UInt    num_subrs;\n    FT_Byte**  code;\n\n  } CID_SubrsRec, *CID_Subrs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                AFM FONT INFORMATION STRUCTURES                    ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  AFM_TrackKernRec_\n  {\n    FT_Int    degree;\n    FT_Fixed  min_ptsize;\n    FT_Fixed  min_kern;\n    FT_Fixed  max_ptsize;\n    FT_Fixed  max_kern;\n\n  } AFM_TrackKernRec, *AFM_TrackKern;\n\n  typedef struct  AFM_KernPairRec_\n  {\n    FT_Int  index1;\n    FT_Int  index2;\n    FT_Int  x;\n    FT_Int  y;\n\n  } AFM_KernPairRec, *AFM_KernPair;\n\n  typedef struct  AFM_FontInfoRec_\n  {\n    FT_Bool        IsCIDFont;\n    FT_BBox        FontBBox;\n    FT_Fixed       Ascender;\n    FT_Fixed       Descender;\n    AFM_TrackKern  TrackKerns;   /* free if non-NULL */\n    FT_Int         NumTrackKern;\n    AFM_KernPair   KernPairs;    /* free if non-NULL */\n    FT_Int         NumKernPair;\n\n  } AFM_FontInfoRec, *AFM_FontInfo;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_FaceRec_*   T1_Face;\n  typedef struct CID_FaceRec_*  CID_Face;\n\n\n  typedef struct  T1_FaceRec_\n  {\n    FT_FaceRec      root;\n    T1_FontRec      type1;\n    const void*     psnames;\n    const void*     psaux;\n    const void*     afm_data;\n    FT_CharMapRec   charmaprecs[2];\n    FT_CharMap      charmaps[2];\n\n    /* support for Multiple Masters fonts */\n    PS_Blend        blend;\n\n    /* undocumented, optional: indices of subroutines that express      */\n    /* the NormalizeDesignVector and the ConvertDesignVector procedure, */\n    /* respectively, as Type 2 charstrings; -1 if keywords not present  */\n    FT_Int           ndv_idx;\n    FT_Int           cdv_idx;\n\n    /* undocumented, optional: has the same meaning as len_buildchar */\n    /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25    */\n    FT_UInt          len_buildchar;\n    FT_Long*         buildchar;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    const void*     pshinter;\n\n  } T1_FaceRec;\n\n\n  typedef struct  CID_FaceRec_\n  {\n    FT_FaceRec       root;\n    void*            psnames;\n    void*            psaux;\n    CID_FaceInfoRec  cid;\n    PS_FontExtraRec  font_extra;\n#if 0\n    void*            afm_data;\n#endif\n    CID_Subrs        subrs;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    void*            pshinter;\n\n    /* since version 2.1.8, but was originally positioned after `afm_data' */\n    FT_Byte*         binary_data; /* used if hex data has been converted */\n    FT_Stream        cid_stream;\n\n  } CID_FaceRec;\n\n\nFT_END_HEADER\n\n#endif /* __T1TYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/internal/tttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttypes.h                                                              */\n/*                                                                         */\n/*    Basic SFNT/TrueType type definitions and interface (specification    */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2008, 2012-2013 by                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTYPES_H__\n#define __TTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TRUETYPE_TABLES_H\n#include FT_INTERNAL_OBJECTS_H\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include FT_MULTIPLE_MASTERS_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TTC_HeaderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    TrueType collection header.  This table contains the offsets of    */\n  /*    the font headers of each distinct TrueType face in the file.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag     :: Must be `ttc ' to indicate a TrueType collection.       */\n  /*                                                                       */\n  /*    version :: The version number.                                     */\n  /*                                                                       */\n  /*    count   :: The number of faces in the collection.  The             */\n  /*               specification says this should be an unsigned long, but */\n  /*               we use a signed long since we need the value -1 for     */\n  /*               specific purposes.                                      */\n  /*                                                                       */\n  /*    offsets :: The offsets of the font headers, one per face.          */\n  /*                                                                       */\n  typedef struct  TTC_HeaderRec_\n  {\n    FT_ULong   tag;\n    FT_Fixed   version;\n    FT_Long    count;\n    FT_ULong*  offsets;\n\n  } TTC_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_HeaderRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    SFNT file format header.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format_tag     :: The font format tag.                             */\n  /*                                                                       */\n  /*    num_tables     :: The number of tables in file.                    */\n  /*                                                                       */\n  /*    search_range   :: Must be `16 * (max power of 2 <= num_tables)'.   */\n  /*                                                                       */\n  /*    entry_selector :: Must be log2 of `search_range / 16'.             */\n  /*                                                                       */\n  /*    range_shift    :: Must be `num_tables * 16 - search_range'.        */\n  /*                                                                       */\n  typedef struct  SFNT_HeaderRec_\n  {\n    FT_ULong   format_tag;\n    FT_UShort  num_tables;\n    FT_UShort  search_range;\n    FT_UShort  entry_selector;\n    FT_UShort  range_shift;\n\n    FT_ULong   offset;  /* not in file */\n\n  } SFNT_HeaderRec, *SFNT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure describes a given table of a TrueType font.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Tag      :: A four-bytes tag describing the table.                 */\n  /*                                                                       */\n  /*    CheckSum :: The table checksum.  This value can be ignored.        */\n  /*                                                                       */\n  /*    Offset   :: The offset of the table from the start of the TrueType */\n  /*                font in its resource.                                  */\n  /*                                                                       */\n  /*    Length   :: The table length (in bytes).                           */\n  /*                                                                       */\n  typedef struct  TT_TableRec_\n  {\n    FT_ULong  Tag;        /*        table type */\n    FT_ULong  CheckSum;   /*    table checksum */\n    FT_ULong  Offset;     /* table file offset */\n    FT_ULong  Length;     /*      table length */\n\n  } TT_TableRec, *TT_Table;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_LongMetricsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the long metrics of the `hmtx' and `vmtx'     */\n  /*    TrueType tables.  The values are expressed in font units.          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    advance :: The advance width or height for the glyph.              */\n  /*                                                                       */\n  /*    bearing :: The left-side or top-side bearing for the glyph.        */\n  /*                                                                       */\n  typedef struct  TT_LongMetricsRec_\n  {\n    FT_UShort  advance;\n    FT_Short   bearing;\n\n  } TT_LongMetricsRec, *TT_LongMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_ShortMetrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple type to model the short metrics of the `hmtx' and `vmtx'  */\n  /*    tables.                                                            */\n  /*                                                                       */\n  typedef FT_Short  TT_ShortMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameEntryRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling TrueType name records.  Name records are used */\n  /*    to store important strings like family name, style name,           */\n  /*    copyright, etc. in _localized_ versions (i.e., language, encoding, */\n  /*    etc).                                                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platformID   :: The ID of the name's encoding platform.            */\n  /*                                                                       */\n  /*    encodingID   :: The platform-specific ID for the name's encoding.  */\n  /*                                                                       */\n  /*    languageID   :: The platform-specific ID for the name's language.  */\n  /*                                                                       */\n  /*    nameID       :: The ID specifying what kind of name this is.       */\n  /*                                                                       */\n  /*    stringLength :: The length of the string in bytes.                 */\n  /*                                                                       */\n  /*    stringOffset :: The offset to the string in the `name' table.      */\n  /*                                                                       */\n  /*    string       :: A pointer to the string's bytes.  Note that these  */\n  /*                    are usually UTF-16 encoded characters.             */\n  /*                                                                       */\n  typedef struct  TT_NameEntryRec_\n  {\n    FT_UShort  platformID;\n    FT_UShort  encodingID;\n    FT_UShort  languageID;\n    FT_UShort  nameID;\n    FT_UShort  stringLength;\n    FT_ULong   stringOffset;\n\n    /* this last field is not defined in the spec */\n    /* but used by the FreeType engine            */\n\n    FT_Byte*   string;\n\n  } TT_NameEntryRec, *TT_NameEntry;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameTableRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType name table.                      */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format         :: The format of the name table.                    */\n  /*                                                                       */\n  /*    numNameRecords :: The number of names in table.                    */\n  /*                                                                       */\n  /*    storageOffset  :: The offset of the name table in the `name'       */\n  /*                      TrueType table.                                  */\n  /*                                                                       */\n  /*    names          :: An array of name records.                        */\n  /*                                                                       */\n  /*    stream         :: the file's input stream.                         */\n  /*                                                                       */\n  typedef struct  TT_NameTableRec_\n  {\n    FT_UShort         format;\n    FT_UInt           numNameRecords;\n    FT_UInt           storageOffset;\n    TT_NameEntryRec*  names;\n    FT_Stream         stream;\n\n  } TT_NameTableRec, *TT_NameTable;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRangeRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A tiny structure used to model a gasp range according to the       */\n  /*    TrueType specification.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    maxPPEM  :: The maximum ppem value to which `gaspFlag' applies.    */\n  /*                                                                       */\n  /*    gaspFlag :: A flag describing the grid-fitting and anti-aliasing   */\n  /*                modes to be used.                                      */\n  /*                                                                       */\n  typedef struct  TT_GaspRangeRec_\n  {\n    FT_UShort  maxPPEM;\n    FT_UShort  gaspFlag;\n\n  } TT_GaspRangeRec, *TT_GaspRange;\n\n\n#define TT_GASP_GRIDFIT  0x01\n#define TT_GASP_DOGRAY   0x02\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType `gasp' table used to specify     */\n  /*    grid-fitting and anti-aliasing behaviour.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version    :: The version number.                                  */\n  /*                                                                       */\n  /*    numRanges  :: The number of gasp ranges in table.                  */\n  /*                                                                       */\n  /*    gaspRanges :: An array of gasp ranges.                             */\n  /*                                                                       */\n  typedef struct  TT_Gasp_\n  {\n    FT_UShort     version;\n    FT_UShort     numRanges;\n    TT_GaspRange  gaspRanges;\n\n  } TT_GaspRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    EMBEDDED BITMAPS SUPPORT                       ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_MetricsRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the big metrics of a given glyph bitmap   */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or `bloc' (Apple) table.                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height       :: The glyph height in pixels.                        */\n  /*                                                                       */\n  /*    width        :: The glyph width in pixels.                         */\n  /*                                                                       */\n  /*    horiBearingX :: The horizontal left bearing.                       */\n  /*                                                                       */\n  /*    horiBearingY :: The horizontal top bearing.                        */\n  /*                                                                       */\n  /*    horiAdvance  :: The horizontal advance.                            */\n  /*                                                                       */\n  /*    vertBearingX :: The vertical left bearing.                         */\n  /*                                                                       */\n  /*    vertBearingY :: The vertical top bearing.                          */\n  /*                                                                       */\n  /*    vertAdvance  :: The vertical advance.                              */\n  /*                                                                       */\n  typedef struct  TT_SBit_MetricsRec_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  horiBearingX;\n    FT_Char  horiBearingY;\n    FT_Byte  horiAdvance;\n\n    FT_Char  vertBearingX;\n    FT_Char  vertBearingY;\n    FT_Byte  vertAdvance;\n\n  } TT_SBit_MetricsRec, *TT_SBit_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_SmallMetricsRec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the small metrics of a given glyph bitmap */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or the `bdat' (Apple) table.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height   :: The glyph height in pixels.                            */\n  /*                                                                       */\n  /*    width    :: The glyph width in pixels.                             */\n  /*                                                                       */\n  /*    bearingX :: The left-side bearing.                                 */\n  /*                                                                       */\n  /*    bearingY :: The top-side bearing.                                  */\n  /*                                                                       */\n  /*    advance  :: The advance width or height.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_Small_Metrics_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  bearingX;\n    FT_Char  bearingY;\n    FT_Byte  advance;\n\n  } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_LineMetricsRec                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe the text line metrics of a given      */\n  /*    bitmap strike, for either a horizontal or vertical layout.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    ascender                :: The ascender in pixels.                 */\n  /*                                                                       */\n  /*    descender               :: The descender in pixels.                */\n  /*                                                                       */\n  /*    max_width               :: The maximum glyph width in pixels.      */\n  /*                                                                       */\n  /*    caret_slope_enumerator  :: Rise of the caret slope, typically set  */\n  /*                               to 1 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_slope_denominator :: Rise of the caret slope, typically set  */\n  /*                               to 0 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_offset            :: Offset in pixels to move the caret for  */\n  /*                               proper positioning.                     */\n  /*                                                                       */\n  /*    min_origin_SB           :: Minimum of horiBearingX (resp.          */\n  /*                               vertBearingY).                          */\n  /*    min_advance_SB          :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horizontal advance -                  */\n  /*                                   ( horiBearingX + width )            */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertical advance -                    */\n  /*                                   ( vertBearingY + height )           */\n  /*                                                                       */\n  /*    max_before_BL           :: Maximum of horiBearingY (resp.          */\n  /*                               vertBearingY).                          */\n  /*                                                                       */\n  /*    min_after_BL            :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horiBearingY - height                 */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertBearingX - width                  */\n  /*                                                                       */\n  /*    pads                    :: Unused (to make the size of the record  */\n  /*                               a multiple of 32 bits.                  */\n  /*                                                                       */\n  typedef struct  TT_SBit_LineMetricsRec_\n  {\n    FT_Char  ascender;\n    FT_Char  descender;\n    FT_Byte  max_width;\n    FT_Char  caret_slope_numerator;\n    FT_Char  caret_slope_denominator;\n    FT_Char  caret_offset;\n    FT_Char  min_origin_SB;\n    FT_Char  min_advance_SB;\n    FT_Char  max_before_BL;\n    FT_Char  min_after_BL;\n    FT_Char  pads[2];\n\n  } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_RangeRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A TrueType/OpenType subIndexTable as defined in the `EBLC'         */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    first_glyph   :: The first glyph index in the range.               */\n  /*                                                                       */\n  /*    last_glyph    :: The last glyph index in the range.                */\n  /*                                                                       */\n  /*    index_format  :: The format of index table.  Valid values are 1    */\n  /*                     to 5.                                             */\n  /*                                                                       */\n  /*    image_format  :: The format of `EBDT' image data.                  */\n  /*                                                                       */\n  /*    image_offset  :: The offset to image data in `EBDT'.               */\n  /*                                                                       */\n  /*    image_size    :: For index formats 2 and 5.  This is the size in   */\n  /*                     bytes of each glyph bitmap.                       */\n  /*                                                                       */\n  /*    big_metrics   :: For index formats 2 and 5.  This is the big       */\n  /*                     metrics for each glyph bitmap.                    */\n  /*                                                                       */\n  /*    num_glyphs    :: For index formats 4 and 5.  This is the number of */\n  /*                     glyphs in the code array.                         */\n  /*                                                                       */\n  /*    glyph_offsets :: For index formats 1 and 3.                        */\n  /*                                                                       */\n  /*    glyph_codes   :: For index formats 4 and 5.                        */\n  /*                                                                       */\n  /*    table_offset  :: The offset of the index table in the `EBLC'       */\n  /*                     table.  Only used during strike loading.          */\n  /*                                                                       */\n  typedef struct  TT_SBit_RangeRec_\n  {\n    FT_UShort           first_glyph;\n    FT_UShort           last_glyph;\n\n    FT_UShort           index_format;\n    FT_UShort           image_format;\n    FT_ULong            image_offset;\n\n    FT_ULong            image_size;\n    TT_SBit_MetricsRec  metrics;\n    FT_ULong            num_glyphs;\n\n    FT_ULong*           glyph_offsets;\n    FT_UShort*          glyph_codes;\n\n    FT_ULong            table_offset;\n\n  } TT_SBit_RangeRec, *TT_SBit_Range;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_StrikeRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap strike in the `EBLC'      */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*   num_index_ranges :: The number of index ranges.                     */\n  /*                                                                       */\n  /*   index_ranges     :: An array of glyph index ranges.                 */\n  /*                                                                       */\n  /*   color_ref        :: Unused.  `color_ref' is put in for future       */\n  /*                       enhancements, but these fields are already      */\n  /*                       in use by other platforms (e.g. Newton).        */\n  /*                       For details, please see                         */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  /*   hori             :: The line metrics for horizontal layouts.        */\n  /*                                                                       */\n  /*   vert             :: The line metrics for vertical layouts.          */\n  /*                                                                       */\n  /*   start_glyph      :: The lowest glyph index for this strike.         */\n  /*                                                                       */\n  /*   end_glyph        :: The highest glyph index for this strike.        */\n  /*                                                                       */\n  /*   x_ppem           :: The number of horizontal pixels per EM.         */\n  /*                                                                       */\n  /*   y_ppem           :: The number of vertical pixels per EM.           */\n  /*                                                                       */\n  /*   bit_depth        :: The bit depth.  Valid values are 1, 2, 4,       */\n  /*                       and 8.                                          */\n  /*                                                                       */\n  /*   flags            :: Is this a vertical or horizontal strike?  For   */\n  /*                       details, please see                             */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  typedef struct  TT_SBit_StrikeRec_\n  {\n    FT_Int                  num_ranges;\n    TT_SBit_Range           sbit_ranges;\n    FT_ULong                ranges_offset;\n\n    FT_ULong                color_ref;\n\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_UShort               start_glyph;\n    FT_UShort               end_glyph;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 bit_depth;\n    FT_Char                 flags;\n\n  } TT_SBit_StrikeRec, *TT_SBit_Strike;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ComponentRec                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure to describe a compound sbit element.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_code :: The element's glyph index.                           */\n  /*                                                                       */\n  /*    x_offset   :: The element's left bearing.                          */\n  /*                                                                       */\n  /*    y_offset   :: The element's top bearing.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_ComponentRec_\n  {\n    FT_UShort  glyph_code;\n    FT_Char    x_offset;\n    FT_Char    y_offset;\n\n  } TT_SBit_ComponentRec, *TT_SBit_Component;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ScaleRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap scaling table, as defined */\n  /*    in the `EBSC' table.                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    hori              :: The horizontal line metrics.                  */\n  /*                                                                       */\n  /*    vert              :: The vertical line metrics.                    */\n  /*                                                                       */\n  /*    x_ppem            :: The number of horizontal pixels per EM.       */\n  /*                                                                       */\n  /*    y_ppem            :: The number of vertical pixels per EM.         */\n  /*                                                                       */\n  /*    x_ppem_substitute :: Substitution x_ppem value.                    */\n  /*                                                                       */\n  /*    y_ppem_substitute :: Substitution y_ppem value.                    */\n  /*                                                                       */\n  typedef struct  TT_SBit_ScaleRec_\n  {\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 x_ppem_substitute;\n    FT_Byte                 y_ppem_substitute;\n\n  } TT_SBit_ScaleRec, *TT_SBit_Scale;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  POSTSCRIPT GLYPH NAMES SUPPORT                   ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_20Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.0.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs    :: The number of named glyphs in the table.          */\n  /*                                                                       */\n  /*    num_names     :: The number of PS names stored in the table.       */\n  /*                                                                       */\n  /*    glyph_indices :: The indices of the glyphs in the names arrays.    */\n  /*                                                                       */\n  /*    glyph_names   :: The PS names not in Mac Encoding.                 */\n  /*                                                                       */\n  typedef struct  TT_Post_20Rec_\n  {\n    FT_UShort   num_glyphs;\n    FT_UShort   num_names;\n    FT_UShort*  glyph_indices;\n    FT_Char**   glyph_names;\n\n  } TT_Post_20Rec, *TT_Post_20;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_25Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.5.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs :: The number of glyphs in the table.                   */\n  /*                                                                       */\n  /*    offsets    :: An array of signed offsets in a normal Mac           */\n  /*                  Postscript name encoding.                            */\n  /*                                                                       */\n  typedef struct  TT_Post_25_\n  {\n    FT_UShort  num_glyphs;\n    FT_Char*   offsets;\n\n  } TT_Post_25Rec, *TT_Post_25;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_NamesRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names table, either format 2.0 or 2.5.                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loaded    :: A flag to indicate whether the PS names are loaded.   */\n  /*                                                                       */\n  /*    format_20 :: The sub-table used for format 2.0.                    */\n  /*                                                                       */\n  /*    format_25 :: The sub-table used for format 2.5.                    */\n  /*                                                                       */\n  typedef struct  TT_Post_NamesRec_\n  {\n    FT_Bool  loaded;\n\n    union\n    {\n      TT_Post_20Rec  format_20;\n      TT_Post_25Rec  format_25;\n\n    } names;\n\n  } TT_Post_NamesRec, *TT_Post_Names;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    GX VARIATION TABLE SUPPORT                     ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n  typedef struct GX_BlendRec_  *GX_Blend;\n#endif\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              EMBEDDED BDF PROPERTIES TABLE SUPPORT                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   * These types are used to support a `BDF ' table that isn't part of the\n   * official TrueType specification.  It is mainly used in SFNT-based\n   * bitmap fonts that were generated from a set of BDF fonts.\n   *\n   * The format of the table is as follows.\n   *\n   *   USHORT   version      `BDF ' table version number, should be 0x0001.\n   *   USHORT   strikeCount  Number of strikes (bitmap sizes) in this table.\n   *   ULONG    stringTable  Offset (from start of BDF table) to string\n   *                         table.\n   *\n   * This is followed by an array of `strikeCount' descriptors, having the\n   * following format.\n   *\n   *   USHORT   ppem         Vertical pixels per EM for this strike.\n   *   USHORT   numItems     Number of items for this strike (properties and\n   *                         atoms).  Maximum is 255.\n   *\n   * This array in turn is followed by `strikeCount' value sets.  Each\n   * `value set' is an array of `numItems' items with the following format.\n   *\n   *   ULONG    item_name    Offset in string table to item name.\n   *   USHORT   item_type    The item type.  Possible values are\n   *                            0 => string (e.g., COMMENT)\n   *                            1 => atom   (e.g., FONT or even SIZE)\n   *                            2 => int32\n   *                            3 => uint32\n   *                         0x10 => A flag to indicate a properties.  This\n   *                                 is ORed with the above values.\n   *   ULONG    item_value   For strings  => Offset into string table without\n   *                                         the corresponding double quotes.\n   *                         For atoms    => Offset into string table.\n   *                         For integers => Direct value.\n   *\n   * All strings in the string table consist of bytes and are\n   * zero-terminated.\n   *\n   */\n\n#ifdef TT_CONFIG_OPTION_BDF\n\n  typedef struct  TT_BDFRec_\n  {\n    FT_Byte*   table;\n    FT_Byte*   table_end;\n    FT_Byte*   strings;\n    FT_ULong   strings_size;\n    FT_UInt    num_strikes;\n    FT_Bool    loaded;\n\n  } TT_BDFRec, *TT_BDF;\n\n#endif /* TT_CONFIG_OPTION_BDF */\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  ORIGINAL TT_FACE CLASS DEFINITION                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This structure/class is defined here because it is common to the      */\n  /* following formats: TTF, OpenType-TT, and OpenType-CFF.                */\n  /*                                                                       */\n  /* Note, however, that the classes TT_Size and TT_GlyphSlot are not      */\n  /* shared between font drivers, and are thus defined in `ttobjs.h'.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType face/font object.  A TT_Face encapsulates   */\n  /*    the resolution and scaling independent parts of a TrueType font    */\n  /*    resource.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The TT_Face structure is also used as a `parent class' for the     */\n  /*    OpenType-CFF class (T2_Face).                                      */\n  /*                                                                       */\n  typedef struct TT_FaceRec_*  TT_Face;\n\n\n  /* a function type used for the truetype bytecode interpreter hooks */\n  typedef FT_Error\n  (*TT_Interpreter)( void*  exec_context );\n\n  /* forward declaration */\n  typedef struct TT_LoaderRec_*  TT_Loader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_GotoTableFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given TrueType table.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    tag    :: A 4-byte tag used to name the table.                     */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    length :: The length of the table in bytes.  Set to 0 if not       */\n  /*              needed.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_GotoTableFunc)( TT_Face    face,\n                              FT_ULong   tag,\n                              FT_Stream  stream,\n                              FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_StartGlyphFunc                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given glyph element, and opens a  */\n  /*    frame for it.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader      :: The current TrueType glyph loader object.           */\n  /*                                                                       */\n  /*    glyph index :: The index of the glyph to access.                   */\n  /*                                                                       */\n  /*    offset      :: The offset of the glyph according to the            */\n  /*                   `locations' table.                                  */\n  /*                                                                       */\n  /*    byte_count  :: The size of the frame in bytes.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is normally equivalent to FT_STREAM_SEEK(offset)     */\n  /*    followed by FT_FRAME_ENTER(byte_count) with the loader's stream,   */\n  /*    but alternative formats (e.g. compressed ones) might use something */\n  /*    different.                                                         */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_StartGlyphFunc)( TT_Loader  loader,\n                               FT_UInt    glyph_index,\n                               FT_ULong   offset,\n                               FT_UInt    byte_count );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_ReadGlyphFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reads one glyph element (its header, a simple glyph, or a          */\n  /*    composite) from the loader's current stream frame.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_ReadGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_EndGlyphFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Closes the current loader stream frame for the glyph.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  typedef void\n  (*TT_Loader_EndGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         TrueType Face Type                            */\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType face class.  These objects model the resolution and   */\n  /*    point-size independent data found in a TrueType font file.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root                 :: The base FT_Face structure, managed by the */\n  /*                            base layer.                                */\n  /*                                                                       */\n  /*    ttc_header           :: The TrueType collection header, used when  */\n  /*                            the file is a `ttc' rather than a `ttf'.   */\n  /*                            For ordinary font files, the field         */\n  /*                            `ttc_header.count' is set to 0.            */\n  /*                                                                       */\n  /*    format_tag           :: The font format tag.                       */\n  /*                                                                       */\n  /*    num_tables           :: The number of TrueType tables in this font */\n  /*                            file.                                      */\n  /*                                                                       */\n  /*    dir_tables           :: The directory of TrueType tables for this  */\n  /*                            font file.                                 */\n  /*                                                                       */\n  /*    header               :: The font's font header (`head' table).     */\n  /*                            Read on font opening.                      */\n  /*                                                                       */\n  /*    horizontal           :: The font's horizontal header (`hhea'       */\n  /*                            table).  This field also contains the      */\n  /*                            associated horizontal metrics table        */\n  /*                            (`hmtx').                                  */\n  /*                                                                       */\n  /*    max_profile          :: The font's maximum profile table.  Read on */\n  /*                            font opening.  Note that some maximum      */\n  /*                            values cannot be taken directly from this  */\n  /*                            table.  We thus define additional fields   */\n  /*                            below to hold the computed maxima.         */\n  /*                                                                       */\n  /*    vertical_info        :: A boolean which is set when the font file  */\n  /*                            contains vertical metrics.  If not, the    */\n  /*                            value of the `vertical' field is           */\n  /*                            undefined.                                 */\n  /*                                                                       */\n  /*    vertical             :: The font's vertical header (`vhea' table). */\n  /*                            This field also contains the associated    */\n  /*                            vertical metrics table (`vmtx'), if found. */\n  /*                            IMPORTANT: The contents of this field is   */\n  /*                            undefined if the `verticalInfo' field is   */\n  /*                            unset.                                     */\n  /*                                                                       */\n  /*    num_names            :: The number of name records within this     */\n  /*                            TrueType font.                             */\n  /*                                                                       */\n  /*    name_table           :: The table of name records (`name').        */\n  /*                                                                       */\n  /*    os2                  :: The font's OS/2 table (`OS/2').            */\n  /*                                                                       */\n  /*    postscript           :: The font's PostScript table (`post'        */\n  /*                            table).  The PostScript glyph names are    */\n  /*                            not loaded by the driver on face opening.  */\n  /*                            See the `ttpost' module for more details.  */\n  /*                                                                       */\n  /*    cmap_table           :: Address of the face's `cmap' SFNT table    */\n  /*                            in memory (it's an extracted frame).       */\n  /*                                                                       */\n  /*    cmap_size            :: The size in bytes of the `cmap_table'      */\n  /*                            described above.                           */\n  /*                                                                       */\n  /*    goto_table           :: A function called by each TrueType table   */\n  /*                            loader to position a stream's cursor to    */\n  /*                            the start of a given table according to    */\n  /*                            its tag.  It defaults to TT_Goto_Face but  */\n  /*                            can be different for strange formats (e.g. */\n  /*                            Type 42).                                  */\n  /*                                                                       */\n  /*    access_glyph_frame   :: A function used to access the frame of a   */\n  /*                            given glyph within the face's font file.   */\n  /*                                                                       */\n  /*    forget_glyph_frame   :: A function used to forget the frame of a   */\n  /*                            given glyph when all data has been loaded. */\n  /*                                                                       */\n  /*    read_glyph_header    :: A function used to read a glyph header.    */\n  /*                            It must be called between an `access' and  */\n  /*                            `forget'.                                  */\n  /*                                                                       */\n  /*    read_simple_glyph    :: A function used to read a simple glyph.    */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    read_composite_glyph :: A function used to read a composite glyph. */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    sfnt                 :: A pointer to the SFNT service.             */\n  /*                                                                       */\n  /*    psnames              :: A pointer to the PostScript names service. */\n  /*                                                                       */\n  /*    hdmx                 :: The face's horizontal device metrics       */\n  /*                            (`hdmx' table).  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    gasp                 :: The grid-fitting and scaling properties    */\n  /*                            table (`gasp').  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    pclt                 :: The `pclt' SFNT table.                     */\n  /*                                                                       */\n  /*    num_sbit_strikes     :: The number of sbit strikes, i.e., bitmap   */\n  /*                            sizes, embedded in this font.              */\n  /*                                                                       */\n  /*    sbit_strikes         :: An array of sbit strikes embedded in this  */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    num_sbit_scales      :: The number of sbit scales for this font.   */\n  /*                                                                       */\n  /*    sbit_scales          :: Array of sbit scales embedded in this      */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    postscript_names     :: A table used to store the Postscript names */\n  /*                            of  the glyphs for this font.  See the     */\n  /*                            file  `ttconfig.h' for comments on the     */\n  /*                            TT_CONFIG_OPTION_POSTSCRIPT_NAMES option.  */\n  /*                                                                       */\n  /*    num_locations        :: The number of glyph locations in this      */\n  /*                            TrueType file.  This should be             */\n  /*                            identical to the number of glyphs.         */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    glyph_locations      :: An array of longs.  These are offsets to   */\n  /*                            glyph data within the `glyf' table.        */\n  /*                            Ignored for Type 2 font faces.             */\n  /*                                                                       */\n  /*    glyf_len             :: The length of the `glyf' table.  Needed    */\n  /*                            for malformed `loca' tables.               */\n  /*                                                                       */\n  /*    font_program_size    :: Size in bytecodes of the face's font       */\n  /*                            program.  0 if none defined.  Ignored for  */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    font_program         :: The face's font program (bytecode stream)  */\n  /*                            executed at load time, also used during    */\n  /*                            glyph rendering.  Comes from the `fpgm'    */\n  /*                            table.  Ignored for Type 2 font fonts.     */\n  /*                                                                       */\n  /*    cvt_program_size     :: The size in bytecodes of the face's cvt    */\n  /*                            program.  Ignored for Type 2 fonts.        */\n  /*                                                                       */\n  /*    cvt_program          :: The face's cvt program (bytecode stream)   */\n  /*                            executed each time an instance/size is     */\n  /*                            changed/reset.  Comes from the `prep'      */\n  /*                            table.  Ignored for Type 2 fonts.          */\n  /*                                                                       */\n  /*    cvt_size             :: Size of the control value table (in        */\n  /*                            entries).   Ignored for Type 2 fonts.      */\n  /*                                                                       */\n  /*    cvt                  :: The face's original control value table.   */\n  /*                            Coordinates are expressed in unscaled font */\n  /*                            units.  Comes from the `cvt ' table.       */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    num_kern_pairs       :: The number of kerning pairs present in the */\n  /*                            font file.  The engine only loads the      */\n  /*                            first horizontal format 0 kern table it    */\n  /*                            finds in the font file.  Ignored for       */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    kern_table_index     :: The index of the kerning table in the font */\n  /*                            kerning directory.  Ignored for Type 2     */\n  /*                            fonts.                                     */\n  /*                                                                       */\n  /*    interpreter          :: A pointer to the TrueType bytecode         */\n  /*                            interpreters field is also used to hook    */\n  /*                            the debugger in `ttdebug'.                 */\n  /*                                                                       */\n  /*    unpatented_hinting   :: If true, use only unpatented methods in    */\n  /*                            the bytecode interpreter.                  */\n  /*                                                                       */\n  /*    doblend              :: A boolean which is set if the font should  */\n  /*                            be blended (this is for GX var).           */\n  /*                                                                       */\n  /*    blend                :: Contains the data needed to control GX     */\n  /*                            variation tables (rather like Multiple     */\n  /*                            Master data).                              */\n  /*                                                                       */\n  /*    extra                :: Reserved for third-party font drivers.     */\n  /*                                                                       */\n  /*    postscript_name      :: The PS name of the font.  Used by the      */\n  /*                            postscript name service.                   */\n  /*                                                                       */\n  typedef struct  TT_FaceRec_\n  {\n    FT_FaceRec            root;\n\n    TTC_HeaderRec         ttc_header;\n\n    FT_ULong              format_tag;\n    FT_UShort             num_tables;\n    TT_Table              dir_tables;\n\n    TT_Header             header;       /* TrueType header table          */\n    TT_HoriHeader         horizontal;   /* TrueType horizontal header     */\n\n    TT_MaxProfile         max_profile;\n\n    FT_Bool               vertical_info;\n    TT_VertHeader         vertical;     /* TT Vertical header, if present */\n\n    FT_UShort             num_names;    /* number of name records  */\n    TT_NameTableRec       name_table;   /* name table              */\n\n    TT_OS2                os2;          /* TrueType OS/2 table            */\n    TT_Postscript         postscript;   /* TrueType Postscript table      */\n\n    FT_Byte*              cmap_table;   /* extracted `cmap' table */\n    FT_ULong              cmap_size;\n\n    TT_Loader_GotoTableFunc   goto_table;\n\n    TT_Loader_StartGlyphFunc  access_glyph_frame;\n    TT_Loader_EndGlyphFunc    forget_glyph_frame;\n    TT_Loader_ReadGlyphFunc   read_glyph_header;\n    TT_Loader_ReadGlyphFunc   read_simple_glyph;\n    TT_Loader_ReadGlyphFunc   read_composite_glyph;\n\n    /* a typeless pointer to the SFNT_Interface table used to load */\n    /* the basic TrueType tables in the face object                */\n    void*                 sfnt;\n\n    /* a typeless pointer to the FT_Service_PsCMapsRec table used to */\n    /* handle glyph names <-> unicode & Mac values                   */\n    void*                 psnames;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Optional TrueType/OpenType tables                                   */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* grid-fitting and scaling table */\n    TT_GaspRec            gasp;                 /* the `gasp' table */\n\n    /* PCL 5 table */\n    TT_PCLT               pclt;\n\n    /* embedded bitmaps support */\n    FT_ULong              num_sbit_scales;\n    TT_SBit_Scale         sbit_scales;\n\n    /* postscript names table */\n    TT_Post_NamesRec      postscript_names;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* TrueType-specific fields (ignored by the OTF-Type2 driver)          */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* the font program, if any */\n    FT_ULong              font_program_size;\n    FT_Byte*              font_program;\n\n    /* the cvt program, if any */\n    FT_ULong              cvt_program_size;\n    FT_Byte*              cvt_program;\n\n    /* the original, unscaled, control value table */\n    FT_ULong              cvt_size;\n    FT_Short*             cvt;\n\n    /* A pointer to the bytecode interpreter to use.  This is also */\n    /* used to hook the debugger for the `ttdebug' utility.        */\n    TT_Interpreter        interpreter;\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    /* Use unpatented hinting only. */\n    FT_Bool               unpatented_hinting;\n#endif\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Other tables or fields. This is used by derivative formats like     */\n    /* OpenType.                                                           */\n    /*                                                                     */\n    /***********************************************************************/\n\n    FT_Generic            extra;\n\n    const char*           postscript_name;\n\n    FT_ULong              glyf_len;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Bool               doblend;\n    GX_Blend              blend;\n#endif\n\n    /* since version 2.2 */\n\n    FT_Byte*              horz_metrics;\n    FT_ULong              horz_metrics_size;\n\n    FT_Byte*              vert_metrics;\n    FT_ULong              vert_metrics_size;\n\n    FT_ULong              num_locations; /* in broken TTF, gid > 0xFFFF */\n    FT_Byte*              glyph_locations;\n\n    FT_Byte*              hdmx_table;\n    FT_ULong              hdmx_table_size;\n    FT_UInt               hdmx_record_count;\n    FT_ULong              hdmx_record_size;\n    FT_Byte*              hdmx_record_sizes;\n\n    FT_Byte*              sbit_table;\n    FT_ULong              sbit_table_size;\n    FT_UInt               sbit_num_strikes;\n\n    FT_Byte*              kern_table;\n    FT_ULong              kern_table_size;\n    FT_UInt               num_kern_tables;\n    FT_UInt32             kern_avail_bits;\n    FT_UInt32             kern_order_bits;\n\n#ifdef TT_CONFIG_OPTION_BDF\n    TT_BDFRec             bdf;\n#endif /* TT_CONFIG_OPTION_BDF */\n\n    /* since 2.3.0 */\n    FT_ULong              horz_metrics_offset;\n    FT_ULong              vert_metrics_offset;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* since 2.4.12 */\n    FT_ULong              sph_found_func_flags; /* special functions found */\n                                                /* for this face           */\n    FT_Bool               sph_compatibility_mode;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n  } TT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  <Struct>                                                             */\n  /*     TT_GlyphZoneRec                                                   */\n  /*                                                                       */\n  /*  <Description>                                                        */\n  /*     A glyph zone is used to load, scale and hint glyph outline        */\n  /*     coordinates.                                                      */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     memory       :: A handle to the memory manager.                   */\n  /*                                                                       */\n  /*     max_points   :: The maximum size in points of the zone.           */\n  /*                                                                       */\n  /*     max_contours :: Max size in links contours of the zone.           */\n  /*                                                                       */\n  /*     n_points     :: The current number of points in the zone.         */\n  /*                                                                       */\n  /*     n_contours   :: The current number of contours in the zone.       */\n  /*                                                                       */\n  /*     org          :: The original glyph coordinates (font              */\n  /*                     units/scaled).                                    */\n  /*                                                                       */\n  /*     cur          :: The current glyph coordinates (scaled/hinted).    */\n  /*                                                                       */\n  /*     tags         :: The point control tags.                           */\n  /*                                                                       */\n  /*     contours     :: The contours end points.                          */\n  /*                                                                       */\n  /*     first_point  :: Offset of the current subglyph's first point.     */\n  /*                                                                       */\n  typedef struct  TT_GlyphZoneRec_\n  {\n    FT_Memory   memory;\n    FT_UShort   max_points;\n    FT_UShort   max_contours;\n    FT_UShort   n_points;    /* number of points in zone    */\n    FT_Short    n_contours;  /* number of contours          */\n\n    FT_Vector*  org;         /* original point coordinates  */\n    FT_Vector*  cur;         /* current point coordinates   */\n    FT_Vector*  orus;        /* original (unscaled) point coordinates */\n\n    FT_Byte*    tags;        /* current touch flags         */\n    FT_UShort*  contours;    /* contour end points          */\n\n    FT_UShort   first_point; /* offset of first (#0) point  */\n\n  } TT_GlyphZoneRec, *TT_GlyphZone;\n\n\n  /* handle to execution context */\n  typedef struct TT_ExecContextRec_*  TT_ExecContext;\n\n  /* glyph loader structure */\n  typedef struct  TT_LoaderRec_\n  {\n    FT_Face          face;\n    FT_Size          size;\n    FT_GlyphSlot     glyph;\n    FT_GlyphLoader   gloader;\n\n    FT_ULong         load_flags;\n    FT_UInt          glyph_index;\n\n    FT_Stream        stream;\n    FT_Int           byte_len;\n\n    FT_Short         n_contours;\n    FT_BBox          bbox;\n    FT_Int           left_bearing;\n    FT_Int           advance;\n    FT_Int           linear;\n    FT_Bool          linear_def;\n    FT_Bool          preserve_pps;\n    FT_Vector        pp1;\n    FT_Vector        pp2;\n\n    FT_ULong         glyf_offset;\n\n    /* the zone where we load our glyphs */\n    TT_GlyphZoneRec  base;\n    TT_GlyphZoneRec  zone;\n\n    TT_ExecContext   exec;\n    FT_Byte*         instructions;\n    FT_ULong         ins_pos;\n\n    /* for possible extensibility in other formats */\n    void*            other;\n\n    /* since version 2.1.8 */\n    FT_Int           top_bearing;\n    FT_Int           vadvance;\n    FT_Vector        pp3;\n    FT_Vector        pp4;\n\n    /* since version 2.2.1 */\n    FT_Byte*         cursor;\n    FT_Byte*         limit;\n\n  } TT_LoaderRec;\n\n\nFT_END_HEADER\n\n#endif /* __TTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/t1tables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tables.h                                                             */\n/*                                                                         */\n/*    Basic Type 1/Type 2 tables definitions and interface (specification  */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TABLES_H__\n#define __T1TABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    type1_tables                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Type 1 Tables                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Type~1 (PostScript) specific font tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of Type 1-specific tables,    */\n  /*    including structures related to other PostScript font formats.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */\n  /* structures in order to support Multiple Master fonts.               */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfoRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 FontInfo dictionary.  */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    FontInfo dictionary.                                               */\n  /*                                                                       */\n  typedef struct  PS_FontInfoRec_\n  {\n    FT_String*  version;\n    FT_String*  notice;\n    FT_String*  full_name;\n    FT_String*  family_name;\n    FT_String*  weight;\n    FT_Long     italic_angle;\n    FT_Bool     is_fixed_pitch;\n    FT_Short    underline_position;\n    FT_UShort   underline_thickness;\n\n  } PS_FontInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_FontInfoRec structure.                           */\n  /*                                                                       */\n  typedef struct PS_FontInfoRec_*  PS_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef PS_FontInfoRec  T1_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_PrivateRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 private dictionary.   */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    Private dictionary.                                                */\n  /*                                                                       */\n  typedef struct  PS_PrivateRec_\n  {\n    FT_Int     unique_id;\n    FT_Int     lenIV;\n\n    FT_Byte    num_blue_values;\n    FT_Byte    num_other_blues;\n    FT_Byte    num_family_blues;\n    FT_Byte    num_family_other_blues;\n\n    FT_Short   blue_values[14];\n    FT_Short   other_blues[10];\n\n    FT_Short   family_blues      [14];\n    FT_Short   family_other_blues[10];\n\n    FT_Fixed   blue_scale;\n    FT_Int     blue_shift;\n    FT_Int     blue_fuzz;\n\n    FT_UShort  standard_width[1];\n    FT_UShort  standard_height[1];\n\n    FT_Byte    num_snap_widths;\n    FT_Byte    num_snap_heights;\n    FT_Bool    force_bold;\n    FT_Bool    round_stem_up;\n\n    FT_Short   snap_widths [13];  /* including std width  */\n    FT_Short   snap_heights[13];  /* including std height */\n\n    FT_Fixed   expansion_factor;\n\n    FT_Long    language_group;\n    FT_Long    password;\n\n    FT_Short   min_feature[2];\n\n  } PS_PrivateRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_PrivateRec structure.                            */\n  /*                                                                       */\n  typedef struct PS_PrivateRec_*  PS_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef PS_PrivateRec  T1_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_Blend_Flags                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of flags used to indicate which fields are present in a      */\n  /*    given blend dictionary (font info or private).  Used to support    */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  typedef enum  T1_Blend_Flags_\n  {\n    /*# required fields in a FontInfo blend dictionary */\n    T1_BLEND_UNDERLINE_POSITION = 0,\n    T1_BLEND_UNDERLINE_THICKNESS,\n    T1_BLEND_ITALIC_ANGLE,\n\n    /*# required fields in a Private blend dictionary */\n    T1_BLEND_BLUE_VALUES,\n    T1_BLEND_OTHER_BLUES,\n    T1_BLEND_STANDARD_WIDTH,\n    T1_BLEND_STANDARD_HEIGHT,\n    T1_BLEND_STEM_SNAP_WIDTHS,\n    T1_BLEND_STEM_SNAP_HEIGHTS,\n    T1_BLEND_BLUE_SCALE,\n    T1_BLEND_BLUE_SHIFT,\n    T1_BLEND_FAMILY_BLUES,\n    T1_BLEND_FAMILY_OTHER_BLUES,\n    T1_BLEND_FORCE_BOLD,\n\n    /*# never remove */\n    T1_BLEND_MAX\n\n  } T1_Blend_Flags;\n\n  /* */\n\n\n  /*# backwards compatible definitions */\n#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION\n#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS\n#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE\n#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES\n#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES\n#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH\n#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT\n#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS\n#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS\n#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE\n#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT\n#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES\n#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES\n#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD\n#define t1_blend_max                  T1_BLEND_MAX\n\n\n  /* maximum number of Multiple Masters designs, as defined in the spec */\n#define T1_MAX_MM_DESIGNS     16\n\n  /* maximum number of Multiple Masters axes, as defined in the spec */\n#define T1_MAX_MM_AXIS        4\n\n  /* maximum number of elements in a design map */\n#define T1_MAX_MM_MAP_POINTS  20\n\n\n  /* this structure is used to store the BlendDesignMap entry for an axis */\n  typedef struct  PS_DesignMap_\n  {\n    FT_Byte    num_points;\n    FT_Long*   design_points;\n    FT_Fixed*  blend_points;\n\n  } PS_DesignMapRec, *PS_DesignMap;\n\n  /* backwards-compatible definition */\n  typedef PS_DesignMapRec  T1_DesignMap;\n\n\n  typedef struct  PS_BlendRec_\n  {\n    FT_UInt          num_designs;\n    FT_UInt          num_axis;\n\n    FT_String*       axis_names[T1_MAX_MM_AXIS];\n    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];\n    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];\n\n    FT_Fixed*        weight_vector;\n    FT_Fixed*        default_weight_vector;\n\n    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];\n    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];\n\n    FT_ULong         blend_bitflags;\n\n    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];\n\n    /* since 2.3.0 */\n\n    /* undocumented, optional: the default design instance;   */\n    /* corresponds to default_weight_vector --                */\n    /* num_default_design_vector == 0 means it is not present */\n    /* in the font and associated metrics files               */\n    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];\n    FT_UInt          num_default_design_vector;\n\n  } PS_BlendRec, *PS_Blend;\n\n\n  /* backwards-compatible definition */\n  typedef PS_BlendRec  T1_Blend;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDictRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent data in a CID top-level dictionary.  */\n  /*                                                                       */\n  typedef struct  CID_FaceDictRec_\n  {\n    PS_PrivateRec  private_dict;\n\n    FT_UInt        len_buildchar;\n    FT_Fixed       forcebold_threshold;\n    FT_Pos         stroke_width;\n    FT_Fixed       expansion_factor;\n\n    FT_Byte        paint_type;\n    FT_Byte        font_type;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n    FT_UInt        num_subrs;\n    FT_ULong       subrmap_offset;\n    FT_Int         sd_bytes;\n\n  } CID_FaceDictRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDict                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceDictRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceDictRec_*  CID_FaceDict;\n\n  /* */\n\n\n  /* backwards-compatible definition */\n  typedef CID_FaceDictRec  CID_FontDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfoRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent CID Face information.                */\n  /*                                                                       */\n  typedef struct  CID_FaceInfoRec_\n  {\n    FT_String*      cid_font_name;\n    FT_Fixed        cid_version;\n    FT_Int          cid_font_type;\n\n    FT_String*      registry;\n    FT_String*      ordering;\n    FT_Int          supplement;\n\n    PS_FontInfoRec  font_info;\n    FT_BBox         font_bbox;\n    FT_ULong        uid_base;\n\n    FT_Int          num_xuid;\n    FT_ULong        xuid[16];\n\n    FT_ULong        cidmap_offset;\n    FT_Int          fd_bytes;\n    FT_Int          gd_bytes;\n    FT_ULong        cid_count;\n\n    FT_Int          num_dicts;\n    CID_FaceDict    font_dicts;\n\n    FT_ULong        data_offset;\n\n  } CID_FaceInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfo                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceInfoRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceInfoRec_*  CID_FaceInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Info                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef CID_FaceInfoRec  CID_Info;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Has_PS_Glyph_Names\n   *\n   * @description:\n   *    Return true if a given face provides reliable PostScript glyph\n   *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,\n   *    except that certain fonts (mostly TrueType) contain incorrect\n   *    glyph name tables.\n   *\n   *    When this function returns true, the caller is sure that the glyph\n   *    names returned by @FT_Get_Glyph_Name are reliable.\n   *\n   * @input:\n   *    face ::\n   *       face handle\n   *\n   * @return:\n   *    Boolean.  True if glyph names are reliable.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Info\n   *\n   * @description:\n   *    Retrieve the @PS_FontInfoRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_info ::\n   *       Output font info structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the font info structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function will\n   *    return the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face      face,\n                       PS_FontInfo  afont_info );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Private\n   *\n   * @description:\n   *    Retrieve the @PS_PrivateRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_private ::\n   *       Output private dictionary structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the @PS_PrivateRec structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face     face,\n                          PS_Private  afont_private );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_EncodingType                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration describing the `Encoding' entry in a Type 1         */\n  /*    dictionary.                                                        */\n  /*                                                                       */\n  typedef enum  T1_EncodingType_\n  {\n    T1_ENCODING_TYPE_NONE = 0,\n    T1_ENCODING_TYPE_ARRAY,\n    T1_ENCODING_TYPE_STANDARD,\n    T1_ENCODING_TYPE_ISOLATIN1,\n    T1_ENCODING_TYPE_EXPERT\n\n  } T1_EncodingType;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    PS_Dict_Keys                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used in calls to @FT_Get_PS_Font_Value to identify  */\n  /*    the Type~1 dictionary entry to retrieve.                           */\n  /*                                                                       */\n  typedef enum  PS_Dict_Keys_\n  {\n    /* conventionally in the font dictionary */\n    PS_DICT_FONT_TYPE,              /* FT_Byte         */\n    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */\n    PS_DICT_FONT_BBOX,              /* FT_Fixed        */\n    PS_DICT_PAINT_TYPE,             /* FT_Byte         */\n    PS_DICT_FONT_NAME,              /* FT_String*      */\n    PS_DICT_UNIQUE_ID,              /* FT_Int          */\n    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */\n    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */\n    PS_DICT_CHAR_STRING,            /* FT_String*      */\n    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */\n    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */\n\n    /* conventionally in the font Private dictionary */\n    PS_DICT_NUM_SUBRS,              /* FT_Int     */\n    PS_DICT_SUBR,                   /* FT_String* */\n    PS_DICT_STD_HW,                 /* FT_UShort  */\n    PS_DICT_STD_VW,                 /* FT_UShort  */\n    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */\n    PS_DICT_BLUE_VALUE,             /* FT_Short   */\n    PS_DICT_BLUE_FUZZ,              /* FT_Int     */\n    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */\n    PS_DICT_OTHER_BLUE,             /* FT_Short   */\n    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */\n    PS_DICT_FAMILY_BLUE,            /* FT_Short   */\n    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */\n    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */\n    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */\n    PS_DICT_BLUE_SHIFT,             /* FT_Int     */\n    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_H,            /* FT_Short   */\n    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_V,            /* FT_Short   */\n    PS_DICT_FORCE_BOLD,             /* FT_Bool    */\n    PS_DICT_RND_STEM_UP,            /* FT_Bool    */\n    PS_DICT_MIN_FEATURE,            /* FT_Short   */\n    PS_DICT_LEN_IV,                 /* FT_Int     */\n    PS_DICT_PASSWORD,               /* FT_Long    */\n    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */\n\n    /* conventionally in the font FontInfo dictionary */\n    PS_DICT_VERSION,                /* FT_String* */\n    PS_DICT_NOTICE,                 /* FT_String* */\n    PS_DICT_FULL_NAME,              /* FT_String* */\n    PS_DICT_FAMILY_NAME,            /* FT_String* */\n    PS_DICT_WEIGHT,                 /* FT_String* */\n    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */\n    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */\n    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */\n    PS_DICT_FS_TYPE,                /* FT_UShort  */\n    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */\n\n    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE\n\n  } PS_Dict_Keys;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Value\n   *\n   * @description:\n   *    Retrieve the value for the supplied key from a PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   *    key ::\n   *       An enumeration value representing the dictionary key to retrieve.\n   *\n   *    idx ::\n   *       For array values, this specifies the index to be returned.\n   *\n   *    value ::\n   *       A pointer to memory into which to write the value.\n   *\n   *    valen_len ::\n   *       The size, in bytes, of the memory supplied for the value.\n   *\n   * @output:\n   *    value ::\n   *       The value matching the above key, if it exists.\n   *\n   * @return:\n   *    The amount of memory (in bytes) required to hold the requested\n   *    value (if it exists, -1 otherwise).\n   *\n   * @note:\n   *    The values returned are not pointers into the internal structures of\n   *    the face, but are `fresh' copies, so that the memory containing them\n   *    belongs to the calling application.  This also enforces the\n   *    `read-only' nature of these values, i.e., this function cannot be\n   *    used to manipulate the face.\n   *\n   *    `value' is a void pointer because the values returned can be of\n   *    various types.\n   *\n   *    If either `value' is NULL or `value_len' is too small, just the\n   *    required memory size for the requested entry is returned.\n   *\n   *    The `idx' parameter is used, not only to retrieve elements of, for\n   *    example, the FontMatrix or FontBBox, but also to retrieve name keys\n   *    from the CharStrings dictionary, and the charstrings themselves.  It\n   *    is ignored for atomic values.\n   *\n   *    PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000.  To\n   *    get the value as in the font stream, you need to divide by\n   *    65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).\n   *\n   *    IMPORTANT: Only key/value pairs read by the FreeType interpreter can\n   *    be retrieved.  So, for example, PostScript procedures such as NP,\n   *    ND, and RD are not available.  Arbitrary keys are, obviously, not be\n   *    available either.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Long )\n  FT_Get_PS_Font_Value( FT_Face       face,\n                        PS_Dict_Keys  key,\n                        FT_UInt       idx,\n                        void         *value,\n                        FT_Long       value_len );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __T1TABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ttnameid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttnameid.h                                                             */\n/*                                                                         */\n/*    TrueType name ID definitions (specification only).                   */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTNAMEID_H__\n#define __TTNAMEID_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values for the `platform' identifier code in the name        */\n  /* records of the TTF `name' table.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_PLATFORM_XXX\n   *\n   * @description:\n   *   A list of valid values for the `platform_id' identifier code in\n   *   @FT_CharMapRec and @FT_SfntName structures.\n   *\n   * @values:\n   *   TT_PLATFORM_APPLE_UNICODE ::\n   *     Used by Apple to indicate a Unicode character map and/or name entry.\n   *     See @TT_APPLE_ID_XXX for corresponding `encoding_id' values.  Note\n   *     that name entries in this format are coded as big-endian UCS-2\n   *     character codes _only_.\n   *\n   *   TT_PLATFORM_MACINTOSH ::\n   *     Used by Apple to indicate a MacOS-specific charmap and/or name entry.\n   *     See @TT_MAC_ID_XXX for corresponding `encoding_id' values.  Note that\n   *     most TrueType fonts contain an Apple roman charmap to be usable on\n   *     MacOS systems (even if they contain a Microsoft charmap as well).\n   *\n   *   TT_PLATFORM_ISO ::\n   *     This value was used to specify ISO/IEC 10646 charmaps.  It is however\n   *     now deprecated.  See @TT_ISO_ID_XXX for a list of corresponding\n   *     `encoding_id' values.\n   *\n   *   TT_PLATFORM_MICROSOFT ::\n   *     Used by Microsoft to indicate Windows-specific charmaps.  See\n   *     @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.\n   *     Note that most fonts contain a Unicode charmap using\n   *     (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).\n   *\n   *   TT_PLATFORM_CUSTOM ::\n   *     Used to indicate application-specific charmaps.\n   *\n   *   TT_PLATFORM_ADOBE ::\n   *     This value isn't part of any font format specification, but is used\n   *     by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec\n   *     structure.  See @TT_ADOBE_ID_XXX.\n   */\n\n#define TT_PLATFORM_APPLE_UNICODE  0\n#define TT_PLATFORM_MACINTOSH      1\n#define TT_PLATFORM_ISO            2 /* deprecated */\n#define TT_PLATFORM_MICROSOFT      3\n#define TT_PLATFORM_CUSTOM         4\n#define TT_PLATFORM_ADOBE          7 /* artificial */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_APPLE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.\n   *\n   * @values:\n   *   TT_APPLE_ID_DEFAULT ::\n   *     Unicode version 1.0.\n   *\n   *   TT_APPLE_ID_UNICODE_1_1 ::\n   *     Unicode 1.1; specifies Hangul characters starting at U+34xx.\n   *\n   *   TT_APPLE_ID_ISO_10646 ::\n   *     Deprecated (identical to preceding).\n   *\n   *   TT_APPLE_ID_UNICODE_2_0 ::\n   *     Unicode 2.0 and beyond (UTF-16 BMP only).\n   *\n   *   TT_APPLE_ID_UNICODE_32 ::\n   *     Unicode 3.1 and beyond, using UTF-32.\n   *\n   *   TT_APPLE_ID_VARIANT_SELECTOR ::\n   *     From Adobe, not Apple.  Not a normal cmap.  Specifies variations\n   *     on a real cmap.\n   */\n\n#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */\n#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */\n#define TT_APPLE_ID_ISO_10646         2 /* deprecated */\n#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */\n#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */\n#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MAC_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MACINTOSH charmaps and name entries.\n   *\n   * @values:\n   *   TT_MAC_ID_ROMAN ::\n   *   TT_MAC_ID_JAPANESE ::\n   *   TT_MAC_ID_TRADITIONAL_CHINESE ::\n   *   TT_MAC_ID_KOREAN ::\n   *   TT_MAC_ID_ARABIC ::\n   *   TT_MAC_ID_HEBREW ::\n   *   TT_MAC_ID_GREEK ::\n   *   TT_MAC_ID_RUSSIAN ::\n   *   TT_MAC_ID_RSYMBOL ::\n   *   TT_MAC_ID_DEVANAGARI ::\n   *   TT_MAC_ID_GURMUKHI ::\n   *   TT_MAC_ID_GUJARATI ::\n   *   TT_MAC_ID_ORIYA ::\n   *   TT_MAC_ID_BENGALI ::\n   *   TT_MAC_ID_TAMIL ::\n   *   TT_MAC_ID_TELUGU ::\n   *   TT_MAC_ID_KANNADA ::\n   *   TT_MAC_ID_MALAYALAM ::\n   *   TT_MAC_ID_SINHALESE ::\n   *   TT_MAC_ID_BURMESE ::\n   *   TT_MAC_ID_KHMER ::\n   *   TT_MAC_ID_THAI ::\n   *   TT_MAC_ID_LAOTIAN ::\n   *   TT_MAC_ID_GEORGIAN ::\n   *   TT_MAC_ID_ARMENIAN ::\n   *   TT_MAC_ID_MALDIVIAN ::\n   *   TT_MAC_ID_SIMPLIFIED_CHINESE ::\n   *   TT_MAC_ID_TIBETAN ::\n   *   TT_MAC_ID_MONGOLIAN ::\n   *   TT_MAC_ID_GEEZ ::\n   *   TT_MAC_ID_SLAVIC ::\n   *   TT_MAC_ID_VIETNAMESE ::\n   *   TT_MAC_ID_SINDHI ::\n   *   TT_MAC_ID_UNINTERP ::\n   */\n\n#define TT_MAC_ID_ROMAN                 0\n#define TT_MAC_ID_JAPANESE              1\n#define TT_MAC_ID_TRADITIONAL_CHINESE   2\n#define TT_MAC_ID_KOREAN                3\n#define TT_MAC_ID_ARABIC                4\n#define TT_MAC_ID_HEBREW                5\n#define TT_MAC_ID_GREEK                 6\n#define TT_MAC_ID_RUSSIAN               7\n#define TT_MAC_ID_RSYMBOL               8\n#define TT_MAC_ID_DEVANAGARI            9\n#define TT_MAC_ID_GURMUKHI             10\n#define TT_MAC_ID_GUJARATI             11\n#define TT_MAC_ID_ORIYA                12\n#define TT_MAC_ID_BENGALI              13\n#define TT_MAC_ID_TAMIL                14\n#define TT_MAC_ID_TELUGU               15\n#define TT_MAC_ID_KANNADA              16\n#define TT_MAC_ID_MALAYALAM            17\n#define TT_MAC_ID_SINHALESE            18\n#define TT_MAC_ID_BURMESE              19\n#define TT_MAC_ID_KHMER                20\n#define TT_MAC_ID_THAI                 21\n#define TT_MAC_ID_LAOTIAN              22\n#define TT_MAC_ID_GEORGIAN             23\n#define TT_MAC_ID_ARMENIAN             24\n#define TT_MAC_ID_MALDIVIAN            25\n#define TT_MAC_ID_SIMPLIFIED_CHINESE   25\n#define TT_MAC_ID_TIBETAN              26\n#define TT_MAC_ID_MONGOLIAN            27\n#define TT_MAC_ID_GEEZ                 28\n#define TT_MAC_ID_SLAVIC               29\n#define TT_MAC_ID_VIETNAMESE           30\n#define TT_MAC_ID_SINDHI               31\n#define TT_MAC_ID_UNINTERP             32\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ISO_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ISO charmaps and name entries.\n   *\n   *   Their use is now deprecated.\n   *\n   * @values:\n   *   TT_ISO_ID_7BIT_ASCII ::\n   *     ASCII.\n   *   TT_ISO_ID_10646 ::\n   *     ISO/10646.\n   *   TT_ISO_ID_8859_1 ::\n   *     Also known as Latin-1.\n   */\n\n#define TT_ISO_ID_7BIT_ASCII  0\n#define TT_ISO_ID_10646       1\n#define TT_ISO_ID_8859_1      2\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MS_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MICROSOFT charmaps and name entries.\n   *\n   * @values:\n   *   TT_MS_ID_SYMBOL_CS ::\n   *     Corresponds to Microsoft symbol encoding. See\n   *     @FT_ENCODING_MS_SYMBOL.\n   *\n   *   TT_MS_ID_UNICODE_CS ::\n   *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See\n   *     @FT_ENCODING_UNICODE.\n   *\n   *   TT_MS_ID_SJIS ::\n   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.\n   *\n   *   TT_MS_ID_GB2312 ::\n   *     Corresponds to Simplified Chinese as used in Mainland China.  See\n   *     @FT_ENCODING_GB2312.\n   *\n   *   TT_MS_ID_BIG_5 ::\n   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.\n   *     See @FT_ENCODING_BIG5.\n   *\n   *   TT_MS_ID_WANSUNG ::\n   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.\n   *\n   *   TT_MS_ID_JOHAB ::\n   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.\n   *\n   *   TT_MS_ID_UCS_4 ::\n   *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to\n   *     the OpenType specification version 1.4 (mid-2001.)\n   */\n\n#define TT_MS_ID_SYMBOL_CS    0\n#define TT_MS_ID_UNICODE_CS   1\n#define TT_MS_ID_SJIS         2\n#define TT_MS_ID_GB2312       3\n#define TT_MS_ID_BIG_5        4\n#define TT_MS_ID_WANSUNG      5\n#define TT_MS_ID_JOHAB        6\n#define TT_MS_ID_UCS_4       10\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ADOBE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ADOBE charmaps.  This is a FreeType-specific extension!\n   *\n   * @values:\n   *   TT_ADOBE_ID_STANDARD ::\n   *     Adobe standard encoding.\n   *   TT_ADOBE_ID_EXPERT ::\n   *     Adobe expert encoding.\n   *   TT_ADOBE_ID_CUSTOM ::\n   *     Adobe custom encoding.\n   *   TT_ADOBE_ID_LATIN_1 ::\n   *     Adobe Latin~1 encoding.\n   */\n\n#define TT_ADOBE_ID_STANDARD  0\n#define TT_ADOBE_ID_EXPERT    1\n#define TT_ADOBE_ID_CUSTOM    2\n#define TT_ADOBE_ID_LATIN_1   3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MACINTOSH.  These values are also used as return values   */\n  /* for function @FT_Get_CMap_Language_ID.                                */\n  /*                                                                       */\n  /* The canonical source for the Apple assigned Language ID's is at       */\n  /*                                                                       */\n  /*   https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html      */\n  /*                                                                       */\n#define TT_MAC_LANGID_ENGLISH                       0\n#define TT_MAC_LANGID_FRENCH                        1\n#define TT_MAC_LANGID_GERMAN                        2\n#define TT_MAC_LANGID_ITALIAN                       3\n#define TT_MAC_LANGID_DUTCH                         4\n#define TT_MAC_LANGID_SWEDISH                       5\n#define TT_MAC_LANGID_SPANISH                       6\n#define TT_MAC_LANGID_DANISH                        7\n#define TT_MAC_LANGID_PORTUGUESE                    8\n#define TT_MAC_LANGID_NORWEGIAN                     9\n#define TT_MAC_LANGID_HEBREW                       10\n#define TT_MAC_LANGID_JAPANESE                     11\n#define TT_MAC_LANGID_ARABIC                       12\n#define TT_MAC_LANGID_FINNISH                      13\n#define TT_MAC_LANGID_GREEK                        14\n#define TT_MAC_LANGID_ICELANDIC                    15\n#define TT_MAC_LANGID_MALTESE                      16\n#define TT_MAC_LANGID_TURKISH                      17\n#define TT_MAC_LANGID_CROATIAN                     18\n#define TT_MAC_LANGID_CHINESE_TRADITIONAL          19\n#define TT_MAC_LANGID_URDU                         20\n#define TT_MAC_LANGID_HINDI                        21\n#define TT_MAC_LANGID_THAI                         22\n#define TT_MAC_LANGID_KOREAN                       23\n#define TT_MAC_LANGID_LITHUANIAN                   24\n#define TT_MAC_LANGID_POLISH                       25\n#define TT_MAC_LANGID_HUNGARIAN                    26\n#define TT_MAC_LANGID_ESTONIAN                     27\n#define TT_MAC_LANGID_LETTISH                      28\n#define TT_MAC_LANGID_SAAMISK                      29\n#define TT_MAC_LANGID_FAEROESE                     30\n#define TT_MAC_LANGID_FARSI                        31\n#define TT_MAC_LANGID_RUSSIAN                      32\n#define TT_MAC_LANGID_CHINESE_SIMPLIFIED           33\n#define TT_MAC_LANGID_FLEMISH                      34\n#define TT_MAC_LANGID_IRISH                        35\n#define TT_MAC_LANGID_ALBANIAN                     36\n#define TT_MAC_LANGID_ROMANIAN                     37\n#define TT_MAC_LANGID_CZECH                        38\n#define TT_MAC_LANGID_SLOVAK                       39\n#define TT_MAC_LANGID_SLOVENIAN                    40\n#define TT_MAC_LANGID_YIDDISH                      41\n#define TT_MAC_LANGID_SERBIAN                      42\n#define TT_MAC_LANGID_MACEDONIAN                   43\n#define TT_MAC_LANGID_BULGARIAN                    44\n#define TT_MAC_LANGID_UKRAINIAN                    45\n#define TT_MAC_LANGID_BYELORUSSIAN                 46\n#define TT_MAC_LANGID_UZBEK                        47\n#define TT_MAC_LANGID_KAZAKH                       48\n#define TT_MAC_LANGID_AZERBAIJANI                  49\n#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT  49\n#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT    50\n#define TT_MAC_LANGID_ARMENIAN                     51\n#define TT_MAC_LANGID_GEORGIAN                     52\n#define TT_MAC_LANGID_MOLDAVIAN                    53\n#define TT_MAC_LANGID_KIRGHIZ                      54\n#define TT_MAC_LANGID_TAJIKI                       55\n#define TT_MAC_LANGID_TURKMEN                      56\n#define TT_MAC_LANGID_MONGOLIAN                    57\n#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT   57\n#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT    58\n#define TT_MAC_LANGID_PASHTO                       59\n#define TT_MAC_LANGID_KURDISH                      60\n#define TT_MAC_LANGID_KASHMIRI                     61\n#define TT_MAC_LANGID_SINDHI                       62\n#define TT_MAC_LANGID_TIBETAN                      63\n#define TT_MAC_LANGID_NEPALI                       64\n#define TT_MAC_LANGID_SANSKRIT                     65\n#define TT_MAC_LANGID_MARATHI                      66\n#define TT_MAC_LANGID_BENGALI                      67\n#define TT_MAC_LANGID_ASSAMESE                     68\n#define TT_MAC_LANGID_GUJARATI                     69\n#define TT_MAC_LANGID_PUNJABI                      70\n#define TT_MAC_LANGID_ORIYA                        71\n#define TT_MAC_LANGID_MALAYALAM                    72\n#define TT_MAC_LANGID_KANNADA                      73\n#define TT_MAC_LANGID_TAMIL                        74\n#define TT_MAC_LANGID_TELUGU                       75\n#define TT_MAC_LANGID_SINHALESE                    76\n#define TT_MAC_LANGID_BURMESE                      77\n#define TT_MAC_LANGID_KHMER                        78\n#define TT_MAC_LANGID_LAO                          79\n#define TT_MAC_LANGID_VIETNAMESE                   80\n#define TT_MAC_LANGID_INDONESIAN                   81\n#define TT_MAC_LANGID_TAGALOG                      82\n#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT           83\n#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT          84\n#define TT_MAC_LANGID_AMHARIC                      85\n#define TT_MAC_LANGID_TIGRINYA                     86\n#define TT_MAC_LANGID_GALLA                        87\n#define TT_MAC_LANGID_SOMALI                       88\n#define TT_MAC_LANGID_SWAHILI                      89\n#define TT_MAC_LANGID_RUANDA                       90\n#define TT_MAC_LANGID_RUNDI                        91\n#define TT_MAC_LANGID_CHEWA                        92\n#define TT_MAC_LANGID_MALAGASY                     93\n#define TT_MAC_LANGID_ESPERANTO                    94\n#define TT_MAC_LANGID_WELSH                       128\n#define TT_MAC_LANGID_BASQUE                      129\n#define TT_MAC_LANGID_CATALAN                     130\n#define TT_MAC_LANGID_LATIN                       131\n#define TT_MAC_LANGID_QUECHUA                     132\n#define TT_MAC_LANGID_GUARANI                     133\n#define TT_MAC_LANGID_AYMARA                      134\n#define TT_MAC_LANGID_TATAR                       135\n#define TT_MAC_LANGID_UIGHUR                      136\n#define TT_MAC_LANGID_DZONGKHA                    137\n#define TT_MAC_LANGID_JAVANESE                    138\n#define TT_MAC_LANGID_SUNDANESE                   139\n\n\n#if 0  /* these seem to be errors that have been dropped */\n\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             140\n#define TT_MAC_LANGID_IRISH_GAELIC                141\n\n#endif\n\n\n  /* The following codes are new as of 2000-03-10 */\n#define TT_MAC_LANGID_GALICIAN                    140\n#define TT_MAC_LANGID_AFRIKAANS                   141\n#define TT_MAC_LANGID_BRETON                      142\n#define TT_MAC_LANGID_INUKTITUT                   143\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             144\n#define TT_MAC_LANGID_MANX_GAELIC                 145\n#define TT_MAC_LANGID_IRISH_GAELIC                146\n#define TT_MAC_LANGID_TONGAN                      147\n#define TT_MAC_LANGID_GREEK_POLYTONIC             148\n#define TT_MAC_LANGID_GREELANDIC                  149\n#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT    150\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MICROSOFT.                                                */\n  /*                                                                       */\n  /* The canonical source for the MS assigned LCIDs is                     */\n  /*                                                                       */\n  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */\n  /*                                                                       */\n\n#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001\n#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401\n#define TT_MS_LANGID_ARABIC_IRAQ                       0x0801\n#define TT_MS_LANGID_ARABIC_EGYPT                      0x0c01\n#define TT_MS_LANGID_ARABIC_LIBYA                      0x1001\n#define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401\n#define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801\n#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1c01\n#define TT_MS_LANGID_ARABIC_OMAN                       0x2001\n#define TT_MS_LANGID_ARABIC_YEMEN                      0x2401\n#define TT_MS_LANGID_ARABIC_SYRIA                      0x2801\n#define TT_MS_LANGID_ARABIC_JORDAN                     0x2c01\n#define TT_MS_LANGID_ARABIC_LEBANON                    0x3001\n#define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401\n#define TT_MS_LANGID_ARABIC_UAE                        0x3801\n#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3c01\n#define TT_MS_LANGID_ARABIC_QATAR                      0x4001\n#define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402\n#define TT_MS_LANGID_CATALAN_SPAIN                     0x0403\n#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004\n#define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404\n#define TT_MS_LANGID_CHINESE_PRC                       0x0804\n#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0c04\n#define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004\n\n#if 1  /* this looks like the correct value */\n#define TT_MS_LANGID_CHINESE_MACAU                     0x1404\n#else  /* but beware, Microsoft may change its mind...\n          the most recent Word reference has the following: */\n#define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG\n#endif\n\n#if 0  /* used only with .NET `cultures'; commented out */\n#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04\n#endif\n\n#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405\n#define TT_MS_LANGID_DANISH_DENMARK                    0x0406\n#define TT_MS_LANGID_GERMAN_GERMANY                    0x0407\n#define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807\n#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0c07\n#define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007\n#define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407\n#define TT_MS_LANGID_GREEK_GREECE                      0x0408\n\n  /* don't ask what this one means... It is commented out currently. */\n#if 0\n#define TT_MS_LANGID_GREEK_GREECE2                     0x2008\n#endif\n\n#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009\n#define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409\n#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809\n#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0c09\n#define TT_MS_LANGID_ENGLISH_CANADA                    0x1009\n#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409\n#define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809\n#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1c09\n#define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009\n#define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409\n#define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809\n#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2c09\n#define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009\n#define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409\n#define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809\n#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3c09\n#define TT_MS_LANGID_ENGLISH_INDIA                     0x4009\n#define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409\n#define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809\n#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040a\n#define TT_MS_LANGID_SPANISH_MEXICO                    0x080a\n#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0c0a\n#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100a\n#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140a\n#define TT_MS_LANGID_SPANISH_PANAMA                    0x180a\n#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1c0a\n#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200a\n#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240a\n#define TT_MS_LANGID_SPANISH_PERU                      0x280a\n#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2c0a\n#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300a\n#define TT_MS_LANGID_SPANISH_CHILE                     0x340a\n#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380a\n#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3c0a\n#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400a\n#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440a\n#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480a\n#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4c0a\n#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500a\n#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a\n  /* The following ID blatantly violate MS specs by using a */\n  /* sublanguage > 0x1F.                                    */\n#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU\n#define TT_MS_LANGID_FINNISH_FINLAND                   0x040b\n#define TT_MS_LANGID_FRENCH_FRANCE                     0x040c\n#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080c\n#define TT_MS_LANGID_FRENCH_CANADA                     0x0c0c\n#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100c\n#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140c\n#define TT_MS_LANGID_FRENCH_MONACO                     0x180c\n#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1c0c\n#define TT_MS_LANGID_FRENCH_REUNION                    0x200c\n#define TT_MS_LANGID_FRENCH_CONGO                      0x240c\n  /* which was formerly: */\n#define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO\n#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280c\n#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2c0c\n#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300c\n#define TT_MS_LANGID_FRENCH_MALI                       0x340c\n#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c\n#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c\n  /* and another violation of the spec (see 0xE40aU) */\n#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU\n#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040d\n#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040e\n#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040f\n#define TT_MS_LANGID_ITALIAN_ITALY                     0x0410\n#define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810\n#define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411\n#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA     0x0412\n#define TT_MS_LANGID_KOREAN_JOHAB_KOREA                0x0812\n#define TT_MS_LANGID_DUTCH_NETHERLANDS                 0x0413\n#define TT_MS_LANGID_DUTCH_BELGIUM                     0x0813\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL           0x0414\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK          0x0814\n#define TT_MS_LANGID_POLISH_POLAND                     0x0415\n#define TT_MS_LANGID_PORTUGUESE_BRAZIL                 0x0416\n#define TT_MS_LANGID_PORTUGUESE_PORTUGAL               0x0816\n#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND        0x0417\n#define TT_MS_LANGID_ROMANIAN_ROMANIA                  0x0418\n#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818\n#define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419\n#define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819\n#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041a\n#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081a\n#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0c1a\n\n#if 0  /* this used to be this value, but it looks like we were wrong */\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a\n#else  /* current sources say */\n#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101a\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141a\n       /* and XPsp2 Platform SDK added (2004-07-26) */\n       /* Names are shortened to be significant within 40 chars. */\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181a\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181a\n#endif\n\n#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041b\n#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041c\n#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041d\n#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081d\n#define TT_MS_LANGID_THAI_THAILAND                     0x041e\n#define TT_MS_LANGID_TURKISH_TURKEY                    0x041f\n#define TT_MS_LANGID_URDU_PAKISTAN                     0x0420\n#define TT_MS_LANGID_URDU_INDIA                        0x0820\n#define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421\n#define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422\n#define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423\n#define TT_MS_LANGID_SLOVENE_SLOVENIA                  0x0424\n#define TT_MS_LANGID_ESTONIAN_ESTONIA                  0x0425\n#define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426\n#define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427\n#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827\n#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428\n#define TT_MS_LANGID_FARSI_IRAN                        0x0429\n#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042a\n#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042b\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042c\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082c\n#define TT_MS_LANGID_BASQUE_SPAIN                      0x042d\n#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042e\n#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042f\n#define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430\n#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431\n#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432\n#define TT_MS_LANGID_VENDA_SOUTH_AFRICA                0x0433\n#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA                0x0434\n#define TT_MS_LANGID_ZULU_SOUTH_AFRICA                 0x0435\n#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA            0x0436\n#define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437\n#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438\n#define TT_MS_LANGID_HINDI_INDIA                       0x0439\n#define TT_MS_LANGID_MALTESE_MALTA                     0x043a\n  /* Added by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043b\n#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083b\n#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3b\n#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103b\n#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143b\n#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183b\n#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3b\n#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203b\n#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243b\n  /* ... and we also keep our old identifier... */\n#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b\n\n#if 0 /* this seems to be a previous inversion */\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#else\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#endif\n\n#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d\n#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043e\n#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083e\n#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043f\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \\\n          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN\n\n#define TT_MS_LANGID_SWAHILI_KENYA                     0x0441\n#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843\n#define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444\n#define TT_MS_LANGID_BENGALI_INDIA                     0x0445\n#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845\n#define TT_MS_LANGID_PUNJABI_INDIA                     0x0446\n#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846\n#define TT_MS_LANGID_GUJARATI_INDIA                    0x0447\n#define TT_MS_LANGID_ORIYA_INDIA                       0x0448\n#define TT_MS_LANGID_TAMIL_INDIA                       0x0449\n#define TT_MS_LANGID_TELUGU_INDIA                      0x044a\n#define TT_MS_LANGID_KANNADA_INDIA                     0x044b\n#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044c\n#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044d\n#define TT_MS_LANGID_MARATHI_INDIA                     0x044e\n#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044f\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850\n#define TT_MS_LANGID_TIBETAN_CHINA                     0x0451\n  /* Don't use the next constant!  It has            */\n  /*   (1) the wrong spelling (Dzonghka)             */\n  /*   (2) Microsoft doesn't officially define it -- */\n  /*       at least it is not in the List of Local   */\n  /*       ID Values.                                */\n  /*   (3) Dzongkha is not the same language as      */\n  /*       Tibetan, so merging it is wrong anyway.   */\n  /*                                                 */\n  /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW.    */\n#define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851\n\n#if 0\n  /* the following used to be defined */\n#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451\n  /* ... but it was changed; */\n#else\n  /* So we will continue to #define it, but with the correct value */\n#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN\n#endif\n\n#define TT_MS_LANGID_WELSH_WALES                       0x0452\n#define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453\n#define TT_MS_LANGID_LAO_LAOS                          0x0454\n#define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455\n#define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456\n#define TT_MS_LANGID_KONKANI_INDIA                     0x0457\n#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458\n#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459\n#define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859\n  /* Missing a LCID for Sindhi in Devanagari script */\n#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045a\n#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045b\n#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045c\n#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045d\n#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045e\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045f\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085f\n  /* Missing a LCID for Tifinagh script */\n#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460\n  /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */\n  /* script is yet unclear... might be Arabic, Nagari or Sharada */\n#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860\n  /* ... and aliased (by MS) for compatibility reasons. */\n#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA\n#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461\n#define TT_MS_LANGID_NEPALI_INDIA                      0x0861\n#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462\n#define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463\n#define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464\n#define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES\n#define TT_MS_LANGID_EDO_NIGERIA                       0x0466\n#define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467\n#define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468\n#define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469\n#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046a\n#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046b\n#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086b\n#define TT_MS_LANGID_QUECHUA_PERU                      0x0c6b\n#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046c\n  /* Also spelled by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \\\n          TT_MS_LANGID_SEPEDI_SOUTH_AFRICA\n  /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */\n#define TT_MS_LANGID_IGBO_NIGERIA                      0x0470\n#define TT_MS_LANGID_KANURI_NIGERIA                    0x0471\n#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472\n#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473\n#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873\n  /* also spelled in the `Passport SDK' list as: */\n#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA\n#define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474\n#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475\n#define TT_MS_LANGID_LATIN                             0x0476\n#define TT_MS_LANGID_SOMALI_SOMALIA                    0x0477\n  /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */\n  /*       not written (but OTOH the peculiar writing system is worth     */\n  /*       studying).                                                     */\n#define TT_MS_LANGID_YI_CHINA                          0x0478\n#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479\n  /* language codes from 0x047a to 0x047f are (still) unknown. */\n#define TT_MS_LANGID_UIGHUR_CHINA                      0x0480\n#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481\n\n#if 0  /* not deemed useful for fonts */\n#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04ff\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the `name' identifier field in the name records of */\n  /* the TTF `name' table.  These values are platform independent.         */\n  /*                                                                       */\n#define TT_NAME_ID_COPYRIGHT            0\n#define TT_NAME_ID_FONT_FAMILY          1\n#define TT_NAME_ID_FONT_SUBFAMILY       2\n#define TT_NAME_ID_UNIQUE_ID            3\n#define TT_NAME_ID_FULL_NAME            4\n#define TT_NAME_ID_VERSION_STRING       5\n#define TT_NAME_ID_PS_NAME              6\n#define TT_NAME_ID_TRADEMARK            7\n\n  /* the following values are from the OpenType spec */\n#define TT_NAME_ID_MANUFACTURER         8\n#define TT_NAME_ID_DESIGNER             9\n#define TT_NAME_ID_DESCRIPTION          10\n#define TT_NAME_ID_VENDOR_URL           11\n#define TT_NAME_ID_DESIGNER_URL         12\n#define TT_NAME_ID_LICENSE              13\n#define TT_NAME_ID_LICENSE_URL          14\n  /* number 15 is reserved */\n#define TT_NAME_ID_PREFERRED_FAMILY     16\n#define TT_NAME_ID_PREFERRED_SUBFAMILY  17\n#define TT_NAME_ID_MAC_FULL_NAME        18\n\n  /* The following code is new as of 2000-01-21 */\n#define TT_NAME_ID_SAMPLE_TEXT          19\n\n  /* This is new in OpenType 1.3 */\n#define TT_NAME_ID_CID_FINDFONT_NAME    20\n\n  /* This is new in OpenType 1.5 */\n#define TT_NAME_ID_WWS_FAMILY           21\n#define TT_NAME_ID_WWS_SUBFAMILY        22\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table.     */\n  /*                                                                       */\n  /* Updated 08-Nov-2008.                                                  */\n  /*                                                                       */\n\n  /* Bit  0   Basic Latin */\n#define TT_UCR_BASIC_LATIN                     (1L <<  0) /* U+0020-U+007E */\n  /* Bit  1   C1 Controls and Latin-1 Supplement */\n#define TT_UCR_LATIN1_SUPPLEMENT               (1L <<  1) /* U+0080-U+00FF */\n  /* Bit  2   Latin Extended-A */\n#define TT_UCR_LATIN_EXTENDED_A                (1L <<  2) /* U+0100-U+017F */\n  /* Bit  3   Latin Extended-B */\n#define TT_UCR_LATIN_EXTENDED_B                (1L <<  3) /* U+0180-U+024F */\n  /* Bit  4   IPA Extensions                 */\n  /*          Phonetic Extensions            */\n  /*          Phonetic Extensions Supplement */\n#define TT_UCR_IPA_EXTENSIONS                  (1L <<  4) /* U+0250-U+02AF */\n                                                          /* U+1D00-U+1D7F */\n                                                          /* U+1D80-U+1DBF */\n  /* Bit  5   Spacing Modifier Letters */\n  /*          Modifier Tone Letters    */\n#define TT_UCR_SPACING_MODIFIER                (1L <<  5) /* U+02B0-U+02FF */\n                                                          /* U+A700-U+A71F */\n  /* Bit  6   Combining Diacritical Marks            */\n  /*          Combining Diacritical Marks Supplement */\n#define TT_UCR_COMBINING_DIACRITICS            (1L <<  6) /* U+0300-U+036F */\n                                                          /* U+1DC0-U+1DFF */\n  /* Bit  7   Greek and Coptic */\n#define TT_UCR_GREEK                           (1L <<  7) /* U+0370-U+03FF */\n  /* Bit  8   Coptic */\n#define TT_UCR_COPTIC                          (1L <<  8) /* U+2C80-U+2CFF */\n  /* Bit  9   Cyrillic            */\n  /*          Cyrillic Supplement */\n  /*          Cyrillic Extended-A */\n  /*          Cyrillic Extended-B */\n#define TT_UCR_CYRILLIC                        (1L <<  9) /* U+0400-U+04FF */\n                                                          /* U+0500-U+052F */\n                                                          /* U+2DE0-U+2DFF */\n                                                          /* U+A640-U+A69F */\n  /* Bit 10   Armenian */\n#define TT_UCR_ARMENIAN                        (1L << 10) /* U+0530-U+058F */\n  /* Bit 11   Hebrew */\n#define TT_UCR_HEBREW                          (1L << 11) /* U+0590-U+05FF */\n  /* Bit 12   Vai */\n#define TT_UCR_VAI                             (1L << 12) /* U+A500-U+A63F */\n  /* Bit 13   Arabic            */\n  /*          Arabic Supplement */\n#define TT_UCR_ARABIC                          (1L << 13) /* U+0600-U+06FF */\n                                                          /* U+0750-U+077F */\n  /* Bit 14   NKo */\n#define TT_UCR_NKO                             (1L << 14) /* U+07C0-U+07FF */\n  /* Bit 15   Devanagari */\n#define TT_UCR_DEVANAGARI                      (1L << 15) /* U+0900-U+097F */\n  /* Bit 16   Bengali */\n#define TT_UCR_BENGALI                         (1L << 16) /* U+0980-U+09FF */\n  /* Bit 17   Gurmukhi */\n#define TT_UCR_GURMUKHI                        (1L << 17) /* U+0A00-U+0A7F */\n  /* Bit 18   Gujarati */\n#define TT_UCR_GUJARATI                        (1L << 18) /* U+0A80-U+0AFF */\n  /* Bit 19   Oriya */\n#define TT_UCR_ORIYA                           (1L << 19) /* U+0B00-U+0B7F */\n  /* Bit 20   Tamil */\n#define TT_UCR_TAMIL                           (1L << 20) /* U+0B80-U+0BFF */\n  /* Bit 21   Telugu */\n#define TT_UCR_TELUGU                          (1L << 21) /* U+0C00-U+0C7F */\n  /* Bit 22   Kannada */\n#define TT_UCR_KANNADA                         (1L << 22) /* U+0C80-U+0CFF */\n  /* Bit 23   Malayalam */\n#define TT_UCR_MALAYALAM                       (1L << 23) /* U+0D00-U+0D7F */\n  /* Bit 24   Thai */\n#define TT_UCR_THAI                            (1L << 24) /* U+0E00-U+0E7F */\n  /* Bit 25   Lao */\n#define TT_UCR_LAO                             (1L << 25) /* U+0E80-U+0EFF */\n  /* Bit 26   Georgian            */\n  /*          Georgian Supplement */\n#define TT_UCR_GEORGIAN                        (1L << 26) /* U+10A0-U+10FF */\n                                                          /* U+2D00-U+2D2F */\n  /* Bit 27   Balinese */\n#define TT_UCR_BALINESE                        (1L << 27) /* U+1B00-U+1B7F */\n  /* Bit 28   Hangul Jamo */\n#define TT_UCR_HANGUL_JAMO                     (1L << 28) /* U+1100-U+11FF */\n  /* Bit 29   Latin Extended Additional */\n  /*          Latin Extended-C          */\n  /*          Latin Extended-D          */\n#define TT_UCR_LATIN_EXTENDED_ADDITIONAL       (1L << 29) /* U+1E00-U+1EFF */\n                                                          /* U+2C60-U+2C7F */\n                                                          /* U+A720-U+A7FF */\n  /* Bit 30   Greek Extended */\n#define TT_UCR_GREEK_EXTENDED                  (1L << 30) /* U+1F00-U+1FFF */\n  /* Bit 31   General Punctuation      */\n  /*          Supplemental Punctuation */\n#define TT_UCR_GENERAL_PUNCTUATION             (1L << 31) /* U+2000-U+206F */\n                                                          /* U+2E00-U+2E7F */\n  /* Bit 32   Superscripts And Subscripts */\n#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS         (1L <<  0) /* U+2070-U+209F */\n  /* Bit 33   Currency Symbols */\n#define TT_UCR_CURRENCY_SYMBOLS                (1L <<  1) /* U+20A0-U+20CF */\n  /* Bit 34   Combining Diacritical Marks For Symbols */\n#define TT_UCR_COMBINING_DIACRITICS_SYMB       (1L <<  2) /* U+20D0-U+20FF */\n  /* Bit 35   Letterlike Symbols */\n#define TT_UCR_LETTERLIKE_SYMBOLS              (1L <<  3) /* U+2100-U+214F */\n  /* Bit 36   Number Forms */\n#define TT_UCR_NUMBER_FORMS                    (1L <<  4) /* U+2150-U+218F */\n  /* Bit 37   Arrows                           */\n  /*          Supplemental Arrows-A            */\n  /*          Supplemental Arrows-B            */\n  /*          Miscellaneous Symbols and Arrows */\n#define TT_UCR_ARROWS                          (1L <<  5) /* U+2190-U+21FF */\n                                                          /* U+27F0-U+27FF */\n                                                          /* U+2900-U+297F */\n                                                          /* U+2B00-U+2BFF */\n  /* Bit 38   Mathematical Operators               */\n  /*          Supplemental Mathematical Operators  */\n  /*          Miscellaneous Mathematical Symbols-A */\n  /*          Miscellaneous Mathematical Symbols-B */\n#define TT_UCR_MATHEMATICAL_OPERATORS          (1L <<  6) /* U+2200-U+22FF */\n                                                          /* U+2A00-U+2AFF */\n                                                          /* U+27C0-U+27EF */\n                                                          /* U+2980-U+29FF */\n  /* Bit 39 Miscellaneous Technical */\n#define TT_UCR_MISCELLANEOUS_TECHNICAL         (1L <<  7) /* U+2300-U+23FF */\n  /* Bit 40   Control Pictures */\n#define TT_UCR_CONTROL_PICTURES                (1L <<  8) /* U+2400-U+243F */\n  /* Bit 41   Optical Character Recognition */\n#define TT_UCR_OCR                             (1L <<  9) /* U+2440-U+245F */\n  /* Bit 42   Enclosed Alphanumerics */\n#define TT_UCR_ENCLOSED_ALPHANUMERICS          (1L << 10) /* U+2460-U+24FF */\n  /* Bit 43   Box Drawing */\n#define TT_UCR_BOX_DRAWING                     (1L << 11) /* U+2500-U+257F */\n  /* Bit 44   Block Elements */\n#define TT_UCR_BLOCK_ELEMENTS                  (1L << 12) /* U+2580-U+259F */\n  /* Bit 45   Geometric Shapes */\n#define TT_UCR_GEOMETRIC_SHAPES                (1L << 13) /* U+25A0-U+25FF */\n  /* Bit 46   Miscellaneous Symbols */\n#define TT_UCR_MISCELLANEOUS_SYMBOLS           (1L << 14) /* U+2600-U+26FF */\n  /* Bit 47   Dingbats */\n#define TT_UCR_DINGBATS                        (1L << 15) /* U+2700-U+27BF */\n  /* Bit 48   CJK Symbols and Punctuation */\n#define TT_UCR_CJK_SYMBOLS                     (1L << 16) /* U+3000-U+303F */\n  /* Bit 49   Hiragana */\n#define TT_UCR_HIRAGANA                        (1L << 17) /* U+3040-U+309F */\n  /* Bit 50   Katakana                     */\n  /*          Katakana Phonetic Extensions */\n#define TT_UCR_KATAKANA                        (1L << 18) /* U+30A0-U+30FF */\n                                                          /* U+31F0-U+31FF */\n  /* Bit 51   Bopomofo          */\n  /*          Bopomofo Extended */\n#define TT_UCR_BOPOMOFO                        (1L << 19) /* U+3100-U+312F */\n                                                          /* U+31A0-U+31BF */\n  /* Bit 52   Hangul Compatibility Jamo */\n#define TT_UCR_HANGUL_COMPATIBILITY_JAMO       (1L << 20) /* U+3130-U+318F */\n  /* Bit 53   Phags-Pa */\n#define TT_UCR_CJK_MISC                        (1L << 21) /* U+A840-U+A87F */\n#define TT_UCR_KANBUN  TT_UCR_CJK_MISC /* deprecated */\n#define TT_UCR_PHAGSPA\n  /* Bit 54   Enclosed CJK Letters and Months */\n#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS     (1L << 22) /* U+3200-U+32FF */\n  /* Bit 55   CJK Compatibility */\n#define TT_UCR_CJK_COMPATIBILITY               (1L << 23) /* U+3300-U+33FF */\n  /* Bit 56   Hangul Syllables */\n#define TT_UCR_HANGUL                          (1L << 24) /* U+AC00-U+D7A3 */\n  /* Bit 57   High Surrogates              */\n  /*          High Private Use Surrogates  */\n  /*          Low Surrogates               */\n  /*                                       */\n  /* According to OpenType specs v.1.3+,   */\n  /* setting bit 57 implies that there is  */\n  /* at least one codepoint beyond the     */\n  /* Basic Multilingual Plane that is      */\n  /* supported by this font.  So it really */\n  /* means >= U+10000                      */\n#define TT_UCR_SURROGATES                      (1L << 25) /* U+D800-U+DB7F */\n                                                          /* U+DB80-U+DBFF */\n                                                          /* U+DC00-U+DFFF */\n#define TT_UCR_NON_PLANE_0  TT_UCR_SURROGATES\n  /* Bit 58  Phoenician */\n#define TT_UCR_PHOENICIAN                      (1L << 26) /*U+10900-U+1091F*/\n  /* Bit 59   CJK Unified Ideographs             */\n  /*          CJK Radicals Supplement            */\n  /*          Kangxi Radicals                    */\n  /*          Ideographic Description Characters */\n  /*          CJK Unified Ideographs Extension A */\n  /*          CJK Unified Ideographs Extension B */\n  /*          Kanbun                             */\n#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS          (1L << 27) /* U+4E00-U+9FFF */\n                                                          /* U+2E80-U+2EFF */\n                                                          /* U+2F00-U+2FDF */\n                                                          /* U+2FF0-U+2FFF */\n                                                          /* U+3400-U+4DB5 */\n                                                          /*U+20000-U+2A6DF*/\n                                                          /* U+3190-U+319F */\n  /* Bit 60   Private Use */\n#define TT_UCR_PRIVATE_USE                     (1L << 28) /* U+E000-U+F8FF */\n  /* Bit 61   CJK Strokes                             */\n  /*          CJK Compatibility Ideographs            */\n  /*          CJK Compatibility Ideographs Supplement */\n#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS    (1L << 29) /* U+31C0-U+31EF */\n                                                          /* U+F900-U+FAFF */\n                                                          /*U+2F800-U+2FA1F*/\n  /* Bit 62   Alphabetic Presentation Forms */\n#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS   (1L << 30) /* U+FB00-U+FB4F */\n  /* Bit 63   Arabic Presentation Forms-A */\n#define TT_UCR_ARABIC_PRESENTATIONS_A          (1L << 31) /* U+FB50-U+FDFF */\n  /* Bit 64   Combining Half Marks */\n#define TT_UCR_COMBINING_HALF_MARKS            (1L <<  0) /* U+FE20-U+FE2F */\n  /* Bit 65   Vertical forms          */\n  /*          CJK Compatibility Forms */\n#define TT_UCR_CJK_COMPATIBILITY_FORMS         (1L <<  1) /* U+FE10-U+FE1F */\n                                                          /* U+FE30-U+FE4F */\n  /* Bit 66   Small Form Variants */\n#define TT_UCR_SMALL_FORM_VARIANTS             (1L <<  2) /* U+FE50-U+FE6F */\n  /* Bit 67   Arabic Presentation Forms-B */\n#define TT_UCR_ARABIC_PRESENTATIONS_B          (1L <<  3) /* U+FE70-U+FEFE */\n  /* Bit 68   Halfwidth and Fullwidth Forms */\n#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS       (1L <<  4) /* U+FF00-U+FFEF */\n  /* Bit 69   Specials */\n#define TT_UCR_SPECIALS                        (1L <<  5) /* U+FFF0-U+FFFD */\n  /* Bit 70   Tibetan */\n#define TT_UCR_TIBETAN                         (1L <<  6) /* U+0F00-U+0FFF */\n  /* Bit 71   Syriac */\n#define TT_UCR_SYRIAC                          (1L <<  7) /* U+0700-U+074F */\n  /* Bit 72   Thaana */\n#define TT_UCR_THAANA                          (1L <<  8) /* U+0780-U+07BF */\n  /* Bit 73   Sinhala */\n#define TT_UCR_SINHALA                         (1L <<  9) /* U+0D80-U+0DFF */\n  /* Bit 74   Myanmar */\n#define TT_UCR_MYANMAR                         (1L << 10) /* U+1000-U+109F */\n  /* Bit 75   Ethiopic            */\n  /*          Ethiopic Supplement */\n  /*          Ethiopic Extended   */\n#define TT_UCR_ETHIOPIC                        (1L << 11) /* U+1200-U+137F */\n                                                          /* U+1380-U+139F */\n                                                          /* U+2D80-U+2DDF */\n  /* Bit 76   Cherokee */\n#define TT_UCR_CHEROKEE                        (1L << 12) /* U+13A0-U+13FF */\n  /* Bit 77   Unified Canadian Aboriginal Syllabics */\n#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS   (1L << 13) /* U+1400-U+167F */\n  /* Bit 78   Ogham */\n#define TT_UCR_OGHAM                           (1L << 14) /* U+1680-U+169F */\n  /* Bit 79   Runic */\n#define TT_UCR_RUNIC                           (1L << 15) /* U+16A0-U+16FF */\n  /* Bit 80   Khmer         */\n  /*          Khmer Symbols */\n#define TT_UCR_KHMER                           (1L << 16) /* U+1780-U+17FF */\n                                                          /* U+19E0-U+19FF */\n  /* Bit 81   Mongolian */\n#define TT_UCR_MONGOLIAN                       (1L << 17) /* U+1800-U+18AF */\n  /* Bit 82   Braille Patterns */\n#define TT_UCR_BRAILLE                         (1L << 18) /* U+2800-U+28FF */\n  /* Bit 83   Yi Syllables */\n  /*          Yi Radicals  */\n#define TT_UCR_YI                              (1L << 19) /* U+A000-U+A48F */\n                                                          /* U+A490-U+A4CF */\n  /* Bit 84   Tagalog  */\n  /*          Hanunoo  */\n  /*          Buhid    */\n  /*          Tagbanwa */\n#define TT_UCR_PHILIPPINE                      (1L << 20) /* U+1700-U+171F */\n                                                          /* U+1720-U+173F */\n                                                          /* U+1740-U+175F */\n                                                          /* U+1760-U+177F */\n  /* Bit 85   Old Italic */\n#define TT_UCR_OLD_ITALIC                      (1L << 21) /*U+10300-U+1032F*/\n  /* Bit 86   Gothic */\n#define TT_UCR_GOTHIC                          (1L << 22) /*U+10330-U+1034F*/\n  /* Bit 87   Deseret */\n#define TT_UCR_DESERET                         (1L << 23) /*U+10400-U+1044F*/\n  /* Bit 88   Byzantine Musical Symbols      */\n  /*          Musical Symbols                */\n  /*          Ancient Greek Musical Notation */\n#define TT_UCR_MUSICAL_SYMBOLS                 (1L << 24) /*U+1D000-U+1D0FF*/\n                                                          /*U+1D100-U+1D1FF*/\n                                                          /*U+1D200-U+1D24F*/\n  /* Bit 89   Mathematical Alphanumeric Symbols */\n#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS       (1L << 25) /*U+1D400-U+1D7FF*/\n  /* Bit 90   Private Use (plane 15) */\n  /*          Private Use (plane 16) */\n#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY       (1L << 26) /*U+F0000-U+FFFFD*/\n                                                        /*U+100000-U+10FFFD*/\n  /* Bit 91   Variation Selectors            */\n  /*          Variation Selectors Supplement */\n#define TT_UCR_VARIATION_SELECTORS             (1L << 27) /* U+FE00-U+FE0F */\n                                                          /*U+E0100-U+E01EF*/\n  /* Bit 92   Tags */\n#define TT_UCR_TAGS                            (1L << 28) /*U+E0000-U+E007F*/\n  /* Bit 93   Limbu */\n#define TT_UCR_LIMBU                           (1L << 29) /* U+1900-U+194F */\n  /* Bit 94   Tai Le */\n#define TT_UCR_TAI_LE                          (1L << 30) /* U+1950-U+197F */\n  /* Bit 95   New Tai Lue */\n#define TT_UCR_NEW_TAI_LUE                     (1L << 31) /* U+1980-U+19DF */\n  /* Bit 96   Buginese */\n#define TT_UCR_BUGINESE                        (1L <<  0) /* U+1A00-U+1A1F */\n  /* Bit 97   Glagolitic */\n#define TT_UCR_GLAGOLITIC                      (1L <<  1) /* U+2C00-U+2C5F */\n  /* Bit 98   Tifinagh */\n#define TT_UCR_TIFINAGH                        (1L <<  2) /* U+2D30-U+2D7F */\n  /* Bit 99   Yijing Hexagram Symbols */\n#define TT_UCR_YIJING                          (1L <<  3) /* U+4DC0-U+4DFF */\n  /* Bit 100  Syloti Nagri */\n#define TT_UCR_SYLOTI_NAGRI                    (1L <<  4) /* U+A800-U+A82F */\n  /* Bit 101  Linear B Syllabary */\n  /*          Linear B Ideograms */\n  /*          Aegean Numbers     */\n#define TT_UCR_LINEAR_B                        (1L <<  5) /*U+10000-U+1007F*/\n                                                          /*U+10080-U+100FF*/\n                                                          /*U+10100-U+1013F*/\n  /* Bit 102  Ancient Greek Numbers */\n#define TT_UCR_ANCIENT_GREEK_NUMBERS           (1L <<  6) /*U+10140-U+1018F*/\n  /* Bit 103  Ugaritic */\n#define TT_UCR_UGARITIC                        (1L <<  7) /*U+10380-U+1039F*/\n  /* Bit 104  Old Persian */\n#define TT_UCR_OLD_PERSIAN                     (1L <<  8) /*U+103A0-U+103DF*/\n  /* Bit 105  Shavian */\n#define TT_UCR_SHAVIAN                         (1L <<  9) /*U+10450-U+1047F*/\n  /* Bit 106  Osmanya */\n#define TT_UCR_OSMANYA                         (1L << 10) /*U+10480-U+104AF*/\n  /* Bit 107  Cypriot Syllabary */\n#define TT_UCR_CYPRIOT_SYLLABARY               (1L << 11) /*U+10800-U+1083F*/\n  /* Bit 108  Kharoshthi */\n#define TT_UCR_KHAROSHTHI                      (1L << 12) /*U+10A00-U+10A5F*/\n  /* Bit 109  Tai Xuan Jing Symbols */\n#define TT_UCR_TAI_XUAN_JING                   (1L << 13) /*U+1D300-U+1D35F*/\n  /* Bit 110  Cuneiform                         */\n  /*          Cuneiform Numbers and Punctuation */\n#define TT_UCR_CUNEIFORM                       (1L << 14) /*U+12000-U+123FF*/\n                                                          /*U+12400-U+1247F*/\n  /* Bit 111  Counting Rod Numerals */\n#define TT_UCR_COUNTING_ROD_NUMERALS           (1L << 15) /*U+1D360-U+1D37F*/\n  /* Bit 112  Sundanese */\n#define TT_UCR_SUNDANESE                       (1L << 16) /* U+1B80-U+1BBF */\n  /* Bit 113  Lepcha */\n#define TT_UCR_LEPCHA                          (1L << 17) /* U+1C00-U+1C4F */\n  /* Bit 114  Ol Chiki */\n#define TT_UCR_OL_CHIKI                        (1L << 18) /* U+1C50-U+1C7F */\n  /* Bit 115  Saurashtra */\n#define TT_UCR_SAURASHTRA                      (1L << 19) /* U+A880-U+A8DF */\n  /* Bit 116  Kayah Li */\n#define TT_UCR_KAYAH_LI                        (1L << 20) /* U+A900-U+A92F */\n  /* Bit 117  Rejang */\n#define TT_UCR_REJANG                          (1L << 21) /* U+A930-U+A95F */\n  /* Bit 118  Cham */\n#define TT_UCR_CHAM                            (1L << 22) /* U+AA00-U+AA5F */\n  /* Bit 119  Ancient Symbols */\n#define TT_UCR_ANCIENT_SYMBOLS                 (1L << 23) /*U+10190-U+101CF*/\n  /* Bit 120  Phaistos Disc */\n#define TT_UCR_PHAISTOS_DISC                   (1L << 24) /*U+101D0-U+101FF*/\n  /* Bit 121  Carian */\n  /*          Lycian */\n  /*          Lydian */\n#define TT_UCR_OLD_ANATOLIAN                   (1L << 25) /*U+102A0-U+102DF*/\n                                                          /*U+10280-U+1029F*/\n                                                          /*U+10920-U+1093F*/\n  /* Bit 122  Domino Tiles  */\n  /*          Mahjong Tiles */\n#define TT_UCR_GAME_TILES                      (1L << 26) /*U+1F030-U+1F09F*/\n                                                          /*U+1F000-U+1F02F*/\n  /* Bit 123-127 Reserved for process-internal usage */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some compilers have a very limited length of identifiers.             */\n  /*                                                                       */\n#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )\n#define HAVE_LIMIT_ON_IDENTS\n#endif\n\n\n#ifndef HAVE_LIMIT_ON_IDENTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here some alias #defines in order to be clearer.                      */\n  /*                                                                       */\n  /* These are not always #defined to stay within the 31~character limit   */\n  /* which some compilers have.                                            */\n  /*                                                                       */\n  /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */\n  /* Borland compilers (read: from BC++ 3.1 on) can increase this limit.   */\n  /* If you get a warning with such a compiler, use the -i40 switch.       */\n  /*                                                                       */\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_A      \\\n         TT_UCR_ARABIC_PRESENTATIONS_A\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_B      \\\n         TT_UCR_ARABIC_PRESENTATIONS_B\n\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS      \\\n         TT_UCR_COMBINING_DIACRITICS\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\\n         TT_UCR_COMBINING_DIACRITICS_SYMB\n\n\n#endif /* !HAVE_LIMIT_ON_IDENTS */\n\n\nFT_END_HEADER\n\n#endif /* __TTNAMEID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/tttables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttables.h                                                             */\n/*                                                                         */\n/*    Basic SFNT/TrueType tables definitions and interface                 */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 1996-2005, 2008-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTABLES_H__\n#define __TTTABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueType Tables                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    TrueType specific table types and functions.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of TrueType-specific tables   */\n  /*    as well as some routines used to access and process them.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Header                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType font header table.  All       */\n  /*    fields follow the TrueType specification.                          */\n  /*                                                                       */\n  typedef struct  TT_Header_\n  {\n    FT_Fixed   Table_Version;\n    FT_Fixed   Font_Revision;\n\n    FT_Long    CheckSum_Adjust;\n    FT_Long    Magic_Number;\n\n    FT_UShort  Flags;\n    FT_UShort  Units_Per_EM;\n\n    FT_Long    Created [2];\n    FT_Long    Modified[2];\n\n    FT_Short   xMin;\n    FT_Short   yMin;\n    FT_Short   xMax;\n    FT_Short   yMax;\n\n    FT_UShort  Mac_Style;\n    FT_UShort  Lowest_Rec_PPEM;\n\n    FT_Short   Font_Direction;\n    FT_Short   Index_To_Loc_Format;\n    FT_Short   Glyph_Data_Format;\n\n  } TT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HoriHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType horizontal header, the `hhea' */\n  /*    table, as well as the corresponding horizontal metrics table,      */\n  /*    i.e., the `hmtx' table.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                :: The table version.                       */\n  /*                                                                       */\n  /*    Ascender               :: The font's ascender, i.e., the distance  */\n  /*                              from the baseline to the top-most of all */\n  /*                              glyph points found in the font.          */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoAscender' field */\n  /*                              of the OS/2 table instead if you want    */\n  /*                              the correct one.                         */\n  /*                                                                       */\n  /*    Descender              :: The font's descender, i.e., the distance */\n  /*                              from the baseline to the bottom-most of  */\n  /*                              all glyph points found in the font.  It  */\n  /*                              is negative.                             */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoDescender'      */\n  /*                              field of the OS/2 table instead if you   */\n  /*                              want the correct one.                    */\n  /*                                                                       */\n  /*    Line_Gap               :: The font's line gap, i.e., the distance  */\n  /*                              to add to the ascender and descender to  */\n  /*                              get the BTB, i.e., the                   */\n  /*                              baseline-to-baseline distance for the    */\n  /*                              font.                                    */\n  /*                                                                       */\n  /*    advance_Width_Max      :: This field is the maximum of all advance */\n  /*                              widths found in the font.  It can be     */\n  /*                              used to compute the maximum width of an  */\n  /*                              arbitrary string of text.                */\n  /*                                                                       */\n  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */\n  /*                              `width' of a glyph's bounding box) for   */\n  /*                              all glyphs in the font.                  */\n  /*                                                                       */\n  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */\n  /*                              slope of the cursor (slope=rise/run).    */\n  /*                                                                       */\n  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */\n  /*                              slope.                                   */\n  /*                                                                       */\n  /*    Reserved               :: 8~reserved bytes.                        */\n  /*                                                                       */\n  /*    metric_Data_Format     :: Always~0.                                */\n  /*                                                                       */\n  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */\n  /*                              table -- this value can be smaller than  */\n  /*                              the total number of glyphs in the font.  */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_HoriHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Width_Max;      /* advance width maximum */\n\n    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */\n    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */\n    FT_Short   xMax_Extent;            /* xmax extents          */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_HMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they are used to connect the metrics header to the relevant    */\n    /* `HMTX' table.                                                      */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_HoriHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_VertHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType vertical header, the `vhea'   */\n  /*    table, as well as the corresponding vertical metrics table, i.e.,  */\n  /*    the `vmtx' table.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                 :: The table version.                      */\n  /*                                                                       */\n  /*    Ascender                :: The font's ascender, i.e., the distance */\n  /*                               from the baseline to the top-most of    */\n  /*                               all glyph points found in the font.     */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoAscender'      */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Descender               :: The font's descender, i.e., the         */\n  /*                               distance from the baseline to the       */\n  /*                               bottom-most of all glyph points found   */\n  /*                               in the font.  It is negative.           */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoDescender'     */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Line_Gap                :: The font's line gap, i.e., the distance */\n  /*                               to add to the ascender and descender to */\n  /*                               get the BTB, i.e., the                  */\n  /*                               baseline-to-baseline distance for the   */\n  /*                               font.                                   */\n  /*                                                                       */\n  /*    advance_Height_Max      :: This field is the maximum of all        */\n  /*                               advance heights found in the font.  It  */\n  /*                               can be used to compute the maximum      */\n  /*                               height of an arbitrary string of text.  */\n  /*                                                                       */\n  /*    min_Top_Side_Bearing    :: The minimum top side bearing of all     */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    min_Bottom_Side_Bearing :: The minimum bottom side bearing of all  */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    yMax_Extent             :: The maximum vertical extent (i.e., the  */\n  /*                               `height' of a glyph's bounding box) for */\n  /*                               all glyphs in the font.                 */\n  /*                                                                       */\n  /*    caret_Slope_Rise        :: The rise coefficient of the cursor's    */\n  /*                               slope of the cursor (slope=rise/run).   */\n  /*                                                                       */\n  /*    caret_Slope_Run         :: The run coefficient of the cursor's     */\n  /*                               slope.                                  */\n  /*                                                                       */\n  /*    caret_Offset            :: The cursor's offset for slanted fonts.  */\n  /*                               This value is `reserved' in vmtx        */\n  /*                               version 1.0.                            */\n  /*                                                                       */\n  /*    Reserved                :: 8~reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format      :: Always~0.                               */\n  /*                                                                       */\n  /*    number_Of_HMetrics      :: Number of VMetrics entries in the       */\n  /*                               `vmtx' table -- this value can be       */\n  /*                               smaller than the total number of glyphs */\n  /*                               in the font.                            */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_VertHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Height_Max;      /* advance height maximum */\n\n    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */\n    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */\n    FT_Short   yMax_Extent;             /* xmax or ymax extents            */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_VMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they're used to connect the metrics header to the relevant     */\n    /* `HMTX' or `VMTX' table.                                            */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_VertHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_OS2                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType OS/2 table. This is the long  */\n  /*    table version.  All fields comply to the TrueType specification.   */\n  /*                                                                       */\n  /*    Note that we now support old Mac fonts which do not include an     */\n  /*    OS/2 table.  In this case, the `version' field is always set to    */\n  /*    0xFFFF.                                                            */\n  /*                                                                       */\n  typedef struct  TT_OS2_\n  {\n    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */\n    FT_Short   xAvgCharWidth;\n    FT_UShort  usWeightClass;\n    FT_UShort  usWidthClass;\n    FT_Short   fsType;\n    FT_Short   ySubscriptXSize;\n    FT_Short   ySubscriptYSize;\n    FT_Short   ySubscriptXOffset;\n    FT_Short   ySubscriptYOffset;\n    FT_Short   ySuperscriptXSize;\n    FT_Short   ySuperscriptYSize;\n    FT_Short   ySuperscriptXOffset;\n    FT_Short   ySuperscriptYOffset;\n    FT_Short   yStrikeoutSize;\n    FT_Short   yStrikeoutPosition;\n    FT_Short   sFamilyClass;\n\n    FT_Byte    panose[10];\n\n    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */\n    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */\n    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */\n    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */\n\n    FT_Char    achVendID[4];\n\n    FT_UShort  fsSelection;\n    FT_UShort  usFirstCharIndex;\n    FT_UShort  usLastCharIndex;\n    FT_Short   sTypoAscender;\n    FT_Short   sTypoDescender;\n    FT_Short   sTypoLineGap;\n    FT_UShort  usWinAscent;\n    FT_UShort  usWinDescent;\n\n    /* only version 1 tables: */\n\n    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */\n    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */\n\n    /* only version 2 tables: */\n\n    FT_Short   sxHeight;\n    FT_Short   sCapHeight;\n    FT_UShort  usDefaultChar;\n    FT_UShort  usBreakChar;\n    FT_UShort  usMaxContext;\n\n  } TT_OS2;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Postscript                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PostScript table.  All fields */\n  /*    comply to the TrueType specification.  This structure does not     */\n  /*    reference the PostScript glyph names, which can be nevertheless    */\n  /*    accessed with the `ttpost' module.                                 */\n  /*                                                                       */\n  typedef struct  TT_Postscript_\n  {\n    FT_Fixed  FormatType;\n    FT_Fixed  italicAngle;\n    FT_Short  underlinePosition;\n    FT_Short  underlineThickness;\n    FT_ULong  isFixedPitch;\n    FT_ULong  minMemType42;\n    FT_ULong  maxMemType42;\n    FT_ULong  minMemType1;\n    FT_ULong  maxMemType1;\n\n    /* Glyph names follow in the file, but we don't   */\n    /* load them by default.  See the ttpost.c file.  */\n\n  } TT_Postscript;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_PCLT                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PCLT table.  All fields       */\n  /*    comply to the TrueType specification.                              */\n  /*                                                                       */\n  typedef struct  TT_PCLT_\n  {\n    FT_Fixed   Version;\n    FT_ULong   FontNumber;\n    FT_UShort  Pitch;\n    FT_UShort  xHeight;\n    FT_UShort  Style;\n    FT_UShort  TypeFamily;\n    FT_UShort  CapHeight;\n    FT_UShort  SymbolSet;\n    FT_Char    TypeFace[16];\n    FT_Char    CharacterComplement[8];\n    FT_Char    FileName[6];\n    FT_Char    StrokeWeight;\n    FT_Char    WidthType;\n    FT_Byte    SerifStyle;\n    FT_Byte    Reserved;\n\n  } TT_PCLT;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The maximum profile is a table containing many max values which    */\n  /*    can be used to pre-allocate arrays.  This ensures that no memory   */\n  /*    allocation occurs during a glyph load.                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version               :: The version number.                       */\n  /*                                                                       */\n  /*    numGlyphs             :: The number of glyphs in this TrueType     */\n  /*                             font.                                     */\n  /*                                                                       */\n  /*    maxPoints             :: The maximum number of points in a         */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositePoints'.                     */\n  /*                                                                       */\n  /*    maxContours           :: The maximum number of contours in a       */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositeContours'.                   */\n  /*                                                                       */\n  /*    maxCompositePoints    :: The maximum number of points in a         */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxPoints'.            */\n  /*                                                                       */\n  /*    maxCompositeContours  :: The maximum number of contours in a       */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxContours'.          */\n  /*                                                                       */\n  /*    maxZones              :: The maximum number of zones used for      */\n  /*                             glyph hinting.                            */\n  /*                                                                       */\n  /*    maxTwilightPoints     :: The maximum number of points in the       */\n  /*                             twilight zone used for glyph hinting.     */\n  /*                                                                       */\n  /*    maxStorage            :: The maximum number of elements in the     */\n  /*                             storage area used for glyph hinting.      */\n  /*                                                                       */\n  /*    maxFunctionDefs       :: The maximum number of function            */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxInstructionDefs    :: The maximum number of instruction         */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxStackElements      :: The maximum number of stack elements used */\n  /*                             during bytecode interpretation.           */\n  /*                                                                       */\n  /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */\n  /*                             used for glyph hinting.                   */\n  /*                                                                       */\n  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */\n  /*                             composite) glyphs in a composite glyph.   */\n  /*                                                                       */\n  /*    maxComponentDepth     :: The maximum nesting depth of composite    */\n  /*                             glyphs.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is only used during font loading.                   */\n  /*                                                                       */\n  typedef struct  TT_MaxProfile_\n  {\n    FT_Fixed   version;\n    FT_UShort  numGlyphs;\n    FT_UShort  maxPoints;\n    FT_UShort  maxContours;\n    FT_UShort  maxCompositePoints;\n    FT_UShort  maxCompositeContours;\n    FT_UShort  maxZones;\n    FT_UShort  maxTwilightPoints;\n    FT_UShort  maxStorage;\n    FT_UShort  maxFunctionDefs;\n    FT_UShort  maxInstructionDefs;\n    FT_UShort  maxStackElements;\n    FT_UShort  maxSizeOfInstructions;\n    FT_UShort  maxComponentElements;\n    FT_UShort  maxComponentDepth;\n\n  } TT_MaxProfile;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Sfnt_Tag                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify the index of an SFNT table.         */\n  /*    Used in the @FT_Get_Sfnt_Table API function.                       */\n  /*                                                                       */\n  typedef enum  FT_Sfnt_Tag_\n  {\n    ft_sfnt_head = 0,    /* TT_Header     */\n    ft_sfnt_maxp = 1,    /* TT_MaxProfile */\n    ft_sfnt_os2  = 2,    /* TT_OS2        */\n    ft_sfnt_hhea = 3,    /* TT_HoriHeader */\n    ft_sfnt_vhea = 4,    /* TT_VertHeader */\n    ft_sfnt_post = 5,    /* TT_Postscript */\n    ft_sfnt_pclt = 6,    /* TT_PCLT       */\n\n    sfnt_max   /* internal end mark */\n\n  } FT_Sfnt_Tag;\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pointer to a given SFNT table within a face.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source.                                    */\n  /*                                                                       */\n  /*    tag  :: The index of the SFNT table.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A type-less pointer to the table.  This will be~0 in case of       */\n  /*    error, or if the corresponding table was not found *OR* loaded     */\n  /*    from the file.                                                     */\n  /*                                                                       */\n  /*    Use a typecast according to `tag' to access the structure          */\n  /*    elements.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The table is owned by the face object and disappears with it.      */\n  /*                                                                       */\n  /*    This function is only useful to access SFNT tables that are loaded */\n  /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */\n  /*    a list.                                                            */\n  /*                                                                       */\n  /*    Here an example how to access the `vhea' table:                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      TT_VertHeader*  vert_header;                                     */\n  /*                                                                       */\n  /*                                                                       */\n  /*      vert_header =                                                    */\n  /*        (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea );       */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Load_Sfnt_Table\n  *\n  * @description:\n  *   Load any font table into client memory.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   tag ::\n  *     The four-byte tag of the table to load.  Use the value~0 if you want\n  *     to access the whole font file.  Otherwise, you can use one of the\n  *     definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new\n  *     one with @FT_MAKE_TAG.\n  *\n  *   offset ::\n  *     The starting offset in the table (or file if tag == 0).\n  *\n  * @output:\n  *   buffer ::\n  *     The target buffer address.  The client must ensure that the memory\n  *     array is big enough to hold the data.\n  *\n  * @inout:\n  *   length ::\n  *     If the `length' parameter is NULL, then try to load the whole table.\n  *     Return an error code if it fails.\n  *\n  *     Else, if `*length' is~0, exit immediately while returning the\n  *     table's (or file) full size in it.\n  *\n  *     Else the number of bytes to read from the table or file, from the\n  *     starting offset.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If you need to determine the table's length you should first call this\n  *   function with `*length' set to~0, as in the following example:\n  *\n  *     {\n  *       FT_ULong  length = 0;\n  *\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );\n  *       if ( error ) { ... table does not exist ... }\n  *\n  *       buffer = malloc( length );\n  *       if ( buffer == NULL ) { ... not enough memory ... }\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );\n  *       if ( error ) { ... could not load table ... }\n  *     }\n  */\n  FT_EXPORT( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Sfnt_Table_Info\n  *\n  * @description:\n  *   Return information on an SFNT table.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   table_index ::\n  *     The index of an SFNT table.  The function returns\n  *     FT_Err_Table_Missing for an invalid value.\n  *\n  * @inout:\n  *   tag ::\n  *     The name tag of the SFNT table.  If the value is NULL, `table_index'\n  *     is ignored, and `length' returns the number of SFNT tables in the\n  *     font.\n  *\n  * @output:\n  *   length ::\n  *     The length of the SFNT table (or the number of SFNT tables, depending\n  *     on `tag').\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   While parsing fonts, FreeType handles SFNT tables with length zero as\n  *   missing.\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */\n  /*    language ID values are in `freetype/ttnameid.h'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */\n  /*    TrueType/sfnt face, just return~0 as the default value.            */\n  /*                                                                       */\n  /*    For a format~14 cmap (to access Unicode IVS), the return value is  */\n  /*    0xFFFFFFFF.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap format.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The format of `charmap'.  If `charmap' doesn't belong to a         */\n  /*    TrueType/sfnt face, return -1.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTTABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/tttags.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttags.h                                                               */\n/*                                                                         */\n/*    Tags for TrueType and OpenType tables (specification only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTAGS_H__\n#define __TTAGS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )\n#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )\n#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )\n#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )\n#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )\n#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )\n#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )\n#define TTAG_CBDT  FT_MAKE_TAG( 'C', 'B', 'D', 'T' )\n#define TTAG_CBLC  FT_MAKE_TAG( 'C', 'B', 'L', 'C' )\n#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )\n#define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )\n#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )\n#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )\n#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )\n#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )\n#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )\n#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )\n#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )\n#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )\n#define TTAG_FOND  FT_MAKE_TAG( 'F', 'O', 'N', 'D' )\n#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )\n#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )\n#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )\n#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )\n#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )\n#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )\n#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )\n#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )\n#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )\n#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )\n#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )\n#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )\n#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )\n#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )\n#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )\n#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )\n#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )\n#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )\n#define TTAG_LWFN  FT_MAKE_TAG( 'L', 'W', 'F', 'N' )\n#define TTAG_MATH  FT_MAKE_TAG( 'M', 'A', 'T', 'H' )\n#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )\n#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )\n#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )\n#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )\n#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )\n#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )\n#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )\n#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )\n#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )\n#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )\n#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )\n#define TTAG_POST  FT_MAKE_TAG( 'P', 'O', 'S', 'T' )\n#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )\n#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )\n#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )\n#define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )\n#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )\n#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )\n#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )\n#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )\n#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )\n#define TTAG_TYP1  FT_MAKE_TAG( 'T', 'Y', 'P', '1' )\n#define TTAG_typ1  FT_MAKE_TAG( 't', 'y', 'p', '1' )\n#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )\n#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )\n#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )\n\n\nFT_END_HEADER\n\n#endif /* __TTAGS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/freetype/ttunpat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttunpat.h                                                              */\n/*                                                                         */\n/*    Definitions for the unpatented TrueType hinting system               */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by Graham Asher <graham.asher@btinternet.com>                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTUNPAT_H__\n#define __TTUNPAT_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_UNPATENTED_HINTING\n  *\n  * @description:\n  *   A constant used as the tag of an @FT_Parameter structure to indicate\n  *   that unpatented methods only should be used by the TrueType bytecode\n  *   interpreter for a typeface opened by @FT_Open_Face.\n  *\n  */\n#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __TTUNPAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/mac/ft2build.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ft2build.h                                                             */\n/*                                                                         */\n/*    FreeType 2 build and setup macros.                                   */\n/*    (Generic version)                                                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2006 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file corresponds to the default `ft2build.h' file for            */\n  /* FreeType 2.  It uses the `freetype' include root.                     */\n  /*                                                                       */\n  /* Note that specific platforms might use a different configuration.     */\n  /* See builds/unix/ft2unix.h for an example.                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FT2_BUILD_GENERIC_H__\n#define __FT2_BUILD_GENERIC_H__\n\n#include <freetype/config/ftheader.h>\n\n#endif /* __FT2_BUILD_GENERIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/config/ftconfig.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftconfig.h                                                             */\n/*                                                                         */\n/*    ANSI-specific configuration file (specification only).               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This header file contains a number of macro definitions that are used */\n  /* by the rest of the engine.  Most of the macros here are automatically */\n  /* determined at compile time, and you should not need to change it to   */\n  /* port FreeType, except to compile the library with a non-ANSI          */\n  /* compiler.                                                             */\n  /*                                                                       */\n  /* Note however that if some specific modifications are needed, we       */\n  /* advise you to place a modified copy in your build directory.          */\n  /*                                                                       */\n  /* The build directory is usually `freetype/builds/<system>', and        */\n  /* contains system-specific files that are always included first when    */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* This ANSI version should stay in `include/freetype/config'.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FTCONFIG_H__\n#define __FTCONFIG_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_OPTIONS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* These macros can be toggled to suit a specific system.  The current   */\n  /* ones are defaults used to compile FreeType in an ANSI C environment   */\n  /* (16bit compilers are also supported).  Copy this file to your own     */\n  /* `freetype/builds/<system>' directory, and edit it to port the engine. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* There are systems (like the Texas Instruments 'C54x) where a `char' */\n  /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */\n  /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */\n  /* is probably unexpected.                                             */\n  /*                                                                     */\n  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */\n  /* `char' type.                                                        */\n\n#ifndef FT_CHAR_BIT\n#define FT_CHAR_BIT  CHAR_BIT\n#endif\n\n\n  /* The size of an `int' type.  */\n#if                                 FT_UINT_MAX == 0xFFFFUL\n#define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)\n#elif                               FT_UINT_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)\n#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `int' type!\"\n#endif\n\n  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */\n  /* DM642) is recognized but avoided.                                   */\n#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `long' type!\"\n#endif\n\n\n  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */\n  /* used -- this is only used to get rid of unpleasant compiler warnings */\n#ifndef FT_UNUSED\n#define FT_UNUSED( arg )  ( (arg) = (arg) )\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     AUTOMATIC CONFIGURATION MACROS                    */\n  /*                                                                       */\n  /* These macros are computed from the ones defined above.  Don't touch   */\n  /* their definition, unless you know precisely what you are doing.  No   */\n  /* porter should need to mess with them.                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Mac support                                                           */\n  /*                                                                       */\n  /*   This is the only necessary change, so it is defined here instead    */\n  /*   providing a new configuration file.                                 */\n  /*                                                                       */\n#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )\n  /* no Carbon frameworks for 64bit 10.4.x */\n  /* AvailabilityMacros.h is available since Mac OS X 10.2,        */\n  /* so guess the system version by maximum errno before inclusion */\n#include <errno.h>\n#ifdef ECANCELED /* defined since 10.2 */\n#include \"AvailabilityMacros.h\"\n#endif\n#if defined( __LP64__ ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )\n#undef FT_MACINTOSH\n#endif\n\n#elif defined( __SC__ ) || defined( __MRC__ )\n  /* Classic MacOS compilers */\n#include \"ConditionalMacros.h\"\n#if TARGET_OS_MAC\n#define FT_MACINTOSH 1\n#endif\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int16                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit signed integer type.                         */\n  /*                                                                       */\n  typedef signed short  FT_Int16;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt16                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit unsigned integer type.                       */\n  /*                                                                       */\n  typedef unsigned short  FT_UInt16;\n\n  /* */\n\n\n  /* this #if 0 ... #endif clause is for documentation purposes */\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int32                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 32bit signed integer type.  The size depends on    */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef signed XXX  FT_Int32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt32                                                          */\n  /*                                                                       */\n  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int64                                                           */\n  /*                                                                       */\n  /*    A typedef for a 64bit signed integer type.  The size depends on    */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef signed XXX  FT_Int64;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt64                                                          */\n  /*                                                                       */\n  /*    A typedef for a 64bit unsigned integer type.  The size depends on  */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt64;\n\n  /* */\n\n#endif\n\n#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)\n\n  typedef signed int      FT_Int32;\n  typedef unsigned int    FT_UInt32;\n\n#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)\n\n  typedef signed long     FT_Int32;\n  typedef unsigned long   FT_UInt32;\n\n#else\n#error \"no 32bit type found -- please check your configuration files\"\n#endif\n\n\n  /* look up an integer type that is at least 32 bits */\n#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)\n\n  typedef int            FT_Fast;\n  typedef unsigned int   FT_UFast;\n\n#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)\n\n  typedef long           FT_Fast;\n  typedef unsigned long  FT_UFast;\n\n#endif\n\n\n  /* determine whether we have a 64-bit int type for platforms without */\n  /* Autoconf                                                          */\n#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)\n\n  /* FT_LONG64 must be defined if a 64-bit type is available */\n#define FT_LONG64\n#define FT_INT64   long\n#define FT_UINT64  unsigned long\n\n#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __BORLANDC__ )  /* Borland C++ */\n\n  /* XXXX: We should probably check the value of __BORLANDC__ in order */\n  /*       to test the compiler version.                               */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __WATCOMC__ )   /* Watcom C++ */\n\n  /* Watcom doesn't provide 64-bit data types */\n\n#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */\n\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#elif defined( __GNUC__ )\n\n  /* GCC provides the `long long' type */\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A 64-bit data type will create compilation problems if you compile    */\n  /* in strict ANSI mode.  To avoid them, we disable its use if __STDC__   */\n  /* is defined.  You can however ignore this rule by defining the         */\n  /* FT_CONFIG_OPTION_FORCE_INT64 configuration macro.                     */\n  /*                                                                       */\n#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )\n\n#ifdef __STDC__\n\n  /* undefine the 64-bit macros in strict ANSI compilation mode */\n#undef FT_LONG64\n#undef FT_INT64\n\n#endif /* __STDC__ */\n\n#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */\n\n#ifdef FT_LONG64\n  typedef FT_INT64   FT_Int64;\n  typedef FT_UINT64  FT_UInt64;\n#endif\n\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT\n\n\n#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER\n  /* Provide assembler fragments for performance-critical functions. */\n  /* These must be defined `static __inline__' with GCC.             */\n\n#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm\n    {\n      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */\n      mov   a,  t,  asr #31         /* a   = (hi >> 31) */\n      add   a,  a,  #0x8000         /* a  += 0x8000 */\n      adds  t2, t2, a               /* t2 += a */\n      adc   t,  t,  #0              /* t  += carry */\n      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */\n      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */\n    }\n    return a;\n  }\n\n#endif /* __CC_ARM || __ARMCC__ */\n\n\n#ifdef __GNUC__\n\n#if defined( __arm__ ) && !defined( __thumb__ )    && \\\n    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm__ __volatile__ (\n      \"smull  %1, %2, %4, %3\\n\\t\"       /* (lo=%1,hi=%2) = a*b */\n      \"mov    %0, %2, asr #31\\n\\t\"      /* %0  = (hi >> 31) */\n      \"add    %0, %0, #0x8000\\n\\t\"      /* %0 += 0x8000 */\n      \"adds   %1, %1, %0\\n\\t\"           /* %1 += %0 */\n      \"adc    %2, %2, #0\\n\\t\"           /* %2 += carry */\n      \"mov    %0, %1, lsr #16\\n\\t\"      /* %0  = %1 >> 16 */\n      \"orr    %0, %0, %2, lsl #16\\n\\t\"  /* %0 |= %2 << 16 */\n      : \"=r\"(a), \"=&r\"(t2), \"=&r\"(t)\n      : \"r\"(a), \"r\"(b)\n      : \"cc\" );\n    return a;\n  }\n\n#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */\n\n#if defined( __i386__ )\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n\n    __asm__ __volatile__ (\n      \"imul  %%edx\\n\"\n      \"movl  %%edx, %%ecx\\n\"\n      \"sarl  $31, %%ecx\\n\"\n      \"addl  $0x8000, %%ecx\\n\"\n      \"addl  %%ecx, %%eax\\n\"\n      \"adcl  $0, %%edx\\n\"\n      \"shrl  $16, %%eax\\n\"\n      \"shll  $16, %%edx\\n\"\n      \"addl  %%edx, %%eax\\n\"\n      : \"=a\"(result), \"=d\"(b)\n      : \"a\"(a), \"d\"(b)\n      : \"%ecx\", \"cc\" );\n    return result;\n  }\n\n#endif /* i386 */\n\n#endif /* __GNUC__ */\n\n\n#ifdef _MSC_VER /* Visual C++ */\n\n#ifdef _M_IX86\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n    __asm\n    {\n      mov eax, a\n      mov edx, b\n      imul edx\n      mov ecx, edx\n      sar ecx, 31\n      add ecx, 8000h\n      add eax, ecx\n      adc edx, 0\n      shr eax, 16\n      shl edx, 16\n      add eax, edx\n      mov result, eax\n    }\n    return result;\n  }\n\n#endif /* _M_IX86 */\n\n#endif /* _MSC_VER */\n\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n#ifdef FT_CONFIG_OPTION_INLINE_MULFIX\n#ifdef FT_MULFIX_ASSEMBLER\n#define FT_MULFIX_INLINED  FT_MULFIX_ASSEMBLER\n#endif\n#endif\n\n\n#ifdef FT_MAKE_OPTION_SINGLE_OBJECT\n\n#define FT_LOCAL( x )      static  x\n#define FT_LOCAL_DEF( x )  static  x\n\n#else\n\n#ifdef __cplusplus\n#define FT_LOCAL( x )      extern \"C\"  x\n#define FT_LOCAL_DEF( x )  extern \"C\"  x\n#else\n#define FT_LOCAL( x )      extern  x\n#define FT_LOCAL_DEF( x )  x\n#endif\n\n#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */\n\n\n#ifndef FT_BASE\n\n#ifdef __cplusplus\n#define FT_BASE( x )  extern \"C\"  x\n#else\n#define FT_BASE( x )  extern  x\n#endif\n\n#endif /* !FT_BASE */\n\n\n#ifndef FT_BASE_DEF\n\n#ifdef __cplusplus\n#define FT_BASE_DEF( x )  x\n#else\n#define FT_BASE_DEF( x )  x\n#endif\n\n#endif /* !FT_BASE_DEF */\n\n\n#ifndef FT_EXPORT\n\n#ifdef __cplusplus\n#define FT_EXPORT( x )  extern \"C\"  x\n#else\n#define FT_EXPORT( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT */\n\n\n#ifndef FT_EXPORT_DEF\n\n#ifdef __cplusplus\n#define FT_EXPORT_DEF( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_DEF( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_DEF */\n\n\n#ifndef FT_EXPORT_VAR\n\n#ifdef __cplusplus\n#define FT_EXPORT_VAR( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_VAR */\n\n  /* The following macros are needed to compile the library with a   */\n  /* C++ compiler and with 16bit compilers.                          */\n  /*                                                                 */\n\n  /* This is special.  Within C++, you must specify `extern \"C\"' for */\n  /* functions which are used via function pointers, and you also    */\n  /* must do that for structures which contain function pointers to  */\n  /* assure C linkage -- it's not possible to have (local) anonymous */\n  /* functions which are accessed by (global) function pointers.     */\n  /*                                                                 */\n  /*                                                                 */\n  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */\n  /* contains pointers to callback functions.                        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */\n  /* that contains pointers to callback functions.                   */\n  /*                                                                 */\n  /*                                                                 */\n  /* Some 16bit compilers have to redefine these macros to insert    */\n  /* the infamous `_cdecl' or `__fastcall' declarations.             */\n  /*                                                                 */\n#ifndef FT_CALLBACK_DEF\n#ifdef __cplusplus\n#define FT_CALLBACK_DEF( x )  extern \"C\"  x\n#else\n#define FT_CALLBACK_DEF( x )  static  x\n#endif\n#endif /* FT_CALLBACK_DEF */\n\n#ifndef FT_CALLBACK_TABLE\n#ifdef __cplusplus\n#define FT_CALLBACK_TABLE      extern \"C\"\n#define FT_CALLBACK_TABLE_DEF  extern \"C\"\n#else\n#define FT_CALLBACK_TABLE      extern\n#define FT_CALLBACK_TABLE_DEF  /* nothing */\n#endif\n#endif /* FT_CALLBACK_TABLE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCONFIG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/config/ftheader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftheader.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_HEADER_H__\n#define __FT_HEADER_H__\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_BEGIN_HEADER                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_END_HEADER in header    */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_BEGIN_HEADER  extern \"C\" {\n#else\n#define FT_BEGIN_HEADER  /* nothing */\n#endif\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_END_HEADER                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_BEGIN_HEADER in header  */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_END_HEADER  }\n#else\n#define FT_END_HEADER  /* nothing */\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Aliases for the FreeType 2 public and configuration files.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_file_macros                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Header File Macros                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Macro definitions used to #include specific header files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following macros are defined to the name of specific           */\n  /*    FreeType~2 header files.  They can be used directly in #include    */\n  /*    statements as in:                                                  */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_MULTIPLE_MASTERS_H                                   */\n  /*      #include FT_GLYPH_H                                              */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    There are several reasons why we are now using macros to name      */\n  /*    public header files.  The first one is that such macros are not    */\n  /*    limited to the infamous 8.3~naming rule required by DOS (and       */\n  /*    `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').   */\n  /*                                                                       */\n  /*    The second reason is that it allows for more flexibility in the    */\n  /*    way FreeType~2 is installed on a given system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* configuration files */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_CONFIG_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 configuration data.\n   *\n   */\n#ifndef FT_CONFIG_CONFIG_H\n#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_STANDARD_LIBRARY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 interface to the standard C library functions.\n   *\n   */\n#ifndef FT_CONFIG_STANDARD_LIBRARY_H\n#define FT_CONFIG_STANDARD_LIBRARY_H  <freetype/config/ftstdlib.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_OPTIONS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 project-specific configuration options.\n   *\n   */\n#ifndef FT_CONFIG_OPTIONS_H\n#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_MODULES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 modules that are statically linked to new library\n   *   instances in @FT_Init_FreeType.\n   *\n   */\n#ifndef FT_CONFIG_MODULES_H\n#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>\n#endif\n\n  /* */\n\n  /* public headers */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_FREETYPE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   base FreeType~2 API.\n   *\n   */\n#define FT_FREETYPE_H  <freetype/freetype.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 error codes (and messages).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_ERRORS_H  <freetype/fterrors.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 module error offsets (and messages).\n   *\n   */\n#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYSTEM_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 interface to low-level operations (i.e., memory management\n   *   and stream i/o).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_SYSTEM_H  <freetype/ftsystem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing type\n   *   definitions related to glyph images (i.e., bitmaps, outlines,\n   *   scan-converter parameters).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_IMAGE_H  <freetype/ftimage.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   basic data types defined by FreeType~2.\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_TYPES_H  <freetype/fttypes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LIST_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list management API of FreeType~2.\n   *\n   *   (Most applications will never need to include this file.)\n   *\n   */\n#define FT_LIST_H  <freetype/ftlist.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OUTLINE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   scalable outline management API of FreeType~2.\n   *\n   */\n#define FT_OUTLINE_H  <freetype/ftoutln.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SIZES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API which manages multiple @FT_Size objects per face.\n   *\n   */\n#define FT_SIZES_H  <freetype/ftsizes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   module management API of FreeType~2.\n   *\n   */\n#define FT_MODULE_H  <freetype/ftmodapi.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_RENDER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   renderer module management API of FreeType~2.\n   *\n   */\n#define FT_RENDER_H  <freetype/ftrender.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_AUTOHINTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the auto-hinting module.\n   *\n   */\n#define FT_AUTOHINTER_H  <freetype/ftautoh.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CFF_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the CFF driver module.\n   *\n   */\n#define FT_CFF_DRIVER_H  <freetype/ftcffdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the TrueType driver module.\n   *\n   */\n#define FT_TRUETYPE_DRIVER_H  <freetype/ftttdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPE1_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the Type~1 format.\n   *\n   */\n#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_IDS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   enumeration values which identify name strings, languages, encodings,\n   *   etc.  This file really contains a _large_ set of constant macro\n   *   definitions, taken from the TrueType and OpenType specifications.\n   *\n   */\n#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the TrueType (as well as OpenType) format.\n   *\n   */\n#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TAGS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of TrueType four-byte `tags' which identify blocks in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BDF_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which accesses BDF-specific strings from a\n   *   face.\n   *\n   */\n#define FT_BDF_H  <freetype/ftbdf.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CID_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which access CID font information from a\n   *   face.\n   *\n   */\n#define FT_CID_H  <freetype/ftcid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GZIP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports gzip-compressed files.\n   *\n   */\n#define FT_GZIP_H  <freetype/ftgzip.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LZW_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports LZW-compressed files.\n   *\n   */\n#define FT_LZW_H  <freetype/ftlzw.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BZIP2_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports bzip2-compressed files.\n   *\n   */\n#define FT_BZIP2_H  <freetype/ftbzip2.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_WINFONTS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports Windows FNT files.\n   *\n   */\n#define FT_WINFONTS_H   <freetype/ftwinfnt.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GLYPH_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional glyph management component.\n   *\n   */\n#define FT_GLYPH_H  <freetype/ftglyph.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BITMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional bitmap conversion component.\n   *\n   */\n#define FT_BITMAP_H  <freetype/ftbitmap.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BBOX_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional exact bounding box computation routines.\n   *\n   */\n#define FT_BBOX_H  <freetype/ftbbox.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional FreeType~2 cache sub-system.\n   *\n   */\n#define FT_CACHE_H  <freetype/ftcache.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `glyph image' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for @FT_Glyph elements.  You can also\n   *   use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to\n   *   store small glyph bitmaps, as it will use less memory.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   glyph image-related cache declarations.\n   *\n   */\n#define FT_CACHE_IMAGE_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_SMALL_BITMAPS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `small bitmaps' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for small glyph bitmaps in a relatively\n   *   memory-efficient way.  You can also use the API defined in\n   *   @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,\n   *   including scalable outlines.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   small bitmaps-related cache declarations.\n   *\n   */\n#define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_CHARMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `charmap' API of the FreeType~2 cache sub-system.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   charmap-based cache declarations.\n   *\n   */\n#define FT_CACHE_CHARMAP_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MAC_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   Macintosh-specific FreeType~2 API.  The latter is used to access\n   *   fonts embedded in resource forks.\n   *\n   *   This header file must be explicitly included by client applications\n   *   compiled on the Mac (note that the base API still works though).\n   *\n   */\n#define FT_MAC_H  <freetype/ftmac.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MULTIPLE_MASTERS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional multiple-masters management API of FreeType~2.\n   *\n   */\n#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SFNT_NAMES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which accesses embedded `name' strings in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OPENTYPE_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates OpenType tables (BASE, GDEF,\n   *   GPOS, GSUB, JSTF).\n   *\n   */\n#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GX_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,\n   *   mort, morx, bsln, just, kern, opbd, trak, prop).\n   *\n   */\n#define FT_GX_VALIDATE_H  <freetype/ftgxval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_PFR_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which accesses PFR-specific data.\n   *\n   */\n#define FT_PFR_H  <freetype/ftpfr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_STROKER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions to stroke outline paths.\n   */\n#define FT_STROKER_H  <freetype/ftstroke.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYNTHESIS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs artificial obliquing and emboldening.\n   */\n#define FT_SYNTHESIS_H  <freetype/ftsynth.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_XFREE86_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions specific to the XFree86 and\n   *   X.Org X11 servers.\n   */\n#define FT_XFREE86_H  <freetype/ftxf86.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRIGONOMETRY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs trigonometric computations (e.g.,\n   *   cosines and arc tangents).\n   */\n#define FT_TRIGONOMETRY_H  <freetype/fttrigon.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LCD_FILTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_LCD_FILTER_H  <freetype/ftlcdfil.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_UNPATENTED_HINTING_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_UNPATENTED_HINTING_H  <freetype/ttunpat.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_INCREMENTAL_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_INCREMENTAL_H  <freetype/ftincrem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GASP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns entries from the TrueType GASP table.\n   */\n#define FT_GASP_H  <freetype/ftgasp.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ADVANCES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns individual and ranged glyph advances.\n   */\n#define FT_ADVANCES_H  <freetype/ftadvanc.h>\n\n\n  /* */\n\n#define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>\n\n\n  /* The internals of the cache sub-system are no longer exposed.  We */\n  /* default to FT_CACHE_H at the moment just in case, but we know of */\n  /* no rogue client that uses them.                                  */\n  /*                                                                  */\n#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>\n\n\n#define FT_INCREMENTAL_H          <freetype/ftincrem.h>\n\n#define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>\n\n\n  /*\n   * Include internal headers definitions from <freetype/internal/...>\n   * only when building the library.\n   */\n#ifdef FT2_BUILD_LIBRARY\n#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>\n#include FT_INTERNAL_INTERNAL_H\n#endif /* FT2_BUILD_LIBRARY */\n\n\n#endif /* __FT2_BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/config/ftmodule.h",
    "content": "/*\n *  This file registers the FreeType modules compiled into the library.\n *\n *  If you use GNU make, this file IS NOT USED!  Instead, it is created in\n *  the objects directory (normally `<topdir>/objs/') based on information\n *  from `<topdir>/modules.cfg'.\n *\n *  Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile\n *  FreeType without GNU make.\n *\n */\n\nFT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\nFT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\n\n/* EOF */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/config/ftoption.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoption.h                                                             */\n/*                                                                         */\n/*    User-selectable configuration macros (specification only).           */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOPTION_H__\n#define __FTOPTION_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* This file contains the default configuration macro definitions for    */\n  /* a standard build of the FreeType library.  There are three ways to    */\n  /* use this file to build project-specific versions of the library:      */\n  /*                                                                       */\n  /*  - You can modify this file by hand, but this is not recommended in   */\n  /*    cases where you would like to build several versions of the        */\n  /*    library from a single source directory.                            */\n  /*                                                                       */\n  /*  - You can put a copy of this file in your build directory, more      */\n  /*    precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD'   */\n  /*    is the name of a directory that is included _before_ the FreeType  */\n  /*    include path during compilation.                                   */\n  /*                                                                       */\n  /*    The default FreeType Makefiles and Jamfiles use the build          */\n  /*    directory `builds/<system>' by default, but you can easily change  */\n  /*    that for your own projects.                                        */\n  /*                                                                       */\n  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */\n  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */\n  /*    locate this file during the build.  For example,                   */\n  /*                                                                       */\n  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */\n  /*      #include <freetype/config/ftheader.h>                            */\n  /*                                                                       */\n  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */\n  /*    definitions.                                                       */\n  /*                                                                       */\n  /*    Note also that you can similarly pre-define the macro              */\n  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */\n  /*    that are statically linked to the library at compile time.  By     */\n  /*    default, this file is <freetype/config/ftmodule.h>.                */\n  /*                                                                       */\n  /*  We highly recommend using the third method whenever possible.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the line below if you want to activate sub-pixel rendering  */\n  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */\n  /*                                                                       */\n  /* Note that this feature is covered by several Microsoft patents        */\n  /* and should not be activated in any default build of the library.      */\n  /*                                                                       */\n  /* This macro has no impact on the FreeType API, only on its             */\n  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */\n  /* FT_Render_Glyph still generates a bitmap that is 3 times wider than   */\n  /* the original size in case this macro isn't defined; however, each     */\n  /* triplet of subpixels has R=G=B.                                       */\n  /*                                                                       */\n  /* This is done to allow FreeType clients to run unmodified, forcing     */\n  /* them to display normal gray-level anti-aliased glyphs.                */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */\n  /* by FreeType to speed up some computations.  However, this will create */\n  /* some problems when compiling the library in strict ANSI mode.         */\n  /*                                                                       */\n  /* For this reason, the use of 64-bit integers is normally disabled when */\n  /* the __STDC__ macro is defined.  You can however disable this by       */\n  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */\n  /*                                                                       */\n  /* For most compilers, this will only create compilation warnings when   */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* ObNote: The compiler-specific 64-bit integers are detected in the     */\n  /*         file `ftconfig.h' either statically or through the            */\n  /*         `configure' script on supported platforms.                    */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_FORCE_INT64\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, do not try to use an assembler version of   */\n  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */\n  /* that to verify that the assembler function works properly, or to      */\n  /* execute benchmark tests of the various implementations.               */\n/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, try to use an inlined assembler version of  */\n  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */\n  /* hinting glyphs, and which should be executed as fast as possible.     */\n  /*                                                                       */\n  /* Note that if your compiler or CPU is not supported, this will default */\n  /* to the standard and portable implementation found in `ftcalc.c'.      */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INLINE_MULFIX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LZW-compressed file support.                                          */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `compress' program.  This is mostly used to parse many of the PCF   */\n  /*   files that come with various X11 distributions.  The implementation */\n  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */\n  /*   (see src/lzw/ftgzip.c).                                             */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_LZW\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Gzip-compressed file support.                                         */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `gzip' program.  This is mostly used to parse many of the PCF files */\n  /*   that come with XFree86.  The implementation uses `zlib' to          */\n  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.  See also   */\n  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_ZLIB\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ZLib library selection                                                */\n  /*                                                                       */\n  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */\n  /*   It allows FreeType's `ftgzip' component to link to the system's     */\n  /*   installation of the ZLib library.  This is useful on systems like   */\n  /*   Unix or VMS where it generally is already available.                */\n  /*                                                                       */\n  /*   If you let it undefined, the component will use its own copy        */\n  /*   of the zlib sources instead.  These have been modified to be        */\n  /*   included directly within the component and *not* export external    */\n  /*   function names.  This allows you to link any program with FreeType  */\n  /*   _and_ ZLib without linking conflicts.                               */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bzip2-compressed file support.                                        */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `bzip2' program.  This is mostly used to parse many of the PCF      */\n  /*   files that come with XFree86.  The implementation uses `libbz2' to  */\n  /*   partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */\n  /*   Contrary to gzip, bzip2 currently is not included and need to use   */\n  /*   the system available bzip2 implementation.                          */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_BZIP2 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define to disable the use of file stream functions and types, FILE,   */\n  /* fopen() etc.  Enables the use of smaller system libraries on embedded */\n  /* systems that have multiple system libraries, some with or without     */\n  /* file stream support, in the cases where file stream support is not    */\n  /* necessary such as memory loading of font files.                       */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  PNG bitmap support.                                                  */\n  /*                                                                       */\n  /*   FreeType now handles loading color bitmap glyphs in the PNG format. */\n  /*   This requires help from the external libpng library.  Uncompressed  */\n  /*   color bitmaps do not need any external libraries and will be        */\n  /*   supported regardless of this configuration.                         */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_PNG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DLL export compilation                                                */\n  /*                                                                       */\n  /*   When compiling FreeType as a DLL, some systems/compilers need a     */\n  /*   special keyword in front OR after the return type of function       */\n  /*   declarations.                                                       */\n  /*                                                                       */\n  /*   Two macros are used within the FreeType source code to define       */\n  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */\n  /*                                                                       */\n  /*     FT_EXPORT( return_type )                                          */\n  /*                                                                       */\n  /*       is used in a function declaration, as in                        */\n  /*                                                                       */\n  /*         FT_EXPORT( FT_Error )                                         */\n  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */\n  /*                                                                       */\n  /*                                                                       */\n  /*     FT_EXPORT_DEF( return_type )                                      */\n  /*                                                                       */\n  /*       is used in a function definition, as in                         */\n  /*                                                                       */\n  /*         FT_EXPORT_DEF( FT_Error )                                     */\n  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */\n  /*         {                                                             */\n  /*           ... some code ...                                           */\n  /*           return FT_Err_Ok;                                           */\n  /*         }                                                             */\n  /*                                                                       */\n  /*   You can provide your own implementation of FT_EXPORT and            */\n  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */\n  /*   will be later automatically defined as `extern return_type' to      */\n  /*   allow normal compilation.                                           */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_EXPORT(x)      extern x */\n/* #define FT_EXPORT_DEF(x)  x */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Glyph Postscript Names handling                                       */\n  /*                                                                       */\n  /*   By default, FreeType 2 is compiled with the `psnames' module.  This */\n  /*   module is in charge of converting a glyph name string into a        */\n  /*   Unicode value, or return a Macintosh standard glyph name for the    */\n  /*   use with the TrueType `post' table.                                 */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want `psnames' compiled in your   */\n  /*   build of FreeType.  This has the following effects:                 */\n  /*                                                                       */\n  /*   - The TrueType driver will provide its own set of glyph names,      */\n  /*     if you build it to support postscript names in the TrueType       */\n  /*     `post' table.                                                     */\n  /*                                                                       */\n  /*   - The Type 1 driver will not be able to synthesize a Unicode        */\n  /*     charmap out of the glyphs found in the fonts.                     */\n  /*                                                                       */\n  /*   You would normally undefine this configuration macro when building  */\n  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Postscript Names to Unicode Values support                            */\n  /*                                                                       */\n  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */\n  /*   in.  Among other things, the module is used to convert a glyph name */\n  /*   into a Unicode value.  This is especially useful in order to        */\n  /*   synthesize on the fly a Unicode charmap from the CFF/Type 1 driver  */\n  /*   through a big table named the `Adobe Glyph List' (AGL).             */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want the Adobe Glyph List         */\n  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */\n  /*   able to synthesize a Unicode charmap out of the glyphs found in the */\n  /*   fonts.                                                              */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for Mac fonts                                                 */\n  /*                                                                       */\n  /*   Define this macro if you want support for outline fonts in Mac      */\n  /*   format (mac dfont, mac resource, macbinary containing a mac         */\n  /*   resource) on non-Mac platforms.                                     */\n  /*                                                                       */\n  /*   Note that the `FOND' resource isn't checked.                        */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_MAC_FONTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Guessing methods to access embedded resource forks                    */\n  /*                                                                       */\n  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */\n  /*   GNU/Linux).                                                         */\n  /*                                                                       */\n  /*   Resource forks which include fonts data are stored sometimes in     */\n  /*   locations which users or developers don't expected.  In some cases, */\n  /*   resource forks start with some offset from the head of a file.  In  */\n  /*   other cases, the actual resource fork is stored in file different   */\n  /*   from what the user specifies.  If this option is activated,         */\n  /*   FreeType tries to guess whether such offsets or different file      */\n  /*   names must be used.                                                 */\n  /*                                                                       */\n  /*   Note that normal, direct access of resource forks is controlled via */\n  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */\n  /*                                                                       */\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Allow the use of FT_Incremental_Interface to load typefaces that      */\n  /* contain no glyph data, but supply it via a callback function.         */\n  /* This is required by clients supporting document formats which         */\n  /* supply font data incrementally as the document is parsed, such        */\n  /* as the Ghostscript interpreter for the PostScript language.           */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INCREMENTAL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The size in bytes of the render pool used by the scan-line converter  */\n  /* to do all of its work.                                                */\n  /*                                                                       */\n  /* This must be greater than 4KByte if you use FreeType to rasterize     */\n  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */\n  /* allocation of the render pool.                                        */\n  /*                                                                       */\n#define FT_RENDER_POOL_SIZE  16384L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MAX_MODULES                                                        */\n  /*                                                                       */\n  /*   The maximum number of modules that can be registered in a single    */\n  /*   FreeType library object.  32 is the default.                        */\n  /*                                                                       */\n#define FT_MAX_MODULES  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Debug level                                                           */\n  /*                                                                       */\n  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */\n  /*   errors are reported through the `ftdebug' component.  In trace      */\n  /*   mode, additional messages are sent to the standard output during    */\n  /*   execution.                                                          */\n  /*                                                                       */\n  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */\n  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */\n  /*                                                                       */\n  /*   Don't define any of these macros to compile in `release' mode!      */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_LEVEL_ERROR */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Autofitter debugging                                                  */\n  /*                                                                       */\n  /*   If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to     */\n  /*   control the autofitter behaviour for debugging purposes with global */\n  /*   boolean variables (consequently, you should *never* enable this     */\n  /*   while compiling in `release' mode):                                 */\n  /*                                                                       */\n  /*     _af_debug_disable_horz_hints                                      */\n  /*     _af_debug_disable_vert_hints                                      */\n  /*     _af_debug_disable_blue_hints                                      */\n  /*                                                                       */\n  /*   Additionally, the following functions provide dumps of various      */\n  /*   internal autofit structures to stdout (using `printf'):             */\n  /*                                                                       */\n  /*     af_glyph_hints_dump_points                                        */\n  /*     af_glyph_hints_dump_segments                                      */\n  /*     af_glyph_hints_dump_edges                                         */\n  /*                                                                       */\n  /*   As an argument, they use another global variable:                   */\n  /*                                                                       */\n  /*     _af_debug_hints                                                   */\n  /*                                                                       */\n  /*   Please have a look at the `ftgrid' demo program to see how those    */\n  /*   variables and macros should be used.                                */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_AUTOFIT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Memory Debugging                                                      */\n  /*                                                                       */\n  /*   FreeType now comes with an integrated memory debugger that is       */\n  /*   capable of detecting simple errors like memory leaks or double      */\n  /*   deletes.  To compile it within your build of the library, you       */\n  /*   should define FT_DEBUG_MEMORY here.                                 */\n  /*                                                                       */\n  /*   Note that the memory debugger is only activated at runtime when     */\n  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_DEBUG_MEMORY */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Module errors                                                         */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), the higher byte  */\n  /*   of an error code gives the module in which the error has occurred,  */\n  /*   while the lower byte is the real error code.                        */\n  /*                                                                       */\n  /*   Setting this macro makes sense for debugging purposes only, since   */\n  /*   it would break source compatibility of certain programs that use    */\n  /*   FreeType 2.                                                         */\n  /*                                                                       */\n  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Position Independent Code                                             */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), FreeType2 will   */\n  /*   avoid creating constants that require address fixups.  Instead the  */\n  /*   constants will be moved into a struct and additional intialization  */\n  /*   code will be used.                                                  */\n  /*                                                                       */\n  /*   Setting this macro is needed for systems that prohibit address      */\n  /*   fixups, such as BREW.                                               */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */\n  /* embedded bitmaps in all formats using the SFNT module (namely         */\n  /* TrueType & OpenType).                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */\n  /* load and enumerate the glyph Postscript names in a TrueType or        */\n  /* OpenType file.                                                        */\n  /*                                                                       */\n  /* Note that when you do not compile the `PSNames' module by undefining  */\n  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */\n  /* contain additional code used to read the PS Names table from a font.  */\n  /*                                                                       */\n  /* (By default, the module uses `PSNames' to extract glyph names.)       */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */\n  /* access the internal name table in a SFNT-based format like TrueType   */\n  /* or OpenType.  The name table contains various strings used to         */\n  /* describe the font, like family name, copyright, version, etc.  It     */\n  /* does not contain any glyph name though.                               */\n  /*                                                                       */\n  /* Accessing SFNT names is done through the functions declared in        */\n  /* `freetype/ftsnames.h'.                                                */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType CMap support                                                 */\n  /*                                                                       */\n  /*   Here you can fine-tune which TrueType CMap table format shall be    */\n  /*   supported.                                                          */\n#define TT_CONFIG_CMAP_FORMAT_0\n#define TT_CONFIG_CMAP_FORMAT_2\n#define TT_CONFIG_CMAP_FORMAT_4\n#define TT_CONFIG_CMAP_FORMAT_6\n#define TT_CONFIG_CMAP_FORMAT_8\n#define TT_CONFIG_CMAP_FORMAT_10\n#define TT_CONFIG_CMAP_FORMAT_12\n#define TT_CONFIG_CMAP_FORMAT_13\n#define TT_CONFIG_CMAP_FORMAT_14\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */\n  /* a bytecode interpreter in the TrueType driver.                        */\n  /*                                                                       */\n  /* By undefining this, you will only compile the code necessary to load  */\n  /* TrueType glyphs without hinting.                                      */\n  /*                                                                       */\n  /*   Do not #undef this macro here, since the build system might         */\n  /*   define it for certain configurations only.                          */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile       */\n  /* EXPERIMENTAL subpixel hinting support into the TrueType driver.  This */\n  /* replaces the native TrueType hinting mechanism when anything but      */\n  /* FT_RENDER_MODE_MONO is requested.                                     */\n  /*                                                                       */\n  /* Enabling this causes the TrueType driver to ignore instructions under */\n  /* certain conditions.  This is done in accordance with the guide here,  */\n  /* with some minor differences:                                          */\n  /*                                                                       */\n  /*  http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */\n  /*                                                                       */\n  /* By undefining this, you only compile the code necessary to hint       */\n  /* TrueType glyphs with native TT hinting.                               */\n  /*                                                                       */\n  /*   This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */\n  /*   defined.                                                            */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */\n  /* of the TrueType bytecode interpreter is used that doesn't implement   */\n  /* any of the patented opcodes and algorithms.  The patents related to   */\n  /* TrueType hinting have expired worldwide since May 2010; this option   */\n  /* is now deprecated.                                                    */\n  /*                                                                       */\n  /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored*  */\n  /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words,  */\n  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */\n  /*                                                                       */\n  /* This macro is only useful for a small number of font files (mostly    */\n  /* for Asian scripts) that require bytecode interpretation to properly   */\n  /* load glyphs.  For all other fonts, this produces unpleasant results,  */\n  /* thus the unpatented interpreter is never used to load glyphs from     */\n  /* TrueType fonts unless one of the following two options is used.       */\n  /*                                                                       */\n  /*   - The unpatented interpreter is explicitly activated by the user    */\n  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */\n  /*     when opening the FT_Face.                                         */\n  /*                                                                       */\n  /*   - FreeType detects that the FT_Face corresponds to one of the       */\n  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */\n  /*     contains a hard-coded list of font names and other matching       */\n  /*     parameters (see function `tt_face_init' in file                   */\n  /*     `src/truetype/ttobjs.c').                                         */\n  /*                                                                       */\n  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     FT_Parameter  parameter;                                          */\n  /*     FT_Open_Args  open_args;                                          */\n  /*                                                                       */\n  /*                                                                       */\n  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */\n  /*                                                                       */\n  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */\n  /*     open_args.pathname   = my_font_pathname;                          */\n  /*     open_args.num_params = 1;                                         */\n  /*     open_args.params     = &parameter;                                */\n  /*                                                                       */\n  /*     error = FT_Open_Face( library, &open_args, index, &face );        */\n  /*     ...                                                               */\n  /*   }                                                                   */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */\n  /* bytecode interpreter with a huge switch statement, rather than a call */\n  /* table.  This results in smaller and faster code for a number of       */\n  /* architectures.                                                        */\n  /*                                                                       */\n  /* Note however that on some compiler/processor combinations, undefining */\n  /* this macro will generate faster, though larger, code.                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */\n  /* TrueType glyph loader to use Apple's definition of how to handle      */\n  /* component offsets in composite glyphs.                                */\n  /*                                                                       */\n  /* Apple and MS disagree on the default behavior of component offsets    */\n  /* in composites.  Apple says that they should be scaled by the scaling  */\n  /* factors in the transformation matrix (roughly, it's more complex)     */\n  /* while MS says they should not.  OpenType defines two bits in the      */\n  /* composite flags array which can be used to disambiguate, but old      */\n  /* fonts will not have them.                                             */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/otspec/glyf.htm                 */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */\n  /*                                                                       */\n#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */\n  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */\n  /* and avar tables).  This has many similarities to Type 1 Multiple      */\n  /* Masters support.                                                      */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */\n  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BDF\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and       */\n  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */\n  /* required.                                                             */\n  /*                                                                       */\n#define T1_MAX_DICT_DEPTH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  256\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */\n  /* files into an existing face.  Note that if set, the T1 driver will be */\n  /* unable to produce kerning distances.                                  */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_AFM\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of the Multiple Masters font support in the Type 1        */\n  /* driver.                                                               */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF       */\n  /* engine gets compiled into FreeType.  If defined, it is possible to    */\n  /* switch between the two engines using the `hinting-engine' property of */\n  /* the cff driver module.                                                */\n  /*                                                                       */\n/* #define CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with CJK (Chinese, Japanese, Korean) script    */\n  /* support.                                                              */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_CJK\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with Indic script support.                     */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_INDIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with warp hinting.  The idea of the warping    */\n  /* code is to slightly scale and shift a glyph within a single dimension */\n  /* so that as much of its segments are aligned (more or less) on the     */\n  /* grid.  To find out the optimal scaling and shifting value, various    */\n  /* parameter combinations are tried and scored.                          */\n  /*                                                                       */\n  /* This experimental option is only active if the render mode is         */\n  /* FT_RENDER_MODE_LIGHT.                                                 */\n  /*                                                                       */\n/* #define AF_CONFIG_OPTION_USE_WARPER */\n\n  /* */\n\n\n  /*\n   *  This macro is obsolete.  Support has been removed in FreeType\n   *  version 2.5.\n   */\n/* #define FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*\n   * This macro is defined if either unpatented or native TrueType\n   * hinting is requested by the definitions above.\n   */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n#define  TT_USE_BYTECODE_INTERPRETER\n#undef   TT_CONFIG_OPTION_UNPATENTED_HINTING\n#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define  TT_USE_BYTECODE_INTERPRETER\n#endif\n\nFT_END_HEADER\n\n\n#endif /* __FTOPTION_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/config/ftstdlib.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstdlib.h                                                             */\n/*                                                                         */\n/*    ANSI-specific library and header configuration file (specification   */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2002-2007, 2009, 2011-2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to group all #includes to the ANSI C library that   */\n  /* FreeType normally requires.  It also defines macros to rename the     */\n  /* standard functions within the FreeType source code.                   */\n  /*                                                                       */\n  /* Load a file which defines __FTSTDLIB_H__ before this one to override  */\n  /* it.                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSTDLIB_H__\n#define __FTSTDLIB_H__\n\n\n#include <stddef.h>\n\n#define ft_ptrdiff_t  ptrdiff_t\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           integer limits                           */\n  /*                                                                    */\n  /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */\n  /* of `int' and `long' in bytes at compile-time.  So far, this works  */\n  /* for all platforms the library has been tested on.                  */\n  /*                                                                    */\n  /* Note that on the extremely rare platforms that do not provide      */\n  /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */\n  /* old Crays where `int' is 36 bits), we do not make any guarantee    */\n  /* about the correct behaviour of FT2 with all fonts.                 */\n  /*                                                                    */\n  /* In these case, `ftconfig.h' will refuse to compile anyway with a   */\n  /* message like `couldn't find 32-bit type' or something similar.     */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <limits.h>\n\n#define FT_CHAR_BIT    CHAR_BIT\n#define FT_USHORT_MAX  USHRT_MAX\n#define FT_INT_MAX     INT_MAX\n#define FT_INT_MIN     INT_MIN\n#define FT_UINT_MAX    UINT_MAX\n#define FT_ULONG_MAX   ULONG_MAX\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                 character and string processing                    */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <string.h>\n\n#define ft_memchr   memchr\n#define ft_memcmp   memcmp\n#define ft_memcpy   memcpy\n#define ft_memmove  memmove\n#define ft_memset   memset\n#define ft_strcat   strcat\n#define ft_strcmp   strcmp\n#define ft_strcpy   strcpy\n#define ft_strlen   strlen\n#define ft_strncmp  strncmp\n#define ft_strncpy  strncpy\n#define ft_strrchr  strrchr\n#define ft_strstr   strstr\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           file handling                            */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdio.h>\n\n#define FT_FILE     FILE\n#define ft_fclose   fclose\n#define ft_fopen    fopen\n#define ft_fread    fread\n#define ft_fseek    fseek\n#define ft_ftell    ftell\n#define ft_sprintf  sprintf\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                             sorting                                */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdlib.h>\n\n#define ft_qsort  qsort\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                        memory allocation                           */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_scalloc   calloc\n#define ft_sfree     free\n#define ft_smalloc   malloc\n#define ft_srealloc  realloc\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                          miscellaneous                             */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_atol   atol\n#define ft_labs   labs\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                         execution control                          */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <setjmp.h>\n\n#define ft_jmp_buf     jmp_buf  /* note: this cannot be a typedef since */\n                                /*       jmp_buf is defined as a macro  */\n                                /*       on certain platforms           */\n\n#define ft_longjmp     longjmp\n#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */\n\n\n  /* the following is only used for debugging purposes, i.e., if */\n  /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined    */\n\n#include <stdarg.h>\n\n\n#endif /* __FTSTDLIB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/freetype.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  freetype.h                                                             */\n/*                                                                         */\n/*    FreeType high-level API and common types (specification only).       */\n/*                                                                         */\n/*  Copyright 1996-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FREETYPE_H__\n#define __FREETYPE_H__\n\n\n#ifndef FT_FREETYPE_H\n#error \"`ft2build.h' hasn't been included yet!\"\n#error \"Please always use macros to include FreeType header files.\"\n#error \"Example:\"\n#error \"  #include <ft2build.h>\"\n#error \"  #include FT_FREETYPE_H\"\n#endif\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n#include FT_ERRORS_H\n\n\nFT_BEGIN_HEADER\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    user_allocation                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    User allocation                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should allocate FreeType data structures.  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType assumes that structures allocated by the user and passed  */\n  /*    as arguments are zeroed out except for the actual data.  In other  */\n  /*    words, it is recommended to use `calloc' (or variants of it)       */\n  /*    instead of `malloc' for allocation.                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        B A S I C   T Y P E S                          */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Base Interface                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 base font interface.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section describes the public high-level API of FreeType~2.    */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library                                                         */\n  /*    FT_Face                                                            */\n  /*    FT_Size                                                            */\n  /*    FT_GlyphSlot                                                       */\n  /*    FT_CharMap                                                         */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SCALABLE                                              */\n  /*    FT_FACE_FLAG_FIXED_SIZES                                           */\n  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */\n  /*    FT_FACE_FLAG_HORIZONTAL                                            */\n  /*    FT_FACE_FLAG_VERTICAL                                              */\n  /*    FT_FACE_FLAG_SFNT                                                  */\n  /*    FT_FACE_FLAG_KERNING                                               */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */\n  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */\n  /*    FT_FACE_FLAG_HINTER                                                */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD                                                 */\n  /*    FT_STYLE_FLAG_ITALIC                                               */\n  /*                                                                       */\n  /*    FT_SizeRec                                                         */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /*    FT_GlyphSlotRec                                                    */\n  /*    FT_Glyph_Metrics                                                   */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /*    FT_Init_FreeType                                                   */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /*    FT_New_Face                                                        */\n  /*    FT_Done_Face                                                       */\n  /*    FT_New_Memory_Face                                                 */\n  /*    FT_Open_Face                                                       */\n  /*    FT_Open_Args                                                       */\n  /*    FT_Parameter                                                       */\n  /*    FT_Attach_File                                                     */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /*    FT_Set_Char_Size                                                   */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*    FT_Request_Size                                                    */\n  /*    FT_Select_Size                                                     */\n  /*    FT_Size_Request_Type                                               */\n  /*    FT_Size_Request                                                    */\n  /*    FT_Set_Transform                                                   */\n  /*    FT_Load_Glyph                                                      */\n  /*    FT_Get_Char_Index                                                  */\n  /*    FT_Get_Name_Index                                                  */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /*    FT_OPEN_MEMORY                                                     */\n  /*    FT_OPEN_STREAM                                                     */\n  /*    FT_OPEN_PATHNAME                                                   */\n  /*    FT_OPEN_DRIVER                                                     */\n  /*    FT_OPEN_PARAMS                                                     */\n  /*                                                                       */\n  /*    FT_LOAD_DEFAULT                                                    */\n  /*    FT_LOAD_RENDER                                                     */\n  /*    FT_LOAD_MONOCHROME                                                 */\n  /*    FT_LOAD_LINEAR_DESIGN                                              */\n  /*    FT_LOAD_NO_SCALE                                                   */\n  /*    FT_LOAD_NO_HINTING                                                 */\n  /*    FT_LOAD_NO_BITMAP                                                  */\n  /*    FT_LOAD_CROP_BITMAP                                                */\n  /*                                                                       */\n  /*    FT_LOAD_VERTICAL_LAYOUT                                            */\n  /*    FT_LOAD_IGNORE_TRANSFORM                                           */\n  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */\n  /*    FT_LOAD_FORCE_AUTOHINT                                             */\n  /*    FT_LOAD_NO_RECURSE                                                 */\n  /*    FT_LOAD_PEDANTIC                                                   */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_NORMAL                                              */\n  /*    FT_LOAD_TARGET_LIGHT                                               */\n  /*    FT_LOAD_TARGET_MONO                                                */\n  /*    FT_LOAD_TARGET_LCD                                                 */\n  /*    FT_LOAD_TARGET_LCD_V                                               */\n  /*                                                                       */\n  /*    FT_Render_Glyph                                                    */\n  /*    FT_Render_Mode                                                     */\n  /*    FT_Get_Kerning                                                     */\n  /*    FT_Kerning_Mode                                                    */\n  /*    FT_Get_Track_Kerning                                               */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /*    FT_CharMapRec                                                      */\n  /*    FT_Select_Charmap                                                  */\n  /*    FT_Set_Charmap                                                     */\n  /*    FT_Get_Charmap_Index                                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING                                    */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING                             */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING                              */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING                                            */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY                                    */\n  /*                                                                       */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Glyph_Metrics                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the metrics of a single glyph.  The      */\n  /*    values are expressed in 26.6 fractional pixel format; if the flag  */\n  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */\n  /*    are expressed in font units instead.                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width ::                                                           */\n  /*      The glyph's width.                                               */\n  /*                                                                       */\n  /*    height ::                                                          */\n  /*      The glyph's height.                                              */\n  /*                                                                       */\n  /*    horiBearingX ::                                                    */\n  /*      Left side bearing for horizontal layout.                         */\n  /*                                                                       */\n  /*    horiBearingY ::                                                    */\n  /*      Top side bearing for horizontal layout.                          */\n  /*                                                                       */\n  /*    horiAdvance ::                                                     */\n  /*      Advance width for horizontal layout.                             */\n  /*                                                                       */\n  /*    vertBearingX ::                                                    */\n  /*      Left side bearing for vertical layout.                           */\n  /*                                                                       */\n  /*    vertBearingY ::                                                    */\n  /*      Top side bearing for vertical layout.  Larger positive values    */\n  /*      mean further below the vertical glyph origin.                    */\n  /*                                                                       */\n  /*    vertAdvance ::                                                     */\n  /*      Advance height for vertical layout.  Positive values mean the    */\n  /*      glyph has a positive advance downward.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */\n  /*    dimensions of the hinted glyph (in case hinting is applicable).    */\n  /*                                                                       */\n  /*    Stroking a glyph with an outside border does not increase          */\n  /*    `horiAdvance' or `vertAdvance'; you have to manually adjust these  */\n  /*    values to account for the added width and height.                  */\n  /*                                                                       */\n  typedef struct  FT_Glyph_Metrics_\n  {\n    FT_Pos  width;\n    FT_Pos  height;\n\n    FT_Pos  horiBearingX;\n    FT_Pos  horiBearingY;\n    FT_Pos  horiAdvance;\n\n    FT_Pos  vertBearingX;\n    FT_Pos  vertBearingY;\n    FT_Pos  vertAdvance;\n\n  } FT_Glyph_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure models the metrics of a bitmap strike (i.e., a set  */\n  /*    of glyphs for a given point size and resolution) in a bitmap font. */\n  /*    It is used for the `available_sizes' field of @FT_Face.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height :: The vertical distance, in pixels, between two            */\n  /*              consecutive baselines.  It is always positive.           */\n  /*                                                                       */\n  /*    width  :: The average width, in pixels, of all glyphs in the       */\n  /*              strike.                                                  */\n  /*                                                                       */\n  /*    size   :: The nominal size of the strike in 26.6 fractional        */\n  /*              points.  This field is not very useful.                  */\n  /*                                                                       */\n  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Windows FNT:                                                       */\n  /*      The nominal size given in a FNT font is not reliable.  Thus when */\n  /*      the driver finds it incorrect, it sets `size' to some calculated */\n  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */\n  /*      height given in the font, respectively.                          */\n  /*                                                                       */\n  /*    TrueType embedded bitmaps:                                         */\n  /*      `size', `width', and `height' values are not contained in the    */\n  /*      bitmap strike itself.  They are computed from the global font    */\n  /*      parameters.                                                      */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_Size_\n  {\n    FT_Short  height;\n    FT_Short  width;\n\n    FT_Pos    size;\n\n    FT_Pos    x_ppem;\n    FT_Pos    y_ppem;\n\n  } FT_Bitmap_Size;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     O B J E C T   C L A S S E S                       */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Library                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a FreeType library instance.  Each `library' is        */\n  /*    completely independent from the others; it is the `root' of a set  */\n  /*    of objects like fonts, faces, sizes, etc.                          */\n  /*                                                                       */\n  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */\n  /*    scan-line converter object (see @FT_Raster).                       */\n  /*                                                                       */\n  /*    In multi-threaded applications, make sure that the same FT_Library */\n  /*    object or any of its children doesn't get accessed in parallel.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Library objects are normally created by @FT_Init_FreeType, and     */\n  /*    destroyed with @FT_Done_FreeType.  If you need reference-counting  */\n  /*    (cf. @FT_Reference_Library), use @FT_New_Library and               */\n  /*    @FT_Done_Library.                                                  */\n  /*                                                                       */\n  typedef struct FT_LibraryRec_  *FT_Library;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Module                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType module object.  Each module can be a  */\n  /*    font driver, a renderer, or anything else that provides services   */\n  /*    to the formers.                                                    */\n  /*                                                                       */\n  typedef struct FT_ModuleRec_*  FT_Module;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType font driver object.  Each font driver */\n  /*    is a special module capable of creating faces from font files.     */\n  /*                                                                       */\n  typedef struct FT_DriverRec_*  FT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Renderer                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType renderer.  A renderer is a special    */\n  /*    module in charge of converting a glyph image to a bitmap, when     */\n  /*    necessary.  Each renderer supports a given glyph image format, and */\n  /*    one or more target surface depths.                                 */\n  /*                                                                       */\n  typedef struct FT_RendererRec_*  FT_Renderer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given typographic face object.  A face object models */\n  /*    a given typeface, in a given style.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */\n  /*    as one or more @FT_Size objects.                                   */\n  /*                                                                       */\n  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */\n  /*    a given filepathname or a custom input stream.                     */\n  /*                                                                       */\n  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_FaceRec for the publicly accessible fields of a given face */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_FaceRec_*  FT_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a face scaled to a given       */\n  /*    character size.                                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */\n  /*    functions like @FT_Load_Glyph to determine the scaling             */\n  /*    transformation which is used to load and hint glyphs and metrics.  */\n  /*                                                                       */\n  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */\n  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */\n  /*    (i.e., the scaling values) of the active @FT_Size.                 */\n  /*                                                                       */\n  /*    You can use @FT_New_Size to create additional size objects for a   */\n  /*    given @FT_Face, but they won't be used by other functions until    */\n  /*    you activate it through @FT_Activate_Size.  Only one size can be   */\n  /*    activated at any given time per face.                              */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_SizeRec for the publicly accessible fields of a given size */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_SizeRec_*  FT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given `glyph slot'.  A slot is a container where it  */\n  /*    is possible to load any of the glyphs contained in its parent      */\n  /*    face.                                                              */\n  /*                                                                       */\n  /*    In other words, each time you call @FT_Load_Glyph or               */\n  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */\n  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */\n  /*    other control information.                                         */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_GlyphSlotRec for the publicly accessible glyph fields.     */\n  /*                                                                       */\n  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given character map.  A charmap is used to translate */\n  /*    character codes in a given encoding into glyph indexes for its     */\n  /*    parent's face.  Some font formats may provide several charmaps per */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    Each face object owns zero or more charmaps, but only one of them  */\n  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */\n  /*                                                                       */\n  /*    The list of available charmaps in a face is available through the  */\n  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    The currently active charmap is available as `face->charmap'.      */\n  /*    You should call @FT_Set_Charmap to change it.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When a new face is created (either through @FT_New_Face or         */\n  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */\n  /*    the list and automatically activates it.                           */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_CharMapRec for the publicly accessible fields of a given   */\n  /*    character map.                                                     */\n  /*                                                                       */\n  typedef struct FT_CharMapRec_*  FT_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags into an unsigned long.  It is */\n  /*    used to define `encoding' identifiers (see @FT_Encoding).          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n\n#ifndef FT_ENC_TAG\n#define FT_ENC_TAG( value, a, b, c, d )         \\\n          value = ( ( (FT_UInt32)(a) << 24 ) |  \\\n                    ( (FT_UInt32)(b) << 16 ) |  \\\n                    ( (FT_UInt32)(c) <<  8 ) |  \\\n                      (FT_UInt32)(d)         )\n\n#endif /* FT_ENC_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify character sets supported by         */\n  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Despite the name, this enumeration lists specific character        */\n  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */\n  /*    UTF-8, UTF-16, etc.).                                              */\n  /*                                                                       */\n  /*    Other encodings might be defined in the future.                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_ENCODING_NONE ::                                                */\n  /*      The encoding value~0 is reserved.                                */\n  /*                                                                       */\n  /*    FT_ENCODING_UNICODE ::                                             */\n  /*      Corresponds to the Unicode character set.  This value covers     */\n  /*      all versions of the Unicode repertoire, including ASCII and      */\n  /*      Latin-1.  Most fonts include a Unicode charmap, but not all      */\n  /*      of them.                                                         */\n  /*                                                                       */\n  /*      For example, if you want to access Unicode value U+1F028 (and    */\n  /*      the font contains it), use value 0x1F028 as the input value for  */\n  /*      @FT_Get_Char_Index.                                              */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SYMBOL ::                                           */\n  /*      Corresponds to the Microsoft Symbol encoding, used to encode     */\n  /*      mathematical symbols in the 32..255 character code range.  For   */\n  /*      more information, see `http://www.ceviz.net/symbol.htm'.         */\n  /*                                                                       */\n  /*    FT_ENCODING_SJIS ::                                                */\n  /*      Corresponds to Japanese SJIS encoding.  More info at             */\n  /*      at `http://langsupport.japanreference.com/encoding.shtml'.       */\n  /*      See note on multi-byte encodings below.                          */\n  /*                                                                       */\n  /*    FT_ENCODING_GB2312 ::                                              */\n  /*      Corresponds to an encoding system for Simplified Chinese as used */\n  /*      used in mainland China.                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_BIG5 ::                                                */\n  /*      Corresponds to an encoding system for Traditional Chinese as     */\n  /*      used in Taiwan and Hong Kong.                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_WANSUNG ::                                             */\n  /*      Corresponds to the Korean encoding system known as Wansung.      */\n  /*      For more information see                                         */\n  /*      `http://www.microsoft.com/typography/unicode/949.txt'.           */\n  /*                                                                       */\n  /*    FT_ENCODING_JOHAB ::                                               */\n  /*      The Korean standard character set (KS~C 5601-1992), which        */\n  /*      corresponds to MS Windows code page 1361.  This character set    */\n  /*      includes all possible Hangeul character combinations.            */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_LATIN_1 ::                                       */\n  /*      Corresponds to a Latin-1 encoding as defined in a Type~1         */\n  /*      PostScript font.  It is limited to 256 character codes.          */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_STANDARD ::                                      */\n  /*      Corresponds to the Adobe Standard encoding, as found in Type~1,  */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_EXPERT ::                                        */\n  /*      Corresponds to the Adobe Expert encoding, as found in Type~1,    */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_CUSTOM ::                                        */\n  /*      Corresponds to a custom encoding, as found in Type~1, CFF, and   */\n  /*      OpenType/CFF fonts.  It is limited to 256 character codes.       */\n  /*                                                                       */\n  /*    FT_ENCODING_APPLE_ROMAN ::                                         */\n  /*      Corresponds to the 8-bit Apple roman encoding.  Many TrueType    */\n  /*      and OpenType fonts contain a charmap for this encoding, since    */\n  /*      older versions of Mac OS are able to use it.                     */\n  /*                                                                       */\n  /*    FT_ENCODING_OLD_LATIN_2 ::                                         */\n  /*      This value is deprecated and was never used nor reported by      */\n  /*      FreeType.  Don't use or test for it.                             */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SJIS ::                                             */\n  /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_GB2312 ::                                           */\n  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_BIG5 ::                                             */\n  /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_WANSUNG ::                                          */\n  /*      Same as FT_ENCODING_WANSUNG.  Deprecated.                        */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_JOHAB ::                                            */\n  /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    By default, FreeType automatically synthesizes a Unicode charmap   */\n  /*    for PostScript fonts, using their glyph names dictionaries.        */\n  /*    However, it also reports the encodings defined explicitly in the   */\n  /*    font file, for the cases when they are needed, with the Adobe      */\n  /*    values as well.                                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */\n  /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */\n  /*    FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out      */\n  /*    which encoding is really present.  If, for example, the            */\n  /*    `cs_registry' field is `KOI8' and the `cs_encoding' field is `R',  */\n  /*    the font is encoded in KOI8-R.                                     */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is always set (with a single exception) by the    */\n  /*    winfonts driver.  Use @FT_Get_WinFNT_Header and examine the        */\n  /*    `charset' field of the @FT_WinFNT_HeaderRec structure to find out  */\n  /*    which encoding is really present.  For example,                    */\n  /*    @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for       */\n  /*    Russian).                                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */\n  /*    and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to  */\n  /*    FT_ENCODING_APPLE_ROMAN).                                          */\n  /*                                                                       */\n  /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */\n  /*    @FT_Get_CMap_Language_ID  to query the Mac language ID which may   */\n  /*    be needed to be able to distinguish Apple encoding variants.  See  */\n  /*                                                                       */\n  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT  */\n  /*                                                                       */\n  /*    to get an idea how to do that.  Basically, if the language ID      */\n  /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */\n  /*    Then examine `encoding_id'.  If, for example, `encoding_id' is     */\n  /*    @TT_MAC_ID_ROMAN and the language ID (minus~1) is                  */\n  /*    `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.        */\n  /*    @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi       */\n  /*    variant the Arabic encoding.                                       */\n  /*                                                                       */\n  typedef enum  FT_Encoding_\n  {\n    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),\n\n    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),\n    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),\n\n    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),\n    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),\n    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),\n    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),\n    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),\n\n    /* for backwards compatibility */\n    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,\n    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,\n    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,\n    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,\n    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,\n\n    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),\n\n    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),\n\n    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )\n\n  } FT_Encoding;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_encoding_xxx                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated; use the corresponding @FT_Encoding */\n  /*    values instead.                                                    */\n  /*                                                                       */\n#define ft_encoding_none            FT_ENCODING_NONE\n#define ft_encoding_unicode         FT_ENCODING_UNICODE\n#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL\n#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1\n#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2\n#define ft_encoding_sjis            FT_ENCODING_SJIS\n#define ft_encoding_gb2312          FT_ENCODING_GB2312\n#define ft_encoding_big5            FT_ENCODING_BIG5\n#define ft_encoding_wansung         FT_ENCODING_WANSUNG\n#define ft_encoding_johab           FT_ENCODING_JOHAB\n\n#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD\n#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT\n#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM\n#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_CharMapRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The base charmap structure.                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face        :: A handle to the parent face object.                 */\n  /*                                                                       */\n  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */\n  /*                   this with @FT_Select_Charmap.                       */\n  /*                                                                       */\n  /*    platform_id :: An ID number describing the platform for the        */\n  /*                   following encoding ID.  This comes directly from    */\n  /*                   the TrueType specification and should be emulated   */\n  /*                   for other formats.                                  */\n  /*                                                                       */\n  /*    encoding_id :: A platform specific encoding number.  This also     */\n  /*                   comes from the TrueType specification and should be */\n  /*                   emulated similarly.                                 */\n  /*                                                                       */\n  typedef struct  FT_CharMapRec_\n  {\n    FT_Face      face;\n    FT_Encoding  encoding;\n    FT_UShort    platform_id;\n    FT_UShort    encoding_id;\n\n  } FT_CharMapRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 B A S E   O B J E C T   C L A S S E S                 */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Face object.                     */\n  /*                                                                       */\n  /*    This structure might change between releases of FreeType~2 and is  */\n  /*    not generally available to client applications.                    */\n  /*                                                                       */\n  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root face class structure.  A face object models a        */\n  /*    typeface in a font file.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_faces           :: The number of faces in the font file.  Some */\n  /*                           font formats can have multiple faces in     */\n  /*                           a font file.                                */\n  /*                                                                       */\n  /*    face_index          :: The index of the face in the font file.  It */\n  /*                           is set to~0 if there is only one face in    */\n  /*                           the font file.                              */\n  /*                                                                       */\n  /*    face_flags          :: A set of bit flags that give important      */\n  /*                           information about the face; see             */\n  /*                           @FT_FACE_FLAG_XXX for the details.          */\n  /*                                                                       */\n  /*    style_flags         :: A set of bit flags indicating the style of  */\n  /*                           the face; see @FT_STYLE_FLAG_XXX for the    */\n  /*                           details.                                    */\n  /*                                                                       */\n  /*    num_glyphs          :: The number of glyphs in the face.  If the   */\n  /*                           face is scalable and has sbits (see         */\n  /*                           `num_fixed_sizes'), it is set to the number */\n  /*                           of outline glyphs.                          */\n  /*                                                                       */\n  /*                           For CID-keyed fonts, this value gives the   */\n  /*                           highest CID used in the font.               */\n  /*                                                                       */\n  /*    family_name         :: The face's family name.  This is an ASCII   */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's family (like `Times New      */\n  /*                           Roman', `Bodoni', `Garamond', etc).  This   */\n  /*                           is a least common denominator used to list  */\n  /*                           fonts.  Some formats (TrueType & OpenType)  */\n  /*                           provide localized and Unicode versions of   */\n  /*                           this string.  Applications should use the   */\n  /*                           format specific interface to access them.   */\n  /*                           Can be NULL (e.g., in fonts embedded in a   */\n  /*                           PDF file).                                  */\n  /*                                                                       */\n  /*    style_name          :: The face's style name.  This is an ASCII    */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's style (like `Italic',        */\n  /*                           `Bold', `Condensed', etc).  Not all font    */\n  /*                           formats provide a style name, so this field */\n  /*                           is optional, and can be set to NULL.  As    */\n  /*                           for `family_name', some formats provide     */\n  /*                           localized and Unicode versions of this      */\n  /*                           string.  Applications should use the format */\n  /*                           specific interface to access them.          */\n  /*                                                                       */\n  /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */\n  /*                           Even if the face is scalable, there might   */\n  /*                           still be bitmap strikes, which are called   */\n  /*                           `sbits' in that case.                       */\n  /*                                                                       */\n  /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */\n  /*                           strikes in the face.  It is set to NULL if  */\n  /*                           there is no bitmap strike.                  */\n  /*                                                                       */\n  /*    num_charmaps        :: The number of charmaps in the face.         */\n  /*                                                                       */\n  /*    charmaps            :: An array of the charmaps of the face.       */\n  /*                                                                       */\n  /*    generic             :: A field reserved for client uses.  See the  */\n  /*                           @FT_Generic type description.               */\n  /*                                                                       */\n  /*    bbox                :: The font bounding box.  Coordinates are     */\n  /*                           expressed in font units (see                */\n  /*                           `units_per_EM').  The box is large enough   */\n  /*                           to contain any glyph from the font.  Thus,  */\n  /*                           `bbox.yMax' can be seen as the `maximum     */\n  /*                           ascender', and `bbox.yMin' as the `minimum  */\n  /*                           descender'.  Only relevant for scalable     */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           Note that the bounding box might be off by  */\n  /*                           (at least) one pixel for hinted fonts.  See */\n  /*                           @FT_Size_Metrics for further discussion.    */\n  /*                                                                       */\n  /*    units_per_EM        :: The number of font units per EM square for  */\n  /*                           this face.  This is typically 2048 for      */\n  /*                           TrueType fonts, and 1000 for Type~1 fonts.  */\n  /*                           Only relevant for scalable formats.         */\n  /*                                                                       */\n  /*    ascender            :: The typographic ascender of the face,       */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMax'.  Only relevant for scalable    */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    descender           :: The typographic descender of the face,      */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMin'.  Note that this field is       */\n  /*                           usually negative.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    height              :: This value is the vertical distance         */\n  /*                           between two consecutive baselines,          */\n  /*                           expressed in font units.  It is always      */\n  /*                           positive.  Only relevant for scalable       */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           If you want the global glyph height, use    */\n  /*                           `ascender - descender'.                     */\n  /*                                                                       */\n  /*    max_advance_width   :: The maximum advance width, in font units,   */\n  /*                           for all glyphs in this face.  This can be   */\n  /*                           used to make word wrapping computations     */\n  /*                           faster.  Only relevant for scalable         */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_height  :: The maximum advance height, in font units,  */\n  /*                           for all glyphs in this face.  This is only  */\n  /*                           relevant for vertical layouts, and is set   */\n  /*                           to `height' for fonts that do not provide   */\n  /*                           vertical metrics.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    underline_position  :: The position, in font units, of the         */\n  /*                           underline line for this face.  It is the    */\n  /*                           center of the underlining stem.  Only       */\n  /*                           relevant for scalable formats.              */\n  /*                                                                       */\n  /*    underline_thickness :: The thickness, in font units, of the        */\n  /*                           underline for this face.  Only relevant for */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    glyph               :: The face's associated glyph slot(s).        */\n  /*                                                                       */\n  /*    size                :: The current active size for this face.      */\n  /*                                                                       */\n  /*    charmap             :: The current active charmap for this face.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Fields may be changed after a call to @FT_Attach_File or           */\n  /*    @FT_Attach_Stream.                                                 */\n  /*                                                                       */\n  typedef struct  FT_FaceRec_\n  {\n    FT_Long           num_faces;\n    FT_Long           face_index;\n\n    FT_Long           face_flags;\n    FT_Long           style_flags;\n\n    FT_Long           num_glyphs;\n\n    FT_String*        family_name;\n    FT_String*        style_name;\n\n    FT_Int            num_fixed_sizes;\n    FT_Bitmap_Size*   available_sizes;\n\n    FT_Int            num_charmaps;\n    FT_CharMap*       charmaps;\n\n    FT_Generic        generic;\n\n    /*# The following member variables (down to `underline_thickness') */\n    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */\n    /*# for bitmap fonts.                                              */\n    FT_BBox           bbox;\n\n    FT_UShort         units_per_EM;\n    FT_Short          ascender;\n    FT_Short          descender;\n    FT_Short          height;\n\n    FT_Short          max_advance_width;\n    FT_Short          max_advance_height;\n\n    FT_Short          underline_position;\n    FT_Short          underline_thickness;\n\n    FT_GlyphSlot      glyph;\n    FT_Size           size;\n    FT_CharMap        charmap;\n\n    /*@private begin */\n\n    FT_Driver         driver;\n    FT_Memory         memory;\n    FT_Stream         stream;\n\n    FT_ListRec        sizes_list;\n\n    FT_Generic        autohint;   /* face-specific auto-hinter data */\n    void*             extensions; /* unused                         */\n\n    FT_Face_Internal  internal;\n\n    /*@private end */\n\n  } FT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `face_flags' field of the          */\n  /*    @FT_FaceRec structure.  They inform client applications of         */\n  /*    properties of the corresponding face.                              */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FACE_FLAG_SCALABLE ::                                           */\n  /*      Indicates that the face contains outline glyphs.  This doesn't   */\n  /*      prevent bitmap strikes, i.e., a face can have both this and      */\n  /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */\n  /*      Indicates that the face contains bitmap strikes.  See also the   */\n  /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */\n  /*      Indicates that the face contains fixed-width characters (like    */\n  /*      Courier, Lucido, MonoType, etc.).                                */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SFNT ::                                               */\n  /*      Indicates that the face uses the `sfnt' storage scheme.  For     */\n  /*      now, this means TrueType and OpenType.                           */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HORIZONTAL ::                                         */\n  /*      Indicates that the face contains horizontal glyph metrics.  This */\n  /*      should be set for all common formats.                            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_VERTICAL ::                                           */\n  /*      Indicates that the face contains vertical glyph metrics.  This   */\n  /*      is only available in some formats, not all of them.              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_KERNING ::                                            */\n  /*      Indicates that the face contains kerning information.  If set,   */\n  /*      the kerning distance can be retrieved through the function       */\n  /*      @FT_Get_Kerning.  Otherwise the function always return the       */\n  /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */\n  /*      from the `GPOS' table (as present in some OpenType fonts).       */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */\n  /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */\n  /*      Indicates that the font contains multiple masters and is capable */\n  /*      of interpolating between them.  See the multiple-masters         */\n  /*      specific API for details.                                        */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */\n  /*      Indicates that the font contains glyph names that can be         */\n  /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */\n  /*      fonts contain broken glyph name tables.  Use the function        */\n  /*      @FT_Has_PS_Glyph_Names when needed.                              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */\n  /*      Used internally by FreeType to indicate that a face's stream was */\n  /*      provided by the client application and should not be destroyed   */\n  /*      when @FT_Done_Face is called.  Don't read or test this flag.     */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HINTER ::                                             */\n  /*      Set if the font driver has a hinting machine of its own.  For    */\n  /*      example, with TrueType fonts, it makes sense to use data from    */\n  /*      the SFNT `gasp' table only if the native TrueType hinting engine */\n  /*      (with the bytecode interpreter) is available and active.         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_CID_KEYED ::                                          */\n  /*      Set if the font is CID-keyed.  In that case, the font is not     */\n  /*      accessed by glyph indices but by CID values.  For subsetted      */\n  /*      CID-keyed fonts this has the consequence that not all index      */\n  /*      values are a valid argument to FT_Load_Glyph.  Only the CID      */\n  /*      values for which corresponding glyphs in the subsetted font      */\n  /*      exist make FT_Load_Glyph return successfully; in all other cases */\n  /*      you get an `FT_Err_Invalid_Argument' error.                      */\n  /*                                                                       */\n  /*      Note that CID-keyed fonts which are in an SFNT wrapper don't     */\n  /*      have this flag set since the glyphs are accessed in the normal   */\n  /*      way (using contiguous indices); the `CID-ness' isn't visible to  */\n  /*      the application.                                                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_TRICKY ::                                             */\n  /*      Set if the font is `tricky', this is, it always needs the        */\n  /*      font format's native hinting engine to get a reasonable result.  */\n  /*      A typical example is the Chinese font `mingli.ttf' which uses    */\n  /*      TrueType bytecode instructions to move and scale all of its      */\n  /*      subglyphs.                                                       */\n  /*                                                                       */\n  /*      It is not possible to autohint such fonts using                  */\n  /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */\n  /*      @FT_LOAD_NO_HINTING.  You have to set both @FT_LOAD_NO_HINTING   */\n  /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */\n  /*      probably never want this except for demonstration purposes.      */\n  /*                                                                       */\n  /*      Currently, there are about a dozen TrueType fonts in the list of */\n  /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */\n  /*                                                                       */\n#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )\n#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )\n#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )\n#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )\n#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )\n#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )\n#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )\n#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )\n#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )\n#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )\n#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )\n#define FT_FACE_FLAG_HINTER            ( 1L << 11 )\n#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )\n#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_HORIZONTAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   horizontal metrics (this is true for all font formats though).\n   *\n   * @also:\n   *   @FT_HAS_VERTICAL can be used to check for vertical metrics.\n   *\n   */\n#define FT_HAS_HORIZONTAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_VERTICAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains real\n   *   vertical metrics (and not only synthesized ones).\n   *\n   */\n#define FT_HAS_VERTICAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_VERTICAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_KERNING( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains kerning\n   *   data that can be accessed with @FT_Get_Kerning.\n   *\n   */\n#define FT_HAS_KERNING( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_KERNING )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SCALABLE( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a scalable\n   *   font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,\n   *   and PFR font formats.\n   *\n   */\n#define FT_IS_SCALABLE( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SCALABLE )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SFNT( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font\n   *   whose format is based on the SFNT storage scheme.  This usually\n   *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded\n   *   bitmap fonts.\n   *\n   *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and\n   *   @FT_TRUETYPE_TABLES_H are available.\n   *\n   */\n#define FT_IS_SFNT( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SFNT )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_FIXED_WIDTH( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font face\n   *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)\n   *   glyphs.\n   *\n   */\n#define FT_IS_FIXED_WIDTH( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FIXED_SIZES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   embedded bitmaps.  See the `available_sizes' field of the\n   *   @FT_FaceRec structure.\n   *\n   */\n#define FT_HAS_FIXED_SIZES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FAST_GLYPHS( face )\n   *\n   * @description:\n   *   Deprecated.\n   *\n   */\n#define FT_HAS_FAST_GLYPHS( face )  0\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_GLYPH_NAMES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some glyph\n   *   names that can be accessed through @FT_Get_Glyph_Name.\n   *\n   */\n#define FT_HAS_GLYPH_NAMES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_MULTIPLE_MASTERS( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H\n   *   are then available to choose the exact design you want.\n   *\n   */\n#define FT_HAS_MULTIPLE_MASTERS( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_CID_KEYED( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a CID-keyed\n   *   font.  See the discussion of @FT_FACE_FLAG_CID_KEYED for more\n   *   details.\n   *\n   *   If this macro is true, all functions defined in @FT_CID_H are\n   *   available.\n   *\n   */\n#define FT_IS_CID_KEYED( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_TRICKY( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face represents a `tricky' font.\n   *   See the discussion of @FT_FACE_FLAG_TRICKY for more details.\n   *\n   */\n#define FT_IS_TRICKY( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_TRICKY )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-flags used to indicate the style of a given face.    */\n  /*    These are used in the `style_flags' field of @FT_FaceRec.          */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_STYLE_FLAG_ITALIC ::                                            */\n  /*      Indicates that a given face style is italic or oblique.          */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD ::                                              */\n  /*      Indicates that a given face is bold.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The style information as provided by FreeType is very basic.  More */\n  /*    details are beyond the scope and should be done on a higher level  */\n  /*    (for example, by analyzing various fields of the `OS/2' table in   */\n  /*    SFNT based fonts).                                                 */\n  /*                                                                       */\n#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )\n#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Size object.                     */\n  /*                                                                       */\n  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The size metrics structure gives the metrics of a size object.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x_ppem       :: The width of the scaled EM square in pixels, hence */\n  /*                    the term `ppem' (pixels per EM).  It is also       */\n  /*                    referred to as `nominal width'.                    */\n  /*                                                                       */\n  /*    y_ppem       :: The height of the scaled EM square in pixels,      */\n  /*                    hence the term `ppem' (pixels per EM).  It is also */\n  /*                    referred to as `nominal height'.                   */\n  /*                                                                       */\n  /*    x_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    horizontal metrics from font units to 26.6         */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    y_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    vertical metrics from font units to 26.6           */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    descender    :: The descender in 26.6 fractional pixels.  See      */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    height       :: The height in 26.6 fractional pixels.  See         */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    max_advance  :: The maximum advance width in 26.6 fractional       */\n  /*                    pixels.  See @FT_FaceRec for the details.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The scaling values, if relevant, are determined first during a     */\n  /*    size changing operation.  The remaining fields are then set by the */\n  /*    driver.  For scalable formats, they are usually set to scaled      */\n  /*    values of the corresponding fields in @FT_FaceRec.                 */\n  /*                                                                       */\n  /*    Note that due to glyph hinting, these values might not be exact    */\n  /*    for certain fonts.  Thus they must be treated as unreliable        */\n  /*    with an error margin of at least one pixel!                        */\n  /*                                                                       */\n  /*    Indeed, the only way to get the exact metrics is to render _all_   */\n  /*    glyphs.  As this would be a definite performance hit, it is up to  */\n  /*    client applications to perform such computations.                  */\n  /*                                                                       */\n  /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */\n  /*                                                                       */\n  typedef struct  FT_Size_Metrics_\n  {\n    FT_UShort  x_ppem;      /* horizontal pixels per EM               */\n    FT_UShort  y_ppem;      /* vertical pixels per EM                 */\n\n    FT_Fixed   x_scale;     /* scaling values used to convert font    */\n    FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */\n\n    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */\n    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */\n    FT_Pos     height;      /* text height in 26.6 frac. pixels       */\n    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */\n\n  } FT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root size class structure.  A size object models a face   */\n  /*    object at a given size.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face    :: Handle to the parent face object.                       */\n  /*                                                                       */\n  /*    generic :: A typeless pointer, which is unused by the FreeType     */\n  /*               library or any of its drivers.  It can be used by       */\n  /*               client applications to link their own data to each size */\n  /*               object.                                                 */\n  /*                                                                       */\n  /*    metrics :: Metrics for this size object.  This field is read-only. */\n  /*                                                                       */\n  typedef struct  FT_SizeRec_\n  {\n    FT_Face           face;      /* parent face object              */\n    FT_Generic        generic;   /* generic pointer for client uses */\n    FT_Size_Metrics   metrics;   /* size metrics                    */\n    FT_Size_Internal  internal;\n\n  } FT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The subglyph structure is an internal object used to describe      */\n  /*    subglyphs (for example, in the case of composites).                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The subglyph implementation is not part of the high-level API,     */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  /*    You can however retrieve subglyph information with                 */\n  /*    @FT_Get_SubGlyph_Info.                                             */\n  /*                                                                       */\n  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_GlyphSlot object.                */\n  /*                                                                       */\n  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root glyph slot class structure.  A glyph slot is a       */\n  /*    container where individual glyphs can be loaded, be they in        */\n  /*    outline or bitmap format.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library           :: A handle to the FreeType library instance     */\n  /*                         this slot belongs to.                         */\n  /*                                                                       */\n  /*    face              :: A handle to the parent face object.           */\n  /*                                                                       */\n  /*    next              :: In some cases (like some font tools), several */\n  /*                         glyph slots per face object can be a good     */\n  /*                         thing.  As this is rare, the glyph slots are  */\n  /*                         listed through a direct, single-linked list   */\n  /*                         using its `next' field.                       */\n  /*                                                                       */\n  /*    generic           :: A typeless pointer which is unused by the     */\n  /*                         FreeType library or any of its drivers.  It   */\n  /*                         can be used by client applications to link    */\n  /*                         their own data to each glyph slot object.     */\n  /*                                                                       */\n  /*    metrics           :: The metrics of the last loaded glyph in the   */\n  /*                         slot.  The returned values depend on the last */\n  /*                         load flags (see the @FT_Load_Glyph API        */\n  /*                         function) and can be expressed either in 26.6 */\n  /*                         fractional pixels or font units.              */\n  /*                                                                       */\n  /*                         Note that even when the glyph image is        */\n  /*                         transformed, the metrics are not.             */\n  /*                                                                       */\n  /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    linearVertAdvance :: The advance height of the unhinted glyph.     */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    advance           :: This shorthand is, depending on               */\n  /*                         @FT_LOAD_IGNORE_TRANSFORM, the transformed    */\n  /*                         advance width for the glyph (in 26.6          */\n  /*                         fractional pixel format).  As specified with  */\n  /*                         @FT_LOAD_VERTICAL_LAYOUT, it uses either the  */\n  /*                         `horiAdvance' or the `vertAdvance' value of   */\n  /*                         `metrics' field.                              */\n  /*                                                                       */\n  /*    format            :: This field indicates the format of the image  */\n  /*                         contained in the glyph slot.  Typically       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP,                      */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */\n  /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */\n  /*                         possible.                                     */\n  /*                                                                       */\n  /*    bitmap            :: This field is used as a bitmap descriptor     */\n  /*                         when the slot format is                       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */\n  /*                         address and content of the bitmap buffer can  */\n  /*                         change between calls of @FT_Load_Glyph and a  */\n  /*                         few other functions.                          */\n  /*                                                                       */\n  /*    bitmap_left       :: This is the bitmap's left bearing expressed   */\n  /*                         in integer pixels.  Of course, this is only   */\n  /*                         valid if the format is                        */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.                      */\n  /*                                                                       */\n  /*    bitmap_top        :: This is the bitmap's top bearing expressed in */\n  /*                         integer pixels.  Remember that this is the    */\n  /*                         distance from the baseline to the top-most    */\n  /*                         glyph scanline, upwards y~coordinates being   */\n  /*                         *positive*.                                   */\n  /*                                                                       */\n  /*    outline           :: The outline descriptor for the current glyph  */\n  /*                         image if its format is                        */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */\n  /*                         loaded, `outline' can be transformed,         */\n  /*                         distorted, embolded, etc.  However, it must   */\n  /*                         not be freed.                                 */\n  /*                                                                       */\n  /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */\n  /*                         This field is only valid for the composite    */\n  /*                         glyph format that should normally only be     */\n  /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */\n  /*                         For now this is internal to FreeType.         */\n  /*                                                                       */\n  /*    subglyphs         :: An array of subglyph descriptors for          */\n  /*                         composite glyphs.  There are `num_subglyphs'  */\n  /*                         elements in there.  Currently internal to     */\n  /*                         FreeType.                                     */\n  /*                                                                       */\n  /*    control_data      :: Certain font drivers can also return the      */\n  /*                         control data for a given glyph image (e.g.    */\n  /*                         TrueType bytecode, Type~1 charstrings, etc.). */\n  /*                         This field is a pointer to such data.         */\n  /*                                                                       */\n  /*    control_len       :: This is the length in bytes of the control    */\n  /*                         data.                                         */\n  /*                                                                       */\n  /*    other             :: Really wicked formats can use this pointer to */\n  /*                         present their own glyph image to client       */\n  /*                         applications.  Note that the application      */\n  /*                         needs to know about the image format.         */\n  /*                                                                       */\n  /*    lsb_delta         :: The difference between hinted and unhinted    */\n  /*                         left side bearing while autohinting is        */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /*    rsb_delta         :: The difference between hinted and unhinted    */\n  /*                         right side bearing while autohinting is       */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If @FT_Load_Glyph is called with default flags (see                */\n  /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */\n  /*    its native format (e.g., an outline glyph for TrueType and Type~1  */\n  /*    formats).                                                          */\n  /*                                                                       */\n  /*    This image can later be converted into a bitmap by calling         */\n  /*    @FT_Render_Glyph.  This function finds the current renderer for    */\n  /*    the native image's format, then invokes it.                        */\n  /*                                                                       */\n  /*    The renderer is in charge of transforming the native image through */\n  /*    the slot's face transformation fields, then converting it into a   */\n  /*    bitmap that is returned in `slot->bitmap'.                         */\n  /*                                                                       */\n  /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */\n  /*    to specify the position of the bitmap relative to the current pen  */\n  /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */\n  /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Here a small pseudo code fragment which shows how to use           */\n  /*    `lsb_delta' and `rsb_delta':                                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Pos  origin_x       = 0;                                      */\n  /*      FT_Pos  prev_rsb_delta = 0;                                      */\n  /*                                                                       */\n  /*                                                                       */\n  /*      for all glyphs do                                                */\n  /*        <compute kern between current and previous glyph and add it to */\n  /*         `origin_x'>                                                   */\n  /*                                                                       */\n  /*        <load glyph with `FT_Load_Glyph'>                              */\n  /*                                                                       */\n  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */\n  /*          origin_x -= 64;                                              */\n  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */\n  /*          origin_x += 64;                                              */\n  /*                                                                       */\n  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */\n  /*                                                                       */\n  /*        <save glyph image, or render glyph, or ...>                    */\n  /*                                                                       */\n  /*        origin_x += face->glyph->advance.x;                            */\n  /*      endfor                                                           */\n  /*    }                                                                  */\n  /*                                                                       */\n  typedef struct  FT_GlyphSlotRec_\n  {\n    FT_Library        library;\n    FT_Face           face;\n    FT_GlyphSlot      next;\n    FT_UInt           reserved;       /* retained for binary compatibility */\n    FT_Generic        generic;\n\n    FT_Glyph_Metrics  metrics;\n    FT_Fixed          linearHoriAdvance;\n    FT_Fixed          linearVertAdvance;\n    FT_Vector         advance;\n\n    FT_Glyph_Format   format;\n\n    FT_Bitmap         bitmap;\n    FT_Int            bitmap_left;\n    FT_Int            bitmap_top;\n\n    FT_Outline        outline;\n\n    FT_UInt           num_subglyphs;\n    FT_SubGlyph       subglyphs;\n\n    void*             control_data;\n    long              control_len;\n\n    FT_Pos            lsb_delta;\n    FT_Pos            rsb_delta;\n\n    void*             other;\n\n    FT_Slot_Internal  internal;\n\n  } FT_GlyphSlotRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         F U N C T I O N S                             */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Init_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new FreeType library object.  The set of modules      */\n  /*    that are registered by this function is determined at build time.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A handle to a new library object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case you want to provide your own memory allocating routines,   */\n  /*    use @FT_New_Library instead, followed by a call to                 */\n  /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */\n  /*                                                                       */\n  /*    For multi-threading applications each thread should have its own   */\n  /*    FT_Library object.                                                 */\n  /*                                                                       */\n  /*    If you need reference-counting (cf. @FT_Reference_Library), use    */\n  /*    @FT_New_Library and @FT_Done_Library.                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given FreeType library object and all of its children,   */\n  /*    including resources, drivers, faces, sizes, etc.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library object.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_FreeType( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OPEN_XXX                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants used within the `flags' field of the */\n  /*    @FT_Open_Args structure.                                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OPEN_MEMORY   :: This is a memory-based stream.                 */\n  /*                                                                       */\n  /*    FT_OPEN_STREAM   :: Copy the stream from the `stream' field.       */\n  /*                                                                       */\n  /*    FT_OPEN_PATHNAME :: Create a new input stream from a C~path        */\n  /*                        name.                                          */\n  /*                                                                       */\n  /*    FT_OPEN_DRIVER   :: Use the `driver' field.                        */\n  /*                                                                       */\n  /*    FT_OPEN_PARAMS   :: Use the `num_params' and `params' fields.      */\n  /*                                                                       */\n  /*    ft_open_memory   :: Deprecated; use @FT_OPEN_MEMORY instead.       */\n  /*                                                                       */\n  /*    ft_open_stream   :: Deprecated; use @FT_OPEN_STREAM instead.       */\n  /*                                                                       */\n  /*    ft_open_pathname :: Deprecated; use @FT_OPEN_PATHNAME instead.     */\n  /*                                                                       */\n  /*    ft_open_driver   :: Deprecated; use @FT_OPEN_DRIVER instead.       */\n  /*                                                                       */\n  /*    ft_open_params   :: Deprecated; use @FT_OPEN_PARAMS instead.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */\n  /*    flags are mutually exclusive.                                      */\n  /*                                                                       */\n#define FT_OPEN_MEMORY    0x1\n#define FT_OPEN_STREAM    0x2\n#define FT_OPEN_PATHNAME  0x4\n#define FT_OPEN_DRIVER    0x8\n#define FT_OPEN_PARAMS    0x10\n\n#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */\n#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */\n#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */\n#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */\n#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Parameter                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to pass more or less generic parameters to */\n  /*    @FT_Open_Face.                                                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag  :: A four-byte identification tag.                            */\n  /*                                                                       */\n  /*    data :: A pointer to the parameter data.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The ID and function of parameters are driver-specific.  See the    */\n  /*    various FT_PARAM_TAG_XXX flags for more information.               */\n  /*                                                                       */\n  typedef struct  FT_Parameter_\n  {\n    FT_ULong    tag;\n    FT_Pointer  data;\n\n  } FT_Parameter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Open_Args                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to indicate how to open a new font file or        */\n  /*    stream.  A pointer to such a structure can be used as a parameter  */\n  /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    flags       :: A set of bit flags indicating how to use the        */\n  /*                   structure.                                          */\n  /*                                                                       */\n  /*    memory_base :: The first byte of the file in memory.               */\n  /*                                                                       */\n  /*    memory_size :: The size in bytes of the file in memory.            */\n  /*                                                                       */\n  /*    pathname    :: A pointer to an 8-bit file pathname.                */\n  /*                                                                       */\n  /*    stream      :: A handle to a source stream object.                 */\n  /*                                                                       */\n  /*    driver      :: This field is exclusively used by @FT_Open_Face;    */\n  /*                   it simply specifies the font driver to use to open  */\n  /*                   the face.  If set to~0, FreeType tries to load the  */\n  /*                   face with each one of the drivers in its list.      */\n  /*                                                                       */\n  /*    num_params  :: The number of extra parameters.                     */\n  /*                                                                       */\n  /*    params      :: Extra parameters passed to the font driver when     */\n  /*                   opening a new face.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream type is determined by the contents of `flags' which     */\n  /*    are tested in the following order by @FT_Open_Face:                */\n  /*                                                                       */\n  /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */\n  /*    memory file of `memory_size' bytes, located at `memory_address'.   */\n  /*    The data are are not copied, and the client is responsible for     */\n  /*    releasing and destroying them _after_ the corresponding call to    */\n  /*    @FT_Done_Face.                                                     */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */\n  /*    custom input stream `stream' is used.                              */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this  */\n  /*    is a normal file and use `pathname' to open it.                    */\n  /*                                                                       */\n  /*    If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to    */\n  /*    open the file with the driver whose handler is in `driver'.        */\n  /*                                                                       */\n  /*    If the `FT_OPEN_PARAMS' bit is set, the parameters given by        */\n  /*    `num_params' and `params' is used.  They are ignored otherwise.    */\n  /*                                                                       */\n  /*    Ideally, both the `pathname' and `params' fields should be tagged  */\n  /*    as `const'; this is missing for API backwards compatibility.  In   */\n  /*    other words, applications should treat them as read-only.          */\n  /*                                                                       */\n  typedef struct  FT_Open_Args_\n  {\n    FT_UInt         flags;\n    const FT_Byte*  memory_base;\n    FT_Long         memory_size;\n    FT_String*      pathname;\n    FT_Stream       stream;\n    FT_Module       driver;\n    FT_Int          num_params;\n    FT_Parameter*   params;\n\n  } FT_Open_Args;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font by its pathname.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pathname   :: A path to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Done_Face to destroy the created @FT_Face object (along    */\n  /*    with its slot and sizes).                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  filepathname,\n               FT_Long      face_index,\n               FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory_Face                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font which has been    */\n  /*    loaded into memory.                                                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    file_base  :: A pointer to the beginning of the font data.         */\n  /*                                                                       */\n  /*    file_size  :: The size of the memory chunk used by the font data.  */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You must not deallocate the memory before calling @FT_Done_Face.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Open_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a face object from a given resource described by            */\n  /*    @FT_Open_Args.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    args       :: A pointer to an `FT_Open_Args' structure which must  */\n  /*                  be filled by the caller.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See note below.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Unlike FreeType 1.x, this function automatically creates a glyph   */\n  /*    slot for the face object which can be accessed directly through    */\n  /*    `face->glyph'.                                                     */\n  /*                                                                       */\n  /*    FT_Open_Face can be used to quickly check whether the font         */\n  /*    format of a given font resource is supported by FreeType.  If the  */\n  /*    `face_index' field is negative, the function's return value is~0   */\n  /*    if the font format is recognized, or non-zero otherwise;           */\n  /*    the function returns a more or less empty face handle in `*aface'  */\n  /*    (if `aface' isn't NULL).  The only useful field in this special    */\n  /*    case is `face->num_faces' which gives the number of faces within   */\n  /*    the font file.  After examination, the returned @FT_Face structure */\n  /*    should be deallocated with a call to @FT_Done_Face.                */\n  /*                                                                       */\n  /*    Each new face object created with this function also owns a        */\n  /*    default @FT_Size object, accessible as `face->size'.               */\n  /*                                                                       */\n  /*    One @FT_Library instance can have multiple face objects, this is,  */\n  /*    @FT_Open_Face and its siblings can be called multiple times using  */\n  /*    the same `library' argument.                                       */\n  /*                                                                       */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_File                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Attach_Stream to attach a file.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: The target face object.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    filepathname :: The pathname.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    `Attach' data to a face object.  Normally, this is used to read    */\n  /*    additional information for the face object.  For example, you can  */\n  /*    attach an AFM file that comes with a Type~1 font to get the        */\n  /*    kerning values and other metrics.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The target face object.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    parameters :: A pointer to @FT_Open_Args which must be filled by   */\n  /*                  the caller.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The meaning of the `attach' (i.e., what really happens when the    */\n  /*    new file is read) is not fixed by FreeType itself.  It really      */\n  /*    depends on the font format (and thus the font driver).             */\n  /*                                                                       */\n  /*    Client applications are expected to know what they are doing       */\n  /*    when invoking this function.  Most drivers simply do not implement */\n  /*    file attachments.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Face                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Face structure  */\n  /*    is created.  This function increments the counter.  @FT_Done_Face  */\n  /*    then only destroys a face if the counter is~1, otherwise it simply */\n  /*    decrements the counter.                                            */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Face objects.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given face object, as well as all of its child slots and */\n  /*    sizes.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a bitmap strike.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to a target face object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strike_index :: The index of the bitmap strike in the              */\n  /*                    `available_sizes' field of @FT_FaceRec structure.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Size_Request_Type                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the supported size request types.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SIZE_REQUEST_TYPE_NOMINAL ::                                    */\n  /*      The nominal size.  The `units_per_EM' field of @FT_FaceRec is    */\n  /*      used to determine both scaling values.                           */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */\n  /*      The real dimension.  The sum of the the `ascender' and (minus    */\n  /*      of) the `descender' fields of @FT_FaceRec are used to determine  */\n  /*      both scaling values.                                             */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */\n  /*      The font bounding box.  The width and height of the `bbox' field */\n  /*      of @FT_FaceRec are used to determine the horizontal and vertical */\n  /*      scaling value, respectively.                                     */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_CELL ::                                       */\n  /*      The `max_advance_width' field of @FT_FaceRec is used to          */\n  /*      determine the horizontal scaling value; the vertical scaling     */\n  /*      value is determined the same way as                              */\n  /*      @FT_SIZE_REQUEST_TYPE_REAL_DIM does.  Finally, both scaling      */\n  /*      values are set to the smaller one.  This type is useful if you   */\n  /*      want to specify the font size for, say, a window of a given      */\n  /*      dimension and 80x24 cells.                                       */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_SCALES ::                                     */\n  /*      Specify the scaling values directly.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The above descriptions only apply to scalable formats.  For bitmap */\n  /*    formats, the behaviour is up to the driver.                        */\n  /*                                                                       */\n  /*    See the note section of @FT_Size_Metrics if you wonder how size    */\n  /*    requesting relates to scaling values.                              */\n  /*                                                                       */\n  typedef enum  FT_Size_Request_Type_\n  {\n    FT_SIZE_REQUEST_TYPE_NOMINAL,\n    FT_SIZE_REQUEST_TYPE_REAL_DIM,\n    FT_SIZE_REQUEST_TYPE_BBOX,\n    FT_SIZE_REQUEST_TYPE_CELL,\n    FT_SIZE_REQUEST_TYPE_SCALES,\n\n    FT_SIZE_REQUEST_TYPE_MAX\n\n  } FT_Size_Request_Type;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_RequestRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a size request.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    type           :: See @FT_Size_Request_Type.                       */\n  /*                                                                       */\n  /*    width          :: The desired width.                               */\n  /*                                                                       */\n  /*    height         :: The desired height.                              */\n  /*                                                                       */\n  /*    horiResolution :: The horizontal resolution.  If set to zero,      */\n  /*                      `width' is treated as a 26.6 fractional pixel    */\n  /*                      value.                                           */\n  /*                                                                       */\n  /*    vertResolution :: The vertical resolution.  If set to zero,        */\n  /*                      `height' is treated as a 26.6 fractional pixel   */\n  /*                      value.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `width' is zero, then the horizontal scaling value is set equal */\n  /*    to the vertical scaling value, and vice versa.                     */\n  /*                                                                       */\n  typedef struct  FT_Size_RequestRec_\n  {\n    FT_Size_Request_Type  type;\n    FT_Long               width;\n    FT_Long               height;\n    FT_UInt               horiResolution;\n    FT_UInt               vertResolution;\n\n  } FT_Size_RequestRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Request                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a size request structure.                              */\n  /*                                                                       */\n  typedef struct FT_Size_RequestRec_  *FT_Size_Request;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Request_Size                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Resize the scale of the active @FT_Size object in a face.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    req  :: A pointer to a @FT_Size_RequestRec.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Although drivers may select the bitmap strike matching the         */\n  /*    request, you should not rely on this if you intend to select a     */\n  /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */\n  /*    case.                                                              */\n  /*                                                                       */\n  /*    The relation between the requested size and the resulting glyph    */\n  /*    size is dependent entirely on how the size is defined in the       */\n  /*    source face.  The font designer chooses the final size of each     */\n  /*    glyph relative to this size.  For more information refer to        */\n  /*    `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Char_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in points).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face            :: A handle to a target face object.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_width      :: The nominal width, in 26.6 fractional points.   */\n  /*                                                                       */\n  /*    char_height     :: The nominal height, in 26.6 fractional points.  */\n  /*                                                                       */\n  /*    horz_resolution :: The horizontal resolution in dpi.               */\n  /*                                                                       */\n  /*    vert_resolution :: The vertical resolution in dpi.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If either the character width or height is zero, it is set equal   */\n  /*    to the other value.                                                */\n  /*                                                                       */\n  /*    If either the horizontal or vertical resolution is zero, it is set */\n  /*    equal to the other value.                                          */\n  /*                                                                       */\n  /*    A character width or height smaller than 1pt is set to 1pt; if     */\n  /*    both resolution values are zero, they are set to 72dpi.            */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in pixels).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to the target face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pixel_width  :: The nominal width, in pixels.                      */\n  /*                                                                       */\n  /*    pixel_height :: The nominal height, in pixels.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should not rely on the resulting glyphs matching, or being     */\n  /*    constrained, to this pixel size.  Refer to @FT_Request_Size to     */\n  /*    understand how requested sizes relate to actual sizes.             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to the target face object where the glyph  */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph_index :: The index of the glyph in the font file.  For       */\n  /*                   CID-keyed fonts (either in PS or in CFF format)     */\n  /*                   this argument specifies the CID value.              */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The loaded glyph may be transformed.  See @FT_Set_Transform for    */\n  /*    the details.                                                       */\n  /*                                                                       */\n  /*    For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is        */\n  /*    returned for invalid CID values (this is, for CID values which     */\n  /*    don't have a corresponding glyph in the font).  See the discussion */\n  /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object, according to its character code.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to a target face object where the glyph    */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_code   :: The glyph's character code, according to the        */\n  /*                   current charmap used in the face.                   */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags );\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_XXX\n   *\n   * @description:\n   *   A list of bit-field constants used with @FT_Load_Glyph to indicate\n   *   what kind of operations to perform during glyph loading.\n   *\n   * @values:\n   *   FT_LOAD_DEFAULT ::\n   *     Corresponding to~0, this value is used as the default glyph load\n   *     operation.  In this case, the following happens:\n   *\n   *     1. FreeType looks for a bitmap for the glyph corresponding to the\n   *        face's current size.  If one is found, the function returns.\n   *        The bitmap data can be accessed from the glyph slot (see note\n   *        below).\n   *\n   *     2. If no embedded bitmap is searched or found, FreeType looks for a\n   *        scalable outline.  If one is found, it is loaded from the font\n   *        file, scaled to device pixels, then `hinted' to the pixel grid\n   *        in order to optimize it.  The outline data can be accessed from\n   *        the glyph slot (see note below).\n   *\n   *     Note that by default, the glyph loader doesn't render outlines into\n   *     bitmaps.  The following flags are used to modify this default\n   *     behaviour to more specific and useful cases.\n   *\n   *   FT_LOAD_NO_SCALE ::\n   *     Don't scale the loaded outline glyph but keep it in font units.\n   *\n   *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and\n   *     unsets @FT_LOAD_RENDER.\n   *\n   *     If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using\n   *     FT_LOAD_NO_SCALE usually yields meaningless outlines because the\n   *     subglyphs must be scaled and positioned with hinting instructions.\n   *     This can be solved by loading the font without FT_LOAD_NO_SCALE and\n   *     setting the character size to `font->units_per_EM'.\n   *\n   *   FT_LOAD_NO_HINTING ::\n   *     Disable hinting.  This generally generates `blurrier' bitmap glyphs\n   *     when the glyph are rendered in any of the anti-aliased modes.  See\n   *     also the note below.\n   *\n   *     This flag is implied by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_RENDER ::\n   *     Call @FT_Render_Glyph after the glyph is loaded.  By default, the\n   *     glyph is rendered in @FT_RENDER_MODE_NORMAL mode.  This can be\n   *     overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.\n   *\n   *     This flag is unset by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_NO_BITMAP ::\n   *     Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this\n   *     flag.\n   *\n   *     @FT_LOAD_NO_SCALE always sets this flag.\n   *\n   *   FT_LOAD_VERTICAL_LAYOUT ::\n   *     Load the glyph for vertical text layout.  In particular, the\n   *     `advance' value in the @FT_GlyphSlotRec structure is set to the\n   *     `vertAdvance' value of the `metrics' field.\n   *\n   *     In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use\n   *     this flag currently.  Reason is that in this case vertical metrics\n   *     get synthesized, and those values are not always consistent across\n   *     various font formats.\n   *\n   *   FT_LOAD_FORCE_AUTOHINT ::\n   *     Indicates that the auto-hinter is preferred over the font's native\n   *     hinter.  See also the note below.\n   *\n   *   FT_LOAD_CROP_BITMAP ::\n   *     Indicates that the font driver should crop the loaded bitmap glyph\n   *     (i.e., remove all space around its black bits).  Not all drivers\n   *     implement this.\n   *\n   *   FT_LOAD_PEDANTIC ::\n   *     Indicates that the font driver should perform pedantic verifications\n   *     during glyph loading.  This is mostly used to detect broken glyphs\n   *     in fonts.  By default, FreeType tries to handle broken fonts also.\n   *\n   *     In particular, errors from the TrueType bytecode engine are not\n   *     passed to the application if this flag is not set; this might\n   *     result in partially hinted or distorted glyphs in case a glyph's\n   *     bytecode is buggy.\n   *\n   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::\n   *     Ignored.  Deprecated.\n   *\n   *   FT_LOAD_NO_RECURSE ::\n   *     This flag is only used internally.  It merely indicates that the\n   *     font driver should not load composite glyphs recursively.  Instead,\n   *     it should set the `num_subglyph' and `subglyphs' values of the\n   *     glyph slot accordingly, and set `glyph->format' to\n   *     @FT_GLYPH_FORMAT_COMPOSITE.\n   *\n   *     The description of sub-glyphs is not available to client\n   *     applications for now.\n   *\n   *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.\n   *\n   *   FT_LOAD_IGNORE_TRANSFORM ::\n   *     Indicates that the transform matrix set by @FT_Set_Transform should\n   *     be ignored.\n   *\n   *   FT_LOAD_MONOCHROME ::\n   *     This flag is used with @FT_LOAD_RENDER to indicate that you want to\n   *     render an outline glyph to a 1-bit monochrome bitmap glyph, with\n   *     8~pixels packed into each byte of the bitmap data.\n   *\n   *     Note that this has no effect on the hinting algorithm used.  You\n   *     should rather use @FT_LOAD_TARGET_MONO so that the\n   *     monochrome-optimized hinting algorithm is used.\n   *\n   *   FT_LOAD_LINEAR_DESIGN ::\n   *     Indicates that the `linearHoriAdvance' and `linearVertAdvance'\n   *     fields of @FT_GlyphSlotRec should be kept in font units.  See\n   *     @FT_GlyphSlotRec for details.\n   *\n   *   FT_LOAD_NO_AUTOHINT ::\n   *     Disable auto-hinter.  See also the note below.\n   *\n   *   FT_LOAD_COLOR ::\n   *     This flag is used to request loading of color embedded-bitmap\n   *     images.  The resulting color bitmaps, if available, will have the\n   *     @FT_PIXEL_MODE_BGRA format.  When the flag is not used and color\n   *     bitmaps are found, they will be converted to 256-level gray\n   *     bitmaps transparently.  Those bitmaps will be in the\n   *     @FT_PIXEL_MODE_GRAY format.\n   *\n   * @note:\n   *   By default, hinting is enabled and the font's native hinter (see\n   *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can\n   *   disable hinting by setting @FT_LOAD_NO_HINTING or change the\n   *   precedence by setting @FT_LOAD_FORCE_AUTOHINT.  You can also set\n   *   @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be\n   *   used at all.\n   *\n   *   See the description of @FT_FACE_FLAG_TRICKY for a special exception\n   *   (affecting only a handful of Asian fonts).\n   *\n   *   Besides deciding which hinter to use, you can also decide which\n   *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.\n   *\n   *   Note that the auto-hinter needs a valid Unicode cmap (either a native\n   *   one or synthesized by FreeType) for producing correct results.  If a\n   *   font provides an incorrect mapping (for example, assigning the\n   *   character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a\n   *   mathematical integral sign), the auto-hinter might produce useless\n   *   results.\n   *\n   */\n#define FT_LOAD_DEFAULT                      0x0\n#define FT_LOAD_NO_SCALE                     ( 1L << 0 )\n#define FT_LOAD_NO_HINTING                   ( 1L << 1 )\n#define FT_LOAD_RENDER                       ( 1L << 2 )\n#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )\n#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )\n#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )\n#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )\n#define FT_LOAD_PEDANTIC                     ( 1L << 7 )\n#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )\n#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )\n#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )\n#define FT_LOAD_MONOCHROME                   ( 1L << 12 )\n#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )\n#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )\n  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */\n#define FT_LOAD_COLOR                        ( 1L << 20 )\n\n  /* */\n\n  /* used internally only by certain font drivers! */\n#define FT_LOAD_ADVANCE_ONLY                 ( 1L << 8 )\n#define FT_LOAD_SBITS_ONLY                   ( 1L << 14 )\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_TARGET_XXX\n   *\n   * @description:\n   *   A list of values that are used to select a specific hinting algorithm\n   *   to use by the hinter.  You should OR one of these values to your\n   *   `load_flags' when calling @FT_Load_Glyph.\n   *\n   *   Note that font's native hinters may ignore the hinting algorithm you\n   *   have specified (e.g., the TrueType bytecode interpreter).  You can set\n   *   @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.\n   *\n   *   Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it\n   *   always implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   * @values:\n   *   FT_LOAD_TARGET_NORMAL ::\n   *     This corresponds to the default hinting algorithm, optimized for\n   *     standard gray-level rendering.  For monochrome output, use\n   *     @FT_LOAD_TARGET_MONO instead.\n   *\n   *   FT_LOAD_TARGET_LIGHT ::\n   *     A lighter hinting algorithm for non-monochrome modes.  Many\n   *     generated glyphs are more fuzzy but better resemble its original\n   *     shape.  A bit like rendering on Mac OS~X.\n   *\n   *     As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   *   FT_LOAD_TARGET_MONO ::\n   *     Strong hinting algorithm that should only be used for monochrome\n   *     output.  The result is probably unpleasant if the glyph is rendered\n   *     in non-monochrome modes.\n   *\n   *   FT_LOAD_TARGET_LCD ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally\n   *     decimated LCD displays.\n   *\n   *   FT_LOAD_TARGET_LCD_V ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically\n   *     decimated LCD displays.\n   *\n   * @note:\n   *   You should use only _one_ of the FT_LOAD_TARGET_XXX values in your\n   *   `load_flags'.  They can't be ORed.\n   *\n   *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the\n   *   corresponding mode (i.e., the mode which matches the used algorithm\n   *   best).  An exeption is FT_LOAD_TARGET_MONO since it implies\n   *   @FT_LOAD_MONOCHROME.\n   *\n   *   You can use a hinting algorithm that doesn't correspond to the same\n   *   rendering mode.  As an example, it is possible to use the `light'\n   *   hinting algorithm and have the results rendered in horizontal LCD\n   *   pixel mode, with code like\n   *\n   *     {\n   *       FT_Load_Glyph( face, glyph_index,\n   *                      load_flags | FT_LOAD_TARGET_LIGHT );\n   *\n   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );\n   *     }\n   *\n   */\n#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )\n\n#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )\n#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )\n#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )\n#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )\n#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )\n\n\n  /**************************************************************************\n   *\n   * @macro:\n   *   FT_LOAD_TARGET_MODE\n   *\n   * @description:\n   *   Return the @FT_Render_Mode corresponding to a given\n   *   @FT_LOAD_TARGET_XXX value.\n   *\n   */\n#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Transform                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to set the transformation that is applied to glyph */\n  /*    images when they are loaded into a glyph slot through              */\n  /*    @FT_Load_Glyph.                                                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the transformation's 2x2 matrix.  Use~0 for */\n  /*              the identity matrix.                                     */\n  /*    delta  :: A pointer to the translation vector.  Use~0 for the null */\n  /*              vector.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The transformation is only applied to scalable image formats after */\n  /*    the glyph has been loaded.  It means that hinting is unaltered by  */\n  /*    the transformation and is performed on the character size given in */\n  /*    the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes.         */\n  /*                                                                       */\n  /*    Note that this also transforms the `face.glyph.advance' field, but */\n  /*    *not* the values in `face.glyph.metrics'.                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Render_Mode                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the render modes supported by       */\n  /*    FreeType~2.  Each mode corresponds to a specific type of scanline  */\n  /*    conversion performed on the outline.                               */\n  /*                                                                       */\n  /*    For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode'     */\n  /*    field in the @FT_GlyphSlotRec structure gives the format of the    */\n  /*    returned bitmap.                                                   */\n  /*                                                                       */\n  /*    All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RENDER_MODE_NORMAL ::                                           */\n  /*      This is the default render mode; it corresponds to 8-bit         */\n  /*      anti-aliased bitmaps.                                            */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LIGHT ::                                            */\n  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */\n  /*      defined as a separate value because render modes are also used   */\n  /*      indirectly to define hinting algorithm selectors.  See           */\n  /*      @FT_LOAD_TARGET_XXX for details.                                 */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_MONO ::                                             */\n  /*      This mode corresponds to 1-bit bitmaps (with 2~levels of         */\n  /*      opacity).                                                        */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD ::                                              */\n  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */\n  /*      displays like LCD screens.  It produces 8-bit bitmaps that are   */\n  /*      3~times the width of the original glyph outline in pixels, and   */\n  /*      which use the @FT_PIXEL_MODE_LCD mode.                           */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD_V ::                                            */\n  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */\n  /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */\n  /*      8-bit bitmaps that are 3~times the height of the original        */\n  /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */\n  /*    filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */\n  /*    (not active in the default builds).  It is up to the caller to     */\n  /*    either call @FT_Library_SetLcdFilter (if available) or do the      */\n  /*    filtering itself.                                                  */\n  /*                                                                       */\n  /*    The selected render mode only affects vector glyphs of a font.     */\n  /*    Embedded bitmaps often have a different pixel mode like            */\n  /*    @FT_PIXEL_MODE_MONO.  You can use @FT_Bitmap_Convert to transform  */\n  /*    them into 8-bit pixmaps.                                           */\n  /*                                                                       */\n  typedef enum  FT_Render_Mode_\n  {\n    FT_RENDER_MODE_NORMAL = 0,\n    FT_RENDER_MODE_LIGHT,\n    FT_RENDER_MODE_MONO,\n    FT_RENDER_MODE_LCD,\n    FT_RENDER_MODE_LCD_V,\n\n    FT_RENDER_MODE_MAX\n\n  } FT_Render_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_render_mode_xxx                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Render_Mode values instead.                                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL                */\n  /*    ft_render_mode_mono   :: see @FT_RENDER_MODE_MONO                  */\n  /*                                                                       */\n#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL\n#define ft_render_mode_mono    FT_RENDER_MODE_MONO\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Render_Glyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph image to a bitmap.  It does so by inspecting */\n  /*    the glyph image format, finding the relevant renderer, and         */\n  /*    invoking it.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot        :: A handle to the glyph slot containing the image to  */\n  /*                   convert.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: This is the render mode used to render the glyph    */\n  /*                   image into a bitmap.  See @FT_Render_Mode for a     */\n  /*                   list of possible values.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Kerning_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify which kerning values to return in   */\n  /*    @FT_Get_Kerning.                                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_KERNING_DEFAULT  :: Return scaled and grid-fitted kerning       */\n  /*                           distances (value is~0).                     */\n  /*                                                                       */\n  /*    FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning    */\n  /*                           distances.                                  */\n  /*                                                                       */\n  /*    FT_KERNING_UNSCALED :: Return the kerning vector in original font  */\n  /*                           units.                                      */\n  /*                                                                       */\n  typedef enum  FT_Kerning_Mode_\n  {\n    FT_KERNING_DEFAULT  = 0,\n    FT_KERNING_UNFITTED,\n    FT_KERNING_UNSCALED\n\n  } FT_Kerning_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_default                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_DEFAULT       */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_default   FT_KERNING_DEFAULT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unfitted                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNFITTED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unfitted  FT_KERNING_UNFITTED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unscaled                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNSCALED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unscaled  FT_KERNING_UNSCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the kerning vector between two glyphs of a same face.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /*    kern_mode   :: See @FT_Kerning_Mode for more information.          */\n  /*                   Determines the scale and dimension of the returned  */\n  /*                   kerning vector.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning vector.  This is either in font units   */\n  /*                   or in pixels (26.6 format) for scalable formats,    */\n  /*                   and in pixels for fixed-sizes formats.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this method.  Other layouts, or more sophisticated    */\n  /*    kernings, are out of the scope of this API function -- they can be */\n  /*    implemented through format-specific interfaces.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Track_Kerning                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the track kerning for a given face object at a given size.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to a source face object.                    */\n  /*                                                                       */\n  /*    point_size :: The point size in 16.16 fractional points.           */\n  /*                                                                       */\n  /*    degree     :: The degree of tightness.  Increasingly negative      */\n  /*                  values represent tighter track kerning, while        */\n  /*                  increasingly positive values represent looser track  */\n  /*                  kerning.  Value zero means no track kerning.         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning   :: The kerning in 16.16 fractional points, to be        */\n  /*                  uniformly applied between all glyphs.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, only the Type~1 font driver supports track kerning,     */\n  /*    using data from AFM files (if attached with @FT_Attach_File or     */\n  /*    @FT_Attach_Stream).                                                */\n  /*                                                                       */\n  /*    Only very few AFM files come with track kerning data; please refer */\n  /*    to the Adobe's AFM specification for more details.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII name of a given glyph in a face.  This only     */\n  /*    works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    buffer_max  :: The maximum number of bytes available in the        */\n  /*                   buffer.                                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer      :: A pointer to a target buffer where the name is      */\n  /*                   copied to.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error is returned if the face doesn't provide glyph names or if */\n  /*    the glyph index is invalid.  In all cases of failure, the first    */\n  /*    byte of `buffer' is set to~0 to indicate an empty name.            */\n  /*                                                                       */\n  /*    The glyph name is truncated to fit within the buffer if it is too  */\n  /*    long.  The returned string is always zero-terminated.              */\n  /*                                                                       */\n  /*    Be aware that FreeType reorders glyph indices internally so that   */\n  /*    glyph index~0 always corresponds to the `missing glyph' (called    */\n  /*    `.notdef').                                                        */\n  /*                                                                       */\n  /*    This function is not compiled within the library if the config     */\n  /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */\n  /*    `include/freetype/config/ftoptions.h'.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII PostScript name of a given face, if available.  */\n  /*    This only works with PostScript and TrueType fonts.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the face's PostScript name.  NULL if unavailable.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned pointer is owned by the face and is destroyed with    */\n  /*    it.                                                                */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_Postscript_Name( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Charmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap by its encoding tag (as listed in           */\n  /*    `freetype.h').                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    encoding :: A handle to the selected encoding.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if no charmap in the face           */\n  /*    corresponds to the encoding queried here.                          */\n  /*                                                                       */\n  /*    Because many fonts contain more than a single cmap for Unicode     */\n  /*    encoding, this function has some special code to select the one    */\n  /*    which covers Unicode best (`best' in the sense that a UCS-4 cmap   */\n  /*    is preferred to a UCS-2 cmap).  It is thus preferable to           */\n  /*    @FT_Set_Charmap in this case.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Charmap                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap for character code to glyph index mapping.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap :: A handle to the selected charmap.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if the charmap is not part of       */\n  /*    the face (i.e., if it is not listed in the `face->charmaps'        */\n  /*    table).                                                            */\n  /*                                                                       */\n  /*    It also fails if a type~14 charmap is selected.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Get_Charmap_Index\n   *\n   * @description:\n   *   Retrieve index of a given charmap.\n   *\n   * @input:\n   *   charmap ::\n   *     A handle to a charmap.\n   *\n   * @return:\n   *   The index into the array of character maps within the face to which\n   *   `charmap' belongs.  If an error occurs, -1 is returned.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Char_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code.  This function   */\n  /*    uses a charmap object to do the mapping.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /*    charcode :: The character code.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within the  */\n  /*    file.  This is done to ensure that value~0 always corresponds to   */\n  /*    the `missing glyph'.  If the first glyph is not named `.notdef',   */\n  /*    then for Type~1 and Type~42 fonts, `.notdef' will be moved into    */\n  /*    the glyph ID~0 position, and whatever was there will be moved to   */\n  /*    the position `.notdef' had.  For Type~1 fonts, if there is no      */\n  /*    `.notdef' glyph at all, then one will be created at index~0 and    */\n  /*    whatever was there will be moved to the last index -- Type~42      */\n  /*    fonts are considered invalid under this condition.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_First_Char                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the first character code in the    */\n  /*    current charmap of a given face.  It also returns the              */\n  /*    corresponding glyph index.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex :: Glyph index of first character code.  0~if charmap is   */\n  /*               empty.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's first character code.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_Next_Char to be able to  */\n  /*    parse all character codes available in a given charmap.  The code  */\n  /*    should look like this:                                             */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_ULong  charcode;                                              */\n  /*      FT_UInt   gindex;                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      charcode = FT_Get_First_Char( face, &gindex );                   */\n  /*      while ( gindex != 0 )                                            */\n  /*      {                                                                */\n  /*        ... do something with (charcode,gindex) pair ...               */\n  /*                                                                       */\n  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */\n  /*      }                                                                */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 if the charmap is empty.  The     */\n  /*    result itself can be~0 in two cases: if the charmap is empty or    */\n  /*    if the value~0 is the first valid character code.                  */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Next_Char                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the next character code in the     */\n  /*    current charmap of a given face following the value `char_code',   */\n  /*    as well as the corresponding glyph index.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: A handle to the source face object.                   */\n  /*    char_code :: The starting character code.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex   :: Glyph index of next character code.  0~if charmap     */\n  /*                 is empty.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's next character code.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_First_Char to walk       */\n  /*    over all character codes available in a given charmap.  See the    */\n  /*    note for this function for a simple code example.                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 when there are no more codes in   */\n  /*    the charmap.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_Next_Char( FT_Face    face,\n                    FT_ULong   char_code,\n                    FT_UInt   *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Name_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given glyph name.  This function uses  */\n  /*    driver specific objects to do the translation.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the source face object.                  */\n  /*                                                                       */\n  /*    glyph_name :: The glyph name.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name );\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SUBGLYPH_FLAG_XXX\n   *\n   * @description:\n   *   A list of constants used to describe subglyphs.  Please refer to the\n   *   TrueType specification for the meaning of the various flags.\n   *\n   * @values:\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::\n   *   FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::\n   *   FT_SUBGLYPH_FLAG_SCALE ::\n   *   FT_SUBGLYPH_FLAG_XY_SCALE ::\n   *   FT_SUBGLYPH_FLAG_2X2 ::\n   *   FT_SUBGLYPH_FLAG_USE_MY_METRICS ::\n   *\n   */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_SubGlyph_Info\n   *\n   * @description:\n   *   Retrieve a description of a given subglyph.  Only use it if\n   *   `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is\n   *   returned otherwise.\n   *\n   * @input:\n   *   glyph ::\n   *     The source glyph slot.\n   *\n   *   sub_index ::\n   *     The index of the subglyph.  Must be less than\n   *     `glyph->num_subglyphs'.\n   *\n   * @output:\n   *   p_index ::\n   *     The glyph index of the subglyph.\n   *\n   *   p_flags ::\n   *     The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.\n   *\n   *   p_arg1 ::\n   *     The subglyph's first argument (if any).\n   *\n   *   p_arg2 ::\n   *     The subglyph's second argument (if any).\n   *\n   *   p_transform ::\n   *     The subglyph transformation (if any).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The values of `*p_arg1', `*p_arg2', and `*p_transform' must be\n   *   interpreted depending on the flags returned in `*p_flags'.  See the\n   *   TrueType specification for details.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FSTYPE_XXX                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `fsType' field of the OS/2 table   */\n  /*    in a TrueType or OpenType font and the `FSType' entry in a         */\n  /*    PostScript font.  These bit flags are returned by                  */\n  /*    @FT_Get_FSType_Flags; they inform client applications of embedding */\n  /*    and subsetting restrictions associated with a font.                */\n  /*                                                                       */\n  /*    See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for  */\n  /*    more details.                                                      */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING ::                                 */\n  /*      Fonts with no fsType bit set may be embedded and permanently     */\n  /*      installed on the remote system by an application.                */\n  /*                                                                       */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING ::                          */\n  /*      Fonts that have only this bit set must not be modified, embedded */\n  /*      or exchanged in any manner without first obtaining permission of */\n  /*      the font software copyright owner.                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING ::                           */\n  /*      If this bit is set, the font may be embedded and temporarily     */\n  /*      loaded on the remote system.  Documents containing Preview &     */\n  /*      Print fonts must be opened `read-only'; no edits can be applied  */\n  /*      to the document.                                                 */\n  /*                                                                       */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING ::                                    */\n  /*      If this bit is set, the font may be embedded but must only be    */\n  /*      installed temporarily on other systems.  In contrast to Preview  */\n  /*      & Print fonts, documents containing editable fonts may be opened */\n  /*      for reading, editing is permitted, and changes may be saved.     */\n  /*                                                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING ::                                         */\n  /*      If this bit is set, the font may not be subsetted prior to       */\n  /*      embedding.                                                       */\n  /*                                                                       */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY ::                                 */\n  /*      If this bit is set, only bitmaps contained in the font may be    */\n  /*      embedded; no outline data may be embedded.  If there are no      */\n  /*      bitmaps available in the font, then the font is unembeddable.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    While the fsType flags can indicate that a font may be embedded, a */\n  /*    license with the font vendor may be separately required to use the */\n  /*    font in this way.                                                  */\n  /*                                                                       */\n#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000\n#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002\n#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004\n#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008\n#define FT_FSTYPE_NO_SUBSETTING                 0x0100\n#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the fsType flags for a font.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The fsType flags, @FT_FSTYPE_XXX.                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use this function rather than directly reading the `fs_type' field */\n  /*    in the @PS_FontInfoRec structure which is only guaranteed to       */\n  /*    return the correct results for Type~1 fonts.                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.8                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UShort )\n  FT_Get_FSType_Flags( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_variants                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Variants                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 interface to Unicode Ideographic Variation          */\n  /*    Sequences (IVS), using the SFNT cmap format~14.                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Many CJK characters have variant forms.  They are a sort of grey   */\n  /*    area somewhere between being totally irrelevant and semantically   */\n  /*    distinct; for this reason, the Unicode consortium decided to       */\n  /*    introduce Ideographic Variation Sequences (IVS), consisting of a   */\n  /*    Unicode base character and one of 240 variant selectors            */\n  /*    (U+E0100-U+E01EF), instead of further extending the already huge   */\n  /*    code range for CJK characters.                                     */\n  /*                                                                       */\n  /*    An IVS is registered and unique; for further details please refer  */\n  /*    to Unicode Technical Standard #37, the Ideographic Variation       */\n  /*    Database:                                                          */\n  /*                                                                       */\n  /*      http://www.unicode.org/reports/tr37/                             */\n  /*                                                                       */\n  /*    To date (November 2012), the character with the most variants is   */\n  /*    U+9089, having 31 such IVS.                                        */\n  /*                                                                       */\n  /*    Adobe and MS decided to support IVS with a new cmap subtable       */\n  /*    (format~14).  It is an odd subtable because it is not a mapping of */\n  /*    input code points to glyphs, but contains lists of all variants    */\n  /*    supported by the font.                                             */\n  /*                                                                       */\n  /*    A variant may be either `default' or `non-default'.  A default     */\n  /*    variant is the one you will get for that code point if you look it */\n  /*    up in the standard Unicode cmap.  A non-default variant is a       */\n  /*    different glyph.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIndex                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code as modified by    */\n  /*    the variation selector.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character code point in Unicode.                             */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode code point of the variation selector.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means either `undefined character code', or    */\n  /*    `undefined selector code', or `no variation selector cmap          */\n  /*    subtable', or `current CharMap is not Unicode'.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value~0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  /*    This function is only meaningful if                                */\n  /*      a) the font has a variation selector cmap sub table,             */\n  /*    and                                                                */\n  /*      b) the current charmap has a Unicode encoding.                   */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Face_GetCharVariantIndex( FT_Face   face,\n                               FT_ULong  charcode,\n                               FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIsDefault                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether this variant of this Unicode character is the one to */\n  /*    be found in the `cmap'.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode codepoint of the variation selector.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if found in the standard (Unicode) cmap, 0~if found in the       */\n  /*    variation selector cmap, or -1 if it is not a variant.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is only meaningful if the font has a variation       */\n  /*    selector cmap subtable.                                            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Int )\n  FT_Face_GetCharVariantIsDefault( FT_Face   face,\n                                   FT_ULong  charcode,\n                                   FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantSelectors                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    in the font.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of selector code points, or NULL if there is */\n  /*    no valid variant selector cmap subtable.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantSelectors( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantsOfChar                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    for the specified character code.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of variant selector code points which are    */\n  /*    active for the given character, or NULL if the corresponding list  */\n  /*    is empty.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantsOfChar( FT_Face   face,\n                             FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharsOfVariant                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode character codes found for */\n  /*    the specified variant selector.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The variant selector code point in Unicode.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A list of all the code points which are specified by this selector */\n  /*    (both default and non-default codes are returned) or NULL if there */\n  /*    is no valid cmap or the variant selector is invalid.               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetCharsOfVariant( FT_Face   face,\n                             FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Computations                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Crunching fixed numbers and vectors.                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various functions used to perform            */\n  /*    computations on 16.16 fixed-float numbers or 2d vectors.           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_MulDiv                                                          */\n  /*    FT_MulFix                                                          */\n  /*    FT_DivFix                                                          */\n  /*    FT_RoundFix                                                        */\n  /*    FT_CeilFix                                                         */\n  /*    FT_FloorFix                                                        */\n  /*    FT_Vector_Transform                                                */\n  /*    FT_Matrix_Multiply                                                 */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    with maximum accuracy (it uses a 64-bit intermediate integer       */\n  /*    whenever necessary).                                               */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c );\n\n\n  /* */\n\n  /* The following #if 0 ... #endif is for the documentation formatter, */\n  /* hiding the internal `FT_MULFIX_INLINED' macro.                     */\n\n#if 0\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*b)/0x10000' with maximum accuracy.  Most of the time this is   */\n  /*    used to multiply a given value by a 16.16 fixed-point factor.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/0x10000'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function has been optimized for the case where the absolute   */\n  /*    value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */\n  /*    As this happens mainly when scaling from notional units to         */\n  /*    fractional pixels in FreeType, it resulted in noticeable speed     */\n  /*    improvements between versions 2.x and 1.x.                         */\n  /*                                                                       */\n  /*    As a conclusion, always try to place a 16.16 factor as the         */\n  /*    _second_ argument of this function; this can make a great          */\n  /*    difference.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n\n  /* */\n#endif\n\n#ifdef FT_MULFIX_INLINED\n#define FT_MulFix( a, b )  FT_MULFIX_INLINED( a, b )\n#else\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_DivFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*0x10000)/b' with maximum accuracy.  Most of the time, this is  */\n  /*    used to divide a given value by a 16.16 fixed-point factor.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*0x10000)/b'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The optimization for FT_DivFix() is simple: If (a~<<~16) fits in   */\n  /*    32~bits, then the division is computed directly.  Otherwise, we    */\n  /*    use a specialized version of @FT_MulDiv.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_RoundFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to round a 16.16 fixed number.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number to be rounded.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x8000) & -0x10000'.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_CeilFix                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the ceiling function of a   */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the ceiling function is to be computed.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FloorFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the floor function of a     */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the floor function is to be computed.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `a & -0x10000'.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Vector_Transform                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a single vector through a 2x2 matrix.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    vector :: The target vector to transform.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the source 2x2 matrix.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `vector' or `matrix' is invalid. */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Vector_Transform( FT_Vector*        vec,\n                       const FT_Matrix*  matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    version                                                            */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType Version                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions and macros related to FreeType versions.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Note that those functions and macros are of limited use because    */\n  /*    even a new release of FreeType with only documentation changes     */\n  /*    increases the version number.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FREETYPE_XXX\n   *\n   * @description:\n   *   These three macros identify the FreeType source code version.\n   *   Use @FT_Library_Version to access them at runtime.\n   *\n   * @values:\n   *   FREETYPE_MAJOR :: The major version number.\n   *   FREETYPE_MINOR :: The minor version number.\n   *   FREETYPE_PATCH :: The patch level.\n   *\n   * @note:\n   *   The version number of FreeType if built as a dynamic link library\n   *   with the `libtool' package is _not_ controlled by these three\n   *   macros.\n   *\n   */\n#define FREETYPE_MAJOR  2\n#define FREETYPE_MINOR  5\n#define FREETYPE_PATCH  0\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the version of the FreeType library being used.  This is    */\n  /*    useful when dynamically linking to the library, since one cannot   */\n  /*    use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and               */\n  /*    @FREETYPE_PATCH.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A source library handle.                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amajor  :: The major version number.                               */\n  /*                                                                       */\n  /*    aminor  :: The minor version number.                               */\n  /*                                                                       */\n  /*    apatch  :: The patch version number.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' argument is because */\n  /*    certain programs implement library initialization in a custom way  */\n  /*    that doesn't use @FT_Init_FreeType.                                */\n  /*                                                                       */\n  /*    In such cases, the library version might not be available before   */\n  /*    the library object has been created.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse all bytecode instructions of a TrueType font file to check   */\n  /*    whether any of the patented opcodes are used.  This is only useful */\n  /*    if you want to be able to use the unpatented hinter with           */\n  /*    fonts that do *not* use these opcodes.                             */\n  /*                                                                       */\n  /*    Note that this function parses *all* glyph instructions in the     */\n  /*    font file, which may be slow.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face handle.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if this is a TrueType font that uses one of the patented         */\n  /*    opcodes, 0~otherwise.                                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Enable or disable the unpatented hinter for a given face.          */\n  /*    Only enable it if you have determined that the face doesn't        */\n  /*    use any patented opcodes (see @FT_Face_CheckTrueTypePatents).      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A face handle.                                            */\n  /*                                                                       */\n  /*    value :: New boolean setting.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The old setting value.  This will always be false if this is not   */\n  /*    an SFNT font, or if the unpatented hinter is not compiled in this  */\n  /*    instance of the library.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FREETYPE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftadvanc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftadvanc.h                                                             */\n/*                                                                         */\n/*    Quick computation of advance widths (specification only).            */\n/*                                                                         */\n/*  Copyright 2008, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTADVANC_H__\n#define __FTADVANC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   quick_advance\n   *\n   * @title:\n   *   Quick retrieval of advance values\n   *\n   * @abstract:\n   *   Retrieve horizontal and vertical advance values without processing\n   *   glyph outlines, if possible.\n   *\n   * @description:\n   *   This section contains functions to quickly extract advance values\n   *   without handling glyph outlines, if possible.\n   */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_ADVANCE_FLAG_FAST_ONLY                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A bit-flag to be OR-ed with the `flags' parameter of the           */\n  /*    @FT_Get_Advance and @FT_Get_Advances functions.                    */\n  /*                                                                       */\n  /*    If set, it indicates that you want these functions to fail if the  */\n  /*    corresponding hinting mode or font driver doesn't allow for very   */\n  /*    quick advance computation.                                         */\n  /*                                                                       */\n  /*    Typically, glyphs which are either unscaled, unhinted, bitmapped,  */\n  /*    or light-hinted can have their advance width computed very         */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /*    Normal and bytecode hinted modes, which require loading, scaling,  */\n  /*    and hinting of the glyph outline, are extremely slow by            */\n  /*    comparison.                                                        */\n  /*                                                                       */\n#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advance                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance value of a given glyph outline in an          */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: The source @FT_Face handle.                          */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /*    load_flags :: A set of bit flags similar to those used when        */\n  /*                  calling @FT_Load_Glyph, used to determine what kind  */\n  /*                  of advances you need.                                */\n  /* <Output>                                                              */\n  /*    padvance :: The advance value.  If scaling is performed (based on  */\n  /*                the value of `load_flags'), the advance value is in    */\n  /*                16.16 format.  Otherwise, it is in font units.         */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */\n  /*                vertical advance corresponding to a vertical layout.   */\n  /*                Otherwise, it is the horizontal advance in a           */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    A scaled advance is returned in 16.16 format but isn't transformed */\n  /*    by the affine transformation specified by @FT_Set_Transform.       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advance( FT_Face    face,\n                  FT_UInt    gindex,\n                  FT_Int32   load_flags,\n                  FT_Fixed  *padvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advances                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance values of several glyph outlines in an        */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: The source @FT_Face handle.                         */\n  /*                                                                       */\n  /*    start       :: The first glyph index.                              */\n  /*                                                                       */\n  /*    count       :: The number of advance values you want to retrieve.  */\n  /*                                                                       */\n  /*    load_flags  :: A set of bit flags similar to those used when       */\n  /*                   calling @FT_Load_Glyph.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    padvance :: The advance values.  This array, to be provided by the */\n  /*                caller, must contain at least `count' elements.        */\n  /*                                                                       */\n  /*                If scaling is performed (based on the value of         */\n  /*                `load_flags'), the advance values are in 16.16 format. */\n  /*                Otherwise, they are in font units.                     */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */\n  /*                vertical advances corresponding to a vertical layout.  */\n  /*                Otherwise, they are the horizontal advances in a       */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    Scaled advances are returned in 16.16 format but aren't            */\n  /*    transformed by the affine transformation specified by              */\n  /*    @FT_Set_Transform.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advances( FT_Face    face,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed  *padvances );\n\n/* */\n\n\nFT_END_HEADER\n\n#endif /* __FTADVANC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftautoh.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftautoh.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the auto-hinter (specification only).   */\n/*                                                                         */\n/*  Copyright 2012, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTAUTOH_H__\n#define __FTAUTOH_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   auto_hinter\n   *\n   * @title:\n   *   The auto-hinter\n   *\n   * @abstract:\n   *   Controlling the auto-hinting module.\n   *\n   * @description:\n   *   While FreeType's auto-hinter doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   Note that the auto-hinter's module name is `autofitter' for\n   *   historical reasons.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   glyph-to-script-map\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The auto-hinter provides various script modules to hint glyphs.\n   *   Examples of supported scripts are Latin or CJK.  Before a glyph is\n   *   auto-hinted, the Unicode character map of the font gets examined, and\n   *   the script is then determined based on Unicode character ranges, see\n   *   below.\n   *\n   *   OpenType fonts, however, often provide much more glyphs than\n   *   character codes (small caps, superscripts, ligatures, swashes, etc.),\n   *   to be controlled by so-called `features'.  Handling OpenType features\n   *   can be quite complicated and thus needs a separate library on top of\n   *   FreeType.\n   *\n   *   The mapping between glyph indices and scripts (in the auto-hinter\n   *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an\n   *   array with `num_glyphs' elements, as found in the font's @FT_Face\n   *   structure.  The `glyph-to-script-map' property returns a pointer to\n   *   this array which can be modified as needed.  Note that the\n   *   modification should happen before the first glyph gets processed by\n   *   the auto-hinter so that the global analysis of the font shapes\n   *   actually uses the modified mapping.\n   *\n   *   The following example code demonstrates how to access it (omitting\n   *   the error handling).\n   *\n   *   {\n   *     FT_Library                library;\n   *     FT_Face                   face;\n   *     FT_Prop_GlyphToScriptMap  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *\n   *     prop.face = face;\n   *\n   *     FT_Property_Get( library, \"autofitter\",\n   *                               \"glyph-to-script-map\", &prop );\n   *\n   *     // adjust `prop.map' as needed right here\n   *\n   *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );\n   *   }\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_AUTOHINTER_SCRIPT_XXX\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   A list of constants used for the @glyph-to-script-map property to\n   *   specify the script submodule the auto-hinter should use for hinting a\n   *   particular glyph.\n   *\n   * @values:\n   *   FT_AUTOHINTER_SCRIPT_NONE ::\n   *     Don't auto-hint this glyph.\n   *\n   *   FT_AUTOHINTER_SCRIPT_LATIN ::\n   *     Apply the latin auto-hinter.  For the auto-hinter, `latin' is a\n   *     very broad term, including Cyrillic and Greek also since characters\n   *     from those scripts share the same design constraints.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0020 - U+007F  // Basic Latin (no control characters)\n   *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)\n   *       U+0100 - U+017F  // Latin Extended-A\n   *       U+0180 - U+024F  // Latin Extended-B\n   *       U+0250 - U+02AF  // IPA Extensions\n   *       U+02B0 - U+02FF  // Spacing Modifier Letters\n   *       U+0300 - U+036F  // Combining Diacritical Marks\n   *       U+0370 - U+03FF  // Greek and Coptic\n   *       U+0400 - U+04FF  // Cyrillic\n   *       U+0500 - U+052F  // Cyrillic Supplement\n   *       U+1D00 - U+1D7F  // Phonetic Extensions\n   *       U+1D80 - U+1DBF  // Phonetic Extensions Supplement\n   *       U+1DC0 - U+1DFF  // Combining Diacritical Marks Supplement\n   *       U+1E00 - U+1EFF  // Latin Extended Additional\n   *       U+1F00 - U+1FFF  // Greek Extended\n   *       U+2000 - U+206F  // General Punctuation\n   *       U+2070 - U+209F  // Superscripts and Subscripts\n   *       U+20A0 - U+20CF  // Currency Symbols\n   *       U+2150 - U+218F  // Number Forms\n   *       U+2460 - U+24FF  // Enclosed Alphanumerics\n   *       U+2C60 - U+2C7F  // Latin Extended-C\n   *       U+2DE0 - U+2DFF  // Cyrillic Extended-A\n   *       U+2E00 - U+2E7F  // Supplemental Punctuation\n   *       U+A640 - U+A69F  // Cyrillic Extended-B\n   *       U+A720 - U+A7FF  // Latin Extended-D\n   *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)\n   *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols\n   *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_CJK ::\n   *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old\n   *     Vietnamese, and some other scripts.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+1100 - U+11FF  // Hangul Jamo\n   *       U+2E80 - U+2EFF  // CJK Radicals Supplement\n   *       U+2F00 - U+2FDF  // Kangxi Radicals\n   *       U+2FF0 - U+2FFF  // Ideographic Description Characters\n   *       U+3000 - U+303F  // CJK Symbols and Punctuation\n   *       U+3040 - U+309F  // Hiragana\n   *       U+30A0 - U+30FF  // Katakana\n   *       U+3100 - U+312F  // Bopomofo\n   *       U+3130 - U+318F  // Hangul Compatibility Jamo\n   *       U+3190 - U+319F  // Kanbun\n   *       U+31A0 - U+31BF  // Bopomofo Extended\n   *       U+31C0 - U+31EF  // CJK Strokes\n   *       U+31F0 - U+31FF  // Katakana Phonetic Extensions\n   *       U+3200 - U+32FF  // Enclosed CJK Letters and Months\n   *       U+3300 - U+33FF  // CJK Compatibility\n   *       U+3400 - U+4DBF  // CJK Unified Ideographs Extension A\n   *       U+4DC0 - U+4DFF  // Yijing Hexagram Symbols\n   *       U+4E00 - U+9FFF  // CJK Unified Ideographs\n   *       U+A960 - U+A97F  // Hangul Jamo Extended-A\n   *       U+AC00 - U+D7AF  // Hangul Syllables\n   *       U+D7B0 - U+D7FF  // Hangul Jamo Extended-B\n   *       U+F900 - U+FAFF  // CJK Compatibility Ideographs\n   *       U+FE10 - U+FE1F  // Vertical forms\n   *       U+FE30 - U+FE4F  // CJK Compatibility Forms\n   *       U+FF00 - U+FFEF  // Halfwidth and Fullwidth Forms\n   *      U+1B000 - U+1B0FF // Kana Supplement\n   *      U+1D300 - U+1D35F // Tai Xuan Hing Symbols\n   *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement\n   *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B\n   *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C\n   *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D\n   *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_INDIC ::\n   *     Apply the indic auto-hinter, covering all major scripts from the\n   *     Indian sub-continent and some other related scripts like Thai, Lao,\n   *     or Tibetan.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0900 - U+0DFF  // Indic Range\n   *       U+0F00 - U+0FFF  // Tibetan\n   *       U+1900 - U+194F  // Limbu\n   *       U+1B80 - U+1BBF  // Sundanese\n   *       U+1C80 - U+1CDF  // Meetei Mayak\n   *       U+A800 - U+A82F  // Syloti Nagri\n   *      U+11800 - U+118DF // Sharada\n   *     }\n   *\n   *     Note that currently Indic support is rudimentary only, missing blue\n   *     zone support.\n   *\n   */\n#define FT_AUTOHINTER_SCRIPT_NONE   0\n#define FT_AUTOHINTER_SCRIPT_LATIN  1\n#define FT_AUTOHINTER_SCRIPT_CJK    2\n#define FT_AUTOHINTER_SCRIPT_INDIC  3\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_GlyphToScriptMap\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The data exchange structure for the @glyph-to-script-map property.\n   *\n   */\n   typedef struct  FT_Prop_GlyphToScriptMap_\n   {\n     FT_Face   face;\n     FT_Byte*  map;\n\n   } FT_Prop_GlyphToScriptMap;\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   fallback-script\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   If no auto-hinter script module can be assigned to a glyph, a\n   *   fallback script gets assigned to it (see also the\n   *   @glyph-to-script-map property).  By default, this is\n   *   @FT_AUTOHINTER_SCRIPT_CJK.  Using the `fallback-script' property,\n   *   this fallback value can be changed.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"fallback-script\", &fallback_script );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   It's important to use the right timing for changing this value: The\n   *   creation of the glyph-to-script map which eventually uses the\n   *   fallback script value gets triggered either by setting or reading a\n   *   face-specific property like @glyph-to-script-map, or by auto-hinting\n   *   any glyph from that face.  In particular, if you have already created\n   *   an @FT_Face structure but not loaded any glyph (using the\n   *   auto-hinter), a change of the fallback glyph will affect this face.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   increase-x-height\n   *\n   * @description:\n   *   For ppem values in the range 6~<= ppem <= `increase-x-height', round\n   *   up the font's x~height much more often than normally.  If the value\n   *   is set to~0, which is the default, this feature is switched off.  Use\n   *   this property to improve the legibility of small font sizes if\n   *   necessary.\n   *\n   *   {\n   *     FT_Library               library;\n   *     FT_Face                  face;\n   *     FT_Prop_IncreaseXHeight  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *     FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );\n   *\n   *     prop.face  = face;\n   *     prop.limit = 14;\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"increase-x-height\", &prop );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   Set this value right after calling @FT_Set_Char_Size, but before\n   *   loading any glyph (using the auto-hinter).\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_IncreaseXHeight\n   *\n   * @description:\n   *   The data exchange structure for the @increase-x-height property.\n   *\n   */\n   typedef struct  FT_Prop_IncreaseXHeight_\n   {\n     FT_Face  face;\n     FT_UInt  limit;\n\n   } FT_Prop_IncreaseXHeight;\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTAUTOH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftbbox.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.h                                                               */\n/*                                                                         */\n/*    FreeType exact bbox computation (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /* It is separated from the rest of the engine for various technical     */\n  /* reasons.  It may well be integrated in `ftoutln' later.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTBBOX_H__\n#define __FTBBOX_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the exact bounding box of an outline.  This is slower      */\n  /*    than computing the control box.  However, it uses an advanced      */\n  /*    algorithm which returns _very_ quickly when the two boxes          */\n  /*    coincide.  Otherwise, the outline Bézier arcs are traversed to     */\n  /*    extract their extrema.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abbox   :: The outline's exact bounding box.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get      */\n  /*    reasonable values for the BBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the BBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBBOX_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (specification).     */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2009 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBDF_H__\n#define __FTBDF_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bdf_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BDF and PCF Files                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    BDF and PCF specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions specific to BDF */\n  /*    and PCF fonts.                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @enum:\n   *    FT_PropertyType\n   *\n   * @description:\n   *    A list of BDF property types.\n   *\n   * @values:\n   *    BDF_PROPERTY_TYPE_NONE ::\n   *      Value~0 is used to indicate a missing property.\n   *\n   *    BDF_PROPERTY_TYPE_ATOM ::\n   *      Property is a string atom.\n   *\n   *    BDF_PROPERTY_TYPE_INTEGER ::\n   *      Property is a 32-bit signed integer.\n   *\n   *    BDF_PROPERTY_TYPE_CARDINAL ::\n   *      Property is a 32-bit unsigned integer.\n   */\n  typedef enum  BDF_PropertyType_\n  {\n    BDF_PROPERTY_TYPE_NONE     = 0,\n    BDF_PROPERTY_TYPE_ATOM     = 1,\n    BDF_PROPERTY_TYPE_INTEGER  = 2,\n    BDF_PROPERTY_TYPE_CARDINAL = 3\n\n  } BDF_PropertyType;\n\n\n  /**********************************************************************\n   *\n   * @type:\n   *    BDF_Property\n   *\n   * @description:\n   *    A handle to a @BDF_PropertyRec structure to model a given\n   *    BDF/PCF property.\n   */\n  typedef struct BDF_PropertyRec_*  BDF_Property;\n\n\n /**********************************************************************\n  *\n  * @struct:\n  *    BDF_PropertyRec\n  *\n  * @description:\n  *    This structure models a given BDF/PCF property.\n  *\n  * @fields:\n  *    type ::\n  *      The property type.\n  *\n  *    u.atom ::\n  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.\n  *\n  *    u.integer ::\n  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.\n  *\n  *    u.cardinal ::\n  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.\n  */\n  typedef struct  BDF_PropertyRec_\n  {\n    BDF_PropertyType  type;\n    union {\n      const char*     atom;\n      FT_Int32        integer;\n      FT_UInt32       cardinal;\n\n    } u;\n\n  } BDF_PropertyRec;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Charset_ID\n  *\n  * @description:\n  *    Retrieve a BDF font character set identity, according to\n  *    the BDF specification.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  * @output:\n  *    acharset_encoding ::\n  *       Charset encoding, as a C~string, owned by the face.\n  *\n  *    acharset_registry ::\n  *       Charset registry, as a C~string, owned by the face.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with BDF faces, returning an error otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Property\n  *\n  * @description:\n  *    Retrieve a BDF property from a BDF or PCF font file.\n  *\n  * @input:\n  *    face :: A handle to the input face.\n  *\n  *    name :: The property name.\n  *\n  * @output:\n  *    aproperty :: The property.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function works with BDF _and_ PCF fonts.  It returns an error\n  *   otherwise.  It also returns an error if the property is not in the\n  *   font.\n  *\n  *   A `property' is a either key-value pair within the STARTPROPERTIES\n  *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the\n  *   `info->props' array within a `FontRec' structure of a PCF font.\n  *\n  *   Integer properties are always stored as `signed' within PCF fonts;\n  *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value\n  *   for BDF fonts only.\n  *\n  *   In case of error, `aproperty->type' is always set to\n  *   @BDF_PROPERTY_TYPE_NONE.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftbitmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.h                                                             */\n/*                                                                         */\n/*    FreeType utility functions for bitmaps (specification).              */\n/*                                                                         */\n/*  Copyright 2004-2006, 2008, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBITMAP_H__\n#define __FTBITMAP_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bitmap_handling                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Bitmap Handling                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Handling FT_Bitmap objects.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains functions for converting FT_Bitmap objects.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_New                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a pointer to an @FT_Bitmap structure.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the bitmap structure.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Copy                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy a bitmap into another one.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    source  :: A handle to the source bitmap.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target  :: A handle to the target bitmap.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Embolden                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\n  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\n  /*    borders are kept unchanged.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /*    yStrength :: How strong the glyph is emboldened vertically.        */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    bitmap    :: A handle to the target bitmap.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The current implementation restricts `xStrength' to be less than   */\n  /*    or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\n  /*                                                                       */\n  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */\n  /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Convert                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */\n  /*    to a bitmap object with depth 8bpp, making the number of used      */\n  /*    bytes line (a.k.a. the `pitch') a multiple of `alignment'.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    source    :: The source bitmap.                                    */\n  /*                                                                       */\n  /*    alignment :: The pitch of the bitmap is a multiple of this         */\n  /*                 parameter.  Common values are 1, 2, or 4.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target    :: The target bitmap.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\n  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\n  /*                                                                       */\n  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\n  /*                                                                       */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GlyphSlot_Own_Bitmap                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Make sure that a glyph slot owns `slot->bitmap'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: The glyph slot.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is to be used in combination with                    */\n  /*    @FT_Bitmap_Embolden.                                               */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    bitmap  :: The bitmap object to be freed.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBITMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftbzip2.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbzip2.h                                                              */\n/*                                                                         */\n/*    Bzip2-compressed stream support.                                     */\n/*                                                                         */\n/*  Copyright 2010 by                                                      */\n/*  Joel Klinghed.                                                         */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBZIP2_H__\n#define __FTBZIP2_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bzip2                                                              */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BZIP2 Streams                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using bzip2-compressed font files.                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Bzip2-specific functions. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenBzip2\n  *\n  * @description:\n  *   Open a new stream to parse bzip2-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.bz2' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, bzip2 compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a bzip2 compressed stream\n  *   from it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with bzip2 support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBZIP2_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftcache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.h                                                              */\n/*                                                                         */\n/*    FreeType Cache subsystem (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCACHE_H__\n#define __FTCACHE_H__\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************\n   *\n   * <Section>\n   *    cache_subsystem\n   *\n   * <Title>\n   *    Cache Sub-System\n   *\n   * <Abstract>\n   *    How to cache face, size, and glyph data with FreeType~2.\n   *\n   * <Description>\n   *   This section describes the FreeType~2 cache sub-system, which is used\n   *   to limit the number of concurrently opened @FT_Face and @FT_Size\n   *   objects, as well as caching information like character maps and glyph\n   *   images while limiting their maximum memory usage.\n   *\n   *   Note that all types and functions begin with the `FTC_' prefix.\n   *\n   *   The cache is highly portable and thus doesn't know anything about the\n   *   fonts installed on your system, or how to access them.  This implies\n   *   the following scheme:\n   *\n   *   First, available or installed font faces are uniquely identified by\n   *   @FTC_FaceID values, provided to the cache by the client.  Note that\n   *   the cache only stores and compares these values, and doesn't try to\n   *   interpret them in any way.\n   *\n   *   Second, the cache calls, only when needed, a client-provided function\n   *   to convert an @FTC_FaceID into a new @FT_Face object.  The latter is\n   *   then completely managed by the cache, including its termination\n   *   through @FT_Done_Face.  To monitor termination of face objects, the\n   *   finalizer callback in the `generic' field of the @FT_Face object can\n   *   be used, which might also be used to store the @FTC_FaceID of the\n   *   face.\n   *\n   *   Clients are free to map face IDs to anything else.  The most simple\n   *   usage is to associate them to a (pathname,face_index) pair that is\n   *   used to call @FT_New_Face.  However, more complex schemes are also\n   *   possible.\n   *\n   *   Note that for the cache to work correctly, the face ID values must be\n   *   *persistent*, which means that the contents they point to should not\n   *   change at runtime, or that their value should not become invalid.\n   *\n   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),\n   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let\n   *   the cache get rid of any references to the old @FTC_FaceID it may\n   *   keep internally.  Failure to do so will lead to incorrect behaviour\n   *   or even crashes.\n   *\n   *   To use the cache, start with calling @FTC_Manager_New to create a new\n   *   @FTC_Manager object, which models a single cache instance.  You can\n   *   then look up @FT_Face and @FT_Size objects with\n   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.\n   *\n   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then\n   *   later use @FTC_CMapCache_Lookup to perform the equivalent of\n   *   @FT_Get_Char_Index, only much faster.\n   *\n   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then\n   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding\n   *   @FT_Glyph objects from the cache.\n   *\n   *   If you need lots of small bitmaps, it is much more memory efficient\n   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This\n   *   returns @FTC_SBitRec structures, which are used to store small\n   *   bitmaps directly.  (A small bitmap is one whose metrics and\n   *   dimensions all fit into 8-bit integers).\n   *\n   *   We hope to also provide a kerning cache in the near future.\n   *\n   *\n   * <Order>\n   *   FTC_Manager\n   *   FTC_FaceID\n   *   FTC_Face_Requester\n   *\n   *   FTC_Manager_New\n   *   FTC_Manager_Reset\n   *   FTC_Manager_Done\n   *   FTC_Manager_LookupFace\n   *   FTC_Manager_LookupSize\n   *   FTC_Manager_RemoveFaceID\n   *\n   *   FTC_Node\n   *   FTC_Node_Unref\n   *\n   *   FTC_ImageCache\n   *   FTC_ImageCache_New\n   *   FTC_ImageCache_Lookup\n   *\n   *   FTC_SBit\n   *   FTC_SBitCache\n   *   FTC_SBitCache_New\n   *   FTC_SBitCache_Lookup\n   *\n   *   FTC_CMapCache\n   *   FTC_CMapCache_New\n   *   FTC_CMapCache_Lookup\n   *\n   *************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    BASIC TYPE DEFINITIONS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type: FTC_FaceID\n   *\n   * @description:\n   *   An opaque pointer type that is used to identity face objects.  The\n   *   contents of such objects is application-dependent.\n   *\n   *   These pointers are typically used to point to a user-defined\n   *   structure containing a font file path, and face index.\n   *\n   * @note:\n   *   Never use NULL as a valid @FTC_FaceID.\n   *\n   *   Face IDs are passed by the client to the cache manager, which calls,\n   *   when needed, the @FTC_Face_Requester to translate them into new\n   *   @FT_Face objects.\n   *\n   *   If the content of a given face ID changes at runtime, or if the value\n   *   becomes invalid (e.g., when uninstalling a font), you should\n   *   immediately call @FTC_Manager_RemoveFaceID before any other cache\n   *   function.\n   *\n   *   Failure to do so will result in incorrect behaviour or even\n   *   memory leaks and crashes.\n   */\n  typedef FT_Pointer  FTC_FaceID;\n\n\n  /************************************************************************\n   *\n   * @functype:\n   *   FTC_Face_Requester\n   *\n   * @description:\n   *   A callback function provided by client applications.  It is used by\n   *   the cache manager to translate a given @FTC_FaceID into a new valid\n   *   @FT_Face object, on demand.\n   *\n   * <Input>\n   *   face_id ::\n   *     The face ID to resolve.\n   *\n   *   library ::\n   *     A handle to a FreeType library object.\n   *\n   *   req_data ::\n   *     Application-provided request data (see note below).\n   *\n   * <Output>\n   *   aface ::\n   *     A new @FT_Face handle.\n   *\n   * <Return>\n   *   FreeType error code.  0~means success.\n   *\n   * <Note>\n   *   The third parameter `req_data' is the same as the one passed by the\n   *   client when @FTC_Manager_New is called.\n   *\n   *   The face requester should not perform funny things on the returned\n   *   face object, like creating a new @FT_Size for it, or setting a\n   *   transformation through @FT_Set_Transform!\n   */\n  typedef FT_Error\n  (*FTC_Face_Requester)( FTC_FaceID  face_id,\n                         FT_Library  library,\n                         FT_Pointer  request_data,\n                         FT_Face*    aface );\n\n /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CACHE MANAGER OBJECT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Manager                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This object corresponds to one instance of the cache-subsystem.    */\n  /*    It is used to cache one or more @FT_Face objects, along with       */\n  /*    corresponding @FT_Size objects.                                    */\n  /*                                                                       */\n  /*    The manager intentionally limits the total number of opened        */\n  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */\n  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */\n  /*                                                                       */\n  /*    The manager is also used to cache `nodes' of various types while   */\n  /*    limiting their total memory usage.                                 */\n  /*                                                                       */\n  /*    All limitations are enforced by keeping lists of managed objects   */\n  /*    in most-recently-used order, and flushing old nodes to make room   */\n  /*    for new ones.                                                      */\n  /*                                                                       */\n  typedef struct FTC_ManagerRec_*  FTC_Manager;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Node                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to a cache node object.  Each cache node is       */\n  /*    reference-counted.  A node with a count of~0 might be flushed      */\n  /*    out of a full cache whenever a lookup request is performed.        */\n  /*                                                                       */\n  /*    If you look up nodes, you have the ability to `acquire' them,      */\n  /*    i.e., to increment their reference count.  This will prevent the   */\n  /*    node from being flushed out of the cache until you explicitly      */\n  /*    `release' it (see @FTC_Node_Unref).                                */\n  /*                                                                       */\n  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */\n  /*                                                                       */\n  typedef struct FTC_NodeRec_*  FTC_Node;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_New                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache manager.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: The parent FreeType library handle to use.            */\n  /*                                                                       */\n  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */\n  /*                 Use~0 for defaults.  Note that this value does not    */\n  /*                 account for managed @FT_Face and @FT_Size objects.    */\n  /*                                                                       */\n  /*    requester :: An application-provided callback used to translate    */\n  /*                 face IDs into real @FT_Face objects.                  */\n  /*                                                                       */\n  /*    req_data  :: A generic pointer that is passed to the requester     */\n  /*                 each time it is called (see @FTC_Face_Requester).     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amanager  :: A handle to a new manager object.  0~in case of       */\n  /*                 failure.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Reset                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Empty a given cache manager.  This simply gets rid of all the      */\n  /*    currently cached @FT_Face and @FT_Size objects within the manager. */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the manager.                                */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Reset( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given manager after emptying it.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the target cache manager object.            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Done( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupFace                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Face object that corresponds to a given face ID   */\n  /*    through a cache manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    face_id :: The ID of the face object.                              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface   :: A handle to the face object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Face object is always owned by the manager.  You  */\n  /*    should never try to discard it yourself.                           */\n  /*                                                                       */\n  /*    The @FT_Face object doesn't necessarily have a current size object */\n  /*    (i.e., face->size can be~0).  If you need a specific `font size',  */\n  /*    use @FTC_Manager_LookupSize instead.                               */\n  /*                                                                       */\n  /*    Never change the face's transformation matrix (i.e., never call    */\n  /*    the @FT_Set_Transform function) on a returned face!  If you need   */\n  /*    to transform glyphs, do it yourself after glyph loading.           */\n  /*                                                                       */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory was available */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_ScalerRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a given character size in either      */\n  /*    pixels or points to the cache manager.  See                        */\n  /*    @FTC_Manager_LookupSize.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id :: The source face ID.                                     */\n  /*                                                                       */\n  /*    width   :: The character width.                                    */\n  /*                                                                       */\n  /*    height  :: The character height.                                   */\n  /*                                                                       */\n  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */\n  /*               interpreted as integer pixel character sizes.           */\n  /*               Otherwise, they are expressed as 1/64th of points.      */\n  /*                                                                       */\n  /*    x_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               horizontal resolution in dpi.                           */\n  /*                                                                       */\n  /*    y_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               vertical resolution in dpi.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This type is mainly used to retrieve @FT_Size objects through the  */\n  /*    cache manager.                                                     */\n  /*                                                                       */\n  typedef struct  FTC_ScalerRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     width;\n    FT_UInt     height;\n    FT_Int      pixel;\n    FT_UInt     x_res;\n    FT_UInt     y_res;\n\n  } FTC_ScalerRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_Scaler                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FTC_ScalerRec structure.                           */\n  /*                                                                       */\n  typedef struct FTC_ScalerRec_*  FTC_Scaler;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupSize                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Size object that corresponds to a given           */\n  /*    @FTC_ScalerRec pointer through a cache manager.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    scaler  :: A scaler handle.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize   :: A handle to the size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Size object is always owned by the manager.  You  */\n  /*    should never try to discard it by yourself.                        */\n  /*                                                                       */\n  /*    You can access the parent @FT_Face object simply as `size->face'   */\n  /*    if you need it.  Note that this object is also owned by the        */\n  /*    manager.                                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory is available  */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Node_Unref                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Decrement a cache node's internal reference count.  When the count */\n  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */\n  /*    cache flushes.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node    :: The cache node handle.                                  */\n  /*                                                                       */\n  /*    manager :: The cache manager handle.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_Manager_RemoveFaceID\n   *\n   * @description:\n   *   A special function used to indicate to the cache manager that\n   *   a given @FTC_FaceID is no longer valid, either because its\n   *   content changed, or because it was deallocated or uninstalled.\n   *\n   * @input:\n   *   manager ::\n   *     The cache manager handle.\n   *\n   *   face_id ::\n   *     The @FTC_FaceID to be removed.\n   *\n   * @note:\n   *   This function flushes all nodes from the cache corresponding to this\n   *   `face_id', with the exception of nodes with a non-null reference\n   *   count.\n   *\n   *   Such nodes are however modified internally so as to never appear\n   *   in later lookups with the same `face_id' value, and to be immediately\n   *   destroyed when released by all their users.\n   *\n   */\n  FT_EXPORT( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_CMapCache\n   *\n   * @description:\n   *   An opaque handle used to model a charmap cache.  This cache is to\n   *   hold character codes -> glyph indices mappings.\n   *\n   */\n  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_New\n   *\n   * @description:\n   *   Create a new charmap cache.\n   *\n   * @input:\n   *   manager ::\n   *     A handle to the cache manager.\n   *\n   * @output:\n   *   acache ::\n   *     A new cache handle.  NULL in case of error.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Like all other caches, this one will be destroyed with the cache\n   *   manager.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_Lookup\n   *\n   * @description:\n   *   Translate a character code into a glyph index, using the charmap\n   *   cache.\n   *\n   * @input:\n   *   cache ::\n   *     A charmap cache handle.\n   *\n   *   face_id ::\n   *     The source face ID.\n   *\n   *   cmap_index ::\n   *     The index of the charmap in the source face.  Any negative value\n   *     means to use the cache @FT_Face's default charmap.\n   *\n   *   char_code ::\n   *     The character code (in the corresponding charmap).\n   *\n   * @return:\n   *    Glyph index.  0~means `no glyph'.\n   *\n   */\n  FT_EXPORT( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       IMAGE CACHE OBJECT                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FTC_ImageTypeRec\n   *\n   * @description:\n   *   A structure used to model the type of images in a glyph cache.\n   *\n   * @fields:\n   *   face_id ::\n   *     The face ID.\n   *\n   *   width ::\n   *     The width in pixels.\n   *\n   *   height ::\n   *     The height in pixels.\n   *\n   *   flags ::\n   *     The load flags, as in @FT_Load_Glyph.\n   *\n   */\n  typedef struct  FTC_ImageTypeRec_\n  {\n    FTC_FaceID  face_id;\n    FT_Int      width;\n    FT_Int      height;\n    FT_Int32    flags;\n\n  } FTC_ImageTypeRec;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_ImageType\n   *\n   * @description:\n   *   A handle to an @FTC_ImageTypeRec structure.\n   *\n   */\n  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;\n\n\n  /* */\n\n\n#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \\\n          ( (d1)->face_id == (d2)->face_id && \\\n            (d1)->width   == (d2)->width   && \\\n            (d1)->flags   == (d2)->flags   )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_ImageCache                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a glyph image cache object.  They are designed to      */\n  /*    hold many distinct glyph images while not exceeding a certain      */\n  /*    memory threshold.                                                  */\n  /*                                                                       */\n  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_New                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new glyph image cache.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: The parent manager for the image cache.                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new glyph image cache object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_Lookup                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a given glyph image from a glyph image cache.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source glyph image cache.                */\n  /*                                                                       */\n  /*    type   :: A pointer to a glyph image type descriptor.              */\n  /*                                                                       */\n  /*    gindex :: The glyph index to retrieve.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: The corresponding @FT_Glyph object.  0~in case of        */\n  /*              failure.                                                 */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_LookupScaler                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source glyph image cache.            */\n  /*                                                                       */\n  /*    scaler     :: A pointer to a scaler descriptor.                    */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index to retrieve.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph     :: The corresponding @FT_Glyph object.  0~in case of    */\n  /*                  failure.                                             */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */\n  /*    glyphs; you should always use the FreeType cache API instead.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBit                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */\n  /*    structure for details.                                             */\n  /*                                                                       */\n  typedef struct FTC_SBitRec_*  FTC_SBit;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_SBitRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very compact structure used to describe a small glyph bitmap.    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width     :: The bitmap width in pixels.                           */\n  /*                                                                       */\n  /*    height    :: The bitmap height in pixels.                          */\n  /*                                                                       */\n  /*    left      :: The horizontal distance from the pen position to the  */\n  /*                 left bitmap border (a.k.a. `left side bearing', or    */\n  /*                 `lsb').                                               */\n  /*                                                                       */\n  /*    top       :: The vertical distance from the pen position (on the   */\n  /*                 baseline) to the upper bitmap border (a.k.a. `top     */\n  /*                 side bearing').  The distance is positive for upwards */\n  /*                 y~coordinates.                                        */\n  /*                                                                       */\n  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */\n  /*                                                                       */\n  /*    max_grays :: Maximum gray level value (in the range 1 to~255).     */\n  /*                                                                       */\n  /*    pitch     :: The number of bytes per bitmap line.  May be positive */\n  /*                 or negative.                                          */\n  /*                                                                       */\n  /*    xadvance  :: The horizontal advance width in pixels.               */\n  /*                                                                       */\n  /*    yadvance  :: The vertical advance height in pixels.                */\n  /*                                                                       */\n  /*    buffer    :: A pointer to the bitmap pixels.                       */\n  /*                                                                       */\n  typedef struct  FTC_SBitRec_\n  {\n    FT_Byte   width;\n    FT_Byte   height;\n    FT_Char   left;\n    FT_Char   top;\n\n    FT_Byte   format;\n    FT_Byte   max_grays;\n    FT_Short  pitch;\n    FT_Char   xadvance;\n    FT_Char   yadvance;\n\n    FT_Byte*  buffer;\n\n  } FTC_SBitRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBitCache                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap cache.  These are special cache objects */\n  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */\n  /*    much more efficient way than the traditional glyph image cache     */\n  /*    implemented by @FTC_ImageCache.                                    */\n  /*                                                                       */\n  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_New                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache to store small glyph bitmaps.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the source cache manager.                   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_Lookup                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Look up a given small glyph bitmap in a given sbit cache and       */\n  /*    `lock' it to prevent its flushing from the cache until needed.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source sbit cache.                       */\n  /*                                                                       */\n  /*    type   :: A pointer to the glyph image type descriptor.            */\n  /*                                                                       */\n  /*    gindex :: The glyph index.                                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit   :: A handle to a small bitmap descriptor.                   */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache    cache,\n                        FTC_ImageType    type,\n                        FT_UInt          gindex,\n                        FTC_SBit        *sbit,\n                        FTC_Node        *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_LookupScaler                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source sbit cache.                   */\n  /*                                                                       */\n  /*    scaler     :: A pointer to the scaler descriptor.                  */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit       :: A handle to a small bitmap descriptor.               */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *sbit,\n                              FTC_Node      *anode );\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftcffdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcffdrv.h                                                             */\n/*                                                                         */\n/*    FreeType API for controlling the CFF driver (specification only).    */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCFFDRV_H__\n#define __FTCFFDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   cff_driver\n   *\n   * @title:\n   *   The CFF driver\n   *\n   * @abstract:\n   *   Controlling the CFF driver module.\n   *\n   * @description:\n   *   While FreeType's CFF driver doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The CFF driver's module name is `cff'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   hinting-engine\n   *\n   * @description:\n   *   Thanks to Adobe, which contributed a new hinting (and parsing)\n   *   engine, an application can select between `freetype' and `adobe' if\n   *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration\n   *   macro isn't defined, `hinting-engine' does nothing.\n   *\n   *   The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is\n   *   defined, and `adobe' otherwise.\n   *\n   *   The following example code demonstrates how to select Adobe's hinting\n   *   engine (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"hinting-engine\", &hinting_engine );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_CFF_HINTING_XXX\n   *\n   * @description:\n   *   A list of constants used for the @hinting-engine property to select\n   *   the hinting engine for CFF fonts.\n   *\n   * @values:\n   *   FT_CFF_HINTING_FREETYPE ::\n   *     Use the old FreeType hinting engine.\n   *\n   *   FT_CFF_HINTING_ADOBE ::\n   *     Use the hinting engine contributed by Adobe.\n   *\n   */\n#define FT_CFF_HINTING_FREETYPE  0\n#define FT_CFF_HINTING_ADOBE     1\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   no-stem-darkening\n   *\n   * @description:\n   *   By default, the Adobe CFF engine darkens stems at smaller sizes,\n   *   regardless of hinting, to enhance contrast.  Setting this property,\n   *   stem darkening gets switched off.\n   *\n   *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_Bool     no_stem_darkening = TRUE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"no-stem-darkening\", &no_stem_darkening );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTCFFDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftchapters.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/* This file defines the structure of the FreeType reference.              */\n/* It is used by the python script which generates the HTML files.         */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    general_remarks                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    General Remarks                                                      */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    user_allocation                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    core_api                                                             */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Core API                                                             */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    version                                                              */\n/*    basic_types                                                          */\n/*    base_interface                                                       */\n/*    glyph_variants                                                       */\n/*    glyph_management                                                     */\n/*    mac_specific                                                         */\n/*    sizes_management                                                     */\n/*    header_file_macros                                                   */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    format_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Format-Specific API                                                  */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    multiple_masters                                                     */\n/*    truetype_tables                                                      */\n/*    type1_tables                                                         */\n/*    sfnt_names                                                           */\n/*    bdf_fonts                                                            */\n/*    cid_fonts                                                            */\n/*    pfr_fonts                                                            */\n/*    winfnt_fonts                                                         */\n/*    font_formats                                                         */\n/*    gasp_table                                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    module_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Controlling FreeType Modules                                         */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    auto_hinter                                                          */\n/*    cff_driver                                                           */\n/*    tt_driver                                                            */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Cache Sub-System                                                     */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    support_api                                                          */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Support API                                                          */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    computations                                                         */\n/*    list_processing                                                      */\n/*    outline_processing                                                   */\n/*    quick_advance                                                        */\n/*    bitmap_handling                                                      */\n/*    raster                                                               */\n/*    glyph_stroker                                                        */\n/*    system_interface                                                     */\n/*    module_management                                                    */\n/*    gzip                                                                 */\n/*    lzw                                                                  */\n/*    bzip2                                                                */\n/*    lcd_filtering                                                        */\n/*                                                                         */\n/***************************************************************************/\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcid.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing CID font information (specification).     */\n/*                                                                         */\n/*  Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal.                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCID_H__\n#define __FTCID_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cid_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    CID Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    CID-keyed font specific API.                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of CID-keyed font specific   */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Registry_Ordering_Supplement\n   *\n   * @description:\n   *    Retrieve the Registry/Ordering/Supplement triple (also known as the\n   *    \"R/O/S\") from a CID-keyed font.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    registry ::\n   *       The registry, as a C~string, owned by the face.\n   *\n   *    ordering ::\n   *       The ordering, as a C~string, owned by the face.\n   *\n   *    supplement ::\n   *       The supplement.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces, returning an error\n   *    otherwise.\n   *\n   * @since:\n   *    2.3.6\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,\n                                           const char*  *registry,\n                                           const char*  *ordering,\n                                           FT_Int       *supplement);\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Is_Internally_CID_Keyed\n   *\n   * @description:\n   *    Retrieve the type of the input face, CID keyed or not.  In\n   *    constrast to the @FT_IS_CID_KEYED macro this function returns\n   *    successfully also for CID-keyed fonts in an SNFT wrapper.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    is_cid ::\n   *       The type of the face as an @FT_Bool.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,\n                                      FT_Bool  *is_cid );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_From_Glyph_Index\n   *\n   * @description:\n   *    Retrieve the CID of the input glyph index.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   *    glyph_index ::\n   *       The input glyph index.\n   *\n   * @output:\n   *    cid ::\n   *       The CID as an @FT_UInt.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_From_Glyph_Index( FT_Face   face,\n                               FT_UInt   glyph_index,\n                               FT_UInt  *cid );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/fterrdef.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrdef.h                                                             */\n/*                                                                         */\n/*    FreeType error codes (specification).                                */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2006, 2007, 2010-2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                LIST OF ERROR CODES/MESSAGES             *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n  /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */\n  /* including this file.                                           */\n\n\n  /* generic errors */\n\n  FT_NOERRORDEF_( Ok,                                        0x00, \\\n                  \"no error\" )\n\n  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \\\n                \"cannot open resource\" )\n  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \\\n                \"unknown file format\" )\n  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \\\n                \"broken file\" )\n  FT_ERRORDEF_( Invalid_Version,                             0x04, \\\n                \"invalid FreeType version\" )\n  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \\\n                \"module version is too low\" )\n  FT_ERRORDEF_( Invalid_Argument,                            0x06, \\\n                \"invalid argument\" )\n  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \\\n                \"unimplemented feature\" )\n  FT_ERRORDEF_( Invalid_Table,                               0x08, \\\n                \"broken table\" )\n  FT_ERRORDEF_( Invalid_Offset,                              0x09, \\\n                \"broken offset within table\" )\n  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \\\n                \"array allocation size too large\" )\n  FT_ERRORDEF_( Missing_Module,                              0x0B, \\\n                \"missing module\" )\n  FT_ERRORDEF_( Missing_Property,                            0x0C, \\\n                \"missing property\" )\n\n  /* glyph/character errors */\n\n  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \\\n                \"invalid glyph index\" )\n  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \\\n                \"invalid character code\" )\n  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \\\n                \"unsupported glyph image format\" )\n  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \\\n                \"cannot render this glyph format\" )\n  FT_ERRORDEF_( Invalid_Outline,                             0x14, \\\n                \"invalid outline\" )\n  FT_ERRORDEF_( Invalid_Composite,                           0x15, \\\n                \"invalid composite glyph\" )\n  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \\\n                \"too many hints\" )\n  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \\\n                \"invalid pixel size\" )\n\n  /* handle errors */\n\n  FT_ERRORDEF_( Invalid_Handle,                              0x20, \\\n                \"invalid object handle\" )\n  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \\\n                \"invalid library handle\" )\n  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \\\n                \"invalid module handle\" )\n  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \\\n                \"invalid face handle\" )\n  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \\\n                \"invalid size handle\" )\n  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \\\n                \"invalid glyph slot handle\" )\n  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \\\n                \"invalid charmap handle\" )\n  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \\\n                \"invalid cache manager handle\" )\n  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \\\n                \"invalid stream handle\" )\n\n  /* driver errors */\n\n  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \\\n                \"too many modules\" )\n  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \\\n                \"too many extensions\" )\n\n  /* memory errors */\n\n  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \\\n                \"out of memory\" )\n  FT_ERRORDEF_( Unlisted_Object,                             0x41, \\\n                \"unlisted object\" )\n\n  /* stream errors */\n\n  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \\\n                \"cannot open stream\" )\n  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \\\n                \"invalid stream seek\" )\n  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \\\n                \"invalid stream skip\" )\n  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \\\n                \"invalid stream read\" )\n  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \\\n                \"invalid stream operation\" )\n  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \\\n                \"invalid frame operation\" )\n  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \\\n                \"nested frame access\" )\n  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \\\n                \"invalid frame read\" )\n\n  /* raster errors */\n\n  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \\\n                \"raster uninitialized\" )\n  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \\\n                \"raster corrupted\" )\n  FT_ERRORDEF_( Raster_Overflow,                             0x62, \\\n                \"raster overflow\" )\n  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \\\n                \"negative height while rastering\" )\n\n  /* cache errors */\n\n  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \\\n                \"too many registered caches\" )\n\n  /* TrueType and SFNT errors */\n\n  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \\\n                \"invalid opcode\" )\n  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \\\n                \"too few arguments\" )\n  FT_ERRORDEF_( Stack_Overflow,                              0x82, \\\n                \"stack overflow\" )\n  FT_ERRORDEF_( Code_Overflow,                               0x83, \\\n                \"code overflow\" )\n  FT_ERRORDEF_( Bad_Argument,                                0x84, \\\n                \"bad argument\" )\n  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \\\n                \"division by zero\" )\n  FT_ERRORDEF_( Invalid_Reference,                           0x86, \\\n                \"invalid reference\" )\n  FT_ERRORDEF_( Debug_OpCode,                                0x87, \\\n                \"found debug opcode\" )\n  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \\\n                \"found ENDF opcode in execution stream\" )\n  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \\\n                \"nested DEFS\" )\n  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \\\n                \"invalid code range\" )\n  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \\\n                \"execution context too long\" )\n  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \\\n                \"too many function definitions\" )\n  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \\\n                \"too many instruction definitions\" )\n  FT_ERRORDEF_( Table_Missing,                               0x8E, \\\n                \"SFNT font table missing\" )\n  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \\\n                \"horizontal header (hhea) table missing\" )\n  FT_ERRORDEF_( Locations_Missing,                           0x90, \\\n                \"locations (loca) table missing\" )\n  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \\\n                \"name table missing\" )\n  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \\\n                \"character map (cmap) table missing\" )\n  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \\\n                \"horizontal metrics (hmtx) table missing\" )\n  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \\\n                \"PostScript (post) table missing\" )\n  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \\\n                \"invalid horizontal metrics\" )\n  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \\\n                \"invalid character map (cmap) format\" )\n  FT_ERRORDEF_( Invalid_PPem,                                0x97, \\\n                \"invalid ppem value\" )\n  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \\\n                \"invalid vertical metrics\" )\n  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \\\n                \"could not find context\" )\n  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \\\n                \"invalid PostScript (post) table format\" )\n  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \\\n                \"invalid PostScript (post) table\" )\n\n  /* CFF, CID, and Type 1 errors */\n\n  FT_ERRORDEF_( Syntax_Error,                                0xA0, \\\n                \"opcode syntax error\" )\n  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \\\n                \"argument stack underflow\" )\n  FT_ERRORDEF_( Ignore,                                      0xA2, \\\n                \"ignore\" )\n  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3, \\\n                \"no Unicode glyph name found\" )\n  FT_ERRORDEF_( Glyph_Too_Big,                               0xA4, \\\n                \"glyph to big for hinting\" )\n\n  /* BDF errors */\n\n  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \\\n                \"`STARTFONT' field missing\" )\n  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \\\n                \"`FONT' field missing\" )\n  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \\\n                \"`SIZE' field missing\" )\n  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3, \\\n                \"`FONTBOUNDINGBOX' field missing\" )\n  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4, \\\n                \"`CHARS' field missing\" )\n  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5, \\\n                \"`STARTCHAR' field missing\" )\n  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6, \\\n                \"`ENCODING' field missing\" )\n  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7, \\\n                \"`BBX' field missing\" )\n  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8, \\\n                \"`BBX' too big\" )\n  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9, \\\n                \"Font header corrupted or missing fields\" )\n  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA, \\\n                \"Font glyphs corrupted or missing fields\" )\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/fterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrors.h                                                             */\n/*                                                                         */\n/*    FreeType error code handling (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2007, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This special header file is used to define the handling of FT2        */\n  /* enumeration constants.  It can also be used to generate error message */\n  /* strings with a small macro trick explained below.                     */\n  /*                                                                       */\n  /* I - Error Formats                                                     */\n  /* -----------------                                                     */\n  /*                                                                       */\n  /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */\n  /*   defined in ftoption.h in order to make the higher byte indicate     */\n  /*   the module where the error has happened (this is not compatible     */\n  /*   with standard builds of FreeType 2).  See the file `ftmoderr.h' for */\n  /*   more details.                                                       */\n  /*                                                                       */\n  /*                                                                       */\n  /* II - Error Message strings                                            */\n  /* --------------------------                                            */\n  /*                                                                       */\n  /*   The error definitions below are made through special macros that    */\n  /*   allow client applications to build a table of error message strings */\n  /*   if they need it.  The strings are not included in a normal build of */\n  /*   FreeType 2 to save space (most client applications do not use       */\n  /*   them).                                                              */\n  /*                                                                       */\n  /*   To do so, you have to define the following macros before including  */\n  /*   this file:                                                          */\n  /*                                                                       */\n  /*   FT_ERROR_START_LIST ::                                              */\n  /*     This macro is called before anything else to define the start of  */\n  /*     the error list.  It is followed by several FT_ERROR_DEF calls     */\n  /*     (see below).                                                      */\n  /*                                                                       */\n  /*   FT_ERROR_DEF( e, v, s ) ::                                          */\n  /*     This macro is called to define one single error.                  */\n  /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */\n  /*     `v' is the error numerical value.                                 */\n  /*     `s' is the corresponding error string.                            */\n  /*                                                                       */\n  /*   FT_ERROR_END_LIST ::                                                */\n  /*     This macro ends the list.                                         */\n  /*                                                                       */\n  /*   Additionally, you have to undefine __FTERRORS_H__ before #including */\n  /*   this file.                                                          */\n  /*                                                                       */\n  /*   Here is a simple example:                                           */\n  /*                                                                       */\n  /*     {                                                                 */\n  /*       #undef __FTERRORS_H__                                           */\n  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */\n  /*       #define FT_ERROR_START_LIST     {                               */\n  /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */\n  /*                                                                       */\n  /*       const struct                                                    */\n  /*       {                                                               */\n  /*         int          err_code;                                        */\n  /*         const char*  err_msg;                                         */\n  /*       } ft_errors[] =                                                 */\n  /*                                                                       */\n  /*       #include FT_ERRORS_H                                            */\n  /*     }                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTERRORS_H__\n#define __FTERRORS_H__\n\n\n  /* include module base error codes */\n#include FT_MODULE_ERRORS_H\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n\n  /* FT_ERR_PREFIX is used as a prefix for error identifiers. */\n  /* By default, we use `FT_Err_'.                            */\n  /*                                                          */\n#ifndef FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FT_Err_\n#endif\n\n\n  /* FT_ERR_BASE is used as the base for module-specific errors. */\n  /*                                                             */\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n#ifndef FT_ERR_BASE\n#define FT_ERR_BASE  FT_Mod_Err_Base\n#endif\n\n#else\n\n#undef FT_ERR_BASE\n#define FT_ERR_BASE  0\n\n#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */\n\n\n  /* If FT_ERRORDEF is not defined, we need to define a simple */\n  /* enumeration type.                                         */\n  /*                                                           */\n#ifndef FT_ERRORDEF\n\n#define FT_ERRORDEF( e, v, s )  e = v,\n#define FT_ERROR_START_LIST     enum {\n#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_ERRORDEF */\n\n\n  /* this macro is used to define an error */\n#define FT_ERRORDEF_( e, v, s )                                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )\n\n  /* this is only used for <module>_Err_Ok, which must be 0! */\n#define FT_NOERRORDEF_( e, v, s )                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )\n\n\n#ifdef FT_ERROR_START_LIST\n  FT_ERROR_START_LIST\n#endif\n\n\n  /* now include the error codes */\n#include FT_ERROR_DEFINITIONS_H\n\n\n#ifdef FT_ERROR_END_LIST\n  FT_ERROR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      SIMPLE CLEANUP                     *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_ERROR_START_LIST\n#undef FT_ERROR_END_LIST\n\n#undef FT_ERRORDEF\n#undef FT_ERRORDEF_\n#undef FT_NOERRORDEF_\n\n#undef FT_NEED_EXTERN_C\n#undef FT_ERR_BASE\n\n  /* FT_ERR_PREFIX is needed internally */\n#ifndef FT2_BUILD_LIBRARY\n#undef FT_ERR_PREFIX\n#endif\n\n#endif /* __FTERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftgasp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.h                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (specification).                   */\n/*                                                                         */\n/*  Copyright 2007, 2008, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef _FT_GASP_H_\n#define _FT_GASP_H_\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\n  /***************************************************************************\n   *\n   * @section:\n   *   gasp_table\n   *\n   * @title:\n   *   Gasp Table\n   *\n   * @abstract:\n   *   Retrieving TrueType `gasp' table entries.\n   *\n   * @description:\n   *   The function @FT_Get_Gasp can be used to query a TrueType or OpenType\n   *   font for specific entries in its `gasp' table, if any.  This is\n   *   mainly useful when implementing native TrueType hinting with the\n   *   bytecode interpreter to duplicate the Windows text rendering results.\n   */\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_GASP_XXX\n   *\n   * @description:\n   *   A list of values and/or bit-flags returned by the @FT_Get_Gasp\n   *   function.\n   *\n   * @values:\n   *   FT_GASP_NO_TABLE ::\n   *     This special value means that there is no GASP table in this face.\n   *     It is up to the client to decide what to do.\n   *\n   *   FT_GASP_DO_GRIDFIT ::\n   *     Grid-fitting and hinting should be performed at the specified ppem.\n   *     This *really* means TrueType bytecode interpretation.  If this bit\n   *     is not set, no hinting gets applied.\n   *\n   *   FT_GASP_DO_GRAY ::\n   *     Anti-aliased rendering should be performed at the specified ppem.\n   *     If not set, do monochrome rendering.\n   *\n   *   FT_GASP_SYMMETRIC_SMOOTHING ::\n   *     If set, smoothing along multiple axes must be used with ClearType.\n   *\n   *   FT_GASP_SYMMETRIC_GRIDFIT ::\n   *     Grid-fitting must be used with ClearType's symmetric smoothing.\n   *\n   * @note:\n   *   The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be\n   *   used for standard font rasterization only.  Independently of that,\n   *   `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to\n   *   be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and\n   *   `FT_GASP_DO_GRAY' are consequently ignored).\n   *\n   *   `ClearType' is Microsoft's implementation of LCD rendering, partly\n   *   protected by patents.\n   *\n   * @since:\n   *   2.3.0\n   */\n#define FT_GASP_NO_TABLE               -1\n#define FT_GASP_DO_GRIDFIT           0x01\n#define FT_GASP_DO_GRAY              0x02\n#define FT_GASP_SYMMETRIC_SMOOTHING  0x08\n#define FT_GASP_SYMMETRIC_GRIDFIT    0x10\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_Gasp\n   *\n   * @description:\n   *   Read the `gasp' table from a TrueType or OpenType font file and\n   *   return the entry corresponding to a given character pixel size.\n   *\n   * @input:\n   *   face :: The source face handle.\n   *   ppem :: The vertical character pixel size.\n   *\n   * @return:\n   *   Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no\n   *   `gasp' table in the face.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem );\n\n/* */\n\n#endif /* _FT_GASP_H_ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.h                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the definition of several convenience functions    */\n  /* that can be used by client applications to easily retrieve glyph      */\n  /* bitmaps and outlines from a given face.                               */\n  /*                                                                       */\n  /* These functions should be optional if you are writing a font server   */\n  /* or text layout engine on top of FreeType.  However, they are pretty   */\n  /* handy for many other simple uses of the library.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTGLYPH_H__\n#define __FTGLYPH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Management                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Generic interface to manage individual glyph data.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains definitions used to manage glyph data        */\n  /*    through generic FT_Glyph objects.  Each of them can contain a      */\n  /*    bitmap, a vector outline, or even images in other formats.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* forward declaration to a private type */\n  typedef struct FT_Glyph_Class_  FT_Glyph_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Glyph                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Handle to an object used to model generic glyph images.  It is a   */\n  /*    pointer to the @FT_GlyphRec structure and can contain a glyph      */\n  /*    bitmap or pointer.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Glyph objects are not owned by the library.  You must thus release */\n  /*    them manually (through @FT_Done_Glyph) _before_ calling            */\n  /*    @FT_Done_FreeType.                                                 */\n  /*                                                                       */\n  typedef struct FT_GlyphRec_*  FT_Glyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root glyph structure contains a given glyph image plus its     */\n  /*    advance width in 16.16 fixed-point format.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library :: A handle to the FreeType library object.                */\n  /*                                                                       */\n  /*    clazz   :: A pointer to the glyph's class.  Private.               */\n  /*                                                                       */\n  /*    format  :: The format of the glyph's image.                        */\n  /*                                                                       */\n  /*    advance :: A 16.16 vector that gives the glyph's advance width.    */\n  /*                                                                       */\n  typedef struct  FT_GlyphRec_\n  {\n    FT_Library             library;\n    const FT_Glyph_Class*  clazz;\n    FT_Glyph_Format        format;\n    FT_Vector              advance;\n\n  } FT_GlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_BitmapGlyph                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a bitmap glyph image.  This is */\n  /*    a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.     */\n  /*                                                                       */\n  typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BitmapGlyphRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for bitmap glyph images.  This really is a        */\n  /*    `sub-class' of @FT_GlyphRec.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root   :: The root @FT_Glyph fields.                               */\n  /*                                                                       */\n  /*    left   :: The left-side bearing, i.e., the horizontal distance     */\n  /*              from the current pen position to the left border of the  */\n  /*              glyph bitmap.                                            */\n  /*                                                                       */\n  /*    top    :: The top-side bearing, i.e., the vertical distance from   */\n  /*              the current pen position to the top border of the glyph  */\n  /*              bitmap.  This distance is positive for upwards~y!        */\n  /*                                                                       */\n  /*    bitmap :: A descriptor for the bitmap.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_BITMAP'.  This lets you access   */\n  /*    the bitmap's contents easily.                                      */\n  /*                                                                       */\n  /*    The corresponding pixel buffer is always owned by @FT_BitmapGlyph  */\n  /*    and is thus created and destroyed with it.                         */\n  /*                                                                       */\n  typedef struct  FT_BitmapGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Int       left;\n    FT_Int       top;\n    FT_Bitmap    bitmap;\n\n  } FT_BitmapGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_OutlineGlyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model an outline glyph image.  This  */\n  /*    is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */\n  /*                                                                       */\n  typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_OutlineGlyphRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for outline (vectorial) glyph images.  This       */\n  /*    really is a `sub-class' of @FT_GlyphRec.                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root    :: The root @FT_Glyph fields.                              */\n  /*                                                                       */\n  /*    outline :: A descriptor for the outline.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have      */\n  /*    `glyph->format == FT_GLYPH_FORMAT_OUTLINE'.  This lets you access  */\n  /*    the outline's content easily.                                      */\n  /*                                                                       */\n  /*    As the outline is extracted from a glyph slot, its coordinates are */\n  /*    expressed normally in 26.6 pixels, unless the flag                 */\n  /*    @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */\n  /*                                                                       */\n  /*    The outline's tables are always owned by the object and are        */\n  /*    destroyed with it.                                                 */\n  /*                                                                       */\n  typedef struct  FT_OutlineGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Outline   outline;\n\n  } FT_OutlineGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to extract a glyph image from a slot.  Note that   */\n  /*    the created @FT_Glyph object must be released with @FT_Done_Glyph. */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot   :: A handle to the source glyph slot.                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: A handle to the glyph object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Copy                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to copy a glyph image.  Note that the created      */\n  /*    @FT_Glyph object must be released with @FT_Done_Glyph.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source glyph object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target glyph object.  0~in case of       */\n  /*              error.                                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Transform                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a glyph image if its format is scalable.                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    glyph  :: A handle to the target glyph object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to a 2x2 matrix to apply.                      */\n  /*                                                                       */\n  /*    delta  :: A pointer to a 2d vector to apply.  Coordinates are      */\n  /*              expressed in 1/64th of a pixel.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code (if not 0, the glyph format is not scalable).  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The 2x2 transformation matrix is also applied to the glyph's       */\n  /*    advance vector.                                                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_BBox_Mode                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The mode how the values of @FT_Glyph_Get_CBox are returned.        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_BBOX_UNSCALED ::                                          */\n  /*      Return unscaled font units.                                      */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_SUBPIXELS ::                                         */\n  /*      Return unfitted 26.6 coordinates.                                */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_GRIDFIT ::                                           */\n  /*      Return grid-fitted 26.6 coordinates.                             */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_TRUNCATE ::                                          */\n  /*      Return coordinates in integer pixels.                            */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_PIXELS ::                                            */\n  /*      Return grid-fitted pixel coordinates.                            */\n  /*                                                                       */\n  typedef enum  FT_Glyph_BBox_Mode_\n  {\n    FT_GLYPH_BBOX_UNSCALED  = 0,\n    FT_GLYPH_BBOX_SUBPIXELS = 0,\n    FT_GLYPH_BBOX_GRIDFIT   = 1,\n    FT_GLYPH_BBOX_TRUNCATE  = 2,\n    FT_GLYPH_BBOX_PIXELS    = 3\n\n  } FT_Glyph_BBox_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_bbox_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Glyph_BBox_Mode values instead.                                */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   ft_glyph_bbox_unscaled  :: See @FT_GLYPH_BBOX_UNSCALED.             */\n  /*   ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS.            */\n  /*   ft_glyph_bbox_gridfit   :: See @FT_GLYPH_BBOX_GRIDFIT.              */\n  /*   ft_glyph_bbox_truncate  :: See @FT_GLYPH_BBOX_TRUNCATE.             */\n  /*   ft_glyph_bbox_pixels    :: See @FT_GLYPH_BBOX_PIXELS.               */\n  /*                                                                       */\n#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED\n#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS\n#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT\n#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE\n#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Get_CBox                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a glyph's `control box'.  The control box encloses all the  */\n  /*    outline's points, including Bézier control points.  Though it      */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the source glyph object.                      */\n  /*                                                                       */\n  /*    mode  :: The mode which indicates how to interpret the returned    */\n  /*             bounding box values.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox :: The glyph coordinate bounding box.  Coordinates are       */\n  /*             expressed in 1/64th of pixels if it is grid-fitted.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Coordinates are relative to the glyph origin, using the y~upwards  */\n  /*    convention.                                                        */\n  /*                                                                       */\n  /*    If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode'   */\n  /*    must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font        */\n  /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */\n  /*    is another name for this constant.                                 */\n  /*                                                                       */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting CBox is meaningless.  To get      */\n  /*    reasonable values for the CBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the CBox  */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  /*    Note that the maximum coordinates are exclusive, which means that  */\n  /*    one can compute the width and height of the glyph image (be it in  */\n  /*    integer or 26.6 pixels) as:                                        */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      width  = bbox.xMax - bbox.xMin;                                  */\n  /*      height = bbox.yMax - bbox.yMin;                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note also that for 26.6 coordinates, if `bbox_mode' is set to      */\n  /*    @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,  */\n  /*    which corresponds to:                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      bbox.xMin = FLOOR(bbox.xMin);                                    */\n  /*      bbox.yMin = FLOOR(bbox.yMin);                                    */\n  /*      bbox.xMax = CEILING(bbox.xMax);                                  */\n  /*      bbox.yMax = CEILING(bbox.yMax);                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get the bbox in pixel coordinates, set `bbox_mode' to           */\n  /*    @FT_GLYPH_BBOX_TRUNCATE.                                           */\n  /*                                                                       */\n  /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */\n  /*    to @FT_GLYPH_BBOX_PIXELS.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_To_Bitmap                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph object to a bitmap glyph object.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    the_glyph   :: A pointer to a handle to the target glyph.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: An enumeration that describes how the data is       */\n  /*                   rendered.                                           */\n  /*                                                                       */\n  /*    origin      :: A pointer to a vector used to translate the glyph   */\n  /*                   image before rendering.  Can be~0 (if no            */\n  /*                   translation).  The origin is expressed in           */\n  /*                   26.6 pixels.                                        */\n  /*                                                                       */\n  /*    destroy     :: A boolean that indicates that the original glyph    */\n  /*                   image should be destroyed by this function.  It is  */\n  /*                   never destroyed in case of error.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does nothing if the glyph format isn't scalable.     */\n  /*                                                                       */\n  /*    The glyph image is translated with the `origin' vector before      */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  /*    The first parameter is a pointer to an @FT_Glyph handle, that will */\n  /*    be _replaced_ by this function (with newly allocated data).        */\n  /*    Typically, you would use (omitting error handling):                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph        glyph;                                         */\n  /*        FT_BitmapGlyph  glyph_bitmap;                                  */\n  /*                                                                       */\n  /*                                                                       */\n  /*        // load glyph                                                  */\n  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */\n  /*                                                                       */\n  /*        // extract glyph image                                         */\n  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */\n  /*                                                                       */\n  /*        // convert to a bitmap (default render mode + destroying old)  */\n  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */\n  /*        {                                                              */\n  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,   */\n  /*                                      0, 1 );                          */\n  /*          if ( error ) // `glyph' unchanged                            */\n  /*            ...                                                        */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        // access bitmap content by typecasting                        */\n  /*        glyph_bitmap = (FT_BitmapGlyph)glyph;                          */\n  /*                                                                       */\n  /*        // do funny stuff with it, like blitting/drawing               */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        // discard glyph image (bitmap or not)                         */\n  /*        FT_Done_Glyph( glyph );                                        */\n  /*      }                                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*    Here another example, again without error handling:                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph  glyphs[MAX_GLYPHS]                                   */\n  /*                                                                       */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       */\n  /*                  FT_Get_Glyph ( face->glyph, &glyph[idx] );           */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*        {                                                              */\n  /*          FT_Glyph  bitmap = glyphs[idx];                              */\n  /*                                                                       */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          // after this call, `bitmap' no longer points into           */\n  /*          // the `glyphs' array (and the old value isn't destroyed)    */\n  /*          FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );    */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          FT_Done_Glyph( bitmap );                                     */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          FT_Done_Glyph( glyphs[idx] );                                */\n  /*      }                                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given glyph.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the target glyph object.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Done_Glyph( FT_Glyph  glyph );\n\n  /* */\n\n\n  /* other helpful functions */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Multiply                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Perform the matrix operation `b = a*b'.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: A pointer to matrix `a'.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    b :: A pointer to matrix `b'.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `a' or `b' is zero.              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix*        b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invert a 2x2 matrix.  Return an error if it can't be inverted.     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    matrix :: A pointer to the target matrix.  Remains untouched in    */\n  /*              case of error.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLYPH_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGXVAL_H__\n#define __FTGXVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gx_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueTypeGX/AAT Validation                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate TrueTypeGX/AAT tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */\n  /*    trak, prop, lcar).                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                                                                       */\n  /* Warning: Use FT_VALIDATE_XXX to validate a table.                     */\n  /*          Following definitions are for gxvalid developers.            */\n  /*                                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_VALIDATE_feat_INDEX     0\n#define FT_VALIDATE_mort_INDEX     1\n#define FT_VALIDATE_morx_INDEX     2\n#define FT_VALIDATE_bsln_INDEX     3\n#define FT_VALIDATE_just_INDEX     4\n#define FT_VALIDATE_kern_INDEX     5\n#define FT_VALIDATE_opbd_INDEX     6\n#define FT_VALIDATE_trak_INDEX     7\n#define FT_VALIDATE_prop_INDEX     8\n#define FT_VALIDATE_lcar_INDEX     9\n#define FT_VALIDATE_GX_LAST_INDEX  FT_VALIDATE_lcar_INDEX\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_VALIDATE_GX_LENGTH\n   *\n   * @description:\n   *   The number of tables checked in this module.  Use it as a parameter\n   *   for the `table-length' argument of function @FT_TrueTypeGX_Validate.\n   */\n#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n  /* */\n\n  /* Up to 0x1000 is used by otvalid.\n     Ox2xxx is reserved for feature OT extension. */\n#define FT_VALIDATE_GX_START 0x4000\n#define FT_VALIDATE_GX_BITFIELD( tag )                  \\\n  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_GXXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_TrueTypeGX_Validate to\n  *    indicate which TrueTypeGX/AAT Type tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_feat ::\n  *      Validate `feat' table.\n  *\n  *    FT_VALIDATE_mort ::\n  *      Validate `mort' table.\n  *\n  *    FT_VALIDATE_morx ::\n  *      Validate `morx' table.\n  *\n  *    FT_VALIDATE_bsln ::\n  *      Validate `bsln' table.\n  *\n  *    FT_VALIDATE_just ::\n  *      Validate `just' table.\n  *\n  *    FT_VALIDATE_kern ::\n  *      Validate `kern' table.\n  *\n  *    FT_VALIDATE_opbd ::\n  *      Validate `opbd' table.\n  *\n  *    FT_VALIDATE_trak ::\n  *      Validate `trak' table.\n  *\n  *    FT_VALIDATE_prop ::\n  *      Validate `prop' table.\n  *\n  *    FT_VALIDATE_lcar ::\n  *      Validate `lcar' table.\n  *\n  *    FT_VALIDATE_GX ::\n  *      Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,\n  *      opbd, trak, prop and lcar).\n  *\n  */\n\n#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )\n#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )\n#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )\n#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )\n#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )\n#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )\n#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )\n#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )\n#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )\n#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \\\n                          FT_VALIDATE_mort | \\\n                          FT_VALIDATE_morx | \\\n                          FT_VALIDATE_bsln | \\\n                          FT_VALIDATE_just | \\\n                          FT_VALIDATE_kern | \\\n                          FT_VALIDATE_opbd | \\\n                          FT_VALIDATE_trak | \\\n                          FT_VALIDATE_prop | \\\n                          FT_VALIDATE_lcar )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Validate\n  *\n  * @description:\n  *    Validate various TrueTypeGX tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_GXXXX for possible values.\n  *\n  *    table_length ::\n  *       The size of the `tables' array.  Normally, @FT_VALIDATE_GX_LENGTH\n  *       should be passed.\n  *\n  * @output:\n  *    tables ::\n  *       The array where all validated sfnt tables are stored.\n  *       The array itself must be allocated by a client.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with TrueTypeGX fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the buffers pointed to by\n  *   each `tables' element, by calling @FT_TrueTypeGX_Free.  A NULL value\n  *   indicates that the table either doesn't exist in the font, the\n  *   application hasn't asked for validation, or the validator doesn't have\n  *   the ability to validate the sfnt table.\n  */\n  FT_EXPORT( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Free\n  *\n  * @description:\n  *    Free the buffer allocated by TrueTypeGX validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer allocated by\n  *       @FT_TrueTypeGX_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_TrueTypeGX_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_CKERNXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_ClassicKern_Validate\n  *    to indicate the classic kern dialect or dialects.  If the selected\n  *    type doesn't fit, @FT_ClassicKern_Validate regards the table as\n  *    invalid.\n  *\n  * @values:\n  *    FT_VALIDATE_MS ::\n  *      Handle the `kern' table as a classic Microsoft kern table.\n  *\n  *    FT_VALIDATE_APPLE ::\n  *      Handle the `kern' table as a classic Apple kern table.\n  *\n  *    FT_VALIDATE_CKERN ::\n  *      Handle the `kern' as either classic Apple or Microsoft kern table.\n  */\n#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )\n#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )\n\n#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Validate\n  *\n  * @description:\n  *    Validate classic (16-bit format) kern table to assure that the offsets\n  *    and indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without error\n  *    checking (which can be quite time consuming).\n  *\n  *    The `kern' table validator in @FT_TrueTypeGX_Validate deals with both\n  *    the new 32-bit format and the classic 16-bit format, while\n  *    FT_ClassicKern_Validate only supports the classic 16-bit format.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the dialect to be validated.  See\n  *       @FT_VALIDATE_CKERNXXX for possible values.\n  *\n  * @output:\n  *    ckern_table ::\n  *       A pointer to the kern table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   After use, the application should deallocate the buffers pointed to by\n  *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value\n  *   indicates that the table doesn't exist in the font.\n  */\n  FT_EXPORT( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Free\n  *\n  * @description:\n  *    Free the buffer allocated by classic Kern validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_ClassicKern_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_ClassicKern_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftgzip.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.h                                                               */\n/*                                                                         */\n/*    Gzip-compressed stream support.                                      */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGZIP_H__\n#define __FTGZIP_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gzip                                                               */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    GZIP Streams                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using gzip-compressed font files.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Gzip-specific functions.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenGzip\n  *\n  * @description:\n  *   Open a new stream to parse gzip-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.gz' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, gzip compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a gzipped stream from\n  *   it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGZIP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftimage.h                                                              */\n/*                                                                         */\n/*    FreeType glyph image formats and default raster interface            */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2010, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Note: A `raster' is simply a scan-line converter, used to render      */\n  /*       FT_Outlines into FT_Bitmaps.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTIMAGE_H__\n#define __FTIMAGE_H__\n\n\n  /* _STANDALONE_ is from ftgrays.c */\n#ifndef _STANDALONE_\n#include <ft2build.h>\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pos                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The type FT_Pos is used to store vectorial coordinates.  Depending */\n  /*    on the context, these can represent distances in integer font      */\n  /*    units, or 16.16, or 26.6 fixed-point pixel coordinates.            */\n  /*                                                                       */\n  typedef signed long  FT_Pos;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Vector                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector; coordinates are of   */\n  /*    the FT_Pos type.                                                   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: The horizontal coordinate.                                    */\n  /*    y :: The vertical coordinate.                                      */\n  /*                                                                       */\n  typedef struct  FT_Vector_\n  {\n    FT_Pos  x;\n    FT_Pos  y;\n\n  } FT_Vector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BBox                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold an outline's bounding box, i.e., the      */\n  /*    coordinates of its extrema in the horizontal and vertical          */\n  /*    directions.                                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xMin :: The horizontal minimum (left-most).                        */\n  /*                                                                       */\n  /*    yMin :: The vertical minimum (bottom-most).                        */\n  /*                                                                       */\n  /*    xMax :: The horizontal maximum (right-most).                       */\n  /*                                                                       */\n  /*    yMax :: The vertical maximum (top-most).                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The bounding box is specified with the coordinates of the lower    */\n  /*    left and the upper right corner.  In PostScript, those values are  */\n  /*    often called (llx,lly) and (urx,ury), respectively.                */\n  /*                                                                       */\n  /*    If `yMin' is negative, this value gives the glyph's descender.     */\n  /*    Otherwise, the glyph doesn't descend below the baseline.           */\n  /*    Similarly, if `ymax' is positive, this value gives the glyph's     */\n  /*    ascender.                                                          */\n  /*                                                                       */\n  /*    `xMin' gives the horizontal distance from the glyph's origin to    */\n  /*    the left edge of the glyph's bounding box.  If `xMin' is negative, */\n  /*    the glyph extends to the left of the origin.                       */\n  /*                                                                       */\n  typedef struct  FT_BBox_\n  {\n    FT_Pos  xMin, yMin;\n    FT_Pos  xMax, yMax;\n\n  } FT_BBox;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Pixel_Mode                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of pixels in a     */\n  /*    given bitmap.  Note that additional formats may be added in the    */\n  /*    future.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_PIXEL_MODE_NONE ::                                              */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_MONO ::                                              */\n  /*      A monochrome bitmap, using 1~bit per pixel.  Note that pixels    */\n  /*      are stored in most-significant order (MSB), which means that     */\n  /*      the left-most pixel in a byte has value 128.                     */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY ::                                              */\n  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */\n  /*      images.  Each pixel is stored in one byte.  Note that the number */\n  /*      of `gray' levels is stored in the `num_grays' field of the       */\n  /*      @FT_Bitmap structure (it generally is 256).                      */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY2 ::                                             */\n  /*      A 2-bit per pixel bitmap, used to represent embedded             */\n  /*      anti-aliased bitmaps in font files according to the OpenType     */\n  /*      specification.  We haven't found a single font using this        */\n  /*      format, however.                                                 */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY4 ::                                             */\n  /*      A 4-bit per pixel bitmap, representing embedded anti-aliased     */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD ::                                               */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on LCD displays; the bitmap is three times      */\n  /*      wider than the original glyph image.  See also                   */\n  /*      @FT_RENDER_MODE_LCD.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD_V ::                                             */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on rotated LCD displays; the bitmap is three    */\n  /*      times taller than the original glyph image.  See also            */\n  /*      @FT_RENDER_MODE_LCD_V.                                           */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_BGRA ::                                              */\n  /*      An image with four 8-bit channels per pixel, representing a      */\n  /*      color image (such as emoticons) with alpha channel.  For each    */\n  /*      pixel, the format is BGRA, which means, the blue channel comes   */\n  /*      first in memory.  The color channels are pre-multiplied and in   */\n  /*      the sRGB colorspace.  For example, full red at half-translucent  */\n  /*      opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */\n  /*      See also @FT_LOAD_COLOR.                                         */\n  /*                                                                       */\n  typedef enum  FT_Pixel_Mode_\n  {\n    FT_PIXEL_MODE_NONE = 0,\n    FT_PIXEL_MODE_MONO,\n    FT_PIXEL_MODE_GRAY,\n    FT_PIXEL_MODE_GRAY2,\n    FT_PIXEL_MODE_GRAY4,\n    FT_PIXEL_MODE_LCD,\n    FT_PIXEL_MODE_LCD_V,\n    FT_PIXEL_MODE_BGRA,\n\n    FT_PIXEL_MODE_MAX      /* do not remove */\n\n  } FT_Pixel_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_pixel_mode_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Pixel_Mode values instead.                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_pixel_mode_none  :: See @FT_PIXEL_MODE_NONE.                    */\n  /*    ft_pixel_mode_mono  :: See @FT_PIXEL_MODE_MONO.                    */\n  /*    ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY.                    */\n  /*    ft_pixel_mode_pal2  :: See @FT_PIXEL_MODE_GRAY2.                   */\n  /*    ft_pixel_mode_pal4  :: See @FT_PIXEL_MODE_GRAY4.                   */\n  /*                                                                       */\n#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE\n#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO\n#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY\n#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2\n#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4\n\n /* */\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Palette_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT!                           */\n  /*                                                                       */\n  /*    An enumeration type to describe the format of a bitmap palette,    */\n  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_palette_mode_rgb  :: The palette is an array of 3-byte RGB      */\n  /*                            records.                                   */\n  /*                                                                       */\n  /*    ft_palette_mode_rgba :: The palette is an array of 4-byte RGBA     */\n  /*                            records.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by       */\n  /*    FreeType, these types are not handled by the library itself.       */\n  /*                                                                       */\n  typedef enum  FT_Palette_Mode_\n  {\n    ft_palette_mode_rgb = 0,\n    ft_palette_mode_rgba,\n\n    ft_palette_mode_max   /* do not remove */\n\n  } FT_Palette_Mode;\n\n  /* */\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a bitmap or pixmap to the raster.     */\n  /*    Note that we now manage pixmaps of various depths through the      */\n  /*    `pixel_mode' field.                                                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    rows         :: The number of bitmap rows.                         */\n  /*                                                                       */\n  /*    width        :: The number of pixels in bitmap row.                */\n  /*                                                                       */\n  /*    pitch        :: The pitch's absolute value is the number of bytes  */\n  /*                    taken by one bitmap row, including padding.        */\n  /*                    However, the pitch is positive when the bitmap has */\n  /*                    a `down' flow, and negative when it has an `up'    */\n  /*                    flow.  In all cases, the pitch is an offset to add */\n  /*                    to a bitmap pointer in order to go down one row.   */\n  /*                                                                       */\n  /*                    Note that `padding' means the alignment of a       */\n  /*                    bitmap to a byte border, and FreeType functions    */\n  /*                    normally align to the smallest possible integer    */\n  /*                    value.                                             */\n  /*                                                                       */\n  /*                    For the B/W rasterizer, `pitch' is always an even  */\n  /*                    number.                                            */\n  /*                                                                       */\n  /*                    To change the pitch of a bitmap (say, to make it a */\n  /*                    multiple of 4), use @FT_Bitmap_Convert.            */\n  /*                    Alternatively, you might use callback functions to */\n  /*                    directly render to the application's surface; see  */\n  /*                    the file `example2.cpp' in the tutorial for a      */\n  /*                    demonstration.                                     */\n  /*                                                                       */\n  /*    buffer       :: A typeless pointer to the bitmap buffer.  This     */\n  /*                    value should be aligned on 32-bit boundaries in    */\n  /*                    most cases.                                        */\n  /*                                                                       */\n  /*    num_grays    :: This field is only used with                       */\n  /*                    @FT_PIXEL_MODE_GRAY; it gives the number of gray   */\n  /*                    levels used in the bitmap.                         */\n  /*                                                                       */\n  /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */\n  /*                    See @FT_Pixel_Mode for possible values.            */\n  /*                                                                       */\n  /*    palette_mode :: This field is intended for paletted pixel modes;   */\n  /*                    it indicates how the palette is stored.  Not       */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /*    palette      :: A typeless pointer to the bitmap palette; this     */\n  /*                    field is intended for paletted pixel modes.  Not   */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   For now, the only pixel modes supported by FreeType are mono and    */\n  /*   grays.  However, drivers might be added in the future to support    */\n  /*   more `colorful' options.                                            */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_\n  {\n    int             rows;\n    int             width;\n    int             pitch;\n    unsigned char*  buffer;\n    short           num_grays;\n    char            pixel_mode;\n    char            palette_mode;\n    void*           palette;\n\n  } FT_Bitmap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure is used to describe an outline to the scan-line     */\n  /*    converter.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    n_contours :: The number of contours in the outline.               */\n  /*                                                                       */\n  /*    n_points   :: The number of points in the outline.                 */\n  /*                                                                       */\n  /*    points     :: A pointer to an array of `n_points' @FT_Vector       */\n  /*                  elements, giving the outline's point coordinates.    */\n  /*                                                                       */\n  /*    tags       :: A pointer to an array of `n_points' chars, giving    */\n  /*                  each outline point's type.                           */\n  /*                                                                       */\n  /*                  If bit~0 is unset, the point is `off' the curve,     */\n  /*                  i.e., a Bézier control point, while it is `on' if    */\n  /*                  set.                                                 */\n  /*                                                                       */\n  /*                  Bit~1 is meaningful for `off' points only.  If set,  */\n  /*                  it indicates a third-order Bézier arc control point; */\n  /*                  and a second-order control point if unset.           */\n  /*                                                                       */\n  /*                  If bit~2 is set, bits 5-7 contain the drop-out mode  */\n  /*                  (as defined in the OpenType specification; the value */\n  /*                  is the same as the argument to the SCANMODE          */\n  /*                  instruction).                                        */\n  /*                                                                       */\n  /*                  Bits 3 and~4 are reserved for internal purposes.     */\n  /*                                                                       */\n  /*    contours   :: An array of `n_contours' shorts, giving the end      */\n  /*                  point of each contour within the outline.  For       */\n  /*                  example, the first contour is defined by the points  */\n  /*                  `0' to `contours[0]', the second one is defined by   */\n  /*                  the points `contours[0]+1' to `contours[1]', etc.    */\n  /*                                                                       */\n  /*    flags      :: A set of bit flags used to characterize the outline  */\n  /*                  and give hints to the scan-converter and hinter on   */\n  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_FLAGS.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The B/W rasterizer only checks bit~2 in the `tags' array for the   */\n  /*    first point of each contour.  The drop-out mode as given with      */\n  /*    @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and       */\n  /*    @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden.           */\n  /*                                                                       */\n  typedef struct  FT_Outline_\n  {\n    short       n_contours;      /* number of contours in glyph        */\n    short       n_points;        /* number of points in the glyph      */\n\n    FT_Vector*  points;          /* the outline's points               */\n    char*       tags;            /* the points flags                   */\n    short*      contours;        /* the contour end points             */\n\n    int         flags;           /* outline masks                      */\n\n  } FT_Outline;\n\n  /* Following limits must be consistent with */\n  /* FT_Outline.{n_contours,n_points}         */\n#define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX\n#define FT_OUTLINE_POINTS_MAX    SHRT_MAX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants use for the flags in an outline's    */\n  /*    `flags' field.                                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OUTLINE_NONE ::                                                 */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_OUTLINE_OWNER ::                                                */\n  /*      If set, this flag indicates that the outline's field arrays      */\n  /*      (i.e., `points', `flags', and `contours') are `owned' by the     */\n  /*      outline object, and should thus be freed when it is destroyed.   */\n  /*                                                                       */\n  /*    FT_OUTLINE_EVEN_ODD_FILL ::                                        */\n  /*      By default, outlines are filled using the non-zero winding rule. */\n  /*      If set to 1, the outline will be filled using the even-odd fill  */\n  /*      rule (only works with the smooth rasterizer).                    */\n  /*                                                                       */\n  /*    FT_OUTLINE_REVERSE_FILL ::                                         */\n  /*      By default, outside contours of an outline are oriented in       */\n  /*      clock-wise direction, as defined in the TrueType specification.  */\n  /*      This flag is set if the outline uses the opposite direction      */\n  /*      (typically for Type~1 fonts).  This flag is ignored by the scan  */\n  /*      converter.                                                       */\n  /*                                                                       */\n  /*    FT_OUTLINE_IGNORE_DROPOUTS ::                                      */\n  /*      By default, the scan converter will try to detect drop-outs in   */\n  /*      an outline and correct the glyph bitmap to ensure consistent     */\n  /*      shape continuity.  If set, this flag hints the scan-line         */\n  /*      converter to ignore such cases.  See below for more information. */\n  /*                                                                       */\n  /*    FT_OUTLINE_SMART_DROPOUTS ::                                       */\n  /*      Select smart dropout control.  If unset, use simple dropout      */\n  /*      control.  Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See    */\n  /*      below for more information.                                      */\n  /*                                                                       */\n  /*    FT_OUTLINE_INCLUDE_STUBS ::                                        */\n  /*      If set, turn pixels on for `stubs', otherwise exclude them.      */\n  /*      Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See below for    */\n  /*      more information.                                                */\n  /*                                                                       */\n  /*    FT_OUTLINE_HIGH_PRECISION ::                                       */\n  /*      This flag indicates that the scan-line converter should try to   */\n  /*      convert this outline to bitmaps with the highest possible        */\n  /*      quality.  It is typically set for small character sizes.  Note   */\n  /*      that this is only a hint that might be completely ignored by a   */\n  /*      given scan-converter.                                            */\n  /*                                                                       */\n  /*    FT_OUTLINE_SINGLE_PASS ::                                          */\n  /*      This flag is set to force a given scan-converter to only use a   */\n  /*      single pass over the outline to render a bitmap glyph image.     */\n  /*      Normally, it is set for very large character sizes.  It is only  */\n  /*      a hint that might be completely ignored by a given               */\n  /*      scan-converter.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */\n  /*    and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth            */\n  /*    rasterizer.                                                        */\n  /*                                                                       */\n  /*    There exists a second mechanism to pass the drop-out mode to the   */\n  /*    B/W rasterizer; see the `tags' field in @FT_Outline.               */\n  /*                                                                       */\n  /*    Please refer to the description of the `SCANTYPE' instruction in   */\n  /*    the OpenType specification (in file `ttinst1.doc') how simple      */\n  /*    drop-outs, smart drop-outs, and stubs are defined.                 */\n  /*                                                                       */\n#define FT_OUTLINE_NONE             0x0\n#define FT_OUTLINE_OWNER            0x1\n#define FT_OUTLINE_EVEN_ODD_FILL    0x2\n#define FT_OUTLINE_REVERSE_FILL     0x4\n#define FT_OUTLINE_IGNORE_DROPOUTS  0x8\n#define FT_OUTLINE_SMART_DROPOUTS   0x10\n#define FT_OUTLINE_INCLUDE_STUBS    0x20\n\n#define FT_OUTLINE_HIGH_PRECISION   0x100\n#define FT_OUTLINE_SINGLE_PASS      0x200\n\n\n /*************************************************************************\n  *\n  * @enum:\n  *   ft_outline_flags\n  *\n  * @description:\n  *   These constants are deprecated.  Please use the corresponding\n  *   @FT_OUTLINE_FLAGS values.\n  *\n  * @values:\n  *   ft_outline_none            :: See @FT_OUTLINE_NONE.\n  *   ft_outline_owner           :: See @FT_OUTLINE_OWNER.\n  *   ft_outline_even_odd_fill   :: See @FT_OUTLINE_EVEN_ODD_FILL.\n  *   ft_outline_reverse_fill    :: See @FT_OUTLINE_REVERSE_FILL.\n  *   ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.\n  *   ft_outline_high_precision  :: See @FT_OUTLINE_HIGH_PRECISION.\n  *   ft_outline_single_pass     :: See @FT_OUTLINE_SINGLE_PASS.\n  */\n#define ft_outline_none             FT_OUTLINE_NONE\n#define ft_outline_owner            FT_OUTLINE_OWNER\n#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL\n#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL\n#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS\n#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION\n#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS\n\n  /* */\n\n#define FT_CURVE_TAG( flag )  ( flag & 3 )\n\n#define FT_CURVE_TAG_ON            1\n#define FT_CURVE_TAG_CONIC         0\n#define FT_CURVE_TAG_CUBIC         2\n\n#define FT_CURVE_TAG_HAS_SCANMODE  4\n\n#define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */\n#define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */\n\n#define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \\\n                                     FT_CURVE_TAG_TOUCH_Y )\n\n#define FT_Curve_Tag_On       FT_CURVE_TAG_ON\n#define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC\n#define FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC\n#define FT_Curve_Tag_Touch_X  FT_CURVE_TAG_TOUCH_X\n#define FT_Curve_Tag_Touch_Y  FT_CURVE_TAG_TOUCH_Y\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `move  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `move to' is emitted to start a new contour in an outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `move to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_LineToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `line  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `line to' is emitted to indicate a segment in the outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `line to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_LineToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `conic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `conic to' is emitted to indicate a second-order Bézier arc in   */\n  /*    the outline.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: An intermediate control point between the last position */\n  /*               and the new target in `to'.                             */\n  /*                                                                       */\n  /*    to      :: A pointer to the target end point of the conic arc.     */\n  /*                                                                       */\n  /*    user    :: A typeless pointer which is passed from the caller of   */\n  /*               the decomposition function.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `cubic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `cubic to' is emitted to indicate a third-order Bézier arc.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first Bézier control point.           */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second Bézier control point.          */\n  /*                                                                       */\n  /*    to       :: A pointer to the target end point.                     */\n  /*                                                                       */\n  /*    user     :: A typeless pointer which is passed from the caller of  */\n  /*                the decomposition function.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,\n                             const FT_Vector*  control2,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline_Funcs                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold various function pointers used during outline  */\n  /*    decomposition in order to emit segments, conic, and cubic Béziers. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    move_to  :: The `move to' emitter.                                 */\n  /*                                                                       */\n  /*    line_to  :: The segment emitter.                                   */\n  /*                                                                       */\n  /*    conic_to :: The second-order Bézier arc emitter.                   */\n  /*                                                                       */\n  /*    cubic_to :: The third-order Bézier arc emitter.                    */\n  /*                                                                       */\n  /*    shift    :: The shift that is applied to coordinates before they   */\n  /*                are sent to the emitter.                               */\n  /*                                                                       */\n  /*    delta    :: The delta that is applied to coordinates before they   */\n  /*                are sent to the emitter, but after the shift.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The point coordinates sent to the emitters are the transformed     */\n  /*    version of the original coordinates (this is important for high    */\n  /*    accuracy during scan-conversion).  The transformation is simple:   */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      x' = (x << shift) - delta                                        */\n  /*      y' = (x << shift) - delta                                        */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Set the values of `shift' and `delta' to~0 to get the original     */\n  /*    point coordinates.                                                 */\n  /*                                                                       */\n  typedef struct  FT_Outline_Funcs_\n  {\n    FT_Outline_MoveToFunc   move_to;\n    FT_Outline_LineToFunc   line_to;\n    FT_Outline_ConicToFunc  conic_to;\n    FT_Outline_CubicToFunc  cubic_to;\n\n    int                     shift;\n    FT_Pos                  delta;\n\n  } FT_Outline_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags to an unsigned long type.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n#ifndef FT_IMAGE_TAG\n#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \\\n          value = ( ( (unsigned long)_x1 << 24 ) | \\\n                    ( (unsigned long)_x2 << 16 ) | \\\n                    ( (unsigned long)_x3 << 8  ) | \\\n                      (unsigned long)_x4         )\n#endif /* FT_IMAGE_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_Format                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of a given glyph   */\n  /*    image.  Note that this version of FreeType only supports two image */\n  /*    formats, even though future font drivers will be able to register  */\n  /*    their own format.                                                  */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_FORMAT_NONE ::                                            */\n  /*      The value~0 is reserved.                                         */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */\n  /*      The glyph image is a composite of several other images.  This    */\n  /*      format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to   */\n  /*      report compound glyphs (like accented characters).               */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_BITMAP ::                                          */\n  /*      The glyph image is a bitmap, and can be described as an          */\n  /*      @FT_Bitmap.  You generally need to access the `bitmap' field of  */\n  /*      the @FT_GlyphSlotRec structure to read it.                       */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_OUTLINE ::                                         */\n  /*      The glyph image is a vectorial outline made of line segments     */\n  /*      and Bézier arcs; it can be described as an @FT_Outline; you      */\n  /*      generally want to access the `outline' field of the              */\n  /*      @FT_GlyphSlotRec structure to read it.                           */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */\n  /*      The glyph image is a vectorial path with no inside and outside   */\n  /*      contours.  Some Type~1 fonts, like those in the Hershey family,  */\n  /*      contain glyphs in this format.  These are described as           */\n  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */\n  /*      them correctly.                                                  */\n  /*                                                                       */\n  typedef enum  FT_Glyph_Format_\n  {\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),\n\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )\n\n  } FT_Glyph_Format;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_format_xxx                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Glyph_Format values instead.                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_glyph_format_none      :: See @FT_GLYPH_FORMAT_NONE.            */\n  /*    ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE.       */\n  /*    ft_glyph_format_bitmap    :: See @FT_GLYPH_FORMAT_BITMAP.          */\n  /*    ft_glyph_format_outline   :: See @FT_GLYPH_FORMAT_OUTLINE.         */\n  /*    ft_glyph_format_plotter   :: See @FT_GLYPH_FORMAT_PLOTTER.         */\n  /*                                                                       */\n#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE\n#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE\n#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP\n#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE\n#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            R A S T E R   D E F I N I T I O N S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A raster is a scan converter, in charge of rendering an outline into  */\n  /* a a bitmap.  This section contains the public API for rasters.        */\n  /*                                                                       */\n  /* Note that in FreeType 2, all rasters are now encapsulated within      */\n  /* specific modules called `renderers'.  See `freetype/ftrender.h' for   */\n  /* more details on renderers.                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    raster                                                             */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Scanline Converter                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How vectorial outlines are converted into bitmaps and pixmaps.     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains technical definitions.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Raster                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle (pointer) to a raster object.  Each object can be used    */\n  /*    independently to convert an outline into a bitmap or pixmap.       */\n  /*                                                                       */\n  typedef struct FT_RasterRec_*  FT_Raster;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Span                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a single span of gray (or black) pixels  */\n  /*    when rendering a monochrome or anti-aliased bitmap.                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x        :: The span's horizontal start position.                  */\n  /*                                                                       */\n  /*    len      :: The span's length in pixels.                           */\n  /*                                                                       */\n  /*    coverage :: The span color/coverage, ranging from 0 (background)   */\n  /*                to 255 (foreground).  Only used for anti-aliased       */\n  /*                rendering.                                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is used by the span drawing callback type named     */\n  /*    @FT_SpanFunc which takes the y~coordinate of the span as a         */\n  /*    a parameter.                                                       */\n  /*                                                                       */\n  /*    The coverage value is always between 0 and 255.  If you want less  */\n  /*    gray values, the callback function has to reduce them.             */\n  /*                                                                       */\n  typedef struct  FT_Span_\n  {\n    short           x;\n    unsigned short  len;\n    unsigned char   coverage;\n\n  } FT_Span;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used as a call-back by the anti-aliased renderer in     */\n  /*    order to let client applications draw themselves the gray pixel    */\n  /*    spans on each scan line.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The scanline's y~coordinate.                              */\n  /*                                                                       */\n  /*    count :: The number of spans to draw on this scanline.             */\n  /*                                                                       */\n  /*    spans :: A table of `count' spans to draw on the scanline.         */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This callback allows client applications to directly render the    */\n  /*    gray spans of the anti-aliased bitmap to any kind of surfaces.     */\n  /*                                                                       */\n  /*    This can be used to write anti-aliased outlines directly to a      */\n  /*    given background bitmap, and even perform translucency.            */\n  /*                                                                       */\n  /*    Note that the `count' field cannot be greater than a fixed value   */\n  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */\n  /*    `ftoption.h'.  By default, this value is set to~32, which means    */\n  /*    that if there are more than 32~spans on a given scanline, the      */\n  /*    callback is called several times with the same `y' parameter in    */\n  /*    order to draw all callbacks.                                       */\n  /*                                                                       */\n  /*    Otherwise, the callback is only called once per scan-line, and     */\n  /*    only for those scanlines that do have `gray' pixels on them.       */\n  /*                                                                       */\n  typedef void\n  (*FT_SpanFunc)( int             y,\n                  int             count,\n                  const FT_Span*  spans,\n                  void*           user );\n\n#define FT_Raster_Span_Func  FT_SpanFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitTest_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to test whether a given target pixel is already set to the drawing */\n  /*    `color'.  These tests are crucial to implement drop-out control    */\n  /*    per-se the TrueType spec.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   1~if the pixel is `set', 0~otherwise.                               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_BitTest_Func)( int    y,\n                             int    x,\n                             void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitSet_Func                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to set an individual target pixel.  This is crucial to implement   */\n  /*    drop-out control according to the TrueType specification.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y~coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x~coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if the pixel is `set', 0~otherwise.                              */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_BitSet_Func)( int    y,\n                            int    x,\n                            void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flag constants as used in the `flags' field of a     */\n  /*    @FT_Raster_Params structure.                                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RASTER_FLAG_DEFAULT :: This value is 0.                         */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_AA      :: This flag is set to indicate that an     */\n  /*                              anti-aliased glyph image should be       */\n  /*                              generated.  Otherwise, it will be        */\n  /*                              monochrome (1-bit).                      */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct      */\n  /*                              rendering.  In this mode, client         */\n  /*                              applications must provide their own span */\n  /*                              callback.  This lets them directly       */\n  /*                              draw or compose over an existing bitmap. */\n  /*                              If this bit is not set, the target       */\n  /*                              pixmap's buffer _must_ be zeroed before  */\n  /*                              rendering.                               */\n  /*                                                                       */\n  /*                              Note that for now, direct rendering is   */\n  /*                              only possible with anti-aliased glyphs.  */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */\n  /*                              rendering mode.  If set, the output will */\n  /*                              be clipped to a box specified in the     */\n  /*                              `clip_box' field of the                  */\n  /*                              @FT_Raster_Params structure.             */\n  /*                                                                       */\n  /*                              Note that by default, the glyph bitmap   */\n  /*                              is clipped to the target pixmap, except  */\n  /*                              in direct rendering mode where all spans */\n  /*                              are generated if no clipping box is set. */\n  /*                                                                       */\n#define FT_RASTER_FLAG_DEFAULT  0x0\n#define FT_RASTER_FLAG_AA       0x1\n#define FT_RASTER_FLAG_DIRECT   0x2\n#define FT_RASTER_FLAG_CLIP     0x4\n\n  /* deprecated */\n#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT\n#define ft_raster_flag_aa       FT_RASTER_FLAG_AA\n#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT\n#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Params                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold the arguments used by a raster's render        */\n  /*    function.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    target      :: The target bitmap.                                  */\n  /*                                                                       */\n  /*    source      :: A pointer to the source glyph image (e.g., an       */\n  /*                   @FT_Outline).                                       */\n  /*                                                                       */\n  /*    flags       :: The rendering flags.                                */\n  /*                                                                       */\n  /*    gray_spans  :: The gray span drawing callback.                     */\n  /*                                                                       */\n  /*    black_spans :: The black span drawing callback.  UNIMPLEMENTED!    */\n  /*                                                                       */\n  /*    bit_test    :: The bit test callback.  UNIMPLEMENTED!              */\n  /*                                                                       */\n  /*    bit_set     :: The bit set callback.  UNIMPLEMENTED!               */\n  /*                                                                       */\n  /*    user        :: User-supplied data that is passed to each drawing   */\n  /*                   callback.                                           */\n  /*                                                                       */\n  /*    clip_box    :: An optional clipping box.  It is only used in       */\n  /*                   direct rendering mode.  Note that coordinates here  */\n  /*                   should be expressed in _integer_ pixels (and not in */\n  /*                   26.6 fixed-point units).                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA    */\n  /*    bit flag is set in the `flags' field, otherwise a monochrome       */\n  /*    bitmap is generated.                                               */\n  /*                                                                       */\n  /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */\n  /*    raster will call the `gray_spans' callback to draw gray pixel      */\n  /*    spans, in the case of an aa glyph bitmap, it will call             */\n  /*    `black_spans', and `bit_test' and `bit_set' in the case of a       */\n  /*    monochrome bitmap.  This allows direct composition over a          */\n  /*    pre-existing bitmap through user-provided callbacks to perform the */\n  /*    span drawing/composition.                                          */\n  /*                                                                       */\n  /*    Note that the `bit_test' and `bit_set' callbacks are required when */\n  /*    rendering a monochrome bitmap, as they are crucial to implement    */\n  /*    correct drop-out control as defined in the TrueType specification. */\n  /*                                                                       */\n  typedef struct  FT_Raster_Params_\n  {\n    const FT_Bitmap*        target;\n    const void*             source;\n    int                     flags;\n    FT_SpanFunc             gray_spans;\n    FT_SpanFunc             black_spans;  /* doesn't work! */\n    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */\n    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */\n    void*                   user;\n    FT_BBox                 clip_box;\n\n  } FT_Raster_Params;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_NewFunc                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create a new raster object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory allocator.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `memory' parameter is a typeless pointer in order to avoid     */\n  /*    un-wanted dependencies on the rest of the FreeType code.  In       */\n  /*    practice, it is an @FT_Memory object, i.e., a handle to the        */\n  /*    standard FreeType memory allocator.  However, this field can be    */\n  /*    completely ignored by a given raster implementation.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_NewFunc)( void*       memory,\n                        FT_Raster*  raster );\n\n#define FT_Raster_New_Func  FT_Raster_NewFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy a given raster object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_DoneFunc)( FT_Raster  raster );\n\n#define FT_Raster_Done_Func  FT_Raster_DoneFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_ResetFunc                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType provides an area of memory called the `render pool',      */\n  /*    available to all registered rasters.  This pool can be freely used */\n  /*    during a given scan-conversion but is shared by all rasters.  Its  */\n  /*    content is thus transient.                                         */\n  /*                                                                       */\n  /*    This function is called each time the render pool changes, or just */\n  /*    after a new raster object is created.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster    :: A handle to the new raster object.                    */\n  /*                                                                       */\n  /*    pool_base :: The address in memory of the render pool.             */\n  /*                                                                       */\n  /*    pool_size :: The size in bytes of the render pool.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Rasters can ignore the render pool and rely on dynamic memory      */\n  /*    allocation if they want to (a handle to the memory allocator is    */\n  /*    passed to the raster constructor).  However, this is not           */\n  /*    recommended for efficiency purposes.                               */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_ResetFunc)( FT_Raster       raster,\n                          unsigned char*  pool_base,\n                          unsigned long   pool_size );\n\n#define FT_Raster_Reset_Func  FT_Raster_ResetFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is a generic facility to change modes or attributes  */\n  /*    in a given raster.  This can be used for debugging purposes, or    */\n  /*    simply to allow implementation-specific `features' in a given      */\n  /*    raster module.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /*    mode   :: A 4-byte tag used to name the mode or property.          */\n  /*                                                                       */\n  /*    args   :: A pointer to the new mode/property to use.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_SetModeFunc)( FT_Raster      raster,\n                            unsigned long  mode,\n                            void*          args );\n\n#define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_RenderFunc                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invoke a given raster to scan-convert a given glyph image into a   */\n  /*    target bitmap.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  /*    params :: A pointer to an @FT_Raster_Params structure used to      */\n  /*              store the rendering parameters.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The exact format of the source image depends on the raster's glyph */\n  /*    format defined in its @FT_Raster_Funcs structure.  It can be an    */\n  /*    @FT_Outline or anything else in order to support a large array of  */\n  /*    glyph formats.                                                     */\n  /*                                                                       */\n  /*    Note also that the render function can fail and return a           */\n  /*    `FT_Err_Unimplemented_Feature' error code if the raster used does  */\n  /*    not support direct composition.                                    */\n  /*                                                                       */\n  /*    XXX: For now, the standard raster doesn't support direct           */\n  /*         composition but this should change for the final release (see */\n  /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */\n  /*         for examples of distinct implementations which support direct */\n  /*         composition).                                                 */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_RenderFunc)( FT_Raster                raster,\n                           const FT_Raster_Params*  params );\n\n#define FT_Raster_Render_Func  FT_Raster_RenderFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   A structure used to describe a given raster class to the library.   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_format  :: The supported glyph format for this raster.       */\n  /*                                                                       */\n  /*    raster_new    :: The raster constructor.                           */\n  /*                                                                       */\n  /*    raster_reset  :: Used to reset the render pool within the raster.  */\n  /*                                                                       */\n  /*    raster_render :: A function to render a glyph into a given bitmap. */\n  /*                                                                       */\n  /*    raster_done   :: The raster destructor.                            */\n  /*                                                                       */\n  typedef struct  FT_Raster_Funcs_\n  {\n    FT_Glyph_Format        glyph_format;\n    FT_Raster_NewFunc      raster_new;\n    FT_Raster_ResetFunc    raster_reset;\n    FT_Raster_SetModeFunc  raster_set_mode;\n    FT_Raster_RenderFunc   raster_render;\n    FT_Raster_DoneFunc     raster_done;\n\n  } FT_Raster_Funcs;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTIMAGE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftincrem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftincrem.h                                                             */\n/*                                                                         */\n/*    FreeType incremental loading (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007, 2008, 2010 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTINCREM_H__\n#define __FTINCREM_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *    incremental\n   *\n   * @title:\n   *    Incremental Loading\n   *\n   * @abstract:\n   *    Custom Glyph Loading.\n   *\n   * @description:\n   *   This section contains various functions used to perform so-called\n   *   `incremental' glyph loading.  This is a mode where all glyphs loaded\n   *   from a given @FT_Face are provided by the client application,\n   *\n   *   Apart from that, all other tables are loaded normally from the font\n   *   file.  This mode is useful when FreeType is used within another\n   *   engine, e.g., a PostScript Imaging Processor.\n   *\n   *   To enable this mode, you must use @FT_Open_Face, passing an\n   *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\n   *   @FT_Incremental_Interface value.  See the comments for\n   *   @FT_Incremental_InterfaceRec for an example.\n   *\n   */\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental\n   *\n   * @description:\n   *   An opaque type describing a user-provided object used to implement\n   *   `incremental' glyph loading within FreeType.  This is used to support\n   *   embedded fonts in certain environments (e.g., PostScript interpreters),\n   *   where the glyph data isn't in the font file, or must be overridden by\n   *   different values.\n   *\n   * @note:\n   *   It is up to client applications to create and implement @FT_Incremental\n   *   objects, as long as they provide implementations for the methods\n   *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\n   *   and @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   *   See the description of @FT_Incremental_InterfaceRec to understand how\n   *   to use incremental objects with FreeType.\n   *\n   */\n  typedef struct FT_IncrementalRec_*  FT_Incremental;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_MetricsRec\n   *\n   * @description:\n   *   A small structure used to contain the basic glyph metrics returned\n   *   by the @FT_Incremental_GetGlyphMetricsFunc method.\n   *\n   * @fields:\n   *   bearing_x ::\n   *     Left bearing, in font units.\n   *\n   *   bearing_y ::\n   *     Top bearing, in font units.\n   *\n   *   advance ::\n   *     Horizontal component of glyph advance, in font units.\n   *\n   *   advance_v ::\n   *     Vertical component of glyph advance, in font units.\n   *\n   * @note:\n   *   These correspond to horizontal or vertical metrics depending on the\n   *   value of the `vertical' argument to the function\n   *   @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   */\n  typedef struct  FT_Incremental_MetricsRec_\n  {\n    FT_Long  bearing_x;\n    FT_Long  bearing_y;\n    FT_Long  advance;\n    FT_Long  advance_v;     /* since 2.3.12 */\n\n  } FT_Incremental_MetricsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_Metrics\n   *\n   * @description:\n   *   A handle to an @FT_Incremental_MetricsRec structure.\n   *\n   */\n   typedef struct FT_Incremental_MetricsRec_*  FT_Incremental_Metrics;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphDataFunc\n   *\n   * @description:\n   *   A function called by FreeType to access a given glyph's data bytes\n   *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\n   *   enabled.\n   *\n   *   Note that the format of the glyph's data bytes depends on the font\n   *   file format.  For TrueType, it must correspond to the raw bytes within\n   *   the `glyf' table.  For PostScript formats, it must correspond to the\n   *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\n   *   undefined for any other format.\n   *\n   * @input:\n   *   incremental ::\n   *     Handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   * @output:\n   *   adata ::\n   *     A structure describing the returned glyph data bytes (which will be\n   *     accessed as a read-only byte block).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If this function returns successfully the method\n   *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\n   *   the data bytes.\n   *\n   *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\n   *   compound glyphs.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\n                                      FT_UInt         glyph_index,\n                                      FT_Data*        adata );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_FreeGlyphDataFunc\n   *\n   * @description:\n   *   A function used to release the glyph data bytes returned by a\n   *   successful call to @FT_Incremental_GetGlyphDataFunc.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   data ::\n   *     A structure describing the glyph data bytes (which will be accessed\n   *     as a read-only byte block).\n   *\n   */\n  typedef void\n  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\n                                       FT_Data*        data );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphMetricsFunc\n   *\n   * @description:\n   *   A function used to retrieve the basic metrics of a given glyph index\n   *   before accessing its data.  This is necessary because, in certain\n   *   formats like TrueType, the metrics are stored in a different place from\n   *   the glyph images proper.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   *   vertical ::\n   *     If true, return vertical metrics.\n   *\n   *   ametrics ::\n   *     This parameter is used for both input and output.\n   *     The original glyph metrics, if any, in font units.  If metrics are\n   *     not available all the values must be set to zero.\n   *\n   * @output:\n   *   ametrics ::\n   *     The replacement glyph metrics in font units.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphMetricsFunc)\n                      ( FT_Incremental              incremental,\n                        FT_UInt                     glyph_index,\n                        FT_Bool                     vertical,\n                        FT_Incremental_MetricsRec  *ametrics );\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_FuncsRec\n   *\n   * @description:\n   *   A table of functions for accessing fonts that load data\n   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\n   *\n   * @fields:\n   *   get_glyph_data ::\n   *     The function to get glyph data.  Must not be null.\n   *\n   *   free_glyph_data ::\n   *     The function to release glyph data.  Must not be null.\n   *\n   *   get_glyph_metrics ::\n   *     The function to get glyph metrics.  May be null if the font does\n   *     not provide overriding glyph metrics.\n   *\n   */\n  typedef struct  FT_Incremental_FuncsRec_\n  {\n    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\n    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\n    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\n\n  } FT_Incremental_FuncsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_InterfaceRec\n   *\n   * @description:\n   *   A structure to be used with @FT_Open_Face to indicate that the user\n   *   wants to support incremental glyph loading.  You should use it with\n   *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\n   *\n   *     {\n   *       FT_Incremental_InterfaceRec  inc_int;\n   *       FT_Parameter                 parameter;\n   *       FT_Open_Args                 open_args;\n   *\n   *\n   *       // set up incremental descriptor\n   *       inc_int.funcs  = my_funcs;\n   *       inc_int.object = my_object;\n   *\n   *       // set up optional parameter\n   *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\n   *       parameter.data = &inc_int;\n   *\n   *       // set up FT_Open_Args structure\n   *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\n   *       open_args.pathname   = my_font_pathname;\n   *       open_args.num_params = 1;\n   *       open_args.params     = &parameter; // we use one optional argument\n   *\n   *       // open the font\n   *       error = FT_Open_Face( library, &open_args, index, &face );\n   *       ...\n   *     }\n   *\n   */\n  typedef struct  FT_Incremental_InterfaceRec_\n  {\n    const FT_Incremental_FuncsRec*  funcs;\n    FT_Incremental                  object;\n\n  } FT_Incremental_InterfaceRec;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_Interface\n   *\n   * @description:\n   *   A pointer to an @FT_Incremental_InterfaceRec structure.\n   *\n   */\n  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_INCREMENTAL\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to indicate\n   *   an incremental loading object to be used by FreeType.\n   *\n   */\n#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTINCREM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftlcdfil.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.h                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2006, 2007, 2008, 2010 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_LCD_FILTER_H__\n#define __FT_LCD_FILTER_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *   lcd_filtering\n   *\n   * @title:\n   *   LCD Filtering\n   *\n   * @abstract:\n   *   Reduce color fringes of LCD-optimized bitmaps.\n   *\n   * @description:\n   *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass\n   *   filter which is then applied to LCD-optimized bitmaps generated\n   *   through @FT_Render_Glyph.  This is useful to reduce color fringes\n   *   which would occur with unfiltered rendering.\n   *\n   *   Note that no filter is active by default, and that this function is\n   *   *not* implemented in default builds of the library.  You need to\n   *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file\n   *   in order to activate it.\n   *\n   *   FreeType generates alpha coverage maps, which are linear by nature.\n   *   For instance, the value 0x80 in bitmap representation means that\n   *   (within numerical precision) 0x80/0xff fraction of that pixel is\n   *   covered by the glyph's outline.  The blending function for placing\n   *   text over a background is\n   *\n   *   {\n   *     dst = alpha * src + (1 - alpha) * dst    ,\n   *   }\n   *\n   *   which is known as OVER.  However, when calculating the output of the\n   *   OVER operator, the source colors should first be transformed to a\n   *   linear color space, then alpha blended in that space, and transformed\n   *   back to the output color space.\n   *\n   *   When linear light blending is used, the default FIR5 filtering\n   *   weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as\n   *   they have been designed for black on white rendering while lacking\n   *   gamma correction.  To preserve color neutrality, weights for a FIR5\n   *   filter should be chosen according to two free parameters `a' and `c',\n   *   and the FIR weights should be\n   *\n   *   {\n   *     [a - c, a + c, 2 * a, a + c, a - c]    .\n   *   }\n   *\n   *   This formula generates equal weights for all the color primaries\n   *   across the filter kernel, which makes it colorless.  One suggested\n   *   set of weights is\n   *\n   *   {\n   *     [0x10, 0x50, 0x60, 0x50, 0x10]    ,\n   *   }\n   *\n   *   where `a' has value 0x30 and `b' value 0x20.  The weights in filter\n   *   may have a sum larger than 0x100, which increases coloration slightly\n   *   but also improves contrast.\n   */\n\n\n  /****************************************************************************\n   *\n   * @enum:\n   *   FT_LcdFilter\n   *\n   * @description:\n   *   A list of values to identify various types of LCD filters.\n   *\n   * @values:\n   *   FT_LCD_FILTER_NONE ::\n   *     Do not perform filtering.  When used with subpixel rendering, this\n   *     results in sometimes severe color fringes.\n   *\n   *   FT_LCD_FILTER_DEFAULT ::\n   *     The default filter reduces color fringes considerably, at the cost\n   *     of a slight blurriness in the output.\n   *\n   *   FT_LCD_FILTER_LIGHT ::\n   *     The light filter is a variant that produces less blurriness at the\n   *     cost of slightly more color fringes than the default one.  It might\n   *     be better, depending on taste, your monitor, or your personal vision.\n   *\n   *   FT_LCD_FILTER_LEGACY ::\n   *     This filter corresponds to the original libXft color filter.  It\n   *     provides high contrast output but can exhibit really bad color\n   *     fringes if glyphs are not extremely well hinted to the pixel grid.\n   *     In other words, it only works well if the TrueType bytecode\n   *     interpreter is enabled *and* high-quality hinted fonts are used.\n   *\n   *     This filter is only provided for comparison purposes, and might be\n   *     disabled or stay unsupported in the future.\n   *\n   * @since:\n   *   2.3.0\n   */\n  typedef enum  FT_LcdFilter_\n  {\n    FT_LCD_FILTER_NONE    = 0,\n    FT_LCD_FILTER_DEFAULT = 1,\n    FT_LCD_FILTER_LIGHT   = 2,\n    FT_LCD_FILTER_LEGACY  = 16,\n\n    FT_LCD_FILTER_MAX   /* do not remove */\n\n  } FT_LcdFilter;\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilter\n   *\n   * @description:\n   *   This function is used to apply color filtering to LCD decimated\n   *   bitmaps, like the ones used when calling @FT_Render_Glyph with\n   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   filter ::\n   *     The filter type.\n   *\n   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or\n   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work\n   *     well on most LCD screens.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This feature is always disabled by default.  Clients must make an\n   *   explicit call to this function with a `filter' value other than\n   *   @FT_LCD_FILTER_NONE in order to enable it.\n   *\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,\n   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.\n   *\n   *   It does _not_ affect the output of @FT_Outline_Render and\n   *   @FT_Outline_Get_Bitmap.\n   *\n   *   If this feature is activated, the dimensions of LCD glyph bitmaps are\n   *   either larger or taller than the dimensions of the corresponding\n   *   outline with regards to the pixel grid.  For example, for\n   *   @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and\n   *   up to 3~pixels to the right.\n   *\n   *   The bitmap offset values are adjusted correctly, so clients shouldn't\n   *   need to modify their layout and glyph positioning code when enabling\n   *   the filter.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter );\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilterWeights\n   *\n   * @description:\n   *   Use this function to override the filter weights selected by\n   *   @FT_Library_SetLcdFilter.  By default, FreeType uses the quintuple\n   *   (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,\n   *   0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and\n   *   FT_LCD_FILTER_LEGACY.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   weights ::\n   *     A pointer to an array; the function copies the first five bytes and\n   *     uses them to specify the filter weights.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   This function must be called after @FT_Library_SetLcdFilter to have\n   *   any effect.\n   *\n   * @since:\n   *   2.4.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_LCD_FILTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftlist.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlist.h                                                               */\n/*                                                                         */\n/*    Generic list support for FreeType (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file implements functions relative to list processing.  Its     */\n  /*  data structures are defined in `freetype.h'.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTLIST_H__\n#define __FTLIST_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    List Processing                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Simple management of lists.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various definitions related to list          */\n  /*    processing using doubly-linked nodes.                              */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_List                                                            */\n  /*    FT_ListNode                                                        */\n  /*    FT_ListRec                                                         */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /*    FT_List_Add                                                        */\n  /*    FT_List_Insert                                                     */\n  /*    FT_List_Find                                                       */\n  /*    FT_List_Remove                                                     */\n  /*    FT_List_Up                                                         */\n  /*    FT_List_Iterate                                                    */\n  /*    FT_List_Iterator                                                   */\n  /*    FT_List_Finalize                                                   */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Find                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the list node for a given listed object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    data :: The address of the listed object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    List node.  NULL if it wasn't found.                               */\n  /*                                                                       */\n  FT_EXPORT( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Add                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Append an element to the end of a list.                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to append.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Insert                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Insert an element at the head of a list.                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to parent list.                                  */\n  /*    node :: The node to insert.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Remove                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a node from a list.  This function doesn't check whether    */\n  /*    the node is in the list!                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The node to remove.                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Up                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Move a node to the head/top of a list.  Used to maintain LRU       */\n  /*    lists.                                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to move.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Iterator                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An FT_List iterator function which is called during a list parse   */\n  /*    by @FT_List_Iterate.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The current iteration list node.                           */\n  /*                                                                       */\n  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */\n  /*            Can be used to point to the iteration's state.             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_List_Iterator)( FT_ListNode  node,\n                       void*        user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Iterate                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse a list and calls a given iterator function on each element.  */\n  /*    Note that parsing is stopped as soon as one of the iterator calls  */\n  /*    returns a non-zero value.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list     :: A handle to the list.                                  */\n  /*    iterator :: An iterator function, called on each node of the list. */\n  /*    user     :: A user-supplied field which is passed as the second    */\n  /*                argument to the iterator.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result (a FreeType error code) of the last iterator call.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An @FT_List iterator function which is called during a list        */\n  /*    finalization by @FT_List_Finalize to destroy all elements in a     */\n  /*    given list.                                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    system :: The current system object.                               */\n  /*                                                                       */\n  /*    data   :: The current object to destroy.                           */\n  /*                                                                       */\n  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */\n  /*              be used to point to the iteration's state.               */\n  /*                                                                       */\n  typedef void\n  (*FT_List_Destructor)( FT_Memory  memory,\n                         void*      data,\n                         void*      user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Finalize                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy all elements in the list as well as the list itself.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list    :: A handle to the list.                                   */\n  /*                                                                       */\n  /*    destroy :: A list destructor that will be applied to each element  */\n  /*               of the list.                                            */\n  /*                                                                       */\n  /*    memory  :: The current memory object which handles deallocation.   */\n  /*                                                                       */\n  /*    user    :: A user-supplied field which is passed as the last       */\n  /*               argument to the destructor.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function expects that all nodes added by @FT_List_Add or      */\n  /*    @FT_List_Insert have been dynamically allocated.                   */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLIST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftlzw.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.h                                                                */\n/*                                                                         */\n/*    LZW-compressed stream support.                                       */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTLZW_H__\n#define __FTLZW_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    lzw                                                                */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    LZW Streams                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using LZW-compressed font files.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of LZW-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenLZW\n  *\n  * @description:\n  *   Open a new stream to parse LZW-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.Z' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream :: The target embedding stream.\n  *\n  *   source :: The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream\n  *\n  *   In certain builds of the library, LZW compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a LZW stream from it\n  *   and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with LZW support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLZW_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftmac.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.h                                                                */\n/*                                                                         */\n/*    Additional Mac-specific API.                                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2007 by                               */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* NOTE: Include this file after <freetype/freetype.h> and after any       */\n/*       Mac-specific headers (because this header uses Mac types such as  */\n/*       Handle, FSSpec, FSRef, etc.)                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMAC_H__\n#define __FTMAC_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n/* gcc-3.4.1 and later can warn about functions tagged as deprecated */\n#ifndef FT_DEPRECATED_ATTRIBUTE\n#if defined(__GNUC__)                                               && \\\n    ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define FT_DEPRECATED_ATTRIBUTE  __attribute__((deprecated))\n#else\n#define FT_DEPRECATED_ATTRIBUTE\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    mac_specific                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Mac Specific Interface                                             */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Only available on the Macintosh.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following definitions are only available if FreeType is        */\n  /*    compiled on a Macintosh.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FOND                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a FOND resource.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fond       :: A FOND resource.                                     */\n  /*                                                                       */\n  /*    face_index :: Only supported for the -1 `sanity check' special     */\n  /*                  case.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Notes>                                                               */\n  /*    This function can be used to create @FT_Face objects from fonts    */\n  /*    that are installed in the system as follows.                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      fond = GetResource( 'FOND', fontName );                          */\n  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face    *aface )\n                       FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_Name                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */\n  /*                  Bold).                                               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file.  For passing to                  */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face.  For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n                          FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_ATS_Name                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font in ATS framework.            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file. For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face. For passing to                    */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n                              FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFilePath_From_Mac_ATS_Name                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pathname of the disk file and face index for given font   */\n  /*    name which is handled by ATS framework.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName    :: Mac OS name of the font in ATS framework.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    path        :: Buffer to store pathname of the file.  For passing  */\n  /*                   to @FT_New_Face.  The client must allocate this     */\n  /*                   buffer before calling this function.                */\n  /*                                                                       */\n  /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */\n  /*                                                                       */\n  /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index )\n                                  FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSSpec to the font file.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSSpec to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */\n  /*    it accepts an FSSpec instead of a path.                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec  *spec,\n                           FT_Long        face_index,\n                           FT_Face       *aface )\n                         FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSRef to the font file.                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSRef to the font file.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */\n  /*    it accepts an FSRef instead of a path.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef  *ref,\n                          FT_Long       face_index,\n                          FT_Face      *aface )\n                        FT_DEPRECATED_ATTRIBUTE;\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTMAC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.h                                                                 */\n/*                                                                         */\n/*    FreeType Multiple Master font interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMM_H__\n#define __FTMM_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    multiple_masters                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Multiple Masters                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to manage Multiple Masters fonts.                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following types and functions are used to manage Multiple      */\n  /*    Master fonts, i.e., the selection of specific design instances by  */\n  /*    setting design axis coordinates.                                   */\n  /*                                                                       */\n  /*    George Williams has extended this interface to make it work with   */\n  /*    both Type~1 Multiple Masters fonts and GX distortable (var)        */\n  /*    fonts.  Some of these routines only work with MM fonts, others     */\n  /*    will work with both types.  They are similar enough that a         */\n  /*    consistent interface makes sense.                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Axis                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  typedef struct  FT_MM_Axis_\n  {\n    FT_String*  name;\n    FT_Long     minimum;\n    FT_Long     maximum;\n\n  } FT_MM_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Multi_Master                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis    :: Number of axes.  Cannot exceed~4.                   */\n  /*                                                                       */\n  /*    num_designs :: Number of designs; should be normally 2^num_axis    */\n  /*                   even though the Type~1 specification strangely      */\n  /*                   allows for intermediate designs to be present. This */\n  /*                   number cannot exceed~16.                            */\n  /*                                                                       */\n  /*    axis        :: A table of axis descriptors.                        */\n  /*                                                                       */\n  typedef struct  FT_Multi_Master_\n  {\n    FT_UInt     num_axis;\n    FT_UInt     num_designs;\n    FT_MM_Axis  axis[T1_MAX_MM_AXIS];\n\n  } FT_Multi_Master;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Axis                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters and GX var fonts.                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*               Not always meaningful for GX.                           */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    def     :: The axis's default design coordinate.                   */\n  /*               FreeType computes meaningful default values for MM; it  */\n  /*               is then an integer value, not in 16.16 format.          */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  /*    tag     :: The axis's tag (the GX equivalent to `name').           */\n  /*               FreeType provides default values for MM if possible.    */\n  /*                                                                       */\n  /*    strid   :: The entry in `name' table (another GX version of        */\n  /*               `name').                                                */\n  /*               Not meaningful for MM.                                  */\n  /*                                                                       */\n  typedef struct  FT_Var_Axis_\n  {\n    FT_String*  name;\n\n    FT_Fixed    minimum;\n    FT_Fixed    def;\n    FT_Fixed    maximum;\n\n    FT_ULong    tag;\n    FT_UInt     strid;\n\n  } FT_Var_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Named_Style                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a named style in a GX var font.   */\n  /*                                                                       */\n  /*    This structure can't be used for MM fonts.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    coords :: The design coordinates for this style.                   */\n  /*              This is an array with one entry for each axis.           */\n  /*                                                                       */\n  /*    strid  :: The entry in `name' table identifying this style.        */\n  /*                                                                       */\n  typedef struct  FT_Var_Named_Style_\n  {\n    FT_Fixed*  coords;\n    FT_UInt    strid;\n\n  } FT_Var_Named_Style;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Var                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    or GX var distortable font.                                        */\n  /*                                                                       */\n  /*    Some fields are specific to one format and not to the other.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis        :: The number of axes.  The maximum value is~4 for */\n  /*                       MM; no limit in GX.                             */\n  /*                                                                       */\n  /*    num_designs     :: The number of designs; should be normally       */\n  /*                       2^num_axis for MM fonts.  Not meaningful for GX */\n  /*                       (where every glyph could have a different       */\n  /*                       number of designs).                             */\n  /*                                                                       */\n  /*    num_namedstyles :: The number of named styles; only meaningful for */\n  /*                       GX which allows certain design coordinates to   */\n  /*                       have a string ID (in the `name' table)          */\n  /*                       associated with them.  The font can tell the    */\n  /*                       user that, for example, Weight=1.5 is `Bold'.   */\n  /*                                                                       */\n  /*    axis            :: A table of axis descriptors.                    */\n  /*                       GX fonts contain slightly more data than MM.    */\n  /*                                                                       */\n  /*    namedstyles     :: A table of named styles.                        */\n  /*                       Only meaningful with GX.                        */\n  /*                                                                       */\n  typedef struct  FT_MM_Var_\n  {\n    FT_UInt              num_axis;\n    FT_UInt              num_designs;\n    FT_UInt              num_namedstyles;\n    FT_Var_Axis*         axis;\n    FT_Var_Named_Style*  namedstyle;\n\n  } FT_MM_Var;\n\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Multi_Master                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master descriptor of a given font.           */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master/GX var descriptor of a given font.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters/GX var descriptor.                 */\n  /*               Allocates a data structure, which the user must free    */\n  /*               (a single call to FT_FREE will do it).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Design_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters fonts, choose an interpolated font design     */\n  /*    through design coordinates.                                        */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Design_Coordinates                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */\n  /*    design through design coordinates.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Blend_Coordinates                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters and GX var fonts, choose an interpolated font */\n  /*    design through normalized blend coordinates.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: The design coordinates array (each element must be   */\n  /*                  between 0 and 1.0).                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Blend_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftmodapi.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmodapi.h                                                             */\n/*                                                                         */\n/*    FreeType modules public interface (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMODAPI_H__\n#define __FTMODAPI_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Module Management                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to add, upgrade, remove, and control modules from FreeType.    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The definitions below are used to manage modules within FreeType.  */\n  /*    Modules can be added, upgraded, and removed at runtime.            */\n  /*    Additionally, some module properties can be controlled also.       */\n  /*                                                                       */\n  /*    Here is a list of possible values of the `module_name' field in    */\n  /*    the @FT_Module_Class structure.                                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      autofitter                                                       */\n  /*      bdf                                                              */\n  /*      cff                                                              */\n  /*      gxvalid                                                          */\n  /*      otvalid                                                          */\n  /*      pcf                                                              */\n  /*      pfr                                                              */\n  /*      psaux                                                            */\n  /*      pshinter                                                         */\n  /*      psnames                                                          */\n  /*      raster1, raster5                                                 */\n  /*      sfnt                                                             */\n  /*      smooth, smooth-lcd, smooth-lcdv                                  */\n  /*      truetype                                                         */\n  /*      type1                                                            */\n  /*      type42                                                           */\n  /*      t1cid                                                            */\n  /*      winfonts                                                         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that the FreeType Cache sub-system is not a FreeType module.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* module bit flags */\n#define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */\n#define FT_MODULE_RENDERER            2  /* this module is a renderer     */\n#define FT_MODULE_HINTER              4  /* this module is a glyph hinter */\n#define FT_MODULE_STYLER              8  /* this module is a styler       */\n\n#define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */\n                                              /* scalable fonts           */\n#define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */\n                                              /* support vector outlines  */\n#define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */\n                                              /* own hinter               */\n\n\n  /* deprecated values */\n#define ft_module_font_driver         FT_MODULE_FONT_DRIVER\n#define ft_module_renderer            FT_MODULE_RENDERER\n#define ft_module_hinter              FT_MODULE_HINTER\n#define ft_module_styler              FT_MODULE_STYLER\n\n#define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE\n#define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES\n#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER\n\n\n  typedef FT_Pointer  FT_Module_Interface;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Constructor                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to initialize (not create) a new module object.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to initialize.                                */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Constructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destructor                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to finalize (not destroy) a given module object.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to finalize.                                  */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Requester                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to query a given module for a specific interface.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to be searched.                               */\n  /*                                                                       */\n  /*    name ::   The name of the interface in the module.                 */\n  /*                                                                       */\n  typedef FT_Module_Interface\n  (*FT_Module_Requester)( FT_Module    module,\n                          const char*  name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The module class descriptor.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    module_flags    :: Bit flags describing the module.                */\n  /*                                                                       */\n  /*    module_size     :: The size of one module object/instance in       */\n  /*                       bytes.                                          */\n  /*                                                                       */\n  /*    module_name     :: The name of the module.                         */\n  /*                                                                       */\n  /*    module_version  :: The version, as a 16.16 fixed number            */\n  /*                       (major.minor).                                  */\n  /*                                                                       */\n  /*    module_requires :: The version of FreeType this module requires,   */\n  /*                       as a 16.16 fixed number (major.minor).  Starts  */\n  /*                       at version 2.0, i.e., 0x20000.                  */\n  /*                                                                       */\n  /*    module_init     :: The initializing function.                      */\n  /*                                                                       */\n  /*    module_done     :: The finalizing function.                        */\n  /*                                                                       */\n  /*    get_interface   :: The interface requesting function.              */\n  /*                                                                       */\n  typedef struct  FT_Module_Class_\n  {\n    FT_ULong               module_flags;\n    FT_Long                module_size;\n    const FT_String*       module_name;\n    FT_Fixed               module_version;\n    FT_Fixed               module_requires;\n\n    const void*            module_interface;\n\n    FT_Module_Constructor  module_init;\n    FT_Module_Destructor   module_done;\n    FT_Module_Requester    get_interface;\n\n  } FT_Module_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add a new module to a given library instance.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    clazz   :: A pointer to class descriptor for the module.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find a module by its name.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module handle.  0~if none was found.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    FreeType's internal modules aren't documented very well, and you   */\n  /*    should look up the source code for details.                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Remove_Module                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a given module from a library instance.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module  :: A handle to a module object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The module object is destroyed by the function in case of success. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Set\n   *\n   * @description:\n   *    Set a property for a given module.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   *       Note that only a few modules have properties.\n   *\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the new\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example sets property `bar' (a simple integer) in\n   *    module `foo' to value~1.\n   *\n   *    {\n   *      FT_UInt  bar;\n   *\n   *\n   *      bar = 1;\n   *      FT_Property_Set( library, \"foo\", \"bar\", &bar );\n   *    }\n   *\n   *    Note that the FreeType Cache sub-system doesn't recognize module\n   *    property changes.  To avoid glyph lookup confusion within the cache\n   *    you should call @FTC_Manager_Reset to completely flush the cache if\n   *    a module property gets changed after @FTC_Manager_New has been\n   *    called.\n   *\n   *    It is not possible to set properties of the FreeType Cache\n   *    sub-system itself with FT_Property_Set; use @FTC_Property_Set\n   *    instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Set( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   const void*       value );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Get\n   *\n   * @description:\n   *    Get a module's property value.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   * @inout:\n   *    value ::\n   *       A generic pointer to a variable or structure which gives the\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example gets property `baz' (a range) in module `foo'.\n   *\n   *    {\n   *      typedef  range_\n   *      {\n   *        FT_Int32  min;\n   *        FT_Int32  max;\n   *\n   *      } range;\n   *\n   *      range  baz;\n   *\n   *\n   *      FT_Property_Get( library, \"foo\", \"baz\", &baz );\n   *    }\n   *\n   *    It is not possible to retrieve properties of the FreeType Cache\n   *    sub-system with FT_Property_Get; use @FTC_Property_Get instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Get( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   void*             value );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Library                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Library         */\n  /*    structure is created.  This function increments the counter.       */\n  /*    @FT_Done_Library then only destroys a library if the counter is~1, */\n  /*    otherwise it simply decrements the counter.                        */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures which    */\n  /*    reference @FT_Library objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a target library object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Library( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Library                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to create a new FreeType library instance    */\n  /*    from a given memory object.  It is thus possible to use libraries  */\n  /*    with distinct memory allocators within the same program.           */\n  /*                                                                       */\n  /*    Normally, you would call this function (followed by a call to      */\n  /*    @FT_Add_Default_Modules or a series of calls to @FT_Add_Module)    */\n  /*    instead of @FT_Init_FreeType to initialize the FreeType library.   */\n  /*                                                                       */\n  /*    Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a      */\n  /*    library instance.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A handle to the original memory object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A pointer to handle of a new library object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Library                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given library object.  This closes all drivers and       */\n  /*    discards all resource objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Library( FT_Library  library );\n\n/* */\n\n  typedef void\n  (*FT_DebugHook_Func)( void*  arg );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set a debug hook function for debugging the interpreter of a font  */\n  /*    format.                                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hook_index :: The index of the debug hook.  You should use the     */\n  /*                  values defined in `ftobjs.h', e.g.,                  */\n  /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */\n  /*                                                                       */\n  /*    debug_hook :: The function used to debug the interpreter.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, four debug hook slots are available, but only two (for  */\n  /*    the TrueType and the Type~1 interpreter) are defined.              */\n  /*                                                                       */\n  /*    Since the internal headers of FreeType are no longer installed,    */\n  /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */\n  /*    This is a bug and will be fixed in a forthcoming release.          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add the set of default drivers to a given library object.          */\n  /*    This is only useful when you create a library object with          */\n  /*    @FT_New_Library (usually to plug a custom memory manager).         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a new library object.                       */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Add_Default_Modules( FT_Library  library );\n\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   truetype_engine\n   *\n   * @title:\n   *   The TrueType Engine\n   *\n   * @abstract:\n   *   TrueType bytecode support.\n   *\n   * @description:\n   *   This section contains a function used to query the level of TrueType\n   *   bytecode support compiled in this version of the library.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   *  @enum:\n   *     FT_TrueTypeEngineType\n   *\n   *  @description:\n   *     A list of values describing which kind of TrueType bytecode\n   *     engine is implemented in a given FT_Library instance.  It is used\n   *     by the @FT_Get_TrueType_Engine_Type function.\n   *\n   *  @values:\n   *     FT_TRUETYPE_ENGINE_TYPE_NONE ::\n   *       The library doesn't implement any kind of bytecode interpreter.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::\n   *       The library implements a bytecode interpreter that doesn't\n   *       support the patented operations of the TrueType virtual machine.\n   *\n   *       Its main use is to load certain Asian fonts which position and\n   *       scale glyph components with bytecode instructions.  It produces\n   *       bad output for most other fonts.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_PATENTED ::\n   *       The library implements a bytecode interpreter that covers\n   *       the full instruction set of the TrueType virtual machine (this\n   *       was governed by patents until May 2010, hence the name).\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  typedef enum  FT_TrueTypeEngineType_\n  {\n    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n\n  } FT_TrueTypeEngineType;\n\n\n  /**************************************************************************\n   *\n   *  @func:\n   *     FT_Get_TrueType_Engine_Type\n   *\n   *  @description:\n   *     Return an @FT_TrueTypeEngineType value to indicate which level of\n   *     the TrueType virtual machine a given library instance supports.\n   *\n   *  @input:\n   *     library ::\n   *       A library instance.\n   *\n   *  @return:\n   *     A value indicating which level is supported.\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  FT_EXPORT( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMODAPI_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftmoderr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmoderr.h                                                             */\n/*                                                                         */\n/*    FreeType module error offsets (specification).                       */\n/*                                                                         */\n/*  Copyright 2001-2005, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the FreeType module error codes.          */\n  /*                                                                       */\n  /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is    */\n  /* set, the lower byte of an error value identifies the error code as    */\n  /* usual.  In addition, the higher byte identifies the module.  For      */\n  /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */\n  /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error        */\n  /* `T1_Err_Invalid_File_Format' has value 0x1403, etc.                   */\n  /*                                                                       */\n  /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero,    */\n  /* including the high byte.                                              */\n  /*                                                                       */\n  /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of   */\n  /* an error value is set to zero.                                        */\n  /*                                                                       */\n  /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */\n  /* provides some macros in `fttypes.h'.                                  */\n  /*                                                                       */\n  /*   FT_ERR( err )                                                       */\n  /*     Add current error module prefix (as defined with the              */\n  /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */\n  /*     the line                                                          */\n  /*                                                                       */\n  /*       error = FT_ERR( Invalid_Outline );                              */\n  /*                                                                       */\n  /*     expands to                                                        */\n  /*                                                                       */\n  /*       error = BDF_Err_Invalid_Outline;                                */\n  /*                                                                       */\n  /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */\n  /*     of `FT_ERR( Ok )'.                                                */\n  /*                                                                       */\n  /*   FT_ERR_EQ( errcode, err )                                           */\n  /*   FT_ERR_NEQ( errcode, err )                                          */\n  /*     Compare error code `errcode' with the error `err' for equality    */\n  /*     and inequality, respectively.  Example:                           */\n  /*                                                                       */\n  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*     Using this macro you don't have to think about error prefixes.    */\n  /*     Of course, if module errors are not active, the above example is  */\n  /*     the same as                                                       */\n  /*                                                                       */\n  /*       if ( error == FT_Err_Invalid_Outline )                          */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*   FT_ERROR_BASE( errcode )                                            */\n  /*   FT_ERROR_MODULE( errcode )                                          */\n  /*     Get base error and module error code, respectively.               */\n  /*                                                                       */\n  /*                                                                       */\n  /* It can also be used to create a module error message table easily     */\n  /* with something like                                                   */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     #undef __FTMODERR_H__                                             */\n  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */\n  /*     #define FT_MODERR_START_LIST     {                                */\n  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */\n  /*                                                                       */\n  /*     const struct                                                      */\n  /*     {                                                                 */\n  /*       int          mod_err_offset;                                    */\n  /*       const char*  mod_err_msg                                        */\n  /*     } ft_mod_errors[] =                                               */\n  /*                                                                       */\n  /*     #include FT_MODULE_ERRORS_H                                       */\n  /*   }                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTMODERR_H__\n#define __FTMODERR_H__\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#ifndef FT_MODERRDEF\n\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,\n#else\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,\n#endif\n\n#define FT_MODERR_START_LIST  enum {\n#define FT_MODERR_END_LIST    FT_Mod_Err_Max };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_MODERRDEF */\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****               LIST MODULE ERROR BASES                   *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_MODERR_START_LIST\n  FT_MODERR_START_LIST\n#endif\n\n\n  FT_MODERRDEF( Base,      0x000, \"base module\" )\n  FT_MODERRDEF( Autofit,   0x100, \"autofitter module\" )\n  FT_MODERRDEF( BDF,       0x200, \"BDF module\" )\n  FT_MODERRDEF( Bzip2,     0x300, \"Bzip2 module\" )\n  FT_MODERRDEF( Cache,     0x400, \"cache module\" )\n  FT_MODERRDEF( CFF,       0x500, \"CFF module\" )\n  FT_MODERRDEF( CID,       0x600, \"CID module\" )\n  FT_MODERRDEF( Gzip,      0x700, \"Gzip module\" )\n  FT_MODERRDEF( LZW,       0x800, \"LZW module\" )\n  FT_MODERRDEF( OTvalid,   0x900, \"OpenType validation module\" )\n  FT_MODERRDEF( PCF,       0xA00, \"PCF module\" )\n  FT_MODERRDEF( PFR,       0xB00, \"PFR module\" )\n  FT_MODERRDEF( PSaux,     0xC00, \"PS auxiliary module\" )\n  FT_MODERRDEF( PShinter,  0xD00, \"PS hinter module\" )\n  FT_MODERRDEF( PSnames,   0xE00, \"PS names module\" )\n  FT_MODERRDEF( Raster,    0xF00, \"raster module\" )\n  FT_MODERRDEF( SFNT,     0x1000, \"SFNT module\" )\n  FT_MODERRDEF( Smooth,   0x1100, \"smooth raster module\" )\n  FT_MODERRDEF( TrueType, 0x1200, \"TrueType module\" )\n  FT_MODERRDEF( Type1,    0x1300, \"Type 1 module\" )\n  FT_MODERRDEF( Type42,   0x1400, \"Type 42 module\" )\n  FT_MODERRDEF( Winfonts, 0x1500, \"Windows FON/FNT module\" )\n  FT_MODERRDEF( GXvalid,  0x1600, \"GX validation module\" )\n\n\n#ifdef FT_MODERR_END_LIST\n  FT_MODERR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      CLEANUP                            *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_MODERR_START_LIST\n#undef FT_MODERR_END_LIST\n#undef FT_MODERRDEF\n#undef FT_NEED_EXTERN_C\n\n\n#endif /* __FTMODERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (specification).         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/*                                                                         */\n/* Warning: This module might be moved to a different library in the       */\n/*          future to avoid a tight dependency between FreeType and the    */\n/*          OpenType specification.                                        */\n/*                                                                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOTVAL_H__\n#define __FTOTVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    ot_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    OpenType Validation                                                */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate OpenType tables.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_OTXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_OpenType_Validate to\n  *    indicate which OpenType tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_BASE ::\n  *      Validate BASE table.\n  *\n  *    FT_VALIDATE_GDEF ::\n  *      Validate GDEF table.\n  *\n  *    FT_VALIDATE_GPOS ::\n  *      Validate GPOS table.\n  *\n  *    FT_VALIDATE_GSUB ::\n  *      Validate GSUB table.\n  *\n  *    FT_VALIDATE_JSTF ::\n  *      Validate JSTF table.\n  *\n  *    FT_VALIDATE_MATH ::\n  *      Validate MATH table.\n  *\n  *    FT_VALIDATE_OT ::\n  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).\n  *\n  */\n#define FT_VALIDATE_BASE  0x0100\n#define FT_VALIDATE_GDEF  0x0200\n#define FT_VALIDATE_GPOS  0x0400\n#define FT_VALIDATE_GSUB  0x0800\n#define FT_VALIDATE_JSTF  0x1000\n#define FT_VALIDATE_MATH  0x2000\n\n#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\\n                        FT_VALIDATE_GDEF | \\\n                        FT_VALIDATE_GPOS | \\\n                        FT_VALIDATE_GSUB | \\\n                        FT_VALIDATE_JSTF | \\\n                        FT_VALIDATE_MATH\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Validate\n  *\n  * @description:\n  *    Validate various OpenType tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_OTXXX for possible values.\n  *\n  * @output:\n  *    BASE_table ::\n  *       A pointer to the BASE table.\n  *\n  *    GDEF_table ::\n  *       A pointer to the GDEF table.\n  *\n  *    GPOS_table ::\n  *       A pointer to the GPOS table.\n  *\n  *    GSUB_table ::\n  *       A pointer to the GSUB table.\n  *\n  *    JSTF_table ::\n  *       A pointer to the JSTF table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with OpenType fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the five tables with\n  *   @FT_OpenType_Free.  A NULL value indicates that the table either\n  *   doesn't exist in the font, or the application hasn't asked for\n  *   validation.\n  */\n  FT_EXPORT( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table );\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Free\n  *\n  * @description:\n  *    Free the buffer allocated by OpenType validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_OpenType_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_OpenType_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftoutln.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.h                                                              */\n/*                                                                         */\n/*    Support for the FT_Outline type used to store glyph shapes of        */\n/*    most scalable font formats (specification).                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOUTLN_H__\n#define __FTOUTLN_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Outline Processing                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions to create, transform, and render vectorial glyph images. */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains routines used to create and destroy scalable */\n  /*    glyph images known as `outlines'.  These can also be measured,     */\n  /*    transformed, and converted into bitmaps and pixmaps.               */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Outline                                                         */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*    FT_Outline_New                                                     */\n  /*    FT_Outline_Done                                                    */\n  /*    FT_Outline_Copy                                                    */\n  /*    FT_Outline_Translate                                               */\n  /*    FT_Outline_Transform                                               */\n  /*    FT_Outline_Embolden                                                */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*    FT_Outline_Reverse                                                 */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /*    FT_Outline_Get_CBox                                                */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /*    FT_Outline_Decompose                                               */\n  /*    FT_Outline_Funcs                                                   */\n  /*    FT_Outline_MoveTo_Func                                             */\n  /*    FT_Outline_LineTo_Func                                             */\n  /*    FT_Outline_ConicTo_Func                                            */\n  /*    FT_Outline_CubicTo_Func                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walk over an outline's structure to decompose it into individual   */\n  /*    segments and Bézier arcs.  This function also emits `move to'      */\n  /*    operations to indicate the start of new contours in the outline.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e., function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer which is passed to each       */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_New                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new outline of a given size.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object from where the       */\n  /*                   outline is allocated.  Note however that the new    */\n  /*                   outline will *not* necessarily be *freed*, when     */\n  /*                   destroying the library, by @FT_Done_FreeType.       */\n  /*                                                                       */\n  /*    numPoints   :: The maximum number of points within the outline.    */\n  /*                   Must be smaller than or equal to 0xFFFF (65535).    */\n  /*                                                                       */\n  /*    numContours :: The maximum number of contours within the outline.  */\n  /*                   This value must be in the range 0 to `numPoints'.   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    anoutline   :: A handle to the new outline.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' parameter is simply */\n  /*    to use the library's memory allocator.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy an outline created with @FT_Outline_New.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle of the library object used to allocate the     */\n  /*               outline.                                                */\n  /*                                                                       */\n  /*    outline :: A pointer to the outline object to be discarded.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the outline's `owner' field is not set, only the outline        */\n  /*    descriptor will be released.                                       */\n  /*                                                                       */\n  /*    The reason why this function takes an `library' parameter is       */\n  /*    simply to use ft_mem_free().                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check the contents of an outline descriptor.                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A handle to a source outline.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_CBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an outline's `control box'.  The control box encloses all   */\n  /*    the outline's points, including Bézier control points.  Though it  */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox   :: The outline's control box.                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Translate                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple translation to the points of an outline.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    xOffset :: The horizontal offset.                                  */\n  /*                                                                       */\n  /*    yOffset :: The vertical offset.                                    */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Copy                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy an outline into another one.  Both objects must have the      */\n  /*    same sizes (number of points & number of contours) when this       */\n  /*    function is called.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source outline.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target outline.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Transform                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple 2x2 matrix to all of an outline's points.  Useful   */\n  /*    for applying rotations, slanting, flipping, etc.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix  :: A pointer to the transformation matrix.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can use @FT_Outline_Translate if you need to translate the     */\n  /*    outline's points.                                                  */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Embolden                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be at most 4~times      */\n  /*    `strength' pixels wider and higher.  You may think of the left and */\n  /*    bottom borders as unchanged.                                       */\n  /*                                                                       */\n  /*    Negative `strength' values to reduce the outline thickness are     */\n  /*    possible also.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline  :: A handle to the target outline.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strength :: How strong the glyph is emboldened.  Expressed in      */\n  /*                26.6 pixel format.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The used algorithm to increase or decrease the thickness of the    */\n  /*    glyph doesn't change the number of points; this means that certain */\n  /*    situations like acute angles or intersections are sometimes        */\n  /*    handled incorrectly.                                               */\n  /*                                                                       */\n  /*    If you need `better' metrics values you should call                */\n  /*    @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.                      */\n  /*                                                                       */\n  /*    Example call:                                                      */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */\n  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */\n  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be `xstrength' pixels   */\n  /*    wider and `ystrength' pixels higher.  Otherwise, it is similar to  */\n  /*    @FT_Outline_Embolden, which uses the same strength in both         */\n  /*    directions.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_EmboldenXY( FT_Outline*  outline,\n                         FT_Pos       xstrength,\n                         FT_Pos       ystrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Reverse                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reverse the drawing direction of an outline.  This is used to      */\n  /*    ensure consistent fill conventions for mirrored glyphs.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in     */\n  /*    the outline's `flags' field.                                       */\n  /*                                                                       */\n  /*    It shouldn't be used by a normal client application, unless it     */\n  /*    knows what it is doing.                                            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Reverse( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap.  The outline's image is simply  */\n  /*    OR-ed to the target bitmap.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the target bitmap descriptor.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT CREATE the bitmap, it only renders an       */\n  /*    outline image within the one you pass to it!  Consequently, the    */\n  /*    various fields in `abitmap' should be set accordingly.             */\n  /*                                                                       */\n  /*    It will use the raster corresponding to the default glyph format.  */\n  /*                                                                       */\n  /*    The value of the `num_grays' field in `abitmap' is ignored.  If    */\n  /*    you select the gray-level rasterizer, and you want less than 256   */\n  /*    gray levels, you have to use @FT_Outline_Render directly.          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap using the current scan-convert.  */\n  /*    This function uses an @FT_Raster_Params structure as an argument,  */\n  /*    allowing advanced features like direct composition, translucency,  */\n  /*    etc.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    params  :: A pointer to an @FT_Raster_Params structure used to     */\n  /*               describe the rendering operation.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should know what you are doing and how @FT_Raster_Params works */\n  /*    to use this function.                                              */\n  /*                                                                       */\n  /*    The field `params.source' will be set to `outline' before the scan */\n  /*    converter is called, which means that the value you give to it is  */\n  /*    actually ignored.                                                  */\n  /*                                                                       */\n  /*    The gray-level rasterizer always uses 256 gray levels.  If you     */\n  /*    want less gray levels, you have to provide your own span callback. */\n  /*    See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the   */\n  /*    @FT_Raster_Params structure for more details.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params );\n\n\n /**************************************************************************\n  *\n  * @enum:\n  *   FT_Orientation\n  *\n  * @description:\n  *   A list of values used to describe an outline's contour orientation.\n  *\n  *   The TrueType and PostScript specifications use different conventions\n  *   to determine whether outline contours should be filled or unfilled.\n  *\n  * @values:\n  *   FT_ORIENTATION_TRUETYPE ::\n  *     According to the TrueType specification, clockwise contours must\n  *     be filled, and counter-clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_POSTSCRIPT ::\n  *     According to the PostScript specification, counter-clockwise contours\n  *     must be filled, and clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_FILL_RIGHT ::\n  *     This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\n  *     remember that in TrueType, everything that is to the right of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_FILL_LEFT ::\n  *     This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\n  *     remember that in PostScript, everything that is to the left of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_NONE ::\n  *     The orientation cannot be determined.  That is, different parts of\n  *     the glyph have different orientation.\n  *\n  */\n  typedef enum  FT_Orientation_\n  {\n    FT_ORIENTATION_TRUETYPE   = 0,\n    FT_ORIENTATION_POSTSCRIPT = 1,\n    FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\n    FT_ORIENTATION_FILL_LEFT  = FT_ORIENTATION_POSTSCRIPT,\n    FT_ORIENTATION_NONE\n\n  } FT_Orientation;\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Outline_Get_Orientation\n  *\n  * @description:\n  *   This function analyzes a glyph outline and tries to compute its\n  *   fill orientation (see @FT_Orientation).  This is done by computing\n  *   the direction of each global horizontal and/or vertical extrema\n  *   within the outline.\n  *\n  *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty\n  *   outlines.\n  *\n  * @input:\n  *   outline ::\n  *     A handle to the source outline.\n  *\n  * @return:\n  *   The orientation.\n  *\n  */\n  FT_EXPORT( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOUTLN_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (specification only).   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2008, 2009 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTPFR_H__\n#define __FTPFR_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    pfr_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    PFR Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    PFR/TrueDoc specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of PFR-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Metrics\n  *\n  * @description:\n  *    Return the outline and metrics resolutions of a given PFR face.\n  *\n  * @input:\n  *    face :: Handle to the input face.  It can be a non-PFR face.\n  *\n  * @output:\n  *    aoutline_resolution ::\n  *      Outline resolution.  This is equivalent to `face->units_per_EM'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_resolution ::\n  *      Metrics resolution.  This is equivalent to `outline_resolution'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_x_scale ::\n  *      A 16.16 fixed-point number used to scale distance expressed\n  *      in metrics units to device sub-pixels.  This is equivalent to\n  *      `face->size->x_scale', but for metrics only.  Optional (parameter\n  *      can be NULL).\n  *\n  *    ametrics_y_scale ::\n  *      Same as `ametrics_x_scale' but for the vertical direction.\n  *      optional (parameter can be NULL).\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If the input face is not a PFR, this function will return an error.\n  *   However, in all cases, it will return valid values.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Kerning\n  *\n  * @description:\n  *    Return the kerning pair corresponding to two glyphs in a PFR face.\n  *    The distance is expressed in metrics units, unlike the result of\n  *    @FT_Get_Kerning.\n  *\n  * @input:\n  *    face  :: A handle to the input face.\n  *\n  *    left  :: Index of the left glyph.\n  *\n  *    right :: Index of the right glyph.\n  *\n  * @output:\n  *    avector :: A kerning vector.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    This function always return distances in original PFR metrics\n  *    units.  This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED\n  *    mode, which always returns distances converted to outline units.\n  *\n  *    You can use the value of the `x_scale' and `y_scale' parameters\n  *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Advance\n  *\n  * @description:\n  *    Return a given glyph advance, expressed in original metrics units,\n  *    from a PFR font.\n  *\n  * @input:\n  *    face   :: A handle to the input face.\n  *\n  *    gindex :: The glyph index.\n  *\n  * @output:\n  *    aadvance :: The glyph advance in metrics units.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics\n  *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftrender.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrender.h                                                             */\n/*                                                                         */\n/*    FreeType renderer modules public interface (specification).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2005, 2006, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRENDER_H__\n#define __FTRENDER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph object */\n  typedef FT_Error\n  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,\n                        FT_GlyphSlot  slot );\n\n  /* destroys a given glyph object */\n  typedef void\n  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );\n\n  typedef void\n  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,\n                             const FT_Matrix*  matrix,\n                             const FT_Vector*  delta );\n\n  typedef void\n  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,\n                           FT_BBox*  abbox );\n\n  typedef FT_Error\n  (*FT_Glyph_CopyFunc)( FT_Glyph   source,\n                        FT_Glyph   target );\n\n  typedef FT_Error\n  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,\n                           FT_GlyphSlot  slot );\n\n/* deprecated */\n#define FT_Glyph_Init_Func       FT_Glyph_InitFunc\n#define FT_Glyph_Done_Func       FT_Glyph_DoneFunc\n#define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc\n#define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc\n#define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc\n#define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc\n\n\n  struct  FT_Glyph_Class_\n  {\n    FT_Long                 glyph_size;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_InitFunc       glyph_init;\n    FT_Glyph_DoneFunc       glyph_done;\n    FT_Glyph_CopyFunc       glyph_copy;\n    FT_Glyph_TransformFunc  glyph_transform;\n    FT_Glyph_GetBBoxFunc    glyph_bbox;\n    FT_Glyph_PrepareFunc    glyph_prepare;\n  };\n\n\n  typedef FT_Error\n  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,\n                             FT_GlyphSlot      slot,\n                             FT_UInt           mode,\n                             const FT_Vector*  origin );\n\n  typedef FT_Error\n  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,\n                                FT_GlyphSlot      slot,\n                                const FT_Matrix*  matrix,\n                                const FT_Vector*  delta );\n\n\n  typedef void\n  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,\n                              FT_GlyphSlot  slot,\n                              FT_BBox*      cbox );\n\n\n  typedef FT_Error\n  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,\n                              FT_ULong     mode_tag,\n                              FT_Pointer   mode_ptr );\n\n/* deprecated identifiers */\n#define FTRenderer_render  FT_Renderer_RenderFunc\n#define FTRenderer_transform  FT_Renderer_TransformFunc\n#define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc\n#define FTRenderer_setMode  FT_Renderer_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The renderer module class descriptor.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root            :: The root @FT_Module_Class fields.               */\n  /*                                                                       */\n  /*    glyph_format    :: The glyph image format this renderer handles.   */\n  /*                                                                       */\n  /*    render_glyph    :: A method used to render the image that is in a  */\n  /*                       given glyph slot into a bitmap.                 */\n  /*                                                                       */\n  /*    transform_glyph :: A method used to transform the image that is in */\n  /*                       a given glyph slot.                             */\n  /*                                                                       */\n  /*    get_glyph_cbox  :: A method used to access the glyph's cbox.       */\n  /*                                                                       */\n  /*    set_mode        :: A method used to pass additional parameters.    */\n  /*                                                                       */\n  /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */\n  /*                       This is a pointer to its raster's class.        */\n  /*                                                                       */\n  typedef struct  FT_Renderer_Class_\n  {\n    FT_Module_Class            root;\n\n    FT_Glyph_Format            glyph_format;\n\n    FT_Renderer_RenderFunc     render_glyph;\n    FT_Renderer_TransformFunc  transform_glyph;\n    FT_Renderer_GetCBoxFunc    get_glyph_cbox;\n    FT_Renderer_SetModeFunc    set_mode;\n\n    FT_Raster_Funcs*           raster_class;\n\n  } FT_Renderer_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the current renderer for a given glyph format.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /*    format  :: The glyph format.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A renderer handle.  0~if none found.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */\n  /*    renderer by its name, use @FT_Get_Module.                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the current renderer to use, and set additional mode.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    renderer   :: A handle to the renderer object.                     */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    parameters :: Additional parameters.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case of success, the renderer will be used to convert glyph     */\n  /*    images in the renderer's known format into bitmaps.                */\n  /*                                                                       */\n  /*    This doesn't change the current renderer for other formats.        */\n  /*                                                                       */\n  /*    Currently, only the B/W renderer, if compiled with                 */\n  /*    FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels               */\n  /*    anti-aliasing mode; this option must be set directly in            */\n  /*    `ftraster.c' and is undefined by default) accepts a single tag     */\n  /*    `pal5' to set its gray palette as a character string with          */\n  /*    5~elements.  Consequently, the third and fourth argument are zero  */\n  /*    normally.                                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTRENDER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftsizes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsizes.h                                                              */\n/*                                                                         */\n/*    FreeType size objects management (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Typical application would normally not need to use these functions.   */\n  /* However, they have been placed in a public API for the rare cases     */\n  /* where they are needed.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSIZES_H__\n#define __FTSIZES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sizes_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Size Management                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Managing multiple sizes per face.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    When creating a new face object (e.g., with @FT_New_Face), an      */\n  /*    @FT_Size object is automatically created and used to store all     */\n  /*    pixel-size dependent information, available in the `face->size'    */\n  /*    field.                                                             */\n  /*                                                                       */\n  /*    It is however possible to create more sizes for a given face,      */\n  /*    mostly in order to manage several character pixel sizes of the     */\n  /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */\n  /*                                                                       */\n  /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */\n  /*    modify the contents of the current `active' size; you thus need    */\n  /*    to use @FT_Activate_Size to change it.                             */\n  /*                                                                       */\n  /*    99% of applications won't need the functions provided here,        */\n  /*    especially if they use the caching sub-system, so be cautious      */\n  /*    when using these.                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Size                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new size object from a given face object.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a parent face object.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize :: A handle to a new size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You need to call @FT_Activate_Size in order to select the new size */\n  /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */\n  /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size*  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Size                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given size object.  Note that @FT_Done_Face              */\n  /*    automatically discards all size objects allocated with             */\n  /*    @FT_New_Size.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Size( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Activate_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Even though it is possible to create several size objects for a    */\n  /*    given face (see @FT_New_Size for details), functions like          */\n  /*    @FT_Load_Glyph or @FT_Load_Char only use the one which has been    */\n  /*    activated last to determine the `current character pixel size'.    */\n  /*                                                                       */\n  /*    This function can be used to `activate' a previously created size  */\n  /*    object.                                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `face' is the size's parent face object, this function changes  */\n  /*    the value of `face->size' to the input size handle.                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Activate_Size( FT_Size  size );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSIZES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftsnames.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.h                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (specification).  */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_SFNT_NAMES_H__\n#define __FT_SFNT_NAMES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sfnt_names                                                         */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    SFNT Names                                                         */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Access the names embedded in TrueType and OpenType files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType and OpenType specifications allow the inclusion of    */\n  /*    a special `names table' in font files.  This table contains        */\n  /*    textual (and internationalized) information regarding the font,    */\n  /*    like family name, copyright, version, etc.                         */\n  /*                                                                       */\n  /*    The definitions below are used to access them if available.        */\n  /*                                                                       */\n  /*    Note that this has nothing to do with glyph names!                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SfntName                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model an SFNT `name' table entry.              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platform_id :: The platform ID for `string'.                       */\n  /*                                                                       */\n  /*    encoding_id :: The encoding ID for `string'.                       */\n  /*                                                                       */\n  /*    language_id :: The language ID for `string'.                       */\n  /*                                                                       */\n  /*    name_id     :: An identifier for `string'.                         */\n  /*                                                                       */\n  /*    string      :: The `name' string.  Note that its format differs    */\n  /*                   depending on the (platform,encoding) pair.  It can  */\n  /*                   be a Pascal String, a UTF-16 one, etc.              */\n  /*                                                                       */\n  /*                   Generally speaking, the string is not               */\n  /*                   zero-terminated.  Please refer to the TrueType      */\n  /*                   specification for details.                          */\n  /*                                                                       */\n  /*    string_len  :: The length of `string' in bytes.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Possible values for `platform_id', `encoding_id', `language_id',   */\n  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */\n  /*    please refer to the TrueType or OpenType specification.            */\n  /*                                                                       */\n  /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */\n  /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */\n  /*                                                                       */\n  typedef struct  FT_SfntName_\n  {\n    FT_UShort  platform_id;\n    FT_UShort  encoding_id;\n    FT_UShort  language_id;\n    FT_UShort  name_id;\n\n    FT_Byte*   string;      /* this string is *not* null-terminated! */\n    FT_UInt    string_len;  /* in bytes */\n\n  } FT_SfntName;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name_Count                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the number of name strings in the SFNT `name' table.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of strings in the `name' table.                         */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a string of the SFNT `name' table for a given index.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to the source face.                              */\n  /*                                                                       */\n  /*    idx   :: The index of the `name' string.                           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aname :: The indexed @FT_SfntName structure.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `string' array returned in the `aname' structure is not        */\n  /*    null-terminated.  The application should deallocate it if it is no */\n  /*    longer in use.                                                     */\n  /*                                                                       */\n  /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */\n  /*    `name' table entries, then do a loop until you get the right       */\n  /*    platform, encoding, and name ID.                                   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname );\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred family subfamily names in `name'\n   *   table since OpenType version 1.4.  For backwards compatibility with\n   *   legacy systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred subfamily names in `name' table since\n   *   OpenType version 1.4.  For backwards compatibility with legacy\n   *   systems which has 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_SFNT_NAMES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftstroke.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.h                                                             */\n/*                                                                         */\n/*    FreeType path stroker (specification).                               */\n/*                                                                         */\n/*  Copyright 2002-2006, 2008, 2009, 2011-2012 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_STROKE_H__\n#define __FT_STROKE_H__\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n /************************************************************************\n  *\n  * @section:\n  *    glyph_stroker\n  *\n  * @title:\n  *    Glyph Stroker\n  *\n  * @abstract:\n  *    Generating bordered and stroked glyphs.\n  *\n  * @description:\n  *    This component generates stroked outlines of a given vectorial\n  *    glyph.  It also allows you to retrieve the `outside' and/or the\n  *    `inside' borders of the stroke.\n  *\n  *    This can be useful to generate `bordered' glyph, i.e., glyphs\n  *    displayed with a coloured (and anti-aliased) border around their\n  *    shape.\n  */\n\n\n /**************************************************************\n  *\n  * @type:\n  *   FT_Stroker\n  *\n  * @description:\n  *   Opaque handler to a path stroker object.\n  */\n  typedef struct FT_StrokerRec_*  FT_Stroker;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineJoin\n   *\n   * @description:\n   *   These values determine how two joining lines are rendered\n   *   in a stroker.\n   *\n   * @values:\n   *   FT_STROKER_LINEJOIN_ROUND ::\n   *     Used to render rounded line joins.  Circular arcs are used\n   *     to join two lines smoothly.\n   *\n   *   FT_STROKER_LINEJOIN_BEVEL ::\n   *     Used to render beveled line joins.  The outer corner of\n   *     the joined lines is filled by enclosing the triangular\n   *     region of the corner with a straight line between the\n   *     outer corners of each stroke.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_FIXED ::\n   *     Used to render mitered line joins, with fixed bevels if the\n   *     miter limit is exceeded.  The outer edges of the strokes\n   *     for the two segments are extended until they meet at an\n   *     angle.  If the segments meet at too sharp an angle (such\n   *     that the miter would extend from the intersection of the\n   *     segments a distance greater than the product of the miter\n   *     limit value and the border radius), then a bevel join (see\n   *     above) is used instead.  This prevents long spikes being\n   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter\n   *     line join as used in PostScript and PDF.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::\n   *   FT_STROKER_LINEJOIN_MITER ::\n   *     Used to render mitered line joins, with variable bevels if\n   *     the miter limit is exceeded.  The intersection of the\n   *     strokes is clipped at a line perpendicular to the bisector\n   *     of the angle between the strokes, at the distance from the\n   *     intersection of the segments equal to the product of the\n   *     miter limit value and the border radius.  This prevents\n   *     long spikes being created.\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line\n   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias\n   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for\n   *     backwards compatibility.\n   */\n  typedef enum  FT_Stroker_LineJoin_\n  {\n    FT_STROKER_LINEJOIN_ROUND          = 0,\n    FT_STROKER_LINEJOIN_BEVEL          = 1,\n    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,\n    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,\n    FT_STROKER_LINEJOIN_MITER_FIXED    = 3\n\n  } FT_Stroker_LineJoin;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineCap\n   *\n   * @description:\n   *   These values determine how the end of opened sub-paths are\n   *   rendered in a stroke.\n   *\n   * @values:\n   *   FT_STROKER_LINECAP_BUTT ::\n   *     The end of lines is rendered as a full stop on the last\n   *     point itself.\n   *\n   *   FT_STROKER_LINECAP_ROUND ::\n   *     The end of lines is rendered as a half-circle around the\n   *     last point.\n   *\n   *   FT_STROKER_LINECAP_SQUARE ::\n   *     The end of lines is rendered as a square around the\n   *     last point.\n   */\n  typedef enum  FT_Stroker_LineCap_\n  {\n    FT_STROKER_LINECAP_BUTT = 0,\n    FT_STROKER_LINECAP_ROUND,\n    FT_STROKER_LINECAP_SQUARE\n\n  } FT_Stroker_LineCap;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_StrokerBorder\n   *\n   * @description:\n   *   These values are used to select a given stroke border\n   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.\n   *\n   * @values:\n   *   FT_STROKER_BORDER_LEFT ::\n   *     Select the left border, relative to the drawing direction.\n   *\n   *   FT_STROKER_BORDER_RIGHT ::\n   *     Select the right border, relative to the drawing direction.\n   *\n   * @note:\n   *   Applications are generally interested in the `inside' and `outside'\n   *   borders.  However, there is no direct mapping between these and the\n   *   `left' and `right' ones, since this really depends on the glyph's\n   *   drawing orientation, which varies between font formats.\n   *\n   *   You can however use @FT_Outline_GetInsideBorder and\n   *   @FT_Outline_GetOutsideBorder to get these.\n   */\n  typedef enum  FT_StrokerBorder_\n  {\n    FT_STROKER_BORDER_LEFT = 0,\n    FT_STROKER_BORDER_RIGHT\n\n  } FT_StrokerBorder;\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetInsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `inside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetOutsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `outside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_New\n   *\n   * @description:\n   *   Create a new stroker object.\n   *\n   * @input:\n   *   library ::\n   *     FreeType library handle.\n   *\n   * @output:\n   *   astroker ::\n   *     A new stroker object handle.  NULL in case of error.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Set\n   *\n   * @description:\n   *   Reset a stroker object's attributes.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   radius ::\n   *     The border radius.\n   *\n   *   line_cap ::\n   *     The line cap style.\n   *\n   *   line_join ::\n   *     The line join style.\n   *\n   *   miter_limit ::\n   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,\n   *     expressed as 16.16 fixed-point value.\n   *\n   * @note:\n   *   The radius is expressed in the same units as the outline\n   *   coordinates.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Rewind\n   *\n   * @description:\n   *   Reset a stroker object without changing its attributes.\n   *   You should call this function before beginning a new\n   *   series of calls to @FT_Stroker_BeginSubPath or\n   *   @FT_Stroker_EndSubPath.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ParseOutline\n   *\n   * @description:\n   *   A convenience function used to parse a whole outline with\n   *   the stroker.  The resulting outline(s) can be retrieved\n   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The source outline.\n   *\n   *   opened ::\n   *     A boolean.  If~1, the outline is treated as an open path instead\n   *     of a closed one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If `opened' is~0 (the default), the outline is treated as a closed\n   *   path, and the stroker generates two distinct `border' outlines.\n   *\n   *   If `opened' is~1, the outline is processed as an open path, and the\n   *   stroker generates a single `stroke' outline.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_BeginSubPath\n   *\n   * @description:\n   *   Start a new sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the start vector.\n   *\n   *   open ::\n   *     A boolean.  If~1, the sub-path is treated as an open one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function is useful when you need to stroke a path that is\n   *   not stored as an @FT_Outline object.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_EndSubPath\n   *\n   * @description:\n   *   Close the current sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function after @FT_Stroker_BeginSubPath.\n   *   If the subpath was not `opened', this function `draws' a\n   *   single line segment to the start position when needed.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_LineTo\n   *\n   * @description:\n   *   `Draw' a single line segment in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ConicTo\n   *\n   * @description:\n   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control ::\n   *     A pointer to a Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_CubicTo\n   *\n   * @description:\n   *   `Draw' a single cubic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control1 ::\n   *     A pointer to the first Bézier control point.\n   *\n   *   control2 ::\n   *     A pointer to second Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetBorderCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export one of the `border' or `stroke'\n   *   outlines generated by the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_GetCounts instead if you want to\n   *   retrieve the counts associated to both borders.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ExportBorder\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the corresponding border to your own @FT_Outline\n   *   structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   *   outline ::\n   *     The target outline handle.\n   *\n   * @note:\n   *   Always call this function after @FT_Stroker_GetBorderCounts to\n   *   get sure that there is enough room in your @FT_Outline object to\n   *   receive all new data.\n   *\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps. The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_Export instead if you want to\n   *   retrieve all borders at once.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export all points/borders from the stroked\n   *   outline/path.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Export\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export all borders to your own @FT_Outline structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The target outline handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Done\n   *\n   * @description:\n   *   Destroy a stroker object.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.  Can be NULL.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Done( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_Stroke\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_StrokeBorder\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker, but\n   *   only return either its inside or outside border.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   inside ::\n   *     A Boolean.  If~1, return the inside border, otherwise\n   *     the outside border.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FT_STROKE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftsynth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.h                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting              */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2006, 2008, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********        WARNING, THIS IS ALPHA CODE!  THIS API         *********/\n  /*********    IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE    *********/\n  /*********            FREETYPE DEVELOPMENT TEAM                  *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Main reason for not lifting the functions in this module to a  */\n  /* `standard' API is that the used parameters for emboldening and */\n  /* slanting are not configurable.  Consider the functions as a    */\n  /* code resource which should be copied into the application and  */\n  /* adapted to the particular needs.                               */\n\n\n#ifndef __FTSYNTH_H__\n#define __FTSYNTH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /* Embolden a glyph by a `reasonable' value (which is highly a matter of */\n  /* taste).  This function is actually a convenience function, providing  */\n  /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */\n  /*                                                                       */\n  /* For emboldened outlines the height, width, and advance metrics are    */\n  /* increased by the strength of the emboldening.  You can also call      */\n  /* @FT_Outline_Get_CBox to get precise values.                           */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );\n\n  /* Slant an outline glyph to the right by about 12 degrees. */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTSYNTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftsystem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.h                                                             */\n/*                                                                         */\n/*    FreeType low-level system interface definition (specification).      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSYSTEM_H__\n#define __FTSYSTEM_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   system_interface                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   System Interface                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   How FreeType manages memory and i/o.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This section contains various definitions related to memory         */\n  /*   management and i/o access.  You need to understand this             */\n  /*   information if you want to use a custom memory manager or you own   */\n  /*   i/o streams.                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  M E M O R Y   M A N A G E M E N T                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Memory\n   *\n   * @description:\n   *   A handle to a given memory manager object, defined with an\n   *   @FT_MemoryRec structure.\n   *\n   */\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Alloc_Func\n   *\n   * @description:\n   *   A function used to allocate `size' bytes from `memory'.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   size ::\n   *     The size in bytes to allocate.\n   *\n   * @return:\n   *   Address of new memory block.  0~in case of failure.\n   *\n   */\n  typedef void*\n  (*FT_Alloc_Func)( FT_Memory  memory,\n                    long       size );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Free_Func\n   *\n   * @description:\n   *   A function used to release a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   block ::\n   *     The address of the target memory block.\n   *\n   */\n  typedef void\n  (*FT_Free_Func)( FT_Memory  memory,\n                   void*      block );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Realloc_Func\n   *\n   * @description:\n   *   A function used to re-allocate a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   cur_size ::\n   *     The block's current size in bytes.\n   *\n   *   new_size ::\n   *     The block's requested new size.\n   *\n   *   block ::\n   *     The block's current address.\n   *\n   * @return:\n   *   New block address.  0~in case of memory shortage.\n   *\n   * @note:\n   *   In case of error, the old block must still be available.\n   *\n   */\n  typedef void*\n  (*FT_Realloc_Func)( FT_Memory  memory,\n                      long       cur_size,\n                      long       new_size,\n                      void*      block );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_MemoryRec\n   *\n   * @description:\n   *   A structure used to describe a given memory manager to FreeType~2.\n   *\n   * @fields:\n   *   user ::\n   *     A generic typeless pointer for user data.\n   *\n   *   alloc ::\n   *     A pointer type to an allocation function.\n   *\n   *   free ::\n   *     A pointer type to an memory freeing function.\n   *\n   *   realloc ::\n   *     A pointer type to a reallocation function.\n   *\n   */\n  struct  FT_MemoryRec_\n  {\n    void*            user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       I / O   M A N A G E M E N T                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Stream\n   *\n   * @description:\n   *   A handle to an input stream.\n   *\n   */\n  typedef struct FT_StreamRec_*  FT_Stream;\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamDesc\n   *\n   * @description:\n   *   A union type used to store either a long or a pointer.  This is used\n   *   to store a file descriptor or a `FILE*' in an input stream.\n   *\n   */\n  typedef union  FT_StreamDesc_\n  {\n    long   value;\n    void*  pointer;\n\n  } FT_StreamDesc;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_IoFunc\n   *\n   * @description:\n   *   A function used to seek and read data from a given input stream.\n   *\n   * @input:\n   *   stream ::\n   *     A handle to the source stream.\n   *\n   *   offset ::\n   *     The offset of read in stream (always from start).\n   *\n   *   buffer ::\n   *     The address of the read buffer.\n   *\n   *   count ::\n   *     The number of bytes to read from the stream.\n   *\n   * @return:\n   *   The number of bytes effectively read by the stream.\n   *\n   * @note:\n   *   This function might be called to perform a seek or skip operation\n   *   with a `count' of~0.  A non-zero return value then indicates an\n   *   error.\n   *\n   */\n  typedef unsigned long\n  (*FT_Stream_IoFunc)( FT_Stream       stream,\n                       unsigned long   offset,\n                       unsigned char*  buffer,\n                       unsigned long   count );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_CloseFunc\n   *\n   * @description:\n   *   A function used to close a given input stream.\n   *\n   * @input:\n   *  stream ::\n   *     A handle to the target stream.\n   *\n   */\n  typedef void\n  (*FT_Stream_CloseFunc)( FT_Stream  stream );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamRec\n   *\n   * @description:\n   *   A structure used to describe an input stream.\n   *\n   * @input:\n   *   base ::\n   *     For memory-based streams, this is the address of the first stream\n   *     byte in memory.  This field should always be set to NULL for\n   *     disk-based streams.\n   *\n   *   size ::\n   *     The stream size in bytes.\n   *\n   *   pos ::\n   *     The current position within the stream.\n   *\n   *   descriptor ::\n   *     This field is a union that can hold an integer or a pointer.  It is\n   *     used by stream implementations to store file descriptors or `FILE*'\n   *     pointers.\n   *\n   *   pathname ::\n   *     This field is completely ignored by FreeType.  However, it is often\n   *     useful during debugging to use it to store the stream's filename\n   *     (where available).\n   *\n   *   read ::\n   *     The stream's input function.\n   *\n   *   close ::\n   *     The stream's close function.\n   *\n   *   memory ::\n   *     The memory manager to use to preload frames.  This is set\n   *     internally by FreeType and shouldn't be touched by stream\n   *     implementations.\n   *\n   *   cursor ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   *   limit ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   */\n  typedef struct  FT_StreamRec_\n  {\n    unsigned char*       base;\n    unsigned long        size;\n    unsigned long        pos;\n\n    FT_StreamDesc        descriptor;\n    FT_StreamDesc        pathname;\n    FT_Stream_IoFunc     read;\n    FT_Stream_CloseFunc  close;\n\n    FT_Memory            memory;\n    unsigned char*       cursor;\n    unsigned char*       limit;\n\n  } FT_StreamRec;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSYSTEM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/fttrigon.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.h                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (specification).                    */\n/*                                                                         */\n/*  Copyright 2001, 2003, 2005, 2007, 2013 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTRIGON_H__\n#define __FTTRIGON_H__\n\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   computations                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Angle\n   *\n   * @description:\n   *   This type is used to model angle values in FreeType.  Note that the\n   *   angle is a 16.16 fixed-point value expressed in degrees.\n   *\n   */\n  typedef FT_Fixed  FT_Angle;\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI\n   *\n   * @description:\n   *   The angle pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI  ( 180L << 16 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_2PI\n   *\n   * @description:\n   *   The angle 2*pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI2\n   *\n   * @description:\n   *   The angle pi/2 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI4\n   *\n   * @description:\n   *   The angle pi/4 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Sin\n   *\n   * @description:\n   *   Return the sinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The sinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Sin( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Cos\n   *\n   * @description:\n   *   Return the cosinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The cosinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Cos( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Tan\n   *\n   * @description:\n   *   Return the tangent of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The tangent value.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Tan( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Atan2\n   *\n   * @description:\n   *   Return the arc-tangent corresponding to a given vector (x,y) in\n   *   the 2d plane.\n   *\n   * @input:\n   *   x ::\n   *     The horizontal vector coordinate.\n   *\n   *   y ::\n   *     The vertical vector coordinate.\n   *\n   * @return:\n   *   The arc-tangent value (i.e. angle).\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Atan2( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Angle_Diff\n   *\n   * @description:\n   *   Return the difference between two angles.  The result is always\n   *   constrained to the ]-PI..PI] interval.\n   *\n   * @input:\n   *   angle1 ::\n   *     First angle.\n   *\n   *   angle2 ::\n   *     Second angle.\n   *\n   * @return:\n   *   Constrained value of `value2-value1'.\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Unit\n   *\n   * @description:\n   *   Return the unit vector corresponding to a given angle.  After the\n   *   call, the value of `vec.x' will be `sin(angle)', and the value of\n   *   `vec.y' will be `cos(angle)'.\n   *\n   *   This function is useful to retrieve both the sinus and cosinus of a\n   *   given angle quickly.\n   *\n   * @output:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Rotate\n   *\n   * @description:\n   *   Rotate a vector by a given angle.\n   *\n   * @inout:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Length\n   *\n   * @description:\n   *   Return the length of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @return:\n   *   The vector length, expressed in the same units that the original\n   *   vector coordinates.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Polarize\n   *\n   * @description:\n   *   Compute both the length and angle of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @output:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_From_Polar\n   *\n   * @description:\n   *   Compute vector coordinates from a length and angle.\n   *\n   * @output:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @input:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTTRIGON_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftttdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftttdrv.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the TrueType driver                     */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTTDRV_H__\n#define __FTTTDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   tt_driver\n   *\n   * @title:\n   *   The TrueType driver\n   *\n   * @abstract:\n   *   Controlling the TrueType driver module.\n   *\n   * @description:\n   *   While FreeType's TrueType driver doesn't expose API functions by\n   *   itself, it is possible to control its behaviour with @FT_Property_Set\n   *   and @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The TrueType driver's module name is `truetype'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   interpreter-version\n   *\n   * @description:\n   *   Currently, two versions are available which represent the bytecode\n   *   interpreter with and without subpixel hinting support,\n   *   respectively.  The default is subpixel support if\n   *   TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel\n   *   support otherwise (since it isn't available then).\n   *\n   *   If subpixel hinting is on, many TrueType bytecode instructions\n   *   behave differently compared to B/W or grayscale rendering.  The\n   *   main idea is to render at a much increased horizontal resolution,\n   *   then sampling down the created output to subpixel precision.\n   *   However, many older fonts are not suited to this and must be\n   *   specially taken care of by applying (hardcoded) font-specific\n   *   tweaks.\n   *\n   *   Details on subpixel hinting and some of the necessary tweaks can be\n   *   found in Greg Hitchcock's whitepaper at\n   *   `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.\n   *\n   *   The following example code demonstrates how to activate subpixel\n   *   hinting (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_38;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"truetype\",\n   *                               \"interpreter-version\",\n   *                               &interpreter_version );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   TT_INTERPRETER_VERSION_XXX\n   *\n   * @description:\n   *   A list of constants used for the @interpreter-version property to\n   *   select the hinting engine for Truetype fonts.\n   *\n   *   The numeric value in the constant names represents the version\n   *   number as returned by the `GETINFO' bytecode instruction.\n   *\n   * @values:\n   *   TT_INTERPRETER_VERSION_35 ::\n   *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in\n   *     Windows~98; only grayscale and B/W rasterizing is supported.\n   *\n   *   TT_INTERPRETER_VERSION_38 ::\n   *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly\n   *     equivalent to the hinting provided by DirectWrite ClearType (as\n   *     can be found, for example, in the Internet Explorer~9 running on\n   *     Windows~7).\n   *\n   * @note:\n   *   This property controls the behaviour of the bytecode interpreter\n   *   and thus how outlines get hinted.  It does *not* control how glyph\n   *   get rasterized!  In particular, it does not control subpixel color\n   *   filtering.\n   *\n   *   If FreeType has not been compiled with configuration option\n   *   FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an\n   *   `FT_Err_Unimplemented_Feature' error.\n   *\n   */\n#define TT_INTERPRETER_VERSION_35  35\n#define TT_INTERPRETER_VERSION_38  38\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTTTDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/fttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttypes.h                                                              */\n/*                                                                         */\n/*    FreeType simple types definitions (specification only).              */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTYPES_H__\n#define __FTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_SYSTEM_H\n#include FT_IMAGE_H\n\n#include <stddef.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Basic Data Types                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The basic data types defined by the library.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the basic data types defined by FreeType~2,  */\n  /*    ranging from simple scalar types to bitmap descriptors.  More      */\n  /*    font-specific structures are defined in a different section.       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Byte                                                            */\n  /*    FT_Bytes                                                           */\n  /*    FT_Char                                                            */\n  /*    FT_Int                                                             */\n  /*    FT_UInt                                                            */\n  /*    FT_Int16                                                           */\n  /*    FT_UInt16                                                          */\n  /*    FT_Int32                                                           */\n  /*    FT_UInt32                                                          */\n  /*    FT_Short                                                           */\n  /*    FT_UShort                                                          */\n  /*    FT_Long                                                            */\n  /*    FT_ULong                                                           */\n  /*    FT_Bool                                                            */\n  /*    FT_Offset                                                          */\n  /*    FT_PtrDist                                                         */\n  /*    FT_String                                                          */\n  /*    FT_Tag                                                             */\n  /*    FT_Error                                                           */\n  /*    FT_Fixed                                                           */\n  /*    FT_Pointer                                                         */\n  /*    FT_Pos                                                             */\n  /*    FT_Vector                                                          */\n  /*    FT_BBox                                                            */\n  /*    FT_Matrix                                                          */\n  /*    FT_FWord                                                           */\n  /*    FT_UFWord                                                          */\n  /*    FT_F2Dot14                                                         */\n  /*    FT_UnitVector                                                      */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /*                                                                       */\n  /*    FT_Generic                                                         */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /*    FT_Bitmap                                                          */\n  /*    FT_Pixel_Mode                                                      */\n  /*    FT_Palette_Mode                                                    */\n  /*    FT_Glyph_Format                                                    */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bool                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef of unsigned char, used for simple booleans.  As usual,   */\n  /*    values 1 and~0 represent true and false, respectively.             */\n  /*                                                                       */\n  typedef unsigned char  FT_Bool;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_FWord                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 16-bit integer used to store a distance in original font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  typedef signed short  FT_FWord;   /* distance in FUnits */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UFWord                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An unsigned 16-bit integer used to store a distance in original    */\n  /*    font units.                                                        */\n  /*                                                                       */\n  typedef unsigned short  FT_UFWord;  /* unsigned distance */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Char                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _signed_ char type.                       */\n  /*                                                                       */\n  typedef signed char  FT_Char;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Byte                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _unsigned_ char type.                     */\n  /*                                                                       */\n  typedef unsigned char  FT_Byte;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bytes                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for constant memory areas.                               */\n  /*                                                                       */\n  typedef const FT_Byte*  FT_Bytes;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Tag                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for 32-bit tags (as used in the SFNT format).            */\n  /*                                                                       */\n  typedef FT_UInt32  FT_Tag;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_String                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the char type, usually used for strings.      */\n  /*                                                                       */\n  typedef char  FT_String;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Short                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed short.                                        */\n  /*                                                                       */\n  typedef signed short  FT_Short;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UShort                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned short.                                      */\n  /*                                                                       */\n  typedef unsigned short  FT_UShort;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the int type.                                        */\n  /*                                                                       */\n  typedef signed int  FT_Int;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the unsigned int type.                               */\n  /*                                                                       */\n  typedef unsigned int  FT_UInt;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Long                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed long.                                         */\n  /*                                                                       */\n  typedef signed long  FT_Long;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ULong                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned long.                                       */\n  /*                                                                       */\n  typedef unsigned long  FT_ULong;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F2Dot14                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 2.14 fixed-point type used for unit vectors.              */\n  /*                                                                       */\n  typedef signed short  FT_F2Dot14;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 26.6 fixed-point type used for vectorial pixel            */\n  /*    coordinates.                                                       */\n  /*                                                                       */\n  typedef signed long  FT_F26Dot6;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Fixed                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is used to store 16.16 fixed-point values, like scaling  */\n  /*    values or matrix coefficients.                                     */\n  /*                                                                       */\n  typedef signed long  FT_Fixed;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Error                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType error code type.  A value of~0 is always interpreted  */\n  /*    as a successful operation.                                         */\n  /*                                                                       */\n  typedef int  FT_Error;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pointer                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for a typeless pointer.                           */\n  /*                                                                       */\n  typedef void*  FT_Pointer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Offset                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `size_t' type, i.e., the largest  */\n  /*    _unsigned_ integer type used to express a file size or position,   */\n  /*    or a memory block size.                                            */\n  /*                                                                       */\n  typedef size_t  FT_Offset;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_PtrDist                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the       */\n  /*    largest _signed_ integer type used to express the distance         */\n  /*    between two pointers.                                              */\n  /*                                                                       */\n  typedef ft_ptrdiff_t  FT_PtrDist;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_UnitVector                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector unit vector.  Uses    */\n  /*    FT_F2Dot14 types.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: Horizontal coordinate.                                        */\n  /*                                                                       */\n  /*    y :: Vertical coordinate.                                          */\n  /*                                                                       */\n  typedef struct  FT_UnitVector_\n  {\n    FT_F2Dot14  x;\n    FT_F2Dot14  y;\n\n  } FT_UnitVector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Matrix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */\n  /*    in 16.16 fixed-point format.  The computation performed is:        */\n  /*                                                                       */\n  /*       {                                                               */\n  /*          x' = x*xx + y*xy                                             */\n  /*          y' = x*yx + y*yy                                             */\n  /*       }                                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    xy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  typedef struct  FT_Matrix_\n  {\n    FT_Fixed  xx, xy;\n    FT_Fixed  yx, yy;\n\n  } FT_Matrix;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read-only binary data represented as a pointer and a length.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    pointer :: The data.                                               */\n  /*                                                                       */\n  /*    length  :: The length of the data in bytes.                        */\n  /*                                                                       */\n  typedef struct  FT_Data_\n  {\n    const FT_Byte*  pointer;\n    FT_Int          length;\n\n  } FT_Data;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Describe a function used to destroy the `client' data of any       */\n  /*    FreeType object.  See the description of the @FT_Generic type for  */\n  /*    details of usage.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The address of the FreeType object which is under finalization.    */\n  /*    Its client data is accessed through its `generic' field.           */\n  /*                                                                       */\n  typedef void  (*FT_Generic_Finalizer)(void*  object);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Generic                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Client applications often need to associate their own data to a    */\n  /*    variety of FreeType core objects.  For example, a text layout API  */\n  /*    might want to associate a glyph cache to a given size object.      */\n  /*                                                                       */\n  /*    Some FreeType object contains a `generic' field, of type           */\n  /*    FT_Generic, which usage is left to client applications and font    */\n  /*    servers.                                                           */\n  /*                                                                       */\n  /*    It can be used to store a pointer to client-specific data, as well */\n  /*    as the address of a `finalizer' function, which will be called by  */\n  /*    FreeType when the object is destroyed (for example, the previous   */\n  /*    client example would put the address of the glyph cache destructor */\n  /*    in the `finalizer' field).                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    data      :: A typeless pointer to any client-specified data. This */\n  /*                 field is completely ignored by the FreeType library.  */\n  /*                                                                       */\n  /*    finalizer :: A pointer to a `generic finalizer' function, which    */\n  /*                 will be called when the object is destroyed.  If this */\n  /*                 field is set to NULL, no code will be called.         */\n  /*                                                                       */\n  typedef struct  FT_Generic_\n  {\n    void*                 data;\n    FT_Generic_Finalizer  finalizer;\n\n  } FT_Generic;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags which are used to label       */\n  /*    TrueType tables into an unsigned long to be used within FreeType.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The produced values *must* be 32-bit integers.  Don't redefine     */\n  /*    this macro.                                                        */\n  /*                                                                       */\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          (FT_Tag)                        \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                    L I S T   M A N A G E M E N T                      */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ListNode                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     Many elements and objects in FreeType are listed through an       */\n  /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */\n  /*     FT_ListNode is a handle to a single list element.                 */\n  /*                                                                       */\n  typedef struct FT_ListNodeRec_*  FT_ListNode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_List                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a list record (see @FT_ListRec).                       */\n  /*                                                                       */\n  typedef struct FT_ListRec_*  FT_List;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a single list element.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    prev :: The previous element in the list.  NULL if first.          */\n  /*                                                                       */\n  /*    next :: The next element in the list.  NULL if last.               */\n  /*                                                                       */\n  /*    data :: A typeless pointer to the listed object.                   */\n  /*                                                                       */\n  typedef struct  FT_ListNodeRec_\n  {\n    FT_ListNode  prev;\n    FT_ListNode  next;\n    void*        data;\n\n  } FT_ListNodeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a simple doubly-linked list.  These are   */\n  /*    used in many parts of FreeType.                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    head :: The head (first element) of doubly-linked list.            */\n  /*                                                                       */\n  /*    tail :: The tail (last element) of doubly-linked list.             */\n  /*                                                                       */\n  typedef struct  FT_ListRec_\n  {\n    FT_ListNode  head;\n    FT_ListNode  tail;\n\n  } FT_ListRec;\n\n\n  /* */\n\n#define FT_IS_EMPTY( list )  ( (list).head == 0 )\n#define FT_BOOL( x )  ( (FT_Bool)( x ) )\n\n  /* concatenate C tokens */\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n  /* see `ftmoderr.h' for descriptions of the following macros */\n\n#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#define FT_ERROR_BASE( x )    ( (x) & 0xFF )\n#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )\n\n#define FT_ERR_EQ( x, e )                                        \\\n          ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )\n#define FT_ERR_NEQ( x, e )                                       \\\n          ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.h                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows fnt-specific data.                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2008 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTWINFNT_H__\n#define __FTWINFNT_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    winfnt_fonts                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Window FNT Files                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Windows FNT specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Windows FNT specific      */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_WinFNT_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `charset' byte in\n   *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX\n   *   encodings (except for cp1361) can be found at ftp://ftp.unicode.org\n   *   in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory.  cp1361 is\n   *   roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.\n   *\n   * @values:\n   *   FT_WinFNT_ID_DEFAULT ::\n   *     This is used for font enumeration and font creation as a\n   *     `don't care' value.  Valid font files don't contain this value.\n   *     When querying for information about the character set of the font\n   *     that is currently selected into a specified device context, this\n   *     return value (of the related Windows API) simply denotes failure.\n   *\n   *   FT_WinFNT_ID_SYMBOL ::\n   *     There is no known mapping table available.\n   *\n   *   FT_WinFNT_ID_MAC ::\n   *     Mac Roman encoding.\n   *\n   *   FT_WinFNT_ID_OEM ::\n   *     From Michael Pöttgen <michael@poettgen.de>:\n   *\n   *       The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM\n   *       is used for the charset of vector fonts, like `modern.fon',\n   *       `roman.fon', and `script.fon' on Windows.\n   *\n   *       The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value\n   *       specifies a character set that is operating-system dependent.\n   *\n   *       The `IFIMETRICS' documentation from the `Windows Driver\n   *       Development Kit' says: This font supports an OEM-specific\n   *       character set.  The OEM character set is system dependent.\n   *\n   *       In general OEM, as opposed to ANSI (i.e., cp1252), denotes the\n   *       second default codepage that most international versions of\n   *       Windows have.  It is one of the OEM codepages from\n   *\n   *         http://www.microsoft.com/globaldev/reference/cphome.mspx,\n   *\n   *       and is used for the `DOS boxes', to support legacy applications.\n   *       A German Windows version for example usually uses ANSI codepage\n   *       1252 and OEM codepage 850.\n   *\n   *   FT_WinFNT_ID_CP874 ::\n   *     A superset of Thai TIS 620 and ISO 8859-11.\n   *\n   *   FT_WinFNT_ID_CP932 ::\n   *     A superset of Japanese Shift-JIS (with minor deviations).\n   *\n   *   FT_WinFNT_ID_CP936 ::\n   *     A superset of simplified Chinese GB 2312-1980 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP949 ::\n   *     A superset of Korean Hangul KS~C 5601-1987 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP950 ::\n   *     A superset of traditional Chinese Big~5 ETen (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP1250 ::\n   *     A superset of East European ISO 8859-2 (with slightly different\n   *     ordering).\n   *\n   *   FT_WinFNT_ID_CP1251 ::\n   *     A superset of Russian ISO 8859-5 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1252 ::\n   *     ANSI encoding.  A superset of ISO 8859-1.\n   *\n   *   FT_WinFNT_ID_CP1253 ::\n   *     A superset of Greek ISO 8859-7 (with minor modifications).\n   *\n   *   FT_WinFNT_ID_CP1254 ::\n   *     A superset of Turkish ISO 8859-9.\n   *\n   *   FT_WinFNT_ID_CP1255 ::\n   *     A superset of Hebrew ISO 8859-8 (with some modifications).\n   *\n   *   FT_WinFNT_ID_CP1256 ::\n   *     A superset of Arabic ISO 8859-6 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1257 ::\n   *     A superset of Baltic ISO 8859-13 (with some deviations).\n   *\n   *   FT_WinFNT_ID_CP1258 ::\n   *     For Vietnamese.  This encoding doesn't cover all necessary\n   *     characters.\n   *\n   *   FT_WinFNT_ID_CP1361 ::\n   *     Korean (Johab).\n   */\n\n#define FT_WinFNT_ID_CP1252    0\n#define FT_WinFNT_ID_DEFAULT   1\n#define FT_WinFNT_ID_SYMBOL    2\n#define FT_WinFNT_ID_MAC      77\n#define FT_WinFNT_ID_CP932   128\n#define FT_WinFNT_ID_CP949   129\n#define FT_WinFNT_ID_CP1361  130\n#define FT_WinFNT_ID_CP936   134\n#define FT_WinFNT_ID_CP950   136\n#define FT_WinFNT_ID_CP1253  161\n#define FT_WinFNT_ID_CP1254  162\n#define FT_WinFNT_ID_CP1258  163\n#define FT_WinFNT_ID_CP1255  177\n#define FT_WinFNT_ID_CP1256  178\n#define FT_WinFNT_ID_CP1257  186\n#define FT_WinFNT_ID_CP1251  204\n#define FT_WinFNT_ID_CP874   222\n#define FT_WinFNT_ID_CP1250  238\n#define FT_WinFNT_ID_OEM     255\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_HeaderRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Windows FNT Header info.                                           */\n  /*                                                                       */\n  typedef struct  FT_WinFNT_HeaderRec_\n  {\n    FT_UShort  version;\n    FT_ULong   file_size;\n    FT_Byte    copyright[60];\n    FT_UShort  file_type;\n    FT_UShort  nominal_point_size;\n    FT_UShort  vertical_resolution;\n    FT_UShort  horizontal_resolution;\n    FT_UShort  ascent;\n    FT_UShort  internal_leading;\n    FT_UShort  external_leading;\n    FT_Byte    italic;\n    FT_Byte    underline;\n    FT_Byte    strike_out;\n    FT_UShort  weight;\n    FT_Byte    charset;\n    FT_UShort  pixel_width;\n    FT_UShort  pixel_height;\n    FT_Byte    pitch_and_family;\n    FT_UShort  avg_width;\n    FT_UShort  max_width;\n    FT_Byte    first_char;\n    FT_Byte    last_char;\n    FT_Byte    default_char;\n    FT_Byte    break_char;\n    FT_UShort  bytes_per_row;\n    FT_ULong   device_offset;\n    FT_ULong   face_name_offset;\n    FT_ULong   bits_pointer;\n    FT_ULong   bits_offset;\n    FT_Byte    reserved;\n    FT_ULong   flags;\n    FT_UShort  A_space;\n    FT_UShort  B_space;\n    FT_UShort  C_space;\n    FT_UShort  color_table_offset;\n    FT_ULong   reserved1[4];\n\n  } FT_WinFNT_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_Header                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FT_WinFNT_HeaderRec structure.                     */\n  /*                                                                       */\n  typedef struct FT_WinFNT_HeaderRec_*  FT_WinFNT_Header;\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_WinFNT_Header\n   *\n   * @description:\n   *    Retrieve a Windows FNT font info header.\n   *\n   * @input:\n   *    face    :: A handle to the input face.\n   *\n   * @output:\n   *    aheader :: The WinFNT header.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function only works with Windows FNT faces, returning an error\n   *   otherwise.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *aheader );\n\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTWINFNT_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ftxf86.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.h                                                               */\n/*                                                                         */\n/*    Support functions for X11.                                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2007 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTXF86_H__\n#define __FTXF86_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   font_formats                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   Font Formats                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   Getting the font format.                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   The single function in this section can be used to get the font     */\n  /*   format.  Note that this information is not needed normally;         */\n  /*   however, there are special cases (like in PDF devices) where it is  */\n  /*   important to differentiate, in spite of FreeType's uniform API.     */\n  /*                                                                       */\n  /*   This function is in the X11/xf86 namespace for historical reasons   */\n  /*   and in no way depends on that windowing system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*   FT_Get_X11_Font_Format                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Return a string describing the format of a given face, using values */\n  /*   which can be used as an X11 FONT_PROPERTY.  Possible values are     */\n  /*   `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */\n  /*   `PFR', and `Windows~FNT'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   face ::                                                             */\n  /*     Input face handle.                                                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   Font format string.  NULL in case of error.                         */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTXF86_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/autohint.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  autohint.h                                                             */\n/*                                                                         */\n/*    High-level `autohint' module-specific interface (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2007, 2009, 2012 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The auto-hinter is used to load and automatically hint glyphs if a    */\n  /* format-specific hinter isn't available.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __AUTOHINT_H__\n#define __AUTOHINT_H__\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A small technical note regarding automatic hinting in order to        */\n  /* clarify this module interface.                                        */\n  /*                                                                       */\n  /* An automatic hinter might compute two kinds of data for a given face: */\n  /*                                                                       */\n  /* - global hints: Usually some metrics that describe global properties  */\n  /*                 of the face.  It is computed by scanning more or less */\n  /*                 aggressively the glyphs in the face, and thus can be  */\n  /*                 very slow to compute (even if the size of global      */\n  /*                 hints is really small).                               */\n  /*                                                                       */\n  /* - glyph hints:  These describe some important features of the glyph   */\n  /*                 outline, as well as how to align them.  They are      */\n  /*                 generally much faster to compute than global hints.   */\n  /*                                                                       */\n  /* The current FreeType auto-hinter does a pretty good job while         */\n  /* performing fast computations for both global and glyph hints.         */\n  /* However, we might be interested in introducing more complex and       */\n  /* powerful algorithms in the future, like the one described in the John */\n  /* D. Hobby paper, which unfortunately requires a lot more horsepower.   */\n  /*                                                                       */\n  /* Because a sufficiently sophisticated font management system would     */\n  /* typically implement an LRU cache of opened face objects to reduce     */\n  /* memory usage, it is a good idea to be able to avoid recomputing       */\n  /* global hints every time the same face is re-opened.                   */\n  /*                                                                       */\n  /* We thus provide the ability to cache global hints outside of the face */\n  /* object, in order to speed up font re-opening time.  Of course, this   */\n  /* feature is purely optional, so most client programs won't even notice */\n  /* it.                                                                   */\n  /*                                                                       */\n  /* I initially thought that it would be a good idea to cache the glyph   */\n  /* hints too.  However, my general idea now is that if you really need   */\n  /* to cache these too, you are simply in need of a new font format,      */\n  /* where all this information could be stored within the font file and   */\n  /* decoded on the fly.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct FT_AutoHinterRec_  *FT_AutoHinter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalGetFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the global hints computed for a given face object.  The   */\n  /*    resulting data is dissociated from the face and will survive a     */\n  /*    call to FT_Done_Face().  It must be discarded through the API      */\n  /*    FT_AutoHinter_GlobalDoneFunc().                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter       :: A handle to the source auto-hinter.                */\n  /*                                                                       */\n  /*    face         :: A handle to the source face object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    global_hints :: A typeless pointer to the global hints.            */\n  /*                                                                       */\n  /*    global_len   :: The size in bytes of the global hints.             */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,\n                                  FT_Face        face,\n                                  void**         global_hints,\n                                  long*          global_len );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalDoneFunc                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard the global hints retrieved through                         */\n  /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */\n  /*    are freed from memory.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the auto-hinter module.                      */\n  /*                                                                       */\n  /*    global :: A pointer to retrieved global hints to discard.          */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter  hinter,\n                                   void*          global );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalResetFunc                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to recompute the global metrics in a given   */\n  /*    font.  This is useful when global font data changes (e.g. Multiple */\n  /*    Masters fonts where blend coordinates change).                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the source auto-hinter.                      */\n  /*                                                                       */\n  /*    face   :: A handle to the face.                                    */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter  hinter,\n                                    FT_Face        face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlyphLoadFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to load, scale, and automatically hint a     */\n  /*    glyph from a given face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the face.                               */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    load_flags  :: The load flags.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is capable of loading composite glyphs by hinting    */\n  /*    each sub-glyph independently (which improves quality).             */\n  /*                                                                       */\n  /*    It will call the font driver with @FT_Load_Glyph, with             */\n  /*    @FT_LOAD_NO_SCALE set.                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,\n                                  FT_GlyphSlot   slot,\n                                  FT_Size        size,\n                                  FT_UInt        glyph_index,\n                                  FT_Int32       load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_AutoHinter_InterfaceRec                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The auto-hinter module's interface.                                */\n  /*                                                                       */\n  typedef struct  FT_AutoHinter_InterfaceRec_\n  {\n    FT_AutoHinter_GlobalResetFunc  reset_face;\n    FT_AutoHinter_GlobalGetFunc    get_global_hints;\n    FT_AutoHinter_GlobalDoneFunc   done_global_hints;\n    FT_AutoHinter_GlyphLoadFunc    load_glyph;\n\n  } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(       \\\n          class_,                             \\\n          reset_face_,                        \\\n          get_global_hints_,                  \\\n          done_global_hints_,                 \\\n          load_glyph_ )                       \\\n  FT_CALLBACK_TABLE_DEF                       \\\n  const FT_AutoHinter_InterfaceRec  class_ =  \\\n  {                                           \\\n    reset_face_,                              \\\n    get_global_hints_,                        \\\n    done_global_hints_,                       \\\n    load_glyph_                               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(                            \\\n          class_,                                                  \\\n          reset_face_,                                             \\\n          get_global_hints_,                                       \\\n          done_global_hints_,                                      \\\n          load_glyph_ )                                            \\\n  void                                                             \\\n  FT_Init_Class_ ## class_( FT_Library                   library,  \\\n                            FT_AutoHinter_InterfaceRec*  clazz )   \\\n  {                                                                \\\n    FT_UNUSED( library );                                          \\\n                                                                   \\\n    clazz->reset_face        = reset_face_;                        \\\n    clazz->get_global_hints  = get_global_hints_;                  \\\n    clazz->done_global_hints = done_global_hints_;                 \\\n    clazz->load_glyph        = load_glyph_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __AUTOHINT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftcalc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcalc.h                                                               */\n/*                                                                         */\n/*    Arithmetic computations (specification).                             */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2009, 2012-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCALC_H__\n#define __FTCALC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FixedSqrt                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the square root of a 16.16 fixed-point value.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x :: The value to compute the root for.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `sqrt(x)'.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is not very fast.                                    */\n  /*                                                                       */\n  FT_BASE( FT_Int32 )\n  FT_SqrtFixed( FT_Int32  x );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv_No_Round                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    (without rounding) with maximum accuracy (it uses a 64-bit         */\n  /*    intermediate integer whenever necessary).                          */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_BASE( FT_Long )\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c );\n\n\n  /*\n   *  A variant of FT_Matrix_Multiply which scales its result afterwards.\n   *  The idea is that both `a' and `b' are scaled by factors of 10 so that\n   *  the values are as precise as possible to get a correct result during\n   *  the 64bit multiplication.  Let `sa' and `sb' be the scaling factors of\n   *  `a' and `b', respectively, then the scaling factor of the result is\n   *  `sa*sb'.\n   */\n  FT_BASE( void )\n  FT_Matrix_Multiply_Scaled( const FT_Matrix*  a,\n                             FT_Matrix        *b,\n                             FT_Long           scaling );\n\n\n  /*\n   *  A variant of FT_Vector_Transform.  See comments for\n   *  FT_Matrix_Multiply_Scaled.\n   */\n  FT_BASE( void )\n  FT_Vector_Transform_Scaled( FT_Vector*        vector,\n                              const FT_Matrix*  matrix,\n                              FT_Long           scaling );\n\n\n  /*\n   *  Return -1, 0, or +1, depending on the orientation of a given corner.\n   *  We use the Cartesian coordinate system, with positive vertical values\n   *  going upwards.  The function returns +1 if the corner turns to the\n   *  left, -1 to the right, and 0 for undecidable cases.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_orientation( FT_Pos  in_x,\n                         FT_Pos  in_y,\n                         FT_Pos  out_x,\n                         FT_Pos  out_y );\n\n  /*\n   *  Return TRUE if a corner is flat or nearly flat.  This is equivalent to\n   *  saying that the angle difference between the `in' and `out' vectors is\n   *  very small.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_is_flat( FT_Pos  in_x,\n                     FT_Pos  in_y,\n                     FT_Pos  out_x,\n                     FT_Pos  out_y );\n\n\n  /*\n   *  Return the most significant bit index.\n   */\n  FT_BASE( FT_Int )\n  FT_MSB( FT_UInt32  z );\n\n\n  /*\n   *  Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses\n   *  two fixed-point arguments instead.\n   */\n  FT_BASE( FT_Fixed )\n  FT_Hypot( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n#define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )\n#define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )\n#define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )\n#define F2DOT14_TO_FIXED( x )  ( (FT_Long)(x) << 2  )\n#define FLOAT_TO_FIXED( x )    ( (FT_Long)( x * 65536.0 ) )\n#define FIXED_TO_INT( x )      ( FT_RoundFix( x ) >> 16 )\n\n#define ROUND_F26DOT6( x )     ( x >= 0 ? (    ( (x) + 32 ) & -64 )     \\\n                                        : ( -( ( 32 - (x) ) & -64 ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTCALC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftdebug.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdebug.h                                                              */\n/*                                                                         */\n/*    Debugging and logging component (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/*                                                                         */\n/*  IMPORTANT: A description of FreeType's debugging support can be        */\n/*             found in `docs/DEBUG.TXT'.  Read it if you need to use or   */\n/*             understand this code.                                       */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDEBUG_H__\n#define __FTDEBUG_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */\n  /* is already defined; this simplifies the following #ifdefs            */\n  /*                                                                      */\n#ifdef FT_DEBUG_LEVEL_TRACE\n#undef  FT_DEBUG_LEVEL_ERROR\n#define FT_DEBUG_LEVEL_ERROR\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the trace enums as well as the trace levels array when they    */\n  /* are needed.                                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE_DEF( x )  trace_ ## x ,\n\n  /* defining the enumeration */\n  typedef enum  FT_Trace_\n  {\n#include FT_INTERNAL_TRACE_H\n    trace_count\n\n  } FT_Trace;\n\n\n  /* defining the array of trace levels, provided by `src/base/ftdebug.c' */\n  extern int  ft_trace_levels[trace_count];\n\n#undef FT_TRACE_DEF\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_TRACE macro                                             */\n  /*                                                                       */\n  /* IMPORTANT!                                                            */\n  /*                                                                       */\n  /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */\n  /* value before using any TRACE macro.                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE( level, varformat )                      \\\n          do                                              \\\n          {                                               \\\n            if ( ft_trace_levels[FT_COMPONENT] >= level ) \\\n              FT_Message varformat;                       \\\n          } while ( 0 )\n\n#else /* !FT_DEBUG_LEVEL_TRACE */\n\n#define FT_TRACE( level, varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Count                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the number of available trace components.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of trace components.  0 if FreeType 2 is not built with */\n  /*    FT_DEBUG_LEVEL_TRACE definition.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may be useful if you want to access elements of      */\n  /*    the internal `ft_trace_levels' array by an index.                  */\n  /*                                                                       */\n  FT_BASE( FT_Int )\n  FT_Trace_Get_Count( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the name of a trace component.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The index of the trace component.                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The name of the trace component.  This is a statically allocated   */\n  /*    C string, so do not free it after use.  NULL if FreeType 2 is not  */\n  /*    built with FT_DEBUG_LEVEL_TRACE definition.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Trace_Get_Count to get the number of available trace       */\n  /*    components.                                                        */\n  /*                                                                       */\n  /*    This function may be useful if you want to control FreeType 2's    */\n  /*    debug level in your application.                                   */\n  /*                                                                       */\n  FT_BASE( const char * )\n  FT_Trace_Get_Name( FT_Int  idx );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* You need two opening and closing parentheses!                         */\n  /*                                                                       */\n  /* Example: FT_TRACE0(( \"Value is %i\", foo ))                            */\n  /*                                                                       */\n  /* Output of the FT_TRACEX macros is sent to stderr.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_TRACE0( varformat )  FT_TRACE( 0, varformat )\n#define FT_TRACE1( varformat )  FT_TRACE( 1, varformat )\n#define FT_TRACE2( varformat )  FT_TRACE( 2, varformat )\n#define FT_TRACE3( varformat )  FT_TRACE( 3, varformat )\n#define FT_TRACE4( varformat )  FT_TRACE( 4, varformat )\n#define FT_TRACE5( varformat )  FT_TRACE( 5, varformat )\n#define FT_TRACE6( varformat )  FT_TRACE( 6, varformat )\n#define FT_TRACE7( varformat )  FT_TRACE( 7, varformat )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ERROR macro.                                            */\n  /*                                                                       */\n  /* Output of this macro is sent to stderr.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ERROR( varformat )  FT_Message  varformat\n\n#else  /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ERROR( varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ASSERT and FT_THROW macros.  The call to `FT_Throw'     */\n  /* makes it possible to easily set a breakpoint at this function.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ASSERT( condition )                                      \\\n          do                                                        \\\n          {                                                         \\\n            if ( !( condition ) )                                   \\\n              FT_Panic( \"assertion failed on line %d of file %s\\n\", \\\n                        __LINE__, __FILE__ );                       \\\n          } while ( 0 )\n\n#define FT_THROW( e )                                   \\\n          ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ),   \\\n                      __LINE__,                         \\\n                      __FILE__ )                      | \\\n            FT_ERR_CAT( FT_ERR_PREFIX, e )            )\n\n#else /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ASSERT( condition )  do { } while ( 0 )\n\n#define FT_THROW( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define `FT_Message' and `FT_Panic' when needed.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#include \"stdio.h\"  /* for vfprintf() */\n\n  /* print a message */\n  FT_BASE( void )\n  FT_Message( const char*  fmt,\n              ... );\n\n  /* print a message and exit */\n  FT_BASE( void )\n  FT_Panic( const char*  fmt,\n            ... );\n\n  /* report file name and line number of an error */\n  FT_BASE( int )\n  FT_Throw( FT_Error     error,\n            int          line,\n            const char*  file );\n\n#endif /* FT_DEBUG_LEVEL_ERROR */\n\n\n  FT_BASE( void )\n  ft_debug_init( void );\n\nFT_END_HEADER\n\n#endif /* __FTDEBUG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftdriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdriver.h                                                             */\n/*                                                                         */\n/*    FreeType font driver interface (specification).                      */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2011-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDRIVER_H__\n#define __FTDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef FT_Error\n  (*FT_Face_InitFunc)( FT_Stream      stream,\n                       FT_Face        face,\n                       FT_Int         typeface_index,\n                       FT_Int         num_params,\n                       FT_Parameter*  parameters );\n\n  typedef void\n  (*FT_Face_DoneFunc)( FT_Face  face );\n\n\n  typedef FT_Error\n  (*FT_Size_InitFunc)( FT_Size  size );\n\n  typedef void\n  (*FT_Size_DoneFunc)( FT_Size  size );\n\n\n  typedef FT_Error\n  (*FT_Slot_InitFunc)( FT_GlyphSlot  slot );\n\n  typedef void\n  (*FT_Slot_DoneFunc)( FT_GlyphSlot  slot );\n\n\n  typedef FT_Error\n  (*FT_Size_RequestFunc)( FT_Size          size,\n                          FT_Size_Request  req );\n\n  typedef FT_Error\n  (*FT_Size_SelectFunc)( FT_Size   size,\n                         FT_ULong  size_index );\n\n  typedef FT_Error\n  (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,\n                       FT_Size       size,\n                       FT_UInt       glyph_index,\n                       FT_Int32      load_flags );\n\n\n  typedef FT_UInt\n  (*FT_CharMap_CharIndexFunc)( FT_CharMap  charmap,\n                               FT_Long     charcode );\n\n  typedef FT_Long\n  (*FT_CharMap_CharNextFunc)( FT_CharMap  charmap,\n                              FT_Long     charcode );\n\n\n  typedef FT_Error\n  (*FT_Face_GetKerningFunc)( FT_Face     face,\n                             FT_UInt     left_glyph,\n                             FT_UInt     right_glyph,\n                             FT_Vector*  kerning );\n\n\n  typedef FT_Error\n  (*FT_Face_AttachFunc)( FT_Face    face,\n                         FT_Stream  stream );\n\n\n  typedef FT_Error\n  (*FT_Face_GetAdvancesFunc)( FT_Face    face,\n                              FT_UInt    first,\n                              FT_UInt    count,\n                              FT_Int32   flags,\n                              FT_Fixed*  advances );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Driver_ClassRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The font driver class.  This structure mostly contains pointers to */\n  /*    driver methods.                                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root             :: The parent module.                             */\n  /*                                                                       */\n  /*    face_object_size :: The size of a face object in bytes.            */\n  /*                                                                       */\n  /*    size_object_size :: The size of a size object in bytes.            */\n  /*                                                                       */\n  /*    slot_object_size :: The size of a glyph object in bytes.           */\n  /*                                                                       */\n  /*    init_face        :: The format-specific face constructor.          */\n  /*                                                                       */\n  /*    done_face        :: The format-specific face destructor.           */\n  /*                                                                       */\n  /*    init_size        :: The format-specific size constructor.          */\n  /*                                                                       */\n  /*    done_size        :: The format-specific size destructor.           */\n  /*                                                                       */\n  /*    init_slot        :: The format-specific slot constructor.          */\n  /*                                                                       */\n  /*    done_slot        :: The format-specific slot destructor.           */\n  /*                                                                       */\n  /*                                                                       */\n  /*    load_glyph       :: A function handle to load a glyph to a slot.   */\n  /*                        This field is mandatory!                       */\n  /*                                                                       */\n  /*    get_kerning      :: A function handle to return the unscaled       */\n  /*                        kerning for a given pair of glyphs.  Can be    */\n  /*                        set to 0 if the format doesn't support         */\n  /*                        kerning.                                       */\n  /*                                                                       */\n  /*    attach_file      :: This function handle is used to read           */\n  /*                        additional data for a face from another        */\n  /*                        file/stream.  For example, this can be used to */\n  /*                        add data from AFM or PFM files on a Type 1     */\n  /*                        face, or a CIDMap on a CID-keyed face.         */\n  /*                                                                       */\n  /*    get_advances     :: A function handle used to return advance       */\n  /*                        widths of `count' glyphs (in font units),      */\n  /*                        starting at `first'.  The `vertical' flag must */\n  /*                        be set to get vertical advance heights.  The   */\n  /*                        `advances' buffer is caller-allocated.         */\n  /*                        The idea of this function is to be able to     */\n  /*                        perform device-independent text layout without */\n  /*                        loading a single glyph image.                  */\n  /*                                                                       */\n  /*    request_size     :: A handle to a function used to request the new */\n  /*                        character size.  Can be set to 0 if the        */\n  /*                        scaling done in the base layer suffices.       */\n  /*                                                                       */\n  /*    select_size      :: A handle to a function used to select a new    */\n  /*                        fixed size.  It is used only if                */\n  /*                        @FT_FACE_FLAG_FIXED_SIZES is set.  Can be set  */\n  /*                        to 0 if the scaling done in the base layer     */\n  /*                        suffices.                                      */\n  /* <Note>                                                                */\n  /*    Most function pointers, with the exception of `load_glyph', can be */\n  /*    set to 0 to indicate a default behaviour.                          */\n  /*                                                                       */\n  typedef struct  FT_Driver_ClassRec_\n  {\n    FT_Module_Class          root;\n\n    FT_Long                  face_object_size;\n    FT_Long                  size_object_size;\n    FT_Long                  slot_object_size;\n\n    FT_Face_InitFunc         init_face;\n    FT_Face_DoneFunc         done_face;\n\n    FT_Size_InitFunc         init_size;\n    FT_Size_DoneFunc         done_size;\n\n    FT_Slot_InitFunc         init_slot;\n    FT_Slot_DoneFunc         done_slot;\n\n    FT_Slot_LoadFunc         load_glyph;\n\n    FT_Face_GetKerningFunc   get_kerning;\n    FT_Face_AttachFunc       attach_file;\n    FT_Face_GetAdvancesFunc  get_advances;\n\n    /* since version 2.2 */\n    FT_Size_RequestFunc      request_size;\n    FT_Size_SelectFunc       select_size;\n\n  } FT_Driver_ClassRec, *FT_Driver_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_DRIVER                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of an FT_Driver_ClassRec      */\n  /*    struct instance.                                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_DRIVER                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Driver_ClassRec struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */\n  /*    called with a pointer where the allocated structure is returned.   */\n  /*    And when it is no longer needed a `destroy' function needs to be   */\n  /*    called to release that allocation.                                 */\n  /*                                                                       */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains a   */\n  /*    mechanism to call these functions for the default modules          */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by driver definition calling `FT_DEFINE_DRIVER' in following.      */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_DRIVER( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Driver_ClassRec  class_;\n\n#define FT_DEFINE_DRIVER(                    \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          face_object_size_,                 \\\n          size_object_size_,                 \\\n          slot_object_size_,                 \\\n          init_face_,                        \\\n          done_face_,                        \\\n          init_size_,                        \\\n          done_size_,                        \\\n          init_slot_,                        \\\n          done_slot_,                        \\\n          load_glyph_,                       \\\n          get_kerning_,                      \\\n          attach_file_,                      \\\n          get_advances_,                     \\\n          request_size_,                     \\\n          select_size_ )                     \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Driver_ClassRec  class_ =         \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n                                             \\\n    face_object_size_,                       \\\n    size_object_size_,                       \\\n    slot_object_size_,                       \\\n                                             \\\n    init_face_,                              \\\n    done_face_,                              \\\n                                             \\\n    init_size_,                              \\\n    done_size_,                              \\\n                                             \\\n    init_slot_,                              \\\n    done_slot_,                              \\\n                                             \\\n    load_glyph_,                             \\\n                                             \\\n    get_kerning_,                            \\\n    attach_file_,                            \\\n    get_advances_,                           \\\n                                             \\\n    request_size_,                           \\\n    select_size_                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_DRIVER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_DRIVER(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          face_object_size_,                                     \\\n          size_object_size_,                                     \\\n          slot_object_size_,                                     \\\n          init_face_,                                            \\\n          done_face_,                                            \\\n          init_size_,                                            \\\n          done_size_,                                            \\\n          init_slot_,                                            \\\n          done_slot_,                                            \\\n          load_glyph_,                                           \\\n          get_kerning_,                                          \\\n          attach_file_,                                          \\\n          get_advances_,                                         \\\n          request_size_,                                         \\\n          select_size_ )                                         \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory        memory = library->memory;                   \\\n    FT_Driver_Class  dclazz = (FT_Driver_Class)clazz;            \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( dclazz )                                                \\\n      FT_FREE( dclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Driver_Class  clazz  = NULL;                              \\\n    FT_Error         error;                                      \\\n    FT_Memory        memory = library->memory;                   \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->face_object_size = face_object_size_;                 \\\n    clazz->size_object_size = size_object_size_;                 \\\n    clazz->slot_object_size = slot_object_size_;                 \\\n                                                                 \\\n    clazz->init_face        = init_face_;                        \\\n    clazz->done_face        = done_face_;                        \\\n                                                                 \\\n    clazz->init_size        = init_size_;                        \\\n    clazz->done_size        = done_size_;                        \\\n                                                                 \\\n    clazz->init_slot        = init_slot_;                        \\\n    clazz->done_slot        = done_slot_;                        \\\n                                                                 \\\n    clazz->load_glyph       = load_glyph_;                       \\\n                                                                 \\\n    clazz->get_kerning      = get_kerning_;                      \\\n    clazz->attach_file      = attach_file_;                      \\\n    clazz->get_advances     = get_advances_;                     \\\n                                                                 \\\n    clazz->request_size     = request_size_;                     \\\n    clazz->select_size      = select_size_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __FTDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftgloadr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgloadr.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph loader (specification).                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2005, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGLOADR_H__\n#define __FTGLOADR_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphLoader                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The glyph loader is an internal object used to load several glyphs */\n  /*    together (for example, in the case of composites).                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The glyph loader implementation is not part of the high-level API, */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;\n\n\n#if 0  /* moved to freetype.h in version 2.2 */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n#endif\n\n\n  typedef struct  FT_SubGlyphRec_\n  {\n    FT_Int     index;\n    FT_UShort  flags;\n    FT_Int     arg1;\n    FT_Int     arg2;\n    FT_Matrix  transform;\n\n  } FT_SubGlyphRec;\n\n\n  typedef struct  FT_GlyphLoadRec_\n  {\n    FT_Outline   outline;       /* outline                   */\n    FT_Vector*   extra_points;  /* extra points table        */\n    FT_Vector*   extra_points2; /* second extra points table */\n    FT_UInt      num_subglyphs; /* number of subglyphs       */\n    FT_SubGlyph  subglyphs;     /* subglyphs                 */\n\n  } FT_GlyphLoadRec, *FT_GlyphLoad;\n\n\n  typedef struct  FT_GlyphLoaderRec_\n  {\n    FT_Memory        memory;\n    FT_UInt          max_points;\n    FT_UInt          max_contours;\n    FT_UInt          max_subglyphs;\n    FT_Bool          use_extra;\n\n    FT_GlyphLoadRec  base;\n    FT_GlyphLoadRec  current;\n\n    void*            other;            /* for possible future extension? */\n\n  } FT_GlyphLoaderRec;\n\n\n  /* create new empty glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_New( FT_Memory        memory,\n                      FT_GlyphLoader  *aloader );\n\n  /* add an extra points table to a glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );\n\n  /* destroy a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Done( FT_GlyphLoader  loader );\n\n  /* reset a glyph loader (frees everything int it) */\n  FT_BASE( void )\n  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );\n\n  /* rewind a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );\n\n  /* check that there is enough space to add `n_points' and `n_contours' */\n  /* to the glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,\n                              FT_UInt         n_points,\n                              FT_UInt         n_contours );\n\n\n#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                         \\\n   ( (_count) == 0 || ((_loader)->base.outline.n_points    +              \\\n                       (_loader)->current.outline.n_points +              \\\n                       (unsigned long)(_count)) <= (_loader)->max_points )\n\n#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                          \\\n  ( (_count) == 0 || ((_loader)->base.outline.n_contours    +              \\\n                      (_loader)->current.outline.n_contours +              \\\n                      (unsigned long)(_count)) <= (_loader)->max_contours )\n\n#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \\\n  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \\\n      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \\\n    ? 0                                                                \\\n    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )\n\n\n  /* check that there is enough space to add `n_subs' sub-glyphs to */\n  /* a glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,\n                                 FT_UInt         n_subs );\n\n  /* prepare a glyph loader, i.e. empty the current glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );\n\n  /* add the current glyph to the base glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Add( FT_GlyphLoader  loader );\n\n  /* copy points from one glyph loader to another */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,\n                             FT_GlyphLoader  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLOADR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftmemory.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmemory.h                                                             */\n/*                                                                         */\n/*    The FreeType memory management macros (specification).               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2007, 2010, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMEMORY_H__\n#define __FTMEMORY_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_SET_ERROR                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used to set an implicit `error' variable to a given  */\n  /*    expression's value (usually a function call), and convert it to a  */\n  /*    boolean which is set whenever the value is != 0.                   */\n  /*                                                                       */\n#undef  FT_SET_ERROR\n#define FT_SET_ERROR( expression ) \\\n          ( ( error = (expression) ) != 0 )\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                           M E M O R Y                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*\n   *  C++ refuses to handle statements like p = (void*)anything, with `p' a\n   *  typed pointer.  Since we don't have a `typeof' operator in standard\n   *  C++, we have to use a template to emulate it.\n   */\n\n#ifdef __cplusplus\n\n  extern \"C++\"\n  template <typename T> inline T*\n  cplusplus_typeof(        T*,\n                    void  *v )\n  {\n    return static_cast <T*> ( v );\n  }\n\n#define FT_ASSIGNP( p, val )  (p) = cplusplus_typeof( (p), (val) )\n\n#else\n\n#define FT_ASSIGNP( p, val )  (p) = (val)\n\n#endif\n\n\n\n#ifdef FT_DEBUG_MEMORY\n\n  FT_BASE( const char* )  _ft_debug_file;\n  FT_BASE( long )         _ft_debug_lineno;\n\n#define FT_DEBUG_INNER( exp )  ( _ft_debug_file   = __FILE__, \\\n                                 _ft_debug_lineno = __LINE__, \\\n                                 (exp) )\n\n#define FT_ASSIGNP_INNER( p, exp )  ( _ft_debug_file   = __FILE__, \\\n                                      _ft_debug_lineno = __LINE__, \\\n                                      FT_ASSIGNP( p, exp ) )\n\n#else /* !FT_DEBUG_MEMORY */\n\n#define FT_DEBUG_INNER( exp )       (exp)\n#define FT_ASSIGNP_INNER( p, exp )  FT_ASSIGNP( p, exp )\n\n#endif /* !FT_DEBUG_MEMORY */\n\n\n  /*\n   *  The allocation functions return a pointer, and the error code\n   *  is written to through the `p_error' parameter.  See below for\n   *  for documentation.\n   */\n\n  FT_BASE( FT_Pointer )\n  ft_mem_alloc( FT_Memory  memory,\n                FT_Long    size,\n                FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qalloc( FT_Memory  memory,\n                 FT_Long    size,\n                 FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_realloc( FT_Memory  memory,\n                  FT_Long    item_size,\n                  FT_Long    cur_count,\n                  FT_Long    new_count,\n                  void*      block,\n                  FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qrealloc( FT_Memory  memory,\n                   FT_Long    item_size,\n                   FT_Long    cur_count,\n                   FT_Long    new_count,\n                   void*      block,\n                   FT_Error  *p_error );\n\n  FT_BASE( void )\n  ft_mem_free( FT_Memory    memory,\n               const void*  P );\n\n\n#define FT_MEM_ALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory,          \\\n                                               (FT_Long)(size), \\\n                                               &error ) )\n\n#define FT_MEM_FREE( ptr )                \\\n          FT_BEGIN_STMNT                  \\\n            ft_mem_free( memory, (ptr) ); \\\n            (ptr) = NULL;                 \\\n          FT_END_STMNT\n\n#define FT_MEM_NEW( ptr )                        \\\n          FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_REALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,           \\\n                                                 1,                \\\n                                                 (FT_Long)(cursz), \\\n                                                 (FT_Long)(newsz), \\\n                                                 (ptr),            \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory,          \\\n                                                (FT_Long)(size), \\\n                                                &error ) )\n\n#define FT_MEM_QNEW( ptr )                        \\\n          FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_QREALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,           \\\n                                                  1,                \\\n                                                  (FT_Long)(cursz), \\\n                                                  (FT_Long)(newsz), \\\n                                                  (ptr),            \\\n                                                  &error ) )\n\n#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,               \\\n                                                 (FT_Long)(item_size), \\\n                                                 0,                    \\\n                                                 (FT_Long)(count),     \\\n                                                 NULL,                 \\\n                                                 &error ) )\n\n#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )           \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 (FT_Long)(itmsz),  \\\n                                                 (FT_Long)(oldcnt), \\\n                                                 (FT_Long)(newcnt), \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,               \\\n                                                  (FT_Long)(item_size), \\\n                                                  0,                    \\\n                                                  (FT_Long)(count),     \\\n                                                  NULL,                 \\\n                                                  &error ) )\n\n#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)            \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  (FT_Long)(itmsz),  \\\n                                                  (FT_Long)(oldcnt), \\\n                                                  (FT_Long)(newcnt), \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n\n#define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )\n\n\n#define FT_MEM_SET( dest, byte, count )     ft_memset( dest, byte, count )\n\n#define FT_MEM_COPY( dest, source, count )  ft_memcpy( dest, source, count )\n\n#define FT_MEM_MOVE( dest, source, count )  ft_memmove( dest, source, count )\n\n\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\n\n#define FT_ZERO( p )                FT_MEM_ZERO( p, sizeof ( *(p) ) )\n\n\n#define FT_ARRAY_ZERO( dest, count )                        \\\n          FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_COPY( dest, source, count )                        \\\n          FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_MOVE( dest, source, count )                        \\\n          FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )\n\n\n  /*\n   *  Return the maximum number of addressable elements in an array.\n   *  We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid\n   *  any problems.\n   */\n#define FT_ARRAY_MAX( ptr )           ( FT_INT_MAX / sizeof ( *(ptr) ) )\n\n#define FT_ARRAY_CHECK( ptr, count )  ( (count) <= FT_ARRAY_MAX( ptr ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following functions macros expect that their pointer argument is  */\n  /* _typed_ in order to automatically compute array element sizes.        */\n  /*                                                                       */\n\n#define FT_MEM_NEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 0,                 \\\n                                                 (FT_Long)(count),  \\\n                                                 NULL,              \\\n                                                 &error ) )\n\n#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 (FT_Long)(cursz),  \\\n                                                 (FT_Long)(newsz),  \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QNEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  0,                 \\\n                                                  (FT_Long)(count),  \\\n                                                  NULL,              \\\n                                                  &error ) )\n\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  (FT_Long)(cursz),  \\\n                                                  (FT_Long)(newsz),  \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n#define FT_ALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )\n\n#define FT_REALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )\n\n#define FT_ALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt,      \\\n                                                 newcnt, itmsz ) )\n\n#define FT_QALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )\n\n#define FT_QREALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )\n\n#define FT_QALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt,      \\\n                                                  newcnt, itmsz ) )\n\n#define FT_FREE( ptr )  FT_MEM_FREE( ptr )\n\n#define FT_NEW( ptr )  FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )\n\n#define FT_NEW_ARRAY( ptr, count )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_RENEW_ARRAY( ptr, curcnt, newcnt )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n#define FT_QNEW( ptr )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )\n\n#define FT_QNEW_ARRAY( ptr, count )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n\n  FT_BASE( FT_Pointer )\n  ft_mem_strdup( FT_Memory    memory,\n                 const char*  str,\n                 FT_Error    *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_dup( FT_Memory    memory,\n              const void*  address,\n              FT_ULong     size,\n              FT_Error    *p_error );\n\n\n#define FT_MEM_STRDUP( dst, str )                                            \\\n          (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )\n\n#define FT_STRDUP( dst, str )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )\n\n#define FT_MEM_DUP( dst, address, size )                                    \\\n          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )\n\n#define FT_DUP( dst, address, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )\n\n\n  /* Return >= 1 if a truncation occurs.            */\n  /* Return 0 if the source string fits the buffer. */\n  /* This is *not* the same as strlcpy().           */\n  FT_BASE( FT_Int )\n  ft_mem_strcpyn( char*        dst,\n                  const char*  src,\n                  FT_ULong     size );\n\n#define FT_STRCPYN( dst, src, size )                                         \\\n          ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMEMORY_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftobjs.h                                                               */\n/*                                                                         */\n/*    The FreeType private base classes (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2010, 2012-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file contains the definition of all internal FreeType classes.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTOBJS_H__\n#define __FTOBJS_H__\n\n#include <ft2build.h>\n#include FT_RENDER_H\n#include FT_SIZES_H\n#include FT_LCD_FILTER_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_GLYPH_LOADER_H\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_AUTOHINT_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_PIC_H\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n#include FT_INCREMENTAL_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some generic definitions.                                             */\n  /*                                                                       */\n#ifndef TRUE\n#define TRUE  1\n#endif\n\n#ifndef FALSE\n#define FALSE  0\n#endif\n\n#ifndef NULL\n#define NULL  (void*)0\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The min and max functions missing in C.  As usual, be careful not to  */\n  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */\n  /*                                                                       */\n#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )\n#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )\n\n#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )\n\n\n#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )\n#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )\n#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )\n\n#define FT_PIX_FLOOR( x )     ( (x) & ~63 )\n#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )\n#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )\n\n\n  /*\n   *  Return the highest power of 2 that is <= value; this correspond to\n   *  the highest bit in a given 32-bit value.\n   */\n  FT_BASE( FT_UInt32 )\n  ft_highpow2( FT_UInt32  value );\n\n\n  /*\n   *  character classification functions -- since these are used to parse\n   *  font files, we must not use those in <ctypes.h> which are\n   *  locale-dependent\n   */\n#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )\n\n#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \\\n                             ( (unsigned)(x) - 'a' ) < 6U  || \\\n                             ( (unsigned)(x) - 'A' ) < 6U  )\n\n  /* the next two macros assume ASCII representation */\n#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )\n#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )\n\n#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )\n#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       C H A R M A P S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to internal charmap object */\n  typedef struct FT_CMapRec_*              FT_CMap;\n\n  /* handle to charmap class structure */\n  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;\n\n  /* internal charmap object structure */\n  typedef struct  FT_CMapRec_\n  {\n    FT_CharMapRec  charmap;\n    FT_CMap_Class  clazz;\n\n  } FT_CMapRec;\n\n  /* typecase any pointer to a charmap handle */\n#define FT_CMAP( x )              ((FT_CMap)( x ))\n\n  /* obvious macros */\n#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id\n#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id\n#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding\n#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face\n\n\n  /* class method definitions */\n  typedef FT_Error\n  (*FT_CMap_InitFunc)( FT_CMap     cmap,\n                       FT_Pointer  init_data );\n\n  typedef void\n  (*FT_CMap_DoneFunc)( FT_CMap  cmap );\n\n  typedef FT_UInt\n  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,\n                            FT_UInt32  char_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,\n                           FT_UInt32  *achar_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharVarIndexFunc)( FT_CMap    cmap,\n                               FT_CMap    unicode_cmap,\n                               FT_UInt32  char_code,\n                               FT_UInt32  variant_selector );\n\n  typedef FT_Bool\n  (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap    cmap,\n                                   FT_UInt32  char_code,\n                                   FT_UInt32  variant_selector );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantListFunc)( FT_CMap    cmap,\n                              FT_Memory  mem );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_CharVariantListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  char_code );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantCharListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  variant_selector );\n\n\n  typedef struct  FT_CMap_ClassRec_\n  {\n    FT_ULong               size;\n    FT_CMap_InitFunc       init;\n    FT_CMap_DoneFunc       done;\n    FT_CMap_CharIndexFunc  char_index;\n    FT_CMap_CharNextFunc   char_next;\n\n    /* Subsequent entries are special ones for format 14 -- the variant */\n    /* selector subtable which behaves like no other                    */\n\n    FT_CMap_CharVarIndexFunc      char_var_index;\n    FT_CMap_CharVarIsDefaultFunc  char_var_default;\n    FT_CMap_VariantListFunc       variant_list;\n    FT_CMap_CharVariantListFunc   charvariant_list;\n    FT_CMap_VariantCharListFunc   variantchar_list;\n\n  } FT_CMap_ClassRec;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_CMAP_CLASS( class_ )              \\\n  FT_CALLBACK_TABLE const  FT_CMap_ClassRec class_;\n\n#define FT_DEFINE_CMAP_CLASS(       \\\n          class_,                   \\\n          size_,                    \\\n          init_,                    \\\n          done_,                    \\\n          char_index_,              \\\n          char_next_,               \\\n          char_var_index_,          \\\n          char_var_default_,        \\\n          variant_list_,            \\\n          charvariant_list_,        \\\n          variantchar_list_ )       \\\n  FT_CALLBACK_TABLE_DEF             \\\n  const FT_CMap_ClassRec  class_ =  \\\n  {                                 \\\n    size_,                          \\\n    init_,                          \\\n    done_,                          \\\n    char_index_,                    \\\n    char_next_,                     \\\n    char_var_index_,                \\\n    char_var_default_,              \\\n    variant_list_,                  \\\n    charvariant_list_,              \\\n    variantchar_list_               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_CMAP_CLASS( class_ )                  \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz );\n\n#define FT_DEFINE_CMAP_CLASS(                            \\\n          class_,                                        \\\n          size_,                                         \\\n          init_,                                         \\\n          done_,                                         \\\n          char_index_,                                   \\\n          char_next_,                                    \\\n          char_var_index_,                               \\\n          char_var_default_,                             \\\n          variant_list_,                                 \\\n          charvariant_list_,                             \\\n          variantchar_list_ )                            \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz )   \\\n  {                                                      \\\n    FT_UNUSED( library );                                \\\n                                                         \\\n    clazz->size             = size_;                     \\\n    clazz->init             = init_;                     \\\n    clazz->done             = done_;                     \\\n    clazz->char_index       = char_index_;               \\\n    clazz->char_next        = char_next_;                \\\n    clazz->char_var_index   = char_var_index_;           \\\n    clazz->char_var_default = char_var_default_;         \\\n    clazz->variant_list     = variant_list_;             \\\n    clazz->charvariant_list = charvariant_list_;         \\\n    clazz->variantchar_list = variantchar_list_;         \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* create a new charmap and add it to charmap->face */\n  FT_BASE( FT_Error )\n  FT_CMap_New( FT_CMap_Class  clazz,\n               FT_Pointer     init_data,\n               FT_CharMap     charmap,\n               FT_CMap       *acmap );\n\n  /* destroy a charmap and remove it from face's list */\n  FT_BASE( void )\n  FT_CMap_Done( FT_CMap  cmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Face_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Face        */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    max_points ::                                                      */\n  /*      The maximum number of points used to store the vectorial outline */\n  /*      of any glyph in this face.  If this value cannot be known in     */\n  /*      advance, or if the face isn't scalable, this should be set to 0. */\n  /*      Only relevant for scalable formats.                              */\n  /*                                                                       */\n  /*    max_contours ::                                                    */\n  /*      The maximum number of contours used to store the vectorial       */\n  /*      outline of any glyph in this face.  If this value cannot be      */\n  /*      known in advance, or if the face isn't scalable, this should be  */\n  /*      set to 0.  Only relevant for scalable formats.                   */\n  /*                                                                       */\n  /*    transform_matrix ::                                                */\n  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */\n  /*      outlines after they are loaded from the font.  Only used by the  */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    transform_delta ::                                                 */\n  /*      A translation vector used to transform glyph outlines after they */\n  /*      are loaded from the font.  Only used by the convenience          */\n  /*      functions.                                                       */\n  /*                                                                       */\n  /*    transform_flags ::                                                 */\n  /*      Some flags used to classify the transform.  Only used by the     */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    services ::                                                        */\n  /*      A cache for frequently used services.  It should be only         */\n  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */\n  /*                                                                       */\n  /*    incremental_interface ::                                           */\n  /*      If non-null, the interface through which glyph data and metrics  */\n  /*      are loaded incrementally for faces that do not provide all of    */\n  /*      this data when first opened.  This field exists only if          */\n  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */\n  /*                                                                       */\n  /*    ignore_unpatented_hinter ::                                        */\n  /*      This boolean flag instructs the glyph loader to ignore the       */\n  /*      native font hinter, if one is found.  This is exclusively used   */\n  /*      in the case when the unpatented hinter is compiled within the    */\n  /*      library.                                                         */\n  /*                                                                       */\n  /*    refcount ::                                                        */\n  /*      A counter initialized to~1 at the time an @FT_Face structure is  */\n  /*      created.  @FT_Reference_Face increments this counter, and        */\n  /*      @FT_Done_Face only destroys a face if the counter is~1,          */\n  /*      otherwise it simply decrements it.                               */\n  /*                                                                       */\n  typedef struct  FT_Face_InternalRec_\n  {\n    FT_Matrix           transform_matrix;\n    FT_Vector           transform_delta;\n    FT_Int              transform_flags;\n\n    FT_ServiceCacheRec  services;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Incremental_InterfaceRec*  incremental_interface;\n#endif\n\n    FT_Bool             ignore_unpatented_hinter;\n    FT_Int              refcount;\n\n  } FT_Face_InternalRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Slot_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_GlyphSlot   */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loader            :: The glyph loader object used to load outlines */\n  /*                         into the glyph slot.                          */\n  /*                                                                       */\n  /*    flags             :: Possible values are zero or                   */\n  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */\n  /*                         that the FT_GlyphSlot structure owns the      */\n  /*                         bitmap buffer.                                */\n  /*                                                                       */\n  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */\n  /*                         must be transformed through a specific        */\n  /*                         font transformation.  This is _not_ the same  */\n  /*                         as the face transform set through             */\n  /*                         FT_Set_Transform().                           */\n  /*                                                                       */\n  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */\n  /*                         transformation, if necessary.                 */\n  /*                                                                       */\n  /*    glyph_delta       :: The 2d translation vector corresponding to    */\n  /*                         the glyph transformation, if necessary.       */\n  /*                                                                       */\n  /*    glyph_hints       :: Format-specific glyph hints management.       */\n  /*                                                                       */\n\n#define FT_GLYPH_OWN_BITMAP  0x1\n\n  typedef struct  FT_Slot_InternalRec_\n  {\n    FT_GlyphLoader  loader;\n    FT_UInt         flags;\n    FT_Bool         glyph_transformed;\n    FT_Matrix       glyph_matrix;\n    FT_Vector       glyph_delta;\n    void*           glyph_hints;\n\n  } FT_GlyphSlot_InternalRec;\n\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Size        */\n  /*    object.  Currently, it's empty.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  typedef struct  FT_Size_InternalRec_\n  {\n    /* empty */\n\n  } FT_Size_InternalRec;\n\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                         M O D U L E S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ModuleRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A module object instance.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    clazz   :: A pointer to the module's class.                        */\n  /*                                                                       */\n  /*    library :: A handle to the parent library object.                  */\n  /*                                                                       */\n  /*    memory  :: A handle to the memory manager.                         */\n  /*                                                                       */\n  typedef struct  FT_ModuleRec_\n  {\n    FT_Module_Class*  clazz;\n    FT_Library        library;\n    FT_Memory         memory;\n\n  } FT_ModuleRec;\n\n\n  /* typecast an object to an FT_Module */\n#define FT_MODULE( x )          ((FT_Module)( x ))\n#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz\n#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library\n#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory\n\n\n#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_FONT_DRIVER )\n\n#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_RENDERER )\n\n#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_HINTER )\n\n#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_STYLER )\n\n#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_DRIVER_SCALABLE )\n\n#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \\\n                                         FT_MODULE_DRIVER_NO_OUTLINES )\n\n#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                     FT_MODULE_DRIVER_HAS_HINTER )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module_Interface                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finds a module and returns its specific interface as a typeless    */\n  /*    pointer.                                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module-specific interface if available, 0 otherwise.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should better be familiar with FreeType internals to know      */\n  /*    which module to look for, and what its interface is :-)            */\n  /*                                                                       */\n  FT_BASE( const void* )\n  FT_Get_Module_Interface( FT_Library   library,\n                           const char*  mod_name );\n\n  FT_BASE( FT_Pointer )\n  ft_module_get_service( FT_Module    module,\n                         const char*  service_id );\n\n  /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****   F A C E,   S I Z E   &   G L Y P H   S L O T   O B J E C T S  ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* a few macros used to perform easy typecasts with minimal brain damage */\n\n#define FT_FACE( x )          ((FT_Face)(x))\n#define FT_SIZE( x )          ((FT_Size)(x))\n#define FT_SLOT( x )          ((FT_GlyphSlot)(x))\n\n#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver\n#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library\n#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory\n#define FT_FACE_STREAM( x )   FT_FACE( x )->stream\n\n#define FT_SIZE_FACE( x )     FT_SIZE( x )->face\n#define FT_SLOT_FACE( x )     FT_SLOT( x )->face\n\n#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph\n#define FT_FACE_SIZE( x )     FT_FACE( x )->size\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_GlyphSlot                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    It is sometimes useful to have more than one glyph slot for a      */\n  /*    given face object.  This function is used to create additional     */\n  /*    slots.  All of them are automatically discarded when the face is   */\n  /*    destroyed.                                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to a parent face object.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aslot :: A handle to a new glyph slot object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_New_GlyphSlot( FT_Face        face,\n                    FT_GlyphSlot  *aslot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_GlyphSlot                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given glyph slot.  Remember however that all slots are  */\n  /*    automatically destroyed with its parent.  Using this function is   */\n  /*    not always mandatory.                                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: A handle to a target glyph slot.                           */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_GlyphSlot( FT_GlyphSlot  slot );\n\n /* */\n\n#define FT_REQUEST_WIDTH( req )                                            \\\n          ( (req)->horiResolution                                          \\\n              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \\\n              : (req)->width )\n\n#define FT_REQUEST_HEIGHT( req )                                            \\\n          ( (req)->vertResolution                                           \\\n              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \\\n              : (req)->height )\n\n\n  /* Set the metrics according to a bitmap strike. */\n  FT_BASE( void )\n  FT_Select_Metrics( FT_Face   face,\n                     FT_ULong  strike_index );\n\n\n  /* Set the metrics according to a size request. */\n  FT_BASE( void )\n  FT_Request_Metrics( FT_Face          face,\n                      FT_Size_Request  req );\n\n\n  /* Match a size request against `available_sizes'. */\n  FT_BASE( FT_Error )\n  FT_Match_Size( FT_Face          face,\n                 FT_Size_Request  req,\n                 FT_Bool          ignore_width,\n                 FT_ULong*        size_index );\n\n\n  /* Use the horizontal metrics to synthesize the vertical metrics. */\n  /* If `advance' is zero, it is also synthesized.                  */\n  FT_BASE( void )\n  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,\n                                  FT_Pos             advance );\n\n\n  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */\n  /* was allocated with ft_glyphslot_alloc_bitmap).                       */\n  FT_BASE( void )\n  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );\n\n\n  /* Allocate a new bitmap buffer in a glyph slot. */\n  FT_BASE( FT_Error )\n  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,\n                             FT_ULong      size );\n\n\n  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */\n  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */\n  FT_BASE( void )\n  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,\n                           FT_Byte*      buffer );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                        R E N D E R E R S                        ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#define FT_RENDERER( x )      ((FT_Renderer)( x ))\n#define FT_GLYPH( x )         ((FT_Glyph)( x ))\n#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))\n#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))\n\n\n  typedef struct  FT_RendererRec_\n  {\n    FT_ModuleRec            root;\n    FT_Renderer_Class*      clazz;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_Class          glyph_class;\n\n    FT_Raster               raster;\n    FT_Raster_Render_Func   raster_render;\n    FT_Renderer_RenderFunc  render;\n\n  } FT_RendererRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    F O N T   D R I V E R S                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* typecast a module into a driver easily */\n#define FT_DRIVER( x )        ((FT_Driver)(x))\n\n  /* typecast a module as a driver, and get its driver class */\n#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_DriverRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root font driver class.  A font driver is responsible for      */\n  /*    managing and loading font files of a given format.                 */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     root         :: Contains the fields of the root module class.     */\n  /*                                                                       */\n  /*     clazz        :: A pointer to the font driver's class.  Note that  */\n  /*                     this is NOT root.clazz.  `class' wasn't used      */\n  /*                     as it is a reserved word in C++.                  */\n  /*                                                                       */\n  /*     faces_list   :: The list of faces currently opened by this        */\n  /*                     driver.                                           */\n  /*                                                                       */\n  /*     glyph_loader :: The glyph loader for all faces managed by this    */\n  /*                     driver.  This object isn't defined for unscalable */\n  /*                     formats.                                          */\n  /*                                                                       */\n  typedef struct  FT_DriverRec_\n  {\n    FT_ModuleRec     root;\n    FT_Driver_Class  clazz;\n    FT_ListRec       faces_list;\n    FT_GlyphLoader   glyph_loader;\n\n  } FT_DriverRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       L I B R A R I E S                         ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* This hook is used by the TrueType debugger.  It must be set to an */\n  /* alternate truetype bytecode interpreter function.                 */\n#define FT_DEBUG_HOOK_TRUETYPE            0\n\n\n  /* Set this debug hook to a non-null pointer to force unpatented hinting */\n  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */\n  /* during debugging.                                                     */\n#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1\n\n\n  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,\n                                            FT_Render_Mode  render_mode,\n                                            FT_Library      library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_LibraryRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType library class.  This is the root of all FreeType      */\n  /*    data.  Use FT_New_Library() to create a library object, and        */\n  /*    FT_Done_Library() to discard it and all child objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory           :: The library's memory object.  Manages memory   */\n  /*                        allocation.                                    */\n  /*                                                                       */\n  /*    version_major    :: The major version number of the library.       */\n  /*                                                                       */\n  /*    version_minor    :: The minor version number of the library.       */\n  /*                                                                       */\n  /*    version_patch    :: The current patch level of the library.        */\n  /*                                                                       */\n  /*    num_modules      :: The number of modules currently registered     */\n  /*                        within this library.  This is set to 0 for new */\n  /*                        libraries.  New modules are added through the  */\n  /*                        FT_Add_Module() API function.                  */\n  /*                                                                       */\n  /*    modules          :: A table used to store handles to the currently */\n  /*                        registered modules. Note that each font driver */\n  /*                        contains a list of its opened faces.           */\n  /*                                                                       */\n  /*    renderers        :: The list of renderers currently registered     */\n  /*                        within the library.                            */\n  /*                                                                       */\n  /*    cur_renderer     :: The current outline renderer.  This is a       */\n  /*                        shortcut used to avoid parsing the list on     */\n  /*                        each call to FT_Outline_Render().  It is a     */\n  /*                        handle to the current renderer for the         */\n  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */\n  /*                                                                       */\n  /*    auto_hinter      :: XXX                                            */\n  /*                                                                       */\n  /*    raster_pool      :: The raster object's render pool.  This can     */\n  /*                        ideally be changed dynamically at run-time.    */\n  /*                                                                       */\n  /*    raster_pool_size :: The size of the render pool in bytes.          */\n  /*                                                                       */\n  /*    debug_hooks      :: XXX                                            */\n  /*                                                                       */\n  /*    lcd_filter       :: If subpixel rendering is activated, the        */\n  /*                        selected LCD filter mode.                      */\n  /*                                                                       */\n  /*    lcd_extra        :: If subpixel rendering is activated, the number */\n  /*                        of extra pixels needed for the LCD filter.     */\n  /*                                                                       */\n  /*    lcd_weights      :: If subpixel rendering is activated, the LCD    */\n  /*                        filter weights, if any.                        */\n  /*                                                                       */\n  /*    lcd_filter_func  :: If subpixel rendering is activated, the LCD    */\n  /*                        filtering callback function.                   */\n  /*                                                                       */\n  /*    pic_container    :: Contains global structs and tables, instead    */\n  /*                        of defining them globallly.                    */\n  /*                                                                       */\n  /*    refcount         :: A counter initialized to~1 at the time an      */\n  /*                        @FT_Library structure is created.              */\n  /*                        @FT_Reference_Library increments this counter, */\n  /*                        and @FT_Done_Library only destroys a library   */\n  /*                        if the counter is~1, otherwise it simply       */\n  /*                        decrements it.                                 */\n  /*                                                                       */\n  typedef struct  FT_LibraryRec_\n  {\n    FT_Memory          memory;           /* library's memory manager */\n\n    FT_Int             version_major;\n    FT_Int             version_minor;\n    FT_Int             version_patch;\n\n    FT_UInt            num_modules;\n    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */\n\n    FT_ListRec         renderers;        /* list of renderers        */\n    FT_Renderer        cur_renderer;     /* current outline renderer */\n    FT_Module          auto_hinter;\n\n    FT_Byte*           raster_pool;      /* scan-line conversion */\n                                         /* render pool          */\n    FT_ULong           raster_pool_size; /* size of render pool in bytes */\n\n    FT_DebugHook_Func  debug_hooks[4];\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n    FT_LcdFilter             lcd_filter;\n    FT_Int                   lcd_extra;        /* number of extra pixels */\n    FT_Byte                  lcd_weights[7];   /* filter weights, if any */\n    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */\n#endif\n\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_PIC_Container   pic_container;\n#endif\n\n    FT_Int             refcount;\n\n  } FT_LibraryRec;\n\n\n  FT_BASE( FT_Renderer )\n  FT_Lookup_Renderer( FT_Library       library,\n                      FT_Glyph_Format  format,\n                      FT_ListNode*     node );\n\n  FT_BASE( FT_Error )\n  FT_Render_Glyph_Internal( FT_Library      library,\n                            FT_GlyphSlot    slot,\n                            FT_Render_Mode  render_mode );\n\n  typedef const char*\n  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,\n                                    FT_String*  glyph_name );\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new memory object.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the new memory object.  0 in case of error.           */\n  /*                                                                       */\n  FT_BASE( FT_Memory )\n  FT_New_Memory( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Memory                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discards memory manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_Memory( FT_Memory  memory );\n\n#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* Define default raster's interface.  The default raster is located in  */\n  /* `src/base/ftraster.c'.                                                */\n  /*                                                                       */\n  /* Client applications can register new rasters through the              */\n  /* FT_Set_Raster() API.                                                  */\n\n#ifndef FT_NO_DEFAULT_RASTER\n  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                      P I C   S U P P O R T                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* PIC support macros for ftimage.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_OUTLINE_FUNCS                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Outline_Funcs struct.         */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_OUTLINE_FUNCS(           \\\n          class_,                          \\\n          move_to_,                        \\\n          line_to_,                        \\\n          conic_to_,                       \\\n          cubic_to_,                       \\\n          shift_,                          \\\n          delta_ )                         \\\n  static const  FT_Outline_Funcs class_ =  \\\n  {                                        \\\n    move_to_,                              \\\n    line_to_,                              \\\n    conic_to_,                             \\\n    cubic_to_,                             \\\n    shift_,                                \\\n    delta_                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_OUTLINE_FUNCS(                     \\\n          class_,                                    \\\n          move_to_,                                  \\\n          line_to_,                                  \\\n          conic_to_,                                 \\\n          cubic_to_,                                 \\\n          shift_,                                    \\\n          delta_ )                                   \\\n  static FT_Error                                    \\\n  Init_Class_ ## class_( FT_Outline_Funcs*  clazz )  \\\n  {                                                  \\\n    clazz->move_to  = move_to_;                      \\\n    clazz->line_to  = line_to_;                      \\\n    clazz->conic_to = conic_to_;                     \\\n    clazz->cubic_to = cubic_to_;                     \\\n    clazz->shift    = shift_;                        \\\n    clazz->delta    = delta_;                        \\\n                                                     \\\n    return FT_Err_Ok;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RASTER_FUNCS                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Raster_Funcs struct.          */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_RASTER_FUNCS(    \\\n          class_,                  \\\n          glyph_format_,           \\\n          raster_new_,             \\\n          raster_reset_,           \\\n          raster_set_mode_,        \\\n          raster_render_,          \\\n          raster_done_ )           \\\n  const FT_Raster_Funcs  class_ =  \\\n  {                                \\\n    glyph_format_,                 \\\n    raster_new_,                   \\\n    raster_reset_,                 \\\n    raster_set_mode_,              \\\n    raster_render_,                \\\n    raster_done_                   \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_RASTER_FUNCS(                        \\\n          class_,                                      \\\n          glyph_format_,                               \\\n          raster_new_,                                 \\\n          raster_reset_,                               \\\n          raster_set_mode_,                            \\\n          raster_render_,                              \\\n          raster_done_ )                               \\\n  void                                                 \\\n  FT_Init_Class_ ## class_( FT_Raster_Funcs*  clazz )  \\\n  {                                                    \\\n    clazz->glyph_format    = glyph_format_;            \\\n    clazz->raster_new      = raster_new_;              \\\n    clazz->raster_reset    = raster_reset_;            \\\n    clazz->raster_set_mode = raster_set_mode_;         \\\n    clazz->raster_render   = raster_render_;           \\\n    clazz->raster_done     = raster_done_;             \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftrender.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_GLYPH                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Glyph_Class struct.           */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated stcture to be filled.               */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_GLYPH(          \\\n          class_,                 \\\n          size_,                  \\\n          format_,                \\\n          init_,                  \\\n          done_,                  \\\n          copy_,                  \\\n          transform_,             \\\n          bbox_,                  \\\n          prepare_ )              \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Glyph_Class  class_ =  \\\n  {                               \\\n    size_,                        \\\n    format_,                      \\\n    init_,                        \\\n    done_,                        \\\n    copy_,                        \\\n    transform_,                   \\\n    bbox_,                        \\\n    prepare_                      \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_GLYPH(                              \\\n          class_,                                     \\\n          size_,                                      \\\n          format_,                                    \\\n          init_,                                      \\\n          done_,                                      \\\n          copy_,                                      \\\n          transform_,                                 \\\n          bbox_,                                      \\\n          prepare_ )                                  \\\n  void                                                \\\n  FT_Init_Class_ ## class_( FT_Glyph_Class*  clazz )  \\\n  {                                                   \\\n    clazz->glyph_size      = size_;                   \\\n    clazz->glyph_format    = format_;                 \\\n    clazz->glyph_init      = init_;                   \\\n    clazz->glyph_done      = done_;                   \\\n    clazz->glyph_copy      = copy_;                   \\\n    clazz->glyph_transform = transform_;              \\\n    clazz->glyph_bbox      = bbox_;                   \\\n    clazz->glyph_prepare   = prepare_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_RENDERER                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Renderer_Class struct instance.                                 */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RENDERER                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Renderer_Class struct.        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need  */\n  /*    to be called with a pointer where the allocated structure is       */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the renderer definition calling `FT_DEFINE_RENDERER' in the     */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_RENDERER( class_ )               \\\n  FT_EXPORT_VAR( const FT_Renderer_Class ) class_;\n\n#define FT_DEFINE_RENDERER(                  \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          glyph_format_,                     \\\n          render_glyph_,                     \\\n          transform_glyph_,                  \\\n          get_glyph_cbox_,                   \\\n          set_mode_,                         \\\n          raster_class_ )                    \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Renderer_Class  class_ =          \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n    glyph_format_,                           \\\n                                             \\\n    render_glyph_,                           \\\n    transform_glyph_,                        \\\n    get_glyph_cbox_,                         \\\n    set_mode_,                               \\\n                                             \\\n    raster_class_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_RENDERER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_RENDERER(                                      \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          glyph_format_,                                         \\\n          render_glyph_,                                         \\\n          transform_glyph_,                                      \\\n          get_glyph_cbox_,                                       \\\n          set_mode_,                                             \\\n          raster_class_ )                                        \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Renderer_Class*  rclazz = (FT_Renderer_Class*)clazz;      \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( rclazz )                                                \\\n      FT_FREE( rclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Renderer_Class*  clazz = NULL;                            \\\n    FT_Error            error;                                   \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->glyph_format    = glyph_format_;                      \\\n                                                                 \\\n    clazz->render_glyph    = render_glyph_;                      \\\n    clazz->transform_glyph = transform_glyph_;                   \\\n    clazz->get_glyph_cbox  = get_glyph_cbox_;                    \\\n    clazz->set_mode        = set_mode_;                          \\\n                                                                 \\\n    clazz->raster_class    = raster_class_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftmodapi.h **/\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Creator                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create (allocate) a new module class object.    */\n  /*    The object's members are initialized, but the module itself is     */\n  /*    not.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory       :: A handle to the memory manager.                    */\n  /*    output_class :: Initialized with the newly allocated class.        */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Creator)( FT_Memory          memory,\n                        FT_Module_Class**  output_class );\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destroyer                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy (deallocate) a module class object.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*    clazz  :: Module class to destroy.                                 */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destroyer)( FT_Memory         memory,\n                          FT_Module_Class*  clazz );\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_MODULE                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Module_Class struct instance.                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_MODULE                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to   */\n  /*    be called with a pointer where the allocated structure is          */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the module definition calling `FT_DEFINE_MODULE' in the         */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_ROOT_MODULE                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct inside */\n  /*    another struct that contains it or in a function that initializes  */\n  /*    that containing struct.                                            */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_MODULE( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Module_Class  class_;\n\n#define FT_DEFINE_ROOT_MODULE(  \\\n          flags_,               \\\n          size_,                \\\n          name_,                \\\n          version_,             \\\n          requires_,            \\\n          interface_,           \\\n          init_,                \\\n          done_,                \\\n          get_interface_ )      \\\n  {                             \\\n    flags_,                     \\\n    size_,                      \\\n                                \\\n    name_,                      \\\n    version_,                   \\\n    requires_,                  \\\n                                \\\n    interface_,                 \\\n                                \\\n    init_,                      \\\n    done_,                      \\\n    get_interface_,             \\\n  },\n\n#define FT_DEFINE_MODULE(         \\\n          class_,                 \\\n          flags_,                 \\\n          size_,                  \\\n          name_,                  \\\n          version_,               \\\n          requires_,              \\\n          interface_,             \\\n          init_,                  \\\n          done_,                  \\\n          get_interface_ )        \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Module_Class class_ =  \\\n  {                               \\\n    flags_,                       \\\n    size_,                        \\\n                                  \\\n    name_,                        \\\n    version_,                     \\\n    requires_,                    \\\n                                  \\\n    interface_,                   \\\n                                  \\\n    init_,                        \\\n    done_,                        \\\n    get_interface_,               \\\n  };\n\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_MODULE( class_ )                               \\\n  FT_Error                                                        \\\n  FT_Create_Class_ ## class_( FT_Library         library,         \\\n                              FT_Module_Class**  output_class );  \\\n  void                                                            \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,         \\\n                               FT_Module_Class*  clazz );\n\n#define FT_DEFINE_ROOT_MODULE(                      \\\n          flags_,                                   \\\n          size_,                                    \\\n          name_,                                    \\\n          version_,                                 \\\n          requires_,                                \\\n          interface_,                               \\\n          init_,                                    \\\n          done_,                                    \\\n          get_interface_ )                          \\\n    clazz->root.module_flags     = flags_;          \\\n    clazz->root.module_size      = size_;           \\\n    clazz->root.module_name      = name_;           \\\n    clazz->root.module_version   = version_;        \\\n    clazz->root.module_requires  = requires_;       \\\n                                                    \\\n    clazz->root.module_interface = interface_;      \\\n                                                    \\\n    clazz->root.module_init      = init_;           \\\n    clazz->root.module_done      = done_;           \\\n    clazz->root.get_interface    = get_interface_;\n\n#define FT_DEFINE_MODULE(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_ )                                       \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory memory = library->memory;                          \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( clazz )                                                 \\\n      FT_FREE( clazz );                                          \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Memory         memory = library->memory;                  \\\n    FT_Module_Class*  clazz  = NULL;                             \\\n    FT_Error          error;                                     \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    clazz->module_flags     = flags_;                            \\\n    clazz->module_size      = size_;                             \\\n    clazz->module_name      = name_;                             \\\n    clazz->module_version   = version_;                          \\\n    clazz->module_requires  = requires_;                         \\\n                                                                 \\\n    clazz->module_interface = interface_;                        \\\n                                                                 \\\n    clazz->module_init      = init_;                             \\\n    clazz->module_done      = done_;                             \\\n    clazz->get_interface    = get_interface_;                    \\\n                                                                 \\\n    *output_class = clazz;                                       \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\nFT_END_HEADER\n\n#endif /* __FTOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services (declaration).       */\n/*                                                                         */\n/*  Copyright 2009, 2012 by                                                */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Modules that ordinarily have const global data that need address     */\n  /*  can instead define pointers here.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTPIC_H__\n#define __FTPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  typedef struct  FT_PIC_Container_\n  {\n    /* pic containers for base */\n    void*  base;\n\n    /* pic containers for modules */\n    void*  autofit;\n    void*  cff;\n    void*  pshinter;\n    void*  psnames;\n    void*  raster;\n    void*  sfnt;\n    void*  smooth;\n    void*  truetype;\n\n  } FT_PIC_Container;\n\n\n  /* Initialize the various function tables, structs, etc. */\n  /* stored in the container.                              */\n  FT_BASE( FT_Error )\n  ft_pic_container_init( FT_Library  library );\n\n\n  /* Destroy the contents of the container. */\n  FT_BASE( void )\n  ft_pic_container_destroy( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftrfork.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrfork.h                                                              */\n/*                                                                         */\n/*    Embedded resource forks accessor (specification).                    */\n/*                                                                         */\n/*  Copyright 2004, 2006, 2007, 2012 by                                    */\n/*  Masatake YAMATO and Redhat K.K.                                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/* Development of the code in this file is support of                      */\n/* Information-technology Promotion Agency, Japan.                         */\n/***************************************************************************/\n\n\n#ifndef __FTRFORK_H__\n#define __FTRFORK_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* Number of guessing rules supported in `FT_Raccess_Guess'.            */\n  /* Don't forget to increment the number if you add a new guessing rule. */\n#define FT_RACCESS_N_RULES  9\n\n\n  /* A structure to describe a reference in a resource by its resource ID */\n  /* and internal offset.  The `POST' resource expects to be concatenated */\n  /* by the order of resource IDs instead of its appearance in the file.  */\n\n  typedef struct  FT_RFork_Ref_\n  {\n    FT_UShort  res_id;\n    FT_ULong   offset;\n\n  } FT_RFork_Ref;\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n  typedef FT_Error\n  (*ft_raccess_guess_func)( FT_Library  library,\n                            FT_Stream   stream,\n                            char       *base_file_name,\n                            char      **result_file_name,\n                            FT_Long    *result_offset );\n\n  typedef enum  FT_RFork_Rule_ {\n    FT_RFork_Rule_invalid = -2,\n    FT_RFork_Rule_uknown, /* -1 */\n    FT_RFork_Rule_apple_double,\n    FT_RFork_Rule_apple_single,\n    FT_RFork_Rule_darwin_ufs_export,\n    FT_RFork_Rule_darwin_newvfs,\n    FT_RFork_Rule_darwin_hfsplus,\n    FT_RFork_Rule_vfat,\n    FT_RFork_Rule_linux_cap,\n    FT_RFork_Rule_linux_double,\n    FT_RFork_Rule_linux_netatalk\n  } FT_RFork_Rule;\n\n  /* For fast translation between rule index and rule type,\n   * the macros FT_RFORK_xxx should be kept consistent with\n   * the raccess_guess_funcs table\n   */\n  typedef struct ft_raccess_guess_rec_ {\n    ft_raccess_guess_func  func;\n    FT_RFork_Rule          type;\n  } ft_raccess_guess_rec;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n  /* this array is a storage in non-PIC mode, so ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          const type name[] = {\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          { raccess_guess_ ## func_suffix,                           \\\n            FT_RFork_Rule_ ## type_suffix },\n#define CONST_FT_RFORK_RULE_ARRAY_END  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  /* this array is a function in PIC mode, so no ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          void                                         \\\n          FT_Init_ ## name( type*  storage )           \\\n          {                                            \\\n            type*  local = storage;                    \\\n                                                       \\\n                                                       \\\n            int  i = 0;\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          local[i].func = raccess_guess_ ## func_suffix;             \\\n          local[i].type = FT_RFork_Rule_ ## type_suffix;             \\\n          i++;\n#define CONST_FT_RFORK_RULE_ARRAY_END  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Guess                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Guess a file name and offset where the actual resource fork is     */\n  /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */\n  /*    guessing rules;  the guessed result for the Nth rule is            */\n  /*    represented as a triplet: a new file name (new_names[N]), a file   */\n  /*    offset (offsets[N]), and an error code (errors[N]).                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    base_name ::                                                       */\n  /*      The (base) file name of the resource fork used for some          */\n  /*      guessing rules.                                                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    new_names ::                                                       */\n  /*      An array of guessed file names in which the resource forks may   */\n  /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */\n  /*      equal to `base_name'.                                            */\n  /*                                                                       */\n  /*    offsets ::                                                         */\n  /*      An array of guessed file offsets.  `offsets[N]' holds the file   */\n  /*      offset of the possible start of the resource fork in file        */\n  /*      `new_names[N]'.                                                  */\n  /*                                                                       */\n  /*    errors ::                                                          */\n  /*      An array of FreeType error codes.  `errors[N]' is the error      */\n  /*      code of Nth guessing rule function.  If `errors[N]' is not       */\n  /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Raccess_Guess( FT_Library  library,\n                    FT_Stream   stream,\n                    char*       base_name,\n                    char**      new_names,\n                    FT_Long*    offsets,\n                    FT_Error*   errors );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_HeaderInfo                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the information from the header of resource fork.  The         */\n  /*    information includes the file offset where the resource map        */\n  /*    starts, and the file offset where the resource data starts.        */\n  /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    rfork_offset ::                                                    */\n  /*      The file offset where the resource fork starts.                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_HeaderInfo( FT_Library  library,\n                             FT_Stream   stream,\n                             FT_Long     rfork_offset,\n                             FT_Long    *map_offset,\n                             FT_Long    *rdata_pos );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_DataOffsets                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the data offsets for a tag in a resource fork.  Offsets are    */\n  /*    stored in an array because, in some cases, resources in a resource */\n  /*    fork have the same tag.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /*    tag ::                                                             */\n  /*      The resource tag.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    offsets ::                                                         */\n  /*      The stream offsets for the resource data specified by `tag'.     */\n  /*      This array is allocated by the function, so you have to call     */\n  /*      @ft_mem_free after use.                                          */\n  /*                                                                       */\n  /*    count ::                                                           */\n  /*      The length of offsets array.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */\n  /*    value for `map_offset' and `rdata_pos'.                            */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_DataOffsets( FT_Library  library,\n                              FT_Stream   stream,\n                              FT_Long     map_offset,\n                              FT_Long     rdata_pos,\n                              FT_Long     tag,\n                              FT_Long   **offsets,\n                              FT_Long    *count );\n\n\nFT_END_HEADER\n\n#endif /* __FTRFORK_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftserv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftserv.h                                                               */\n/*                                                                         */\n/*    The FreeType services (specification only).                          */\n/*                                                                         */\n/*  Copyright 2003-2007, 2009, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Each module can export one or more `services'.  Each service is      */\n  /*  identified by a constant string and modeled by a pointer; the latter */\n  /*  generally corresponds to a structure containing function pointers.   */\n  /*                                                                       */\n  /*  Note that a service's data cannot be a mere function pointer because */\n  /*  in C it is possible that function pointers might be implemented      */\n  /*  differently than data pointers (e.g. 48 bits instead of 32).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSERV_H__\n#define __FTSERV_H__\n\n\nFT_BEGIN_HEADER\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from a face's driver module.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );             \\\n    FT_Pointer   _tmp_  = NULL;                                             \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                              \\\n                                                                            \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                                        \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );              \\\n    FT_Pointer  _tmp_  = NULL;                                              \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    ptr = _tmp_;                                                            \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_GLOBAL_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from all modules.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );    \\\n    FT_Pointer   _tmp_;                                            \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                     \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );     \\\n    FT_Pointer  _tmp_;                                             \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    ptr   = _tmp_;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****         S E R V I C E   D E S C R I P T O R S                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  The following structure is used to _describe_ a given service\n   *  to the library.  This is useful to build simple static service lists.\n   */\n  typedef struct  FT_ServiceDescRec_\n  {\n    const char*  serv_id;     /* service name         */\n    const void*  serv_data;   /* service pointer/data */\n\n  } FT_ServiceDescRec;\n\n  typedef const FT_ServiceDescRec*  FT_ServiceDesc;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_SERVICEDESCREC1                                          */\n  /*    FT_DEFINE_SERVICEDESCREC2                                          */\n  /*    FT_DEFINE_SERVICEDESCREC3                                          */\n  /*    FT_DEFINE_SERVICEDESCREC4                                          */\n  /*    FT_DEFINE_SERVICEDESCREC5                                          */\n  /*    FT_DEFINE_SERVICEDESCREC6                                          */\n  /*    FT_DEFINE_SERVICEDESCREC7                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an array of FT_ServiceDescRec structures.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function needs to  */\n  /*    be called with a pointer to return an allocated array.  As soon as */\n  /*    it is no longer needed, a `destroy' function needs to be called to */\n  /*    release that allocation.                                           */\n  /*                                                                       */\n  /*    These functions should be manually called from the `pic_init' and  */\n  /*    `pic_free' functions of your module (see FT_DEFINE_MODULE).        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the array will be         */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { serv_id_7, serv_data_7 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = NULL;                                              \\\n    clazz[1].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = NULL;                                              \\\n    clazz[2].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = NULL;                                              \\\n    clazz[3].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = NULL;                                              \\\n    clazz[4].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = NULL;                                              \\\n    clazz[5].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = NULL;                                              \\\n    clazz[6].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = serv_id_7;                                         \\\n    clazz[6].serv_data = serv_data_7;                                       \\\n    clazz[7].serv_id   = NULL;                                              \\\n    clazz[7].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*\n   *  Parse a list of FT_ServiceDescRec descriptors and look for\n   *  a specific service by ID.  Note that the last element in the\n   *  array must be { NULL, NULL }, and that the function should\n   *  return NULL if the service isn't available.\n   *\n   *  This function can be used by modules to implement their\n   *  `get_service' method.\n   */\n  FT_BASE( FT_Pointer )\n  ft_service_list_lookup( FT_ServiceDesc  service_descriptors,\n                          const char*     service_id );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****             S E R V I C E S   C A C H E                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  This structure is used to store a cache for several frequently used\n   *  services.  It is the type of `face->internal->services'.  You\n   *  should only use FT_FACE_LOOKUP_SERVICE to access it.\n   *\n   *  All fields should have the type FT_Pointer to relax compilation\n   *  dependencies.  We assume the developer isn't completely stupid.\n   *\n   *  Each field must be named `service_XXXX' where `XXX' corresponds to\n   *  the correct FT_SERVICE_ID_XXXX macro.  See the definition of\n   *  FT_FACE_LOOKUP_SERVICE below how this is implemented.\n   *\n   */\n  typedef struct  FT_ServiceCacheRec_\n  {\n    FT_Pointer  service_POSTSCRIPT_FONT_NAME;\n    FT_Pointer  service_MULTI_MASTERS;\n    FT_Pointer  service_GLYPH_DICT;\n    FT_Pointer  service_PFR_METRICS;\n    FT_Pointer  service_WINFNT;\n\n  } FT_ServiceCacheRec, *FT_ServiceCache;\n\n\n  /*\n   *  A magic number used within the services cache.\n   */\n\n  /* ensure that value `1' has the same width as a pointer */\n#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)~(FT_PtrDist)1)\n\n\n  /*\n   * @macro:\n   *   FT_FACE_LOOKUP_SERVICE\n   *\n   * @description:\n   *   This macro is used to lookup a service from a face's driver module\n   *   using its cache.\n   *\n   * @input:\n   *   face::\n   *     The source face handle containing the cache.\n   *\n   *   field ::\n   *     The field name in the cache.\n   *\n   *   id ::\n   *     The service ID.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable receiving the service data.  NULL if not available.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer   svc;                                          \\\n    FT_Pointer*  Pptr = (FT_Pointer*)&(ptr);                   \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    *Pptr = svc;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer  svc;                                           \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    ptr = svc;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n  /*\n   *  A macro used to define new service structure types.\n   */\n\n#define FT_DEFINE_SERVICE( name )            \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    FT_Service_ ## name ## Rec ;             \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    const * FT_Service_ ## name ;            \\\n  struct FT_Service_ ## name ## Rec_\n\n  /* */\n\n  /*\n   *  The header files containing the services.\n   */\n\n#define FT_SERVICE_BDF_H                <freetype/internal/services/svbdf.h>\n#define FT_SERVICE_CID_H                <freetype/internal/services/svcid.h>\n#define FT_SERVICE_GLYPH_DICT_H         <freetype/internal/services/svgldict.h>\n#define FT_SERVICE_GX_VALIDATE_H        <freetype/internal/services/svgxval.h>\n#define FT_SERVICE_KERNING_H            <freetype/internal/services/svkern.h>\n#define FT_SERVICE_MULTIPLE_MASTERS_H   <freetype/internal/services/svmm.h>\n#define FT_SERVICE_OPENTYPE_VALIDATE_H  <freetype/internal/services/svotval.h>\n#define FT_SERVICE_PFR_H                <freetype/internal/services/svpfr.h>\n#define FT_SERVICE_POSTSCRIPT_CMAPS_H   <freetype/internal/services/svpscmap.h>\n#define FT_SERVICE_POSTSCRIPT_INFO_H    <freetype/internal/services/svpsinfo.h>\n#define FT_SERVICE_POSTSCRIPT_NAME_H    <freetype/internal/services/svpostnm.h>\n#define FT_SERVICE_PROPERTIES_H         <freetype/internal/services/svprop.h>\n#define FT_SERVICE_SFNT_H               <freetype/internal/services/svsfnt.h>\n#define FT_SERVICE_TRUETYPE_ENGINE_H    <freetype/internal/services/svtteng.h>\n#define FT_SERVICE_TT_CMAP_H            <freetype/internal/services/svttcmap.h>\n#define FT_SERVICE_WINFNT_H             <freetype/internal/services/svwinfnt.h>\n#define FT_SERVICE_XFREE86_NAME_H       <freetype/internal/services/svxf86nm.h>\n#define FT_SERVICE_TRUETYPE_GLYF_H      <freetype/internal/services/svttglyf.h>\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTSERV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftstream.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstream.h                                                             */\n/*                                                                         */\n/*    Stream handling (specification).                                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2006, 2011, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSTREAM_H__\n#define __FTSTREAM_H__\n\n\n#include <ft2build.h>\n#include FT_SYSTEM_H\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* format of an 8-bit frame_op value:           */\n  /*                                              */\n  /* bit  76543210                                */\n  /*      xxxxxxes                                */\n  /*                                              */\n  /* s is set to 1 if the value is signed.        */\n  /* e is set to 1 if the value is little-endian. */\n  /* xxx is a command.                            */\n\n#define FT_FRAME_OP_SHIFT         2\n#define FT_FRAME_OP_SIGNED        1\n#define FT_FRAME_OP_LITTLE        2\n#define FT_FRAME_OP_COMMAND( x )  ( x >> FT_FRAME_OP_SHIFT )\n\n#define FT_MAKE_FRAME_OP( command, little, sign ) \\\n          ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )\n\n#define FT_FRAME_OP_END    0\n#define FT_FRAME_OP_START  1  /* start a new frame     */\n#define FT_FRAME_OP_BYTE   2  /* read 1-byte value     */\n#define FT_FRAME_OP_SHORT  3  /* read 2-byte value     */\n#define FT_FRAME_OP_LONG   4  /* read 4-byte value     */\n#define FT_FRAME_OP_OFF3   5  /* read 3-byte value     */\n#define FT_FRAME_OP_BYTES  6  /* read a bytes sequence */\n\n\n  typedef enum  FT_Frame_Op_\n  {\n    ft_frame_end       = 0,\n    ft_frame_start     = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),\n\n    ft_frame_byte      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 0 ),\n    ft_frame_schar     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 1 ),\n\n    ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),\n    ft_frame_short_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),\n    ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),\n    ft_frame_short_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),\n\n    ft_frame_ulong_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),\n    ft_frame_long_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),\n    ft_frame_ulong_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),\n    ft_frame_long_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),\n\n    ft_frame_uoff3_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),\n    ft_frame_off3_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),\n    ft_frame_uoff3_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),\n    ft_frame_off3_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),\n\n    ft_frame_bytes     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),\n    ft_frame_skip      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )\n\n  } FT_Frame_Op;\n\n\n  typedef struct  FT_Frame_Field_\n  {\n    FT_Byte    value;\n    FT_Byte    size;\n    FT_UShort  offset;\n\n  } FT_Frame_Field;\n\n\n  /* Construct an FT_Frame_Field out of a structure type and a field name. */\n  /* The structure type must be set in the FT_STRUCTURE macro before       */\n  /* calling the FT_FRAME_START() macro.                                   */\n  /*                                                                       */\n#define FT_FIELD_SIZE( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )\n\n#define FT_FIELD_SIZE_DELTA( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )\n\n#define FT_FIELD_OFFSET( f ) \\\n          (FT_UShort)( offsetof( FT_STRUCTURE, f ) )\n\n#define FT_FRAME_FIELD( frame_op, field ) \\\n          {                               \\\n            frame_op,                     \\\n            FT_FIELD_SIZE( field ),       \\\n            FT_FIELD_OFFSET( field )      \\\n          }\n\n#define FT_MAKE_EMPTY_FIELD( frame_op )  { frame_op, 0, 0 }\n\n#define FT_FRAME_START( size )   { ft_frame_start, 0, size }\n#define FT_FRAME_END             { ft_frame_end, 0, 0 }\n\n#define FT_FRAME_LONG( f )       FT_FRAME_FIELD( ft_frame_long_be, f )\n#define FT_FRAME_ULONG( f )      FT_FRAME_FIELD( ft_frame_ulong_be, f )\n#define FT_FRAME_SHORT( f )      FT_FRAME_FIELD( ft_frame_short_be, f )\n#define FT_FRAME_USHORT( f )     FT_FRAME_FIELD( ft_frame_ushort_be, f )\n#define FT_FRAME_OFF3( f )       FT_FRAME_FIELD( ft_frame_off3_be, f )\n#define FT_FRAME_UOFF3( f )      FT_FRAME_FIELD( ft_frame_uoff3_be, f )\n#define FT_FRAME_BYTE( f )       FT_FRAME_FIELD( ft_frame_byte, f )\n#define FT_FRAME_CHAR( f )       FT_FRAME_FIELD( ft_frame_schar, f )\n\n#define FT_FRAME_LONG_LE( f )    FT_FRAME_FIELD( ft_frame_long_le, f )\n#define FT_FRAME_ULONG_LE( f )   FT_FRAME_FIELD( ft_frame_ulong_le, f )\n#define FT_FRAME_SHORT_LE( f )   FT_FRAME_FIELD( ft_frame_short_le, f )\n#define FT_FRAME_USHORT_LE( f )  FT_FRAME_FIELD( ft_frame_ushort_le, f )\n#define FT_FRAME_OFF3_LE( f )    FT_FRAME_FIELD( ft_frame_off3_le, f )\n#define FT_FRAME_UOFF3_LE( f )   FT_FRAME_FIELD( ft_frame_uoff3_le, f )\n\n#define FT_FRAME_SKIP_LONG       { ft_frame_long_be, 0, 0 }\n#define FT_FRAME_SKIP_SHORT      { ft_frame_short_be, 0, 0 }\n#define FT_FRAME_SKIP_BYTE       { ft_frame_byte, 0, 0 }\n\n#define FT_FRAME_BYTES( field, count ) \\\n          {                            \\\n            ft_frame_bytes,            \\\n            count,                     \\\n            FT_FIELD_OFFSET( field )   \\\n          }\n\n#define FT_FRAME_SKIP_BYTES( count )  { ft_frame_skip, count, 0 }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */\n  /* type `char*' or equivalent (1-byte elements).                         */\n  /*                                                                       */\n\n#define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )\n\n#define FT_INT16( x )   ( (FT_Int16)(x)  )\n#define FT_UINT16( x )  ( (FT_UInt16)(x) )\n#define FT_INT32( x )   ( (FT_Int32)(x)  )\n#define FT_UINT32( x )  ( (FT_UInt32)(x) )\n\n\n#define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )\n#define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )\n\n\n#define FT_PEEK_SHORT( p )  FT_INT16( FT_BYTE_U16( p, 0, 8) | \\\n                                      FT_BYTE_U16( p, 1, 0) )\n\n#define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \\\n                                        FT_BYTE_U16( p, 1, 0 ) )\n\n#define FT_PEEK_LONG( p )  FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                     FT_BYTE_U32( p, 1, 16 ) | \\\n                                     FT_BYTE_U32( p, 2,  8 ) | \\\n                                     FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                       FT_BYTE_U32( p, 1, 16 ) | \\\n                                       FT_BYTE_U32( p, 2,  8 ) | \\\n                                       FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_OFF3( p )  FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                     FT_BYTE_U32( p, 1,  8 ) | \\\n                                     FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                       FT_BYTE_U32( p, 1,  8 ) | \\\n                                       FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \\\n                                         FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \\\n                                           FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                        FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                          FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n\n#define FT_NEXT_CHAR( buffer )       \\\n          ( (signed char)*buffer++ )\n\n#define FT_NEXT_BYTE( buffer )         \\\n          ( (unsigned char)*buffer++ )\n\n#define FT_NEXT_SHORT( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )\n\n\n#define FT_NEXT_SHORT_LE( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT_LE( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3_LE( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG_LE( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each GET_xxxx() macro uses an implicit `stream' variable.             */\n  /*                                                                       */\n#if 0\n#define FT_GET_MACRO( type )    FT_NEXT_ ## type ( stream->cursor )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( CHAR )\n#define FT_GET_BYTE()       FT_GET_MACRO( BYTE )\n#define FT_GET_SHORT()      FT_GET_MACRO( SHORT )\n#define FT_GET_USHORT()     FT_GET_MACRO( USHORT )\n#define FT_GET_OFF3()       FT_GET_MACRO( OFF3 )\n#define FT_GET_UOFF3()      FT_GET_MACRO( UOFF3 )\n#define FT_GET_LONG()       FT_GET_MACRO( LONG )\n#define FT_GET_ULONG()      FT_GET_MACRO( ULONG )\n#define FT_GET_TAG4()       FT_GET_MACRO( ULONG )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( SHORT_LE )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( USHORT_LE )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( LONG_LE )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( ULONG_LE )\n\n#else\n#define FT_GET_MACRO( func, type )        ( (type)func( stream ) )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )\n#define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )\n#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )\n#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )\n#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )\n#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )\n#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetULong, FT_Long )\n#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )\n#endif\n\n#define FT_READ_MACRO( func, type, var )        \\\n          ( var = (type)func( stream, &error ), \\\n            error != FT_Err_Ok )\n\n#define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )\n#define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )\n#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )\n#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )\n#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )\n#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )\n#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )\n#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )\n\n#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )\n#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )\n#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )\n#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /* initialize a stream for reading a regular system stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Open( FT_Stream    stream,\n                  const char*  filepathname );\n\n#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* create a new (input) stream from an FT_Open_Args structure */\n  FT_BASE( FT_Error )\n  FT_Stream_New( FT_Library           library,\n                 const FT_Open_Args*  args,\n                 FT_Stream           *astream );\n\n  /* free a stream */\n  FT_BASE( void )\n  FT_Stream_Free( FT_Stream  stream,\n                  FT_Int     external );\n\n  /* initialize a stream for reading in-memory data */\n  FT_BASE( void )\n  FT_Stream_OpenMemory( FT_Stream       stream,\n                        const FT_Byte*  base,\n                        FT_ULong        size );\n\n  /* close a stream (does not destroy the stream structure) */\n  FT_BASE( void )\n  FT_Stream_Close( FT_Stream  stream );\n\n\n  /* seek within a stream. position is relative to start of stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Seek( FT_Stream  stream,\n                  FT_ULong   pos );\n\n  /* skip bytes in a stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Skip( FT_Stream  stream,\n                  FT_Long    distance );\n\n  /* return current stream position */\n  FT_BASE( FT_Long )\n  FT_Stream_Pos( FT_Stream  stream );\n\n  /* read bytes from a stream into a user-allocated buffer, returns an */\n  /* error if not all bytes could be read.                             */\n  FT_BASE( FT_Error )\n  FT_Stream_Read( FT_Stream  stream,\n                  FT_Byte*   buffer,\n                  FT_ULong   count );\n\n  /* read bytes from a stream at a given position */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadAt( FT_Stream  stream,\n                    FT_ULong   pos,\n                    FT_Byte*   buffer,\n                    FT_ULong   count );\n\n  /* try to read bytes at the end of a stream; return number of bytes */\n  /* really available                                                 */\n  FT_BASE( FT_ULong )\n  FT_Stream_TryRead( FT_Stream  stream,\n                     FT_Byte*   buffer,\n                     FT_ULong   count );\n\n  /* Enter a frame of `count' consecutive bytes in a stream.  Returns an */\n  /* error if the frame could not be read/accessed.  The caller can use  */\n  /* the FT_Stream_Get_XXX functions to retrieve frame data without      */\n  /* error checks.                                                       */\n  /*                                                                     */\n  /* You must _always_ call FT_Stream_ExitFrame() once you have entered  */\n  /* a stream frame!                                                     */\n  /*                                                                     */\n  FT_BASE( FT_Error )\n  FT_Stream_EnterFrame( FT_Stream  stream,\n                        FT_ULong   count );\n\n  /* exit a stream frame */\n  FT_BASE( void )\n  FT_Stream_ExitFrame( FT_Stream  stream );\n\n  /* Extract a stream frame.  If the stream is disk-based, a heap block */\n  /* is allocated and the frame bytes are read into it.  If the stream  */\n  /* is memory-based, this function simply set a pointer to the data.   */\n  /*                                                                    */\n  /* Useful to optimize access to memory-based streams transparently.   */\n  /*                                                                    */\n  /* All extracted frames must be `freed' with a call to the function   */\n  /* FT_Stream_ReleaseFrame().                                          */\n  /*                                                                    */\n  FT_BASE( FT_Error )\n  FT_Stream_ExtractFrame( FT_Stream  stream,\n                          FT_ULong   count,\n                          FT_Byte**  pbytes );\n\n  /* release an extract frame (see FT_Stream_ExtractFrame) */\n  FT_BASE( void )\n  FT_Stream_ReleaseFrame( FT_Stream  stream,\n                          FT_Byte**  pbytes );\n\n  /* read a byte from an entered frame */\n  FT_BASE( FT_Char )\n  FT_Stream_GetChar( FT_Stream  stream );\n\n  /* read a 16-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShort( FT_Stream  stream );\n\n  /* read a 24-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetUOffset( FT_Stream  stream );\n\n  /* read a 32-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULong( FT_Stream  stream );\n\n  /* read a 16-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShortLE( FT_Stream  stream );\n\n  /* read a 32-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULongLE( FT_Stream  stream );\n\n\n  /* read a byte from a stream */\n  FT_BASE( FT_Char )\n  FT_Stream_ReadChar( FT_Stream  stream,\n                      FT_Error*  error );\n\n  /* read a 16-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShort( FT_Stream  stream,\n                        FT_Error*  error );\n\n  /* read a 24-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadUOffset( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* read a 32-bit big-endian integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULong( FT_Stream  stream,\n                       FT_Error*  error );\n\n  /* read a 16-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShortLE( FT_Stream  stream,\n                          FT_Error*  error );\n\n  /* read a 32-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULongLE( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* Read a structure from a stream.  The structure must be described */\n  /* by an array of FT_Frame_Field records.                           */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadFields( FT_Stream              stream,\n                        const FT_Frame_Field*  fields,\n                        void*                  structure );\n\n\n#define FT_STREAM_POS()           \\\n          FT_Stream_Pos( stream )\n\n#define FT_STREAM_SEEK( position )                               \\\n          FT_SET_ERROR( FT_Stream_Seek( stream,                  \\\n                                        (FT_ULong)(position) ) )\n\n#define FT_STREAM_SKIP( distance )                              \\\n          FT_SET_ERROR( FT_Stream_Skip( stream,                 \\\n                                        (FT_Long)(distance) ) )\n\n#define FT_STREAM_READ( buffer, count )                       \\\n          FT_SET_ERROR( FT_Stream_Read( stream,               \\\n                                        (FT_Byte*)(buffer),   \\\n                                        (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_AT( position, buffer, count )            \\\n          FT_SET_ERROR( FT_Stream_ReadAt( stream,               \\\n                                          (FT_ULong)(position), \\\n                                          (FT_Byte*)buffer,     \\\n                                          (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_FIELDS( fields, object )                          \\\n          FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )\n\n\n#define FT_FRAME_ENTER( size )                                           \\\n          FT_SET_ERROR(                                                  \\\n            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream,                \\\n                                                  (FT_ULong)(size) ) ) )\n\n#define FT_FRAME_EXIT()                                   \\\n          FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )\n\n#define FT_FRAME_EXTRACT( size, bytes )                                       \\\n          FT_SET_ERROR(                                                       \\\n            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream,                   \\\n                                                    (FT_ULong)(size),         \\\n                                                    (FT_Byte**)&(bytes) ) ) )\n\n#define FT_FRAME_RELEASE( bytes )                                         \\\n          FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream,                 \\\n                                                  (FT_Byte**)&(bytes) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTSTREAM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/fttrace.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrace.h                                                              */\n/*                                                                         */\n/*    Tracing handling (specification only).                               */\n/*                                                                         */\n/*  Copyright 2002, 2004-2007, 2009, 2011-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* definitions of trace levels for FreeType 2 */\n\n  /* the first level must always be `trace_any' */\nFT_TRACE_DEF( any )\n\n  /* base components */\nFT_TRACE_DEF( calc )      /* calculations            (ftcalc.c)   */\nFT_TRACE_DEF( memory )    /* memory manager          (ftobjs.c)   */\nFT_TRACE_DEF( stream )    /* stream manager          (ftstream.c) */\nFT_TRACE_DEF( io )        /* i/o interface           (ftsystem.c) */\nFT_TRACE_DEF( list )      /* list management         (ftlist.c)   */\nFT_TRACE_DEF( init )      /* initialization          (ftinit.c)   */\nFT_TRACE_DEF( objs )      /* base objects            (ftobjs.c)   */\nFT_TRACE_DEF( outline )   /* outline management      (ftoutln.c)  */\nFT_TRACE_DEF( glyph )     /* glyph management        (ftglyph.c)  */\nFT_TRACE_DEF( gloader )   /* glyph loader            (ftgloadr.c) */\n\nFT_TRACE_DEF( raster )    /* monochrome rasterizer   (ftraster.c) */\nFT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */\nFT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */\nFT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */\nFT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */\nFT_TRACE_DEF( bitmap )    /* bitmap checksum         (ftobjs.c)   */\n\n  /* Cache sub-system */\nFT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */\n\n  /* SFNT driver components */\nFT_TRACE_DEF( sfdriver )  /* SFNT font driver        (sfdriver.c) */\nFT_TRACE_DEF( sfobjs )    /* SFNT object handler     (sfobjs.c)   */\nFT_TRACE_DEF( ttcmap )    /* charmap handler         (ttcmap.c)   */\nFT_TRACE_DEF( ttkern )    /* kerning handler         (ttkern.c)   */\nFT_TRACE_DEF( ttload )    /* basic TrueType tables   (ttload.c)   */\nFT_TRACE_DEF( ttmtx )     /* metrics-related tables  (ttmtx.c)    */\nFT_TRACE_DEF( ttpost )    /* PS table processing     (ttpost.c)   */\nFT_TRACE_DEF( ttsbit )    /* TrueType sbit handling  (ttsbit.c)   */\nFT_TRACE_DEF( ttbdf )     /* TrueType embedded BDF   (ttbdf.c)    */\n\n  /* TrueType driver components */\nFT_TRACE_DEF( ttdriver )  /* TT font driver          (ttdriver.c) */\nFT_TRACE_DEF( ttgload )   /* TT glyph loader         (ttgload.c)  */\nFT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */\nFT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */\nFT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */\nFT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */\n\n  /* Type 1 driver components */\nFT_TRACE_DEF( t1afm )\nFT_TRACE_DEF( t1driver )\nFT_TRACE_DEF( t1gload )\nFT_TRACE_DEF( t1hint )\nFT_TRACE_DEF( t1load )\nFT_TRACE_DEF( t1objs )\nFT_TRACE_DEF( t1parse )\n\n  /* PostScript helper module `psaux' */\nFT_TRACE_DEF( t1decode )\nFT_TRACE_DEF( psobjs )\nFT_TRACE_DEF( psconv )\n\n  /* PostScript hinting module `pshinter' */\nFT_TRACE_DEF( pshrec )\nFT_TRACE_DEF( pshalgo1 )\nFT_TRACE_DEF( pshalgo2 )\n\n  /* Type 2 driver components */\nFT_TRACE_DEF( cffdriver )\nFT_TRACE_DEF( cffgload )\nFT_TRACE_DEF( cffload )\nFT_TRACE_DEF( cffobjs )\nFT_TRACE_DEF( cffparse )\n\nFT_TRACE_DEF( cf2blues )\nFT_TRACE_DEF( cf2hints )\nFT_TRACE_DEF( cf2interp )\n\n  /* Type 42 driver component */\nFT_TRACE_DEF( t42 )\n\n  /* CID driver components */\nFT_TRACE_DEF( cidafm )\nFT_TRACE_DEF( ciddriver )\nFT_TRACE_DEF( cidgload )\nFT_TRACE_DEF( cidload )\nFT_TRACE_DEF( cidobjs )\nFT_TRACE_DEF( cidparse )\n\n  /* Windows font component */\nFT_TRACE_DEF( winfnt )\n\n  /* PCF font components */\nFT_TRACE_DEF( pcfdriver )\nFT_TRACE_DEF( pcfread )\n\n  /* BDF font components */\nFT_TRACE_DEF( bdfdriver )\nFT_TRACE_DEF( bdflib )\n\n  /* PFR font component */\nFT_TRACE_DEF( pfr )\n\n  /* OpenType validation components */\nFT_TRACE_DEF( otvmodule )\nFT_TRACE_DEF( otvcommon )\nFT_TRACE_DEF( otvbase )\nFT_TRACE_DEF( otvgdef )\nFT_TRACE_DEF( otvgpos )\nFT_TRACE_DEF( otvgsub )\nFT_TRACE_DEF( otvjstf )\nFT_TRACE_DEF( otvmath )\n\n  /* TrueTypeGX/AAT validation components */\nFT_TRACE_DEF( gxvmodule )\nFT_TRACE_DEF( gxvcommon )\nFT_TRACE_DEF( gxvfeat )\nFT_TRACE_DEF( gxvmort )\nFT_TRACE_DEF( gxvmorx )\nFT_TRACE_DEF( gxvbsln )\nFT_TRACE_DEF( gxvjust )\nFT_TRACE_DEF( gxvkern )\nFT_TRACE_DEF( gxvopbd )\nFT_TRACE_DEF( gxvtrak )\nFT_TRACE_DEF( gxvprop )\nFT_TRACE_DEF( gxvlcar )\n\n  /* autofit components */\nFT_TRACE_DEF( afmodule )\nFT_TRACE_DEF( afhints )\nFT_TRACE_DEF( afcjk )\nFT_TRACE_DEF( aflatin )\nFT_TRACE_DEF( aflatin2 )\nFT_TRACE_DEF( afwarp )\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/ftvalid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftvalid.h                                                              */\n/*                                                                         */\n/*    FreeType validation support (specification).                         */\n/*                                                                         */\n/*  Copyright 2004, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTVALID_H__\n#define __FTVALID_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    V A L I D A T I O N                          ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to a validation object */\n  typedef struct FT_ValidatorRec_ volatile*  FT_Validator;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* There are three distinct validation levels defined here:              */\n  /*                                                                       */\n  /* FT_VALIDATE_DEFAULT ::                                                */\n  /*   A table that passes this validation level can be used reliably by   */\n  /*   FreeType.  It generally means that all offsets have been checked to */\n  /*   prevent out-of-bound reads, that array counts are correct, etc.     */\n  /*                                                                       */\n  /* FT_VALIDATE_TIGHT ::                                                  */\n  /*   A table that passes this validation level can be used reliably and  */\n  /*   doesn't contain invalid data.  For example, a charmap table that    */\n  /*   returns invalid glyph indices will not pass, even though it can     */\n  /*   be used with FreeType in default mode (the library will simply      */\n  /*   return an error later when trying to load the glyph).               */\n  /*                                                                       */\n  /*   It also checks that fields which must be a multiple of 2, 4, or 8,  */\n  /*   don't have incorrect values, etc.                                   */\n  /*                                                                       */\n  /* FT_VALIDATE_PARANOID ::                                               */\n  /*   Only for font debugging.  Checks that a table follows the           */\n  /*   specification by 100%.  Very few fonts will be able to pass this    */\n  /*   level anyway but it can be useful for certain tools like font       */\n  /*   editors/converters.                                                 */\n  /*                                                                       */\n  typedef enum  FT_ValidationLevel_\n  {\n    FT_VALIDATE_DEFAULT = 0,\n    FT_VALIDATE_TIGHT,\n    FT_VALIDATE_PARANOID\n\n  } FT_ValidationLevel;\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n  /* We disable the warning `structure was padded due to   */\n  /* __declspec(align())' in order to compile cleanly with */\n  /* the maximum level of warnings.                        */\n#pragma warning( push )\n#pragma warning( disable : 4324 )\n#endif /* _MSC_VER */\n\n  /* validator structure */\n  typedef struct  FT_ValidatorRec_\n  {\n    const FT_Byte*      base;        /* address of table in memory       */\n    const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */\n    FT_ValidationLevel  level;       /* validation level                 */\n    FT_Error            error;       /* error returned. 0 means success  */\n\n    ft_jmp_buf          jump_buffer; /* used for exception handling      */\n\n  } FT_ValidatorRec;\n\n#if defined( _MSC_VER )\n#pragma warning( pop )\n#endif\n\n#define FT_VALIDATOR( x )  ( (FT_Validator)( x ) )\n\n\n  FT_BASE( void )\n  ft_validator_init( FT_Validator        valid,\n                     const FT_Byte*      base,\n                     const FT_Byte*      limit,\n                     FT_ValidationLevel  level );\n\n  /* Do not use this. It's broken and will cause your validator to crash */\n  /* if you run it on an invalid font.                                   */\n  FT_BASE( FT_Int )\n  ft_validator_run( FT_Validator  valid );\n\n  /* Sets the error field in a validator, then calls `longjmp' to return */\n  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */\n  /* error checks within the validation routines.                        */\n  /*                                                                     */\n  FT_BASE( void )\n  ft_validator_error( FT_Validator  valid,\n                      FT_Error      error );\n\n\n  /* Calls ft_validate_error.  Assumes that the `valid' local variable */\n  /* holds a pointer to the current validator object.                  */\n  /*                                                                   */\n  /* Use preprocessor prescan to pass FT_ERR_PREFIX.                   */\n  /*                                                                   */\n#define FT_INVALID( _prefix, _error )  FT_INVALID_( _prefix, _error )\n#define FT_INVALID_( _prefix, _error ) \\\n          ft_validator_error( valid, _prefix ## _error )\n\n  /* called when a broken table is detected */\n#define FT_INVALID_TOO_SHORT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid offset is detected */\n#define FT_INVALID_OFFSET \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )\n\n  /* called when an invalid format/value is detected */\n#define FT_INVALID_FORMAT \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n  /* called when an invalid glyph index is detected */\n#define FT_INVALID_GLYPH_ID \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )\n\n  /* called when an invalid field value is detected */\n#define FT_INVALID_DATA \\\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\n\n\nFT_END_HEADER\n\n#endif /* __FTVALID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/internal.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  internal.h                                                             */\n/*                                                                         */\n/*    Internal header files (specification only).                          */\n/*                                                                         */\n/*  Copyright 1996-2004, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is automatically included by `ft2build.h'.                  */\n  /* Do not include it manually!                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define FT_INTERNAL_OBJECTS_H             <freetype/internal/ftobjs.h>\n#define FT_INTERNAL_PIC_H                 <freetype/internal/ftpic.h>\n#define FT_INTERNAL_STREAM_H              <freetype/internal/ftstream.h>\n#define FT_INTERNAL_MEMORY_H              <freetype/internal/ftmemory.h>\n#define FT_INTERNAL_DEBUG_H               <freetype/internal/ftdebug.h>\n#define FT_INTERNAL_CALC_H                <freetype/internal/ftcalc.h>\n#define FT_INTERNAL_DRIVER_H              <freetype/internal/ftdriver.h>\n#define FT_INTERNAL_TRACE_H               <freetype/internal/fttrace.h>\n#define FT_INTERNAL_GLYPH_LOADER_H        <freetype/internal/ftgloadr.h>\n#define FT_INTERNAL_SFNT_H                <freetype/internal/sfnt.h>\n#define FT_INTERNAL_SERVICE_H             <freetype/internal/ftserv.h>\n#define FT_INTERNAL_RFORK_H               <freetype/internal/ftrfork.h>\n#define FT_INTERNAL_VALIDATE_H            <freetype/internal/ftvalid.h>\n\n#define FT_INTERNAL_TRUETYPE_TYPES_H      <freetype/internal/tttypes.h>\n#define FT_INTERNAL_TYPE1_TYPES_H         <freetype/internal/t1types.h>\n\n#define FT_INTERNAL_POSTSCRIPT_AUX_H      <freetype/internal/psaux.h>\n#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <freetype/internal/pshints.h>\n#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <freetype/internal/psglobal.h>\n\n#define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n\n  /* We disable the warning `conditional expression is constant' here */\n  /* in order to compile cleanly with the maximum level of warnings.  */\n  /* In particular, the warning complains about stuff like `while(0)' */\n  /* which is very useful in macro definitions.  There is no benefit  */\n  /* in having it enabled.                                            */\n#pragma warning( disable : 4127 )\n\n#endif /* _MSC_VER */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/psaux.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psaux.h                                                                */\n/*                                                                         */\n/*    Auxiliary functions and data structures related to PostScript fonts  */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSAUX_H__\n#define __PSAUX_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                             T1_TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct PS_TableRec_*              PS_Table;\n  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Table_FuncsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of function pointers to manage PS_Table objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    table_init    :: Used to initialize a table.                       */\n  /*                                                                       */\n  /*    table_done    :: Finalizes resp. destroy a given table.            */\n  /*                                                                       */\n  /*    table_add     :: Adds a new object to a table.                     */\n  /*                                                                       */\n  /*    table_release :: Releases table data, then finalizes it.           */\n  /*                                                                       */\n  typedef struct  PS_Table_FuncsRec_\n  {\n    FT_Error\n    (*init)( PS_Table   table,\n             FT_Int     count,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Table  table );\n\n    FT_Error\n    (*add)( PS_Table    table,\n            FT_Int      idx,\n            void*       object,\n            FT_PtrDist  length );\n\n    void\n    (*release)( PS_Table  table );\n\n  } PS_Table_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Table is a simple object used to store an array of objects in */\n  /*    a single memory block.                                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    block     :: The address in memory of the growheap's block.  This  */\n  /*                 can change between two object adds, due to            */\n  /*                 reallocation.                                         */\n  /*                                                                       */\n  /*    cursor    :: The current top of the grow heap within its block.    */\n  /*                                                                       */\n  /*    capacity  :: The current size of the heap block.  Increments by    */\n  /*                 1kByte chunks.                                        */\n  /*                                                                       */\n  /*    init      :: Set to 0xDEADBEEF if `elements' and `lengths' have    */\n  /*                 been allocated.                                       */\n  /*                                                                       */\n  /*    max_elems :: The maximum number of elements in table.              */\n  /*                                                                       */\n  /*    num_elems :: The current number of elements in table.              */\n  /*                                                                       */\n  /*    elements  :: A table of element addresses within the block.        */\n  /*                                                                       */\n  /*    lengths   :: A table of element sizes within the block.            */\n  /*                                                                       */\n  /*    memory    :: The object used for memory operations                 */\n  /*                 (alloc/realloc).                                      */\n  /*                                                                       */\n  /*    funcs     :: A table of method pointers for this object.           */\n  /*                                                                       */\n  typedef struct  PS_TableRec_\n  {\n    FT_Byte*           block;          /* current memory block           */\n    FT_Offset          cursor;         /* current cursor in memory block */\n    FT_Offset          capacity;       /* current size of memory block   */\n    FT_Long            init;\n\n    FT_Int             max_elems;\n    FT_Int             num_elems;\n    FT_Byte**          elements;       /* addresses of table elements */\n    FT_PtrDist*        lengths;        /* lengths of table elements   */\n\n    FT_Memory          memory;\n    PS_Table_FuncsRec  funcs;\n\n  } PS_TableRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       T1 FIELDS & TOKENS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PS_ParserRec_*  PS_Parser;\n\n  typedef struct T1_TokenRec_*   T1_Token;\n\n  typedef struct T1_FieldRec_*   T1_Field;\n\n\n  /* simple enumeration type used to identify token types */\n  typedef enum  T1_TokenType_\n  {\n    T1_TOKEN_TYPE_NONE = 0,\n    T1_TOKEN_TYPE_ANY,\n    T1_TOKEN_TYPE_STRING,\n    T1_TOKEN_TYPE_ARRAY,\n    T1_TOKEN_TYPE_KEY, /* aka `name' */\n\n    /* do not remove */\n    T1_TOKEN_TYPE_MAX\n\n  } T1_TokenType;\n\n\n  /* a simple structure used to identify tokens */\n  typedef struct  T1_TokenRec_\n  {\n    FT_Byte*      start;   /* first character of token in input stream */\n    FT_Byte*      limit;   /* first character after the token          */\n    T1_TokenType  type;    /* type of token                            */\n\n  } T1_TokenRec;\n\n\n  /* enumeration type used to identify object fields */\n  typedef enum  T1_FieldType_\n  {\n    T1_FIELD_TYPE_NONE = 0,\n    T1_FIELD_TYPE_BOOL,\n    T1_FIELD_TYPE_INTEGER,\n    T1_FIELD_TYPE_FIXED,\n    T1_FIELD_TYPE_FIXED_1000,\n    T1_FIELD_TYPE_STRING,\n    T1_FIELD_TYPE_KEY,\n    T1_FIELD_TYPE_BBOX,\n    T1_FIELD_TYPE_MM_BBOX,\n    T1_FIELD_TYPE_INTEGER_ARRAY,\n    T1_FIELD_TYPE_FIXED_ARRAY,\n    T1_FIELD_TYPE_CALLBACK,\n\n    /* do not remove */\n    T1_FIELD_TYPE_MAX\n\n  } T1_FieldType;\n\n\n  typedef enum  T1_FieldLocation_\n  {\n    T1_FIELD_LOCATION_CID_INFO,\n    T1_FIELD_LOCATION_FONT_DICT,\n    T1_FIELD_LOCATION_FONT_EXTRA,\n    T1_FIELD_LOCATION_FONT_INFO,\n    T1_FIELD_LOCATION_PRIVATE,\n    T1_FIELD_LOCATION_BBOX,\n    T1_FIELD_LOCATION_LOADER,\n    T1_FIELD_LOCATION_FACE,\n    T1_FIELD_LOCATION_BLEND,\n\n    /* do not remove */\n    T1_FIELD_LOCATION_MAX\n\n  } T1_FieldLocation;\n\n\n  typedef void\n  (*T1_Field_ParseFunc)( FT_Face     face,\n                         FT_Pointer  parser );\n\n\n  /* structure type used to model object fields */\n  typedef struct  T1_FieldRec_\n  {\n    const char*         ident;        /* field identifier               */\n    T1_FieldLocation    location;\n    T1_FieldType        type;         /* type of field                  */\n    T1_Field_ParseFunc  reader;\n    FT_UInt             offset;       /* offset of field in object      */\n    FT_Byte             size;         /* size of field in bytes         */\n    FT_UInt             array_max;    /* maximum number of elements for */\n                                      /* array                          */\n    FT_UInt             count_offset; /* offset of element count for    */\n                                      /* arrays; must not be zero if in */\n                                      /* use -- in other words, a       */\n                                      /* `num_FOO' element must not     */\n                                      /* start the used structure if we */\n                                      /* parse a `FOO' array            */\n    FT_UInt             dict;         /* where we expect it             */\n  } T1_FieldRec;\n\n#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */\n#define T1_FIELD_DICT_PRIVATE  ( 1 << 1 )\n\n\n\n#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \\\n          {                                                 \\\n            _ident, T1CODE, _type,                          \\\n            0,                                              \\\n            FT_FIELD_OFFSET( _fname ),                      \\\n            FT_FIELD_SIZE( _fname ),                        \\\n            0, 0,                                           \\\n            _dict                                           \\\n          },\n\n#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \\\n          {                                             \\\n            _ident, T1CODE, T1_FIELD_TYPE_CALLBACK,     \\\n            (T1_Field_ParseFunc)_reader,                \\\n            0, 0,                                       \\\n            0, 0,                                       \\\n            _dict                                       \\\n          },\n\n#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \\\n          {                                                      \\\n            _ident, T1CODE, _type,                               \\\n            0,                                                   \\\n            FT_FIELD_OFFSET( _fname ),                           \\\n            FT_FIELD_SIZE_DELTA( _fname ),                       \\\n            _max,                                                \\\n            FT_FIELD_OFFSET( num_ ## _fname ),                   \\\n            _dict                                                \\\n          },\n\n#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \\\n          {                                                       \\\n            _ident, T1CODE, _type,                                \\\n            0,                                                    \\\n            FT_FIELD_OFFSET( _fname ),                            \\\n            FT_FIELD_SIZE_DELTA( _fname ),                        \\\n            _max, 0,                                              \\\n            _dict                                                 \\\n          },\n\n\n#define T1_FIELD_BOOL( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )\n\n#define T1_FIELD_NUM( _ident, _fname, _dict )                                 \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )\n\n#define T1_FIELD_FIXED( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )\n\n#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )                     \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \\\n                               _dict )\n\n#define T1_FIELD_STRING( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )\n\n#define T1_FIELD_KEY( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )\n\n#define T1_FIELD_BBOX( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )\n\n\n#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_CALLBACK( _ident, _name, _dict )       \\\n          T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 PARSER                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct PS_Parser_FuncsRec_*  PS_Parser_Funcs;\n\n  typedef struct  PS_Parser_FuncsRec_\n  {\n    void\n    (*init)( PS_Parser  parser,\n             FT_Byte*   base,\n             FT_Byte*   limit,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Parser  parser );\n\n    void\n    (*skip_spaces)( PS_Parser  parser );\n    void\n    (*skip_PS_token)( PS_Parser  parser );\n\n    FT_Long\n    (*to_int)( PS_Parser  parser );\n    FT_Fixed\n    (*to_fixed)( PS_Parser  parser,\n                 FT_Int     power_ten );\n\n    FT_Error\n    (*to_bytes)( PS_Parser  parser,\n                 FT_Byte*   bytes,\n                 FT_Offset  max_bytes,\n                 FT_Long*   pnum_bytes,\n                 FT_Bool    delimiters );\n\n    FT_Int\n    (*to_coord_array)( PS_Parser  parser,\n                       FT_Int     max_coords,\n                       FT_Short*  coords );\n    FT_Int\n    (*to_fixed_array)( PS_Parser  parser,\n                       FT_Int     max_values,\n                       FT_Fixed*  values,\n                       FT_Int     power_ten );\n\n    void\n    (*to_token)( PS_Parser  parser,\n                 T1_Token   token );\n    void\n    (*to_token_array)( PS_Parser  parser,\n                       T1_Token   tokens,\n                       FT_UInt    max_tokens,\n                       FT_Int*    pnum_tokens );\n\n    FT_Error\n    (*load_field)( PS_Parser       parser,\n                   const T1_Field  field,\n                   void**          objects,\n                   FT_UInt         max_objects,\n                   FT_ULong*       pflags );\n\n    FT_Error\n    (*load_field_table)( PS_Parser       parser,\n                         const T1_Field  field,\n                         void**          objects,\n                         FT_UInt         max_objects,\n                         FT_ULong*       pflags );\n\n  } PS_Parser_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_ParserRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Parser is an object used to parse a Type 1 font very quickly. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    cursor :: The current position in the text.                        */\n  /*                                                                       */\n  /*    base   :: Start of the processed text.                             */\n  /*                                                                       */\n  /*    limit  :: End of the processed text.                               */\n  /*                                                                       */\n  /*    error  :: The last error returned.                                 */\n  /*                                                                       */\n  /*    memory :: The object used for memory operations (alloc/realloc).   */\n  /*                                                                       */\n  /*    funcs  :: A table of functions for the parser.                     */\n  /*                                                                       */\n  typedef struct  PS_ParserRec_\n  {\n    FT_Byte*   cursor;\n    FT_Byte*   base;\n    FT_Byte*   limit;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    PS_Parser_FuncsRec  funcs;\n\n  } PS_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 BUILDER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_BuilderRec_*  T1_Builder;\n\n\n  typedef FT_Error\n  (*T1_Builder_Check_Points_Func)( T1_Builder  builder,\n                                   FT_Int      count );\n\n  typedef void\n  (*T1_Builder_Add_Point_Func)( T1_Builder  builder,\n                                FT_Pos      x,\n                                FT_Pos      y,\n                                FT_Byte     flag );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Point1_Func)( T1_Builder  builder,\n                                 FT_Pos      x,\n                                 FT_Pos      y );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Contour_Func)( T1_Builder  builder );\n\n  typedef FT_Error\n  (*T1_Builder_Start_Point_Func)( T1_Builder  builder,\n                                  FT_Pos      x,\n                                  FT_Pos      y );\n\n  typedef void\n  (*T1_Builder_Close_Contour_Func)( T1_Builder  builder );\n\n\n  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;\n\n  typedef struct  T1_Builder_FuncsRec_\n  {\n    void\n    (*init)( T1_Builder    builder,\n             FT_Face       face,\n             FT_Size       size,\n             FT_GlyphSlot  slot,\n             FT_Bool       hinting );\n\n    void\n    (*done)( T1_Builder   builder );\n\n    T1_Builder_Check_Points_Func   check_points;\n    T1_Builder_Add_Point_Func      add_point;\n    T1_Builder_Add_Point1_Func     add_point1;\n    T1_Builder_Add_Contour_Func    add_contour;\n    T1_Builder_Start_Point_Func    start_point;\n    T1_Builder_Close_Contour_Func  close_contour;\n\n  } T1_Builder_FuncsRec;\n\n\n  /* an enumeration type to handle charstring parsing states */\n  typedef enum  T1_ParseState_\n  {\n    T1_Parse_Start,\n    T1_Parse_Have_Width,\n    T1_Parse_Have_Moveto,\n    T1_Parse_Have_Path\n\n  } T1_ParseState;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Structure>                                                           */\n  /*    T1_BuilderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     A structure used during glyph loading to store its outline.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory       :: The current memory object.                         */\n  /*                                                                       */\n  /*    face         :: The current face object.                           */\n  /*                                                                       */\n  /*    glyph        :: The current glyph slot.                            */\n  /*                                                                       */\n  /*    loader       :: XXX                                                */\n  /*                                                                       */\n  /*    base         :: The base glyph outline.                            */\n  /*                                                                       */\n  /*    current      :: The current glyph outline.                         */\n  /*                                                                       */\n  /*    max_points   :: maximum points in builder outline                  */\n  /*                                                                       */\n  /*    max_contours :: Maximum number of contours in builder outline.     */\n  /*                                                                       */\n  /*    pos_x        :: The horizontal translation (if composite glyph).   */\n  /*                                                                       */\n  /*    pos_y        :: The vertical translation (if composite glyph).     */\n  /*                                                                       */\n  /*    left_bearing :: The left side bearing point.                       */\n  /*                                                                       */\n  /*    advance      :: The horizontal advance vector.                     */\n  /*                                                                       */\n  /*    bbox         :: Unused.                                            */\n  /*                                                                       */\n  /*    parse_state  :: An enumeration which controls the charstring       */\n  /*                    parsing state.                                     */\n  /*                                                                       */\n  /*    load_points  :: If this flag is not set, no points are loaded.     */\n  /*                                                                       */\n  /*    no_recurse   :: Set but not used.                                  */\n  /*                                                                       */\n  /*    metrics_only :: A boolean indicating that we only want to compute  */\n  /*                    the metrics of a given glyph, not load all of its  */\n  /*                    points.                                            */\n  /*                                                                       */\n  /*    funcs        :: An array of function pointers for the builder.     */\n  /*                                                                       */\n  typedef struct  T1_BuilderRec_\n  {\n    FT_Memory       memory;\n    FT_Face         face;\n    FT_GlyphSlot    glyph;\n    FT_GlyphLoader  loader;\n    FT_Outline*     base;\n    FT_Outline*     current;\n\n    FT_Pos          pos_x;\n    FT_Pos          pos_y;\n\n    FT_Vector       left_bearing;\n    FT_Vector       advance;\n\n    FT_BBox         bbox;          /* bounding box */\n    T1_ParseState   parse_state;\n    FT_Bool         load_points;\n    FT_Bool         no_recurse;\n\n    FT_Bool         metrics_only;\n\n    void*           hints_funcs;    /* hinter-specific */\n    void*           hints_globals;  /* hinter-specific */\n\n    T1_Builder_FuncsRec  funcs;\n\n  } T1_BuilderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 DECODER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  8\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  32\n\n#endif /* 0 */\n\n\n  typedef struct  T1_Decoder_ZoneRec_\n  {\n    FT_Byte*  cursor;\n    FT_Byte*  base;\n    FT_Byte*  limit;\n\n  } T1_Decoder_ZoneRec, *T1_Decoder_Zone;\n\n\n  typedef struct T1_DecoderRec_*              T1_Decoder;\n  typedef const struct T1_Decoder_FuncsRec_*  T1_Decoder_Funcs;\n\n\n  typedef FT_Error\n  (*T1_Decoder_Callback)( T1_Decoder  decoder,\n                          FT_UInt     glyph_index );\n\n\n  typedef struct  T1_Decoder_FuncsRec_\n  {\n    FT_Error\n    (*init)( T1_Decoder           decoder,\n             FT_Face              face,\n             FT_Size              size,\n             FT_GlyphSlot         slot,\n             FT_Byte**            glyph_names,\n             PS_Blend             blend,\n             FT_Bool              hinting,\n             FT_Render_Mode       hint_mode,\n             T1_Decoder_Callback  callback );\n\n    void\n    (*done)( T1_Decoder  decoder );\n\n    FT_Error\n    (*parse_charstrings)( T1_Decoder  decoder,\n                          FT_Byte*    base,\n                          FT_UInt     len );\n\n  } T1_Decoder_FuncsRec;\n\n\n  typedef struct  T1_DecoderRec_\n  {\n    T1_BuilderRec        builder;\n\n    FT_Long              stack[T1_MAX_CHARSTRINGS_OPERANDS];\n    FT_Long*             top;\n\n    T1_Decoder_ZoneRec   zones[T1_MAX_SUBRS_CALLS + 1];\n    T1_Decoder_Zone      zone;\n\n    FT_Service_PsCMaps   psnames;      /* for seac */\n    FT_UInt              num_glyphs;\n    FT_Byte**            glyph_names;\n\n    FT_Int               lenIV;        /* internal for sub routine calls */\n    FT_UInt              num_subrs;\n    FT_Byte**            subrs;\n    FT_PtrDist*          subrs_len;    /* array of subrs length (optional) */\n\n    FT_Matrix            font_matrix;\n    FT_Vector            font_offset;\n\n    FT_Int               flex_state;\n    FT_Int               num_flex_vectors;\n    FT_Vector            flex_vectors[7];\n\n    PS_Blend             blend;       /* for multiple master support */\n\n    FT_Render_Mode       hint_mode;\n\n    T1_Decoder_Callback  parse_callback;\n    T1_Decoder_FuncsRec  funcs;\n\n    FT_Long*             buildchar;\n    FT_UInt              len_buildchar;\n\n    FT_Bool              seac;\n\n  } T1_DecoderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            AFM PARSER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct AFM_ParserRec_*  AFM_Parser;\n\n  typedef struct  AFM_Parser_FuncsRec_\n  {\n    FT_Error\n    (*init)( AFM_Parser  parser,\n             FT_Memory   memory,\n             FT_Byte*    base,\n             FT_Byte*    limit );\n\n    void\n    (*done)( AFM_Parser  parser );\n\n    FT_Error\n    (*parse)( AFM_Parser  parser );\n\n  } AFM_Parser_FuncsRec;\n\n\n  typedef struct AFM_StreamRec_*  AFM_Stream;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    AFM_ParserRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An AFM_Parser is a parser for the AFM files.                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory    :: The object used for memory operations (alloc and      */\n  /*                 realloc).                                             */\n  /*                                                                       */\n  /*    stream    :: This is an opaque object.                             */\n  /*                                                                       */\n  /*    FontInfo  :: The result will be stored here.                       */\n  /*                                                                       */\n  /*    get_index :: A user provided function to get a glyph index by its  */\n  /*                 name.                                                 */\n  /*                                                                       */\n  typedef struct  AFM_ParserRec_\n  {\n    FT_Memory     memory;\n    AFM_Stream    stream;\n\n    AFM_FontInfo  FontInfo;\n\n    FT_Int\n    (*get_index)( const char*  name,\n                  FT_Offset    len,\n                  void*        user_data );\n\n    void*         user_data;\n\n  } AFM_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     TYPE1 CHARMAPS                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct T1_CMap_ClassesRec_*  T1_CMap_Classes;\n\n  typedef struct T1_CMap_ClassesRec_\n  {\n    FT_CMap_Class  standard;\n    FT_CMap_Class  expert;\n    FT_CMap_Class  custom;\n    FT_CMap_Class  unicode;\n\n  } T1_CMap_ClassesRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        PSAux Module Interface                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  PSAux_ServiceRec_\n  {\n    /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */\n    const PS_Table_FuncsRec*    ps_table_funcs;\n    const PS_Parser_FuncsRec*   ps_parser_funcs;\n    const T1_Builder_FuncsRec*  t1_builder_funcs;\n    const T1_Decoder_FuncsRec*  t1_decoder_funcs;\n\n    void\n    (*t1_decrypt)( FT_Byte*   buffer,\n                   FT_Offset  length,\n                   FT_UShort  seed );\n\n    T1_CMap_Classes  t1_cmap_classes;\n\n    /* fields after this comment line were added after version 2.1.10 */\n    const AFM_Parser_FuncsRec*  afm_parser_funcs;\n\n  } PSAux_ServiceRec, *PSAux_Service;\n\n  /* backwards-compatible type definition */\n  typedef PSAux_ServiceRec   PSAux_Interface;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 Some convenience functions                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define IS_PS_NEWLINE( ch ) \\\n  ( (ch) == '\\r' ||         \\\n    (ch) == '\\n' )\n\n#define IS_PS_SPACE( ch )  \\\n  ( (ch) == ' '         || \\\n    IS_PS_NEWLINE( ch ) || \\\n    (ch) == '\\t'        || \\\n    (ch) == '\\f'        || \\\n    (ch) == '\\0' )\n\n#define IS_PS_SPECIAL( ch )       \\\n  ( (ch) == '/'                || \\\n    (ch) == '(' || (ch) == ')' || \\\n    (ch) == '<' || (ch) == '>' || \\\n    (ch) == '[' || (ch) == ']' || \\\n    (ch) == '{' || (ch) == '}' || \\\n    (ch) == '%'                )\n\n#define IS_PS_DELIM( ch )  \\\n  ( IS_PS_SPACE( ch )   || \\\n    IS_PS_SPECIAL( ch ) )\n\n#define IS_PS_DIGIT( ch )        \\\n  ( (ch) >= '0' && (ch) <= '9' )\n\n#define IS_PS_XDIGIT( ch )            \\\n  ( IS_PS_DIGIT( ch )              || \\\n    ( (ch) >= 'A' && (ch) <= 'F' ) || \\\n    ( (ch) >= 'a' && (ch) <= 'f' ) )\n\n#define IS_PS_BASE85( ch )       \\\n  ( (ch) >= '!' && (ch) <= 'u' )\n\n#define IS_PS_TOKEN( cur, limit, token )                                \\\n  ( (char)(cur)[0] == (token)[0]                                     && \\\n    ( (cur) + sizeof ( (token) ) == (limit) ||                          \\\n      ( (cur) + sizeof( (token) ) < (limit)          &&                 \\\n        IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) )             && \\\n    ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )\n\n\nFT_END_HEADER\n\n#endif /* __PSAUX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/pshints.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshints.h                                                              */\n/*                                                                         */\n/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */\n/*    recorders (specification only).  These are used to support native    */\n/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */\n/*                                                                         */\n/*  Copyright 2001-2003, 2005-2007, 2009, 2012 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHINTS_H__\n#define __PSHINTS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PSH_GlobalsRec_*  PSH_Globals;\n\n  typedef FT_Error\n  (*PSH_Globals_NewFunc)( FT_Memory     memory,\n                          T1_Private*   private_dict,\n                          PSH_Globals*  aglobals );\n\n  typedef FT_Error\n  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,\n                               FT_Fixed     x_scale,\n                               FT_Fixed     y_scale,\n                               FT_Fixed     x_delta,\n                               FT_Fixed     y_delta );\n\n  typedef void\n  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );\n\n\n  typedef struct  PSH_Globals_FuncsRec_\n  {\n    PSH_Globals_NewFunc       create;\n    PSH_Globals_SetScaleFunc  set_scale;\n    PSH_Globals_DestroyFunc   destroy;\n\n  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 1 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stem', `stem3', or `reset').  Note that these functions do\n   *     not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   PostScript hinter.\n   *\n   */\n  typedef struct T1_HintsRec_*  T1_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of\n   *   a given @T1_Hints object.\n   *\n   */\n  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to prepare it for a new Type 1\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T1_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T1_Hints_OpenFunc)( T1_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStemFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record a new horizontal or\n   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'\n   *   operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   coords ::\n   *     Array of 2 coordinates in 16.16 format, used as (position,length)\n   *     stem descriptor.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   `coords[0]' is the absolute stem position (lowest coordinate);\n   *   `coords[1]' is the length.\n   *\n   *   The length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   *   If the length is -21 (corresponding to a bottom ghost stem), then\n   *   the real stem position is `coords[0]+coords[1]'.\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStemFunc)( T1_Hints   hints,\n                           FT_UInt    dimension,\n                           FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStem3Func\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record three\n   *   counter-controlled horizontal or vertical stems at once.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems, 1 for vertical ones.\n   *\n   *   coords ::\n   *     An array of 6 values in 16.16 format, holding 3 (position,length)\n   *     pairs for the counter-controlled stems.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   The lengths cannot be negative (ghost stems are never\n   *   counter-controlled).\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStem3Func)( T1_Hints   hints,\n                            FT_UInt    dimension,\n                            FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ResetFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to reset the stems hints in a\n   *   recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph in which the\n   *     previously defined hints apply.\n   *\n   */\n  typedef void\n  (*T1_Hints_ResetFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_CloseFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called once all hints have been\n   *   recorded.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font as the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_ApplyFunc)( T1_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T1_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T1_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T1 Hints recorder.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stem ::\n   *     The function to set a simple stem.\n   *\n   *   stem3 ::\n   *     The function to set counter-controlled stems.\n   *\n   *   reset ::\n   *     The function to reset stem hints.\n   *\n   *   apply ::\n   *     The function to apply the hints to the corresponding glyph outline.\n   *\n   */\n  typedef struct  T1_Hints_FuncsRec_\n  {\n    T1_Hints               hints;\n    T1_Hints_OpenFunc      open;\n    T1_Hints_CloseFunc     close;\n    T1_Hints_SetStemFunc   stem;\n    T1_Hints_SetStem3Func  stem3;\n    T1_Hints_ResetFunc     reset;\n    T1_Hints_ApplyFunc     apply;\n\n  } T1_Hints_FuncsRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 2 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stems', `hintmask', `counters').  Note that these\n   *     functions do not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   Postscript hinter.\n   *\n   */\n  typedef struct T2_HintsRec_*  T2_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of\n   *   a given @T2_Hints object.\n   *\n   */\n  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to prepare it for a new Type 2\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T2_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T2_Hints_OpenFunc)( T2_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_StemsFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set the table of stems in\n   *   either the vertical or horizontal dimension.  Equivalent to the\n   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   count ::\n   *     The number of stems.\n   *\n   *   coords ::\n   *     An array of `count' (position,length) pairs in 16.16 format.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   There are `2*count' elements in the `coords' array.  Each even\n   *   element is an absolute position in font units, each odd element is a\n   *   length in font units.\n   *\n   *   A length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   */\n  typedef void\n  (*T2_Hints_StemsFunc)( T2_Hints   hints,\n                         FT_UInt    dimension,\n                         FT_UInt    count,\n                         FT_Fixed*  coordinates );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_MaskFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given hintmask (this\n   *   corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The glyph index of the last point to which the previously defined\n   *     or activated hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *   The `bytes' array can come directly from the Type 2 charstring and\n   *   respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_MaskFunc)( T2_Hints        hints,\n                        FT_UInt         end_point,\n                        FT_UInt         bit_count,\n                        const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CounterFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given counter mask\n   *   (this corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     A glyph index of the last point to which the previously defined or\n   *     active hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *    The `bytes' array can come directly from the Type 2 charstring and\n   *    respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_CounterFunc)( T2_Hints        hints,\n                           FT_UInt         bit_count,\n                           const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_CloseFunc)( T2_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called after the `close'\n   *   method.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font than the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_ApplyFunc)( T2_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T2_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T2_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T2 hints recorder object.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stems ::\n   *     The function to set the dimension's stems table.\n   *\n   *   hintmask ::\n   *     The function to set hint masks.\n   *\n   *   counter ::\n   *     The function to set counter masks.\n   *\n   *   apply ::\n   *     The function to apply the hints on the corresponding glyph outline.\n   *\n   */\n  typedef struct  T2_Hints_FuncsRec_\n  {\n    T2_Hints              hints;\n    T2_Hints_OpenFunc     open;\n    T2_Hints_CloseFunc    close;\n    T2_Hints_StemsFunc    stems;\n    T2_Hints_MaskFunc     hintmask;\n    T2_Hints_CounterFunc  counter;\n    T2_Hints_ApplyFunc    apply;\n\n  } T2_Hints_FuncsRec;\n\n\n  /* */\n\n\n  typedef struct  PSHinter_Interface_\n  {\n    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );\n    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );\n    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );\n\n  } PSHinter_Interface;\n\n  typedef PSHinter_Interface*  PSHinter_Service;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_PSHINTER_INTERFACE(        \\\n          class_,                            \\\n          get_globals_funcs_,                \\\n          get_t1_funcs_,                     \\\n          get_t2_funcs_ )                    \\\n  static const PSHinter_Interface  class_ =  \\\n  {                                          \\\n    get_globals_funcs_,                      \\\n    get_t1_funcs_,                           \\\n    get_t2_funcs_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_PSHINTER_INTERFACE(                      \\\n          class_,                                          \\\n          get_globals_funcs_,                              \\\n          get_t1_funcs_,                                   \\\n          get_t2_funcs_ )                                  \\\n  void                                                     \\\n  FT_Init_Class_ ## class_( FT_Library           library,  \\\n                            PSHinter_Interface*  clazz )   \\\n  {                                                        \\\n    FT_UNUSED( library );                                  \\\n                                                           \\\n    clazz->get_globals_funcs = get_globals_funcs_;         \\\n    clazz->get_t1_funcs      = get_t1_funcs_;              \\\n    clazz->get_t2_funcs      = get_t2_funcs_;              \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __PSHINTS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svbdf.h                                                                */\n/*                                                                         */\n/*    The FreeType BDF services (specification).                           */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVBDF_H__\n#define __SVBDF_H__\n\n#include FT_BDF_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_BDF  \"bdf\"\n\n  typedef FT_Error\n  (*FT_BDF_GetCharsetIdFunc)( FT_Face       face,\n                              const char*  *acharset_encoding,\n                              const char*  *acharset_registry );\n\n  typedef FT_Error\n  (*FT_BDF_GetPropertyFunc)( FT_Face           face,\n                             const char*       prop_name,\n                             BDF_PropertyRec  *aproperty );\n\n\n  FT_DEFINE_SERVICE( BDF )\n  {\n    FT_BDF_GetCharsetIdFunc  get_charset_id;\n    FT_BDF_GetPropertyFunc   get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  static const FT_Service_BDFRec  class_ =                               \\\n  {                                                                      \\\n    get_charset_id_, get_property_                                       \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  void                                                                   \\\n  FT_Init_Class_ ## class_( FT_Service_BDFRec*  clazz )                  \\\n  {                                                                      \\\n    clazz->get_charset_id = get_charset_id_;                             \\\n    clazz->get_property   = get_property_;                               \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svcid.h                                                                */\n/*                                                                         */\n/*    The FreeType CID font services (specification).                      */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal.            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVCID_H__\n#define __SVCID_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_CID  \"CID\"\n\n  typedef FT_Error\n  (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face       face,\n                                               const char*  *registry,\n                                               const char*  *ordering,\n                                               FT_Int       *supplement );\n  typedef FT_Error\n  (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face   face,\n                                         FT_Bool  *is_cid );\n  typedef FT_Error\n  (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face   face,\n                                      FT_UInt   glyph_index,\n                                      FT_UInt  *cid );\n\n  FT_DEFINE_SERVICE( CID )\n  {\n    FT_CID_GetRegistryOrderingSupplementFunc  get_ros;\n    FT_CID_GetIsInternallyCIDKeyedFunc        get_is_cid;\n    FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  static const FT_Service_CIDRec class_ =                                   \\\n  {                                                                         \\\n    get_ros_, get_is_cid_, get_cid_from_glyph_index_                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library          library,                    \\\n                            FT_Service_CIDRec*  clazz )                     \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->get_ros                  = get_ros_;                             \\\n    clazz->get_is_cid               = get_is_cid_;                          \\\n    clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svgldict.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgldict.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph dictionary services (specification).              */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGLDICT_H__\n#define __SVGLDICT_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to retrieve glyph names, as well as to find the\n   *  index of a given glyph name in a font.\n   *\n   */\n\n#define FT_SERVICE_ID_GLYPH_DICT  \"glyph-dict\"\n\n\n  typedef FT_Error\n  (*FT_GlyphDict_GetNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_GlyphDict_NameIndexFunc)( FT_Face     face,\n                                 FT_String*  glyph_name );\n\n\n  FT_DEFINE_SERVICE( GlyphDict )\n  {\n    FT_GlyphDict_GetNameFunc    get_name;\n    FT_GlyphDict_NameIndexFunc  name_index;  /* optional */\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  static const FT_Service_GlyphDictRec  class_ =                       \\\n  {                                                                    \\\n    get_name_, name_index_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  void                                                                 \\\n  FT_Init_Class_ ## class_( FT_Library                library,         \\\n                            FT_Service_GlyphDictRec*  clazz )          \\\n  {                                                                    \\\n    FT_UNUSED( library );                                              \\\n                                                                       \\\n    clazz->get_name   = get_name_;                                     \\\n    clazz->name_index = name_index_;                                   \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGLDICT_H__ */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005 by                                                */\n/*  Masatake YAMATO, Red Hat K.K.,                                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGXVAL_H__\n#define __SVGXVAL_H__\n\n#include FT_GX_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_GX_VALIDATE           \"truetypegx-validate\"\n#define FT_SERVICE_ID_CLASSICKERN_VALIDATE  \"classickern-validate\"\n\n  typedef FT_Error\n  (*gxv_validate_func)( FT_Face   face,\n                        FT_UInt   gx_flags,\n                        FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                        FT_UInt   table_length );\n\n\n  typedef FT_Error\n  (*ckern_validate_func)( FT_Face   face,\n                          FT_UInt   ckern_flags,\n                          FT_Bytes  *ckern_table );\n\n\n  FT_DEFINE_SERVICE( GXvalidate )\n  {\n    gxv_validate_func  validate;\n  };\n\n  FT_DEFINE_SERVICE( CKERNvalidate )\n  {\n    ckern_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svkern.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svkern.h                                                               */\n/*                                                                         */\n/*    The FreeType Kerning service (specification).                        */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVKERN_H__\n#define __SVKERN_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n#define FT_SERVICE_ID_KERNING  \"kerning\"\n\n\n  typedef FT_Error\n  (*FT_Kerning_TrackGetFunc)( FT_Face    face,\n                              FT_Fixed   point_size,\n                              FT_Int     degree,\n                              FT_Fixed*  akerning );\n\n  FT_DEFINE_SERVICE( Kerning )\n  {\n    FT_Kerning_TrackGetFunc  get_track;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVKERN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svmm.h                                                                 */\n/*                                                                         */\n/*    The FreeType Multiple Masters and GX var services (specification).   */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVMM_H__\n#define __SVMM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to manage multiple-masters data in a given face.\n   *\n   *  See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).\n   *\n   */\n\n#define FT_SERVICE_ID_MULTI_MASTERS  \"multi-masters\"\n\n\n  typedef FT_Error\n  (*FT_Get_MM_Func)( FT_Face           face,\n                     FT_Multi_Master*  master );\n\n  typedef FT_Error\n  (*FT_Get_MM_Var_Func)( FT_Face      face,\n                         FT_MM_Var*  *master );\n\n  typedef FT_Error\n  (*FT_Set_MM_Design_Func)( FT_Face   face,\n                            FT_UInt   num_coords,\n                            FT_Long*  coords );\n\n  typedef FT_Error\n  (*FT_Set_Var_Design_Func)( FT_Face    face,\n                             FT_UInt    num_coords,\n                             FT_Fixed*  coords );\n\n  typedef FT_Error\n  (*FT_Set_MM_Blend_Func)( FT_Face   face,\n                           FT_UInt   num_coords,\n                           FT_Long*  coords );\n\n\n  FT_DEFINE_SERVICE( MultiMasters )\n  {\n    FT_Get_MM_Func          get_mm;\n    FT_Set_MM_Design_Func   set_mm_design;\n    FT_Set_MM_Blend_Func    set_mm_blend;\n    FT_Get_MM_Var_Func      get_mm_var;\n    FT_Set_Var_Design_Func  set_var_design;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  static const FT_Service_MultiMastersRec  class_ =                         \\\n  {                                                                         \\\n    get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_    \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Service_MultiMastersRec*  clazz )            \\\n  {                                                                         \\\n    clazz->get_mm         = get_mm_;                                        \\\n    clazz->set_mm_design  = set_mm_design_;                                 \\\n    clazz->set_mm_blend   = set_mm_blend_;                                  \\\n    clazz->get_mm_var     = get_mm_var_;                                    \\\n    clazz->set_var_design = set_var_design_;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svotval.h                                                              */\n/*                                                                         */\n/*    The FreeType OpenType validation service (specification).            */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVOTVAL_H__\n#define __SVOTVAL_H__\n\n#include FT_OPENTYPE_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_OPENTYPE_VALIDATE  \"opentype-validate\"\n\n\n  typedef FT_Error\n  (*otv_validate_func)( FT_Face volatile  face,\n                        FT_UInt           ot_flags,\n                        FT_Bytes         *base,\n                        FT_Bytes         *gdef,\n                        FT_Bytes         *gpos,\n                        FT_Bytes         *gsub,\n                        FT_Bytes         *jstf );\n\n\n  FT_DEFINE_SERVICE( OTvalidate )\n  {\n    otv_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpfr.h                                                                */\n/*                                                                         */\n/*    Internal PFR service functions (specification).                      */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPFR_H__\n#define __SVPFR_H__\n\n#include FT_PFR_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PFR_METRICS  \"pfr-metrics\"\n\n\n  typedef FT_Error\n  (*FT_PFR_GetMetricsFunc)( FT_Face    face,\n                            FT_UInt   *aoutline,\n                            FT_UInt   *ametrics,\n                            FT_Fixed  *ax_scale,\n                            FT_Fixed  *ay_scale );\n\n  typedef FT_Error\n  (*FT_PFR_GetKerningFunc)( FT_Face     face,\n                            FT_UInt     left,\n                            FT_UInt     right,\n                            FT_Vector  *avector );\n\n  typedef FT_Error\n  (*FT_PFR_GetAdvanceFunc)( FT_Face   face,\n                            FT_UInt   gindex,\n                            FT_Pos   *aadvance );\n\n\n  FT_DEFINE_SERVICE( PfrMetrics )\n  {\n    FT_PFR_GetMetricsFunc  get_metrics;\n    FT_PFR_GetKerningFunc  get_kerning;\n    FT_PFR_GetAdvanceFunc  get_advance;\n\n  };\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __SVPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svpostnm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpostnm.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript name services (specification).               */\n/*                                                                         */\n/*  Copyright 2003, 2007, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPOSTNM_H__\n#define __SVPOSTNM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n  /*\n   *  A trivial service used to retrieve the PostScript name of a given\n   *  font when available.  The `get_name' field should never be NULL.\n   *\n   *  The corresponding function can return NULL to indicate that the\n   *  PostScript name is not available.\n   *\n   *  The name is owned by the face and will be destroyed with it.\n   */\n\n#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME  \"postscript-font-name\"\n\n\n  typedef const char*\n  (*FT_PsName_GetFunc)( FT_Face  face );\n\n\n  FT_DEFINE_SERVICE( PsFontName )\n  {\n    FT_PsName_GetFunc  get_ps_font_name;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  static const FT_Service_PsFontNameRec  class_ =                    \\\n  {                                                                  \\\n    get_ps_font_name_                                                \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  void                                                               \\\n  FT_Init_Class_ ## class_( FT_Library                 library,      \\\n                            FT_Service_PsFontNameRec*  clazz )       \\\n  {                                                                  \\\n    FT_UNUSED( library );                                            \\\n                                                                     \\\n    clazz->get_ps_font_name = get_ps_font_name_;                     \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPOSTNM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svprop.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svprop.h                                                               */\n/*                                                                         */\n/*    The FreeType property service (specification).                       */\n/*                                                                         */\n/*  Copyright 2012 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPROP_H__\n#define __SVPROP_H__\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PROPERTIES  \"properties\"\n\n\n  typedef FT_Error\n  (*FT_Properties_SetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            const void*  value );\n\n  typedef FT_Error\n  (*FT_Properties_GetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            void*        value );\n\n\n  FT_DEFINE_SERVICE( Properties )\n  {\n    FT_Properties_SetFunc  set_property;\n    FT_Properties_GetFunc  get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,          \\\n                                         set_property_,   \\\n                                         get_property_ )  \\\n  static const FT_Service_PropertiesRec  class_ =         \\\n  {                                                       \\\n    set_property_,                                        \\\n    get_property_                                         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,                \\\n                                         set_property_,         \\\n                                         get_property_ )        \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Service_PropertiesRec*  clazz )  \\\n  {                                                             \\\n    clazz->set_property = set_property_;                        \\\n    clazz->get_property = get_property_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPROP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svpscmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpscmap.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript charmap service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2006, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSCMAP_H__\n#define __SVPSCMAP_H__\n\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_CMAPS  \"postscript-cmaps\"\n\n\n  /*\n   *  Adobe glyph name to unicode value.\n   */\n  typedef FT_UInt32\n  (*PS_Unicode_ValueFunc)( const char*  glyph_name );\n\n  /*\n   *  Macintosh name id to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Macintosh_NameFunc)( FT_UInt  name_index );\n\n  /*\n   *  Adobe standard string ID to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );\n\n\n  /*\n   *  Simple unicode -> glyph index charmap built from font glyph names\n   *  table.\n   */\n  typedef struct  PS_UniMap_\n  {\n    FT_UInt32  unicode;      /* bit 31 set: is glyph variant */\n    FT_UInt    glyph_index;\n\n  } PS_UniMap;\n\n\n  typedef struct PS_UnicodesRec_*  PS_Unicodes;\n\n  typedef struct  PS_UnicodesRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt     num_maps;\n    PS_UniMap*  maps;\n\n  } PS_UnicodesRec;\n\n\n  /*\n   *  A function which returns a glyph name for a given index.  Returns\n   *  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_GetGlyphNameFunc)( FT_Pointer  data,\n                          FT_UInt     string_index );\n\n  /*\n   *  A function used to release the glyph name returned by\n   *  PS_GetGlyphNameFunc, when needed\n   */\n  typedef void\n  (*PS_FreeGlyphNameFunc)( FT_Pointer  data,\n                           const char*  name );\n\n  typedef FT_Error\n  (*PS_Unicodes_InitFunc)( FT_Memory             memory,\n                           PS_Unicodes           unicodes,\n                           FT_UInt               num_glyphs,\n                           PS_GetGlyphNameFunc   get_glyph_name,\n                           PS_FreeGlyphNameFunc  free_glyph_name,\n                           FT_Pointer            glyph_data );\n\n  typedef FT_UInt\n  (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,\n                                FT_UInt32    unicode );\n\n  typedef FT_UInt32\n  (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,\n                               FT_UInt32   *unicode );\n\n\n  FT_DEFINE_SERVICE( PsCMaps )\n  {\n    PS_Unicode_ValueFunc       unicode_value;\n\n    PS_Unicodes_InitFunc       unicodes_init;\n    PS_Unicodes_CharIndexFunc  unicodes_char_index;\n    PS_Unicodes_CharNextFunc   unicodes_char_next;\n\n    PS_Macintosh_NameFunc      macintosh_name;\n    PS_Adobe_Std_StringsFunc   adobe_std_strings;\n    const unsigned short*      adobe_std_encoding;\n    const unsigned short*      adobe_expert_encoding;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  static const FT_Service_PsCMapsRec  class_ =                              \\\n  {                                                                         \\\n    unicode_value_, unicodes_init_,                                         \\\n    unicodes_char_index_, unicodes_char_next_, macintosh_name_,             \\\n    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library              library,                \\\n                            FT_Service_PsCMapsRec*  clazz )                 \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->unicode_value         = unicode_value_;                          \\\n    clazz->unicodes_init         = unicodes_init_;                          \\\n    clazz->unicodes_char_index   = unicodes_char_index_;                    \\\n    clazz->unicodes_char_next    = unicodes_char_next_;                     \\\n    clazz->macintosh_name        = macintosh_name_;                         \\\n    clazz->adobe_std_strings     = adobe_std_strings_;                      \\\n    clazz->adobe_std_encoding    = adobe_std_encoding_;                     \\\n    clazz->adobe_expert_encoding = adobe_expert_encoding_;                  \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svpsinfo.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpsinfo.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript info service (specification).                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2011, 2012 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSINFO_H__\n#define __SVPSINFO_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_INFO  \"postscript-info\"\n\n\n  typedef FT_Error\n  (*PS_GetFontInfoFunc)( FT_Face          face,\n                         PS_FontInfoRec*  afont_info );\n\n  typedef FT_Error\n  (*PS_GetFontExtraFunc)( FT_Face           face,\n                          PS_FontExtraRec*  afont_extra );\n\n  typedef FT_Int\n  (*PS_HasGlyphNamesFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*PS_GetFontPrivateFunc)( FT_Face         face,\n                            PS_PrivateRec*  afont_private );\n\n  typedef FT_Long\n  (*PS_GetFontValueFunc)( FT_Face       face,\n                          PS_Dict_Keys  key,\n                          FT_UInt       idx,\n                          void         *value,\n                          FT_Long       value_len );\n\n\n  FT_DEFINE_SERVICE( PsInfo )\n  {\n    PS_GetFontInfoFunc     ps_get_font_info;\n    PS_GetFontExtraFunc    ps_get_font_extra;\n    PS_HasGlyphNamesFunc   ps_has_glyph_names;\n    PS_GetFontPrivateFunc  ps_get_font_private;\n    PS_GetFontValueFunc    ps_get_font_value;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  static const FT_Service_PsInfoRec  class_ =                    \\\n  {                                                              \\\n    get_font_info_, ps_get_font_extra_, has_glyph_names_,        \\\n    get_font_private_, get_font_value_                           \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  void                                                           \\\n  FT_Init_Class_ ## class_( FT_Library             library,      \\\n                            FT_Service_PsInfoRec*  clazz )       \\\n  {                                                              \\\n    FT_UNUSED( library );                                        \\\n                                                                 \\\n    clazz->ps_get_font_info    = get_font_info_;                 \\\n    clazz->ps_get_font_extra   = ps_get_font_extra_;             \\\n    clazz->ps_has_glyph_names  = has_glyph_names_;               \\\n    clazz->ps_get_font_private = get_font_private_;              \\\n    clazz->ps_get_font_value   = get_font_value_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSINFO_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svsfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svsfnt.h                                                               */\n/*                                                                         */\n/*    The FreeType SFNT table loading service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVSFNT_H__\n#define __SVSFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_SFNT_TABLE  \"sfnt-table\"\n\n\n  /*\n   * Used to implement FT_Load_Sfnt_Table().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableLoadFunc)( FT_Face    face,\n                            FT_ULong   tag,\n                            FT_Long    offset,\n                            FT_Byte*   buffer,\n                            FT_ULong*  length );\n\n  /*\n   * Used to implement FT_Get_Sfnt_Table().\n   */\n  typedef void*\n  (*FT_SFNT_TableGetFunc)( FT_Face      face,\n                           FT_Sfnt_Tag  tag );\n\n\n  /*\n   * Used to implement FT_Sfnt_Table_Info().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableInfoFunc)( FT_Face    face,\n                            FT_UInt    idx,\n                            FT_ULong  *tag,\n                            FT_ULong  *offset,\n                            FT_ULong  *length );\n\n\n  FT_DEFINE_SERVICE( SFNT_Table )\n  {\n    FT_SFNT_TableLoadFunc  load_table;\n    FT_SFNT_TableGetFunc   get_table;\n    FT_SFNT_TableInfoFunc  table_info;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ )  \\\n  static const FT_Service_SFNT_TableRec  class_ =                      \\\n  {                                                                    \\\n    load_, get_, info_                                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \\\n  void                                                                \\\n  FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec*  clazz )        \\\n  {                                                                   \\\n    clazz->load_table = load_;                                        \\\n    clazz->get_table  = get_;                                         \\\n    clazz->table_info = info_;                                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVSFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svttcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttcmap.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType/sfnt cmap extra information service.           */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  Masatake YAMATO, Redhat K.K.                                           */\n/*                                                                         */\n/*  Copyright 2003, 2008, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/* Development of this service is support of\n   Information-technology Promotion Agency, Japan. */\n\n#ifndef __SVTTCMAP_H__\n#define __SVTTCMAP_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_CMAP  \"tt-cmaps\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_CMapInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to store TrueType/sfnt specific cmap information  */\n  /*    which is not covered by the generic @FT_CharMap structure.  This   */\n  /*    structure can be accessed with the @FT_Get_TT_CMap_Info function.  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    language ::                                                        */\n  /*      The language ID used in Mac fonts.  Definitions of values are in */\n  /*      freetype/ttnameid.h.                                             */\n  /*                                                                       */\n  /*    format ::                                                          */\n  /*      The cmap format.  OpenType 1.5 defines the formats 0 (byte       */\n  /*      encoding table), 2~(high-byte mapping through table), 4~(segment */\n  /*      mapping to delta values), 6~(trimmed table mapping), 8~(mixed    */\n  /*      16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented   */\n  /*      coverage), and 14 (Unicode Variation Sequences).                 */\n  /*                                                                       */\n  typedef struct  TT_CMapInfo_\n  {\n    FT_ULong  language;\n    FT_Long   format;\n\n  } TT_CMapInfo;\n\n\n  typedef FT_Error\n  (*TT_CMap_Info_GetFunc)( FT_CharMap    charmap,\n                           TT_CMapInfo  *cmap_info );\n\n\n  FT_DEFINE_SERVICE( TTCMaps )\n  {\n    TT_CMap_Info_GetFunc  get_cmap_info;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  static const FT_Service_TTCMapsRec  class_ =                  \\\n  {                                                             \\\n    get_cmap_info_                                              \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Library              library,    \\\n                            FT_Service_TTCMapsRec*  clazz )     \\\n  {                                                             \\\n    FT_UNUSED( library );                                       \\\n                                                                \\\n    clazz->get_cmap_info = get_cmap_info_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svtteng.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svtteng.h                                                              */\n/*                                                                         */\n/*    The FreeType TrueType engine query service (specification).          */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVTTENG_H__\n#define __SVTTENG_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_TRUETYPE_ENGINE  \"truetype-engine\"\n\n  /*\n   * Used to implement FT_Get_TrueType_Engine_Type\n   */\n\n  FT_DEFINE_SERVICE( TrueTypeEngine )\n  {\n    FT_TrueTypeEngineType  engine_type;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVTTENG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svttglyf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttglyf.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType glyph service.                                 */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by David Turner.                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __SVTTGLYF_H__\n#define __SVTTGLYF_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_GLYF  \"tt-glyf\"\n\n\n  typedef FT_ULong\n  (*TT_Glyf_GetLocationFunc)( FT_Face    face,\n                              FT_UInt    gindex,\n                              FT_ULong  *psize );\n\n  FT_DEFINE_SERVICE( TTGlyf )\n  {\n    TT_Glyf_GetLocationFunc  get_location;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  static const FT_Service_TTGlyfRec  class_ =                 \\\n  {                                                           \\\n    get_location_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  void                                                        \\\n  FT_Init_Class_ ## class_( FT_Service_TTGlyfRec*  clazz )    \\\n  {                                                           \\\n    clazz->get_location = get_location_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTGLYF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svwinfnt.h                                                             */\n/*                                                                         */\n/*    The FreeType Windows FNT/FONT service (specification).               */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVWINFNT_H__\n#define __SVWINFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_WINFONTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_WINFNT  \"winfonts\"\n\n  typedef FT_Error\n  (*FT_WinFnt_GetHeaderFunc)( FT_Face               face,\n                              FT_WinFNT_HeaderRec  *aheader );\n\n\n  FT_DEFINE_SERVICE( WinFnt )\n  {\n    FT_WinFnt_GetHeaderFunc  get_header;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVWINFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/services/svxf86nm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svxf86nm.h                                                             */\n/*                                                                         */\n/*    The FreeType XFree86 services (specification only).                  */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVXF86NM_H__\n#define __SVXF86NM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A trivial service used to return the name of a face's font driver,\n   *  according to the XFree86 nomenclature.  Note that the service data\n   *  is a simple constant string pointer.\n   */\n\n#define FT_SERVICE_ID_XF86_NAME  \"xf86-driver-name\"\n\n#define FT_XF86_FORMAT_TRUETYPE  \"TrueType\"\n#define FT_XF86_FORMAT_TYPE_1    \"Type 1\"\n#define FT_XF86_FORMAT_BDF       \"BDF\"\n#define FT_XF86_FORMAT_PCF       \"PCF\"\n#define FT_XF86_FORMAT_TYPE_42   \"Type 42\"\n#define FT_XF86_FORMAT_CID       \"CID Type 1\"\n#define FT_XF86_FORMAT_CFF       \"CFF\"\n#define FT_XF86_FORMAT_PFR       \"PFR\"\n#define FT_XF86_FORMAT_WINFNT    \"Windows FNT\"\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVXF86NM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/sfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfnt.h                                                                 */\n/*                                                                         */\n/*    High-level `sfnt' driver interface (specification).                  */\n/*                                                                         */\n/*  Copyright 1996-2006, 2009, 2012-2013 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFNT_H__\n#define __SFNT_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Init_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    First part of the SFNT face object initialization.  This finds     */\n  /*    the face in a SFNT file or collection, and load its format tag in  */\n  /*    face->format_tag.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  /*    This function recognizes fonts embedded in a `TrueType             */\n  /*    collection'.                                                       */\n  /*                                                                       */\n  /*    Once the format tag has been validated by the font driver, it      */\n  /*    should then call the TT_Load_Face_Func() callback to read the rest */\n  /*    of the SFNT tables in the object.                                  */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Init_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Second part of the SFNT face object initialization.  This loads    */\n  /*    the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function must be called after TT_Init_Face_Func().            */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Done_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A callback used to delete the common SFNT data from a face.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT destroy the face object.                    */\n  /*                                                                       */\n  typedef void\n  (*TT_Done_Face_Func)( TT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Any_Func                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load any font table into client memory.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: The face object to look for.                             */\n  /*                                                                       */\n  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */\n  /*              to access the whole font file, else set this parameter   */\n  /*              to a valid TrueType table tag that you can forge with    */\n  /*              the MAKE_TT_TAG macro.                                   */\n  /*                                                                       */\n  /*    offset :: The starting offset in the table (or the file if         */\n  /*              tag == 0).                                               */\n  /*                                                                       */\n  /*    length :: The address of the decision variable:                    */\n  /*                                                                       */\n  /*                If length == NULL:                                     */\n  /*                  Loads the whole table.  Returns an error if          */\n  /*                  `offset' == 0!                                       */\n  /*                                                                       */\n  /*                If *length == 0:                                       */\n  /*                  Exits immediately; returning the length of the given */\n  /*                  table or of the font file, depending on the value of */\n  /*                  `tag'.                                               */\n  /*                                                                       */\n  /*                If *length != 0:                                       */\n  /*                  Loads the next `length' bytes of table or font,      */\n  /*                  starting at offset `offset' (in table or font too).  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer :: The address of target buffer.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    TrueType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Any_Func)( TT_Face    face,\n                       FT_ULong   tag,\n                       FT_Long    offset,\n                       FT_Byte   *buffer,\n                       FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Find_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether an embedded bitmap (an `sbit') exists for a given    */\n  /*    glyph, at a given strike.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    glyph_index   :: The glyph index.                                  */\n  /*                                                                       */\n  /*    strike_index  :: The current strike index.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    arange        :: The SBit range containing the glyph index.        */\n  /*                                                                       */\n  /*    astrike       :: The SBit strike containing the glyph index.       */\n  /*                                                                       */\n  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns                    */\n  /*    SFNT_Err_Invalid_Argument if no sbit exists for the requested      */\n  /*    glyph.                                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Find_SBit_Image_Func)( TT_Face          face,\n                              FT_UInt          glyph_index,\n                              FT_ULong         strike_index,\n                              TT_SBit_Range   *arange,\n                              TT_SBit_Strike  *astrike,\n                              FT_ULong        *aglyph_offset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Metrics_Func                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the big metrics for a given embedded bitmap.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream      :: The input stream.                                   */\n  /*                                                                       */\n  /*    range       :: The SBit range containing the glyph.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    big_metrics :: A big SBit metrics structure for the glyph.         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be positioned at the glyph's offset within  */\n  /*    the `EBDT' table before the call.                                  */\n  /*                                                                       */\n  /*    If the image format uses variable metrics, the stream cursor is    */\n  /*    positioned just after the metrics header in the `EBDT' table on    */\n  /*    function exit.                                                     */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Metrics_Func)( FT_Stream        stream,\n                                TT_SBit_Range    range,\n                                TT_SBit_Metrics  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given glyph sbit image from the font resource.  This also   */\n  /*    returns its metrics.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      The target face object.                                          */\n  /*                                                                       */\n  /*    strike_index ::                                                    */\n  /*      The strike index.                                                */\n  /*                                                                       */\n  /*    glyph_index ::                                                     */\n  /*      The current glyph index.                                         */\n  /*                                                                       */\n  /*    load_flags ::                                                      */\n  /*      The current load flags.                                          */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      The input stream.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amap ::                                                            */\n  /*      The target pixmap.                                               */\n  /*                                                                       */\n  /*    ametrics ::                                                        */\n  /*      A big sbit metrics structure for the glyph image.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    glyph sbit exists for the index.                                   */\n  /*                                                                       */\n  /*  <Note>                                                               */\n  /*    The `map.buffer' field is always freed before the glyph is loaded. */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Image_Func)( TT_Face              face,\n                              FT_ULong             strike_index,\n                              FT_UInt              glyph_index,\n                              FT_UInt              load_flags,\n                              FT_Stream            stream,\n                              FT_Bitmap           *amap,\n                              TT_SBit_MetricsRec  *ametrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Set_SBit_Strike_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select an sbit strike for a given size request.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    req           :: The size request.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    astrike_index :: The index of the sbit strike.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    sbit strike exists for the selected ppem values.                   */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Set_SBit_Strike_Func)( TT_Face          face,\n                              FT_Size_Request  req,\n                              FT_ULong*        astrike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Strike_Metrics_Func                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the metrics of a given strike.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    strike_index  :: The strike index.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    metrics       :: the metrics of the strike.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    such sbit strike exists.                                           */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Strike_Metrics_Func)( TT_Face           face,\n                                  FT_ULong          strike_index,\n                                  FT_Size_Metrics*  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_PS_Name_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the PostScript glyph name of a glyph.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    idx  :: The glyph index.                                           */\n  /*                                                                       */\n  /*    PSname :: The address of a string pointer.  Will be NULL in case   */\n  /*              of error, otherwise it is a pointer to the glyph name.   */\n  /*                                                                       */\n  /*              You must not modify the returned string!                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_PS_Name_Func)( TT_Face      face,\n                          FT_UInt      idx,\n                          FT_String**  PSname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Metrics_Func                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a metrics table, which is a table with a horizontal and a     */\n  /*    vertical version.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load the vertical one.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Metrics_Func)( TT_Face    face,\n                           FT_Stream  stream,\n                           FT_Bool    vertical );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_Metrics_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the horizontal or vertical header in a face object.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load vertical metrics.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_Metrics_Func)( TT_Face     face,\n                          FT_Bool     vertical,\n                          FT_UInt     gindex,\n                          FT_Short*   abearing,\n                          FT_UShort*  aadvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The function uses `face->goto_table' to seek the stream to the     */\n  /*    start of the table, except while loading the font directory.       */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Table_Func)( TT_Face    face,\n                         FT_Stream  stream );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Free_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Free a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  typedef void\n  (*TT_Free_Table_Func)( TT_Face  face );\n\n\n  /*\n   * @functype:\n   *    TT_Face_GetKerningFunc\n   *\n   * @description:\n   *    Return the horizontal kerning value between two glyphs.\n   *\n   * @input:\n   *    face        :: A handle to the source face object.\n   *    left_glyph  :: The left glyph index.\n   *    right_glyph :: The right glyph index.\n   *\n   * @return:\n   *    The kerning value in font units.\n   */\n  typedef FT_Int\n  (*TT_Face_GetKerningFunc)( TT_Face  face,\n                             FT_UInt  left_glyph,\n                             FT_UInt  right_glyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_Interface                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure holds pointers to the functions used to load and    */\n  /*    free the basic tables that are required in a `sfnt' font file.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Check the various xxx_Func() descriptions for details.             */\n  /*                                                                       */\n  typedef struct  SFNT_Interface_\n  {\n    TT_Loader_GotoTableFunc      goto_table;\n\n    TT_Init_Face_Func            init_face;\n    TT_Load_Face_Func            load_face;\n    TT_Done_Face_Func            done_face;\n    FT_Module_Requester          get_interface;\n\n    TT_Load_Any_Func             load_any;\n\n    /* these functions are called by `load_face' but they can also  */\n    /* be called from external modules, if there is a need to do so */\n    TT_Load_Table_Func           load_head;\n    TT_Load_Metrics_Func         load_hhea;\n    TT_Load_Table_Func           load_cmap;\n    TT_Load_Table_Func           load_maxp;\n    TT_Load_Table_Func           load_os2;\n    TT_Load_Table_Func           load_post;\n\n    TT_Load_Table_Func           load_name;\n    TT_Free_Table_Func           free_name;\n\n    /* this field was called `load_kerning' up to version 2.1.10 */\n    TT_Load_Table_Func           load_kern;\n\n    TT_Load_Table_Func           load_gasp;\n    TT_Load_Table_Func           load_pclt;\n\n    /* see `ttload.h'; this field was called `load_bitmap_header' up to */\n    /* version 2.1.10                                                   */\n    TT_Load_Table_Func           load_bhed;\n\n    TT_Load_SBit_Image_Func      load_sbit_image;\n\n    /* see `ttpost.h' */\n    TT_Get_PS_Name_Func          get_psname;\n    TT_Free_Table_Func           free_psnames;\n\n    /* starting here, the structure differs from version 2.1.7 */\n\n    /* this field was introduced in version 2.1.8, named `get_psname' */\n    TT_Face_GetKerningFunc       get_kerning;\n\n    /* new elements introduced after version 2.1.10 */\n\n    /* load the font directory, i.e., the offset table and */\n    /* the table directory                                 */\n    TT_Load_Table_Func           load_font_dir;\n    TT_Load_Metrics_Func         load_hmtx;\n\n    TT_Load_Table_Func           load_eblc;\n    TT_Free_Table_Func           free_eblc;\n\n    TT_Set_SBit_Strike_Func      set_sbit_strike;\n    TT_Load_Strike_Metrics_Func  load_strike_metrics;\n\n    TT_Get_Metrics_Func          get_metrics;\n\n  } SFNT_Interface;\n\n\n  /* transitional */\n  typedef SFNT_Interface*   SFNT_Service;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SFNT_INTERFACE(        \\\n          class_,                        \\\n          goto_table_,                   \\\n          init_face_,                    \\\n          load_face_,                    \\\n          done_face_,                    \\\n          get_interface_,                \\\n          load_any_,                     \\\n          load_head_,                    \\\n          load_hhea_,                    \\\n          load_cmap_,                    \\\n          load_maxp_,                    \\\n          load_os2_,                     \\\n          load_post_,                    \\\n          load_name_,                    \\\n          free_name_,                    \\\n          load_kern_,                    \\\n          load_gasp_,                    \\\n          load_pclt_,                    \\\n          load_bhed_,                    \\\n          load_sbit_image_,              \\\n          get_psname_,                   \\\n          free_psnames_,                 \\\n          get_kerning_,                  \\\n          load_font_dir_,                \\\n          load_hmtx_,                    \\\n          load_eblc_,                    \\\n          free_eblc_,                    \\\n          set_sbit_strike_,              \\\n          load_strike_metrics_,          \\\n          get_metrics_ )                 \\\n  static const SFNT_Interface  class_ =  \\\n  {                                      \\\n    goto_table_,                         \\\n    init_face_,                          \\\n    load_face_,                          \\\n    done_face_,                          \\\n    get_interface_,                      \\\n    load_any_,                           \\\n    load_head_,                          \\\n    load_hhea_,                          \\\n    load_cmap_,                          \\\n    load_maxp_,                          \\\n    load_os2_,                           \\\n    load_post_,                          \\\n    load_name_,                          \\\n    free_name_,                          \\\n    load_kern_,                          \\\n    load_gasp_,                          \\\n    load_pclt_,                          \\\n    load_bhed_,                          \\\n    load_sbit_image_,                    \\\n    get_psname_,                         \\\n    free_psnames_,                       \\\n    get_kerning_,                        \\\n    load_font_dir_,                      \\\n    load_hmtx_,                          \\\n    load_eblc_,                          \\\n    free_eblc_,                          \\\n    set_sbit_strike_,                    \\\n    load_strike_metrics_,                \\\n    get_metrics_,                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_INTERNAL( a, a_ )  \\\n          clazz->a = a_;\n\n#define FT_DEFINE_SFNT_INTERFACE(                       \\\n          class_,                                       \\\n          goto_table_,                                  \\\n          init_face_,                                   \\\n          load_face_,                                   \\\n          done_face_,                                   \\\n          get_interface_,                               \\\n          load_any_,                                    \\\n          load_head_,                                   \\\n          load_hhea_,                                   \\\n          load_cmap_,                                   \\\n          load_maxp_,                                   \\\n          load_os2_,                                    \\\n          load_post_,                                   \\\n          load_name_,                                   \\\n          free_name_,                                   \\\n          load_kern_,                                   \\\n          load_gasp_,                                   \\\n          load_pclt_,                                   \\\n          load_bhed_,                                   \\\n          load_sbit_image_,                             \\\n          get_psname_,                                  \\\n          free_psnames_,                                \\\n          get_kerning_,                                 \\\n          load_font_dir_,                               \\\n          load_hmtx_,                                   \\\n          load_eblc_,                                   \\\n          free_eblc_,                                   \\\n          set_sbit_strike_,                             \\\n          load_strike_metrics_,                         \\\n          get_metrics_ )                                \\\n  void                                                  \\\n  FT_Init_Class_ ## class_( FT_Library       library,   \\\n                            SFNT_Interface*  clazz )    \\\n  {                                                     \\\n    FT_UNUSED( library );                               \\\n                                                        \\\n    clazz->goto_table          = goto_table_;           \\\n    clazz->init_face           = init_face_;            \\\n    clazz->load_face           = load_face_;            \\\n    clazz->done_face           = done_face_;            \\\n    clazz->get_interface       = get_interface_;        \\\n    clazz->load_any            = load_any_;             \\\n    clazz->load_head           = load_head_;            \\\n    clazz->load_hhea           = load_hhea_;            \\\n    clazz->load_cmap           = load_cmap_;            \\\n    clazz->load_maxp           = load_maxp_;            \\\n    clazz->load_os2            = load_os2_;             \\\n    clazz->load_post           = load_post_;            \\\n    clazz->load_name           = load_name_;            \\\n    clazz->free_name           = free_name_;            \\\n    clazz->load_kern           = load_kern_;            \\\n    clazz->load_gasp           = load_gasp_;            \\\n    clazz->load_pclt           = load_pclt_;            \\\n    clazz->load_bhed           = load_bhed_;            \\\n    clazz->load_sbit_image     = load_sbit_image_;      \\\n    clazz->get_psname          = get_psname_;           \\\n    clazz->free_psnames        = free_psnames_;         \\\n    clazz->get_kerning         = get_kerning_;          \\\n    clazz->load_font_dir       = load_font_dir_;        \\\n    clazz->load_hmtx           = load_hmtx_;            \\\n    clazz->load_eblc           = load_eblc_;            \\\n    clazz->free_eblc           = free_eblc_;            \\\n    clazz->set_sbit_strike     = set_sbit_strike_;      \\\n    clazz->load_strike_metrics = load_strike_metrics_;  \\\n    clazz->get_metrics         = get_metrics_;          \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __SFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/t1types.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1types.h                                                              */\n/*                                                                         */\n/*    Basic Type1/Type2 type definitions and interface (specification      */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TYPES_H__\n#define __T1TYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_EncodingRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling a custom encoding.                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_chars  :: The number of character codes in the encoding.       */\n  /*                  Usually 256.                                         */\n  /*                                                                       */\n  /*    code_first :: The lowest valid character code in the encoding.     */\n  /*                                                                       */\n  /*    code_last  :: The highest valid character code in the encoding     */\n  /*                  + 1. When equal to code_first there are no valid     */\n  /*                  character codes.                                     */\n  /*                                                                       */\n  /*    char_index :: An array of corresponding glyph indices.             */\n  /*                                                                       */\n  /*    char_name  :: An array of corresponding glyph names.               */\n  /*                                                                       */\n  typedef struct  T1_EncodingRecRec_\n  {\n    FT_Int       num_chars;\n    FT_Int       code_first;\n    FT_Int       code_last;\n\n    FT_UShort*   char_index;\n    FT_String**  char_name;\n\n  } T1_EncodingRec, *T1_Encoding;\n\n\n  /* used to hold extra data of PS_FontInfoRec that\n   * cannot be stored in the publicly defined structure.\n   *\n   * Note these can't be blended with multiple-masters.\n   */\n  typedef struct  PS_FontExtraRec_\n  {\n    FT_UShort  fs_type;\n\n  } PS_FontExtraRec;\n\n\n  typedef struct  T1_FontRec_\n  {\n    PS_FontInfoRec   font_info;         /* font info dictionary   */\n    PS_FontExtraRec  font_extra;        /* font info extra fields */\n    PS_PrivateRec    private_dict;      /* private dictionary     */\n    FT_String*       font_name;         /* top-level dictionary   */\n\n    T1_EncodingType  encoding_type;\n    T1_EncodingRec   encoding;\n\n    FT_Byte*         subrs_block;\n    FT_Byte*         charstrings_block;\n    FT_Byte*         glyph_names_block;\n\n    FT_Int           num_subrs;\n    FT_Byte**        subrs;\n    FT_PtrDist*      subrs_len;\n\n    FT_Int           num_glyphs;\n    FT_String**      glyph_names;       /* array of glyph names       */\n    FT_Byte**        charstrings;       /* array of glyph charstrings */\n    FT_PtrDist*      charstrings_len;\n\n    FT_Byte          paint_type;\n    FT_Byte          font_type;\n    FT_Matrix        font_matrix;\n    FT_Vector        font_offset;\n    FT_BBox          font_bbox;\n    FT_Long          font_id;\n\n    FT_Fixed         stroke_width;\n\n  } T1_FontRec, *T1_Font;\n\n\n  typedef struct  CID_SubrsRec_\n  {\n    FT_UInt    num_subrs;\n    FT_Byte**  code;\n\n  } CID_SubrsRec, *CID_Subrs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                AFM FONT INFORMATION STRUCTURES                    ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  AFM_TrackKernRec_\n  {\n    FT_Int    degree;\n    FT_Fixed  min_ptsize;\n    FT_Fixed  min_kern;\n    FT_Fixed  max_ptsize;\n    FT_Fixed  max_kern;\n\n  } AFM_TrackKernRec, *AFM_TrackKern;\n\n  typedef struct  AFM_KernPairRec_\n  {\n    FT_Int  index1;\n    FT_Int  index2;\n    FT_Int  x;\n    FT_Int  y;\n\n  } AFM_KernPairRec, *AFM_KernPair;\n\n  typedef struct  AFM_FontInfoRec_\n  {\n    FT_Bool        IsCIDFont;\n    FT_BBox        FontBBox;\n    FT_Fixed       Ascender;\n    FT_Fixed       Descender;\n    AFM_TrackKern  TrackKerns;   /* free if non-NULL */\n    FT_Int         NumTrackKern;\n    AFM_KernPair   KernPairs;    /* free if non-NULL */\n    FT_Int         NumKernPair;\n\n  } AFM_FontInfoRec, *AFM_FontInfo;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_FaceRec_*   T1_Face;\n  typedef struct CID_FaceRec_*  CID_Face;\n\n\n  typedef struct  T1_FaceRec_\n  {\n    FT_FaceRec      root;\n    T1_FontRec      type1;\n    const void*     psnames;\n    const void*     psaux;\n    const void*     afm_data;\n    FT_CharMapRec   charmaprecs[2];\n    FT_CharMap      charmaps[2];\n\n    /* support for Multiple Masters fonts */\n    PS_Blend        blend;\n\n    /* undocumented, optional: indices of subroutines that express      */\n    /* the NormalizeDesignVector and the ConvertDesignVector procedure, */\n    /* respectively, as Type 2 charstrings; -1 if keywords not present  */\n    FT_Int           ndv_idx;\n    FT_Int           cdv_idx;\n\n    /* undocumented, optional: has the same meaning as len_buildchar */\n    /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25    */\n    FT_UInt          len_buildchar;\n    FT_Long*         buildchar;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    const void*     pshinter;\n\n  } T1_FaceRec;\n\n\n  typedef struct  CID_FaceRec_\n  {\n    FT_FaceRec       root;\n    void*            psnames;\n    void*            psaux;\n    CID_FaceInfoRec  cid;\n    PS_FontExtraRec  font_extra;\n#if 0\n    void*            afm_data;\n#endif\n    CID_Subrs        subrs;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    void*            pshinter;\n\n    /* since version 2.1.8, but was originally positioned after `afm_data' */\n    FT_Byte*         binary_data; /* used if hex data has been converted */\n    FT_Stream        cid_stream;\n\n  } CID_FaceRec;\n\n\nFT_END_HEADER\n\n#endif /* __T1TYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/internal/tttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttypes.h                                                              */\n/*                                                                         */\n/*    Basic SFNT/TrueType type definitions and interface (specification    */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2008, 2012-2013 by                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTYPES_H__\n#define __TTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TRUETYPE_TABLES_H\n#include FT_INTERNAL_OBJECTS_H\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include FT_MULTIPLE_MASTERS_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TTC_HeaderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    TrueType collection header.  This table contains the offsets of    */\n  /*    the font headers of each distinct TrueType face in the file.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag     :: Must be `ttc ' to indicate a TrueType collection.       */\n  /*                                                                       */\n  /*    version :: The version number.                                     */\n  /*                                                                       */\n  /*    count   :: The number of faces in the collection.  The             */\n  /*               specification says this should be an unsigned long, but */\n  /*               we use a signed long since we need the value -1 for     */\n  /*               specific purposes.                                      */\n  /*                                                                       */\n  /*    offsets :: The offsets of the font headers, one per face.          */\n  /*                                                                       */\n  typedef struct  TTC_HeaderRec_\n  {\n    FT_ULong   tag;\n    FT_Fixed   version;\n    FT_Long    count;\n    FT_ULong*  offsets;\n\n  } TTC_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_HeaderRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    SFNT file format header.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format_tag     :: The font format tag.                             */\n  /*                                                                       */\n  /*    num_tables     :: The number of tables in file.                    */\n  /*                                                                       */\n  /*    search_range   :: Must be `16 * (max power of 2 <= num_tables)'.   */\n  /*                                                                       */\n  /*    entry_selector :: Must be log2 of `search_range / 16'.             */\n  /*                                                                       */\n  /*    range_shift    :: Must be `num_tables * 16 - search_range'.        */\n  /*                                                                       */\n  typedef struct  SFNT_HeaderRec_\n  {\n    FT_ULong   format_tag;\n    FT_UShort  num_tables;\n    FT_UShort  search_range;\n    FT_UShort  entry_selector;\n    FT_UShort  range_shift;\n\n    FT_ULong   offset;  /* not in file */\n\n  } SFNT_HeaderRec, *SFNT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure describes a given table of a TrueType font.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Tag      :: A four-bytes tag describing the table.                 */\n  /*                                                                       */\n  /*    CheckSum :: The table checksum.  This value can be ignored.        */\n  /*                                                                       */\n  /*    Offset   :: The offset of the table from the start of the TrueType */\n  /*                font in its resource.                                  */\n  /*                                                                       */\n  /*    Length   :: The table length (in bytes).                           */\n  /*                                                                       */\n  typedef struct  TT_TableRec_\n  {\n    FT_ULong  Tag;        /*        table type */\n    FT_ULong  CheckSum;   /*    table checksum */\n    FT_ULong  Offset;     /* table file offset */\n    FT_ULong  Length;     /*      table length */\n\n  } TT_TableRec, *TT_Table;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_LongMetricsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the long metrics of the `hmtx' and `vmtx'     */\n  /*    TrueType tables.  The values are expressed in font units.          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    advance :: The advance width or height for the glyph.              */\n  /*                                                                       */\n  /*    bearing :: The left-side or top-side bearing for the glyph.        */\n  /*                                                                       */\n  typedef struct  TT_LongMetricsRec_\n  {\n    FT_UShort  advance;\n    FT_Short   bearing;\n\n  } TT_LongMetricsRec, *TT_LongMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_ShortMetrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple type to model the short metrics of the `hmtx' and `vmtx'  */\n  /*    tables.                                                            */\n  /*                                                                       */\n  typedef FT_Short  TT_ShortMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameEntryRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling TrueType name records.  Name records are used */\n  /*    to store important strings like family name, style name,           */\n  /*    copyright, etc. in _localized_ versions (i.e., language, encoding, */\n  /*    etc).                                                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platformID   :: The ID of the name's encoding platform.            */\n  /*                                                                       */\n  /*    encodingID   :: The platform-specific ID for the name's encoding.  */\n  /*                                                                       */\n  /*    languageID   :: The platform-specific ID for the name's language.  */\n  /*                                                                       */\n  /*    nameID       :: The ID specifying what kind of name this is.       */\n  /*                                                                       */\n  /*    stringLength :: The length of the string in bytes.                 */\n  /*                                                                       */\n  /*    stringOffset :: The offset to the string in the `name' table.      */\n  /*                                                                       */\n  /*    string       :: A pointer to the string's bytes.  Note that these  */\n  /*                    are usually UTF-16 encoded characters.             */\n  /*                                                                       */\n  typedef struct  TT_NameEntryRec_\n  {\n    FT_UShort  platformID;\n    FT_UShort  encodingID;\n    FT_UShort  languageID;\n    FT_UShort  nameID;\n    FT_UShort  stringLength;\n    FT_ULong   stringOffset;\n\n    /* this last field is not defined in the spec */\n    /* but used by the FreeType engine            */\n\n    FT_Byte*   string;\n\n  } TT_NameEntryRec, *TT_NameEntry;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameTableRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType name table.                      */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format         :: The format of the name table.                    */\n  /*                                                                       */\n  /*    numNameRecords :: The number of names in table.                    */\n  /*                                                                       */\n  /*    storageOffset  :: The offset of the name table in the `name'       */\n  /*                      TrueType table.                                  */\n  /*                                                                       */\n  /*    names          :: An array of name records.                        */\n  /*                                                                       */\n  /*    stream         :: the file's input stream.                         */\n  /*                                                                       */\n  typedef struct  TT_NameTableRec_\n  {\n    FT_UShort         format;\n    FT_UInt           numNameRecords;\n    FT_UInt           storageOffset;\n    TT_NameEntryRec*  names;\n    FT_Stream         stream;\n\n  } TT_NameTableRec, *TT_NameTable;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRangeRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A tiny structure used to model a gasp range according to the       */\n  /*    TrueType specification.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    maxPPEM  :: The maximum ppem value to which `gaspFlag' applies.    */\n  /*                                                                       */\n  /*    gaspFlag :: A flag describing the grid-fitting and anti-aliasing   */\n  /*                modes to be used.                                      */\n  /*                                                                       */\n  typedef struct  TT_GaspRangeRec_\n  {\n    FT_UShort  maxPPEM;\n    FT_UShort  gaspFlag;\n\n  } TT_GaspRangeRec, *TT_GaspRange;\n\n\n#define TT_GASP_GRIDFIT  0x01\n#define TT_GASP_DOGRAY   0x02\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType `gasp' table used to specify     */\n  /*    grid-fitting and anti-aliasing behaviour.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version    :: The version number.                                  */\n  /*                                                                       */\n  /*    numRanges  :: The number of gasp ranges in table.                  */\n  /*                                                                       */\n  /*    gaspRanges :: An array of gasp ranges.                             */\n  /*                                                                       */\n  typedef struct  TT_Gasp_\n  {\n    FT_UShort     version;\n    FT_UShort     numRanges;\n    TT_GaspRange  gaspRanges;\n\n  } TT_GaspRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    EMBEDDED BITMAPS SUPPORT                       ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_MetricsRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the big metrics of a given glyph bitmap   */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or `bloc' (Apple) table.                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height       :: The glyph height in pixels.                        */\n  /*                                                                       */\n  /*    width        :: The glyph width in pixels.                         */\n  /*                                                                       */\n  /*    horiBearingX :: The horizontal left bearing.                       */\n  /*                                                                       */\n  /*    horiBearingY :: The horizontal top bearing.                        */\n  /*                                                                       */\n  /*    horiAdvance  :: The horizontal advance.                            */\n  /*                                                                       */\n  /*    vertBearingX :: The vertical left bearing.                         */\n  /*                                                                       */\n  /*    vertBearingY :: The vertical top bearing.                          */\n  /*                                                                       */\n  /*    vertAdvance  :: The vertical advance.                              */\n  /*                                                                       */\n  typedef struct  TT_SBit_MetricsRec_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  horiBearingX;\n    FT_Char  horiBearingY;\n    FT_Byte  horiAdvance;\n\n    FT_Char  vertBearingX;\n    FT_Char  vertBearingY;\n    FT_Byte  vertAdvance;\n\n  } TT_SBit_MetricsRec, *TT_SBit_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_SmallMetricsRec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the small metrics of a given glyph bitmap */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or the `bdat' (Apple) table.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height   :: The glyph height in pixels.                            */\n  /*                                                                       */\n  /*    width    :: The glyph width in pixels.                             */\n  /*                                                                       */\n  /*    bearingX :: The left-side bearing.                                 */\n  /*                                                                       */\n  /*    bearingY :: The top-side bearing.                                  */\n  /*                                                                       */\n  /*    advance  :: The advance width or height.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_Small_Metrics_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  bearingX;\n    FT_Char  bearingY;\n    FT_Byte  advance;\n\n  } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_LineMetricsRec                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe the text line metrics of a given      */\n  /*    bitmap strike, for either a horizontal or vertical layout.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    ascender                :: The ascender in pixels.                 */\n  /*                                                                       */\n  /*    descender               :: The descender in pixels.                */\n  /*                                                                       */\n  /*    max_width               :: The maximum glyph width in pixels.      */\n  /*                                                                       */\n  /*    caret_slope_enumerator  :: Rise of the caret slope, typically set  */\n  /*                               to 1 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_slope_denominator :: Rise of the caret slope, typically set  */\n  /*                               to 0 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_offset            :: Offset in pixels to move the caret for  */\n  /*                               proper positioning.                     */\n  /*                                                                       */\n  /*    min_origin_SB           :: Minimum of horiBearingX (resp.          */\n  /*                               vertBearingY).                          */\n  /*    min_advance_SB          :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horizontal advance -                  */\n  /*                                   ( horiBearingX + width )            */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertical advance -                    */\n  /*                                   ( vertBearingY + height )           */\n  /*                                                                       */\n  /*    max_before_BL           :: Maximum of horiBearingY (resp.          */\n  /*                               vertBearingY).                          */\n  /*                                                                       */\n  /*    min_after_BL            :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horiBearingY - height                 */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertBearingX - width                  */\n  /*                                                                       */\n  /*    pads                    :: Unused (to make the size of the record  */\n  /*                               a multiple of 32 bits.                  */\n  /*                                                                       */\n  typedef struct  TT_SBit_LineMetricsRec_\n  {\n    FT_Char  ascender;\n    FT_Char  descender;\n    FT_Byte  max_width;\n    FT_Char  caret_slope_numerator;\n    FT_Char  caret_slope_denominator;\n    FT_Char  caret_offset;\n    FT_Char  min_origin_SB;\n    FT_Char  min_advance_SB;\n    FT_Char  max_before_BL;\n    FT_Char  min_after_BL;\n    FT_Char  pads[2];\n\n  } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_RangeRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A TrueType/OpenType subIndexTable as defined in the `EBLC'         */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    first_glyph   :: The first glyph index in the range.               */\n  /*                                                                       */\n  /*    last_glyph    :: The last glyph index in the range.                */\n  /*                                                                       */\n  /*    index_format  :: The format of index table.  Valid values are 1    */\n  /*                     to 5.                                             */\n  /*                                                                       */\n  /*    image_format  :: The format of `EBDT' image data.                  */\n  /*                                                                       */\n  /*    image_offset  :: The offset to image data in `EBDT'.               */\n  /*                                                                       */\n  /*    image_size    :: For index formats 2 and 5.  This is the size in   */\n  /*                     bytes of each glyph bitmap.                       */\n  /*                                                                       */\n  /*    big_metrics   :: For index formats 2 and 5.  This is the big       */\n  /*                     metrics for each glyph bitmap.                    */\n  /*                                                                       */\n  /*    num_glyphs    :: For index formats 4 and 5.  This is the number of */\n  /*                     glyphs in the code array.                         */\n  /*                                                                       */\n  /*    glyph_offsets :: For index formats 1 and 3.                        */\n  /*                                                                       */\n  /*    glyph_codes   :: For index formats 4 and 5.                        */\n  /*                                                                       */\n  /*    table_offset  :: The offset of the index table in the `EBLC'       */\n  /*                     table.  Only used during strike loading.          */\n  /*                                                                       */\n  typedef struct  TT_SBit_RangeRec_\n  {\n    FT_UShort           first_glyph;\n    FT_UShort           last_glyph;\n\n    FT_UShort           index_format;\n    FT_UShort           image_format;\n    FT_ULong            image_offset;\n\n    FT_ULong            image_size;\n    TT_SBit_MetricsRec  metrics;\n    FT_ULong            num_glyphs;\n\n    FT_ULong*           glyph_offsets;\n    FT_UShort*          glyph_codes;\n\n    FT_ULong            table_offset;\n\n  } TT_SBit_RangeRec, *TT_SBit_Range;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_StrikeRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap strike in the `EBLC'      */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*   num_index_ranges :: The number of index ranges.                     */\n  /*                                                                       */\n  /*   index_ranges     :: An array of glyph index ranges.                 */\n  /*                                                                       */\n  /*   color_ref        :: Unused.  `color_ref' is put in for future       */\n  /*                       enhancements, but these fields are already      */\n  /*                       in use by other platforms (e.g. Newton).        */\n  /*                       For details, please see                         */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  /*   hori             :: The line metrics for horizontal layouts.        */\n  /*                                                                       */\n  /*   vert             :: The line metrics for vertical layouts.          */\n  /*                                                                       */\n  /*   start_glyph      :: The lowest glyph index for this strike.         */\n  /*                                                                       */\n  /*   end_glyph        :: The highest glyph index for this strike.        */\n  /*                                                                       */\n  /*   x_ppem           :: The number of horizontal pixels per EM.         */\n  /*                                                                       */\n  /*   y_ppem           :: The number of vertical pixels per EM.           */\n  /*                                                                       */\n  /*   bit_depth        :: The bit depth.  Valid values are 1, 2, 4,       */\n  /*                       and 8.                                          */\n  /*                                                                       */\n  /*   flags            :: Is this a vertical or horizontal strike?  For   */\n  /*                       details, please see                             */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  typedef struct  TT_SBit_StrikeRec_\n  {\n    FT_Int                  num_ranges;\n    TT_SBit_Range           sbit_ranges;\n    FT_ULong                ranges_offset;\n\n    FT_ULong                color_ref;\n\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_UShort               start_glyph;\n    FT_UShort               end_glyph;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 bit_depth;\n    FT_Char                 flags;\n\n  } TT_SBit_StrikeRec, *TT_SBit_Strike;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ComponentRec                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure to describe a compound sbit element.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_code :: The element's glyph index.                           */\n  /*                                                                       */\n  /*    x_offset   :: The element's left bearing.                          */\n  /*                                                                       */\n  /*    y_offset   :: The element's top bearing.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_ComponentRec_\n  {\n    FT_UShort  glyph_code;\n    FT_Char    x_offset;\n    FT_Char    y_offset;\n\n  } TT_SBit_ComponentRec, *TT_SBit_Component;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ScaleRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap scaling table, as defined */\n  /*    in the `EBSC' table.                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    hori              :: The horizontal line metrics.                  */\n  /*                                                                       */\n  /*    vert              :: The vertical line metrics.                    */\n  /*                                                                       */\n  /*    x_ppem            :: The number of horizontal pixels per EM.       */\n  /*                                                                       */\n  /*    y_ppem            :: The number of vertical pixels per EM.         */\n  /*                                                                       */\n  /*    x_ppem_substitute :: Substitution x_ppem value.                    */\n  /*                                                                       */\n  /*    y_ppem_substitute :: Substitution y_ppem value.                    */\n  /*                                                                       */\n  typedef struct  TT_SBit_ScaleRec_\n  {\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 x_ppem_substitute;\n    FT_Byte                 y_ppem_substitute;\n\n  } TT_SBit_ScaleRec, *TT_SBit_Scale;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  POSTSCRIPT GLYPH NAMES SUPPORT                   ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_20Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.0.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs    :: The number of named glyphs in the table.          */\n  /*                                                                       */\n  /*    num_names     :: The number of PS names stored in the table.       */\n  /*                                                                       */\n  /*    glyph_indices :: The indices of the glyphs in the names arrays.    */\n  /*                                                                       */\n  /*    glyph_names   :: The PS names not in Mac Encoding.                 */\n  /*                                                                       */\n  typedef struct  TT_Post_20Rec_\n  {\n    FT_UShort   num_glyphs;\n    FT_UShort   num_names;\n    FT_UShort*  glyph_indices;\n    FT_Char**   glyph_names;\n\n  } TT_Post_20Rec, *TT_Post_20;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_25Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.5.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs :: The number of glyphs in the table.                   */\n  /*                                                                       */\n  /*    offsets    :: An array of signed offsets in a normal Mac           */\n  /*                  Postscript name encoding.                            */\n  /*                                                                       */\n  typedef struct  TT_Post_25_\n  {\n    FT_UShort  num_glyphs;\n    FT_Char*   offsets;\n\n  } TT_Post_25Rec, *TT_Post_25;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_NamesRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names table, either format 2.0 or 2.5.                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loaded    :: A flag to indicate whether the PS names are loaded.   */\n  /*                                                                       */\n  /*    format_20 :: The sub-table used for format 2.0.                    */\n  /*                                                                       */\n  /*    format_25 :: The sub-table used for format 2.5.                    */\n  /*                                                                       */\n  typedef struct  TT_Post_NamesRec_\n  {\n    FT_Bool  loaded;\n\n    union\n    {\n      TT_Post_20Rec  format_20;\n      TT_Post_25Rec  format_25;\n\n    } names;\n\n  } TT_Post_NamesRec, *TT_Post_Names;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    GX VARIATION TABLE SUPPORT                     ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n  typedef struct GX_BlendRec_  *GX_Blend;\n#endif\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              EMBEDDED BDF PROPERTIES TABLE SUPPORT                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   * These types are used to support a `BDF ' table that isn't part of the\n   * official TrueType specification.  It is mainly used in SFNT-based\n   * bitmap fonts that were generated from a set of BDF fonts.\n   *\n   * The format of the table is as follows.\n   *\n   *   USHORT   version      `BDF ' table version number, should be 0x0001.\n   *   USHORT   strikeCount  Number of strikes (bitmap sizes) in this table.\n   *   ULONG    stringTable  Offset (from start of BDF table) to string\n   *                         table.\n   *\n   * This is followed by an array of `strikeCount' descriptors, having the\n   * following format.\n   *\n   *   USHORT   ppem         Vertical pixels per EM for this strike.\n   *   USHORT   numItems     Number of items for this strike (properties and\n   *                         atoms).  Maximum is 255.\n   *\n   * This array in turn is followed by `strikeCount' value sets.  Each\n   * `value set' is an array of `numItems' items with the following format.\n   *\n   *   ULONG    item_name    Offset in string table to item name.\n   *   USHORT   item_type    The item type.  Possible values are\n   *                            0 => string (e.g., COMMENT)\n   *                            1 => atom   (e.g., FONT or even SIZE)\n   *                            2 => int32\n   *                            3 => uint32\n   *                         0x10 => A flag to indicate a properties.  This\n   *                                 is ORed with the above values.\n   *   ULONG    item_value   For strings  => Offset into string table without\n   *                                         the corresponding double quotes.\n   *                         For atoms    => Offset into string table.\n   *                         For integers => Direct value.\n   *\n   * All strings in the string table consist of bytes and are\n   * zero-terminated.\n   *\n   */\n\n#ifdef TT_CONFIG_OPTION_BDF\n\n  typedef struct  TT_BDFRec_\n  {\n    FT_Byte*   table;\n    FT_Byte*   table_end;\n    FT_Byte*   strings;\n    FT_ULong   strings_size;\n    FT_UInt    num_strikes;\n    FT_Bool    loaded;\n\n  } TT_BDFRec, *TT_BDF;\n\n#endif /* TT_CONFIG_OPTION_BDF */\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  ORIGINAL TT_FACE CLASS DEFINITION                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This structure/class is defined here because it is common to the      */\n  /* following formats: TTF, OpenType-TT, and OpenType-CFF.                */\n  /*                                                                       */\n  /* Note, however, that the classes TT_Size and TT_GlyphSlot are not      */\n  /* shared between font drivers, and are thus defined in `ttobjs.h'.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType face/font object.  A TT_Face encapsulates   */\n  /*    the resolution and scaling independent parts of a TrueType font    */\n  /*    resource.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The TT_Face structure is also used as a `parent class' for the     */\n  /*    OpenType-CFF class (T2_Face).                                      */\n  /*                                                                       */\n  typedef struct TT_FaceRec_*  TT_Face;\n\n\n  /* a function type used for the truetype bytecode interpreter hooks */\n  typedef FT_Error\n  (*TT_Interpreter)( void*  exec_context );\n\n  /* forward declaration */\n  typedef struct TT_LoaderRec_*  TT_Loader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_GotoTableFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given TrueType table.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    tag    :: A 4-byte tag used to name the table.                     */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    length :: The length of the table in bytes.  Set to 0 if not       */\n  /*              needed.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_GotoTableFunc)( TT_Face    face,\n                              FT_ULong   tag,\n                              FT_Stream  stream,\n                              FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_StartGlyphFunc                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given glyph element, and opens a  */\n  /*    frame for it.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader      :: The current TrueType glyph loader object.           */\n  /*                                                                       */\n  /*    glyph index :: The index of the glyph to access.                   */\n  /*                                                                       */\n  /*    offset      :: The offset of the glyph according to the            */\n  /*                   `locations' table.                                  */\n  /*                                                                       */\n  /*    byte_count  :: The size of the frame in bytes.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is normally equivalent to FT_STREAM_SEEK(offset)     */\n  /*    followed by FT_FRAME_ENTER(byte_count) with the loader's stream,   */\n  /*    but alternative formats (e.g. compressed ones) might use something */\n  /*    different.                                                         */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_StartGlyphFunc)( TT_Loader  loader,\n                               FT_UInt    glyph_index,\n                               FT_ULong   offset,\n                               FT_UInt    byte_count );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_ReadGlyphFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reads one glyph element (its header, a simple glyph, or a          */\n  /*    composite) from the loader's current stream frame.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_ReadGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_EndGlyphFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Closes the current loader stream frame for the glyph.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  typedef void\n  (*TT_Loader_EndGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         TrueType Face Type                            */\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType face class.  These objects model the resolution and   */\n  /*    point-size independent data found in a TrueType font file.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root                 :: The base FT_Face structure, managed by the */\n  /*                            base layer.                                */\n  /*                                                                       */\n  /*    ttc_header           :: The TrueType collection header, used when  */\n  /*                            the file is a `ttc' rather than a `ttf'.   */\n  /*                            For ordinary font files, the field         */\n  /*                            `ttc_header.count' is set to 0.            */\n  /*                                                                       */\n  /*    format_tag           :: The font format tag.                       */\n  /*                                                                       */\n  /*    num_tables           :: The number of TrueType tables in this font */\n  /*                            file.                                      */\n  /*                                                                       */\n  /*    dir_tables           :: The directory of TrueType tables for this  */\n  /*                            font file.                                 */\n  /*                                                                       */\n  /*    header               :: The font's font header (`head' table).     */\n  /*                            Read on font opening.                      */\n  /*                                                                       */\n  /*    horizontal           :: The font's horizontal header (`hhea'       */\n  /*                            table).  This field also contains the      */\n  /*                            associated horizontal metrics table        */\n  /*                            (`hmtx').                                  */\n  /*                                                                       */\n  /*    max_profile          :: The font's maximum profile table.  Read on */\n  /*                            font opening.  Note that some maximum      */\n  /*                            values cannot be taken directly from this  */\n  /*                            table.  We thus define additional fields   */\n  /*                            below to hold the computed maxima.         */\n  /*                                                                       */\n  /*    vertical_info        :: A boolean which is set when the font file  */\n  /*                            contains vertical metrics.  If not, the    */\n  /*                            value of the `vertical' field is           */\n  /*                            undefined.                                 */\n  /*                                                                       */\n  /*    vertical             :: The font's vertical header (`vhea' table). */\n  /*                            This field also contains the associated    */\n  /*                            vertical metrics table (`vmtx'), if found. */\n  /*                            IMPORTANT: The contents of this field is   */\n  /*                            undefined if the `verticalInfo' field is   */\n  /*                            unset.                                     */\n  /*                                                                       */\n  /*    num_names            :: The number of name records within this     */\n  /*                            TrueType font.                             */\n  /*                                                                       */\n  /*    name_table           :: The table of name records (`name').        */\n  /*                                                                       */\n  /*    os2                  :: The font's OS/2 table (`OS/2').            */\n  /*                                                                       */\n  /*    postscript           :: The font's PostScript table (`post'        */\n  /*                            table).  The PostScript glyph names are    */\n  /*                            not loaded by the driver on face opening.  */\n  /*                            See the `ttpost' module for more details.  */\n  /*                                                                       */\n  /*    cmap_table           :: Address of the face's `cmap' SFNT table    */\n  /*                            in memory (it's an extracted frame).       */\n  /*                                                                       */\n  /*    cmap_size            :: The size in bytes of the `cmap_table'      */\n  /*                            described above.                           */\n  /*                                                                       */\n  /*    goto_table           :: A function called by each TrueType table   */\n  /*                            loader to position a stream's cursor to    */\n  /*                            the start of a given table according to    */\n  /*                            its tag.  It defaults to TT_Goto_Face but  */\n  /*                            can be different for strange formats (e.g. */\n  /*                            Type 42).                                  */\n  /*                                                                       */\n  /*    access_glyph_frame   :: A function used to access the frame of a   */\n  /*                            given glyph within the face's font file.   */\n  /*                                                                       */\n  /*    forget_glyph_frame   :: A function used to forget the frame of a   */\n  /*                            given glyph when all data has been loaded. */\n  /*                                                                       */\n  /*    read_glyph_header    :: A function used to read a glyph header.    */\n  /*                            It must be called between an `access' and  */\n  /*                            `forget'.                                  */\n  /*                                                                       */\n  /*    read_simple_glyph    :: A function used to read a simple glyph.    */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    read_composite_glyph :: A function used to read a composite glyph. */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    sfnt                 :: A pointer to the SFNT service.             */\n  /*                                                                       */\n  /*    psnames              :: A pointer to the PostScript names service. */\n  /*                                                                       */\n  /*    hdmx                 :: The face's horizontal device metrics       */\n  /*                            (`hdmx' table).  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    gasp                 :: The grid-fitting and scaling properties    */\n  /*                            table (`gasp').  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    pclt                 :: The `pclt' SFNT table.                     */\n  /*                                                                       */\n  /*    num_sbit_strikes     :: The number of sbit strikes, i.e., bitmap   */\n  /*                            sizes, embedded in this font.              */\n  /*                                                                       */\n  /*    sbit_strikes         :: An array of sbit strikes embedded in this  */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    num_sbit_scales      :: The number of sbit scales for this font.   */\n  /*                                                                       */\n  /*    sbit_scales          :: Array of sbit scales embedded in this      */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    postscript_names     :: A table used to store the Postscript names */\n  /*                            of  the glyphs for this font.  See the     */\n  /*                            file  `ttconfig.h' for comments on the     */\n  /*                            TT_CONFIG_OPTION_POSTSCRIPT_NAMES option.  */\n  /*                                                                       */\n  /*    num_locations        :: The number of glyph locations in this      */\n  /*                            TrueType file.  This should be             */\n  /*                            identical to the number of glyphs.         */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    glyph_locations      :: An array of longs.  These are offsets to   */\n  /*                            glyph data within the `glyf' table.        */\n  /*                            Ignored for Type 2 font faces.             */\n  /*                                                                       */\n  /*    glyf_len             :: The length of the `glyf' table.  Needed    */\n  /*                            for malformed `loca' tables.               */\n  /*                                                                       */\n  /*    font_program_size    :: Size in bytecodes of the face's font       */\n  /*                            program.  0 if none defined.  Ignored for  */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    font_program         :: The face's font program (bytecode stream)  */\n  /*                            executed at load time, also used during    */\n  /*                            glyph rendering.  Comes from the `fpgm'    */\n  /*                            table.  Ignored for Type 2 font fonts.     */\n  /*                                                                       */\n  /*    cvt_program_size     :: The size in bytecodes of the face's cvt    */\n  /*                            program.  Ignored for Type 2 fonts.        */\n  /*                                                                       */\n  /*    cvt_program          :: The face's cvt program (bytecode stream)   */\n  /*                            executed each time an instance/size is     */\n  /*                            changed/reset.  Comes from the `prep'      */\n  /*                            table.  Ignored for Type 2 fonts.          */\n  /*                                                                       */\n  /*    cvt_size             :: Size of the control value table (in        */\n  /*                            entries).   Ignored for Type 2 fonts.      */\n  /*                                                                       */\n  /*    cvt                  :: The face's original control value table.   */\n  /*                            Coordinates are expressed in unscaled font */\n  /*                            units.  Comes from the `cvt ' table.       */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    num_kern_pairs       :: The number of kerning pairs present in the */\n  /*                            font file.  The engine only loads the      */\n  /*                            first horizontal format 0 kern table it    */\n  /*                            finds in the font file.  Ignored for       */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    kern_table_index     :: The index of the kerning table in the font */\n  /*                            kerning directory.  Ignored for Type 2     */\n  /*                            fonts.                                     */\n  /*                                                                       */\n  /*    interpreter          :: A pointer to the TrueType bytecode         */\n  /*                            interpreters field is also used to hook    */\n  /*                            the debugger in `ttdebug'.                 */\n  /*                                                                       */\n  /*    unpatented_hinting   :: If true, use only unpatented methods in    */\n  /*                            the bytecode interpreter.                  */\n  /*                                                                       */\n  /*    doblend              :: A boolean which is set if the font should  */\n  /*                            be blended (this is for GX var).           */\n  /*                                                                       */\n  /*    blend                :: Contains the data needed to control GX     */\n  /*                            variation tables (rather like Multiple     */\n  /*                            Master data).                              */\n  /*                                                                       */\n  /*    extra                :: Reserved for third-party font drivers.     */\n  /*                                                                       */\n  /*    postscript_name      :: The PS name of the font.  Used by the      */\n  /*                            postscript name service.                   */\n  /*                                                                       */\n  typedef struct  TT_FaceRec_\n  {\n    FT_FaceRec            root;\n\n    TTC_HeaderRec         ttc_header;\n\n    FT_ULong              format_tag;\n    FT_UShort             num_tables;\n    TT_Table              dir_tables;\n\n    TT_Header             header;       /* TrueType header table          */\n    TT_HoriHeader         horizontal;   /* TrueType horizontal header     */\n\n    TT_MaxProfile         max_profile;\n\n    FT_Bool               vertical_info;\n    TT_VertHeader         vertical;     /* TT Vertical header, if present */\n\n    FT_UShort             num_names;    /* number of name records  */\n    TT_NameTableRec       name_table;   /* name table              */\n\n    TT_OS2                os2;          /* TrueType OS/2 table            */\n    TT_Postscript         postscript;   /* TrueType Postscript table      */\n\n    FT_Byte*              cmap_table;   /* extracted `cmap' table */\n    FT_ULong              cmap_size;\n\n    TT_Loader_GotoTableFunc   goto_table;\n\n    TT_Loader_StartGlyphFunc  access_glyph_frame;\n    TT_Loader_EndGlyphFunc    forget_glyph_frame;\n    TT_Loader_ReadGlyphFunc   read_glyph_header;\n    TT_Loader_ReadGlyphFunc   read_simple_glyph;\n    TT_Loader_ReadGlyphFunc   read_composite_glyph;\n\n    /* a typeless pointer to the SFNT_Interface table used to load */\n    /* the basic TrueType tables in the face object                */\n    void*                 sfnt;\n\n    /* a typeless pointer to the FT_Service_PsCMapsRec table used to */\n    /* handle glyph names <-> unicode & Mac values                   */\n    void*                 psnames;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Optional TrueType/OpenType tables                                   */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* grid-fitting and scaling table */\n    TT_GaspRec            gasp;                 /* the `gasp' table */\n\n    /* PCL 5 table */\n    TT_PCLT               pclt;\n\n    /* embedded bitmaps support */\n    FT_ULong              num_sbit_scales;\n    TT_SBit_Scale         sbit_scales;\n\n    /* postscript names table */\n    TT_Post_NamesRec      postscript_names;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* TrueType-specific fields (ignored by the OTF-Type2 driver)          */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* the font program, if any */\n    FT_ULong              font_program_size;\n    FT_Byte*              font_program;\n\n    /* the cvt program, if any */\n    FT_ULong              cvt_program_size;\n    FT_Byte*              cvt_program;\n\n    /* the original, unscaled, control value table */\n    FT_ULong              cvt_size;\n    FT_Short*             cvt;\n\n    /* A pointer to the bytecode interpreter to use.  This is also */\n    /* used to hook the debugger for the `ttdebug' utility.        */\n    TT_Interpreter        interpreter;\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    /* Use unpatented hinting only. */\n    FT_Bool               unpatented_hinting;\n#endif\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Other tables or fields. This is used by derivative formats like     */\n    /* OpenType.                                                           */\n    /*                                                                     */\n    /***********************************************************************/\n\n    FT_Generic            extra;\n\n    const char*           postscript_name;\n\n    FT_ULong              glyf_len;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Bool               doblend;\n    GX_Blend              blend;\n#endif\n\n    /* since version 2.2 */\n\n    FT_Byte*              horz_metrics;\n    FT_ULong              horz_metrics_size;\n\n    FT_Byte*              vert_metrics;\n    FT_ULong              vert_metrics_size;\n\n    FT_ULong              num_locations; /* in broken TTF, gid > 0xFFFF */\n    FT_Byte*              glyph_locations;\n\n    FT_Byte*              hdmx_table;\n    FT_ULong              hdmx_table_size;\n    FT_UInt               hdmx_record_count;\n    FT_ULong              hdmx_record_size;\n    FT_Byte*              hdmx_record_sizes;\n\n    FT_Byte*              sbit_table;\n    FT_ULong              sbit_table_size;\n    FT_UInt               sbit_num_strikes;\n\n    FT_Byte*              kern_table;\n    FT_ULong              kern_table_size;\n    FT_UInt               num_kern_tables;\n    FT_UInt32             kern_avail_bits;\n    FT_UInt32             kern_order_bits;\n\n#ifdef TT_CONFIG_OPTION_BDF\n    TT_BDFRec             bdf;\n#endif /* TT_CONFIG_OPTION_BDF */\n\n    /* since 2.3.0 */\n    FT_ULong              horz_metrics_offset;\n    FT_ULong              vert_metrics_offset;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* since 2.4.12 */\n    FT_ULong              sph_found_func_flags; /* special functions found */\n                                                /* for this face           */\n    FT_Bool               sph_compatibility_mode;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n  } TT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  <Struct>                                                             */\n  /*     TT_GlyphZoneRec                                                   */\n  /*                                                                       */\n  /*  <Description>                                                        */\n  /*     A glyph zone is used to load, scale and hint glyph outline        */\n  /*     coordinates.                                                      */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     memory       :: A handle to the memory manager.                   */\n  /*                                                                       */\n  /*     max_points   :: The maximum size in points of the zone.           */\n  /*                                                                       */\n  /*     max_contours :: Max size in links contours of the zone.           */\n  /*                                                                       */\n  /*     n_points     :: The current number of points in the zone.         */\n  /*                                                                       */\n  /*     n_contours   :: The current number of contours in the zone.       */\n  /*                                                                       */\n  /*     org          :: The original glyph coordinates (font              */\n  /*                     units/scaled).                                    */\n  /*                                                                       */\n  /*     cur          :: The current glyph coordinates (scaled/hinted).    */\n  /*                                                                       */\n  /*     tags         :: The point control tags.                           */\n  /*                                                                       */\n  /*     contours     :: The contours end points.                          */\n  /*                                                                       */\n  /*     first_point  :: Offset of the current subglyph's first point.     */\n  /*                                                                       */\n  typedef struct  TT_GlyphZoneRec_\n  {\n    FT_Memory   memory;\n    FT_UShort   max_points;\n    FT_UShort   max_contours;\n    FT_UShort   n_points;    /* number of points in zone    */\n    FT_Short    n_contours;  /* number of contours          */\n\n    FT_Vector*  org;         /* original point coordinates  */\n    FT_Vector*  cur;         /* current point coordinates   */\n    FT_Vector*  orus;        /* original (unscaled) point coordinates */\n\n    FT_Byte*    tags;        /* current touch flags         */\n    FT_UShort*  contours;    /* contour end points          */\n\n    FT_UShort   first_point; /* offset of first (#0) point  */\n\n  } TT_GlyphZoneRec, *TT_GlyphZone;\n\n\n  /* handle to execution context */\n  typedef struct TT_ExecContextRec_*  TT_ExecContext;\n\n  /* glyph loader structure */\n  typedef struct  TT_LoaderRec_\n  {\n    FT_Face          face;\n    FT_Size          size;\n    FT_GlyphSlot     glyph;\n    FT_GlyphLoader   gloader;\n\n    FT_ULong         load_flags;\n    FT_UInt          glyph_index;\n\n    FT_Stream        stream;\n    FT_Int           byte_len;\n\n    FT_Short         n_contours;\n    FT_BBox          bbox;\n    FT_Int           left_bearing;\n    FT_Int           advance;\n    FT_Int           linear;\n    FT_Bool          linear_def;\n    FT_Bool          preserve_pps;\n    FT_Vector        pp1;\n    FT_Vector        pp2;\n\n    FT_ULong         glyf_offset;\n\n    /* the zone where we load our glyphs */\n    TT_GlyphZoneRec  base;\n    TT_GlyphZoneRec  zone;\n\n    TT_ExecContext   exec;\n    FT_Byte*         instructions;\n    FT_ULong         ins_pos;\n\n    /* for possible extensibility in other formats */\n    void*            other;\n\n    /* since version 2.1.8 */\n    FT_Int           top_bearing;\n    FT_Int           vadvance;\n    FT_Vector        pp3;\n    FT_Vector        pp4;\n\n    /* since version 2.2.1 */\n    FT_Byte*         cursor;\n    FT_Byte*         limit;\n\n  } TT_LoaderRec;\n\n\nFT_END_HEADER\n\n#endif /* __TTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/t1tables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tables.h                                                             */\n/*                                                                         */\n/*    Basic Type 1/Type 2 tables definitions and interface (specification  */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TABLES_H__\n#define __T1TABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    type1_tables                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Type 1 Tables                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Type~1 (PostScript) specific font tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of Type 1-specific tables,    */\n  /*    including structures related to other PostScript font formats.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */\n  /* structures in order to support Multiple Master fonts.               */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfoRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 FontInfo dictionary.  */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    FontInfo dictionary.                                               */\n  /*                                                                       */\n  typedef struct  PS_FontInfoRec_\n  {\n    FT_String*  version;\n    FT_String*  notice;\n    FT_String*  full_name;\n    FT_String*  family_name;\n    FT_String*  weight;\n    FT_Long     italic_angle;\n    FT_Bool     is_fixed_pitch;\n    FT_Short    underline_position;\n    FT_UShort   underline_thickness;\n\n  } PS_FontInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_FontInfoRec structure.                           */\n  /*                                                                       */\n  typedef struct PS_FontInfoRec_*  PS_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef PS_FontInfoRec  T1_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_PrivateRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 private dictionary.   */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    Private dictionary.                                                */\n  /*                                                                       */\n  typedef struct  PS_PrivateRec_\n  {\n    FT_Int     unique_id;\n    FT_Int     lenIV;\n\n    FT_Byte    num_blue_values;\n    FT_Byte    num_other_blues;\n    FT_Byte    num_family_blues;\n    FT_Byte    num_family_other_blues;\n\n    FT_Short   blue_values[14];\n    FT_Short   other_blues[10];\n\n    FT_Short   family_blues      [14];\n    FT_Short   family_other_blues[10];\n\n    FT_Fixed   blue_scale;\n    FT_Int     blue_shift;\n    FT_Int     blue_fuzz;\n\n    FT_UShort  standard_width[1];\n    FT_UShort  standard_height[1];\n\n    FT_Byte    num_snap_widths;\n    FT_Byte    num_snap_heights;\n    FT_Bool    force_bold;\n    FT_Bool    round_stem_up;\n\n    FT_Short   snap_widths [13];  /* including std width  */\n    FT_Short   snap_heights[13];  /* including std height */\n\n    FT_Fixed   expansion_factor;\n\n    FT_Long    language_group;\n    FT_Long    password;\n\n    FT_Short   min_feature[2];\n\n  } PS_PrivateRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_PrivateRec structure.                            */\n  /*                                                                       */\n  typedef struct PS_PrivateRec_*  PS_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef PS_PrivateRec  T1_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_Blend_Flags                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of flags used to indicate which fields are present in a      */\n  /*    given blend dictionary (font info or private).  Used to support    */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  typedef enum  T1_Blend_Flags_\n  {\n    /*# required fields in a FontInfo blend dictionary */\n    T1_BLEND_UNDERLINE_POSITION = 0,\n    T1_BLEND_UNDERLINE_THICKNESS,\n    T1_BLEND_ITALIC_ANGLE,\n\n    /*# required fields in a Private blend dictionary */\n    T1_BLEND_BLUE_VALUES,\n    T1_BLEND_OTHER_BLUES,\n    T1_BLEND_STANDARD_WIDTH,\n    T1_BLEND_STANDARD_HEIGHT,\n    T1_BLEND_STEM_SNAP_WIDTHS,\n    T1_BLEND_STEM_SNAP_HEIGHTS,\n    T1_BLEND_BLUE_SCALE,\n    T1_BLEND_BLUE_SHIFT,\n    T1_BLEND_FAMILY_BLUES,\n    T1_BLEND_FAMILY_OTHER_BLUES,\n    T1_BLEND_FORCE_BOLD,\n\n    /*# never remove */\n    T1_BLEND_MAX\n\n  } T1_Blend_Flags;\n\n  /* */\n\n\n  /*# backwards compatible definitions */\n#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION\n#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS\n#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE\n#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES\n#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES\n#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH\n#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT\n#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS\n#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS\n#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE\n#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT\n#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES\n#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES\n#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD\n#define t1_blend_max                  T1_BLEND_MAX\n\n\n  /* maximum number of Multiple Masters designs, as defined in the spec */\n#define T1_MAX_MM_DESIGNS     16\n\n  /* maximum number of Multiple Masters axes, as defined in the spec */\n#define T1_MAX_MM_AXIS        4\n\n  /* maximum number of elements in a design map */\n#define T1_MAX_MM_MAP_POINTS  20\n\n\n  /* this structure is used to store the BlendDesignMap entry for an axis */\n  typedef struct  PS_DesignMap_\n  {\n    FT_Byte    num_points;\n    FT_Long*   design_points;\n    FT_Fixed*  blend_points;\n\n  } PS_DesignMapRec, *PS_DesignMap;\n\n  /* backwards-compatible definition */\n  typedef PS_DesignMapRec  T1_DesignMap;\n\n\n  typedef struct  PS_BlendRec_\n  {\n    FT_UInt          num_designs;\n    FT_UInt          num_axis;\n\n    FT_String*       axis_names[T1_MAX_MM_AXIS];\n    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];\n    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];\n\n    FT_Fixed*        weight_vector;\n    FT_Fixed*        default_weight_vector;\n\n    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];\n    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];\n\n    FT_ULong         blend_bitflags;\n\n    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];\n\n    /* since 2.3.0 */\n\n    /* undocumented, optional: the default design instance;   */\n    /* corresponds to default_weight_vector --                */\n    /* num_default_design_vector == 0 means it is not present */\n    /* in the font and associated metrics files               */\n    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];\n    FT_UInt          num_default_design_vector;\n\n  } PS_BlendRec, *PS_Blend;\n\n\n  /* backwards-compatible definition */\n  typedef PS_BlendRec  T1_Blend;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDictRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent data in a CID top-level dictionary.  */\n  /*                                                                       */\n  typedef struct  CID_FaceDictRec_\n  {\n    PS_PrivateRec  private_dict;\n\n    FT_UInt        len_buildchar;\n    FT_Fixed       forcebold_threshold;\n    FT_Pos         stroke_width;\n    FT_Fixed       expansion_factor;\n\n    FT_Byte        paint_type;\n    FT_Byte        font_type;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n    FT_UInt        num_subrs;\n    FT_ULong       subrmap_offset;\n    FT_Int         sd_bytes;\n\n  } CID_FaceDictRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDict                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceDictRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceDictRec_*  CID_FaceDict;\n\n  /* */\n\n\n  /* backwards-compatible definition */\n  typedef CID_FaceDictRec  CID_FontDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfoRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent CID Face information.                */\n  /*                                                                       */\n  typedef struct  CID_FaceInfoRec_\n  {\n    FT_String*      cid_font_name;\n    FT_Fixed        cid_version;\n    FT_Int          cid_font_type;\n\n    FT_String*      registry;\n    FT_String*      ordering;\n    FT_Int          supplement;\n\n    PS_FontInfoRec  font_info;\n    FT_BBox         font_bbox;\n    FT_ULong        uid_base;\n\n    FT_Int          num_xuid;\n    FT_ULong        xuid[16];\n\n    FT_ULong        cidmap_offset;\n    FT_Int          fd_bytes;\n    FT_Int          gd_bytes;\n    FT_ULong        cid_count;\n\n    FT_Int          num_dicts;\n    CID_FaceDict    font_dicts;\n\n    FT_ULong        data_offset;\n\n  } CID_FaceInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfo                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceInfoRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceInfoRec_*  CID_FaceInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Info                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef CID_FaceInfoRec  CID_Info;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Has_PS_Glyph_Names\n   *\n   * @description:\n   *    Return true if a given face provides reliable PostScript glyph\n   *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,\n   *    except that certain fonts (mostly TrueType) contain incorrect\n   *    glyph name tables.\n   *\n   *    When this function returns true, the caller is sure that the glyph\n   *    names returned by @FT_Get_Glyph_Name are reliable.\n   *\n   * @input:\n   *    face ::\n   *       face handle\n   *\n   * @return:\n   *    Boolean.  True if glyph names are reliable.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Info\n   *\n   * @description:\n   *    Retrieve the @PS_FontInfoRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_info ::\n   *       Output font info structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the font info structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function will\n   *    return the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face      face,\n                       PS_FontInfo  afont_info );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Private\n   *\n   * @description:\n   *    Retrieve the @PS_PrivateRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_private ::\n   *       Output private dictionary structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the @PS_PrivateRec structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face     face,\n                          PS_Private  afont_private );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_EncodingType                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration describing the `Encoding' entry in a Type 1         */\n  /*    dictionary.                                                        */\n  /*                                                                       */\n  typedef enum  T1_EncodingType_\n  {\n    T1_ENCODING_TYPE_NONE = 0,\n    T1_ENCODING_TYPE_ARRAY,\n    T1_ENCODING_TYPE_STANDARD,\n    T1_ENCODING_TYPE_ISOLATIN1,\n    T1_ENCODING_TYPE_EXPERT\n\n  } T1_EncodingType;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    PS_Dict_Keys                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used in calls to @FT_Get_PS_Font_Value to identify  */\n  /*    the Type~1 dictionary entry to retrieve.                           */\n  /*                                                                       */\n  typedef enum  PS_Dict_Keys_\n  {\n    /* conventionally in the font dictionary */\n    PS_DICT_FONT_TYPE,              /* FT_Byte         */\n    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */\n    PS_DICT_FONT_BBOX,              /* FT_Fixed        */\n    PS_DICT_PAINT_TYPE,             /* FT_Byte         */\n    PS_DICT_FONT_NAME,              /* FT_String*      */\n    PS_DICT_UNIQUE_ID,              /* FT_Int          */\n    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */\n    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */\n    PS_DICT_CHAR_STRING,            /* FT_String*      */\n    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */\n    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */\n\n    /* conventionally in the font Private dictionary */\n    PS_DICT_NUM_SUBRS,              /* FT_Int     */\n    PS_DICT_SUBR,                   /* FT_String* */\n    PS_DICT_STD_HW,                 /* FT_UShort  */\n    PS_DICT_STD_VW,                 /* FT_UShort  */\n    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */\n    PS_DICT_BLUE_VALUE,             /* FT_Short   */\n    PS_DICT_BLUE_FUZZ,              /* FT_Int     */\n    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */\n    PS_DICT_OTHER_BLUE,             /* FT_Short   */\n    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */\n    PS_DICT_FAMILY_BLUE,            /* FT_Short   */\n    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */\n    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */\n    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */\n    PS_DICT_BLUE_SHIFT,             /* FT_Int     */\n    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_H,            /* FT_Short   */\n    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_V,            /* FT_Short   */\n    PS_DICT_FORCE_BOLD,             /* FT_Bool    */\n    PS_DICT_RND_STEM_UP,            /* FT_Bool    */\n    PS_DICT_MIN_FEATURE,            /* FT_Short   */\n    PS_DICT_LEN_IV,                 /* FT_Int     */\n    PS_DICT_PASSWORD,               /* FT_Long    */\n    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */\n\n    /* conventionally in the font FontInfo dictionary */\n    PS_DICT_VERSION,                /* FT_String* */\n    PS_DICT_NOTICE,                 /* FT_String* */\n    PS_DICT_FULL_NAME,              /* FT_String* */\n    PS_DICT_FAMILY_NAME,            /* FT_String* */\n    PS_DICT_WEIGHT,                 /* FT_String* */\n    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */\n    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */\n    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */\n    PS_DICT_FS_TYPE,                /* FT_UShort  */\n    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */\n\n    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE\n\n  } PS_Dict_Keys;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Value\n   *\n   * @description:\n   *    Retrieve the value for the supplied key from a PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   *    key ::\n   *       An enumeration value representing the dictionary key to retrieve.\n   *\n   *    idx ::\n   *       For array values, this specifies the index to be returned.\n   *\n   *    value ::\n   *       A pointer to memory into which to write the value.\n   *\n   *    valen_len ::\n   *       The size, in bytes, of the memory supplied for the value.\n   *\n   * @output:\n   *    value ::\n   *       The value matching the above key, if it exists.\n   *\n   * @return:\n   *    The amount of memory (in bytes) required to hold the requested\n   *    value (if it exists, -1 otherwise).\n   *\n   * @note:\n   *    The values returned are not pointers into the internal structures of\n   *    the face, but are `fresh' copies, so that the memory containing them\n   *    belongs to the calling application.  This also enforces the\n   *    `read-only' nature of these values, i.e., this function cannot be\n   *    used to manipulate the face.\n   *\n   *    `value' is a void pointer because the values returned can be of\n   *    various types.\n   *\n   *    If either `value' is NULL or `value_len' is too small, just the\n   *    required memory size for the requested entry is returned.\n   *\n   *    The `idx' parameter is used, not only to retrieve elements of, for\n   *    example, the FontMatrix or FontBBox, but also to retrieve name keys\n   *    from the CharStrings dictionary, and the charstrings themselves.  It\n   *    is ignored for atomic values.\n   *\n   *    PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000.  To\n   *    get the value as in the font stream, you need to divide by\n   *    65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).\n   *\n   *    IMPORTANT: Only key/value pairs read by the FreeType interpreter can\n   *    be retrieved.  So, for example, PostScript procedures such as NP,\n   *    ND, and RD are not available.  Arbitrary keys are, obviously, not be\n   *    available either.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Long )\n  FT_Get_PS_Font_Value( FT_Face       face,\n                        PS_Dict_Keys  key,\n                        FT_UInt       idx,\n                        void         *value,\n                        FT_Long       value_len );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __T1TABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ttnameid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttnameid.h                                                             */\n/*                                                                         */\n/*    TrueType name ID definitions (specification only).                   */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTNAMEID_H__\n#define __TTNAMEID_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values for the `platform' identifier code in the name        */\n  /* records of the TTF `name' table.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_PLATFORM_XXX\n   *\n   * @description:\n   *   A list of valid values for the `platform_id' identifier code in\n   *   @FT_CharMapRec and @FT_SfntName structures.\n   *\n   * @values:\n   *   TT_PLATFORM_APPLE_UNICODE ::\n   *     Used by Apple to indicate a Unicode character map and/or name entry.\n   *     See @TT_APPLE_ID_XXX for corresponding `encoding_id' values.  Note\n   *     that name entries in this format are coded as big-endian UCS-2\n   *     character codes _only_.\n   *\n   *   TT_PLATFORM_MACINTOSH ::\n   *     Used by Apple to indicate a MacOS-specific charmap and/or name entry.\n   *     See @TT_MAC_ID_XXX for corresponding `encoding_id' values.  Note that\n   *     most TrueType fonts contain an Apple roman charmap to be usable on\n   *     MacOS systems (even if they contain a Microsoft charmap as well).\n   *\n   *   TT_PLATFORM_ISO ::\n   *     This value was used to specify ISO/IEC 10646 charmaps.  It is however\n   *     now deprecated.  See @TT_ISO_ID_XXX for a list of corresponding\n   *     `encoding_id' values.\n   *\n   *   TT_PLATFORM_MICROSOFT ::\n   *     Used by Microsoft to indicate Windows-specific charmaps.  See\n   *     @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.\n   *     Note that most fonts contain a Unicode charmap using\n   *     (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).\n   *\n   *   TT_PLATFORM_CUSTOM ::\n   *     Used to indicate application-specific charmaps.\n   *\n   *   TT_PLATFORM_ADOBE ::\n   *     This value isn't part of any font format specification, but is used\n   *     by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec\n   *     structure.  See @TT_ADOBE_ID_XXX.\n   */\n\n#define TT_PLATFORM_APPLE_UNICODE  0\n#define TT_PLATFORM_MACINTOSH      1\n#define TT_PLATFORM_ISO            2 /* deprecated */\n#define TT_PLATFORM_MICROSOFT      3\n#define TT_PLATFORM_CUSTOM         4\n#define TT_PLATFORM_ADOBE          7 /* artificial */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_APPLE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.\n   *\n   * @values:\n   *   TT_APPLE_ID_DEFAULT ::\n   *     Unicode version 1.0.\n   *\n   *   TT_APPLE_ID_UNICODE_1_1 ::\n   *     Unicode 1.1; specifies Hangul characters starting at U+34xx.\n   *\n   *   TT_APPLE_ID_ISO_10646 ::\n   *     Deprecated (identical to preceding).\n   *\n   *   TT_APPLE_ID_UNICODE_2_0 ::\n   *     Unicode 2.0 and beyond (UTF-16 BMP only).\n   *\n   *   TT_APPLE_ID_UNICODE_32 ::\n   *     Unicode 3.1 and beyond, using UTF-32.\n   *\n   *   TT_APPLE_ID_VARIANT_SELECTOR ::\n   *     From Adobe, not Apple.  Not a normal cmap.  Specifies variations\n   *     on a real cmap.\n   */\n\n#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */\n#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */\n#define TT_APPLE_ID_ISO_10646         2 /* deprecated */\n#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */\n#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */\n#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MAC_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MACINTOSH charmaps and name entries.\n   *\n   * @values:\n   *   TT_MAC_ID_ROMAN ::\n   *   TT_MAC_ID_JAPANESE ::\n   *   TT_MAC_ID_TRADITIONAL_CHINESE ::\n   *   TT_MAC_ID_KOREAN ::\n   *   TT_MAC_ID_ARABIC ::\n   *   TT_MAC_ID_HEBREW ::\n   *   TT_MAC_ID_GREEK ::\n   *   TT_MAC_ID_RUSSIAN ::\n   *   TT_MAC_ID_RSYMBOL ::\n   *   TT_MAC_ID_DEVANAGARI ::\n   *   TT_MAC_ID_GURMUKHI ::\n   *   TT_MAC_ID_GUJARATI ::\n   *   TT_MAC_ID_ORIYA ::\n   *   TT_MAC_ID_BENGALI ::\n   *   TT_MAC_ID_TAMIL ::\n   *   TT_MAC_ID_TELUGU ::\n   *   TT_MAC_ID_KANNADA ::\n   *   TT_MAC_ID_MALAYALAM ::\n   *   TT_MAC_ID_SINHALESE ::\n   *   TT_MAC_ID_BURMESE ::\n   *   TT_MAC_ID_KHMER ::\n   *   TT_MAC_ID_THAI ::\n   *   TT_MAC_ID_LAOTIAN ::\n   *   TT_MAC_ID_GEORGIAN ::\n   *   TT_MAC_ID_ARMENIAN ::\n   *   TT_MAC_ID_MALDIVIAN ::\n   *   TT_MAC_ID_SIMPLIFIED_CHINESE ::\n   *   TT_MAC_ID_TIBETAN ::\n   *   TT_MAC_ID_MONGOLIAN ::\n   *   TT_MAC_ID_GEEZ ::\n   *   TT_MAC_ID_SLAVIC ::\n   *   TT_MAC_ID_VIETNAMESE ::\n   *   TT_MAC_ID_SINDHI ::\n   *   TT_MAC_ID_UNINTERP ::\n   */\n\n#define TT_MAC_ID_ROMAN                 0\n#define TT_MAC_ID_JAPANESE              1\n#define TT_MAC_ID_TRADITIONAL_CHINESE   2\n#define TT_MAC_ID_KOREAN                3\n#define TT_MAC_ID_ARABIC                4\n#define TT_MAC_ID_HEBREW                5\n#define TT_MAC_ID_GREEK                 6\n#define TT_MAC_ID_RUSSIAN               7\n#define TT_MAC_ID_RSYMBOL               8\n#define TT_MAC_ID_DEVANAGARI            9\n#define TT_MAC_ID_GURMUKHI             10\n#define TT_MAC_ID_GUJARATI             11\n#define TT_MAC_ID_ORIYA                12\n#define TT_MAC_ID_BENGALI              13\n#define TT_MAC_ID_TAMIL                14\n#define TT_MAC_ID_TELUGU               15\n#define TT_MAC_ID_KANNADA              16\n#define TT_MAC_ID_MALAYALAM            17\n#define TT_MAC_ID_SINHALESE            18\n#define TT_MAC_ID_BURMESE              19\n#define TT_MAC_ID_KHMER                20\n#define TT_MAC_ID_THAI                 21\n#define TT_MAC_ID_LAOTIAN              22\n#define TT_MAC_ID_GEORGIAN             23\n#define TT_MAC_ID_ARMENIAN             24\n#define TT_MAC_ID_MALDIVIAN            25\n#define TT_MAC_ID_SIMPLIFIED_CHINESE   25\n#define TT_MAC_ID_TIBETAN              26\n#define TT_MAC_ID_MONGOLIAN            27\n#define TT_MAC_ID_GEEZ                 28\n#define TT_MAC_ID_SLAVIC               29\n#define TT_MAC_ID_VIETNAMESE           30\n#define TT_MAC_ID_SINDHI               31\n#define TT_MAC_ID_UNINTERP             32\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ISO_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ISO charmaps and name entries.\n   *\n   *   Their use is now deprecated.\n   *\n   * @values:\n   *   TT_ISO_ID_7BIT_ASCII ::\n   *     ASCII.\n   *   TT_ISO_ID_10646 ::\n   *     ISO/10646.\n   *   TT_ISO_ID_8859_1 ::\n   *     Also known as Latin-1.\n   */\n\n#define TT_ISO_ID_7BIT_ASCII  0\n#define TT_ISO_ID_10646       1\n#define TT_ISO_ID_8859_1      2\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MS_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MICROSOFT charmaps and name entries.\n   *\n   * @values:\n   *   TT_MS_ID_SYMBOL_CS ::\n   *     Corresponds to Microsoft symbol encoding. See\n   *     @FT_ENCODING_MS_SYMBOL.\n   *\n   *   TT_MS_ID_UNICODE_CS ::\n   *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See\n   *     @FT_ENCODING_UNICODE.\n   *\n   *   TT_MS_ID_SJIS ::\n   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.\n   *\n   *   TT_MS_ID_GB2312 ::\n   *     Corresponds to Simplified Chinese as used in Mainland China.  See\n   *     @FT_ENCODING_GB2312.\n   *\n   *   TT_MS_ID_BIG_5 ::\n   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.\n   *     See @FT_ENCODING_BIG5.\n   *\n   *   TT_MS_ID_WANSUNG ::\n   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.\n   *\n   *   TT_MS_ID_JOHAB ::\n   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.\n   *\n   *   TT_MS_ID_UCS_4 ::\n   *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to\n   *     the OpenType specification version 1.4 (mid-2001.)\n   */\n\n#define TT_MS_ID_SYMBOL_CS    0\n#define TT_MS_ID_UNICODE_CS   1\n#define TT_MS_ID_SJIS         2\n#define TT_MS_ID_GB2312       3\n#define TT_MS_ID_BIG_5        4\n#define TT_MS_ID_WANSUNG      5\n#define TT_MS_ID_JOHAB        6\n#define TT_MS_ID_UCS_4       10\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ADOBE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ADOBE charmaps.  This is a FreeType-specific extension!\n   *\n   * @values:\n   *   TT_ADOBE_ID_STANDARD ::\n   *     Adobe standard encoding.\n   *   TT_ADOBE_ID_EXPERT ::\n   *     Adobe expert encoding.\n   *   TT_ADOBE_ID_CUSTOM ::\n   *     Adobe custom encoding.\n   *   TT_ADOBE_ID_LATIN_1 ::\n   *     Adobe Latin~1 encoding.\n   */\n\n#define TT_ADOBE_ID_STANDARD  0\n#define TT_ADOBE_ID_EXPERT    1\n#define TT_ADOBE_ID_CUSTOM    2\n#define TT_ADOBE_ID_LATIN_1   3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MACINTOSH.  These values are also used as return values   */\n  /* for function @FT_Get_CMap_Language_ID.                                */\n  /*                                                                       */\n  /* The canonical source for the Apple assigned Language ID's is at       */\n  /*                                                                       */\n  /*   https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html      */\n  /*                                                                       */\n#define TT_MAC_LANGID_ENGLISH                       0\n#define TT_MAC_LANGID_FRENCH                        1\n#define TT_MAC_LANGID_GERMAN                        2\n#define TT_MAC_LANGID_ITALIAN                       3\n#define TT_MAC_LANGID_DUTCH                         4\n#define TT_MAC_LANGID_SWEDISH                       5\n#define TT_MAC_LANGID_SPANISH                       6\n#define TT_MAC_LANGID_DANISH                        7\n#define TT_MAC_LANGID_PORTUGUESE                    8\n#define TT_MAC_LANGID_NORWEGIAN                     9\n#define TT_MAC_LANGID_HEBREW                       10\n#define TT_MAC_LANGID_JAPANESE                     11\n#define TT_MAC_LANGID_ARABIC                       12\n#define TT_MAC_LANGID_FINNISH                      13\n#define TT_MAC_LANGID_GREEK                        14\n#define TT_MAC_LANGID_ICELANDIC                    15\n#define TT_MAC_LANGID_MALTESE                      16\n#define TT_MAC_LANGID_TURKISH                      17\n#define TT_MAC_LANGID_CROATIAN                     18\n#define TT_MAC_LANGID_CHINESE_TRADITIONAL          19\n#define TT_MAC_LANGID_URDU                         20\n#define TT_MAC_LANGID_HINDI                        21\n#define TT_MAC_LANGID_THAI                         22\n#define TT_MAC_LANGID_KOREAN                       23\n#define TT_MAC_LANGID_LITHUANIAN                   24\n#define TT_MAC_LANGID_POLISH                       25\n#define TT_MAC_LANGID_HUNGARIAN                    26\n#define TT_MAC_LANGID_ESTONIAN                     27\n#define TT_MAC_LANGID_LETTISH                      28\n#define TT_MAC_LANGID_SAAMISK                      29\n#define TT_MAC_LANGID_FAEROESE                     30\n#define TT_MAC_LANGID_FARSI                        31\n#define TT_MAC_LANGID_RUSSIAN                      32\n#define TT_MAC_LANGID_CHINESE_SIMPLIFIED           33\n#define TT_MAC_LANGID_FLEMISH                      34\n#define TT_MAC_LANGID_IRISH                        35\n#define TT_MAC_LANGID_ALBANIAN                     36\n#define TT_MAC_LANGID_ROMANIAN                     37\n#define TT_MAC_LANGID_CZECH                        38\n#define TT_MAC_LANGID_SLOVAK                       39\n#define TT_MAC_LANGID_SLOVENIAN                    40\n#define TT_MAC_LANGID_YIDDISH                      41\n#define TT_MAC_LANGID_SERBIAN                      42\n#define TT_MAC_LANGID_MACEDONIAN                   43\n#define TT_MAC_LANGID_BULGARIAN                    44\n#define TT_MAC_LANGID_UKRAINIAN                    45\n#define TT_MAC_LANGID_BYELORUSSIAN                 46\n#define TT_MAC_LANGID_UZBEK                        47\n#define TT_MAC_LANGID_KAZAKH                       48\n#define TT_MAC_LANGID_AZERBAIJANI                  49\n#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT  49\n#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT    50\n#define TT_MAC_LANGID_ARMENIAN                     51\n#define TT_MAC_LANGID_GEORGIAN                     52\n#define TT_MAC_LANGID_MOLDAVIAN                    53\n#define TT_MAC_LANGID_KIRGHIZ                      54\n#define TT_MAC_LANGID_TAJIKI                       55\n#define TT_MAC_LANGID_TURKMEN                      56\n#define TT_MAC_LANGID_MONGOLIAN                    57\n#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT   57\n#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT    58\n#define TT_MAC_LANGID_PASHTO                       59\n#define TT_MAC_LANGID_KURDISH                      60\n#define TT_MAC_LANGID_KASHMIRI                     61\n#define TT_MAC_LANGID_SINDHI                       62\n#define TT_MAC_LANGID_TIBETAN                      63\n#define TT_MAC_LANGID_NEPALI                       64\n#define TT_MAC_LANGID_SANSKRIT                     65\n#define TT_MAC_LANGID_MARATHI                      66\n#define TT_MAC_LANGID_BENGALI                      67\n#define TT_MAC_LANGID_ASSAMESE                     68\n#define TT_MAC_LANGID_GUJARATI                     69\n#define TT_MAC_LANGID_PUNJABI                      70\n#define TT_MAC_LANGID_ORIYA                        71\n#define TT_MAC_LANGID_MALAYALAM                    72\n#define TT_MAC_LANGID_KANNADA                      73\n#define TT_MAC_LANGID_TAMIL                        74\n#define TT_MAC_LANGID_TELUGU                       75\n#define TT_MAC_LANGID_SINHALESE                    76\n#define TT_MAC_LANGID_BURMESE                      77\n#define TT_MAC_LANGID_KHMER                        78\n#define TT_MAC_LANGID_LAO                          79\n#define TT_MAC_LANGID_VIETNAMESE                   80\n#define TT_MAC_LANGID_INDONESIAN                   81\n#define TT_MAC_LANGID_TAGALOG                      82\n#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT           83\n#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT          84\n#define TT_MAC_LANGID_AMHARIC                      85\n#define TT_MAC_LANGID_TIGRINYA                     86\n#define TT_MAC_LANGID_GALLA                        87\n#define TT_MAC_LANGID_SOMALI                       88\n#define TT_MAC_LANGID_SWAHILI                      89\n#define TT_MAC_LANGID_RUANDA                       90\n#define TT_MAC_LANGID_RUNDI                        91\n#define TT_MAC_LANGID_CHEWA                        92\n#define TT_MAC_LANGID_MALAGASY                     93\n#define TT_MAC_LANGID_ESPERANTO                    94\n#define TT_MAC_LANGID_WELSH                       128\n#define TT_MAC_LANGID_BASQUE                      129\n#define TT_MAC_LANGID_CATALAN                     130\n#define TT_MAC_LANGID_LATIN                       131\n#define TT_MAC_LANGID_QUECHUA                     132\n#define TT_MAC_LANGID_GUARANI                     133\n#define TT_MAC_LANGID_AYMARA                      134\n#define TT_MAC_LANGID_TATAR                       135\n#define TT_MAC_LANGID_UIGHUR                      136\n#define TT_MAC_LANGID_DZONGKHA                    137\n#define TT_MAC_LANGID_JAVANESE                    138\n#define TT_MAC_LANGID_SUNDANESE                   139\n\n\n#if 0  /* these seem to be errors that have been dropped */\n\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             140\n#define TT_MAC_LANGID_IRISH_GAELIC                141\n\n#endif\n\n\n  /* The following codes are new as of 2000-03-10 */\n#define TT_MAC_LANGID_GALICIAN                    140\n#define TT_MAC_LANGID_AFRIKAANS                   141\n#define TT_MAC_LANGID_BRETON                      142\n#define TT_MAC_LANGID_INUKTITUT                   143\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             144\n#define TT_MAC_LANGID_MANX_GAELIC                 145\n#define TT_MAC_LANGID_IRISH_GAELIC                146\n#define TT_MAC_LANGID_TONGAN                      147\n#define TT_MAC_LANGID_GREEK_POLYTONIC             148\n#define TT_MAC_LANGID_GREELANDIC                  149\n#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT    150\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MICROSOFT.                                                */\n  /*                                                                       */\n  /* The canonical source for the MS assigned LCIDs is                     */\n  /*                                                                       */\n  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */\n  /*                                                                       */\n\n#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001\n#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401\n#define TT_MS_LANGID_ARABIC_IRAQ                       0x0801\n#define TT_MS_LANGID_ARABIC_EGYPT                      0x0c01\n#define TT_MS_LANGID_ARABIC_LIBYA                      0x1001\n#define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401\n#define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801\n#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1c01\n#define TT_MS_LANGID_ARABIC_OMAN                       0x2001\n#define TT_MS_LANGID_ARABIC_YEMEN                      0x2401\n#define TT_MS_LANGID_ARABIC_SYRIA                      0x2801\n#define TT_MS_LANGID_ARABIC_JORDAN                     0x2c01\n#define TT_MS_LANGID_ARABIC_LEBANON                    0x3001\n#define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401\n#define TT_MS_LANGID_ARABIC_UAE                        0x3801\n#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3c01\n#define TT_MS_LANGID_ARABIC_QATAR                      0x4001\n#define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402\n#define TT_MS_LANGID_CATALAN_SPAIN                     0x0403\n#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004\n#define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404\n#define TT_MS_LANGID_CHINESE_PRC                       0x0804\n#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0c04\n#define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004\n\n#if 1  /* this looks like the correct value */\n#define TT_MS_LANGID_CHINESE_MACAU                     0x1404\n#else  /* but beware, Microsoft may change its mind...\n          the most recent Word reference has the following: */\n#define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG\n#endif\n\n#if 0  /* used only with .NET `cultures'; commented out */\n#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04\n#endif\n\n#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405\n#define TT_MS_LANGID_DANISH_DENMARK                    0x0406\n#define TT_MS_LANGID_GERMAN_GERMANY                    0x0407\n#define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807\n#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0c07\n#define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007\n#define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407\n#define TT_MS_LANGID_GREEK_GREECE                      0x0408\n\n  /* don't ask what this one means... It is commented out currently. */\n#if 0\n#define TT_MS_LANGID_GREEK_GREECE2                     0x2008\n#endif\n\n#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009\n#define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409\n#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809\n#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0c09\n#define TT_MS_LANGID_ENGLISH_CANADA                    0x1009\n#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409\n#define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809\n#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1c09\n#define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009\n#define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409\n#define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809\n#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2c09\n#define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009\n#define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409\n#define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809\n#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3c09\n#define TT_MS_LANGID_ENGLISH_INDIA                     0x4009\n#define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409\n#define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809\n#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040a\n#define TT_MS_LANGID_SPANISH_MEXICO                    0x080a\n#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0c0a\n#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100a\n#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140a\n#define TT_MS_LANGID_SPANISH_PANAMA                    0x180a\n#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1c0a\n#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200a\n#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240a\n#define TT_MS_LANGID_SPANISH_PERU                      0x280a\n#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2c0a\n#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300a\n#define TT_MS_LANGID_SPANISH_CHILE                     0x340a\n#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380a\n#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3c0a\n#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400a\n#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440a\n#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480a\n#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4c0a\n#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500a\n#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a\n  /* The following ID blatantly violate MS specs by using a */\n  /* sublanguage > 0x1F.                                    */\n#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU\n#define TT_MS_LANGID_FINNISH_FINLAND                   0x040b\n#define TT_MS_LANGID_FRENCH_FRANCE                     0x040c\n#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080c\n#define TT_MS_LANGID_FRENCH_CANADA                     0x0c0c\n#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100c\n#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140c\n#define TT_MS_LANGID_FRENCH_MONACO                     0x180c\n#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1c0c\n#define TT_MS_LANGID_FRENCH_REUNION                    0x200c\n#define TT_MS_LANGID_FRENCH_CONGO                      0x240c\n  /* which was formerly: */\n#define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO\n#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280c\n#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2c0c\n#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300c\n#define TT_MS_LANGID_FRENCH_MALI                       0x340c\n#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c\n#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c\n  /* and another violation of the spec (see 0xE40aU) */\n#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU\n#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040d\n#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040e\n#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040f\n#define TT_MS_LANGID_ITALIAN_ITALY                     0x0410\n#define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810\n#define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411\n#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA     0x0412\n#define TT_MS_LANGID_KOREAN_JOHAB_KOREA                0x0812\n#define TT_MS_LANGID_DUTCH_NETHERLANDS                 0x0413\n#define TT_MS_LANGID_DUTCH_BELGIUM                     0x0813\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL           0x0414\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK          0x0814\n#define TT_MS_LANGID_POLISH_POLAND                     0x0415\n#define TT_MS_LANGID_PORTUGUESE_BRAZIL                 0x0416\n#define TT_MS_LANGID_PORTUGUESE_PORTUGAL               0x0816\n#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND        0x0417\n#define TT_MS_LANGID_ROMANIAN_ROMANIA                  0x0418\n#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818\n#define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419\n#define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819\n#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041a\n#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081a\n#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0c1a\n\n#if 0  /* this used to be this value, but it looks like we were wrong */\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a\n#else  /* current sources say */\n#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101a\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141a\n       /* and XPsp2 Platform SDK added (2004-07-26) */\n       /* Names are shortened to be significant within 40 chars. */\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181a\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181a\n#endif\n\n#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041b\n#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041c\n#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041d\n#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081d\n#define TT_MS_LANGID_THAI_THAILAND                     0x041e\n#define TT_MS_LANGID_TURKISH_TURKEY                    0x041f\n#define TT_MS_LANGID_URDU_PAKISTAN                     0x0420\n#define TT_MS_LANGID_URDU_INDIA                        0x0820\n#define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421\n#define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422\n#define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423\n#define TT_MS_LANGID_SLOVENE_SLOVENIA                  0x0424\n#define TT_MS_LANGID_ESTONIAN_ESTONIA                  0x0425\n#define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426\n#define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427\n#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827\n#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428\n#define TT_MS_LANGID_FARSI_IRAN                        0x0429\n#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042a\n#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042b\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042c\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082c\n#define TT_MS_LANGID_BASQUE_SPAIN                      0x042d\n#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042e\n#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042f\n#define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430\n#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431\n#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432\n#define TT_MS_LANGID_VENDA_SOUTH_AFRICA                0x0433\n#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA                0x0434\n#define TT_MS_LANGID_ZULU_SOUTH_AFRICA                 0x0435\n#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA            0x0436\n#define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437\n#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438\n#define TT_MS_LANGID_HINDI_INDIA                       0x0439\n#define TT_MS_LANGID_MALTESE_MALTA                     0x043a\n  /* Added by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043b\n#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083b\n#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3b\n#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103b\n#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143b\n#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183b\n#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3b\n#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203b\n#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243b\n  /* ... and we also keep our old identifier... */\n#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b\n\n#if 0 /* this seems to be a previous inversion */\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#else\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#endif\n\n#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d\n#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043e\n#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083e\n#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043f\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \\\n          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN\n\n#define TT_MS_LANGID_SWAHILI_KENYA                     0x0441\n#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843\n#define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444\n#define TT_MS_LANGID_BENGALI_INDIA                     0x0445\n#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845\n#define TT_MS_LANGID_PUNJABI_INDIA                     0x0446\n#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846\n#define TT_MS_LANGID_GUJARATI_INDIA                    0x0447\n#define TT_MS_LANGID_ORIYA_INDIA                       0x0448\n#define TT_MS_LANGID_TAMIL_INDIA                       0x0449\n#define TT_MS_LANGID_TELUGU_INDIA                      0x044a\n#define TT_MS_LANGID_KANNADA_INDIA                     0x044b\n#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044c\n#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044d\n#define TT_MS_LANGID_MARATHI_INDIA                     0x044e\n#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044f\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850\n#define TT_MS_LANGID_TIBETAN_CHINA                     0x0451\n  /* Don't use the next constant!  It has            */\n  /*   (1) the wrong spelling (Dzonghka)             */\n  /*   (2) Microsoft doesn't officially define it -- */\n  /*       at least it is not in the List of Local   */\n  /*       ID Values.                                */\n  /*   (3) Dzongkha is not the same language as      */\n  /*       Tibetan, so merging it is wrong anyway.   */\n  /*                                                 */\n  /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW.    */\n#define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851\n\n#if 0\n  /* the following used to be defined */\n#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451\n  /* ... but it was changed; */\n#else\n  /* So we will continue to #define it, but with the correct value */\n#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN\n#endif\n\n#define TT_MS_LANGID_WELSH_WALES                       0x0452\n#define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453\n#define TT_MS_LANGID_LAO_LAOS                          0x0454\n#define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455\n#define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456\n#define TT_MS_LANGID_KONKANI_INDIA                     0x0457\n#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458\n#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459\n#define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859\n  /* Missing a LCID for Sindhi in Devanagari script */\n#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045a\n#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045b\n#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045c\n#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045d\n#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045e\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045f\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085f\n  /* Missing a LCID for Tifinagh script */\n#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460\n  /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */\n  /* script is yet unclear... might be Arabic, Nagari or Sharada */\n#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860\n  /* ... and aliased (by MS) for compatibility reasons. */\n#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA\n#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461\n#define TT_MS_LANGID_NEPALI_INDIA                      0x0861\n#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462\n#define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463\n#define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464\n#define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES\n#define TT_MS_LANGID_EDO_NIGERIA                       0x0466\n#define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467\n#define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468\n#define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469\n#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046a\n#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046b\n#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086b\n#define TT_MS_LANGID_QUECHUA_PERU                      0x0c6b\n#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046c\n  /* Also spelled by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \\\n          TT_MS_LANGID_SEPEDI_SOUTH_AFRICA\n  /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */\n#define TT_MS_LANGID_IGBO_NIGERIA                      0x0470\n#define TT_MS_LANGID_KANURI_NIGERIA                    0x0471\n#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472\n#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473\n#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873\n  /* also spelled in the `Passport SDK' list as: */\n#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA\n#define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474\n#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475\n#define TT_MS_LANGID_LATIN                             0x0476\n#define TT_MS_LANGID_SOMALI_SOMALIA                    0x0477\n  /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */\n  /*       not written (but OTOH the peculiar writing system is worth     */\n  /*       studying).                                                     */\n#define TT_MS_LANGID_YI_CHINA                          0x0478\n#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479\n  /* language codes from 0x047a to 0x047f are (still) unknown. */\n#define TT_MS_LANGID_UIGHUR_CHINA                      0x0480\n#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481\n\n#if 0  /* not deemed useful for fonts */\n#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04ff\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the `name' identifier field in the name records of */\n  /* the TTF `name' table.  These values are platform independent.         */\n  /*                                                                       */\n#define TT_NAME_ID_COPYRIGHT            0\n#define TT_NAME_ID_FONT_FAMILY          1\n#define TT_NAME_ID_FONT_SUBFAMILY       2\n#define TT_NAME_ID_UNIQUE_ID            3\n#define TT_NAME_ID_FULL_NAME            4\n#define TT_NAME_ID_VERSION_STRING       5\n#define TT_NAME_ID_PS_NAME              6\n#define TT_NAME_ID_TRADEMARK            7\n\n  /* the following values are from the OpenType spec */\n#define TT_NAME_ID_MANUFACTURER         8\n#define TT_NAME_ID_DESIGNER             9\n#define TT_NAME_ID_DESCRIPTION          10\n#define TT_NAME_ID_VENDOR_URL           11\n#define TT_NAME_ID_DESIGNER_URL         12\n#define TT_NAME_ID_LICENSE              13\n#define TT_NAME_ID_LICENSE_URL          14\n  /* number 15 is reserved */\n#define TT_NAME_ID_PREFERRED_FAMILY     16\n#define TT_NAME_ID_PREFERRED_SUBFAMILY  17\n#define TT_NAME_ID_MAC_FULL_NAME        18\n\n  /* The following code is new as of 2000-01-21 */\n#define TT_NAME_ID_SAMPLE_TEXT          19\n\n  /* This is new in OpenType 1.3 */\n#define TT_NAME_ID_CID_FINDFONT_NAME    20\n\n  /* This is new in OpenType 1.5 */\n#define TT_NAME_ID_WWS_FAMILY           21\n#define TT_NAME_ID_WWS_SUBFAMILY        22\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table.     */\n  /*                                                                       */\n  /* Updated 08-Nov-2008.                                                  */\n  /*                                                                       */\n\n  /* Bit  0   Basic Latin */\n#define TT_UCR_BASIC_LATIN                     (1L <<  0) /* U+0020-U+007E */\n  /* Bit  1   C1 Controls and Latin-1 Supplement */\n#define TT_UCR_LATIN1_SUPPLEMENT               (1L <<  1) /* U+0080-U+00FF */\n  /* Bit  2   Latin Extended-A */\n#define TT_UCR_LATIN_EXTENDED_A                (1L <<  2) /* U+0100-U+017F */\n  /* Bit  3   Latin Extended-B */\n#define TT_UCR_LATIN_EXTENDED_B                (1L <<  3) /* U+0180-U+024F */\n  /* Bit  4   IPA Extensions                 */\n  /*          Phonetic Extensions            */\n  /*          Phonetic Extensions Supplement */\n#define TT_UCR_IPA_EXTENSIONS                  (1L <<  4) /* U+0250-U+02AF */\n                                                          /* U+1D00-U+1D7F */\n                                                          /* U+1D80-U+1DBF */\n  /* Bit  5   Spacing Modifier Letters */\n  /*          Modifier Tone Letters    */\n#define TT_UCR_SPACING_MODIFIER                (1L <<  5) /* U+02B0-U+02FF */\n                                                          /* U+A700-U+A71F */\n  /* Bit  6   Combining Diacritical Marks            */\n  /*          Combining Diacritical Marks Supplement */\n#define TT_UCR_COMBINING_DIACRITICS            (1L <<  6) /* U+0300-U+036F */\n                                                          /* U+1DC0-U+1DFF */\n  /* Bit  7   Greek and Coptic */\n#define TT_UCR_GREEK                           (1L <<  7) /* U+0370-U+03FF */\n  /* Bit  8   Coptic */\n#define TT_UCR_COPTIC                          (1L <<  8) /* U+2C80-U+2CFF */\n  /* Bit  9   Cyrillic            */\n  /*          Cyrillic Supplement */\n  /*          Cyrillic Extended-A */\n  /*          Cyrillic Extended-B */\n#define TT_UCR_CYRILLIC                        (1L <<  9) /* U+0400-U+04FF */\n                                                          /* U+0500-U+052F */\n                                                          /* U+2DE0-U+2DFF */\n                                                          /* U+A640-U+A69F */\n  /* Bit 10   Armenian */\n#define TT_UCR_ARMENIAN                        (1L << 10) /* U+0530-U+058F */\n  /* Bit 11   Hebrew */\n#define TT_UCR_HEBREW                          (1L << 11) /* U+0590-U+05FF */\n  /* Bit 12   Vai */\n#define TT_UCR_VAI                             (1L << 12) /* U+A500-U+A63F */\n  /* Bit 13   Arabic            */\n  /*          Arabic Supplement */\n#define TT_UCR_ARABIC                          (1L << 13) /* U+0600-U+06FF */\n                                                          /* U+0750-U+077F */\n  /* Bit 14   NKo */\n#define TT_UCR_NKO                             (1L << 14) /* U+07C0-U+07FF */\n  /* Bit 15   Devanagari */\n#define TT_UCR_DEVANAGARI                      (1L << 15) /* U+0900-U+097F */\n  /* Bit 16   Bengali */\n#define TT_UCR_BENGALI                         (1L << 16) /* U+0980-U+09FF */\n  /* Bit 17   Gurmukhi */\n#define TT_UCR_GURMUKHI                        (1L << 17) /* U+0A00-U+0A7F */\n  /* Bit 18   Gujarati */\n#define TT_UCR_GUJARATI                        (1L << 18) /* U+0A80-U+0AFF */\n  /* Bit 19   Oriya */\n#define TT_UCR_ORIYA                           (1L << 19) /* U+0B00-U+0B7F */\n  /* Bit 20   Tamil */\n#define TT_UCR_TAMIL                           (1L << 20) /* U+0B80-U+0BFF */\n  /* Bit 21   Telugu */\n#define TT_UCR_TELUGU                          (1L << 21) /* U+0C00-U+0C7F */\n  /* Bit 22   Kannada */\n#define TT_UCR_KANNADA                         (1L << 22) /* U+0C80-U+0CFF */\n  /* Bit 23   Malayalam */\n#define TT_UCR_MALAYALAM                       (1L << 23) /* U+0D00-U+0D7F */\n  /* Bit 24   Thai */\n#define TT_UCR_THAI                            (1L << 24) /* U+0E00-U+0E7F */\n  /* Bit 25   Lao */\n#define TT_UCR_LAO                             (1L << 25) /* U+0E80-U+0EFF */\n  /* Bit 26   Georgian            */\n  /*          Georgian Supplement */\n#define TT_UCR_GEORGIAN                        (1L << 26) /* U+10A0-U+10FF */\n                                                          /* U+2D00-U+2D2F */\n  /* Bit 27   Balinese */\n#define TT_UCR_BALINESE                        (1L << 27) /* U+1B00-U+1B7F */\n  /* Bit 28   Hangul Jamo */\n#define TT_UCR_HANGUL_JAMO                     (1L << 28) /* U+1100-U+11FF */\n  /* Bit 29   Latin Extended Additional */\n  /*          Latin Extended-C          */\n  /*          Latin Extended-D          */\n#define TT_UCR_LATIN_EXTENDED_ADDITIONAL       (1L << 29) /* U+1E00-U+1EFF */\n                                                          /* U+2C60-U+2C7F */\n                                                          /* U+A720-U+A7FF */\n  /* Bit 30   Greek Extended */\n#define TT_UCR_GREEK_EXTENDED                  (1L << 30) /* U+1F00-U+1FFF */\n  /* Bit 31   General Punctuation      */\n  /*          Supplemental Punctuation */\n#define TT_UCR_GENERAL_PUNCTUATION             (1L << 31) /* U+2000-U+206F */\n                                                          /* U+2E00-U+2E7F */\n  /* Bit 32   Superscripts And Subscripts */\n#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS         (1L <<  0) /* U+2070-U+209F */\n  /* Bit 33   Currency Symbols */\n#define TT_UCR_CURRENCY_SYMBOLS                (1L <<  1) /* U+20A0-U+20CF */\n  /* Bit 34   Combining Diacritical Marks For Symbols */\n#define TT_UCR_COMBINING_DIACRITICS_SYMB       (1L <<  2) /* U+20D0-U+20FF */\n  /* Bit 35   Letterlike Symbols */\n#define TT_UCR_LETTERLIKE_SYMBOLS              (1L <<  3) /* U+2100-U+214F */\n  /* Bit 36   Number Forms */\n#define TT_UCR_NUMBER_FORMS                    (1L <<  4) /* U+2150-U+218F */\n  /* Bit 37   Arrows                           */\n  /*          Supplemental Arrows-A            */\n  /*          Supplemental Arrows-B            */\n  /*          Miscellaneous Symbols and Arrows */\n#define TT_UCR_ARROWS                          (1L <<  5) /* U+2190-U+21FF */\n                                                          /* U+27F0-U+27FF */\n                                                          /* U+2900-U+297F */\n                                                          /* U+2B00-U+2BFF */\n  /* Bit 38   Mathematical Operators               */\n  /*          Supplemental Mathematical Operators  */\n  /*          Miscellaneous Mathematical Symbols-A */\n  /*          Miscellaneous Mathematical Symbols-B */\n#define TT_UCR_MATHEMATICAL_OPERATORS          (1L <<  6) /* U+2200-U+22FF */\n                                                          /* U+2A00-U+2AFF */\n                                                          /* U+27C0-U+27EF */\n                                                          /* U+2980-U+29FF */\n  /* Bit 39 Miscellaneous Technical */\n#define TT_UCR_MISCELLANEOUS_TECHNICAL         (1L <<  7) /* U+2300-U+23FF */\n  /* Bit 40   Control Pictures */\n#define TT_UCR_CONTROL_PICTURES                (1L <<  8) /* U+2400-U+243F */\n  /* Bit 41   Optical Character Recognition */\n#define TT_UCR_OCR                             (1L <<  9) /* U+2440-U+245F */\n  /* Bit 42   Enclosed Alphanumerics */\n#define TT_UCR_ENCLOSED_ALPHANUMERICS          (1L << 10) /* U+2460-U+24FF */\n  /* Bit 43   Box Drawing */\n#define TT_UCR_BOX_DRAWING                     (1L << 11) /* U+2500-U+257F */\n  /* Bit 44   Block Elements */\n#define TT_UCR_BLOCK_ELEMENTS                  (1L << 12) /* U+2580-U+259F */\n  /* Bit 45   Geometric Shapes */\n#define TT_UCR_GEOMETRIC_SHAPES                (1L << 13) /* U+25A0-U+25FF */\n  /* Bit 46   Miscellaneous Symbols */\n#define TT_UCR_MISCELLANEOUS_SYMBOLS           (1L << 14) /* U+2600-U+26FF */\n  /* Bit 47   Dingbats */\n#define TT_UCR_DINGBATS                        (1L << 15) /* U+2700-U+27BF */\n  /* Bit 48   CJK Symbols and Punctuation */\n#define TT_UCR_CJK_SYMBOLS                     (1L << 16) /* U+3000-U+303F */\n  /* Bit 49   Hiragana */\n#define TT_UCR_HIRAGANA                        (1L << 17) /* U+3040-U+309F */\n  /* Bit 50   Katakana                     */\n  /*          Katakana Phonetic Extensions */\n#define TT_UCR_KATAKANA                        (1L << 18) /* U+30A0-U+30FF */\n                                                          /* U+31F0-U+31FF */\n  /* Bit 51   Bopomofo          */\n  /*          Bopomofo Extended */\n#define TT_UCR_BOPOMOFO                        (1L << 19) /* U+3100-U+312F */\n                                                          /* U+31A0-U+31BF */\n  /* Bit 52   Hangul Compatibility Jamo */\n#define TT_UCR_HANGUL_COMPATIBILITY_JAMO       (1L << 20) /* U+3130-U+318F */\n  /* Bit 53   Phags-Pa */\n#define TT_UCR_CJK_MISC                        (1L << 21) /* U+A840-U+A87F */\n#define TT_UCR_KANBUN  TT_UCR_CJK_MISC /* deprecated */\n#define TT_UCR_PHAGSPA\n  /* Bit 54   Enclosed CJK Letters and Months */\n#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS     (1L << 22) /* U+3200-U+32FF */\n  /* Bit 55   CJK Compatibility */\n#define TT_UCR_CJK_COMPATIBILITY               (1L << 23) /* U+3300-U+33FF */\n  /* Bit 56   Hangul Syllables */\n#define TT_UCR_HANGUL                          (1L << 24) /* U+AC00-U+D7A3 */\n  /* Bit 57   High Surrogates              */\n  /*          High Private Use Surrogates  */\n  /*          Low Surrogates               */\n  /*                                       */\n  /* According to OpenType specs v.1.3+,   */\n  /* setting bit 57 implies that there is  */\n  /* at least one codepoint beyond the     */\n  /* Basic Multilingual Plane that is      */\n  /* supported by this font.  So it really */\n  /* means >= U+10000                      */\n#define TT_UCR_SURROGATES                      (1L << 25) /* U+D800-U+DB7F */\n                                                          /* U+DB80-U+DBFF */\n                                                          /* U+DC00-U+DFFF */\n#define TT_UCR_NON_PLANE_0  TT_UCR_SURROGATES\n  /* Bit 58  Phoenician */\n#define TT_UCR_PHOENICIAN                      (1L << 26) /*U+10900-U+1091F*/\n  /* Bit 59   CJK Unified Ideographs             */\n  /*          CJK Radicals Supplement            */\n  /*          Kangxi Radicals                    */\n  /*          Ideographic Description Characters */\n  /*          CJK Unified Ideographs Extension A */\n  /*          CJK Unified Ideographs Extension B */\n  /*          Kanbun                             */\n#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS          (1L << 27) /* U+4E00-U+9FFF */\n                                                          /* U+2E80-U+2EFF */\n                                                          /* U+2F00-U+2FDF */\n                                                          /* U+2FF0-U+2FFF */\n                                                          /* U+3400-U+4DB5 */\n                                                          /*U+20000-U+2A6DF*/\n                                                          /* U+3190-U+319F */\n  /* Bit 60   Private Use */\n#define TT_UCR_PRIVATE_USE                     (1L << 28) /* U+E000-U+F8FF */\n  /* Bit 61   CJK Strokes                             */\n  /*          CJK Compatibility Ideographs            */\n  /*          CJK Compatibility Ideographs Supplement */\n#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS    (1L << 29) /* U+31C0-U+31EF */\n                                                          /* U+F900-U+FAFF */\n                                                          /*U+2F800-U+2FA1F*/\n  /* Bit 62   Alphabetic Presentation Forms */\n#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS   (1L << 30) /* U+FB00-U+FB4F */\n  /* Bit 63   Arabic Presentation Forms-A */\n#define TT_UCR_ARABIC_PRESENTATIONS_A          (1L << 31) /* U+FB50-U+FDFF */\n  /* Bit 64   Combining Half Marks */\n#define TT_UCR_COMBINING_HALF_MARKS            (1L <<  0) /* U+FE20-U+FE2F */\n  /* Bit 65   Vertical forms          */\n  /*          CJK Compatibility Forms */\n#define TT_UCR_CJK_COMPATIBILITY_FORMS         (1L <<  1) /* U+FE10-U+FE1F */\n                                                          /* U+FE30-U+FE4F */\n  /* Bit 66   Small Form Variants */\n#define TT_UCR_SMALL_FORM_VARIANTS             (1L <<  2) /* U+FE50-U+FE6F */\n  /* Bit 67   Arabic Presentation Forms-B */\n#define TT_UCR_ARABIC_PRESENTATIONS_B          (1L <<  3) /* U+FE70-U+FEFE */\n  /* Bit 68   Halfwidth and Fullwidth Forms */\n#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS       (1L <<  4) /* U+FF00-U+FFEF */\n  /* Bit 69   Specials */\n#define TT_UCR_SPECIALS                        (1L <<  5) /* U+FFF0-U+FFFD */\n  /* Bit 70   Tibetan */\n#define TT_UCR_TIBETAN                         (1L <<  6) /* U+0F00-U+0FFF */\n  /* Bit 71   Syriac */\n#define TT_UCR_SYRIAC                          (1L <<  7) /* U+0700-U+074F */\n  /* Bit 72   Thaana */\n#define TT_UCR_THAANA                          (1L <<  8) /* U+0780-U+07BF */\n  /* Bit 73   Sinhala */\n#define TT_UCR_SINHALA                         (1L <<  9) /* U+0D80-U+0DFF */\n  /* Bit 74   Myanmar */\n#define TT_UCR_MYANMAR                         (1L << 10) /* U+1000-U+109F */\n  /* Bit 75   Ethiopic            */\n  /*          Ethiopic Supplement */\n  /*          Ethiopic Extended   */\n#define TT_UCR_ETHIOPIC                        (1L << 11) /* U+1200-U+137F */\n                                                          /* U+1380-U+139F */\n                                                          /* U+2D80-U+2DDF */\n  /* Bit 76   Cherokee */\n#define TT_UCR_CHEROKEE                        (1L << 12) /* U+13A0-U+13FF */\n  /* Bit 77   Unified Canadian Aboriginal Syllabics */\n#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS   (1L << 13) /* U+1400-U+167F */\n  /* Bit 78   Ogham */\n#define TT_UCR_OGHAM                           (1L << 14) /* U+1680-U+169F */\n  /* Bit 79   Runic */\n#define TT_UCR_RUNIC                           (1L << 15) /* U+16A0-U+16FF */\n  /* Bit 80   Khmer         */\n  /*          Khmer Symbols */\n#define TT_UCR_KHMER                           (1L << 16) /* U+1780-U+17FF */\n                                                          /* U+19E0-U+19FF */\n  /* Bit 81   Mongolian */\n#define TT_UCR_MONGOLIAN                       (1L << 17) /* U+1800-U+18AF */\n  /* Bit 82   Braille Patterns */\n#define TT_UCR_BRAILLE                         (1L << 18) /* U+2800-U+28FF */\n  /* Bit 83   Yi Syllables */\n  /*          Yi Radicals  */\n#define TT_UCR_YI                              (1L << 19) /* U+A000-U+A48F */\n                                                          /* U+A490-U+A4CF */\n  /* Bit 84   Tagalog  */\n  /*          Hanunoo  */\n  /*          Buhid    */\n  /*          Tagbanwa */\n#define TT_UCR_PHILIPPINE                      (1L << 20) /* U+1700-U+171F */\n                                                          /* U+1720-U+173F */\n                                                          /* U+1740-U+175F */\n                                                          /* U+1760-U+177F */\n  /* Bit 85   Old Italic */\n#define TT_UCR_OLD_ITALIC                      (1L << 21) /*U+10300-U+1032F*/\n  /* Bit 86   Gothic */\n#define TT_UCR_GOTHIC                          (1L << 22) /*U+10330-U+1034F*/\n  /* Bit 87   Deseret */\n#define TT_UCR_DESERET                         (1L << 23) /*U+10400-U+1044F*/\n  /* Bit 88   Byzantine Musical Symbols      */\n  /*          Musical Symbols                */\n  /*          Ancient Greek Musical Notation */\n#define TT_UCR_MUSICAL_SYMBOLS                 (1L << 24) /*U+1D000-U+1D0FF*/\n                                                          /*U+1D100-U+1D1FF*/\n                                                          /*U+1D200-U+1D24F*/\n  /* Bit 89   Mathematical Alphanumeric Symbols */\n#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS       (1L << 25) /*U+1D400-U+1D7FF*/\n  /* Bit 90   Private Use (plane 15) */\n  /*          Private Use (plane 16) */\n#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY       (1L << 26) /*U+F0000-U+FFFFD*/\n                                                        /*U+100000-U+10FFFD*/\n  /* Bit 91   Variation Selectors            */\n  /*          Variation Selectors Supplement */\n#define TT_UCR_VARIATION_SELECTORS             (1L << 27) /* U+FE00-U+FE0F */\n                                                          /*U+E0100-U+E01EF*/\n  /* Bit 92   Tags */\n#define TT_UCR_TAGS                            (1L << 28) /*U+E0000-U+E007F*/\n  /* Bit 93   Limbu */\n#define TT_UCR_LIMBU                           (1L << 29) /* U+1900-U+194F */\n  /* Bit 94   Tai Le */\n#define TT_UCR_TAI_LE                          (1L << 30) /* U+1950-U+197F */\n  /* Bit 95   New Tai Lue */\n#define TT_UCR_NEW_TAI_LUE                     (1L << 31) /* U+1980-U+19DF */\n  /* Bit 96   Buginese */\n#define TT_UCR_BUGINESE                        (1L <<  0) /* U+1A00-U+1A1F */\n  /* Bit 97   Glagolitic */\n#define TT_UCR_GLAGOLITIC                      (1L <<  1) /* U+2C00-U+2C5F */\n  /* Bit 98   Tifinagh */\n#define TT_UCR_TIFINAGH                        (1L <<  2) /* U+2D30-U+2D7F */\n  /* Bit 99   Yijing Hexagram Symbols */\n#define TT_UCR_YIJING                          (1L <<  3) /* U+4DC0-U+4DFF */\n  /* Bit 100  Syloti Nagri */\n#define TT_UCR_SYLOTI_NAGRI                    (1L <<  4) /* U+A800-U+A82F */\n  /* Bit 101  Linear B Syllabary */\n  /*          Linear B Ideograms */\n  /*          Aegean Numbers     */\n#define TT_UCR_LINEAR_B                        (1L <<  5) /*U+10000-U+1007F*/\n                                                          /*U+10080-U+100FF*/\n                                                          /*U+10100-U+1013F*/\n  /* Bit 102  Ancient Greek Numbers */\n#define TT_UCR_ANCIENT_GREEK_NUMBERS           (1L <<  6) /*U+10140-U+1018F*/\n  /* Bit 103  Ugaritic */\n#define TT_UCR_UGARITIC                        (1L <<  7) /*U+10380-U+1039F*/\n  /* Bit 104  Old Persian */\n#define TT_UCR_OLD_PERSIAN                     (1L <<  8) /*U+103A0-U+103DF*/\n  /* Bit 105  Shavian */\n#define TT_UCR_SHAVIAN                         (1L <<  9) /*U+10450-U+1047F*/\n  /* Bit 106  Osmanya */\n#define TT_UCR_OSMANYA                         (1L << 10) /*U+10480-U+104AF*/\n  /* Bit 107  Cypriot Syllabary */\n#define TT_UCR_CYPRIOT_SYLLABARY               (1L << 11) /*U+10800-U+1083F*/\n  /* Bit 108  Kharoshthi */\n#define TT_UCR_KHAROSHTHI                      (1L << 12) /*U+10A00-U+10A5F*/\n  /* Bit 109  Tai Xuan Jing Symbols */\n#define TT_UCR_TAI_XUAN_JING                   (1L << 13) /*U+1D300-U+1D35F*/\n  /* Bit 110  Cuneiform                         */\n  /*          Cuneiform Numbers and Punctuation */\n#define TT_UCR_CUNEIFORM                       (1L << 14) /*U+12000-U+123FF*/\n                                                          /*U+12400-U+1247F*/\n  /* Bit 111  Counting Rod Numerals */\n#define TT_UCR_COUNTING_ROD_NUMERALS           (1L << 15) /*U+1D360-U+1D37F*/\n  /* Bit 112  Sundanese */\n#define TT_UCR_SUNDANESE                       (1L << 16) /* U+1B80-U+1BBF */\n  /* Bit 113  Lepcha */\n#define TT_UCR_LEPCHA                          (1L << 17) /* U+1C00-U+1C4F */\n  /* Bit 114  Ol Chiki */\n#define TT_UCR_OL_CHIKI                        (1L << 18) /* U+1C50-U+1C7F */\n  /* Bit 115  Saurashtra */\n#define TT_UCR_SAURASHTRA                      (1L << 19) /* U+A880-U+A8DF */\n  /* Bit 116  Kayah Li */\n#define TT_UCR_KAYAH_LI                        (1L << 20) /* U+A900-U+A92F */\n  /* Bit 117  Rejang */\n#define TT_UCR_REJANG                          (1L << 21) /* U+A930-U+A95F */\n  /* Bit 118  Cham */\n#define TT_UCR_CHAM                            (1L << 22) /* U+AA00-U+AA5F */\n  /* Bit 119  Ancient Symbols */\n#define TT_UCR_ANCIENT_SYMBOLS                 (1L << 23) /*U+10190-U+101CF*/\n  /* Bit 120  Phaistos Disc */\n#define TT_UCR_PHAISTOS_DISC                   (1L << 24) /*U+101D0-U+101FF*/\n  /* Bit 121  Carian */\n  /*          Lycian */\n  /*          Lydian */\n#define TT_UCR_OLD_ANATOLIAN                   (1L << 25) /*U+102A0-U+102DF*/\n                                                          /*U+10280-U+1029F*/\n                                                          /*U+10920-U+1093F*/\n  /* Bit 122  Domino Tiles  */\n  /*          Mahjong Tiles */\n#define TT_UCR_GAME_TILES                      (1L << 26) /*U+1F030-U+1F09F*/\n                                                          /*U+1F000-U+1F02F*/\n  /* Bit 123-127 Reserved for process-internal usage */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some compilers have a very limited length of identifiers.             */\n  /*                                                                       */\n#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )\n#define HAVE_LIMIT_ON_IDENTS\n#endif\n\n\n#ifndef HAVE_LIMIT_ON_IDENTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here some alias #defines in order to be clearer.                      */\n  /*                                                                       */\n  /* These are not always #defined to stay within the 31~character limit   */\n  /* which some compilers have.                                            */\n  /*                                                                       */\n  /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */\n  /* Borland compilers (read: from BC++ 3.1 on) can increase this limit.   */\n  /* If you get a warning with such a compiler, use the -i40 switch.       */\n  /*                                                                       */\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_A      \\\n         TT_UCR_ARABIC_PRESENTATIONS_A\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_B      \\\n         TT_UCR_ARABIC_PRESENTATIONS_B\n\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS      \\\n         TT_UCR_COMBINING_DIACRITICS\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\\n         TT_UCR_COMBINING_DIACRITICS_SYMB\n\n\n#endif /* !HAVE_LIMIT_ON_IDENTS */\n\n\nFT_END_HEADER\n\n#endif /* __TTNAMEID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/tttables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttables.h                                                             */\n/*                                                                         */\n/*    Basic SFNT/TrueType tables definitions and interface                 */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 1996-2005, 2008-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTABLES_H__\n#define __TTTABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueType Tables                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    TrueType specific table types and functions.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of TrueType-specific tables   */\n  /*    as well as some routines used to access and process them.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Header                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType font header table.  All       */\n  /*    fields follow the TrueType specification.                          */\n  /*                                                                       */\n  typedef struct  TT_Header_\n  {\n    FT_Fixed   Table_Version;\n    FT_Fixed   Font_Revision;\n\n    FT_Long    CheckSum_Adjust;\n    FT_Long    Magic_Number;\n\n    FT_UShort  Flags;\n    FT_UShort  Units_Per_EM;\n\n    FT_Long    Created [2];\n    FT_Long    Modified[2];\n\n    FT_Short   xMin;\n    FT_Short   yMin;\n    FT_Short   xMax;\n    FT_Short   yMax;\n\n    FT_UShort  Mac_Style;\n    FT_UShort  Lowest_Rec_PPEM;\n\n    FT_Short   Font_Direction;\n    FT_Short   Index_To_Loc_Format;\n    FT_Short   Glyph_Data_Format;\n\n  } TT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HoriHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType horizontal header, the `hhea' */\n  /*    table, as well as the corresponding horizontal metrics table,      */\n  /*    i.e., the `hmtx' table.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                :: The table version.                       */\n  /*                                                                       */\n  /*    Ascender               :: The font's ascender, i.e., the distance  */\n  /*                              from the baseline to the top-most of all */\n  /*                              glyph points found in the font.          */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoAscender' field */\n  /*                              of the OS/2 table instead if you want    */\n  /*                              the correct one.                         */\n  /*                                                                       */\n  /*    Descender              :: The font's descender, i.e., the distance */\n  /*                              from the baseline to the bottom-most of  */\n  /*                              all glyph points found in the font.  It  */\n  /*                              is negative.                             */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoDescender'      */\n  /*                              field of the OS/2 table instead if you   */\n  /*                              want the correct one.                    */\n  /*                                                                       */\n  /*    Line_Gap               :: The font's line gap, i.e., the distance  */\n  /*                              to add to the ascender and descender to  */\n  /*                              get the BTB, i.e., the                   */\n  /*                              baseline-to-baseline distance for the    */\n  /*                              font.                                    */\n  /*                                                                       */\n  /*    advance_Width_Max      :: This field is the maximum of all advance */\n  /*                              widths found in the font.  It can be     */\n  /*                              used to compute the maximum width of an  */\n  /*                              arbitrary string of text.                */\n  /*                                                                       */\n  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */\n  /*                              `width' of a glyph's bounding box) for   */\n  /*                              all glyphs in the font.                  */\n  /*                                                                       */\n  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */\n  /*                              slope of the cursor (slope=rise/run).    */\n  /*                                                                       */\n  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */\n  /*                              slope.                                   */\n  /*                                                                       */\n  /*    Reserved               :: 8~reserved bytes.                        */\n  /*                                                                       */\n  /*    metric_Data_Format     :: Always~0.                                */\n  /*                                                                       */\n  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */\n  /*                              table -- this value can be smaller than  */\n  /*                              the total number of glyphs in the font.  */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_HoriHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Width_Max;      /* advance width maximum */\n\n    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */\n    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */\n    FT_Short   xMax_Extent;            /* xmax extents          */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_HMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they are used to connect the metrics header to the relevant    */\n    /* `HMTX' table.                                                      */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_HoriHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_VertHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType vertical header, the `vhea'   */\n  /*    table, as well as the corresponding vertical metrics table, i.e.,  */\n  /*    the `vmtx' table.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                 :: The table version.                      */\n  /*                                                                       */\n  /*    Ascender                :: The font's ascender, i.e., the distance */\n  /*                               from the baseline to the top-most of    */\n  /*                               all glyph points found in the font.     */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoAscender'      */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Descender               :: The font's descender, i.e., the         */\n  /*                               distance from the baseline to the       */\n  /*                               bottom-most of all glyph points found   */\n  /*                               in the font.  It is negative.           */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoDescender'     */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Line_Gap                :: The font's line gap, i.e., the distance */\n  /*                               to add to the ascender and descender to */\n  /*                               get the BTB, i.e., the                  */\n  /*                               baseline-to-baseline distance for the   */\n  /*                               font.                                   */\n  /*                                                                       */\n  /*    advance_Height_Max      :: This field is the maximum of all        */\n  /*                               advance heights found in the font.  It  */\n  /*                               can be used to compute the maximum      */\n  /*                               height of an arbitrary string of text.  */\n  /*                                                                       */\n  /*    min_Top_Side_Bearing    :: The minimum top side bearing of all     */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    min_Bottom_Side_Bearing :: The minimum bottom side bearing of all  */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    yMax_Extent             :: The maximum vertical extent (i.e., the  */\n  /*                               `height' of a glyph's bounding box) for */\n  /*                               all glyphs in the font.                 */\n  /*                                                                       */\n  /*    caret_Slope_Rise        :: The rise coefficient of the cursor's    */\n  /*                               slope of the cursor (slope=rise/run).   */\n  /*                                                                       */\n  /*    caret_Slope_Run         :: The run coefficient of the cursor's     */\n  /*                               slope.                                  */\n  /*                                                                       */\n  /*    caret_Offset            :: The cursor's offset for slanted fonts.  */\n  /*                               This value is `reserved' in vmtx        */\n  /*                               version 1.0.                            */\n  /*                                                                       */\n  /*    Reserved                :: 8~reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format      :: Always~0.                               */\n  /*                                                                       */\n  /*    number_Of_HMetrics      :: Number of VMetrics entries in the       */\n  /*                               `vmtx' table -- this value can be       */\n  /*                               smaller than the total number of glyphs */\n  /*                               in the font.                            */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_VertHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Height_Max;      /* advance height maximum */\n\n    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */\n    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */\n    FT_Short   yMax_Extent;             /* xmax or ymax extents            */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_VMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they're used to connect the metrics header to the relevant     */\n    /* `HMTX' or `VMTX' table.                                            */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_VertHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_OS2                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType OS/2 table. This is the long  */\n  /*    table version.  All fields comply to the TrueType specification.   */\n  /*                                                                       */\n  /*    Note that we now support old Mac fonts which do not include an     */\n  /*    OS/2 table.  In this case, the `version' field is always set to    */\n  /*    0xFFFF.                                                            */\n  /*                                                                       */\n  typedef struct  TT_OS2_\n  {\n    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */\n    FT_Short   xAvgCharWidth;\n    FT_UShort  usWeightClass;\n    FT_UShort  usWidthClass;\n    FT_Short   fsType;\n    FT_Short   ySubscriptXSize;\n    FT_Short   ySubscriptYSize;\n    FT_Short   ySubscriptXOffset;\n    FT_Short   ySubscriptYOffset;\n    FT_Short   ySuperscriptXSize;\n    FT_Short   ySuperscriptYSize;\n    FT_Short   ySuperscriptXOffset;\n    FT_Short   ySuperscriptYOffset;\n    FT_Short   yStrikeoutSize;\n    FT_Short   yStrikeoutPosition;\n    FT_Short   sFamilyClass;\n\n    FT_Byte    panose[10];\n\n    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */\n    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */\n    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */\n    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */\n\n    FT_Char    achVendID[4];\n\n    FT_UShort  fsSelection;\n    FT_UShort  usFirstCharIndex;\n    FT_UShort  usLastCharIndex;\n    FT_Short   sTypoAscender;\n    FT_Short   sTypoDescender;\n    FT_Short   sTypoLineGap;\n    FT_UShort  usWinAscent;\n    FT_UShort  usWinDescent;\n\n    /* only version 1 tables: */\n\n    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */\n    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */\n\n    /* only version 2 tables: */\n\n    FT_Short   sxHeight;\n    FT_Short   sCapHeight;\n    FT_UShort  usDefaultChar;\n    FT_UShort  usBreakChar;\n    FT_UShort  usMaxContext;\n\n  } TT_OS2;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Postscript                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PostScript table.  All fields */\n  /*    comply to the TrueType specification.  This structure does not     */\n  /*    reference the PostScript glyph names, which can be nevertheless    */\n  /*    accessed with the `ttpost' module.                                 */\n  /*                                                                       */\n  typedef struct  TT_Postscript_\n  {\n    FT_Fixed  FormatType;\n    FT_Fixed  italicAngle;\n    FT_Short  underlinePosition;\n    FT_Short  underlineThickness;\n    FT_ULong  isFixedPitch;\n    FT_ULong  minMemType42;\n    FT_ULong  maxMemType42;\n    FT_ULong  minMemType1;\n    FT_ULong  maxMemType1;\n\n    /* Glyph names follow in the file, but we don't   */\n    /* load them by default.  See the ttpost.c file.  */\n\n  } TT_Postscript;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_PCLT                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PCLT table.  All fields       */\n  /*    comply to the TrueType specification.                              */\n  /*                                                                       */\n  typedef struct  TT_PCLT_\n  {\n    FT_Fixed   Version;\n    FT_ULong   FontNumber;\n    FT_UShort  Pitch;\n    FT_UShort  xHeight;\n    FT_UShort  Style;\n    FT_UShort  TypeFamily;\n    FT_UShort  CapHeight;\n    FT_UShort  SymbolSet;\n    FT_Char    TypeFace[16];\n    FT_Char    CharacterComplement[8];\n    FT_Char    FileName[6];\n    FT_Char    StrokeWeight;\n    FT_Char    WidthType;\n    FT_Byte    SerifStyle;\n    FT_Byte    Reserved;\n\n  } TT_PCLT;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The maximum profile is a table containing many max values which    */\n  /*    can be used to pre-allocate arrays.  This ensures that no memory   */\n  /*    allocation occurs during a glyph load.                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version               :: The version number.                       */\n  /*                                                                       */\n  /*    numGlyphs             :: The number of glyphs in this TrueType     */\n  /*                             font.                                     */\n  /*                                                                       */\n  /*    maxPoints             :: The maximum number of points in a         */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositePoints'.                     */\n  /*                                                                       */\n  /*    maxContours           :: The maximum number of contours in a       */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositeContours'.                   */\n  /*                                                                       */\n  /*    maxCompositePoints    :: The maximum number of points in a         */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxPoints'.            */\n  /*                                                                       */\n  /*    maxCompositeContours  :: The maximum number of contours in a       */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxContours'.          */\n  /*                                                                       */\n  /*    maxZones              :: The maximum number of zones used for      */\n  /*                             glyph hinting.                            */\n  /*                                                                       */\n  /*    maxTwilightPoints     :: The maximum number of points in the       */\n  /*                             twilight zone used for glyph hinting.     */\n  /*                                                                       */\n  /*    maxStorage            :: The maximum number of elements in the     */\n  /*                             storage area used for glyph hinting.      */\n  /*                                                                       */\n  /*    maxFunctionDefs       :: The maximum number of function            */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxInstructionDefs    :: The maximum number of instruction         */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxStackElements      :: The maximum number of stack elements used */\n  /*                             during bytecode interpretation.           */\n  /*                                                                       */\n  /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */\n  /*                             used for glyph hinting.                   */\n  /*                                                                       */\n  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */\n  /*                             composite) glyphs in a composite glyph.   */\n  /*                                                                       */\n  /*    maxComponentDepth     :: The maximum nesting depth of composite    */\n  /*                             glyphs.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is only used during font loading.                   */\n  /*                                                                       */\n  typedef struct  TT_MaxProfile_\n  {\n    FT_Fixed   version;\n    FT_UShort  numGlyphs;\n    FT_UShort  maxPoints;\n    FT_UShort  maxContours;\n    FT_UShort  maxCompositePoints;\n    FT_UShort  maxCompositeContours;\n    FT_UShort  maxZones;\n    FT_UShort  maxTwilightPoints;\n    FT_UShort  maxStorage;\n    FT_UShort  maxFunctionDefs;\n    FT_UShort  maxInstructionDefs;\n    FT_UShort  maxStackElements;\n    FT_UShort  maxSizeOfInstructions;\n    FT_UShort  maxComponentElements;\n    FT_UShort  maxComponentDepth;\n\n  } TT_MaxProfile;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Sfnt_Tag                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify the index of an SFNT table.         */\n  /*    Used in the @FT_Get_Sfnt_Table API function.                       */\n  /*                                                                       */\n  typedef enum  FT_Sfnt_Tag_\n  {\n    ft_sfnt_head = 0,    /* TT_Header     */\n    ft_sfnt_maxp = 1,    /* TT_MaxProfile */\n    ft_sfnt_os2  = 2,    /* TT_OS2        */\n    ft_sfnt_hhea = 3,    /* TT_HoriHeader */\n    ft_sfnt_vhea = 4,    /* TT_VertHeader */\n    ft_sfnt_post = 5,    /* TT_Postscript */\n    ft_sfnt_pclt = 6,    /* TT_PCLT       */\n\n    sfnt_max   /* internal end mark */\n\n  } FT_Sfnt_Tag;\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pointer to a given SFNT table within a face.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source.                                    */\n  /*                                                                       */\n  /*    tag  :: The index of the SFNT table.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A type-less pointer to the table.  This will be~0 in case of       */\n  /*    error, or if the corresponding table was not found *OR* loaded     */\n  /*    from the file.                                                     */\n  /*                                                                       */\n  /*    Use a typecast according to `tag' to access the structure          */\n  /*    elements.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The table is owned by the face object and disappears with it.      */\n  /*                                                                       */\n  /*    This function is only useful to access SFNT tables that are loaded */\n  /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */\n  /*    a list.                                                            */\n  /*                                                                       */\n  /*    Here an example how to access the `vhea' table:                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      TT_VertHeader*  vert_header;                                     */\n  /*                                                                       */\n  /*                                                                       */\n  /*      vert_header =                                                    */\n  /*        (TT_VertHeader*)FT_Get_Sfnt_Table( face, ft_sfnt_vhea );       */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Load_Sfnt_Table\n  *\n  * @description:\n  *   Load any font table into client memory.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   tag ::\n  *     The four-byte tag of the table to load.  Use the value~0 if you want\n  *     to access the whole font file.  Otherwise, you can use one of the\n  *     definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new\n  *     one with @FT_MAKE_TAG.\n  *\n  *   offset ::\n  *     The starting offset in the table (or file if tag == 0).\n  *\n  * @output:\n  *   buffer ::\n  *     The target buffer address.  The client must ensure that the memory\n  *     array is big enough to hold the data.\n  *\n  * @inout:\n  *   length ::\n  *     If the `length' parameter is NULL, then try to load the whole table.\n  *     Return an error code if it fails.\n  *\n  *     Else, if `*length' is~0, exit immediately while returning the\n  *     table's (or file) full size in it.\n  *\n  *     Else the number of bytes to read from the table or file, from the\n  *     starting offset.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If you need to determine the table's length you should first call this\n  *   function with `*length' set to~0, as in the following example:\n  *\n  *     {\n  *       FT_ULong  length = 0;\n  *\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );\n  *       if ( error ) { ... table does not exist ... }\n  *\n  *       buffer = malloc( length );\n  *       if ( buffer == NULL ) { ... not enough memory ... }\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );\n  *       if ( error ) { ... could not load table ... }\n  *     }\n  */\n  FT_EXPORT( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Sfnt_Table_Info\n  *\n  * @description:\n  *   Return information on an SFNT table.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   table_index ::\n  *     The index of an SFNT table.  The function returns\n  *     FT_Err_Table_Missing for an invalid value.\n  *\n  * @inout:\n  *   tag ::\n  *     The name tag of the SFNT table.  If the value is NULL, `table_index'\n  *     is ignored, and `length' returns the number of SFNT tables in the\n  *     font.\n  *\n  * @output:\n  *   length ::\n  *     The length of the SFNT table (or the number of SFNT tables, depending\n  *     on `tag').\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   While parsing fonts, FreeType handles SFNT tables with length zero as\n  *   missing.\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */\n  /*    language ID values are in `freetype/ttnameid.h'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */\n  /*    TrueType/sfnt face, just return~0 as the default value.            */\n  /*                                                                       */\n  /*    For a format~14 cmap (to access Unicode IVS), the return value is  */\n  /*    0xFFFFFFFF.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap format.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The format of `charmap'.  If `charmap' doesn't belong to a         */\n  /*    TrueType/sfnt face, return -1.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTTABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/tttags.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttags.h                                                               */\n/*                                                                         */\n/*    Tags for TrueType and OpenType tables (specification only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTAGS_H__\n#define __TTAGS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )\n#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )\n#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )\n#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )\n#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )\n#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )\n#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )\n#define TTAG_CBDT  FT_MAKE_TAG( 'C', 'B', 'D', 'T' )\n#define TTAG_CBLC  FT_MAKE_TAG( 'C', 'B', 'L', 'C' )\n#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )\n#define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )\n#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )\n#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )\n#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )\n#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )\n#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )\n#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )\n#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )\n#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )\n#define TTAG_FOND  FT_MAKE_TAG( 'F', 'O', 'N', 'D' )\n#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )\n#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )\n#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )\n#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )\n#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )\n#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )\n#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )\n#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )\n#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )\n#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )\n#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )\n#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )\n#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )\n#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )\n#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )\n#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )\n#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )\n#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )\n#define TTAG_LWFN  FT_MAKE_TAG( 'L', 'W', 'F', 'N' )\n#define TTAG_MATH  FT_MAKE_TAG( 'M', 'A', 'T', 'H' )\n#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )\n#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )\n#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )\n#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )\n#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )\n#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )\n#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )\n#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )\n#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )\n#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )\n#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )\n#define TTAG_POST  FT_MAKE_TAG( 'P', 'O', 'S', 'T' )\n#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )\n#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )\n#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )\n#define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )\n#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )\n#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )\n#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )\n#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )\n#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )\n#define TTAG_TYP1  FT_MAKE_TAG( 'T', 'Y', 'P', '1' )\n#define TTAG_typ1  FT_MAKE_TAG( 't', 'y', 'p', '1' )\n#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )\n#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )\n#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )\n\n\nFT_END_HEADER\n\n#endif /* __TTAGS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/freetype/ttunpat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttunpat.h                                                              */\n/*                                                                         */\n/*    Definitions for the unpatented TrueType hinting system               */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by Graham Asher <graham.asher@btinternet.com>                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTUNPAT_H__\n#define __TTUNPAT_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_UNPATENTED_HINTING\n  *\n  * @description:\n  *   A constant used as the tag of an @FT_Parameter structure to indicate\n  *   that unpatented methods only should be used by the TrueType bytecode\n  *   interpreter for a typeface opened by @FT_Open_Face.\n  *\n  */\n#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __TTUNPAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/include/win32/ft2build.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ft2build.h                                                             */\n/*                                                                         */\n/*    FreeType 2 build and setup macros.                                   */\n/*    (Generic version)                                                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2006 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file corresponds to the default `ft2build.h' file for            */\n  /* FreeType 2.  It uses the `freetype' include root.                     */\n  /*                                                                       */\n  /* Note that specific platforms might use a different configuration.     */\n  /* See builds/unix/ft2unix.h for an example.                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FT2_BUILD_GENERIC_H__\n#define __FT2_BUILD_GENERIC_H__\n\n#include <freetype/config/ftheader.h>\n\n#endif /* __FT2_BUILD_GENERIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "cocos2d/external/freetype2/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE := cocos_freetype2_static\nLOCAL_MODULE_FILENAME := freetype2\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libfreetype.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android $(LOCAL_PATH)/../../include/android/freetype2\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/glfw3/include/mac/glfw3.h",
    "content": "/*************************************************************************\n * GLFW 3.0 - www.glfw.org\n * A library for OpenGL, window and input\n *------------------------------------------------------------------------\n * Copyright (c) 2002-2006 Marcus Geelnard\n * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n *\n * This software is provided 'as-is', without any express or implied\n * warranty. In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would\n *    be appreciated but is not required.\n *\n * 2. Altered source versions must be plainly marked as such, and must not\n *    be misrepresented as being the original software.\n *\n * 3. This notice may not be removed or altered from any source\n *    distribution.\n *\n *************************************************************************/\n\n#ifndef _glfw3_h_\n#define _glfw3_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/*************************************************************************\n * Doxygen documentation\n *************************************************************************/\n\n/*! @defgroup clipboard Clipboard support\n */\n/*! @defgroup context Context handling\n */\n/*! @defgroup error Error handling\n */\n/*! @defgroup init Initialization and version information\n */\n/*! @defgroup input Input handling\n */\n/*! @defgroup monitor Monitor handling\n *\n *  This is the reference documentation for monitor related functions and types.\n *  For more information, see the @ref monitor.\n */\n/*! @defgroup time Time input\n */\n/*! @defgroup window Window handling\n *\n *  This is the reference documentation for window related functions and types,\n *  including creation, deletion and event polling.  For more information, see\n *  the @ref window.\n */\n\n\n/*************************************************************************\n * Global definitions\n *************************************************************************/\n\n/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */\n\n/* Please report any problems that you find with your compiler, which may\n * be solved in this section! There are several compilers that I have not\n * been able to test this file with yet.\n *\n * First: If we are we on Windows, we want a single define for it (_WIN32)\n * (Note: For Cygwin the compiler flag -mwin32 should be used, but to\n * make sure that things run smoothly for Cygwin users, we add __CYGWIN__\n * to the list of \"valid Win32 identifiers\", which removes the need for\n * -mwin32)\n */\n#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))\n #define _WIN32\n#endif /* _WIN32 */\n\n/* In order for extension support to be portable, we need to define an\n * OpenGL function call method. We use the keyword APIENTRY, which is\n * defined for Win32. (Note: Windows also needs this for <GL/gl.h>)\n */\n#ifndef APIENTRY\n #ifdef _WIN32\n  #define APIENTRY __stdcall\n #else\n  #define APIENTRY\n #endif\n#endif /* APIENTRY */\n\n/* The following three defines are here solely to make some Windows-based\n * <GL/gl.h> files happy. Theoretically we could include <windows.h>, but\n * it has the major drawback of severely polluting our namespace.\n */\n\n/* Under Windows, we need WINGDIAPI defined */\n#if !defined(WINGDIAPI) && defined(_WIN32)\n #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)\n  /* Microsoft Visual C++, Borland C++ Builder and Pelles C */\n  #define WINGDIAPI __declspec(dllimport)\n #elif defined(__LCC__)\n  /* LCC-Win32 */\n  #define WINGDIAPI __stdcall\n #else\n  /* Others (e.g. MinGW, Cygwin) */\n  #define WINGDIAPI extern\n #endif\n #define GLFW_WINGDIAPI_DEFINED\n#endif /* WINGDIAPI */\n\n/* Some <GL/glu.h> files also need CALLBACK defined */\n#if !defined(CALLBACK) && defined(_WIN32)\n #if defined(_MSC_VER)\n  /* Microsoft Visual C++ */\n  #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)\n   #define CALLBACK __stdcall\n  #else\n   #define CALLBACK\n  #endif\n #else\n  /* Other Windows compilers */\n  #define CALLBACK __stdcall\n #endif\n #define GLFW_CALLBACK_DEFINED\n#endif /* CALLBACK */\n\n/* Most GL/glu.h variants on Windows need wchar_t\n * OpenGL/gl.h blocks the definition of ptrdiff_t by glext.h on OS X */\n#if !defined(GLFW_INCLUDE_NONE)\n #include <stddef.h>\n#endif\n\n/* Include the chosen client API headers.\n */\n#if defined(__APPLE_CC__)\n  #if defined(GLFW_INCLUDE_GLCOREARB)\n    #include <OpenGL/gl3.h>\n  #elif !defined(GLFW_INCLUDE_NONE)\n    #define GL_GLEXT_LEGACY\n    #include <OpenGL/gl.h>\n  #endif\n  #if defined(GLFW_INCLUDE_GLU)\n    #include <OpenGL/glu.h>\n  #endif\n#else\n  #if defined(GLFW_INCLUDE_GLCOREARB)\n    #include <GL/glcorearb.h>\n  #elif defined(GLFW_INCLUDE_ES1)\n    #include <GLES/gl.h>\n  #elif defined(GLFW_INCLUDE_ES2)\n    #include <GLES2/gl2.h>\n  #elif defined(GLFW_INCLUDE_ES3)\n    #include <GLES3/gl3.h>\n  #elif !defined(GLFW_INCLUDE_NONE)\n    #include <GL/gl.h>\n  #endif\n  #if defined(GLFW_INCLUDE_GLU)\n    #include <GL/glu.h>\n  #endif\n#endif\n\n#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)\n /* GLFW_DLL is defined by users of GLFW when compiling programs that will link\n  * to the DLL version of the GLFW library.  _GLFW_BUILD_DLL is defined by the\n  * GLFW configuration header when compiling the DLL version of the library.\n  */\n #error \"You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined\"\n#endif\n\n#if defined(_WIN32) && defined(_GLFW_BUILD_DLL)\n\n /* We are building a Win32 DLL */\n #define GLFWAPI __declspec(dllexport)\n\n#elif defined(_WIN32) && defined(GLFW_DLL)\n\n /* We are calling a Win32 DLL */\n #if defined(__LCC__)\n  #define GLFWAPI extern\n #else\n  #define GLFWAPI __declspec(dllimport)\n #endif\n\n#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)\n\n #define GLFWAPI __attribute__((visibility(\"default\")))\n\n#else\n\n /* We are either building/calling a static lib or we are non-win32 */\n #define GLFWAPI\n\n#endif\n\n/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */\n\n\n/*************************************************************************\n * GLFW API tokens\n *************************************************************************/\n\n/*! @name GLFW version macros\n *  @{ */\n/*! @brief The major version number of the GLFW library.\n *\n *  This is incremented when the API is changed in non-compatible ways.\n *  @ingroup init\n */\n#define GLFW_VERSION_MAJOR          3\n/*! @brief The minor version number of the GLFW library.\n *\n *  This is incremented when features are added to the API but it remains\n *  backward-compatible.\n *  @ingroup init\n */\n#define GLFW_VERSION_MINOR          0\n/*! @brief The revision number of the GLFW library.\n *\n *  This is incremented when a bug fix release is made that does not contain any\n *  API changes.\n *  @ingroup init\n */\n#define GLFW_VERSION_REVISION       4\n/*! @} */\n\n/*! @name Key and button actions\n *  @{ */\n/*! @brief The key or button was released.\n *  @ingroup input\n */\n#define GLFW_RELEASE                0\n/*! @brief The key or button was pressed.\n *  @ingroup input\n */\n#define GLFW_PRESS                  1\n/*! @brief The key was held down until it repeated.\n *  @ingroup input\n */\n#define GLFW_REPEAT                 2\n/*! @} */\n\n/*! @defgroup keys Keyboard keys\n *\n * These key codes are inspired by the *USB HID Usage Tables v1.12* (p. 53-60),\n * but re-arranged to map to 7-bit ASCII for printable keys (function keys are\n * put in the 256+ range).\n *\n * The naming of the key codes follow these rules:\n *  - The US keyboard layout is used\n *  - Names of printable alpha-numeric characters are used (e.g. \"A\", \"R\",\n *    \"3\", etc.)\n *  - For non-alphanumeric characters, Unicode:ish names are used (e.g.\n *    \"COMMA\", \"LEFT_SQUARE_BRACKET\", etc.). Note that some names do not\n *    correspond to the Unicode standard (usually for brevity)\n *  - Keys that lack a clear US mapping are named \"WORLD_x\"\n *  - For non-printable keys, custom names are used (e.g. \"F4\",\n *    \"BACKSPACE\", etc.)\n *\n *  @ingroup input\n *  @{\n */\n\n/* The unknown key */\n#define GLFW_KEY_UNKNOWN            -1\n\n/* Printable keys */\n#define GLFW_KEY_SPACE              32\n#define GLFW_KEY_APOSTROPHE         39  /* ' */\n#define GLFW_KEY_COMMA              44  /* , */\n#define GLFW_KEY_MINUS              45  /* - */\n#define GLFW_KEY_PERIOD             46  /* . */\n#define GLFW_KEY_SLASH              47  /* / */\n#define GLFW_KEY_0                  48\n#define GLFW_KEY_1                  49\n#define GLFW_KEY_2                  50\n#define GLFW_KEY_3                  51\n#define GLFW_KEY_4                  52\n#define GLFW_KEY_5                  53\n#define GLFW_KEY_6                  54\n#define GLFW_KEY_7                  55\n#define GLFW_KEY_8                  56\n#define GLFW_KEY_9                  57\n#define GLFW_KEY_SEMICOLON          59  /* ; */\n#define GLFW_KEY_EQUAL              61  /* = */\n#define GLFW_KEY_A                  65\n#define GLFW_KEY_B                  66\n#define GLFW_KEY_C                  67\n#define GLFW_KEY_D                  68\n#define GLFW_KEY_E                  69\n#define GLFW_KEY_F                  70\n#define GLFW_KEY_G                  71\n#define GLFW_KEY_H                  72\n#define GLFW_KEY_I                  73\n#define GLFW_KEY_J                  74\n#define GLFW_KEY_K                  75\n#define GLFW_KEY_L                  76\n#define GLFW_KEY_M                  77\n#define GLFW_KEY_N                  78\n#define GLFW_KEY_O                  79\n#define GLFW_KEY_P                  80\n#define GLFW_KEY_Q                  81\n#define GLFW_KEY_R                  82\n#define GLFW_KEY_S                  83\n#define GLFW_KEY_T                  84\n#define GLFW_KEY_U                  85\n#define GLFW_KEY_V                  86\n#define GLFW_KEY_W                  87\n#define GLFW_KEY_X                  88\n#define GLFW_KEY_Y                  89\n#define GLFW_KEY_Z                  90\n#define GLFW_KEY_LEFT_BRACKET       91  /* [ */\n#define GLFW_KEY_BACKSLASH          92  /* \\ */\n#define GLFW_KEY_RIGHT_BRACKET      93  /* ] */\n#define GLFW_KEY_GRAVE_ACCENT       96  /* ` */\n#define GLFW_KEY_WORLD_1            161 /* non-US #1 */\n#define GLFW_KEY_WORLD_2            162 /* non-US #2 */\n\n/* Function keys */\n#define GLFW_KEY_ESCAPE             256\n#define GLFW_KEY_ENTER              257\n#define GLFW_KEY_TAB                258\n#define GLFW_KEY_BACKSPACE          259\n#define GLFW_KEY_INSERT             260\n#define GLFW_KEY_DELETE             261\n#define GLFW_KEY_RIGHT              262\n#define GLFW_KEY_LEFT               263\n#define GLFW_KEY_DOWN               264\n#define GLFW_KEY_UP                 265\n#define GLFW_KEY_PAGE_UP            266\n#define GLFW_KEY_PAGE_DOWN          267\n#define GLFW_KEY_HOME               268\n#define GLFW_KEY_END                269\n#define GLFW_KEY_CAPS_LOCK          280\n#define GLFW_KEY_SCROLL_LOCK        281\n#define GLFW_KEY_NUM_LOCK           282\n#define GLFW_KEY_PRINT_SCREEN       283\n#define GLFW_KEY_PAUSE              284\n#define GLFW_KEY_F1                 290\n#define GLFW_KEY_F2                 291\n#define GLFW_KEY_F3                 292\n#define GLFW_KEY_F4                 293\n#define GLFW_KEY_F5                 294\n#define GLFW_KEY_F6                 295\n#define GLFW_KEY_F7                 296\n#define GLFW_KEY_F8                 297\n#define GLFW_KEY_F9                 298\n#define GLFW_KEY_F10                299\n#define GLFW_KEY_F11                300\n#define GLFW_KEY_F12                301\n#define GLFW_KEY_F13                302\n#define GLFW_KEY_F14                303\n#define GLFW_KEY_F15                304\n#define GLFW_KEY_F16                305\n#define GLFW_KEY_F17                306\n#define GLFW_KEY_F18                307\n#define GLFW_KEY_F19                308\n#define GLFW_KEY_F20                309\n#define GLFW_KEY_F21                310\n#define GLFW_KEY_F22                311\n#define GLFW_KEY_F23                312\n#define GLFW_KEY_F24                313\n#define GLFW_KEY_F25                314\n#define GLFW_KEY_KP_0               320\n#define GLFW_KEY_KP_1               321\n#define GLFW_KEY_KP_2               322\n#define GLFW_KEY_KP_3               323\n#define GLFW_KEY_KP_4               324\n#define GLFW_KEY_KP_5               325\n#define GLFW_KEY_KP_6               326\n#define GLFW_KEY_KP_7               327\n#define GLFW_KEY_KP_8               328\n#define GLFW_KEY_KP_9               329\n#define GLFW_KEY_KP_DECIMAL         330\n#define GLFW_KEY_KP_DIVIDE          331\n#define GLFW_KEY_KP_MULTIPLY        332\n#define GLFW_KEY_KP_SUBTRACT        333\n#define GLFW_KEY_KP_ADD             334\n#define GLFW_KEY_KP_ENTER           335\n#define GLFW_KEY_KP_EQUAL           336\n#define GLFW_KEY_LEFT_SHIFT         340\n#define GLFW_KEY_LEFT_CONTROL       341\n#define GLFW_KEY_LEFT_ALT           342\n#define GLFW_KEY_LEFT_SUPER         343\n#define GLFW_KEY_RIGHT_SHIFT        344\n#define GLFW_KEY_RIGHT_CONTROL      345\n#define GLFW_KEY_RIGHT_ALT          346\n#define GLFW_KEY_RIGHT_SUPER        347\n#define GLFW_KEY_MENU               348\n#define GLFW_KEY_LAST               GLFW_KEY_MENU\n\n/*! @} */\n\n/*! @defgroup mods Modifier key flags\n *  @ingroup input\n *  @{ */\n\n/*! @brief If this bit is set one or more Shift keys were held down.\n */\n#define GLFW_MOD_SHIFT           0x0001\n/*! @brief If this bit is set one or more Control keys were held down.\n */\n#define GLFW_MOD_CONTROL         0x0002\n/*! @brief If this bit is set one or more Alt keys were held down.\n */\n#define GLFW_MOD_ALT             0x0004\n/*! @brief If this bit is set one or more Super keys were held down.\n */\n#define GLFW_MOD_SUPER           0x0008\n\n/*! @} */\n\n/*! @defgroup buttons Mouse buttons\n *  @ingroup input\n *  @{ */\n#define GLFW_MOUSE_BUTTON_1         0\n#define GLFW_MOUSE_BUTTON_2         1\n#define GLFW_MOUSE_BUTTON_3         2\n#define GLFW_MOUSE_BUTTON_4         3\n#define GLFW_MOUSE_BUTTON_5         4\n#define GLFW_MOUSE_BUTTON_6         5\n#define GLFW_MOUSE_BUTTON_7         6\n#define GLFW_MOUSE_BUTTON_8         7\n#define GLFW_MOUSE_BUTTON_LAST      GLFW_MOUSE_BUTTON_8\n#define GLFW_MOUSE_BUTTON_LEFT      GLFW_MOUSE_BUTTON_1\n#define GLFW_MOUSE_BUTTON_RIGHT     GLFW_MOUSE_BUTTON_2\n#define GLFW_MOUSE_BUTTON_MIDDLE    GLFW_MOUSE_BUTTON_3\n/*! @} */\n\n/*! @defgroup joysticks Joysticks\n *  @ingroup input\n *  @{ */\n#define GLFW_JOYSTICK_1             0\n#define GLFW_JOYSTICK_2             1\n#define GLFW_JOYSTICK_3             2\n#define GLFW_JOYSTICK_4             3\n#define GLFW_JOYSTICK_5             4\n#define GLFW_JOYSTICK_6             5\n#define GLFW_JOYSTICK_7             6\n#define GLFW_JOYSTICK_8             7\n#define GLFW_JOYSTICK_9             8\n#define GLFW_JOYSTICK_10            9\n#define GLFW_JOYSTICK_11            10\n#define GLFW_JOYSTICK_12            11\n#define GLFW_JOYSTICK_13            12\n#define GLFW_JOYSTICK_14            13\n#define GLFW_JOYSTICK_15            14\n#define GLFW_JOYSTICK_16            15\n#define GLFW_JOYSTICK_LAST          GLFW_JOYSTICK_16\n/*! @} */\n\n/*! @defgroup errors Error codes\n *  @ingroup error\n *  @{ */\n/*! @brief GLFW has not been initialized.\n */\n#define GLFW_NOT_INITIALIZED        0x00010001\n/*! @brief No context is current for this thread.\n */\n#define GLFW_NO_CURRENT_CONTEXT     0x00010002\n/*! @brief One of the enum parameters for the function was given an invalid\n *  enum.\n */\n#define GLFW_INVALID_ENUM           0x00010003\n/*! @brief One of the parameters for the function was given an invalid value.\n */\n#define GLFW_INVALID_VALUE          0x00010004\n/*! @brief A memory allocation failed.\n */\n#define GLFW_OUT_OF_MEMORY          0x00010005\n/*! @brief GLFW could not find support for the requested client API on the\n *  system.\n */\n#define GLFW_API_UNAVAILABLE        0x00010006\n/*! @brief The requested client API version is not available.\n */\n#define GLFW_VERSION_UNAVAILABLE    0x00010007\n/*! @brief A platform-specific error occurred that does not match any of the\n *  more specific categories.\n */\n#define GLFW_PLATFORM_ERROR         0x00010008\n/*! @brief The clipboard did not contain data in the requested format.\n */\n#define GLFW_FORMAT_UNAVAILABLE     0x00010009\n/*! @} */\n\n#define GLFW_FOCUSED                0x00020001\n#define GLFW_ICONIFIED              0x00020002\n#define GLFW_RESIZABLE              0x00020003\n#define GLFW_VISIBLE                0x00020004\n#define GLFW_DECORATED              0x00020005\n\n#define GLFW_RED_BITS               0x00021001\n#define GLFW_GREEN_BITS             0x00021002\n#define GLFW_BLUE_BITS              0x00021003\n#define GLFW_ALPHA_BITS             0x00021004\n#define GLFW_DEPTH_BITS             0x00021005\n#define GLFW_STENCIL_BITS           0x00021006\n#define GLFW_ACCUM_RED_BITS         0x00021007\n#define GLFW_ACCUM_GREEN_BITS       0x00021008\n#define GLFW_ACCUM_BLUE_BITS        0x00021009\n#define GLFW_ACCUM_ALPHA_BITS       0x0002100A\n#define GLFW_AUX_BUFFERS            0x0002100B\n#define GLFW_STEREO                 0x0002100C\n#define GLFW_SAMPLES                0x0002100D\n#define GLFW_SRGB_CAPABLE           0x0002100E\n#define GLFW_REFRESH_RATE           0x0002100F\n\n#define GLFW_CLIENT_API             0x00022001\n#define GLFW_CONTEXT_VERSION_MAJOR  0x00022002\n#define GLFW_CONTEXT_VERSION_MINOR  0x00022003\n#define GLFW_CONTEXT_REVISION       0x00022004\n#define GLFW_CONTEXT_ROBUSTNESS     0x00022005\n#define GLFW_OPENGL_FORWARD_COMPAT  0x00022006\n#define GLFW_OPENGL_DEBUG_CONTEXT   0x00022007\n#define GLFW_OPENGL_PROFILE         0x00022008\n\n#define GLFW_OPENGL_API             0x00030001\n#define GLFW_OPENGL_ES_API          0x00030002\n\n#define GLFW_NO_ROBUSTNESS                   0\n#define GLFW_NO_RESET_NOTIFICATION  0x00031001\n#define GLFW_LOSE_CONTEXT_ON_RESET  0x00031002\n\n#define GLFW_OPENGL_ANY_PROFILE              0\n#define GLFW_OPENGL_CORE_PROFILE    0x00032001\n#define GLFW_OPENGL_COMPAT_PROFILE  0x00032002\n\n#define GLFW_CURSOR                 0x00033001\n#define GLFW_STICKY_KEYS            0x00033002\n#define GLFW_STICKY_MOUSE_BUTTONS   0x00033003\n\n#define GLFW_CURSOR_NORMAL          0x00034001\n#define GLFW_CURSOR_HIDDEN          0x00034002\n#define GLFW_CURSOR_DISABLED        0x00034003\n\n#define GLFW_CONNECTED              0x00040001\n#define GLFW_DISCONNECTED           0x00040002\n\n\n/*************************************************************************\n * GLFW API types\n *************************************************************************/\n\n/*! @brief Client API function pointer type.\n *\n *  Generic function pointer used for returning client API function pointers\n *  without forcing a cast from a regular pointer.\n *\n *  @ingroup context\n */\ntypedef void (*GLFWglproc)(void);\n\n/*! @brief Opaque monitor object.\n *\n *  Opaque monitor object.\n *\n *  @ingroup monitor\n */\ntypedef struct GLFWmonitor GLFWmonitor;\n\n/*! @brief Opaque window object.\n *\n *  Opaque window object.\n *\n *  @ingroup window\n */\ntypedef struct GLFWwindow GLFWwindow;\n\n/*! @brief The function signature for error callbacks.\n *\n *  This is the function signature for error callback functions.\n *\n *  @param[in] error An [error code](@ref errors).\n *  @param[in] description A UTF-8 encoded string describing the error.\n *\n *  @sa glfwSetErrorCallback\n *\n *  @ingroup error\n */\ntypedef void (* GLFWerrorfun)(int,const char*);\n\n/*! @brief The function signature for window position callbacks.\n *\n *  This is the function signature for window position callback functions.\n *\n *  @param[in] window The window that the user moved.\n *  @param[in] xpos The new x-coordinate, in screen coordinates, of the\n *  upper-left corner of the client area of the window.\n *  @param[in] ypos The new y-coordinate, in screen coordinates, of the\n *  upper-left corner of the client area of the window.\n *\n *  @sa glfwSetWindowPosCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for window resize callbacks.\n *\n *  This is the function signature for window size callback functions.\n *\n *  @param[in] window The window that the user resized.\n *  @param[in] width The new width, in screen coordinates, of the window.\n *  @param[in] height The new height, in screen coordinates, of the window.\n *\n *  @sa glfwSetWindowSizeCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for window close callbacks.\n *\n *  This is the function signature for window close callback functions.\n *\n *  @param[in] window The window that the user attempted to close.\n *\n *  @sa glfwSetWindowCloseCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowclosefun)(GLFWwindow*);\n\n/*! @brief The function signature for window content refresh callbacks.\n *\n *  This is the function signature for window refresh callback functions.\n *\n *  @param[in] window The window whose content needs to be refreshed.\n *\n *  @sa glfwSetWindowRefreshCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowrefreshfun)(GLFWwindow*);\n\n/*! @brief The function signature for window focus/defocus callbacks.\n *\n *  This is the function signature for window focus callback functions.\n *\n *  @param[in] window The window that was focused or defocused.\n *  @param[in] focused `GL_TRUE` if the window was focused, or `GL_FALSE` if\n *  it was defocused.\n *\n *  @sa glfwSetWindowFocusCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for window iconify/restore callbacks.\n *\n *  This is the function signature for window iconify/restore callback\n *  functions.\n *\n *  @param[in] window The window that was iconified or restored.\n *  @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`\n *  if it was restored.\n *\n *  @sa glfwSetWindowIconifyCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for framebuffer resize callbacks.\n *\n *  This is the function signature for framebuffer resize callback\n *  functions.\n *\n *  @param[in] window The window whose framebuffer was resized.\n *  @param[in] width The new width, in pixels, of the framebuffer.\n *  @param[in] height The new height, in pixels, of the framebuffer.\n *\n *  @sa glfwSetFramebufferSizeCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for mouse button callbacks.\n *\n *  This is the function signature for mouse button callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] button The [mouse button](@ref buttons) that was pressed or\n *  released.\n *  @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were\n *  held down.\n *\n *  @sa glfwSetMouseButtonCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);\n\n/*! @brief The function signature for cursor position callbacks.\n *\n *  This is the function signature for cursor position callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] xpos The new x-coordinate, in screen coordinates, of the cursor.\n *  @param[in] ypos The new y-coordinate, in screen coordinates, of the cursor.\n *\n *  @sa glfwSetCursorPosCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);\n\n/*! @brief The function signature for cursor enter/leave callbacks.\n *\n *  This is the function signature for cursor enter/leave callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] entered `GL_TRUE` if the cursor entered the window's client\n *  area, or `GL_FALSE` if it left it.\n *\n *  @sa glfwSetCursorEnterCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcursorenterfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for scroll callbacks.\n *\n *  This is the function signature for scroll callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] xoffset The scroll offset along the x-axis.\n *  @param[in] yoffset The scroll offset along the y-axis.\n *\n *  @sa glfwSetScrollCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWscrollfun)(GLFWwindow*,double,double);\n\n/*! @brief The function signature for keyboard key callbacks.\n *\n *  This is the function signature for keyboard key callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] key The [keyboard key](@ref keys) that was pressed or released.\n *  @param[in] scancode The system-specific scancode of the key.\n *  @param[in] action @ref GLFW_PRESS, @ref GLFW_RELEASE or @ref GLFW_REPEAT.\n *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were\n *  held down.\n *\n *  @sa glfwSetKeyCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);\n\n/*! @brief The function signature for Unicode character callbacks.\n *\n *  This is the function signature for Unicode character callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] codepoint The Unicode code point of the character.\n *\n *  @sa glfwSetCharCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);\n\n/*! @brief The function signature for monitor configuration callbacks.\n *\n *  This is the function signature for monitor configuration callback functions.\n *\n *  @param[in] monitor The monitor that was connected or disconnected.\n *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.\n *\n *  @sa glfwSetMonitorCallback\n *\n *  @ingroup monitor\n */\ntypedef void (* GLFWmonitorfun)(GLFWmonitor*,int);\n\n/*! @brief Video mode type.\n *\n *  This describes a single video mode.\n *\n *  @ingroup monitor\n */\ntypedef struct GLFWvidmode\n{\n    /*! The width, in screen coordinates, of the video mode.\n     */\n    int width;\n    /*! The height, in screen coordinates, of the video mode.\n     */\n    int height;\n    /*! The bit depth of the red channel of the video mode.\n     */\n    int redBits;\n    /*! The bit depth of the green channel of the video mode.\n     */\n    int greenBits;\n    /*! The bit depth of the blue channel of the video mode.\n     */\n    int blueBits;\n    /*! The refresh rate, in Hz, of the video mode.\n     */\n    int refreshRate;\n} GLFWvidmode;\n\n/*! @brief Gamma ramp.\n *\n *  This describes the gamma ramp for a monitor.\n *\n *  @sa glfwGetGammaRamp glfwSetGammaRamp\n *\n *  @ingroup monitor\n */\ntypedef struct GLFWgammaramp\n{\n    /*! An array of value describing the response of the red channel.\n     */\n    unsigned short* red;\n    /*! An array of value describing the response of the green channel.\n     */\n    unsigned short* green;\n    /*! An array of value describing the response of the blue channel.\n     */\n    unsigned short* blue;\n    /*! The number of elements in each array.\n     */\n    unsigned int size;\n} GLFWgammaramp;\n\n\n/*************************************************************************\n * GLFW API functions\n *************************************************************************/\n\n/*! @brief Initializes the GLFW library.\n *\n *  This function initializes the GLFW library.  Before most GLFW functions can\n *  be used, GLFW must be initialized, and before a program terminates GLFW\n *  should be terminated in order to free any resources allocated during or\n *  after initialization.\n *\n *  If this function fails, it calls @ref glfwTerminate before returning.  If it\n *  succeeds, you should call @ref glfwTerminate before the program exits.\n *\n *  Additional calls to this function after successful initialization but before\n *  termination will succeed but will do nothing.\n *\n *  @return `GL_TRUE` if successful, or `GL_FALSE` if an error occurred.\n *\n *  @par New in GLFW 3\n *  This function no longer registers @ref glfwTerminate with `atexit`.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note **OS X:** This function will change the current directory of the\n *  application to the `Contents/Resources` subdirectory of the application's\n *  bundle, if present.\n *\n *  @sa glfwTerminate\n *\n *  @ingroup init\n */\nGLFWAPI int glfwInit(void);\n\n/*! @brief Terminates the GLFW library.\n *\n *  This function destroys all remaining windows, frees any allocated resources\n *  and sets the library to an uninitialized state.  Once this is called, you\n *  must again call @ref glfwInit successfully before you will be able to use\n *  most GLFW functions.\n *\n *  If GLFW has been successfully initialized, this function should be called\n *  before the program exits.  If initialization fails, there is no need to call\n *  this function, as it is called by @ref glfwInit before it returns failure.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @warning No window's context may be current on another thread when this\n *  function is called.\n *\n *  @sa glfwInit\n *\n *  @ingroup init\n */\nGLFWAPI void glfwTerminate(void);\n\n/*! @brief Retrieves the version of the GLFW library.\n *\n *  This function retrieves the major, minor and revision numbers of the GLFW\n *  library.  It is intended for when you are using GLFW as a shared library and\n *  want to ensure that you are using the minimum required version.\n *\n *  @param[out] major Where to store the major version number, or `NULL`.\n *  @param[out] minor Where to store the minor version number, or `NULL`.\n *  @param[out] rev Where to store the revision number, or `NULL`.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @remarks This function may be called from any thread.\n *\n *  @sa glfwGetVersionString\n *\n *  @ingroup init\n */\nGLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);\n\n/*! @brief Returns a string describing the compile-time configuration.\n *\n *  This function returns a static string generated at compile-time according to\n *  which configuration macros were defined.  This is intended for use when\n *  submitting bug reports, to allow developers to see which code paths are\n *  enabled in a binary.\n *\n *  The format of the string is as follows:\n *  - The version of GLFW\n *  - The name of the window system API\n *  - The name of the context creation API\n *  - Any additional options or APIs\n *\n *  For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL\n *  back ends, the version string may look something like this:\n *\n *      3.0.0 Win32 WGL MinGW\n *\n *  @return The GLFW version string.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @remarks This function may be called from any thread.\n *\n *  @sa glfwGetVersion\n *\n *  @ingroup init\n */\nGLFWAPI const char* glfwGetVersionString(void);\n\n/*! @brief Sets the error callback.\n *\n *  This function sets the error callback, which is called with an error code\n *  and a human-readable description each time a GLFW error occurs.\n *\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @note The error callback is called by the thread where the error was\n *  generated.  If you are using GLFW from multiple threads, your error callback\n *  needs to be written accordingly.\n *\n *  @note Because the description string provided to the callback may have been\n *  generated specifically for that error, it is not guaranteed to be valid\n *  after the callback has returned.  If you wish to use it after that, you need\n *  to make your own copy of it before returning.\n *\n *  @ingroup error\n */\nGLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);\n\n/*! @brief Returns the currently connected monitors.\n *\n *  This function returns an array of handles for all currently connected\n *  monitors.\n *\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of monitor handles, or `NULL` if an error occurred.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the monitor configuration\n *  changes.  See @ref glfwSetMonitorCallback to receive notifications of\n *  configuration changes.\n *\n *  @sa glfwGetPrimaryMonitor\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitor** glfwGetMonitors(int* count);\n\n/*! @brief Returns the primary monitor.\n *\n *  This function returns the primary monitor.  This is usually the monitor\n *  where elements like the Windows task bar or the OS X menu bar is located.\n *\n *  @return The primary monitor, or `NULL` if an error occurred.\n *\n *  @sa glfwGetMonitors\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);\n\n/*! @brief Returns the position of the monitor's viewport on the virtual screen.\n *\n *  This function returns the position, in screen coordinates, of the upper-left\n *  corner of the specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.\n *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);\n\n/*! @brief Returns the physical size of the monitor.\n *\n *  This function returns the size, in millimetres, of the display area of the\n *  specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] width Where to store the width, in mm, of the monitor's display\n *  area, or `NULL`.\n *  @param[out] height Where to store the height, in mm, of the monitor's\n *  display area, or `NULL`.\n *\n *  @note Some operating systems do not provide accurate information, either\n *  because the monitor's EDID data is incorrect, or because the driver does not\n *  report it accurately.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* height);\n\n/*! @brief Returns the name of the specified monitor.\n *\n *  This function returns a human-readable name, encoded as UTF-8, of the\n *  specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The UTF-8 encoded name of the monitor, or `NULL` if an error\n *  occurred.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @ingroup monitor\n */\nGLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);\n\n/*! @brief Sets the monitor configuration callback.\n *\n *  This function sets the monitor configuration callback, or removes the\n *  currently set callback.  This is called when a monitor is connected to or\n *  disconnected from the system.\n *\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @bug **X11:** This callback is not yet called on monitor configuration\n *  changes.\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);\n\n/*! @brief Returns the available video modes for the specified monitor.\n *\n *  This function returns an array of all video modes supported by the specified\n *  monitor.  The returned array is sorted in ascending order, first by color\n *  bit depth (the sum of all channel depths) and then by resolution area (the\n *  product of width and height).\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] count Where to store the number of video modes in the returned\n *  array.  This is set to zero if an error occurred.\n *  @return An array of video modes, or `NULL` if an error occurred.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until this function is called again\n *  for the specified monitor.\n *\n *  @sa glfwGetVideoMode\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);\n\n/*! @brief Returns the current mode of the specified monitor.\n *\n *  This function returns the current video mode of the specified monitor.  If\n *  you are using a full screen window, the return value will therefore depend\n *  on whether it is focused.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The current mode of the monitor, or `NULL` if an error occurred.\n *\n *  @note The returned struct is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @sa glfwGetVideoModes\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);\n\n/*! @brief Generates a gamma ramp and sets it for the specified monitor.\n *\n *  This function generates a 256-element gamma ramp from the specified exponent\n *  and then calls @ref glfwSetGammaRamp with it.\n *\n *  @param[in] monitor The monitor whose gamma ramp to set.\n *  @param[in] gamma The desired exponent.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);\n\n/*! @brief Retrieves the current gamma ramp for the specified monitor.\n *\n *  This function retrieves the current gamma ramp of the specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The current gamma ramp, or `NULL` if an error occurred.\n *\n *  @note The value arrays of the returned ramp are allocated and freed by GLFW.\n *  You should not free them yourself.\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);\n\n/*! @brief Sets the current gamma ramp for the specified monitor.\n *\n *  This function sets the current gamma ramp for the specified monitor.\n *\n *  @param[in] monitor The monitor whose gamma ramp to set.\n *  @param[in] ramp The gamma ramp to use.\n *\n *  @note Gamma ramp sizes other than 256 are not supported by all hardware.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);\n\n/*! @brief Resets all window hints to their default values.\n *\n *  This function resets all window hints to their\n *  [default values](@ref window_hints_values).\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwWindowHint\n *\n *  @ingroup window\n */\nGLFWAPI void glfwDefaultWindowHints(void);\n\n/*! @brief Sets the specified window hint to the desired value.\n *\n *  This function sets hints for the next call to @ref glfwCreateWindow.  The\n *  hints, once set, retain their values until changed by a call to @ref\n *  glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is\n *  terminated with @ref glfwTerminate.\n *\n *  @param[in] target The [window hint](@ref window_hints) to set.\n *  @param[in] hint The new value of the window hint.\n *\n *  @par New in GLFW 3\n *  Hints are no longer reset to their default values on window creation.  To\n *  set default hint values, use @ref glfwDefaultWindowHints.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwDefaultWindowHints\n *\n *  @ingroup window\n */\nGLFWAPI void glfwWindowHint(int target, int hint);\n\n/*! @brief Creates a window and its associated context.\n *\n *  This function creates a window and its associated context.  Most of the\n *  options controlling how the window and its context should be created are\n *  specified through @ref glfwWindowHint.\n *\n *  Successful creation does not change which context is current.  Before you\n *  can use the newly created context, you need to make it current using @ref\n *  glfwMakeContextCurrent.\n *\n *  Note that the created window and context may differ from what you requested,\n *  as not all parameters and hints are\n *  [hard constraints](@ref window_hints_hard).  This includes the size of the\n *  window, especially for full screen windows.  To retrieve the actual\n *  attributes of the created window and context, use queries like @ref\n *  glfwGetWindowAttrib and @ref glfwGetWindowSize.\n *\n *  To create a full screen window, you need to specify the monitor to use.  If\n *  no monitor is specified, windowed mode will be used.  Unless you have a way\n *  for the user to choose a specific monitor, it is recommended that you pick\n *  the primary monitor.  For more information on how to retrieve monitors, see\n *  @ref monitor_monitors.\n *\n *  To create the window at a specific position, make it initially invisible\n *  using the `GLFW_VISIBLE` window hint, set its position and then show it.\n *\n *  If a full screen window is active, the screensaver is prohibited from\n *  starting.\n *\n *  @param[in] width The desired width, in screen coordinates, of the window.\n *  This must be greater than zero.\n *  @param[in] height The desired height, in screen coordinates, of the window.\n *  This must be greater than zero.\n *  @param[in] title The initial, UTF-8 encoded window title.\n *  @param[in] monitor The monitor to use for full screen mode, or `NULL` to use\n *  windowed mode.\n *  @param[in] share The window whose context to share resources with, or `NULL`\n *  to not share resources.\n *  @return The handle of the created window, or `NULL` if an error occurred.\n *\n *  @remarks **Windows:** Window creation will fail if the Microsoft GDI\n *  software OpenGL implementation is the only one available.\n *\n *  @remarks **Windows:** If the executable has an icon resource named\n *  `GLFW_ICON,` it will be set as the icon for the window.  If no such icon is\n *  present, the `IDI_WINLOGO` icon will be used instead.\n *\n *  @remarks **OS X:** The GLFW window has no icon, as it is not a document\n *  window, but the dock icon will be the same as the application bundle's icon.\n *  Also, the first time a window is opened the menu bar is populated with\n *  common commands like Hide, Quit and About.  The (minimal) about dialog uses\n *  information from the application's bundle.  For more information on bundles,\n *  see the Bundle Programming Guide provided by Apple.\n *\n *  @remarks **X11:** There is no mechanism for setting the window icon yet.\n *\n *  @remarks The swap interval is not set during window creation, but is left at\n *  the default value for that platform.  For more information, see @ref\n *  glfwSwapInterval.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwDestroyWindow\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);\n\n/*! @brief Destroys the specified window and its context.\n *\n *  This function destroys the specified window and its context.  On calling\n *  this function, no further callbacks will be called for that window.\n *\n *  @param[in] window The window to destroy.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note If the window's context is current on the main thread, it is\n *  detached before being destroyed.\n *\n *  @warning The window's context must not be current on any other thread.\n *\n *  @sa glfwCreateWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwDestroyWindow(GLFWwindow* window);\n\n/*! @brief Checks the close flag of the specified window.\n *\n *  This function returns the value of the close flag of the specified window.\n *\n *  @param[in] window The window to query.\n *  @return The value of the close flag.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @ingroup window\n */\nGLFWAPI int glfwWindowShouldClose(GLFWwindow* window);\n\n/*! @brief Sets the close flag of the specified window.\n *\n *  This function sets the value of the close flag of the specified window.\n *  This can be used to override the user's attempt to close the window, or\n *  to signal that it should be closed.\n *\n *  @param[in] window The window whose flag to change.\n *  @param[in] value The new value.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);\n\n/*! @brief Sets the title of the specified window.\n *\n *  This function sets the window title, encoded as UTF-8, of the specified\n *  window.\n *\n *  @param[in] window The window whose title to change.\n *  @param[in] title The UTF-8 encoded window title.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);\n\n/*! @brief Retrieves the position of the client area of the specified window.\n *\n *  This function retrieves the position, in screen coordinates, of the\n *  upper-left corner of the client area of the specified window.\n *\n *  @param[in] window The window to query.\n *  @param[out] xpos Where to store the x-coordinate of the upper-left corner of\n *  the client area, or `NULL`.\n *  @param[out] ypos Where to store the y-coordinate of the upper-left corner of\n *  the client area, or `NULL`.\n *\n *  @sa glfwSetWindowPos\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);\n\n/*! @brief Sets the position of the client area of the specified window.\n *\n *  This function sets the position, in screen coordinates, of the upper-left\n *  corner of the client area of the window.\n *\n *  If the specified window is a full screen window, this function does nothing.\n *\n *  If you wish to set an initial window position you should create a hidden\n *  window (using @ref glfwWindowHint and `GLFW_VISIBLE`), set its position and\n *  then show it.\n *\n *  @param[in] window The window to query.\n *  @param[in] xpos The x-coordinate of the upper-left corner of the client area.\n *  @param[in] ypos The y-coordinate of the upper-left corner of the client area.\n *\n *  @note It is very rarely a good idea to move an already visible window, as it\n *  will confuse and annoy the user.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The window manager may put limits on what positions are allowed.\n *\n *  @sa glfwGetWindowPos\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);\n\n/*! @brief Retrieves the size of the client area of the specified window.\n *\n *  This function retrieves the size, in screen coordinates, of the client area\n *  of the specified window.  If you wish to retrieve the size of the\n *  framebuffer in pixels, see @ref glfwGetFramebufferSize.\n *\n *  @param[in] window The window whose size to retrieve.\n *  @param[out] width Where to store the width, in screen coordinates, of the\n *  client area, or `NULL`.\n *  @param[out] height Where to store the height, in screen coordinates, of the\n *  client area, or `NULL`.\n *\n *  @sa glfwSetWindowSize\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);\n\n/*! @brief Sets the size of the client area of the specified window.\n *\n *  This function sets the size, in screen coordinates, of the client area of\n *  the specified window.\n *\n *  For full screen windows, this function selects and switches to the resolution\n *  closest to the specified size, without affecting the window's context.  As\n *  the context is unaffected, the bit depths of the framebuffer remain\n *  unchanged.\n *\n *  @param[in] window The window to resize.\n *  @param[in] width The desired width of the specified window.\n *  @param[in] height The desired height of the specified window.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The window manager may put limits on what window sizes are allowed.\n *\n *  @sa glfwGetWindowSize\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);\n\n/*! @brief Retrieves the size of the framebuffer of the specified window.\n *\n *  This function retrieves the size, in pixels, of the framebuffer of the\n *  specified window.  If you wish to retrieve the size of the window in screen\n *  coordinates, see @ref glfwGetWindowSize.\n *\n *  @param[in] window The window whose framebuffer to query.\n *  @param[out] width Where to store the width, in pixels, of the framebuffer,\n *  or `NULL`.\n *  @param[out] height Where to store the height, in pixels, of the framebuffer,\n *  or `NULL`.\n *\n *  @sa glfwSetFramebufferSizeCallback\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);\n\n/*! @brief Iconifies the specified window.\n *\n *  This function iconifies/minimizes the specified window, if it was previously\n *  restored.  If it is a full screen window, the original monitor resolution is\n *  restored until the window is restored.  If the window is already iconified,\n *  this function does nothing.\n *\n *  @param[in] window The window to iconify.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwRestoreWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwIconifyWindow(GLFWwindow* window);\n\n/*! @brief Restores the specified window.\n *\n *  This function restores the specified window, if it was previously\n *  iconified/minimized.  If it is a full screen window, the resolution chosen\n *  for the window is restored on the selected monitor.  If the window is\n *  already restored, this function does nothing.\n *\n *  @param[in] window The window to restore.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwIconifyWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwRestoreWindow(GLFWwindow* window);\n\n/*! @brief Makes the specified window visible.\n *\n *  This function makes the specified window visible, if it was previously\n *  hidden.  If the window is already visible or is in full screen mode, this\n *  function does nothing.\n *\n *  @param[in] window The window to make visible.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwHideWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwShowWindow(GLFWwindow* window);\n\n/*! @brief Hides the specified window.\n *\n *  This function hides the specified window, if it was previously visible.  If\n *  the window is already hidden or is in full screen mode, this function does\n *  nothing.\n *\n *  @param[in] window The window to hide.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwShowWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwHideWindow(GLFWwindow* window);\n\n/*! @brief Returns the monitor that the window uses for full screen mode.\n *\n *  This function returns the handle of the monitor that the specified window is\n *  in full screen on.\n *\n *  @param[in] window The window to query.\n *  @return The monitor, or `NULL` if the window is in windowed mode.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);\n\n/*! @brief Returns an attribute of the specified window.\n *\n *  This function returns an attribute of the specified window.  There are many\n *  attributes, some related to the window and others to its context.\n *\n *  @param[in] window The window to query.\n *  @param[in] attrib The [window attribute](@ref window_attribs) whose value to\n *  return.\n *  @return The value of the attribute, or zero if an error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);\n\n/*! @brief Sets the user pointer of the specified window.\n *\n *  This function sets the user-defined pointer of the specified window.  The\n *  current value is retained until the window is destroyed.  The initial value\n *  is `NULL`.\n *\n *  @param[in] window The window whose pointer to set.\n *  @param[in] pointer The new value.\n *\n *  @sa glfwGetWindowUserPointer\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);\n\n/*! @brief Returns the user pointer of the specified window.\n *\n *  This function returns the current value of the user-defined pointer of the\n *  specified window.  The initial value is `NULL`.\n *\n *  @param[in] window The window whose pointer to return.\n *\n *  @sa glfwSetWindowUserPointer\n *\n *  @ingroup window\n */\nGLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);\n\n/*! @brief Sets the position callback for the specified window.\n *\n *  This function sets the position callback of the specified window, which is\n *  called when the window is moved.  The callback is provided with the screen\n *  position of the upper-left corner of the client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);\n\n/*! @brief Sets the size callback for the specified window.\n *\n *  This function sets the size callback of the specified window, which is\n *  called when the window is resized.  The callback is provided with the size,\n *  in screen coordinates, of the client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);\n\n/*! @brief Sets the close callback for the specified window.\n *\n *  This function sets the close callback of the specified window, which is\n *  called when the user attempts to close the window, for example by clicking\n *  the close widget in the title bar.\n *\n *  The close flag is set before this callback is called, but you can modify it\n *  at any time with @ref glfwSetWindowShouldClose.\n *\n *  The close callback is not triggered by @ref glfwDestroyWindow.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @par New in GLFW 3\n *  The close callback no longer returns a value.\n *\n *  @remarks **OS X:** Selecting Quit from the application menu will\n *  trigger the close callback for all windows.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);\n\n/*! @brief Sets the refresh callback for the specified window.\n *\n *  This function sets the refresh callback of the specified window, which is\n *  called when the client area of the window needs to be redrawn, for example\n *  if the window has been exposed after having been covered by another window.\n *\n *  On compositing window systems such as Aero, Compiz or Aqua, where the window\n *  contents are saved off-screen, this callback may be called only very\n *  infrequently or never at all.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @note On compositing window systems such as Aero, Compiz or Aqua, where the\n *  window contents are saved off-screen, this callback may be called only very\n *  infrequently or never at all.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);\n\n/*! @brief Sets the focus callback for the specified window.\n *\n *  This function sets the focus callback of the specified window, which is\n *  called when the window gains or loses focus.\n *\n *  After the focus callback is called for a window that lost focus, synthetic\n *  key and mouse button release events will be generated for all such that had\n *  been pressed.  For more information, see @ref glfwSetKeyCallback and @ref\n *  glfwSetMouseButtonCallback.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);\n\n/*! @brief Sets the iconify callback for the specified window.\n *\n *  This function sets the iconification callback of the specified window, which\n *  is called when the window is iconified or restored.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);\n\n/*! @brief Sets the framebuffer resize callback for the specified window.\n *\n *  This function sets the framebuffer resize callback of the specified window,\n *  which is called when the framebuffer of the specified window is resized.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);\n\n/*! @brief Processes all pending events.\n *\n *  This function processes only those events that have already been received\n *  and then returns immediately.  Processing events will cause the window and\n *  input callbacks associated with those events to be called.\n *\n *  This function is not required for joystick input to work.\n *\n *  @par New in GLFW 3\n *  This function is no longer called by @ref glfwSwapBuffers.  You need to call\n *  it or @ref glfwWaitEvents yourself.\n *\n *  @remarks On some platforms, a window move, resize or menu operation will\n *  cause event processing to block.  This is due to how event processing is\n *  designed on those platforms.  You can use the\n *  [window refresh callback](@ref GLFWwindowrefreshfun) to redraw the contents\n *  of your window when necessary during the operation.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note On some platforms, certain callbacks may be called outside of a call\n *  to one of the event processing functions.\n *\n *  @sa glfwWaitEvents\n *\n *  @ingroup window\n */\nGLFWAPI void glfwPollEvents(void);\n\n/*! @brief Waits until events are pending and processes them.\n *\n *  This function puts the calling thread to sleep until at least one event has\n *  been received.  Once one or more events have been received, it behaves as if\n *  @ref glfwPollEvents was called, i.e. the events are processed and the\n *  function then returns immediately.  Processing events will cause the window\n *  and input callbacks associated with those events to be called.\n *\n *  Since not all events are associated with callbacks, this function may return\n *  without a callback having been called even if you are monitoring all\n *  callbacks.\n *\n *  This function is not required for joystick input to work.\n *\n *  @remarks On some platforms, a window move, resize or menu operation will\n *  cause event processing to block.  This is due to how event processing is\n *  designed on those platforms.  You can use the\n *  [window refresh callback](@ref GLFWwindowrefreshfun) to redraw the contents\n *  of your window when necessary during the operation.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note On some platforms, certain callbacks may be called outside of a call\n *  to one of the event processing functions.\n *\n *  @sa glfwPollEvents\n *\n *  @ingroup window\n */\nGLFWAPI void glfwWaitEvents(void);\n\n/*! @brief Returns the value of an input option for the specified window.\n *\n *  @param[in] window The window to query.\n *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or\n *  `GLFW_STICKY_MOUSE_BUTTONS`.\n *\n *  @sa glfwSetInputMode\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);\n\n/*! @brief Sets an input option for the specified window.\n *  @param[in] window The window whose input mode to set.\n *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or\n *  `GLFW_STICKY_MOUSE_BUTTONS`.\n *  @param[in] value The new value of the specified input mode.\n *\n *  If `mode` is `GLFW_CURSOR`, the value must be one of the supported input\n *  modes:\n *  - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.\n *  - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client\n *    area of the window but does not restrict the cursor from leaving.  This is\n *    useful if you wish to render your own cursor or have no visible cursor at\n *    all.\n *  - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual\n *    and unlimited cursor movement.  This is useful for implementing for\n *    example 3D camera controls.\n *\n *  If `mode` is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to\n *  enable sticky keys, or `GL_FALSE` to disable it.  If sticky keys are\n *  enabled, a key press will ensure that @ref glfwGetKey returns @ref\n *  GLFW_PRESS the next time it is called even if the key had been released\n *  before the call.  This is useful when you are only interested in whether\n *  keys have been pressed but not when or in which order.\n *\n *  If `mode` is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either `GL_TRUE`\n *  to enable sticky mouse buttons, or `GL_FALSE` to disable it.  If sticky\n *  mouse buttons are enabled, a mouse button press will ensure that @ref\n *  glfwGetMouseButton returns @ref GLFW_PRESS the next time it is called even\n *  if the mouse button had been released before the call.  This is useful when\n *  you are only interested in whether mouse buttons have been pressed but not\n *  when or in which order.\n *\n *  @sa glfwGetInputMode\n *\n *  @ingroup input\n */\nGLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);\n\n/*! @brief Returns the last reported state of a keyboard key for the specified\n *  window.\n *\n *  This function returns the last state reported for the specified key to the\n *  specified window.  The returned state is one of `GLFW_PRESS` or\n *  `GLFW_RELEASE`.  The higher-level state `GLFW_REPEAT` is only reported to\n *  the key callback.\n *\n *  If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns\n *  `GLFW_PRESS` the first time you call this function after a key has been\n *  pressed, even if the key has already been released.\n *\n *  The key functions deal with physical keys, with [key tokens](@ref keys)\n *  named after their use on the standard US keyboard layout.  If you want to\n *  input text, use the Unicode character callback instead.\n *\n *  @param[in] window The desired window.\n *  @param[in] key The desired [keyboard key](@ref keys).\n *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *\n *  @note `GLFW_KEY_UNKNOWN` is not a valid key for this function.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetKey(GLFWwindow* window, int key);\n\n/*! @brief Returns the last reported state of a mouse button for the specified\n *  window.\n *\n *  This function returns the last state reported for the specified mouse button\n *  to the specified window.\n *\n *  If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function\n *  returns `GLFW_PRESS` the first time you call this function after a mouse\n *  button has been pressed, even if the mouse button has already been released.\n *\n *  @param[in] window The desired window.\n *  @param[in] button The desired [mouse button](@ref buttons).\n *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);\n\n/*! @brief Retrieves the last reported cursor position, relative to the client\n *  area of the window.\n *\n *  This function returns the last reported position of the cursor, in screen\n *  coordinates, relative to the upper-left corner of the client area of the\n *  specified window.\n *\n *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor\n *  position is unbounded and limited only by the minimum and maximum values of\n *  a `double`.\n *\n *  The coordinate can be converted to their integer equivalents with the\n *  `floor` function.  Casting directly to an integer type works for positive\n *  coordinates, but fails for negative ones.\n *\n *  @param[in] window The desired window.\n *  @param[out] xpos Where to store the cursor x-coordinate, relative to the\n *  left edge of the client area, or `NULL`.\n *  @param[out] ypos Where to store the cursor y-coordinate, relative to the to\n *  top edge of the client area, or `NULL`.\n *\n *  @sa glfwSetCursorPos\n *\n *  @ingroup input\n */\nGLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);\n\n/*! @brief Sets the position of the cursor, relative to the client area of the\n *  window.\n *\n *  This function sets the position, in screen coordinates, of the cursor\n *  relative to the upper-left corner of the client area of the specified\n *  window.  The window must be focused.  If the window does not have focus when\n *  this function is called, it fails silently.\n *\n *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor\n *  position is unbounded and limited only by the minimum and maximum values of\n *  a `double`.\n *\n *  @param[in] window The desired window.\n *  @param[in] xpos The desired x-coordinate, relative to the left edge of the\n *  client area.\n *  @param[in] ypos The desired y-coordinate, relative to the top edge of the\n *  client area.\n *\n *  @sa glfwGetCursorPos\n *\n *  @ingroup input\n */\nGLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);\n\n/*! @brief Sets the key callback.\n *\n *  This function sets the key callback of the specific window, which is called\n *  when a key is pressed, repeated or released.\n *\n *  The key functions deal with physical keys, with layout independent\n *  [key tokens](@ref keys) named after their values in the standard US keyboard\n *  layout.  If you want to input text, use the\n *  [character callback](@ref glfwSetCharCallback) instead.\n *\n *  When a window loses focus, it will generate synthetic key release events\n *  for all pressed keys.  You can tell these events from user-generated events\n *  by the fact that the synthetic ones are generated after the window has lost\n *  focus, i.e. `GLFW_FOCUSED` will be false and the focus callback will have\n *  already been called.\n *\n *  The scancode of a key is specific to that platform or sometimes even to that\n *  machine.  Scancodes are intended to allow users to bind keys that don't have\n *  a GLFW key token.  Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their\n *  state is not saved and so it cannot be retrieved with @ref glfwGetKey.\n *\n *  Sometimes GLFW needs to generate synthetic key events, in which case the\n *  scancode may be zero.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new key callback, or `NULL` to remove the currently\n *  set callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);\n\n/*! @brief Sets the Unicode character callback.\n *\n *  This function sets the character callback of the specific window, which is\n *  called when a Unicode character is input.\n *\n *  The character callback is intended for text input.  If you want to know\n *  whether a specific key was pressed or released, use the\n *  [key callback](@ref glfwSetKeyCallback) instead.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);\n\n/*! @brief Sets the mouse button callback.\n *\n *  This function sets the mouse button callback of the specified window, which\n *  is called when a mouse button is pressed or released.\n *\n *  When a window loses focus, it will generate synthetic mouse button release\n *  events for all pressed mouse buttons.  You can tell these events from\n *  user-generated events by the fact that the synthetic ones are generated\n *  after the window has lost focus, i.e. `GLFW_FOCUSED` will be false and the\n *  focus callback will have already been called.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);\n\n/*! @brief Sets the cursor position callback.\n *\n *  This function sets the cursor position callback of the specified window,\n *  which is called when the cursor is moved.  The callback is provided with the\n *  position, in screen coordinates, relative to the upper-left corner of the\n *  client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);\n\n/*! @brief Sets the cursor enter/exit callback.\n *\n *  This function sets the cursor boundary crossing callback of the specified\n *  window, which is called when the cursor enters or leaves the client area of\n *  the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);\n\n/*! @brief Sets the scroll callback.\n *\n *  This function sets the scroll callback of the specified window, which is\n *  called when a scrolling device is used, such as a mouse wheel or scrolling\n *  area of a touchpad.\n *\n *  The scroll callback receives all scrolling input, like that from a mouse\n *  wheel or a touchpad scrolling area.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new scroll callback, or `NULL` to remove the currently\n *  set callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);\n\n/*! @brief Returns whether the specified joystick is present.\n *\n *  This function returns whether the specified joystick is present.\n *\n *  @param[in] joy The joystick to query.\n *  @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwJoystickPresent(int joy);\n\n/*! @brief Returns the values of all axes of the specified joystick.\n *\n *  This function returns the values of all axes of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of axis values, or `NULL` if the joystick is not present.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the next call to @ref\n *  glfwGetJoystickAxes for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const float* glfwGetJoystickAxes(int joy, int* count);\n\n/*! @brief Returns the state of all buttons of the specified joystick.\n *\n *  This function returns the state of all buttons of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of button states, or `NULL` if the joystick is not present.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the next call to @ref\n *  glfwGetJoystickButtons for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count);\n\n/*! @brief Returns the name of the specified joystick.\n *\n *  This function returns the name, encoded as UTF-8, of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick\n *  is not present.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned string is valid only until the next call to @ref\n *  glfwGetJoystickName for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const char* glfwGetJoystickName(int joy);\n\n/*! @brief Sets the clipboard to the specified string.\n *\n *  This function sets the system clipboard to the specified, UTF-8 encoded\n *  string.  The string is copied before returning, so you don't have to retain\n *  it afterwards.\n *\n *  @param[in] window The window that will own the clipboard contents.\n *  @param[in] string A UTF-8 encoded string.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwGetClipboardString\n *\n *  @ingroup clipboard\n */\nGLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);\n\n/*! @brief Retrieves the contents of the clipboard as a string.\n *\n *  This function returns the contents of the system clipboard, if it contains\n *  or is convertible to a UTF-8 encoded string.\n *\n *  @param[in] window The window that will request the clipboard contents.\n *  @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`\n *  if an error occurred.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned string is valid only until the next call to @ref\n *  glfwGetClipboardString or @ref glfwSetClipboardString.\n *\n *  @sa glfwSetClipboardString\n *\n *  @ingroup clipboard\n */\nGLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);\n\n/*! @brief Returns the value of the GLFW timer.\n *\n *  This function returns the value of the GLFW timer.  Unless the timer has\n *  been set using @ref glfwSetTime, the timer measures time elapsed since GLFW\n *  was initialized.\n *\n *  @return The current value, in seconds, or zero if an error occurred.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note The resolution of the timer is system dependent, but is usually on the\n *  order of a few micro- or nanoseconds.  It uses the highest-resolution\n *  monotonic time source on each supported platform.\n *\n *  @ingroup time\n */\nGLFWAPI double glfwGetTime(void);\n\n/*! @brief Sets the GLFW timer.\n *\n *  This function sets the value of the GLFW timer.  It then continues to count\n *  up from that value.\n *\n *  @param[in] time The new value, in seconds.\n *\n *  @note The resolution of the timer is system dependent, but is usually on the\n *  order of a few micro- or nanoseconds.  It uses the highest-resolution\n *  monotonic time source on each supported platform.\n *\n *  @ingroup time\n */\nGLFWAPI void glfwSetTime(double time);\n\n/*! @brief Makes the context of the specified window current for the calling\n *  thread.\n *\n *  This function makes the context of the specified window current on the\n *  calling thread.  A context can only be made current on a single thread at\n *  a time and each thread can have only a single current context at a time.\n *\n *  @param[in] window The window whose context to make current, or `NULL` to\n *  detach the current context.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @sa glfwGetCurrentContext\n *\n *  @ingroup context\n */\nGLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);\n\n/*! @brief Returns the window whose context is current on the calling thread.\n *\n *  This function returns the window whose context is current on the calling\n *  thread.\n *\n *  @return The window whose context is current, or `NULL` if no window's\n *  context is current.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @sa glfwMakeContextCurrent\n *\n *  @ingroup context\n */\nGLFWAPI GLFWwindow* glfwGetCurrentContext(void);\n\n/*! @brief Swaps the front and back buffers of the specified window.\n *\n *  This function swaps the front and back buffers of the specified window.  If\n *  the swap interval is greater than zero, the GPU driver waits the specified\n *  number of screen updates before swapping the buffers.\n *\n *  @param[in] window The window whose buffers to swap.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @par New in GLFW 3\n *  This function no longer calls @ref glfwPollEvents.  You need to call it or\n *  @ref glfwWaitEvents yourself.\n *\n *  @sa glfwSwapInterval\n *\n *  @ingroup context\n */\nGLFWAPI void glfwSwapBuffers(GLFWwindow* window);\n\n/*! @brief Sets the swap interval for the current context.\n *\n *  This function sets the swap interval for the current context, i.e. the\n *  number of screen updates to wait before swapping the buffers of a window and\n *  returning from @ref glfwSwapBuffers.  This is sometimes called 'vertical\n *  synchronization', 'vertical retrace synchronization' or 'vsync'.\n *\n *  Contexts that support either of the `WGL_EXT_swap_control_tear` and\n *  `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals,\n *  which allow the driver to swap even if a frame arrives a little bit late.\n *  You can check for the presence of these extensions using @ref\n *  glfwExtensionSupported.  For more information about swap tearing, see the\n *  extension specifications.\n *\n *  @param[in] interval The minimum number of screen updates to wait for\n *  until the buffers are swapped by @ref glfwSwapBuffers.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note This function is not called during window creation, leaving the swap\n *  interval set to whatever is the default on that platform.  This is done\n *  because some swap interval extensions used by GLFW do not allow the swap\n *  interval to be reset to zero once it has been set to a non-zero value.\n *\n *  @note Some GPU drivers do not honor the requested swap interval, either\n *  because of user settings that override the request or due to bugs in the\n *  driver.\n *\n *  @sa glfwSwapBuffers\n *\n *  @ingroup context\n */\nGLFWAPI void glfwSwapInterval(int interval);\n\n/*! @brief Returns whether the specified extension is available.\n *\n *  This function returns whether the specified\n *  [OpenGL or context creation API extension](@ref context_glext) is supported\n *  by the current context.  For example, on Windows both the OpenGL and WGL\n *  extension strings are checked.\n *\n *  @param[in] extension The ASCII encoded name of the extension.\n *  @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note As this functions searches one or more extension strings on each call,\n *  it is recommended that you cache its results if it's going to be used\n *  frequently.  The extension strings will not change during the lifetime of\n *  a context, so there is no danger in doing this.\n *\n *  @ingroup context\n */\nGLFWAPI int glfwExtensionSupported(const char* extension);\n\n/*! @brief Returns the address of the specified function for the current\n *  context.\n *\n *  This function returns the address of the specified\n *  [client API or extension function](@ref context_glext), if it is supported\n *  by the current context.\n *\n *  @param[in] procname The ASCII encoded name of the function.\n *  @return The address of the function, or `NULL` if the function is\n *  unavailable.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note The addresses of these functions are not guaranteed to be the same for\n *  all contexts, especially if they use different client APIs or even different\n *  context creation hints.\n *\n *  @ingroup context\n */\nGLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);\n\n\n/*************************************************************************\n * Global definition cleanup\n *************************************************************************/\n\n/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */\n\n#ifdef GLFW_WINGDIAPI_DEFINED\n #undef WINGDIAPI\n #undef GLFW_WINGDIAPI_DEFINED\n#endif\n\n#ifdef GLFW_CALLBACK_DEFINED\n #undef CALLBACK\n #undef GLFW_CALLBACK_DEFINED\n#endif\n\n/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _glfw3_h_ */\n\n"
  },
  {
    "path": "cocos2d/external/glfw3/include/mac/glfw3native.h",
    "content": "/*************************************************************************\n * GLFW 3.0 - www.glfw.org\n * A library for OpenGL, window and input\n *------------------------------------------------------------------------\n * Copyright (c) 2002-2006 Marcus Geelnard\n * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n *\n * This software is provided 'as-is', without any express or implied\n * warranty. In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would\n *    be appreciated but is not required.\n *\n * 2. Altered source versions must be plainly marked as such, and must not\n *    be misrepresented as being the original software.\n *\n * 3. This notice may not be removed or altered from any source\n *    distribution.\n *\n *************************************************************************/\n\n#ifndef _glfw3_native_h_\n#define _glfw3_native_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/*************************************************************************\n * Doxygen documentation\n *************************************************************************/\n\n/*! @defgroup native Native access\n *\n *  **By using the native API, you assert that you know what you're doing and\n *  how to fix problems caused by using it.  If you don't, you shouldn't be\n *  using it.**\n *\n *  Before the inclusion of @ref glfw3native.h, you must define exactly one\n *  window API macro and exactly one context API macro.  Failure to do this\n *  will cause a compile-time error.\n *\n *  The available window API macros are:\n *  * `GLFW_EXPOSE_NATIVE_WIN32`\n *  * `GLFW_EXPOSE_NATIVE_COCOA`\n *  * `GLFW_EXPOSE_NATIVE_X11`\n *\n *  The available context API macros are:\n *  * `GLFW_EXPOSE_NATIVE_WGL`\n *  * `GLFW_EXPOSE_NATIVE_NSGL`\n *  * `GLFW_EXPOSE_NATIVE_GLX`\n *  * `GLFW_EXPOSE_NATIVE_EGL`\n *\n *  These macros select which of the native access functions that are declared\n *  and which platform-specific headers to include.  It is then up your (by\n *  definition platform-specific) code to handle which of these should be\n *  defined.\n */\n\n\n/*************************************************************************\n * System headers and types\n *************************************************************************/\n\n#if defined(GLFW_EXPOSE_NATIVE_WIN32)\n #include <windows.h>\n#elif defined(GLFW_EXPOSE_NATIVE_COCOA)\n #if defined(__OBJC__)\n  #import <Cocoa/Cocoa.h>\n #else\n  typedef void* id;\n #endif\n#elif defined(GLFW_EXPOSE_NATIVE_X11)\n #include <X11/Xlib.h>\n#else\n #error \"No window API specified\"\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_WGL)\n /* WGL is declared by windows.h */\n#elif defined(GLFW_EXPOSE_NATIVE_NSGL)\n /* NSGL is declared by Cocoa.h */\n#elif defined(GLFW_EXPOSE_NATIVE_GLX)\n #include <GL/glx.h>\n#elif defined(GLFW_EXPOSE_NATIVE_EGL)\n #include <EGL/egl.h>\n#else\n #error \"No context API specified\"\n#endif\n\n\n/*************************************************************************\n * Functions\n *************************************************************************/\n\n#if defined(GLFW_EXPOSE_NATIVE_WIN32)\n/*! @brief Returns the `HWND` of the specified window.\n *  @return The `HWND` of the specified window.\n *  @ingroup native\n */\nGLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_WGL)\n/*! @brief Returns the `HGLRC` of the specified window.\n *  @return The `HGLRC` of the specified window.\n *  @ingroup native\n */\nGLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_COCOA)\n/*! @brief Returns the `NSWindow` of the specified window.\n *  @return The `NSWindow` of the specified window.\n *  @ingroup native\n */\nGLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_NSGL)\n/*! @brief Returns the `NSOpenGLContext` of the specified window.\n *  @return The `NSOpenGLContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI id glfwGetNSGLContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_X11)\n/*! @brief Returns the `Display` used by GLFW.\n *  @return The `Display` used by GLFW.\n *  @ingroup native\n */\nGLFWAPI Display* glfwGetX11Display(void);\n/*! @brief Returns the `Window` of the specified window.\n *  @return The `Window` of the specified window.\n *  @ingroup native\n */\nGLFWAPI Window glfwGetX11Window(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_GLX)\n/*! @brief Returns the `GLXContext` of the specified window.\n *  @return The `GLXContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_EGL)\n/*! @brief Returns the `EGLDisplay` used by GLFW.\n *  @return The `EGLDisplay` used by GLFW.\n *  @ingroup native\n */\nGLFWAPI EGLDisplay glfwGetEGLDisplay(void);\n/*! @brief Returns the `EGLContext` of the specified window.\n *  @return The `EGLContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);\n/*! @brief Returns the `EGLSurface` of the specified window.\n *  @return The `EGLSurface` of the specified window.\n *  @ingroup native\n */\nGLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _glfw3_native_h_ */\n\n"
  },
  {
    "path": "cocos2d/external/glfw3/include/win32/glfw3.h",
    "content": "/*************************************************************************\n * GLFW 3.0 - www.glfw.org\n * A library for OpenGL, window and input\n *------------------------------------------------------------------------\n * Copyright (c) 2002-2006 Marcus Geelnard\n * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n *\n * This software is provided 'as-is', without any express or implied\n * warranty. In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would\n *    be appreciated but is not required.\n *\n * 2. Altered source versions must be plainly marked as such, and must not\n *    be misrepresented as being the original software.\n *\n * 3. This notice may not be removed or altered from any source\n *    distribution.\n *\n *************************************************************************/\n\n#ifndef _glfw3_h_\n#define _glfw3_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/*************************************************************************\n * Doxygen documentation\n *************************************************************************/\n\n/*! @defgroup clipboard Clipboard support\n */\n/*! @defgroup context Context handling\n */\n/*! @defgroup error Error handling\n */\n/*! @defgroup init Initialization and version information\n */\n/*! @defgroup input Input handling\n */\n/*! @defgroup monitor Monitor handling\n *\n *  This is the reference documentation for monitor related functions and types.\n *  For more information, see the @ref monitor.\n */\n/*! @defgroup time Time input\n */\n/*! @defgroup window Window handling\n *\n *  This is the reference documentation for window related functions and types,\n *  including creation, deletion and event polling.  For more information, see\n *  the @ref window.\n */\n\n\n/*************************************************************************\n * Global definitions\n *************************************************************************/\n\n/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */\n\n/* Please report any problems that you find with your compiler, which may\n * be solved in this section! There are several compilers that I have not\n * been able to test this file with yet.\n *\n * First: If we are we on Windows, we want a single define for it (_WIN32)\n * (Note: For Cygwin the compiler flag -mwin32 should be used, but to\n * make sure that things run smoothly for Cygwin users, we add __CYGWIN__\n * to the list of \"valid Win32 identifiers\", which removes the need for\n * -mwin32)\n */\n#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__))\n #define _WIN32\n#endif /* _WIN32 */\n\n/* In order for extension support to be portable, we need to define an\n * OpenGL function call method. We use the keyword APIENTRY, which is\n * defined for Win32. (Note: Windows also needs this for <GL/gl.h>)\n */\n#ifndef APIENTRY\n #ifdef _WIN32\n  #define APIENTRY __stdcall\n #else\n  #define APIENTRY\n #endif\n#endif /* APIENTRY */\n\n/* The following three defines are here solely to make some Windows-based\n * <GL/gl.h> files happy. Theoretically we could include <windows.h>, but\n * it has the major drawback of severely polluting our namespace.\n */\n\n/* Under Windows, we need WINGDIAPI defined */\n#if !defined(WINGDIAPI) && defined(_WIN32)\n #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)\n  /* Microsoft Visual C++, Borland C++ Builder and Pelles C */\n  #define WINGDIAPI __declspec(dllimport)\n #elif defined(__LCC__)\n  /* LCC-Win32 */\n  #define WINGDIAPI __stdcall\n #else\n  /* Others (e.g. MinGW, Cygwin) */\n  #define WINGDIAPI extern\n #endif\n #define GLFW_WINGDIAPI_DEFINED\n#endif /* WINGDIAPI */\n\n/* Some <GL/glu.h> files also need CALLBACK defined */\n#if !defined(CALLBACK) && defined(_WIN32)\n #if defined(_MSC_VER)\n  /* Microsoft Visual C++ */\n  #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)\n   #define CALLBACK __stdcall\n  #else\n   #define CALLBACK\n  #endif\n #else\n  /* Other Windows compilers */\n  #define CALLBACK __stdcall\n #endif\n #define GLFW_CALLBACK_DEFINED\n#endif /* CALLBACK */\n\n/* Most GL/glu.h variants on Windows need wchar_t\n * OpenGL/gl.h blocks the definition of ptrdiff_t by glext.h on OS X */\n#if !defined(GLFW_INCLUDE_NONE)\n #include <stddef.h>\n#endif\n\n/* Include the chosen client API headers.\n */\n#if defined(__APPLE_CC__)\n  #if defined(GLFW_INCLUDE_GLCOREARB)\n    #include <OpenGL/gl3.h>\n  #elif !defined(GLFW_INCLUDE_NONE)\n    #define GL_GLEXT_LEGACY\n    #include <OpenGL/gl.h>\n  #endif\n  #if defined(GLFW_INCLUDE_GLU)\n    #include <OpenGL/glu.h>\n  #endif\n#else\n  #if defined(GLFW_INCLUDE_GLCOREARB)\n    #include <GL/glcorearb.h>\n  #elif defined(GLFW_INCLUDE_ES1)\n    #include <GLES/gl.h>\n  #elif defined(GLFW_INCLUDE_ES2)\n    #include <GLES2/gl2.h>\n  #elif defined(GLFW_INCLUDE_ES3)\n    #include <GLES3/gl3.h>\n  #elif !defined(GLFW_INCLUDE_NONE)\n    #include <GL/gl.h>\n  #endif\n  #if defined(GLFW_INCLUDE_GLU)\n    #include <GL/glu.h>\n  #endif\n#endif\n\n#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)\n /* GLFW_DLL is defined by users of GLFW when compiling programs that will link\n  * to the DLL version of the GLFW library.  _GLFW_BUILD_DLL is defined by the\n  * GLFW configuration header when compiling the DLL version of the library.\n  */\n #error \"You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined\"\n#endif\n\n#if defined(_WIN32) && defined(_GLFW_BUILD_DLL)\n\n /* We are building a Win32 DLL */\n #define GLFWAPI __declspec(dllexport)\n\n#elif defined(_WIN32) && defined(GLFW_DLL)\n\n /* We are calling a Win32 DLL */\n #if defined(__LCC__)\n  #define GLFWAPI extern\n #else\n  #define GLFWAPI __declspec(dllimport)\n #endif\n\n#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)\n\n #define GLFWAPI __attribute__((visibility(\"default\")))\n\n#else\n\n /* We are either building/calling a static lib or we are non-win32 */\n #define GLFWAPI\n\n#endif\n\n/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */\n\n\n/*************************************************************************\n * GLFW API tokens\n *************************************************************************/\n\n/*! @name GLFW version macros\n *  @{ */\n/*! @brief The major version number of the GLFW library.\n *\n *  This is incremented when the API is changed in non-compatible ways.\n *  @ingroup init\n */\n#define GLFW_VERSION_MAJOR          3\n/*! @brief The minor version number of the GLFW library.\n *\n *  This is incremented when features are added to the API but it remains\n *  backward-compatible.\n *  @ingroup init\n */\n#define GLFW_VERSION_MINOR          0\n/*! @brief The revision number of the GLFW library.\n *\n *  This is incremented when a bug fix release is made that does not contain any\n *  API changes.\n *  @ingroup init\n */\n#define GLFW_VERSION_REVISION       4\n/*! @} */\n\n/*! @name Key and button actions\n *  @{ */\n/*! @brief The key or button was released.\n *  @ingroup input\n */\n#define GLFW_RELEASE                0\n/*! @brief The key or button was pressed.\n *  @ingroup input\n */\n#define GLFW_PRESS                  1\n/*! @brief The key was held down until it repeated.\n *  @ingroup input\n */\n#define GLFW_REPEAT                 2\n/*! @} */\n\n/*! @defgroup keys Keyboard keys\n *\n * These key codes are inspired by the *USB HID Usage Tables v1.12* (p. 53-60),\n * but re-arranged to map to 7-bit ASCII for printable keys (function keys are\n * put in the 256+ range).\n *\n * The naming of the key codes follow these rules:\n *  - The US keyboard layout is used\n *  - Names of printable alpha-numeric characters are used (e.g. \"A\", \"R\",\n *    \"3\", etc.)\n *  - For non-alphanumeric characters, Unicode:ish names are used (e.g.\n *    \"COMMA\", \"LEFT_SQUARE_BRACKET\", etc.). Note that some names do not\n *    correspond to the Unicode standard (usually for brevity)\n *  - Keys that lack a clear US mapping are named \"WORLD_x\"\n *  - For non-printable keys, custom names are used (e.g. \"F4\",\n *    \"BACKSPACE\", etc.)\n *\n *  @ingroup input\n *  @{\n */\n\n/* The unknown key */\n#define GLFW_KEY_UNKNOWN            -1\n\n/* Printable keys */\n#define GLFW_KEY_SPACE              32\n#define GLFW_KEY_APOSTROPHE         39  /* ' */\n#define GLFW_KEY_COMMA              44  /* , */\n#define GLFW_KEY_MINUS              45  /* - */\n#define GLFW_KEY_PERIOD             46  /* . */\n#define GLFW_KEY_SLASH              47  /* / */\n#define GLFW_KEY_0                  48\n#define GLFW_KEY_1                  49\n#define GLFW_KEY_2                  50\n#define GLFW_KEY_3                  51\n#define GLFW_KEY_4                  52\n#define GLFW_KEY_5                  53\n#define GLFW_KEY_6                  54\n#define GLFW_KEY_7                  55\n#define GLFW_KEY_8                  56\n#define GLFW_KEY_9                  57\n#define GLFW_KEY_SEMICOLON          59  /* ; */\n#define GLFW_KEY_EQUAL              61  /* = */\n#define GLFW_KEY_A                  65\n#define GLFW_KEY_B                  66\n#define GLFW_KEY_C                  67\n#define GLFW_KEY_D                  68\n#define GLFW_KEY_E                  69\n#define GLFW_KEY_F                  70\n#define GLFW_KEY_G                  71\n#define GLFW_KEY_H                  72\n#define GLFW_KEY_I                  73\n#define GLFW_KEY_J                  74\n#define GLFW_KEY_K                  75\n#define GLFW_KEY_L                  76\n#define GLFW_KEY_M                  77\n#define GLFW_KEY_N                  78\n#define GLFW_KEY_O                  79\n#define GLFW_KEY_P                  80\n#define GLFW_KEY_Q                  81\n#define GLFW_KEY_R                  82\n#define GLFW_KEY_S                  83\n#define GLFW_KEY_T                  84\n#define GLFW_KEY_U                  85\n#define GLFW_KEY_V                  86\n#define GLFW_KEY_W                  87\n#define GLFW_KEY_X                  88\n#define GLFW_KEY_Y                  89\n#define GLFW_KEY_Z                  90\n#define GLFW_KEY_LEFT_BRACKET       91  /* [ */\n#define GLFW_KEY_BACKSLASH          92  /* \\ */\n#define GLFW_KEY_RIGHT_BRACKET      93  /* ] */\n#define GLFW_KEY_GRAVE_ACCENT       96  /* ` */\n#define GLFW_KEY_WORLD_1            161 /* non-US #1 */\n#define GLFW_KEY_WORLD_2            162 /* non-US #2 */\n\n/* Function keys */\n#define GLFW_KEY_ESCAPE             256\n#define GLFW_KEY_ENTER              257\n#define GLFW_KEY_TAB                258\n#define GLFW_KEY_BACKSPACE          259\n#define GLFW_KEY_INSERT             260\n#define GLFW_KEY_DELETE             261\n#define GLFW_KEY_RIGHT              262\n#define GLFW_KEY_LEFT               263\n#define GLFW_KEY_DOWN               264\n#define GLFW_KEY_UP                 265\n#define GLFW_KEY_PAGE_UP            266\n#define GLFW_KEY_PAGE_DOWN          267\n#define GLFW_KEY_HOME               268\n#define GLFW_KEY_END                269\n#define GLFW_KEY_CAPS_LOCK          280\n#define GLFW_KEY_SCROLL_LOCK        281\n#define GLFW_KEY_NUM_LOCK           282\n#define GLFW_KEY_PRINT_SCREEN       283\n#define GLFW_KEY_PAUSE              284\n#define GLFW_KEY_F1                 290\n#define GLFW_KEY_F2                 291\n#define GLFW_KEY_F3                 292\n#define GLFW_KEY_F4                 293\n#define GLFW_KEY_F5                 294\n#define GLFW_KEY_F6                 295\n#define GLFW_KEY_F7                 296\n#define GLFW_KEY_F8                 297\n#define GLFW_KEY_F9                 298\n#define GLFW_KEY_F10                299\n#define GLFW_KEY_F11                300\n#define GLFW_KEY_F12                301\n#define GLFW_KEY_F13                302\n#define GLFW_KEY_F14                303\n#define GLFW_KEY_F15                304\n#define GLFW_KEY_F16                305\n#define GLFW_KEY_F17                306\n#define GLFW_KEY_F18                307\n#define GLFW_KEY_F19                308\n#define GLFW_KEY_F20                309\n#define GLFW_KEY_F21                310\n#define GLFW_KEY_F22                311\n#define GLFW_KEY_F23                312\n#define GLFW_KEY_F24                313\n#define GLFW_KEY_F25                314\n#define GLFW_KEY_KP_0               320\n#define GLFW_KEY_KP_1               321\n#define GLFW_KEY_KP_2               322\n#define GLFW_KEY_KP_3               323\n#define GLFW_KEY_KP_4               324\n#define GLFW_KEY_KP_5               325\n#define GLFW_KEY_KP_6               326\n#define GLFW_KEY_KP_7               327\n#define GLFW_KEY_KP_8               328\n#define GLFW_KEY_KP_9               329\n#define GLFW_KEY_KP_DECIMAL         330\n#define GLFW_KEY_KP_DIVIDE          331\n#define GLFW_KEY_KP_MULTIPLY        332\n#define GLFW_KEY_KP_SUBTRACT        333\n#define GLFW_KEY_KP_ADD             334\n#define GLFW_KEY_KP_ENTER           335\n#define GLFW_KEY_KP_EQUAL           336\n#define GLFW_KEY_LEFT_SHIFT         340\n#define GLFW_KEY_LEFT_CONTROL       341\n#define GLFW_KEY_LEFT_ALT           342\n#define GLFW_KEY_LEFT_SUPER         343\n#define GLFW_KEY_RIGHT_SHIFT        344\n#define GLFW_KEY_RIGHT_CONTROL      345\n#define GLFW_KEY_RIGHT_ALT          346\n#define GLFW_KEY_RIGHT_SUPER        347\n#define GLFW_KEY_MENU               348\n#define GLFW_KEY_LAST               GLFW_KEY_MENU\n\n/*! @} */\n\n/*! @defgroup mods Modifier key flags\n *  @ingroup input\n *  @{ */\n\n/*! @brief If this bit is set one or more Shift keys were held down.\n */\n#define GLFW_MOD_SHIFT           0x0001\n/*! @brief If this bit is set one or more Control keys were held down.\n */\n#define GLFW_MOD_CONTROL         0x0002\n/*! @brief If this bit is set one or more Alt keys were held down.\n */\n#define GLFW_MOD_ALT             0x0004\n/*! @brief If this bit is set one or more Super keys were held down.\n */\n#define GLFW_MOD_SUPER           0x0008\n\n/*! @} */\n\n/*! @defgroup buttons Mouse buttons\n *  @ingroup input\n *  @{ */\n#define GLFW_MOUSE_BUTTON_1         0\n#define GLFW_MOUSE_BUTTON_2         1\n#define GLFW_MOUSE_BUTTON_3         2\n#define GLFW_MOUSE_BUTTON_4         3\n#define GLFW_MOUSE_BUTTON_5         4\n#define GLFW_MOUSE_BUTTON_6         5\n#define GLFW_MOUSE_BUTTON_7         6\n#define GLFW_MOUSE_BUTTON_8         7\n#define GLFW_MOUSE_BUTTON_LAST      GLFW_MOUSE_BUTTON_8\n#define GLFW_MOUSE_BUTTON_LEFT      GLFW_MOUSE_BUTTON_1\n#define GLFW_MOUSE_BUTTON_RIGHT     GLFW_MOUSE_BUTTON_2\n#define GLFW_MOUSE_BUTTON_MIDDLE    GLFW_MOUSE_BUTTON_3\n/*! @} */\n\n/*! @defgroup joysticks Joysticks\n *  @ingroup input\n *  @{ */\n#define GLFW_JOYSTICK_1             0\n#define GLFW_JOYSTICK_2             1\n#define GLFW_JOYSTICK_3             2\n#define GLFW_JOYSTICK_4             3\n#define GLFW_JOYSTICK_5             4\n#define GLFW_JOYSTICK_6             5\n#define GLFW_JOYSTICK_7             6\n#define GLFW_JOYSTICK_8             7\n#define GLFW_JOYSTICK_9             8\n#define GLFW_JOYSTICK_10            9\n#define GLFW_JOYSTICK_11            10\n#define GLFW_JOYSTICK_12            11\n#define GLFW_JOYSTICK_13            12\n#define GLFW_JOYSTICK_14            13\n#define GLFW_JOYSTICK_15            14\n#define GLFW_JOYSTICK_16            15\n#define GLFW_JOYSTICK_LAST          GLFW_JOYSTICK_16\n/*! @} */\n\n/*! @defgroup errors Error codes\n *  @ingroup error\n *  @{ */\n/*! @brief GLFW has not been initialized.\n */\n#define GLFW_NOT_INITIALIZED        0x00010001\n/*! @brief No context is current for this thread.\n */\n#define GLFW_NO_CURRENT_CONTEXT     0x00010002\n/*! @brief One of the enum parameters for the function was given an invalid\n *  enum.\n */\n#define GLFW_INVALID_ENUM           0x00010003\n/*! @brief One of the parameters for the function was given an invalid value.\n */\n#define GLFW_INVALID_VALUE          0x00010004\n/*! @brief A memory allocation failed.\n */\n#define GLFW_OUT_OF_MEMORY          0x00010005\n/*! @brief GLFW could not find support for the requested client API on the\n *  system.\n */\n#define GLFW_API_UNAVAILABLE        0x00010006\n/*! @brief The requested client API version is not available.\n */\n#define GLFW_VERSION_UNAVAILABLE    0x00010007\n/*! @brief A platform-specific error occurred that does not match any of the\n *  more specific categories.\n */\n#define GLFW_PLATFORM_ERROR         0x00010008\n/*! @brief The clipboard did not contain data in the requested format.\n */\n#define GLFW_FORMAT_UNAVAILABLE     0x00010009\n/*! @} */\n\n#define GLFW_FOCUSED                0x00020001\n#define GLFW_ICONIFIED              0x00020002\n#define GLFW_RESIZABLE              0x00020003\n#define GLFW_VISIBLE                0x00020004\n#define GLFW_DECORATED              0x00020005\n\n#define GLFW_RED_BITS               0x00021001\n#define GLFW_GREEN_BITS             0x00021002\n#define GLFW_BLUE_BITS              0x00021003\n#define GLFW_ALPHA_BITS             0x00021004\n#define GLFW_DEPTH_BITS             0x00021005\n#define GLFW_STENCIL_BITS           0x00021006\n#define GLFW_ACCUM_RED_BITS         0x00021007\n#define GLFW_ACCUM_GREEN_BITS       0x00021008\n#define GLFW_ACCUM_BLUE_BITS        0x00021009\n#define GLFW_ACCUM_ALPHA_BITS       0x0002100A\n#define GLFW_AUX_BUFFERS            0x0002100B\n#define GLFW_STEREO                 0x0002100C\n#define GLFW_SAMPLES                0x0002100D\n#define GLFW_SRGB_CAPABLE           0x0002100E\n#define GLFW_REFRESH_RATE           0x0002100F\n\n#define GLFW_CLIENT_API             0x00022001\n#define GLFW_CONTEXT_VERSION_MAJOR  0x00022002\n#define GLFW_CONTEXT_VERSION_MINOR  0x00022003\n#define GLFW_CONTEXT_REVISION       0x00022004\n#define GLFW_CONTEXT_ROBUSTNESS     0x00022005\n#define GLFW_OPENGL_FORWARD_COMPAT  0x00022006\n#define GLFW_OPENGL_DEBUG_CONTEXT   0x00022007\n#define GLFW_OPENGL_PROFILE         0x00022008\n\n#define GLFW_OPENGL_API             0x00030001\n#define GLFW_OPENGL_ES_API          0x00030002\n\n#define GLFW_NO_ROBUSTNESS                   0\n#define GLFW_NO_RESET_NOTIFICATION  0x00031001\n#define GLFW_LOSE_CONTEXT_ON_RESET  0x00031002\n\n#define GLFW_OPENGL_ANY_PROFILE              0\n#define GLFW_OPENGL_CORE_PROFILE    0x00032001\n#define GLFW_OPENGL_COMPAT_PROFILE  0x00032002\n\n#define GLFW_CURSOR                 0x00033001\n#define GLFW_STICKY_KEYS            0x00033002\n#define GLFW_STICKY_MOUSE_BUTTONS   0x00033003\n\n#define GLFW_CURSOR_NORMAL          0x00034001\n#define GLFW_CURSOR_HIDDEN          0x00034002\n#define GLFW_CURSOR_DISABLED        0x00034003\n\n#define GLFW_CONNECTED              0x00040001\n#define GLFW_DISCONNECTED           0x00040002\n\n\n/*************************************************************************\n * GLFW API types\n *************************************************************************/\n\n/*! @brief Client API function pointer type.\n *\n *  Generic function pointer used for returning client API function pointers\n *  without forcing a cast from a regular pointer.\n *\n *  @ingroup context\n */\ntypedef void (*GLFWglproc)(void);\n\n/*! @brief Opaque monitor object.\n *\n *  Opaque monitor object.\n *\n *  @ingroup monitor\n */\ntypedef struct GLFWmonitor GLFWmonitor;\n\n/*! @brief Opaque window object.\n *\n *  Opaque window object.\n *\n *  @ingroup window\n */\ntypedef struct GLFWwindow GLFWwindow;\n\n/*! @brief The function signature for error callbacks.\n *\n *  This is the function signature for error callback functions.\n *\n *  @param[in] error An [error code](@ref errors).\n *  @param[in] description A UTF-8 encoded string describing the error.\n *\n *  @sa glfwSetErrorCallback\n *\n *  @ingroup error\n */\ntypedef void (* GLFWerrorfun)(int,const char*);\n\n/*! @brief The function signature for window position callbacks.\n *\n *  This is the function signature for window position callback functions.\n *\n *  @param[in] window The window that the user moved.\n *  @param[in] xpos The new x-coordinate, in screen coordinates, of the\n *  upper-left corner of the client area of the window.\n *  @param[in] ypos The new y-coordinate, in screen coordinates, of the\n *  upper-left corner of the client area of the window.\n *\n *  @sa glfwSetWindowPosCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for window resize callbacks.\n *\n *  This is the function signature for window size callback functions.\n *\n *  @param[in] window The window that the user resized.\n *  @param[in] width The new width, in screen coordinates, of the window.\n *  @param[in] height The new height, in screen coordinates, of the window.\n *\n *  @sa glfwSetWindowSizeCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for window close callbacks.\n *\n *  This is the function signature for window close callback functions.\n *\n *  @param[in] window The window that the user attempted to close.\n *\n *  @sa glfwSetWindowCloseCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowclosefun)(GLFWwindow*);\n\n/*! @brief The function signature for window content refresh callbacks.\n *\n *  This is the function signature for window refresh callback functions.\n *\n *  @param[in] window The window whose content needs to be refreshed.\n *\n *  @sa glfwSetWindowRefreshCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowrefreshfun)(GLFWwindow*);\n\n/*! @brief The function signature for window focus/defocus callbacks.\n *\n *  This is the function signature for window focus callback functions.\n *\n *  @param[in] window The window that was focused or defocused.\n *  @param[in] focused `GL_TRUE` if the window was focused, or `GL_FALSE` if\n *  it was defocused.\n *\n *  @sa glfwSetWindowFocusCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for window iconify/restore callbacks.\n *\n *  This is the function signature for window iconify/restore callback\n *  functions.\n *\n *  @param[in] window The window that was iconified or restored.\n *  @param[in] iconified `GL_TRUE` if the window was iconified, or `GL_FALSE`\n *  if it was restored.\n *\n *  @sa glfwSetWindowIconifyCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for framebuffer resize callbacks.\n *\n *  This is the function signature for framebuffer resize callback\n *  functions.\n *\n *  @param[in] window The window whose framebuffer was resized.\n *  @param[in] width The new width, in pixels, of the framebuffer.\n *  @param[in] height The new height, in pixels, of the framebuffer.\n *\n *  @sa glfwSetFramebufferSizeCallback\n *\n *  @ingroup window\n */\ntypedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);\n\n/*! @brief The function signature for mouse button callbacks.\n *\n *  This is the function signature for mouse button callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] button The [mouse button](@ref buttons) that was pressed or\n *  released.\n *  @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were\n *  held down.\n *\n *  @sa glfwSetMouseButtonCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);\n\n/*! @brief The function signature for cursor position callbacks.\n *\n *  This is the function signature for cursor position callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] xpos The new x-coordinate, in screen coordinates, of the cursor.\n *  @param[in] ypos The new y-coordinate, in screen coordinates, of the cursor.\n *\n *  @sa glfwSetCursorPosCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);\n\n/*! @brief The function signature for cursor enter/leave callbacks.\n *\n *  This is the function signature for cursor enter/leave callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] entered `GL_TRUE` if the cursor entered the window's client\n *  area, or `GL_FALSE` if it left it.\n *\n *  @sa glfwSetCursorEnterCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcursorenterfun)(GLFWwindow*,int);\n\n/*! @brief The function signature for scroll callbacks.\n *\n *  This is the function signature for scroll callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] xoffset The scroll offset along the x-axis.\n *  @param[in] yoffset The scroll offset along the y-axis.\n *\n *  @sa glfwSetScrollCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWscrollfun)(GLFWwindow*,double,double);\n\n/*! @brief The function signature for keyboard key callbacks.\n *\n *  This is the function signature for keyboard key callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] key The [keyboard key](@ref keys) that was pressed or released.\n *  @param[in] scancode The system-specific scancode of the key.\n *  @param[in] action @ref GLFW_PRESS, @ref GLFW_RELEASE or @ref GLFW_REPEAT.\n *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were\n *  held down.\n *\n *  @sa glfwSetKeyCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);\n\n/*! @brief The function signature for Unicode character callbacks.\n *\n *  This is the function signature for Unicode character callback functions.\n *\n *  @param[in] window The window that received the event.\n *  @param[in] codepoint The Unicode code point of the character.\n *\n *  @sa glfwSetCharCallback\n *\n *  @ingroup input\n */\ntypedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);\n\n/*! @brief The function signature for monitor configuration callbacks.\n *\n *  This is the function signature for monitor configuration callback functions.\n *\n *  @param[in] monitor The monitor that was connected or disconnected.\n *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.\n *\n *  @sa glfwSetMonitorCallback\n *\n *  @ingroup monitor\n */\ntypedef void (* GLFWmonitorfun)(GLFWmonitor*,int);\n\n/*! @brief Video mode type.\n *\n *  This describes a single video mode.\n *\n *  @ingroup monitor\n */\ntypedef struct GLFWvidmode\n{\n    /*! The width, in screen coordinates, of the video mode.\n     */\n    int width;\n    /*! The height, in screen coordinates, of the video mode.\n     */\n    int height;\n    /*! The bit depth of the red channel of the video mode.\n     */\n    int redBits;\n    /*! The bit depth of the green channel of the video mode.\n     */\n    int greenBits;\n    /*! The bit depth of the blue channel of the video mode.\n     */\n    int blueBits;\n    /*! The refresh rate, in Hz, of the video mode.\n     */\n    int refreshRate;\n} GLFWvidmode;\n\n/*! @brief Gamma ramp.\n *\n *  This describes the gamma ramp for a monitor.\n *\n *  @sa glfwGetGammaRamp glfwSetGammaRamp\n *\n *  @ingroup monitor\n */\ntypedef struct GLFWgammaramp\n{\n    /*! An array of value describing the response of the red channel.\n     */\n    unsigned short* red;\n    /*! An array of value describing the response of the green channel.\n     */\n    unsigned short* green;\n    /*! An array of value describing the response of the blue channel.\n     */\n    unsigned short* blue;\n    /*! The number of elements in each array.\n     */\n    unsigned int size;\n} GLFWgammaramp;\n\n\n/*************************************************************************\n * GLFW API functions\n *************************************************************************/\n\n/*! @brief Initializes the GLFW library.\n *\n *  This function initializes the GLFW library.  Before most GLFW functions can\n *  be used, GLFW must be initialized, and before a program terminates GLFW\n *  should be terminated in order to free any resources allocated during or\n *  after initialization.\n *\n *  If this function fails, it calls @ref glfwTerminate before returning.  If it\n *  succeeds, you should call @ref glfwTerminate before the program exits.\n *\n *  Additional calls to this function after successful initialization but before\n *  termination will succeed but will do nothing.\n *\n *  @return `GL_TRUE` if successful, or `GL_FALSE` if an error occurred.\n *\n *  @par New in GLFW 3\n *  This function no longer registers @ref glfwTerminate with `atexit`.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note **OS X:** This function will change the current directory of the\n *  application to the `Contents/Resources` subdirectory of the application's\n *  bundle, if present.\n *\n *  @sa glfwTerminate\n *\n *  @ingroup init\n */\nGLFWAPI int glfwInit(void);\n\n/*! @brief Terminates the GLFW library.\n *\n *  This function destroys all remaining windows, frees any allocated resources\n *  and sets the library to an uninitialized state.  Once this is called, you\n *  must again call @ref glfwInit successfully before you will be able to use\n *  most GLFW functions.\n *\n *  If GLFW has been successfully initialized, this function should be called\n *  before the program exits.  If initialization fails, there is no need to call\n *  this function, as it is called by @ref glfwInit before it returns failure.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @warning No window's context may be current on another thread when this\n *  function is called.\n *\n *  @sa glfwInit\n *\n *  @ingroup init\n */\nGLFWAPI void glfwTerminate(void);\n\n/*! @brief Retrieves the version of the GLFW library.\n *\n *  This function retrieves the major, minor and revision numbers of the GLFW\n *  library.  It is intended for when you are using GLFW as a shared library and\n *  want to ensure that you are using the minimum required version.\n *\n *  @param[out] major Where to store the major version number, or `NULL`.\n *  @param[out] minor Where to store the minor version number, or `NULL`.\n *  @param[out] rev Where to store the revision number, or `NULL`.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @remarks This function may be called from any thread.\n *\n *  @sa glfwGetVersionString\n *\n *  @ingroup init\n */\nGLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);\n\n/*! @brief Returns a string describing the compile-time configuration.\n *\n *  This function returns a static string generated at compile-time according to\n *  which configuration macros were defined.  This is intended for use when\n *  submitting bug reports, to allow developers to see which code paths are\n *  enabled in a binary.\n *\n *  The format of the string is as follows:\n *  - The version of GLFW\n *  - The name of the window system API\n *  - The name of the context creation API\n *  - Any additional options or APIs\n *\n *  For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL\n *  back ends, the version string may look something like this:\n *\n *      3.0.0 Win32 WGL MinGW\n *\n *  @return The GLFW version string.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @remarks This function may be called from any thread.\n *\n *  @sa glfwGetVersion\n *\n *  @ingroup init\n */\nGLFWAPI const char* glfwGetVersionString(void);\n\n/*! @brief Sets the error callback.\n *\n *  This function sets the error callback, which is called with an error code\n *  and a human-readable description each time a GLFW error occurs.\n *\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @remarks This function may be called before @ref glfwInit.\n *\n *  @note The error callback is called by the thread where the error was\n *  generated.  If you are using GLFW from multiple threads, your error callback\n *  needs to be written accordingly.\n *\n *  @note Because the description string provided to the callback may have been\n *  generated specifically for that error, it is not guaranteed to be valid\n *  after the callback has returned.  If you wish to use it after that, you need\n *  to make your own copy of it before returning.\n *\n *  @ingroup error\n */\nGLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);\n\n/*! @brief Returns the currently connected monitors.\n *\n *  This function returns an array of handles for all currently connected\n *  monitors.\n *\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of monitor handles, or `NULL` if an error occurred.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the monitor configuration\n *  changes.  See @ref glfwSetMonitorCallback to receive notifications of\n *  configuration changes.\n *\n *  @sa glfwGetPrimaryMonitor\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitor** glfwGetMonitors(int* count);\n\n/*! @brief Returns the primary monitor.\n *\n *  This function returns the primary monitor.  This is usually the monitor\n *  where elements like the Windows task bar or the OS X menu bar is located.\n *\n *  @return The primary monitor, or `NULL` if an error occurred.\n *\n *  @sa glfwGetMonitors\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);\n\n/*! @brief Returns the position of the monitor's viewport on the virtual screen.\n *\n *  This function returns the position, in screen coordinates, of the upper-left\n *  corner of the specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.\n *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);\n\n/*! @brief Returns the physical size of the monitor.\n *\n *  This function returns the size, in millimetres, of the display area of the\n *  specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] width Where to store the width, in mm, of the monitor's display\n *  area, or `NULL`.\n *  @param[out] height Where to store the height, in mm, of the monitor's\n *  display area, or `NULL`.\n *\n *  @note Some operating systems do not provide accurate information, either\n *  because the monitor's EDID data is incorrect, or because the driver does not\n *  report it accurately.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* height);\n\n/*! @brief Returns the name of the specified monitor.\n *\n *  This function returns a human-readable name, encoded as UTF-8, of the\n *  specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The UTF-8 encoded name of the monitor, or `NULL` if an error\n *  occurred.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @ingroup monitor\n */\nGLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);\n\n/*! @brief Sets the monitor configuration callback.\n *\n *  This function sets the monitor configuration callback, or removes the\n *  currently set callback.  This is called when a monitor is connected to or\n *  disconnected from the system.\n *\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @bug **X11:** This callback is not yet called on monitor configuration\n *  changes.\n *\n *  @ingroup monitor\n */\nGLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);\n\n/*! @brief Returns the available video modes for the specified monitor.\n *\n *  This function returns an array of all video modes supported by the specified\n *  monitor.  The returned array is sorted in ascending order, first by color\n *  bit depth (the sum of all channel depths) and then by resolution area (the\n *  product of width and height).\n *\n *  @param[in] monitor The monitor to query.\n *  @param[out] count Where to store the number of video modes in the returned\n *  array.  This is set to zero if an error occurred.\n *  @return An array of video modes, or `NULL` if an error occurred.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until this function is called again\n *  for the specified monitor.\n *\n *  @sa glfwGetVideoMode\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count);\n\n/*! @brief Returns the current mode of the specified monitor.\n *\n *  This function returns the current video mode of the specified monitor.  If\n *  you are using a full screen window, the return value will therefore depend\n *  on whether it is focused.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The current mode of the monitor, or `NULL` if an error occurred.\n *\n *  @note The returned struct is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @sa glfwGetVideoModes\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);\n\n/*! @brief Generates a gamma ramp and sets it for the specified monitor.\n *\n *  This function generates a 256-element gamma ramp from the specified exponent\n *  and then calls @ref glfwSetGammaRamp with it.\n *\n *  @param[in] monitor The monitor whose gamma ramp to set.\n *  @param[in] gamma The desired exponent.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);\n\n/*! @brief Retrieves the current gamma ramp for the specified monitor.\n *\n *  This function retrieves the current gamma ramp of the specified monitor.\n *\n *  @param[in] monitor The monitor to query.\n *  @return The current gamma ramp, or `NULL` if an error occurred.\n *\n *  @note The value arrays of the returned ramp are allocated and freed by GLFW.\n *  You should not free them yourself.\n *\n *  @ingroup monitor\n */\nGLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);\n\n/*! @brief Sets the current gamma ramp for the specified monitor.\n *\n *  This function sets the current gamma ramp for the specified monitor.\n *\n *  @param[in] monitor The monitor whose gamma ramp to set.\n *  @param[in] ramp The gamma ramp to use.\n *\n *  @note Gamma ramp sizes other than 256 are not supported by all hardware.\n *\n *  @ingroup monitor\n */\nGLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);\n\n/*! @brief Resets all window hints to their default values.\n *\n *  This function resets all window hints to their\n *  [default values](@ref window_hints_values).\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwWindowHint\n *\n *  @ingroup window\n */\nGLFWAPI void glfwDefaultWindowHints(void);\n\n/*! @brief Sets the specified window hint to the desired value.\n *\n *  This function sets hints for the next call to @ref glfwCreateWindow.  The\n *  hints, once set, retain their values until changed by a call to @ref\n *  glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is\n *  terminated with @ref glfwTerminate.\n *\n *  @param[in] target The [window hint](@ref window_hints) to set.\n *  @param[in] hint The new value of the window hint.\n *\n *  @par New in GLFW 3\n *  Hints are no longer reset to their default values on window creation.  To\n *  set default hint values, use @ref glfwDefaultWindowHints.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwDefaultWindowHints\n *\n *  @ingroup window\n */\nGLFWAPI void glfwWindowHint(int target, int hint);\n\n/*! @brief Creates a window and its associated context.\n *\n *  This function creates a window and its associated context.  Most of the\n *  options controlling how the window and its context should be created are\n *  specified through @ref glfwWindowHint.\n *\n *  Successful creation does not change which context is current.  Before you\n *  can use the newly created context, you need to make it current using @ref\n *  glfwMakeContextCurrent.\n *\n *  Note that the created window and context may differ from what you requested,\n *  as not all parameters and hints are\n *  [hard constraints](@ref window_hints_hard).  This includes the size of the\n *  window, especially for full screen windows.  To retrieve the actual\n *  attributes of the created window and context, use queries like @ref\n *  glfwGetWindowAttrib and @ref glfwGetWindowSize.\n *\n *  To create a full screen window, you need to specify the monitor to use.  If\n *  no monitor is specified, windowed mode will be used.  Unless you have a way\n *  for the user to choose a specific monitor, it is recommended that you pick\n *  the primary monitor.  For more information on how to retrieve monitors, see\n *  @ref monitor_monitors.\n *\n *  To create the window at a specific position, make it initially invisible\n *  using the `GLFW_VISIBLE` window hint, set its position and then show it.\n *\n *  If a full screen window is active, the screensaver is prohibited from\n *  starting.\n *\n *  @param[in] width The desired width, in screen coordinates, of the window.\n *  This must be greater than zero.\n *  @param[in] height The desired height, in screen coordinates, of the window.\n *  This must be greater than zero.\n *  @param[in] title The initial, UTF-8 encoded window title.\n *  @param[in] monitor The monitor to use for full screen mode, or `NULL` to use\n *  windowed mode.\n *  @param[in] share The window whose context to share resources with, or `NULL`\n *  to not share resources.\n *  @return The handle of the created window, or `NULL` if an error occurred.\n *\n *  @remarks **Windows:** Window creation will fail if the Microsoft GDI\n *  software OpenGL implementation is the only one available.\n *\n *  @remarks **Windows:** If the executable has an icon resource named\n *  `GLFW_ICON,` it will be set as the icon for the window.  If no such icon is\n *  present, the `IDI_WINLOGO` icon will be used instead.\n *\n *  @remarks **OS X:** The GLFW window has no icon, as it is not a document\n *  window, but the dock icon will be the same as the application bundle's icon.\n *  Also, the first time a window is opened the menu bar is populated with\n *  common commands like Hide, Quit and About.  The (minimal) about dialog uses\n *  information from the application's bundle.  For more information on bundles,\n *  see the Bundle Programming Guide provided by Apple.\n *\n *  @remarks **X11:** There is no mechanism for setting the window icon yet.\n *\n *  @remarks The swap interval is not set during window creation, but is left at\n *  the default value for that platform.  For more information, see @ref\n *  glfwSwapInterval.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwDestroyWindow\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share);\n\n/*! @brief Destroys the specified window and its context.\n *\n *  This function destroys the specified window and its context.  On calling\n *  this function, no further callbacks will be called for that window.\n *\n *  @param[in] window The window to destroy.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note If the window's context is current on the main thread, it is\n *  detached before being destroyed.\n *\n *  @warning The window's context must not be current on any other thread.\n *\n *  @sa glfwCreateWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwDestroyWindow(GLFWwindow* window);\n\n/*! @brief Checks the close flag of the specified window.\n *\n *  This function returns the value of the close flag of the specified window.\n *\n *  @param[in] window The window to query.\n *  @return The value of the close flag.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @ingroup window\n */\nGLFWAPI int glfwWindowShouldClose(GLFWwindow* window);\n\n/*! @brief Sets the close flag of the specified window.\n *\n *  This function sets the value of the close flag of the specified window.\n *  This can be used to override the user's attempt to close the window, or\n *  to signal that it should be closed.\n *\n *  @param[in] window The window whose flag to change.\n *  @param[in] value The new value.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);\n\n/*! @brief Sets the title of the specified window.\n *\n *  This function sets the window title, encoded as UTF-8, of the specified\n *  window.\n *\n *  @param[in] window The window whose title to change.\n *  @param[in] title The UTF-8 encoded window title.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);\n\n/*! @brief Retrieves the position of the client area of the specified window.\n *\n *  This function retrieves the position, in screen coordinates, of the\n *  upper-left corner of the client area of the specified window.\n *\n *  @param[in] window The window to query.\n *  @param[out] xpos Where to store the x-coordinate of the upper-left corner of\n *  the client area, or `NULL`.\n *  @param[out] ypos Where to store the y-coordinate of the upper-left corner of\n *  the client area, or `NULL`.\n *\n *  @sa glfwSetWindowPos\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);\n\n/*! @brief Sets the position of the client area of the specified window.\n *\n *  This function sets the position, in screen coordinates, of the upper-left\n *  corner of the client area of the window.\n *\n *  If the specified window is a full screen window, this function does nothing.\n *\n *  If you wish to set an initial window position you should create a hidden\n *  window (using @ref glfwWindowHint and `GLFW_VISIBLE`), set its position and\n *  then show it.\n *\n *  @param[in] window The window to query.\n *  @param[in] xpos The x-coordinate of the upper-left corner of the client area.\n *  @param[in] ypos The y-coordinate of the upper-left corner of the client area.\n *\n *  @note It is very rarely a good idea to move an already visible window, as it\n *  will confuse and annoy the user.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The window manager may put limits on what positions are allowed.\n *\n *  @sa glfwGetWindowPos\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);\n\n/*! @brief Retrieves the size of the client area of the specified window.\n *\n *  This function retrieves the size, in screen coordinates, of the client area\n *  of the specified window.  If you wish to retrieve the size of the\n *  framebuffer in pixels, see @ref glfwGetFramebufferSize.\n *\n *  @param[in] window The window whose size to retrieve.\n *  @param[out] width Where to store the width, in screen coordinates, of the\n *  client area, or `NULL`.\n *  @param[out] height Where to store the height, in screen coordinates, of the\n *  client area, or `NULL`.\n *\n *  @sa glfwSetWindowSize\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);\n\n/*! @brief Sets the size of the client area of the specified window.\n *\n *  This function sets the size, in screen coordinates, of the client area of\n *  the specified window.\n *\n *  For full screen windows, this function selects and switches to the resolution\n *  closest to the specified size, without affecting the window's context.  As\n *  the context is unaffected, the bit depths of the framebuffer remain\n *  unchanged.\n *\n *  @param[in] window The window to resize.\n *  @param[in] width The desired width of the specified window.\n *  @param[in] height The desired height of the specified window.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The window manager may put limits on what window sizes are allowed.\n *\n *  @sa glfwGetWindowSize\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height);\n\n/*! @brief Retrieves the size of the framebuffer of the specified window.\n *\n *  This function retrieves the size, in pixels, of the framebuffer of the\n *  specified window.  If you wish to retrieve the size of the window in screen\n *  coordinates, see @ref glfwGetWindowSize.\n *\n *  @param[in] window The window whose framebuffer to query.\n *  @param[out] width Where to store the width, in pixels, of the framebuffer,\n *  or `NULL`.\n *  @param[out] height Where to store the height, in pixels, of the framebuffer,\n *  or `NULL`.\n *\n *  @sa glfwSetFramebufferSizeCallback\n *\n *  @ingroup window\n */\nGLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height);\n\n/*! @brief Iconifies the specified window.\n *\n *  This function iconifies/minimizes the specified window, if it was previously\n *  restored.  If it is a full screen window, the original monitor resolution is\n *  restored until the window is restored.  If the window is already iconified,\n *  this function does nothing.\n *\n *  @param[in] window The window to iconify.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwRestoreWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwIconifyWindow(GLFWwindow* window);\n\n/*! @brief Restores the specified window.\n *\n *  This function restores the specified window, if it was previously\n *  iconified/minimized.  If it is a full screen window, the resolution chosen\n *  for the window is restored on the selected monitor.  If the window is\n *  already restored, this function does nothing.\n *\n *  @param[in] window The window to restore.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwIconifyWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwRestoreWindow(GLFWwindow* window);\n\n/*! @brief Makes the specified window visible.\n *\n *  This function makes the specified window visible, if it was previously\n *  hidden.  If the window is already visible or is in full screen mode, this\n *  function does nothing.\n *\n *  @param[in] window The window to make visible.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwHideWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwShowWindow(GLFWwindow* window);\n\n/*! @brief Hides the specified window.\n *\n *  This function hides the specified window, if it was previously visible.  If\n *  the window is already hidden or is in full screen mode, this function does\n *  nothing.\n *\n *  @param[in] window The window to hide.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwShowWindow\n *\n *  @ingroup window\n */\nGLFWAPI void glfwHideWindow(GLFWwindow* window);\n\n/*! @brief Returns the monitor that the window uses for full screen mode.\n *\n *  This function returns the handle of the monitor that the specified window is\n *  in full screen on.\n *\n *  @param[in] window The window to query.\n *  @return The monitor, or `NULL` if the window is in windowed mode.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);\n\n/*! @brief Returns an attribute of the specified window.\n *\n *  This function returns an attribute of the specified window.  There are many\n *  attributes, some related to the window and others to its context.\n *\n *  @param[in] window The window to query.\n *  @param[in] attrib The [window attribute](@ref window_attribs) whose value to\n *  return.\n *  @return The value of the attribute, or zero if an error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);\n\n/*! @brief Sets the user pointer of the specified window.\n *\n *  This function sets the user-defined pointer of the specified window.  The\n *  current value is retained until the window is destroyed.  The initial value\n *  is `NULL`.\n *\n *  @param[in] window The window whose pointer to set.\n *  @param[in] pointer The new value.\n *\n *  @sa glfwGetWindowUserPointer\n *\n *  @ingroup window\n */\nGLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer);\n\n/*! @brief Returns the user pointer of the specified window.\n *\n *  This function returns the current value of the user-defined pointer of the\n *  specified window.  The initial value is `NULL`.\n *\n *  @param[in] window The window whose pointer to return.\n *\n *  @sa glfwSetWindowUserPointer\n *\n *  @ingroup window\n */\nGLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);\n\n/*! @brief Sets the position callback for the specified window.\n *\n *  This function sets the position callback of the specified window, which is\n *  called when the window is moved.  The callback is provided with the screen\n *  position of the upper-left corner of the client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);\n\n/*! @brief Sets the size callback for the specified window.\n *\n *  This function sets the size callback of the specified window, which is\n *  called when the window is resized.  The callback is provided with the size,\n *  in screen coordinates, of the client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);\n\n/*! @brief Sets the close callback for the specified window.\n *\n *  This function sets the close callback of the specified window, which is\n *  called when the user attempts to close the window, for example by clicking\n *  the close widget in the title bar.\n *\n *  The close flag is set before this callback is called, but you can modify it\n *  at any time with @ref glfwSetWindowShouldClose.\n *\n *  The close callback is not triggered by @ref glfwDestroyWindow.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @par New in GLFW 3\n *  The close callback no longer returns a value.\n *\n *  @remarks **OS X:** Selecting Quit from the application menu will\n *  trigger the close callback for all windows.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);\n\n/*! @brief Sets the refresh callback for the specified window.\n *\n *  This function sets the refresh callback of the specified window, which is\n *  called when the client area of the window needs to be redrawn, for example\n *  if the window has been exposed after having been covered by another window.\n *\n *  On compositing window systems such as Aero, Compiz or Aqua, where the window\n *  contents are saved off-screen, this callback may be called only very\n *  infrequently or never at all.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @note On compositing window systems such as Aero, Compiz or Aqua, where the\n *  window contents are saved off-screen, this callback may be called only very\n *  infrequently or never at all.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);\n\n/*! @brief Sets the focus callback for the specified window.\n *\n *  This function sets the focus callback of the specified window, which is\n *  called when the window gains or loses focus.\n *\n *  After the focus callback is called for a window that lost focus, synthetic\n *  key and mouse button release events will be generated for all such that had\n *  been pressed.  For more information, see @ref glfwSetKeyCallback and @ref\n *  glfwSetMouseButtonCallback.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);\n\n/*! @brief Sets the iconify callback for the specified window.\n *\n *  This function sets the iconification callback of the specified window, which\n *  is called when the window is iconified or restored.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);\n\n/*! @brief Sets the framebuffer resize callback for the specified window.\n *\n *  This function sets the framebuffer resize callback of the specified window,\n *  which is called when the framebuffer of the specified window is resized.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup window\n */\nGLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);\n\n/*! @brief Processes all pending events.\n *\n *  This function processes only those events that have already been received\n *  and then returns immediately.  Processing events will cause the window and\n *  input callbacks associated with those events to be called.\n *\n *  This function is not required for joystick input to work.\n *\n *  @par New in GLFW 3\n *  This function is no longer called by @ref glfwSwapBuffers.  You need to call\n *  it or @ref glfwWaitEvents yourself.\n *\n *  @remarks On some platforms, a window move, resize or menu operation will\n *  cause event processing to block.  This is due to how event processing is\n *  designed on those platforms.  You can use the\n *  [window refresh callback](@ref GLFWwindowrefreshfun) to redraw the contents\n *  of your window when necessary during the operation.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note On some platforms, certain callbacks may be called outside of a call\n *  to one of the event processing functions.\n *\n *  @sa glfwWaitEvents\n *\n *  @ingroup window\n */\nGLFWAPI void glfwPollEvents(void);\n\n/*! @brief Waits until events are pending and processes them.\n *\n *  This function puts the calling thread to sleep until at least one event has\n *  been received.  Once one or more events have been received, it behaves as if\n *  @ref glfwPollEvents was called, i.e. the events are processed and the\n *  function then returns immediately.  Processing events will cause the window\n *  and input callbacks associated with those events to be called.\n *\n *  Since not all events are associated with callbacks, this function may return\n *  without a callback having been called even if you are monitoring all\n *  callbacks.\n *\n *  This function is not required for joystick input to work.\n *\n *  @remarks On some platforms, a window move, resize or menu operation will\n *  cause event processing to block.  This is due to how event processing is\n *  designed on those platforms.  You can use the\n *  [window refresh callback](@ref GLFWwindowrefreshfun) to redraw the contents\n *  of your window when necessary during the operation.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note This function may not be called from a callback.\n *\n *  @note On some platforms, certain callbacks may be called outside of a call\n *  to one of the event processing functions.\n *\n *  @sa glfwPollEvents\n *\n *  @ingroup window\n */\nGLFWAPI void glfwWaitEvents(void);\n\n/*! @brief Returns the value of an input option for the specified window.\n *\n *  @param[in] window The window to query.\n *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or\n *  `GLFW_STICKY_MOUSE_BUTTONS`.\n *\n *  @sa glfwSetInputMode\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);\n\n/*! @brief Sets an input option for the specified window.\n *  @param[in] window The window whose input mode to set.\n *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or\n *  `GLFW_STICKY_MOUSE_BUTTONS`.\n *  @param[in] value The new value of the specified input mode.\n *\n *  If `mode` is `GLFW_CURSOR`, the value must be one of the supported input\n *  modes:\n *  - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.\n *  - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client\n *    area of the window but does not restrict the cursor from leaving.  This is\n *    useful if you wish to render your own cursor or have no visible cursor at\n *    all.\n *  - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual\n *    and unlimited cursor movement.  This is useful for implementing for\n *    example 3D camera controls.\n *\n *  If `mode` is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to\n *  enable sticky keys, or `GL_FALSE` to disable it.  If sticky keys are\n *  enabled, a key press will ensure that @ref glfwGetKey returns @ref\n *  GLFW_PRESS the next time it is called even if the key had been released\n *  before the call.  This is useful when you are only interested in whether\n *  keys have been pressed but not when or in which order.\n *\n *  If `mode` is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either `GL_TRUE`\n *  to enable sticky mouse buttons, or `GL_FALSE` to disable it.  If sticky\n *  mouse buttons are enabled, a mouse button press will ensure that @ref\n *  glfwGetMouseButton returns @ref GLFW_PRESS the next time it is called even\n *  if the mouse button had been released before the call.  This is useful when\n *  you are only interested in whether mouse buttons have been pressed but not\n *  when or in which order.\n *\n *  @sa glfwGetInputMode\n *\n *  @ingroup input\n */\nGLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);\n\n/*! @brief Returns the last reported state of a keyboard key for the specified\n *  window.\n *\n *  This function returns the last state reported for the specified key to the\n *  specified window.  The returned state is one of `GLFW_PRESS` or\n *  `GLFW_RELEASE`.  The higher-level state `GLFW_REPEAT` is only reported to\n *  the key callback.\n *\n *  If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns\n *  `GLFW_PRESS` the first time you call this function after a key has been\n *  pressed, even if the key has already been released.\n *\n *  The key functions deal with physical keys, with [key tokens](@ref keys)\n *  named after their use on the standard US keyboard layout.  If you want to\n *  input text, use the Unicode character callback instead.\n *\n *  @param[in] window The desired window.\n *  @param[in] key The desired [keyboard key](@ref keys).\n *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *\n *  @note `GLFW_KEY_UNKNOWN` is not a valid key for this function.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetKey(GLFWwindow* window, int key);\n\n/*! @brief Returns the last reported state of a mouse button for the specified\n *  window.\n *\n *  This function returns the last state reported for the specified mouse button\n *  to the specified window.\n *\n *  If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function\n *  returns `GLFW_PRESS` the first time you call this function after a mouse\n *  button has been pressed, even if the mouse button has already been released.\n *\n *  @param[in] window The desired window.\n *  @param[in] button The desired [mouse button](@ref buttons).\n *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);\n\n/*! @brief Retrieves the last reported cursor position, relative to the client\n *  area of the window.\n *\n *  This function returns the last reported position of the cursor, in screen\n *  coordinates, relative to the upper-left corner of the client area of the\n *  specified window.\n *\n *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor\n *  position is unbounded and limited only by the minimum and maximum values of\n *  a `double`.\n *\n *  The coordinate can be converted to their integer equivalents with the\n *  `floor` function.  Casting directly to an integer type works for positive\n *  coordinates, but fails for negative ones.\n *\n *  @param[in] window The desired window.\n *  @param[out] xpos Where to store the cursor x-coordinate, relative to the\n *  left edge of the client area, or `NULL`.\n *  @param[out] ypos Where to store the cursor y-coordinate, relative to the to\n *  top edge of the client area, or `NULL`.\n *\n *  @sa glfwSetCursorPos\n *\n *  @ingroup input\n */\nGLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);\n\n/*! @brief Sets the position of the cursor, relative to the client area of the\n *  window.\n *\n *  This function sets the position, in screen coordinates, of the cursor\n *  relative to the upper-left corner of the client area of the specified\n *  window.  The window must be focused.  If the window does not have focus when\n *  this function is called, it fails silently.\n *\n *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor\n *  position is unbounded and limited only by the minimum and maximum values of\n *  a `double`.\n *\n *  @param[in] window The desired window.\n *  @param[in] xpos The desired x-coordinate, relative to the left edge of the\n *  client area.\n *  @param[in] ypos The desired y-coordinate, relative to the top edge of the\n *  client area.\n *\n *  @sa glfwGetCursorPos\n *\n *  @ingroup input\n */\nGLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);\n\n/*! @brief Sets the key callback.\n *\n *  This function sets the key callback of the specific window, which is called\n *  when a key is pressed, repeated or released.\n *\n *  The key functions deal with physical keys, with layout independent\n *  [key tokens](@ref keys) named after their values in the standard US keyboard\n *  layout.  If you want to input text, use the\n *  [character callback](@ref glfwSetCharCallback) instead.\n *\n *  When a window loses focus, it will generate synthetic key release events\n *  for all pressed keys.  You can tell these events from user-generated events\n *  by the fact that the synthetic ones are generated after the window has lost\n *  focus, i.e. `GLFW_FOCUSED` will be false and the focus callback will have\n *  already been called.\n *\n *  The scancode of a key is specific to that platform or sometimes even to that\n *  machine.  Scancodes are intended to allow users to bind keys that don't have\n *  a GLFW key token.  Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their\n *  state is not saved and so it cannot be retrieved with @ref glfwGetKey.\n *\n *  Sometimes GLFW needs to generate synthetic key events, in which case the\n *  scancode may be zero.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new key callback, or `NULL` to remove the currently\n *  set callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);\n\n/*! @brief Sets the Unicode character callback.\n *\n *  This function sets the character callback of the specific window, which is\n *  called when a Unicode character is input.\n *\n *  The character callback is intended for text input.  If you want to know\n *  whether a specific key was pressed or released, use the\n *  [key callback](@ref glfwSetKeyCallback) instead.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);\n\n/*! @brief Sets the mouse button callback.\n *\n *  This function sets the mouse button callback of the specified window, which\n *  is called when a mouse button is pressed or released.\n *\n *  When a window loses focus, it will generate synthetic mouse button release\n *  events for all pressed mouse buttons.  You can tell these events from\n *  user-generated events by the fact that the synthetic ones are generated\n *  after the window has lost focus, i.e. `GLFW_FOCUSED` will be false and the\n *  focus callback will have already been called.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);\n\n/*! @brief Sets the cursor position callback.\n *\n *  This function sets the cursor position callback of the specified window,\n *  which is called when the cursor is moved.  The callback is provided with the\n *  position, in screen coordinates, relative to the upper-left corner of the\n *  client area of the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);\n\n/*! @brief Sets the cursor enter/exit callback.\n *\n *  This function sets the cursor boundary crossing callback of the specified\n *  window, which is called when the cursor enters or leaves the client area of\n *  the window.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new callback, or `NULL` to remove the currently set\n *  callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);\n\n/*! @brief Sets the scroll callback.\n *\n *  This function sets the scroll callback of the specified window, which is\n *  called when a scrolling device is used, such as a mouse wheel or scrolling\n *  area of a touchpad.\n *\n *  The scroll callback receives all scrolling input, like that from a mouse\n *  wheel or a touchpad scrolling area.\n *\n *  @param[in] window The window whose callback to set.\n *  @param[in] cbfun The new scroll callback, or `NULL` to remove the currently\n *  set callback.\n *  @return The previously set callback, or `NULL` if no callback was set or an\n *  error occurred.\n *\n *  @ingroup input\n */\nGLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);\n\n/*! @brief Returns whether the specified joystick is present.\n *\n *  This function returns whether the specified joystick is present.\n *\n *  @param[in] joy The joystick to query.\n *  @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise.\n *\n *  @ingroup input\n */\nGLFWAPI int glfwJoystickPresent(int joy);\n\n/*! @brief Returns the values of all axes of the specified joystick.\n *\n *  This function returns the values of all axes of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of axis values, or `NULL` if the joystick is not present.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the next call to @ref\n *  glfwGetJoystickAxes for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const float* glfwGetJoystickAxes(int joy, int* count);\n\n/*! @brief Returns the state of all buttons of the specified joystick.\n *\n *  This function returns the state of all buttons of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @param[out] count Where to store the size of the returned array.  This is\n *  set to zero if an error occurred.\n *  @return An array of button states, or `NULL` if the joystick is not present.\n *\n *  @note The returned array is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned array is valid only until the next call to @ref\n *  glfwGetJoystickButtons for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count);\n\n/*! @brief Returns the name of the specified joystick.\n *\n *  This function returns the name, encoded as UTF-8, of the specified joystick.\n *\n *  @param[in] joy The joystick to query.\n *  @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick\n *  is not present.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned string is valid only until the next call to @ref\n *  glfwGetJoystickName for that joystick.\n *\n *  @ingroup input\n */\nGLFWAPI const char* glfwGetJoystickName(int joy);\n\n/*! @brief Sets the clipboard to the specified string.\n *\n *  This function sets the system clipboard to the specified, UTF-8 encoded\n *  string.  The string is copied before returning, so you don't have to retain\n *  it afterwards.\n *\n *  @param[in] window The window that will own the clipboard contents.\n *  @param[in] string A UTF-8 encoded string.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @sa glfwGetClipboardString\n *\n *  @ingroup clipboard\n */\nGLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);\n\n/*! @brief Retrieves the contents of the clipboard as a string.\n *\n *  This function returns the contents of the system clipboard, if it contains\n *  or is convertible to a UTF-8 encoded string.\n *\n *  @param[in] window The window that will request the clipboard contents.\n *  @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`\n *  if an error occurred.\n *\n *  @note This function may only be called from the main thread.\n *\n *  @note The returned string is allocated and freed by GLFW.  You should not\n *  free it yourself.\n *\n *  @note The returned string is valid only until the next call to @ref\n *  glfwGetClipboardString or @ref glfwSetClipboardString.\n *\n *  @sa glfwSetClipboardString\n *\n *  @ingroup clipboard\n */\nGLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);\n\n/*! @brief Returns the value of the GLFW timer.\n *\n *  This function returns the value of the GLFW timer.  Unless the timer has\n *  been set using @ref glfwSetTime, the timer measures time elapsed since GLFW\n *  was initialized.\n *\n *  @return The current value, in seconds, or zero if an error occurred.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note The resolution of the timer is system dependent, but is usually on the\n *  order of a few micro- or nanoseconds.  It uses the highest-resolution\n *  monotonic time source on each supported platform.\n *\n *  @ingroup time\n */\nGLFWAPI double glfwGetTime(void);\n\n/*! @brief Sets the GLFW timer.\n *\n *  This function sets the value of the GLFW timer.  It then continues to count\n *  up from that value.\n *\n *  @param[in] time The new value, in seconds.\n *\n *  @note The resolution of the timer is system dependent, but is usually on the\n *  order of a few micro- or nanoseconds.  It uses the highest-resolution\n *  monotonic time source on each supported platform.\n *\n *  @ingroup time\n */\nGLFWAPI void glfwSetTime(double time);\n\n/*! @brief Makes the context of the specified window current for the calling\n *  thread.\n *\n *  This function makes the context of the specified window current on the\n *  calling thread.  A context can only be made current on a single thread at\n *  a time and each thread can have only a single current context at a time.\n *\n *  @param[in] window The window whose context to make current, or `NULL` to\n *  detach the current context.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @sa glfwGetCurrentContext\n *\n *  @ingroup context\n */\nGLFWAPI void glfwMakeContextCurrent(GLFWwindow* window);\n\n/*! @brief Returns the window whose context is current on the calling thread.\n *\n *  This function returns the window whose context is current on the calling\n *  thread.\n *\n *  @return The window whose context is current, or `NULL` if no window's\n *  context is current.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @sa glfwMakeContextCurrent\n *\n *  @ingroup context\n */\nGLFWAPI GLFWwindow* glfwGetCurrentContext(void);\n\n/*! @brief Swaps the front and back buffers of the specified window.\n *\n *  This function swaps the front and back buffers of the specified window.  If\n *  the swap interval is greater than zero, the GPU driver waits the specified\n *  number of screen updates before swapping the buffers.\n *\n *  @param[in] window The window whose buffers to swap.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @par New in GLFW 3\n *  This function no longer calls @ref glfwPollEvents.  You need to call it or\n *  @ref glfwWaitEvents yourself.\n *\n *  @sa glfwSwapInterval\n *\n *  @ingroup context\n */\nGLFWAPI void glfwSwapBuffers(GLFWwindow* window);\n\n/*! @brief Sets the swap interval for the current context.\n *\n *  This function sets the swap interval for the current context, i.e. the\n *  number of screen updates to wait before swapping the buffers of a window and\n *  returning from @ref glfwSwapBuffers.  This is sometimes called 'vertical\n *  synchronization', 'vertical retrace synchronization' or 'vsync'.\n *\n *  Contexts that support either of the `WGL_EXT_swap_control_tear` and\n *  `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals,\n *  which allow the driver to swap even if a frame arrives a little bit late.\n *  You can check for the presence of these extensions using @ref\n *  glfwExtensionSupported.  For more information about swap tearing, see the\n *  extension specifications.\n *\n *  @param[in] interval The minimum number of screen updates to wait for\n *  until the buffers are swapped by @ref glfwSwapBuffers.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note This function is not called during window creation, leaving the swap\n *  interval set to whatever is the default on that platform.  This is done\n *  because some swap interval extensions used by GLFW do not allow the swap\n *  interval to be reset to zero once it has been set to a non-zero value.\n *\n *  @note Some GPU drivers do not honor the requested swap interval, either\n *  because of user settings that override the request or due to bugs in the\n *  driver.\n *\n *  @sa glfwSwapBuffers\n *\n *  @ingroup context\n */\nGLFWAPI void glfwSwapInterval(int interval);\n\n/*! @brief Returns whether the specified extension is available.\n *\n *  This function returns whether the specified\n *  [OpenGL or context creation API extension](@ref context_glext) is supported\n *  by the current context.  For example, on Windows both the OpenGL and WGL\n *  extension strings are checked.\n *\n *  @param[in] extension The ASCII encoded name of the extension.\n *  @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note As this functions searches one or more extension strings on each call,\n *  it is recommended that you cache its results if it's going to be used\n *  frequently.  The extension strings will not change during the lifetime of\n *  a context, so there is no danger in doing this.\n *\n *  @ingroup context\n */\nGLFWAPI int glfwExtensionSupported(const char* extension);\n\n/*! @brief Returns the address of the specified function for the current\n *  context.\n *\n *  This function returns the address of the specified\n *  [client API or extension function](@ref context_glext), if it is supported\n *  by the current context.\n *\n *  @param[in] procname The ASCII encoded name of the function.\n *  @return The address of the function, or `NULL` if the function is\n *  unavailable.\n *\n *  @remarks This function may be called from secondary threads.\n *\n *  @note The addresses of these functions are not guaranteed to be the same for\n *  all contexts, especially if they use different client APIs or even different\n *  context creation hints.\n *\n *  @ingroup context\n */\nGLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);\n\n\n/*************************************************************************\n * Global definition cleanup\n *************************************************************************/\n\n/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */\n\n#ifdef GLFW_WINGDIAPI_DEFINED\n #undef WINGDIAPI\n #undef GLFW_WINGDIAPI_DEFINED\n#endif\n\n#ifdef GLFW_CALLBACK_DEFINED\n #undef CALLBACK\n #undef GLFW_CALLBACK_DEFINED\n#endif\n\n/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _glfw3_h_ */\n\n"
  },
  {
    "path": "cocos2d/external/glfw3/include/win32/glfw3native.h",
    "content": "/*************************************************************************\n * GLFW 3.0 - www.glfw.org\n * A library for OpenGL, window and input\n *------------------------------------------------------------------------\n * Copyright (c) 2002-2006 Marcus Geelnard\n * Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>\n *\n * This software is provided 'as-is', without any express or implied\n * warranty. In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would\n *    be appreciated but is not required.\n *\n * 2. Altered source versions must be plainly marked as such, and must not\n *    be misrepresented as being the original software.\n *\n * 3. This notice may not be removed or altered from any source\n *    distribution.\n *\n *************************************************************************/\n\n#ifndef _glfw3_native_h_\n#define _glfw3_native_h_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/*************************************************************************\n * Doxygen documentation\n *************************************************************************/\n\n/*! @defgroup native Native access\n *\n *  **By using the native API, you assert that you know what you're doing and\n *  how to fix problems caused by using it.  If you don't, you shouldn't be\n *  using it.**\n *\n *  Before the inclusion of @ref glfw3native.h, you must define exactly one\n *  window API macro and exactly one context API macro.  Failure to do this\n *  will cause a compile-time error.\n *\n *  The available window API macros are:\n *  * `GLFW_EXPOSE_NATIVE_WIN32`\n *  * `GLFW_EXPOSE_NATIVE_COCOA`\n *  * `GLFW_EXPOSE_NATIVE_X11`\n *\n *  The available context API macros are:\n *  * `GLFW_EXPOSE_NATIVE_WGL`\n *  * `GLFW_EXPOSE_NATIVE_NSGL`\n *  * `GLFW_EXPOSE_NATIVE_GLX`\n *  * `GLFW_EXPOSE_NATIVE_EGL`\n *\n *  These macros select which of the native access functions that are declared\n *  and which platform-specific headers to include.  It is then up your (by\n *  definition platform-specific) code to handle which of these should be\n *  defined.\n */\n\n\n/*************************************************************************\n * System headers and types\n *************************************************************************/\n\n#if defined(GLFW_EXPOSE_NATIVE_WIN32)\n #include <windows.h>\n#elif defined(GLFW_EXPOSE_NATIVE_COCOA)\n #if defined(__OBJC__)\n  #import <Cocoa/Cocoa.h>\n #else\n  typedef void* id;\n #endif\n#elif defined(GLFW_EXPOSE_NATIVE_X11)\n #include <X11/Xlib.h>\n#else\n #error \"No window API specified\"\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_WGL)\n /* WGL is declared by windows.h */\n#elif defined(GLFW_EXPOSE_NATIVE_NSGL)\n /* NSGL is declared by Cocoa.h */\n#elif defined(GLFW_EXPOSE_NATIVE_GLX)\n #include <GL/glx.h>\n#elif defined(GLFW_EXPOSE_NATIVE_EGL)\n #include <EGL/egl.h>\n#else\n #error \"No context API specified\"\n#endif\n\n\n/*************************************************************************\n * Functions\n *************************************************************************/\n\n#if defined(GLFW_EXPOSE_NATIVE_WIN32)\n/*! @brief Returns the `HWND` of the specified window.\n *  @return The `HWND` of the specified window.\n *  @ingroup native\n */\nGLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_WGL)\n/*! @brief Returns the `HGLRC` of the specified window.\n *  @return The `HGLRC` of the specified window.\n *  @ingroup native\n */\nGLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_COCOA)\n/*! @brief Returns the `NSWindow` of the specified window.\n *  @return The `NSWindow` of the specified window.\n *  @ingroup native\n */\nGLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_NSGL)\n/*! @brief Returns the `NSOpenGLContext` of the specified window.\n *  @return The `NSOpenGLContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI id glfwGetNSGLContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_X11)\n/*! @brief Returns the `Display` used by GLFW.\n *  @return The `Display` used by GLFW.\n *  @ingroup native\n */\nGLFWAPI Display* glfwGetX11Display(void);\n/*! @brief Returns the `Window` of the specified window.\n *  @return The `Window` of the specified window.\n *  @ingroup native\n */\nGLFWAPI Window glfwGetX11Window(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_GLX)\n/*! @brief Returns the `GLXContext` of the specified window.\n *  @return The `GLXContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);\n#endif\n\n#if defined(GLFW_EXPOSE_NATIVE_EGL)\n/*! @brief Returns the `EGLDisplay` used by GLFW.\n *  @return The `EGLDisplay` used by GLFW.\n *  @ingroup native\n */\nGLFWAPI EGLDisplay glfwGetEGLDisplay(void);\n/*! @brief Returns the `EGLContext` of the specified window.\n *  @return The `EGLContext` of the specified window.\n *  @ingroup native\n */\nGLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);\n/*! @brief Returns the `EGLSurface` of the specified window.\n *  @return The `EGLSurface` of the specified window.\n *  @ingroup native\n */\nGLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _glfw3_native_h_ */\n\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/android/jconfig.h",
    "content": "/* jconfig.h.  Generated from jconfig.cfg by configure.  */\n/* jconfig.cfg --- source file edited by configure script */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES 1\n#define HAVE_UNSIGNED_CHAR 1\n#define HAVE_UNSIGNED_SHORT 1\n/* #undef void */\n/* #undef const */\n/* #undef CHAR_IS_UNSIGNED */\n#define HAVE_STDDEF_H 1\n#define HAVE_STDLIB_H 1\n#define HAVE_LOCALE_H 1\n/* #undef NEED_BSD_STRINGS */\n/* #undef NEED_SYS_TYPES_H */\n/* #undef NEED_FAR_POINTERS */\n/* #undef NEED_SHORT_EXTERNAL_NAMES */\n/* Define this if you get warnings about undefined structures. */\n/* #undef INCOMPLETE_TYPES_BROKEN */\n\n/* Define \"boolean\" as unsigned char, not int, on Windows systems. */\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n\n#ifdef JPEG_INTERNALS\n\n/* #undef RIGHT_SHIFT_IS_UNSIGNED */\n#define INLINE __inline__\n/* These are for configuring the JPEG memory manager. */\n/* #undef DEFAULT_MAX_MEM */\n/* #undef NO_MKTEMP */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n/* #undef RLE_SUPPORTED */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n/* #undef TWO_FILE_COMMANDLINE */\n/* #undef NEED_SIGNAL_CATCHER */\n/* #undef DONT_USE_B_MODE */\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg. */\n/* #undef PROGRESS_REPORT */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/android/jerror.h",
    "content": "/*\n * jerror.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 1997-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the error and message codes for the JPEG library.\n * Edit this file to add new codes, or to translate the message strings to\n * some other language.\n * A set of error-reporting macros are defined too.  Some applications using\n * the JPEG library may wish to include this file to get the error codes\n * and/or the macros.\n */\n\n/*\n * To define the enum list of message codes, include this file without\n * defining macro JMESSAGE.  To create a message string table, include it\n * again with a suitable JMESSAGE definition (see jerror.c for an example).\n */\n#ifndef JMESSAGE\n#ifndef JERROR_H\n/* First time through, define the enum list */\n#define JMAKE_ENUM_LIST\n#else\n/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */\n#define JMESSAGE(code,string)\n#endif /* JERROR_H */\n#endif /* JMESSAGE */\n\n#ifdef JMAKE_ENUM_LIST\n\ntypedef enum {\n\n#define JMESSAGE(code,string)\tcode ,\n\n#endif /* JMAKE_ENUM_LIST */\n\nJMESSAGE(JMSG_NOMESSAGE, \"Bogus message code %d\") /* Must be first entry! */\n\n/* For maintenance convenience, list is alphabetical by message code name */\nJMESSAGE(JERR_BAD_ALIGN_TYPE, \"ALIGN_TYPE is wrong, please fix\")\nJMESSAGE(JERR_BAD_ALLOC_CHUNK, \"MAX_ALLOC_CHUNK is wrong, please fix\")\nJMESSAGE(JERR_BAD_BUFFER_MODE, \"Bogus buffer control mode\")\nJMESSAGE(JERR_BAD_COMPONENT_ID, \"Invalid component ID %d in SOS\")\nJMESSAGE(JERR_BAD_CROP_SPEC, \"Invalid crop request\")\nJMESSAGE(JERR_BAD_DCT_COEF, \"DCT coefficient out of range\")\nJMESSAGE(JERR_BAD_DCTSIZE, \"DCT scaled block size %dx%d not supported\")\nJMESSAGE(JERR_BAD_DROP_SAMPLING,\n\t \"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c\")\nJMESSAGE(JERR_BAD_HUFF_TABLE, \"Bogus Huffman table definition\")\nJMESSAGE(JERR_BAD_IN_COLORSPACE, \"Bogus input colorspace\")\nJMESSAGE(JERR_BAD_J_COLORSPACE, \"Bogus JPEG colorspace\")\nJMESSAGE(JERR_BAD_LENGTH, \"Bogus marker length\")\nJMESSAGE(JERR_BAD_LIB_VERSION,\n\t \"Wrong JPEG library version: library is %d, caller expects %d\")\nJMESSAGE(JERR_BAD_MCU_SIZE, \"Sampling factors too large for interleaved scan\")\nJMESSAGE(JERR_BAD_POOL_ID, \"Invalid memory pool code %d\")\nJMESSAGE(JERR_BAD_PRECISION, \"Unsupported JPEG data precision %d\")\nJMESSAGE(JERR_BAD_PROGRESSION,\n\t \"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d\")\nJMESSAGE(JERR_BAD_PROG_SCRIPT,\n\t \"Invalid progressive parameters at scan script entry %d\")\nJMESSAGE(JERR_BAD_SAMPLING, \"Bogus sampling factors\")\nJMESSAGE(JERR_BAD_SCAN_SCRIPT, \"Invalid scan script at entry %d\")\nJMESSAGE(JERR_BAD_STATE, \"Improper call to JPEG library in state %d\")\nJMESSAGE(JERR_BAD_STRUCT_SIZE,\n\t \"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u\")\nJMESSAGE(JERR_BAD_VIRTUAL_ACCESS, \"Bogus virtual array access\")\nJMESSAGE(JERR_BUFFER_SIZE, \"Buffer passed to JPEG library is too small\")\nJMESSAGE(JERR_CANT_SUSPEND, \"Suspension not allowed here\")\nJMESSAGE(JERR_CCIR601_NOTIMPL, \"CCIR601 sampling not implemented yet\")\nJMESSAGE(JERR_COMPONENT_COUNT, \"Too many color components: %d, max %d\")\nJMESSAGE(JERR_CONVERSION_NOTIMPL, \"Unsupported color conversion request\")\nJMESSAGE(JERR_DAC_INDEX, \"Bogus DAC index %d\")\nJMESSAGE(JERR_DAC_VALUE, \"Bogus DAC value 0x%x\")\nJMESSAGE(JERR_DHT_INDEX, \"Bogus DHT index %d\")\nJMESSAGE(JERR_DQT_INDEX, \"Bogus DQT index %d\")\nJMESSAGE(JERR_EMPTY_IMAGE, \"Empty JPEG image (DNL not supported)\")\nJMESSAGE(JERR_EMS_READ, \"Read from EMS failed\")\nJMESSAGE(JERR_EMS_WRITE, \"Write to EMS failed\")\nJMESSAGE(JERR_EOI_EXPECTED, \"Didn't expect more than one scan\")\nJMESSAGE(JERR_FILE_READ, \"Input file read error\")\nJMESSAGE(JERR_FILE_WRITE, \"Output file write error --- out of disk space?\")\nJMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, \"Fractional sampling not implemented yet\")\nJMESSAGE(JERR_HUFF_CLEN_OVERFLOW, \"Huffman code size table overflow\")\nJMESSAGE(JERR_HUFF_MISSING_CODE, \"Missing Huffman code table entry\")\nJMESSAGE(JERR_IMAGE_TOO_BIG, \"Maximum supported image dimension is %u pixels\")\nJMESSAGE(JERR_INPUT_EMPTY, \"Empty input file\")\nJMESSAGE(JERR_INPUT_EOF, \"Premature end of input file\")\nJMESSAGE(JERR_MISMATCHED_QUANT_TABLE,\n\t \"Cannot transcode due to multiple use of quantization table %d\")\nJMESSAGE(JERR_MISSING_DATA, \"Scan script does not transmit all data\")\nJMESSAGE(JERR_MODE_CHANGE, \"Invalid color quantization mode change\")\nJMESSAGE(JERR_NOTIMPL, \"Not implemented yet\")\nJMESSAGE(JERR_NOT_COMPILED, \"Requested feature was omitted at compile time\")\nJMESSAGE(JERR_NO_ARITH_TABLE, \"Arithmetic table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_BACKING_STORE, \"Backing store not supported\")\nJMESSAGE(JERR_NO_HUFF_TABLE, \"Huffman table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_IMAGE, \"JPEG datastream contains no image\")\nJMESSAGE(JERR_NO_QUANT_TABLE, \"Quantization table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_SOI, \"Not a JPEG file: starts with 0x%02x 0x%02x\")\nJMESSAGE(JERR_OUT_OF_MEMORY, \"Insufficient memory (case %d)\")\nJMESSAGE(JERR_QUANT_COMPONENTS,\n\t \"Cannot quantize more than %d color components\")\nJMESSAGE(JERR_QUANT_FEW_COLORS, \"Cannot quantize to fewer than %d colors\")\nJMESSAGE(JERR_QUANT_MANY_COLORS, \"Cannot quantize to more than %d colors\")\nJMESSAGE(JERR_SOF_BEFORE, \"Invalid JPEG file structure: %s before SOF\")\nJMESSAGE(JERR_SOF_DUPLICATE, \"Invalid JPEG file structure: two SOF markers\")\nJMESSAGE(JERR_SOF_NO_SOS, \"Invalid JPEG file structure: missing SOS marker\")\nJMESSAGE(JERR_SOF_UNSUPPORTED, \"Unsupported JPEG process: SOF type 0x%02x\")\nJMESSAGE(JERR_SOI_DUPLICATE, \"Invalid JPEG file structure: two SOI markers\")\nJMESSAGE(JERR_TFILE_CREATE, \"Failed to create temporary file %s\")\nJMESSAGE(JERR_TFILE_READ, \"Read failed on temporary file\")\nJMESSAGE(JERR_TFILE_SEEK, \"Seek failed on temporary file\")\nJMESSAGE(JERR_TFILE_WRITE,\n\t \"Write failed on temporary file --- out of disk space?\")\nJMESSAGE(JERR_TOO_LITTLE_DATA, \"Application transferred too few scanlines\")\nJMESSAGE(JERR_UNKNOWN_MARKER, \"Unsupported marker type 0x%02x\")\nJMESSAGE(JERR_VIRTUAL_BUG, \"Virtual array controller messed up\")\nJMESSAGE(JERR_WIDTH_OVERFLOW, \"Image too wide for this implementation\")\nJMESSAGE(JERR_XMS_READ, \"Read from XMS failed\")\nJMESSAGE(JERR_XMS_WRITE, \"Write to XMS failed\")\nJMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)\nJMESSAGE(JMSG_VERSION, JVERSION)\nJMESSAGE(JTRC_16BIT_TABLES,\n\t \"Caution: quantization tables are too coarse for baseline JPEG\")\nJMESSAGE(JTRC_ADOBE,\n\t \"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d\")\nJMESSAGE(JTRC_APP0, \"Unknown APP0 marker (not JFIF), length %u\")\nJMESSAGE(JTRC_APP14, \"Unknown APP14 marker (not Adobe), length %u\")\nJMESSAGE(JTRC_DAC, \"Define Arithmetic Table 0x%02x: 0x%02x\")\nJMESSAGE(JTRC_DHT, \"Define Huffman Table 0x%02x\")\nJMESSAGE(JTRC_DQT, \"Define Quantization Table %d  precision %d\")\nJMESSAGE(JTRC_DRI, \"Define Restart Interval %u\")\nJMESSAGE(JTRC_EMS_CLOSE, \"Freed EMS handle %u\")\nJMESSAGE(JTRC_EMS_OPEN, \"Obtained EMS handle %u\")\nJMESSAGE(JTRC_EOI, \"End Of Image\")\nJMESSAGE(JTRC_HUFFBITS, \"        %3d %3d %3d %3d %3d %3d %3d %3d\")\nJMESSAGE(JTRC_JFIF, \"JFIF APP0 marker: version %d.%02d, density %dx%d  %d\")\nJMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,\n\t \"Warning: thumbnail image size does not match data length %u\")\nJMESSAGE(JTRC_JFIF_EXTENSION,\n\t \"JFIF extension marker: type 0x%02x, length %u\")\nJMESSAGE(JTRC_JFIF_THUMBNAIL, \"    with %d x %d thumbnail image\")\nJMESSAGE(JTRC_MISC_MARKER, \"Miscellaneous marker 0x%02x, length %u\")\nJMESSAGE(JTRC_PARMLESS_MARKER, \"Unexpected marker 0x%02x\")\nJMESSAGE(JTRC_QUANTVALS, \"        %4u %4u %4u %4u %4u %4u %4u %4u\")\nJMESSAGE(JTRC_QUANT_3_NCOLORS, \"Quantizing to %d = %d*%d*%d colors\")\nJMESSAGE(JTRC_QUANT_NCOLORS, \"Quantizing to %d colors\")\nJMESSAGE(JTRC_QUANT_SELECTED, \"Selected %d colors for quantization\")\nJMESSAGE(JTRC_RECOVERY_ACTION, \"At marker 0x%02x, recovery action %d\")\nJMESSAGE(JTRC_RST, \"RST%d\")\nJMESSAGE(JTRC_SMOOTH_NOTIMPL,\n\t \"Smoothing not supported with nonstandard sampling ratios\")\nJMESSAGE(JTRC_SOF, \"Start Of Frame 0x%02x: width=%u, height=%u, components=%d\")\nJMESSAGE(JTRC_SOF_COMPONENT, \"    Component %d: %dhx%dv q=%d\")\nJMESSAGE(JTRC_SOI, \"Start of Image\")\nJMESSAGE(JTRC_SOS, \"Start Of Scan: %d components\")\nJMESSAGE(JTRC_SOS_COMPONENT, \"    Component %d: dc=%d ac=%d\")\nJMESSAGE(JTRC_SOS_PARAMS, \"  Ss=%d, Se=%d, Ah=%d, Al=%d\")\nJMESSAGE(JTRC_TFILE_CLOSE, \"Closed temporary file %s\")\nJMESSAGE(JTRC_TFILE_OPEN, \"Opened temporary file %s\")\nJMESSAGE(JTRC_THUMB_JPEG,\n\t \"JFIF extension marker: JPEG-compressed thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_PALETTE,\n\t \"JFIF extension marker: palette thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_RGB,\n\t \"JFIF extension marker: RGB thumbnail image, length %u\")\nJMESSAGE(JTRC_UNKNOWN_IDS,\n\t \"Unrecognized component IDs %d %d %d, assuming YCbCr\")\nJMESSAGE(JTRC_XMS_CLOSE, \"Freed XMS handle %u\")\nJMESSAGE(JTRC_XMS_OPEN, \"Obtained XMS handle %u\")\nJMESSAGE(JWRN_ADOBE_XFORM, \"Unknown Adobe color transform code %d\")\nJMESSAGE(JWRN_ARITH_BAD_CODE, \"Corrupt JPEG data: bad arithmetic code\")\nJMESSAGE(JWRN_BOGUS_PROGRESSION,\n\t \"Inconsistent progression sequence for component %d coefficient %d\")\nJMESSAGE(JWRN_EXTRANEOUS_DATA,\n\t \"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x\")\nJMESSAGE(JWRN_HIT_MARKER, \"Corrupt JPEG data: premature end of data segment\")\nJMESSAGE(JWRN_HUFF_BAD_CODE, \"Corrupt JPEG data: bad Huffman code\")\nJMESSAGE(JWRN_JFIF_MAJOR, \"Warning: unknown JFIF revision number %d.%02d\")\nJMESSAGE(JWRN_JPEG_EOF, \"Premature end of JPEG file\")\nJMESSAGE(JWRN_MUST_RESYNC,\n\t \"Corrupt JPEG data: found marker 0x%02x instead of RST%d\")\nJMESSAGE(JWRN_NOT_SEQUENTIAL, \"Invalid SOS parameters for sequential JPEG\")\nJMESSAGE(JWRN_TOO_MUCH_DATA, \"Application transferred too many scanlines\")\n\n#ifdef JMAKE_ENUM_LIST\n\n  JMSG_LASTMSGCODE\n} J_MESSAGE_CODE;\n\n#undef JMAKE_ENUM_LIST\n#endif /* JMAKE_ENUM_LIST */\n\n/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */\n#undef JMESSAGE\n\n\n#ifndef JERROR_H\n#define JERROR_H\n\n/* Macros to simplify using the error and trace message stuff */\n/* The first parameter is either type of cinfo pointer */\n\n/* Fatal errors (print message and exit) */\n#define ERREXIT(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT3(cinfo,code,p1,p2,p3)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (cinfo)->err->msg_parm.i[3] = (p4), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (cinfo)->err->msg_parm.i[3] = (p4), \\\n   (cinfo)->err->msg_parm.i[4] = (p5), \\\n   (cinfo)->err->msg_parm.i[5] = (p6), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXITS(cinfo,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n\n#define MAKESTMT(stuff)\t\tdo { stuff } while (0)\n\n/* Nonfatal errors (we can keep going, but the data is probably corrupt) */\n#define WARNMS(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n\n/* Informational/debugging messages */\n#define TRACEMS(cinfo,lvl,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS1(cinfo,lvl,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS2(cinfo,lvl,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   _mp[4] = (p5); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMSS(cinfo,lvl,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n\n#endif /* JERROR_H */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/android/jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8\t/* use 8 or 12 */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10\t/* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE\t255\n#define CENTERJSAMPLE\t128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t4095\n#define CENTERJSAMPLE\t2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char UINT8;\n#else /* not CHAR_IS_UNSIGNED */\ntypedef short UINT8;\n#endif /* CHAR_IS_UNSIGNED */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT32 */\n#ifndef _BASETSD_H_\t\t/* Microsoft defines it in basetsd.h */\n#ifndef _BASETSD_H\t\t/* MinGW is slightly different */\n#ifndef QGLOBAL_H\t\t/* Qt defines it in qglobal.h */\ntypedef long INT32;\n#endif\n#endif\n#endif\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)\t\tstatic type\n/* a function used only in its module: */\n#define LOCAL(type)\t\tstatic type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)\t\ttype\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)\t\textern type\n\n\n/* This macro is used to declare a \"method\", that is, a function pointer.\n * We want to supply prototype parameters if the compiler can cope.\n * Note that the arglist parameter must be parenthesized!\n * Again, you can customize this if you need special linkage keywords.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n#else\n#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n#endif\n\n\n/* The noreturn type identifier is used to declare functions\n * which cannot return.\n * Compilers can thus create more optimized code and perform\n * better checks for warnings and errors.\n * Static analyzer tools can make improved inferences about\n * execution paths and are prevented from giving false alerts.\n *\n * Unfortunately, the proposed specifications of corresponding\n * extensions in the Dec 2011 ISO C standard revision (C11),\n * GCC, MSVC, etc. are not viable.\n * Thus we introduce a user defined type to declare noreturn\n * functions at least for clarity.  A proper compiler would\n * have a suitable noreturn type to match in place of void.\n */\n\n#ifndef HAVE_NORETURN_T\ntypedef void noreturn_t;\n#endif\n\n\n/* Here is the pseudo-keyword for declaring pointers that must be \"far\"\n * on 80x86 machines.  Most of the specialized coding for 80x86 is handled\n * by just saying \"FAR *\" where such a pointer is needed.  In a few places\n * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.\n */\n\n#ifndef FAR\n#ifdef NEED_FAR_POINTERS\n#define FAR  far\n#else\n#define FAR\n#endif\n#endif\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifdef HAVE_BOOLEAN\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#else\ntypedef enum { FALSE = 0, TRUE = 1 } boolean;\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED\t/* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED\t/* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED\t/* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define DCT_SCALING_SUPPORTED\t    /* Input rescaling via DCT? (Requires DCT_ISLOW)*/\n#define ENTROPY_OPT_SUPPORTED\t    /* Optimization of entropy coding parms? */\n/* Note: if you selected 12-bit data precision, it is dangerous to turn off\n * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit\n * precision, so jchuff.c normally uses entropy optimization to compute\n * usable tables for higher precision.  If you don't want to do optimization,\n * you'll have to supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define IDCT_SCALING_SUPPORTED\t    /* Output rescaling via IDCT? */\n#define SAVE_MARKERS_SUPPORTED\t    /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED\t    /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED\t    /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * Ordering of RGB data in scanlines passed to or from the application.\n * If your application wants to deal with data in the order B,G,R, just\n * change these macros.  You can also deal with formats such as R,G,B,X\n * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing\n * the offsets will also change the order in which colormap data is organized.\n * RESTRICTIONS:\n * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.\n * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE\n *    is not 3 (they don't understand about dummy color components!).  So you\n *    can't use color quantization if you change that value.\n */\n\n#define RGB_RED\t\t0\t/* Offset of Red in an RGB scanline element */\n#define RGB_GREEN\t1\t/* Offset of Green */\n#define RGB_BLUE\t2\t/* Offset of Blue */\n#define RGB_PIXELSIZE\t3\t/* JSAMPLEs per RGB scanline element */\n\n\n/* Definitions for speed-related optimizations. */\n\n\n/* If your compiler supports inline functions, define INLINE\n * as the inline keyword; otherwise define it as empty.\n */\n\n#ifndef INLINE\n#ifdef __GNUC__\t\t\t/* for instance, GNU C knows about inline */\n#define INLINE __inline__\n#endif\n#ifndef INLINE\n#define INLINE\t\t\t/* default is to define it as empty */\n#endif\n#endif\n\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#define MULTIPLIER  int\t\t/* type for fastest integer multiply */\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n * Typically, float is faster in ANSI C compilers, while double is faster in\n * pre-ANSI compilers (because they insist on converting to double anyway).\n * The code below therefore chooses float if we have ANSI-style prototypes.\n */\n\n#ifndef FAST_FLOAT\n#ifdef HAVE_PROTOTYPES\n#define FAST_FLOAT  float\n#else\n#define FAST_FLOAT  double\n#endif\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/android/jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED\t/* in case jinclude.h already did */\n#include \"jconfig.h\"\t\t/* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"\t\t/* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n/* Version IDs for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 90\".\n */\n\n#define JPEG_LIB_VERSION        90\t/* Compatibility version 9.0 */\n#define JPEG_LIB_VERSION_MAJOR  9\n#define JPEG_LIB_VERSION_MINOR  0\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard, so don't change them\n * if you want to be compatible.\n */\n\n#define DCTSIZE\t\t    8\t/* The basic DCT block is 8x8 coefficients */\n#define DCTSIZE2\t    64\t/* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4\t/* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4\t/* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16\t/* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4\t/* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4\t/* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n * On 80x86 machines, the image arrays are too big for near pointers,\n * but the pointer arrays can fit in near memory.\n */\n\ntypedef JSAMPLE FAR *JSAMPROW;\t/* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;\t/* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE;\t/* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2];\t/* one block of coefficients */\ntypedef JBLOCK FAR *JBLOCKROW;\t/* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;\t\t/* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;\t/* a 3-D array of coefficient blocks */\n\ntypedef JCOEF FAR *JCOEFPTR;\t/* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];\t/* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];\t\t/* bits[k] = # of symbols with codes of */\n\t\t\t\t/* length k bits; bits[0] is unused */\n  UINT8 huffval[256];\t\t/* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;\t\t/* identifier for this component (0..255) */\n  int component_index;\t\t/* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;\t\t/* horizontal sampling factor (1..4) */\n  int v_samp_factor;\t\t/* vertical sampling factor (1..4) */\n  int quant_tbl_no;\t\t/* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;\t\t/* DC entropy table selector (0..3) */\n  int ac_tbl_no;\t\t/* AC entropy table selector (0..3) */\n  \n  /* Remaining fields should be treated as private by applications. */\n  \n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples,\n   * reflecting any scaling we choose to apply during the DCT step.\n   * Values from 1 to 16 are supported.\n   * Note that different components may receive different DCT scalings.\n   */\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface);\n   * DCT scaling is included, so\n   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)\n   * and similarly for height.\n   */\n  JDIMENSION downsampled_width;\t /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* This flag is used only for decompression.  In cases where some of the\n   * components will be ignored (eg grayscale output from YCbCr image),\n   * we can skip most computations for the unused components.\n   */\n  boolean component_needed;\t/* do we need the value of this component? */\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;\t\t/* number of blocks per MCU, horizontally */\n  int MCU_height;\t\t/* number of blocks per MCU, vertically */\n  int MCU_blocks;\t\t/* MCU_width * MCU_height */\n  int MCU_sample_width;\t/* MCU width in samples: MCU_width * DCT_h_scaled_size */\n  int last_col_width;\t\t/* # of non-dummy blocks across in last MCU */\n  int last_row_height;\t\t/* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL * quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void * dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;\t\t/* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;\t\t\t/* progressive JPEG spectral selection parms */\n  int Ah, Al;\t\t\t/* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;\t/* next in list, or NULL */\n  UINT8 marker;\t\t\t/* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length;\t/* # bytes of data in the file */\n  unsigned int data_length;\t/* # bytes of data saved at data[] */\n  JOCTET FAR * data;\t\t/* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\ntypedef enum {\n\tJCS_UNKNOWN,\t\t/* error/unspecified */\n\tJCS_GRAYSCALE,\t\t/* monochrome */\n\tJCS_RGB,\t\t/* red/green/blue */\n\tJCS_YCbCr,\t\t/* Y/Cb/Cr (also known as YUV) */\n\tJCS_CMYK,\t\t/* C/M/Y/K */\n\tJCS_YCCK\t\t/* Y/Cb/Cr/K */\n} J_COLOR_SPACE;\n\n/* Supported color transforms. */\n\ntypedef enum {\n\tJCT_NONE           = 0,\n\tJCT_SUBTRACT_GREEN = 1\n} J_COLOR_TRANSFORM;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n\tJDCT_ISLOW,\t\t/* slow but accurate integer algorithm */\n\tJDCT_IFAST,\t\t/* faster, less accurate integer method */\n\tJDCT_FLOAT\t\t/* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT\t\t/* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST\t\t/* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n\tJDITHER_NONE,\t\t/* no dithering */\n\tJDITHER_ORDERED,\t/* simple ordered dither */\n\tJDITHER_FS\t\t/* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr * err;\t/* Error handler module */\\\n  struct jpeg_memory_mgr * mem;\t/* Memory manager module */\\\n  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\\\n  void * client_data;\t\t/* Available for use by application */\\\n  boolean is_decompressor;\t/* So common code can tell which is which */\\\n  int global_state\t\t/* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;\t\t/* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct * j_common_ptr;\ntypedef struct jpeg_compress_struct * j_compress_ptr;\ntypedef struct jpeg_decompress_struct * j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr * dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;\t/* input image width */\n  JDIMENSION image_height;\t/* input image height */\n  int input_components;\t\t/* # of color components in input image */\n  J_COLOR_SPACE in_color_space;\t/* colorspace of input image */\n\n  double input_gamma;\t\t/* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;\t/* scaled JPEG image width */\n  JDIMENSION jpeg_height;\t/* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  int q_scale_factor[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;\t\t/* # of entries in scan_info array */\n  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;\t\t/* TRUE=caller supplies downsampled data */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;\t/* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n  int smoothing_factor;\t\t/* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;\t/* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;\t\t/* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;\t/* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;\t/* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean write_Adobe_marker;\t/* should an Adobe marker be written? */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier, writes LSE marker if nonzero */\n\n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;\t/* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;\t/* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n  \n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n  \n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n  \n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order;\t/* natural-order position array */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) */\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master * master;\n  struct jpeg_c_main_controller * main;\n  struct jpeg_c_prep_controller * prep;\n  struct jpeg_c_coef_controller * coef;\n  struct jpeg_marker_writer * marker;\n  struct jpeg_color_converter * cconvert;\n  struct jpeg_downsampler * downsample;\n  struct jpeg_forward_dct * fdct;\n  struct jpeg_entropy_encoder * entropy;\n  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr * src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;\t/* nominal image width (from SOF marker) */\n  JDIMENSION image_height;\t/* nominal image height */\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;\t\t/* image gamma wanted in output */\n\n  boolean buffered_image;\t/* TRUE=multiple output passes */\n  boolean raw_data_out;\t\t/* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;\t/* IDCT algorithm selector */\n  boolean do_fancy_upsampling;\t/* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;\t/* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;\t/* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;\t/* type of color dithering to use */\n  boolean two_pass_quantize;\t/* TRUE=use two-pass color quantization */\n  int desired_number_of_colors;\t/* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;\t/* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;\t/* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;\t/* scaled image width */\n  JDIMENSION output_height;\t/* scaled image height */\n  int out_color_components;\t/* # of color components in out_color_space */\n  int output_components;\t/* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;\t/* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;\t/* number of entries in use */\n  JSAMPARRAY colormap;\t\t/* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;\t/* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;\t/* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;\t/* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;\t/* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;\t/* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];\t/* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  boolean is_baseline;\t\t/* TRUE if Baseline SOF0 encountered */\n  boolean progressive_mode;\t/* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;\t/* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;\t/* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean saw_Adobe_marker;\t/* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;\t/* Color transform code from Adobe marker */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier derived from LSE marker, otherwise zero */\n\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE * sample_range_limit; /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n\n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) for entropy decode */\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master * master;\n  struct jpeg_d_main_controller * main;\n  struct jpeg_d_coef_controller * coef;\n  struct jpeg_d_post_controller * post;\n  struct jpeg_input_controller * inputctl;\n  struct jpeg_marker_reader * marker;\n  struct jpeg_entropy_decoder * entropy;\n  struct jpeg_inverse_dct * idct;\n  struct jpeg_upsampler * upsample;\n  struct jpeg_color_deconverter * cconvert;\n  struct jpeg_color_quantizer * cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));\n  /* Conditionally emit a trace or warning message */\n  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));\n  /* Routine that actually outputs a trace or error message */\n  JMETHOD(void, output_message, (j_common_ptr cinfo));\n  /* Format a message string for the most recent JPEG error or message */\n  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));\n#define JMSG_LENGTH_MAX  200\t/* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));\n  \n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n  \n  /* Standard state variables for error facility */\n  \n  int trace_level;\t\t/* max msg_level that will be displayed */\n  \n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;\t\t/* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const * jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const * addon_message_table; /* Non-library errors */\n  int first_addon_message;\t/* code for first string in addon table */\n  int last_addon_message;\t/* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));\n\n  long pass_counter;\t\t/* work units completed in this pass */\n  long pass_limit;\t\t/* total number of work units in this pass */\n  int completed_passes;\t\t/* passes completed so far */\n  int total_passes;\t\t/* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n\n  JMETHOD(void, init_destination, (j_compress_ptr cinfo));\n  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));\n  JMETHOD(void, term_destination, (j_compress_ptr cinfo));\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET * next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in buffer */\n\n  JMETHOD(void, init_source, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));\n  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));\n  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));\n  JMETHOD(void, term_source, (j_decompress_ptr cinfo));\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT\t0\t/* lasts until master record is destroyed */\n#define JPOOL_IMAGE\t1\t/* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS\t2\n\ntypedef struct jvirt_sarray_control * jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control * jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,\n\t\t\t\tsize_t sizeofobject));\n  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     size_t sizeofobject));\n  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     JDIMENSION samplesperrow,\n\t\t\t\t     JDIMENSION numrows));\n  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t      JDIMENSION blocksperrow,\n\t\t\t\t      JDIMENSION numrows));\n  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION samplesperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION blocksperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));\n  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t   jvirt_sarray_ptr ptr,\n\t\t\t\t\t   JDIMENSION start_row,\n\t\t\t\t\t   JDIMENSION num_rows,\n\t\t\t\t\t   boolean writable));\n  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t    jvirt_barray_ptr ptr,\n\t\t\t\t\t    JDIMENSION start_row,\n\t\t\t\t\t    JDIMENSION num_rows,\n\t\t\t\t\t    boolean writable));\n  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));\n  JMETHOD(void, self_destruct, (j_common_ptr cinfo));\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));\n\n\n/* Declarations for routines called by application.\n * The JPP macro hides prototype parameters from compilers that can't cope.\n * Note JPP requires double parentheses.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JPP(arglist)\targlist\n#else\n#define JPP(arglist)\t()\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers.\n * We shorten external names to be unique in the first six letters, which\n * is good enough for all known systems.\n * (If your compiler itself needs names to be unique in less than 15 \n * characters, you are out of luck.  Get a better compiler.)\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_error\t\tjStdError\n#define jpeg_CreateCompress\tjCreaCompress\n#define jpeg_CreateDecompress\tjCreaDecompress\n#define jpeg_destroy_compress\tjDestCompress\n#define jpeg_destroy_decompress\tjDestDecompress\n#define jpeg_stdio_dest\t\tjStdDest\n#define jpeg_stdio_src\t\tjStdSrc\n#define jpeg_mem_dest\t\tjMemDest\n#define jpeg_mem_src\t\tjMemSrc\n#define jpeg_set_defaults\tjSetDefaults\n#define jpeg_set_colorspace\tjSetColorspace\n#define jpeg_default_colorspace\tjDefColorspace\n#define jpeg_set_quality\tjSetQuality\n#define jpeg_set_linear_quality\tjSetLQuality\n#define jpeg_default_qtables\tjDefQTables\n#define jpeg_add_quant_table\tjAddQuantTable\n#define jpeg_quality_scaling\tjQualityScaling\n#define jpeg_simple_progression\tjSimProgress\n#define jpeg_suppress_tables\tjSuppressTables\n#define jpeg_alloc_quant_table\tjAlcQTable\n#define jpeg_alloc_huff_table\tjAlcHTable\n#define jpeg_start_compress\tjStrtCompress\n#define jpeg_write_scanlines\tjWrtScanlines\n#define jpeg_finish_compress\tjFinCompress\n#define jpeg_calc_jpeg_dimensions\tjCjpegDimensions\n#define jpeg_write_raw_data\tjWrtRawData\n#define jpeg_write_marker\tjWrtMarker\n#define jpeg_write_m_header\tjWrtMHeader\n#define jpeg_write_m_byte\tjWrtMByte\n#define jpeg_write_tables\tjWrtTables\n#define jpeg_read_header\tjReadHeader\n#define jpeg_start_decompress\tjStrtDecompress\n#define jpeg_read_scanlines\tjReadScanlines\n#define jpeg_finish_decompress\tjFinDecompress\n#define jpeg_read_raw_data\tjReadRawData\n#define jpeg_has_multiple_scans\tjHasMultScn\n#define jpeg_start_output\tjStrtOutput\n#define jpeg_finish_output\tjFinOutput\n#define jpeg_input_complete\tjInComplete\n#define jpeg_new_colormap\tjNewCMap\n#define jpeg_consume_input\tjConsumeInput\n#define jpeg_core_output_dimensions\tjCoreDimensions\n#define jpeg_calc_output_dimensions\tjCalcDimensions\n#define jpeg_save_markers\tjSaveMarkers\n#define jpeg_set_marker_processor\tjSetMarker\n#define jpeg_read_coefficients\tjReadCoefs\n#define jpeg_write_coefficients\tjWrtCoefs\n#define jpeg_copy_critical_parameters\tjCopyCrit\n#define jpeg_abort_compress\tjAbrtCompress\n#define jpeg_abort_decompress\tjAbrtDecompress\n#define jpeg_abort\t\tjAbort\n#define jpeg_destroy\t\tjDestroy\n#define jpeg_resync_to_restart\tjResyncRestart\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error\n\tJPP((struct jpeg_error_mgr * err));\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t(size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t  (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,\n\t\t\t\t      int version, size_t structsize));\nEXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,\n\t\t\t\t\tint version, size_t structsize));\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));\nEXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,\n\t\t\t       unsigned char ** outbuffer,\n\t\t\t       unsigned long * outsize));\nEXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,\n\t\t\t      unsigned char * inbuffer,\n\t\t\t      unsigned long insize));\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,\n\t\t\t\t      J_COLOR_SPACE colorspace));\nEXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,\n\t\t\t\t   boolean force_baseline));\nEXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  int scale_factor,\n\t\t\t\t\t  boolean force_baseline));\nEXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean force_baseline));\nEXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,\n\t\t\t\t       const unsigned int *basic_table,\n\t\t\t\t       int scale_factor,\n\t\t\t\t       boolean force_baseline));\nEXTERN(int) jpeg_quality_scaling JPP((int quality));\nEXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean suppress));\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,\n\t\t\t\t      boolean write_all_tables));\nEXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JSAMPARRAY scanlines,\n\t\t\t\t\t     JDIMENSION num_lines));\nEXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));\n\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JSAMPIMAGE data,\n\t\t\t\t\t    JDIMENSION num_lines));\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker\n\tJPP((j_compress_ptr cinfo, int marker,\n\t     const JOCTET * dataptr, unsigned int datalen));\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header\n\tJPP((j_compress_ptr cinfo, int marker, unsigned int datalen));\nEXTERN(void) jpeg_write_m_byte\n\tJPP((j_compress_ptr cinfo, int val));\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,\n\t\t\t\t  boolean require_image));\n/* Return value is one of: */\n#define JPEG_SUSPENDED\t\t0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK\t\t1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY\t2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JSAMPARRAY scanlines,\n\t\t\t\t\t    JDIMENSION max_lines));\nEXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t   JSAMPIMAGE data,\n\t\t\t\t\t   JDIMENSION max_lines));\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,\n\t\t\t\t       int scan_number));\nEXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));\nEXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED\t0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS\t1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI\t2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED\t3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED\t4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\nEXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     unsigned int length_limit));\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     jpeg_marker_parser_method routine));\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  jvirt_barray_ptr * coef_arrays));\nEXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,\n\t\t\t\t\t\tj_compress_ptr dstinfo));\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    int desired));\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0\t0xD0\t/* RST0 marker code */\n#define JPEG_EOI\t0xD9\t/* EOI marker code */\n#define JPEG_APP0\t0xE0\t/* APP0 marker code */\n#define JPEG_COM\t0xFE\t/* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS\t\t/* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"\t\t/* fetch private declarations */\n#include \"jerror.h\"\t\t/* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/ios/jconfig.h",
    "content": "/* jconfig.h.  Generated from jconfig.cfg by configure.  */\n/* jconfig.cfg --- source file edited by configure script */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES 1\n#define HAVE_UNSIGNED_CHAR 1\n#define HAVE_UNSIGNED_SHORT 1\n/* #undef void */\n/* #undef const */\n/* #undef CHAR_IS_UNSIGNED */\n#define HAVE_STDDEF_H 1\n#define HAVE_STDLIB_H 1\n#define HAVE_LOCALE_H 1\n/* #undef NEED_BSD_STRINGS */\n/* #undef NEED_SYS_TYPES_H */\n/* #undef NEED_FAR_POINTERS */\n/* #undef NEED_SHORT_EXTERNAL_NAMES */\n/* Define this if you get warnings about undefined structures. */\n/* #undef INCOMPLETE_TYPES_BROKEN */\n\n/* Define \"boolean\" as unsigned char, not int, on Windows systems. */\n//#ifdef _WIN32\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n//#endif\n\n#ifdef JPEG_INTERNALS\n\n/* #undef RIGHT_SHIFT_IS_UNSIGNED */\n#define INLINE __inline__\n/* These are for configuring the JPEG memory manager. */\n/* #undef DEFAULT_MAX_MEM */\n/* #undef NO_MKTEMP */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n/* #undef RLE_SUPPORTED */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n/* #undef TWO_FILE_COMMANDLINE */\n/* #undef NEED_SIGNAL_CATCHER */\n/* #undef DONT_USE_B_MODE */\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg. */\n/* #undef PROGRESS_REPORT */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/ios/jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8\t/* use 8 or 12 */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10\t/* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE\t255\n#define CENTERJSAMPLE\t128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t4095\n#define CENTERJSAMPLE\t2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char UINT8;\n#else /* not CHAR_IS_UNSIGNED */\ntypedef short UINT8;\n#endif /* CHAR_IS_UNSIGNED */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT32 */\n#ifndef _BASETSD_H_\t\t/* Microsoft defines it in basetsd.h */\n#ifndef _BASETSD_H\t\t/* MinGW is slightly different */\n#ifndef QGLOBAL_H\t\t/* Qt defines it in qglobal.h */\ntypedef long INT32;\n#endif\n#endif\n#endif\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)\t\tstatic type\n/* a function used only in its module: */\n#define LOCAL(type)\t\tstatic type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)\t\ttype\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)\t\textern type\n\n\n/* This macro is used to declare a \"method\", that is, a function pointer.\n * We want to supply prototype parameters if the compiler can cope.\n * Note that the arglist parameter must be parenthesized!\n * Again, you can customize this if you need special linkage keywords.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n#else\n#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n#endif\n\n\n/* The noreturn type identifier is used to declare functions\n * which cannot return.\n * Compilers can thus create more optimized code and perform\n * better checks for warnings and errors.\n * Static analyzer tools can make improved inferences about\n * execution paths and are prevented from giving false alerts.\n *\n * Unfortunately, the proposed specifications of corresponding\n * extensions in the Dec 2011 ISO C standard revision (C11),\n * GCC, MSVC, etc. are not viable.\n * Thus we introduce a user defined type to declare noreturn\n * functions at least for clarity.  A proper compiler would\n * have a suitable noreturn type to match in place of void.\n */\n\n#ifndef HAVE_NORETURN_T\ntypedef void noreturn_t;\n#endif\n\n\n/* Here is the pseudo-keyword for declaring pointers that must be \"far\"\n * on 80x86 machines.  Most of the specialized coding for 80x86 is handled\n * by just saying \"FAR *\" where such a pointer is needed.  In a few places\n * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.\n */\n\n#ifndef FAR\n#ifdef NEED_FAR_POINTERS\n#define FAR  far\n#else\n#define FAR\n#endif\n#endif\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifdef HAVE_BOOLEAN\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#else\ntypedef enum { FALSE = 0, TRUE = 1 } boolean;\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED\t/* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED\t/* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED\t/* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define DCT_SCALING_SUPPORTED\t    /* Input rescaling via DCT? (Requires DCT_ISLOW)*/\n#define ENTROPY_OPT_SUPPORTED\t    /* Optimization of entropy coding parms? */\n/* Note: if you selected 12-bit data precision, it is dangerous to turn off\n * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit\n * precision, so jchuff.c normally uses entropy optimization to compute\n * usable tables for higher precision.  If you don't want to do optimization,\n * you'll have to supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define IDCT_SCALING_SUPPORTED\t    /* Output rescaling via IDCT? */\n#define SAVE_MARKERS_SUPPORTED\t    /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED\t    /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED\t    /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * Ordering of RGB data in scanlines passed to or from the application.\n * If your application wants to deal with data in the order B,G,R, just\n * change these macros.  You can also deal with formats such as R,G,B,X\n * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing\n * the offsets will also change the order in which colormap data is organized.\n * RESTRICTIONS:\n * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.\n * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE\n *    is not 3 (they don't understand about dummy color components!).  So you\n *    can't use color quantization if you change that value.\n */\n\n#define RGB_RED\t\t0\t/* Offset of Red in an RGB scanline element */\n#define RGB_GREEN\t1\t/* Offset of Green */\n#define RGB_BLUE\t2\t/* Offset of Blue */\n#define RGB_PIXELSIZE\t3\t/* JSAMPLEs per RGB scanline element */\n\n\n/* Definitions for speed-related optimizations. */\n\n\n/* If your compiler supports inline functions, define INLINE\n * as the inline keyword; otherwise define it as empty.\n */\n\n#ifndef INLINE\n#ifdef __GNUC__\t\t\t/* for instance, GNU C knows about inline */\n#define INLINE __inline__\n#endif\n#ifndef INLINE\n#define INLINE\t\t\t/* default is to define it as empty */\n#endif\n#endif\n\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#define MULTIPLIER  int\t\t/* type for fastest integer multiply */\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n * Typically, float is faster in ANSI C compilers, while double is faster in\n * pre-ANSI compilers (because they insist on converting to double anyway).\n * The code below therefore chooses float if we have ANSI-style prototypes.\n */\n\n#ifndef FAST_FLOAT\n#ifdef HAVE_PROTOTYPES\n#define FAST_FLOAT  float\n#else\n#define FAST_FLOAT  double\n#endif\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/ios/jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED\t/* in case jinclude.h already did */\n#include \"jconfig.h\"\t\t/* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"\t\t/* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n/* Version IDs for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 90\".\n */\n\n#define JPEG_LIB_VERSION        90\t/* Compatibility version 9.0 */\n#define JPEG_LIB_VERSION_MAJOR  9\n#define JPEG_LIB_VERSION_MINOR  0\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard, so don't change them\n * if you want to be compatible.\n */\n\n#define DCTSIZE\t\t    8\t/* The basic DCT block is 8x8 coefficients */\n#define DCTSIZE2\t    64\t/* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4\t/* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4\t/* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16\t/* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4\t/* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4\t/* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n * On 80x86 machines, the image arrays are too big for near pointers,\n * but the pointer arrays can fit in near memory.\n */\n\ntypedef JSAMPLE FAR *JSAMPROW;\t/* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;\t/* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE;\t/* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2];\t/* one block of coefficients */\ntypedef JBLOCK FAR *JBLOCKROW;\t/* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;\t\t/* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;\t/* a 3-D array of coefficient blocks */\n\ntypedef JCOEF FAR *JCOEFPTR;\t/* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];\t/* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];\t\t/* bits[k] = # of symbols with codes of */\n\t\t\t\t/* length k bits; bits[0] is unused */\n  UINT8 huffval[256];\t\t/* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;\t\t/* identifier for this component (0..255) */\n  int component_index;\t\t/* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;\t\t/* horizontal sampling factor (1..4) */\n  int v_samp_factor;\t\t/* vertical sampling factor (1..4) */\n  int quant_tbl_no;\t\t/* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;\t\t/* DC entropy table selector (0..3) */\n  int ac_tbl_no;\t\t/* AC entropy table selector (0..3) */\n  \n  /* Remaining fields should be treated as private by applications. */\n  \n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples,\n   * reflecting any scaling we choose to apply during the DCT step.\n   * Values from 1 to 16 are supported.\n   * Note that different components may receive different DCT scalings.\n   */\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface);\n   * DCT scaling is included, so\n   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)\n   * and similarly for height.\n   */\n  JDIMENSION downsampled_width;\t /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* This flag is used only for decompression.  In cases where some of the\n   * components will be ignored (eg grayscale output from YCbCr image),\n   * we can skip most computations for the unused components.\n   */\n  boolean component_needed;\t/* do we need the value of this component? */\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;\t\t/* number of blocks per MCU, horizontally */\n  int MCU_height;\t\t/* number of blocks per MCU, vertically */\n  int MCU_blocks;\t\t/* MCU_width * MCU_height */\n  int MCU_sample_width;\t/* MCU width in samples: MCU_width * DCT_h_scaled_size */\n  int last_col_width;\t\t/* # of non-dummy blocks across in last MCU */\n  int last_row_height;\t\t/* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL * quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void * dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;\t\t/* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;\t\t\t/* progressive JPEG spectral selection parms */\n  int Ah, Al;\t\t\t/* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;\t/* next in list, or NULL */\n  UINT8 marker;\t\t\t/* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length;\t/* # bytes of data in the file */\n  unsigned int data_length;\t/* # bytes of data saved at data[] */\n  JOCTET FAR * data;\t\t/* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\ntypedef enum {\n\tJCS_UNKNOWN,\t\t/* error/unspecified */\n\tJCS_GRAYSCALE,\t\t/* monochrome */\n\tJCS_RGB,\t\t/* red/green/blue */\n\tJCS_YCbCr,\t\t/* Y/Cb/Cr (also known as YUV) */\n\tJCS_CMYK,\t\t/* C/M/Y/K */\n\tJCS_YCCK\t\t/* Y/Cb/Cr/K */\n} J_COLOR_SPACE;\n\n/* Supported color transforms. */\n\ntypedef enum {\n\tJCT_NONE           = 0,\n\tJCT_SUBTRACT_GREEN = 1\n} J_COLOR_TRANSFORM;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n\tJDCT_ISLOW,\t\t/* slow but accurate integer algorithm */\n\tJDCT_IFAST,\t\t/* faster, less accurate integer method */\n\tJDCT_FLOAT\t\t/* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT\t\t/* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST\t\t/* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n\tJDITHER_NONE,\t\t/* no dithering */\n\tJDITHER_ORDERED,\t/* simple ordered dither */\n\tJDITHER_FS\t\t/* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr * err;\t/* Error handler module */\\\n  struct jpeg_memory_mgr * mem;\t/* Memory manager module */\\\n  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\\\n  void * client_data;\t\t/* Available for use by application */\\\n  boolean is_decompressor;\t/* So common code can tell which is which */\\\n  int global_state\t\t/* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;\t\t/* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct * j_common_ptr;\ntypedef struct jpeg_compress_struct * j_compress_ptr;\ntypedef struct jpeg_decompress_struct * j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr * dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;\t/* input image width */\n  JDIMENSION image_height;\t/* input image height */\n  int input_components;\t\t/* # of color components in input image */\n  J_COLOR_SPACE in_color_space;\t/* colorspace of input image */\n\n  double input_gamma;\t\t/* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;\t/* scaled JPEG image width */\n  JDIMENSION jpeg_height;\t/* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  int q_scale_factor[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;\t\t/* # of entries in scan_info array */\n  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;\t\t/* TRUE=caller supplies downsampled data */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;\t/* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n  int smoothing_factor;\t\t/* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;\t/* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;\t\t/* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;\t/* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;\t/* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean write_Adobe_marker;\t/* should an Adobe marker be written? */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier, writes LSE marker if nonzero */\n\n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;\t/* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;\t/* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n  \n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n  \n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n  \n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order;\t/* natural-order position array */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) */\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master * master;\n  struct jpeg_c_main_controller * main;\n  struct jpeg_c_prep_controller * prep;\n  struct jpeg_c_coef_controller * coef;\n  struct jpeg_marker_writer * marker;\n  struct jpeg_color_converter * cconvert;\n  struct jpeg_downsampler * downsample;\n  struct jpeg_forward_dct * fdct;\n  struct jpeg_entropy_encoder * entropy;\n  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr * src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;\t/* nominal image width (from SOF marker) */\n  JDIMENSION image_height;\t/* nominal image height */\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;\t\t/* image gamma wanted in output */\n\n  boolean buffered_image;\t/* TRUE=multiple output passes */\n  boolean raw_data_out;\t\t/* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;\t/* IDCT algorithm selector */\n  boolean do_fancy_upsampling;\t/* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;\t/* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;\t/* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;\t/* type of color dithering to use */\n  boolean two_pass_quantize;\t/* TRUE=use two-pass color quantization */\n  int desired_number_of_colors;\t/* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;\t/* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;\t/* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;\t/* scaled image width */\n  JDIMENSION output_height;\t/* scaled image height */\n  int out_color_components;\t/* # of color components in out_color_space */\n  int output_components;\t/* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;\t/* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;\t/* number of entries in use */\n  JSAMPARRAY colormap;\t\t/* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;\t/* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;\t/* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;\t/* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;\t/* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;\t/* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];\t/* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  boolean is_baseline;\t\t/* TRUE if Baseline SOF0 encountered */\n  boolean progressive_mode;\t/* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;\t/* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;\t/* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean saw_Adobe_marker;\t/* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;\t/* Color transform code from Adobe marker */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier derived from LSE marker, otherwise zero */\n\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE * sample_range_limit; /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n\n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) for entropy decode */\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master * master;\n  struct jpeg_d_main_controller * main;\n  struct jpeg_d_coef_controller * coef;\n  struct jpeg_d_post_controller * post;\n  struct jpeg_input_controller * inputctl;\n  struct jpeg_marker_reader * marker;\n  struct jpeg_entropy_decoder * entropy;\n  struct jpeg_inverse_dct * idct;\n  struct jpeg_upsampler * upsample;\n  struct jpeg_color_deconverter * cconvert;\n  struct jpeg_color_quantizer * cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));\n  /* Conditionally emit a trace or warning message */\n  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));\n  /* Routine that actually outputs a trace or error message */\n  JMETHOD(void, output_message, (j_common_ptr cinfo));\n  /* Format a message string for the most recent JPEG error or message */\n  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));\n#define JMSG_LENGTH_MAX  200\t/* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));\n  \n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n  \n  /* Standard state variables for error facility */\n  \n  int trace_level;\t\t/* max msg_level that will be displayed */\n  \n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;\t\t/* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const * jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const * addon_message_table; /* Non-library errors */\n  int first_addon_message;\t/* code for first string in addon table */\n  int last_addon_message;\t/* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));\n\n  long pass_counter;\t\t/* work units completed in this pass */\n  long pass_limit;\t\t/* total number of work units in this pass */\n  int completed_passes;\t\t/* passes completed so far */\n  int total_passes;\t\t/* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n\n  JMETHOD(void, init_destination, (j_compress_ptr cinfo));\n  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));\n  JMETHOD(void, term_destination, (j_compress_ptr cinfo));\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET * next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in buffer */\n\n  JMETHOD(void, init_source, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));\n  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));\n  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));\n  JMETHOD(void, term_source, (j_decompress_ptr cinfo));\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT\t0\t/* lasts until master record is destroyed */\n#define JPOOL_IMAGE\t1\t/* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS\t2\n\ntypedef struct jvirt_sarray_control * jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control * jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,\n\t\t\t\tsize_t sizeofobject));\n  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     size_t sizeofobject));\n  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     JDIMENSION samplesperrow,\n\t\t\t\t     JDIMENSION numrows));\n  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t      JDIMENSION blocksperrow,\n\t\t\t\t      JDIMENSION numrows));\n  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION samplesperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION blocksperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));\n  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t   jvirt_sarray_ptr ptr,\n\t\t\t\t\t   JDIMENSION start_row,\n\t\t\t\t\t   JDIMENSION num_rows,\n\t\t\t\t\t   boolean writable));\n  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t    jvirt_barray_ptr ptr,\n\t\t\t\t\t    JDIMENSION start_row,\n\t\t\t\t\t    JDIMENSION num_rows,\n\t\t\t\t\t    boolean writable));\n  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));\n  JMETHOD(void, self_destruct, (j_common_ptr cinfo));\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));\n\n\n/* Declarations for routines called by application.\n * The JPP macro hides prototype parameters from compilers that can't cope.\n * Note JPP requires double parentheses.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JPP(arglist)\targlist\n#else\n#define JPP(arglist)\t()\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers.\n * We shorten external names to be unique in the first six letters, which\n * is good enough for all known systems.\n * (If your compiler itself needs names to be unique in less than 15 \n * characters, you are out of luck.  Get a better compiler.)\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_error\t\tjStdError\n#define jpeg_CreateCompress\tjCreaCompress\n#define jpeg_CreateDecompress\tjCreaDecompress\n#define jpeg_destroy_compress\tjDestCompress\n#define jpeg_destroy_decompress\tjDestDecompress\n#define jpeg_stdio_dest\t\tjStdDest\n#define jpeg_stdio_src\t\tjStdSrc\n#define jpeg_mem_dest\t\tjMemDest\n#define jpeg_mem_src\t\tjMemSrc\n#define jpeg_set_defaults\tjSetDefaults\n#define jpeg_set_colorspace\tjSetColorspace\n#define jpeg_default_colorspace\tjDefColorspace\n#define jpeg_set_quality\tjSetQuality\n#define jpeg_set_linear_quality\tjSetLQuality\n#define jpeg_default_qtables\tjDefQTables\n#define jpeg_add_quant_table\tjAddQuantTable\n#define jpeg_quality_scaling\tjQualityScaling\n#define jpeg_simple_progression\tjSimProgress\n#define jpeg_suppress_tables\tjSuppressTables\n#define jpeg_alloc_quant_table\tjAlcQTable\n#define jpeg_alloc_huff_table\tjAlcHTable\n#define jpeg_start_compress\tjStrtCompress\n#define jpeg_write_scanlines\tjWrtScanlines\n#define jpeg_finish_compress\tjFinCompress\n#define jpeg_calc_jpeg_dimensions\tjCjpegDimensions\n#define jpeg_write_raw_data\tjWrtRawData\n#define jpeg_write_marker\tjWrtMarker\n#define jpeg_write_m_header\tjWrtMHeader\n#define jpeg_write_m_byte\tjWrtMByte\n#define jpeg_write_tables\tjWrtTables\n#define jpeg_read_header\tjReadHeader\n#define jpeg_start_decompress\tjStrtDecompress\n#define jpeg_read_scanlines\tjReadScanlines\n#define jpeg_finish_decompress\tjFinDecompress\n#define jpeg_read_raw_data\tjReadRawData\n#define jpeg_has_multiple_scans\tjHasMultScn\n#define jpeg_start_output\tjStrtOutput\n#define jpeg_finish_output\tjFinOutput\n#define jpeg_input_complete\tjInComplete\n#define jpeg_new_colormap\tjNewCMap\n#define jpeg_consume_input\tjConsumeInput\n#define jpeg_core_output_dimensions\tjCoreDimensions\n#define jpeg_calc_output_dimensions\tjCalcDimensions\n#define jpeg_save_markers\tjSaveMarkers\n#define jpeg_set_marker_processor\tjSetMarker\n#define jpeg_read_coefficients\tjReadCoefs\n#define jpeg_write_coefficients\tjWrtCoefs\n#define jpeg_copy_critical_parameters\tjCopyCrit\n#define jpeg_abort_compress\tjAbrtCompress\n#define jpeg_abort_decompress\tjAbrtDecompress\n#define jpeg_abort\t\tjAbort\n#define jpeg_destroy\t\tjDestroy\n#define jpeg_resync_to_restart\tjResyncRestart\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error\n\tJPP((struct jpeg_error_mgr * err));\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t(size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t  (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,\n\t\t\t\t      int version, size_t structsize));\nEXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,\n\t\t\t\t\tint version, size_t structsize));\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));\nEXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,\n\t\t\t       unsigned char ** outbuffer,\n\t\t\t       unsigned long * outsize));\nEXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,\n\t\t\t      unsigned char * inbuffer,\n\t\t\t      unsigned long insize));\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,\n\t\t\t\t      J_COLOR_SPACE colorspace));\nEXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,\n\t\t\t\t   boolean force_baseline));\nEXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  int scale_factor,\n\t\t\t\t\t  boolean force_baseline));\nEXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean force_baseline));\nEXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,\n\t\t\t\t       const unsigned int *basic_table,\n\t\t\t\t       int scale_factor,\n\t\t\t\t       boolean force_baseline));\nEXTERN(int) jpeg_quality_scaling JPP((int quality));\nEXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean suppress));\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,\n\t\t\t\t      boolean write_all_tables));\nEXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JSAMPARRAY scanlines,\n\t\t\t\t\t     JDIMENSION num_lines));\nEXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));\n\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JSAMPIMAGE data,\n\t\t\t\t\t    JDIMENSION num_lines));\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker\n\tJPP((j_compress_ptr cinfo, int marker,\n\t     const JOCTET * dataptr, unsigned int datalen));\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header\n\tJPP((j_compress_ptr cinfo, int marker, unsigned int datalen));\nEXTERN(void) jpeg_write_m_byte\n\tJPP((j_compress_ptr cinfo, int val));\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,\n\t\t\t\t  boolean require_image));\n/* Return value is one of: */\n#define JPEG_SUSPENDED\t\t0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK\t\t1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY\t2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JSAMPARRAY scanlines,\n\t\t\t\t\t    JDIMENSION max_lines));\nEXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t   JSAMPIMAGE data,\n\t\t\t\t\t   JDIMENSION max_lines));\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,\n\t\t\t\t       int scan_number));\nEXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));\nEXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED\t0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS\t1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI\t2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED\t3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED\t4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\nEXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     unsigned int length_limit));\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     jpeg_marker_parser_method routine));\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  jvirt_barray_ptr * coef_arrays));\nEXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,\n\t\t\t\t\t\tj_compress_ptr dstinfo));\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    int desired));\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0\t0xD0\t/* RST0 marker code */\n#define JPEG_EOI\t0xD9\t/* EOI marker code */\n#define JPEG_APP0\t0xE0\t/* APP0 marker code */\n#define JPEG_COM\t0xFE\t/* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS\t\t/* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"\t\t/* fetch private declarations */\n#include \"jerror.h\"\t\t/* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/linux/jconfig.h",
    "content": "/* jconfig.h.  Generated from jconfig.cfg by configure.  */\n/* jconfig.cfg --- source file edited by configure script */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES 1\n#define HAVE_UNSIGNED_CHAR 1\n#define HAVE_UNSIGNED_SHORT 1\n/* #undef void */\n/* #undef const */\n/* #undef CHAR_IS_UNSIGNED */\n#define HAVE_STDDEF_H 1\n#define HAVE_STDLIB_H 1\n#define HAVE_LOCALE_H 1\n/* #undef NEED_BSD_STRINGS */\n/* #undef NEED_SYS_TYPES_H */\n/* #undef NEED_FAR_POINTERS */\n/* #undef NEED_SHORT_EXTERNAL_NAMES */\n/* Define this if you get warnings about undefined structures. */\n/* #undef INCOMPLETE_TYPES_BROKEN */\n\n/* Define \"boolean\" as unsigned char, not int, on Windows systems. */\n#ifdef _WIN32\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n#endif\n\n#ifdef JPEG_INTERNALS\n\n/* #undef RIGHT_SHIFT_IS_UNSIGNED */\n#define INLINE __inline__\n/* These are for configuring the JPEG memory manager. */\n/* #undef DEFAULT_MAX_MEM */\n/* #undef NO_MKTEMP */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n/* #undef RLE_SUPPORTED */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n/* #undef TWO_FILE_COMMANDLINE */\n/* #undef NEED_SIGNAL_CATCHER */\n/* #undef DONT_USE_B_MODE */\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg. */\n/* #undef PROGRESS_REPORT */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/linux/jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8\t/* use 8 or 12 */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10\t/* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE\t255\n#define CENTERJSAMPLE\t128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t4095\n#define CENTERJSAMPLE\t2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char UINT8;\n#else /* not CHAR_IS_UNSIGNED */\ntypedef short UINT8;\n#endif /* CHAR_IS_UNSIGNED */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT32 */\n#ifndef _BASETSD_H_\t\t/* Microsoft defines it in basetsd.h */\n#ifndef _BASETSD_H\t\t/* MinGW is slightly different */\n#ifndef QGLOBAL_H\t\t/* Qt defines it in qglobal.h */\ntypedef long INT32;\n#endif\n#endif\n#endif\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)\t\tstatic type\n/* a function used only in its module: */\n#define LOCAL(type)\t\tstatic type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)\t\ttype\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)\t\textern type\n\n\n/* This macro is used to declare a \"method\", that is, a function pointer.\n * We want to supply prototype parameters if the compiler can cope.\n * Note that the arglist parameter must be parenthesized!\n * Again, you can customize this if you need special linkage keywords.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n#else\n#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n#endif\n\n\n/* The noreturn type identifier is used to declare functions\n * which cannot return.\n * Compilers can thus create more optimized code and perform\n * better checks for warnings and errors.\n * Static analyzer tools can make improved inferences about\n * execution paths and are prevented from giving false alerts.\n *\n * Unfortunately, the proposed specifications of corresponding\n * extensions in the Dec 2011 ISO C standard revision (C11),\n * GCC, MSVC, etc. are not viable.\n * Thus we introduce a user defined type to declare noreturn\n * functions at least for clarity.  A proper compiler would\n * have a suitable noreturn type to match in place of void.\n */\n\n#ifndef HAVE_NORETURN_T\ntypedef void noreturn_t;\n#endif\n\n\n/* Here is the pseudo-keyword for declaring pointers that must be \"far\"\n * on 80x86 machines.  Most of the specialized coding for 80x86 is handled\n * by just saying \"FAR *\" where such a pointer is needed.  In a few places\n * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.\n */\n\n#ifndef FAR\n#ifdef NEED_FAR_POINTERS\n#define FAR  far\n#else\n#define FAR\n#endif\n#endif\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifdef HAVE_BOOLEAN\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#else\ntypedef enum { FALSE = 0, TRUE = 1 } boolean;\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED\t/* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED\t/* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED\t/* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define DCT_SCALING_SUPPORTED\t    /* Input rescaling via DCT? (Requires DCT_ISLOW)*/\n#define ENTROPY_OPT_SUPPORTED\t    /* Optimization of entropy coding parms? */\n/* Note: if you selected 12-bit data precision, it is dangerous to turn off\n * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit\n * precision, so jchuff.c normally uses entropy optimization to compute\n * usable tables for higher precision.  If you don't want to do optimization,\n * you'll have to supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define IDCT_SCALING_SUPPORTED\t    /* Output rescaling via IDCT? */\n#define SAVE_MARKERS_SUPPORTED\t    /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED\t    /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED\t    /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * Ordering of RGB data in scanlines passed to or from the application.\n * If your application wants to deal with data in the order B,G,R, just\n * change these macros.  You can also deal with formats such as R,G,B,X\n * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing\n * the offsets will also change the order in which colormap data is organized.\n * RESTRICTIONS:\n * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.\n * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE\n *    is not 3 (they don't understand about dummy color components!).  So you\n *    can't use color quantization if you change that value.\n */\n\n#define RGB_RED\t\t0\t/* Offset of Red in an RGB scanline element */\n#define RGB_GREEN\t1\t/* Offset of Green */\n#define RGB_BLUE\t2\t/* Offset of Blue */\n#define RGB_PIXELSIZE\t3\t/* JSAMPLEs per RGB scanline element */\n\n\n/* Definitions for speed-related optimizations. */\n\n\n/* If your compiler supports inline functions, define INLINE\n * as the inline keyword; otherwise define it as empty.\n */\n\n#ifndef INLINE\n#ifdef __GNUC__\t\t\t/* for instance, GNU C knows about inline */\n#define INLINE __inline__\n#endif\n#ifndef INLINE\n#define INLINE\t\t\t/* default is to define it as empty */\n#endif\n#endif\n\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#define MULTIPLIER  int\t\t/* type for fastest integer multiply */\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n * Typically, float is faster in ANSI C compilers, while double is faster in\n * pre-ANSI compilers (because they insist on converting to double anyway).\n * The code below therefore chooses float if we have ANSI-style prototypes.\n */\n\n#ifndef FAST_FLOAT\n#ifdef HAVE_PROTOTYPES\n#define FAST_FLOAT  float\n#else\n#define FAST_FLOAT  double\n#endif\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/linux/jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED\t/* in case jinclude.h already did */\n#include \"jconfig.h\"\t\t/* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"\t\t/* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n/* Version IDs for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 90\".\n */\n\n#define JPEG_LIB_VERSION        90\t/* Compatibility version 9.0 */\n#define JPEG_LIB_VERSION_MAJOR  9\n#define JPEG_LIB_VERSION_MINOR  0\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard, so don't change them\n * if you want to be compatible.\n */\n\n#define DCTSIZE\t\t    8\t/* The basic DCT block is 8x8 coefficients */\n#define DCTSIZE2\t    64\t/* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4\t/* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4\t/* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16\t/* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4\t/* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4\t/* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n * On 80x86 machines, the image arrays are too big for near pointers,\n * but the pointer arrays can fit in near memory.\n */\n\ntypedef JSAMPLE FAR *JSAMPROW;\t/* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;\t/* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE;\t/* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2];\t/* one block of coefficients */\ntypedef JBLOCK FAR *JBLOCKROW;\t/* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;\t\t/* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;\t/* a 3-D array of coefficient blocks */\n\ntypedef JCOEF FAR *JCOEFPTR;\t/* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];\t/* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];\t\t/* bits[k] = # of symbols with codes of */\n\t\t\t\t/* length k bits; bits[0] is unused */\n  UINT8 huffval[256];\t\t/* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;\t\t/* identifier for this component (0..255) */\n  int component_index;\t\t/* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;\t\t/* horizontal sampling factor (1..4) */\n  int v_samp_factor;\t\t/* vertical sampling factor (1..4) */\n  int quant_tbl_no;\t\t/* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;\t\t/* DC entropy table selector (0..3) */\n  int ac_tbl_no;\t\t/* AC entropy table selector (0..3) */\n  \n  /* Remaining fields should be treated as private by applications. */\n  \n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples,\n   * reflecting any scaling we choose to apply during the DCT step.\n   * Values from 1 to 16 are supported.\n   * Note that different components may receive different DCT scalings.\n   */\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface);\n   * DCT scaling is included, so\n   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)\n   * and similarly for height.\n   */\n  JDIMENSION downsampled_width;\t /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* This flag is used only for decompression.  In cases where some of the\n   * components will be ignored (eg grayscale output from YCbCr image),\n   * we can skip most computations for the unused components.\n   */\n  boolean component_needed;\t/* do we need the value of this component? */\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;\t\t/* number of blocks per MCU, horizontally */\n  int MCU_height;\t\t/* number of blocks per MCU, vertically */\n  int MCU_blocks;\t\t/* MCU_width * MCU_height */\n  int MCU_sample_width;\t/* MCU width in samples: MCU_width * DCT_h_scaled_size */\n  int last_col_width;\t\t/* # of non-dummy blocks across in last MCU */\n  int last_row_height;\t\t/* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL * quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void * dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;\t\t/* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;\t\t\t/* progressive JPEG spectral selection parms */\n  int Ah, Al;\t\t\t/* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;\t/* next in list, or NULL */\n  UINT8 marker;\t\t\t/* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length;\t/* # bytes of data in the file */\n  unsigned int data_length;\t/* # bytes of data saved at data[] */\n  JOCTET FAR * data;\t\t/* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\ntypedef enum {\n\tJCS_UNKNOWN,\t\t/* error/unspecified */\n\tJCS_GRAYSCALE,\t\t/* monochrome */\n\tJCS_RGB,\t\t/* red/green/blue */\n\tJCS_YCbCr,\t\t/* Y/Cb/Cr (also known as YUV) */\n\tJCS_CMYK,\t\t/* C/M/Y/K */\n\tJCS_YCCK\t\t/* Y/Cb/Cr/K */\n} J_COLOR_SPACE;\n\n/* Supported color transforms. */\n\ntypedef enum {\n\tJCT_NONE           = 0,\n\tJCT_SUBTRACT_GREEN = 1\n} J_COLOR_TRANSFORM;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n\tJDCT_ISLOW,\t\t/* slow but accurate integer algorithm */\n\tJDCT_IFAST,\t\t/* faster, less accurate integer method */\n\tJDCT_FLOAT\t\t/* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT\t\t/* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST\t\t/* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n\tJDITHER_NONE,\t\t/* no dithering */\n\tJDITHER_ORDERED,\t/* simple ordered dither */\n\tJDITHER_FS\t\t/* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr * err;\t/* Error handler module */\\\n  struct jpeg_memory_mgr * mem;\t/* Memory manager module */\\\n  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\\\n  void * client_data;\t\t/* Available for use by application */\\\n  boolean is_decompressor;\t/* So common code can tell which is which */\\\n  int global_state\t\t/* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;\t\t/* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct * j_common_ptr;\ntypedef struct jpeg_compress_struct * j_compress_ptr;\ntypedef struct jpeg_decompress_struct * j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr * dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;\t/* input image width */\n  JDIMENSION image_height;\t/* input image height */\n  int input_components;\t\t/* # of color components in input image */\n  J_COLOR_SPACE in_color_space;\t/* colorspace of input image */\n\n  double input_gamma;\t\t/* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;\t/* scaled JPEG image width */\n  JDIMENSION jpeg_height;\t/* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  int q_scale_factor[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;\t\t/* # of entries in scan_info array */\n  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;\t\t/* TRUE=caller supplies downsampled data */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;\t/* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n  int smoothing_factor;\t\t/* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;\t/* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;\t\t/* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;\t/* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;\t/* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean write_Adobe_marker;\t/* should an Adobe marker be written? */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier, writes LSE marker if nonzero */\n\n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;\t/* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;\t/* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n  \n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n  \n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n  \n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order;\t/* natural-order position array */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) */\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master * master;\n  struct jpeg_c_main_controller * main;\n  struct jpeg_c_prep_controller * prep;\n  struct jpeg_c_coef_controller * coef;\n  struct jpeg_marker_writer * marker;\n  struct jpeg_color_converter * cconvert;\n  struct jpeg_downsampler * downsample;\n  struct jpeg_forward_dct * fdct;\n  struct jpeg_entropy_encoder * entropy;\n  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr * src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;\t/* nominal image width (from SOF marker) */\n  JDIMENSION image_height;\t/* nominal image height */\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;\t\t/* image gamma wanted in output */\n\n  boolean buffered_image;\t/* TRUE=multiple output passes */\n  boolean raw_data_out;\t\t/* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;\t/* IDCT algorithm selector */\n  boolean do_fancy_upsampling;\t/* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;\t/* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;\t/* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;\t/* type of color dithering to use */\n  boolean two_pass_quantize;\t/* TRUE=use two-pass color quantization */\n  int desired_number_of_colors;\t/* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;\t/* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;\t/* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;\t/* scaled image width */\n  JDIMENSION output_height;\t/* scaled image height */\n  int out_color_components;\t/* # of color components in out_color_space */\n  int output_components;\t/* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;\t/* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;\t/* number of entries in use */\n  JSAMPARRAY colormap;\t\t/* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;\t/* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;\t/* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;\t/* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;\t/* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;\t/* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];\t/* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  boolean is_baseline;\t\t/* TRUE if Baseline SOF0 encountered */\n  boolean progressive_mode;\t/* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;\t/* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;\t/* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean saw_Adobe_marker;\t/* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;\t/* Color transform code from Adobe marker */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier derived from LSE marker, otherwise zero */\n\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE * sample_range_limit; /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n\n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) for entropy decode */\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master * master;\n  struct jpeg_d_main_controller * main;\n  struct jpeg_d_coef_controller * coef;\n  struct jpeg_d_post_controller * post;\n  struct jpeg_input_controller * inputctl;\n  struct jpeg_marker_reader * marker;\n  struct jpeg_entropy_decoder * entropy;\n  struct jpeg_inverse_dct * idct;\n  struct jpeg_upsampler * upsample;\n  struct jpeg_color_deconverter * cconvert;\n  struct jpeg_color_quantizer * cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));\n  /* Conditionally emit a trace or warning message */\n  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));\n  /* Routine that actually outputs a trace or error message */\n  JMETHOD(void, output_message, (j_common_ptr cinfo));\n  /* Format a message string for the most recent JPEG error or message */\n  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));\n#define JMSG_LENGTH_MAX  200\t/* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));\n  \n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n  \n  /* Standard state variables for error facility */\n  \n  int trace_level;\t\t/* max msg_level that will be displayed */\n  \n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;\t\t/* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const * jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const * addon_message_table; /* Non-library errors */\n  int first_addon_message;\t/* code for first string in addon table */\n  int last_addon_message;\t/* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));\n\n  long pass_counter;\t\t/* work units completed in this pass */\n  long pass_limit;\t\t/* total number of work units in this pass */\n  int completed_passes;\t\t/* passes completed so far */\n  int total_passes;\t\t/* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n\n  JMETHOD(void, init_destination, (j_compress_ptr cinfo));\n  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));\n  JMETHOD(void, term_destination, (j_compress_ptr cinfo));\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET * next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in buffer */\n\n  JMETHOD(void, init_source, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));\n  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));\n  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));\n  JMETHOD(void, term_source, (j_decompress_ptr cinfo));\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT\t0\t/* lasts until master record is destroyed */\n#define JPOOL_IMAGE\t1\t/* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS\t2\n\ntypedef struct jvirt_sarray_control * jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control * jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,\n\t\t\t\tsize_t sizeofobject));\n  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     size_t sizeofobject));\n  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     JDIMENSION samplesperrow,\n\t\t\t\t     JDIMENSION numrows));\n  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t      JDIMENSION blocksperrow,\n\t\t\t\t      JDIMENSION numrows));\n  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION samplesperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION blocksperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));\n  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t   jvirt_sarray_ptr ptr,\n\t\t\t\t\t   JDIMENSION start_row,\n\t\t\t\t\t   JDIMENSION num_rows,\n\t\t\t\t\t   boolean writable));\n  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t    jvirt_barray_ptr ptr,\n\t\t\t\t\t    JDIMENSION start_row,\n\t\t\t\t\t    JDIMENSION num_rows,\n\t\t\t\t\t    boolean writable));\n  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));\n  JMETHOD(void, self_destruct, (j_common_ptr cinfo));\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));\n\n\n/* Declarations for routines called by application.\n * The JPP macro hides prototype parameters from compilers that can't cope.\n * Note JPP requires double parentheses.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JPP(arglist)\targlist\n#else\n#define JPP(arglist)\t()\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers.\n * We shorten external names to be unique in the first six letters, which\n * is good enough for all known systems.\n * (If your compiler itself needs names to be unique in less than 15 \n * characters, you are out of luck.  Get a better compiler.)\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_error\t\tjStdError\n#define jpeg_CreateCompress\tjCreaCompress\n#define jpeg_CreateDecompress\tjCreaDecompress\n#define jpeg_destroy_compress\tjDestCompress\n#define jpeg_destroy_decompress\tjDestDecompress\n#define jpeg_stdio_dest\t\tjStdDest\n#define jpeg_stdio_src\t\tjStdSrc\n#define jpeg_mem_dest\t\tjMemDest\n#define jpeg_mem_src\t\tjMemSrc\n#define jpeg_set_defaults\tjSetDefaults\n#define jpeg_set_colorspace\tjSetColorspace\n#define jpeg_default_colorspace\tjDefColorspace\n#define jpeg_set_quality\tjSetQuality\n#define jpeg_set_linear_quality\tjSetLQuality\n#define jpeg_default_qtables\tjDefQTables\n#define jpeg_add_quant_table\tjAddQuantTable\n#define jpeg_quality_scaling\tjQualityScaling\n#define jpeg_simple_progression\tjSimProgress\n#define jpeg_suppress_tables\tjSuppressTables\n#define jpeg_alloc_quant_table\tjAlcQTable\n#define jpeg_alloc_huff_table\tjAlcHTable\n#define jpeg_start_compress\tjStrtCompress\n#define jpeg_write_scanlines\tjWrtScanlines\n#define jpeg_finish_compress\tjFinCompress\n#define jpeg_calc_jpeg_dimensions\tjCjpegDimensions\n#define jpeg_write_raw_data\tjWrtRawData\n#define jpeg_write_marker\tjWrtMarker\n#define jpeg_write_m_header\tjWrtMHeader\n#define jpeg_write_m_byte\tjWrtMByte\n#define jpeg_write_tables\tjWrtTables\n#define jpeg_read_header\tjReadHeader\n#define jpeg_start_decompress\tjStrtDecompress\n#define jpeg_read_scanlines\tjReadScanlines\n#define jpeg_finish_decompress\tjFinDecompress\n#define jpeg_read_raw_data\tjReadRawData\n#define jpeg_has_multiple_scans\tjHasMultScn\n#define jpeg_start_output\tjStrtOutput\n#define jpeg_finish_output\tjFinOutput\n#define jpeg_input_complete\tjInComplete\n#define jpeg_new_colormap\tjNewCMap\n#define jpeg_consume_input\tjConsumeInput\n#define jpeg_core_output_dimensions\tjCoreDimensions\n#define jpeg_calc_output_dimensions\tjCalcDimensions\n#define jpeg_save_markers\tjSaveMarkers\n#define jpeg_set_marker_processor\tjSetMarker\n#define jpeg_read_coefficients\tjReadCoefs\n#define jpeg_write_coefficients\tjWrtCoefs\n#define jpeg_copy_critical_parameters\tjCopyCrit\n#define jpeg_abort_compress\tjAbrtCompress\n#define jpeg_abort_decompress\tjAbrtDecompress\n#define jpeg_abort\t\tjAbort\n#define jpeg_destroy\t\tjDestroy\n#define jpeg_resync_to_restart\tjResyncRestart\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error\n\tJPP((struct jpeg_error_mgr * err));\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t(size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t  (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,\n\t\t\t\t      int version, size_t structsize));\nEXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,\n\t\t\t\t\tint version, size_t structsize));\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));\nEXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,\n\t\t\t       unsigned char ** outbuffer,\n\t\t\t       unsigned long * outsize));\nEXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,\n\t\t\t      unsigned char * inbuffer,\n\t\t\t      unsigned long insize));\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,\n\t\t\t\t      J_COLOR_SPACE colorspace));\nEXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,\n\t\t\t\t   boolean force_baseline));\nEXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  int scale_factor,\n\t\t\t\t\t  boolean force_baseline));\nEXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean force_baseline));\nEXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,\n\t\t\t\t       const unsigned int *basic_table,\n\t\t\t\t       int scale_factor,\n\t\t\t\t       boolean force_baseline));\nEXTERN(int) jpeg_quality_scaling JPP((int quality));\nEXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean suppress));\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,\n\t\t\t\t      boolean write_all_tables));\nEXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JSAMPARRAY scanlines,\n\t\t\t\t\t     JDIMENSION num_lines));\nEXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));\n\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JSAMPIMAGE data,\n\t\t\t\t\t    JDIMENSION num_lines));\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker\n\tJPP((j_compress_ptr cinfo, int marker,\n\t     const JOCTET * dataptr, unsigned int datalen));\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header\n\tJPP((j_compress_ptr cinfo, int marker, unsigned int datalen));\nEXTERN(void) jpeg_write_m_byte\n\tJPP((j_compress_ptr cinfo, int val));\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,\n\t\t\t\t  boolean require_image));\n/* Return value is one of: */\n#define JPEG_SUSPENDED\t\t0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK\t\t1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY\t2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JSAMPARRAY scanlines,\n\t\t\t\t\t    JDIMENSION max_lines));\nEXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t   JSAMPIMAGE data,\n\t\t\t\t\t   JDIMENSION max_lines));\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,\n\t\t\t\t       int scan_number));\nEXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));\nEXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED\t0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS\t1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI\t2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED\t3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED\t4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\nEXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     unsigned int length_limit));\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     jpeg_marker_parser_method routine));\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  jvirt_barray_ptr * coef_arrays));\nEXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,\n\t\t\t\t\t\tj_compress_ptr dstinfo));\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    int desired));\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0\t0xD0\t/* RST0 marker code */\n#define JPEG_EOI\t0xD9\t/* EOI marker code */\n#define JPEG_APP0\t0xE0\t/* APP0 marker code */\n#define JPEG_COM\t0xFE\t/* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS\t\t/* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"\t\t/* fetch private declarations */\n#include \"jerror.h\"\t\t/* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/mac/jconfig.h",
    "content": "/* jconfig.h.  Generated from jconfig.cfg by configure.  */\n/* jconfig.cfg --- source file edited by configure script */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES 1\n#define HAVE_UNSIGNED_CHAR 1\n#define HAVE_UNSIGNED_SHORT 1\n/* #undef void */\n/* #undef const */\n/* #undef CHAR_IS_UNSIGNED */\n#define HAVE_STDDEF_H 1\n#define HAVE_STDLIB_H 1\n#define HAVE_LOCALE_H 1\n/* #undef NEED_BSD_STRINGS */\n/* #undef NEED_SYS_TYPES_H */\n/* #undef NEED_FAR_POINTERS */\n/* #undef NEED_SHORT_EXTERNAL_NAMES */\n/* Define this if you get warnings about undefined structures. */\n/* #undef INCOMPLETE_TYPES_BROKEN */\n\n/* Define \"boolean\" as unsigned char, not int, on Windows systems. */\n//#ifdef _WIN32\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n//#endif\n\n#ifdef JPEG_INTERNALS\n\n/* #undef RIGHT_SHIFT_IS_UNSIGNED */\n#define INLINE __inline__\n/* These are for configuring the JPEG memory manager. */\n/* #undef DEFAULT_MAX_MEM */\n/* #undef NO_MKTEMP */\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n/* #undef RLE_SUPPORTED */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n/* #undef TWO_FILE_COMMANDLINE */\n/* #undef NEED_SIGNAL_CATCHER */\n/* #undef DONT_USE_B_MODE */\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg. */\n/* #undef PROGRESS_REPORT */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/mac/jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8\t/* use 8 or 12 */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10\t/* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE\t255\n#define CENTERJSAMPLE\t128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t4095\n#define CENTERJSAMPLE\t2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char UINT8;\n#else /* not CHAR_IS_UNSIGNED */\ntypedef short UINT8;\n#endif /* CHAR_IS_UNSIGNED */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT32 */\n#ifndef _BASETSD_H_\t\t/* Microsoft defines it in basetsd.h */\n#ifndef _BASETSD_H\t\t/* MinGW is slightly different */\n#ifndef QGLOBAL_H\t\t/* Qt defines it in qglobal.h */\ntypedef long INT32;\n#endif\n#endif\n#endif\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)\t\tstatic type\n/* a function used only in its module: */\n#define LOCAL(type)\t\tstatic type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)\t\ttype\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)\t\textern type\n\n\n/* This macro is used to declare a \"method\", that is, a function pointer.\n * We want to supply prototype parameters if the compiler can cope.\n * Note that the arglist parameter must be parenthesized!\n * Again, you can customize this if you need special linkage keywords.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n#else\n#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n#endif\n\n\n/* The noreturn type identifier is used to declare functions\n * which cannot return.\n * Compilers can thus create more optimized code and perform\n * better checks for warnings and errors.\n * Static analyzer tools can make improved inferences about\n * execution paths and are prevented from giving false alerts.\n *\n * Unfortunately, the proposed specifications of corresponding\n * extensions in the Dec 2011 ISO C standard revision (C11),\n * GCC, MSVC, etc. are not viable.\n * Thus we introduce a user defined type to declare noreturn\n * functions at least for clarity.  A proper compiler would\n * have a suitable noreturn type to match in place of void.\n */\n\n#ifndef HAVE_NORETURN_T\ntypedef void noreturn_t;\n#endif\n\n\n/* Here is the pseudo-keyword for declaring pointers that must be \"far\"\n * on 80x86 machines.  Most of the specialized coding for 80x86 is handled\n * by just saying \"FAR *\" where such a pointer is needed.  In a few places\n * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.\n */\n\n#ifndef FAR\n#ifdef NEED_FAR_POINTERS\n#define FAR  far\n#else\n#define FAR\n#endif\n#endif\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifdef HAVE_BOOLEAN\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#else\ntypedef enum { FALSE = 0, TRUE = 1 } boolean;\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED\t/* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED\t/* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED\t/* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define DCT_SCALING_SUPPORTED\t    /* Input rescaling via DCT? (Requires DCT_ISLOW)*/\n#define ENTROPY_OPT_SUPPORTED\t    /* Optimization of entropy coding parms? */\n/* Note: if you selected 12-bit data precision, it is dangerous to turn off\n * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit\n * precision, so jchuff.c normally uses entropy optimization to compute\n * usable tables for higher precision.  If you don't want to do optimization,\n * you'll have to supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define IDCT_SCALING_SUPPORTED\t    /* Output rescaling via IDCT? */\n#define SAVE_MARKERS_SUPPORTED\t    /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED\t    /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED\t    /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * Ordering of RGB data in scanlines passed to or from the application.\n * If your application wants to deal with data in the order B,G,R, just\n * change these macros.  You can also deal with formats such as R,G,B,X\n * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing\n * the offsets will also change the order in which colormap data is organized.\n * RESTRICTIONS:\n * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.\n * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE\n *    is not 3 (they don't understand about dummy color components!).  So you\n *    can't use color quantization if you change that value.\n */\n\n#define RGB_RED\t\t0\t/* Offset of Red in an RGB scanline element */\n#define RGB_GREEN\t1\t/* Offset of Green */\n#define RGB_BLUE\t2\t/* Offset of Blue */\n#define RGB_PIXELSIZE\t3\t/* JSAMPLEs per RGB scanline element */\n\n\n/* Definitions for speed-related optimizations. */\n\n\n/* If your compiler supports inline functions, define INLINE\n * as the inline keyword; otherwise define it as empty.\n */\n\n#ifndef INLINE\n#ifdef __GNUC__\t\t\t/* for instance, GNU C knows about inline */\n#define INLINE __inline__\n#endif\n#ifndef INLINE\n#define INLINE\t\t\t/* default is to define it as empty */\n#endif\n#endif\n\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#define MULTIPLIER  int\t\t/* type for fastest integer multiply */\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n * Typically, float is faster in ANSI C compilers, while double is faster in\n * pre-ANSI compilers (because they insist on converting to double anyway).\n * The code below therefore chooses float if we have ANSI-style prototypes.\n */\n\n#ifndef FAST_FLOAT\n#ifdef HAVE_PROTOTYPES\n#define FAST_FLOAT  float\n#else\n#define FAST_FLOAT  double\n#endif\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/mac/jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED\t/* in case jinclude.h already did */\n#include \"jconfig.h\"\t\t/* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"\t\t/* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n/* Version IDs for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 90\".\n */\n\n#define JPEG_LIB_VERSION        90\t/* Compatibility version 9.0 */\n#define JPEG_LIB_VERSION_MAJOR  9\n#define JPEG_LIB_VERSION_MINOR  0\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard, so don't change them\n * if you want to be compatible.\n */\n\n#define DCTSIZE\t\t    8\t/* The basic DCT block is 8x8 coefficients */\n#define DCTSIZE2\t    64\t/* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4\t/* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4\t/* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16\t/* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4\t/* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4\t/* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n * On 80x86 machines, the image arrays are too big for near pointers,\n * but the pointer arrays can fit in near memory.\n */\n\ntypedef JSAMPLE FAR *JSAMPROW;\t/* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;\t/* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE;\t/* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2];\t/* one block of coefficients */\ntypedef JBLOCK FAR *JBLOCKROW;\t/* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;\t\t/* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;\t/* a 3-D array of coefficient blocks */\n\ntypedef JCOEF FAR *JCOEFPTR;\t/* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];\t/* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];\t\t/* bits[k] = # of symbols with codes of */\n\t\t\t\t/* length k bits; bits[0] is unused */\n  UINT8 huffval[256];\t\t/* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;\t\t/* identifier for this component (0..255) */\n  int component_index;\t\t/* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;\t\t/* horizontal sampling factor (1..4) */\n  int v_samp_factor;\t\t/* vertical sampling factor (1..4) */\n  int quant_tbl_no;\t\t/* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;\t\t/* DC entropy table selector (0..3) */\n  int ac_tbl_no;\t\t/* AC entropy table selector (0..3) */\n  \n  /* Remaining fields should be treated as private by applications. */\n  \n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples,\n   * reflecting any scaling we choose to apply during the DCT step.\n   * Values from 1 to 16 are supported.\n   * Note that different components may receive different DCT scalings.\n   */\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface);\n   * DCT scaling is included, so\n   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)\n   * and similarly for height.\n   */\n  JDIMENSION downsampled_width;\t /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* This flag is used only for decompression.  In cases where some of the\n   * components will be ignored (eg grayscale output from YCbCr image),\n   * we can skip most computations for the unused components.\n   */\n  boolean component_needed;\t/* do we need the value of this component? */\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;\t\t/* number of blocks per MCU, horizontally */\n  int MCU_height;\t\t/* number of blocks per MCU, vertically */\n  int MCU_blocks;\t\t/* MCU_width * MCU_height */\n  int MCU_sample_width;\t/* MCU width in samples: MCU_width * DCT_h_scaled_size */\n  int last_col_width;\t\t/* # of non-dummy blocks across in last MCU */\n  int last_row_height;\t\t/* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL * quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void * dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;\t\t/* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;\t\t\t/* progressive JPEG spectral selection parms */\n  int Ah, Al;\t\t\t/* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;\t/* next in list, or NULL */\n  UINT8 marker;\t\t\t/* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length;\t/* # bytes of data in the file */\n  unsigned int data_length;\t/* # bytes of data saved at data[] */\n  JOCTET FAR * data;\t\t/* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\ntypedef enum {\n\tJCS_UNKNOWN,\t\t/* error/unspecified */\n\tJCS_GRAYSCALE,\t\t/* monochrome */\n\tJCS_RGB,\t\t/* red/green/blue */\n\tJCS_YCbCr,\t\t/* Y/Cb/Cr (also known as YUV) */\n\tJCS_CMYK,\t\t/* C/M/Y/K */\n\tJCS_YCCK\t\t/* Y/Cb/Cr/K */\n} J_COLOR_SPACE;\n\n/* Supported color transforms. */\n\ntypedef enum {\n\tJCT_NONE           = 0,\n\tJCT_SUBTRACT_GREEN = 1\n} J_COLOR_TRANSFORM;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n\tJDCT_ISLOW,\t\t/* slow but accurate integer algorithm */\n\tJDCT_IFAST,\t\t/* faster, less accurate integer method */\n\tJDCT_FLOAT\t\t/* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT\t\t/* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST\t\t/* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n\tJDITHER_NONE,\t\t/* no dithering */\n\tJDITHER_ORDERED,\t/* simple ordered dither */\n\tJDITHER_FS\t\t/* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr * err;\t/* Error handler module */\\\n  struct jpeg_memory_mgr * mem;\t/* Memory manager module */\\\n  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\\\n  void * client_data;\t\t/* Available for use by application */\\\n  boolean is_decompressor;\t/* So common code can tell which is which */\\\n  int global_state\t\t/* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;\t\t/* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct * j_common_ptr;\ntypedef struct jpeg_compress_struct * j_compress_ptr;\ntypedef struct jpeg_decompress_struct * j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr * dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;\t/* input image width */\n  JDIMENSION image_height;\t/* input image height */\n  int input_components;\t\t/* # of color components in input image */\n  J_COLOR_SPACE in_color_space;\t/* colorspace of input image */\n\n  double input_gamma;\t\t/* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;\t/* scaled JPEG image width */\n  JDIMENSION jpeg_height;\t/* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  int q_scale_factor[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;\t\t/* # of entries in scan_info array */\n  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;\t\t/* TRUE=caller supplies downsampled data */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;\t/* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n  int smoothing_factor;\t\t/* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;\t/* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;\t\t/* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;\t/* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;\t/* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean write_Adobe_marker;\t/* should an Adobe marker be written? */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier, writes LSE marker if nonzero */\n\n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;\t/* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;\t/* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n  \n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n  \n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n  \n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order;\t/* natural-order position array */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) */\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master * master;\n  struct jpeg_c_main_controller * main;\n  struct jpeg_c_prep_controller * prep;\n  struct jpeg_c_coef_controller * coef;\n  struct jpeg_marker_writer * marker;\n  struct jpeg_color_converter * cconvert;\n  struct jpeg_downsampler * downsample;\n  struct jpeg_forward_dct * fdct;\n  struct jpeg_entropy_encoder * entropy;\n  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr * src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;\t/* nominal image width (from SOF marker) */\n  JDIMENSION image_height;\t/* nominal image height */\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;\t\t/* image gamma wanted in output */\n\n  boolean buffered_image;\t/* TRUE=multiple output passes */\n  boolean raw_data_out;\t\t/* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;\t/* IDCT algorithm selector */\n  boolean do_fancy_upsampling;\t/* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;\t/* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;\t/* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;\t/* type of color dithering to use */\n  boolean two_pass_quantize;\t/* TRUE=use two-pass color quantization */\n  int desired_number_of_colors;\t/* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;\t/* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;\t/* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;\t/* scaled image width */\n  JDIMENSION output_height;\t/* scaled image height */\n  int out_color_components;\t/* # of color components in out_color_space */\n  int output_components;\t/* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;\t/* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;\t/* number of entries in use */\n  JSAMPARRAY colormap;\t\t/* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;\t/* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;\t/* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;\t/* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;\t/* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;\t/* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];\t/* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  boolean is_baseline;\t\t/* TRUE if Baseline SOF0 encountered */\n  boolean progressive_mode;\t/* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;\t/* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;\t/* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean saw_Adobe_marker;\t/* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;\t/* Color transform code from Adobe marker */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier derived from LSE marker, otherwise zero */\n\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE * sample_range_limit; /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n\n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) for entropy decode */\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master * master;\n  struct jpeg_d_main_controller * main;\n  struct jpeg_d_coef_controller * coef;\n  struct jpeg_d_post_controller * post;\n  struct jpeg_input_controller * inputctl;\n  struct jpeg_marker_reader * marker;\n  struct jpeg_entropy_decoder * entropy;\n  struct jpeg_inverse_dct * idct;\n  struct jpeg_upsampler * upsample;\n  struct jpeg_color_deconverter * cconvert;\n  struct jpeg_color_quantizer * cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));\n  /* Conditionally emit a trace or warning message */\n  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));\n  /* Routine that actually outputs a trace or error message */\n  JMETHOD(void, output_message, (j_common_ptr cinfo));\n  /* Format a message string for the most recent JPEG error or message */\n  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));\n#define JMSG_LENGTH_MAX  200\t/* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));\n  \n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n  \n  /* Standard state variables for error facility */\n  \n  int trace_level;\t\t/* max msg_level that will be displayed */\n  \n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;\t\t/* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const * jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const * addon_message_table; /* Non-library errors */\n  int first_addon_message;\t/* code for first string in addon table */\n  int last_addon_message;\t/* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));\n\n  long pass_counter;\t\t/* work units completed in this pass */\n  long pass_limit;\t\t/* total number of work units in this pass */\n  int completed_passes;\t\t/* passes completed so far */\n  int total_passes;\t\t/* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n\n  JMETHOD(void, init_destination, (j_compress_ptr cinfo));\n  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));\n  JMETHOD(void, term_destination, (j_compress_ptr cinfo));\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET * next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in buffer */\n\n  JMETHOD(void, init_source, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));\n  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));\n  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));\n  JMETHOD(void, term_source, (j_decompress_ptr cinfo));\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT\t0\t/* lasts until master record is destroyed */\n#define JPOOL_IMAGE\t1\t/* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS\t2\n\ntypedef struct jvirt_sarray_control * jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control * jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,\n\t\t\t\tsize_t sizeofobject));\n  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     size_t sizeofobject));\n  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     JDIMENSION samplesperrow,\n\t\t\t\t     JDIMENSION numrows));\n  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t      JDIMENSION blocksperrow,\n\t\t\t\t      JDIMENSION numrows));\n  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION samplesperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION blocksperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));\n  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t   jvirt_sarray_ptr ptr,\n\t\t\t\t\t   JDIMENSION start_row,\n\t\t\t\t\t   JDIMENSION num_rows,\n\t\t\t\t\t   boolean writable));\n  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t    jvirt_barray_ptr ptr,\n\t\t\t\t\t    JDIMENSION start_row,\n\t\t\t\t\t    JDIMENSION num_rows,\n\t\t\t\t\t    boolean writable));\n  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));\n  JMETHOD(void, self_destruct, (j_common_ptr cinfo));\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));\n\n\n/* Declarations for routines called by application.\n * The JPP macro hides prototype parameters from compilers that can't cope.\n * Note JPP requires double parentheses.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JPP(arglist)\targlist\n#else\n#define JPP(arglist)\t()\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers.\n * We shorten external names to be unique in the first six letters, which\n * is good enough for all known systems.\n * (If your compiler itself needs names to be unique in less than 15 \n * characters, you are out of luck.  Get a better compiler.)\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_error\t\tjStdError\n#define jpeg_CreateCompress\tjCreaCompress\n#define jpeg_CreateDecompress\tjCreaDecompress\n#define jpeg_destroy_compress\tjDestCompress\n#define jpeg_destroy_decompress\tjDestDecompress\n#define jpeg_stdio_dest\t\tjStdDest\n#define jpeg_stdio_src\t\tjStdSrc\n#define jpeg_mem_dest\t\tjMemDest\n#define jpeg_mem_src\t\tjMemSrc\n#define jpeg_set_defaults\tjSetDefaults\n#define jpeg_set_colorspace\tjSetColorspace\n#define jpeg_default_colorspace\tjDefColorspace\n#define jpeg_set_quality\tjSetQuality\n#define jpeg_set_linear_quality\tjSetLQuality\n#define jpeg_default_qtables\tjDefQTables\n#define jpeg_add_quant_table\tjAddQuantTable\n#define jpeg_quality_scaling\tjQualityScaling\n#define jpeg_simple_progression\tjSimProgress\n#define jpeg_suppress_tables\tjSuppressTables\n#define jpeg_alloc_quant_table\tjAlcQTable\n#define jpeg_alloc_huff_table\tjAlcHTable\n#define jpeg_start_compress\tjStrtCompress\n#define jpeg_write_scanlines\tjWrtScanlines\n#define jpeg_finish_compress\tjFinCompress\n#define jpeg_calc_jpeg_dimensions\tjCjpegDimensions\n#define jpeg_write_raw_data\tjWrtRawData\n#define jpeg_write_marker\tjWrtMarker\n#define jpeg_write_m_header\tjWrtMHeader\n#define jpeg_write_m_byte\tjWrtMByte\n#define jpeg_write_tables\tjWrtTables\n#define jpeg_read_header\tjReadHeader\n#define jpeg_start_decompress\tjStrtDecompress\n#define jpeg_read_scanlines\tjReadScanlines\n#define jpeg_finish_decompress\tjFinDecompress\n#define jpeg_read_raw_data\tjReadRawData\n#define jpeg_has_multiple_scans\tjHasMultScn\n#define jpeg_start_output\tjStrtOutput\n#define jpeg_finish_output\tjFinOutput\n#define jpeg_input_complete\tjInComplete\n#define jpeg_new_colormap\tjNewCMap\n#define jpeg_consume_input\tjConsumeInput\n#define jpeg_core_output_dimensions\tjCoreDimensions\n#define jpeg_calc_output_dimensions\tjCalcDimensions\n#define jpeg_save_markers\tjSaveMarkers\n#define jpeg_set_marker_processor\tjSetMarker\n#define jpeg_read_coefficients\tjReadCoefs\n#define jpeg_write_coefficients\tjWrtCoefs\n#define jpeg_copy_critical_parameters\tjCopyCrit\n#define jpeg_abort_compress\tjAbrtCompress\n#define jpeg_abort_decompress\tjAbrtDecompress\n#define jpeg_abort\t\tjAbort\n#define jpeg_destroy\t\tjDestroy\n#define jpeg_resync_to_restart\tjResyncRestart\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error\n\tJPP((struct jpeg_error_mgr * err));\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t(size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t  (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,\n\t\t\t\t      int version, size_t structsize));\nEXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,\n\t\t\t\t\tint version, size_t structsize));\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));\nEXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,\n\t\t\t       unsigned char ** outbuffer,\n\t\t\t       unsigned long * outsize));\nEXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,\n\t\t\t      unsigned char * inbuffer,\n\t\t\t      unsigned long insize));\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,\n\t\t\t\t      J_COLOR_SPACE colorspace));\nEXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,\n\t\t\t\t   boolean force_baseline));\nEXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  int scale_factor,\n\t\t\t\t\t  boolean force_baseline));\nEXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean force_baseline));\nEXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,\n\t\t\t\t       const unsigned int *basic_table,\n\t\t\t\t       int scale_factor,\n\t\t\t\t       boolean force_baseline));\nEXTERN(int) jpeg_quality_scaling JPP((int quality));\nEXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean suppress));\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,\n\t\t\t\t      boolean write_all_tables));\nEXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JSAMPARRAY scanlines,\n\t\t\t\t\t     JDIMENSION num_lines));\nEXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));\n\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JSAMPIMAGE data,\n\t\t\t\t\t    JDIMENSION num_lines));\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker\n\tJPP((j_compress_ptr cinfo, int marker,\n\t     const JOCTET * dataptr, unsigned int datalen));\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header\n\tJPP((j_compress_ptr cinfo, int marker, unsigned int datalen));\nEXTERN(void) jpeg_write_m_byte\n\tJPP((j_compress_ptr cinfo, int val));\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,\n\t\t\t\t  boolean require_image));\n/* Return value is one of: */\n#define JPEG_SUSPENDED\t\t0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK\t\t1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY\t2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JSAMPARRAY scanlines,\n\t\t\t\t\t    JDIMENSION max_lines));\nEXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t   JSAMPIMAGE data,\n\t\t\t\t\t   JDIMENSION max_lines));\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,\n\t\t\t\t       int scan_number));\nEXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));\nEXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED\t0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS\t1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI\t2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED\t3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED\t4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\nEXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     unsigned int length_limit));\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     jpeg_marker_parser_method routine));\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  jvirt_barray_ptr * coef_arrays));\nEXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,\n\t\t\t\t\t\tj_compress_ptr dstinfo));\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    int desired));\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0\t0xD0\t/* RST0 marker code */\n#define JPEG_EOI\t0xD9\t/* EOI marker code */\n#define JPEG_APP0\t0xE0\t/* APP0 marker code */\n#define JPEG_COM\t0xFE\t/* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS\t\t/* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"\t\t/* fetch private declarations */\n#include \"jerror.h\"\t\t/* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/win32/jconfig.h",
    "content": "/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* we presume a 32-bit flat memory model */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not enum, per Windows custom */\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\t/* optional */\n#define USE_SETMODE\t\t/* Microsoft has setmode() */\n#undef NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/win32/jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8\t/* use 8 or 12 */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10\t/* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE\t255\n#define CENTERJSAMPLE\t128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t4095\n#define CENTERJSAMPLE\t2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef CHAR_IS_UNSIGNED\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* CHAR_IS_UNSIGNED */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char UINT8;\n#else /* not CHAR_IS_UNSIGNED */\ntypedef short UINT8;\n#endif /* CHAR_IS_UNSIGNED */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT32 */\n#ifndef _BASETSD_H_\t\t/* Microsoft defines it in basetsd.h */\n#ifndef _BASETSD_H\t\t/* MinGW is slightly different */\n#ifndef QGLOBAL_H\t\t/* Qt defines it in qglobal.h */\ntypedef long INT32;\n#endif\n#endif\n#endif\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)\t\tstatic type\n/* a function used only in its module: */\n#define LOCAL(type)\t\tstatic type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)\t\ttype\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)\t\textern type\n\n\n/* This macro is used to declare a \"method\", that is, a function pointer.\n * We want to supply prototype parameters if the compiler can cope.\n * Note that the arglist parameter must be parenthesized!\n * Again, you can customize this if you need special linkage keywords.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n#else\n#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n#endif\n\n\n/* The noreturn type identifier is used to declare functions\n * which cannot return.\n * Compilers can thus create more optimized code and perform\n * better checks for warnings and errors.\n * Static analyzer tools can make improved inferences about\n * execution paths and are prevented from giving false alerts.\n *\n * Unfortunately, the proposed specifications of corresponding\n * extensions in the Dec 2011 ISO C standard revision (C11),\n * GCC, MSVC, etc. are not viable.\n * Thus we introduce a user defined type to declare noreturn\n * functions at least for clarity.  A proper compiler would\n * have a suitable noreturn type to match in place of void.\n */\n\n#ifndef HAVE_NORETURN_T\ntypedef void noreturn_t;\n#endif\n\n\n/* Here is the pseudo-keyword for declaring pointers that must be \"far\"\n * on 80x86 machines.  Most of the specialized coding for 80x86 is handled\n * by just saying \"FAR *\" where such a pointer is needed.  In a few places\n * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.\n */\n\n#ifndef FAR\n#ifdef NEED_FAR_POINTERS\n#define FAR  far\n#else\n#define FAR\n#endif\n#endif\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifdef HAVE_BOOLEAN\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n#else\ntypedef enum { FALSE = 0, TRUE = 1 } boolean;\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED\t/* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED\t/* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED\t/* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define DCT_SCALING_SUPPORTED\t    /* Input rescaling via DCT? (Requires DCT_ISLOW)*/\n#define ENTROPY_OPT_SUPPORTED\t    /* Optimization of entropy coding parms? */\n/* Note: if you selected 12-bit data precision, it is dangerous to turn off\n * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit\n * precision, so jchuff.c normally uses entropy optimization to compute\n * usable tables for higher precision.  If you don't want to do optimization,\n * you'll have to supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_ARITH_CODING_SUPPORTED    /* Arithmetic coding back end? */\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define IDCT_SCALING_SUPPORTED\t    /* Output rescaling via IDCT? */\n#define SAVE_MARKERS_SUPPORTED\t    /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED\t    /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED\t    /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * Ordering of RGB data in scanlines passed to or from the application.\n * If your application wants to deal with data in the order B,G,R, just\n * change these macros.  You can also deal with formats such as R,G,B,X\n * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing\n * the offsets will also change the order in which colormap data is organized.\n * RESTRICTIONS:\n * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.\n * 2. The color quantizer modules will not behave desirably if RGB_PIXELSIZE\n *    is not 3 (they don't understand about dummy color components!).  So you\n *    can't use color quantization if you change that value.\n */\n\n#define RGB_RED\t\t0\t/* Offset of Red in an RGB scanline element */\n#define RGB_GREEN\t1\t/* Offset of Green */\n#define RGB_BLUE\t2\t/* Offset of Blue */\n#define RGB_PIXELSIZE\t3\t/* JSAMPLEs per RGB scanline element */\n\n\n/* Definitions for speed-related optimizations. */\n\n\n/* If your compiler supports inline functions, define INLINE\n * as the inline keyword; otherwise define it as empty.\n */\n\n#ifndef INLINE\n#ifdef __GNUC__\t\t\t/* for instance, GNU C knows about inline */\n#define INLINE __inline__\n#endif\n#ifndef INLINE\n#define INLINE\t\t\t/* default is to define it as empty */\n#endif\n#endif\n\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#define MULTIPLIER  int\t\t/* type for fastest integer multiply */\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n * Typically, float is faster in ANSI C compilers, while double is faster in\n * pre-ANSI compilers (because they insist on converting to double anyway).\n * The code below therefore chooses float if we have ANSI-style prototypes.\n */\n\n#ifndef FAST_FLOAT\n#ifdef HAVE_PROTOTYPES\n#define FAST_FLOAT  float\n#else\n#define FAST_FLOAT  double\n#endif\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "cocos2d/external/jpeg/include/win32/jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2012 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED\t/* in case jinclude.h already did */\n#include \"jconfig.h\"\t\t/* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"\t\t/* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n/* Version IDs for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 90\".\n */\n\n#define JPEG_LIB_VERSION        90\t/* Compatibility version 9.0 */\n#define JPEG_LIB_VERSION_MAJOR  9\n#define JPEG_LIB_VERSION_MINOR  0\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard, so don't change them\n * if you want to be compatible.\n */\n\n#define DCTSIZE\t\t    8\t/* The basic DCT block is 8x8 coefficients */\n#define DCTSIZE2\t    64\t/* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4\t/* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4\t/* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16\t/* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4\t/* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4\t/* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n * On 80x86 machines, the image arrays are too big for near pointers,\n * but the pointer arrays can fit in near memory.\n */\n\ntypedef JSAMPLE FAR *JSAMPROW;\t/* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;\t/* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE;\t/* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2];\t/* one block of coefficients */\ntypedef JBLOCK FAR *JBLOCKROW;\t/* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;\t\t/* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;\t/* a 3-D array of coefficient blocks */\n\ntypedef JCOEF FAR *JCOEFPTR;\t/* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];\t/* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];\t\t/* bits[k] = # of symbols with codes of */\n\t\t\t\t/* length k bits; bits[0] is unused */\n  UINT8 huffval[256];\t\t/* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;\t\t/* identifier for this component (0..255) */\n  int component_index;\t\t/* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;\t\t/* horizontal sampling factor (1..4) */\n  int v_samp_factor;\t\t/* vertical sampling factor (1..4) */\n  int quant_tbl_no;\t\t/* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;\t\t/* DC entropy table selector (0..3) */\n  int ac_tbl_no;\t\t/* AC entropy table selector (0..3) */\n  \n  /* Remaining fields should be treated as private by applications. */\n  \n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples,\n   * reflecting any scaling we choose to apply during the DCT step.\n   * Values from 1 to 16 are supported.\n   * Note that different components may receive different DCT scalings.\n   */\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface);\n   * DCT scaling is included, so\n   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)\n   * and similarly for height.\n   */\n  JDIMENSION downsampled_width;\t /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* This flag is used only for decompression.  In cases where some of the\n   * components will be ignored (eg grayscale output from YCbCr image),\n   * we can skip most computations for the unused components.\n   */\n  boolean component_needed;\t/* do we need the value of this component? */\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;\t\t/* number of blocks per MCU, horizontally */\n  int MCU_height;\t\t/* number of blocks per MCU, vertically */\n  int MCU_blocks;\t\t/* MCU_width * MCU_height */\n  int MCU_sample_width;\t/* MCU width in samples: MCU_width * DCT_h_scaled_size */\n  int last_col_width;\t\t/* # of non-dummy blocks across in last MCU */\n  int last_row_height;\t\t/* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL * quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void * dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;\t\t/* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;\t\t\t/* progressive JPEG spectral selection parms */\n  int Ah, Al;\t\t\t/* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;\t/* next in list, or NULL */\n  UINT8 marker;\t\t\t/* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length;\t/* # bytes of data in the file */\n  unsigned int data_length;\t/* # bytes of data saved at data[] */\n  JOCTET FAR * data;\t\t/* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\ntypedef enum {\n\tJCS_UNKNOWN,\t\t/* error/unspecified */\n\tJCS_GRAYSCALE,\t\t/* monochrome */\n\tJCS_RGB,\t\t/* red/green/blue */\n\tJCS_YCbCr,\t\t/* Y/Cb/Cr (also known as YUV) */\n\tJCS_CMYK,\t\t/* C/M/Y/K */\n\tJCS_YCCK\t\t/* Y/Cb/Cr/K */\n} J_COLOR_SPACE;\n\n/* Supported color transforms. */\n\ntypedef enum {\n\tJCT_NONE           = 0,\n\tJCT_SUBTRACT_GREEN = 1\n} J_COLOR_TRANSFORM;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n\tJDCT_ISLOW,\t\t/* slow but accurate integer algorithm */\n\tJDCT_IFAST,\t\t/* faster, less accurate integer method */\n\tJDCT_FLOAT\t\t/* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT\t\t/* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST\t\t/* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n\tJDITHER_NONE,\t\t/* no dithering */\n\tJDITHER_ORDERED,\t/* simple ordered dither */\n\tJDITHER_FS\t\t/* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr * err;\t/* Error handler module */\\\n  struct jpeg_memory_mgr * mem;\t/* Memory manager module */\\\n  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\\\n  void * client_data;\t\t/* Available for use by application */\\\n  boolean is_decompressor;\t/* So common code can tell which is which */\\\n  int global_state\t\t/* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;\t\t/* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct * j_common_ptr;\ntypedef struct jpeg_compress_struct * j_compress_ptr;\ntypedef struct jpeg_decompress_struct * j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr * dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;\t/* input image width */\n  JDIMENSION image_height;\t/* input image height */\n  int input_components;\t\t/* # of color components in input image */\n  J_COLOR_SPACE in_color_space;\t/* colorspace of input image */\n\n  double input_gamma;\t\t/* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;\t/* scaled JPEG image width */\n  JDIMENSION jpeg_height;\t/* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  int q_scale_factor[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;\t\t/* # of entries in scan_info array */\n  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;\t\t/* TRUE=caller supplies downsampled data */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;\t/* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n  int smoothing_factor;\t\t/* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;\t/* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;\t\t/* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;\t/* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;\t/* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean write_Adobe_marker;\t/* should an Adobe marker be written? */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier, writes LSE marker if nonzero */\n\n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;\t/* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;\t/* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n  \n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n  \n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n  \n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order;\t/* natural-order position array */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) */\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master * master;\n  struct jpeg_c_main_controller * main;\n  struct jpeg_c_prep_controller * prep;\n  struct jpeg_c_coef_controller * coef;\n  struct jpeg_marker_writer * marker;\n  struct jpeg_color_converter * cconvert;\n  struct jpeg_downsampler * downsample;\n  struct jpeg_forward_dct * fdct;\n  struct jpeg_entropy_encoder * entropy;\n  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr * src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;\t/* nominal image width (from SOF marker) */\n  JDIMENSION image_height;\t/* nominal image height */\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;\t\t/* image gamma wanted in output */\n\n  boolean buffered_image;\t/* TRUE=multiple output passes */\n  boolean raw_data_out;\t\t/* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;\t/* IDCT algorithm selector */\n  boolean do_fancy_upsampling;\t/* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;\t/* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;\t/* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;\t/* type of color dithering to use */\n  boolean two_pass_quantize;\t/* TRUE=use two-pass color quantization */\n  int desired_number_of_colors;\t/* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;\t/* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;\t/* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;\t/* scaled image width */\n  JDIMENSION output_height;\t/* scaled image height */\n  int out_color_components;\t/* # of color components in out_color_space */\n  int output_components;\t/* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;\t/* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;\t/* number of entries in use */\n  JSAMPARRAY colormap;\t\t/* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;\t/* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;\t/* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;\t/* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;\t/* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;\t/* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];\t/* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  boolean is_baseline;\t\t/* TRUE if Baseline SOF0 encountered */\n  boolean progressive_mode;\t/* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;\t/* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;\t/* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean saw_Adobe_marker;\t/* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;\t/* Color transform code from Adobe marker */\n\n  J_COLOR_TRANSFORM color_transform;\n  /* Color transform identifier derived from LSE marker, otherwise zero */\n\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE * sample_range_limit; /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n\n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) for entropy decode */\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master * master;\n  struct jpeg_d_main_controller * main;\n  struct jpeg_d_coef_controller * coef;\n  struct jpeg_d_post_controller * post;\n  struct jpeg_input_controller * inputctl;\n  struct jpeg_marker_reader * marker;\n  struct jpeg_entropy_decoder * entropy;\n  struct jpeg_inverse_dct * idct;\n  struct jpeg_upsampler * upsample;\n  struct jpeg_color_deconverter * cconvert;\n  struct jpeg_color_quantizer * cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));\n  /* Conditionally emit a trace or warning message */\n  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));\n  /* Routine that actually outputs a trace or error message */\n  JMETHOD(void, output_message, (j_common_ptr cinfo));\n  /* Format a message string for the most recent JPEG error or message */\n  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));\n#define JMSG_LENGTH_MAX  200\t/* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));\n  \n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n  \n  /* Standard state variables for error facility */\n  \n  int trace_level;\t\t/* max msg_level that will be displayed */\n  \n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;\t\t/* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const * jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const * addon_message_table; /* Non-library errors */\n  int first_addon_message;\t/* code for first string in addon table */\n  int last_addon_message;\t/* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));\n\n  long pass_counter;\t\t/* work units completed in this pass */\n  long pass_limit;\t\t/* total number of work units in this pass */\n  int completed_passes;\t\t/* passes completed so far */\n  int total_passes;\t\t/* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n\n  JMETHOD(void, init_destination, (j_compress_ptr cinfo));\n  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));\n  JMETHOD(void, term_destination, (j_compress_ptr cinfo));\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET * next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in buffer */\n\n  JMETHOD(void, init_source, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));\n  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));\n  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));\n  JMETHOD(void, term_source, (j_decompress_ptr cinfo));\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT\t0\t/* lasts until master record is destroyed */\n#define JPOOL_IMAGE\t1\t/* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS\t2\n\ntypedef struct jvirt_sarray_control * jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control * jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,\n\t\t\t\tsize_t sizeofobject));\n  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     size_t sizeofobject));\n  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     JDIMENSION samplesperrow,\n\t\t\t\t     JDIMENSION numrows));\n  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t      JDIMENSION blocksperrow,\n\t\t\t\t      JDIMENSION numrows));\n  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION samplesperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION blocksperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));\n  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t   jvirt_sarray_ptr ptr,\n\t\t\t\t\t   JDIMENSION start_row,\n\t\t\t\t\t   JDIMENSION num_rows,\n\t\t\t\t\t   boolean writable));\n  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t    jvirt_barray_ptr ptr,\n\t\t\t\t\t    JDIMENSION start_row,\n\t\t\t\t\t    JDIMENSION num_rows,\n\t\t\t\t\t    boolean writable));\n  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));\n  JMETHOD(void, self_destruct, (j_common_ptr cinfo));\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));\n\n\n/* Declarations for routines called by application.\n * The JPP macro hides prototype parameters from compilers that can't cope.\n * Note JPP requires double parentheses.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JPP(arglist)\targlist\n#else\n#define JPP(arglist)\t()\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers.\n * We shorten external names to be unique in the first six letters, which\n * is good enough for all known systems.\n * (If your compiler itself needs names to be unique in less than 15 \n * characters, you are out of luck.  Get a better compiler.)\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_error\t\tjStdError\n#define jpeg_CreateCompress\tjCreaCompress\n#define jpeg_CreateDecompress\tjCreaDecompress\n#define jpeg_destroy_compress\tjDestCompress\n#define jpeg_destroy_decompress\tjDestDecompress\n#define jpeg_stdio_dest\t\tjStdDest\n#define jpeg_stdio_src\t\tjStdSrc\n#define jpeg_mem_dest\t\tjMemDest\n#define jpeg_mem_src\t\tjMemSrc\n#define jpeg_set_defaults\tjSetDefaults\n#define jpeg_set_colorspace\tjSetColorspace\n#define jpeg_default_colorspace\tjDefColorspace\n#define jpeg_set_quality\tjSetQuality\n#define jpeg_set_linear_quality\tjSetLQuality\n#define jpeg_default_qtables\tjDefQTables\n#define jpeg_add_quant_table\tjAddQuantTable\n#define jpeg_quality_scaling\tjQualityScaling\n#define jpeg_simple_progression\tjSimProgress\n#define jpeg_suppress_tables\tjSuppressTables\n#define jpeg_alloc_quant_table\tjAlcQTable\n#define jpeg_alloc_huff_table\tjAlcHTable\n#define jpeg_start_compress\tjStrtCompress\n#define jpeg_write_scanlines\tjWrtScanlines\n#define jpeg_finish_compress\tjFinCompress\n#define jpeg_calc_jpeg_dimensions\tjCjpegDimensions\n#define jpeg_write_raw_data\tjWrtRawData\n#define jpeg_write_marker\tjWrtMarker\n#define jpeg_write_m_header\tjWrtMHeader\n#define jpeg_write_m_byte\tjWrtMByte\n#define jpeg_write_tables\tjWrtTables\n#define jpeg_read_header\tjReadHeader\n#define jpeg_start_decompress\tjStrtDecompress\n#define jpeg_read_scanlines\tjReadScanlines\n#define jpeg_finish_decompress\tjFinDecompress\n#define jpeg_read_raw_data\tjReadRawData\n#define jpeg_has_multiple_scans\tjHasMultScn\n#define jpeg_start_output\tjStrtOutput\n#define jpeg_finish_output\tjFinOutput\n#define jpeg_input_complete\tjInComplete\n#define jpeg_new_colormap\tjNewCMap\n#define jpeg_consume_input\tjConsumeInput\n#define jpeg_core_output_dimensions\tjCoreDimensions\n#define jpeg_calc_output_dimensions\tjCalcDimensions\n#define jpeg_save_markers\tjSaveMarkers\n#define jpeg_set_marker_processor\tjSetMarker\n#define jpeg_read_coefficients\tjReadCoefs\n#define jpeg_write_coefficients\tjWrtCoefs\n#define jpeg_copy_critical_parameters\tjCopyCrit\n#define jpeg_abort_compress\tjAbrtCompress\n#define jpeg_abort_decompress\tjAbrtDecompress\n#define jpeg_abort\t\tjAbort\n#define jpeg_destroy\t\tjDestroy\n#define jpeg_resync_to_restart\tjResyncRestart\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error\n\tJPP((struct jpeg_error_mgr * err));\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t(size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t  (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,\n\t\t\t\t      int version, size_t structsize));\nEXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,\n\t\t\t\t\tint version, size_t structsize));\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));\nEXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,\n\t\t\t       unsigned char ** outbuffer,\n\t\t\t       unsigned long * outsize));\nEXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,\n\t\t\t      unsigned char * inbuffer,\n\t\t\t      unsigned long insize));\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,\n\t\t\t\t      J_COLOR_SPACE colorspace));\nEXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,\n\t\t\t\t   boolean force_baseline));\nEXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  int scale_factor,\n\t\t\t\t\t  boolean force_baseline));\nEXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean force_baseline));\nEXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,\n\t\t\t\t       const unsigned int *basic_table,\n\t\t\t\t       int scale_factor,\n\t\t\t\t       boolean force_baseline));\nEXTERN(int) jpeg_quality_scaling JPP((int quality));\nEXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean suppress));\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,\n\t\t\t\t      boolean write_all_tables));\nEXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JSAMPARRAY scanlines,\n\t\t\t\t\t     JDIMENSION num_lines));\nEXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));\n\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JSAMPIMAGE data,\n\t\t\t\t\t    JDIMENSION num_lines));\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker\n\tJPP((j_compress_ptr cinfo, int marker,\n\t     const JOCTET * dataptr, unsigned int datalen));\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header\n\tJPP((j_compress_ptr cinfo, int marker, unsigned int datalen));\nEXTERN(void) jpeg_write_m_byte\n\tJPP((j_compress_ptr cinfo, int val));\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,\n\t\t\t\t  boolean require_image));\n/* Return value is one of: */\n#define JPEG_SUSPENDED\t\t0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK\t\t1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY\t2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JSAMPARRAY scanlines,\n\t\t\t\t\t    JDIMENSION max_lines));\nEXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t   JSAMPIMAGE data,\n\t\t\t\t\t   JDIMENSION max_lines));\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,\n\t\t\t\t       int scan_number));\nEXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));\nEXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED\t0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS\t1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI\t2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED\t3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED\t4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\nEXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     unsigned int length_limit));\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     jpeg_marker_parser_method routine));\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  jvirt_barray_ptr * coef_arrays));\nEXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,\n\t\t\t\t\t\tj_compress_ptr dstinfo));\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    int desired));\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0\t0xD0\t/* RST0 marker code */\n#define JPEG_EOI\t0xD9\t/* EOI marker code */\n#define JPEG_APP0\t0xE0\t/* APP0 marker code */\n#define JPEG_COM\t0xFE\t/* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS\t\t/* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"\t\t/* fetch private declarations */\n#include \"jerror.h\"\t\t/* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "cocos2d/external/jpeg/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE := cocos_jpeg_static\nLOCAL_MODULE_FILENAME := jpeg\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libjpeg.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/json/document.h",
    "content": "#ifndef RAPIDJSON_DOCUMENT_H_\n#define RAPIDJSON_DOCUMENT_H_\n\n#include \"reader.h\"\n#include \"internal/strfunc.h\"\n#include <new>\t\t// placement new\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4127) // conditional expression is constant\n#endif\n\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericValue\n\n//! Represents a JSON value. Use Value for UTF8 encoding and default allocator.\n/*!\n\tA JSON value can be one of 7 types. This class is a variant type supporting\n\tthese types.\n\n\tUse the Value if UTF8 and default allocator\n\n\t\\tparam Encoding\tEncoding of the value. (Even non-string values need to have the same encoding in a document)\n\t\\tparam Allocator\tAllocator type for allocating memory of object, array and string.\n*/\n#pragma pack (push, 4)\ntemplate <typename Encoding, typename Allocator = MemoryPoolAllocator<> > \nclass GenericValue {\npublic:\n\t//! Name-value pair in an object.\n\tstruct Member { \n\t\tGenericValue<Encoding, Allocator> name;\t\t//!< name of member (must be a string)\n\t\tGenericValue<Encoding, Allocator> value;\t//!< value of member.\n\t};\n\n\ttypedef Encoding EncodingType;\t\t\t\t\t//!< Encoding type from template parameter.\n\ttypedef Allocator AllocatorType;\t\t\t\t//!< Allocator type from template parameter.\n\ttypedef typename Encoding::Ch Ch;\t\t\t\t//!< Character type derived from Encoding.\n\ttypedef Member* MemberIterator;\t\t\t\t\t//!< Member iterator for iterating in object.\n\ttypedef const Member* ConstMemberIterator;\t\t//!< Constant member iterator for iterating in object.\n\ttypedef GenericValue* ValueIterator;\t\t\t//!< Value iterator for iterating in array.\n\ttypedef const GenericValue* ConstValueIterator;\t//!< Constant value iterator for iterating in array.\n\n\t//!@name Constructors and destructor.\n\t//@{\n\n\t//! Default constructor creates a null value.\n\tGenericValue() : flags_(kNullFlag) {}\n\n\t//! Copy constructor is not permitted.\nprivate:\n\tGenericValue(const GenericValue& rhs);\n\npublic:\n\n\t//! Constructor with JSON value type.\n\t/*! This creates a Value of specified type with default content.\n\t\t\\param type\tType of the value.\n\t\t\\note Default content for number is zero.\n\t*/\n\tGenericValue(Type type) {\n\t\tstatic const unsigned defaultFlags[7] = {\n\t\t\tkNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kConstStringFlag,\n\t\t\tkNumberFlag | kIntFlag | kUintFlag | kInt64Flag | kUint64Flag | kDoubleFlag\n\t\t};\n\t\tRAPIDJSON_ASSERT(type <= kNumberType);\n\t\tflags_ = defaultFlags[type];\n\t\tmemset(&data_, 0, sizeof(data_));\n\t}\n\n\t//! Constructor for boolean value.\n\tGenericValue(bool b) : flags_(b ? kTrueFlag : kFalseFlag) {}\n\n\t//! Constructor for int value.\n\tGenericValue(int i) : flags_(kNumberIntFlag) { \n\t\tdata_.n.i64 = i;\n\t\tif (i >= 0)\n\t\t\tflags_ |= kUintFlag | kUint64Flag;\n\t}\n\n\t//! Constructor for unsigned value.\n\tGenericValue(unsigned u) : flags_(kNumberUintFlag) {\n\t\tdata_.n.u64 = u; \n\t\tif (!(u & 0x80000000))\n\t\t\tflags_ |= kIntFlag | kInt64Flag;\n\t}\n\n\t//! Constructor for int64_t value.\n\tGenericValue(int64_t i64) : flags_(kNumberInt64Flag) {\n\t\tdata_.n.i64 = i64;\n\t\tif (i64 >= 0) {\n\t\t\tflags_ |= kNumberUint64Flag;\n\t\t\tif (!(i64 & 0xFFFFFFFF00000000LL))\n\t\t\t\tflags_ |= kUintFlag;\n\t\t\tif (!(i64 & 0xFFFFFFFF80000000LL))\n\t\t\t\tflags_ |= kIntFlag;\n\t\t}\n\t\telse if (i64 >= -2147483648LL)\n\t\t\tflags_ |= kIntFlag;\n\t}\n\n\t//! Constructor for uint64_t value.\n\tGenericValue(uint64_t u64) : flags_(kNumberUint64Flag) {\n\t\tdata_.n.u64 = u64;\n\t\tif (!(u64 & 0x8000000000000000ULL))\n\t\t\tflags_ |= kInt64Flag;\n\t\tif (!(u64 & 0xFFFFFFFF00000000ULL))\n\t\t\tflags_ |= kUintFlag;\n\t\tif (!(u64 & 0xFFFFFFFF80000000ULL))\n\t\t\tflags_ |= kIntFlag;\n\t}\n\n\t//! Constructor for double value.\n\tGenericValue(double d) : flags_(kNumberDoubleFlag) { data_.n.d = d; }\n\n\t//! Constructor for constant string (i.e. do not make a copy of string)\n\tGenericValue(const Ch* s, SizeType length) { \n\t\tRAPIDJSON_ASSERT(s != NULL);\n\t\tflags_ = kConstStringFlag;\n\t\tdata_.s.str = s;\n\t\tdata_.s.length = length;\n\t}\n\n\t//! Constructor for constant string (i.e. do not make a copy of string)\n\tGenericValue(const Ch* s) { SetStringRaw(s, internal::StrLen(s)); }\n\n\t//! Constructor for copy-string (i.e. do make a copy of string)\n\tGenericValue(const Ch* s, SizeType length, Allocator& allocator) { SetStringRaw(s, length, allocator); }\n\n\t//! Constructor for copy-string (i.e. do make a copy of string)\n\tGenericValue(const Ch*s, Allocator& allocator) { SetStringRaw(s, internal::StrLen(s), allocator); }\n\n\t//! Destructor.\n\t/*! Need to destruct elements of array, members of object, or copy-string.\n\t*/\n\t~GenericValue() {\n\t\tif (Allocator::kNeedFree) {\t// Shortcut by Allocator's trait\n\t\t\tswitch(flags_) {\n\t\t\tcase kArrayFlag:\n\t\t\t\tfor (GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v)\n\t\t\t\t\tv->~GenericValue();\n\t\t\t\tAllocator::Free(data_.a.elements);\n\t\t\t\tbreak;\n\n\t\t\tcase kObjectFlag:\n\t\t\t\tfor (Member* m = data_.o.members; m != data_.o.members + data_.o.size; ++m) {\n\t\t\t\t\tm->name.~GenericValue();\n\t\t\t\t\tm->value.~GenericValue();\n\t\t\t\t}\n\t\t\t\tAllocator::Free(data_.o.members);\n\t\t\t\tbreak;\n\n\t\t\tcase kCopyStringFlag:\n\t\t\t\tAllocator::Free(const_cast<Ch*>(data_.s.str));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t//@}\n\n\t//!@name Assignment operators\n\t//@{\n\n\t//! Assignment with move semantics.\n\t/*! \\param rhs Source of the assignment. It will become a null value after assignment.\n\t*/\n\tGenericValue& operator=(GenericValue& rhs) {\n\t\tRAPIDJSON_ASSERT(this != &rhs);\n\t\tthis->~GenericValue();\n\t\tmemcpy(this, &rhs, sizeof(GenericValue));\n\t\trhs.flags_ = kNullFlag;\n\t\treturn *this;\n\t}\n\n\t//! Assignment with primitive types.\n\t/*! \\tparam T Either Type, int, unsigned, int64_t, uint64_t, const Ch*\n\t\t\\param value The value to be assigned.\n\t*/\n\ttemplate <typename T>\n\tGenericValue& operator=(T value) {\n\t\tthis->~GenericValue();\n\t\tnew (this) GenericValue(value);\n\t\treturn *this;\n\t}\n\t//@}\n\n\t//!@name Type\n\t//@{\n\n\tType GetType()\tconst { return static_cast<Type>(flags_ & kTypeMask); }\n\tbool IsNull()\tconst { return flags_ == kNullFlag; }\n\tbool IsFalse()\tconst { return flags_ == kFalseFlag; }\n\tbool IsTrue()\tconst { return flags_ == kTrueFlag; }\n\tbool IsBool()\tconst { return (flags_ & kBoolFlag) != 0; }\n\tbool IsObject()\tconst { return flags_ == kObjectFlag; }\n\tbool IsArray()\tconst { return flags_ == kArrayFlag; }\n\tbool IsNumber() const { return (flags_ & kNumberFlag) != 0; }\n\tbool IsInt()\tconst { return (flags_ & kIntFlag) != 0; }\n\tbool IsUint()\tconst { return (flags_ & kUintFlag) != 0; }\n\tbool IsInt64()\tconst { return (flags_ & kInt64Flag) != 0; }\n\tbool IsUint64()\tconst { return (flags_ & kUint64Flag) != 0; }\n\tbool IsDouble() const { return (flags_ & kDoubleFlag) != 0; }\n\tbool IsString() const { return (flags_ & kStringFlag) != 0; }\n\n\t//@}\n\n\t//!@name Null\n\t//@{\n\n\tGenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; }\n\n\t//@}\n\n\t//!@name Bool\n\t//@{\n\n\tbool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return flags_ == kTrueFlag; }\n\tGenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; }\n\n\t//@}\n\n\t//!@name Object\n\t//@{\n\n\t//! Set this value as an empty object.\n\tGenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; }\n\n\t//! Get the value associated with the object's name.\n\tGenericValue& operator[](const Ch* name) {\n\t\tif (Member* member = FindMember(name))\n\t\t\treturn member->value;\n\t\telse {\n\t\t\tstatic GenericValue NullValue;\n\t\t\treturn NullValue;\n\t\t}\n\t}\n\tconst GenericValue& operator[](const Ch* name) const { return const_cast<GenericValue&>(*this)[name]; }\n\n\t//! Member iterators.\n\tConstMemberIterator MemberonBegin() const\t{ RAPIDJSON_ASSERT(IsObject()); return data_.o.members; }\n\tConstMemberIterator MemberonEnd()\tconst\t{ RAPIDJSON_ASSERT(IsObject()); return data_.o.members + data_.o.size; }\n\tMemberIterator MemberonBegin()\t\t\t{ RAPIDJSON_ASSERT(IsObject()); return data_.o.members; }\n\tMemberIterator MemberonEnd()\t\t\t\t{ RAPIDJSON_ASSERT(IsObject()); return data_.o.members + data_.o.size; }\n\n\t//! Check whether a member exists in the object.\n\tbool HasMember(const Ch* name) const { return FindMember(name) != 0; }\n\n\t//! Add a member (name-value pair) to the object.\n\t/*! \\param name A string value as name of member.\n\t\t\\param value Value of any type.\n\t    \\param allocator Allocator for reallocating memory.\n\t    \\return The value itself for fluent API.\n\t    \\note The ownership of name and value will be transfered to this object if success.\n\t*/\n\tGenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) {\n\t\tRAPIDJSON_ASSERT(IsObject());\n\t\tRAPIDJSON_ASSERT(name.IsString());\n\t\tObject& o = data_.o;\n\t\tif (o.size >= o.capacity) {\n\t\t\tif (o.capacity == 0) {\n\t\t\t\to.capacity = kDefaultObjectCapacity;\n\t\t\t\to.members = (Member*)allocator.Malloc(o.capacity * sizeof(Member));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSizeType oldCapacity = o.capacity;\n\t\t\t\to.capacity *= 2;\n\t\t\t\to.members = (Member*)allocator.Realloc(o.members, oldCapacity * sizeof(Member), o.capacity * sizeof(Member));\n\t\t\t}\n\t\t}\n\t\to.members[o.size].name.RawAssign(name);\n\t\to.members[o.size].value.RawAssign(value);\n\t\to.size++;\n\t\treturn *this;\n\t}\n\n\tGenericValue& AddMember(const Ch* name, Allocator& nameAllocator, GenericValue& value, Allocator& allocator) {\n\t\tGenericValue n(name, internal::StrLen(name), nameAllocator);\n\t\treturn AddMember(n, value, allocator);\n\t}\n\n\tGenericValue& AddMember(const Ch* name, GenericValue& value, Allocator& allocator) {\n\t\tGenericValue n(name, internal::StrLen(name));\n\t\treturn AddMember(n, value, allocator);\n\t}\n\n\ttemplate <typename T>\n\tGenericValue& AddMember(const Ch* name, T value, Allocator& allocator) {\n\t\tGenericValue n(name, internal::StrLen(name));\n\t\tGenericValue v(value);\n\t\treturn AddMember(n, v, allocator);\n\t}\n\n\t//! Remove a member in object by its name.\n\t/*! \\param name Name of member to be removed.\n\t    \\return Whether the member existed.\n\t    \\note Removing member is implemented by moving the last member. So the ordering of members is changed.\n\t*/\n\tbool RemoveMember(const Ch* name) {\n\t\tRAPIDJSON_ASSERT(IsObject());\n\t\tif (Member* m = FindMember(name)) {\n\t\t\tRAPIDJSON_ASSERT(data_.o.size > 0);\n\t\t\tRAPIDJSON_ASSERT(data_.o.members != 0);\n\n\t\t\tMember* last = data_.o.members + (data_.o.size - 1);\n\t\t\tif (data_.o.size > 1 && m != last) {\n\t\t\t\t// Move the last one to this place\n\t\t\t\tm->name = last->name;\n\t\t\t\tm->value = last->value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Only one left, just destroy\n\t\t\t\tm->name.~GenericValue();\n\t\t\t\tm->value.~GenericValue();\n\t\t\t}\n\t\t\t--data_.o.size;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t//@}\n\n\t//!@name Array\n\t//@{\n\n\t//! Set this value as an empty array.\n\tGenericValue& SetArray() {\tthis->~GenericValue(); new (this) GenericValue(kArrayType); return *this; }\n\n\t//! Get the number of elements in array.\n\tSizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; }\n\n\t//! Get the capacity of array.\n\tSizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; }\n\n\t//! Check whether the array is empty.\n\tbool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; }\n\n\t//! Remove all elements in the array.\n\t/*! This function do not deallocate memory in the array, i.e. the capacity is unchanged.\n\t*/\n\tvoid Clear() {\n\t\tRAPIDJSON_ASSERT(IsArray()); \n\t\tfor (SizeType i = 0; i < data_.a.size; ++i)\n\t\t\tdata_.a.elements[i].~GenericValue();\n\t\tdata_.a.size = 0;\n\t}\n\n\t//! Get an element from array by index.\n\t/*! \\param index Zero-based index of element.\n\t\t\\note\n\\code\nValue a(kArrayType);\na.PushBack(123);\nint x = a[0].GetInt();\t\t\t\t// Error: operator[ is ambiguous, as 0 also mean a null pointer of const char* type.\nint y = a[SizeType(0)].GetInt();\t// Cast to SizeType will work.\nint z = a[0u].GetInt();\t\t\t\t// This works too.\n\\endcode\n\t*/\n\tGenericValue& operator[](SizeType index) {\n\t\tRAPIDJSON_ASSERT(IsArray());\n\t\tRAPIDJSON_ASSERT(index < data_.a.size);\n\t\treturn data_.a.elements[index];\n\t}\n\tconst GenericValue& operator[](SizeType index) const { return const_cast<GenericValue&>(*this)[index]; }\n\n\t//! Element iterator\n\tValueIterator onBegin() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements; }\n\tValueIterator onEnd() { RAPIDJSON_ASSERT(IsArray()); return data_.a.elements + data_.a.size; }\n\tConstValueIterator onBegin() const { return const_cast<GenericValue&>(*this).onBegin(); }\n\tConstValueIterator onEnd() const { return const_cast<GenericValue&>(*this).onEnd(); }\n\n\t//! Request the array to have enough capacity to store elements.\n\t/*! \\param newCapacity\tThe capacity that the array at least need to have.\n\t\t\\param allocator\tThe allocator for allocating memory. It must be the same one use previously.\n\t\t\\return The value itself for fluent API.\n\t*/\n\tGenericValue& Reserve(SizeType newCapacity, Allocator &allocator) {\n\t\tRAPIDJSON_ASSERT(IsArray());\n\t\tif (newCapacity > data_.a.capacity) {\n\t\t\tdata_.a.elements = (GenericValue*)allocator.Realloc(data_.a.elements, data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue));\n\t\t\tdata_.a.capacity = newCapacity;\n\t\t}\n\t\treturn *this;\n\t}\n\n\t//! Append a value at the end of the array.\n\t/*! \\param value\t\tThe value to be appended.\n\t    \\param allocator\tThe allocator for allocating memory. It must be the same one use previously.\n\t    \\return The value itself for fluent API.\n\t    \\note The ownership of the value will be transfered to this object if success.\n\t    \\note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.\n\t*/\n\tGenericValue& PushBack(GenericValue& value, Allocator& allocator) {\n\t\tRAPIDJSON_ASSERT(IsArray());\n\t\tif (data_.a.size >= data_.a.capacity)\n\t\t\tReserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : data_.a.capacity * 2, allocator);\n\t\tdata_.a.elements[data_.a.size++].RawAssign(value);\n\t\treturn *this;\n\t}\n\n\ttemplate <typename T>\n\tGenericValue& PushBack(T value, Allocator& allocator) {\n\t\tGenericValue v(value);\n\t\treturn PushBack(v, allocator);\n\t}\n\n\t//! Remove the last element in the array.\n\tGenericValue& PopBack() {\n\t\tRAPIDJSON_ASSERT(IsArray());\n\t\tRAPIDJSON_ASSERT(!Empty());\n\t\tdata_.a.elements[--data_.a.size].~GenericValue();\n\t\treturn *this;\n\t}\n\t//@}\n\n\t//!@name Number\n\t//@{\n\n\tint GetInt() const\t\t\t{ RAPIDJSON_ASSERT(flags_ & kIntFlag);   return data_.n.i.i;   }\n\tunsigned GetUint() const\t{ RAPIDJSON_ASSERT(flags_ & kUintFlag);  return data_.n.u.u;   }\n\tint64_t GetInt64() const\t{ RAPIDJSON_ASSERT(flags_ & kInt64Flag); return data_.n.i64; }\n\tuint64_t GetUint64() const\t{ RAPIDJSON_ASSERT(flags_ & kUint64Flag); return data_.n.u64; }\n\n\tdouble GetDouble() const {\n\t\tRAPIDJSON_ASSERT(IsNumber());\n\t\tif ((flags_ & kDoubleFlag) != 0)\t\t\t\treturn data_.n.d;\t// exact type, no conversion.\n\t\tif ((flags_ & kIntFlag) != 0)\t\t\t\t\treturn data_.n.i.i;\t// int -> double\n\t\tif ((flags_ & kUintFlag) != 0)\t\t\t\t\treturn data_.n.u.u;\t// unsigned -> double\n\t\tif ((flags_ & kInt64Flag) != 0)\t\t\t\t\treturn (double)data_.n.i64; // int64_t -> double (may lose precision)\n\t\tRAPIDJSON_ASSERT((flags_ & kUint64Flag) != 0);\treturn (double)data_.n.u64;\t// uint64_t -> double (may lose precision)\n\t}\n\n\tGenericValue& SetInt(int i)\t\t\t\t{ this->~GenericValue(); new (this) GenericValue(i);\treturn *this; }\n\tGenericValue& SetUint(unsigned u)\t\t{ this->~GenericValue(); new (this) GenericValue(u);\treturn *this; }\n\tGenericValue& SetInt64(int64_t i64)\t\t{ this->~GenericValue(); new (this) GenericValue(i64);\treturn *this; }\n\tGenericValue& SetUint64(uint64_t u64)\t{ this->~GenericValue(); new (this) GenericValue(u64);\treturn *this; }\n\tGenericValue& SetDouble(double d)\t\t{ this->~GenericValue(); new (this) GenericValue(d);\treturn *this; }\n\n\t//@}\n\n\t//!@name String\n\t//@{\n\n\tconst Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return data_.s.str; }\n\n\t//! Get the length of string.\n\t/*! Since rapidjson permits \"\\u0000\" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().\n\t*/\n\tSizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return data_.s.length; }\n\n\t//! Set this value as a string without copying source string.\n\t/*! This version has better performance with supplied length, and also support string containing null character.\n\t\t\\param s source string pointer. \n\t\t\\param length The length of source string, excluding the trailing null terminator.\n\t\t\\return The value itself for fluent API.\n\t*/\n\tGenericValue& SetString(const Ch* s, SizeType length) { this->~GenericValue(); SetStringRaw(s, length); return *this; }\n\n\t//! Set this value as a string without copying source string.\n\t/*! \\param s source string pointer. \n\t\t\\return The value itself for fluent API.\n\t*/\n\tGenericValue& SetString(const Ch* s) { return SetString(s, internal::StrLen(s)); }\n\n\t//! Set this value as a string by copying from source string.\n\t/*! This version has better performance with supplied length, and also support string containing null character.\n\t\t\\param s source string. \n\t\t\\param length The length of source string, excluding the trailing null terminator.\n\t\t\\param allocator Allocator for allocating copied buffer. Commonly use document.GetAllocator().\n\t\t\\return The value itself for fluent API.\n\t*/\n\tGenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { this->~GenericValue(); SetStringRaw(s, length, allocator); return *this; }\n\n\t//! Set this value as a string by copying from source string.\n\t/*!\t\\param s source string. \n\t\t\\param allocator Allocator for allocating copied buffer. Commonly use document.GetAllocator().\n\t\t\\return The value itself for fluent API.\n\t*/\n\tGenericValue& SetString(const Ch* s, Allocator& allocator) {\tSetString(s, internal::StrLen(s), allocator); return *this; }\n\n\t//@}\n\n\t//! Generate events of this value to a Handler.\n\t/*! This function adopts the GoF visitor pattern.\n\t\tTypical usage is to output this JSON value as JSON text via Writer, which is a Handler.\n\t\tIt can also be used to deep clone this value via GenericDocument, which is also a Handler.\n\t\t\\tparam Handler type of handler.\n\t\t\\param handler An object implementing concept Handler.\n\t*/\n\ttemplate <typename Handler>\n\tconst GenericValue& Accept(Handler& handler) const {\n\t\tswitch(GetType()) {\n\t\tcase kNullType:\t\thandler.Null(); break;\n\t\tcase kFalseType:\thandler.Bool(false); break;\n\t\tcase kTrueType:\t\thandler.Bool(true); break;\n\n\t\tcase kObjectType:\n\t\t\thandler.StartObject();\n\t\t\tfor (Member* m = data_.o.members; m != data_.o.members + data_.o.size; ++m) {\n\t\t\t\thandler.String(m->name.data_.s.str, m->name.data_.s.length, false);\n\t\t\t\tm->value.Accept(handler);\n\t\t\t}\n\t\t\thandler.EndObject(data_.o.size);\n\t\t\tbreak;\n\n\t\tcase kArrayType:\n\t\t\thandler.StartArray();\n\t\t\tfor (GenericValue* v = data_.a.elements; v != data_.a.elements + data_.a.size; ++v)\n\t\t\t\tv->Accept(handler);\n\t\t\thandler.EndArray(data_.a.size);\n\t\t\tbreak;\n\n\t\tcase kStringType:\n\t\t\thandler.String(data_.s.str, data_.s.length, false);\n\t\t\tbreak;\n\n\t\tcase kNumberType:\n\t\t\tif (IsInt())\t\t\thandler.Int(data_.n.i.i);\n\t\t\telse if (IsUint())\t\thandler.Uint(data_.n.u.u);\n\t\t\telse if (IsInt64())\t\thandler.Int64(data_.n.i64);\n\t\t\telse if (IsUint64())\thandler.Uint64(data_.n.u64);\n\t\t\telse\t\t\t\t\thandler.Double(data_.n.d);\n\t\t\tbreak;\n\t\t}\n\t\treturn *this;\n\t}\n\nprivate:\n\ttemplate <typename, typename>\n\tfriend class GenericDocument;\n\n\tenum {\n\t\tkBoolFlag = 0x100,\n\t\tkNumberFlag = 0x200,\n\t\tkIntFlag = 0x400,\n\t\tkUintFlag = 0x800,\n\t\tkInt64Flag = 0x1000,\n\t\tkUint64Flag = 0x2000,\n\t\tkDoubleFlag = 0x4000,\n\t\tkStringFlag = 0x100000,\n\t\tkCopyFlag = 0x200000,\n\n\t\t// Initial flags of different types.\n\t\tkNullFlag = kNullType,\n\t\tkTrueFlag = kTrueType | kBoolFlag,\n\t\tkFalseFlag = kFalseType | kBoolFlag,\n\t\tkNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag,\n\t\tkNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag,\n\t\tkNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,\n\t\tkNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag,\n\t\tkNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag,\n\t\tkConstStringFlag = kStringType | kStringFlag,\n\t\tkCopyStringFlag = kStringType | kStringFlag | kCopyFlag,\n\t\tkObjectFlag = kObjectType,\n\t\tkArrayFlag = kArrayType,\n\n\t\tkTypeMask = 0xFF\t// bitwise-and with mask of 0xFF can be optimized by compiler\n\t};\n\n\tstatic const SizeType kDefaultArrayCapacity = 16;\n\tstatic const SizeType kDefaultObjectCapacity = 16;\n\n\tstruct String {\n\t\tconst Ch* str;\n\t\tSizeType length;\n\t\tunsigned hashcode;\t//!< reserved\n\t};\t// 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n\t// By using proper binary layout, retrieval of different integer types do not need conversions.\n\tunion Number {\n#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN\n\t\tstruct I {\n\t\t\tint i;\n\t\t\tchar padding[4];\n\t\t}i;\n\t\tstruct U {\n\t\t\tunsigned u;\n\t\t\tchar padding2[4];\n\t\t}u;\n#else\n\t\tstruct I {\n\t\t\tchar padding[4];\n\t\t\tint i;\n\t\t}i;\n\t\tstruct U {\n\t\t\tchar padding2[4];\n\t\t\tunsigned u;\n\t\t}u;\n#endif\n\t\tint64_t i64;\n\t\tuint64_t u64;\n\t\tdouble d;\n\t};\t// 8 bytes\n\n\tstruct Object {\n\t\tMember* members;\n\t\tSizeType size;\n\t\tSizeType capacity;\n\t};\t// 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n\tstruct Array {\n\t\tGenericValue<Encoding, Allocator>* elements;\n\t\tSizeType size;\n\t\tSizeType capacity;\n\t};\t// 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n\tunion Data {\n\t\tString s;\n\t\tNumber n;\n\t\tObject o;\n\t\tArray a;\n\t};\t// 12 bytes in 32-bit mode, 16 bytes in 64-bit mode\n\n\t//! Find member by name.\n\tMember* FindMember(const Ch* name) {\n\t\tRAPIDJSON_ASSERT(name);\n\t\tRAPIDJSON_ASSERT(IsObject());\n\n\t\tSizeType length = internal::StrLen(name);\n\n\t\tObject& o = data_.o;\n\t\tfor (Member* member = o.members; member != data_.o.members + data_.o.size; ++member)\n\t\t\tif (length == member->name.data_.s.length && memcmp(member->name.data_.s.str, name, length * sizeof(Ch)) == 0)\n\t\t\t\treturn member;\n\n\t\treturn 0;\n\t}\n\tconst Member* FindMember(const Ch* name) const { return const_cast<GenericValue&>(*this).FindMember(name); }\n\n\t// Initialize this value as array with initial data, without calling destructor.\n\tvoid SetArrayRaw(GenericValue* values, SizeType count, Allocator& alloctaor) {\n\t\tflags_ = kArrayFlag;\n\t\tdata_.a.elements = (GenericValue*)alloctaor.Malloc(count * sizeof(GenericValue));\n\t\tmemcpy(data_.a.elements, values, count * sizeof(GenericValue));\n\t\tdata_.a.size = data_.a.capacity = count;\n\t}\n\n\t//! Initialize this value as object with initial data, without calling destructor.\n\tvoid SetObjectRaw(Member* members, SizeType count, Allocator& alloctaor) {\n\t\tflags_ = kObjectFlag;\n\t\tdata_.o.members = (Member*)alloctaor.Malloc(count * sizeof(Member));\n\t\tmemcpy(data_.o.members, members, count * sizeof(Member));\n\t\tdata_.o.size = data_.o.capacity = count;\n\t}\n\n\t//! Initialize this value as constant string, without calling destructor.\n\tvoid SetStringRaw(const Ch* s, SizeType length) {\n\t\tRAPIDJSON_ASSERT(s != NULL);\n\t\tflags_ = kConstStringFlag;\n\t\tdata_.s.str = s;\n\t\tdata_.s.length = length;\n\t}\n\n\t//! Initialize this value as copy string with initial data, without calling destructor.\n\tvoid SetStringRaw(const Ch* s, SizeType length, Allocator& allocator) {\n\t\tRAPIDJSON_ASSERT(s != NULL);\n\t\tflags_ = kCopyStringFlag;\n\t\tdata_.s.str = (Ch *)allocator.Malloc((length + 1) * sizeof(Ch));\n\t\tdata_.s.length = length;\n\t\tmemcpy(const_cast<Ch*>(data_.s.str), s, length * sizeof(Ch));\n\t\tconst_cast<Ch*>(data_.s.str)[length] = '\\0';\n\t}\n\n\t//! Assignment without calling destructor\n\tvoid RawAssign(GenericValue& rhs) {\n\t\tmemcpy(this, &rhs, sizeof(GenericValue));\n\t\trhs.flags_ = kNullFlag;\n\t}\n\n\tData data_;\n\tunsigned flags_;\n};\n#pragma pack (pop)\n\n//! Value with UTF8 encoding.\ntypedef GenericValue<UTF8<> > Value;\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericDocument \n\n//! A document for parsing JSON text as DOM.\n/*!\n\t\\implements Handler\n\t\\tparam Encoding encoding for both parsing and string storage.\n\t\\tparam Alloactor allocator for allocating memory for the DOM, and the stack during parsing.\n*/\ntemplate <typename Encoding, typename Allocator = MemoryPoolAllocator<> >\nclass GenericDocument : public GenericValue<Encoding, Allocator> {\npublic:\n\ttypedef typename Encoding::Ch Ch;\t\t\t\t\t\t//!< Character type derived from Encoding.\n\ttypedef GenericValue<Encoding, Allocator> ValueType;\t//!< Value type of the document.\n\ttypedef Allocator AllocatorType;\t\t\t\t\t\t//!< Allocator type from template parameter.\n\n\t//! Constructor\n\t/*! \\param allocator\t\tOptional allocator for allocating stack memory.\n\t\t\\param stackCapacity\tInitial capacity of stack in bytes.\n\t*/\n\tGenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(allocator, stackCapacity), parseError_(0), errorOffset_(0) {}\n\n\t//! Parse JSON text from an input stream.\n\t/*! \\tparam parseFlags Combination of ParseFlag.\n\t\t\\param stream Input stream to be parsed.\n\t\t\\return The document itself for fluent API.\n\t*/\n\ttemplate <unsigned parseFlags, typename Stream>\n\tGenericDocument& ParseStream(Stream& stream) {\n\t\tValueType::SetNull(); // Remove existing root if exist\n\t\tGenericReader<Encoding, Allocator> reader;\n\t\tif (reader.template Parse<parseFlags>(stream, *this)) {\n\t\t\tRAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object\n\t\t\tthis->RawAssign(*stack_.template Pop<ValueType>(1));\t// Add this-> to prevent issue 13.\n\t\t\tparseError_ = 0;\n\t\t\terrorOffset_ = 0;\n\t\t}\n\t\telse {\n\t\t\tparseError_ = reader.GetParseError();\n\t\t\terrorOffset_ = reader.GetErrorOffset();\n\t\t\tClearStack();\n\t\t}\n\t\treturn *this;\n\t}\n\n\t//! Parse JSON text from a mutable string.\n\t/*! \\tparam parseFlags Combination of ParseFlag.\n\t\t\\param str Mutable zero-terminated string to be parsed.\n\t\t\\return The document itself for fluent API.\n\t*/\n\ttemplate <unsigned parseFlags>\n\tGenericDocument& ParseInsitu(Ch* str) {\n\t\tGenericInsituStringStream<Encoding> s(str);\n\t\treturn ParseStream<parseFlags | kParseInsituFlag>(s);\n\t}\n\n\t//! Parse JSON text from a read-only string.\n\t/*! \\tparam parseFlags Combination of ParseFlag (must not contain kParseInsituFlag).\n\t\t\\param str Read-only zero-terminated string to be parsed.\n\t*/\n\ttemplate <unsigned parseFlags>\n\tGenericDocument& Parse(const Ch* str) {\n\t\tRAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag));\n\t\tGenericStringStream<Encoding> s(str);\n\t\treturn ParseStream<parseFlags>(s);\n\t}\n\n\t//! Whether a parse error was occured in the last parsing.\n\tbool HasParseError() const { return parseError_ != 0; }\n\n\t//! Get the message of parsing error.\n\tconst char* GetParseError() const { return parseError_; }\n\n\t//! Get the offset in character of the parsing error.\n\tsize_t GetErrorOffset() const { return errorOffset_; }\n\n\t//! Get the allocator of this document.\n\tAllocator& GetAllocator() {\treturn stack_.GetAllocator(); }\n\n\t//! Get the capacity of stack in bytes.\n\tsize_t GetStackCapacity() const { return stack_.GetCapacity(); }\n\nprivate:\n\t// Prohibit assignment\n\tGenericDocument& operator=(const GenericDocument&);\n\n\tfriend class GenericReader<Encoding, Allocator>;\t// for Reader to call the following private handler functions\n\n\t// Implementation of Handler\n\tvoid Null()\t{ new (stack_.template Push<ValueType>()) ValueType(); }\n\tvoid Bool(bool b) { new (stack_.template Push<ValueType>()) ValueType(b); }\n\tvoid Int(int i) { new (stack_.template Push<ValueType>()) ValueType(i); }\n\tvoid Uint(unsigned i) { new (stack_.template Push<ValueType>()) ValueType(i); }\n\tvoid Int64(int64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); }\n\tvoid Uint64(uint64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); }\n\tvoid Double(double d) { new (stack_.template Push<ValueType>()) ValueType(d); }\n\n\tvoid String(const Ch* str, SizeType length, bool copy) { \n\t\tif (copy) \n\t\t\tnew (stack_.template Push<ValueType>()) ValueType(str, length, GetAllocator());\n\t\telse\n\t\t\tnew (stack_.template Push<ValueType>()) ValueType(str, length);\n\t}\n\n\tvoid StartObject() { new (stack_.template Push<ValueType>()) ValueType(kObjectType); }\n\t\n\tvoid EndObject(SizeType memberCount) {\n\t\ttypename ValueType::Member* members = stack_.template Pop<typename ValueType::Member>(memberCount);\n\t\tstack_.template Top<ValueType>()->SetObjectRaw(members, (SizeType)memberCount, GetAllocator());\n\t}\n\n\tvoid StartArray() { new (stack_.template Push<ValueType>()) ValueType(kArrayType); }\n\t\n\tvoid EndArray(SizeType elementCount) {\n\t\tValueType* elements = stack_.template Pop<ValueType>(elementCount);\n\t\tstack_.template Top<ValueType>()->SetArrayRaw(elements, elementCount, GetAllocator());\n\t}\n\n\tvoid ClearStack() {\n\t\tif (Allocator::kNeedFree)\n\t\t\twhile (stack_.GetSize() > 0)\t// Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects)\n\t\t\t\t(stack_.template Pop<ValueType>(1))->~ValueType();\n\t\telse\n\t\t\tstack_.Clear();\n\t}\n\n\tstatic const size_t kDefaultStackCapacity = 1024;\n\tinternal::Stack<Allocator> stack_;\n\tconst char* parseError_;\n\tsize_t errorOffset_;\n};\n\ntypedef GenericDocument<UTF8<> > Document;\n\n} // namespace rapidjson\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif // RAPIDJSON_DOCUMENT_H_\n"
  },
  {
    "path": "cocos2d/external/json/filestream.h",
    "content": "#ifndef RAPIDJSON_FILESTREAM_H_\n#define RAPIDJSON_FILESTREAM_H_\n\n#include <cstdio>\n\nnamespace rapidjson {\n\n//! Wrapper of C file stream for input or output.\n/*!\n\tThis simple wrapper does not check the validity of the stream.\n\t\\implements Stream\n*/\nclass FileStream {\npublic:\n\ttypedef char Ch;\t//!< Character type. Only support char.\n\n\tFileStream(FILE* fp) : fp_(fp), count_(0) { Read(); }\n\tchar Peek() const { return current_; }\n\tchar Take() { char c = current_; Read(); return c; }\n\tsize_t Tell() const { return count_; }\n\tvoid Put(char c) { fputc(c, fp_); }\n\n\t// Not implemented\n\tchar* PutBegin() { return 0; }\n\tsize_t PutEnd(char*) { return 0; }\n\nprivate:\n\tvoid Read() {\n\t\tRAPIDJSON_ASSERT(fp_ != 0);\n\t\tint c = fgetc(fp_);\n\t\tif (c != EOF) {\n\t\t\tcurrent_ = (char)c;\n\t\t\tcount_++;\n\t\t}\n\t\telse\n\t\t\tcurrent_ = '\\0';\n\t}\n\n\tFILE* fp_;\n\tchar current_;\n\tsize_t count_;\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_FILESTREAM_H_\n"
  },
  {
    "path": "cocos2d/external/json/internal/pow10.h",
    "content": "#ifndef RAPIDJSON_POW10_\n#define RAPIDJSON_POW10_\n\nnamespace rapidjson {\nnamespace internal {\n\n//! Computes integer powers of 10 in double (10.0^n).\n/*! This function uses lookup table for fast and accurate results.\n\t\\param n positive/negative exponent. Must <= 308.\n\t\\return 10.0^n\n*/\ninline double Pow10(int n) {\n\tstatic const double e[] = { // 1e-308...1e308: 617 * 8 bytes = 4936 bytes\n\t\t1e-308,1e-307,1e-306,1e-305,1e-304,1e-303,1e-302,1e-301,1e-300,\n\t\t1e-299,1e-298,1e-297,1e-296,1e-295,1e-294,1e-293,1e-292,1e-291,1e-290,1e-289,1e-288,1e-287,1e-286,1e-285,1e-284,1e-283,1e-282,1e-281,1e-280,\n\t\t1e-279,1e-278,1e-277,1e-276,1e-275,1e-274,1e-273,1e-272,1e-271,1e-270,1e-269,1e-268,1e-267,1e-266,1e-265,1e-264,1e-263,1e-262,1e-261,1e-260,\n\t\t1e-259,1e-258,1e-257,1e-256,1e-255,1e-254,1e-253,1e-252,1e-251,1e-250,1e-249,1e-248,1e-247,1e-246,1e-245,1e-244,1e-243,1e-242,1e-241,1e-240,\n\t\t1e-239,1e-238,1e-237,1e-236,1e-235,1e-234,1e-233,1e-232,1e-231,1e-230,1e-229,1e-228,1e-227,1e-226,1e-225,1e-224,1e-223,1e-222,1e-221,1e-220,\n\t\t1e-219,1e-218,1e-217,1e-216,1e-215,1e-214,1e-213,1e-212,1e-211,1e-210,1e-209,1e-208,1e-207,1e-206,1e-205,1e-204,1e-203,1e-202,1e-201,1e-200,\n\t\t1e-199,1e-198,1e-197,1e-196,1e-195,1e-194,1e-193,1e-192,1e-191,1e-190,1e-189,1e-188,1e-187,1e-186,1e-185,1e-184,1e-183,1e-182,1e-181,1e-180,\n\t\t1e-179,1e-178,1e-177,1e-176,1e-175,1e-174,1e-173,1e-172,1e-171,1e-170,1e-169,1e-168,1e-167,1e-166,1e-165,1e-164,1e-163,1e-162,1e-161,1e-160,\n\t\t1e-159,1e-158,1e-157,1e-156,1e-155,1e-154,1e-153,1e-152,1e-151,1e-150,1e-149,1e-148,1e-147,1e-146,1e-145,1e-144,1e-143,1e-142,1e-141,1e-140,\n\t\t1e-139,1e-138,1e-137,1e-136,1e-135,1e-134,1e-133,1e-132,1e-131,1e-130,1e-129,1e-128,1e-127,1e-126,1e-125,1e-124,1e-123,1e-122,1e-121,1e-120,\n\t\t1e-119,1e-118,1e-117,1e-116,1e-115,1e-114,1e-113,1e-112,1e-111,1e-110,1e-109,1e-108,1e-107,1e-106,1e-105,1e-104,1e-103,1e-102,1e-101,1e-100,\n\t\t1e-99, 1e-98, 1e-97, 1e-96, 1e-95, 1e-94, 1e-93, 1e-92, 1e-91, 1e-90, 1e-89, 1e-88, 1e-87, 1e-86, 1e-85, 1e-84, 1e-83, 1e-82, 1e-81, 1e-80, \n\t\t1e-79, 1e-78, 1e-77, 1e-76, 1e-75, 1e-74, 1e-73, 1e-72, 1e-71, 1e-70, 1e-69, 1e-68, 1e-67, 1e-66, 1e-65, 1e-64, 1e-63, 1e-62, 1e-61, 1e-60, \n\t\t1e-59, 1e-58, 1e-57, 1e-56, 1e-55, 1e-54, 1e-53, 1e-52, 1e-51, 1e-50, 1e-49, 1e-48, 1e-47, 1e-46, 1e-45, 1e-44, 1e-43, 1e-42, 1e-41, 1e-40, \n\t\t1e-39, 1e-38, 1e-37, 1e-36, 1e-35, 1e-34, 1e-33, 1e-32, 1e-31, 1e-30, 1e-29, 1e-28, 1e-27, 1e-26, 1e-25, 1e-24, 1e-23, 1e-22, 1e-21, 1e-20, \n\t\t1e-19, 1e-18, 1e-17, 1e-16, 1e-15, 1e-14, 1e-13, 1e-12, 1e-11, 1e-10, 1e-9,  1e-8,  1e-7,  1e-6,  1e-5,  1e-4,  1e-3,  1e-2,  1e-1,  1e+0,  \n\t\t1e+1,  1e+2,  1e+3,  1e+4,  1e+5,  1e+6,  1e+7,  1e+8,  1e+9,  1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, \n\t\t1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40,\n\t\t1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60,\n\t\t1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80,\n\t\t1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100,\n\t\t1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120,\n\t\t1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140,\n\t\t1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160,\n\t\t1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180,\n\t\t1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200,\n\t\t1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220,\n\t\t1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240,\n\t\t1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260,\n\t\t1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280,\n\t\t1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300,\n\t\t1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308\n\t};\n\tRAPIDJSON_ASSERT(n <= 308);\n\treturn n < -308 ? 0.0 : e[n + 308];\n}\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_POW10_\n"
  },
  {
    "path": "cocos2d/external/json/internal/stack.h",
    "content": "#ifndef RAPIDJSON_INTERNAL_STACK_H_\n#define RAPIDJSON_INTERNAL_STACK_H_\n\nnamespace rapidjson {\nnamespace internal {\n\n///////////////////////////////////////////////////////////////////////////////\n// Stack\n\n//! A type-unsafe stack for storing different types of data.\n/*! \\tparam Allocator Allocator for allocating stack memory.\n*/\ntemplate <typename Allocator>\nclass Stack {\npublic:\n\tStack(Allocator* allocator, size_t stack_capacity) : allocator_(allocator), own_allocator_(0), stack_(0), stack_top_(0), stack_end_(0), stack_capacity_(stack_capacity) {\n\t\tRAPIDJSON_ASSERT(stack_capacity_ > 0);\n\t\tif (!allocator_)\n\t\t\town_allocator_ = allocator_ = new Allocator();\n\t\tstack_top_ = stack_ = (char*)allocator_->Malloc(stack_capacity_);\n\t\tstack_end_ = stack_ + stack_capacity_;\n\t}\n\n\t~Stack() {\n\t\tAllocator::Free(stack_);\n\t\tdelete own_allocator_; // Only delete if it is owned by the stack\n\t}\n\n\tvoid Clear() { /*stack_top_ = 0;*/ stack_top_ = stack_; }\n\n\ttemplate<typename T>\n\tT* Push(size_t count = 1) {\n\t\t // Expand the stack if needed\n\t\tif (stack_top_ + sizeof(T) * count >= stack_end_) {\n\t\t\tsize_t new_capacity = stack_capacity_ * 2;\n\t\t\tsize_t size = GetSize();\n\t\t\tsize_t new_size = GetSize() + sizeof(T) * count;\n\t\t\tif (new_capacity < new_size)\n\t\t\t\tnew_capacity = new_size;\n\t\t\tstack_ = (char*)allocator_->Realloc(stack_, stack_capacity_, new_capacity);\n\t\t\tstack_capacity_ = new_capacity;\n\t\t\tstack_top_ = stack_ + size;\n\t\t\tstack_end_ = stack_ + stack_capacity_;\n\t\t}\n\t\tT* ret = (T*)stack_top_;\n\t\tstack_top_ += sizeof(T) * count;\n\t\treturn ret;\n\t}\n\n\ttemplate<typename T>\n\tT* Pop(size_t count) {\n\t\tRAPIDJSON_ASSERT(GetSize() >= count * sizeof(T));\n\t\tstack_top_ -= count * sizeof(T);\n\t\treturn (T*)stack_top_;\n\t}\n\n\ttemplate<typename T>\n\tT* Top() { \n\t\tRAPIDJSON_ASSERT(GetSize() >= sizeof(T));\n\t\treturn (T*)(stack_top_ - sizeof(T));\n\t}\n\n\ttemplate<typename T>\n\tT* Bottom() { return (T*)stack_; }\n\n\tAllocator& GetAllocator() { return *allocator_; }\n\tsize_t GetSize() const { return stack_top_ - stack_; }\n\tsize_t GetCapacity() const { return stack_capacity_; }\n\nprivate:\n\tAllocator* allocator_;\n\tAllocator* own_allocator_;\n\tchar *stack_;\n\tchar *stack_top_;\n\tchar *stack_end_;\n\tsize_t stack_capacity_;\n};\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_STACK_H_\n"
  },
  {
    "path": "cocos2d/external/json/internal/strfunc.h",
    "content": "#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_\n#define RAPIDJSON_INTERNAL_STRFUNC_H_\n\nnamespace rapidjson {\nnamespace internal {\n\n//! Custom strlen() which works on different character types.\n/*!\t\\tparam Ch Character type (e.g. char, wchar_t, short)\n\t\\param s Null-terminated input string.\n\t\\return Number of characters in the string. \n\t\\note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.\n*/\ntemplate <typename Ch>\ninline SizeType StrLen(const Ch* s) {\n\tconst Ch* p = s;\n\twhile (*p != '\\0')\n\t\t++p;\n\treturn SizeType(p - s);\n}\n\n} // namespace internal\n} // namespace rapidjson\n\n#endif // RAPIDJSON_INTERNAL_STRFUNC_H_\n"
  },
  {
    "path": "cocos2d/external/json/prettywriter.h",
    "content": "#ifndef RAPIDJSON_PRETTYWRITER_H_\n#define RAPIDJSON_PRETTYWRITER_H_\n\n#include \"writer.h\"\n\nnamespace rapidjson {\n\n//! Writer with indentation and spacing.\n/*!\n\t\\tparam Stream Type of ouptut stream.\n\t\\tparam Encoding Encoding of both source strings and output.\n\t\\tparam Allocator Type of allocator for allocating memory of stack.\n*/\ntemplate<typename Stream, typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<> >\nclass PrettyWriter : public Writer<Stream, Encoding, Allocator> {\npublic:\n\ttypedef Writer<Stream, Encoding, Allocator> Base;\n\ttypedef typename Base::Ch Ch;\n\n\t//! Constructor\n\t/*! \\param stream Output stream.\n\t\t\\param allocator User supplied allocator. If it is null, it will create a private one.\n\t\t\\param levelDepth Initial capacity of \n\t*/\n\tPrettyWriter(Stream& stream, Allocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) : \n\t\tBase(stream, allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {}\n\n\t//! Set custom indentation.\n\t/*! \\param indentChar\t\tCharacter for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r').\n\t\t\\param indentCharCount\tNumber of indent characters for each indentation level.\n\t\t\\note The default indentation is 4 spaces.\n\t*/\n\tPrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) {\n\t\tRAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\\t' || indentChar == '\\n' || indentChar == '\\r');\n\t\tindentChar_ = indentChar;\n\t\tindentCharCount_ = indentCharCount;\n\t\treturn *this;\n\t}\n\n\t//@name Implementation of Handler.\n\t//@{\n\n\tPrettyWriter& Null()\t\t\t\t{ PrettyPrefix(kNullType);   Base::WriteNull();\t\t\treturn *this; }\n\tPrettyWriter& Bool(bool b)\t\t\t{ PrettyPrefix(b ? kTrueType : kFalseType); Base::WriteBool(b); return *this; }\n\tPrettyWriter& Int(int i)\t\t\t{ PrettyPrefix(kNumberType); Base::WriteInt(i);\t\t\treturn *this; }\n\tPrettyWriter& Uint(unsigned u)\t\t{ PrettyPrefix(kNumberType); Base::WriteUint(u);\t\treturn *this; }\n\tPrettyWriter& Int64(int64_t i64)\t{ PrettyPrefix(kNumberType); Base::WriteInt64(i64);\t\treturn *this; }\n\tPrettyWriter& Uint64(uint64_t u64)\t{ PrettyPrefix(kNumberType); Base::WriteUint64(u64);\treturn *this; }\n\tPrettyWriter& Double(double d)\t\t{ PrettyPrefix(kNumberType); Base::WriteDouble(d);\t\treturn *this; }\n\n\tPrettyWriter& String(const Ch* str, SizeType length, bool copy = false) {\n\t\t(void)copy;\n\t\tPrettyPrefix(kStringType);\n\t\tBase::WriteString(str, length);\n\t\treturn *this;\n\t}\n\n\tPrettyWriter& StartObject() {\n\t\tPrettyPrefix(kObjectType);\n\t\tnew (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(false);\n\t\tBase::WriteStartObject();\n\t\treturn *this;\n\t}\n\n\tPrettyWriter& EndObject(SizeType memberCount = 0) {\n\t\t(void)memberCount;\n\t\tRAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));\n\t\tRAPIDJSON_ASSERT(!Base::level_stack_.template Top<typename Base::Level>()->inArray);\n\t\tbool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;\n\n\t\tif (!empty) {\n\t\t\tBase::stream_.Put('\\n');\n\t\t\tWriteIndent();\n\t\t}\n\t\tBase::WriteEndObject();\n\t\treturn *this;\n\t}\n\n\tPrettyWriter& StartArray() {\n\t\tPrettyPrefix(kArrayType);\n\t\tnew (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(true);\n\t\tBase::WriteStartArray();\n\t\treturn *this;\n\t}\n\n\tPrettyWriter& EndArray(SizeType memberCount = 0) {\n\t\t(void)memberCount;\n\t\tRAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));\n\t\tRAPIDJSON_ASSERT(Base::level_stack_.template Top<typename Base::Level>()->inArray);\n\t\tbool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;\n\n\t\tif (!empty) {\n\t\t\tBase::stream_.Put('\\n');\n\t\t\tWriteIndent();\n\t\t}\n\t\tBase::WriteEndArray();\n\t\treturn *this;\n\t}\n\n\t//@}\n\n\t//! Simpler but slower overload.\n\tPrettyWriter& String(const Ch* str) { return String(str, internal::StrLen(str)); }\n\nprotected:\n\tvoid PrettyPrefix(Type type) {\n\t\t(void)type;\n\t\tif (Base::level_stack_.GetSize() != 0) { // this value is not at root\n\t\t\ttypename Base::Level* level = Base::level_stack_.template Top<typename Base::Level>();\n\n\t\t\tif (level->inArray) {\n\t\t\t\tif (level->valueCount > 0) {\n\t\t\t\t\tBase::stream_.Put(','); // add comma if it is not the first element in array\n\t\t\t\t\tBase::stream_.Put('\\n');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tBase::stream_.Put('\\n');\n\t\t\t\tWriteIndent();\n\t\t\t}\n\t\t\telse {\t// in object\n\t\t\t\tif (level->valueCount > 0) {\n\t\t\t\t\tif (level->valueCount % 2 == 0) {\n\t\t\t\t\t\tBase::stream_.Put(',');\n\t\t\t\t\t\tBase::stream_.Put('\\n');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tBase::stream_.Put(':');\n\t\t\t\t\t\tBase::stream_.Put(' ');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tBase::stream_.Put('\\n');\n\n\t\t\t\tif (level->valueCount % 2 == 0)\n\t\t\t\t\tWriteIndent();\n\t\t\t}\n\t\t\tif (!level->inArray && level->valueCount % 2 == 0)\n\t\t\t\tRAPIDJSON_ASSERT(type == kStringType);  // if it's in object, then even number should be a name\n\t\t\tlevel->valueCount++;\n\t\t}\n\t\telse\n\t\t\tRAPIDJSON_ASSERT(type == kObjectType || type == kArrayType);\n\t}\n\n\tvoid WriteIndent()  {\n\t\tsize_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_;\n\t\tPutN(Base::stream_, indentChar_, count);\n\t}\n\n\tCh indentChar_;\n\tunsigned indentCharCount_;\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_RAPIDJSON_H_\n"
  },
  {
    "path": "cocos2d/external/json/rapidjson.h",
    "content": "#ifndef RAPIDJSON_RAPIDJSON_H_\n#define RAPIDJSON_RAPIDJSON_H_\n\n// Copyright (c) 2011-2012 Milo Yip (miloyip@gmail.com)\n// Version 0.11\n\n#include <cstdlib>\t// malloc(), realloc(), free()\n#include <cstring>\t// memcpy()\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_NO_INT64DEFINE\n\n// Here defines int64_t and uint64_t types in global namespace.\n// If user have their own definition, can define RAPIDJSON_NO_INT64DEFINE to disable this.\n#ifndef RAPIDJSON_NO_INT64DEFINE\n#ifdef _MSC_VER\ntypedef __int64 int64_t;\ntypedef unsigned __int64 uint64_t;\n#else\n#include <inttypes.h>\n#endif\n#endif // RAPIDJSON_NO_INT64TYPEDEF\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_ENDIAN\n#define RAPIDJSON_LITTLEENDIAN\t0\t//!< Little endian machine\n#define RAPIDJSON_BIGENDIAN\t\t1\t//!< Big endian machine\n\n//! Endianness of the machine.\n/*!\tGCC provided macro for detecting endianness of the target machine. But other\n\tcompilers may not have this. User can define RAPIDJSON_ENDIAN to either\n\tRAPIDJSON_LITTLEENDIAN or RAPIDJSON_BIGENDIAN.\n*/\n#ifndef RAPIDJSON_ENDIAN\n#ifdef __BYTE_ORDER__\n#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN\n#else\n#define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN\n#endif // __BYTE_ORDER__\n#else\n#define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN\t// Assumes little endian otherwise.\n#endif\n#endif // RAPIDJSON_ENDIAN\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_SIMD\n\n// Enable SSE2 optimization.\n//#define RAPIDJSON_SSE2\n\n// Enable SSE4.2 optimization.\n//#define RAPIDJSON_SSE42\n\n#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)\n#define RAPIDJSON_SIMD\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_NO_SIZETYPEDEFINE\n\n#ifndef RAPIDJSON_NO_SIZETYPEDEFINE\nnamespace rapidjson {\n//! Use 32-bit array/string indices even for 64-bit platform, instead of using size_t.\n/*! User may override the SizeType by defining RAPIDJSON_NO_SIZETYPEDEFINE.\n*/\ntypedef unsigned SizeType;\n} // namespace rapidjson\n#endif\n\n///////////////////////////////////////////////////////////////////////////////\n// RAPIDJSON_ASSERT\n\n//! Assertion.\n/*! By default, rapidjson uses C assert() for assertion.\n\tUser can override it by defining RAPIDJSON_ASSERT(x) macro.\n*/\n#ifndef RAPIDJSON_ASSERT\n#include <cassert>\n#define RAPIDJSON_ASSERT(x) assert(x)\n#endif // RAPIDJSON_ASSERT\n\n///////////////////////////////////////////////////////////////////////////////\n// Helpers\n\n#define RAPIDJSON_MULTILINEMACRO_BEGIN do {  \n#define RAPIDJSON_MULTILINEMACRO_END \\\n} while((void)0, 0)\n\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n// Allocator\n\n/*! \\class rapidjson::Allocator\n\t\\brief Concept for allocating, resizing and freeing memory block.\n\t\n\tNote that Malloc() and Realloc() are non-static but Free() is static.\n\t\n\tSo if an allocator need to support Free(), it needs to put its pointer in \n\tthe header of memory block.\n\n\\code\nconcept Allocator {\n\tstatic const bool kNeedFree;\t//!< Whether this allocator needs to call Free().\n\n\t// Allocate a memory block.\n\t// \\param size of the memory block in bytes.\n\t// \\returns pointer to the memory block.\n\tvoid* Malloc(size_t size);\n\n\t// Resize a memory block.\n\t// \\param originalPtr The pointer to current memory block. Null pointer is permitted.\n\t// \\param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.)\n\t// \\param newSize the new size in bytes.\n\tvoid* Realloc(void* originalPtr, size_t originalSize, size_t newSize);\n\n\t// Free a memory block.\n\t// \\param pointer to the memory block. Null pointer is permitted.\n\tstatic void Free(void *ptr);\n};\n\\endcode\n*/\n\n///////////////////////////////////////////////////////////////////////////////\n// CrtAllocator\n\n//! C-runtime library allocator.\n/*! This class is just wrapper for standard C library memory routines.\n\t\\implements Allocator\n*/\nclass CrtAllocator {\npublic:\n\tstatic const bool kNeedFree = true;\n\tvoid* Malloc(size_t size) { return malloc(size); }\n\tvoid* Realloc(void* originalPtr, size_t originalSize, size_t newSize) { (void)originalSize; return realloc(originalPtr, newSize); }\n\tstatic void Free(void *ptr) { free(ptr); }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// MemoryPoolAllocator\n\n//! Default memory allocator used by the parser and DOM.\n/*! This allocator allocate memory blocks from pre-allocated memory chunks. \n\n    It does not free memory blocks. And Realloc() only allocate new memory.\n\n    The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default.\n\n    User may also supply a buffer as the first chunk.\n\n    If the user-buffer is full then additional chunks are allocated by BaseAllocator.\n\n    The user-buffer is not deallocated by this allocator.\n\n    \\tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator.\n\t\\implements Allocator\n*/\ntemplate <typename BaseAllocator = CrtAllocator>\nclass MemoryPoolAllocator {\npublic:\n\tstatic const bool kNeedFree = false;\t//!< Tell users that no need to call Free() with this allocator. (concept Allocator)\n\n\t//! Constructor with chunkSize.\n\t/*! \\param chunkSize The size of memory chunk. The default is kDefaultChunkSize.\n\t\t\\param baseAllocator The allocator for allocating memory chunks.\n\t*/\n\tMemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) : \n\t\tchunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0)\n\t{\n\t\tif (!baseAllocator_)\n\t\t\townBaseAllocator_ = baseAllocator_ = new BaseAllocator();\n\t\tAddChunk(chunk_capacity_);\n\t}\n\n\t//! Constructor with user-supplied buffer.\n\t/*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size.\n\n\t\tThe user buffer will not be deallocated when this allocator is destructed.\n\n\t\t\\param buffer User supplied buffer.\n\t\t\\param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader).\n\t\t\\param chunkSize The size of memory chunk. The default is kDefaultChunkSize.\n\t\t\\param baseAllocator The allocator for allocating memory chunks.\n\t*/\n\tMemoryPoolAllocator(char *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :\n\t\tchunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0)\n\t{\n\t\tRAPIDJSON_ASSERT(buffer != 0);\n\t\tRAPIDJSON_ASSERT(size > sizeof(ChunkHeader));\n\t\tchunkHead_ = (ChunkHeader*)buffer;\n\t\tchunkHead_->capacity = size - sizeof(ChunkHeader);\n\t\tchunkHead_->size = 0;\n\t\tchunkHead_->next = 0;\n\t}\n\n\t//! Destructor.\n\t/*! This deallocates all memory chunks, excluding the user-supplied buffer.\n\t*/\n\t~MemoryPoolAllocator() {\n\t\tClear();\n\t\tdelete ownBaseAllocator_;\n\t}\n\n\t//! Deallocates all memory chunks, excluding the user-supplied buffer.\n\tvoid Clear() {\n\t\twhile(chunkHead_ != 0 && chunkHead_ != (ChunkHeader *)userBuffer_) {\n\t\t\tChunkHeader* next = chunkHead_->next;\n\t\t\tbaseAllocator_->Free(chunkHead_);\n\t\t\tchunkHead_ = next;\n\t\t}\n\t}\n\n\t//! Computes the total capacity of allocated memory chunks.\n\t/*! \\return total capacity in bytes.\n\t*/\n\tsize_t Capacity() {\n\t\tsize_t capacity = 0;\n\t\tfor (ChunkHeader* c = chunkHead_; c != 0; c = c->next)\n\t\t\tcapacity += c->capacity;\n\t\treturn capacity;\n\t}\n\n\t//! Computes the memory blocks allocated.\n\t/*! \\return total used bytes.\n\t*/\n\tsize_t Size() {\n\t\tsize_t size = 0;\n\t\tfor (ChunkHeader* c = chunkHead_; c != 0; c = c->next)\n\t\t\tsize += c->size;\n\t\treturn size;\n\t}\n\n\t//! Allocates a memory block. (concept Allocator)\n\tvoid* Malloc(size_t size) {\n\t\tsize = (size + 3) & ~3;\t// Force aligning size to 4\n\n\t\tif (chunkHead_->size + size > chunkHead_->capacity)\n\t\t\tAddChunk(chunk_capacity_ > size ? chunk_capacity_ : size);\n\n\t\tchar *buffer = (char *)(chunkHead_ + 1) + chunkHead_->size;\n\t\tRAPIDJSON_ASSERT(((uintptr_t)buffer & 3) == 0);\t// returned buffer is aligned to 4\n\t\tchunkHead_->size += size;\n\n\t\treturn buffer;\n\t}\n\n\t//! Resizes a memory block (concept Allocator)\n\tvoid* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {\n\t\tif (originalPtr == 0)\n\t\t\treturn Malloc(newSize);\n\n\t\t// Do not shrink if new size is smaller than original\n\t\tif (originalSize >= newSize)\n\t\t\treturn originalPtr;\n\n\t\t// Simply expand it if it is the last allocation and there is sufficient space\n\t\tif (originalPtr == (char *)(chunkHead_ + 1) + chunkHead_->size - originalSize) {\n\t\t\tsize_t increment = newSize - originalSize;\n\t\t\tincrement = (increment + 3) & ~3;\t// Force aligning size to 4\n\t\t\tif (chunkHead_->size + increment <= chunkHead_->capacity) {\n\t\t\t\tchunkHead_->size += increment;\n\t\t\t\tRAPIDJSON_ASSERT(((uintptr_t)originalPtr & 3) == 0);\t// returned buffer is aligned to 4\n\t\t\t\treturn originalPtr;\n\t\t\t}\n\t\t}\n\n\t\t// Realloc process: allocate and copy memory, do not free original buffer.\n\t\tvoid* newBuffer = Malloc(newSize);\n\t\tRAPIDJSON_ASSERT(newBuffer != 0);\t// Do not handle out-of-memory explicitly.\n\t\treturn memcpy(newBuffer, originalPtr, originalSize);\n\t}\n\n\t//! Frees a memory block (concept Allocator)\n\tstatic void Free(void *) {} // Do nothing\n\nprivate:\n\t//! Creates a new chunk.\n\t/*! \\param capacity Capacity of the chunk in bytes.\n\t*/\n\tvoid AddChunk(size_t capacity) {\n\t\tChunkHeader* chunk = (ChunkHeader*)baseAllocator_->Malloc(sizeof(ChunkHeader) + capacity);\n\t\tchunk->capacity = capacity;\n\t\tchunk->size = 0;\n\t\tchunk->next = chunkHead_;\n\t\tchunkHead_ =  chunk;\n\t}\n\n\tstatic const int kDefaultChunkCapacity = 64 * 1024; //!< Default chunk capacity.\n\n\t//! Chunk header for perpending to each chunk.\n\t/*! Chunks are stored as a singly linked list.\n\t*/\n\tstruct ChunkHeader {\n\t\tsize_t capacity;\t//!< Capacity of the chunk in bytes (excluding the header itself).\n\t\tsize_t size;\t\t//!< Current size of allocated memory in bytes.\n\t\tChunkHeader *next;\t//!< Next chunk in the linked list.\n\t};\n\n\tChunkHeader *chunkHead_;\t//!< Head of the chunk linked-list. Only the head chunk serves allocation.\n\tsize_t chunk_capacity_;\t\t//!< The minimum capacity of chunk when they are allocated.\n\tchar *userBuffer_;\t\t\t//!< User supplied buffer.\n\tBaseAllocator* baseAllocator_;\t//!< base allocator for allocating memory chunks.\n\tBaseAllocator* ownBaseAllocator_;\t//!< base allocator created by this object.\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Encoding\n\n/*! \\class rapidjson::Encoding\n\t\\brief Concept for encoding of Unicode characters.\n\n\\code\nconcept Encoding {\n\ttypename Ch;\t//! Type of character.\n\n\t//! \\brief Encode a Unicode codepoint to a buffer.\n\t//! \\param buffer pointer to destination buffer to store the result. It should have sufficient size of encoding one character.\n\t//! \\param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively.\n\t//! \\returns the pointer to the next character after the encoded data.\n\tstatic Ch* Encode(Ch *buffer, unsigned codepoint);\n};\n\\endcode\n*/\n\n///////////////////////////////////////////////////////////////////////////////\n// UTF8\n\n//! UTF-8 encoding.\n/*! http://en.wikipedia.org/wiki/UTF-8\n\t\\tparam CharType Type for storing 8-bit UTF-8 data. Default is char.\n\t\\implements Encoding\n*/\ntemplate<typename CharType = char>\nstruct UTF8 {\n\ttypedef CharType Ch;\n\n\tstatic Ch* Encode(Ch *buffer, unsigned codepoint) {\n\t\tif (codepoint <= 0x7F) \n\t\t\t*buffer++ = codepoint & 0xFF;\n\t\telse if (codepoint <= 0x7FF) {\n\t\t\t*buffer++ = 0xC0 | ((codepoint >> 6) & 0xFF);\n\t\t\t*buffer++ = 0x80 | ((codepoint & 0x3F));\n\t\t}\n\t\telse if (codepoint <= 0xFFFF) {\n\t\t\t*buffer++ = 0xE0 | ((codepoint >> 12) & 0xFF);\n\t\t\t*buffer++ = 0x80 | ((codepoint >> 6) & 0x3F);\n\t\t\t*buffer++ = 0x80 | (codepoint & 0x3F);\n\t\t}\n\t\telse {\n\t\t\tRAPIDJSON_ASSERT(codepoint <= 0x10FFFF);\n\t\t\t*buffer++ = 0xF0 | ((codepoint >> 18) & 0xFF);\n\t\t\t*buffer++ = 0x80 | ((codepoint >> 12) & 0x3F);\n\t\t\t*buffer++ = 0x80 | ((codepoint >> 6) & 0x3F);\n\t\t\t*buffer++ = 0x80 | (codepoint & 0x3F);\n\t\t}\n\t\treturn buffer;\n\t}\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// UTF16\n\n//! UTF-16 encoding.\n/*! http://en.wikipedia.org/wiki/UTF-16\n\t\\tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead.\n\t\\implements Encoding\n*/\ntemplate<typename CharType = wchar_t>\nstruct UTF16 {\n\ttypedef CharType Ch;\n\n\tstatic Ch* Encode(Ch* buffer, unsigned codepoint) {\n\t\tif (codepoint <= 0xFFFF) {\n\t\t\tRAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair \n\t\t\t*buffer++ = static_cast<Ch>(codepoint);\n\t\t}\n\t\telse {\n\t\t\tRAPIDJSON_ASSERT(codepoint <= 0x10FFFF);\n\t\t\tunsigned v = codepoint - 0x10000;\n\t\t\t*buffer++ = static_cast<Ch>((v >> 10) + 0xD800);\n\t\t\t*buffer++ = (v & 0x3FF) + 0xDC00;\n\t\t}\n\t\treturn buffer;\n\t}\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// UTF32\n\n//! UTF-32 encoding. \n/*! http://en.wikipedia.org/wiki/UTF-32\n\t\\tparam Ch Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead.\n\t\\implements Encoding\n*/\ntemplate<typename CharType = unsigned>\nstruct UTF32 {\n\ttypedef CharType Ch;\n\n\tstatic Ch *Encode(Ch* buffer, unsigned codepoint) {\n\t\tRAPIDJSON_ASSERT(codepoint <= 0x10FFFF);\n\t\t*buffer++ = codepoint;\n\t\treturn buffer;\n\t}\n};\n\n///////////////////////////////////////////////////////////////////////////////\n//  Stream\n\n/*! \\class rapidjson::Stream\n\t\\brief Concept for reading and writing characters.\n\n\tFor read-only stream, no need to implement PutBegin(), Put() and PutEnd().\n\n\tFor write-only stream, only need to implement Put().\n\n\\code\nconcept Stream {\n\ttypename Ch;\t//!< Character type of the stream.\n\n\t//! Read the current character from stream without moving the read cursor.\n\tCh Peek() const;\n\n\t//! Read the current character from stream and moving the read cursor to next character.\n\tCh Take();\n\n\t//! Get the current read cursor.\n\t//! \\return Number of characters read from start.\n\tsize_t Tell();\n\n\t//! Begin writing operation at the current read pointer.\n\t//! \\return The begin writer pointer.\n\tCh* PutBegin();\n\n\t//! Write a character.\n\tvoid Put(Ch c);\n\n\t//! End the writing operation.\n\t//! \\param begin The begin write pointer returned by PutBegin().\n\t//! \\return Number of characters written.\n\tsize_t PutEnd(Ch* begin);\n}\n\\endcode\n*/\n\n//! Put N copies of a character to a stream.\ntemplate<typename Stream, typename Ch>\ninline void PutN(Stream& stream, Ch c, size_t n) {\n\tfor (size_t i = 0; i < n; i++)\n\t\tstream.Put(c);\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// StringStream\n\n//! Read-only string stream.\n/*! \\implements Stream\n*/\ntemplate <typename Encoding>\nstruct GenericStringStream {\n\ttypedef typename Encoding::Ch Ch;\n\n\tGenericStringStream(const Ch *src) : src_(src), head_(src) {}\n\n\tCh Peek() const { return *src_; }\n\tCh Take() { return *src_++; }\n\tsize_t Tell() const { return src_ - head_; }\n\n\tCh* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }\n\tvoid Put(Ch) { RAPIDJSON_ASSERT(false); }\n\tsize_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }\n\n\tconst Ch* src_;\t\t//!< Current read position.\n\tconst Ch* head_;\t//!< Original head of the string.\n};\n\ntypedef GenericStringStream<UTF8<> > StringStream;\n\n///////////////////////////////////////////////////////////////////////////////\n// InsituStringStream\n\n//! A read-write string stream.\n/*! This string stream is particularly designed for in-situ parsing.\n\t\\implements Stream\n*/\ntemplate <typename Encoding>\nstruct GenericInsituStringStream {\n\ttypedef typename Encoding::Ch Ch;\n\n\tGenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {}\n\n\t// Read\n\tCh Peek() { return *src_; }\n\tCh Take() { return *src_++; }\n\tsize_t Tell() { return src_ - head_; }\n\n\t// Write\n\tCh* PutBegin() { return dst_ = src_; }\n\tvoid Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; }\n\tsize_t PutEnd(Ch* begin) { return dst_ - begin; }\n\n\tCh* src_;\n\tCh* dst_;\n\tCh* head_;\n};\n\ntypedef GenericInsituStringStream<UTF8<> > InsituStringStream;\n\n///////////////////////////////////////////////////////////////////////////////\n// Type\n\n//! Type of JSON value\nenum Type {\n\tkNullType = 0,\t\t//!< null\n\tkFalseType = 1,\t\t//!< false\n\tkTrueType = 2,\t\t//!< true\n\tkObjectType = 3,\t//!< object\n\tkArrayType = 4,\t\t//!< array \n\tkStringType = 5,\t//!< string\n\tkNumberType = 6,\t//!< number\n};\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_RAPIDJSON_H_\n"
  },
  {
    "path": "cocos2d/external/json/reader.h",
    "content": "#ifndef RAPIDJSON_READER_H_\n#define RAPIDJSON_READER_H_\n\n// Copyright (c) 2011 Milo Yip (miloyip@gmail.com)\n// Version 0.1\n\n#include \"rapidjson.h\"\n#include \"internal/pow10.h\"\n#include \"internal/stack.h\"\n#include <csetjmp>\n\n#ifdef RAPIDJSON_SSE42\n#include <nmmintrin.h>\n#elif defined(RAPIDJSON_SSE2)\n#include <emmintrin.h>\n#endif\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4127) // conditional expression is constant\n#endif\n\n#ifndef RAPIDJSON_PARSE_ERROR\n#define RAPIDJSON_PARSE_ERROR(msg, offset) \\\n\tRAPIDJSON_MULTILINEMACRO_BEGIN \\\n\tparseError_ = msg; \\\n\terrorOffset_ = offset; \\\n\tlongjmp(jmpbuf_, 1); \\\n\tRAPIDJSON_MULTILINEMACRO_END\n#endif\n\nnamespace rapidjson {\n\n///////////////////////////////////////////////////////////////////////////////\n// ParseFlag\n\n//! Combination of parseFlags\nenum ParseFlag {\n\tkParseDefaultFlags = 0,\t\t\t//!< Default parse flags. Non-destructive parsing. Text strings are decoded into allocated buffer.\n\tkParseInsituFlag = 1\t\t\t//!< In-situ(destructive) parsing.\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Handler\n\n/*!\t\\class rapidjson::Handler\n\t\\brief Concept for receiving events from GenericReader upon parsing.\n\\code\nconcept Handler {\n\ttypename Ch;\n\n\tvoid Null();\n\tvoid Bool(bool b);\n\tvoid Int(int i);\n\tvoid Uint(unsigned i);\n\tvoid Int64(int64_t i);\n\tvoid Uint64(uint64_t i);\n\tvoid Double(double d);\n\tvoid String(const Ch* str, SizeType length, bool copy);\n\tvoid StartObject();\n\tvoid EndObject(SizeType memberCount);\n\tvoid StartArray();\n\tvoid EndArray(SizeType elementCount);\n};\n\\endcode\n*/\n///////////////////////////////////////////////////////////////////////////////\n// BaseReaderHandler\n\n//! Default implementation of Handler.\n/*! This can be used as base class of any reader handler.\n\t\\implements Handler\n*/\ntemplate<typename Encoding = UTF8<> >\nstruct BaseReaderHandler {\n\ttypedef typename Encoding::Ch Ch;\n\n\tvoid Default() {}\n\tvoid Null() { Default(); }\n\tvoid Bool(bool) { Default(); }\n\tvoid Int(int) { Default(); }\n\tvoid Uint(unsigned) { Default(); }\n\tvoid Int64(int64_t) { Default(); }\n\tvoid Uint64(uint64_t) { Default(); }\n\tvoid Double(double) { Default(); }\n\tvoid String(const Ch*, SizeType, bool) { Default(); }\n\tvoid StartObject() { Default(); }\n\tvoid EndObject(SizeType) { Default(); }\n\tvoid StartArray() { Default(); }\n\tvoid EndArray(SizeType) { Default(); }\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// SkipWhitespace\n\n//! Skip the JSON white spaces in a stream.\n/*! \\param stream A input stream for skipping white spaces.\n\t\\note This function has SSE2/SSE4.2 specialization.\n*/\ntemplate<typename Stream>\nvoid SkipWhitespace(Stream& stream) {\n\tStream s = stream;\t// Use a local copy for optimization\n\twhile (s.Peek() == ' ' || s.Peek() == '\\n' || s.Peek() == '\\r' || s.Peek() == '\\t')\n\t\ts.Take();\n\tstream = s;\n}\n\n#ifdef RAPIDJSON_SSE42\n//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once.\ninline const char *SkipWhitespace_SIMD(const char* p) {\n\tstatic const char whitespace[16] = \" \\n\\r\\t\";\n\t__m128i w = _mm_loadu_si128((const __m128i *)&whitespace[0]);\n\n\tfor (;;) {\n\t\t__m128i s = _mm_loadu_si128((const __m128i *)p);\n\t\tunsigned r = _mm_cvtsi128_si32(_mm_cmpistrm(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_BIT_MASK | _SIDD_NEGATIVE_POLARITY));\n\t\tif (r == 0)\t// all 16 characters are whitespace\n\t\t\tp += 16;\n\t\telse {\t\t// some of characters may be non-whitespace\n#ifdef _MSC_VER\t\t// Find the index of first non-whitespace\n\t\t\tunsigned long offset;\n\t\t\tif (_BitScanForward(&offset, r))\n\t\t\t\treturn p + offset;\n#else\n\t\t\tif (r != 0)\n\t\t\t\treturn p + __builtin_ffs(r) - 1;\n#endif\n\t\t}\n\t}\n}\n\n#elif defined(RAPIDJSON_SSE2)\n\n//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once.\ninline const char *SkipWhitespace_SIMD(const char* p) {\n\tstatic const char whitespaces[4][17] = {\n\t\t\"                \",\n\t\t\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\n\t\t\"\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\\r\",\n\t\t\"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\"};\n\n\t__m128i w0 = _mm_loadu_si128((const __m128i *)&whitespaces[0][0]);\n\t__m128i w1 = _mm_loadu_si128((const __m128i *)&whitespaces[1][0]);\n\t__m128i w2 = _mm_loadu_si128((const __m128i *)&whitespaces[2][0]);\n\t__m128i w3 = _mm_loadu_si128((const __m128i *)&whitespaces[3][0]);\n\n\tfor (;;) {\n\t\t__m128i s = _mm_loadu_si128((const __m128i *)p);\n\t\t__m128i x = _mm_cmpeq_epi8(s, w0);\n\t\tx = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1));\n\t\tx = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2));\n\t\tx = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3));\n\t\tunsigned short r = ~_mm_movemask_epi8(x);\n\t\tif (r == 0)\t// all 16 characters are whitespace\n\t\t\tp += 16;\n\t\telse {\t\t// some of characters may be non-whitespace\n#ifdef _MSC_VER\t\t// Find the index of first non-whitespace\n\t\t\tunsigned long offset;\n\t\t\tif (_BitScanForward(&offset, r))\n\t\t\t\treturn p + offset;\n#else\n\t\t\tif (r != 0)\n\t\t\t\treturn p + __builtin_ffs(r) - 1;\n#endif\n\t\t}\n\t}\n}\n\n#endif // RAPIDJSON_SSE2\n\n#ifdef RAPIDJSON_SIMD\n//! Template function specialization for InsituStringStream\ntemplate<> inline void SkipWhitespace(InsituStringStream& stream) { \n\tstream.src_ = const_cast<char*>(SkipWhitespace_SIMD(stream.src_));\n}\n\n//! Template function specialization for StringStream\ntemplate<> inline void SkipWhitespace(StringStream& stream) {\n\tstream.src_ = SkipWhitespace_SIMD(stream.src_);\n}\n#endif // RAPIDJSON_SIMD\n\n///////////////////////////////////////////////////////////////////////////////\n// GenericReader\n\n//! SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.\n/*! GenericReader parses JSON text from a stream, and send events synchronously to an \n    object implementing Handler concept.\n\n    It needs to allocate a stack for storing a single decoded string during \n    non-destructive parsing.\n\n    For in-situ parsing, the decoded string is directly written to the source \n    text string, no temporary buffer is required.\n\n    A GenericReader object can be reused for parsing multiple JSON text.\n    \n    \\tparam Encoding Encoding of both the stream and the parse output.\n    \\tparam Allocator Allocator type for stack.\n*/\ntemplate <typename Encoding, typename Allocator = MemoryPoolAllocator<> >\nclass GenericReader {\npublic:\n\ttypedef typename Encoding::Ch Ch;\n\n\t//! Constructor.\n\t/*! \\param allocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing)\n\t\t\\param stackCapacity stack capacity in bytes for storing a single decoded string.  (Only use for non-destructive parsing)\n\t*/\n\tGenericReader(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity) : stack_(allocator, stackCapacity), parseError_(0), errorOffset_(0) {}\n\n\t//! Parse JSON text.\n\t/*! \\tparam parseFlags Combination of ParseFlag. \n\t\t \\tparam Stream Type of input stream.\n\t\t \\tparam Handler Type of handler which must implement Handler concept.\n\t\t \\param stream Input stream to be parsed.\n\t\t \\param handler The handler to receive events.\n\t\t \\return Whether the parsing is successful.\n\t*/\n\ttemplate <unsigned parseFlags, typename Stream, typename Handler>\n\tbool Parse(Stream& stream, Handler& handler) {\n\t\tparseError_ = 0;\n\t\terrorOffset_ = 0;\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable\n#endif\n\t\tif (setjmp(jmpbuf_)) {\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\t\t\tstack_.Clear();\n\t\t\treturn false;\n\t\t}\n\n\t\tSkipWhitespace(stream);\n\n\t\tif (stream.Peek() == '\\0')\n\t\t\tRAPIDJSON_PARSE_ERROR(\"Text only contains white space(s)\", stream.Tell());\n\t\telse {\n\t\t\tswitch (stream.Peek()) {\n\t\t\t\tcase '{': ParseObject<parseFlags>(stream, handler); break;\n\t\t\t\tcase '[': ParseArray<parseFlags>(stream, handler); break;\n\t\t\t\tdefault: RAPIDJSON_PARSE_ERROR(\"Expect either an object or array at root\", stream.Tell());\n\t\t\t}\n\t\t\tSkipWhitespace(stream);\n\n\t\t\tif (stream.Peek() != '\\0')\n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Nothing should follow the root object or array.\", stream.Tell());\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tbool HasParseError() const { return parseError_ != 0; }\n\tconst char* GetParseError() const { return parseError_; }\n\tsize_t GetErrorOffset() const { return errorOffset_; }\n\nprivate:\n\t// Parse object: { string : value, ... }\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseObject(Stream& stream, Handler& handler) {\n\t\tRAPIDJSON_ASSERT(stream.Peek() == '{');\n\t\tstream.Take();\t// Skip '{'\n\t\thandler.StartObject();\n\t\tSkipWhitespace(stream);\n\n\t\tif (stream.Peek() == '}') {\n\t\t\tstream.Take();\n\t\t\thandler.EndObject(0);\t// empty object\n\t\t\treturn;\n\t\t}\n\n\t\tfor (SizeType memberCount = 0;;) {\n\t\t\tif (stream.Peek() != '\"') {\n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Name of an object member must be a string\", stream.Tell());\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tParseString<parseFlags>(stream, handler);\n\t\t\tSkipWhitespace(stream);\n\n\t\t\tif (stream.Take() != ':') {\n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"There must be a colon after the name of object member\", stream.Tell());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tSkipWhitespace(stream);\n\n\t\t\tParseValue<parseFlags>(stream, handler);\n\t\t\tSkipWhitespace(stream);\n\n\t\t\t++memberCount;\n\n\t\t\tswitch(stream.Take()) {\n\t\t\t\tcase ',': SkipWhitespace(stream); break;\n\t\t\t\tcase '}': handler.EndObject(memberCount); return;\n\t\t\t\tdefault:  RAPIDJSON_PARSE_ERROR(\"Must be a comma or '}' after an object member\", stream.Tell());\n\t\t\t}\n\t\t}\n\t}\n\n\t// Parse array: [ value, ... ]\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseArray(Stream& stream, Handler& handler) {\n\t\tRAPIDJSON_ASSERT(stream.Peek() == '[');\n\t\tstream.Take();\t// Skip '['\n\t\thandler.StartArray();\n\t\tSkipWhitespace(stream);\n\n\t\tif (stream.Peek() == ']') {\n\t\t\tstream.Take();\n\t\t\thandler.EndArray(0); // empty array\n\t\t\treturn;\n\t\t}\n\n\t\tfor (SizeType elementCount = 0;;) {\n\t\t\tParseValue<parseFlags>(stream, handler);\n\t\t\t++elementCount;\n\t\t\tSkipWhitespace(stream);\n\n\t\t\tswitch (stream.Take()) {\n\t\t\t\tcase ',': SkipWhitespace(stream); break;\n\t\t\t\tcase ']': handler.EndArray(elementCount); return;\n\t\t\t\tdefault:  RAPIDJSON_PARSE_ERROR(\"Must be a comma or ']' after an array element.\", stream.Tell());\n\t\t\t}\n\t\t}\n\t}\n\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseNull(Stream& stream, Handler& handler) {\n\t\tRAPIDJSON_ASSERT(stream.Peek() == 'n');\n\t\tstream.Take();\n\n\t\tif (stream.Take() == 'u' && stream.Take() == 'l' && stream.Take() == 'l')\n\t\t\thandler.Null();\n\t\telse\n\t\t\tRAPIDJSON_PARSE_ERROR(\"Invalid value\", stream.Tell() - 1);\n\t}\n\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseTrue(Stream& stream, Handler& handler) {\n\t\tRAPIDJSON_ASSERT(stream.Peek() == 't');\n\t\tstream.Take();\n\n\t\tif (stream.Take() == 'r' && stream.Take() == 'u' && stream.Take() == 'e')\n\t\t\thandler.Bool(true);\n\t\telse\n\t\t\tRAPIDJSON_PARSE_ERROR(\"Invalid value\", stream.Tell());\n\t}\n\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseFalse(Stream& stream, Handler& handler) {\n\t\tRAPIDJSON_ASSERT(stream.Peek() == 'f');\n\t\tstream.Take();\n\n\t\tif (stream.Take() == 'a' && stream.Take() == 'l' && stream.Take() == 's' && stream.Take() == 'e')\n\t\t\thandler.Bool(false);\n\t\telse\n\t\t\tRAPIDJSON_PARSE_ERROR(\"Invalid value\", stream.Tell() - 1);\n\t}\n\n\t// Helper function to parse four hexidecimal digits in \\uXXXX in ParseString().\n\ttemplate<typename Stream>\n\tunsigned ParseHex4(Stream& stream) {\n\t\tStream s = stream;\t// Use a local copy for optimization\n\t\tunsigned codepoint = 0;\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tCh c = s.Take();\n\t\t\tcodepoint <<= 4;\n\t\t\tcodepoint += c;\n\t\t\tif (c >= '0' && c <= '9')\n\t\t\t\tcodepoint -= '0';\n\t\t\telse if (c >= 'A' && c <= 'F')\n\t\t\t\tcodepoint -= 'A' - 10;\n\t\t\telse if (c >= 'a' && c <= 'f')\n\t\t\t\tcodepoint -= 'a' - 10;\n\t\t\telse \n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Incorrect hex digit after \\\\u escape\", s.Tell() - 1);\n\t\t}\n\t\tstream = s; // Restore stream\n\t\treturn codepoint;\n\t}\n\n\t// Parse string, handling the prefix and suffix double quotes and escaping.\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseString(Stream& stream, Handler& handler) {\n#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\tstatic const Ch escape[256] = {\n\t\t\tZ16, Z16, 0, 0,'\\\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'/', \n\t\t\tZ16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\\\', 0, 0, 0, \n\t\t\t0, 0,'\\b', 0, 0, 0,'\\f', 0, 0, 0, 0, 0, 0, 0,'\\n', 0, \n\t\t\t0, 0,'\\r', 0,'\\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \n\t\t\tZ16, Z16, Z16, Z16, Z16, Z16, Z16, Z16\n\t\t};\n#undef Z16\n\n\t\tStream s = stream;\t// Use a local copy for optimization\n\t\tRAPIDJSON_ASSERT(s.Peek() == '\\\"');\n\t\ts.Take();\t// Skip '\\\"'\n\t\tCh *head;\n\t\tSizeType len;\n\t\tif (parseFlags & kParseInsituFlag)\n\t\t\thead = s.PutBegin();\n\t\telse\n\t\t\tlen = 0;\n\n#define RAPIDJSON_PUT(x) \\\n\tdo { \\\n\t\tif (parseFlags & kParseInsituFlag) \\\n\t\t\ts.Put(x); \\\n\t\telse { \\\n\t\t\t*stack_.template Push<Ch>() = x; \\\n\t\t\t++len; \\\n\t\t} \\\n\t} while(false)\n\n\t\tfor (;;) {\n\t\t\tCh c = s.Take();\n\t\t\tif (c == '\\\\') {\t// Escape\n\t\t\t\tCh e = s.Take();\n\t\t\t\tif ((sizeof(Ch) == 1 || e < 256) && escape[(unsigned char)e])\n\t\t\t\t\tRAPIDJSON_PUT(escape[(unsigned char)e]);\n\t\t\t\telse if (e == 'u') {\t// Unicode\n\t\t\t\t\tunsigned codepoint = ParseHex4(s);\n\t\t\t\t\tif (codepoint >= 0xD800 && codepoint <= 0xDBFF) { // Handle UTF-16 surrogate pair\n\t\t\t\t\t\tif (s.Take() != '\\\\' || s.Take() != 'u') {\n\t\t\t\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Missing the second \\\\u in surrogate pair\", s.Tell() - 2);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunsigned codepoint2 = ParseHex4(s);\n\t\t\t\t\t\tif (codepoint2 < 0xDC00 || codepoint2 > 0xDFFF) {\n\t\t\t\t\t\t\tRAPIDJSON_PARSE_ERROR(\"The second \\\\u in surrogate pair is invalid\", s.Tell() - 2);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcodepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000;\n\t\t\t\t\t}\n\n\t\t\t\t\tCh buffer[4];\n\t\t\t\t\tSizeType count = SizeType(Encoding::Encode(buffer, codepoint) - &buffer[0]);\n\n\t\t\t\t\tif (parseFlags & kParseInsituFlag) \n\t\t\t\t\t\tfor (SizeType i = 0; i < count; i++)\n\t\t\t\t\t\t\ts.Put(buffer[i]);\n\t\t\t\t\telse {\n\t\t\t\t\t\tmemcpy(stack_.template Push<Ch>(count), buffer, count * sizeof(Ch));\n\t\t\t\t\t\tlen += count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Unknown escape character\", stream.Tell() - 1);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (c == '\"') {\t// Closing double quote\n\t\t\t\tif (parseFlags & kParseInsituFlag) {\n\t\t\t\t\tsize_t length = s.PutEnd(head);\n\t\t\t\t\tRAPIDJSON_ASSERT(length <= 0xFFFFFFFF);\n\t\t\t\t\tRAPIDJSON_PUT('\\0');\t// null-terminate the string\n\t\t\t\t\thandler.String(head, SizeType(length), false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tRAPIDJSON_PUT('\\0');\n\t\t\t\t\thandler.String(stack_.template Pop<Ch>(len), len - 1, true);\n\t\t\t\t}\n\t\t\t\tstream = s;\t// restore stream\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (c == '\\0') {\n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"lacks ending quotation before the end of string\", stream.Tell() - 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if ((unsigned)c < 0x20) {\t// RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF\n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Incorrect unescaped character in string\", stream.Tell() - 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t\tRAPIDJSON_PUT(c);\t// Normal character, just copy\n\t\t}\n#undef RAPIDJSON_PUT\n\t}\n\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseNumber(Stream& stream, Handler& handler) {\n\t\tStream s = stream; // Local copy for optimization\n\t\t// Parse minus\n\t\tbool minus = false;\n\t\tif (s.Peek() == '-') {\n\t\t\tminus = true;\n\t\t\ts.Take();\n\t\t}\n\n\t\t// Parse int: zero / ( digit1-9 *DIGIT )\n\t\tunsigned i;\n\t\tbool try64bit = false;\n\t\tif (s.Peek() == '0') {\n\t\t\ti = 0;\n\t\t\ts.Take();\n\t\t}\n\t\telse if (s.Peek() >= '1' && s.Peek() <= '9') {\n\t\t\ti = s.Take() - '0';\n\n\t\t\tif (minus)\n\t\t\t\twhile (s.Peek() >= '0' && s.Peek() <= '9') {\n\t\t\t\t\tif (i >= 214748364) { // 2^31 = 2147483648\n\t\t\t\t\t\tif (i != 214748364 || s.Peek() > '8') {\n\t\t\t\t\t\t\ttry64bit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ti = i * 10 + (s.Take() - '0');\n\t\t\t\t}\n\t\t\telse\n\t\t\t\twhile (s.Peek() >= '0' && s.Peek() <= '9') {\n\t\t\t\t\tif (i >= 429496729) { // 2^32 - 1 = 4294967295\n\t\t\t\t\t\tif (i != 429496729 || s.Peek() > '5') {\n\t\t\t\t\t\t\ttry64bit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ti = i * 10 + (s.Take() - '0');\n\t\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tRAPIDJSON_PARSE_ERROR(\"Expect a value here.\", stream.Tell());\n\t\t\treturn;\n\t\t}\n\n\t\t// Parse 64bit int\n\t\tuint64_t i64 = 0;\n\t\tbool useDouble = false;\n\t\tif (try64bit) {\n\t\t\ti64 = i;\n\t\t\tif (minus) \n\t\t\t\twhile (s.Peek() >= '0' && s.Peek() <= '9') {\t\t\t\t\t\n\t\t\t\t\tif (i64 >= 922337203685477580uLL) // 2^63 = 9223372036854775808\n\t\t\t\t\t\tif (i64 != 922337203685477580uLL || s.Peek() > '8') {\n\t\t\t\t\t\t\tuseDouble = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\ti64 = i64 * 10 + (s.Take() - '0');\n\t\t\t\t}\n\t\t\telse\n\t\t\t\twhile (s.Peek() >= '0' && s.Peek() <= '9') {\t\t\t\t\t\n\t\t\t\t\tif (i64 >= 1844674407370955161uLL) // 2^64 - 1 = 18446744073709551615\n\t\t\t\t\t\tif (i64 != 1844674407370955161uLL || s.Peek() > '5') {\n\t\t\t\t\t\t\tuseDouble = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\ti64 = i64 * 10 + (s.Take() - '0');\n\t\t\t\t}\n\t\t}\n\n\t\t// Force double for big integer\n\t\tdouble d = 0.0;\n\t\tif (useDouble) {\n\t\t\td = (double)i64;\n\t\t\twhile (s.Peek() >= '0' && s.Peek() <= '9') {\n\t\t\t\tif (d >= 1E307) {\n\t\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Number too big to store in double\", stream.Tell());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\td = d * 10 + (s.Take() - '0');\n\t\t\t}\n\t\t}\n\n\t\t// Parse frac = decimal-point 1*DIGIT\n\t\tint expFrac = 0;\n\t\tif (s.Peek() == '.') {\n\t\t\tif (!useDouble) {\n\t\t\t\td = try64bit ? (double)i64 : (double)i;\n\t\t\t\tuseDouble = true;\n\t\t\t}\n\t\t\ts.Take();\n\n\t\t\tif (s.Peek() >= '0' && s.Peek() <= '9') {\n\t\t\t\td = d * 10 + (s.Take() - '0');\n\t\t\t\t--expFrac;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"At least one digit in fraction part\", stream.Tell());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhile (s.Peek() >= '0' && s.Peek() <= '9') {\n\t\t\t\tif (expFrac > -16) {\n\t\t\t\t\td = d * 10 + (s.Peek() - '0');\n\t\t\t\t\t--expFrac;\n\t\t\t\t}\n\t\t\t\ts.Take();\n\t\t\t}\n\t\t}\n\n\t\t// Parse exp = e [ minus / plus ] 1*DIGIT\n\t\tint exp = 0;\n\t\tif (s.Peek() == 'e' || s.Peek() == 'E') {\n\t\t\tif (!useDouble) {\n\t\t\t\td = try64bit ? (double)i64 : (double)i;\n\t\t\t\tuseDouble = true;\n\t\t\t}\n\t\t\ts.Take();\n\n\t\t\tbool expMinus = false;\n\t\t\tif (s.Peek() == '+')\n\t\t\t\ts.Take();\n\t\t\telse if (s.Peek() == '-') {\n\t\t\t\ts.Take();\n\t\t\t\texpMinus = true;\n\t\t\t}\n\n\t\t\tif (s.Peek() >= '0' && s.Peek() <= '9') {\n\t\t\t\texp = s.Take() - '0';\n\t\t\t\twhile (s.Peek() >= '0' && s.Peek() <= '9') {\n\t\t\t\t\texp = exp * 10 + (s.Take() - '0');\n\t\t\t\t\tif (exp > 308) {\n\t\t\t\t\t\tRAPIDJSON_PARSE_ERROR(\"Number too big to store in double\", stream.Tell());\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tRAPIDJSON_PARSE_ERROR(\"At least one digit in exponent\", s.Tell());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (expMinus)\n\t\t\t\texp = -exp;\n\t\t}\n\n\t\t// Finish parsing, call event according to the type of number.\n\t\tif (useDouble) {\n\t\t\td *= internal::Pow10(exp + expFrac);\n\t\t\thandler.Double(minus ? -d : d);\n\t\t}\n\t\telse {\n\t\t\tif (try64bit) {\n\t\t\t\tif (minus)\n\t\t\t\t\thandler.Int64(-(int64_t)i64);\n\t\t\t\telse\n\t\t\t\t\thandler.Uint64(i64);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (minus)\n\t\t\t\t\thandler.Int(-(int)i);\n\t\t\t\telse\n\t\t\t\t\thandler.Uint(i);\n\t\t\t}\n\t\t}\n\n\t\tstream = s; // restore stream\n\t}\n\n\t// Parse any JSON value\n\ttemplate<unsigned parseFlags, typename Stream, typename Handler>\n\tvoid ParseValue(Stream& stream, Handler& handler) {\n\t\tswitch (stream.Peek()) {\n\t\t\tcase 'n': ParseNull  <parseFlags>(stream, handler); break;\n\t\t\tcase 't': ParseTrue  <parseFlags>(stream, handler); break;\n\t\t\tcase 'f': ParseFalse <parseFlags>(stream, handler); break;\n\t\t\tcase '\"': ParseString<parseFlags>(stream, handler); break;\n\t\t\tcase '{': ParseObject<parseFlags>(stream, handler); break;\n\t\t\tcase '[': ParseArray <parseFlags>(stream, handler); break;\n\t\t\tdefault : ParseNumber<parseFlags>(stream, handler);\n\t\t}\n\t}\n\n\tstatic const size_t kDefaultStackCapacity = 256;\t//!< Default stack capacity in bytes for storing a single decoded string. \n\tinternal::Stack<Allocator> stack_;\t//!< A stack for storing decoded string temporarily during non-destructive parsing.\n\tjmp_buf jmpbuf_;\t\t\t\t\t//!< setjmp buffer for fast exit from nested parsing function calls.\n\tconst char* parseError_;\n\tsize_t errorOffset_;\n}; // class GenericReader\n\n//! Reader with UTF8 encoding and default allocator.\ntypedef GenericReader<UTF8<> > Reader;\n\n} // namespace rapidjson\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif // RAPIDJSON_READER_H_\n"
  },
  {
    "path": "cocos2d/external/json/stringbuffer.h",
    "content": "#ifndef RAPIDJSON_STRINGBUFFER_H_\n#define RAPIDJSON_STRINGBUFFER_H_\n\n#include \"rapidjson.h\"\n#include \"internal/stack.h\"\n\nnamespace rapidjson {\n\n//! Represents an in-memory output stream.\n/*!\n\t\\tparam Encoding Encoding of the stream.\n\t\\tparam Allocator type for allocating memory buffer.\n\t\\implements Stream\n*/\ntemplate <typename Encoding, typename Allocator = CrtAllocator>\nstruct GenericStringBuffer {\n\ttypedef typename Encoding::Ch Ch;\n\n\tGenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}\n\n\tvoid Put(Ch c) { *stack_.template Push<Ch>() = c; }\n\n\tvoid Clear() { stack_.Clear(); }\n\n\tconst char* GetString() const {\n\t\t// Push and pop a null terminator. This is safe.\n\t\t*stack_.template Push<Ch>() = '\\0';\n\t\tstack_.template Pop<Ch>(1);\n\n\t\treturn stack_.template Bottom<Ch>();\n\t}\n\n\tsize_t Size() const { return stack_.GetSize(); }\n\n\tstatic const size_t kDefaultCapacity = 256;\n\tmutable internal::Stack<Allocator> stack_;\n};\n\ntypedef GenericStringBuffer<UTF8<> > StringBuffer;\n\n//! Implement specialized version of PutN() with memset() for better performance.\ntemplate<>\ninline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {\n\tmemset(stream.stack_.Push<char>(n), c, n * sizeof(c));\n}\n\n} // namespace rapidjson\n\n#endif // RAPIDJSON_STRINGBUFFER_H_\n"
  },
  {
    "path": "cocos2d/external/json/writer.h",
    "content": "#ifndef RAPIDJSON_WRITER_H_\n#define RAPIDJSON_WRITER_H_\n\n#include \"rapidjson.h\"\n#include \"internal/stack.h\"\n#include \"internal/strfunc.h\"\n#include <cstdio>\t// snprintf() or _sprintf_s()\n#include <new>\t\t// placement new\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4127) // conditional expression is constant\n#endif\n\nnamespace rapidjson {\n\n//! JSON writer\n/*! Writer implements the concept Handler.\n\tIt generates JSON text by events to an output stream.\n\n\tUser may programmatically calls the functions of a writer to generate JSON text.\n\n\tOn the other side, a writer can also be passed to objects that generates events, \n\n\tfor example Reader::Parse() and Document::Accept().\n\n\t\\tparam Stream Type of ouptut stream.\n\t\\tparam Encoding Encoding of both source strings and output.\n\t\\implements Handler\n*/\ntemplate<typename Stream, typename Encoding = UTF8<>, typename Allocator = MemoryPoolAllocator<> >\nclass Writer {\npublic:\n\ttypedef typename Encoding::Ch Ch;\n\n\tWriter(Stream& stream, Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) : \n\t\tstream_(stream), level_stack_(allocator, levelDepth * sizeof(Level)) {}\n\n\t//@name Implementation of Handler\n\t//@{\n\tWriter& Null()\t\t\t\t\t{ Prefix(kNullType);   WriteNull();\t\t\treturn *this; }\n\tWriter& Bool(bool b)\t\t\t{ Prefix(b ? kTrueType : kFalseType); WriteBool(b); return *this; }\n\tWriter& Int(int i)\t\t\t\t{ Prefix(kNumberType); WriteInt(i);\t\t\treturn *this; }\n\tWriter& Uint(unsigned u)\t\t{ Prefix(kNumberType); WriteUint(u);\t\treturn *this; }\n\tWriter& Int64(int64_t i64)\t\t{ Prefix(kNumberType); WriteInt64(i64);\t\treturn *this; }\n\tWriter& Uint64(uint64_t u64)\t{ Prefix(kNumberType); WriteUint64(u64);\treturn *this; }\n\tWriter& Double(double d)\t\t{ Prefix(kNumberType); WriteDouble(d);\t\treturn *this; }\n\n\tWriter& String(const Ch* str, SizeType length, bool copy = false) {\n\t\t(void)copy;\n\t\tPrefix(kStringType);\n\t\tWriteString(str, length);\n\t\treturn *this;\n\t}\n\n\tWriter& StartObject() {\n\t\tPrefix(kObjectType);\n\t\tnew (level_stack_.template Push<Level>()) Level(false);\n\t\tWriteStartObject();\n\t\treturn *this;\n\t}\n\n\tWriter& EndObject(SizeType memberCount = 0) {\n\t\t(void)memberCount;\n\t\tRAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));\n\t\tRAPIDJSON_ASSERT(!level_stack_.template Top<Level>()->inArray);\n\t\tlevel_stack_.template Pop<Level>(1);\n\t\tWriteEndObject();\n\t\treturn *this;\n\t}\n\n\tWriter& StartArray() {\n\t\tPrefix(kArrayType);\n\t\tnew (level_stack_.template Push<Level>()) Level(true);\n\t\tWriteStartArray();\n\t\treturn *this;\n\t}\n\n\tWriter& EndArray(SizeType elementCount = 0) {\n\t\t(void)elementCount;\n\t\tRAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));\n\t\tRAPIDJSON_ASSERT(level_stack_.template Top<Level>()->inArray);\n\t\tlevel_stack_.template Pop<Level>(1);\n\t\tWriteEndArray();\n\t\treturn *this;\n\t}\n\t//@}\n\n\t//! Simpler but slower overload.\n\tWriter& String(const Ch* str) { return String(str, internal::StrLen(str)); }\n\nprotected:\n\t//! Information for each nested level\n\tstruct Level {\n\t\tLevel(bool inArray_) : inArray(inArray_), valueCount(0) {}\n\t\tbool inArray;\t\t//!< true if in array, otherwise in object\n\t\tsize_t valueCount;\t//!< number of values in this level\n\t};\n\n\tstatic const size_t kDefaultLevelDepth = 32;\n\n\tvoid WriteNull()  {\n\t\tstream_.Put('n'); stream_.Put('u'); stream_.Put('l'); stream_.Put('l');\n\t}\n\n\tvoid WriteBool(bool b)  {\n\t\tif (b) {\n\t\t\tstream_.Put('t'); stream_.Put('r'); stream_.Put('u'); stream_.Put('e');\n\t\t}\n\t\telse {\n\t\t\tstream_.Put('f'); stream_.Put('a'); stream_.Put('l'); stream_.Put('s'); stream_.Put('e');\n\t\t}\n\t}\n\n\tvoid WriteInt(int i) {\n\t\tif (i < 0) {\n\t\t\tstream_.Put('-');\n\t\t\ti = -i;\n\t\t}\n\t\tWriteUint((unsigned)i);\n\t}\n\n\tvoid WriteUint(unsigned u) {\n\t\tchar buffer[10];\n\t\tchar *p = buffer;\n\t\tdo {\n\t\t\t*p++ = (u % 10) + '0';\n\t\t\tu /= 10;\n\t\t} while (u > 0);\n\n\t\tdo {\n\t\t\t--p;\n\t\t\tstream_.Put(*p);\n\t\t} while (p != buffer);\n\t}\n\n\tvoid WriteInt64(int64_t i64) {\n\t\tif (i64 < 0) {\n\t\t\tstream_.Put('-');\n\t\t\ti64 = -i64;\n\t\t}\n\t\tWriteUint64((uint64_t)i64);\n\t}\n\n\tvoid WriteUint64(uint64_t u64) {\n\t\tchar buffer[20];\n\t\tchar *p = buffer;\n\t\tdo {\n\t\t\t*p++ = char(u64 % 10) + '0';\n\t\t\tu64 /= 10;\n\t\t} while (u64 > 0);\n\n\t\tdo {\n\t\t\t--p;\n\t\t\tstream_.Put(*p);\n\t\t} while (p != buffer);\n\t}\n\n\t//! \\todo Optimization with custom double-to-string converter.\n\tvoid WriteDouble(double d) {\n\t\tchar buffer[100];\n#if _MSC_VER\n\t\tint ret = sprintf_s(buffer, sizeof(buffer), \"%g\", d);\n#else\n\t\tint ret = snprintf(buffer, sizeof(buffer), \"%g\", d);\n#endif\n\t\tRAPIDJSON_ASSERT(ret >= 1);\n\t\tfor (int i = 0; i < ret; i++)\n\t\t\tstream_.Put(buffer[i]);\n\t}\n\n\tvoid WriteString(const Ch* str, SizeType length)  {\n\t\tstatic const char hexDigits[] = \"0123456789ABCDEF\";\n\t\tstatic const char escape[256] = {\n#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t\t\t//0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F\n\t\t\t'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00\n\t\t\t'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10\n\t\t\t  0,   0, '\"',   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, // 20\n\t\t\tZ16, Z16,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 30~4F\n\t\t\t  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,'\\\\',   0,   0,   0, // 50\n\t\t\tZ16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16\t\t\t\t\t\t\t\t// 60~FF\n#undef Z16\n\t\t};\n\n\t\tstream_.Put('\\\"');\n\t\tfor (const Ch* p = str; p != str + length; ++p) {\n\t\t\tif ((sizeof(Ch) == 1 || *p < 256) && escape[(unsigned char)*p])  {\n\t\t\t\tstream_.Put('\\\\');\n\t\t\t\tstream_.Put(escape[(unsigned char)*p]);\n\t\t\t\tif (escape[(unsigned char)*p] == 'u') {\n\t\t\t\t\tstream_.Put('0');\n\t\t\t\t\tstream_.Put('0');\n\t\t\t\t\tstream_.Put(hexDigits[(*p) >> 4]);\n\t\t\t\t\tstream_.Put(hexDigits[(*p) & 0xF]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tstream_.Put(*p);\n\t\t}\n\t\tstream_.Put('\\\"');\n\t}\n\n\tvoid WriteStartObject()\t{ stream_.Put('{'); }\n\tvoid WriteEndObject()\t{ stream_.Put('}'); }\n\tvoid WriteStartArray()\t{ stream_.Put('['); }\n\tvoid WriteEndArray()\t{ stream_.Put(']'); }\n\n\tvoid Prefix(Type type) {\n\t\t(void)type;\n\t\tif (level_stack_.GetSize() != 0) { // this value is not at root\n\t\t\tLevel* level = level_stack_.template Top<Level>();\n\t\t\tif (level->valueCount > 0) {\n\t\t\t\tif (level->inArray) \n\t\t\t\t\tstream_.Put(','); // add comma if it is not the first element in array\n\t\t\t\telse  // in object\n\t\t\t\t\tstream_.Put((level->valueCount % 2 == 0) ? ',' : ':');\n\t\t\t}\n\t\t\tif (!level->inArray && level->valueCount % 2 == 0)\n\t\t\t\tRAPIDJSON_ASSERT(type == kStringType);  // if it's in object, then even number should be a name\n\t\t\tlevel->valueCount++;\n\t\t}\n\t\telse\n\t\t\tRAPIDJSON_ASSERT(type == kObjectType || type == kArrayType);\n\t}\n\n\tStream& stream_;\n\tinternal::Stack<Allocator> level_stack_;\n\nprivate:\n\t// Prohibit assignment for VC C4512 warning\n\tWriter& operator=(const Writer& w);\n};\n\n} // namespace rapidjson\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif // RAPIDJSON_RAPIDJSON_H_\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmod.h",
    "content": "/*$ preserve start $*/\n\n/* ============================================================================================ */\n/* FMOD Ex - Main C/C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */\n/*                                                                                              */\n/* This header is the base header for all other FMOD headers.  If you are programming in C      */\n/* use this exclusively, or if you are programming C++ use this in conjunction with FMOD.HPP    */\n/*                                                                                              */\n/* ============================================================================================ */\n\n#ifndef _FMOD_H\n#define _FMOD_H\n\n/*\n    FMOD version number.  Check this against FMOD::System::getVersion.\n    0xaaaabbcc -> aaaa = major version number.  bb = minor version number.  cc = development version number.\n*/\n\n#define FMOD_VERSION    0x00043601\n\n/*\n    Compiler specific settings.\n*/\n\n#if defined(__CYGWIN32__)\n    #define F_CDECL __cdecl\n    #define F_STDCALL __stdcall\n    #define F_DECLSPEC __declspec\n    #define F_DLLEXPORT ( dllexport )\n#elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(_XBOX))\n    #define F_CDECL _cdecl\n    #define F_STDCALL _stdcall\n    #define F_DECLSPEC __declspec\n    #define F_DLLEXPORT ( dllexport )\n#elif defined(__MACH__) || defined (__ANDROID__)\n    #define F_CDECL\n    #define F_STDCALL\n    #define F_DECLSPEC\n    #define F_DLLEXPORT __attribute__ ((visibility(\"default\")))\n#else\n    #define F_STDCALL\n    #define F_CDECL\n    #define F_DECLSPEC\n    #define F_DLLEXPORT\n#endif\n\n#ifdef DLL_EXPORTS\n    #if defined(__MACH__) || defined(__ANDROID__) || defined(JUNGLE)\n        #define F_API __attribute__ ((visibility(\"default\")))\n    #else\n        #define F_API __declspec(dllexport) F_STDCALL\n    #endif\n#else\n    #define F_API F_STDCALL\n#endif\n\n#define F_CALLBACK F_STDCALL\n\n/*\n    FMOD types.\n*/\n\ntypedef int                       FMOD_BOOL;\ntypedef struct FMOD_SYSTEM        FMOD_SYSTEM;\ntypedef struct FMOD_SOUND         FMOD_SOUND;\ntypedef struct FMOD_CHANNEL       FMOD_CHANNEL;\ntypedef struct FMOD_CHANNELGROUP  FMOD_CHANNELGROUP;\ntypedef struct FMOD_SOUNDGROUP    FMOD_SOUNDGROUP;\ntypedef struct FMOD_REVERB        FMOD_REVERB;\ntypedef struct FMOD_DSP           FMOD_DSP;\ntypedef struct FMOD_DSPCONNECTION FMOD_DSPCONNECTION;\ntypedef struct FMOD_POLYGON\t\t  FMOD_POLYGON;\ntypedef struct FMOD_GEOMETRY\t  FMOD_GEOMETRY;\ntypedef struct FMOD_SYNCPOINT\t  FMOD_SYNCPOINT;\ntypedef unsigned int              FMOD_MODE;\ntypedef unsigned int              FMOD_TIMEUNIT;\ntypedef unsigned int              FMOD_INITFLAGS;\ntypedef unsigned int              FMOD_CAPS;\ntypedef unsigned int              FMOD_DEBUGLEVEL;\ntypedef unsigned int              FMOD_MEMORY_TYPE;\n\n/*$ fmod result start $*/\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    error codes.  Returned from every function.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n]\n*/\ntypedef enum\n{\n    FMOD_OK,                        /* No errors. */\n    FMOD_ERR_ALREADYLOCKED,         /* Tried to call lock a second time before unlock was called. */\n    FMOD_ERR_BADCOMMAND,            /* Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). */\n    FMOD_ERR_CDDA_DRIVERS,          /* Neither NTSCSI nor ASPI could be initialised. */\n    FMOD_ERR_CDDA_INIT,             /* An error occurred while initialising the CDDA subsystem. */\n    FMOD_ERR_CDDA_INVALID_DEVICE,   /* Couldn't find the specified device. */\n    FMOD_ERR_CDDA_NOAUDIO,          /* No audio tracks on the specified disc. */\n    FMOD_ERR_CDDA_NODEVICES,        /* No CD/DVD devices were found. */ \n    FMOD_ERR_CDDA_NODISC,           /* No disc present in the specified drive. */\n    FMOD_ERR_CDDA_READ,             /* A CDDA read error occurred. */\n    FMOD_ERR_CHANNEL_ALLOC,         /* Error trying to allocate a channel. */\n    FMOD_ERR_CHANNEL_STOLEN,        /* The specified channel has been reused to play another sound. */\n    FMOD_ERR_COM,                   /* A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. */\n    FMOD_ERR_DMA,                   /* DMA Failure.  See debug output for more information. */\n    FMOD_ERR_DSP_CONNECTION,        /* DSP connection error.  Connection possibly caused a cyclic dependancy.  Or tried to connect a tree too many units deep (more than 128). */\n    FMOD_ERR_DSP_FORMAT,            /* DSP Format error.  A DSP unit may have attempted to connect to this network with the wrong format. */\n    FMOD_ERR_DSP_NOTFOUND,          /* DSP connection error.  Couldn't find the DSP unit specified. */\n    FMOD_ERR_DSP_RUNNING,           /* DSP error.  Cannot perform this operation while the network is in the middle of running.  This will most likely happen if a connection or disconnection is attempted in a DSP callback. */\n    FMOD_ERR_DSP_TOOMANYCONNECTIONS,/* DSP connection error.  The unit being connected to or disconnected should only have 1 input or output. */\n    FMOD_ERR_FILE_BAD,              /* Error loading file. */\n    FMOD_ERR_FILE_COULDNOTSEEK,     /* Couldn't perform seek operation.  This is a limitation of the medium (ie netstreams) or the file format. */\n    FMOD_ERR_FILE_DISKEJECTED,      /* Media was ejected while reading. */\n    FMOD_ERR_FILE_EOF,              /* End of file unexpectedly reached while trying to read essential data (truncated data?). */\n    FMOD_ERR_FILE_NOTFOUND,         /* File not found. */\n    FMOD_ERR_FILE_UNWANTED,         /* Unwanted file access occured. */\n    FMOD_ERR_FORMAT,                /* Unsupported file or audio format. */\n    FMOD_ERR_HTTP,                  /* A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. */\n    FMOD_ERR_HTTP_ACCESS,           /* The specified resource requires authentication or is forbidden. */\n    FMOD_ERR_HTTP_PROXY_AUTH,       /* Proxy authentication is required to access the specified resource. */\n    FMOD_ERR_HTTP_SERVER_ERROR,     /* A HTTP server error occurred. */\n    FMOD_ERR_HTTP_TIMEOUT,          /* The HTTP request timed out. */\n    FMOD_ERR_INITIALIZATION,        /* FMOD was not initialized correctly to support this function. */\n    FMOD_ERR_INITIALIZED,           /* Cannot call this command after System::init. */\n    FMOD_ERR_INTERNAL,              /* An error occured that wasn't supposed to.  Contact support. */\n    FMOD_ERR_INVALID_ADDRESS,       /* On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) */\n    FMOD_ERR_INVALID_FLOAT,         /* Value passed in was a NaN, Inf or denormalized float. */\n    FMOD_ERR_INVALID_HANDLE,        /* An invalid object handle was used. */\n    FMOD_ERR_INVALID_PARAM,         /* An invalid parameter was passed to this function. */\n    FMOD_ERR_INVALID_POSITION,      /* An invalid seek position was passed to this function. */\n    FMOD_ERR_INVALID_SPEAKER,       /* An invalid speaker was passed to this function based on the current speaker mode. */\n    FMOD_ERR_INVALID_SYNCPOINT,     /* The syncpoint did not come from this sound handle. */\n    FMOD_ERR_INVALID_VECTOR,        /* The vectors passed in are not unit length, or perpendicular. */\n    FMOD_ERR_MAXAUDIBLE,            /* Reached maximum audible playback count for this sound's soundgroup. */\n    FMOD_ERR_MEMORY,                /* Not enough memory or resources. */\n    FMOD_ERR_MEMORY_CANTPOINT,      /* Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. */\n    FMOD_ERR_MEMORY_SRAM,           /* Not enough memory or resources on console sound ram. */\n    FMOD_ERR_NEEDS2D,               /* Tried to call a command on a 3d sound when the command was meant for 2d sound. */\n    FMOD_ERR_NEEDS3D,               /* Tried to call a command on a 2d sound when the command was meant for 3d sound. */\n    FMOD_ERR_NEEDSHARDWARE,         /* Tried to use a feature that requires hardware support.  (ie trying to play a GCADPCM compressed sound in software on Wii). */\n    FMOD_ERR_NEEDSSOFTWARE,         /* Tried to use a feature that requires the software engine.  Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. */\n    FMOD_ERR_NET_CONNECT,           /* Couldn't connect to the specified host. */\n    FMOD_ERR_NET_SOCKET_ERROR,      /* A socket error occurred.  This is a catch-all for socket-related errors not listed elsewhere. */\n    FMOD_ERR_NET_URL,               /* The specified URL couldn't be resolved. */\n    FMOD_ERR_NET_WOULD_BLOCK,       /* Operation on a non-blocking socket could not complete immediately. */\n    FMOD_ERR_NOTREADY,              /* Operation could not be performed because specified sound/DSP connection is not ready. */\n    FMOD_ERR_OUTPUT_ALLOCATED,      /* Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */\n    FMOD_ERR_OUTPUT_CREATEBUFFER,   /* Error creating hardware sound buffer. */\n    FMOD_ERR_OUTPUT_DRIVERCALL,     /* A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. */\n    FMOD_ERR_OUTPUT_ENUMERATION,    /* Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal. */\n    FMOD_ERR_OUTPUT_FORMAT,         /* Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). */\n    FMOD_ERR_OUTPUT_INIT,           /* Error initializing output device. */\n    FMOD_ERR_OUTPUT_NOHARDWARE,     /* FMOD_HARDWARE was specified but the sound card does not have the resources necessary to play it. */\n    FMOD_ERR_OUTPUT_NOSOFTWARE,     /* Attempted to create a software sound but no software channels were specified in System::init. */\n    FMOD_ERR_PAN,                   /* Panning only works with mono or stereo sound sources. */\n    FMOD_ERR_PLUGIN,                /* An unspecified error has been returned from a 3rd party plugin. */\n    FMOD_ERR_PLUGIN_INSTANCES,      /* The number of allowed instances of a plugin has been exceeded. */\n    FMOD_ERR_PLUGIN_MISSING,        /* A requested output, dsp unit type or codec was not available. */\n    FMOD_ERR_PLUGIN_RESOURCE,       /* A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback) */\n    FMOD_ERR_PRELOADED,             /* The specified sound is still in use by the event system, call EventSystem::unloadFSB before trying to release it. */\n    FMOD_ERR_PROGRAMMERSOUND,       /* The specified sound is still in use by the event system, wait for the event which is using it finish with it. */\n    FMOD_ERR_RECORD,                /* An error occured trying to initialize the recording device. */\n    FMOD_ERR_REVERB_INSTANCE,       /* Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesnt exist. */\n    FMOD_ERR_SUBSOUND_ALLOCATED,    /* This subsound is already being used by another sound, you cannot have more than one parent to a sound.  Null out the other parent's entry first. */\n    FMOD_ERR_SUBSOUND_CANTMOVE,     /* Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file. */\n    FMOD_ERR_SUBSOUND_MODE,         /* The subsound's mode bits do not match with the parent sound's mode bits.  See documentation for function that it was called with. */\n    FMOD_ERR_SUBSOUNDS,             /* The error occured because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have.  The operation may also not be able to be performed on a parent sound, or a parent sound was played without setting up a sentence first. */\n    FMOD_ERR_TAGNOTFOUND,           /* The specified tag could not be found or there are no tags. */\n    FMOD_ERR_TOOMANYCHANNELS,       /* The sound created exceeds the allowable input channel count.  This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. */\n    FMOD_ERR_UNIMPLEMENTED,         /* Something in FMOD hasn't been implemented when it should be! contact support! */\n    FMOD_ERR_UNINITIALIZED,         /* This command failed because System::init or System::setDriver was not called. */\n    FMOD_ERR_UNSUPPORTED,           /* A command issued was not supported by this object.  Possibly a plugin without certain callbacks specified. */\n    FMOD_ERR_UPDATE,                /* An error caused by System::update occured. */\n    FMOD_ERR_VERSION,               /* The version number of this file format is not supported. */\n\n    FMOD_ERR_EVENT_FAILED,          /* An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. */\n    FMOD_ERR_EVENT_INFOONLY,        /* Can't execute this command on an EVENT_INFOONLY event. */\n    FMOD_ERR_EVENT_INTERNAL,        /* An error occured that wasn't supposed to.  See debug log for reason. */\n    FMOD_ERR_EVENT_MAXSTREAMS,      /* Event failed because 'Max streams' was hit when FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS was specified. */\n    FMOD_ERR_EVENT_MISMATCH,        /* FSB mismatches the FEV it was compiled with, the stream/sample mode it was meant to be created with was different, or the FEV was built for a different platform. */\n    FMOD_ERR_EVENT_NAMECONFLICT,    /* A category with the same name already exists. */\n    FMOD_ERR_EVENT_NOTFOUND,        /* The requested event, event group, event category or event property could not be found. */\n    FMOD_ERR_EVENT_NEEDSSIMPLE,     /* Tried to call a function on a complex event that's only supported by simple events. */\n    FMOD_ERR_EVENT_GUIDCONFLICT,    /* An event with the same GUID already exists. */\n    FMOD_ERR_EVENT_ALREADY_LOADED,  /* The specified project has already been loaded. Having multiple copies of the same project loaded simultaneously is forbidden. */\n\n    FMOD_ERR_MUSIC_UNINITIALIZED,   /* Music system is not initialized probably because no music data is loaded. */\n    FMOD_ERR_MUSIC_NOTFOUND,        /* The requested music entity could not be found. */\n    FMOD_ERR_MUSIC_NOCALLBACK,      /* The music callback is required, but it has not been set. */\n\n    FMOD_RESULT_FORCEINT = 65536    /* Makes sure this enum is signed 32bit. */\n} FMOD_RESULT;\n/*$ fmod result end $*/\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a point in 3D space.\n\n    [REMARKS]\n    FMOD uses a left handed co-ordinate system by default.<br>\n    To use a right handed co-ordinate system specify FMOD_INIT_3D_RIGHTHANDED from FMOD_INITFLAGS in System::init.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::set3DListenerAttributes\n    System::get3DListenerAttributes\n    Channel::set3DAttributes\n    Channel::get3DAttributes\n    Channel::set3DCustomRolloff\n    Channel::get3DCustomRolloff\n    Sound::set3DCustomRolloff\n    Sound::get3DCustomRolloff\n    Geometry::addPolygon\n    Geometry::setPolygonVertex\n    Geometry::getPolygonVertex\n    Geometry::setRotation\n    Geometry::getRotation\n    Geometry::setPosition\n    Geometry::getPosition\n    Geometry::setScale\n    Geometry::getScale\n    FMOD_INITFLAGS\n]\n*/\ntypedef struct\n{\n\tfloat x;        /* X co-ordinate in 3D space. */\n    float y;        /* Y co-ordinate in 3D space. */\n    float z;        /* Z co-ordinate in 3D space. */\n} FMOD_VECTOR;\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a globally unique identifier.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::getDriverInfo\n]\n*/\ntypedef struct\n{\n    unsigned int   Data1;       /* Specifies the first 8 hexadecimal digits of the GUID */\n    unsigned short Data2;       /* Specifies the first group of 4 hexadecimal digits.   */\n    unsigned short Data3;       /* Specifies the second group of 4 hexadecimal digits.  */\n    unsigned char  Data4[8];    /* Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits. */\n} FMOD_GUID;\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure that is passed into FMOD_FILE_ASYNCREADCALLBACK.  Use the information in this structure to perform\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    <br>\n    Instructions: write to 'buffer', and 'bytesread' <b>BEFORE</b> setting 'result'.<br>  \n    As soon as result is set, FMOD will asynchronously continue internally using the data provided in this structure.<br>\n    <br>\n    Set 'result' to the result expected from a normal file read callback.<br>\n    If the read was successful, set it to FMOD_OK.<br>\n    If it read some data but hit the end of the file, set it to FMOD_ERR_FILE_EOF.<br>\n    If a bad error occurred, return FMOD_ERR_FILE_BAD<br>\n    If a disk was ejected, return FMOD_ERR_FILE_DISKEJECTED.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_FILE_ASYNCREADCALLBACK\n    FMOD_FILE_ASYNCCANCELCALLBACK\n]\n*/\ntypedef struct\n{\n    void           *handle;         /* [r] The file handle that was filled out in the open callback. */\n    unsigned int    offset;         /* [r] Seek position, make sure you read from this file offset. */\n    unsigned int    sizebytes;      /* [r] how many bytes requested for read. */\n    int             priority;       /* [r] 0 = low importance.  100 = extremely important (ie 'must read now or stuttering may occur') */\n\n    void           *buffer;         /* [w] Buffer to read file data into. */\n    unsigned int    bytesread;      /* [w] Fill this in before setting result code to tell FMOD how many bytes were read. */\n    FMOD_RESULT     result;         /* [r/w] Result code, FMOD_OK tells the system it is ready to consume the data.  Set this last!  Default value = FMOD_ERR_NOTREADY. */\n\n    void           *userdata;       /* [r] User data pointer. */\n} FMOD_ASYNCREADINFO;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These output types are used with System::setOutput / System::getOutput, to choose which output method to use.\n  \n    [REMARKS]\n    To pass information to the driver when initializing fmod use the extradriverdata parameter in System::init for the following reasons.<br>\n    <li>FMOD_OUTPUTTYPE_WAVWRITER - extradriverdata is a pointer to a char * filename that the wav writer will output to.\n    <li>FMOD_OUTPUTTYPE_WAVWRITER_NRT - extradriverdata is a pointer to a char * filename that the wav writer will output to.\n    <li>FMOD_OUTPUTTYPE_DSOUND - extradriverdata is a pointer to a HWND so that FMOD can set the focus on the audio for a particular window.\n    <li>FMOD_OUTPUTTYPE_PS3 - extradriverdata is a pointer to a FMOD_PS3_EXTRADRIVERDATA struct. This can be found in fmodps3.h.\n    <li>FMOD_OUTPUTTYPE_GC - extradriverdata is a pointer to a FMOD_GC_INFO struct. This can be found in fmodgc.h.\n    <li>FMOD_OUTPUTTYPE_WII - extradriverdata is a pointer to a FMOD_WII_INFO struct. This can be found in fmodwii.h.\n    <li>FMOD_OUTPUTTYPE_ALSA - extradriverdata is a pointer to a FMOD_LINUX_EXTRADRIVERDATA struct. This can be found in fmodlinux.h.<br>\n    <br>\n    Currently these are the only FMOD drivers that take extra information.  Other unknown plugins may have different requirements.\n    <br><br>\n    Note! If FMOD_OUTPUTTYPE_WAVWRITER_NRT or FMOD_OUTPUTTYPE_NOSOUND_NRT are used, and if the System::update function is being called\n    very quickly (ie for a non realtime decode) it may be being called too quickly for the FMOD streamer thread to respond to.  \n    The result will be a skipping/stuttering output in the captured audio.<br>\n    <br>\n    To remedy this, disable the FMOD Ex streamer thread, and use FMOD_INIT_STREAM_FROM_UPDATE to avoid skipping in the output stream,\n    as it will lock the mixer and the streamer together in the same thread.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::setOutput\n    System::getOutput\n    System::setSoftwareFormat\n    System::getSoftwareFormat\n    System::init\n    System::update\n    FMOD_INITFLAGS\n]\n*/\ntypedef enum\n{\n    FMOD_OUTPUTTYPE_AUTODETECT,      /* Picks the best output mode for the platform.  This is the default. */\n                                     \n    FMOD_OUTPUTTYPE_UNKNOWN,         /* All             - 3rd party plugin, unknown.  This is for use with System::getOutput only. */\n    FMOD_OUTPUTTYPE_NOSOUND,         /* All             - All calls in this mode succeed but make no sound. */\n    FMOD_OUTPUTTYPE_WAVWRITER,       /* All             - Writes output to fmodoutput.wav by default.  Use the 'extradriverdata' parameter in System::init, by simply passing the filename as a string, to set the wav filename. */\n    FMOD_OUTPUTTYPE_NOSOUND_NRT,     /* All             - Non-realtime version of FMOD_OUTPUTTYPE_NOSOUND.  User can drive mixer with System::update at whatever rate they want. */\n    FMOD_OUTPUTTYPE_WAVWRITER_NRT,   /* All             - Non-realtime version of FMOD_OUTPUTTYPE_WAVWRITER.  User can drive mixer with System::update at whatever rate they want. */\n                                     \n    FMOD_OUTPUTTYPE_DSOUND,          /* Win32/Win64     - DirectSound output.                       (Default on Windows XP and below) */\n    FMOD_OUTPUTTYPE_WINMM,           /* Win32/Win64     - Windows Multimedia output. */\n    FMOD_OUTPUTTYPE_WASAPI,          /* Win32           - Windows Audio Session API.                (Default on Windows Vista and above) */\n    FMOD_OUTPUTTYPE_ASIO,            /* Win32           - Low latency ASIO 2.0 driver. */\n    FMOD_OUTPUTTYPE_OSS,             /* Linux/Linux64   - Open Sound System output.                 (Default on Linux, third preference) */\n    FMOD_OUTPUTTYPE_ALSA,            /* Linux/Linux64   - Advanced Linux Sound Architecture output. (Default on Linux, second preference if available) */\n    FMOD_OUTPUTTYPE_ESD,             /* Linux/Linux64   - Enlightment Sound Daemon output. */\n    FMOD_OUTPUTTYPE_PULSEAUDIO,      /* Linux/Linux64   - PulseAudio output.                        (Default on Linux, first preference if available) */\n    FMOD_OUTPUTTYPE_COREAUDIO,       /* Mac             - Macintosh CoreAudio output.               (Default on Mac) */\n    FMOD_OUTPUTTYPE_XBOX360,         /* Xbox 360        - Native Xbox360 output.                    (Default on Xbox 360) */\n    FMOD_OUTPUTTYPE_PSP,             /* PSP             - Native PSP output.                        (Default on PSP) */\n    FMOD_OUTPUTTYPE_PS3,             /* PS3             - Native PS3 output.                        (Default on PS3) */\n    FMOD_OUTPUTTYPE_NGP,             /* NGP             - Native NGP output.                        (Default on NGP) */\n\tFMOD_OUTPUTTYPE_WII,\t\t\t /* Wii\t\t\t    - Native Wii output.                        (Default on Wii) */\n    FMOD_OUTPUTTYPE_3DS,             /* 3DS             - Native 3DS output                         (Default on 3DS) */\n    FMOD_OUTPUTTYPE_AUDIOTRACK,      /* Android         - Java Audio Track output.                  (Default on Android 2.2 and below) */\n    FMOD_OUTPUTTYPE_OPENSL,          /* Android         - OpenSL ES output.                         (Default on Android 2.3 and above) */   \n\n    FMOD_OUTPUTTYPE_MAX,             /* Maximum number of output types supported. */\n    FMOD_OUTPUTTYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_OUTPUTTYPE;\n\n\n/*\n[DEFINE] \n[\n    [NAME]\n    FMOD_CAPS\n\n    [DESCRIPTION]   \n    Bit fields to use with System::getDriverCaps to determine the capabilities of a card / output device.\n\n    [REMARKS]\n    It is important to check FMOD_CAPS_HARDWARE_EMULATED on windows machines, to then adjust System::setDSPBufferSize to (1024, 10) to compensate for the higher latency.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::getDriverCaps\n    System::setDSPBufferSize\n]\n*/\n#define FMOD_CAPS_NONE                   0x00000000  /* Device has no special capabilities. */\n#define FMOD_CAPS_HARDWARE               0x00000001  /* Device supports hardware mixing. */\n#define FMOD_CAPS_HARDWARE_EMULATED      0x00000002  /* User has device set to 'Hardware acceleration = off' in control panel, and now extra 200ms latency is incurred. */\n#define FMOD_CAPS_OUTPUT_MULTICHANNEL    0x00000004  /* Device can do multichannel output, ie greater than 2 channels. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM8     0x00000008  /* Device can output to 8bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM16    0x00000010  /* Device can output to 16bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM24    0x00000020  /* Device can output to 24bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM32    0x00000040  /* Device can output to 32bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCMFLOAT 0x00000080  /* Device can output to 32bit floating point PCM. */\n#define FMOD_CAPS_REVERB_LIMITED         0x00002000  /* Device supports some form of limited hardware reverb, maybe parameterless and only selectable by environment. */\n/* [DEFINE_END] */\n\n/*\n[DEFINE] \n[\n    [NAME]\n    FMOD_DEBUGLEVEL\n\n    [DESCRIPTION]   \n    Bit fields to use with FMOD::Debug_SetLevel / FMOD::Debug_GetLevel to control the level of tty debug output with logging versions of FMOD (fmodL).\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    Debug_SetLevel \n    Debug_GetLevel\n]\n*/\n#define FMOD_DEBUG_LEVEL_NONE           0x00000000\n#define FMOD_DEBUG_LEVEL_LOG            0x00000001      /* Will display generic logging messages. */\n#define FMOD_DEBUG_LEVEL_ERROR          0x00000002      /* Will display errors. */\n#define FMOD_DEBUG_LEVEL_WARNING        0x00000004      /* Will display warnings that are not fatal. */\n#define FMOD_DEBUG_LEVEL_HINT           0x00000008      /* Will hint to you if there is something possibly better you could be doing. */\n#define FMOD_DEBUG_LEVEL_ALL            0x000000FF    \n#define FMOD_DEBUG_TYPE_MEMORY          0x00000100      /* Show FMOD memory related logging messages. */\n#define FMOD_DEBUG_TYPE_THREAD          0x00000200      /* Show FMOD thread related logging messages. */\n#define FMOD_DEBUG_TYPE_FILE            0x00000400      /* Show FMOD file system related logging messages. */\n#define FMOD_DEBUG_TYPE_NET             0x00000800      /* Show FMOD network related logging messages. */\n#define FMOD_DEBUG_TYPE_EVENT           0x00001000      /* Show FMOD Event related logging messages. */\n#define FMOD_DEBUG_TYPE_ALL             0x0000FFFF                      \n#define FMOD_DEBUG_DISPLAY_TIMESTAMPS   0x01000000      /* Display the timestamp of the log entry in milliseconds. */\n#define FMOD_DEBUG_DISPLAY_LINENUMBERS  0x02000000      /* Display the FMOD Ex source code line numbers, for debugging purposes. */\n#define FMOD_DEBUG_DISPLAY_COMPRESS     0x04000000      /* If a message is repeated more than 5 times it will stop displaying it and instead display the number of times the message was logged. */\n#define FMOD_DEBUG_DISPLAY_THREAD       0x08000000      /* Display the thread ID of the calling function that caused this log entry to appear. */\n#define FMOD_DEBUG_DISPLAY_ALL          0x0F000000\n#define FMOD_DEBUG_ALL                  0xFFFFFFFF\n/* [DEFINE_END] */\n\n\n/*\n[DEFINE] \n[\n    [NAME]\n    FMOD_MEMORY_TYPE\n\n    [DESCRIPTION]   \n    Bit fields for memory allocation type being passed into FMOD memory callbacks.\n\n    [REMARKS]\n    Remember this is a bitfield.  You may get more than 1 bit set (ie physical + persistent) so do not simply switch on the types!  You must check each bit individually or clear out the bits that you do not want within the callback.<br>\n    Bits can be excluded if you want during Memory_Initialize so that you never get them.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_MEMORY_ALLOCCALLBACK\n    FMOD_MEMORY_REALLOCCALLBACK\n    FMOD_MEMORY_FREECALLBACK\n    Memory_Initialize\n    \n]\n*/\n#define FMOD_MEMORY_NORMAL             0x00000000       /* Standard memory. */\n#define FMOD_MEMORY_STREAM_FILE        0x00000001       /* Stream file buffer, size controllable with System::setStreamBufferSize. */\n#define FMOD_MEMORY_STREAM_DECODE      0x00000002       /* Stream decode buffer, size controllable with FMOD_CREATESOUNDEXINFO::decodebuffersize. */\n#define FMOD_MEMORY_SAMPLEDATA         0x00000004       /* Sample data buffer.  Raw audio data, usually PCM/MPEG/ADPCM/XMA data. */\n#define FMOD_MEMORY_DSP_OUTPUTBUFFER   0x00000008       /* DSP memory block allocated when more than 1 output exists on a DSP node. */\n#define FMOD_MEMORY_XBOX360_PHYSICAL   0x00100000       /* Requires XPhysicalAlloc / XPhysicalFree. */\n#define FMOD_MEMORY_PERSISTENT         0x00200000       /* Persistent memory. Memory will be freed when System::release is called. */\n#define FMOD_MEMORY_SECONDARY          0x00400000       /* Secondary memory. Allocation should be in secondary memory. For example RSX on the PS3. */\n#define FMOD_MEMORY_ALL                0xFFFFFFFF\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These are speaker types defined for use with the System::setSpeakerMode or System::getSpeakerMode command.\n\n    [REMARKS]\n    These are important notes on speaker modes in regards to sounds created with FMOD_SOFTWARE.<br>\n    Note below the phrase 'sound channels' is used.  These are the subchannels inside a sound, they are not related and \n    have nothing to do with the FMOD class \"Channel\".<br>\n    For example a mono sound has 1 sound channel, a stereo sound has 2 sound channels, and an AC3 or 6 channel wav file have 6 \"sound channels\".<br>\n    <br>\n    FMOD_SPEAKERMODE_RAW<br>\n    ---------------------<br>\n    This mode is for output devices that are not specifically mono/stereo/quad/surround/5.1 or 7.1, but are multichannel.<br>\n    Use System::setSoftwareFormat to specify the number of speakers you want to address, otherwise it will default to 2 (stereo).<br>\n    Sound channels map to speakers sequentially, so a mono sound maps to output speaker 0, stereo sound maps to output speaker 0 & 1.<br>\n    The user assumes knowledge of the speaker order.  FMOD_SPEAKER enumerations may not apply, so raw channel indices should be used.<br>\n    Multichannel sounds map input channels to output channels 1:1. <br>\n    Channel::setPan and Channel::setSpeakerMix do not work.<br>\n    Speaker levels must be manually set with Channel::setSpeakerLevels.<br>\n    <br>\n    FMOD_SPEAKERMODE_MONO<br>\n    ---------------------<br>\n    This mode is for a 1 speaker arrangement.<br>\n    Panning does not work in this speaker mode.<br>\n    Mono, stereo and multichannel sounds have each sound channel played on the one speaker unity.<br>\n    Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    Channel::setSpeakerMix does not work.<br>\n    <br>\n    FMOD_SPEAKERMODE_STEREO<br>\n    -----------------------<br>\n    This mode is for 2 speaker arrangements that have a left and right speaker.<br>\n    <li>Mono sounds default to an even distribution between left and right.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the middle, or full left in the left speaker and full right in the right speaker.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds have each sound channel played on each speaker at unity.<br>\n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but only front left and right parameters are used, the rest are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_QUAD<br>\n    ------------------------<br>\n    This mode is for 4 speaker arrangements that have a front left, front right, rear left and a rear right speaker.<br>\n    <li>Mono sounds default to an even distribution between front left and front right.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.<br>\n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.<br>\n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but side left, side right, center and lfe are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_SURROUND<br>\n    ------------------------<br>\n    This mode is for 5 speaker arrangements that have a left/right/center/rear left/rear right.<br>\n    <li>Mono sounds default to the center speaker.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.  \n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but side left / side right are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_5POINT1<br>\n    ------------------------<br>\n    This mode is for 5.1 speaker arrangements that have a left/right/center/rear left/rear right and a subwoofer speaker.<br>\n    <li>Mono sounds default to the center speaker.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.  \n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but side left / side right are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_7POINT1<br>\n    ------------------------<br>\n    This mode is for 7.1 speaker arrangements that have a left/right/center/rear left/rear right/side left/side right \n    and a subwoofer speaker.<br>\n    <li>Mono sounds default to the center speaker.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.  \n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works and every parameter is used to set the balance of a sound in any speaker.<br>\n    <br>\n    FMOD_SPEAKERMODE_PROLOGIC<br>\n    ------------------------------------------------------<br>\n    This mode is for mono, stereo, 5.1 and 7.1 speaker arrangements, as it is backwards and forwards compatible with stereo, \n    but to get a surround effect a Dolby Prologic or Prologic 2 hardware decoder / amplifier is needed.<br>\n    Pan behavior is the same as FMOD_SPEAKERMODE_5POINT1.<br>\n    <br>\n    If this function is called the numoutputchannels setting in System::setSoftwareFormat is overwritten.<br>\n    <br>\n    Output rate must be 44100, 48000 or 96000 for this to work otherwise FMOD_ERR_OUTPUT_INIT will be returned.<br>\n\n    FMOD_SPEAKERMODE_MYEARS<br>\n    ------------------------------------------------------<br>\n    This mode is for headphones.  This will attempt to load a MyEars profile (see myears.net.au) and use it to generate\n    surround sound on headphones using a personalized HRTF algorithm, for realistic 3d sound.<br>\n    Pan behavior is the same as FMOD_SPEAKERMODE_7POINT1.<br>\n    MyEars speaker mode will automatically be set if the speakermode is FMOD_SPEAKERMODE_STEREO and the MyEars profile exists.<br>\n    If this mode is set explicitly, FMOD_INIT_DISABLE_MYEARS_AUTODETECT has no effect.<br>\n    If this mode is set explicitly and the MyEars profile does not exist, FMOD_ERR_OUTPUT_DRIVERCALL will be returned.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setSpeakerMode\n    System::getSpeakerMode\n    System::getDriverCaps\n    System::setSoftwareFormat\n    Channel::setSpeakerLevels\n]\n*/\ntypedef enum\n{\n    FMOD_SPEAKERMODE_RAW,              /* There is no specific speakermode.  Sound channels are mapped in order of input to output.  Use System::setSoftwareFormat to specify speaker count. See remarks for more information. */\n    FMOD_SPEAKERMODE_MONO,             /* The speakers are monaural. */\n    FMOD_SPEAKERMODE_STEREO,           /* The speakers are stereo (DEFAULT). */\n    FMOD_SPEAKERMODE_QUAD,             /* 4 speaker setup.  This includes front left, front right, rear left, rear right.  */\n    FMOD_SPEAKERMODE_SURROUND,         /* 5 speaker setup.  This includes front left, front right, center, rear left, rear right. */\n    FMOD_SPEAKERMODE_5POINT1,          /* 5.1 speaker setup.  This includes front left, front right, center, rear left, rear right and a subwoofer. */\n    FMOD_SPEAKERMODE_7POINT1,          /* 7.1 speaker setup.  This includes front left, front right, center, rear left, rear right, side left, side right and a subwoofer. */\n    \n    FMOD_SPEAKERMODE_PROLOGIC,         /* Stereo output, but data is encoded to be played on a Prologic 2 / CircleSurround decoder in 5.1 via an analog connection.  See remarks about limitations. */\n    FMOD_SPEAKERMODE_MYEARS,           /* Stereo output, but data is encoded using personalized HRTF algorithms.  See myears.net.au */\n\n    FMOD_SPEAKERMODE_MAX,              /* Maximum number of speaker modes supported. */\n    FMOD_SPEAKERMODE_FORCEINT = 65536  /* Makes sure this enum is signed 32bit. */\n} FMOD_SPEAKERMODE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These are speaker types defined for use with the Channel::setSpeakerLevels command.\n    It can also be used for speaker placement in the System::set3DSpeakerPosition command.\n\n    [REMARKS]\n    If you are using FMOD_SPEAKERMODE_RAW and speaker assignments are meaningless, just cast a raw integer value to this type.<br>\n    For example (FMOD_SPEAKER)7 would use the 7th speaker (also the same as FMOD_SPEAKER_SIDE_RIGHT).<br>\n    Values higher than this can be used if an output system has more than 8 speaker types / output channels.  15 is the current maximum.<br>\n    <br>\n    NOTE: On Playstation 3 in 7.1, the extra 2 speakers are not side left/side right, they are 'surround back left'/'surround back right' which\n    locate the speakers behind the listener instead of to the sides like on PC.  FMOD_SPEAKER_SBL/FMOD_SPEAKER_SBR are provided to make it \n    clearer what speaker is being addressed on that platform.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_SPEAKERMODE\n    Channel::setSpeakerLevels\n    Channel::getSpeakerLevels\n    System::set3DSpeakerPosition\n    System::get3DSpeakerPosition\n]\n*/\ntypedef enum\n{\n    FMOD_SPEAKER_FRONT_LEFT,\n    FMOD_SPEAKER_FRONT_RIGHT,\n    FMOD_SPEAKER_FRONT_CENTER,\n    FMOD_SPEAKER_LOW_FREQUENCY,\n    FMOD_SPEAKER_BACK_LEFT,\n    FMOD_SPEAKER_BACK_RIGHT,\n    FMOD_SPEAKER_SIDE_LEFT,\n    FMOD_SPEAKER_SIDE_RIGHT,\n    \n    FMOD_SPEAKER_MAX,                                       /* Maximum number of speaker types supported. */\n    FMOD_SPEAKER_MONO        = FMOD_SPEAKER_FRONT_LEFT,     /* For use with FMOD_SPEAKERMODE_MONO and Channel::SetSpeakerLevels.  Mapped to same value as FMOD_SPEAKER_FRONT_LEFT. */\n    FMOD_SPEAKER_NULL        = FMOD_SPEAKER_MAX,            /* A non speaker.  Use this to send. */\n    FMOD_SPEAKER_SBL         = FMOD_SPEAKER_SIDE_LEFT,      /* For use with FMOD_SPEAKERMODE_7POINT1 on PS3 where the extra speakers are surround back inside of side speakers. */\n    FMOD_SPEAKER_SBR         = FMOD_SPEAKER_SIDE_RIGHT,     /* For use with FMOD_SPEAKERMODE_7POINT1 on PS3 where the extra speakers are surround back inside of side speakers. */\n    FMOD_SPEAKER_FORCEINT    = 65536                        /* Makes sure this enum is signed 32bit. */\n} FMOD_SPEAKER;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These are plugin types defined for use with the System::getNumPlugins, \n    System::getPluginInfo and System::unloadPlugin functions.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::getNumPlugins\n    System::getPluginInfo\n    System::unloadPlugin\n]\n*/\ntypedef enum\n{\n    FMOD_PLUGINTYPE_OUTPUT,          /* The plugin type is an output module.  FMOD mixed audio will play through one of these devices */\n    FMOD_PLUGINTYPE_CODEC,           /* The plugin type is a file format codec.  FMOD will use these codecs to load file formats for playback. */\n    FMOD_PLUGINTYPE_DSP,             /* The plugin type is a DSP unit.  FMOD will use these plugins as part of its DSP network to apply effects to output or generate sound in realtime. */\n\n    FMOD_PLUGINTYPE_MAX,             /* Maximum number of plugin types supported. */\n    FMOD_PLUGINTYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_PLUGINTYPE;\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_INITFLAGS\n\n    [DESCRIPTION]   \n    Initialization flags.  Use them with System::init in the flags parameter to change various behavior.  \n\n    [REMARKS]\n    Use System::setAdvancedSettings to adjust settings for some of the features that are enabled by these flags.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::init\n    System::update \n    System::setAdvancedSettings\n    Channel::set3DOcclusion\n]\n*/\n#define FMOD_INIT_NORMAL                     0x00000000 /* All platforms - Initialize normally */\n#define FMOD_INIT_STREAM_FROM_UPDATE         0x00000001 /* All platforms - No stream thread is created internally.  Streams are driven from System::update.  Mainly used with non-realtime outputs. */\n#define FMOD_INIT_3D_RIGHTHANDED             0x00000002 /* All platforms - FMOD will treat +X as right, +Y as up and +Z as backwards (towards you). */\n#define FMOD_INIT_SOFTWARE_DISABLE           0x00000004 /* All platforms - Disable software mixer to save memory.  Anything created with FMOD_SOFTWARE will fail and DSP will not work. */\n#define FMOD_INIT_SOFTWARE_OCCLUSION         0x00000008 /* All platforms - All FMOD_SOFTWARE with FMOD_3D based voices will add a software lowpass filter effect into the DSP chain which is automatically used when Channel::set3DOcclusion is used or the geometry API. */\n#define FMOD_INIT_SOFTWARE_HRTF              0x00000010 /* All platforms - All FMOD_SOFTWARE with FMOD_3D based voices will add a software lowpass filter effect into the DSP chain which causes sounds to sound duller when the sound goes behind the listener.  Use System::setAdvancedSettings to adjust cutoff frequency. */\n#define FMOD_INIT_DISTANCE_FILTERING         0x00000200 /* All platforms - All FMOD_SOFTWARE with FMOD_3D based voices will add a software lowpass and highpass filter effect into the DSP chain which will act as a distance-automated bandpass filter. Use System::setAdvancedSettings to adjust the centre frequency. */\n#define FMOD_INIT_SOFTWARE_REVERB_LOWMEM     0x00000040 /* All platforms - SFX reverb is run using 22/24khz delay buffers, halving the memory required. */\n#define FMOD_INIT_ENABLE_PROFILE             0x00000020 /* All platforms - Enable TCP/IP based host which allows FMOD Designer or FMOD Profiler to connect to it, and view memory, CPU and the DSP network graph in real-time. */\n#define FMOD_INIT_VOL0_BECOMES_VIRTUAL       0x00000080 /* All platforms - Any sounds that are 0 volume will go virtual and not be processed except for having their positions updated virtually.  Use System::setAdvancedSettings to adjust what volume besides zero to switch to virtual at. */\n#define FMOD_INIT_WASAPI_EXCLUSIVE           0x00000100 /* Win32 Vista only - for WASAPI output - Enable exclusive access to hardware, lower latency at the expense of excluding other applications from accessing the audio hardware. */\n#define FMOD_INIT_PS3_PREFERDTS              0x00800000 /* PS3 only - Prefer DTS over Dolby Digital if both are supported. Note: 8 and 6 channel LPCM is always preferred over both DTS and Dolby Digital. */\n#define FMOD_INIT_PS3_FORCE2CHLPCM           0x01000000 /* PS3 only - Force PS3 system output mode to 2 channel LPCM. */\n#define FMOD_INIT_DISABLEDOLBY               0x00100000 /* Wii / 3DS - Disable Dolby Pro Logic surround. Speakermode will be set to STEREO even if user has selected surround in the system settings. */\n#define FMOD_INIT_SYSTEM_MUSICMUTENOTPAUSE   0x00200000 /* Xbox 360 / PS3 - The \"music\" channelgroup which by default pauses when custom 360 dashboard / PS3 BGM music is played, can be changed to mute (therefore continues playing) instead of pausing, by using this flag. */\n#define FMOD_INIT_SYNCMIXERWITHUPDATE        0x00400000 /* Win32/Wii/PS3/Xbox/Xbox 360 - FMOD Mixer thread is woken up to do a mix when System::update is called rather than waking periodically on its own timer. */\n#define FMOD_INIT_GEOMETRY_USECLOSEST        0x04000000 /* All platforms - With the geometry engine, only process the closest polygon rather than accumulating all polygons the sound to listener line intersects. */\n#define FMOD_INIT_DISABLE_MYEARS_AUTODETECT  0x08000000 /* Win32 - Disables automatic setting of FMOD_SPEAKERMODE_STEREO to FMOD_SPEAKERMODE_MYEARS if the MyEars profile exists on the PC.  MyEars is HRTF 7.1 downmixing through headphones. */\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These definitions describe the type of song being played.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getFormat\n]\n*/\ntypedef enum\n{\n    FMOD_SOUND_TYPE_UNKNOWN,         /* 3rd party / unknown plugin format. */\n    FMOD_SOUND_TYPE_AIFF,            /* AIFF. */\n    FMOD_SOUND_TYPE_ASF,             /* Microsoft Advanced Systems Format (ie WMA/ASF/WMV). */\n    FMOD_SOUND_TYPE_AT3,             /* Sony ATRAC 3 format */\n    FMOD_SOUND_TYPE_CDDA,            /* Digital CD audio. */\n    FMOD_SOUND_TYPE_DLS,             /* Sound font / downloadable sound bank. */\n    FMOD_SOUND_TYPE_FLAC,            /* FLAC lossless codec. */\n    FMOD_SOUND_TYPE_FSB,             /* FMOD Sample Bank. */\n    FMOD_SOUND_TYPE_GCADPCM,         /* Nintendo GameCube/Wii ADPCM */\n    FMOD_SOUND_TYPE_IT,              /* Impulse Tracker. */\n    FMOD_SOUND_TYPE_MIDI,            /* MIDI. extracodecdata is a pointer to an FMOD_MIDI_EXTRACODECDATA structure. */\n    FMOD_SOUND_TYPE_MOD,             /* Protracker / Fasttracker MOD. */\n    FMOD_SOUND_TYPE_MPEG,            /* MP2/MP3 MPEG. */\n    FMOD_SOUND_TYPE_OGGVORBIS,       /* Ogg vorbis. */\n    FMOD_SOUND_TYPE_PLAYLIST,        /* Information only from ASX/PLS/M3U/WAX playlists */\n    FMOD_SOUND_TYPE_RAW,             /* Raw PCM data. */\n    FMOD_SOUND_TYPE_S3M,             /* ScreamTracker 3. */\n    FMOD_SOUND_TYPE_SF2,             /* Sound font 2 format. */\n    FMOD_SOUND_TYPE_USER,            /* User created sound. */\n    FMOD_SOUND_TYPE_WAV,             /* Microsoft WAV. */\n    FMOD_SOUND_TYPE_XM,              /* FastTracker 2 XM. */\n    FMOD_SOUND_TYPE_XMA,             /* Xbox360 XMA */\n    FMOD_SOUND_TYPE_VAG,             /* PlayStation Portable ADPCM VAG format. */\n    FMOD_SOUND_TYPE_AUDIOQUEUE,      /* iPhone hardware decoder, supports AAC, ALAC and MP3. extracodecdata is a pointer to an FMOD_AUDIOQUEUE_EXTRACODECDATA structure. */\n    FMOD_SOUND_TYPE_XWMA,            /* Xbox360 XWMA */\n    FMOD_SOUND_TYPE_BCWAV,           /* 3DS BCWAV container format for DSP ADPCM and PCM */\n    FMOD_SOUND_TYPE_AT9,             /* NGP ATRAC 9 format */\n\n    FMOD_SOUND_TYPE_MAX,             /* Maximum number of sound types supported. */\n    FMOD_SOUND_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_SOUND_TYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These definitions describe the native format of the hardware or software buffer that will be used.\n\n    [REMARKS]\n    This is the format the native hardware or software buffer will be or is created in.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createSound\n    Sound::getFormat\n]\n*/\ntypedef enum\n{\n    FMOD_SOUND_FORMAT_NONE,             /* Unitialized / unknown. */\n    FMOD_SOUND_FORMAT_PCM8,             /* 8bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCM16,            /* 16bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCM24,            /* 24bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCM32,            /* 32bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCMFLOAT,         /* 32bit floating point PCM data. */\n    FMOD_SOUND_FORMAT_GCADPCM,          /* Compressed Nintendo GameCube/Wii DSP data. */\n    FMOD_SOUND_FORMAT_IMAADPCM,         /* Compressed IMA ADPCM / Xbox ADPCM data. */\n    FMOD_SOUND_FORMAT_VAG,              /* Compressed PlayStation Portable ADPCM data. */\n    FMOD_SOUND_FORMAT_HEVAG,            /* Compressed NGP ADPCM data. */\n    FMOD_SOUND_FORMAT_XMA,              /* Compressed Xbox360 data. */\n    FMOD_SOUND_FORMAT_MPEG,             /* Compressed MPEG layer 2 or 3 data. */\n    FMOD_SOUND_FORMAT_CELT,             /* Compressed CELT data. */\n\n    FMOD_SOUND_FORMAT_MAX,              /* Maximum number of sound formats supported. */   \n    FMOD_SOUND_FORMAT_FORCEINT = 65536  /* Makes sure this enum is signed 32bit. */\n} FMOD_SOUND_FORMAT;\n\n\n/*\n[DEFINE]\n[\n    [NAME] \n    FMOD_MODE\n\n    [DESCRIPTION]   \n    Sound description bitfields, bitwise OR them together for loading and describing sounds.\n\n    [REMARKS]\n    By default a sound will open as a static sound that is decompressed fully into memory to PCM. (ie equivalent of FMOD_CREATESAMPLE)<br>\n    To have a sound stream instead, use FMOD_CREATESTREAM, or use the wrapper function System::createStream.<br>\n    Some opening modes (ie FMOD_OPENUSER, FMOD_OPENMEMORY, FMOD_OPENMEMORY_POINT, FMOD_OPENRAW) will need extra information.<br>\n    This can be provided using the FMOD_CREATESOUNDEXINFO structure.\n    <br>\n    Specifying FMOD_OPENMEMORY_POINT will POINT to your memory rather allocating its own sound buffers and duplicating it internally.<br>\n    <b><u>This means you cannot free the memory while FMOD is using it, until after Sound::release is called.</b></u>\n    With FMOD_OPENMEMORY_POINT, for PCM formats, only WAV, FSB, and RAW are supported.  For compressed formats, only those formats supported by FMOD_CREATECOMPRESSEDSAMPLE are supported.<br>\n    With FMOD_OPENMEMORY_POINT and FMOD_OPENRAW or PCM, if using them together, note that you must pad the data on each side by 16 bytes.  This is so fmod can modify the ends of the data for looping/interpolation/mixing purposes.  If a wav file, you will need to insert silence, and then reset loop points to stop the playback from playing that silence.<br>\n    With FMOD_OPENMEMORY_POINT, For Wii/PSP FMOD_HARDWARE supports this flag for the GCADPCM/VAG formats.  On other platforms FMOD_SOFTWARE must be used.<br>\n    <br>\n    <b>Xbox 360 memory</b> On Xbox 360 Specifying FMOD_OPENMEMORY_POINT to a virtual memory address will cause FMOD_ERR_INVALID_ADDRESS\n    to be returned.  Use physical memory only for this functionality.<br>\n    <br>\n    FMOD_LOWMEM is used on a sound if you want to minimize the memory overhead, by having FMOD not allocate memory for certain \n    features that are not likely to be used in a game environment.  These are :<br>\n    1. Sound::getName functionality is removed.  256 bytes per sound is saved.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createSound\n    System::createStream\n    Sound::setMode\n    Sound::getMode\n    Channel::setMode\n    Channel::getMode\n    Sound::set3DCustomRolloff\n    Channel::set3DCustomRolloff\n    Sound::getOpenState\n]\n*/\n#define FMOD_DEFAULT                   0x00000000  /* FMOD_DEFAULT is a default sound type.  Equivalent to all the defaults listed below.  FMOD_LOOP_OFF, FMOD_2D, FMOD_HARDWARE.  (Note - only Windows with a high spec soundcard, PSP, and Wii support FMOD_HARDWARE) */\n#define FMOD_LOOP_OFF                  0x00000001  /* For non looping sounds. (DEFAULT).  Overrides FMOD_LOOP_NORMAL / FMOD_LOOP_BIDI. */\n#define FMOD_LOOP_NORMAL               0x00000002  /* For forward looping sounds. */\n#define FMOD_LOOP_BIDI                 0x00000004  /* For bidirectional looping sounds. (only works on software mixed static sounds). */\n#define FMOD_2D                        0x00000008  /* Ignores any 3d processing. (DEFAULT). */\n#define FMOD_3D                        0x00000010  /* Makes the sound positionable in 3D.  Overrides FMOD_2D. */\n#define FMOD_HARDWARE                  0x00000020  /* Attempts to make sounds use hardware acceleration. (DEFAULT).  Note on platforms that don't support FMOD_HARDWARE (only Windows with a high spec soundcard, PSP, and Wii support FMOD_HARDWARE), this will be internally treated as FMOD_SOFTWARE. */\n#define FMOD_SOFTWARE                  0x00000040  /* Makes the sound be mixed by the FMOD CPU based software mixer.  Overrides FMOD_HARDWARE.  Use this for FFT, DSP, compressed sample support, 2D multi-speaker support and other software related features. */\n#define FMOD_CREATESTREAM              0x00000080  /* Decompress at runtime, streaming from the source provided (ie from disk).  Overrides FMOD_CREATESAMPLE and FMOD_CREATECOMPRESSEDSAMPLE.  Note a stream can only be played once at a time due to a stream only having 1 stream buffer and file handle.  Open multiple streams to have them play concurrently. */\n#define FMOD_CREATESAMPLE              0x00000100  /* Decompress at loadtime, decompressing or decoding whole file into memory as the target sample format (ie PCM).  Fastest for FMOD_SOFTWARE based playback and most flexible.  */\n#define FMOD_CREATECOMPRESSEDSAMPLE    0x00000200  /* Load MP2, MP3, IMAADPCM or XMA into memory and leave it compressed.  During playback the FMOD software mixer will decode it in realtime as a 'compressed sample'.  Can only be used in combination with FMOD_SOFTWARE.  Overrides FMOD_CREATESAMPLE.  If the sound data is not ADPCM, MPEG or XMA it will behave as if it was created with FMOD_CREATESAMPLE and decode the sound into PCM. */\n#define FMOD_OPENUSER                  0x00000400  /* Opens a user created static sample or stream. Use FMOD_CREATESOUNDEXINFO to specify format and/or read callbacks.  If a user created 'sample' is created with no read callback, the sample will be empty.  Use Sound::lock and Sound::unlock to place sound data into the sound if this is the case. */\n#define FMOD_OPENMEMORY                0x00000800  /* \"name_or_data\" will be interpreted as a pointer to memory instead of filename for creating sounds.  Use FMOD_CREATESOUNDEXINFO to specify length.  If used with FMOD_CREATESAMPLE or FMOD_CREATECOMPRESSEDSAMPLE, FMOD duplicates the memory into its own buffers.  Your own buffer can be freed after open.  If used with FMOD_CREATESTREAM, FMOD will stream out of the buffer whose pointer you passed in.  In this case, your own buffer should not be freed until you have finished with and released the stream.*/\n#define FMOD_OPENMEMORY_POINT          0x10000000  /* \"name_or_data\" will be interpreted as a pointer to memory instead of filename for creating sounds.  Use FMOD_CREATESOUNDEXINFO to specify length.  This differs to FMOD_OPENMEMORY in that it uses the memory as is, without duplicating the memory into its own buffers.  For Wii/PSP FMOD_HARDWARE supports this flag for the GCADPCM/VAG formats.  On other platforms FMOD_SOFTWARE must be used, as sound hardware on the other platforms (ie PC) cannot access main ram.  Cannot be freed after open, only after Sound::release.   Will not work if the data is compressed and FMOD_CREATECOMPRESSEDSAMPLE is not used. */\n#define FMOD_OPENRAW                   0x00001000  /* Will ignore file format and treat as raw pcm.  Use FMOD_CREATESOUNDEXINFO to specify format.  Requires at least defaultfrequency, numchannels and format to be specified before it will open.  Must be little endian data. */\n#define FMOD_OPENONLY                  0x00002000  /* Just open the file, dont prebuffer or read.  Good for fast opens for info, or when sound::readData is to be used. */\n#define FMOD_ACCURATETIME              0x00004000  /* For System::createSound - for accurate Sound::getLength/Channel::setPosition on VBR MP3, and MOD/S3M/XM/IT/MIDI files.  Scans file first, so takes longer to open. FMOD_OPENONLY does not affect this. */\n#define FMOD_MPEGSEARCH                0x00008000  /* For corrupted / bad MP3 files.  This will search all the way through the file until it hits a valid MPEG header.  Normally only searches for 4k. */\n#define FMOD_NONBLOCKING               0x00010000  /* For opening sounds and getting streamed subsounds (seeking) asyncronously.  Use Sound::getOpenState to poll the state of the sound as it opens or retrieves the subsound in the background. */\n#define FMOD_UNIQUE                    0x00020000  /* Unique sound, can only be played one at a time */\n#define FMOD_3D_HEADRELATIVE           0x00040000  /* Make the sound's position, velocity and orientation relative to the listener. */\n#define FMOD_3D_WORLDRELATIVE          0x00080000  /* Make the sound's position, velocity and orientation absolute (relative to the world). (DEFAULT) */\n#define FMOD_3D_INVERSEROLLOFF         0x00100000  /* This sound will follow the inverse rolloff model where mindistance = full volume, maxdistance = where sound stops attenuating, and rolloff is fixed according to the global rolloff factor.  (DEFAULT) */\n#define FMOD_3D_LINEARROLLOFF          0x00200000  /* This sound will follow a linear rolloff model where mindistance = full volume, maxdistance = silence.  Rolloffscale is ignored. */\n#define FMOD_3D_LINEARSQUAREROLLOFF    0x00400000  /* This sound will follow a linear-square rolloff model where mindistance = full volume, maxdistance = silence.  Rolloffscale is ignored. */\n#define FMOD_3D_CUSTOMROLLOFF          0x04000000  /* This sound will follow a rolloff model defined by Sound::set3DCustomRolloff / Channel::set3DCustomRolloff.  */\n#define FMOD_3D_IGNOREGEOMETRY         0x40000000  /* Is not affect by geometry occlusion.  If not specified in Sound::setMode, or Channel::setMode, the flag is cleared and it is affected by geometry again. */\n#define FMOD_UNICODE                   0x01000000  /* Filename is double-byte unicode. */\n#define FMOD_IGNORETAGS                0x02000000  /* Skips id3v2/asf/etc tag checks when opening a sound, to reduce seek/read overhead when opening files (helps with CD performance). */\n#define FMOD_LOWMEM                    0x08000000  /* Removes some features from samples to give a lower memory overhead, like Sound::getName.  See remarks. */\n#define FMOD_LOADSECONDARYRAM          0x20000000  /* Load sound into the secondary RAM of supported platform. On PS3, sounds will be loaded into RSX/VRAM. */\n#define FMOD_VIRTUAL_PLAYFROMSTART     0x80000000  /* For sounds that start virtual (due to being quiet or low importance), instead of swapping back to audible, and playing at the correct offset according to time, this flag makes the sound play from the start. */\n\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These values describe what state a sound is in after FMOD_NONBLOCKING has been used to open it.\n\n    [REMARKS]\n    With streams, if you are using FMOD_NONBLOCKING, note that if the user calls Sound::getSubSound, a stream will go into FMOD_OPENSTATE_SEEKING state and sound related commands will return FMOD_ERR_NOTREADY.<br>\n    With streams, if you are using FMOD_NONBLOCKING, note that if the user calls Channel::getPosition, a stream will go into FMOD_OPENSTATE_SETPOSITION state and sound related commands will return FMOD_ERR_NOTREADY.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    Sound::getOpenState\n    FMOD_MODE\n]\n*/\ntypedef enum\n{\n    FMOD_OPENSTATE_READY = 0,       /* Opened and ready to play. */\n    FMOD_OPENSTATE_LOADING,         /* Initial load in progress. */\n    FMOD_OPENSTATE_ERROR,           /* Failed to open - file not found, out of memory etc.  See return value of Sound::getOpenState for what happened. */\n    FMOD_OPENSTATE_CONNECTING,      /* Connecting to remote host (internet sounds only). */\n    FMOD_OPENSTATE_BUFFERING,       /* Buffering data. */\n    FMOD_OPENSTATE_SEEKING,         /* Seeking to subsound and re-flushing stream buffer. */\n    FMOD_OPENSTATE_PLAYING,         /* Ready and playing, but not possible to release at this time without stalling the main thread. */\n    FMOD_OPENSTATE_SETPOSITION,     /* Seeking within a stream to a different position. */\n\n    FMOD_OPENSTATE_MAX,             /* Maximum number of open state types. */\n    FMOD_OPENSTATE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_OPENSTATE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These flags are used with SoundGroup::setMaxAudibleBehavior to determine what happens when more sounds \n    are played than are specified with SoundGroup::setMaxAudible.\n\n    [REMARKS]\n    When using FMOD_SOUNDGROUP_BEHAVIOR_MUTE, SoundGroup::setMuteFadeSpeed can be used to stop a sudden transition.  \n    Instead, the time specified will be used to cross fade between the sounds that go silent and the ones that become audible.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    SoundGroup::setMaxAudibleBehavior\n    SoundGroup::getMaxAudibleBehavior\n    SoundGroup::setMaxAudible\n    SoundGroup::getMaxAudible\n    SoundGroup::setMuteFadeSpeed\n    SoundGroup::getMuteFadeSpeed\n]\n*/\ntypedef enum \n{\n    FMOD_SOUNDGROUP_BEHAVIOR_FAIL,              /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will simply fail during System::playSound. */\n    FMOD_SOUNDGROUP_BEHAVIOR_MUTE,              /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will be silent, then if another sound in the group stops the sound that was silent before becomes audible again. */\n    FMOD_SOUNDGROUP_BEHAVIOR_STEALLOWEST,       /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will steal the quietest / least important sound playing in the group. */\n\n    FMOD_SOUNDGROUP_BEHAVIOR_MAX,               /* Maximum number of open state types. */\n    FMOD_SOUNDGROUP_BEHAVIOR_FORCEINT = 65536   /* Makes sure this enum is signed 32bit. */\n} FMOD_SOUNDGROUP_BEHAVIOR;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These callback types are used with Channel::setCallback.\n\n    [REMARKS]\n    Each callback has commanddata parameters passed as int unique to the type of callback.<br>\n    See reference to FMOD_CHANNEL_CALLBACK to determine what they might mean for each type of callback.<br>\n    <br>\n    <b>Note!</b>  Currently the user must call System::update for these callbacks to trigger!\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Channel::setCallback\n    FMOD_CHANNEL_CALLBACK\n    System::update\n]\n*/\ntypedef enum\n{\n    FMOD_CHANNEL_CALLBACKTYPE_END,                  /* Called when a sound ends. */\n    FMOD_CHANNEL_CALLBACKTYPE_VIRTUALVOICE,         /* Called when a voice is swapped out or swapped in. */\n    FMOD_CHANNEL_CALLBACKTYPE_SYNCPOINT,            /* Called when a syncpoint is encountered.  Can be from wav file markers. */\n    FMOD_CHANNEL_CALLBACKTYPE_OCCLUSION,            /* Called when the channel has its geometry occlusion value calculated.  Can be used to clamp or change the value. */\n\n    FMOD_CHANNEL_CALLBACKTYPE_MAX,                  /* Maximum number of callback types supported. */\n    FMOD_CHANNEL_CALLBACKTYPE_FORCEINT = 65536      /* Makes sure this enum is signed 32bit. */\n} FMOD_CHANNEL_CALLBACKTYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These callback types are used with System::setCallback.\n\n    [REMARKS]\n    Each callback has commanddata parameters passed as void* unique to the type of callback.<br>\n    See reference to FMOD_SYSTEM_CALLBACK to determine what they might mean for each type of callback.<br>\n    <br>\n    <b>Note!</b> Using FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED (on Mac only) requires the application to be running an event loop which will allow external changes to device list to be detected by FMOD.\n    <br>\n    <b>Note!</b> The 'system' object pointer will be null for FMOD_SYSTEM_CALLBACKTYPE_THREADCREATED and FMOD_SYSTEM_CALLBACKTYPE_MEMORYALLOCATIONFAILED callbacks.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::setCallback\n    FMOD_SYSTEM_CALLBACK\n    System::update\n    DSP::addInput\n]\n*/\ntypedef enum\n{\n    FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED,         /* Called from System::update when the enumerated list of devices has changed. */\n    FMOD_SYSTEM_CALLBACKTYPE_DEVICELOST,                /* Called from System::update when an output device has been lost due to control panel parameter changes and FMOD cannot automatically recover. */\n    FMOD_SYSTEM_CALLBACKTYPE_MEMORYALLOCATIONFAILED,    /* Called directly when a memory allocation fails somewhere in FMOD.  (NOTE - 'system' will be NULL in this callback type.)*/\n    FMOD_SYSTEM_CALLBACKTYPE_THREADCREATED,             /* Called directly when a thread is created. (NOTE - 'system' will be NULL in this callback type.) */\n    FMOD_SYSTEM_CALLBACKTYPE_BADDSPCONNECTION,          /* Called when a bad connection was made with DSP::addInput. Usually called from mixer thread because that is where the connections are made.  */\n    FMOD_SYSTEM_CALLBACKTYPE_BADDSPLEVEL,               /* Called when too many effects were added exceeding the maximum tree depth of 128.  This is most likely caused by accidentally adding too many DSP effects. Usually called from mixer thread because that is where the connections are made.  */\n\n    FMOD_SYSTEM_CALLBACKTYPE_MAX,                       /* Maximum number of callback types supported. */\n    FMOD_SYSTEM_CALLBACKTYPE_FORCEINT = 65536           /* Makes sure this enum is signed 32bit. */\n} FMOD_SYSTEM_CALLBACKTYPE;\n\n\n/* \n    FMOD Callbacks\n*/\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SYSTEM_CALLBACK)       (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACKTYPE type, void *commanddata1, void *commanddata2);\n\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CHANNEL_CALLBACK)      (FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, void *commanddata1, void *commanddata2);\n\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_NONBLOCKCALLBACK)(FMOD_SOUND *sound, FMOD_RESULT result);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_PCMREADCALLBACK)(FMOD_SOUND *sound, void *data, unsigned int datalen);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_PCMSETPOSCALLBACK)(FMOD_SOUND *sound, int subsound, unsigned int position, FMOD_TIMEUNIT postype);\n\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_OPENCALLBACK)     (const char *name, int unicode, unsigned int *filesize, void **handle, void **userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_CLOSECALLBACK)    (void *handle, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_READCALLBACK)     (void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_SEEKCALLBACK)     (void *handle, unsigned int pos, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_ASYNCREADCALLBACK)(FMOD_ASYNCREADINFO *info, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_ASYNCCANCELCALLBACK)(void *handle, void *userdata);\n\ntypedef void *      (F_CALLBACK *FMOD_MEMORY_ALLOCCALLBACK)  (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);\ntypedef void *      (F_CALLBACK *FMOD_MEMORY_REALLOCCALLBACK)(void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);\ntypedef void        (F_CALLBACK *FMOD_MEMORY_FREECALLBACK)   (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr);\n\ntypedef float       (F_CALLBACK *FMOD_3D_ROLLOFFCALLBACK)    (FMOD_CHANNEL *channel, float distance);\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of windowing methods used in spectrum analysis to reduce leakage / transient signals intefering with the analysis.<br>\n    This is a problem with analysis of continuous signals that only have a small portion of the signal sample (the fft window size).<br>\n    Windowing the signal with a curve or triangle tapers the sides of the fft window to help alleviate this problem.\n\n    [REMARKS]\n    Cyclic signals such as a sine wave that repeat their cycle in a multiple of the window size do not need windowing.<br>\n    I.e. If the sine wave repeats every 1024, 512, 256 etc samples and the FMOD fft window is 1024, then the signal would not need windowing.<br>\n    Not windowing is the same as FMOD_DSP_FFT_WINDOW_RECT, which is the default.<br>\n    If the cycle of the signal (ie the sine wave) is not a multiple of the window size, it will cause frequency abnormalities, so a different windowing method is needed.<br>\n    <exclude>\n    <br>\n    FMOD_DSP_FFT_WINDOW_RECT.<br>\n    <img src=\"..\\static\\rectangle.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_TRIANGLE.<br>\n    <img src=\"..\\static\\triangle.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_HAMMING.<br>\n    <img src=\"..\\static\\hamming.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_HANNING.<br>\n    <img src=\"..\\static\\hanning.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_BLACKMAN.<br>\n    <img src=\"..\\static\\blackman.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS.<br>\n    <img src=\"..\\static\\blackmanharris.gif\"></img>\n    </exclude>\n    \n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::getSpectrum\n    Channel::getSpectrum\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_FFT_WINDOW_RECT,            /* w[n] = 1.0                                                                                            */\n    FMOD_DSP_FFT_WINDOW_TRIANGLE,        /* w[n] = TRI(2n/N)                                                                                      */\n    FMOD_DSP_FFT_WINDOW_HAMMING,         /* w[n] = 0.54 - (0.46 * COS(n/N) )                                                                      */\n    FMOD_DSP_FFT_WINDOW_HANNING,         /* w[n] = 0.5 *  (1.0  - COS(n/N) )                                                                      */\n    FMOD_DSP_FFT_WINDOW_BLACKMAN,        /* w[n] = 0.42 - (0.5  * COS(n/N) ) + (0.08 * COS(2.0 * n/N) )                                           */\n    FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS,  /* w[n] = 0.35875 - (0.48829 * COS(1.0 * n/N)) + (0.14128 * COS(2.0 * n/N)) - (0.01168 * COS(3.0 * n/N)) */\n    \n    FMOD_DSP_FFT_WINDOW_MAX,             /* Maximum number of FFT window types supported. */\n    FMOD_DSP_FFT_WINDOW_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_DSP_FFT_WINDOW;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of interpolation types that the FMOD Ex software mixer supports.  \n\n    [REMARKS]\n    The default resampler type is FMOD_DSP_RESAMPLER_LINEAR.<br>\n    Use System::setSoftwareFormat to tell FMOD the resampling quality you require for FMOD_SOFTWARE based sounds.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::setSoftwareFormat\n    System::getSoftwareFormat\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_RESAMPLER_NOINTERP,        /* No interpolation.  High frequency aliasing hiss will be audible depending on the sample rate of the sound. */\n    FMOD_DSP_RESAMPLER_LINEAR,          /* Linear interpolation (default method).  Fast and good quality, causes very slight lowpass effect on low frequency sounds. */\n    FMOD_DSP_RESAMPLER_CUBIC,           /* Cubic interpolation.  Slower than linear interpolation but better quality. */\n    FMOD_DSP_RESAMPLER_SPLINE,          /* 5 point spline interpolation.  Slowest resampling method but best quality. */\n\n    FMOD_DSP_RESAMPLER_MAX,             /* Maximum number of resample methods supported. */\n    FMOD_DSP_RESAMPLER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_DSP_RESAMPLER;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of tag types that could be stored within a sound.  These include id3 tags, metadata from netstreams and vorbis/asf data.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n]\n*/\ntypedef enum\n{\n    FMOD_TAGTYPE_UNKNOWN = 0,\n    FMOD_TAGTYPE_ID3V1,\n    FMOD_TAGTYPE_ID3V2,\n    FMOD_TAGTYPE_VORBISCOMMENT,\n    FMOD_TAGTYPE_SHOUTCAST,\n    FMOD_TAGTYPE_ICECAST,\n    FMOD_TAGTYPE_ASF,\n    FMOD_TAGTYPE_MIDI,\n    FMOD_TAGTYPE_PLAYLIST,\n    FMOD_TAGTYPE_FMOD,\n    FMOD_TAGTYPE_USER,\n\n    FMOD_TAGTYPE_MAX,               /* Maximum number of tag types supported. */\n    FMOD_TAGTYPE_FORCEINT = 65536   /* Makes sure this enum is signed 32bit. */\n} FMOD_TAGTYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of data types that can be returned by Sound::getTag\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n]\n*/\ntypedef enum\n{\n    FMOD_TAGDATATYPE_BINARY = 0,\n    FMOD_TAGDATATYPE_INT,\n    FMOD_TAGDATATYPE_FLOAT,\n    FMOD_TAGDATATYPE_STRING,\n    FMOD_TAGDATATYPE_STRING_UTF16,\n    FMOD_TAGDATATYPE_STRING_UTF16BE,\n    FMOD_TAGDATATYPE_STRING_UTF8,\n    FMOD_TAGDATATYPE_CDTOC,\n\n    FMOD_TAGDATATYPE_MAX,               /* Maximum number of tag datatypes supported. */\n    FMOD_TAGDATATYPE_FORCEINT = 65536   /* Makes sure this enum is signed 32bit. */\n} FMOD_TAGDATATYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    Types of delay that can be used with Channel::setDelay / Channel::getDelay.\n\n    [REMARKS]\n    If you haven't called Channel::setDelay yet, if you call Channel::getDelay with FMOD_DELAYTYPE_DSPCLOCK_START it will return the \n    equivalent global DSP clock value to determine when a channel started, so that you can use it for other channels to sync against.<br>\n    <br>\n    Use System::getDSPClock to also get the current dspclock time, a base for future calls to Channel::setDelay.<br>\n    <br>\n    Use FMOD_64BIT_ADD or FMOD_64BIT_SUB to add a hi/lo combination together and cope with wraparound.\n    <br>\n    If FMOD_DELAYTYPE_END_MS is specified, the value is not treated as a 64 bit number, just the delayhi value is used and it is treated as milliseconds.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Channel::setDelay\n    Channel::getDelay\n    System::getDSPClock\n]\n*/\ntypedef enum\n{\n    FMOD_DELAYTYPE_END_MS,              /* Delay at the end of the sound in milliseconds.  Use delayhi only.   Channel::isPlaying will remain true until this delay has passed even though the sound itself has stopped playing.*/\n    FMOD_DELAYTYPE_DSPCLOCK_START,      /* Time the sound started if Channel::getDelay is used, or if Channel::setDelay is used, the sound will delay playing until this exact tick. */\n    FMOD_DELAYTYPE_DSPCLOCK_END,        /* Time the sound should end. If this is non-zero, the channel will go silent at this exact tick. */\n    FMOD_DELAYTYPE_DSPCLOCK_PAUSE,      /* Time the sound should pause. If this is non-zero, the channel will pause at this exact tick. */\n\n    FMOD_DELAYTYPE_MAX,                 /* Maximum number of tag datatypes supported. */\n    FMOD_DELAYTYPE_FORCEINT = 65536     /* Makes sure this enum is signed 32bit. */\n} FMOD_DELAYTYPE;\n\n\n#define FMOD_64BIT_ADD(_hi1, _lo1, _hi2, _lo2) _hi1 += ((_hi2) + ((((_lo1) + (_lo2)) < (_lo1)) ? 1 : 0)); (_lo1) += (_lo2);\n#define FMOD_64BIT_SUB(_hi1, _lo1, _hi2, _lo2) _hi1 -= ((_hi2) + ((((_lo1) - (_lo2)) > (_lo1)) ? 1 : 0)); (_lo1) -= (_lo2);\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a piece of tag data.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n    FMOD_TAGTYPE\n    FMOD_TAGDATATYPE\n]\n*/\ntypedef struct FMOD_TAG\n{\n    FMOD_TAGTYPE      type;         /* [r] The type of this tag. */\n    FMOD_TAGDATATYPE  datatype;     /* [r] The type of data that this tag contains */\n    char             *name;         /* [r] The name of this tag i.e. \"TITLE\", \"ARTIST\" etc. */\n    void             *data;         /* [r] Pointer to the tag data - its format is determined by the datatype member */\n    unsigned int      datalen;      /* [r] Length of the data contained in this tag */\n    FMOD_BOOL         updated;      /* [r] True if this tag has been updated since last being accessed with Sound::getTag */\n} FMOD_TAG;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a CD/DVD table of contents\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n]\n*/\ntypedef struct FMOD_CDTOC\n{\n    int numtracks;                  /* [r] The number of tracks on the CD */\n    int min[100];                   /* [r] The start offset of each track in minutes */\n    int sec[100];                   /* [r] The start offset of each track in seconds */\n    int frame[100];                 /* [r] The start offset of each track in frames */\n} FMOD_CDTOC;\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_TIMEUNIT\n\n    [DESCRIPTION]   \n    List of time types that can be returned by Sound::getLength and used with Channel::setPosition or Channel::getPosition.\n\n    [REMARKS]\n    FMOD_TIMEUNIT_SENTENCE_MS, FMOD_TIMEUNIT_SENTENCE_PCM, FMOD_TIMEUNIT_SENTENCE_PCMBYTES, FMOD_TIMEUNIT_SENTENCE and FMOD_TIMEUNIT_SENTENCE_SUBSOUND are only supported by Channel functions.\n    Do not combine flags except FMOD_TIMEUNIT_BUFFERED.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getLength\n    Channel::setPosition\n    Channel::getPosition\n]\n*/\n#define FMOD_TIMEUNIT_MS                0x00000001  /* Milliseconds. */\n#define FMOD_TIMEUNIT_PCM               0x00000002  /* PCM samples, related to milliseconds * samplerate / 1000. */\n#define FMOD_TIMEUNIT_PCMBYTES          0x00000004  /* Bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes). */\n#define FMOD_TIMEUNIT_RAWBYTES          0x00000008  /* Raw file bytes of (compressed) sound data (does not include headers).  Only used by Sound::getLength and Channel::getPosition. */\n#define FMOD_TIMEUNIT_PCMFRACTION       0x00000010  /* Fractions of 1 PCM sample.  Unsigned int range 0 to 0xFFFFFFFF.  Used for sub-sample granularity for DSP purposes. */\n#define FMOD_TIMEUNIT_MODORDER          0x00000100  /* MOD/S3M/XM/IT.  Order in a sequenced module format.  Use Sound::getFormat to determine the PCM format being decoded to. */\n#define FMOD_TIMEUNIT_MODROW            0x00000200  /* MOD/S3M/XM/IT.  Current row in a sequenced module format.  Sound::getLength will return the number of rows in the currently playing or seeked to pattern. */\n#define FMOD_TIMEUNIT_MODPATTERN        0x00000400  /* MOD/S3M/XM/IT.  Current pattern in a sequenced module format.  Sound::getLength will return the number of patterns in the song and Channel::getPosition will return the currently playing pattern. */\n#define FMOD_TIMEUNIT_SENTENCE_MS       0x00010000  /* Currently playing subsound in a sentence time in milliseconds. */\n#define FMOD_TIMEUNIT_SENTENCE_PCM      0x00020000  /* Currently playing subsound in a sentence time in PCM Samples, related to milliseconds * samplerate / 1000. */\n#define FMOD_TIMEUNIT_SENTENCE_PCMBYTES 0x00040000  /* Currently playing subsound in a sentence time in bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes). */\n#define FMOD_TIMEUNIT_SENTENCE          0x00080000  /* Currently playing sentence index according to the channel. */\n#define FMOD_TIMEUNIT_SENTENCE_SUBSOUND 0x00100000  /* Currently playing subsound index in a sentence. */\n#define FMOD_TIMEUNIT_BUFFERED          0x10000000  /* Time value as seen by buffered stream.  This is always ahead of audible time, and is only used for processing. */\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]\n    When creating a multichannel sound, FMOD will pan them to their default speaker locations, for example a 6 channel sound will default to one channel per 5.1 output speaker.<br>\n    Another example is a stereo sound.  It will default to left = front left, right = front right.<br>\n    <br>\n    This is for sounds that are not 'default'.  For example you might have a sound that is 6 channels but actually made up of 3 stereo pairs, that should all be located in front left, front right only.\n\n    [REMARKS]\n    For full flexibility of speaker assignments, use Channel::setSpeakerLevels.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_CREATESOUNDEXINFO\n    Channel::setSpeakerLevels\n]\n*/\ntypedef enum\n{\n    FMOD_SPEAKERMAPTYPE_DEFAULT,     /* This is the default, and just means FMOD decides which speakers it puts the source channels. */\n    FMOD_SPEAKERMAPTYPE_ALLMONO,     /* This means the sound is made up of all mono sounds.  All voices will be panned to the front center by default in this case.  */\n    FMOD_SPEAKERMAPTYPE_ALLSTEREO,   /* This means the sound is made up of all stereo sounds.  All voices will be panned to front left and front right alternating every second channel.  */\n    FMOD_SPEAKERMAPTYPE_51_PROTOOLS  /* Map a 5.1 sound to use protools L C R Ls Rs LFE mapping.  Will return an error if not a 6 channel sound. */\n} FMOD_SPEAKERMAPTYPE;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Use this structure with System::createSound when more control is needed over loading.<br>\n    The possible reasons to use this with System::createSound are:<br>\n    <li>Loading a file from memory.\n    <li>Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length.\n    <li>To create a user created / non file based sound.\n    <li>To specify a starting subsound to seek to within a multi-sample sounds (ie FSB/DLS/SF2) when created as a stream.\n    <li>To specify which subsounds to load for multi-sample sounds (ie FSB/DLS/SF2) so that memory is saved and only a subset is actually loaded/read from disk.\n    <li>To specify 'piggyback' read and seek callbacks for capture of sound data as fmod reads and decodes it.  Useful for ripping decoded PCM data from sounds as they are loaded / played.\n    <li>To specify a MIDI DLS/SF2 sample set file to load when opening a MIDI file.\n    See below on what members to fill for each of the above types of sound you want to create.\n\n    [REMARKS]\n    This structure is optional!  Specify 0 or NULL in System::createSound if you don't need it!<br>\n    <br>\n    <u>Loading a file from memory.</u><br>\n    <li>Create the sound using the FMOD_OPENMEMORY flag.<br>\n    <li>Mandatory.  Specify 'length' for the size of the memory block in bytes.\n    <li>Other flags are optional.\n    <br>\n    <br>\n    <u>Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length.</u><br>\n    <li>Mandatory.  Specify 'fileoffset' and 'length'.\n    <li>Other flags are optional.\n    <br>\n    <br>\n    <u>To create a user created / non file based sound.</u><br>\n    <li>Create the sound using the FMOD_OPENUSER flag.\n    <li>Mandatory.  Specify 'defaultfrequency, 'numchannels' and 'format'.\n    <li>Other flags are optional.\n    <br>\n    <br>\n    <u>To specify a starting subsound to seek to and flush with, within a multi-sample stream (ie FSB/DLS/SF2).</u><br>\n    <br>\n    <li>Mandatory.  Specify 'initialsubsound'.\n    <br>\n    <br>\n    <u>To specify which subsounds to load for multi-sample sounds (ie FSB/DLS/SF2) so that memory is saved and only a subset is actually loaded/read from disk.</u><br>\n    <br>\n    <li>Mandatory.  Specify 'inclusionlist' and 'inclusionlistnum'.\n    <br>\n    <br>\n    <u>To specify 'piggyback' read and seek callbacks for capture of sound data as fmod reads and decodes it.  Useful for ripping decoded PCM data from sounds as they are loaded / played.</u><br>\n    <br>\n    <li>Mandatory.  Specify 'pcmreadcallback' and 'pcmseekcallback'.\n    <br>\n    <br>\n    <u>To specify a MIDI DLS/SF2 sample set file to load when opening a MIDI file.</u><br>\n    <br>\n    <li>Mandatory.  Specify 'dlsname'.\n    <br>\n    <br>\n    Setting the 'decodebuffersize' is for cpu intensive codecs that may be causing stuttering, not file intensive codecs (ie those from CD or netstreams) which are normally \n    altered with System::setStreamBufferSize.  As an example of cpu intensive codecs, an mp3 file will take more cpu to decode than a PCM wav file.<br>\n    If you have a stuttering effect, then it is using more cpu than the decode buffer playback rate can keep up with.  Increasing the decode buffersize will most likely solve this problem.<br>\n    <br>\n    <br>\n    FSB codec.  If inclusionlist and numsubsounds are used together, this will trigger a special mode where subsounds are shuffled down to save memory.  (useful for large FSB \n    files where you only want to load 1 sound).  There will be no gaps, ie no null subsounds.  As an example, if there are 10,000 subsounds and there is an inclusionlist with only 1 entry, \n    and numsubsounds = 1, then subsound 0 will be that entry, and there will only be the memory allocated for 1 subsound.  Previously there would still be 10,000 subsound pointers and other\n    associated codec entries allocated along with it multiplied by 10,000.<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createSound\n    System::setStreamBufferSize\n    FMOD_MODE\n    FMOD_SOUND_FORMAT\n    FMOD_SOUND_TYPE\n    FMOD_SPEAKERMAPTYPE\n]\n*/\ntypedef struct FMOD_CREATESOUNDEXINFO\n{\n    int                            cbsize;             /* [w] Size of this structure.  This is used so the structure can be expanded in the future and still work on older versions of FMOD Ex. */\n    unsigned int                   length;             /* [w] Optional. Specify 0 to ignore. Size in bytes of file to load, or sound to create (in this case only if FMOD_OPENUSER is used).  Required if loading from memory.  If 0 is specified, then it will use the size of the file (unless loading from memory then an error will be returned). */\n    unsigned int                   fileoffset;         /* [w] Optional. Specify 0 to ignore. Offset from start of the file to start loading from.  This is useful for loading files from inside big data files. */\n    int                            numchannels;        /* [w] Optional. Specify 0 to ignore. Number of channels in a sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used. */\n    int                            defaultfrequency;   /* [w] Optional. Specify 0 to ignore. Default frequency of sound in a sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used.  Other formats use the frequency determined by the file format. */\n    FMOD_SOUND_FORMAT              format;             /* [w] Optional. Specify 0 or FMOD_SOUND_FORMAT_NONE to ignore. Format of the sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used.  Other formats use the format determined by the file format.   */\n    unsigned int                   decodebuffersize;   /* [w] Optional. Specify 0 to ignore. For streams.  This determines the size of the double buffer (in PCM samples) that a stream uses.  Use this for user created streams if you want to determine the size of the callback buffer passed to you.  Specify 0 to use FMOD's default size which is currently equivalent to 400ms of the sound format created/loaded. */\n    int                            initialsubsound;    /* [w] Optional. Specify 0 to ignore. In a multi-sample file format such as .FSB/.DLS/.SF2, specify the initial subsound to seek to, only if FMOD_CREATESTREAM is used. */\n    int                            numsubsounds;       /* [w] Optional. Specify 0 to ignore or have no subsounds.  In a sound created with FMOD_OPENUSER, specify the number of subsounds that are accessable with Sound::getSubSound.  If not created with FMOD_OPENUSER, this will limit the number of subsounds loaded within a multi-subsound file.  If using FSB, then if FMOD_CREATESOUNDEXINFO::inclusionlist is used, this will shuffle subsounds down so that there are not any gaps.  It will mean that the indices of the sounds will be different. */\n    int                           *inclusionlist;      /* [w] Optional. Specify 0 to ignore. In a multi-sample format such as .FSB/.DLS/.SF2 it may be desirable to specify only a subset of sounds to be loaded out of the whole file.  This is an array of subsound indices to load into memory when created. */\n    int                            inclusionlistnum;   /* [w] Optional. Specify 0 to ignore. This is the number of integers contained within the inclusionlist array. */\n    FMOD_SOUND_PCMREADCALLBACK     pcmreadcallback;    /* [w] Optional. Specify 0 to ignore. Callback to 'piggyback' on FMOD's read functions and accept or even write PCM data while FMOD is opening the sound.  Used for user sounds created with FMOD_OPENUSER or for capturing decoded data as FMOD reads it. */\n    FMOD_SOUND_PCMSETPOSCALLBACK   pcmsetposcallback;  /* [w] Optional. Specify 0 to ignore. Callback for when the user calls a seeking function such as Channel::setTime or Channel::setPosition within a multi-sample sound, and for when it is opened.*/\n    FMOD_SOUND_NONBLOCKCALLBACK    nonblockcallback;   /* [w] Optional. Specify 0 to ignore. Callback for successful completion, or error while loading a sound that used the FMOD_NONBLOCKING flag.*/\n    const char                    *dlsname;            /* [w] Optional. Specify 0 to ignore. Filename for a DLS or SF2 sample set when loading a MIDI file. If not specified, on Windows it will attempt to open /windows/system32/drivers/gm.dls or /windows/system32/drivers/etc/gm.dls, on Mac it will attempt to load /System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls, otherwise the MIDI will fail to open. Current DLS support is for level 1 of the specification. */\n    const char                    *encryptionkey;      /* [w] Optional. Specify 0 to ignore. Key for encrypted FSB file.  Without this key an encrypted FSB file will not load. */\n    int                            maxpolyphony;       /* [w] Optional. Specify 0 to ignore. For sequenced formats with dynamic channel allocation such as .MID and .IT, this specifies the maximum voice count allowed while playing.  .IT defaults to 64.  .MID defaults to 32. */\n    void                          *userdata;           /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the sound during creation.  Access via Sound::getUserData.  Note: This is not passed to FMOD_FILE_OPENCALLBACK, that is a different userdata that is file specific. */\n    FMOD_SOUND_TYPE                suggestedsoundtype; /* [w] Optional. Specify 0 or FMOD_SOUND_TYPE_UNKNOWN to ignore.  Instead of scanning all codec types, use this to speed up loading by making it jump straight to this codec. */\n    FMOD_FILE_OPENCALLBACK         useropen;           /* [w] Optional. Specify 0 to ignore. Callback for opening this file. */\n    FMOD_FILE_CLOSECALLBACK        userclose;          /* [w] Optional. Specify 0 to ignore. Callback for closing this file. */\n    FMOD_FILE_READCALLBACK         userread;           /* [w] Optional. Specify 0 to ignore. Callback for reading from this file. */\n    FMOD_FILE_SEEKCALLBACK         userseek;           /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */\n    FMOD_FILE_ASYNCREADCALLBACK    userasyncread;      /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */\n    FMOD_FILE_ASYNCCANCELCALLBACK  userasynccancel;    /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */\n    FMOD_SPEAKERMAPTYPE            speakermap;         /* [w] Optional. Specify 0 to ignore. Use this to differ the way fmod maps multichannel sounds to speakers.  See FMOD_SPEAKERMAPTYPE for more. */\n    FMOD_SOUNDGROUP               *initialsoundgroup;  /* [w] Optional. Specify 0 to ignore. Specify a sound group if required, to put sound in as it is created. */\n    unsigned int                   initialseekposition;/* [w] Optional. Specify 0 to ignore. For streams. Specify an initial position to seek the stream to. */\n    FMOD_TIMEUNIT                  initialseekpostype; /* [w] Optional. Specify 0 to ignore. For streams. Specify the time unit for the position set in initialseekposition. */\n    int                            ignoresetfilesystem;/* [w] Optional. Specify 0 to ignore. Set to 1 to use fmod's built in file system. Ignores setFileSystem callbacks and also FMOD_CREATESOUNEXINFO file callbacks.  Useful for specific cases where you don't want to use your own file system but want to use fmod's file system (ie net streaming). */\n    int                            cddaforceaspi;      /* [w] Optional. Specify 0 to ignore. For CDDA sounds only - if non-zero use ASPI instead of NTSCSI to access the specified CD/DVD device. */\n    unsigned int                   audioqueuepolicy;   /* [w] Optional. Specify 0 or FMOD_AUDIOQUEUE_CODECPOLICY_DEFAULT to ignore. Policy used to determine whether hardware or software is used for decoding, see FMOD_AUDIOQUEUE_CODECPOLICY for options (iOS >= 3.0 required, otherwise only hardware is available) */ \n    unsigned int                   minmidigranularity; /* [w] Optional. Specify 0 to ignore. Allows you to set a minimum desired MIDI mixer granularity. Values smaller than 512 give greater than default accuracy at the cost of more CPU and vice versa. Specify 0 for default (512 samples). */\n    int                            nonblockthreadid;   /* [w] Optional. Specify 0 to ignore. Specifies a thread index to execute non blocking load on.  Allows for up to 5 threads to be used for loading at once.  This is to avoid one load blocking another.  Maximum value = 4. */\n} FMOD_CREATESOUNDEXINFO;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure defining a reverb environment.<br>\n\n    [REMARKS]\n    Note the default reverb properties are the same as the FMOD_PRESET_GENERIC preset.<br>\n    Note that integer values that typically range from -10,000 to 1000 are represented in \n    decibels, and are of a logarithmic scale, not linear, wheras float values are always linear.<br>\n    <br>\n    The numerical values listed below are the maximum, minimum and default values for each variable respectively.<br>\n    <br>\n    <b>SUPPORTED</b> next to each parameter means the platform the parameter can be set on.  Some platforms support all parameters and some don't.<br>\n    WII   means Nintendo Wii hardware reverb (must use FMOD_HARDWARE).<br>\n    PSP   means Playstation Portable hardware reverb (must use FMOD_HARDWARE).<br>\n    SFX   means FMOD SFX software reverb.  This works on any platform that uses FMOD_SOFTWARE for loading sounds.<br>\n    ---   means unsupported/deprecated.  Will either be removed or supported by SFX in the future.\n    <br>\n    Nintendo Wii Notes:<br>\n    This structure supports only limited parameters, and maps them to the Wii hardware reverb as follows.<br>\n    DecayTime = 'time'<br>\n    ReverbDelay = 'predelay'<br>\n    ModulationDepth = 'damping'<br>\n    Reflections = 'coloration'<br>\n    EnvDiffusion = 'crosstalk'<br>\n    Room = 'mix'<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [r/w] are either read or write depending on if you are using System::setReverbProperties (w) or System::getReverbProperties (r).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setReverbProperties\n    System::getReverbProperties\n    FMOD_REVERB_PRESETS\n    FMOD_REVERB_FLAGS\n]\n*/\ntypedef struct FMOD_REVERB_PROPERTIES\n{                                   /*       MIN    MAX    DEFAULT DESCRIPTION */\n    int          Instance;          /* [w]   0      3      0       Environment Instance.                                                 (SUPPORTED:SFX(4 instances) and Wii (3 instances)) */\n    int          Environment;       /* [r/w] -1     25     -1      Sets all listener properties.  -1 = OFF.                              (SUPPORTED:SFX(-1 only)/PSP) */\n    float        EnvDiffusion;      /* [r/w] 0.0    1.0    1.0     Environment diffusion                                                 (SUPPORTED:WII) */\n    int          Room;              /* [r/w] -10000 0      -1000   Room effect level (at mid frequencies)                                (SUPPORTED:SFX/WII/PSP) */\n    int          RoomHF;            /* [r/w] -10000 0      -100    Relative room effect level at high frequencies                        (SUPPORTED:SFX) */\n    int          RoomLF;            /* [r/w] -10000 0      0       Relative room effect level at low frequencies                         (SUPPORTED:SFX) */\n    float        DecayTime;         /* [r/w] 0.1    20.0   1.49    Reverberation decay time at mid frequencies                           (SUPPORTED:SFX/WII) */\n    float        DecayHFRatio;      /* [r/w] 0.1    2.0    0.83    High-frequency to mid-frequency decay time ratio                      (SUPPORTED:SFX) */\n    float        DecayLFRatio;      /* [r/w] 0.1    2.0    1.0     Low-frequency to mid-frequency decay time ratio                       (SUPPORTED:---) */\n    int          Reflections;       /* [r/w] -10000 1000   -2602   Early reflections level relative to room effect                       (SUPPORTED:SFX/WII) */\n    float        ReflectionsDelay;  /* [r/w] 0.0    0.3    0.007   Initial reflection delay time                                         (SUPPORTED:SFX) */\n    int          Reverb;            /* [r/w] -10000 2000   200     Late reverberation level relative to room effect                      (SUPPORTED:SFX) */\n    float        ReverbDelay;       /* [r/w] 0.0    0.1    0.011   Late reverberation delay time relative to initial reflection          (SUPPORTED:SFX/WII) */\n    float        ModulationTime;    /* [r/w] 0.04   4.0    0.25    Modulation time                                                       (SUPPORTED:---) */\n    float        ModulationDepth;   /* [r/w] 0.0    1.0    0.0     Modulation depth                                                      (SUPPORTED:WII) */\n    float        HFReference;       /* [r/w] 1000.0 20000  5000.0  Reference high frequency (hz)                                         (SUPPORTED:SFX) */\n    float        LFReference;       /* [r/w] 20.0   1000.0 250.0   Reference low frequency (hz)                                          (SUPPORTED:SFX) */\n    float        Diffusion;         /* [r/w] 0.0    100.0  100.0   Value that controls the echo density in the late reverberation decay. (SUPPORTED:SFX) */\n    float        Density;           /* [r/w] 0.0    100.0  100.0   Value that controls the modal density in the late reverberation decay (SUPPORTED:SFX) */\n    unsigned int Flags;             /* [r/w] FMOD_REVERB_FLAGS - modifies the behavior of above properties                               (SUPPORTED:WII) */\n} FMOD_REVERB_PROPERTIES;\n\n\n/*\n[DEFINE] \n[\n    [NAME] \n    FMOD_REVERB_FLAGS\n\n    [DESCRIPTION]\n    Values for the Flags member of the FMOD_REVERB_PROPERTIES structure.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_REVERB_PROPERTIES\n]\n*/\n#define FMOD_REVERB_FLAGS_HIGHQUALITYREVERB     0x00000400 /* Wii. Use high quality reverb */\n#define FMOD_REVERB_FLAGS_HIGHQUALITYDPL2REVERB 0x00000800 /* Wii. Use high quality DPL2 reverb */\n#define FMOD_REVERB_FLAGS_DEFAULT               0x00000000\n/* [DEFINE_END] */\n\n\n/*\n[DEFINE] \n[\n    [NAME] \n    FMOD_REVERB_PRESETS\n\n    [DESCRIPTION]   \n    A set of predefined environment PARAMETERS.<br>\n    These are used to initialize an FMOD_REVERB_PROPERTIES structure statically.<br>\n    i.e.<br>\n    FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_GENERIC;\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setReverbProperties\n]\n*/\n/*                                    Inst Env  Diffus  Room   RoomHF  RmLF DecTm   DecHF  DecLF   Refl  RefDel   Revb  RevDel  ModTm  ModDp   HFRef    LFRef   Diffus  Densty  FLAGS */\n#define FMOD_PRESET_OFF              {  0, -1,  1.00f, -10000, -10000, 0,   1.00f,  1.00f, 1.0f,  -2602, 0.007f,   200, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f,   0.0f,   0.0f, 0x33f }\n#define FMOD_PRESET_GENERIC          {  0,  0,  1.00f, -1000,  -100,   0,   1.49f,  0.83f, 1.0f,  -2602, 0.007f,   200, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_PADDEDCELL       {  0,  1,  1.00f, -1000,  -6000,  0,   0.17f,  0.10f, 1.0f,  -1204, 0.001f,   207, 0.002f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_ROOM             {  0,  2,  1.00f, -1000,  -454,   0,   0.40f,  0.83f, 1.0f,  -1646, 0.002f,    53, 0.003f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_BATHROOM         {  0,  3,  1.00f, -1000,  -1200,  0,   1.49f,  0.54f, 1.0f,   -370, 0.007f,  1030, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f,  60.0f, 0x3f }\n#define FMOD_PRESET_LIVINGROOM       {  0,  4,  1.00f, -1000,  -6000,  0,   0.50f,  0.10f, 1.0f,  -1376, 0.003f, -1104, 0.004f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_STONEROOM        {  0,  5,  1.00f, -1000,  -300,   0,   2.31f,  0.64f, 1.0f,   -711, 0.012f,    83, 0.017f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_AUDITORIUM       {  0,  6,  1.00f, -1000,  -476,   0,   4.32f,  0.59f, 1.0f,   -789, 0.020f,  -289, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CONCERTHALL      {  0,  7,  1.00f, -1000,  -500,   0,   3.92f,  0.70f, 1.0f,  -1230, 0.020f,    -2, 0.029f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CAVE             {  0,  8,  1.00f, -1000,  0,      0,   2.91f,  1.30f, 1.0f,   -602, 0.015f,  -302, 0.022f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x1f }\n#define FMOD_PRESET_ARENA            {  0,  9,  1.00f, -1000,  -698,   0,   7.24f,  0.33f, 1.0f,  -1166, 0.020f,    16, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_HANGAR           {  0,  10, 1.00f, -1000,  -1000,  0,   10.05f, 0.23f, 1.0f,   -602, 0.020f,   198, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CARPETTEDHALLWAY {  0,  11, 1.00f, -1000,  -4000,  0,   0.30f,  0.10f, 1.0f,  -1831, 0.002f, -1630, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_HALLWAY          {  0,  12, 1.00f, -1000,  -300,   0,   1.49f,  0.59f, 1.0f,  -1219, 0.007f,   441, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_STONECORRIDOR    {  0,  13, 1.00f, -1000,  -237,   0,   2.70f,  0.79f, 1.0f,  -1214, 0.013f,   395, 0.020f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_ALLEY            {  0,  14, 0.30f, -1000,  -270,   0,   1.49f,  0.86f, 1.0f,  -1204, 0.007f,    -4, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_FOREST           {  0,  15, 0.30f, -1000,  -3300,  0,   1.49f,  0.54f, 1.0f,  -2560, 0.162f,  -229, 0.088f, 0.25f, 0.000f, 5000.0f, 250.0f,  79.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CITY             {  0,  16, 0.50f, -1000,  -800,   0,   1.49f,  0.67f, 1.0f,  -2273, 0.007f, -1691, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f,  50.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_MOUNTAINS        {  0,  17, 0.27f, -1000,  -2500,  0,   1.49f,  0.21f, 1.0f,  -2780, 0.300f, -1434, 0.100f, 0.25f, 0.000f, 5000.0f, 250.0f,  27.0f, 100.0f, 0x1f }\n#define FMOD_PRESET_QUARRY           {  0,  18, 1.00f, -1000,  -1000,  0,   1.49f,  0.83f, 1.0f, -10000, 0.061f,   500, 0.025f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_PLAIN            {  0,  19, 0.21f, -1000,  -2000,  0,   1.49f,  0.50f, 1.0f,  -2466, 0.179f, -1926, 0.100f, 0.25f, 0.000f, 5000.0f, 250.0f,  21.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_PARKINGLOT       {  0,  20, 1.00f, -1000,  0,      0,   1.65f,  1.50f, 1.0f,  -1363, 0.008f, -1153, 0.012f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x1f }\n#define FMOD_PRESET_SEWERPIPE        {  0,  21, 0.80f, -1000,  -1000,  0,   2.81f,  0.14f, 1.0f,    429, 0.014f,  1023, 0.021f, 0.25f, 0.000f, 5000.0f, 250.0f,  80.0f,  60.0f, 0x3f }\n#define FMOD_PRESET_UNDERWATER       {  0,  22, 1.00f, -1000,  -4000,  0,   1.49f,  0.10f, 1.0f,   -449, 0.007f,  1700, 0.011f, 1.18f, 0.348f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n\n/* PlayStation Portable Only presets */\n#define FMOD_PRESET_PSP_ROOM         {  0,  1,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_STUDIO_A     {  0,  2,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_STUDIO_B     {  0,  3,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_STUDIO_C     {  0,  4,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_HALL         {  0,  5,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_SPACE        {  0,  6,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_ECHO         {  0,  7,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_DELAY        {  0,  8,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_PIPE         {  0,  9,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n/* [DEFINE_END] */\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure defining the properties for a reverb source, related to a FMOD channel.<br>\n    <br>\n    Note the default reverb properties are the same as the FMOD_PRESET_GENERIC preset.<br>\n    Note that integer values that typically range from -10,000 to 1000 are represented in \n    decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear.<br>\n    PORTABILITY: Each member has the platform it supports in braces ie (win32/wii).<br>\n    <br>\n    The numerical values listed below are the maximum, minimum and default values for each variable respectively.<br>\n\n    [REMARKS]\n    <b>SUPPORTED</b> next to each parameter means the platform the parameter can be set on.  Some platforms support all parameters and some don't.<br>\n    WII   means Nintendo Wii hardware reverb (must use FMOD_HARDWARE).<br>\n    PSP   means Playstation Portable hardware reverb (must use FMOD_HARDWARE).<br>\n    SFX   means FMOD SFX software reverb.  This works on any platform that uses FMOD_SOFTWARE for loading sounds.<br>\n    ---   means unsupported/deprecated.  Will either be removed or supported by SFX in the future.\n    <br>\n    <br>\n    <b>'ConnectionPoint' Parameter.</b>  This parameter is for the FMOD software reverb only (known as SFX in the list above).<br>\n    By default the dsp network connection for a channel and its reverb is between the 'SFX Reverb' unit, and the channel's wavetable/resampler/dspcodec/oscillator unit (the unit below the channel DSP head).  NULL can be used for this parameter to make it use this default behaviour.<br>\n    This parameter allows the user to connect the SFX reverb to somewhere else internally, for example the channel DSP head, or a related channelgroup.  The event system uses this so that it can have the output of an event going to the reverb, instead of just the output of the event's channels (thereby ignoring event effects/submixes etc).<br>\n    Do not use if you are unaware of DSP network connection issues.  Leave it at the default of NULL instead.<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [r/w] are either read or write depending on if you are using Channel::setReverbProperties (w) or Channel::getReverbProperties (r).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    Channel::setReverbProperties\n    Channel::getReverbProperties\n    FMOD_REVERB_CHANNELFLAGS \n]\n*/\ntypedef struct FMOD_REVERB_CHANNELPROPERTIES\n{                                      /*       MIN    MAX  DEFAULT  DESCRIPTION */\n    int          Direct;               /* [r/w] -10000 1000 0        Direct path level                                        (SUPPORTED:SFX) */\n    int          Room;                 /* [r/w] -10000 1000 0        Room effect level                                        (SUPPORTED:SFX) */\n    unsigned int Flags;                /* [r/w] FMOD_REVERB_CHANNELFLAGS - modifies the behavior of properties                (SUPPORTED:SFX) */\n    FMOD_DSP    *ConnectionPoint;      /* [r/w] See remarks.         DSP network location to connect reverb for this channel. (SUPPORTED:SFX).*/\n} FMOD_REVERB_CHANNELPROPERTIES;\n\n\n/*\n[DEFINE] \n[\n    [NAME] \n    FMOD_REVERB_CHANNELFLAGS\n\n    [DESCRIPTION]\n    Values for the Flags member of the FMOD_REVERB_CHANNELPROPERTIES structure.\n\n    [REMARKS]\n    For SFX Reverb, there is support for multiple reverb environments.<br>\n    Use FMOD_REVERB_CHANNELFLAGS_ENVIRONMENT0 to FMOD_REVERB_CHANNELFLAGS_ENVIRONMENT3 in the flags member \n    of FMOD_REVERB_CHANNELPROPERTIES to specify which environment instance(s) to target. <br>\n    - If you do not specify any instance the first reverb instance will be used.<br>\n    - If you specify more than one instance with getReverbProperties, the first instance will be used.<br>\n    - If you specify more than one instance with setReverbProperties, it will set more than 1 instance at once.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_REVERB_CHANNELPROPERTIES\n]\n*/\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE0     0x00000010 /* SFX/Wii. Specify channel to target reverb instance 0.  Default target. */\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE1     0x00000020 /* SFX/Wii. Specify channel to target reverb instance 1. */\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE2     0x00000040 /* SFX/Wii. Specify channel to target reverb instance 2. */\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE3     0x00000080 /* SFX. Specify channel to target reverb instance 3. */\n\n#define FMOD_REVERB_CHANNELFLAGS_DEFAULT       FMOD_REVERB_CHANNELFLAGS_INSTANCE0\n/* [DEFINE_END] */\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Settings for advanced features like configuring memory and cpu usage for the FMOD_CREATECOMPRESSEDSAMPLE feature.\n\n    [REMARKS]\n    maxMPEGcodecs / maxADPCMcodecs / maxXMAcodecs will determine the maximum cpu usage of playing realtime samples.  Use this to lower potential excess cpu usage and also control memory usage.<br>\n    <br>\n    maxPCMcodecs is for use with PS3 only. It will determine the maximum number of PCM voices that can be played at once. This includes streams of any format and all sounds created\n    *without* the FMOD_CREATECOMPRESSEDSAMPLE flag.\n    <br>\n    Memory will be allocated for codecs 'up front' (during System::init) if these values are specified as non zero.  If any are zero, it allocates memory for the codec whenever a file of the type in question is loaded.  So if maxMPEGcodecs is 0 for example, it will allocate memory for the mpeg codecs the first time an mp3 is loaded or an mp3 based .FSB file is loaded.<br>\n    <br>\n    Due to inefficient encoding techniques on certain .wav based ADPCM files, FMOD can can need an extra 29720 bytes per codec.  This means for lowest memory consumption.  Use FSB as it uses an optimal/small ADPCM block size.<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [r/w] are either read or write depending on if you are using System::setAdvancedSettings (w) or System::getAdvancedSettings (r).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setAdvancedSettings\n    System::getAdvancedSettings\n    System::init\n    FMOD_MODE\n]\n*/\ntypedef struct FMOD_ADVANCEDSETTINGS\n{                       \n    int             cbsize;                     /* [w]   Size of this structure.  Use sizeof(FMOD_ADVANCEDSETTINGS)  NOTE: This must be set before calling System::getAdvancedSettings! */\n    int             maxMPEGcodecs;              /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  Mpeg  codecs consume 21,684 bytes per instance and this number will determine how many mpeg channels can be played simultaneously.   Default = 32. */\n    int             maxADPCMcodecs;             /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  ADPCM codecs consume  2,136 bytes per instance and this number will determine how many ADPCM channels can be played simultaneously.  Default = 32. */\n    int             maxXMAcodecs;               /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  XMA   codecs consume 14,836 bytes per instance and this number will determine how many XMA channels can be played simultaneously.    Default = 32. */\n    int             maxCELTcodecs;              /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  CELT  codecs consume 11,500 bytes per instance and this number will determine how many CELT channels can be played simultaneously.   Default = 32. */    \n    int             maxPCMcodecs;               /* [r/w] Optional. Specify 0 to ignore. For use with PS3 only.                          PCM   codecs consume 12,672 bytes per instance and this number will determine how many streams and PCM voices can be played simultaneously. Default = 16. */\n    int             ASIONumChannels;            /* [r/w] Optional. Specify 0 to ignore. Number of channels available on the ASIO device. */\n    char          **ASIOChannelList;            /* [r/w] Optional. Specify 0 to ignore. Pointer to an array of strings (number of entries defined by ASIONumChannels) with ASIO channel names. */\n    FMOD_SPEAKER   *ASIOSpeakerList;            /* [r/w] Optional. Specify 0 to ignore. Pointer to a list of speakers that the ASIO channels map to.  This can be called after System::init to remap ASIO output. */\n    int             max3DReverbDSPs;            /* [r/w] Optional. Specify 0 to ignore. The max number of 3d reverb DSP's in the system. (NOTE: CURRENTLY DISABLED / UNUSED) */\n    float           HRTFMinAngle;               /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_SOFTWARE_HRTF.  The angle range (0-360) of a 3D sound in relation to the listener, at which the HRTF function begins to have an effect. 0 = in front of the listener. 180 = from 90 degrees to the left of the listener to 90 degrees to the right. 360 = behind the listener. Default = 180.0. */\n    float           HRTFMaxAngle;               /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_SOFTWARE_HRTF.  The angle range (0-360) of a 3D sound in relation to the listener, at which the HRTF function has maximum effect. 0 = front of the listener. 180 = from 90 degrees to the left of the listener to 90 degrees to the right. 360 = behind the listener. Default = 360.0. */\n    float           HRTFFreq;                   /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_SOFTWARE_HRTF.  The cutoff frequency of the HRTF's lowpass filter function when at maximum effect. (i.e. at HRTFMaxAngle).  Default = 4000.0. */\n    float           vol0virtualvol;             /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_VOL0_BECOMES_VIRTUAL.  If this flag is used, and the volume is 0.0, then the sound will become virtual.  Use this value to raise the threshold to a different point where a sound goes virtual. */\n    int             eventqueuesize;             /* [r/w] Optional. Specify 0 to ignore. For use with FMOD Event system only.  Specifies the number of slots available for simultaneous non blocking loads, across all threads.  Default = 64. */\n    unsigned int    defaultDecodeBufferSize;    /* [r/w] Optional. Specify 0 to ignore. For streams. This determines the default size of the double buffer (in milliseconds) that a stream uses.  Default = 400ms */\n    char           *debugLogFilename;           /* [r/w] Optional. Specify 0 to ignore. Gives fmod's logging system a path/filename.  Normally the log is placed in the same directory as the executable and called fmod.log. When using System::getAdvancedSettings, provide at least 256 bytes of memory to copy into. */\n    unsigned short  profileport;                /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_ENABLE_PROFILE.  Specify the port to listen on for connections by the profiler application. */\n    unsigned int    geometryMaxFadeTime;        /* [r/w] Optional. Specify 0 to ignore. The maximum time in miliseconds it takes for a channel to fade to the new level when its occlusion changes. */\n    unsigned int    maxSpectrumWaveDataBuffers; /* [r/w] Optional. Specify 0 to ignore. Tells System::init to allocate a pool of wavedata/spectrum buffers to prevent memory fragmentation, any additional buffers will be allocated normally. */\n    unsigned int    musicSystemCacheDelay;      /* [r/w] Optional. Specify 0 to ignore. The delay the music system should allow for loading a sample from disk (in milliseconds). Default = 400 ms. */\n    float           distanceFilterCentreFreq;   /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_DISTANCE_FILTERING.  The default centre frequency in Hz for the distance filtering effect. Default = 1500.0. */\n} FMOD_ADVANCEDSETTINGS;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]\n    Special channel index values for FMOD functions.\n\n    [REMARKS]\n    To get 'all' of the channels, use System::getMasterChannelGroup.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::playSound\n    System::playDSP\n    System::getChannel\n    System::getMasterChannelGroup\n]\n*/\ntypedef enum\n{\n    FMOD_CHANNEL_FREE  = -1,      /* For a channel index, FMOD chooses a free voice using the priority system. */\n    FMOD_CHANNEL_REUSE = -2       /* For a channel index, re-use the channel handle that was passed in. */\n} FMOD_CHANNELINDEX;\n\n#include \"fmod_codec.h\"\n#include \"fmod_dsp.h\"\n#include \"fmod_memoryinfo.h\"\n\n/* ========================================================================================== */\n/* FUNCTION PROTOTYPES                                                                        */\n/* ========================================================================================== */\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\n/*\n    FMOD global system functions (optional).\n*/\n\nFMOD_RESULT F_API FMOD_Memory_Initialize           (void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags);\nFMOD_RESULT F_API FMOD_Memory_GetStats             (int *currentalloced, int *maxalloced, FMOD_BOOL blocking);\nFMOD_RESULT F_API FMOD_Debug_SetLevel              (FMOD_DEBUGLEVEL level);\nFMOD_RESULT F_API FMOD_Debug_GetLevel              (FMOD_DEBUGLEVEL *level);\nFMOD_RESULT F_API FMOD_File_SetDiskBusy            (int busy);\nFMOD_RESULT F_API FMOD_File_GetDiskBusy            (int *busy);\n\n/*\n    FMOD System factory functions.  Use this to create an FMOD System Instance.  below you will see FMOD_System_Init/Close to get started.\n*/\n\nFMOD_RESULT F_API FMOD_System_Create               (FMOD_SYSTEM **system); \nFMOD_RESULT F_API FMOD_System_Release              (FMOD_SYSTEM *system); \n\n/*$ preserve end $*/\n\n/*\n    'System' API\n*/\n\n/*\n     Pre-init functions.\n*/\n\nFMOD_RESULT F_API FMOD_System_SetOutput              (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE output);\nFMOD_RESULT F_API FMOD_System_GetOutput              (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE *output);\nFMOD_RESULT F_API FMOD_System_GetNumDrivers          (FMOD_SYSTEM *system, int *numdrivers);\nFMOD_RESULT F_API FMOD_System_GetDriverInfo          (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetDriverInfoW         (FMOD_SYSTEM *system, int id, short *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetDriverCaps          (FMOD_SYSTEM *system, int id, FMOD_CAPS *caps, int *controlpaneloutputrate, FMOD_SPEAKERMODE *controlpanelspeakermode);\nFMOD_RESULT F_API FMOD_System_SetDriver              (FMOD_SYSTEM *system, int driver);\nFMOD_RESULT F_API FMOD_System_GetDriver              (FMOD_SYSTEM *system, int *driver);\nFMOD_RESULT F_API FMOD_System_SetHardwareChannels    (FMOD_SYSTEM *system, int numhardwarechannels);\nFMOD_RESULT F_API FMOD_System_SetSoftwareChannels    (FMOD_SYSTEM *system, int numsoftwarechannels);\nFMOD_RESULT F_API FMOD_System_GetSoftwareChannels    (FMOD_SYSTEM *system, int *numsoftwarechannels);\nFMOD_RESULT F_API FMOD_System_SetSoftwareFormat      (FMOD_SYSTEM *system, int samplerate, FMOD_SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, FMOD_DSP_RESAMPLER resamplemethod);\nFMOD_RESULT F_API FMOD_System_GetSoftwareFormat      (FMOD_SYSTEM *system, int *samplerate, FMOD_SOUND_FORMAT *format, int *numoutputchannels, int *maxinputchannels, FMOD_DSP_RESAMPLER *resamplemethod, int *bits);\nFMOD_RESULT F_API FMOD_System_SetDSPBufferSize       (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers);\nFMOD_RESULT F_API FMOD_System_GetDSPBufferSize       (FMOD_SYSTEM *system, unsigned int *bufferlength, int *numbuffers);\nFMOD_RESULT F_API FMOD_System_SetFileSystem          (FMOD_SYSTEM *system, FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, FMOD_FILE_ASYNCREADCALLBACK userasyncread, FMOD_FILE_ASYNCCANCELCALLBACK userasynccancel, int blockalign);\nFMOD_RESULT F_API FMOD_System_AttachFileSystem       (FMOD_SYSTEM *system, FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek);\nFMOD_RESULT F_API FMOD_System_SetAdvancedSettings    (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);\nFMOD_RESULT F_API FMOD_System_GetAdvancedSettings    (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);\nFMOD_RESULT F_API FMOD_System_SetSpeakerMode         (FMOD_SYSTEM *system, FMOD_SPEAKERMODE speakermode);\nFMOD_RESULT F_API FMOD_System_GetSpeakerMode         (FMOD_SYSTEM *system, FMOD_SPEAKERMODE *speakermode);\nFMOD_RESULT F_API FMOD_System_SetCallback            (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK callback);\n\n/*\n     Plug-in support                       \n*/\n\nFMOD_RESULT F_API FMOD_System_SetPluginPath          (FMOD_SYSTEM *system, const char *path);\nFMOD_RESULT F_API FMOD_System_LoadPlugin             (FMOD_SYSTEM *system, const char *filename, unsigned int *handle, unsigned int priority);\nFMOD_RESULT F_API FMOD_System_UnloadPlugin           (FMOD_SYSTEM *system, unsigned int handle);\nFMOD_RESULT F_API FMOD_System_GetNumPlugins          (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int *numplugins);\nFMOD_RESULT F_API FMOD_System_GetPluginHandle        (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);\nFMOD_RESULT F_API FMOD_System_GetPluginInfo          (FMOD_SYSTEM *system, unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);\nFMOD_RESULT F_API FMOD_System_SetOutputByPlugin      (FMOD_SYSTEM *system, unsigned int handle);\nFMOD_RESULT F_API FMOD_System_GetOutputByPlugin      (FMOD_SYSTEM *system, unsigned int *handle);\nFMOD_RESULT F_API FMOD_System_CreateDSPByPlugin      (FMOD_SYSTEM *system, unsigned int handle, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_CreateCodec            (FMOD_SYSTEM *system, FMOD_CODEC_DESCRIPTION *description, unsigned int priority);\n\n/*\n     Init/Close                            \n*/\n\nFMOD_RESULT F_API FMOD_System_Init                   (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);\nFMOD_RESULT F_API FMOD_System_Close                  (FMOD_SYSTEM *system);\n\n/*\n     General post-init system functions    \n*/\n\nFMOD_RESULT F_API FMOD_System_Update                 (FMOD_SYSTEM *system);\n\nFMOD_RESULT F_API FMOD_System_Set3DSettings          (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale);\nFMOD_RESULT F_API FMOD_System_Get3DSettings          (FMOD_SYSTEM *system, float *dopplerscale, float *distancefactor, float *rolloffscale);\nFMOD_RESULT F_API FMOD_System_Set3DNumListeners      (FMOD_SYSTEM *system, int numlisteners);\nFMOD_RESULT F_API FMOD_System_Get3DNumListeners      (FMOD_SYSTEM *system, int *numlisteners);\nFMOD_RESULT F_API FMOD_System_Set3DListenerAttributes(FMOD_SYSTEM *system, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_System_Get3DListenerAttributes(FMOD_SYSTEM *system, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_System_Set3DRolloffCallback   (FMOD_SYSTEM *system, FMOD_3D_ROLLOFFCALLBACK callback);\nFMOD_RESULT F_API FMOD_System_Set3DSpeakerPosition   (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float x, float y, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_System_Get3DSpeakerPosition   (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float *x, float *y, FMOD_BOOL *active);\n\nFMOD_RESULT F_API FMOD_System_SetStreamBufferSize    (FMOD_SYSTEM *system, unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);\nFMOD_RESULT F_API FMOD_System_GetStreamBufferSize    (FMOD_SYSTEM *system, unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);\n\n/*\n     System information functions.        \n*/\n\nFMOD_RESULT F_API FMOD_System_GetVersion             (FMOD_SYSTEM *system, unsigned int *version);\nFMOD_RESULT F_API FMOD_System_GetOutputHandle        (FMOD_SYSTEM *system, void **handle);\nFMOD_RESULT F_API FMOD_System_GetChannelsPlaying     (FMOD_SYSTEM *system, int *channels);\nFMOD_RESULT F_API FMOD_System_GetHardwareChannels    (FMOD_SYSTEM *system, int *numhardwarechannels);\nFMOD_RESULT F_API FMOD_System_GetCPUUsage            (FMOD_SYSTEM *system, float *dsp, float *stream, float *geometry, float *update, float *total);\nFMOD_RESULT F_API FMOD_System_GetSoundRAM            (FMOD_SYSTEM *system, int *currentalloced, int *maxalloced, int *total);\nFMOD_RESULT F_API FMOD_System_GetNumCDROMDrives      (FMOD_SYSTEM *system, int *numdrives);\nFMOD_RESULT F_API FMOD_System_GetCDROMDriveName      (FMOD_SYSTEM *system, int drive, char *drivename, int drivenamelen, char *scsiname, int scsinamelen, char *devicename, int devicenamelen);\nFMOD_RESULT F_API FMOD_System_GetSpectrum            (FMOD_SYSTEM *system, float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\nFMOD_RESULT F_API FMOD_System_GetWaveData            (FMOD_SYSTEM *system, float *wavearray, int numvalues, int channeloffset);\n\n/*\n     Sound/DSP/Channel/FX creation and retrieval.       \n*/\n\nFMOD_RESULT F_API FMOD_System_CreateSound            (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_System_CreateStream           (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_System_CreateDSP              (FMOD_SYSTEM *system, FMOD_DSP_DESCRIPTION *description, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_CreateDSPByType        (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_CreateChannelGroup     (FMOD_SYSTEM *system, const char *name, FMOD_CHANNELGROUP **channelgroup);\nFMOD_RESULT F_API FMOD_System_CreateSoundGroup       (FMOD_SYSTEM *system, const char *name, FMOD_SOUNDGROUP **soundgroup);\nFMOD_RESULT F_API FMOD_System_CreateReverb           (FMOD_SYSTEM *system, FMOD_REVERB **reverb);\n\nFMOD_RESULT F_API FMOD_System_PlaySound              (FMOD_SYSTEM *system, FMOD_CHANNELINDEX channelid, FMOD_SOUND *sound, FMOD_BOOL paused, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_System_PlayDSP                (FMOD_SYSTEM *system, FMOD_CHANNELINDEX channelid, FMOD_DSP *dsp, FMOD_BOOL paused, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_System_GetChannel             (FMOD_SYSTEM *system, int channelid, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_System_GetMasterChannelGroup  (FMOD_SYSTEM *system, FMOD_CHANNELGROUP **channelgroup);\nFMOD_RESULT F_API FMOD_System_GetMasterSoundGroup    (FMOD_SYSTEM *system, FMOD_SOUNDGROUP **soundgroup);\n\n/*\n     Reverb API                           \n*/\n\nFMOD_RESULT F_API FMOD_System_SetReverbProperties    (FMOD_SYSTEM *system, const FMOD_REVERB_PROPERTIES *prop);\nFMOD_RESULT F_API FMOD_System_GetReverbProperties    (FMOD_SYSTEM *system, FMOD_REVERB_PROPERTIES *prop);\nFMOD_RESULT F_API FMOD_System_SetReverbAmbientProperties(FMOD_SYSTEM *system, FMOD_REVERB_PROPERTIES *prop);\nFMOD_RESULT F_API FMOD_System_GetReverbAmbientProperties(FMOD_SYSTEM *system, FMOD_REVERB_PROPERTIES *prop);\n\n/*\n     System level DSP access.\n*/\n\nFMOD_RESULT F_API FMOD_System_GetDSPHead             (FMOD_SYSTEM *system, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_AddDSP                 (FMOD_SYSTEM *system, FMOD_DSP *dsp, FMOD_DSPCONNECTION **connection);\nFMOD_RESULT F_API FMOD_System_LockDSP                (FMOD_SYSTEM *system);\nFMOD_RESULT F_API FMOD_System_UnlockDSP              (FMOD_SYSTEM *system);\nFMOD_RESULT F_API FMOD_System_GetDSPClock            (FMOD_SYSTEM *system, unsigned int *hi, unsigned int *lo);\n\n/*\n     Recording API.\n*/\n\nFMOD_RESULT F_API FMOD_System_GetRecordNumDrivers    (FMOD_SYSTEM *system, int *numdrivers);\nFMOD_RESULT F_API FMOD_System_GetRecordDriverInfo    (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetRecordDriverInfoW   (FMOD_SYSTEM *system, int id, short *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetRecordDriverCaps    (FMOD_SYSTEM *system, int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency);\nFMOD_RESULT F_API FMOD_System_GetRecordPosition      (FMOD_SYSTEM *system, int id, unsigned int *position);\n\nFMOD_RESULT F_API FMOD_System_RecordStart            (FMOD_SYSTEM *system, int id, FMOD_SOUND *sound, FMOD_BOOL loop);\nFMOD_RESULT F_API FMOD_System_RecordStop             (FMOD_SYSTEM *system, int id);\nFMOD_RESULT F_API FMOD_System_IsRecording            (FMOD_SYSTEM *system, int id, FMOD_BOOL *recording);\n\n/*\n     Geometry API.\n*/\n\nFMOD_RESULT F_API FMOD_System_CreateGeometry         (FMOD_SYSTEM *system, int maxpolygons, int maxvertices, FMOD_GEOMETRY **geometry);\nFMOD_RESULT F_API FMOD_System_SetGeometrySettings    (FMOD_SYSTEM *system, float maxworldsize);\nFMOD_RESULT F_API FMOD_System_GetGeometrySettings    (FMOD_SYSTEM *system, float *maxworldsize);\nFMOD_RESULT F_API FMOD_System_LoadGeometry           (FMOD_SYSTEM *system, const void *data, int datasize, FMOD_GEOMETRY **geometry);\nFMOD_RESULT F_API FMOD_System_GetGeometryOcclusion   (FMOD_SYSTEM *system, const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);\n\n/*\n     Network functions.\n*/\n\nFMOD_RESULT F_API FMOD_System_SetNetworkProxy        (FMOD_SYSTEM *system, const char *proxy);\nFMOD_RESULT F_API FMOD_System_GetNetworkProxy        (FMOD_SYSTEM *system, char *proxy, int proxylen);\nFMOD_RESULT F_API FMOD_System_SetNetworkTimeout      (FMOD_SYSTEM *system, int timeout);\nFMOD_RESULT F_API FMOD_System_GetNetworkTimeout      (FMOD_SYSTEM *system, int *timeout);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_System_SetUserData            (FMOD_SYSTEM *system, void *userdata);\nFMOD_RESULT F_API FMOD_System_GetUserData            (FMOD_SYSTEM *system, void **userdata);\n\nFMOD_RESULT F_API FMOD_System_GetMemoryInfo          (FMOD_SYSTEM *system, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Sound' API\n*/\n\nFMOD_RESULT F_API FMOD_Sound_Release                 (FMOD_SOUND *sound);\nFMOD_RESULT F_API FMOD_Sound_GetSystemObject         (FMOD_SOUND *sound, FMOD_SYSTEM **system);\n\n/*\n     Standard sound manipulation functions.                                                \n*/\n\nFMOD_RESULT F_API FMOD_Sound_Lock                    (FMOD_SOUND *sound, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);\nFMOD_RESULT F_API FMOD_Sound_Unlock                  (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);\nFMOD_RESULT F_API FMOD_Sound_SetDefaults             (FMOD_SOUND *sound, float frequency, float volume, float pan, int priority);\nFMOD_RESULT F_API FMOD_Sound_GetDefaults             (FMOD_SOUND *sound, float *frequency, float *volume, float *pan, int *priority);\nFMOD_RESULT F_API FMOD_Sound_SetVariations           (FMOD_SOUND *sound, float frequencyvar, float volumevar, float panvar);\nFMOD_RESULT F_API FMOD_Sound_GetVariations           (FMOD_SOUND *sound, float *frequencyvar, float *volumevar, float *panvar);\nFMOD_RESULT F_API FMOD_Sound_Set3DMinMaxDistance     (FMOD_SOUND *sound, float min, float max);\nFMOD_RESULT F_API FMOD_Sound_Get3DMinMaxDistance     (FMOD_SOUND *sound, float *min, float *max);\nFMOD_RESULT F_API FMOD_Sound_Set3DConeSettings       (FMOD_SOUND *sound, float insideconeangle, float outsideconeangle, float outsidevolume);\nFMOD_RESULT F_API FMOD_Sound_Get3DConeSettings       (FMOD_SOUND *sound, float *insideconeangle, float *outsideconeangle, float *outsidevolume);\nFMOD_RESULT F_API FMOD_Sound_Set3DCustomRolloff      (FMOD_SOUND *sound, FMOD_VECTOR *points, int numpoints);\nFMOD_RESULT F_API FMOD_Sound_Get3DCustomRolloff      (FMOD_SOUND *sound, FMOD_VECTOR **points, int *numpoints);\nFMOD_RESULT F_API FMOD_Sound_SetSubSound             (FMOD_SOUND *sound, int index, FMOD_SOUND *subsound);\nFMOD_RESULT F_API FMOD_Sound_GetSubSound             (FMOD_SOUND *sound, int index, FMOD_SOUND **subsound);\nFMOD_RESULT F_API FMOD_Sound_SetSubSoundSentence     (FMOD_SOUND *sound, int *subsoundlist, int numsubsounds);\nFMOD_RESULT F_API FMOD_Sound_GetName                 (FMOD_SOUND *sound, char *name, int namelen);\nFMOD_RESULT F_API FMOD_Sound_GetLength               (FMOD_SOUND *sound, unsigned int *length, FMOD_TIMEUNIT lengthtype);\nFMOD_RESULT F_API FMOD_Sound_GetFormat               (FMOD_SOUND *sound, FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);\nFMOD_RESULT F_API FMOD_Sound_GetNumSubSounds         (FMOD_SOUND *sound, int *numsubsounds);\nFMOD_RESULT F_API FMOD_Sound_GetNumTags              (FMOD_SOUND *sound, int *numtags, int *numtagsupdated);\nFMOD_RESULT F_API FMOD_Sound_GetTag                  (FMOD_SOUND *sound, const char *name, int index, FMOD_TAG *tag);\nFMOD_RESULT F_API FMOD_Sound_GetOpenState            (FMOD_SOUND *sound, FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, FMOD_BOOL *starving, FMOD_BOOL *diskbusy);\nFMOD_RESULT F_API FMOD_Sound_ReadData                (FMOD_SOUND *sound, void *buffer, unsigned int lenbytes, unsigned int *read);\nFMOD_RESULT F_API FMOD_Sound_SeekData                (FMOD_SOUND *sound, unsigned int pcm);\n\nFMOD_RESULT F_API FMOD_Sound_SetSoundGroup           (FMOD_SOUND *sound, FMOD_SOUNDGROUP *soundgroup);\nFMOD_RESULT F_API FMOD_Sound_GetSoundGroup           (FMOD_SOUND *sound, FMOD_SOUNDGROUP **soundgroup);\n\n/*\n     Synchronization point API.  These points can come from markers embedded in wav files, and can also generate channel callbacks.        \n*/\n\nFMOD_RESULT F_API FMOD_Sound_GetNumSyncPoints        (FMOD_SOUND *sound, int *numsyncpoints);\nFMOD_RESULT F_API FMOD_Sound_GetSyncPoint            (FMOD_SOUND *sound, int index, FMOD_SYNCPOINT **point);\nFMOD_RESULT F_API FMOD_Sound_GetSyncPointInfo        (FMOD_SOUND *sound, FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);\nFMOD_RESULT F_API FMOD_Sound_AddSyncPoint            (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);\nFMOD_RESULT F_API FMOD_Sound_DeleteSyncPoint         (FMOD_SOUND *sound, FMOD_SYNCPOINT *point);\n\n/*\n     Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.\n*/\n\nFMOD_RESULT F_API FMOD_Sound_SetMode                 (FMOD_SOUND *sound, FMOD_MODE mode);\nFMOD_RESULT F_API FMOD_Sound_GetMode                 (FMOD_SOUND *sound, FMOD_MODE *mode);\nFMOD_RESULT F_API FMOD_Sound_SetLoopCount            (FMOD_SOUND *sound, int loopcount);\nFMOD_RESULT F_API FMOD_Sound_GetLoopCount            (FMOD_SOUND *sound, int *loopcount);\nFMOD_RESULT F_API FMOD_Sound_SetLoopPoints           (FMOD_SOUND *sound, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\nFMOD_RESULT F_API FMOD_Sound_GetLoopPoints           (FMOD_SOUND *sound, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n/*\n     For MOD/S3M/XM/IT/MID sequenced formats only.\n*/\n\nFMOD_RESULT F_API FMOD_Sound_GetMusicNumChannels     (FMOD_SOUND *sound, int *numchannels);\nFMOD_RESULT F_API FMOD_Sound_SetMusicChannelVolume   (FMOD_SOUND *sound, int channel, float volume);\nFMOD_RESULT F_API FMOD_Sound_GetMusicChannelVolume   (FMOD_SOUND *sound, int channel, float *volume);\nFMOD_RESULT F_API FMOD_Sound_SetMusicSpeed           (FMOD_SOUND *sound, float speed);\nFMOD_RESULT F_API FMOD_Sound_GetMusicSpeed           (FMOD_SOUND *sound, float *speed);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_Sound_SetUserData             (FMOD_SOUND *sound, void *userdata);\nFMOD_RESULT F_API FMOD_Sound_GetUserData             (FMOD_SOUND *sound, void **userdata);\n\nFMOD_RESULT F_API FMOD_Sound_GetMemoryInfo           (FMOD_SOUND *sound, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Channel' API\n*/\n\nFMOD_RESULT F_API FMOD_Channel_GetSystemObject       (FMOD_CHANNEL *channel, FMOD_SYSTEM **system);\n\nFMOD_RESULT F_API FMOD_Channel_Stop                  (FMOD_CHANNEL *channel);\nFMOD_RESULT F_API FMOD_Channel_SetPaused             (FMOD_CHANNEL *channel, FMOD_BOOL paused);\nFMOD_RESULT F_API FMOD_Channel_GetPaused             (FMOD_CHANNEL *channel, FMOD_BOOL *paused);\nFMOD_RESULT F_API FMOD_Channel_SetVolume             (FMOD_CHANNEL *channel, float volume);\nFMOD_RESULT F_API FMOD_Channel_GetVolume             (FMOD_CHANNEL *channel, float *volume);\nFMOD_RESULT F_API FMOD_Channel_SetFrequency          (FMOD_CHANNEL *channel, float frequency);\nFMOD_RESULT F_API FMOD_Channel_GetFrequency          (FMOD_CHANNEL *channel, float *frequency);\nFMOD_RESULT F_API FMOD_Channel_SetPan                (FMOD_CHANNEL *channel, float pan);\nFMOD_RESULT F_API FMOD_Channel_GetPan                (FMOD_CHANNEL *channel, float *pan);\nFMOD_RESULT F_API FMOD_Channel_SetDelay              (FMOD_CHANNEL *channel, FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo);\nFMOD_RESULT F_API FMOD_Channel_GetDelay              (FMOD_CHANNEL *channel, FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo);\nFMOD_RESULT F_API FMOD_Channel_SetSpeakerMix         (FMOD_CHANNEL *channel, float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\nFMOD_RESULT F_API FMOD_Channel_GetSpeakerMix         (FMOD_CHANNEL *channel, float *frontleft, float *frontright, float *center, float *lfe, float *backleft, float *backright, float *sideleft, float *sideright);\nFMOD_RESULT F_API FMOD_Channel_SetSpeakerLevels      (FMOD_CHANNEL *channel, FMOD_SPEAKER speaker, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_GetSpeakerLevels      (FMOD_CHANNEL *channel, FMOD_SPEAKER speaker, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_SetInputChannelMix    (FMOD_CHANNEL *channel, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_GetInputChannelMix    (FMOD_CHANNEL *channel, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_SetMute               (FMOD_CHANNEL *channel, FMOD_BOOL mute);\nFMOD_RESULT F_API FMOD_Channel_GetMute               (FMOD_CHANNEL *channel, FMOD_BOOL *mute);\nFMOD_RESULT F_API FMOD_Channel_SetPriority           (FMOD_CHANNEL *channel, int priority);\nFMOD_RESULT F_API FMOD_Channel_GetPriority           (FMOD_CHANNEL *channel, int *priority);\nFMOD_RESULT F_API FMOD_Channel_SetPosition           (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype);\nFMOD_RESULT F_API FMOD_Channel_GetPosition           (FMOD_CHANNEL *channel, unsigned int *position, FMOD_TIMEUNIT postype);\nFMOD_RESULT F_API FMOD_Channel_SetReverbProperties   (FMOD_CHANNEL *channel, const FMOD_REVERB_CHANNELPROPERTIES *prop);\nFMOD_RESULT F_API FMOD_Channel_GetReverbProperties   (FMOD_CHANNEL *channel, FMOD_REVERB_CHANNELPROPERTIES *prop);\nFMOD_RESULT F_API FMOD_Channel_SetLowPassGain        (FMOD_CHANNEL *channel, float gain);\nFMOD_RESULT F_API FMOD_Channel_GetLowPassGain        (FMOD_CHANNEL *channel, float *gain);\n\nFMOD_RESULT F_API FMOD_Channel_SetChannelGroup       (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup);\nFMOD_RESULT F_API FMOD_Channel_GetChannelGroup       (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP **channelgroup);\nFMOD_RESULT F_API FMOD_Channel_SetCallback           (FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACK callback);\n\n/*\n     3D functionality.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_Set3DAttributes       (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\nFMOD_RESULT F_API FMOD_Channel_Get3DAttributes       (FMOD_CHANNEL *channel, FMOD_VECTOR *pos, FMOD_VECTOR *vel);\nFMOD_RESULT F_API FMOD_Channel_Set3DMinMaxDistance   (FMOD_CHANNEL *channel, float mindistance, float maxdistance);\nFMOD_RESULT F_API FMOD_Channel_Get3DMinMaxDistance   (FMOD_CHANNEL *channel, float *mindistance, float *maxdistance);\nFMOD_RESULT F_API FMOD_Channel_Set3DConeSettings     (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume);\nFMOD_RESULT F_API FMOD_Channel_Get3DConeSettings     (FMOD_CHANNEL *channel, float *insideconeangle, float *outsideconeangle, float *outsidevolume);\nFMOD_RESULT F_API FMOD_Channel_Set3DConeOrientation  (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);\nFMOD_RESULT F_API FMOD_Channel_Get3DConeOrientation  (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);\nFMOD_RESULT F_API FMOD_Channel_Set3DCustomRolloff    (FMOD_CHANNEL *channel, FMOD_VECTOR *points, int numpoints);\nFMOD_RESULT F_API FMOD_Channel_Get3DCustomRolloff    (FMOD_CHANNEL *channel, FMOD_VECTOR **points, int *numpoints);\nFMOD_RESULT F_API FMOD_Channel_Set3DOcclusion        (FMOD_CHANNEL *channel, float directocclusion, float reverbocclusion);\nFMOD_RESULT F_API FMOD_Channel_Get3DOcclusion        (FMOD_CHANNEL *channel, float *directocclusion, float *reverbocclusion);\nFMOD_RESULT F_API FMOD_Channel_Set3DSpread           (FMOD_CHANNEL *channel, float angle);\nFMOD_RESULT F_API FMOD_Channel_Get3DSpread           (FMOD_CHANNEL *channel, float *angle);\nFMOD_RESULT F_API FMOD_Channel_Set3DPanLevel         (FMOD_CHANNEL *channel, float level);\nFMOD_RESULT F_API FMOD_Channel_Get3DPanLevel         (FMOD_CHANNEL *channel, float *level);\nFMOD_RESULT F_API FMOD_Channel_Set3DDopplerLevel     (FMOD_CHANNEL *channel, float level);\nFMOD_RESULT F_API FMOD_Channel_Get3DDopplerLevel     (FMOD_CHANNEL *channel, float *level);\nFMOD_RESULT F_API FMOD_Channel_Set3DDistanceFilter   (FMOD_CHANNEL *channel, FMOD_BOOL custom, float customLevel, float centerFreq);\nFMOD_RESULT F_API FMOD_Channel_Get3DDistanceFilter   (FMOD_CHANNEL *channel, FMOD_BOOL *custom, float *customLevel, float *centerFreq);\n\n/*\n     DSP functionality only for channels playing sounds created with FMOD_SOFTWARE.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_GetDSPHead            (FMOD_CHANNEL *channel, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_Channel_AddDSP                (FMOD_CHANNEL *channel, FMOD_DSP *dsp, FMOD_DSPCONNECTION **connection);\n\n/*\n     Information only functions.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_IsPlaying             (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying);\nFMOD_RESULT F_API FMOD_Channel_IsVirtual             (FMOD_CHANNEL *channel, FMOD_BOOL *isvirtual);\nFMOD_RESULT F_API FMOD_Channel_GetAudibility         (FMOD_CHANNEL *channel, float *audibility);\nFMOD_RESULT F_API FMOD_Channel_GetCurrentSound       (FMOD_CHANNEL *channel, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_Channel_GetSpectrum           (FMOD_CHANNEL *channel, float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\nFMOD_RESULT F_API FMOD_Channel_GetWaveData           (FMOD_CHANNEL *channel, float *wavearray, int numvalues, int channeloffset);\nFMOD_RESULT F_API FMOD_Channel_GetIndex              (FMOD_CHANNEL *channel, int *index);\n\n/*\n     Functions also found in Sound class but here they can be set per channel.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_SetMode               (FMOD_CHANNEL *channel, FMOD_MODE mode);\nFMOD_RESULT F_API FMOD_Channel_GetMode               (FMOD_CHANNEL *channel, FMOD_MODE *mode);\nFMOD_RESULT F_API FMOD_Channel_SetLoopCount          (FMOD_CHANNEL *channel, int loopcount);\nFMOD_RESULT F_API FMOD_Channel_GetLoopCount          (FMOD_CHANNEL *channel, int *loopcount);\nFMOD_RESULT F_API FMOD_Channel_SetLoopPoints         (FMOD_CHANNEL *channel, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\nFMOD_RESULT F_API FMOD_Channel_GetLoopPoints         (FMOD_CHANNEL *channel, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n/*\n     Userdata set/get.                                                \n*/\n\nFMOD_RESULT F_API FMOD_Channel_SetUserData           (FMOD_CHANNEL *channel, void *userdata);\nFMOD_RESULT F_API FMOD_Channel_GetUserData           (FMOD_CHANNEL *channel, void **userdata);\n\nFMOD_RESULT F_API FMOD_Channel_GetMemoryInfo         (FMOD_CHANNEL *channel, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'ChannelGroup' API\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_Release          (FMOD_CHANNELGROUP *channelgroup);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetSystemObject  (FMOD_CHANNELGROUP *channelgroup, FMOD_SYSTEM **system);\n\n/*\n     Channelgroup scale values.  (changes attributes relative to the channels, doesn't overwrite them)\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_SetVolume        (FMOD_CHANNELGROUP *channelgroup, float volume);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetVolume        (FMOD_CHANNELGROUP *channelgroup, float *volume);\nFMOD_RESULT F_API FMOD_ChannelGroup_SetPitch         (FMOD_CHANNELGROUP *channelgroup, float pitch);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetPitch         (FMOD_CHANNELGROUP *channelgroup, float *pitch);\nFMOD_RESULT F_API FMOD_ChannelGroup_Set3DOcclusion   (FMOD_CHANNELGROUP *channelgroup, float directocclusion, float reverbocclusion);\nFMOD_RESULT F_API FMOD_ChannelGroup_Get3DOcclusion   (FMOD_CHANNELGROUP *channelgroup, float *directocclusion, float *reverbocclusion);\nFMOD_RESULT F_API FMOD_ChannelGroup_SetPaused        (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetPaused        (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *paused);\nFMOD_RESULT F_API FMOD_ChannelGroup_SetMute          (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetMute          (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *mute);\n\n/*\n     Channelgroup override values.  (recursively overwrites whatever settings the channels had)\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_Stop             (FMOD_CHANNELGROUP *channelgroup);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideVolume   (FMOD_CHANNELGROUP *channelgroup, float volume);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideFrequency(FMOD_CHANNELGROUP *channelgroup, float frequency);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverridePan      (FMOD_CHANNELGROUP *channelgroup, float pan);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideReverbProperties(FMOD_CHANNELGROUP *channelgroup, const FMOD_REVERB_CHANNELPROPERTIES *prop);\nFMOD_RESULT F_API FMOD_ChannelGroup_Override3DAttributes(FMOD_CHANNELGROUP *channelgroup, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideSpeakerMix(FMOD_CHANNELGROUP *channelgroup, float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\n\n/*\n     Nested channel groups.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_AddGroup         (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetNumGroups     (FMOD_CHANNELGROUP *channelgroup, int *numgroups);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetGroup         (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNELGROUP **group);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetParentGroup   (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP **group);\n\n/*\n     DSP functionality only for channel groups playing sounds created with FMOD_SOFTWARE.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_GetDSPHead       (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_ChannelGroup_AddDSP           (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, FMOD_DSPCONNECTION **connection);\n\n/*\n     Information only functions.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_GetName          (FMOD_CHANNELGROUP *channelgroup, char *name, int namelen);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetNumChannels   (FMOD_CHANNELGROUP *channelgroup, int *numchannels);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetChannel       (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetSpectrum      (FMOD_CHANNELGROUP *channelgroup, float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetWaveData      (FMOD_CHANNELGROUP *channelgroup, float *wavearray, int numvalues, int channeloffset);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_SetUserData      (FMOD_CHANNELGROUP *channelgroup, void *userdata);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetUserData      (FMOD_CHANNELGROUP *channelgroup, void **userdata);\n\nFMOD_RESULT F_API FMOD_ChannelGroup_GetMemoryInfo    (FMOD_CHANNELGROUP *channelgroup, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'SoundGroup' API\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_Release            (FMOD_SOUNDGROUP *soundgroup);\nFMOD_RESULT F_API FMOD_SoundGroup_GetSystemObject    (FMOD_SOUNDGROUP *soundgroup, FMOD_SYSTEM **system);\n\n/*\n     SoundGroup control functions.\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudible      (FMOD_SOUNDGROUP *soundgroup, int maxaudible);\nFMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudible      (FMOD_SOUNDGROUP *soundgroup, int *maxaudible);\nFMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior(FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior);\nFMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior(FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);\nFMOD_RESULT F_API FMOD_SoundGroup_SetMuteFadeSpeed   (FMOD_SOUNDGROUP *soundgroup, float speed);\nFMOD_RESULT F_API FMOD_SoundGroup_GetMuteFadeSpeed   (FMOD_SOUNDGROUP *soundgroup, float *speed);\nFMOD_RESULT F_API FMOD_SoundGroup_SetVolume          (FMOD_SOUNDGROUP *soundgroup, float volume);\nFMOD_RESULT F_API FMOD_SoundGroup_GetVolume          (FMOD_SOUNDGROUP *soundgroup, float *volume);\nFMOD_RESULT F_API FMOD_SoundGroup_Stop               (FMOD_SOUNDGROUP *soundgroup);\n\n/*\n     Information only functions.\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_GetName            (FMOD_SOUNDGROUP *soundgroup, char *name, int namelen);\nFMOD_RESULT F_API FMOD_SoundGroup_GetNumSounds       (FMOD_SOUNDGROUP *soundgroup, int *numsounds);\nFMOD_RESULT F_API FMOD_SoundGroup_GetSound           (FMOD_SOUNDGROUP *soundgroup, int index, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_SoundGroup_GetNumPlaying      (FMOD_SOUNDGROUP *soundgroup, int *numplaying);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_SetUserData        (FMOD_SOUNDGROUP *soundgroup, void *userdata);\nFMOD_RESULT F_API FMOD_SoundGroup_GetUserData        (FMOD_SOUNDGROUP *soundgroup, void **userdata);\n\nFMOD_RESULT F_API FMOD_SoundGroup_GetMemoryInfo      (FMOD_SOUNDGROUP *soundgroup, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'DSP' API\n*/\n\nFMOD_RESULT F_API FMOD_DSP_Release                   (FMOD_DSP *dsp);\nFMOD_RESULT F_API FMOD_DSP_GetSystemObject           (FMOD_DSP *dsp, FMOD_SYSTEM **system);\n\n/*\n     Connection / disconnection / input and output enumeration.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_AddInput                  (FMOD_DSP *dsp, FMOD_DSP *target, FMOD_DSPCONNECTION **connection);\nFMOD_RESULT F_API FMOD_DSP_DisconnectFrom            (FMOD_DSP *dsp, FMOD_DSP *target);\nFMOD_RESULT F_API FMOD_DSP_DisconnectAll             (FMOD_DSP *dsp, FMOD_BOOL inputs, FMOD_BOOL outputs);\nFMOD_RESULT F_API FMOD_DSP_Remove                    (FMOD_DSP *dsp);\nFMOD_RESULT F_API FMOD_DSP_GetNumInputs              (FMOD_DSP *dsp, int *numinputs);\nFMOD_RESULT F_API FMOD_DSP_GetNumOutputs             (FMOD_DSP *dsp, int *numoutputs);\nFMOD_RESULT F_API FMOD_DSP_GetInput                  (FMOD_DSP *dsp, int index, FMOD_DSP **input, FMOD_DSPCONNECTION **inputconnection);\nFMOD_RESULT F_API FMOD_DSP_GetOutput                 (FMOD_DSP *dsp, int index, FMOD_DSP **output, FMOD_DSPCONNECTION **outputconnection);\n\n/*\n     DSP unit control.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_SetActive                 (FMOD_DSP *dsp, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_DSP_GetActive                 (FMOD_DSP *dsp, FMOD_BOOL *active);\nFMOD_RESULT F_API FMOD_DSP_SetBypass                 (FMOD_DSP *dsp, FMOD_BOOL bypass);\nFMOD_RESULT F_API FMOD_DSP_GetBypass                 (FMOD_DSP *dsp, FMOD_BOOL *bypass);\nFMOD_RESULT F_API FMOD_DSP_SetSpeakerActive          (FMOD_DSP *dsp, FMOD_SPEAKER speaker, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_DSP_GetSpeakerActive          (FMOD_DSP *dsp, FMOD_SPEAKER speaker, FMOD_BOOL *active);\nFMOD_RESULT F_API FMOD_DSP_Reset                     (FMOD_DSP *dsp);\n\n/*\n     DSP parameter control.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_SetParameter              (FMOD_DSP *dsp, int index, float value);\nFMOD_RESULT F_API FMOD_DSP_GetParameter              (FMOD_DSP *dsp, int index, float *value, char *valuestr, int valuestrlen);\nFMOD_RESULT F_API FMOD_DSP_GetNumParameters          (FMOD_DSP *dsp, int *numparams);\nFMOD_RESULT F_API FMOD_DSP_GetParameterInfo          (FMOD_DSP *dsp, int index, char *name, char *label, char *description, int descriptionlen, float *min, float *max);\nFMOD_RESULT F_API FMOD_DSP_ShowConfigDialog          (FMOD_DSP *dsp, void *hwnd, FMOD_BOOL show);\n\n/*\n     DSP attributes.        \n*/\n\nFMOD_RESULT F_API FMOD_DSP_GetInfo                   (FMOD_DSP *dsp, char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);\nFMOD_RESULT F_API FMOD_DSP_GetType                   (FMOD_DSP *dsp, FMOD_DSP_TYPE *type);\nFMOD_RESULT F_API FMOD_DSP_SetDefaults               (FMOD_DSP *dsp, float frequency, float volume, float pan, int priority);\nFMOD_RESULT F_API FMOD_DSP_GetDefaults               (FMOD_DSP *dsp, float *frequency, float *volume, float *pan, int *priority);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_SetUserData               (FMOD_DSP *dsp, void *userdata);\nFMOD_RESULT F_API FMOD_DSP_GetUserData               (FMOD_DSP *dsp, void **userdata);\n\nFMOD_RESULT F_API FMOD_DSP_GetMemoryInfo             (FMOD_DSP *dsp, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'DSPConnection' API\n*/\n\nFMOD_RESULT F_API FMOD_DSPConnection_GetInput        (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **input);\nFMOD_RESULT F_API FMOD_DSPConnection_GetOutput       (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **output);\nFMOD_RESULT F_API FMOD_DSPConnection_SetMix          (FMOD_DSPCONNECTION *dspconnection, float volume);\nFMOD_RESULT F_API FMOD_DSPConnection_GetMix          (FMOD_DSPCONNECTION *dspconnection, float *volume);\nFMOD_RESULT F_API FMOD_DSPConnection_SetLevels       (FMOD_DSPCONNECTION *dspconnection, FMOD_SPEAKER speaker, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_DSPConnection_GetLevels       (FMOD_DSPCONNECTION *dspconnection, FMOD_SPEAKER speaker, float *levels, int numlevels);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_DSPConnection_SetUserData     (FMOD_DSPCONNECTION *dspconnection, void *userdata);\nFMOD_RESULT F_API FMOD_DSPConnection_GetUserData     (FMOD_DSPCONNECTION *dspconnection, void **userdata);\n\nFMOD_RESULT F_API FMOD_DSPConnection_GetMemoryInfo   (FMOD_DSPCONNECTION *dspconnection, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Geometry' API\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_Release              (FMOD_GEOMETRY *geometry);\n\n/*\n     Polygon manipulation.\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_AddPolygon           (FMOD_GEOMETRY *geometry, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);\nFMOD_RESULT F_API FMOD_Geometry_GetNumPolygons       (FMOD_GEOMETRY *geometry, int *numpolygons);\nFMOD_RESULT F_API FMOD_Geometry_GetMaxPolygons       (FMOD_GEOMETRY *geometry, int *maxpolygons, int *maxvertices);\nFMOD_RESULT F_API FMOD_Geometry_GetPolygonNumVertices(FMOD_GEOMETRY *geometry, int index, int *numvertices);\nFMOD_RESULT F_API FMOD_Geometry_SetPolygonVertex     (FMOD_GEOMETRY *geometry, int index, int vertexindex, const FMOD_VECTOR *vertex);\nFMOD_RESULT F_API FMOD_Geometry_GetPolygonVertex     (FMOD_GEOMETRY *geometry, int index, int vertexindex, FMOD_VECTOR *vertex);\nFMOD_RESULT F_API FMOD_Geometry_SetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided);\nFMOD_RESULT F_API FMOD_Geometry_GetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float *directocclusion, float *reverbocclusion, FMOD_BOOL *doublesided);\n\n/*\n     Object manipulation.\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_SetActive            (FMOD_GEOMETRY *geometry, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_Geometry_GetActive            (FMOD_GEOMETRY *geometry, FMOD_BOOL *active);\nFMOD_RESULT F_API FMOD_Geometry_SetRotation          (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_Geometry_GetRotation          (FMOD_GEOMETRY *geometry, FMOD_VECTOR *forward, FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_Geometry_SetPosition          (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *position);\nFMOD_RESULT F_API FMOD_Geometry_GetPosition          (FMOD_GEOMETRY *geometry, FMOD_VECTOR *position);\nFMOD_RESULT F_API FMOD_Geometry_SetScale             (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *scale);\nFMOD_RESULT F_API FMOD_Geometry_GetScale             (FMOD_GEOMETRY *geometry, FMOD_VECTOR *scale);\nFMOD_RESULT F_API FMOD_Geometry_Save                 (FMOD_GEOMETRY *geometry, void *data, int *datasize);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_SetUserData          (FMOD_GEOMETRY *geometry, void *userdata);\nFMOD_RESULT F_API FMOD_Geometry_GetUserData          (FMOD_GEOMETRY *geometry, void **userdata);\n\nFMOD_RESULT F_API FMOD_Geometry_GetMemoryInfo        (FMOD_GEOMETRY *geometry, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Reverb' API\n*/\n\nFMOD_RESULT F_API FMOD_Reverb_Release                (FMOD_REVERB *reverb);\n\n/*\n     Reverb manipulation.\n*/\n\nFMOD_RESULT F_API FMOD_Reverb_Set3DAttributes        (FMOD_REVERB *reverb, const FMOD_VECTOR *position, float mindistance, float maxdistance);\nFMOD_RESULT F_API FMOD_Reverb_Get3DAttributes        (FMOD_REVERB *reverb, FMOD_VECTOR *position, float *mindistance, float *maxdistance);\nFMOD_RESULT F_API FMOD_Reverb_SetProperties          (FMOD_REVERB *reverb, const FMOD_REVERB_PROPERTIES *properties);\nFMOD_RESULT F_API FMOD_Reverb_GetProperties          (FMOD_REVERB *reverb, FMOD_REVERB_PROPERTIES *properties);\nFMOD_RESULT F_API FMOD_Reverb_SetActive              (FMOD_REVERB *reverb, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_Reverb_GetActive              (FMOD_REVERB *reverb, FMOD_BOOL *active);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_Reverb_SetUserData            (FMOD_REVERB *reverb, void *userdata);\nFMOD_RESULT F_API FMOD_Reverb_GetUserData            (FMOD_REVERB *reverb, void **userdata);\n\nFMOD_RESULT F_API FMOD_Reverb_GetMemoryInfo          (FMOD_REVERB *reverb, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n/*$ preserve start $*/\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n/*$ preserve end $*/\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmod.hpp",
    "content": "/* ========================================================================================== */\n/* FMOD Ex - C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011.      */\n/*                                                                                            */\n/* Use this header in conjunction with fmod.h (which contains all the constants / callbacks)  */\n/* to develop using C++ classes.                                                              */\n/* ========================================================================================== */\n\n#ifndef _FMOD_HPP\n#define _FMOD_HPP\n\n#include \"fmod.h\"\n\n/*\n    Constant and defines\n*/\n\n/*\n    FMOD Namespace\n*/\nnamespace FMOD\n{\n    class System;\n    class Sound;\n    class Channel;\n    class ChannelGroup;\n    class SoundGroup;\n    class Reverb;\n    class DSP;\n    class DSPConnection;\n    class Geometry;\n\n    /*\n        FMOD global system functions (optional).\n    */\n    inline FMOD_RESULT Memory_Initialize(void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }\n    inline FMOD_RESULT Memory_GetStats  (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); }\n    inline FMOD_RESULT Debug_SetLevel(FMOD_DEBUGLEVEL level)  { return FMOD_Debug_SetLevel(level); }\n    inline FMOD_RESULT Debug_GetLevel(FMOD_DEBUGLEVEL *level) { return FMOD_Debug_GetLevel(level); }\n    inline FMOD_RESULT File_SetDiskBusy(int busy) { return FMOD_File_SetDiskBusy(busy); }\n    inline FMOD_RESULT File_GetDiskBusy(int *busy) { return FMOD_File_GetDiskBusy(busy); }\n\n    /*\n        FMOD System factory functions.\n    */\n    inline FMOD_RESULT System_Create(System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }\n\n    /*\n       'System' API\n    */\n\n    class System\n    {\n      private:\n\n        System();   /* Constructor made private so user cannot statically instance a System class.  \n                       System_Create must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n                                                 \n        // Pre-init functions.\n        FMOD_RESULT F_API setOutput              (FMOD_OUTPUTTYPE output);\n        FMOD_RESULT F_API getOutput              (FMOD_OUTPUTTYPE *output);\n        FMOD_RESULT F_API getNumDrivers          (int *numdrivers);\n        FMOD_RESULT F_API getDriverInfo          (int id, char *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getDriverInfoW         (int id, short *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getDriverCaps          (int id, FMOD_CAPS *caps, int *controlpaneloutputrate, FMOD_SPEAKERMODE *controlpanelspeakermode);\n        FMOD_RESULT F_API setDriver              (int driver);\n        FMOD_RESULT F_API getDriver              (int *driver);\n        FMOD_RESULT F_API setHardwareChannels    (int numhardwarechannels);\n        FMOD_RESULT F_API setSoftwareChannels    (int numsoftwarechannels);\n        FMOD_RESULT F_API getSoftwareChannels    (int *numsoftwarechannels);\n        FMOD_RESULT F_API setSoftwareFormat      (int samplerate, FMOD_SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, FMOD_DSP_RESAMPLER resamplemethod);\n        FMOD_RESULT F_API getSoftwareFormat      (int *samplerate, FMOD_SOUND_FORMAT *format, int *numoutputchannels, int *maxinputchannels, FMOD_DSP_RESAMPLER *resamplemethod, int *bits);\n        FMOD_RESULT F_API setDSPBufferSize       (unsigned int bufferlength, int numbuffers);\n        FMOD_RESULT F_API getDSPBufferSize       (unsigned int *bufferlength, int *numbuffers);\n        FMOD_RESULT F_API setFileSystem          (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, FMOD_FILE_ASYNCREADCALLBACK userasyncread, FMOD_FILE_ASYNCCANCELCALLBACK userasynccancel, int blockalign);\n        FMOD_RESULT F_API attachFileSystem       (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek);\n        FMOD_RESULT F_API setAdvancedSettings    (FMOD_ADVANCEDSETTINGS *settings);\n        FMOD_RESULT F_API getAdvancedSettings    (FMOD_ADVANCEDSETTINGS *settings);\n        FMOD_RESULT F_API setSpeakerMode         (FMOD_SPEAKERMODE speakermode);\n        FMOD_RESULT F_API getSpeakerMode         (FMOD_SPEAKERMODE *speakermode);\n        FMOD_RESULT F_API setCallback            (FMOD_SYSTEM_CALLBACK callback);\n                                                \n        // Plug-in support                       \n        FMOD_RESULT F_API setPluginPath          (const char *path);\n        FMOD_RESULT F_API loadPlugin             (const char *filename, unsigned int *handle, unsigned int priority = 0);\n        FMOD_RESULT F_API unloadPlugin           (unsigned int handle);\n        FMOD_RESULT F_API getNumPlugins          (FMOD_PLUGINTYPE plugintype, int *numplugins);\n        FMOD_RESULT F_API getPluginHandle        (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);\n        FMOD_RESULT F_API getPluginInfo          (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);\n        FMOD_RESULT F_API setOutputByPlugin      (unsigned int handle);\n        FMOD_RESULT F_API getOutputByPlugin      (unsigned int *handle);\n        FMOD_RESULT F_API createDSPByPlugin      (unsigned int handle, DSP **dsp);\n        FMOD_RESULT F_API createCodec            (FMOD_CODEC_DESCRIPTION *description, unsigned int priority = 0);\n                                                 \n        // Init/Close                            \n        FMOD_RESULT F_API init                   (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);\n        FMOD_RESULT F_API close                  ();\n                                                 \n        // General post-init system functions    \n        FMOD_RESULT F_API update                 ();        /* IMPORTANT! CALL THIS ONCE PER FRAME! */\n                                                 \n        FMOD_RESULT F_API set3DSettings          (float dopplerscale, float distancefactor, float rolloffscale);\n        FMOD_RESULT F_API get3DSettings          (float *dopplerscale, float *distancefactor, float *rolloffscale);\n        FMOD_RESULT F_API set3DNumListeners      (int numlisteners);\n        FMOD_RESULT F_API get3DNumListeners      (int *numlisteners);\n        FMOD_RESULT F_API set3DListenerAttributes(int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\n        FMOD_RESULT F_API get3DListenerAttributes(int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);\n        FMOD_RESULT F_API set3DRolloffCallback   (FMOD_3D_ROLLOFFCALLBACK callback);\n        FMOD_RESULT F_API set3DSpeakerPosition   (FMOD_SPEAKER speaker, float x, float y, bool active);\n        FMOD_RESULT F_API get3DSpeakerPosition   (FMOD_SPEAKER speaker, float *x, float *y, bool *active);\n\n        FMOD_RESULT F_API setStreamBufferSize    (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);\n        FMOD_RESULT F_API getStreamBufferSize    (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);\n                                                \n        // System information functions.        \n        FMOD_RESULT F_API getVersion             (unsigned int *version);\n        FMOD_RESULT F_API getOutputHandle        (void **handle);\n        FMOD_RESULT F_API getChannelsPlaying     (int *channels);\n        FMOD_RESULT F_API getHardwareChannels    (int *numhardwarechannels);\n        FMOD_RESULT F_API getCPUUsage            (float *dsp, float *stream, float *geometry, float *update, float *total);\n        FMOD_RESULT F_API getSoundRAM            (int *currentalloced, int *maxalloced, int *total);\n        FMOD_RESULT F_API getNumCDROMDrives      (int *numdrives);\n        FMOD_RESULT F_API getCDROMDriveName      (int drive, char *drivename, int drivenamelen, char *scsiname, int scsinamelen, char *devicename, int devicenamelen);\n        FMOD_RESULT F_API getSpectrum            (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\n        FMOD_RESULT F_API getWaveData            (float *wavearray, int numvalues, int channeloffset);\n                                                \n        // Sound/DSP/Channel/FX creation and retrieval.       \n        FMOD_RESULT F_API createSound            (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);\n        FMOD_RESULT F_API createStream           (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);\n        FMOD_RESULT F_API createDSP              (FMOD_DSP_DESCRIPTION *description, DSP **dsp);\n        FMOD_RESULT F_API createDSPByType        (FMOD_DSP_TYPE type, DSP **dsp);\n        FMOD_RESULT F_API createChannelGroup     (const char *name, ChannelGroup **channelgroup);\n        FMOD_RESULT F_API createSoundGroup       (const char *name, SoundGroup **soundgroup);\n        FMOD_RESULT F_API createReverb           (Reverb **reverb); \n                                                \n        FMOD_RESULT F_API playSound              (FMOD_CHANNELINDEX channelid, Sound *sound, bool paused, Channel **channel);\n        FMOD_RESULT F_API playDSP                (FMOD_CHANNELINDEX channelid, DSP *dsp, bool paused, Channel **channel);\n        FMOD_RESULT F_API getChannel             (int channelid, Channel **channel);\n        FMOD_RESULT F_API getMasterChannelGroup  (ChannelGroup **channelgroup);\n        FMOD_RESULT F_API getMasterSoundGroup    (SoundGroup **soundgroup);\n                                              \n        // Reverb API                           \n        FMOD_RESULT F_API setReverbProperties    (const FMOD_REVERB_PROPERTIES *prop);\n        FMOD_RESULT F_API getReverbProperties    (FMOD_REVERB_PROPERTIES *prop);\n        FMOD_RESULT F_API setReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop);\n        FMOD_RESULT F_API getReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop);\n                                                 \n        // System level DSP access.\n        FMOD_RESULT F_API getDSPHead             (DSP **dsp);\n        FMOD_RESULT F_API addDSP                 (DSP *dsp, DSPConnection **connection);\n        FMOD_RESULT F_API lockDSP                ();\n        FMOD_RESULT F_API unlockDSP              ();\n        FMOD_RESULT F_API getDSPClock            (unsigned int *hi, unsigned int *lo);\n                                               \n        // Recording API.\n        FMOD_RESULT F_API getRecordNumDrivers    (int *numdrivers);\n        FMOD_RESULT F_API getRecordDriverInfo    (int id, char *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getRecordDriverInfoW   (int id, short *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getRecordDriverCaps    (int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency);\n        FMOD_RESULT F_API getRecordPosition      (int id, unsigned int *position);  \n\n        FMOD_RESULT F_API recordStart            (int id, Sound *sound, bool loop);\n        FMOD_RESULT F_API recordStop             (int id);\n        FMOD_RESULT F_API isRecording            (int id, bool *recording);\n\n        // Geometry API.\n        FMOD_RESULT F_API createGeometry         (int maxpolygons, int maxvertices, Geometry **geometry);\n        FMOD_RESULT F_API setGeometrySettings    (float maxworldsize);\n        FMOD_RESULT F_API getGeometrySettings    (float *maxworldsize);\n        FMOD_RESULT F_API loadGeometry           (const void *data, int datasize, Geometry **geometry);\n        FMOD_RESULT F_API getGeometryOcclusion   (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);\n\n        // Network functions.\n        FMOD_RESULT F_API setNetworkProxy        (const char *proxy);\n        FMOD_RESULT F_API getNetworkProxy        (char *proxy, int proxylen);\n        FMOD_RESULT F_API setNetworkTimeout      (int timeout);\n        FMOD_RESULT F_API getNetworkTimeout      (int *timeout);\n                                              \n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'Sound' API\n    */\n    class Sound\n    {\n      private:\n\n        Sound();   /* Constructor made private so user cannot statically instance a Sound class.\n                      Appropriate Sound creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        // Standard sound manipulation functions.                                                \n        FMOD_RESULT F_API lock                   (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);\n        FMOD_RESULT F_API unlock                 (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);\n        FMOD_RESULT F_API setDefaults            (float frequency, float volume, float pan, int priority);\n        FMOD_RESULT F_API getDefaults            (float *frequency, float *volume, float *pan,  int *priority);\n        FMOD_RESULT F_API setVariations          (float frequencyvar, float volumevar, float panvar);\n        FMOD_RESULT F_API getVariations          (float *frequencyvar, float *volumevar, float *panvar);\n        FMOD_RESULT F_API set3DMinMaxDistance    (float min, float max);\n        FMOD_RESULT F_API get3DMinMaxDistance    (float *min, float *max);\n        FMOD_RESULT F_API set3DConeSettings      (float insideconeangle, float outsideconeangle, float outsidevolume);\n        FMOD_RESULT F_API get3DConeSettings      (float *insideconeangle, float *outsideconeangle, float *outsidevolume);\n        FMOD_RESULT F_API set3DCustomRolloff     (FMOD_VECTOR *points, int numpoints);\n        FMOD_RESULT F_API get3DCustomRolloff     (FMOD_VECTOR **points, int *numpoints);\n        FMOD_RESULT F_API setSubSound            (int index, Sound *subsound);\n        FMOD_RESULT F_API getSubSound            (int index, Sound **subsound);\n        FMOD_RESULT F_API setSubSoundSentence    (int *subsoundlist, int numsubsounds);\n        FMOD_RESULT F_API getName                (char *name, int namelen);\n        FMOD_RESULT F_API getLength              (unsigned int *length, FMOD_TIMEUNIT lengthtype);\n        FMOD_RESULT F_API getFormat              (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);\n        FMOD_RESULT F_API getNumSubSounds        (int *numsubsounds);\n        FMOD_RESULT F_API getNumTags             (int *numtags, int *numtagsupdated);\n        FMOD_RESULT F_API getTag                 (const char *name, int index, FMOD_TAG *tag);\n        FMOD_RESULT F_API getOpenState           (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);\n        FMOD_RESULT F_API readData               (void *buffer, unsigned int lenbytes, unsigned int *read);\n        FMOD_RESULT F_API seekData               (unsigned int pcm);\n\n        FMOD_RESULT F_API setSoundGroup          (SoundGroup *soundgroup);\n        FMOD_RESULT F_API getSoundGroup          (SoundGroup **soundgroup);\n\n        // Synchronization point API.  These points can come from markers embedded in wav files, and can also generate channel callbacks.        \n        FMOD_RESULT F_API getNumSyncPoints       (int *numsyncpoints);\n        FMOD_RESULT F_API getSyncPoint           (int index, FMOD_SYNCPOINT **point);\n        FMOD_RESULT F_API getSyncPointInfo       (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);\n        FMOD_RESULT F_API addSyncPoint           (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);\n        FMOD_RESULT F_API deleteSyncPoint        (FMOD_SYNCPOINT *point);\n\n        // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.\n        FMOD_RESULT F_API setMode                (FMOD_MODE mode);\n        FMOD_RESULT F_API getMode                (FMOD_MODE *mode);\n        FMOD_RESULT F_API setLoopCount           (int loopcount);\n        FMOD_RESULT F_API getLoopCount           (int *loopcount);\n        FMOD_RESULT F_API setLoopPoints          (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\n        FMOD_RESULT F_API getLoopPoints          (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n        // For MOD/S3M/XM/IT/MID sequenced formats only.\n        FMOD_RESULT F_API getMusicNumChannels    (int *numchannels);\n        FMOD_RESULT F_API setMusicChannelVolume  (int channel, float volume);\n        FMOD_RESULT F_API getMusicChannelVolume  (int channel, float *volume);\n        FMOD_RESULT F_API setMusicSpeed          (float speed);\n        FMOD_RESULT F_API getMusicSpeed          (float *speed);\n                            \n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'Channel' API.\n    */ \n    class Channel\n    {\n      private:\n\n        Channel();   /* Constructor made private so user cannot statically instance a Channel class.  \n                        Appropriate Channel creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        FMOD_RESULT F_API stop                   ();\n        FMOD_RESULT F_API setPaused              (bool paused);\n        FMOD_RESULT F_API getPaused              (bool *paused);\n        FMOD_RESULT F_API setVolume              (float volume);\n        FMOD_RESULT F_API getVolume              (float *volume);\n        FMOD_RESULT F_API setFrequency           (float frequency);\n        FMOD_RESULT F_API getFrequency           (float *frequency);\n        FMOD_RESULT F_API setPan                 (float pan);\n        FMOD_RESULT F_API getPan                 (float *pan);\n        FMOD_RESULT F_API setDelay               (FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo);\n        FMOD_RESULT F_API getDelay               (FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo);\n        FMOD_RESULT F_API setSpeakerMix          (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\n        FMOD_RESULT F_API getSpeakerMix          (float *frontleft, float *frontright, float *center, float *lfe, float *backleft, float *backright, float *sideleft, float *sideright);\n        FMOD_RESULT F_API setSpeakerLevels       (FMOD_SPEAKER speaker, float *levels, int numlevels);\n        FMOD_RESULT F_API getSpeakerLevels       (FMOD_SPEAKER speaker, float *levels, int numlevels);\n        FMOD_RESULT F_API setInputChannelMix     (float *levels, int numlevels);\n        FMOD_RESULT F_API getInputChannelMix     (float *levels, int numlevels);\n        FMOD_RESULT F_API setMute                (bool mute);\n        FMOD_RESULT F_API getMute                (bool *mute);\n        FMOD_RESULT F_API setPriority            (int priority);\n        FMOD_RESULT F_API getPriority            (int *priority);\n        FMOD_RESULT F_API setPosition            (unsigned int position, FMOD_TIMEUNIT postype);\n        FMOD_RESULT F_API getPosition            (unsigned int *position, FMOD_TIMEUNIT postype);\n        FMOD_RESULT F_API setReverbProperties    (const FMOD_REVERB_CHANNELPROPERTIES *prop);\n        FMOD_RESULT F_API getReverbProperties    (FMOD_REVERB_CHANNELPROPERTIES *prop);\n        FMOD_RESULT F_API setLowPassGain         (float gain);\n        FMOD_RESULT F_API getLowPassGain         (float *gain);\n\n        FMOD_RESULT F_API setChannelGroup        (ChannelGroup *channelgroup);\n        FMOD_RESULT F_API getChannelGroup        (ChannelGroup **channelgroup);\n        FMOD_RESULT F_API setCallback            (FMOD_CHANNEL_CALLBACK callback);\n\n        // 3D functionality.\n        FMOD_RESULT F_API set3DAttributes        (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\n        FMOD_RESULT F_API get3DAttributes        (FMOD_VECTOR *pos, FMOD_VECTOR *vel);\n        FMOD_RESULT F_API set3DMinMaxDistance    (float mindistance, float maxdistance);\n        FMOD_RESULT F_API get3DMinMaxDistance    (float *mindistance, float *maxdistance);\n        FMOD_RESULT F_API set3DConeSettings      (float insideconeangle, float outsideconeangle, float outsidevolume);\n        FMOD_RESULT F_API get3DConeSettings      (float *insideconeangle, float *outsideconeangle, float *outsidevolume);\n        FMOD_RESULT F_API set3DConeOrientation   (FMOD_VECTOR *orientation);\n        FMOD_RESULT F_API get3DConeOrientation   (FMOD_VECTOR *orientation);\n        FMOD_RESULT F_API set3DCustomRolloff     (FMOD_VECTOR *points, int numpoints);\n        FMOD_RESULT F_API get3DCustomRolloff     (FMOD_VECTOR **points, int *numpoints);\n        FMOD_RESULT F_API set3DOcclusion         (float directocclusion, float reverbocclusion);\n        FMOD_RESULT F_API get3DOcclusion         (float *directocclusion, float *reverbocclusion);\n        FMOD_RESULT F_API set3DSpread            (float angle);\n        FMOD_RESULT F_API get3DSpread            (float *angle);\n        FMOD_RESULT F_API set3DPanLevel          (float level);\n        FMOD_RESULT F_API get3DPanLevel          (float *level);\n        FMOD_RESULT F_API set3DDopplerLevel      (float level);\n        FMOD_RESULT F_API get3DDopplerLevel      (float *level);\n        FMOD_RESULT F_API set3DDistanceFilter    (bool custom, float customLevel, float centerFreq);\n        FMOD_RESULT F_API get3DDistanceFilter    (bool *custom, float *customLevel, float *centerFreq);\n\n        // DSP functionality only for channels playing sounds created with FMOD_SOFTWARE.\n        FMOD_RESULT F_API getDSPHead             (DSP **dsp);\n        FMOD_RESULT F_API addDSP                 (DSP *dsp, DSPConnection **connection);\n\n        // Information only functions.\n        FMOD_RESULT F_API isPlaying              (bool *isplaying);\n        FMOD_RESULT F_API isVirtual              (bool *isvirtual);\n        FMOD_RESULT F_API getAudibility          (float *audibility);\n        FMOD_RESULT F_API getCurrentSound        (Sound **sound);\n        FMOD_RESULT F_API getSpectrum            (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\n        FMOD_RESULT F_API getWaveData            (float *wavearray, int numvalues, int channeloffset);\n        FMOD_RESULT F_API getIndex               (int *index);\n                                                \n        // Functions also found in Sound class but here they can be set per channel.\n        FMOD_RESULT F_API setMode                (FMOD_MODE mode);\n        FMOD_RESULT F_API getMode                (FMOD_MODE *mode);\n        FMOD_RESULT F_API setLoopCount           (int loopcount);\n        FMOD_RESULT F_API getLoopCount           (int *loopcount);\n        FMOD_RESULT F_API setLoopPoints          (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\n        FMOD_RESULT F_API getLoopPoints          (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n        // Userdata set/get.                                                \n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'ChannelGroup' API\n    */\n    class ChannelGroup\n    {\n      private:\n\n        ChannelGroup();   /* Constructor made private so user cannot statically instance a ChannelGroup class.  \n                             Appropriate ChannelGroup creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                 ();\n        FMOD_RESULT F_API getSystemObject         (System **system);\n\n        // Channelgroup scale values.  (changes attributes relative to the channels, doesn't overwrite them)\n        FMOD_RESULT F_API setVolume               (float volume);\n        FMOD_RESULT F_API getVolume               (float *volume);\n        FMOD_RESULT F_API setPitch                (float pitch);\n        FMOD_RESULT F_API getPitch                (float *pitch);\n        FMOD_RESULT F_API set3DOcclusion          (float directocclusion, float reverbocclusion);\n        FMOD_RESULT F_API get3DOcclusion          (float *directocclusion, float *reverbocclusion);\n        FMOD_RESULT F_API setPaused               (bool paused);\n        FMOD_RESULT F_API getPaused               (bool *paused);\n        FMOD_RESULT F_API setMute                 (bool mute);\n        FMOD_RESULT F_API getMute                 (bool *mute);\n\n        // Channelgroup override values.  (recursively overwrites whatever settings the channels had)\n        FMOD_RESULT F_API stop                    ();\n        FMOD_RESULT F_API overrideVolume          (float volume);\n        FMOD_RESULT F_API overrideFrequency       (float frequency);\n        FMOD_RESULT F_API overridePan             (float pan);\n        FMOD_RESULT F_API overrideReverbProperties(const FMOD_REVERB_CHANNELPROPERTIES *prop);\n        FMOD_RESULT F_API override3DAttributes    (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\n        FMOD_RESULT F_API overrideSpeakerMix      (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\n\n        // Nested channel groups.\n        FMOD_RESULT F_API addGroup                (ChannelGroup *group);\n        FMOD_RESULT F_API getNumGroups            (int *numgroups);\n        FMOD_RESULT F_API getGroup                (int index, ChannelGroup **group);\n        FMOD_RESULT F_API getParentGroup          (ChannelGroup **group);\n\n        // DSP functionality only for channel groups playing sounds created with FMOD_SOFTWARE.\n        FMOD_RESULT F_API getDSPHead              (DSP **dsp);\n        FMOD_RESULT F_API addDSP                  (DSP *dsp, DSPConnection **connection);\n\n        // Information only functions.\n        FMOD_RESULT F_API getName                 (char *name, int namelen);\n        FMOD_RESULT F_API getNumChannels          (int *numchannels);\n        FMOD_RESULT F_API getChannel              (int index, Channel **channel);\n        FMOD_RESULT F_API getSpectrum             (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\n        FMOD_RESULT F_API getWaveData             (float *wavearray, int numvalues, int channeloffset);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData             (void *userdata);\n        FMOD_RESULT F_API getUserData             (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo           (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'SoundGroup' API\n    */\n    class SoundGroup\n    {\n      private:\n\n        SoundGroup();       /* Constructor made private so user cannot statically instance a SoundGroup class.  \n                               Appropriate SoundGroup creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        // SoundGroup control functions.\n        FMOD_RESULT F_API setMaxAudible          (int maxaudible);\n        FMOD_RESULT F_API getMaxAudible          (int *maxaudible);\n        FMOD_RESULT F_API setMaxAudibleBehavior  (FMOD_SOUNDGROUP_BEHAVIOR behavior);\n        FMOD_RESULT F_API getMaxAudibleBehavior  (FMOD_SOUNDGROUP_BEHAVIOR *behavior);\n        FMOD_RESULT F_API setMuteFadeSpeed       (float speed);\n        FMOD_RESULT F_API getMuteFadeSpeed       (float *speed);\n        FMOD_RESULT F_API setVolume              (float volume);\n        FMOD_RESULT F_API getVolume              (float *volume);\n        FMOD_RESULT F_API stop                   ();\n\n        // Information only functions.\n        FMOD_RESULT F_API getName                (char *name, int namelen);\n        FMOD_RESULT F_API getNumSounds           (int *numsounds);\n        FMOD_RESULT F_API getSound               (int index, Sound **sound);\n        FMOD_RESULT F_API getNumPlaying          (int *numplaying);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n    \n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'DSP' API\n    */\n    class DSP\n    {\n      private:\n\n        DSP();   /* Constructor made private so user cannot statically instance a DSP class.  \n                    Appropriate DSP creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        // Connection / disconnection / input and output enumeration.\n        FMOD_RESULT F_API addInput               (DSP *target, DSPConnection **connection);\n        FMOD_RESULT F_API disconnectFrom         (DSP *target);\n        FMOD_RESULT F_API disconnectAll          (bool inputs, bool outputs);\n        FMOD_RESULT F_API remove                 ();\n        FMOD_RESULT F_API getNumInputs           (int *numinputs);\n        FMOD_RESULT F_API getNumOutputs          (int *numoutputs);\n        FMOD_RESULT F_API getInput               (int index, DSP **input, DSPConnection **inputconnection);\n        FMOD_RESULT F_API getOutput              (int index, DSP **output, DSPConnection **outputconnection);\n\n        // DSP unit control.\n        FMOD_RESULT F_API setActive              (bool active);\n        FMOD_RESULT F_API getActive              (bool *active);\n        FMOD_RESULT F_API setBypass              (bool bypass);\n        FMOD_RESULT F_API getBypass              (bool *bypass);\n        FMOD_RESULT F_API setSpeakerActive\t\t (FMOD_SPEAKER speaker, bool active);\n\t\tFMOD_RESULT F_API getSpeakerActive\t\t (FMOD_SPEAKER speaker, bool *active);\n\t\tFMOD_RESULT F_API reset                  ();\n\t\t\n\n        // DSP parameter control.\n        FMOD_RESULT F_API setParameter           (int index, float value);\n        FMOD_RESULT F_API getParameter           (int index, float *value, char *valuestr, int valuestrlen);\n        FMOD_RESULT F_API getNumParameters       (int *numparams);\n        FMOD_RESULT F_API getParameterInfo       (int index, char *name, char *label, char *description, int descriptionlen, float *min, float *max);\n        FMOD_RESULT F_API showConfigDialog       (void *hwnd, bool show);\n        \n        // DSP attributes.        \n        FMOD_RESULT F_API getInfo                (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);\n        FMOD_RESULT F_API getType                (FMOD_DSP_TYPE *type); \n        FMOD_RESULT F_API setDefaults            (float frequency, float volume, float pan, int priority);\n        FMOD_RESULT F_API getDefaults            (float *frequency, float *volume, float *pan, int *priority);\n                                                \n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n\n    /*\n        'DSPConnection' API\n    */\n    class DSPConnection\n    {\n      private:\n\n        DSPConnection();    /* Constructor made private so user cannot statically instance a DSPConnection class.  \n                               Appropriate DSPConnection creation or retrieval function must be used. */\n\n      public:\n\n        FMOD_RESULT F_API getInput              (DSP **input);\n        FMOD_RESULT F_API getOutput             (DSP **output);\n        FMOD_RESULT F_API setMix                (float volume);\n        FMOD_RESULT F_API getMix                (float *volume);\n        FMOD_RESULT F_API setLevels             (FMOD_SPEAKER speaker, float *levels, int numlevels);\n        FMOD_RESULT F_API getLevels             (FMOD_SPEAKER speaker, float *levels, int numlevels);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData           (void *userdata);\n        FMOD_RESULT F_API getUserData           (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo         (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n\n    /*\n        'Geometry' API\n    */\n    class Geometry\n    {\n      private:\n\n        Geometry();   /* Constructor made private so user cannot statically instance a Geometry class.  \n                         Appropriate Geometry creation or retrieval function must be used. */\n\n      public:        \n\n        FMOD_RESULT F_API release                ();\n\n        // Polygon manipulation.\n        FMOD_RESULT F_API addPolygon             (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);\n        FMOD_RESULT F_API getNumPolygons         (int *numpolygons); \n        FMOD_RESULT F_API getMaxPolygons         (int *maxpolygons, int *maxvertices);\n        FMOD_RESULT F_API getPolygonNumVertices  (int index, int *numvertices);\n        FMOD_RESULT F_API setPolygonVertex       (int index, int vertexindex, const FMOD_VECTOR *vertex); \n        FMOD_RESULT F_API getPolygonVertex       (int index, int vertexindex, FMOD_VECTOR *vertex);\n        FMOD_RESULT F_API setPolygonAttributes   (int index, float directocclusion, float reverbocclusion, bool doublesided); \n        FMOD_RESULT F_API getPolygonAttributes   (int index, float *directocclusion, float *reverbocclusion, bool *doublesided); \n\n        // Object manipulation.\n        FMOD_RESULT F_API setActive              (bool active);                                                 \n        FMOD_RESULT F_API getActive              (bool *active);                                                 \n        FMOD_RESULT F_API setRotation            (const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\n        FMOD_RESULT F_API getRotation            (FMOD_VECTOR *forward, FMOD_VECTOR *up);\n        FMOD_RESULT F_API setPosition            (const FMOD_VECTOR *position);\n        FMOD_RESULT F_API getPosition            (FMOD_VECTOR *position);\n        FMOD_RESULT F_API setScale               (const FMOD_VECTOR *scale);\n        FMOD_RESULT F_API getScale               (FMOD_VECTOR *scale);\n        FMOD_RESULT F_API save                   (void *data, int *datasize);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n\n    /*\n        'Reverb' API\n    */\n    class Reverb\n    {\n      private:\n\n        Reverb();    /*  Constructor made private so user cannot statically instance a Reverb class.  \n                         Appropriate Reverb creation or retrieval function must be used. */\n\n      public:    \n\n        FMOD_RESULT F_API release                ();\n\n        // Reverb manipulation.\n        FMOD_RESULT F_API set3DAttributes        (const FMOD_VECTOR *position, float mindistance, float maxdistance);\n        FMOD_RESULT F_API get3DAttributes        (FMOD_VECTOR *position, float *mindistance,float *maxdistance);\n        FMOD_RESULT F_API setProperties          (const FMOD_REVERB_PROPERTIES *properties);\n        FMOD_RESULT F_API getProperties          (FMOD_REVERB_PROPERTIES *properties);\n        FMOD_RESULT F_API setActive              (bool active);\n        FMOD_RESULT F_API getActive              (bool *active);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);    \n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmod_codec.h",
    "content": "/* ==================================================================================================== */\n/* FMOD Ex - codec development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011.  */\n/*                                                                                                      */\n/* Use this header if you are wanting to develop your own file format plugin to use with                */\n/* FMOD's codec system.  With this header you can make your own fileformat plugin that FMOD             */\n/* can register and use.  See the documentation and examples on how to make a working plugin.           */\n/*                                                                                                      */\n/* ==================================================================================================== */\n\n#ifndef _FMOD_CODEC_H\n#define _FMOD_CODEC_H\n\ntypedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;\ntypedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;\n\n/*\n    Codec callbacks\n*/ \ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPENCALLBACK)        (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSECALLBACK)       (FMOD_CODEC_STATE *codec_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READCALLBACK)        (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int sizebytes, unsigned int *bytesread);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTHCALLBACK)   (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATECALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATACALLBACK)    (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT)       (FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    When creating a codec, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file.\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_CODEC_STATE\n]\n*/\ntypedef struct FMOD_CODEC_DESCRIPTION\n{\n    const char                     *name;            /* [in] Name of the codec. */\n    unsigned int                    version;         /* [in] Plugin writer's version number. */\n    int                             defaultasstream; /* [in] Tells FMOD to open the file as a stream when calling System::createSound, and not a static sample.  Should normally be 0 (FALSE), because generally the user wants to decode the file into memory when using System::createSound.   Mainly used for formats that decode for a very long time, or could use large amounts of memory when decoded.  Usually sequenced formats such as mod/s3m/xm/it/midi fall into this category.   It is mainly to stop users that don't know what they're doing from getting FMOD_ERR_MEMORY returned from createSound when they should have in fact called System::createStream or used FMOD_CREATESTREAM in System::createSound. */\n    FMOD_TIMEUNIT                   timeunits;       /* [in] When setposition codec is called, only these time formats will be passed to the codec. Use bitwise OR to accumulate different types. */\n    FMOD_CODEC_OPENCALLBACK         open;            /* [in] Open callback for the codec for when FMOD tries to open a sound using this codec. */\n    FMOD_CODEC_CLOSECALLBACK        close;           /* [in] Close callback for the codec for when FMOD tries to close a sound using this codec.  */\n    FMOD_CODEC_READCALLBACK         read;            /* [in] Read callback for the codec for when FMOD tries to read some data from the file to the destination format (specified in the open callback). */\n    FMOD_CODEC_GETLENGTHCALLBACK    getlength;       /* [in] Callback to return the length of the song in whatever format required when Sound::getLength is called. */\n    FMOD_CODEC_SETPOSITIONCALLBACK  setposition;     /* [in] Seek callback for the codec for when FMOD tries to seek within the file with Channel::setPosition. */\n    FMOD_CODEC_GETPOSITIONCALLBACK  getposition;     /* [in] Tell callback for the codec for when FMOD tries to get the current position within the with Channel::getPosition. */\n    FMOD_CODEC_SOUNDCREATECALLBACK  soundcreate;     /* [in] Sound creation callback for the codec when FMOD finishes creating the sound.  (So the codec can set more parameters for the related created sound, ie loop points/mode or 3D attributes etc). */\n    FMOD_CODEC_GETWAVEFORMAT        getwaveformat;   /* [in] Callback to tell FMOD about the waveformat of a particular subsound.  This is to save memory, rather than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the codec, the codec might have a more optimal way of storing this information. */\n} FMOD_CODEC_DESCRIPTION;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Set these values marked 'in' to tell fmod what sort of sound to create.<br>\n    The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code.  So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.<br>\n    Members marked as 'out' are set by fmod.  Do not modify these.  Simply specify 0 for these values when declaring the structure, FMOD will fill in the values for you after creation with the correct function pointers.<br>\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    <br>\n    An FMOD file might be from disk, memory or network, however the file may be opened by the user.<br>\n    <br>\n    'numsubsounds' should be 0 if the file is a normal single sound stream or sound.  Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>\n    'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself.  Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), MIDI/MOD/S3M/XM/IT (contain instruments).<br>\n    The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format.  If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1.  If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.<br>\n    When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.\n    \n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_SOUND_FORMAT\n    FMOD_FILE_READCALLBACK      \n    FMOD_FILE_SEEKCALLBACK      \n    FMOD_CODEC_METADATACALLBACK\n    Sound::getSubSound\n    Sound::getNumSubSounds\n]\n*/\nstruct FMOD_CODEC_WAVEFORMAT\n{\n    char               name[256];     /* [in] Name of sound.*/\n    FMOD_SOUND_FORMAT  format;        /* [in] Format for (decompressed) codec output, ie FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16.*/\n    int                channels;      /* [in] Number of channels used by codec, ie mono = 1, stereo = 2. */\n    int                frequency;     /* [in] Default frequency in hz of the codec, ie 44100. */\n    unsigned int       lengthbytes;   /* [in] Length in bytes of the source data. */\n    unsigned int       lengthpcm;     /* [in] Length in decompressed, PCM samples of the file, ie length in seconds * frequency.  Used for Sound::getLength and for memory allocation of static decompressed sample data. */\n    int                blockalign;    /* [in] Blockalign in decompressed, PCM samples of the optimal decode chunk size for this format.  The codec read callback will be called in multiples of this value. */\n    int                loopstart;     /* [in] Loopstart in decompressed, PCM samples of file. */\n    int                loopend;       /* [in] Loopend in decompressed, PCM samples of file. */\n    FMOD_MODE          mode;          /* [in] Mode to determine whether the sound should by default load as looping, non looping, 2d or 3d. */\n    unsigned int       channelmask;   /* [in] Microsoft speaker channel mask, as defined for WAVEFORMATEXTENSIBLE and is found in ksmedia.h.  Leave at 0 to play in natural speaker order. */\n};\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Codec plugin structure that is passed into each callback.<br>\n    <br>\n    Set these numsubsounds and waveformat members when called in FMOD_CODEC_OPENCALLBACK to tell fmod what sort of sound to create.<br>\n    <br>\n    The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code.  So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.<br>\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    <br>\n    An FMOD file might be from disk, memory or internet, however the file may be opened by the user.<br>\n    <br>\n    'numsubsounds' should be 0 if the file is a normal single sound stream or sound.  Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>\n    'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself.  Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), DLS (contain instruments).<br>\n    The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format.  If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1.  If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.<br>\n    When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.\n    \n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_SOUND_FORMAT\n    FMOD_FILE_READCALLBACK      \n    FMOD_FILE_SEEKCALLBACK      \n    FMOD_CODEC_METADATACALLBACK\n    Sound::getSubSound\n    Sound::getNumSubSounds\n]\n*/\nstruct FMOD_CODEC_STATE\n{\n    int                         numsubsounds;  /* [in] Number of 'subsounds' in this sound.  Anything other than 0 makes it a 'container' format (ie CDDA/DLS/FSB etc which contain 1 or more su bsounds).  For most normal, single sound codec such as WAV/AIFF/MP3, this should be 0 as they are not a container for subsounds, they are the sound by itself. */\n    FMOD_CODEC_WAVEFORMAT      *waveformat;    /* [in] Pointer to an array of format structures containing information about each sample.  Can be 0 or NULL if FMOD_CODEC_GETWAVEFORMAT callback is preferred.  The number of entries here must equal the number of subsounds defined in the subsound parameter. If numsubsounds = 0 then there should be 1 instance of this structure. */\n    void                       *plugindata;    /* [in] Plugin writer created data the codec author wants to attach to this object. */\n                                               \n    void                       *filehandle;    /* [out] This will return an internal FMOD file handle to use with the callbacks provided.  */\n    unsigned int                filesize;      /* [out] This will contain the size of the file in bytes. */\n    FMOD_FILE_READCALLBACK      fileread;      /* [out] This will return a callable FMOD file function to use from codec. */\n    FMOD_FILE_SEEKCALLBACK      fileseek;      /* [out] This will return a callable FMOD file function to use from codec.  */\n    FMOD_CODEC_METADATACALLBACK metadata;      /* [out] This will return a callable FMOD metadata function to use from codec.  */\n};\n\n#endif\n\n\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmod_dsp.h",
    "content": "/* ========================================================================================== */\n/* FMOD Ex - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011.      */\n/*                                                                                            */\n/* Use this header if you are interested in delving deeper into the FMOD software mixing /    */\n/* DSP engine.  In this header you can find parameter structures for FMOD system reigstered   */\n/* DSP effects and generators.                                                                */\n/* Also use this header if you are wanting to develop your own DSP plugin to use with FMOD's  */\n/* dsp system.  With this header you can make your own DSP plugin that FMOD can               */\n/* register and use.  See the documentation and examples on how to make a working plugin.     */\n/*                                                                                            */\n/* ========================================================================================== */\n\n#ifndef _FMOD_DSP_H\n#define _FMOD_DSP_H\n\ntypedef struct FMOD_DSP_STATE FMOD_DSP_STATE;\n\n/* \n    DSP callbacks\n*/\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_CREATECALLBACK)     (FMOD_DSP_STATE *dsp_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RELEASECALLBACK)    (FMOD_DSP_STATE *dsp_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RESETCALLBACK)      (FMOD_DSP_STATE *dsp_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_READCALLBACK)       (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPOSITIONCALLBACK)(FMOD_DSP_STATE *dsp_state, unsigned int pos);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAMCALLBACK)   (FMOD_DSP_STATE *dsp_state, int index, float value);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAMCALLBACK)   (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DIALOGCALLBACK)     (FMOD_DSP_STATE *dsp_state, void *hwnd, int show);\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These definitions can be used for creating FMOD defined special effects or DSP units.\n\n    [REMARKS]\n    To get them to be active, first create the unit, then add it somewhere into the DSP network, either at the front of the network near the soundcard unit to affect the global output (by using System::getDSPHead), or on a single channel (using Channel::getDSPHead).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createDSPByType\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_TYPE_UNKNOWN,            /* This unit was created via a non FMOD plugin so has an unknown purpose. */\n    FMOD_DSP_TYPE_MIXER,              /* This unit does nothing but take inputs and mix them together then feed the result to the soundcard unit. */\n    FMOD_DSP_TYPE_OSCILLATOR,         /* This unit generates sine/square/saw/triangle or noise tones. */\n    FMOD_DSP_TYPE_LOWPASS,            /* This unit filters sound using a high quality, resonant lowpass filter algorithm but consumes more CPU time. */\n    FMOD_DSP_TYPE_ITLOWPASS,          /* This unit filters sound using a resonant lowpass filter algorithm that is used in Impulse Tracker, but with limited cutoff range (0 to 8060hz). */\n    FMOD_DSP_TYPE_HIGHPASS,           /* This unit filters sound using a resonant highpass filter algorithm. */\n    FMOD_DSP_TYPE_ECHO,               /* This unit produces an echo on the sound and fades out at the desired rate. */\n    FMOD_DSP_TYPE_FLANGE,             /* This unit produces a flange effect on the sound. */\n    FMOD_DSP_TYPE_DISTORTION,         /* This unit distorts the sound. */\n    FMOD_DSP_TYPE_NORMALIZE,          /* This unit normalizes or amplifies the sound to a certain level. */\n    FMOD_DSP_TYPE_PARAMEQ,            /* This unit attenuates or amplifies a selected frequency range. */\n    FMOD_DSP_TYPE_PITCHSHIFT,         /* This unit bends the pitch of a sound without changing the speed of playback. */\n    FMOD_DSP_TYPE_CHORUS,             /* This unit produces a chorus effect on the sound. */\n    FMOD_DSP_TYPE_VSTPLUGIN,          /* This unit allows the use of Steinberg VST plugins */\n    FMOD_DSP_TYPE_WINAMPPLUGIN,       /* This unit allows the use of Nullsoft Winamp plugins */\n    FMOD_DSP_TYPE_ITECHO,             /* This unit produces an echo on the sound and fades out at the desired rate as is used in Impulse Tracker. */\n    FMOD_DSP_TYPE_COMPRESSOR,         /* This unit implements dynamic compression (linked multichannel, wideband) */\n    FMOD_DSP_TYPE_SFXREVERB,          /* This unit implements SFX reverb */\n    FMOD_DSP_TYPE_LOWPASS_SIMPLE,     /* This unit filters sound using a simple lowpass with no resonance, but has flexible cutoff and is fast. */\n    FMOD_DSP_TYPE_DELAY,              /* This unit produces different delays on individual channels of the sound. */\n    FMOD_DSP_TYPE_TREMOLO,            /* This unit produces a tremolo / chopper effect on the sound. */\n    FMOD_DSP_TYPE_LADSPAPLUGIN,       /* This unit allows the use of LADSPA standard plugins. */\n    FMOD_DSP_TYPE_HIGHPASS_SIMPLE,    /* This unit filters sound using a simple highpass with no resonance, but has flexible cutoff and is fast. */\n    FMOD_DSP_TYPE_FORCEINT = 65536    /* Makes sure this enum is signed 32bit. */\n} FMOD_DSP_TYPE;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure to define a parameter for a DSP unit.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    <br>\n    The step parameter tells the gui or application that the parameter has a certain granularity.<br>\n    For example in the example of cutoff frequency with a range from 100.0 to 22050.0 you might only want the selection to be in 10hz increments.  For this you would simply use 10.0 as the step value.<br>\n    For a boolean, you can use min = 0.0, max = 1.0, step = 1.0.  This way the only possible values are 0.0 and 1.0.<br>\n    Some applications may detect min = 0.0, max = 1.0, step = 1.0 and replace a graphical slider bar with a checkbox instead.<br>\n    A step value of 1.0 would simulate integer values only.<br>\n    A step value of 0.0 would mean the full floating point range is accessable.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]    \n    System::createDSP\n    DSP::setParameter\n]\n*/\ntypedef struct FMOD_DSP_PARAMETERDESC\n{\n    float       min;                                /* [w] Minimum value of the parameter (ie 100.0). */\n    float       max;                                /* [w] Maximum value of the parameter (ie 22050.0). */\n    float       defaultval;                         /* [w] Default value of parameter. */\n    char        name[16];                           /* [w] Name of the parameter to be displayed (ie \"Cutoff frequency\"). */\n    char        label[16];                          /* [w] Short string to be put next to value to denote the unit type (ie \"hz\"). */\n    const char *description;                        /* [w] Description of the parameter to be displayed as a help item / tooltip for this parameter. */\n} FMOD_DSP_PARAMETERDESC;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    <br>\n    There are 2 different ways to change a parameter in this architecture.<br>\n    One is to use DSP::setParameter / DSP::getParameter.  This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.<br>\n    The other is to use DSP::showConfigDialog.  This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]    \n    System::createDSP\n    FMOD_DSP_STATE\n]\n*/\ntypedef struct FMOD_DSP_DESCRIPTION\n{\n    char                         name[32];           /* [w] Name of the unit to be displayed in the network. */\n    unsigned int                 version;            /* [w] Plugin writer's version number. */\n    int                          channels;           /* [w] Number of channels.  Use 0 to process whatever number of channels is currently in the network.  >0 would be mostly used if the unit is a unit that only generates sound. */\n    FMOD_DSP_CREATECALLBACK      create;             /* [w] Create callback.  This is called when DSP unit is created.  Can be null. */\n    FMOD_DSP_RELEASECALLBACK     release;            /* [w] Release callback.  This is called just before the unit is freed so the user can do any cleanup needed for the unit.  Can be null. */\n    FMOD_DSP_RESETCALLBACK       reset;              /* [w] Reset callback.  This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state.  Use to avoid clicks or artifacts. */\n    FMOD_DSP_READCALLBACK        read;               /* [w] Read callback.  Processing is done here.  Can be null. */\n    FMOD_DSP_SETPOSITIONCALLBACK setposition;        /* [w] Set position callback.  This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source.  Can be null. */\n\n    int                          numparameters;      /* [w] Number of parameters used in this filter.  The user finds this with DSP::getNumParameters */\n    FMOD_DSP_PARAMETERDESC      *paramdesc;          /* [w] Variable number of parameter structures. */\n    FMOD_DSP_SETPARAMCALLBACK    setparameter;       /* [w] This is called when the user calls DSP::setParameter.  Can be null. */\n    FMOD_DSP_GETPARAMCALLBACK    getparameter;       /* [w] This is called when the user calls DSP::getParameter.  Can be null. */\n    FMOD_DSP_DIALOGCALLBACK      config;             /* [w] This is called when the user calls DSP::showConfigDialog.  Can be used to display a dialog to configure the filter.  Can be null. */\n    int                          configwidth;        /* [w] Width of config dialog graphic if there is one.  0 otherwise.*/\n    int                          configheight;       /* [w] Height of config dialog graphic if there is one.  0 otherwise.*/\n    void                        *userdata;           /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation.  Access via DSP::getUserData. */\n} FMOD_DSP_DESCRIPTION;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    DSP plugin structure that is passed into each callback.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_DSP_DESCRIPTION\n]\n*/\nstruct FMOD_DSP_STATE\n{\n    FMOD_DSP      *instance;      /* [r] Handle to the DSP hand the user created.  Not to be modified.  C++ users cast to FMOD::DSP to use.  */\n    void          *plugindata;    /* [w] Plugin writer created data the output author wants to attach to this object. */\n\tunsigned short speakermask;\t  /* [w] Specifies which speakers the DSP effect is active on */\n};\n\n\n/*\n    ===================================================================================================\n\n    FMOD built in effect parameters.  \n    Use DSP::setParameter with these enums for the 'index' parameter.\n\n    ===================================================================================================\n*/\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_OSCILLATOR filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_OSCILLATOR_TYPE,   /* Waveform type.  0 = sine.  1 = square. 2 = sawup. 3 = sawdown. 4 = triangle. 5 = noise.  */\n    FMOD_DSP_OSCILLATOR_RATE    /* Frequency of the sinewave in hz.  1.0 to 22000.0.  Default = 220.0. */\n} FMOD_DSP_OSCILLATOR;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_LOWPASS filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_LOWPASS_CUTOFF,    /* Lowpass cutoff frequency in hz.   10.0 to 22000.0.  Default = 5000.0. */\n    FMOD_DSP_LOWPASS_RESONANCE  /* Lowpass resonance Q value. 1.0 to 10.0.  Default = 1.0. */\n} FMOD_DSP_LOWPASS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_ITLOWPASS filter.<br>\n    This is different to the default FMOD_DSP_TYPE_ITLOWPASS filter in that it uses a different quality algorithm and is \n    the filter used to produce the correct sounding playback in .IT files.<br> \n    FMOD Ex's .IT playback uses this filter.<br>\n\n    [REMARKS]\n    Note! This filter actually has a limited cutoff frequency below the specified maximum, due to its limited design, \n    so for a more  open range filter use FMOD_DSP_LOWPASS or if you don't mind not having resonance, \n    FMOD_DSP_LOWPASS_SIMPLE.<br>\n    The effective maximum cutoff is about 8060hz.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_ITLOWPASS_CUTOFF,    /* Lowpass cutoff frequency in hz.  1.0 to 22000.0.  Default = 5000.0/ */\n    FMOD_DSP_ITLOWPASS_RESONANCE  /* Lowpass resonance Q value.  0.0 to 127.0.  Default = 1.0. */\n} FMOD_DSP_ITLOWPASS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_HIGHPASS filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_HIGHPASS_CUTOFF,    /* Highpass cutoff frequency in hz.  1.0 to output 22000.0.  Default = 5000.0. */\n    FMOD_DSP_HIGHPASS_RESONANCE  /* Highpass resonance Q value.  1.0 to 10.0.  Default = 1.0. */\n} FMOD_DSP_HIGHPASS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_ECHO filter.\n\n    [REMARKS]\n    Note.  Every time the delay is changed, the plugin re-allocates the echo buffer.  This means the echo will dissapear at that time while it refills its new buffer.<br>\n    Larger echo delays result in larger amounts of memory allocated.<br>\n    <br>\n    '<i>maxchannels</i>' also dictates the amount of memory allocated.  By default, the maxchannels value is 0.  If FMOD is set to stereo, the echo unit will allocate enough memory for 2 channels.  If it is 5.1, it will allocate enough memory for a 6 channel echo, etc.<br>\n    If the echo effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.<br>\n    When the echo is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly.  It is only in this case where you might want to increase the channel count above the output's channel count.<br>\n    If a channel echo is set to a lower number than the sound's channel count that is coming in, it will not echo the sound.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_ECHO_DELAY,       /* Echo delay in ms.  10  to 5000.  Default = 500. */\n    FMOD_DSP_ECHO_DECAYRATIO,  /* Echo decay per delay.  0 to 1.  1.0 = No decay, 0.0 = total decay (ie simple 1 line delay).  Default = 0.5. */\n    FMOD_DSP_ECHO_MAXCHANNELS, /* Maximum channels supported.  0 to 16.  0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc.  See remarks for more.  Default = 0.  It is suggested to leave at 0! */\n    FMOD_DSP_ECHO_DRYMIX,      /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 1.0. */\n    FMOD_DSP_ECHO_WETMIX       /* Volume of echo signal to pass to output.  0.0 to 1.0. Default = 1.0. */\n} FMOD_DSP_ECHO;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_DELAY filter.\n\n    [REMARKS]\n    Note.  Every time MaxDelay is changed, the plugin re-allocates the delay buffer.  This means the delay will dissapear at that time while it refills its new buffer.<br>\n    A larger MaxDelay results in larger amounts of memory allocated.<br>\n    Channel delays above MaxDelay will be clipped to MaxDelay and the delay buffer will not be resized.<br>\n    <br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_DELAY_CH0,      /* Channel #0 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH1,      /* Channel #1 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH2,      /* Channel #2 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH3,      /* Channel #3 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH4,      /* Channel #4 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH5,      /* Channel #5 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH6,      /* Channel #6 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH7,      /* Channel #7 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH8,      /* Channel #8 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH9,      /* Channel #9 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH10,     /* Channel #10 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH11,     /* Channel #11 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH12,     /* Channel #12 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH13,     /* Channel #13 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH14,     /* Channel #14 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH15,     /* Channel #15 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_MAXDELAY  /* Maximum delay in ms.  0  to 10000.  Default = 10. */\n} FMOD_DSP_DELAY;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_FLANGE filter.\n\n    [REMARKS]\n    Flange is an effect where the signal is played twice at the same time, and one copy slides back and forth creating a whooshing or flanging effect.<br>\n    As there are 2 copies of the same signal, by default each signal is given 50% mix, so that the total is not louder than the original unaffected signal.<br>\n    <br>\n    Flange depth is a percentage of a 10ms shift from the original signal.  Anything above 10ms is not considered flange because to the ear it begins to 'echo' so 10ms is the highest value possible.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_FLANGE_DRYMIX,      /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 0.45. */\n    FMOD_DSP_FLANGE_WETMIX,      /* Volume of flange signal to pass to output.  0.0 to 1.0. Default = 0.55. */\n    FMOD_DSP_FLANGE_DEPTH,       /* Flange depth.  0.01 to 1.0.  Default = 1.0. */\n    FMOD_DSP_FLANGE_RATE         /* Flange speed in hz.  0.0 to 20.0.  Default = 0.1. */\n} FMOD_DSP_FLANGE;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_TREMOLO filter.\n\n    [REMARKS]\n    The tremolo effect varies the amplitude of a sound. Depending on the settings, this unit can produce a tremolo, chopper or auto-pan effect.<br>\n    <br>\n    The shape of the LFO (low freq. oscillator) can morphed between sine, triangle and sawtooth waves using the FMOD_DSP_TREMOLO_SHAPE and FMOD_DSP_TREMOLO_SKEW parameters.<br>\n    FMOD_DSP_TREMOLO_DUTY and FMOD_DSP_TREMOLO_SQUARE are useful for a chopper-type effect where the first controls the on-time duration and second controls the flatness of the envelope.<br>\n    FMOD_DSP_TREMOLO_SPREAD varies the LFO phase between channels to get an auto-pan effect. This works best with a sine shape LFO.<br>\n    The LFO can be synchronized using the FMOD_DSP_TREMOLO_PHASE parameter which sets its instantaneous phase.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_TREMOLO_FREQUENCY,     /* LFO frequency in Hz.  0.1 to 20.  Default = 4. */\n    FMOD_DSP_TREMOLO_DEPTH,         /* Tremolo depth.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_SHAPE,         /* LFO shape morph between triangle and sine.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_SKEW,          /* Time-skewing of LFO cycle.  -1 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_DUTY,          /* LFO on-time.  0 to 1.  Default = 0.5. */\n    FMOD_DSP_TREMOLO_SQUARE,        /* Flatness of the LFO shape.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_PHASE,         /* Instantaneous LFO phase.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_SPREAD         /* Rotation / auto-pan effect.  -1 to 1.  Default = 0. */\n} FMOD_DSP_TREMOLO;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_DISTORTION filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_DISTORTION_LEVEL    /* Distortion value.  0.0 to 1.0.  Default = 0.5. */\n} FMOD_DSP_DISTORTION;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_NORMALIZE filter.\n\n    [REMARKS]\n    Normalize amplifies the sound based on the maximum peaks within the signal.<br>\n    For example if the maximum peaks in the signal were 50% of the bandwidth, it would scale the whole sound by 2.<br>\n    The lower threshold value makes the normalizer ignores peaks below a certain point, to avoid over-amplification if a loud signal suddenly came in, and also to avoid amplifying to maximum things like background hiss.<br>\n    <br>\n    Because FMOD is a realtime audio processor, it doesn't have the luxury of knowing the peak for the whole sound (ie it can't see into the future), so it has to process data as it comes in.<br>\n    To avoid very sudden changes in volume level based on small samples of new data, fmod fades towards the desired amplification which makes for smooth gain control.  The fadetime parameter can control this.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_NORMALIZE_FADETIME,    /* Time to ramp the silence to full in ms.  0.0 to 20000.0. Default = 5000.0. */\n    FMOD_DSP_NORMALIZE_THRESHHOLD,  /* Lower volume range threshold to ignore.  0.0 to 1.0.  Default = 0.1.  Raise higher to stop amplification of very quiet signals. */\n    FMOD_DSP_NORMALIZE_MAXAMP       /* Maximum amplification allowed.  1.0 to 100000.0.  Default = 20.0.  1.0 = no amplifaction, higher values allow more boost. */\n} FMOD_DSP_NORMALIZE;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_PARAMEQ filter.\n\n    [REMARKS]\n    Parametric EQ is a bandpass filter that attenuates or amplifies a selected frequency and its neighbouring frequencies.<br>\n    <br>\n    To create a multi-band EQ create multiple FMOD_DSP_TYPE_PARAMEQ units and set each unit to different frequencies, for example 1000hz, 2000hz, 4000hz, 8000hz, 16000hz with a range of 1 octave each.<br>\n    <br>\n    When a frequency has its gain set to 1.0, the sound will be unaffected and represents the original signal exactly.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_PARAMEQ_CENTER,     /* Frequency center.  20.0 to 22000.0.  Default = 8000.0. */\n    FMOD_DSP_PARAMEQ_BANDWIDTH,  /* Octave range around the center frequency to filter.  0.2 to 5.0.  Default = 1.0. */\n    FMOD_DSP_PARAMEQ_GAIN        /* Frequency Gain.  0.05 to 3.0.  Default = 1.0.  */\n} FMOD_DSP_PARAMEQ;\n\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_PITCHSHIFT filter.\n\n    [REMARKS]\n    This pitch shifting unit can be used to change the pitch of a sound without speeding it up or slowing it down.<br>\n    It can also be used for time stretching or scaling, for example if the pitch was doubled, and the frequency of the sound was halved, the pitch of the sound would sound correct but it would be twice as slow.<br>\n    <br>\n    <b>Warning!</b> This filter is very computationally expensive!  Similar to a vocoder, it requires several overlapping FFT and IFFT's to produce smooth output, and can require around 440mhz for 1 stereo 48khz signal using the default settings.<br>\n    Reducing the signal to mono will half the cpu usage.<br>\n    Reducing this will lower audio quality, but what settings to use are largely dependant on the sound being played.  A noisy polyphonic signal will need higher fft size compared to a speaking voice for example.<br>\n    <br>\n    This pitch shifter is based on the pitch shifter code at http://www.dspdimension.com, written by Stephan M. Bernsee.<br>\n    The original code is COPYRIGHT 1999-2003 Stephan M. Bernsee <smb@dspdimension.com>.<br>\n    <br>\n    '<i>maxchannels</i>' dictates the amount of memory allocated.  By default, the maxchannels value is 0.  If FMOD is set to stereo, the pitch shift unit will allocate enough memory for 2 channels.  If it is 5.1, it will allocate enough memory for a 6 channel pitch shift, etc.<br>\n    If the pitch shift effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.<br>\n    When the pitch shift is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly.  It is only in this case where you might want to increase the channel count above the output's channel count.<br>\n    If a channel pitch shift is set to a lower number than the sound's channel count that is coming in, it will not pitch shift the sound.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_PITCHSHIFT_PITCH,       /* Pitch value.  0.5 to 2.0.  Default = 1.0. 0.5 = one octave down, 2.0 = one octave up.  1.0 does not change the pitch. */\n    FMOD_DSP_PITCHSHIFT_FFTSIZE,     /* FFT window size.  256, 512, 1024, 2048, 4096.  Default = 1024.  Increase this to reduce 'smearing'.  This effect is a warbling sound similar to when an mp3 is encoded at very low bitrates. */\n    FMOD_DSP_PITCHSHIFT_OVERLAP,     /* Removed.  Do not use.  FMOD now uses 4 overlaps and cannot be changed. */\n    FMOD_DSP_PITCHSHIFT_MAXCHANNELS  /* Maximum channels supported.  0 to 16.  0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc.  See remarks for more.  Default = 0.  It is suggested to leave at 0! */\n} FMOD_DSP_PITCHSHIFT;\n\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_CHORUS filter.\n\n    [REMARKS]\n    Chrous is an effect where the sound is more 'spacious' due to 1 to 3 versions of the sound being played along side the original signal but with the pitch of each copy modulating on a sine wave.<br>\n    This is a highly configurable chorus unit.  It supports 3 taps, small and large delay times and also feedback.<br>\n    This unit also could be used to do a simple echo, or a flange effect. \n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_CHORUS_DRYMIX,   /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 0.5. */\n    FMOD_DSP_CHORUS_WETMIX1,  /* Volume of 1st chorus tap.  0.0 to 1.0.  Default = 0.5. */\n    FMOD_DSP_CHORUS_WETMIX2,  /* Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the first tap.  0.0 to 1.0.  Default = 0.5. */\n    FMOD_DSP_CHORUS_WETMIX3,  /* Volume of 3rd chorus tap. This tap is 90 degrees out of phase of the second tap.  0.0 to 1.0.  Default = 0.5. */\n    FMOD_DSP_CHORUS_DELAY,    /* Chorus delay in ms.  0.1 to 100.0.  Default = 40.0 ms. */\n    FMOD_DSP_CHORUS_RATE,     /* Chorus modulation rate in hz.  0.0 to 20.0.  Default = 0.8 hz. */\n    FMOD_DSP_CHORUS_DEPTH,    /* Chorus modulation depth.  0.0 to 1.0.  Default = 0.03. */\n    FMOD_DSP_CHORUS_FEEDBACK  /* Chorus feedback.  Controls how much of the wet signal gets fed back into the chorus buffer.  0.0 to 1.0.  Default = 0.0. */\n} FMOD_DSP_CHORUS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_ITECHO filter.<br>\n    This is effectively a software based echo filter that emulates the DirectX DMO echo effect.  Impulse tracker files can support this, and FMOD will produce the effect on ANY platform, not just those that support DirectX effects!<br>\n\n    [REMARKS]\n    Note.  Every time the delay is changed, the plugin re-allocates the echo buffer.  This means the echo will dissapear at that time while it refills its new buffer.<br>\n    Larger echo delays result in larger amounts of memory allocated.<br>\n    <br>\n    As this is a stereo filter made mainly for IT playback, it is targeted for stereo signals.<br>\n    With mono signals only the FMOD_DSP_ITECHO_LEFTDELAY is used.<br>\n    For multichannel signals (>2) there will be no echo on those channels.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::SetParameter\n    DSP::GetParameter\n    FMOD_DSP_TYPE\n    System::addDSP\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_ITECHO_WETDRYMIX,      /* Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0.0 through 100.0 (all wet). The default value is 50. */\n    FMOD_DSP_ITECHO_FEEDBACK,       /* Percentage of output fed back into input, in the range from 0.0 through 100.0. The default value is 50. */\n    FMOD_DSP_ITECHO_LEFTDELAY,      /* Delay for left channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */\n    FMOD_DSP_ITECHO_RIGHTDELAY,     /* Delay for right channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */\n    FMOD_DSP_ITECHO_PANDELAY        /* Value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. Possible values are defined as 0.0 (equivalent to FALSE) and 1.0 (equivalent to TRUE).  CURRENTLY NOT SUPPORTED. */\n} FMOD_DSP_ITECHO;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_COMPRESSOR unit.\n    This is a simple linked multichannel software limiter that is uniform across the whole spectrum.<br>\n\n    [REMARKS]\n    The limiter is not guaranteed to catch every peak above the threshold level,\n    because it cannot apply gain reduction instantaneously - the time delay is\n    determined by the attack time. However setting the attack time too short will\n    distort the sound, so it is a compromise. High level peaks can be avoided by\n    using a short attack time - but not too short, and setting the threshold a few\n    decibels below the critical level.\n    <br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::SetParameter\n    DSP::GetParameter\n    FMOD_DSP_TYPE\n    System::addDSP\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_COMPRESSOR_THRESHOLD,  /* Threshold level (dB) in the range from -60 through 0. The default value is 0. */ \n    FMOD_DSP_COMPRESSOR_ATTACK,     /* Gain reduction attack time (milliseconds), in the range from 10 through 200. The default value is 50. */\n    FMOD_DSP_COMPRESSOR_RELEASE,    /* Gain reduction release time (milliseconds), in the range from 20 through 1000. The default value is 50. */\n    FMOD_DSP_COMPRESSOR_GAINMAKEUP  /* Make-up gain (dB) applied after limiting, in the range from 0 through 30. The default value is 0. */\n} FMOD_DSP_COMPRESSOR;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_SFXREVERB unit.<br>\n    \n    [REMARKS]\n    This is a high quality I3DL2 based reverb.<br>\n    On top of the I3DL2 property set, \"Dry Level\" is also included to allow the dry mix to be changed.<br>\n    <br>\n    These properties can be set with presets in FMOD_REVERB_PRESETS.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::SetParameter\n    DSP::GetParameter\n    FMOD_DSP_TYPE\n    System::addDSP\n    FMOD_REVERB_PRESETS\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_SFXREVERB_DRYLEVEL,            /* Dry Level      : Mix level of dry signal in output in mB.  Ranges from -10000.0 to 0.0.  Default is 0. */\n    FMOD_DSP_SFXREVERB_ROOM,                /* Room           : Room effect level at low frequencies in mB.  Ranges from -10000.0 to 0.0.  Default is -10000.0. */\n    FMOD_DSP_SFXREVERB_ROOMHF,              /* Room HF        : Room effect high-frequency level re. low frequency level in mB.  Ranges from -10000.0 to 0.0.  Default is 0.0. */\n    FMOD_DSP_SFXREVERB_DECAYTIME,           /* Decay Time     : Reverberation decay time at low-frequencies in seconds.  Ranges from 0.1 to 20.0. Default is 1.0. */\n    FMOD_DSP_SFXREVERB_DECAYHFRATIO,        /* Decay HF Ratio : High-frequency to low-frequency decay time ratio.  Ranges from 0.1 to 2.0. Default is 0.5. */\n    FMOD_DSP_SFXREVERB_REFLECTIONSLEVEL,    /* Reflections    : Early reflections level relative to room effect in mB.  Ranges from -10000.0 to 1000.0.  Default is -10000.0. */\n    FMOD_DSP_SFXREVERB_REFLECTIONSDELAY,    /* Reflect Delay  : Delay time of first reflection in seconds.  Ranges from 0.0 to 0.3.  Default is 0.02. */\n    FMOD_DSP_SFXREVERB_REVERBLEVEL,         /* Reverb         : Late reverberation level relative to room effect in mB.  Ranges from -10000.0 to 2000.0.  Default is 0.0. */\n    FMOD_DSP_SFXREVERB_REVERBDELAY,         /* Reverb Delay   : Late reverberation delay time relative to first reflection in seconds.  Ranges from 0.0 to 0.1.  Default is 0.04. */\n    FMOD_DSP_SFXREVERB_DIFFUSION,           /* Diffusion      : Reverberation diffusion (echo density) in percent.  Ranges from 0.0 to 100.0.  Default is 100.0. */\n    FMOD_DSP_SFXREVERB_DENSITY,             /* Density        : Reverberation density (modal density) in percent.  Ranges from 0.0 to 100.0.  Default is 100.0. */\n    FMOD_DSP_SFXREVERB_HFREFERENCE,         /* HF Reference   : Reference high frequency in Hz.  Ranges from 20.0 to 20000.0. Default is 5000.0. */\n    FMOD_DSP_SFXREVERB_ROOMLF,              /* Room LF        : Room effect low-frequency level in mB.  Ranges from -10000.0 to 0.0.  Default is 0.0. */\n    FMOD_DSP_SFXREVERB_LFREFERENCE          /* LF Reference   : Reference low-frequency in Hz.  Ranges from 20.0 to 1000.0. Default is 250.0. */\n} FMOD_DSP_SFXREVERB;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_LOWPASS_SIMPLE filter.<br>\n    This is a very simple low pass filter, based on two single-pole RC time-constant modules.\n    The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.<br> \n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_LOWPASS_SIMPLE_CUTOFF     /* Lowpass cutoff frequency in hz.  10.0 to 22000.0.  Default = 5000.0 */\n} FMOD_DSP_LOWPASS_SIMPLE;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_HIGHPASS_SIMPLE filter.<br>\n    This is a very simple single-order high pass filter.\n    The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.<br> \n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_HIGHPASS_SIMPLE_CUTOFF     /* Highpass cutoff frequency in hz.  10.0 to 22000.0.  Default = 1000.0 */\n} FMOD_DSP_HIGHPASS_SIMPLE;\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmod_errors.h",
    "content": "/*$ preserve start $*/\n\n/* ============================================================================================== */\n/* FMOD Ex - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */\n/*                                                                                                */\n/* Use this header if you want to store or display a string version / english explanation of      */\n/* the FMOD error codes.                                                                          */\n/*                                                                                                */\n/* ============================================================================================== */\n\n#ifndef _FMOD_ERRORS_H\n#define _FMOD_ERRORS_H\n\n#include \"fmod.h\"\n\n#ifdef __GNUC__ \nstatic const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));\n#endif\n\nstatic const char *FMOD_ErrorString(FMOD_RESULT errcode)\n{\n    switch (errcode)\n    {\n/*$ preserve end $*/\n        case FMOD_ERR_ALREADYLOCKED:          return \"Tried to call lock a second time before unlock was called. \";\n        case FMOD_ERR_BADCOMMAND:             return \"Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). \";\n        case FMOD_ERR_CDDA_DRIVERS:           return \"Neither NTSCSI nor ASPI could be initialised. \";\n        case FMOD_ERR_CDDA_INIT:              return \"An error occurred while initialising the CDDA subsystem. \";\n        case FMOD_ERR_CDDA_INVALID_DEVICE:    return \"Couldn't find the specified device. \";\n        case FMOD_ERR_CDDA_NOAUDIO:           return \"No audio tracks on the specified disc. \";\n        case FMOD_ERR_CDDA_NODEVICES:         return \"No CD/DVD devices were found. \";\n        case FMOD_ERR_CDDA_NODISC:            return \"No disc present in the specified drive. \";\n        case FMOD_ERR_CDDA_READ:              return \"A CDDA read error occurred. \";\n        case FMOD_ERR_CHANNEL_ALLOC:          return \"Error trying to allocate a channel. \";\n        case FMOD_ERR_CHANNEL_STOLEN:         return \"The specified channel has been reused to play another sound. \";\n        case FMOD_ERR_COM:                    return \"A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. \";\n        case FMOD_ERR_DMA:                    return \"DMA Failure.  See debug output for more information. \";\n        case FMOD_ERR_DSP_CONNECTION:         return \"DSP connection error.  Connection possibly caused a cyclic dependancy.  Or tried to connect a tree too many units deep (more than 128). \";\n        case FMOD_ERR_DSP_FORMAT:             return \"DSP Format error.  A DSP unit may have attempted to connect to this network with the wrong format. \";\n        case FMOD_ERR_DSP_NOTFOUND:           return \"DSP connection error.  Couldn't find the DSP unit specified. \";\n        case FMOD_ERR_DSP_RUNNING:            return \"DSP error.  Cannot perform this operation while the network is in the middle of running.  This will most likely happen if a connection or disconnection is attempted in a DSP callback. \";\n        case FMOD_ERR_DSP_TOOMANYCONNECTIONS: return \"DSP connection error.  The unit being connected to or disconnected should only have 1 input or output. \";\n        case FMOD_ERR_EVENT_ALREADY_LOADED:   return \"The specified project has already been loaded. Having multiple copies of the same project loaded simultaneously is forbidden. \";\n        case FMOD_ERR_EVENT_FAILED:           return \"An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. \";\n        case FMOD_ERR_EVENT_GUIDCONFLICT:     return \"An event with the same GUID already exists. \";\n        case FMOD_ERR_EVENT_INFOONLY:         return \"Can't execute this command on an EVENT_INFOONLY event. \";\n        case FMOD_ERR_EVENT_INTERNAL:         return \"An error occured that wasn't supposed to.  See debug log for reason. \";\n        case FMOD_ERR_EVENT_MAXSTREAMS:       return \"Event failed because 'Max streams' was hit when FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS was specified. \";\n        case FMOD_ERR_EVENT_MISMATCH:         return \"FSB mismatches the FEV it was compiled with, the stream/sample mode it was meant to be created with was different, or the FEV was built for a different platform. \";\n        case FMOD_ERR_EVENT_NAMECONFLICT:     return \"A category with the same name already exists. \";\n        case FMOD_ERR_EVENT_NEEDSSIMPLE:      return \"Tried to call a function on a complex event that's only supported by simple events. \";\n        case FMOD_ERR_EVENT_NOTFOUND:         return \"The requested event, event group, event category or event property could not be found. \";\n        case FMOD_ERR_FILE_BAD:               return \"Error loading file. \";\n        case FMOD_ERR_FILE_COULDNOTSEEK:      return \"Couldn't perform seek operation.  This is a limitation of the medium (ie netstreams) or the file format. \";\n        case FMOD_ERR_FILE_DISKEJECTED:       return \"Media was ejected while reading. \";\n        case FMOD_ERR_FILE_EOF:               return \"End of file unexpectedly reached while trying to read essential data (truncated data?). \";\n        case FMOD_ERR_FILE_NOTFOUND:          return \"File not found. \";\n        case FMOD_ERR_FILE_UNWANTED:          return \"Unwanted file access occured. \";\n        case FMOD_ERR_FORMAT:                 return \"Unsupported file or audio format. \";\n        case FMOD_ERR_HTTP:                   return \"A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. \";\n        case FMOD_ERR_HTTP_ACCESS:            return \"The specified resource requires authentication or is forbidden. \";\n        case FMOD_ERR_HTTP_PROXY_AUTH:        return \"Proxy authentication is required to access the specified resource. \";\n        case FMOD_ERR_HTTP_SERVER_ERROR:      return \"A HTTP server error occurred. \";\n        case FMOD_ERR_HTTP_TIMEOUT:           return \"The HTTP request timed out. \";\n        case FMOD_ERR_INITIALIZATION:         return \"FMOD was not initialized correctly to support this function. \";\n        case FMOD_ERR_INITIALIZED:            return \"Cannot call this command after System::init. \";\n        case FMOD_ERR_INTERNAL:               return \"An error occured that wasn't supposed to.  Contact support. \";\n        case FMOD_ERR_INVALID_ADDRESS:        return \"On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) \";\n        case FMOD_ERR_INVALID_FLOAT:          return \"Value passed in was a NaN, Inf or denormalized float. \";\n        case FMOD_ERR_INVALID_HANDLE:         return \"An invalid object handle was used. \";\n        case FMOD_ERR_INVALID_PARAM:          return \"An invalid parameter was passed to this function. \";\n        case FMOD_ERR_INVALID_POSITION:       return \"An invalid seek position was passed to this function. \";\n        case FMOD_ERR_INVALID_SPEAKER:        return \"An invalid speaker was passed to this function based on the current speaker mode. \";\n        case FMOD_ERR_INVALID_SYNCPOINT:      return \"The syncpoint did not come from this sound handle. \";\n        case FMOD_ERR_INVALID_VECTOR:         return \"The vectors passed in are not unit length, or perpendicular. \";\n        case FMOD_ERR_MAXAUDIBLE:             return \"Reached maximum audible playback count for this sound's soundgroup. \";\n        case FMOD_ERR_MEMORY:                 return \"Not enough memory or resources. \";\n        case FMOD_ERR_MEMORY_CANTPOINT:       return \"Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. \";\n        case FMOD_ERR_MEMORY_SRAM:            return \"Not enough memory or resources on console sound ram. \";\n        case FMOD_ERR_MUSIC_NOCALLBACK:       return \"The music callback is required, but it has not been set. \";\n        case FMOD_ERR_MUSIC_NOTFOUND:         return \"The requested music entity could not be found. \";\n        case FMOD_ERR_MUSIC_UNINITIALIZED:    return \"Music system is not initialized probably because no music data is loaded. \";\n        case FMOD_ERR_NEEDS2D:                return \"Tried to call a command on a 3d sound when the command was meant for 2d sound. \";\n        case FMOD_ERR_NEEDS3D:                return \"Tried to call a command on a 2d sound when the command was meant for 3d sound. \";\n        case FMOD_ERR_NEEDSHARDWARE:          return \"Tried to use a feature that requires hardware support.  (ie trying to play a GCADPCM compressed sound in software on Wii). \";\n        case FMOD_ERR_NEEDSSOFTWARE:          return \"Tried to use a feature that requires the software engine.  Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. \";\n        case FMOD_ERR_NET_CONNECT:            return \"Couldn't connect to the specified host. \";\n        case FMOD_ERR_NET_SOCKET_ERROR:       return \"A socket error occurred.  This is a catch-all for socket-related errors not listed elsewhere. \";\n        case FMOD_ERR_NET_URL:                return \"The specified URL couldn't be resolved. \";\n        case FMOD_ERR_NET_WOULD_BLOCK:        return \"Operation on a non-blocking socket could not complete immediately. \";\n        case FMOD_ERR_NOTREADY:               return \"Operation could not be performed because specified sound/DSP connection is not ready. \";\n        case FMOD_ERR_OUTPUT_ALLOCATED:       return \"Error initializing output device, but more specifically, the output device is already in use and cannot be reused. \";\n        case FMOD_ERR_OUTPUT_CREATEBUFFER:    return \"Error creating hardware sound buffer. \";\n        case FMOD_ERR_OUTPUT_DRIVERCALL:      return \"A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. \";\n        case FMOD_ERR_OUTPUT_ENUMERATION:     return \"Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal. \";\n        case FMOD_ERR_OUTPUT_FORMAT:          return \"Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). \";\n        case FMOD_ERR_OUTPUT_INIT:            return \"Error initializing output device. \";\n        case FMOD_ERR_OUTPUT_NOHARDWARE:      return \"FMOD_HARDWARE was specified but the sound card does not have the resources necessary to play it. \";\n        case FMOD_ERR_OUTPUT_NOSOFTWARE:      return \"Attempted to create a software sound but no software channels were specified in System::init. \";\n        case FMOD_ERR_PAN:                    return \"Panning only works with mono or stereo sound sources. \";\n        case FMOD_ERR_PLUGIN:                 return \"An unspecified error has been returned from a 3rd party plugin. \";\n        case FMOD_ERR_PLUGIN_INSTANCES:       return \"The number of allowed instances of a plugin has been exceeded. \";\n        case FMOD_ERR_PLUGIN_MISSING:         return \"A requested output, dsp unit type or codec was not available. \";\n        case FMOD_ERR_PLUGIN_RESOURCE:        return \"A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback) \";\n        case FMOD_ERR_PRELOADED:              return \"The specified sound is still in use by the event system, call EventSystem::unloadFSB before trying to release it. \";\n        case FMOD_ERR_PROGRAMMERSOUND:        return \"The specified sound is still in use by the event system, wait for the event which is using it finish with it. \";\n        case FMOD_ERR_RECORD:                 return \"An error occured trying to initialize the recording device. \";\n        case FMOD_ERR_REVERB_INSTANCE:        return \"Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesnt exist. \";\n        case FMOD_ERR_SUBSOUNDS:              return \"The error occured because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have.  The operation may also not be able to be performed on a parent sound, or a parent sound was played without setting up a sentence first. \";\n        case FMOD_ERR_SUBSOUND_ALLOCATED:     return \"This subsound is already being used by another sound, you cannot have more than one parent to a sound.  Null out the other parent's entry first. \";\n        case FMOD_ERR_SUBSOUND_CANTMOVE:      return \"Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file. \";\n        case FMOD_ERR_SUBSOUND_MODE:          return \"The subsound's mode bits do not match with the parent sound's mode bits.  See documentation for function that it was called with. \";\n        case FMOD_ERR_TAGNOTFOUND:            return \"The specified tag could not be found or there are no tags. \";\n        case FMOD_ERR_TOOMANYCHANNELS:        return \"The sound created exceeds the allowable input channel count.  This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. \";\n        case FMOD_ERR_UNIMPLEMENTED:          return \"Something in FMOD hasn't been implemented when it should be! contact support! \";\n        case FMOD_ERR_UNINITIALIZED:          return \"This command failed because System::init or System::setDriver was not called. \";\n        case FMOD_ERR_UNSUPPORTED:            return \"A command issued was not supported by this object.  Possibly a plugin without certain callbacks specified. \";\n        case FMOD_ERR_UPDATE:                 return \"An error caused by System::update occured. \";\n        case FMOD_ERR_VERSION:                return \"The version number of this file format is not supported. \";\n        case FMOD_OK:                         return \"No errors.\";\n        default :                             return \"Unknown error.\";\n/*$ preserve start $*/\n    };\n}\n\n#endif\n/*$ preserve end $*/\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmod_memoryinfo.h",
    "content": "/* ============================================================================================= */\n/* FMOD Ex - Memory info header file. Copyright (c), Firelight Technologies Pty, Ltd. 2008-2011. */\n/*                                                                                               */\n/* Use this header if you are interested in getting detailed information on FMOD's memory        */\n/* usage. See the documentation for more details.                                                */\n/*                                                                                               */\n/* ============================================================================================= */\n\n#ifndef _FMOD_MEMORYINFO_H\n#define _FMOD_MEMORYINFO_H\n\n/*\n[STRUCTURE]\n[\n    [DESCRIPTION]\n    Structure to be filled with detailed memory usage information of an FMOD object\n\n    [REMARKS]\n    Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question. \n    On return from getMemoryInfo, each member of this structure will hold the amount of memory used for its type in bytes.<br>\n    <br>\n    Members marked with [in] mean the user sets the value before passing it to the function.<br>\n    Members marked with [out] mean FMOD sets the value to be used after the function exits.<br>\n\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::getMemoryInfo\n    EventSystem::getMemoryInfo\n    FMOD_MEMBITS    \n    FMOD_EVENT_MEMBITS\n]\n*/\ntypedef struct FMOD_MEMORY_USAGE_DETAILS\n{\n    unsigned int other;                          /* [out] Memory not accounted for by other types */\n    unsigned int string;                         /* [out] String data */\n    unsigned int system;                         /* [out] System object and various internals */\n    unsigned int plugins;                        /* [out] Plugin objects and internals */\n    unsigned int output;                         /* [out] Output module object and internals */\n    unsigned int channel;                        /* [out] Channel related memory */\n    unsigned int channelgroup;                   /* [out] ChannelGroup objects and internals */\n    unsigned int codec;                          /* [out] Codecs allocated for streaming */\n    unsigned int file;                           /* [out] File buffers and structures */\n    unsigned int sound;                          /* [out] Sound objects and internals */\n    unsigned int secondaryram;                   /* [out] Sound data stored in secondary RAM */\n    unsigned int soundgroup;                     /* [out] SoundGroup objects and internals */\n    unsigned int streambuffer;                   /* [out] Stream buffer memory */\n    unsigned int dspconnection;                  /* [out] DSPConnection objects and internals */\n    unsigned int dsp;                            /* [out] DSP implementation objects */\n    unsigned int dspcodec;                       /* [out] Realtime file format decoding DSP objects */\n    unsigned int profile;                        /* [out] Profiler memory footprint. */\n    unsigned int recordbuffer;                   /* [out] Buffer used to store recorded data from microphone */\n    unsigned int reverb;                         /* [out] Reverb implementation objects */\n    unsigned int reverbchannelprops;             /* [out] Reverb channel properties structs */\n    unsigned int geometry;                       /* [out] Geometry objects and internals */\n    unsigned int syncpoint;                      /* [out] Sync point memory. */\n    unsigned int eventsystem;                    /* [out] EventSystem and various internals */\n    unsigned int musicsystem;                    /* [out] MusicSystem and various internals */\n    unsigned int fev;                            /* [out] Definition of objects contained in all loaded projects e.g. events, groups, categories */\n    unsigned int memoryfsb;                      /* [out] Data loaded with preloadFSB */\n    unsigned int eventproject;                   /* [out] EventProject objects and internals */\n    unsigned int eventgroupi;                    /* [out] EventGroup objects and internals */\n    unsigned int soundbankclass;                 /* [out] Objects used to manage wave banks */\n    unsigned int soundbanklist;                  /* [out] Data used to manage lists of wave bank usage */\n    unsigned int streaminstance;                 /* [out] Stream objects and internals */\n    unsigned int sounddefclass;                  /* [out] Sound definition objects */\n    unsigned int sounddefdefclass;               /* [out] Sound definition static data objects */\n    unsigned int sounddefpool;                   /* [out] Sound definition pool data */\n    unsigned int reverbdef;                      /* [out] Reverb definition objects */\n    unsigned int eventreverb;                    /* [out] Reverb objects */\n    unsigned int userproperty;                   /* [out] User property objects */\n    unsigned int eventinstance;                  /* [out] Event instance base objects */\n    unsigned int eventinstance_complex;          /* [out] Complex event instance objects */\n    unsigned int eventinstance_simple;           /* [out] Simple event instance objects */\n    unsigned int eventinstance_layer;            /* [out] Event layer instance objects */\n    unsigned int eventinstance_sound;            /* [out] Event sound instance objects */\n    unsigned int eventenvelope;                  /* [out] Event envelope objects */\n    unsigned int eventenvelopedef;               /* [out] Event envelope definition objects */\n    unsigned int eventparameter;                 /* [out] Event parameter objects */\n    unsigned int eventcategory;                  /* [out] Event category objects */\n    unsigned int eventenvelopepoint;             /* [out] Event envelope point objects */\n    unsigned int eventinstancepool;              /* [out] Event instance pool memory */\n} FMOD_MEMORY_USAGE_DETAILS;\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_MEMBITS\n\n    [DESCRIPTION]\n    Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Ex class.\n    Use with the \"memorybits\" parameter of getMemoryInfo to get information on FMOD Ex memory usage.\n\n    [REMARKS]\n    Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question. \n    The FMOD_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See System::getMemoryInfo for an example.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_EVENT_MEMBITS\n    System::getMemoryInfo\n]\n*/\n#define FMOD_MEMBITS_OTHER                       0x00000001  /* Memory not accounted for by other types */\n#define FMOD_MEMBITS_STRING                      0x00000002  /* String data */\n\n#define FMOD_MEMBITS_SYSTEM                      0x00000004  /* System object and various internals */\n#define FMOD_MEMBITS_PLUGINS                     0x00000008  /* Plugin objects and internals */\n#define FMOD_MEMBITS_OUTPUT                      0x00000010  /* Output module object and internals */\n#define FMOD_MEMBITS_CHANNEL                     0x00000020  /* Channel related memory */\n#define FMOD_MEMBITS_CHANNELGROUP                0x00000040  /* ChannelGroup objects and internals */\n#define FMOD_MEMBITS_CODEC                       0x00000080  /* Codecs allocated for streaming */\n#define FMOD_MEMBITS_FILE                        0x00000100  /* Codecs allocated for streaming */\n#define FMOD_MEMBITS_SOUND                       0x00000200  /* Sound objects and internals */\n#define FMOD_MEMBITS_SOUND_SECONDARYRAM          0x00000400  /* Sound data stored in secondary RAM */\n#define FMOD_MEMBITS_SOUNDGROUP                  0x00000800  /* SoundGroup objects and internals */\n#define FMOD_MEMBITS_STREAMBUFFER                0x00001000  /* Stream buffer memory */\n#define FMOD_MEMBITS_DSPCONNECTION               0x00002000  /* DSPConnection objects and internals */\n#define FMOD_MEMBITS_DSP                         0x00004000  /* DSP implementation objects */\n#define FMOD_MEMBITS_DSPCODEC                    0x00008000  /* Realtime file format decoding DSP objects */\n#define FMOD_MEMBITS_PROFILE                     0x00010000  /* Profiler memory footprint. */\n#define FMOD_MEMBITS_RECORDBUFFER                0x00020000  /* Buffer used to store recorded data from microphone */\n#define FMOD_MEMBITS_REVERB                      0x00040000  /* Reverb implementation objects */\n#define FMOD_MEMBITS_REVERBCHANNELPROPS          0x00080000  /* Reverb channel properties structs */\n#define FMOD_MEMBITS_GEOMETRY                    0x00100000  /* Geometry objects and internals */\n#define FMOD_MEMBITS_SYNCPOINT                   0x00200000  /* Sync point memory. */\n#define FMOD_MEMBITS_ALL                         0xffffffff  /* All memory used by FMOD Ex */\n/* [DEFINE_END] */\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_EVENT_MEMBITS\n\n    [DESCRIPTION]\n    Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Event System class.\n    Use with the \"event_memorybits\" parameter of getMemoryInfo to get information on FMOD Event System memory usage.\n\n    [REMARKS]\n    Every public FMOD Event System class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question. \n    The FMOD_EVENT_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See EventSystem::getMemoryInfo for an example.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_MEMBITS\n    System::getMemoryInfo\n]\n*/                                               \n#define FMOD_EVENT_MEMBITS_EVENTSYSTEM           0x00000001  /* EventSystem and various internals */\n#define FMOD_EVENT_MEMBITS_MUSICSYSTEM           0x00000002  /* MusicSystem and various internals */\n#define FMOD_EVENT_MEMBITS_FEV                   0x00000004  /* Definition of objects contained in all loaded projects e.g. events, groups, categories */\n#define FMOD_EVENT_MEMBITS_MEMORYFSB             0x00000008  /* Data loaded with preloadFSB */\n#define FMOD_EVENT_MEMBITS_EVENTPROJECT          0x00000010  /* EventProject objects and internals */\n#define FMOD_EVENT_MEMBITS_EVENTGROUPI           0x00000020  /* EventGroup objects and internals */\n#define FMOD_EVENT_MEMBITS_SOUNDBANKCLASS        0x00000040  /* Objects used to manage wave banks */\n#define FMOD_EVENT_MEMBITS_SOUNDBANKLIST         0x00000080  /* Data used to manage lists of wave bank usage */\n#define FMOD_EVENT_MEMBITS_STREAMINSTANCE        0x00000100  /* Stream objects and internals */\n#define FMOD_EVENT_MEMBITS_SOUNDDEFCLASS         0x00000200  /* Sound definition objects */\n#define FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS      0x00000400  /* Sound definition static data objects */\n#define FMOD_EVENT_MEMBITS_SOUNDDEFPOOL          0x00000800  /* Sound definition pool data */\n#define FMOD_EVENT_MEMBITS_REVERBDEF             0x00001000  /* Reverb definition objects */\n#define FMOD_EVENT_MEMBITS_EVENTREVERB           0x00002000  /* Reverb objects */\n#define FMOD_EVENT_MEMBITS_USERPROPERTY          0x00004000  /* User property objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE         0x00008000  /* Event instance base objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX 0x00010000  /* Complex event instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE  0x00020000  /* Simple event instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER   0x00040000  /* Event layer instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND   0x00080000  /* Event sound instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTENVELOPE         0x00100000  /* Event envelope objects */\n#define FMOD_EVENT_MEMBITS_EVENTENVELOPEDEF      0x00200000  /* Event envelope definition objects */\n#define FMOD_EVENT_MEMBITS_EVENTPARAMETER        0x00400000  /* Event parameter objects */\n#define FMOD_EVENT_MEMBITS_EVENTCATEGORY         0x00800000  /* Event category objects */\n#define FMOD_EVENT_MEMBITS_EVENTENVELOPEPOINT    0x01000000  /* Event envelope point object+s */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCEPOOL     0x02000000  /* Event instance pool data */\n#define FMOD_EVENT_MEMBITS_ALL                   0xffffffff  /* All memory used by FMOD Event System */\n\n/* All event instance memory */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_GROUP   (FMOD_EVENT_MEMBITS_EVENTINSTANCE            | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE  | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER   | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND)\n\n/* All sound definition memory */\n#define FMOD_EVENT_MEMBITS_SOUNDDEF_GROUP        (FMOD_EVENT_MEMBITS_SOUNDDEFCLASS            | \\\n                                                     FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS      | \\\n                                                     FMOD_EVENT_MEMBITS_SOUNDDEFPOOL)\n/* [DEFINE_END] */\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmod_output.h",
    "content": "/* ==================================================================================================== */\n/* FMOD Ex - output development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */\n/*                                                                                                      */\n/* Use this header if you are wanting to develop your own output plugin to use with                     */\n/* FMOD's output system.  With this header you can make your own output plugin that FMOD                */\n/* can register and use.  See the documentation and examples on how to make a working plugin.           */\n/*                                                                                                      */\n/* ==================================================================================================== */\n\n#ifndef _FMOD_OUTPUT_H\n#define _FMOD_OUTPUT_H\n\n#include \"fmod.h\"\n\ntypedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;\n\n/*\n    Output callbacks\n*/ \ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int *numdrivers);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERNAMECALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERCAPSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, FMOD_CAPS *caps);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_INITCALLBACK)         (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, int outputchannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSECALLBACK)        (FMOD_OUTPUT_STATE *output_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UPDATECALLBACK)       (FMOD_OUTPUT_STATE *output_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETHANDLECALLBACK)    (FMOD_OUTPUT_STATE *output_state, void **handle);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETPOSITIONCALLBACK)  (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_LOCKCALLBACK)         (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UNLOCKCALLBACK)       (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_READFROMMIXER)        (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    When creating an output, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file of this type.\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_OUTPUT_STATE\n]\n*/\ntypedef struct FMOD_OUTPUT_DESCRIPTION\n{\n    const char                        *name;                  /* [in] Name of the output. */\n    unsigned int                       version;               /* [in] Plugin writer's version number. */\n    int                                polling;               /* [in] If TRUE (non zero), this tells FMOD to start a thread and call getposition / lock / unlock for feeding data.  If 0, the output is probably callback based, so all the plugin needs to do is call readfrommixer to the appropriate pointer. */ \n    FMOD_OUTPUT_GETNUMDRIVERSCALLBACK  getnumdrivers;         /* [in] For sound device enumeration.  This callback is to give System::getNumDrivers somthing to return. */\n    FMOD_OUTPUT_GETDRIVERNAMECALLBACK  getdrivername;         /* [in] For sound device enumeration.  This callback is to give System::getDriverName somthing to return. */\n    FMOD_OUTPUT_GETDRIVERCAPSCALLBACK  getdrivercaps;         /* [in] For sound device enumeration.  This callback is to give System::getDriverCaps somthing to return. */\n    FMOD_OUTPUT_INITCALLBACK           init;                  /* [in] Initialization function for the output device.  This is called from System::init. */\n    FMOD_OUTPUT_CLOSECALLBACK          close;                 /* [in] Cleanup / close down function for the output device.  This is called from System::close. */\n    FMOD_OUTPUT_UPDATECALLBACK         update;                /* [in] Update function that is called once a frame by the user.  This is called from System::update. */\n    FMOD_OUTPUT_GETHANDLECALLBACK      gethandle;             /* [in] This is called from System::getOutputHandle.  This is just to return a pointer to the internal system device object that the system may be using.*/\n    FMOD_OUTPUT_GETPOSITIONCALLBACK    getposition;           /* [in] This is called from the FMOD software mixer thread if 'polling' = true.  This returns a position value in samples so that FMOD knows where and when to fill its buffer. */\n    FMOD_OUTPUT_LOCKCALLBACK           lock;                  /* [in] This is called from the FMOD software mixer thread if 'polling' = true.  This function provides a pointer to data that FMOD can write to when software mixing. */\n    FMOD_OUTPUT_UNLOCKCALLBACK         unlock;                /* [in] This is called from the FMOD software mixer thread if 'polling' = true.  This optional function accepts the data that has been mixed and copies it or does whatever it needs to before sending it to the hardware. */\n} FMOD_OUTPUT_DESCRIPTION;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Output plugin structure that is passed into each callback.\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_OUTPUT_DESCRIPTION\n]\n*/\nstruct FMOD_OUTPUT_STATE\n{\n    void                      *plugindata;      /* [in] Plugin writer created data the output author wants to attach to this object. */\n    FMOD_OUTPUT_READFROMMIXER  readfrommixer;   /* [out] Function to update mixer and write the result to the provided pointer.  Used from callback based output only.  Polling based output uses lock/unlock/getposition. */\n};\n\n#endif\n\n\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/32-bit/fmodlinux.h",
    "content": "/* =========================================================================================== */\n/* FMOD Linux Specific header file. Copyright (c), Firelight Technologies Pty, Ltd. 2005-2011. */\n/* =========================================================================================== */\n\n#ifndef _FMODLINUX_H\n#define _FMODLINUX_H\n\n#include \"fmod.h\"\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Use this structure with System::init to set the information required for linux\n    initialisation.\n\n    Pass this structure in as the \"extradriverdata\" parameter in System::init.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Linux, Linux64\n\n    [SEE_ALSO]\n    System::init\n]\n*/\ntypedef struct FMOD_LINUX_EXTRADRIVERDATA\n{\n    const char  *output_driver_arguments;    /* ALSA Only - Arguments to apply to the selected output driver */\n    const char  *record_driver_arguments;    /* ALSA Only - Arguments to apply to the selected input (record) driver */\n} FMOD_LINUX_EXTRADRIVERDATA;\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmod.h",
    "content": "/*$ preserve start $*/\n\n/* ============================================================================================ */\n/* FMOD Ex - Main C/C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */\n/*                                                                                              */\n/* This header is the base header for all other FMOD headers.  If you are programming in C      */\n/* use this exclusively, or if you are programming C++ use this in conjunction with FMOD.HPP    */\n/*                                                                                              */\n/* ============================================================================================ */\n\n#ifndef _FMOD_H\n#define _FMOD_H\n\n/*\n    FMOD version number.  Check this against FMOD::System::getVersion.\n    0xaaaabbcc -> aaaa = major version number.  bb = minor version number.  cc = development version number.\n*/\n\n#define FMOD_VERSION    0x00043800\n\n/*\n    Compiler specific settings.\n*/\n\n#if defined(__CYGWIN32__)\n    #define F_CDECL __cdecl\n    #define F_STDCALL __stdcall\n    #define F_DECLSPEC __declspec\n    #define F_DLLEXPORT ( dllexport )\n#elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(_XBOX))\n    #define F_CDECL _cdecl\n    #define F_STDCALL _stdcall\n    #define F_DECLSPEC __declspec\n    #define F_DLLEXPORT ( dllexport )\n#elif defined(__MACH__) || defined (__ANDROID__)\n    #define F_CDECL\n    #define F_STDCALL\n    #define F_DECLSPEC\n    #define F_DLLEXPORT __attribute__ ((visibility(\"default\")))\n#else\n    #define F_STDCALL\n    #define F_CDECL\n    #define F_DECLSPEC\n    #define F_DLLEXPORT\n#endif\n\n#ifdef DLL_EXPORTS\n    #if defined(__MACH__) || defined(__ANDROID__) || defined(JUNGLE)\n        #define F_API __attribute__ ((visibility(\"default\")))\n    #else\n        #define F_API __declspec(dllexport) F_STDCALL\n    #endif\n#else\n    #define F_API F_STDCALL\n#endif\n\n#define F_CALLBACK F_STDCALL\n\n/*\n    FMOD types.\n*/\n\ntypedef int                       FMOD_BOOL;\ntypedef struct FMOD_SYSTEM        FMOD_SYSTEM;\ntypedef struct FMOD_SOUND         FMOD_SOUND;\ntypedef struct FMOD_CHANNEL       FMOD_CHANNEL;\ntypedef struct FMOD_CHANNELGROUP  FMOD_CHANNELGROUP;\ntypedef struct FMOD_SOUNDGROUP    FMOD_SOUNDGROUP;\ntypedef struct FMOD_REVERB        FMOD_REVERB;\ntypedef struct FMOD_DSP           FMOD_DSP;\ntypedef struct FMOD_DSPCONNECTION FMOD_DSPCONNECTION;\ntypedef struct FMOD_POLYGON\t\t  FMOD_POLYGON;\ntypedef struct FMOD_GEOMETRY\t  FMOD_GEOMETRY;\ntypedef struct FMOD_SYNCPOINT\t  FMOD_SYNCPOINT;\ntypedef unsigned int              FMOD_MODE;\ntypedef unsigned int              FMOD_TIMEUNIT;\ntypedef unsigned int              FMOD_INITFLAGS;\ntypedef unsigned int              FMOD_CAPS;\ntypedef unsigned int              FMOD_DEBUGLEVEL;\ntypedef unsigned int              FMOD_MEMORY_TYPE;\n\n/*$ fmod result start $*/\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    error codes.  Returned from every function.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n]\n*/\ntypedef enum\n{\n    FMOD_OK,                        /* No errors. */\n    FMOD_ERR_ALREADYLOCKED,         /* Tried to call lock a second time before unlock was called. */\n    FMOD_ERR_BADCOMMAND,            /* Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). */\n    FMOD_ERR_CDDA_DRIVERS,          /* Neither NTSCSI nor ASPI could be initialised. */\n    FMOD_ERR_CDDA_INIT,             /* An error occurred while initialising the CDDA subsystem. */\n    FMOD_ERR_CDDA_INVALID_DEVICE,   /* Couldn't find the specified device. */\n    FMOD_ERR_CDDA_NOAUDIO,          /* No audio tracks on the specified disc. */\n    FMOD_ERR_CDDA_NODEVICES,        /* No CD/DVD devices were found. */ \n    FMOD_ERR_CDDA_NODISC,           /* No disc present in the specified drive. */\n    FMOD_ERR_CDDA_READ,             /* A CDDA read error occurred. */\n    FMOD_ERR_CHANNEL_ALLOC,         /* Error trying to allocate a channel. */\n    FMOD_ERR_CHANNEL_STOLEN,        /* The specified channel has been reused to play another sound. */\n    FMOD_ERR_COM,                   /* A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. */\n    FMOD_ERR_DMA,                   /* DMA Failure.  See debug output for more information. */\n    FMOD_ERR_DSP_CONNECTION,        /* DSP connection error.  Connection possibly caused a cyclic dependancy.  Or tried to connect a tree too many units deep (more than 128). */\n    FMOD_ERR_DSP_FORMAT,            /* DSP Format error.  A DSP unit may have attempted to connect to this network with the wrong format. */\n    FMOD_ERR_DSP_NOTFOUND,          /* DSP connection error.  Couldn't find the DSP unit specified. */\n    FMOD_ERR_DSP_RUNNING,           /* DSP error.  Cannot perform this operation while the network is in the middle of running.  This will most likely happen if a connection or disconnection is attempted in a DSP callback. */\n    FMOD_ERR_DSP_TOOMANYCONNECTIONS,/* DSP connection error.  The unit being connected to or disconnected should only have 1 input or output. */\n    FMOD_ERR_FILE_BAD,              /* Error loading file. */\n    FMOD_ERR_FILE_COULDNOTSEEK,     /* Couldn't perform seek operation.  This is a limitation of the medium (ie netstreams) or the file format. */\n    FMOD_ERR_FILE_DISKEJECTED,      /* Media was ejected while reading. */\n    FMOD_ERR_FILE_EOF,              /* End of file unexpectedly reached while trying to read essential data (truncated data?). */\n    FMOD_ERR_FILE_NOTFOUND,         /* File not found. */\n    FMOD_ERR_FILE_UNWANTED,         /* Unwanted file access occured. */\n    FMOD_ERR_FORMAT,                /* Unsupported file or audio format. */\n    FMOD_ERR_HTTP,                  /* A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. */\n    FMOD_ERR_HTTP_ACCESS,           /* The specified resource requires authentication or is forbidden. */\n    FMOD_ERR_HTTP_PROXY_AUTH,       /* Proxy authentication is required to access the specified resource. */\n    FMOD_ERR_HTTP_SERVER_ERROR,     /* A HTTP server error occurred. */\n    FMOD_ERR_HTTP_TIMEOUT,          /* The HTTP request timed out. */\n    FMOD_ERR_INITIALIZATION,        /* FMOD was not initialized correctly to support this function. */\n    FMOD_ERR_INITIALIZED,           /* Cannot call this command after System::init. */\n    FMOD_ERR_INTERNAL,              /* An error occured that wasn't supposed to.  Contact support. */\n    FMOD_ERR_INVALID_ADDRESS,       /* On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) */\n    FMOD_ERR_INVALID_FLOAT,         /* Value passed in was a NaN, Inf or denormalized float. */\n    FMOD_ERR_INVALID_HANDLE,        /* An invalid object handle was used. */\n    FMOD_ERR_INVALID_PARAM,         /* An invalid parameter was passed to this function. */\n    FMOD_ERR_INVALID_POSITION,      /* An invalid seek position was passed to this function. */\n    FMOD_ERR_INVALID_SPEAKER,       /* An invalid speaker was passed to this function based on the current speaker mode. */\n    FMOD_ERR_INVALID_SYNCPOINT,     /* The syncpoint did not come from this sound handle. */\n    FMOD_ERR_INVALID_VECTOR,        /* The vectors passed in are not unit length, or perpendicular. */\n    FMOD_ERR_MAXAUDIBLE,            /* Reached maximum audible playback count for this sound's soundgroup. */\n    FMOD_ERR_MEMORY,                /* Not enough memory or resources. */\n    FMOD_ERR_MEMORY_CANTPOINT,      /* Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. */\n    FMOD_ERR_MEMORY_SRAM,           /* Not enough memory or resources on console sound ram. */\n    FMOD_ERR_NEEDS2D,               /* Tried to call a command on a 3d sound when the command was meant for 2d sound. */\n    FMOD_ERR_NEEDS3D,               /* Tried to call a command on a 2d sound when the command was meant for 3d sound. */\n    FMOD_ERR_NEEDSHARDWARE,         /* Tried to use a feature that requires hardware support.  (ie trying to play a GCADPCM compressed sound in software on Wii). */\n    FMOD_ERR_NEEDSSOFTWARE,         /* Tried to use a feature that requires the software engine.  Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. */\n    FMOD_ERR_NET_CONNECT,           /* Couldn't connect to the specified host. */\n    FMOD_ERR_NET_SOCKET_ERROR,      /* A socket error occurred.  This is a catch-all for socket-related errors not listed elsewhere. */\n    FMOD_ERR_NET_URL,               /* The specified URL couldn't be resolved. */\n    FMOD_ERR_NET_WOULD_BLOCK,       /* Operation on a non-blocking socket could not complete immediately. */\n    FMOD_ERR_NOTREADY,              /* Operation could not be performed because specified sound/DSP connection is not ready. */\n    FMOD_ERR_OUTPUT_ALLOCATED,      /* Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */\n    FMOD_ERR_OUTPUT_CREATEBUFFER,   /* Error creating hardware sound buffer. */\n    FMOD_ERR_OUTPUT_DRIVERCALL,     /* A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. */\n    FMOD_ERR_OUTPUT_ENUMERATION,    /* Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal. */\n    FMOD_ERR_OUTPUT_FORMAT,         /* Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). */\n    FMOD_ERR_OUTPUT_INIT,           /* Error initializing output device. */\n    FMOD_ERR_OUTPUT_NOHARDWARE,     /* FMOD_HARDWARE was specified but the sound card does not have the resources necessary to play it. */\n    FMOD_ERR_OUTPUT_NOSOFTWARE,     /* Attempted to create a software sound but no software channels were specified in System::init. */\n    FMOD_ERR_PAN,                   /* Panning only works with mono or stereo sound sources. */\n    FMOD_ERR_PLUGIN,                /* An unspecified error has been returned from a 3rd party plugin. */\n    FMOD_ERR_PLUGIN_INSTANCES,      /* The number of allowed instances of a plugin has been exceeded. */\n    FMOD_ERR_PLUGIN_MISSING,        /* A requested output, dsp unit type or codec was not available. */\n    FMOD_ERR_PLUGIN_RESOURCE,       /* A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback) */\n    FMOD_ERR_PRELOADED,             /* The specified sound is still in use by the event system, call EventSystem::unloadFSB before trying to release it. */\n    FMOD_ERR_PROGRAMMERSOUND,       /* The specified sound is still in use by the event system, wait for the event which is using it finish with it. */\n    FMOD_ERR_RECORD,                /* An error occured trying to initialize the recording device. */\n    FMOD_ERR_REVERB_INSTANCE,       /* Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesnt exist. */\n    FMOD_ERR_SUBSOUND_ALLOCATED,    /* This subsound is already being used by another sound, you cannot have more than one parent to a sound.  Null out the other parent's entry first. */\n    FMOD_ERR_SUBSOUND_CANTMOVE,     /* Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file. */\n    FMOD_ERR_SUBSOUND_MODE,         /* The subsound's mode bits do not match with the parent sound's mode bits.  See documentation for function that it was called with. */\n    FMOD_ERR_SUBSOUNDS,             /* The error occured because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have.  The operation may also not be able to be performed on a parent sound, or a parent sound was played without setting up a sentence first. */\n    FMOD_ERR_TAGNOTFOUND,           /* The specified tag could not be found or there are no tags. */\n    FMOD_ERR_TOOMANYCHANNELS,       /* The sound created exceeds the allowable input channel count.  This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. */\n    FMOD_ERR_UNIMPLEMENTED,         /* Something in FMOD hasn't been implemented when it should be! contact support! */\n    FMOD_ERR_UNINITIALIZED,         /* This command failed because System::init or System::setDriver was not called. */\n    FMOD_ERR_UNSUPPORTED,           /* A command issued was not supported by this object.  Possibly a plugin without certain callbacks specified. */\n    FMOD_ERR_UPDATE,                /* An error caused by System::update occured. */\n    FMOD_ERR_VERSION,               /* The version number of this file format is not supported. */\n\n    FMOD_ERR_EVENT_FAILED,          /* An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. */\n    FMOD_ERR_EVENT_INFOONLY,        /* Can't execute this command on an EVENT_INFOONLY event. */\n    FMOD_ERR_EVENT_INTERNAL,        /* An error occured that wasn't supposed to.  See debug log for reason. */\n    FMOD_ERR_EVENT_MAXSTREAMS,      /* Event failed because 'Max streams' was hit when FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS was specified. */\n    FMOD_ERR_EVENT_MISMATCH,        /* FSB mismatches the FEV it was compiled with, the stream/sample mode it was meant to be created with was different, or the FEV was built for a different platform. */\n    FMOD_ERR_EVENT_NAMECONFLICT,    /* A category with the same name already exists. */\n    FMOD_ERR_EVENT_NOTFOUND,        /* The requested event, event group, event category or event property could not be found. */\n    FMOD_ERR_EVENT_NEEDSSIMPLE,     /* Tried to call a function on a complex event that's only supported by simple events. */\n    FMOD_ERR_EVENT_GUIDCONFLICT,    /* An event with the same GUID already exists. */\n    FMOD_ERR_EVENT_ALREADY_LOADED,  /* The specified project has already been loaded. Having multiple copies of the same project loaded simultaneously is forbidden. */\n\n    FMOD_ERR_MUSIC_UNINITIALIZED,   /* Music system is not initialized probably because no music data is loaded. */\n    FMOD_ERR_MUSIC_NOTFOUND,        /* The requested music entity could not be found. */\n    FMOD_ERR_MUSIC_NOCALLBACK,      /* The music callback is required, but it has not been set. */\n\n    FMOD_RESULT_FORCEINT = 65536    /* Makes sure this enum is signed 32bit. */\n} FMOD_RESULT;\n/*$ fmod result end $*/\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a point in 3D space.\n\n    [REMARKS]\n    FMOD uses a left handed co-ordinate system by default.<br>\n    To use a right handed co-ordinate system specify FMOD_INIT_3D_RIGHTHANDED from FMOD_INITFLAGS in System::init.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::set3DListenerAttributes\n    System::get3DListenerAttributes\n    Channel::set3DAttributes\n    Channel::get3DAttributes\n    Channel::set3DCustomRolloff\n    Channel::get3DCustomRolloff\n    Sound::set3DCustomRolloff\n    Sound::get3DCustomRolloff\n    Geometry::addPolygon\n    Geometry::setPolygonVertex\n    Geometry::getPolygonVertex\n    Geometry::setRotation\n    Geometry::getRotation\n    Geometry::setPosition\n    Geometry::getPosition\n    Geometry::setScale\n    Geometry::getScale\n    FMOD_INITFLAGS\n]\n*/\ntypedef struct\n{\n\tfloat x;        /* X co-ordinate in 3D space. */\n    float y;        /* Y co-ordinate in 3D space. */\n    float z;        /* Z co-ordinate in 3D space. */\n} FMOD_VECTOR;\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a globally unique identifier.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::getDriverInfo\n]\n*/\ntypedef struct\n{\n    unsigned int   Data1;       /* Specifies the first 8 hexadecimal digits of the GUID */\n    unsigned short Data2;       /* Specifies the first group of 4 hexadecimal digits.   */\n    unsigned short Data3;       /* Specifies the second group of 4 hexadecimal digits.  */\n    unsigned char  Data4[8];    /* Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits. */\n} FMOD_GUID;\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure that is passed into FMOD_FILE_ASYNCREADCALLBACK.  Use the information in this structure to perform\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    <br>\n    Instructions: write to 'buffer', and 'bytesread' <b>BEFORE</b> setting 'result'.<br>  \n    As soon as result is set, FMOD will asynchronously continue internally using the data provided in this structure.<br>\n    <br>\n    Set 'result' to the result expected from a normal file read callback.<br>\n    If the read was successful, set it to FMOD_OK.<br>\n    If it read some data but hit the end of the file, set it to FMOD_ERR_FILE_EOF.<br>\n    If a bad error occurred, return FMOD_ERR_FILE_BAD<br>\n    If a disk was ejected, return FMOD_ERR_FILE_DISKEJECTED.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_FILE_ASYNCREADCALLBACK\n    FMOD_FILE_ASYNCCANCELCALLBACK\n]\n*/\ntypedef struct\n{\n    void           *handle;         /* [r] The file handle that was filled out in the open callback. */\n    unsigned int    offset;         /* [r] Seek position, make sure you read from this file offset. */\n    unsigned int    sizebytes;      /* [r] how many bytes requested for read. */\n    int             priority;       /* [r] 0 = low importance.  100 = extremely important (ie 'must read now or stuttering may occur') */\n\n    void           *buffer;         /* [w] Buffer to read file data into. */\n    unsigned int    bytesread;      /* [w] Fill this in before setting result code to tell FMOD how many bytes were read. */\n    FMOD_RESULT     result;         /* [r/w] Result code, FMOD_OK tells the system it is ready to consume the data.  Set this last!  Default value = FMOD_ERR_NOTREADY. */\n\n    void           *userdata;       /* [r] User data pointer. */\n} FMOD_ASYNCREADINFO;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These output types are used with System::setOutput / System::getOutput, to choose which output method to use.\n  \n    [REMARKS]\n    To pass information to the driver when initializing fmod use the extradriverdata parameter in System::init for the following reasons.<br>\n    <li>FMOD_OUTPUTTYPE_WAVWRITER - extradriverdata is a pointer to a char * filename that the wav writer will output to.\n    <li>FMOD_OUTPUTTYPE_WAVWRITER_NRT - extradriverdata is a pointer to a char * filename that the wav writer will output to.\n    <li>FMOD_OUTPUTTYPE_DSOUND - extradriverdata is a pointer to a HWND so that FMOD can set the focus on the audio for a particular window.\n    <li>FMOD_OUTPUTTYPE_PS3 - extradriverdata is a pointer to a FMOD_PS3_EXTRADRIVERDATA struct. This can be found in fmodps3.h.\n    <li>FMOD_OUTPUTTYPE_GC - extradriverdata is a pointer to a FMOD_GC_INFO struct. This can be found in fmodgc.h.\n    <li>FMOD_OUTPUTTYPE_WII - extradriverdata is a pointer to a FMOD_WII_INFO struct. This can be found in fmodwii.h.\n    <li>FMOD_OUTPUTTYPE_ALSA - extradriverdata is a pointer to a FMOD_LINUX_EXTRADRIVERDATA struct. This can be found in fmodlinux.h.<br>\n    <br>\n    Currently these are the only FMOD drivers that take extra information.  Other unknown plugins may have different requirements.\n    <br><br>\n    Note! If FMOD_OUTPUTTYPE_WAVWRITER_NRT or FMOD_OUTPUTTYPE_NOSOUND_NRT are used, and if the System::update function is being called\n    very quickly (ie for a non realtime decode) it may be being called too quickly for the FMOD streamer thread to respond to.  \n    The result will be a skipping/stuttering output in the captured audio.<br>\n    <br>\n    To remedy this, disable the FMOD Ex streamer thread, and use FMOD_INIT_STREAM_FROM_UPDATE to avoid skipping in the output stream,\n    as it will lock the mixer and the streamer together in the same thread.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::setOutput\n    System::getOutput\n    System::setSoftwareFormat\n    System::getSoftwareFormat\n    System::init\n    System::update\n    FMOD_INITFLAGS\n]\n*/\ntypedef enum\n{\n    FMOD_OUTPUTTYPE_AUTODETECT,      /* Picks the best output mode for the platform.  This is the default. */\n                                     \n    FMOD_OUTPUTTYPE_UNKNOWN,         /* All             - 3rd party plugin, unknown.  This is for use with System::getOutput only. */\n    FMOD_OUTPUTTYPE_NOSOUND,         /* All             - All calls in this mode succeed but make no sound. */\n    FMOD_OUTPUTTYPE_WAVWRITER,       /* All             - Writes output to fmodoutput.wav by default.  Use the 'extradriverdata' parameter in System::init, by simply passing the filename as a string, to set the wav filename. */\n    FMOD_OUTPUTTYPE_NOSOUND_NRT,     /* All             - Non-realtime version of FMOD_OUTPUTTYPE_NOSOUND.  User can drive mixer with System::update at whatever rate they want. */\n    FMOD_OUTPUTTYPE_WAVWRITER_NRT,   /* All             - Non-realtime version of FMOD_OUTPUTTYPE_WAVWRITER.  User can drive mixer with System::update at whatever rate they want. */\n                                     \n    FMOD_OUTPUTTYPE_DSOUND,          /* Win32/Win64     - DirectSound output.                       (Default on Windows XP and below) */\n    FMOD_OUTPUTTYPE_WINMM,           /* Win32/Win64     - Windows Multimedia output. */\n    FMOD_OUTPUTTYPE_WASAPI,          /* Win32           - Windows Audio Session API.                (Default on Windows Vista and above) */\n    FMOD_OUTPUTTYPE_ASIO,            /* Win32           - Low latency ASIO 2.0 driver. */\n    FMOD_OUTPUTTYPE_OSS,             /* Linux/Linux64   - Open Sound System output.                 (Default on Linux, third preference) */\n    FMOD_OUTPUTTYPE_ALSA,            /* Linux/Linux64   - Advanced Linux Sound Architecture output. (Default on Linux, second preference if available) */\n    FMOD_OUTPUTTYPE_ESD,             /* Linux/Linux64   - Enlightment Sound Daemon output. */\n    FMOD_OUTPUTTYPE_PULSEAUDIO,      /* Linux/Linux64   - PulseAudio output.                        (Default on Linux, first preference if available) */\n    FMOD_OUTPUTTYPE_COREAUDIO,       /* Mac             - Macintosh CoreAudio output.               (Default on Mac) */\n    FMOD_OUTPUTTYPE_XBOX360,         /* Xbox 360        - Native Xbox360 output.                    (Default on Xbox 360) */\n    FMOD_OUTPUTTYPE_PSP,             /* PSP             - Native PSP output.                        (Default on PSP) */\n    FMOD_OUTPUTTYPE_PS3,             /* PS3             - Native PS3 output.                        (Default on PS3) */\n    FMOD_OUTPUTTYPE_NGP,             /* NGP             - Native NGP output.                        (Default on NGP) */\n\tFMOD_OUTPUTTYPE_WII,\t\t\t /* Wii\t\t\t    - Native Wii output.                        (Default on Wii) */\n    FMOD_OUTPUTTYPE_3DS,             /* 3DS             - Native 3DS output                         (Default on 3DS) */\n    FMOD_OUTPUTTYPE_AUDIOTRACK,      /* Android         - Java Audio Track output.                  (Default on Android 2.2 and below) */\n    FMOD_OUTPUTTYPE_OPENSL,          /* Android         - OpenSL ES output.                         (Default on Android 2.3 and above) */   \n    FMOD_OUTPUTTYPE_NACL,            /* Native Client   - Native Client output.                     (Default on Native Client) */   \n\n    FMOD_OUTPUTTYPE_MAX,             /* Maximum number of output types supported. */\n    FMOD_OUTPUTTYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_OUTPUTTYPE;\n\n\n/*\n[DEFINE] \n[\n    [NAME]\n    FMOD_CAPS\n\n    [DESCRIPTION]   \n    Bit fields to use with System::getDriverCaps to determine the capabilities of a card / output device.\n\n    [REMARKS]\n    It is important to check FMOD_CAPS_HARDWARE_EMULATED on windows machines, to then adjust System::setDSPBufferSize to (1024, 10) to compensate for the higher latency.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::getDriverCaps\n    System::setDSPBufferSize\n]\n*/\n#define FMOD_CAPS_NONE                   0x00000000  /* Device has no special capabilities. */\n#define FMOD_CAPS_HARDWARE               0x00000001  /* Device supports hardware mixing. */\n#define FMOD_CAPS_HARDWARE_EMULATED      0x00000002  /* User has device set to 'Hardware acceleration = off' in control panel, and now extra 200ms latency is incurred. */\n#define FMOD_CAPS_OUTPUT_MULTICHANNEL    0x00000004  /* Device can do multichannel output, ie greater than 2 channels. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM8     0x00000008  /* Device can output to 8bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM16    0x00000010  /* Device can output to 16bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM24    0x00000020  /* Device can output to 24bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCM32    0x00000040  /* Device can output to 32bit integer PCM. */\n#define FMOD_CAPS_OUTPUT_FORMAT_PCMFLOAT 0x00000080  /* Device can output to 32bit floating point PCM. */\n#define FMOD_CAPS_REVERB_LIMITED         0x00002000  /* Device supports some form of limited hardware reverb, maybe parameterless and only selectable by environment. */\n/* [DEFINE_END] */\n\n/*\n[DEFINE] \n[\n    [NAME]\n    FMOD_DEBUGLEVEL\n\n    [DESCRIPTION]   \n    Bit fields to use with FMOD::Debug_SetLevel / FMOD::Debug_GetLevel to control the level of tty debug output with logging versions of FMOD (fmodL).\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    Debug_SetLevel \n    Debug_GetLevel\n]\n*/\n#define FMOD_DEBUG_LEVEL_NONE           0x00000000\n#define FMOD_DEBUG_LEVEL_LOG            0x00000001      /* Will display generic logging messages. */\n#define FMOD_DEBUG_LEVEL_ERROR          0x00000002      /* Will display errors. */\n#define FMOD_DEBUG_LEVEL_WARNING        0x00000004      /* Will display warnings that are not fatal. */\n#define FMOD_DEBUG_LEVEL_HINT           0x00000008      /* Will hint to you if there is something possibly better you could be doing. */\n#define FMOD_DEBUG_LEVEL_ALL            0x000000FF    \n#define FMOD_DEBUG_TYPE_MEMORY          0x00000100      /* Show FMOD memory related logging messages. */\n#define FMOD_DEBUG_TYPE_THREAD          0x00000200      /* Show FMOD thread related logging messages. */\n#define FMOD_DEBUG_TYPE_FILE            0x00000400      /* Show FMOD file system related logging messages. */\n#define FMOD_DEBUG_TYPE_NET             0x00000800      /* Show FMOD network related logging messages. */\n#define FMOD_DEBUG_TYPE_EVENT           0x00001000      /* Show FMOD Event related logging messages. */\n#define FMOD_DEBUG_TYPE_ALL             0x0000FFFF                      \n#define FMOD_DEBUG_DISPLAY_TIMESTAMPS   0x01000000      /* Display the timestamp of the log entry in milliseconds. */\n#define FMOD_DEBUG_DISPLAY_LINENUMBERS  0x02000000      /* Display the FMOD Ex source code line numbers, for debugging purposes. */\n#define FMOD_DEBUG_DISPLAY_COMPRESS     0x04000000      /* If a message is repeated more than 5 times it will stop displaying it and instead display the number of times the message was logged. */\n#define FMOD_DEBUG_DISPLAY_THREAD       0x08000000      /* Display the thread ID of the calling function that caused this log entry to appear. */\n#define FMOD_DEBUG_DISPLAY_ALL          0x0F000000\n#define FMOD_DEBUG_ALL                  0xFFFFFFFF\n/* [DEFINE_END] */\n\n\n/*\n[DEFINE] \n[\n    [NAME]\n    FMOD_MEMORY_TYPE\n\n    [DESCRIPTION]   \n    Bit fields for memory allocation type being passed into FMOD memory callbacks.\n\n    [REMARKS]\n    Remember this is a bitfield.  You may get more than 1 bit set (ie physical + persistent) so do not simply switch on the types!  You must check each bit individually or clear out the bits that you do not want within the callback.<br>\n    Bits can be excluded if you want during Memory_Initialize so that you never get them.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_MEMORY_ALLOCCALLBACK\n    FMOD_MEMORY_REALLOCCALLBACK\n    FMOD_MEMORY_FREECALLBACK\n    Memory_Initialize\n    \n]\n*/\n#define FMOD_MEMORY_NORMAL             0x00000000       /* Standard memory. */\n#define FMOD_MEMORY_STREAM_FILE        0x00000001       /* Stream file buffer, size controllable with System::setStreamBufferSize. */\n#define FMOD_MEMORY_STREAM_DECODE      0x00000002       /* Stream decode buffer, size controllable with FMOD_CREATESOUNDEXINFO::decodebuffersize. */\n#define FMOD_MEMORY_SAMPLEDATA         0x00000004       /* Sample data buffer.  Raw audio data, usually PCM/MPEG/ADPCM/XMA data. */\n#define FMOD_MEMORY_DSP_OUTPUTBUFFER   0x00000008       /* DSP memory block allocated when more than 1 output exists on a DSP node. */\n#define FMOD_MEMORY_XBOX360_PHYSICAL   0x00100000       /* Requires XPhysicalAlloc / XPhysicalFree. */\n#define FMOD_MEMORY_PERSISTENT         0x00200000       /* Persistent memory. Memory will be freed when System::release is called. */\n#define FMOD_MEMORY_SECONDARY          0x00400000       /* Secondary memory. Allocation should be in secondary memory. For example RSX on the PS3. */\n#define FMOD_MEMORY_ALL                0xFFFFFFFF\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These are speaker types defined for use with the System::setSpeakerMode or System::getSpeakerMode command.\n\n    [REMARKS]\n    These are important notes on speaker modes in regards to sounds created with FMOD_SOFTWARE.<br>\n    Note below the phrase 'sound channels' is used.  These are the subchannels inside a sound, they are not related and \n    have nothing to do with the FMOD class \"Channel\".<br>\n    For example a mono sound has 1 sound channel, a stereo sound has 2 sound channels, and an AC3 or 6 channel wav file have 6 \"sound channels\".<br>\n    <br>\n    FMOD_SPEAKERMODE_RAW<br>\n    ---------------------<br>\n    This mode is for output devices that are not specifically mono/stereo/quad/surround/5.1 or 7.1, but are multichannel.<br>\n    Use System::setSoftwareFormat to specify the number of speakers you want to address, otherwise it will default to 2 (stereo).<br>\n    Sound channels map to speakers sequentially, so a mono sound maps to output speaker 0, stereo sound maps to output speaker 0 & 1.<br>\n    The user assumes knowledge of the speaker order.  FMOD_SPEAKER enumerations may not apply, so raw channel indices should be used.<br>\n    Multichannel sounds map input channels to output channels 1:1. <br>\n    Channel::setPan and Channel::setSpeakerMix do not work.<br>\n    Speaker levels must be manually set with Channel::setSpeakerLevels.<br>\n    <br>\n    FMOD_SPEAKERMODE_MONO<br>\n    ---------------------<br>\n    This mode is for a 1 speaker arrangement.<br>\n    Panning does not work in this speaker mode.<br>\n    Mono, stereo and multichannel sounds have each sound channel played on the one speaker unity.<br>\n    Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    Channel::setSpeakerMix does not work.<br>\n    <br>\n    FMOD_SPEAKERMODE_STEREO<br>\n    -----------------------<br>\n    This mode is for 2 speaker arrangements that have a left and right speaker.<br>\n    <li>Mono sounds default to an even distribution between left and right.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the middle, or full left in the left speaker and full right in the right speaker.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds have each sound channel played on each speaker at unity.<br>\n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but only front left and right parameters are used, the rest are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_QUAD<br>\n    ------------------------<br>\n    This mode is for 4 speaker arrangements that have a front left, front right, rear left and a rear right speaker.<br>\n    <li>Mono sounds default to an even distribution between front left and front right.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.<br>\n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.<br>\n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but side left, side right, center and lfe are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_SURROUND<br>\n    ------------------------<br>\n    This mode is for 5 speaker arrangements that have a left/right/center/rear left/rear right.<br>\n    <li>Mono sounds default to the center speaker.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.  \n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but side left / side right are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_5POINT1<br>\n    ------------------------<br>\n    This mode is for 5.1 speaker arrangements that have a left/right/center/rear left/rear right and a subwoofer speaker.<br>\n    <li>Mono sounds default to the center speaker.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.  \n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works but side left / side right are ignored.<br>\n    <br>\n    FMOD_SPEAKERMODE_7POINT1<br>\n    ------------------------<br>\n    This mode is for 7.1 speaker arrangements that have a left/right/center/rear left/rear right/side left/side right \n    and a subwoofer speaker.<br>\n    <li>Mono sounds default to the center speaker.  They can be panned with Channel::setPan.<br>\n    <li>Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.  \n    <li>They can be cross faded with Channel::setPan.<br>\n    <li>Multichannel sounds default to all of their sound channels being played on each speaker in order of input.  \n    <li>Mix behavior for multichannel sounds can be set with Channel::setSpeakerLevels.<br>\n    <li>Channel::setSpeakerMix works and every parameter is used to set the balance of a sound in any speaker.<br>\n    <br>\n    FMOD_SPEAKERMODE_PROLOGIC<br>\n    ------------------------------------------------------<br>\n    This mode is for mono, stereo, 5.1 and 7.1 speaker arrangements, as it is backwards and forwards compatible with stereo, \n    but to get a surround effect a Dolby Prologic or Prologic 2 hardware decoder / amplifier is needed.<br>\n    Pan behavior is the same as FMOD_SPEAKERMODE_5POINT1.<br>\n    <br>\n    If this function is called the numoutputchannels setting in System::setSoftwareFormat is overwritten.<br>\n    <br>\n    Output rate must be 44100, 48000 or 96000 for this to work otherwise FMOD_ERR_OUTPUT_INIT will be returned.<br>\n\n    FMOD_SPEAKERMODE_MYEARS<br>\n    ------------------------------------------------------<br>\n    This mode is for headphones.  This will attempt to load a MyEars profile (see myears.net.au) and use it to generate\n    surround sound on headphones using a personalized HRTF algorithm, for realistic 3d sound.<br>\n    Pan behavior is the same as FMOD_SPEAKERMODE_7POINT1.<br>\n    MyEars speaker mode will automatically be set if the speakermode is FMOD_SPEAKERMODE_STEREO and the MyEars profile exists.<br>\n    If this mode is set explicitly, FMOD_INIT_DISABLE_MYEARS_AUTODETECT has no effect.<br>\n    If this mode is set explicitly and the MyEars profile does not exist, FMOD_ERR_OUTPUT_DRIVERCALL will be returned.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setSpeakerMode\n    System::getSpeakerMode\n    System::getDriverCaps\n    System::setSoftwareFormat\n    Channel::setSpeakerLevels\n]\n*/\ntypedef enum\n{\n    FMOD_SPEAKERMODE_RAW,              /* There is no specific speakermode.  Sound channels are mapped in order of input to output.  Use System::setSoftwareFormat to specify speaker count. See remarks for more information. */\n    FMOD_SPEAKERMODE_MONO,             /* The speakers are monaural. */\n    FMOD_SPEAKERMODE_STEREO,           /* The speakers are stereo (DEFAULT). */\n    FMOD_SPEAKERMODE_QUAD,             /* 4 speaker setup.  This includes front left, front right, rear left, rear right.  */\n    FMOD_SPEAKERMODE_SURROUND,         /* 5 speaker setup.  This includes front left, front right, center, rear left, rear right. */\n    FMOD_SPEAKERMODE_5POINT1,          /* 5.1 speaker setup.  This includes front left, front right, center, rear left, rear right and a subwoofer. */\n    FMOD_SPEAKERMODE_7POINT1,          /* 7.1 speaker setup.  This includes front left, front right, center, rear left, rear right, side left, side right and a subwoofer. */\n    \n    FMOD_SPEAKERMODE_PROLOGIC,         /* Stereo output, but data is encoded to be played on a Prologic 2 / CircleSurround decoder in 5.1 via an analog connection.  See remarks about limitations. */\n    FMOD_SPEAKERMODE_MYEARS,           /* Stereo output, but data is encoded using personalized HRTF algorithms.  See myears.net.au */\n\n    FMOD_SPEAKERMODE_MAX,              /* Maximum number of speaker modes supported. */\n    FMOD_SPEAKERMODE_FORCEINT = 65536  /* Makes sure this enum is signed 32bit. */\n} FMOD_SPEAKERMODE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These are speaker types defined for use with the Channel::setSpeakerLevels command.\n    It can also be used for speaker placement in the System::set3DSpeakerPosition command.\n\n    [REMARKS]\n    If you are using FMOD_SPEAKERMODE_RAW and speaker assignments are meaningless, just cast a raw integer value to this type.<br>\n    For example (FMOD_SPEAKER)7 would use the 7th speaker (also the same as FMOD_SPEAKER_SIDE_RIGHT).<br>\n    Values higher than this can be used if an output system has more than 8 speaker types / output channels.  15 is the current maximum.<br>\n    <br>\n    NOTE: On Playstation 3 in 7.1, the extra 2 speakers are not side left/side right, they are 'surround back left'/'surround back right' which\n    locate the speakers behind the listener instead of to the sides like on PC.  FMOD_SPEAKER_SBL/FMOD_SPEAKER_SBR are provided to make it \n    clearer what speaker is being addressed on that platform.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_SPEAKERMODE\n    Channel::setSpeakerLevels\n    Channel::getSpeakerLevels\n    System::set3DSpeakerPosition\n    System::get3DSpeakerPosition\n]\n*/\ntypedef enum\n{\n    FMOD_SPEAKER_FRONT_LEFT,\n    FMOD_SPEAKER_FRONT_RIGHT,\n    FMOD_SPEAKER_FRONT_CENTER,\n    FMOD_SPEAKER_LOW_FREQUENCY,\n    FMOD_SPEAKER_BACK_LEFT,\n    FMOD_SPEAKER_BACK_RIGHT,\n    FMOD_SPEAKER_SIDE_LEFT,\n    FMOD_SPEAKER_SIDE_RIGHT,\n    \n    FMOD_SPEAKER_MAX,                                       /* Maximum number of speaker types supported. */\n    FMOD_SPEAKER_MONO        = FMOD_SPEAKER_FRONT_LEFT,     /* For use with FMOD_SPEAKERMODE_MONO and Channel::SetSpeakerLevels.  Mapped to same value as FMOD_SPEAKER_FRONT_LEFT. */\n    FMOD_SPEAKER_NULL        = 65535,                       /* A non speaker.  Use this with ASIO mapping to ignore a speaker. */\n    FMOD_SPEAKER_SBL         = FMOD_SPEAKER_SIDE_LEFT,      /* For use with FMOD_SPEAKERMODE_7POINT1 on PS3 where the extra speakers are surround back inside of side speakers. */\n    FMOD_SPEAKER_SBR         = FMOD_SPEAKER_SIDE_RIGHT,     /* For use with FMOD_SPEAKERMODE_7POINT1 on PS3 where the extra speakers are surround back inside of side speakers. */\n    FMOD_SPEAKER_FORCEINT    = 65536                        /* Makes sure this enum is signed 32bit. */\n} FMOD_SPEAKER;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These are plugin types defined for use with the System::getNumPlugins, \n    System::getPluginInfo and System::unloadPlugin functions.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::getNumPlugins\n    System::getPluginInfo\n    System::unloadPlugin\n]\n*/\ntypedef enum\n{\n    FMOD_PLUGINTYPE_OUTPUT,          /* The plugin type is an output module.  FMOD mixed audio will play through one of these devices */\n    FMOD_PLUGINTYPE_CODEC,           /* The plugin type is a file format codec.  FMOD will use these codecs to load file formats for playback. */\n    FMOD_PLUGINTYPE_DSP,             /* The plugin type is a DSP unit.  FMOD will use these plugins as part of its DSP network to apply effects to output or generate sound in realtime. */\n\n    FMOD_PLUGINTYPE_MAX,             /* Maximum number of plugin types supported. */\n    FMOD_PLUGINTYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_PLUGINTYPE;\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_INITFLAGS\n\n    [DESCRIPTION]   \n    Initialization flags.  Use them with System::init in the flags parameter to change various behavior.  \n\n    [REMARKS]\n    Use System::setAdvancedSettings to adjust settings for some of the features that are enabled by these flags.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::init\n    System::update \n    System::setAdvancedSettings\n    Channel::set3DOcclusion\n]\n*/\n#define FMOD_INIT_NORMAL                     0x00000000 /* All platforms - Initialize normally */\n#define FMOD_INIT_STREAM_FROM_UPDATE         0x00000001 /* All platforms - No stream thread is created internally.  Streams are driven from System::update.  Mainly used with non-realtime outputs. */\n#define FMOD_INIT_3D_RIGHTHANDED             0x00000002 /* All platforms - FMOD will treat +X as right, +Y as up and +Z as backwards (towards you). */\n#define FMOD_INIT_SOFTWARE_DISABLE           0x00000004 /* All platforms - Disable software mixer to save memory.  Anything created with FMOD_SOFTWARE will fail and DSP will not work. */\n#define FMOD_INIT_OCCLUSION_LOWPASS          0x00000008 /* All platforms - All FMOD_SOFTWARE (and FMOD_HARDWARE on 3DS and NGP) with FMOD_3D based voices will add a software lowpass filter effect into the DSP chain which is automatically used when Channel::set3DOcclusion is used or the geometry API. */\n#define FMOD_INIT_HRTF_LOWPASS               0x00000010 /* All platforms - All FMOD_SOFTWARE (and FMOD_HARDWARE on 3DS and NGP) with FMOD_3D based voices will add a software lowpass filter effect into the DSP chain which causes sounds to sound duller when the sound goes behind the listener.  Use System::setAdvancedSettings to adjust cutoff frequency. */\n#define FMOD_INIT_DISTANCE_FILTERING         0x00000200 /* All platforms - All FMOD_SOFTWARE with FMOD_3D based voices will add a software lowpass and highpass filter effect into the DSP chain which will act as a distance-automated bandpass filter. Use System::setAdvancedSettings to adjust the center frequency. */\n#define FMOD_INIT_SOFTWARE_REVERB_LOWMEM     0x00000040 /* All platforms - SFX reverb is run using 22/24khz delay buffers, halving the memory required. */\n#define FMOD_INIT_ENABLE_PROFILE             0x00000020 /* All platforms - Enable TCP/IP based host which allows FMOD Designer or FMOD Profiler to connect to it, and view memory, CPU and the DSP network graph in real-time. */\n#define FMOD_INIT_VOL0_BECOMES_VIRTUAL       0x00000080 /* All platforms - Any sounds that are 0 volume will go virtual and not be processed except for having their positions updated virtually.  Use System::setAdvancedSettings to adjust what volume besides zero to switch to virtual at. */\n#define FMOD_INIT_WASAPI_EXCLUSIVE           0x00000100 /* Win32 Vista only - for WASAPI output - Enable exclusive access to hardware, lower latency at the expense of excluding other applications from accessing the audio hardware. */\n#define FMOD_INIT_PS3_PREFERDTS              0x00800000 /* PS3 only - Prefer DTS over Dolby Digital if both are supported. Note: 8 and 6 channel LPCM is always preferred over both DTS and Dolby Digital. */\n#define FMOD_INIT_PS3_FORCE2CHLPCM           0x01000000 /* PS3 only - Force PS3 system output mode to 2 channel LPCM. */\n#define FMOD_INIT_DISABLEDOLBY               0x00100000 /* Wii / 3DS - Disable Dolby Pro Logic surround. Speakermode will be set to STEREO even if user has selected surround in the system settings. */\n#define FMOD_INIT_SYSTEM_MUSICMUTENOTPAUSE   0x00200000 /* Xbox 360 / PS3 - The \"music\" channelgroup which by default pauses when custom 360 dashboard / PS3 BGM music is played, can be changed to mute (therefore continues playing) instead of pausing, by using this flag. */\n#define FMOD_INIT_SYNCMIXERWITHUPDATE        0x00400000 /* Win32/Wii/PS3/Xbox/Xbox 360 - FMOD Mixer thread is woken up to do a mix when System::update is called rather than waking periodically on its own timer. */\n#define FMOD_INIT_GEOMETRY_USECLOSEST        0x04000000 /* All platforms - With the geometry engine, only process the closest polygon rather than accumulating all polygons the sound to listener line intersects. */\n#define FMOD_INIT_DISABLE_MYEARS_AUTODETECT  0x08000000 /* Win32 - Disables automatic setting of FMOD_SPEAKERMODE_STEREO to FMOD_SPEAKERMODE_MYEARS if the MyEars profile exists on the PC.  MyEars is HRTF 7.1 downmixing through headphones. */\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These definitions describe the type of song being played.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getFormat\n]\n*/\ntypedef enum\n{\n    FMOD_SOUND_TYPE_UNKNOWN,         /* 3rd party / unknown plugin format. */\n    FMOD_SOUND_TYPE_AIFF,            /* AIFF. */\n    FMOD_SOUND_TYPE_ASF,             /* Microsoft Advanced Systems Format (ie WMA/ASF/WMV). */\n    FMOD_SOUND_TYPE_AT3,             /* Sony ATRAC 3 format */\n    FMOD_SOUND_TYPE_CDDA,            /* Digital CD audio. */\n    FMOD_SOUND_TYPE_DLS,             /* Sound font / downloadable sound bank. */\n    FMOD_SOUND_TYPE_FLAC,            /* FLAC lossless codec. */\n    FMOD_SOUND_TYPE_FSB,             /* FMOD Sample Bank. */\n    FMOD_SOUND_TYPE_GCADPCM,         /* Nintendo GameCube/Wii ADPCM */\n    FMOD_SOUND_TYPE_IT,              /* Impulse Tracker. */\n    FMOD_SOUND_TYPE_MIDI,            /* MIDI. extracodecdata is a pointer to an FMOD_MIDI_EXTRACODECDATA structure. */\n    FMOD_SOUND_TYPE_MOD,             /* Protracker / Fasttracker MOD. */\n    FMOD_SOUND_TYPE_MPEG,            /* MP2/MP3 MPEG. */\n    FMOD_SOUND_TYPE_OGGVORBIS,       /* Ogg vorbis. */\n    FMOD_SOUND_TYPE_PLAYLIST,        /* Information only from ASX/PLS/M3U/WAX playlists */\n    FMOD_SOUND_TYPE_RAW,             /* Raw PCM data. */\n    FMOD_SOUND_TYPE_S3M,             /* ScreamTracker 3. */\n    FMOD_SOUND_TYPE_SF2,             /* Sound font 2 format. */\n    FMOD_SOUND_TYPE_USER,            /* User created sound. */\n    FMOD_SOUND_TYPE_WAV,             /* Microsoft WAV. */\n    FMOD_SOUND_TYPE_XM,              /* FastTracker 2 XM. */\n    FMOD_SOUND_TYPE_XMA,             /* Xbox360 XMA */\n    FMOD_SOUND_TYPE_VAG,             /* PlayStation Portable ADPCM VAG format. */\n    FMOD_SOUND_TYPE_AUDIOQUEUE,      /* iPhone hardware decoder, supports AAC, ALAC and MP3. extracodecdata is a pointer to an FMOD_AUDIOQUEUE_EXTRACODECDATA structure. */\n    FMOD_SOUND_TYPE_XWMA,            /* Xbox360 XWMA */\n    FMOD_SOUND_TYPE_BCWAV,           /* 3DS BCWAV container format for DSP ADPCM and PCM */\n    FMOD_SOUND_TYPE_AT9,             /* NGP ATRAC 9 format */\n\n    FMOD_SOUND_TYPE_MAX,             /* Maximum number of sound types supported. */\n    FMOD_SOUND_TYPE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_SOUND_TYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These definitions describe the native format of the hardware or software buffer that will be used.\n\n    [REMARKS]\n    This is the format the native hardware or software buffer will be or is created in.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createSound\n    Sound::getFormat\n]\n*/\ntypedef enum\n{\n    FMOD_SOUND_FORMAT_NONE,             /* Unitialized / unknown. */\n    FMOD_SOUND_FORMAT_PCM8,             /* 8bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCM16,            /* 16bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCM24,            /* 24bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCM32,            /* 32bit integer PCM data. */\n    FMOD_SOUND_FORMAT_PCMFLOAT,         /* 32bit floating point PCM data. */\n    FMOD_SOUND_FORMAT_GCADPCM,          /* Compressed Nintendo 3DS/Wii DSP data. */\n    FMOD_SOUND_FORMAT_IMAADPCM,         /* Compressed IMA ADPCM data. */\n    FMOD_SOUND_FORMAT_VAG,              /* Compressed PlayStation Portable ADPCM data. */\n    FMOD_SOUND_FORMAT_HEVAG,            /* Compressed PSVita ADPCM data. */\n    FMOD_SOUND_FORMAT_XMA,              /* Compressed Xbox360 XMA data. */\n    FMOD_SOUND_FORMAT_MPEG,             /* Compressed MPEG layer 2 or 3 data. */\n    FMOD_SOUND_FORMAT_CELT,             /* Compressed CELT data. */\n    FMOD_SOUND_FORMAT_AT9,              /* Compressed PSVita ATRAC9 data. */\n    FMOD_SOUND_FORMAT_XWMA,             /* Compressed Xbox360 xWMA data. */\n\n    FMOD_SOUND_FORMAT_MAX,              /* Maximum number of sound formats supported. */   \n    FMOD_SOUND_FORMAT_FORCEINT = 65536  /* Makes sure this enum is signed 32bit. */\n} FMOD_SOUND_FORMAT;\n\n\n/*\n[DEFINE]\n[\n    [NAME] \n    FMOD_MODE\n\n    [DESCRIPTION]   \n    Sound description bitfields, bitwise OR them together for loading and describing sounds.\n\n    [REMARKS]\n    By default a sound will open as a static sound that is decompressed fully into memory to PCM. (ie equivalent of FMOD_CREATESAMPLE)<br>\n    To have a sound stream instead, use FMOD_CREATESTREAM, or use the wrapper function System::createStream.<br>\n    Some opening modes (ie FMOD_OPENUSER, FMOD_OPENMEMORY, FMOD_OPENMEMORY_POINT, FMOD_OPENRAW) will need extra information.<br>\n    This can be provided using the FMOD_CREATESOUNDEXINFO structure.\n    <br>\n    Specifying FMOD_OPENMEMORY_POINT will POINT to your memory rather allocating its own sound buffers and duplicating it internally.<br>\n    <b><u>This means you cannot free the memory while FMOD is using it, until after Sound::release is called.</b></u>\n    With FMOD_OPENMEMORY_POINT, for PCM formats, only WAV, FSB, and RAW are supported.  For compressed formats, only those formats supported by FMOD_CREATECOMPRESSEDSAMPLE are supported.<br>\n    With FMOD_OPENMEMORY_POINT and FMOD_OPENRAW or PCM, if using them together, note that you must pad the data on each side by 16 bytes.  This is so fmod can modify the ends of the data for looping/interpolation/mixing purposes.  If a wav file, you will need to insert silence, and then reset loop points to stop the playback from playing that silence.<br>\n    With FMOD_OPENMEMORY_POINT, For Wii/PSP FMOD_HARDWARE supports this flag for the GCADPCM/VAG formats.  On other platforms FMOD_SOFTWARE must be used.<br>\n    <br>\n    <b>Xbox 360 memory</b> On Xbox 360 Specifying FMOD_OPENMEMORY_POINT to a virtual memory address will cause FMOD_ERR_INVALID_ADDRESS\n    to be returned.  Use physical memory only for this functionality.<br>\n    <br>\n    FMOD_LOWMEM is used on a sound if you want to minimize the memory overhead, by having FMOD not allocate memory for certain \n    features that are not likely to be used in a game environment.  These are :<br>\n    1. Sound::getName functionality is removed.  256 bytes per sound is saved.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createSound\n    System::createStream\n    Sound::setMode\n    Sound::getMode\n    Channel::setMode\n    Channel::getMode\n    Sound::set3DCustomRolloff\n    Channel::set3DCustomRolloff\n    Sound::getOpenState\n]\n*/\n#define FMOD_DEFAULT                   0x00000000  /* FMOD_DEFAULT is a default sound type.  Equivalent to all the defaults listed below.  FMOD_LOOP_OFF, FMOD_2D, FMOD_HARDWARE.  (Note - only Windows with a high spec soundcard, PSP, and Wii support FMOD_HARDWARE) */\n#define FMOD_LOOP_OFF                  0x00000001  /* For non looping sounds. (DEFAULT).  Overrides FMOD_LOOP_NORMAL / FMOD_LOOP_BIDI. */\n#define FMOD_LOOP_NORMAL               0x00000002  /* For forward looping sounds. */\n#define FMOD_LOOP_BIDI                 0x00000004  /* For bidirectional looping sounds. (only works on software mixed static sounds). */\n#define FMOD_2D                        0x00000008  /* Ignores any 3d processing. (DEFAULT). */\n#define FMOD_3D                        0x00000010  /* Makes the sound positionable in 3D.  Overrides FMOD_2D. */\n#define FMOD_HARDWARE                  0x00000020  /* Attempts to make sounds use hardware acceleration. (DEFAULT).  Note on platforms that don't support FMOD_HARDWARE (only Windows with a high spec soundcard, PSP, and Wii support FMOD_HARDWARE), this will be internally treated as FMOD_SOFTWARE. */\n#define FMOD_SOFTWARE                  0x00000040  /* Makes the sound be mixed by the FMOD CPU based software mixer.  Overrides FMOD_HARDWARE.  Use this for FFT, DSP, compressed sample support, 2D multi-speaker support and other software related features. */\n#define FMOD_CREATESTREAM              0x00000080  /* Decompress at runtime, streaming from the source provided (ie from disk).  Overrides FMOD_CREATESAMPLE and FMOD_CREATECOMPRESSEDSAMPLE.  Note a stream can only be played once at a time due to a stream only having 1 stream buffer and file handle.  Open multiple streams to have them play concurrently. */\n#define FMOD_CREATESAMPLE              0x00000100  /* Decompress at loadtime, decompressing or decoding whole file into memory as the target sample format (ie PCM).  Fastest for FMOD_SOFTWARE based playback and most flexible.  */\n#define FMOD_CREATECOMPRESSEDSAMPLE    0x00000200  /* Load MP2, MP3, IMAADPCM or XMA into memory and leave it compressed.  During playback the FMOD software mixer will decode it in realtime as a 'compressed sample'.  Can only be used in combination with FMOD_SOFTWARE.  Overrides FMOD_CREATESAMPLE.  If the sound data is not ADPCM, MPEG or XMA it will behave as if it was created with FMOD_CREATESAMPLE and decode the sound into PCM. */\n#define FMOD_OPENUSER                  0x00000400  /* Opens a user created static sample or stream. Use FMOD_CREATESOUNDEXINFO to specify format and/or read callbacks.  If a user created 'sample' is created with no read callback, the sample will be empty.  Use Sound::lock and Sound::unlock to place sound data into the sound if this is the case. */\n#define FMOD_OPENMEMORY                0x00000800  /* \"name_or_data\" will be interpreted as a pointer to memory instead of filename for creating sounds.  Use FMOD_CREATESOUNDEXINFO to specify length.  If used with FMOD_CREATESAMPLE or FMOD_CREATECOMPRESSEDSAMPLE, FMOD duplicates the memory into its own buffers.  Your own buffer can be freed after open.  If used with FMOD_CREATESTREAM, FMOD will stream out of the buffer whose pointer you passed in.  In this case, your own buffer should not be freed until you have finished with and released the stream.*/\n#define FMOD_OPENMEMORY_POINT          0x10000000  /* \"name_or_data\" will be interpreted as a pointer to memory instead of filename for creating sounds.  Use FMOD_CREATESOUNDEXINFO to specify length.  This differs to FMOD_OPENMEMORY in that it uses the memory as is, without duplicating the memory into its own buffers.  For Wii/PSP FMOD_HARDWARE supports this flag for the GCADPCM/VAG formats.  On other platforms FMOD_SOFTWARE must be used, as sound hardware on the other platforms (ie PC) cannot access main ram.  Cannot be freed after open, only after Sound::release.   Will not work if the data is compressed and FMOD_CREATECOMPRESSEDSAMPLE is not used. */\n#define FMOD_OPENRAW                   0x00001000  /* Will ignore file format and treat as raw pcm.  Use FMOD_CREATESOUNDEXINFO to specify format.  Requires at least defaultfrequency, numchannels and format to be specified before it will open.  Must be little endian data. */\n#define FMOD_OPENONLY                  0x00002000  /* Just open the file, dont prebuffer or read.  Good for fast opens for info, or when sound::readData is to be used. */\n#define FMOD_ACCURATETIME              0x00004000  /* For System::createSound - for accurate Sound::getLength/Channel::setPosition on VBR MP3, and MOD/S3M/XM/IT/MIDI files.  Scans file first, so takes longer to open. FMOD_OPENONLY does not affect this. */\n#define FMOD_MPEGSEARCH                0x00008000  /* For corrupted / bad MP3 files.  This will search all the way through the file until it hits a valid MPEG header.  Normally only searches for 4k. */\n#define FMOD_NONBLOCKING               0x00010000  /* For opening sounds and getting streamed subsounds (seeking) asyncronously.  Use Sound::getOpenState to poll the state of the sound as it opens or retrieves the subsound in the background. */\n#define FMOD_UNIQUE                    0x00020000  /* Unique sound, can only be played one at a time */\n#define FMOD_3D_HEADRELATIVE           0x00040000  /* Make the sound's position, velocity and orientation relative to the listener. */\n#define FMOD_3D_WORLDRELATIVE          0x00080000  /* Make the sound's position, velocity and orientation absolute (relative to the world). (DEFAULT) */\n#define FMOD_3D_INVERSEROLLOFF         0x00100000  /* This sound will follow the inverse rolloff model where mindistance = full volume, maxdistance = where sound stops attenuating, and rolloff is fixed according to the global rolloff factor.  (DEFAULT) */\n#define FMOD_3D_LINEARROLLOFF          0x00200000  /* This sound will follow a linear rolloff model where mindistance = full volume, maxdistance = silence.  Rolloffscale is ignored. */\n#define FMOD_3D_LINEARSQUAREROLLOFF    0x00400000  /* This sound will follow a linear-square rolloff model where mindistance = full volume, maxdistance = silence.  Rolloffscale is ignored. */\n#define FMOD_3D_CUSTOMROLLOFF          0x04000000  /* This sound will follow a rolloff model defined by Sound::set3DCustomRolloff / Channel::set3DCustomRolloff.  */\n#define FMOD_3D_IGNOREGEOMETRY         0x40000000  /* Is not affect by geometry occlusion.  If not specified in Sound::setMode, or Channel::setMode, the flag is cleared and it is affected by geometry again. */\n#define FMOD_UNICODE                   0x01000000  /* Filename is double-byte unicode. */\n#define FMOD_IGNORETAGS                0x02000000  /* Skips id3v2/asf/etc tag checks when opening a sound, to reduce seek/read overhead when opening files (helps with CD performance). */\n#define FMOD_LOWMEM                    0x08000000  /* Removes some features from samples to give a lower memory overhead, like Sound::getName.  See remarks. */\n#define FMOD_LOADSECONDARYRAM          0x20000000  /* Load sound into the secondary RAM of supported platform. On PS3, sounds will be loaded into RSX/VRAM. */\n#define FMOD_VIRTUAL_PLAYFROMSTART     0x80000000  /* For sounds that start virtual (due to being quiet or low importance), instead of swapping back to audible, and playing at the correct offset according to time, this flag makes the sound play from the start. */\n\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These values describe what state a sound is in after FMOD_NONBLOCKING has been used to open it.\n\n    [REMARKS]\n    With streams, if you are using FMOD_NONBLOCKING, note that if the user calls Sound::getSubSound, a stream will go into FMOD_OPENSTATE_SEEKING state and sound related commands will return FMOD_ERR_NOTREADY.<br>\n    With streams, if you are using FMOD_NONBLOCKING, note that if the user calls Channel::getPosition, a stream will go into FMOD_OPENSTATE_SETPOSITION state and sound related commands will return FMOD_ERR_NOTREADY.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    Sound::getOpenState\n    FMOD_MODE\n]\n*/\ntypedef enum\n{\n    FMOD_OPENSTATE_READY = 0,       /* Opened and ready to play. */\n    FMOD_OPENSTATE_LOADING,         /* Initial load in progress. */\n    FMOD_OPENSTATE_ERROR,           /* Failed to open - file not found, out of memory etc.  See return value of Sound::getOpenState for what happened. */\n    FMOD_OPENSTATE_CONNECTING,      /* Connecting to remote host (internet sounds only). */\n    FMOD_OPENSTATE_BUFFERING,       /* Buffering data. */\n    FMOD_OPENSTATE_SEEKING,         /* Seeking to subsound and re-flushing stream buffer. */\n    FMOD_OPENSTATE_PLAYING,         /* Ready and playing, but not possible to release at this time without stalling the main thread. */\n    FMOD_OPENSTATE_SETPOSITION,     /* Seeking within a stream to a different position. */\n\n    FMOD_OPENSTATE_MAX,             /* Maximum number of open state types. */\n    FMOD_OPENSTATE_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_OPENSTATE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These flags are used with SoundGroup::setMaxAudibleBehavior to determine what happens when more sounds \n    are played than are specified with SoundGroup::setMaxAudible.\n\n    [REMARKS]\n    When using FMOD_SOUNDGROUP_BEHAVIOR_MUTE, SoundGroup::setMuteFadeSpeed can be used to stop a sudden transition.  \n    Instead, the time specified will be used to cross fade between the sounds that go silent and the ones that become audible.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    SoundGroup::setMaxAudibleBehavior\n    SoundGroup::getMaxAudibleBehavior\n    SoundGroup::setMaxAudible\n    SoundGroup::getMaxAudible\n    SoundGroup::setMuteFadeSpeed\n    SoundGroup::getMuteFadeSpeed\n]\n*/\ntypedef enum \n{\n    FMOD_SOUNDGROUP_BEHAVIOR_FAIL,              /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will simply fail during System::playSound. */\n    FMOD_SOUNDGROUP_BEHAVIOR_MUTE,              /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will be silent, then if another sound in the group stops the sound that was silent before becomes audible again. */\n    FMOD_SOUNDGROUP_BEHAVIOR_STEALLOWEST,       /* Any sound played that puts the sound count over the SoundGroup::setMaxAudible setting, will steal the quietest / least important sound playing in the group. */\n\n    FMOD_SOUNDGROUP_BEHAVIOR_MAX,               /* Maximum number of open state types. */\n    FMOD_SOUNDGROUP_BEHAVIOR_FORCEINT = 65536   /* Makes sure this enum is signed 32bit. */\n} FMOD_SOUNDGROUP_BEHAVIOR;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These callback types are used with Channel::setCallback.\n\n    [REMARKS]\n    Each callback has commanddata parameters passed as int unique to the type of callback.<br>\n    See reference to FMOD_CHANNEL_CALLBACK to determine what they might mean for each type of callback.<br>\n    <br>\n    <b>Note!</b>  Currently the user must call System::update for these callbacks to trigger!\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Channel::setCallback\n    FMOD_CHANNEL_CALLBACK\n    System::update\n]\n*/\ntypedef enum\n{\n    FMOD_CHANNEL_CALLBACKTYPE_END,                  /* Called when a sound ends. */\n    FMOD_CHANNEL_CALLBACKTYPE_VIRTUALVOICE,         /* Called when a voice is swapped out or swapped in. */\n    FMOD_CHANNEL_CALLBACKTYPE_SYNCPOINT,            /* Called when a syncpoint is encountered.  Can be from wav file markers. */\n    FMOD_CHANNEL_CALLBACKTYPE_OCCLUSION,            /* Called when the channel has its geometry occlusion value calculated.  Can be used to clamp or change the value. */\n\n    FMOD_CHANNEL_CALLBACKTYPE_MAX,                  /* Maximum number of callback types supported. */\n    FMOD_CHANNEL_CALLBACKTYPE_FORCEINT = 65536      /* Makes sure this enum is signed 32bit. */\n} FMOD_CHANNEL_CALLBACKTYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These callback types are used with System::setCallback.\n\n    [REMARKS]\n    Each callback has commanddata parameters passed as void* unique to the type of callback.<br>\n    See reference to FMOD_SYSTEM_CALLBACK to determine what they might mean for each type of callback.<br>\n    <br>\n    <b>Note!</b> Using FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED (on Mac only) requires the application to be running an event loop which will allow external changes to device list to be detected by FMOD.\n    <br>\n    <b>Note!</b> The 'system' object pointer will be null for FMOD_SYSTEM_CALLBACKTYPE_THREADCREATED and FMOD_SYSTEM_CALLBACKTYPE_MEMORYALLOCATIONFAILED callbacks.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::setCallback\n    FMOD_SYSTEM_CALLBACK\n    System::update\n    DSP::addInput\n]\n*/\ntypedef enum\n{\n    FMOD_SYSTEM_CALLBACKTYPE_DEVICELISTCHANGED,         /* Called from System::update when the enumerated list of devices has changed. */\n    FMOD_SYSTEM_CALLBACKTYPE_DEVICELOST,                /* Called from System::update when an output device has been lost due to control panel parameter changes and FMOD cannot automatically recover. */\n    FMOD_SYSTEM_CALLBACKTYPE_MEMORYALLOCATIONFAILED,    /* Called directly when a memory allocation fails somewhere in FMOD.  (NOTE - 'system' will be NULL in this callback type.)*/\n    FMOD_SYSTEM_CALLBACKTYPE_THREADCREATED,             /* Called directly when a thread is created. (NOTE - 'system' will be NULL in this callback type.) */\n    FMOD_SYSTEM_CALLBACKTYPE_BADDSPCONNECTION,          /* Called when a bad connection was made with DSP::addInput. Usually called from mixer thread because that is where the connections are made.  */\n    FMOD_SYSTEM_CALLBACKTYPE_BADDSPLEVEL,               /* Called when too many effects were added exceeding the maximum tree depth of 128.  This is most likely caused by accidentally adding too many DSP effects. Usually called from mixer thread because that is where the connections are made.  */\n\n    FMOD_SYSTEM_CALLBACKTYPE_MAX,                       /* Maximum number of callback types supported. */\n    FMOD_SYSTEM_CALLBACKTYPE_FORCEINT = 65536           /* Makes sure this enum is signed 32bit. */\n} FMOD_SYSTEM_CALLBACKTYPE;\n\n\n/* \n    FMOD Callbacks\n*/\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SYSTEM_CALLBACK)       (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACKTYPE type, void *commanddata1, void *commanddata2);\n\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CHANNEL_CALLBACK)      (FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, void *commanddata1, void *commanddata2);\n\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_NONBLOCKCALLBACK)(FMOD_SOUND *sound, FMOD_RESULT result);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_PCMREADCALLBACK)(FMOD_SOUND *sound, void *data, unsigned int datalen);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_SOUND_PCMSETPOSCALLBACK)(FMOD_SOUND *sound, int subsound, unsigned int position, FMOD_TIMEUNIT postype);\n\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_OPENCALLBACK)     (const char *name, int unicode, unsigned int *filesize, void **handle, void **userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_CLOSECALLBACK)    (void *handle, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_READCALLBACK)     (void *handle, void *buffer, unsigned int sizebytes, unsigned int *bytesread, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_SEEKCALLBACK)     (void *handle, unsigned int pos, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_ASYNCREADCALLBACK)(FMOD_ASYNCREADINFO *info, void *userdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_FILE_ASYNCCANCELCALLBACK)(void *handle, void *userdata);\n\ntypedef void *      (F_CALLBACK *FMOD_MEMORY_ALLOCCALLBACK)  (unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);\ntypedef void *      (F_CALLBACK *FMOD_MEMORY_REALLOCCALLBACK)(void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr);\ntypedef void        (F_CALLBACK *FMOD_MEMORY_FREECALLBACK)   (void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr);\n\ntypedef float       (F_CALLBACK *FMOD_3D_ROLLOFFCALLBACK)    (FMOD_CHANNEL *channel, float distance);\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of windowing methods used in spectrum analysis to reduce leakage / transient signals intefering with the analysis.<br>\n    This is a problem with analysis of continuous signals that only have a small portion of the signal sample (the fft window size).<br>\n    Windowing the signal with a curve or triangle tapers the sides of the fft window to help alleviate this problem.\n\n    [REMARKS]\n    Cyclic signals such as a sine wave that repeat their cycle in a multiple of the window size do not need windowing.<br>\n    I.e. If the sine wave repeats every 1024, 512, 256 etc samples and the FMOD fft window is 1024, then the signal would not need windowing.<br>\n    Not windowing is the same as FMOD_DSP_FFT_WINDOW_RECT, which is the default.<br>\n    If the cycle of the signal (ie the sine wave) is not a multiple of the window size, it will cause frequency abnormalities, so a different windowing method is needed.<br>\n    <exclude>\n    <br>\n    FMOD_DSP_FFT_WINDOW_RECT.<br>\n    <img src=\"..\\static\\rectangle.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_TRIANGLE.<br>\n    <img src=\"..\\static\\triangle.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_HAMMING.<br>\n    <img src=\"..\\static\\hamming.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_HANNING.<br>\n    <img src=\"..\\static\\hanning.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_BLACKMAN.<br>\n    <img src=\"..\\static\\blackman.gif\"></img><br>\n    <br>\n    FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS.<br>\n    <img src=\"..\\static\\blackmanharris.gif\"></img>\n    </exclude>\n    \n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::getSpectrum\n    Channel::getSpectrum\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_FFT_WINDOW_RECT,            /* w[n] = 1.0                                                                                            */\n    FMOD_DSP_FFT_WINDOW_TRIANGLE,        /* w[n] = TRI(2n/N)                                                                                      */\n    FMOD_DSP_FFT_WINDOW_HAMMING,         /* w[n] = 0.54 - (0.46 * COS(n/N) )                                                                      */\n    FMOD_DSP_FFT_WINDOW_HANNING,         /* w[n] = 0.5 *  (1.0  - COS(n/N) )                                                                      */\n    FMOD_DSP_FFT_WINDOW_BLACKMAN,        /* w[n] = 0.42 - (0.5  * COS(n/N) ) + (0.08 * COS(2.0 * n/N) )                                           */\n    FMOD_DSP_FFT_WINDOW_BLACKMANHARRIS,  /* w[n] = 0.35875 - (0.48829 * COS(1.0 * n/N)) + (0.14128 * COS(2.0 * n/N)) - (0.01168 * COS(3.0 * n/N)) */\n    \n    FMOD_DSP_FFT_WINDOW_MAX,             /* Maximum number of FFT window types supported. */\n    FMOD_DSP_FFT_WINDOW_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_DSP_FFT_WINDOW;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of interpolation types that the FMOD Ex software mixer supports.  \n\n    [REMARKS]\n    The default resampler type is FMOD_DSP_RESAMPLER_LINEAR.<br>\n    Use System::setSoftwareFormat to tell FMOD the resampling quality you require for FMOD_SOFTWARE based sounds.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    System::setSoftwareFormat\n    System::getSoftwareFormat\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_RESAMPLER_NOINTERP,        /* No interpolation.  High frequency aliasing hiss will be audible depending on the sample rate of the sound. */\n    FMOD_DSP_RESAMPLER_LINEAR,          /* Linear interpolation (default method).  Fast and good quality, causes very slight lowpass effect on low frequency sounds. */\n    FMOD_DSP_RESAMPLER_CUBIC,           /* Cubic interpolation.  Slower than linear interpolation but better quality. */\n    FMOD_DSP_RESAMPLER_SPLINE,          /* 5 point spline interpolation.  Slowest resampling method but best quality. */\n\n    FMOD_DSP_RESAMPLER_MAX,             /* Maximum number of resample methods supported. */\n    FMOD_DSP_RESAMPLER_FORCEINT = 65536 /* Makes sure this enum is signed 32bit. */\n} FMOD_DSP_RESAMPLER;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of tag types that could be stored within a sound.  These include id3 tags, metadata from netstreams and vorbis/asf data.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n]\n*/\ntypedef enum\n{\n    FMOD_TAGTYPE_UNKNOWN = 0,\n    FMOD_TAGTYPE_ID3V1,\n    FMOD_TAGTYPE_ID3V2,\n    FMOD_TAGTYPE_VORBISCOMMENT,\n    FMOD_TAGTYPE_SHOUTCAST,\n    FMOD_TAGTYPE_ICECAST,\n    FMOD_TAGTYPE_ASF,\n    FMOD_TAGTYPE_MIDI,\n    FMOD_TAGTYPE_PLAYLIST,\n    FMOD_TAGTYPE_FMOD,\n    FMOD_TAGTYPE_USER,\n\n    FMOD_TAGTYPE_MAX,               /* Maximum number of tag types supported. */\n    FMOD_TAGTYPE_FORCEINT = 65536   /* Makes sure this enum is signed 32bit. */\n} FMOD_TAGTYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    List of data types that can be returned by Sound::getTag\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n]\n*/\ntypedef enum\n{\n    FMOD_TAGDATATYPE_BINARY = 0,\n    FMOD_TAGDATATYPE_INT,\n    FMOD_TAGDATATYPE_FLOAT,\n    FMOD_TAGDATATYPE_STRING,\n    FMOD_TAGDATATYPE_STRING_UTF16,\n    FMOD_TAGDATATYPE_STRING_UTF16BE,\n    FMOD_TAGDATATYPE_STRING_UTF8,\n    FMOD_TAGDATATYPE_CDTOC,\n\n    FMOD_TAGDATATYPE_MAX,               /* Maximum number of tag datatypes supported. */\n    FMOD_TAGDATATYPE_FORCEINT = 65536   /* Makes sure this enum is signed 32bit. */\n} FMOD_TAGDATATYPE;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    Types of delay that can be used with Channel::setDelay / Channel::getDelay.\n\n    [REMARKS]\n    If you haven't called Channel::setDelay yet, if you call Channel::getDelay with FMOD_DELAYTYPE_DSPCLOCK_START it will return the \n    equivalent global DSP clock value to determine when a channel started, so that you can use it for other channels to sync against.<br>\n    <br>\n    Use System::getDSPClock to also get the current dspclock time, a base for future calls to Channel::setDelay.<br>\n    <br>\n    Use FMOD_64BIT_ADD or FMOD_64BIT_SUB to add a hi/lo combination together and cope with wraparound.\n    <br>\n    If FMOD_DELAYTYPE_END_MS is specified, the value is not treated as a 64 bit number, just the delayhi value is used and it is treated as milliseconds.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Channel::setDelay\n    Channel::getDelay\n    System::getDSPClock\n]\n*/\ntypedef enum\n{\n    FMOD_DELAYTYPE_END_MS,              /* Delay at the end of the sound in milliseconds.  Use delayhi only.   Channel::isPlaying will remain true until this delay has passed even though the sound itself has stopped playing.*/\n    FMOD_DELAYTYPE_DSPCLOCK_START,      /* Time the sound started if Channel::getDelay is used, or if Channel::setDelay is used, the sound will delay playing until this exact tick. */\n    FMOD_DELAYTYPE_DSPCLOCK_END,        /* Time the sound should end. If this is non-zero, the channel will go silent at this exact tick. */\n    FMOD_DELAYTYPE_DSPCLOCK_PAUSE,      /* Time the sound should pause. If this is non-zero, the channel will pause at this exact tick. */\n\n    FMOD_DELAYTYPE_MAX,                 /* Maximum number of tag datatypes supported. */\n    FMOD_DELAYTYPE_FORCEINT = 65536     /* Makes sure this enum is signed 32bit. */\n} FMOD_DELAYTYPE;\n\n\n#define FMOD_64BIT_ADD(_hi1, _lo1, _hi2, _lo2) _hi1 += ((_hi2) + ((((_lo1) + (_lo2)) < (_lo1)) ? 1 : 0)); (_lo1) += (_lo2);\n#define FMOD_64BIT_SUB(_hi1, _lo1, _hi2, _lo2) _hi1 -= ((_hi2) + ((((_lo1) - (_lo2)) > (_lo1)) ? 1 : 0)); (_lo1) -= (_lo2);\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a piece of tag data.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n    FMOD_TAGTYPE\n    FMOD_TAGDATATYPE\n]\n*/\ntypedef struct FMOD_TAG\n{\n    FMOD_TAGTYPE      type;         /* [r] The type of this tag. */\n    FMOD_TAGDATATYPE  datatype;     /* [r] The type of data that this tag contains */\n    char             *name;         /* [r] The name of this tag i.e. \"TITLE\", \"ARTIST\" etc. */\n    void             *data;         /* [r] Pointer to the tag data - its format is determined by the datatype member */\n    unsigned int      datalen;      /* [r] Length of the data contained in this tag */\n    FMOD_BOOL         updated;      /* [r] True if this tag has been updated since last being accessed with Sound::getTag */\n} FMOD_TAG;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]   \n    Structure describing a CD/DVD table of contents\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getTag\n]\n*/\ntypedef struct FMOD_CDTOC\n{\n    int numtracks;                  /* [r] The number of tracks on the CD */\n    int min[100];                   /* [r] The start offset of each track in minutes */\n    int sec[100];                   /* [r] The start offset of each track in seconds */\n    int frame[100];                 /* [r] The start offset of each track in frames */\n} FMOD_CDTOC;\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_TIMEUNIT\n\n    [DESCRIPTION]   \n    List of time types that can be returned by Sound::getLength and used with Channel::setPosition or Channel::getPosition.\n\n    [REMARKS]\n    FMOD_TIMEUNIT_SENTENCE_MS, FMOD_TIMEUNIT_SENTENCE_PCM, FMOD_TIMEUNIT_SENTENCE_PCMBYTES, FMOD_TIMEUNIT_SENTENCE and FMOD_TIMEUNIT_SENTENCE_SUBSOUND are only supported by Channel functions.\n    Do not combine flags except FMOD_TIMEUNIT_BUFFERED.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    Sound::getLength\n    Channel::setPosition\n    Channel::getPosition\n]\n*/\n#define FMOD_TIMEUNIT_MS                0x00000001  /* Milliseconds. */\n#define FMOD_TIMEUNIT_PCM               0x00000002  /* PCM samples, related to milliseconds * samplerate / 1000. */\n#define FMOD_TIMEUNIT_PCMBYTES          0x00000004  /* Bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes). */\n#define FMOD_TIMEUNIT_RAWBYTES          0x00000008  /* Raw file bytes of (compressed) sound data (does not include headers).  Only used by Sound::getLength and Channel::getPosition. */\n#define FMOD_TIMEUNIT_PCMFRACTION       0x00000010  /* Fractions of 1 PCM sample.  Unsigned int range 0 to 0xFFFFFFFF.  Used for sub-sample granularity for DSP purposes. */\n#define FMOD_TIMEUNIT_MODORDER          0x00000100  /* MOD/S3M/XM/IT.  Order in a sequenced module format.  Use Sound::getFormat to determine the PCM format being decoded to. */\n#define FMOD_TIMEUNIT_MODROW            0x00000200  /* MOD/S3M/XM/IT.  Current row in a sequenced module format.  Sound::getLength will return the number of rows in the currently playing or seeked to pattern. */\n#define FMOD_TIMEUNIT_MODPATTERN        0x00000400  /* MOD/S3M/XM/IT.  Current pattern in a sequenced module format.  Sound::getLength will return the number of patterns in the song and Channel::getPosition will return the currently playing pattern. */\n#define FMOD_TIMEUNIT_SENTENCE_MS       0x00010000  /* Currently playing subsound in a sentence time in milliseconds. */\n#define FMOD_TIMEUNIT_SENTENCE_PCM      0x00020000  /* Currently playing subsound in a sentence time in PCM Samples, related to milliseconds * samplerate / 1000. */\n#define FMOD_TIMEUNIT_SENTENCE_PCMBYTES 0x00040000  /* Currently playing subsound in a sentence time in bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes). */\n#define FMOD_TIMEUNIT_SENTENCE          0x00080000  /* Currently playing sentence index according to the channel. */\n#define FMOD_TIMEUNIT_SENTENCE_SUBSOUND 0x00100000  /* Currently playing subsound index in a sentence. */\n#define FMOD_TIMEUNIT_BUFFERED          0x10000000  /* Time value as seen by buffered stream.  This is always ahead of audible time, and is only used for processing. */\n/* [DEFINE_END] */\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]\n    When creating a multichannel sound, FMOD will pan them to their default speaker locations, for example a 6 channel sound will default to one channel per 5.1 output speaker.<br>\n    Another example is a stereo sound.  It will default to left = front left, right = front right.<br>\n    <br>\n    This is for sounds that are not 'default'.  For example you might have a sound that is 6 channels but actually made up of 3 stereo pairs, that should all be located in front left, front right only.\n\n    [REMARKS]\n    For full flexibility of speaker assignments, use Channel::setSpeakerLevels.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_CREATESOUNDEXINFO\n    Channel::setSpeakerLevels\n]\n*/\ntypedef enum\n{\n    FMOD_SPEAKERMAPTYPE_DEFAULT,     /* This is the default, and just means FMOD decides which speakers it puts the source channels. */\n    FMOD_SPEAKERMAPTYPE_ALLMONO,     /* This means the sound is made up of all mono sounds.  All voices will be panned to the front center by default in this case.  */\n    FMOD_SPEAKERMAPTYPE_ALLSTEREO,   /* This means the sound is made up of all stereo sounds.  All voices will be panned to front left and front right alternating every second channel.  */\n    FMOD_SPEAKERMAPTYPE_51_PROTOOLS  /* Map a 5.1 sound to use protools L C R Ls Rs LFE mapping.  Will return an error if not a 6 channel sound. */\n} FMOD_SPEAKERMAPTYPE;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Use this structure with System::createSound when more control is needed over loading.<br>\n    The possible reasons to use this with System::createSound are:<br>\n    <li>Loading a file from memory.\n    <li>Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length.\n    <li>To create a user created / non file based sound.\n    <li>To specify a starting subsound to seek to within a multi-sample sounds (ie FSB/DLS/SF2) when created as a stream.\n    <li>To specify which subsounds to load for multi-sample sounds (ie FSB/DLS/SF2) so that memory is saved and only a subset is actually loaded/read from disk.\n    <li>To specify 'piggyback' read and seek callbacks for capture of sound data as fmod reads and decodes it.  Useful for ripping decoded PCM data from sounds as they are loaded / played.\n    <li>To specify a MIDI DLS/SF2 sample set file to load when opening a MIDI file.\n    See below on what members to fill for each of the above types of sound you want to create.\n\n    [REMARKS]\n    This structure is optional!  Specify 0 or NULL in System::createSound if you don't need it!<br>\n    <br>\n    <u>Loading a file from memory.</u><br>\n    <li>Create the sound using the FMOD_OPENMEMORY flag.<br>\n    <li>Mandatory.  Specify 'length' for the size of the memory block in bytes.\n    <li>Other flags are optional.\n    <br>\n    <br>\n    <u>Loading a file from within another larger (possibly wad/pak) file, by giving the loader an offset and length.</u><br>\n    <li>Mandatory.  Specify 'fileoffset' and 'length'.\n    <li>Other flags are optional.\n    <br>\n    <br>\n    <u>To create a user created / non file based sound.</u><br>\n    <li>Create the sound using the FMOD_OPENUSER flag.\n    <li>Mandatory.  Specify 'defaultfrequency, 'numchannels' and 'format'.\n    <li>Other flags are optional.\n    <br>\n    <br>\n    <u>To specify a starting subsound to seek to and flush with, within a multi-sample stream (ie FSB/DLS/SF2).</u><br>\n    <br>\n    <li>Mandatory.  Specify 'initialsubsound'.\n    <br>\n    <br>\n    <u>To specify which subsounds to load for multi-sample sounds (ie FSB/DLS/SF2) so that memory is saved and only a subset is actually loaded/read from disk.</u><br>\n    <br>\n    <li>Mandatory.  Specify 'inclusionlist' and 'inclusionlistnum'.\n    <br>\n    <br>\n    <u>To specify 'piggyback' read and seek callbacks for capture of sound data as fmod reads and decodes it.  Useful for ripping decoded PCM data from sounds as they are loaded / played.</u><br>\n    <br>\n    <li>Mandatory.  Specify 'pcmreadcallback' and 'pcmseekcallback'.\n    <br>\n    <br>\n    <u>To specify a MIDI DLS/SF2 sample set file to load when opening a MIDI file.</u><br>\n    <br>\n    <li>Mandatory.  Specify 'dlsname'.\n    <br>\n    <br>\n    Setting the 'decodebuffersize' is for cpu intensive codecs that may be causing stuttering, not file intensive codecs (ie those from CD or netstreams) which are normally \n    altered with System::setStreamBufferSize.  As an example of cpu intensive codecs, an mp3 file will take more cpu to decode than a PCM wav file.<br>\n    If you have a stuttering effect, then it is using more cpu than the decode buffer playback rate can keep up with.  Increasing the decode buffersize will most likely solve this problem.<br>\n    <br>\n    <br>\n    FSB codec.  If inclusionlist and numsubsounds are used together, this will trigger a special mode where subsounds are shuffled down to save memory.  (useful for large FSB \n    files where you only want to load 1 sound).  There will be no gaps, ie no null subsounds.  As an example, if there are 10,000 subsounds and there is an inclusionlist with only 1 entry, \n    and numsubsounds = 1, then subsound 0 will be that entry, and there will only be the memory allocated for 1 subsound.  Previously there would still be 10,000 subsound pointers and other\n    associated codec entries allocated along with it multiplied by 10,000.<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createSound\n    System::setStreamBufferSize\n    FMOD_MODE\n    FMOD_SOUND_FORMAT\n    FMOD_SOUND_TYPE\n    FMOD_SPEAKERMAPTYPE\n]\n*/\ntypedef struct FMOD_CREATESOUNDEXINFO\n{\n    int                            cbsize;             /* [w] Size of this structure.  This is used so the structure can be expanded in the future and still work on older versions of FMOD Ex. */\n    unsigned int                   length;             /* [w] Optional. Specify 0 to ignore. Size in bytes of file to load, or sound to create (in this case only if FMOD_OPENUSER is used).  Required if loading from memory.  If 0 is specified, then it will use the size of the file (unless loading from memory then an error will be returned). */\n    unsigned int                   fileoffset;         /* [w] Optional. Specify 0 to ignore. Offset from start of the file to start loading from.  This is useful for loading files from inside big data files. */\n    int                            numchannels;        /* [w] Optional. Specify 0 to ignore. Number of channels in a sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used. */\n    int                            defaultfrequency;   /* [w] Optional. Specify 0 to ignore. Default frequency of sound in a sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used.  Other formats use the frequency determined by the file format. */\n    FMOD_SOUND_FORMAT              format;             /* [w] Optional. Specify 0 or FMOD_SOUND_FORMAT_NONE to ignore. Format of the sound mandatory if FMOD_OPENUSER or FMOD_OPENRAW is used.  Other formats use the format determined by the file format.   */\n    unsigned int                   decodebuffersize;   /* [w] Optional. Specify 0 to ignore. For streams.  This determines the size of the double buffer (in PCM samples) that a stream uses.  Use this for user created streams if you want to determine the size of the callback buffer passed to you.  Specify 0 to use FMOD's default size which is currently equivalent to 400ms of the sound format created/loaded. */\n    int                            initialsubsound;    /* [w] Optional. Specify 0 to ignore. In a multi-sample file format such as .FSB/.DLS/.SF2, specify the initial subsound to seek to, only if FMOD_CREATESTREAM is used. */\n    int                            numsubsounds;       /* [w] Optional. Specify 0 to ignore or have no subsounds.  In a sound created with FMOD_OPENUSER, specify the number of subsounds that are accessable with Sound::getSubSound.  If not created with FMOD_OPENUSER, this will limit the number of subsounds loaded within a multi-subsound file.  If using FSB, then if FMOD_CREATESOUNDEXINFO::inclusionlist is used, this will shuffle subsounds down so that there are not any gaps.  It will mean that the indices of the sounds will be different. */\n    int                           *inclusionlist;      /* [w] Optional. Specify 0 to ignore. In a multi-sample format such as .FSB/.DLS/.SF2 it may be desirable to specify only a subset of sounds to be loaded out of the whole file.  This is an array of subsound indices to load into memory when created. */\n    int                            inclusionlistnum;   /* [w] Optional. Specify 0 to ignore. This is the number of integers contained within the inclusionlist array. */\n    FMOD_SOUND_PCMREADCALLBACK     pcmreadcallback;    /* [w] Optional. Specify 0 to ignore. Callback to 'piggyback' on FMOD's read functions and accept or even write PCM data while FMOD is opening the sound.  Used for user sounds created with FMOD_OPENUSER or for capturing decoded data as FMOD reads it. */\n    FMOD_SOUND_PCMSETPOSCALLBACK   pcmsetposcallback;  /* [w] Optional. Specify 0 to ignore. Callback for when the user calls a seeking function such as Channel::setTime or Channel::setPosition within a multi-sample sound, and for when it is opened.*/\n    FMOD_SOUND_NONBLOCKCALLBACK    nonblockcallback;   /* [w] Optional. Specify 0 to ignore. Callback for successful completion, or error while loading a sound that used the FMOD_NONBLOCKING flag.*/\n    const char                    *dlsname;            /* [w] Optional. Specify 0 to ignore. Filename for a DLS or SF2 sample set when loading a MIDI file. If not specified, on Windows it will attempt to open /windows/system32/drivers/gm.dls or /windows/system32/drivers/etc/gm.dls, on Mac it will attempt to load /System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls, otherwise the MIDI will fail to open. Current DLS support is for level 1 of the specification. */\n    const char                    *encryptionkey;      /* [w] Optional. Specify 0 to ignore. Key for encrypted FSB file.  Without this key an encrypted FSB file will not load. */\n    int                            maxpolyphony;       /* [w] Optional. Specify 0 to ignore. For sequenced formats with dynamic channel allocation such as .MID and .IT, this specifies the maximum voice count allowed while playing.  .IT defaults to 64.  .MID defaults to 32. */\n    void                          *userdata;           /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the sound during creation.  Access via Sound::getUserData.  Note: This is not passed to FMOD_FILE_OPENCALLBACK, that is a different userdata that is file specific. */\n    FMOD_SOUND_TYPE                suggestedsoundtype; /* [w] Optional. Specify 0 or FMOD_SOUND_TYPE_UNKNOWN to ignore.  Instead of scanning all codec types, use this to speed up loading by making it jump straight to this codec. */\n    FMOD_FILE_OPENCALLBACK         useropen;           /* [w] Optional. Specify 0 to ignore. Callback for opening this file. */\n    FMOD_FILE_CLOSECALLBACK        userclose;          /* [w] Optional. Specify 0 to ignore. Callback for closing this file. */\n    FMOD_FILE_READCALLBACK         userread;           /* [w] Optional. Specify 0 to ignore. Callback for reading from this file. */\n    FMOD_FILE_SEEKCALLBACK         userseek;           /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */\n    FMOD_FILE_ASYNCREADCALLBACK    userasyncread;      /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */\n    FMOD_FILE_ASYNCCANCELCALLBACK  userasynccancel;    /* [w] Optional. Specify 0 to ignore. Callback for seeking within this file. */\n    FMOD_SPEAKERMAPTYPE            speakermap;         /* [w] Optional. Specify 0 to ignore. Use this to differ the way fmod maps multichannel sounds to speakers.  See FMOD_SPEAKERMAPTYPE for more. */\n    FMOD_SOUNDGROUP               *initialsoundgroup;  /* [w] Optional. Specify 0 to ignore. Specify a sound group if required, to put sound in as it is created. */\n    unsigned int                   initialseekposition;/* [w] Optional. Specify 0 to ignore. For streams. Specify an initial position to seek the stream to. */\n    FMOD_TIMEUNIT                  initialseekpostype; /* [w] Optional. Specify 0 to ignore. For streams. Specify the time unit for the position set in initialseekposition. */\n    int                            ignoresetfilesystem;/* [w] Optional. Specify 0 to ignore. Set to 1 to use fmod's built in file system. Ignores setFileSystem callbacks and also FMOD_CREATESOUNEXINFO file callbacks.  Useful for specific cases where you don't want to use your own file system but want to use fmod's file system (ie net streaming). */\n    int                            cddaforceaspi;      /* [w] Optional. Specify 0 to ignore. For CDDA sounds only - if non-zero use ASPI instead of NTSCSI to access the specified CD/DVD device. */\n    unsigned int                   audioqueuepolicy;   /* [w] Optional. Specify 0 or FMOD_AUDIOQUEUE_CODECPOLICY_DEFAULT to ignore. Policy used to determine whether hardware or software is used for decoding, see FMOD_AUDIOQUEUE_CODECPOLICY for options (iOS >= 3.0 required, otherwise only hardware is available) */ \n    unsigned int                   minmidigranularity; /* [w] Optional. Specify 0 to ignore. Allows you to set a minimum desired MIDI mixer granularity. Values smaller than 512 give greater than default accuracy at the cost of more CPU and vice versa. Specify 0 for default (512 samples). */\n    int                            nonblockthreadid;   /* [w] Optional. Specify 0 to ignore. Specifies a thread index to execute non blocking load on.  Allows for up to 5 threads to be used for loading at once.  This is to avoid one load blocking another.  Maximum value = 4. */\n} FMOD_CREATESOUNDEXINFO;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure defining a reverb environment.<br>\n\n    [REMARKS]\n    Note the default reverb properties are the same as the FMOD_PRESET_GENERIC preset.<br>\n    Note that integer values that typically range from -10,000 to 1000 are represented in \n    decibels, and are of a logarithmic scale, not linear, wheras float values are always linear.<br>\n    <br>\n    The numerical values listed below are the maximum, minimum and default values for each variable respectively.<br>\n    <br>\n    <b>SUPPORTED</b> next to each parameter means the platform the parameter can be set on.  Some platforms support all parameters and some don't.<br>\n    WII   means Nintendo Wii hardware reverb (must use FMOD_HARDWARE).<br>\n    PSP   means Playstation Portable hardware reverb (must use FMOD_HARDWARE).<br>\n    SFX   means FMOD SFX software reverb.  This works on any platform that uses FMOD_SOFTWARE for loading sounds.<br>\n    ---   means unsupported/deprecated.  Will either be removed or supported by SFX in the future.\n    <br>\n    Nintendo Wii Notes:<br>\n    This structure supports only limited parameters, and maps them to the Wii hardware reverb as follows.<br>\n    DecayTime = 'time'<br>\n    ReverbDelay = 'predelay'<br>\n    ModulationDepth = 'damping'<br>\n    Reflections = 'coloration'<br>\n    EnvDiffusion = 'crosstalk'<br>\n    Room = 'mix'<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [r/w] are either read or write depending on if you are using System::setReverbProperties (w) or System::getReverbProperties (r).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setReverbProperties\n    System::getReverbProperties\n    FMOD_REVERB_PRESETS\n    FMOD_REVERB_FLAGS\n]\n*/\ntypedef struct FMOD_REVERB_PROPERTIES\n{                                   /*       MIN    MAX    DEFAULT DESCRIPTION */\n    int          Instance;          /* [w]   0      3      0       Environment Instance.                                                 (SUPPORTED:SFX(4 instances) and Wii (3 instances)) */\n    int          Environment;       /* [r/w] -1     25     -1      Sets all listener properties.  -1 = OFF.                              (SUPPORTED:SFX(-1 only)/PSP) */\n    float        EnvDiffusion;      /* [r/w] 0.0    1.0    1.0     Environment diffusion                                                 (SUPPORTED:WII) */\n    int          Room;              /* [r/w] -10000 0      -1000   Room effect level (at mid frequencies)                                (SUPPORTED:SFX/WII/PSP) */\n    int          RoomHF;            /* [r/w] -10000 0      -100    Relative room effect level at high frequencies                        (SUPPORTED:SFX) */\n    int          RoomLF;            /* [r/w] -10000 0      0       Relative room effect level at low frequencies                         (SUPPORTED:SFX) */\n    float        DecayTime;         /* [r/w] 0.1    20.0   1.49    Reverberation decay time at mid frequencies                           (SUPPORTED:SFX/WII) */\n    float        DecayHFRatio;      /* [r/w] 0.1    2.0    0.83    High-frequency to mid-frequency decay time ratio                      (SUPPORTED:SFX) */\n    float        DecayLFRatio;      /* [r/w] 0.1    2.0    1.0     Low-frequency to mid-frequency decay time ratio                       (SUPPORTED:---) */\n    int          Reflections;       /* [r/w] -10000 1000   -2602   Early reflections level relative to room effect                       (SUPPORTED:SFX/WII) */\n    float        ReflectionsDelay;  /* [r/w] 0.0    0.3    0.007   Initial reflection delay time                                         (SUPPORTED:SFX) */\n    int          Reverb;            /* [r/w] -10000 2000   200     Late reverberation level relative to room effect                      (SUPPORTED:SFX) */\n    float        ReverbDelay;       /* [r/w] 0.0    0.1    0.011   Late reverberation delay time relative to initial reflection          (SUPPORTED:SFX/WII) */\n    float        ModulationTime;    /* [r/w] 0.04   4.0    0.25    Modulation time                                                       (SUPPORTED:---) */\n    float        ModulationDepth;   /* [r/w] 0.0    1.0    0.0     Modulation depth                                                      (SUPPORTED:WII) */\n    float        HFReference;       /* [r/w] 1000.0 20000  5000.0  Reference high frequency (hz)                                         (SUPPORTED:SFX) */\n    float        LFReference;       /* [r/w] 20.0   1000.0 250.0   Reference low frequency (hz)                                          (SUPPORTED:SFX) */\n    float        Diffusion;         /* [r/w] 0.0    100.0  100.0   Value that controls the echo density in the late reverberation decay. (SUPPORTED:SFX) */\n    float        Density;           /* [r/w] 0.0    100.0  100.0   Value that controls the modal density in the late reverberation decay (SUPPORTED:SFX) */\n    unsigned int Flags;             /* [r/w] FMOD_REVERB_FLAGS - modifies the behavior of above properties                               (SUPPORTED:WII) */\n} FMOD_REVERB_PROPERTIES;\n\n\n/*\n[DEFINE] \n[\n    [NAME] \n    FMOD_REVERB_FLAGS\n\n    [DESCRIPTION]\n    Values for the Flags member of the FMOD_REVERB_PROPERTIES structure.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_REVERB_PROPERTIES\n]\n*/\n#define FMOD_REVERB_FLAGS_HIGHQUALITYREVERB     0x00000400 /* Wii. Use high quality reverb */\n#define FMOD_REVERB_FLAGS_HIGHQUALITYDPL2REVERB 0x00000800 /* Wii. Use high quality DPL2 reverb */\n#define FMOD_REVERB_FLAGS_DEFAULT               0x00000000\n/* [DEFINE_END] */\n\n\n/*\n[DEFINE] \n[\n    [NAME] \n    FMOD_REVERB_PRESETS\n\n    [DESCRIPTION]   \n    A set of predefined environment PARAMETERS.<br>\n    These are used to initialize an FMOD_REVERB_PROPERTIES structure statically.<br>\n    i.e.<br>\n    FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_GENERIC;\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setReverbProperties\n]\n*/\n/*                                    Inst Env  Diffus  Room   RoomHF  RmLF DecTm   DecHF  DecLF   Refl  RefDel   Revb  RevDel  ModTm  ModDp   HFRef    LFRef   Diffus  Densty  FLAGS */\n#define FMOD_PRESET_OFF              {  0, -1,  1.00f, -10000, -10000, 0,   1.00f,  1.00f, 1.0f,  -2602, 0.007f,   200, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f,   0.0f,   0.0f, 0x33f }\n#define FMOD_PRESET_GENERIC          {  0,  0,  1.00f, -1000,  -100,   0,   1.49f,  0.83f, 1.0f,  -2602, 0.007f,   200, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_PADDEDCELL       {  0,  1,  1.00f, -1000,  -6000,  0,   0.17f,  0.10f, 1.0f,  -1204, 0.001f,   207, 0.002f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_ROOM             {  0,  2,  1.00f, -1000,  -454,   0,   0.40f,  0.83f, 1.0f,  -1646, 0.002f,    53, 0.003f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_BATHROOM         {  0,  3,  1.00f, -1000,  -1200,  0,   1.49f,  0.54f, 1.0f,   -370, 0.007f,  1030, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f,  60.0f, 0x3f }\n#define FMOD_PRESET_LIVINGROOM       {  0,  4,  1.00f, -1000,  -6000,  0,   0.50f,  0.10f, 1.0f,  -1376, 0.003f, -1104, 0.004f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_STONEROOM        {  0,  5,  1.00f, -1000,  -300,   0,   2.31f,  0.64f, 1.0f,   -711, 0.012f,    83, 0.017f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_AUDITORIUM       {  0,  6,  1.00f, -1000,  -476,   0,   4.32f,  0.59f, 1.0f,   -789, 0.020f,  -289, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CONCERTHALL      {  0,  7,  1.00f, -1000,  -500,   0,   3.92f,  0.70f, 1.0f,  -1230, 0.020f,    -2, 0.029f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CAVE             {  0,  8,  1.00f, -1000,  0,      0,   2.91f,  1.30f, 1.0f,   -602, 0.015f,  -302, 0.022f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x1f }\n#define FMOD_PRESET_ARENA            {  0,  9,  1.00f, -1000,  -698,   0,   7.24f,  0.33f, 1.0f,  -1166, 0.020f,    16, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_HANGAR           {  0,  10, 1.00f, -1000,  -1000,  0,   10.05f, 0.23f, 1.0f,   -602, 0.020f,   198, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CARPETTEDHALLWAY {  0,  11, 1.00f, -1000,  -4000,  0,   0.30f,  0.10f, 1.0f,  -1831, 0.002f, -1630, 0.030f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_HALLWAY          {  0,  12, 1.00f, -1000,  -300,   0,   1.49f,  0.59f, 1.0f,  -1219, 0.007f,   441, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_STONECORRIDOR    {  0,  13, 1.00f, -1000,  -237,   0,   2.70f,  0.79f, 1.0f,  -1214, 0.013f,   395, 0.020f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_ALLEY            {  0,  14, 0.30f, -1000,  -270,   0,   1.49f,  0.86f, 1.0f,  -1204, 0.007f,    -4, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_FOREST           {  0,  15, 0.30f, -1000,  -3300,  0,   1.49f,  0.54f, 1.0f,  -2560, 0.162f,  -229, 0.088f, 0.25f, 0.000f, 5000.0f, 250.0f,  79.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_CITY             {  0,  16, 0.50f, -1000,  -800,   0,   1.49f,  0.67f, 1.0f,  -2273, 0.007f, -1691, 0.011f, 0.25f, 0.000f, 5000.0f, 250.0f,  50.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_MOUNTAINS        {  0,  17, 0.27f, -1000,  -2500,  0,   1.49f,  0.21f, 1.0f,  -2780, 0.300f, -1434, 0.100f, 0.25f, 0.000f, 5000.0f, 250.0f,  27.0f, 100.0f, 0x1f }\n#define FMOD_PRESET_QUARRY           {  0,  18, 1.00f, -1000,  -1000,  0,   1.49f,  0.83f, 1.0f, -10000, 0.061f,   500, 0.025f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_PLAIN            {  0,  19, 0.21f, -1000,  -2000,  0,   1.49f,  0.50f, 1.0f,  -2466, 0.179f, -1926, 0.100f, 0.25f, 0.000f, 5000.0f, 250.0f,  21.0f, 100.0f, 0x3f }\n#define FMOD_PRESET_PARKINGLOT       {  0,  20, 1.00f, -1000,  0,      0,   1.65f,  1.50f, 1.0f,  -1363, 0.008f, -1153, 0.012f, 0.25f, 0.000f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x1f }\n#define FMOD_PRESET_SEWERPIPE        {  0,  21, 0.80f, -1000,  -1000,  0,   2.81f,  0.14f, 1.0f,    429, 0.014f,  1023, 0.021f, 0.25f, 0.000f, 5000.0f, 250.0f,  80.0f,  60.0f, 0x3f }\n#define FMOD_PRESET_UNDERWATER       {  0,  22, 1.00f, -1000,  -4000,  0,   1.49f,  0.10f, 1.0f,   -449, 0.007f,  1700, 0.011f, 1.18f, 0.348f, 5000.0f, 250.0f, 100.0f, 100.0f, 0x3f }\n\n/* PlayStation Portable Only presets */\n#define FMOD_PRESET_PSP_ROOM         {  0,  1,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_STUDIO_A     {  0,  2,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_STUDIO_B     {  0,  3,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_STUDIO_C     {  0,  4,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_HALL         {  0,  5,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_SPACE        {  0,  6,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_ECHO         {  0,  7,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_DELAY        {  0,  8,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n#define FMOD_PRESET_PSP_PIPE         {  0,  9,  0,     0,      0,      0,   0.0f,   0.0f,  0.0f,     0,  0.000f,     0, 0.000f, 0.00f, 0.000f, 0000.0f,   0.0f,  0.0f,    0.0f, 0x31f }\n/* [DEFINE_END] */\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure defining the properties for a reverb source, related to a FMOD channel.<br>\n    <br>\n    Note the default reverb properties are the same as the FMOD_PRESET_GENERIC preset.<br>\n    Note that integer values that typically range from -10,000 to 1000 are represented in \n    decibels, and are of a logarithmic scale, not linear, wheras float values are typically linear.<br>\n    PORTABILITY: Each member has the platform it supports in braces ie (win32/wii).<br>\n    <br>\n    The numerical values listed below are the maximum, minimum and default values for each variable respectively.<br>\n\n    [REMARKS]\n    <b>SUPPORTED</b> next to each parameter means the platform the parameter can be set on.  Some platforms support all parameters and some don't.<br>\n    WII   means Nintendo Wii hardware reverb (must use FMOD_HARDWARE).<br>\n    PSP   means Playstation Portable hardware reverb (must use FMOD_HARDWARE).<br>\n    SFX   means FMOD SFX software reverb.  This works on any platform that uses FMOD_SOFTWARE for loading sounds.<br>\n    ---   means unsupported/deprecated.  Will either be removed or supported by SFX in the future.\n    <br>\n    <br>\n    <b>'ConnectionPoint' Parameter.</b>  This parameter is for the FMOD software reverb only (known as SFX in the list above).<br>\n    By default the dsp network connection for a channel and its reverb is between the 'SFX Reverb' unit, and the channel's wavetable/resampler/dspcodec/oscillator unit (the unit below the channel DSP head).  NULL can be used for this parameter to make it use this default behaviour.<br>\n    This parameter allows the user to connect the SFX reverb to somewhere else internally, for example the channel DSP head, or a related channelgroup.  The event system uses this so that it can have the output of an event going to the reverb, instead of just the output of the event's channels (thereby ignoring event effects/submixes etc).<br>\n    Do not use if you are unaware of DSP network connection issues.  Leave it at the default of NULL instead.<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [r/w] are either read or write depending on if you are using Channel::setReverbProperties (w) or Channel::getReverbProperties (r).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    Channel::setReverbProperties\n    Channel::getReverbProperties\n    FMOD_REVERB_CHANNELFLAGS \n]\n*/\ntypedef struct FMOD_REVERB_CHANNELPROPERTIES\n{                                      /*       MIN    MAX  DEFAULT  DESCRIPTION */\n    int          Direct;               /* [r/w] -10000 1000 0        Direct path level                                        (SUPPORTED:SFX) */\n    int          Room;                 /* [r/w] -10000 1000 0        Room effect level                                        (SUPPORTED:SFX) */\n    unsigned int Flags;                /* [r/w] FMOD_REVERB_CHANNELFLAGS - modifies the behavior of properties                (SUPPORTED:SFX) */\n    FMOD_DSP    *ConnectionPoint;      /* [r/w] See remarks.         DSP network location to connect reverb for this channel. (SUPPORTED:SFX).*/\n} FMOD_REVERB_CHANNELPROPERTIES;\n\n\n/*\n[DEFINE] \n[\n    [NAME] \n    FMOD_REVERB_CHANNELFLAGS\n\n    [DESCRIPTION]\n    Values for the Flags member of the FMOD_REVERB_CHANNELPROPERTIES structure.\n\n    [REMARKS]\n    For SFX Reverb, there is support for multiple reverb environments.<br>\n    Use FMOD_REVERB_CHANNELFLAGS_ENVIRONMENT0 to FMOD_REVERB_CHANNELFLAGS_ENVIRONMENT3 in the flags member \n    of FMOD_REVERB_CHANNELPROPERTIES to specify which environment instance(s) to target. <br>\n    - If you do not specify any instance the first reverb instance will be used.<br>\n    - If you specify more than one instance with getReverbProperties, the first instance will be used.<br>\n    - If you specify more than one instance with setReverbProperties, it will set more than 1 instance at once.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_REVERB_CHANNELPROPERTIES\n]\n*/\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE0     0x00000010 /* SFX/Wii. Specify channel to target reverb instance 0.  Default target. */\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE1     0x00000020 /* SFX/Wii. Specify channel to target reverb instance 1. */\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE2     0x00000040 /* SFX/Wii. Specify channel to target reverb instance 2. */\n#define FMOD_REVERB_CHANNELFLAGS_INSTANCE3     0x00000080 /* SFX. Specify channel to target reverb instance 3. */\n\n#define FMOD_REVERB_CHANNELFLAGS_DEFAULT       FMOD_REVERB_CHANNELFLAGS_INSTANCE0\n/* [DEFINE_END] */\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Settings for advanced features like configuring memory and cpu usage for the FMOD_CREATECOMPRESSEDSAMPLE feature.\n\n    [REMARKS]\n    maxMPEGcodecs / maxADPCMcodecs / maxXMAcodecs will determine the maximum cpu usage of playing realtime samples.  Use this to lower potential excess cpu usage and also control memory usage.<br>\n    <br>\n    maxPCMcodecs is for use with PS3 only. It will determine the maximum number of PCM voices that can be played at once. This includes streams of any format and all sounds created\n    *without* the FMOD_CREATECOMPRESSEDSAMPLE flag.\n    <br>\n    Memory will be allocated for codecs 'up front' (during System::init) if these values are specified as non zero.  If any are zero, it allocates memory for the codec whenever a file of the type in question is loaded.  So if maxMPEGcodecs is 0 for example, it will allocate memory for the mpeg codecs the first time an mp3 is loaded or an mp3 based .FSB file is loaded.<br>\n    <br>\n    Due to inefficient encoding techniques on certain .wav based ADPCM files, FMOD can can need an extra 29720 bytes per codec.  This means for lowest memory consumption.  Use FSB as it uses an optimal/small ADPCM block size.<br>\n    <br>\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [r/w] are either read or write depending on if you are using System::setAdvancedSettings (w) or System::getAdvancedSettings (r).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::setAdvancedSettings\n    System::getAdvancedSettings\n    System::init\n    FMOD_MODE\n]\n*/\ntypedef struct FMOD_ADVANCEDSETTINGS\n{                       \n    int             cbsize;                     /* [w]   Size of this structure.  Use sizeof(FMOD_ADVANCEDSETTINGS)  NOTE: This must be set before calling System::getAdvancedSettings! */\n    int             maxMPEGcodecs;              /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  Mpeg  codecs consume 21,684 bytes per instance and this number will determine how many mpeg channels can be played simultaneously.   Default = 32. */\n    int             maxADPCMcodecs;             /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  ADPCM codecs consume  2,136 bytes per instance and this number will determine how many ADPCM channels can be played simultaneously.  Default = 32. */\n    int             maxXMAcodecs;               /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  XMA   codecs consume 14,836 bytes per instance and this number will determine how many XMA channels can be played simultaneously.    Default = 32. */\n    int             maxCELTcodecs;              /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_CREATECOMPRESSEDSAMPLE only.  CELT  codecs consume 11,500 bytes per instance and this number will determine how many CELT channels can be played simultaneously.   Default = 32. */    \n    int             maxPCMcodecs;               /* [r/w] Optional. Specify 0 to ignore. For use with PS3 only.                          PCM   codecs consume 12,672 bytes per instance and this number will determine how many streams and PCM voices can be played simultaneously. Default = 16. */\n    int             ASIONumChannels;            /* [r/w] Optional. Specify 0 to ignore. Number of channels available on the ASIO device. */\n    char          **ASIOChannelList;            /* [r/w] Optional. Specify 0 to ignore. Pointer to an array of strings (number of entries defined by ASIONumChannels) with ASIO channel names. */\n    FMOD_SPEAKER   *ASIOSpeakerList;            /* [r/w] Optional. Specify 0 to ignore. Pointer to a list of speakers that the ASIO channels map to.  This can be called after System::init to remap ASIO output. */\n    int             max3DReverbDSPs;            /* [r/w] Optional. Specify 0 to ignore. The max number of 3d reverb DSP's in the system. (NOTE: CURRENTLY DISABLED / UNUSED) */\n    float           HRTFMinAngle;               /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_HRTF_LOWPASS.  The angle range (0-360) of a 3D sound in relation to the listener, at which the HRTF function begins to have an effect. 0 = in front of the listener. 180 = from 90 degrees to the left of the listener to 90 degrees to the right. 360 = behind the listener. Default = 180.0. */\n    float           HRTFMaxAngle;               /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_HRTF_LOWPASS.  The angle range (0-360) of a 3D sound in relation to the listener, at which the HRTF function has maximum effect. 0 = front of the listener. 180 = from 90 degrees to the left of the listener to 90 degrees to the right. 360 = behind the listener. Default = 360.0. */\n    float           HRTFFreq;                   /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_HRTF_LOWPASS.  The cutoff frequency of the HRTF's lowpass filter function when at maximum effect. (i.e. at HRTFMaxAngle).  Default = 4000.0. */\n    float           vol0virtualvol;             /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_VOL0_BECOMES_VIRTUAL.  If this flag is used, and the volume is 0.0, then the sound will become virtual.  Use this value to raise the threshold to a different point where a sound goes virtual. */\n    int             eventqueuesize;             /* [r/w] Optional. Specify 0 to ignore. For use with FMOD Event system only.  Specifies the number of slots available for simultaneous non blocking loads, across all threads.  Default = 32. */\n    unsigned int    defaultDecodeBufferSize;    /* [r/w] Optional. Specify 0 to ignore. For streams. This determines the default size of the double buffer (in milliseconds) that a stream uses.  Default = 400ms */\n    char           *debugLogFilename;           /* [r/w] Optional. Specify 0 to ignore. Gives fmod's logging system a path/filename.  Normally the log is placed in the same directory as the executable and called fmod.log. When using System::getAdvancedSettings, provide at least 256 bytes of memory to copy into. */\n    unsigned short  profileport;                /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_ENABLE_PROFILE.  Specify the port to listen on for connections by the profiler application. */\n    unsigned int    geometryMaxFadeTime;        /* [r/w] Optional. Specify 0 to ignore. The maximum time in miliseconds it takes for a channel to fade to the new level when its occlusion changes. */\n    unsigned int    maxSpectrumWaveDataBuffers; /* [r/w] Optional. Specify 0 to ignore. Tells System::init to allocate a pool of wavedata/spectrum buffers to prevent memory fragmentation, any additional buffers will be allocated normally. */\n    unsigned int    musicSystemCacheDelay;      /* [r/w] Optional. Specify 0 to ignore. The delay the music system should allow for loading a sample from disk (in milliseconds). Default = 400 ms. */\n    float           distanceFilterCenterFreq;   /* [r/w] Optional. Specify 0 to ignore. For use with FMOD_INIT_DISTANCE_FILTERING.  The default center frequency in Hz for the distance filtering effect. Default = 1500.0. */\n} FMOD_ADVANCEDSETTINGS;\n\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]\n    Special channel index values for FMOD functions.\n\n    [REMARKS]\n    To get 'all' of the channels, use System::getMasterChannelGroup.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::playSound\n    System::playDSP\n    System::getChannel\n    System::getMasterChannelGroup\n]\n*/\ntypedef enum\n{\n    FMOD_CHANNEL_FREE  = -1,      /* For a channel index, FMOD chooses a free voice using the priority system. */\n    FMOD_CHANNEL_REUSE = -2       /* For a channel index, re-use the channel handle that was passed in. */\n} FMOD_CHANNELINDEX;\n\n#include \"fmod_codec.h\"\n#include \"fmod_dsp.h\"\n#include \"fmod_memoryinfo.h\"\n\n/* ========================================================================================== */\n/* FUNCTION PROTOTYPES                                                                        */\n/* ========================================================================================== */\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\n/*\n    FMOD global system functions (optional).\n*/\n\nFMOD_RESULT F_API FMOD_Memory_Initialize           (void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags);\nFMOD_RESULT F_API FMOD_Memory_GetStats             (int *currentalloced, int *maxalloced, FMOD_BOOL blocking);\nFMOD_RESULT F_API FMOD_Debug_SetLevel              (FMOD_DEBUGLEVEL level);\nFMOD_RESULT F_API FMOD_Debug_GetLevel              (FMOD_DEBUGLEVEL *level);\nFMOD_RESULT F_API FMOD_File_SetDiskBusy            (int busy);\nFMOD_RESULT F_API FMOD_File_GetDiskBusy            (int *busy);\n\n/*\n    FMOD System factory functions.  Use this to create an FMOD System Instance.  below you will see FMOD_System_Init/Close to get started.\n*/\n\nFMOD_RESULT F_API FMOD_System_Create               (FMOD_SYSTEM **system); \nFMOD_RESULT F_API FMOD_System_Release              (FMOD_SYSTEM *system); \n\n/*$ preserve end $*/\n\n/*\n    'System' API\n*/\n\n/*\n     Pre-init functions.\n*/\n\nFMOD_RESULT F_API FMOD_System_SetOutput              (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE output);\nFMOD_RESULT F_API FMOD_System_GetOutput              (FMOD_SYSTEM *system, FMOD_OUTPUTTYPE *output);\nFMOD_RESULT F_API FMOD_System_GetNumDrivers          (FMOD_SYSTEM *system, int *numdrivers);\nFMOD_RESULT F_API FMOD_System_GetDriverInfo          (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetDriverInfoW         (FMOD_SYSTEM *system, int id, short *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetDriverCaps          (FMOD_SYSTEM *system, int id, FMOD_CAPS *caps, int *controlpaneloutputrate, FMOD_SPEAKERMODE *controlpanelspeakermode);\nFMOD_RESULT F_API FMOD_System_SetDriver              (FMOD_SYSTEM *system, int driver);\nFMOD_RESULT F_API FMOD_System_GetDriver              (FMOD_SYSTEM *system, int *driver);\nFMOD_RESULT F_API FMOD_System_SetHardwareChannels    (FMOD_SYSTEM *system, int numhardwarechannels);\nFMOD_RESULT F_API FMOD_System_SetSoftwareChannels    (FMOD_SYSTEM *system, int numsoftwarechannels);\nFMOD_RESULT F_API FMOD_System_GetSoftwareChannels    (FMOD_SYSTEM *system, int *numsoftwarechannels);\nFMOD_RESULT F_API FMOD_System_SetSoftwareFormat      (FMOD_SYSTEM *system, int samplerate, FMOD_SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, FMOD_DSP_RESAMPLER resamplemethod);\nFMOD_RESULT F_API FMOD_System_GetSoftwareFormat      (FMOD_SYSTEM *system, int *samplerate, FMOD_SOUND_FORMAT *format, int *numoutputchannels, int *maxinputchannels, FMOD_DSP_RESAMPLER *resamplemethod, int *bits);\nFMOD_RESULT F_API FMOD_System_SetDSPBufferSize       (FMOD_SYSTEM *system, unsigned int bufferlength, int numbuffers);\nFMOD_RESULT F_API FMOD_System_GetDSPBufferSize       (FMOD_SYSTEM *system, unsigned int *bufferlength, int *numbuffers);\nFMOD_RESULT F_API FMOD_System_SetFileSystem          (FMOD_SYSTEM *system, FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, FMOD_FILE_ASYNCREADCALLBACK userasyncread, FMOD_FILE_ASYNCCANCELCALLBACK userasynccancel, int blockalign);\nFMOD_RESULT F_API FMOD_System_AttachFileSystem       (FMOD_SYSTEM *system, FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek);\nFMOD_RESULT F_API FMOD_System_SetAdvancedSettings    (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);\nFMOD_RESULT F_API FMOD_System_GetAdvancedSettings    (FMOD_SYSTEM *system, FMOD_ADVANCEDSETTINGS *settings);\nFMOD_RESULT F_API FMOD_System_SetSpeakerMode         (FMOD_SYSTEM *system, FMOD_SPEAKERMODE speakermode);\nFMOD_RESULT F_API FMOD_System_GetSpeakerMode         (FMOD_SYSTEM *system, FMOD_SPEAKERMODE *speakermode);\nFMOD_RESULT F_API FMOD_System_SetCallback            (FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBACK callback);\n\n/*\n     Plug-in support                       \n*/\n\nFMOD_RESULT F_API FMOD_System_SetPluginPath          (FMOD_SYSTEM *system, const char *path);\nFMOD_RESULT F_API FMOD_System_LoadPlugin             (FMOD_SYSTEM *system, const char *filename, unsigned int *handle, unsigned int priority);\nFMOD_RESULT F_API FMOD_System_UnloadPlugin           (FMOD_SYSTEM *system, unsigned int handle);\nFMOD_RESULT F_API FMOD_System_GetNumPlugins          (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int *numplugins);\nFMOD_RESULT F_API FMOD_System_GetPluginHandle        (FMOD_SYSTEM *system, FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);\nFMOD_RESULT F_API FMOD_System_GetPluginInfo          (FMOD_SYSTEM *system, unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);\nFMOD_RESULT F_API FMOD_System_SetOutputByPlugin      (FMOD_SYSTEM *system, unsigned int handle);\nFMOD_RESULT F_API FMOD_System_GetOutputByPlugin      (FMOD_SYSTEM *system, unsigned int *handle);\nFMOD_RESULT F_API FMOD_System_CreateDSPByPlugin      (FMOD_SYSTEM *system, unsigned int handle, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_CreateCodec            (FMOD_SYSTEM *system, FMOD_CODEC_DESCRIPTION *description, unsigned int priority);\n\n/*\n     Init/Close                            \n*/\n\nFMOD_RESULT F_API FMOD_System_Init                   (FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);\nFMOD_RESULT F_API FMOD_System_Close                  (FMOD_SYSTEM *system);\n\n/*\n     General post-init system functions    \n*/\n\nFMOD_RESULT F_API FMOD_System_Update                 (FMOD_SYSTEM *system);\n\nFMOD_RESULT F_API FMOD_System_Set3DSettings          (FMOD_SYSTEM *system, float dopplerscale, float distancefactor, float rolloffscale);\nFMOD_RESULT F_API FMOD_System_Get3DSettings          (FMOD_SYSTEM *system, float *dopplerscale, float *distancefactor, float *rolloffscale);\nFMOD_RESULT F_API FMOD_System_Set3DNumListeners      (FMOD_SYSTEM *system, int numlisteners);\nFMOD_RESULT F_API FMOD_System_Get3DNumListeners      (FMOD_SYSTEM *system, int *numlisteners);\nFMOD_RESULT F_API FMOD_System_Set3DListenerAttributes(FMOD_SYSTEM *system, int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_System_Get3DListenerAttributes(FMOD_SYSTEM *system, int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_System_Set3DRolloffCallback   (FMOD_SYSTEM *system, FMOD_3D_ROLLOFFCALLBACK callback);\nFMOD_RESULT F_API FMOD_System_Set3DSpeakerPosition   (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float x, float y, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_System_Get3DSpeakerPosition   (FMOD_SYSTEM *system, FMOD_SPEAKER speaker, float *x, float *y, FMOD_BOOL *active);\n\nFMOD_RESULT F_API FMOD_System_SetStreamBufferSize    (FMOD_SYSTEM *system, unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);\nFMOD_RESULT F_API FMOD_System_GetStreamBufferSize    (FMOD_SYSTEM *system, unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);\n\n/*\n     System information functions.        \n*/\n\nFMOD_RESULT F_API FMOD_System_GetVersion             (FMOD_SYSTEM *system, unsigned int *version);\nFMOD_RESULT F_API FMOD_System_GetOutputHandle        (FMOD_SYSTEM *system, void **handle);\nFMOD_RESULT F_API FMOD_System_GetChannelsPlaying     (FMOD_SYSTEM *system, int *channels);\nFMOD_RESULT F_API FMOD_System_GetHardwareChannels    (FMOD_SYSTEM *system, int *numhardwarechannels);\nFMOD_RESULT F_API FMOD_System_GetCPUUsage            (FMOD_SYSTEM *system, float *dsp, float *stream, float *geometry, float *update, float *total);\nFMOD_RESULT F_API FMOD_System_GetSoundRAM            (FMOD_SYSTEM *system, int *currentalloced, int *maxalloced, int *total);\nFMOD_RESULT F_API FMOD_System_GetNumCDROMDrives      (FMOD_SYSTEM *system, int *numdrives);\nFMOD_RESULT F_API FMOD_System_GetCDROMDriveName      (FMOD_SYSTEM *system, int drive, char *drivename, int drivenamelen, char *scsiname, int scsinamelen, char *devicename, int devicenamelen);\nFMOD_RESULT F_API FMOD_System_GetSpectrum            (FMOD_SYSTEM *system, float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\nFMOD_RESULT F_API FMOD_System_GetWaveData            (FMOD_SYSTEM *system, float *wavearray, int numvalues, int channeloffset);\n\n/*\n     Sound/DSP/Channel/FX creation and retrieval.       \n*/\n\nFMOD_RESULT F_API FMOD_System_CreateSound            (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_System_CreateStream           (FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_System_CreateDSP              (FMOD_SYSTEM *system, FMOD_DSP_DESCRIPTION *description, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_CreateDSPByType        (FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_CreateChannelGroup     (FMOD_SYSTEM *system, const char *name, FMOD_CHANNELGROUP **channelgroup);\nFMOD_RESULT F_API FMOD_System_CreateSoundGroup       (FMOD_SYSTEM *system, const char *name, FMOD_SOUNDGROUP **soundgroup);\nFMOD_RESULT F_API FMOD_System_CreateReverb           (FMOD_SYSTEM *system, FMOD_REVERB **reverb);\n\nFMOD_RESULT F_API FMOD_System_PlaySound              (FMOD_SYSTEM *system, FMOD_CHANNELINDEX channelid, FMOD_SOUND *sound, FMOD_BOOL paused, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_System_PlayDSP                (FMOD_SYSTEM *system, FMOD_CHANNELINDEX channelid, FMOD_DSP *dsp, FMOD_BOOL paused, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_System_GetChannel             (FMOD_SYSTEM *system, int channelid, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_System_GetMasterChannelGroup  (FMOD_SYSTEM *system, FMOD_CHANNELGROUP **channelgroup);\nFMOD_RESULT F_API FMOD_System_GetMasterSoundGroup    (FMOD_SYSTEM *system, FMOD_SOUNDGROUP **soundgroup);\n\n/*\n     Reverb API                           \n*/\n\nFMOD_RESULT F_API FMOD_System_SetReverbProperties    (FMOD_SYSTEM *system, const FMOD_REVERB_PROPERTIES *prop);\nFMOD_RESULT F_API FMOD_System_GetReverbProperties    (FMOD_SYSTEM *system, FMOD_REVERB_PROPERTIES *prop);\nFMOD_RESULT F_API FMOD_System_SetReverbAmbientProperties(FMOD_SYSTEM *system, FMOD_REVERB_PROPERTIES *prop);\nFMOD_RESULT F_API FMOD_System_GetReverbAmbientProperties(FMOD_SYSTEM *system, FMOD_REVERB_PROPERTIES *prop);\n\n/*\n     System level DSP access.\n*/\n\nFMOD_RESULT F_API FMOD_System_GetDSPHead             (FMOD_SYSTEM *system, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_System_AddDSP                 (FMOD_SYSTEM *system, FMOD_DSP *dsp, FMOD_DSPCONNECTION **connection);\nFMOD_RESULT F_API FMOD_System_LockDSP                (FMOD_SYSTEM *system);\nFMOD_RESULT F_API FMOD_System_UnlockDSP              (FMOD_SYSTEM *system);\nFMOD_RESULT F_API FMOD_System_GetDSPClock            (FMOD_SYSTEM *system, unsigned int *hi, unsigned int *lo);\n\n/*\n     Recording API.\n*/\n\nFMOD_RESULT F_API FMOD_System_GetRecordNumDrivers    (FMOD_SYSTEM *system, int *numdrivers);\nFMOD_RESULT F_API FMOD_System_GetRecordDriverInfo    (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetRecordDriverInfoW   (FMOD_SYSTEM *system, int id, short *name, int namelen, FMOD_GUID *guid);\nFMOD_RESULT F_API FMOD_System_GetRecordDriverCaps    (FMOD_SYSTEM *system, int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency);\nFMOD_RESULT F_API FMOD_System_GetRecordPosition      (FMOD_SYSTEM *system, int id, unsigned int *position);\n\nFMOD_RESULT F_API FMOD_System_RecordStart            (FMOD_SYSTEM *system, int id, FMOD_SOUND *sound, FMOD_BOOL loop);\nFMOD_RESULT F_API FMOD_System_RecordStop             (FMOD_SYSTEM *system, int id);\nFMOD_RESULT F_API FMOD_System_IsRecording            (FMOD_SYSTEM *system, int id, FMOD_BOOL *recording);\n\n/*\n     Geometry API.\n*/\n\nFMOD_RESULT F_API FMOD_System_CreateGeometry         (FMOD_SYSTEM *system, int maxpolygons, int maxvertices, FMOD_GEOMETRY **geometry);\nFMOD_RESULT F_API FMOD_System_SetGeometrySettings    (FMOD_SYSTEM *system, float maxworldsize);\nFMOD_RESULT F_API FMOD_System_GetGeometrySettings    (FMOD_SYSTEM *system, float *maxworldsize);\nFMOD_RESULT F_API FMOD_System_LoadGeometry           (FMOD_SYSTEM *system, const void *data, int datasize, FMOD_GEOMETRY **geometry);\nFMOD_RESULT F_API FMOD_System_GetGeometryOcclusion   (FMOD_SYSTEM *system, const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);\n\n/*\n     Network functions.\n*/\n\nFMOD_RESULT F_API FMOD_System_SetNetworkProxy        (FMOD_SYSTEM *system, const char *proxy);\nFMOD_RESULT F_API FMOD_System_GetNetworkProxy        (FMOD_SYSTEM *system, char *proxy, int proxylen);\nFMOD_RESULT F_API FMOD_System_SetNetworkTimeout      (FMOD_SYSTEM *system, int timeout);\nFMOD_RESULT F_API FMOD_System_GetNetworkTimeout      (FMOD_SYSTEM *system, int *timeout);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_System_SetUserData            (FMOD_SYSTEM *system, void *userdata);\nFMOD_RESULT F_API FMOD_System_GetUserData            (FMOD_SYSTEM *system, void **userdata);\n\nFMOD_RESULT F_API FMOD_System_GetMemoryInfo          (FMOD_SYSTEM *system, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Sound' API\n*/\n\nFMOD_RESULT F_API FMOD_Sound_Release                 (FMOD_SOUND *sound);\nFMOD_RESULT F_API FMOD_Sound_GetSystemObject         (FMOD_SOUND *sound, FMOD_SYSTEM **system);\n\n/*\n     Standard sound manipulation functions.                                                \n*/\n\nFMOD_RESULT F_API FMOD_Sound_Lock                    (FMOD_SOUND *sound, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);\nFMOD_RESULT F_API FMOD_Sound_Unlock                  (FMOD_SOUND *sound, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);\nFMOD_RESULT F_API FMOD_Sound_SetDefaults             (FMOD_SOUND *sound, float frequency, float volume, float pan, int priority);\nFMOD_RESULT F_API FMOD_Sound_GetDefaults             (FMOD_SOUND *sound, float *frequency, float *volume, float *pan, int *priority);\nFMOD_RESULT F_API FMOD_Sound_SetVariations           (FMOD_SOUND *sound, float frequencyvar, float volumevar, float panvar);\nFMOD_RESULT F_API FMOD_Sound_GetVariations           (FMOD_SOUND *sound, float *frequencyvar, float *volumevar, float *panvar);\nFMOD_RESULT F_API FMOD_Sound_Set3DMinMaxDistance     (FMOD_SOUND *sound, float min, float max);\nFMOD_RESULT F_API FMOD_Sound_Get3DMinMaxDistance     (FMOD_SOUND *sound, float *min, float *max);\nFMOD_RESULT F_API FMOD_Sound_Set3DConeSettings       (FMOD_SOUND *sound, float insideconeangle, float outsideconeangle, float outsidevolume);\nFMOD_RESULT F_API FMOD_Sound_Get3DConeSettings       (FMOD_SOUND *sound, float *insideconeangle, float *outsideconeangle, float *outsidevolume);\nFMOD_RESULT F_API FMOD_Sound_Set3DCustomRolloff      (FMOD_SOUND *sound, FMOD_VECTOR *points, int numpoints);\nFMOD_RESULT F_API FMOD_Sound_Get3DCustomRolloff      (FMOD_SOUND *sound, FMOD_VECTOR **points, int *numpoints);\nFMOD_RESULT F_API FMOD_Sound_SetSubSound             (FMOD_SOUND *sound, int index, FMOD_SOUND *subsound);\nFMOD_RESULT F_API FMOD_Sound_GetSubSound             (FMOD_SOUND *sound, int index, FMOD_SOUND **subsound);\nFMOD_RESULT F_API FMOD_Sound_SetSubSoundSentence     (FMOD_SOUND *sound, int *subsoundlist, int numsubsounds);\nFMOD_RESULT F_API FMOD_Sound_GetName                 (FMOD_SOUND *sound, char *name, int namelen);\nFMOD_RESULT F_API FMOD_Sound_GetLength               (FMOD_SOUND *sound, unsigned int *length, FMOD_TIMEUNIT lengthtype);\nFMOD_RESULT F_API FMOD_Sound_GetFormat               (FMOD_SOUND *sound, FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);\nFMOD_RESULT F_API FMOD_Sound_GetNumSubSounds         (FMOD_SOUND *sound, int *numsubsounds);\nFMOD_RESULT F_API FMOD_Sound_GetNumTags              (FMOD_SOUND *sound, int *numtags, int *numtagsupdated);\nFMOD_RESULT F_API FMOD_Sound_GetTag                  (FMOD_SOUND *sound, const char *name, int index, FMOD_TAG *tag);\nFMOD_RESULT F_API FMOD_Sound_GetOpenState            (FMOD_SOUND *sound, FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, FMOD_BOOL *starving, FMOD_BOOL *diskbusy);\nFMOD_RESULT F_API FMOD_Sound_ReadData                (FMOD_SOUND *sound, void *buffer, unsigned int lenbytes, unsigned int *read);\nFMOD_RESULT F_API FMOD_Sound_SeekData                (FMOD_SOUND *sound, unsigned int pcm);\n\nFMOD_RESULT F_API FMOD_Sound_SetSoundGroup           (FMOD_SOUND *sound, FMOD_SOUNDGROUP *soundgroup);\nFMOD_RESULT F_API FMOD_Sound_GetSoundGroup           (FMOD_SOUND *sound, FMOD_SOUNDGROUP **soundgroup);\n\n/*\n     Synchronization point API.  These points can come from markers embedded in wav files, and can also generate channel callbacks.        \n*/\n\nFMOD_RESULT F_API FMOD_Sound_GetNumSyncPoints        (FMOD_SOUND *sound, int *numsyncpoints);\nFMOD_RESULT F_API FMOD_Sound_GetSyncPoint            (FMOD_SOUND *sound, int index, FMOD_SYNCPOINT **point);\nFMOD_RESULT F_API FMOD_Sound_GetSyncPointInfo        (FMOD_SOUND *sound, FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);\nFMOD_RESULT F_API FMOD_Sound_AddSyncPoint            (FMOD_SOUND *sound, unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);\nFMOD_RESULT F_API FMOD_Sound_DeleteSyncPoint         (FMOD_SOUND *sound, FMOD_SYNCPOINT *point);\n\n/*\n     Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.\n*/\n\nFMOD_RESULT F_API FMOD_Sound_SetMode                 (FMOD_SOUND *sound, FMOD_MODE mode);\nFMOD_RESULT F_API FMOD_Sound_GetMode                 (FMOD_SOUND *sound, FMOD_MODE *mode);\nFMOD_RESULT F_API FMOD_Sound_SetLoopCount            (FMOD_SOUND *sound, int loopcount);\nFMOD_RESULT F_API FMOD_Sound_GetLoopCount            (FMOD_SOUND *sound, int *loopcount);\nFMOD_RESULT F_API FMOD_Sound_SetLoopPoints           (FMOD_SOUND *sound, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\nFMOD_RESULT F_API FMOD_Sound_GetLoopPoints           (FMOD_SOUND *sound, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n/*\n     For MOD/S3M/XM/IT/MID sequenced formats only.\n*/\n\nFMOD_RESULT F_API FMOD_Sound_GetMusicNumChannels     (FMOD_SOUND *sound, int *numchannels);\nFMOD_RESULT F_API FMOD_Sound_SetMusicChannelVolume   (FMOD_SOUND *sound, int channel, float volume);\nFMOD_RESULT F_API FMOD_Sound_GetMusicChannelVolume   (FMOD_SOUND *sound, int channel, float *volume);\nFMOD_RESULT F_API FMOD_Sound_SetMusicSpeed           (FMOD_SOUND *sound, float speed);\nFMOD_RESULT F_API FMOD_Sound_GetMusicSpeed           (FMOD_SOUND *sound, float *speed);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_Sound_SetUserData             (FMOD_SOUND *sound, void *userdata);\nFMOD_RESULT F_API FMOD_Sound_GetUserData             (FMOD_SOUND *sound, void **userdata);\n\nFMOD_RESULT F_API FMOD_Sound_GetMemoryInfo           (FMOD_SOUND *sound, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Channel' API\n*/\n\nFMOD_RESULT F_API FMOD_Channel_GetSystemObject       (FMOD_CHANNEL *channel, FMOD_SYSTEM **system);\n\nFMOD_RESULT F_API FMOD_Channel_Stop                  (FMOD_CHANNEL *channel);\nFMOD_RESULT F_API FMOD_Channel_SetPaused             (FMOD_CHANNEL *channel, FMOD_BOOL paused);\nFMOD_RESULT F_API FMOD_Channel_GetPaused             (FMOD_CHANNEL *channel, FMOD_BOOL *paused);\nFMOD_RESULT F_API FMOD_Channel_SetVolume             (FMOD_CHANNEL *channel, float volume);\nFMOD_RESULT F_API FMOD_Channel_GetVolume             (FMOD_CHANNEL *channel, float *volume);\nFMOD_RESULT F_API FMOD_Channel_SetFrequency          (FMOD_CHANNEL *channel, float frequency);\nFMOD_RESULT F_API FMOD_Channel_GetFrequency          (FMOD_CHANNEL *channel, float *frequency);\nFMOD_RESULT F_API FMOD_Channel_SetPan                (FMOD_CHANNEL *channel, float pan);\nFMOD_RESULT F_API FMOD_Channel_GetPan                (FMOD_CHANNEL *channel, float *pan);\nFMOD_RESULT F_API FMOD_Channel_SetDelay              (FMOD_CHANNEL *channel, FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo);\nFMOD_RESULT F_API FMOD_Channel_GetDelay              (FMOD_CHANNEL *channel, FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo);\nFMOD_RESULT F_API FMOD_Channel_SetSpeakerMix         (FMOD_CHANNEL *channel, float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\nFMOD_RESULT F_API FMOD_Channel_GetSpeakerMix         (FMOD_CHANNEL *channel, float *frontleft, float *frontright, float *center, float *lfe, float *backleft, float *backright, float *sideleft, float *sideright);\nFMOD_RESULT F_API FMOD_Channel_SetSpeakerLevels      (FMOD_CHANNEL *channel, FMOD_SPEAKER speaker, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_GetSpeakerLevels      (FMOD_CHANNEL *channel, FMOD_SPEAKER speaker, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_SetInputChannelMix    (FMOD_CHANNEL *channel, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_GetInputChannelMix    (FMOD_CHANNEL *channel, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_Channel_SetMute               (FMOD_CHANNEL *channel, FMOD_BOOL mute);\nFMOD_RESULT F_API FMOD_Channel_GetMute               (FMOD_CHANNEL *channel, FMOD_BOOL *mute);\nFMOD_RESULT F_API FMOD_Channel_SetPriority           (FMOD_CHANNEL *channel, int priority);\nFMOD_RESULT F_API FMOD_Channel_GetPriority           (FMOD_CHANNEL *channel, int *priority);\nFMOD_RESULT F_API FMOD_Channel_SetPosition           (FMOD_CHANNEL *channel, unsigned int position, FMOD_TIMEUNIT postype);\nFMOD_RESULT F_API FMOD_Channel_GetPosition           (FMOD_CHANNEL *channel, unsigned int *position, FMOD_TIMEUNIT postype);\nFMOD_RESULT F_API FMOD_Channel_SetReverbProperties   (FMOD_CHANNEL *channel, const FMOD_REVERB_CHANNELPROPERTIES *prop);\nFMOD_RESULT F_API FMOD_Channel_GetReverbProperties   (FMOD_CHANNEL *channel, FMOD_REVERB_CHANNELPROPERTIES *prop);\nFMOD_RESULT F_API FMOD_Channel_SetLowPassGain        (FMOD_CHANNEL *channel, float gain);\nFMOD_RESULT F_API FMOD_Channel_GetLowPassGain        (FMOD_CHANNEL *channel, float *gain);\n\nFMOD_RESULT F_API FMOD_Channel_SetChannelGroup       (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP *channelgroup);\nFMOD_RESULT F_API FMOD_Channel_GetChannelGroup       (FMOD_CHANNEL *channel, FMOD_CHANNELGROUP **channelgroup);\nFMOD_RESULT F_API FMOD_Channel_SetCallback           (FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACK callback);\n\n/*\n     3D functionality.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_Set3DAttributes       (FMOD_CHANNEL *channel, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\nFMOD_RESULT F_API FMOD_Channel_Get3DAttributes       (FMOD_CHANNEL *channel, FMOD_VECTOR *pos, FMOD_VECTOR *vel);\nFMOD_RESULT F_API FMOD_Channel_Set3DMinMaxDistance   (FMOD_CHANNEL *channel, float mindistance, float maxdistance);\nFMOD_RESULT F_API FMOD_Channel_Get3DMinMaxDistance   (FMOD_CHANNEL *channel, float *mindistance, float *maxdistance);\nFMOD_RESULT F_API FMOD_Channel_Set3DConeSettings     (FMOD_CHANNEL *channel, float insideconeangle, float outsideconeangle, float outsidevolume);\nFMOD_RESULT F_API FMOD_Channel_Get3DConeSettings     (FMOD_CHANNEL *channel, float *insideconeangle, float *outsideconeangle, float *outsidevolume);\nFMOD_RESULT F_API FMOD_Channel_Set3DConeOrientation  (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);\nFMOD_RESULT F_API FMOD_Channel_Get3DConeOrientation  (FMOD_CHANNEL *channel, FMOD_VECTOR *orientation);\nFMOD_RESULT F_API FMOD_Channel_Set3DCustomRolloff    (FMOD_CHANNEL *channel, FMOD_VECTOR *points, int numpoints);\nFMOD_RESULT F_API FMOD_Channel_Get3DCustomRolloff    (FMOD_CHANNEL *channel, FMOD_VECTOR **points, int *numpoints);\nFMOD_RESULT F_API FMOD_Channel_Set3DOcclusion        (FMOD_CHANNEL *channel, float directocclusion, float reverbocclusion);\nFMOD_RESULT F_API FMOD_Channel_Get3DOcclusion        (FMOD_CHANNEL *channel, float *directocclusion, float *reverbocclusion);\nFMOD_RESULT F_API FMOD_Channel_Set3DSpread           (FMOD_CHANNEL *channel, float angle);\nFMOD_RESULT F_API FMOD_Channel_Get3DSpread           (FMOD_CHANNEL *channel, float *angle);\nFMOD_RESULT F_API FMOD_Channel_Set3DPanLevel         (FMOD_CHANNEL *channel, float level);\nFMOD_RESULT F_API FMOD_Channel_Get3DPanLevel         (FMOD_CHANNEL *channel, float *level);\nFMOD_RESULT F_API FMOD_Channel_Set3DDopplerLevel     (FMOD_CHANNEL *channel, float level);\nFMOD_RESULT F_API FMOD_Channel_Get3DDopplerLevel     (FMOD_CHANNEL *channel, float *level);\nFMOD_RESULT F_API FMOD_Channel_Set3DDistanceFilter   (FMOD_CHANNEL *channel, FMOD_BOOL custom, float customLevel, float centerFreq);\nFMOD_RESULT F_API FMOD_Channel_Get3DDistanceFilter   (FMOD_CHANNEL *channel, FMOD_BOOL *custom, float *customLevel, float *centerFreq);\n\n/*\n     DSP functionality only for channels playing sounds created with FMOD_SOFTWARE.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_GetDSPHead            (FMOD_CHANNEL *channel, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_Channel_AddDSP                (FMOD_CHANNEL *channel, FMOD_DSP *dsp, FMOD_DSPCONNECTION **connection);\n\n/*\n     Information only functions.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_IsPlaying             (FMOD_CHANNEL *channel, FMOD_BOOL *isplaying);\nFMOD_RESULT F_API FMOD_Channel_IsVirtual             (FMOD_CHANNEL *channel, FMOD_BOOL *isvirtual);\nFMOD_RESULT F_API FMOD_Channel_GetAudibility         (FMOD_CHANNEL *channel, float *audibility);\nFMOD_RESULT F_API FMOD_Channel_GetCurrentSound       (FMOD_CHANNEL *channel, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_Channel_GetSpectrum           (FMOD_CHANNEL *channel, float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\nFMOD_RESULT F_API FMOD_Channel_GetWaveData           (FMOD_CHANNEL *channel, float *wavearray, int numvalues, int channeloffset);\nFMOD_RESULT F_API FMOD_Channel_GetIndex              (FMOD_CHANNEL *channel, int *index);\n\n/*\n     Functions also found in Sound class but here they can be set per channel.\n*/\n\nFMOD_RESULT F_API FMOD_Channel_SetMode               (FMOD_CHANNEL *channel, FMOD_MODE mode);\nFMOD_RESULT F_API FMOD_Channel_GetMode               (FMOD_CHANNEL *channel, FMOD_MODE *mode);\nFMOD_RESULT F_API FMOD_Channel_SetLoopCount          (FMOD_CHANNEL *channel, int loopcount);\nFMOD_RESULT F_API FMOD_Channel_GetLoopCount          (FMOD_CHANNEL *channel, int *loopcount);\nFMOD_RESULT F_API FMOD_Channel_SetLoopPoints         (FMOD_CHANNEL *channel, unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\nFMOD_RESULT F_API FMOD_Channel_GetLoopPoints         (FMOD_CHANNEL *channel, unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n/*\n     Userdata set/get.                                                \n*/\n\nFMOD_RESULT F_API FMOD_Channel_SetUserData           (FMOD_CHANNEL *channel, void *userdata);\nFMOD_RESULT F_API FMOD_Channel_GetUserData           (FMOD_CHANNEL *channel, void **userdata);\n\nFMOD_RESULT F_API FMOD_Channel_GetMemoryInfo         (FMOD_CHANNEL *channel, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'ChannelGroup' API\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_Release          (FMOD_CHANNELGROUP *channelgroup);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetSystemObject  (FMOD_CHANNELGROUP *channelgroup, FMOD_SYSTEM **system);\n\n/*\n     Channelgroup scale values.  (changes attributes relative to the channels, doesn't overwrite them)\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_SetVolume        (FMOD_CHANNELGROUP *channelgroup, float volume);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetVolume        (FMOD_CHANNELGROUP *channelgroup, float *volume);\nFMOD_RESULT F_API FMOD_ChannelGroup_SetPitch         (FMOD_CHANNELGROUP *channelgroup, float pitch);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetPitch         (FMOD_CHANNELGROUP *channelgroup, float *pitch);\nFMOD_RESULT F_API FMOD_ChannelGroup_Set3DOcclusion   (FMOD_CHANNELGROUP *channelgroup, float directocclusion, float reverbocclusion);\nFMOD_RESULT F_API FMOD_ChannelGroup_Get3DOcclusion   (FMOD_CHANNELGROUP *channelgroup, float *directocclusion, float *reverbocclusion);\nFMOD_RESULT F_API FMOD_ChannelGroup_SetPaused        (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL paused);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetPaused        (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *paused);\nFMOD_RESULT F_API FMOD_ChannelGroup_SetMute          (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL mute);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetMute          (FMOD_CHANNELGROUP *channelgroup, FMOD_BOOL *mute);\n\n/*\n     Channelgroup override values.  (recursively overwrites whatever settings the channels had)\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_Stop             (FMOD_CHANNELGROUP *channelgroup);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideVolume   (FMOD_CHANNELGROUP *channelgroup, float volume);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideFrequency(FMOD_CHANNELGROUP *channelgroup, float frequency);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverridePan      (FMOD_CHANNELGROUP *channelgroup, float pan);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideReverbProperties(FMOD_CHANNELGROUP *channelgroup, const FMOD_REVERB_CHANNELPROPERTIES *prop);\nFMOD_RESULT F_API FMOD_ChannelGroup_Override3DAttributes(FMOD_CHANNELGROUP *channelgroup, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\nFMOD_RESULT F_API FMOD_ChannelGroup_OverrideSpeakerMix(FMOD_CHANNELGROUP *channelgroup, float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\n\n/*\n     Nested channel groups.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_AddGroup         (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP *group);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetNumGroups     (FMOD_CHANNELGROUP *channelgroup, int *numgroups);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetGroup         (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNELGROUP **group);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetParentGroup   (FMOD_CHANNELGROUP *channelgroup, FMOD_CHANNELGROUP **group);\n\n/*\n     DSP functionality only for channel groups playing sounds created with FMOD_SOFTWARE.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_GetDSPHead       (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP **dsp);\nFMOD_RESULT F_API FMOD_ChannelGroup_AddDSP           (FMOD_CHANNELGROUP *channelgroup, FMOD_DSP *dsp, FMOD_DSPCONNECTION **connection);\n\n/*\n     Information only functions.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_GetName          (FMOD_CHANNELGROUP *channelgroup, char *name, int namelen);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetNumChannels   (FMOD_CHANNELGROUP *channelgroup, int *numchannels);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetChannel       (FMOD_CHANNELGROUP *channelgroup, int index, FMOD_CHANNEL **channel);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetSpectrum      (FMOD_CHANNELGROUP *channelgroup, float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetWaveData      (FMOD_CHANNELGROUP *channelgroup, float *wavearray, int numvalues, int channeloffset);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_ChannelGroup_SetUserData      (FMOD_CHANNELGROUP *channelgroup, void *userdata);\nFMOD_RESULT F_API FMOD_ChannelGroup_GetUserData      (FMOD_CHANNELGROUP *channelgroup, void **userdata);\n\nFMOD_RESULT F_API FMOD_ChannelGroup_GetMemoryInfo    (FMOD_CHANNELGROUP *channelgroup, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'SoundGroup' API\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_Release            (FMOD_SOUNDGROUP *soundgroup);\nFMOD_RESULT F_API FMOD_SoundGroup_GetSystemObject    (FMOD_SOUNDGROUP *soundgroup, FMOD_SYSTEM **system);\n\n/*\n     SoundGroup control functions.\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudible      (FMOD_SOUNDGROUP *soundgroup, int maxaudible);\nFMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudible      (FMOD_SOUNDGROUP *soundgroup, int *maxaudible);\nFMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior(FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior);\nFMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior(FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);\nFMOD_RESULT F_API FMOD_SoundGroup_SetMuteFadeSpeed   (FMOD_SOUNDGROUP *soundgroup, float speed);\nFMOD_RESULT F_API FMOD_SoundGroup_GetMuteFadeSpeed   (FMOD_SOUNDGROUP *soundgroup, float *speed);\nFMOD_RESULT F_API FMOD_SoundGroup_SetVolume          (FMOD_SOUNDGROUP *soundgroup, float volume);\nFMOD_RESULT F_API FMOD_SoundGroup_GetVolume          (FMOD_SOUNDGROUP *soundgroup, float *volume);\nFMOD_RESULT F_API FMOD_SoundGroup_Stop               (FMOD_SOUNDGROUP *soundgroup);\n\n/*\n     Information only functions.\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_GetName            (FMOD_SOUNDGROUP *soundgroup, char *name, int namelen);\nFMOD_RESULT F_API FMOD_SoundGroup_GetNumSounds       (FMOD_SOUNDGROUP *soundgroup, int *numsounds);\nFMOD_RESULT F_API FMOD_SoundGroup_GetSound           (FMOD_SOUNDGROUP *soundgroup, int index, FMOD_SOUND **sound);\nFMOD_RESULT F_API FMOD_SoundGroup_GetNumPlaying      (FMOD_SOUNDGROUP *soundgroup, int *numplaying);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_SoundGroup_SetUserData        (FMOD_SOUNDGROUP *soundgroup, void *userdata);\nFMOD_RESULT F_API FMOD_SoundGroup_GetUserData        (FMOD_SOUNDGROUP *soundgroup, void **userdata);\n\nFMOD_RESULT F_API FMOD_SoundGroup_GetMemoryInfo      (FMOD_SOUNDGROUP *soundgroup, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'DSP' API\n*/\n\nFMOD_RESULT F_API FMOD_DSP_Release                   (FMOD_DSP *dsp);\nFMOD_RESULT F_API FMOD_DSP_GetSystemObject           (FMOD_DSP *dsp, FMOD_SYSTEM **system);\n\n/*\n     Connection / disconnection / input and output enumeration.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_AddInput                  (FMOD_DSP *dsp, FMOD_DSP *target, FMOD_DSPCONNECTION **connection);\nFMOD_RESULT F_API FMOD_DSP_DisconnectFrom            (FMOD_DSP *dsp, FMOD_DSP *target);\nFMOD_RESULT F_API FMOD_DSP_DisconnectAll             (FMOD_DSP *dsp, FMOD_BOOL inputs, FMOD_BOOL outputs);\nFMOD_RESULT F_API FMOD_DSP_Remove                    (FMOD_DSP *dsp);\nFMOD_RESULT F_API FMOD_DSP_GetNumInputs              (FMOD_DSP *dsp, int *numinputs);\nFMOD_RESULT F_API FMOD_DSP_GetNumOutputs             (FMOD_DSP *dsp, int *numoutputs);\nFMOD_RESULT F_API FMOD_DSP_GetInput                  (FMOD_DSP *dsp, int index, FMOD_DSP **input, FMOD_DSPCONNECTION **inputconnection);\nFMOD_RESULT F_API FMOD_DSP_GetOutput                 (FMOD_DSP *dsp, int index, FMOD_DSP **output, FMOD_DSPCONNECTION **outputconnection);\n\n/*\n     DSP unit control.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_SetActive                 (FMOD_DSP *dsp, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_DSP_GetActive                 (FMOD_DSP *dsp, FMOD_BOOL *active);\nFMOD_RESULT F_API FMOD_DSP_SetBypass                 (FMOD_DSP *dsp, FMOD_BOOL bypass);\nFMOD_RESULT F_API FMOD_DSP_GetBypass                 (FMOD_DSP *dsp, FMOD_BOOL *bypass);\nFMOD_RESULT F_API FMOD_DSP_SetSpeakerActive          (FMOD_DSP *dsp, FMOD_SPEAKER speaker, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_DSP_GetSpeakerActive          (FMOD_DSP *dsp, FMOD_SPEAKER speaker, FMOD_BOOL *active);\nFMOD_RESULT F_API FMOD_DSP_Reset                     (FMOD_DSP *dsp);\n\n/*\n     DSP parameter control.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_SetParameter              (FMOD_DSP *dsp, int index, float value);\nFMOD_RESULT F_API FMOD_DSP_GetParameter              (FMOD_DSP *dsp, int index, float *value, char *valuestr, int valuestrlen);\nFMOD_RESULT F_API FMOD_DSP_GetNumParameters          (FMOD_DSP *dsp, int *numparams);\nFMOD_RESULT F_API FMOD_DSP_GetParameterInfo          (FMOD_DSP *dsp, int index, char *name, char *label, char *description, int descriptionlen, float *min, float *max);\nFMOD_RESULT F_API FMOD_DSP_ShowConfigDialog          (FMOD_DSP *dsp, void *hwnd, FMOD_BOOL show);\n\n/*\n     DSP attributes.        \n*/\n\nFMOD_RESULT F_API FMOD_DSP_GetInfo                   (FMOD_DSP *dsp, char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);\nFMOD_RESULT F_API FMOD_DSP_GetType                   (FMOD_DSP *dsp, FMOD_DSP_TYPE *type);\nFMOD_RESULT F_API FMOD_DSP_SetDefaults               (FMOD_DSP *dsp, float frequency, float volume, float pan, int priority);\nFMOD_RESULT F_API FMOD_DSP_GetDefaults               (FMOD_DSP *dsp, float *frequency, float *volume, float *pan, int *priority);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_DSP_SetUserData               (FMOD_DSP *dsp, void *userdata);\nFMOD_RESULT F_API FMOD_DSP_GetUserData               (FMOD_DSP *dsp, void **userdata);\n\nFMOD_RESULT F_API FMOD_DSP_GetMemoryInfo             (FMOD_DSP *dsp, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'DSPConnection' API\n*/\n\nFMOD_RESULT F_API FMOD_DSPConnection_GetInput        (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **input);\nFMOD_RESULT F_API FMOD_DSPConnection_GetOutput       (FMOD_DSPCONNECTION *dspconnection, FMOD_DSP **output);\nFMOD_RESULT F_API FMOD_DSPConnection_SetMix          (FMOD_DSPCONNECTION *dspconnection, float volume);\nFMOD_RESULT F_API FMOD_DSPConnection_GetMix          (FMOD_DSPCONNECTION *dspconnection, float *volume);\nFMOD_RESULT F_API FMOD_DSPConnection_SetLevels       (FMOD_DSPCONNECTION *dspconnection, FMOD_SPEAKER speaker, float *levels, int numlevels);\nFMOD_RESULT F_API FMOD_DSPConnection_GetLevels       (FMOD_DSPCONNECTION *dspconnection, FMOD_SPEAKER speaker, float *levels, int numlevels);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_DSPConnection_SetUserData     (FMOD_DSPCONNECTION *dspconnection, void *userdata);\nFMOD_RESULT F_API FMOD_DSPConnection_GetUserData     (FMOD_DSPCONNECTION *dspconnection, void **userdata);\n\nFMOD_RESULT F_API FMOD_DSPConnection_GetMemoryInfo   (FMOD_DSPCONNECTION *dspconnection, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Geometry' API\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_Release              (FMOD_GEOMETRY *geometry);\n\n/*\n     Polygon manipulation.\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_AddPolygon           (FMOD_GEOMETRY *geometry, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);\nFMOD_RESULT F_API FMOD_Geometry_GetNumPolygons       (FMOD_GEOMETRY *geometry, int *numpolygons);\nFMOD_RESULT F_API FMOD_Geometry_GetMaxPolygons       (FMOD_GEOMETRY *geometry, int *maxpolygons, int *maxvertices);\nFMOD_RESULT F_API FMOD_Geometry_GetPolygonNumVertices(FMOD_GEOMETRY *geometry, int index, int *numvertices);\nFMOD_RESULT F_API FMOD_Geometry_SetPolygonVertex     (FMOD_GEOMETRY *geometry, int index, int vertexindex, const FMOD_VECTOR *vertex);\nFMOD_RESULT F_API FMOD_Geometry_GetPolygonVertex     (FMOD_GEOMETRY *geometry, int index, int vertexindex, FMOD_VECTOR *vertex);\nFMOD_RESULT F_API FMOD_Geometry_SetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float directocclusion, float reverbocclusion, FMOD_BOOL doublesided);\nFMOD_RESULT F_API FMOD_Geometry_GetPolygonAttributes (FMOD_GEOMETRY *geometry, int index, float *directocclusion, float *reverbocclusion, FMOD_BOOL *doublesided);\n\n/*\n     Object manipulation.\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_SetActive            (FMOD_GEOMETRY *geometry, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_Geometry_GetActive            (FMOD_GEOMETRY *geometry, FMOD_BOOL *active);\nFMOD_RESULT F_API FMOD_Geometry_SetRotation          (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_Geometry_GetRotation          (FMOD_GEOMETRY *geometry, FMOD_VECTOR *forward, FMOD_VECTOR *up);\nFMOD_RESULT F_API FMOD_Geometry_SetPosition          (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *position);\nFMOD_RESULT F_API FMOD_Geometry_GetPosition          (FMOD_GEOMETRY *geometry, FMOD_VECTOR *position);\nFMOD_RESULT F_API FMOD_Geometry_SetScale             (FMOD_GEOMETRY *geometry, const FMOD_VECTOR *scale);\nFMOD_RESULT F_API FMOD_Geometry_GetScale             (FMOD_GEOMETRY *geometry, FMOD_VECTOR *scale);\nFMOD_RESULT F_API FMOD_Geometry_Save                 (FMOD_GEOMETRY *geometry, void *data, int *datasize);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_Geometry_SetUserData          (FMOD_GEOMETRY *geometry, void *userdata);\nFMOD_RESULT F_API FMOD_Geometry_GetUserData          (FMOD_GEOMETRY *geometry, void **userdata);\n\nFMOD_RESULT F_API FMOD_Geometry_GetMemoryInfo        (FMOD_GEOMETRY *geometry, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n\n/*\n    'Reverb' API\n*/\n\nFMOD_RESULT F_API FMOD_Reverb_Release                (FMOD_REVERB *reverb);\n\n/*\n     Reverb manipulation.\n*/\n\nFMOD_RESULT F_API FMOD_Reverb_Set3DAttributes        (FMOD_REVERB *reverb, const FMOD_VECTOR *position, float mindistance, float maxdistance);\nFMOD_RESULT F_API FMOD_Reverb_Get3DAttributes        (FMOD_REVERB *reverb, FMOD_VECTOR *position, float *mindistance, float *maxdistance);\nFMOD_RESULT F_API FMOD_Reverb_SetProperties          (FMOD_REVERB *reverb, const FMOD_REVERB_PROPERTIES *properties);\nFMOD_RESULT F_API FMOD_Reverb_GetProperties          (FMOD_REVERB *reverb, FMOD_REVERB_PROPERTIES *properties);\nFMOD_RESULT F_API FMOD_Reverb_SetActive              (FMOD_REVERB *reverb, FMOD_BOOL active);\nFMOD_RESULT F_API FMOD_Reverb_GetActive              (FMOD_REVERB *reverb, FMOD_BOOL *active);\n\n/*\n     Userdata set/get.\n*/\n\nFMOD_RESULT F_API FMOD_Reverb_SetUserData            (FMOD_REVERB *reverb, void *userdata);\nFMOD_RESULT F_API FMOD_Reverb_GetUserData            (FMOD_REVERB *reverb, void **userdata);\n\nFMOD_RESULT F_API FMOD_Reverb_GetMemoryInfo          (FMOD_REVERB *reverb, unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n/*$ preserve start $*/\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n/*$ preserve end $*/\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmod.hpp",
    "content": "/* ========================================================================================== */\n/* FMOD Ex - C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011.      */\n/*                                                                                            */\n/* Use this header in conjunction with fmod.h (which contains all the constants / callbacks)  */\n/* to develop using C++ classes.                                                              */\n/* ========================================================================================== */\n\n#ifndef _FMOD_HPP\n#define _FMOD_HPP\n\n#include \"fmod.h\"\n\n/*\n    Constant and defines\n*/\n\n/*\n    FMOD Namespace\n*/\nnamespace FMOD\n{\n    class System;\n    class Sound;\n    class Channel;\n    class ChannelGroup;\n    class SoundGroup;\n    class Reverb;\n    class DSP;\n    class DSPConnection;\n    class Geometry;\n\n    /*\n        FMOD global system functions (optional).\n    */\n    inline FMOD_RESULT Memory_Initialize(void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = FMOD_MEMORY_ALL) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }\n    inline FMOD_RESULT Memory_GetStats  (int *currentalloced, int *maxalloced, bool blocking = true) { return FMOD_Memory_GetStats(currentalloced, maxalloced, blocking); }\n    inline FMOD_RESULT Debug_SetLevel(FMOD_DEBUGLEVEL level)  { return FMOD_Debug_SetLevel(level); }\n    inline FMOD_RESULT Debug_GetLevel(FMOD_DEBUGLEVEL *level) { return FMOD_Debug_GetLevel(level); }\n    inline FMOD_RESULT File_SetDiskBusy(int busy) { return FMOD_File_SetDiskBusy(busy); }\n    inline FMOD_RESULT File_GetDiskBusy(int *busy) { return FMOD_File_GetDiskBusy(busy); }\n\n    /*\n        FMOD System factory functions.\n    */\n    inline FMOD_RESULT System_Create(System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }\n\n    /*\n       'System' API\n    */\n\n    class System\n    {\n      private:\n\n        System();   /* Constructor made private so user cannot statically instance a System class.  \n                       System_Create must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n                                                 \n        // Pre-init functions.\n        FMOD_RESULT F_API setOutput              (FMOD_OUTPUTTYPE output);\n        FMOD_RESULT F_API getOutput              (FMOD_OUTPUTTYPE *output);\n        FMOD_RESULT F_API getNumDrivers          (int *numdrivers);\n        FMOD_RESULT F_API getDriverInfo          (int id, char *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getDriverInfoW         (int id, short *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getDriverCaps          (int id, FMOD_CAPS *caps, int *controlpaneloutputrate, FMOD_SPEAKERMODE *controlpanelspeakermode);\n        FMOD_RESULT F_API setDriver              (int driver);\n        FMOD_RESULT F_API getDriver              (int *driver);\n        FMOD_RESULT F_API setHardwareChannels    (int numhardwarechannels);\n        FMOD_RESULT F_API setSoftwareChannels    (int numsoftwarechannels);\n        FMOD_RESULT F_API getSoftwareChannels    (int *numsoftwarechannels);\n        FMOD_RESULT F_API setSoftwareFormat      (int samplerate, FMOD_SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, FMOD_DSP_RESAMPLER resamplemethod);\n        FMOD_RESULT F_API getSoftwareFormat      (int *samplerate, FMOD_SOUND_FORMAT *format, int *numoutputchannels, int *maxinputchannels, FMOD_DSP_RESAMPLER *resamplemethod, int *bits);\n        FMOD_RESULT F_API setDSPBufferSize       (unsigned int bufferlength, int numbuffers);\n        FMOD_RESULT F_API getDSPBufferSize       (unsigned int *bufferlength, int *numbuffers);\n        FMOD_RESULT F_API setFileSystem          (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, FMOD_FILE_ASYNCREADCALLBACK userasyncread, FMOD_FILE_ASYNCCANCELCALLBACK userasynccancel, int blockalign);\n        FMOD_RESULT F_API attachFileSystem       (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek);\n        FMOD_RESULT F_API setAdvancedSettings    (FMOD_ADVANCEDSETTINGS *settings);\n        FMOD_RESULT F_API getAdvancedSettings    (FMOD_ADVANCEDSETTINGS *settings);\n        FMOD_RESULT F_API setSpeakerMode         (FMOD_SPEAKERMODE speakermode);\n        FMOD_RESULT F_API getSpeakerMode         (FMOD_SPEAKERMODE *speakermode);\n        FMOD_RESULT F_API setCallback            (FMOD_SYSTEM_CALLBACK callback);\n                                                \n        // Plug-in support                       \n        FMOD_RESULT F_API setPluginPath          (const char *path);\n        FMOD_RESULT F_API loadPlugin             (const char *filename, unsigned int *handle, unsigned int priority = 0);\n        FMOD_RESULT F_API unloadPlugin           (unsigned int handle);\n        FMOD_RESULT F_API getNumPlugins          (FMOD_PLUGINTYPE plugintype, int *numplugins);\n        FMOD_RESULT F_API getPluginHandle        (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle);\n        FMOD_RESULT F_API getPluginInfo          (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version);\n        FMOD_RESULT F_API setOutputByPlugin      (unsigned int handle);\n        FMOD_RESULT F_API getOutputByPlugin      (unsigned int *handle);\n        FMOD_RESULT F_API createDSPByPlugin      (unsigned int handle, DSP **dsp);\n        FMOD_RESULT F_API createCodec            (FMOD_CODEC_DESCRIPTION *description, unsigned int priority = 0);\n                                                 \n        // Init/Close                            \n        FMOD_RESULT F_API init                   (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata);\n        FMOD_RESULT F_API close                  ();\n                                                 \n        // General post-init system functions    \n        FMOD_RESULT F_API update                 ();        /* IMPORTANT! CALL THIS ONCE PER FRAME! */\n                                                 \n        FMOD_RESULT F_API set3DSettings          (float dopplerscale, float distancefactor, float rolloffscale);\n        FMOD_RESULT F_API get3DSettings          (float *dopplerscale, float *distancefactor, float *rolloffscale);\n        FMOD_RESULT F_API set3DNumListeners      (int numlisteners);\n        FMOD_RESULT F_API get3DNumListeners      (int *numlisteners);\n        FMOD_RESULT F_API set3DListenerAttributes(int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\n        FMOD_RESULT F_API get3DListenerAttributes(int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up);\n        FMOD_RESULT F_API set3DRolloffCallback   (FMOD_3D_ROLLOFFCALLBACK callback);\n        FMOD_RESULT F_API set3DSpeakerPosition   (FMOD_SPEAKER speaker, float x, float y, bool active);\n        FMOD_RESULT F_API get3DSpeakerPosition   (FMOD_SPEAKER speaker, float *x, float *y, bool *active);\n\n        FMOD_RESULT F_API setStreamBufferSize    (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype);\n        FMOD_RESULT F_API getStreamBufferSize    (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype);\n                                                \n        // System information functions.        \n        FMOD_RESULT F_API getVersion             (unsigned int *version);\n        FMOD_RESULT F_API getOutputHandle        (void **handle);\n        FMOD_RESULT F_API getChannelsPlaying     (int *channels);\n        FMOD_RESULT F_API getHardwareChannels    (int *numhardwarechannels);\n        FMOD_RESULT F_API getCPUUsage            (float *dsp, float *stream, float *geometry, float *update, float *total);\n        FMOD_RESULT F_API getSoundRAM            (int *currentalloced, int *maxalloced, int *total);\n        FMOD_RESULT F_API getNumCDROMDrives      (int *numdrives);\n        FMOD_RESULT F_API getCDROMDriveName      (int drive, char *drivename, int drivenamelen, char *scsiname, int scsinamelen, char *devicename, int devicenamelen);\n        FMOD_RESULT F_API getSpectrum            (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\n        FMOD_RESULT F_API getWaveData            (float *wavearray, int numvalues, int channeloffset);\n                                                \n        // Sound/DSP/Channel/FX creation and retrieval.       \n        FMOD_RESULT F_API createSound            (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);\n        FMOD_RESULT F_API createStream           (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);\n        FMOD_RESULT F_API createDSP              (FMOD_DSP_DESCRIPTION *description, DSP **dsp);\n        FMOD_RESULT F_API createDSPByType        (FMOD_DSP_TYPE type, DSP **dsp);\n        FMOD_RESULT F_API createChannelGroup     (const char *name, ChannelGroup **channelgroup);\n        FMOD_RESULT F_API createSoundGroup       (const char *name, SoundGroup **soundgroup);\n        FMOD_RESULT F_API createReverb           (Reverb **reverb); \n                                                \n        FMOD_RESULT F_API playSound              (FMOD_CHANNELINDEX channelid, Sound *sound, bool paused, Channel **channel);\n        FMOD_RESULT F_API playDSP                (FMOD_CHANNELINDEX channelid, DSP *dsp, bool paused, Channel **channel);\n        FMOD_RESULT F_API getChannel             (int channelid, Channel **channel);\n        FMOD_RESULT F_API getMasterChannelGroup  (ChannelGroup **channelgroup);\n        FMOD_RESULT F_API getMasterSoundGroup    (SoundGroup **soundgroup);\n                                              \n        // Reverb API                           \n        FMOD_RESULT F_API setReverbProperties    (const FMOD_REVERB_PROPERTIES *prop);\n        FMOD_RESULT F_API getReverbProperties    (FMOD_REVERB_PROPERTIES *prop);\n        FMOD_RESULT F_API setReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop);\n        FMOD_RESULT F_API getReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop);\n                                                 \n        // System level DSP access.\n        FMOD_RESULT F_API getDSPHead             (DSP **dsp);\n        FMOD_RESULT F_API addDSP                 (DSP *dsp, DSPConnection **connection);\n        FMOD_RESULT F_API lockDSP                ();\n        FMOD_RESULT F_API unlockDSP              ();\n        FMOD_RESULT F_API getDSPClock            (unsigned int *hi, unsigned int *lo);\n                                               \n        // Recording API.\n        FMOD_RESULT F_API getRecordNumDrivers    (int *numdrivers);\n        FMOD_RESULT F_API getRecordDriverInfo    (int id, char *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getRecordDriverInfoW   (int id, short *name, int namelen, FMOD_GUID *guid);\n        FMOD_RESULT F_API getRecordDriverCaps    (int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency);\n        FMOD_RESULT F_API getRecordPosition      (int id, unsigned int *position);  \n\n        FMOD_RESULT F_API recordStart            (int id, Sound *sound, bool loop);\n        FMOD_RESULT F_API recordStop             (int id);\n        FMOD_RESULT F_API isRecording            (int id, bool *recording);\n\n        // Geometry API.\n        FMOD_RESULT F_API createGeometry         (int maxpolygons, int maxvertices, Geometry **geometry);\n        FMOD_RESULT F_API setGeometrySettings    (float maxworldsize);\n        FMOD_RESULT F_API getGeometrySettings    (float *maxworldsize);\n        FMOD_RESULT F_API loadGeometry           (const void *data, int datasize, Geometry **geometry);\n        FMOD_RESULT F_API getGeometryOcclusion   (const FMOD_VECTOR *listener, const FMOD_VECTOR *source, float *direct, float *reverb);\n\n        // Network functions.\n        FMOD_RESULT F_API setNetworkProxy        (const char *proxy);\n        FMOD_RESULT F_API getNetworkProxy        (char *proxy, int proxylen);\n        FMOD_RESULT F_API setNetworkTimeout      (int timeout);\n        FMOD_RESULT F_API getNetworkTimeout      (int *timeout);\n                                              \n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'Sound' API\n    */\n    class Sound\n    {\n      private:\n\n        Sound();   /* Constructor made private so user cannot statically instance a Sound class.\n                      Appropriate Sound creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        // Standard sound manipulation functions.                                                \n        FMOD_RESULT F_API lock                   (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);\n        FMOD_RESULT F_API unlock                 (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);\n        FMOD_RESULT F_API setDefaults            (float frequency, float volume, float pan, int priority);\n        FMOD_RESULT F_API getDefaults            (float *frequency, float *volume, float *pan,  int *priority);\n        FMOD_RESULT F_API setVariations          (float frequencyvar, float volumevar, float panvar);\n        FMOD_RESULT F_API getVariations          (float *frequencyvar, float *volumevar, float *panvar);\n        FMOD_RESULT F_API set3DMinMaxDistance    (float min, float max);\n        FMOD_RESULT F_API get3DMinMaxDistance    (float *min, float *max);\n        FMOD_RESULT F_API set3DConeSettings      (float insideconeangle, float outsideconeangle, float outsidevolume);\n        FMOD_RESULT F_API get3DConeSettings      (float *insideconeangle, float *outsideconeangle, float *outsidevolume);\n        FMOD_RESULT F_API set3DCustomRolloff     (FMOD_VECTOR *points, int numpoints);\n        FMOD_RESULT F_API get3DCustomRolloff     (FMOD_VECTOR **points, int *numpoints);\n        FMOD_RESULT F_API setSubSound            (int index, Sound *subsound);\n        FMOD_RESULT F_API getSubSound            (int index, Sound **subsound);\n        FMOD_RESULT F_API setSubSoundSentence    (int *subsoundlist, int numsubsounds);\n        FMOD_RESULT F_API getName                (char *name, int namelen);\n        FMOD_RESULT F_API getLength              (unsigned int *length, FMOD_TIMEUNIT lengthtype);\n        FMOD_RESULT F_API getFormat              (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits);\n        FMOD_RESULT F_API getNumSubSounds        (int *numsubsounds);\n        FMOD_RESULT F_API getNumTags             (int *numtags, int *numtagsupdated);\n        FMOD_RESULT F_API getTag                 (const char *name, int index, FMOD_TAG *tag);\n        FMOD_RESULT F_API getOpenState           (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);\n        FMOD_RESULT F_API readData               (void *buffer, unsigned int lenbytes, unsigned int *read);\n        FMOD_RESULT F_API seekData               (unsigned int pcm);\n\n        FMOD_RESULT F_API setSoundGroup          (SoundGroup *soundgroup);\n        FMOD_RESULT F_API getSoundGroup          (SoundGroup **soundgroup);\n\n        // Synchronization point API.  These points can come from markers embedded in wav files, and can also generate channel callbacks.        \n        FMOD_RESULT F_API getNumSyncPoints       (int *numsyncpoints);\n        FMOD_RESULT F_API getSyncPoint           (int index, FMOD_SYNCPOINT **point);\n        FMOD_RESULT F_API getSyncPointInfo       (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype);\n        FMOD_RESULT F_API addSyncPoint           (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point);\n        FMOD_RESULT F_API deleteSyncPoint        (FMOD_SYNCPOINT *point);\n\n        // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.\n        FMOD_RESULT F_API setMode                (FMOD_MODE mode);\n        FMOD_RESULT F_API getMode                (FMOD_MODE *mode);\n        FMOD_RESULT F_API setLoopCount           (int loopcount);\n        FMOD_RESULT F_API getLoopCount           (int *loopcount);\n        FMOD_RESULT F_API setLoopPoints          (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\n        FMOD_RESULT F_API getLoopPoints          (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n        // For MOD/S3M/XM/IT/MID sequenced formats only.\n        FMOD_RESULT F_API getMusicNumChannels    (int *numchannels);\n        FMOD_RESULT F_API setMusicChannelVolume  (int channel, float volume);\n        FMOD_RESULT F_API getMusicChannelVolume  (int channel, float *volume);\n        FMOD_RESULT F_API setMusicSpeed          (float speed);\n        FMOD_RESULT F_API getMusicSpeed          (float *speed);\n                            \n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'Channel' API.\n    */ \n    class Channel\n    {\n      private:\n\n        Channel();   /* Constructor made private so user cannot statically instance a Channel class.  \n                        Appropriate Channel creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        FMOD_RESULT F_API stop                   ();\n        FMOD_RESULT F_API setPaused              (bool paused);\n        FMOD_RESULT F_API getPaused              (bool *paused);\n        FMOD_RESULT F_API setVolume              (float volume);\n        FMOD_RESULT F_API getVolume              (float *volume);\n        FMOD_RESULT F_API setFrequency           (float frequency);\n        FMOD_RESULT F_API getFrequency           (float *frequency);\n        FMOD_RESULT F_API setPan                 (float pan);\n        FMOD_RESULT F_API getPan                 (float *pan);\n        FMOD_RESULT F_API setDelay               (FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo);\n        FMOD_RESULT F_API getDelay               (FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo);\n        FMOD_RESULT F_API setSpeakerMix          (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\n        FMOD_RESULT F_API getSpeakerMix          (float *frontleft, float *frontright, float *center, float *lfe, float *backleft, float *backright, float *sideleft, float *sideright);\n        FMOD_RESULT F_API setSpeakerLevels       (FMOD_SPEAKER speaker, float *levels, int numlevels);\n        FMOD_RESULT F_API getSpeakerLevels       (FMOD_SPEAKER speaker, float *levels, int numlevels);\n        FMOD_RESULT F_API setInputChannelMix     (float *levels, int numlevels);\n        FMOD_RESULT F_API getInputChannelMix     (float *levels, int numlevels);\n        FMOD_RESULT F_API setMute                (bool mute);\n        FMOD_RESULT F_API getMute                (bool *mute);\n        FMOD_RESULT F_API setPriority            (int priority);\n        FMOD_RESULT F_API getPriority            (int *priority);\n        FMOD_RESULT F_API setPosition            (unsigned int position, FMOD_TIMEUNIT postype);\n        FMOD_RESULT F_API getPosition            (unsigned int *position, FMOD_TIMEUNIT postype);\n        FMOD_RESULT F_API setReverbProperties    (const FMOD_REVERB_CHANNELPROPERTIES *prop);\n        FMOD_RESULT F_API getReverbProperties    (FMOD_REVERB_CHANNELPROPERTIES *prop);\n        FMOD_RESULT F_API setLowPassGain         (float gain);\n        FMOD_RESULT F_API getLowPassGain         (float *gain);\n\n        FMOD_RESULT F_API setChannelGroup        (ChannelGroup *channelgroup);\n        FMOD_RESULT F_API getChannelGroup        (ChannelGroup **channelgroup);\n        FMOD_RESULT F_API setCallback            (FMOD_CHANNEL_CALLBACK callback);\n\n        // 3D functionality.\n        FMOD_RESULT F_API set3DAttributes        (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\n        FMOD_RESULT F_API get3DAttributes        (FMOD_VECTOR *pos, FMOD_VECTOR *vel);\n        FMOD_RESULT F_API set3DMinMaxDistance    (float mindistance, float maxdistance);\n        FMOD_RESULT F_API get3DMinMaxDistance    (float *mindistance, float *maxdistance);\n        FMOD_RESULT F_API set3DConeSettings      (float insideconeangle, float outsideconeangle, float outsidevolume);\n        FMOD_RESULT F_API get3DConeSettings      (float *insideconeangle, float *outsideconeangle, float *outsidevolume);\n        FMOD_RESULT F_API set3DConeOrientation   (FMOD_VECTOR *orientation);\n        FMOD_RESULT F_API get3DConeOrientation   (FMOD_VECTOR *orientation);\n        FMOD_RESULT F_API set3DCustomRolloff     (FMOD_VECTOR *points, int numpoints);\n        FMOD_RESULT F_API get3DCustomRolloff     (FMOD_VECTOR **points, int *numpoints);\n        FMOD_RESULT F_API set3DOcclusion         (float directocclusion, float reverbocclusion);\n        FMOD_RESULT F_API get3DOcclusion         (float *directocclusion, float *reverbocclusion);\n        FMOD_RESULT F_API set3DSpread            (float angle);\n        FMOD_RESULT F_API get3DSpread            (float *angle);\n        FMOD_RESULT F_API set3DPanLevel          (float level);\n        FMOD_RESULT F_API get3DPanLevel          (float *level);\n        FMOD_RESULT F_API set3DDopplerLevel      (float level);\n        FMOD_RESULT F_API get3DDopplerLevel      (float *level);\n        FMOD_RESULT F_API set3DDistanceFilter    (bool custom, float customLevel, float centerFreq);\n        FMOD_RESULT F_API get3DDistanceFilter    (bool *custom, float *customLevel, float *centerFreq);\n\n        // DSP functionality only for channels playing sounds created with FMOD_SOFTWARE.\n        FMOD_RESULT F_API getDSPHead             (DSP **dsp);\n        FMOD_RESULT F_API addDSP                 (DSP *dsp, DSPConnection **connection);\n\n        // Information only functions.\n        FMOD_RESULT F_API isPlaying              (bool *isplaying);\n        FMOD_RESULT F_API isVirtual              (bool *isvirtual);\n        FMOD_RESULT F_API getAudibility          (float *audibility);\n        FMOD_RESULT F_API getCurrentSound        (Sound **sound);\n        FMOD_RESULT F_API getSpectrum            (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\n        FMOD_RESULT F_API getWaveData            (float *wavearray, int numvalues, int channeloffset);\n        FMOD_RESULT F_API getIndex               (int *index);\n                                                \n        // Functions also found in Sound class but here they can be set per channel.\n        FMOD_RESULT F_API setMode                (FMOD_MODE mode);\n        FMOD_RESULT F_API getMode                (FMOD_MODE *mode);\n        FMOD_RESULT F_API setLoopCount           (int loopcount);\n        FMOD_RESULT F_API getLoopCount           (int *loopcount);\n        FMOD_RESULT F_API setLoopPoints          (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype);\n        FMOD_RESULT F_API getLoopPoints          (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype);\n\n        // Userdata set/get.                                                \n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'ChannelGroup' API\n    */\n    class ChannelGroup\n    {\n      private:\n\n        ChannelGroup();   /* Constructor made private so user cannot statically instance a ChannelGroup class.  \n                             Appropriate ChannelGroup creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                 ();\n        FMOD_RESULT F_API getSystemObject         (System **system);\n\n        // Channelgroup scale values.  (changes attributes relative to the channels, doesn't overwrite them)\n        FMOD_RESULT F_API setVolume               (float volume);\n        FMOD_RESULT F_API getVolume               (float *volume);\n        FMOD_RESULT F_API setPitch                (float pitch);\n        FMOD_RESULT F_API getPitch                (float *pitch);\n        FMOD_RESULT F_API set3DOcclusion          (float directocclusion, float reverbocclusion);\n        FMOD_RESULT F_API get3DOcclusion          (float *directocclusion, float *reverbocclusion);\n        FMOD_RESULT F_API setPaused               (bool paused);\n        FMOD_RESULT F_API getPaused               (bool *paused);\n        FMOD_RESULT F_API setMute                 (bool mute);\n        FMOD_RESULT F_API getMute                 (bool *mute);\n\n        // Channelgroup override values.  (recursively overwrites whatever settings the channels had)\n        FMOD_RESULT F_API stop                    ();\n        FMOD_RESULT F_API overrideVolume          (float volume);\n        FMOD_RESULT F_API overrideFrequency       (float frequency);\n        FMOD_RESULT F_API overridePan             (float pan);\n        FMOD_RESULT F_API overrideReverbProperties(const FMOD_REVERB_CHANNELPROPERTIES *prop);\n        FMOD_RESULT F_API override3DAttributes    (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);\n        FMOD_RESULT F_API overrideSpeakerMix      (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright);\n\n        // Nested channel groups.\n        FMOD_RESULT F_API addGroup                (ChannelGroup *group);\n        FMOD_RESULT F_API getNumGroups            (int *numgroups);\n        FMOD_RESULT F_API getGroup                (int index, ChannelGroup **group);\n        FMOD_RESULT F_API getParentGroup          (ChannelGroup **group);\n\n        // DSP functionality only for channel groups playing sounds created with FMOD_SOFTWARE.\n        FMOD_RESULT F_API getDSPHead              (DSP **dsp);\n        FMOD_RESULT F_API addDSP                  (DSP *dsp, DSPConnection **connection);\n\n        // Information only functions.\n        FMOD_RESULT F_API getName                 (char *name, int namelen);\n        FMOD_RESULT F_API getNumChannels          (int *numchannels);\n        FMOD_RESULT F_API getChannel              (int index, Channel **channel);\n        FMOD_RESULT F_API getSpectrum             (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype);\n        FMOD_RESULT F_API getWaveData             (float *wavearray, int numvalues, int channeloffset);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData             (void *userdata);\n        FMOD_RESULT F_API getUserData             (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo           (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'SoundGroup' API\n    */\n    class SoundGroup\n    {\n      private:\n\n        SoundGroup();       /* Constructor made private so user cannot statically instance a SoundGroup class.  \n                               Appropriate SoundGroup creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        // SoundGroup control functions.\n        FMOD_RESULT F_API setMaxAudible          (int maxaudible);\n        FMOD_RESULT F_API getMaxAudible          (int *maxaudible);\n        FMOD_RESULT F_API setMaxAudibleBehavior  (FMOD_SOUNDGROUP_BEHAVIOR behavior);\n        FMOD_RESULT F_API getMaxAudibleBehavior  (FMOD_SOUNDGROUP_BEHAVIOR *behavior);\n        FMOD_RESULT F_API setMuteFadeSpeed       (float speed);\n        FMOD_RESULT F_API getMuteFadeSpeed       (float *speed);\n        FMOD_RESULT F_API setVolume              (float volume);\n        FMOD_RESULT F_API getVolume              (float *volume);\n        FMOD_RESULT F_API stop                   ();\n\n        // Information only functions.\n        FMOD_RESULT F_API getName                (char *name, int namelen);\n        FMOD_RESULT F_API getNumSounds           (int *numsounds);\n        FMOD_RESULT F_API getSound               (int index, Sound **sound);\n        FMOD_RESULT F_API getNumPlaying          (int *numplaying);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n    \n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n    /*\n        'DSP' API\n    */\n    class DSP\n    {\n      private:\n\n        DSP();   /* Constructor made private so user cannot statically instance a DSP class.  \n                    Appropriate DSP creation or retrieval function must be used. */\n      public:\n\n        FMOD_RESULT F_API release                ();\n        FMOD_RESULT F_API getSystemObject        (System **system);\n\n        // Connection / disconnection / input and output enumeration.\n        FMOD_RESULT F_API addInput               (DSP *target, DSPConnection **connection);\n        FMOD_RESULT F_API disconnectFrom         (DSP *target);\n        FMOD_RESULT F_API disconnectAll          (bool inputs, bool outputs);\n        FMOD_RESULT F_API remove                 ();\n        FMOD_RESULT F_API getNumInputs           (int *numinputs);\n        FMOD_RESULT F_API getNumOutputs          (int *numoutputs);\n        FMOD_RESULT F_API getInput               (int index, DSP **input, DSPConnection **inputconnection);\n        FMOD_RESULT F_API getOutput              (int index, DSP **output, DSPConnection **outputconnection);\n\n        // DSP unit control.\n        FMOD_RESULT F_API setActive              (bool active);\n        FMOD_RESULT F_API getActive              (bool *active);\n        FMOD_RESULT F_API setBypass              (bool bypass);\n        FMOD_RESULT F_API getBypass              (bool *bypass);\n        FMOD_RESULT F_API setSpeakerActive\t\t (FMOD_SPEAKER speaker, bool active);\n\t\tFMOD_RESULT F_API getSpeakerActive\t\t (FMOD_SPEAKER speaker, bool *active);\n\t\tFMOD_RESULT F_API reset                  ();\n\t\t\n\n        // DSP parameter control.\n        FMOD_RESULT F_API setParameter           (int index, float value);\n        FMOD_RESULT F_API getParameter           (int index, float *value, char *valuestr, int valuestrlen);\n        FMOD_RESULT F_API getNumParameters       (int *numparams);\n        FMOD_RESULT F_API getParameterInfo       (int index, char *name, char *label, char *description, int descriptionlen, float *min, float *max);\n        FMOD_RESULT F_API showConfigDialog       (void *hwnd, bool show);\n        \n        // DSP attributes.        \n        FMOD_RESULT F_API getInfo                (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight);\n        FMOD_RESULT F_API getType                (FMOD_DSP_TYPE *type); \n        FMOD_RESULT F_API setDefaults            (float frequency, float volume, float pan, int priority);\n        FMOD_RESULT F_API getDefaults            (float *frequency, float *volume, float *pan, int *priority);\n                                                \n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n\n    /*\n        'DSPConnection' API\n    */\n    class DSPConnection\n    {\n      private:\n\n        DSPConnection();    /* Constructor made private so user cannot statically instance a DSPConnection class.  \n                               Appropriate DSPConnection creation or retrieval function must be used. */\n\n      public:\n\n        FMOD_RESULT F_API getInput              (DSP **input);\n        FMOD_RESULT F_API getOutput             (DSP **output);\n        FMOD_RESULT F_API setMix                (float volume);\n        FMOD_RESULT F_API getMix                (float *volume);\n        FMOD_RESULT F_API setLevels             (FMOD_SPEAKER speaker, float *levels, int numlevels);\n        FMOD_RESULT F_API getLevels             (FMOD_SPEAKER speaker, float *levels, int numlevels);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData           (void *userdata);\n        FMOD_RESULT F_API getUserData           (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo         (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n\n    /*\n        'Geometry' API\n    */\n    class Geometry\n    {\n      private:\n\n        Geometry();   /* Constructor made private so user cannot statically instance a Geometry class.  \n                         Appropriate Geometry creation or retrieval function must be used. */\n\n      public:        \n\n        FMOD_RESULT F_API release                ();\n\n        // Polygon manipulation.\n        FMOD_RESULT F_API addPolygon             (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex);\n        FMOD_RESULT F_API getNumPolygons         (int *numpolygons); \n        FMOD_RESULT F_API getMaxPolygons         (int *maxpolygons, int *maxvertices);\n        FMOD_RESULT F_API getPolygonNumVertices  (int index, int *numvertices);\n        FMOD_RESULT F_API setPolygonVertex       (int index, int vertexindex, const FMOD_VECTOR *vertex); \n        FMOD_RESULT F_API getPolygonVertex       (int index, int vertexindex, FMOD_VECTOR *vertex);\n        FMOD_RESULT F_API setPolygonAttributes   (int index, float directocclusion, float reverbocclusion, bool doublesided); \n        FMOD_RESULT F_API getPolygonAttributes   (int index, float *directocclusion, float *reverbocclusion, bool *doublesided); \n\n        // Object manipulation.\n        FMOD_RESULT F_API setActive              (bool active);                                                 \n        FMOD_RESULT F_API getActive              (bool *active);                                                 \n        FMOD_RESULT F_API setRotation            (const FMOD_VECTOR *forward, const FMOD_VECTOR *up);\n        FMOD_RESULT F_API getRotation            (FMOD_VECTOR *forward, FMOD_VECTOR *up);\n        FMOD_RESULT F_API setPosition            (const FMOD_VECTOR *position);\n        FMOD_RESULT F_API getPosition            (FMOD_VECTOR *position);\n        FMOD_RESULT F_API setScale               (const FMOD_VECTOR *scale);\n        FMOD_RESULT F_API getScale               (FMOD_VECTOR *scale);\n        FMOD_RESULT F_API save                   (void *data, int *datasize);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);\n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n\n\n    /*\n        'Reverb' API\n    */\n    class Reverb\n    {\n      private:\n\n        Reverb();    /*  Constructor made private so user cannot statically instance a Reverb class.  \n                         Appropriate Reverb creation or retrieval function must be used. */\n\n      public:    \n\n        FMOD_RESULT F_API release                ();\n\n        // Reverb manipulation.\n        FMOD_RESULT F_API set3DAttributes        (const FMOD_VECTOR *position, float mindistance, float maxdistance);\n        FMOD_RESULT F_API get3DAttributes        (FMOD_VECTOR *position, float *mindistance,float *maxdistance);\n        FMOD_RESULT F_API setProperties          (const FMOD_REVERB_PROPERTIES *properties);\n        FMOD_RESULT F_API getProperties          (FMOD_REVERB_PROPERTIES *properties);\n        FMOD_RESULT F_API setActive              (bool active);\n        FMOD_RESULT F_API getActive              (bool *active);\n\n        // Userdata set/get.\n        FMOD_RESULT F_API setUserData            (void *userdata);\n        FMOD_RESULT F_API getUserData            (void **userdata);    \n\n        FMOD_RESULT F_API getMemoryInfo          (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, FMOD_MEMORY_USAGE_DETAILS *memoryused_details);\n    };\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmod_codec.h",
    "content": "/* ==================================================================================================== */\n/* FMOD Ex - codec development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011.  */\n/*                                                                                                      */\n/* Use this header if you are wanting to develop your own file format plugin to use with                */\n/* FMOD's codec system.  With this header you can make your own fileformat plugin that FMOD             */\n/* can register and use.  See the documentation and examples on how to make a working plugin.           */\n/*                                                                                                      */\n/* ==================================================================================================== */\n\n#ifndef _FMOD_CODEC_H\n#define _FMOD_CODEC_H\n\ntypedef struct FMOD_CODEC_STATE FMOD_CODEC_STATE;\ntypedef struct FMOD_CODEC_WAVEFORMAT FMOD_CODEC_WAVEFORMAT;\n\n/*\n    Codec callbacks\n*/ \ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_OPENCALLBACK)        (FMOD_CODEC_STATE *codec_state, FMOD_MODE usermode, FMOD_CREATESOUNDEXINFO *userexinfo);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_CLOSECALLBACK)       (FMOD_CODEC_STATE *codec_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_READCALLBACK)        (FMOD_CODEC_STATE *codec_state, void *buffer, unsigned int sizebytes, unsigned int *bytesread);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETLENGTHCALLBACK)   (FMOD_CODEC_STATE *codec_state, unsigned int *length, FMOD_TIMEUNIT lengthtype);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, unsigned int position, FMOD_TIMEUNIT postype);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETPOSITIONCALLBACK) (FMOD_CODEC_STATE *codec_state, unsigned int *position, FMOD_TIMEUNIT postype);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_SOUNDCREATECALLBACK) (FMOD_CODEC_STATE *codec_state, int subsound, FMOD_SOUND *sound);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_METADATACALLBACK)    (FMOD_CODEC_STATE *codec_state, FMOD_TAGTYPE tagtype, char *name, void *data, unsigned int datalen, FMOD_TAGDATATYPE datatype, int unique);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_CODEC_GETWAVEFORMAT)       (FMOD_CODEC_STATE *codec_state, int index, FMOD_CODEC_WAVEFORMAT *waveformat);\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    When creating a codec, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file.\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_CODEC_STATE\n]\n*/\ntypedef struct FMOD_CODEC_DESCRIPTION\n{\n    const char                     *name;            /* [in] Name of the codec. */\n    unsigned int                    version;         /* [in] Plugin writer's version number. */\n    int                             defaultasstream; /* [in] Tells FMOD to open the file as a stream when calling System::createSound, and not a static sample.  Should normally be 0 (FALSE), because generally the user wants to decode the file into memory when using System::createSound.   Mainly used for formats that decode for a very long time, or could use large amounts of memory when decoded.  Usually sequenced formats such as mod/s3m/xm/it/midi fall into this category.   It is mainly to stop users that don't know what they're doing from getting FMOD_ERR_MEMORY returned from createSound when they should have in fact called System::createStream or used FMOD_CREATESTREAM in System::createSound. */\n    FMOD_TIMEUNIT                   timeunits;       /* [in] When setposition codec is called, only these time formats will be passed to the codec. Use bitwise OR to accumulate different types. */\n    FMOD_CODEC_OPENCALLBACK         open;            /* [in] Open callback for the codec for when FMOD tries to open a sound using this codec. */\n    FMOD_CODEC_CLOSECALLBACK        close;           /* [in] Close callback for the codec for when FMOD tries to close a sound using this codec.  */\n    FMOD_CODEC_READCALLBACK         read;            /* [in] Read callback for the codec for when FMOD tries to read some data from the file to the destination format (specified in the open callback). */\n    FMOD_CODEC_GETLENGTHCALLBACK    getlength;       /* [in] Callback to return the length of the song in whatever format required when Sound::getLength is called. */\n    FMOD_CODEC_SETPOSITIONCALLBACK  setposition;     /* [in] Seek callback for the codec for when FMOD tries to seek within the file with Channel::setPosition. */\n    FMOD_CODEC_GETPOSITIONCALLBACK  getposition;     /* [in] Tell callback for the codec for when FMOD tries to get the current position within the with Channel::getPosition. */\n    FMOD_CODEC_SOUNDCREATECALLBACK  soundcreate;     /* [in] Sound creation callback for the codec when FMOD finishes creating the sound.  (So the codec can set more parameters for the related created sound, ie loop points/mode or 3D attributes etc). */\n    FMOD_CODEC_GETWAVEFORMAT        getwaveformat;   /* [in] Callback to tell FMOD about the waveformat of a particular subsound.  This is to save memory, rather than saving 1000 FMOD_CODEC_WAVEFORMAT structures in the codec, the codec might have a more optimal way of storing this information. */\n} FMOD_CODEC_DESCRIPTION;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Set these values marked 'in' to tell fmod what sort of sound to create.<br>\n    The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code.  So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.<br>\n    Members marked as 'out' are set by fmod.  Do not modify these.  Simply specify 0 for these values when declaring the structure, FMOD will fill in the values for you after creation with the correct function pointers.<br>\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    <br>\n    An FMOD file might be from disk, memory or network, however the file may be opened by the user.<br>\n    <br>\n    'numsubsounds' should be 0 if the file is a normal single sound stream or sound.  Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>\n    'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself.  Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), MIDI/MOD/S3M/XM/IT (contain instruments).<br>\n    The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format.  If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1.  If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.<br>\n    When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.\n    \n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_SOUND_FORMAT\n    FMOD_FILE_READCALLBACK      \n    FMOD_FILE_SEEKCALLBACK      \n    FMOD_CODEC_METADATACALLBACK\n    Sound::getSubSound\n    Sound::getNumSubSounds\n]\n*/\nstruct FMOD_CODEC_WAVEFORMAT\n{\n    char               name[256];     /* [in] Name of sound.*/\n    FMOD_SOUND_FORMAT  format;        /* [in] Format for (decompressed) codec output, ie FMOD_SOUND_FORMAT_PCM8, FMOD_SOUND_FORMAT_PCM16.*/\n    int                channels;      /* [in] Number of channels used by codec, ie mono = 1, stereo = 2. */\n    int                frequency;     /* [in] Default frequency in hz of the codec, ie 44100. */\n    unsigned int       lengthbytes;   /* [in] Length in bytes of the source data. */\n    unsigned int       lengthpcm;     /* [in] Length in decompressed, PCM samples of the file, ie length in seconds * frequency.  Used for Sound::getLength and for memory allocation of static decompressed sample data. */\n    int                blockalign;    /* [in] Blockalign in decompressed, PCM samples of the optimal decode chunk size for this format.  The codec read callback will be called in multiples of this value. */\n    int                loopstart;     /* [in] Loopstart in decompressed, PCM samples of file. */\n    int                loopend;       /* [in] Loopend in decompressed, PCM samples of file. */\n    FMOD_MODE          mode;          /* [in] Mode to determine whether the sound should by default load as looping, non looping, 2d or 3d. */\n    unsigned int       channelmask;   /* [in] Microsoft speaker channel mask, as defined for WAVEFORMATEXTENSIBLE and is found in ksmedia.h.  Leave at 0 to play in natural speaker order. */\n};\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Codec plugin structure that is passed into each callback.<br>\n    <br>\n    Set these numsubsounds and waveformat members when called in FMOD_CODEC_OPENCALLBACK to tell fmod what sort of sound to create.<br>\n    <br>\n    The format, channels and frequency tell FMOD what sort of hardware buffer to create when you initialize your code.  So if you wrote an MP3 codec that decoded to stereo 16bit integer PCM, you would specify FMOD_SOUND_FORMAT_PCM16, and channels would be equal to 2.<br>\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    <br>\n    An FMOD file might be from disk, memory or internet, however the file may be opened by the user.<br>\n    <br>\n    'numsubsounds' should be 0 if the file is a normal single sound stream or sound.  Examples of this would be .WAV, .WMA, .MP3, .AIFF.<br>\n    'numsubsounds' should be 1+ if the file is a container format, and does not contain wav data itself.  Examples of these types would be CDDA (multiple CD tracks), FSB (contains multiple sounds), DLS (contain instruments).<br>\n    The arrays of format, channel, frequency, length and blockalign should point to arrays of information based on how many subsounds are in the format.  If the number of subsounds is 0 then it should point to 1 of each attribute, the same as if the number of subsounds was 1.  If subsounds was 100 for example, each pointer should point to an array of 100 of each attribute.<br>\n    When a sound has 1 or more subsounds, you must play the individual sounds specified by first obtaining the subsound with Sound::getSubSound.\n    \n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_SOUND_FORMAT\n    FMOD_FILE_READCALLBACK      \n    FMOD_FILE_SEEKCALLBACK      \n    FMOD_CODEC_METADATACALLBACK\n    Sound::getSubSound\n    Sound::getNumSubSounds\n]\n*/\nstruct FMOD_CODEC_STATE\n{\n    int                         numsubsounds;  /* [in] Number of 'subsounds' in this sound.  Anything other than 0 makes it a 'container' format (ie CDDA/DLS/FSB etc which contain 1 or more su bsounds).  For most normal, single sound codec such as WAV/AIFF/MP3, this should be 0 as they are not a container for subsounds, they are the sound by itself. */\n    FMOD_CODEC_WAVEFORMAT      *waveformat;    /* [in] Pointer to an array of format structures containing information about each sample.  Can be 0 or NULL if FMOD_CODEC_GETWAVEFORMAT callback is preferred.  The number of entries here must equal the number of subsounds defined in the subsound parameter. If numsubsounds = 0 then there should be 1 instance of this structure. */\n    void                       *plugindata;    /* [in] Plugin writer created data the codec author wants to attach to this object. */\n                                               \n    void                       *filehandle;    /* [out] This will return an internal FMOD file handle to use with the callbacks provided.  */\n    unsigned int                filesize;      /* [out] This will contain the size of the file in bytes. */\n    FMOD_FILE_READCALLBACK      fileread;      /* [out] This will return a callable FMOD file function to use from codec. */\n    FMOD_FILE_SEEKCALLBACK      fileseek;      /* [out] This will return a callable FMOD file function to use from codec.  */\n    FMOD_CODEC_METADATACALLBACK metadata;      /* [out] This will return a callable FMOD metadata function to use from codec.  */\n};\n\n#endif\n\n\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmod_dsp.h",
    "content": "/* ========================================================================================== */\n/* FMOD Ex - DSP header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011.      */\n/*                                                                                            */\n/* Use this header if you are interested in delving deeper into the FMOD software mixing /    */\n/* DSP engine.  In this header you can find parameter structures for FMOD system reigstered   */\n/* DSP effects and generators.                                                                */\n/* Also use this header if you are wanting to develop your own DSP plugin to use with FMOD's  */\n/* dsp system.  With this header you can make your own DSP plugin that FMOD can               */\n/* register and use.  See the documentation and examples on how to make a working plugin.     */\n/*                                                                                            */\n/* ========================================================================================== */\n\n#ifndef _FMOD_DSP_H\n#define _FMOD_DSP_H\n\ntypedef struct FMOD_DSP_STATE FMOD_DSP_STATE;\n\n/* \n    DSP callbacks\n*/\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_CREATECALLBACK)     (FMOD_DSP_STATE *dsp_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RELEASECALLBACK)    (FMOD_DSP_STATE *dsp_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_RESETCALLBACK)      (FMOD_DSP_STATE *dsp_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_READCALLBACK)       (FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPOSITIONCALLBACK)(FMOD_DSP_STATE *dsp_state, unsigned int pos);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_SETPARAMCALLBACK)   (FMOD_DSP_STATE *dsp_state, int index, float value);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_GETPARAMCALLBACK)   (FMOD_DSP_STATE *dsp_state, int index, float *value, char *valuestr);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_DSP_DIALOGCALLBACK)     (FMOD_DSP_STATE *dsp_state, void *hwnd, int show);\n\n/*\n[ENUM]\n[\n    [DESCRIPTION]   \n    These definitions can be used for creating FMOD defined special effects or DSP units.\n\n    [REMARKS]\n    To get them to be active, first create the unit, then add it somewhere into the DSP network, either at the front of the network near the soundcard unit to affect the global output (by using System::getDSPHead), or on a single channel (using Channel::getDSPHead).\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::createDSPByType\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_TYPE_UNKNOWN,            /* This unit was created via a non FMOD plugin so has an unknown purpose. */\n    FMOD_DSP_TYPE_MIXER,              /* This unit does nothing but take inputs and mix them together then feed the result to the soundcard unit. */\n    FMOD_DSP_TYPE_OSCILLATOR,         /* This unit generates sine/square/saw/triangle or noise tones. */\n    FMOD_DSP_TYPE_LOWPASS,            /* This unit filters sound using a high quality, resonant lowpass filter algorithm but consumes more CPU time. */\n    FMOD_DSP_TYPE_ITLOWPASS,          /* This unit filters sound using a resonant lowpass filter algorithm that is used in Impulse Tracker, but with limited cutoff range (0 to 8060hz). */\n    FMOD_DSP_TYPE_HIGHPASS,           /* This unit filters sound using a resonant highpass filter algorithm. */\n    FMOD_DSP_TYPE_ECHO,               /* This unit produces an echo on the sound and fades out at the desired rate. */\n    FMOD_DSP_TYPE_FLANGE,             /* This unit produces a flange effect on the sound. */\n    FMOD_DSP_TYPE_DISTORTION,         /* This unit distorts the sound. */\n    FMOD_DSP_TYPE_NORMALIZE,          /* This unit normalizes or amplifies the sound to a certain level. */\n    FMOD_DSP_TYPE_PARAMEQ,            /* This unit attenuates or amplifies a selected frequency range. */\n    FMOD_DSP_TYPE_PITCHSHIFT,         /* This unit bends the pitch of a sound without changing the speed of playback. */\n    FMOD_DSP_TYPE_CHORUS,             /* This unit produces a chorus effect on the sound. */\n    FMOD_DSP_TYPE_VSTPLUGIN,          /* This unit allows the use of Steinberg VST plugins */\n    FMOD_DSP_TYPE_WINAMPPLUGIN,       /* This unit allows the use of Nullsoft Winamp plugins */\n    FMOD_DSP_TYPE_ITECHO,             /* This unit produces an echo on the sound and fades out at the desired rate as is used in Impulse Tracker. */\n    FMOD_DSP_TYPE_COMPRESSOR,         /* This unit implements dynamic compression (linked multichannel, wideband) */\n    FMOD_DSP_TYPE_SFXREVERB,          /* This unit implements SFX reverb */\n    FMOD_DSP_TYPE_LOWPASS_SIMPLE,     /* This unit filters sound using a simple lowpass with no resonance, but has flexible cutoff and is fast. */\n    FMOD_DSP_TYPE_DELAY,              /* This unit produces different delays on individual channels of the sound. */\n    FMOD_DSP_TYPE_TREMOLO,            /* This unit produces a tremolo / chopper effect on the sound. */\n    FMOD_DSP_TYPE_LADSPAPLUGIN,       /* This unit allows the use of LADSPA standard plugins. */\n    FMOD_DSP_TYPE_HIGHPASS_SIMPLE,    /* This unit filters sound using a simple highpass with no resonance, but has flexible cutoff and is fast. */\n    FMOD_DSP_TYPE_FORCEINT = 65536    /* Makes sure this enum is signed 32bit. */\n} FMOD_DSP_TYPE;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Structure to define a parameter for a DSP unit.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    <br>\n    The step parameter tells the gui or application that the parameter has a certain granularity.<br>\n    For example in the example of cutoff frequency with a range from 100.0 to 22050.0 you might only want the selection to be in 10hz increments.  For this you would simply use 10.0 as the step value.<br>\n    For a boolean, you can use min = 0.0, max = 1.0, step = 1.0.  This way the only possible values are 0.0 and 1.0.<br>\n    Some applications may detect min = 0.0, max = 1.0, step = 1.0 and replace a graphical slider bar with a checkbox instead.<br>\n    A step value of 1.0 would simulate integer values only.<br>\n    A step value of 0.0 would mean the full floating point range is accessable.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]    \n    System::createDSP\n    DSP::setParameter\n]\n*/\ntypedef struct FMOD_DSP_PARAMETERDESC\n{\n    float       min;                                /* [w] Minimum value of the parameter (ie 100.0). */\n    float       max;                                /* [w] Maximum value of the parameter (ie 22050.0). */\n    float       defaultval;                         /* [w] Default value of parameter. */\n    char        name[16];                           /* [w] Name of the parameter to be displayed (ie \"Cutoff frequency\"). */\n    char        label[16];                          /* [w] Short string to be put next to value to denote the unit type (ie \"hz\"). */\n    const char *description;                        /* [w] Description of the parameter to be displayed as a help item / tooltip for this parameter. */\n} FMOD_DSP_PARAMETERDESC;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    When creating a DSP unit, declare one of these and provide the relevant callbacks and name for FMOD to use when it creates and uses a DSP unit of this type.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n    <br>\n    There are 2 different ways to change a parameter in this architecture.<br>\n    One is to use DSP::setParameter / DSP::getParameter.  This is platform independant and is dynamic, so new unknown plugins can have their parameters enumerated and used.<br>\n    The other is to use DSP::showConfigDialog.  This is platform specific and requires a GUI, and will display a dialog box to configure the plugin.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]    \n    System::createDSP\n    FMOD_DSP_STATE\n]\n*/\ntypedef struct FMOD_DSP_DESCRIPTION\n{\n    char                         name[32];           /* [w] Name of the unit to be displayed in the network. */\n    unsigned int                 version;            /* [w] Plugin writer's version number. */\n    int                          channels;           /* [w] Number of channels.  Use 0 to process whatever number of channels is currently in the network.  >0 would be mostly used if the unit is a unit that only generates sound. */\n    FMOD_DSP_CREATECALLBACK      create;             /* [w] Create callback.  This is called when DSP unit is created.  Can be null. */\n    FMOD_DSP_RELEASECALLBACK     release;            /* [w] Release callback.  This is called just before the unit is freed so the user can do any cleanup needed for the unit.  Can be null. */\n    FMOD_DSP_RESETCALLBACK       reset;              /* [w] Reset callback.  This is called by the user to reset any history buffers that may need resetting for a filter, when it is to be used or re-used for the first time to its initial clean state.  Use to avoid clicks or artifacts. */\n    FMOD_DSP_READCALLBACK        read;               /* [w] Read callback.  Processing is done here.  Can be null. */\n    FMOD_DSP_SETPOSITIONCALLBACK setposition;        /* [w] Set position callback.  This is called if the unit wants to update its position info but not process data, or reset a cursor position internally if it is reading data from a certain source.  Can be null. */\n\n    int                          numparameters;      /* [w] Number of parameters used in this filter.  The user finds this with DSP::getNumParameters */\n    FMOD_DSP_PARAMETERDESC      *paramdesc;          /* [w] Variable number of parameter structures. */\n    FMOD_DSP_SETPARAMCALLBACK    setparameter;       /* [w] This is called when the user calls DSP::setParameter.  Can be null. */\n    FMOD_DSP_GETPARAMCALLBACK    getparameter;       /* [w] This is called when the user calls DSP::getParameter.  Can be null. */\n    FMOD_DSP_DIALOGCALLBACK      config;             /* [w] This is called when the user calls DSP::showConfigDialog.  Can be used to display a dialog to configure the filter.  Can be null. */\n    int                          configwidth;        /* [w] Width of config dialog graphic if there is one.  0 otherwise.*/\n    int                          configheight;       /* [w] Height of config dialog graphic if there is one.  0 otherwise.*/\n    void                        *userdata;           /* [w] Optional. Specify 0 to ignore. This is user data to be attached to the DSP unit during creation.  Access via DSP::getUserData. */\n} FMOD_DSP_DESCRIPTION;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    DSP plugin structure that is passed into each callback.\n\n    [REMARKS]\n    Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n    Members marked with [w] mean the variable can be written to.  The user can set the value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_DSP_DESCRIPTION\n]\n*/\nstruct FMOD_DSP_STATE\n{\n    FMOD_DSP      *instance;      /* [r] Handle to the DSP hand the user created.  Not to be modified.  C++ users cast to FMOD::DSP to use.  */\n    void          *plugindata;    /* [w] Plugin writer created data the output author wants to attach to this object. */\n\tunsigned short speakermask;\t  /* [w] Specifies which speakers the DSP effect is active on */\n};\n\n\n/*\n    ===================================================================================================\n\n    FMOD built in effect parameters.  \n    Use DSP::setParameter with these enums for the 'index' parameter.\n\n    ===================================================================================================\n*/\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_OSCILLATOR filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_OSCILLATOR_TYPE,   /* Waveform type.  0 = sine.  1 = square. 2 = sawup. 3 = sawdown. 4 = triangle. 5 = noise.  */\n    FMOD_DSP_OSCILLATOR_RATE    /* Frequency of the sinewave in hz.  1.0 to 22000.0.  Default = 220.0. */\n} FMOD_DSP_OSCILLATOR;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_LOWPASS filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_LOWPASS_CUTOFF,    /* Lowpass cutoff frequency in hz.   10.0 to 22000.0.  Default = 5000.0. */\n    FMOD_DSP_LOWPASS_RESONANCE  /* Lowpass resonance Q value. 1.0 to 10.0.  Default = 1.0. */\n} FMOD_DSP_LOWPASS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_ITLOWPASS filter.<br>\n    This is different to the default FMOD_DSP_TYPE_ITLOWPASS filter in that it uses a different quality algorithm and is \n    the filter used to produce the correct sounding playback in .IT files.<br> \n    FMOD Ex's .IT playback uses this filter.<br>\n\n    [REMARKS]\n    Note! This filter actually has a limited cutoff frequency below the specified maximum, due to its limited design, \n    so for a more  open range filter use FMOD_DSP_LOWPASS or if you don't mind not having resonance, \n    FMOD_DSP_LOWPASS_SIMPLE.<br>\n    The effective maximum cutoff is about 8060hz.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_ITLOWPASS_CUTOFF,    /* Lowpass cutoff frequency in hz.  1.0 to 22000.0.  Default = 5000.0/ */\n    FMOD_DSP_ITLOWPASS_RESONANCE  /* Lowpass resonance Q value.  0.0 to 127.0.  Default = 1.0. */\n} FMOD_DSP_ITLOWPASS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_HIGHPASS filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_HIGHPASS_CUTOFF,    /* Highpass cutoff frequency in hz.  1.0 to output 22000.0.  Default = 5000.0. */\n    FMOD_DSP_HIGHPASS_RESONANCE  /* Highpass resonance Q value.  1.0 to 10.0.  Default = 1.0. */\n} FMOD_DSP_HIGHPASS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_ECHO filter.\n\n    [REMARKS]\n    Note.  Every time the delay is changed, the plugin re-allocates the echo buffer.  This means the echo will dissapear at that time while it refills its new buffer.<br>\n    Larger echo delays result in larger amounts of memory allocated.<br>\n    <br>\n    '<i>maxchannels</i>' also dictates the amount of memory allocated.  By default, the maxchannels value is 0.  If FMOD is set to stereo, the echo unit will allocate enough memory for 2 channels.  If it is 5.1, it will allocate enough memory for a 6 channel echo, etc.<br>\n    If the echo effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.<br>\n    When the echo is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly.  It is only in this case where you might want to increase the channel count above the output's channel count.<br>\n    If a channel echo is set to a lower number than the sound's channel count that is coming in, it will not echo the sound.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_ECHO_DELAY,       /* Echo delay in ms.  10  to 5000.  Default = 500. */\n    FMOD_DSP_ECHO_DECAYRATIO,  /* Echo decay per delay.  0 to 1.  1.0 = No decay, 0.0 = total decay (ie simple 1 line delay).  Default = 0.5. */\n    FMOD_DSP_ECHO_MAXCHANNELS, /* Maximum channels supported.  0 to 16.  0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc.  See remarks for more.  Default = 0.  It is suggested to leave at 0! */\n    FMOD_DSP_ECHO_DRYMIX,      /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 1.0. */\n    FMOD_DSP_ECHO_WETMIX       /* Volume of echo signal to pass to output.  0.0 to 1.0. Default = 1.0. */\n} FMOD_DSP_ECHO;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_DELAY filter.\n\n    [REMARKS]\n    Note.  Every time MaxDelay is changed, the plugin re-allocates the delay buffer.  This means the delay will dissapear at that time while it refills its new buffer.<br>\n    A larger MaxDelay results in larger amounts of memory allocated.<br>\n    Channel delays above MaxDelay will be clipped to MaxDelay and the delay buffer will not be resized.<br>\n    <br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_DELAY_CH0,      /* Channel #0 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH1,      /* Channel #1 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH2,      /* Channel #2 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH3,      /* Channel #3 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH4,      /* Channel #4 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH5,      /* Channel #5 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH6,      /* Channel #6 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH7,      /* Channel #7 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH8,      /* Channel #8 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH9,      /* Channel #9 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH10,     /* Channel #10 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH11,     /* Channel #11 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH12,     /* Channel #12 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH13,     /* Channel #13 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH14,     /* Channel #14 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_CH15,     /* Channel #15 Delay in ms.  0  to 10000.  Default = 0. */\n    FMOD_DSP_DELAY_MAXDELAY  /* Maximum delay in ms.  0  to 10000.  Default = 10. */\n} FMOD_DSP_DELAY;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_FLANGE filter.\n\n    [REMARKS]\n    Flange is an effect where the signal is played twice at the same time, and one copy slides back and forth creating a whooshing or flanging effect.<br>\n    As there are 2 copies of the same signal, by default each signal is given 50% mix, so that the total is not louder than the original unaffected signal.<br>\n    <br>\n    Flange depth is a percentage of a 10ms shift from the original signal.  Anything above 10ms is not considered flange because to the ear it begins to 'echo' so 10ms is the highest value possible.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_FLANGE_DRYMIX,      /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 0.45. */\n    FMOD_DSP_FLANGE_WETMIX,      /* Volume of flange signal to pass to output.  0.0 to 1.0. Default = 0.55. */\n    FMOD_DSP_FLANGE_DEPTH,       /* Flange depth (percentage of 40ms delay).  0.01 to 1.0.  Default = 1.0. */\n    FMOD_DSP_FLANGE_RATE         /* Flange speed in hz.  0.0 to 20.0.  Default = 0.1. */\n} FMOD_DSP_FLANGE;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_TREMOLO filter.\n\n    [REMARKS]\n    The tremolo effect varies the amplitude of a sound. Depending on the settings, this unit can produce a tremolo, chopper or auto-pan effect.<br>\n    <br>\n    The shape of the LFO (low freq. oscillator) can morphed between sine, triangle and sawtooth waves using the FMOD_DSP_TREMOLO_SHAPE and FMOD_DSP_TREMOLO_SKEW parameters.<br>\n    FMOD_DSP_TREMOLO_DUTY and FMOD_DSP_TREMOLO_SQUARE are useful for a chopper-type effect where the first controls the on-time duration and second controls the flatness of the envelope.<br>\n    FMOD_DSP_TREMOLO_SPREAD varies the LFO phase between channels to get an auto-pan effect. This works best with a sine shape LFO.<br>\n    The LFO can be synchronized using the FMOD_DSP_TREMOLO_PHASE parameter which sets its instantaneous phase.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_TREMOLO_FREQUENCY,     /* LFO frequency in Hz.  0.1 to 20.  Default = 4. */\n    FMOD_DSP_TREMOLO_DEPTH,         /* Tremolo depth.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_SHAPE,         /* LFO shape morph between triangle and sine.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_SKEW,          /* Time-skewing of LFO cycle.  -1 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_DUTY,          /* LFO on-time.  0 to 1.  Default = 0.5. */\n    FMOD_DSP_TREMOLO_SQUARE,        /* Flatness of the LFO shape.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_PHASE,         /* Instantaneous LFO phase.  0 to 1.  Default = 0. */\n    FMOD_DSP_TREMOLO_SPREAD         /* Rotation / auto-pan effect.  -1 to 1.  Default = 0. */\n} FMOD_DSP_TREMOLO;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_DISTORTION filter.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_DISTORTION_LEVEL    /* Distortion value.  0.0 to 1.0.  Default = 0.5. */\n} FMOD_DSP_DISTORTION;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_NORMALIZE filter.\n\n    [REMARKS]\n    Normalize amplifies the sound based on the maximum peaks within the signal.<br>\n    For example if the maximum peaks in the signal were 50% of the bandwidth, it would scale the whole sound by 2.<br>\n    The lower threshold value makes the normalizer ignores peaks below a certain point, to avoid over-amplification if a loud signal suddenly came in, and also to avoid amplifying to maximum things like background hiss.<br>\n    <br>\n    Because FMOD is a realtime audio processor, it doesn't have the luxury of knowing the peak for the whole sound (ie it can't see into the future), so it has to process data as it comes in.<br>\n    To avoid very sudden changes in volume level based on small samples of new data, fmod fades towards the desired amplification which makes for smooth gain control.  The fadetime parameter can control this.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_NORMALIZE_FADETIME,    /* Time to ramp the silence to full in ms.  0.0 to 20000.0. Default = 5000.0. */\n    FMOD_DSP_NORMALIZE_THRESHHOLD,  /* Lower volume range threshold to ignore.  0.0 to 1.0.  Default = 0.1.  Raise higher to stop amplification of very quiet signals. */\n    FMOD_DSP_NORMALIZE_MAXAMP       /* Maximum amplification allowed.  1.0 to 100000.0.  Default = 20.0.  1.0 = no amplifaction, higher values allow more boost. */\n} FMOD_DSP_NORMALIZE;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_PARAMEQ filter.\n\n    [REMARKS]\n    Parametric EQ is a bandpass filter that attenuates or amplifies a selected frequency and its neighbouring frequencies.<br>\n    <br>\n    To create a multi-band EQ create multiple FMOD_DSP_TYPE_PARAMEQ units and set each unit to different frequencies, for example 1000hz, 2000hz, 4000hz, 8000hz, 16000hz with a range of 1 octave each.<br>\n    <br>\n    When a frequency has its gain set to 1.0, the sound will be unaffected and represents the original signal exactly.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_PARAMEQ_CENTER,     /* Frequency center.  20.0 to 22000.0.  Default = 8000.0. */\n    FMOD_DSP_PARAMEQ_BANDWIDTH,  /* Octave range around the center frequency to filter.  0.2 to 5.0.  Default = 1.0. */\n    FMOD_DSP_PARAMEQ_GAIN        /* Frequency Gain.  0.05 to 3.0.  Default = 1.0.  */\n} FMOD_DSP_PARAMEQ;\n\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_PITCHSHIFT filter.\n\n    [REMARKS]\n    This pitch shifting unit can be used to change the pitch of a sound without speeding it up or slowing it down.<br>\n    It can also be used for time stretching or scaling, for example if the pitch was doubled, and the frequency of the sound was halved, the pitch of the sound would sound correct but it would be twice as slow.<br>\n    <br>\n    <b>Warning!</b> This filter is very computationally expensive!  Similar to a vocoder, it requires several overlapping FFT and IFFT's to produce smooth output, and can require around 440mhz for 1 stereo 48khz signal using the default settings.<br>\n    Reducing the signal to mono will half the cpu usage.<br>\n    Reducing this will lower audio quality, but what settings to use are largely dependant on the sound being played.  A noisy polyphonic signal will need higher fft size compared to a speaking voice for example.<br>\n    <br>\n    This pitch shifter is based on the pitch shifter code at http://www.dspdimension.com, written by Stephan M. Bernsee.<br>\n    The original code is COPYRIGHT 1999-2003 Stephan M. Bernsee <smb@dspdimension.com>.<br>\n    <br>\n    '<i>maxchannels</i>' dictates the amount of memory allocated.  By default, the maxchannels value is 0.  If FMOD is set to stereo, the pitch shift unit will allocate enough memory for 2 channels.  If it is 5.1, it will allocate enough memory for a 6 channel pitch shift, etc.<br>\n    If the pitch shift effect is only ever applied to the global mix (ie it was added with System::addDSP), then 0 is the value to set as it will be enough to handle all speaker modes.<br>\n    When the pitch shift is added to a channel (ie Channel::addDSP) then the channel count that comes in could be anything from 1 to 8 possibly.  It is only in this case where you might want to increase the channel count above the output's channel count.<br>\n    If a channel pitch shift is set to a lower number than the sound's channel count that is coming in, it will not pitch shift the sound.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_PITCHSHIFT_PITCH,       /* Pitch value.  0.5 to 2.0.  Default = 1.0. 0.5 = one octave down, 2.0 = one octave up.  1.0 does not change the pitch. */\n    FMOD_DSP_PITCHSHIFT_FFTSIZE,     /* FFT window size.  256, 512, 1024, 2048, 4096.  Default = 1024.  Increase this to reduce 'smearing'.  This effect is a warbling sound similar to when an mp3 is encoded at very low bitrates. */\n    FMOD_DSP_PITCHSHIFT_OVERLAP,     /* Removed.  Do not use.  FMOD now uses 4 overlaps and cannot be changed. */\n    FMOD_DSP_PITCHSHIFT_MAXCHANNELS  /* Maximum channels supported.  0 to 16.  0 = same as fmod's default output polyphony, 1 = mono, 2 = stereo etc.  See remarks for more.  Default = 0.  It is suggested to leave at 0! */\n} FMOD_DSP_PITCHSHIFT;\n\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_CHORUS filter.\n\n    [REMARKS]\n    Chrous is an effect where the sound is more 'spacious' due to 1 to 3 versions of the sound being played along side the original signal but with the pitch of each copy modulating on a sine wave.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_CHORUS_DRYMIX,   /* Volume of original signal to pass to output.  0.0 to 1.0. Default = 0.5. */\n    FMOD_DSP_CHORUS_WETMIX1,  /* Volume of 1st chorus tap.  0.0 to 1.0.  Default = 0.5. */\n    FMOD_DSP_CHORUS_WETMIX2,  /* Volume of 2nd chorus tap. This tap is 90 degrees out of phase of the first tap.  0.0 to 1.0.  Default = 0.5. */\n    FMOD_DSP_CHORUS_WETMIX3,  /* Volume of 3rd chorus tap. This tap is 90 degrees out of phase of the second tap.  0.0 to 1.0.  Default = 0.5. */\n    FMOD_DSP_CHORUS_DELAY,    /* Chorus delay in ms.  0.1 to 100.0.  Default = 40.0 ms. */\n    FMOD_DSP_CHORUS_RATE,     /* Chorus modulation rate in hz.  0.0 to 20.0.  Default = 0.8 hz. */\n    FMOD_DSP_CHORUS_DEPTH     /* Chorus modulation depth.  0.0 to 1.0.  Default = 0.03. */\n} FMOD_DSP_CHORUS;\n\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_ITECHO filter.<br>\n    This is effectively a software based echo filter that emulates the DirectX DMO echo effect.  Impulse tracker files can support this, and FMOD will produce the effect on ANY platform, not just those that support DirectX effects!<br>\n\n    [REMARKS]\n    Note.  Every time the delay is changed, the plugin re-allocates the echo buffer.  This means the echo will dissapear at that time while it refills its new buffer.<br>\n    Larger echo delays result in larger amounts of memory allocated.<br>\n    <br>\n    As this is a stereo filter made mainly for IT playback, it is targeted for stereo signals.<br>\n    With mono signals only the FMOD_DSP_ITECHO_LEFTDELAY is used.<br>\n    For multichannel signals (>2) there will be no echo on those channels.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::SetParameter\n    DSP::GetParameter\n    FMOD_DSP_TYPE\n    System::addDSP\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_ITECHO_WETDRYMIX,      /* Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from 0.0 through 100.0 (all wet). The default value is 50. */\n    FMOD_DSP_ITECHO_FEEDBACK,       /* Percentage of output fed back into input, in the range from 0.0 through 100.0. The default value is 50. */\n    FMOD_DSP_ITECHO_LEFTDELAY,      /* Delay for left channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */\n    FMOD_DSP_ITECHO_RIGHTDELAY,     /* Delay for right channel, in milliseconds, in the range from 1.0 through 2000.0. The default value is 500 ms. */\n    FMOD_DSP_ITECHO_PANDELAY        /* Value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. Possible values are defined as 0.0 (equivalent to FALSE) and 1.0 (equivalent to TRUE).  CURRENTLY NOT SUPPORTED. */\n} FMOD_DSP_ITECHO;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_COMPRESSOR unit.\n    This is a simple linked multichannel software limiter that is uniform across the whole spectrum.<br>\n\n    [REMARKS]\n    The limiter is not guaranteed to catch every peak above the threshold level,\n    because it cannot apply gain reduction instantaneously - the time delay is\n    determined by the attack time. However setting the attack time too short will\n    distort the sound, so it is a compromise. High level peaks can be avoided by\n    using a short attack time - but not too short, and setting the threshold a few\n    decibels below the critical level.\n    <br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::SetParameter\n    DSP::GetParameter\n    FMOD_DSP_TYPE\n    System::addDSP\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_COMPRESSOR_THRESHOLD,  /* Threshold level (dB) in the range from -60 through 0. The default value is 0. */ \n    FMOD_DSP_COMPRESSOR_ATTACK,     /* Gain reduction attack time (milliseconds), in the range from 10 through 200. The default value is 50. */\n    FMOD_DSP_COMPRESSOR_RELEASE,    /* Gain reduction release time (milliseconds), in the range from 20 through 1000. The default value is 50. */\n    FMOD_DSP_COMPRESSOR_GAINMAKEUP  /* Make-up gain (dB) applied after limiting, in the range from 0 through 30. The default value is 0. */\n} FMOD_DSP_COMPRESSOR;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_SFXREVERB unit.<br>\n    \n    [REMARKS]\n    This is a high quality I3DL2 based reverb.<br>\n    On top of the I3DL2 property set, \"Dry Level\" is also included to allow the dry mix to be changed.<br>\n    <br>\n    These properties can be set with presets in FMOD_REVERB_PRESETS.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::SetParameter\n    DSP::GetParameter\n    FMOD_DSP_TYPE\n    System::addDSP\n    FMOD_REVERB_PRESETS\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_SFXREVERB_DRYLEVEL,            /* Dry Level      : Mix level of dry signal in output in mB.  Ranges from -10000.0 to 0.0.  Default is 0. */\n    FMOD_DSP_SFXREVERB_ROOM,                /* Room           : Room effect level at low frequencies in mB.  Ranges from -10000.0 to 0.0.  Default is -10000.0. */\n    FMOD_DSP_SFXREVERB_ROOMHF,              /* Room HF        : Room effect high-frequency level re. low frequency level in mB.  Ranges from -10000.0 to 0.0.  Default is 0.0. */\n    FMOD_DSP_SFXREVERB_DECAYTIME,           /* Decay Time     : Reverberation decay time at low-frequencies in seconds.  Ranges from 0.1 to 20.0. Default is 1.0. */\n    FMOD_DSP_SFXREVERB_DECAYHFRATIO,        /* Decay HF Ratio : High-frequency to low-frequency decay time ratio.  Ranges from 0.1 to 2.0. Default is 0.5. */\n    FMOD_DSP_SFXREVERB_REFLECTIONSLEVEL,    /* Reflections    : Early reflections level relative to room effect in mB.  Ranges from -10000.0 to 1000.0.  Default is -10000.0. */\n    FMOD_DSP_SFXREVERB_REFLECTIONSDELAY,    /* Reflect Delay  : Delay time of first reflection in seconds.  Ranges from 0.0 to 0.3.  Default is 0.02. */\n    FMOD_DSP_SFXREVERB_REVERBLEVEL,         /* Reverb         : Late reverberation level relative to room effect in mB.  Ranges from -10000.0 to 2000.0.  Default is 0.0. */\n    FMOD_DSP_SFXREVERB_REVERBDELAY,         /* Reverb Delay   : Late reverberation delay time relative to first reflection in seconds.  Ranges from 0.0 to 0.1.  Default is 0.04. */\n    FMOD_DSP_SFXREVERB_DIFFUSION,           /* Diffusion      : Reverberation diffusion (echo density) in percent.  Ranges from 0.0 to 100.0.  Default is 100.0. */\n    FMOD_DSP_SFXREVERB_DENSITY,             /* Density        : Reverberation density (modal density) in percent.  Ranges from 0.0 to 100.0.  Default is 100.0. */\n    FMOD_DSP_SFXREVERB_HFREFERENCE,         /* HF Reference   : Reference high frequency in Hz.  Ranges from 20.0 to 20000.0. Default is 5000.0. */\n    FMOD_DSP_SFXREVERB_ROOMLF,              /* Room LF        : Room effect low-frequency level in mB.  Ranges from -10000.0 to 0.0.  Default is 0.0. */\n    FMOD_DSP_SFXREVERB_LFREFERENCE          /* LF Reference   : Reference low-frequency in Hz.  Ranges from 20.0 to 1000.0. Default is 250.0. */\n} FMOD_DSP_SFXREVERB;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_LOWPASS_SIMPLE filter.<br>\n    This is a very simple low pass filter, based on two single-pole RC time-constant modules.\n    The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.<br> \n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_LOWPASS_SIMPLE_CUTOFF     /* Lowpass cutoff frequency in hz.  10.0 to 22000.0.  Default = 5000.0 */\n} FMOD_DSP_LOWPASS_SIMPLE;\n\n/*\n[ENUM]\n[  \n    [DESCRIPTION]   \n    Parameter types for the FMOD_DSP_TYPE_HIGHPASS_SIMPLE filter.<br>\n    This is a very simple single-order high pass filter.\n    The emphasis is on speed rather than accuracy, so this should not be used for task requiring critical filtering.<br> \n\n    [REMARKS]\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]      \n    DSP::setParameter\n    DSP::getParameter\n    FMOD_DSP_TYPE\n]\n*/\ntypedef enum\n{\n    FMOD_DSP_HIGHPASS_SIMPLE_CUTOFF     /* Highpass cutoff frequency in hz.  10.0 to 22000.0.  Default = 1000.0 */\n} FMOD_DSP_HIGHPASS_SIMPLE;\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmod_errors.h",
    "content": "/*$ preserve start $*/\n\n/* ============================================================================================== */\n/* FMOD Ex - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */\n/*                                                                                                */\n/* Use this header if you want to store or display a string version / english explanation of      */\n/* the FMOD error codes.                                                                          */\n/*                                                                                                */\n/* ============================================================================================== */\n\n#ifndef _FMOD_ERRORS_H\n#define _FMOD_ERRORS_H\n\n#include \"fmod.h\"\n\n#ifdef __GNUC__ \nstatic const char *FMOD_ErrorString(FMOD_RESULT errcode) __attribute__((unused));\n#endif\n\nstatic const char *FMOD_ErrorString(FMOD_RESULT errcode)\n{\n    switch (errcode)\n    {\n/*$ preserve end $*/\n        case FMOD_ERR_ALREADYLOCKED:          return \"Tried to call lock a second time before unlock was called. \";\n        case FMOD_ERR_BADCOMMAND:             return \"Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound). \";\n        case FMOD_ERR_CDDA_DRIVERS:           return \"Neither NTSCSI nor ASPI could be initialised. \";\n        case FMOD_ERR_CDDA_INIT:              return \"An error occurred while initialising the CDDA subsystem. \";\n        case FMOD_ERR_CDDA_INVALID_DEVICE:    return \"Couldn't find the specified device. \";\n        case FMOD_ERR_CDDA_NOAUDIO:           return \"No audio tracks on the specified disc. \";\n        case FMOD_ERR_CDDA_NODEVICES:         return \"No CD/DVD devices were found. \";\n        case FMOD_ERR_CDDA_NODISC:            return \"No disc present in the specified drive. \";\n        case FMOD_ERR_CDDA_READ:              return \"A CDDA read error occurred. \";\n        case FMOD_ERR_CHANNEL_ALLOC:          return \"Error trying to allocate a channel. \";\n        case FMOD_ERR_CHANNEL_STOLEN:         return \"The specified channel has been reused to play another sound. \";\n        case FMOD_ERR_COM:                    return \"A Win32 COM related error occured. COM failed to initialize or a QueryInterface failed meaning a Windows codec or driver was not installed properly. \";\n        case FMOD_ERR_DMA:                    return \"DMA Failure.  See debug output for more information. \";\n        case FMOD_ERR_DSP_CONNECTION:         return \"DSP connection error.  Connection possibly caused a cyclic dependancy.  Or tried to connect a tree too many units deep (more than 128). \";\n        case FMOD_ERR_DSP_FORMAT:             return \"DSP Format error.  A DSP unit may have attempted to connect to this network with the wrong format. \";\n        case FMOD_ERR_DSP_NOTFOUND:           return \"DSP connection error.  Couldn't find the DSP unit specified. \";\n        case FMOD_ERR_DSP_RUNNING:            return \"DSP error.  Cannot perform this operation while the network is in the middle of running.  This will most likely happen if a connection or disconnection is attempted in a DSP callback. \";\n        case FMOD_ERR_DSP_TOOMANYCONNECTIONS: return \"DSP connection error.  The unit being connected to or disconnected should only have 1 input or output. \";\n        case FMOD_ERR_EVENT_ALREADY_LOADED:   return \"The specified project has already been loaded. Having multiple copies of the same project loaded simultaneously is forbidden. \";\n        case FMOD_ERR_EVENT_FAILED:           return \"An Event failed to be retrieved, most likely due to 'just fail' being specified as the max playbacks behavior. \";\n        case FMOD_ERR_EVENT_GUIDCONFLICT:     return \"An event with the same GUID already exists. \";\n        case FMOD_ERR_EVENT_INFOONLY:         return \"Can't execute this command on an EVENT_INFOONLY event. \";\n        case FMOD_ERR_EVENT_INTERNAL:         return \"An error occured that wasn't supposed to.  See debug log for reason. \";\n        case FMOD_ERR_EVENT_MAXSTREAMS:       return \"Event failed because 'Max streams' was hit when FMOD_EVENT_INIT_FAIL_ON_MAXSTREAMS was specified. \";\n        case FMOD_ERR_EVENT_MISMATCH:         return \"FSB mismatches the FEV it was compiled with, the stream/sample mode it was meant to be created with was different, or the FEV was built for a different platform. \";\n        case FMOD_ERR_EVENT_NAMECONFLICT:     return \"A category with the same name already exists. \";\n        case FMOD_ERR_EVENT_NEEDSSIMPLE:      return \"Tried to call a function on a complex event that's only supported by simple events. \";\n        case FMOD_ERR_EVENT_NOTFOUND:         return \"The requested event, event group, event category or event property could not be found. \";\n        case FMOD_ERR_FILE_BAD:               return \"Error loading file. \";\n        case FMOD_ERR_FILE_COULDNOTSEEK:      return \"Couldn't perform seek operation.  This is a limitation of the medium (ie netstreams) or the file format. \";\n        case FMOD_ERR_FILE_DISKEJECTED:       return \"Media was ejected while reading. \";\n        case FMOD_ERR_FILE_EOF:               return \"End of file unexpectedly reached while trying to read essential data (truncated data?). \";\n        case FMOD_ERR_FILE_NOTFOUND:          return \"File not found. \";\n        case FMOD_ERR_FILE_UNWANTED:          return \"Unwanted file access occured. \";\n        case FMOD_ERR_FORMAT:                 return \"Unsupported file or audio format. \";\n        case FMOD_ERR_HTTP:                   return \"A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere. \";\n        case FMOD_ERR_HTTP_ACCESS:            return \"The specified resource requires authentication or is forbidden. \";\n        case FMOD_ERR_HTTP_PROXY_AUTH:        return \"Proxy authentication is required to access the specified resource. \";\n        case FMOD_ERR_HTTP_SERVER_ERROR:      return \"A HTTP server error occurred. \";\n        case FMOD_ERR_HTTP_TIMEOUT:           return \"The HTTP request timed out. \";\n        case FMOD_ERR_INITIALIZATION:         return \"FMOD was not initialized correctly to support this function. \";\n        case FMOD_ERR_INITIALIZED:            return \"Cannot call this command after System::init. \";\n        case FMOD_ERR_INTERNAL:               return \"An error occured that wasn't supposed to.  Contact support. \";\n        case FMOD_ERR_INVALID_ADDRESS:        return \"On Xbox 360, this memory address passed to FMOD must be physical, (ie allocated with XPhysicalAlloc.) \";\n        case FMOD_ERR_INVALID_FLOAT:          return \"Value passed in was a NaN, Inf or denormalized float. \";\n        case FMOD_ERR_INVALID_HANDLE:         return \"An invalid object handle was used. \";\n        case FMOD_ERR_INVALID_PARAM:          return \"An invalid parameter was passed to this function. \";\n        case FMOD_ERR_INVALID_POSITION:       return \"An invalid seek position was passed to this function. \";\n        case FMOD_ERR_INVALID_SPEAKER:        return \"An invalid speaker was passed to this function based on the current speaker mode. \";\n        case FMOD_ERR_INVALID_SYNCPOINT:      return \"The syncpoint did not come from this sound handle. \";\n        case FMOD_ERR_INVALID_VECTOR:         return \"The vectors passed in are not unit length, or perpendicular. \";\n        case FMOD_ERR_MAXAUDIBLE:             return \"Reached maximum audible playback count for this sound's soundgroup. \";\n        case FMOD_ERR_MEMORY:                 return \"Not enough memory or resources. \";\n        case FMOD_ERR_MEMORY_CANTPOINT:       return \"Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used. \";\n        case FMOD_ERR_MEMORY_SRAM:            return \"Not enough memory or resources on console sound ram. \";\n        case FMOD_ERR_MUSIC_NOCALLBACK:       return \"The music callback is required, but it has not been set. \";\n        case FMOD_ERR_MUSIC_NOTFOUND:         return \"The requested music entity could not be found. \";\n        case FMOD_ERR_MUSIC_UNINITIALIZED:    return \"Music system is not initialized probably because no music data is loaded. \";\n        case FMOD_ERR_NEEDS2D:                return \"Tried to call a command on a 3d sound when the command was meant for 2d sound. \";\n        case FMOD_ERR_NEEDS3D:                return \"Tried to call a command on a 2d sound when the command was meant for 3d sound. \";\n        case FMOD_ERR_NEEDSHARDWARE:          return \"Tried to use a feature that requires hardware support.  (ie trying to play a GCADPCM compressed sound in software on Wii). \";\n        case FMOD_ERR_NEEDSSOFTWARE:          return \"Tried to use a feature that requires the software engine.  Software engine has either been turned off, or command was executed on a hardware channel which does not support this feature. \";\n        case FMOD_ERR_NET_CONNECT:            return \"Couldn't connect to the specified host. \";\n        case FMOD_ERR_NET_SOCKET_ERROR:       return \"A socket error occurred.  This is a catch-all for socket-related errors not listed elsewhere. \";\n        case FMOD_ERR_NET_URL:                return \"The specified URL couldn't be resolved. \";\n        case FMOD_ERR_NET_WOULD_BLOCK:        return \"Operation on a non-blocking socket could not complete immediately. \";\n        case FMOD_ERR_NOTREADY:               return \"Operation could not be performed because specified sound/DSP connection is not ready. \";\n        case FMOD_ERR_OUTPUT_ALLOCATED:       return \"Error initializing output device, but more specifically, the output device is already in use and cannot be reused. \";\n        case FMOD_ERR_OUTPUT_CREATEBUFFER:    return \"Error creating hardware sound buffer. \";\n        case FMOD_ERR_OUTPUT_DRIVERCALL:      return \"A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. \";\n        case FMOD_ERR_OUTPUT_ENUMERATION:     return \"Error enumerating the available driver list. List may be inconsistent due to a recent device addition or removal. \";\n        case FMOD_ERR_OUTPUT_FORMAT:          return \"Soundcard does not support the minimum features needed for this soundsystem (16bit stereo output). \";\n        case FMOD_ERR_OUTPUT_INIT:            return \"Error initializing output device. \";\n        case FMOD_ERR_OUTPUT_NOHARDWARE:      return \"FMOD_HARDWARE was specified but the sound card does not have the resources necessary to play it. \";\n        case FMOD_ERR_OUTPUT_NOSOFTWARE:      return \"Attempted to create a software sound but no software channels were specified in System::init. \";\n        case FMOD_ERR_PAN:                    return \"Panning only works with mono or stereo sound sources. \";\n        case FMOD_ERR_PLUGIN:                 return \"An unspecified error has been returned from a 3rd party plugin. \";\n        case FMOD_ERR_PLUGIN_INSTANCES:       return \"The number of allowed instances of a plugin has been exceeded. \";\n        case FMOD_ERR_PLUGIN_MISSING:         return \"A requested output, dsp unit type or codec was not available. \";\n        case FMOD_ERR_PLUGIN_RESOURCE:        return \"A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback) \";\n        case FMOD_ERR_PRELOADED:              return \"The specified sound is still in use by the event system, call EventSystem::unloadFSB before trying to release it. \";\n        case FMOD_ERR_PROGRAMMERSOUND:        return \"The specified sound is still in use by the event system, wait for the event which is using it finish with it. \";\n        case FMOD_ERR_RECORD:                 return \"An error occured trying to initialize the recording device. \";\n        case FMOD_ERR_REVERB_INSTANCE:        return \"Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesnt exist. \";\n        case FMOD_ERR_SUBSOUNDS:              return \"The error occured because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have.  The operation may also not be able to be performed on a parent sound, or a parent sound was played without setting up a sentence first. \";\n        case FMOD_ERR_SUBSOUND_ALLOCATED:     return \"This subsound is already being used by another sound, you cannot have more than one parent to a sound.  Null out the other parent's entry first. \";\n        case FMOD_ERR_SUBSOUND_CANTMOVE:      return \"Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file. \";\n        case FMOD_ERR_SUBSOUND_MODE:          return \"The subsound's mode bits do not match with the parent sound's mode bits.  See documentation for function that it was called with. \";\n        case FMOD_ERR_TAGNOTFOUND:            return \"The specified tag could not be found or there are no tags. \";\n        case FMOD_ERR_TOOMANYCHANNELS:        return \"The sound created exceeds the allowable input channel count.  This can be increased using the maxinputchannels parameter in System::setSoftwareFormat. \";\n        case FMOD_ERR_UNIMPLEMENTED:          return \"Something in FMOD hasn't been implemented when it should be! contact support! \";\n        case FMOD_ERR_UNINITIALIZED:          return \"This command failed because System::init or System::setDriver was not called. \";\n        case FMOD_ERR_UNSUPPORTED:            return \"A command issued was not supported by this object.  Possibly a plugin without certain callbacks specified. \";\n        case FMOD_ERR_UPDATE:                 return \"An error caused by System::update occured. \";\n        case FMOD_ERR_VERSION:                return \"The version number of this file format is not supported. \";\n        case FMOD_OK:                         return \"No errors.\";\n        default :                             return \"Unknown error.\";\n/*$ preserve start $*/\n    };\n}\n\n#endif\n/*$ preserve end $*/\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmod_memoryinfo.h",
    "content": "/* ============================================================================================= */\n/* FMOD Ex - Memory info header file. Copyright (c), Firelight Technologies Pty, Ltd. 2008-2011. */\n/*                                                                                               */\n/* Use this header if you are interested in getting detailed information on FMOD's memory        */\n/* usage. See the documentation for more details.                                                */\n/*                                                                                               */\n/* ============================================================================================= */\n\n#ifndef _FMOD_MEMORYINFO_H\n#define _FMOD_MEMORYINFO_H\n\n/*\n[STRUCTURE]\n[\n    [DESCRIPTION]\n    Structure to be filled with detailed memory usage information of an FMOD object\n\n    [REMARKS]\n    Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question. \n    On return from getMemoryInfo, each member of this structure will hold the amount of memory used for its type in bytes.<br>\n    <br>\n    Members marked with [in] mean the user sets the value before passing it to the function.<br>\n    Members marked with [out] mean FMOD sets the value to be used after the function exits.<br>\n\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    System::getMemoryInfo\n    EventSystem::getMemoryInfo\n    FMOD_MEMBITS    \n    FMOD_EVENT_MEMBITS\n]\n*/\ntypedef struct FMOD_MEMORY_USAGE_DETAILS\n{\n    unsigned int other;                          /* [out] Memory not accounted for by other types */\n    unsigned int string;                         /* [out] String data */\n    unsigned int system;                         /* [out] System object and various internals */\n    unsigned int plugins;                        /* [out] Plugin objects and internals */\n    unsigned int output;                         /* [out] Output module object and internals */\n    unsigned int channel;                        /* [out] Channel related memory */\n    unsigned int channelgroup;                   /* [out] ChannelGroup objects and internals */\n    unsigned int codec;                          /* [out] Codecs allocated for streaming */\n    unsigned int file;                           /* [out] File buffers and structures */\n    unsigned int sound;                          /* [out] Sound objects and internals */\n    unsigned int secondaryram;                   /* [out] Sound data stored in secondary RAM */\n    unsigned int soundgroup;                     /* [out] SoundGroup objects and internals */\n    unsigned int streambuffer;                   /* [out] Stream buffer memory */\n    unsigned int dspconnection;                  /* [out] DSPConnection objects and internals */\n    unsigned int dsp;                            /* [out] DSP implementation objects */\n    unsigned int dspcodec;                       /* [out] Realtime file format decoding DSP objects */\n    unsigned int profile;                        /* [out] Profiler memory footprint. */\n    unsigned int recordbuffer;                   /* [out] Buffer used to store recorded data from microphone */\n    unsigned int reverb;                         /* [out] Reverb implementation objects */\n    unsigned int reverbchannelprops;             /* [out] Reverb channel properties structs */\n    unsigned int geometry;                       /* [out] Geometry objects and internals */\n    unsigned int syncpoint;                      /* [out] Sync point memory. */\n    unsigned int eventsystem;                    /* [out] EventSystem and various internals */\n    unsigned int musicsystem;                    /* [out] MusicSystem and various internals */\n    unsigned int fev;                            /* [out] Definition of objects contained in all loaded projects e.g. events, groups, categories */\n    unsigned int memoryfsb;                      /* [out] Data loaded with preloadFSB */\n    unsigned int eventproject;                   /* [out] EventProject objects and internals */\n    unsigned int eventgroupi;                    /* [out] EventGroup objects and internals */\n    unsigned int soundbankclass;                 /* [out] Objects used to manage wave banks */\n    unsigned int soundbanklist;                  /* [out] Data used to manage lists of wave bank usage */\n    unsigned int streaminstance;                 /* [out] Stream objects and internals */\n    unsigned int sounddefclass;                  /* [out] Sound definition objects */\n    unsigned int sounddefdefclass;               /* [out] Sound definition static data objects */\n    unsigned int sounddefpool;                   /* [out] Sound definition pool data */\n    unsigned int reverbdef;                      /* [out] Reverb definition objects */\n    unsigned int eventreverb;                    /* [out] Reverb objects */\n    unsigned int userproperty;                   /* [out] User property objects */\n    unsigned int eventinstance;                  /* [out] Event instance base objects */\n    unsigned int eventinstance_complex;          /* [out] Complex event instance objects */\n    unsigned int eventinstance_simple;           /* [out] Simple event instance objects */\n    unsigned int eventinstance_layer;            /* [out] Event layer instance objects */\n    unsigned int eventinstance_sound;            /* [out] Event sound instance objects */\n    unsigned int eventenvelope;                  /* [out] Event envelope objects */\n    unsigned int eventenvelopedef;               /* [out] Event envelope definition objects */\n    unsigned int eventparameter;                 /* [out] Event parameter objects */\n    unsigned int eventcategory;                  /* [out] Event category objects */\n    unsigned int eventenvelopepoint;             /* [out] Event envelope point objects */\n    unsigned int eventinstancepool;              /* [out] Event instance pool memory */\n} FMOD_MEMORY_USAGE_DETAILS;\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_MEMBITS\n\n    [DESCRIPTION]\n    Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Ex class.\n    Use with the \"memorybits\" parameter of getMemoryInfo to get information on FMOD Ex memory usage.\n\n    [REMARKS]\n    Every public FMOD class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question. \n    The FMOD_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See System::getMemoryInfo for an example.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_EVENT_MEMBITS\n    System::getMemoryInfo\n]\n*/\n#define FMOD_MEMBITS_OTHER                       0x00000001  /* Memory not accounted for by other types */\n#define FMOD_MEMBITS_STRING                      0x00000002  /* String data */\n\n#define FMOD_MEMBITS_SYSTEM                      0x00000004  /* System object and various internals */\n#define FMOD_MEMBITS_PLUGINS                     0x00000008  /* Plugin objects and internals */\n#define FMOD_MEMBITS_OUTPUT                      0x00000010  /* Output module object and internals */\n#define FMOD_MEMBITS_CHANNEL                     0x00000020  /* Channel related memory */\n#define FMOD_MEMBITS_CHANNELGROUP                0x00000040  /* ChannelGroup objects and internals */\n#define FMOD_MEMBITS_CODEC                       0x00000080  /* Codecs allocated for streaming */\n#define FMOD_MEMBITS_FILE                        0x00000100  /* Codecs allocated for streaming */\n#define FMOD_MEMBITS_SOUND                       0x00000200  /* Sound objects and internals */\n#define FMOD_MEMBITS_SOUND_SECONDARYRAM          0x00000400  /* Sound data stored in secondary RAM */\n#define FMOD_MEMBITS_SOUNDGROUP                  0x00000800  /* SoundGroup objects and internals */\n#define FMOD_MEMBITS_STREAMBUFFER                0x00001000  /* Stream buffer memory */\n#define FMOD_MEMBITS_DSPCONNECTION               0x00002000  /* DSPConnection objects and internals */\n#define FMOD_MEMBITS_DSP                         0x00004000  /* DSP implementation objects */\n#define FMOD_MEMBITS_DSPCODEC                    0x00008000  /* Realtime file format decoding DSP objects */\n#define FMOD_MEMBITS_PROFILE                     0x00010000  /* Profiler memory footprint. */\n#define FMOD_MEMBITS_RECORDBUFFER                0x00020000  /* Buffer used to store recorded data from microphone */\n#define FMOD_MEMBITS_REVERB                      0x00040000  /* Reverb implementation objects */\n#define FMOD_MEMBITS_REVERBCHANNELPROPS          0x00080000  /* Reverb channel properties structs */\n#define FMOD_MEMBITS_GEOMETRY                    0x00100000  /* Geometry objects and internals */\n#define FMOD_MEMBITS_SYNCPOINT                   0x00200000  /* Sync point memory. */\n#define FMOD_MEMBITS_ALL                         0xffffffff  /* All memory used by FMOD Ex */\n/* [DEFINE_END] */\n\n\n/*\n[DEFINE]\n[\n    [NAME]\n    FMOD_EVENT_MEMBITS\n\n    [DESCRIPTION]\n    Bitfield used to request specific memory usage information from the getMemoryInfo function of every public FMOD Event System class.\n    Use with the \"event_memorybits\" parameter of getMemoryInfo to get information on FMOD Event System memory usage.\n\n    [REMARKS]\n    Every public FMOD Event System class has a getMemoryInfo function which can be used to get detailed information on what memory resources are associated with the object in question. \n    The FMOD_EVENT_MEMBITS defines can be OR'd together to specify precisely what memory usage you'd like to get information on. See EventSystem::getMemoryInfo for an example.\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_MEMBITS\n    System::getMemoryInfo\n]\n*/                                               \n#define FMOD_EVENT_MEMBITS_EVENTSYSTEM           0x00000001  /* EventSystem and various internals */\n#define FMOD_EVENT_MEMBITS_MUSICSYSTEM           0x00000002  /* MusicSystem and various internals */\n#define FMOD_EVENT_MEMBITS_FEV                   0x00000004  /* Definition of objects contained in all loaded projects e.g. events, groups, categories */\n#define FMOD_EVENT_MEMBITS_MEMORYFSB             0x00000008  /* Data loaded with preloadFSB */\n#define FMOD_EVENT_MEMBITS_EVENTPROJECT          0x00000010  /* EventProject objects and internals */\n#define FMOD_EVENT_MEMBITS_EVENTGROUPI           0x00000020  /* EventGroup objects and internals */\n#define FMOD_EVENT_MEMBITS_SOUNDBANKCLASS        0x00000040  /* Objects used to manage wave banks */\n#define FMOD_EVENT_MEMBITS_SOUNDBANKLIST         0x00000080  /* Data used to manage lists of wave bank usage */\n#define FMOD_EVENT_MEMBITS_STREAMINSTANCE        0x00000100  /* Stream objects and internals */\n#define FMOD_EVENT_MEMBITS_SOUNDDEFCLASS         0x00000200  /* Sound definition objects */\n#define FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS      0x00000400  /* Sound definition static data objects */\n#define FMOD_EVENT_MEMBITS_SOUNDDEFPOOL          0x00000800  /* Sound definition pool data */\n#define FMOD_EVENT_MEMBITS_REVERBDEF             0x00001000  /* Reverb definition objects */\n#define FMOD_EVENT_MEMBITS_EVENTREVERB           0x00002000  /* Reverb objects */\n#define FMOD_EVENT_MEMBITS_USERPROPERTY          0x00004000  /* User property objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE         0x00008000  /* Event instance base objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX 0x00010000  /* Complex event instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE  0x00020000  /* Simple event instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER   0x00040000  /* Event layer instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND   0x00080000  /* Event sound instance objects */\n#define FMOD_EVENT_MEMBITS_EVENTENVELOPE         0x00100000  /* Event envelope objects */\n#define FMOD_EVENT_MEMBITS_EVENTENVELOPEDEF      0x00200000  /* Event envelope definition objects */\n#define FMOD_EVENT_MEMBITS_EVENTPARAMETER        0x00400000  /* Event parameter objects */\n#define FMOD_EVENT_MEMBITS_EVENTCATEGORY         0x00800000  /* Event category objects */\n#define FMOD_EVENT_MEMBITS_EVENTENVELOPEPOINT    0x01000000  /* Event envelope point object+s */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCEPOOL     0x02000000  /* Event instance pool data */\n#define FMOD_EVENT_MEMBITS_ALL                   0xffffffff  /* All memory used by FMOD Event System */\n\n/* All event instance memory */\n#define FMOD_EVENT_MEMBITS_EVENTINSTANCE_GROUP   (FMOD_EVENT_MEMBITS_EVENTINSTANCE            | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_COMPLEX | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_SIMPLE  | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_LAYER   | \\\n                                                     FMOD_EVENT_MEMBITS_EVENTINSTANCE_SOUND)\n\n/* All sound definition memory */\n#define FMOD_EVENT_MEMBITS_SOUNDDEF_GROUP        (FMOD_EVENT_MEMBITS_SOUNDDEFCLASS            | \\\n                                                     FMOD_EVENT_MEMBITS_SOUNDDEFDEFCLASS      | \\\n                                                     FMOD_EVENT_MEMBITS_SOUNDDEFPOOL)\n/* [DEFINE_END] */\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmod_output.h",
    "content": "/* ==================================================================================================== */\n/* FMOD Ex - output development header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2011. */\n/*                                                                                                      */\n/* Use this header if you are wanting to develop your own output plugin to use with                     */\n/* FMOD's output system.  With this header you can make your own output plugin that FMOD                */\n/* can register and use.  See the documentation and examples on how to make a working plugin.           */\n/*                                                                                                      */\n/* ==================================================================================================== */\n\n#ifndef _FMOD_OUTPUT_H\n#define _FMOD_OUTPUT_H\n\n#include \"fmod.h\"\n\ntypedef struct FMOD_OUTPUT_STATE FMOD_OUTPUT_STATE;\n\n/*\n    Output callbacks\n*/ \ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETNUMDRIVERSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int *numdrivers);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERNAMECALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, char *name, int namelen);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETDRIVERCAPSCALLBACK)(FMOD_OUTPUT_STATE *output_state, int id, FMOD_CAPS *caps);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_INITCALLBACK)         (FMOD_OUTPUT_STATE *output_state, int selecteddriver, FMOD_INITFLAGS flags, int *outputrate, int outputchannels, FMOD_SOUND_FORMAT *outputformat, int dspbufferlength, int dspnumbuffers, void *extradriverdata);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_CLOSECALLBACK)        (FMOD_OUTPUT_STATE *output_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UPDATECALLBACK)       (FMOD_OUTPUT_STATE *output_state);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETHANDLECALLBACK)    (FMOD_OUTPUT_STATE *output_state, void **handle);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_GETPOSITIONCALLBACK)  (FMOD_OUTPUT_STATE *output_state, unsigned int *pcm);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_LOCKCALLBACK)         (FMOD_OUTPUT_STATE *output_state, unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_UNLOCKCALLBACK)       (FMOD_OUTPUT_STATE *output_state, void *ptr1, void *ptr2, unsigned int len1, unsigned int len2);\ntypedef FMOD_RESULT (F_CALLBACK *FMOD_OUTPUT_READFROMMIXER)        (FMOD_OUTPUT_STATE *output_state, void *buffer, unsigned int length);\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    When creating an output, declare one of these and provide the relevant callbacks and name for FMOD to use when it opens and reads a file of this type.\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_OUTPUT_STATE\n]\n*/\ntypedef struct FMOD_OUTPUT_DESCRIPTION\n{\n    const char                        *name;                  /* [in] Name of the output. */\n    unsigned int                       version;               /* [in] Plugin writer's version number. */\n    int                                polling;               /* [in] If TRUE (non zero), this tells FMOD to start a thread and call getposition / lock / unlock for feeding data.  If 0, the output is probably callback based, so all the plugin needs to do is call readfrommixer to the appropriate pointer. */ \n    FMOD_OUTPUT_GETNUMDRIVERSCALLBACK  getnumdrivers;         /* [in] For sound device enumeration.  This callback is to give System::getNumDrivers somthing to return. */\n    FMOD_OUTPUT_GETDRIVERNAMECALLBACK  getdrivername;         /* [in] For sound device enumeration.  This callback is to give System::getDriverName somthing to return. */\n    FMOD_OUTPUT_GETDRIVERCAPSCALLBACK  getdrivercaps;         /* [in] For sound device enumeration.  This callback is to give System::getDriverCaps somthing to return. */\n    FMOD_OUTPUT_INITCALLBACK           init;                  /* [in] Initialization function for the output device.  This is called from System::init. */\n    FMOD_OUTPUT_CLOSECALLBACK          close;                 /* [in] Cleanup / close down function for the output device.  This is called from System::close. */\n    FMOD_OUTPUT_UPDATECALLBACK         update;                /* [in] Update function that is called once a frame by the user.  This is called from System::update. */\n    FMOD_OUTPUT_GETHANDLECALLBACK      gethandle;             /* [in] This is called from System::getOutputHandle.  This is just to return a pointer to the internal system device object that the system may be using.*/\n    FMOD_OUTPUT_GETPOSITIONCALLBACK    getposition;           /* [in] This is called from the FMOD software mixer thread if 'polling' = true.  This returns a position value in samples so that FMOD knows where and when to fill its buffer. */\n    FMOD_OUTPUT_LOCKCALLBACK           lock;                  /* [in] This is called from the FMOD software mixer thread if 'polling' = true.  This function provides a pointer to data that FMOD can write to when software mixing. */\n    FMOD_OUTPUT_UNLOCKCALLBACK         unlock;                /* [in] This is called from the FMOD software mixer thread if 'polling' = true.  This optional function accepts the data that has been mixed and copies it or does whatever it needs to before sending it to the hardware. */\n} FMOD_OUTPUT_DESCRIPTION;\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Output plugin structure that is passed into each callback.\n\n    [REMARKS]\n    Members marked with [in] mean the variable can be written to.  The user can set the value.<br>\n    Members marked with [out] mean the variable is modified by FMOD and is for reading purposes only.  Do not change this value.<br>\n\n    [PLATFORMS]\n    Win32, Win64, Linux, Linux64, Macintosh, Xbox360, PlayStation Portable, PlayStation 3, Wii, iPhone, 3GS, NGP, Android\n\n    [SEE_ALSO]\n    FMOD_OUTPUT_DESCRIPTION\n]\n*/\nstruct FMOD_OUTPUT_STATE\n{\n    void                      *plugindata;      /* [in] Plugin writer created data the output author wants to attach to this object. */\n    FMOD_OUTPUT_READFROMMIXER  readfrommixer;   /* [out] Function to update mixer and write the result to the provided pointer.  Used from callback based output only.  Polling based output uses lock/unlock/getposition. */\n};\n\n#endif\n\n\n"
  },
  {
    "path": "cocos2d/external/linux-specific/fmod/include/64-bit/fmodlinux.h",
    "content": "/* =========================================================================================== */\n/* FMOD Linux Specific header file. Copyright (c), Firelight Technologies Pty, Ltd. 2005-2011. */\n/* =========================================================================================== */\n\n#ifndef _FMODLINUX_H\n#define _FMODLINUX_H\n\n#include \"fmod.h\"\n\n\n/*\n[STRUCTURE] \n[\n    [DESCRIPTION]\n    Use this structure with System::init to set the information required for linux\n    initialisation.\n\n    Pass this structure in as the \"extradriverdata\" parameter in System::init.\n\n    [REMARKS]\n\n    [PLATFORMS]\n    Linux, Linux64\n\n    [SEE_ALSO]\n    System::init\n]\n*/\ntypedef struct FMOD_LINUX_EXTRADRIVERDATA\n{\n    const char  *output_driver_arguments;    /* ALSA Only - Arguments to apply to the selected output driver */\n    const char  *record_driver_arguments;    /* ALSA Only - Arguments to apply to the selected input (record) driver */\n} FMOD_LINUX_EXTRADRIVERDATA;\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/CMakeLists.txt",
    "content": "set(LUA_SRC\n  lapi.c\n  lauxlib.c\n  lbaselib.c\n  lcode.c\n  ldblib.c\n  ldebug.c\n  ldo.c\n  ldump.c\n  lfunc.c\n  lgc.c\n  linit.c\n  liolib.c\n  llex.c\n  lmathlib.c\n  lmem.c\n  loadlib.c\n  lobject.c\n  lopcodes.c\n  loslib.c\n  lparser.c\n  lstate.c\n  lstring.c\n  lstrlib.c\n  ltable.c\n  ltablib.c\n  ltm.c\n  lundump.c\n  lvm.c\n  lzio.c\n  print.c\n)\n\nadd_library(lua STATIC\n  ${LUA_SRC}\n)\n\nset_target_properties(lua\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lapi.c",
    "content": "/*\n** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $\n** Lua API\n** See Copyright Notice in lua.h\n*/\n\n\n#include <assert.h>\n#include <math.h>\n#include <stdarg.h>\n#include <string.h>\n\n#define lapi_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lapi.h\"\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"lgc.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"ltm.h\"\n#include \"lundump.h\"\n#include \"lvm.h\"\n\n\n\nconst char lua_ident[] =\n  \"$Lua: \" LUA_RELEASE \" \" LUA_COPYRIGHT \" $\\n\"\n  \"$Authors: \" LUA_AUTHORS \" $\\n\"\n  \"$URL: www.lua.org $\\n\";\n\n\n\n#define api_checknelems(L, n)\tapi_check(L, (n) <= (L->top - L->base))\n\n#define api_checkvalidindex(L, i)\tapi_check(L, (i) != luaO_nilobject)\n\n#define api_incr_top(L)   {api_check(L, L->top < L->ci->top); L->top++;}\n\n\n\nstatic TValue *index2adr (lua_State *L, int idx) {\n  if (idx > 0) {\n    TValue *o = L->base + (idx - 1);\n    api_check(L, idx <= L->ci->top - L->base);\n    if (o >= L->top) return cast(TValue *, luaO_nilobject);\n    else return o;\n  }\n  else if (idx > LUA_REGISTRYINDEX) {\n    api_check(L, idx != 0 && -idx <= L->top - L->base);\n    return L->top + idx;\n  }\n  else switch (idx) {  /* pseudo-indices */\n    case LUA_REGISTRYINDEX: return registry(L);\n    case LUA_ENVIRONINDEX: {\n      Closure *func = curr_func(L);\n      sethvalue(L, &L->env, func->c.env);\n      return &L->env;\n    }\n    case LUA_GLOBALSINDEX: return gt(L);\n    default: {\n      Closure *func = curr_func(L);\n      idx = LUA_GLOBALSINDEX - idx;\n      return (idx <= func->c.nupvalues)\n                ? &func->c.upvalue[idx-1]\n                : cast(TValue *, luaO_nilobject);\n    }\n  }\n}\n\n\nstatic Table *getcurrenv (lua_State *L) {\n  if (L->ci == L->base_ci)  /* no enclosing function? */\n    return hvalue(gt(L));  /* use global table as environment */\n  else {\n    Closure *func = curr_func(L);\n    return func->c.env;\n  }\n}\n\n\nvoid luaA_pushobject (lua_State *L, const TValue *o) {\n  setobj2s(L, L->top, o);\n  api_incr_top(L);\n}\n\n\nLUA_API int lua_checkstack (lua_State *L, int size) {\n  int res = 1;\n  lua_lock(L);\n  if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK)\n    res = 0;  /* stack overflow */\n  else if (size > 0) {\n    luaD_checkstack(L, size);\n    if (L->ci->top < L->top + size)\n      L->ci->top = L->top + size;\n  }\n  lua_unlock(L);\n  return res;\n}\n\n\nLUA_API void lua_xmove (lua_State *from, lua_State *to, int n) {\n  int i;\n  if (from == to) return;\n  lua_lock(to);\n  api_checknelems(from, n);\n  api_check(from, G(from) == G(to));\n  api_check(from, to->ci->top - to->top >= n);\n  from->top -= n;\n  for (i = 0; i < n; i++) {\n    setobj2s(to, to->top++, from->top + i);\n  }\n  lua_unlock(to);\n}\n\n\nLUA_API void lua_setlevel (lua_State *from, lua_State *to) {\n  to->nCcalls = from->nCcalls;\n}\n\n\nLUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) {\n  lua_CFunction old;\n  lua_lock(L);\n  old = G(L)->panic;\n  G(L)->panic = panicf;\n  lua_unlock(L);\n  return old;\n}\n\n\nLUA_API lua_State *lua_newthread (lua_State *L) {\n  lua_State *L1;\n  lua_lock(L);\n  luaC_checkGC(L);\n  L1 = luaE_newthread(L);\n  setthvalue(L, L->top, L1);\n  api_incr_top(L);\n  lua_unlock(L);\n  luai_userstatethread(L, L1);\n  return L1;\n}\n\n\n\n/*\n** basic stack manipulation\n*/\n\n\nLUA_API int lua_gettop (lua_State *L) {\n  return cast_int(L->top - L->base);\n}\n\n\nLUA_API void lua_settop (lua_State *L, int idx) {\n  lua_lock(L);\n  if (idx >= 0) {\n    api_check(L, idx <= L->stack_last - L->base);\n    while (L->top < L->base + idx)\n      setnilvalue(L->top++);\n    L->top = L->base + idx;\n  }\n  else {\n    api_check(L, -(idx+1) <= (L->top - L->base));\n    L->top += idx+1;  /* `subtract' index (index is negative) */\n  }\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_remove (lua_State *L, int idx) {\n  StkId p;\n  lua_lock(L);\n  p = index2adr(L, idx);\n  api_checkvalidindex(L, p);\n  while (++p < L->top) setobjs2s(L, p-1, p);\n  L->top--;\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_insert (lua_State *L, int idx) {\n  StkId p;\n  StkId q;\n  lua_lock(L);\n  p = index2adr(L, idx);\n  api_checkvalidindex(L, p);\n  for (q = L->top; q>p; q--) setobjs2s(L, q, q-1);\n  setobjs2s(L, p, L->top);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_replace (lua_State *L, int idx) {\n  StkId o;\n  lua_lock(L);\n  /* explicit test for incompatible code */\n  if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci)\n    luaG_runerror(L, \"no calling environment\");\n  api_checknelems(L, 1);\n  o = index2adr(L, idx);\n  api_checkvalidindex(L, o);\n  if (idx == LUA_ENVIRONINDEX) {\n    Closure *func = curr_func(L);\n    api_check(L, ttistable(L->top - 1)); \n    func->c.env = hvalue(L->top - 1);\n    luaC_barrier(L, func, L->top - 1);\n  }\n  else {\n    setobj(L, o, L->top - 1);\n    if (idx < LUA_GLOBALSINDEX)  /* function upvalue? */\n      luaC_barrier(L, curr_func(L), L->top - 1);\n  }\n  L->top--;\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_pushvalue (lua_State *L, int idx) {\n  lua_lock(L);\n  setobj2s(L, L->top, index2adr(L, idx));\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\n\n/*\n** access functions (stack -> C)\n*/\n\n\nLUA_API int lua_type (lua_State *L, int idx) {\n  StkId o = index2adr(L, idx);\n  return (o == luaO_nilobject) ? LUA_TNONE : ttype(o);\n}\n\n\nLUA_API const char *lua_typename (lua_State *L, int t) {\n  UNUSED(L);\n  return (t == LUA_TNONE) ? \"no value\" : luaT_typenames[t];\n}\n\n\nLUA_API int lua_iscfunction (lua_State *L, int idx) {\n  StkId o = index2adr(L, idx);\n  return iscfunction(o);\n}\n\n\nLUA_API int lua_isnumber (lua_State *L, int idx) {\n  TValue n;\n  const TValue *o = index2adr(L, idx);\n  return tonumber(o, &n);\n}\n\n\nLUA_API int lua_isstring (lua_State *L, int idx) {\n  int t = lua_type(L, idx);\n  return (t == LUA_TSTRING || t == LUA_TNUMBER);\n}\n\n\nLUA_API int lua_isuserdata (lua_State *L, int idx) {\n  const TValue *o = index2adr(L, idx);\n  return (ttisuserdata(o) || ttislightuserdata(o));\n}\n\n\nLUA_API int lua_rawequal (lua_State *L, int index1, int index2) {\n  StkId o1 = index2adr(L, index1);\n  StkId o2 = index2adr(L, index2);\n  return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0\n         : luaO_rawequalObj(o1, o2);\n}\n\n\nLUA_API int lua_equal (lua_State *L, int index1, int index2) {\n  StkId o1, o2;\n  int i;\n  lua_lock(L);  /* may call tag method */\n  o1 = index2adr(L, index1);\n  o2 = index2adr(L, index2);\n  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2);\n  lua_unlock(L);\n  return i;\n}\n\n\nLUA_API int lua_lessthan (lua_State *L, int index1, int index2) {\n  StkId o1, o2;\n  int i;\n  lua_lock(L);  /* may call tag method */\n  o1 = index2adr(L, index1);\n  o2 = index2adr(L, index2);\n  i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0\n       : luaV_lessthan(L, o1, o2);\n  lua_unlock(L);\n  return i;\n}\n\n\n\nLUA_API lua_Number lua_tonumber (lua_State *L, int idx) {\n  TValue n;\n  const TValue *o = index2adr(L, idx);\n  if (tonumber(o, &n))\n    return nvalue(o);\n  else\n    return 0;\n}\n\n\nLUA_API lua_Integer lua_tointeger (lua_State *L, int idx) {\n  TValue n;\n  const TValue *o = index2adr(L, idx);\n  if (tonumber(o, &n)) {\n    lua_Integer res;\n    lua_Number num = nvalue(o);\n    lua_number2integer(res, num);\n    return res;\n  }\n  else\n    return 0;\n}\n\n\nLUA_API int lua_toboolean (lua_State *L, int idx) {\n  const TValue *o = index2adr(L, idx);\n  return !l_isfalse(o);\n}\n\n\nLUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {\n  StkId o = index2adr(L, idx);\n  if (!ttisstring(o)) {\n    lua_lock(L);  /* `luaV_tostring' may create a new string */\n    if (!luaV_tostring(L, o)) {  /* conversion failed? */\n      if (len != NULL) *len = 0;\n      lua_unlock(L);\n      return NULL;\n    }\n    luaC_checkGC(L);\n    o = index2adr(L, idx);  /* previous call may reallocate the stack */\n    lua_unlock(L);\n  }\n  if (len != NULL) *len = tsvalue(o)->len;\n  return svalue(o);\n}\n\n\nLUA_API size_t lua_objlen (lua_State *L, int idx) {\n  StkId o = index2adr(L, idx);\n  switch (ttype(o)) {\n    case LUA_TSTRING: return tsvalue(o)->len;\n    case LUA_TUSERDATA: return uvalue(o)->len;\n    case LUA_TTABLE: return luaH_getn(hvalue(o));\n    case LUA_TNUMBER: {\n      size_t l;\n      lua_lock(L);  /* `luaV_tostring' may create a new string */\n      l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0);\n      lua_unlock(L);\n      return l;\n    }\n    default: return 0;\n  }\n}\n\n\nLUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) {\n  StkId o = index2adr(L, idx);\n  return (!iscfunction(o)) ? NULL : clvalue(o)->c.f;\n}\n\n\nLUA_API void *lua_touserdata (lua_State *L, int idx) {\n  StkId o = index2adr(L, idx);\n  switch (ttype(o)) {\n    case LUA_TUSERDATA: return (rawuvalue(o) + 1);\n    case LUA_TLIGHTUSERDATA: return pvalue(o);\n    default: return NULL;\n  }\n}\n\n\nLUA_API lua_State *lua_tothread (lua_State *L, int idx) {\n  StkId o = index2adr(L, idx);\n  return (!ttisthread(o)) ? NULL : thvalue(o);\n}\n\n\nLUA_API const void *lua_topointer (lua_State *L, int idx) {\n  StkId o = index2adr(L, idx);\n  switch (ttype(o)) {\n    case LUA_TTABLE: return hvalue(o);\n    case LUA_TFUNCTION: return clvalue(o);\n    case LUA_TTHREAD: return thvalue(o);\n    case LUA_TUSERDATA:\n    case LUA_TLIGHTUSERDATA:\n      return lua_touserdata(L, idx);\n    default: return NULL;\n  }\n}\n\n\n\n/*\n** push functions (C -> stack)\n*/\n\n\nLUA_API void lua_pushnil (lua_State *L) {\n  lua_lock(L);\n  setnilvalue(L->top);\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_pushnumber (lua_State *L, lua_Number n) {\n  lua_lock(L);\n  setnvalue(L->top, n);\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_pushinteger (lua_State *L, lua_Integer n) {\n  lua_lock(L);\n  setnvalue(L->top, cast_num(n));\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {\n  lua_lock(L);\n  luaC_checkGC(L);\n  setsvalue2s(L, L->top, luaS_newlstr(L, s, len));\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_pushstring (lua_State *L, const char *s) {\n  if (s == NULL)\n    lua_pushnil(L);\n  else\n    lua_pushlstring(L, s, strlen(s));\n}\n\n\nLUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt,\n                                      va_list argp) {\n  const char *ret;\n  lua_lock(L);\n  luaC_checkGC(L);\n  ret = luaO_pushvfstring(L, fmt, argp);\n  lua_unlock(L);\n  return ret;\n}\n\n\nLUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) {\n  const char *ret;\n  va_list argp;\n  lua_lock(L);\n  luaC_checkGC(L);\n  va_start(argp, fmt);\n  ret = luaO_pushvfstring(L, fmt, argp);\n  va_end(argp);\n  lua_unlock(L);\n  return ret;\n}\n\n\nLUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {\n  Closure *cl;\n  lua_lock(L);\n  luaC_checkGC(L);\n  api_checknelems(L, n);\n  cl = luaF_newCclosure(L, n, getcurrenv(L));\n  cl->c.f = fn;\n  L->top -= n;\n  while (n--)\n    setobj2n(L, &cl->c.upvalue[n], L->top+n);\n  setclvalue(L, L->top, cl);\n  lua_assert(iswhite(obj2gco(cl)));\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_pushboolean (lua_State *L, int b) {\n  lua_lock(L);\n  setbvalue(L->top, (b != 0));  /* ensure that true is 1 */\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_pushlightuserdata (lua_State *L, void *p) {\n  lua_lock(L);\n  setpvalue(L->top, p);\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API int lua_pushthread (lua_State *L) {\n  lua_lock(L);\n  setthvalue(L, L->top, L);\n  api_incr_top(L);\n  lua_unlock(L);\n  return (G(L)->mainthread == L);\n}\n\n\n\n/*\n** get functions (Lua -> stack)\n*/\n\n\nLUA_API void lua_gettable (lua_State *L, int idx) {\n  StkId t;\n  lua_lock(L);\n  t = index2adr(L, idx);\n  api_checkvalidindex(L, t);\n  luaV_gettable(L, t, L->top - 1, L->top - 1);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_getfield (lua_State *L, int idx, const char *k) {\n  StkId t;\n  TValue key;\n  lua_lock(L);\n  t = index2adr(L, idx);\n  api_checkvalidindex(L, t);\n  setsvalue(L, &key, luaS_new(L, k));\n  luaV_gettable(L, t, &key, L->top);\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_rawget (lua_State *L, int idx) {\n  StkId t;\n  lua_lock(L);\n  t = index2adr(L, idx);\n  api_check(L, ttistable(t));\n  setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1));\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_rawgeti (lua_State *L, int idx, int n) {\n  StkId o;\n  lua_lock(L);\n  o = index2adr(L, idx);\n  api_check(L, ttistable(o));\n  setobj2s(L, L->top, luaH_getnum(hvalue(o), n));\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_createtable (lua_State *L, int narray, int nrec) {\n  lua_lock(L);\n  luaC_checkGC(L);\n  sethvalue(L, L->top, luaH_new(L, narray, nrec));\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\nLUA_API int lua_getmetatable (lua_State *L, int objindex) {\n  const TValue *obj;\n  Table *mt = NULL;\n  int res;\n  lua_lock(L);\n  obj = index2adr(L, objindex);\n  switch (ttype(obj)) {\n    case LUA_TTABLE:\n      mt = hvalue(obj)->metatable;\n      break;\n    case LUA_TUSERDATA:\n      mt = uvalue(obj)->metatable;\n      break;\n    default:\n      mt = G(L)->mt[ttype(obj)];\n      break;\n  }\n  if (mt == NULL)\n    res = 0;\n  else {\n    sethvalue(L, L->top, mt);\n    api_incr_top(L);\n    res = 1;\n  }\n  lua_unlock(L);\n  return res;\n}\n\n\nLUA_API void lua_getfenv (lua_State *L, int idx) {\n  StkId o;\n  lua_lock(L);\n  o = index2adr(L, idx);\n  api_checkvalidindex(L, o);\n  switch (ttype(o)) {\n    case LUA_TFUNCTION:\n      sethvalue(L, L->top, clvalue(o)->c.env);\n      break;\n    case LUA_TUSERDATA:\n      sethvalue(L, L->top, uvalue(o)->env);\n      break;\n    case LUA_TTHREAD:\n      setobj2s(L, L->top,  gt(thvalue(o)));\n      break;\n    default:\n      setnilvalue(L->top);\n      break;\n  }\n  api_incr_top(L);\n  lua_unlock(L);\n}\n\n\n/*\n** set functions (stack -> Lua)\n*/\n\n\nLUA_API void lua_settable (lua_State *L, int idx) {\n  StkId t;\n  lua_lock(L);\n  api_checknelems(L, 2);\n  t = index2adr(L, idx);\n  api_checkvalidindex(L, t);\n  luaV_settable(L, t, L->top - 2, L->top - 1);\n  L->top -= 2;  /* pop index and value */\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_setfield (lua_State *L, int idx, const char *k) {\n  StkId t;\n  TValue key;\n  lua_lock(L);\n  api_checknelems(L, 1);\n  t = index2adr(L, idx);\n  api_checkvalidindex(L, t);\n  setsvalue(L, &key, luaS_new(L, k));\n  luaV_settable(L, t, &key, L->top - 1);\n  L->top--;  /* pop value */\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_rawset (lua_State *L, int idx) {\n  StkId t;\n  lua_lock(L);\n  api_checknelems(L, 2);\n  t = index2adr(L, idx);\n  api_check(L, ttistable(t));\n  setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1);\n  luaC_barriert(L, hvalue(t), L->top-1);\n  L->top -= 2;\n  lua_unlock(L);\n}\n\n\nLUA_API void lua_rawseti (lua_State *L, int idx, int n) {\n  StkId o;\n  lua_lock(L);\n  api_checknelems(L, 1);\n  o = index2adr(L, idx);\n  api_check(L, ttistable(o));\n  setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1);\n  luaC_barriert(L, hvalue(o), L->top-1);\n  L->top--;\n  lua_unlock(L);\n}\n\n\nLUA_API int lua_setmetatable (lua_State *L, int objindex) {\n  TValue *obj;\n  Table *mt;\n  lua_lock(L);\n  api_checknelems(L, 1);\n  obj = index2adr(L, objindex);\n  api_checkvalidindex(L, obj);\n  if (ttisnil(L->top - 1))\n    mt = NULL;\n  else {\n    api_check(L, ttistable(L->top - 1));\n    mt = hvalue(L->top - 1);\n  }\n  switch (ttype(obj)) {\n    case LUA_TTABLE: {\n      hvalue(obj)->metatable = mt;\n      if (mt)\n        luaC_objbarriert(L, hvalue(obj), mt);\n      break;\n    }\n    case LUA_TUSERDATA: {\n      uvalue(obj)->metatable = mt;\n      if (mt)\n        luaC_objbarrier(L, rawuvalue(obj), mt);\n      break;\n    }\n    default: {\n      G(L)->mt[ttype(obj)] = mt;\n      break;\n    }\n  }\n  L->top--;\n  lua_unlock(L);\n  return 1;\n}\n\n\nLUA_API int lua_setfenv (lua_State *L, int idx) {\n  StkId o;\n  int res = 1;\n  lua_lock(L);\n  api_checknelems(L, 1);\n  o = index2adr(L, idx);\n  api_checkvalidindex(L, o);\n  api_check(L, ttistable(L->top - 1));\n  switch (ttype(o)) {\n    case LUA_TFUNCTION:\n      clvalue(o)->c.env = hvalue(L->top - 1);\n      break;\n    case LUA_TUSERDATA:\n      uvalue(o)->env = hvalue(L->top - 1);\n      break;\n    case LUA_TTHREAD:\n      sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1));\n      break;\n    default:\n      res = 0;\n      break;\n  }\n  if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1));\n  L->top--;\n  lua_unlock(L);\n  return res;\n}\n\n\n/*\n** `load' and `call' functions (run Lua code)\n*/\n\n\n#define adjustresults(L,nres) \\\n    { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; }\n\n\n#define checkresults(L,na,nr) \\\n     api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)))\n\t\n\nLUA_API void lua_call (lua_State *L, int nargs, int nresults) {\n  StkId func;\n  lua_lock(L);\n  api_checknelems(L, nargs+1);\n  checkresults(L, nargs, nresults);\n  func = L->top - (nargs+1);\n  luaD_call(L, func, nresults);\n  adjustresults(L, nresults);\n  lua_unlock(L);\n}\n\n\n\n/*\n** Execute a protected call.\n*/\nstruct CallS {  /* data to `f_call' */\n  StkId func;\n  int nresults;\n};\n\n\nstatic void f_call (lua_State *L, void *ud) {\n  struct CallS *c = cast(struct CallS *, ud);\n  luaD_call(L, c->func, c->nresults);\n}\n\n\n\nLUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) {\n  struct CallS c;\n  int status;\n  ptrdiff_t func;\n  lua_lock(L);\n  api_checknelems(L, nargs+1);\n  checkresults(L, nargs, nresults);\n  if (errfunc == 0)\n    func = 0;\n  else {\n    StkId o = index2adr(L, errfunc);\n    api_checkvalidindex(L, o);\n    func = savestack(L, o);\n  }\n  c.func = L->top - (nargs+1);  /* function to be called */\n  c.nresults = nresults;\n  status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func);\n  adjustresults(L, nresults);\n  lua_unlock(L);\n  return status;\n}\n\n\n/*\n** Execute a protected C call.\n*/\nstruct CCallS {  /* data to `f_Ccall' */\n  lua_CFunction func;\n  void *ud;\n};\n\n\nstatic void f_Ccall (lua_State *L, void *ud) {\n  struct CCallS *c = cast(struct CCallS *, ud);\n  Closure *cl;\n  cl = luaF_newCclosure(L, 0, getcurrenv(L));\n  cl->c.f = c->func;\n  setclvalue(L, L->top, cl);  /* push function */\n  api_incr_top(L);\n  setpvalue(L->top, c->ud);  /* push only argument */\n  api_incr_top(L);\n  luaD_call(L, L->top - 2, 0);\n}\n\n\nLUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) {\n  struct CCallS c;\n  int status;\n  lua_lock(L);\n  c.func = func;\n  c.ud = ud;\n  status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0);\n  lua_unlock(L);\n  return status;\n}\n\n\nLUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,\n                      const char *chunkname) {\n  ZIO z;\n  int status;\n  lua_lock(L);\n  if (!chunkname) chunkname = \"?\";\n  luaZ_init(L, &z, reader, data);\n  status = luaD_protectedparser(L, &z, chunkname);\n  lua_unlock(L);\n  return status;\n}\n\n\nLUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) {\n  int status;\n  TValue *o;\n  lua_lock(L);\n  api_checknelems(L, 1);\n  o = L->top - 1;\n  if (isLfunction(o))\n    status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0);\n  else\n    status = 1;\n  lua_unlock(L);\n  return status;\n}\n\n\nLUA_API int  lua_status (lua_State *L) {\n  return L->status;\n}\n\n\n/*\n** Garbage-collection function\n*/\n\nLUA_API int lua_gc (lua_State *L, int what, int data) {\n  int res = 0;\n  global_State *g;\n  lua_lock(L);\n  g = G(L);\n  switch (what) {\n    case LUA_GCSTOP: {\n      g->GCthreshold = MAX_LUMEM;\n      break;\n    }\n    case LUA_GCRESTART: {\n      g->GCthreshold = g->totalbytes;\n      break;\n    }\n    case LUA_GCCOLLECT: {\n      luaC_fullgc(L);\n      break;\n    }\n    case LUA_GCCOUNT: {\n      /* GC values are expressed in Kbytes: #bytes/2^10 */\n      res = cast_int(g->totalbytes >> 10);\n      break;\n    }\n    case LUA_GCCOUNTB: {\n      res = cast_int(g->totalbytes & 0x3ff);\n      break;\n    }\n    case LUA_GCSTEP: {\n      lu_mem a = (cast(lu_mem, data) << 10);\n      if (a <= g->totalbytes)\n        g->GCthreshold = g->totalbytes - a;\n      else\n        g->GCthreshold = 0;\n      while (g->GCthreshold <= g->totalbytes) {\n        luaC_step(L);\n        if (g->gcstate == GCSpause) {  /* end of cycle? */\n          res = 1;  /* signal it */\n          break;\n        }\n      }\n      break;\n    }\n    case LUA_GCSETPAUSE: {\n      res = g->gcpause;\n      g->gcpause = data;\n      break;\n    }\n    case LUA_GCSETSTEPMUL: {\n      res = g->gcstepmul;\n      g->gcstepmul = data;\n      break;\n    }\n    default: res = -1;  /* invalid option */\n  }\n  lua_unlock(L);\n  return res;\n}\n\n\n\n/*\n** miscellaneous functions\n*/\n\n\nLUA_API int lua_error (lua_State *L) {\n  lua_lock(L);\n  api_checknelems(L, 1);\n  luaG_errormsg(L);\n  lua_unlock(L);\n  return 0;  /* to avoid warnings */\n}\n\n\nLUA_API int lua_next (lua_State *L, int idx) {\n  StkId t;\n  int more;\n  lua_lock(L);\n  t = index2adr(L, idx);\n  api_check(L, ttistable(t));\n  more = luaH_next(L, hvalue(t), L->top - 1);\n  if (more) {\n    api_incr_top(L);\n  }\n  else  /* no more elements */\n    L->top -= 1;  /* remove key */\n  lua_unlock(L);\n  return more;\n}\n\n\nLUA_API void lua_concat (lua_State *L, int n) {\n  lua_lock(L);\n  api_checknelems(L, n);\n  if (n >= 2) {\n    luaC_checkGC(L);\n    luaV_concat(L, n, cast_int(L->top - L->base) - 1);\n    L->top -= (n-1);\n  }\n  else if (n == 0) {  /* push empty string */\n    setsvalue2s(L, L->top, luaS_newlstr(L, \"\", 0));\n    api_incr_top(L);\n  }\n  /* else n == 1; nothing to do */\n  lua_unlock(L);\n}\n\n\nLUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) {\n  lua_Alloc f;\n  lua_lock(L);\n  if (ud) *ud = G(L)->ud;\n  f = G(L)->frealloc;\n  lua_unlock(L);\n  return f;\n}\n\n\nLUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) {\n  lua_lock(L);\n  G(L)->ud = ud;\n  G(L)->frealloc = f;\n  lua_unlock(L);\n}\n\n\nLUA_API void *lua_newuserdata (lua_State *L, size_t size) {\n  Udata *u;\n  lua_lock(L);\n  luaC_checkGC(L);\n  u = luaS_newudata(L, size, getcurrenv(L));\n  setuvalue(L, L->top, u);\n  api_incr_top(L);\n  lua_unlock(L);\n  return u + 1;\n}\n\n\n\n\nstatic const char *aux_upvalue (StkId fi, int n, TValue **val) {\n  Closure *f;\n  if (!ttisfunction(fi)) return NULL;\n  f = clvalue(fi);\n  if (f->c.isC) {\n    if (!(1 <= n && n <= f->c.nupvalues)) return NULL;\n    *val = &f->c.upvalue[n-1];\n    return \"\";\n  }\n  else {\n    Proto *p = f->l.p;\n    if (!(1 <= n && n <= p->sizeupvalues)) return NULL;\n    *val = f->l.upvals[n-1]->v;\n    return getstr(p->upvalues[n-1]);\n  }\n}\n\n\nLUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) {\n  const char *name;\n  TValue *val;\n  lua_lock(L);\n  name = aux_upvalue(index2adr(L, funcindex), n, &val);\n  if (name) {\n    setobj2s(L, L->top, val);\n    api_incr_top(L);\n  }\n  lua_unlock(L);\n  return name;\n}\n\n\nLUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {\n  const char *name;\n  TValue *val;\n  StkId fi;\n  lua_lock(L);\n  fi = index2adr(L, funcindex);\n  api_checknelems(L, 1);\n  name = aux_upvalue(fi, n, &val);\n  if (name) {\n    L->top--;\n    setobj(L, val, L->top);\n    luaC_barrier(L, clvalue(fi), L->top);\n  }\n  lua_unlock(L);\n  return name;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lapi.h",
    "content": "/*\n** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $\n** Auxiliary functions from Lua API\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lapi_h\n#define lapi_h\n\n\n#include \"lobject.h\"\n\n\nLUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lauxlib.c",
    "content": "/*\n** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $\n** Auxiliary functions for building Lua libraries\n** See Copyright Notice in lua.h\n*/\n\n\n#include <ctype.h>\n#include <errno.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n\n/* This file uses only the official API of Lua.\n** Any function declared here could be written as an application function.\n*/\n\n#define lauxlib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n\n\n#define FREELIST_REF\t0\t/* free list of references */\n\n\n/* convert a stack index to positive */\n#define abs_index(L, i)\t\t((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \\\n\t\t\t\t\tlua_gettop(L) + (i) + 1)\n\n\n/*\n** {======================================================\n** Error-report functions\n** =======================================================\n*/\n\n\nLUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {\n  lua_Debug ar;\n  if (!lua_getstack(L, 0, &ar))  /* no stack frame? */\n    return luaL_error(L, \"bad argument #%d (%s)\", narg, extramsg);\n  lua_getinfo(L, \"n\", &ar);\n  if (strcmp(ar.namewhat, \"method\") == 0) {\n    narg--;  /* do not count `self' */\n    if (narg == 0)  /* error is in the self argument itself? */\n      return luaL_error(L, \"calling \" LUA_QS \" on bad self (%s)\",\n                           ar.name, extramsg);\n  }\n  if (ar.name == NULL)\n    ar.name = \"?\";\n  return luaL_error(L, \"bad argument #%d to \" LUA_QS \" (%s)\",\n                        narg, ar.name, extramsg);\n}\n\n\nLUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) {\n  const char *msg = lua_pushfstring(L, \"%s expected, got %s\",\n                                    tname, luaL_typename(L, narg));\n  return luaL_argerror(L, narg, msg);\n}\n\n\nstatic void tag_error (lua_State *L, int narg, int tag) {\n  luaL_typerror(L, narg, lua_typename(L, tag));\n}\n\n\nLUALIB_API void luaL_where (lua_State *L, int level) {\n  lua_Debug ar;\n  if (lua_getstack(L, level, &ar)) {  /* check function at level */\n    lua_getinfo(L, \"Sl\", &ar);  /* get info about it */\n    if (ar.currentline > 0) {  /* is there info? */\n      lua_pushfstring(L, \"%s:%d: \", ar.short_src, ar.currentline);\n      return;\n    }\n  }\n  lua_pushliteral(L, \"\");  /* else, no information available... */\n}\n\n\nLUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) {\n  va_list argp;\n  va_start(argp, fmt);\n  luaL_where(L, 1);\n  lua_pushvfstring(L, fmt, argp);\n  va_end(argp);\n  lua_concat(L, 2);\n  return lua_error(L);\n}\n\n/* }====================================================== */\n\n\nLUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def,\n                                 const char *const lst[]) {\n  const char *name = (def) ? luaL_optstring(L, narg, def) :\n                             luaL_checkstring(L, narg);\n  int i;\n  for (i=0; lst[i]; i++)\n    if (strcmp(lst[i], name) == 0)\n      return i;\n  return luaL_argerror(L, narg,\n                       lua_pushfstring(L, \"invalid option \" LUA_QS, name));\n}\n\n\nLUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) {\n  lua_getfield(L, LUA_REGISTRYINDEX, tname);  /* get registry.name */\n  if (!lua_isnil(L, -1))  /* name already in use? */\n    return 0;  /* leave previous value on top, but return 0 */\n  lua_pop(L, 1);\n  lua_newtable(L);  /* create metatable */\n  lua_pushvalue(L, -1);\n  lua_setfield(L, LUA_REGISTRYINDEX, tname);  /* registry.name = metatable */\n  return 1;\n}\n\n\nLUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) {\n  void *p = lua_touserdata(L, ud);\n  if (p != NULL) {  /* value is a userdata? */\n    if (lua_getmetatable(L, ud)) {  /* does it have a metatable? */\n      lua_getfield(L, LUA_REGISTRYINDEX, tname);  /* get correct metatable */\n      if (lua_rawequal(L, -1, -2)) {  /* does it have the correct mt? */\n        lua_pop(L, 2);  /* remove both metatables */\n        return p;\n      }\n    }\n  }\n  luaL_typerror(L, ud, tname);  /* else error */\n  return NULL;  /* to avoid warnings */\n}\n\n\nLUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) {\n  if (!lua_checkstack(L, space))\n    luaL_error(L, \"stack overflow (%s)\", mes);\n}\n\n\nLUALIB_API void luaL_checktype (lua_State *L, int narg, int t) {\n  if (lua_type(L, narg) != t)\n    tag_error(L, narg, t);\n}\n\n\nLUALIB_API void luaL_checkany (lua_State *L, int narg) {\n  if (lua_type(L, narg) == LUA_TNONE)\n    luaL_argerror(L, narg, \"value expected\");\n}\n\n\nLUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) {\n  const char *s = lua_tolstring(L, narg, len);\n  if (!s) tag_error(L, narg, LUA_TSTRING);\n  return s;\n}\n\n\nLUALIB_API const char *luaL_optlstring (lua_State *L, int narg,\n                                        const char *def, size_t *len) {\n  if (lua_isnoneornil(L, narg)) {\n    if (len)\n      *len = (def ? strlen(def) : 0);\n    return def;\n  }\n  else return luaL_checklstring(L, narg, len);\n}\n\n\nLUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {\n  lua_Number d = lua_tonumber(L, narg);\n  if (d == 0 && !lua_isnumber(L, narg))  /* avoid extra test when d is not 0 */\n    tag_error(L, narg, LUA_TNUMBER);\n  return d;\n}\n\n\nLUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) {\n  return luaL_opt(L, luaL_checknumber, narg, def);\n}\n\n\nLUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) {\n  lua_Integer d = lua_tointeger(L, narg);\n  if (d == 0 && !lua_isnumber(L, narg))  /* avoid extra test when d is not 0 */\n    tag_error(L, narg, LUA_TNUMBER);\n  return d;\n}\n\n\nLUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,\n                                                      lua_Integer def) {\n  return luaL_opt(L, luaL_checkinteger, narg, def);\n}\n\n\nLUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {\n  if (!lua_getmetatable(L, obj))  /* no metatable? */\n    return 0;\n  lua_pushstring(L, event);\n  lua_rawget(L, -2);\n  if (lua_isnil(L, -1)) {\n    lua_pop(L, 2);  /* remove metatable and metafield */\n    return 0;\n  }\n  else {\n    lua_remove(L, -2);  /* remove only metatable */\n    return 1;\n  }\n}\n\n\nLUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {\n  obj = abs_index(L, obj);\n  if (!luaL_getmetafield(L, obj, event))  /* no metafield? */\n    return 0;\n  lua_pushvalue(L, obj);\n  lua_call(L, 1, 1);\n  return 1;\n}\n\n\nLUALIB_API void (luaL_register) (lua_State *L, const char *libname,\n                                const luaL_Reg *l) {\n  luaI_openlib(L, libname, l, 0);\n}\n\n\nstatic int libsize (const luaL_Reg *l) {\n  int size = 0;\n  for (; l->name; l++) size++;\n  return size;\n}\n\n\nLUALIB_API void luaI_openlib (lua_State *L, const char *libname,\n                              const luaL_Reg *l, int nup) {\n  if (libname) {\n    int size = libsize(l);\n    /* check whether lib already exists */\n    luaL_findtable(L, LUA_REGISTRYINDEX, \"_LOADED\", 1);\n    lua_getfield(L, -1, libname);  /* get _LOADED[libname] */\n    if (!lua_istable(L, -1)) {  /* not found? */\n      lua_pop(L, 1);  /* remove previous result */\n      /* try global variable (and create one if it does not exist) */\n      if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL)\n        luaL_error(L, \"name conflict for module \" LUA_QS, libname);\n      lua_pushvalue(L, -1);\n      lua_setfield(L, -3, libname);  /* _LOADED[libname] = new table */\n    }\n    lua_remove(L, -2);  /* remove _LOADED table */\n    lua_insert(L, -(nup+1));  /* move library table to below upvalues */\n  }\n  for (; l->name; l++) {\n    int i;\n    for (i=0; i<nup; i++)  /* copy upvalues to the top */\n      lua_pushvalue(L, -nup);\n    lua_pushcclosure(L, l->func, nup);\n    lua_setfield(L, -(nup+2), l->name);\n  }\n  lua_pop(L, nup);  /* remove upvalues */\n}\n\n\n\n/*\n** {======================================================\n** getn-setn: size for arrays\n** =======================================================\n*/\n\n#if defined(LUA_COMPAT_GETN)\n\nstatic int checkint (lua_State *L, int topop) {\n  int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1;\n  lua_pop(L, topop);\n  return n;\n}\n\n\nstatic void getsizes (lua_State *L) {\n  lua_getfield(L, LUA_REGISTRYINDEX, \"LUA_SIZES\");\n  if (lua_isnil(L, -1)) {  /* no `size' table? */\n    lua_pop(L, 1);  /* remove nil */\n    lua_newtable(L);  /* create it */\n    lua_pushvalue(L, -1);  /* `size' will be its own metatable */\n    lua_setmetatable(L, -2);\n    lua_pushliteral(L, \"kv\");\n    lua_setfield(L, -2, \"__mode\");  /* metatable(N).__mode = \"kv\" */\n    lua_pushvalue(L, -1);\n    lua_setfield(L, LUA_REGISTRYINDEX, \"LUA_SIZES\");  /* store in register */\n  }\n}\n\n\nLUALIB_API void luaL_setn (lua_State *L, int t, int n) {\n  t = abs_index(L, t);\n  lua_pushliteral(L, \"n\");\n  lua_rawget(L, t);\n  if (checkint(L, 1) >= 0) {  /* is there a numeric field `n'? */\n    lua_pushliteral(L, \"n\");  /* use it */\n    lua_pushinteger(L, n);\n    lua_rawset(L, t);\n  }\n  else {  /* use `sizes' */\n    getsizes(L);\n    lua_pushvalue(L, t);\n    lua_pushinteger(L, n);\n    lua_rawset(L, -3);  /* sizes[t] = n */\n    lua_pop(L, 1);  /* remove `sizes' */\n  }\n}\n\n\nLUALIB_API int luaL_getn (lua_State *L, int t) {\n  int n;\n  t = abs_index(L, t);\n  lua_pushliteral(L, \"n\");  /* try t.n */\n  lua_rawget(L, t);\n  if ((n = checkint(L, 1)) >= 0) return n;\n  getsizes(L);  /* else try sizes[t] */\n  lua_pushvalue(L, t);\n  lua_rawget(L, -2);\n  if ((n = checkint(L, 2)) >= 0) return n;\n  return (int)lua_objlen(L, t);\n}\n\n#endif\n\n/* }====================================================== */\n\n\n\nLUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p,\n                                                               const char *r) {\n  const char *wild;\n  size_t l = strlen(p);\n  luaL_Buffer b;\n  luaL_buffinit(L, &b);\n  while ((wild = strstr(s, p)) != NULL) {\n    luaL_addlstring(&b, s, wild - s);  /* push prefix */\n    luaL_addstring(&b, r);  /* push replacement in place of pattern */\n    s = wild + l;  /* continue after `p' */\n  }\n  luaL_addstring(&b, s);  /* push last suffix */\n  luaL_pushresult(&b);\n  return lua_tostring(L, -1);\n}\n\n\nLUALIB_API const char *luaL_findtable (lua_State *L, int idx,\n                                       const char *fname, int szhint) {\n  const char *e;\n  lua_pushvalue(L, idx);\n  do {\n    e = strchr(fname, '.');\n    if (e == NULL) e = fname + strlen(fname);\n    lua_pushlstring(L, fname, e - fname);\n    lua_rawget(L, -2);\n    if (lua_isnil(L, -1)) {  /* no such field? */\n      lua_pop(L, 1);  /* remove this nil */\n      lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */\n      lua_pushlstring(L, fname, e - fname);\n      lua_pushvalue(L, -2);\n      lua_settable(L, -4);  /* set new table into field */\n    }\n    else if (!lua_istable(L, -1)) {  /* field has a non-table value? */\n      lua_pop(L, 2);  /* remove table and value */\n      return fname;  /* return problematic part of the name */\n    }\n    lua_remove(L, -2);  /* remove previous table */\n    fname = e + 1;\n  } while (*e == '.');\n  return NULL;\n}\n\n\n\n/*\n** {======================================================\n** Generic Buffer manipulation\n** =======================================================\n*/\n\n\n#define bufflen(B)\t((B)->p - (B)->buffer)\n#define bufffree(B)\t((size_t)(LUAL_BUFFERSIZE - bufflen(B)))\n\n#define LIMIT\t(LUA_MINSTACK/2)\n\n\nstatic int emptybuffer (luaL_Buffer *B) {\n  size_t l = bufflen(B);\n  if (l == 0) return 0;  /* put nothing on stack */\n  else {\n    lua_pushlstring(B->L, B->buffer, l);\n    B->p = B->buffer;\n    B->lvl++;\n    return 1;\n  }\n}\n\n\nstatic void adjuststack (luaL_Buffer *B) {\n  if (B->lvl > 1) {\n    lua_State *L = B->L;\n    int toget = 1;  /* number of levels to concat */\n    size_t toplen = lua_strlen(L, -1);\n    do {\n      size_t l = lua_strlen(L, -(toget+1));\n      if (B->lvl - toget + 1 >= LIMIT || toplen > l) {\n        toplen += l;\n        toget++;\n      }\n      else break;\n    } while (toget < B->lvl);\n    lua_concat(L, toget);\n    B->lvl = B->lvl - toget + 1;\n  }\n}\n\n\nLUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) {\n  if (emptybuffer(B))\n    adjuststack(B);\n  return B->buffer;\n}\n\n\nLUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) {\n  while (l--)\n    luaL_addchar(B, *s++);\n}\n\n\nLUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) {\n  luaL_addlstring(B, s, strlen(s));\n}\n\n\nLUALIB_API void luaL_pushresult (luaL_Buffer *B) {\n  emptybuffer(B);\n  lua_concat(B->L, B->lvl);\n  B->lvl = 1;\n}\n\n\nLUALIB_API void luaL_addvalue (luaL_Buffer *B) {\n  lua_State *L = B->L;\n  size_t vl;\n  const char *s = lua_tolstring(L, -1, &vl);\n  if (vl <= bufffree(B)) {  /* fit into buffer? */\n    memcpy(B->p, s, vl);  /* put it there */\n    B->p += vl;\n    lua_pop(L, 1);  /* remove from stack */\n  }\n  else {\n    if (emptybuffer(B))\n      lua_insert(L, -2);  /* put buffer before new value */\n    B->lvl++;  /* add new value into B stack */\n    adjuststack(B);\n  }\n}\n\n\nLUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) {\n  B->L = L;\n  B->p = B->buffer;\n  B->lvl = 0;\n}\n\n/* }====================================================== */\n\n\nLUALIB_API int luaL_ref (lua_State *L, int t) {\n  int ref;\n  t = abs_index(L, t);\n  if (lua_isnil(L, -1)) {\n    lua_pop(L, 1);  /* remove from stack */\n    return LUA_REFNIL;  /* `nil' has a unique fixed reference */\n  }\n  lua_rawgeti(L, t, FREELIST_REF);  /* get first free element */\n  ref = (int)lua_tointeger(L, -1);  /* ref = t[FREELIST_REF] */\n  lua_pop(L, 1);  /* remove it from stack */\n  if (ref != 0) {  /* any free element? */\n    lua_rawgeti(L, t, ref);  /* remove it from list */\n    lua_rawseti(L, t, FREELIST_REF);  /* (t[FREELIST_REF] = t[ref]) */\n  }\n  else {  /* no free elements */\n    ref = (int)lua_objlen(L, t);\n    ref++;  /* create new reference */\n  }\n  lua_rawseti(L, t, ref);\n  return ref;\n}\n\n\nLUALIB_API void luaL_unref (lua_State *L, int t, int ref) {\n  if (ref >= 0) {\n    t = abs_index(L, t);\n    lua_rawgeti(L, t, FREELIST_REF);\n    lua_rawseti(L, t, ref);  /* t[ref] = t[FREELIST_REF] */\n    lua_pushinteger(L, ref);\n    lua_rawseti(L, t, FREELIST_REF);  /* t[FREELIST_REF] = ref */\n  }\n}\n\n\n\n/*\n** {======================================================\n** Load functions\n** =======================================================\n*/\n\ntypedef struct LoadF {\n  int extraline;\n  FILE *f;\n  char buff[LUAL_BUFFERSIZE];\n} LoadF;\n\n\nstatic const char *getF (lua_State *L, void *ud, size_t *size) {\n  LoadF *lf = (LoadF *)ud;\n  (void)L;\n  if (lf->extraline) {\n    lf->extraline = 0;\n    *size = 1;\n    return \"\\n\";\n  }\n  if (feof(lf->f)) return NULL;\n  *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f);\n  return (*size > 0) ? lf->buff : NULL;\n}\n\n\nstatic int errfile (lua_State *L, const char *what, int fnameindex) {\n  const char *serr = strerror(errno);\n  const char *filename = lua_tostring(L, fnameindex) + 1;\n  lua_pushfstring(L, \"cannot %s %s: %s\", what, filename, serr);\n  lua_remove(L, fnameindex);\n  return LUA_ERRFILE;\n}\n\n\nLUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {\n  LoadF lf;\n  int status, readstatus;\n  int c;\n  int fnameindex = lua_gettop(L) + 1;  /* index of filename on the stack */\n  lf.extraline = 0;\n  if (filename == NULL) {\n    lua_pushliteral(L, \"=stdin\");\n    lf.f = stdin;\n  }\n  else {\n    lua_pushfstring(L, \"@%s\", filename);\n    lf.f = fopen(filename, \"r\");\n    if (lf.f == NULL) return errfile(L, \"open\", fnameindex);\n  }\n  c = getc(lf.f);\n  if (c == '#') {  /* Unix exec. file? */\n    lf.extraline = 1;\n    while ((c = getc(lf.f)) != EOF && c != '\\n') ;  /* skip first line */\n    if (c == '\\n') c = getc(lf.f);\n  }\n  if (c == LUA_SIGNATURE[0] && filename) {  /* binary file? */\n    lf.f = freopen(filename, \"rb\", lf.f);  /* reopen in binary mode */\n    if (lf.f == NULL) return errfile(L, \"reopen\", fnameindex);\n    /* skip eventual `#!...' */\n   while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;\n    lf.extraline = 0;\n  }\n  ungetc(c, lf.f);\n  status = lua_load(L, getF, &lf, lua_tostring(L, -1));\n  readstatus = ferror(lf.f);\n  if (filename) fclose(lf.f);  /* close file (even in case of errors) */\n  if (readstatus) {\n    lua_settop(L, fnameindex);  /* ignore results from `lua_load' */\n    return errfile(L, \"read\", fnameindex);\n  }\n  lua_remove(L, fnameindex);\n  return status;\n}\n\n\ntypedef struct LoadS {\n  const char *s;\n  size_t size;\n} LoadS;\n\n\nstatic const char *getS (lua_State *L, void *ud, size_t *size) {\n  LoadS *ls = (LoadS *)ud;\n  (void)L;\n  if (ls->size == 0) return NULL;\n  *size = ls->size;\n  ls->size = 0;\n  return ls->s;\n}\n\n\nLUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size,\n                                const char *name) {\n  LoadS ls;\n  ls.s = buff;\n  ls.size = size;\n  return lua_load(L, getS, &ls, name);\n}\n\n\nLUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) {\n  return luaL_loadbuffer(L, s, strlen(s), s);\n}\n\n\n\n/* }====================================================== */\n\n\nstatic void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {\n  (void)ud;\n  (void)osize;\n  if (nsize == 0) {\n    free(ptr);\n    return NULL;\n  }\n  else\n    return realloc(ptr, nsize);\n}\n\n\nstatic int panic (lua_State *L) {\n  (void)L;  /* to avoid warnings */\n  fprintf(stderr, \"PANIC: unprotected error in call to Lua API (%s)\\n\",\n                   lua_tostring(L, -1));\n  return 0;\n}\n\n\nLUALIB_API lua_State *luaL_newstate (void) {\n  lua_State *L = lua_newstate(l_alloc, NULL);\n  if (L) lua_atpanic(L, &panic);\n  return L;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lauxlib.h",
    "content": "/*\n** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $\n** Auxiliary functions for building Lua libraries\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lauxlib_h\n#define lauxlib_h\n\n\n#include <stddef.h>\n#include <stdio.h>\n\n#include \"lua.h\"\n\n\n#if defined(LUA_COMPAT_GETN)\nLUALIB_API int (luaL_getn) (lua_State *L, int t);\nLUALIB_API void (luaL_setn) (lua_State *L, int t, int n);\n#else\n#define luaL_getn(L,i)          ((int)lua_objlen(L, i))\n#define luaL_setn(L,i,j)        ((void)0)  /* no op! */\n#endif\n\n#if defined(LUA_COMPAT_OPENLIB)\n#define luaI_openlib\tluaL_openlib\n#endif\n\n\n/* extra error code for `luaL_load' */\n#define LUA_ERRFILE     (LUA_ERRERR+1)\n\n\ntypedef struct luaL_Reg {\n  const char *name;\n  lua_CFunction func;\n} luaL_Reg;\n\n\n\nLUALIB_API void (luaI_openlib) (lua_State *L, const char *libname,\n                                const luaL_Reg *l, int nup);\nLUALIB_API void (luaL_register) (lua_State *L, const char *libname,\n                                const luaL_Reg *l);\nLUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);\nLUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);\nLUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);\nLUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);\nLUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,\n                                                          size_t *l);\nLUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,\n                                          const char *def, size_t *l);\nLUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);\nLUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);\n\nLUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);\nLUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,\n                                          lua_Integer def);\n\nLUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);\nLUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);\nLUALIB_API void (luaL_checkany) (lua_State *L, int narg);\n\nLUALIB_API int   (luaL_newmetatable) (lua_State *L, const char *tname);\nLUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);\n\nLUALIB_API void (luaL_where) (lua_State *L, int lvl);\nLUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);\n\nLUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,\n                                   const char *const lst[]);\n\nLUALIB_API int (luaL_ref) (lua_State *L, int t);\nLUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);\n\nLUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);\nLUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,\n                                  const char *name);\nLUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);\n\nLUALIB_API lua_State *(luaL_newstate) (void);\n\n\nLUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,\n                                                  const char *r);\n\nLUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,\n                                         const char *fname, int szhint);\n\n\n\n\n/*\n** ===============================================================\n** some useful macros\n** ===============================================================\n*/\n\n#define luaL_argcheck(L, cond,numarg,extramsg)\t\\\n\t\t((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))\n#define luaL_checkstring(L,n)\t(luaL_checklstring(L, (n), NULL))\n#define luaL_optstring(L,n,d)\t(luaL_optlstring(L, (n), (d), NULL))\n#define luaL_checkint(L,n)\t((int)luaL_checkinteger(L, (n)))\n#define luaL_optint(L,n,d)\t((int)luaL_optinteger(L, (n), (d)))\n#define luaL_checklong(L,n)\t((long)luaL_checkinteger(L, (n)))\n#define luaL_optlong(L,n,d)\t((long)luaL_optinteger(L, (n), (d)))\n\n#define luaL_typename(L,i)\tlua_typename(L, lua_type(L,(i)))\n\n#define luaL_dofile(L, fn) \\\n\t(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\n#define luaL_dostring(L, s) \\\n\t(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\n#define luaL_getmetatable(L,n)\t(lua_getfield(L, LUA_REGISTRYINDEX, (n)))\n\n#define luaL_opt(L,f,n,d)\t(lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))\n\n/*\n** {======================================================\n** Generic Buffer manipulation\n** =======================================================\n*/\n\n\n\ntypedef struct luaL_Buffer {\n  char *p;\t\t\t/* current position in buffer */\n  int lvl;  /* number of strings in the stack (level) */\n  lua_State *L;\n  char buffer[LUAL_BUFFERSIZE];\n} luaL_Buffer;\n\n#define luaL_addchar(B,c) \\\n  ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \\\n   (*(B)->p++ = (char)(c)))\n\n/* compatibility only */\n#define luaL_putchar(B,c)\tluaL_addchar(B,c)\n\n#define luaL_addsize(B,n)\t((B)->p += (n))\n\nLUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);\nLUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);\nLUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);\nLUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);\nLUALIB_API void (luaL_addvalue) (luaL_Buffer *B);\nLUALIB_API void (luaL_pushresult) (luaL_Buffer *B);\n\n\n/* }====================================================== */\n\n\n/* compatibility with ref system */\n\n/* pre-defined references */\n#define LUA_NOREF       (-2)\n#define LUA_REFNIL      (-1)\n\n#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \\\n      (lua_pushstring(L, \"unlocked references are obsolete\"), lua_error(L), 0))\n\n#define lua_unref(L,ref)        luaL_unref(L, LUA_REGISTRYINDEX, (ref))\n\n#define lua_getref(L,ref)       lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))\n\n\n#define luaL_reg\tluaL_Reg\n\n#endif\n\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lbaselib.c",
    "content": "/*\n** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $\n** Basic library\n** See Copyright Notice in lua.h\n*/\n\n\n\n#include <ctype.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define lbaselib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n\n\n/*\n** If your system does not support `stdout', you can just remove this function.\n** If you need, you can define your own `print' function, following this\n** model but changing `fputs' to put the strings at a proper place\n** (a console window or a log file, for instance).\n*/\nstatic int luaB_print (lua_State *L) {\n  int n = lua_gettop(L);  /* number of arguments */\n  int i;\n  lua_getglobal(L, \"tostring\");\n  for (i=1; i<=n; i++) {\n    const char *s;\n    lua_pushvalue(L, -1);  /* function to be called */\n    lua_pushvalue(L, i);   /* value to print */\n    lua_call(L, 1, 1);\n    s = lua_tostring(L, -1);  /* get result */\n    if (s == NULL)\n      return luaL_error(L, LUA_QL(\"tostring\") \" must return a string to \"\n                           LUA_QL(\"print\"));\n    if (i>1) fputs(\"\\t\", stdout);\n    fputs(s, stdout);\n    lua_pop(L, 1);  /* pop result */\n  }\n  fputs(\"\\n\", stdout);\n  return 0;\n}\n\n\nstatic int luaB_tonumber (lua_State *L) {\n  int base = luaL_optint(L, 2, 10);\n  if (base == 10) {  /* standard conversion */\n    luaL_checkany(L, 1);\n    if (lua_isnumber(L, 1)) {\n      lua_pushnumber(L, lua_tonumber(L, 1));\n      return 1;\n    }\n  }\n  else {\n    const char *s1 = luaL_checkstring(L, 1);\n    char *s2;\n    unsigned long n;\n    luaL_argcheck(L, 2 <= base && base <= 36, 2, \"base out of range\");\n    n = strtoul(s1, &s2, base);\n    if (s1 != s2) {  /* at least one valid digit? */\n      while (isspace((unsigned char)(*s2))) s2++;  /* skip trailing spaces */\n      if (*s2 == '\\0') {  /* no invalid trailing characters? */\n        lua_pushnumber(L, (lua_Number)n);\n        return 1;\n      }\n    }\n  }\n  lua_pushnil(L);  /* else not a number */\n  return 1;\n}\n\n\nstatic int luaB_error (lua_State *L) {\n  int level = luaL_optint(L, 2, 1);\n  lua_settop(L, 1);\n  if (lua_isstring(L, 1) && level > 0) {  /* add extra information? */\n    luaL_where(L, level);\n    lua_pushvalue(L, 1);\n    lua_concat(L, 2);\n  }\n  return lua_error(L);\n}\n\n\nstatic int luaB_getmetatable (lua_State *L) {\n  luaL_checkany(L, 1);\n  if (!lua_getmetatable(L, 1)) {\n    lua_pushnil(L);\n    return 1;  /* no metatable */\n  }\n  luaL_getmetafield(L, 1, \"__metatable\");\n  return 1;  /* returns either __metatable field (if present) or metatable */\n}\n\n\nstatic int luaB_setmetatable (lua_State *L) {\n  int t = lua_type(L, 2);\n  luaL_checktype(L, 1, LUA_TTABLE);\n  luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,\n                    \"nil or table expected\");\n  if (luaL_getmetafield(L, 1, \"__metatable\"))\n    luaL_error(L, \"cannot change a protected metatable\");\n  lua_settop(L, 2);\n  lua_setmetatable(L, 1);\n  return 1;\n}\n\n\nstatic void getfunc (lua_State *L, int opt) {\n  if (lua_isfunction(L, 1)) lua_pushvalue(L, 1);\n  else {\n    lua_Debug ar;\n    int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1);\n    luaL_argcheck(L, level >= 0, 1, \"level must be non-negative\");\n    if (lua_getstack(L, level, &ar) == 0)\n      luaL_argerror(L, 1, \"invalid level\");\n    lua_getinfo(L, \"f\", &ar);\n    if (lua_isnil(L, -1))\n      luaL_error(L, \"no function environment for tail call at level %d\",\n                    level);\n  }\n}\n\n\nstatic int luaB_getfenv (lua_State *L) {\n  getfunc(L, 1);\n  if (lua_iscfunction(L, -1))  /* is a C function? */\n    lua_pushvalue(L, LUA_GLOBALSINDEX);  /* return the thread's global env. */\n  else\n    lua_getfenv(L, -1);\n  return 1;\n}\n\n\nstatic int luaB_setfenv (lua_State *L) {\n  luaL_checktype(L, 2, LUA_TTABLE);\n  getfunc(L, 0);\n  lua_pushvalue(L, 2);\n  if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) {\n    /* change environment of current thread */\n    lua_pushthread(L);\n    lua_insert(L, -2);\n    lua_setfenv(L, -2);\n    return 0;\n  }\n  else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0)\n    luaL_error(L,\n          LUA_QL(\"setfenv\") \" cannot change environment of given object\");\n  return 1;\n}\n\n\nstatic int luaB_rawequal (lua_State *L) {\n  luaL_checkany(L, 1);\n  luaL_checkany(L, 2);\n  lua_pushboolean(L, lua_rawequal(L, 1, 2));\n  return 1;\n}\n\n\nstatic int luaB_rawget (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n  luaL_checkany(L, 2);\n  lua_settop(L, 2);\n  lua_rawget(L, 1);\n  return 1;\n}\n\nstatic int luaB_rawset (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n  luaL_checkany(L, 2);\n  luaL_checkany(L, 3);\n  lua_settop(L, 3);\n  lua_rawset(L, 1);\n  return 1;\n}\n\n\nstatic int luaB_gcinfo (lua_State *L) {\n  lua_pushinteger(L, lua_getgccount(L));\n  return 1;\n}\n\n\nstatic int luaB_collectgarbage (lua_State *L) {\n  static const char *const opts[] = {\"stop\", \"restart\", \"collect\",\n    \"count\", \"step\", \"setpause\", \"setstepmul\", NULL};\n  static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT,\n    LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL};\n  int o = luaL_checkoption(L, 1, \"collect\", opts);\n  int ex = luaL_optint(L, 2, 0);\n  int res = lua_gc(L, optsnum[o], ex);\n  switch (optsnum[o]) {\n    case LUA_GCCOUNT: {\n      int b = lua_gc(L, LUA_GCCOUNTB, 0);\n      lua_pushnumber(L, res + ((lua_Number)b/1024));\n      return 1;\n    }\n    case LUA_GCSTEP: {\n      lua_pushboolean(L, res);\n      return 1;\n    }\n    default: {\n      lua_pushnumber(L, res);\n      return 1;\n    }\n  }\n}\n\n\nstatic int luaB_type (lua_State *L) {\n  luaL_checkany(L, 1);\n  lua_pushstring(L, luaL_typename(L, 1));\n  return 1;\n}\n\n\nstatic int luaB_next (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n  lua_settop(L, 2);  /* create a 2nd argument if there isn't one */\n  if (lua_next(L, 1))\n    return 2;\n  else {\n    lua_pushnil(L);\n    return 1;\n  }\n}\n\n\nstatic int luaB_pairs (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n  lua_pushvalue(L, lua_upvalueindex(1));  /* return generator, */\n  lua_pushvalue(L, 1);  /* state, */\n  lua_pushnil(L);  /* and initial value */\n  return 3;\n}\n\n\nstatic int ipairsaux (lua_State *L) {\n  int i = luaL_checkint(L, 2);\n  luaL_checktype(L, 1, LUA_TTABLE);\n  i++;  /* next value */\n  lua_pushinteger(L, i);\n  lua_rawgeti(L, 1, i);\n  return (lua_isnil(L, -1)) ? 0 : 2;\n}\n\n\nstatic int luaB_ipairs (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n  lua_pushvalue(L, lua_upvalueindex(1));  /* return generator, */\n  lua_pushvalue(L, 1);  /* state, */\n  lua_pushinteger(L, 0);  /* and initial value */\n  return 3;\n}\n\n\nstatic int load_aux (lua_State *L, int status) {\n  if (status == 0)  /* OK? */\n    return 1;\n  else {\n    lua_pushnil(L);\n    lua_insert(L, -2);  /* put before error message */\n    return 2;  /* return nil plus error message */\n  }\n}\n\n\nstatic int luaB_loadstring (lua_State *L) {\n  size_t l;\n  const char *s = luaL_checklstring(L, 1, &l);\n  const char *chunkname = luaL_optstring(L, 2, s);\n  return load_aux(L, luaL_loadbuffer(L, s, l, chunkname));\n}\n\n\nstatic int luaB_loadfile (lua_State *L) {\n  const char *fname = luaL_optstring(L, 1, NULL);\n  return load_aux(L, luaL_loadfile(L, fname));\n}\n\n\n/*\n** Reader for generic `load' function: `lua_load' uses the\n** stack for internal stuff, so the reader cannot change the\n** stack top. Instead, it keeps its resulting string in a\n** reserved slot inside the stack.\n*/\nstatic const char *generic_reader (lua_State *L, void *ud, size_t *size) {\n  (void)ud;  /* to avoid warnings */\n  luaL_checkstack(L, 2, \"too many nested functions\");\n  lua_pushvalue(L, 1);  /* get function */\n  lua_call(L, 0, 1);  /* call it */\n  if (lua_isnil(L, -1)) {\n    *size = 0;\n    return NULL;\n  }\n  else if (lua_isstring(L, -1)) {\n    lua_replace(L, 3);  /* save string in a reserved stack slot */\n    return lua_tolstring(L, 3, size);\n  }\n  else luaL_error(L, \"reader function must return a string\");\n  return NULL;  /* to avoid warnings */\n}\n\n\nstatic int luaB_load (lua_State *L) {\n  int status;\n  const char *cname = luaL_optstring(L, 2, \"=(load)\");\n  luaL_checktype(L, 1, LUA_TFUNCTION);\n  lua_settop(L, 3);  /* function, eventual name, plus one reserved slot */\n  status = lua_load(L, generic_reader, NULL, cname);\n  return load_aux(L, status);\n}\n\n\nstatic int luaB_dofile (lua_State *L) {\n  const char *fname = luaL_optstring(L, 1, NULL);\n  int n = lua_gettop(L);\n  if (luaL_loadfile(L, fname) != 0) lua_error(L);\n  lua_call(L, 0, LUA_MULTRET);\n  return lua_gettop(L) - n;\n}\n\n\nstatic int luaB_assert (lua_State *L) {\n  luaL_checkany(L, 1);\n  if (!lua_toboolean(L, 1))\n    return luaL_error(L, \"%s\", luaL_optstring(L, 2, \"assertion failed!\"));\n  return lua_gettop(L);\n}\n\n\nstatic int luaB_unpack (lua_State *L) {\n  int i, e, n;\n  luaL_checktype(L, 1, LUA_TTABLE);\n  i = luaL_optint(L, 2, 1);\n  e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1));\n  if (i > e) return 0;  /* empty range */\n  n = e - i + 1;  /* number of elements */\n  if (n <= 0 || !lua_checkstack(L, n))  /* n <= 0 means arith. overflow */\n    return luaL_error(L, \"too many results to unpack\");\n  lua_rawgeti(L, 1, i);  /* push arg[i] (avoiding overflow problems) */\n  while (i++ < e)  /* push arg[i + 1...e] */\n    lua_rawgeti(L, 1, i);\n  return n;\n}\n\n\nstatic int luaB_select (lua_State *L) {\n  int n = lua_gettop(L);\n  if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') {\n    lua_pushinteger(L, n-1);\n    return 1;\n  }\n  else {\n    int i = luaL_checkint(L, 1);\n    if (i < 0) i = n + i;\n    else if (i > n) i = n;\n    luaL_argcheck(L, 1 <= i, 1, \"index out of range\");\n    return n - i;\n  }\n}\n\n\nstatic int luaB_pcall (lua_State *L) {\n  int status;\n  luaL_checkany(L, 1);\n  status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0);\n  lua_pushboolean(L, (status == 0));\n  lua_insert(L, 1);\n  return lua_gettop(L);  /* return status + all results */\n}\n\n\nstatic int luaB_xpcall (lua_State *L) {\n  int status;\n  luaL_checkany(L, 2);\n  lua_settop(L, 2);\n  lua_insert(L, 1);  /* put error function under function to be called */\n  status = lua_pcall(L, 0, LUA_MULTRET, 1);\n  lua_pushboolean(L, (status == 0));\n  lua_replace(L, 1);\n  return lua_gettop(L);  /* return status + all results */\n}\n\n\nstatic int luaB_tostring (lua_State *L) {\n  luaL_checkany(L, 1);\n  if (luaL_callmeta(L, 1, \"__tostring\"))  /* is there a metafield? */\n    return 1;  /* use its value */\n  switch (lua_type(L, 1)) {\n    case LUA_TNUMBER:\n      lua_pushstring(L, lua_tostring(L, 1));\n      break;\n    case LUA_TSTRING:\n      lua_pushvalue(L, 1);\n      break;\n    case LUA_TBOOLEAN:\n      lua_pushstring(L, (lua_toboolean(L, 1) ? \"true\" : \"false\"));\n      break;\n    case LUA_TNIL:\n      lua_pushliteral(L, \"nil\");\n      break;\n    default:\n      lua_pushfstring(L, \"%s: %p\", luaL_typename(L, 1), lua_topointer(L, 1));\n      break;\n  }\n  return 1;\n}\n\n\nstatic int luaB_newproxy (lua_State *L) {\n  lua_settop(L, 1);\n  lua_newuserdata(L, 0);  /* create proxy */\n  if (lua_toboolean(L, 1) == 0)\n    return 1;  /* no metatable */\n  else if (lua_isboolean(L, 1)) {\n    lua_newtable(L);  /* create a new metatable `m' ... */\n    lua_pushvalue(L, -1);  /* ... and mark `m' as a valid metatable */\n    lua_pushboolean(L, 1);\n    lua_rawset(L, lua_upvalueindex(1));  /* weaktable[m] = true */\n  }\n  else {\n    int validproxy = 0;  /* to check if weaktable[metatable(u)] == true */\n    if (lua_getmetatable(L, 1)) {\n      lua_rawget(L, lua_upvalueindex(1));\n      validproxy = lua_toboolean(L, -1);\n      lua_pop(L, 1);  /* remove value */\n    }\n    luaL_argcheck(L, validproxy, 1, \"boolean or proxy expected\");\n    lua_getmetatable(L, 1);  /* metatable is valid; get it */\n  }\n  lua_setmetatable(L, 2);\n  return 1;\n}\n\n\nstatic const luaL_Reg base_funcs[] = {\n  {\"assert\", luaB_assert},\n  {\"collectgarbage\", luaB_collectgarbage},\n  {\"dofile\", luaB_dofile},\n  {\"error\", luaB_error},\n  {\"gcinfo\", luaB_gcinfo},\n  {\"getfenv\", luaB_getfenv},\n  {\"getmetatable\", luaB_getmetatable},\n  {\"loadfile\", luaB_loadfile},\n  {\"load\", luaB_load},\n  {\"loadstring\", luaB_loadstring},\n  {\"next\", luaB_next},\n  {\"pcall\", luaB_pcall},\n  {\"print\", luaB_print},\n  {\"rawequal\", luaB_rawequal},\n  {\"rawget\", luaB_rawget},\n  {\"rawset\", luaB_rawset},\n  {\"select\", luaB_select},\n  {\"setfenv\", luaB_setfenv},\n  {\"setmetatable\", luaB_setmetatable},\n  {\"tonumber\", luaB_tonumber},\n  {\"tostring\", luaB_tostring},\n  {\"type\", luaB_type},\n  {\"unpack\", luaB_unpack},\n  {\"xpcall\", luaB_xpcall},\n  {NULL, NULL}\n};\n\n\n/*\n** {======================================================\n** Coroutine library\n** =======================================================\n*/\n\n#define CO_RUN\t0\t/* running */\n#define CO_SUS\t1\t/* suspended */\n#define CO_NOR\t2\t/* 'normal' (it resumed another coroutine) */\n#define CO_DEAD\t3\n\nstatic const char *const statnames[] =\n    {\"running\", \"suspended\", \"normal\", \"dead\"};\n\nstatic int costatus (lua_State *L, lua_State *co) {\n  if (L == co) return CO_RUN;\n  switch (lua_status(co)) {\n    case LUA_YIELD:\n      return CO_SUS;\n    case 0: {\n      lua_Debug ar;\n      if (lua_getstack(co, 0, &ar) > 0)  /* does it have frames? */\n        return CO_NOR;  /* it is running */\n      else if (lua_gettop(co) == 0)\n          return CO_DEAD;\n      else\n        return CO_SUS;  /* initial state */\n    }\n    default:  /* some error occured */\n      return CO_DEAD;\n  }\n}\n\n\nstatic int luaB_costatus (lua_State *L) {\n  lua_State *co = lua_tothread(L, 1);\n  luaL_argcheck(L, co, 1, \"coroutine expected\");\n  lua_pushstring(L, statnames[costatus(L, co)]);\n  return 1;\n}\n\n\nstatic int auxresume (lua_State *L, lua_State *co, int narg) {\n  int status = costatus(L, co);\n  if (!lua_checkstack(co, narg))\n    luaL_error(L, \"too many arguments to resume\");\n  if (status != CO_SUS) {\n    lua_pushfstring(L, \"cannot resume %s coroutine\", statnames[status]);\n    return -1;  /* error flag */\n  }\n  lua_xmove(L, co, narg);\n  lua_setlevel(L, co);\n  status = lua_resume(co, narg);\n  if (status == 0 || status == LUA_YIELD) {\n    int nres = lua_gettop(co);\n    if (!lua_checkstack(L, nres + 1))\n      luaL_error(L, \"too many results to resume\");\n    lua_xmove(co, L, nres);  /* move yielded values */\n    return nres;\n  }\n  else {\n    lua_xmove(co, L, 1);  /* move error message */\n    return -1;  /* error flag */\n  }\n}\n\n\nstatic int luaB_coresume (lua_State *L) {\n  lua_State *co = lua_tothread(L, 1);\n  int r;\n  luaL_argcheck(L, co, 1, \"coroutine expected\");\n  r = auxresume(L, co, lua_gettop(L) - 1);\n  if (r < 0) {\n    lua_pushboolean(L, 0);\n    lua_insert(L, -2);\n    return 2;  /* return false + error message */\n  }\n  else {\n    lua_pushboolean(L, 1);\n    lua_insert(L, -(r + 1));\n    return r + 1;  /* return true + `resume' returns */\n  }\n}\n\n\nstatic int luaB_auxwrap (lua_State *L) {\n  lua_State *co = lua_tothread(L, lua_upvalueindex(1));\n  int r = auxresume(L, co, lua_gettop(L));\n  if (r < 0) {\n    if (lua_isstring(L, -1)) {  /* error object is a string? */\n      luaL_where(L, 1);  /* add extra info */\n      lua_insert(L, -2);\n      lua_concat(L, 2);\n    }\n    lua_error(L);  /* propagate error */\n  }\n  return r;\n}\n\n\nstatic int luaB_cocreate (lua_State *L) {\n  lua_State *NL = lua_newthread(L);\n  luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1,\n    \"Lua function expected\");\n  lua_pushvalue(L, 1);  /* move function to top */\n  lua_xmove(L, NL, 1);  /* move function from L to NL */\n  return 1;\n}\n\n\nstatic int luaB_cowrap (lua_State *L) {\n  luaB_cocreate(L);\n  lua_pushcclosure(L, luaB_auxwrap, 1);\n  return 1;\n}\n\n\nstatic int luaB_yield (lua_State *L) {\n  return lua_yield(L, lua_gettop(L));\n}\n\n\nstatic int luaB_corunning (lua_State *L) {\n  if (lua_pushthread(L))\n    lua_pushnil(L);  /* main thread is not a coroutine */\n  return 1;\n}\n\n\nstatic const luaL_Reg co_funcs[] = {\n  {\"create\", luaB_cocreate},\n  {\"resume\", luaB_coresume},\n  {\"running\", luaB_corunning},\n  {\"status\", luaB_costatus},\n  {\"wrap\", luaB_cowrap},\n  {\"yield\", luaB_yield},\n  {NULL, NULL}\n};\n\n/* }====================================================== */\n\n\nstatic void auxopen (lua_State *L, const char *name,\n                     lua_CFunction f, lua_CFunction u) {\n  lua_pushcfunction(L, u);\n  lua_pushcclosure(L, f, 1);\n  lua_setfield(L, -2, name);\n}\n\n\nstatic void base_open (lua_State *L) {\n  /* set global _G */\n  lua_pushvalue(L, LUA_GLOBALSINDEX);\n  lua_setglobal(L, \"_G\");\n  /* open lib into global table */\n  luaL_register(L, \"_G\", base_funcs);\n  lua_pushliteral(L, LUA_VERSION);\n  lua_setglobal(L, \"_VERSION\");  /* set global _VERSION */\n  /* `ipairs' and `pairs' need auxiliary functions as upvalues */\n  auxopen(L, \"ipairs\", luaB_ipairs, ipairsaux);\n  auxopen(L, \"pairs\", luaB_pairs, luaB_next);\n  /* `newproxy' needs a weaktable as upvalue */\n  lua_createtable(L, 0, 1);  /* new table `w' */\n  lua_pushvalue(L, -1);  /* `w' will be its own metatable */\n  lua_setmetatable(L, -2);\n  lua_pushliteral(L, \"kv\");\n  lua_setfield(L, -2, \"__mode\");  /* metatable(w).__mode = \"kv\" */\n  lua_pushcclosure(L, luaB_newproxy, 1);\n  lua_setglobal(L, \"newproxy\");  /* set global `newproxy' */\n}\n\n\nLUALIB_API int luaopen_base (lua_State *L) {\n  base_open(L);\n  luaL_register(L, LUA_COLIBNAME, co_funcs);\n  return 2;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lcode.c",
    "content": "/*\n** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $\n** Code generator for Lua\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stdlib.h>\n\n#define lcode_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lcode.h\"\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lgc.h\"\n#include \"llex.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lopcodes.h\"\n#include \"lparser.h\"\n#include \"ltable.h\"\n\n\n#define hasjumps(e)\t((e)->t != (e)->f)\n\n\nstatic int isnumeral(expdesc *e) {\n  return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP);\n}\n\n\nvoid luaK_nil (FuncState *fs, int from, int n) {\n  Instruction *previous;\n  if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */\n    if (fs->pc == 0) {  /* function start? */\n      if (from >= fs->nactvar)\n        return;  /* positions are already clean */\n    }\n    else {\n      previous = &fs->f->code[fs->pc-1];\n      if (GET_OPCODE(*previous) == OP_LOADNIL) {\n        int pfrom = GETARG_A(*previous);\n        int pto = GETARG_B(*previous);\n        if (pfrom <= from && from <= pto+1) {  /* can connect both? */\n          if (from+n-1 > pto)\n            SETARG_B(*previous, from+n-1);\n          return;\n        }\n      }\n    }\n  }\n  luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0);  /* else no optimization */\n}\n\n\nint luaK_jump (FuncState *fs) {\n  int jpc = fs->jpc;  /* save list of jumps to here */\n  int j;\n  fs->jpc = NO_JUMP;\n  j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP);\n  luaK_concat(fs, &j, jpc);  /* keep them on hold */\n  return j;\n}\n\n\nvoid luaK_ret (FuncState *fs, int first, int nret) {\n  luaK_codeABC(fs, OP_RETURN, first, nret+1, 0);\n}\n\n\nstatic int condjump (FuncState *fs, OpCode op, int A, int B, int C) {\n  luaK_codeABC(fs, op, A, B, C);\n  return luaK_jump(fs);\n}\n\n\nstatic void fixjump (FuncState *fs, int pc, int dest) {\n  Instruction *jmp = &fs->f->code[pc];\n  int offset = dest-(pc+1);\n  lua_assert(dest != NO_JUMP);\n  if (abs(offset) > MAXARG_sBx)\n    luaX_syntaxerror(fs->ls, \"control structure too long\");\n  SETARG_sBx(*jmp, offset);\n}\n\n\n/*\n** returns current `pc' and marks it as a jump target (to avoid wrong\n** optimizations with consecutive instructions not in the same basic block).\n*/\nint luaK_getlabel (FuncState *fs) {\n  fs->lasttarget = fs->pc;\n  return fs->pc;\n}\n\n\nstatic int getjump (FuncState *fs, int pc) {\n  int offset = GETARG_sBx(fs->f->code[pc]);\n  if (offset == NO_JUMP)  /* point to itself represents end of list */\n    return NO_JUMP;  /* end of list */\n  else\n    return (pc+1)+offset;  /* turn offset into absolute position */\n}\n\n\nstatic Instruction *getjumpcontrol (FuncState *fs, int pc) {\n  Instruction *pi = &fs->f->code[pc];\n  if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1))))\n    return pi-1;\n  else\n    return pi;\n}\n\n\n/*\n** check whether list has any jump that do not produce a value\n** (or produce an inverted value)\n*/\nstatic int need_value (FuncState *fs, int list) {\n  for (; list != NO_JUMP; list = getjump(fs, list)) {\n    Instruction i = *getjumpcontrol(fs, list);\n    if (GET_OPCODE(i) != OP_TESTSET) return 1;\n  }\n  return 0;  /* not found */\n}\n\n\nstatic int patchtestreg (FuncState *fs, int node, int reg) {\n  Instruction *i = getjumpcontrol(fs, node);\n  if (GET_OPCODE(*i) != OP_TESTSET)\n    return 0;  /* cannot patch other instructions */\n  if (reg != NO_REG && reg != GETARG_B(*i))\n    SETARG_A(*i, reg);\n  else  /* no register to put value or register already has the value */\n    *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i));\n\n  return 1;\n}\n\n\nstatic void removevalues (FuncState *fs, int list) {\n  for (; list != NO_JUMP; list = getjump(fs, list))\n      patchtestreg(fs, list, NO_REG);\n}\n\n\nstatic void patchlistaux (FuncState *fs, int list, int vtarget, int reg,\n                          int dtarget) {\n  while (list != NO_JUMP) {\n    int next = getjump(fs, list);\n    if (patchtestreg(fs, list, reg))\n      fixjump(fs, list, vtarget);\n    else\n      fixjump(fs, list, dtarget);  /* jump to default target */\n    list = next;\n  }\n}\n\n\nstatic void dischargejpc (FuncState *fs) {\n  patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc);\n  fs->jpc = NO_JUMP;\n}\n\n\nvoid luaK_patchlist (FuncState *fs, int list, int target) {\n  if (target == fs->pc)\n    luaK_patchtohere(fs, list);\n  else {\n    lua_assert(target < fs->pc);\n    patchlistaux(fs, list, target, NO_REG, target);\n  }\n}\n\n\nvoid luaK_patchtohere (FuncState *fs, int list) {\n  luaK_getlabel(fs);\n  luaK_concat(fs, &fs->jpc, list);\n}\n\n\nvoid luaK_concat (FuncState *fs, int *l1, int l2) {\n  if (l2 == NO_JUMP) return;\n  else if (*l1 == NO_JUMP)\n    *l1 = l2;\n  else {\n    int list = *l1;\n    int next;\n    while ((next = getjump(fs, list)) != NO_JUMP)  /* find last element */\n      list = next;\n    fixjump(fs, list, l2);\n  }\n}\n\n\nvoid luaK_checkstack (FuncState *fs, int n) {\n  int newstack = fs->freereg + n;\n  if (newstack > fs->f->maxstacksize) {\n    if (newstack >= MAXSTACK)\n      luaX_syntaxerror(fs->ls, \"function or expression too complex\");\n    fs->f->maxstacksize = cast_byte(newstack);\n  }\n}\n\n\nvoid luaK_reserveregs (FuncState *fs, int n) {\n  luaK_checkstack(fs, n);\n  fs->freereg += n;\n}\n\n\nstatic void freereg (FuncState *fs, int reg) {\n  if (!ISK(reg) && reg >= fs->nactvar) {\n    fs->freereg--;\n    lua_assert(reg == fs->freereg);\n  }\n}\n\n\nstatic void freeexp (FuncState *fs, expdesc *e) {\n  if (e->k == VNONRELOC)\n    freereg(fs, e->u.s.info);\n}\n\n\nstatic int addk (FuncState *fs, TValue *k, TValue *v) {\n  lua_State *L = fs->L;\n  TValue *idx = luaH_set(L, fs->h, k);\n  Proto *f = fs->f;\n  int oldsize = f->sizek;\n  if (ttisnumber(idx)) {\n    lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v));\n    return cast_int(nvalue(idx));\n  }\n  else {  /* constant not found; create a new entry */\n    setnvalue(idx, cast_num(fs->nk));\n    luaM_growvector(L, f->k, fs->nk, f->sizek, TValue,\n                    MAXARG_Bx, \"constant table overflow\");\n    while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]);\n    setobj(L, &f->k[fs->nk], v);\n    luaC_barrier(L, f, v);\n    return fs->nk++;\n  }\n}\n\n\nint luaK_stringK (FuncState *fs, TString *s) {\n  TValue o;\n  setsvalue(fs->L, &o, s);\n  return addk(fs, &o, &o);\n}\n\n\nint luaK_numberK (FuncState *fs, lua_Number r) {\n  TValue o;\n  setnvalue(&o, r);\n  return addk(fs, &o, &o);\n}\n\n\nstatic int boolK (FuncState *fs, int b) {\n  TValue o;\n  setbvalue(&o, b);\n  return addk(fs, &o, &o);\n}\n\n\nstatic int nilK (FuncState *fs) {\n  TValue k, v;\n  setnilvalue(&v);\n  /* cannot use nil as key; instead use table itself to represent nil */\n  sethvalue(fs->L, &k, fs->h);\n  return addk(fs, &k, &v);\n}\n\n\nvoid luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {\n  if (e->k == VCALL) {  /* expression is an open function call? */\n    SETARG_C(getcode(fs, e), nresults+1);\n  }\n  else if (e->k == VVARARG) {\n    SETARG_B(getcode(fs, e), nresults+1);\n    SETARG_A(getcode(fs, e), fs->freereg);\n    luaK_reserveregs(fs, 1);\n  }\n}\n\n\nvoid luaK_setoneret (FuncState *fs, expdesc *e) {\n  if (e->k == VCALL) {  /* expression is an open function call? */\n    e->k = VNONRELOC;\n    e->u.s.info = GETARG_A(getcode(fs, e));\n  }\n  else if (e->k == VVARARG) {\n    SETARG_B(getcode(fs, e), 2);\n    e->k = VRELOCABLE;  /* can relocate its simple result */\n  }\n}\n\n\nvoid luaK_dischargevars (FuncState *fs, expdesc *e) {\n  switch (e->k) {\n    case VLOCAL: {\n      e->k = VNONRELOC;\n      break;\n    }\n    case VUPVAL: {\n      e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0);\n      e->k = VRELOCABLE;\n      break;\n    }\n    case VGLOBAL: {\n      e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info);\n      e->k = VRELOCABLE;\n      break;\n    }\n    case VINDEXED: {\n      freereg(fs, e->u.s.aux);\n      freereg(fs, e->u.s.info);\n      e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux);\n      e->k = VRELOCABLE;\n      break;\n    }\n    case VVARARG:\n    case VCALL: {\n      luaK_setoneret(fs, e);\n      break;\n    }\n    default: break;  /* there is one value available (somewhere) */\n  }\n}\n\n\nstatic int code_label (FuncState *fs, int A, int b, int jump) {\n  luaK_getlabel(fs);  /* those instructions may be jump targets */\n  return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump);\n}\n\n\nstatic void discharge2reg (FuncState *fs, expdesc *e, int reg) {\n  luaK_dischargevars(fs, e);\n  switch (e->k) {\n    case VNIL: {\n      luaK_nil(fs, reg, 1);\n      break;\n    }\n    case VFALSE:  case VTRUE: {\n      luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0);\n      break;\n    }\n    case VK: {\n      luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info);\n      break;\n    }\n    case VKNUM: {\n      luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval));\n      break;\n    }\n    case VRELOCABLE: {\n      Instruction *pc = &getcode(fs, e);\n      SETARG_A(*pc, reg);\n      break;\n    }\n    case VNONRELOC: {\n      if (reg != e->u.s.info)\n        luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0);\n      break;\n    }\n    default: {\n      lua_assert(e->k == VVOID || e->k == VJMP);\n      return;  /* nothing to do... */\n    }\n  }\n  e->u.s.info = reg;\n  e->k = VNONRELOC;\n}\n\n\nstatic void discharge2anyreg (FuncState *fs, expdesc *e) {\n  if (e->k != VNONRELOC) {\n    luaK_reserveregs(fs, 1);\n    discharge2reg(fs, e, fs->freereg-1);\n  }\n}\n\n\nstatic void exp2reg (FuncState *fs, expdesc *e, int reg) {\n  discharge2reg(fs, e, reg);\n  if (e->k == VJMP)\n    luaK_concat(fs, &e->t, e->u.s.info);  /* put this jump in `t' list */\n  if (hasjumps(e)) {\n    int final;  /* position after whole expression */\n    int p_f = NO_JUMP;  /* position of an eventual LOAD false */\n    int p_t = NO_JUMP;  /* position of an eventual LOAD true */\n    if (need_value(fs, e->t) || need_value(fs, e->f)) {\n      int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);\n      p_f = code_label(fs, reg, 0, 1);\n      p_t = code_label(fs, reg, 1, 0);\n      luaK_patchtohere(fs, fj);\n    }\n    final = luaK_getlabel(fs);\n    patchlistaux(fs, e->f, final, reg, p_f);\n    patchlistaux(fs, e->t, final, reg, p_t);\n  }\n  e->f = e->t = NO_JUMP;\n  e->u.s.info = reg;\n  e->k = VNONRELOC;\n}\n\n\nvoid luaK_exp2nextreg (FuncState *fs, expdesc *e) {\n  luaK_dischargevars(fs, e);\n  freeexp(fs, e);\n  luaK_reserveregs(fs, 1);\n  exp2reg(fs, e, fs->freereg - 1);\n}\n\n\nint luaK_exp2anyreg (FuncState *fs, expdesc *e) {\n  luaK_dischargevars(fs, e);\n  if (e->k == VNONRELOC) {\n    if (!hasjumps(e)) return e->u.s.info;  /* exp is already in a register */\n    if (e->u.s.info >= fs->nactvar) {  /* reg. is not a local? */\n      exp2reg(fs, e, e->u.s.info);  /* put value on it */\n      return e->u.s.info;\n    }\n  }\n  luaK_exp2nextreg(fs, e);  /* default */\n  return e->u.s.info;\n}\n\n\nvoid luaK_exp2val (FuncState *fs, expdesc *e) {\n  if (hasjumps(e))\n    luaK_exp2anyreg(fs, e);\n  else\n    luaK_dischargevars(fs, e);\n}\n\n\nint luaK_exp2RK (FuncState *fs, expdesc *e) {\n  luaK_exp2val(fs, e);\n  switch (e->k) {\n    case VKNUM:\n    case VTRUE:\n    case VFALSE:\n    case VNIL: {\n      if (fs->nk <= MAXINDEXRK) {  /* constant fit in RK operand? */\n        e->u.s.info = (e->k == VNIL)  ? nilK(fs) :\n                      (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :\n                                        boolK(fs, (e->k == VTRUE));\n        e->k = VK;\n        return RKASK(e->u.s.info);\n      }\n      else break;\n    }\n    case VK: {\n      if (e->u.s.info <= MAXINDEXRK)  /* constant fit in argC? */\n        return RKASK(e->u.s.info);\n      else break;\n    }\n    default: break;\n  }\n  /* not a constant in the right range: put it in a register */\n  return luaK_exp2anyreg(fs, e);\n}\n\n\nvoid luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {\n  switch (var->k) {\n    case VLOCAL: {\n      freeexp(fs, ex);\n      exp2reg(fs, ex, var->u.s.info);\n      return;\n    }\n    case VUPVAL: {\n      int e = luaK_exp2anyreg(fs, ex);\n      luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0);\n      break;\n    }\n    case VGLOBAL: {\n      int e = luaK_exp2anyreg(fs, ex);\n      luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info);\n      break;\n    }\n    case VINDEXED: {\n      int e = luaK_exp2RK(fs, ex);\n      luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e);\n      break;\n    }\n    default: {\n      lua_assert(0);  /* invalid var kind to store */\n      break;\n    }\n  }\n  freeexp(fs, ex);\n}\n\n\nvoid luaK_self (FuncState *fs, expdesc *e, expdesc *key) {\n  int func;\n  luaK_exp2anyreg(fs, e);\n  freeexp(fs, e);\n  func = fs->freereg;\n  luaK_reserveregs(fs, 2);\n  luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key));\n  freeexp(fs, key);\n  e->u.s.info = func;\n  e->k = VNONRELOC;\n}\n\n\nstatic void invertjump (FuncState *fs, expdesc *e) {\n  Instruction *pc = getjumpcontrol(fs, e->u.s.info);\n  lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET &&\n                                           GET_OPCODE(*pc) != OP_TEST);\n  SETARG_A(*pc, !(GETARG_A(*pc)));\n}\n\n\nstatic int jumponcond (FuncState *fs, expdesc *e, int cond) {\n  if (e->k == VRELOCABLE) {\n    Instruction ie = getcode(fs, e);\n    if (GET_OPCODE(ie) == OP_NOT) {\n      fs->pc--;  /* remove previous OP_NOT */\n      return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond);\n    }\n    /* else go through */\n  }\n  discharge2anyreg(fs, e);\n  freeexp(fs, e);\n  return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond);\n}\n\n\nvoid luaK_goiftrue (FuncState *fs, expdesc *e) {\n  int pc;  /* pc of last jump */\n  luaK_dischargevars(fs, e);\n  switch (e->k) {\n    case VK: case VKNUM: case VTRUE: {\n      pc = NO_JUMP;  /* always true; do nothing */\n      break;\n    }\n    case VJMP: {\n      invertjump(fs, e);\n      pc = e->u.s.info;\n      break;\n    }\n    default: {\n      pc = jumponcond(fs, e, 0);\n      break;\n    }\n  }\n  luaK_concat(fs, &e->f, pc);  /* insert last jump in `f' list */\n  luaK_patchtohere(fs, e->t);\n  e->t = NO_JUMP;\n}\n\n\nstatic void luaK_goiffalse (FuncState *fs, expdesc *e) {\n  int pc;  /* pc of last jump */\n  luaK_dischargevars(fs, e);\n  switch (e->k) {\n    case VNIL: case VFALSE: {\n      pc = NO_JUMP;  /* always false; do nothing */\n      break;\n    }\n    case VJMP: {\n      pc = e->u.s.info;\n      break;\n    }\n    default: {\n      pc = jumponcond(fs, e, 1);\n      break;\n    }\n  }\n  luaK_concat(fs, &e->t, pc);  /* insert last jump in `t' list */\n  luaK_patchtohere(fs, e->f);\n  e->f = NO_JUMP;\n}\n\n\nstatic void codenot (FuncState *fs, expdesc *e) {\n  luaK_dischargevars(fs, e);\n  switch (e->k) {\n    case VNIL: case VFALSE: {\n      e->k = VTRUE;\n      break;\n    }\n    case VK: case VKNUM: case VTRUE: {\n      e->k = VFALSE;\n      break;\n    }\n    case VJMP: {\n      invertjump(fs, e);\n      break;\n    }\n    case VRELOCABLE:\n    case VNONRELOC: {\n      discharge2anyreg(fs, e);\n      freeexp(fs, e);\n      e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0);\n      e->k = VRELOCABLE;\n      break;\n    }\n    default: {\n      lua_assert(0);  /* cannot happen */\n      break;\n    }\n  }\n  /* interchange true and false lists */\n  { int temp = e->f; e->f = e->t; e->t = temp; }\n  removevalues(fs, e->f);\n  removevalues(fs, e->t);\n}\n\n\nvoid luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) {\n  t->u.s.aux = luaK_exp2RK(fs, k);\n  t->k = VINDEXED;\n}\n\n\nstatic int constfolding (OpCode op, expdesc *e1, expdesc *e2) {\n  lua_Number v1, v2, r;\n  if (!isnumeral(e1) || !isnumeral(e2)) return 0;\n  v1 = e1->u.nval;\n  v2 = e2->u.nval;\n  switch (op) {\n    case OP_ADD: r = luai_numadd(v1, v2); break;\n    case OP_SUB: r = luai_numsub(v1, v2); break;\n    case OP_MUL: r = luai_nummul(v1, v2); break;\n    case OP_DIV:\n      if (v2 == 0) return 0;  /* do not attempt to divide by 0 */\n      r = luai_numdiv(v1, v2); break;\n    case OP_MOD:\n      if (v2 == 0) return 0;  /* do not attempt to divide by 0 */\n      r = luai_nummod(v1, v2); break;\n    case OP_POW: r = luai_numpow(v1, v2); break;\n    case OP_UNM: r = luai_numunm(v1); break;\n    case OP_LEN: return 0;  /* no constant folding for 'len' */\n    default: lua_assert(0); r = 0; break;\n  }\n  if (luai_numisnan(r)) return 0;  /* do not attempt to produce NaN */\n  e1->u.nval = r;\n  return 1;\n}\n\n\nstatic void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) {\n  if (constfolding(op, e1, e2))\n    return;\n  else {\n    int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0;\n    int o1 = luaK_exp2RK(fs, e1);\n    if (o1 > o2) {\n      freeexp(fs, e1);\n      freeexp(fs, e2);\n    }\n    else {\n      freeexp(fs, e2);\n      freeexp(fs, e1);\n    }\n    e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2);\n    e1->k = VRELOCABLE;\n  }\n}\n\n\nstatic void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1,\n                                                          expdesc *e2) {\n  int o1 = luaK_exp2RK(fs, e1);\n  int o2 = luaK_exp2RK(fs, e2);\n  freeexp(fs, e2);\n  freeexp(fs, e1);\n  if (cond == 0 && op != OP_EQ) {\n    int temp;  /* exchange args to replace by `<' or `<=' */\n    temp = o1; o1 = o2; o2 = temp;  /* o1 <==> o2 */\n    cond = 1;\n  }\n  e1->u.s.info = condjump(fs, op, cond, o1, o2);\n  e1->k = VJMP;\n}\n\n\nvoid luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) {\n  expdesc e2;\n  e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0;\n  switch (op) {\n    case OPR_MINUS: {\n      if (!isnumeral(e))\n        luaK_exp2anyreg(fs, e);  /* cannot operate on non-numeric constants */\n      codearith(fs, OP_UNM, e, &e2);\n      break;\n    }\n    case OPR_NOT: codenot(fs, e); break;\n    case OPR_LEN: {\n      luaK_exp2anyreg(fs, e);  /* cannot operate on constants */\n      codearith(fs, OP_LEN, e, &e2);\n      break;\n    }\n    default: lua_assert(0);\n  }\n}\n\n\nvoid luaK_infix (FuncState *fs, BinOpr op, expdesc *v) {\n  switch (op) {\n    case OPR_AND: {\n      luaK_goiftrue(fs, v);\n      break;\n    }\n    case OPR_OR: {\n      luaK_goiffalse(fs, v);\n      break;\n    }\n    case OPR_CONCAT: {\n      luaK_exp2nextreg(fs, v);  /* operand must be on the `stack' */\n      break;\n    }\n    case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV:\n    case OPR_MOD: case OPR_POW: {\n      if (!isnumeral(v)) luaK_exp2RK(fs, v);\n      break;\n    }\n    default: {\n      luaK_exp2RK(fs, v);\n      break;\n    }\n  }\n}\n\n\nvoid luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) {\n  switch (op) {\n    case OPR_AND: {\n      lua_assert(e1->t == NO_JUMP);  /* list must be closed */\n      luaK_dischargevars(fs, e2);\n      luaK_concat(fs, &e2->f, e1->f);\n      *e1 = *e2;\n      break;\n    }\n    case OPR_OR: {\n      lua_assert(e1->f == NO_JUMP);  /* list must be closed */\n      luaK_dischargevars(fs, e2);\n      luaK_concat(fs, &e2->t, e1->t);\n      *e1 = *e2;\n      break;\n    }\n    case OPR_CONCAT: {\n      luaK_exp2val(fs, e2);\n      if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) {\n        lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1);\n        freeexp(fs, e1);\n        SETARG_B(getcode(fs, e2), e1->u.s.info);\n        e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info;\n      }\n      else {\n        luaK_exp2nextreg(fs, e2);  /* operand must be on the 'stack' */\n        codearith(fs, OP_CONCAT, e1, e2);\n      }\n      break;\n    }\n    case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break;\n    case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break;\n    case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break;\n    case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break;\n    case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break;\n    case OPR_POW: codearith(fs, OP_POW, e1, e2); break;\n    case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break;\n    case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break;\n    case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break;\n    case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break;\n    case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break;\n    case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break;\n    default: lua_assert(0);\n  }\n}\n\n\nvoid luaK_fixline (FuncState *fs, int line) {\n  fs->f->lineinfo[fs->pc - 1] = line;\n}\n\n\nstatic int luaK_code (FuncState *fs, Instruction i, int line) {\n  Proto *f = fs->f;\n  dischargejpc(fs);  /* `pc' will change */\n  /* put new instruction in code array */\n  luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction,\n                  MAX_INT, \"code size overflow\");\n  f->code[fs->pc] = i;\n  /* save corresponding line information */\n  luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int,\n                  MAX_INT, \"code size overflow\");\n  f->lineinfo[fs->pc] = line;\n  return fs->pc++;\n}\n\n\nint luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) {\n  lua_assert(getOpMode(o) == iABC);\n  lua_assert(getBMode(o) != OpArgN || b == 0);\n  lua_assert(getCMode(o) != OpArgN || c == 0);\n  return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline);\n}\n\n\nint luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) {\n  lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx);\n  lua_assert(getCMode(o) == OpArgN);\n  return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline);\n}\n\n\nvoid luaK_setlist (FuncState *fs, int base, int nelems, int tostore) {\n  int c =  (nelems - 1)/LFIELDS_PER_FLUSH + 1;\n  int b = (tostore == LUA_MULTRET) ? 0 : tostore;\n  lua_assert(tostore != 0);\n  if (c <= MAXARG_C)\n    luaK_codeABC(fs, OP_SETLIST, base, b, c);\n  else {\n    luaK_codeABC(fs, OP_SETLIST, base, b, 0);\n    luaK_code(fs, cast(Instruction, c), fs->ls->lastline);\n  }\n  fs->freereg = base + 1;  /* free registers with list values */\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lcode.h",
    "content": "/*\n** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $\n** Code generator for Lua\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lcode_h\n#define lcode_h\n\n#include \"llex.h\"\n#include \"lobject.h\"\n#include \"lopcodes.h\"\n#include \"lparser.h\"\n\n\n/*\n** Marks the end of a patch list. It is an invalid value both as an absolute\n** address, and as a list link (would link an element to itself).\n*/\n#define NO_JUMP (-1)\n\n\n/*\n** grep \"ORDER OPR\" if you change these enums\n*/\ntypedef enum BinOpr {\n  OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,\n  OPR_CONCAT,\n  OPR_NE, OPR_EQ,\n  OPR_LT, OPR_LE, OPR_GT, OPR_GE,\n  OPR_AND, OPR_OR,\n  OPR_NOBINOPR\n} BinOpr;\n\n\ntypedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr;\n\n\n#define getcode(fs,e)\t((fs)->f->code[(e)->u.s.info])\n\n#define luaK_codeAsBx(fs,o,A,sBx)\tluaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)\n\n#define luaK_setmultret(fs,e)\tluaK_setreturns(fs, e, LUA_MULTRET)\n\nLUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);\nLUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);\nLUAI_FUNC void luaK_fixline (FuncState *fs, int line);\nLUAI_FUNC void luaK_nil (FuncState *fs, int from, int n);\nLUAI_FUNC void luaK_reserveregs (FuncState *fs, int n);\nLUAI_FUNC void luaK_checkstack (FuncState *fs, int n);\nLUAI_FUNC int luaK_stringK (FuncState *fs, TString *s);\nLUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r);\nLUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e);\nLUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e);\nLUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e);\nLUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);\nLUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e);\nLUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);\nLUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);\nLUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);\nLUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);\nLUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);\nLUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);\nLUAI_FUNC int luaK_jump (FuncState *fs);\nLUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret);\nLUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target);\nLUAI_FUNC void luaK_patchtohere (FuncState *fs, int list);\nLUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2);\nLUAI_FUNC int luaK_getlabel (FuncState *fs);\nLUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);\nLUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);\nLUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);\nLUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ldblib.c",
    "content": "/*\n** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $\n** Interface from Lua to its debug API\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define ldblib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n\nstatic int db_getregistry (lua_State *L) {\n  lua_pushvalue(L, LUA_REGISTRYINDEX);\n  return 1;\n}\n\n\nstatic int db_getmetatable (lua_State *L) {\n  luaL_checkany(L, 1);\n  if (!lua_getmetatable(L, 1)) {\n    lua_pushnil(L);  /* no metatable */\n  }\n  return 1;\n}\n\n\nstatic int db_setmetatable (lua_State *L) {\n  int t = lua_type(L, 2);\n  luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,\n                    \"nil or table expected\");\n  lua_settop(L, 2);\n  lua_pushboolean(L, lua_setmetatable(L, 1));\n  return 1;\n}\n\n\nstatic int db_getfenv (lua_State *L) {\n  luaL_checkany(L, 1);\n  lua_getfenv(L, 1);\n  return 1;\n}\n\n\nstatic int db_setfenv (lua_State *L) {\n  luaL_checktype(L, 2, LUA_TTABLE);\n  lua_settop(L, 2);\n  if (lua_setfenv(L, 1) == 0)\n    luaL_error(L, LUA_QL(\"setfenv\")\n                  \" cannot change environment of given object\");\n  return 1;\n}\n\n\nstatic void settabss (lua_State *L, const char *i, const char *v) {\n  lua_pushstring(L, v);\n  lua_setfield(L, -2, i);\n}\n\n\nstatic void settabsi (lua_State *L, const char *i, int v) {\n  lua_pushinteger(L, v);\n  lua_setfield(L, -2, i);\n}\n\n\nstatic lua_State *getthread (lua_State *L, int *arg) {\n  if (lua_isthread(L, 1)) {\n    *arg = 1;\n    return lua_tothread(L, 1);\n  }\n  else {\n    *arg = 0;\n    return L;\n  }\n}\n\n\nstatic void treatstackoption (lua_State *L, lua_State *L1, const char *fname) {\n  if (L == L1) {\n    lua_pushvalue(L, -2);\n    lua_remove(L, -3);\n  }\n  else\n    lua_xmove(L1, L, 1);\n  lua_setfield(L, -2, fname);\n}\n\n\nstatic int db_getinfo (lua_State *L) {\n  lua_Debug ar;\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  const char *options = luaL_optstring(L, arg+2, \"flnSu\");\n  if (lua_isnumber(L, arg+1)) {\n    if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) {\n      lua_pushnil(L);  /* level out of range */\n      return 1;\n    }\n  }\n  else if (lua_isfunction(L, arg+1)) {\n    lua_pushfstring(L, \">%s\", options);\n    options = lua_tostring(L, -1);\n    lua_pushvalue(L, arg+1);\n    lua_xmove(L, L1, 1);\n  }\n  else\n    return luaL_argerror(L, arg+1, \"function or level expected\");\n  if (!lua_getinfo(L1, options, &ar))\n    return luaL_argerror(L, arg+2, \"invalid option\");\n  lua_createtable(L, 0, 2);\n  if (strchr(options, 'S')) {\n    settabss(L, \"source\", ar.source);\n    settabss(L, \"short_src\", ar.short_src);\n    settabsi(L, \"linedefined\", ar.linedefined);\n    settabsi(L, \"lastlinedefined\", ar.lastlinedefined);\n    settabss(L, \"what\", ar.what);\n  }\n  if (strchr(options, 'l'))\n    settabsi(L, \"currentline\", ar.currentline);\n  if (strchr(options, 'u'))\n    settabsi(L, \"nups\", ar.nups);\n  if (strchr(options, 'n')) {\n    settabss(L, \"name\", ar.name);\n    settabss(L, \"namewhat\", ar.namewhat);\n  }\n  if (strchr(options, 'L'))\n    treatstackoption(L, L1, \"activelines\");\n  if (strchr(options, 'f'))\n    treatstackoption(L, L1, \"func\");\n  return 1;  /* return table */\n}\n    \n\nstatic int db_getlocal (lua_State *L) {\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  lua_Debug ar;\n  const char *name;\n  if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar))  /* out of range? */\n    return luaL_argerror(L, arg+1, \"level out of range\");\n  name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2));\n  if (name) {\n    lua_xmove(L1, L, 1);\n    lua_pushstring(L, name);\n    lua_pushvalue(L, -2);\n    return 2;\n  }\n  else {\n    lua_pushnil(L);\n    return 1;\n  }\n}\n\n\nstatic int db_setlocal (lua_State *L) {\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  lua_Debug ar;\n  if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar))  /* out of range? */\n    return luaL_argerror(L, arg+1, \"level out of range\");\n  luaL_checkany(L, arg+3);\n  lua_settop(L, arg+3);\n  lua_xmove(L, L1, 1);\n  lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2)));\n  return 1;\n}\n\n\nstatic int auxupvalue (lua_State *L, int get) {\n  const char *name;\n  int n = luaL_checkint(L, 2);\n  luaL_checktype(L, 1, LUA_TFUNCTION);\n  if (lua_iscfunction(L, 1)) return 0;  /* cannot touch C upvalues from Lua */\n  name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);\n  if (name == NULL) return 0;\n  lua_pushstring(L, name);\n  lua_insert(L, -(get+1));\n  return get + 1;\n}\n\n\nstatic int db_getupvalue (lua_State *L) {\n  return auxupvalue(L, 1);\n}\n\n\nstatic int db_setupvalue (lua_State *L) {\n  luaL_checkany(L, 3);\n  return auxupvalue(L, 0);\n}\n\n\n\nstatic const char KEY_HOOK = 'h';\n\n\nstatic void hookf (lua_State *L, lua_Debug *ar) {\n  static const char *const hooknames[] =\n    {\"call\", \"return\", \"line\", \"count\", \"tail return\"};\n  lua_pushlightuserdata(L, (void *)&KEY_HOOK);\n  lua_rawget(L, LUA_REGISTRYINDEX);\n  lua_pushlightuserdata(L, L);\n  lua_rawget(L, -2);\n  if (lua_isfunction(L, -1)) {\n    lua_pushstring(L, hooknames[(int)ar->event]);\n    if (ar->currentline >= 0)\n      lua_pushinteger(L, ar->currentline);\n    else lua_pushnil(L);\n    lua_assert(lua_getinfo(L, \"lS\", ar));\n    lua_call(L, 2, 0);\n  }\n}\n\n\nstatic int makemask (const char *smask, int count) {\n  int mask = 0;\n  if (strchr(smask, 'c')) mask |= LUA_MASKCALL;\n  if (strchr(smask, 'r')) mask |= LUA_MASKRET;\n  if (strchr(smask, 'l')) mask |= LUA_MASKLINE;\n  if (count > 0) mask |= LUA_MASKCOUNT;\n  return mask;\n}\n\n\nstatic char *unmakemask (int mask, char *smask) {\n  int i = 0;\n  if (mask & LUA_MASKCALL) smask[i++] = 'c';\n  if (mask & LUA_MASKRET) smask[i++] = 'r';\n  if (mask & LUA_MASKLINE) smask[i++] = 'l';\n  smask[i] = '\\0';\n  return smask;\n}\n\n\nstatic void gethooktable (lua_State *L) {\n  lua_pushlightuserdata(L, (void *)&KEY_HOOK);\n  lua_rawget(L, LUA_REGISTRYINDEX);\n  if (!lua_istable(L, -1)) {\n    lua_pop(L, 1);\n    lua_createtable(L, 0, 1);\n    lua_pushlightuserdata(L, (void *)&KEY_HOOK);\n    lua_pushvalue(L, -2);\n    lua_rawset(L, LUA_REGISTRYINDEX);\n  }\n}\n\n\nstatic int db_sethook (lua_State *L) {\n  int arg, mask, count;\n  lua_Hook func;\n  lua_State *L1 = getthread(L, &arg);\n  if (lua_isnoneornil(L, arg+1)) {\n    lua_settop(L, arg+1);\n    func = NULL; mask = 0; count = 0;  /* turn off hooks */\n  }\n  else {\n    const char *smask = luaL_checkstring(L, arg+2);\n    luaL_checktype(L, arg+1, LUA_TFUNCTION);\n    count = luaL_optint(L, arg+3, 0);\n    func = hookf; mask = makemask(smask, count);\n  }\n  gethooktable(L);\n  lua_pushlightuserdata(L, L1);\n  lua_pushvalue(L, arg+1);\n  lua_rawset(L, -3);  /* set new hook */\n  lua_pop(L, 1);  /* remove hook table */\n  lua_sethook(L1, func, mask, count);  /* set hooks */\n  return 0;\n}\n\n\nstatic int db_gethook (lua_State *L) {\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  char buff[5];\n  int mask = lua_gethookmask(L1);\n  lua_Hook hook = lua_gethook(L1);\n  if (hook != NULL && hook != hookf)  /* external hook? */\n    lua_pushliteral(L, \"external hook\");\n  else {\n    gethooktable(L);\n    lua_pushlightuserdata(L, L1);\n    lua_rawget(L, -2);   /* get hook */\n    lua_remove(L, -2);  /* remove hook table */\n  }\n  lua_pushstring(L, unmakemask(mask, buff));\n  lua_pushinteger(L, lua_gethookcount(L1));\n  return 3;\n}\n\n\nstatic int db_debug (lua_State *L) {\n  for (;;) {\n    char buffer[250];\n    fputs(\"lua_debug> \", stderr);\n    if (fgets(buffer, sizeof(buffer), stdin) == 0 ||\n        strcmp(buffer, \"cont\\n\") == 0)\n      return 0;\n    if (luaL_loadbuffer(L, buffer, strlen(buffer), \"=(debug command)\") ||\n        lua_pcall(L, 0, 0, 0)) {\n      fputs(lua_tostring(L, -1), stderr);\n      fputs(\"\\n\", stderr);\n    }\n    lua_settop(L, 0);  /* remove eventual returns */\n  }\n}\n\n\n#define LEVELS1\t12\t/* size of the first part of the stack */\n#define LEVELS2\t10\t/* size of the second part of the stack */\n\nstatic int db_errorfb (lua_State *L) {\n  int level;\n  int firstpart = 1;  /* still before eventual `...' */\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  lua_Debug ar;\n  if (lua_isnumber(L, arg+2)) {\n    level = (int)lua_tointeger(L, arg+2);\n    lua_pop(L, 1);\n  }\n  else\n    level = (L == L1) ? 1 : 0;  /* level 0 may be this own function */\n  if (lua_gettop(L) == arg)\n    lua_pushliteral(L, \"\");\n  else if (!lua_isstring(L, arg+1)) return 1;  /* message is not a string */\n  else lua_pushliteral(L, \"\\n\");\n  lua_pushliteral(L, \"stack traceback:\");\n  while (lua_getstack(L1, level++, &ar)) {\n    if (level > LEVELS1 && firstpart) {\n      /* no more than `LEVELS2' more levels? */\n      if (!lua_getstack(L1, level+LEVELS2, &ar))\n        level--;  /* keep going */\n      else {\n        lua_pushliteral(L, \"\\n\\t...\");  /* too many levels */\n        while (lua_getstack(L1, level+LEVELS2, &ar))  /* find last levels */\n          level++;\n      }\n      firstpart = 0;\n      continue;\n    }\n    lua_pushliteral(L, \"\\n\\t\");\n    lua_getinfo(L1, \"Snl\", &ar);\n    lua_pushfstring(L, \"%s:\", ar.short_src);\n    if (ar.currentline > 0)\n      lua_pushfstring(L, \"%d:\", ar.currentline);\n    if (*ar.namewhat != '\\0')  /* is there a name? */\n        lua_pushfstring(L, \" in function \" LUA_QS, ar.name);\n    else {\n      if (*ar.what == 'm')  /* main? */\n        lua_pushfstring(L, \" in main chunk\");\n      else if (*ar.what == 'C' || *ar.what == 't')\n        lua_pushliteral(L, \" ?\");  /* C function or tail call */\n      else\n        lua_pushfstring(L, \" in function <%s:%d>\",\n                           ar.short_src, ar.linedefined);\n    }\n    lua_concat(L, lua_gettop(L) - arg);\n  }\n  lua_concat(L, lua_gettop(L) - arg);\n  return 1;\n}\n\n\nstatic const luaL_Reg dblib[] = {\n  {\"debug\", db_debug},\n  {\"getfenv\", db_getfenv},\n  {\"gethook\", db_gethook},\n  {\"getinfo\", db_getinfo},\n  {\"getlocal\", db_getlocal},\n  {\"getregistry\", db_getregistry},\n  {\"getmetatable\", db_getmetatable},\n  {\"getupvalue\", db_getupvalue},\n  {\"setfenv\", db_setfenv},\n  {\"sethook\", db_sethook},\n  {\"setlocal\", db_setlocal},\n  {\"setmetatable\", db_setmetatable},\n  {\"setupvalue\", db_setupvalue},\n  {\"traceback\", db_errorfb},\n  {NULL, NULL}\n};\n\n\nLUALIB_API int luaopen_debug (lua_State *L) {\n  luaL_register(L, LUA_DBLIBNAME, dblib);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ldebug.c",
    "content": "/*\n** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $\n** Debug Interface\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <string.h>\n\n\n#define ldebug_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lapi.h\"\n#include \"lcode.h\"\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"lobject.h\"\n#include \"lopcodes.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"ltm.h\"\n#include \"lvm.h\"\n\n\n\nstatic const char *getfuncname (lua_State *L, CallInfo *ci, const char **name);\n\n\nstatic int currentpc (lua_State *L, CallInfo *ci) {\n  if (!isLua(ci)) return -1;  /* function is not a Lua function? */\n  if (ci == L->ci)\n    ci->savedpc = L->savedpc;\n  return pcRel(ci->savedpc, ci_func(ci)->l.p);\n}\n\n\nstatic int currentline (lua_State *L, CallInfo *ci) {\n  int pc = currentpc(L, ci);\n  if (pc < 0)\n    return -1;  /* only active lua functions have current-line information */\n  else\n    return getline(ci_func(ci)->l.p, pc);\n}\n\n\n/*\n** this function can be called asynchronous (e.g. during a signal)\n*/\nLUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {\n  if (func == NULL || mask == 0) {  /* turn off hooks? */\n    mask = 0;\n    func = NULL;\n  }\n  L->hook = func;\n  L->basehookcount = count;\n  resethookcount(L);\n  L->hookmask = cast_byte(mask);\n  return 1;\n}\n\n\nLUA_API lua_Hook lua_gethook (lua_State *L) {\n  return L->hook;\n}\n\n\nLUA_API int lua_gethookmask (lua_State *L) {\n  return L->hookmask;\n}\n\n\nLUA_API int lua_gethookcount (lua_State *L) {\n  return L->basehookcount;\n}\n\n\nLUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {\n  int status;\n  CallInfo *ci;\n  lua_lock(L);\n  for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) {\n    level--;\n    if (f_isLua(ci))  /* Lua function? */\n      level -= ci->tailcalls;  /* skip lost tail calls */\n  }\n  if (level == 0 && ci > L->base_ci) {  /* level found? */\n    status = 1;\n    ar->i_ci = cast_int(ci - L->base_ci);\n  }\n  else if (level < 0) {  /* level is of a lost tail call? */\n    status = 1;\n    ar->i_ci = 0;\n  }\n  else status = 0;  /* no such level */\n  lua_unlock(L);\n  return status;\n}\n\n\nstatic Proto *getluaproto (CallInfo *ci) {\n  return (isLua(ci) ? ci_func(ci)->l.p : NULL);\n}\n\n\nstatic const char *findlocal (lua_State *L, CallInfo *ci, int n) {\n  const char *name;\n  Proto *fp = getluaproto(ci);\n  if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL)\n    return name;  /* is a local variable in a Lua function */\n  else {\n    StkId limit = (ci == L->ci) ? L->top : (ci+1)->func;\n    if (limit - ci->base >= n && n > 0)  /* is 'n' inside 'ci' stack? */\n      return \"(*temporary)\";\n    else\n      return NULL;\n  }\n}\n\n\nLUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {\n  CallInfo *ci = L->base_ci + ar->i_ci;\n  const char *name = findlocal(L, ci, n);\n  lua_lock(L);\n  if (name)\n      luaA_pushobject(L, ci->base + (n - 1));\n  lua_unlock(L);\n  return name;\n}\n\n\nLUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {\n  CallInfo *ci = L->base_ci + ar->i_ci;\n  const char *name = findlocal(L, ci, n);\n  lua_lock(L);\n  if (name)\n      setobjs2s(L, ci->base + (n - 1), L->top - 1);\n  L->top--;  /* pop value */\n  lua_unlock(L);\n  return name;\n}\n\n\nstatic void funcinfo (lua_Debug *ar, Closure *cl) {\n  if (cl->c.isC) {\n    ar->source = \"=[C]\";\n    ar->linedefined = -1;\n    ar->lastlinedefined = -1;\n    ar->what = \"C\";\n  }\n  else {\n    ar->source = getstr(cl->l.p->source);\n    ar->linedefined = cl->l.p->linedefined;\n    ar->lastlinedefined = cl->l.p->lastlinedefined;\n    ar->what = (ar->linedefined == 0) ? \"main\" : \"Lua\";\n  }\n  luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE);\n}\n\n\nstatic void info_tailcall (lua_Debug *ar) {\n  ar->name = ar->namewhat = \"\";\n  ar->what = \"tail\";\n  ar->lastlinedefined = ar->linedefined = ar->currentline = -1;\n  ar->source = \"=(tail call)\";\n  luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE);\n  ar->nups = 0;\n}\n\n\nstatic void collectvalidlines (lua_State *L, Closure *f) {\n  if (f == NULL || f->c.isC) {\n    setnilvalue(L->top);\n  }\n  else {\n    Table *t = luaH_new(L, 0, 0);\n    int *lineinfo = f->l.p->lineinfo;\n    int i;\n    for (i=0; i<f->l.p->sizelineinfo; i++)\n      setbvalue(luaH_setnum(L, t, lineinfo[i]), 1);\n    sethvalue(L, L->top, t); \n  }\n  incr_top(L);\n}\n\n\nstatic int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,\n                    Closure *f, CallInfo *ci) {\n  int status = 1;\n  if (f == NULL) {\n    info_tailcall(ar);\n    return status;\n  }\n  for (; *what; what++) {\n    switch (*what) {\n      case 'S': {\n        funcinfo(ar, f);\n        break;\n      }\n      case 'l': {\n        ar->currentline = (ci) ? currentline(L, ci) : -1;\n        break;\n      }\n      case 'u': {\n        ar->nups = f->c.nupvalues;\n        break;\n      }\n      case 'n': {\n        ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL;\n        if (ar->namewhat == NULL) {\n          ar->namewhat = \"\";  /* not found */\n          ar->name = NULL;\n        }\n        break;\n      }\n      case 'L':\n      case 'f':  /* handled by lua_getinfo */\n        break;\n      default: status = 0;  /* invalid option */\n    }\n  }\n  return status;\n}\n\n\nLUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {\n  int status;\n  Closure *f = NULL;\n  CallInfo *ci = NULL;\n  lua_lock(L);\n  if (*what == '>') {\n    StkId func = L->top - 1;\n    luai_apicheck(L, ttisfunction(func));\n    what++;  /* skip the '>' */\n    f = clvalue(func);\n    L->top--;  /* pop function */\n  }\n  else if (ar->i_ci != 0) {  /* no tail call? */\n    ci = L->base_ci + ar->i_ci;\n    lua_assert(ttisfunction(ci->func));\n    f = clvalue(ci->func);\n  }\n  status = auxgetinfo(L, what, ar, f, ci);\n  if (strchr(what, 'f')) {\n    if (f == NULL) setnilvalue(L->top);\n    else setclvalue(L, L->top, f);\n    incr_top(L);\n  }\n  if (strchr(what, 'L'))\n    collectvalidlines(L, f);\n  lua_unlock(L);\n  return status;\n}\n\n\n/*\n** {======================================================\n** Symbolic Execution and code checker\n** =======================================================\n*/\n\n#define check(x)\t\tif (!(x)) return 0;\n\n#define checkjump(pt,pc)\tcheck(0 <= pc && pc < pt->sizecode)\n\n#define checkreg(pt,reg)\tcheck((reg) < (pt)->maxstacksize)\n\n\n\nstatic int precheck (const Proto *pt) {\n  check(pt->maxstacksize <= MAXSTACK);\n  check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);\n  check(!(pt->is_vararg & VARARG_NEEDSARG) ||\n              (pt->is_vararg & VARARG_HASARG));\n  check(pt->sizeupvalues <= pt->nups);\n  check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);\n  check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);\n  return 1;\n}\n\n\n#define checkopenop(pt,pc)\tluaG_checkopenop((pt)->code[(pc)+1])\n\nint luaG_checkopenop (Instruction i) {\n  switch (GET_OPCODE(i)) {\n    case OP_CALL:\n    case OP_TAILCALL:\n    case OP_RETURN:\n    case OP_SETLIST: {\n      check(GETARG_B(i) == 0);\n      return 1;\n    }\n    default: return 0;  /* invalid instruction after an open call */\n  }\n}\n\n\nstatic int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) {\n  switch (mode) {\n    case OpArgN: check(r == 0); break;\n    case OpArgU: break;\n    case OpArgR: checkreg(pt, r); break;\n    case OpArgK:\n      check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize);\n      break;\n  }\n  return 1;\n}\n\n\nstatic Instruction symbexec (const Proto *pt, int lastpc, int reg) {\n  int pc;\n  int last;  /* stores position of last instruction that changed `reg' */\n  last = pt->sizecode-1;  /* points to final return (a `neutral' instruction) */\n  check(precheck(pt));\n  for (pc = 0; pc < lastpc; pc++) {\n    Instruction i = pt->code[pc];\n    OpCode op = GET_OPCODE(i);\n    int a = GETARG_A(i);\n    int b = 0;\n    int c = 0;\n    check(op < NUM_OPCODES);\n    checkreg(pt, a);\n    switch (getOpMode(op)) {\n      case iABC: {\n        b = GETARG_B(i);\n        c = GETARG_C(i);\n        check(checkArgMode(pt, b, getBMode(op)));\n        check(checkArgMode(pt, c, getCMode(op)));\n        break;\n      }\n      case iABx: {\n        b = GETARG_Bx(i);\n        if (getBMode(op) == OpArgK) check(b < pt->sizek);\n        break;\n      }\n      case iAsBx: {\n        b = GETARG_sBx(i);\n        if (getBMode(op) == OpArgR) {\n          int dest = pc+1+b;\n          check(0 <= dest && dest < pt->sizecode);\n          if (dest > 0) {\n            int j;\n            /* check that it does not jump to a setlist count; this\n               is tricky, because the count from a previous setlist may\n               have the same value of an invalid setlist; so, we must\n               go all the way back to the first of them (if any) */\n            for (j = 0; j < dest; j++) {\n              Instruction d = pt->code[dest-1-j];\n              if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break;\n            }\n            /* if 'j' is even, previous value is not a setlist (even if\n               it looks like one) */\n            check((j&1) == 0);\n          }\n        }\n        break;\n      }\n    }\n    if (testAMode(op)) {\n      if (a == reg) last = pc;  /* change register `a' */\n    }\n    if (testTMode(op)) {\n      check(pc+2 < pt->sizecode);  /* check skip */\n      check(GET_OPCODE(pt->code[pc+1]) == OP_JMP);\n    }\n    switch (op) {\n      case OP_LOADBOOL: {\n        if (c == 1) {  /* does it jump? */\n          check(pc+2 < pt->sizecode);  /* check its jump */\n          check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST ||\n                GETARG_C(pt->code[pc+1]) != 0);\n        }\n        break;\n      }\n      case OP_LOADNIL: {\n        if (a <= reg && reg <= b)\n          last = pc;  /* set registers from `a' to `b' */\n        break;\n      }\n      case OP_GETUPVAL:\n      case OP_SETUPVAL: {\n        check(b < pt->nups);\n        break;\n      }\n      case OP_GETGLOBAL:\n      case OP_SETGLOBAL: {\n        check(ttisstring(&pt->k[b]));\n        break;\n      }\n      case OP_SELF: {\n        checkreg(pt, a+1);\n        if (reg == a+1) last = pc;\n        break;\n      }\n      case OP_CONCAT: {\n        check(b < c);  /* at least two operands */\n        break;\n      }\n      case OP_TFORLOOP: {\n        check(c >= 1);  /* at least one result (control variable) */\n        checkreg(pt, a+2+c);  /* space for results */\n        if (reg >= a+2) last = pc;  /* affect all regs above its base */\n        break;\n      }\n      case OP_FORLOOP:\n      case OP_FORPREP:\n        checkreg(pt, a+3);\n        /* go through */\n      case OP_JMP: {\n        int dest = pc+1+b;\n        /* not full check and jump is forward and do not skip `lastpc'? */\n        if (reg != NO_REG && pc < dest && dest <= lastpc)\n          pc += b;  /* do the jump */\n        break;\n      }\n      case OP_CALL:\n      case OP_TAILCALL: {\n        if (b != 0) {\n          checkreg(pt, a+b-1);\n        }\n        c--;  /* c = num. returns */\n        if (c == LUA_MULTRET) {\n          check(checkopenop(pt, pc));\n        }\n        else if (c != 0)\n          checkreg(pt, a+c-1);\n        if (reg >= a) last = pc;  /* affect all registers above base */\n        break;\n      }\n      case OP_RETURN: {\n        b--;  /* b = num. returns */\n        if (b > 0) checkreg(pt, a+b-1);\n        break;\n      }\n      case OP_SETLIST: {\n        if (b > 0) checkreg(pt, a + b);\n        if (c == 0) {\n          pc++;\n          check(pc < pt->sizecode - 1);\n        }\n        break;\n      }\n      case OP_CLOSURE: {\n        int nup, j;\n        check(b < pt->sizep);\n        nup = pt->p[b]->nups;\n        check(pc + nup < pt->sizecode);\n        for (j = 1; j <= nup; j++) {\n          OpCode op1 = GET_OPCODE(pt->code[pc + j]);\n          check(op1 == OP_GETUPVAL || op1 == OP_MOVE);\n        }\n        if (reg != NO_REG)  /* tracing? */\n          pc += nup;  /* do not 'execute' these pseudo-instructions */\n        break;\n      }\n      case OP_VARARG: {\n        check((pt->is_vararg & VARARG_ISVARARG) &&\n             !(pt->is_vararg & VARARG_NEEDSARG));\n        b--;\n        if (b == LUA_MULTRET) check(checkopenop(pt, pc));\n        checkreg(pt, a+b-1);\n        break;\n      }\n      default: break;\n    }\n  }\n  return pt->code[last];\n}\n\n#undef check\n#undef checkjump\n#undef checkreg\n\n/* }====================================================== */\n\n\nint luaG_checkcode (const Proto *pt) {\n  return (symbexec(pt, pt->sizecode, NO_REG) != 0);\n}\n\n\nstatic const char *kname (Proto *p, int c) {\n  if (ISK(c) && ttisstring(&p->k[INDEXK(c)]))\n    return svalue(&p->k[INDEXK(c)]);\n  else\n    return \"?\";\n}\n\n\nstatic const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,\n                               const char **name) {\n  if (isLua(ci)) {  /* a Lua function? */\n    Proto *p = ci_func(ci)->l.p;\n    int pc = currentpc(L, ci);\n    Instruction i;\n    *name = luaF_getlocalname(p, stackpos+1, pc);\n    if (*name)  /* is a local? */\n      return \"local\";\n    i = symbexec(p, pc, stackpos);  /* try symbolic execution */\n    lua_assert(pc != -1);\n    switch (GET_OPCODE(i)) {\n      case OP_GETGLOBAL: {\n        int g = GETARG_Bx(i);  /* global index */\n        lua_assert(ttisstring(&p->k[g]));\n        *name = svalue(&p->k[g]);\n        return \"global\";\n      }\n      case OP_MOVE: {\n        int a = GETARG_A(i);\n        int b = GETARG_B(i);  /* move from `b' to `a' */\n        if (b < a)\n          return getobjname(L, ci, b, name);  /* get name for `b' */\n        break;\n      }\n      case OP_GETTABLE: {\n        int k = GETARG_C(i);  /* key index */\n        *name = kname(p, k);\n        return \"field\";\n      }\n      case OP_GETUPVAL: {\n        int u = GETARG_B(i);  /* upvalue index */\n        *name = p->upvalues ? getstr(p->upvalues[u]) : \"?\";\n        return \"upvalue\";\n      }\n      case OP_SELF: {\n        int k = GETARG_C(i);  /* key index */\n        *name = kname(p, k);\n        return \"method\";\n      }\n      default: break;\n    }\n  }\n  return NULL;  /* no useful name found */\n}\n\n\nstatic const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {\n  Instruction i;\n  if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1))\n    return NULL;  /* calling function is not Lua (or is unknown) */\n  ci--;  /* calling function */\n  i = ci_func(ci)->l.p->code[currentpc(L, ci)];\n  if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL ||\n      GET_OPCODE(i) == OP_TFORLOOP)\n    return getobjname(L, ci, GETARG_A(i), name);\n  else\n    return NULL;  /* no useful name can be found */\n}\n\n\n/* only ANSI way to check whether a pointer points to an array */\nstatic int isinstack (CallInfo *ci, const TValue *o) {\n  StkId p;\n  for (p = ci->base; p < ci->top; p++)\n    if (o == p) return 1;\n  return 0;\n}\n\n\nvoid luaG_typeerror (lua_State *L, const TValue *o, const char *op) {\n  const char *name = NULL;\n  const char *t = luaT_typenames[ttype(o)];\n  const char *kind = (isinstack(L->ci, o)) ?\n                         getobjname(L, L->ci, cast_int(o - L->base), &name) :\n                         NULL;\n  if (kind)\n    luaG_runerror(L, \"attempt to %s %s \" LUA_QS \" (a %s value)\",\n                op, kind, name, t);\n  else\n    luaG_runerror(L, \"attempt to %s a %s value\", op, t);\n}\n\n\nvoid luaG_concaterror (lua_State *L, StkId p1, StkId p2) {\n  if (ttisstring(p1) || ttisnumber(p1)) p1 = p2;\n  lua_assert(!ttisstring(p1) && !ttisnumber(p1));\n  luaG_typeerror(L, p1, \"concatenate\");\n}\n\n\nvoid luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) {\n  TValue temp;\n  if (luaV_tonumber(p1, &temp) == NULL)\n    p2 = p1;  /* first operand is wrong */\n  luaG_typeerror(L, p2, \"perform arithmetic on\");\n}\n\n\nint luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) {\n  const char *t1 = luaT_typenames[ttype(p1)];\n  const char *t2 = luaT_typenames[ttype(p2)];\n  if (t1[2] == t2[2])\n    luaG_runerror(L, \"attempt to compare two %s values\", t1);\n  else\n    luaG_runerror(L, \"attempt to compare %s with %s\", t1, t2);\n  return 0;\n}\n\n\nstatic void addinfo (lua_State *L, const char *msg) {\n  CallInfo *ci = L->ci;\n  if (isLua(ci)) {  /* is Lua code? */\n    char buff[LUA_IDSIZE];  /* add file:line information */\n    int line = currentline(L, ci);\n    luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE);\n    luaO_pushfstring(L, \"%s:%d: %s\", buff, line, msg);\n  }\n}\n\n\nvoid luaG_errormsg (lua_State *L) {\n  if (L->errfunc != 0) {  /* is there an error handling function? */\n    StkId errfunc = restorestack(L, L->errfunc);\n    if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR);\n    setobjs2s(L, L->top, L->top - 1);  /* move argument */\n    setobjs2s(L, L->top - 1, errfunc);  /* push function */\n    incr_top(L);\n    luaD_call(L, L->top - 2, 1);  /* call it */\n  }\n  luaD_throw(L, LUA_ERRRUN);\n}\n\n\nvoid luaG_runerror (lua_State *L, const char *fmt, ...) {\n  va_list argp;\n  va_start(argp, fmt);\n  addinfo(L, luaO_pushvfstring(L, fmt, argp));\n  va_end(argp);\n  luaG_errormsg(L);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ldebug.h",
    "content": "/*\n** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $\n** Auxiliary functions from Debug Interface module\n** See Copyright Notice in lua.h\n*/\n\n#ifndef ldebug_h\n#define ldebug_h\n\n\n#include \"lstate.h\"\n\n\n#define pcRel(pc, p)\t(cast(int, (pc) - (p)->code) - 1)\n\n#define getline(f,pc)\t(((f)->lineinfo) ? (f)->lineinfo[pc] : 0)\n\n#define resethookcount(L)\t(L->hookcount = L->basehookcount)\n\n\nLUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,\n                                             const char *opname);\nLUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);\nLUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,\n                                              const TValue *p2);\nLUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,\n                                             const TValue *p2);\nLUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);\nLUAI_FUNC void luaG_errormsg (lua_State *L);\nLUAI_FUNC int luaG_checkcode (const Proto *pt);\nLUAI_FUNC int luaG_checkopenop (Instruction i);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ldo.c",
    "content": "/*\n** $Id: ldo.c,v 2.38.1.4 2012/01/18 02:27:10 roberto Exp $\n** Stack and Call structure of Lua\n** See Copyright Notice in lua.h\n*/\n\n\n#include <setjmp.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define ldo_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"lgc.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lopcodes.h\"\n#include \"lparser.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"ltm.h\"\n#include \"lundump.h\"\n#include \"lvm.h\"\n#include \"lzio.h\"\n\n\n\n\n/*\n** {======================================================\n** Error-recovery functions\n** =======================================================\n*/\n\n\n/* chain list of long jump buffers */\nstruct lua_longjmp {\n  struct lua_longjmp *previous;\n  luai_jmpbuf b;\n  volatile int status;  /* error code */\n};\n\n\nvoid luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) {\n  switch (errcode) {\n    case LUA_ERRMEM: {\n      setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG));\n      break;\n    }\n    case LUA_ERRERR: {\n      setsvalue2s(L, oldtop, luaS_newliteral(L, \"error in error handling\"));\n      break;\n    }\n    case LUA_ERRSYNTAX:\n    case LUA_ERRRUN: {\n      setobjs2s(L, oldtop, L->top - 1);  /* error message on current top */\n      break;\n    }\n  }\n  L->top = oldtop + 1;\n}\n\n\nstatic void restore_stack_limit (lua_State *L) {\n  lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1);\n  if (L->size_ci > LUAI_MAXCALLS) {  /* there was an overflow? */\n    int inuse = cast_int(L->ci - L->base_ci);\n    if (inuse + 1 < LUAI_MAXCALLS)  /* can `undo' overflow? */\n      luaD_reallocCI(L, LUAI_MAXCALLS);\n  }\n}\n\n\nstatic void resetstack (lua_State *L, int status) {\n  L->ci = L->base_ci;\n  L->base = L->ci->base;\n  luaF_close(L, L->base);  /* close eventual pending closures */\n  luaD_seterrorobj(L, status, L->base);\n  L->nCcalls = L->baseCcalls;\n  L->allowhook = 1;\n  restore_stack_limit(L);\n  L->errfunc = 0;\n  L->errorJmp = NULL;\n}\n\n\nvoid luaD_throw (lua_State *L, int errcode) {\n  if (L->errorJmp) {\n    L->errorJmp->status = errcode;\n    LUAI_THROW(L, L->errorJmp);\n  }\n  else {\n    L->status = cast_byte(errcode);\n    if (G(L)->panic) {\n      resetstack(L, errcode);\n      lua_unlock(L);\n      G(L)->panic(L);\n    }\n    exit(EXIT_FAILURE);\n  }\n}\n\n\nint luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {\n  struct lua_longjmp lj;\n  lj.status = 0;\n  lj.previous = L->errorJmp;  /* chain new error handler */\n  L->errorJmp = &lj;\n  LUAI_TRY(L, &lj,\n    (*f)(L, ud);\n  );\n  L->errorJmp = lj.previous;  /* restore old error handler */\n  return lj.status;\n}\n\n/* }====================================================== */\n\n\nstatic void correctstack (lua_State *L, TValue *oldstack) {\n  CallInfo *ci;\n  GCObject *up;\n  L->top = (L->top - oldstack) + L->stack;\n  for (up = L->openupval; up != NULL; up = up->gch.next)\n    gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack;\n  for (ci = L->base_ci; ci <= L->ci; ci++) {\n    ci->top = (ci->top - oldstack) + L->stack;\n    ci->base = (ci->base - oldstack) + L->stack;\n    ci->func = (ci->func - oldstack) + L->stack;\n  }\n  L->base = (L->base - oldstack) + L->stack;\n}\n\n\nvoid luaD_reallocstack (lua_State *L, int newsize) {\n  TValue *oldstack = L->stack;\n  int realsize = newsize + 1 + EXTRA_STACK;\n  lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1);\n  luaM_reallocvector(L, L->stack, L->stacksize, realsize, TValue);\n  L->stacksize = realsize;\n  L->stack_last = L->stack+newsize;\n  correctstack(L, oldstack);\n}\n\n\nvoid luaD_reallocCI (lua_State *L, int newsize) {\n  CallInfo *oldci = L->base_ci;\n  luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo);\n  L->size_ci = newsize;\n  L->ci = (L->ci - oldci) + L->base_ci;\n  L->end_ci = L->base_ci + L->size_ci - 1;\n}\n\n\nvoid luaD_growstack (lua_State *L, int n) {\n  if (n <= L->stacksize)  /* double size is enough? */\n    luaD_reallocstack(L, 2*L->stacksize);\n  else\n    luaD_reallocstack(L, L->stacksize + n);\n}\n\n\nstatic CallInfo *growCI (lua_State *L) {\n  if (L->size_ci > LUAI_MAXCALLS)  /* overflow while handling overflow? */\n    luaD_throw(L, LUA_ERRERR);\n  else {\n    luaD_reallocCI(L, 2*L->size_ci);\n    if (L->size_ci > LUAI_MAXCALLS)\n      luaG_runerror(L, \"stack overflow\");\n  }\n  return ++L->ci;\n}\n\n\nvoid luaD_callhook (lua_State *L, int event, int line) {\n  lua_Hook hook = L->hook;\n  if (hook && L->allowhook) {\n    ptrdiff_t top = savestack(L, L->top);\n    ptrdiff_t ci_top = savestack(L, L->ci->top);\n    lua_Debug ar;\n    ar.event = event;\n    ar.currentline = line;\n    if (event == LUA_HOOKTAILRET)\n      ar.i_ci = 0;  /* tail call; no debug information about it */\n    else\n      ar.i_ci = cast_int(L->ci - L->base_ci);\n    luaD_checkstack(L, LUA_MINSTACK);  /* ensure minimum stack size */\n    L->ci->top = L->top + LUA_MINSTACK;\n    lua_assert(L->ci->top <= L->stack_last);\n    L->allowhook = 0;  /* cannot call hooks inside a hook */\n    lua_unlock(L);\n    (*hook)(L, &ar);\n    lua_lock(L);\n    lua_assert(!L->allowhook);\n    L->allowhook = 1;\n    L->ci->top = restorestack(L, ci_top);\n    L->top = restorestack(L, top);\n  }\n}\n\n\nstatic StkId adjust_varargs (lua_State *L, Proto *p, int actual) {\n  int i;\n  int nfixargs = p->numparams;\n  Table *htab = NULL;\n  StkId base, fixed;\n  for (; actual < nfixargs; ++actual)\n    setnilvalue(L->top++);\n#if defined(LUA_COMPAT_VARARG)\n  if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */\n    int nvar = actual - nfixargs;  /* number of extra arguments */\n    lua_assert(p->is_vararg & VARARG_HASARG);\n    luaC_checkGC(L);\n    luaD_checkstack(L, p->maxstacksize);\n    htab = luaH_new(L, nvar, 1);  /* create `arg' table */\n    for (i=0; i<nvar; i++)  /* put extra arguments into `arg' table */\n      setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);\n    /* store counter in field `n' */\n    setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, \"n\")), cast_num(nvar));\n  }\n#endif\n  /* move fixed parameters to final position */\n  fixed = L->top - actual;  /* first fixed argument */\n  base = L->top;  /* final position of first argument */\n  for (i=0; i<nfixargs; i++) {\n    setobjs2s(L, L->top++, fixed+i);\n    setnilvalue(fixed+i);\n  }\n  /* add `arg' parameter */\n  if (htab) {\n    sethvalue(L, L->top++, htab);\n    lua_assert(iswhite(obj2gco(htab)));\n  }\n  return base;\n}\n\n\nstatic StkId tryfuncTM (lua_State *L, StkId func) {\n  const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL);\n  StkId p;\n  ptrdiff_t funcr = savestack(L, func);\n  if (!ttisfunction(tm))\n    luaG_typeerror(L, func, \"call\");\n  /* Open a hole inside the stack at `func' */\n  for (p = L->top; p > func; p--) setobjs2s(L, p, p-1);\n  incr_top(L);\n  func = restorestack(L, funcr);  /* previous call may change stack */\n  setobj2s(L, func, tm);  /* tag method is the new function to be called */\n  return func;\n}\n\n\n\n#define inc_ci(L) \\\n  ((L->ci == L->end_ci) ? growCI(L) : \\\n   (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci))\n\n\nint luaD_precall (lua_State *L, StkId func, int nresults) {\n  LClosure *cl;\n  ptrdiff_t funcr;\n  if (!ttisfunction(func)) /* `func' is not a function? */\n    func = tryfuncTM(L, func);  /* check the `function' tag method */\n  funcr = savestack(L, func);\n  cl = &clvalue(func)->l;\n  L->ci->savedpc = L->savedpc;\n  if (!cl->isC) {  /* Lua function? prepare its call */\n    CallInfo *ci;\n    StkId st, base;\n    Proto *p = cl->p;\n    luaD_checkstack(L, p->maxstacksize);\n    func = restorestack(L, funcr);\n    if (!p->is_vararg) {  /* no varargs? */\n      base = func + 1;\n      if (L->top > base + p->numparams)\n        L->top = base + p->numparams;\n    }\n    else {  /* vararg function */\n      int nargs = cast_int(L->top - func) - 1;\n      base = adjust_varargs(L, p, nargs);\n      func = restorestack(L, funcr);  /* previous call may change the stack */\n    }\n    ci = inc_ci(L);  /* now `enter' new function */\n    ci->func = func;\n    L->base = ci->base = base;\n    ci->top = L->base + p->maxstacksize;\n    lua_assert(ci->top <= L->stack_last);\n    L->savedpc = p->code;  /* starting point */\n    ci->tailcalls = 0;\n    ci->nresults = nresults;\n    for (st = L->top; st < ci->top; st++)\n      setnilvalue(st);\n    L->top = ci->top;\n    if (L->hookmask & LUA_MASKCALL) {\n      L->savedpc++;  /* hooks assume 'pc' is already incremented */\n      luaD_callhook(L, LUA_HOOKCALL, -1);\n      L->savedpc--;  /* correct 'pc' */\n    }\n    return PCRLUA;\n  }\n  else {  /* if is a C function, call it */\n    CallInfo *ci;\n    int n;\n    luaD_checkstack(L, LUA_MINSTACK);  /* ensure minimum stack size */\n    ci = inc_ci(L);  /* now `enter' new function */\n    ci->func = restorestack(L, funcr);\n    L->base = ci->base = ci->func + 1;\n    ci->top = L->top + LUA_MINSTACK;\n    lua_assert(ci->top <= L->stack_last);\n    ci->nresults = nresults;\n    if (L->hookmask & LUA_MASKCALL)\n      luaD_callhook(L, LUA_HOOKCALL, -1);\n    lua_unlock(L);\n    n = (*curr_func(L)->c.f)(L);  /* do the actual call */\n    lua_lock(L);\n    if (n < 0)  /* yielding? */\n      return PCRYIELD;\n    else {\n      luaD_poscall(L, L->top - n);\n      return PCRC;\n    }\n  }\n}\n\n\nstatic StkId callrethooks (lua_State *L, StkId firstResult) {\n  ptrdiff_t fr = savestack(L, firstResult);  /* next call may change stack */\n  luaD_callhook(L, LUA_HOOKRET, -1);\n  if (f_isLua(L->ci)) {  /* Lua function? */\n    while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */\n      luaD_callhook(L, LUA_HOOKTAILRET, -1);\n  }\n  return restorestack(L, fr);\n}\n\n\nint luaD_poscall (lua_State *L, StkId firstResult) {\n  StkId res;\n  int wanted, i;\n  CallInfo *ci;\n  if (L->hookmask & LUA_MASKRET)\n    firstResult = callrethooks(L, firstResult);\n  ci = L->ci--;\n  res = ci->func;  /* res == final position of 1st result */\n  wanted = ci->nresults;\n  L->base = (ci - 1)->base;  /* restore base */\n  L->savedpc = (ci - 1)->savedpc;  /* restore savedpc */\n  /* move results to correct place */\n  for (i = wanted; i != 0 && firstResult < L->top; i--)\n    setobjs2s(L, res++, firstResult++);\n  while (i-- > 0)\n    setnilvalue(res++);\n  L->top = res;\n  return (wanted - LUA_MULTRET);  /* 0 iff wanted == LUA_MULTRET */\n}\n\n\n/*\n** Call a function (C or Lua). The function to be called is at *func.\n** The arguments are on the stack, right after the function.\n** When returns, all the results are on the stack, starting at the original\n** function position.\n*/ \nvoid luaD_call (lua_State *L, StkId func, int nResults) {\n  if (++L->nCcalls >= LUAI_MAXCCALLS) {\n    if (L->nCcalls == LUAI_MAXCCALLS)\n      luaG_runerror(L, \"C stack overflow\");\n    else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3)))\n      luaD_throw(L, LUA_ERRERR);  /* error while handing stack error */\n  }\n  if (luaD_precall(L, func, nResults) == PCRLUA)  /* is a Lua function? */\n    luaV_execute(L, 1);  /* call it */\n  L->nCcalls--;\n  luaC_checkGC(L);\n}\n\n\nstatic void resume (lua_State *L, void *ud) {\n  StkId firstArg = cast(StkId, ud);\n  CallInfo *ci = L->ci;\n  if (L->status == 0) {  /* start coroutine? */\n    lua_assert(ci == L->base_ci && firstArg > L->base);\n    if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA)\n      return;\n  }\n  else {  /* resuming from previous yield */\n    lua_assert(L->status == LUA_YIELD);\n    L->status = 0;\n    if (!f_isLua(ci)) {  /* `common' yield? */\n      /* finish interrupted execution of `OP_CALL' */\n      lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL ||\n                 GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL);\n      if (luaD_poscall(L, firstArg))  /* complete it... */\n        L->top = L->ci->top;  /* and correct top if not multiple results */\n    }\n    else  /* yielded inside a hook: just continue its execution */\n      L->base = L->ci->base;\n  }\n  luaV_execute(L, cast_int(L->ci - L->base_ci));\n}\n\n\nstatic int resume_error (lua_State *L, const char *msg) {\n  L->top = L->ci->base;\n  setsvalue2s(L, L->top, luaS_new(L, msg));\n  incr_top(L);\n  lua_unlock(L);\n  return LUA_ERRRUN;\n}\n\n\nLUA_API int lua_resume (lua_State *L, int nargs) {\n  int status;\n  lua_lock(L);\n  if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci))\n      return resume_error(L, \"cannot resume non-suspended coroutine\");\n  if (L->nCcalls >= LUAI_MAXCCALLS)\n    return resume_error(L, \"C stack overflow\");\n  luai_userstateresume(L, nargs);\n  lua_assert(L->errfunc == 0);\n  L->baseCcalls = ++L->nCcalls;\n  status = luaD_rawrunprotected(L, resume, L->top - nargs);\n  if (status != 0) {  /* error? */\n    L->status = cast_byte(status);  /* mark thread as `dead' */\n    luaD_seterrorobj(L, status, L->top);\n    L->ci->top = L->top;\n  }\n  else {\n    lua_assert(L->nCcalls == L->baseCcalls);\n    status = L->status;\n  }\n  --L->nCcalls;\n  lua_unlock(L);\n  return status;\n}\n\n\nLUA_API int lua_yield (lua_State *L, int nresults) {\n  luai_userstateyield(L, nresults);\n  lua_lock(L);\n  if (L->nCcalls > L->baseCcalls)\n    luaG_runerror(L, \"attempt to yield across metamethod/C-call boundary\");\n  L->base = L->top - nresults;  /* protect stack slots below */\n  L->status = LUA_YIELD;\n  lua_unlock(L);\n  return -1;\n}\n\n\nint luaD_pcall (lua_State *L, Pfunc func, void *u,\n                ptrdiff_t old_top, ptrdiff_t ef) {\n  int status;\n  unsigned short oldnCcalls = L->nCcalls;\n  ptrdiff_t old_ci = saveci(L, L->ci);\n  lu_byte old_allowhooks = L->allowhook;\n  ptrdiff_t old_errfunc = L->errfunc;\n  L->errfunc = ef;\n  status = luaD_rawrunprotected(L, func, u);\n  if (status != 0) {  /* an error occurred? */\n    StkId oldtop = restorestack(L, old_top);\n    luaF_close(L, oldtop);  /* close eventual pending closures */\n    luaD_seterrorobj(L, status, oldtop);\n    L->nCcalls = oldnCcalls;\n    L->ci = restoreci(L, old_ci);\n    L->base = L->ci->base;\n    L->savedpc = L->ci->savedpc;\n    L->allowhook = old_allowhooks;\n    restore_stack_limit(L);\n  }\n  L->errfunc = old_errfunc;\n  return status;\n}\n\n\n\n/*\n** Execute a protected parser.\n*/\nstruct SParser {  /* data to `f_parser' */\n  ZIO *z;\n  Mbuffer buff;  /* buffer to be used by the scanner */\n  const char *name;\n};\n\nstatic void f_parser (lua_State *L, void *ud) {\n  int i;\n  Proto *tf;\n  Closure *cl;\n  struct SParser *p = cast(struct SParser *, ud);\n  int c = luaZ_lookahead(p->z);\n  luaC_checkGC(L);\n  tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z,\n                                                             &p->buff, p->name);\n  cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L)));\n  cl->l.p = tf;\n  for (i = 0; i < tf->nups; i++)  /* initialize eventual upvalues */\n    cl->l.upvals[i] = luaF_newupval(L);\n  setclvalue(L, L->top, cl);\n  incr_top(L);\n}\n\n\nint luaD_protectedparser (lua_State *L, ZIO *z, const char *name) {\n  struct SParser p;\n  int status;\n  p.z = z; p.name = name;\n  luaZ_initbuffer(L, &p.buff);\n  status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);\n  luaZ_freebuffer(L, &p.buff);\n  return status;\n}\n\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ldo.h",
    "content": "/*\n** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $\n** Stack and Call structure of Lua\n** See Copyright Notice in lua.h\n*/\n\n#ifndef ldo_h\n#define ldo_h\n\n\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"lzio.h\"\n\n\n#define luaD_checkstack(L,n)\t\\\n  if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \\\n    luaD_growstack(L, n); \\\n  else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));\n\n\n#define incr_top(L) {luaD_checkstack(L,1); L->top++;}\n\n#define savestack(L,p)\t\t((char *)(p) - (char *)L->stack)\n#define restorestack(L,n)\t((TValue *)((char *)L->stack + (n)))\n\n#define saveci(L,p)\t\t((char *)(p) - (char *)L->base_ci)\n#define restoreci(L,n)\t\t((CallInfo *)((char *)L->base_ci + (n)))\n\n\n/* results from luaD_precall */\n#define PCRLUA\t\t0\t/* initiated a call to a Lua function */\n#define PCRC\t\t1\t/* did a call to a C function */\n#define PCRYIELD\t2\t/* C funtion yielded */\n\n\n/* type of protected functions, to be ran by `runprotected' */\ntypedef void (*Pfunc) (lua_State *L, void *ud);\n\nLUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);\nLUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);\nLUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);\nLUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);\nLUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,\n                                        ptrdiff_t oldtop, ptrdiff_t ef);\nLUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);\nLUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);\nLUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);\nLUAI_FUNC void luaD_growstack (lua_State *L, int n);\n\nLUAI_FUNC void luaD_throw (lua_State *L, int errcode);\nLUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);\n\nLUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ldump.c",
    "content": "/*\n** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $\n** save precompiled Lua chunks\n** See Copyright Notice in lua.h\n*/\n\n#include <stddef.h>\n\n#define ldump_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"lundump.h\"\n\ntypedef struct {\n lua_State* L;\n lua_Writer writer;\n void* data;\n int strip;\n int status;\n} DumpState;\n\n#define DumpMem(b,n,size,D)\tDumpBlock(b,(n)*(size),D)\n#define DumpVar(x,D)\t \tDumpMem(&x,1,sizeof(x),D)\n\nstatic void DumpBlock(const void* b, size_t size, DumpState* D)\n{\n if (D->status==0)\n {\n  lua_unlock(D->L);\n  D->status=(*D->writer)(D->L,b,size,D->data);\n  lua_lock(D->L);\n }\n}\n\nstatic void DumpChar(int y, DumpState* D)\n{\n char x=(char)y;\n DumpVar(x,D);\n}\n\nstatic void DumpInt(int x, DumpState* D)\n{\n DumpVar(x,D);\n}\n\nstatic void DumpNumber(lua_Number x, DumpState* D)\n{\n DumpVar(x,D);\n}\n\nstatic void DumpVector(const void* b, int n, size_t size, DumpState* D)\n{\n DumpInt(n,D);\n DumpMem(b,n,size,D);\n}\n\nstatic void DumpString(const TString* s, DumpState* D)\n{\n if (s==NULL || getstr(s)==NULL)\n {\n  size_t size=0;\n  DumpVar(size,D);\n }\n else\n {\n  size_t size=s->tsv.len+1;\t\t/* include trailing '\\0' */\n  DumpVar(size,D);\n  DumpBlock(getstr(s),size,D);\n }\n}\n\n#define DumpCode(f,D)\t DumpVector(f->code,f->sizecode,sizeof(Instruction),D)\n\nstatic void DumpFunction(const Proto* f, const TString* p, DumpState* D);\n\nstatic void DumpConstants(const Proto* f, DumpState* D)\n{\n int i,n=f->sizek;\n DumpInt(n,D);\n for (i=0; i<n; i++)\n {\n  const TValue* o=&f->k[i];\n  DumpChar(ttype(o),D);\n  switch (ttype(o))\n  {\n   case LUA_TNIL:\n\tbreak;\n   case LUA_TBOOLEAN:\n\tDumpChar(bvalue(o),D);\n\tbreak;\n   case LUA_TNUMBER:\n\tDumpNumber(nvalue(o),D);\n\tbreak;\n   case LUA_TSTRING:\n\tDumpString(rawtsvalue(o),D);\n\tbreak;\n   default:\n\tlua_assert(0);\t\t\t/* cannot happen */\n\tbreak;\n  }\n }\n n=f->sizep;\n DumpInt(n,D);\n for (i=0; i<n; i++) DumpFunction(f->p[i],f->source,D);\n}\n\nstatic void DumpDebug(const Proto* f, DumpState* D)\n{\n int i,n;\n n= (D->strip) ? 0 : f->sizelineinfo;\n DumpVector(f->lineinfo,n,sizeof(int),D);\n n= (D->strip) ? 0 : f->sizelocvars;\n DumpInt(n,D);\n for (i=0; i<n; i++)\n {\n  DumpString(f->locvars[i].varname,D);\n  DumpInt(f->locvars[i].startpc,D);\n  DumpInt(f->locvars[i].endpc,D);\n }\n n= (D->strip) ? 0 : f->sizeupvalues;\n DumpInt(n,D);\n for (i=0; i<n; i++) DumpString(f->upvalues[i],D);\n}\n\nstatic void DumpFunction(const Proto* f, const TString* p, DumpState* D)\n{\n DumpString((f->source==p || D->strip) ? NULL : f->source,D);\n DumpInt(f->linedefined,D);\n DumpInt(f->lastlinedefined,D);\n DumpChar(f->nups,D);\n DumpChar(f->numparams,D);\n DumpChar(f->is_vararg,D);\n DumpChar(f->maxstacksize,D);\n DumpCode(f,D);\n DumpConstants(f,D);\n DumpDebug(f,D);\n}\n\nstatic void DumpHeader(DumpState* D)\n{\n char h[LUAC_HEADERSIZE];\n luaU_header(h);\n DumpBlock(h,LUAC_HEADERSIZE,D);\n}\n\n/*\n** dump Lua function as precompiled chunk\n*/\nint luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip)\n{\n DumpState D;\n D.L=L;\n D.writer=w;\n D.data=data;\n D.strip=strip;\n D.status=0;\n DumpHeader(&D);\n DumpFunction(f,NULL,&D);\n return D.status;\n}\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lfunc.c",
    "content": "/*\n** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $\n** Auxiliary functions to manipulate prototypes and closures\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stddef.h>\n\n#define lfunc_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lfunc.h\"\n#include \"lgc.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n\n\n\nClosure *luaF_newCclosure (lua_State *L, int nelems, Table *e) {\n  Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems)));\n  luaC_link(L, obj2gco(c), LUA_TFUNCTION);\n  c->c.isC = 1;\n  c->c.env = e;\n  c->c.nupvalues = cast_byte(nelems);\n  return c;\n}\n\n\nClosure *luaF_newLclosure (lua_State *L, int nelems, Table *e) {\n  Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems)));\n  luaC_link(L, obj2gco(c), LUA_TFUNCTION);\n  c->l.isC = 0;\n  c->l.env = e;\n  c->l.nupvalues = cast_byte(nelems);\n  while (nelems--) c->l.upvals[nelems] = NULL;\n  return c;\n}\n\n\nUpVal *luaF_newupval (lua_State *L) {\n  UpVal *uv = luaM_new(L, UpVal);\n  luaC_link(L, obj2gco(uv), LUA_TUPVAL);\n  uv->v = &uv->u.value;\n  setnilvalue(uv->v);\n  return uv;\n}\n\n\nUpVal *luaF_findupval (lua_State *L, StkId level) {\n  global_State *g = G(L);\n  GCObject **pp = &L->openupval;\n  UpVal *p;\n  UpVal *uv;\n  while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) {\n    lua_assert(p->v != &p->u.value);\n    if (p->v == level) {  /* found a corresponding upvalue? */\n      if (isdead(g, obj2gco(p)))  /* is it dead? */\n        changewhite(obj2gco(p));  /* ressurect it */\n      return p;\n    }\n    pp = &p->next;\n  }\n  uv = luaM_new(L, UpVal);  /* not found: create a new one */\n  uv->tt = LUA_TUPVAL;\n  uv->marked = luaC_white(g);\n  uv->v = level;  /* current value lives in the stack */\n  uv->next = *pp;  /* chain it in the proper position */\n  *pp = obj2gco(uv);\n  uv->u.l.prev = &g->uvhead;  /* double link it in `uvhead' list */\n  uv->u.l.next = g->uvhead.u.l.next;\n  uv->u.l.next->u.l.prev = uv;\n  g->uvhead.u.l.next = uv;\n  lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);\n  return uv;\n}\n\n\nstatic void unlinkupval (UpVal *uv) {\n  lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);\n  uv->u.l.next->u.l.prev = uv->u.l.prev;  /* remove from `uvhead' list */\n  uv->u.l.prev->u.l.next = uv->u.l.next;\n}\n\n\nvoid luaF_freeupval (lua_State *L, UpVal *uv) {\n  if (uv->v != &uv->u.value)  /* is it open? */\n    unlinkupval(uv);  /* remove from open list */\n  luaM_free(L, uv);  /* free upvalue */\n}\n\n\nvoid luaF_close (lua_State *L, StkId level) {\n  UpVal *uv;\n  global_State *g = G(L);\n  while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) {\n    GCObject *o = obj2gco(uv);\n    lua_assert(!isblack(o) && uv->v != &uv->u.value);\n    L->openupval = uv->next;  /* remove from `open' list */\n    if (isdead(g, o))\n      luaF_freeupval(L, uv);  /* free upvalue */\n    else {\n      unlinkupval(uv);\n      setobj(L, &uv->u.value, uv->v);\n      uv->v = &uv->u.value;  /* now current value lives here */\n      luaC_linkupval(L, uv);  /* link upvalue into `gcroot' list */\n    }\n  }\n}\n\n\nProto *luaF_newproto (lua_State *L) {\n  Proto *f = luaM_new(L, Proto);\n  luaC_link(L, obj2gco(f), LUA_TPROTO);\n  f->k = NULL;\n  f->sizek = 0;\n  f->p = NULL;\n  f->sizep = 0;\n  f->code = NULL;\n  f->sizecode = 0;\n  f->sizelineinfo = 0;\n  f->sizeupvalues = 0;\n  f->nups = 0;\n  f->upvalues = NULL;\n  f->numparams = 0;\n  f->is_vararg = 0;\n  f->maxstacksize = 0;\n  f->lineinfo = NULL;\n  f->sizelocvars = 0;\n  f->locvars = NULL;\n  f->linedefined = 0;\n  f->lastlinedefined = 0;\n  f->source = NULL;\n  return f;\n}\n\n\nvoid luaF_freeproto (lua_State *L, Proto *f) {\n  luaM_freearray(L, f->code, f->sizecode, Instruction);\n  luaM_freearray(L, f->p, f->sizep, Proto *);\n  luaM_freearray(L, f->k, f->sizek, TValue);\n  luaM_freearray(L, f->lineinfo, f->sizelineinfo, int);\n  luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar);\n  luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *);\n  luaM_free(L, f);\n}\n\n\nvoid luaF_freeclosure (lua_State *L, Closure *c) {\n  int size = (c->c.isC) ? sizeCclosure(c->c.nupvalues) :\n                          sizeLclosure(c->l.nupvalues);\n  luaM_freemem(L, c, size);\n}\n\n\n/*\n** Look for n-th local variable at line `line' in function `func'.\n** Returns NULL if not found.\n*/\nconst char *luaF_getlocalname (const Proto *f, int local_number, int pc) {\n  int i;\n  for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) {\n    if (pc < f->locvars[i].endpc) {  /* is variable active? */\n      local_number--;\n      if (local_number == 0)\n        return getstr(f->locvars[i].varname);\n    }\n  }\n  return NULL;  /* not found */\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lfunc.h",
    "content": "/*\n** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $\n** Auxiliary functions to manipulate prototypes and closures\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lfunc_h\n#define lfunc_h\n\n\n#include \"lobject.h\"\n\n\n#define sizeCclosure(n)\t(cast(int, sizeof(CClosure)) + \\\n                         cast(int, sizeof(TValue)*((n)-1)))\n\n#define sizeLclosure(n)\t(cast(int, sizeof(LClosure)) + \\\n                         cast(int, sizeof(TValue *)*((n)-1)))\n\n\nLUAI_FUNC Proto *luaF_newproto (lua_State *L);\nLUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e);\nLUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e);\nLUAI_FUNC UpVal *luaF_newupval (lua_State *L);\nLUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level);\nLUAI_FUNC void luaF_close (lua_State *L, StkId level);\nLUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f);\nLUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c);\nLUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv);\nLUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number,\n                                         int pc);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lgc.c",
    "content": "/*\n** $Id: lgc.c,v 2.38.1.2 2011/03/18 18:05:38 roberto Exp $\n** Garbage Collector\n** See Copyright Notice in lua.h\n*/\n\n#include <string.h>\n\n#define lgc_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"lgc.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"ltm.h\"\n\n\n#define GCSTEPSIZE\t1024u\n#define GCSWEEPMAX\t40\n#define GCSWEEPCOST\t10\n#define GCFINALIZECOST\t100\n\n\n#define maskmarks\tcast_byte(~(bitmask(BLACKBIT)|WHITEBITS))\n\n#define makewhite(g,x)\t\\\n   ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g)))\n\n#define white2gray(x)\treset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)\n#define black2gray(x)\tresetbit((x)->gch.marked, BLACKBIT)\n\n#define stringmark(s)\treset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT)\n\n\n#define isfinalized(u)\t\ttestbit((u)->marked, FINALIZEDBIT)\n#define markfinalized(u)\tl_setbit((u)->marked, FINALIZEDBIT)\n\n\n#define KEYWEAK         bitmask(KEYWEAKBIT)\n#define VALUEWEAK       bitmask(VALUEWEAKBIT)\n\n\n\n#define markvalue(g,o) { checkconsistency(o); \\\n  if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); }\n\n#define markobject(g,t) { if (iswhite(obj2gco(t))) \\\n\t\treallymarkobject(g, obj2gco(t)); }\n\n\n#define setthreshold(g)  (g->GCthreshold = (g->estimate/100) * g->gcpause)\n\n\nstatic void removeentry (Node *n) {\n  lua_assert(ttisnil(gval(n)));\n  if (iscollectable(gkey(n)))\n    setttype(gkey(n), LUA_TDEADKEY);  /* dead key; remove it */\n}\n\n\nstatic void reallymarkobject (global_State *g, GCObject *o) {\n  lua_assert(iswhite(o) && !isdead(g, o));\n  white2gray(o);\n  switch (o->gch.tt) {\n    case LUA_TSTRING: {\n      return;\n    }\n    case LUA_TUSERDATA: {\n      Table *mt = gco2u(o)->metatable;\n      gray2black(o);  /* udata are never gray */\n      if (mt) markobject(g, mt);\n      markobject(g, gco2u(o)->env);\n      return;\n    }\n    case LUA_TUPVAL: {\n      UpVal *uv = gco2uv(o);\n      markvalue(g, uv->v);\n      if (uv->v == &uv->u.value)  /* closed? */\n        gray2black(o);  /* open upvalues are never black */\n      return;\n    }\n    case LUA_TFUNCTION: {\n      gco2cl(o)->c.gclist = g->gray;\n      g->gray = o;\n      break;\n    }\n    case LUA_TTABLE: {\n      gco2h(o)->gclist = g->gray;\n      g->gray = o;\n      break;\n    }\n    case LUA_TTHREAD: {\n      gco2th(o)->gclist = g->gray;\n      g->gray = o;\n      break;\n    }\n    case LUA_TPROTO: {\n      gco2p(o)->gclist = g->gray;\n      g->gray = o;\n      break;\n    }\n    default: lua_assert(0);\n  }\n}\n\n\nstatic void marktmu (global_State *g) {\n  GCObject *u = g->tmudata;\n  if (u) {\n    do {\n      u = u->gch.next;\n      makewhite(g, u);  /* may be marked, if left from previous GC */\n      reallymarkobject(g, u);\n    } while (u != g->tmudata);\n  }\n}\n\n\n/* move `dead' udata that need finalization to list `tmudata' */\nsize_t luaC_separateudata (lua_State *L, int all) {\n  global_State *g = G(L);\n  size_t deadmem = 0;\n  GCObject **p = &g->mainthread->next;\n  GCObject *curr;\n  while ((curr = *p) != NULL) {\n    if (!(iswhite(curr) || all) || isfinalized(gco2u(curr)))\n      p = &curr->gch.next;  /* don't bother with them */\n    else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) {\n      markfinalized(gco2u(curr));  /* don't need finalization */\n      p = &curr->gch.next;\n    }\n    else {  /* must call its gc method */\n      deadmem += sizeudata(gco2u(curr));\n      markfinalized(gco2u(curr));\n      *p = curr->gch.next;\n      /* link `curr' at the end of `tmudata' list */\n      if (g->tmudata == NULL)  /* list is empty? */\n        g->tmudata = curr->gch.next = curr;  /* creates a circular list */\n      else {\n        curr->gch.next = g->tmudata->gch.next;\n        g->tmudata->gch.next = curr;\n        g->tmudata = curr;\n      }\n    }\n  }\n  return deadmem;\n}\n\n\nstatic int traversetable (global_State *g, Table *h) {\n  int i;\n  int weakkey = 0;\n  int weakvalue = 0;\n  const TValue *mode;\n  if (h->metatable)\n    markobject(g, h->metatable);\n  mode = gfasttm(g, h->metatable, TM_MODE);\n  if (mode && ttisstring(mode)) {  /* is there a weak mode? */\n    weakkey = (strchr(svalue(mode), 'k') != NULL);\n    weakvalue = (strchr(svalue(mode), 'v') != NULL);\n    if (weakkey || weakvalue) {  /* is really weak? */\n      h->marked &= ~(KEYWEAK | VALUEWEAK);  /* clear bits */\n      h->marked |= cast_byte((weakkey << KEYWEAKBIT) |\n                             (weakvalue << VALUEWEAKBIT));\n      h->gclist = g->weak;  /* must be cleared after GC, ... */\n      g->weak = obj2gco(h);  /* ... so put in the appropriate list */\n    }\n  }\n  if (weakkey && weakvalue) return 1;\n  if (!weakvalue) {\n    i = h->sizearray;\n    while (i--)\n      markvalue(g, &h->array[i]);\n  }\n  i = sizenode(h);\n  while (i--) {\n    Node *n = gnode(h, i);\n    lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n)));\n    if (ttisnil(gval(n)))\n      removeentry(n);  /* remove empty entries */\n    else {\n      lua_assert(!ttisnil(gkey(n)));\n      if (!weakkey) markvalue(g, gkey(n));\n      if (!weakvalue) markvalue(g, gval(n));\n    }\n  }\n  return weakkey || weakvalue;\n}\n\n\n/*\n** All marks are conditional because a GC may happen while the\n** prototype is still being created\n*/\nstatic void traverseproto (global_State *g, Proto *f) {\n  int i;\n  if (f->source) stringmark(f->source);\n  for (i=0; i<f->sizek; i++)  /* mark literals */\n    markvalue(g, &f->k[i]);\n  for (i=0; i<f->sizeupvalues; i++) {  /* mark upvalue names */\n    if (f->upvalues[i])\n      stringmark(f->upvalues[i]);\n  }\n  for (i=0; i<f->sizep; i++) {  /* mark nested protos */\n    if (f->p[i])\n      markobject(g, f->p[i]);\n  }\n  for (i=0; i<f->sizelocvars; i++) {  /* mark local-variable names */\n    if (f->locvars[i].varname)\n      stringmark(f->locvars[i].varname);\n  }\n}\n\n\n\nstatic void traverseclosure (global_State *g, Closure *cl) {\n  markobject(g, cl->c.env);\n  if (cl->c.isC) {\n    int i;\n    for (i=0; i<cl->c.nupvalues; i++)  /* mark its upvalues */\n      markvalue(g, &cl->c.upvalue[i]);\n  }\n  else {\n    int i;\n    lua_assert(cl->l.nupvalues == cl->l.p->nups);\n    markobject(g, cl->l.p);\n    for (i=0; i<cl->l.nupvalues; i++)  /* mark its upvalues */\n      markobject(g, cl->l.upvals[i]);\n  }\n}\n\n\nstatic void checkstacksizes (lua_State *L, StkId max) {\n  int ci_used = cast_int(L->ci - L->base_ci);  /* number of `ci' in use */\n  int s_used = cast_int(max - L->stack);  /* part of stack in use */\n  if (L->size_ci > LUAI_MAXCALLS)  /* handling overflow? */\n    return;  /* do not touch the stacks */\n  if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci)\n    luaD_reallocCI(L, L->size_ci/2);  /* still big enough... */\n  condhardstacktests(luaD_reallocCI(L, ci_used + 1));\n  if (4*s_used < L->stacksize &&\n      2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize)\n    luaD_reallocstack(L, L->stacksize/2);  /* still big enough... */\n  condhardstacktests(luaD_reallocstack(L, s_used));\n}\n\n\nstatic void traversestack (global_State *g, lua_State *l) {\n  StkId o, lim;\n  CallInfo *ci;\n  markvalue(g, gt(l));\n  lim = l->top;\n  for (ci = l->base_ci; ci <= l->ci; ci++) {\n    lua_assert(ci->top <= l->stack_last);\n    if (lim < ci->top) lim = ci->top;\n  }\n  for (o = l->stack; o < l->top; o++)\n    markvalue(g, o);\n  for (; o <= lim; o++)\n    setnilvalue(o);\n  checkstacksizes(l, lim);\n}\n\n\n/*\n** traverse one gray object, turning it to black.\n** Returns `quantity' traversed.\n*/\nstatic l_mem propagatemark (global_State *g) {\n  GCObject *o = g->gray;\n  lua_assert(isgray(o));\n  gray2black(o);\n  switch (o->gch.tt) {\n    case LUA_TTABLE: {\n      Table *h = gco2h(o);\n      g->gray = h->gclist;\n      if (traversetable(g, h))  /* table is weak? */\n        black2gray(o);  /* keep it gray */\n      return sizeof(Table) + sizeof(TValue) * h->sizearray +\n                             sizeof(Node) * sizenode(h);\n    }\n    case LUA_TFUNCTION: {\n      Closure *cl = gco2cl(o);\n      g->gray = cl->c.gclist;\n      traverseclosure(g, cl);\n      return (cl->c.isC) ? sizeCclosure(cl->c.nupvalues) :\n                           sizeLclosure(cl->l.nupvalues);\n    }\n    case LUA_TTHREAD: {\n      lua_State *th = gco2th(o);\n      g->gray = th->gclist;\n      th->gclist = g->grayagain;\n      g->grayagain = o;\n      black2gray(o);\n      traversestack(g, th);\n      return sizeof(lua_State) + sizeof(TValue) * th->stacksize +\n                                 sizeof(CallInfo) * th->size_ci;\n    }\n    case LUA_TPROTO: {\n      Proto *p = gco2p(o);\n      g->gray = p->gclist;\n      traverseproto(g, p);\n      return sizeof(Proto) + sizeof(Instruction) * p->sizecode +\n                             sizeof(Proto *) * p->sizep +\n                             sizeof(TValue) * p->sizek + \n                             sizeof(int) * p->sizelineinfo +\n                             sizeof(LocVar) * p->sizelocvars +\n                             sizeof(TString *) * p->sizeupvalues;\n    }\n    default: lua_assert(0); return 0;\n  }\n}\n\n\nstatic size_t propagateall (global_State *g) {\n  size_t m = 0;\n  while (g->gray) m += propagatemark(g);\n  return m;\n}\n\n\n/*\n** The next function tells whether a key or value can be cleared from\n** a weak table. Non-collectable objects are never removed from weak\n** tables. Strings behave as `values', so are never removed too. for\n** other objects: if really collected, cannot keep them; for userdata\n** being finalized, keep them in keys, but not in values\n*/\nstatic int iscleared (const TValue *o, int iskey) {\n  if (!iscollectable(o)) return 0;\n  if (ttisstring(o)) {\n    stringmark(rawtsvalue(o));  /* strings are `values', so are never weak */\n    return 0;\n  }\n  return iswhite(gcvalue(o)) ||\n    (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o))));\n}\n\n\n/*\n** clear collected entries from weaktables\n*/\nstatic void cleartable (GCObject *l) {\n  while (l) {\n    Table *h = gco2h(l);\n    int i = h->sizearray;\n    lua_assert(testbit(h->marked, VALUEWEAKBIT) ||\n               testbit(h->marked, KEYWEAKBIT));\n    if (testbit(h->marked, VALUEWEAKBIT)) {\n      while (i--) {\n        TValue *o = &h->array[i];\n        if (iscleared(o, 0))  /* value was collected? */\n          setnilvalue(o);  /* remove value */\n      }\n    }\n    i = sizenode(h);\n    while (i--) {\n      Node *n = gnode(h, i);\n      if (!ttisnil(gval(n)) &&  /* non-empty entry? */\n          (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) {\n        setnilvalue(gval(n));  /* remove value ... */\n        removeentry(n);  /* remove entry from table */\n      }\n    }\n    l = h->gclist;\n  }\n}\n\n\nstatic void freeobj (lua_State *L, GCObject *o) {\n  switch (o->gch.tt) {\n    case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break;\n    case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break;\n    case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break;\n    case LUA_TTABLE: luaH_free(L, gco2h(o)); break;\n    case LUA_TTHREAD: {\n      lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread);\n      luaE_freethread(L, gco2th(o));\n      break;\n    }\n    case LUA_TSTRING: {\n      G(L)->strt.nuse--;\n      luaM_freemem(L, o, sizestring(gco2ts(o)));\n      break;\n    }\n    case LUA_TUSERDATA: {\n      luaM_freemem(L, o, sizeudata(gco2u(o)));\n      break;\n    }\n    default: lua_assert(0);\n  }\n}\n\n\n\n#define sweepwholelist(L,p)\tsweeplist(L,p,MAX_LUMEM)\n\n\nstatic GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {\n  GCObject *curr;\n  global_State *g = G(L);\n  int deadmask = otherwhite(g);\n  while ((curr = *p) != NULL && count-- > 0) {\n    if (curr->gch.tt == LUA_TTHREAD)  /* sweep open upvalues of each thread */\n      sweepwholelist(L, &gco2th(curr)->openupval);\n    if ((curr->gch.marked ^ WHITEBITS) & deadmask) {  /* not dead? */\n      lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT));\n      makewhite(g, curr);  /* make it white (for next cycle) */\n      p = &curr->gch.next;\n    }\n    else {  /* must erase `curr' */\n      lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT));\n      *p = curr->gch.next;\n      if (curr == g->rootgc)  /* is the first element of the list? */\n        g->rootgc = curr->gch.next;  /* adjust first */\n      freeobj(L, curr);\n    }\n  }\n  return p;\n}\n\n\nstatic void checkSizes (lua_State *L) {\n  global_State *g = G(L);\n  /* check size of string hash */\n  if (g->strt.nuse < cast(lu_int32, g->strt.size/4) &&\n      g->strt.size > MINSTRTABSIZE*2)\n    luaS_resize(L, g->strt.size/2);  /* table is too big */\n  /* check size of buffer */\n  if (luaZ_sizebuffer(&g->buff) > LUA_MINBUFFER*2) {  /* buffer too big? */\n    size_t newsize = luaZ_sizebuffer(&g->buff) / 2;\n    luaZ_resizebuffer(L, &g->buff, newsize);\n  }\n}\n\n\nstatic void GCTM (lua_State *L) {\n  global_State *g = G(L);\n  GCObject *o = g->tmudata->gch.next;  /* get first element */\n  Udata *udata = rawgco2u(o);\n  const TValue *tm;\n  /* remove udata from `tmudata' */\n  if (o == g->tmudata)  /* last element? */\n    g->tmudata = NULL;\n  else\n    g->tmudata->gch.next = udata->uv.next;\n  udata->uv.next = g->mainthread->next;  /* return it to `root' list */\n  g->mainthread->next = o;\n  makewhite(g, o);\n  tm = fasttm(L, udata->uv.metatable, TM_GC);\n  if (tm != NULL) {\n    lu_byte oldah = L->allowhook;\n    lu_mem oldt = g->GCthreshold;\n    L->allowhook = 0;  /* stop debug hooks during GC tag method */\n    g->GCthreshold = 2*g->totalbytes;  /* avoid GC steps */\n    setobj2s(L, L->top, tm);\n    setuvalue(L, L->top+1, udata);\n    L->top += 2;\n    luaD_call(L, L->top - 2, 0);\n    L->allowhook = oldah;  /* restore hooks */\n    g->GCthreshold = oldt;  /* restore threshold */\n  }\n}\n\n\n/*\n** Call all GC tag methods\n*/\nvoid luaC_callGCTM (lua_State *L) {\n  while (G(L)->tmudata)\n    GCTM(L);\n}\n\n\nvoid luaC_freeall (lua_State *L) {\n  global_State *g = G(L);\n  int i;\n  g->currentwhite = WHITEBITS | bitmask(SFIXEDBIT);  /* mask to collect all elements */\n  sweepwholelist(L, &g->rootgc);\n  for (i = 0; i < g->strt.size; i++)  /* free all string lists */\n    sweepwholelist(L, &g->strt.hash[i]);\n}\n\n\nstatic void markmt (global_State *g) {\n  int i;\n  for (i=0; i<NUM_TAGS; i++)\n    if (g->mt[i]) markobject(g, g->mt[i]);\n}\n\n\n/* mark root set */\nstatic void markroot (lua_State *L) {\n  global_State *g = G(L);\n  g->gray = NULL;\n  g->grayagain = NULL;\n  g->weak = NULL;\n  markobject(g, g->mainthread);\n  /* make global table be traversed before main stack */\n  markvalue(g, gt(g->mainthread));\n  markvalue(g, registry(L));\n  markmt(g);\n  g->gcstate = GCSpropagate;\n}\n\n\nstatic void remarkupvals (global_State *g) {\n  UpVal *uv;\n  for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) {\n    lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv);\n    if (isgray(obj2gco(uv)))\n      markvalue(g, uv->v);\n  }\n}\n\n\nstatic void atomic (lua_State *L) {\n  global_State *g = G(L);\n  size_t udsize;  /* total size of userdata to be finalized */\n  /* remark occasional upvalues of (maybe) dead threads */\n  remarkupvals(g);\n  /* traverse objects cautch by write barrier and by 'remarkupvals' */\n  propagateall(g);\n  /* remark weak tables */\n  g->gray = g->weak;\n  g->weak = NULL;\n  lua_assert(!iswhite(obj2gco(g->mainthread)));\n  markobject(g, L);  /* mark running thread */\n  markmt(g);  /* mark basic metatables (again) */\n  propagateall(g);\n  /* remark gray again */\n  g->gray = g->grayagain;\n  g->grayagain = NULL;\n  propagateall(g);\n  udsize = luaC_separateudata(L, 0);  /* separate userdata to be finalized */\n  marktmu(g);  /* mark `preserved' userdata */\n  udsize += propagateall(g);  /* remark, to propagate `preserveness' */\n  cleartable(g->weak);  /* remove collected objects from weak tables */\n  /* flip current white */\n  g->currentwhite = cast_byte(otherwhite(g));\n  g->sweepstrgc = 0;\n  g->sweepgc = &g->rootgc;\n  g->gcstate = GCSsweepstring;\n  g->estimate = g->totalbytes - udsize;  /* first estimate */\n}\n\n\nstatic l_mem singlestep (lua_State *L) {\n  global_State *g = G(L);\n  /*lua_checkmemory(L);*/\n  switch (g->gcstate) {\n    case GCSpause: {\n      markroot(L);  /* start a new collection */\n      return 0;\n    }\n    case GCSpropagate: {\n      if (g->gray)\n        return propagatemark(g);\n      else {  /* no more `gray' objects */\n        atomic(L);  /* finish mark phase */\n        return 0;\n      }\n    }\n    case GCSsweepstring: {\n      lu_mem old = g->totalbytes;\n      sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]);\n      if (g->sweepstrgc >= g->strt.size)  /* nothing more to sweep? */\n        g->gcstate = GCSsweep;  /* end sweep-string phase */\n      lua_assert(old >= g->totalbytes);\n      g->estimate -= old - g->totalbytes;\n      return GCSWEEPCOST;\n    }\n    case GCSsweep: {\n      lu_mem old = g->totalbytes;\n      g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX);\n      if (*g->sweepgc == NULL) {  /* nothing more to sweep? */\n        checkSizes(L);\n        g->gcstate = GCSfinalize;  /* end sweep phase */\n      }\n      lua_assert(old >= g->totalbytes);\n      g->estimate -= old - g->totalbytes;\n      return GCSWEEPMAX*GCSWEEPCOST;\n    }\n    case GCSfinalize: {\n      if (g->tmudata) {\n        GCTM(L);\n        if (g->estimate > GCFINALIZECOST)\n          g->estimate -= GCFINALIZECOST;\n        return GCFINALIZECOST;\n      }\n      else {\n        g->gcstate = GCSpause;  /* end collection */\n        g->gcdept = 0;\n        return 0;\n      }\n    }\n    default: lua_assert(0); return 0;\n  }\n}\n\n\nvoid luaC_step (lua_State *L) {\n  global_State *g = G(L);\n  l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul;\n  if (lim == 0)\n    lim = (MAX_LUMEM-1)/2;  /* no limit */\n  g->gcdept += g->totalbytes - g->GCthreshold;\n  do {\n    lim -= singlestep(L);\n    if (g->gcstate == GCSpause)\n      break;\n  } while (lim > 0);\n  if (g->gcstate != GCSpause) {\n    if (g->gcdept < GCSTEPSIZE)\n      g->GCthreshold = g->totalbytes + GCSTEPSIZE;  /* - lim/g->gcstepmul;*/\n    else {\n      g->gcdept -= GCSTEPSIZE;\n      g->GCthreshold = g->totalbytes;\n    }\n  }\n  else {\n    setthreshold(g);\n  }\n}\n\n\nvoid luaC_fullgc (lua_State *L) {\n  global_State *g = G(L);\n  if (g->gcstate <= GCSpropagate) {\n    /* reset sweep marks to sweep all elements (returning them to white) */\n    g->sweepstrgc = 0;\n    g->sweepgc = &g->rootgc;\n    /* reset other collector lists */\n    g->gray = NULL;\n    g->grayagain = NULL;\n    g->weak = NULL;\n    g->gcstate = GCSsweepstring;\n  }\n  lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate);\n  /* finish any pending sweep phase */\n  while (g->gcstate != GCSfinalize) {\n    lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep);\n    singlestep(L);\n  }\n  markroot(L);\n  while (g->gcstate != GCSpause) {\n    singlestep(L);\n  }\n  setthreshold(g);\n}\n\n\nvoid luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) {\n  global_State *g = G(L);\n  lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o));\n  lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);\n  lua_assert(ttype(&o->gch) != LUA_TTABLE);\n  /* must keep invariant? */\n  if (g->gcstate == GCSpropagate)\n    reallymarkobject(g, v);  /* restore invariant */\n  else  /* don't mind */\n    makewhite(g, o);  /* mark as white just to avoid other barriers */\n}\n\n\nvoid luaC_barrierback (lua_State *L, Table *t) {\n  global_State *g = G(L);\n  GCObject *o = obj2gco(t);\n  lua_assert(isblack(o) && !isdead(g, o));\n  lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);\n  black2gray(o);  /* make table gray (again) */\n  t->gclist = g->grayagain;\n  g->grayagain = o;\n}\n\n\nvoid luaC_link (lua_State *L, GCObject *o, lu_byte tt) {\n  global_State *g = G(L);\n  o->gch.next = g->rootgc;\n  g->rootgc = o;\n  o->gch.marked = luaC_white(g);\n  o->gch.tt = tt;\n}\n\n\nvoid luaC_linkupval (lua_State *L, UpVal *uv) {\n  global_State *g = G(L);\n  GCObject *o = obj2gco(uv);\n  o->gch.next = g->rootgc;  /* link upvalue into `rootgc' list */\n  g->rootgc = o;\n  if (isgray(o)) { \n    if (g->gcstate == GCSpropagate) {\n      gray2black(o);  /* closed upvalues need barrier */\n      luaC_barrier(L, uv, uv->v);\n    }\n    else {  /* sweep phase: sweep it (turning it into white) */\n      makewhite(g, o);\n      lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);\n    }\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lgc.h",
    "content": "/*\n** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $\n** Garbage Collector\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lgc_h\n#define lgc_h\n\n\n#include \"lobject.h\"\n\n\n/*\n** Possible states of the Garbage Collector\n*/\n#define GCSpause\t0\n#define GCSpropagate\t1\n#define GCSsweepstring\t2\n#define GCSsweep\t3\n#define GCSfinalize\t4\n\n\n/*\n** some userful bit tricks\n*/\n#define resetbits(x,m)\t((x) &= cast(lu_byte, ~(m)))\n#define setbits(x,m)\t((x) |= (m))\n#define testbits(x,m)\t((x) & (m))\n#define bitmask(b)\t(1<<(b))\n#define bit2mask(b1,b2)\t(bitmask(b1) | bitmask(b2))\n#define l_setbit(x,b)\tsetbits(x, bitmask(b))\n#define resetbit(x,b)\tresetbits(x, bitmask(b))\n#define testbit(x,b)\ttestbits(x, bitmask(b))\n#define set2bits(x,b1,b2)\tsetbits(x, (bit2mask(b1, b2)))\n#define reset2bits(x,b1,b2)\tresetbits(x, (bit2mask(b1, b2)))\n#define test2bits(x,b1,b2)\ttestbits(x, (bit2mask(b1, b2)))\n\n\n\n/*\n** Layout for bit use in `marked' field:\n** bit 0 - object is white (type 0)\n** bit 1 - object is white (type 1)\n** bit 2 - object is black\n** bit 3 - for userdata: has been finalized\n** bit 3 - for tables: has weak keys\n** bit 4 - for tables: has weak values\n** bit 5 - object is fixed (should not be collected)\n** bit 6 - object is \"super\" fixed (only the main thread)\n*/\n\n\n#define WHITE0BIT\t0\n#define WHITE1BIT\t1\n#define BLACKBIT\t2\n#define FINALIZEDBIT\t3\n#define KEYWEAKBIT\t3\n#define VALUEWEAKBIT\t4\n#define FIXEDBIT\t5\n#define SFIXEDBIT\t6\n#define WHITEBITS\tbit2mask(WHITE0BIT, WHITE1BIT)\n\n\n#define iswhite(x)      test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)\n#define isblack(x)      testbit((x)->gch.marked, BLACKBIT)\n#define isgray(x)\t(!isblack(x) && !iswhite(x))\n\n#define otherwhite(g)\t(g->currentwhite ^ WHITEBITS)\n#define isdead(g,v)\t((v)->gch.marked & otherwhite(g) & WHITEBITS)\n\n#define changewhite(x)\t((x)->gch.marked ^= WHITEBITS)\n#define gray2black(x)\tl_setbit((x)->gch.marked, BLACKBIT)\n\n#define valiswhite(x)\t(iscollectable(x) && iswhite(gcvalue(x)))\n\n#define luaC_white(g)\tcast(lu_byte, (g)->currentwhite & WHITEBITS)\n\n\n#define luaC_checkGC(L) { \\\n  condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \\\n  if (G(L)->totalbytes >= G(L)->GCthreshold) \\\n\tluaC_step(L); }\n\n\n#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p)))  \\\n\tluaC_barrierf(L,obj2gco(p),gcvalue(v)); }\n\n#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t)))  \\\n\tluaC_barrierback(L,t); }\n\n#define luaC_objbarrier(L,p,o)  \\\n\t{ if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \\\n\t\tluaC_barrierf(L,obj2gco(p),obj2gco(o)); }\n\n#define luaC_objbarriert(L,t,o)  \\\n   { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); }\n\nLUAI_FUNC size_t luaC_separateudata (lua_State *L, int all);\nLUAI_FUNC void luaC_callGCTM (lua_State *L);\nLUAI_FUNC void luaC_freeall (lua_State *L);\nLUAI_FUNC void luaC_step (lua_State *L);\nLUAI_FUNC void luaC_fullgc (lua_State *L);\nLUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt);\nLUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv);\nLUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);\nLUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/linit.c",
    "content": "/*\n** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $\n** Initialization of libraries for lua.c\n** See Copyright Notice in lua.h\n*/\n\n\n#define linit_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lualib.h\"\n#include \"lauxlib.h\"\n\n\nstatic const luaL_Reg lualibs[] = {\n  {\"\", luaopen_base},\n  {LUA_LOADLIBNAME, luaopen_package},\n  {LUA_TABLIBNAME, luaopen_table},\n  {LUA_IOLIBNAME, luaopen_io},\n  {LUA_OSLIBNAME, luaopen_os},\n  {LUA_STRLIBNAME, luaopen_string},\n  {LUA_MATHLIBNAME, luaopen_math},\n  {LUA_DBLIBNAME, luaopen_debug},\n  {NULL, NULL}\n};\n\n\nLUALIB_API void luaL_openlibs (lua_State *L) {\n  const luaL_Reg *lib = lualibs;\n  for (; lib->func; lib++) {\n    lua_pushcfunction(L, lib->func);\n    lua_pushstring(L, lib->name);\n    lua_call(L, 1, 0);\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/liolib.c",
    "content": "/*\n** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $\n** Standard I/O (and system) library\n** See Copyright Notice in lua.h\n*/\n\n\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define liolib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n\n#define IO_INPUT\t1\n#define IO_OUTPUT\t2\n\n\nstatic const char *const fnames[] = {\"input\", \"output\"};\n\n\nstatic int pushresult (lua_State *L, int i, const char *filename) {\n  int en = errno;  /* calls to Lua API may change this value */\n  if (i) {\n    lua_pushboolean(L, 1);\n    return 1;\n  }\n  else {\n    lua_pushnil(L);\n    if (filename)\n      lua_pushfstring(L, \"%s: %s\", filename, strerror(en));\n    else\n      lua_pushfstring(L, \"%s\", strerror(en));\n    lua_pushinteger(L, en);\n    return 3;\n  }\n}\n\n\nstatic void fileerror (lua_State *L, int arg, const char *filename) {\n  lua_pushfstring(L, \"%s: %s\", filename, strerror(errno));\n  luaL_argerror(L, arg, lua_tostring(L, -1));\n}\n\n\n#define tofilep(L)\t((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE))\n\n\nstatic int io_type (lua_State *L) {\n  void *ud;\n  luaL_checkany(L, 1);\n  ud = lua_touserdata(L, 1);\n  lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE);\n  if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1))\n    lua_pushnil(L);  /* not a file */\n  else if (*((FILE **)ud) == NULL)\n    lua_pushliteral(L, \"closed file\");\n  else\n    lua_pushliteral(L, \"file\");\n  return 1;\n}\n\n\nstatic FILE *tofile (lua_State *L) {\n  FILE **f = tofilep(L);\n  if (*f == NULL)\n    luaL_error(L, \"attempt to use a closed file\");\n  return *f;\n}\n\n\n\n/*\n** When creating file handles, always creates a `closed' file handle\n** before opening the actual file; so, if there is a memory error, the\n** file is not left opened.\n*/\nstatic FILE **newfile (lua_State *L) {\n  FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *));\n  *pf = NULL;  /* file handle is currently `closed' */\n  luaL_getmetatable(L, LUA_FILEHANDLE);\n  lua_setmetatable(L, -2);\n  return pf;\n}\n\n\n/*\n** function to (not) close the standard files stdin, stdout, and stderr\n*/\nstatic int io_noclose (lua_State *L) {\n  lua_pushnil(L);\n  lua_pushliteral(L, \"cannot close standard file\");\n  return 2;\n}\n\n\n/*\n** function to close 'popen' files\n*/\nstatic int io_pclose (lua_State *L) {\n  FILE **p = tofilep(L);\n  int ok = lua_pclose(L, *p);\n  *p = NULL;\n  return pushresult(L, ok, NULL);\n}\n\n\n/*\n** function to close regular files\n*/\nstatic int io_fclose (lua_State *L) {\n  FILE **p = tofilep(L);\n  int ok = (fclose(*p) == 0);\n  *p = NULL;\n  return pushresult(L, ok, NULL);\n}\n\n\nstatic int aux_close (lua_State *L) {\n  lua_getfenv(L, 1);\n  lua_getfield(L, -1, \"__close\");\n  return (lua_tocfunction(L, -1))(L);\n}\n\n\nstatic int io_close (lua_State *L) {\n  if (lua_isnone(L, 1))\n    lua_rawgeti(L, LUA_ENVIRONINDEX, IO_OUTPUT);\n  tofile(L);  /* make sure argument is a file */\n  return aux_close(L);\n}\n\n\nstatic int io_gc (lua_State *L) {\n  FILE *f = *tofilep(L);\n  /* ignore closed files */\n  if (f != NULL)\n    aux_close(L);\n  return 0;\n}\n\n\nstatic int io_tostring (lua_State *L) {\n  FILE *f = *tofilep(L);\n  if (f == NULL)\n    lua_pushliteral(L, \"file (closed)\");\n  else\n    lua_pushfstring(L, \"file (%p)\", f);\n  return 1;\n}\n\n\nstatic int io_open (lua_State *L) {\n  const char *filename = luaL_checkstring(L, 1);\n  const char *mode = luaL_optstring(L, 2, \"r\");\n  FILE **pf = newfile(L);\n  *pf = fopen(filename, mode);\n  return (*pf == NULL) ? pushresult(L, 0, filename) : 1;\n}\n\n\n/*\n** this function has a separated environment, which defines the\n** correct __close for 'popen' files\n*/\nstatic int io_popen (lua_State *L) {\n  const char *filename = luaL_checkstring(L, 1);\n  const char *mode = luaL_optstring(L, 2, \"r\");\n  FILE **pf = newfile(L);\n  *pf = lua_popen(L, filename, mode);\n  return (*pf == NULL) ? pushresult(L, 0, filename) : 1;\n}\n\n\n#ifndef __native_client__\nstatic int io_tmpfile (lua_State *L) {\n  FILE **pf = newfile(L);\n  *pf = tmpfile();\n  return (*pf == NULL) ? pushresult(L, 0, NULL) : 1;\n}\n#endif\n\n\nstatic FILE *getiofile (lua_State *L, int findex) {\n  FILE *f;\n  lua_rawgeti(L, LUA_ENVIRONINDEX, findex);\n  f = *(FILE **)lua_touserdata(L, -1);\n  if (f == NULL)\n    luaL_error(L, \"standard %s file is closed\", fnames[findex - 1]);\n  return f;\n}\n\n\nstatic int g_iofile (lua_State *L, int f, const char *mode) {\n  if (!lua_isnoneornil(L, 1)) {\n    const char *filename = lua_tostring(L, 1);\n    if (filename) {\n      FILE **pf = newfile(L);\n      *pf = fopen(filename, mode);\n      if (*pf == NULL)\n        fileerror(L, 1, filename);\n    }\n    else {\n      tofile(L);  /* check that it's a valid file handle */\n      lua_pushvalue(L, 1);\n    }\n    lua_rawseti(L, LUA_ENVIRONINDEX, f);\n  }\n  /* return current value */\n  lua_rawgeti(L, LUA_ENVIRONINDEX, f);\n  return 1;\n}\n\n\nstatic int io_input (lua_State *L) {\n  return g_iofile(L, IO_INPUT, \"r\");\n}\n\n\nstatic int io_output (lua_State *L) {\n  return g_iofile(L, IO_OUTPUT, \"w\");\n}\n\n\nstatic int io_readline (lua_State *L);\n\n\nstatic void aux_lines (lua_State *L, int idx, int toclose) {\n  lua_pushvalue(L, idx);\n  lua_pushboolean(L, toclose);  /* close/not close file when finished */\n  lua_pushcclosure(L, io_readline, 2);\n}\n\n\nstatic int f_lines (lua_State *L) {\n  tofile(L);  /* check that it's a valid file handle */\n  aux_lines(L, 1, 0);\n  return 1;\n}\n\n\nstatic int io_lines (lua_State *L) {\n  if (lua_isnoneornil(L, 1)) {  /* no arguments? */\n    /* will iterate over default input */\n    lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT);\n    return f_lines(L);\n  }\n  else {\n    const char *filename = luaL_checkstring(L, 1);\n    FILE **pf = newfile(L);\n    *pf = fopen(filename, \"r\");\n    if (*pf == NULL)\n      fileerror(L, 1, filename);\n    aux_lines(L, lua_gettop(L), 1);\n    return 1;\n  }\n}\n\n\n/*\n** {======================================================\n** READ\n** =======================================================\n*/\n\n\nstatic int read_number (lua_State *L, FILE *f) {\n  lua_Number d;\n  if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {\n    lua_pushnumber(L, d);\n    return 1;\n  }\n  else {\n    lua_pushnil(L);  /* \"result\" to be removed */\n    return 0;  /* read fails */\n  }\n}\n\n\nstatic int test_eof (lua_State *L, FILE *f) {\n  int c = getc(f);\n  ungetc(c, f);\n  lua_pushlstring(L, NULL, 0);\n  return (c != EOF);\n}\n\n\nstatic int read_line (lua_State *L, FILE *f) {\n  luaL_Buffer b;\n  luaL_buffinit(L, &b);\n  for (;;) {\n    size_t l;\n    char *p = luaL_prepbuffer(&b);\n    if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) {  /* eof? */\n      luaL_pushresult(&b);  /* close buffer */\n      return (lua_objlen(L, -1) > 0);  /* check whether read something */\n    }\n    l = strlen(p);\n    if (l == 0 || p[l-1] != '\\n')\n      luaL_addsize(&b, l);\n    else {\n      luaL_addsize(&b, l - 1);  /* do not include `eol' */\n      luaL_pushresult(&b);  /* close buffer */\n      return 1;  /* read at least an `eol' */\n    }\n  }\n}\n\n\nstatic int read_chars (lua_State *L, FILE *f, size_t n) {\n  size_t rlen;  /* how much to read */\n  size_t nr;  /* number of chars actually read */\n  luaL_Buffer b;\n  luaL_buffinit(L, &b);\n  rlen = LUAL_BUFFERSIZE;  /* try to read that much each time */\n  do {\n    char *p = luaL_prepbuffer(&b);\n    if (rlen > n) rlen = n;  /* cannot read more than asked */\n    nr = fread(p, sizeof(char), rlen, f);\n    luaL_addsize(&b, nr);\n    n -= nr;  /* still have to read `n' chars */\n  } while (n > 0 && nr == rlen);  /* until end of count or eof */\n  luaL_pushresult(&b);  /* close buffer */\n  return (n == 0 || lua_objlen(L, -1) > 0);\n}\n\n\nstatic int g_read (lua_State *L, FILE *f, int first) {\n  int nargs = lua_gettop(L) - 1;\n  int success;\n  int n;\n  clearerr(f);\n  if (nargs == 0) {  /* no arguments? */\n    success = read_line(L, f);\n    n = first+1;  /* to return 1 result */\n  }\n  else {  /* ensure stack space for all results and for auxlib's buffer */\n    luaL_checkstack(L, nargs+LUA_MINSTACK, \"too many arguments\");\n    success = 1;\n    for (n = first; nargs-- && success; n++) {\n      if (lua_type(L, n) == LUA_TNUMBER) {\n        size_t l = (size_t)lua_tointeger(L, n);\n        success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l);\n      }\n      else {\n        const char *p = lua_tostring(L, n);\n        luaL_argcheck(L, p && p[0] == '*', n, \"invalid option\");\n        switch (p[1]) {\n          case 'n':  /* number */\n            success = read_number(L, f);\n            break;\n          case 'l':  /* line */\n            success = read_line(L, f);\n            break;\n          case 'a':  /* file */\n            read_chars(L, f, ~((size_t)0));  /* read MAX_SIZE_T chars */\n            success = 1; /* always success */\n            break;\n          default:\n            return luaL_argerror(L, n, \"invalid format\");\n        }\n      }\n    }\n  }\n  if (ferror(f))\n    return pushresult(L, 0, NULL);\n  if (!success) {\n    lua_pop(L, 1);  /* remove last result */\n    lua_pushnil(L);  /* push nil instead */\n  }\n  return n - first;\n}\n\n\nstatic int io_read (lua_State *L) {\n  return g_read(L, getiofile(L, IO_INPUT), 1);\n}\n\n\nstatic int f_read (lua_State *L) {\n  return g_read(L, tofile(L), 2);\n}\n\n\nstatic int io_readline (lua_State *L) {\n  FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1));\n  int sucess;\n  if (f == NULL)  /* file is already closed? */\n    luaL_error(L, \"file is already closed\");\n  sucess = read_line(L, f);\n  if (ferror(f))\n    return luaL_error(L, \"%s\", strerror(errno));\n  if (sucess) return 1;\n  else {  /* EOF */\n    if (lua_toboolean(L, lua_upvalueindex(2))) {  /* generator created file? */\n      lua_settop(L, 0);\n      lua_pushvalue(L, lua_upvalueindex(1));\n      aux_close(L);  /* close it */\n    }\n    return 0;\n  }\n}\n\n/* }====================================================== */\n\n\nstatic int g_write (lua_State *L, FILE *f, int arg) {\n  int nargs = lua_gettop(L) - 1;\n  int status = 1;\n  for (; nargs--; arg++) {\n    if (lua_type(L, arg) == LUA_TNUMBER) {\n      /* optimization: could be done exactly as for strings */\n      status = status &&\n          fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0;\n    }\n    else {\n      size_t l;\n      const char *s = luaL_checklstring(L, arg, &l);\n      status = status && (fwrite(s, sizeof(char), l, f) == l);\n    }\n  }\n  return pushresult(L, status, NULL);\n}\n\n\nstatic int io_write (lua_State *L) {\n  return g_write(L, getiofile(L, IO_OUTPUT), 1);\n}\n\n\nstatic int f_write (lua_State *L) {\n  return g_write(L, tofile(L), 2);\n}\n\n\nstatic int f_seek (lua_State *L) {\n  static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END};\n  static const char *const modenames[] = {\"set\", \"cur\", \"end\", NULL};\n  FILE *f = tofile(L);\n  int op = luaL_checkoption(L, 2, \"cur\", modenames);\n  long offset = luaL_optlong(L, 3, 0);\n  op = fseek(f, offset, mode[op]);\n  if (op)\n    return pushresult(L, 0, NULL);  /* error */\n  else {\n    lua_pushinteger(L, ftell(f));\n    return 1;\n  }\n}\n\n\nstatic int f_setvbuf (lua_State *L) {\n  static const int mode[] = {_IONBF, _IOFBF, _IOLBF};\n  static const char *const modenames[] = {\"no\", \"full\", \"line\", NULL};\n  FILE *f = tofile(L);\n  int op = luaL_checkoption(L, 2, NULL, modenames);\n  lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE);\n  int res = setvbuf(f, NULL, mode[op], sz);\n  return pushresult(L, res == 0, NULL);\n}\n\n\n\nstatic int io_flush (lua_State *L) {\n  return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL);\n}\n\n\nstatic int f_flush (lua_State *L) {\n  return pushresult(L, fflush(tofile(L)) == 0, NULL);\n}\n\n\nstatic const luaL_Reg iolib[] = {\n  {\"close\", io_close},\n  {\"flush\", io_flush},\n  {\"input\", io_input},\n  {\"lines\", io_lines},\n  {\"open\", io_open},\n  {\"output\", io_output},\n  {\"popen\", io_popen},\n  {\"read\", io_read},\n#ifndef __native_client__\n  {\"tmpfile\", io_tmpfile},\n#endif\n  {\"type\", io_type},\n  {\"write\", io_write},\n  {NULL, NULL}\n};\n\n\nstatic const luaL_Reg flib[] = {\n  {\"close\", io_close},\n  {\"flush\", f_flush},\n  {\"lines\", f_lines},\n  {\"read\", f_read},\n  {\"seek\", f_seek},\n  {\"setvbuf\", f_setvbuf},\n  {\"write\", f_write},\n  {\"__gc\", io_gc},\n  {\"__tostring\", io_tostring},\n  {NULL, NULL}\n};\n\n\nstatic void createmeta (lua_State *L) {\n  luaL_newmetatable(L, LUA_FILEHANDLE);  /* create metatable for file handles */\n  lua_pushvalue(L, -1);  /* push metatable */\n  lua_setfield(L, -2, \"__index\");  /* metatable.__index = metatable */\n  luaL_register(L, NULL, flib);  /* file methods */\n}\n\n\nstatic void createstdfile (lua_State *L, FILE *f, int k, const char *fname) {\n  *newfile(L) = f;\n  if (k > 0) {\n    lua_pushvalue(L, -1);\n    lua_rawseti(L, LUA_ENVIRONINDEX, k);\n  }\n  lua_pushvalue(L, -2);  /* copy environment */\n  lua_setfenv(L, -2);  /* set it */\n  lua_setfield(L, -3, fname);\n}\n\n\nstatic void newfenv (lua_State *L, lua_CFunction cls) {\n  lua_createtable(L, 0, 1);\n  lua_pushcfunction(L, cls);\n  lua_setfield(L, -2, \"__close\");\n}\n\n\nLUALIB_API int luaopen_io (lua_State *L) {\n  createmeta(L);\n  /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */\n  newfenv(L, io_fclose);\n  lua_replace(L, LUA_ENVIRONINDEX);\n  /* open library */\n  luaL_register(L, LUA_IOLIBNAME, iolib);\n  /* create (and set) default files */\n  newfenv(L, io_noclose);  /* close function for default files */\n  createstdfile(L, stdin, IO_INPUT, \"stdin\");\n  createstdfile(L, stdout, IO_OUTPUT, \"stdout\");\n  createstdfile(L, stderr, 0, \"stderr\");\n  lua_pop(L, 1);  /* pop environment for default files */\n  lua_getfield(L, -1, \"popen\");\n  newfenv(L, io_pclose);  /* create environment for 'popen' */\n  lua_setfenv(L, -2);  /* set fenv for 'popen' */\n  lua_pop(L, 1);  /* pop 'popen' */\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/llex.c",
    "content": "/*\n** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $\n** Lexical Analyzer\n** See Copyright Notice in lua.h\n*/\n\n\n#include <ctype.h>\n#include <locale.h>\n#include <string.h>\n\n#define llex_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldo.h\"\n#include \"llex.h\"\n#include \"lobject.h\"\n#include \"lparser.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"lzio.h\"\n\n\n\n#define next(ls) (ls->current = zgetc(ls->z))\n\n\n\n\n#define currIsNewline(ls)\t(ls->current == '\\n' || ls->current == '\\r')\n\n\n/* ORDER RESERVED */\nconst char *const luaX_tokens [] = {\n    \"and\", \"break\", \"do\", \"else\", \"elseif\",\n    \"end\", \"false\", \"for\", \"function\", \"if\",\n    \"in\", \"local\", \"nil\", \"not\", \"or\", \"repeat\",\n    \"return\", \"then\", \"true\", \"until\", \"while\",\n    \"..\", \"...\", \"==\", \">=\", \"<=\", \"~=\",\n    \"<number>\", \"<name>\", \"<string>\", \"<eof>\",\n    NULL\n};\n\n\n#define save_and_next(ls) (save(ls, ls->current), next(ls))\n\n\nstatic void save (LexState *ls, int c) {\n  Mbuffer *b = ls->buff;\n  if (b->n + 1 > b->buffsize) {\n    size_t newsize;\n    if (b->buffsize >= MAX_SIZET/2)\n      luaX_lexerror(ls, \"lexical element too long\", 0);\n    newsize = b->buffsize * 2;\n    luaZ_resizebuffer(ls->L, b, newsize);\n  }\n  b->buffer[b->n++] = cast(char, c);\n}\n\n\nvoid luaX_init (lua_State *L) {\n  int i;\n  for (i=0; i<NUM_RESERVED; i++) {\n    TString *ts = luaS_new(L, luaX_tokens[i]);\n    luaS_fix(ts);  /* reserved words are never collected */\n    lua_assert(strlen(luaX_tokens[i])+1 <= TOKEN_LEN);\n    ts->tsv.reserved = cast_byte(i+1);  /* reserved word */\n  }\n}\n\n\n#define MAXSRC          80\n\n\nconst char *luaX_token2str (LexState *ls, int token) {\n  if (token < FIRST_RESERVED) {\n    lua_assert(token == cast(unsigned char, token));\n    return (iscntrl(token)) ? luaO_pushfstring(ls->L, \"char(%d)\", token) :\n                              luaO_pushfstring(ls->L, \"%c\", token);\n  }\n  else\n    return luaX_tokens[token-FIRST_RESERVED];\n}\n\n\nstatic const char *txtToken (LexState *ls, int token) {\n  switch (token) {\n    case TK_NAME:\n    case TK_STRING:\n    case TK_NUMBER:\n      save(ls, '\\0');\n      return luaZ_buffer(ls->buff);\n    default:\n      return luaX_token2str(ls, token);\n  }\n}\n\n\nvoid luaX_lexerror (LexState *ls, const char *msg, int token) {\n  char buff[MAXSRC];\n  luaO_chunkid(buff, getstr(ls->source), MAXSRC);\n  msg = luaO_pushfstring(ls->L, \"%s:%d: %s\", buff, ls->linenumber, msg);\n  if (token)\n    luaO_pushfstring(ls->L, \"%s near \" LUA_QS, msg, txtToken(ls, token));\n  luaD_throw(ls->L, LUA_ERRSYNTAX);\n}\n\n\nvoid luaX_syntaxerror (LexState *ls, const char *msg) {\n  luaX_lexerror(ls, msg, ls->t.token);\n}\n\n\nTString *luaX_newstring (LexState *ls, const char *str, size_t l) {\n  lua_State *L = ls->L;\n  TString *ts = luaS_newlstr(L, str, l);\n  TValue *o = luaH_setstr(L, ls->fs->h, ts);  /* entry for `str' */\n  if (ttisnil(o)) {\n    setbvalue(o, 1);  /* make sure `str' will not be collected */\n    luaC_checkGC(L);\n  }\n  return ts;\n}\n\n\nstatic void inclinenumber (LexState *ls) {\n  int old = ls->current;\n  lua_assert(currIsNewline(ls));\n  next(ls);  /* skip `\\n' or `\\r' */\n  if (currIsNewline(ls) && ls->current != old)\n    next(ls);  /* skip `\\n\\r' or `\\r\\n' */\n  if (++ls->linenumber >= MAX_INT)\n    luaX_syntaxerror(ls, \"chunk has too many lines\");\n}\n\n\nvoid luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) {\n  ls->decpoint = '.';\n  ls->L = L;\n  ls->lookahead.token = TK_EOS;  /* no look-ahead token */\n  ls->z = z;\n  ls->fs = NULL;\n  ls->linenumber = 1;\n  ls->lastline = 1;\n  ls->source = source;\n  luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER);  /* initialize buffer */\n  next(ls);  /* read first char */\n}\n\n\n\n/*\n** =======================================================\n** LEXICAL ANALYZER\n** =======================================================\n*/\n\n\n\nstatic int check_next (LexState *ls, const char *set) {\n  if (!strchr(set, ls->current))\n    return 0;\n  save_and_next(ls);\n  return 1;\n}\n\n\nstatic void buffreplace (LexState *ls, char from, char to) {\n  size_t n = luaZ_bufflen(ls->buff);\n  char *p = luaZ_buffer(ls->buff);\n  while (n--)\n    if (p[n] == from) p[n] = to;\n}\n\n\nstatic void trydecpoint (LexState *ls, SemInfo *seminfo) {\n  /* format error: try to update decimal point separator */\n  /* struct lconv *cv = localeconv(); removed for android ndk */\n  char old = ls->decpoint;\n  ls->decpoint = '.'; /* (cv ? cv->decimal_point[0] : '.'); removed for android ndk */\n  buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */\n  if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {\n    /* format error with correct decimal point: no more options */\n    buffreplace(ls, ls->decpoint, '.');  /* undo change (for error message) */\n    luaX_lexerror(ls, \"malformed number\", TK_NUMBER);\n  }\n}\n\n\n/* LUA_NUMBER */\nstatic void read_numeral (LexState *ls, SemInfo *seminfo) {\n  lua_assert(isdigit(ls->current));\n  do {\n    save_and_next(ls);\n  } while (isdigit(ls->current) || ls->current == '.');\n  if (check_next(ls, \"Ee\"))  /* `E'? */\n    check_next(ls, \"+-\");  /* optional exponent sign */\n  while (isalnum(ls->current) || ls->current == '_')\n    save_and_next(ls);\n  save(ls, '\\0');\n  buffreplace(ls, '.', ls->decpoint);  /* follow locale for decimal point */\n  if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r))  /* format error? */\n    trydecpoint(ls, seminfo); /* try to update decimal point separator */\n}\n\n\nstatic int skip_sep (LexState *ls) {\n  int count = 0;\n  int s = ls->current;\n  lua_assert(s == '[' || s == ']');\n  save_and_next(ls);\n  while (ls->current == '=') {\n    save_and_next(ls);\n    count++;\n  }\n  return (ls->current == s) ? count : (-count) - 1;\n}\n\n\nstatic void read_long_string (LexState *ls, SemInfo *seminfo, int sep) {\n  int cont = 0;\n  (void)(cont);  /* avoid warnings when `cont' is not used */\n  save_and_next(ls);  /* skip 2nd `[' */\n  if (currIsNewline(ls))  /* string starts with a newline? */\n    inclinenumber(ls);  /* skip it */\n  for (;;) {\n    switch (ls->current) {\n      case EOZ:\n        luaX_lexerror(ls, (seminfo) ? \"unfinished long string\" :\n                                   \"unfinished long comment\", TK_EOS);\n        break;  /* to avoid warnings */\n#if defined(LUA_COMPAT_LSTR)\n      case '[': {\n        if (skip_sep(ls) == sep) {\n          save_and_next(ls);  /* skip 2nd `[' */\n          cont++;\n#if LUA_COMPAT_LSTR == 1\n          if (sep == 0)\n            luaX_lexerror(ls, \"nesting of [[...]] is deprecated\", '[');\n#endif\n        }\n        break;\n      }\n#endif\n      case ']': {\n        if (skip_sep(ls) == sep) {\n          save_and_next(ls);  /* skip 2nd `]' */\n#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2\n          cont--;\n          if (sep == 0 && cont >= 0) break;\n#endif\n          goto endloop;\n        }\n        break;\n      }\n      case '\\n':\n      case '\\r': {\n        save(ls, '\\n');\n        inclinenumber(ls);\n        if (!seminfo) luaZ_resetbuffer(ls->buff);  /* avoid wasting space */\n        break;\n      }\n      default: {\n        if (seminfo) save_and_next(ls);\n        else next(ls);\n      }\n    }\n  } endloop:\n  if (seminfo)\n    seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep),\n                                     luaZ_bufflen(ls->buff) - 2*(2 + sep));\n}\n\n\nstatic void read_string (LexState *ls, int del, SemInfo *seminfo) {\n  save_and_next(ls);\n  while (ls->current != del) {\n    switch (ls->current) {\n      case EOZ:\n        luaX_lexerror(ls, \"unfinished string\", TK_EOS);\n        continue;  /* to avoid warnings */\n      case '\\n':\n      case '\\r':\n        luaX_lexerror(ls, \"unfinished string\", TK_STRING);\n        continue;  /* to avoid warnings */\n      case '\\\\': {\n        int c;\n        next(ls);  /* do not save the `\\' */\n        switch (ls->current) {\n          case 'a': c = '\\a'; break;\n          case 'b': c = '\\b'; break;\n          case 'f': c = '\\f'; break;\n          case 'n': c = '\\n'; break;\n          case 'r': c = '\\r'; break;\n          case 't': c = '\\t'; break;\n          case 'v': c = '\\v'; break;\n          case '\\n':  /* go through */\n          case '\\r': save(ls, '\\n'); inclinenumber(ls); continue;\n          case EOZ: continue;  /* will raise an error next loop */\n          default: {\n            if (!isdigit(ls->current))\n              save_and_next(ls);  /* handles \\\\, \\\", \\', and \\? */\n            else {  /* \\xxx */\n              int i = 0;\n              c = 0;\n              do {\n                c = 10*c + (ls->current-'0');\n                next(ls);\n              } while (++i<3 && isdigit(ls->current));\n              if (c > UCHAR_MAX)\n                luaX_lexerror(ls, \"escape sequence too large\", TK_STRING);\n              save(ls, c);\n            }\n            continue;\n          }\n        }\n        save(ls, c);\n        next(ls);\n        continue;\n      }\n      default:\n        save_and_next(ls);\n    }\n  }\n  save_and_next(ls);  /* skip delimiter */\n  seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1,\n                                   luaZ_bufflen(ls->buff) - 2);\n}\n\n\nstatic int llex (LexState *ls, SemInfo *seminfo) {\n  luaZ_resetbuffer(ls->buff);\n  for (;;) {\n    switch (ls->current) {\n      case '\\n':\n      case '\\r': {\n        inclinenumber(ls);\n        continue;\n      }\n      case '-': {\n        next(ls);\n        if (ls->current != '-') return '-';\n        /* else is a comment */\n        next(ls);\n        if (ls->current == '[') {\n          int sep = skip_sep(ls);\n          luaZ_resetbuffer(ls->buff);  /* `skip_sep' may dirty the buffer */\n          if (sep >= 0) {\n            read_long_string(ls, NULL, sep);  /* long comment */\n            luaZ_resetbuffer(ls->buff);\n            continue;\n          }\n        }\n        /* else short comment */\n        while (!currIsNewline(ls) && ls->current != EOZ)\n          next(ls);\n        continue;\n      }\n      case '[': {\n        int sep = skip_sep(ls);\n        if (sep >= 0) {\n          read_long_string(ls, seminfo, sep);\n          return TK_STRING;\n        }\n        else if (sep == -1) return '[';\n        else luaX_lexerror(ls, \"invalid long string delimiter\", TK_STRING);\n      }\n      case '=': {\n        next(ls);\n        if (ls->current != '=') return '=';\n        else { next(ls); return TK_EQ; }\n      }\n      case '<': {\n        next(ls);\n        if (ls->current != '=') return '<';\n        else { next(ls); return TK_LE; }\n      }\n      case '>': {\n        next(ls);\n        if (ls->current != '=') return '>';\n        else { next(ls); return TK_GE; }\n      }\n      case '~': {\n        next(ls);\n        if (ls->current != '=') return '~';\n        else { next(ls); return TK_NE; }\n      }\n      case '\"':\n      case '\\'': {\n        read_string(ls, ls->current, seminfo);\n        return TK_STRING;\n      }\n      case '.': {\n        save_and_next(ls);\n        if (check_next(ls, \".\")) {\n          if (check_next(ls, \".\"))\n            return TK_DOTS;   /* ... */\n          else return TK_CONCAT;   /* .. */\n        }\n        else if (!isdigit(ls->current)) return '.';\n        else {\n          read_numeral(ls, seminfo);\n          return TK_NUMBER;\n        }\n      }\n      case EOZ: {\n        return TK_EOS;\n      }\n      default: {\n        if (isspace(ls->current)) {\n          lua_assert(!currIsNewline(ls));\n          next(ls);\n          continue;\n        }\n        else if (isdigit(ls->current)) {\n          read_numeral(ls, seminfo);\n          return TK_NUMBER;\n        }\n        else if (isalpha(ls->current) || ls->current == '_') {\n          /* identifier or reserved word */\n          TString *ts;\n          do {\n            save_and_next(ls);\n          } while (isalnum(ls->current) || ls->current == '_');\n          ts = luaX_newstring(ls, luaZ_buffer(ls->buff),\n                                  luaZ_bufflen(ls->buff));\n          if (ts->tsv.reserved > 0)  /* reserved word? */\n            return ts->tsv.reserved - 1 + FIRST_RESERVED;\n          else {\n            seminfo->ts = ts;\n            return TK_NAME;\n          }\n        }\n        else {\n          int c = ls->current;\n          next(ls);\n          return c;  /* single-char tokens (+ - / ...) */\n        }\n      }\n    }\n  }\n}\n\n\nvoid luaX_next (LexState *ls) {\n  ls->lastline = ls->linenumber;\n  if (ls->lookahead.token != TK_EOS) {  /* is there a look-ahead token? */\n    ls->t = ls->lookahead;  /* use this one */\n    ls->lookahead.token = TK_EOS;  /* and discharge it */\n  }\n  else\n    ls->t.token = llex(ls, &ls->t.seminfo);  /* read next token */\n}\n\n\nvoid luaX_lookahead (LexState *ls) {\n  lua_assert(ls->lookahead.token == TK_EOS);\n  ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/llex.h",
    "content": "/*\n** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $\n** Lexical Analyzer\n** See Copyright Notice in lua.h\n*/\n\n#ifndef llex_h\n#define llex_h\n\n#include \"lobject.h\"\n#include \"lzio.h\"\n\n\n#define FIRST_RESERVED\t257\n\n/* maximum length of a reserved word */\n#define TOKEN_LEN\t(sizeof(\"function\")/sizeof(char))\n\n\n/*\n* WARNING: if you change the order of this enumeration,\n* grep \"ORDER RESERVED\"\n*/\nenum RESERVED {\n  /* terminal symbols denoted by reserved words */\n  TK_AND = FIRST_RESERVED, TK_BREAK,\n  TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,\n  TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,\n  TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,\n  /* other terminal symbols */\n  TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER,\n  TK_NAME, TK_STRING, TK_EOS\n};\n\n/* number of reserved words */\n#define NUM_RESERVED\t(cast(int, TK_WHILE-FIRST_RESERVED+1))\n\n\n/* array with token `names' */\nLUAI_DATA const char *const luaX_tokens [];\n\n\ntypedef union {\n  lua_Number r;\n  TString *ts;\n} SemInfo;  /* semantics information */\n\n\ntypedef struct Token {\n  int token;\n  SemInfo seminfo;\n} Token;\n\n\ntypedef struct LexState {\n  int current;  /* current character (charint) */\n  int linenumber;  /* input line counter */\n  int lastline;  /* line of last token `consumed' */\n  Token t;  /* current token */\n  Token lookahead;  /* look ahead token */\n  struct FuncState *fs;  /* `FuncState' is private to the parser */\n  struct lua_State *L;\n  ZIO *z;  /* input stream */\n  Mbuffer *buff;  /* buffer for tokens */\n  TString *source;  /* current source name */\n  char decpoint;  /* locale decimal point */\n} LexState;\n\n\nLUAI_FUNC void luaX_init (lua_State *L);\nLUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,\n                              TString *source);\nLUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);\nLUAI_FUNC void luaX_next (LexState *ls);\nLUAI_FUNC void luaX_lookahead (LexState *ls);\nLUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);\nLUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);\nLUAI_FUNC const char *luaX_token2str (LexState *ls, int token);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/llimits.h",
    "content": "/*\n** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $\n** Limits, basic types, and some other `installation-dependent' definitions\n** See Copyright Notice in lua.h\n*/\n\n#ifndef llimits_h\n#define llimits_h\n\n\n#include <limits.h>\n#include <stddef.h>\n\n\n#include \"lua.h\"\n\n\ntypedef LUAI_UINT32 lu_int32;\n\ntypedef LUAI_UMEM lu_mem;\n\ntypedef LUAI_MEM l_mem;\n\n\n\n/* chars used as small naturals (so that `char' is reserved for characters) */\ntypedef unsigned char lu_byte;\n\n\n#define MAX_SIZET\t((size_t)(~(size_t)0)-2)\n\n#define MAX_LUMEM\t((lu_mem)(~(lu_mem)0)-2)\n\n\n#define MAX_INT (INT_MAX-2)  /* maximum value of an int (-2 for safety) */\n\n/*\n** conversion of pointer to integer\n** this is for hashing only; there is no problem if the integer\n** cannot hold the whole pointer value\n*/\n#define IntPoint(p)  ((unsigned int)(lu_mem)(p))\n\n\n\n/* type to ensure maximum alignment */\ntypedef LUAI_USER_ALIGNMENT_T L_Umaxalign;\n\n\n/* result of a `usual argument conversion' over lua_Number */\ntypedef LUAI_UACNUMBER l_uacNumber;\n\n\n/* internal assertions for in-house debugging */\n#ifdef lua_assert\n\n#define check_exp(c,e)\t\t(lua_assert(c), (e))\n#define api_check(l,e)\t\tlua_assert(e)\n\n#else\n\n#define lua_assert(c)\t\t((void)0)\n#define check_exp(c,e)\t\t(e)\n#define api_check\t\tluai_apicheck\n\n#endif\n\n\n#ifndef UNUSED\n#define UNUSED(x)\t((void)(x))\t/* to avoid warnings */\n#endif\n\n\n#ifndef cast\n#define cast(t, exp)\t((t)(exp))\n#endif\n\n#define cast_byte(i)\tcast(lu_byte, (i))\n#define cast_num(i)\tcast(lua_Number, (i))\n#define cast_int(i)\tcast(int, (i))\n\n\n\n/*\n** type for virtual-machine instructions\n** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)\n*/\ntypedef lu_int32 Instruction;\n\n\n\n/* maximum stack for a Lua function */\n#define MAXSTACK\t250\n\n\n\n/* minimum size for the string table (must be power of 2) */\n#ifndef MINSTRTABSIZE\n#define MINSTRTABSIZE\t32\n#endif\n\n\n/* minimum size for string buffer */\n#ifndef LUA_MINBUFFER\n#define LUA_MINBUFFER\t32\n#endif\n\n\n#ifndef lua_lock\n#define lua_lock(L)     ((void) 0) \n#define lua_unlock(L)   ((void) 0)\n#endif\n\n#ifndef luai_threadyield\n#define luai_threadyield(L)     {lua_unlock(L); lua_lock(L);}\n#endif\n\n\n/*\n** macro to control inclusion of some hard tests on stack reallocation\n*/ \n#ifndef HARDSTACKTESTS\n#define condhardstacktests(x)\t((void)0)\n#else\n#define condhardstacktests(x)\tx\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lmathlib.c",
    "content": "/*\n** $Id: lmathlib.c,v 1.67.1.1 2007/12/27 13:02:25 roberto Exp $\n** Standard mathematical library\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stdlib.h>\n#include <math.h>\n\n#define lmathlib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n#undef PI\n#define PI (3.14159265358979323846)\n#define RADIANS_PER_DEGREE (PI/180.0)\n\n\n\nstatic int math_abs (lua_State *L) {\n  lua_pushnumber(L, fabs(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_sin (lua_State *L) {\n  lua_pushnumber(L, sin(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_sinh (lua_State *L) {\n  lua_pushnumber(L, sinh(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_cos (lua_State *L) {\n  lua_pushnumber(L, cos(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_cosh (lua_State *L) {\n  lua_pushnumber(L, cosh(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_tan (lua_State *L) {\n  lua_pushnumber(L, tan(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_tanh (lua_State *L) {\n  lua_pushnumber(L, tanh(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_asin (lua_State *L) {\n  lua_pushnumber(L, asin(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_acos (lua_State *L) {\n  lua_pushnumber(L, acos(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_atan (lua_State *L) {\n  lua_pushnumber(L, atan(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_atan2 (lua_State *L) {\n  lua_pushnumber(L, atan2(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));\n  return 1;\n}\n\nstatic int math_ceil (lua_State *L) {\n  lua_pushnumber(L, ceil(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_floor (lua_State *L) {\n  lua_pushnumber(L, floor(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_fmod (lua_State *L) {\n  lua_pushnumber(L, fmod(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));\n  return 1;\n}\n\nstatic int math_modf (lua_State *L) {\n  double ip;\n  double fp = modf(luaL_checknumber(L, 1), &ip);\n  lua_pushnumber(L, ip);\n  lua_pushnumber(L, fp);\n  return 2;\n}\n\nstatic int math_sqrt (lua_State *L) {\n  lua_pushnumber(L, sqrt(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_pow (lua_State *L) {\n  lua_pushnumber(L, pow(luaL_checknumber(L, 1), luaL_checknumber(L, 2)));\n  return 1;\n}\n\nstatic int math_log (lua_State *L) {\n  lua_pushnumber(L, log(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_log10 (lua_State *L) {\n  lua_pushnumber(L, log10(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_exp (lua_State *L) {\n  lua_pushnumber(L, exp(luaL_checknumber(L, 1)));\n  return 1;\n}\n\nstatic int math_deg (lua_State *L) {\n  lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE);\n  return 1;\n}\n\nstatic int math_rad (lua_State *L) {\n  lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE);\n  return 1;\n}\n\nstatic int math_frexp (lua_State *L) {\n  int e;\n  lua_pushnumber(L, frexp(luaL_checknumber(L, 1), &e));\n  lua_pushinteger(L, e);\n  return 2;\n}\n\nstatic int math_ldexp (lua_State *L) {\n  lua_pushnumber(L, ldexp(luaL_checknumber(L, 1), luaL_checkint(L, 2)));\n  return 1;\n}\n\n\n\nstatic int math_min (lua_State *L) {\n  int n = lua_gettop(L);  /* number of arguments */\n  lua_Number dmin = luaL_checknumber(L, 1);\n  int i;\n  for (i=2; i<=n; i++) {\n    lua_Number d = luaL_checknumber(L, i);\n    if (d < dmin)\n      dmin = d;\n  }\n  lua_pushnumber(L, dmin);\n  return 1;\n}\n\n\nstatic int math_max (lua_State *L) {\n  int n = lua_gettop(L);  /* number of arguments */\n  lua_Number dmax = luaL_checknumber(L, 1);\n  int i;\n  for (i=2; i<=n; i++) {\n    lua_Number d = luaL_checknumber(L, i);\n    if (d > dmax)\n      dmax = d;\n  }\n  lua_pushnumber(L, dmax);\n  return 1;\n}\n\n\nstatic int math_random (lua_State *L) {\n  /* the `%' avoids the (rare) case of r==1, and is needed also because on\n     some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */\n  lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX;\n  switch (lua_gettop(L)) {  /* check number of arguments */\n    case 0: {  /* no arguments */\n      lua_pushnumber(L, r);  /* Number between 0 and 1 */\n      break;\n    }\n    case 1: {  /* only upper limit */\n      int u = luaL_checkint(L, 1);\n      luaL_argcheck(L, 1<=u, 1, \"interval is empty\");\n      lua_pushnumber(L, floor(r*u)+1);  /* int between 1 and `u' */\n      break;\n    }\n    case 2: {  /* lower and upper limits */\n      int l = luaL_checkint(L, 1);\n      int u = luaL_checkint(L, 2);\n      luaL_argcheck(L, l<=u, 2, \"interval is empty\");\n      lua_pushnumber(L, floor(r*(u-l+1))+l);  /* int between `l' and `u' */\n      break;\n    }\n    default: return luaL_error(L, \"wrong number of arguments\");\n  }\n  return 1;\n}\n\n\nstatic int math_randomseed (lua_State *L) {\n  srand(luaL_checkint(L, 1));\n  return 0;\n}\n\n\nstatic const luaL_Reg mathlib[] = {\n  {\"abs\",   math_abs},\n  {\"acos\",  math_acos},\n  {\"asin\",  math_asin},\n  {\"atan2\", math_atan2},\n  {\"atan\",  math_atan},\n  {\"ceil\",  math_ceil},\n  {\"cosh\",   math_cosh},\n  {\"cos\",   math_cos},\n  {\"deg\",   math_deg},\n  {\"exp\",   math_exp},\n  {\"floor\", math_floor},\n  {\"fmod\",   math_fmod},\n  {\"frexp\", math_frexp},\n  {\"ldexp\", math_ldexp},\n  {\"log10\", math_log10},\n  {\"log\",   math_log},\n  {\"max\",   math_max},\n  {\"min\",   math_min},\n  {\"modf\",   math_modf},\n  {\"pow\",   math_pow},\n  {\"rad\",   math_rad},\n  {\"random\",     math_random},\n  {\"randomseed\", math_randomseed},\n  {\"sinh\",   math_sinh},\n  {\"sin\",   math_sin},\n  {\"sqrt\",  math_sqrt},\n  {\"tanh\",   math_tanh},\n  {\"tan\",   math_tan},\n  {NULL, NULL}\n};\n\n\n/*\n** Open math library\n*/\nLUALIB_API int luaopen_math (lua_State *L) {\n  luaL_register(L, LUA_MATHLIBNAME, mathlib);\n  lua_pushnumber(L, PI);\n  lua_setfield(L, -2, \"pi\");\n  lua_pushnumber(L, HUGE_VAL);\n  lua_setfield(L, -2, \"huge\");\n#if defined(LUA_COMPAT_MOD)\n  lua_getfield(L, -1, \"fmod\");\n  lua_setfield(L, -2, \"mod\");\n#endif\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lmem.c",
    "content": "/*\n** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $\n** Interface to Memory Manager\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stddef.h>\n\n#define lmem_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n\n\n\n/*\n** About the realloc function:\n** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize);\n** (`osize' is the old size, `nsize' is the new size)\n**\n** Lua ensures that (ptr == NULL) iff (osize == 0).\n**\n** * frealloc(ud, NULL, 0, x) creates a new block of size `x'\n**\n** * frealloc(ud, p, x, 0) frees the block `p'\n** (in this specific case, frealloc must return NULL).\n** particularly, frealloc(ud, NULL, 0, 0) does nothing\n** (which is equivalent to free(NULL) in ANSI C)\n**\n** frealloc returns NULL if it cannot create or reallocate the area\n** (any reallocation to an equal or smaller size cannot fail!)\n*/\n\n\n\n#define MINSIZEARRAY\t4\n\n\nvoid *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems,\n                     int limit, const char *errormsg) {\n  void *newblock;\n  int newsize;\n  if (*size >= limit/2) {  /* cannot double it? */\n    if (*size >= limit)  /* cannot grow even a little? */\n      luaG_runerror(L, errormsg);\n    newsize = limit;  /* still have at least one free place */\n  }\n  else {\n    newsize = (*size)*2;\n    if (newsize < MINSIZEARRAY)\n      newsize = MINSIZEARRAY;  /* minimum size */\n  }\n  newblock = luaM_reallocv(L, block, *size, newsize, size_elems);\n  *size = newsize;  /* update only when everything else is OK */\n  return newblock;\n}\n\n\nvoid *luaM_toobig (lua_State *L) {\n  luaG_runerror(L, \"memory allocation error: block too big\");\n  return NULL;  /* to avoid warnings */\n}\n\n\n\n/*\n** generic allocation routine.\n*/\nvoid *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) {\n  global_State *g = G(L);\n  lua_assert((osize == 0) == (block == NULL));\n  block = (*g->frealloc)(g->ud, block, osize, nsize);\n  if (block == NULL && nsize > 0)\n    luaD_throw(L, LUA_ERRMEM);\n  lua_assert((nsize == 0) == (block == NULL));\n  g->totalbytes = (g->totalbytes - osize) + nsize;\n  return block;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lmem.h",
    "content": "/*\n** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $\n** Interface to Memory Manager\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lmem_h\n#define lmem_h\n\n\n#include <stddef.h>\n\n#include \"llimits.h\"\n#include \"lua.h\"\n\n#define MEMERRMSG\t\"not enough memory\"\n\n\n#define luaM_reallocv(L,b,on,n,e) \\\n\t((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ?  /* +1 to avoid warnings */ \\\n\t\tluaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \\\n\t\tluaM_toobig(L))\n\n#define luaM_freemem(L, b, s)\tluaM_realloc_(L, (b), (s), 0)\n#define luaM_free(L, b)\t\tluaM_realloc_(L, (b), sizeof(*(b)), 0)\n#define luaM_freearray(L, b, n, t)   luaM_reallocv(L, (b), n, 0, sizeof(t))\n\n#define luaM_malloc(L,t)\tluaM_realloc_(L, NULL, 0, (t))\n#define luaM_new(L,t)\t\tcast(t *, luaM_malloc(L, sizeof(t)))\n#define luaM_newvector(L,n,t) \\\n\t\tcast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))\n\n#define luaM_growvector(L,v,nelems,size,t,limit,e) \\\n          if ((nelems)+1 > (size)) \\\n            ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))\n\n#define luaM_reallocvector(L, v,oldn,n,t) \\\n   ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t))))\n\n\nLUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize,\n                                                          size_t size);\nLUAI_FUNC void *luaM_toobig (lua_State *L);\nLUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size,\n                               size_t size_elem, int limit,\n                               const char *errormsg);\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/loadlib.c",
    "content": "/*\n** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $\n** Dynamic library loader for Lua\n** See Copyright Notice in lua.h\n**\n** This module contains an implementation of loadlib for Unix systems\n** that have dlfcn, an implementation for Darwin (Mac OS X), an\n** implementation for Windows, and a stub for other systems.\n*/\n\n\n#include <stdlib.h>\n#include <string.h>\n\n\n#define loadlib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n/* prefix for open functions in C libraries */\n#define LUA_POF\t\t\"luaopen_\"\n\n/* separator for open functions in C libraries */\n#define LUA_OFSEP\t\"_\"\n\n\n#define LIBPREFIX\t\"LOADLIB: \"\n\n#define POF\t\tLUA_POF\n#define LIB_FAIL\t\"open\"\n\n\n/* error codes for ll_loadfunc */\n#define ERRLIB\t\t1\n#define ERRFUNC\t\t2\n\n#define setprogdir(L)\t\t((void)0)\n\n\nstatic void ll_unloadlib (void *lib);\nstatic void *ll_load (lua_State *L, const char *path);\nstatic lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym);\n\n\n\n#if defined(LUA_DL_DLOPEN)\n/*\n** {========================================================================\n** This is an implementation of loadlib based on the dlfcn interface.\n** The dlfcn interface is available in Linux, SunOS, Solaris, IRIX, FreeBSD,\n** NetBSD, AIX 4.2, HPUX 11, and  probably most other Unix flavors, at least\n** as an emulation layer on top of native functions.\n** =========================================================================\n*/\n\n#include <dlfcn.h>\n\nstatic void ll_unloadlib (void *lib) {\n  dlclose(lib);\n}\n\n\nstatic void *ll_load (lua_State *L, const char *path) {\n  void *lib = dlopen(path, RTLD_NOW);\n  if (lib == NULL) lua_pushstring(L, dlerror());\n  return lib;\n}\n\n\nstatic lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {\n  lua_CFunction f = (lua_CFunction)dlsym(lib, sym);\n  if (f == NULL) lua_pushstring(L, dlerror());\n  return f;\n}\n\n/* }====================================================== */\n\n\n\n#elif defined(LUA_DL_DLL)\n/*\n** {======================================================================\n** This is an implementation of loadlib for Windows using native functions.\n** =======================================================================\n*/\n\n#include <windows.h>\n\n\n#undef setprogdir\n\nstatic void setprogdir (lua_State *L) {\n  char buff[MAX_PATH + 1];\n  char *lb;\n  DWORD nsize = sizeof(buff)/sizeof(char);\n  DWORD n = GetModuleFileNameA(NULL, buff, nsize);\n  if (n == 0 || n == nsize || (lb = strrchr(buff, '\\\\')) == NULL)\n    luaL_error(L, \"unable to get ModuleFileName\");\n  else {\n    *lb = '\\0';\n    luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff);\n    lua_remove(L, -2);  /* remove original string */\n  }\n}\n\n\nstatic void pusherror (lua_State *L) {\n  int error = GetLastError();\n  char buffer[128];\n  if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,\n      NULL, error, 0, buffer, sizeof(buffer), NULL))\n    lua_pushstring(L, buffer);\n  else\n    lua_pushfstring(L, \"system error %d\\n\", error);\n}\n\nstatic void ll_unloadlib (void *lib) {\n  FreeLibrary((HINSTANCE)lib);\n}\n\n\nstatic void *ll_load (lua_State *L, const char *path) {\n  HINSTANCE lib = LoadLibraryA(path);\n  if (lib == NULL) pusherror(L);\n  return lib;\n}\n\n\nstatic lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {\n  lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym);\n  if (f == NULL) pusherror(L);\n  return f;\n}\n\n/* }====================================================== */\n\n\n\n#elif defined(LUA_DL_DYLD)\n/*\n** {======================================================================\n** Native Mac OS X / Darwin Implementation\n** =======================================================================\n*/\n\n#include <mach-o/dyld.h>\n\n\n/* Mac appends a `_' before C function names */\n#undef POF\n#define POF\t\"_\" LUA_POF\n\n\nstatic void pusherror (lua_State *L) {\n  const char *err_str;\n  const char *err_file;\n  NSLinkEditErrors err;\n  int err_num;\n  NSLinkEditError(&err, &err_num, &err_file, &err_str);\n  lua_pushstring(L, err_str);\n}\n\n\nstatic const char *errorfromcode (NSObjectFileImageReturnCode ret) {\n  switch (ret) {\n    case NSObjectFileImageInappropriateFile:\n      return \"file is not a bundle\";\n    case NSObjectFileImageArch:\n      return \"library is for wrong CPU type\";\n    case NSObjectFileImageFormat:\n      return \"bad format\";\n    case NSObjectFileImageAccess:\n      return \"cannot access file\";\n    case NSObjectFileImageFailure:\n    default:\n      return \"unable to load library\";\n  }\n}\n\n\nstatic void ll_unloadlib (void *lib) {\n  NSUnLinkModule((NSModule)lib, NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES);\n}\n\n\nstatic void *ll_load (lua_State *L, const char *path) {\n  NSObjectFileImage img;\n  NSObjectFileImageReturnCode ret;\n  /* this would be a rare case, but prevents crashing if it happens */\n  if(!_dyld_present()) {\n    lua_pushliteral(L, \"dyld not present\");\n    return NULL;\n  }\n  ret = NSCreateObjectFileImageFromFile(path, &img);\n  if (ret == NSObjectFileImageSuccess) {\n    NSModule mod = NSLinkModule(img, path, NSLINKMODULE_OPTION_PRIVATE |\n                       NSLINKMODULE_OPTION_RETURN_ON_ERROR);\n    NSDestroyObjectFileImage(img);\n    if (mod == NULL) pusherror(L);\n    return mod;\n  }\n  lua_pushstring(L, errorfromcode(ret));\n  return NULL;\n}\n\n\nstatic lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {\n  NSSymbol nss = NSLookupSymbolInModule((NSModule)lib, sym);\n  if (nss == NULL) {\n    lua_pushfstring(L, \"symbol \" LUA_QS \" not found\", sym);\n    return NULL;\n  }\n  return (lua_CFunction)NSAddressOfSymbol(nss);\n}\n\n/* }====================================================== */\n\n\n\n#else\n/*\n** {======================================================\n** Fallback for other systems\n** =======================================================\n*/\n\n#undef LIB_FAIL\n#define LIB_FAIL\t\"absent\"\n\n\n#define DLMSG\t\"dynamic libraries not enabled; check your Lua installation\"\n\n\nstatic void ll_unloadlib (void *lib) {\n  (void)lib;  /* to avoid warnings */\n}\n\n\nstatic void *ll_load (lua_State *L, const char *path) {\n  (void)path;  /* to avoid warnings */\n  lua_pushliteral(L, DLMSG);\n  return NULL;\n}\n\n\nstatic lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {\n  (void)lib; (void)sym;  /* to avoid warnings */\n  lua_pushliteral(L, DLMSG);\n  return NULL;\n}\n\n/* }====================================================== */\n#endif\n\n\n\nstatic void **ll_register (lua_State *L, const char *path) {\n  void **plib;\n  lua_pushfstring(L, \"%s%s\", LIBPREFIX, path);\n  lua_gettable(L, LUA_REGISTRYINDEX);  /* check library in registry? */\n  if (!lua_isnil(L, -1))  /* is there an entry? */\n    plib = (void **)lua_touserdata(L, -1);\n  else {  /* no entry yet; create one */\n    lua_pop(L, 1);\n    plib = (void **)lua_newuserdata(L, sizeof(const void *));\n    *plib = NULL;\n    luaL_getmetatable(L, \"_LOADLIB\");\n    lua_setmetatable(L, -2);\n    lua_pushfstring(L, \"%s%s\", LIBPREFIX, path);\n    lua_pushvalue(L, -2);\n    lua_settable(L, LUA_REGISTRYINDEX);\n  }\n  return plib;\n}\n\n\n/*\n** __gc tag method: calls library's `ll_unloadlib' function with the lib\n** handle\n*/\nstatic int gctm (lua_State *L) {\n  void **lib = (void **)luaL_checkudata(L, 1, \"_LOADLIB\");\n  if (*lib) ll_unloadlib(*lib);\n  *lib = NULL;  /* mark library as closed */\n  return 0;\n}\n\n\nstatic int ll_loadfunc (lua_State *L, const char *path, const char *sym) {\n  void **reg = ll_register(L, path);\n  if (*reg == NULL) *reg = ll_load(L, path);\n  if (*reg == NULL)\n    return ERRLIB;  /* unable to load library */\n  else {\n    lua_CFunction f = ll_sym(L, *reg, sym);\n    if (f == NULL)\n      return ERRFUNC;  /* unable to find function */\n    lua_pushcfunction(L, f);\n    return 0;  /* return function */\n  }\n}\n\n\nstatic int ll_loadlib (lua_State *L) {\n  const char *path = luaL_checkstring(L, 1);\n  const char *init = luaL_checkstring(L, 2);\n  int stat = ll_loadfunc(L, path, init);\n  if (stat == 0)  /* no errors? */\n    return 1;  /* return the loaded function */\n  else {  /* error; error message is on stack top */\n    lua_pushnil(L);\n    lua_insert(L, -2);\n    lua_pushstring(L, (stat == ERRLIB) ?  LIB_FAIL : \"init\");\n    return 3;  /* return nil, error message, and where */\n  }\n}\n\n\n\n/*\n** {======================================================\n** 'require' function\n** =======================================================\n*/\n\n\nstatic int readable (const char *filename) {\n  FILE *f = fopen(filename, \"r\");  /* try to open file */\n  if (f == NULL) return 0;  /* open failed */\n  fclose(f);\n  return 1;\n}\n\n\nstatic const char *pushnexttemplate (lua_State *L, const char *path) {\n  const char *l;\n  while (*path == *LUA_PATHSEP) path++;  /* skip separators */\n  if (*path == '\\0') return NULL;  /* no more templates */\n  l = strchr(path, *LUA_PATHSEP);  /* find next separator */\n  if (l == NULL) l = path + strlen(path);\n  lua_pushlstring(L, path, l - path);  /* template */\n  return l;\n}\n\n\nstatic const char *findfile (lua_State *L, const char *name,\n                                           const char *pname) {\n  const char *path;\n  name = luaL_gsub(L, name, \".\", LUA_DIRSEP);\n  lua_getfield(L, LUA_ENVIRONINDEX, pname);\n  path = lua_tostring(L, -1);\n  if (path == NULL)\n    luaL_error(L, LUA_QL(\"package.%s\") \" must be a string\", pname);\n  lua_pushliteral(L, \"\");  /* error accumulator */\n  while ((path = pushnexttemplate(L, path)) != NULL) {\n    const char *filename;\n    filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name);\n    lua_remove(L, -2);  /* remove path template */\n    if (readable(filename))  /* does file exist and is readable? */\n      return filename;  /* return that file name */\n    lua_pushfstring(L, \"\\n\\tno file \" LUA_QS, filename);\n    lua_remove(L, -2);  /* remove file name */\n    lua_concat(L, 2);  /* add entry to possible error message */\n  }\n  return NULL;  /* not found */\n}\n\n\nstatic void loaderror (lua_State *L, const char *filename) {\n  luaL_error(L, \"error loading module \" LUA_QS \" from file \" LUA_QS \":\\n\\t%s\",\n                lua_tostring(L, 1), filename, lua_tostring(L, -1));\n}\n\n\nstatic int loader_Lua (lua_State *L) {\n  const char *filename;\n  const char *name = luaL_checkstring(L, 1);\n  filename = findfile(L, name, \"path\");\n  if (filename == NULL) return 1;  /* library not found in this path */\n  if (luaL_loadfile(L, filename) != 0)\n    loaderror(L, filename);\n  return 1;  /* library loaded successfully */\n}\n\n\nstatic const char *mkfuncname (lua_State *L, const char *modname) {\n  const char *funcname;\n  const char *mark = strchr(modname, *LUA_IGMARK);\n  if (mark) modname = mark + 1;\n  funcname = luaL_gsub(L, modname, \".\", LUA_OFSEP);\n  funcname = lua_pushfstring(L, POF\"%s\", funcname);\n  lua_remove(L, -2);  /* remove 'gsub' result */\n  return funcname;\n}\n\n\nstatic int loader_C (lua_State *L) {\n  const char *funcname;\n  const char *name = luaL_checkstring(L, 1);\n  const char *filename = findfile(L, name, \"cpath\");\n  if (filename == NULL) return 1;  /* library not found in this path */\n  funcname = mkfuncname(L, name);\n  if (ll_loadfunc(L, filename, funcname) != 0)\n    loaderror(L, filename);\n  return 1;  /* library loaded successfully */\n}\n\n\nstatic int loader_Croot (lua_State *L) {\n  const char *funcname;\n  const char *filename;\n  const char *name = luaL_checkstring(L, 1);\n  const char *p = strchr(name, '.');\n  int stat;\n  if (p == NULL) return 0;  /* is root */\n  lua_pushlstring(L, name, p - name);\n  filename = findfile(L, lua_tostring(L, -1), \"cpath\");\n  if (filename == NULL) return 1;  /* root not found */\n  funcname = mkfuncname(L, name);\n  if ((stat = ll_loadfunc(L, filename, funcname)) != 0) {\n    if (stat != ERRFUNC) loaderror(L, filename);  /* real error */\n    lua_pushfstring(L, \"\\n\\tno module \" LUA_QS \" in file \" LUA_QS,\n                       name, filename);\n    return 1;  /* function not found */\n  }\n  return 1;\n}\n\n\nstatic int loader_preload (lua_State *L) {\n  const char *name = luaL_checkstring(L, 1);\n  lua_getfield(L, LUA_ENVIRONINDEX, \"preload\");\n  if (!lua_istable(L, -1))\n    luaL_error(L, LUA_QL(\"package.preload\") \" must be a table\");\n  lua_getfield(L, -1, name);\n  if (lua_isnil(L, -1))  /* not found? */\n    lua_pushfstring(L, \"\\n\\tno field package.preload['%s']\", name);\n  return 1;\n}\n\n\nstatic const int sentinel_ = 0;\n#define sentinel\t((void *)&sentinel_)\n\n\nstatic int ll_require (lua_State *L) {\n  const char *name = luaL_checkstring(L, 1);\n  int i;\n  lua_settop(L, 1);  /* _LOADED table will be at index 2 */\n  lua_getfield(L, LUA_REGISTRYINDEX, \"_LOADED\");\n  lua_getfield(L, 2, name);\n  if (lua_toboolean(L, -1)) {  /* is it there? */\n    if (lua_touserdata(L, -1) == sentinel)  /* check loops */\n      luaL_error(L, \"loop or previous error loading module \" LUA_QS, name);\n    return 1;  /* package is already loaded */\n  }\n  /* else must load it; iterate over available loaders */\n  lua_getfield(L, LUA_ENVIRONINDEX, \"loaders\");\n  if (!lua_istable(L, -1))\n    luaL_error(L, LUA_QL(\"package.loaders\") \" must be a table\");\n  lua_pushliteral(L, \"\");  /* error message accumulator */\n  for (i=1; ; i++) {\n    lua_rawgeti(L, -2, i);  /* get a loader */\n    if (lua_isnil(L, -1))\n      luaL_error(L, \"module \" LUA_QS \" not found:%s\",\n                    name, lua_tostring(L, -2));\n    lua_pushstring(L, name);\n    lua_call(L, 1, 1);  /* call it */\n    if (lua_isfunction(L, -1))  /* did it find module? */\n      break;  /* module loaded successfully */\n    else if (lua_isstring(L, -1))  /* loader returned error message? */\n      lua_concat(L, 2);  /* accumulate it */\n    else\n      lua_pop(L, 1);\n  }\n  lua_pushlightuserdata(L, sentinel);\n  lua_setfield(L, 2, name);  /* _LOADED[name] = sentinel */\n  lua_pushstring(L, name);  /* pass name as argument to module */\n  lua_call(L, 1, 1);  /* run loaded module */\n  if (!lua_isnil(L, -1))  /* non-nil return? */\n    lua_setfield(L, 2, name);  /* _LOADED[name] = returned value */\n  lua_getfield(L, 2, name);\n  if (lua_touserdata(L, -1) == sentinel) {   /* module did not set a value? */\n    lua_pushboolean(L, 1);  /* use true as result */\n    lua_pushvalue(L, -1);  /* extra copy to be returned */\n    lua_setfield(L, 2, name);  /* _LOADED[name] = true */\n  }\n  return 1;\n}\n\n/* }====================================================== */\n\n\n\n/*\n** {======================================================\n** 'module' function\n** =======================================================\n*/\n  \n\nstatic void setfenv (lua_State *L) {\n  lua_Debug ar;\n  if (lua_getstack(L, 1, &ar) == 0 ||\n      lua_getinfo(L, \"f\", &ar) == 0 ||  /* get calling function */\n      lua_iscfunction(L, -1))\n    luaL_error(L, LUA_QL(\"module\") \" not called from a Lua function\");\n  lua_pushvalue(L, -2);\n  lua_setfenv(L, -2);\n  lua_pop(L, 1);\n}\n\n\nstatic void dooptions (lua_State *L, int n) {\n  int i;\n  for (i = 2; i <= n; i++) {\n    lua_pushvalue(L, i);  /* get option (a function) */\n    lua_pushvalue(L, -2);  /* module */\n    lua_call(L, 1, 0);\n  }\n}\n\n\nstatic void modinit (lua_State *L, const char *modname) {\n  const char *dot;\n  lua_pushvalue(L, -1);\n  lua_setfield(L, -2, \"_M\");  /* module._M = module */\n  lua_pushstring(L, modname);\n  lua_setfield(L, -2, \"_NAME\");\n  dot = strrchr(modname, '.');  /* look for last dot in module name */\n  if (dot == NULL) dot = modname;\n  else dot++;\n  /* set _PACKAGE as package name (full module name minus last part) */\n  lua_pushlstring(L, modname, dot - modname);\n  lua_setfield(L, -2, \"_PACKAGE\");\n}\n\n\nstatic int ll_module (lua_State *L) {\n  const char *modname = luaL_checkstring(L, 1);\n  int loaded = lua_gettop(L) + 1;  /* index of _LOADED table */\n  lua_getfield(L, LUA_REGISTRYINDEX, \"_LOADED\");\n  lua_getfield(L, loaded, modname);  /* get _LOADED[modname] */\n  if (!lua_istable(L, -1)) {  /* not found? */\n    lua_pop(L, 1);  /* remove previous result */\n    /* try global variable (and create one if it does not exist) */\n    if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1) != NULL)\n      return luaL_error(L, \"name conflict for module \" LUA_QS, modname);\n    lua_pushvalue(L, -1);\n    lua_setfield(L, loaded, modname);  /* _LOADED[modname] = new table */\n  }\n  /* check whether table already has a _NAME field */\n  lua_getfield(L, -1, \"_NAME\");\n  if (!lua_isnil(L, -1))  /* is table an initialized module? */\n    lua_pop(L, 1);\n  else {  /* no; initialize it */\n    lua_pop(L, 1);\n    modinit(L, modname);\n  }\n  lua_pushvalue(L, -1);\n  setfenv(L);\n  dooptions(L, loaded - 1);\n  return 0;\n}\n\n\nstatic int ll_seeall (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n  if (!lua_getmetatable(L, 1)) {\n    lua_createtable(L, 0, 1); /* create new metatable */\n    lua_pushvalue(L, -1);\n    lua_setmetatable(L, 1);\n  }\n  lua_pushvalue(L, LUA_GLOBALSINDEX);\n  lua_setfield(L, -2, \"__index\");  /* mt.__index = _G */\n  return 0;\n}\n\n\n/* }====================================================== */\n\n\n\n/* auxiliary mark (for internal use) */\n#define AUXMARK\t\t\"\\1\"\n\nstatic void setpath (lua_State *L, const char *fieldname, const char *envname,\n                                   const char *def) {\n  const char *path = getenv(envname);\n  if (path == NULL)  /* no environment variable? */\n    lua_pushstring(L, def);  /* use default */\n  else {\n    /* replace \";;\" by \";AUXMARK;\" and then AUXMARK by default path */\n    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,\n                              LUA_PATHSEP AUXMARK LUA_PATHSEP);\n    luaL_gsub(L, path, AUXMARK, def);\n    lua_remove(L, -2);\n  }\n  setprogdir(L);\n  lua_setfield(L, -2, fieldname);\n}\n\n\nstatic const luaL_Reg pk_funcs[] = {\n  {\"loadlib\", ll_loadlib},\n  {\"seeall\", ll_seeall},\n  {NULL, NULL}\n};\n\n\nstatic const luaL_Reg ll_funcs[] = {\n  {\"module\", ll_module},\n  {\"require\", ll_require},\n  {NULL, NULL}\n};\n\n\nstatic const lua_CFunction loaders[] =\n  {loader_preload, loader_Lua, loader_C, loader_Croot, NULL};\n\n\nLUALIB_API int luaopen_package (lua_State *L) {\n  int i;\n  /* create new type _LOADLIB */\n  luaL_newmetatable(L, \"_LOADLIB\");\n  lua_pushcfunction(L, gctm);\n  lua_setfield(L, -2, \"__gc\");\n  /* create `package' table */\n  luaL_register(L, LUA_LOADLIBNAME, pk_funcs);\n#if defined(LUA_COMPAT_LOADLIB) \n  lua_getfield(L, -1, \"loadlib\");\n  lua_setfield(L, LUA_GLOBALSINDEX, \"loadlib\");\n#endif\n  lua_pushvalue(L, -1);\n  lua_replace(L, LUA_ENVIRONINDEX);\n  /* create `loaders' table */\n  lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);\n  /* fill it with pre-defined loaders */\n  for (i=0; loaders[i] != NULL; i++) {\n    lua_pushcfunction(L, loaders[i]);\n    lua_rawseti(L, -2, i+1);\n  }\n  lua_setfield(L, -2, \"loaders\");  /* put it in field `loaders' */\n  setpath(L, \"path\", LUA_PATH, LUA_PATH_DEFAULT);  /* set field `path' */\n  setpath(L, \"cpath\", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */\n  /* store config information */\n  lua_pushliteral(L, LUA_DIRSEP \"\\n\" LUA_PATHSEP \"\\n\" LUA_PATH_MARK \"\\n\"\n                     LUA_EXECDIR \"\\n\" LUA_IGMARK);\n  lua_setfield(L, -2, \"config\");\n  /* set field `loaded' */\n  luaL_findtable(L, LUA_REGISTRYINDEX, \"_LOADED\", 2);\n  lua_setfield(L, -2, \"loaded\");\n  /* set field `preload' */\n  lua_newtable(L);\n  lua_setfield(L, -2, \"preload\");\n  lua_pushvalue(L, LUA_GLOBALSINDEX);\n  luaL_register(L, NULL, ll_funcs);  /* open lib into global table */\n  lua_pop(L, 1);\n  return 1;  /* return 'package' table */\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lobject.c",
    "content": "/*\n** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $\n** Some generic functions over Lua objects\n** See Copyright Notice in lua.h\n*/\n\n#include <ctype.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define lobject_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldo.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"lvm.h\"\n\n\n\nconst TValue luaO_nilobject_ = {{NULL}, LUA_TNIL};\n\n\n/*\n** converts an integer to a \"floating point byte\", represented as\n** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if\n** eeeee != 0 and (xxx) otherwise.\n*/\nint luaO_int2fb (unsigned int x) {\n  int e = 0;  /* expoent */\n  while (x >= 16) {\n    x = (x+1) >> 1;\n    e++;\n  }\n  if (x < 8) return x;\n  else return ((e+1) << 3) | (cast_int(x) - 8);\n}\n\n\n/* converts back */\nint luaO_fb2int (int x) {\n  int e = (x >> 3) & 31;\n  if (e == 0) return x;\n  else return ((x & 7)+8) << (e - 1);\n}\n\n\nint luaO_log2 (unsigned int x) {\n  static const lu_byte log_2[256] = {\n    0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,\n    6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n    7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n    8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8\n  };\n  int l = -1;\n  while (x >= 256) { l += 8; x >>= 8; }\n  return l + log_2[x];\n\n}\n\n\nint luaO_rawequalObj (const TValue *t1, const TValue *t2) {\n  if (ttype(t1) != ttype(t2)) return 0;\n  else switch (ttype(t1)) {\n    case LUA_TNIL:\n      return 1;\n    case LUA_TNUMBER:\n      return luai_numeq(nvalue(t1), nvalue(t2));\n    case LUA_TBOOLEAN:\n      return bvalue(t1) == bvalue(t2);  /* boolean true must be 1 !! */\n    case LUA_TLIGHTUSERDATA:\n      return pvalue(t1) == pvalue(t2);\n    default:\n      lua_assert(iscollectable(t1));\n      return gcvalue(t1) == gcvalue(t2);\n  }\n}\n\n\nint luaO_str2d (const char *s, lua_Number *result) {\n  char *endptr;\n  *result = lua_str2number(s, &endptr);\n  if (endptr == s) return 0;  /* conversion failed */\n  if (*endptr == 'x' || *endptr == 'X')  /* maybe an hexadecimal constant? */\n    *result = cast_num(strtoul(s, &endptr, 16));\n  if (*endptr == '\\0') return 1;  /* most common case */\n  while (isspace(cast(unsigned char, *endptr))) endptr++;\n  if (*endptr != '\\0') return 0;  /* invalid trailing characters? */\n  return 1;\n}\n\n\n\nstatic void pushstr (lua_State *L, const char *str) {\n  setsvalue2s(L, L->top, luaS_new(L, str));\n  incr_top(L);\n}\n\n\n/* this function handles only `%d', `%c', %f, %p, and `%s' formats */\nconst char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) {\n  int n = 1;\n  pushstr(L, \"\");\n  for (;;) {\n    const char *e = strchr(fmt, '%');\n    if (e == NULL) break;\n    setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt));\n    incr_top(L);\n    switch (*(e+1)) {\n      case 's': {\n        const char *s = va_arg(argp, char *);\n        if (s == NULL) s = \"(null)\";\n        pushstr(L, s);\n        break;\n      }\n      case 'c': {\n        char buff[2];\n        buff[0] = cast(char, va_arg(argp, int));\n        buff[1] = '\\0';\n        pushstr(L, buff);\n        break;\n      }\n      case 'd': {\n        setnvalue(L->top, cast_num(va_arg(argp, int)));\n        incr_top(L);\n        break;\n      }\n      case 'f': {\n        setnvalue(L->top, cast_num(va_arg(argp, l_uacNumber)));\n        incr_top(L);\n        break;\n      }\n      case 'p': {\n        char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */\n        sprintf(buff, \"%p\", va_arg(argp, void *));\n        pushstr(L, buff);\n        break;\n      }\n      case '%': {\n        pushstr(L, \"%\");\n        break;\n      }\n      default: {\n        char buff[3];\n        buff[0] = '%';\n        buff[1] = *(e+1);\n        buff[2] = '\\0';\n        pushstr(L, buff);\n        break;\n      }\n    }\n    n += 2;\n    fmt = e+2;\n  }\n  pushstr(L, fmt);\n  luaV_concat(L, n+1, cast_int(L->top - L->base) - 1);\n  L->top -= n;\n  return svalue(L->top - 1);\n}\n\n\nconst char *luaO_pushfstring (lua_State *L, const char *fmt, ...) {\n  const char *msg;\n  va_list argp;\n  va_start(argp, fmt);\n  msg = luaO_pushvfstring(L, fmt, argp);\n  va_end(argp);\n  return msg;\n}\n\n\nvoid luaO_chunkid (char *out, const char *source, size_t bufflen) {\n  if (*source == '=') {\n    strncpy(out, source+1, bufflen);  /* remove first char */\n    out[bufflen-1] = '\\0';  /* ensures null termination */\n  }\n  else {  /* out = \"source\", or \"...source\" */\n    if (*source == '@') {\n      size_t l;\n      source++;  /* skip the `@' */\n      bufflen -= sizeof(\" '...' \");\n      l = strlen(source);\n      strcpy(out, \"\");\n      if (l > bufflen) {\n        source += (l-bufflen);  /* get last part of file name */\n        strcat(out, \"...\");\n      }\n      strcat(out, source);\n    }\n    else {  /* out = [string \"string\"] */\n      size_t len = strcspn(source, \"\\n\\r\");  /* stop at first newline */\n      bufflen -= sizeof(\" [string \\\"...\\\"] \");\n      if (len > bufflen) len = bufflen;\n      strcpy(out, \"[string \\\"\");\n      if (source[len] != '\\0') {  /* must truncate? */\n        strncat(out, source, len);\n        strcat(out, \"...\");\n      }\n      else\n        strcat(out, source);\n      strcat(out, \"\\\"]\");\n    }\n  }\n}\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lobject.h",
    "content": "/*\n** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $\n** Type definitions for Lua objects\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lobject_h\n#define lobject_h\n\n\n#include <stdarg.h>\n\n\n#include \"llimits.h\"\n#include \"lua.h\"\n\n\n/* tags for values visible from Lua */\n#define LAST_TAG\tLUA_TTHREAD\n\n#define NUM_TAGS\t(LAST_TAG+1)\n\n\n/*\n** Extra tags for non-values\n*/\n#define LUA_TPROTO\t(LAST_TAG+1)\n#define LUA_TUPVAL\t(LAST_TAG+2)\n#define LUA_TDEADKEY\t(LAST_TAG+3)\n\n\n/*\n** Union of all collectable objects\n*/\ntypedef union GCObject GCObject;\n\n\n/*\n** Common Header for all collectable objects (in macro form, to be\n** included in other objects)\n*/\n#define CommonHeader\tGCObject *next; lu_byte tt; lu_byte marked\n\n\n/*\n** Common header in struct form\n*/\ntypedef struct GCheader {\n  CommonHeader;\n} GCheader;\n\n\n\n\n/*\n** Union of all Lua values\n*/\ntypedef union {\n  GCObject *gc;\n  void *p;\n  lua_Number n;\n  int b;\n} Value;\n\n\n/*\n** Tagged Values\n*/\n\n#define TValuefields\tValue value; int tt\n\ntypedef struct lua_TValue {\n  TValuefields;\n} TValue;\n\n\n/* Macros to test type */\n#define ttisnil(o)\t(ttype(o) == LUA_TNIL)\n#define ttisnumber(o)\t(ttype(o) == LUA_TNUMBER)\n#define ttisstring(o)\t(ttype(o) == LUA_TSTRING)\n#define ttistable(o)\t(ttype(o) == LUA_TTABLE)\n#define ttisfunction(o)\t(ttype(o) == LUA_TFUNCTION)\n#define ttisboolean(o)\t(ttype(o) == LUA_TBOOLEAN)\n#define ttisuserdata(o)\t(ttype(o) == LUA_TUSERDATA)\n#define ttisthread(o)\t(ttype(o) == LUA_TTHREAD)\n#define ttislightuserdata(o)\t(ttype(o) == LUA_TLIGHTUSERDATA)\n\n/* Macros to access values */\n#define ttype(o)\t((o)->tt)\n#define gcvalue(o)\tcheck_exp(iscollectable(o), (o)->value.gc)\n#define pvalue(o)\tcheck_exp(ttislightuserdata(o), (o)->value.p)\n#define nvalue(o)\tcheck_exp(ttisnumber(o), (o)->value.n)\n#define rawtsvalue(o)\tcheck_exp(ttisstring(o), &(o)->value.gc->ts)\n#define tsvalue(o)\t(&rawtsvalue(o)->tsv)\n#define rawuvalue(o)\tcheck_exp(ttisuserdata(o), &(o)->value.gc->u)\n#define uvalue(o)\t(&rawuvalue(o)->uv)\n#define clvalue(o)\tcheck_exp(ttisfunction(o), &(o)->value.gc->cl)\n#define hvalue(o)\tcheck_exp(ttistable(o), &(o)->value.gc->h)\n#define bvalue(o)\tcheck_exp(ttisboolean(o), (o)->value.b)\n#define thvalue(o)\tcheck_exp(ttisthread(o), &(o)->value.gc->th)\n\n#define l_isfalse(o)\t(ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))\n\n/*\n** for internal debug only\n*/\n#define checkconsistency(obj) \\\n  lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt))\n\n#define checkliveness(g,obj) \\\n  lua_assert(!iscollectable(obj) || \\\n  ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc)))\n\n\n/* Macros to set values */\n#define setnilvalue(obj) ((obj)->tt=LUA_TNIL)\n\n#define setnvalue(obj,x) \\\n  { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; }\n\n#define setpvalue(obj,x) \\\n  { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; }\n\n#define setbvalue(obj,x) \\\n  { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; }\n\n#define setsvalue(L,obj,x) \\\n  { TValue *i_o=(obj); \\\n    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \\\n    checkliveness(G(L),i_o); }\n\n#define setuvalue(L,obj,x) \\\n  { TValue *i_o=(obj); \\\n    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \\\n    checkliveness(G(L),i_o); }\n\n#define setthvalue(L,obj,x) \\\n  { TValue *i_o=(obj); \\\n    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \\\n    checkliveness(G(L),i_o); }\n\n#define setclvalue(L,obj,x) \\\n  { TValue *i_o=(obj); \\\n    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \\\n    checkliveness(G(L),i_o); }\n\n#define sethvalue(L,obj,x) \\\n  { TValue *i_o=(obj); \\\n    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \\\n    checkliveness(G(L),i_o); }\n\n#define setptvalue(L,obj,x) \\\n  { TValue *i_o=(obj); \\\n    i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \\\n    checkliveness(G(L),i_o); }\n\n\n\n\n#define setobj(L,obj1,obj2) \\\n  { const TValue *o2=(obj2); TValue *o1=(obj1); \\\n    o1->value = o2->value; o1->tt=o2->tt; \\\n    checkliveness(G(L),o1); }\n\n\n/*\n** different types of sets, according to destination\n*/\n\n/* from stack to (same) stack */\n#define setobjs2s\tsetobj\n/* to stack (not from same stack) */\n#define setobj2s\tsetobj\n#define setsvalue2s\tsetsvalue\n#define sethvalue2s\tsethvalue\n#define setptvalue2s\tsetptvalue\n/* from table to same table */\n#define setobjt2t\tsetobj\n/* to table */\n#define setobj2t\tsetobj\n/* to new object */\n#define setobj2n\tsetobj\n#define setsvalue2n\tsetsvalue\n\n#define setttype(obj, tt) (ttype(obj) = (tt))\n\n\n#define iscollectable(o)\t(ttype(o) >= LUA_TSTRING)\n\n\n\ntypedef TValue *StkId;  /* index to stack elements */\n\n\n/*\n** String headers for string table\n*/\ntypedef union TString {\n  L_Umaxalign dummy;  /* ensures maximum alignment for strings */\n  struct {\n    CommonHeader;\n    lu_byte reserved;\n    unsigned int hash;\n    size_t len;\n  } tsv;\n} TString;\n\n\n#define getstr(ts)\tcast(const char *, (ts) + 1)\n#define svalue(o)       getstr(rawtsvalue(o))\n\n\n\ntypedef union Udata {\n  L_Umaxalign dummy;  /* ensures maximum alignment for `local' udata */\n  struct {\n    CommonHeader;\n    struct Table *metatable;\n    struct Table *env;\n    size_t len;\n  } uv;\n} Udata;\n\n\n\n\n/*\n** Function Prototypes\n*/\ntypedef struct Proto {\n  CommonHeader;\n  TValue *k;  /* constants used by the function */\n  Instruction *code;\n  struct Proto **p;  /* functions defined inside the function */\n  int *lineinfo;  /* map from opcodes to source lines */\n  struct LocVar *locvars;  /* information about local variables */\n  TString **upvalues;  /* upvalue names */\n  TString  *source;\n  int sizeupvalues;\n  int sizek;  /* size of `k' */\n  int sizecode;\n  int sizelineinfo;\n  int sizep;  /* size of `p' */\n  int sizelocvars;\n  int linedefined;\n  int lastlinedefined;\n  GCObject *gclist;\n  lu_byte nups;  /* number of upvalues */\n  lu_byte numparams;\n  lu_byte is_vararg;\n  lu_byte maxstacksize;\n} Proto;\n\n\n/* masks for new-style vararg */\n#define VARARG_HASARG\t\t1\n#define VARARG_ISVARARG\t\t2\n#define VARARG_NEEDSARG\t\t4\n\n\ntypedef struct LocVar {\n  TString *varname;\n  int startpc;  /* first point where variable is active */\n  int endpc;    /* first point where variable is dead */\n} LocVar;\n\n\n\n/*\n** Upvalues\n*/\n\ntypedef struct UpVal {\n  CommonHeader;\n  TValue *v;  /* points to stack or to its own value */\n  union {\n    TValue value;  /* the value (when closed) */\n    struct {  /* double linked list (when open) */\n      struct UpVal *prev;\n      struct UpVal *next;\n    } l;\n  } u;\n} UpVal;\n\n\n/*\n** Closures\n*/\n\n#define ClosureHeader \\\n\tCommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \\\n\tstruct Table *env\n\ntypedef struct CClosure {\n  ClosureHeader;\n  lua_CFunction f;\n  TValue upvalue[1];\n} CClosure;\n\n\ntypedef struct LClosure {\n  ClosureHeader;\n  struct Proto *p;\n  UpVal *upvals[1];\n} LClosure;\n\n\ntypedef union Closure {\n  CClosure c;\n  LClosure l;\n} Closure;\n\n\n#define iscfunction(o)\t(ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC)\n#define isLfunction(o)\t(ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC)\n\n\n/*\n** Tables\n*/\n\ntypedef union TKey {\n  struct {\n    TValuefields;\n    struct Node *next;  /* for chaining */\n  } nk;\n  TValue tvk;\n} TKey;\n\n\ntypedef struct Node {\n  TValue i_val;\n  TKey i_key;\n} Node;\n\n\ntypedef struct Table {\n  CommonHeader;\n  lu_byte flags;  /* 1<<p means tagmethod(p) is not present */ \n  lu_byte lsizenode;  /* log2 of size of `node' array */\n  struct Table *metatable;\n  TValue *array;  /* array part */\n  Node *node;\n  Node *lastfree;  /* any free position is before this position */\n  GCObject *gclist;\n  int sizearray;  /* size of `array' array */\n} Table;\n\n\n\n/*\n** `module' operation for hashing (size is always a power of 2)\n*/\n#define lmod(s,size) \\\n\t(check_exp((size&(size-1))==0, (cast(int, (s) & ((size)-1)))))\n\n\n#define twoto(x)\t(1<<(x))\n#define sizenode(t)\t(twoto((t)->lsizenode))\n\n\n#define luaO_nilobject\t\t(&luaO_nilobject_)\n\nLUAI_DATA const TValue luaO_nilobject_;\n\n#define ceillog2(x)\t(luaO_log2((x)-1) + 1)\n\nLUAI_FUNC int luaO_log2 (unsigned int x);\nLUAI_FUNC int luaO_int2fb (unsigned int x);\nLUAI_FUNC int luaO_fb2int (int x);\nLUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2);\nLUAI_FUNC int luaO_str2d (const char *s, lua_Number *result);\nLUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt,\n                                                       va_list argp);\nLUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);\nLUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len);\n\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lopcodes.c",
    "content": "/*\n** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $\n** See Copyright Notice in lua.h\n*/\n\n\n#define lopcodes_c\n#define LUA_CORE\n\n\n#include \"lopcodes.h\"\n\n\n/* ORDER OP */\n\nconst char *const luaP_opnames[NUM_OPCODES+1] = {\n  \"MOVE\",\n  \"LOADK\",\n  \"LOADBOOL\",\n  \"LOADNIL\",\n  \"GETUPVAL\",\n  \"GETGLOBAL\",\n  \"GETTABLE\",\n  \"SETGLOBAL\",\n  \"SETUPVAL\",\n  \"SETTABLE\",\n  \"NEWTABLE\",\n  \"SELF\",\n  \"ADD\",\n  \"SUB\",\n  \"MUL\",\n  \"DIV\",\n  \"MOD\",\n  \"POW\",\n  \"UNM\",\n  \"NOT\",\n  \"LEN\",\n  \"CONCAT\",\n  \"JMP\",\n  \"EQ\",\n  \"LT\",\n  \"LE\",\n  \"TEST\",\n  \"TESTSET\",\n  \"CALL\",\n  \"TAILCALL\",\n  \"RETURN\",\n  \"FORLOOP\",\n  \"FORPREP\",\n  \"TFORLOOP\",\n  \"SETLIST\",\n  \"CLOSE\",\n  \"CLOSURE\",\n  \"VARARG\",\n  NULL\n};\n\n\n#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))\n\nconst lu_byte luaP_opmodes[NUM_OPCODES] = {\n/*       T  A    B       C     mode\t\t   opcode\t*/\n  opmode(0, 1, OpArgR, OpArgN, iABC) \t\t/* OP_MOVE */\n ,opmode(0, 1, OpArgK, OpArgN, iABx)\t\t/* OP_LOADK */\n ,opmode(0, 1, OpArgU, OpArgU, iABC)\t\t/* OP_LOADBOOL */\n ,opmode(0, 1, OpArgR, OpArgN, iABC)\t\t/* OP_LOADNIL */\n ,opmode(0, 1, OpArgU, OpArgN, iABC)\t\t/* OP_GETUPVAL */\n ,opmode(0, 1, OpArgK, OpArgN, iABx)\t\t/* OP_GETGLOBAL */\n ,opmode(0, 1, OpArgR, OpArgK, iABC)\t\t/* OP_GETTABLE */\n ,opmode(0, 0, OpArgK, OpArgN, iABx)\t\t/* OP_SETGLOBAL */\n ,opmode(0, 0, OpArgU, OpArgN, iABC)\t\t/* OP_SETUPVAL */\n ,opmode(0, 0, OpArgK, OpArgK, iABC)\t\t/* OP_SETTABLE */\n ,opmode(0, 1, OpArgU, OpArgU, iABC)\t\t/* OP_NEWTABLE */\n ,opmode(0, 1, OpArgR, OpArgK, iABC)\t\t/* OP_SELF */\n ,opmode(0, 1, OpArgK, OpArgK, iABC)\t\t/* OP_ADD */\n ,opmode(0, 1, OpArgK, OpArgK, iABC)\t\t/* OP_SUB */\n ,opmode(0, 1, OpArgK, OpArgK, iABC)\t\t/* OP_MUL */\n ,opmode(0, 1, OpArgK, OpArgK, iABC)\t\t/* OP_DIV */\n ,opmode(0, 1, OpArgK, OpArgK, iABC)\t\t/* OP_MOD */\n ,opmode(0, 1, OpArgK, OpArgK, iABC)\t\t/* OP_POW */\n ,opmode(0, 1, OpArgR, OpArgN, iABC)\t\t/* OP_UNM */\n ,opmode(0, 1, OpArgR, OpArgN, iABC)\t\t/* OP_NOT */\n ,opmode(0, 1, OpArgR, OpArgN, iABC)\t\t/* OP_LEN */\n ,opmode(0, 1, OpArgR, OpArgR, iABC)\t\t/* OP_CONCAT */\n ,opmode(0, 0, OpArgR, OpArgN, iAsBx)\t\t/* OP_JMP */\n ,opmode(1, 0, OpArgK, OpArgK, iABC)\t\t/* OP_EQ */\n ,opmode(1, 0, OpArgK, OpArgK, iABC)\t\t/* OP_LT */\n ,opmode(1, 0, OpArgK, OpArgK, iABC)\t\t/* OP_LE */\n ,opmode(1, 1, OpArgR, OpArgU, iABC)\t\t/* OP_TEST */\n ,opmode(1, 1, OpArgR, OpArgU, iABC)\t\t/* OP_TESTSET */\n ,opmode(0, 1, OpArgU, OpArgU, iABC)\t\t/* OP_CALL */\n ,opmode(0, 1, OpArgU, OpArgU, iABC)\t\t/* OP_TAILCALL */\n ,opmode(0, 0, OpArgU, OpArgN, iABC)\t\t/* OP_RETURN */\n ,opmode(0, 1, OpArgR, OpArgN, iAsBx)\t\t/* OP_FORLOOP */\n ,opmode(0, 1, OpArgR, OpArgN, iAsBx)\t\t/* OP_FORPREP */\n ,opmode(1, 0, OpArgN, OpArgU, iABC)\t\t/* OP_TFORLOOP */\n ,opmode(0, 0, OpArgU, OpArgU, iABC)\t\t/* OP_SETLIST */\n ,opmode(0, 0, OpArgN, OpArgN, iABC)\t\t/* OP_CLOSE */\n ,opmode(0, 1, OpArgU, OpArgN, iABx)\t\t/* OP_CLOSURE */\n ,opmode(0, 1, OpArgU, OpArgN, iABC)\t\t/* OP_VARARG */\n};\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lopcodes.h",
    "content": "/*\n** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $\n** Opcodes for Lua virtual machine\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lopcodes_h\n#define lopcodes_h\n\n#include \"llimits.h\"\n\n\n/*===========================================================================\n  We assume that instructions are unsigned numbers.\n  All instructions have an opcode in the first 6 bits.\n  Instructions can have the following fields:\n\t`A' : 8 bits\n\t`B' : 9 bits\n\t`C' : 9 bits\n\t`Bx' : 18 bits (`B' and `C' together)\n\t`sBx' : signed Bx\n\n  A signed argument is represented in excess K; that is, the number\n  value is the unsigned value minus K. K is exactly the maximum value\n  for that argument (so that -max is represented by 0, and +max is\n  represented by 2*max), which is half the maximum for the corresponding\n  unsigned argument.\n===========================================================================*/\n\n\nenum OpMode {iABC, iABx, iAsBx};  /* basic instruction format */\n\n\n/*\n** size and position of opcode arguments.\n*/\n#define SIZE_C\t\t9\n#define SIZE_B\t\t9\n#define SIZE_Bx\t\t(SIZE_C + SIZE_B)\n#define SIZE_A\t\t8\n\n#define SIZE_OP\t\t6\n\n#define POS_OP\t\t0\n#define POS_A\t\t(POS_OP + SIZE_OP)\n#define POS_C\t\t(POS_A + SIZE_A)\n#define POS_B\t\t(POS_C + SIZE_C)\n#define POS_Bx\t\tPOS_C\n\n\n/*\n** limits for opcode arguments.\n** we use (signed) int to manipulate most arguments,\n** so they must fit in LUAI_BITSINT-1 bits (-1 for sign)\n*/\n#if SIZE_Bx < LUAI_BITSINT-1\n#define MAXARG_Bx        ((1<<SIZE_Bx)-1)\n#define MAXARG_sBx        (MAXARG_Bx>>1)         /* `sBx' is signed */\n#else\n#define MAXARG_Bx        MAX_INT\n#define MAXARG_sBx        MAX_INT\n#endif\n\n\n#define MAXARG_A        ((1<<SIZE_A)-1)\n#define MAXARG_B        ((1<<SIZE_B)-1)\n#define MAXARG_C        ((1<<SIZE_C)-1)\n\n\n/* creates a mask with `n' 1 bits at position `p' */\n#define MASK1(n,p)\t((~((~(Instruction)0)<<n))<<p)\n\n/* creates a mask with `n' 0 bits at position `p' */\n#define MASK0(n,p)\t(~MASK1(n,p))\n\n/*\n** the following macros help to manipulate instructions\n*/\n\n#define GET_OPCODE(i)\t(cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))\n#define SET_OPCODE(i,o)\t((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \\\n\t\t((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))\n\n#define GETARG_A(i)\t(cast(int, ((i)>>POS_A) & MASK1(SIZE_A,0)))\n#define SETARG_A(i,u)\t((i) = (((i)&MASK0(SIZE_A,POS_A)) | \\\n\t\t((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A))))\n\n#define GETARG_B(i)\t(cast(int, ((i)>>POS_B) & MASK1(SIZE_B,0)))\n#define SETARG_B(i,b)\t((i) = (((i)&MASK0(SIZE_B,POS_B)) | \\\n\t\t((cast(Instruction, b)<<POS_B)&MASK1(SIZE_B,POS_B))))\n\n#define GETARG_C(i)\t(cast(int, ((i)>>POS_C) & MASK1(SIZE_C,0)))\n#define SETARG_C(i,b)\t((i) = (((i)&MASK0(SIZE_C,POS_C)) | \\\n\t\t((cast(Instruction, b)<<POS_C)&MASK1(SIZE_C,POS_C))))\n\n#define GETARG_Bx(i)\t(cast(int, ((i)>>POS_Bx) & MASK1(SIZE_Bx,0)))\n#define SETARG_Bx(i,b)\t((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \\\n\t\t((cast(Instruction, b)<<POS_Bx)&MASK1(SIZE_Bx,POS_Bx))))\n\n#define GETARG_sBx(i)\t(GETARG_Bx(i)-MAXARG_sBx)\n#define SETARG_sBx(i,b)\tSETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))\n\n\n#define CREATE_ABC(o,a,b,c)\t((cast(Instruction, o)<<POS_OP) \\\n\t\t\t| (cast(Instruction, a)<<POS_A) \\\n\t\t\t| (cast(Instruction, b)<<POS_B) \\\n\t\t\t| (cast(Instruction, c)<<POS_C))\n\n#define CREATE_ABx(o,a,bc)\t((cast(Instruction, o)<<POS_OP) \\\n\t\t\t| (cast(Instruction, a)<<POS_A) \\\n\t\t\t| (cast(Instruction, bc)<<POS_Bx))\n\n\n/*\n** Macros to operate RK indices\n*/\n\n/* this bit 1 means constant (0 means register) */\n#define BITRK\t\t(1 << (SIZE_B - 1))\n\n/* test whether value is a constant */\n#define ISK(x)\t\t((x) & BITRK)\n\n/* gets the index of the constant */\n#define INDEXK(r)\t((int)(r) & ~BITRK)\n\n#define MAXINDEXRK\t(BITRK - 1)\n\n/* code a constant index as a RK value */\n#define RKASK(x)\t((x) | BITRK)\n\n\n/*\n** invalid register that fits in 8 bits\n*/\n#define NO_REG\t\tMAXARG_A\n\n\n/*\n** R(x) - register\n** Kst(x) - constant (in constant table)\n** RK(x) == if ISK(x) then Kst(INDEXK(x)) else R(x)\n*/\n\n\n/*\n** grep \"ORDER OP\" if you change these enums\n*/\n\ntypedef enum {\n/*----------------------------------------------------------------------\nname\t\targs\tdescription\n------------------------------------------------------------------------*/\nOP_MOVE,/*\tA B\tR(A) := R(B)\t\t\t\t\t*/\nOP_LOADK,/*\tA Bx\tR(A) := Kst(Bx)\t\t\t\t\t*/\nOP_LOADBOOL,/*\tA B C\tR(A) := (Bool)B; if (C) pc++\t\t\t*/\nOP_LOADNIL,/*\tA B\tR(A) := ... := R(B) := nil\t\t\t*/\nOP_GETUPVAL,/*\tA B\tR(A) := UpValue[B]\t\t\t\t*/\n\nOP_GETGLOBAL,/*\tA Bx\tR(A) := Gbl[Kst(Bx)]\t\t\t\t*/\nOP_GETTABLE,/*\tA B C\tR(A) := R(B)[RK(C)]\t\t\t\t*/\n\nOP_SETGLOBAL,/*\tA Bx\tGbl[Kst(Bx)] := R(A)\t\t\t\t*/\nOP_SETUPVAL,/*\tA B\tUpValue[B] := R(A)\t\t\t\t*/\nOP_SETTABLE,/*\tA B C\tR(A)[RK(B)] := RK(C)\t\t\t\t*/\n\nOP_NEWTABLE,/*\tA B C\tR(A) := {} (size = B,C)\t\t\t\t*/\n\nOP_SELF,/*\tA B C\tR(A+1) := R(B); R(A) := R(B)[RK(C)]\t\t*/\n\nOP_ADD,/*\tA B C\tR(A) := RK(B) + RK(C)\t\t\t\t*/\nOP_SUB,/*\tA B C\tR(A) := RK(B) - RK(C)\t\t\t\t*/\nOP_MUL,/*\tA B C\tR(A) := RK(B) * RK(C)\t\t\t\t*/\nOP_DIV,/*\tA B C\tR(A) := RK(B) / RK(C)\t\t\t\t*/\nOP_MOD,/*\tA B C\tR(A) := RK(B) % RK(C)\t\t\t\t*/\nOP_POW,/*\tA B C\tR(A) := RK(B) ^ RK(C)\t\t\t\t*/\nOP_UNM,/*\tA B\tR(A) := -R(B)\t\t\t\t\t*/\nOP_NOT,/*\tA B\tR(A) := not R(B)\t\t\t\t*/\nOP_LEN,/*\tA B\tR(A) := length of R(B)\t\t\t\t*/\n\nOP_CONCAT,/*\tA B C\tR(A) := R(B).. ... ..R(C)\t\t\t*/\n\nOP_JMP,/*\tsBx\tpc+=sBx\t\t\t\t\t*/\n\nOP_EQ,/*\tA B C\tif ((RK(B) == RK(C)) ~= A) then pc++\t\t*/\nOP_LT,/*\tA B C\tif ((RK(B) <  RK(C)) ~= A) then pc++  \t\t*/\nOP_LE,/*\tA B C\tif ((RK(B) <= RK(C)) ~= A) then pc++  \t\t*/\n\nOP_TEST,/*\tA C\tif not (R(A) <=> C) then pc++\t\t\t*/ \nOP_TESTSET,/*\tA B C\tif (R(B) <=> C) then R(A) := R(B) else pc++\t*/ \n\nOP_CALL,/*\tA B C\tR(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */\nOP_TAILCALL,/*\tA B C\treturn R(A)(R(A+1), ... ,R(A+B-1))\t\t*/\nOP_RETURN,/*\tA B\treturn R(A), ... ,R(A+B-2)\t(see note)\t*/\n\nOP_FORLOOP,/*\tA sBx\tR(A)+=R(A+2);\n\t\t\tif R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/\nOP_FORPREP,/*\tA sBx\tR(A)-=R(A+2); pc+=sBx\t\t\t\t*/\n\nOP_TFORLOOP,/*\tA C\tR(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); \n                        if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++\t*/ \nOP_SETLIST,/*\tA B C\tR(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B\t*/\n\nOP_CLOSE,/*\tA \tclose all variables in the stack up to (>=) R(A)*/\nOP_CLOSURE,/*\tA Bx\tR(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n))\t*/\n\nOP_VARARG/*\tA B\tR(A), R(A+1), ..., R(A+B-1) = vararg\t\t*/\n} OpCode;\n\n\n#define NUM_OPCODES\t(cast(int, OP_VARARG) + 1)\n\n\n\n/*===========================================================================\n  Notes:\n  (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1,\n      and can be 0: OP_CALL then sets `top' to last_result+1, so\n      next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'.\n\n  (*) In OP_VARARG, if (B == 0) then use actual number of varargs and\n      set top (like in OP_CALL with C == 0).\n\n  (*) In OP_RETURN, if (B == 0) then return up to `top'\n\n  (*) In OP_SETLIST, if (B == 0) then B = `top';\n      if (C == 0) then next `instruction' is real C\n\n  (*) For comparisons, A specifies what condition the test should accept\n      (true or false).\n\n  (*) All `skips' (pc++) assume that next instruction is a jump\n===========================================================================*/\n\n\n/*\n** masks for instruction properties. The format is:\n** bits 0-1: op mode\n** bits 2-3: C arg mode\n** bits 4-5: B arg mode\n** bit 6: instruction set register A\n** bit 7: operator is a test\n*/  \n\nenum OpArgMask {\n  OpArgN,  /* argument is not used */\n  OpArgU,  /* argument is used */\n  OpArgR,  /* argument is a register or a jump offset */\n  OpArgK   /* argument is a constant or register/constant */\n};\n\nLUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES];\n\n#define getOpMode(m)\t(cast(enum OpMode, luaP_opmodes[m] & 3))\n#define getBMode(m)\t(cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))\n#define getCMode(m)\t(cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))\n#define testAMode(m)\t(luaP_opmodes[m] & (1 << 6))\n#define testTMode(m)\t(luaP_opmodes[m] & (1 << 7))\n\n\nLUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1];  /* opcode names */\n\n\n/* number of list items to accumulate before a SETLIST instruction */\n#define LFIELDS_PER_FLUSH\t50\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/loslib.c",
    "content": "/*\n** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $\n** Standard Operating System library\n** See Copyright Notice in lua.h\n*/\n\n\n#include <errno.h>\n#include <locale.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n\n#define loslib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\nstatic int os_pushresult (lua_State *L, int i, const char *filename) {\n  int en = errno;  /* calls to Lua API may change this value */\n  if (i) {\n    lua_pushboolean(L, 1);\n    return 1;\n  }\n  else {\n    lua_pushnil(L);\n    lua_pushfstring(L, \"%s: %s\", filename, strerror(en));\n    lua_pushinteger(L, en);\n    return 3;\n  }\n}\n\n\n#ifndef __native_client__\nstatic int os_execute (lua_State *L) {\n  lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));\n  return 1;\n}\n#endif\n\n\nstatic int os_remove (lua_State *L) {\n  const char *filename = luaL_checkstring(L, 1);\n  return os_pushresult(L, remove(filename) == 0, filename);\n}\n\n\nstatic int os_rename (lua_State *L) {\n  const char *fromname = luaL_checkstring(L, 1);\n  const char *toname = luaL_checkstring(L, 2);\n  return os_pushresult(L, rename(fromname, toname) == 0, fromname);\n}\n\n\nstatic int os_tmpname (lua_State *L) {\n  char buff[LUA_TMPNAMBUFSIZE];\n  int err;\n  lua_tmpnam(buff, err);\n  if (err)\n    return luaL_error(L, \"unable to generate a unique filename\");\n  lua_pushstring(L, buff);\n  return 1;\n}\n\n\nstatic int os_getenv (lua_State *L) {\n  lua_pushstring(L, getenv(luaL_checkstring(L, 1)));  /* if NULL push nil */\n  return 1;\n}\n\n\nstatic int os_clock (lua_State *L) {\n  lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC);\n  return 1;\n}\n\n\n/*\n** {======================================================\n** Time/Date operations\n** { year=%Y, month=%m, day=%d, hour=%H, min=%M, sec=%S,\n**   wday=%w+1, yday=%j, isdst=? }\n** =======================================================\n*/\n\nstatic void setfield (lua_State *L, const char *key, int value) {\n  lua_pushinteger(L, value);\n  lua_setfield(L, -2, key);\n}\n\nstatic void setboolfield (lua_State *L, const char *key, int value) {\n  if (value < 0)  /* undefined? */\n    return;  /* does not set field */\n  lua_pushboolean(L, value);\n  lua_setfield(L, -2, key);\n}\n\nstatic int getboolfield (lua_State *L, const char *key) {\n  int res;\n  lua_getfield(L, -1, key);\n  res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1);\n  lua_pop(L, 1);\n  return res;\n}\n\n\nstatic int getfield (lua_State *L, const char *key, int d) {\n  int res;\n  lua_getfield(L, -1, key);\n  if (lua_isnumber(L, -1))\n    res = (int)lua_tointeger(L, -1);\n  else {\n    if (d < 0)\n      return luaL_error(L, \"field \" LUA_QS \" missing in date table\", key);\n    res = d;\n  }\n  lua_pop(L, 1);\n  return res;\n}\n\n\nstatic int os_date (lua_State *L) {\n  const char *s = luaL_optstring(L, 1, \"%c\");\n  time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL));\n  struct tm *stm;\n  if (*s == '!') {  /* UTC? */\n    stm = gmtime(&t);\n    s++;  /* skip `!' */\n  }\n  else\n    stm = localtime(&t);\n  if (stm == NULL)  /* invalid date? */\n    lua_pushnil(L);\n  else if (strcmp(s, \"*t\") == 0) {\n    lua_createtable(L, 0, 9);  /* 9 = number of fields */\n    setfield(L, \"sec\", stm->tm_sec);\n    setfield(L, \"min\", stm->tm_min);\n    setfield(L, \"hour\", stm->tm_hour);\n    setfield(L, \"day\", stm->tm_mday);\n    setfield(L, \"month\", stm->tm_mon+1);\n    setfield(L, \"year\", stm->tm_year+1900);\n    setfield(L, \"wday\", stm->tm_wday+1);\n    setfield(L, \"yday\", stm->tm_yday+1);\n    setboolfield(L, \"isdst\", stm->tm_isdst);\n  }\n  else {\n    char cc[3];\n    luaL_Buffer b;\n    cc[0] = '%'; cc[2] = '\\0';\n    luaL_buffinit(L, &b);\n    for (; *s; s++) {\n      if (*s != '%' || *(s + 1) == '\\0')  /* no conversion specifier? */\n        luaL_addchar(&b, *s);\n      else {\n        size_t reslen;\n        char buff[200];  /* should be big enough for any conversion result */\n        cc[1] = *(++s);\n        reslen = strftime(buff, sizeof(buff), cc, stm);\n        luaL_addlstring(&b, buff, reslen);\n      }\n    }\n    luaL_pushresult(&b);\n  }\n  return 1;\n}\n\n\nstatic int os_time (lua_State *L) {\n  time_t t;\n  if (lua_isnoneornil(L, 1))  /* called without args? */\n    t = time(NULL);  /* get current time */\n  else {\n    struct tm ts;\n    luaL_checktype(L, 1, LUA_TTABLE);\n    lua_settop(L, 1);  /* make sure table is at the top */\n    ts.tm_sec = getfield(L, \"sec\", 0);\n    ts.tm_min = getfield(L, \"min\", 0);\n    ts.tm_hour = getfield(L, \"hour\", 12);\n    ts.tm_mday = getfield(L, \"day\", -1);\n    ts.tm_mon = getfield(L, \"month\", -1) - 1;\n    ts.tm_year = getfield(L, \"year\", -1) - 1900;\n    ts.tm_isdst = getboolfield(L, \"isdst\");\n    t = mktime(&ts);\n  }\n  if (t == (time_t)(-1))\n    lua_pushnil(L);\n  else\n    lua_pushnumber(L, (lua_Number)t);\n  return 1;\n}\n\n\nstatic int os_difftime (lua_State *L) {\n  lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)),\n                             (time_t)(luaL_optnumber(L, 2, 0))));\n  return 1;\n}\n\n/* }====================================================== */\n\n\nstatic int os_setlocale (lua_State *L) {\n  static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY,\n                      LC_NUMERIC, LC_TIME};\n  static const char *const catnames[] = {\"all\", \"collate\", \"ctype\", \"monetary\",\n     \"numeric\", \"time\", NULL};\n  const char *l = luaL_optstring(L, 1, NULL);\n  int op = luaL_checkoption(L, 2, \"all\", catnames);\n  lua_pushstring(L, setlocale(cat[op], l));\n  return 1;\n}\n\n\nstatic int os_exit (lua_State *L) {\n  exit(luaL_optint(L, 1, EXIT_SUCCESS));\n}\n\nstatic const luaL_Reg syslib[] = {\n  {\"clock\",     os_clock},\n  {\"date\",      os_date},\n  {\"difftime\",  os_difftime},\n#ifndef __native_client__\n  {\"execute\",   os_execute},\n#endif\n  {\"exit\",      os_exit},\n  {\"getenv\",    os_getenv},\n  {\"remove\",    os_remove},\n  {\"rename\",    os_rename},\n  {\"setlocale\", os_setlocale},\n  {\"time\",      os_time},\n  {\"tmpname\",   os_tmpname},\n  {NULL, NULL}\n};\n\n/* }====================================================== */\n\n\n\nLUALIB_API int luaopen_os (lua_State *L) {\n  luaL_register(L, LUA_OSLIBNAME, syslib);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lparser.c",
    "content": "/*\n** $Id: lparser.c,v 2.42.1.4 2011/10/21 19:31:42 roberto Exp $\n** Lua Parser\n** See Copyright Notice in lua.h\n*/\n\n\n#include <string.h>\n\n#define lparser_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lcode.h\"\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"llex.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lopcodes.h\"\n#include \"lparser.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n\n\n\n#define hasmultret(k)\t\t((k) == VCALL || (k) == VVARARG)\n\n#define getlocvar(fs, i)\t((fs)->f->locvars[(fs)->actvar[i]])\n\n#define luaY_checklimit(fs,v,l,m)\tif ((v)>(l)) errorlimit(fs,l,m)\n\n\n/*\n** nodes for block list (list of active blocks)\n*/\ntypedef struct BlockCnt {\n  struct BlockCnt *previous;  /* chain */\n  int breaklist;  /* list of jumps out of this loop */\n  lu_byte nactvar;  /* # active locals outside the breakable structure */\n  lu_byte upval;  /* true if some variable in the block is an upvalue */\n  lu_byte isbreakable;  /* true if `block' is a loop */\n} BlockCnt;\n\n\n\n/*\n** prototypes for recursive non-terminal functions\n*/\nstatic void chunk (LexState *ls);\nstatic void expr (LexState *ls, expdesc *v);\n\n\nstatic void anchor_token (LexState *ls) {\n  if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) {\n    TString *ts = ls->t.seminfo.ts;\n    luaX_newstring(ls, getstr(ts), ts->tsv.len);\n  }\n}\n\n\nstatic void error_expected (LexState *ls, int token) {\n  luaX_syntaxerror(ls,\n      luaO_pushfstring(ls->L, LUA_QS \" expected\", luaX_token2str(ls, token)));\n}\n\n\nstatic void errorlimit (FuncState *fs, int limit, const char *what) {\n  const char *msg = (fs->f->linedefined == 0) ?\n    luaO_pushfstring(fs->L, \"main function has more than %d %s\", limit, what) :\n    luaO_pushfstring(fs->L, \"function at line %d has more than %d %s\",\n                            fs->f->linedefined, limit, what);\n  luaX_lexerror(fs->ls, msg, 0);\n}\n\n\nstatic int testnext (LexState *ls, int c) {\n  if (ls->t.token == c) {\n    luaX_next(ls);\n    return 1;\n  }\n  else return 0;\n}\n\n\nstatic void check (LexState *ls, int c) {\n  if (ls->t.token != c)\n    error_expected(ls, c);\n}\n\nstatic void checknext (LexState *ls, int c) {\n  check(ls, c);\n  luaX_next(ls);\n}\n\n\n#define check_condition(ls,c,msg)\t{ if (!(c)) luaX_syntaxerror(ls, msg); }\n\n\n\nstatic void check_match (LexState *ls, int what, int who, int where) {\n  if (!testnext(ls, what)) {\n    if (where == ls->linenumber)\n      error_expected(ls, what);\n    else {\n      luaX_syntaxerror(ls, luaO_pushfstring(ls->L,\n             LUA_QS \" expected (to close \" LUA_QS \" at line %d)\",\n              luaX_token2str(ls, what), luaX_token2str(ls, who), where));\n    }\n  }\n}\n\n\nstatic TString *str_checkname (LexState *ls) {\n  TString *ts;\n  check(ls, TK_NAME);\n  ts = ls->t.seminfo.ts;\n  luaX_next(ls);\n  return ts;\n}\n\n\nstatic void init_exp (expdesc *e, expkind k, int i) {\n  e->f = e->t = NO_JUMP;\n  e->k = k;\n  e->u.s.info = i;\n}\n\n\nstatic void codestring (LexState *ls, expdesc *e, TString *s) {\n  init_exp(e, VK, luaK_stringK(ls->fs, s));\n}\n\n\nstatic void checkname(LexState *ls, expdesc *e) {\n  codestring(ls, e, str_checkname(ls));\n}\n\n\nstatic int registerlocalvar (LexState *ls, TString *varname) {\n  FuncState *fs = ls->fs;\n  Proto *f = fs->f;\n  int oldsize = f->sizelocvars;\n  luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars,\n                  LocVar, SHRT_MAX, \"too many local variables\");\n  while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL;\n  f->locvars[fs->nlocvars].varname = varname;\n  luaC_objbarrier(ls->L, f, varname);\n  return fs->nlocvars++;\n}\n\n\n#define new_localvarliteral(ls,v,n) \\\n  new_localvar(ls, luaX_newstring(ls, \"\" v, (sizeof(v)/sizeof(char))-1), n)\n\n\nstatic void new_localvar (LexState *ls, TString *name, int n) {\n  FuncState *fs = ls->fs;\n  luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, \"local variables\");\n  fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name));\n}\n\n\nstatic void adjustlocalvars (LexState *ls, int nvars) {\n  FuncState *fs = ls->fs;\n  fs->nactvar = cast_byte(fs->nactvar + nvars);\n  for (; nvars; nvars--) {\n    getlocvar(fs, fs->nactvar - nvars).startpc = fs->pc;\n  }\n}\n\n\nstatic void removevars (LexState *ls, int tolevel) {\n  FuncState *fs = ls->fs;\n  while (fs->nactvar > tolevel)\n    getlocvar(fs, --fs->nactvar).endpc = fs->pc;\n}\n\n\nstatic int indexupvalue (FuncState *fs, TString *name, expdesc *v) {\n  int i;\n  Proto *f = fs->f;\n  int oldsize = f->sizeupvalues;\n  for (i=0; i<f->nups; i++) {\n    if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) {\n      lua_assert(f->upvalues[i] == name);\n      return i;\n    }\n  }\n  /* new one */\n  luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, \"upvalues\");\n  luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues,\n                  TString *, MAX_INT, \"\");\n  while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL;\n  f->upvalues[f->nups] = name;\n  luaC_objbarrier(fs->L, f, name);\n  lua_assert(v->k == VLOCAL || v->k == VUPVAL);\n  fs->upvalues[f->nups].k = cast_byte(v->k);\n  fs->upvalues[f->nups].info = cast_byte(v->u.s.info);\n  return f->nups++;\n}\n\n\nstatic int searchvar (FuncState *fs, TString *n) {\n  int i;\n  for (i=fs->nactvar-1; i >= 0; i--) {\n    if (n == getlocvar(fs, i).varname)\n      return i;\n  }\n  return -1;  /* not found */\n}\n\n\nstatic void markupval (FuncState *fs, int level) {\n  BlockCnt *bl = fs->bl;\n  while (bl && bl->nactvar > level) bl = bl->previous;\n  if (bl) bl->upval = 1;\n}\n\n\nstatic int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) {\n  if (fs == NULL) {  /* no more levels? */\n    init_exp(var, VGLOBAL, NO_REG);  /* default is global variable */\n    return VGLOBAL;\n  }\n  else {\n    int v = searchvar(fs, n);  /* look up at current level */\n    if (v >= 0) {\n      init_exp(var, VLOCAL, v);\n      if (!base)\n        markupval(fs, v);  /* local will be used as an upval */\n      return VLOCAL;\n    }\n    else {  /* not found at current level; try upper one */\n      if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL)\n        return VGLOBAL;\n      var->u.s.info = indexupvalue(fs, n, var);  /* else was LOCAL or UPVAL */\n      var->k = VUPVAL;  /* upvalue in this level */\n      return VUPVAL;\n    }\n  }\n}\n\n\nstatic void singlevar (LexState *ls, expdesc *var) {\n  TString *varname = str_checkname(ls);\n  FuncState *fs = ls->fs;\n  if (singlevaraux(fs, varname, var, 1) == VGLOBAL)\n    var->u.s.info = luaK_stringK(fs, varname);  /* info points to global name */\n}\n\n\nstatic void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) {\n  FuncState *fs = ls->fs;\n  int extra = nvars - nexps;\n  if (hasmultret(e->k)) {\n    extra++;  /* includes call itself */\n    if (extra < 0) extra = 0;\n    luaK_setreturns(fs, e, extra);  /* last exp. provides the difference */\n    if (extra > 1) luaK_reserveregs(fs, extra-1);\n  }\n  else {\n    if (e->k != VVOID) luaK_exp2nextreg(fs, e);  /* close last expression */\n    if (extra > 0) {\n      int reg = fs->freereg;\n      luaK_reserveregs(fs, extra);\n      luaK_nil(fs, reg, extra);\n    }\n  }\n}\n\n\nstatic void enterlevel (LexState *ls) {\n  if (++ls->L->nCcalls > LUAI_MAXCCALLS)\n\tluaX_lexerror(ls, \"chunk has too many syntax levels\", 0);\n}\n\n\n#define leavelevel(ls)\t((ls)->L->nCcalls--)\n\n\nstatic void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) {\n  bl->breaklist = NO_JUMP;\n  bl->isbreakable = isbreakable;\n  bl->nactvar = fs->nactvar;\n  bl->upval = 0;\n  bl->previous = fs->bl;\n  fs->bl = bl;\n  lua_assert(fs->freereg == fs->nactvar);\n}\n\n\nstatic void leaveblock (FuncState *fs) {\n  BlockCnt *bl = fs->bl;\n  fs->bl = bl->previous;\n  removevars(fs->ls, bl->nactvar);\n  if (bl->upval)\n    luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);\n  /* a block either controls scope or breaks (never both) */\n  lua_assert(!bl->isbreakable || !bl->upval);\n  lua_assert(bl->nactvar == fs->nactvar);\n  fs->freereg = fs->nactvar;  /* free registers */\n  luaK_patchtohere(fs, bl->breaklist);\n}\n\n\nstatic void pushclosure (LexState *ls, FuncState *func, expdesc *v) {\n  FuncState *fs = ls->fs;\n  Proto *f = fs->f;\n  int oldsize = f->sizep;\n  int i;\n  luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *,\n                  MAXARG_Bx, \"constant table overflow\");\n  while (oldsize < f->sizep) f->p[oldsize++] = NULL;\n  f->p[fs->np++] = func->f;\n  luaC_objbarrier(ls->L, f, func->f);\n  init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1));\n  for (i=0; i<func->f->nups; i++) {\n    OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL;\n    luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0);\n  }\n}\n\n\nstatic void open_func (LexState *ls, FuncState *fs) {\n  lua_State *L = ls->L;\n  Proto *f = luaF_newproto(L);\n  fs->f = f;\n  fs->prev = ls->fs;  /* linked list of funcstates */\n  fs->ls = ls;\n  fs->L = L;\n  ls->fs = fs;\n  fs->pc = 0;\n  fs->lasttarget = -1;\n  fs->jpc = NO_JUMP;\n  fs->freereg = 0;\n  fs->nk = 0;\n  fs->np = 0;\n  fs->nlocvars = 0;\n  fs->nactvar = 0;\n  fs->bl = NULL;\n  f->source = ls->source;\n  f->maxstacksize = 2;  /* registers 0/1 are always valid */\n  fs->h = luaH_new(L, 0, 0);\n  /* anchor table of constants and prototype (to avoid being collected) */\n  sethvalue2s(L, L->top, fs->h);\n  incr_top(L);\n  setptvalue2s(L, L->top, f);\n  incr_top(L);\n}\n\n\nstatic void close_func (LexState *ls) {\n  lua_State *L = ls->L;\n  FuncState *fs = ls->fs;\n  Proto *f = fs->f;\n  removevars(ls, 0);\n  luaK_ret(fs, 0, 0);  /* final return */\n  luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction);\n  f->sizecode = fs->pc;\n  luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int);\n  f->sizelineinfo = fs->pc;\n  luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue);\n  f->sizek = fs->nk;\n  luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);\n  f->sizep = fs->np;\n  luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);\n  f->sizelocvars = fs->nlocvars;\n  luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *);\n  f->sizeupvalues = f->nups;\n  lua_assert(luaG_checkcode(f));\n  lua_assert(fs->bl == NULL);\n  ls->fs = fs->prev;\n  /* last token read was anchored in defunct function; must reanchor it */\n  if (fs) anchor_token(ls);\n  L->top -= 2;  /* remove table and prototype from the stack */\n}\n\n\nProto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {\n  struct LexState lexstate;\n  struct FuncState funcstate;\n  lexstate.buff = buff;\n  luaX_setinput(L, &lexstate, z, luaS_new(L, name));\n  open_func(&lexstate, &funcstate);\n  funcstate.f->is_vararg = VARARG_ISVARARG;  /* main func. is always vararg */\n  luaX_next(&lexstate);  /* read first token */\n  chunk(&lexstate);\n  check(&lexstate, TK_EOS);\n  close_func(&lexstate);\n  lua_assert(funcstate.prev == NULL);\n  lua_assert(funcstate.f->nups == 0);\n  lua_assert(lexstate.fs == NULL);\n  return funcstate.f;\n}\n\n\n\n/*============================================================*/\n/* GRAMMAR RULES */\n/*============================================================*/\n\n\nstatic void field (LexState *ls, expdesc *v) {\n  /* field -> ['.' | ':'] NAME */\n  FuncState *fs = ls->fs;\n  expdesc key;\n  luaK_exp2anyreg(fs, v);\n  luaX_next(ls);  /* skip the dot or colon */\n  checkname(ls, &key);\n  luaK_indexed(fs, v, &key);\n}\n\n\nstatic void yindex (LexState *ls, expdesc *v) {\n  /* index -> '[' expr ']' */\n  luaX_next(ls);  /* skip the '[' */\n  expr(ls, v);\n  luaK_exp2val(ls->fs, v);\n  checknext(ls, ']');\n}\n\n\n/*\n** {======================================================================\n** Rules for Constructors\n** =======================================================================\n*/\n\n\nstruct ConsControl {\n  expdesc v;  /* last list item read */\n  expdesc *t;  /* table descriptor */\n  int nh;  /* total number of `record' elements */\n  int na;  /* total number of array elements */\n  int tostore;  /* number of array elements pending to be stored */\n};\n\n\nstatic void recfield (LexState *ls, struct ConsControl *cc) {\n  /* recfield -> (NAME | `['exp1`]') = exp1 */\n  FuncState *fs = ls->fs;\n  int reg = ls->fs->freereg;\n  expdesc key, val;\n  int rkkey;\n  if (ls->t.token == TK_NAME) {\n    luaY_checklimit(fs, cc->nh, MAX_INT, \"items in a constructor\");\n    checkname(ls, &key);\n  }\n  else  /* ls->t.token == '[' */\n    yindex(ls, &key);\n  cc->nh++;\n  checknext(ls, '=');\n  rkkey = luaK_exp2RK(fs, &key);\n  expr(ls, &val);\n  luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val));\n  fs->freereg = reg;  /* free registers */\n}\n\n\nstatic void closelistfield (FuncState *fs, struct ConsControl *cc) {\n  if (cc->v.k == VVOID) return;  /* there is no list item */\n  luaK_exp2nextreg(fs, &cc->v);\n  cc->v.k = VVOID;\n  if (cc->tostore == LFIELDS_PER_FLUSH) {\n    luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore);  /* flush */\n    cc->tostore = 0;  /* no more items pending */\n  }\n}\n\n\nstatic void lastlistfield (FuncState *fs, struct ConsControl *cc) {\n  if (cc->tostore == 0) return;\n  if (hasmultret(cc->v.k)) {\n    luaK_setmultret(fs, &cc->v);\n    luaK_setlist(fs, cc->t->u.s.info, cc->na, LUA_MULTRET);\n    cc->na--;  /* do not count last expression (unknown number of elements) */\n  }\n  else {\n    if (cc->v.k != VVOID)\n      luaK_exp2nextreg(fs, &cc->v);\n    luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore);\n  }\n}\n\n\nstatic void listfield (LexState *ls, struct ConsControl *cc) {\n  expr(ls, &cc->v);\n  luaY_checklimit(ls->fs, cc->na, MAX_INT, \"items in a constructor\");\n  cc->na++;\n  cc->tostore++;\n}\n\n\nstatic void constructor (LexState *ls, expdesc *t) {\n  /* constructor -> ?? */\n  FuncState *fs = ls->fs;\n  int line = ls->linenumber;\n  int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0);\n  struct ConsControl cc;\n  cc.na = cc.nh = cc.tostore = 0;\n  cc.t = t;\n  init_exp(t, VRELOCABLE, pc);\n  init_exp(&cc.v, VVOID, 0);  /* no value (yet) */\n  luaK_exp2nextreg(ls->fs, t);  /* fix it at stack top (for gc) */\n  checknext(ls, '{');\n  do {\n    lua_assert(cc.v.k == VVOID || cc.tostore > 0);\n    if (ls->t.token == '}') break;\n    closelistfield(fs, &cc);\n    switch(ls->t.token) {\n      case TK_NAME: {  /* may be listfields or recfields */\n        luaX_lookahead(ls);\n        if (ls->lookahead.token != '=')  /* expression? */\n          listfield(ls, &cc);\n        else\n          recfield(ls, &cc);\n        break;\n      }\n      case '[': {  /* constructor_item -> recfield */\n        recfield(ls, &cc);\n        break;\n      }\n      default: {  /* constructor_part -> listfield */\n        listfield(ls, &cc);\n        break;\n      }\n    }\n  } while (testnext(ls, ',') || testnext(ls, ';'));\n  check_match(ls, '}', '{', line);\n  lastlistfield(fs, &cc);\n  SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */\n  SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh));  /* set initial table size */\n}\n\n/* }====================================================================== */\n\n\n\nstatic void parlist (LexState *ls) {\n  /* parlist -> [ param { `,' param } ] */\n  FuncState *fs = ls->fs;\n  Proto *f = fs->f;\n  int nparams = 0;\n  f->is_vararg = 0;\n  if (ls->t.token != ')') {  /* is `parlist' not empty? */\n    do {\n      switch (ls->t.token) {\n        case TK_NAME: {  /* param -> NAME */\n          new_localvar(ls, str_checkname(ls), nparams++);\n          break;\n        }\n        case TK_DOTS: {  /* param -> `...' */\n          luaX_next(ls);\n#if defined(LUA_COMPAT_VARARG)\n          /* use `arg' as default name */\n          new_localvarliteral(ls, \"arg\", nparams++);\n          f->is_vararg = VARARG_HASARG | VARARG_NEEDSARG;\n#endif\n          f->is_vararg |= VARARG_ISVARARG;\n          break;\n        }\n        default: luaX_syntaxerror(ls, \"<name> or \" LUA_QL(\"...\") \" expected\");\n      }\n    } while (!f->is_vararg && testnext(ls, ','));\n  }\n  adjustlocalvars(ls, nparams);\n  f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG));\n  luaK_reserveregs(fs, fs->nactvar);  /* reserve register for parameters */\n}\n\n\nstatic void body (LexState *ls, expdesc *e, int needself, int line) {\n  /* body ->  `(' parlist `)' chunk END */\n  FuncState new_fs;\n  open_func(ls, &new_fs);\n  new_fs.f->linedefined = line;\n  checknext(ls, '(');\n  if (needself) {\n    new_localvarliteral(ls, \"self\", 0);\n    adjustlocalvars(ls, 1);\n  }\n  parlist(ls);\n  checknext(ls, ')');\n  chunk(ls);\n  new_fs.f->lastlinedefined = ls->linenumber;\n  check_match(ls, TK_END, TK_FUNCTION, line);\n  close_func(ls);\n  pushclosure(ls, &new_fs, e);\n}\n\n\nstatic int explist1 (LexState *ls, expdesc *v) {\n  /* explist1 -> expr { `,' expr } */\n  int n = 1;  /* at least one expression */\n  expr(ls, v);\n  while (testnext(ls, ',')) {\n    luaK_exp2nextreg(ls->fs, v);\n    expr(ls, v);\n    n++;\n  }\n  return n;\n}\n\n\nstatic void funcargs (LexState *ls, expdesc *f) {\n  FuncState *fs = ls->fs;\n  expdesc args;\n  int base, nparams;\n  int line = ls->linenumber;\n  switch (ls->t.token) {\n    case '(': {  /* funcargs -> `(' [ explist1 ] `)' */\n      if (line != ls->lastline)\n        luaX_syntaxerror(ls,\"ambiguous syntax (function call x new statement)\");\n      luaX_next(ls);\n      if (ls->t.token == ')')  /* arg list is empty? */\n        args.k = VVOID;\n      else {\n        explist1(ls, &args);\n        luaK_setmultret(fs, &args);\n      }\n      check_match(ls, ')', '(', line);\n      break;\n    }\n    case '{': {  /* funcargs -> constructor */\n      constructor(ls, &args);\n      break;\n    }\n    case TK_STRING: {  /* funcargs -> STRING */\n      codestring(ls, &args, ls->t.seminfo.ts);\n      luaX_next(ls);  /* must use `seminfo' before `next' */\n      break;\n    }\n    default: {\n      luaX_syntaxerror(ls, \"function arguments expected\");\n      return;\n    }\n  }\n  lua_assert(f->k == VNONRELOC);\n  base = f->u.s.info;  /* base register for call */\n  if (hasmultret(args.k))\n    nparams = LUA_MULTRET;  /* open call */\n  else {\n    if (args.k != VVOID)\n      luaK_exp2nextreg(fs, &args);  /* close last argument */\n    nparams = fs->freereg - (base+1);\n  }\n  init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2));\n  luaK_fixline(fs, line);\n  fs->freereg = base+1;  /* call remove function and arguments and leaves\n                            (unless changed) one result */\n}\n\n\n\n\n/*\n** {======================================================================\n** Expression parsing\n** =======================================================================\n*/\n\n\nstatic void prefixexp (LexState *ls, expdesc *v) {\n  /* prefixexp -> NAME | '(' expr ')' */\n  switch (ls->t.token) {\n    case '(': {\n      int line = ls->linenumber;\n      luaX_next(ls);\n      expr(ls, v);\n      check_match(ls, ')', '(', line);\n      luaK_dischargevars(ls->fs, v);\n      return;\n    }\n    case TK_NAME: {\n      singlevar(ls, v);\n      return;\n    }\n    default: {\n      luaX_syntaxerror(ls, \"unexpected symbol\");\n      return;\n    }\n  }\n}\n\n\nstatic void primaryexp (LexState *ls, expdesc *v) {\n  /* primaryexp ->\n        prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */\n  FuncState *fs = ls->fs;\n  prefixexp(ls, v);\n  for (;;) {\n    switch (ls->t.token) {\n      case '.': {  /* field */\n        field(ls, v);\n        break;\n      }\n      case '[': {  /* `[' exp1 `]' */\n        expdesc key;\n        luaK_exp2anyreg(fs, v);\n        yindex(ls, &key);\n        luaK_indexed(fs, v, &key);\n        break;\n      }\n      case ':': {  /* `:' NAME funcargs */\n        expdesc key;\n        luaX_next(ls);\n        checkname(ls, &key);\n        luaK_self(fs, v, &key);\n        funcargs(ls, v);\n        break;\n      }\n      case '(': case TK_STRING: case '{': {  /* funcargs */\n        luaK_exp2nextreg(fs, v);\n        funcargs(ls, v);\n        break;\n      }\n      default: return;\n    }\n  }\n}\n\n\nstatic void simpleexp (LexState *ls, expdesc *v) {\n  /* simpleexp -> NUMBER | STRING | NIL | true | false | ... |\n                  constructor | FUNCTION body | primaryexp */\n  switch (ls->t.token) {\n    case TK_NUMBER: {\n      init_exp(v, VKNUM, 0);\n      v->u.nval = ls->t.seminfo.r;\n      break;\n    }\n    case TK_STRING: {\n      codestring(ls, v, ls->t.seminfo.ts);\n      break;\n    }\n    case TK_NIL: {\n      init_exp(v, VNIL, 0);\n      break;\n    }\n    case TK_TRUE: {\n      init_exp(v, VTRUE, 0);\n      break;\n    }\n    case TK_FALSE: {\n      init_exp(v, VFALSE, 0);\n      break;\n    }\n    case TK_DOTS: {  /* vararg */\n      FuncState *fs = ls->fs;\n      check_condition(ls, fs->f->is_vararg,\n                      \"cannot use \" LUA_QL(\"...\") \" outside a vararg function\");\n      fs->f->is_vararg &= ~VARARG_NEEDSARG;  /* don't need 'arg' */\n      init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0));\n      break;\n    }\n    case '{': {  /* constructor */\n      constructor(ls, v);\n      return;\n    }\n    case TK_FUNCTION: {\n      luaX_next(ls);\n      body(ls, v, 0, ls->linenumber);\n      return;\n    }\n    default: {\n      primaryexp(ls, v);\n      return;\n    }\n  }\n  luaX_next(ls);\n}\n\n\nstatic UnOpr getunopr (int op) {\n  switch (op) {\n    case TK_NOT: return OPR_NOT;\n    case '-': return OPR_MINUS;\n    case '#': return OPR_LEN;\n    default: return OPR_NOUNOPR;\n  }\n}\n\n\nstatic BinOpr getbinopr (int op) {\n  switch (op) {\n    case '+': return OPR_ADD;\n    case '-': return OPR_SUB;\n    case '*': return OPR_MUL;\n    case '/': return OPR_DIV;\n    case '%': return OPR_MOD;\n    case '^': return OPR_POW;\n    case TK_CONCAT: return OPR_CONCAT;\n    case TK_NE: return OPR_NE;\n    case TK_EQ: return OPR_EQ;\n    case '<': return OPR_LT;\n    case TK_LE: return OPR_LE;\n    case '>': return OPR_GT;\n    case TK_GE: return OPR_GE;\n    case TK_AND: return OPR_AND;\n    case TK_OR: return OPR_OR;\n    default: return OPR_NOBINOPR;\n  }\n}\n\n\nstatic const struct {\n  lu_byte left;  /* left priority for each binary operator */\n  lu_byte right; /* right priority */\n} priority[] = {  /* ORDER OPR */\n   {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7},  /* `+' `-' `/' `%' */\n   {10, 9}, {5, 4},                 /* power and concat (right associative) */\n   {3, 3}, {3, 3},                  /* equality and inequality */\n   {3, 3}, {3, 3}, {3, 3}, {3, 3},  /* order */\n   {2, 2}, {1, 1}                   /* logical (and/or) */\n};\n\n#define UNARY_PRIORITY\t8  /* priority for unary operators */\n\n\n/*\n** subexpr -> (simpleexp | unop subexpr) { binop subexpr }\n** where `binop' is any binary operator with a priority higher than `limit'\n*/\nstatic BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) {\n  BinOpr op;\n  UnOpr uop;\n  enterlevel(ls);\n  uop = getunopr(ls->t.token);\n  if (uop != OPR_NOUNOPR) {\n    luaX_next(ls);\n    subexpr(ls, v, UNARY_PRIORITY);\n    luaK_prefix(ls->fs, uop, v);\n  }\n  else simpleexp(ls, v);\n  /* expand while operators have priorities higher than `limit' */\n  op = getbinopr(ls->t.token);\n  while (op != OPR_NOBINOPR && priority[op].left > limit) {\n    expdesc v2;\n    BinOpr nextop;\n    luaX_next(ls);\n    luaK_infix(ls->fs, op, v);\n    /* read sub-expression with higher priority */\n    nextop = subexpr(ls, &v2, priority[op].right);\n    luaK_posfix(ls->fs, op, v, &v2);\n    op = nextop;\n  }\n  leavelevel(ls);\n  return op;  /* return first untreated operator */\n}\n\n\nstatic void expr (LexState *ls, expdesc *v) {\n  subexpr(ls, v, 0);\n}\n\n/* }==================================================================== */\n\n\n\n/*\n** {======================================================================\n** Rules for Statements\n** =======================================================================\n*/\n\n\nstatic int block_follow (int token) {\n  switch (token) {\n    case TK_ELSE: case TK_ELSEIF: case TK_END:\n    case TK_UNTIL: case TK_EOS:\n      return 1;\n    default: return 0;\n  }\n}\n\n\nstatic void block (LexState *ls) {\n  /* block -> chunk */\n  FuncState *fs = ls->fs;\n  BlockCnt bl;\n  enterblock(fs, &bl, 0);\n  chunk(ls);\n  lua_assert(bl.breaklist == NO_JUMP);\n  leaveblock(fs);\n}\n\n\n/*\n** structure to chain all variables in the left-hand side of an\n** assignment\n*/\nstruct LHS_assign {\n  struct LHS_assign *prev;\n  expdesc v;  /* variable (global, local, upvalue, or indexed) */\n};\n\n\n/*\n** check whether, in an assignment to a local variable, the local variable\n** is needed in a previous assignment (to a table). If so, save original\n** local value in a safe place and use this safe copy in the previous\n** assignment.\n*/\nstatic void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) {\n  FuncState *fs = ls->fs;\n  int extra = fs->freereg;  /* eventual position to save local variable */\n  int conflict = 0;\n  for (; lh; lh = lh->prev) {\n    if (lh->v.k == VINDEXED) {\n      if (lh->v.u.s.info == v->u.s.info) {  /* conflict? */\n        conflict = 1;\n        lh->v.u.s.info = extra;  /* previous assignment will use safe copy */\n      }\n      if (lh->v.u.s.aux == v->u.s.info) {  /* conflict? */\n        conflict = 1;\n        lh->v.u.s.aux = extra;  /* previous assignment will use safe copy */\n      }\n    }\n  }\n  if (conflict) {\n    luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0);  /* make copy */\n    luaK_reserveregs(fs, 1);\n  }\n}\n\n\nstatic void assignment (LexState *ls, struct LHS_assign *lh, int nvars) {\n  expdesc e;\n  check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED,\n                      \"syntax error\");\n  if (testnext(ls, ',')) {  /* assignment -> `,' primaryexp assignment */\n    struct LHS_assign nv;\n    nv.prev = lh;\n    primaryexp(ls, &nv.v);\n    if (nv.v.k == VLOCAL)\n      check_conflict(ls, lh, &nv.v);\n    luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls,\n                    \"variables in assignment\");\n    assignment(ls, &nv, nvars+1);\n  }\n  else {  /* assignment -> `=' explist1 */\n    int nexps;\n    checknext(ls, '=');\n    nexps = explist1(ls, &e);\n    if (nexps != nvars) {\n      adjust_assign(ls, nvars, nexps, &e);\n      if (nexps > nvars)\n        ls->fs->freereg -= nexps - nvars;  /* remove extra values */\n    }\n    else {\n      luaK_setoneret(ls->fs, &e);  /* close last expression */\n      luaK_storevar(ls->fs, &lh->v, &e);\n      return;  /* avoid default */\n    }\n  }\n  init_exp(&e, VNONRELOC, ls->fs->freereg-1);  /* default assignment */\n  luaK_storevar(ls->fs, &lh->v, &e);\n}\n\n\nstatic int cond (LexState *ls) {\n  /* cond -> exp */\n  expdesc v;\n  expr(ls, &v);  /* read condition */\n  if (v.k == VNIL) v.k = VFALSE;  /* `falses' are all equal here */\n  luaK_goiftrue(ls->fs, &v);\n  return v.f;\n}\n\n\nstatic void breakstat (LexState *ls) {\n  FuncState *fs = ls->fs;\n  BlockCnt *bl = fs->bl;\n  int upval = 0;\n  while (bl && !bl->isbreakable) {\n    upval |= bl->upval;\n    bl = bl->previous;\n  }\n  if (!bl)\n    luaX_syntaxerror(ls, \"no loop to break\");\n  if (upval)\n    luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);\n  luaK_concat(fs, &bl->breaklist, luaK_jump(fs));\n}\n\n\nstatic void whilestat (LexState *ls, int line) {\n  /* whilestat -> WHILE cond DO block END */\n  FuncState *fs = ls->fs;\n  int whileinit;\n  int condexit;\n  BlockCnt bl;\n  luaX_next(ls);  /* skip WHILE */\n  whileinit = luaK_getlabel(fs);\n  condexit = cond(ls);\n  enterblock(fs, &bl, 1);\n  checknext(ls, TK_DO);\n  block(ls);\n  luaK_patchlist(fs, luaK_jump(fs), whileinit);\n  check_match(ls, TK_END, TK_WHILE, line);\n  leaveblock(fs);\n  luaK_patchtohere(fs, condexit);  /* false conditions finish the loop */\n}\n\n\nstatic void repeatstat (LexState *ls, int line) {\n  /* repeatstat -> REPEAT block UNTIL cond */\n  int condexit;\n  FuncState *fs = ls->fs;\n  int repeat_init = luaK_getlabel(fs);\n  BlockCnt bl1, bl2;\n  enterblock(fs, &bl1, 1);  /* loop block */\n  enterblock(fs, &bl2, 0);  /* scope block */\n  luaX_next(ls);  /* skip REPEAT */\n  chunk(ls);\n  check_match(ls, TK_UNTIL, TK_REPEAT, line);\n  condexit = cond(ls);  /* read condition (inside scope block) */\n  if (!bl2.upval) {  /* no upvalues? */\n    leaveblock(fs);  /* finish scope */\n    luaK_patchlist(ls->fs, condexit, repeat_init);  /* close the loop */\n  }\n  else {  /* complete semantics when there are upvalues */\n    breakstat(ls);  /* if condition then break */\n    luaK_patchtohere(ls->fs, condexit);  /* else... */\n    leaveblock(fs);  /* finish scope... */\n    luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init);  /* and repeat */\n  }\n  leaveblock(fs);  /* finish loop */\n}\n\n\nstatic int exp1 (LexState *ls) {\n  expdesc e;\n  int k;\n  expr(ls, &e);\n  k = e.k;\n  luaK_exp2nextreg(ls->fs, &e);\n  return k;\n}\n\n\nstatic void forbody (LexState *ls, int base, int line, int nvars, int isnum) {\n  /* forbody -> DO block */\n  BlockCnt bl;\n  FuncState *fs = ls->fs;\n  int prep, endfor;\n  adjustlocalvars(ls, 3);  /* control variables */\n  checknext(ls, TK_DO);\n  prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs);\n  enterblock(fs, &bl, 0);  /* scope for declared variables */\n  adjustlocalvars(ls, nvars);\n  luaK_reserveregs(fs, nvars);\n  block(ls);\n  leaveblock(fs);  /* end of scope for declared variables */\n  luaK_patchtohere(fs, prep);\n  endfor = (isnum) ? luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP) :\n                     luaK_codeABC(fs, OP_TFORLOOP, base, 0, nvars);\n  luaK_fixline(fs, line);  /* pretend that `OP_FOR' starts the loop */\n  luaK_patchlist(fs, (isnum ? endfor : luaK_jump(fs)), prep + 1);\n}\n\n\nstatic void fornum (LexState *ls, TString *varname, int line) {\n  /* fornum -> NAME = exp1,exp1[,exp1] forbody */\n  FuncState *fs = ls->fs;\n  int base = fs->freereg;\n  new_localvarliteral(ls, \"(for index)\", 0);\n  new_localvarliteral(ls, \"(for limit)\", 1);\n  new_localvarliteral(ls, \"(for step)\", 2);\n  new_localvar(ls, varname, 3);\n  checknext(ls, '=');\n  exp1(ls);  /* initial value */\n  checknext(ls, ',');\n  exp1(ls);  /* limit */\n  if (testnext(ls, ','))\n    exp1(ls);  /* optional step */\n  else {  /* default step = 1 */\n    luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1));\n    luaK_reserveregs(fs, 1);\n  }\n  forbody(ls, base, line, 1, 1);\n}\n\n\nstatic void forlist (LexState *ls, TString *indexname) {\n  /* forlist -> NAME {,NAME} IN explist1 forbody */\n  FuncState *fs = ls->fs;\n  expdesc e;\n  int nvars = 0;\n  int line;\n  int base = fs->freereg;\n  /* create control variables */\n  new_localvarliteral(ls, \"(for generator)\", nvars++);\n  new_localvarliteral(ls, \"(for state)\", nvars++);\n  new_localvarliteral(ls, \"(for control)\", nvars++);\n  /* create declared variables */\n  new_localvar(ls, indexname, nvars++);\n  while (testnext(ls, ','))\n    new_localvar(ls, str_checkname(ls), nvars++);\n  checknext(ls, TK_IN);\n  line = ls->linenumber;\n  adjust_assign(ls, 3, explist1(ls, &e), &e);\n  luaK_checkstack(fs, 3);  /* extra space to call generator */\n  forbody(ls, base, line, nvars - 3, 0);\n}\n\n\nstatic void forstat (LexState *ls, int line) {\n  /* forstat -> FOR (fornum | forlist) END */\n  FuncState *fs = ls->fs;\n  TString *varname;\n  BlockCnt bl;\n  enterblock(fs, &bl, 1);  /* scope for loop and control variables */\n  luaX_next(ls);  /* skip `for' */\n  varname = str_checkname(ls);  /* first variable name */\n  switch (ls->t.token) {\n    case '=': fornum(ls, varname, line); break;\n    case ',': case TK_IN: forlist(ls, varname); break;\n    default: luaX_syntaxerror(ls, LUA_QL(\"=\") \" or \" LUA_QL(\"in\") \" expected\");\n  }\n  check_match(ls, TK_END, TK_FOR, line);\n  leaveblock(fs);  /* loop scope (`break' jumps to this point) */\n}\n\n\nstatic int test_then_block (LexState *ls) {\n  /* test_then_block -> [IF | ELSEIF] cond THEN block */\n  int condexit;\n  luaX_next(ls);  /* skip IF or ELSEIF */\n  condexit = cond(ls);\n  checknext(ls, TK_THEN);\n  block(ls);  /* `then' part */\n  return condexit;\n}\n\n\nstatic void ifstat (LexState *ls, int line) {\n  /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */\n  FuncState *fs = ls->fs;\n  int flist;\n  int escapelist = NO_JUMP;\n  flist = test_then_block(ls);  /* IF cond THEN block */\n  while (ls->t.token == TK_ELSEIF) {\n    luaK_concat(fs, &escapelist, luaK_jump(fs));\n    luaK_patchtohere(fs, flist);\n    flist = test_then_block(ls);  /* ELSEIF cond THEN block */\n  }\n  if (ls->t.token == TK_ELSE) {\n    luaK_concat(fs, &escapelist, luaK_jump(fs));\n    luaK_patchtohere(fs, flist);\n    luaX_next(ls);  /* skip ELSE (after patch, for correct line info) */\n    block(ls);  /* `else' part */\n  }\n  else\n    luaK_concat(fs, &escapelist, flist);\n  luaK_patchtohere(fs, escapelist);\n  check_match(ls, TK_END, TK_IF, line);\n}\n\n\nstatic void localfunc (LexState *ls) {\n  expdesc v, b;\n  FuncState *fs = ls->fs;\n  new_localvar(ls, str_checkname(ls), 0);\n  init_exp(&v, VLOCAL, fs->freereg);\n  luaK_reserveregs(fs, 1);\n  adjustlocalvars(ls, 1);\n  body(ls, &b, 0, ls->linenumber);\n  luaK_storevar(fs, &v, &b);\n  /* debug information will only see the variable after this point! */\n  getlocvar(fs, fs->nactvar - 1).startpc = fs->pc;\n}\n\n\nstatic void localstat (LexState *ls) {\n  /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */\n  int nvars = 0;\n  int nexps;\n  expdesc e;\n  do {\n    new_localvar(ls, str_checkname(ls), nvars++);\n  } while (testnext(ls, ','));\n  if (testnext(ls, '='))\n    nexps = explist1(ls, &e);\n  else {\n    e.k = VVOID;\n    nexps = 0;\n  }\n  adjust_assign(ls, nvars, nexps, &e);\n  adjustlocalvars(ls, nvars);\n}\n\n\nstatic int funcname (LexState *ls, expdesc *v) {\n  /* funcname -> NAME {field} [`:' NAME] */\n  int needself = 0;\n  singlevar(ls, v);\n  while (ls->t.token == '.')\n    field(ls, v);\n  if (ls->t.token == ':') {\n    needself = 1;\n    field(ls, v);\n  }\n  return needself;\n}\n\n\nstatic void funcstat (LexState *ls, int line) {\n  /* funcstat -> FUNCTION funcname body */\n  int needself;\n  expdesc v, b;\n  luaX_next(ls);  /* skip FUNCTION */\n  needself = funcname(ls, &v);\n  body(ls, &b, needself, line);\n  luaK_storevar(ls->fs, &v, &b);\n  luaK_fixline(ls->fs, line);  /* definition `happens' in the first line */\n}\n\n\nstatic void exprstat (LexState *ls) {\n  /* stat -> func | assignment */\n  FuncState *fs = ls->fs;\n  struct LHS_assign v;\n  primaryexp(ls, &v.v);\n  if (v.v.k == VCALL)  /* stat -> func */\n    SETARG_C(getcode(fs, &v.v), 1);  /* call statement uses no results */\n  else {  /* stat -> assignment */\n    v.prev = NULL;\n    assignment(ls, &v, 1);\n  }\n}\n\n\nstatic void retstat (LexState *ls) {\n  /* stat -> RETURN explist */\n  FuncState *fs = ls->fs;\n  expdesc e;\n  int first, nret;  /* registers with returned values */\n  luaX_next(ls);  /* skip RETURN */\n  if (block_follow(ls->t.token) || ls->t.token == ';')\n    first = nret = 0;  /* return no values */\n  else {\n    nret = explist1(ls, &e);  /* optional return values */\n    if (hasmultret(e.k)) {\n      luaK_setmultret(fs, &e);\n      if (e.k == VCALL && nret == 1) {  /* tail call? */\n        SET_OPCODE(getcode(fs,&e), OP_TAILCALL);\n        lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar);\n      }\n      first = fs->nactvar;\n      nret = LUA_MULTRET;  /* return all values */\n    }\n    else {\n      if (nret == 1)  /* only one single value? */\n        first = luaK_exp2anyreg(fs, &e);\n      else {\n        luaK_exp2nextreg(fs, &e);  /* values must go to the `stack' */\n        first = fs->nactvar;  /* return all `active' values */\n        lua_assert(nret == fs->freereg - first);\n      }\n    }\n  }\n  luaK_ret(fs, first, nret);\n}\n\n\nstatic int statement (LexState *ls) {\n  int line = ls->linenumber;  /* may be needed for error messages */\n  switch (ls->t.token) {\n    case TK_IF: {  /* stat -> ifstat */\n      ifstat(ls, line);\n      return 0;\n    }\n    case TK_WHILE: {  /* stat -> whilestat */\n      whilestat(ls, line);\n      return 0;\n    }\n    case TK_DO: {  /* stat -> DO block END */\n      luaX_next(ls);  /* skip DO */\n      block(ls);\n      check_match(ls, TK_END, TK_DO, line);\n      return 0;\n    }\n    case TK_FOR: {  /* stat -> forstat */\n      forstat(ls, line);\n      return 0;\n    }\n    case TK_REPEAT: {  /* stat -> repeatstat */\n      repeatstat(ls, line);\n      return 0;\n    }\n    case TK_FUNCTION: {\n      funcstat(ls, line);  /* stat -> funcstat */\n      return 0;\n    }\n    case TK_LOCAL: {  /* stat -> localstat */\n      luaX_next(ls);  /* skip LOCAL */\n      if (testnext(ls, TK_FUNCTION))  /* local function? */\n        localfunc(ls);\n      else\n        localstat(ls);\n      return 0;\n    }\n    case TK_RETURN: {  /* stat -> retstat */\n      retstat(ls);\n      return 1;  /* must be last statement */\n    }\n    case TK_BREAK: {  /* stat -> breakstat */\n      luaX_next(ls);  /* skip BREAK */\n      breakstat(ls);\n      return 1;  /* must be last statement */\n    }\n    default: {\n      exprstat(ls);\n      return 0;  /* to avoid warnings */\n    }\n  }\n}\n\n\nstatic void chunk (LexState *ls) {\n  /* chunk -> { stat [`;'] } */\n  int islast = 0;\n  enterlevel(ls);\n  while (!islast && !block_follow(ls->t.token)) {\n    islast = statement(ls);\n    testnext(ls, ';');\n    lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg &&\n               ls->fs->freereg >= ls->fs->nactvar);\n    ls->fs->freereg = ls->fs->nactvar;  /* free registers */\n  }\n  leavelevel(ls);\n}\n\n/* }====================================================================== */\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lparser.h",
    "content": "/*\n** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $\n** Lua Parser\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lparser_h\n#define lparser_h\n\n#include \"llimits.h\"\n#include \"lobject.h\"\n#include \"lzio.h\"\n\n\n/*\n** Expression descriptor\n*/\n\ntypedef enum {\n  VVOID,\t/* no value */\n  VNIL,\n  VTRUE,\n  VFALSE,\n  VK,\t\t/* info = index of constant in `k' */\n  VKNUM,\t/* nval = numerical value */\n  VLOCAL,\t/* info = local register */\n  VUPVAL,       /* info = index of upvalue in `upvalues' */\n  VGLOBAL,\t/* info = index of table; aux = index of global name in `k' */\n  VINDEXED,\t/* info = table register; aux = index register (or `k') */\n  VJMP,\t\t/* info = instruction pc */\n  VRELOCABLE,\t/* info = instruction pc */\n  VNONRELOC,\t/* info = result register */\n  VCALL,\t/* info = instruction pc */\n  VVARARG\t/* info = instruction pc */\n} expkind;\n\ntypedef struct expdesc {\n  expkind k;\n  union {\n    struct { int info, aux; } s;\n    lua_Number nval;\n  } u;\n  int t;  /* patch list of `exit when true' */\n  int f;  /* patch list of `exit when false' */\n} expdesc;\n\n\ntypedef struct upvaldesc {\n  lu_byte k;\n  lu_byte info;\n} upvaldesc;\n\n\nstruct BlockCnt;  /* defined in lparser.c */\n\n\n/* state needed to generate code for a given function */\ntypedef struct FuncState {\n  Proto *f;  /* current function header */\n  Table *h;  /* table to find (and reuse) elements in `k' */\n  struct FuncState *prev;  /* enclosing function */\n  struct LexState *ls;  /* lexical state */\n  struct lua_State *L;  /* copy of the Lua state */\n  struct BlockCnt *bl;  /* chain of current blocks */\n  int pc;  /* next position to code (equivalent to `ncode') */\n  int lasttarget;   /* `pc' of last `jump target' */\n  int jpc;  /* list of pending jumps to `pc' */\n  int freereg;  /* first free register */\n  int nk;  /* number of elements in `k' */\n  int np;  /* number of elements in `p' */\n  short nlocvars;  /* number of elements in `locvars' */\n  lu_byte nactvar;  /* number of active local variables */\n  upvaldesc upvalues[LUAI_MAXUPVALUES];  /* upvalues */\n  unsigned short actvar[LUAI_MAXVARS];  /* declared-variable stack */\n} FuncState;\n\n\nLUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,\n                                            const char *name);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lstate.c",
    "content": "/*\n** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $\n** Global State\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stddef.h>\n\n#define lstate_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"lgc.h\"\n#include \"llex.h\"\n#include \"lmem.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"ltm.h\"\n\n\n#define state_size(x)\t(sizeof(x) + LUAI_EXTRASPACE)\n#define fromstate(l)\t(cast(lu_byte *, (l)) - LUAI_EXTRASPACE)\n#define tostate(l)   (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE))\n\n\n/*\n** Main thread combines a thread state and the global state\n*/\ntypedef struct LG {\n  lua_State l;\n  global_State g;\n} LG;\n  \n\n\nstatic void stack_init (lua_State *L1, lua_State *L) {\n  /* initialize CallInfo array */\n  L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo);\n  L1->ci = L1->base_ci;\n  L1->size_ci = BASIC_CI_SIZE;\n  L1->end_ci = L1->base_ci + L1->size_ci - 1;\n  /* initialize stack array */\n  L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue);\n  L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK;\n  L1->top = L1->stack;\n  L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1;\n  /* initialize first ci */\n  L1->ci->func = L1->top;\n  setnilvalue(L1->top++);  /* `function' entry for this `ci' */\n  L1->base = L1->ci->base = L1->top;\n  L1->ci->top = L1->top + LUA_MINSTACK;\n}\n\n\nstatic void freestack (lua_State *L, lua_State *L1) {\n  luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo);\n  luaM_freearray(L, L1->stack, L1->stacksize, TValue);\n}\n\n\n/*\n** open parts that may cause memory-allocation errors\n*/\nstatic void f_luaopen (lua_State *L, void *ud) {\n  global_State *g = G(L);\n  UNUSED(ud);\n  stack_init(L, L);  /* init stack */\n  sethvalue(L, gt(L), luaH_new(L, 0, 2));  /* table of globals */\n  sethvalue(L, registry(L), luaH_new(L, 0, 2));  /* registry */\n  luaS_resize(L, MINSTRTABSIZE);  /* initial size of string table */\n  luaT_init(L);\n  luaX_init(L);\n  luaS_fix(luaS_newliteral(L, MEMERRMSG));\n  g->GCthreshold = 4*g->totalbytes;\n}\n\n\nstatic void preinit_state (lua_State *L, global_State *g) {\n  G(L) = g;\n  L->stack = NULL;\n  L->stacksize = 0;\n  L->errorJmp = NULL;\n  L->hook = NULL;\n  L->hookmask = 0;\n  L->basehookcount = 0;\n  L->allowhook = 1;\n  resethookcount(L);\n  L->openupval = NULL;\n  L->size_ci = 0;\n  L->nCcalls = L->baseCcalls = 0;\n  L->status = 0;\n  L->base_ci = L->ci = NULL;\n  L->savedpc = NULL;\n  L->errfunc = 0;\n  setnilvalue(gt(L));\n}\n\n\nstatic void close_state (lua_State *L) {\n  global_State *g = G(L);\n  luaF_close(L, L->stack);  /* close all upvalues for this thread */\n  luaC_freeall(L);  /* collect all objects */\n  lua_assert(g->rootgc == obj2gco(L));\n  lua_assert(g->strt.nuse == 0);\n  luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *);\n  luaZ_freebuffer(L, &g->buff);\n  freestack(L, L);\n  lua_assert(g->totalbytes == sizeof(LG));\n  (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0);\n}\n\n\nlua_State *luaE_newthread (lua_State *L) {\n  lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State)));\n  luaC_link(L, obj2gco(L1), LUA_TTHREAD);\n  preinit_state(L1, G(L));\n  stack_init(L1, L);  /* init stack */\n  setobj2n(L, gt(L1), gt(L));  /* share table of globals */\n  L1->hookmask = L->hookmask;\n  L1->basehookcount = L->basehookcount;\n  L1->hook = L->hook;\n  resethookcount(L1);\n  lua_assert(iswhite(obj2gco(L1)));\n  return L1;\n}\n\n\nvoid luaE_freethread (lua_State *L, lua_State *L1) {\n  luaF_close(L1, L1->stack);  /* close all upvalues for this thread */\n  lua_assert(L1->openupval == NULL);\n  luai_userstatefree(L1);\n  freestack(L, L1);\n  luaM_freemem(L, fromstate(L1), state_size(lua_State));\n}\n\n\nLUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {\n  int i;\n  lua_State *L;\n  global_State *g;\n  void *l = (*f)(ud, NULL, 0, state_size(LG));\n  if (l == NULL) return NULL;\n  L = tostate(l);\n  g = &((LG *)L)->g;\n  L->next = NULL;\n  L->tt = LUA_TTHREAD;\n  g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT);\n  L->marked = luaC_white(g);\n  set2bits(L->marked, FIXEDBIT, SFIXEDBIT);\n  preinit_state(L, g);\n  g->frealloc = f;\n  g->ud = ud;\n  g->mainthread = L;\n  g->uvhead.u.l.prev = &g->uvhead;\n  g->uvhead.u.l.next = &g->uvhead;\n  g->GCthreshold = 0;  /* mark it as unfinished state */\n  g->strt.size = 0;\n  g->strt.nuse = 0;\n  g->strt.hash = NULL;\n  setnilvalue(registry(L));\n  luaZ_initbuffer(L, &g->buff);\n  g->panic = NULL;\n  g->gcstate = GCSpause;\n  g->rootgc = obj2gco(L);\n  g->sweepstrgc = 0;\n  g->sweepgc = &g->rootgc;\n  g->gray = NULL;\n  g->grayagain = NULL;\n  g->weak = NULL;\n  g->tmudata = NULL;\n  g->totalbytes = sizeof(LG);\n  g->gcpause = LUAI_GCPAUSE;\n  g->gcstepmul = LUAI_GCMUL;\n  g->gcdept = 0;\n  for (i=0; i<NUM_TAGS; i++) g->mt[i] = NULL;\n  if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) {\n    /* memory allocation error: free partial state */\n    close_state(L);\n    L = NULL;\n  }\n  else\n    luai_userstateopen(L);\n  return L;\n}\n\n\nstatic void callallgcTM (lua_State *L, void *ud) {\n  UNUSED(ud);\n  luaC_callGCTM(L);  /* call GC metamethods for all udata */\n}\n\n\nLUA_API void lua_close (lua_State *L) {\n  L = G(L)->mainthread;  /* only the main thread can be closed */\n  lua_lock(L);\n  luaF_close(L, L->stack);  /* close all upvalues for this thread */\n  luaC_separateudata(L, 1);  /* separate udata that have GC metamethods */\n  L->errfunc = 0;  /* no error function during GC metamethods */\n  do {  /* repeat until no more errors */\n    L->ci = L->base_ci;\n    L->base = L->top = L->ci->base;\n    L->nCcalls = L->baseCcalls = 0;\n  } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0);\n  lua_assert(G(L)->tmudata == NULL);\n  luai_userstateclose(L);\n  close_state(L);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lstate.h",
    "content": "/*\n** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $\n** Global State\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lstate_h\n#define lstate_h\n\n#include \"lua.h\"\n\n#include \"lobject.h\"\n#include \"ltm.h\"\n#include \"lzio.h\"\n\n\n\nstruct lua_longjmp;  /* defined in ldo.c */\n\n\n/* table of globals */\n#define gt(L)\t(&L->l_gt)\n\n/* registry */\n#define registry(L)\t(&G(L)->l_registry)\n\n\n/* extra stack space to handle TM calls and some other extras */\n#define EXTRA_STACK   5\n\n\n#define BASIC_CI_SIZE           8\n\n#define BASIC_STACK_SIZE        (2*LUA_MINSTACK)\n\n\n\ntypedef struct stringtable {\n  GCObject **hash;\n  lu_int32 nuse;  /* number of elements */\n  int size;\n} stringtable;\n\n\n/*\n** informations about a call\n*/\ntypedef struct CallInfo {\n  StkId base;  /* base for this function */\n  StkId func;  /* function index in the stack */\n  StkId\ttop;  /* top for this function */\n  const Instruction *savedpc;\n  int nresults;  /* expected number of results from this function */\n  int tailcalls;  /* number of tail calls lost under this entry */\n} CallInfo;\n\n\n\n#define curr_func(L)\t(clvalue(L->ci->func))\n#define ci_func(ci)\t(clvalue((ci)->func))\n#define f_isLua(ci)\t(!ci_func(ci)->c.isC)\n#define isLua(ci)\t(ttisfunction((ci)->func) && f_isLua(ci))\n\n\n/*\n** `global state', shared by all threads of this state\n*/\ntypedef struct global_State {\n  stringtable strt;  /* hash table for strings */\n  lua_Alloc frealloc;  /* function to reallocate memory */\n  void *ud;         /* auxiliary data to `frealloc' */\n  lu_byte currentwhite;\n  lu_byte gcstate;  /* state of garbage collector */\n  int sweepstrgc;  /* position of sweep in `strt' */\n  GCObject *rootgc;  /* list of all collectable objects */\n  GCObject **sweepgc;  /* position of sweep in `rootgc' */\n  GCObject *gray;  /* list of gray objects */\n  GCObject *grayagain;  /* list of objects to be traversed atomically */\n  GCObject *weak;  /* list of weak tables (to be cleared) */\n  GCObject *tmudata;  /* last element of list of userdata to be GC */\n  Mbuffer buff;  /* temporary buffer for string concatentation */\n  lu_mem GCthreshold;\n  lu_mem totalbytes;  /* number of bytes currently allocated */\n  lu_mem estimate;  /* an estimate of number of bytes actually in use */\n  lu_mem gcdept;  /* how much GC is `behind schedule' */\n  int gcpause;  /* size of pause between successive GCs */\n  int gcstepmul;  /* GC `granularity' */\n  lua_CFunction panic;  /* to be called in unprotected errors */\n  TValue l_registry;\n  struct lua_State *mainthread;\n  UpVal uvhead;  /* head of double-linked list of all open upvalues */\n  struct Table *mt[NUM_TAGS];  /* metatables for basic types */\n  TString *tmname[TM_N];  /* array with tag-method names */\n} global_State;\n\n\n/*\n** `per thread' state\n*/\nstruct lua_State {\n  CommonHeader;\n  lu_byte status;\n  StkId top;  /* first free slot in the stack */\n  StkId base;  /* base of current function */\n  global_State *l_G;\n  CallInfo *ci;  /* call info for current function */\n  const Instruction *savedpc;  /* `savedpc' of current function */\n  StkId stack_last;  /* last free slot in the stack */\n  StkId stack;  /* stack base */\n  CallInfo *end_ci;  /* points after end of ci array*/\n  CallInfo *base_ci;  /* array of CallInfo's */\n  int stacksize;\n  int size_ci;  /* size of array `base_ci' */\n  unsigned short nCcalls;  /* number of nested C calls */\n  unsigned short baseCcalls;  /* nested C calls when resuming coroutine */\n  lu_byte hookmask;\n  lu_byte allowhook;\n  int basehookcount;\n  int hookcount;\n  lua_Hook hook;\n  TValue l_gt;  /* table of globals */\n  TValue env;  /* temporary place for environments */\n  GCObject *openupval;  /* list of open upvalues in this stack */\n  GCObject *gclist;\n  struct lua_longjmp *errorJmp;  /* current error recover point */\n  ptrdiff_t errfunc;  /* current error handling function (stack index) */\n};\n\n\n#define G(L)\t(L->l_G)\n\n\n/*\n** Union of all collectable objects\n*/\nunion GCObject {\n  GCheader gch;\n  union TString ts;\n  union Udata u;\n  union Closure cl;\n  struct Table h;\n  struct Proto p;\n  struct UpVal uv;\n  struct lua_State th;  /* thread */\n};\n\n\n/* macros to convert a GCObject into a specific value */\n#define rawgco2ts(o)\tcheck_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))\n#define gco2ts(o)\t(&rawgco2ts(o)->tsv)\n#define rawgco2u(o)\tcheck_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))\n#define gco2u(o)\t(&rawgco2u(o)->uv)\n#define gco2cl(o)\tcheck_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))\n#define gco2h(o)\tcheck_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))\n#define gco2p(o)\tcheck_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))\n#define gco2uv(o)\tcheck_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))\n#define ngcotouv(o) \\\n\tcheck_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))\n#define gco2th(o)\tcheck_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))\n\n/* macro to convert any Lua object into a GCObject */\n#define obj2gco(v)\t(cast(GCObject *, (v)))\n\n\nLUAI_FUNC lua_State *luaE_newthread (lua_State *L);\nLUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1);\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lstring.c",
    "content": "/*\n** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $\n** String table (keeps all strings handled by Lua)\n** See Copyright Notice in lua.h\n*/\n\n\n#include <string.h>\n\n#define lstring_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n\n\n\nvoid luaS_resize (lua_State *L, int newsize) {\n  GCObject **newhash;\n  stringtable *tb;\n  int i;\n  if (G(L)->gcstate == GCSsweepstring)\n    return;  /* cannot resize during GC traverse */\n  newhash = luaM_newvector(L, newsize, GCObject *);\n  tb = &G(L)->strt;\n  for (i=0; i<newsize; i++) newhash[i] = NULL;\n  /* rehash */\n  for (i=0; i<tb->size; i++) {\n    GCObject *p = tb->hash[i];\n    while (p) {  /* for each node in the list */\n      GCObject *next = p->gch.next;  /* save next */\n      unsigned int h = gco2ts(p)->hash;\n      int h1 = lmod(h, newsize);  /* new position */\n      lua_assert(cast_int(h%newsize) == lmod(h, newsize));\n      p->gch.next = newhash[h1];  /* chain it */\n      newhash[h1] = p;\n      p = next;\n    }\n  }\n  luaM_freearray(L, tb->hash, tb->size, TString *);\n  tb->size = newsize;\n  tb->hash = newhash;\n}\n\n\nstatic TString *newlstr (lua_State *L, const char *str, size_t l,\n                                       unsigned int h) {\n  TString *ts;\n  stringtable *tb;\n  if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char))\n    luaM_toobig(L);\n  ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString)));\n  ts->tsv.len = l;\n  ts->tsv.hash = h;\n  ts->tsv.marked = luaC_white(G(L));\n  ts->tsv.tt = LUA_TSTRING;\n  ts->tsv.reserved = 0;\n  memcpy(ts+1, str, l*sizeof(char));\n  ((char *)(ts+1))[l] = '\\0';  /* ending 0 */\n  tb = &G(L)->strt;\n  h = lmod(h, tb->size);\n  ts->tsv.next = tb->hash[h];  /* chain new entry */\n  tb->hash[h] = obj2gco(ts);\n  tb->nuse++;\n  if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2)\n    luaS_resize(L, tb->size*2);  /* too crowded */\n  return ts;\n}\n\n\nTString *luaS_newlstr (lua_State *L, const char *str, size_t l) {\n  GCObject *o;\n  unsigned int h = cast(unsigned int, l);  /* seed */\n  size_t step = (l>>5)+1;  /* if string is too long, don't hash all its chars */\n  size_t l1;\n  for (l1=l; l1>=step; l1-=step)  /* compute hash */\n    h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1]));\n  for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)];\n       o != NULL;\n       o = o->gch.next) {\n    TString *ts = rawgco2ts(o);\n    if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) {\n      /* string may be dead */\n      if (isdead(G(L), o)) changewhite(o);\n      return ts;\n    }\n  }\n  return newlstr(L, str, l, h);  /* not found */\n}\n\n\nUdata *luaS_newudata (lua_State *L, size_t s, Table *e) {\n  Udata *u;\n  if (s > MAX_SIZET - sizeof(Udata))\n    luaM_toobig(L);\n  u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata)));\n  u->uv.marked = luaC_white(G(L));  /* is not finalized */\n  u->uv.tt = LUA_TUSERDATA;\n  u->uv.len = s;\n  u->uv.metatable = NULL;\n  u->uv.env = e;\n  /* chain it on udata list (after main thread) */\n  u->uv.next = G(L)->mainthread->next;\n  G(L)->mainthread->next = obj2gco(u);\n  return u;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lstring.h",
    "content": "/*\n** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $\n** String table (keep all strings handled by Lua)\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lstring_h\n#define lstring_h\n\n\n#include \"lgc.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n\n\n#define sizestring(s)\t(sizeof(union TString)+((s)->len+1)*sizeof(char))\n\n#define sizeudata(u)\t(sizeof(union Udata)+(u)->len)\n\n#define luaS_new(L, s)\t(luaS_newlstr(L, s, strlen(s)))\n#define luaS_newliteral(L, s)\t(luaS_newlstr(L, \"\" s, \\\n                                 (sizeof(s)/sizeof(char))-1))\n\n#define luaS_fix(s)\tl_setbit((s)->tsv.marked, FIXEDBIT)\n\nLUAI_FUNC void luaS_resize (lua_State *L, int newsize);\nLUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);\nLUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lstrlib.c",
    "content": "/*\n** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $\n** Standard library for string operations and pattern-matching\n** See Copyright Notice in lua.h\n*/\n\n\n#include <ctype.h>\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define lstrlib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n/* macro to `unsign' a character */\n#define uchar(c)        ((unsigned char)(c))\n\n\n\nstatic int str_len (lua_State *L) {\n  size_t l;\n  luaL_checklstring(L, 1, &l);\n  lua_pushinteger(L, l);\n  return 1;\n}\n\n\nstatic ptrdiff_t posrelat (ptrdiff_t pos, size_t len) {\n  /* relative string position: negative means back from end */\n  if (pos < 0) pos += (ptrdiff_t)len + 1;\n  return (pos >= 0) ? pos : 0;\n}\n\n\nstatic int str_sub (lua_State *L) {\n  size_t l;\n  const char *s = luaL_checklstring(L, 1, &l);\n  ptrdiff_t start = posrelat(luaL_checkinteger(L, 2), l);\n  ptrdiff_t end = posrelat(luaL_optinteger(L, 3, -1), l);\n  if (start < 1) start = 1;\n  if (end > (ptrdiff_t)l) end = (ptrdiff_t)l;\n  if (start <= end)\n    lua_pushlstring(L, s+start-1, end-start+1);\n  else lua_pushliteral(L, \"\");\n  return 1;\n}\n\n\nstatic int str_reverse (lua_State *L) {\n  size_t l;\n  luaL_Buffer b;\n  const char *s = luaL_checklstring(L, 1, &l);\n  luaL_buffinit(L, &b);\n  while (l--) luaL_addchar(&b, s[l]);\n  luaL_pushresult(&b);\n  return 1;\n}\n\n\nstatic int str_lower (lua_State *L) {\n  size_t l;\n  size_t i;\n  luaL_Buffer b;\n  const char *s = luaL_checklstring(L, 1, &l);\n  luaL_buffinit(L, &b);\n  for (i=0; i<l; i++)\n    luaL_addchar(&b, tolower(uchar(s[i])));\n  luaL_pushresult(&b);\n  return 1;\n}\n\n\nstatic int str_upper (lua_State *L) {\n  size_t l;\n  size_t i;\n  luaL_Buffer b;\n  const char *s = luaL_checklstring(L, 1, &l);\n  luaL_buffinit(L, &b);\n  for (i=0; i<l; i++)\n    luaL_addchar(&b, toupper(uchar(s[i])));\n  luaL_pushresult(&b);\n  return 1;\n}\n\nstatic int str_rep (lua_State *L) {\n  size_t l;\n  luaL_Buffer b;\n  const char *s = luaL_checklstring(L, 1, &l);\n  int n = luaL_checkint(L, 2);\n  luaL_buffinit(L, &b);\n  while (n-- > 0)\n    luaL_addlstring(&b, s, l);\n  luaL_pushresult(&b);\n  return 1;\n}\n\n\nstatic int str_byte (lua_State *L) {\n  size_t l;\n  const char *s = luaL_checklstring(L, 1, &l);\n  ptrdiff_t posi = posrelat(luaL_optinteger(L, 2, 1), l);\n  ptrdiff_t pose = posrelat(luaL_optinteger(L, 3, posi), l);\n  int n, i;\n  if (posi <= 0) posi = 1;\n  if ((size_t)pose > l) pose = l;\n  if (posi > pose) return 0;  /* empty interval; return no values */\n  n = (int)(pose -  posi + 1);\n  if (posi + n <= pose)  /* overflow? */\n    luaL_error(L, \"string slice too long\");\n  luaL_checkstack(L, n, \"string slice too long\");\n  for (i=0; i<n; i++)\n    lua_pushinteger(L, uchar(s[posi+i-1]));\n  return n;\n}\n\n\nstatic int str_char (lua_State *L) {\n  int n = lua_gettop(L);  /* number of arguments */\n  int i;\n  luaL_Buffer b;\n  luaL_buffinit(L, &b);\n  for (i=1; i<=n; i++) {\n    int c = luaL_checkint(L, i);\n    luaL_argcheck(L, uchar(c) == c, i, \"invalid value\");\n    luaL_addchar(&b, uchar(c));\n  }\n  luaL_pushresult(&b);\n  return 1;\n}\n\n\nstatic int writer (lua_State *L, const void* b, size_t size, void* B) {\n  (void)L;\n  luaL_addlstring((luaL_Buffer*) B, (const char *)b, size);\n  return 0;\n}\n\n\nstatic int str_dump (lua_State *L) {\n  luaL_Buffer b;\n  luaL_checktype(L, 1, LUA_TFUNCTION);\n  lua_settop(L, 1);\n  luaL_buffinit(L,&b);\n  if (lua_dump(L, writer, &b) != 0)\n    luaL_error(L, \"unable to dump given function\");\n  luaL_pushresult(&b);\n  return 1;\n}\n\n\n\n/*\n** {======================================================\n** PATTERN MATCHING\n** =======================================================\n*/\n\n\n#define CAP_UNFINISHED\t(-1)\n#define CAP_POSITION\t(-2)\n\ntypedef struct MatchState {\n  const char *src_init;  /* init of source string */\n  const char *src_end;  /* end (`\\0') of source string */\n  lua_State *L;\n  int level;  /* total number of captures (finished or unfinished) */\n  struct {\n    const char *init;\n    ptrdiff_t len;\n  } capture[LUA_MAXCAPTURES];\n} MatchState;\n\n\n#define L_ESC\t\t'%'\n#define SPECIALS\t\"^$*+?.([%-\"\n\n\nstatic int check_capture (MatchState *ms, int l) {\n  l -= '1';\n  if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)\n    return luaL_error(ms->L, \"invalid capture index\");\n  return l;\n}\n\n\nstatic int capture_to_close (MatchState *ms) {\n  int level = ms->level;\n  for (level--; level>=0; level--)\n    if (ms->capture[level].len == CAP_UNFINISHED) return level;\n  return luaL_error(ms->L, \"invalid pattern capture\");\n}\n\n\nstatic const char *classend (MatchState *ms, const char *p) {\n  switch (*p++) {\n    case L_ESC: {\n      if (*p == '\\0')\n        luaL_error(ms->L, \"malformed pattern (ends with \" LUA_QL(\"%%\") \")\");\n      return p+1;\n    }\n    case '[': {\n      if (*p == '^') p++;\n      do {  /* look for a `]' */\n        if (*p == '\\0')\n          luaL_error(ms->L, \"malformed pattern (missing \" LUA_QL(\"]\") \")\");\n        if (*(p++) == L_ESC && *p != '\\0')\n          p++;  /* skip escapes (e.g. `%]') */\n      } while (*p != ']');\n      return p+1;\n    }\n    default: {\n      return p;\n    }\n  }\n}\n\n\nstatic int match_class (int c, int cl) {\n  int res;\n  switch (tolower(cl)) {\n    case 'a' : res = isalpha(c); break;\n    case 'c' : res = iscntrl(c); break;\n    case 'd' : res = isdigit(c); break;\n    case 'l' : res = islower(c); break;\n    case 'p' : res = ispunct(c); break;\n    case 's' : res = isspace(c); break;\n    case 'u' : res = isupper(c); break;\n    case 'w' : res = isalnum(c); break;\n    case 'x' : res = isxdigit(c); break;\n    case 'z' : res = (c == 0); break;\n    default: return (cl == c);\n  }\n  return (islower(cl) ? res : !res);\n}\n\n\nstatic int matchbracketclass (int c, const char *p, const char *ec) {\n  int sig = 1;\n  if (*(p+1) == '^') {\n    sig = 0;\n    p++;  /* skip the `^' */\n  }\n  while (++p < ec) {\n    if (*p == L_ESC) {\n      p++;\n      if (match_class(c, uchar(*p)))\n        return sig;\n    }\n    else if ((*(p+1) == '-') && (p+2 < ec)) {\n      p+=2;\n      if (uchar(*(p-2)) <= c && c <= uchar(*p))\n        return sig;\n    }\n    else if (uchar(*p) == c) return sig;\n  }\n  return !sig;\n}\n\n\nstatic int singlematch (int c, const char *p, const char *ep) {\n  switch (*p) {\n    case '.': return 1;  /* matches any char */\n    case L_ESC: return match_class(c, uchar(*(p+1)));\n    case '[': return matchbracketclass(c, p, ep-1);\n    default:  return (uchar(*p) == c);\n  }\n}\n\n\nstatic const char *match (MatchState *ms, const char *s, const char *p);\n\n\nstatic const char *matchbalance (MatchState *ms, const char *s,\n                                   const char *p) {\n  if (*p == 0 || *(p+1) == 0)\n    luaL_error(ms->L, \"unbalanced pattern\");\n  if (*s != *p) return NULL;\n  else {\n    int b = *p;\n    int e = *(p+1);\n    int cont = 1;\n    while (++s < ms->src_end) {\n      if (*s == e) {\n        if (--cont == 0) return s+1;\n      }\n      else if (*s == b) cont++;\n    }\n  }\n  return NULL;  /* string ends out of balance */\n}\n\n\nstatic const char *max_expand (MatchState *ms, const char *s,\n                                 const char *p, const char *ep) {\n  ptrdiff_t i = 0;  /* counts maximum expand for item */\n  while ((s+i)<ms->src_end && singlematch(uchar(*(s+i)), p, ep))\n    i++;\n  /* keeps trying to match with the maximum repetitions */\n  while (i>=0) {\n    const char *res = match(ms, (s+i), ep+1);\n    if (res) return res;\n    i--;  /* else didn't match; reduce 1 repetition to try again */\n  }\n  return NULL;\n}\n\n\nstatic const char *min_expand (MatchState *ms, const char *s,\n                                 const char *p, const char *ep) {\n  for (;;) {\n    const char *res = match(ms, s, ep+1);\n    if (res != NULL)\n      return res;\n    else if (s<ms->src_end && singlematch(uchar(*s), p, ep))\n      s++;  /* try with one more repetition */\n    else return NULL;\n  }\n}\n\n\nstatic const char *start_capture (MatchState *ms, const char *s,\n                                    const char *p, int what) {\n  const char *res;\n  int level = ms->level;\n  if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, \"too many captures\");\n  ms->capture[level].init = s;\n  ms->capture[level].len = what;\n  ms->level = level+1;\n  if ((res=match(ms, s, p)) == NULL)  /* match failed? */\n    ms->level--;  /* undo capture */\n  return res;\n}\n\n\nstatic const char *end_capture (MatchState *ms, const char *s,\n                                  const char *p) {\n  int l = capture_to_close(ms);\n  const char *res;\n  ms->capture[l].len = s - ms->capture[l].init;  /* close capture */\n  if ((res = match(ms, s, p)) == NULL)  /* match failed? */\n    ms->capture[l].len = CAP_UNFINISHED;  /* undo capture */\n  return res;\n}\n\n\nstatic const char *match_capture (MatchState *ms, const char *s, int l) {\n  size_t len;\n  l = check_capture(ms, l);\n  len = ms->capture[l].len;\n  if ((size_t)(ms->src_end-s) >= len &&\n      memcmp(ms->capture[l].init, s, len) == 0)\n    return s+len;\n  else return NULL;\n}\n\n\nstatic const char *match (MatchState *ms, const char *s, const char *p) {\n  init: /* using goto's to optimize tail recursion */\n  switch (*p) {\n    case '(': {  /* start capture */\n      if (*(p+1) == ')')  /* position capture? */\n        return start_capture(ms, s, p+2, CAP_POSITION);\n      else\n        return start_capture(ms, s, p+1, CAP_UNFINISHED);\n    }\n    case ')': {  /* end capture */\n      return end_capture(ms, s, p+1);\n    }\n    case L_ESC: {\n      switch (*(p+1)) {\n        case 'b': {  /* balanced string? */\n          s = matchbalance(ms, s, p+2);\n          if (s == NULL) return NULL;\n          p+=4; goto init;  /* else return match(ms, s, p+4); */\n        }\n        case 'f': {  /* frontier? */\n          const char *ep; char previous;\n          p += 2;\n          if (*p != '[')\n            luaL_error(ms->L, \"missing \" LUA_QL(\"[\") \" after \"\n                               LUA_QL(\"%%f\") \" in pattern\");\n          ep = classend(ms, p);  /* points to what is next */\n          previous = (s == ms->src_init) ? '\\0' : *(s-1);\n          if (matchbracketclass(uchar(previous), p, ep-1) ||\n             !matchbracketclass(uchar(*s), p, ep-1)) return NULL;\n          p=ep; goto init;  /* else return match(ms, s, ep); */\n        }\n        default: {\n          if (isdigit(uchar(*(p+1)))) {  /* capture results (%0-%9)? */\n            s = match_capture(ms, s, uchar(*(p+1)));\n            if (s == NULL) return NULL;\n            p+=2; goto init;  /* else return match(ms, s, p+2) */\n          }\n          goto dflt;  /* case default */\n        }\n      }\n    }\n    case '\\0': {  /* end of pattern */\n      return s;  /* match succeeded */\n    }\n    case '$': {\n      if (*(p+1) == '\\0')  /* is the `$' the last char in pattern? */\n        return (s == ms->src_end) ? s : NULL;  /* check end of string */\n      else goto dflt;\n    }\n    default: dflt: {  /* it is a pattern item */\n      const char *ep = classend(ms, p);  /* points to what is next */\n      int m = s<ms->src_end && singlematch(uchar(*s), p, ep);\n      switch (*ep) {\n        case '?': {  /* optional */\n          const char *res;\n          if (m && ((res=match(ms, s+1, ep+1)) != NULL))\n            return res;\n          p=ep+1; goto init;  /* else return match(ms, s, ep+1); */\n        }\n        case '*': {  /* 0 or more repetitions */\n          return max_expand(ms, s, p, ep);\n        }\n        case '+': {  /* 1 or more repetitions */\n          return (m ? max_expand(ms, s+1, p, ep) : NULL);\n        }\n        case '-': {  /* 0 or more repetitions (minimum) */\n          return min_expand(ms, s, p, ep);\n        }\n        default: {\n          if (!m) return NULL;\n          s++; p=ep; goto init;  /* else return match(ms, s+1, ep); */\n        }\n      }\n    }\n  }\n}\n\n\n\nstatic const char *lmemfind (const char *s1, size_t l1,\n                               const char *s2, size_t l2) {\n  if (l2 == 0) return s1;  /* empty strings are everywhere */\n  else if (l2 > l1) return NULL;  /* avoids a negative `l1' */\n  else {\n    const char *init;  /* to search for a `*s2' inside `s1' */\n    l2--;  /* 1st char will be checked by `memchr' */\n    l1 = l1-l2;  /* `s2' cannot be found after that */\n    while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) {\n      init++;   /* 1st char is already checked */\n      if (memcmp(init, s2+1, l2) == 0)\n        return init-1;\n      else {  /* correct `l1' and `s1' to try again */\n        l1 -= init-s1;\n        s1 = init;\n      }\n    }\n    return NULL;  /* not found */\n  }\n}\n\n\nstatic void push_onecapture (MatchState *ms, int i, const char *s,\n                                                    const char *e) {\n  if (i >= ms->level) {\n    if (i == 0)  /* ms->level == 0, too */\n      lua_pushlstring(ms->L, s, e - s);  /* add whole match */\n    else\n      luaL_error(ms->L, \"invalid capture index\");\n  }\n  else {\n    ptrdiff_t l = ms->capture[i].len;\n    if (l == CAP_UNFINISHED) luaL_error(ms->L, \"unfinished capture\");\n    if (l == CAP_POSITION)\n      lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1);\n    else\n      lua_pushlstring(ms->L, ms->capture[i].init, l);\n  }\n}\n\n\nstatic int push_captures (MatchState *ms, const char *s, const char *e) {\n  int i;\n  int nlevels = (ms->level == 0 && s) ? 1 : ms->level;\n  luaL_checkstack(ms->L, nlevels, \"too many captures\");\n  for (i = 0; i < nlevels; i++)\n    push_onecapture(ms, i, s, e);\n  return nlevels;  /* number of strings pushed */\n}\n\n\nstatic int str_find_aux (lua_State *L, int find) {\n  size_t l1, l2;\n  const char *s = luaL_checklstring(L, 1, &l1);\n  const char *p = luaL_checklstring(L, 2, &l2);\n  ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1;\n  if (init < 0) init = 0;\n  else if ((size_t)(init) > l1) init = (ptrdiff_t)l1;\n  if (find && (lua_toboolean(L, 4) ||  /* explicit request? */\n      strpbrk(p, SPECIALS) == NULL)) {  /* or no special characters? */\n    /* do a plain search */\n    const char *s2 = lmemfind(s+init, l1-init, p, l2);\n    if (s2) {\n      lua_pushinteger(L, s2-s+1);\n      lua_pushinteger(L, s2-s+l2);\n      return 2;\n    }\n  }\n  else {\n    MatchState ms;\n    int anchor = (*p == '^') ? (p++, 1) : 0;\n    const char *s1=s+init;\n    ms.L = L;\n    ms.src_init = s;\n    ms.src_end = s+l1;\n    do {\n      const char *res;\n      ms.level = 0;\n      if ((res=match(&ms, s1, p)) != NULL) {\n        if (find) {\n          lua_pushinteger(L, s1-s+1);  /* start */\n          lua_pushinteger(L, res-s);   /* end */\n          return push_captures(&ms, NULL, 0) + 2;\n        }\n        else\n          return push_captures(&ms, s1, res);\n      }\n    } while (s1++ < ms.src_end && !anchor);\n  }\n  lua_pushnil(L);  /* not found */\n  return 1;\n}\n\n\nstatic int str_find (lua_State *L) {\n  return str_find_aux(L, 1);\n}\n\n\nstatic int str_match (lua_State *L) {\n  return str_find_aux(L, 0);\n}\n\n\nstatic int gmatch_aux (lua_State *L) {\n  MatchState ms;\n  size_t ls;\n  const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls);\n  const char *p = lua_tostring(L, lua_upvalueindex(2));\n  const char *src;\n  ms.L = L;\n  ms.src_init = s;\n  ms.src_end = s+ls;\n  for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3));\n       src <= ms.src_end;\n       src++) {\n    const char *e;\n    ms.level = 0;\n    if ((e = match(&ms, src, p)) != NULL) {\n      lua_Integer newstart = e-s;\n      if (e == src) newstart++;  /* empty match? go at least one position */\n      lua_pushinteger(L, newstart);\n      lua_replace(L, lua_upvalueindex(3));\n      return push_captures(&ms, src, e);\n    }\n  }\n  return 0;  /* not found */\n}\n\n\nstatic int gmatch (lua_State *L) {\n  luaL_checkstring(L, 1);\n  luaL_checkstring(L, 2);\n  lua_settop(L, 2);\n  lua_pushinteger(L, 0);\n  lua_pushcclosure(L, gmatch_aux, 3);\n  return 1;\n}\n\n\nstatic int gfind_nodef (lua_State *L) {\n  return luaL_error(L, LUA_QL(\"string.gfind\") \" was renamed to \"\n                       LUA_QL(\"string.gmatch\"));\n}\n\n\nstatic void add_s (MatchState *ms, luaL_Buffer *b, const char *s,\n                                                   const char *e) {\n  size_t l, i;\n  const char *news = lua_tolstring(ms->L, 3, &l);\n  for (i = 0; i < l; i++) {\n    if (news[i] != L_ESC)\n      luaL_addchar(b, news[i]);\n    else {\n      i++;  /* skip ESC */\n      if (!isdigit(uchar(news[i])))\n        luaL_addchar(b, news[i]);\n      else if (news[i] == '0')\n          luaL_addlstring(b, s, e - s);\n      else {\n        push_onecapture(ms, news[i] - '1', s, e);\n        luaL_addvalue(b);  /* add capture to accumulated result */\n      }\n    }\n  }\n}\n\n\nstatic void add_value (MatchState *ms, luaL_Buffer *b, const char *s,\n                                                       const char *e) {\n  lua_State *L = ms->L;\n  switch (lua_type(L, 3)) {\n    case LUA_TNUMBER:\n    case LUA_TSTRING: {\n      add_s(ms, b, s, e);\n      return;\n    }\n    case LUA_TFUNCTION: {\n      int n;\n      lua_pushvalue(L, 3);\n      n = push_captures(ms, s, e);\n      lua_call(L, n, 1);\n      break;\n    }\n    case LUA_TTABLE: {\n      push_onecapture(ms, 0, s, e);\n      lua_gettable(L, 3);\n      break;\n    }\n  }\n  if (!lua_toboolean(L, -1)) {  /* nil or false? */\n    lua_pop(L, 1);\n    lua_pushlstring(L, s, e - s);  /* keep original text */\n  }\n  else if (!lua_isstring(L, -1))\n    luaL_error(L, \"invalid replacement value (a %s)\", luaL_typename(L, -1)); \n  luaL_addvalue(b);  /* add result to accumulator */\n}\n\n\nstatic int str_gsub (lua_State *L) {\n  size_t srcl;\n  const char *src = luaL_checklstring(L, 1, &srcl);\n  const char *p = luaL_checkstring(L, 2);\n  int  tr = lua_type(L, 3);\n  int max_s = luaL_optint(L, 4, srcl+1);\n  int anchor = (*p == '^') ? (p++, 1) : 0;\n  int n = 0;\n  MatchState ms;\n  luaL_Buffer b;\n  luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING ||\n                   tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3,\n                      \"string/function/table expected\");\n  luaL_buffinit(L, &b);\n  ms.L = L;\n  ms.src_init = src;\n  ms.src_end = src+srcl;\n  while (n < max_s) {\n    const char *e;\n    ms.level = 0;\n    e = match(&ms, src, p);\n    if (e) {\n      n++;\n      add_value(&ms, &b, src, e);\n    }\n    if (e && e>src) /* non empty match? */\n      src = e;  /* skip it */\n    else if (src < ms.src_end)\n      luaL_addchar(&b, *src++);\n    else break;\n    if (anchor) break;\n  }\n  luaL_addlstring(&b, src, ms.src_end-src);\n  luaL_pushresult(&b);\n  lua_pushinteger(L, n);  /* number of substitutions */\n  return 2;\n}\n\n/* }====================================================== */\n\n\n/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */\n#define MAX_ITEM\t512\n/* valid flags in a format specification */\n#define FLAGS\t\"-+ #0\"\n/*\n** maximum size of each format specification (such as '%-099.99d')\n** (+10 accounts for %99.99x plus margin of error)\n*/\n#define MAX_FORMAT\t(sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10)\n\n\nstatic void addquoted (lua_State *L, luaL_Buffer *b, int arg) {\n  size_t l;\n  const char *s = luaL_checklstring(L, arg, &l);\n  luaL_addchar(b, '\"');\n  while (l--) {\n    switch (*s) {\n      case '\"': case '\\\\': case '\\n': {\n        luaL_addchar(b, '\\\\');\n        luaL_addchar(b, *s);\n        break;\n      }\n      case '\\r': {\n        luaL_addlstring(b, \"\\\\r\", 2);\n        break;\n      }\n      case '\\0': {\n        luaL_addlstring(b, \"\\\\000\", 4);\n        break;\n      }\n      default: {\n        luaL_addchar(b, *s);\n        break;\n      }\n    }\n    s++;\n  }\n  luaL_addchar(b, '\"');\n}\n\nstatic const char *scanformat (lua_State *L, const char *strfrmt, char *form) {\n  const char *p = strfrmt;\n  while (*p != '\\0' && strchr(FLAGS, *p) != NULL) p++;  /* skip flags */\n  if ((size_t)(p - strfrmt) >= sizeof(FLAGS))\n    luaL_error(L, \"invalid format (repeated flags)\");\n  if (isdigit(uchar(*p))) p++;  /* skip width */\n  if (isdigit(uchar(*p))) p++;  /* (2 digits at most) */\n  if (*p == '.') {\n    p++;\n    if (isdigit(uchar(*p))) p++;  /* skip precision */\n    if (isdigit(uchar(*p))) p++;  /* (2 digits at most) */\n  }\n  if (isdigit(uchar(*p)))\n    luaL_error(L, \"invalid format (width or precision too long)\");\n  *(form++) = '%';\n  strncpy(form, strfrmt, p - strfrmt + 1);\n  form += p - strfrmt + 1;\n  *form = '\\0';\n  return p;\n}\n\n\nstatic void addintlen (char *form) {\n  size_t l = strlen(form);\n  char spec = form[l - 1];\n  strcpy(form + l - 1, LUA_INTFRMLEN);\n  form[l + sizeof(LUA_INTFRMLEN) - 2] = spec;\n  form[l + sizeof(LUA_INTFRMLEN) - 1] = '\\0';\n}\n\n\nstatic int str_format (lua_State *L) {\n  int top = lua_gettop(L);\n  int arg = 1;\n  size_t sfl;\n  const char *strfrmt = luaL_checklstring(L, arg, &sfl);\n  const char *strfrmt_end = strfrmt+sfl;\n  luaL_Buffer b;\n  luaL_buffinit(L, &b);\n  while (strfrmt < strfrmt_end) {\n    if (*strfrmt != L_ESC)\n      luaL_addchar(&b, *strfrmt++);\n    else if (*++strfrmt == L_ESC)\n      luaL_addchar(&b, *strfrmt++);  /* %% */\n    else { /* format item */\n      char form[MAX_FORMAT];  /* to store the format (`%...') */\n      char buff[MAX_ITEM];  /* to store the formatted item */\n      if (++arg > top)\n        luaL_argerror(L, arg, \"no value\");\n      strfrmt = scanformat(L, strfrmt, form);\n      switch (*strfrmt++) {\n        case 'c': {\n          sprintf(buff, form, (int)luaL_checknumber(L, arg));\n          break;\n        }\n        case 'd':  case 'i': {\n          addintlen(form);\n          sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg));\n          break;\n        }\n        case 'o':  case 'u':  case 'x':  case 'X': {\n          addintlen(form);\n          sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg));\n          break;\n        }\n        case 'e':  case 'E': case 'f':\n        case 'g': case 'G': {\n          sprintf(buff, form, (double)luaL_checknumber(L, arg));\n          break;\n        }\n        case 'q': {\n          addquoted(L, &b, arg);\n          continue;  /* skip the 'addsize' at the end */\n        }\n        case 's': {\n          size_t l;\n          const char *s = luaL_checklstring(L, arg, &l);\n          if (!strchr(form, '.') && l >= 100) {\n            /* no precision and string is too long to be formatted;\n               keep original string */\n            lua_pushvalue(L, arg);\n            luaL_addvalue(&b);\n            continue;  /* skip the `addsize' at the end */\n          }\n          else {\n            sprintf(buff, form, s);\n            break;\n          }\n        }\n        default: {  /* also treat cases `pnLlh' */\n          return luaL_error(L, \"invalid option \" LUA_QL(\"%%%c\") \" to \"\n                               LUA_QL(\"format\"), *(strfrmt - 1));\n        }\n      }\n      luaL_addlstring(&b, buff, strlen(buff));\n    }\n  }\n  luaL_pushresult(&b);\n  return 1;\n}\n\n\nstatic const luaL_Reg strlib[] = {\n  {\"byte\", str_byte},\n  {\"char\", str_char},\n  {\"dump\", str_dump},\n  {\"find\", str_find},\n  {\"format\", str_format},\n  {\"gfind\", gfind_nodef},\n  {\"gmatch\", gmatch},\n  {\"gsub\", str_gsub},\n  {\"len\", str_len},\n  {\"lower\", str_lower},\n  {\"match\", str_match},\n  {\"rep\", str_rep},\n  {\"reverse\", str_reverse},\n  {\"sub\", str_sub},\n  {\"upper\", str_upper},\n  {NULL, NULL}\n};\n\n\nstatic void createmetatable (lua_State *L) {\n  lua_createtable(L, 0, 1);  /* create metatable for strings */\n  lua_pushliteral(L, \"\");  /* dummy string */\n  lua_pushvalue(L, -2);\n  lua_setmetatable(L, -2);  /* set string metatable */\n  lua_pop(L, 1);  /* pop dummy string */\n  lua_pushvalue(L, -2);  /* string library... */\n  lua_setfield(L, -2, \"__index\");  /* ...is the __index metamethod */\n  lua_pop(L, 1);  /* pop metatable */\n}\n\n\n/*\n** Open string library\n*/\nLUALIB_API int luaopen_string (lua_State *L) {\n  luaL_register(L, LUA_STRLIBNAME, strlib);\n#if defined(LUA_COMPAT_GFIND)\n  lua_getfield(L, -1, \"gmatch\");\n  lua_setfield(L, -2, \"gfind\");\n#endif\n  createmetatable(L);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ltable.c",
    "content": "/*\n** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $\n** Lua tables (hash)\n** See Copyright Notice in lua.h\n*/\n\n\n/*\n** Implementation of tables (aka arrays, objects, or hash tables).\n** Tables keep its elements in two parts: an array part and a hash part.\n** Non-negative integer keys are all candidates to be kept in the array\n** part. The actual size of the array is the largest `n' such that at\n** least half the slots between 0 and n are in use.\n** Hash uses a mix of chained scatter table with Brent's variation.\n** A main invariant of these tables is that, if an element is not\n** in its main position (i.e. the `original' position that its hash gives\n** to it), then the colliding element is in its own main position.\n** Hence even when the load factor reaches 100%, performance remains good.\n*/\n\n#include <math.h>\n#include <string.h>\n\n#define ltable_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lgc.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"ltable.h\"\n\n\n/*\n** max size of array part is 2^MAXBITS\n*/\n#if LUAI_BITSINT > 26\n#define MAXBITS\t\t26\n#else\n#define MAXBITS\t\t(LUAI_BITSINT-2)\n#endif\n\n#define MAXASIZE\t(1 << MAXBITS)\n\n\n#define hashpow2(t,n)      (gnode(t, lmod((n), sizenode(t))))\n  \n#define hashstr(t,str)  hashpow2(t, (str)->tsv.hash)\n#define hashboolean(t,p)        hashpow2(t, p)\n\n\n/*\n** for some types, it is better to avoid modulus by power of 2, as\n** they tend to have many 2 factors.\n*/\n#define hashmod(t,n)\t(gnode(t, ((n) % ((sizenode(t)-1)|1))))\n\n\n#define hashpointer(t,p)\thashmod(t, IntPoint(p))\n\n\n/*\n** number of ints inside a lua_Number\n*/\n#define numints\t\tcast_int(sizeof(lua_Number)/sizeof(int))\n\n\n\n#define dummynode\t\t(&dummynode_)\n\nstatic const Node dummynode_ = {\n  {{NULL}, LUA_TNIL},  /* value */\n  {{{NULL}, LUA_TNIL, NULL}}  /* key */\n};\n\n\n/*\n** hash for lua_Numbers\n*/\nstatic Node *hashnum (const Table *t, lua_Number n) {\n  unsigned int a[numints];\n  int i;\n  if (luai_numeq(n, 0))  /* avoid problems with -0 */\n    return gnode(t, 0);\n  memcpy(a, &n, sizeof(a));\n  for (i = 1; i < numints; i++) a[0] += a[i];\n  return hashmod(t, a[0]);\n}\n\n\n\n/*\n** returns the `main' position of an element in a table (that is, the index\n** of its hash value)\n*/\nstatic Node *mainposition (const Table *t, const TValue *key) {\n  switch (ttype(key)) {\n    case LUA_TNUMBER:\n      return hashnum(t, nvalue(key));\n    case LUA_TSTRING:\n      return hashstr(t, rawtsvalue(key));\n    case LUA_TBOOLEAN:\n      return hashboolean(t, bvalue(key));\n    case LUA_TLIGHTUSERDATA:\n      return hashpointer(t, pvalue(key));\n    default:\n      return hashpointer(t, gcvalue(key));\n  }\n}\n\n\n/*\n** returns the index for `key' if `key' is an appropriate key to live in\n** the array part of the table, -1 otherwise.\n*/\nstatic int arrayindex (const TValue *key) {\n  if (ttisnumber(key)) {\n    lua_Number n = nvalue(key);\n    int k;\n    lua_number2int(k, n);\n    if (luai_numeq(cast_num(k), n))\n      return k;\n  }\n  return -1;  /* `key' did not match some condition */\n}\n\n\n/*\n** returns the index of a `key' for table traversals. First goes all\n** elements in the array part, then elements in the hash part. The\n** beginning of a traversal is signalled by -1.\n*/\nstatic int findindex (lua_State *L, Table *t, StkId key) {\n  int i;\n  if (ttisnil(key)) return -1;  /* first iteration */\n  i = arrayindex(key);\n  if (0 < i && i <= t->sizearray)  /* is `key' inside array part? */\n    return i-1;  /* yes; that's the index (corrected to C) */\n  else {\n    Node *n = mainposition(t, key);\n    do {  /* check whether `key' is somewhere in the chain */\n      /* key may be dead already, but it is ok to use it in `next' */\n      if (luaO_rawequalObj(key2tval(n), key) ||\n            (ttype(gkey(n)) == LUA_TDEADKEY && iscollectable(key) &&\n             gcvalue(gkey(n)) == gcvalue(key))) {\n        i = cast_int(n - gnode(t, 0));  /* key index in hash table */\n        /* hash elements are numbered after array ones */\n        return i + t->sizearray;\n      }\n      else n = gnext(n);\n    } while (n);\n    luaG_runerror(L, \"invalid key to \" LUA_QL(\"next\"));  /* key not found */\n    return 0;  /* to avoid warnings */\n  }\n}\n\n\nint luaH_next (lua_State *L, Table *t, StkId key) {\n  int i = findindex(L, t, key);  /* find original element */\n  for (i++; i < t->sizearray; i++) {  /* try first array part */\n    if (!ttisnil(&t->array[i])) {  /* a non-nil value? */\n      setnvalue(key, cast_num(i+1));\n      setobj2s(L, key+1, &t->array[i]);\n      return 1;\n    }\n  }\n  for (i -= t->sizearray; i < sizenode(t); i++) {  /* then hash part */\n    if (!ttisnil(gval(gnode(t, i)))) {  /* a non-nil value? */\n      setobj2s(L, key, key2tval(gnode(t, i)));\n      setobj2s(L, key+1, gval(gnode(t, i)));\n      return 1;\n    }\n  }\n  return 0;  /* no more elements */\n}\n\n\n/*\n** {=============================================================\n** Rehash\n** ==============================================================\n*/\n\n\nstatic int computesizes (int nums[], int *narray) {\n  int i;\n  int twotoi;  /* 2^i */\n  int a = 0;  /* number of elements smaller than 2^i */\n  int na = 0;  /* number of elements to go to array part */\n  int n = 0;  /* optimal size for array part */\n  for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) {\n    if (nums[i] > 0) {\n      a += nums[i];\n      if (a > twotoi/2) {  /* more than half elements present? */\n        n = twotoi;  /* optimal size (till now) */\n        na = a;  /* all elements smaller than n will go to array part */\n      }\n    }\n    if (a == *narray) break;  /* all elements already counted */\n  }\n  *narray = n;\n  lua_assert(*narray/2 <= na && na <= *narray);\n  return na;\n}\n\n\nstatic int countint (const TValue *key, int *nums) {\n  int k = arrayindex(key);\n  if (0 < k && k <= MAXASIZE) {  /* is `key' an appropriate array index? */\n    nums[ceillog2(k)]++;  /* count as such */\n    return 1;\n  }\n  else\n    return 0;\n}\n\n\nstatic int numusearray (const Table *t, int *nums) {\n  int lg;\n  int ttlg;  /* 2^lg */\n  int ause = 0;  /* summation of `nums' */\n  int i = 1;  /* count to traverse all array keys */\n  for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) {  /* for each slice */\n    int lc = 0;  /* counter */\n    int lim = ttlg;\n    if (lim > t->sizearray) {\n      lim = t->sizearray;  /* adjust upper limit */\n      if (i > lim)\n        break;  /* no more elements to count */\n    }\n    /* count elements in range (2^(lg-1), 2^lg] */\n    for (; i <= lim; i++) {\n      if (!ttisnil(&t->array[i-1]))\n        lc++;\n    }\n    nums[lg] += lc;\n    ause += lc;\n  }\n  return ause;\n}\n\n\nstatic int numusehash (const Table *t, int *nums, int *pnasize) {\n  int totaluse = 0;  /* total number of elements */\n  int ause = 0;  /* summation of `nums' */\n  int i = sizenode(t);\n  while (i--) {\n    Node *n = &t->node[i];\n    if (!ttisnil(gval(n))) {\n      ause += countint(key2tval(n), nums);\n      totaluse++;\n    }\n  }\n  *pnasize += ause;\n  return totaluse;\n}\n\n\nstatic void setarrayvector (lua_State *L, Table *t, int size) {\n  int i;\n  luaM_reallocvector(L, t->array, t->sizearray, size, TValue);\n  for (i=t->sizearray; i<size; i++)\n     setnilvalue(&t->array[i]);\n  t->sizearray = size;\n}\n\n\nstatic void setnodevector (lua_State *L, Table *t, int size) {\n  int lsize;\n  if (size == 0) {  /* no elements to hash part? */\n    t->node = cast(Node *, dummynode);  /* use common `dummynode' */\n    lsize = 0;\n  }\n  else {\n    int i;\n    lsize = ceillog2(size);\n    if (lsize > MAXBITS)\n      luaG_runerror(L, \"table overflow\");\n    size = twoto(lsize);\n    t->node = luaM_newvector(L, size, Node);\n    for (i=0; i<size; i++) {\n      Node *n = gnode(t, i);\n      gnext(n) = NULL;\n      setnilvalue(gkey(n));\n      setnilvalue(gval(n));\n    }\n  }\n  t->lsizenode = cast_byte(lsize);\n  t->lastfree = gnode(t, size);  /* all positions are free */\n}\n\n\nstatic void resize (lua_State *L, Table *t, int nasize, int nhsize) {\n  int i;\n  int oldasize = t->sizearray;\n  int oldhsize = t->lsizenode;\n  Node *nold = t->node;  /* save old hash ... */\n  if (nasize > oldasize)  /* array part must grow? */\n    setarrayvector(L, t, nasize);\n  /* create new hash part with appropriate size */\n  setnodevector(L, t, nhsize);  \n  if (nasize < oldasize) {  /* array part must shrink? */\n    t->sizearray = nasize;\n    /* re-insert elements from vanishing slice */\n    for (i=nasize; i<oldasize; i++) {\n      if (!ttisnil(&t->array[i]))\n        setobjt2t(L, luaH_setnum(L, t, i+1), &t->array[i]);\n    }\n    /* shrink array */\n    luaM_reallocvector(L, t->array, oldasize, nasize, TValue);\n  }\n  /* re-insert elements from hash part */\n  for (i = twoto(oldhsize) - 1; i >= 0; i--) {\n    Node *old = nold+i;\n    if (!ttisnil(gval(old)))\n      setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old));\n  }\n  if (nold != dummynode)\n    luaM_freearray(L, nold, twoto(oldhsize), Node);  /* free old array */\n}\n\n\nvoid luaH_resizearray (lua_State *L, Table *t, int nasize) {\n  int nsize = (t->node == dummynode) ? 0 : sizenode(t);\n  resize(L, t, nasize, nsize);\n}\n\n\nstatic void rehash (lua_State *L, Table *t, const TValue *ek) {\n  int nasize, na;\n  int nums[MAXBITS+1];  /* nums[i] = number of keys between 2^(i-1) and 2^i */\n  int i;\n  int totaluse;\n  for (i=0; i<=MAXBITS; i++) nums[i] = 0;  /* reset counts */\n  nasize = numusearray(t, nums);  /* count keys in array part */\n  totaluse = nasize;  /* all those keys are integer keys */\n  totaluse += numusehash(t, nums, &nasize);  /* count keys in hash part */\n  /* count extra key */\n  nasize += countint(ek, nums);\n  totaluse++;\n  /* compute new size for array part */\n  na = computesizes(nums, &nasize);\n  /* resize the table to new computed sizes */\n  resize(L, t, nasize, totaluse - na);\n}\n\n\n\n/*\n** }=============================================================\n*/\n\n\nTable *luaH_new (lua_State *L, int narray, int nhash) {\n  Table *t = luaM_new(L, Table);\n  luaC_link(L, obj2gco(t), LUA_TTABLE);\n  t->metatable = NULL;\n  t->flags = cast_byte(~0);\n  /* temporary values (kept only if some malloc fails) */\n  t->array = NULL;\n  t->sizearray = 0;\n  t->lsizenode = 0;\n  t->node = cast(Node *, dummynode);\n  setarrayvector(L, t, narray);\n  setnodevector(L, t, nhash);\n  return t;\n}\n\n\nvoid luaH_free (lua_State *L, Table *t) {\n  if (t->node != dummynode)\n    luaM_freearray(L, t->node, sizenode(t), Node);\n  luaM_freearray(L, t->array, t->sizearray, TValue);\n  luaM_free(L, t);\n}\n\n\nstatic Node *getfreepos (Table *t) {\n  while (t->lastfree-- > t->node) {\n    if (ttisnil(gkey(t->lastfree)))\n      return t->lastfree;\n  }\n  return NULL;  /* could not find a free place */\n}\n\n\n\n/*\n** inserts a new key into a hash table; first, check whether key's main \n** position is free. If not, check whether colliding node is in its main \n** position or not: if it is not, move colliding node to an empty place and \n** put new key in its main position; otherwise (colliding node is in its main \n** position), new key goes to an empty position. \n*/\nstatic TValue *newkey (lua_State *L, Table *t, const TValue *key) {\n  Node *mp = mainposition(t, key);\n  if (!ttisnil(gval(mp)) || mp == dummynode) {\n    Node *othern;\n    Node *n = getfreepos(t);  /* get a free place */\n    if (n == NULL) {  /* cannot find a free place? */\n      rehash(L, t, key);  /* grow table */\n      return luaH_set(L, t, key);  /* re-insert key into grown table */\n    }\n    lua_assert(n != dummynode);\n    othern = mainposition(t, key2tval(mp));\n    if (othern != mp) {  /* is colliding node out of its main position? */\n      /* yes; move colliding node into free position */\n      while (gnext(othern) != mp) othern = gnext(othern);  /* find previous */\n      gnext(othern) = n;  /* redo the chain with `n' in place of `mp' */\n      *n = *mp;  /* copy colliding node into free pos. (mp->next also goes) */\n      gnext(mp) = NULL;  /* now `mp' is free */\n      setnilvalue(gval(mp));\n    }\n    else {  /* colliding node is in its own main position */\n      /* new node will go into free position */\n      gnext(n) = gnext(mp);  /* chain new position */\n      gnext(mp) = n;\n      mp = n;\n    }\n  }\n  gkey(mp)->value = key->value; gkey(mp)->tt = key->tt;\n  luaC_barriert(L, t, key);\n  lua_assert(ttisnil(gval(mp)));\n  return gval(mp);\n}\n\n\n/*\n** search function for integers\n*/\nconst TValue *luaH_getnum (Table *t, int key) {\n  /* (1 <= key && key <= t->sizearray) */\n  if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray))\n    return &t->array[key-1];\n  else {\n    lua_Number nk = cast_num(key);\n    Node *n = hashnum(t, nk);\n    do {  /* check whether `key' is somewhere in the chain */\n      if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk))\n        return gval(n);  /* that's it */\n      else n = gnext(n);\n    } while (n);\n    return luaO_nilobject;\n  }\n}\n\n\n/*\n** search function for strings\n*/\nconst TValue *luaH_getstr (Table *t, TString *key) {\n  Node *n = hashstr(t, key);\n  do {  /* check whether `key' is somewhere in the chain */\n    if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key)\n      return gval(n);  /* that's it */\n    else n = gnext(n);\n  } while (n);\n  return luaO_nilobject;\n}\n\n\n/*\n** main search function\n*/\nconst TValue *luaH_get (Table *t, const TValue *key) {\n  switch (ttype(key)) {\n    case LUA_TNIL: return luaO_nilobject;\n    case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key));\n    case LUA_TNUMBER: {\n      int k;\n      lua_Number n = nvalue(key);\n      lua_number2int(k, n);\n      if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */\n        return luaH_getnum(t, k);  /* use specialized version */\n      /* else go through */\n    }\n    default: {\n      Node *n = mainposition(t, key);\n      do {  /* check whether `key' is somewhere in the chain */\n        if (luaO_rawequalObj(key2tval(n), key))\n          return gval(n);  /* that's it */\n        else n = gnext(n);\n      } while (n);\n      return luaO_nilobject;\n    }\n  }\n}\n\n\nTValue *luaH_set (lua_State *L, Table *t, const TValue *key) {\n  const TValue *p = luaH_get(t, key);\n  t->flags = 0;\n  if (p != luaO_nilobject)\n    return cast(TValue *, p);\n  else {\n    if (ttisnil(key)) luaG_runerror(L, \"table index is nil\");\n    else if (ttisnumber(key) && luai_numisnan(nvalue(key)))\n      luaG_runerror(L, \"table index is NaN\");\n    return newkey(L, t, key);\n  }\n}\n\n\nTValue *luaH_setnum (lua_State *L, Table *t, int key) {\n  const TValue *p = luaH_getnum(t, key);\n  if (p != luaO_nilobject)\n    return cast(TValue *, p);\n  else {\n    TValue k;\n    setnvalue(&k, cast_num(key));\n    return newkey(L, t, &k);\n  }\n}\n\n\nTValue *luaH_setstr (lua_State *L, Table *t, TString *key) {\n  const TValue *p = luaH_getstr(t, key);\n  if (p != luaO_nilobject)\n    return cast(TValue *, p);\n  else {\n    TValue k;\n    setsvalue(L, &k, key);\n    return newkey(L, t, &k);\n  }\n}\n\n\nstatic int unbound_search (Table *t, unsigned int j) {\n  unsigned int i = j;  /* i is zero or a present index */\n  j++;\n  /* find `i' and `j' such that i is present and j is not */\n  while (!ttisnil(luaH_getnum(t, j))) {\n    i = j;\n    j *= 2;\n    if (j > cast(unsigned int, MAX_INT)) {  /* overflow? */\n      /* table was built with bad purposes: resort to linear search */\n      i = 1;\n      while (!ttisnil(luaH_getnum(t, i))) i++;\n      return i - 1;\n    }\n  }\n  /* now do a binary search between them */\n  while (j - i > 1) {\n    unsigned int m = (i+j)/2;\n    if (ttisnil(luaH_getnum(t, m))) j = m;\n    else i = m;\n  }\n  return i;\n}\n\n\n/*\n** Try to find a boundary in table `t'. A `boundary' is an integer index\n** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil).\n*/\nint luaH_getn (Table *t) {\n  unsigned int j = t->sizearray;\n  if (j > 0 && ttisnil(&t->array[j - 1])) {\n    /* there is a boundary in the array part: (binary) search for it */\n    unsigned int i = 0;\n    while (j - i > 1) {\n      unsigned int m = (i+j)/2;\n      if (ttisnil(&t->array[m - 1])) j = m;\n      else i = m;\n    }\n    return i;\n  }\n  /* else must find a boundary in hash part */\n  else if (t->node == dummynode)  /* hash part is empty? */\n    return j;  /* that is easy... */\n  else return unbound_search(t, j);\n}\n\n\n\n#if defined(LUA_DEBUG)\n\nNode *luaH_mainposition (const Table *t, const TValue *key) {\n  return mainposition(t, key);\n}\n\nint luaH_isdummy (Node *n) { return n == dummynode; }\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ltable.h",
    "content": "/*\n** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $\n** Lua tables (hash)\n** See Copyright Notice in lua.h\n*/\n\n#ifndef ltable_h\n#define ltable_h\n\n#include \"lobject.h\"\n\n\n#define gnode(t,i)\t(&(t)->node[i])\n#define gkey(n)\t\t(&(n)->i_key.nk)\n#define gval(n)\t\t(&(n)->i_val)\n#define gnext(n)\t((n)->i_key.nk.next)\n\n#define key2tval(n)\t(&(n)->i_key.tvk)\n\n\nLUAI_FUNC const TValue *luaH_getnum (Table *t, int key);\nLUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);\nLUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);\nLUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);\nLUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);\nLUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);\nLUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash);\nLUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize);\nLUAI_FUNC void luaH_free (lua_State *L, Table *t);\nLUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);\nLUAI_FUNC int luaH_getn (Table *t);\n\n\n#if defined(LUA_DEBUG)\nLUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);\nLUAI_FUNC int luaH_isdummy (Node *n);\n#endif\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ltablib.c",
    "content": "/*\n** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $\n** Library for Table Manipulation\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stddef.h>\n\n#define ltablib_c\n#define LUA_LIB\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n#define aux_getn(L,n)\t(luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n))\n\n\nstatic int foreachi (lua_State *L) {\n  int i;\n  int n = aux_getn(L, 1);\n  luaL_checktype(L, 2, LUA_TFUNCTION);\n  for (i=1; i <= n; i++) {\n    lua_pushvalue(L, 2);  /* function */\n    lua_pushinteger(L, i);  /* 1st argument */\n    lua_rawgeti(L, 1, i);  /* 2nd argument */\n    lua_call(L, 2, 1);\n    if (!lua_isnil(L, -1))\n      return 1;\n    lua_pop(L, 1);  /* remove nil result */\n  }\n  return 0;\n}\n\n\nstatic int foreach (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n  luaL_checktype(L, 2, LUA_TFUNCTION);\n  lua_pushnil(L);  /* first key */\n  while (lua_next(L, 1)) {\n    lua_pushvalue(L, 2);  /* function */\n    lua_pushvalue(L, -3);  /* key */\n    lua_pushvalue(L, -3);  /* value */\n    lua_call(L, 2, 1);\n    if (!lua_isnil(L, -1))\n      return 1;\n    lua_pop(L, 2);  /* remove value and result */\n  }\n  return 0;\n}\n\n\nstatic int maxn (lua_State *L) {\n  lua_Number max = 0;\n  luaL_checktype(L, 1, LUA_TTABLE);\n  lua_pushnil(L);  /* first key */\n  while (lua_next(L, 1)) {\n    lua_pop(L, 1);  /* remove value */\n    if (lua_type(L, -1) == LUA_TNUMBER) {\n      lua_Number v = lua_tonumber(L, -1);\n      if (v > max) max = v;\n    }\n  }\n  lua_pushnumber(L, max);\n  return 1;\n}\n\n\nstatic int getn (lua_State *L) {\n  lua_pushinteger(L, aux_getn(L, 1));\n  return 1;\n}\n\n\nstatic int setn (lua_State *L) {\n  luaL_checktype(L, 1, LUA_TTABLE);\n#ifndef luaL_setn\n  luaL_setn(L, 1, luaL_checkint(L, 2));\n#else\n  luaL_error(L, LUA_QL(\"setn\") \" is obsolete\");\n#endif\n  lua_pushvalue(L, 1);\n  return 1;\n}\n\n\nstatic int tinsert (lua_State *L) {\n  int e = aux_getn(L, 1) + 1;  /* first empty element */\n  int pos;  /* where to insert new element */\n  switch (lua_gettop(L)) {\n    case 2: {  /* called with only 2 arguments */\n      pos = e;  /* insert new element at the end */\n      break;\n    }\n    case 3: {\n      int i;\n      pos = luaL_checkint(L, 2);  /* 2nd argument is the position */\n      if (pos > e) e = pos;  /* `grow' array if necessary */\n      for (i = e; i > pos; i--) {  /* move up elements */\n        lua_rawgeti(L, 1, i-1);\n        lua_rawseti(L, 1, i);  /* t[i] = t[i-1] */\n      }\n      break;\n    }\n    default: {\n      return luaL_error(L, \"wrong number of arguments to \" LUA_QL(\"insert\"));\n    }\n  }\n  luaL_setn(L, 1, e);  /* new size */\n  lua_rawseti(L, 1, pos);  /* t[pos] = v */\n  return 0;\n}\n\n\nstatic int tremove (lua_State *L) {\n  int e = aux_getn(L, 1);\n  int pos = luaL_optint(L, 2, e);\n  if (!(1 <= pos && pos <= e))  /* position is outside bounds? */\n   return 0;  /* nothing to remove */\n  luaL_setn(L, 1, e - 1);  /* t.n = n-1 */\n  lua_rawgeti(L, 1, pos);  /* result = t[pos] */\n  for ( ;pos<e; pos++) {\n    lua_rawgeti(L, 1, pos+1);\n    lua_rawseti(L, 1, pos);  /* t[pos] = t[pos+1] */\n  }\n  lua_pushnil(L);\n  lua_rawseti(L, 1, e);  /* t[e] = nil */\n  return 1;\n}\n\n\nstatic void addfield (lua_State *L, luaL_Buffer *b, int i) {\n  lua_rawgeti(L, 1, i);\n  if (!lua_isstring(L, -1))\n    luaL_error(L, \"invalid value (%s) at index %d in table for \"\n                  LUA_QL(\"concat\"), luaL_typename(L, -1), i);\n    luaL_addvalue(b);\n}\n\n\nstatic int tconcat (lua_State *L) {\n  luaL_Buffer b;\n  size_t lsep;\n  int i, last;\n  const char *sep = luaL_optlstring(L, 2, \"\", &lsep);\n  luaL_checktype(L, 1, LUA_TTABLE);\n  i = luaL_optint(L, 3, 1);\n  last = luaL_opt(L, luaL_checkint, 4, luaL_getn(L, 1));\n  luaL_buffinit(L, &b);\n  for (; i < last; i++) {\n    addfield(L, &b, i);\n    luaL_addlstring(&b, sep, lsep);\n  }\n  if (i == last)  /* add last value (if interval was not empty) */\n    addfield(L, &b, i);\n  luaL_pushresult(&b);\n  return 1;\n}\n\n\n\n/*\n** {======================================================\n** Quicksort\n** (based on `Algorithms in MODULA-3', Robert Sedgewick;\n**  Addison-Wesley, 1993.)\n*/\n\n\nstatic void set2 (lua_State *L, int i, int j) {\n  lua_rawseti(L, 1, i);\n  lua_rawseti(L, 1, j);\n}\n\nstatic int sort_comp (lua_State *L, int a, int b) {\n  if (!lua_isnil(L, 2)) {  /* function? */\n    int res;\n    lua_pushvalue(L, 2);\n    lua_pushvalue(L, a-1);  /* -1 to compensate function */\n    lua_pushvalue(L, b-2);  /* -2 to compensate function and `a' */\n    lua_call(L, 2, 1);\n    res = lua_toboolean(L, -1);\n    lua_pop(L, 1);\n    return res;\n  }\n  else  /* a < b? */\n    return lua_lessthan(L, a, b);\n}\n\nstatic void auxsort (lua_State *L, int l, int u) {\n  while (l < u) {  /* for tail recursion */\n    int i, j;\n    /* sort elements a[l], a[(l+u)/2] and a[u] */\n    lua_rawgeti(L, 1, l);\n    lua_rawgeti(L, 1, u);\n    if (sort_comp(L, -1, -2))  /* a[u] < a[l]? */\n      set2(L, l, u);  /* swap a[l] - a[u] */\n    else\n      lua_pop(L, 2);\n    if (u-l == 1) break;  /* only 2 elements */\n    i = (l+u)/2;\n    lua_rawgeti(L, 1, i);\n    lua_rawgeti(L, 1, l);\n    if (sort_comp(L, -2, -1))  /* a[i]<a[l]? */\n      set2(L, i, l);\n    else {\n      lua_pop(L, 1);  /* remove a[l] */\n      lua_rawgeti(L, 1, u);\n      if (sort_comp(L, -1, -2))  /* a[u]<a[i]? */\n        set2(L, i, u);\n      else\n        lua_pop(L, 2);\n    }\n    if (u-l == 2) break;  /* only 3 elements */\n    lua_rawgeti(L, 1, i);  /* Pivot */\n    lua_pushvalue(L, -1);\n    lua_rawgeti(L, 1, u-1);\n    set2(L, i, u-1);\n    /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */\n    i = l; j = u-1;\n    for (;;) {  /* invariant: a[l..i] <= P <= a[j..u] */\n      /* repeat ++i until a[i] >= P */\n      while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) {\n        if (i>u) luaL_error(L, \"invalid order function for sorting\");\n        lua_pop(L, 1);  /* remove a[i] */\n      }\n      /* repeat --j until a[j] <= P */\n      while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) {\n        if (j<l) luaL_error(L, \"invalid order function for sorting\");\n        lua_pop(L, 1);  /* remove a[j] */\n      }\n      if (j<i) {\n        lua_pop(L, 3);  /* pop pivot, a[i], a[j] */\n        break;\n      }\n      set2(L, i, j);\n    }\n    lua_rawgeti(L, 1, u-1);\n    lua_rawgeti(L, 1, i);\n    set2(L, u-1, i);  /* swap pivot (a[u-1]) with a[i] */\n    /* a[l..i-1] <= a[i] == P <= a[i+1..u] */\n    /* adjust so that smaller half is in [j..i] and larger one in [l..u] */\n    if (i-l < u-i) {\n      j=l; i=i-1; l=i+2;\n    }\n    else {\n      j=i+1; i=u; u=j-2;\n    }\n    auxsort(L, j, i);  /* call recursively the smaller one */\n  }  /* repeat the routine for the larger one */\n}\n\nstatic int sort (lua_State *L) {\n  int n = aux_getn(L, 1);\n  luaL_checkstack(L, 40, \"\");  /* assume array is smaller than 2^40 */\n  if (!lua_isnoneornil(L, 2))  /* is there a 2nd argument? */\n    luaL_checktype(L, 2, LUA_TFUNCTION);\n  lua_settop(L, 2);  /* make sure there is two arguments */\n  auxsort(L, 1, n);\n  return 0;\n}\n\n/* }====================================================== */\n\n\nstatic const luaL_Reg tab_funcs[] = {\n  {\"concat\", tconcat},\n  {\"foreach\", foreach},\n  {\"foreachi\", foreachi},\n  {\"getn\", getn},\n  {\"maxn\", maxn},\n  {\"insert\", tinsert},\n  {\"remove\", tremove},\n  {\"setn\", setn},\n  {\"sort\", sort},\n  {NULL, NULL}\n};\n\n\nLUALIB_API int luaopen_table (lua_State *L) {\n  luaL_register(L, LUA_TABLIBNAME, tab_funcs);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ltm.c",
    "content": "/*\n** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $\n** Tag methods\n** See Copyright Notice in lua.h\n*/\n\n\n#include <string.h>\n\n#define ltm_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"lobject.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"ltm.h\"\n\n\n\nconst char *const luaT_typenames[] = {\n  \"nil\", \"boolean\", \"userdata\", \"number\",\n  \"string\", \"table\", \"function\", \"userdata\", \"thread\",\n  \"proto\", \"upval\"\n};\n\n\nvoid luaT_init (lua_State *L) {\n  static const char *const luaT_eventname[] = {  /* ORDER TM */\n    \"__index\", \"__newindex\",\n    \"__gc\", \"__mode\", \"__eq\",\n    \"__add\", \"__sub\", \"__mul\", \"__div\", \"__mod\",\n    \"__pow\", \"__unm\", \"__len\", \"__lt\", \"__le\",\n    \"__concat\", \"__call\"\n  };\n  int i;\n  for (i=0; i<TM_N; i++) {\n    G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]);\n    luaS_fix(G(L)->tmname[i]);  /* never collect these names */\n  }\n}\n\n\n/*\n** function to be used with macro \"fasttm\": optimized for absence of\n** tag methods\n*/\nconst TValue *luaT_gettm (Table *events, TMS event, TString *ename) {\n  const TValue *tm = luaH_getstr(events, ename);\n  lua_assert(event <= TM_EQ);\n  if (ttisnil(tm)) {  /* no tag method? */\n    events->flags |= cast_byte(1u<<event);  /* cache this fact */\n    return NULL;\n  }\n  else return tm;\n}\n\n\nconst TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {\n  Table *mt;\n  switch (ttype(o)) {\n    case LUA_TTABLE:\n      mt = hvalue(o)->metatable;\n      break;\n    case LUA_TUSERDATA:\n      mt = uvalue(o)->metatable;\n      break;\n    default:\n      mt = G(L)->mt[ttype(o)];\n  }\n  return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/ltm.h",
    "content": "/*\n** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $\n** Tag methods\n** See Copyright Notice in lua.h\n*/\n\n#ifndef ltm_h\n#define ltm_h\n\n\n#include \"lobject.h\"\n\n\n/*\n* WARNING: if you change the order of this enumeration,\n* grep \"ORDER TM\"\n*/\ntypedef enum {\n  TM_INDEX,\n  TM_NEWINDEX,\n  TM_GC,\n  TM_MODE,\n  TM_EQ,  /* last tag method with `fast' access */\n  TM_ADD,\n  TM_SUB,\n  TM_MUL,\n  TM_DIV,\n  TM_MOD,\n  TM_POW,\n  TM_UNM,\n  TM_LEN,\n  TM_LT,\n  TM_LE,\n  TM_CONCAT,\n  TM_CALL,\n  TM_N\t\t/* number of elements in the enum */\n} TMS;\n\n\n\n#define gfasttm(g,et,e) ((et) == NULL ? NULL : \\\n  ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))\n\n#define fasttm(l,et,e)\tgfasttm(G(l), et, e)\n\nLUAI_DATA const char *const luaT_typenames[];\n\n\nLUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);\nLUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,\n                                                       TMS event);\nLUAI_FUNC void luaT_init (lua_State *L);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lua.c",
    "content": "/*\n** $Id: lua.c,v 1.160.1.2 2007/12/28 15:32:23 roberto Exp $\n** Lua stand-alone interpreter\n** See Copyright Notice in lua.h\n*/\n\n\n#include <signal.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define lua_c\n\n#include \"lua.h\"\n\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n\n\nstatic lua_State *globalL = NULL;\n\nstatic const char *progname = LUA_PROGNAME;\n\n\n\nstatic void lstop (lua_State *L, lua_Debug *ar) {\n  (void)ar;  /* unused arg. */\n  lua_sethook(L, NULL, 0, 0);\n  luaL_error(L, \"interrupted!\");\n}\n\n\nstatic void laction (int i) {\n  signal(i, SIG_DFL); /* if another SIGINT happens before lstop,\n                              terminate process (default action) */\n  lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);\n}\n\n\nstatic void print_usage (void) {\n  fprintf(stderr,\n  \"usage: %s [options] [script [args]].\\n\"\n  \"Available options are:\\n\"\n  \"  -e stat  execute string \" LUA_QL(\"stat\") \"\\n\"\n  \"  -l name  require library \" LUA_QL(\"name\") \"\\n\"\n  \"  -i       enter interactive mode after executing \" LUA_QL(\"script\") \"\\n\"\n  \"  -v       show version information\\n\"\n  \"  --       stop handling options\\n\"\n  \"  -        execute stdin and stop handling options\\n\"\n  ,\n  progname);\n  fflush(stderr);\n}\n\n\nstatic void l_message (const char *pname, const char *msg) {\n  if (pname) fprintf(stderr, \"%s: \", pname);\n  fprintf(stderr, \"%s\\n\", msg);\n  fflush(stderr);\n}\n\n\nstatic int report (lua_State *L, int status) {\n  if (status && !lua_isnil(L, -1)) {\n    const char *msg = lua_tostring(L, -1);\n    if (msg == NULL) msg = \"(error object is not a string)\";\n    l_message(progname, msg);\n    lua_pop(L, 1);\n  }\n  return status;\n}\n\n\nstatic int traceback (lua_State *L) {\n  if (!lua_isstring(L, 1))  /* 'message' not a string? */\n    return 1;  /* keep it intact */\n  lua_getfield(L, LUA_GLOBALSINDEX, \"debug\");\n  if (!lua_istable(L, -1)) {\n    lua_pop(L, 1);\n    return 1;\n  }\n  lua_getfield(L, -1, \"traceback\");\n  if (!lua_isfunction(L, -1)) {\n    lua_pop(L, 2);\n    return 1;\n  }\n  lua_pushvalue(L, 1);  /* pass error message */\n  lua_pushinteger(L, 2);  /* skip this function and traceback */\n  lua_call(L, 2, 1);  /* call debug.traceback */\n  return 1;\n}\n\n\nstatic int docall (lua_State *L, int narg, int clear) {\n  int status;\n  int base = lua_gettop(L) - narg;  /* function index */\n  lua_pushcfunction(L, traceback);  /* push traceback function */\n  lua_insert(L, base);  /* put it under chunk and args */\n  signal(SIGINT, laction);\n  status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);\n  signal(SIGINT, SIG_DFL);\n  lua_remove(L, base);  /* remove traceback function */\n  /* force a complete garbage collection in case of errors */\n  if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0);\n  return status;\n}\n\n\nstatic void print_version (void) {\n  l_message(NULL, LUA_RELEASE \"  \" LUA_COPYRIGHT);\n}\n\n\nstatic int getargs (lua_State *L, char **argv, int n) {\n  int narg;\n  int i;\n  int argc = 0;\n  while (argv[argc]) argc++;  /* count total number of arguments */\n  narg = argc - (n + 1);  /* number of arguments to the script */\n  luaL_checkstack(L, narg + 3, \"too many arguments to script\");\n  for (i=n+1; i < argc; i++)\n    lua_pushstring(L, argv[i]);\n  lua_createtable(L, narg, n + 1);\n  for (i=0; i < argc; i++) {\n    lua_pushstring(L, argv[i]);\n    lua_rawseti(L, -2, i - n);\n  }\n  return narg;\n}\n\n\nstatic int dofile (lua_State *L, const char *name) {\n  int status = luaL_loadfile(L, name) || docall(L, 0, 1);\n  return report(L, status);\n}\n\n\nstatic int dostring (lua_State *L, const char *s, const char *name) {\n  int status = luaL_loadbuffer(L, s, strlen(s), name) || docall(L, 0, 1);\n  return report(L, status);\n}\n\n\nstatic int dolibrary (lua_State *L, const char *name) {\n  lua_getglobal(L, \"require\");\n  lua_pushstring(L, name);\n  return report(L, docall(L, 1, 1));\n}\n\n\nstatic const char *get_prompt (lua_State *L, int firstline) {\n  const char *p;\n  lua_getfield(L, LUA_GLOBALSINDEX, firstline ? \"_PROMPT\" : \"_PROMPT2\");\n  p = lua_tostring(L, -1);\n  if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2);\n  lua_pop(L, 1);  /* remove global */\n  return p;\n}\n\n\nstatic int incomplete (lua_State *L, int status) {\n  if (status == LUA_ERRSYNTAX) {\n    size_t lmsg;\n    const char *msg = lua_tolstring(L, -1, &lmsg);\n    const char *tp = msg + lmsg - (sizeof(LUA_QL(\"<eof>\")) - 1);\n    if (strstr(msg, LUA_QL(\"<eof>\")) == tp) {\n      lua_pop(L, 1);\n      return 1;\n    }\n  }\n  return 0;  /* else... */\n}\n\n\nstatic int pushline (lua_State *L, int firstline) {\n  char buffer[LUA_MAXINPUT];\n  char *b = buffer;\n  size_t l;\n  const char *prmt = get_prompt(L, firstline);\n  if (lua_readline(L, b, prmt) == 0)\n    return 0;  /* no input */\n  l = strlen(b);\n  if (l > 0 && b[l-1] == '\\n')  /* line ends with newline? */\n    b[l-1] = '\\0';  /* remove it */\n  if (firstline && b[0] == '=')  /* first line starts with `=' ? */\n    lua_pushfstring(L, \"return %s\", b+1);  /* change it to `return' */\n  else\n    lua_pushstring(L, b);\n  lua_freeline(L, b);\n  return 1;\n}\n\n\nstatic int loadline (lua_State *L) {\n  int status;\n  lua_settop(L, 0);\n  if (!pushline(L, 1))\n    return -1;  /* no input */\n  for (;;) {  /* repeat until gets a complete line */\n    status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), \"=stdin\");\n    if (!incomplete(L, status)) break;  /* cannot try to add lines? */\n    if (!pushline(L, 0))  /* no more input? */\n      return -1;\n    lua_pushliteral(L, \"\\n\");  /* add a new line... */\n    lua_insert(L, -2);  /* ...between the two lines */\n    lua_concat(L, 3);  /* join them */\n  }\n  lua_saveline(L, 1);\n  lua_remove(L, 1);  /* remove line */\n  return status;\n}\n\n\nstatic void dotty (lua_State *L) {\n  int status;\n  const char *oldprogname = progname;\n  progname = NULL;\n  while ((status = loadline(L)) != -1) {\n    if (status == 0) status = docall(L, 0, 0);\n    report(L, status);\n    if (status == 0 && lua_gettop(L) > 0) {  /* any result to print? */\n      lua_getglobal(L, \"print\");\n      lua_insert(L, 1);\n      if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0)\n        l_message(progname, lua_pushfstring(L,\n                               \"error calling \" LUA_QL(\"print\") \" (%s)\",\n                               lua_tostring(L, -1)));\n    }\n  }\n  lua_settop(L, 0);  /* clear stack */\n  fputs(\"\\n\", stdout);\n  fflush(stdout);\n  progname = oldprogname;\n}\n\n\nstatic int handle_script (lua_State *L, char **argv, int n) {\n  int status;\n  const char *fname;\n  int narg = getargs(L, argv, n);  /* collect arguments */\n  lua_setglobal(L, \"arg\");\n  fname = argv[n];\n  if (strcmp(fname, \"-\") == 0 && strcmp(argv[n-1], \"--\") != 0) \n    fname = NULL;  /* stdin */\n  status = luaL_loadfile(L, fname);\n  lua_insert(L, -(narg+1));\n  if (status == 0)\n    status = docall(L, narg, 0);\n  else\n    lua_pop(L, narg);      \n  return report(L, status);\n}\n\n\n/* check that argument has no extra characters at the end */\n#define notail(x)\t{if ((x)[2] != '\\0') return -1;}\n\n\nstatic int collectargs (char **argv, int *pi, int *pv, int *pe) {\n  int i;\n  for (i = 1; argv[i] != NULL; i++) {\n    if (argv[i][0] != '-')  /* not an option? */\n        return i;\n    switch (argv[i][1]) {  /* option */\n      case '-':\n        notail(argv[i]);\n        return (argv[i+1] != NULL ? i+1 : 0);\n      case '\\0':\n        return i;\n      case 'i':\n        notail(argv[i]);\n        *pi = 1;  /* go through */\n      case 'v':\n        notail(argv[i]);\n        *pv = 1;\n        break;\n      case 'e':\n        *pe = 1;  /* go through */\n      case 'l':\n        if (argv[i][2] == '\\0') {\n          i++;\n          if (argv[i] == NULL) return -1;\n        }\n        break;\n      default: return -1;  /* invalid option */\n    }\n  }\n  return 0;\n}\n\n\nstatic int runargs (lua_State *L, char **argv, int n) {\n  int i;\n  for (i = 1; i < n; i++) {\n    if (argv[i] == NULL) continue;\n    lua_assert(argv[i][0] == '-');\n    switch (argv[i][1]) {  /* option */\n      case 'e': {\n        const char *chunk = argv[i] + 2;\n        if (*chunk == '\\0') chunk = argv[++i];\n        lua_assert(chunk != NULL);\n        if (dostring(L, chunk, \"=(command line)\") != 0)\n          return 1;\n        break;\n      }\n      case 'l': {\n        const char *filename = argv[i] + 2;\n        if (*filename == '\\0') filename = argv[++i];\n        lua_assert(filename != NULL);\n        if (dolibrary(L, filename))\n          return 1;  /* stop if file fails */\n        break;\n      }\n      default: break;\n    }\n  }\n  return 0;\n}\n\n\nstatic int handle_luainit (lua_State *L) {\n  const char *init = getenv(LUA_INIT);\n  if (init == NULL) return 0;  /* status OK */\n  else if (init[0] == '@')\n    return dofile(L, init+1);\n  else\n    return dostring(L, init, \"=\" LUA_INIT);\n}\n\n\nstruct Smain {\n  int argc;\n  char **argv;\n  int status;\n};\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lua.h",
    "content": "/*\n** $Id: lua.h,v 1.218.1.7 2012/01/13 20:36:20 roberto Exp $\n** Lua - An Extensible Extension Language\n** Lua.org, PUC-Rio, Brazil (http://www.lua.org)\n** See Copyright Notice at the end of this file\n*/\n\n\n#ifndef lua_h\n#define lua_h\n\n#include <stdarg.h>\n#include <stddef.h>\n\n\n#include \"luaconf.h\"\n\n\n#define LUA_VERSION\t\"Lua 5.1\"\n#define LUA_RELEASE\t\"Lua 5.1.5\"\n#define LUA_VERSION_NUM\t501\n#define LUA_COPYRIGHT\t\"Copyright (C) 1994-2012 Lua.org, PUC-Rio\"\n#define LUA_AUTHORS \t\"R. Ierusalimschy, L. H. de Figueiredo & W. Celes\"\n\n\n/* mark for precompiled code (`<esc>Lua') */\n#define\tLUA_SIGNATURE\t\"\\033Lua\"\n\n/* option for multiple returns in `lua_pcall' and `lua_call' */\n#define LUA_MULTRET\t(-1)\n\n\n/*\n** pseudo-indices\n*/\n#define LUA_REGISTRYINDEX\t(-10000)\n#define LUA_ENVIRONINDEX\t(-10001)\n#define LUA_GLOBALSINDEX\t(-10002)\n#define lua_upvalueindex(i)\t(LUA_GLOBALSINDEX-(i))\n\n\n/* thread status; 0 is OK */\n#define LUA_YIELD\t1\n#define LUA_ERRRUN\t2\n#define LUA_ERRSYNTAX\t3\n#define LUA_ERRMEM\t4\n#define LUA_ERRERR\t5\n\n\ntypedef struct lua_State lua_State;\n\ntypedef int (*lua_CFunction) (lua_State *L);\n\n\n/*\n** functions that read/write blocks when loading/dumping Lua chunks\n*/\ntypedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);\n\ntypedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);\n\n\n/*\n** prototype for memory-allocation functions\n*/\ntypedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);\n\n\n/*\n** basic types\n*/\n#define LUA_TNONE\t\t(-1)\n\n#define LUA_TNIL\t\t0\n#define LUA_TBOOLEAN\t\t1\n#define LUA_TLIGHTUSERDATA\t2\n#define LUA_TNUMBER\t\t3\n#define LUA_TSTRING\t\t4\n#define LUA_TTABLE\t\t5\n#define LUA_TFUNCTION\t\t6\n#define LUA_TUSERDATA\t\t7\n#define LUA_TTHREAD\t\t8\n\n\n\n/* minimum Lua stack available to a C function */\n#define LUA_MINSTACK\t20\n\n\n/*\n** generic extra include file\n*/\n#if defined(LUA_USER_H)\n#include LUA_USER_H\n#endif\n\n\n/* type of numbers in Lua */\ntypedef LUA_NUMBER lua_Number;\n\n\n/* type for integer functions */\ntypedef LUA_INTEGER lua_Integer;\n\n\n\n/*\n** state manipulation\n*/\nLUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);\nLUA_API void       (lua_close) (lua_State *L);\nLUA_API lua_State *(lua_newthread) (lua_State *L);\n\nLUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);\n\n\n/*\n** basic stack manipulation\n*/\nLUA_API int   (lua_gettop) (lua_State *L);\nLUA_API void  (lua_settop) (lua_State *L, int idx);\nLUA_API void  (lua_pushvalue) (lua_State *L, int idx);\nLUA_API void  (lua_remove) (lua_State *L, int idx);\nLUA_API void  (lua_insert) (lua_State *L, int idx);\nLUA_API void  (lua_replace) (lua_State *L, int idx);\nLUA_API int   (lua_checkstack) (lua_State *L, int sz);\n\nLUA_API void  (lua_xmove) (lua_State *from, lua_State *to, int n);\n\n\n/*\n** access functions (stack -> C)\n*/\n\nLUA_API int             (lua_isnumber) (lua_State *L, int idx);\nLUA_API int             (lua_isstring) (lua_State *L, int idx);\nLUA_API int             (lua_iscfunction) (lua_State *L, int idx);\nLUA_API int             (lua_isuserdata) (lua_State *L, int idx);\nLUA_API int             (lua_type) (lua_State *L, int idx);\nLUA_API const char     *(lua_typename) (lua_State *L, int tp);\n\nLUA_API int            (lua_equal) (lua_State *L, int idx1, int idx2);\nLUA_API int            (lua_rawequal) (lua_State *L, int idx1, int idx2);\nLUA_API int            (lua_lessthan) (lua_State *L, int idx1, int idx2);\n\nLUA_API lua_Number      (lua_tonumber) (lua_State *L, int idx);\nLUA_API lua_Integer     (lua_tointeger) (lua_State *L, int idx);\nLUA_API int             (lua_toboolean) (lua_State *L, int idx);\nLUA_API const char     *(lua_tolstring) (lua_State *L, int idx, size_t *len);\nLUA_API size_t          (lua_objlen) (lua_State *L, int idx);\nLUA_API lua_CFunction   (lua_tocfunction) (lua_State *L, int idx);\nLUA_API void\t       *(lua_touserdata) (lua_State *L, int idx);\nLUA_API lua_State      *(lua_tothread) (lua_State *L, int idx);\nLUA_API const void     *(lua_topointer) (lua_State *L, int idx);\n\n\n/*\n** push functions (C -> stack)\n*/\nLUA_API void  (lua_pushnil) (lua_State *L);\nLUA_API void  (lua_pushnumber) (lua_State *L, lua_Number n);\nLUA_API void  (lua_pushinteger) (lua_State *L, lua_Integer n);\nLUA_API void  (lua_pushlstring) (lua_State *L, const char *s, size_t l);\nLUA_API void  (lua_pushstring) (lua_State *L, const char *s);\nLUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,\n                                                      va_list argp);\nLUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);\nLUA_API void  (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);\nLUA_API void  (lua_pushboolean) (lua_State *L, int b);\nLUA_API void  (lua_pushlightuserdata) (lua_State *L, void *p);\nLUA_API int   (lua_pushthread) (lua_State *L);\n\n\n/*\n** get functions (Lua -> stack)\n*/\nLUA_API void  (lua_gettable) (lua_State *L, int idx);\nLUA_API void  (lua_getfield) (lua_State *L, int idx, const char *k);\nLUA_API void  (lua_rawget) (lua_State *L, int idx);\nLUA_API void  (lua_rawgeti) (lua_State *L, int idx, int n);\nLUA_API void  (lua_createtable) (lua_State *L, int narr, int nrec);\nLUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);\nLUA_API int   (lua_getmetatable) (lua_State *L, int objindex);\nLUA_API void  (lua_getfenv) (lua_State *L, int idx);\n\n\n/*\n** set functions (stack -> Lua)\n*/\nLUA_API void  (lua_settable) (lua_State *L, int idx);\nLUA_API void  (lua_setfield) (lua_State *L, int idx, const char *k);\nLUA_API void  (lua_rawset) (lua_State *L, int idx);\nLUA_API void  (lua_rawseti) (lua_State *L, int idx, int n);\nLUA_API int   (lua_setmetatable) (lua_State *L, int objindex);\nLUA_API int   (lua_setfenv) (lua_State *L, int idx);\n\n\n/*\n** `load' and `call' functions (load and run Lua code)\n*/\nLUA_API void  (lua_call) (lua_State *L, int nargs, int nresults);\nLUA_API int   (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);\nLUA_API int   (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);\nLUA_API int   (lua_load) (lua_State *L, lua_Reader reader, void *dt,\n                                        const char *chunkname);\n\nLUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);\n\n\n/*\n** coroutine functions\n*/\nLUA_API int  (lua_yield) (lua_State *L, int nresults);\nLUA_API int  (lua_resume) (lua_State *L, int narg);\nLUA_API int  (lua_status) (lua_State *L);\n\n/*\n** garbage-collection function and options\n*/\n\n#define LUA_GCSTOP\t\t0\n#define LUA_GCRESTART\t\t1\n#define LUA_GCCOLLECT\t\t2\n#define LUA_GCCOUNT\t\t3\n#define LUA_GCCOUNTB\t\t4\n#define LUA_GCSTEP\t\t5\n#define LUA_GCSETPAUSE\t\t6\n#define LUA_GCSETSTEPMUL\t7\n\nLUA_API int (lua_gc) (lua_State *L, int what, int data);\n\n\n/*\n** miscellaneous functions\n*/\n\nLUA_API int   (lua_error) (lua_State *L);\n\nLUA_API int   (lua_next) (lua_State *L, int idx);\n\nLUA_API void  (lua_concat) (lua_State *L, int n);\n\nLUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);\nLUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);\n\n\n\n/* \n** ===============================================================\n** some useful macros\n** ===============================================================\n*/\n\n#define lua_pop(L,n)\t\tlua_settop(L, -(n)-1)\n\n#define lua_newtable(L)\t\tlua_createtable(L, 0, 0)\n\n#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))\n\n#define lua_pushcfunction(L,f)\tlua_pushcclosure(L, (f), 0)\n\n#define lua_strlen(L,i)\t\tlua_objlen(L, (i))\n\n#define lua_isfunction(L,n)\t(lua_type(L, (n)) == LUA_TFUNCTION)\n#define lua_istable(L,n)\t(lua_type(L, (n)) == LUA_TTABLE)\n#define lua_islightuserdata(L,n)\t(lua_type(L, (n)) == LUA_TLIGHTUSERDATA)\n#define lua_isnil(L,n)\t\t(lua_type(L, (n)) == LUA_TNIL)\n#define lua_isboolean(L,n)\t(lua_type(L, (n)) == LUA_TBOOLEAN)\n#define lua_isthread(L,n)\t(lua_type(L, (n)) == LUA_TTHREAD)\n#define lua_isnone(L,n)\t\t(lua_type(L, (n)) == LUA_TNONE)\n#define lua_isnoneornil(L, n)\t(lua_type(L, (n)) <= 0)\n\n#define lua_pushliteral(L, s)\t\\\n\tlua_pushlstring(L, \"\" s, (sizeof(s)/sizeof(char))-1)\n\n#define lua_setglobal(L,s)\tlua_setfield(L, LUA_GLOBALSINDEX, (s))\n#define lua_getglobal(L,s)\tlua_getfield(L, LUA_GLOBALSINDEX, (s))\n\n#define lua_tostring(L,i)\tlua_tolstring(L, (i), NULL)\n\n\n\n/*\n** compatibility macros and functions\n*/\n\n#define lua_open()\tluaL_newstate()\n\n#define lua_getregistry(L)\tlua_pushvalue(L, LUA_REGISTRYINDEX)\n\n#define lua_getgccount(L)\tlua_gc(L, LUA_GCCOUNT, 0)\n\n#define lua_Chunkreader\t\tlua_Reader\n#define lua_Chunkwriter\t\tlua_Writer\n\n\n/* hack */\nLUA_API void lua_setlevel\t(lua_State *from, lua_State *to);\n\n\n/*\n** {======================================================================\n** Debug API\n** =======================================================================\n*/\n\n\n/*\n** Event codes\n*/\n#define LUA_HOOKCALL\t0\n#define LUA_HOOKRET\t1\n#define LUA_HOOKLINE\t2\n#define LUA_HOOKCOUNT\t3\n#define LUA_HOOKTAILRET 4\n\n\n/*\n** Event masks\n*/\n#define LUA_MASKCALL\t(1 << LUA_HOOKCALL)\n#define LUA_MASKRET\t(1 << LUA_HOOKRET)\n#define LUA_MASKLINE\t(1 << LUA_HOOKLINE)\n#define LUA_MASKCOUNT\t(1 << LUA_HOOKCOUNT)\n\ntypedef struct lua_Debug lua_Debug;  /* activation record */\n\n\n/* Functions to be called by the debuger in specific events */\ntypedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);\n\n\nLUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);\nLUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);\nLUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);\nLUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);\nLUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);\nLUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);\n\nLUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);\nLUA_API lua_Hook lua_gethook (lua_State *L);\nLUA_API int lua_gethookmask (lua_State *L);\nLUA_API int lua_gethookcount (lua_State *L);\n\n\nstruct lua_Debug {\n  int event;\n  const char *name;\t/* (n) */\n  const char *namewhat;\t/* (n) `global', `local', `field', `method' */\n  const char *what;\t/* (S) `Lua', `C', `main', `tail' */\n  const char *source;\t/* (S) */\n  int currentline;\t/* (l) */\n  int nups;\t\t/* (u) number of upvalues */\n  int linedefined;\t/* (S) */\n  int lastlinedefined;\t/* (S) */\n  char short_src[LUA_IDSIZE]; /* (S) */\n  /* private part */\n  int i_ci;  /* active function */\n};\n\n/* }====================================================================== */\n\n\n/******************************************************************************\n* Copyright (C) 1994-2012 Lua.org, PUC-Rio.  All rights reserved.\n*\n* Permission is hereby granted, free of charge, to any person obtaining\n* a copy of this software and associated documentation files (the\n* \"Software\"), to deal in the Software without restriction, including\n* without limitation the rights to use, copy, modify, merge, publish,\n* distribute, sublicense, and/or sell copies of the Software, and to\n* permit persons to whom the Software is furnished to do so, subject to\n* the following conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n******************************************************************************/\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/luaconf.h",
    "content": "/*\n** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $\n** Configuration file for Lua\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lconfig_h\n#define lconfig_h\n\n#include <limits.h>\n#include <stddef.h>\n\n\n/*\n** ==================================================================\n** Search for \"@@\" to find all configurable definitions.\n** ===================================================================\n*/\n\n\n/*\n@@ LUA_ANSI controls the use of non-ansi features.\n** CHANGE it (define it) if you want Lua to avoid the use of any\n** non-ansi feature or library.\n*/\n#if defined(__STRICT_ANSI__)\n#define LUA_ANSI\n#endif\n\n\n#if !defined(LUA_ANSI) && defined(_WIN32)\n#define LUA_WIN\n#endif\n\n#if defined(LUA_USE_LINUX)\n#define LUA_USE_POSIX\n#define LUA_USE_DLOPEN\t\t/* needs an extra library: -ldl */\n#define LUA_USE_READLINE\t/* needs some extra libraries */\n#endif\n\n#if defined(LUA_USE_MACOSX)\n#define LUA_USE_POSIX\n#define LUA_DL_DYLD\t\t/* does not need extra library */\n#endif\n\n\n\n/*\n@@ LUA_USE_POSIX includes all functionallity listed as X/Open System\n@* Interfaces Extension (XSI).\n** CHANGE it (define it) if your system is XSI compatible.\n*/\n#if defined(LUA_USE_POSIX)\n#define LUA_USE_MKSTEMP\n#define LUA_USE_ISATTY\n#define LUA_USE_POPEN\n#define LUA_USE_ULONGJMP\n#endif\n\n\n/*\n@@ LUA_PATH and LUA_CPATH are the names of the environment variables that\n@* Lua check to set its paths.\n@@ LUA_INIT is the name of the environment variable that Lua\n@* checks for initialization code.\n** CHANGE them if you want different names.\n*/\n#define LUA_PATH        \"LUA_PATH\"\n#define LUA_CPATH       \"LUA_CPATH\"\n#define LUA_INIT\t\"LUA_INIT\"\n\n\n/*\n@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for\n@* Lua libraries.\n@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for\n@* C libraries.\n** CHANGE them if your machine has a non-conventional directory\n** hierarchy or if you want to install your libraries in\n** non-conventional directories.\n*/\n#if defined(_WIN32)\n/*\n** In Windows, any exclamation mark ('!') in the path is replaced by the\n** path of the directory of the executable file of the current process.\n*/\n#define LUA_LDIR\t\"!\\\\lua\\\\\"\n#define LUA_CDIR\t\"!\\\\\"\n#define LUA_PATH_DEFAULT  \\\n\t\t\".\\\\?.lua;\"  LUA_LDIR\"?.lua;\"  LUA_LDIR\"?\\\\init.lua;\" \\\n\t\t             LUA_CDIR\"?.lua;\"  LUA_CDIR\"?\\\\init.lua\"\n#define LUA_CPATH_DEFAULT \\\n\t\".\\\\?.dll;\"  LUA_CDIR\"?.dll;\" LUA_CDIR\"loadall.dll\"\n\n#else\n#define LUA_ROOT\t\"/usr/local/\"\n#define LUA_LDIR\tLUA_ROOT \"share/lua/5.1/\"\n#define LUA_CDIR\tLUA_ROOT \"lib/lua/5.1/\"\n#define LUA_PATH_DEFAULT  \\\n\t\t\"./?.lua;\"  LUA_LDIR\"?.lua;\"  LUA_LDIR\"?/init.lua;\" \\\n\t\t            LUA_CDIR\"?.lua;\"  LUA_CDIR\"?/init.lua\"\n#define LUA_CPATH_DEFAULT \\\n\t\"./?.so;\"  LUA_CDIR\"?.so;\" LUA_CDIR\"loadall.so\"\n#endif\n\n\n/*\n@@ LUA_DIRSEP is the directory separator (for submodules).\n** CHANGE it if your machine does not use \"/\" as the directory separator\n** and is not Windows. (On Windows Lua automatically uses \"\\\".)\n*/\n#if defined(_WIN32)\n#define LUA_DIRSEP\t\"\\\\\"\n#else\n#define LUA_DIRSEP\t\"/\"\n#endif\n\n\n/*\n@@ LUA_PATHSEP is the character that separates templates in a path.\n@@ LUA_PATH_MARK is the string that marks the substitution points in a\n@* template.\n@@ LUA_EXECDIR in a Windows path is replaced by the executable's\n@* directory.\n@@ LUA_IGMARK is a mark to ignore all before it when bulding the\n@* luaopen_ function name.\n** CHANGE them if for some reason your system cannot use those\n** characters. (E.g., if one of those characters is a common character\n** in file/directory names.) Probably you do not need to change them.\n*/\n#define LUA_PATHSEP\t\";\"\n#define LUA_PATH_MARK\t\"?\"\n#define LUA_EXECDIR\t\"!\"\n#define LUA_IGMARK\t\"-\"\n\n\n/*\n@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.\n** CHANGE that if ptrdiff_t is not adequate on your machine. (On most\n** machines, ptrdiff_t gives a good choice between int or long.)\n*/\n#define LUA_INTEGER\tptrdiff_t\n\n\n/*\n@@ LUA_API is a mark for all core API functions.\n@@ LUALIB_API is a mark for all standard library functions.\n** CHANGE them if you need to define those functions in some special way.\n** For instance, if you want to create one Windows DLL with the core and\n** the libraries, you may want to use the following definition (define\n** LUA_BUILD_AS_DLL to get it).\n*/\n#if defined(LUA_BUILD_AS_DLL)\n\n#if defined(LUA_CORE) || defined(LUA_LIB)\n#define LUA_API __declspec(dllexport)\n#else\n#define LUA_API __declspec(dllimport)\n#endif\n\n#else\n\n#define LUA_API\t\textern\n\n#endif\n\n/* more often than not the libs go together with the core */\n#define LUALIB_API\tLUA_API\n\n\n/*\n@@ LUAI_FUNC is a mark for all extern functions that are not to be\n@* exported to outside modules.\n@@ LUAI_DATA is a mark for all extern (const) variables that are not to\n@* be exported to outside modules.\n** CHANGE them if you need to mark them in some special way. Elf/gcc\n** (versions 3.2 and later) mark them as \"hidden\" to optimize access\n** when Lua is compiled as a shared library.\n*/\n#if defined(luaall_c)\n#define LUAI_FUNC\tstatic\n#define LUAI_DATA\t/* empty */\n\n#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \\\n      defined(__ELF__)\n#define LUAI_FUNC\t__attribute__((visibility(\"hidden\"))) extern\n#define LUAI_DATA\tLUAI_FUNC\n\n#else\n#define LUAI_FUNC\textern\n#define LUAI_DATA\textern\n#endif\n\n\n\n/*\n@@ LUA_QL describes how error messages quote program elements.\n** CHANGE it if you want a different appearance.\n*/\n#define LUA_QL(x)\t\"'\" x \"'\"\n#define LUA_QS\t\tLUA_QL(\"%s\")\n\n\n/*\n@@ LUA_IDSIZE gives the maximum size for the description of the source\n@* of a function in debug information.\n** CHANGE it if you want a different size.\n*/\n#define LUA_IDSIZE\t60\n\n\n/*\n** {==================================================================\n** Stand-alone configuration\n** ===================================================================\n*/\n\n#if defined(lua_c) || defined(luaall_c)\n\n/*\n@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that\n@* is, whether we're running lua interactively).\n** CHANGE it if you have a better definition for non-POSIX/non-Windows\n** systems.\n*/\n#if defined(LUA_USE_ISATTY)\n#include <unistd.h>\n#define lua_stdin_is_tty()\tisatty(0)\n#elif defined(LUA_WIN)\n#include <io.h>\n#include <stdio.h>\n#define lua_stdin_is_tty()\t_isatty(_fileno(stdin))\n#else\n#define lua_stdin_is_tty()\t1  /* assume stdin is a tty */\n#endif\n\n\n/*\n@@ LUA_PROMPT is the default prompt used by stand-alone Lua.\n@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua.\n** CHANGE them if you want different prompts. (You can also change the\n** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.)\n*/\n#define LUA_PROMPT\t\t\"> \"\n#define LUA_PROMPT2\t\t\">> \"\n\n\n/*\n@@ LUA_PROGNAME is the default name for the stand-alone Lua program.\n** CHANGE it if your stand-alone interpreter has a different name and\n** your system is not able to detect that name automatically.\n*/\n#define LUA_PROGNAME\t\t\"lua\"\n\n\n/*\n@@ LUA_MAXINPUT is the maximum length for an input line in the\n@* stand-alone interpreter.\n** CHANGE it if you need longer lines.\n*/\n#define LUA_MAXINPUT\t512\n\n\n/*\n@@ lua_readline defines how to show a prompt and then read a line from\n@* the standard input.\n@@ lua_saveline defines how to \"save\" a read line in a \"history\".\n@@ lua_freeline defines how to free a line read by lua_readline.\n** CHANGE them if you want to improve this functionality (e.g., by using\n** GNU readline and history facilities).\n*/\n#if defined(LUA_USE_READLINE)\n#include <stdio.h>\n#include <readline/readline.h>\n#include <readline/history.h>\n#define lua_readline(L,b,p)\t((void)L, ((b)=readline(p)) != NULL)\n#define lua_saveline(L,idx) \\\n\tif (lua_strlen(L,idx) > 0)  /* non-empty line? */ \\\n\t  add_history(lua_tostring(L, idx));  /* add it to history */\n#define lua_freeline(L,b)\t((void)L, free(b))\n#else\n#define lua_readline(L,b,p)\t\\\n\t((void)L, fputs(p, stdout), fflush(stdout),  /* show prompt */ \\\n\tfgets(b, LUA_MAXINPUT, stdin) != NULL)  /* get line */\n#define lua_saveline(L,idx)\t{ (void)L; (void)idx; }\n#define lua_freeline(L,b)\t{ (void)L; (void)b; }\n#endif\n\n#endif\n\n/* }================================================================== */\n\n\n/*\n@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles\n@* as a percentage.\n** CHANGE it if you want the GC to run faster or slower (higher values\n** mean larger pauses which mean slower collection.) You can also change\n** this value dynamically.\n*/\n#define LUAI_GCPAUSE\t200  /* 200% (wait memory to double before next GC) */\n\n\n/*\n@@ LUAI_GCMUL defines the default speed of garbage collection relative to\n@* memory allocation as a percentage.\n** CHANGE it if you want to change the granularity of the garbage\n** collection. (Higher values mean coarser collections. 0 represents\n** infinity, where each step performs a full collection.) You can also\n** change this value dynamically.\n*/\n#define LUAI_GCMUL\t200 /* GC runs 'twice the speed' of memory allocation */\n\n\n\n/*\n@@ LUA_COMPAT_GETN controls compatibility with old getn behavior.\n** CHANGE it (define it) if you want exact compatibility with the\n** behavior of setn/getn in Lua 5.0.\n*/\n#undef LUA_COMPAT_GETN\n\n/*\n@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib.\n** CHANGE it to undefined as soon as you do not need a global 'loadlib'\n** function (the function is still available as 'package.loadlib').\n*/\n#undef LUA_COMPAT_LOADLIB\n\n/*\n@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature.\n** CHANGE it to undefined as soon as your programs use only '...' to\n** access vararg parameters (instead of the old 'arg' table).\n*/\n#define LUA_COMPAT_VARARG\n\n/*\n@@ LUA_COMPAT_MOD controls compatibility with old math.mod function.\n** CHANGE it to undefined as soon as your programs use 'math.fmod' or\n** the new '%' operator instead of 'math.mod'.\n*/\n#define LUA_COMPAT_MOD\n\n/*\n@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting\n@* facility.\n** CHANGE it to 2 if you want the old behaviour, or undefine it to turn\n** off the advisory error when nesting [[...]].\n*/\n#define LUA_COMPAT_LSTR\t\t1\n\n/*\n@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.\n** CHANGE it to undefined as soon as you rename 'string.gfind' to\n** 'string.gmatch'.\n*/\n#define LUA_COMPAT_GFIND\n\n/*\n@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'\n@* behavior.\n** CHANGE it to undefined as soon as you replace to 'luaL_register'\n** your uses of 'luaL_openlib'\n*/\n#define LUA_COMPAT_OPENLIB\n\n\n\n/*\n@@ luai_apicheck is the assert macro used by the Lua-C API.\n** CHANGE luai_apicheck if you want Lua to perform some checks in the\n** parameters it gets from API calls. This may slow down the interpreter\n** a bit, but may be quite useful when debugging C code that interfaces\n** with Lua. A useful redefinition is to use assert.h.\n*/\n#if defined(LUA_USE_APICHECK)\n#include <assert.h>\n#define luai_apicheck(L,o)\t{ (void)L; assert(o); }\n#else\n#define luai_apicheck(L,o)\t{ (void)L; }\n#endif\n\n\n/*\n@@ LUAI_BITSINT defines the number of bits in an int.\n** CHANGE here if Lua cannot automatically detect the number of bits of\n** your machine. Probably you do not need to change this.\n*/\n/* avoid overflows in comparison */\n#if INT_MAX-20 < 32760\n#define LUAI_BITSINT\t16\n#elif INT_MAX > 2147483640L\n/* int has at least 32 bits */\n#define LUAI_BITSINT\t32\n#else\n#error \"you must define LUA_BITSINT with number of bits in an integer\"\n#endif\n\n\n/*\n@@ LUAI_UINT32 is an unsigned integer with at least 32 bits.\n@@ LUAI_INT32 is an signed integer with at least 32 bits.\n@@ LUAI_UMEM is an unsigned integer big enough to count the total\n@* memory used by Lua.\n@@ LUAI_MEM is a signed integer big enough to count the total memory\n@* used by Lua.\n** CHANGE here if for some weird reason the default definitions are not\n** good enough for your machine. (The definitions in the 'else'\n** part always works, but may waste space on machines with 64-bit\n** longs.) Probably you do not need to change this.\n*/\n#if LUAI_BITSINT >= 32\n#define LUAI_UINT32\tunsigned int\n#define LUAI_INT32\tint\n#define LUAI_MAXINT32\tINT_MAX\n#define LUAI_UMEM\tsize_t\n#define LUAI_MEM\tptrdiff_t\n#else\n/* 16-bit ints */\n#define LUAI_UINT32\tunsigned long\n#define LUAI_INT32\tlong\n#define LUAI_MAXINT32\tLONG_MAX\n#define LUAI_UMEM\tunsigned long\n#define LUAI_MEM\tlong\n#endif\n\n\n/*\n@@ LUAI_MAXCALLS limits the number of nested calls.\n** CHANGE it if you need really deep recursive calls. This limit is\n** arbitrary; its only purpose is to stop infinite recursion before\n** exhausting memory.\n*/\n#define LUAI_MAXCALLS\t20000\n\n\n/*\n@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function\n@* can use.\n** CHANGE it if you need lots of (Lua) stack space for your C\n** functions. This limit is arbitrary; its only purpose is to stop C\n** functions to consume unlimited stack space. (must be smaller than\n** -LUA_REGISTRYINDEX)\n*/\n#define LUAI_MAXCSTACK\t8000\n\n\n\n/*\n** {==================================================================\n** CHANGE (to smaller values) the following definitions if your system\n** has a small C stack. (Or you may want to change them to larger\n** values if your system has a large C stack and these limits are\n** too rigid for you.) Some of these constants control the size of\n** stack-allocated arrays used by the compiler or the interpreter, while\n** others limit the maximum number of recursive calls that the compiler\n** or the interpreter can perform. Values too large may cause a C stack\n** overflow for some forms of deep constructs.\n** ===================================================================\n*/\n\n\n/*\n@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and\n@* syntactical nested non-terminals in a program.\n*/\n#define LUAI_MAXCCALLS\t\t200\n\n\n/*\n@@ LUAI_MAXVARS is the maximum number of local variables per function\n@* (must be smaller than 250).\n*/\n#define LUAI_MAXVARS\t\t200\n\n\n/*\n@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function\n@* (must be smaller than 250).\n*/\n#define LUAI_MAXUPVALUES\t60\n\n\n/*\n@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.\n*/\n#define LUAL_BUFFERSIZE\t\tBUFSIZ\n\n/* }================================================================== */\n\n\n\n\n/*\n** {==================================================================\n@@ LUA_NUMBER is the type of numbers in Lua.\n** CHANGE the following definitions only if you want to build Lua\n** with a number type different from double. You may also need to\n** change lua_number2int & lua_number2integer.\n** ===================================================================\n*/\n\n#define LUA_NUMBER_DOUBLE\n#define LUA_NUMBER\tdouble\n\n/*\n@@ LUAI_UACNUMBER is the result of an 'usual argument conversion'\n@* over a number.\n*/\n#define LUAI_UACNUMBER\tdouble\n\n\n/*\n@@ LUA_NUMBER_SCAN is the format for reading numbers.\n@@ LUA_NUMBER_FMT is the format for writing numbers.\n@@ lua_number2str converts a number to a string.\n@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion.\n@@ lua_str2number converts a string to a number.\n*/\n#define LUA_NUMBER_SCAN\t\t\"%lf\"\n#define LUA_NUMBER_FMT\t\t\"%.14g\"\n#define lua_number2str(s,n)\tsprintf((s), LUA_NUMBER_FMT, (n))\n#define LUAI_MAXNUMBER2STR\t32 /* 16 digits, sign, point, and \\0 */\n#define lua_str2number(s,p)\tstrtod((s), (p))\n\n\n/*\n@@ The luai_num* macros define the primitive operations over numbers.\n*/\n#if defined(LUA_CORE)\n#include <math.h>\n#define luai_numadd(a,b)\t((a)+(b))\n#define luai_numsub(a,b)\t((a)-(b))\n#define luai_nummul(a,b)\t((a)*(b))\n#define luai_numdiv(a,b)\t((a)/(b))\n#define luai_nummod(a,b)\t((a) - floor((a)/(b))*(b))\n#define luai_numpow(a,b)\t(pow(a,b))\n#define luai_numunm(a)\t\t(-(a))\n#define luai_numeq(a,b)\t\t((a)==(b))\n#define luai_numlt(a,b)\t\t((a)<(b))\n#define luai_numle(a,b)\t\t((a)<=(b))\n#define luai_numisnan(a)\t(!luai_numeq((a), (a)))\n#endif\n\n\n/*\n@@ lua_number2int is a macro to convert lua_Number to int.\n@@ lua_number2integer is a macro to convert lua_Number to lua_Integer.\n** CHANGE them if you know a faster way to convert a lua_Number to\n** int (with any rounding method and without throwing errors) in your\n** system. In Pentium machines, a naive typecast from double to int\n** in C is extremely slow, so any alternative is worth trying.\n*/\n\n/* On a Pentium, resort to a trick */\n#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \\\n    (defined(__i386) || defined (_M_IX86) || defined(__i386__))\n\n/* On a Microsoft compiler, use assembler */\n#if defined(_MSC_VER)\n\n#define lua_number2int(i,d)   __asm fld d   __asm fistp i\n#define lua_number2integer(i,n)\t\tlua_number2int(i, n)\n\n/* the next trick should work on any Pentium, but sometimes clashes\n   with a DirectX idiosyncrasy */\n#else\n\nunion luai_Cast { double l_d; long l_l; };\n#define lua_number2int(i,d) \\\n  { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; }\n#define lua_number2integer(i,n)\t\tlua_number2int(i, n)\n\n#endif\n\n\n/* this option always works, but may be slow */\n#else\n#define lua_number2int(i,d)\t((i)=(int)(d))\n#define lua_number2integer(i,d)\t((i)=(lua_Integer)(d))\n\n#endif\n\n/* }================================================================== */\n\n\n/*\n@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment.\n** CHANGE it if your system requires alignments larger than double. (For\n** instance, if your system supports long doubles and they must be\n** aligned in 16-byte boundaries, then you should add long double in the\n** union.) Probably you do not need to change this.\n*/\n#define LUAI_USER_ALIGNMENT_T\tunion { double u; void *s; long l; }\n\n\n/*\n@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling.\n** CHANGE them if you prefer to use longjmp/setjmp even with C++\n** or if want/don't to use _longjmp/_setjmp instead of regular\n** longjmp/setjmp. By default, Lua handles errors with exceptions when\n** compiling as C++ code, with _longjmp/_setjmp when asked to use them,\n** and with longjmp/setjmp otherwise.\n*/\n#if defined(__cplusplus)\n/* C++ exceptions */\n#define LUAI_THROW(L,c)\tthrow(c)\n#define LUAI_TRY(L,c,a)\ttry { a } catch(...) \\\n\t{ if ((c)->status == 0) (c)->status = -1; }\n#define luai_jmpbuf\tint  /* dummy variable */\n\n#elif defined(LUA_USE_ULONGJMP)\n/* in Unix, try _longjmp/_setjmp (more efficient) */\n#define LUAI_THROW(L,c)\t_longjmp((c)->b, 1)\n#define LUAI_TRY(L,c,a)\tif (_setjmp((c)->b) == 0) { a }\n#define luai_jmpbuf\tjmp_buf\n\n#else\n/* default handling with long jumps */\n#define LUAI_THROW(L,c)\tlongjmp((c)->b, 1)\n#define LUAI_TRY(L,c,a)\tif (setjmp((c)->b) == 0) { a }\n#define luai_jmpbuf\tjmp_buf\n\n#endif\n\n\n/*\n@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern\n@* can do during pattern-matching.\n** CHANGE it if you need more captures. This limit is arbitrary.\n*/\n#define LUA_MAXCAPTURES\t\t32\n\n\n/*\n@@ lua_tmpnam is the function that the OS library uses to create a\n@* temporary name.\n@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.\n** CHANGE them if you have an alternative to tmpnam (which is considered\n** insecure) or if you want the original tmpnam anyway.  By default, Lua\n** uses tmpnam except when POSIX is available, where it uses mkstemp.\n*/\n#if defined(loslib_c) || defined(luaall_c)\n\n#if defined(LUA_USE_MKSTEMP)\n#include <unistd.h>\n#define LUA_TMPNAMBUFSIZE\t32\n#define lua_tmpnam(b,e)\t{ \\\n\tstrcpy(b, \"/tmp/lua_XXXXXX\"); \\\n\te = mkstemp(b); \\\n\tif (e != -1) close(e); \\\n\te = (e == -1); }\n\n#else\n#define LUA_TMPNAMBUFSIZE\tL_tmpnam\n#define lua_tmpnam(b,e)\t\t{ e = (tmpnam(b) == NULL); }\n#endif\n\n#endif\n\n\n/*\n@@ lua_popen spawns a new process connected to the current one through\n@* the file streams.\n** CHANGE it if you have a way to implement it in your system.\n*/\n#if defined(LUA_USE_POPEN)\n\n#define lua_popen(L,c,m)\t((void)L, fflush(NULL), popen(c,m))\n#define lua_pclose(L,file)\t((void)L, (pclose(file) != -1))\n\n#elif defined(LUA_WIN)\n\n#define lua_popen(L,c,m)\t((void)L, _popen(c,m))\n#define lua_pclose(L,file)\t((void)L, (_pclose(file) != -1))\n\n#else\n\n#define lua_popen(L,c,m)\t((void)((void)c, m),  \\\n\t\tluaL_error(L, LUA_QL(\"popen\") \" not supported\"), (FILE*)0)\n#define lua_pclose(L,file)\t\t((void)((void)L, file), 0)\n\n#endif\n\n/*\n@@ LUA_DL_* define which dynamic-library system Lua should use.\n** CHANGE here if Lua has problems choosing the appropriate\n** dynamic-library system for your platform (either Windows' DLL, Mac's\n** dyld, or Unix's dlopen). If your system is some kind of Unix, there\n** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for\n** it.  To use dlopen you also need to adapt the src/Makefile (probably\n** adding -ldl to the linker options), so Lua does not select it\n** automatically.  (When you change the makefile to add -ldl, you must\n** also add -DLUA_USE_DLOPEN.)\n** If you do not want any kind of dynamic library, undefine all these\n** options.\n** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.\n*/\n#if defined(LUA_USE_DLOPEN)\n#define LUA_DL_DLOPEN\n#endif\n\n#if defined(LUA_WIN)\n#define LUA_DL_DLL\n#endif\n\n\n/*\n@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State\n@* (the data goes just *before* the lua_State pointer).\n** CHANGE (define) this if you really need that. This value must be\n** a multiple of the maximum alignment required for your machine.\n*/\n#define LUAI_EXTRASPACE\t\t0\n\n\n/*\n@@ luai_userstate* allow user-specific actions on threads.\n** CHANGE them if you defined LUAI_EXTRASPACE and need to do something\n** extra when a thread is created/deleted/resumed/yielded.\n*/\n#define luai_userstateopen(L)\t\t((void)L)\n#define luai_userstateclose(L)\t\t((void)L)\n#define luai_userstatethread(L,L1)\t((void)L)\n#define luai_userstatefree(L)\t\t((void)L)\n#define luai_userstateresume(L,n)\t((void)L)\n#define luai_userstateyield(L,n)\t((void)L)\n\n\n/*\n@@ LUA_INTFRMLEN is the length modifier for integer conversions\n@* in 'string.format'.\n@@ LUA_INTFRM_T is the integer type correspoding to the previous length\n@* modifier.\n** CHANGE them if your system supports long long or does not support long.\n*/\n\n#if defined(LUA_USELONGLONG)\n\n#define LUA_INTFRMLEN\t\t\"ll\"\n#define LUA_INTFRM_T\t\tlong long\n\n#else\n\n#define LUA_INTFRMLEN\t\t\"l\"\n#define LUA_INTFRM_T\t\tlong\n\n#endif\n\n\n\n/* =================================================================== */\n\n/*\n** Local configuration. You can use this space to add your redefinitions\n** without modifying the main part of the file.\n*/\n\n\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lualib.h",
    "content": "/*\n** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $\n** Lua standard libraries\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lualib_h\n#define lualib_h\n\n#include \"lua.h\"\n\n\n/* Key to file-handle type */\n#define LUA_FILEHANDLE\t\t\"FILE*\"\n\n\n#define LUA_COLIBNAME\t\"coroutine\"\nLUALIB_API int (luaopen_base) (lua_State *L);\n\n#define LUA_TABLIBNAME\t\"table\"\nLUALIB_API int (luaopen_table) (lua_State *L);\n\n#define LUA_IOLIBNAME\t\"io\"\nLUALIB_API int (luaopen_io) (lua_State *L);\n\n#define LUA_OSLIBNAME\t\"os\"\nLUALIB_API int (luaopen_os) (lua_State *L);\n\n#define LUA_STRLIBNAME\t\"string\"\nLUALIB_API int (luaopen_string) (lua_State *L);\n\n#define LUA_MATHLIBNAME\t\"math\"\nLUALIB_API int (luaopen_math) (lua_State *L);\n\n#define LUA_DBLIBNAME\t\"debug\"\nLUALIB_API int (luaopen_debug) (lua_State *L);\n\n#define LUA_LOADLIBNAME\t\"package\"\nLUALIB_API int (luaopen_package) (lua_State *L);\n\n\n/* open all previous libraries */\nLUALIB_API void (luaL_openlibs) (lua_State *L); \n\n\n\n#ifndef lua_assert\n#define lua_assert(x)\t((void)0)\n#endif\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lundump.c",
    "content": "/*\n** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $\n** load precompiled Lua chunks\n** See Copyright Notice in lua.h\n*/\n\n#include <string.h>\n\n#define lundump_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"lmem.h\"\n#include \"lobject.h\"\n#include \"lstring.h\"\n#include \"lundump.h\"\n#include \"lzio.h\"\n\ntypedef struct {\n lua_State* L;\n ZIO* Z;\n Mbuffer* b;\n const char* name;\n} LoadState;\n\n#ifdef LUAC_TRUST_BINARIES\n#define IF(c,s)\n#define error(S,s)\n#else\n#define IF(c,s)\t\tif (c) error(S,s)\n\nstatic void error(LoadState* S, const char* why)\n{\n luaO_pushfstring(S->L,\"%s: %s in precompiled chunk\",S->name,why);\n luaD_throw(S->L,LUA_ERRSYNTAX);\n}\n#endif\n\n#define LoadMem(S,b,n,size)\tLoadBlock(S,b,(n)*(size))\n#define\tLoadByte(S)\t\t(lu_byte)LoadChar(S)\n#define LoadVar(S,x)\t\tLoadMem(S,&x,1,sizeof(x))\n#define LoadVector(S,b,n,size)\tLoadMem(S,b,n,size)\n\nstatic void LoadBlock(LoadState* S, void* b, size_t size)\n{\n size_t r=luaZ_read(S->Z,b,size);\n IF (r!=0, \"unexpected end\");\n}\n\nstatic int LoadChar(LoadState* S)\n{\n char x;\n LoadVar(S,x);\n return x;\n}\n\nstatic int LoadInt(LoadState* S)\n{\n int x;\n LoadVar(S,x);\n IF (x<0, \"bad integer\");\n return x;\n}\n\nstatic lua_Number LoadNumber(LoadState* S)\n{\n lua_Number x;\n LoadVar(S,x);\n return x;\n}\n\nstatic TString* LoadString(LoadState* S)\n{\n size_t size;\n LoadVar(S,size);\n if (size==0)\n  return NULL;\n else\n {\n  char* s=luaZ_openspace(S->L,S->b,size);\n  LoadBlock(S,s,size);\n  return luaS_newlstr(S->L,s,size-1);\t\t/* remove trailing '\\0' */\n }\n}\n\nstatic void LoadCode(LoadState* S, Proto* f)\n{\n int n=LoadInt(S);\n f->code=luaM_newvector(S->L,n,Instruction);\n f->sizecode=n;\n LoadVector(S,f->code,n,sizeof(Instruction));\n}\n\nstatic Proto* LoadFunction(LoadState* S, TString* p);\n\nstatic void LoadConstants(LoadState* S, Proto* f)\n{\n int i,n;\n n=LoadInt(S);\n f->k=luaM_newvector(S->L,n,TValue);\n f->sizek=n;\n for (i=0; i<n; i++) setnilvalue(&f->k[i]);\n for (i=0; i<n; i++)\n {\n  TValue* o=&f->k[i];\n  int t=LoadChar(S);\n  switch (t)\n  {\n   case LUA_TNIL:\n   \tsetnilvalue(o);\n\tbreak;\n   case LUA_TBOOLEAN:\n   \tsetbvalue(o,LoadChar(S)!=0);\n\tbreak;\n   case LUA_TNUMBER:\n\tsetnvalue(o,LoadNumber(S));\n\tbreak;\n   case LUA_TSTRING:\n\tsetsvalue2n(S->L,o,LoadString(S));\n\tbreak;\n   default:\n\terror(S,\"bad constant\");\n\tbreak;\n  }\n }\n n=LoadInt(S);\n f->p=luaM_newvector(S->L,n,Proto*);\n f->sizep=n;\n for (i=0; i<n; i++) f->p[i]=NULL;\n for (i=0; i<n; i++) f->p[i]=LoadFunction(S,f->source);\n}\n\nstatic void LoadDebug(LoadState* S, Proto* f)\n{\n int i,n;\n n=LoadInt(S);\n f->lineinfo=luaM_newvector(S->L,n,int);\n f->sizelineinfo=n;\n LoadVector(S,f->lineinfo,n,sizeof(int));\n n=LoadInt(S);\n f->locvars=luaM_newvector(S->L,n,LocVar);\n f->sizelocvars=n;\n for (i=0; i<n; i++) f->locvars[i].varname=NULL;\n for (i=0; i<n; i++)\n {\n  f->locvars[i].varname=LoadString(S);\n  f->locvars[i].startpc=LoadInt(S);\n  f->locvars[i].endpc=LoadInt(S);\n }\n n=LoadInt(S);\n f->upvalues=luaM_newvector(S->L,n,TString*);\n f->sizeupvalues=n;\n for (i=0; i<n; i++) f->upvalues[i]=NULL;\n for (i=0; i<n; i++) f->upvalues[i]=LoadString(S);\n}\n\nstatic Proto* LoadFunction(LoadState* S, TString* p)\n{\n Proto* f;\n if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,\"code too deep\");\n f=luaF_newproto(S->L);\n setptvalue2s(S->L,S->L->top,f); incr_top(S->L);\n f->source=LoadString(S); if (f->source==NULL) f->source=p;\n f->linedefined=LoadInt(S);\n f->lastlinedefined=LoadInt(S);\n f->nups=LoadByte(S);\n f->numparams=LoadByte(S);\n f->is_vararg=LoadByte(S);\n f->maxstacksize=LoadByte(S);\n LoadCode(S,f);\n LoadConstants(S,f);\n LoadDebug(S,f);\n IF (!luaG_checkcode(f), \"bad code\");\n S->L->top--;\n S->L->nCcalls--;\n return f;\n}\n\nstatic void LoadHeader(LoadState* S)\n{\n char h[LUAC_HEADERSIZE];\n char s[LUAC_HEADERSIZE];\n luaU_header(h);\n LoadBlock(S,s,LUAC_HEADERSIZE);\n IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, \"bad header\");\n}\n\n/*\n** load precompiled chunk\n*/\nProto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name)\n{\n LoadState S;\n if (*name=='@' || *name=='=')\n  S.name=name+1;\n else if (*name==LUA_SIGNATURE[0])\n  S.name=\"binary string\";\n else\n  S.name=name;\n S.L=L;\n S.Z=Z;\n S.b=buff;\n LoadHeader(&S);\n return LoadFunction(&S,luaS_newliteral(L,\"=?\"));\n}\n\n/*\n* make header\n*/\nvoid luaU_header (char* h)\n{\n int x=1;\n memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1);\n h+=sizeof(LUA_SIGNATURE)-1;\n *h++=(char)LUAC_VERSION;\n *h++=(char)LUAC_FORMAT;\n *h++=(char)*(char*)&x;\t\t\t\t/* endianness */\n *h++=(char)sizeof(int);\n *h++=(char)sizeof(size_t);\n *h++=(char)sizeof(Instruction);\n *h++=(char)sizeof(lua_Number);\n *h++=(char)(((lua_Number)0.5)==0);\t\t/* is lua_Number integral? */\n}\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lundump.h",
    "content": "/*\n** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $\n** load precompiled Lua chunks\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lundump_h\n#define lundump_h\n\n#include \"lobject.h\"\n#include \"lzio.h\"\n\n/* load one chunk; from lundump.c */\nLUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name);\n\n/* make header; from lundump.c */\nLUAI_FUNC void luaU_header (char* h);\n\n/* dump one chunk; from ldump.c */\nLUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);\n\n#ifdef luac_c\n/* print one chunk; from print.c */\nLUAI_FUNC void luaU_print (const Proto* f, int full);\n#endif\n\n/* for header of binary files -- this is Lua 5.1 */\n#define LUAC_VERSION\t\t0x51\n\n/* for header of binary files -- this is the official format */\n#define LUAC_FORMAT\t\t0\n\n/* size of header of binary files */\n#define LUAC_HEADERSIZE\t\t12\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lvm.c",
    "content": "/*\n** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $\n** Lua virtual machine\n** See Copyright Notice in lua.h\n*/\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define lvm_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"ldebug.h\"\n#include \"ldo.h\"\n#include \"lfunc.h\"\n#include \"lgc.h\"\n#include \"lobject.h\"\n#include \"lopcodes.h\"\n#include \"lstate.h\"\n#include \"lstring.h\"\n#include \"ltable.h\"\n#include \"ltm.h\"\n#include \"lvm.h\"\n\n\n\n/* limit for table tag-method chains (to avoid loops) */\n#define MAXTAGLOOP\t100\n\n\nconst TValue *luaV_tonumber (const TValue *obj, TValue *n) {\n  lua_Number num;\n  if (ttisnumber(obj)) return obj;\n  if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) {\n    setnvalue(n, num);\n    return n;\n  }\n  else\n    return NULL;\n}\n\n\nint luaV_tostring (lua_State *L, StkId obj) {\n  if (!ttisnumber(obj))\n    return 0;\n  else {\n    char s[LUAI_MAXNUMBER2STR];\n    lua_Number n = nvalue(obj);\n    lua_number2str(s, n);\n    setsvalue2s(L, obj, luaS_new(L, s));\n    return 1;\n  }\n}\n\n\nstatic void traceexec (lua_State *L, const Instruction *pc) {\n  lu_byte mask = L->hookmask;\n  const Instruction *oldpc = L->savedpc;\n  L->savedpc = pc;\n  if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) {\n    resethookcount(L);\n    luaD_callhook(L, LUA_HOOKCOUNT, -1);\n  }\n  if (mask & LUA_MASKLINE) {\n    Proto *p = ci_func(L->ci)->l.p;\n    int npc = pcRel(pc, p);\n    int newline = getline(p, npc);\n    /* call linehook when enter a new function, when jump back (loop),\n       or when enter a new line */\n    if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p)))\n      luaD_callhook(L, LUA_HOOKLINE, newline);\n  }\n}\n\n\nstatic void callTMres (lua_State *L, StkId res, const TValue *f,\n                        const TValue *p1, const TValue *p2) {\n  ptrdiff_t result = savestack(L, res);\n  setobj2s(L, L->top, f);  /* push function */\n  setobj2s(L, L->top+1, p1);  /* 1st argument */\n  setobj2s(L, L->top+2, p2);  /* 2nd argument */\n  luaD_checkstack(L, 3);\n  L->top += 3;\n  luaD_call(L, L->top - 3, 1);\n  res = restorestack(L, result);\n  L->top--;\n  setobjs2s(L, res, L->top);\n}\n\n\n\nstatic void callTM (lua_State *L, const TValue *f, const TValue *p1,\n                    const TValue *p2, const TValue *p3) {\n  setobj2s(L, L->top, f);  /* push function */\n  setobj2s(L, L->top+1, p1);  /* 1st argument */\n  setobj2s(L, L->top+2, p2);  /* 2nd argument */\n  setobj2s(L, L->top+3, p3);  /* 3th argument */\n  luaD_checkstack(L, 4);\n  L->top += 4;\n  luaD_call(L, L->top - 4, 0);\n}\n\n\nvoid luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {\n  int loop;\n  for (loop = 0; loop < MAXTAGLOOP; loop++) {\n    const TValue *tm;\n    if (ttistable(t)) {  /* `t' is a table? */\n      Table *h = hvalue(t);\n      const TValue *res = luaH_get(h, key); /* do a primitive get */\n      if (!ttisnil(res) ||  /* result is no nil? */\n          (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */\n        setobj2s(L, val, res);\n        return;\n      }\n      /* else will try the tag method */\n    }\n    else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX)))\n      luaG_typeerror(L, t, \"index\");\n    if (ttisfunction(tm)) {\n      callTMres(L, val, tm, t, key);\n      return;\n    }\n    t = tm;  /* else repeat with `tm' */ \n  }\n  luaG_runerror(L, \"loop in gettable\");\n}\n\n\nvoid luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {\n  int loop;\n  TValue temp;\n  for (loop = 0; loop < MAXTAGLOOP; loop++) {\n    const TValue *tm;\n    if (ttistable(t)) {  /* `t' is a table? */\n      Table *h = hvalue(t);\n      TValue *oldval = luaH_set(L, h, key); /* do a primitive set */\n      if (!ttisnil(oldval) ||  /* result is no nil? */\n          (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */\n        setobj2t(L, oldval, val);\n        h->flags = 0;\n        luaC_barriert(L, h, val);\n        return;\n      }\n      /* else will try the tag method */\n    }\n    else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX)))\n      luaG_typeerror(L, t, \"index\");\n    if (ttisfunction(tm)) {\n      callTM(L, tm, t, key, val);\n      return;\n    }\n    /* else repeat with `tm' */\n    setobj(L, &temp, tm);  /* avoid pointing inside table (may rehash) */\n    t = &temp;\n  }\n  luaG_runerror(L, \"loop in settable\");\n}\n\n\nstatic int call_binTM (lua_State *L, const TValue *p1, const TValue *p2,\n                       StkId res, TMS event) {\n  const TValue *tm = luaT_gettmbyobj(L, p1, event);  /* try first operand */\n  if (ttisnil(tm))\n    tm = luaT_gettmbyobj(L, p2, event);  /* try second operand */\n  if (ttisnil(tm)) return 0;\n  callTMres(L, res, tm, p1, p2);\n  return 1;\n}\n\n\nstatic const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2,\n                                  TMS event) {\n  const TValue *tm1 = fasttm(L, mt1, event);\n  const TValue *tm2;\n  if (tm1 == NULL) return NULL;  /* no metamethod */\n  if (mt1 == mt2) return tm1;  /* same metatables => same metamethods */\n  tm2 = fasttm(L, mt2, event);\n  if (tm2 == NULL) return NULL;  /* no metamethod */\n  if (luaO_rawequalObj(tm1, tm2))  /* same metamethods? */\n    return tm1;\n  return NULL;\n}\n\n\nstatic int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2,\n                         TMS event) {\n  const TValue *tm1 = luaT_gettmbyobj(L, p1, event);\n  const TValue *tm2;\n  if (ttisnil(tm1)) return -1;  /* no metamethod? */\n  tm2 = luaT_gettmbyobj(L, p2, event);\n  if (!luaO_rawequalObj(tm1, tm2))  /* different metamethods? */\n    return -1;\n  callTMres(L, L->top, tm1, p1, p2);\n  return !l_isfalse(L->top);\n}\n\n\nstatic int l_strcmp (const TString *ls, const TString *rs) {\n  const char *l = getstr(ls);\n  size_t ll = ls->tsv.len;\n  const char *r = getstr(rs);\n  size_t lr = rs->tsv.len;\n  for (;;) {\n    int temp = strcoll(l, r);\n    if (temp != 0) return temp;\n    else {  /* strings are equal up to a `\\0' */\n      size_t len = strlen(l);  /* index of first `\\0' in both strings */\n      if (len == lr)  /* r is finished? */\n        return (len == ll) ? 0 : 1;\n      else if (len == ll)  /* l is finished? */\n        return -1;  /* l is smaller than r (because r is not finished) */\n      /* both strings longer than `len'; go on comparing (after the `\\0') */\n      len++;\n      l += len; ll -= len; r += len; lr -= len;\n    }\n  }\n}\n\n\nint luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) {\n  int res;\n  if (ttype(l) != ttype(r))\n    return luaG_ordererror(L, l, r);\n  else if (ttisnumber(l))\n    return luai_numlt(nvalue(l), nvalue(r));\n  else if (ttisstring(l))\n    return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0;\n  else if ((res = call_orderTM(L, l, r, TM_LT)) != -1)\n    return res;\n  return luaG_ordererror(L, l, r);\n}\n\n\nstatic int lessequal (lua_State *L, const TValue *l, const TValue *r) {\n  int res;\n  if (ttype(l) != ttype(r))\n    return luaG_ordererror(L, l, r);\n  else if (ttisnumber(l))\n    return luai_numle(nvalue(l), nvalue(r));\n  else if (ttisstring(l))\n    return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0;\n  else if ((res = call_orderTM(L, l, r, TM_LE)) != -1)  /* first try `le' */\n    return res;\n  else if ((res = call_orderTM(L, r, l, TM_LT)) != -1)  /* else try `lt' */\n    return !res;\n  return luaG_ordererror(L, l, r);\n}\n\n\nint luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {\n  const TValue *tm;\n  lua_assert(ttype(t1) == ttype(t2));\n  switch (ttype(t1)) {\n    case LUA_TNIL: return 1;\n    case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2));\n    case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2);  /* true must be 1 !! */\n    case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2);\n    case LUA_TUSERDATA: {\n      if (uvalue(t1) == uvalue(t2)) return 1;\n      tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable,\n                         TM_EQ);\n      break;  /* will try TM */\n    }\n    case LUA_TTABLE: {\n      if (hvalue(t1) == hvalue(t2)) return 1;\n      tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ);\n      break;  /* will try TM */\n    }\n    default: return gcvalue(t1) == gcvalue(t2);\n  }\n  if (tm == NULL) return 0;  /* no TM? */\n  callTMres(L, L->top, tm, t1, t2);  /* call TM */\n  return !l_isfalse(L->top);\n}\n\n\nvoid luaV_concat (lua_State *L, int total, int last) {\n  do {\n    StkId top = L->base + last + 1;\n    int n = 2;  /* number of elements handled in this pass (at least 2) */\n    if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) {\n      if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT))\n        luaG_concaterror(L, top-2, top-1);\n    } else if (tsvalue(top-1)->len == 0)  /* second op is empty? */\n      (void)tostring(L, top - 2);  /* result is first op (as string) */\n    else {\n      /* at least two string values; get as many as possible */\n      size_t tl = tsvalue(top-1)->len;\n      char *buffer;\n      int i;\n      /* collect total length */\n      for (n = 1; n < total && tostring(L, top-n-1); n++) {\n        size_t l = tsvalue(top-n-1)->len;\n        if (l >= MAX_SIZET - tl) luaG_runerror(L, \"string length overflow\");\n        tl += l;\n      }\n      buffer = luaZ_openspace(L, &G(L)->buff, tl);\n      tl = 0;\n      for (i=n; i>0; i--) {  /* concat all strings */\n        size_t l = tsvalue(top-i)->len;\n        memcpy(buffer+tl, svalue(top-i), l);\n        tl += l;\n      }\n      setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl));\n    }\n    total -= n-1;  /* got `n' strings to create 1 new */\n    last -= n-1;\n  } while (total > 1);  /* repeat until only 1 result left */\n}\n\n\nstatic void Arith (lua_State *L, StkId ra, const TValue *rb,\n                   const TValue *rc, TMS op) {\n  TValue tempb, tempc;\n  const TValue *b, *c;\n  if ((b = luaV_tonumber(rb, &tempb)) != NULL &&\n      (c = luaV_tonumber(rc, &tempc)) != NULL) {\n    lua_Number nb = nvalue(b), nc = nvalue(c);\n    switch (op) {\n      case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break;\n      case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break;\n      case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break;\n      case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break;\n      case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break;\n      case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break;\n      case TM_UNM: setnvalue(ra, luai_numunm(nb)); break;\n      default: lua_assert(0); break;\n    }\n  }\n  else if (!call_binTM(L, rb, rc, ra, op))\n    luaG_aritherror(L, rb, rc);\n}\n\n\n\n/*\n** some macros for common tasks in `luaV_execute'\n*/\n\n#define runtime_check(L, c)\t{ if (!(c)) break; }\n\n#define RA(i)\t(base+GETARG_A(i))\n/* to be used after possible stack reallocation */\n#define RB(i)\tcheck_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i))\n#define RC(i)\tcheck_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i))\n#define RKB(i)\tcheck_exp(getBMode(GET_OPCODE(i)) == OpArgK, \\\n\tISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i))\n#define RKC(i)\tcheck_exp(getCMode(GET_OPCODE(i)) == OpArgK, \\\n\tISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i))\n#define KBx(i)\tcheck_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i))\n\n\n#define dojump(L,pc,i)\t{(pc) += (i); luai_threadyield(L);}\n\n\n#define Protect(x)\t{ L->savedpc = pc; {x;}; base = L->base; }\n\n\n#define arith_op(op,tm) { \\\n        TValue *rb = RKB(i); \\\n        TValue *rc = RKC(i); \\\n        if (ttisnumber(rb) && ttisnumber(rc)) { \\\n          lua_Number nb = nvalue(rb), nc = nvalue(rc); \\\n          setnvalue(ra, op(nb, nc)); \\\n        } \\\n        else \\\n          Protect(Arith(L, ra, rb, rc, tm)); \\\n      }\n\n\n\nvoid luaV_execute (lua_State *L, int nexeccalls) {\n  LClosure *cl;\n  StkId base;\n  TValue *k;\n  const Instruction *pc;\n reentry:  /* entry point */\n  lua_assert(isLua(L->ci));\n  pc = L->savedpc;\n  cl = &clvalue(L->ci->func)->l;\n  base = L->base;\n  k = cl->p->k;\n  /* main loop of interpreter */\n  for (;;) {\n    const Instruction i = *pc++;\n    StkId ra;\n    if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) &&\n        (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) {\n      traceexec(L, pc);\n      if (L->status == LUA_YIELD) {  /* did hook yield? */\n        L->savedpc = pc - 1;\n        return;\n      }\n      base = L->base;\n    }\n    /* warning!! several calls may realloc the stack and invalidate `ra' */\n    ra = RA(i);\n    lua_assert(base == L->base && L->base == L->ci->base);\n    lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);\n    lua_assert(L->top == L->ci->top || luaG_checkopenop(i));\n    switch (GET_OPCODE(i)) {\n      case OP_MOVE: {\n        setobjs2s(L, ra, RB(i));\n        continue;\n      }\n      case OP_LOADK: {\n        setobj2s(L, ra, KBx(i));\n        continue;\n      }\n      case OP_LOADBOOL: {\n        setbvalue(ra, GETARG_B(i));\n        if (GETARG_C(i)) pc++;  /* skip next instruction (if C) */\n        continue;\n      }\n      case OP_LOADNIL: {\n        TValue *rb = RB(i);\n        do {\n          setnilvalue(rb--);\n        } while (rb >= ra);\n        continue;\n      }\n      case OP_GETUPVAL: {\n        int b = GETARG_B(i);\n        setobj2s(L, ra, cl->upvals[b]->v);\n        continue;\n      }\n      case OP_GETGLOBAL: {\n        TValue g;\n        TValue *rb = KBx(i);\n        sethvalue(L, &g, cl->env);\n        lua_assert(ttisstring(rb));\n        Protect(luaV_gettable(L, &g, rb, ra));\n        continue;\n      }\n      case OP_GETTABLE: {\n        Protect(luaV_gettable(L, RB(i), RKC(i), ra));\n        continue;\n      }\n      case OP_SETGLOBAL: {\n        TValue g;\n        sethvalue(L, &g, cl->env);\n        lua_assert(ttisstring(KBx(i)));\n        Protect(luaV_settable(L, &g, KBx(i), ra));\n        continue;\n      }\n      case OP_SETUPVAL: {\n        UpVal *uv = cl->upvals[GETARG_B(i)];\n        setobj(L, uv->v, ra);\n        luaC_barrier(L, uv, ra);\n        continue;\n      }\n      case OP_SETTABLE: {\n        Protect(luaV_settable(L, ra, RKB(i), RKC(i)));\n        continue;\n      }\n      case OP_NEWTABLE: {\n        int b = GETARG_B(i);\n        int c = GETARG_C(i);\n        sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c)));\n        Protect(luaC_checkGC(L));\n        continue;\n      }\n      case OP_SELF: {\n        StkId rb = RB(i);\n        setobjs2s(L, ra+1, rb);\n        Protect(luaV_gettable(L, rb, RKC(i), ra));\n        continue;\n      }\n      case OP_ADD: {\n        arith_op(luai_numadd, TM_ADD);\n        continue;\n      }\n      case OP_SUB: {\n        arith_op(luai_numsub, TM_SUB);\n        continue;\n      }\n      case OP_MUL: {\n        arith_op(luai_nummul, TM_MUL);\n        continue;\n      }\n      case OP_DIV: {\n        arith_op(luai_numdiv, TM_DIV);\n        continue;\n      }\n      case OP_MOD: {\n        arith_op(luai_nummod, TM_MOD);\n        continue;\n      }\n      case OP_POW: {\n        arith_op(luai_numpow, TM_POW);\n        continue;\n      }\n      case OP_UNM: {\n        TValue *rb = RB(i);\n        if (ttisnumber(rb)) {\n          lua_Number nb = nvalue(rb);\n          setnvalue(ra, luai_numunm(nb));\n        }\n        else {\n          Protect(Arith(L, ra, rb, rb, TM_UNM));\n        }\n        continue;\n      }\n      case OP_NOT: {\n        int res = l_isfalse(RB(i));  /* next assignment may change this value */\n        setbvalue(ra, res);\n        continue;\n      }\n      case OP_LEN: {\n        const TValue *rb = RB(i);\n        switch (ttype(rb)) {\n          case LUA_TTABLE: {\n            setnvalue(ra, cast_num(luaH_getn(hvalue(rb))));\n            break;\n          }\n          case LUA_TSTRING: {\n            setnvalue(ra, cast_num(tsvalue(rb)->len));\n            break;\n          }\n          default: {  /* try metamethod */\n            Protect(\n              if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))\n                luaG_typeerror(L, rb, \"get length of\");\n            )\n          }\n        }\n        continue;\n      }\n      case OP_CONCAT: {\n        int b = GETARG_B(i);\n        int c = GETARG_C(i);\n        Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L));\n        setobjs2s(L, RA(i), base+b);\n        continue;\n      }\n      case OP_JMP: {\n        dojump(L, pc, GETARG_sBx(i));\n        continue;\n      }\n      case OP_EQ: {\n        TValue *rb = RKB(i);\n        TValue *rc = RKC(i);\n        Protect(\n          if (equalobj(L, rb, rc) == GETARG_A(i))\n            dojump(L, pc, GETARG_sBx(*pc));\n        )\n        pc++;\n        continue;\n      }\n      case OP_LT: {\n        Protect(\n          if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))\n            dojump(L, pc, GETARG_sBx(*pc));\n        )\n        pc++;\n        continue;\n      }\n      case OP_LE: {\n        Protect(\n          if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))\n            dojump(L, pc, GETARG_sBx(*pc));\n        )\n        pc++;\n        continue;\n      }\n      case OP_TEST: {\n        if (l_isfalse(ra) != GETARG_C(i))\n          dojump(L, pc, GETARG_sBx(*pc));\n        pc++;\n        continue;\n      }\n      case OP_TESTSET: {\n        TValue *rb = RB(i);\n        if (l_isfalse(rb) != GETARG_C(i)) {\n          setobjs2s(L, ra, rb);\n          dojump(L, pc, GETARG_sBx(*pc));\n        }\n        pc++;\n        continue;\n      }\n      case OP_CALL: {\n        int b = GETARG_B(i);\n        int nresults = GETARG_C(i) - 1;\n        if (b != 0) L->top = ra+b;  /* else previous instruction set top */\n        L->savedpc = pc;\n        switch (luaD_precall(L, ra, nresults)) {\n          case PCRLUA: {\n            nexeccalls++;\n            goto reentry;  /* restart luaV_execute over new Lua function */\n          }\n          case PCRC: {\n            /* it was a C function (`precall' called it); adjust results */\n            if (nresults >= 0) L->top = L->ci->top;\n            base = L->base;\n            continue;\n          }\n          default: {\n            return;  /* yield */\n          }\n        }\n      }\n      case OP_TAILCALL: {\n        int b = GETARG_B(i);\n        if (b != 0) L->top = ra+b;  /* else previous instruction set top */\n        L->savedpc = pc;\n        lua_assert(GETARG_C(i) - 1 == LUA_MULTRET);\n        switch (luaD_precall(L, ra, LUA_MULTRET)) {\n          case PCRLUA: {\n            /* tail call: put new frame in place of previous one */\n            CallInfo *ci = L->ci - 1;  /* previous frame */\n            int aux;\n            StkId func = ci->func;\n            StkId pfunc = (ci+1)->func;  /* previous function index */\n            if (L->openupval) luaF_close(L, ci->base);\n            L->base = ci->base = ci->func + ((ci+1)->base - pfunc);\n            for (aux = 0; pfunc+aux < L->top; aux++)  /* move frame down */\n              setobjs2s(L, func+aux, pfunc+aux);\n            ci->top = L->top = func+aux;  /* correct top */\n            lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize);\n            ci->savedpc = L->savedpc;\n            ci->tailcalls++;  /* one more call lost */\n            L->ci--;  /* remove new frame */\n            goto reentry;\n          }\n          case PCRC: {  /* it was a C function (`precall' called it) */\n            base = L->base;\n            continue;\n          }\n          default: {\n            return;  /* yield */\n          }\n        }\n      }\n      case OP_RETURN: {\n        int b = GETARG_B(i);\n        if (b != 0) L->top = ra+b-1;\n        if (L->openupval) luaF_close(L, base);\n        L->savedpc = pc;\n        b = luaD_poscall(L, ra);\n        if (--nexeccalls == 0)  /* was previous function running `here'? */\n          return;  /* no: return */\n        else {  /* yes: continue its execution */\n          if (b) L->top = L->ci->top;\n          lua_assert(isLua(L->ci));\n          lua_assert(GET_OPCODE(*((L->ci)->savedpc - 1)) == OP_CALL);\n          goto reentry;\n        }\n      }\n      case OP_FORLOOP: {\n        lua_Number step = nvalue(ra+2);\n        lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */\n        lua_Number limit = nvalue(ra+1);\n        if (luai_numlt(0, step) ? luai_numle(idx, limit)\n                                : luai_numle(limit, idx)) {\n          dojump(L, pc, GETARG_sBx(i));  /* jump back */\n          setnvalue(ra, idx);  /* update internal index... */\n          setnvalue(ra+3, idx);  /* ...and external index */\n        }\n        continue;\n      }\n      case OP_FORPREP: {\n        const TValue *init = ra;\n        const TValue *plimit = ra+1;\n        const TValue *pstep = ra+2;\n        L->savedpc = pc;  /* next steps may throw errors */\n        if (!tonumber(init, ra))\n          luaG_runerror(L, LUA_QL(\"for\") \" initial value must be a number\");\n        else if (!tonumber(plimit, ra+1))\n          luaG_runerror(L, LUA_QL(\"for\") \" limit must be a number\");\n        else if (!tonumber(pstep, ra+2))\n          luaG_runerror(L, LUA_QL(\"for\") \" step must be a number\");\n        setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep)));\n        dojump(L, pc, GETARG_sBx(i));\n        continue;\n      }\n      case OP_TFORLOOP: {\n        StkId cb = ra + 3;  /* call base */\n        setobjs2s(L, cb+2, ra+2);\n        setobjs2s(L, cb+1, ra+1);\n        setobjs2s(L, cb, ra);\n        L->top = cb+3;  /* func. + 2 args (state and index) */\n        Protect(luaD_call(L, cb, GETARG_C(i)));\n        L->top = L->ci->top;\n        cb = RA(i) + 3;  /* previous call may change the stack */\n        if (!ttisnil(cb)) {  /* continue loop? */\n          setobjs2s(L, cb-1, cb);  /* save control variable */\n          dojump(L, pc, GETARG_sBx(*pc));  /* jump back */\n        }\n        pc++;\n        continue;\n      }\n      case OP_SETLIST: {\n        int n = GETARG_B(i);\n        int c = GETARG_C(i);\n        int last;\n        Table *h;\n        if (n == 0) {\n          n = cast_int(L->top - ra) - 1;\n          L->top = L->ci->top;\n        }\n        if (c == 0) c = cast_int(*pc++);\n        runtime_check(L, ttistable(ra));\n        h = hvalue(ra);\n        last = ((c-1)*LFIELDS_PER_FLUSH) + n;\n        if (last > h->sizearray)  /* needs more space? */\n          luaH_resizearray(L, h, last);  /* pre-alloc it at once */\n        for (; n > 0; n--) {\n          TValue *val = ra+n;\n          setobj2t(L, luaH_setnum(L, h, last--), val);\n          luaC_barriert(L, h, val);\n        }\n        continue;\n      }\n      case OP_CLOSE: {\n        luaF_close(L, ra);\n        continue;\n      }\n      case OP_CLOSURE: {\n        Proto *p;\n        Closure *ncl;\n        int nup, j;\n        p = cl->p->p[GETARG_Bx(i)];\n        nup = p->nups;\n        ncl = luaF_newLclosure(L, nup, cl->env);\n        ncl->l.p = p;\n        for (j=0; j<nup; j++, pc++) {\n          if (GET_OPCODE(*pc) == OP_GETUPVAL)\n            ncl->l.upvals[j] = cl->upvals[GETARG_B(*pc)];\n          else {\n            lua_assert(GET_OPCODE(*pc) == OP_MOVE);\n            ncl->l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc));\n          }\n        }\n        setclvalue(L, ra, ncl);\n        Protect(luaC_checkGC(L));\n        continue;\n      }\n      case OP_VARARG: {\n        int b = GETARG_B(i) - 1;\n        int j;\n        CallInfo *ci = L->ci;\n        int n = cast_int(ci->base - ci->func) - cl->p->numparams - 1;\n        if (b == LUA_MULTRET) {\n          Protect(luaD_checkstack(L, n));\n          ra = RA(i);  /* previous call may change the stack */\n          b = n;\n          L->top = ra + n;\n        }\n        for (j = 0; j < b; j++) {\n          if (j < n) {\n            setobjs2s(L, ra + j, ci->base - n + j);\n          }\n          else {\n            setnilvalue(ra + j);\n          }\n        }\n        continue;\n      }\n    }\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lvm.h",
    "content": "/*\n** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $\n** Lua virtual machine\n** See Copyright Notice in lua.h\n*/\n\n#ifndef lvm_h\n#define lvm_h\n\n\n#include \"ldo.h\"\n#include \"lobject.h\"\n#include \"ltm.h\"\n\n\n#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))\n\n#define tonumber(o,n)\t(ttype(o) == LUA_TNUMBER || \\\n                         (((o) = luaV_tonumber(o,n)) != NULL))\n\n#define equalobj(L,o1,o2) \\\n\t(ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))\n\n\nLUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);\nLUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2);\nLUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);\nLUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);\nLUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,\n                                            StkId val);\nLUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,\n                                            StkId val);\nLUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls);\nLUAI_FUNC void luaV_concat (lua_State *L, int total, int last);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lzio.c",
    "content": "/*\n** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $\n** a generic input stream interface\n** See Copyright Notice in lua.h\n*/\n\n\n#include <string.h>\n\n#define lzio_c\n#define LUA_CORE\n\n#include \"lua.h\"\n\n#include \"llimits.h\"\n#include \"lmem.h\"\n#include \"lstate.h\"\n#include \"lzio.h\"\n\n\nint luaZ_fill (ZIO *z) {\n  size_t size;\n  lua_State *L = z->L;\n  const char *buff;\n  lua_unlock(L);\n  buff = z->reader(L, z->data, &size);\n  lua_lock(L);\n  if (buff == NULL || size == 0) return EOZ;\n  z->n = size - 1;\n  z->p = buff;\n  return char2int(*(z->p++));\n}\n\n\nint luaZ_lookahead (ZIO *z) {\n  if (z->n == 0) {\n    if (luaZ_fill(z) == EOZ)\n      return EOZ;\n    else {\n      z->n++;  /* luaZ_fill removed first byte; put back it */\n      z->p--;\n    }\n  }\n  return char2int(*z->p);\n}\n\n\nvoid luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) {\n  z->L = L;\n  z->reader = reader;\n  z->data = data;\n  z->n = 0;\n  z->p = NULL;\n}\n\n\n/* --------------------------------------------------------------- read --- */\nsize_t luaZ_read (ZIO *z, void *b, size_t n) {\n  while (n) {\n    size_t m;\n    if (luaZ_lookahead(z) == EOZ)\n      return n;  /* return number of missing bytes */\n    m = (n <= z->n) ? n : z->n;  /* min. between n and z->n */\n    memcpy(b, z->p, m);\n    z->n -= m;\n    z->p += m;\n    b = (char *)b + m;\n    n -= m;\n  }\n  return 0;\n}\n\n/* ------------------------------------------------------------------------ */\nchar *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {\n  if (n > buff->buffsize) {\n    if (n < LUA_MINBUFFER) n = LUA_MINBUFFER;\n    luaZ_resizebuffer(L, buff, n);\n  }\n  return buff->buffer;\n}\n\n\n"
  },
  {
    "path": "cocos2d/external/lua/lua/lzio.h",
    "content": "/*\n** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $\n** Buffered streams\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lzio_h\n#define lzio_h\n\n#include \"lua.h\"\n\n#include \"lmem.h\"\n\n\n#define EOZ\t(-1)\t\t\t/* end of stream */\n\ntypedef struct Zio ZIO;\n\n#define char2int(c)\tcast(int, cast(unsigned char, (c)))\n\n#define zgetc(z)  (((z)->n--)>0 ?  char2int(*(z)->p++) : luaZ_fill(z))\n\ntypedef struct Mbuffer {\n  char *buffer;\n  size_t n;\n  size_t buffsize;\n} Mbuffer;\n\n#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)\n\n#define luaZ_buffer(buff)\t((buff)->buffer)\n#define luaZ_sizebuffer(buff)\t((buff)->buffsize)\n#define luaZ_bufflen(buff)\t((buff)->n)\n\n#define luaZ_resetbuffer(buff) ((buff)->n = 0)\n\n\n#define luaZ_resizebuffer(L, buff, size) \\\n\t(luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \\\n\t(buff)->buffsize = size)\n\n#define luaZ_freebuffer(L, buff)\tluaZ_resizebuffer(L, buff, 0)\n\n\nLUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);\nLUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,\n                                        void *data);\nLUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n);\t/* read next n bytes */\nLUAI_FUNC int luaZ_lookahead (ZIO *z);\n\n\n\n/* --------- Private Part ------------------ */\n\nstruct Zio {\n  size_t n;\t\t\t/* bytes still unread */\n  const char *p;\t\t/* current position in buffer */\n  lua_Reader reader;\n  void* data;\t\t\t/* additional data */\n  lua_State *L;\t\t\t/* Lua state (for reader) */\n};\n\n\nLUAI_FUNC int luaZ_fill (ZIO *z);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/lua/print.c",
    "content": "/*\n** $Id: print.c,v 1.55a 2006/05/31 13:30:05 lhf Exp $\n** print bytecodes\n** See Copyright Notice in lua.h\n*/\n\n#include <ctype.h>\n#include <stdio.h>\n\n#define luac_c\n#define LUA_CORE\n\n#include \"ldebug.h\"\n#include \"lobject.h\"\n#include \"lopcodes.h\"\n#include \"lundump.h\"\n\n#define PrintFunction\tluaU_print\n\n#define Sizeof(x)\t((int)sizeof(x))\n#define VOID(p)\t\t((const void*)(p))\n\nstatic void PrintString(const TString* ts)\n{\n const char* s=getstr(ts);\n size_t i,n=ts->tsv.len;\n putchar('\"');\n for (i=0; i<n; i++)\n {\n  int c=s[i];\n  switch (c)\n  {\n   case '\"': printf(\"\\\\\\\"\"); break;\n   case '\\\\': printf(\"\\\\\\\\\"); break;\n   case '\\a': printf(\"\\\\a\"); break;\n   case '\\b': printf(\"\\\\b\"); break;\n   case '\\f': printf(\"\\\\f\"); break;\n   case '\\n': printf(\"\\\\n\"); break;\n   case '\\r': printf(\"\\\\r\"); break;\n   case '\\t': printf(\"\\\\t\"); break;\n   case '\\v': printf(\"\\\\v\"); break;\n   default:\tif (isprint((unsigned char)c))\n   \t\t\tputchar(c);\n\t\telse\n\t\t\tprintf(\"\\\\%03u\",(unsigned char)c);\n  }\n }\n putchar('\"');\n}\n\nstatic void PrintConstant(const Proto* f, int i)\n{\n const TValue* o=&f->k[i];\n switch (ttype(o))\n {\n  case LUA_TNIL:\n\tprintf(\"nil\");\n\tbreak;\n  case LUA_TBOOLEAN:\n\tprintf(bvalue(o) ? \"true\" : \"false\");\n\tbreak;\n  case LUA_TNUMBER:\n\tprintf(LUA_NUMBER_FMT,nvalue(o));\n\tbreak;\n  case LUA_TSTRING:\n\tPrintString(rawtsvalue(o));\n\tbreak;\n  default:\t\t\t\t/* cannot happen */\n\tprintf(\"? type=%d\",ttype(o));\n\tbreak;\n }\n}\n\nstatic void PrintCode(const Proto* f)\n{\n const Instruction* code=f->code;\n int pc,n=f->sizecode;\n for (pc=0; pc<n; pc++)\n {\n  Instruction i=code[pc];\n  OpCode o=GET_OPCODE(i);\n  int a=GETARG_A(i);\n  int b=GETARG_B(i);\n  int c=GETARG_C(i);\n  int bx=GETARG_Bx(i);\n  int sbx=GETARG_sBx(i);\n  int line=getline(f,pc);\n  printf(\"\\t%d\\t\",pc+1);\n  if (line>0) printf(\"[%d]\\t\",line); else printf(\"[-]\\t\");\n  printf(\"%-9s\\t\",luaP_opnames[o]);\n  switch (getOpMode(o))\n  {\n   case iABC:\n    printf(\"%d\",a);\n    if (getBMode(o)!=OpArgN) printf(\" %d\",ISK(b) ? (-1-INDEXK(b)) : b);\n    if (getCMode(o)!=OpArgN) printf(\" %d\",ISK(c) ? (-1-INDEXK(c)) : c);\n    break;\n   case iABx:\n    if (getBMode(o)==OpArgK) printf(\"%d %d\",a,-1-bx); else printf(\"%d %d\",a,bx);\n    break;\n   case iAsBx:\n    if (o==OP_JMP) printf(\"%d\",sbx); else printf(\"%d %d\",a,sbx);\n    break;\n  }\n  switch (o)\n  {\n   case OP_LOADK:\n    printf(\"\\t; \"); PrintConstant(f,bx);\n    break;\n   case OP_GETUPVAL:\n   case OP_SETUPVAL:\n    printf(\"\\t; %s\", (f->sizeupvalues>0) ? getstr(f->upvalues[b]) : \"-\");\n    break;\n   case OP_GETGLOBAL:\n   case OP_SETGLOBAL:\n    printf(\"\\t; %s\",svalue(&f->k[bx]));\n    break;\n   case OP_GETTABLE:\n   case OP_SELF:\n    if (ISK(c)) { printf(\"\\t; \"); PrintConstant(f,INDEXK(c)); }\n    break;\n   case OP_SETTABLE:\n   case OP_ADD:\n   case OP_SUB:\n   case OP_MUL:\n   case OP_DIV:\n   case OP_POW:\n   case OP_EQ:\n   case OP_LT:\n   case OP_LE:\n    if (ISK(b) || ISK(c))\n    {\n     printf(\"\\t; \");\n     if (ISK(b)) PrintConstant(f,INDEXK(b)); else printf(\"-\");\n     printf(\" \");\n     if (ISK(c)) PrintConstant(f,INDEXK(c)); else printf(\"-\");\n    }\n    break;\n   case OP_JMP:\n   case OP_FORLOOP:\n   case OP_FORPREP:\n    printf(\"\\t; to %d\",sbx+pc+2);\n    break;\n   case OP_CLOSURE:\n    printf(\"\\t; %p\",VOID(f->p[bx]));\n    break;\n   case OP_SETLIST:\n    if (c==0) printf(\"\\t; %d\",(int)code[++pc]);\n    else printf(\"\\t; %d\",c);\n    break;\n   default:\n    break;\n  }\n  printf(\"\\n\");\n }\n}\n\n#define SS(x)\t(x==1)?\"\":\"s\"\n#define S(x)\tx,SS(x)\n\nstatic void PrintHeader(const Proto* f)\n{\n const char* s=getstr(f->source);\n if (*s=='@' || *s=='=')\n  s++;\n else if (*s==LUA_SIGNATURE[0])\n  s=\"(bstring)\";\n else\n  s=\"(string)\";\n printf(\"\\n%s <%s:%d,%d> (%d instruction%s, %d bytes at %p)\\n\",\n \t(f->linedefined==0)?\"main\":\"function\",s,\n\tf->linedefined,f->lastlinedefined,\n\tS(f->sizecode),f->sizecode*Sizeof(Instruction),VOID(f));\n printf(\"%d%s param%s, %d slot%s, %d upvalue%s, \",\n\tf->numparams,f->is_vararg?\"+\":\"\",SS(f->numparams),\n\tS(f->maxstacksize),S(f->nups));\n printf(\"%d local%s, %d constant%s, %d function%s\\n\",\n\tS(f->sizelocvars),S(f->sizek),S(f->sizep));\n}\n\nstatic void PrintConstants(const Proto* f)\n{\n int i,n=f->sizek;\n printf(\"constants (%d) for %p:\\n\",n,VOID(f));\n for (i=0; i<n; i++)\n {\n  printf(\"\\t%d\\t\",i+1);\n  PrintConstant(f,i);\n  printf(\"\\n\");\n }\n}\n\nstatic void PrintLocals(const Proto* f)\n{\n int i,n=f->sizelocvars;\n printf(\"locals (%d) for %p:\\n\",n,VOID(f));\n for (i=0; i<n; i++)\n {\n  printf(\"\\t%d\\t%s\\t%d\\t%d\\n\",\n  i,getstr(f->locvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1);\n }\n}\n\nstatic void PrintUpvalues(const Proto* f)\n{\n int i,n=f->sizeupvalues;\n printf(\"upvalues (%d) for %p:\\n\",n,VOID(f));\n if (f->upvalues==NULL) return;\n for (i=0; i<n; i++)\n {\n  printf(\"\\t%d\\t%s\\n\",i,getstr(f->upvalues[i]));\n }\n}\n\nvoid PrintFunction(const Proto* f, int full)\n{\n int i,n=f->sizep;\n PrintHeader(f);\n PrintCode(f);\n if (full)\n {\n  PrintConstants(f);\n  PrintLocals(f);\n  PrintUpvalues(f);\n }\n for (i=0; i<n; i++) PrintFunction(f->p[i],full);\n}\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/build_android.sh",
    "content": "#!/bin/sh\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nhost_os=`uname -s | tr \"[:upper:]\" \"[:lower:]\"`\n\nSRCDIR=$DIR/src\ncd \"$SRCDIR\"\n\nNDK=$NDK_ROOT\nNDKABI=8\nNDKVER=$NDK/toolchains/arm-linux-androideabi-4.6\nNDKP=$NDKVER/prebuilt/${host_os}-x86/bin/arm-linux-androideabi-\nNDKF=\"--sysroot $NDK/platforms/android-$NDKABI/arch-arm\"\n\n# Android/ARM, armeabi (ARMv5TE soft-float), Android 2.2+ (Froyo)\nDESTDIR=$DIR/prebuilt/android/armeabi\nrm \"$DESTDIR\"/*.a\nmake clean\nmake HOST_CC=\"gcc -m32\" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS=\"$NDKF\"\n\nif [ -f $SRCDIR/src/libluajit.a ]; then\n    mv $SRCDIR/src/libluajit.a $DESTDIR/libluajit.a\nfi;\n\n# Android/ARM, armeabi-v7a (ARMv7 VFP), Android 4.0+ (ICS)\nNDKARCH=\"-march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8\"\nDESTDIR=$DIR/prebuilt/android/armeabi-v7a\nrm \"$DESTDIR\"/*.a\nmake clean\nmake HOST_CC=\"gcc -m32\" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS=\"$NDKF $NDKARCH\"\n\nif [ -f $SRCDIR/src/libluajit.a ]; then\n    mv $SRCDIR/src/libluajit.a $DESTDIR/libluajit.a\nfi;\n\n# Android/x86, x86 (i686 SSE3), Android 4.0+ (ICS)\nNDKABI=14\nDESTDIR=$DIR/prebuilt/android/x86\nNDKVER=$NDK/toolchains/x86-4.6\nNDKP=$NDKVER/prebuilt/${host_os}-x86/bin/i686-linux-android-\nNDKF=\"--sysroot $NDK/platforms/android-$NDKABI/arch-x86\"\nrm \"$DESTDIR\"/*.a\nmake clean\nmake HOST_CC=\"gcc -m32\" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS=\"$NDKF\"\n\nif [ -f $SRCDIR/src/libluajit.a ]; then\n    mv $SRCDIR/src/libluajit.a $DESTDIR/libluajit.a\nfi;\n\nmake clean\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/build_ios.sh",
    "content": "#!/bin/sh\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nLIPO=\"xcrun -sdk iphoneos lipo\"\nSTRIP=\"xcrun -sdk iphoneos strip\"\n\nSRCDIR=$DIR/src\nDESTDIR=$DIR/prebuilt/ios\nIXCODE=`xcode-select -print-path`\nISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer\nISDKVER=iPhoneOS6.1.sdk\nISDKP=$ISDK/usr/bin/\n\nrm \"$DESTDIR\"/*.a\ncd $SRCDIR\n\nmake clean\nISDKF=\"-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER\"\nmake HOST_CC=\"gcc -m32 -arch i386\" CROSS=$ISDKP TARGET_FLAGS=\"$ISDKF\" TARGET_SYS=iOS\nmv \"$SRCDIR\"/src/libluajit.a \"$DESTDIR\"/libluajit-armv7.a\n\nmake clean\nISDKF=\"-arch armv7s -isysroot $ISDK/SDKs/$ISDKVER\"\nmake HOST_CC=\"gcc -m32 -arch i386\" CROSS=$ISDKP TARGET_FLAGS=\"$ISDKF\" TARGET_SYS=iOS\nmv \"$SRCDIR\"/src/libluajit.a \"$DESTDIR\"/libluajit-armv7s.a\n\nmake clean\nmake CC=\"gcc -m32 -arch i386\" clean all\nmv \"$SRCDIR\"/src/libluajit.a \"$DESTDIR\"/libluajit-i386.a\n\n$LIPO -create \"$DESTDIR\"/libluajit-*.a -output \"$DESTDIR\"/libluajit.a\n$STRIP -S \"$DESTDIR\"/libluajit.a\n$LIPO -info \"$DESTDIR\"/libluajit.a\n\nrm \"$DESTDIR\"/libluajit-*.a\n\nmake clean\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/build_mac.sh",
    "content": "#!/bin/sh\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nSRCDIR=$DIR/src\nDESTDIR=$DIR/prebuilt/mac\nMACOSX_DEPLOYMENT_TARGET=\"10.6\"\n\nrm \"$DESTDIR\"/*.a\n\ncd $SRCDIR\nmake clean\nmake CC=\"gcc -m64 -arch x86_64\" clean all\n\nif [ -f $SRCDIR/src/libluajit.a ]; then\n    mv $SRCDIR/src/libluajit.a $DESTDIR/libluajit.a\nfi;\n\nmake clean\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/include/lauxlib.h",
    "content": "/*\n** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $\n** Auxiliary functions for building Lua libraries\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lauxlib_h\n#define lauxlib_h\n\n\n#include <stddef.h>\n#include <stdio.h>\n\n#include \"lua.h\"\n\n\n#define luaL_getn(L,i)          ((int)lua_objlen(L, i))\n#define luaL_setn(L,i,j)        ((void)0)  /* no op! */\n\n/* extra error code for `luaL_load' */\n#define LUA_ERRFILE     (LUA_ERRERR+1)\n\ntypedef struct luaL_Reg {\n  const char *name;\n  lua_CFunction func;\n} luaL_Reg;\n\nLUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,\n                                const luaL_Reg *l, int nup);\nLUALIB_API void (luaL_register) (lua_State *L, const char *libname,\n                                const luaL_Reg *l);\nLUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);\nLUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);\nLUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);\nLUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);\nLUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,\n                                                          size_t *l);\nLUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,\n                                          const char *def, size_t *l);\nLUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);\nLUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);\n\nLUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);\nLUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,\n                                          lua_Integer def);\n\nLUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);\nLUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);\nLUALIB_API void (luaL_checkany) (lua_State *L, int narg);\n\nLUALIB_API int   (luaL_newmetatable) (lua_State *L, const char *tname);\nLUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);\n\nLUALIB_API void (luaL_where) (lua_State *L, int lvl);\nLUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);\n\nLUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,\n                                   const char *const lst[]);\n\nLUALIB_API int (luaL_ref) (lua_State *L, int t);\nLUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);\n\nLUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);\nLUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,\n                                  const char *name);\nLUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);\n\nLUALIB_API lua_State *(luaL_newstate) (void);\n\n\nLUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,\n                                                  const char *r);\n\nLUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,\n                                         const char *fname, int szhint);\n\n/* From Lua 5.2. */\nLUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname);\nLUALIB_API int luaL_execresult(lua_State *L, int stat);\nLUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename,\n\t\t\t\t const char *mode);\nLUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz,\n\t\t\t\t   const char *name, const char *mode);\nLUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,\n\t\t\t\tint level);\n\n\n/*\n** ===============================================================\n** some useful macros\n** ===============================================================\n*/\n\n#define luaL_argcheck(L, cond,numarg,extramsg)\t\\\n\t\t((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))\n#define luaL_checkstring(L,n)\t(luaL_checklstring(L, (n), NULL))\n#define luaL_optstring(L,n,d)\t(luaL_optlstring(L, (n), (d), NULL))\n#define luaL_checkint(L,n)\t((int)luaL_checkinteger(L, (n)))\n#define luaL_optint(L,n,d)\t((int)luaL_optinteger(L, (n), (d)))\n#define luaL_checklong(L,n)\t((long)luaL_checkinteger(L, (n)))\n#define luaL_optlong(L,n,d)\t((long)luaL_optinteger(L, (n), (d)))\n\n#define luaL_typename(L,i)\tlua_typename(L, lua_type(L,(i)))\n\n#define luaL_dofile(L, fn) \\\n\t(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\n#define luaL_dostring(L, s) \\\n\t(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\n#define luaL_getmetatable(L,n)\t(lua_getfield(L, LUA_REGISTRYINDEX, (n)))\n\n#define luaL_opt(L,f,n,d)\t(lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))\n\n/*\n** {======================================================\n** Generic Buffer manipulation\n** =======================================================\n*/\n\n\n\ntypedef struct luaL_Buffer {\n  char *p;\t\t\t/* current position in buffer */\n  int lvl;  /* number of strings in the stack (level) */\n  lua_State *L;\n  char buffer[LUAL_BUFFERSIZE];\n} luaL_Buffer;\n\n#define luaL_addchar(B,c) \\\n  ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \\\n   (*(B)->p++ = (char)(c)))\n\n/* compatibility only */\n#define luaL_putchar(B,c)\tluaL_addchar(B,c)\n\n#define luaL_addsize(B,n)\t((B)->p += (n))\n\nLUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);\nLUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);\nLUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);\nLUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);\nLUALIB_API void (luaL_addvalue) (luaL_Buffer *B);\nLUALIB_API void (luaL_pushresult) (luaL_Buffer *B);\n\n\n/* }====================================================== */\n\n\n/* compatibility with ref system */\n\n/* pre-defined references */\n#define LUA_NOREF       (-2)\n#define LUA_REFNIL      (-1)\n\n#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \\\n      (lua_pushstring(L, \"unlocked references are obsolete\"), lua_error(L), 0))\n\n#define lua_unref(L,ref)        luaL_unref(L, LUA_REGISTRYINDEX, (ref))\n\n#define lua_getref(L,ref)       lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))\n\n\n#define luaL_reg\tluaL_Reg\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/include/lua.h",
    "content": "/*\n** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $\n** Lua - An Extensible Extension Language\n** Lua.org, PUC-Rio, Brazil (http://www.lua.org)\n** See Copyright Notice at the end of this file\n*/\n\n\n#ifndef lua_h\n#define lua_h\n\n#include <stdarg.h>\n#include <stddef.h>\n\n\n#include \"luaconf.h\"\n\n\n#define LUA_VERSION\t\"Lua 5.1\"\n#define LUA_RELEASE\t\"Lua 5.1.4\"\n#define LUA_VERSION_NUM\t501\n#define LUA_COPYRIGHT\t\"Copyright (C) 1994-2008 Lua.org, PUC-Rio\"\n#define LUA_AUTHORS\t\"R. Ierusalimschy, L. H. de Figueiredo & W. Celes\"\n\n\n/* mark for precompiled code (`<esc>Lua') */\n#define\tLUA_SIGNATURE\t\"\\033Lua\"\n\n/* option for multiple returns in `lua_pcall' and `lua_call' */\n#define LUA_MULTRET\t(-1)\n\n\n/*\n** pseudo-indices\n*/\n#define LUA_REGISTRYINDEX\t(-10000)\n#define LUA_ENVIRONINDEX\t(-10001)\n#define LUA_GLOBALSINDEX\t(-10002)\n#define lua_upvalueindex(i)\t(LUA_GLOBALSINDEX-(i))\n\n\n/* thread status; 0 is OK */\n#define LUA_YIELD\t1\n#define LUA_ERRRUN\t2\n#define LUA_ERRSYNTAX\t3\n#define LUA_ERRMEM\t4\n#define LUA_ERRERR\t5\n\n\ntypedef struct lua_State lua_State;\n\ntypedef int (*lua_CFunction) (lua_State *L);\n\n\n/*\n** functions that read/write blocks when loading/dumping Lua chunks\n*/\ntypedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);\n\ntypedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);\n\n\n/*\n** prototype for memory-allocation functions\n*/\ntypedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);\n\n\n/*\n** basic types\n*/\n#define LUA_TNONE\t\t(-1)\n\n#define LUA_TNIL\t\t0\n#define LUA_TBOOLEAN\t\t1\n#define LUA_TLIGHTUSERDATA\t2\n#define LUA_TNUMBER\t\t3\n#define LUA_TSTRING\t\t4\n#define LUA_TTABLE\t\t5\n#define LUA_TFUNCTION\t\t6\n#define LUA_TUSERDATA\t\t7\n#define LUA_TTHREAD\t\t8\n\n\n\n/* minimum Lua stack available to a C function */\n#define LUA_MINSTACK\t20\n\n\n/*\n** generic extra include file\n*/\n#if defined(LUA_USER_H)\n#include LUA_USER_H\n#endif\n\n\n/* type of numbers in Lua */\ntypedef LUA_NUMBER lua_Number;\n\n\n/* type for integer functions */\ntypedef LUA_INTEGER lua_Integer;\n\n\n\n/*\n** state manipulation\n*/\nLUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);\nLUA_API void       (lua_close) (lua_State *L);\nLUA_API lua_State *(lua_newthread) (lua_State *L);\n\nLUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);\n\n\n/*\n** basic stack manipulation\n*/\nLUA_API int   (lua_gettop) (lua_State *L);\nLUA_API void  (lua_settop) (lua_State *L, int idx);\nLUA_API void  (lua_pushvalue) (lua_State *L, int idx);\nLUA_API void  (lua_remove) (lua_State *L, int idx);\nLUA_API void  (lua_insert) (lua_State *L, int idx);\nLUA_API void  (lua_replace) (lua_State *L, int idx);\nLUA_API int   (lua_checkstack) (lua_State *L, int sz);\n\nLUA_API void  (lua_xmove) (lua_State *from, lua_State *to, int n);\n\n\n/*\n** access functions (stack -> C)\n*/\n\nLUA_API int             (lua_isnumber) (lua_State *L, int idx);\nLUA_API int             (lua_isstring) (lua_State *L, int idx);\nLUA_API int             (lua_iscfunction) (lua_State *L, int idx);\nLUA_API int             (lua_isuserdata) (lua_State *L, int idx);\nLUA_API int             (lua_type) (lua_State *L, int idx);\nLUA_API const char     *(lua_typename) (lua_State *L, int tp);\n\nLUA_API int            (lua_equal) (lua_State *L, int idx1, int idx2);\nLUA_API int            (lua_rawequal) (lua_State *L, int idx1, int idx2);\nLUA_API int            (lua_lessthan) (lua_State *L, int idx1, int idx2);\n\nLUA_API lua_Number      (lua_tonumber) (lua_State *L, int idx);\nLUA_API lua_Integer     (lua_tointeger) (lua_State *L, int idx);\nLUA_API int             (lua_toboolean) (lua_State *L, int idx);\nLUA_API const char     *(lua_tolstring) (lua_State *L, int idx, size_t *len);\nLUA_API size_t          (lua_objlen) (lua_State *L, int idx);\nLUA_API lua_CFunction   (lua_tocfunction) (lua_State *L, int idx);\nLUA_API void\t       *(lua_touserdata) (lua_State *L, int idx);\nLUA_API lua_State      *(lua_tothread) (lua_State *L, int idx);\nLUA_API const void     *(lua_topointer) (lua_State *L, int idx);\n\n\n/*\n** push functions (C -> stack)\n*/\nLUA_API void  (lua_pushnil) (lua_State *L);\nLUA_API void  (lua_pushnumber) (lua_State *L, lua_Number n);\nLUA_API void  (lua_pushinteger) (lua_State *L, lua_Integer n);\nLUA_API void  (lua_pushlstring) (lua_State *L, const char *s, size_t l);\nLUA_API void  (lua_pushstring) (lua_State *L, const char *s);\nLUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,\n                                                      va_list argp);\nLUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);\nLUA_API void  (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);\nLUA_API void  (lua_pushboolean) (lua_State *L, int b);\nLUA_API void  (lua_pushlightuserdata) (lua_State *L, void *p);\nLUA_API int   (lua_pushthread) (lua_State *L);\n\n\n/*\n** get functions (Lua -> stack)\n*/\nLUA_API void  (lua_gettable) (lua_State *L, int idx);\nLUA_API void  (lua_getfield) (lua_State *L, int idx, const char *k);\nLUA_API void  (lua_rawget) (lua_State *L, int idx);\nLUA_API void  (lua_rawgeti) (lua_State *L, int idx, int n);\nLUA_API void  (lua_createtable) (lua_State *L, int narr, int nrec);\nLUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);\nLUA_API int   (lua_getmetatable) (lua_State *L, int objindex);\nLUA_API void  (lua_getfenv) (lua_State *L, int idx);\n\n\n/*\n** set functions (stack -> Lua)\n*/\nLUA_API void  (lua_settable) (lua_State *L, int idx);\nLUA_API void  (lua_setfield) (lua_State *L, int idx, const char *k);\nLUA_API void  (lua_rawset) (lua_State *L, int idx);\nLUA_API void  (lua_rawseti) (lua_State *L, int idx, int n);\nLUA_API int   (lua_setmetatable) (lua_State *L, int objindex);\nLUA_API int   (lua_setfenv) (lua_State *L, int idx);\n\n\n/*\n** `load' and `call' functions (load and run Lua code)\n*/\nLUA_API void  (lua_call) (lua_State *L, int nargs, int nresults);\nLUA_API int   (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);\nLUA_API int   (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);\nLUA_API int   (lua_load) (lua_State *L, lua_Reader reader, void *dt,\n                                        const char *chunkname);\n\nLUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);\n\n\n/*\n** coroutine functions\n*/\nLUA_API int  (lua_yield) (lua_State *L, int nresults);\nLUA_API int  (lua_resume) (lua_State *L, int narg);\nLUA_API int  (lua_status) (lua_State *L);\n\n/*\n** garbage-collection function and options\n*/\n\n#define LUA_GCSTOP\t\t0\n#define LUA_GCRESTART\t\t1\n#define LUA_GCCOLLECT\t\t2\n#define LUA_GCCOUNT\t\t3\n#define LUA_GCCOUNTB\t\t4\n#define LUA_GCSTEP\t\t5\n#define LUA_GCSETPAUSE\t\t6\n#define LUA_GCSETSTEPMUL\t7\n\nLUA_API int (lua_gc) (lua_State *L, int what, int data);\n\n\n/*\n** miscellaneous functions\n*/\n\nLUA_API int   (lua_error) (lua_State *L);\n\nLUA_API int   (lua_next) (lua_State *L, int idx);\n\nLUA_API void  (lua_concat) (lua_State *L, int n);\n\nLUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);\nLUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);\n\n\n\n/*\n** ===============================================================\n** some useful macros\n** ===============================================================\n*/\n\n#define lua_pop(L,n)\t\tlua_settop(L, -(n)-1)\n\n#define lua_newtable(L)\t\tlua_createtable(L, 0, 0)\n\n#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))\n\n#define lua_pushcfunction(L,f)\tlua_pushcclosure(L, (f), 0)\n\n#define lua_strlen(L,i)\t\tlua_objlen(L, (i))\n\n#define lua_isfunction(L,n)\t(lua_type(L, (n)) == LUA_TFUNCTION)\n#define lua_istable(L,n)\t(lua_type(L, (n)) == LUA_TTABLE)\n#define lua_islightuserdata(L,n)\t(lua_type(L, (n)) == LUA_TLIGHTUSERDATA)\n#define lua_isnil(L,n)\t\t(lua_type(L, (n)) == LUA_TNIL)\n#define lua_isboolean(L,n)\t(lua_type(L, (n)) == LUA_TBOOLEAN)\n#define lua_isthread(L,n)\t(lua_type(L, (n)) == LUA_TTHREAD)\n#define lua_isnone(L,n)\t\t(lua_type(L, (n)) == LUA_TNONE)\n#define lua_isnoneornil(L, n)\t(lua_type(L, (n)) <= 0)\n\n#define lua_pushliteral(L, s)\t\\\n\tlua_pushlstring(L, \"\" s, (sizeof(s)/sizeof(char))-1)\n\n#define lua_setglobal(L,s)\tlua_setfield(L, LUA_GLOBALSINDEX, (s))\n#define lua_getglobal(L,s)\tlua_getfield(L, LUA_GLOBALSINDEX, (s))\n\n#define lua_tostring(L,i)\tlua_tolstring(L, (i), NULL)\n\n\n\n/*\n** compatibility macros and functions\n*/\n\n#define lua_open()\tluaL_newstate()\n\n#define lua_getregistry(L)\tlua_pushvalue(L, LUA_REGISTRYINDEX)\n\n#define lua_getgccount(L)\tlua_gc(L, LUA_GCCOUNT, 0)\n\n#define lua_Chunkreader\t\tlua_Reader\n#define lua_Chunkwriter\t\tlua_Writer\n\n\n/* hack */\nLUA_API void lua_setlevel\t(lua_State *from, lua_State *to);\n\n\n/*\n** {======================================================================\n** Debug API\n** =======================================================================\n*/\n\n\n/*\n** Event codes\n*/\n#define LUA_HOOKCALL\t0\n#define LUA_HOOKRET\t1\n#define LUA_HOOKLINE\t2\n#define LUA_HOOKCOUNT\t3\n#define LUA_HOOKTAILRET 4\n\n\n/*\n** Event masks\n*/\n#define LUA_MASKCALL\t(1 << LUA_HOOKCALL)\n#define LUA_MASKRET\t(1 << LUA_HOOKRET)\n#define LUA_MASKLINE\t(1 << LUA_HOOKLINE)\n#define LUA_MASKCOUNT\t(1 << LUA_HOOKCOUNT)\n\ntypedef struct lua_Debug lua_Debug;  /* activation record */\n\n\n/* Functions to be called by the debuger in specific events */\ntypedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);\n\n\nLUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);\nLUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);\nLUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);\nLUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);\nLUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);\nLUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);\nLUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);\nLUA_API lua_Hook lua_gethook (lua_State *L);\nLUA_API int lua_gethookmask (lua_State *L);\nLUA_API int lua_gethookcount (lua_State *L);\n\n/* From Lua 5.2. */\nLUA_API void *lua_upvalueid (lua_State *L, int idx, int n);\nLUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2);\nLUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt,\n\t\t       const char *chunkname, const char *mode);\n\n\nstruct lua_Debug {\n  int event;\n  const char *name;\t/* (n) */\n  const char *namewhat;\t/* (n) `global', `local', `field', `method' */\n  const char *what;\t/* (S) `Lua', `C', `main', `tail' */\n  const char *source;\t/* (S) */\n  int currentline;\t/* (l) */\n  int nups;\t\t/* (u) number of upvalues */\n  int linedefined;\t/* (S) */\n  int lastlinedefined;\t/* (S) */\n  char short_src[LUA_IDSIZE]; /* (S) */\n  /* private part */\n  int i_ci;  /* active function */\n};\n\n/* }====================================================================== */\n\n\n/******************************************************************************\n* Copyright (C) 1994-2008 Lua.org, PUC-Rio.  All rights reserved.\n*\n* Permission is hereby granted, free of charge, to any person obtaining\n* a copy of this software and associated documentation files (the\n* \"Software\"), to deal in the Software without restriction, including\n* without limitation the rights to use, copy, modify, merge, publish,\n* distribute, sublicense, and/or sell copies of the Software, and to\n* permit persons to whom the Software is furnished to do so, subject to\n* the following conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n******************************************************************************/\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/include/luaconf.h",
    "content": "/*\n** Configuration header.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef luaconf_h\n#define luaconf_h\n\n#include <limits.h>\n#include <stddef.h>\n\n/* Default path for loading Lua and C modules with require(). */\n#if defined(_WIN32)\n/*\n** In Windows, any exclamation mark ('!') in the path is replaced by the\n** path of the directory of the executable file of the current process.\n*/\n#define LUA_LDIR\t\"!\\\\lua\\\\\"\n#define LUA_CDIR\t\"!\\\\\"\n#define LUA_PATH_DEFAULT \\\n  \".\\\\?.lua;\" LUA_LDIR\"?.lua;\" LUA_LDIR\"?\\\\init.lua;\"\n#define LUA_CPATH_DEFAULT \\\n  \".\\\\?.dll;\" LUA_CDIR\"?.dll;\" LUA_CDIR\"loadall.dll\"\n#else\n/*\n** Note to distribution maintainers: do NOT patch the following line!\n** Please read ../doc/install.html#distro and pass PREFIX=/usr instead.\n*/\n#define LUA_ROOT\t\"/usr/local/\"\n#define LUA_LDIR\tLUA_ROOT \"share/lua/5.1/\"\n#define LUA_CDIR\tLUA_ROOT \"lib/lua/5.1/\"\n#ifdef LUA_XROOT\n#define LUA_JDIR\tLUA_XROOT \"share/luajit-2.0.1/\"\n#define LUA_XPATH \\\n  \";\" LUA_XROOT \"share/lua/5.1/?.lua;\" LUA_XROOT \"share/lua/5.1/?/init.lua\"\n#define LUA_XCPATH\tLUA_XROOT \"lib/lua/5.1/?.so;\"\n#else\n#define LUA_JDIR\tLUA_ROOT \"share/luajit-2.0.1/\"\n#define LUA_XPATH\n#define LUA_XCPATH\n#endif\n#define LUA_PATH_DEFAULT \\\n  \"./?.lua;\" LUA_JDIR\"?.lua;\" LUA_LDIR\"?.lua;\" LUA_LDIR\"?/init.lua\" LUA_XPATH\n#define LUA_CPATH_DEFAULT \\\n  \"./?.so;\" LUA_CDIR\"?.so;\" LUA_XCPATH LUA_CDIR\"loadall.so\"\n#endif\n\n/* Environment variable names for path overrides and initialization code. */\n#define LUA_PATH\t\"LUA_PATH\"\n#define LUA_CPATH\t\"LUA_CPATH\"\n#define LUA_INIT\t\"LUA_INIT\"\n\n/* Special file system characters. */\n#if defined(_WIN32)\n#define LUA_DIRSEP\t\"\\\\\"\n#else\n#define LUA_DIRSEP\t\"/\"\n#endif\n#define LUA_PATHSEP\t\";\"\n#define LUA_PATH_MARK\t\"?\"\n#define LUA_EXECDIR\t\"!\"\n#define LUA_IGMARK\t\"-\"\n#define LUA_PATH_CONFIG \\\n  LUA_DIRSEP \"\\n\" LUA_PATHSEP \"\\n\" LUA_PATH_MARK \"\\n\" \\\n  LUA_EXECDIR \"\\n\" LUA_IGMARK\n\n/* Quoting in error messages. */\n#define LUA_QL(x)\t\"'\" x \"'\"\n#define LUA_QS\t\tLUA_QL(\"%s\")\n\n/* Various tunables. */\n#define LUAI_MAXSTACK\t65500\t/* Max. # of stack slots for a thread (<64K). */\n#define LUAI_MAXCSTACK\t8000\t/* Max. # of stack slots for a C func (<10K). */\n#define LUAI_GCPAUSE\t200\t/* Pause GC until memory is at 200%. */\n#define LUAI_GCMUL\t200\t/* Run GC at 200% of allocation speed. */\n#define LUA_MAXCAPTURES\t32\t/* Max. pattern captures. */\n\n/* Compatibility with older library function names. */\n#define LUA_COMPAT_MOD\t\t/* OLD: math.mod, NEW: math.fmod */\n#define LUA_COMPAT_GFIND\t/* OLD: string.gfind, NEW: string.gmatch */\n\n/* Configuration for the frontend (the luajit executable). */\n#if defined(luajit_c)\n#define LUA_PROGNAME\t\"luajit\"  /* Fallback frontend name. */\n#define LUA_PROMPT\t\"> \"\t/* Interactive prompt. */\n#define LUA_PROMPT2\t\">> \"\t/* Continuation prompt. */\n#define LUA_MAXINPUT\t512\t/* Max. input line length. */\n#endif\n\n/* Note: changing the following defines breaks the Lua 5.1 ABI. */\n#define LUA_INTEGER\tptrdiff_t\n#define LUA_IDSIZE\t60\t/* Size of lua_Debug.short_src. */\n/*\n** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using\n** unreasonable amounts of stack space, but still retain ABI compatibility.\n** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it.\n*/\n#define LUAL_BUFFERSIZE\t(BUFSIZ > 16384 ? 8192 : BUFSIZ)\n\n/* The following defines are here only for compatibility with luaconf.h\n** from the standard Lua distribution. They must not be changed for LuaJIT.\n*/\n#define LUA_NUMBER_DOUBLE\n#define LUA_NUMBER\t\tdouble\n#define LUAI_UACNUMBER\t\tdouble\n#define LUA_NUMBER_SCAN\t\t\"%lf\"\n#define LUA_NUMBER_FMT\t\t\"%.14g\"\n#define lua_number2str(s, n)\tsprintf((s), LUA_NUMBER_FMT, (n))\n#define LUAI_MAXNUMBER2STR\t32\n#define LUA_INTFRMLEN\t\t\"l\"\n#define LUA_INTFRM_T\t\tlong\n\n/* Linkage of public API functions. */\n#if defined(LUA_BUILD_AS_DLL)\n#if defined(LUA_CORE) || defined(LUA_LIB)\n#define LUA_API\t\t__declspec(dllexport)\n#else\n#define LUA_API\t\t__declspec(dllimport)\n#endif\n#else\n#define LUA_API\t\textern\n#endif\n\n#define LUALIB_API\tLUA_API\n\n/* Support for internal assertions. */\n#if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK)\n#include <assert.h>\n#endif\n#ifdef LUA_USE_ASSERT\n#define lua_assert(x)\t\tassert(x)\n#endif\n#ifdef LUA_USE_APICHECK\n#define luai_apicheck(L, o)\t{ (void)L; assert(o); }\n#else\n#define luai_apicheck(L, o)\t{ (void)L; }\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/include/lualib.h",
    "content": "/*\n** Standard library header.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LUALIB_H\n#define _LUALIB_H\n\n#include \"lua.h\"\n\n#define LUA_FILEHANDLE\t\"FILE*\"\n\n#define LUA_COLIBNAME\t\"coroutine\"\n#define LUA_MATHLIBNAME\t\"math\"\n#define LUA_STRLIBNAME\t\"string\"\n#define LUA_TABLIBNAME\t\"table\"\n#define LUA_IOLIBNAME\t\"io\"\n#define LUA_OSLIBNAME\t\"os\"\n#define LUA_LOADLIBNAME\t\"package\"\n#define LUA_DBLIBNAME\t\"debug\"\n#define LUA_BITLIBNAME\t\"bit\"\n#define LUA_JITLIBNAME\t\"jit\"\n#define LUA_FFILIBNAME\t\"ffi\"\n\nLUALIB_API int luaopen_base(lua_State *L);\nLUALIB_API int luaopen_math(lua_State *L);\nLUALIB_API int luaopen_string(lua_State *L);\nLUALIB_API int luaopen_table(lua_State *L);\nLUALIB_API int luaopen_io(lua_State *L);\nLUALIB_API int luaopen_os(lua_State *L);\nLUALIB_API int luaopen_package(lua_State *L);\nLUALIB_API int luaopen_debug(lua_State *L);\nLUALIB_API int luaopen_bit(lua_State *L);\nLUALIB_API int luaopen_jit(lua_State *L);\nLUALIB_API int luaopen_ffi(lua_State *L);\n\nLUALIB_API void luaL_openlibs(lua_State *L);\n\n#ifndef lua_assert\n#define lua_assert(x)\t((void)0)\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE    := luajit_static\nLOCAL_MODULE_FILENAME := libluajit\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libluajit.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/COPYRIGHT",
    "content": "===============================================================================\nLuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/\n\nCopyright (C) 2005-2013 Mike Pall. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n[ MIT license: http://www.opensource.org/licenses/mit-license.php ]\n\n===============================================================================\n[ LuaJIT includes code from Lua 5.1/5.2, which has this license statement: ]\n\nCopyright (C) 1994-2012 Lua.org, PUC-Rio.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n===============================================================================\n[ LuaJIT includes code from dlmalloc, which has this license statement: ]\n\nThis is a version (aka dlmalloc) of malloc/free/realloc written by\nDoug Lea and released to the public domain, as explained at\nhttp://creativecommons.org/licenses/publicdomain\n\n===============================================================================\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/Makefile",
    "content": "##############################################################################\n# LuaJIT top level Makefile for installation. Requires GNU Make.\n#\n# Please read doc/install.html before changing any variables!\n#\n# Suitable for POSIX platforms (Linux, *BSD, OSX etc.).\n# Note: src/Makefile has many more configurable options.\n#\n# ##### This Makefile is NOT useful for Windows! #####\n# For MSVC, please follow the instructions given in src/msvcbuild.bat.\n# For MinGW and Cygwin, cd to src and run make with the Makefile there.\n#\n# Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n##############################################################################\n\nMAJVER=  2\nMINVER=  0\nRELVER=  1\nVERSION= $(MAJVER).$(MINVER).$(RELVER)\nABIVER=  5.1\n\n##############################################################################\n#\n# Change the installation path as needed. This automatically adjusts\n# the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path!\n#\nexport PREFIX= /usr/local\n##############################################################################\n\nDPREFIX= $(DESTDIR)$(PREFIX)\nINSTALL_BIN=   $(DPREFIX)/bin\nINSTALL_LIB=   $(DPREFIX)/lib\nINSTALL_SHARE= $(DPREFIX)/share\nINSTALL_INC=   $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)\n\nINSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION)\nINSTALL_JITLIB= $(INSTALL_LJLIBD)/jit\nINSTALL_LMODD= $(INSTALL_SHARE)/lua\nINSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)\nINSTALL_CMODD= $(INSTALL_LIB)/lua\nINSTALL_CMOD= $(INSTALL_CMODD)/$(ABIVER)\nINSTALL_MAN= $(INSTALL_SHARE)/man/man1\nINSTALL_PKGCONFIG= $(INSTALL_LIB)/pkgconfig\n\nINSTALL_TNAME= luajit-$(VERSION)\nINSTALL_TSYMNAME= luajit\nINSTALL_ANAME= libluajit-$(ABIVER).a\nINSTALL_SONAME= libluajit-$(ABIVER).so.$(MAJVER).$(MINVER).$(RELVER)\nINSTALL_SOSHORT= libluajit-$(ABIVER).so\nINSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib\nINSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib\nINSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib\nINSTALL_PCNAME= luajit.pc\n\nINSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)\nINSTALL_DYN= $(INSTALL_LIB)/$(INSTALL_SONAME)\nINSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_SOSHORT)\nINSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_SOSHORT)\nINSTALL_T= $(INSTALL_BIN)/$(INSTALL_TNAME)\nINSTALL_TSYM= $(INSTALL_BIN)/$(INSTALL_TSYMNAME)\nINSTALL_PC= $(INSTALL_PKGCONFIG)/$(INSTALL_PCNAME)\n\nINSTALL_DIRS= $(INSTALL_BIN) $(INSTALL_LIB) $(INSTALL_INC) $(INSTALL_MAN) \\\n  $(INSTALL_PKGCONFIG) $(INSTALL_JITLIB) $(INSTALL_LMOD) $(INSTALL_CMOD)\nUNINSTALL_DIRS= $(INSTALL_JITLIB) $(INSTALL_LJLIBD) $(INSTALL_INC) \\\n  $(INSTALL_LMOD) $(INSTALL_LMODD) $(INSTALL_CMOD) $(INSTALL_CMODD)\n\nRM= rm -f\nMKDIR= mkdir -p\nRMDIR= rmdir 2>/dev/null\nSYMLINK= ln -sf\nINSTALL_X= install -m 0755\nINSTALL_F= install -m 0644\nUNINSTALL= $(RM)\nLDCONFIG= ldconfig -n\nSED_PC= sed -e \"s|^prefix=.*|prefix=$(PREFIX)|\"\n\nFILE_T= luajit\nFILE_A= libluajit.a\nFILE_SO= libluajit.so\nFILE_MAN= luajit.1\nFILE_PC= luajit.pc\nFILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h\nFILES_JITLIB= bc.lua v.lua dump.lua dis_x86.lua dis_x64.lua dis_arm.lua \\\n\t      dis_ppc.lua dis_mips.lua dis_mipsel.lua bcsave.lua vmdef.lua\n\nifeq (,$(findstring Windows,$(OS)))\n  ifeq (Darwin,$(shell uname -s))\n    INSTALL_SONAME= $(INSTALL_DYLIBNAME)\n    INSTALL_SHORT1= $(INSTALL_LIB)/$(INSTALL_DYLIBSHORT1)\n    INSTALL_SHORT2= $(INSTALL_LIB)/$(INSTALL_DYLIBSHORT2)\n    LDCONFIG= :\n  endif\nendif\n\n##############################################################################\n\nINSTALL_DEP= src/luajit\n\ndefault all $(INSTALL_DEP):\n\t@echo \"==== Building LuaJIT $(VERSION) ====\"\n\t$(MAKE) -C src\n\t@echo \"==== Successfully built LuaJIT $(VERSION) ====\"\n\ninstall: $(INSTALL_DEP)\n\t@echo \"==== Installing LuaJIT $(VERSION) to $(PREFIX) ====\"\n\t$(MKDIR) $(INSTALL_DIRS)\n\tcd src && $(INSTALL_X) $(FILE_T) $(INSTALL_T)\n\tcd src && test -f $(FILE_A) && $(INSTALL_F) $(FILE_A) $(INSTALL_STATIC) || :\n\t$(RM) $(INSTALL_TSYM) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2)\n\tcd src && test -f $(FILE_SO) && \\\n\t  $(INSTALL_X) $(FILE_SO) $(INSTALL_DYN) && \\\n\t  $(LDCONFIG) $(INSTALL_LIB) && \\\n\t  $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT1) && \\\n\t  $(SYMLINK) $(INSTALL_SONAME) $(INSTALL_SHORT2) || :\n\tcd etc && $(INSTALL_F) $(FILE_MAN) $(INSTALL_MAN)\n\tcd etc && $(SED_PC) $(FILE_PC) > $(FILE_PC).tmp && \\\n\t  $(INSTALL_F) $(FILE_PC).tmp $(INSTALL_PC) && \\\n\t  $(RM) $(FILE_PC).tmp\n\tcd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)\n\tcd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)\n\t$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)\n\t@echo \"==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ====\"\n\nuninstall:\n\t@echo \"==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ====\"\n\t$(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)\n\tfor file in $(FILES_JITLIB); do \\\n\t  $(UNINSTALL) $(INSTALL_JITLIB)/$$file; \\\n\t  done\n\tfor file in $(FILES_INC); do \\\n\t  $(UNINSTALL) $(INSTALL_INC)/$$file; \\\n\t  done\n\t$(LDCONFIG) $(INSTALL_LIB)\n\t$(RMDIR) $(UNINSTALL_DIRS) || :\n\t@echo \"==== Successfully uninstalled LuaJIT $(VERSION) from $(PREFIX) ====\"\n\n##############################################################################\n\namalg:\n\t@echo \"Building LuaJIT $(VERSION)\"\n\t$(MAKE) -C src amalg\n\nclean:\n\t$(MAKE) -C src clean\n\n.PHONY: all install amalg clean\n\n##############################################################################\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/README",
    "content": "README for LuaJIT 2.0.1\n-----------------------\n\nLuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.\n\nProject Homepage: http://luajit.org/\n\nLuaJIT is Copyright (C) 2005-2013 Mike Pall.\nLuaJIT is free software, released under the MIT license.\nSee full Copyright Notice in the COPYRIGHT file or in luajit.h.\n\nDocumentation for LuaJIT is available in HTML format.\nPlease point your favorite browser to:\n\n doc/luajit.html\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/bluequad-print.css",
    "content": "/* Copyright (C) 2004-2013 Mike Pall.\n *\n * You are welcome to use the general ideas of this design for your own sites.\n * But please do not steal the stylesheet, the layout or the color scheme.\n */\nbody {\n  font-family: serif;\n  font-size: 11pt;\n  margin: 0 3em;\n  padding: 0;\n  border: none;\n}\na:link, a:visited, a:hover, a:active {\n  text-decoration: none;\n  background: transparent;\n  color: #0000ff;\n}\nh1, h2, h3 {\n  font-family: sans-serif;\n  font-weight: bold;\n  text-align: left;\n  margin: 0.5em 0;\n  padding: 0;\n}\nh1 {\n  font-size: 200%;\n}\nh2 {\n  font-size: 150%;\n}\nh3 {\n  font-size: 125%;\n}\np {\n  margin: 0 0 0.5em 0;\n  padding: 0;\n}\nul, ol {\n  margin: 0.5em 0;\n  padding: 0 0 0 2em;\n}\nul {\n  list-style: outside square;\n}\nol {\n  list-style: outside decimal;\n}\nli {\n  margin: 0;\n  padding: 0;\n}\ndl {\n  margin: 1em 0;\n  padding: 1em;\n  border: 1px solid black;\n}\ndt {\n  font-weight: bold;\n  margin: 0;\n  padding: 0;\n}\ndt sup {\n  float: right;\n  margin-left: 1em;\n}\ndd {\n  margin: 0.5em 0 0 2em;\n  padding: 0;\n}\ntable {\n  table-layout: fixed;\n  width: 100%;\n  margin: 1em 0;\n  padding: 0;\n  border: 1px solid black;\n  border-spacing: 0;\n  border-collapse: collapse;\n}\ntr {\n  margin: 0;\n  padding: 0;\n  border: none;\n}\ntd {\n  text-align: left;\n  margin: 0;\n  padding: 0.2em 0.5em;\n  border-top: 1px solid black;\n  border-bottom: 1px solid black;\n}\ntr.separate td {\n  border-top: double;\n}\ntt, pre, code, kbd, samp {\n  font-family: monospace;\n  font-size: 75%;\n}\nkbd {\n  font-weight: bolder;\n}\nblockquote, pre {\n  margin: 1em 2em;\n  padding: 0;\n}\nimg {\n  border: none;\n  vertical-align: baseline;\n  margin: 0;\n  padding: 0;\n}\nimg.left {\n  float: left;\n  margin: 0.5em 1em 0.5em 0;\n}\nimg.right {\n  float: right;\n  margin: 0.5em 0 0.5em 1em;\n}\n.flush {\n  clear: both;\n  visibility: hidden;\n}\n.hide, .noprint, #nav {\n  display: none !important;\n}\n.pagebreak {\n  page-break-before: always;\n}\n#site {\n  text-align: right;\n  font-family: sans-serif;\n  font-weight: bold;\n  margin: 0 1em;\n  border-bottom: 1pt solid black;\n}\n#site a {\n  font-size: 1.2em;\n}\n#site a:link, #site a:visited {\n  text-decoration: none;\n  font-weight: bold;\n  background: transparent;\n  color: #ffffff;\n}\n#logo {\n  color: #ff8000;\n}\n#head {\n  clear: both;\n  margin: 0 1em;\n}\n#main {\n  line-height: 1.3;\n  text-align: justify;\n  margin: 1em;\n}\n#foot {\n  clear: both;\n  font-size: 80%;\n  text-align: center;\n  margin: 0 1.25em;\n  padding: 0.5em 0 0 0;\n  border-top: 1pt solid black;\n  page-break-before: avoid;\n  page-break-after: avoid;\n}\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/bluequad.css",
    "content": "/* Copyright (C) 2004-2013 Mike Pall.\n *\n * You are welcome to use the general ideas of this design for your own sites.\n * But please do not steal the stylesheet, the layout or the color scheme.\n */\n/* colorscheme:\n *\n * site  |  head   #4162bf/white   | #6078bf/#e6ecff\n * ------+------   ----------------+-------------------\n * nav   |  main   #bfcfff         | #e6ecff/black\n *\n * nav:  hiback   loback     #c5d5ff #b9c9f9\n *       hiborder loborder   #e6ecff #97a7d7\n *       link     hover      #2142bf #ff0000\n *\n * link: link visited hover  #2142bf #8122bf #ff0000\n *\n * main: boxback  boxborder  #f0f4ff #bfcfff\n */\nbody {\n  font-family: Verdana, Arial, Helvetica, sans-serif;\n  font-size: 10pt;\n  margin: 0;\n  padding: 0;\n  border: none;\n  background: #e0e0e0;\n  color: #000000;\n}\na:link {\n  text-decoration: none;\n  background: transparent;\n  color: #2142bf;\n}\na:visited {\n  text-decoration: none;\n  background: transparent;\n  color: #8122bf;\n}\na:hover, a:active {\n  text-decoration: underline;\n  background: transparent;\n  color: #ff0000;\n}\nh1, h2, h3 {\n  font-weight: bold;\n  text-align: left;\n  margin: 0.5em 0;\n  padding: 0;\n  background: transparent;\n}\nh1 {\n  font-size: 200%;\n  line-height: 3em; /* really 6em relative to body, match #site span */\n  margin: 0;\n}\nh2 {\n  font-size: 150%;\n  color: #606060;\n}\nh3 {\n  font-size: 125%;\n  color: #404040;\n}\np {\n  max-width: 600px;\n  margin: 0 0 0.5em 0;\n  padding: 0;\n}\nb {\n  color: #404040;\n}\nul, ol {\n  max-width: 600px;\n  margin: 0.5em 0;\n  padding: 0 0 0 2em;\n}\nul {\n  list-style: outside square;\n}\nol {\n  list-style: outside decimal;\n}\nli {\n  margin: 0;\n  padding: 0;\n}\ndl {\n  max-width: 600px;\n  margin: 1em 0;\n  padding: 1em;\n  border: 1px solid #bfcfff;\n  background: #f0f4ff;\n}\ndt {\n  font-weight: bold;\n  margin: 0;\n  padding: 0;\n}\ndt sup {\n  float: right;\n  margin-left: 1em;\n  color: #808080;\n}\ndt a:visited {\n  text-decoration: none;\n  color: #2142bf;\n}\ndt a:hover, dt a:active {\n  text-decoration: none;\n  color: #ff0000;\n}\ndd {\n  margin: 0.5em 0 0 2em;\n  padding: 0;\n}\ndiv.tablewrap { /* for IE *sigh* */\n  max-width: 600px;\n}\ntable {\n  table-layout: fixed;\n  border-spacing: 0;\n  border-collapse: collapse;\n  max-width: 600px;\n  width: 100%;\n  margin: 1em 0;\n  padding: 0;\n  border: 1px solid #bfcfff;\n}\ntr {\n  margin: 0;\n  padding: 0;\n  border: none;\n}\ntr.odd {\n  background: #f0f4ff;\n}\ntr.separate td {\n  border-top: 1px solid #bfcfff;\n}\ntd {\n  text-align: left;\n  margin: 0;\n  padding: 0.2em 0.5em;\n  border: none;\n}\ntt, code, kbd, samp {\n  font-family: Courier New, Courier, monospace;\n  line-height: 1.2;\n  font-size: 110%;\n}\nkbd {\n  font-weight: bolder;\n}\nblockquote, pre {\n  max-width: 600px;\n  margin: 1em 2em;\n  padding: 0;\n}\npre {\n  line-height: 1.1;\n}\npre.code {\n  line-height: 1.4;\n  margin: 0.5em 0 1em 0.5em;\n  padding: 0.5em 1em;\n  border: 1px solid #bfcfff;\n  background: #f0f4ff;\n}\npre.mark {\n  padding-left: 2em;\n}\nspan.codemark {\n  position:absolute;\n  left: 16em;\n  color: #4040c0;\n}\nspan.mark {\n  color: #4040c0;\n  font-family: Courier New, Courier, monospace;\n  line-height: 1.1;\n}\nimg {\n  border: none;\n  vertical-align: baseline;\n  margin: 0;\n  padding: 0;\n}\nimg.left {\n  float: left;\n  margin: 0.5em 1em 0.5em 0;\n}\nimg.right {\n  float: right;\n  margin: 0.5em 0 0.5em 1em;\n}\n.indent {\n  padding-left: 1em;\n}\n.flush {\n  clear: both;\n  visibility: hidden;\n}\n.hide, .noscreen {\n  display: none !important;\n}\n.ext {\n  color: #ff8000;\n}\n.new {\n  font-size: 6pt;\n  vertical-align: middle;\n  background: #ff8000;\n  color: #ffffff;\n}\n#site {\n  clear: both;\n  float: left;\n  width: 13em;\n  text-align: center;\n  font-weight: bold;\n  margin: 0;\n  padding: 0;\n  background: transparent;\n  color: #ffffff;\n}\n#site a {\n  font-size: 200%;\n}\n#site a:link, #site a:visited {\n  text-decoration: none;\n  font-weight: bold;\n  background: transparent;\n  color: #ffffff;\n}\n#site span {\n  line-height: 3em; /* really 6em relative to body, match h1 */\n}\n#logo {\n  color: #ffb380;\n}\n#head {\n  margin: 0;\n  padding: 0 0 0 2em;\n  border-left: solid 13em #4162bf;\n  border-right: solid 3em #6078bf;\n  background: #6078bf;\n  color: #e6ecff;\n}\n#nav {\n  clear: both;\n  float: left;\n  overflow: hidden;\n  text-align: left;\n  line-height: 1.5;\n  width: 13em;\n  padding-top: 1em;\n  background: transparent;\n}\n#nav ul {\n  list-style: none outside;\n  margin: 0;\n  padding: 0;\n}\n#nav li {\n  margin: 0;\n  padding: 0;\n}\n#nav a {\n  display: block;\n  text-decoration: none;\n  font-weight: bold;\n  margin: 0;\n  padding: 2px 1em;\n  border-top: 1px solid transparent;\n  border-bottom: 1px solid transparent;\n  background: transparent;\n  color: #2142bf;\n}\n#nav a:hover, #nav a:active {\n  text-decoration: none;\n  border-top: 1px solid #97a7d7;\n  border-bottom: 1px solid #e6ecff;\n  background: #b9c9f9;\n  color: #ff0000;\n}\n#nav a.current, #nav a.current:hover, #nav a.current:active {\n  border-top: 1px solid #e6ecff;\n  border-bottom: 1px solid #97a7d7;\n  background: #c5d5ff;\n  color: #2142bf;\n}\n#nav ul ul a {\n  padding: 0 1em 0 1.7em;\n}\n#nav ul ul ul a {\n  padding: 0 0.5em 0 2.4em;\n}\n#main {\n  line-height: 1.5;\n  text-align: left;\n  margin: 0;\n  padding: 1em 2em;\n  border-left: solid 13em #bfcfff;\n  border-right: solid 3em #e6ecff;\n  background: #e6ecff;\n}\n#foot {\n  clear: both;\n  font-size: 80%;\n  text-align: center;\n  margin: 0;\n  padding: 0.5em;\n  background: #6078bf;\n  color: #ffffff;\n}\n#foot a:link, #foot a:visited {\n  text-decoration: underline;\n  background: transparent;\n  color: #ffffff;\n}\n#foot a:hover, #foot a:active {\n  text-decoration: underline;\n  background: transparent;\n  color: #bfcfff;\n}\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/changes.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>LuaJIT Change History</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ndiv.major { max-width: 600px; padding: 1em; margin: 1em 0 1em 0; }\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>LuaJIT Change History</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a class=\"current\" href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nThis is a list of changes between the released versions of LuaJIT.<br>\nThe current <span style=\"color: #0000c0;\">stable version</span> is <strong>LuaJIT&nbsp;2.0.1</strong>.<br>\n</p>\n<p>\nPlease check the\n<a href=\"http://luajit.org/changes.html\"><span class=\"ext\">&raquo;</span>&nbsp;Online Change History</a>\nto see whether newer versions are available.\n</p>\n\n<div class=\"major\" style=\"background: #d0d0ff;\">\n<h2 id=\"LuaJIT-2.0.1\">LuaJIT 2.0.1 &mdash; 2013-02-19</h2>\n<ul>\n<li>Don't clear frame for out-of-memory error.</li>\n<li>Leave hook when resume catches error thrown from hook.</li>\n<li>Add missing GC steps for template table creation.</li>\n<li>Fix discharge order of comparisons in Lua parser.</li>\n<li>Improve buffer handling for <tt>io.read()</tt>.</li>\n<li>OSX: Add support for Mach-O object files to <tt>-b</tt> option.</li>\n<li>Fix PS3 port.</li>\n<li>Fix/enable Xbox 360 port.</li>\n<li>x86/x64: Always mark ref for shift count as non-weak.</li>\n<li>x64: Don't fuse implicitly 32-to-64 extended operands.</li>\n<li>ARM: Fix armhf call argument handling.</li>\n<li>ARM: Fix code generation for integer math.min/math.max.</li>\n<li>PPC/e500: Fix <tt>lj_vm_floor()</tt> for Inf/NaN.</li>\n<li>FFI: Change priority of table initializer variants for structs.</li>\n<li>FFI: Fix code generation for bool call result check on x86/x64.</li>\n<li>FFI: Load FFI library on-demand for bytecode with cdata literals.</li>\n<li>FFI: Fix handling of qualified transparent structs/unions.</li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0\">LuaJIT 2.0.0 &mdash; 2012-11-08</h2>\n<ul>\n<li>Correctness and completeness:\n<ul>\n  <li>Fix Android/x86 build.</li>\n  <li>Fix recording of equality comparisons with <tt>__eq</tt> metamethods.</li>\n  <li>Fix detection of immutable upvalues.</li>\n  <li>Replace error with PANIC for callbacks from JIT-compiled code.</li>\n  <li>Fix builtin string to number conversion for <tt>INT_MIN</tt>.</li>\n  <li>Don't create unneeded array part for template tables.</li>\n  <li>Fix <tt>CONV.num.int</tt> sinking.</li>\n  <li>Don't propagate implicitly widened number to index metamethods.</li>\n  <li>ARM: Fix ordered comparisons of number vs. non-number.</li>\n  <li>FFI: Fix code generation for replay of sunk float fields.</li>\n  <li>FFI: Fix signedness of bool.</li>\n  <li>FFI: Fix recording of bool call result check on x86/x64.</li>\n  <li>FFI: Fix stack-adjustment for <tt>__thiscall</tt> callbacks.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta11\">LuaJIT 2.0.0-beta11 &mdash; 2012-10-16</h2>\n<ul>\n<li>New features:\n<ul>\n  <li>Use ARM VFP instructions, if available (build-time detection).</li>\n  <li>Add support for ARM hard-float EABI (<tt>armhf</tt>).</li>\n  <li>Add PS3 port.</li>\n  <li>Add many features from Lua&nbsp;5.2, e.g. <tt>goto</tt>/labels.\n  Refer to <a href=\"extensions.html#lua52\">this list</a>.</li>\n  <li>FFI: Add parameterized C types.</li>\n  <li>FFI: Add support for copy constructors.</li>\n  <li>FFI: Equality comparisons never raise an error (treat as unequal instead).</li>\n  <li>FFI: Box all accessed or returned enums.</li>\n  <li>FFI: Check for <tt>__new</tt> metamethod when calling a constructor.</li>\n  <li>FFI: Handle <tt>__pairs</tt>/<tt>__ipairs</tt> metamethods for cdata objects.</li>\n  <li>FFI: Convert <tt>io.*</tt> file handle to <tt>FILE *</tt> pointer (but as a <tt>void *</tt>).</li>\n  <li>FFI: Detect and support type punning through unions.</li>\n  <li>FFI: Improve various error messages.</li>\n</ul></li>\n<li>Build-system reorganization:\n<ul>\n  <li>Reorganize directory layout:<br>\n  <tt>lib/*</tt> &rarr; <tt>src/jit/*</tt><br>\n  <tt>src/buildvm_*.dasc</tt> &rarr; <tt>src/vm_*.dasc</tt><br>\n  <tt>src/buildvm_*.h</tt> &rarr; removed<br>\n  <tt>src/buildvm*</tt> &rarr; <tt>src/host/*</tt></li>\n  <li>Add minified Lua interpreter plus Lua BitOp (<tt>minilua</tt>) to run DynASM.</li>\n  <li>Change DynASM bit operations to use Lua BitOp</li>\n  <li>Translate only <tt>vm_*.dasc</tt> for detected target architecture.</li>\n  <li>Improve target detection for <tt>msvcbuild.bat</tt>.</li>\n  <li>Fix build issues on Cygwin and MinGW with optional MSys.</li>\n  <li>Handle cross-compiles with FPU/no-FPU or hard-fp/soft-fp ABI mismatch.</li>\n  <li>Remove some library functions for no-JIT/no-FFI builds.</li>\n  <li>Add uninstall target to top-level Makefile.</li>\n</ul></li>\n<li>Correctness and completeness:\n<ul>\n  <li>Preserve snapshot #0 PC for all traces.</li>\n  <li>Fix argument checks for <tt>coroutine.create()</tt>.</li>\n  <li>Command line prints version and JIT status to <tt>stdout</tt>, not <tt>stderr</tt>.</li>\n  <li>Fix userdata <tt>__gc</tt> separations at Lua state close.</li>\n  <li>Fix <tt>TDUP</tt> to <tt>HLOAD</tt> forwarding for <tt>LJ_DUALNUM</tt> builds.</li>\n  <li>Fix buffer check in bytecode writer.</li>\n  <li>Make <tt>os.date()</tt> thread-safe.</li>\n  <li>Add missing declarations for MSVC intrinsics.</li>\n  <li>Fix dispatch table modifications for return hooks.</li>\n  <li>Workaround for MSVC conversion bug (<tt>double</tt> &rarr; <tt>uint32_t</tt> &rarr; <tt>int32_t</tt>).</li>\n  <li>Fix FOLD rule <tt>(i-j)-i => 0-j</tt>.</li>\n  <li>Never use DWARF unwinder on Windows.</li>\n  <li>Fix shrinking of direct mapped blocks in builtin allocator.</li>\n  <li>Limit recursion depth in <tt>string.match()</tt> et al.</li>\n  <li>Fix late despecialization of <tt>ITERN</tt> after loop has been entered.</li>\n  <li>Fix <tt>'f'</tt> and <tt>'L'</tt> options for <tt>debug.getinfo()</tt> and <tt>lua_getinfo()</tt>.</li>\n  <li>Fix <tt>package.searchpath()</tt>.</li>\n  <li>OSX: Change dylib names to be consistent with other platforms.</li>\n  <li>Android: Workaround for broken <tt>sprintf(\"%g\",&nbsp;-0.0)</tt>.</li>\n  <li>x86: Remove support for ancient CPUs without <tt>CMOV</tt> (before Pentium Pro).</li>\n  <li>x86: Fix register allocation for calls returning register pair.</li>\n  <li>x86/x64: Fix fusion of unsigned byte comparisons with swapped operands.</li>\n  <li>ARM: Fix <tt>tonumber()</tt> argument check.</li>\n  <li>ARM: Fix modulo operator and <tt>math.floor()</tt>/<tt>math.ceil()</tt> for <tt>inf</tt>/<tt>nan</tt>.</li>\n  <li>ARM: Invoke SPLIT pass for leftover <tt>IR_TOBIT</tt>.</li>\n  <li>ARM: Fix BASE register coalescing.</li>\n  <li>PPC: Fix interpreter state setup in callbacks.</li>\n  <li>PPC: Fix <tt>string.sub()</tt> range check.</li>\n  <li>MIPS: Support generation of MIPS/MIPSEL bytecode object files.</li>\n  <li>MIPS: Fix calls to <tt>floor()</tt>/<tt>ceil()</tt><tt>/trunc()</tt>.</li>\n  <li>ARM/PPC: Detect more target architecture variants.</li>\n  <li>ARM/PPC/e500/MIPS: Fix tailcalls from fast functions, esp. <tt>tostring()</tt>.</li>\n  <li>ARM/PPC/MIPS: Fix rematerialization of FP constants.</li>\n  <li>FFI: Don't call <tt>FreeLibrary()</tt> on our own EXE/DLL.</li>\n  <li>FFI: Resolve metamethods for constructors, too.</li>\n  <li>FFI: Properly disable callbacks on iOS (would require executable memory).</li>\n  <li>FFI: Fix cdecl string parsing during recording.</li>\n  <li>FFI: Show address pointed to for <tt>tostring(ref)</tt>, too.</li>\n  <li>FFI: Fix alignment of C call argument/return structure.</li>\n  <li>FFI: Initialize all fields of standard types.</li>\n  <li>FFI: Fix callback handling when new C&nbsp;types are declared in callback.</li>\n  <li>FFI: Fix recording of constructors for pointers.</li>\n  <li>FFI: Always resolve metamethods for pointers to structs.</li>\n  <li>FFI: Correctly propagate alignment when interning nested types.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n  <li>Add allocation sinking and store sinking optimization.</li>\n  <li>Constify immutable upvalues.</li>\n  <li>Add builtin string to integer or FP number conversion. Improves cross-platform consistency and correctness.</li>\n  <li>Create string hash slots in template tables for non-const values, too. Avoids later table resizes.</li>\n  <li>Eliminate <tt>HREFK</tt> guard for template table references.</li>\n  <li>Add various new FOLD rules.</li>\n  <li>Don't use stack unwinding for <tt>lua_yield()</tt> (slow on x64).</li>\n  <li>ARM, PPC, MIPS: Improve <tt>XLOAD</tt> operand fusion and register hinting.</li>\n  <li>PPC, MIPS: Compile <tt>math.sqrt()</tt> to sqrt instruction, if available.</li>\n  <li>FFI: Fold <tt>KPTR</tt> + constant offset in SPLIT pass.</li>\n  <li>FFI: Optimize/inline <tt>ffi.copy()</tt> and <tt>ffi.fill()</tt>.</li>\n  <li>FFI: Compile and optimize array/struct copies.</li>\n  <li>FFI: Compile <tt>ffi.typeof(cdata|ctype)</tt>, <tt>ffi.sizeof()</tt>, <tt>ffi.alignof()</tt>, <tt>ffi.offsetof()</tt> and <tt>ffi.gc()</tt>.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta10\">LuaJIT 2.0.0-beta10 &mdash; 2012-05-09</h2>\n<ul>\n<li>New features:\n<ul>\n<li>The MIPS of LuaJIT is complete. It requires a CPU conforming to the\nMIPS32&nbsp;R1 architecture with hardware FPU. O32 hard-fp ABI,\nlittle-endian or big-endian.</li>\n<li>Auto-detect target arch via cross-compiler. No need for\n<tt>TARGET=arch</tt> anymore.</li>\n<li>Make DynASM compatible with Lua 5.2.</li>\n<li>From Lua 5.2: Try <tt>__tostring</tt> metamethod on non-string error\nmessages..</li>\n</ul></li>\n<li>Correctness and completeness:\n<ul>\n<li>Fix parsing of hex literals with exponents.</li>\n<li>Fix bytecode dump for certain number constants.</li>\n<li>Fix argument type in error message for relative arguments.</li>\n<li>Fix argument error handling on Lua stacks without a frame.</li>\n<li>Add missing mcode limit check in assembler backend.</li>\n<li>Fix compilation on OpenBSD.</li>\n<li>Avoid recursive GC steps after GC-triggered trace exit.</li>\n<li>Replace <tt>&lt;unwind.h&gt;</tt> definitions with our own.</li>\n<li>Fix OSX build issues. Bump minimum required OSX version to 10.4.</li>\n<li>Fix discharge order of comparisons in Lua parser.</li>\n<li>Ensure running <tt>__gc</tt> of userdata created in <tt>__gc</tt>\nat state close.</li>\n<li>Limit number of userdata <tt>__gc</tt> separations at state close.</li>\n<li>Fix bytecode <tt>JMP</tt> slot range when optimizing\n<tt>and</tt>/<tt>or</tt> with constant LHS.</li>\n<li>Fix DSE of <tt>USTORE</tt>.</li>\n<li>Make <tt>lua_concat()</tt> work from C&nbsp;hook with partial frame.</li>\n<li>Add required PHIs for implicit conversions, e.g. via <tt>XREF</tt>\nforwarding.</li>\n<li>Add more comparison variants to Valgrind suppressions file.</li>\n<li>Disable loading bytecode with an extra header (BOM or <tt>#!</tt>).</li>\n<li>Fix PHI stack slot syncing.</li>\n<li>ARM: Reorder type/value tests to silence Valgrind.</li>\n<li>ARM: Fix register allocation for <tt>ldrd</tt>-optimized\n<tt>HREFK</tt>.</li>\n<li>ARM: Fix conditional branch fixup for <tt>OBAR</tt>.</li>\n<li>ARM: Invoke SPLIT pass for <tt>double</tt> args in FFI call.</li>\n<li>ARM: Handle all <tt>CALL*</tt> ops with <tt>double</tt> results in\nSPLIT pass.</li>\n<li>ARM: Fix rejoin of <tt>POW</tt> in SPLIT pass.</li>\n<li>ARM: Fix compilation of <tt>math.sinh</tt>, <tt>math.cosh</tt>,\n<tt>math.tanh</tt>.</li>\n<li>ARM, PPC: Avoid pointless arg clearing in <tt>BC_IFUNCF</tt>.</li>\n<li>PPC: Fix resume after yield from hook.</li>\n<li>PPC: Fix argument checking for <tt>rawget()</tt>.</li>\n<li>PPC: Fix fusion of floating-point <tt>XLOAD</tt>/<tt>XSTORE</tt>.</li>\n<li>PPC: Fix <tt>HREFK</tt> code generation for huge tables.</li>\n<li>PPC: Use builtin D-Cache/I-Cache sync code.</li>\n</ul></li>\n<li>FFI library:\n<ul>\n<li>Ignore empty statements in <tt>ffi.cdef()</tt>.</li>\n<li>Ignore number parsing errors while skipping definitions.</li>\n<li>Don't touch frame in callbacks with tailcalls to fast functions.</li>\n<li>Fix library unloading on POSIX systems.</li>\n<li>Finalize cdata before userdata when closing the state.</li>\n<li>Change <tt>ffi.load()</tt> library name resolution for Cygwin.</li>\n<li>Fix resolving of function name redirects on Windows/x86.</li>\n<li>Fix symbol resolving error messages on Windows.</li>\n<li>Fix blacklisting of C functions calling callbacks.</li>\n<li>Fix result type of pointer difference.</li>\n<li>Use correct PC in FFI metamethod error message.</li>\n<li>Allow <tt>'typedef _Bool int BOOL;'</tt> for the Windows API.</li>\n<li>Don't record test for bool result of call, if ignored.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta9\">LuaJIT 2.0.0-beta9 &mdash; 2011-12-14</h2>\n<ul>\n<li>New features:\n<ul>\n<li>PPC port of LuaJIT is complete. Default is the dual-number port\n(usually faster). Single-number port selectable via <tt>src/Makefile</tt>\nat build time.</li>\n<li>Add FFI callback support.</li>\n<li>Extend <tt>-b</tt> to generate <tt>.c</tt>, <tt>.h</tt> or <tt>.obj/.o</tt>\nfiles with embedded bytecode.</li>\n<li>Allow loading embedded bytecode with <tt>require()</tt>.</li>\n<li>From Lua 5.2: Change to <tt>'\\z'</tt> escape. Reject undefined escape\nsequences.</li>\n</ul></li>\n<li>Correctness and completeness:\n<ul>\n<li>Fix OSX 10.7 build. Fix <tt>install_name</tt> and versioning on OSX.</li>\n<li>Fix iOS build.</li>\n<li>Install <tt>dis_arm.lua</tt>, too.</li>\n<li>Mark installed shared library as executable.</li>\n<li>Add debug option to <tt>msvcbuild.bat</tt> and improve error handling.</li>\n<li>Fix data-flow analysis for iterators.</li>\n<li>Fix forced unwinding triggered by external unwinder.</li>\n<li>Record missing <tt>for</tt> loop slot loads (return to lower frame).</li>\n<li>Always use ANSI variants of Windows system functions.</li>\n<li>Fix GC barrier for multi-result table constructor (<tt>TSETM</tt>).</li>\n<li>Fix/add various FOLD rules.</li>\n<li>Add potential PHI for number conversions due to type instability.</li>\n<li>Do not eliminate PHIs only referenced from other PHIs.</li>\n<li>Correctly anchor implicit number to string conversions in Lua/C API.</li>\n<li>Fix various stack limit checks.</li>\n<li>x64: Use thread-safe exceptions for external unwinding (GCC platforms).</li>\n<li>x64: Fix result type of cdata index conversions.</li>\n<li>x64: Fix <tt>math.random()</tt> and <tt>bit.bswap()</tt> code generation.</li>\n<li>x64: Fix <tt>lightuserdata</tt> comparisons.</li>\n<li>x64: Always extend stack-passed arguments to pointer size.</li>\n<li>ARM: Many fixes to code generation backend.</li>\n<li>PPC/e500: Fix dispatch for binop metamethods.</li>\n<li>PPC/e500: Save/restore condition registers when entering/leaving the VM.</li>\n<li>PPC/e500: Fix write barrier in stores of strings to upvalues.</li>\n</ul></li>\n<li>FFI library:\n<ul>\n<li>Fix C comment parsing.</li>\n<li>Fix snapshot optimization for cdata comparisons.</li>\n<li>Fix recording of const/enum lookups in namespaces.</li>\n<li>Fix call argument and return handling for <tt>I8/U8/I16/U16</tt> types.</li>\n<li>Fix unfused loads of float fields.</li>\n<li>Fix <tt>ffi.string()</tt> recording.</li>\n<li>Save <tt>GetLastError()</tt> around <tt>ffi.load()</tt> and symbol\nresolving, too.</li>\n<li>Improve ld script detection in <tt>ffi.load()</tt>.</li>\n<li>Record loads/stores to external variables in namespaces.</li>\n<li>Compile calls to stdcall, fastcall and vararg functions.</li>\n<li>Treat function ctypes like pointers in comparisons.</li>\n<li>Resolve <tt>__call</tt> metamethod for pointers, too.</li>\n<li>Record C function calls with bool return values.</li>\n<li>Record <tt>ffi.errno()</tt>.</li>\n<li>x86: Fix number to <tt>uint32_t</tt> conversion rounding.</li>\n<li>x86: Fix 64 bit arithmetic in assembler backend.</li>\n<li>x64: Fix struct-by-value calling conventions.</li>\n<li>ARM: Ensure invocation of SPLIT pass for float conversions.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n<li>Display trace types with <tt>-jv</tt> and <tt>-jdump</tt>.</li>\n<li>Record isolated calls. But prefer recording loops over calls.</li>\n<li>Specialize to prototype for non-monomorphic functions. Solves the\ntrace-explosion problem for closure-heavy programming styles.</li>\n<li>Always generate a portable <tt>vmdef.lua</tt>. Easier for distros.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta8\">LuaJIT 2.0.0-beta8 &mdash; 2011-06-23</h2>\n<ul>\n<li>New features:\n<ul>\n<li>Soft-float ARM port of LuaJIT is complete.</li>\n<li>Add support for bytecode loading/saving and <tt>-b</tt> command line\noption.</li>\n<li>From Lua 5.2: <tt>__len</tt> metamethod for tables\n(disabled by default).</li>\n</ul></li>\n<li>Correctness and completeness:\n<ul>\n<li>ARM: Misc. fixes for interpreter.</li>\n<li>x86/x64: Fix <tt>bit.*</tt> argument checking in interpreter.</li>\n<li>Catch early out-of-memory in memory allocator initialization.</li>\n<li>Fix data-flow analysis for paths leading to an upvalue close.</li>\n<li>Fix check for missing arguments in <tt>string.format()</tt>.</li>\n<li>Fix Solaris/x86 build (note: not a supported target).</li>\n<li>Fix recording of loops with instable directions in side traces.</li>\n<li>x86/x64: Fix fusion of comparisons with <tt>u8</tt>/<tt>u16</tt>\n<tt>XLOAD</tt>.</li>\n<li>x86/x64: Fix register allocation for variable shifts.</li>\n</ul></li>\n<li>FFI library:\n<ul>\n<li>Add <tt>ffi.errno()</tt>. Save <tt>errno</tt>/<tt>GetLastError()</tt>\naround allocations etc.</li>\n<li>Fix <tt>__gc</tt> for VLA/VLS cdata objects.</li>\n<li>Fix recording of casts from 32 bit cdata pointers to integers.</li>\n<li><tt>tonumber(cdata)</tt> returns <tt>nil</tt> for non-numbers.</li>\n<li>Show address pointed to for <tt>tostring(pointer)</tt>.</li>\n<li>Print <tt>NULL</tt> pointers as <tt>\"cdata&lt;... *&gt;: NULL\"</tt>.</li>\n<li>Support <tt>__tostring</tt> metamethod for pointers to structs, too.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n<li>More tuning for loop unrolling heuristics.</li>\n<li>Flatten and compress in-memory debug info (saves ~70%).</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta7\">LuaJIT 2.0.0-beta7 &mdash; 2011-05-05</h2>\n<ul>\n<li>New features:\n<ul>\n<li>ARM port of the LuaJIT interpreter is complete.</li>\n<li>FFI library: Add <tt>ffi.gc()</tt>, <tt>ffi.metatype()</tt>,\n<tt>ffi.istype()</tt>.</li>\n<li>FFI library: Resolve ld script redirection in <tt>ffi.load()</tt>.</li>\n<li>From Lua 5.2: <tt>package.searchpath()</tt>, <tt>fp:read(\"*L\")</tt>,\n<tt>load(string)</tt>.</li>\n<li>From Lua 5.2, disabled by default: empty statement,\n<tt>table.unpack()</tt>, modified <tt>coroutine.running()</tt>.</li>\n</ul></li>\n<li>Correctness and completeness:\n<ul>\n<li>FFI library: numerous fixes.</li>\n<li>Fix type mismatches in store-to-load forwarding.</li>\n<li>Fix error handling within metamethods.</li>\n<li>Fix <tt>table.maxn()</tt>.</li>\n<li>Improve accuracy of <tt>x^-k</tt> on x64.</li>\n<li>Fix code generation for Intel Atom in x64 mode.</li>\n<li>Fix narrowing of POW.</li>\n<li>Fix recording of retried fast functions.</li>\n<li>Fix code generation for <tt>bit.bnot()</tt> and multiplies.</li>\n<li>Fix error location within cpcall frames.</li>\n<li>Add workaround for old libgcc unwind bug.</li>\n<li>Fix <tt>lua_yield()</tt> and <tt>getmetatable(lightuserdata)</tt> on x64.</li>\n<li>Misc. fixes for PPC/e500 interpreter.</li>\n<li>Fix stack slot updates for down-recursion.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n<li>Add dual-number mode (int/double) for the VM. Enabled for ARM.</li>\n<li>Improve narrowing of arithmetic operators and <tt>for</tt> loops.</li>\n<li>Tune loop unrolling heuristics and increase trace recorder limits.</li>\n<li>Eliminate dead slots in snapshots using bytecode data-flow analysis.</li>\n<li>Avoid phantom stores to proxy tables.</li>\n<li>Optimize lookups in empty proxy tables.</li>\n<li>Improve bytecode optimization of <tt>and</tt>/<tt>or</tt> operators.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta6\">LuaJIT 2.0.0-beta6 &mdash; 2011-02-11</h2>\n<ul>\n<li>New features:\n<ul>\n<li>PowerPC/e500v2 port of the LuaJIT interpreter is complete.</li>\n<li>Various minor features from Lua 5.2: Hex escapes in literals,\n<tt>'\\*'</tt> escape, reversible <tt>string.format(\"%q\",s)</tt>,\n<tt>\"%g\"</tt> pattern, <tt>table.sort</tt> checks callbacks,\n<tt>os.exit(status|true|false[,close])</tt>.</li>\n<li>Lua 5.2 <tt>__pairs</tt> and <tt>__ipairs</tt> metamethods\n(disabled by default).</li>\n<li>Initial release of the FFI library.</li>\n</ul></li>\n<li>Correctness and completeness:\n<ul>\n<li>Fix <tt>string.format()</tt> for non-finite numbers.</li>\n<li>Fix memory leak when compiled to use the built-in allocator.</li>\n<li>x86/x64: Fix unnecessary resize in <tt>TSETM</tt> bytecode.</li>\n<li>Fix various GC issues with traces and <tt>jit.flush()</tt>.</li>\n<li>x64: Fix fusion of indexes for array references.</li>\n<li>x86/x64: Fix stack overflow handling for coroutine results.</li>\n<li>Enable low-2GB memory allocation on FreeBSD/x64.</li>\n<li>Fix <tt>collectgarbage(\"count\")</tt> result if more than 2GB is in use.</li>\n<li>Fix parsing of hex floats.</li>\n<li>x86/x64: Fix loop branch inversion with trailing\n<tt>HREF+NE/EQ</tt>.</li>\n<li>Add <tt>jit.os</tt> string.</li>\n<li><tt>coroutine.create()</tt> permits running C functions, too.</li>\n<li>Fix OSX build to work with newer ld64 versions.</li>\n<li>Fix bytecode optimization of <tt>and</tt>/<tt>or</tt> operators.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n<li>Emit specialized bytecode for <tt>pairs()</tt>/<tt>next()</tt>.</li>\n<li>Improve bytecode coalescing of <tt>nil</tt> constants.</li>\n<li>Compile calls to vararg functions.</li>\n<li>Compile <tt>select()</tt>.</li>\n<li>Improve alias analysis, esp. for loads from allocations.</li>\n<li>Tuning of various compiler heuristics.</li>\n<li>Refactor and extend IR conversion instructions.</li>\n<li>x86/x64: Various backend enhancements related to the FFI.</li>\n<li>Add SPLIT pass to split 64 bit IR instructions for 32 bit CPUs.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta5\">LuaJIT 2.0.0-beta5 &mdash; 2010-08-24</h2>\n<ul>\n<li>Correctness and completeness:\n<ul>\n<li>Fix trace exit dispatch to function headers.</li>\n<li>Fix Windows and OSX builds with LUAJIT_DISABLE_JIT.</li>\n<li>Reorganize and fix placement of generated machine code on x64.</li>\n<li>Fix TNEW in x64 interpreter.</li>\n<li>Do not eliminate PHIs for values only referenced from side exits.</li>\n<li>OS-independent canonicalization of strings for non-finite numbers.</li>\n<li>Fix <tt>string.char()</tt> range check on x64.</li>\n<li>Fix <tt>tostring()</tt> resolving within <tt>print()</tt>.</li>\n<li>Fix error handling for <tt>next()</tt>.</li>\n<li>Fix passing of constant arguments to external calls on x64.</li>\n<li>Fix interpreter argument check for two-argument SSE math functions.</li>\n<li>Fix C frame chain corruption caused by <tt>lua_cpcall()</tt>.</li>\n<li>Fix return from <tt>pcall()</tt> within active hook.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n<li>Replace on-trace GC frame syncing with interpreter exit.</li>\n<li>Improve hash lookup specialization by not removing dead keys during GC.</li>\n<li>Turn traces into true GC objects.</li>\n<li>Avoid starting a GC cycle immediately after library init.</li>\n<li>Add weak guards to improve dead-code elimination.</li>\n<li>Speed up string interning.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta4\">LuaJIT 2.0.0-beta4 &mdash; 2010-03-28</h2>\n<ul>\n<li>Correctness and completeness:\n<ul>\n<li>Fix precondition for on-trace creation of table keys.</li>\n<li>Fix <tt>{f()}</tt> on x64 when table is resized.</li>\n<li>Fix folding of ordered comparisons with same references.</li>\n<li>Fix snapshot restores for multi-result bytecodes.</li>\n<li>Fix potential hang when recording bytecode with nested closures.</li>\n<li>Fix recording of <tt>getmetatable()</tt>, <tt>tonumber()</tt> and bad argument types.</li>\n<li>Fix SLOAD fusion across returns to lower frames.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n<li>Add array bounds check elimination. <tt>-Oabc</tt> is enabled by default.</li>\n<li>More tuning for x64, e.g. smaller table objects.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta3\">LuaJIT 2.0.0-beta3 &mdash; 2010-03-07</h2>\n<ul>\n<li>LuaJIT x64 port:\n<ul>\n<li>Port integrated memory allocator to Linux/x64, Windows/x64 and OSX/x64.</li>\n<li>Port interpreter and JIT compiler to x64.</li>\n<li>Port DynASM to x64.</li>\n<li>Many 32/64 bit cleanups in the VM.</li>\n<li>Allow building the interpreter with either x87 or SSE2 arithmetics.</li>\n<li>Add external unwinding and C++ exception interop (default on x64).</li>\n</ul></li>\n<li>Correctness and completeness:\n<ul>\n<li>Fix constructor bytecode generation for certain conditional values.</li>\n<li>Fix some cases of ordered string comparisons.</li>\n<li>Fix <tt>lua_tocfunction()</tt>.</li>\n<li>Fix cutoff register in JMP bytecode for some conditional expressions.</li>\n<li>Fix PHI marking algorithm for references from variant slots.</li>\n<li>Fix <tt>package.cpath</tt> for non-default PREFIX.</li>\n<li>Fix DWARF2 frame unwind information for interpreter on OSX.</li>\n<li>Drive the GC forward on string allocations in the parser.</li>\n<li>Implement call/return hooks (zero-cost if disabled).</li>\n<li>Implement yield from C hooks.</li>\n<li>Disable JIT compiler on older non-SSE2 CPUs instead of aborting.</li>\n</ul></li>\n<li>Structural and performance enhancements:\n<ul>\n<li>Compile recursive code (tail-, up- and down-recursion).</li>\n<li>Improve heuristics for bytecode penalties and blacklisting.</li>\n<li>Split CALL/FUNC recording and clean up fast function call semantics.</li>\n<li>Major redesign of internal function call handling.</li>\n<li>Improve FOR loop const specialization and integerness checks.</li>\n<li>Switch to pre-initialized stacks. Avoid frame-clearing.</li>\n<li>Colocation of prototypes and related data: bytecode, constants, debug info.</li>\n<li>Cleanup parser and streamline bytecode generation.</li>\n<li>Add support for weak IR references to register allocator.</li>\n<li>Switch to compressed, extensible snapshots.</li>\n<li>Compile returns to frames below the start frame.</li>\n<li>Improve alias analysis of upvalues using a disambiguation hash value.</li>\n<li>Compile floor/ceil/trunc to SSE2 helper calls or SSE4.1 instructions.</li>\n<li>Add generic C call handling to IR and backend.</li>\n<li>Improve KNUM fuse vs. load heuristics.</li>\n<li>Compile various <tt>io.*()</tt> functions.</li>\n<li>Compile <tt>math.sinh()</tt>, <tt>math.cosh()</tt>, <tt>math.tanh()</tt>\nand <tt>math.random()</tt>.</li>\n</ul></li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta2\">LuaJIT 2.0.0-beta2 &mdash; 2009-11-09</h2>\n<ul>\n<li>Reorganize build system. Build static+shared library on POSIX.</li>\n<li>Allow C++ exception conversion on all platforms\nusing a wrapper function.</li>\n<li>Automatically catch C++ exceptions and rethrow Lua error\n(DWARF2 only).</li>\n<li>Check for the correct x87 FPU precision at strategic points.</li>\n<li>Always use wrappers for libm functions.</li>\n<li>Resurrect metamethod name strings before copying them.</li>\n<li>Mark current trace, even if compiler is idle.</li>\n<li>Ensure FILE metatable is created only once.</li>\n<li>Fix type comparisons when different integer types are involved.</li>\n<li>Fix <tt>getmetatable()</tt> recording.</li>\n<li>Fix TDUP with dead keys in template table.</li>\n<li><tt>jit.flush(tr)</tt> returns status.\nPrevent manual flush of a trace that's still linked.</li>\n<li>Improve register allocation heuristics for invariant references.</li>\n<li>Compile the push/pop variants of <tt>table.insert()</tt> and\n<tt>table.remove()</tt>.</li>\n<li>Compatibility with MSVC <tt>link&nbsp/debug</tt>.</li>\n<li>Fix <tt>lua_iscfunction()</tt>.</li>\n<li>Fix <tt>math.random()</tt> when compiled with <tt>-fpic</tt> (OSX).</li>\n<li>Fix <tt>table.maxn()</tt>.</li>\n<li>Bump <tt>MACOSX_DEPLOYMENT_TARGET</tt> to <tt>10.4</tt></li>\n<li><tt>luaL_check*()</tt> and <tt>luaL_opt*()</tt> now support\nnegative arguments, too.<br>\nThis matches the behavior of Lua 5.1, but not the specification.</li>\n</ul>\n\n<h2 id=\"LuaJIT-2.0.0-beta1\">LuaJIT 2.0.0-beta1 &mdash; 2009-10-31</h2>\n<ul>\n<li>This is the first public release of LuaJIT 2.0.</li>\n<li>The whole VM has been rewritten from the ground up, so there's\nno point in listing differences over earlier versions.</li>\n</ul>\n</div>\n\n<div class=\"major\" style=\"background: #ffff80;\">\n<h2 id=\"LuaJIT-1.1.8\">LuaJIT 1.1.8 &mdash; 2012-04-16</h2>\n<ul>\n<li>Merged with Lua 5.1.5. Also integrated fixes for all\n<a href=\"http://www.lua.org/bugs.html#5.1.5\"><span class=\"ext\">&raquo;</span>&nbsp;<span class=\"ext\">&raquo;</span>&nbsp;currently known bugs in Lua 5.1.5</a>.</li>\n</ul>\n\n<h2 id=\"LuaJIT-1.1.7\">LuaJIT 1.1.7 &mdash; 2011-05-05</h2>\n<ul>\n<li>Added fixes for the\n<a href=\"http://www.lua.org/bugs.html#5.1.4\"><span class=\"ext\">&raquo;</span>&nbsp;currently known bugs in Lua 5.1.4</a>.</li>\n</ul>\n\n<h2 id=\"LuaJIT-1.1.6\">LuaJIT 1.1.6 &mdash; 2010-03-28</h2>\n<ul>\n<li>Added fixes for the\n<a href=\"http://www.lua.org/bugs.html#5.1.4\"><span class=\"ext\">&raquo;</span>&nbsp;currently known bugs in Lua 5.1.4</a>.</li>\n<li>Removed wrong GC check in <tt>jit_createstate()</tt>.\nThanks to Tim Mensch.</li>\n<li>Fixed bad assertions while compiling <tt>table.insert()</tt> and\n<tt>table.remove()</tt>.</li>\n</ul>\n\n<h2 id=\"LuaJIT-1.1.5\">LuaJIT 1.1.5 &mdash; 2008-10-25</h2>\n<ul>\n<li>Merged with Lua 5.1.4. Fixes all\n<a href=\"http://www.lua.org/bugs.html#5.1.3\"><span class=\"ext\">&raquo;</span>&nbsp;known bugs in Lua 5.1.3</a>.</li>\n</ul>\n\n<h2 id=\"LuaJIT-1.1.4\">LuaJIT 1.1.4 &mdash; 2008-02-05</h2>\n<ul>\n<li>Merged with Lua 5.1.3. Fixes all\n<a href=\"http://www.lua.org/bugs.html#5.1.2\"><span class=\"ext\">&raquo;</span>&nbsp;known bugs in Lua 5.1.2</a>.</li>\n<li>Fixed possible (but unlikely) stack corruption while compiling\n<tt>k^x</tt> expressions.</li>\n<li>Fixed DynASM template for cmpss instruction.</li>\n</ul>\n\n<h2 id=\"LuaJIT-1.1.3\">LuaJIT 1.1.3 &mdash; 2007-05-24</h2>\n<ul>\n<li>Merged with Lua 5.1.2. Fixes all\n<a href=\"http://www.lua.org/bugs.html#5.1.1\"><span class=\"ext\">&raquo;</span>&nbsp;known bugs in Lua 5.1.1</a>.</li>\n<li>Merged pending Lua 5.1.x fixes: \"return -nil\" bug, spurious count hook call.</li>\n<li>Remove a (sometimes) wrong assertion in <tt>luaJIT_findpc()</tt>.</li>\n<li>DynASM now allows labels for displacements and <tt>.aword</tt>.</li>\n<li>Fix some compiler warnings for DynASM glue (internal API change).</li>\n<li>Correct naming for SSSE3 (temporarily known as SSE4) in DynASM and x86 disassembler.</li>\n<li>The loadable debug modules now handle redirection to stdout\n(e.g. <tt>-j&nbsp;trace=-</tt>).</li>\n</ul>\n\n<h2 id=\"LuaJIT-1.1.2\">LuaJIT 1.1.2 &mdash; 2006-06-24</h2>\n<ul>\n<li>Fix MSVC inline assembly: use only local variables with\n<tt>lua_number2int()</tt>.</li>\n<li>Fix \"attempt to call a thread value\" bug on Mac OS X:\nmake values of consts used as lightuserdata keys unique\nto avoid joining by the compiler/linker.</li>\n</ul>\n\n<h2 id=\"LuaJIT-1.1.1\">LuaJIT 1.1.1 &mdash; 2006-06-20</h2>\n<ul>\n<li>Merged with Lua 5.1.1. Fixes all\n<a href=\"http://www.lua.org/bugs.html#5.1\"><span class=\"ext\">&raquo;</span>&nbsp;known bugs in Lua 5.1</a>.</li>\n<li>Enforce (dynamic) linker error for EXE/DLL version mismatches.</li>\n<li>Minor changes to DynASM: faster pre-processing, smaller encoding\nfor some immediates.</li>\n</ul>\n<p>\nThis release is in sync with Coco 1.1.1 (see the\n<a href=\"http://coco.luajit.org/changes.html\"><span class=\"ext\">&raquo;</span>&nbsp;Coco Change History</a>).\n</p>\n\n<h2 id=\"LuaJIT-1.1.0\">LuaJIT 1.1.0 &mdash; 2006-03-13</h2>\n<ul>\n<li>Merged with Lua 5.1 (final).</li>\n\n<li>New JIT call frame setup:\n<ul>\n<li>The C stack is kept 16 byte aligned (faster).\nMandatory for Mac OS X on Intel, too.</li>\n<li>Faster calling conventions for internal C helper functions.</li>\n<li>Better instruction scheduling for function prologue, OP_CALL and\nOP_RETURN.</li>\n</ul></li>\n\n<li>Miscellaneous optimizations:\n<ul>\n<li>Faster loads of FP constants. Remove narrow-to-wide store-to-load\nforwarding stalls.</li>\n<li>Use (scalar) SSE2 ops (if the CPU supports it) to speed up slot moves\nand FP to integer conversions.</li>\n<li>Optimized the two-argument form of <tt>OP_CONCAT</tt> (<tt>a..b</tt>).</li>\n<li>Inlined <tt>OP_MOD</tt> (<tt>a%b</tt>).\nWith better accuracy than the C variant, too.</li>\n<li>Inlined <tt>OP_POW</tt> (<tt>a^b</tt>). Unroll <tt>x^k</tt> or\nuse <tt>k^x = 2^(log2(k)*x)</tt> or call <tt>pow()</tt>.</li>\n</ul></li>\n\n<li>Changes in the optimizer:\n<ul>\n<li>Improved hinting for table keys derived from table values\n(<tt>t1[t2[x]]</tt>).</li>\n<li>Lookup hinting now works with arbitrary object types and\nsupports index chains, too.</li>\n<li>Generate type hints for arithmetic and comparison operators,\nOP_LEN, OP_CONCAT and OP_FORPREP.</li>\n<li>Remove several hint definitions in favour of a generic COMBINE hint.</li>\n<li>Complete rewrite of <tt>jit.opt_inline</tt> module\n(ex <tt>jit.opt_lib</tt>).</li>\n</ul></li>\n\n<li>Use adaptive deoptimization:\n<ul>\n<li>If runtime verification of a contract fails, the affected\ninstruction is recompiled and patched on-the-fly.\nRegular programs will trigger deoptimization only occasionally.</li>\n<li>This avoids generating code for uncommon fallback cases\nmost of the time. Generated code is up to 30% smaller compared to\nLuaJIT&nbsp;1.0.3.</li>\n<li>Deoptimization is used for many opcodes and contracts:\n<ul>\n<li>OP_CALL, OP_TAILCALL: type mismatch for callable.</li>\n<li>Inlined calls: closure mismatch, parameter number and type mismatches.</li>\n<li>OP_GETTABLE, OP_SETTABLE: table or key type and range mismatches.</li>\n<li>All arithmetic and comparison operators, OP_LEN, OP_CONCAT,\nOP_FORPREP: operand type and range mismatches.</li>\n</ul></li>\n<li>Complete redesign of the debug and traceback info\n(bytecode &harr; mcode) to support deoptimization.\nMuch more flexible and needs only 50% of the space.</li>\n<li>The modules <tt>jit.trace</tt>, <tt>jit.dumphints</tt> and\n<tt>jit.dump</tt> handle deoptimization.</li>\n</ul></li>\n\n<li>Inlined many popular library functions\n(for commonly used arguments only):\n<ul>\n<li>Most <tt>math.*</tt> functions (the 18 most used ones)\n[2x-10x faster].</li>\n<li><tt>string.len</tt>, <tt>string.sub</tt> and <tt>string.char</tt>\n[2x-10x faster].</li>\n<li><tt>table.insert</tt>, <tt>table.remove</tt> and <tt>table.getn</tt>\n[3x-5x faster].</li>\n<li><tt>coroutine.yield</tt> and <tt>coroutine.resume</tt>\n[3x-5x faster].</li>\n<li><tt>pairs</tt>, <tt>ipairs</tt> and the corresponding iterators\n[8x-15x faster].</li>\n</ul></li>\n\n<li>Changes in the core and loadable modules and the stand-alone executable:\n<ul>\n<li>Added <tt>jit.version</tt>, <tt>jit.version_num</tt>\nand <tt>jit.arch</tt>.</li>\n<li>Reorganized some internal API functions (<tt>jit.util.*mcode*</tt>).</li>\n<li>The <tt>-j dump</tt> output now shows JSUB names, too.</li>\n<li>New x86 disassembler module written in pure Lua. No dependency\non ndisasm anymore. Flexible API, very compact (500 lines)\nand complete (x87, MMX, SSE, SSE2, SSE3, SSSE3, privileged instructions).</li>\n<li><tt>luajit -v</tt> prints the LuaJIT version and copyright\non a separate line.</li>\n</ul></li>\n\n<li>Added SSE, SSE2, SSE3 and SSSE3 support to DynASM.</li>\n<li>Miscellaneous doc changes. Added a section about\n<a href=\"install.html#embedding\">embedding LuaJIT</a>.</li>\n</ul>\n<p>\nThis release is in sync with Coco 1.1.0 (see the\n<a href=\"http://coco.luajit.org/changes.html\"><span class=\"ext\">&raquo;</span>&nbsp;Coco Change History</a>).\n</p>\n</div>\n\n<div class=\"major\" style=\"background: #ffffd0;\">\n<h2 id=\"LuaJIT-1.0.3\">LuaJIT 1.0.3 &mdash; 2005-09-08</h2>\n<ul>\n<li>Even more docs.</li>\n<li>Unified closure checks in <tt>jit.*</tt>.</li>\n<li>Fixed some range checks in <tt>jit.util.*</tt>.</li>\n<li>Fixed __newindex call originating from <tt>jit_settable_str()</tt>.</li>\n<li>Merged with Lua 5.1 alpha (including early bug fixes).</li>\n</ul>\n<p>\nThis is the first public release of LuaJIT.\n</p>\n\n<h2 id=\"LuaJIT-1.0.2\">LuaJIT 1.0.2 &mdash; 2005-09-02</h2>\n<ul>\n<li>Add support for flushing the Valgrind translation cache <br>\n(<tt>MYCFLAGS= -DUSE_VALGRIND</tt>).</li>\n<li>Add support for freeing executable mcode memory to the <tt>mmap()</tt>-based\nvariant for POSIX systems.</li>\n<li>Reorganized the C&nbsp;function signature handling in\n<tt>jit.opt_lib</tt>.</li>\n<li>Changed to index-based hints for inlining C&nbsp;functions.\nStill no support in the backend for inlining.</li>\n<li>Hardcode <tt>HEAP_CREATE_ENABLE_EXECUTE</tt> value if undefined.</li>\n<li>Misc. changes to the <tt>jit.*</tt> modules.</li>\n<li>Misc. changes to the Makefiles.</li>\n<li>Lots of new docs.</li>\n<li>Complete doc reorg.</li>\n</ul>\n<p>\nNot released because Lua 5.1 alpha came out today.\n</p>\n\n<h2 id=\"LuaJIT-1.0.1\">LuaJIT 1.0.1 &mdash; 2005-08-31</h2>\n<ul>\n<li>Missing GC step in <tt>OP_CONCAT</tt>.</li>\n<li>Fix result handling for C &ndash;> JIT calls.</li>\n<li>Detect CPU feature bits.</li>\n<li>Encode conditional moves (<tt>fucomip</tt>) only when supported.</li>\n<li>Add fallback instructions for FP compares.</li>\n<li>Add support for <tt>LUA_COMPAT_VARARG</tt>. Still disabled by default.</li>\n<li>MSVC needs a specific place for the <tt>CALLBACK</tt> attribute\n(David Burgess).</li>\n<li>Misc. doc updates.</li>\n</ul>\n<p>\nInterim non-public release.\nSpecial thanks to Adam D. Moss for reporting most of the bugs.\n</p>\n\n<h2 id=\"LuaJIT-1.0.0\">LuaJIT 1.0.0 &mdash; 2005-08-29</h2>\n<p>\nThis is the initial non-public release of LuaJIT.\n</p>\n</div>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/contact.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>Contact</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>Contact</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nPlease send general questions to the\n<a href=\"http://luajit.org/list.html\"><span class=\"ext\">&raquo;</span>&nbsp;LuaJIT mailing list</a>.\nYou can also send any questions you have directly to me:\n</p>\n\n<script type=\"text/javascript\">\n<!--\nvar xS=\"@-:\\\" .0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ<abc>defghijklmnopqrstuvwxyz\";function xD(s)\n{var len=s.length;var r=\"\";for(var i=0;i<len;i++)\n{var c=s.charAt(i);var n=xS.indexOf(c);if(n!=-1)c=xS.charAt(69-n);r+=c;}\ndocument.write(\"<\"+\"p>\"+r+\"<\"+\"/p>\\n\");}\n//-->\n</script>\n<script type=\"text/javascript\">\n<!--\nxD(\"fyZKB8xv\\\"FJytmz8.KAB0u52D\")\n//--></script>\n<noscript>\n<p><img src=\"img/contact.png\" alt=\"Contact info in image\" width=\"170\" height=\"13\">\n</p>\n</noscript>\n\n<h2>Copyright</h2>\n<p>\nAll documentation is\nCopyright &copy; 2005-2013 Mike Pall.\n</p>\n\n\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/ext_c_api.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>Lua/C API Extensions</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>Lua/C API Extensions</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a class=\"current\" href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nLuaJIT adds some extensions to the standard Lua/C API. The LuaJIT include\ndirectory must be in the compiler search path (<tt>-I<i>path</i></tt>)\nto be able to include the required header for C code:\n</p>\n<pre class=\"code\">\n#include \"luajit.h\"\n</pre>\n<p>\nOr for C++ code:\n</p>\n<pre class=\"code\">\n#include \"lua.hpp\"\n</pre>\n\n<h2 id=\"luaJIT_setmode\"><tt>luaJIT_setmode(L, idx, mode)</tt>\n&mdash; Control VM</h2>\n<p>\nThis is a C API extension to allow control of the VM from C code. The\nfull prototype of <tt>LuaJIT_setmode</tt> is:\n</p>\n<pre class=\"code\">\nLUA_API int luaJIT_setmode(lua_State *L, int idx, int mode);\n</pre>\n<p>\nThe returned status is either success (<tt>1</tt>) or failure (<tt>0</tt>).\nThe second argument is either <tt>0</tt> or a stack index (similar to the\nother Lua/C API functions).\n</p>\n<p>\nThe third argument specifies the mode, which is 'or'ed with a flag.\nThe flag can be <tt>LUAJIT_MODE_OFF</tt> to turn a feature on,\n<tt>LUAJIT_MODE_ON</tt> to turn a feature off, or\n<tt>LUAJIT_MODE_FLUSH</tt> to flush cached code.\n</p>\n<p>\nThe following modes are defined:\n</p>\n\n<h3 id=\"mode_engine\"><tt>luaJIT_setmode(L, 0, LUAJIT_MODE_ENGINE|flag)</tt></h3>\n<p>\nTurn the whole JIT compiler on or off or flush the whole cache of compiled code.\n</p>\n\n<h3 id=\"mode_func\"><tt>luaJIT_setmode(L, idx, LUAJIT_MODE_FUNC|flag)</tt><br>\n<tt>luaJIT_setmode(L, idx, LUAJIT_MODE_ALLFUNC|flag)</tt><br>\n<tt>luaJIT_setmode(L, idx, LUAJIT_MODE_ALLSUBFUNC|flag)</tt></h3>\n<p>\nThis sets the mode for the function at the stack index <tt>idx</tt> or\nthe parent of the calling function (<tt>idx = 0</tt>). It either\nenables JIT compilation for a function, disables it and flushes any\nalready compiled code or only flushes already compiled code. This\napplies recursively to all sub-functions of the function with\n<tt>LUAJIT_MODE_ALLFUNC</tt> or only to the sub-functions with\n<tt>LUAJIT_MODE_ALLSUBFUNC</tt>.\n</p>\n\n<h3 id=\"mode_trace\"><tt>luaJIT_setmode(L, trace,<br>\n&nbsp;&nbsp;LUAJIT_MODE_TRACE|LUAJIT_MODE_FLUSH)</tt></h3>\n<p>\nFlushes the specified root trace and all of its side traces from the cache.\nThe code for the trace will be retained as long as there are any other\ntraces which link to it.\n</p>\n\n<h3 id=\"mode_wrapcfunc\"><tt>luaJIT_setmode(L, idx, LUAJIT_MODE_WRAPCFUNC|flag)</tt></h3>\n<p>\nThis mode defines a wrapper function for calls to C functions. If\ncalled with <tt>LUAJIT_MODE_ON</tt>, the stack index at <tt>idx</tt>\nmust be a <tt>lightuserdata</tt> object holding a pointer to the wrapper\nfunction. From now on all C functions are called through the wrapper\nfunction. If called with <tt>LUAJIT_MODE_OFF</tt> this mode is turned\noff and all C functions are directly called.\n</p>\n<p>\nThe wrapper function can be used for debugging purposes or to catch\nand convert foreign exceptions. But please read the section on\n<a href=\"extensions.html#exceptions\">C++&nbsp;exception interoperability</a>\nfirst. Recommended usage can be seen in this C++ code excerpt:\n</p>\n<pre class=\"code\">\n#include &lt;exception&gt;\n#include \"lua.hpp\"\n\n// Catch C++ exceptions and convert them to Lua error messages.\n// Customize as needed for your own exception classes.\nstatic int wrap_exceptions(lua_State *L, lua_CFunction f)\n{\n  try {\n    return f(L);  // Call wrapped function and return result.\n  } catch (const char *s) {  // Catch and convert exceptions.\n    lua_pushstring(L, s);\n  } catch (std::exception& e) {\n    lua_pushstring(L, e.what());\n  } catch (...) {\n    lua_pushliteral(L, \"caught (...)\");\n  }\n  return lua_error(L);  // Rethrow as a Lua error.\n}\n\nstatic int myinit(lua_State *L)\n{\n  ...\n  // Define wrapper function and enable it.\n  lua_pushlightuserdata(L, (void *)wrap_exceptions);\n  luaJIT_setmode(L, -1, LUAJIT_MODE_WRAPCFUNC|LUAJIT_MODE_ON);\n  lua_pop(L, 1);\n  ...\n}\n</pre>\n<p>\nNote that you can only define <b>a single global wrapper function</b>,\nso be careful when using this mechanism from multiple C++ modules.\nAlso note that this mechanism is not without overhead.\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/ext_ffi.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>FFI Library</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>FFI Library</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a class=\"current\" href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\n\nThe FFI library allows <b>calling external C&nbsp;functions</b> and\n<b>using C&nbsp;data structures</b> from pure Lua code.\n\n</p>\n<p>\n\nThe FFI library largely obviates the need to write tedious manual\nLua/C bindings in C. No need to learn a separate binding language\n&mdash; <b>it parses plain C&nbsp;declarations!</b> These can be\ncut-n-pasted from C&nbsp;header files or reference manuals. It's up to\nthe task of binding large libraries without the need for dealing with\nfragile binding generators.\n\n</p>\n<p>\nThe FFI library is tightly integrated into LuaJIT (it's not available\nas a separate module). The code generated by the JIT-compiler for\naccesses to C&nbsp;data structures from Lua code is on par with the\ncode a C&nbsp;compiler would generate. Calls to C&nbsp;functions can\nbe inlined in JIT-compiled code, unlike calls to functions bound via\nthe classic Lua/C API.\n</p>\n<p>\nThis page gives a short introduction to the usage of the FFI library.\n<em>Please use the FFI sub-topics in the navigation bar to learn more.</em>\n</p>\n\n<h2 id=\"call\">Motivating Example: Calling External C Functions</h2>\n<p>\nIt's really easy to call an external C&nbsp;library function:\n</p>\n<pre class=\"code mark\">\n<span class=\"codemark\">&#9312;\n&#9313;\n\n\n&#9314;</span>local ffi = require(\"ffi\")\nffi.cdef[[\n<span style=\"color:#00a000;\">int printf(const char *fmt, ...);</span>\n]]\nffi.C.printf(\"Hello %s!\", \"world\")\n</pre>\n<p>\nSo, let's pick that apart:\n</p>\n<p>\n<span class=\"mark\">&#9312;</span> Load the FFI library.\n</p>\n<p>\n<span class=\"mark\">&#9313;</span> Add a C&nbsp;declaration\nfor the function. The part inside the double-brackets (in green) is\njust standard C&nbsp;syntax.\n</p>\n<p>\n<span class=\"mark\">&#9314;</span> Call the named\nC&nbsp;function &mdash; Yes, it's that simple!\n</p>\n<p style=\"font-size: 8pt;\">\nActually, what goes on behind the scenes is far from simple: <span\nstyle=\"color:#4040c0;\">&#9314;</span> makes use of the standard\nC&nbsp;library namespace <tt>ffi.C</tt>. Indexing this namespace with\na symbol name (<tt>\"printf\"</tt>) automatically binds it to the\nstandard C&nbsp;library. The result is a special kind of object which,\nwhen called, runs the <tt>printf</tt> function. The arguments passed\nto this function are automatically converted from Lua objects to the\ncorresponding C&nbsp;types.\n</p>\n<p>\nOk, so maybe the use of <tt>printf()</tt> wasn't such a spectacular\nexample. You could have done that with <tt>io.write()</tt> and\n<tt>string.format()</tt>, too. But you get the idea ...\n</p>\n<p>\nSo here's something to pop up a message box on Windows:\n</p>\n<pre class=\"code\">\nlocal ffi = require(\"ffi\")\nffi.cdef[[\n<span style=\"color:#00a000;\">int MessageBoxA(void *w, const char *txt, const char *cap, int type);</span>\n]]\nffi.C.MessageBoxA(nil, \"Hello world!\", \"Test\", 0)\n</pre>\n<p>\nBing! Again, that was far too easy, no?\n</p>\n<p style=\"font-size: 8pt;\">\nCompare this with the effort required to bind that function using the\nclassic Lua/C API: create an extra C&nbsp;file, add a C&nbsp;function\nthat retrieves and checks the argument types passed from Lua and calls\nthe actual C&nbsp;function, add a list of module functions and their\nnames, add a <tt>luaopen_*</tt> function and register all module\nfunctions, compile and link it into a shared library (DLL), move it to\nthe proper path, add Lua code that loads the module aaaand ... finally\ncall the binding function. Phew!\n</p>\n\n<h2 id=\"cdata\">Motivating Example: Using C Data Structures</h2>\n<p>\nThe FFI library allows you to create and access C&nbsp;data\nstructures. Of course the main use for this is for interfacing with\nC&nbsp;functions. But they can be used stand-alone, too.\n</p>\n<p>\nLua is built upon high-level data types. They are flexible, extensible\nand dynamic. That's why we all love Lua so much. Alas, this can be\ninefficient for certain tasks, where you'd really want a low-level\ndata type. E.g. a large array of a fixed structure needs to be\nimplemented with a big table holding lots of tiny tables. This imposes\nboth a substantial memory overhead as well as a performance overhead.\n</p>\n<p>\nHere's a sketch of a library that operates on color images plus a\nsimple benchmark. First, the plain Lua version:\n</p>\n<pre class=\"code\">\nlocal floor = math.floor\n\nlocal function image_ramp_green(n)\n  local img = {}\n  local f = 255/(n-1)\n  for i=1,n do\n    img[i] = { red = 0, green = floor((i-1)*f), blue = 0, alpha = 255 }\n  end\n  return img\nend\n\nlocal function image_to_grey(img, n)\n  for i=1,n do\n    local y = floor(0.3*img[i].red + 0.59*img[i].green + 0.11*img[i].blue)\n    img[i].red = y; img[i].green = y; img[i].blue = y\n  end\nend\n\nlocal N = 400*400\nlocal img = image_ramp_green(N)\nfor i=1,1000 do\n  image_to_grey(img, N)\nend\n</pre>\n<p>\nThis creates a table with 160.000 pixels, each of which is a table\nholding four number values in the range of 0-255. First an image with\na green ramp is created (1D for simplicity), then the image is\nconverted to greyscale 1000 times. Yes, that's silly, but I was in\nneed of a simple example ...\n</p>\n<p>\nAnd here's the FFI version. The modified parts have been marked in\nbold:\n</p>\n<pre class=\"code mark\">\n<span class=\"codemark\">&#9312;\n\n\n\n\n\n&#9313;\n\n&#9314;\n&#9315;\n\n\n\n\n\n\n&#9314;\n&#9316;</span><b>local ffi = require(\"ffi\")\nffi.cdef[[\n</b><span style=\"color:#00a000;\">typedef struct { uint8_t red, green, blue, alpha; } rgba_pixel;</span><b>\n]]</b>\n\nlocal function image_ramp_green(n)\n  <b>local img = ffi.new(\"rgba_pixel[?]\", n)</b>\n  local f = 255/(n-1)\n  for i=<b>0,n-1</b> do\n    <b>img[i].green = i*f</b>\n    <b>img[i].alpha = 255</b>\n  end\n  return img\nend\n\nlocal function image_to_grey(img, n)\n  for i=<b>0,n-1</b> do\n    local y = <b>0.3*img[i].red + 0.59*img[i].green + 0.11*img[i].blue</b>\n    img[i].red = y; img[i].green = y; img[i].blue = y\n  end\nend\n\nlocal N = 400*400\nlocal img = image_ramp_green(N)\nfor i=1,1000 do\n  image_to_grey(img, N)\nend\n</pre>\n<p>\nOk, so that wasn't too difficult:\n</p>\n<p>\n<span class=\"mark\">&#9312;</span> First, load the FFI\nlibrary and declare the low-level data type. Here we choose a\n<tt>struct</tt> which holds four byte fields, one for each component\nof a 4x8&nbsp;bit RGBA pixel.\n</p>\n<p>\n<span class=\"mark\">&#9313;</span> Creating the data\nstructure with <tt>ffi.new()</tt> is straightforward &mdash; the\n<tt>'?'</tt> is a placeholder for the number of elements of a\nvariable-length array.\n</p>\n<p>\n<span class=\"mark\">&#9314;</span> C&nbsp;arrays are\nzero-based, so the indexes have to run from <tt>0</tt> to\n<tt>n-1</tt>. One might want to allocate one more element instead to\nsimplify converting legacy code.\n</p>\n<p>\n<span class=\"mark\">&#9315;</span> Since <tt>ffi.new()</tt>\nzero-fills the array by default, we only need to set the green and the\nalpha fields.\n</p>\n<p>\n<span class=\"mark\">&#9316;</span> The calls to\n<tt>math.floor()</tt> can be omitted here, because floating-point\nnumbers are already truncated towards zero when converting them to an\ninteger. This happens implicitly when the number is stored in the\nfields of each pixel.\n</p>\n<p>\nNow let's have a look at the impact of the changes: first, memory\nconsumption for the image is down from 22&nbsp;Megabytes to\n640&nbsp;Kilobytes (400*400*4 bytes). That's a factor of 35x less! So,\nyes, tables do have a noticeable overhead. BTW: The original program\nwould consume 40&nbsp;Megabytes in plain Lua (on x64).\n</p>\n<p>\nNext, performance: the pure Lua version runs in 9.57 seconds (52.9\nseconds with the Lua interpreter) and the FFI version runs in 0.48\nseconds on my machine (YMMV). That's a factor of 20x faster (110x\nfaster than the Lua interpreter).\n</p>\n<p style=\"font-size: 8pt;\">\nThe avid reader may notice that converting the pure Lua version over\nto use array indexes for the colors (<tt>[1]</tt> instead of\n<tt>.red</tt>, <tt>[2]</tt> instead of <tt>.green</tt> etc.) ought to\nbe more compact and faster. This is certainly true (by a factor of\n~1.7x). Switching to a struct-of-arrays would help, too.\n</p>\n<p style=\"font-size: 8pt;\">\nHowever the resulting code would be less idiomatic and rather\nerror-prone. And it still doesn't get even close to the performance of\nthe FFI version of the code. Also, high-level data structures cannot\nbe easily passed to other C&nbsp;functions, especially I/O functions,\nwithout undue conversion penalties.\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/ext_ffi_api.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>ffi.* API Functions</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ntable.abitable { width: 30em; line-height: 1.2; }\ntr.abihead td { font-weight: bold; }\ntd.abiparam { font-weight: bold; width: 6em; }\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1><tt>ffi.*</tt> API Functions</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a class=\"current\" href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nThis page describes the API functions provided by the FFI library in\ndetail. It's recommended to read through the\n<a href=\"ext_ffi.html\">introduction</a> and the\n<a href=\"ext_ffi_tutorial.html\">FFI tutorial</a> first.\n</p>\n\n<h2 id=\"glossary\">Glossary</h2>\n<ul>\n<li><b>cdecl</b> &mdash; An abstract C&nbsp;type declaration (a Lua\nstring).</li>\n<li><b>ctype</b> &mdash; A C&nbsp;type object. This is a special kind of\n<b>cdata</b> returned by <tt>ffi.typeof()</tt>. It serves as a\n<b>cdata</b> <a href=\"#ffi_new\">constructor</a> when called.</li>\n<li><b>cdata</b> &mdash; A C&nbsp;data object. It holds a value of the\ncorresponding <b>ctype</b>.</li>\n<li><b>ct</b> &mdash; A C&nbsp;type specification which can be used for\nmost of the API functions. Either a <b>cdecl</b>, a <b>ctype</b> or a\n<b>cdata</b> serving as a template type.</li>\n<li><b>cb</b> &mdash; A callback object. This is a C&nbsp;data object\nholding a special function pointer. Calling this function from\nC&nbsp;code runs an associated Lua function.</li>\n<li><b>VLA</b> &mdash; A variable-length array is declared with a\n<tt>?</tt> instead of the number of elements, e.g. <tt>\"int[?]\"</tt>.\nThe number of elements (<tt>nelem</tt>) must be given when it's\n<a href=\"#ffi_new\">created</a>.</li>\n<li><b>VLS</b> &mdash; A variable-length struct is a <tt>struct</tt> C\ntype where the last element is a <b>VLA</b>. The same rules for\ndeclaration and creation apply.</li>\n</ul>\n\n<h2 id=\"decl\">Declaring and Accessing External Symbols</h2>\n<p>\nExternal symbols must be declared first and can then be accessed by\nindexing a <a href=\"ext_ffi_semantics.html#clib\">C&nbsp;library\nnamespace</a>, which automatically binds the symbol to a specific\nlibrary.\n</p>\n\n<h3 id=\"ffi_cdef\"><tt>ffi.cdef(def)</tt></h3>\n<p>\nAdds multiple C&nbsp;declarations for types or external symbols (named\nvariables or functions). <tt>def</tt> must be a Lua string. It's\nrecommended to use the syntactic sugar for string arguments as\nfollows:\n</p>\n<pre class=\"code\">\nffi.cdef[[\n<span style=\"color:#00a000;\">typedef struct foo { int a, b; } foo_t;  // Declare a struct and typedef.\nint dofoo(foo_t *f, int n);  /* Declare an external C function. */</span>\n]]\n</pre>\n<p>\nThe contents of the string (the part in green above) must be a\nsequence of\n<a href=\"ext_ffi_semantics.html#clang\">C&nbsp;declarations</a>,\nseparated by semicolons. The trailing semicolon for a single\ndeclaration may be omitted.\n</p>\n<p>\nPlease note that external symbols are only <em>declared</em>, but they\nare <em>not bound</em> to any specific address, yet. Binding is\nachieved with C&nbsp;library namespaces (see below).\n</p>\n<p style=\"color: #c00000;\">\nC&nbsp;declarations are not passed through a C&nbsp;pre-processor,\nyet. No pre-processor tokens are allowed, except for\n<tt>#pragma&nbsp;pack</tt>. Replace <tt>#define</tt> in existing\nC&nbsp;header files with <tt>enum</tt>, <tt>static&nbsp;const</tt>\nor <tt>typedef</tt> and/or pass the files through an external\nC&nbsp;pre-processor (once). Be careful not to include unneeded or\nredundant declarations from unrelated header files.\n</p>\n\n<h3 id=\"ffi_C\"><tt>ffi.C</tt></h3>\n<p>\nThis is the default C&nbsp;library namespace &mdash; note the\nuppercase <tt>'C'</tt>. It binds to the default set of symbols or\nlibraries on the target system. These are more or less the same as a\nC&nbsp;compiler would offer by default, without specifying extra link\nlibraries.\n</p>\n<p>\nOn POSIX systems, this binds to symbols in the default or global\nnamespace. This includes all exported symbols from the executable and\nany libraries loaded into the global namespace. This includes at least\n<tt>libc</tt>, <tt>libm</tt>, <tt>libdl</tt> (on Linux),\n<tt>libgcc</tt> (if compiled with GCC), as well as any exported\nsymbols from the Lua/C&nbsp;API provided by LuaJIT itself.\n</p>\n<p>\nOn Windows systems, this binds to symbols exported from the\n<tt>*.exe</tt>, the <tt>lua51.dll</tt> (i.e. the Lua/C&nbsp;API\nprovided by LuaJIT itself), the C&nbsp;runtime library LuaJIT was linked\nwith (<tt>msvcrt*.dll</tt>), <tt>kernel32.dll</tt>,\n<tt>user32.dll</tt> and <tt>gdi32.dll</tt>.\n</p>\n\n<h3 id=\"ffi_load\"><tt>clib = ffi.load(name [,global])</tt></h3>\n<p>\nThis loads the dynamic library given by <tt>name</tt> and returns\na new C&nbsp;library namespace which binds to its symbols. On POSIX\nsystems, if <tt>global</tt> is <tt>true</tt>, the library symbols are\nloaded into the global namespace, too.\n</p>\n<p>\nIf <tt>name</tt> is a path, the library is loaded from this path.\nOtherwise <tt>name</tt> is canonicalized in a system-dependent way and\nsearched in the default search path for dynamic libraries:\n</p>\n<p>\nOn POSIX systems, if the name contains no dot, the extension\n<tt>.so</tt> is appended. Also, the <tt>lib</tt> prefix is prepended\nif necessary. So <tt>ffi.load(\"z\")</tt> looks for <tt>\"libz.so\"</tt>\nin the default shared library search path.\n</p>\n<p>\nOn Windows systems, if the name contains no dot, the extension\n<tt>.dll</tt> is appended. So <tt>ffi.load(\"ws2_32\")</tt> looks for\n<tt>\"ws2_32.dll\"</tt> in the default DLL search path.\n</p>\n\n<h2 id=\"create\">Creating cdata Objects</h2>\n<p>\nThe following API functions create cdata objects (<tt>type()</tt>\nreturns <tt>\"cdata\"</tt>). All created cdata objects are\n<a href=\"ext_ffi_semantics.html#gc\">garbage collected</a>.\n</p>\n\n<h3 id=\"ffi_new\"><tt>cdata = ffi.new(ct [,nelem] [,init...])<br>\ncdata = <em>ctype</em>([nelem,] [init...])</tt></h3>\n<p>\nCreates a cdata object for the given <tt>ct</tt>. VLA/VLS types\nrequire the <tt>nelem</tt> argument. The second syntax uses a ctype as\na constructor and is otherwise fully equivalent.\n</p>\n<p>\nThe cdata object is initialized according to the\n<a href=\"ext_ffi_semantics.html#init\">rules for initializers</a>,\nusing the optional <tt>init</tt> arguments. Excess initializers cause\nan error.\n</p>\n<p>\nPerformance notice: if you want to create many objects of one kind,\nparse the cdecl only once and get its ctype with\n<tt>ffi.typeof()</tt>. Then use the ctype as a constructor repeatedly.\n</p>\n<p style=\"font-size: 8pt;\">\nPlease note that an anonymous <tt>struct</tt> declaration implicitly\ncreates a new and distinguished ctype every time you use it for\n<tt>ffi.new()</tt>. This is probably <b>not</b> what you want,\nespecially if you create more than one cdata object. Different anonymous\n<tt>structs</tt> are not considered assignment-compatible by the\nC&nbsp;standard, even though they may have the same fields! Also, they\nare considered different types by the JIT-compiler, which may cause an\nexcessive number of traces. It's strongly suggested to either declare\na named <tt>struct</tt> or <tt>typedef</tt> with <tt>ffi.cdef()</tt>\nor to create a single ctype object for an anonymous <tt>struct</tt>\nwith <tt>ffi.typeof()</tt>.\n</p>\n\n<h3 id=\"ffi_typeof\"><tt>ctype = ffi.typeof(ct)</tt></h3>\n<p>\nCreates a ctype object for the given <tt>ct</tt>.\n</p>\n<p>\nThis function is especially useful to parse a cdecl only once and then\nuse the resulting ctype object as a <a href=\"#ffi_new\">constructor</a>.\n</p>\n\n<h3 id=\"ffi_cast\"><tt>cdata = ffi.cast(ct, init)</tt></h3>\n<p>\nCreates a scalar cdata object for the given <tt>ct</tt>. The cdata\nobject is initialized with <tt>init</tt> using the \"cast\" variant of\nthe <a href=\"ext_ffi_semantics.html#convert\">C&nbsp;type conversion\nrules</a>.\n</p>\n<p>\nThis functions is mainly useful to override the pointer compatibility\nchecks or to convert pointers to addresses or vice versa.\n</p>\n\n<h3 id=\"ffi_metatype\"><tt>ctype = ffi.metatype(ct, metatable)</tt></h3>\n<p>\nCreates a ctype object for the given <tt>ct</tt> and associates it with\na metatable. Only <tt>struct</tt>/<tt>union</tt> types, complex numbers\nand vectors are allowed. Other types may be wrapped in a\n<tt>struct</tt>, if needed.\n</p>\n<p>\nThe association with a metatable is permanent and cannot be changed\nafterwards. Neither the contents of the <tt>metatable</tt> nor the\ncontents of an <tt>__index</tt> table (if any) may be modified\nafterwards. The associated metatable automatically applies to all uses\nof this type, no matter how the objects are created or where they\noriginate from. Note that pre-defined operations on types have\nprecedence (e.g. declared field names cannot be overriden).\n</p>\n<p>\nAll standard Lua metamethods are implemented. These are called directly,\nwithout shortcuts and on any mix of types. For binary operations, the\nleft operand is checked first for a valid ctype metamethod. The\n<tt>__gc</tt> metamethod only applies to <tt>struct</tt>/<tt>union</tt>\ntypes and performs an implicit <a href=\"#ffi_gc\"><tt>ffi.gc()</tt></a>\ncall during creation of an instance.\n</p>\n\n<h3 id=\"ffi_gc\"><tt>cdata = ffi.gc(cdata, finalizer)</tt></h3>\n<p>\nAssociates a finalizer with a pointer or aggregate cdata object. The\ncdata object is returned unchanged.\n</p>\n<p>\nThis function allows safe integration of unmanaged resources into the\nautomatic memory management of the LuaJIT garbage collector. Typical\nusage:\n</p>\n<pre class=\"code\">\nlocal p = ffi.gc(ffi.C.malloc(n), ffi.C.free)\n...\np = nil -- Last reference to p is gone.\n-- GC will eventually run finalizer: ffi.C.free(p)\n</pre>\n<p>\nA cdata finalizer works like the <tt>__gc</tt> metamethod for userdata\nobjects: when the last reference to a cdata object is gone, the\nassociated finalizer is called with the cdata object as an argument. The\nfinalizer can be a Lua function or a cdata function or cdata function\npointer. An existing finalizer can be removed by setting a <tt>nil</tt>\nfinalizer, e.g. right before explicitly deleting a resource:\n</p>\n<pre class=\"code\">\nffi.C.free(ffi.gc(p, nil)) -- Manually free the memory.\n</pre>\n\n<h2 id=\"info\">C&nbsp;Type Information</h2>\n<p>\nThe following API functions return information about C&nbsp;types.\nThey are most useful for inspecting cdata objects.\n</p>\n\n<h3 id=\"ffi_sizeof\"><tt>size = ffi.sizeof(ct [,nelem])</tt></h3>\n<p>\nReturns the size of <tt>ct</tt> in bytes. Returns <tt>nil</tt> if\nthe size is not known (e.g. for <tt>\"void\"</tt> or function types).\nRequires <tt>nelem</tt> for VLA/VLS types, except for cdata objects.\n</p>\n\n<h3 id=\"ffi_alignof\"><tt>align = ffi.alignof(ct)</tt></h3>\n<p>\nReturns the minimum required alignment for <tt>ct</tt> in bytes.\n</p>\n\n<h3 id=\"ffi_offsetof\"><tt>ofs [,bpos,bsize] = ffi.offsetof(ct, field)</tt></h3>\n<p>\nReturns the offset (in bytes) of <tt>field</tt> relative to the start\nof <tt>ct</tt>, which must be a <tt>struct</tt>. Additionally returns\nthe position and the field size (in bits) for bit fields.\n</p>\n\n<h3 id=\"ffi_istype\"><tt>status = ffi.istype(ct, obj)</tt></h3>\n<p>\nReturns <tt>true</tt> if <tt>obj</tt> has the C&nbsp;type given by\n<tt>ct</tt>. Returns <tt>false</tt> otherwise.\n</p>\n<p>\nC&nbsp;type qualifiers (<tt>const</tt> etc.) are ignored. Pointers are\nchecked with the standard pointer compatibility rules, but without any\nspecial treatment for <tt>void&nbsp;*</tt>. If <tt>ct</tt> specifies a\n<tt>struct</tt>/<tt>union</tt>, then a pointer to this type is accepted,\ntoo. Otherwise the types must match exactly.\n</p>\n<p>\nNote: this function accepts all kinds of Lua objects for the\n<tt>obj</tt> argument, but always returns <tt>false</tt> for non-cdata\nobjects.\n</p>\n\n<h2 id=\"util\">Utility Functions</h2>\n\n<h3 id=\"ffi_errno\"><tt>err = ffi.errno([newerr])</tt></h3>\n<p>\nReturns the error number set by the last C&nbsp;function call which\nindicated an error condition. If the optional <tt>newerr</tt> argument\nis present, the error number is set to the new value and the previous\nvalue is returned.\n</p>\n<p>\nThis function offers a portable and OS-independent way to get and set the\nerror number. Note that only <em>some</em> C&nbsp;functions set the error\nnumber. And it's only significant if the function actually indicated an\nerror condition (e.g. with a return value of <tt>-1</tt> or\n<tt>NULL</tt>). Otherwise, it may or may not contain any previously set\nvalue.\n</p>\n<p>\nYou're advised to call this function only when needed and as close as\npossible after the return of the related C&nbsp;function. The\n<tt>errno</tt> value is preserved across hooks, memory allocations,\ninvocations of the JIT compiler and other internal VM activity. The same\napplies to the value returned by <tt>GetLastError()</tt> on Windows, but\nyou need to declare and call it yourself.\n</p>\n\n<h3 id=\"ffi_string\"><tt>str = ffi.string(ptr [,len])</tt></h3>\n<p>\nCreates an interned Lua string from the data pointed to by\n<tt>ptr</tt>.\n</p>\n<p>\nIf the optional argument <tt>len</tt> is missing, <tt>ptr</tt> is\nconverted to a <tt>\"char&nbsp;*\"</tt> and the data is assumed to be\nzero-terminated. The length of the string is computed with\n<tt>strlen()</tt>.\n</p>\n<p>\nOtherwise <tt>ptr</tt> is converted to a <tt>\"void&nbsp;*\"</tt> and\n<tt>len</tt> gives the length of the data. The data may contain\nembedded zeros and need not be byte-oriented (though this may cause\nendianess issues).\n</p>\n<p>\nThis function is mainly useful to convert (temporary)\n<tt>\"const&nbsp;char&nbsp;*\"</tt> pointers returned by\nC&nbsp;functions to Lua strings and store them or pass them to other\nfunctions expecting a Lua string. The Lua string is an (interned) copy\nof the data and bears no relation to the original data area anymore.\nLua strings are 8&nbsp;bit clean and may be used to hold arbitrary,\nnon-character data.\n</p>\n<p>\nPerformance notice: it's faster to pass the length of the string, if\nit's known. E.g. when the length is returned by a C&nbsp;call like\n<tt>sprintf()</tt>.\n</p>\n\n<h3 id=\"ffi_copy\"><tt>ffi.copy(dst, src, len)<br>\nffi.copy(dst, str)</tt></h3>\n<p>\nCopies the data pointed to by <tt>src</tt> to <tt>dst</tt>.\n<tt>dst</tt> is converted to a <tt>\"void&nbsp;*\"</tt> and <tt>src</tt>\nis converted to a <tt>\"const void&nbsp;*\"</tt>.\n</p>\n<p>\nIn the first syntax, <tt>len</tt> gives the number of bytes to copy.\nCaveat: if <tt>src</tt> is a Lua string, then <tt>len</tt> must not\nexceed <tt>#src+1</tt>.\n</p>\n<p>\nIn the second syntax, the source of the copy must be a Lua string. All\nbytes of the string <em>plus a zero-terminator</em> are copied to\n<tt>dst</tt> (i.e. <tt>#src+1</tt> bytes).\n</p>\n<p>\nPerformance notice: <tt>ffi.copy()</tt> may be used as a faster\n(inlinable) replacement for the C&nbsp;library functions\n<tt>memcpy()</tt>, <tt>strcpy()</tt> and <tt>strncpy()</tt>.\n</p>\n\n<h3 id=\"ffi_fill\"><tt>ffi.fill(dst, len [,c])</tt></h3>\n<p>\nFills the data pointed to by <tt>dst</tt> with <tt>len</tt> constant\nbytes, given by <tt>c</tt>. If <tt>c</tt> is omitted, the data is\nzero-filled.\n</p>\n<p>\nPerformance notice: <tt>ffi.fill()</tt> may be used as a faster\n(inlinable) replacement for the C&nbsp;library function\n<tt>memset(dst,&nbsp;c,&nbsp;len)</tt>. Please note the different\norder of arguments!\n</p>\n\n<h2 id=\"target\">Target-specific Information</h2>\n\n<h3 id=\"ffi_abi\"><tt>status = ffi.abi(param)</tt></h3>\n<p>\nReturns <tt>true</tt> if <tt>param</tt> (a Lua string) applies for the\ntarget ABI (Application Binary Interface). Returns <tt>false</tt>\notherwise. The following parameters are currently defined:\n</p>\n<table class=\"abitable\">\n<tr class=\"abihead\">\n<td class=\"abiparam\">Parameter</td>\n<td class=\"abidesc\">Description</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"abiparam\">32bit</td><td class=\"abidesc\">32 bit architecture</td></tr>\n<tr class=\"even\">\n<td class=\"abiparam\">64bit</td><td class=\"abidesc\">64 bit architecture</td></tr>\n<tr class=\"odd separate\">\n<td class=\"abiparam\">le</td><td class=\"abidesc\">Little-endian architecture</td></tr>\n<tr class=\"even\">\n<td class=\"abiparam\">be</td><td class=\"abidesc\">Big-endian architecture</td></tr>\n<tr class=\"odd separate\">\n<td class=\"abiparam\">fpu</td><td class=\"abidesc\">Target has a hardware FPU</td></tr>\n<tr class=\"even\">\n<td class=\"abiparam\">softfp</td><td class=\"abidesc\">softfp calling conventions</td></tr>\n<tr class=\"odd\">\n<td class=\"abiparam\">hardfp</td><td class=\"abidesc\">hardfp calling conventions</td></tr>\n<tr class=\"even separate\">\n<td class=\"abiparam\">eabi</td><td class=\"abidesc\">EABI variant of the standard ABI</td></tr>\n<tr class=\"odd\">\n<td class=\"abiparam\">win</td><td class=\"abidesc\">Windows variant of the standard ABI</td></tr>\n</table>\n\n<h3 id=\"ffi_os\"><tt>ffi.os</tt></h3>\n<p>\nContains the target OS name. Same contents as\n<a href=\"ext_jit.html#jit_os\"><tt>jit.os</tt></a>.\n</p>\n\n<h3 id=\"ffi_arch\"><tt>ffi.arch</tt></h3>\n<p>\nContains the target architecture name. Same contents as\n<a href=\"ext_jit.html#jit_arch\"><tt>jit.arch</tt></a>.\n</p>\n\n<h2 id=\"callback\">Methods for Callbacks</h2>\n<p>\nThe C&nbsp;types for <a href=\"ext_ffi_semantics.html#callback\">callbacks</a>\nhave some extra methods:\n</p>\n\n<h3 id=\"callback_free\"><tt>cb:free()</tt></h3>\n<p>\nFree the resources associated with a callback. The associated Lua\nfunction is unanchored and may be garbage collected. The callback\nfunction pointer is no longer valid and must not be called anymore\n(it may be reused by a subsequently created callback).\n</p>\n\n<h3 id=\"callback_set\"><tt>cb:set(func)</tt></h3>\n<p>\nAssociate a new Lua function with a callback. The C&nbsp;type of the\ncallback and the callback function pointer are unchanged.\n</p>\n<p>\nThis method is useful to dynamically switch the receiver of callbacks\nwithout creating a new callback each time and registering it again (e.g.\nwith a GUI library).\n</p>\n\n<h2 id=\"extended\">Extended Standard Library Functions</h2>\n<p>\nThe following standard library functions have been extended to work\nwith cdata objects:\n</p>\n\n<h3 id=\"tonumber\"><tt>n = tonumber(cdata)</tt></h3>\n<p>\nConverts a number cdata object to a <tt>double</tt> and returns it as\na Lua number. This is particularly useful for boxed 64&nbsp;bit\ninteger values. Caveat: this conversion may incur a precision loss.\n</p>\n\n<h3 id=\"tostring\"><tt>s = tostring(cdata)</tt></h3>\n<p>\nReturns a string representation of the value of 64&nbsp;bit integers\n(<tt><b>\"</b>nnn<b>LL\"</b></tt> or <tt><b>\"</b>nnn<b>ULL\"</b></tt>) or\ncomplex numbers (<tt><b>\"</b>re&plusmn;im<b>i\"</b></tt>). Otherwise\nreturns a string representation of the C&nbsp;type of a ctype object\n(<tt><b>\"ctype&lt;</b>type<b>&gt;\"</b></tt>) or a cdata object\n(<tt><b>\"cdata&lt;</b>type<b>&gt;:&nbsp;</b>address\"</tt>), unless you\noverride it with a <tt>__tostring</tt> metamethod (see\n<a href=\"#ffi_metatype\"><tt>ffi.metatype()</tt></a>).\n</p>\n\n<h3 id=\"pairs\"><tt>iter, obj, start = pairs(cdata)<br>\niter, obj, start = ipairs(cdata)<br></tt></h3>\n<p>\nCalls the <tt>__pairs</tt> or <tt>__ipairs</tt> metamethod of the\ncorresponding ctype.\n</p>\n\n<h2 id=\"literals\">Extensions to the Lua Parser</h2>\n<p>\nThe parser for Lua source code treats numeric literals with the\nsuffixes <tt>LL</tt> or <tt>ULL</tt> as signed or unsigned 64&nbsp;bit\nintegers. Case doesn't matter, but uppercase is recommended for\nreadability. It handles both decimal (<tt>42LL</tt>) and hexadecimal\n(<tt>0x2aLL</tt>) literals.\n</p>\n<p>\nThe imaginary part of complex numbers can be specified by suffixing\nnumber literals with <tt>i</tt> or <tt>I</tt>, e.g. <tt>12.5i</tt>.\nCaveat: you'll need to use <tt>1i</tt> to get an imaginary part with\nthe value one, since <tt>i</tt> itself still refers to a variable\nnamed <tt>i</tt>.\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/ext_ffi_semantics.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>FFI Semantics</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ntable.convtable { line-height: 1.2; }\ntr.convhead td { font-weight: bold; }\ntd.convop { font-style: italic; width: 40%; }\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>FFI Semantics</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a class=\"current\" href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nThis page describes the detailed semantics underlying the FFI library\nand its interaction with both Lua and C&nbsp;code.\n</p>\n<p>\nGiven that the FFI library is designed to interface with C&nbsp;code\nand that declarations can be written in plain C&nbsp;syntax, <b>it\nclosely follows the C&nbsp;language semantics</b>, wherever possible.\nSome minor concessions are needed for smoother interoperation with Lua\nlanguage semantics.\n</p>\n<p>\nPlease don't be overwhelmed by the contents of this page &mdash; this\nis a reference and you may need to consult it, if in doubt. It doesn't\nhurt to skim this page, but most of the semantics \"just work\" as you'd\nexpect them to work. It should be straightforward to write\napplications using the LuaJIT FFI for developers with a C or C++\nbackground.\n</p>\n\n<h2 id=\"clang\">C Language Support</h2>\n<p>\nThe FFI library has a built-in C&nbsp;parser with a minimal memory\nfootprint. It's used by the <a href=\"ext_ffi_api.html\">ffi.* library\nfunctions</a> to declare C&nbsp;types or external symbols.\n</p>\n<p>\nIt's only purpose is to parse C&nbsp;declarations, as found e.g. in\nC&nbsp;header files. Although it does evaluate constant expressions,\nit's <em>not</em> a C&nbsp;compiler. The body of <tt>inline</tt>\nC&nbsp;function definitions is simply ignored.\n</p>\n<p>\nAlso, this is <em>not</em> a validating C&nbsp;parser. It expects and\naccepts correctly formed C&nbsp;declarations, but it may choose to\nignore bad declarations or show rather generic error messages. If in\ndoubt, please check the input against your favorite C&nbsp;compiler.\n</p>\n<p>\nThe C&nbsp;parser complies to the <b>C99 language standard</b> plus\nthe following extensions:\n</p>\n<ul>\n\n<li>The <tt>'\\e'</tt> escape in character and string literals.</li>\n\n<li>The C99/C++ boolean type, declared with the keywords <tt>bool</tt>\nor <tt>_Bool</tt>.</li>\n\n<li>Complex numbers, declared with the keywords <tt>complex</tt> or\n<tt>_Complex</tt>.</li>\n\n<li>Two complex number types: <tt>complex</tt> (aka\n<tt>complex&nbsp;double</tt>) and <tt>complex&nbsp;float</tt>.</li>\n\n<li>Vector types, declared with the GCC <tt>mode</tt> or\n<tt>vector_size</tt> attribute.</li>\n\n<li>Unnamed ('transparent') <tt>struct</tt>/<tt>union</tt> fields\ninside a <tt>struct</tt>/<tt>union</tt>.</li>\n\n<li>Incomplete <tt>enum</tt> declarations, handled like incomplete\n<tt>struct</tt> declarations.</li>\n\n<li>Unnamed <tt>enum</tt> fields inside a\n<tt>struct</tt>/<tt>union</tt>. This is similar to a scoped C++\n<tt>enum</tt>, except that declared constants are visible in the\nglobal namespace, too.</li>\n\n<li>Scoped <tt>static&nbsp;const</tt> declarations inside a\n<tt>struct</tt>/<tt>union</tt> (from C++).</li>\n\n<li>Zero-length arrays (<tt>[0]</tt>), empty\n<tt>struct</tt>/<tt>union</tt>, variable-length arrays (VLA,\n<tt>[?]</tt>) and variable-length structs (VLS, with a trailing\nVLA).</li>\n\n<li>C++ reference types (<tt>int&nbsp;&amp;x</tt>).</li>\n\n<li>Alternate GCC keywords with '<tt>__</tt>', e.g.\n<tt>__const__</tt>.</li>\n\n<li>GCC <tt>__attribute__</tt> with the following attributes:\n<tt>aligned</tt>, <tt>packed</tt>, <tt>mode</tt>,\n<tt>vector_size</tt>, <tt>cdecl</tt>, <tt>fastcall</tt>,\n<tt>stdcall</tt>, <tt>thiscall</tt>.</li>\n\n<li>The GCC <tt>__extension__</tt> keyword and the GCC\n<tt>__alignof__</tt> operator.</li>\n\n<li>GCC <tt>__asm__(\"symname\")</tt> symbol name redirection for\nfunction declarations.</li>\n\n<li>MSVC keywords for fixed-length types: <tt>__int8</tt>,\n<tt>__int16</tt>, <tt>__int32</tt> and <tt>__int64</tt>.</li>\n\n<li>MSVC <tt>__cdecl</tt>, <tt>__fastcall</tt>, <tt>__stdcall</tt>,\n<tt>__thiscall</tt>, <tt>__ptr32</tt>, <tt>__ptr64</tt>,\n<tt>__declspec(align(n))</tt> and <tt>#pragma&nbsp;pack</tt>.</li>\n\n<li>All other GCC/MSVC-specific attributes are ignored.</li>\n\n</ul>\n<p>\nThe following C&nbsp;types are pre-defined by the C&nbsp;parser (like\na <tt>typedef</tt>, except re-declarations will be ignored):\n</p>\n<ul>\n\n<li>Vararg handling: <tt>va_list</tt>, <tt>__builtin_va_list</tt>,\n<tt>__gnuc_va_list</tt>.</li>\n\n<li>From <tt>&lt;stddef.h&gt;</tt>: <tt>ptrdiff_t</tt>,\n<tt>size_t</tt>, <tt>wchar_t</tt>.</li>\n\n<li>From <tt>&lt;stdint.h&gt;</tt>: <tt>int8_t</tt>, <tt>int16_t</tt>,\n<tt>int32_t</tt>, <tt>int64_t</tt>, <tt>uint8_t</tt>,\n<tt>uint16_t</tt>, <tt>uint32_t</tt>, <tt>uint64_t</tt>,\n<tt>intptr_t</tt>, <tt>uintptr_t</tt>.</li>\n\n</ul>\n<p>\nYou're encouraged to use these types in preference to\ncompiler-specific extensions or target-dependent standard types.\nE.g. <tt>char</tt> differs in signedness and <tt>long</tt> differs in\nsize, depending on the target architecture and platform ABI.\n</p>\n<p>\nThe following C&nbsp;features are <b>not</b> supported:\n</p>\n<ul>\n\n<li>A declaration must always have a type specifier; it doesn't\ndefault to an <tt>int</tt> type.</li>\n\n<li>Old-style empty function declarations (K&amp;R) are not allowed.\nAll C&nbsp;functions must have a proper prototype declaration. A\nfunction declared without parameters (<tt>int&nbsp;foo();</tt>) is\ntreated as a function taking zero arguments, like in C++.</li>\n\n<li>The <tt>long double</tt> C&nbsp;type is parsed correctly, but\nthere's no support for the related conversions, accesses or arithmetic\noperations.</li>\n\n<li>Wide character strings and character literals are not\nsupported.</li>\n\n<li><a href=\"#status\">See below</a> for features that are currently\nnot implemented.</li>\n\n</ul>\n\n<h2 id=\"convert\">C Type Conversion Rules</h2>\n\n<h3 id=\"convert_tolua\">Conversions from C&nbsp;types to Lua objects</h3>\n<p>\nThese conversion rules apply for <em>read accesses</em> to\nC&nbsp;types: indexing pointers, arrays or\n<tt>struct</tt>/<tt>union</tt> types; reading external variables or\nconstant values; retrieving return values from C&nbsp;calls:\n</p>\n<table class=\"convtable\">\n<tr class=\"convhead\">\n<td class=\"convin\">Input</td>\n<td class=\"convop\">Conversion</td>\n<td class=\"convout\">Output</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"convin\"><tt>int8_t</tt>, <tt>int16_t</tt></td><td class=\"convop\">&rarr;<sup>sign-ext</sup> <tt>int32_t</tt> &rarr; <tt>double</tt></td><td class=\"convout\">number</td></tr>\n<tr class=\"even\">\n<td class=\"convin\"><tt>uint8_t</tt>, <tt>uint16_t</tt></td><td class=\"convop\">&rarr;<sup>zero-ext</sup> <tt>int32_t</tt> &rarr; <tt>double</tt></td><td class=\"convout\">number</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\"><tt>int32_t</tt>, <tt>uint32_t</tt></td><td class=\"convop\">&rarr; <tt>double</tt></td><td class=\"convout\">number</td></tr>\n<tr class=\"even\">\n<td class=\"convin\"><tt>int64_t</tt>, <tt>uint64_t</tt></td><td class=\"convop\">boxed value</td><td class=\"convout\">64 bit int cdata</td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\"><tt>double</tt>, <tt>float</tt></td><td class=\"convop\">&rarr; <tt>double</tt></td><td class=\"convout\">number</td></tr>\n<tr class=\"even separate\">\n<td class=\"convin\"><tt>bool</tt></td><td class=\"convop\">0 &rarr; <tt>false</tt>, otherwise <tt>true</tt></td><td class=\"convout\">boolean</td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\"><tt>enum</tt></td><td class=\"convop\">boxed value</td><td class=\"convout\">enum cdata</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Complex number</td><td class=\"convop\">boxed value</td><td class=\"convout\">complex cdata</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">Vector</td><td class=\"convop\">boxed value</td><td class=\"convout\">vector cdata</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Pointer</td><td class=\"convop\">boxed value</td><td class=\"convout\">pointer cdata</td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">Array</td><td class=\"convop\">boxed reference</td><td class=\"convout\">reference cdata</td></tr>\n<tr class=\"even\">\n<td class=\"convin\"><tt>struct</tt>/<tt>union</tt></td><td class=\"convop\">boxed reference</td><td class=\"convout\">reference cdata</td></tr>\n</table>\n<p>\nBitfields are treated like their underlying type.\n</p>\n<p>\nReference types are dereferenced <em>before</em> a conversion can take\nplace &mdash; the conversion is applied to the C&nbsp;type pointed to\nby the reference.\n</p>\n\n<h3 id=\"convert_fromlua\">Conversions from Lua objects to C&nbsp;types</h3>\n<p>\nThese conversion rules apply for <em>write accesses</em> to\nC&nbsp;types: indexing pointers, arrays or\n<tt>struct</tt>/<tt>union</tt> types; initializing cdata objects;\ncasts to C&nbsp;types; writing to external variables; passing\narguments to C&nbsp;calls:\n</p>\n<table class=\"convtable\">\n<tr class=\"convhead\">\n<td class=\"convin\">Input</td>\n<td class=\"convop\">Conversion</td>\n<td class=\"convout\">Output</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">number</td><td class=\"convop\">&rarr;</td><td class=\"convout\"><tt>double</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\">boolean</td><td class=\"convop\"><tt>false</tt> &rarr; 0, <tt>true</tt> &rarr; 1</td><td class=\"convout\"><tt>bool</tt></td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">nil</td><td class=\"convop\"><tt>NULL</tt> &rarr;</td><td class=\"convout\"><tt>(void *)</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\">lightuserdata</td><td class=\"convop\">lightuserdata address &rarr;</td><td class=\"convout\"><tt>(void *)</tt></td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">userdata</td><td class=\"convop\">userdata payload &rarr;</td><td class=\"convout\"><tt>(void *)</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\">io.* file</td><td class=\"convop\">get FILE * handle &rarr;</td><td class=\"convout\"><tt>(void *)</tt></td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">string</td><td class=\"convop\">match against <tt>enum</tt> constant</td><td class=\"convout\"><tt>enum</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\">string</td><td class=\"convop\">copy string data + zero-byte</td><td class=\"convout\"><tt>int8_t[]</tt>, <tt>uint8_t[]</tt></td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">string</td><td class=\"convop\">string data &rarr;</td><td class=\"convout\"><tt>const char[]</tt></td></tr>\n<tr class=\"even separate\">\n<td class=\"convin\">function</td><td class=\"convop\"><a href=\"#callback\">create callback</a> &rarr;</td><td class=\"convout\">C function type</td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">table</td><td class=\"convop\"><a href=\"#init_table\">table initializer</a></td><td class=\"convout\">Array</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">table</td><td class=\"convop\"><a href=\"#init_table\">table initializer</a></td><td class=\"convout\"><tt>struct</tt>/<tt>union</tt></td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">cdata</td><td class=\"convop\">cdata payload &rarr;</td><td class=\"convout\">C type</td></tr>\n</table>\n<p>\nIf the result type of this conversion doesn't match the\nC&nbsp;type of the destination, the\n<a href=\"#convert_between\">conversion rules between C&nbsp;types</a>\nare applied.\n</p>\n<p>\nReference types are immutable after initialization (\"no re-seating of\nreferences\"). For initialization purposes or when passing values to\nreference parameters, they are treated like pointers. Note that unlike\nin C++, there's no way to implement automatic reference generation of\nvariables under the Lua language semantics. If you want to call a\nfunction with a reference parameter, you need to explicitly pass a\none-element array.\n</p>\n\n<h3 id=\"convert_between\">Conversions between C&nbsp;types</h3>\n<p>\nThese conversion rules are more or less the same as the standard\nC&nbsp;conversion rules. Some rules only apply to casts, or require\npointer or type compatibility:\n</p>\n<table class=\"convtable\">\n<tr class=\"convhead\">\n<td class=\"convin\">Input</td>\n<td class=\"convop\">Conversion</td>\n<td class=\"convout\">Output</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">Signed integer</td><td class=\"convop\">&rarr;<sup>narrow or sign-extend</sup></td><td class=\"convout\">Integer</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Unsigned integer</td><td class=\"convop\">&rarr;<sup>narrow or zero-extend</sup></td><td class=\"convout\">Integer</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">Integer</td><td class=\"convop\">&rarr;<sup>round</sup></td><td class=\"convout\"><tt>double</tt>, <tt>float</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\"><tt>double</tt>, <tt>float</tt></td><td class=\"convop\">&rarr;<sup>trunc</sup> <tt>int32_t</tt> &rarr;<sup>narrow</sup></td><td class=\"convout\"><tt>(u)int8_t</tt>, <tt>(u)int16_t</tt></td></tr>\n<tr class=\"odd\">\n<td class=\"convin\"><tt>double</tt>, <tt>float</tt></td><td class=\"convop\">&rarr;<sup>trunc</sup></td><td class=\"convout\"><tt>(u)int32_t</tt>, <tt>(u)int64_t</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\"><tt>double</tt>, <tt>float</tt></td><td class=\"convop\">&rarr;<sup>round</sup></td><td class=\"convout\"><tt>float</tt>, <tt>double</tt></td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">Number</td><td class=\"convop\">n == 0 &rarr; 0, otherwise 1</td><td class=\"convout\"><tt>bool</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\"><tt>bool</tt></td><td class=\"convop\"><tt>false</tt> &rarr; 0, <tt>true</tt> &rarr; 1</td><td class=\"convout\">Number</td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">Complex number</td><td class=\"convop\">convert real part</td><td class=\"convout\">Number</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Number</td><td class=\"convop\">convert real part, imag = 0</td><td class=\"convout\">Complex number</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">Complex number</td><td class=\"convop\">convert real and imag part</td><td class=\"convout\">Complex number</td></tr>\n<tr class=\"even separate\">\n<td class=\"convin\">Number</td><td class=\"convop\">convert scalar and replicate</td><td class=\"convout\">Vector</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">Vector</td><td class=\"convop\">copy (same size)</td><td class=\"convout\">Vector</td></tr>\n<tr class=\"even separate\">\n<td class=\"convin\"><tt>struct</tt>/<tt>union</tt></td><td class=\"convop\">take base address (compat)</td><td class=\"convout\">Pointer</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">Array</td><td class=\"convop\">take base address (compat)</td><td class=\"convout\">Pointer</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Function</td><td class=\"convop\">take function address</td><td class=\"convout\">Function pointer</td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">Number</td><td class=\"convop\">convert via <tt>uintptr_t</tt> (cast)</td><td class=\"convout\">Pointer</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Pointer</td><td class=\"convop\">convert address (compat/cast)</td><td class=\"convout\">Pointer</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">Pointer</td><td class=\"convop\">convert address (cast)</td><td class=\"convout\">Integer</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Array</td><td class=\"convop\">convert base address (cast)</td><td class=\"convout\">Integer</td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">Array</td><td class=\"convop\">copy (compat)</td><td class=\"convout\">Array</td></tr>\n<tr class=\"even\">\n<td class=\"convin\"><tt>struct</tt>/<tt>union</tt></td><td class=\"convop\">copy (identical type)</td><td class=\"convout\"><tt>struct</tt>/<tt>union</tt></td></tr>\n</table>\n<p>\nBitfields or <tt>enum</tt> types are treated like their underlying\ntype.\n</p>\n<p>\nConversions not listed above will raise an error. E.g. it's not\npossible to convert a pointer to a complex number or vice versa.\n</p>\n\n<h3 id=\"convert_vararg\">Conversions for vararg C&nbsp;function arguments</h3>\n<p>\nThe following default conversion rules apply when passing Lua objects\nto the variable argument part of vararg C&nbsp;functions:\n</p>\n<table class=\"convtable\">\n<tr class=\"convhead\">\n<td class=\"convin\">Input</td>\n<td class=\"convop\">Conversion</td>\n<td class=\"convout\">Output</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">number</td><td class=\"convop\">&rarr;</td><td class=\"convout\"><tt>double</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\">boolean</td><td class=\"convop\"><tt>false</tt> &rarr; 0, <tt>true</tt> &rarr; 1</td><td class=\"convout\"><tt>bool</tt></td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\">nil</td><td class=\"convop\"><tt>NULL</tt> &rarr;</td><td class=\"convout\"><tt>(void *)</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\">userdata</td><td class=\"convop\">userdata payload &rarr;</td><td class=\"convout\"><tt>(void *)</tt></td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">lightuserdata</td><td class=\"convop\">lightuserdata address &rarr;</td><td class=\"convout\"><tt>(void *)</tt></td></tr>\n<tr class=\"even separate\">\n<td class=\"convin\">string</td><td class=\"convop\">string data &rarr;</td><td class=\"convout\"><tt>const char *</tt></td></tr>\n<tr class=\"odd separate\">\n<td class=\"convin\"><tt>float</tt> cdata</td><td class=\"convop\">&rarr;</td><td class=\"convout\"><tt>double</tt></td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Array cdata</td><td class=\"convop\">take base address</td><td class=\"convout\">Element pointer</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\"><tt>struct</tt>/<tt>union</tt> cdata</td><td class=\"convop\">take base address</td><td class=\"convout\"><tt>struct</tt>/<tt>union</tt> pointer</td></tr>\n<tr class=\"even\">\n<td class=\"convin\">Function cdata</td><td class=\"convop\">take function address</td><td class=\"convout\">Function pointer</td></tr>\n<tr class=\"odd\">\n<td class=\"convin\">Any other cdata</td><td class=\"convop\">no conversion</td><td class=\"convout\">C type</td></tr>\n</table>\n<p>\nTo pass a Lua object, other than a cdata object, as a specific type,\nyou need to override the conversion rules: create a temporary cdata\nobject with a constructor or a cast and initialize it with the value\nto pass:\n</p>\n<p>\nAssuming <tt>x</tt> is a Lua number, here's how to pass it as an\ninteger to a vararg function:\n</p>\n<pre class=\"code\">\nffi.cdef[[\nint printf(const char *fmt, ...);\n]]\nffi.C.printf(\"integer value: %d\\n\", ffi.new(\"int\", x))\n</pre>\n<p>\nIf you don't do this, the default Lua number &rarr; <tt>double</tt>\nconversion rule applies. A vararg C&nbsp;function expecting an integer\nwill see a garbled or uninitialized value.\n</p>\n\n<h2 id=\"init\">Initializers</h2>\n<p>\nCreating a cdata object with\n<a href=\"ext_ffi_api.html#ffi_new\"><tt>ffi.new()</tt></a> or the\nequivalent constructor syntax always initializes its contents, too.\nDifferent rules apply, depending on the number of optional\ninitializers and the C&nbsp;types involved:\n</p>\n<ul>\n<li>If no initializers are given, the object is filled with zero bytes.</li>\n\n<li>Scalar types (numbers and pointers) accept a single initializer.\nThe Lua object is <a href=\"#convert_fromlua\">converted to the scalar\nC&nbsp;type</a>.</li>\n\n<li>Valarrays (complex numbers and vectors) are treated like scalars\nwhen a single initializer is given. Otherwise they are treated like\nregular arrays.</li>\n\n<li>Aggregate types (arrays and structs) accept either a single cdata\ninitializer of the same type (copy constructor), a single\n<a href=\"#init_table\">table initializer</a>, or a flat list of\ninitializers.</li>\n\n<li>The elements of an array are initialized, starting at index zero.\nIf a single initializer is given for an array, it's repeated for all\nremaining elements. This doesn't happen if two or more initializers\nare given: all remaining uninitialized elements are filled with zero\nbytes.</li>\n\n<li>Byte arrays may also be initialized with a Lua string. This copies\nthe whole string plus a terminating zero-byte. The copy stops early only\nif the array has a known, fixed size.</li>\n\n<li>The fields of a <tt>struct</tt> are initialized in the order of\ntheir declaration. Uninitialized fields are filled with zero\nbytes.</li>\n\n<li>Only the first field of a <tt>union</tt> can be initialized with a\nflat initializer.</li>\n\n<li>Elements or fields which are aggregates themselves are initialized\nwith a <em>single</em> initializer, but this may be a table\ninitializer or a compatible aggregate.</li>\n\n<li>Excess initializers cause an error.</li>\n\n</ul>\n\n<h2 id=\"init_table\">Table Initializers</h2>\n<p>\nThe following rules apply if a Lua table is used to initialize an\nArray or a <tt>struct</tt>/<tt>union</tt>:\n</p>\n<ul>\n\n<li>If the table index <tt>[0]</tt> is non-<tt>nil</tt>, then the\ntable is assumed to be zero-based. Otherwise it's assumed to be\none-based.</li>\n\n<li>Array elements, starting at index zero, are initialized one-by-one\nwith the consecutive table elements, starting at either index\n<tt>[0]</tt> or <tt>[1]</tt>. This process stops at the first\n<tt>nil</tt> table element.</li>\n\n<li>If exactly one array element was initialized, it's repeated for\nall the remaining elements. Otherwise all remaining uninitialized\nelements are filled with zero bytes.</li>\n\n<li>The above logic only applies to arrays with a known fixed size.\nA VLA is only initialized with the element(s) given in the table.\nDepending on the use case, you may need to explicitly add a\n<tt>NULL</tt> or <tt>0</tt> terminator to a VLA.</li>\n\n<li>A <tt>struct</tt>/<tt>union</tt> can be initialized in the\norder of the declaration of its fields. Each field is initialized with\nconsecutive table elements, starting at either index <tt>[0]</tt>\nor <tt>[1]</tt>. This process stops at the first <tt>nil</tt> table\nelement.</li>\n\n<li>Otherwise, if neither index <tt>[0]</tt> nor <tt>[1]</tt> is present,\na <tt>struct</tt>/<tt>union</tt> is initialized by looking up each field\nname (as a string key) in the table. Each non-<tt>nil</tt> value is\nused to initialize the corresponding field.</li>\n\n<li>Uninitialized fields of a <tt>struct</tt> are filled with zero\nbytes, except for the trailing VLA of a VLS.</li>\n\n<li>Initialization of a <tt>union</tt> stops after one field has been\ninitialized. If no field has been initialized, the <tt>union</tt> is\nfilled with zero bytes.</li>\n\n<li>Elements or fields which are aggregates themselves are initialized\nwith a <em>single</em> initializer, but this may be a nested table\ninitializer (or a compatible aggregate).</li>\n\n<li>Excess initializers for an array cause an error. Excess\ninitializers for a <tt>struct</tt>/<tt>union</tt> are ignored.\nUnrelated table entries are ignored, too.</li>\n\n</ul>\n<p>\nExample:\n</p>\n<pre class=\"code\">\nlocal ffi = require(\"ffi\")\n\nffi.cdef[[\nstruct foo { int a, b; };\nunion bar { int i; double d; };\nstruct nested { int x; struct foo y; };\n]]\n\nffi.new(\"int[3]\", {})            --> 0, 0, 0\nffi.new(\"int[3]\", {1})           --> 1, 1, 1\nffi.new(\"int[3]\", {1,2})         --> 1, 2, 0\nffi.new(\"int[3]\", {1,2,3})       --> 1, 2, 3\nffi.new(\"int[3]\", {[0]=1})       --> 1, 1, 1\nffi.new(\"int[3]\", {[0]=1,2})     --> 1, 2, 0\nffi.new(\"int[3]\", {[0]=1,2,3})   --> 1, 2, 3\nffi.new(\"int[3]\", {[0]=1,2,3,4}) --> error: too many initializers\n\nffi.new(\"struct foo\", {})            --> a = 0, b = 0\nffi.new(\"struct foo\", {1})           --> a = 1, b = 0\nffi.new(\"struct foo\", {1,2})         --> a = 1, b = 2\nffi.new(\"struct foo\", {[0]=1,2})     --> a = 1, b = 2\nffi.new(\"struct foo\", {b=2})         --> a = 0, b = 2\nffi.new(\"struct foo\", {a=1,b=2,c=3}) --> a = 1, b = 2  'c' is ignored\n\nffi.new(\"union bar\", {})        --> i = 0, d = 0.0\nffi.new(\"union bar\", {1})       --> i = 1, d = ?\nffi.new(\"union bar\", {[0]=1,2}) --> i = 1, d = ?    '2' is ignored\nffi.new(\"union bar\", {d=2})     --> i = ?, d = 2.0\n\nffi.new(\"struct nested\", {1,{2,3}})     --> x = 1, y.a = 2, y.b = 3\nffi.new(\"struct nested\", {x=1,y={2,3}}) --> x = 1, y.a = 2, y.b = 3\n</pre>\n\n<h2 id=\"cdata_ops\">Operations on cdata Objects</h2>\n<p>\nAll of the standard Lua operators can be applied to cdata objects or a\nmix of a cdata object and another Lua object. The following list shows\nthe pre-defined operations.\n</p>\n<p>\nReference types are dereferenced <em>before</em> performing each of\nthe operations below &mdash; the operation is applied to the\nC&nbsp;type pointed to by the reference.\n</p>\n<p>\nThe pre-defined operations are always tried first before deferring to a\nmetamethod or index table (if any) for the corresponding ctype (except\nfor <tt>__new</tt>). An error is raised if the metamethod lookup or\nindex table lookup fails.\n</p>\n\n<h3 id=\"cdata_array\">Indexing a cdata object</h3>\n<ul>\n\n<li><b>Indexing a pointer/array</b>: a cdata pointer/array can be\nindexed by a cdata number or a Lua number. The element address is\ncomputed as the base address plus the number value multiplied by the\nelement size in bytes. A read access loads the element value and\n<a href=\"#convert_tolua\">converts it to a Lua object</a>. A write\naccess <a href=\"#convert_fromlua\">converts a Lua object to the element\ntype</a> and stores the converted value to the element. An error is\nraised if the element size is undefined or a write access to a\nconstant element is attempted.</li>\n\n<li><b>Dereferencing a <tt>struct</tt>/<tt>union</tt> field</b>: a\ncdata <tt>struct</tt>/<tt>union</tt> or a pointer to a\n<tt>struct</tt>/<tt>union</tt> can be dereferenced by a string key,\ngiving the field name. The field address is computed as the base\naddress plus the relative offset of the field. A read access loads the\nfield value and <a href=\"#convert_tolua\">converts it to a Lua\nobject</a>. A write access <a href=\"#convert_fromlua\">converts a Lua\nobject to the field type</a> and stores the converted value to the\nfield. An error is raised if a write access to a constant\n<tt>struct</tt>/<tt>union</tt> or a constant field is attempted.\nScoped enum constants or static constants are treated like a constant\nfield.</li>\n\n<li><b>Indexing a complex number</b>: a complex number can be indexed\neither by a cdata number or a Lua number with the values 0 or 1, or by\nthe strings <tt>\"re\"</tt> or <tt>\"im\"</tt>. A read access loads the\nreal part (<tt>[0]</tt>, <tt>.re</tt>) or the imaginary part\n(<tt>[1]</tt>, <tt>.im</tt>) part of a complex number and\n<a href=\"#convert_tolua\">converts it to a Lua number</a>. The\nsub-parts of a complex number are immutable &mdash; assigning to an\nindex of a complex number raises an error. Accessing out-of-bound\nindexes returns unspecified results, but is guaranteed not to trigger\nmemory access violations.</li>\n\n<li><b>Indexing a vector</b>: a vector is treated like an array for\nindexing purposes, except the vector elements are immutable &mdash;\nassigning to an index of a vector raises an error.</li>\n\n</ul>\n<p>\nA ctype object can be indexed with a string key, too. The only\npre-defined operation is reading scoped constants of\n<tt>struct</tt>/<tt>union</tt> types. All other accesses defer\nto the corresponding metamethods or index tables (if any).\n</p>\n<p>\nNote: since there's (deliberately) no address-of operator, a cdata\nobject holding a value type is effectively immutable after\ninitialization. The JIT compiler benefits from this fact when applying\ncertain optimizations.\n</p>\n<p>\nAs a consequence, the <em>elements</em> of complex numbers and\nvectors are immutable. But the elements of an aggregate holding these\ntypes <em>may</em> be modified of course. I.e. you cannot assign to\n<tt>foo.c.im</tt>, but you can assign a (newly created) complex number\nto <tt>foo.c</tt>.\n</p>\n<p>\nThe JIT compiler implements strict aliasing rules: accesses to different\ntypes do <b>not</b> alias, except for differences in signedness (this\napplies even to <tt>char</tt> pointers, unlike C99). Type punning\nthrough unions is explicitly detected and allowed.\n</p>\n\n<h3 id=\"cdata_call\">Calling a cdata object</h3>\n<ul>\n\n<li><b>Constructor</b>: a ctype object can be called and used as a\n<a href=\"ext_ffi_api.html#ffi_new\">constructor</a>. This is equivalent\nto <tt>ffi.new(ct, ...)</tt>, unless a <tt>__new</tt> metamethod is\ndefined. The <tt>__new</tt> metamethod is called with the ctype object\nplus any other arguments passed to the contructor. Note that you have to\nuse <tt>ffi.new</tt> inside of it, since calling <tt>ct(...)</tt> would\ncause infinite recursion.</li>\n\n<li><b>C&nbsp;function call</b>: a cdata function or cdata function\npointer can be called. The passed arguments are\n<a href=\"#convert_fromlua\">converted to the C&nbsp;types</a> of the\nparameters given by the function declaration. Arguments passed to the\nvariable argument part of vararg C&nbsp;function use\n<a href=\"#convert_vararg\">special conversion rules</a>. This\nC&nbsp;function is called and the return value (if any) is\n<a href=\"#convert_tolua\">converted to a Lua object</a>.<br>\nOn Windows/x86 systems, <tt>__stdcall</tt> functions are automatically\ndetected and a function declared as <tt>__cdecl</tt> (the default) is\nsilently fixed up after the first call.</li>\n\n</ul>\n\n<h3 id=\"cdata_arith\">Arithmetic on cdata objects</h3>\n<ul>\n\n<li><b>Pointer arithmetic</b>: a cdata pointer/array and a cdata\nnumber or a Lua number can be added or subtracted. The number must be\non the right hand side for a subtraction. The result is a pointer of\nthe same type with an address plus or minus the number value\nmultiplied by the element size in bytes. An error is raised if the\nelement size is undefined.</li>\n\n<li><b>Pointer difference</b>: two compatible cdata pointers/arrays\ncan be subtracted. The result is the difference between their\naddresses, divided by the element size in bytes. An error is raised if\nthe element size is undefined or zero.</li>\n\n<li><b>64&nbsp;bit integer arithmetic</b>: the standard arithmetic\noperators (<tt>+&nbsp;-&nbsp;*&nbsp;/&nbsp;%&nbsp;^</tt> and unary\nminus) can be applied to two cdata numbers, or a cdata number and a\nLua number. If one of them is an <tt>uint64_t</tt>, the other side is\nconverted to an <tt>uint64_t</tt> and an unsigned arithmetic operation\nis performed. Otherwise both sides are converted to an\n<tt>int64_t</tt> and a signed arithmetic operation is performed. The\nresult is a boxed 64&nbsp;bit cdata object.<br>\n\nIf one of the operands is an <tt>enum</tt> and the other operand is a\nstring, the string is converted to the value of a matching <tt>enum</tt>\nconstant before the above conversion.<br>\n\nThese rules ensure that 64&nbsp;bit integers are \"sticky\". Any\nexpression involving at least one 64&nbsp;bit integer operand results\nin another one. The undefined cases for the division, modulo and power\noperators return <tt>2LL&nbsp;^&nbsp;63</tt> or\n<tt>2ULL&nbsp;^&nbsp;63</tt>.<br>\n\nYou'll have to explicitly convert a 64&nbsp;bit integer to a Lua\nnumber (e.g. for regular floating-point calculations) with\n<tt>tonumber()</tt>. But note this may incur a precision loss.</li>\n\n</ul>\n\n<h3 id=\"cdata_comp\">Comparisons of cdata objects</h3>\n<ul>\n\n<li><b>Pointer comparison</b>: two compatible cdata pointers/arrays\ncan be compared. The result is the same as an unsigned comparison of\ntheir addresses. <tt>nil</tt> is treated like a <tt>NULL</tt> pointer,\nwhich is compatible with any other pointer type.</li>\n\n<li><b>64&nbsp;bit integer comparison</b>: two cdata numbers, or a\ncdata number and a Lua number can be compared with each other. If one\nof them is an <tt>uint64_t</tt>, the other side is converted to an\n<tt>uint64_t</tt> and an unsigned comparison is performed. Otherwise\nboth sides are converted to an <tt>int64_t</tt> and a signed\ncomparison is performed.<br>\n\nIf one of the operands is an <tt>enum</tt> and the other operand is a\nstring, the string is converted to the value of a matching <tt>enum</tt>\nconstant before the above conversion.<br>\n\n<li><b>Comparisons for equality/inequality</b> never raise an error.\nEven incompatible pointers can be compared for equality by address. Any\nother incompatible comparison (also with non-cdata objects) treats the\ntwo sides as unequal.</li>\n\n</ul>\n\n<h3 id=\"cdata_key\">cdata objects as table keys</h3>\n<p>\nLua tables may be indexed by cdata objects, but this doesn't provide\nany useful semantics &mdash; <b>cdata objects are unsuitable as table\nkeys!</b>\n</p>\n<p>\nA cdata object is treated like any other garbage-collected object and\nis hashed and compared by its address for table indexing. Since\nthere's no interning for cdata value types, the same value may be\nboxed in different cdata objects with different addresses. Thus\n<tt>t[1LL+1LL]</tt> and <tt>t[2LL]</tt> usually <b>do not</b> point to\nthe same hash slot and they certainly <b>do not</b> point to the same\nhash slot as <tt>t[2]</tt>.\n</p>\n<p>\nIt would seriously drive up implementation complexity and slow down\nthe common case, if one were to add extra handling for by-value\nhashing and comparisons to Lua tables. Given the ubiquity of their use\ninside the VM, this is not acceptable.\n</p>\n<p>\nThere are three viable alternatives, if you really need to use cdata\nobjects as keys:\n</p>\n<ul>\n\n<li>If you can get by with the precision of Lua numbers\n(52&nbsp;bits), then use <tt>tonumber()</tt> on a cdata number or\ncombine multiple fields of a cdata aggregate to a Lua number. Then use\nthe resulting Lua number as a key when indexing tables.<br>\nOne obvious benefit: <tt>t[tonumber(2LL)]</tt> <b>does</b> point to\nthe same slot as <tt>t[2]</tt>.</li>\n\n<li>Otherwise use either <tt>tostring()</tt> on 64&nbsp;bit integers\nor complex numbers or combine multiple fields of a cdata aggregate to\na Lua string (e.g. with\n<a href=\"ext_ffi_api.html#ffi_string\"><tt>ffi.string()</tt></a>). Then\nuse the resulting Lua string as a key when indexing tables.</li>\n\n<li>Create your own specialized hash table implementation using the\nC&nbsp;types provided by the FFI library, just like you would in\nC&nbsp;code. Ultimately this may give much better performance than the\nother alternatives or what a generic by-value hash table could\npossibly provide.</li>\n\n</ul>\n\n<h2 id=\"param\">Parameterized Types</h2>\n<p>\nTo facilitate some abstractions, the two functions\n<a href=\"ext_ffi_api.html#ffi_typeof\"><tt>ffi.typeof</tt></a> and\n<a href=\"ext_ffi_api.html#ffi_cdef\"><tt>ffi.cdef</tt></a> support\nparameterized types in C&nbsp;declarations. Note: none of the other API\nfunctions taking a cdecl allow this.\n</p>\n<p>\nAny place you can write a <b><tt>typedef</tt> name</b>, an\n<b>identifier</b> or a <b>number</b> in a declaration, you can write\n<tt>$</tt> (the dollar sign) instead. These placeholders are replaced in\norder of appearance with the arguments following the cdecl string:\n</p>\n<pre class=\"code\">\n-- Declare a struct with a parameterized field type and name:\nffi.cdef([[\ntypedef struct { $ $; } foo_t;\n]], type1, name1)\n\n-- Anonymous struct with dynamic names:\nlocal bar_t = ffi.typeof(\"struct { int $, $; }\", name1, name2)\n-- Derived pointer type:\nlocal bar_ptr_t = ffi.typeof(\"$ *\", bar_t)\n\n-- Parameterized dimensions work even where a VLA won't work:\nlocal matrix_t = ffi.typeof(\"uint8_t[$][$]\", width, height)\n</pre>\n<p>\nCaveat: this is <em>not</em> simple text substitution! A passed ctype or\ncdata object is treated like the underlying type, a passed string is\nconsidered an identifier and a number is considered a number. You must\nnot mix this up: e.g. passing <tt>\"int\"</tt> as a string doesn't work in\nplace of a type, you'd need to use <tt>ffi.typeof(\"int\")</tt> instead.\n</p>\n<p>\nThe main use for parameterized types are libraries implementing abstract\ndata types\n(<a href=\"http://www.freelists.org/post/luajit/ffi-type-of-pointer-to,8\"><span class=\"ext\">&raquo;</span>&nbsp;example</a>),\nsimilar to what can be achieved with C++ template metaprogramming.\nAnother use case are derived types of anonymous structs, which avoids\npollution of the global struct namespace.\n</p>\n<p>\nPlease note that parameterized types are a nice tool and indispensable\nfor certain use cases. But you'll want to use them sparingly in regular\ncode, e.g. when all types are actually fixed.\n</p>\n\n<h2 id=\"gc\">Garbage Collection of cdata Objects</h2>\n<p>\nAll explicitly (<tt>ffi.new()</tt>, <tt>ffi.cast()</tt> etc.) or\nimplicitly (accessors) created cdata objects are garbage collected.\nYou need to ensure to retain valid references to cdata objects\nsomewhere on a Lua stack, an upvalue or in a Lua table while they are\nstill in use. Once the last reference to a cdata object is gone, the\ngarbage collector will automatically free the memory used by it (at\nthe end of the next GC cycle).\n</p>\n<p>\nPlease note that pointers themselves are cdata objects, however they\nare <b>not</b> followed by the garbage collector. So e.g. if you\nassign a cdata array to a pointer, you must keep the cdata object\nholding the array alive as long as the pointer is still in use:\n</p>\n<pre class=\"code\">\nffi.cdef[[\ntypedef struct { int *a; } foo_t;\n]]\n\nlocal s = ffi.new(\"foo_t\", ffi.new(\"int[10]\")) -- <span style=\"color:#c00000;\">WRONG!</span>\n\nlocal a = ffi.new(\"int[10]\") -- <span style=\"color:#00a000;\">OK</span>\nlocal s = ffi.new(\"foo_t\", a)\n-- Now do something with 's', but keep 'a' alive until you're done.\n</pre>\n<p>\nSimilar rules apply for Lua strings which are implicitly converted to\n<tt>\"const&nbsp;char&nbsp;*\"</tt>: the string object itself must be\nreferenced somewhere or it'll be garbage collected eventually. The\npointer will then point to stale data, which may have already been\noverwritten. Note that <em>string literals</em> are automatically kept\nalive as long as the function containing it (actually its prototype)\nis not garbage collected.\n</p>\n<p>\nObjects which are passed as an argument to an external C&nbsp;function\nare kept alive until the call returns. So it's generally safe to\ncreate temporary cdata objects in argument lists. This is a common\nidiom for <a href=\"#convert_vararg\">passing specific C&nbsp;types to\nvararg functions</a>.\n</p>\n<p>\nMemory areas returned by C functions (e.g. from <tt>malloc()</tt>)\nmust be manually managed, of course (or use\n<a href=\"ext_ffi_api.html#ffi_gc\"><tt>ffi.gc()</tt></a>). Pointers to\ncdata objects are indistinguishable from pointers returned by C\nfunctions (which is one of the reasons why the GC cannot follow them).\n</p>\n\n<h2 id=\"callback\">Callbacks</h2>\n<p>\nThe LuaJIT FFI automatically generates special callback functions\nwhenever a Lua function is converted to a C&nbsp;function pointer. This\nassociates the generated callback function pointer with the C&nbsp;type\nof the function pointer and the Lua function object (closure).\n</p>\n<p>\nThis can happen implicitly due to the usual conversions, e.g. when\npassing a Lua function to a function pointer argument. Or you can use\n<tt>ffi.cast()</tt> to explicitly cast a Lua function to a\nC&nbsp;function pointer.\n</p>\n<p>\nCurrently only certain C&nbsp;function types can be used as callback\nfunctions. Neither C&nbsp;vararg functions nor functions with\npass-by-value aggregate argument or result types are supported. There\nare no restrictions for the kind of Lua functions that can be called\nfrom the callback &mdash; no checks for the proper number of arguments\nare made. The return value of the Lua function will be converted to the\nresult type and an error will be thrown for invalid conversions.\n</p>\n<p>\nIt's allowed to throw errors across a callback invocation, but it's not\nadvisable in general. Do this only if you know the C&nbsp;function, that\ncalled the callback, copes with the forced stack unwinding and doesn't\nleak resources.\n</p>\n<p>\nOne thing that's not allowed, is to let an FFI call into a C&nbsp;function\nget JIT-compiled, which in turn calls a callback, calling into Lua again.\nUsually this attempt is caught by the interpreter first and the\nC&nbsp;function is blacklisted for compilation.\n</p>\n<p>\nHowever, this heuristic may fail under specific circumstances: e.g. a\nmessage polling function might not run Lua callbacks right away and the call\ngets JIT-compiled. If it later happens to call back into Lua (e.g. a rarely\ninvoked error callback), you'll get a VM PANIC with the message\n<tt>\"bad callback\"</tt>. Then you'll need to manually turn off\nJIT-compilation with\n<a href=\"ext_jit.html#jit_onoff_func\"><tt>jit.off()</tt></a> for the\nsurrounding Lua function that invokes such a message polling function (or\nsimilar).\n</p>\n\n<h3 id=\"callback_resources\">Callback resource handling</h3>\n<p>\nCallbacks take up resources &mdash; you can only have a limited number\nof them at the same time (500&nbsp;-&nbsp;1000, depending on the\narchitecture). The associated Lua functions are anchored to prevent\ngarbage collection, too.\n</p>\n<p>\n<b>Callbacks due to implicit conversions are permanent!</b> There is no\nway to guess their lifetime, since the C&nbsp;side might store the\nfunction pointer for later use (typical for GUI toolkits). The associated\nresources cannot be reclaimed until termination:\n</p>\n<pre class=\"code\">\nffi.cdef[[\ntypedef int (__stdcall *WNDENUMPROC)(void *hwnd, intptr_t l);\nint EnumWindows(WNDENUMPROC func, intptr_t l);\n]]\n\n-- Implicit conversion to a callback via function pointer argument.\nlocal count = 0\nffi.C.EnumWindows(function(hwnd, l)\n  count = count + 1\n  return true\nend, 0)\n-- The callback is permanent and its resources cannot be reclaimed!\n-- Ok, so this may not be a problem, if you do this only once.\n</pre>\n<p>\nNote: this example shows that you <em>must</em> properly declare\n<tt>__stdcall</tt> callbacks on Windows/x86 systems. The calling\nconvention cannot be automatically detected, unlike for\n<tt>__stdcall</tt> calls <em>to</em> Windows functions.\n</p>\n<p>\nFor some use cases it's necessary to free up the resources or to\ndynamically redirect callbacks. Use an explicit cast to a\nC&nbsp;function pointer and keep the resulting cdata object. Then use\nthe <a href=\"ext_ffi_api.html#callback_free\"><tt>cb:free()</tt></a>\nor <a href=\"ext_ffi_api.html#callback_set\"><tt>cb:set()</tt></a> methods\non the cdata object:\n</p>\n<pre class=\"code\">\n-- Explicitly convert to a callback via cast.\nlocal count = 0\nlocal cb = ffi.cast(\"WNDENUMPROC\", function(hwnd, l)\n  count = count + 1\n  return true\nend)\n\n-- Pass it to a C function.\nffi.C.EnumWindows(cb, 0)\n-- EnumWindows doesn't need the callback after it returns, so free it.\n\ncb:free()\n-- The callback function pointer is no longer valid and its resources\n-- will be reclaimed. The created Lua closure will be garbage collected.\n</pre>\n\n<h3 id=\"callback_performance\">Callback performance</h3>\n<p>\n<b>Callbacks are slow!</b> First, the C&nbsp;to Lua transition itself\nhas an unavoidable cost, similar to a <tt>lua_call()</tt> or\n<tt>lua_pcall()</tt>. Argument and result marshalling add to that cost.\nAnd finally, neither the C&nbsp;compiler nor LuaJIT can inline or\noptimize across the language barrier and hoist repeated computations out\nof a callback function.\n</p>\n<p>\nDo not use callbacks for performance-sensitive work: e.g. consider a\nnumerical integration routine which takes a user-defined function to\nintegrate over. It's a bad idea to call a user-defined Lua function from\nC&nbsp;code millions of times. The callback overhead will be absolutely\ndetrimental for performance.\n</p>\n<p>\nIt's considerably faster to write the numerical integration routine\nitself in Lua &mdash; the JIT compiler will be able to inline the\nuser-defined function and optimize it together with its calling context,\nwith very competitive performance.\n</p>\n<p>\nAs a general guideline: <b>use callbacks only when you must</b>, because\nof existing C&nbsp;APIs. E.g. callback performance is irrelevant for a\nGUI application, which waits for user input most of the time, anyway.\n</p>\n<p>\nFor new designs <b>avoid push-style APIs</b>: a C&nbsp;function repeatedly\ncalling a callback for each result. Instead <b>use pull-style APIs</b>:\ncall a C&nbsp;function repeatedly to get a new result. Calls from Lua\nto C via the FFI are much faster than the other way round. Most well-designed\nlibraries already use pull-style APIs (read/write, get/put).\n</p>\n\n<h2 id=\"clib\">C Library Namespaces</h2>\n<p>\nA C&nbsp;library namespace is a special kind of object which allows\naccess to the symbols contained in shared libraries or the default\nsymbol namespace. The default\n<a href=\"ext_ffi_api.html#ffi_C\"><tt>ffi.C</tt></a> namespace is\nautomatically created when the FFI library is loaded. C&nbsp;library\nnamespaces for specific shared libraries may be created with the\n<a href=\"ext_ffi_api.html#ffi_load\"><tt>ffi.load()</tt></a> API\nfunction.\n</p>\n<p>\nIndexing a C&nbsp;library namespace object with a symbol name (a Lua\nstring) automatically binds it to the library. First the symbol type\nis resolved &mdash; it must have been declared with\n<a href=\"ext_ffi_api.html#ffi_cdef\"><tt>ffi.cdef</tt></a>. Then the\nsymbol address is resolved by searching for the symbol name in the\nassociated shared libraries or the default symbol namespace. Finally,\nthe resulting binding between the symbol name, the symbol type and its\naddress is cached. Missing symbol declarations or nonexistent symbol\nnames cause an error.\n</p>\n<p>\nThis is what happens on a <b>read access</b> for the different kinds of\nsymbols:\n</p>\n<ul>\n\n<li>External functions: a cdata object with the type of the function\nand its address is returned.</li>\n\n<li>External variables: the symbol address is dereferenced and the\nloaded value is <a href=\"#convert_tolua\">converted to a Lua object</a>\nand returned.</li>\n\n<li>Constant values (<tt>static&nbsp;const</tt> or <tt>enum</tt>\nconstants): the constant is <a href=\"#convert_tolua\">converted to a\nLua object</a> and returned.</li>\n\n</ul>\n<p>\nThis is what happens on a <b>write access</b>:\n</p>\n<ul>\n\n<li>External variables: the value to be written is\n<a href=\"#convert_fromlua\">converted to the C&nbsp;type</a> of the\nvariable and then stored at the symbol address.</li>\n\n<li>Writing to constant variables or to any other symbol type causes\nan error, like any other attempted write to a constant location.</li>\n\n</ul>\n<p>\nC&nbsp;library namespaces themselves are garbage collected objects. If\nthe last reference to the namespace object is gone, the garbage\ncollector will eventually release the shared library reference and\nremove all memory associated with the namespace. Since this may\ntrigger the removal of the shared library from the memory of the\nrunning process, it's generally <em>not safe</em> to use function\ncdata objects obtained from a library if the namespace object may be\nunreferenced.\n</p>\n<p>\nPerformance notice: the JIT compiler specializes to the identity of\nnamespace objects and to the strings used to index it. This\neffectively turns function cdata objects into constants. It's not\nuseful and actually counter-productive to explicitly cache these\nfunction objects, e.g. <tt>local strlen = ffi.C.strlen</tt>. OTOH it\n<em>is</em> useful to cache the namespace itself, e.g. <tt>local C =\nffi.C</tt>.\n</p>\n\n<h2 id=\"policy\">No Hand-holding!</h2>\n<p>\nThe FFI library has been designed as <b>a low-level library</b>. The\ngoal is to interface with C&nbsp;code and C&nbsp;data types with a\nminimum of overhead. This means <b>you can do anything you can do\nfrom&nbsp;C</b>: access all memory, overwrite anything in memory, call\nmachine code at any memory address and so on.\n</p>\n<p>\nThe FFI library provides <b>no memory safety</b>, unlike regular Lua\ncode. It will happily allow you to dereference a <tt>NULL</tt>\npointer, to access arrays out of bounds or to misdeclare\nC&nbsp;functions. If you make a mistake, your application might crash,\njust like equivalent C&nbsp;code would.\n</p>\n<p>\nThis behavior is inevitable, since the goal is to provide full\ninteroperability with C&nbsp;code. Adding extra safety measures, like\nbounds checks, would be futile. There's no way to detect\nmisdeclarations of C&nbsp;functions, since shared libraries only\nprovide symbol names, but no type information. Likewise there's no way\nto infer the valid range of indexes for a returned pointer.\n</p>\n<p>\nAgain: the FFI library is a low-level library. This implies it needs\nto be used with care, but it's flexibility and performance often\noutweigh this concern. If you're a C or C++ developer, it'll be easy\nto apply your existing knowledge. OTOH writing code for the FFI\nlibrary is not for the faint of heart and probably shouldn't be the\nfirst exercise for someone with little experience in Lua, C or C++.\n</p>\n<p>\nAs a corollary of the above, the FFI library is <b>not safe for use by\nuntrusted Lua code</b>. If you're sandboxing untrusted Lua code, you\ndefinitely don't want to give this code access to the FFI library or\nto <em>any</em> cdata object (except 64&nbsp;bit integers or complex\nnumbers). Any properly engineered Lua sandbox needs to provide safety\nwrappers for many of the standard Lua library functions &mdash;\nsimilar wrappers need to be written for high-level operations on FFI\ndata types, too.\n</p>\n\n<h2 id=\"status\">Current Status</h2>\n<p>\nThe initial release of the FFI library has some limitations and is\nmissing some features. Most of these will be fixed in future releases.\n</p>\n<p>\n<a href=\"#clang\">C language support</a> is\ncurrently incomplete:\n</p>\n<ul>\n<li>C&nbsp;declarations are not passed through a C&nbsp;pre-processor,\nyet.</li>\n<li>The C&nbsp;parser is able to evaluate most constant expressions\ncommonly found in C&nbsp;header files. However it doesn't handle the\nfull range of C&nbsp;expression semantics and may fail for some\nobscure constructs.</li>\n<li><tt>static const</tt> declarations only work for integer types\nup to 32&nbsp;bits. Neither declaring string constants nor\nfloating-point constants is supported.</li>\n<li>Packed <tt>struct</tt> bitfields that cross container boundaries\nare not implemented.</li>\n<li>Native vector types may be defined with the GCC <tt>mode</tt> or\n<tt>vector_size</tt> attribute. But no operations other than loading,\nstoring and initializing them are supported, yet.</li>\n<li>The <tt>volatile</tt> type qualifier is currently ignored by\ncompiled code.</li>\n<li><a href=\"ext_ffi_api.html#ffi_cdef\"><tt>ffi.cdef</tt></a> silently\nignores all re-declarations.</li>\n</ul>\n<p>\nThe JIT compiler already handles a large subset of all FFI operations.\nIt automatically falls back to the interpreter for unimplemented\noperations (you can check for this with the\n<a href=\"running.html#opt_j\"><tt>-jv</tt></a> command line option).\nThe following operations are currently not compiled and may exhibit\nsuboptimal performance, especially when used in inner loops:\n</p>\n<ul>\n<li>Bitfield accesses and initializations.</li>\n<li>Vector operations.</li>\n<li>Table initializers.</li>\n<li>Initialization of nested <tt>struct</tt>/<tt>union</tt> types.</li>\n<li>Allocations of variable-length arrays or structs.</li>\n<li>Allocations of C&nbsp;types with a size &gt; 128&nbsp;bytes or an\nalignment &gt; 8&nbsp;bytes.</li>\n<li>Conversions from lightuserdata to <tt>void&nbsp;*</tt>.</li>\n<li>Pointer differences for element sizes that are not a power of\ntwo.</li>\n<li>Calls to C&nbsp;functions with aggregates passed or returned by\nvalue.</li>\n<li>Calls to ctype metamethods which are not plain functions.</li>\n<li>ctype <tt>__newindex</tt> tables and non-string lookups in ctype\n<tt>__index</tt> tables.</li>\n<li><tt>tostring()</tt> for cdata types.</li>\n<li>Calls to <tt>ffi.cdef()</tt>, <tt>ffi.load()</tt> and\n<tt>ffi.metatype()</tt>.</li>\n</ul>\n<p>\nOther missing features:\n</p>\n<ul>\n<li>Bit operations for 64&nbsp;bit types.</li>\n<li>Arithmetic for <tt>complex</tt> numbers.</li>\n<li>Passing structs by value to vararg C&nbsp;functions.</li>\n<li><a href=\"extensions.html#exceptions\">C++ exception interoperability</a>\ndoes not extend to C&nbsp;functions called via the FFI, if the call is\ncompiled.</li>\n</ul>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/ext_ffi_tutorial.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>FFI Tutorial</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ntable.idiomtable { font-size: 90%; line-height: 1.2; }\ntable.idiomtable tt { font-size: 100%; }\ntable.idiomtable td { vertical-align: top; }\ntr.idiomhead td { font-weight: bold; }\ntd.idiomlua b { font-weight: normal; color: #2142bf; }\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>FFI Tutorial</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a class=\"current\" href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nThis page is intended to give you an overview of the features of the FFI\nlibrary by presenting a few use cases and guidelines.\n</p>\n<p>\nThis page makes no attempt to explain all of the FFI library, though.\nYou'll want to have a look at the <a href=\"ext_ffi_api.html\">ffi.* API\nfunction reference</a> and the <a href=\"ext_ffi_semantics.html\">FFI\nsemantics</a> to learn more.\n</p>\n\n<h2 id=\"load\">Loading the FFI Library</h2>\n<p>\nThe FFI library is built into LuaJIT by default, but it's not loaded\nand initialized by default. The suggested way to use the FFI library\nis to add the following to the start of every Lua file that needs one\nof its functions:\n</p>\n<pre class=\"code\">\nlocal ffi = require(\"ffi\")\n</pre>\n<p>\nPlease note this doesn't define an <tt>ffi</tt> variable in the table\nof globals &mdash; you really need to use the local variable. The\n<tt>require</tt> function ensures the library is only loaded once.\n</p>\n<p style=\"font-size: 8pt;\">\nNote: If you want to experiment with the FFI from the interactive prompt\nof the command line executable, omit the <tt>local</tt>, as it doesn't\npreserve local variables across lines.\n</p>\n\n<h2 id=\"sleep\">Accessing Standard System Functions</h2>\n<p>\nThe following code explains how to access standard system functions.\nWe slowly print two lines of dots by sleeping for 10&nbsp;milliseconds\nafter each dot:\n</p>\n<pre class=\"code mark\">\n<span class=\"codemark\">&nbsp;\n&#9312;\n\n\n\n\n\n&#9313;\n&#9314;\n&#9315;\n\n\n\n&#9316;\n\n\n\n\n\n&#9317;</span>local ffi = require(\"ffi\")\nffi.cdef[[\n<span style=\"color:#00a000;\">void Sleep(int ms);\nint poll(struct pollfd *fds, unsigned long nfds, int timeout);</span>\n]]\n\nlocal sleep\nif ffi.os == \"Windows\" then\n  function sleep(s)\n    ffi.C.Sleep(s*1000)\n  end\nelse\n  function sleep(s)\n    ffi.C.poll(nil, 0, s*1000)\n  end\nend\n\nfor i=1,160 do\n  io.write(\".\"); io.flush()\n  sleep(0.01)\nend\nio.write(\"\\n\")\n</pre>\n<p>\nHere's the step-by-step explanation:\n</p>\n<p>\n<span class=\"mark\">&#9312;</span> This defines the\nC&nbsp;library functions we're going to use. The part inside the\ndouble-brackets (in green) is just standard C&nbsp;syntax. You can\nusually get this info from the C&nbsp;header files or the\ndocumentation provided by each C&nbsp;library or C&nbsp;compiler.\n</p>\n<p>\n<span class=\"mark\">&#9313;</span> The difficulty we're\nfacing here, is that there are different standards to choose from.\nWindows has a simple <tt>Sleep()</tt> function. On other systems there\nare a variety of functions available to achieve sub-second sleeps, but\nwith no clear consensus. Thankfully <tt>poll()</tt> can be used for\nthis task, too, and it's present on most non-Windows systems. The\ncheck for <tt>ffi.os</tt> makes sure we use the Windows-specific\nfunction only on Windows systems.\n</p>\n<p>\n<span class=\"mark\">&#9314;</span> Here we're wrapping the\ncall to the C&nbsp;function in a Lua function. This isn't strictly\nnecessary, but it's helpful to deal with system-specific issues only\nin one part of the code. The way we're wrapping it ensures the check\nfor the OS is only done during initialization and not for every call.\n</p>\n<p>\n<span class=\"mark\">&#9315;</span> A more subtle point is\nthat we defined our <tt>sleep()</tt> function (for the sake of this\nexample) as taking the number of seconds, but accepting fractional\nseconds. Multiplying this by 1000 gets us milliseconds, but that still\nleaves it a Lua number, which is a floating-point value. Alas, the\n<tt>Sleep()</tt> function only accepts an integer value. Luckily for\nus, the FFI library automatically performs the conversion when calling\nthe function (truncating the FP value towards zero, like in C).\n</p>\n<p style=\"font-size: 8pt;\">\nSome readers will notice that <tt>Sleep()</tt> is part of\n<tt>KERNEL32.DLL</tt> and is also a <tt>stdcall</tt> function. So how\ncan this possibly work? The FFI library provides the <tt>ffi.C</tt>\ndefault C&nbsp;library namespace, which allows calling functions from\nthe default set of libraries, like a C&nbsp;compiler would. Also, the\nFFI library automatically detects <tt>stdcall</tt> functions, so you\ndon't need to declare them as such.\n</p>\n<p>\n<span class=\"mark\">&#9316;</span> The <tt>poll()</tt>\nfunction takes a couple more arguments we're not going to use. You can\nsimply use <tt>nil</tt> to pass a <tt>NULL</tt> pointer and <tt>0</tt>\nfor the <tt>nfds</tt> parameter. Please note that the\nnumber&nbsp;<tt>0</tt> <em>does not convert to a pointer value</em>,\nunlike in C++. You really have to pass pointers to pointer arguments\nand numbers to number arguments.\n</p>\n<p style=\"font-size: 8pt;\">\nThe page on <a href=\"ext_ffi_semantics.html\">FFI semantics</a> has all\nof the gory details about\n<a href=\"ext_ffi_semantics.html#convert\">conversions between Lua\nobjects and C&nbsp;types</a>. For the most part you don't have to deal\nwith this, as it's performed automatically and it's carefully designed\nto bridge the semantic differences between Lua and C.\n</p>\n<p>\n<span class=\"mark\">&#9317;</span> Now that we have defined\nour own <tt>sleep()</tt> function, we can just call it from plain Lua\ncode. That wasn't so bad, huh? Turning these boring animated dots into\na fascinating best-selling game is left as an exercise for the reader.\n:-)\n</p>\n\n<h2 id=\"zlib\">Accessing the zlib Compression Library</h2>\n<p>\nThe following code shows how to access the <a\nhref=\"http://zlib.net/\">zlib</a> compression library from Lua code.\nWe'll define two convenience wrapper functions that take a string and\ncompress or uncompress it to another string:\n</p>\n<pre class=\"code mark\">\n<span class=\"codemark\">&nbsp;\n&#9312;\n\n\n\n\n\n\n&#9313;\n\n\n&#9314;\n\n&#9315;\n\n\n&#9316;\n\n\n&#9317;\n\n\n\n\n\n\n\n&#9318;</span>local ffi = require(\"ffi\")\nffi.cdef[[\n<span style=\"color:#00a000;\">unsigned long compressBound(unsigned long sourceLen);\nint compress2(uint8_t *dest, unsigned long *destLen,\n\t      const uint8_t *source, unsigned long sourceLen, int level);\nint uncompress(uint8_t *dest, unsigned long *destLen,\n\t       const uint8_t *source, unsigned long sourceLen);</span>\n]]\nlocal zlib = ffi.load(ffi.os == \"Windows\" and \"zlib1\" or \"z\")\n\nlocal function compress(txt)\n  local n = zlib.compressBound(#txt)\n  local buf = ffi.new(\"uint8_t[?]\", n)\n  local buflen = ffi.new(\"unsigned long[1]\", n)\n  local res = zlib.compress2(buf, buflen, txt, #txt, 9)\n  assert(res == 0)\n  return ffi.string(buf, buflen[0])\nend\n\nlocal function uncompress(comp, n)\n  local buf = ffi.new(\"uint8_t[?]\", n)\n  local buflen = ffi.new(\"unsigned long[1]\", n)\n  local res = zlib.uncompress(buf, buflen, comp, #comp)\n  assert(res == 0)\n  return ffi.string(buf, buflen[0])\nend\n\n-- Simple test code.\nlocal txt = string.rep(\"abcd\", 1000)\nprint(\"Uncompressed size: \", #txt)\nlocal c = compress(txt)\nprint(\"Compressed size: \", #c)\nlocal txt2 = uncompress(c, #txt)\nassert(txt2 == txt)\n</pre>\n<p>\nHere's the step-by-step explanation:\n</p>\n<p>\n<span class=\"mark\">&#9312;</span> This defines some of the\nC&nbsp;functions provided by zlib. For the sake of this example, some\ntype indirections have been reduced and it uses the pre-defined\nfixed-size integer types, while still adhering to the zlib API/ABI.\n</p>\n<p>\n<span class=\"mark\">&#9313;</span> This loads the zlib shared\nlibrary. On POSIX systems it's named <tt>libz.so</tt> and usually\ncomes pre-installed. Since <tt>ffi.load()</tt> automatically adds any\nmissing standard prefixes/suffixes, we can simply load the\n<tt>\"z\"</tt> library. On Windows it's named <tt>zlib1.dll</tt> and\nyou'll have to download it first from the\n<a href=\"http://zlib.net/\"><span class=\"ext\">&raquo;</span>&nbsp;zlib site</a>. The check for\n<tt>ffi.os</tt> makes sure we pass the right name to\n<tt>ffi.load()</tt>.\n</p>\n<p>\n<span class=\"mark\">&#9314;</span> First, the maximum size of\nthe compression buffer is obtained by calling the\n<tt>zlib.compressBound</tt> function with the length of the\nuncompressed string. The next line allocates a byte buffer of this\nsize. The <tt>[?]</tt> in the type specification indicates a\nvariable-length array (VLA). The actual number of elements of this\narray is given as the 2nd argument to <tt>ffi.new()</tt>.\n</p>\n<p>\n<span class=\"mark\">&#9315;</span> This may look strange at\nfirst, but have a look at the declaration of the <tt>compress2</tt>\nfunction from zlib: the destination length is defined as a pointer!\nThis is because you pass in the maximum buffer size and get back the\nactual length that was used.\n</p>\n<p>\nIn C you'd pass in the address of a local variable\n(<tt>&amp;buflen</tt>). But since there's no address-of operator in\nLua, we'll just pass in a one-element array. Conveniently it can be\ninitialized with the maximum buffer size in one step. Calling the\nactual <tt>zlib.compress2</tt> function is then straightforward.\n</p>\n<p>\n<span class=\"mark\">&#9316;</span> We want to return the\ncompressed data as a Lua string, so we'll use <tt>ffi.string()</tt>.\nIt needs a pointer to the start of the data and the actual length. The\nlength has been returned in the <tt>buflen</tt> array, so we'll just\nget it from there.\n</p>\n<p style=\"font-size: 8pt;\">\nNote that since the function returns now, the <tt>buf</tt> and\n<tt>buflen</tt> variables will eventually be garbage collected. This\nis fine, because <tt>ffi.string()</tt> has copied the contents to a\nnewly created (interned) Lua string. If you plan to call this function\nlots of times, consider reusing the buffers and/or handing back the\nresults in buffers instead of strings. This will reduce the overhead\nfor garbage collection and string interning.\n</p>\n<p>\n<span class=\"mark\">&#9317;</span> The <tt>uncompress</tt>\nfunctions does the exact opposite of the <tt>compress</tt> function.\nThe compressed data doesn't include the size of the original string,\nso this needs to be passed in. Otherwise no surprises here.\n</p>\n<p>\n<span class=\"mark\">&#9318;</span> The code, that makes use\nof the functions we just defined, is just plain Lua code. It doesn't\nneed to know anything about the LuaJIT FFI &mdash; the convenience\nwrapper functions completely hide it.\n</p>\n<p>\nOne major advantage of the LuaJIT FFI is that you are now able to\nwrite those wrappers <em>in Lua</em>. And at a fraction of the time it\nwould cost you to create an extra C&nbsp;module using the Lua/C API.\nMany of the simpler C&nbsp;functions can probably be used directly\nfrom your Lua code, without any wrappers.\n</p>\n<p style=\"font-size: 8pt;\">\nSide note: the zlib API uses the <tt>long</tt> type for passing\nlengths and sizes around. But all those zlib functions actually only\ndeal with 32&nbsp;bit values. This is an unfortunate choice for a\npublic API, but may be explained by zlib's history &mdash; we'll just\nhave to deal with it.\n</p>\n<p style=\"font-size: 8pt;\">\nFirst, you should know that a <tt>long</tt> is a 64&nbsp;bit type e.g.\non POSIX/x64 systems, but a 32&nbsp;bit type on Windows/x64 and on\n32&nbsp;bit systems. Thus a <tt>long</tt> result can be either a plain\nLua number or a boxed 64&nbsp;bit integer cdata object, depending on\nthe target system.\n</p>\n<p style=\"font-size: 8pt;\">\nOk, so the <tt>ffi.*</tt> functions generally accept cdata objects\nwherever you'd want to use a number. That's why we get a away with\npassing <tt>n</tt> to <tt>ffi.string()</tt> above. But other Lua\nlibrary functions or modules don't know how to deal with this. So for\nmaximum portability one needs to use <tt>tonumber()</tt> on returned\n<tt>long</tt> results before passing them on. Otherwise the\napplication might work on some systems, but would fail in a POSIX/x64\nenvironment.\n</p>\n\n<h2 id=\"metatype\">Defining Metamethods for a C&nbsp;Type</h2>\n<p>\nThe following code explains how to define metamethods for a C type.\nWe define a simple point type and add some operations to it:\n</p>\n<pre class=\"code mark\">\n<span class=\"codemark\">&nbsp;\n&#9312;\n\n\n\n&#9313;\n\n&#9314;\n\n&#9315;\n\n\n\n&#9316;\n\n&#9317;</span>local ffi = require(\"ffi\")\nffi.cdef[[\n<span style=\"color:#00a000;\">typedef struct { double x, y; } point_t;</span>\n]]\n\nlocal point\nlocal mt = {\n  __add = function(a, b) return point(a.x+b.x, a.y+b.y) end,\n  __len = function(a) return math.sqrt(a.x*a.x + a.y*a.y) end,\n  __index = {\n    area = function(a) return a.x*a.x + a.y*a.y end,\n  },\n}\npoint = ffi.metatype(\"point_t\", mt)\n\nlocal a = point(3, 4)\nprint(a.x, a.y)  --> 3  4\nprint(#a)        --> 5\nprint(a:area())  --> 25\nlocal b = a + point(0.5, 8)\nprint(#b)        --> 12.5\n</pre>\n<p>\nHere's the step-by-step explanation:\n</p>\n<p>\n<span class=\"mark\">&#9312;</span> This defines the C&nbsp;type for a\ntwo-dimensional point object.\n</p>\n<p>\n<span class=\"mark\">&#9313;</span> We have to declare the variable\nholding the point constructor first, because it's used inside of a\nmetamethod.\n</p>\n<p>\n<span class=\"mark\">&#9314;</span> Let's define an <tt>__add</tt>\nmetamethod which adds the coordinates of two points and creates a new\npoint object. For simplicity, this function assumes that both arguments\nare points. But it could be any mix of objects, if at least one operand\nis of the required type (e.g. adding a point plus a number or vice\nversa). Our <tt>__len</tt> metamethod returns the distance of a point to\nthe origin.\n</p>\n<p>\n<span class=\"mark\">&#9315;</span> If we run out of operators, we can\ndefine named methods, too. Here the <tt>__index</tt> table defines an\n<tt>area</tt> function. For custom indexing needs, one might want to\ndefine <tt>__index</tt> and <tt>__newindex</tt> <em>functions</em> instead.\n</p>\n<p>\n<span class=\"mark\">&#9316;</span> This associates the metamethods with\nour C&nbsp;type. This only needs to be done once. For convenience, a\nconstructor is returned by\n<a href=\"ext_ffi_api.html#ffi_metatype\"><tt>ffi.metatype()</tt></a>.\nWe're not required to use it, though. The original C&nbsp;type can still\nbe used e.g. to create an array of points. The metamethods automatically\napply to any and all uses of this type.\n</p>\n<p>\nPlease note that the association with a metatable is permanent and\n<b>the metatable must not be modified afterwards!</b> Ditto for the\n<tt>__index</tt> table.\n</p>\n<p>\n<span class=\"mark\">&#9317;</span> Here are some simple usage examples\nfor the point type and their expected results. The pre-defined\noperations (such as <tt>a.x</tt>) can be freely mixed with the newly\ndefined metamethods. Note that <tt>area</tt> is a method and must be\ncalled with the Lua syntax for methods: <tt>a:area()</tt>, not\n<tt>a.area()</tt>.\n</p>\n<p>\nThe C&nbsp;type metamethod mechanism is most useful when used in\nconjunction with C&nbsp;libraries that are written in an object-oriented\nstyle. Creators return a pointer to a new instance and methods take an\ninstance pointer as the first argument. Sometimes you can just point\n<tt>__index</tt> to the library namespace and <tt>__gc</tt> to the\ndestructor and you're done. But often enough you'll want to add\nconvenience wrappers, e.g. to return actual Lua strings or when\nreturning multiple values.\n</p>\n<p>\nSome C libraries only declare instance pointers as an opaque\n<tt>void&nbsp;*</tt> type. In this case you can use a fake type for all\ndeclarations, e.g. a pointer to a named (incomplete) struct will do:\n<tt>typedef struct foo_type *foo_handle</tt>. The C&nbsp;side doesn't\nknow what you declare with the LuaJIT FFI, but as long as the underlying\ntypes are compatible, everything still works.\n</p>\n\n<h2 id=\"idioms\">Translating C&nbsp;Idioms</h2>\n<p>\nHere's a list of common C&nbsp;idioms and their translation to the\nLuaJIT FFI:\n</p>\n<table class=\"idiomtable\">\n<tr class=\"idiomhead\">\n<td class=\"idiomdesc\">Idiom</td>\n<td class=\"idiomc\">C&nbsp;code</td>\n<td class=\"idiomlua\">Lua code</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"idiomdesc\">Pointer dereference<br><tt>int *p;</tt></td><td class=\"idiomc\"><tt>x = *p;<br>*p = y;</tt></td><td class=\"idiomlua\"><tt>x = <b>p[0]</b><br><b>p[0]</b> = y</tt></td></tr>\n<tr class=\"even\">\n<td class=\"idiomdesc\">Pointer indexing<br><tt>int i, *p;</tt></td><td class=\"idiomc\"><tt>x = p[i];<br>p[i+1] = y;</tt></td><td class=\"idiomlua\"><tt>x = p[i]<br>p[i+1] = y</tt></td></tr>\n<tr class=\"odd\">\n<td class=\"idiomdesc\">Array indexing<br><tt>int i, a[];</tt></td><td class=\"idiomc\"><tt>x = a[i];<br>a[i+1] = y;</tt></td><td class=\"idiomlua\"><tt>x = a[i]<br>a[i+1] = y</tt></td></tr>\n<tr class=\"even separate\">\n<td class=\"idiomdesc\"><tt>struct</tt>/<tt>union</tt> dereference<br><tt>struct foo s;</tt></td><td class=\"idiomc\"><tt>x = s.field;<br>s.field = y;</tt></td><td class=\"idiomlua\"><tt>x = s.field<br>s.field = y</tt></td></tr>\n<tr class=\"odd\">\n<td class=\"idiomdesc\"><tt>struct</tt>/<tt>union</tt> pointer deref.<br><tt>struct foo *sp;</tt></td><td class=\"idiomc\"><tt>x = sp->field;<br>sp->field = y;</tt></td><td class=\"idiomlua\"><tt>x = <b>s.field</b><br><b>s.field</b> = y</tt></td></tr>\n<tr class=\"even separate\">\n<td class=\"idiomdesc\">Pointer arithmetic<br><tt>int i, *p;</tt></td><td class=\"idiomc\"><tt>x = p + i;<br>y = p - i;</tt></td><td class=\"idiomlua\"><tt>x = p + i<br>y = p - i</tt></td></tr>\n<tr class=\"odd\">\n<td class=\"idiomdesc\">Pointer difference<br><tt>int *p1, *p2;</tt></td><td class=\"idiomc\"><tt>x = p1 - p2;</tt></td><td class=\"idiomlua\"><tt>x = p1 - p2</tt></td></tr>\n<tr class=\"even\">\n<td class=\"idiomdesc\">Array element pointer<br><tt>int i, a[];</tt></td><td class=\"idiomc\"><tt>x = &amp;a[i];</tt></td><td class=\"idiomlua\"><tt>x = <b>a+i</b></tt></td></tr>\n<tr class=\"odd\">\n<td class=\"idiomdesc\">Cast pointer to address<br><tt>int *p;</tt></td><td class=\"idiomc\"><tt>x = (intptr_t)p;</tt></td><td class=\"idiomlua\"><tt>x = <b>tonumber(<br>&nbsp;ffi.cast(\"intptr_t\",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;p))</b></tt></td></tr>\n<tr class=\"even separate\">\n<td class=\"idiomdesc\">Functions with outargs<br><tt>void foo(int *inoutlen);</tt></td><td class=\"idiomc\"><tt>int len = x;<br>foo(&amp;len);<br>y = len;</tt></td><td class=\"idiomlua\"><tt><b>local len =<br>&nbsp;&nbsp;ffi.new(\"int[1]\", x)<br>foo(len)<br>y = len[0]</b></tt></td></tr>\n<tr class=\"odd\">\n<td class=\"idiomdesc\"><a href=\"ext_ffi_semantics.html#convert_vararg\">Vararg conversions</a><br><tt>int printf(char *fmt, ...);</tt></td><td class=\"idiomc\"><tt>printf(\"%g\", 1.0);<br>printf(\"%d\", 1);<br>&nbsp;</tt></td><td class=\"idiomlua\"><tt>printf(\"%g\", 1);<br>printf(\"%d\",<br>&nbsp;&nbsp;<b>ffi.new(\"int\", 1)</b>)</tt></td></tr>\n</table>\n\n<h2 id=\"cache\">To Cache or Not to Cache</h2>\n<p>\nIt's a common Lua idiom to cache library functions in local variables\nor upvalues, e.g.:\n</p>\n<pre class=\"code\">\nlocal byte, char = string.byte, string.char\nlocal function foo(x)\n  return char(byte(x)+1)\nend\n</pre>\n<p>\nThis replaces several hash-table lookups with a (faster) direct use of\na local or an upvalue. This is less important with LuaJIT, since the\nJIT compiler optimizes hash-table lookups a lot and is even able to\nhoist most of them out of the inner loops. It can't eliminate\n<em>all</em> of them, though, and it saves some typing for often-used\nfunctions. So there's still a place for this, even with LuaJIT.\n</p>\n<p>\nThe situation is a bit different with C&nbsp;function calls via the\nFFI library. The JIT compiler has special logic to eliminate <em>all\nof the lookup overhead</em> for functions resolved from a\n<a href=\"ext_ffi_semantics.html#clib\">C&nbsp;library namespace</a>!\nThus it's not helpful and actually counter-productive to cache\nindividual C&nbsp;functions like this:\n</p>\n<pre class=\"code\">\nlocal <b>funca</b>, <b>funcb</b> = ffi.C.funcb, ffi.C.funcb -- <span style=\"color:#c00000;\">Not helpful!</span>\nlocal function foo(x, n)\n  for i=1,n do <b>funcb</b>(<b>funca</b>(x, i), 1) end\nend\n</pre>\n<p>\nThis turns them into indirect calls and generates bigger and slower\nmachine code. Instead you'll want to cache the namespace itself and\nrely on the JIT compiler to eliminate the lookups:\n</p>\n<pre class=\"code\">\nlocal <b>C</b> = ffi.C          -- <span style=\"color:#00a000;\">Instead use this!</span>\nlocal function foo(x, n)\n  for i=1,n do <b>C.funcb</b>(<b>C.funca</b>(x, i), 1) end\nend\n</pre>\n<p>\nThis generates both shorter and faster code. So <b>don't cache\nC&nbsp;functions</b>, but <b>do</b> cache namespaces! Most often the\nnamespace is already in a local variable at an outer scope, e.g. from\n<tt>local&nbsp;lib&nbsp;=&nbsp;ffi.load(...)</tt>. Note that copying\nit to a local variable in the function scope is unnecessary.\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/ext_jit.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>jit.* Library</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1><tt>jit.*</tt> Library</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a class=\"current\" href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nThe functions in this built-in module control the behavior of the JIT\ncompiler engine. Note that JIT-compilation is fully automatic &mdash;\nyou probably won't need to use any of the following functions unless\nyou have special needs.\n</p>\n\n<h3 id=\"jit_onoff\"><tt>jit.on()<br>\njit.off()</tt></h3>\n<p>\nTurns the whole JIT compiler on (default) or off.\n</p>\n<p>\nThese functions are typically used with the command line options\n<tt>-j on</tt> or <tt>-j off</tt>.\n</p>\n\n<h3 id=\"jit_flush\"><tt>jit.flush()</tt></h3>\n<p>\nFlushes the whole cache of compiled code.\n</p>\n\n<h3 id=\"jit_onoff_func\"><tt>jit.on(func|true [,true|false])<br>\njit.off(func|true [,true|false])<br>\njit.flush(func|true [,true|false])</tt></h3>\n<p>\n<tt>jit.on</tt> enables JIT compilation for a Lua function (this is\nthe default).\n</p>\n<p>\n<tt>jit.off</tt> disables JIT compilation for a Lua function and\nflushes any already compiled code from the code cache.\n</p>\n<p>\n<tt>jit.flush</tt> flushes the code, but doesn't affect the\nenable/disable status.\n</p>\n<p>\nThe current function, i.e. the Lua function calling this library\nfunction, can also be specified by passing <tt>true</tt> as the first\nargument.\n</p>\n<p>\nIf the second argument is <tt>true</tt>, JIT compilation is also\nenabled, disabled or flushed recursively for all sub-functions of a\nfunction. With <tt>false</tt> only the sub-functions are affected.\n</p>\n<p>\nThe <tt>jit.on</tt> and <tt>jit.off</tt> functions only set a flag\nwhich is checked when the function is about to be compiled. They do\nnot trigger immediate compilation.\n</p>\n<p>\nTypical usage is <tt>jit.off(true, true)</tt> in the main chunk\nof a module to turn off JIT compilation for the whole module for\ndebugging purposes.\n</p>\n\n<h3 id=\"jit_flush_tr\"><tt>jit.flush(tr)</tt></h3>\n<p>\nFlushes the root trace, specified by its number, and all of its side\ntraces from the cache. The code for the trace will be retained as long\nas there are any other traces which link to it.\n</p>\n\n<h3 id=\"jit_status\"><tt>status, ... = jit.status()</tt></h3>\n<p>\nReturns the current status of the JIT compiler. The first result is\neither <tt>true</tt> or <tt>false</tt> if the JIT compiler is turned\non or off. The remaining results are strings for CPU-specific features\nand enabled optimizations.\n</p>\n\n<h3 id=\"jit_version\"><tt>jit.version</tt></h3>\n<p>\nContains the LuaJIT version string.\n</p>\n\n<h3 id=\"jit_version_num\"><tt>jit.version_num</tt></h3>\n<p>\nContains the version number of the LuaJIT core. Version xx.yy.zz\nis represented by the decimal number xxyyzz.\n</p>\n\n<h3 id=\"jit_os\"><tt>jit.os</tt></h3>\n<p>\nContains the target OS name:\n\"Windows\", \"Linux\", \"OSX\", \"BSD\", \"POSIX\" or \"Other\".\n</p>\n\n<h3 id=\"jit_arch\"><tt>jit.arch</tt></h3>\n<p>\nContains the target architecture name:\n\"x86\", \"x64\" or \"ppcspe\".\n</p>\n\n<h2 id=\"jit_opt\"><tt>jit.opt.*</tt> &mdash; JIT compiler optimization control</h2>\n<p>\nThis sub-module provides the backend for the <tt>-O</tt> command line\noption.\n</p>\n<p>\nYou can also use it programmatically, e.g.:\n</p>\n<pre class=\"code\">\njit.opt.start(2) -- same as -O2\njit.opt.start(\"-dce\")\njit.opt.start(\"hotloop=10\", \"hotexit=2\")\n</pre>\n<p>\nUnlike in LuaJIT 1.x, the module is built-in and\n<b>optimization is turned on by default!</b>\nIt's no longer necessary to run <tt>require(\"jit.opt\").start()</tt>,\nwhich was one of the ways to enable optimization.\n</p>\n\n<h2 id=\"jit_util\"><tt>jit.util.*</tt> &mdash; JIT compiler introspection</h2>\n<p>\nThis sub-module holds functions to introspect the bytecode, generated\ntraces, the IR and the generated machine code. The functionality\nprovided by this module is still in flux and therefore undocumented.\n</p>\n<p>\nThe debug modules <tt>-jbc</tt>, <tt>-jv</tt> and <tt>-jdump</tt> make\nextensive use of these functions. Please check out their source code,\nif you want to know more.\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/extensions.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>Extensions</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ntable.exc {\n  line-height: 1.2;\n}\ntr.exchead td {\n  font-weight: bold;\n}\ntd.excplatform {\n  width: 48%;\n}\ntd.exccompiler {\n  width: 29%;\n}\ntd.excinterop {\n  width: 23%;\n}\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>Extensions</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a class=\"current\" href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nLuaJIT is fully upwards-compatible with Lua 5.1. It supports all\n<a href=\"http://www.lua.org/manual/5.1/manual.html#5\"><span class=\"ext\">&raquo;</span>&nbsp;standard Lua\nlibrary functions</a> and the full set of\n<a href=\"http://www.lua.org/manual/5.1/manual.html#3\"><span class=\"ext\">&raquo;</span>&nbsp;Lua/C API\nfunctions</a>.\n</p>\n<p>\nLuaJIT is also fully ABI-compatible to Lua 5.1 at the linker/dynamic\nloader level. This means you can compile a C&nbsp;module against the\nstandard Lua headers and load the same shared library from either Lua\nor LuaJIT.\n</p>\n<p>\nLuaJIT extends the standard Lua VM with new functionality and adds\nseveral extension modules. Please note this page is only about\n<em>functional</em> enhancements and not about performance enhancements,\nsuch as the optimized VM, the faster interpreter or the JIT compiler.\n</p>\n\n<h2 id=\"modules\">Extensions Modules</h2>\n<p>\nLuaJIT comes with several built-in extension modules:\n</p>\n\n<h3 id=\"bit\"><tt>bit.*</tt> &mdash; Bitwise operations</h3>\n<p>\nLuaJIT supports all bitwise operations as defined by\n<a href=\"http://bitop.luajit.org\"><span class=\"ext\">&raquo;</span>&nbsp;Lua BitOp</a>:\n</p>\n<pre class=\"code\">\nbit.tobit  bit.tohex  bit.bnot    bit.band bit.bor  bit.bxor\nbit.lshift bit.rshift bit.arshift bit.rol  bit.ror  bit.bswap\n</pre>\n<p>\nThis module is a LuaJIT built-in &mdash; you don't need to download or\ninstall Lua BitOp. The Lua BitOp site has full documentation for all\n<a href=\"http://bitop.luajit.org/api.html\"><span class=\"ext\">&raquo;</span>&nbsp;Lua BitOp API functions</a>.\n</p>\n<p>\nPlease make sure to <tt>require</tt> the module before using any of\nits functions:\n</p>\n<pre class=\"code\">\nlocal bit = require(\"bit\")\n</pre>\n<p>\nAn already installed Lua BitOp module is ignored by LuaJIT.\nThis way you can use bit operations from both Lua and LuaJIT on a\nshared installation.\n</p>\n\n<h3 id=\"ffi\"><tt>ffi.*</tt> &mdash; FFI library</h3>\n<p>\nThe <a href=\"ext_ffi.html\">FFI library</a> allows calling external\nC&nbsp;functions and the use of C&nbsp;data structures from pure Lua\ncode.\n</p>\n\n<h3 id=\"jit\"><tt>jit.*</tt> &mdash; JIT compiler control</h3>\n<p>\nThe functions in this module\n<a href=\"ext_jit.html\">control the behavior of the JIT compiler engine</a>.\n</p>\n\n<h3 id=\"c_api\">C API extensions</h3>\n<p>\nLuaJIT adds some\n<a href=\"ext_c_api.html\">extra functions to the Lua/C API</a>.\n</p>\n\n<h2 id=\"library\">Enhanced Standard Library Functions</h2>\n\n<h3 id=\"xpcall\"><tt>xpcall(f, err [,args...])</tt> passes arguments</h3>\n<p>\nUnlike the standard implementation in Lua 5.1, <tt>xpcall()</tt>\npasses any arguments after the error function to the function\nwhich is called in a protected context.\n</p>\n\n<h3 id=\"load\"><tt>loadfile()</tt> etc. handle UTF-8 source code</h3>\n<p>\nNon-ASCII characters are handled transparently by the Lua source code parser.\nThis allows the use of UTF-8 characters in identifiers and strings.\nA UTF-8 BOM is skipped at the start of the source code.\n</p>\n\n<h3 id=\"tostring\"><tt>tostring()</tt> etc. canonicalize NaN and &plusmn;Inf</h3>\n<p>\nAll number-to-string conversions consistently convert non-finite numbers\nto the same strings on all platforms. NaN results in <tt>\"nan\"</tt>,\npositive infinity results in <tt>\"inf\"</tt> and negative infinity results\nin <tt>\"-inf\"</tt>.\n</p>\n\n<h3 id=\"tonumber\"><tt>tonumber()</tt> etc. use builtin string to number conversion</h3>\n<p>\nAll string-to-number conversions consistently convert integer and\nfloating-point inputs in decimal and hexadecimal on all platforms.\n<tt>strtod()</tt> is <em>not</em> used anymore, which avoids numerous\nproblems with poor C library implementations. The builtin conversion\nfunction provides full precision according to the IEEE-754 standard, it\nworks independently of the current locale and it supports hex floating-point\nnumbers (e.g. <tt>0x1.5p-3</tt>).\n</p>\n\n<h3 id=\"string_dump\"><tt>string.dump(f [,strip])</tt> generates portable bytecode</h3>\n<p>\nAn extra argument has been added to <tt>string.dump()</tt>. If set to\n<tt>true</tt>, 'stripped' bytecode without debug information is\ngenerated. This speeds up later bytecode loading and reduces memory\nusage. See also the\n<a href=\"running.html#opt_b\"><tt>-b</tt> command line option</a>.\n</p>\n<p>\nThe generated bytecode is portable and can be loaded on any architecture\nthat LuaJIT supports, independent of word size or endianess. However the\nbytecode compatibility versions must match. Bytecode stays compatible\nfor dot releases (x.y.0 &rarr; x.y.1), but may change with major or\nminor releases (2.0 &rarr; 2.1) or between any beta release. Foreign\nbytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded.\n</p>\n\n<h3 id=\"math_random\">Enhanced PRNG for <tt>math.random()</tt></h3>\n<p>\nLuaJIT uses a Tausworthe PRNG with period 2^223 to implement\n<tt>math.random()</tt> and <tt>math.randomseed()</tt>. The quality of\nthe PRNG results is much superior compared to the standard Lua\nimplementation which uses the platform-specific ANSI rand().\n</p>\n<p>\nThe PRNG generates the same sequences from the same seeds on all\nplatforms and makes use of all bits in the seed argument.\n<tt>math.random()</tt> without arguments generates 52 pseudo-random bits\nfor every call. The result is uniformly distributed between 0.0 and 1.0.\nIt's correctly scaled up and rounded for <tt>math.random(n&nbsp;[,m])</tt> to\npreserve uniformity.\n</p>\n\n<h3 id=\"io\"><tt>io.*</tt> functions handle 64&nbsp;bit file offsets</h3>\n<p>\nThe file I/O functions in the standard <tt>io.*</tt> library handle\n64&nbsp;bit file offsets. In particular this means it's possible\nto open files larger than 2&nbsp;Gigabytes and to reposition or obtain\nthe current file position for offsets beyond 2&nbsp;GB\n(<tt>fp:seek()</tt> method).\n</p>\n\n<h3 id=\"debug_meta\"><tt>debug.*</tt> functions identify metamethods</h3>\n<p>\n<tt>debug.getinfo()</tt> and <tt>lua_getinfo()</tt> also return information\nabout invoked metamethods. The <tt>namewhat</tt> field is set to\n<tt>\"metamethod\"</tt> and the <tt>name</tt> field has the name of\nthe corresponding metamethod (e.g. <tt>\"__index\"</tt>).\n</p>\n\n<h2 id=\"resumable\">Fully Resumable VM</h2>\n<p>\nThe LuaJIT VM is fully resumable. This means you can yield from a\ncoroutine even across contexts, where this would not possible with\nthe standard Lua&nbsp;5.1 VM: e.g. you can yield across <tt>pcall()</tt>\nand <tt>xpcall()</tt>, across iterators and across metamethods.\n</p>\n\n<h2 id=\"lua52\">Extensions from Lua 5.2</h2>\n<p>\nLuaJIT supports some language and library extensions from Lua&nbsp;5.2.\nFeatures that are unlikely to break existing code are unconditionally\nenabled:\n</p>\n<ul>\n<li><tt>goto</tt> and <tt>::labels::</tt>.</li>\n<li>Hex escapes <tt>'\\x3F'</tt> and <tt>'\\*'</tt> escape in strings.</li>\n<li><tt>load(string|reader, chunkname [,mode [,env]])</tt>.\n<tt>loadstring()</tt> is an alias.</li>\n<li><tt>math.log(x [,base])</tt>.\n<li><tt>string.rep(s, n [,sep])</tt>.\n<li><tt>string.format()</tt>: <tt>%q</tt> reversible.\n<tt>%s</tt> checks <tt>__tostring</tt>.\n<tt>%a</tt> and <tt>\"%A</tt> added.</li>\n<li>String matching pattern <tt>%g</tt> added.</li>\n<li><tt>io.read(\"*L\")</tt>.</li>\n<li><tt>io.lines()</tt> and <tt>file:lines()</tt> process\n<tt>io.read()</tt> options.</li>\n<li><tt>os.exit(status|true|false [,close])</tt>.</li>\n<li><tt>package.searchpath(name, path [, sep [, rep]])</tt>.</li>\n<li><tt>package.loadlib(name, \"*\")</tt>.</li>\n<li><tt>debug.getinfo()</tt> returns <tt>nparams</tt> and <tt>isvararg</tt>\nfor option <tt>\"u\"</tt>.</li>\n<li><tt>debug.getlocal()</tt> accepts function instead of level.</li>\n<li><tt>debug.getlocal()</tt> and <tt>debug.setlocal()</tt> accept negative\nindexes for varargs.</li>\n<li><tt>debug.getupvalue()</tt> and <tt>debug.setupvalue()</tt> handle\nC&nbsp;functions.</li>\n<li><tt>debug.upvalueid()</tt> and <tt>debug.upvaluejoin()</tt>.</li>\n<li>Command line option <tt>-E</tt>.</li>\n<li>Command line checks <tt>__tostring</tt> for errors.</li>\n</ul>\n<p>\nOther features are only enabled, if LuaJIT is built with\n<tt>-DLUAJIT_ENABLE_LUA52COMPAT</tt>:\n</p>\n<ul>\n<li><tt>goto</tt> is a keyword and not a valid variable name anymore.</li>\n<li><tt>break</tt> can be placed anywhere. Empty statements (<tt>;;</tt>)\nare allowed.</li>\n<li><tt>__lt</tt>, <tt>__le</tt> are invoked for mixed types.</li>\n<li><tt>__len</tt> for tables. <tt>rawlen()</tt> library function.</li>\n<li><tt>pairs()</tt> and <tt>ipairs()</tt> check for <tt>__pairs</tt> and\n<tt>__ipairs</tt>.</li>\n<li><tt>coroutine.running()</tt> returns two results.</li>\n<li><tt>table.pack()</tt> and <tt>table.unpack()</tt>\n(same as <tt>unpack()</tt>).</li>\n<li><tt>io.write()</tt> and <tt>file:write()</tt> return file handle\ninstead of <tt>true</tt>.</li>\n<li><tt>os.execute()</tt> and <tt>pipe:close()</tt> return detailed\nexit status.</li>\n<li><tt>debug.setmetatable()</tt> returns object.</li>\n<li><tt>debug.getuservalue()</tt> and <tt>debug.setuservalue()</tt>.</li>\n<li>Remove <tt>math.mod()</tt>, <tt>string.gfind()</tt>.\n</ul>\n<p>\nNote: this provides only partial compatibility with Lua 5.2 at the\nlanguage and Lua library level. LuaJIT is API+ABI-compatible with\nLua&nbsp;5.1, which prevents implementing features that would otherwise\nbreak the Lua/C API and ABI (e.g. <tt>_ENV</tt>).\n</p>\n\n<h2 id=\"exceptions\">C++ Exception Interoperability</h2>\n<p>\nLuaJIT has built-in support for interoperating with C++&nbsp;exceptions.\nThe available range of features depends on the target platform and\nthe toolchain used to compile LuaJIT:\n</p>\n<table class=\"exc\">\n<tr class=\"exchead\">\n<td class=\"excplatform\">Platform</td>\n<td class=\"exccompiler\">Compiler</td>\n<td class=\"excinterop\">Interoperability</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"excplatform\">POSIX/x64, DWARF2 unwinding</td>\n<td class=\"exccompiler\">GCC 4.3+</td>\n<td class=\"excinterop\"><b style=\"color: #00a000;\">Full</b></td>\n</tr>\n<tr class=\"even\">\n<td class=\"excplatform\">Other platforms, DWARF2 unwinding</td>\n<td class=\"exccompiler\">GCC</td>\n<td class=\"excinterop\"><b style=\"color: #c06000;\">Limited</b></td>\n</tr>\n<tr class=\"odd\">\n<td class=\"excplatform\">Windows/x64</td>\n<td class=\"exccompiler\">MSVC or WinSDK</td>\n<td class=\"excinterop\"><b style=\"color: #00a000;\">Full</b></td>\n</tr>\n<tr class=\"even\">\n<td class=\"excplatform\">Windows/x86</td>\n<td class=\"exccompiler\">Any</td>\n<td class=\"excinterop\"><b style=\"color: #a00000;\">No</b></td>\n</tr>\n<tr class=\"odd\">\n<td class=\"excplatform\">Other platforms</td>\n<td class=\"exccompiler\">Other compilers</td>\n<td class=\"excinterop\"><b style=\"color: #a00000;\">No</b></td>\n</tr>\n</table>\n<p>\n<b style=\"color: #00a000;\">Full interoperability</b> means:\n</p>\n<ul>\n<li>C++&nbsp;exceptions can be caught on the Lua side with <tt>pcall()</tt>,\n<tt>lua_pcall()</tt> etc.</li>\n<li>C++&nbsp;exceptions will be converted to the generic Lua error\n<tt>\"C++&nbsp;exception\"</tt>, unless you use the\n<a href=\"ext_c_api.html#mode_wrapcfunc\">C&nbsp;call wrapper</a> feature.</li>\n<li>It's safe to throw C++&nbsp;exceptions across non-protected Lua frames\non the C&nbsp;stack. The contents of the C++&nbsp;exception object\npass through unmodified.</li>\n<li>Lua errors can be caught on the C++ side with <tt>catch(...)</tt>.\nThe corresponding Lua error message can be retrieved from the Lua stack.</li>\n<li>Throwing Lua errors across C++ frames is safe. C++ destructors\nwill be called.</li>\n</ul>\n<p>\n<b style=\"color: #c06000;\">Limited interoperability</b> means:\n</p>\n<ul>\n<li>C++&nbsp;exceptions can be caught on the Lua side with <tt>pcall()</tt>,\n<tt>lua_pcall()</tt> etc.</li>\n<li>C++&nbsp;exceptions will be converted to the generic Lua error\n<tt>\"C++&nbsp;exception\"</tt>, unless you use the\n<a href=\"ext_c_api.html#mode_wrapcfunc\">C&nbsp;call wrapper</a> feature.</li>\n<li>C++&nbsp;exceptions will be caught by non-protected Lua frames and\nare rethrown as a generic Lua error. The C++&nbsp;exception object will\nbe destroyed.</li>\n<li>Lua errors <b>cannot</b> be caught on the C++ side.</li>\n<li>Throwing Lua errors across C++ frames will <b>not</b> call\nC++ destructors.</li>\n</ul>\n\n<p>\n<b style=\"color: #a00000;\">No interoperability</b> means:\n</p>\n<ul>\n<li>It's <b>not</b> safe to throw C++&nbsp;exceptions across Lua frames.</li>\n<li>C++&nbsp;exceptions <b>cannot</b> be caught on the Lua side.</li>\n<li>Lua errors <b>cannot</b> be caught on the C++ side.</li>\n<li>Throwing Lua errors across C++ frames will <b>not</b> call\nC++ destructors.</li>\n<li>Additionally, on Windows/x86 with SEH-based C++&nbsp;exceptions:\nit's <b>not</b> safe to throw a Lua error across any frames containing\na C++ function with any try/catch construct or using variables with\n(implicit) destructors. This also applies to any functions which may be\ninlined in such a function. It doesn't matter whether <tt>lua_error()</tt>\nis called inside or outside of a try/catch or whether any object actually\nneeds to be destroyed: the SEH chain is corrupted and this will eventually\nlead to the termination of the process.</li>\n</ul>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/faq.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>Frequently Asked Questions (FAQ)</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ndd { margin-left: 1.5em; }\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>Frequently Asked Questions (FAQ)</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a class=\"current\" href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<dl>\n<dt>Q: Where can I learn more about LuaJIT and Lua?</dt>\n<dd>\n<ul style=\"padding: 0;\">\n<li>The <a href=\"http://luajit.org/list.html\"><span class=\"ext\">&raquo;</span>&nbsp;LuaJIT mailing list</a> focuses on topics\nrelated to LuaJIT.</li>\n<li>The <a href=\"http://wiki.luajit.org/\"><span class=\"ext\">&raquo;</span>&nbsp;LuaJIT wiki</a> gathers community\nresources about LuaJIT.</li>\n<li>News about Lua itself can be found at the\n<a href=\"http://www.lua.org/lua-l.html\"><span class=\"ext\">&raquo;</span>&nbsp;Lua mailing list</a>.\nThe mailing list archives are worth checking out for older postings\nabout LuaJIT.</li>\n<li>The <a href=\"http://lua.org\"><span class=\"ext\">&raquo;</span>&nbsp;main Lua.org site</a> has complete\n<a href=\"http://www.lua.org/docs.html\"><span class=\"ext\">&raquo;</span>&nbsp;documentation</a> of the language\nand links to books and papers about Lua.</li>\n<li>The community-managed <a href=\"http://lua-users.org/wiki/\"><span class=\"ext\">&raquo;</span>&nbsp;Lua Wiki</a>\nhas information about diverse topics.</li>\n</ul>\n</dl>\n\n<dl>\n<dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt>\n<dd>\nI'm planning to write more documentation about the internals of LuaJIT.\nIn the meantime, please use the following Google Scholar searches\nto find relevant papers:<br>\nSearch for: <a href=\"http://scholar.google.com/scholar?q=Trace+Compiler\"><span class=\"ext\">&raquo;</span>&nbsp;Trace Compiler</a><br>\nSearch for: <a href=\"http://scholar.google.com/scholar?q=JIT+Compiler\"><span class=\"ext\">&raquo;</span>&nbsp;JIT Compiler</a><br>\nSearch for: <a href=\"http://scholar.google.com/scholar?q=Dynamic+Language+Optimizations\"><span class=\"ext\">&raquo;</span>&nbsp;Dynamic Language Optimizations</a><br>\nSearch for: <a href=\"http://scholar.google.com/scholar?q=SSA+Form\"><span class=\"ext\">&raquo;</span>&nbsp;SSA Form</a><br>\nSearch for: <a href=\"http://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation\"><span class=\"ext\">&raquo;</span>&nbsp;Linear Scan Register Allocation</a><br>\nHere is a list of the <a href=\"http://article.gmane.org/gmane.comp.lang.lua.general/58908\"><span class=\"ext\">&raquo;</span>&nbsp;innovative features in LuaJIT</a>.<br>\nAnd, you know, reading the source is of course the only way to enlightenment. :-)\n</dd>\n</dl>\n\n<dl>\n<dt>Q: Why do I get this error: \"attempt to index global 'arg' (a nil value)\"?<br>\nQ: My vararg functions fail after switching to LuaJIT!</dt>\n<dd>LuaJIT is compatible to the Lua 5.1 language standard. It doesn't\nsupport the implicit <tt>arg</tt> parameter for old-style vararg\nfunctions from Lua 5.0.<br>Please convert your code to the\n<a href=\"http://www.lua.org/manual/5.1/manual.html#2.5.9\"><span class=\"ext\">&raquo;</span>&nbsp;Lua 5.1\nvararg syntax</a>.</dd>\n</dl>\n\n<dl>\n<dt>Q: Why do I get this error: \"bad FPU precision\"?<br>\n<dt>Q: I get weird behavior after initializing Direct3D.<br>\n<dt>Q: Some FPU operations crash after I load a Delphi DLL.<br>\n</dt>\n<dd>\n\nDirectX/Direct3D (up to version 9) sets the x87 FPU to single-precision\nmode by default. This violates the Windows ABI and interferes with the\noperation of many programs &mdash; LuaJIT is affected, too. Please make\nsure you always use the <tt>D3DCREATE_FPU_PRESERVE</tt> flag when\ninitializing Direct3D.<br>\n\nDirect3D version 10 or higher do not show this behavior anymore.\nConsider testing your application with older versions, too.<br>\n\nSimilarly, the Borland/Delphi runtime modifies the FPU control word and\nenables FP exceptions. Of course this violates the Windows ABI, too.\nPlease check the Delphi docs for the Set8087CW method.\n\n</dl>\n\n<dl>\n<dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt>\n<dd>The interrupt signal handler sets a Lua debug hook. But this is\ncurrently ignored by compiled code (this will eventually be fixed). If\nyour program is running in a tight loop and never falls back to the\ninterpreter, the debug hook never runs and can't throw the\n\"interrupted!\" error.<br> In the meantime you have to press Ctrl-C\ntwice to get stop your program. That's similar to when it's stuck\nrunning inside a C function under the Lua interpreter.</dd>\n</dl>\n\n<dl>\n<dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt>\n<dd>Because it's a completely redesigned VM and has very little code\nin common with Lua anymore. Also, if the patch introduces changes to\nthe Lua semantics, these would need to be reflected everywhere in the\nVM, from the interpreter up to all stages of the compiler.<br> Please\nuse only standard Lua language constructs. For many common needs you\ncan use source transformations or use wrapper or proxy functions.\nThe compiler will happily optimize away such indirections.</dd>\n</dl>\n\n<dl>\n<dt>Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?</dt>\n<dd>Because it's a compiler &mdash; it needs to generate native\nmachine code. This means the code generator must be ported to each\narchitecture. And the fast interpreter is written in assembler and\nmust be ported, too. This is quite an undertaking.<br>\nThe <a href=\"install.html\">install documentation</a> shows the supported\narchitectures. Other architectures will follow based on sufficient user\ndemand and/or sponsoring.</dd>\n</dl>\n\n<dl>\n<dt>Q: When will feature X be added? When will the next version be released?</dt>\n<dd>When it's ready.<br>\nC'mon, it's open source &mdash; I'm doing it on my own time and you're\ngetting it for free. You can either contribute a patch or sponsor\nthe development of certain features, if they are important to you.\n</dd>\n</dl>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/install.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>Installation</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ntable.compat {\n  line-height: 1.2;\n  font-size: 80%;\n}\ntable.compat td {\n  border: 1px solid #bfcfff;\n  height: 2.5em;\n}\ntable.compat tr.compathead td {\n  font-weight: bold;\n  border-bottom: 2px solid #bfcfff;\n}\ntr.compathead td.compatos {\n  vertical-align: top;\n}\ntable.compat td.compatcpu {\n  width: 18%;\n  border-right: 2px solid #bfcfff;\n}\ntd.compatos {\n  width: 21%;\n  vertical-align: middle;\n}\ntd.compatno {\n  background-color: #d0d0d0;\n}\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>Installation</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a class=\"current\" href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nLuaJIT is only distributed as a source package. This page explains\nhow to build and install LuaJIT with different operating systems\nand C&nbsp;compilers.\n</p>\n<p>\nFor the impatient (on POSIX systems):\n</p>\n<pre class=\"code\">\nmake &amp;&amp; sudo make install\n</pre>\n<p>\nLuaJIT currently builds out-of-the box on most systems.\nHere's the compatibility matrix for the supported combinations of\noperating systems, CPUs and compilers:\n</p>\n<table class=\"compat\">\n<tr class=\"compathead\">\n<td class=\"compatcpu\">CPU / OS</td>\n<td class=\"compatos\"><a href=\"#posix\">Linux</a> or<br><a href=\"#android\">Android</a></td>\n<td class=\"compatos\"><a href=\"#posix\">*BSD, Other</a></td>\n<td class=\"compatos\"><a href=\"#posix\">OSX 10.4+</a> or<br><a href=\"#ios\">iOS 3.0+</a></td>\n<td class=\"compatos\"><a href=\"#windows\">Windows<br>XP/Vista/7</a></td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"compatcpu\">x86 (32 bit)</td>\n<td class=\"compatos\">GCC 4.x<br>GCC 3.4</td>\n<td class=\"compatos\">GCC 4.x<br>GCC 3.4</td>\n<td class=\"compatos\">GCC 4.x<br>GCC 3.4</td>\n<td class=\"compatos\">MSVC, MSVC/EE<br>WinSDK<br>MinGW, Cygwin</td>\n</tr>\n<tr class=\"even\">\n<td class=\"compatcpu\">x64 (64 bit)</td>\n<td class=\"compatos\">GCC 4.x</td>\n<td class=\"compatos compatno\">&nbsp;</td>\n<td class=\"compatos\">GCC 4.x</td>\n<td class=\"compatos\">MSVC + SDK v7.0<br>WinSDK v7.0</td>\n</tr>\n<tr class=\"odd\">\n<td class=\"compatcpu\"><a href=\"#cross2\">ARMv5+<br>ARM9E+</a></td>\n<td class=\"compatos\">GCC 4.2+</td>\n<td class=\"compatos\">GCC 4.2+</td>\n<td class=\"compatos\">GCC 4.2+</td>\n<td class=\"compatos compatno\">&nbsp;</td>\n</tr>\n<tr class=\"even\">\n<td class=\"compatcpu\"><a href=\"#cross2\">PPC</a></td>\n<td class=\"compatos\">GCC 4.3+</td>\n<td class=\"compatos\">GCC 4.3+<br>GCC 4.1 (<a href=\"#ps3\">PS3</a>)</td>\n<td class=\"compatos compatno\">&nbsp;</td>\n<td class=\"compatos\">XEDK (<a href=\"#xbox360\">Xbox 360</a>)</td>\n</tr>\n<tr class=\"odd\">\n<td class=\"compatcpu\"><a href=\"#cross2\">PPC/e500v2</a></td>\n<td class=\"compatos\">GCC 4.3+</td>\n<td class=\"compatos\">GCC 4.3+</td>\n<td class=\"compatos compatno\">&nbsp;</td>\n<td class=\"compatos compatno\">&nbsp;</td>\n</tr>\n<tr class=\"even\">\n<td class=\"compatcpu\"><a href=\"#cross2\">MIPS</a></td>\n<td class=\"compatos\">GCC 4.3+</td>\n<td class=\"compatos\">GCC 4.3+</td>\n<td class=\"compatos compatno\">&nbsp;</td>\n<td class=\"compatos compatno\">&nbsp;</td>\n</tr>\n</table>\n\n<h2>Configuring LuaJIT</h2>\n<p>\nThe standard configuration should work fine for most installations.\nUsually there is no need to tweak the settings. The following files\nhold all user-configurable settings:\n</p>\n<ul>\n<li><tt>src/luaconf.h</tt> sets some configuration variables.</li>\n<li><tt>Makefile</tt> has settings for <b>installing</b> LuaJIT (POSIX\nonly).</li>\n<li><tt>src/Makefile</tt> has settings for <b>compiling</b> LuaJIT\nunder POSIX, MinGW or Cygwin.</li>\n<li><tt>src/msvcbuild.bat</tt> has settings for compiling LuaJIT with\nMSVC or WinSDK.</li>\n</ul>\n<p>\nPlease read the instructions given in these files, before changing\nany settings.\n</p>\n\n<h2 id=\"posix\">POSIX Systems (Linux, OSX, *BSD etc.)</h2>\n<h3>Prerequisites</h3>\n<p>\nDepending on your distribution, you may need to install a package for\nGCC, the development headers and/or a complete SDK. E.g. on a current\nDebian/Ubuntu, install <tt>libc6-dev</tt> with the package manager.\n</p>\n<p>\nDownload the current source package of LuaJIT (pick the .tar.gz),\nif you haven't already done so. Move it to a directory of your choice,\nopen a terminal window and change to this directory. Now unpack the archive\nand change to the newly created directory:\n</p>\n<pre class=\"code\">\ntar zxf LuaJIT-2.0.1.tar.gz\ncd LuaJIT-2.0.1</pre>\n<h3>Building LuaJIT</h3>\n<p>\nThe supplied Makefiles try to auto-detect the settings needed for your\noperating system and your compiler. They need to be run with GNU Make,\nwhich is probably the default on your system, anyway. Simply run:\n</p>\n<pre class=\"code\">\nmake\n</pre>\n<p>\nThis always builds a native x86, x64 or PPC binary, depending on the host OS\nyou're running this command on. Check the section on\n<a href=\"#cross\">cross-compilation</a> for more options.\n</p>\n<p>\nBy default, modules are only searched under the prefix <tt>/usr/local</tt>.\nYou can add an extra prefix to the search paths by appending the\n<tt>PREFIX</tt> option, e.g.:\n</p>\n<pre class=\"code\">\nmake PREFIX=/home/myself/lj2\n</pre>\n<p>\nNote for OSX: if the <tt>MACOSX_DEPLOYMENT_TARGET</tt> environment\nvariable is not set, then it's forced to <tt>10.4</tt>.\n</p>\n<h3>Installing LuaJIT</h3>\n<p>\nThe top-level Makefile installs LuaJIT by default under\n<tt>/usr/local</tt>, i.e. the executable ends up in\n<tt>/usr/local/bin</tt> and so on. You need root privileges\nto write to this path. So, assuming sudo is installed on your system,\nrun the following command and enter your sudo password:\n</p>\n<pre class=\"code\">\nsudo make install\n</pre>\n<p>\nOtherwise specify the directory prefix as an absolute path, e.g.:\n</p>\n<pre class=\"code\">\nmake install PREFIX=/home/myself/lj2\n</pre>\n<p>\nObviously the prefixes given during build and installation need to be the same.\n</p>\n\n<h2 id=\"windows\">Windows Systems</h2>\n<h3>Prerequisites</h3>\n<p>\nEither install one of the open source SDKs\n(<a href=\"http://mingw.org/\"><span class=\"ext\">&raquo;</span>&nbsp;MinGW</a> or\n<a href=\"http://www.cygwin.com/\"><span class=\"ext\">&raquo;</span>&nbsp;Cygwin</a>), which come with a modified\nGCC plus the required development headers.\n</p>\n<p>\nOr install Microsoft's Visual C++ (MSVC). The freely downloadable\n<a href=\"http://www.microsoft.com/Express/VC/\"><span class=\"ext\">&raquo;</span>&nbsp;Express Edition</a>\nworks just fine, but only contains an x86 compiler.\n</p>\n<p>\nThe freely downloadable\n<a href=\"http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx\"><span class=\"ext\">&raquo;</span>&nbsp;Windows SDK</a>\nonly comes with command line tools, but this is all you need to build LuaJIT.\nIt contains x86 and x64 compilers.\n</p>\n<p>\nNext, download the source package and unpack it using an archive manager\n(e.g. the Windows Explorer) to a directory of your choice.\n</p>\n<h3>Building with MSVC</h3>\n<p>\nOpen a \"Visual Studio .NET Command Prompt\", <tt>cd</tt> to the\ndirectory where you've unpacked the sources and run these commands:\n</p>\n<pre class=\"code\">\ncd src\nmsvcbuild\n</pre>\n<p>\nThen follow the installation instructions below.\n</p>\n<h3>Building with the Windows SDK</h3>\n<p>\nOpen a \"Windows SDK Command Shell\" and select the x86 compiler:\n</p>\n<pre class=\"code\">\nsetenv /release /x86\n</pre>\n<p>\nOr select the x64 compiler:\n</p>\n<pre class=\"code\">\nsetenv /release /x64\n</pre>\n<p>\nThen <tt>cd</tt> to the directory where you've unpacked the sources\nand run these commands:\n</p>\n<pre class=\"code\">\ncd src\nmsvcbuild\n</pre>\n<p>\nThen follow the installation instructions below.\n</p>\n<h3>Building with MinGW or Cygwin</h3>\n<p>\nOpen a command prompt window and make sure the MinGW or Cygwin programs\nare in your path. Then <tt>cd</tt> to the directory where\nyou've unpacked the sources and run this command for MinGW:\n</p>\n<pre class=\"code\">\nmingw32-make\n</pre>\n<p>\nOr this command for Cygwin:\n</p>\n<pre class=\"code\">\nmake\n</pre>\n<p>\nThen follow the installation instructions below.\n</p>\n<h3>Installing LuaJIT</h3>\n<p>\nCopy <tt>luajit.exe</tt> and <tt>lua51.dll</tt> (built in the <tt>src</tt>\ndirectory) to a newly created directory (any location is ok).\nAdd <tt>lua</tt> and <tt>lua\\jit</tt> directories below it and copy\nall Lua files from the <tt>src\\jit</tt> directory of the distribution\nto the latter directory.\n</p>\n<p>\nThere are no hardcoded\nabsolute path names &mdash; all modules are loaded relative to the\ndirectory where <tt>luajit.exe</tt> is installed\n(see <tt>src/luaconf.h</tt>).\n</p>\n\n<h2 id=\"cross\">Cross-compiling LuaJIT</h2>\n<p>\nThe GNU Makefile-based build system allows cross-compiling on any host\nfor any supported target, as long as both architectures have the same\npointer size. If you want to cross-compile to any 32 bit target on an\nx64 OS, you need to install the multilib development package (e.g.\n<tt>libc6-dev-i386</tt> on Debian/Ubuntu) and build a 32 bit host part\n(<tt>HOST_CC=\"gcc -m32\"</tt>).\n</p>\n<p>\nYou need to specify <tt>TARGET_SYS</tt> whenever the host OS and the\ntarget OS differ, or you'll get assembler or linker errors. E.g. if\nyou're compiling on a Windows or OSX host for embedded Linux or Android,\nyou need to add <tt>TARGET_SYS=Linux</tt> to the examples below. For a\nminimal target OS, you may need to disable the built-in allocator in\n<tt>src/Makefile</tt> and use <tt>TARGET_SYS=Other</tt>. The examples\nbelow only show some popular targets &mdash; please check the comments\nin <tt>src/Makefile</tt> for more details.\n</p>\n<pre class=\"code\">\n# Cross-compile to a 32 bit binary on a multilib x64 OS\nmake CC=\"gcc -m32\"\n\n# Cross-compile on Debian/Ubuntu for Windows (mingw32 package)\nmake HOST_CC=\"gcc -m32\" CROSS=i586-mingw32msvc- TARGET_SYS=Windows\n</pre>\n<p id=\"cross2\">\nThe <tt>CROSS</tt> prefix allows specifying a standard GNU cross-compile\ntoolchain (Binutils, GCC and a matching libc). The prefix may vary\ndepending on the <tt>--target</tt> the toolchain was built for (note the\n<tt>CROSS</tt> prefix has a trailing <tt>\"-\"</tt>). The examples below\nuse the canonical toolchain triplets for Linux.\n</p>\n<p>\nSince there's often no easy way to detect CPU features at runtime, it's\nimportant to compile with the proper CPU or architecture settings. You\ncan specify these when building the toolchain yourself. Or add\n<tt>-mcpu=...</tt> or <tt>-march=...</tt> to <tt>TARGET_CFLAGS</tt>. For\nARM it's important to have the correct <tt>-mfloat-abi=...</tt> setting,\ntoo. Otherwise LuaJIT may not run at the full performance of your target\nCPU.\n</p>\n<pre class=\"code\">\n# ARM soft-float\nmake HOST_CC=\"gcc -m32\" CROSS=arm-linux-gnueabi- \\\n     TARGET_CFLAGS=\"-mfloat-abi=soft\"\n\n# ARM soft-float ABI with VFP (example for Cortex-A8)\nmake HOST_CC=\"gcc -m32\" CROSS=arm-linux-gnueabi- \\\n     TARGET_CFLAGS=\"-mcpu=cortex-a8 -mfloat-abi=softfp\"\n\n# ARM hard-float ABI with VFP (armhf, requires recent toolchain)\nmake HOST_CC=\"gcc -m32\" CROSS=arm-linux-gnueabihf-\n\n# PPC\nmake HOST_CC=\"gcc -m32\" CROSS=powerpc-linux-gnu-\n# PPC/e500v2 (fast interpreter only)\nmake HOST_CC=\"gcc -m32\" CROSS=powerpc-e500v2-linux-gnuspe-\n\n# MIPS big-endian\nmake HOST_CC=\"gcc -m32\" CROSS=mips-linux-\n# MIPS little-endian\nmake HOST_CC=\"gcc -m32\" CROSS=mipsel-linux-\n</pre>\n<p>\nYou can cross-compile for <b id=\"android\">Android</b> using the <a href=\"http://developer.android.com/sdk/ndk/index.html\"><span class=\"ext\">&raquo;</span>&nbsp;Android NDK</a>.\nThe environment variables need to match the install locations and the\ndesired target platform. E.g. Android&nbsp;4.0 corresponds to ABI level&nbsp;14.\nFor details check the folder <tt>docs</tt> in the NDK directory.\n</p>\n<p>\nOnly a few common variations for the different CPUs, ABIs and platforms\nare listed. Please use your own judgement for which combination you want\nto build/deploy or which lowest common denominator you want to pick:\n</p>\n<pre class=\"code\">\n# Android/ARM, armeabi (ARMv5TE soft-float), Android 2.2+ (Froyo)\nNDK=/opt/android/ndk\nNDKABI=8\nNDKVER=$NDK/toolchains/arm-linux-androideabi-4.6\nNDKP=$NDKVER/prebuilt/linux-x86/bin/arm-linux-androideabi-\nNDKF=\"--sysroot $NDK/platforms/android-$NDKABI/arch-arm\"\nmake HOST_CC=\"gcc -m32\" CROSS=$NDKP TARGET_FLAGS=\"$NDKF\"\n\n# Android/ARM, armeabi-v7a (ARMv7 VFP), Android 4.0+ (ICS)\nNDK=/opt/android/ndk\nNDKABI=14\nNDKVER=$NDK/toolchains/arm-linux-androideabi-4.6\nNDKP=$NDKVER/prebuilt/linux-x86/bin/arm-linux-androideabi-\nNDKF=\"--sysroot $NDK/platforms/android-$NDKABI/arch-arm\"\nNDKARCH=\"-march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8\"\nmake HOST_CC=\"gcc -m32\" CROSS=$NDKP TARGET_FLAGS=\"$NDKF $NDKARCH\"\n\n# Android/MIPS, mips (MIPS32R1 hard-float), Android 4.0+ (ICS)\nNDK=/opt/android/ndk\nNDKABI=14\nNDKVER=$NDK/toolchains/mipsel-linux-android-4.6\nNDKP=$NDKVER/prebuilt/linux-x86/bin/mipsel-linux-android-\nNDKF=\"--sysroot $NDK/platforms/android-$NDKABI/arch-mips\"\nmake HOST_CC=\"gcc -m32\" CROSS=$NDKP TARGET_FLAGS=\"$NDKF\"\n\n# Android/x86, x86 (i686 SSE3), Android 4.0+ (ICS)\nNDK=/opt/android/ndk\nNDKABI=14\nNDKVER=$NDK/toolchains/x86-4.6\nNDKP=$NDKVER/prebuilt/linux-x86/bin/i686-linux-android-\nNDKF=\"--sysroot $NDK/platforms/android-$NDKABI/arch-x86\"\nmake HOST_CC=\"gcc -m32\" CROSS=$NDKP TARGET_FLAGS=\"$NDKF\"\n</pre>\n<p>\nYou can cross-compile for <b id=\"ios\">iOS 3.0+</b> (iPhone/iPad) using the <a href=\"http://developer.apple.com/devcenter/ios/index.action\"><span class=\"ext\">&raquo;</span>&nbsp;iOS SDK</a>.\nThe environment variables need to match the iOS SDK version:\n</p>\n<p style=\"font-size: 8pt;\">\nNote: <b>the JIT compiler is disabled for iOS</b>, because regular iOS Apps\nare not allowed to generate code at runtime. You'll only get the performance\nof the LuaJIT interpreter on iOS. This is still faster than plain Lua, but\nmuch slower than the JIT compiler. Please complain to Apple, not me.\nOr use Android. :-p\n</p>\n<pre class=\"code\">\nIXCODE=`xcode-select -print-path`\nISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer\nISDKVER=iPhoneOS6.0.sdk\nISDKP=$ISDK/usr/bin/\nISDKF=\"-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER\"\nmake HOST_CC=\"gcc -m32 -arch i386\" CROSS=$ISDKP TARGET_FLAGS=\"$ISDKF\" \\\n     TARGET_SYS=iOS\n</pre>\n<p>\nYou can cross-compile for <b id=\"ps3\">PS3</b> using the PS3&nbsp;SDK from\na Linux host or a Windows host (requires 32 bit MinGW (GCC) on the host,\ntoo). Due to restrictions on consoles, the JIT compiler is disabled and\nonly the fast interpreter is built:\n</p>\n<pre class=\"code\">\nmake HOST_CC=\"gcc -m32\" CROSS=ppu-lv2-\n</pre>\n<p>\nYou can cross-compile for <b id=\"xbox360\">Xbox 360</b> using the\nXbox&nbsp;360 SDK (MSVC + XEDK). Due to restrictions on consoles, the\nJIT compiler is disabled and only the fast interpreter is built.\n</p>\n<p>\nOpen a \"Visual Studio .NET Command Prompt\" (32&nbsp;bit host compiler),\n<tt>cd</tt> to the directory where you've unpacked the sources and run\nthe following commands. This builds a static library <tt>luajit20.lib</tt>,\nwhich can be linked against your game, just like the Lua library.\n</p>\n<pre class=\"code\">\ncd src\nxedkbuild\n</pre>\n\n<h2 id=\"embed\">Embedding LuaJIT</h2>\n<p>\nLuaJIT is API-compatible with Lua 5.1. If you've already embedded Lua\ninto your application, you probably don't need to do anything to switch\nto LuaJIT, except link with a different library:\n</p>\n<ul>\n<li>It's strongly suggested to build LuaJIT separately using the supplied\nbuild system. Please do <em>not</em> attempt to integrate the individual\nsource files into your build tree. You'll most likely get the internal build\ndependencies wrong or mess up the compiler flags. Treat LuaJIT like any\nother external library and link your application with either the dynamic\nor static library, depending on your needs.</li>\n<li>If you want to load C modules compiled for plain Lua\nwith <tt>require()</tt>, you need to make sure the public symbols\n(e.g. <tt>lua_pushnumber</tt>) are exported, too:\n<ul><li>On POSIX systems you can either link to the shared library\nor link the static library into your application. In the latter case\nyou'll need to export all public symbols from your main executable\n(e.g. <tt>-Wl,-E</tt> on Linux) and add the external dependencies\n(e.g. <tt>-lm -ldl</tt> on Linux).</li>\n<li>Since Windows symbols are bound to a specific DLL name, you need to\nlink to the <tt>lua51.dll</tt> created by the LuaJIT build (do not rename\nthe DLL). You may link LuaJIT statically on Windows only if you don't\nintend to load Lua/C modules at runtime.\n</li></ul>\n</li>\n<li>\nIf you're building a 64 bit application on OSX which links directly or\nindirectly against LuaJIT, you need to link your main executable\nwith these flags:\n<pre class=\"code\">\n-pagezero_size 10000 -image_base 100000000\n</pre>\nAlso, it's recommended to <tt>rebase</tt> all (self-compiled) shared libraries\nwhich are loaded at runtime on OSX/x64 (e.g. C extension modules for Lua).\nSee: <tt>man rebase</tt>\n</li>\n</ul>\n<p>Additional hints for initializing LuaJIT using the C API functions:</p>\n<ul>\n<li>Here's a\n<a href=\"http://lua-users.org/wiki/SimpleLuaApiExample\"><span class=\"ext\">&raquo;</span>&nbsp;simple example</a>\nfor embedding Lua or LuaJIT into your application.</li>\n<li>Make sure you use <tt>luaL_newstate</tt>. Avoid using\n<tt>lua_newstate</tt>, since this uses the (slower) default memory\nallocator from your system (no support for this on x64).</li>\n<li>Make sure you use <tt>luaL_openlibs</tt> and not the old Lua 5.0 style\nof calling <tt>luaopen_base</tt> etc. directly.</li>\n<li>To change or extend the list of standard libraries to load, copy\n<tt>src/lib_init.c</tt> to your project and modify it accordingly.\nMake sure the <tt>jit</tt> library is loaded or the JIT compiler\nwill not be activated.</li>\n<li>The <tt>bit.*</tt> module for bitwise operations\nis already built-in. There's no need to statically link\n<a href=\"http://bitop.luajit.org/\"><span class=\"ext\">&raquo;</span>&nbsp;Lua BitOp</a> to your application.</li>\n</ul>\n\n<h2 id=\"distro\">Hints for Distribution Maintainers</h2>\n<p>\nThe LuaJIT build system has extra provisions for the needs of most\nPOSIX-based distributions. If you're a package maintainer for\na distribution, <em>please</em> make use of these features and\navoid patching, subverting, autotoolizing or messing up the build system\nin unspeakable ways.\n</p>\n<p>\nThere should be absolutely no need to patch <tt>luaconf.h</tt> or any\nof the Makefiles. And please do not hand-pick files for your packages &mdash;\nsimply use whatever <tt>make install</tt> creates. There's a reason\nfor all of the files <em>and</em> directories it creates.\n</p>\n<p>\nThe build system uses GNU make and auto-detects most settings based on\nthe host you're building it on. This should work fine for native builds,\neven when sandboxed. You may need to pass some of the following flags to\n<em>both</em> the <tt>make</tt> and the <tt>make install</tt> command lines\nfor a regular distribution build:\n</p>\n<ul>\n<li><tt>PREFIX</tt> overrides the installation path and should usually\nbe set to <tt>/usr</tt>. Setting this also changes the module paths and\nthe <tt>-rpath</tt> of the shared library.</li>\n<li><tt>DESTDIR</tt> is an absolute path which allows you to install\nto a shadow tree instead of the root tree of the build system.</li>\n<li>Have a look at the top-level <tt>Makefile</tt> and <tt>src/Makefile</tt>\nfor additional variables to tweak. The following variables <em>may</em> be\noverridden, but it's <em>not</em> recommended, except for special needs\nlike cross-builds:\n<tt>BUILDMODE, CC, HOST_CC, STATIC_CC, DYNAMIC_CC, CFLAGS, HOST_CFLAGS,\nTARGET_CFLAGS, LDFLAGS, HOST_LDFLAGS, TARGET_LDFLAGS, TARGET_SHLDFLAGS,\nTARGET_FLAGS, LIBS, HOST_LIBS, TARGET_LIBS, CROSS, HOST_SYS, TARGET_SYS\n</tt></li>\n</ul>\n<p>\nThe build system has a special target for an amalgamated build, i.e.\n<tt>make amalg</tt>. This compiles the LuaJIT core as one huge C file\nand allows GCC to generate faster and shorter code. Alas, this requires\nlots of memory during the build. This may be a problem for some users,\nthat's why it's not enabled by default. But it shouldn't be a problem for\nmost build farms. It's recommended that binary distributions use this\ntarget for their LuaJIT builds.\n</p>\n<p>\nThe tl;dr version of the above:\n</p>\n<pre class=\"code\">\nmake amalg PREFIX=/usr && \\\nmake install PREFIX=/usr DESTDIR=/tmp/buildroot\n</pre>\n<p>\nFinally, if you encounter any difficulties, please\n<a href=\"contact.html\">contact me</a> first, instead of releasing a broken\npackage onto unsuspecting users. Because they'll usually gonna complain\nto me (the upstream) and not you (the package maintainer), anyway.\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/luajit.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>LuaJIT</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<meta name=\"description\" content=\"LuaJIT is a Just-In-Time (JIT) compiler for the Lua language.\">\n<style type=\"text/css\">\ntable.feature {\n  width: inherit;\n  line-height: 1.2;\n  margin: 0;\n}\ntable.feature td {\n  width: 80px;\n  height: 40px;\n  vertical-align: middle;\n  text-align: center;\n  font-weight: bold;\n  border: 4px solid #e6ecff;\n  border-radius: 12px;\n}\ntable.os td {\n  background: #7080d0;\n  background-image: linear-gradient(#4060c0 10%, #b0b0ff 95%);\n  background-image: -moz-linear-gradient(#4060c0 10%, #b0b0ff 95%);\n  background-image: -webkit-linear-gradient(#4060c0 10%, #b0b0ff 95%);\n  background-image: -o-linear-gradient(#4060c0 10%, #b0b0ff 95%);\n  background-image: -ms-linear-gradient(#4060c0 10%, #b0b0ff 95%);\n}\ntable.os1 td {\n  color: #ffff80;\n}\ntable.os2 td {\n  color: #ffa040;\n}\ntable.compiler td {\n  color: #2080ff;\n  background: #62bf41;\n  background-image: linear-gradient(#62bf41 10%, #b0ffb0 95%);\n  background-image: -moz-linear-gradient(#62bf41 10%, #b0ffb0 95%);\n  background-image: -webkit-linear-gradient(#62bf41 10%, #b0ffb0 95%);\n  background-image: -o-linear-gradient(#62bf41 10%, #b0ffb0 95%);\n  background-image: -ms-linear-gradient(#62bf41 10%, #b0ffb0 95%);\n}\ntable.cpu td {\n  color: #ffff00;\n  background: #cf7251;\n  background-image: linear-gradient(#bf6241 10%, #ffb0b0 95%);\n  background-image: -moz-linear-gradient(#bf6241 10%, #ffb0b0 95%);\n  background-image: -webkit-linear-gradient(#bf6241 10%, #ffb0b0 95%);\n  background-image: -o-linear-gradient(#bf6241 10%, #ffb0b0 95%);\n  background-image: -ms-linear-gradient(#bf6241 10%, #ffb0b0 95%);\n}\ntable.fcompat td {\n  color: #2060e0;\n  background: #61cfcf;\n  background-image: linear-gradient(#41bfbf 10%, #b0ffff 95%);\n  background-image: -moz-linear-gradient(#41bfbf 10%, #b0ffff 95%);\n  background-image: -webkit-linear-gradient(#41bfbf 10%, #b0ffff 95%);\n  background-image: -o-linear-gradient(#41bfbf 10%, #b0ffff 95%);\n  background-image: -ms-linear-gradient(#41bfbf 10%, #b0ffff 95%);\n}\ntable.stats td {\n  color: #ffffff;\n  background: #a0a0a0;\n  background-image: linear-gradient(#808080 10%, #d0d0d0 95%);\n  background-image: -moz-linear-gradient(#808080 10%, #d0d0d0 95%);\n  background-image: -webkit-linear-gradient(#808080 10%, #d0d0d0 95%);\n  background-image: -o-linear-gradient(#808080 10%, #d0d0d0 95%);\n  background-image: -ms-linear-gradient(#808080 10%, #d0d0d0 95%);\n}\ntable.stats td.speed {\n  color: #ff4020;\n}\ntable.stats td.kb {\n  color: #ffff80;\n  background: #808080;\n  background-image: linear-gradient(#606060 10%, #c0c0c0 95%);\n  background-image: -moz-linear-gradient(#606060 10%, #c0c0c0 95%);\n  background-image: -webkit-linear-gradient(#606060 10%, #c0c0c0 95%);\n  background-image: -o-linear-gradient(#606060 10%, #c0c0c0 95%);\n  background-image: -ms-linear-gradient(#606060 10%, #c0c0c0 95%);\n}\ntable.feature small {\n  font-size: 50%;\n}\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>LuaJIT</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a class=\"current\" href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nLuaJIT is a <b>Just-In-Time Compiler</b> (JIT) for the\n<a href=\"http://www.lua.org/\"><span class=\"ext\">&raquo;</span>&nbsp;Lua</a> programming language.\nLua is a powerful, dynamic and light-weight programming language.\nIt may be embedded or used as a general-purpose, stand-alone language.\n</p>\n<p>\nLuaJIT is Copyright &copy; 2005-2013 Mike Pall, released under the\n<a href=\"http://www.opensource.org/licenses/mit-license.php\"><span class=\"ext\">&raquo;</span>&nbsp;MIT open source license</a>.\n</p>\n<p>\n</p>\n\n<h2>Compatibility</h2>\n<table class=\"feature os os1\">\n<tr><td>Windows</td><td>Linux</td><td>BSD</td><td>OSX</td><td>POSIX</td></tr>\n</table>\n<table class=\"feature os os2\">\n<tr><td><span style=\"font-size:90%;\">Embedded</span></td><td>Android</td><td>iOS</td><td>PS3</td><td>Xbox 360</td></tr>\n</table>\n<table class=\"feature compiler\">\n<tr><td>GCC</td><td>CLANG<br>LLVM</td><td>MSVC</td></tr>\n</table>\n<table class=\"feature cpu\">\n<tr><td>x86</td><td>x64</td><td>ARM</td><td>PPC</td><td>e500</td><td>MIPS</td></tr>\n</table>\n<table class=\"feature fcompat\">\n<tr><td>Lua&nbsp;5.1<br>API+ABI</td><td>+&nbsp;JIT</td><td>+&nbsp;BitOp</td><td>+&nbsp;FFI</td><td>Drop-in<br>DLL/.so</td></tr>\n</table>\n\n<h2>Overview</h2>\n<table class=\"feature stats\">\n<tr>\n<td class=\"speed\">3x<br>-&nbsp;&nbsp;100x</td>\n<td class=\"kb\">115&nbsp;<small>KB</small><br>VM</td>\n<td class=\"kb\">90&nbsp;<small>KB</small><br>JIT</td>\n<td class=\"kloc\">63&nbsp;<small>KLOC</small><br>C</td>\n<td class=\"kloc\">24&nbsp;<small>KLOC</small><br>ASM</td>\n<td class=\"kloc\">11&nbsp;<small>KLOC</small><br>Lua</td>\n</tr>\n</table>\n<p style=\"margin-top: 1em;\">\nLuaJIT has been successfully used as a <b>scripting middleware</b> in\ngames, appliances, network and graphics apps, numerical simulations,\ntrading platforms and many other specialty applications. It scales from\nembedded devices, smartphones, desktops up to server farms. It combines\nhigh flexibility with <a href=\"http://luajit.org/performance.html\"><span class=\"ext\">&raquo;</span>&nbsp;high performance</a>\nand an unmatched <b>low memory footprint</b>.\n</p>\n<p>\nLuaJIT has been in continuous development since 2005. It's widely\nconsidered to be <b>one of the fastest dynamic language\nimplementations</b>. It has outperformed other dynamic languages on many\ncross-language benchmarks since its first release &mdash; often by a\nsubstantial margin.\n</p>\n<p>\nFor <b>LuaJIT 2.0</b>, the whole VM has been rewritten from the ground up\nand relentlessly optimized for performance. It combines a <b>high-speed\ninterpreter</b>, written in assembler, with a <b>state-of-the-art JIT\ncompiler</b>.\n</p>\n<p>\nAn innovative <b>trace compiler</b> is integrated with advanced,\nSSA-based optimizations and highly tuned code generation backends.\nA substantial reduction of the overhead associated with dynamic languages\nallows it to break into the performance range traditionally reserved for\noffline, static language compilers.\n</p>\n\n<h2>More ...</h2>\n<p>\nPlease select a sub-topic in the navigation bar to learn more about LuaJIT.\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/running.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>Running LuaJIT</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\ntable.opt {\n  line-height: 1.2;\n}\ntr.opthead td {\n  font-weight: bold;\n}\ntd.flag_name {\n  width: 4em;\n}\ntd.flag_level {\n  width: 2em;\n  text-align: center;\n}\ntd.param_name {\n  width: 6em;\n}\ntd.param_default {\n  width: 4em;\n  text-align: right;\n}\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>Running LuaJIT</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a class=\"current\" href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\nLuaJIT has only a single stand-alone executable, called <tt>luajit</tt> on\nPOSIX systems or <tt>luajit.exe</tt> on Windows. It can be used to run simple\nLua statements or whole Lua applications from the command line. It has an\ninteractive mode, too.\n</p>\n\n<h2 id=\"options\">Command Line Options</h2>\n<p>\nThe <tt>luajit</tt> stand-alone executable is just a slightly modified\nversion of the regular <tt>lua</tt> stand-alone executable.\nIt supports the same basic options, too. <tt>luajit&nbsp;-h</tt>\nprints a short list of the available options. Please have a look at the\n<a href=\"http://www.lua.org/manual/5.1/manual.html#6\"><span class=\"ext\">&raquo;</span>&nbsp;Lua manual</a>\nfor details.\n</p>\n<p>\nLuaJIT has some additional options:\n</p>\n\n<h3 id=\"opt_b\"><tt>-b[options] input output</tt></h3>\n<p>\nThis option saves or lists bytecode. The following additional options\nare accepted:\n</p>\n<ul>\n<li><tt>-l</tt> &mdash; Only list bytecode.</li>\n<li><tt>-s</tt> &mdash; Strip debug info (this is the default).</li>\n<li><tt>-g</tt> &mdash; Keep debug info.</li>\n<li><tt>-n name</tt> &mdash; Set module name (default: auto-detect from input name)</li>\n<li><tt>-t type</tt> &mdash; Set output file type (default: auto-detect from output name).</li>\n<li><tt>-a arch</tt> &mdash; Override architecture for object files (default: native).</li>\n<li><tt>-o os</tt> &mdash; Override OS for object files (default: native).</li>\n<li><tt>-e chunk</tt> &mdash; Use chunk string as input.</li>\n<li><tt>-</tt> (a single minus sign) &mdash; Use stdin as input and/or stdout as output.</li>\n</ul>\n<p>\nThe output file type is auto-detected from the extension of the output\nfile name:\n</p>\n<ul>\n<li><tt>c</tt> &mdash; C source file, exported bytecode data.</li>\n<li><tt>h</tt> &mdash; C header file, static bytecode data.</li>\n<li><tt>obj</tt> or <tt>o</tt> &mdash; Object file, exported bytecode data\n(OS- and architecture-specific).</li>\n<li><tt>raw</tt> or any other extension &mdash; Raw bytecode file (portable).\n</ul>\n<p>\nNotes:\n</p>\n<ul>\n<li>See also <a href=\"extensions.html#string_dump\">string.dump()</a>\nfor information on bytecode portability and compatibility.</li>\n<li>A file in raw bytecode format is auto-detected and can be loaded like\nany Lua source file. E.g. directly from the command line or with\n<tt>loadfile()</tt>, <tt>dofile()</tt> etc.</li>\n<li>To statically embed the bytecode of a module in your application,\ngenerate an object file and just link it with your application.</li>\n<li>On most ELF-based systems (e.g. Linux) you need to explicitly export the\nglobal symbols when linking your application, e.g. with: <tt>-Wl,-E</tt></li>\n<li><tt>require()</tt> tries to load embedded bytecode data from exported\nsymbols (in <tt>*.exe</tt> or <tt>lua51.dll</tt> on Windows) and from\nshared libraries in <tt>package.cpath</tt>.</li>\n</ul>\n<p>\nTypical usage examples:\n</p>\n<pre class=\"code\">\nluajit -b test.lua test.out                 # Save bytecode to test.out\nluajit -bg test.lua test.out                # Keep debug info\nluajit -be \"print('hello world')\" test.out  # Save cmdline script\n\nluajit -bl test.lua                         # List to stdout\nluajit -bl test.lua test.txt                # List to test.txt\nluajit -ble \"print('hello world')\"          # List cmdline script\n\nluajit -b test.lua test.obj                 # Generate object file\n# Link test.obj with your application and load it with require(\"test\")\n</pre>\n\n<h3 id=\"opt_j\"><tt>-j cmd[=arg[,arg...]]</tt></h3>\n<p>\nThis option performs a LuaJIT control command or activates one of the\nloadable extension modules. The command is first looked up in the\n<tt>jit.*</tt> library. If no matching function is found, a module\nnamed <tt>jit.&lt;cmd&gt;</tt> is loaded and the <tt>start()</tt>\nfunction of the module is called with the specified arguments (if\nany). The space between <tt>-j</tt> and <tt>cmd</tt> is optional.\n</p>\n<p>\nHere are the available LuaJIT control commands:\n</p>\n<ul>\n<li id=\"j_on\"><tt>-jon</tt> &mdash; Turns the JIT compiler on (default).</li>\n<li id=\"j_off\"><tt>-joff</tt> &mdash; Turns the JIT compiler off (only use the interpreter).</li>\n<li id=\"j_flush\"><tt>-jflush</tt> &mdash; Flushes the whole cache of compiled code.</li>\n<li id=\"j_v\"><tt>-jv</tt> &mdash; Shows verbose information about the progress of the JIT compiler.</li>\n<li id=\"j_dump\"><tt>-jdump</tt> &mdash; Dumps the code and structures used in various compiler stages.</li>\n</ul>\n<p>\nThe <tt>-jv</tt> and <tt>-jdump</tt> commands are extension modules\nwritten in Lua. They are mainly used for debugging the JIT compiler\nitself. For a description of their options and output format, please\nread the comment block at the start of their source.\nThey can be found in the <tt>lib</tt> directory of the source\ndistribution or installed under the <tt>jit</tt> directory. By default\nthis is <tt>/usr/local/share/luajit-2.0.1/jit</tt> on POSIX\nsystems.\n</p>\n\n<h3 id=\"opt_O\"><tt>-O[level]</tt><br>\n<tt>-O[+]flag</tt>&nbsp;&nbsp;&nbsp;<tt>-O-flag</tt><br>\n<tt>-Oparam=value</tt></h3>\n<p>\nThis options allows fine-tuned control of the optimizations used by\nthe JIT compiler. This is mainly intended for debugging LuaJIT itself.\nPlease note that the JIT compiler is extremely fast (we are talking\nabout the microsecond to millisecond range). Disabling optimizations\ndoesn't have any visible impact on its overhead, but usually generates\ncode that runs slower.\n</p>\n<p>\nThe first form sets an optimization level &mdash; this enables a\nspecific mix of optimization flags. <tt>-O0</tt> turns off all\noptimizations and higher numbers enable more optimizations. Omitting\nthe level (i.e. just <tt>-O</tt>) sets the default optimization level,\nwhich is <tt>-O3</tt> in the current version.\n</p>\n<p>\nThe second form adds or removes individual optimization flags.\nThe third form sets a parameter for the VM or the JIT compiler\nto a specific value.\n</p>\n<p>\nYou can either use this option multiple times (like <tt>-Ocse\n-O-dce -Ohotloop=10</tt>) or separate several settings with a comma\n(like <tt>-O+cse,-dce,hotloop=10</tt>). The settings are applied from\nleft to right and later settings override earlier ones. You can freely\nmix the three forms, but note that setting an optimization level\noverrides all earlier flags.\n</p>\n<p>\nHere are the available flags and at what optimization levels they\nare enabled:\n</p>\n<table class=\"opt\">\n<tr class=\"opthead\">\n<td class=\"flag_name\">Flag</td>\n<td class=\"flag_level\">-O1</td>\n<td class=\"flag_level\">-O2</td>\n<td class=\"flag_level\">-O3</td>\n<td class=\"flag_desc\">&nbsp;</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"flag_name\">fold</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Constant Folding, Simplifications and Reassociation</td></tr>\n<tr class=\"even\">\n<td class=\"flag_name\">cse</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Common-Subexpression Elimination</td></tr>\n<tr class=\"odd\">\n<td class=\"flag_name\">dce</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Dead-Code Elimination</td></tr>\n<tr class=\"even\">\n<td class=\"flag_name\">narrow</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Narrowing of numbers to integers</td></tr>\n<tr class=\"odd\">\n<td class=\"flag_name\">loop</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Loop Optimizations (code hoisting)</td></tr>\n<tr class=\"even\">\n<td class=\"flag_name\">fwd</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Load Forwarding (L2L) and Store Forwarding (S2L)</td></tr>\n<tr class=\"odd\">\n<td class=\"flag_name\">dse</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Dead-Store Elimination</td></tr>\n<tr class=\"even\">\n<td class=\"flag_name\">abc</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Array Bounds Check Elimination</td></tr>\n<tr class=\"odd\">\n<td class=\"flag_name\">sink</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Allocation/Store Sinking</td></tr>\n<tr class=\"even\">\n<td class=\"flag_name\">fuse</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&nbsp;</td><td class=\"flag_level\">&bull;</td><td class=\"flag_desc\">Fusion of operands into instructions</td></tr>\n</table>\n<p>\nHere are the parameters and their default settings:\n</p>\n<table class=\"opt\">\n<tr class=\"opthead\">\n<td class=\"param_name\">Parameter</td>\n<td class=\"param_default\">Default</td>\n<td class=\"param_desc\">&nbsp;</td>\n</tr>\n<tr class=\"odd separate\">\n<td class=\"param_name\">maxtrace</td><td class=\"param_default\">1000</td><td class=\"param_desc\">Max. number of traces in the cache</td></tr>\n<tr class=\"even\">\n<td class=\"param_name\">maxrecord</td><td class=\"param_default\">4000</td><td class=\"param_desc\">Max. number of recorded IR instructions</td></tr>\n<tr class=\"odd\">\n<td class=\"param_name\">maxirconst</td><td class=\"param_default\">500</td><td class=\"param_desc\">Max. number of IR constants of a trace</td></tr>\n<tr class=\"even\">\n<td class=\"param_name\">maxside</td><td class=\"param_default\">100</td><td class=\"param_desc\">Max. number of side traces of a root trace</td></tr>\n<tr class=\"odd\">\n<td class=\"param_name\">maxsnap</td><td class=\"param_default\">500</td><td class=\"param_desc\">Max. number of snapshots for a trace</td></tr>\n<tr class=\"even separate\">\n<td class=\"param_name\">hotloop</td><td class=\"param_default\">56</td><td class=\"param_desc\">Number of iterations to detect a hot loop or hot call</td></tr>\n<tr class=\"odd\">\n<td class=\"param_name\">hotexit</td><td class=\"param_default\">10</td><td class=\"param_desc\">Number of taken exits to start a side trace</td></tr>\n<tr class=\"even\">\n<td class=\"param_name\">tryside</td><td class=\"param_default\">4</td><td class=\"param_desc\">Number of attempts to compile a side trace</td></tr>\n<tr class=\"odd separate\">\n<td class=\"param_name\">instunroll</td><td class=\"param_default\">4</td><td class=\"param_desc\">Max. unroll factor for instable loops</td></tr>\n<tr class=\"even\">\n<td class=\"param_name\">loopunroll</td><td class=\"param_default\">15</td><td class=\"param_desc\">Max. unroll factor for loop ops in side traces</td></tr>\n<tr class=\"odd\">\n<td class=\"param_name\">callunroll</td><td class=\"param_default\">3</td><td class=\"param_desc\">Max. unroll factor for pseudo-recursive calls</td></tr>\n<tr class=\"even\">\n<td class=\"param_name\">recunroll</td><td class=\"param_default\">2</td><td class=\"param_desc\">Min. unroll factor for true recursion</td></tr>\n<tr class=\"odd separate\">\n<td class=\"param_name\">sizemcode</td><td class=\"param_default\">32</td><td class=\"param_desc\">Size of each machine code area in KBytes (Windows: 64K)</td></tr>\n<tr class=\"even\">\n<td class=\"param_name\">maxmcode</td><td class=\"param_default\">512</td><td class=\"param_desc\">Max. total size of all machine code areas in KBytes</td></tr>\n</table>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/doc/status.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<title>Status &amp; Roadmap</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n<meta name=\"Author\" content=\"Mike Pall\">\n<meta name=\"Copyright\" content=\"Copyright (C) 2005-2013, Mike Pall\">\n<meta name=\"Language\" content=\"en\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad.css\" media=\"screen\">\n<link rel=\"stylesheet\" type=\"text/css\" href=\"bluequad-print.css\" media=\"print\">\n<style type=\"text/css\">\nul li { padding-bottom: 0.3em; }\n</style>\n</head>\n<body>\n<div id=\"site\">\n<a href=\"http://luajit.org\"><span>Lua<span id=\"logo\">JIT</span></span></a>\n</div>\n<div id=\"head\">\n<h1>Status &amp; Roadmap</h1>\n</div>\n<div id=\"nav\">\n<ul><li>\n<a href=\"luajit.html\">LuaJIT</a>\n<ul><li>\n<a href=\"http://luajit.org/download.html\">Download <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"install.html\">Installation</a>\n</li><li>\n<a href=\"running.html\">Running</a>\n</li></ul>\n</li><li>\n<a href=\"extensions.html\">Extensions</a>\n<ul><li>\n<a href=\"ext_ffi.html\">FFI Library</a>\n<ul><li>\n<a href=\"ext_ffi_tutorial.html\">FFI Tutorial</a>\n</li><li>\n<a href=\"ext_ffi_api.html\">ffi.* API</a>\n</li><li>\n<a href=\"ext_ffi_semantics.html\">FFI Semantics</a>\n</li></ul>\n</li><li>\n<a href=\"ext_jit.html\">jit.* Library</a>\n</li><li>\n<a href=\"ext_c_api.html\">Lua/C API</a>\n</li></ul>\n</li><li>\n<a class=\"current\" href=\"status.html\">Status</a>\n<ul><li>\n<a href=\"changes.html\">Changes</a>\n</li></ul>\n</li><li>\n<a href=\"faq.html\">FAQ</a>\n</li><li>\n<a href=\"http://luajit.org/performance.html\">Performance <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://wiki.luajit.org/\">Wiki <span class=\"ext\">&raquo;</span></a>\n</li><li>\n<a href=\"http://luajit.org/list.html\">Mailing List <span class=\"ext\">&raquo;</span></a>\n</li></ul>\n</div>\n<div id=\"main\">\n<p>\n<span style=\"color: #0000c0;\">LuaJIT&nbsp;2.0</span> is the current\n<span style=\"color: #0000c0;\">stable branch</span>. This branch is in\nfeature-freeze &mdash; new features will only be added to LuaJIT&nbsp;2.1.\n</p>\n\n<h2>Current Status</h2>\n<p>\nLuaJIT ought to run all Lua&nbsp;5.1-compatible source code just fine.\nIt's considered a serious bug if the VM crashes or produces unexpected\nresults &mdash; please report this.\n</p>\n<p>\nKnown incompatibilities and issues in LuaJIT&nbsp;2.0:\n</p>\n<ul>\n<li>\nThere are some differences in <b>implementation-defined</b> behavior.\nThese either have a good reason, are arbitrary design choices\nor are due to quirks in the VM. The latter cases may get fixed if a\ndemonstrable need is shown.\n</li>\n<li>\nThe Lua <b>debug API</b> is missing a couple of features (return\nhooks for non-Lua functions) and shows slightly different behavior\nin LuaJIT (no per-coroutine hooks, no tail call counting).\n</li>\n<li>\nSome checks are missing in the JIT-compiled code for obscure situations\nwith <b>open upvalues aliasing</b> one of the SSA slots later on (or\nvice versa). Bonus points, if you can find a real world test case for\nthis.\n</li>\n<li>\nCurrently some <b>out-of-memory</b> errors from <b>on-trace code</b> are not\nhandled correctly. The error may fall through an on-trace\n<tt>pcall</tt> or it may be passed on to the function set with\n<tt>lua_atpanic</tt> on x64. This issue will be fixed with the new\ngarbage collector.\n</li>\n</ul>\n\n<h2>Roadmap</h2>\n<p>\nPlease refer to the\n<a href=\"http://www.freelists.org/post/luajit/LuaJIT-Roadmap-20122013\"><span class=\"ext\">&raquo;</span>&nbsp;LuaJIT Roadmap 2012/2013</a> and an\n<a href=\"http://www.freelists.org/post/luajit/LuaJIT-Roadmap-20122013-UPDATE\"><span class=\"ext\">&raquo;</span>&nbsp;update on release planning</a> for details.\n</p>\n<p>\n</p>\n<br class=\"flush\">\n</div>\n<div id=\"foot\">\n<hr class=\"hide\">\nCopyright &copy; 2005-2013 Mike Pall\n<span class=\"noprint\">\n&middot;\n<a href=\"contact.html\">Contact</a>\n</span>\n</div>\n</body>\n</html>\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_arm.h",
    "content": "/*\n** DynASM ARM encoding engine.\n** Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n** Released under the MIT license. See dynasm.lua for full copyright notice.\n*/\n\n#include <stddef.h>\n#include <stdarg.h>\n#include <string.h>\n#include <stdlib.h>\n\n#define DASM_ARCH\t\t\"arm\"\n\n#ifndef DASM_EXTERN\n#define DASM_EXTERN(a,b,c,d)\t0\n#endif\n\n/* Action definitions. */\nenum {\n  DASM_STOP, DASM_SECTION, DASM_ESC, DASM_REL_EXT,\n  /* The following actions need a buffer position. */\n  DASM_ALIGN, DASM_REL_LG, DASM_LABEL_LG,\n  /* The following actions also have an argument. */\n  DASM_REL_PC, DASM_LABEL_PC,\n  DASM_IMM, DASM_IMM12, DASM_IMM16, DASM_IMML8, DASM_IMML12, DASM_IMMV8,\n  DASM__MAX\n};\n\n/* Maximum number of section buffer positions for a single dasm_put() call. */\n#define DASM_MAXSECPOS\t\t25\n\n/* DynASM encoder status codes. Action list offset or number are or'ed in. */\n#define DASM_S_OK\t\t0x00000000\n#define DASM_S_NOMEM\t\t0x01000000\n#define DASM_S_PHASE\t\t0x02000000\n#define DASM_S_MATCH_SEC\t0x03000000\n#define DASM_S_RANGE_I\t\t0x11000000\n#define DASM_S_RANGE_SEC\t0x12000000\n#define DASM_S_RANGE_LG\t\t0x13000000\n#define DASM_S_RANGE_PC\t\t0x14000000\n#define DASM_S_RANGE_REL\t0x15000000\n#define DASM_S_UNDEF_LG\t\t0x21000000\n#define DASM_S_UNDEF_PC\t\t0x22000000\n\n/* Macros to convert positions (8 bit section + 24 bit index). */\n#define DASM_POS2IDX(pos)\t((pos)&0x00ffffff)\n#define DASM_POS2BIAS(pos)\t((pos)&0xff000000)\n#define DASM_SEC2POS(sec)\t((sec)<<24)\n#define DASM_POS2SEC(pos)\t((pos)>>24)\n#define DASM_POS2PTR(D, pos)\t(D->sections[DASM_POS2SEC(pos)].rbuf + (pos))\n\n/* Action list type. */\ntypedef const unsigned int *dasm_ActList;\n\n/* Per-section structure. */\ntypedef struct dasm_Section {\n  int *rbuf;\t\t/* Biased buffer pointer (negative section bias). */\n  int *buf;\t\t/* True buffer pointer. */\n  size_t bsize;\t\t/* Buffer size in bytes. */\n  int pos;\t\t/* Biased buffer position. */\n  int epos;\t\t/* End of biased buffer position - max single put. */\n  int ofs;\t\t/* Byte offset into section. */\n} dasm_Section;\n\n/* Core structure holding the DynASM encoding state. */\nstruct dasm_State {\n  size_t psize;\t\t\t/* Allocated size of this structure. */\n  dasm_ActList actionlist;\t/* Current actionlist pointer. */\n  int *lglabels;\t\t/* Local/global chain/pos ptrs. */\n  size_t lgsize;\n  int *pclabels;\t\t/* PC label chains/pos ptrs. */\n  size_t pcsize;\n  void **globals;\t\t/* Array of globals (bias -10). */\n  dasm_Section *section;\t/* Pointer to active section. */\n  size_t codesize;\t\t/* Total size of all code sections. */\n  int maxsection;\t\t/* 0 <= sectionidx < maxsection. */\n  int status;\t\t\t/* Status code. */\n  dasm_Section sections[1];\t/* All sections. Alloc-extended. */\n};\n\n/* The size of the core structure depends on the max. number of sections. */\n#define DASM_PSZ(ms)\t(sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section))\n\n\n/* Initialize DynASM state. */\nvoid dasm_init(Dst_DECL, int maxsection)\n{\n  dasm_State *D;\n  size_t psz = 0;\n  int i;\n  Dst_REF = NULL;\n  DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection));\n  D = Dst_REF;\n  D->psize = psz;\n  D->lglabels = NULL;\n  D->lgsize = 0;\n  D->pclabels = NULL;\n  D->pcsize = 0;\n  D->globals = NULL;\n  D->maxsection = maxsection;\n  for (i = 0; i < maxsection; i++) {\n    D->sections[i].buf = NULL;  /* Need this for pass3. */\n    D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i);\n    D->sections[i].bsize = 0;\n    D->sections[i].epos = 0;  /* Wrong, but is recalculated after resize. */\n  }\n}\n\n/* Free DynASM state. */\nvoid dasm_free(Dst_DECL)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  for (i = 0; i < D->maxsection; i++)\n    if (D->sections[i].buf)\n      DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize);\n  if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize);\n  if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize);\n  DASM_M_FREE(Dst, D, D->psize);\n}\n\n/* Setup global label array. Must be called before dasm_setup(). */\nvoid dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl)\n{\n  dasm_State *D = Dst_REF;\n  D->globals = gl - 10;  /* Negative bias to compensate for locals. */\n  DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int));\n}\n\n/* Grow PC label array. Can be called after dasm_setup(), too. */\nvoid dasm_growpc(Dst_DECL, unsigned int maxpc)\n{\n  dasm_State *D = Dst_REF;\n  size_t osz = D->pcsize;\n  DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int));\n  memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz);\n}\n\n/* Setup encoder. */\nvoid dasm_setup(Dst_DECL, const void *actionlist)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  D->actionlist = (dasm_ActList)actionlist;\n  D->status = DASM_S_OK;\n  D->section = &D->sections[0];\n  memset((void *)D->lglabels, 0, D->lgsize);\n  if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);\n  for (i = 0; i < D->maxsection; i++) {\n    D->sections[i].pos = DASM_SEC2POS(i);\n    D->sections[i].ofs = 0;\n  }\n}\n\n\n#ifdef DASM_CHECKS\n#define CK(x, st) \\\n  do { if (!(x)) { \\\n    D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0)\n#define CKPL(kind, st) \\\n  do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \\\n    D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0)\n#else\n#define CK(x, st)\t((void)0)\n#define CKPL(kind, st)\t((void)0)\n#endif\n\nstatic int dasm_imm12(unsigned int n)\n{\n  int i;\n  for (i = 0; i < 16; i++, n = (n << 2) | (n >> 30))\n    if (n <= 255) return (int)(n + (i << 8));\n  return -1;\n}\n\n/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */\nvoid dasm_put(Dst_DECL, int start, ...)\n{\n  va_list ap;\n  dasm_State *D = Dst_REF;\n  dasm_ActList p = D->actionlist + start;\n  dasm_Section *sec = D->section;\n  int pos = sec->pos, ofs = sec->ofs;\n  int *b;\n\n  if (pos >= sec->epos) {\n    DASM_M_GROW(Dst, int, sec->buf, sec->bsize,\n      sec->bsize + 2*DASM_MAXSECPOS*sizeof(int));\n    sec->rbuf = sec->buf - DASM_POS2BIAS(pos);\n    sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos);\n  }\n\n  b = sec->rbuf;\n  b[pos++] = start;\n\n  va_start(ap, start);\n  while (1) {\n    unsigned int ins = *p++;\n    unsigned int action = (ins >> 16);\n    if (action >= DASM__MAX) {\n      ofs += 4;\n    } else {\n      int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0;\n      switch (action) {\n      case DASM_STOP: goto stop;\n      case DASM_SECTION:\n\tn = (ins & 255); CK(n < D->maxsection, RANGE_SEC);\n\tD->section = &D->sections[n]; goto stop;\n      case DASM_ESC: p++; ofs += 4; break;\n      case DASM_REL_EXT: break;\n      case DASM_ALIGN: ofs += (ins & 255); b[pos++] = ofs; break;\n      case DASM_REL_LG:\n\tn = (ins & 2047) - 10; pl = D->lglabels + n;\n\tif (n >= 0) { CKPL(lg, LG); goto putrel; }  /* Bkwd rel or global. */\n\tpl += 10; n = *pl;\n\tif (n < 0) n = 0;  /* Start new chain for fwd rel if label exists. */\n\tgoto linkrel;\n      case DASM_REL_PC:\n\tpl = D->pclabels + n; CKPL(pc, PC);\n      putrel:\n\tn = *pl;\n\tif (n < 0) {  /* Label exists. Get label pos and store it. */\n\t  b[pos] = -n;\n\t} else {\n      linkrel:\n\t  b[pos] = n;  /* Else link to rel chain, anchored at label. */\n\t  *pl = pos;\n\t}\n\tpos++;\n\tbreak;\n      case DASM_LABEL_LG:\n\tpl = D->lglabels + (ins & 2047) - 10; CKPL(lg, LG); goto putlabel;\n      case DASM_LABEL_PC:\n\tpl = D->pclabels + n; CKPL(pc, PC);\n      putlabel:\n\tn = *pl;  /* n > 0: Collapse rel chain and replace with label pos. */\n\twhile (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos;\n\t}\n\t*pl = -pos;  /* Label exists now. */\n\tb[pos++] = ofs;  /* Store pass1 offset estimate. */\n\tbreak;\n      case DASM_IMM:\n      case DASM_IMM16:\n#ifdef DASM_CHECKS\n\tCK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I);\n\tif ((ins & 0x8000))\n\t  CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I);\n\telse\n\t  CK((n>>((ins>>5)&31)) == 0, RANGE_I);\n#endif\n\tb[pos++] = n;\n\tbreak;\n      case DASM_IMMV8:\n\tCK((n & 3) == 0, RANGE_I);\n\tn >>= 2;\n      case DASM_IMML8:\n      case DASM_IMML12:\n\tCK(n >= 0 ? ((n>>((ins>>5)&31)) == 0) :\n\t\t    (((-n)>>((ins>>5)&31)) == 0), RANGE_I);\n\tb[pos++] = n;\n\tbreak;\n      case DASM_IMM12:\n\tCK(dasm_imm12((unsigned int)n) != -1, RANGE_I);\n\tb[pos++] = n;\n\tbreak;\n      }\n    }\n  }\nstop:\n  va_end(ap);\n  sec->pos = pos;\n  sec->ofs = ofs;\n}\n#undef CK\n\n/* Pass 2: Link sections, shrink aligns, fix label offsets. */\nint dasm_link(Dst_DECL, size_t *szp)\n{\n  dasm_State *D = Dst_REF;\n  int secnum;\n  int ofs = 0;\n\n#ifdef DASM_CHECKS\n  *szp = 0;\n  if (D->status != DASM_S_OK) return D->status;\n  {\n    int pc;\n    for (pc = 0; pc*sizeof(int) < D->pcsize; pc++)\n      if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc;\n  }\n#endif\n\n  { /* Handle globals not defined in this translation unit. */\n    int idx;\n    for (idx = 20; idx*sizeof(int) < D->lgsize; idx++) {\n      int n = D->lglabels[idx];\n      /* Undefined label: Collapse rel chain and replace with marker (< 0). */\n      while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; }\n    }\n  }\n\n  /* Combine all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->rbuf;\n    int pos = DASM_SEC2POS(secnum);\n    int lastpos = sec->pos;\n\n    while (pos != lastpos) {\n      dasm_ActList p = D->actionlist + b[pos++];\n      while (1) {\n\tunsigned int ins = *p++;\n\tunsigned int action = (ins >> 16);\n\tswitch (action) {\n\tcase DASM_STOP: case DASM_SECTION: goto stop;\n\tcase DASM_ESC: p++; break;\n\tcase DASM_REL_EXT: break;\n\tcase DASM_ALIGN: ofs -= (b[pos++] + ofs) & (ins & 255); break;\n\tcase DASM_REL_LG: case DASM_REL_PC: pos++; break;\n\tcase DASM_LABEL_LG: case DASM_LABEL_PC: b[pos++] += ofs; break;\n\tcase DASM_IMM: case DASM_IMM12: case DASM_IMM16:\n\tcase DASM_IMML8: case DASM_IMML12: case DASM_IMMV8: pos++; break;\n\t}\n      }\n      stop: (void)0;\n    }\n    ofs += sec->ofs;  /* Next section starts right after current section. */\n  }\n\n  D->codesize = ofs;  /* Total size of all code sections */\n  *szp = ofs;\n  return DASM_S_OK;\n}\n\n#ifdef DASM_CHECKS\n#define CK(x, st) \\\n  do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0)\n#else\n#define CK(x, st)\t((void)0)\n#endif\n\n/* Pass 3: Encode sections. */\nint dasm_encode(Dst_DECL, void *buffer)\n{\n  dasm_State *D = Dst_REF;\n  char *base = (char *)buffer;\n  unsigned int *cp = (unsigned int *)buffer;\n  int secnum;\n\n  /* Encode all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->buf;\n    int *endb = sec->rbuf + sec->pos;\n\n    while (b != endb) {\n      dasm_ActList p = D->actionlist + *b++;\n      while (1) {\n\tunsigned int ins = *p++;\n\tunsigned int action = (ins >> 16);\n\tint n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0;\n\tswitch (action) {\n\tcase DASM_STOP: case DASM_SECTION: goto stop;\n\tcase DASM_ESC: *cp++ = *p++; break;\n\tcase DASM_REL_EXT:\n\t  n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins&2047), !(ins&2048));\n\t  goto patchrel;\n\tcase DASM_ALIGN:\n\t  ins &= 255; while ((((char *)cp - base) & ins)) *cp++ = 0xe1a00000;\n\t  break;\n\tcase DASM_REL_LG:\n\t  CK(n >= 0, UNDEF_LG);\n\tcase DASM_REL_PC:\n\t  CK(n >= 0, UNDEF_PC);\n\t  n = *DASM_POS2PTR(D, n) - (int)((char *)cp - base) - 4;\n\tpatchrel:\n\t  if ((ins & 0x800) == 0) {\n\t    CK((n & 3) == 0 && ((n+0x02000000) >> 26) == 0, RANGE_REL);\n\t    cp[-1] |= ((n >> 2) & 0x00ffffff);\n\t  } else if ((ins & 0x1000)) {\n\t    CK((n & 3) == 0 && -256 <= n && n <= 256, RANGE_REL);\n\t    goto patchimml8;\n\t  } else if ((ins & 0x2000) == 0) {\n\t    CK((n & 3) == 0 && -4096 <= n && n <= 4096, RANGE_REL);\n\t    goto patchimml;\n\t  } else {\n\t    CK((n & 3) == 0 && -1020 <= n && n <= 1020, RANGE_REL);\n\t    n >>= 2;\n\t    goto patchimml;\n\t  }\n\t  break;\n\tcase DASM_LABEL_LG:\n\t  ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n);\n\t  break;\n\tcase DASM_LABEL_PC: break;\n\tcase DASM_IMM:\n\t  cp[-1] |= ((n>>((ins>>10)&31)) & ((1<<((ins>>5)&31))-1)) << (ins&31);\n\t  break;\n\tcase DASM_IMM12:\n\t  cp[-1] |= dasm_imm12((unsigned int)n);\n\t  break;\n\tcase DASM_IMM16:\n\t  cp[-1] |= ((n & 0xf000) << 4) | (n & 0x0fff);\n\t  break;\n\tcase DASM_IMML8: patchimml8:\n\t  cp[-1] |= n >= 0 ? (0x00800000 | (n & 0x0f) | ((n & 0xf0) << 4)) :\n\t\t\t     ((-n & 0x0f) | ((-n & 0xf0) << 4));\n\t  break;\n\tcase DASM_IMML12: case DASM_IMMV8: patchimml:\n\t  cp[-1] |= n >= 0 ? (0x00800000 | n) : (-n);\n\t  break;\n\tdefault: *cp++ = ins; break;\n\t}\n      }\n      stop: (void)0;\n    }\n  }\n\n  if (base + D->codesize != (char *)cp)  /* Check for phase errors. */\n    return DASM_S_PHASE;\n  return DASM_S_OK;\n}\n#undef CK\n\n/* Get PC label offset. */\nint dasm_getpclabel(Dst_DECL, unsigned int pc)\n{\n  dasm_State *D = Dst_REF;\n  if (pc*sizeof(int) < D->pcsize) {\n    int pos = D->pclabels[pc];\n    if (pos < 0) return *DASM_POS2PTR(D, -pos);\n    if (pos > 0) return -1;  /* Undefined. */\n  }\n  return -2;  /* Unused or out of range. */\n}\n\n#ifdef DASM_CHECKS\n/* Optional sanity checker to call between isolated encoding steps. */\nint dasm_checkstep(Dst_DECL, int secmatch)\n{\n  dasm_State *D = Dst_REF;\n  if (D->status == DASM_S_OK) {\n    int i;\n    for (i = 1; i <= 9; i++) {\n      if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_LG|i; break; }\n      D->lglabels[i] = 0;\n    }\n  }\n  if (D->status == DASM_S_OK && secmatch >= 0 &&\n      D->section != &D->sections[secmatch])\n    D->status = DASM_S_MATCH_SEC|(D->section-D->sections);\n  return D->status;\n}\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_arm.lua",
    "content": "------------------------------------------------------------------------------\n-- DynASM ARM module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- See dynasm.lua for full copyright notice.\n------------------------------------------------------------------------------\n\n-- Module information:\nlocal _info = {\n  arch =\t\"arm\",\n  description =\t\"DynASM ARM module\",\n  version =\t\"1.3.0\",\n  vernum =\t 10300,\n  release =\t\"2011-05-05\",\n  author =\t\"Mike Pall\",\n  license =\t\"MIT\",\n}\n\n-- Exported glue functions for the arch-specific module.\nlocal _M = { _info = _info }\n\n-- Cache library functions.\nlocal type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs\nlocal assert, setmetatable, rawget = assert, setmetatable, rawget\nlocal _s = string\nlocal sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char\nlocal match, gmatch, gsub = _s.match, _s.gmatch, _s.gsub\nlocal concat, sort, insert = table.concat, table.sort, table.insert\nlocal bit = bit or require(\"bit\")\nlocal band, shl, shr, sar = bit.band, bit.lshift, bit.rshift, bit.arshift\nlocal ror, tohex = bit.ror, bit.tohex\n\n-- Inherited tables and callbacks.\nlocal g_opt, g_arch\nlocal wline, werror, wfatal, wwarn\n\n-- Action name list.\n-- CHECK: Keep this in sync with the C code!\nlocal action_names = {\n  \"STOP\", \"SECTION\", \"ESC\", \"REL_EXT\",\n  \"ALIGN\", \"REL_LG\", \"LABEL_LG\",\n  \"REL_PC\", \"LABEL_PC\", \"IMM\", \"IMM12\", \"IMM16\", \"IMML8\", \"IMML12\", \"IMMV8\",\n}\n\n-- Maximum number of section buffer positions for dasm_put().\n-- CHECK: Keep this in sync with the C code!\nlocal maxsecpos = 25 -- Keep this low, to avoid excessively long C lines.\n\n-- Action name -> action number.\nlocal map_action = {}\nfor n,name in ipairs(action_names) do\n  map_action[name] = n-1\nend\n\n-- Action list buffer.\nlocal actlist = {}\n\n-- Argument list for next dasm_put(). Start with offset 0 into action list.\nlocal actargs = { 0 }\n\n-- Current number of section buffer positions for dasm_put().\nlocal secpos = 1\n\n------------------------------------------------------------------------------\n\n-- Dump action names and numbers.\nlocal function dumpactions(out)\n  out:write(\"DynASM encoding engine action codes:\\n\")\n  for n,name in ipairs(action_names) do\n    local num = map_action[name]\n    out:write(format(\"  %-10s %02X  %d\\n\", name, num, num))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write action list buffer as a huge static C array.\nlocal function writeactions(out, name)\n  local nn = #actlist\n  if nn == 0 then nn = 1; actlist[0] = map_action.STOP end\n  out:write(\"static const unsigned int \", name, \"[\", nn, \"] = {\\n\")\n  for i = 1,nn-1 do\n    assert(out:write(\"0x\", tohex(actlist[i]), \",\\n\"))\n  end\n  assert(out:write(\"0x\", tohex(actlist[nn]), \"\\n};\\n\\n\"))\nend\n\n------------------------------------------------------------------------------\n\n-- Add word to action list.\nlocal function wputxw(n)\n  assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, \"word out of range\")\n  actlist[#actlist+1] = n\nend\n\n-- Add action to list with optional arg. Advance buffer pos, too.\nlocal function waction(action, val, a, num)\n  local w = assert(map_action[action], \"bad action name `\"..action..\"'\")\n  wputxw(w * 0x10000 + (val or 0))\n  if a then actargs[#actargs+1] = a end\n  if a or num then secpos = secpos + (num or 1) end\nend\n\n-- Flush action list (intervening C code or buffer pos overflow).\nlocal function wflush(term)\n  if #actlist == actargs[1] then return end -- Nothing to flush.\n  if not term then waction(\"STOP\") end -- Terminate action list.\n  wline(format(\"dasm_put(Dst, %s);\", concat(actargs, \", \")), true)\n  actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put().\n  secpos = 1 -- The actionlist offset occupies a buffer position, too.\nend\n\n-- Put escaped word.\nlocal function wputw(n)\n  if n <= 0x000fffff then waction(\"ESC\") end\n  wputxw(n)\nend\n\n-- Reserve position for word.\nlocal function wpos()\n  local pos = #actlist+1\n  actlist[pos] = \"\"\n  return pos\nend\n\n-- Store word to reserved position.\nlocal function wputpos(pos, n)\n  assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, \"word out of range\")\n  if n <= 0x000fffff then\n    insert(actlist, pos+1, n)\n    n = map_action.ESC * 0x10000\n  end\n  actlist[pos] = n\nend\n\n------------------------------------------------------------------------------\n\n-- Global label name -> global label number. With auto assignment on 1st use.\nlocal next_global = 20\nlocal map_global = setmetatable({}, { __index = function(t, name)\n  if not match(name, \"^[%a_][%w_]*$\") then werror(\"bad global label\") end\n  local n = next_global\n  if n > 2047 then werror(\"too many global labels\") end\n  next_global = n + 1\n  t[name] = n\n  return n\nend})\n\n-- Dump global labels.\nlocal function dumpglobals(out, lvl)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"Global labels:\\n\")\n  for i=20,next_global-1 do\n    out:write(format(\"  %s\\n\", t[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write global label enum.\nlocal function writeglobals(out, prefix)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"enum {\\n\")\n  for i=20,next_global-1 do\n    out:write(\"  \", prefix, t[i], \",\\n\")\n  end\n  out:write(\"  \", prefix, \"_MAX\\n};\\n\")\nend\n\n-- Write global label names.\nlocal function writeglobalnames(out, name)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=20,next_global-1 do\n    out:write(\"  \\\"\", t[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Extern label name -> extern label number. With auto assignment on 1st use.\nlocal next_extern = 0\nlocal map_extern_ = {}\nlocal map_extern = setmetatable({}, { __index = function(t, name)\n  -- No restrictions on the name for now.\n  local n = next_extern\n  if n > 2047 then werror(\"too many extern labels\") end\n  next_extern = n + 1\n  t[name] = n\n  map_extern_[n] = name\n  return n\nend})\n\n-- Dump extern labels.\nlocal function dumpexterns(out, lvl)\n  out:write(\"Extern labels:\\n\")\n  for i=0,next_extern-1 do\n    out:write(format(\"  %s\\n\", map_extern_[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write extern label names.\nlocal function writeexternnames(out, name)\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=0,next_extern-1 do\n    out:write(\"  \\\"\", map_extern_[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Arch-specific maps.\n\n-- Ext. register name -> int. name.\nlocal map_archdef = { sp = \"r13\", lr = \"r14\", pc = \"r15\", }\n\n-- Int. register name -> ext. name.\nlocal map_reg_rev = { r13 = \"sp\", r14 = \"lr\", r15 = \"pc\", }\n\nlocal map_type = {}\t\t-- Type name -> { ctype, reg }\nlocal ctypenum = 0\t\t-- Type number (for Dt... macros).\n\n-- Reverse defines for registers.\nfunction _M.revdef(s)\n  return map_reg_rev[s] or s\nend\n\nlocal map_shift = { lsl = 0, lsr = 1, asr = 2, ror = 3, }\n\nlocal map_cond = {\n  eq = 0, ne = 1, cs = 2, cc = 3, mi = 4, pl = 5, vs = 6, vc = 7,\n  hi = 8, ls = 9, ge = 10, lt = 11, gt = 12, le = 13, al = 14,\n  hs = 2, lo = 3,\n}\n\n------------------------------------------------------------------------------\n\n-- Template strings for ARM instructions.\nlocal map_op = {\n  -- Basic data processing instructions.\n  and_3 = \"e0000000DNPs\",\n  eor_3 = \"e0200000DNPs\",\n  sub_3 = \"e0400000DNPs\",\n  rsb_3 = \"e0600000DNPs\",\n  add_3 = \"e0800000DNPs\",\n  adc_3 = \"e0a00000DNPs\",\n  sbc_3 = \"e0c00000DNPs\",\n  rsc_3 = \"e0e00000DNPs\",\n  tst_2 = \"e1100000NP\",\n  teq_2 = \"e1300000NP\",\n  cmp_2 = \"e1500000NP\",\n  cmn_2 = \"e1700000NP\",\n  orr_3 = \"e1800000DNPs\",\n  mov_2 = \"e1a00000DPs\",\n  bic_3 = \"e1c00000DNPs\",\n  mvn_2 = \"e1e00000DPs\",\n\n  and_4 = \"e0000000DNMps\",\n  eor_4 = \"e0200000DNMps\",\n  sub_4 = \"e0400000DNMps\",\n  rsb_4 = \"e0600000DNMps\",\n  add_4 = \"e0800000DNMps\",\n  adc_4 = \"e0a00000DNMps\",\n  sbc_4 = \"e0c00000DNMps\",\n  rsc_4 = \"e0e00000DNMps\",\n  tst_3 = \"e1100000NMp\",\n  teq_3 = \"e1300000NMp\",\n  cmp_3 = \"e1500000NMp\",\n  cmn_3 = \"e1700000NMp\",\n  orr_4 = \"e1800000DNMps\",\n  mov_3 = \"e1a00000DMps\",\n  bic_4 = \"e1c00000DNMps\",\n  mvn_3 = \"e1e00000DMps\",\n\n  lsl_3 = \"e1a00000DMws\",\n  lsr_3 = \"e1a00020DMws\",\n  asr_3 = \"e1a00040DMws\",\n  ror_3 = \"e1a00060DMws\",\n  rrx_2 = \"e1a00060DMs\",\n\n  -- Multiply and multiply-accumulate.\n  mul_3 = \"e0000090NMSs\",\n  mla_4 = \"e0200090NMSDs\",\n  umaal_4 = \"e0400090DNMSs\",\t-- v6\n  mls_4 = \"e0600090DNMSs\",\t-- v6T2\n  umull_4 = \"e0800090DNMSs\",\n  umlal_4 = \"e0a00090DNMSs\",\n  smull_4 = \"e0c00090DNMSs\",\n  smlal_4 = \"e0e00090DNMSs\",\n\n  -- Halfword multiply and multiply-accumulate.\n  smlabb_4 = \"e1000080NMSD\",\t-- v5TE\n  smlatb_4 = \"e10000a0NMSD\",\t-- v5TE\n  smlabt_4 = \"e10000c0NMSD\",\t-- v5TE\n  smlatt_4 = \"e10000e0NMSD\",\t-- v5TE\n  smlawb_4 = \"e1200080NMSD\",\t-- v5TE\n  smulwb_3 = \"e12000a0NMS\",\t-- v5TE\n  smlawt_4 = \"e12000c0NMSD\",\t-- v5TE\n  smulwt_3 = \"e12000e0NMS\",\t-- v5TE\n  smlalbb_4 = \"e1400080NMSD\",\t-- v5TE\n  smlaltb_4 = \"e14000a0NMSD\",\t-- v5TE\n  smlalbt_4 = \"e14000c0NMSD\",\t-- v5TE\n  smlaltt_4 = \"e14000e0NMSD\",\t-- v5TE\n  smulbb_3 = \"e1600080NMS\",\t-- v5TE\n  smultb_3 = \"e16000a0NMS\",\t-- v5TE\n  smulbt_3 = \"e16000c0NMS\",\t-- v5TE\n  smultt_3 = \"e16000e0NMS\",\t-- v5TE\n\n  -- Miscellaneous data processing instructions.\n  clz_2 = \"e16f0f10DM\", -- v5T\n  rev_2 = \"e6bf0f30DM\", -- v6\n  rev16_2 = \"e6bf0fb0DM\", -- v6\n  revsh_2 = \"e6ff0fb0DM\", -- v6\n  sel_3 = \"e6800fb0DNM\", -- v6\n  usad8_3 = \"e780f010NMS\", -- v6\n  usada8_4 = \"e7800010NMSD\", -- v6\n  rbit_2 = \"e6ff0f30DM\", -- v6T2\n  movw_2 = \"e3000000DW\", -- v6T2\n  movt_2 = \"e3400000DW\", -- v6T2\n  -- Note: the X encodes width-1, not width.\n  sbfx_4 = \"e7a00050DMvX\", -- v6T2\n  ubfx_4 = \"e7e00050DMvX\", -- v6T2\n  -- Note: the X encodes the msb field, not the width.\n  bfc_3 = \"e7c0001fDvX\", -- v6T2\n  bfi_4 = \"e7c00010DMvX\", -- v6T2\n\n  -- Packing and unpacking instructions.\n  pkhbt_3 = \"e6800010DNM\", pkhbt_4 = \"e6800010DNMv\", -- v6\n  pkhtb_3 = \"e6800050DNM\", pkhtb_4 = \"e6800050DNMv\", -- v6\n  sxtab_3 = \"e6a00070DNM\", sxtab_4 = \"e6a00070DNMv\", -- v6\n  sxtab16_3 = \"e6800070DNM\", sxtab16_4 = \"e6800070DNMv\", -- v6\n  sxtah_3 = \"e6b00070DNM\", sxtah_4 = \"e6b00070DNMv\", -- v6\n  sxtb_2 = \"e6af0070DM\", sxtb_3 = \"e6af0070DMv\", -- v6\n  sxtb16_2 = \"e68f0070DM\", sxtb16_3 = \"e68f0070DMv\", -- v6\n  sxth_2 = \"e6bf0070DM\", sxth_3 = \"e6bf0070DMv\", -- v6\n  uxtab_3 = \"e6e00070DNM\", uxtab_4 = \"e6e00070DNMv\", -- v6\n  uxtab16_3 = \"e6c00070DNM\", uxtab16_4 = \"e6c00070DNMv\", -- v6\n  uxtah_3 = \"e6f00070DNM\", uxtah_4 = \"e6f00070DNMv\", -- v6\n  uxtb_2 = \"e6ef0070DM\", uxtb_3 = \"e6ef0070DMv\", -- v6\n  uxtb16_2 = \"e6cf0070DM\", uxtb16_3 = \"e6cf0070DMv\", -- v6\n  uxth_2 = \"e6ff0070DM\", uxth_3 = \"e6ff0070DMv\", -- v6\n\n  -- Saturating instructions.\n  qadd_3 = \"e1000050DMN\",\t-- v5TE\n  qsub_3 = \"e1200050DMN\",\t-- v5TE\n  qdadd_3 = \"e1400050DMN\",\t-- v5TE\n  qdsub_3 = \"e1600050DMN\",\t-- v5TE\n  -- Note: the X for ssat* encodes sat_imm-1, not sat_imm.\n  ssat_3 = \"e6a00010DXM\", ssat_4 = \"e6a00010DXMp\", -- v6\n  usat_3 = \"e6e00010DXM\", usat_4 = \"e6e00010DXMp\", -- v6\n  ssat16_3 = \"e6a00f30DXM\", -- v6\n  usat16_3 = \"e6e00f30DXM\", -- v6\n\n  -- Parallel addition and subtraction.\n  sadd16_3 = \"e6100f10DNM\", -- v6\n  sasx_3 = \"e6100f30DNM\", -- v6\n  ssax_3 = \"e6100f50DNM\", -- v6\n  ssub16_3 = \"e6100f70DNM\", -- v6\n  sadd8_3 = \"e6100f90DNM\", -- v6\n  ssub8_3 = \"e6100ff0DNM\", -- v6\n  qadd16_3 = \"e6200f10DNM\", -- v6\n  qasx_3 = \"e6200f30DNM\", -- v6\n  qsax_3 = \"e6200f50DNM\", -- v6\n  qsub16_3 = \"e6200f70DNM\", -- v6\n  qadd8_3 = \"e6200f90DNM\", -- v6\n  qsub8_3 = \"e6200ff0DNM\", -- v6\n  shadd16_3 = \"e6300f10DNM\", -- v6\n  shasx_3 = \"e6300f30DNM\", -- v6\n  shsax_3 = \"e6300f50DNM\", -- v6\n  shsub16_3 = \"e6300f70DNM\", -- v6\n  shadd8_3 = \"e6300f90DNM\", -- v6\n  shsub8_3 = \"e6300ff0DNM\", -- v6\n  uadd16_3 = \"e6500f10DNM\", -- v6\n  uasx_3 = \"e6500f30DNM\", -- v6\n  usax_3 = \"e6500f50DNM\", -- v6\n  usub16_3 = \"e6500f70DNM\", -- v6\n  uadd8_3 = \"e6500f90DNM\", -- v6\n  usub8_3 = \"e6500ff0DNM\", -- v6\n  uqadd16_3 = \"e6600f10DNM\", -- v6\n  uqasx_3 = \"e6600f30DNM\", -- v6\n  uqsax_3 = \"e6600f50DNM\", -- v6\n  uqsub16_3 = \"e6600f70DNM\", -- v6\n  uqadd8_3 = \"e6600f90DNM\", -- v6\n  uqsub8_3 = \"e6600ff0DNM\", -- v6\n  uhadd16_3 = \"e6700f10DNM\", -- v6\n  uhasx_3 = \"e6700f30DNM\", -- v6\n  uhsax_3 = \"e6700f50DNM\", -- v6\n  uhsub16_3 = \"e6700f70DNM\", -- v6\n  uhadd8_3 = \"e6700f90DNM\", -- v6\n  uhsub8_3 = \"e6700ff0DNM\", -- v6\n\n  -- Load/store instructions.\n  str_2 = \"e4000000DL\", str_3 = \"e4000000DL\", str_4 = \"e4000000DL\",\n  strb_2 = \"e4400000DL\", strb_3 = \"e4400000DL\", strb_4 = \"e4400000DL\",\n  ldr_2 = \"e4100000DL\", ldr_3 = \"e4100000DL\", ldr_4 = \"e4100000DL\",\n  ldrb_2 = \"e4500000DL\", ldrb_3 = \"e4500000DL\", ldrb_4 = \"e4500000DL\",\n  strh_2 = \"e00000b0DL\", strh_3 = \"e00000b0DL\",\n  ldrh_2 = \"e01000b0DL\", ldrh_3 = \"e01000b0DL\",\n  ldrd_2 = \"e00000d0DL\", ldrd_3 = \"e00000d0DL\", -- v5TE\n  ldrsb_2 = \"e01000d0DL\", ldrsb_3 = \"e01000d0DL\",\n  strd_2 = \"e00000f0DL\", strd_3 = \"e00000f0DL\", -- v5TE\n  ldrsh_2 = \"e01000f0DL\", ldrsh_3 = \"e01000f0DL\",\n\n  ldm_2 = \"e8900000oR\", ldmia_2 = \"e8900000oR\", ldmfd_2 = \"e8900000oR\",\n  ldmda_2 = \"e8100000oR\", ldmfa_2 = \"e8100000oR\",\n  ldmdb_2 = \"e9100000oR\", ldmea_2 = \"e9100000oR\",\n  ldmib_2 = \"e9900000oR\", ldmed_2 = \"e9900000oR\",\n  stm_2 = \"e8800000oR\", stmia_2 = \"e8800000oR\", stmfd_2 = \"e8800000oR\",\n  stmda_2 = \"e8000000oR\", stmfa_2 = \"e8000000oR\",\n  stmdb_2 = \"e9000000oR\", stmea_2 = \"e9000000oR\",\n  stmib_2 = \"e9800000oR\", stmed_2 = \"e9800000oR\",\n  pop_1 = \"e8bd0000R\", push_1 = \"e92d0000R\",\n\n  -- Branch instructions.\n  b_1 = \"ea000000B\",\n  bl_1 = \"eb000000B\",\n  blx_1 = \"e12fff30C\",\n  bx_1 = \"e12fff10M\",\n\n  -- Miscellaneous instructions.\n  nop_0 = \"e1a00000\",\n  mrs_1 = \"e10f0000D\",\n  bkpt_1 = \"e1200070K\", -- v5T\n  svc_1 = \"ef000000T\", swi_1 = \"ef000000T\",\n  ud_0 = \"e7f001f0\",\n\n  -- VFP instructions.\n  [\"vadd.f32_3\"] = \"ee300a00dnm\",\n  [\"vadd.f64_3\"] = \"ee300b00Gdnm\",\n  [\"vsub.f32_3\"] = \"ee300a40dnm\",\n  [\"vsub.f64_3\"] = \"ee300b40Gdnm\",\n  [\"vmul.f32_3\"] = \"ee200a00dnm\",\n  [\"vmul.f64_3\"] = \"ee200b00Gdnm\",\n  [\"vnmul.f32_3\"] = \"ee200a40dnm\",\n  [\"vnmul.f64_3\"] = \"ee200b40Gdnm\",\n  [\"vmla.f32_3\"] = \"ee000a00dnm\",\n  [\"vmla.f64_3\"] = \"ee000b00Gdnm\",\n  [\"vmls.f32_3\"] = \"ee000a40dnm\",\n  [\"vmls.f64_3\"] = \"ee000b40Gdnm\",\n  [\"vnmla.f32_3\"] = \"ee100a40dnm\",\n  [\"vnmla.f64_3\"] = \"ee100b40Gdnm\",\n  [\"vnmls.f32_3\"] = \"ee100a00dnm\",\n  [\"vnmls.f64_3\"] = \"ee100b00Gdnm\",\n  [\"vdiv.f32_3\"] = \"ee800a00dnm\",\n  [\"vdiv.f64_3\"] = \"ee800b00Gdnm\",\n\n  [\"vabs.f32_2\"] = \"eeb00ac0dm\",\n  [\"vabs.f64_2\"] = \"eeb00bc0Gdm\",\n  [\"vneg.f32_2\"] = \"eeb10a40dm\",\n  [\"vneg.f64_2\"] = \"eeb10b40Gdm\",\n  [\"vsqrt.f32_2\"] = \"eeb10ac0dm\",\n  [\"vsqrt.f64_2\"] = \"eeb10bc0Gdm\",\n  [\"vcmp.f32_2\"] = \"eeb40a40dm\",\n  [\"vcmp.f64_2\"] = \"eeb40b40Gdm\",\n  [\"vcmpe.f32_2\"] = \"eeb40ac0dm\",\n  [\"vcmpe.f64_2\"] = \"eeb40bc0Gdm\",\n  [\"vcmpz.f32_1\"] = \"eeb50a40d\",\n  [\"vcmpz.f64_1\"] = \"eeb50b40Gd\",\n  [\"vcmpze.f32_1\"] = \"eeb50ac0d\",\n  [\"vcmpze.f64_1\"] = \"eeb50bc0Gd\",\n\n  vldr_2 = \"ed100a00dl|ed100b00Gdl\",\n  vstr_2 = \"ed000a00dl|ed000b00Gdl\",\n  vldm_2 = \"ec900a00or\",\n  vldmia_2 = \"ec900a00or\",\n  vldmdb_2 = \"ed100a00or\",\n  vpop_1 = \"ecbd0a00r\",\n  vstm_2 = \"ec800a00or\",\n  vstmia_2 = \"ec800a00or\",\n  vstmdb_2 = \"ed000a00or\",\n  vpush_1 = \"ed2d0a00r\",\n\n  [\"vmov.f32_2\"] = \"eeb00a40dm|eeb00a00dY\",\t-- #imm is VFPv3 only\n  [\"vmov.f64_2\"] = \"eeb00b40Gdm|eeb00b00GdY\",\t-- #imm is VFPv3 only\n  vmov_2 = \"ee100a10Dn|ee000a10nD\",\n  vmov_3 = \"ec500a10DNm|ec400a10mDN|ec500b10GDNm|ec400b10GmDN\",\n\n  vmrs_0 = \"eef1fa10\",\n  vmrs_1 = \"eef10a10D\",\n  vmsr_1 = \"eee10a10D\",\n\n  [\"vcvt.s32.f32_2\"] = \"eebd0ac0dm\",\n  [\"vcvt.s32.f64_2\"] = \"eebd0bc0dGm\",\n  [\"vcvt.u32.f32_2\"] = \"eebc0ac0dm\",\n  [\"vcvt.u32.f64_2\"] = \"eebc0bc0dGm\",\n  [\"vcvtr.s32.f32_2\"] = \"eebd0a40dm\",\n  [\"vcvtr.s32.f64_2\"] = \"eebd0b40dGm\",\n  [\"vcvtr.u32.f32_2\"] = \"eebc0a40dm\",\n  [\"vcvtr.u32.f64_2\"] = \"eebc0b40dGm\",\n  [\"vcvt.f32.s32_2\"] = \"eeb80ac0dm\",\n  [\"vcvt.f64.s32_2\"] = \"eeb80bc0GdFm\",\n  [\"vcvt.f32.u32_2\"] = \"eeb80a40dm\",\n  [\"vcvt.f64.u32_2\"] = \"eeb80b40GdFm\",\n  [\"vcvt.f32.f64_2\"] = \"eeb70bc0dGm\",\n  [\"vcvt.f64.f32_2\"] = \"eeb70ac0GdFm\",\n\n  -- VFPv4 only:\n  [\"vfma.f32_3\"] = \"eea00a00dnm\",\n  [\"vfma.f64_3\"] = \"eea00b00Gdnm\",\n  [\"vfms.f32_3\"] = \"eea00a40dnm\",\n  [\"vfms.f64_3\"] = \"eea00b40Gdnm\",\n  [\"vfnma.f32_3\"] = \"ee900a40dnm\",\n  [\"vfnma.f64_3\"] = \"ee900b40Gdnm\",\n  [\"vfnms.f32_3\"] = \"ee900a00dnm\",\n  [\"vfnms.f64_3\"] = \"ee900b00Gdnm\",\n\n  -- NYI: Advanced SIMD instructions.\n\n  -- NYI: I have no need for these instructions right now:\n  -- swp, swpb, strex, ldrex, strexd, ldrexd, strexb, ldrexb, strexh, ldrexh\n  -- msr, nopv6, yield, wfe, wfi, sev, dbg, bxj, smc, srs, rfe\n  -- cps, setend, pli, pld, pldw, clrex, dsb, dmb, isb\n  -- stc, ldc, mcr, mcr2, mrc, mrc2, mcrr, mcrr2, mrrc, mrrc2, cdp, cdp2\n}\n\n-- Add mnemonics for \"s\" variants.\ndo\n  local t = {}\n  for k,v in pairs(map_op) do\n    if sub(v, -1) == \"s\" then\n      local v2 = sub(v, 1, 2)..char(byte(v, 3)+1)..sub(v, 4, -2)\n      t[sub(k, 1, -3)..\"s\"..sub(k, -2)] = v2\n    end\n  end\n  for k,v in pairs(t) do\n    map_op[k] = v\n  end\nend\n\n------------------------------------------------------------------------------\n\nlocal function parse_gpr(expr)\n  local tname, ovreg = match(expr, \"^([%w_]+):(r1?[0-9])$\")\n  local tp = map_type[tname or expr]\n  if tp then\n    local reg = ovreg or tp.reg\n    if not reg then\n      werror(\"type `\"..(tname or expr)..\"' needs a register override\")\n    end\n    expr = reg\n  end\n  local r = match(expr, \"^r(1?[0-9])$\")\n  if r then\n    r = tonumber(r)\n    if r <= 15 then return r, tp end\n  end\n  werror(\"bad register name `\"..expr..\"'\")\nend\n\nlocal function parse_gpr_pm(expr)\n  local pm, expr2 = match(expr, \"^([+-]?)(.*)$\")\n  return parse_gpr(expr2), (pm == \"-\")\nend\n\nlocal function parse_vr(expr, tp)\n  local t, r = match(expr, \"^([sd])([0-9]+)$\")\n  if t == tp then\n    r = tonumber(r)\n    if r <= 31 then\n      if t == \"s\" then return shr(r, 1), band(r, 1) end\n      return band(r, 15), shr(r, 4)\n    end\n  end\n  werror(\"bad register name `\"..expr..\"'\")\nend\n\nlocal function parse_reglist(reglist)\n  reglist = match(reglist, \"^{%s*([^}]*)}$\")\n  if not reglist then werror(\"register list expected\") end\n  local rr = 0\n  for p in gmatch(reglist..\",\", \"%s*([^,]*),\") do\n    local rbit = shl(1, parse_gpr(gsub(p, \"%s+$\", \"\")))\n    if band(rr, rbit) ~= 0 then\n      werror(\"duplicate register `\"..p..\"'\")\n    end\n    rr = rr + rbit\n  end\n  return rr\nend\n\nlocal function parse_vrlist(reglist)\n  local ta, ra, tb, rb = match(reglist,\n\t\t\t   \"^{%s*([sd])([0-9]+)%s*%-%s*([sd])([0-9]+)%s*}$\")\n  ra, rb = tonumber(ra), tonumber(rb)\n  if ta and ta == tb and ra and rb and ra <= 31 and rb <= 31 and ra <= rb then\n    local nr = rb+1 - ra\n    if ta == \"s\" then\n      return shl(shr(ra,1),12)+shl(band(ra,1),22) + nr\n    else\n      return shl(band(ra,15),12)+shl(shr(ra,4),22) + nr*2 + 0x100\n    end\n  end\n  werror(\"register list expected\")\nend\n\nlocal function parse_imm(imm, bits, shift, scale, signed)\n  imm = match(imm, \"^#(.*)$\")\n  if not imm then werror(\"expected immediate operand\") end\n  local n = tonumber(imm)\n  if n then\n    local m = sar(n, scale)\n    if shl(m, scale) == n then\n      if signed then\n\tlocal s = sar(m, bits-1)\n\tif s == 0 then return shl(m, shift)\n\telseif s == -1 then return shl(m + shl(1, bits), shift) end\n      else\n\tif sar(m, bits) == 0 then return shl(m, shift) end\n      end\n    end\n    werror(\"out of range immediate `\"..imm..\"'\")\n  else\n    waction(\"IMM\", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm)\n    return 0\n  end\nend\n\nlocal function parse_imm12(imm)\n  local n = tonumber(imm)\n  if n then\n    local m = band(n)\n    for i=0,-15,-1 do\n      if shr(m, 8) == 0 then return m + shl(band(i, 15), 8) end\n      m = ror(m, 2)\n    end\n    werror(\"out of range immediate `\"..imm..\"'\")\n  else\n    waction(\"IMM12\", 0, imm)\n    return 0\n  end\nend\n\nlocal function parse_imm16(imm)\n  imm = match(imm, \"^#(.*)$\")\n  if not imm then werror(\"expected immediate operand\") end\n  local n = tonumber(imm)\n  if n then\n    if shr(n, 16) == 0 then return band(n, 0x0fff) + shl(band(n, 0xf000), 4) end\n    werror(\"out of range immediate `\"..imm..\"'\")\n  else\n    waction(\"IMM16\", 32*16, imm)\n    return 0\n  end\nend\n\nlocal function parse_imm_load(imm, ext)\n  local n = tonumber(imm)\n  if n then\n    if ext then\n      if n >= -255 and n <= 255 then\n\tlocal up = 0x00800000\n\tif n < 0 then n = -n; up = 0 end\n\treturn shl(band(n, 0xf0), 4) + band(n, 0x0f) + up\n      end\n    else\n      if n >= -4095 and n <= 4095 then\n\tif n >= 0 then return n+0x00800000 end\n\treturn -n\n      end\n    end\n    werror(\"out of range immediate `\"..imm..\"'\")\n  else\n    waction(ext and \"IMML8\" or \"IMML12\", 32768 + shl(ext and 8 or 12, 5), imm)\n    return 0\n  end\nend\n\nlocal function parse_shift(shift, gprok)\n  if shift == \"rrx\" then\n    return 3 * 32\n  else\n    local s, s2 = match(shift, \"^(%S+)%s*(.*)$\")\n    s = map_shift[s]\n    if not s then werror(\"expected shift operand\") end\n    if sub(s2, 1, 1) == \"#\" then\n      return parse_imm(s2, 5, 7, 0, false) + shl(s, 5)\n    else\n      if not gprok then werror(\"expected immediate shift operand\") end\n      return shl(parse_gpr(s2), 8) + shl(s, 5) + 16\n    end\n  end\nend\n\nlocal function parse_label(label, def)\n  local prefix = sub(label, 1, 2)\n  -- =>label (pc label reference)\n  if prefix == \"=>\" then\n    return \"PC\", 0, sub(label, 3)\n  end\n  -- ->name (global label reference)\n  if prefix == \"->\" then\n    return \"LG\", map_global[sub(label, 3)]\n  end\n  if def then\n    -- [1-9] (local label definition)\n    if match(label, \"^[1-9]$\") then\n      return \"LG\", 10+tonumber(label)\n    end\n  else\n    -- [<>][1-9] (local label reference)\n    local dir, lnum = match(label, \"^([<>])([1-9])$\")\n    if dir then -- Fwd: 1-9, Bkwd: 11-19.\n      return \"LG\", lnum + (dir == \">\" and 0 or 10)\n    end\n    -- extern label (extern label reference)\n    local extname = match(label, \"^extern%s+(%S+)$\")\n    if extname then\n      return \"EXT\", map_extern[extname]\n    end\n  end\n  werror(\"bad label `\"..label..\"'\")\nend\n\nlocal function parse_load(params, nparams, n, op)\n  local oplo = band(op, 255)\n  local ext, ldrd = (oplo ~= 0), (oplo == 208)\n  local d\n  if (ldrd or oplo == 240) then\n    d = band(shr(op, 12), 15)\n    if band(d, 1) ~= 0 then werror(\"odd destination register\") end\n  end\n  local pn = params[n]\n  local p1, wb = match(pn, \"^%[%s*(.-)%s*%](!?)$\")\n  local p2 = params[n+1]\n  if not p1 then\n    if not p2 then\n      if match(pn, \"^[<>=%-]\") or match(pn, \"^extern%s+\") then\n\tlocal mode, n, s = parse_label(pn, false)\n\twaction(\"REL_\"..mode, n + (ext and 0x1800 or 0x0800), s, 1)\n\treturn op + 15 * 65536 + 0x01000000 + (ext and 0x00400000 or 0)\n      end\n      local reg, tailr = match(pn, \"^([%w_:]+)%s*(.*)$\")\n      if reg and tailr ~= \"\" then\n\tlocal d, tp = parse_gpr(reg)\n\tif tp then\n\t  waction(ext and \"IMML8\" or \"IMML12\", 32768 + 32*(ext and 8 or 12),\n\t\t  format(tp.ctypefmt, tailr))\n\t  return op + shl(d, 16) + 0x01000000 + (ext and 0x00400000 or 0)\n\tend\n      end\n    end\n    werror(\"expected address operand\")\n  end\n  if wb == \"!\" then op = op + 0x00200000 end\n  if p2 then\n    if wb == \"!\" then werror(\"bad use of '!'\") end\n    local p3 = params[n+2]\n    op = op + shl(parse_gpr(p1), 16)\n    local imm = match(p2, \"^#(.*)$\")\n    if imm then\n      local m = parse_imm_load(imm, ext)\n      if p3 then werror(\"too many parameters\") end\n      op = op + m + (ext and 0x00400000 or 0)\n    else\n      local m, neg = parse_gpr_pm(p2)\n      if ldrd and (m == d or m-1 == d) then werror(\"register conflict\") end\n      op = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000)\n      if p3 then op = op + parse_shift(p3) end\n    end\n  else\n    local p1a, p2 = match(p1, \"^([^,%s]*)%s*(.*)$\")\n    op = op + shl(parse_gpr(p1a), 16) + 0x01000000\n    if p2 ~= \"\" then\n      local imm = match(p2, \"^,%s*#(.*)$\")\n      if imm then\n\tlocal m = parse_imm_load(imm, ext)\n\top = op + m + (ext and 0x00400000 or 0)\n      else\n\tlocal p2a, p3 = match(p2, \"^,%s*([^,%s]*)%s*,?%s*(.*)$\")\n\tlocal m, neg = parse_gpr_pm(p2a)\n\tif ldrd and (m == d or m-1 == d) then werror(\"register conflict\") end\n\top = op + m + (neg and 0 or 0x00800000) + (ext and 0 or 0x02000000)\n\tif p3 ~= \"\" then\n\t  if ext then werror(\"too many parameters\") end\n\t  op = op + parse_shift(p3)\n\tend\n      end\n    else\n      if wb == \"!\" then werror(\"bad use of '!'\") end\n      op = op + (ext and 0x00c00000 or 0x00800000)\n    end\n  end\n  return op\nend\n\nlocal function parse_vload(q)\n  local reg, imm = match(q, \"^%[%s*([^,%s]*)%s*(.*)%]$\")\n  if reg then\n    local d = shl(parse_gpr(reg), 16)\n    if imm == \"\" then return d end\n    imm = match(imm, \"^,%s*#(.*)$\")\n    if imm then\n      local n = tonumber(imm)\n      if n then\n\tif n >= -1020 and n <= 1020 and n%4 == 0 then\n\t  return d + (n >= 0 and n/4+0x00800000 or -n/4)\n\tend\n\twerror(\"out of range immediate `\"..imm..\"'\")\n      else\n\twaction(\"IMMV8\", 32768 + 32*8, imm)\n\treturn d\n      end\n    end\n  else\n    if match(q, \"^[<>=%-]\") or match(q, \"^extern%s+\") then\n      local mode, n, s = parse_label(q, false)\n      waction(\"REL_\"..mode, n + 0x2800, s, 1)\n      return 15 * 65536\n    end\n    local reg, tailr = match(q, \"^([%w_:]+)%s*(.*)$\")\n    if reg and tailr ~= \"\" then\n      local d, tp = parse_gpr(reg)\n      if tp then\n\twaction(\"IMMV8\", 32768 + 32*8, format(tp.ctypefmt, tailr))\n\treturn shl(d, 16)\n      end\n    end\n  end\n  werror(\"expected address operand\")\nend\n\n------------------------------------------------------------------------------\n\n-- Handle opcodes defined with template strings.\nlocal function parse_template(params, template, nparams, pos)\n  local op = tonumber(sub(template, 1, 8), 16)\n  local n = 1\n  local vr = \"s\"\n\n  -- Process each character.\n  for p in gmatch(sub(template, 9), \".\") do\n    local q = params[n]\n    if p == \"D\" then\n      op = op + shl(parse_gpr(q), 12); n = n + 1\n    elseif p == \"N\" then\n      op = op + shl(parse_gpr(q), 16); n = n + 1\n    elseif p == \"S\" then\n      op = op + shl(parse_gpr(q), 8); n = n + 1\n    elseif p == \"M\" then\n      op = op + parse_gpr(q); n = n + 1\n    elseif p == \"d\" then\n      local r,h = parse_vr(q, vr); op = op+shl(r,12)+shl(h,22); n = n + 1\n    elseif p == \"n\" then\n      local r,h = parse_vr(q, vr); op = op+shl(r,16)+shl(h,7); n = n + 1\n    elseif p == \"m\" then\n      local r,h = parse_vr(q, vr); op = op+r+shl(h,5); n = n + 1\n    elseif p == \"P\" then\n      local imm = match(q, \"^#(.*)$\")\n      if imm then\n\top = op + parse_imm12(imm) + 0x02000000\n      else\n\top = op + parse_gpr(q)\n      end\n      n = n + 1\n    elseif p == \"p\" then\n      op = op + parse_shift(q, true); n = n + 1\n    elseif p == \"L\" then\n      op = parse_load(params, nparams, n, op)\n    elseif p == \"l\" then\n      op = op + parse_vload(q)\n    elseif p == \"B\" then\n      local mode, n, s = parse_label(q, false)\n      waction(\"REL_\"..mode, n, s, 1)\n    elseif p == \"C\" then -- blx gpr vs. blx label.\n      if match(q, \"^([%w_]+):(r1?[0-9])$\") or match(q, \"^r(1?[0-9])$\") then\n\top = op + parse_gpr(q)\n      else\n\tif op < 0xe0000000 then werror(\"unconditional instruction\") end\n\tlocal mode, n, s = parse_label(q, false)\n\twaction(\"REL_\"..mode, n, s, 1)\n\top = 0xfa000000\n      end\n    elseif p == \"F\" then\n      vr = \"s\"\n    elseif p == \"G\" then\n      vr = \"d\"\n    elseif p == \"o\" then\n      local r, wb = match(q, \"^([^!]*)(!?)$\")\n      op = op + shl(parse_gpr(r), 16) + (wb == \"!\" and 0x00200000 or 0)\n      n = n + 1\n    elseif p == \"R\" then\n      op = op + parse_reglist(q); n = n + 1\n    elseif p == \"r\" then\n      op = op + parse_vrlist(q); n = n + 1\n    elseif p == \"W\" then\n      op = op + parse_imm16(q); n = n + 1\n    elseif p == \"v\" then\n      op = op + parse_imm(q, 5, 7, 0, false); n = n + 1\n    elseif p == \"w\" then\n      local imm = match(q, \"^#(.*)$\")\n      if imm then\n\top = op + parse_imm(q, 5, 7, 0, false); n = n + 1\n      else\n\top = op + shl(parse_gpr(q), 8) + 16\n      end\n    elseif p == \"X\" then\n      op = op + parse_imm(q, 5, 16, 0, false); n = n + 1\n    elseif p == \"Y\" then\n      local imm = tonumber(match(q, \"^#(.*)$\")); n = n + 1\n      if not imm or shr(imm, 8) ~= 0 then\n\twerror(\"bad immediate operand\")\n      end\n      op = op + shl(band(imm, 0xf0), 12) + band(imm, 0x0f)\n    elseif p == \"K\" then\n      local imm = tonumber(match(q, \"^#(.*)$\")); n = n + 1\n      if not imm or shr(imm, 16) ~= 0 then\n\twerror(\"bad immediate operand\")\n      end\n      op = op + shl(band(imm, 0xfff0), 4) + band(imm, 0x000f)\n    elseif p == \"T\" then\n      op = op + parse_imm(q, 24, 0, 0, false); n = n + 1\n    elseif p == \"s\" then\n      -- Ignored.\n    else\n      assert(false)\n    end\n  end\n  wputpos(pos, op)\nend\n\nmap_op[\".template__\"] = function(params, template, nparams)\n  if not params then return sub(template, 9) end\n\n  -- Limit number of section buffer positions used by a single dasm_put().\n  -- A single opcode needs a maximum of 3 positions.\n  if secpos+3 > maxsecpos then wflush() end\n  local pos = wpos()\n  local apos, spos = #actargs, secpos\n\n  local ok, err\n  for t in gmatch(template, \"[^|]+\") do\n    ok, err = pcall(parse_template, params, t, nparams, pos)\n    if ok then return end\n    secpos = spos\n    actargs[apos+1] = nil\n    actargs[apos+2] = nil\n    actargs[apos+3] = nil\n  end\n  error(err, 0)\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode to mark the position where the action list is to be emitted.\nmap_op[\".actionlist_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeactions(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the global enum is to be emitted.\nmap_op[\".globals_1\"] = function(params)\n  if not params then return \"prefix\" end\n  local prefix = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobals(out, prefix) end)\nend\n\n-- Pseudo-opcode to mark the position where the global names are to be emitted.\nmap_op[\".globalnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobalnames(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the extern names are to be emitted.\nmap_op[\".externnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeexternnames(out, name) end)\nend\n\n------------------------------------------------------------------------------\n\n-- Label pseudo-opcode (converted from trailing colon form).\nmap_op[\".label_1\"] = function(params)\n  if not params then return \"[1-9] | ->global | =>pcexpr\" end\n  if secpos+1 > maxsecpos then wflush() end\n  local mode, n, s = parse_label(params[1], true)\n  if mode == \"EXT\" then werror(\"bad label definition\") end\n  waction(\"LABEL_\"..mode, n, s, 1)\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcodes for data storage.\nmap_op[\".long_*\"] = function(params)\n  if not params then return \"imm...\" end\n  for _,p in ipairs(params) do\n    local n = tonumber(p)\n    if not n then werror(\"bad immediate `\"..p..\"'\") end\n    if n < 0 then n = n + 2^32 end\n    wputw(n)\n    if secpos+2 > maxsecpos then wflush() end\n  end\nend\n\n-- Alignment pseudo-opcode.\nmap_op[\".align_1\"] = function(params)\n  if not params then return \"numpow2\" end\n  if secpos+1 > maxsecpos then wflush() end\n  local align = tonumber(params[1])\n  if align then\n    local x = align\n    -- Must be a power of 2 in the range (2 ... 256).\n    for i=1,8 do\n      x = x / 2\n      if x == 1 then\n\twaction(\"ALIGN\", align-1, nil, 1) -- Action byte is 2**n-1.\n\treturn\n      end\n    end\n  end\n  werror(\"bad alignment\")\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode for (primitive) type definitions (map to C types).\nmap_op[\".type_3\"] = function(params, nparams)\n  if not params then\n    return nparams == 2 and \"name, ctype\" or \"name, ctype, reg\"\n  end\n  local name, ctype, reg = params[1], params[2], params[3]\n  if not match(name, \"^[%a_][%w_]*$\") then\n    werror(\"bad type name `\"..name..\"'\")\n  end\n  local tp = map_type[name]\n  if tp then\n    werror(\"duplicate type `\"..name..\"'\")\n  end\n  -- Add #type to defines. A bit unclean to put it in map_archdef.\n  map_archdef[\"#\"..name] = \"sizeof(\"..ctype..\")\"\n  -- Add new type and emit shortcut define.\n  local num = ctypenum + 1\n  map_type[name] = {\n    ctype = ctype,\n    ctypefmt = format(\"Dt%X(%%s)\", num),\n    reg = reg,\n  }\n  wline(format(\"#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)\", num, ctype))\n  ctypenum = num\nend\nmap_op[\".type_2\"] = map_op[\".type_3\"]\n\n-- Dump type definitions.\nlocal function dumptypes(out, lvl)\n  local t = {}\n  for name in pairs(map_type) do t[#t+1] = name end\n  sort(t)\n  out:write(\"Type definitions:\\n\")\n  for _,name in ipairs(t) do\n    local tp = map_type[name]\n    local reg = tp.reg or \"\"\n    out:write(format(\"  %-20s %-20s %s\\n\", name, tp.ctype, reg))\n  end\n  out:write(\"\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Set the current section.\nfunction _M.section(num)\n  waction(\"SECTION\", num)\n  wflush(true) -- SECTION is a terminal action.\nend\n\n------------------------------------------------------------------------------\n\n-- Dump architecture description.\nfunction _M.dumparch(out)\n  out:write(format(\"DynASM %s version %s, released %s\\n\\n\",\n    _info.arch, _info.version, _info.release))\n  dumpactions(out)\nend\n\n-- Dump all user defined elements.\nfunction _M.dumpdef(out, lvl)\n  dumptypes(out, lvl)\n  dumpglobals(out, lvl)\n  dumpexterns(out, lvl)\nend\n\n------------------------------------------------------------------------------\n\n-- Pass callbacks from/to the DynASM core.\nfunction _M.passcb(wl, we, wf, ww)\n  wline, werror, wfatal, wwarn = wl, we, wf, ww\n  return wflush\nend\n\n-- Setup the arch-specific module.\nfunction _M.setup(arch, opt)\n  g_arch, g_opt = arch, opt\nend\n\n-- Merge the core maps and the arch-specific maps.\nfunction _M.mergemaps(map_coreop, map_def)\n  setmetatable(map_op, { __index = function(t, k)\n    local v = map_coreop[k]\n    if v then return v end\n    local k1, cc, k2 = match(k, \"^(.-)(..)([._].*)$\")\n    local cv = map_cond[cc]\n    if cv then\n      local v = rawget(t, k1..k2)\n      if type(v) == \"string\" then\n\tlocal scv = format(\"%x\", cv)\n\treturn gsub(scv..sub(v, 2), \"|e\", \"|\"..scv)\n      end\n    end\n  end })\n  setmetatable(map_def, { __index = map_archdef })\n  return map_op, map_def\nend\n\nreturn _M\n\n------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_mips.h",
    "content": "/*\n** DynASM MIPS encoding engine.\n** Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n** Released under the MIT license. See dynasm.lua for full copyright notice.\n*/\n\n#include <stddef.h>\n#include <stdarg.h>\n#include <string.h>\n#include <stdlib.h>\n\n#define DASM_ARCH\t\t\"mips\"\n\n#ifndef DASM_EXTERN\n#define DASM_EXTERN(a,b,c,d)\t0\n#endif\n\n/* Action definitions. */\nenum {\n  DASM_STOP, DASM_SECTION, DASM_ESC, DASM_REL_EXT,\n  /* The following actions need a buffer position. */\n  DASM_ALIGN, DASM_REL_LG, DASM_LABEL_LG,\n  /* The following actions also have an argument. */\n  DASM_REL_PC, DASM_LABEL_PC, DASM_IMM,\n  DASM__MAX\n};\n\n/* Maximum number of section buffer positions for a single dasm_put() call. */\n#define DASM_MAXSECPOS\t\t25\n\n/* DynASM encoder status codes. Action list offset or number are or'ed in. */\n#define DASM_S_OK\t\t0x00000000\n#define DASM_S_NOMEM\t\t0x01000000\n#define DASM_S_PHASE\t\t0x02000000\n#define DASM_S_MATCH_SEC\t0x03000000\n#define DASM_S_RANGE_I\t\t0x11000000\n#define DASM_S_RANGE_SEC\t0x12000000\n#define DASM_S_RANGE_LG\t\t0x13000000\n#define DASM_S_RANGE_PC\t\t0x14000000\n#define DASM_S_RANGE_REL\t0x15000000\n#define DASM_S_UNDEF_LG\t\t0x21000000\n#define DASM_S_UNDEF_PC\t\t0x22000000\n\n/* Macros to convert positions (8 bit section + 24 bit index). */\n#define DASM_POS2IDX(pos)\t((pos)&0x00ffffff)\n#define DASM_POS2BIAS(pos)\t((pos)&0xff000000)\n#define DASM_SEC2POS(sec)\t((sec)<<24)\n#define DASM_POS2SEC(pos)\t((pos)>>24)\n#define DASM_POS2PTR(D, pos)\t(D->sections[DASM_POS2SEC(pos)].rbuf + (pos))\n\n/* Action list type. */\ntypedef const unsigned int *dasm_ActList;\n\n/* Per-section structure. */\ntypedef struct dasm_Section {\n  int *rbuf;\t\t/* Biased buffer pointer (negative section bias). */\n  int *buf;\t\t/* True buffer pointer. */\n  size_t bsize;\t\t/* Buffer size in bytes. */\n  int pos;\t\t/* Biased buffer position. */\n  int epos;\t\t/* End of biased buffer position - max single put. */\n  int ofs;\t\t/* Byte offset into section. */\n} dasm_Section;\n\n/* Core structure holding the DynASM encoding state. */\nstruct dasm_State {\n  size_t psize;\t\t\t/* Allocated size of this structure. */\n  dasm_ActList actionlist;\t/* Current actionlist pointer. */\n  int *lglabels;\t\t/* Local/global chain/pos ptrs. */\n  size_t lgsize;\n  int *pclabels;\t\t/* PC label chains/pos ptrs. */\n  size_t pcsize;\n  void **globals;\t\t/* Array of globals (bias -10). */\n  dasm_Section *section;\t/* Pointer to active section. */\n  size_t codesize;\t\t/* Total size of all code sections. */\n  int maxsection;\t\t/* 0 <= sectionidx < maxsection. */\n  int status;\t\t\t/* Status code. */\n  dasm_Section sections[1];\t/* All sections. Alloc-extended. */\n};\n\n/* The size of the core structure depends on the max. number of sections. */\n#define DASM_PSZ(ms)\t(sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section))\n\n\n/* Initialize DynASM state. */\nvoid dasm_init(Dst_DECL, int maxsection)\n{\n  dasm_State *D;\n  size_t psz = 0;\n  int i;\n  Dst_REF = NULL;\n  DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection));\n  D = Dst_REF;\n  D->psize = psz;\n  D->lglabels = NULL;\n  D->lgsize = 0;\n  D->pclabels = NULL;\n  D->pcsize = 0;\n  D->globals = NULL;\n  D->maxsection = maxsection;\n  for (i = 0; i < maxsection; i++) {\n    D->sections[i].buf = NULL;  /* Need this for pass3. */\n    D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i);\n    D->sections[i].bsize = 0;\n    D->sections[i].epos = 0;  /* Wrong, but is recalculated after resize. */\n  }\n}\n\n/* Free DynASM state. */\nvoid dasm_free(Dst_DECL)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  for (i = 0; i < D->maxsection; i++)\n    if (D->sections[i].buf)\n      DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize);\n  if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize);\n  if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize);\n  DASM_M_FREE(Dst, D, D->psize);\n}\n\n/* Setup global label array. Must be called before dasm_setup(). */\nvoid dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl)\n{\n  dasm_State *D = Dst_REF;\n  D->globals = gl - 10;  /* Negative bias to compensate for locals. */\n  DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int));\n}\n\n/* Grow PC label array. Can be called after dasm_setup(), too. */\nvoid dasm_growpc(Dst_DECL, unsigned int maxpc)\n{\n  dasm_State *D = Dst_REF;\n  size_t osz = D->pcsize;\n  DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int));\n  memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz);\n}\n\n/* Setup encoder. */\nvoid dasm_setup(Dst_DECL, const void *actionlist)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  D->actionlist = (dasm_ActList)actionlist;\n  D->status = DASM_S_OK;\n  D->section = &D->sections[0];\n  memset((void *)D->lglabels, 0, D->lgsize);\n  if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);\n  for (i = 0; i < D->maxsection; i++) {\n    D->sections[i].pos = DASM_SEC2POS(i);\n    D->sections[i].ofs = 0;\n  }\n}\n\n\n#ifdef DASM_CHECKS\n#define CK(x, st) \\\n  do { if (!(x)) { \\\n    D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0)\n#define CKPL(kind, st) \\\n  do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \\\n    D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0)\n#else\n#define CK(x, st)\t((void)0)\n#define CKPL(kind, st)\t((void)0)\n#endif\n\n/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */\nvoid dasm_put(Dst_DECL, int start, ...)\n{\n  va_list ap;\n  dasm_State *D = Dst_REF;\n  dasm_ActList p = D->actionlist + start;\n  dasm_Section *sec = D->section;\n  int pos = sec->pos, ofs = sec->ofs;\n  int *b;\n\n  if (pos >= sec->epos) {\n    DASM_M_GROW(Dst, int, sec->buf, sec->bsize,\n      sec->bsize + 2*DASM_MAXSECPOS*sizeof(int));\n    sec->rbuf = sec->buf - DASM_POS2BIAS(pos);\n    sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos);\n  }\n\n  b = sec->rbuf;\n  b[pos++] = start;\n\n  va_start(ap, start);\n  while (1) {\n    unsigned int ins = *p++;\n    unsigned int action = (ins >> 16) - 0xff00;\n    if (action >= DASM__MAX) {\n      ofs += 4;\n    } else {\n      int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0;\n      switch (action) {\n      case DASM_STOP: goto stop;\n      case DASM_SECTION:\n\tn = (ins & 255); CK(n < D->maxsection, RANGE_SEC);\n\tD->section = &D->sections[n]; goto stop;\n      case DASM_ESC: p++; ofs += 4; break;\n      case DASM_REL_EXT: break;\n      case DASM_ALIGN: ofs += (ins & 255); b[pos++] = ofs; break;\n      case DASM_REL_LG:\n\tn = (ins & 2047) - 10; pl = D->lglabels + n;\n\tif (n >= 0) { CKPL(lg, LG); goto putrel; }  /* Bkwd rel or global. */\n\tpl += 10; n = *pl;\n\tif (n < 0) n = 0;  /* Start new chain for fwd rel if label exists. */\n\tgoto linkrel;\n      case DASM_REL_PC:\n\tpl = D->pclabels + n; CKPL(pc, PC);\n      putrel:\n\tn = *pl;\n\tif (n < 0) {  /* Label exists. Get label pos and store it. */\n\t  b[pos] = -n;\n\t} else {\n      linkrel:\n\t  b[pos] = n;  /* Else link to rel chain, anchored at label. */\n\t  *pl = pos;\n\t}\n\tpos++;\n\tbreak;\n      case DASM_LABEL_LG:\n\tpl = D->lglabels + (ins & 2047) - 10; CKPL(lg, LG); goto putlabel;\n      case DASM_LABEL_PC:\n\tpl = D->pclabels + n; CKPL(pc, PC);\n      putlabel:\n\tn = *pl;  /* n > 0: Collapse rel chain and replace with label pos. */\n\twhile (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos;\n\t}\n\t*pl = -pos;  /* Label exists now. */\n\tb[pos++] = ofs;  /* Store pass1 offset estimate. */\n\tbreak;\n      case DASM_IMM:\n#ifdef DASM_CHECKS\n\tCK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I);\n#endif\n\tn >>= ((ins>>10)&31);\n#ifdef DASM_CHECKS\n\tif (ins & 0x8000)\n\t  CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I);\n\telse\n\t  CK((n>>((ins>>5)&31)) == 0, RANGE_I);\n#endif\n\tb[pos++] = n;\n\tbreak;\n      }\n    }\n  }\nstop:\n  va_end(ap);\n  sec->pos = pos;\n  sec->ofs = ofs;\n}\n#undef CK\n\n/* Pass 2: Link sections, shrink aligns, fix label offsets. */\nint dasm_link(Dst_DECL, size_t *szp)\n{\n  dasm_State *D = Dst_REF;\n  int secnum;\n  int ofs = 0;\n\n#ifdef DASM_CHECKS\n  *szp = 0;\n  if (D->status != DASM_S_OK) return D->status;\n  {\n    int pc;\n    for (pc = 0; pc*sizeof(int) < D->pcsize; pc++)\n      if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc;\n  }\n#endif\n\n  { /* Handle globals not defined in this translation unit. */\n    int idx;\n    for (idx = 20; idx*sizeof(int) < D->lgsize; idx++) {\n      int n = D->lglabels[idx];\n      /* Undefined label: Collapse rel chain and replace with marker (< 0). */\n      while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; }\n    }\n  }\n\n  /* Combine all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->rbuf;\n    int pos = DASM_SEC2POS(secnum);\n    int lastpos = sec->pos;\n\n    while (pos != lastpos) {\n      dasm_ActList p = D->actionlist + b[pos++];\n      while (1) {\n\tunsigned int ins = *p++;\n\tunsigned int action = (ins >> 16) - 0xff00;\n\tswitch (action) {\n\tcase DASM_STOP: case DASM_SECTION: goto stop;\n\tcase DASM_ESC: p++; break;\n\tcase DASM_REL_EXT: break;\n\tcase DASM_ALIGN: ofs -= (b[pos++] + ofs) & (ins & 255); break;\n\tcase DASM_REL_LG: case DASM_REL_PC: pos++; break;\n\tcase DASM_LABEL_LG: case DASM_LABEL_PC: b[pos++] += ofs; break;\n\tcase DASM_IMM: pos++; break;\n\t}\n      }\n      stop: (void)0;\n    }\n    ofs += sec->ofs;  /* Next section starts right after current section. */\n  }\n\n  D->codesize = ofs;  /* Total size of all code sections */\n  *szp = ofs;\n  return DASM_S_OK;\n}\n\n#ifdef DASM_CHECKS\n#define CK(x, st) \\\n  do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0)\n#else\n#define CK(x, st)\t((void)0)\n#endif\n\n/* Pass 3: Encode sections. */\nint dasm_encode(Dst_DECL, void *buffer)\n{\n  dasm_State *D = Dst_REF;\n  char *base = (char *)buffer;\n  unsigned int *cp = (unsigned int *)buffer;\n  int secnum;\n\n  /* Encode all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->buf;\n    int *endb = sec->rbuf + sec->pos;\n\n    while (b != endb) {\n      dasm_ActList p = D->actionlist + *b++;\n      while (1) {\n\tunsigned int ins = *p++;\n\tunsigned int action = (ins >> 16) - 0xff00;\n\tint n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0;\n\tswitch (action) {\n\tcase DASM_STOP: case DASM_SECTION: goto stop;\n\tcase DASM_ESC: *cp++ = *p++; break;\n\tcase DASM_REL_EXT:\n\t  n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins & 2047), 1);\n\t  goto patchrel;\n\tcase DASM_ALIGN:\n\t  ins &= 255; while ((((char *)cp - base) & ins)) *cp++ = 0x60000000;\n\t  break;\n\tcase DASM_REL_LG:\n\t  CK(n >= 0, UNDEF_LG);\n\tcase DASM_REL_PC:\n\t  CK(n >= 0, UNDEF_PC);\n\t  n = *DASM_POS2PTR(D, n);\n\t  if (ins & 2048)\n\t    n = n - (int)((char *)cp - base);\n\t  else\n\t    n = (n + (int)base) & 0x0fffffff;\n\tpatchrel:\n\t  CK((n & 3) == 0 &&\n\t     ((n + ((ins & 2048) ? 0x00020000 : 0)) >>\n\t       ((ins & 2048) ? 18 : 28)) == 0, RANGE_REL);\n\t  cp[-1] |= ((n>>2) & ((ins & 2048) ? 0x0000ffff: 0x03ffffff));\n\t  break;\n\tcase DASM_LABEL_LG:\n\t  ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n);\n\t  break;\n\tcase DASM_LABEL_PC: break;\n\tcase DASM_IMM:\n\t  cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31);\n\t  break;\n\tdefault: *cp++ = ins; break;\n\t}\n      }\n      stop: (void)0;\n    }\n  }\n\n  if (base + D->codesize != (char *)cp)  /* Check for phase errors. */\n    return DASM_S_PHASE;\n  return DASM_S_OK;\n}\n#undef CK\n\n/* Get PC label offset. */\nint dasm_getpclabel(Dst_DECL, unsigned int pc)\n{\n  dasm_State *D = Dst_REF;\n  if (pc*sizeof(int) < D->pcsize) {\n    int pos = D->pclabels[pc];\n    if (pos < 0) return *DASM_POS2PTR(D, -pos);\n    if (pos > 0) return -1;  /* Undefined. */\n  }\n  return -2;  /* Unused or out of range. */\n}\n\n#ifdef DASM_CHECKS\n/* Optional sanity checker to call between isolated encoding steps. */\nint dasm_checkstep(Dst_DECL, int secmatch)\n{\n  dasm_State *D = Dst_REF;\n  if (D->status == DASM_S_OK) {\n    int i;\n    for (i = 1; i <= 9; i++) {\n      if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_LG|i; break; }\n      D->lglabels[i] = 0;\n    }\n  }\n  if (D->status == DASM_S_OK && secmatch >= 0 &&\n      D->section != &D->sections[secmatch])\n    D->status = DASM_S_MATCH_SEC|(D->section-D->sections);\n  return D->status;\n}\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_mips.lua",
    "content": "------------------------------------------------------------------------------\n-- DynASM MIPS module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- See dynasm.lua for full copyright notice.\n------------------------------------------------------------------------------\n\n-- Module information:\nlocal _info = {\n  arch =\t\"mips\",\n  description =\t\"DynASM MIPS module\",\n  version =\t\"1.3.0\",\n  vernum =\t 10300,\n  release =\t\"2012-01-23\",\n  author =\t\"Mike Pall\",\n  license =\t\"MIT\",\n}\n\n-- Exported glue functions for the arch-specific module.\nlocal _M = { _info = _info }\n\n-- Cache library functions.\nlocal type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs\nlocal assert, setmetatable = assert, setmetatable\nlocal _s = string\nlocal sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char\nlocal match, gmatch = _s.match, _s.gmatch\nlocal concat, sort = table.concat, table.sort\nlocal bit = bit or require(\"bit\")\nlocal band, shl, sar, tohex = bit.band, bit.lshift, bit.arshift, bit.tohex\n\n-- Inherited tables and callbacks.\nlocal g_opt, g_arch\nlocal wline, werror, wfatal, wwarn\n\n-- Action name list.\n-- CHECK: Keep this in sync with the C code!\nlocal action_names = {\n  \"STOP\", \"SECTION\", \"ESC\", \"REL_EXT\",\n  \"ALIGN\", \"REL_LG\", \"LABEL_LG\",\n  \"REL_PC\", \"LABEL_PC\", \"IMM\",\n}\n\n-- Maximum number of section buffer positions for dasm_put().\n-- CHECK: Keep this in sync with the C code!\nlocal maxsecpos = 25 -- Keep this low, to avoid excessively long C lines.\n\n-- Action name -> action number.\nlocal map_action = {}\nfor n,name in ipairs(action_names) do\n  map_action[name] = n-1\nend\n\n-- Action list buffer.\nlocal actlist = {}\n\n-- Argument list for next dasm_put(). Start with offset 0 into action list.\nlocal actargs = { 0 }\n\n-- Current number of section buffer positions for dasm_put().\nlocal secpos = 1\n\n------------------------------------------------------------------------------\n\n-- Dump action names and numbers.\nlocal function dumpactions(out)\n  out:write(\"DynASM encoding engine action codes:\\n\")\n  for n,name in ipairs(action_names) do\n    local num = map_action[name]\n    out:write(format(\"  %-10s %02X  %d\\n\", name, num, num))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write action list buffer as a huge static C array.\nlocal function writeactions(out, name)\n  local nn = #actlist\n  if nn == 0 then nn = 1; actlist[0] = map_action.STOP end\n  out:write(\"static const unsigned int \", name, \"[\", nn, \"] = {\\n\")\n  for i = 1,nn-1 do\n    assert(out:write(\"0x\", tohex(actlist[i]), \",\\n\"))\n  end\n  assert(out:write(\"0x\", tohex(actlist[nn]), \"\\n};\\n\\n\"))\nend\n\n------------------------------------------------------------------------------\n\n-- Add word to action list.\nlocal function wputxw(n)\n  assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, \"word out of range\")\n  actlist[#actlist+1] = n\nend\n\n-- Add action to list with optional arg. Advance buffer pos, too.\nlocal function waction(action, val, a, num)\n  local w = assert(map_action[action], \"bad action name `\"..action..\"'\")\n  wputxw(0xff000000 + w * 0x10000 + (val or 0))\n  if a then actargs[#actargs+1] = a end\n  if a or num then secpos = secpos + (num or 1) end\nend\n\n-- Flush action list (intervening C code or buffer pos overflow).\nlocal function wflush(term)\n  if #actlist == actargs[1] then return end -- Nothing to flush.\n  if not term then waction(\"STOP\") end -- Terminate action list.\n  wline(format(\"dasm_put(Dst, %s);\", concat(actargs, \", \")), true)\n  actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put().\n  secpos = 1 -- The actionlist offset occupies a buffer position, too.\nend\n\n-- Put escaped word.\nlocal function wputw(n)\n  if n >= 0xff000000 then waction(\"ESC\") end\n  wputxw(n)\nend\n\n-- Reserve position for word.\nlocal function wpos()\n  local pos = #actlist+1\n  actlist[pos] = \"\"\n  return pos\nend\n\n-- Store word to reserved position.\nlocal function wputpos(pos, n)\n  assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, \"word out of range\")\n  actlist[pos] = n\nend\n\n------------------------------------------------------------------------------\n\n-- Global label name -> global label number. With auto assignment on 1st use.\nlocal next_global = 20\nlocal map_global = setmetatable({}, { __index = function(t, name)\n  if not match(name, \"^[%a_][%w_]*$\") then werror(\"bad global label\") end\n  local n = next_global\n  if n > 2047 then werror(\"too many global labels\") end\n  next_global = n + 1\n  t[name] = n\n  return n\nend})\n\n-- Dump global labels.\nlocal function dumpglobals(out, lvl)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"Global labels:\\n\")\n  for i=20,next_global-1 do\n    out:write(format(\"  %s\\n\", t[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write global label enum.\nlocal function writeglobals(out, prefix)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"enum {\\n\")\n  for i=20,next_global-1 do\n    out:write(\"  \", prefix, t[i], \",\\n\")\n  end\n  out:write(\"  \", prefix, \"_MAX\\n};\\n\")\nend\n\n-- Write global label names.\nlocal function writeglobalnames(out, name)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=20,next_global-1 do\n    out:write(\"  \\\"\", t[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Extern label name -> extern label number. With auto assignment on 1st use.\nlocal next_extern = 0\nlocal map_extern_ = {}\nlocal map_extern = setmetatable({}, { __index = function(t, name)\n  -- No restrictions on the name for now.\n  local n = next_extern\n  if n > 2047 then werror(\"too many extern labels\") end\n  next_extern = n + 1\n  t[name] = n\n  map_extern_[n] = name\n  return n\nend})\n\n-- Dump extern labels.\nlocal function dumpexterns(out, lvl)\n  out:write(\"Extern labels:\\n\")\n  for i=0,next_extern-1 do\n    out:write(format(\"  %s\\n\", map_extern_[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write extern label names.\nlocal function writeexternnames(out, name)\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=0,next_extern-1 do\n    out:write(\"  \\\"\", map_extern_[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Arch-specific maps.\nlocal map_archdef = { sp=\"r29\", ra=\"r31\" } -- Ext. register name -> int. name.\n\nlocal map_type = {}\t\t-- Type name -> { ctype, reg }\nlocal ctypenum = 0\t\t-- Type number (for Dt... macros).\n\n-- Reverse defines for registers.\nfunction _M.revdef(s)\n  if s == \"r29\" then return \"sp\"\n  elseif s == \"r31\" then return \"ra\" end\n  return s\nend\n\n------------------------------------------------------------------------------\n\n-- Template strings for MIPS instructions.\nlocal map_op = {\n  -- First-level opcodes.\n  j_1 =\t\t\"08000000J\",\n  jal_1 =\t\"0c000000J\",\n  b_1 =\t\t\"10000000B\",\n  beqz_2 =\t\"10000000SB\",\n  beq_3 =\t\"10000000STB\",\n  bnez_2 =\t\"14000000SB\",\n  bne_3 =\t\"14000000STB\",\n  blez_2 =\t\"18000000SB\",\n  bgtz_2 =\t\"1c000000SB\",\n  addi_3 =\t\"20000000TSI\",\n  li_2 =\t\"24000000TI\",\n  addiu_3 =\t\"24000000TSI\",\n  slti_3 =\t\"28000000TSI\",\n  sltiu_3 =\t\"2c000000TSI\",\n  andi_3 =\t\"30000000TSU\",\n  lu_2 =\t\"34000000TU\",\n  ori_3 =\t\"34000000TSU\",\n  xori_3 =\t\"38000000TSU\",\n  lui_2 =\t\"3c000000TU\",\n  beqzl_2 =\t\"50000000SB\",\n  beql_3 =\t\"50000000STB\",\n  bnezl_2 =\t\"54000000SB\",\n  bnel_3 =\t\"54000000STB\",\n  blezl_2 =\t\"58000000SB\",\n  bgtzl_2 =\t\"5c000000SB\",\n  lb_2 =\t\"80000000TO\",\n  lh_2 =\t\"84000000TO\",\n  lwl_2 =\t\"88000000TO\",\n  lw_2 =\t\"8c000000TO\",\n  lbu_2 =\t\"90000000TO\",\n  lhu_2 =\t\"94000000TO\",\n  lwr_2 =\t\"98000000TO\",\n  sb_2 =\t\"a0000000TO\",\n  sh_2 =\t\"a4000000TO\",\n  swl_2 =\t\"a8000000TO\",\n  sw_2 =\t\"ac000000TO\",\n  swr_2 =\t\"b8000000TO\",\n  cache_2 =\t\"bc000000NO\",\n  ll_2 =\t\"c0000000TO\",\n  lwc1_2 =\t\"c4000000HO\",\n  pref_2 =\t\"cc000000NO\",\n  ldc1_2 =\t\"d4000000HO\",\n  sc_2 =\t\"e0000000TO\",\n  swc1_2 =\t\"e4000000HO\",\n  sdc1_2 =\t\"f4000000HO\",\n\n  -- Opcode SPECIAL.\n  nop_0 =\t\"00000000\",\n  sll_3 =\t\"00000000DTA\",\n  movf_2 =\t\"00000001DS\",\n  movf_3 =\t\"00000001DSC\",\n  movt_2 =\t\"00010001DS\",\n  movt_3 =\t\"00010001DSC\",\n  srl_3 =\t\"00000002DTA\",\n  rotr_3 =\t\"00200002DTA\",\n  sra_3 =\t\"00000003DTA\",\n  sllv_3 =\t\"00000004DTS\",\n  srlv_3 =\t\"00000006DTS\",\n  rotrv_3 =\t\"00000046DTS\",\n  srav_3 =\t\"00000007DTS\",\n  jr_1 =\t\"00000008S\",\n  jalr_1 =\t\"0000f809S\",\n  jalr_2 =\t\"00000009DS\",\n  movz_3 =\t\"0000000aDST\",\n  movn_3 =\t\"0000000bDST\",\n  syscall_0 =\t\"0000000c\",\n  syscall_1 =\t\"0000000cY\",\n  break_0 =\t\"0000000d\",\n  break_1 =\t\"0000000dY\",\n  sync_0 =\t\"0000000f\",\n  mfhi_1 =\t\"00000010D\",\n  mthi_1 =\t\"00000011S\",\n  mflo_1 =\t\"00000012D\",\n  mtlo_1 =\t\"00000013S\",\n  mult_2 =\t\"00000018ST\",\n  multu_2 =\t\"00000019ST\",\n  div_2 =\t\"0000001aST\",\n  divu_2 =\t\"0000001bST\",\n  add_3 =\t\"00000020DST\",\n  move_2 =\t\"00000021DS\",\n  addu_3 =\t\"00000021DST\",\n  sub_3 =\t\"00000022DST\",\n  negu_2 =\t\"00000023DT\",\n  subu_3 =\t\"00000023DST\",\n  and_3 =\t\"00000024DST\",\n  or_3 =\t\"00000025DST\",\n  xor_3 =\t\"00000026DST\",\n  not_2 =\t\"00000027DS\",\n  nor_3 =\t\"00000027DST\",\n  slt_3 =\t\"0000002aDST\",\n  sltu_3 =\t\"0000002bDST\",\n  tge_2 =\t\"00000030ST\",\n  tge_3 =\t\"00000030STZ\",\n  tgeu_2 =\t\"00000031ST\",\n  tgeu_3 =\t\"00000031STZ\",\n  tlt_2 =\t\"00000032ST\",\n  tlt_3 =\t\"00000032STZ\",\n  tltu_2 =\t\"00000033ST\",\n  tltu_3 =\t\"00000033STZ\",\n  teq_2 =\t\"00000034ST\",\n  teq_3 =\t\"00000034STZ\",\n  tne_2 =\t\"00000036ST\",\n  tne_3 =\t\"00000036STZ\",\n\n  -- Opcode REGIMM.\n  bltz_2 =\t\"04000000SB\",\n  bgez_2 =\t\"04010000SB\",\n  bltzl_2 =\t\"04020000SB\",\n  bgezl_2 =\t\"04030000SB\",\n  tgei_2 =\t\"04080000SI\",\n  tgeiu_2 =\t\"04090000SI\",\n  tlti_2 =\t\"040a0000SI\",\n  tltiu_2 =\t\"040b0000SI\",\n  teqi_2 =\t\"040c0000SI\",\n  tnei_2 =\t\"040e0000SI\",\n  bltzal_2 =\t\"04100000SB\",\n  bal_1 =\t\"04110000B\",\n  bgezal_2 =\t\"04110000SB\",\n  bltzall_2 =\t\"04120000SB\",\n  bgezall_2 =\t\"04130000SB\",\n  synci_1 =\t\"041f0000O\",\n\n  -- Opcode SPECIAL2.\n  madd_2 =\t\"70000000ST\",\n  maddu_2 =\t\"70000001ST\",\n  mul_3 =\t\"70000002DST\",\n  msub_2 =\t\"70000004ST\",\n  msubu_2 =\t\"70000005ST\",\n  clz_2 =\t\"70000020DS=\",\n  clo_2 =\t\"70000021DS=\",\n  sdbbp_0 =\t\"7000003f\",\n  sdbbp_1 =\t\"7000003fY\",\n\n  -- Opcode SPECIAL3.\n  ext_4 =\t\"7c000000TSAM\", -- Note: last arg is msbd = size-1\n  ins_4 =\t\"7c000004TSAM\", -- Note: last arg is msb = pos+size-1\n  wsbh_2 =\t\"7c0000a0DT\",\n  seb_2 =\t\"7c000420DT\",\n  seh_2 =\t\"7c000620DT\",\n  rdhwr_2 =\t\"7c00003bTD\",\n\n  -- Opcode COP0.\n  mfc0_2 =\t\"40000000TD\",\n  mfc0_3 =\t\"40000000TDW\",\n  mtc0_2 =\t\"40800000TD\",\n  mtc0_3 =\t\"40800000TDW\",\n  rdpgpr_2 =\t\"41400000DT\",\n  di_0 =\t\"41606000\",\n  di_1 =\t\"41606000T\",\n  ei_0 =\t\"41606020\",\n  ei_1 =\t\"41606020T\",\n  wrpgpr_2 =\t\"41c00000DT\",\n  tlbr_0 =\t\"42000001\",\n  tlbwi_0 =\t\"42000002\",\n  tlbwr_0 =\t\"42000006\",\n  tlbp_0 =\t\"42000008\",\n  eret_0 =\t\"42000018\",\n  deret_0 =\t\"4200001f\",\n  wait_0 =\t\"42000020\",\n\n  -- Opcode COP1.\n  mfc1_2 =\t\"44000000TG\",\n  cfc1_2 =\t\"44400000TG\",\n  mfhc1_2 =\t\"44600000TG\",\n  mtc1_2 =\t\"44800000TG\",\n  ctc1_2 =\t\"44c00000TG\",\n  mthc1_2 =\t\"44e00000TG\",\n\n  bc1f_1 =\t\"45000000B\",\n  bc1f_2 =\t\"45000000CB\",\n  bc1t_1 =\t\"45010000B\",\n  bc1t_2 =\t\"45010000CB\",\n  bc1fl_1 =\t\"45020000B\",\n  bc1fl_2 =\t\"45020000CB\",\n  bc1tl_1 =\t\"45030000B\",\n  bc1tl_2 =\t\"45030000CB\",\n\n  [\"add.s_3\"] =\t\t\"46000000FGH\",\n  [\"sub.s_3\"] =\t\t\"46000001FGH\",\n  [\"mul.s_3\"] =\t\t\"46000002FGH\",\n  [\"div.s_3\"] =\t\t\"46000003FGH\",\n  [\"sqrt.s_2\"] =\t\"46000004FG\",\n  [\"abs.s_2\"] =\t\t\"46000005FG\",\n  [\"mov.s_2\"] =\t\t\"46000006FG\",\n  [\"neg.s_2\"] =\t\t\"46000007FG\",\n  [\"round.l.s_2\"] =\t\"46000008FG\",\n  [\"trunc.l.s_2\"] =\t\"46000009FG\",\n  [\"ceil.l.s_2\"] =\t\"4600000aFG\",\n  [\"floor.l.s_2\"] =\t\"4600000bFG\",\n  [\"round.w.s_2\"] =\t\"4600000cFG\",\n  [\"trunc.w.s_2\"] =\t\"4600000dFG\",\n  [\"ceil.w.s_2\"] =\t\"4600000eFG\",\n  [\"floor.w.s_2\"] =\t\"4600000fFG\",\n  [\"movf.s_2\"] =\t\"46000011FG\",\n  [\"movf.s_3\"] =\t\"46000011FGC\",\n  [\"movt.s_2\"] =\t\"46010011FG\",\n  [\"movt.s_3\"] =\t\"46010011FGC\",\n  [\"movz.s_3\"] =\t\"46000012FGT\",\n  [\"movn.s_3\"] =\t\"46000013FGT\",\n  [\"recip.s_2\"] =\t\"46000015FG\",\n  [\"rsqrt.s_2\"] =\t\"46000016FG\",\n  [\"cvt.d.s_2\"] =\t\"46000021FG\",\n  [\"cvt.w.s_2\"] =\t\"46000024FG\",\n  [\"cvt.l.s_2\"] =\t\"46000025FG\",\n  [\"cvt.ps.s_3\"] =\t\"46000026FGH\",\n  [\"c.f.s_2\"] =\t\t\"46000030GH\",\n  [\"c.f.s_3\"] =\t\t\"46000030VGH\",\n  [\"c.un.s_2\"] =\t\"46000031GH\",\n  [\"c.un.s_3\"] =\t\"46000031VGH\",\n  [\"c.eq.s_2\"] =\t\"46000032GH\",\n  [\"c.eq.s_3\"] =\t\"46000032VGH\",\n  [\"c.ueq.s_2\"] =\t\"46000033GH\",\n  [\"c.ueq.s_3\"] =\t\"46000033VGH\",\n  [\"c.olt.s_2\"] =\t\"46000034GH\",\n  [\"c.olt.s_3\"] =\t\"46000034VGH\",\n  [\"c.ult.s_2\"] =\t\"46000035GH\",\n  [\"c.ult.s_3\"] =\t\"46000035VGH\",\n  [\"c.ole.s_2\"] =\t\"46000036GH\",\n  [\"c.ole.s_3\"] =\t\"46000036VGH\",\n  [\"c.ule.s_2\"] =\t\"46000037GH\",\n  [\"c.ule.s_3\"] =\t\"46000037VGH\",\n  [\"c.sf.s_2\"] =\t\"46000038GH\",\n  [\"c.sf.s_3\"] =\t\"46000038VGH\",\n  [\"c.ngle.s_2\"] =\t\"46000039GH\",\n  [\"c.ngle.s_3\"] =\t\"46000039VGH\",\n  [\"c.seq.s_2\"] =\t\"4600003aGH\",\n  [\"c.seq.s_3\"] =\t\"4600003aVGH\",\n  [\"c.ngl.s_2\"] =\t\"4600003bGH\",\n  [\"c.ngl.s_3\"] =\t\"4600003bVGH\",\n  [\"c.lt.s_2\"] =\t\"4600003cGH\",\n  [\"c.lt.s_3\"] =\t\"4600003cVGH\",\n  [\"c.nge.s_2\"] =\t\"4600003dGH\",\n  [\"c.nge.s_3\"] =\t\"4600003dVGH\",\n  [\"c.le.s_2\"] =\t\"4600003eGH\",\n  [\"c.le.s_3\"] =\t\"4600003eVGH\",\n  [\"c.ngt.s_2\"] =\t\"4600003fGH\",\n  [\"c.ngt.s_3\"] =\t\"4600003fVGH\",\n\n  [\"add.d_3\"] =\t\t\"46200000FGH\",\n  [\"sub.d_3\"] =\t\t\"46200001FGH\",\n  [\"mul.d_3\"] =\t\t\"46200002FGH\",\n  [\"div.d_3\"] =\t\t\"46200003FGH\",\n  [\"sqrt.d_2\"] =\t\"46200004FG\",\n  [\"abs.d_2\"] =\t\t\"46200005FG\",\n  [\"mov.d_2\"] =\t\t\"46200006FG\",\n  [\"neg.d_2\"] =\t\t\"46200007FG\",\n  [\"round.l.d_2\"] =\t\"46200008FG\",\n  [\"trunc.l.d_2\"] =\t\"46200009FG\",\n  [\"ceil.l.d_2\"] =\t\"4620000aFG\",\n  [\"floor.l.d_2\"] =\t\"4620000bFG\",\n  [\"round.w.d_2\"] =\t\"4620000cFG\",\n  [\"trunc.w.d_2\"] =\t\"4620000dFG\",\n  [\"ceil.w.d_2\"] =\t\"4620000eFG\",\n  [\"floor.w.d_2\"] =\t\"4620000fFG\",\n  [\"movf.d_2\"] =\t\"46200011FG\",\n  [\"movf.d_3\"] =\t\"46200011FGC\",\n  [\"movt.d_2\"] =\t\"46210011FG\",\n  [\"movt.d_3\"] =\t\"46210011FGC\",\n  [\"movz.d_3\"] =\t\"46200012FGT\",\n  [\"movn.d_3\"] =\t\"46200013FGT\",\n  [\"recip.d_2\"] =\t\"46200015FG\",\n  [\"rsqrt.d_2\"] =\t\"46200016FG\",\n  [\"cvt.s.d_2\"] =\t\"46200020FG\",\n  [\"cvt.w.d_2\"] =\t\"46200024FG\",\n  [\"cvt.l.d_2\"] =\t\"46200025FG\",\n  [\"c.f.d_2\"] =\t\t\"46200030GH\",\n  [\"c.f.d_3\"] =\t\t\"46200030VGH\",\n  [\"c.un.d_2\"] =\t\"46200031GH\",\n  [\"c.un.d_3\"] =\t\"46200031VGH\",\n  [\"c.eq.d_2\"] =\t\"46200032GH\",\n  [\"c.eq.d_3\"] =\t\"46200032VGH\",\n  [\"c.ueq.d_2\"] =\t\"46200033GH\",\n  [\"c.ueq.d_3\"] =\t\"46200033VGH\",\n  [\"c.olt.d_2\"] =\t\"46200034GH\",\n  [\"c.olt.d_3\"] =\t\"46200034VGH\",\n  [\"c.ult.d_2\"] =\t\"46200035GH\",\n  [\"c.ult.d_3\"] =\t\"46200035VGH\",\n  [\"c.ole.d_2\"] =\t\"46200036GH\",\n  [\"c.ole.d_3\"] =\t\"46200036VGH\",\n  [\"c.ule.d_2\"] =\t\"46200037GH\",\n  [\"c.ule.d_3\"] =\t\"46200037VGH\",\n  [\"c.sf.d_2\"] =\t\"46200038GH\",\n  [\"c.sf.d_3\"] =\t\"46200038VGH\",\n  [\"c.ngle.d_2\"] =\t\"46200039GH\",\n  [\"c.ngle.d_3\"] =\t\"46200039VGH\",\n  [\"c.seq.d_2\"] =\t\"4620003aGH\",\n  [\"c.seq.d_3\"] =\t\"4620003aVGH\",\n  [\"c.ngl.d_2\"] =\t\"4620003bGH\",\n  [\"c.ngl.d_3\"] =\t\"4620003bVGH\",\n  [\"c.lt.d_2\"] =\t\"4620003cGH\",\n  [\"c.lt.d_3\"] =\t\"4620003cVGH\",\n  [\"c.nge.d_2\"] =\t\"4620003dGH\",\n  [\"c.nge.d_3\"] =\t\"4620003dVGH\",\n  [\"c.le.d_2\"] =\t\"4620003eGH\",\n  [\"c.le.d_3\"] =\t\"4620003eVGH\",\n  [\"c.ngt.d_2\"] =\t\"4620003fGH\",\n  [\"c.ngt.d_3\"] =\t\"4620003fVGH\",\n\n  [\"add.ps_3\"] =\t\"46c00000FGH\",\n  [\"sub.ps_3\"] =\t\"46c00001FGH\",\n  [\"mul.ps_3\"] =\t\"46c00002FGH\",\n  [\"abs.ps_2\"] =\t\"46c00005FG\",\n  [\"mov.ps_2\"] =\t\"46c00006FG\",\n  [\"neg.ps_2\"] =\t\"46c00007FG\",\n  [\"movf.ps_2\"] =\t\"46c00011FG\",\n  [\"movf.ps_3\"] =\t\"46c00011FGC\",\n  [\"movt.ps_2\"] =\t\"46c10011FG\",\n  [\"movt.ps_3\"] =\t\"46c10011FGC\",\n  [\"movz.ps_3\"] =\t\"46c00012FGT\",\n  [\"movn.ps_3\"] =\t\"46c00013FGT\",\n  [\"cvt.s.pu_2\"] =\t\"46c00020FG\",\n  [\"cvt.s.pl_2\"] =\t\"46c00028FG\",\n  [\"pll.ps_3\"] =\t\"46c0002cFGH\",\n  [\"plu.ps_3\"] =\t\"46c0002dFGH\",\n  [\"pul.ps_3\"] =\t\"46c0002eFGH\",\n  [\"puu.ps_3\"] =\t\"46c0002fFGH\",\n  [\"c.f.ps_2\"] =\t\"46c00030GH\",\n  [\"c.f.ps_3\"] =\t\"46c00030VGH\",\n  [\"c.un.ps_2\"] =\t\"46c00031GH\",\n  [\"c.un.ps_3\"] =\t\"46c00031VGH\",\n  [\"c.eq.ps_2\"] =\t\"46c00032GH\",\n  [\"c.eq.ps_3\"] =\t\"46c00032VGH\",\n  [\"c.ueq.ps_2\"] =\t\"46c00033GH\",\n  [\"c.ueq.ps_3\"] =\t\"46c00033VGH\",\n  [\"c.olt.ps_2\"] =\t\"46c00034GH\",\n  [\"c.olt.ps_3\"] =\t\"46c00034VGH\",\n  [\"c.ult.ps_2\"] =\t\"46c00035GH\",\n  [\"c.ult.ps_3\"] =\t\"46c00035VGH\",\n  [\"c.ole.ps_2\"] =\t\"46c00036GH\",\n  [\"c.ole.ps_3\"] =\t\"46c00036VGH\",\n  [\"c.ule.ps_2\"] =\t\"46c00037GH\",\n  [\"c.ule.ps_3\"] =\t\"46c00037VGH\",\n  [\"c.sf.ps_2\"] =\t\"46c00038GH\",\n  [\"c.sf.ps_3\"] =\t\"46c00038VGH\",\n  [\"c.ngle.ps_2\"] =\t\"46c00039GH\",\n  [\"c.ngle.ps_3\"] =\t\"46c00039VGH\",\n  [\"c.seq.ps_2\"] =\t\"46c0003aGH\",\n  [\"c.seq.ps_3\"] =\t\"46c0003aVGH\",\n  [\"c.ngl.ps_2\"] =\t\"46c0003bGH\",\n  [\"c.ngl.ps_3\"] =\t\"46c0003bVGH\",\n  [\"c.lt.ps_2\"] =\t\"46c0003cGH\",\n  [\"c.lt.ps_3\"] =\t\"46c0003cVGH\",\n  [\"c.nge.ps_2\"] =\t\"46c0003dGH\",\n  [\"c.nge.ps_3\"] =\t\"46c0003dVGH\",\n  [\"c.le.ps_2\"] =\t\"46c0003eGH\",\n  [\"c.le.ps_3\"] =\t\"46c0003eVGH\",\n  [\"c.ngt.ps_2\"] =\t\"46c0003fGH\",\n  [\"c.ngt.ps_3\"] =\t\"46c0003fVGH\",\n\n  [\"cvt.s.w_2\"] =\t\"46800020FG\",\n  [\"cvt.d.w_2\"] =\t\"46800021FG\",\n\n  [\"cvt.s.l_2\"] =\t\"46a00020FG\",\n  [\"cvt.d.l_2\"] =\t\"46a00021FG\",\n\n  -- Opcode COP1X.\n  lwxc1_2 =\t\t\"4c000000FX\",\n  ldxc1_2 =\t\t\"4c000001FX\",\n  luxc1_2 =\t\t\"4c000005FX\",\n  swxc1_2 =\t\t\"4c000008FX\",\n  sdxc1_2 =\t\t\"4c000009FX\",\n  suxc1_2 =\t\t\"4c00000dFX\",\n  prefx_2 =\t\t\"4c00000fMX\",\n  [\"alnv.ps_4\"] =\t\"4c00001eFGHS\",\n  [\"madd.s_4\"] =\t\"4c000020FRGH\",\n  [\"madd.d_4\"] =\t\"4c000021FRGH\",\n  [\"madd.ps_4\"] =\t\"4c000026FRGH\",\n  [\"msub.s_4\"] =\t\"4c000028FRGH\",\n  [\"msub.d_4\"] =\t\"4c000029FRGH\",\n  [\"msub.ps_4\"] =\t\"4c00002eFRGH\",\n  [\"nmadd.s_4\"] =\t\"4c000030FRGH\",\n  [\"nmadd.d_4\"] =\t\"4c000031FRGH\",\n  [\"nmadd.ps_4\"] =\t\"4c000036FRGH\",\n  [\"nmsub.s_4\"] =\t\"4c000038FRGH\",\n  [\"nmsub.d_4\"] =\t\"4c000039FRGH\",\n  [\"nmsub.ps_4\"] =\t\"4c00003eFRGH\",\n}\n\n------------------------------------------------------------------------------\n\nlocal function parse_gpr(expr)\n  local tname, ovreg = match(expr, \"^([%w_]+):(r[1-3]?[0-9])$\")\n  local tp = map_type[tname or expr]\n  if tp then\n    local reg = ovreg or tp.reg\n    if not reg then\n      werror(\"type `\"..(tname or expr)..\"' needs a register override\")\n    end\n    expr = reg\n  end\n  local r = match(expr, \"^r([1-3]?[0-9])$\")\n  if r then\n    r = tonumber(r)\n    if r <= 31 then return r, tp end\n  end\n  werror(\"bad register name `\"..expr..\"'\")\nend\n\nlocal function parse_fpr(expr)\n  local r = match(expr, \"^f([1-3]?[0-9])$\")\n  if r then\n    r = tonumber(r)\n    if r <= 31 then return r end\n  end\n  werror(\"bad register name `\"..expr..\"'\")\nend\n\nlocal function parse_imm(imm, bits, shift, scale, signed)\n  local n = tonumber(imm)\n  if n then\n    local m = sar(n, scale)\n    if shl(m, scale) == n then\n      if signed then\n\tlocal s = sar(m, bits-1)\n\tif s == 0 then return shl(m, shift)\n\telseif s == -1 then return shl(m + shl(1, bits), shift) end\n      else\n\tif sar(m, bits) == 0 then return shl(m, shift) end\n      end\n    end\n    werror(\"out of range immediate `\"..imm..\"'\")\n  elseif match(imm, \"^[rf]([1-3]?[0-9])$\") or\n\t match(imm, \"^([%w_]+):([rf][1-3]?[0-9])$\") then\n    werror(\"expected immediate operand, got register\")\n  else\n    waction(\"IMM\", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm)\n    return 0\n  end\nend\n\nlocal function parse_disp(disp)\n  local imm, reg = match(disp, \"^(.*)%(([%w_:]+)%)$\")\n  if imm then\n    local r = shl(parse_gpr(reg), 21)\n    local extname = match(imm, \"^extern%s+(%S+)$\")\n    if extname then\n      waction(\"REL_EXT\", map_extern[extname], nil, 1)\n      return r\n    else\n      return r + parse_imm(imm, 16, 0, 0, true)\n    end\n  end\n  local reg, tailr = match(disp, \"^([%w_:]+)%s*(.*)$\")\n  if reg and tailr ~= \"\" then\n    local r, tp = parse_gpr(reg)\n    if tp then\n      waction(\"IMM\", 32768+16*32, format(tp.ctypefmt, tailr))\n      return shl(r, 21)\n    end\n  end\n  werror(\"bad displacement `\"..disp..\"'\")\nend\n\nlocal function parse_index(idx)\n  local rt, rs = match(idx, \"^(.*)%(([%w_:]+)%)$\")\n  if rt then\n    rt = parse_gpr(rt)\n    rs = parse_gpr(rs)\n    return shl(rt, 16) + shl(rs, 21)\n  end\n  werror(\"bad index `\"..idx..\"'\")\nend\n\nlocal function parse_label(label, def)\n  local prefix = sub(label, 1, 2)\n  -- =>label (pc label reference)\n  if prefix == \"=>\" then\n    return \"PC\", 0, sub(label, 3)\n  end\n  -- ->name (global label reference)\n  if prefix == \"->\" then\n    return \"LG\", map_global[sub(label, 3)]\n  end\n  if def then\n    -- [1-9] (local label definition)\n    if match(label, \"^[1-9]$\") then\n      return \"LG\", 10+tonumber(label)\n    end\n  else\n    -- [<>][1-9] (local label reference)\n    local dir, lnum = match(label, \"^([<>])([1-9])$\")\n    if dir then -- Fwd: 1-9, Bkwd: 11-19.\n      return \"LG\", lnum + (dir == \">\" and 0 or 10)\n    end\n    -- extern label (extern label reference)\n    local extname = match(label, \"^extern%s+(%S+)$\")\n    if extname then\n      return \"EXT\", map_extern[extname]\n    end\n  end\n  werror(\"bad label `\"..label..\"'\")\nend\n\n------------------------------------------------------------------------------\n\n-- Handle opcodes defined with template strings.\nmap_op[\".template__\"] = function(params, template, nparams)\n  if not params then return sub(template, 9) end\n  local op = tonumber(sub(template, 1, 8), 16)\n  local n = 1\n\n  -- Limit number of section buffer positions used by a single dasm_put().\n  -- A single opcode needs a maximum of 2 positions (ins/ext).\n  if secpos+2 > maxsecpos then wflush() end\n  local pos = wpos()\n\n  -- Process each character.\n  for p in gmatch(sub(template, 9), \".\") do\n    if p == \"D\" then\n      op = op + shl(parse_gpr(params[n]), 11); n = n + 1\n    elseif p == \"T\" then\n      op = op + shl(parse_gpr(params[n]), 16); n = n + 1\n    elseif p == \"S\" then\n      op = op + shl(parse_gpr(params[n]), 21); n = n + 1\n    elseif p == \"F\" then\n      op = op + shl(parse_fpr(params[n]), 6); n = n + 1\n    elseif p == \"G\" then\n      op = op + shl(parse_fpr(params[n]), 11); n = n + 1\n    elseif p == \"H\" then\n      op = op + shl(parse_fpr(params[n]), 16); n = n + 1\n    elseif p == \"R\" then\n      op = op + shl(parse_fpr(params[n]), 21); n = n + 1\n    elseif p == \"I\" then\n      op = op + parse_imm(params[n], 16, 0, 0, true); n = n + 1\n    elseif p == \"U\" then\n      op = op + parse_imm(params[n], 16, 0, 0, false); n = n + 1\n    elseif p == \"O\" then\n      op = op + parse_disp(params[n]); n = n + 1\n    elseif p == \"X\" then\n      op = op + parse_index(params[n]); n = n + 1\n    elseif p == \"B\" or p == \"J\" then\n      local mode, n, s = parse_label(params[n], false)\n      if p == \"B\" then n = n + 2048 end\n      waction(\"REL_\"..mode, n, s, 1)\n      n = n + 1\n    elseif p == \"A\" then\n      op = op + parse_imm(params[n], 5, 6, 0, false); n = n + 1\n    elseif p == \"M\" then\n      op = op + parse_imm(params[n], 5, 11, 0, false); n = n + 1\n    elseif p == \"N\" then\n      op = op + parse_imm(params[n], 5, 16, 0, false); n = n + 1\n    elseif p == \"C\" then\n      op = op + parse_imm(params[n], 3, 18, 0, false); n = n + 1\n    elseif p == \"V\" then\n      op = op + parse_imm(params[n], 3, 8, 0, false); n = n + 1\n    elseif p == \"W\" then\n      op = op + parse_imm(params[n], 3, 0, 0, false); n = n + 1\n    elseif p == \"Y\" then\n      op = op + parse_imm(params[n], 20, 6, 0, false); n = n + 1\n    elseif p == \"Z\" then\n      op = op + parse_imm(params[n], 10, 6, 0, false); n = n + 1\n    elseif p == \"=\" then\n      op = op + shl(band(op, 0xf800), 5) -- Copy D to T for clz, clo.\n    else\n      assert(false)\n    end\n  end\n  wputpos(pos, op)\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode to mark the position where the action list is to be emitted.\nmap_op[\".actionlist_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeactions(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the global enum is to be emitted.\nmap_op[\".globals_1\"] = function(params)\n  if not params then return \"prefix\" end\n  local prefix = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobals(out, prefix) end)\nend\n\n-- Pseudo-opcode to mark the position where the global names are to be emitted.\nmap_op[\".globalnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobalnames(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the extern names are to be emitted.\nmap_op[\".externnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeexternnames(out, name) end)\nend\n\n------------------------------------------------------------------------------\n\n-- Label pseudo-opcode (converted from trailing colon form).\nmap_op[\".label_1\"] = function(params)\n  if not params then return \"[1-9] | ->global | =>pcexpr\" end\n  if secpos+1 > maxsecpos then wflush() end\n  local mode, n, s = parse_label(params[1], true)\n  if mode == \"EXT\" then werror(\"bad label definition\") end\n  waction(\"LABEL_\"..mode, n, s, 1)\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcodes for data storage.\nmap_op[\".long_*\"] = function(params)\n  if not params then return \"imm...\" end\n  for _,p in ipairs(params) do\n    local n = tonumber(p)\n    if not n then werror(\"bad immediate `\"..p..\"'\") end\n    if n < 0 then n = n + 2^32 end\n    wputw(n)\n    if secpos+2 > maxsecpos then wflush() end\n  end\nend\n\n-- Alignment pseudo-opcode.\nmap_op[\".align_1\"] = function(params)\n  if not params then return \"numpow2\" end\n  if secpos+1 > maxsecpos then wflush() end\n  local align = tonumber(params[1])\n  if align then\n    local x = align\n    -- Must be a power of 2 in the range (2 ... 256).\n    for i=1,8 do\n      x = x / 2\n      if x == 1 then\n\twaction(\"ALIGN\", align-1, nil, 1) -- Action byte is 2**n-1.\n\treturn\n      end\n    end\n  end\n  werror(\"bad alignment\")\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode for (primitive) type definitions (map to C types).\nmap_op[\".type_3\"] = function(params, nparams)\n  if not params then\n    return nparams == 2 and \"name, ctype\" or \"name, ctype, reg\"\n  end\n  local name, ctype, reg = params[1], params[2], params[3]\n  if not match(name, \"^[%a_][%w_]*$\") then\n    werror(\"bad type name `\"..name..\"'\")\n  end\n  local tp = map_type[name]\n  if tp then\n    werror(\"duplicate type `\"..name..\"'\")\n  end\n  -- Add #type to defines. A bit unclean to put it in map_archdef.\n  map_archdef[\"#\"..name] = \"sizeof(\"..ctype..\")\"\n  -- Add new type and emit shortcut define.\n  local num = ctypenum + 1\n  map_type[name] = {\n    ctype = ctype,\n    ctypefmt = format(\"Dt%X(%%s)\", num),\n    reg = reg,\n  }\n  wline(format(\"#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)\", num, ctype))\n  ctypenum = num\nend\nmap_op[\".type_2\"] = map_op[\".type_3\"]\n\n-- Dump type definitions.\nlocal function dumptypes(out, lvl)\n  local t = {}\n  for name in pairs(map_type) do t[#t+1] = name end\n  sort(t)\n  out:write(\"Type definitions:\\n\")\n  for _,name in ipairs(t) do\n    local tp = map_type[name]\n    local reg = tp.reg or \"\"\n    out:write(format(\"  %-20s %-20s %s\\n\", name, tp.ctype, reg))\n  end\n  out:write(\"\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Set the current section.\nfunction _M.section(num)\n  waction(\"SECTION\", num)\n  wflush(true) -- SECTION is a terminal action.\nend\n\n------------------------------------------------------------------------------\n\n-- Dump architecture description.\nfunction _M.dumparch(out)\n  out:write(format(\"DynASM %s version %s, released %s\\n\\n\",\n    _info.arch, _info.version, _info.release))\n  dumpactions(out)\nend\n\n-- Dump all user defined elements.\nfunction _M.dumpdef(out, lvl)\n  dumptypes(out, lvl)\n  dumpglobals(out, lvl)\n  dumpexterns(out, lvl)\nend\n\n------------------------------------------------------------------------------\n\n-- Pass callbacks from/to the DynASM core.\nfunction _M.passcb(wl, we, wf, ww)\n  wline, werror, wfatal, wwarn = wl, we, wf, ww\n  return wflush\nend\n\n-- Setup the arch-specific module.\nfunction _M.setup(arch, opt)\n  g_arch, g_opt = arch, opt\nend\n\n-- Merge the core maps and the arch-specific maps.\nfunction _M.mergemaps(map_coreop, map_def)\n  setmetatable(map_op, { __index = map_coreop })\n  setmetatable(map_def, { __index = map_archdef })\n  return map_op, map_def\nend\n\nreturn _M\n\n------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_ppc.h",
    "content": "/*\n** DynASM PPC encoding engine.\n** Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n** Released under the MIT license. See dynasm.lua for full copyright notice.\n*/\n\n#include <stddef.h>\n#include <stdarg.h>\n#include <string.h>\n#include <stdlib.h>\n\n#define DASM_ARCH\t\t\"ppc\"\n\n#ifndef DASM_EXTERN\n#define DASM_EXTERN(a,b,c,d)\t0\n#endif\n\n/* Action definitions. */\nenum {\n  DASM_STOP, DASM_SECTION, DASM_ESC, DASM_REL_EXT,\n  /* The following actions need a buffer position. */\n  DASM_ALIGN, DASM_REL_LG, DASM_LABEL_LG,\n  /* The following actions also have an argument. */\n  DASM_REL_PC, DASM_LABEL_PC, DASM_IMM,\n  DASM__MAX\n};\n\n/* Maximum number of section buffer positions for a single dasm_put() call. */\n#define DASM_MAXSECPOS\t\t25\n\n/* DynASM encoder status codes. Action list offset or number are or'ed in. */\n#define DASM_S_OK\t\t0x00000000\n#define DASM_S_NOMEM\t\t0x01000000\n#define DASM_S_PHASE\t\t0x02000000\n#define DASM_S_MATCH_SEC\t0x03000000\n#define DASM_S_RANGE_I\t\t0x11000000\n#define DASM_S_RANGE_SEC\t0x12000000\n#define DASM_S_RANGE_LG\t\t0x13000000\n#define DASM_S_RANGE_PC\t\t0x14000000\n#define DASM_S_RANGE_REL\t0x15000000\n#define DASM_S_UNDEF_LG\t\t0x21000000\n#define DASM_S_UNDEF_PC\t\t0x22000000\n\n/* Macros to convert positions (8 bit section + 24 bit index). */\n#define DASM_POS2IDX(pos)\t((pos)&0x00ffffff)\n#define DASM_POS2BIAS(pos)\t((pos)&0xff000000)\n#define DASM_SEC2POS(sec)\t((sec)<<24)\n#define DASM_POS2SEC(pos)\t((pos)>>24)\n#define DASM_POS2PTR(D, pos)\t(D->sections[DASM_POS2SEC(pos)].rbuf + (pos))\n\n/* Action list type. */\ntypedef const unsigned int *dasm_ActList;\n\n/* Per-section structure. */\ntypedef struct dasm_Section {\n  int *rbuf;\t\t/* Biased buffer pointer (negative section bias). */\n  int *buf;\t\t/* True buffer pointer. */\n  size_t bsize;\t\t/* Buffer size in bytes. */\n  int pos;\t\t/* Biased buffer position. */\n  int epos;\t\t/* End of biased buffer position - max single put. */\n  int ofs;\t\t/* Byte offset into section. */\n} dasm_Section;\n\n/* Core structure holding the DynASM encoding state. */\nstruct dasm_State {\n  size_t psize;\t\t\t/* Allocated size of this structure. */\n  dasm_ActList actionlist;\t/* Current actionlist pointer. */\n  int *lglabels;\t\t/* Local/global chain/pos ptrs. */\n  size_t lgsize;\n  int *pclabels;\t\t/* PC label chains/pos ptrs. */\n  size_t pcsize;\n  void **globals;\t\t/* Array of globals (bias -10). */\n  dasm_Section *section;\t/* Pointer to active section. */\n  size_t codesize;\t\t/* Total size of all code sections. */\n  int maxsection;\t\t/* 0 <= sectionidx < maxsection. */\n  int status;\t\t\t/* Status code. */\n  dasm_Section sections[1];\t/* All sections. Alloc-extended. */\n};\n\n/* The size of the core structure depends on the max. number of sections. */\n#define DASM_PSZ(ms)\t(sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section))\n\n\n/* Initialize DynASM state. */\nvoid dasm_init(Dst_DECL, int maxsection)\n{\n  dasm_State *D;\n  size_t psz = 0;\n  int i;\n  Dst_REF = NULL;\n  DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection));\n  D = Dst_REF;\n  D->psize = psz;\n  D->lglabels = NULL;\n  D->lgsize = 0;\n  D->pclabels = NULL;\n  D->pcsize = 0;\n  D->globals = NULL;\n  D->maxsection = maxsection;\n  for (i = 0; i < maxsection; i++) {\n    D->sections[i].buf = NULL;  /* Need this for pass3. */\n    D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i);\n    D->sections[i].bsize = 0;\n    D->sections[i].epos = 0;  /* Wrong, but is recalculated after resize. */\n  }\n}\n\n/* Free DynASM state. */\nvoid dasm_free(Dst_DECL)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  for (i = 0; i < D->maxsection; i++)\n    if (D->sections[i].buf)\n      DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize);\n  if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize);\n  if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize);\n  DASM_M_FREE(Dst, D, D->psize);\n}\n\n/* Setup global label array. Must be called before dasm_setup(). */\nvoid dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl)\n{\n  dasm_State *D = Dst_REF;\n  D->globals = gl - 10;  /* Negative bias to compensate for locals. */\n  DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int));\n}\n\n/* Grow PC label array. Can be called after dasm_setup(), too. */\nvoid dasm_growpc(Dst_DECL, unsigned int maxpc)\n{\n  dasm_State *D = Dst_REF;\n  size_t osz = D->pcsize;\n  DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int));\n  memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz);\n}\n\n/* Setup encoder. */\nvoid dasm_setup(Dst_DECL, const void *actionlist)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  D->actionlist = (dasm_ActList)actionlist;\n  D->status = DASM_S_OK;\n  D->section = &D->sections[0];\n  memset((void *)D->lglabels, 0, D->lgsize);\n  if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);\n  for (i = 0; i < D->maxsection; i++) {\n    D->sections[i].pos = DASM_SEC2POS(i);\n    D->sections[i].ofs = 0;\n  }\n}\n\n\n#ifdef DASM_CHECKS\n#define CK(x, st) \\\n  do { if (!(x)) { \\\n    D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0)\n#define CKPL(kind, st) \\\n  do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \\\n    D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0)\n#else\n#define CK(x, st)\t((void)0)\n#define CKPL(kind, st)\t((void)0)\n#endif\n\n/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */\nvoid dasm_put(Dst_DECL, int start, ...)\n{\n  va_list ap;\n  dasm_State *D = Dst_REF;\n  dasm_ActList p = D->actionlist + start;\n  dasm_Section *sec = D->section;\n  int pos = sec->pos, ofs = sec->ofs;\n  int *b;\n\n  if (pos >= sec->epos) {\n    DASM_M_GROW(Dst, int, sec->buf, sec->bsize,\n      sec->bsize + 2*DASM_MAXSECPOS*sizeof(int));\n    sec->rbuf = sec->buf - DASM_POS2BIAS(pos);\n    sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos);\n  }\n\n  b = sec->rbuf;\n  b[pos++] = start;\n\n  va_start(ap, start);\n  while (1) {\n    unsigned int ins = *p++;\n    unsigned int action = (ins >> 16);\n    if (action >= DASM__MAX) {\n      ofs += 4;\n    } else {\n      int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0;\n      switch (action) {\n      case DASM_STOP: goto stop;\n      case DASM_SECTION:\n\tn = (ins & 255); CK(n < D->maxsection, RANGE_SEC);\n\tD->section = &D->sections[n]; goto stop;\n      case DASM_ESC: p++; ofs += 4; break;\n      case DASM_REL_EXT: break;\n      case DASM_ALIGN: ofs += (ins & 255); b[pos++] = ofs; break;\n      case DASM_REL_LG:\n\tn = (ins & 2047) - 10; pl = D->lglabels + n;\n\tif (n >= 0) { CKPL(lg, LG); goto putrel; }  /* Bkwd rel or global. */\n\tpl += 10; n = *pl;\n\tif (n < 0) n = 0;  /* Start new chain for fwd rel if label exists. */\n\tgoto linkrel;\n      case DASM_REL_PC:\n\tpl = D->pclabels + n; CKPL(pc, PC);\n      putrel:\n\tn = *pl;\n\tif (n < 0) {  /* Label exists. Get label pos and store it. */\n\t  b[pos] = -n;\n\t} else {\n      linkrel:\n\t  b[pos] = n;  /* Else link to rel chain, anchored at label. */\n\t  *pl = pos;\n\t}\n\tpos++;\n\tbreak;\n      case DASM_LABEL_LG:\n\tpl = D->lglabels + (ins & 2047) - 10; CKPL(lg, LG); goto putlabel;\n      case DASM_LABEL_PC:\n\tpl = D->pclabels + n; CKPL(pc, PC);\n      putlabel:\n\tn = *pl;  /* n > 0: Collapse rel chain and replace with label pos. */\n\twhile (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos;\n\t}\n\t*pl = -pos;  /* Label exists now. */\n\tb[pos++] = ofs;  /* Store pass1 offset estimate. */\n\tbreak;\n      case DASM_IMM:\n#ifdef DASM_CHECKS\n\tCK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I);\n#endif\n\tn >>= ((ins>>10)&31);\n#ifdef DASM_CHECKS\n\tif (ins & 0x8000)\n\t  CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I);\n\telse\n\t  CK((n>>((ins>>5)&31)) == 0, RANGE_I);\n#endif\n\tb[pos++] = n;\n\tbreak;\n      }\n    }\n  }\nstop:\n  va_end(ap);\n  sec->pos = pos;\n  sec->ofs = ofs;\n}\n#undef CK\n\n/* Pass 2: Link sections, shrink aligns, fix label offsets. */\nint dasm_link(Dst_DECL, size_t *szp)\n{\n  dasm_State *D = Dst_REF;\n  int secnum;\n  int ofs = 0;\n\n#ifdef DASM_CHECKS\n  *szp = 0;\n  if (D->status != DASM_S_OK) return D->status;\n  {\n    int pc;\n    for (pc = 0; pc*sizeof(int) < D->pcsize; pc++)\n      if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc;\n  }\n#endif\n\n  { /* Handle globals not defined in this translation unit. */\n    int idx;\n    for (idx = 20; idx*sizeof(int) < D->lgsize; idx++) {\n      int n = D->lglabels[idx];\n      /* Undefined label: Collapse rel chain and replace with marker (< 0). */\n      while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; }\n    }\n  }\n\n  /* Combine all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->rbuf;\n    int pos = DASM_SEC2POS(secnum);\n    int lastpos = sec->pos;\n\n    while (pos != lastpos) {\n      dasm_ActList p = D->actionlist + b[pos++];\n      while (1) {\n\tunsigned int ins = *p++;\n\tunsigned int action = (ins >> 16);\n\tswitch (action) {\n\tcase DASM_STOP: case DASM_SECTION: goto stop;\n\tcase DASM_ESC: p++; break;\n\tcase DASM_REL_EXT: break;\n\tcase DASM_ALIGN: ofs -= (b[pos++] + ofs) & (ins & 255); break;\n\tcase DASM_REL_LG: case DASM_REL_PC: pos++; break;\n\tcase DASM_LABEL_LG: case DASM_LABEL_PC: b[pos++] += ofs; break;\n\tcase DASM_IMM: pos++; break;\n\t}\n      }\n      stop: (void)0;\n    }\n    ofs += sec->ofs;  /* Next section starts right after current section. */\n  }\n\n  D->codesize = ofs;  /* Total size of all code sections */\n  *szp = ofs;\n  return DASM_S_OK;\n}\n\n#ifdef DASM_CHECKS\n#define CK(x, st) \\\n  do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0)\n#else\n#define CK(x, st)\t((void)0)\n#endif\n\n/* Pass 3: Encode sections. */\nint dasm_encode(Dst_DECL, void *buffer)\n{\n  dasm_State *D = Dst_REF;\n  char *base = (char *)buffer;\n  unsigned int *cp = (unsigned int *)buffer;\n  int secnum;\n\n  /* Encode all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->buf;\n    int *endb = sec->rbuf + sec->pos;\n\n    while (b != endb) {\n      dasm_ActList p = D->actionlist + *b++;\n      while (1) {\n\tunsigned int ins = *p++;\n\tunsigned int action = (ins >> 16);\n\tint n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0;\n\tswitch (action) {\n\tcase DASM_STOP: case DASM_SECTION: goto stop;\n\tcase DASM_ESC: *cp++ = *p++; break;\n\tcase DASM_REL_EXT:\n\t  n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins & 2047), 1) - 4;\n\t  goto patchrel;\n\tcase DASM_ALIGN:\n\t  ins &= 255; while ((((char *)cp - base) & ins)) *cp++ = 0x60000000;\n\t  break;\n\tcase DASM_REL_LG:\n\t  CK(n >= 0, UNDEF_LG);\n\tcase DASM_REL_PC:\n\t  CK(n >= 0, UNDEF_PC);\n\t  n = *DASM_POS2PTR(D, n) - (int)((char *)cp - base);\n\tpatchrel:\n\t  CK((n & 3) == 0 &&\n\t      (((n+4) + ((ins & 2048) ? 0x00008000 : 0x02000000)) >>\n\t       ((ins & 2048) ? 16 : 26)) == 0, RANGE_REL);\n\t  cp[-1] |= ((n+4) & ((ins & 2048) ? 0x0000fffc: 0x03fffffc));\n\t  break;\n\tcase DASM_LABEL_LG:\n\t  ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n);\n\t  break;\n\tcase DASM_LABEL_PC: break;\n\tcase DASM_IMM:\n\t  cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31);\n\t  break;\n\tdefault: *cp++ = ins; break;\n\t}\n      }\n      stop: (void)0;\n    }\n  }\n\n  if (base + D->codesize != (char *)cp)  /* Check for phase errors. */\n    return DASM_S_PHASE;\n  return DASM_S_OK;\n}\n#undef CK\n\n/* Get PC label offset. */\nint dasm_getpclabel(Dst_DECL, unsigned int pc)\n{\n  dasm_State *D = Dst_REF;\n  if (pc*sizeof(int) < D->pcsize) {\n    int pos = D->pclabels[pc];\n    if (pos < 0) return *DASM_POS2PTR(D, -pos);\n    if (pos > 0) return -1;  /* Undefined. */\n  }\n  return -2;  /* Unused or out of range. */\n}\n\n#ifdef DASM_CHECKS\n/* Optional sanity checker to call between isolated encoding steps. */\nint dasm_checkstep(Dst_DECL, int secmatch)\n{\n  dasm_State *D = Dst_REF;\n  if (D->status == DASM_S_OK) {\n    int i;\n    for (i = 1; i <= 9; i++) {\n      if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_LG|i; break; }\n      D->lglabels[i] = 0;\n    }\n  }\n  if (D->status == DASM_S_OK && secmatch >= 0 &&\n      D->section != &D->sections[secmatch])\n    D->status = DASM_S_MATCH_SEC|(D->section-D->sections);\n  return D->status;\n}\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_ppc.lua",
    "content": "------------------------------------------------------------------------------\n-- DynASM PPC module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- See dynasm.lua for full copyright notice.\n------------------------------------------------------------------------------\n\n-- Module information:\nlocal _info = {\n  arch =\t\"ppc\",\n  description =\t\"DynASM PPC module\",\n  version =\t\"1.3.0\",\n  vernum =\t 10300,\n  release =\t\"2011-05-05\",\n  author =\t\"Mike Pall\",\n  license =\t\"MIT\",\n}\n\n-- Exported glue functions for the arch-specific module.\nlocal _M = { _info = _info }\n\n-- Cache library functions.\nlocal type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs\nlocal assert, setmetatable = assert, setmetatable\nlocal _s = string\nlocal sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char\nlocal match, gmatch = _s.match, _s.gmatch\nlocal concat, sort = table.concat, table.sort\nlocal bit = bit or require(\"bit\")\nlocal band, shl, shr, sar = bit.band, bit.lshift, bit.rshift, bit.arshift\nlocal tohex = bit.tohex\n\n-- Inherited tables and callbacks.\nlocal g_opt, g_arch\nlocal wline, werror, wfatal, wwarn\n\n-- Action name list.\n-- CHECK: Keep this in sync with the C code!\nlocal action_names = {\n  \"STOP\", \"SECTION\", \"ESC\", \"REL_EXT\",\n  \"ALIGN\", \"REL_LG\", \"LABEL_LG\",\n  \"REL_PC\", \"LABEL_PC\", \"IMM\",\n}\n\n-- Maximum number of section buffer positions for dasm_put().\n-- CHECK: Keep this in sync with the C code!\nlocal maxsecpos = 25 -- Keep this low, to avoid excessively long C lines.\n\n-- Action name -> action number.\nlocal map_action = {}\nfor n,name in ipairs(action_names) do\n  map_action[name] = n-1\nend\n\n-- Action list buffer.\nlocal actlist = {}\n\n-- Argument list for next dasm_put(). Start with offset 0 into action list.\nlocal actargs = { 0 }\n\n-- Current number of section buffer positions for dasm_put().\nlocal secpos = 1\n\n------------------------------------------------------------------------------\n\n-- Dump action names and numbers.\nlocal function dumpactions(out)\n  out:write(\"DynASM encoding engine action codes:\\n\")\n  for n,name in ipairs(action_names) do\n    local num = map_action[name]\n    out:write(format(\"  %-10s %02X  %d\\n\", name, num, num))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write action list buffer as a huge static C array.\nlocal function writeactions(out, name)\n  local nn = #actlist\n  if nn == 0 then nn = 1; actlist[0] = map_action.STOP end\n  out:write(\"static const unsigned int \", name, \"[\", nn, \"] = {\\n\")\n  for i = 1,nn-1 do\n    assert(out:write(\"0x\", tohex(actlist[i]), \",\\n\"))\n  end\n  assert(out:write(\"0x\", tohex(actlist[nn]), \"\\n};\\n\\n\"))\nend\n\n------------------------------------------------------------------------------\n\n-- Add word to action list.\nlocal function wputxw(n)\n  assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, \"word out of range\")\n  actlist[#actlist+1] = n\nend\n\n-- Add action to list with optional arg. Advance buffer pos, too.\nlocal function waction(action, val, a, num)\n  local w = assert(map_action[action], \"bad action name `\"..action..\"'\")\n  wputxw(w * 0x10000 + (val or 0))\n  if a then actargs[#actargs+1] = a end\n  if a or num then secpos = secpos + (num or 1) end\nend\n\n-- Flush action list (intervening C code or buffer pos overflow).\nlocal function wflush(term)\n  if #actlist == actargs[1] then return end -- Nothing to flush.\n  if not term then waction(\"STOP\") end -- Terminate action list.\n  wline(format(\"dasm_put(Dst, %s);\", concat(actargs, \", \")), true)\n  actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put().\n  secpos = 1 -- The actionlist offset occupies a buffer position, too.\nend\n\n-- Put escaped word.\nlocal function wputw(n)\n  if n <= 0xffffff then waction(\"ESC\") end\n  wputxw(n)\nend\n\n-- Reserve position for word.\nlocal function wpos()\n  local pos = #actlist+1\n  actlist[pos] = \"\"\n  return pos\nend\n\n-- Store word to reserved position.\nlocal function wputpos(pos, n)\n  assert(n >= 0 and n <= 0xffffffff and n % 1 == 0, \"word out of range\")\n  actlist[pos] = n\nend\n\n------------------------------------------------------------------------------\n\n-- Global label name -> global label number. With auto assignment on 1st use.\nlocal next_global = 20\nlocal map_global = setmetatable({}, { __index = function(t, name)\n  if not match(name, \"^[%a_][%w_]*$\") then werror(\"bad global label\") end\n  local n = next_global\n  if n > 2047 then werror(\"too many global labels\") end\n  next_global = n + 1\n  t[name] = n\n  return n\nend})\n\n-- Dump global labels.\nlocal function dumpglobals(out, lvl)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"Global labels:\\n\")\n  for i=20,next_global-1 do\n    out:write(format(\"  %s\\n\", t[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write global label enum.\nlocal function writeglobals(out, prefix)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"enum {\\n\")\n  for i=20,next_global-1 do\n    out:write(\"  \", prefix, t[i], \",\\n\")\n  end\n  out:write(\"  \", prefix, \"_MAX\\n};\\n\")\nend\n\n-- Write global label names.\nlocal function writeglobalnames(out, name)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=20,next_global-1 do\n    out:write(\"  \\\"\", t[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Extern label name -> extern label number. With auto assignment on 1st use.\nlocal next_extern = 0\nlocal map_extern_ = {}\nlocal map_extern = setmetatable({}, { __index = function(t, name)\n  -- No restrictions on the name for now.\n  local n = next_extern\n  if n > 2047 then werror(\"too many extern labels\") end\n  next_extern = n + 1\n  t[name] = n\n  map_extern_[n] = name\n  return n\nend})\n\n-- Dump extern labels.\nlocal function dumpexterns(out, lvl)\n  out:write(\"Extern labels:\\n\")\n  for i=0,next_extern-1 do\n    out:write(format(\"  %s\\n\", map_extern_[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write extern label names.\nlocal function writeexternnames(out, name)\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=0,next_extern-1 do\n    out:write(\"  \\\"\", map_extern_[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Arch-specific maps.\nlocal map_archdef = { sp = \"r1\" } -- Ext. register name -> int. name.\n\nlocal map_type = {}\t\t-- Type name -> { ctype, reg }\nlocal ctypenum = 0\t\t-- Type number (for Dt... macros).\n\n-- Reverse defines for registers.\nfunction _M.revdef(s)\n  if s == \"r1\" then return \"sp\" end\n  return s\nend\n\nlocal map_cond = {\n  lt = 0, gt = 1, eq = 2, so = 3,\n  ge = 4, le = 5, ne = 6, ns = 7,\n}\n\n------------------------------------------------------------------------------\n\n-- Template strings for PPC instructions.\nlocal map_op = {\n  tdi_3 =\t\"08000000ARI\",\n  twi_3 =\t\"0c000000ARI\",\n  mulli_3 =\t\"1c000000RRI\",\n  subfic_3 =\t\"20000000RRI\",\n  cmplwi_3 =\t\"28000000XRU\",\n  cmplwi_2 =\t\"28000000-RU\",\n  cmpldi_3 =\t\"28200000XRU\",\n  cmpldi_2 =\t\"28200000-RU\",\n  cmpwi_3 =\t\"2c000000XRI\",\n  cmpwi_2 =\t\"2c000000-RI\",\n  cmpdi_3 =\t\"2c200000XRI\",\n  cmpdi_2 =\t\"2c200000-RI\",\n  addic_3 =\t\"30000000RRI\",\n  [\"addic._3\"] = \"34000000RRI\",\n  addi_3 =\t\"38000000RR0I\",\n  li_2 =\t\"38000000RI\",\n  la_2 =\t\"38000000RD\",\n  addis_3 =\t\"3c000000RR0I\",\n  lis_2 =\t\"3c000000RI\",\n  lus_2 =\t\"3c000000RU\",\n  bc_3 =\t\"40000000AAK\",\n  bcl_3 =\t\"40000001AAK\",\n  bdnz_1 =\t\"42000000K\",\n  bdz_1 =\t\"42400000K\",\n  sc_0 =\t\"44000000\",\n  b_1 =\t\t\"48000000J\",\n  bl_1 =\t\"48000001J\",\n  rlwimi_5 =\t\"50000000RR~AAA.\",\n  rlwinm_5 =\t\"54000000RR~AAA.\",\n  rlwnm_5 =\t\"5c000000RR~RAA.\",\n  ori_3 =\t\"60000000RR~U\",\n  nop_0 =\t\"60000000\",\n  oris_3 =\t\"64000000RR~U\",\n  xori_3 =\t\"68000000RR~U\",\n  xoris_3 =\t\"6c000000RR~U\",\n  [\"andi._3\"] =\t\"70000000RR~U\",\n  [\"andis._3\"] = \"74000000RR~U\",\n  lwz_2 =\t\"80000000RD\",\n  lwzu_2 =\t\"84000000RD\",\n  lbz_2 =\t\"88000000RD\",\n  lbzu_2 =\t\"8c000000RD\",\n  stw_2 =\t\"90000000RD\",\n  stwu_2 =\t\"94000000RD\",\n  stb_2 =\t\"98000000RD\",\n  stbu_2 =\t\"9c000000RD\",\n  lhz_2 =\t\"a0000000RD\",\n  lhzu_2 =\t\"a4000000RD\",\n  lha_2 =\t\"a8000000RD\",\n  lhau_2 =\t\"ac000000RD\",\n  sth_2 =\t\"b0000000RD\",\n  sthu_2 =\t\"b4000000RD\",\n  lmw_2 =\t\"b8000000RD\",\n  stmw_2 =\t\"bc000000RD\",\n  lfs_2 =\t\"c0000000FD\",\n  lfsu_2 =\t\"c4000000FD\",\n  lfd_2 =\t\"c8000000FD\",\n  lfdu_2 =\t\"cc000000FD\",\n  stfs_2 =\t\"d0000000FD\",\n  stfsu_2 =\t\"d4000000FD\",\n  stfd_2 =\t\"d8000000FD\",\n  stfdu_2 =\t\"dc000000FD\",\n  ld_2 =\t\"e8000000RD\", -- NYI: displacement must be divisible by 4.\n  ldu_2 =\t\"e8000001RD\",\n  lwa_2 =\t\"e8000002RD\",\n  std_2 =\t\"f8000000RD\",\n  stdu_2 =\t\"f8000001RD\",\n\n  -- Primary opcode 19:\n  mcrf_2 =\t\"4c000000XX\",\n  isync_0 =\t\"4c00012c\",\n  crnor_3 =\t\"4c000042CCC\",\n  crnot_2 =\t\"4c000042CC=\",\n  crandc_3 =\t\"4c000102CCC\",\n  crxor_3 =\t\"4c000182CCC\",\n  crclr_1 =\t\"4c000182C==\",\n  crnand_3 =\t\"4c0001c2CCC\",\n  crand_3 =\t\"4c000202CCC\",\n  creqv_3 =\t\"4c000242CCC\",\n  crset_1 =\t\"4c000242C==\",\n  crorc_3 =\t\"4c000342CCC\",\n  cror_3 =\t\"4c000382CCC\",\n  crmove_2 =\t\"4c000382CC=\",\n  bclr_2 =\t\"4c000020AA\",\n  bclrl_2 =\t\"4c000021AA\",\n  bcctr_2 =\t\"4c000420AA\",\n  bcctrl_2 =\t\"4c000421AA\",\n  blr_0 =\t\"4e800020\",\n  blrl_0 =\t\"4e800021\",\n  bctr_0 =\t\"4e800420\",\n  bctrl_0 =\t\"4e800421\",\n\n  -- Primary opcode 31:\n  cmpw_3 =\t\"7c000000XRR\",\n  cmpw_2 =\t\"7c000000-RR\",\n  cmpd_3 =\t\"7c200000XRR\",\n  cmpd_2 =\t\"7c200000-RR\",\n  tw_3 =\t\"7c000008ARR\",\n  subfc_3 =\t\"7c000010RRR.\",\n  subc_3 =\t\"7c000010RRR~.\",\n  mulhdu_3 =\t\"7c000012RRR.\",\n  addc_3 =\t\"7c000014RRR.\",\n  mulhwu_3 =\t\"7c000016RRR.\",\n  isel_4 =\t\"7c00001eRRRC\",\n  isellt_3 =\t\"7c00001eRRR\",\n  iselgt_3 =\t\"7c00005eRRR\",\n  iseleq_3 =\t\"7c00009eRRR\",\n  mfcr_1 =\t\"7c000026R\",\n  mfocrf_2 =\t\"7c100026RG\",\n  mtcrf_2 =\t\"7c000120GR\",\n  mtocrf_2 =\t\"7c100120GR\",\n  lwarx_3 =\t\"7c000028RR0R\",\n  ldx_3 =\t\"7c00002aRR0R\",\n  lwzx_3 =\t\"7c00002eRR0R\",\n  slw_3 =\t\"7c000030RR~R.\",\n  cntlzw_2 =\t\"7c000034RR~\",\n  sld_3 =\t\"7c000036RR~R.\",\n  and_3 =\t\"7c000038RR~R.\",\n  cmplw_3 =\t\"7c000040XRR\",\n  cmplw_2 =\t\"7c000040-RR\",\n  cmpld_3 =\t\"7c200040XRR\",\n  cmpld_2 =\t\"7c200040-RR\",\n  subf_3 =\t\"7c000050RRR.\",\n  sub_3 =\t\"7c000050RRR~.\",\n  ldux_3 =\t\"7c00006aRR0R\",\n  dcbst_2 =\t\"7c00006c-RR\",\n  lwzux_3 =\t\"7c00006eRR0R\",\n  cntlzd_2 =\t\"7c000074RR~\",\n  andc_3 =\t\"7c000078RR~R.\",\n  td_3 =\t\"7c000088ARR\",\n  mulhd_3 =\t\"7c000092RRR.\",\n  mulhw_3 =\t\"7c000096RRR.\",\n  ldarx_3 =\t\"7c0000a8RR0R\",\n  dcbf_2 =\t\"7c0000ac-RR\",\n  lbzx_3 =\t\"7c0000aeRR0R\",\n  neg_2 =\t\"7c0000d0RR.\",\n  lbzux_3 =\t\"7c0000eeRR0R\",\n  popcntb_2 =\t\"7c0000f4RR~\",\n  not_2 =\t\"7c0000f8RR~%.\",\n  nor_3 =\t\"7c0000f8RR~R.\",\n  subfe_3 =\t\"7c000110RRR.\",\n  sube_3 =\t\"7c000110RRR~.\",\n  adde_3 =\t\"7c000114RRR.\",\n  stdx_3 =\t\"7c00012aRR0R\",\n  stwcx_3 =\t\"7c00012cRR0R.\",\n  stwx_3 =\t\"7c00012eRR0R\",\n  prtyw_2 =\t\"7c000134RR~\",\n  stdux_3 =\t\"7c00016aRR0R\",\n  stwux_3 =\t\"7c00016eRR0R\",\n  prtyd_2 =\t\"7c000174RR~\",\n  subfze_2 =\t\"7c000190RR.\",\n  addze_2 =\t\"7c000194RR.\",\n  stdcx_3 =\t\"7c0001acRR0R.\",\n  stbx_3 =\t\"7c0001aeRR0R\",\n  subfme_2 =\t\"7c0001d0RR.\",\n  mulld_3 =\t\"7c0001d2RRR.\",\n  addme_2 =\t\"7c0001d4RR.\",\n  mullw_3 =\t\"7c0001d6RRR.\",\n  dcbtst_2 =\t\"7c0001ec-RR\",\n  stbux_3 =\t\"7c0001eeRR0R\",\n  add_3 =\t\"7c000214RRR.\",\n  dcbt_2 =\t\"7c00022c-RR\",\n  lhzx_3 =\t\"7c00022eRR0R\",\n  eqv_3 =\t\"7c000238RR~R.\",\n  eciwx_3 =\t\"7c00026cRR0R\",\n  lhzux_3 =\t\"7c00026eRR0R\",\n  xor_3 =\t\"7c000278RR~R.\",\n  mfspefscr_1 =\t\"7c0082a6R\",\n  mfxer_1 =\t\"7c0102a6R\",\n  mflr_1 =\t\"7c0802a6R\",\n  mfctr_1 =\t\"7c0902a6R\",\n  lwax_3 =\t\"7c0002aaRR0R\",\n  lhax_3 =\t\"7c0002aeRR0R\",\n  mftb_1 =\t\"7c0c42e6R\",\n  mftbu_1 =\t\"7c0d42e6R\",\n  lwaux_3 =\t\"7c0002eaRR0R\",\n  lhaux_3 =\t\"7c0002eeRR0R\",\n  sthx_3 =\t\"7c00032eRR0R\",\n  orc_3 =\t\"7c000338RR~R.\",\n  ecowx_3 =\t\"7c00036cRR0R\",\n  sthux_3 =\t\"7c00036eRR0R\",\n  or_3 =\t\"7c000378RR~R.\",\n  mr_2 =\t\"7c000378RR~%.\",\n  divdu_3 =\t\"7c000392RRR.\",\n  divwu_3 =\t\"7c000396RRR.\",\n  mtspefscr_1 =\t\"7c0083a6R\",\n  mtxer_1 =\t\"7c0103a6R\",\n  mtlr_1 =\t\"7c0803a6R\",\n  mtctr_1 =\t\"7c0903a6R\",\n  dcbi_2 =\t\"7c0003ac-RR\",\n  nand_3 =\t\"7c0003b8RR~R.\",\n  divd_3 =\t\"7c0003d2RRR.\",\n  divw_3 =\t\"7c0003d6RRR.\",\n  cmpb_3 =\t\"7c0003f8RR~R.\",\n  mcrxr_1 =\t\"7c000400X\",\n  subfco_3 =\t\"7c000410RRR.\",\n  subco_3 =\t\"7c000410RRR~.\",\n  addco_3 =\t\"7c000414RRR.\",\n  ldbrx_3 =\t\"7c000428RR0R\",\n  lswx_3 =\t\"7c00042aRR0R\",\n  lwbrx_3 =\t\"7c00042cRR0R\",\n  lfsx_3 =\t\"7c00042eFR0R\",\n  srw_3 =\t\"7c000430RR~R.\",\n  srd_3 =\t\"7c000436RR~R.\",\n  subfo_3 =\t\"7c000450RRR.\",\n  subo_3 =\t\"7c000450RRR~.\",\n  lfsux_3 =\t\"7c00046eFR0R\",\n  lswi_3 =\t\"7c0004aaRR0A\",\n  sync_0 =\t\"7c0004ac\",\n  lwsync_0 =\t\"7c2004ac\",\n  ptesync_0 =\t\"7c4004ac\",\n  lfdx_3 =\t\"7c0004aeFR0R\",\n  nego_2 =\t\"7c0004d0RR.\",\n  lfdux_3 =\t\"7c0004eeFR0R\",\n  subfeo_3 =\t\"7c000510RRR.\",\n  subeo_3 =\t\"7c000510RRR~.\",\n  addeo_3 =\t\"7c000514RRR.\",\n  stdbrx_3 =\t\"7c000528RR0R\",\n  stswx_3 =\t\"7c00052aRR0R\",\n  stwbrx_3 =\t\"7c00052cRR0R\",\n  stfsx_3 =\t\"7c00052eFR0R\",\n  stfsux_3 =\t\"7c00056eFR0R\",\n  subfzeo_2 =\t\"7c000590RR.\",\n  addzeo_2 =\t\"7c000594RR.\",\n  stswi_3 =\t\"7c0005aaRR0A\",\n  stfdx_3 =\t\"7c0005aeFR0R\",\n  subfmeo_2 =\t\"7c0005d0RR.\",\n  mulldo_3 =\t\"7c0005d2RRR.\",\n  addmeo_2 =\t\"7c0005d4RR.\",\n  mullwo_3 =\t\"7c0005d6RRR.\",\n  dcba_2 =\t\"7c0005ec-RR\",\n  stfdux_3 =\t\"7c0005eeFR0R\",\n  addo_3 =\t\"7c000614RRR.\",\n  lhbrx_3 =\t\"7c00062cRR0R\",\n  sraw_3 =\t\"7c000630RR~R.\",\n  srad_3 =\t\"7c000634RR~R.\",\n  srawi_3 =\t\"7c000670RR~A.\",\n  sradi_3 =\t\"7c000674RR~H.\",\n  eieio_0 =\t\"7c0006ac\",\n  lfiwax_3 =\t\"7c0006aeFR0R\",\n  sthbrx_3 =\t\"7c00072cRR0R\",\n  extsh_2 =\t\"7c000734RR~.\",\n  extsb_2 =\t\"7c000774RR~.\",\n  divduo_3 =\t\"7c000792RRR.\",\n  divwou_3 =\t\"7c000796RRR.\",\n  icbi_2 =\t\"7c0007ac-RR\",\n  stfiwx_3 =\t\"7c0007aeFR0R\",\n  extsw_2 =\t\"7c0007b4RR~.\",\n  divdo_3 =\t\"7c0007d2RRR.\",\n  divwo_3 =\t\"7c0007d6RRR.\",\n  dcbz_2 =\t\"7c0007ec-RR\",\n\n  -- Primary opcode 30:\n  rldicl_4 =\t\"78000000RR~HM.\",\n  rldicr_4 =\t\"78000004RR~HM.\",\n  rldic_4 =\t\"78000008RR~HM.\",\n  rldimi_4 =\t\"7800000cRR~HM.\",\n  rldcl_4 =\t\"78000010RR~RM.\",\n  rldcr_4 =\t\"78000012RR~RM.\",\n\n  -- Primary opcode 59:\n  fdivs_3 =\t\"ec000024FFF.\",\n  fsubs_3 =\t\"ec000028FFF.\",\n  fadds_3 =\t\"ec00002aFFF.\",\n  fsqrts_2 =\t\"ec00002cF-F.\",\n  fres_2 =\t\"ec000030F-F.\",\n  fmuls_3 =\t\"ec000032FF-F.\",\n  frsqrtes_2 =\t\"ec000034F-F.\",\n  fmsubs_4 =\t\"ec000038FFFF~.\",\n  fmadds_4 =\t\"ec00003aFFFF~.\",\n  fnmsubs_4 =\t\"ec00003cFFFF~.\",\n  fnmadds_4 =\t\"ec00003eFFFF~.\",\n\n  -- Primary opcode 63:\n  fdiv_3 =\t\"fc000024FFF.\",\n  fsub_3 =\t\"fc000028FFF.\",\n  fadd_3 =\t\"fc00002aFFF.\",\n  fsqrt_2 =\t\"fc00002cF-F.\",\n  fsel_4 =\t\"fc00002eFFFF~.\",\n  fre_2 =\t\"fc000030F-F.\",\n  fmul_3 =\t\"fc000032FF-F.\",\n  frsqrte_2 =\t\"fc000034F-F.\",\n  fmsub_4 =\t\"fc000038FFFF~.\",\n  fmadd_4 =\t\"fc00003aFFFF~.\",\n  fnmsub_4 =\t\"fc00003cFFFF~.\",\n  fnmadd_4 =\t\"fc00003eFFFF~.\",\n  fcmpu_3 =\t\"fc000000XFF\",\n  fcpsgn_3 =\t\"fc000010FFF.\",\n  fcmpo_3 =\t\"fc000040XFF\",\n  mtfsb1_1 =\t\"fc00004cA\",\n  fneg_2 =\t\"fc000050F-F.\",\n  mcrfs_2 =\t\"fc000080XX\",\n  mtfsb0_1 =\t\"fc00008cA\",\n  fmr_2 =\t\"fc000090F-F.\",\n  frsp_2 =\t\"fc000018F-F.\",\n  fctiw_2 =\t\"fc00001cF-F.\",\n  fctiwz_2 =\t\"fc00001eF-F.\",\n  mtfsfi_2 =\t\"fc00010cAA\", -- NYI: upshift.\n  fnabs_2 =\t\"fc000110F-F.\",\n  fabs_2 =\t\"fc000210F-F.\",\n  frin_2 =\t\"fc000310F-F.\",\n  friz_2 =\t\"fc000350F-F.\",\n  frip_2 =\t\"fc000390F-F.\",\n  frim_2 =\t\"fc0003d0F-F.\",\n  mffs_1 =\t\"fc00048eF.\",\n  -- NYI: mtfsf, mtfsb0, mtfsb1.\n  fctid_2 =\t\"fc00065cF-F.\",\n  fctidz_2 =\t\"fc00065eF-F.\",\n  fcfid_2 =\t\"fc00069cF-F.\",\n\n  -- Primary opcode 4, SPE APU extension:\n  evaddw_3 =\t\t\"10000200RRR\",\n  evaddiw_3 =\t\t\"10000202RAR~\",\n  evsubw_3 =\t\t\"10000204RRR~\",\n  evsubiw_3 =\t\t\"10000206RAR~\",\n  evabs_2 =\t\t\"10000208RR\",\n  evneg_2 =\t\t\"10000209RR\",\n  evextsb_2 =\t\t\"1000020aRR\",\n  evextsh_2 =\t\t\"1000020bRR\",\n  evrndw_2 =\t\t\"1000020cRR\",\n  evcntlzw_2 =\t\t\"1000020dRR\",\n  evcntlsw_2 =\t\t\"1000020eRR\",\n  brinc_3 =\t\t\"1000020fRRR\",\n  evand_3 =\t\t\"10000211RRR\",\n  evandc_3 =\t\t\"10000212RRR\",\n  evxor_3 =\t\t\"10000216RRR\",\n  evor_3 =\t\t\"10000217RRR\",\n  evmr_2 =\t\t\"10000217RR=\",\n  evnor_3 =\t\t\"10000218RRR\",\n  evnot_2 =\t\t\"10000218RR=\",\n  eveqv_3 =\t\t\"10000219RRR\",\n  evorc_3 =\t\t\"1000021bRRR\",\n  evnand_3 =\t\t\"1000021eRRR\",\n  evsrwu_3 =\t\t\"10000220RRR\",\n  evsrws_3 =\t\t\"10000221RRR\",\n  evsrwiu_3 =\t\t\"10000222RRA\",\n  evsrwis_3 =\t\t\"10000223RRA\",\n  evslw_3 =\t\t\"10000224RRR\",\n  evslwi_3 =\t\t\"10000226RRA\",\n  evrlw_3 =\t\t\"10000228RRR\",\n  evsplati_2 =\t\t\"10000229RS\",\n  evrlwi_3 =\t\t\"1000022aRRA\",\n  evsplatfi_2 =\t\t\"1000022bRS\",\n  evmergehi_3 =\t\t\"1000022cRRR\",\n  evmergelo_3 =\t\t\"1000022dRRR\",\n  evcmpgtu_3 =\t\t\"10000230XRR\",\n  evcmpgtu_2 =\t\t\"10000230-RR\",\n  evcmpgts_3 =\t\t\"10000231XRR\",\n  evcmpgts_2 =\t\t\"10000231-RR\",\n  evcmpltu_3 =\t\t\"10000232XRR\",\n  evcmpltu_2 =\t\t\"10000232-RR\",\n  evcmplts_3 =\t\t\"10000233XRR\",\n  evcmplts_2 =\t\t\"10000233-RR\",\n  evcmpeq_3 =\t\t\"10000234XRR\",\n  evcmpeq_2 =\t\t\"10000234-RR\",\n  evsel_4 =\t\t\"10000278RRRW\",\n  evsel_3 =\t\t\"10000278RRR\",\n  evfsadd_3 =\t\t\"10000280RRR\",\n  evfssub_3 =\t\t\"10000281RRR\",\n  evfsabs_2 =\t\t\"10000284RR\",\n  evfsnabs_2 =\t\t\"10000285RR\",\n  evfsneg_2 =\t\t\"10000286RR\",\n  evfsmul_3 =\t\t\"10000288RRR\",\n  evfsdiv_3 =\t\t\"10000289RRR\",\n  evfscmpgt_3 =\t\t\"1000028cXRR\",\n  evfscmpgt_2 =\t\t\"1000028c-RR\",\n  evfscmplt_3 =\t\t\"1000028dXRR\",\n  evfscmplt_2 =\t\t\"1000028d-RR\",\n  evfscmpeq_3 =\t\t\"1000028eXRR\",\n  evfscmpeq_2 =\t\t\"1000028e-RR\",\n  evfscfui_2 =\t\t\"10000290R-R\",\n  evfscfsi_2 =\t\t\"10000291R-R\",\n  evfscfuf_2 =\t\t\"10000292R-R\",\n  evfscfsf_2 =\t\t\"10000293R-R\",\n  evfsctui_2 =\t\t\"10000294R-R\",\n  evfsctsi_2 =\t\t\"10000295R-R\",\n  evfsctuf_2 =\t\t\"10000296R-R\",\n  evfsctsf_2 =\t\t\"10000297R-R\",\n  evfsctuiz_2 =\t\t\"10000298R-R\",\n  evfsctsiz_2 =\t\t\"1000029aR-R\",\n  evfststgt_3 =\t\t\"1000029cXRR\",\n  evfststgt_2 =\t\t\"1000029c-RR\",\n  evfststlt_3 =\t\t\"1000029dXRR\",\n  evfststlt_2 =\t\t\"1000029d-RR\",\n  evfststeq_3 =\t\t\"1000029eXRR\",\n  evfststeq_2 =\t\t\"1000029e-RR\",\n  efsadd_3 =\t\t\"100002c0RRR\",\n  efssub_3 =\t\t\"100002c1RRR\",\n  efsabs_2 =\t\t\"100002c4RR\",\n  efsnabs_2 =\t\t\"100002c5RR\",\n  efsneg_2 =\t\t\"100002c6RR\",\n  efsmul_3 =\t\t\"100002c8RRR\",\n  efsdiv_3 =\t\t\"100002c9RRR\",\n  efscmpgt_3 =\t\t\"100002ccXRR\",\n  efscmpgt_2 =\t\t\"100002cc-RR\",\n  efscmplt_3 =\t\t\"100002cdXRR\",\n  efscmplt_2 =\t\t\"100002cd-RR\",\n  efscmpeq_3 =\t\t\"100002ceXRR\",\n  efscmpeq_2 =\t\t\"100002ce-RR\",\n  efscfd_2 =\t\t\"100002cfR-R\",\n  efscfui_2 =\t\t\"100002d0R-R\",\n  efscfsi_2 =\t\t\"100002d1R-R\",\n  efscfuf_2 =\t\t\"100002d2R-R\",\n  efscfsf_2 =\t\t\"100002d3R-R\",\n  efsctui_2 =\t\t\"100002d4R-R\",\n  efsctsi_2 =\t\t\"100002d5R-R\",\n  efsctuf_2 =\t\t\"100002d6R-R\",\n  efsctsf_2 =\t\t\"100002d7R-R\",\n  efsctuiz_2 =\t\t\"100002d8R-R\",\n  efsctsiz_2 =\t\t\"100002daR-R\",\n  efststgt_3 =\t\t\"100002dcXRR\",\n  efststgt_2 =\t\t\"100002dc-RR\",\n  efststlt_3 =\t\t\"100002ddXRR\",\n  efststlt_2 =\t\t\"100002dd-RR\",\n  efststeq_3 =\t\t\"100002deXRR\",\n  efststeq_2 =\t\t\"100002de-RR\",\n  efdadd_3 =\t\t\"100002e0RRR\",\n  efdsub_3 =\t\t\"100002e1RRR\",\n  efdcfuid_2 =\t\t\"100002e2R-R\",\n  efdcfsid_2 =\t\t\"100002e3R-R\",\n  efdabs_2 =\t\t\"100002e4RR\",\n  efdnabs_2 =\t\t\"100002e5RR\",\n  efdneg_2 =\t\t\"100002e6RR\",\n  efdmul_3 =\t\t\"100002e8RRR\",\n  efddiv_3 =\t\t\"100002e9RRR\",\n  efdctuidz_2 =\t\t\"100002eaR-R\",\n  efdctsidz_2 =\t\t\"100002ebR-R\",\n  efdcmpgt_3 =\t\t\"100002ecXRR\",\n  efdcmpgt_2 =\t\t\"100002ec-RR\",\n  efdcmplt_3 =\t\t\"100002edXRR\",\n  efdcmplt_2 =\t\t\"100002ed-RR\",\n  efdcmpeq_3 =\t\t\"100002eeXRR\",\n  efdcmpeq_2 =\t\t\"100002ee-RR\",\n  efdcfs_2 =\t\t\"100002efR-R\",\n  efdcfui_2 =\t\t\"100002f0R-R\",\n  efdcfsi_2 =\t\t\"100002f1R-R\",\n  efdcfuf_2 =\t\t\"100002f2R-R\",\n  efdcfsf_2 =\t\t\"100002f3R-R\",\n  efdctui_2 =\t\t\"100002f4R-R\",\n  efdctsi_2 =\t\t\"100002f5R-R\",\n  efdctuf_2 =\t\t\"100002f6R-R\",\n  efdctsf_2 =\t\t\"100002f7R-R\",\n  efdctuiz_2 =\t\t\"100002f8R-R\",\n  efdctsiz_2 =\t\t\"100002faR-R\",\n  efdtstgt_3 =\t\t\"100002fcXRR\",\n  efdtstgt_2 =\t\t\"100002fc-RR\",\n  efdtstlt_3 =\t\t\"100002fdXRR\",\n  efdtstlt_2 =\t\t\"100002fd-RR\",\n  efdtsteq_3 =\t\t\"100002feXRR\",\n  efdtsteq_2 =\t\t\"100002fe-RR\",\n  evlddx_3 =\t\t\"10000300RR0R\",\n  evldd_2 =\t\t\"10000301R8\",\n  evldwx_3 =\t\t\"10000302RR0R\",\n  evldw_2 =\t\t\"10000303R8\",\n  evldhx_3 =\t\t\"10000304RR0R\",\n  evldh_2 =\t\t\"10000305R8\",\n  evlwhex_3 =\t\t\"10000310RR0R\",\n  evlwhe_2 =\t\t\"10000311R4\",\n  evlwhoux_3 =\t\t\"10000314RR0R\",\n  evlwhou_2 =\t\t\"10000315R4\",\n  evlwhosx_3 =\t\t\"10000316RR0R\",\n  evlwhos_2 =\t\t\"10000317R4\",\n  evstddx_3 =\t\t\"10000320RR0R\",\n  evstdd_2 =\t\t\"10000321R8\",\n  evstdwx_3 =\t\t\"10000322RR0R\",\n  evstdw_2 =\t\t\"10000323R8\",\n  evstdhx_3 =\t\t\"10000324RR0R\",\n  evstdh_2 =\t\t\"10000325R8\",\n  evstwhex_3 =\t\t\"10000330RR0R\",\n  evstwhe_2 =\t\t\"10000331R4\",\n  evstwhox_3 =\t\t\"10000334RR0R\",\n  evstwho_2 =\t\t\"10000335R4\",\n  evstwwex_3 =\t\t\"10000338RR0R\",\n  evstwwe_2 =\t\t\"10000339R4\",\n  evstwwox_3 =\t\t\"1000033cRR0R\",\n  evstwwo_2 =\t\t\"1000033dR4\",\n  evmhessf_3 =\t\t\"10000403RRR\",\n  evmhossf_3 =\t\t\"10000407RRR\",\n  evmheumi_3 =\t\t\"10000408RRR\",\n  evmhesmi_3 =\t\t\"10000409RRR\",\n  evmhesmf_3 =\t\t\"1000040bRRR\",\n  evmhoumi_3 =\t\t\"1000040cRRR\",\n  evmhosmi_3 =\t\t\"1000040dRRR\",\n  evmhosmf_3 =\t\t\"1000040fRRR\",\n  evmhessfa_3 =\t\t\"10000423RRR\",\n  evmhossfa_3 =\t\t\"10000427RRR\",\n  evmheumia_3 =\t\t\"10000428RRR\",\n  evmhesmia_3 =\t\t\"10000429RRR\",\n  evmhesmfa_3 =\t\t\"1000042bRRR\",\n  evmhoumia_3 =\t\t\"1000042cRRR\",\n  evmhosmia_3 =\t\t\"1000042dRRR\",\n  evmhosmfa_3 =\t\t\"1000042fRRR\",\n  evmwhssf_3 =\t\t\"10000447RRR\",\n  evmwlumi_3 =\t\t\"10000448RRR\",\n  evmwhumi_3 =\t\t\"1000044cRRR\",\n  evmwhsmi_3 =\t\t\"1000044dRRR\",\n  evmwhsmf_3 =\t\t\"1000044fRRR\",\n  evmwssf_3 =\t\t\"10000453RRR\",\n  evmwumi_3 =\t\t\"10000458RRR\",\n  evmwsmi_3 =\t\t\"10000459RRR\",\n  evmwsmf_3 =\t\t\"1000045bRRR\",\n  evmwhssfa_3 =\t\t\"10000467RRR\",\n  evmwlumia_3 =\t\t\"10000468RRR\",\n  evmwhumia_3 =\t\t\"1000046cRRR\",\n  evmwhsmia_3 =\t\t\"1000046dRRR\",\n  evmwhsmfa_3 =\t\t\"1000046fRRR\",\n  evmwssfa_3 =\t\t\"10000473RRR\",\n  evmwumia_3 =\t\t\"10000478RRR\",\n  evmwsmia_3 =\t\t\"10000479RRR\",\n  evmwsmfa_3 =\t\t\"1000047bRRR\",\n  evmra_2 =\t\t\"100004c4RR\",\n  evdivws_3 =\t\t\"100004c6RRR\",\n  evdivwu_3 =\t\t\"100004c7RRR\",\n  evmwssfaa_3 =\t\t\"10000553RRR\",\n  evmwumiaa_3 =\t\t\"10000558RRR\",\n  evmwsmiaa_3 =\t\t\"10000559RRR\",\n  evmwsmfaa_3 =\t\t\"1000055bRRR\",\n  evmwssfan_3 =\t\t\"100005d3RRR\",\n  evmwumian_3 =\t\t\"100005d8RRR\",\n  evmwsmian_3 =\t\t\"100005d9RRR\",\n  evmwsmfan_3 =\t\t\"100005dbRRR\",\n  evmergehilo_3 =\t\"1000022eRRR\",\n  evmergelohi_3 =\t\"1000022fRRR\",\n  evlhhesplatx_3 =\t\"10000308RR0R\",\n  evlhhesplat_2 =\t\"10000309R2\",\n  evlhhousplatx_3 =\t\"1000030cRR0R\",\n  evlhhousplat_2 =\t\"1000030dR2\",\n  evlhhossplatx_3 =\t\"1000030eRR0R\",\n  evlhhossplat_2 =\t\"1000030fR2\",\n  evlwwsplatx_3 =\t\"10000318RR0R\",\n  evlwwsplat_2 =\t\"10000319R4\",\n  evlwhsplatx_3 =\t\"1000031cRR0R\",\n  evlwhsplat_2 =\t\"1000031dR4\",\n  evaddusiaaw_2 =\t\"100004c0RR\",\n  evaddssiaaw_2 =\t\"100004c1RR\",\n  evsubfusiaaw_2 =\t\"100004c2RR\",\n  evsubfssiaaw_2 =\t\"100004c3RR\",\n  evaddumiaaw_2 =\t\"100004c8RR\",\n  evaddsmiaaw_2 =\t\"100004c9RR\",\n  evsubfumiaaw_2 =\t\"100004caRR\",\n  evsubfsmiaaw_2 =\t\"100004cbRR\",\n  evmheusiaaw_3 =\t\"10000500RRR\",\n  evmhessiaaw_3 =\t\"10000501RRR\",\n  evmhessfaaw_3 =\t\"10000503RRR\",\n  evmhousiaaw_3 =\t\"10000504RRR\",\n  evmhossiaaw_3 =\t\"10000505RRR\",\n  evmhossfaaw_3 =\t\"10000507RRR\",\n  evmheumiaaw_3 =\t\"10000508RRR\",\n  evmhesmiaaw_3 =\t\"10000509RRR\",\n  evmhesmfaaw_3 =\t\"1000050bRRR\",\n  evmhoumiaaw_3 =\t\"1000050cRRR\",\n  evmhosmiaaw_3 =\t\"1000050dRRR\",\n  evmhosmfaaw_3 =\t\"1000050fRRR\",\n  evmhegumiaa_3 =\t\"10000528RRR\",\n  evmhegsmiaa_3 =\t\"10000529RRR\",\n  evmhegsmfaa_3 =\t\"1000052bRRR\",\n  evmhogumiaa_3 =\t\"1000052cRRR\",\n  evmhogsmiaa_3 =\t\"1000052dRRR\",\n  evmhogsmfaa_3 =\t\"1000052fRRR\",\n  evmwlusiaaw_3 =\t\"10000540RRR\",\n  evmwlssiaaw_3 =\t\"10000541RRR\",\n  evmwlumiaaw_3 =\t\"10000548RRR\",\n  evmwlsmiaaw_3 =\t\"10000549RRR\",\n  evmheusianw_3 =\t\"10000580RRR\",\n  evmhessianw_3 =\t\"10000581RRR\",\n  evmhessfanw_3 =\t\"10000583RRR\",\n  evmhousianw_3 =\t\"10000584RRR\",\n  evmhossianw_3 =\t\"10000585RRR\",\n  evmhossfanw_3 =\t\"10000587RRR\",\n  evmheumianw_3 =\t\"10000588RRR\",\n  evmhesmianw_3 =\t\"10000589RRR\",\n  evmhesmfanw_3 =\t\"1000058bRRR\",\n  evmhoumianw_3 =\t\"1000058cRRR\",\n  evmhosmianw_3 =\t\"1000058dRRR\",\n  evmhosmfanw_3 =\t\"1000058fRRR\",\n  evmhegumian_3 =\t\"100005a8RRR\",\n  evmhegsmian_3 =\t\"100005a9RRR\",\n  evmhegsmfan_3 =\t\"100005abRRR\",\n  evmhogumian_3 =\t\"100005acRRR\",\n  evmhogsmian_3 =\t\"100005adRRR\",\n  evmhogsmfan_3 =\t\"100005afRRR\",\n  evmwlusianw_3 =\t\"100005c0RRR\",\n  evmwlssianw_3 =\t\"100005c1RRR\",\n  evmwlumianw_3 =\t\"100005c8RRR\",\n  evmwlsmianw_3 =\t\"100005c9RRR\",\n\n  -- NYI: Book E instructions.\n}\n\n-- Add mnemonics for \".\" variants.\ndo\n  local t = {}\n  for k,v in pairs(map_op) do\n    if sub(v, -1) == \".\" then\n      local v2 = sub(v, 1, 7)..char(byte(v, 8)+1)..sub(v, 9, -2)\n      t[sub(k, 1, -3)..\".\"..sub(k, -2)] = v2\n    end\n  end\n  for k,v in pairs(t) do\n    map_op[k] = v\n  end\nend\n\n-- Add more branch mnemonics.\nfor cond,c in pairs(map_cond) do\n  local b1 = \"b\"..cond\n  local c1 = shl(band(c, 3), 16) + (c < 4 and 0x01000000 or 0)\n  -- bX[l]\n  map_op[b1..\"_1\"] = tohex(0x40800000 + c1)..\"K\"\n  map_op[b1..\"y_1\"] = tohex(0x40a00000 + c1)..\"K\"\n  map_op[b1..\"l_1\"] = tohex(0x40800001 + c1)..\"K\"\n  map_op[b1..\"_2\"] = tohex(0x40800000 + c1)..\"-XK\"\n  map_op[b1..\"y_2\"] = tohex(0x40a00000 + c1)..\"-XK\"\n  map_op[b1..\"l_2\"] = tohex(0x40800001 + c1)..\"-XK\"\n  -- bXlr[l]\n  map_op[b1..\"lr_0\"] = tohex(0x4c800020 + c1)\n  map_op[b1..\"lrl_0\"] = tohex(0x4c800021 + c1)\n  map_op[b1..\"ctr_0\"] = tohex(0x4c800420 + c1)\n  map_op[b1..\"ctrl_0\"] = tohex(0x4c800421 + c1)\n  -- bXctr[l]\n  map_op[b1..\"lr_1\"] = tohex(0x4c800020 + c1)..\"-X\"\n  map_op[b1..\"lrl_1\"] = tohex(0x4c800021 + c1)..\"-X\"\n  map_op[b1..\"ctr_1\"] = tohex(0x4c800420 + c1)..\"-X\"\n  map_op[b1..\"ctrl_1\"] = tohex(0x4c800421 + c1)..\"-X\"\nend\n\n------------------------------------------------------------------------------\n\nlocal function parse_gpr(expr)\n  local tname, ovreg = match(expr, \"^([%w_]+):(r[1-3]?[0-9])$\")\n  local tp = map_type[tname or expr]\n  if tp then\n    local reg = ovreg or tp.reg\n    if not reg then\n      werror(\"type `\"..(tname or expr)..\"' needs a register override\")\n    end\n    expr = reg\n  end\n  local r = match(expr, \"^r([1-3]?[0-9])$\")\n  if r then\n    r = tonumber(r)\n    if r <= 31 then return r, tp end\n  end\n  werror(\"bad register name `\"..expr..\"'\")\nend\n\nlocal function parse_fpr(expr)\n  local r = match(expr, \"^f([1-3]?[0-9])$\")\n  if r then\n    r = tonumber(r)\n    if r <= 31 then return r end\n  end\n  werror(\"bad register name `\"..expr..\"'\")\nend\n\nlocal function parse_cr(expr)\n  local r = match(expr, \"^cr([0-7])$\")\n  if r then return tonumber(r) end\n  werror(\"bad condition register name `\"..expr..\"'\")\nend\n\nlocal function parse_cond(expr)\n  local r, cond = match(expr, \"^4%*cr([0-7])%+(%w%w)$\")\n  if r then\n    r = tonumber(r)\n    local c = map_cond[cond]\n    if c and c < 4 then return r*4+c end\n  end\n  werror(\"bad condition bit name `\"..expr..\"'\")\nend\n\nlocal function parse_imm(imm, bits, shift, scale, signed)\n  local n = tonumber(imm)\n  if n then\n    local m = sar(n, scale)\n    if shl(m, scale) == n then\n      if signed then\n\tlocal s = sar(m, bits-1)\n\tif s == 0 then return shl(m, shift)\n\telseif s == -1 then return shl(m + shl(1, bits), shift) end\n      else\n\tif sar(m, bits) == 0 then return shl(m, shift) end\n      end\n    end\n    werror(\"out of range immediate `\"..imm..\"'\")\n  elseif match(imm, \"^r([1-3]?[0-9])$\") or\n\t match(imm, \"^([%w_]+):(r[1-3]?[0-9])$\") then\n    werror(\"expected immediate operand, got register\")\n  else\n    waction(\"IMM\", (signed and 32768 or 0)+scale*1024+bits*32+shift, imm)\n    return 0\n  end\nend\n\nlocal function parse_shiftmask(imm, isshift)\n  local n = tonumber(imm)\n  if n then\n    if shr(n, 6) == 0 then\n      local lsb = band(imm, 31)\n      local msb = imm - lsb\n      return isshift and (shl(lsb, 11)+shr(msb, 4)) or (shl(lsb, 6)+msb)\n    end\n    werror(\"out of range immediate `\"..imm..\"'\")\n  elseif match(imm, \"^r([1-3]?[0-9])$\") or\n\t match(imm, \"^([%w_]+):(r[1-3]?[0-9])$\") then\n    werror(\"expected immediate operand, got register\")\n  else\n    werror(\"NYI: parameterized 64 bit shift/mask\")\n  end\nend\n\nlocal function parse_disp(disp)\n  local imm, reg = match(disp, \"^(.*)%(([%w_:]+)%)$\")\n  if imm then\n    local r = parse_gpr(reg)\n    if r == 0 then werror(\"cannot use r0 in displacement\") end\n    return shl(r, 16) + parse_imm(imm, 16, 0, 0, true)\n  end\n  local reg, tailr = match(disp, \"^([%w_:]+)%s*(.*)$\")\n  if reg and tailr ~= \"\" then\n    local r, tp = parse_gpr(reg)\n    if r == 0 then werror(\"cannot use r0 in displacement\") end\n    if tp then\n      waction(\"IMM\", 32768+16*32, format(tp.ctypefmt, tailr))\n      return shl(r, 16)\n    end\n  end\n  werror(\"bad displacement `\"..disp..\"'\")\nend\n\nlocal function parse_u5disp(disp, scale)\n  local imm, reg = match(disp, \"^(.*)%(([%w_:]+)%)$\")\n  if imm then\n    local r = parse_gpr(reg)\n    if r == 0 then werror(\"cannot use r0 in displacement\") end\n    return shl(r, 16) + parse_imm(imm, 5, 11, scale, false)\n  end\n  local reg, tailr = match(disp, \"^([%w_:]+)%s*(.*)$\")\n  if reg and tailr ~= \"\" then\n    local r, tp = parse_gpr(reg)\n    if r == 0 then werror(\"cannot use r0 in displacement\") end\n    if tp then\n      waction(\"IMM\", scale*1024+5*32+11, format(tp.ctypefmt, tailr))\n      return shl(r, 16)\n    end\n  end\n  werror(\"bad displacement `\"..disp..\"'\")\nend\n\nlocal function parse_label(label, def)\n  local prefix = sub(label, 1, 2)\n  -- =>label (pc label reference)\n  if prefix == \"=>\" then\n    return \"PC\", 0, sub(label, 3)\n  end\n  -- ->name (global label reference)\n  if prefix == \"->\" then\n    return \"LG\", map_global[sub(label, 3)]\n  end\n  if def then\n    -- [1-9] (local label definition)\n    if match(label, \"^[1-9]$\") then\n      return \"LG\", 10+tonumber(label)\n    end\n  else\n    -- [<>][1-9] (local label reference)\n    local dir, lnum = match(label, \"^([<>])([1-9])$\")\n    if dir then -- Fwd: 1-9, Bkwd: 11-19.\n      return \"LG\", lnum + (dir == \">\" and 0 or 10)\n    end\n    -- extern label (extern label reference)\n    local extname = match(label, \"^extern%s+(%S+)$\")\n    if extname then\n      return \"EXT\", map_extern[extname]\n    end\n  end\n  werror(\"bad label `\"..label..\"'\")\nend\n\n------------------------------------------------------------------------------\n\n-- Handle opcodes defined with template strings.\nmap_op[\".template__\"] = function(params, template, nparams)\n  if not params then return sub(template, 9) end\n  local op = tonumber(sub(template, 1, 8), 16)\n  local n, rs = 1, 26\n\n  -- Limit number of section buffer positions used by a single dasm_put().\n  -- A single opcode needs a maximum of 3 positions (rlwinm).\n  if secpos+3 > maxsecpos then wflush() end\n  local pos = wpos()\n\n  -- Process each character.\n  for p in gmatch(sub(template, 9), \".\") do\n    if p == \"R\" then\n      rs = rs - 5; op = op + shl(parse_gpr(params[n]), rs); n = n + 1\n    elseif p == \"F\" then\n      rs = rs - 5; op = op + shl(parse_fpr(params[n]), rs); n = n + 1\n    elseif p == \"A\" then\n      rs = rs - 5; op = op + parse_imm(params[n], 5, rs, 0, false); n = n + 1\n    elseif p == \"S\" then\n      rs = rs - 5; op = op + parse_imm(params[n], 5, rs, 0, true); n = n + 1\n    elseif p == \"I\" then\n      op = op + parse_imm(params[n], 16, 0, 0, true); n = n + 1\n    elseif p == \"U\" then\n      op = op + parse_imm(params[n], 16, 0, 0, false); n = n + 1\n    elseif p == \"D\" then\n      op = op + parse_disp(params[n]); n = n + 1\n    elseif p == \"2\" then\n      op = op + parse_u5disp(params[n], 1); n = n + 1\n    elseif p == \"4\" then\n      op = op + parse_u5disp(params[n], 2); n = n + 1\n    elseif p == \"8\" then\n      op = op + parse_u5disp(params[n], 3); n = n + 1\n    elseif p == \"C\" then\n      rs = rs - 5; op = op + shl(parse_cond(params[n]), rs); n = n + 1\n    elseif p == \"X\" then\n      rs = rs - 5; op = op + shl(parse_cr(params[n]), rs+2); n = n + 1\n    elseif p == \"W\" then\n      op = op + parse_cr(params[n]); n = n + 1\n    elseif p == \"G\" then\n      op = op + parse_imm(params[n], 8, 12, 0, false); n = n + 1\n    elseif p == \"H\" then\n      op = op + parse_shiftmask(params[n], true); n = n + 1\n    elseif p == \"M\" then\n      op = op + parse_shiftmask(params[n], false); n = n + 1\n    elseif p == \"J\" or p == \"K\" then\n      local mode, n, s = parse_label(params[n], false)\n      if p == \"K\" then n = n + 2048 end\n      waction(\"REL_\"..mode, n, s, 1)\n      n = n + 1\n    elseif p == \"0\" then\n      if band(shr(op, rs), 31) == 0 then werror(\"cannot use r0\") end\n    elseif p == \"=\" or p == \"%\" then\n      local t = band(shr(op, p == \"%\" and rs+5 or rs), 31)\n      rs = rs - 5\n      op = op + shl(t, rs)\n    elseif p == \"~\" then\n      local mm = shl(31, rs)\n      local lo = band(op, mm)\n      local hi = band(op, shl(mm, 5))\n      op = op - lo - hi + shl(lo, 5) + shr(hi, 5)\n    elseif p == \"-\" then\n      rs = rs - 5\n    elseif p == \".\" then\n      -- Ignored.\n    else\n      assert(false)\n    end\n  end\n  wputpos(pos, op)\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode to mark the position where the action list is to be emitted.\nmap_op[\".actionlist_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeactions(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the global enum is to be emitted.\nmap_op[\".globals_1\"] = function(params)\n  if not params then return \"prefix\" end\n  local prefix = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobals(out, prefix) end)\nend\n\n-- Pseudo-opcode to mark the position where the global names are to be emitted.\nmap_op[\".globalnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobalnames(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the extern names are to be emitted.\nmap_op[\".externnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeexternnames(out, name) end)\nend\n\n------------------------------------------------------------------------------\n\n-- Label pseudo-opcode (converted from trailing colon form).\nmap_op[\".label_1\"] = function(params)\n  if not params then return \"[1-9] | ->global | =>pcexpr\" end\n  if secpos+1 > maxsecpos then wflush() end\n  local mode, n, s = parse_label(params[1], true)\n  if mode == \"EXT\" then werror(\"bad label definition\") end\n  waction(\"LABEL_\"..mode, n, s, 1)\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcodes for data storage.\nmap_op[\".long_*\"] = function(params)\n  if not params then return \"imm...\" end\n  for _,p in ipairs(params) do\n    local n = tonumber(p)\n    if not n then werror(\"bad immediate `\"..p..\"'\") end\n    if n < 0 then n = n + 2^32 end\n    wputw(n)\n    if secpos+2 > maxsecpos then wflush() end\n  end\nend\n\n-- Alignment pseudo-opcode.\nmap_op[\".align_1\"] = function(params)\n  if not params then return \"numpow2\" end\n  if secpos+1 > maxsecpos then wflush() end\n  local align = tonumber(params[1])\n  if align then\n    local x = align\n    -- Must be a power of 2 in the range (2 ... 256).\n    for i=1,8 do\n      x = x / 2\n      if x == 1 then\n\twaction(\"ALIGN\", align-1, nil, 1) -- Action byte is 2**n-1.\n\treturn\n      end\n    end\n  end\n  werror(\"bad alignment\")\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode for (primitive) type definitions (map to C types).\nmap_op[\".type_3\"] = function(params, nparams)\n  if not params then\n    return nparams == 2 and \"name, ctype\" or \"name, ctype, reg\"\n  end\n  local name, ctype, reg = params[1], params[2], params[3]\n  if not match(name, \"^[%a_][%w_]*$\") then\n    werror(\"bad type name `\"..name..\"'\")\n  end\n  local tp = map_type[name]\n  if tp then\n    werror(\"duplicate type `\"..name..\"'\")\n  end\n  -- Add #type to defines. A bit unclean to put it in map_archdef.\n  map_archdef[\"#\"..name] = \"sizeof(\"..ctype..\")\"\n  -- Add new type and emit shortcut define.\n  local num = ctypenum + 1\n  map_type[name] = {\n    ctype = ctype,\n    ctypefmt = format(\"Dt%X(%%s)\", num),\n    reg = reg,\n  }\n  wline(format(\"#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)\", num, ctype))\n  ctypenum = num\nend\nmap_op[\".type_2\"] = map_op[\".type_3\"]\n\n-- Dump type definitions.\nlocal function dumptypes(out, lvl)\n  local t = {}\n  for name in pairs(map_type) do t[#t+1] = name end\n  sort(t)\n  out:write(\"Type definitions:\\n\")\n  for _,name in ipairs(t) do\n    local tp = map_type[name]\n    local reg = tp.reg or \"\"\n    out:write(format(\"  %-20s %-20s %s\\n\", name, tp.ctype, reg))\n  end\n  out:write(\"\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Set the current section.\nfunction _M.section(num)\n  waction(\"SECTION\", num)\n  wflush(true) -- SECTION is a terminal action.\nend\n\n------------------------------------------------------------------------------\n\n-- Dump architecture description.\nfunction _M.dumparch(out)\n  out:write(format(\"DynASM %s version %s, released %s\\n\\n\",\n    _info.arch, _info.version, _info.release))\n  dumpactions(out)\nend\n\n-- Dump all user defined elements.\nfunction _M.dumpdef(out, lvl)\n  dumptypes(out, lvl)\n  dumpglobals(out, lvl)\n  dumpexterns(out, lvl)\nend\n\n------------------------------------------------------------------------------\n\n-- Pass callbacks from/to the DynASM core.\nfunction _M.passcb(wl, we, wf, ww)\n  wline, werror, wfatal, wwarn = wl, we, wf, ww\n  return wflush\nend\n\n-- Setup the arch-specific module.\nfunction _M.setup(arch, opt)\n  g_arch, g_opt = arch, opt\nend\n\n-- Merge the core maps and the arch-specific maps.\nfunction _M.mergemaps(map_coreop, map_def)\n  setmetatable(map_op, { __index = map_coreop })\n  setmetatable(map_def, { __index = map_archdef })\n  return map_op, map_def\nend\n\nreturn _M\n\n------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_proto.h",
    "content": "/*\n** DynASM encoding engine prototypes.\n** Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n** Released under the MIT license. See dynasm.lua for full copyright notice.\n*/\n\n#ifndef _DASM_PROTO_H\n#define _DASM_PROTO_H\n\n#include <stddef.h>\n#include <stdarg.h>\n\n#define DASM_IDENT\t\"DynASM 1.3.0\"\n#define DASM_VERSION\t10300\t/* 1.3.0 */\n\n#ifndef Dst_DECL\n#define Dst_DECL\tdasm_State **Dst\n#endif\n\n#ifndef Dst_REF\n#define Dst_REF\t\t(*Dst)\n#endif\n\n#ifndef DASM_FDEF\n#define DASM_FDEF\textern\n#endif\n\n#ifndef DASM_M_GROW\n#define DASM_M_GROW(ctx, t, p, sz, need) \\\n  do { \\\n    size_t _sz = (sz), _need = (need); \\\n    if (_sz < _need) { \\\n      if (_sz < 16) _sz = 16; \\\n      while (_sz < _need) _sz += _sz; \\\n      (p) = (t *)realloc((p), _sz); \\\n      if ((p) == NULL) exit(1); \\\n      (sz) = _sz; \\\n    } \\\n  } while(0)\n#endif\n\n#ifndef DASM_M_FREE\n#define DASM_M_FREE(ctx, p, sz)\tfree(p)\n#endif\n\n/* Internal DynASM encoder state. */\ntypedef struct dasm_State dasm_State;\n\n\n/* Initialize and free DynASM state. */\nDASM_FDEF void dasm_init(Dst_DECL, int maxsection);\nDASM_FDEF void dasm_free(Dst_DECL);\n\n/* Setup global array. Must be called before dasm_setup(). */\nDASM_FDEF void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl);\n\n/* Grow PC label array. Can be called after dasm_setup(), too. */\nDASM_FDEF void dasm_growpc(Dst_DECL, unsigned int maxpc);\n\n/* Setup encoder. */\nDASM_FDEF void dasm_setup(Dst_DECL, const void *actionlist);\n\n/* Feed encoder with actions. Calls are generated by pre-processor. */\nDASM_FDEF void dasm_put(Dst_DECL, int start, ...);\n\n/* Link sections and return the resulting size. */\nDASM_FDEF int dasm_link(Dst_DECL, size_t *szp);\n\n/* Encode sections into buffer. */\nDASM_FDEF int dasm_encode(Dst_DECL, void *buffer);\n\n/* Get PC label offset. */\nDASM_FDEF int dasm_getpclabel(Dst_DECL, unsigned int pc);\n\n#ifdef DASM_CHECKS\n/* Optional sanity checker to call between isolated encoding steps. */\nDASM_FDEF int dasm_checkstep(Dst_DECL, int secmatch);\n#else\n#define dasm_checkstep(a, b)\t0\n#endif\n\n\n#endif /* _DASM_PROTO_H */\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_x64.lua",
    "content": "------------------------------------------------------------------------------\n-- DynASM x64 module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- See dynasm.lua for full copyright notice.\n------------------------------------------------------------------------------\n-- This module just sets 64 bit mode for the combined x86/x64 module.\n-- All the interesting stuff is there.\n------------------------------------------------------------------------------\n\nx64 = true -- Using a global is an ugly, but effective solution.\nreturn require(\"dasm_x86\")\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_x86.h",
    "content": "/*\n** DynASM x86 encoding engine.\n** Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n** Released under the MIT license. See dynasm.lua for full copyright notice.\n*/\n\n#include <stddef.h>\n#include <stdarg.h>\n#include <string.h>\n#include <stdlib.h>\n\n#define DASM_ARCH\t\t\"x86\"\n\n#ifndef DASM_EXTERN\n#define DASM_EXTERN(a,b,c,d)\t0\n#endif\n\n/* Action definitions. DASM_STOP must be 255. */\nenum {\n  DASM_DISP = 233,\n  DASM_IMM_S, DASM_IMM_B, DASM_IMM_W, DASM_IMM_D, DASM_IMM_WB, DASM_IMM_DB,\n  DASM_VREG, DASM_SPACE, DASM_SETLABEL, DASM_REL_A, DASM_REL_LG, DASM_REL_PC,\n  DASM_IMM_LG, DASM_IMM_PC, DASM_LABEL_LG, DASM_LABEL_PC, DASM_ALIGN,\n  DASM_EXTERN, DASM_ESC, DASM_MARK, DASM_SECTION, DASM_STOP\n};\n\n/* Maximum number of section buffer positions for a single dasm_put() call. */\n#define DASM_MAXSECPOS\t\t25\n\n/* DynASM encoder status codes. Action list offset or number are or'ed in. */\n#define DASM_S_OK\t\t0x00000000\n#define DASM_S_NOMEM\t\t0x01000000\n#define DASM_S_PHASE\t\t0x02000000\n#define DASM_S_MATCH_SEC\t0x03000000\n#define DASM_S_RANGE_I\t\t0x11000000\n#define DASM_S_RANGE_SEC\t0x12000000\n#define DASM_S_RANGE_LG\t\t0x13000000\n#define DASM_S_RANGE_PC\t\t0x14000000\n#define DASM_S_RANGE_VREG\t0x15000000\n#define DASM_S_UNDEF_L\t\t0x21000000\n#define DASM_S_UNDEF_PC\t\t0x22000000\n\n/* Macros to convert positions (8 bit section + 24 bit index). */\n#define DASM_POS2IDX(pos)\t((pos)&0x00ffffff)\n#define DASM_POS2BIAS(pos)\t((pos)&0xff000000)\n#define DASM_SEC2POS(sec)\t((sec)<<24)\n#define DASM_POS2SEC(pos)\t((pos)>>24)\n#define DASM_POS2PTR(D, pos)\t(D->sections[DASM_POS2SEC(pos)].rbuf + (pos))\n\n/* Action list type. */\ntypedef const unsigned char *dasm_ActList;\n\n/* Per-section structure. */\ntypedef struct dasm_Section {\n  int *rbuf;\t\t/* Biased buffer pointer (negative section bias). */\n  int *buf;\t\t/* True buffer pointer. */\n  size_t bsize;\t\t/* Buffer size in bytes. */\n  int pos;\t\t/* Biased buffer position. */\n  int epos;\t\t/* End of biased buffer position - max single put. */\n  int ofs;\t\t/* Byte offset into section. */\n} dasm_Section;\n\n/* Core structure holding the DynASM encoding state. */\nstruct dasm_State {\n  size_t psize;\t\t\t/* Allocated size of this structure. */\n  dasm_ActList actionlist;\t/* Current actionlist pointer. */\n  int *lglabels;\t\t/* Local/global chain/pos ptrs. */\n  size_t lgsize;\n  int *pclabels;\t\t/* PC label chains/pos ptrs. */\n  size_t pcsize;\n  void **globals;\t\t/* Array of globals (bias -10). */\n  dasm_Section *section;\t/* Pointer to active section. */\n  size_t codesize;\t\t/* Total size of all code sections. */\n  int maxsection;\t\t/* 0 <= sectionidx < maxsection. */\n  int status;\t\t\t/* Status code. */\n  dasm_Section sections[1];\t/* All sections. Alloc-extended. */\n};\n\n/* The size of the core structure depends on the max. number of sections. */\n#define DASM_PSZ(ms)\t(sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section))\n\n\n/* Initialize DynASM state. */\nvoid dasm_init(Dst_DECL, int maxsection)\n{\n  dasm_State *D;\n  size_t psz = 0;\n  int i;\n  Dst_REF = NULL;\n  DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection));\n  D = Dst_REF;\n  D->psize = psz;\n  D->lglabels = NULL;\n  D->lgsize = 0;\n  D->pclabels = NULL;\n  D->pcsize = 0;\n  D->globals = NULL;\n  D->maxsection = maxsection;\n  for (i = 0; i < maxsection; i++) {\n    D->sections[i].buf = NULL;  /* Need this for pass3. */\n    D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i);\n    D->sections[i].bsize = 0;\n    D->sections[i].epos = 0;  /* Wrong, but is recalculated after resize. */\n  }\n}\n\n/* Free DynASM state. */\nvoid dasm_free(Dst_DECL)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  for (i = 0; i < D->maxsection; i++)\n    if (D->sections[i].buf)\n      DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize);\n  if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize);\n  if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize);\n  DASM_M_FREE(Dst, D, D->psize);\n}\n\n/* Setup global label array. Must be called before dasm_setup(). */\nvoid dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl)\n{\n  dasm_State *D = Dst_REF;\n  D->globals = gl - 10;  /* Negative bias to compensate for locals. */\n  DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int));\n}\n\n/* Grow PC label array. Can be called after dasm_setup(), too. */\nvoid dasm_growpc(Dst_DECL, unsigned int maxpc)\n{\n  dasm_State *D = Dst_REF;\n  size_t osz = D->pcsize;\n  DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int));\n  memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz);\n}\n\n/* Setup encoder. */\nvoid dasm_setup(Dst_DECL, const void *actionlist)\n{\n  dasm_State *D = Dst_REF;\n  int i;\n  D->actionlist = (dasm_ActList)actionlist;\n  D->status = DASM_S_OK;\n  D->section = &D->sections[0];\n  memset((void *)D->lglabels, 0, D->lgsize);\n  if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);\n  for (i = 0; i < D->maxsection; i++) {\n    D->sections[i].pos = DASM_SEC2POS(i);\n    D->sections[i].ofs = 0;\n  }\n}\n\n\n#ifdef DASM_CHECKS\n#define CK(x, st) \\\n  do { if (!(x)) { \\\n    D->status = DASM_S_##st|(int)(p-D->actionlist-1); return; } } while (0)\n#define CKPL(kind, st) \\\n  do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \\\n    D->status=DASM_S_RANGE_##st|(int)(p-D->actionlist-1); return; } } while (0)\n#else\n#define CK(x, st)\t((void)0)\n#define CKPL(kind, st)\t((void)0)\n#endif\n\n/* Pass 1: Store actions and args, link branches/labels, estimate offsets. */\nvoid dasm_put(Dst_DECL, int start, ...)\n{\n  va_list ap;\n  dasm_State *D = Dst_REF;\n  dasm_ActList p = D->actionlist + start;\n  dasm_Section *sec = D->section;\n  int pos = sec->pos, ofs = sec->ofs, mrm = 4;\n  int *b;\n\n  if (pos >= sec->epos) {\n    DASM_M_GROW(Dst, int, sec->buf, sec->bsize,\n      sec->bsize + 2*DASM_MAXSECPOS*sizeof(int));\n    sec->rbuf = sec->buf - DASM_POS2BIAS(pos);\n    sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos);\n  }\n\n  b = sec->rbuf;\n  b[pos++] = start;\n\n  va_start(ap, start);\n  while (1) {\n    int action = *p++;\n    if (action < DASM_DISP) {\n      ofs++;\n    } else if (action <= DASM_REL_A) {\n      int n = va_arg(ap, int);\n      b[pos++] = n;\n      switch (action) {\n      case DASM_DISP:\n\tif (n == 0) { if ((mrm&7) == 4) mrm = p[-2]; if ((mrm&7) != 5) break; }\n      case DASM_IMM_DB: if (((n+128)&-256) == 0) goto ob;\n      case DASM_REL_A: /* Assumes ptrdiff_t is int. !x64 */\n      case DASM_IMM_D: ofs += 4; break;\n      case DASM_IMM_S: CK(((n+128)&-256) == 0, RANGE_I); goto ob;\n      case DASM_IMM_B: CK((n&-256) == 0, RANGE_I); ob: ofs++; break;\n      case DASM_IMM_WB: if (((n+128)&-256) == 0) goto ob;\n      case DASM_IMM_W: CK((n&-65536) == 0, RANGE_I); ofs += 2; break;\n      case DASM_SPACE: p++; ofs += n; break;\n      case DASM_SETLABEL: b[pos-2] = -0x40000000; break;  /* Neg. label ofs. */\n      case DASM_VREG: CK((n&-8) == 0 && (n != 4 || (*p&1) == 0), RANGE_VREG);\n\tif (*p++ == 1 && *p == DASM_DISP) mrm = n; continue;\n      }\n      mrm = 4;\n    } else {\n      int *pl, n;\n      switch (action) {\n      case DASM_REL_LG:\n      case DASM_IMM_LG:\n\tn = *p++; pl = D->lglabels + n;\n\tif (n <= 246) { CKPL(lg, LG); goto putrel; }  /* Bkwd rel or global. */\n\tpl -= 246; n = *pl;\n\tif (n < 0) n = 0;  /* Start new chain for fwd rel if label exists. */\n\tgoto linkrel;\n      case DASM_REL_PC:\n      case DASM_IMM_PC: pl = D->pclabels + va_arg(ap, int); CKPL(pc, PC);\n      putrel:\n\tn = *pl;\n\tif (n < 0) {  /* Label exists. Get label pos and store it. */\n\t  b[pos] = -n;\n\t} else {\n      linkrel:\n\t  b[pos] = n;  /* Else link to rel chain, anchored at label. */\n\t  *pl = pos;\n\t}\n\tpos++;\n\tofs += 4;  /* Maximum offset needed. */\n\tif (action == DASM_REL_LG || action == DASM_REL_PC)\n\t  b[pos++] = ofs;  /* Store pass1 offset estimate. */\n\tbreak;\n      case DASM_LABEL_LG: pl = D->lglabels + *p++; CKPL(lg, LG); goto putlabel;\n      case DASM_LABEL_PC: pl = D->pclabels + va_arg(ap, int); CKPL(pc, PC);\n      putlabel:\n\tn = *pl;  /* n > 0: Collapse rel chain and replace with label pos. */\n\twhile (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; }\n\t*pl = -pos;  /* Label exists now. */\n\tb[pos++] = ofs;  /* Store pass1 offset estimate. */\n\tbreak;\n      case DASM_ALIGN:\n\tofs += *p++;  /* Maximum alignment needed (arg is 2**n-1). */\n\tb[pos++] = ofs;  /* Store pass1 offset estimate. */\n\tbreak;\n      case DASM_EXTERN: p += 2; ofs += 4; break;\n      case DASM_ESC: p++; ofs++; break;\n      case DASM_MARK: mrm = p[-2]; break;\n      case DASM_SECTION:\n\tn = *p; CK(n < D->maxsection, RANGE_SEC); D->section = &D->sections[n];\n      case DASM_STOP: goto stop;\n      }\n    }\n  }\nstop:\n  va_end(ap);\n  sec->pos = pos;\n  sec->ofs = ofs;\n}\n#undef CK\n\n/* Pass 2: Link sections, shrink branches/aligns, fix label offsets. */\nint dasm_link(Dst_DECL, size_t *szp)\n{\n  dasm_State *D = Dst_REF;\n  int secnum;\n  int ofs = 0;\n\n#ifdef DASM_CHECKS\n  *szp = 0;\n  if (D->status != DASM_S_OK) return D->status;\n  {\n    int pc;\n    for (pc = 0; pc*sizeof(int) < D->pcsize; pc++)\n      if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc;\n  }\n#endif\n\n  { /* Handle globals not defined in this translation unit. */\n    int idx;\n    for (idx = 10; idx*sizeof(int) < D->lgsize; idx++) {\n      int n = D->lglabels[idx];\n      /* Undefined label: Collapse rel chain and replace with marker (< 0). */\n      while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; }\n    }\n  }\n\n  /* Combine all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->rbuf;\n    int pos = DASM_SEC2POS(secnum);\n    int lastpos = sec->pos;\n\n    while (pos != lastpos) {\n      dasm_ActList p = D->actionlist + b[pos++];\n      while (1) {\n\tint op, action = *p++;\n\tswitch (action) {\n\tcase DASM_REL_LG: p++; op = p[-3]; goto rel_pc;\n\tcase DASM_REL_PC: op = p[-2]; rel_pc: {\n\t  int shrink = op == 0xe9 ? 3 : ((op&0xf0) == 0x80 ? 4 : 0);\n\t  if (shrink) {  /* Shrinkable branch opcode? */\n\t    int lofs, lpos = b[pos];\n\t    if (lpos < 0) goto noshrink;  /* Ext global? */\n\t    lofs = *DASM_POS2PTR(D, lpos);\n\t    if (lpos > pos) {  /* Fwd label: add cumulative section offsets. */\n\t      int i;\n\t      for (i = secnum; i < DASM_POS2SEC(lpos); i++)\n\t\tlofs += D->sections[i].ofs;\n\t    } else {\n\t      lofs -= ofs;  /* Bkwd label: unfix offset. */\n\t    }\n\t    lofs -= b[pos+1];  /* Short branch ok? */\n\t    if (lofs >= -128-shrink && lofs <= 127) ofs -= shrink;  /* Yes. */\n\t    else { noshrink: shrink = 0; }  /* No, cannot shrink op. */\n\t  }\n\t  b[pos+1] = shrink;\n\t  pos += 2;\n\t  break;\n\t}\n\tcase DASM_SPACE: case DASM_IMM_LG: case DASM_VREG: p++;\n\tcase DASM_DISP: case DASM_IMM_S: case DASM_IMM_B: case DASM_IMM_W:\n\tcase DASM_IMM_D: case DASM_IMM_WB: case DASM_IMM_DB:\n\tcase DASM_SETLABEL: case DASM_REL_A: case DASM_IMM_PC: pos++; break;\n\tcase DASM_LABEL_LG: p++;\n\tcase DASM_LABEL_PC: b[pos++] += ofs; break; /* Fix label offset. */\n\tcase DASM_ALIGN: ofs -= (b[pos++]+ofs)&*p++; break; /* Adjust ofs. */\n\tcase DASM_EXTERN: p += 2; break;\n\tcase DASM_ESC: p++; break;\n\tcase DASM_MARK: break;\n\tcase DASM_SECTION: case DASM_STOP: goto stop;\n\t}\n      }\n      stop: (void)0;\n    }\n    ofs += sec->ofs;  /* Next section starts right after current section. */\n  }\n\n  D->codesize = ofs;  /* Total size of all code sections */\n  *szp = ofs;\n  return DASM_S_OK;\n}\n\n#define dasmb(x)\t*cp++ = (unsigned char)(x)\n#ifndef DASM_ALIGNED_WRITES\n#define dasmw(x) \\\n  do { *((unsigned short *)cp) = (unsigned short)(x); cp+=2; } while (0)\n#define dasmd(x) \\\n  do { *((unsigned int *)cp) = (unsigned int)(x); cp+=4; } while (0)\n#else\n#define dasmw(x)\tdo { dasmb(x); dasmb((x)>>8); } while (0)\n#define dasmd(x)\tdo { dasmw(x); dasmw((x)>>16); } while (0)\n#endif\n\n/* Pass 3: Encode sections. */\nint dasm_encode(Dst_DECL, void *buffer)\n{\n  dasm_State *D = Dst_REF;\n  unsigned char *base = (unsigned char *)buffer;\n  unsigned char *cp = base;\n  int secnum;\n\n  /* Encode all code sections. No support for data sections (yet). */\n  for (secnum = 0; secnum < D->maxsection; secnum++) {\n    dasm_Section *sec = D->sections + secnum;\n    int *b = sec->buf;\n    int *endb = sec->rbuf + sec->pos;\n\n    while (b != endb) {\n      dasm_ActList p = D->actionlist + *b++;\n      unsigned char *mark = NULL;\n      while (1) {\n\tint action = *p++;\n\tint n = (action >= DASM_DISP && action <= DASM_ALIGN) ? *b++ : 0;\n\tswitch (action) {\n\tcase DASM_DISP: if (!mark) mark = cp; {\n\t  unsigned char *mm = mark;\n\t  if (*p != DASM_IMM_DB && *p != DASM_IMM_WB) mark = NULL;\n\t  if (n == 0) { int mrm = mm[-1]&7; if (mrm == 4) mrm = mm[0]&7;\n\t    if (mrm != 5) { mm[-1] -= 0x80; break; } }\n\t  if (((n+128) & -256) != 0) goto wd; else mm[-1] -= 0x40;\n\t}\n\tcase DASM_IMM_S: case DASM_IMM_B: wb: dasmb(n); break;\n\tcase DASM_IMM_DB: if (((n+128)&-256) == 0) {\n\t    db: if (!mark) mark = cp; mark[-2] += 2; mark = NULL; goto wb;\n\t  } else mark = NULL;\n\tcase DASM_IMM_D: wd: dasmd(n); break;\n\tcase DASM_IMM_WB: if (((n+128)&-256) == 0) goto db; else mark = NULL;\n\tcase DASM_IMM_W: dasmw(n); break;\n\tcase DASM_VREG: { int t = *p++; if (t >= 2) n<<=3; cp[-1] |= n; break; }\n\tcase DASM_REL_LG: p++; if (n >= 0) goto rel_pc;\n\t  b++; n = (int)(ptrdiff_t)D->globals[-n];\n\tcase DASM_REL_A: rel_a: n -= (int)(ptrdiff_t)(cp+4); goto wd; /* !x64 */\n\tcase DASM_REL_PC: rel_pc: {\n\t  int shrink = *b++;\n\t  int *pb = DASM_POS2PTR(D, n); if (*pb < 0) { n = pb[1]; goto rel_a; }\n\t  n = *pb - ((int)(cp-base) + 4-shrink);\n\t  if (shrink == 0) goto wd;\n\t  if (shrink == 4) { cp--; cp[-1] = *cp-0x10; } else cp[-1] = 0xeb;\n\t  goto wb;\n\t}\n\tcase DASM_IMM_LG:\n\t  p++; if (n < 0) { n = (int)(ptrdiff_t)D->globals[-n]; goto wd; }\n\tcase DASM_IMM_PC: {\n\t  int *pb = DASM_POS2PTR(D, n);\n\t  n = *pb < 0 ? pb[1] : (*pb + (int)(ptrdiff_t)base);\n\t  goto wd;\n\t}\n\tcase DASM_LABEL_LG: {\n\t  int idx = *p++;\n\t  if (idx >= 10)\n\t    D->globals[idx] = (void *)(base + (*p == DASM_SETLABEL ? *b : n));\n\t  break;\n\t}\n\tcase DASM_LABEL_PC: case DASM_SETLABEL: break;\n\tcase DASM_SPACE: { int fill = *p++; while (n--) *cp++ = fill; break; }\n\tcase DASM_ALIGN:\n\t  n = *p++;\n\t  while (((cp-base) & n)) *cp++ = 0x90; /* nop */\n\t  break;\n\tcase DASM_EXTERN: n = DASM_EXTERN(Dst, cp, p[1], *p); p += 2; goto wd;\n\tcase DASM_MARK: mark = cp; break;\n\tcase DASM_ESC: action = *p++;\n\tdefault: *cp++ = action; break;\n\tcase DASM_SECTION: case DASM_STOP: goto stop;\n\t}\n      }\n      stop: (void)0;\n    }\n  }\n\n  if (base + D->codesize != cp)  /* Check for phase errors. */\n    return DASM_S_PHASE;\n  return DASM_S_OK;\n}\n\n/* Get PC label offset. */\nint dasm_getpclabel(Dst_DECL, unsigned int pc)\n{\n  dasm_State *D = Dst_REF;\n  if (pc*sizeof(int) < D->pcsize) {\n    int pos = D->pclabels[pc];\n    if (pos < 0) return *DASM_POS2PTR(D, -pos);\n    if (pos > 0) return -1;  /* Undefined. */\n  }\n  return -2;  /* Unused or out of range. */\n}\n\n#ifdef DASM_CHECKS\n/* Optional sanity checker to call between isolated encoding steps. */\nint dasm_checkstep(Dst_DECL, int secmatch)\n{\n  dasm_State *D = Dst_REF;\n  if (D->status == DASM_S_OK) {\n    int i;\n    for (i = 1; i <= 9; i++) {\n      if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_L|i; break; }\n      D->lglabels[i] = 0;\n    }\n  }\n  if (D->status == DASM_S_OK && secmatch >= 0 &&\n      D->section != &D->sections[secmatch])\n    D->status = DASM_S_MATCH_SEC|(int)(D->section-D->sections);\n  return D->status;\n}\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dasm_x86.lua",
    "content": "------------------------------------------------------------------------------\n-- DynASM x86/x64 module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- See dynasm.lua for full copyright notice.\n------------------------------------------------------------------------------\n\nlocal x64 = x64\n\n-- Module information:\nlocal _info = {\n  arch =\tx64 and \"x64\" or \"x86\",\n  description =\t\"DynASM x86/x64 module\",\n  version =\t\"1.3.0\",\n  vernum =\t 10300,\n  release =\t\"2011-05-05\",\n  author =\t\"Mike Pall\",\n  license =\t\"MIT\",\n}\n\n-- Exported glue functions for the arch-specific module.\nlocal _M = { _info = _info }\n\n-- Cache library functions.\nlocal type, tonumber, pairs, ipairs = type, tonumber, pairs, ipairs\nlocal assert, unpack, setmetatable = assert, unpack or table.unpack, setmetatable\nlocal _s = string\nlocal sub, format, byte, char = _s.sub, _s.format, _s.byte, _s.char\nlocal find, match, gmatch, gsub = _s.find, _s.match, _s.gmatch, _s.gsub\nlocal concat, sort = table.concat, table.sort\nlocal bit = bit or require(\"bit\")\nlocal band, shl, shr = bit.band, bit.lshift, bit.rshift\n\n-- Inherited tables and callbacks.\nlocal g_opt, g_arch\nlocal wline, werror, wfatal, wwarn\n\n-- Action name list.\n-- CHECK: Keep this in sync with the C code!\nlocal action_names = {\n  -- int arg, 1 buffer pos:\n  \"DISP\",  \"IMM_S\", \"IMM_B\", \"IMM_W\", \"IMM_D\",  \"IMM_WB\", \"IMM_DB\",\n  -- action arg (1 byte), int arg, 1 buffer pos (reg/num):\n  \"VREG\", \"SPACE\", -- !x64: VREG support NYI.\n  -- ptrdiff_t arg, 1 buffer pos (address): !x64\n  \"SETLABEL\", \"REL_A\",\n  -- action arg (1 byte) or int arg, 2 buffer pos (link, offset):\n  \"REL_LG\", \"REL_PC\",\n  -- action arg (1 byte) or int arg, 1 buffer pos (link):\n  \"IMM_LG\", \"IMM_PC\",\n  -- action arg (1 byte) or int arg, 1 buffer pos (offset):\n  \"LABEL_LG\", \"LABEL_PC\",\n  -- action arg (1 byte), 1 buffer pos (offset):\n  \"ALIGN\",\n  -- action args (2 bytes), no buffer pos.\n  \"EXTERN\",\n  -- action arg (1 byte), no buffer pos.\n  \"ESC\",\n  -- no action arg, no buffer pos.\n  \"MARK\",\n  -- action arg (1 byte), no buffer pos, terminal action:\n  \"SECTION\",\n  -- no args, no buffer pos, terminal action:\n  \"STOP\"\n}\n\n-- Maximum number of section buffer positions for dasm_put().\n-- CHECK: Keep this in sync with the C code!\nlocal maxsecpos = 25 -- Keep this low, to avoid excessively long C lines.\n\n-- Action name -> action number (dynamically generated below).\nlocal map_action = {}\n-- First action number. Everything below does not need to be escaped.\nlocal actfirst = 256-#action_names\n\n-- Action list buffer and string (only used to remove dupes).\nlocal actlist = {}\nlocal actstr = \"\"\n\n-- Argument list for next dasm_put(). Start with offset 0 into action list.\nlocal actargs = { 0 }\n\n-- Current number of section buffer positions for dasm_put().\nlocal secpos = 1\n\n------------------------------------------------------------------------------\n\n-- Compute action numbers for action names.\nfor n,name in ipairs(action_names) do\n  local num = actfirst + n - 1\n  map_action[name] = num\nend\n\n-- Dump action names and numbers.\nlocal function dumpactions(out)\n  out:write(\"DynASM encoding engine action codes:\\n\")\n  for n,name in ipairs(action_names) do\n    local num = map_action[name]\n    out:write(format(\"  %-10s %02X  %d\\n\", name, num, num))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write action list buffer as a huge static C array.\nlocal function writeactions(out, name)\n  local nn = #actlist\n  local last = actlist[nn] or 255\n  actlist[nn] = nil -- Remove last byte.\n  if nn == 0 then nn = 1 end\n  out:write(\"static const unsigned char \", name, \"[\", nn, \"] = {\\n\")\n  local s = \"  \"\n  for n,b in ipairs(actlist) do\n    s = s..b..\",\"\n    if #s >= 75 then\n      assert(out:write(s, \"\\n\"))\n      s = \"  \"\n    end\n  end\n  out:write(s, last, \"\\n};\\n\\n\") -- Add last byte back.\nend\n\n------------------------------------------------------------------------------\n\n-- Add byte to action list.\nlocal function wputxb(n)\n  assert(n >= 0 and n <= 255 and n % 1 == 0, \"byte out of range\")\n  actlist[#actlist+1] = n\nend\n\n-- Add action to list with optional arg. Advance buffer pos, too.\nlocal function waction(action, a, num)\n  wputxb(assert(map_action[action], \"bad action name `\"..action..\"'\"))\n  if a then actargs[#actargs+1] = a end\n  if a or num then secpos = secpos + (num or 1) end\nend\n\n-- Add call to embedded DynASM C code.\nlocal function wcall(func, args)\n  wline(format(\"dasm_%s(Dst, %s);\", func, concat(args, \", \")), true)\nend\n\n-- Delete duplicate action list chunks. A tad slow, but so what.\nlocal function dedupechunk(offset)\n  local al, as = actlist, actstr\n  local chunk = char(unpack(al, offset+1, #al))\n  local orig = find(as, chunk, 1, true)\n  if orig then\n    actargs[1] = orig-1 -- Replace with original offset.\n    for i=offset+1,#al do al[i] = nil end -- Kill dupe.\n  else\n    actstr = as..chunk\n  end\nend\n\n-- Flush action list (intervening C code or buffer pos overflow).\nlocal function wflush(term)\n  local offset = actargs[1]\n  if #actlist == offset then return end -- Nothing to flush.\n  if not term then waction(\"STOP\") end -- Terminate action list.\n  dedupechunk(offset)\n  wcall(\"put\", actargs) -- Add call to dasm_put().\n  actargs = { #actlist } -- Actionlist offset is 1st arg to next dasm_put().\n  secpos = 1 -- The actionlist offset occupies a buffer position, too.\nend\n\n-- Put escaped byte.\nlocal function wputb(n)\n  if n >= actfirst then waction(\"ESC\") end -- Need to escape byte.\n  wputxb(n)\nend\n\n------------------------------------------------------------------------------\n\n-- Global label name -> global label number. With auto assignment on 1st use.\nlocal next_global = 10\nlocal map_global = setmetatable({}, { __index = function(t, name)\n  if not match(name, \"^[%a_][%w_@]*$\") then werror(\"bad global label\") end\n  local n = next_global\n  if n > 246 then werror(\"too many global labels\") end\n  next_global = n + 1\n  t[name] = n\n  return n\nend})\n\n-- Dump global labels.\nlocal function dumpglobals(out, lvl)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"Global labels:\\n\")\n  for i=10,next_global-1 do\n    out:write(format(\"  %s\\n\", t[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write global label enum.\nlocal function writeglobals(out, prefix)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"enum {\\n\")\n  for i=10,next_global-1 do\n    out:write(\"  \", prefix, gsub(t[i], \"@.*\", \"\"), \",\\n\")\n  end\n  out:write(\"  \", prefix, \"_MAX\\n};\\n\")\nend\n\n-- Write global label names.\nlocal function writeglobalnames(out, name)\n  local t = {}\n  for name, n in pairs(map_global) do t[n] = name end\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=10,next_global-1 do\n    out:write(\"  \\\"\", t[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Extern label name -> extern label number. With auto assignment on 1st use.\nlocal next_extern = -1\nlocal map_extern = setmetatable({}, { __index = function(t, name)\n  -- No restrictions on the name for now.\n  local n = next_extern\n  if n < -256 then werror(\"too many extern labels\") end\n  next_extern = n - 1\n  t[name] = n\n  return n\nend})\n\n-- Dump extern labels.\nlocal function dumpexterns(out, lvl)\n  local t = {}\n  for name, n in pairs(map_extern) do t[-n] = name end\n  out:write(\"Extern labels:\\n\")\n  for i=1,-next_extern-1 do\n    out:write(format(\"  %s\\n\", t[i]))\n  end\n  out:write(\"\\n\")\nend\n\n-- Write extern label names.\nlocal function writeexternnames(out, name)\n  local t = {}\n  for name, n in pairs(map_extern) do t[-n] = name end\n  out:write(\"static const char *const \", name, \"[] = {\\n\")\n  for i=1,-next_extern-1 do\n    out:write(\"  \\\"\", t[i], \"\\\",\\n\")\n  end\n  out:write(\"  (const char *)0\\n};\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Arch-specific maps.\nlocal map_archdef = {}\t\t-- Ext. register name -> int. name.\nlocal map_reg_rev = {}\t\t-- Int. register name -> ext. name.\nlocal map_reg_num = {}\t\t-- Int. register name -> register number.\nlocal map_reg_opsize = {}\t-- Int. register name -> operand size.\nlocal map_reg_valid_base = {}\t-- Int. register name -> valid base register?\nlocal map_reg_valid_index = {}\t-- Int. register name -> valid index register?\nlocal map_reg_needrex = {}\t-- Int. register name -> need rex vs. no rex.\nlocal reg_list = {}\t\t-- Canonical list of int. register names.\n\nlocal map_type = {}\t\t-- Type name -> { ctype, reg }\nlocal ctypenum = 0\t\t-- Type number (for _PTx macros).\n\nlocal addrsize = x64 and \"q\" or \"d\"\t-- Size for address operands.\n\n-- Helper functions to fill register maps.\nlocal function mkrmap(sz, cl, names)\n  local cname = format(\"@%s\", sz)\n  reg_list[#reg_list+1] = cname\n  map_archdef[cl] = cname\n  map_reg_rev[cname] = cl\n  map_reg_num[cname] = -1\n  map_reg_opsize[cname] = sz\n  if sz == addrsize or sz == \"d\" then\n    map_reg_valid_base[cname] = true\n    map_reg_valid_index[cname] = true\n  end\n  if names then\n    for n,name in ipairs(names) do\n      local iname = format(\"@%s%x\", sz, n-1)\n      reg_list[#reg_list+1] = iname\n      map_archdef[name] = iname\n      map_reg_rev[iname] = name\n      map_reg_num[iname] = n-1\n      map_reg_opsize[iname] = sz\n      if sz == \"b\" and n > 4 then map_reg_needrex[iname] = false end\n      if sz == addrsize or sz == \"d\" then\n\tmap_reg_valid_base[iname] = true\n\tmap_reg_valid_index[iname] = true\n      end\n    end\n  end\n  for i=0,(x64 and sz ~= \"f\") and 15 or 7 do\n    local needrex = sz == \"b\" and i > 3\n    local iname = format(\"@%s%x%s\", sz, i, needrex and \"R\" or \"\")\n    if needrex then map_reg_needrex[iname] = true end\n    local name\n    if sz == \"o\" then name = format(\"xmm%d\", i)\n    elseif sz == \"f\" then name = format(\"st%d\", i)\n    else name = format(\"r%d%s\", i, sz == addrsize and \"\" or sz) end\n    map_archdef[name] = iname\n    if not map_reg_rev[iname] then\n      reg_list[#reg_list+1] = iname\n      map_reg_rev[iname] = name\n      map_reg_num[iname] = i\n      map_reg_opsize[iname] = sz\n      if sz == addrsize or sz == \"d\" then\n\tmap_reg_valid_base[iname] = true\n\tmap_reg_valid_index[iname] = true\n      end\n    end\n  end\n  reg_list[#reg_list+1] = \"\"\nend\n\n-- Integer registers (qword, dword, word and byte sized).\nif x64 then\n  mkrmap(\"q\", \"Rq\", {\"rax\", \"rcx\", \"rdx\", \"rbx\", \"rsp\", \"rbp\", \"rsi\", \"rdi\"})\nend\nmkrmap(\"d\", \"Rd\", {\"eax\", \"ecx\", \"edx\", \"ebx\", \"esp\", \"ebp\", \"esi\", \"edi\"})\nmkrmap(\"w\", \"Rw\", {\"ax\", \"cx\", \"dx\", \"bx\", \"sp\", \"bp\", \"si\", \"di\"})\nmkrmap(\"b\", \"Rb\", {\"al\", \"cl\", \"dl\", \"bl\", \"ah\", \"ch\", \"dh\", \"bh\"})\nmap_reg_valid_index[map_archdef.esp] = false\nif x64 then map_reg_valid_index[map_archdef.rsp] = false end\nmap_archdef[\"Ra\"] = \"@\"..addrsize\n\n-- FP registers (internally tword sized, but use \"f\" as operand size).\nmkrmap(\"f\", \"Rf\")\n\n-- SSE registers (oword sized, but qword and dword accessible).\nmkrmap(\"o\", \"xmm\")\n\n-- Operand size prefixes to codes.\nlocal map_opsize = {\n  byte = \"b\", word = \"w\", dword = \"d\", qword = \"q\", oword = \"o\", tword = \"t\",\n  aword = addrsize,\n}\n\n-- Operand size code to number.\nlocal map_opsizenum = {\n  b = 1, w = 2, d = 4, q = 8, o = 16, t = 10,\n}\n\n-- Operand size code to name.\nlocal map_opsizename = {\n  b = \"byte\", w = \"word\", d = \"dword\", q = \"qword\", o = \"oword\", t = \"tword\",\n  f = \"fpword\",\n}\n\n-- Valid index register scale factors.\nlocal map_xsc = {\n  [\"1\"] = 0, [\"2\"] = 1, [\"4\"] = 2, [\"8\"] = 3,\n}\n\n-- Condition codes.\nlocal map_cc = {\n  o = 0, no = 1, b = 2, nb = 3, e = 4, ne = 5, be = 6, nbe = 7,\n  s = 8, ns = 9, p = 10, np = 11, l = 12, nl = 13, le = 14, nle = 15,\n  c = 2, nae = 2, nc = 3, ae = 3, z = 4, nz = 5, na = 6, a = 7,\n  pe = 10, po = 11, nge = 12, ge = 13, ng = 14, g = 15,\n}\n\n\n-- Reverse defines for registers.\nfunction _M.revdef(s)\n  return gsub(s, \"@%w+\", map_reg_rev)\nend\n\n-- Dump register names and numbers\nlocal function dumpregs(out)\n  out:write(\"Register names, sizes and internal numbers:\\n\")\n  for _,reg in ipairs(reg_list) do\n    if reg == \"\" then\n      out:write(\"\\n\")\n    else\n      local name = map_reg_rev[reg]\n      local num = map_reg_num[reg]\n      local opsize = map_opsizename[map_reg_opsize[reg]]\n      out:write(format(\"  %-5s %-8s %s\\n\", name, opsize,\n\t\t       num < 0 and \"(variable)\" or num))\n    end\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Put action for label arg (IMM_LG, IMM_PC, REL_LG, REL_PC).\nlocal function wputlabel(aprefix, imm, num)\n  if type(imm) == \"number\" then\n    if imm < 0 then\n      waction(\"EXTERN\")\n      wputxb(aprefix == \"IMM_\" and 0 or 1)\n      imm = -imm-1\n    else\n      waction(aprefix..\"LG\", nil, num);\n    end\n    wputxb(imm)\n  else\n    waction(aprefix..\"PC\", imm, num)\n  end\nend\n\n-- Put signed byte or arg.\nlocal function wputsbarg(n)\n  if type(n) == \"number\" then\n    if n < -128 or n > 127 then\n      werror(\"signed immediate byte out of range\")\n    end\n    if n < 0 then n = n + 256 end\n    wputb(n)\n  else waction(\"IMM_S\", n) end\nend\n\n-- Put unsigned byte or arg.\nlocal function wputbarg(n)\n  if type(n) == \"number\" then\n    if n < 0 or n > 255 then\n      werror(\"unsigned immediate byte out of range\")\n    end\n    wputb(n)\n  else waction(\"IMM_B\", n) end\nend\n\n-- Put unsigned word or arg.\nlocal function wputwarg(n)\n  if type(n) == \"number\" then\n    if shr(n, 16) ~= 0 then\n      werror(\"unsigned immediate word out of range\")\n    end\n    wputb(band(n, 255)); wputb(shr(n, 8));\n  else waction(\"IMM_W\", n) end\nend\n\n-- Put signed or unsigned dword or arg.\nlocal function wputdarg(n)\n  local tn = type(n)\n  if tn == \"number\" then\n    wputb(band(n, 255))\n    wputb(band(shr(n, 8), 255))\n    wputb(band(shr(n, 16), 255))\n    wputb(shr(n, 24))\n  elseif tn == \"table\" then\n    wputlabel(\"IMM_\", n[1], 1)\n  else\n    waction(\"IMM_D\", n)\n  end\nend\n\n-- Put operand-size dependent number or arg (defaults to dword).\nlocal function wputszarg(sz, n)\n  if not sz or sz == \"d\" or sz == \"q\" then wputdarg(n)\n  elseif sz == \"w\" then wputwarg(n)\n  elseif sz == \"b\" then wputbarg(n)\n  elseif sz == \"s\" then wputsbarg(n)\n  else werror(\"bad operand size\") end\nend\n\n-- Put multi-byte opcode with operand-size dependent modifications.\nlocal function wputop(sz, op, rex)\n  local r\n  if rex ~= 0 and not x64 then werror(\"bad operand size\") end\n  if sz == \"w\" then wputb(102) end\n  -- Needs >32 bit numbers, but only for crc32 eax, word [ebx]\n  if op >= 4294967296 then r = op%4294967296 wputb((op-r)/4294967296) op = r end\n  if op >= 16777216 then wputb(shr(op, 24)); op = band(op, 0xffffff) end\n  if op >= 65536 then\n    if rex ~= 0 then\n      local opc3 = band(op, 0xffff00)\n      if opc3 == 0x0f3a00 or opc3 == 0x0f3800 then\n\twputb(64 + band(rex, 15)); rex = 0\n      end\n    end\n    wputb(shr(op, 16)); op = band(op, 0xffff)\n  end\n  if op >= 256 then\n    local b = shr(op, 8)\n    if b == 15 and rex ~= 0 then wputb(64 + band(rex, 15)); rex = 0 end\n    wputb(b)\n    op = band(op, 255)\n  end\n  if rex ~= 0 then wputb(64 + band(rex, 15)) end\n  if sz == \"b\" then op = op - 1 end\n  wputb(op)\nend\n\n-- Put ModRM or SIB formatted byte.\nlocal function wputmodrm(m, s, rm, vs, vrm)\n  assert(m < 4 and s < 16 and rm < 16, \"bad modrm operands\")\n  wputb(shl(m, 6) + shl(band(s, 7), 3) + band(rm, 7))\nend\n\n-- Put ModRM/SIB plus optional displacement.\nlocal function wputmrmsib(t, imark, s, vsreg)\n  local vreg, vxreg\n  local reg, xreg = t.reg, t.xreg\n  if reg and reg < 0 then reg = 0; vreg = t.vreg end\n  if xreg and xreg < 0 then xreg = 0; vxreg = t.vxreg end\n  if s < 0 then s = 0 end\n\n  -- Register mode.\n  if sub(t.mode, 1, 1) == \"r\" then\n    wputmodrm(3, s, reg)\n    if vsreg then waction(\"VREG\", vsreg); wputxb(2) end\n    if vreg then waction(\"VREG\", vreg); wputxb(0) end\n    return\n  end\n\n  local disp = t.disp\n  local tdisp = type(disp)\n  -- No base register?\n  if not reg then\n    local riprel = false\n    if xreg then\n      -- Indexed mode with index register only.\n      -- [xreg*xsc+disp] -> (0, s, esp) (xsc, xreg, ebp)\n      wputmodrm(0, s, 4)\n      if imark == \"I\" then waction(\"MARK\") end\n      if vsreg then waction(\"VREG\", vsreg); wputxb(2) end\n      wputmodrm(t.xsc, xreg, 5)\n      if vxreg then waction(\"VREG\", vxreg); wputxb(3) end\n    else\n      -- Pure 32 bit displacement.\n      if x64 and tdisp ~= \"table\" then\n\twputmodrm(0, s, 4) -- [disp] -> (0, s, esp) (0, esp, ebp)\n\tif imark == \"I\" then waction(\"MARK\") end\n\twputmodrm(0, 4, 5)\n      else\n\triprel = x64\n\twputmodrm(0, s, 5) -- [disp|rip-label] -> (0, s, ebp)\n\tif imark == \"I\" then waction(\"MARK\") end\n      end\n      if vsreg then waction(\"VREG\", vsreg); wputxb(2) end\n    end\n    if riprel then -- Emit rip-relative displacement.\n      if match(\"UWSiI\", imark) then\n\twerror(\"NYI: rip-relative displacement followed by immediate\")\n      end\n      -- The previous byte in the action buffer cannot be 0xe9 or 0x80-0x8f.\n      wputlabel(\"REL_\", disp[1], 2)\n    else\n      wputdarg(disp)\n    end\n    return\n  end\n\n  local m\n  if tdisp == \"number\" then -- Check displacement size at assembly time.\n    if disp == 0 and band(reg, 7) ~= 5 then -- [ebp] -> [ebp+0] (in SIB, too)\n      if not vreg then m = 0 end -- Force DISP to allow [Rd(5)] -> [ebp+0]\n    elseif disp >= -128 and disp <= 127 then m = 1\n    else m = 2 end\n  elseif tdisp == \"table\" then\n    m = 2\n  end\n\n  -- Index register present or esp as base register: need SIB encoding.\n  if xreg or band(reg, 7) == 4 then\n    wputmodrm(m or 2, s, 4) -- ModRM.\n    if m == nil or imark == \"I\" then waction(\"MARK\") end\n    if vsreg then waction(\"VREG\", vsreg); wputxb(2) end\n    wputmodrm(t.xsc or 0, xreg or 4, reg) -- SIB.\n    if vxreg then waction(\"VREG\", vxreg); wputxb(3) end\n    if vreg then waction(\"VREG\", vreg); wputxb(1) end\n  else\n    wputmodrm(m or 2, s, reg) -- ModRM.\n    if (imark == \"I\" and (m == 1 or m == 2)) or\n       (m == nil and (vsreg or vreg)) then waction(\"MARK\") end\n    if vsreg then waction(\"VREG\", vsreg); wputxb(2) end\n    if vreg then waction(\"VREG\", vreg); wputxb(1) end\n  end\n\n  -- Put displacement.\n  if m == 1 then wputsbarg(disp)\n  elseif m == 2 then wputdarg(disp)\n  elseif m == nil then waction(\"DISP\", disp) end\nend\n\n------------------------------------------------------------------------------\n\n-- Return human-readable operand mode string.\nlocal function opmodestr(op, args)\n  local m = {}\n  for i=1,#args do\n    local a = args[i]\n    m[#m+1] = sub(a.mode, 1, 1)..(a.opsize or \"?\")\n  end\n  return op..\" \"..concat(m, \",\")\nend\n\n-- Convert number to valid integer or nil.\nlocal function toint(expr)\n  local n = tonumber(expr)\n  if n then\n    if n % 1 ~= 0 or n < -2147483648 or n > 4294967295 then\n      werror(\"bad integer number `\"..expr..\"'\")\n    end\n    return n\n  end\nend\n\n-- Parse immediate expression.\nlocal function immexpr(expr)\n  -- &expr (pointer)\n  if sub(expr, 1, 1) == \"&\" then\n    return \"iPJ\", format(\"(ptrdiff_t)(%s)\", sub(expr,2))\n  end\n\n  local prefix = sub(expr, 1, 2)\n  -- =>expr (pc label reference)\n  if prefix == \"=>\" then\n    return \"iJ\", sub(expr, 3)\n  end\n  -- ->name (global label reference)\n  if prefix == \"->\" then\n    return \"iJ\", map_global[sub(expr, 3)]\n  end\n\n  -- [<>][1-9] (local label reference)\n  local dir, lnum = match(expr, \"^([<>])([1-9])$\")\n  if dir then -- Fwd: 247-255, Bkwd: 1-9.\n    return \"iJ\", lnum + (dir == \">\" and 246 or 0)\n  end\n\n  local extname = match(expr, \"^extern%s+(%S+)$\")\n  if extname then\n    return \"iJ\", map_extern[extname]\n  end\n\n  -- expr (interpreted as immediate)\n  return \"iI\", expr\nend\n\n-- Parse displacement expression: +-num, +-expr, +-opsize*num\nlocal function dispexpr(expr)\n  local disp = expr == \"\" and 0 or toint(expr)\n  if disp then return disp end\n  local c, dispt = match(expr, \"^([+-])%s*(.+)$\")\n  if c == \"+\" then\n    expr = dispt\n  elseif not c then\n    werror(\"bad displacement expression `\"..expr..\"'\")\n  end\n  local opsize, tailops = match(dispt, \"^(%w+)%s*%*%s*(.+)$\")\n  local ops, imm = map_opsize[opsize], toint(tailops)\n  if ops and imm then\n    if c == \"-\" then imm = -imm end\n    return imm*map_opsizenum[ops]\n  end\n  local mode, iexpr = immexpr(dispt)\n  if mode == \"iJ\" then\n    if c == \"-\" then werror(\"cannot invert label reference\") end\n    return { iexpr }\n  end\n  return expr -- Need to return original signed expression.\nend\n\n-- Parse register or type expression.\nlocal function rtexpr(expr)\n  if not expr then return end\n  local tname, ovreg = match(expr, \"^([%w_]+):(@[%w_]+)$\")\n  local tp = map_type[tname or expr]\n  if tp then\n    local reg = ovreg or tp.reg\n    local rnum = map_reg_num[reg]\n    if not rnum then\n      werror(\"type `\"..(tname or expr)..\"' needs a register override\")\n    end\n    if not map_reg_valid_base[reg] then\n      werror(\"bad base register override `\"..(map_reg_rev[reg] or reg)..\"'\")\n    end\n    return reg, rnum, tp\n  end\n  return expr, map_reg_num[expr]\nend\n\n-- Parse operand and return { mode, opsize, reg, xreg, xsc, disp, imm }.\nlocal function parseoperand(param)\n  local t = {}\n\n  local expr = param\n  local opsize, tailops = match(param, \"^(%w+)%s*(.+)$\")\n  if opsize then\n    t.opsize = map_opsize[opsize]\n    if t.opsize then expr = tailops end\n  end\n\n  local br = match(expr, \"^%[%s*(.-)%s*%]$\")\n  repeat\n    if br then\n      t.mode = \"xm\"\n\n      -- [disp]\n      t.disp = toint(br)\n      if t.disp then\n\tt.mode = x64 and \"xm\" or \"xmO\"\n\tbreak\n      end\n\n      -- [reg...]\n      local tp\n      local reg, tailr = match(br, \"^([@%w_:]+)%s*(.*)$\")\n      reg, t.reg, tp = rtexpr(reg)\n      if not t.reg then\n\t-- [expr]\n\tt.mode = x64 and \"xm\" or \"xmO\"\n\tt.disp = dispexpr(\"+\"..br)\n\tbreak\n      end\n\n      if t.reg == -1 then\n\tt.vreg, tailr = match(tailr, \"^(%b())(.*)$\")\n\tif not t.vreg then werror(\"bad variable register expression\") end\n      end\n\n      -- [xreg*xsc] or [xreg*xsc+-disp] or [xreg*xsc+-expr]\n      local xsc, tailsc = match(tailr, \"^%*%s*([1248])%s*(.*)$\")\n      if xsc then\n\tif not map_reg_valid_index[reg] then\n\t  werror(\"bad index register `\"..map_reg_rev[reg]..\"'\")\n\tend\n\tt.xsc = map_xsc[xsc]\n\tt.xreg = t.reg\n\tt.vxreg = t.vreg\n\tt.reg = nil\n\tt.vreg = nil\n\tt.disp = dispexpr(tailsc)\n\tbreak\n      end\n      if not map_reg_valid_base[reg] then\n\twerror(\"bad base register `\"..map_reg_rev[reg]..\"'\")\n      end\n\n      -- [reg] or [reg+-disp]\n      t.disp = toint(tailr) or (tailr == \"\" and 0)\n      if t.disp then break end\n\n      -- [reg+xreg...]\n      local xreg, tailx = match(tailr, \"^+%s*([@%w_:]+)%s*(.*)$\")\n      xreg, t.xreg, tp = rtexpr(xreg)\n      if not t.xreg then\n\t-- [reg+-expr]\n\tt.disp = dispexpr(tailr)\n\tbreak\n      end\n      if not map_reg_valid_index[xreg] then\n\twerror(\"bad index register `\"..map_reg_rev[xreg]..\"'\")\n      end\n\n      if t.xreg == -1 then\n\tt.vxreg, tailx = match(tailx, \"^(%b())(.*)$\")\n\tif not t.vxreg then werror(\"bad variable register expression\") end\n      end\n\n      -- [reg+xreg*xsc...]\n      local xsc, tailsc = match(tailx, \"^%*%s*([1248])%s*(.*)$\")\n      if xsc then\n\tt.xsc = map_xsc[xsc]\n\ttailx = tailsc\n      end\n\n      -- [...] or [...+-disp] or [...+-expr]\n      t.disp = dispexpr(tailx)\n    else\n      -- imm or opsize*imm\n      local imm = toint(expr)\n      if not imm and sub(expr, 1, 1) == \"*\" and t.opsize then\n\timm = toint(sub(expr, 2))\n\tif imm then\n\t  imm = imm * map_opsizenum[t.opsize]\n\t  t.opsize = nil\n\tend\n      end\n      if imm then\n\tif t.opsize then werror(\"bad operand size override\") end\n\tlocal m = \"i\"\n\tif imm == 1 then m = m..\"1\" end\n\tif imm >= 4294967168 and imm <= 4294967295 then imm = imm-4294967296 end\n\tif imm >= -128 and imm <= 127 then m = m..\"S\" end\n\tt.imm = imm\n\tt.mode = m\n\tbreak\n      end\n\n      local tp\n      local reg, tailr = match(expr, \"^([@%w_:]+)%s*(.*)$\")\n      reg, t.reg, tp = rtexpr(reg)\n      if t.reg then\n\tif t.reg == -1 then\n\t  t.vreg, tailr = match(tailr, \"^(%b())(.*)$\")\n\t  if not t.vreg then werror(\"bad variable register expression\") end\n\tend\n\t-- reg\n\tif tailr == \"\" then\n\t  if t.opsize then werror(\"bad operand size override\") end\n\t  t.opsize = map_reg_opsize[reg]\n\t  if t.opsize == \"f\" then\n\t    t.mode = t.reg == 0 and \"fF\" or \"f\"\n\t  else\n\t    if reg == \"@w4\" or (x64 and reg == \"@d4\") then\n\t      wwarn(\"bad idea, try again with `\"..(x64 and \"rsp'\" or \"esp'\"))\n\t    end\n\t    t.mode = t.reg == 0 and \"rmR\" or (reg == \"@b1\" and \"rmC\" or \"rm\")\n\t  end\n\t  t.needrex = map_reg_needrex[reg]\n\t  break\n\tend\n\n\t-- type[idx], type[idx].field, type->field -> [reg+offset_expr]\n\tif not tp then werror(\"bad operand `\"..param..\"'\") end\n\tt.mode = \"xm\"\n\tt.disp = format(tp.ctypefmt, tailr)\n      else\n\tt.mode, t.imm = immexpr(expr)\n\tif sub(t.mode, -1) == \"J\" then\n\t  if t.opsize and t.opsize ~= addrsize then\n\t    werror(\"bad operand size override\")\n\t  end\n\t  t.opsize = addrsize\n\tend\n      end\n    end\n  until true\n  return t\nend\n\n------------------------------------------------------------------------------\n-- x86 Template String Description\n-- ===============================\n--\n-- Each template string is a list of [match:]pattern pairs,\n-- separated by \"|\". The first match wins. No match means a\n-- bad or unsupported combination of operand modes or sizes.\n--\n-- The match part and the \":\" is omitted if the operation has\n-- no operands. Otherwise the first N characters are matched\n-- against the mode strings of each of the N operands.\n--\n-- The mode string for each operand type is (see parseoperand()):\n--   Integer register: \"rm\", +\"R\" for eax, ax, al, +\"C\" for cl\n--   FP register:      \"f\",  +\"F\" for st0\n--   Index operand:    \"xm\", +\"O\" for [disp] (pure offset)\n--   Immediate:        \"i\",  +\"S\" for signed 8 bit, +\"1\" for 1,\n--                     +\"I\" for arg, +\"P\" for pointer\n--   Any:              +\"J\" for valid jump targets\n--\n-- So a match character \"m\" (mixed) matches both an integer register\n-- and an index operand (to be encoded with the ModRM/SIB scheme).\n-- But \"r\" matches only a register and \"x\" only an index operand\n-- (e.g. for FP memory access operations).\n--\n-- The operand size match string starts right after the mode match\n-- characters and ends before the \":\". \"dwb\" or \"qdwb\" is assumed, if empty.\n-- The effective data size of the operation is matched against this list.\n--\n-- If only the regular \"b\", \"w\", \"d\", \"q\", \"t\" operand sizes are\n-- present, then all operands must be the same size. Unspecified sizes\n-- are ignored, but at least one operand must have a size or the pattern\n-- won't match (use the \"byte\", \"word\", \"dword\", \"qword\", \"tword\"\n-- operand size overrides. E.g.: mov dword [eax], 1).\n--\n-- If the list has a \"1\" or \"2\" prefix, the operand size is taken\n-- from the respective operand and any other operand sizes are ignored.\n-- If the list contains only \".\", all operand sizes are ignored.\n-- If the list has a \"/\" prefix, the concatenated (mixed) operand sizes\n-- are compared to the match.\n--\n-- E.g. \"rrdw\" matches for either two dword registers or two word\n-- registers. \"Fx2dq\" matches an st0 operand plus an index operand\n-- pointing to a dword (float) or qword (double).\n--\n-- Every character after the \":\" is part of the pattern string:\n--   Hex chars are accumulated to form the opcode (left to right).\n--   \"n\"       disables the standard opcode mods\n--             (otherwise: -1 for \"b\", o16 prefix for \"w\", rex.w for \"q\")\n--   \"X\"       Force REX.W.\n--   \"r\"/\"R\"   adds the reg. number from the 1st/2nd operand to the opcode.\n--   \"m\"/\"M\"   generates ModRM/SIB from the 1st/2nd operand.\n--             The spare 3 bits are either filled with the last hex digit or\n--             the result from a previous \"r\"/\"R\". The opcode is restored.\n--\n-- All of the following characters force a flush of the opcode:\n--   \"o\"/\"O\"   stores a pure 32 bit disp (offset) from the 1st/2nd operand.\n--   \"S\"       stores a signed 8 bit immediate from the last operand.\n--   \"U\"       stores an unsigned 8 bit immediate from the last operand.\n--   \"W\"       stores an unsigned 16 bit immediate from the last operand.\n--   \"i\"       stores an operand sized immediate from the last operand.\n--   \"I\"       dito, but generates an action code to optionally modify\n--             the opcode (+2) for a signed 8 bit immediate.\n--   \"J\"       generates one of the REL action codes from the last operand.\n--\n------------------------------------------------------------------------------\n\n-- Template strings for x86 instructions. Ordered by first opcode byte.\n-- Unimplemented opcodes (deliberate omissions) are marked with *.\nlocal map_op = {\n  -- 00-05: add...\n  -- 06: *push es\n  -- 07: *pop es\n  -- 08-0D: or...\n  -- 0E: *push cs\n  -- 0F: two byte opcode prefix\n  -- 10-15: adc...\n  -- 16: *push ss\n  -- 17: *pop ss\n  -- 18-1D: sbb...\n  -- 1E: *push ds\n  -- 1F: *pop ds\n  -- 20-25: and...\n  es_0 =\t\"26\",\n  -- 27: *daa\n  -- 28-2D: sub...\n  cs_0 =\t\"2E\",\n  -- 2F: *das\n  -- 30-35: xor...\n  ss_0 =\t\"36\",\n  -- 37: *aaa\n  -- 38-3D: cmp...\n  ds_0 =\t\"3E\",\n  -- 3F: *aas\n  inc_1 =\tx64 and \"m:FF0m\" or \"rdw:40r|m:FF0m\",\n  dec_1 =\tx64 and \"m:FF1m\" or \"rdw:48r|m:FF1m\",\n  push_1 =\t(x64 and \"rq:n50r|rw:50r|mq:nFF6m|mw:FF6m\" or\n\t\t\t \"rdw:50r|mdw:FF6m\")..\"|S.:6AS|ib:n6Ai|i.:68i\",\n  pop_1 =\tx64 and \"rq:n58r|rw:58r|mq:n8F0m|mw:8F0m\" or \"rdw:58r|mdw:8F0m\",\n  -- 60: *pusha, *pushad, *pushaw\n  -- 61: *popa, *popad, *popaw\n  -- 62: *bound rdw,x\n  -- 63: x86: *arpl mw,rw\n  movsxd_2 =\tx64 and \"rm/qd:63rM\",\n  fs_0 =\t\"64\",\n  gs_0 =\t\"65\",\n  o16_0 =\t\"66\",\n  a16_0 =\tnot x64 and \"67\" or nil,\n  a32_0 =\tx64 and \"67\",\n  -- 68: push idw\n  -- 69: imul rdw,mdw,idw\n  -- 6A: push ib\n  -- 6B: imul rdw,mdw,S\n  -- 6C: *insb\n  -- 6D: *insd, *insw\n  -- 6E: *outsb\n  -- 6F: *outsd, *outsw\n  -- 70-7F: jcc lb\n  -- 80: add... mb,i\n  -- 81: add... mdw,i\n  -- 82: *undefined\n  -- 83: add... mdw,S\n  test_2 =\t\"mr:85Rm|rm:85rM|Ri:A9ri|mi:F70mi\",\n  -- 86: xchg rb,mb\n  -- 87: xchg rdw,mdw\n  -- 88: mov mb,r\n  -- 89: mov mdw,r\n  -- 8A: mov r,mb\n  -- 8B: mov r,mdw\n  -- 8C: *mov mdw,seg\n  lea_2 =\t\"rx1dq:8DrM\",\n  -- 8E: *mov seg,mdw\n  -- 8F: pop mdw\n  nop_0 =\t\"90\",\n  xchg_2 =\t\"Rrqdw:90R|rRqdw:90r|rm:87rM|mr:87Rm\",\n  cbw_0 =\t\"6698\",\n  cwde_0 =\t\"98\",\n  cdqe_0 =\t\"4898\",\n  cwd_0 =\t\"6699\",\n  cdq_0 =\t\"99\",\n  cqo_0 =\t\"4899\",\n  -- 9A: *call iw:idw\n  wait_0 =\t\"9B\",\n  fwait_0 =\t\"9B\",\n  pushf_0 =\t\"9C\",\n  pushfd_0 =\tnot x64 and \"9C\",\n  pushfq_0 =\tx64 and \"9C\",\n  popf_0 =\t\"9D\",\n  popfd_0 =\tnot x64 and \"9D\",\n  popfq_0 =\tx64 and \"9D\",\n  sahf_0 =\t\"9E\",\n  lahf_0 =\t\"9F\",\n  mov_2 =\t\"OR:A3o|RO:A1O|mr:89Rm|rm:8BrM|rib:nB0ri|ridw:B8ri|mi:C70mi\",\n  movsb_0 =\t\"A4\",\n  movsw_0 =\t\"66A5\",\n  movsd_0 =\t\"A5\",\n  cmpsb_0 =\t\"A6\",\n  cmpsw_0 =\t\"66A7\",\n  cmpsd_0 =\t\"A7\",\n  -- A8: test Rb,i\n  -- A9: test Rdw,i\n  stosb_0 =\t\"AA\",\n  stosw_0 =\t\"66AB\",\n  stosd_0 =\t\"AB\",\n  lodsb_0 =\t\"AC\",\n  lodsw_0 =\t\"66AD\",\n  lodsd_0 =\t\"AD\",\n  scasb_0 =\t\"AE\",\n  scasw_0 =\t\"66AF\",\n  scasd_0 =\t\"AF\",\n  -- B0-B7: mov rb,i\n  -- B8-BF: mov rdw,i\n  -- C0: rol... mb,i\n  -- C1: rol... mdw,i\n  ret_1 =\t\"i.:nC2W\",\n  ret_0 =\t\"C3\",\n  -- C4: *les rdw,mq\n  -- C5: *lds rdw,mq\n  -- C6: mov mb,i\n  -- C7: mov mdw,i\n  -- C8: *enter iw,ib\n  leave_0 =\t\"C9\",\n  -- CA: *retf iw\n  -- CB: *retf\n  int3_0 =\t\"CC\",\n  int_1 =\t\"i.:nCDU\",\n  into_0 =\t\"CE\",\n  -- CF: *iret\n  -- D0: rol... mb,1\n  -- D1: rol... mdw,1\n  -- D2: rol... mb,cl\n  -- D3: rol... mb,cl\n  -- D4: *aam ib\n  -- D5: *aad ib\n  -- D6: *salc\n  -- D7: *xlat\n  -- D8-DF: floating point ops\n  -- E0: *loopne\n  -- E1: *loope\n  -- E2: *loop\n  -- E3: *jcxz, *jecxz\n  -- E4: *in Rb,ib\n  -- E5: *in Rdw,ib\n  -- E6: *out ib,Rb\n  -- E7: *out ib,Rdw\n  call_1 =\tx64 and \"mq:nFF2m|J.:E8nJ\" or \"md:FF2m|J.:E8J\",\n  jmp_1 =\tx64 and \"mq:nFF4m|J.:E9nJ\" or \"md:FF4m|J.:E9J\", -- short: EB\n  -- EA: *jmp iw:idw\n  -- EB: jmp ib\n  -- EC: *in Rb,dx\n  -- ED: *in Rdw,dx\n  -- EE: *out dx,Rb\n  -- EF: *out dx,Rdw\n  -- F0: *lock\n  int1_0 =\t\"F1\",\n  repne_0 =\t\"F2\",\n  repnz_0 =\t\"F2\",\n  rep_0 =\t\"F3\",\n  repe_0 =\t\"F3\",\n  repz_0 =\t\"F3\",\n  -- F4: *hlt\n  cmc_0 =\t\"F5\",\n  -- F6: test... mb,i; div... mb\n  -- F7: test... mdw,i; div... mdw\n  clc_0 =\t\"F8\",\n  stc_0 =\t\"F9\",\n  -- FA: *cli\n  cld_0 =\t\"FC\",\n  std_0 =\t\"FD\",\n  -- FE: inc... mb\n  -- FF: inc... mdw\n\n  -- misc ops\n  not_1 =\t\"m:F72m\",\n  neg_1 =\t\"m:F73m\",\n  mul_1 =\t\"m:F74m\",\n  imul_1 =\t\"m:F75m\",\n  div_1 =\t\"m:F76m\",\n  idiv_1 =\t\"m:F77m\",\n\n  imul_2 =\t\"rmqdw:0FAFrM|rIqdw:69rmI|rSqdw:6BrmS|riqdw:69rmi\",\n  imul_3 =\t\"rmIqdw:69rMI|rmSqdw:6BrMS|rmiqdw:69rMi\",\n\n  movzx_2 =\t\"rm/db:0FB6rM|rm/qb:|rm/wb:0FB6rM|rm/dw:0FB7rM|rm/qw:\",\n  movsx_2 =\t\"rm/db:0FBErM|rm/qb:|rm/wb:0FBErM|rm/dw:0FBFrM|rm/qw:\",\n\n  bswap_1 =\t\"rqd:0FC8r\",\n  bsf_2 =\t\"rmqdw:0FBCrM\",\n  bsr_2 =\t\"rmqdw:0FBDrM\",\n  bt_2 =\t\"mrqdw:0FA3Rm|miqdw:0FBA4mU\",\n  btc_2 =\t\"mrqdw:0FBBRm|miqdw:0FBA7mU\",\n  btr_2 =\t\"mrqdw:0FB3Rm|miqdw:0FBA6mU\",\n  bts_2 =\t\"mrqdw:0FABRm|miqdw:0FBA5mU\",\n\n  rdtsc_0 =\t\"0F31\", -- P1+\n  cpuid_0 =\t\"0FA2\", -- P1+\n\n  -- floating point ops\n  fst_1 =\t\"ff:DDD0r|xd:D92m|xq:nDD2m\",\n  fstp_1 =\t\"ff:DDD8r|xd:D93m|xq:nDD3m|xt:DB7m\",\n  fld_1 =\t\"ff:D9C0r|xd:D90m|xq:nDD0m|xt:DB5m\",\n\n  fpop_0 =\t\"DDD8\", -- Alias for fstp st0.\n\n  fist_1 =\t\"xw:nDF2m|xd:DB2m\",\n  fistp_1 =\t\"xw:nDF3m|xd:DB3m|xq:nDF7m\",\n  fild_1 =\t\"xw:nDF0m|xd:DB0m|xq:nDF5m\",\n\n  fxch_0 =\t\"D9C9\",\n  fxch_1 =\t\"ff:D9C8r\",\n  fxch_2 =\t\"fFf:D9C8r|Fff:D9C8R\",\n\n  fucom_1 =\t\"ff:DDE0r\",\n  fucom_2 =\t\"Fff:DDE0R\",\n  fucomp_1 =\t\"ff:DDE8r\",\n  fucomp_2 =\t\"Fff:DDE8R\",\n  fucomi_1 =\t\"ff:DBE8r\", -- P6+\n  fucomi_2 =\t\"Fff:DBE8R\", -- P6+\n  fucomip_1 =\t\"ff:DFE8r\", -- P6+\n  fucomip_2 =\t\"Fff:DFE8R\", -- P6+\n  fcomi_1 =\t\"ff:DBF0r\", -- P6+\n  fcomi_2 =\t\"Fff:DBF0R\", -- P6+\n  fcomip_1 =\t\"ff:DFF0r\", -- P6+\n  fcomip_2 =\t\"Fff:DFF0R\", -- P6+\n  fucompp_0 =\t\"DAE9\",\n  fcompp_0 =\t\"DED9\",\n\n  fldcw_1 =\t\"xw:nD95m\",\n  fstcw_1 =\t\"xw:n9BD97m\",\n  fnstcw_1 =\t\"xw:nD97m\",\n  fstsw_1 =\t\"Rw:n9BDFE0|xw:n9BDD7m\",\n  fnstsw_1 =\t\"Rw:nDFE0|xw:nDD7m\",\n  fclex_0 =\t\"9BDBE2\",\n  fnclex_0 =\t\"DBE2\",\n\n  fnop_0 =\t\"D9D0\",\n  -- D9D1-D9DF: unassigned\n\n  fchs_0 =\t\"D9E0\",\n  fabs_0 =\t\"D9E1\",\n  -- D9E2: unassigned\n  -- D9E3: unassigned\n  ftst_0 =\t\"D9E4\",\n  fxam_0 =\t\"D9E5\",\n  -- D9E6: unassigned\n  -- D9E7: unassigned\n  fld1_0 =\t\"D9E8\",\n  fldl2t_0 =\t\"D9E9\",\n  fldl2e_0 =\t\"D9EA\",\n  fldpi_0 =\t\"D9EB\",\n  fldlg2_0 =\t\"D9EC\",\n  fldln2_0 =\t\"D9ED\",\n  fldz_0 =\t\"D9EE\",\n  -- D9EF: unassigned\n\n  f2xm1_0 =\t\"D9F0\",\n  fyl2x_0 =\t\"D9F1\",\n  fptan_0 =\t\"D9F2\",\n  fpatan_0 =\t\"D9F3\",\n  fxtract_0 =\t\"D9F4\",\n  fprem1_0 =\t\"D9F5\",\n  fdecstp_0 =\t\"D9F6\",\n  fincstp_0 =\t\"D9F7\",\n  fprem_0 =\t\"D9F8\",\n  fyl2xp1_0 =\t\"D9F9\",\n  fsqrt_0 =\t\"D9FA\",\n  fsincos_0 =\t\"D9FB\",\n  frndint_0 =\t\"D9FC\",\n  fscale_0 =\t\"D9FD\",\n  fsin_0 =\t\"D9FE\",\n  fcos_0 =\t\"D9FF\",\n\n  -- SSE, SSE2\n  andnpd_2 =\t\"rmo:660F55rM\",\n  andnps_2 =\t\"rmo:0F55rM\",\n  andpd_2 =\t\"rmo:660F54rM\",\n  andps_2 =\t\"rmo:0F54rM\",\n  clflush_1 =\t\"x.:0FAE7m\",\n  cmppd_3 =\t\"rmio:660FC2rMU\",\n  cmpps_3 =\t\"rmio:0FC2rMU\",\n  cmpsd_3 =\t\"rrio:F20FC2rMU|rxi/oq:\",\n  cmpss_3 =\t\"rrio:F30FC2rMU|rxi/od:\",\n  comisd_2 =\t\"rro:660F2FrM|rx/oq:\",\n  comiss_2 =\t\"rro:0F2FrM|rx/od:\",\n  cvtdq2pd_2 =\t\"rro:F30FE6rM|rx/oq:\",\n  cvtdq2ps_2 =\t\"rmo:0F5BrM\",\n  cvtpd2dq_2 =\t\"rmo:F20FE6rM\",\n  cvtpd2ps_2 =\t\"rmo:660F5ArM\",\n  cvtpi2pd_2 =\t\"rx/oq:660F2ArM\",\n  cvtpi2ps_2 =\t\"rx/oq:0F2ArM\",\n  cvtps2dq_2 =\t\"rmo:660F5BrM\",\n  cvtps2pd_2 =\t\"rro:0F5ArM|rx/oq:\",\n  cvtsd2si_2 =\t\"rr/do:F20F2DrM|rr/qo:|rx/dq:|rxq:\",\n  cvtsd2ss_2 =\t\"rro:F20F5ArM|rx/oq:\",\n  cvtsi2sd_2 =\t\"rm/od:F20F2ArM|rm/oq:F20F2ArXM\",\n  cvtsi2ss_2 =\t\"rm/od:F30F2ArM|rm/oq:F30F2ArXM\",\n  cvtss2sd_2 =\t\"rro:F30F5ArM|rx/od:\",\n  cvtss2si_2 =\t\"rr/do:F20F2CrM|rr/qo:|rxd:|rx/qd:\",\n  cvttpd2dq_2 =\t\"rmo:660FE6rM\",\n  cvttps2dq_2 =\t\"rmo:F30F5BrM\",\n  cvttsd2si_2 =\t\"rr/do:F20F2CrM|rr/qo:|rx/dq:|rxq:\",\n  cvttss2si_2 =\t\"rr/do:F30F2CrM|rr/qo:|rxd:|rx/qd:\",\n  ldmxcsr_1 =\t\"xd:0FAE2m\",\n  lfence_0 =\t\"0FAEE8\",\n  maskmovdqu_2 = \"rro:660FF7rM\",\n  mfence_0 =\t\"0FAEF0\",\n  movapd_2 =\t\"rmo:660F28rM|mro:660F29Rm\",\n  movaps_2 =\t\"rmo:0F28rM|mro:0F29Rm\",\n  movd_2 =\t\"rm/od:660F6ErM|rm/oq:660F6ErXM|mr/do:660F7ERm|mr/qo:\",\n  movdqa_2 =\t\"rmo:660F6FrM|mro:660F7FRm\",\n  movdqu_2 =\t\"rmo:F30F6FrM|mro:F30F7FRm\",\n  movhlps_2 =\t\"rro:0F12rM\",\n  movhpd_2 =\t\"rx/oq:660F16rM|xr/qo:n660F17Rm\",\n  movhps_2 =\t\"rx/oq:0F16rM|xr/qo:n0F17Rm\",\n  movlhps_2 =\t\"rro:0F16rM\",\n  movlpd_2 =\t\"rx/oq:660F12rM|xr/qo:n660F13Rm\",\n  movlps_2 =\t\"rx/oq:0F12rM|xr/qo:n0F13Rm\",\n  movmskpd_2 =\t\"rr/do:660F50rM\",\n  movmskps_2 =\t\"rr/do:0F50rM\",\n  movntdq_2 =\t\"xro:660FE7Rm\",\n  movnti_2 =\t\"xrqd:0FC3Rm\",\n  movntpd_2 =\t\"xro:660F2BRm\",\n  movntps_2 =\t\"xro:0F2BRm\",\n  movq_2 =\t\"rro:F30F7ErM|rx/oq:|xr/qo:n660FD6Rm\",\n  movsd_2 =\t\"rro:F20F10rM|rx/oq:|xr/qo:nF20F11Rm\",\n  movss_2 =\t\"rro:F30F10rM|rx/od:|xr/do:F30F11Rm\",\n  movupd_2 =\t\"rmo:660F10rM|mro:660F11Rm\",\n  movups_2 =\t\"rmo:0F10rM|mro:0F11Rm\",\n  orpd_2 =\t\"rmo:660F56rM\",\n  orps_2 =\t\"rmo:0F56rM\",\n  packssdw_2 =\t\"rmo:660F6BrM\",\n  packsswb_2 =\t\"rmo:660F63rM\",\n  packuswb_2 =\t\"rmo:660F67rM\",\n  paddb_2 =\t\"rmo:660FFCrM\",\n  paddd_2 =\t\"rmo:660FFErM\",\n  paddq_2 =\t\"rmo:660FD4rM\",\n  paddsb_2 =\t\"rmo:660FECrM\",\n  paddsw_2 =\t\"rmo:660FEDrM\",\n  paddusb_2 =\t\"rmo:660FDCrM\",\n  paddusw_2 =\t\"rmo:660FDDrM\",\n  paddw_2 =\t\"rmo:660FFDrM\",\n  pand_2 =\t\"rmo:660FDBrM\",\n  pandn_2 =\t\"rmo:660FDFrM\",\n  pause_0 =\t\"F390\",\n  pavgb_2 =\t\"rmo:660FE0rM\",\n  pavgw_2 =\t\"rmo:660FE3rM\",\n  pcmpeqb_2 =\t\"rmo:660F74rM\",\n  pcmpeqd_2 =\t\"rmo:660F76rM\",\n  pcmpeqw_2 =\t\"rmo:660F75rM\",\n  pcmpgtb_2 =\t\"rmo:660F64rM\",\n  pcmpgtd_2 =\t\"rmo:660F66rM\",\n  pcmpgtw_2 =\t\"rmo:660F65rM\",\n  pextrw_3 =\t\"rri/do:660FC5rMU|xri/wo:660F3A15nrMU\", -- Mem op: SSE4.1 only.\n  pinsrw_3 =\t\"rri/od:660FC4rMU|rxi/ow:\",\n  pmaddwd_2 =\t\"rmo:660FF5rM\",\n  pmaxsw_2 =\t\"rmo:660FEErM\",\n  pmaxub_2 =\t\"rmo:660FDErM\",\n  pminsw_2 =\t\"rmo:660FEArM\",\n  pminub_2 =\t\"rmo:660FDArM\",\n  pmovmskb_2 =\t\"rr/do:660FD7rM\",\n  pmulhuw_2 =\t\"rmo:660FE4rM\",\n  pmulhw_2 =\t\"rmo:660FE5rM\",\n  pmullw_2 =\t\"rmo:660FD5rM\",\n  pmuludq_2 =\t\"rmo:660FF4rM\",\n  por_2 =\t\"rmo:660FEBrM\",\n  prefetchnta_1 = \"xb:n0F180m\",\n  prefetcht0_1 = \"xb:n0F181m\",\n  prefetcht1_1 = \"xb:n0F182m\",\n  prefetcht2_1 = \"xb:n0F183m\",\n  psadbw_2 =\t\"rmo:660FF6rM\",\n  pshufd_3 =\t\"rmio:660F70rMU\",\n  pshufhw_3 =\t\"rmio:F30F70rMU\",\n  pshuflw_3 =\t\"rmio:F20F70rMU\",\n  pslld_2 =\t\"rmo:660FF2rM|rio:660F726mU\",\n  pslldq_2 =\t\"rio:660F737mU\",\n  psllq_2 =\t\"rmo:660FF3rM|rio:660F736mU\",\n  psllw_2 =\t\"rmo:660FF1rM|rio:660F716mU\",\n  psrad_2 =\t\"rmo:660FE2rM|rio:660F724mU\",\n  psraw_2 =\t\"rmo:660FE1rM|rio:660F714mU\",\n  psrld_2 =\t\"rmo:660FD2rM|rio:660F722mU\",\n  psrldq_2 =\t\"rio:660F733mU\",\n  psrlq_2 =\t\"rmo:660FD3rM|rio:660F732mU\",\n  psrlw_2 =\t\"rmo:660FD1rM|rio:660F712mU\",\n  psubb_2 =\t\"rmo:660FF8rM\",\n  psubd_2 =\t\"rmo:660FFArM\",\n  psubq_2 =\t\"rmo:660FFBrM\",\n  psubsb_2 =\t\"rmo:660FE8rM\",\n  psubsw_2 =\t\"rmo:660FE9rM\",\n  psubusb_2 =\t\"rmo:660FD8rM\",\n  psubusw_2 =\t\"rmo:660FD9rM\",\n  psubw_2 =\t\"rmo:660FF9rM\",\n  punpckhbw_2 =\t\"rmo:660F68rM\",\n  punpckhdq_2 =\t\"rmo:660F6ArM\",\n  punpckhqdq_2 = \"rmo:660F6DrM\",\n  punpckhwd_2 =\t\"rmo:660F69rM\",\n  punpcklbw_2 =\t\"rmo:660F60rM\",\n  punpckldq_2 =\t\"rmo:660F62rM\",\n  punpcklqdq_2 = \"rmo:660F6CrM\",\n  punpcklwd_2 =\t\"rmo:660F61rM\",\n  pxor_2 =\t\"rmo:660FEFrM\",\n  rcpps_2 =\t\"rmo:0F53rM\",\n  rcpss_2 =\t\"rro:F30F53rM|rx/od:\",\n  rsqrtps_2 =\t\"rmo:0F52rM\",\n  rsqrtss_2 =\t\"rmo:F30F52rM\",\n  sfence_0 =\t\"0FAEF8\",\n  shufpd_3 =\t\"rmio:660FC6rMU\",\n  shufps_3 =\t\"rmio:0FC6rMU\",\n  stmxcsr_1 =   \"xd:0FAE3m\",\n  ucomisd_2 =\t\"rro:660F2ErM|rx/oq:\",\n  ucomiss_2 =\t\"rro:0F2ErM|rx/od:\",\n  unpckhpd_2 =\t\"rmo:660F15rM\",\n  unpckhps_2 =\t\"rmo:0F15rM\",\n  unpcklpd_2 =\t\"rmo:660F14rM\",\n  unpcklps_2 =\t\"rmo:0F14rM\",\n  xorpd_2 =\t\"rmo:660F57rM\",\n  xorps_2 =\t\"rmo:0F57rM\",\n\n  -- SSE3 ops\n  fisttp_1 =\t\"xw:nDF1m|xd:DB1m|xq:nDD1m\",\n  addsubpd_2 =\t\"rmo:660FD0rM\",\n  addsubps_2 =\t\"rmo:F20FD0rM\",\n  haddpd_2 =\t\"rmo:660F7CrM\",\n  haddps_2 =\t\"rmo:F20F7CrM\",\n  hsubpd_2 =\t\"rmo:660F7DrM\",\n  hsubps_2 =\t\"rmo:F20F7DrM\",\n  lddqu_2 =\t\"rxo:F20FF0rM\",\n  movddup_2 =\t\"rmo:F20F12rM\",\n  movshdup_2 =\t\"rmo:F30F16rM\",\n  movsldup_2 =\t\"rmo:F30F12rM\",\n\n  -- SSSE3 ops\n  pabsb_2 =\t\"rmo:660F381CrM\",\n  pabsd_2 =\t\"rmo:660F381ErM\",\n  pabsw_2 =\t\"rmo:660F381DrM\",\n  palignr_3 =\t\"rmio:660F3A0FrMU\",\n  phaddd_2 =\t\"rmo:660F3802rM\",\n  phaddsw_2 =\t\"rmo:660F3803rM\",\n  phaddw_2 =\t\"rmo:660F3801rM\",\n  phsubd_2 =\t\"rmo:660F3806rM\",\n  phsubsw_2 =\t\"rmo:660F3807rM\",\n  phsubw_2 =\t\"rmo:660F3805rM\",\n  pmaddubsw_2 =\t\"rmo:660F3804rM\",\n  pmulhrsw_2 =\t\"rmo:660F380BrM\",\n  pshufb_2 =\t\"rmo:660F3800rM\",\n  psignb_2 =\t\"rmo:660F3808rM\",\n  psignd_2 =\t\"rmo:660F380ArM\",\n  psignw_2 =\t\"rmo:660F3809rM\",\n\n  -- SSE4.1 ops\n  blendpd_3 =\t\"rmio:660F3A0DrMU\",\n  blendps_3 =\t\"rmio:660F3A0CrMU\",\n  blendvpd_3 =\t\"rmRo:660F3815rM\",\n  blendvps_3 =\t\"rmRo:660F3814rM\",\n  dppd_3 =\t\"rmio:660F3A41rMU\",\n  dpps_3 =\t\"rmio:660F3A40rMU\",\n  extractps_3 =\t\"mri/do:660F3A17RmU|rri/qo:660F3A17RXmU\",\n  insertps_3 =\t\"rrio:660F3A41rMU|rxi/od:\",\n  movntdqa_2 =\t\"rmo:660F382ArM\",\n  mpsadbw_3 =\t\"rmio:660F3A42rMU\",\n  packusdw_2 =\t\"rmo:660F382BrM\",\n  pblendvb_3 =\t\"rmRo:660F3810rM\",\n  pblendw_3 =\t\"rmio:660F3A0ErMU\",\n  pcmpeqq_2 =\t\"rmo:660F3829rM\",\n  pextrb_3 =\t\"rri/do:660F3A14nRmU|rri/qo:|xri/bo:\",\n  pextrd_3 =\t\"mri/do:660F3A16RmU\",\n  pextrq_3 =\t\"mri/qo:660F3A16RmU\",\n  -- pextrw is SSE2, mem operand is SSE4.1 only\n  phminposuw_2 = \"rmo:660F3841rM\",\n  pinsrb_3 =\t\"rri/od:660F3A20nrMU|rxi/ob:\",\n  pinsrd_3 =\t\"rmi/od:660F3A22rMU\",\n  pinsrq_3 =\t\"rmi/oq:660F3A22rXMU\",\n  pmaxsb_2 =\t\"rmo:660F383CrM\",\n  pmaxsd_2 =\t\"rmo:660F383DrM\",\n  pmaxud_2 =\t\"rmo:660F383FrM\",\n  pmaxuw_2 =\t\"rmo:660F383ErM\",\n  pminsb_2 =\t\"rmo:660F3838rM\",\n  pminsd_2 =\t\"rmo:660F3839rM\",\n  pminud_2 =\t\"rmo:660F383BrM\",\n  pminuw_2 =\t\"rmo:660F383ArM\",\n  pmovsxbd_2 =\t\"rro:660F3821rM|rx/od:\",\n  pmovsxbq_2 =\t\"rro:660F3822rM|rx/ow:\",\n  pmovsxbw_2 =\t\"rro:660F3820rM|rx/oq:\",\n  pmovsxdq_2 =\t\"rro:660F3825rM|rx/oq:\",\n  pmovsxwd_2 =\t\"rro:660F3823rM|rx/oq:\",\n  pmovsxwq_2 =\t\"rro:660F3824rM|rx/od:\",\n  pmovzxbd_2 =\t\"rro:660F3831rM|rx/od:\",\n  pmovzxbq_2 =\t\"rro:660F3832rM|rx/ow:\",\n  pmovzxbw_2 =\t\"rro:660F3830rM|rx/oq:\",\n  pmovzxdq_2 =\t\"rro:660F3835rM|rx/oq:\",\n  pmovzxwd_2 =\t\"rro:660F3833rM|rx/oq:\",\n  pmovzxwq_2 =\t\"rro:660F3834rM|rx/od:\",\n  pmuldq_2 =\t\"rmo:660F3828rM\",\n  pmulld_2 =\t\"rmo:660F3840rM\",\n  ptest_2 =\t\"rmo:660F3817rM\",\n  roundpd_3 =\t\"rmio:660F3A09rMU\",\n  roundps_3 =\t\"rmio:660F3A08rMU\",\n  roundsd_3 =\t\"rrio:660F3A0BrMU|rxi/oq:\",\n  roundss_3 =\t\"rrio:660F3A0ArMU|rxi/od:\",\n\n  -- SSE4.2 ops\n  crc32_2 =\t\"rmqd:F20F38F1rM|rm/dw:66F20F38F1rM|rm/db:F20F38F0rM|rm/qb:\",\n  pcmpestri_3 =\t\"rmio:660F3A61rMU\",\n  pcmpestrm_3 =\t\"rmio:660F3A60rMU\",\n  pcmpgtq_2 =\t\"rmo:660F3837rM\",\n  pcmpistri_3 =\t\"rmio:660F3A63rMU\",\n  pcmpistrm_3 =\t\"rmio:660F3A62rMU\",\n  popcnt_2 =\t\"rmqdw:F30FB8rM\",\n\n  -- SSE4a\n  extrq_2 =\t\"rro:660F79rM\",\n  extrq_3 =\t\"riio:660F780mUU\",\n  insertq_2 =\t\"rro:F20F79rM\",\n  insertq_4 =\t\"rriio:F20F78rMUU\",\n  lzcnt_2 =\t\"rmqdw:F30FBDrM\",\n  movntsd_2 =\t\"xr/qo:nF20F2BRm\",\n  movntss_2 =\t\"xr/do:F30F2BRm\",\n  -- popcnt is also in SSE4.2\n}\n\n------------------------------------------------------------------------------\n\n-- Arithmetic ops.\nfor name,n in pairs{ add = 0, [\"or\"] = 1, adc = 2, sbb = 3,\n\t\t     [\"and\"] = 4, sub = 5, xor = 6, cmp = 7 } do\n  local n8 = shl(n, 3)\n  map_op[name..\"_2\"] = format(\n    \"mr:%02XRm|rm:%02XrM|mI1qdw:81%XmI|mS1qdw:83%XmS|Ri1qdwb:%02Xri|mi1qdwb:81%Xmi\",\n    1+n8, 3+n8, n, n, 5+n8, n)\nend\n\n-- Shift ops.\nfor name,n in pairs{ rol = 0, ror = 1, rcl = 2, rcr = 3,\n\t\t     shl = 4, shr = 5,          sar = 7, sal = 4 } do\n  map_op[name..\"_2\"] = format(\"m1:D1%Xm|mC1qdwb:D3%Xm|mi:C1%XmU\", n, n, n)\nend\n\n-- Conditional ops.\nfor cc,n in pairs(map_cc) do\n  map_op[\"j\"..cc..\"_1\"] = format(\"J.:n0F8%XJ\", n) -- short: 7%X\n  map_op[\"set\"..cc..\"_1\"] = format(\"mb:n0F9%X2m\", n)\n  map_op[\"cmov\"..cc..\"_2\"] = format(\"rmqdw:0F4%XrM\", n) -- P6+\nend\n\n-- FP arithmetic ops.\nfor name,n in pairs{ add = 0, mul = 1, com = 2, comp = 3,\n\t\t     sub = 4, subr = 5, div = 6, divr = 7 } do\n  local nc = 0xc0 + shl(n, 3)\n  local nr = nc + (n < 4 and 0 or (n % 2 == 0 and 8 or -8))\n  local fn = \"f\"..name\n  map_op[fn..\"_1\"] = format(\"ff:D8%02Xr|xd:D8%Xm|xq:nDC%Xm\", nc, n, n)\n  if n == 2 or n == 3 then\n    map_op[fn..\"_2\"] = format(\"Fff:D8%02XR|Fx2d:D8%XM|Fx2q:nDC%XM\", nc, n, n)\n  else\n    map_op[fn..\"_2\"] = format(\"Fff:D8%02XR|fFf:DC%02Xr|Fx2d:D8%XM|Fx2q:nDC%XM\", nc, nr, n, n)\n    map_op[fn..\"p_1\"] = format(\"ff:DE%02Xr\", nr)\n    map_op[fn..\"p_2\"] = format(\"fFf:DE%02Xr\", nr)\n  end\n  map_op[\"fi\"..name..\"_1\"] = format(\"xd:DA%Xm|xw:nDE%Xm\", n, n)\nend\n\n-- FP conditional moves.\nfor cc,n in pairs{ b=0, e=1, be=2, u=3, nb=4, ne=5, nbe=6, nu=7 } do\n  local nc = 0xdac0 + shl(band(n, 3), 3) + shl(band(n, 4), 6)\n  map_op[\"fcmov\"..cc..\"_1\"] = format(\"ff:%04Xr\", nc) -- P6+\n  map_op[\"fcmov\"..cc..\"_2\"] = format(\"Fff:%04XR\", nc) -- P6+\nend\n\n-- SSE FP arithmetic ops.\nfor name,n in pairs{ sqrt = 1, add = 8, mul = 9,\n\t\t     sub = 12, min = 13, div = 14, max = 15 } do\n  map_op[name..\"ps_2\"] = format(\"rmo:0F5%XrM\", n)\n  map_op[name..\"ss_2\"] = format(\"rro:F30F5%XrM|rx/od:\", n)\n  map_op[name..\"pd_2\"] = format(\"rmo:660F5%XrM\", n)\n  map_op[name..\"sd_2\"] = format(\"rro:F20F5%XrM|rx/oq:\", n)\nend\n\n------------------------------------------------------------------------------\n\n-- Process pattern string.\nlocal function dopattern(pat, args, sz, op, needrex)\n  local digit, addin\n  local opcode = 0\n  local szov = sz\n  local narg = 1\n  local rex = 0\n\n  -- Limit number of section buffer positions used by a single dasm_put().\n  -- A single opcode needs a maximum of 5 positions.\n  if secpos+5 > maxsecpos then wflush() end\n\n  -- Process each character.\n  for c in gmatch(pat..\"|\", \".\") do\n    if match(c, \"%x\") then\t-- Hex digit.\n      digit = byte(c) - 48\n      if digit > 48 then digit = digit - 39\n      elseif digit > 16 then digit = digit - 7 end\n      opcode = opcode*16 + digit\n      addin = nil\n    elseif c == \"n\" then\t-- Disable operand size mods for opcode.\n      szov = nil\n    elseif c == \"X\" then\t-- Force REX.W.\n      rex = 8\n    elseif c == \"r\" then\t-- Merge 1st operand regno. into opcode.\n      addin = args[1]; opcode = opcode + (addin.reg % 8)\n      if narg < 2 then narg = 2 end\n    elseif c == \"R\" then\t-- Merge 2nd operand regno. into opcode.\n      addin = args[2]; opcode = opcode + (addin.reg % 8)\n      narg = 3\n    elseif c == \"m\" or c == \"M\" then\t-- Encode ModRM/SIB.\n      local s\n      if addin then\n\ts = addin.reg\n\topcode = opcode - band(s, 7)\t-- Undo regno opcode merge.\n      else\n\ts = band(opcode, 15)\t-- Undo last digit.\n\topcode = shr(opcode, 4)\n      end\n      local nn = c == \"m\" and 1 or 2\n      local t = args[nn]\n      if narg <= nn then narg = nn + 1 end\n      if szov == \"q\" and rex == 0 then rex = rex + 8 end\n      if t.reg and t.reg > 7 then rex = rex + 1 end\n      if t.xreg and t.xreg > 7 then rex = rex + 2 end\n      if s > 7 then rex = rex + 4 end\n      if needrex then rex = rex + 16 end\n      wputop(szov, opcode, rex); opcode = nil\n      local imark = sub(pat, -1) -- Force a mark (ugly).\n      -- Put ModRM/SIB with regno/last digit as spare.\n      wputmrmsib(t, imark, s, addin and addin.vreg)\n      addin = nil\n    else\n      if opcode then -- Flush opcode.\n\tif szov == \"q\" and rex == 0 then rex = rex + 8 end\n\tif needrex then rex = rex + 16 end\n\tif addin and addin.reg == -1 then\n\t  wputop(szov, opcode - 7, rex)\n\t  waction(\"VREG\", addin.vreg); wputxb(0)\n\telse\n\t  if addin and addin.reg > 7 then rex = rex + 1 end\n\t  wputop(szov, opcode, rex)\n\tend\n\topcode = nil\n      end\n      if c == \"|\" then break end\n      if c == \"o\" then -- Offset (pure 32 bit displacement).\n\twputdarg(args[1].disp); if narg < 2 then narg = 2 end\n      elseif c == \"O\" then\n\twputdarg(args[2].disp); narg = 3\n      else\n\t-- Anything else is an immediate operand.\n\tlocal a = args[narg]\n\tnarg = narg + 1\n\tlocal mode, imm = a.mode, a.imm\n\tif mode == \"iJ\" and not match(\"iIJ\", c) then\n\t  werror(\"bad operand size for label\")\n\tend\n\tif c == \"S\" then\n\t  wputsbarg(imm)\n\telseif c == \"U\" then\n\t  wputbarg(imm)\n\telseif c == \"W\" then\n\t  wputwarg(imm)\n\telseif c == \"i\" or c == \"I\" then\n\t  if mode == \"iJ\" then\n\t    wputlabel(\"IMM_\", imm, 1)\n\t  elseif mode == \"iI\" and c == \"I\" then\n\t    waction(sz == \"w\" and \"IMM_WB\" or \"IMM_DB\", imm)\n\t  else\n\t    wputszarg(sz, imm)\n\t  end\n\telseif c == \"J\" then\n\t  if mode == \"iPJ\" then\n\t    waction(\"REL_A\", imm) -- !x64 (secpos)\n\t  else\n\t    wputlabel(\"REL_\", imm, 2)\n\t  end\n\telse\n\t  werror(\"bad char `\"..c..\"' in pattern `\"..pat..\"' for `\"..op..\"'\")\n\tend\n      end\n    end\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Mapping of operand modes to short names. Suppress output with '#'.\nlocal map_modename = {\n  r = \"reg\", R = \"eax\", C = \"cl\", x = \"mem\", m = \"mrm\", i = \"imm\",\n  f = \"stx\", F = \"st0\", J = \"lbl\", [\"1\"] = \"1\",\n  I = \"#\", S = \"#\", O = \"#\",\n}\n\n-- Return a table/string showing all possible operand modes.\nlocal function templatehelp(template, nparams)\n  if nparams == 0 then return \"\" end\n  local t = {}\n  for tm in gmatch(template, \"[^%|]+\") do\n    local s = map_modename[sub(tm, 1, 1)]\n    s = s..gsub(sub(tm, 2, nparams), \".\", function(c)\n      return \", \"..map_modename[c]\n    end)\n    if not match(s, \"#\") then t[#t+1] = s end\n  end\n  return t\nend\n\n-- Match operand modes against mode match part of template.\nlocal function matchtm(tm, args)\n  for i=1,#args do\n    if not match(args[i].mode, sub(tm, i, i)) then return end\n  end\n  return true\nend\n\n-- Handle opcodes defined with template strings.\nmap_op[\".template__\"] = function(params, template, nparams)\n  if not params then return templatehelp(template, nparams) end\n  local args = {}\n\n  -- Zero-operand opcodes have no match part.\n  if #params == 0 then\n    dopattern(template, args, \"d\", params.op, nil)\n    return\n  end\n\n  -- Determine common operand size (coerce undefined size) or flag as mixed.\n  local sz, szmix, needrex\n  for i,p in ipairs(params) do\n    args[i] = parseoperand(p)\n    local nsz = args[i].opsize\n    if nsz then\n      if sz and sz ~= nsz then szmix = true else sz = nsz end\n    end\n    local nrex = args[i].needrex\n    if nrex ~= nil then\n      if needrex == nil then\n\tneedrex = nrex\n      elseif needrex ~= nrex then\n\twerror(\"bad mix of byte-addressable registers\")\n      end\n    end\n  end\n\n  -- Try all match:pattern pairs (separated by '|').\n  local gotmatch, lastpat\n  for tm in gmatch(template, \"[^%|]+\") do\n    -- Split off size match (starts after mode match) and pattern string.\n    local szm, pat = match(tm, \"^(.-):(.*)$\", #args+1)\n    if pat == \"\" then pat = lastpat else lastpat = pat end\n    if matchtm(tm, args) then\n      local prefix = sub(szm, 1, 1)\n      if prefix == \"/\" then -- Match both operand sizes.\n\tif args[1].opsize == sub(szm, 2, 2) and\n\t   args[2].opsize == sub(szm, 3, 3) then\n\t  dopattern(pat, args, sz, params.op, needrex) -- Process pattern.\n\t  return\n\tend\n      else -- Match common operand size.\n\tlocal szp = sz\n\tif szm == \"\" then szm = x64 and \"qdwb\" or \"dwb\" end -- Default sizes.\n\tif prefix == \"1\" then szp = args[1].opsize; szmix = nil\n\telseif prefix == \"2\" then szp = args[2].opsize; szmix = nil end\n\tif not szmix and (prefix == \".\" or match(szm, szp or \"#\")) then\n\t  dopattern(pat, args, szp, params.op, needrex) -- Process pattern.\n\t  return\n\tend\n      end\n      gotmatch = true\n    end\n  end\n\n  local msg = \"bad operand mode\"\n  if gotmatch then\n    if szmix then\n      msg = \"mixed operand size\"\n    else\n      msg = sz and \"bad operand size\" or \"missing operand size\"\n    end\n  end\n\n  werror(msg..\" in `\"..opmodestr(params.op, args)..\"'\")\nend\n\n------------------------------------------------------------------------------\n\n-- x64-specific opcode for 64 bit immediates and displacements.\nif x64 then\n  function map_op.mov64_2(params)\n    if not params then return { \"reg, imm\", \"reg, [disp]\", \"[disp], reg\" } end\n    if secpos+2 > maxsecpos then wflush() end\n    local opcode, op64, sz, rex\n    local op64 = match(params[1], \"^%[%s*(.-)%s*%]$\")\n    if op64 then\n      local a = parseoperand(params[2])\n      if a.mode ~= \"rmR\" then werror(\"bad operand mode\") end\n      sz = a.opsize\n      rex = sz == \"q\" and 8 or 0\n      opcode = 0xa3\n    else\n      op64 = match(params[2], \"^%[%s*(.-)%s*%]$\")\n      local a = parseoperand(params[1])\n      if op64 then\n\tif a.mode ~= \"rmR\" then werror(\"bad operand mode\") end\n\tsz = a.opsize\n\trex = sz == \"q\" and 8 or 0\n\topcode = 0xa1\n      else\n\tif sub(a.mode, 1, 1) ~= \"r\" or a.opsize ~= \"q\" then\n\t  werror(\"bad operand mode\")\n\tend\n\top64 = params[2]\n\topcode = 0xb8 + band(a.reg, 7) -- !x64: no VREG support.\n\trex = a.reg > 7 and 9 or 8\n      end\n    end\n    wputop(sz, opcode, rex)\n    waction(\"IMM_D\", format(\"(unsigned int)(%s)\", op64))\n    waction(\"IMM_D\", format(\"(unsigned int)((%s)>>32)\", op64))\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcodes for data storage.\nlocal function op_data(params)\n  if not params then return \"imm...\" end\n  local sz = sub(params.op, 2, 2)\n  if sz == \"a\" then sz = addrsize end\n  for _,p in ipairs(params) do\n    local a = parseoperand(p)\n    if sub(a.mode, 1, 1) ~= \"i\" or (a.opsize and a.opsize ~= sz) then\n      werror(\"bad mode or size in `\"..p..\"'\")\n    end\n    if a.mode == \"iJ\" then\n      wputlabel(\"IMM_\", a.imm, 1)\n    else\n      wputszarg(sz, a.imm)\n    end\n    if secpos+2 > maxsecpos then wflush() end\n  end\nend\n\nmap_op[\".byte_*\"] = op_data\nmap_op[\".sbyte_*\"] = op_data\nmap_op[\".word_*\"] = op_data\nmap_op[\".dword_*\"] = op_data\nmap_op[\".aword_*\"] = op_data\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode to mark the position where the action list is to be emitted.\nmap_op[\".actionlist_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeactions(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the global enum is to be emitted.\nmap_op[\".globals_1\"] = function(params)\n  if not params then return \"prefix\" end\n  local prefix = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobals(out, prefix) end)\nend\n\n-- Pseudo-opcode to mark the position where the global names are to be emitted.\nmap_op[\".globalnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeglobalnames(out, name) end)\nend\n\n-- Pseudo-opcode to mark the position where the extern names are to be emitted.\nmap_op[\".externnames_1\"] = function(params)\n  if not params then return \"cvar\" end\n  local name = params[1] -- No syntax check. You get to keep the pieces.\n  wline(function(out) writeexternnames(out, name) end)\nend\n\n------------------------------------------------------------------------------\n\n-- Label pseudo-opcode (converted from trailing colon form).\nmap_op[\".label_2\"] = function(params)\n  if not params then return \"[1-9] | ->global | =>pcexpr  [, addr]\" end\n  if secpos+2 > maxsecpos then wflush() end\n  local a = parseoperand(params[1])\n  local mode, imm = a.mode, a.imm\n  if type(imm) == \"number\" and (mode == \"iJ\" or (imm >= 1 and imm <= 9)) then\n    -- Local label (1: ... 9:) or global label (->global:).\n    waction(\"LABEL_LG\", nil, 1)\n    wputxb(imm)\n  elseif mode == \"iJ\" then\n    -- PC label (=>pcexpr:).\n    waction(\"LABEL_PC\", imm)\n  else\n    werror(\"bad label definition\")\n  end\n  -- SETLABEL must immediately follow LABEL_LG/LABEL_PC.\n  local addr = params[2]\n  if addr then\n    local a = parseoperand(addr)\n    if a.mode == \"iPJ\" then\n      waction(\"SETLABEL\", a.imm)\n    else\n      werror(\"bad label assignment\")\n    end\n  end\nend\nmap_op[\".label_1\"] = map_op[\".label_2\"]\n\n------------------------------------------------------------------------------\n\n-- Alignment pseudo-opcode.\nmap_op[\".align_1\"] = function(params)\n  if not params then return \"numpow2\" end\n  if secpos+1 > maxsecpos then wflush() end\n  local align = tonumber(params[1]) or map_opsizenum[map_opsize[params[1]]]\n  if align then\n    local x = align\n    -- Must be a power of 2 in the range (2 ... 256).\n    for i=1,8 do\n      x = x / 2\n      if x == 1 then\n\twaction(\"ALIGN\", nil, 1)\n\twputxb(align-1) -- Action byte is 2**n-1.\n\treturn\n      end\n    end\n  end\n  werror(\"bad alignment\")\nend\n\n-- Spacing pseudo-opcode.\nmap_op[\".space_2\"] = function(params)\n  if not params then return \"num [, filler]\" end\n  if secpos+1 > maxsecpos then wflush() end\n  waction(\"SPACE\", params[1])\n  local fill = params[2]\n  if fill then\n    fill = tonumber(fill)\n    if not fill or fill < 0 or fill > 255 then werror(\"bad filler\") end\n  end\n  wputxb(fill or 0)\nend\nmap_op[\".space_1\"] = map_op[\".space_2\"]\n\n------------------------------------------------------------------------------\n\n-- Pseudo-opcode for (primitive) type definitions (map to C types).\nmap_op[\".type_3\"] = function(params, nparams)\n  if not params then\n    return nparams == 2 and \"name, ctype\" or \"name, ctype, reg\"\n  end\n  local name, ctype, reg = params[1], params[2], params[3]\n  if not match(name, \"^[%a_][%w_]*$\") then\n    werror(\"bad type name `\"..name..\"'\")\n  end\n  local tp = map_type[name]\n  if tp then\n    werror(\"duplicate type `\"..name..\"'\")\n  end\n  if reg and not map_reg_valid_base[reg] then\n    werror(\"bad base register `\"..(map_reg_rev[reg] or reg)..\"'\")\n  end\n  -- Add #type to defines. A bit unclean to put it in map_archdef.\n  map_archdef[\"#\"..name] = \"sizeof(\"..ctype..\")\"\n  -- Add new type and emit shortcut define.\n  local num = ctypenum + 1\n  map_type[name] = {\n    ctype = ctype,\n    ctypefmt = format(\"Dt%X(%%s)\", num),\n    reg = reg,\n  }\n  wline(format(\"#define Dt%X(_V) (int)(ptrdiff_t)&(((%s *)0)_V)\", num, ctype))\n  ctypenum = num\nend\nmap_op[\".type_2\"] = map_op[\".type_3\"]\n\n-- Dump type definitions.\nlocal function dumptypes(out, lvl)\n  local t = {}\n  for name in pairs(map_type) do t[#t+1] = name end\n  sort(t)\n  out:write(\"Type definitions:\\n\")\n  for _,name in ipairs(t) do\n    local tp = map_type[name]\n    local reg = tp.reg and map_reg_rev[tp.reg] or \"\"\n    out:write(format(\"  %-20s %-20s %s\\n\", name, tp.ctype, reg))\n  end\n  out:write(\"\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Set the current section.\nfunction _M.section(num)\n  waction(\"SECTION\")\n  wputxb(num)\n  wflush(true) -- SECTION is a terminal action.\nend\n\n------------------------------------------------------------------------------\n\n-- Dump architecture description.\nfunction _M.dumparch(out)\n  out:write(format(\"DynASM %s version %s, released %s\\n\\n\",\n    _info.arch, _info.version, _info.release))\n  dumpregs(out)\n  dumpactions(out)\nend\n\n-- Dump all user defined elements.\nfunction _M.dumpdef(out, lvl)\n  dumptypes(out, lvl)\n  dumpglobals(out, lvl)\n  dumpexterns(out, lvl)\nend\n\n------------------------------------------------------------------------------\n\n-- Pass callbacks from/to the DynASM core.\nfunction _M.passcb(wl, we, wf, ww)\n  wline, werror, wfatal, wwarn = wl, we, wf, ww\n  return wflush\nend\n\n-- Setup the arch-specific module.\nfunction _M.setup(arch, opt)\n  g_arch, g_opt = arch, opt\nend\n\n-- Merge the core maps and the arch-specific maps.\nfunction _M.mergemaps(map_coreop, map_def)\n  setmetatable(map_op, { __index = map_coreop })\n  setmetatable(map_def, { __index = map_archdef })\n  return map_op, map_def\nend\n\nreturn _M\n\n------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/dynasm/dynasm.lua",
    "content": "------------------------------------------------------------------------------\n-- DynASM. A dynamic assembler for code generation engines.\n-- Originally designed and implemented for LuaJIT.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- See below for full copyright notice.\n------------------------------------------------------------------------------\n\n-- Application information.\nlocal _info = {\n  name =\t\"DynASM\",\n  description =\t\"A dynamic assembler for code generation engines\",\n  version =\t\"1.3.0\",\n  vernum =\t 10300,\n  release =\t\"2011-05-05\",\n  author =\t\"Mike Pall\",\n  url =\t\t\"http://luajit.org/dynasm.html\",\n  license =\t\"MIT\",\n  copyright =\t[[\nCopyright (C) 2005-2013 Mike Pall. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n[ MIT license: http://www.opensource.org/licenses/mit-license.php ]\n]],\n}\n\n-- Cache library functions.\nlocal type, pairs, ipairs = type, pairs, ipairs\nlocal pcall, error, assert = pcall, error, assert\nlocal _s = string\nlocal sub, match, gmatch, gsub = _s.sub, _s.match, _s.gmatch, _s.gsub\nlocal format, rep, upper = _s.format, _s.rep, _s.upper\nlocal _t = table\nlocal insert, remove, concat, sort = _t.insert, _t.remove, _t.concat, _t.sort\nlocal exit = os.exit\nlocal io = io\nlocal stdin, stdout, stderr = io.stdin, io.stdout, io.stderr\n\n------------------------------------------------------------------------------\n\n-- Program options.\nlocal g_opt = {}\n\n-- Global state for current file.\nlocal g_fname, g_curline, g_indent, g_lineno, g_synclineno, g_arch\nlocal g_errcount = 0\n\n-- Write buffer for output file.\nlocal g_wbuffer, g_capbuffer\n\n------------------------------------------------------------------------------\n\n-- Write an output line (or callback function) to the buffer.\nlocal function wline(line, needindent)\n  local buf = g_capbuffer or g_wbuffer\n  buf[#buf+1] = needindent and g_indent..line or line\n  g_synclineno = g_synclineno + 1\nend\n\n-- Write assembler line as a comment, if requestd.\nlocal function wcomment(aline)\n  if g_opt.comment then\n    wline(g_opt.comment..aline..g_opt.endcomment, true)\n  end\nend\n\n-- Resync CPP line numbers.\nlocal function wsync()\n  if g_synclineno ~= g_lineno and g_opt.cpp then\n    wline(\"# \"..g_lineno..' \"'..g_fname..'\"')\n    g_synclineno = g_lineno\n  end\nend\n\n-- Dummy action flush function. Replaced with arch-specific function later.\nlocal function wflush(term)\nend\n\n-- Dump all buffered output lines.\nlocal function wdumplines(out, buf)\n  for _,line in ipairs(buf) do\n    if type(line) == \"string\" then\n      assert(out:write(line, \"\\n\"))\n    else\n      -- Special callback to dynamically insert lines after end of processing.\n      line(out)\n    end\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Emit an error. Processing continues with next statement.\nlocal function werror(msg)\n  error(format(\"%s:%s: error: %s:\\n%s\", g_fname, g_lineno, msg, g_curline), 0)\nend\n\n-- Emit a fatal error. Processing stops.\nlocal function wfatal(msg)\n  g_errcount = \"fatal\"\n  werror(msg)\nend\n\n-- Print a warning. Processing continues.\nlocal function wwarn(msg)\n  stderr:write(format(\"%s:%s: warning: %s:\\n%s\\n\",\n    g_fname, g_lineno, msg, g_curline))\nend\n\n-- Print caught error message. But suppress excessive errors.\nlocal function wprinterr(...)\n  if type(g_errcount) == \"number\" then\n    -- Regular error.\n    g_errcount = g_errcount + 1\n    if g_errcount < 21 then -- Seems to be a reasonable limit.\n      stderr:write(...)\n    elseif g_errcount == 21 then\n      stderr:write(g_fname,\n\t\":*: warning: too many errors (suppressed further messages).\\n\")\n    end\n  else\n    -- Fatal error.\n    stderr:write(...)\n    return true -- Stop processing.\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Map holding all option handlers.\nlocal opt_map = {}\nlocal opt_current\n\n-- Print error and exit with error status.\nlocal function opterror(...)\n  stderr:write(\"dynasm.lua: ERROR: \", ...)\n  stderr:write(\"\\n\")\n  exit(1)\nend\n\n-- Get option parameter.\nlocal function optparam(args)\n  local argn = args.argn\n  local p = args[argn]\n  if not p then\n    opterror(\"missing parameter for option `\", opt_current, \"'.\")\n  end\n  args.argn = argn + 1\n  return p\nend\n\n------------------------------------------------------------------------------\n\n-- Core pseudo-opcodes.\nlocal map_coreop = {}\n-- Dummy opcode map. Replaced by arch-specific map.\nlocal map_op = {}\n\n-- Forward declarations.\nlocal dostmt\nlocal readfile\n\n------------------------------------------------------------------------------\n\n-- Map for defines (initially empty, chains to arch-specific map).\nlocal map_def = {}\n\n-- Pseudo-opcode to define a substitution.\nmap_coreop[\".define_2\"] = function(params, nparams)\n  if not params then return nparams == 1 and \"name\" or \"name, subst\" end\n  local name, def = params[1], params[2] or \"1\"\n  if not match(name, \"^[%a_][%w_]*$\") then werror(\"bad or duplicate define\") end\n  map_def[name] = def\nend\nmap_coreop[\".define_1\"] = map_coreop[\".define_2\"]\n\n-- Define a substitution on the command line.\nfunction opt_map.D(args)\n  local namesubst = optparam(args)\n  local name, subst = match(namesubst, \"^([%a_][%w_]*)=(.*)$\")\n  if name then\n    map_def[name] = subst\n  elseif match(namesubst, \"^[%a_][%w_]*$\") then\n    map_def[namesubst] = \"1\"\n  else\n    opterror(\"bad define\")\n  end\nend\n\n-- Undefine a substitution on the command line.\nfunction opt_map.U(args)\n  local name = optparam(args)\n  if match(name, \"^[%a_][%w_]*$\") then\n    map_def[name] = nil\n  else\n    opterror(\"bad define\")\n  end\nend\n\n-- Helper for definesubst.\nlocal gotsubst\n\nlocal function definesubst_one(word)\n  local subst = map_def[word]\n  if subst then gotsubst = word; return subst else return word end\nend\n\n-- Iteratively substitute defines.\nlocal function definesubst(stmt)\n  -- Limit number of iterations.\n  for i=1,100 do\n    gotsubst = false\n    stmt = gsub(stmt, \"#?[%w_]+\", definesubst_one)\n    if not gotsubst then break end\n  end\n  if gotsubst then wfatal(\"recursive define involving `\"..gotsubst..\"'\") end\n  return stmt\nend\n\n-- Dump all defines.\nlocal function dumpdefines(out, lvl)\n  local t = {}\n  for name in pairs(map_def) do\n    t[#t+1] = name\n  end\n  sort(t)\n  out:write(\"Defines:\\n\")\n  for _,name in ipairs(t) do\n    local subst = map_def[name]\n    if g_arch then subst = g_arch.revdef(subst) end\n    out:write(format(\"  %-20s %s\\n\", name, subst))\n  end\n  out:write(\"\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Support variables for conditional assembly.\nlocal condlevel = 0\nlocal condstack = {}\n\n-- Evaluate condition with a Lua expression. Substitutions already performed.\nlocal function cond_eval(cond)\n  local func, err\n  if setfenv then\n    func, err = loadstring(\"return \"..cond, \"=expr\")\n  else\n    -- No globals. All unknown identifiers evaluate to nil.\n    func, err = load(\"return \"..cond, \"=expr\", \"t\", {})\n  end\n  if func then\n    if setfenv then\n      setfenv(func, {}) -- No globals. All unknown identifiers evaluate to nil.\n    end\n    local ok, res = pcall(func)\n    if ok then\n      if res == 0 then return false end -- Oh well.\n      return not not res\n    end\n    err = res\n  end\n  wfatal(\"bad condition: \"..err)\nend\n\n-- Skip statements until next conditional pseudo-opcode at the same level.\nlocal function stmtskip()\n  local dostmt_save = dostmt\n  local lvl = 0\n  dostmt = function(stmt)\n    local op = match(stmt, \"^%s*(%S+)\")\n    if op == \".if\" then\n      lvl = lvl + 1\n    elseif lvl ~= 0 then\n      if op == \".endif\" then lvl = lvl - 1 end\n    elseif op == \".elif\" or op == \".else\" or op == \".endif\" then\n      dostmt = dostmt_save\n      dostmt(stmt)\n    end\n  end\nend\n\n-- Pseudo-opcodes for conditional assembly.\nmap_coreop[\".if_1\"] = function(params)\n  if not params then return \"condition\" end\n  local lvl = condlevel + 1\n  local res = cond_eval(params[1])\n  condlevel = lvl\n  condstack[lvl] = res\n  if not res then stmtskip() end\nend\n\nmap_coreop[\".elif_1\"] = function(params)\n  if not params then return \"condition\" end\n  if condlevel == 0 then wfatal(\".elif without .if\") end\n  local lvl = condlevel\n  local res = condstack[lvl]\n  if res then\n    if res == \"else\" then wfatal(\".elif after .else\") end\n  else\n    res = cond_eval(params[1])\n    if res then\n      condstack[lvl] = res\n      return\n    end\n  end\n  stmtskip()\nend\n\nmap_coreop[\".else_0\"] = function(params)\n  if condlevel == 0 then wfatal(\".else without .if\") end\n  local lvl = condlevel\n  local res = condstack[lvl]\n  condstack[lvl] = \"else\"\n  if res then\n    if res == \"else\" then wfatal(\".else after .else\") end\n    stmtskip()\n  end\nend\n\nmap_coreop[\".endif_0\"] = function(params)\n  local lvl = condlevel\n  if lvl == 0 then wfatal(\".endif without .if\") end\n  condlevel = lvl - 1\nend\n\n-- Check for unfinished conditionals.\nlocal function checkconds()\n  if g_errcount ~= \"fatal\" and condlevel ~= 0 then\n    wprinterr(g_fname, \":*: error: unbalanced conditional\\n\")\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Search for a file in the given path and open it for reading.\nlocal function pathopen(path, name)\n  local dirsep = package and match(package.path, \"\\\\\") and \"\\\\\" or \"/\"\n  for _,p in ipairs(path) do\n    local fullname = p == \"\" and name or p..dirsep..name\n    local fin = io.open(fullname, \"r\")\n    if fin then\n      g_fname = fullname\n      return fin\n    end\n  end\nend\n\n-- Include a file.\nmap_coreop[\".include_1\"] = function(params)\n  if not params then return \"filename\" end\n  local name = params[1]\n  -- Save state. Ugly, I know. but upvalues are fast.\n  local gf, gl, gcl, gi = g_fname, g_lineno, g_curline, g_indent\n  -- Read the included file.\n  local fatal = readfile(pathopen(g_opt.include, name) or\n\t\t\t wfatal(\"include file `\"..name..\"' not found\"))\n  -- Restore state.\n  g_synclineno = -1\n  g_fname, g_lineno, g_curline, g_indent = gf, gl, gcl, gi\n  if fatal then wfatal(\"in include file\") end\nend\n\n-- Make .include and conditionals initially available, too.\nmap_op[\".include_1\"] = map_coreop[\".include_1\"]\nmap_op[\".if_1\"] = map_coreop[\".if_1\"]\nmap_op[\".elif_1\"] = map_coreop[\".elif_1\"]\nmap_op[\".else_0\"] = map_coreop[\".else_0\"]\nmap_op[\".endif_0\"] = map_coreop[\".endif_0\"]\n\n------------------------------------------------------------------------------\n\n-- Support variables for macros.\nlocal mac_capture, mac_lineno, mac_name\nlocal mac_active = {}\nlocal mac_list = {}\n\n-- Pseudo-opcode to define a macro.\nmap_coreop[\".macro_*\"] = function(mparams)\n  if not mparams then return \"name [, params...]\" end\n  -- Split off and validate macro name.\n  local name = remove(mparams, 1)\n  if not name then werror(\"missing macro name\") end\n  if not (match(name, \"^[%a_][%w_%.]*$\") or match(name, \"^%.[%w_%.]*$\")) then\n    wfatal(\"bad macro name `\"..name..\"'\")\n  end\n  -- Validate macro parameter names.\n  local mdup = {}\n  for _,mp in ipairs(mparams) do\n    if not match(mp, \"^[%a_][%w_]*$\") then\n      wfatal(\"bad macro parameter name `\"..mp..\"'\")\n    end\n    if mdup[mp] then wfatal(\"duplicate macro parameter name `\"..mp..\"'\") end\n    mdup[mp] = true\n  end\n  -- Check for duplicate or recursive macro definitions.\n  local opname = name..\"_\"..#mparams\n  if map_op[opname] or map_op[name..\"_*\"] then\n    wfatal(\"duplicate macro `\"..name..\"' (\"..#mparams..\" parameters)\")\n  end\n  if mac_capture then wfatal(\"recursive macro definition\") end\n\n  -- Enable statement capture.\n  local lines = {}\n  mac_lineno = g_lineno\n  mac_name = name\n  mac_capture = function(stmt) -- Statement capture function.\n    -- Stop macro definition with .endmacro pseudo-opcode.\n    if not match(stmt, \"^%s*.endmacro%s*$\") then\n      lines[#lines+1] = stmt\n      return\n    end\n    mac_capture = nil\n    mac_lineno = nil\n    mac_name = nil\n    mac_list[#mac_list+1] = opname\n    -- Add macro-op definition.\n    map_op[opname] = function(params)\n      if not params then return mparams, lines end\n      -- Protect against recursive macro invocation.\n      if mac_active[opname] then wfatal(\"recursive macro invocation\") end\n      mac_active[opname] = true\n      -- Setup substitution map.\n      local subst = {}\n      for i,mp in ipairs(mparams) do subst[mp] = params[i] end\n      local mcom\n      if g_opt.maccomment and g_opt.comment then\n\tmcom = \" MACRO \"..name..\" (\"..#mparams..\")\"\n\twcomment(\"{\"..mcom)\n      end\n      -- Loop through all captured statements\n      for _,stmt in ipairs(lines) do\n\t-- Substitute macro parameters.\n\tlocal st = gsub(stmt, \"[%w_]+\", subst)\n\tst = definesubst(st)\n\tst = gsub(st, \"%s*%.%.%s*\", \"\") -- Token paste a..b.\n\tif mcom and sub(st, 1, 1) ~= \"|\" then wcomment(st) end\n\t-- Emit statement. Use a protected call for better diagnostics.\n\tlocal ok, err = pcall(dostmt, st)\n\tif not ok then\n\t  -- Add the captured statement to the error.\n\t  wprinterr(err, \"\\n\", g_indent, \"|  \", stmt,\n\t\t    \"\\t[MACRO \", name, \" (\", #mparams, \")]\\n\")\n\tend\n      end\n      if mcom then wcomment(\"}\"..mcom) end\n      mac_active[opname] = nil\n    end\n  end\nend\n\n-- An .endmacro pseudo-opcode outside of a macro definition is an error.\nmap_coreop[\".endmacro_0\"] = function(params)\n  wfatal(\".endmacro without .macro\")\nend\n\n-- Dump all macros and their contents (with -PP only).\nlocal function dumpmacros(out, lvl)\n  sort(mac_list)\n  out:write(\"Macros:\\n\")\n  for _,opname in ipairs(mac_list) do\n    local name = sub(opname, 1, -3)\n    local params, lines = map_op[opname]()\n    out:write(format(\"  %-20s %s\\n\", name, concat(params, \", \")))\n    if lvl > 1 then\n      for _,line in ipairs(lines) do\n\tout:write(\"  |\", line, \"\\n\")\n      end\n      out:write(\"\\n\")\n    end\n  end\n  out:write(\"\\n\")\nend\n\n-- Check for unfinished macro definitions.\nlocal function checkmacros()\n  if mac_capture then\n    wprinterr(g_fname, \":\", mac_lineno,\n\t      \": error: unfinished .macro `\", mac_name ,\"'\\n\")\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Support variables for captures.\nlocal cap_lineno, cap_name\nlocal cap_buffers = {}\nlocal cap_used = {}\n\n-- Start a capture.\nmap_coreop[\".capture_1\"] = function(params)\n  if not params then return \"name\" end\n  wflush()\n  local name = params[1]\n  if not match(name, \"^[%a_][%w_]*$\") then\n    wfatal(\"bad capture name `\"..name..\"'\")\n  end\n  if cap_name then\n    wfatal(\"already capturing to `\"..cap_name..\"' since line \"..cap_lineno)\n  end\n  cap_name = name\n  cap_lineno = g_lineno\n  -- Create or continue a capture buffer and start the output line capture.\n  local buf = cap_buffers[name]\n  if not buf then buf = {}; cap_buffers[name] = buf end\n  g_capbuffer = buf\n  g_synclineno = 0\nend\n\n-- Stop a capture.\nmap_coreop[\".endcapture_0\"] = function(params)\n  wflush()\n  if not cap_name then wfatal(\".endcapture without a valid .capture\") end\n  cap_name = nil\n  cap_lineno = nil\n  g_capbuffer = nil\n  g_synclineno = 0\nend\n\n-- Dump a capture buffer.\nmap_coreop[\".dumpcapture_1\"] = function(params)\n  if not params then return \"name\" end\n  wflush()\n  local name = params[1]\n  if not match(name, \"^[%a_][%w_]*$\") then\n    wfatal(\"bad capture name `\"..name..\"'\")\n  end\n  cap_used[name] = true\n  wline(function(out)\n    local buf = cap_buffers[name]\n    if buf then wdumplines(out, buf) end\n  end)\n  g_synclineno = 0\nend\n\n-- Dump all captures and their buffers (with -PP only).\nlocal function dumpcaptures(out, lvl)\n  out:write(\"Captures:\\n\")\n  for name,buf in pairs(cap_buffers) do\n    out:write(format(\"  %-20s %4s)\\n\", name, \"(\"..#buf))\n    if lvl > 1 then\n      local bar = rep(\"=\", 76)\n      out:write(\"  \", bar, \"\\n\")\n      for _,line in ipairs(buf) do\n\tout:write(\"  \", line, \"\\n\")\n      end\n      out:write(\"  \", bar, \"\\n\\n\")\n    end\n  end\n  out:write(\"\\n\")\nend\n\n-- Check for unfinished or unused captures.\nlocal function checkcaptures()\n  if cap_name then\n    wprinterr(g_fname, \":\", cap_lineno,\n\t      \": error: unfinished .capture `\", cap_name,\"'\\n\")\n    return\n  end\n  for name in pairs(cap_buffers) do\n    if not cap_used[name] then\n      wprinterr(g_fname, \":*: error: missing .dumpcapture \", name ,\"\\n\")\n    end\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Sections names.\nlocal map_sections = {}\n\n-- Pseudo-opcode to define code sections.\n-- TODO: Data sections, BSS sections. Needs extra C code and API.\nmap_coreop[\".section_*\"] = function(params)\n  if not params then return \"name...\" end\n  if #map_sections > 0 then werror(\"duplicate section definition\") end\n  wflush()\n  for sn,name in ipairs(params) do\n    local opname = \".\"..name..\"_0\"\n    if not match(name, \"^[%a][%w_]*$\") or\n       map_op[opname] or map_op[\".\"..name..\"_*\"] then\n      werror(\"bad section name `\"..name..\"'\")\n    end\n    map_sections[#map_sections+1] = name\n    wline(format(\"#define DASM_SECTION_%s\\t%d\", upper(name), sn-1))\n    map_op[opname] = function(params) g_arch.section(sn-1) end\n  end\n  wline(format(\"#define DASM_MAXSECTION\\t\\t%d\", #map_sections))\nend\n\n-- Dump all sections.\nlocal function dumpsections(out, lvl)\n  out:write(\"Sections:\\n\")\n  for _,name in ipairs(map_sections) do\n    out:write(format(\"  %s\\n\", name))\n  end\n  out:write(\"\\n\")\nend\n\n------------------------------------------------------------------------------\n\n-- Replacement for customized Lua, which lacks the package library.\nlocal prefix = \"\"\nif not require then\n  function require(name)\n    local fp = assert(io.open(prefix..name..\".lua\"))\n    local s = fp:read(\"*a\")\n    assert(fp:close())\n    return assert(loadstring(s, \"@\"..name..\".lua\"))()\n  end\nend\n\n-- Load architecture-specific module.\nlocal function loadarch(arch)\n  if not match(arch, \"^[%w_]+$\") then return \"bad arch name\" end\n  local ok, m_arch = pcall(require, \"dasm_\"..arch)\n  if not ok then return \"cannot load module: \"..m_arch end\n  g_arch = m_arch\n  wflush = m_arch.passcb(wline, werror, wfatal, wwarn)\n  m_arch.setup(arch, g_opt)\n  map_op, map_def = m_arch.mergemaps(map_coreop, map_def)\nend\n\n-- Dump architecture description.\nfunction opt_map.dumparch(args)\n  local name = optparam(args)\n  if not g_arch then\n    local err = loadarch(name)\n    if err then opterror(err) end\n  end\n\n  local t = {}\n  for name in pairs(map_coreop) do t[#t+1] = name end\n  for name in pairs(map_op) do t[#t+1] = name end\n  sort(t)\n\n  local out = stdout\n  local _arch = g_arch._info\n  out:write(format(\"%s version %s, released %s, %s\\n\",\n    _info.name, _info.version, _info.release, _info.url))\n  g_arch.dumparch(out)\n\n  local pseudo = true\n  out:write(\"Pseudo-Opcodes:\\n\")\n  for _,sname in ipairs(t) do\n    local name, nparam = match(sname, \"^(.+)_([0-9%*])$\")\n    if name then\n      if pseudo and sub(name, 1, 1) ~= \".\" then\n\tout:write(\"\\nOpcodes:\\n\")\n\tpseudo = false\n      end\n      local f = map_op[sname]\n      local s\n      if nparam ~= \"*\" then nparam = nparam + 0 end\n      if nparam == 0 then\n\ts = \"\"\n      elseif type(f) == \"string\" then\n\ts = map_op[\".template__\"](nil, f, nparam)\n      else\n\ts = f(nil, nparam)\n      end\n      if type(s) == \"table\" then\n\tfor _,s2 in ipairs(s) do\n\t  out:write(format(\"  %-12s %s\\n\", name, s2))\n\tend\n      else\n\tout:write(format(\"  %-12s %s\\n\", name, s))\n      end\n    end\n  end\n  out:write(\"\\n\")\n  exit(0)\nend\n\n-- Pseudo-opcode to set the architecture.\n-- Only initially available (map_op is replaced when called).\nmap_op[\".arch_1\"] = function(params)\n  if not params then return \"name\" end\n  local err = loadarch(params[1])\n  if err then wfatal(err) end\nend\n\n-- Dummy .arch pseudo-opcode to improve the error report.\nmap_coreop[\".arch_1\"] = function(params)\n  if not params then return \"name\" end\n  wfatal(\"duplicate .arch statement\")\nend\n\n------------------------------------------------------------------------------\n\n-- Dummy pseudo-opcode. Don't confuse '.nop' with 'nop'.\nmap_coreop[\".nop_*\"] = function(params)\n  if not params then return \"[ignored...]\" end\nend\n\n-- Pseudo-opcodes to raise errors.\nmap_coreop[\".error_1\"] = function(params)\n  if not params then return \"message\" end\n  werror(params[1])\nend\n\nmap_coreop[\".fatal_1\"] = function(params)\n  if not params then return \"message\" end\n  wfatal(params[1])\nend\n\n-- Dump all user defined elements.\nlocal function dumpdef(out)\n  local lvl = g_opt.dumpdef\n  if lvl == 0 then return end\n  dumpsections(out, lvl)\n  dumpdefines(out, lvl)\n  if g_arch then g_arch.dumpdef(out, lvl) end\n  dumpmacros(out, lvl)\n  dumpcaptures(out, lvl)\nend\n\n------------------------------------------------------------------------------\n\n-- Helper for splitstmt.\nlocal splitlvl\n\nlocal function splitstmt_one(c)\n  if c == \"(\" then\n    splitlvl = \")\"..splitlvl\n  elseif c == \"[\" then\n    splitlvl = \"]\"..splitlvl\n  elseif c == \"{\" then\n    splitlvl = \"}\"..splitlvl\n  elseif c == \")\" or c == \"]\" or c == \"}\" then\n    if sub(splitlvl, 1, 1) ~= c then werror(\"unbalanced (), [] or {}\") end\n    splitlvl = sub(splitlvl, 2)\n  elseif splitlvl == \"\" then\n    return \" \\0 \"\n  end\n  return c\nend\n\n-- Split statement into (pseudo-)opcode and params.\nlocal function splitstmt(stmt)\n  -- Convert label with trailing-colon into .label statement.\n  local label = match(stmt, \"^%s*(.+):%s*$\")\n  if label then return \".label\", {label} end\n\n  -- Split at commas and equal signs, but obey parentheses and brackets.\n  splitlvl = \"\"\n  stmt = gsub(stmt, \"[,%(%)%[%]{}]\", splitstmt_one)\n  if splitlvl ~= \"\" then werror(\"unbalanced () or []\") end\n\n  -- Split off opcode.\n  local op, other = match(stmt, \"^%s*([^%s%z]+)%s*(.*)$\")\n  if not op then werror(\"bad statement syntax\") end\n\n  -- Split parameters.\n  local params = {}\n  for p in gmatch(other, \"%s*(%Z+)%z?\") do\n    params[#params+1] = gsub(p, \"%s+$\", \"\")\n  end\n  if #params > 16 then werror(\"too many parameters\") end\n\n  params.op = op\n  return op, params\nend\n\n-- Process a single statement.\ndostmt = function(stmt)\n  -- Ignore empty statements.\n  if match(stmt, \"^%s*$\") then return end\n\n  -- Capture macro defs before substitution.\n  if mac_capture then return mac_capture(stmt) end\n  stmt = definesubst(stmt)\n\n  -- Emit C code without parsing the line.\n  if sub(stmt, 1, 1) == \"|\" then\n    local tail = sub(stmt, 2)\n    wflush()\n    if sub(tail, 1, 2) == \"//\" then wcomment(tail) else wline(tail, true) end\n    return\n  end\n\n  -- Split into (pseudo-)opcode and params.\n  local op, params = splitstmt(stmt)\n\n  -- Get opcode handler (matching # of parameters or generic handler).\n  local f = map_op[op..\"_\"..#params] or map_op[op..\"_*\"]\n  if not f then\n    if not g_arch then wfatal(\"first statement must be .arch\") end\n    -- Improve error report.\n    for i=0,9 do\n      if map_op[op..\"_\"..i] then\n\twerror(\"wrong number of parameters for `\"..op..\"'\")\n      end\n    end\n    werror(\"unknown statement `\"..op..\"'\")\n  end\n\n  -- Call opcode handler or special handler for template strings.\n  if type(f) == \"string\" then\n    map_op[\".template__\"](params, f)\n  else\n    f(params)\n  end\nend\n\n-- Process a single line.\nlocal function doline(line)\n  if g_opt.flushline then wflush() end\n\n  -- Assembler line?\n  local indent, aline = match(line, \"^(%s*)%|(.*)$\")\n  if not aline then\n    -- No, plain C code line, need to flush first.\n    wflush()\n    wsync()\n    wline(line, false)\n    return\n  end\n\n  g_indent = indent -- Remember current line indentation.\n\n  -- Emit C code (even from macros). Avoids echo and line parsing.\n  if sub(aline, 1, 1) == \"|\" then\n    if not mac_capture then\n      wsync()\n    elseif g_opt.comment then\n      wsync()\n      wcomment(aline)\n    end\n    dostmt(aline)\n    return\n  end\n\n  -- Echo assembler line as a comment.\n  if g_opt.comment then\n    wsync()\n    wcomment(aline)\n  end\n\n  -- Strip assembler comments.\n  aline = gsub(aline, \"//.*$\", \"\")\n\n  -- Split line into statements at semicolons.\n  if match(aline, \";\") then\n    for stmt in gmatch(aline, \"[^;]+\") do dostmt(stmt) end\n  else\n    dostmt(aline)\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Write DynASM header.\nlocal function dasmhead(out)\n  out:write(format([[\n/*\n** This file has been pre-processed with DynASM.\n** %s\n** DynASM version %s, DynASM %s version %s\n** DO NOT EDIT! The original file is in \"%s\".\n*/\n\n#if DASM_VERSION != %d\n#error \"Version mismatch between DynASM and included encoding engine\"\n#endif\n\n]], _info.url,\n    _info.version, g_arch._info.arch, g_arch._info.version,\n    g_fname, _info.vernum))\nend\n\n-- Read input file.\nreadfile = function(fin)\n  g_indent = \"\"\n  g_lineno = 0\n  g_synclineno = -1\n\n  -- Process all lines.\n  for line in fin:lines() do\n    g_lineno = g_lineno + 1\n    g_curline = line\n    local ok, err = pcall(doline, line)\n    if not ok and wprinterr(err, \"\\n\") then return true end\n  end\n  wflush()\n\n  -- Close input file.\n  assert(fin == stdin or fin:close())\nend\n\n-- Write output file.\nlocal function writefile(outfile)\n  local fout\n\n  -- Open output file.\n  if outfile == nil or outfile == \"-\" then\n    fout = stdout\n  else\n    fout = assert(io.open(outfile, \"w\"))\n  end\n\n  -- Write all buffered lines\n  wdumplines(fout, g_wbuffer)\n\n  -- Close output file.\n  assert(fout == stdout or fout:close())\n\n  -- Optionally dump definitions.\n  dumpdef(fout == stdout and stderr or stdout)\nend\n\n-- Translate an input file to an output file.\nlocal function translate(infile, outfile)\n  g_wbuffer = {}\n  g_indent = \"\"\n  g_lineno = 0\n  g_synclineno = -1\n\n  -- Put header.\n  wline(dasmhead)\n\n  -- Read input file.\n  local fin\n  if infile == \"-\" then\n    g_fname = \"(stdin)\"\n    fin = stdin\n  else\n    g_fname = infile\n    fin = assert(io.open(infile, \"r\"))\n  end\n  readfile(fin)\n\n  -- Check for errors.\n  if not g_arch then\n    wprinterr(g_fname, \":*: error: missing .arch directive\\n\")\n  end\n  checkconds()\n  checkmacros()\n  checkcaptures()\n\n  if g_errcount ~= 0 then\n    stderr:write(g_fname, \":*: info: \", g_errcount, \" error\",\n      (type(g_errcount) == \"number\" and g_errcount > 1) and \"s\" or \"\",\n      \" in input file -- no output file generated.\\n\")\n    dumpdef(stderr)\n    exit(1)\n  end\n\n  -- Write output file.\n  writefile(outfile)\nend\n\n------------------------------------------------------------------------------\n\n-- Print help text.\nfunction opt_map.help()\n  stdout:write(\"DynASM -- \", _info.description, \".\\n\")\n  stdout:write(\"DynASM \", _info.version, \" \", _info.release, \"  \", _info.url, \"\\n\")\n  stdout:write[[\n\nUsage: dynasm [OPTION]... INFILE.dasc|-\n\n  -h, --help           Display this help text.\n  -V, --version        Display version and copyright information.\n\n  -o, --outfile FILE   Output file name (default is stdout).\n  -I, --include DIR    Add directory to the include search path.\n\n  -c, --ccomment       Use /* */ comments for assembler lines.\n  -C, --cppcomment     Use // comments for assembler lines (default).\n  -N, --nocomment      Suppress assembler lines in output.\n  -M, --maccomment     Show macro expansions as comments (default off).\n\n  -L, --nolineno       Suppress CPP line number information in output.\n  -F, --flushline      Flush action list for every line.\n\n  -D NAME[=SUBST]      Define a substitution.\n  -U NAME              Undefine a substitution.\n\n  -P, --dumpdef        Dump defines, macros, etc. Repeat for more output.\n  -A, --dumparch ARCH  Load architecture ARCH and dump description.\n]]\n  exit(0)\nend\n\n-- Print version information.\nfunction opt_map.version()\n  stdout:write(format(\"%s version %s, released %s\\n%s\\n\\n%s\",\n    _info.name, _info.version, _info.release, _info.url, _info.copyright))\n  exit(0)\nend\n\n-- Misc. options.\nfunction opt_map.outfile(args) g_opt.outfile = optparam(args) end\nfunction opt_map.include(args) insert(g_opt.include, 1, optparam(args)) end\nfunction opt_map.ccomment() g_opt.comment = \"/*|\"; g_opt.endcomment = \" */\" end\nfunction opt_map.cppcomment() g_opt.comment = \"//|\"; g_opt.endcomment = \"\" end\nfunction opt_map.nocomment() g_opt.comment = false end\nfunction opt_map.maccomment() g_opt.maccomment = true end\nfunction opt_map.nolineno() g_opt.cpp = false end\nfunction opt_map.flushline() g_opt.flushline = true end\nfunction opt_map.dumpdef() g_opt.dumpdef = g_opt.dumpdef + 1 end\n\n------------------------------------------------------------------------------\n\n-- Short aliases for long options.\nlocal opt_alias = {\n  h = \"help\", [\"?\"] = \"help\", V = \"version\",\n  o = \"outfile\", I = \"include\",\n  c = \"ccomment\", C = \"cppcomment\", N = \"nocomment\", M = \"maccomment\",\n  L = \"nolineno\", F = \"flushline\",\n  P = \"dumpdef\", A = \"dumparch\",\n}\n\n-- Parse single option.\nlocal function parseopt(opt, args)\n  opt_current = #opt == 1 and \"-\"..opt or \"--\"..opt\n  local f = opt_map[opt] or opt_map[opt_alias[opt]]\n  if not f then\n    opterror(\"unrecognized option `\", opt_current, \"'. Try `--help'.\\n\")\n  end\n  f(args)\nend\n\n-- Parse arguments.\nlocal function parseargs(args)\n  -- Default options.\n  g_opt.comment = \"//|\"\n  g_opt.endcomment = \"\"\n  g_opt.cpp = true\n  g_opt.dumpdef = 0\n  g_opt.include = { \"\" }\n\n  -- Process all option arguments.\n  args.argn = 1\n  repeat\n    local a = args[args.argn]\n    if not a then break end\n    local lopt, opt = match(a, \"^%-(%-?)(.+)\")\n    if not opt then break end\n    args.argn = args.argn + 1\n    if lopt == \"\" then\n      -- Loop through short options.\n      for o in gmatch(opt, \".\") do parseopt(o, args) end\n    else\n      -- Long option.\n      parseopt(opt, args)\n    end\n  until false\n\n  -- Check for proper number of arguments.\n  local nargs = #args - args.argn + 1\n  if nargs ~= 1 then\n    if nargs == 0 then\n      if g_opt.dumpdef > 0 then return dumpdef(stdout) end\n    end\n    opt_map.help()\n  end\n\n  -- Translate a single input file to a single output file\n  -- TODO: Handle multiple files?\n  translate(args[args.argn], g_opt.outfile)\nend\n\n------------------------------------------------------------------------------\n\n-- Add the directory dynasm.lua resides in to the Lua module search path.\nlocal arg = arg\nif arg and arg[0] then\n  prefix = match(arg[0], \"^(.*[/\\\\])\")\n  if package and prefix then package.path = prefix..\"?.lua;\"..package.path end\nend\n\n-- Start DynASM.\nparseargs{...}\n\n------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/etc/luajit.1",
    "content": ".TH luajit 1 \"\" \"\" \"LuaJIT documentation\"\n.SH NAME\nluajit \\- Just-In-Time Compiler for the Lua Language\n\\fB\n.SH SYNOPSIS\n.B luajit\n[\\fIoptions\\fR]... [\\fIscript\\fR [\\fIargs\\fR]...]\n.SH \"WEB SITE\"\n.IR http://luajit.org\n.SH DESCRIPTION\n.PP\nThis is the command-line program to run Lua programs with \\fBLuaJIT\\fR.\n.PP\n\\fBLuaJIT\\fR is a just-in-time (JIT) compiler for the Lua language.\nThe virtual machine (VM) is based on a fast interpreter combined with\na trace compiler. It can significantly improve the performance of Lua programs.\n.PP\n\\fBLuaJIT\\fR is API\\- and ABI-compatible with the VM of the standard\nLua\\ 5.1 interpreter. When embedding the VM into an application,\nthe built library can be used as a drop-in replacement.\n.SH OPTIONS\n.TP\n.BI \"\\-e \" chunk\nRun the given chunk of Lua code.\n.TP\n.BI \"\\-l \" library\nLoad the named library, just like \\fBrequire(\"\\fR\\fIlibrary\\fR\\fB\")\\fR.\n.TP\n.BI \"\\-b \" ...\nSave or list bytecode. Run without arguments to get help on options.\n.TP\n.BI \"\\-j \" command\nPerform LuaJIT control command (optional space after \\fB\\-j\\fR).\n.TP\n.BI \"\\-O\" [opt]\nControl LuaJIT optimizations.\n.TP\n.B \"\\-i\"\nRun in interactive mode.\n.TP\n.B \"\\-v\"\nShow \\fBLuaJIT\\fR version.\n.TP\n.B \"\\-E\"\nIgnore environment variables.\n.TP\n.B \"\\-\\-\"\nStop processing options.\n.TP\n.B \"\\-\"\nRead script from stdin instead.\n.PP\nAfter all options are processed, the given \\fIscript\\fR is run.\nThe arguments are passed in the global \\fIarg\\fR table.\n.PP\nInteractive mode is only entered, if no \\fIscript\\fR and no \\fB\\-e\\fR\noption is given. Interactive mode can be left with EOF (\\fICtrl\\-Z\\fB).\n.SH EXAMPLES\n.TP\nluajit hello.lua world\n\nPrints \"Hello world\", assuming \\fIhello.lua\\fR contains:\n.br\n  print(\"Hello\", arg[1])\n.TP\nluajit \\-e \"local x=0; for i=1,1e9 do x=x+i end; print(x)\"\n\nCalculates the sum of the numbers from 1 to 1000000000.\n.br\nAnd finishes in a reasonable amount of time, too.\n.TP\nluajit \\-jv \\-e \"for i=1,10 do for j=1,10 do for k=1,100 do end end end\"\n\nRuns some nested loops and shows the resulting traces.\n.SH COPYRIGHT\n.PP\n\\fBLuaJIT\\fR is Copyright \\(co 2005-2013 Mike Pall.\n.br\n\\fBLuaJIT\\fR is open source software, released under the MIT license.\n.SH SEE ALSO\n.PP\nMore details in the provided HTML docs or at:\n.IR http://luajit.org\n.br\nMore about the Lua language can be found at:\n.IR http://lua.org/docs.html\n.PP\nlua(1)\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/etc/luajit.pc",
    "content": "# Package information for LuaJIT to be used by pkg-config.\nmajver=2\nminver=0\nrelver=1\nversion=${majver}.${minver}.${relver}\nabiver=5.1\n\nprefix=/usr/local\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nlibname=luajit-${abiver}\nincludedir=${prefix}/include/luajit-${majver}.${minver}\n\nINSTALL_LMOD=${prefix}/share/lua/${abiver}\nINSTALL_CMOD=${prefix}/lib/lua/${abiver}\n\nName: LuaJIT\nDescription: Just-in-time compiler for Lua\nURL: http://luajit.org\nVersion: ${version}\nRequires:\nLibs: -L${libdir} -l${libname}\nLibs.private: -Wl,-E -lm -ldl\nCflags: -I${includedir}\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/Makefile",
    "content": "##############################################################################\n# LuaJIT Makefile. Requires GNU Make.\n#\n# Please read doc/install.html before changing any variables!\n#\n# Suitable for POSIX platforms (Linux, *BSD, OSX etc.).\n# Also works with MinGW and Cygwin on Windows.\n# Please check msvcbuild.bat for building with MSVC on Windows.\n#\n# Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h\n##############################################################################\n\nMAJVER=  2\nMINVER=  0\nRELVER=  0\nABIVER=  5.1\nNODOTABIVER= 51\n\n##############################################################################\n#############################  COMPILER OPTIONS  #############################\n##############################################################################\n# These options mainly affect the speed of the JIT compiler itself, not the\n# speed of the JIT-compiled code. Turn any of the optional settings on by\n# removing the '#' in front of them. Make sure you force a full recompile\n# with \"make clean\", followed by \"make\" if you change any options.\n#\n# LuaJIT builds as a native 32 or 64 bit binary by default.\nCC= gcc\n#\n# Use this if you want to force a 32 bit build on a 64 bit multilib OS.\n#CC= gcc -m32\n#\n# Since the assembler part does NOT maintain a frame pointer, it's pointless\n# to slow down the C part by not omitting it. Debugging, tracebacks and\n# unwinding are not affected -- the assembler part has frame unwind\n# information and GCC emits it where needed (x64) or with -g (see CCDEBUG).\nCCOPT= -O2 -fomit-frame-pointer\n# Use this if you want to generate a smaller binary (but it's slower):\n#CCOPT= -Os -fomit-frame-pointer\n# Note: it's no longer recommended to use -O3 with GCC 4.x.\n# The I-Cache bloat usually outweighs the benefits from aggressive inlining.\n#\n# Target-specific compiler options:\n#\n# x86 only: it's recommended to compile at least for i686. Better yet,\n# compile for an architecture that has SSE2, too (-msse -msse2).\n#\n# x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute\n# the binaries to a different machine you could also use: -march=native\n#\nCCOPT_x86= -march=i686\nCCOPT_x64=\nCCOPT_arm=\nCCOPT_ppc=\nCCOPT_ppcspe=\nCCOPT_mips=\n#\nCCDEBUG=\n# Uncomment the next line to generate debug information:\n#CCDEBUG= -g\n#\nCCWARN= -Wall\n# Uncomment the next line to enable more warnings:\n#CCWARN+= -Wextra -Wdeclaration-after-statement -Wredundant-decls -Wshadow -Wpointer-arith\n#\n##############################################################################\n\n##############################################################################\n################################  BUILD MODE  ################################\n##############################################################################\n# The default build mode is mixed mode on POSIX. On Windows this is the same\n# as dynamic mode.\n#\n# Mixed mode creates a static + dynamic library and a statically linked luajit.\nBUILDMODE= mixed\n#\n# Static mode creates a static library and a statically linked luajit.\n#BUILDMODE= static\n#\n# Dynamic mode creates a dynamic library and a dynamically linked luajit.\n# Note: this executable will only run when the library is installed!\n#BUILDMODE= dynamic\n#\n##############################################################################\n\n##############################################################################\n#################################  FEATURES  #################################\n##############################################################################\n# Enable/disable these features as needed, but make sure you force a full\n# recompile with \"make clean\", followed by \"make\".\nXCFLAGS=\n#\n# Permanently disable the FFI extension to reduce the size of the LuaJIT\n# executable. But please consider that the FFI library is compiled-in,\n# but NOT loaded by default. It only allocates any memory, if you actually\n# make use of it.\n#XCFLAGS+= -DLUAJIT_DISABLE_FFI\n#\n# Features from Lua 5.2 that are unlikely to break existing code are\n# enabled by default. Some other features that *might* break some existing\n# code (e.g. __pairs or os.execute() return values) can be enabled here.\n# Note: this does not provide full compatibility with Lua 5.2 at this time.\n#XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT\n#\n# Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter.\n#XCFLAGS+= -DLUAJIT_DISABLE_JIT\n#\n# Some architectures (e.g. PPC) can use either single-number (1) or\n# dual-number (2) mode. Uncomment one of these lines to override the\n# default mode. Please see LJ_ARCH_NUMMODE in lj_arch.h for details.\n#XCFLAGS+= -DLUAJIT_NUMMODE=1\n#XCFLAGS+= -DLUAJIT_NUMMODE=2\n#\n##############################################################################\n\n##############################################################################\n############################  DEBUGGING SUPPORT  #############################\n##############################################################################\n# Enable these options as needed, but make sure you force a full recompile\n# with \"make clean\", followed by \"make\".\n# Note that most of these are NOT suitable for benchmarking or release mode!\n#\n# Use the system provided memory allocator (realloc) instead of the\n# bundled memory allocator. This is slower, but sometimes helpful for\n# debugging. It's helpful for Valgrind's memcheck tool, too. This option\n# cannot be enabled on x64, since the built-in allocator is mandatory.\n#XCFLAGS+= -DLUAJIT_USE_SYSMALLOC\n#\n# This define is required to run LuaJIT under Valgrind. The Valgrind\n# header files must be installed. You should enable debug information, too.\n# Use --suppressions=lj.supp to avoid some false positives.\n#XCFLAGS+= -DLUAJIT_USE_VALGRIND\n#\n# This is the client for the GDB JIT API. GDB 7.0 or higher is required\n# to make use of it. See lj_gdbjit.c for details. Enabling this causes\n# a non-negligible overhead, even when not running under GDB.\n#XCFLAGS+= -DLUAJIT_USE_GDBJIT\n#\n# Turn on assertions for the Lua/C API to debug problems with lua_* calls.\n# This is rather slow -- use only while developing C libraries/embeddings.\n#XCFLAGS+= -DLUA_USE_APICHECK\n#\n# Turn on assertions for the whole LuaJIT VM. This significantly slows down\n# everything. Use only if you suspect a problem with LuaJIT itself.\n#XCFLAGS+= -DLUA_USE_ASSERT\n#\n##############################################################################\n# You probably don't need to change anything below this line!\n##############################################################################\n\n##############################################################################\n# Flags and options for host and target.\n##############################################################################\n\n# You can override the following variables at the make command line:\n#   CC       HOST_CC       STATIC_CC       DYNAMIC_CC\n#   CFLAGS   HOST_CFLAGS   TARGET_CFLAGS\n#   LDFLAGS  HOST_LDFLAGS  TARGET_LDFLAGS  TARGET_SHLDFLAGS\n#   LIBS     HOST_LIBS     TARGET_LIBS\n#   CROSS    HOST_SYS      TARGET_SYS      TARGET_FLAGS\n#\n# Cross-compilation examples:\n#   make HOST_CC=\"gcc -m32\" CROSS=i586-mingw32msvc- TARGET_SYS=Windows\n#   make HOST_CC=\"gcc -m32\" CROSS=powerpc-linux-gnu-\n\nCCOPTIONS= $(CCDEBUG) $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS)\nLDOPTIONS= $(CCDEBUG) $(LDFLAGS)\n\nHOST_CC= $(CC)\nHOST_RM= rm -f\n# If left blank, minilua is built and used. You can supply an installed\n# copy of (plain) Lua 5.1 or 5.2, plus Lua BitOp. E.g. with: HOST_LUA=lua\nHOST_LUA=\n\nHOST_XCFLAGS= -I.\nHOST_XLDFLAGS=\nHOST_XLIBS=\nHOST_ACFLAGS= $(CCOPTIONS) $(HOST_XCFLAGS) $(TARGET_ARCH) $(HOST_CFLAGS)\nHOST_ALDFLAGS= $(LDOPTIONS) $(HOST_XLDFLAGS) $(HOST_LDFLAGS)\nHOST_ALIBS= $(HOST_XLIBS) $(LIBS) $(HOST_LIBS)\n\nSTATIC_CC = $(CROSS)$(CC)\nDYNAMIC_CC = $(CROSS)$(CC) -fPIC\nTARGET_CC= $(STATIC_CC)\nTARGET_STCC= $(STATIC_CC)\nTARGET_DYNCC= $(DYNAMIC_CC)\nTARGET_LD= $(CROSS)$(CC)\nTARGET_AR= $(CROSS)ar rcus\nTARGET_STRIP= $(CROSS)strip\n\nTARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER)\nTARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib\nTARGET_DYLIBPATH= $(or $(PREFIX),/usr/local)/lib/$(TARGET_DYLIBNAME)\nTARGET_DLLNAME= lua$(NODOTABIVER).dll\nTARGET_XSHLDFLAGS= -shared -fPIC -Wl,-soname,$(TARGET_SONAME)\nTARGET_DYNXLDOPTS=\n\nTARGET_LFSFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE\nTARGET_XCFLAGS= $(TARGET_LFSFLAGS) -U_FORTIFY_SOURCE\nTARGET_XLDFLAGS=\nTARGET_XLIBS= -lm\nTARGET_TCFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS)\nTARGET_ACFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS)\nTARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAGS)\nTARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS)\nTARGET_ALIBS= $(TARGET_XLIBS) $(LIBS) $(TARGET_LIBS)\n\nTARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_TCFLAGS) -E lj_arch.h -dM)\nifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH)))\n  TARGET_LJARCH= x64\nelse\nifneq (,$(findstring LJ_TARGET_X86 ,$(TARGET_TESTARCH)))\n  TARGET_LJARCH= x86\nelse\nifneq (,$(findstring LJ_TARGET_ARM ,$(TARGET_TESTARCH)))\n  TARGET_LJARCH= arm\nelse\nifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH)))\n  TARGET_LJARCH= ppc\nelse\nifneq (,$(findstring LJ_TARGET_PPCSPE ,$(TARGET_TESTARCH)))\n  TARGET_LJARCH= ppcspe\nelse\nifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH)))\n  ifneq (,$(findstring MIPSEL ,$(TARGET_TESTARCH)))\n    TARGET_ARCH= -D__MIPSEL__=1\n  endif\n  TARGET_LJARCH= mips\nelse\n  $(error Unsupported target architecture)\nendif\nendif\nendif\nendif\nendif\nendif\n\nifneq (,$(findstring LJ_TARGET_PS3 1,$(TARGET_TESTARCH)))\n  TARGET_SYS= PS3\n  TARGET_ARCH+= -D__CELLOS_LV2__\n  TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC\nendif\nifneq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH)))\n  TARGET_ARCH+= -DLUAJIT_NO_UNWIND\nendif\n\nTARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH))\nTARGET_ARCH+= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_LJARCH))\n\nifneq (,$(PREFIX))\nifneq (/usr/local,$(PREFIX))\n  TARGET_XCFLAGS+= -DLUA_XROOT=\\\"$(PREFIX)/\\\"\n  ifneq (/usr,$(PREFIX))\n    TARGET_DYNXLDOPTS= -Wl,-rpath,$(PREFIX)/lib\n  endif\nendif\nendif\n\n##############################################################################\n# System detection.\n##############################################################################\n\nifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM))\n  HOST_SYS= Windows\n  HOST_RM= del\nelse\n  HOST_SYS:= $(shell uname -s)\n  ifneq (,$(findstring MINGW,$(HOST_SYS)))\n    HOST_SYS= Windows\n    HOST_MSYS= mingw\n  endif\n  ifneq (,$(findstring CYGWIN,$(HOST_SYS)))\n    HOST_SYS= Windows\n    HOST_MSYS= cygwin\n  endif\nendif\n\nTARGET_SYS?= $(HOST_SYS)\nifeq (Windows,$(TARGET_SYS))\n  TARGET_STRIP+= --strip-unneeded\n  TARGET_XSHLDFLAGS= -shared\n  TARGET_DYNXLDOPTS=\nelse\nifeq (Darwin,$(TARGET_SYS))\n  ifeq (,$(MACOSX_DEPLOYMENT_TARGET))\n    export MACOSX_DEPLOYMENT_TARGET=10.4\n  endif\n  TARGET_STRIP+= -x\n  TARGET_AR+= 2>/dev/null\n  TARGET_XCFLAGS+= -fno-stack-protector\n  TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC\n  TARGET_DYNXLDOPTS=\n  TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)\n  ifeq (x64,$(TARGET_LJARCH))\n    TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000\n    TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000\n  endif\nelse\nifeq (iOS,$(TARGET_SYS))\n  TARGET_STRIP+= -x\n  TARGET_AR+= 2>/dev/null\n  TARGET_XCFLAGS+= -fno-stack-protector\n  TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC\n  TARGET_DYNXLDOPTS=\n  TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)\nelse\n  ifneq (,$(findstring stack-protector,$(shell $(TARGET_CC) -dumpspecs)))\n    TARGET_XCFLAGS+= -fno-stack-protector\n  endif\n  ifneq (SunOS,$(TARGET_SYS))\n    ifneq (PS3,$(TARGET_SYS))\n      TARGET_XLDFLAGS+= -Wl,-E\n    endif\n  endif\n  ifeq (Linux,$(TARGET_SYS))\n    TARGET_XLIBS+= -ldl\n  endif\n  ifeq (GNU/kFreeBSD,$(TARGET_SYS))\n    TARGET_XLIBS+= -ldl\n  endif\nendif\nendif\nendif\n\nifneq ($(HOST_SYS),$(TARGET_SYS))\n  ifeq (Windows,$(TARGET_SYS))\n    HOST_XCFLAGS+= -malign-double -DLUAJIT_OS=LUAJIT_OS_WINDOWS\n  else\n  ifeq (Linux,$(TARGET_SYS))\n    HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_LINUX\n  else\n  ifeq (Darwin,$(TARGET_SYS))\n    HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX\n  else\n  ifeq (iOS,$(TARGET_SYS))\n    HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX\n  else\n    HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OTHER\n  endif\n  endif\n  endif\n  endif\nendif\n\nifneq (,$(CCDEBUG))\n  TARGET_STRIP= @:\nendif\n\n##############################################################################\n# Files and pathnames.\n##############################################################################\n\nMINILUA_O= host/minilua.o\nMINILUA_LIBS= -lm\nMINILUA_T= host/minilua\nMINILUA_X= $(MINILUA_T)\n\nifeq (,$(HOST_LUA))\n  HOST_LUA= $(MINILUA_X)\n  DASM_DEP= $(MINILUA_T)\nendif\n\nDASM_DIR= ../dynasm\nDASM= $(HOST_LUA) $(DASM_DIR)/dynasm.lua\nDASM_XFLAGS=\nDASM_AFLAGS=\nDASM_ARCH= $(TARGET_LJARCH)\n\nifneq (,$(findstring LJ_ARCH_BITS 64,$(TARGET_TESTARCH)))\n  DASM_AFLAGS+= -D P64\nendif\nifneq (,$(findstring LJ_HASJIT 1,$(TARGET_TESTARCH)))\n  DASM_AFLAGS+= -D JIT\nendif\nifneq (,$(findstring LJ_HASFFI 1,$(TARGET_TESTARCH)))\n  DASM_AFLAGS+= -D FFI\nendif\nifneq (,$(findstring LJ_DUALNUM 1,$(TARGET_TESTARCH)))\n  DASM_AFLAGS+= -D DUALNUM\nendif\nifneq (,$(findstring LJ_ARCH_HASFPU 1,$(TARGET_TESTARCH)))\n  DASM_AFLAGS+= -D FPU\n  TARGET_ARCH+= -DLJ_ARCH_HASFPU=1\nelse\n  TARGET_ARCH+= -DLJ_ARCH_HASFPU=0\nendif\nifeq (,$(findstring LJ_ABI_SOFTFP 1,$(TARGET_TESTARCH)))\n  DASM_AFLAGS+= -D HFABI\n  TARGET_ARCH+= -DLJ_ABI_SOFTFP=0\nelse\n  TARGET_ARCH+= -DLJ_ABI_SOFTFP=1\nendif\nDASM_AFLAGS+= -D VER=$(subst LJ_ARCH_VERSION_,,$(filter LJ_ARCH_VERSION_%,$(subst LJ_ARCH_VERSION ,LJ_ARCH_VERSION_,$(TARGET_TESTARCH))))\nifeq (Windows,$(TARGET_SYS))\n  DASM_AFLAGS+= -D WIN\nendif\nifeq (x86,$(TARGET_LJARCH))\n  ifneq (,$(findstring __SSE2__ 1,$(TARGET_TESTARCH)))\n    DASM_AFLAGS+= -D SSE\n  endif\nelse\nifeq (x64,$(TARGET_LJARCH))\n  DASM_ARCH= x86\nelse\nifeq (arm,$(TARGET_LJARCH))\n  ifeq (iOS,$(TARGET_SYS))\n    DASM_AFLAGS+= -D IOS\n  endif\nelse\nifeq (ppc,$(TARGET_LJARCH))\n  ifneq (,$(findstring LJ_ARCH_SQRT 1,$(TARGET_TESTARCH)))\n    DASM_AFLAGS+= -D SQRT\n  endif\n  ifneq (,$(findstring LJ_ARCH_ROUND 1,$(TARGET_TESTARCH)))\n    DASM_AFLAGS+= -D ROUND\n  endif\n  ifneq (,$(findstring LJ_ARCH_PPC64 1,$(TARGET_TESTARCH)))\n    DASM_AFLAGS+= -D GPR64\n  endif\n  ifeq (PS3,$(TARGET_SYS))\n    DASM_AFLAGS+= -D PPE -D TOC\n  endif\nendif\nendif\nendif\nendif\n\nDASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS)\nDASM_DASC= vm_$(DASM_ARCH).dasc\n\nBUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \\\n\t   host/buildvm_lib.o host/buildvm_fold.o\nBUILDVM_T= host/buildvm\nBUILDVM_X= $(BUILDVM_T)\n\nHOST_O= $(MINILUA_O) $(BUILDVM_O)\nHOST_T= $(MINILUA_T) $(BUILDVM_T)\n\nLJVM_S= lj_vm.s\nLJVM_O= lj_vm.o\nLJVM_BOUT= $(LJVM_S)\nLJVM_MODE= elfasm\n\nLJLIB_O= lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o \\\n\t lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_ffi.o\nLJLIB_C= $(LJLIB_O:.o=.c)\n\nLJCORE_O= lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o \\\n\t  lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \\\n\t  lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o lj_strscan.o \\\n\t  lj_api.o lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o lj_load.o \\\n\t  lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o \\\n\t  lj_opt_dce.o lj_opt_loop.o lj_opt_split.o lj_opt_sink.o \\\n\t  lj_mcode.o lj_snap.o lj_record.o lj_crecord.o lj_ffrecord.o \\\n\t  lj_asm.o lj_trace.o lj_gdbjit.o \\\n\t  lj_ctype.o lj_cdata.o lj_cconv.o lj_ccall.o lj_ccallback.o \\\n\t  lj_carith.o lj_clib.o lj_cparse.o \\\n\t  lj_lib.o lj_alloc.o lib_aux.o \\\n\t  $(LJLIB_O) lib_init.o\n\nLJVMCORE_O= $(LJVM_O) $(LJCORE_O)\nLJVMCORE_DYNO= $(LJVMCORE_O:.o=_dyn.o)\n\nLIB_VMDEF= jit/vmdef.lua\nLIB_VMDEFP= $(LIB_VMDEF)\n\nLUAJIT_O= luajit.o\nLUAJIT_A= libluajit.a\nLUAJIT_SO= libluajit.so\nLUAJIT_T= luajit\n\nALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T)\nALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \\\n\t    host/buildvm_arch.h\nALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP)\nWIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk\nALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM)\n\n##############################################################################\n# Build mode handling.\n##############################################################################\n\n# Mixed mode defaults.\nTARGET_O= $(LUAJIT_A)\nTARGET_T= $(LUAJIT_T) $(LUAJIT_SO)\nTARGET_DEP= $(LIB_VMDEF) $(LUAJIT_SO)\n\nifeq (Windows,$(TARGET_SYS))\n  TARGET_DYNCC= $(STATIC_CC)\n  LJVM_MODE= coffasm\n  LUAJIT_T= luajit.exe\n  ifeq (cygwin,$(HOST_MSYS))\n    LUAJIT_SO= cyg$(TARGET_DLLNAME)\n  else\n    LUAJIT_SO= $(TARGET_DLLNAME)\n  endif\n  # Mixed mode is not supported on Windows. And static mode doesn't work well.\n  # C modules cannot be loaded, because they bind to lua51.dll.\n  ifneq (static,$(BUILDMODE))\n    BUILDMODE= dynamic\n    TARGET_XCFLAGS+= -DLUA_BUILD_AS_DLL\n  endif\nendif\nifeq (Darwin,$(TARGET_SYS))\n  LJVM_MODE= machasm\nendif\nifeq (iOS,$(TARGET_SYS))\n  LJVM_MODE= machasm\nendif\nifeq (SunOS,$(TARGET_SYS))\n  BUILDMODE= static\nendif\nifeq (PS3,$(TARGET_SYS))\n  BUILDMODE= static\nendif\n\nifeq (Windows,$(HOST_SYS))\n  MINILUA_T= host/minilua.exe\n  BUILDVM_T= host/buildvm.exe\n  ifeq (,$(HOST_MSYS))\n    MINILUA_X= host\\minilua\n    BUILDVM_X= host\\buildvm\n    ALL_RM:= $(subst /,\\,$(ALL_RM))\n  endif\nendif\n\nifeq (static,$(BUILDMODE))\n  TARGET_DYNCC= @:\n  TARGET_T= $(LUAJIT_T)\n  TARGET_DEP= $(LIB_VMDEF)\nelse\nifeq (dynamic,$(BUILDMODE))\n  ifneq (Windows,$(TARGET_SYS))\n    TARGET_CC= $(DYNAMIC_CC)\n  endif\n  TARGET_DYNCC= @:\n  LJVMCORE_DYNO= $(LJVMCORE_O)\n  TARGET_O= $(LUAJIT_SO)\n  TARGET_XLDFLAGS+= $(TARGET_DYNXLDOPTS)\nelse\nifeq (Darwin,$(TARGET_SYS))\n  TARGET_DYNCC= @:\n  LJVMCORE_DYNO= $(LJVMCORE_O)\nendif\nifeq (iOS,$(TARGET_SYS))\n  TARGET_DYNCC= @:\n  LJVMCORE_DYNO= $(LJVMCORE_O)\nendif\nendif\nendif\n\nQ= @\nE= @echo\n#Q=\n#E= @:\n\n##############################################################################\n# Make targets.\n##############################################################################\n\ndefault all:\t$(TARGET_T)\n\namalg:\n\t@grep \"^[+|]\" ljamalg.c\n\t$(MAKE) all \"LJCORE_O=ljamalg.o\"\n\nclean:\n\t$(HOST_RM) $(ALL_RM)\n\ndepend:\n\t@for file in $(ALL_HDRGEN); do \\\n\t  test -f $$file || touch $$file; \\\n\t  done\n\t@$(HOST_CC) $(HOST_ACFLAGS) -MM *.c host/*.c | \\\n\t  sed -e \"s| [^ ]*/dasm_\\S*\\.h||g\" \\\n\t      -e \"s|^\\([^l ]\\)|host/\\1|\" \\\n\t      -e \"s| lj_target_\\S*\\.h| lj_target_*.h|g\" \\\n\t      -e \"s| lj_emit_\\S*\\.h| lj_emit_*.h|g\" \\\n\t      -e \"s| lj_asm_\\S*\\.h| lj_asm_*.h|g\" >Makefile.dep\n\t@for file in $(ALL_HDRGEN); do \\\n\t  test -s $$file || $(HOST_RM) $$file; \\\n\t  done\n\n.PHONY: default all amalg clean depend\n\n##############################################################################\n# Rules for generated files.\n##############################################################################\n\n$(MINILUA_T): $(MINILUA_O)\n\t$(E) \"HOSTLINK  $@\"\n\t$(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS)\n\nhost/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP)\n\t$(E) \"DYNASM    $@\"\n\t$(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC)\n\nhost/buildvm.o: $(DASM_DIR)/dasm_*.h\n\n$(BUILDVM_T): $(BUILDVM_O)\n\t$(E) \"HOSTLINK  $@\"\n\t$(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(BUILDVM_O) $(HOST_ALIBS)\n\n$(LJVM_BOUT): $(BUILDVM_T)\n\t$(E) \"BUILDVM   $@\"\n\t$(Q)$(BUILDVM_X) -m $(LJVM_MODE) -o $@\n\nlj_bcdef.h: $(BUILDVM_T) $(LJLIB_C)\n\t$(E) \"BUILDVM   $@\"\n\t$(Q)$(BUILDVM_X) -m bcdef -o $@ $(LJLIB_C)\n\nlj_ffdef.h: $(BUILDVM_T) $(LJLIB_C)\n\t$(E) \"BUILDVM   $@\"\n\t$(Q)$(BUILDVM_X) -m ffdef -o $@ $(LJLIB_C)\n\nlj_libdef.h: $(BUILDVM_T) $(LJLIB_C)\n\t$(E) \"BUILDVM   $@\"\n\t$(Q)$(BUILDVM_X) -m libdef -o $@ $(LJLIB_C)\n\nlj_recdef.h: $(BUILDVM_T) $(LJLIB_C)\n\t$(E) \"BUILDVM   $@\"\n\t$(Q)$(BUILDVM_X) -m recdef -o $@ $(LJLIB_C)\n\n$(LIB_VMDEF): $(BUILDVM_T) $(LJLIB_C)\n\t$(E) \"BUILDVM   $@\"\n\t$(Q)$(BUILDVM_X) -m vmdef -o $(LIB_VMDEFP) $(LJLIB_C)\n\nlj_folddef.h: $(BUILDVM_T) lj_opt_fold.c\n\t$(E) \"BUILDVM   $@\"\n\t$(Q)$(BUILDVM_X) -m folddef -o $@ lj_opt_fold.c\n\n##############################################################################\n# Object file rules.\n##############################################################################\n\n%.o: %.c\n\t$(E) \"CC        $@\"\n\t$(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $<\n\t$(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $<\n\n%.o: %.s\n\t$(E) \"ASM       $@\"\n\t$(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $<\n\t$(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $<\n\n$(LUAJIT_O):\n\t$(E) \"CC        $@\"\n\t$(Q)$(TARGET_STCC) $(TARGET_ACFLAGS) -c -o $@ $<\n\n$(HOST_O): %.o: %.c\n\t$(E) \"HOSTCC    $@\"\n\t$(Q)$(HOST_CC) $(HOST_ACFLAGS) -c -o $@ $<\n\ninclude Makefile.dep\n\n##############################################################################\n# Target file rules.\n##############################################################################\n\n$(LUAJIT_A): $(LJVMCORE_O)\n\t$(E) \"AR        $@\"\n\t$(Q)$(TARGET_AR) $@ $(LJVMCORE_O)\n\n# The dependency on _O, but linking with _DYNO is intentional.\n$(LUAJIT_SO): $(LJVMCORE_O)\n\t$(E) \"DYNLINK   $@\"\n\t$(Q)$(TARGET_LD) $(TARGET_ASHLDFLAGS) -o $@ $(LJVMCORE_DYNO) $(TARGET_ALIBS)\n\t$(Q)$(TARGET_STRIP) $@\n\n$(LUAJIT_T): $(TARGET_O) $(LUAJIT_O) $(TARGET_DEP)\n\t$(E) \"LINK      $@\"\n\t$(Q)$(TARGET_LD) $(TARGET_ALDFLAGS) -o $@ $(LUAJIT_O) $(TARGET_O) $(TARGET_ALIBS)\n\t$(Q)$(TARGET_STRIP) $@\n\t$(E) \"OK        Successfully built LuaJIT\"\n\n##############################################################################\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/Makefile.dep",
    "content": "lib_aux.o: lib_aux.c lua.h luaconf.h lauxlib.h lj_obj.h lj_def.h \\\n lj_arch.h lj_err.h lj_errmsg.h lj_state.h lj_trace.h lj_jit.h lj_ir.h \\\n lj_dispatch.h lj_bc.h lj_traceerr.h lj_lib.h lj_alloc.h\nlib_base.o: lib_base.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \\\n lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h \\\n lj_tab.h lj_meta.h lj_state.h lj_ctype.h lj_cconv.h lj_bc.h lj_ff.h \\\n lj_ffdef.h lj_dispatch.h lj_jit.h lj_ir.h lj_char.h lj_strscan.h \\\n lj_lib.h lj_libdef.h\nlib_bit.o: lib_bit.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \\\n lj_arch.h lj_err.h lj_errmsg.h lj_str.h lj_lib.h lj_libdef.h\nlib_debug.o: lib_debug.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \\\n lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_lib.h \\\n lj_libdef.h\nlib_ffi.o: lib_ffi.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \\\n lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_meta.h \\\n lj_ctype.h lj_cparse.h lj_cdata.h lj_cconv.h lj_carith.h lj_ccall.h \\\n lj_ccallback.h lj_clib.h lj_ff.h lj_ffdef.h lj_lib.h lj_libdef.h\nlib_init.o: lib_init.c lua.h luaconf.h lauxlib.h lualib.h lj_arch.h\nlib_io.o: lib_io.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \\\n lj_arch.h lj_err.h lj_errmsg.h lj_str.h lj_state.h lj_ff.h lj_ffdef.h \\\n lj_lib.h lj_libdef.h\nlib_jit.o: lib_jit.c lua.h luaconf.h lauxlib.h lualib.h lj_arch.h \\\n lj_obj.h lj_def.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h \\\n lj_bc.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_target.h \\\n lj_target_*.h lj_dispatch.h lj_vm.h lj_vmevent.h lj_lib.h luajit.h \\\n lj_libdef.h\nlib_math.o: lib_math.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \\\n lj_def.h lj_arch.h lj_lib.h lj_vm.h lj_libdef.h\nlib_os.o: lib_os.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h lj_def.h \\\n lj_arch.h lj_err.h lj_errmsg.h lj_lib.h lj_libdef.h\nlib_package.o: lib_package.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \\\n lj_def.h lj_arch.h lj_err.h lj_errmsg.h lj_lib.h\nlib_string.o: lib_string.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \\\n lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h \\\n lj_meta.h lj_state.h lj_ff.h lj_ffdef.h lj_bcdump.h lj_lex.h lj_char.h \\\n lj_lib.h lj_libdef.h\nlib_table.o: lib_table.c lua.h luaconf.h lauxlib.h lualib.h lj_obj.h \\\n lj_def.h lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_tab.h lj_lib.h \\\n lj_libdef.h\nlj_alloc.o: lj_alloc.c lj_def.h lua.h luaconf.h lj_arch.h lj_alloc.h\nlj_api.o: lj_api.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_func.h lj_udata.h \\\n lj_meta.h lj_state.h lj_bc.h lj_frame.h lj_trace.h lj_jit.h lj_ir.h \\\n lj_dispatch.h lj_traceerr.h lj_vm.h lj_strscan.h\nlj_asm.o: lj_asm.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ctype.h lj_ir.h lj_jit.h \\\n lj_ircall.h lj_iropt.h lj_mcode.h lj_trace.h lj_dispatch.h lj_traceerr.h \\\n lj_snap.h lj_asm.h lj_vm.h lj_target.h lj_target_*.h lj_emit_*.h \\\n lj_asm_*.h\nlj_bc.o: lj_bc.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_bc.h \\\n lj_bcdef.h\nlj_bcread.o: lj_bcread.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_bc.h lj_ctype.h \\\n lj_cdata.h lualib.h lj_lex.h lj_bcdump.h lj_state.h\nlj_bcwrite.o: lj_bcwrite.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_str.h lj_bc.h lj_ctype.h lj_dispatch.h lj_jit.h lj_ir.h \\\n lj_bcdump.h lj_lex.h lj_err.h lj_errmsg.h lj_vm.h\nlj_carith.o: lj_carith.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_tab.h lj_meta.h lj_ctype.h lj_cconv.h \\\n lj_cdata.h lj_carith.h\nlj_ccall.o: lj_ccall.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_cconv.h \\\n lj_cdata.h lj_ccall.h lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_bc.h \\\n lj_traceerr.h\nlj_ccallback.o: lj_ccallback.c lj_obj.h lua.h luaconf.h lj_def.h \\\n lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_tab.h lj_state.h lj_frame.h \\\n lj_bc.h lj_ctype.h lj_cconv.h lj_ccall.h lj_ccallback.h lj_target.h \\\n lj_target_*.h lj_mcode.h lj_jit.h lj_ir.h lj_trace.h lj_dispatch.h \\\n lj_traceerr.h lj_vm.h\nlj_cconv.o: lj_cconv.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_err.h lj_errmsg.h lj_tab.h lj_ctype.h lj_gc.h lj_cdata.h lj_cconv.h \\\n lj_ccallback.h\nlj_cdata.o: lj_cdata.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_cconv.h \\\n lj_cdata.h\nlj_char.o: lj_char.c lj_char.h lj_def.h lua.h luaconf.h\nlj_clib.o: lj_clib.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_err.h lj_errmsg.h lj_tab.h lj_str.h lj_udata.h lj_ctype.h lj_cconv.h \\\n lj_cdata.h lj_clib.h\nlj_cparse.o: lj_cparse.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_ctype.h lj_cparse.h lj_frame.h \\\n lj_bc.h lj_vm.h lj_char.h lj_strscan.h\nlj_crecord.o: lj_crecord.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ctype.h \\\n lj_gc.h lj_cdata.h lj_cparse.h lj_cconv.h lj_clib.h lj_ccall.h lj_ff.h \\\n lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \\\n lj_dispatch.h lj_traceerr.h lj_record.h lj_ffrecord.h lj_snap.h \\\n lj_crecord.h\nlj_ctype.o: lj_ctype.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_ccallback.h\nlj_debug.o: lj_debug.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_state.h lj_frame.h \\\n lj_bc.h lj_jit.h lj_ir.h\nlj_dispatch.o: lj_dispatch.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_err.h lj_errmsg.h lj_func.h lj_str.h lj_tab.h lj_meta.h lj_debug.h \\\n lj_state.h lj_frame.h lj_bc.h lj_ff.h lj_ffdef.h lj_jit.h lj_ir.h \\\n lj_ccallback.h lj_ctype.h lj_gc.h lj_trace.h lj_dispatch.h lj_traceerr.h \\\n lj_vm.h luajit.h\nlj_err.o: lj_err.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_err.h \\\n lj_errmsg.h lj_debug.h lj_str.h lj_func.h lj_state.h lj_frame.h lj_bc.h \\\n lj_ff.h lj_ffdef.h lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h \\\n lj_traceerr.h lj_vm.h\nlj_ffrecord.o: lj_ffrecord.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_frame.h lj_bc.h lj_ff.h \\\n lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \\\n lj_dispatch.h lj_traceerr.h lj_record.h lj_ffrecord.h lj_crecord.h \\\n lj_vm.h lj_strscan.h lj_recdef.h\nlj_func.o: lj_func.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_func.h lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_bc.h \\\n lj_traceerr.h lj_vm.h\nlj_gc.o: lj_gc.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h lj_udata.h lj_meta.h \\\n lj_state.h lj_frame.h lj_bc.h lj_ctype.h lj_cdata.h lj_trace.h lj_jit.h \\\n lj_ir.h lj_dispatch.h lj_traceerr.h lj_vm.h\nlj_gdbjit.o: lj_gdbjit.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_frame.h lj_bc.h lj_jit.h \\\n lj_ir.h lj_dispatch.h\nlj_ir.o: lj_ir.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_str.h lj_tab.h lj_ir.h lj_jit.h lj_ircall.h lj_iropt.h lj_trace.h \\\n lj_dispatch.h lj_bc.h lj_traceerr.h lj_ctype.h lj_cdata.h lj_carith.h \\\n lj_vm.h lj_strscan.h lj_lib.h\nlj_lex.o: lj_lex.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_ctype.h lj_cdata.h lualib.h \\\n lj_state.h lj_lex.h lj_parse.h lj_char.h lj_strscan.h\nlj_lib.o: lj_lib.c lauxlib.h lua.h luaconf.h lj_obj.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h lj_bc.h \\\n lj_dispatch.h lj_jit.h lj_ir.h lj_vm.h lj_strscan.h lj_lib.h\nlj_load.o: lj_load.c lua.h luaconf.h lauxlib.h lj_obj.h lj_def.h \\\n lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_func.h lj_frame.h \\\n lj_bc.h lj_vm.h lj_lex.h lj_bcdump.h lj_parse.h\nlj_mcode.o: lj_mcode.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_jit.h lj_ir.h lj_mcode.h lj_trace.h lj_dispatch.h lj_bc.h \\\n lj_traceerr.h lj_vm.h\nlj_meta.o: lj_meta.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_meta.h lj_frame.h lj_bc.h \\\n lj_vm.h lj_strscan.h\nlj_obj.o: lj_obj.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h\nlj_opt_dce.o: lj_opt_dce.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_ir.h lj_jit.h lj_iropt.h\nlj_opt_fold.o: lj_opt_fold.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_str.h lj_tab.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h lj_dispatch.h \\\n lj_bc.h lj_traceerr.h lj_ctype.h lj_gc.h lj_carith.h lj_vm.h \\\n lj_strscan.h lj_folddef.h\nlj_opt_loop.o: lj_opt_loop.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h \\\n lj_dispatch.h lj_bc.h lj_traceerr.h lj_snap.h lj_vm.h\nlj_opt_mem.o: lj_opt_mem.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_tab.h lj_ir.h lj_jit.h lj_iropt.h\nlj_opt_narrow.o: lj_opt_narrow.c lj_obj.h lua.h luaconf.h lj_def.h \\\n lj_arch.h lj_bc.h lj_ir.h lj_jit.h lj_iropt.h lj_trace.h lj_dispatch.h \\\n lj_traceerr.h lj_vm.h lj_strscan.h\nlj_opt_sink.o: lj_opt_sink.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_ir.h lj_jit.h lj_iropt.h lj_target.h lj_target_*.h\nlj_opt_split.o: lj_opt_split.c lj_obj.h lua.h luaconf.h lj_def.h \\\n lj_arch.h lj_err.h lj_errmsg.h lj_str.h lj_ir.h lj_jit.h lj_ircall.h \\\n lj_iropt.h lj_vm.h\nlj_parse.o: lj_parse.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_func.h \\\n lj_state.h lj_bc.h lj_ctype.h lj_lex.h lj_parse.h lj_vm.h lj_vmevent.h\nlj_record.o: lj_record.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_meta.h lj_frame.h lj_bc.h \\\n lj_ctype.h lj_gc.h lj_ff.h lj_ffdef.h lj_ir.h lj_jit.h lj_ircall.h \\\n lj_iropt.h lj_trace.h lj_dispatch.h lj_traceerr.h lj_record.h \\\n lj_ffrecord.h lj_snap.h lj_vm.h\nlj_snap.o: lj_snap.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_tab.h lj_state.h lj_frame.h lj_bc.h lj_ir.h lj_jit.h lj_iropt.h \\\n lj_trace.h lj_dispatch.h lj_traceerr.h lj_snap.h lj_target.h \\\n lj_target_*.h lj_ctype.h lj_cdata.h\nlj_state.o: lj_state.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h lj_meta.h \\\n lj_state.h lj_frame.h lj_bc.h lj_ctype.h lj_trace.h lj_jit.h lj_ir.h \\\n lj_dispatch.h lj_traceerr.h lj_vm.h lj_lex.h lj_alloc.h\nlj_str.o: lj_str.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_err.h lj_errmsg.h lj_str.h lj_state.h lj_char.h\nlj_strscan.o: lj_strscan.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_char.h lj_strscan.h\nlj_tab.o: lj_tab.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_gc.h \\\n lj_err.h lj_errmsg.h lj_tab.h\nlj_trace.o: lj_trace.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_frame.h lj_bc.h \\\n lj_state.h lj_ir.h lj_jit.h lj_iropt.h lj_mcode.h lj_trace.h \\\n lj_dispatch.h lj_traceerr.h lj_snap.h lj_gdbjit.h lj_record.h lj_asm.h \\\n lj_vm.h lj_vmevent.h lj_target.h lj_target_*.h\nlj_udata.o: lj_udata.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_gc.h lj_udata.h\nlj_vmevent.o: lj_vmevent.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_str.h lj_tab.h lj_state.h lj_dispatch.h lj_bc.h lj_jit.h lj_ir.h \\\n lj_vm.h lj_vmevent.h\nlj_vmmath.o: lj_vmmath.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \\\n lj_ir.h lj_vm.h\nljamalg.o: ljamalg.c lua.h luaconf.h lauxlib.h lj_gc.c lj_obj.h lj_def.h \\\n lj_arch.h lj_gc.h lj_err.h lj_errmsg.h lj_str.h lj_tab.h lj_func.h \\\n lj_udata.h lj_meta.h lj_state.h lj_frame.h lj_bc.h lj_ctype.h lj_cdata.h \\\n lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_traceerr.h lj_vm.h lj_err.c \\\n lj_debug.h lj_ff.h lj_ffdef.h lj_char.c lj_char.h lj_bc.c lj_bcdef.h \\\n lj_obj.c lj_str.c lj_tab.c lj_func.c lj_udata.c lj_meta.c lj_strscan.h \\\n lj_debug.c lj_state.c lj_lex.h lj_alloc.h lj_dispatch.c lj_ccallback.h \\\n luajit.h lj_vmevent.c lj_vmevent.h lj_vmmath.c lj_strscan.c lj_api.c \\\n lj_lex.c lualib.h lj_parse.h lj_parse.c lj_bcread.c lj_bcdump.h \\\n lj_bcwrite.c lj_load.c lj_ctype.c lj_cdata.c lj_cconv.h lj_cconv.c \\\n lj_ccall.c lj_ccall.h lj_ccallback.c lj_target.h lj_target_*.h \\\n lj_mcode.h lj_carith.c lj_carith.h lj_clib.c lj_clib.h lj_cparse.c \\\n lj_cparse.h lj_lib.c lj_lib.h lj_ir.c lj_ircall.h lj_iropt.h \\\n lj_opt_mem.c lj_opt_fold.c lj_folddef.h lj_opt_narrow.c lj_opt_dce.c \\\n lj_opt_loop.c lj_snap.h lj_opt_split.c lj_opt_sink.c lj_mcode.c \\\n lj_snap.c lj_record.c lj_record.h lj_ffrecord.h lj_crecord.c \\\n lj_crecord.h lj_ffrecord.c lj_recdef.h lj_asm.c lj_asm.h lj_emit_*.h \\\n lj_asm_*.h lj_trace.c lj_gdbjit.h lj_gdbjit.c lj_alloc.c lib_aux.c \\\n lib_base.c lj_libdef.h lib_math.c lib_string.c lib_table.c lib_io.c \\\n lib_os.c lib_package.c lib_debug.c lib_bit.c lib_jit.c lib_ffi.c \\\n lib_init.c\nluajit.o: luajit.c lua.h luaconf.h lauxlib.h lualib.h luajit.h lj_arch.h\nhost/buildvm.o: host/buildvm.c host/buildvm.h lj_def.h lua.h luaconf.h \\\n lj_arch.h lj_obj.h lj_def.h lj_arch.h lj_gc.h lj_obj.h lj_bc.h lj_ir.h \\\n lj_ircall.h lj_ir.h lj_jit.h lj_frame.h lj_bc.h lj_dispatch.h lj_ctype.h \\\n lj_gc.h lj_ccall.h lj_ctype.h luajit.h \\\n host/buildvm_arch.h lj_traceerr.h\nhost/buildvm_asm.o: host/buildvm_asm.c host/buildvm.h lj_def.h lua.h luaconf.h \\\n lj_arch.h lj_bc.h lj_def.h lj_arch.h\nhost/buildvm_fold.o: host/buildvm_fold.c host/buildvm.h lj_def.h lua.h \\\n luaconf.h lj_arch.h lj_obj.h lj_def.h lj_arch.h lj_ir.h lj_obj.h\nhost/buildvm_lib.o: host/buildvm_lib.c host/buildvm.h lj_def.h lua.h luaconf.h \\\n lj_arch.h lj_obj.h lj_def.h lj_arch.h lj_lib.h lj_obj.h\nhost/buildvm_peobj.o: host/buildvm_peobj.c host/buildvm.h lj_def.h lua.h \\\n luaconf.h lj_arch.h lj_bc.h lj_def.h lj_arch.h\nhost/minilua.o: host/minilua.c\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/README",
    "content": "The files in this directory are only used during the build process of LuaJIT.\nFor cross-compilation, they must be executed on the host, not on the target.\n\nThese files should NOT be installed!\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/buildvm.c",
    "content": "/*\n** LuaJIT VM builder.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** This is a tool to build the hand-tuned assembler code required for\n** LuaJIT's bytecode interpreter. It supports a variety of output formats\n** to feed different toolchains (see usage() below).\n**\n** This tool is not particularly optimized because it's only used while\n** _building_ LuaJIT. There's no point in distributing or installing it.\n** Only the object code generated by this tool is linked into LuaJIT.\n**\n** Caveat: some memory is not free'd, error handling is lazy.\n** It's a one-shot tool -- any effort fixing this would be wasted.\n*/\n\n#include \"buildvm.h\"\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_bc.h\"\n#include \"lj_ir.h\"\n#include \"lj_ircall.h\"\n#include \"lj_frame.h\"\n#include \"lj_dispatch.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#include \"lj_ccall.h\"\n#endif\n#include \"luajit.h\"\n\n#if defined(_WIN32)\n#include <fcntl.h>\n#include <io.h>\n#endif\n\n/* ------------------------------------------------------------------------ */\n\n/* DynASM glue definitions. */\n#define Dst\t\tctx\n#define Dst_DECL\tBuildCtx *ctx\n#define Dst_REF\t\t(ctx->D)\n#define DASM_CHECKS\t1\n\n#include \"../dynasm/dasm_proto.h\"\n\n/* Glue macros for DynASM. */\nstatic int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type);\n\n#define DASM_EXTERN(ctx, addr, idx, type) \\\n  collect_reloc(ctx, addr, idx, type)\n\n/* ------------------------------------------------------------------------ */\n\n/* Avoid trouble if cross-compiling for an x86 target. Speed doesn't matter. */\n#define DASM_ALIGNED_WRITES\t1\n\n/* Embed architecture-specific DynASM encoder. */\n#if LJ_TARGET_X86ORX64\n#include \"../dynasm/dasm_x86.h\"\n#elif LJ_TARGET_ARM\n#include \"../dynasm/dasm_arm.h\"\n#elif LJ_TARGET_PPC\n#include \"../dynasm/dasm_ppc.h\"\n#elif LJ_TARGET_PPCSPE\n#include \"../dynasm/dasm_ppc.h\"\n#elif LJ_TARGET_MIPS\n#include \"../dynasm/dasm_mips.h\"\n#else\n#error \"No support for this architecture (yet)\"\n#endif\n\n/* Embed generated architecture-specific backend. */\n#include \"buildvm_arch.h\"\n\n/* ------------------------------------------------------------------------ */\n\nvoid owrite(BuildCtx *ctx, const void *ptr, size_t sz)\n{\n  if (fwrite(ptr, 1, sz, ctx->fp) != sz) {\n    fprintf(stderr, \"Error: cannot write to output file: %s\\n\",\n\t    strerror(errno));\n    exit(1);\n  }\n}\n\n/* ------------------------------------------------------------------------ */\n\n/* Emit code as raw bytes. Only used for DynASM debugging. */\nstatic void emit_raw(BuildCtx *ctx)\n{\n  owrite(ctx, ctx->code, ctx->codesz);\n}\n\n/* -- Build machine code -------------------------------------------------- */\n\nstatic const char *sym_decorate(BuildCtx *ctx,\n\t\t\t\tconst char *prefix, const char *suffix)\n{\n  char name[256];\n  char *p;\n#if LJ_64\n  const char *symprefix = ctx->mode == BUILD_machasm ? \"_\" : \"\";\n#elif LJ_TARGET_XBOX360\n  const char *symprefix = \"\";\n#else\n  const char *symprefix = ctx->mode != BUILD_elfasm ? \"_\" : \"\";\n#endif\n  sprintf(name, \"%s%s%s\", symprefix, prefix, suffix);\n  p = strchr(name, '@');\n  if (p) {\n    if (!LJ_64 && (ctx->mode == BUILD_coffasm || ctx->mode == BUILD_peobj))\n      name[0] = '@';\n    else\n      *p = '\\0';\n  }\n  p = (char *)malloc(strlen(name)+1);  /* MSVC doesn't like strdup. */\n  strcpy(p, name);\n  return p;\n}\n\n#define NRELOCSYM\t(sizeof(extnames)/sizeof(extnames[0])-1)\n\nstatic int relocmap[NRELOCSYM];\n\n/* Collect external relocations. */\nstatic int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type)\n{\n  if (ctx->nreloc >= BUILD_MAX_RELOC) {\n    fprintf(stderr, \"Error: too many relocations, increase BUILD_MAX_RELOC.\\n\");\n    exit(1);\n  }\n  if (relocmap[idx] < 0) {\n    relocmap[idx] = ctx->nrelocsym;\n    ctx->relocsym[ctx->nrelocsym] = sym_decorate(ctx, \"\", extnames[idx]);\n    ctx->nrelocsym++;\n  }\n  ctx->reloc[ctx->nreloc].ofs = (int32_t)(addr - ctx->code);\n  ctx->reloc[ctx->nreloc].sym = relocmap[idx];\n  ctx->reloc[ctx->nreloc].type = type;\n  ctx->nreloc++;\n#if LJ_TARGET_XBOX360\n  return (int)(ctx->code - addr) + 4;  /* Encode symbol offset of .text. */\n#else\n  return 0;  /* Encode symbol offset of 0. */\n#endif\n}\n\n/* Naive insertion sort. Performance doesn't matter here. */\nstatic void sym_insert(BuildCtx *ctx, int32_t ofs,\n\t\t       const char *prefix, const char *suffix)\n{\n  ptrdiff_t i = ctx->nsym++;\n  while (i > 0) {\n    if (ctx->sym[i-1].ofs <= ofs)\n      break;\n    ctx->sym[i] = ctx->sym[i-1];\n    i--;\n  }\n  ctx->sym[i].ofs = ofs;\n  ctx->sym[i].name = sym_decorate(ctx, prefix, suffix);\n}\n\n/* Build the machine code. */\nstatic int build_code(BuildCtx *ctx)\n{\n  int status;\n  int i;\n\n  /* Initialize DynASM structures. */\n  ctx->nglob = GLOB__MAX;\n  ctx->glob = (void **)malloc(ctx->nglob*sizeof(void *));\n  memset(ctx->glob, 0, ctx->nglob*sizeof(void *));\n  ctx->nreloc = 0;\n\n  ctx->globnames = globnames;\n  ctx->relocsym = (const char **)malloc(NRELOCSYM*sizeof(const char *));\n  ctx->nrelocsym = 0;\n  for (i = 0; i < (int)NRELOCSYM; i++) relocmap[i] = -1;\n\n  ctx->dasm_ident = DASM_IDENT;\n  ctx->dasm_arch = DASM_ARCH;\n\n  dasm_init(Dst, DASM_MAXSECTION);\n  dasm_setupglobal(Dst, ctx->glob, ctx->nglob);\n  dasm_setup(Dst, build_actionlist);\n\n  /* Call arch-specific backend to emit the code. */\n  ctx->npc = build_backend(ctx);\n\n  /* Finalize the code. */\n  (void)dasm_checkstep(Dst, -1);\n  if ((status = dasm_link(Dst, &ctx->codesz))) return status;\n  ctx->code = (uint8_t *)malloc(ctx->codesz);\n  if ((status = dasm_encode(Dst, (void *)ctx->code))) return status;\n\n  /* Allocate symbol table and bytecode offsets. */\n  ctx->beginsym = sym_decorate(ctx, \"\", LABEL_PREFIX \"vm_asm_begin\");\n  ctx->sym = (BuildSym *)malloc((ctx->npc+ctx->nglob+1)*sizeof(BuildSym));\n  ctx->nsym = 0;\n  ctx->bc_ofs = (int32_t *)malloc(ctx->npc*sizeof(int32_t));\n\n  /* Collect the opcodes (PC labels). */\n  for (i = 0; i < ctx->npc; i++) {\n    int32_t ofs = dasm_getpclabel(Dst, i);\n    if (ofs < 0) return 0x22000000|i;\n    ctx->bc_ofs[i] = ofs;\n    if ((LJ_HASJIT ||\n\t !(i == BC_JFORI || i == BC_JFORL || i == BC_JITERL || i == BC_JLOOP ||\n\t   i == BC_IFORL || i == BC_IITERL || i == BC_ILOOP)) &&\n\t(LJ_HASFFI || i != BC_KCDATA))\n      sym_insert(ctx, ofs, LABEL_PREFIX_BC, bc_names[i]);\n  }\n\n  /* Collect the globals (named labels). */\n  for (i = 0; i < ctx->nglob; i++) {\n    const char *gl = globnames[i];\n    int len = (int)strlen(gl);\n    if (!ctx->glob[i]) {\n      fprintf(stderr, \"Error: undefined global %s\\n\", gl);\n      exit(2);\n    }\n    /* Skip the _Z symbols. */\n    if (!(len >= 2 && gl[len-2] == '_' && gl[len-1] == 'Z'))\n      sym_insert(ctx, (int32_t)((uint8_t *)(ctx->glob[i]) - ctx->code),\n\t\t LABEL_PREFIX, globnames[i]);\n  }\n\n  /* Close the address range. */\n  sym_insert(ctx, (int32_t)ctx->codesz, \"\", \"\");\n  ctx->nsym--;\n\n  dasm_free(Dst);\n\n  return 0;\n}\n\n/* -- Generate VM enums --------------------------------------------------- */\n\nconst char *const bc_names[] = {\n#define BCNAME(name, ma, mb, mc, mt)       #name,\nBCDEF(BCNAME)\n#undef BCNAME\n  NULL\n};\n\nconst char *const ir_names[] = {\n#define IRNAME(name, m, m1, m2)\t#name,\nIRDEF(IRNAME)\n#undef IRNAME\n  NULL\n};\n\nconst char *const irt_names[] = {\n#define IRTNAME(name, size)\t#name,\nIRTDEF(IRTNAME)\n#undef IRTNAME\n  NULL\n};\n\nconst char *const irfpm_names[] = {\n#define FPMNAME(name)\t\t#name,\nIRFPMDEF(FPMNAME)\n#undef FPMNAME\n  NULL\n};\n\nconst char *const irfield_names[] = {\n#define FLNAME(name, ofs)\t#name,\nIRFLDEF(FLNAME)\n#undef FLNAME\n  NULL\n};\n\nconst char *const ircall_names[] = {\n#define IRCALLNAME(cond, name, nargs, kind, type, flags)\t#name,\nIRCALLDEF(IRCALLNAME)\n#undef IRCALLNAME\n  NULL\n};\n\nstatic const char *const trace_errors[] = {\n#define TREDEF(name, msg)\tmsg,\n#include \"lj_traceerr.h\"\n  NULL\n};\n\nstatic const char *lower(char *buf, const char *s)\n{\n  char *p = buf;\n  while (*s) {\n    *p++ = (*s >= 'A' && *s <= 'Z') ? *s+0x20 : *s;\n    s++;\n  }\n  *p = '\\0';\n  return buf;\n}\n\n/* Emit C source code for bytecode-related definitions. */\nstatic void emit_bcdef(BuildCtx *ctx)\n{\n  int i;\n  fprintf(ctx->fp, \"/* This is a generated file. DO NOT EDIT! */\\n\\n\");\n  fprintf(ctx->fp, \"LJ_DATADEF const uint16_t lj_bc_ofs[] = {\\n\");\n  for (i = 0; i < ctx->npc; i++) {\n    if (i != 0)\n      fprintf(ctx->fp, \",\\n\");\n    fprintf(ctx->fp, \"%d\", ctx->bc_ofs[i]);\n  }\n}\n\n/* Emit VM definitions as Lua code for debug modules. */\nstatic void emit_vmdef(BuildCtx *ctx)\n{\n  char buf[80];\n  int i;\n  fprintf(ctx->fp, \"-- This is a generated file. DO NOT EDIT!\\n\\n\");\n  fprintf(ctx->fp, \"module(...)\\n\\n\");\n\n  fprintf(ctx->fp, \"bcnames = \\\"\");\n  for (i = 0; bc_names[i]; i++) fprintf(ctx->fp, \"%-6s\", bc_names[i]);\n  fprintf(ctx->fp, \"\\\"\\n\\n\");\n\n  fprintf(ctx->fp, \"irnames = \\\"\");\n  for (i = 0; ir_names[i]; i++) fprintf(ctx->fp, \"%-6s\", ir_names[i]);\n  fprintf(ctx->fp, \"\\\"\\n\\n\");\n\n  fprintf(ctx->fp, \"irfpm = { [0]=\");\n  for (i = 0; irfpm_names[i]; i++)\n    fprintf(ctx->fp, \"\\\"%s\\\", \", lower(buf, irfpm_names[i]));\n  fprintf(ctx->fp, \"}\\n\\n\");\n\n  fprintf(ctx->fp, \"irfield = { [0]=\");\n  for (i = 0; irfield_names[i]; i++) {\n    char *p;\n    lower(buf, irfield_names[i]);\n    p = strchr(buf, '_');\n    if (p) *p = '.';\n    fprintf(ctx->fp, \"\\\"%s\\\", \", buf);\n  }\n  fprintf(ctx->fp, \"}\\n\\n\");\n\n  fprintf(ctx->fp, \"ircall = {\\n[0]=\");\n  for (i = 0; ircall_names[i]; i++)\n    fprintf(ctx->fp, \"\\\"%s\\\",\\n\", ircall_names[i]);\n  fprintf(ctx->fp, \"}\\n\\n\");\n\n  fprintf(ctx->fp, \"traceerr = {\\n[0]=\");\n  for (i = 0; trace_errors[i]; i++)\n    fprintf(ctx->fp, \"\\\"%s\\\",\\n\", trace_errors[i]);\n  fprintf(ctx->fp, \"}\\n\\n\");\n}\n\n/* -- Argument parsing ---------------------------------------------------- */\n\n/* Build mode names. */\nstatic const char *const modenames[] = {\n#define BUILDNAME(name)\t\t#name,\nBUILDDEF(BUILDNAME)\n#undef BUILDNAME\n  NULL\n};\n\n/* Print usage information and exit. */\nstatic void usage(void)\n{\n  int i;\n  fprintf(stderr, LUAJIT_VERSION \" VM builder.\\n\");\n  fprintf(stderr, LUAJIT_COPYRIGHT \", \" LUAJIT_URL \"\\n\");\n  fprintf(stderr, \"Target architecture: \" LJ_ARCH_NAME \"\\n\\n\");\n  fprintf(stderr, \"Usage: buildvm -m mode [-o outfile] [infiles...]\\n\\n\");\n  fprintf(stderr, \"Available modes:\\n\");\n  for (i = 0; i < BUILD__MAX; i++)\n    fprintf(stderr, \"  %s\\n\", modenames[i]);\n  exit(1);\n}\n\n/* Parse the output mode name. */\nstatic BuildMode parsemode(const char *mode)\n{\n  int i;\n  for (i = 0; modenames[i]; i++)\n    if (!strcmp(mode, modenames[i]))\n      return (BuildMode)i;\n  usage();\n  return (BuildMode)-1;\n}\n\n/* Parse arguments. */\nstatic void parseargs(BuildCtx *ctx, char **argv)\n{\n  const char *a;\n  int i;\n  ctx->mode = (BuildMode)-1;\n  ctx->outname = \"-\";\n  for (i = 1; (a = argv[i]) != NULL; i++) {\n    if (a[0] != '-')\n      break;\n    switch (a[1]) {\n    case '-':\n      if (a[2]) goto err;\n      i++;\n      goto ok;\n    case '\\0':\n      goto ok;\n    case 'm':\n      i++;\n      if (a[2] || argv[i] == NULL) goto err;\n      ctx->mode = parsemode(argv[i]);\n      break;\n    case 'o':\n      i++;\n      if (a[2] || argv[i] == NULL) goto err;\n      ctx->outname = argv[i];\n      break;\n    default: err:\n      usage();\n      break;\n    }\n  }\nok:\n  ctx->args = argv+i;\n  if (ctx->mode == (BuildMode)-1) goto err;\n}\n\nint main(int argc, char **argv)\n{\n  BuildCtx ctx_;\n  BuildCtx *ctx = &ctx_;\n  int status, binmode;\n\n  if (sizeof(void *) != 4*LJ_32+8*LJ_64) {\n    fprintf(stderr,\"Error: pointer size mismatch in cross-build.\\n\");\n    fprintf(stderr,\"Try: make HOST_CC=\\\"gcc -m32\\\" CROSS=...\\n\\n\");\n    return 1;\n  }\n\n  UNUSED(argc);\n  parseargs(ctx, argv);\n\n  if ((status = build_code(ctx))) {\n    fprintf(stderr,\"Error: DASM error %08x\\n\", status);\n    return 1;\n  }\n\n  switch (ctx->mode) {\n  case BUILD_peobj:\n  case BUILD_raw:\n    binmode = 1;\n    break;\n  default:\n    binmode = 0;\n    break;\n  }\n\n  if (ctx->outname[0] == '-' && ctx->outname[1] == '\\0') {\n    ctx->fp = stdout;\n#if defined(_WIN32)\n    if (binmode)\n      _setmode(_fileno(stdout), _O_BINARY);  /* Yuck. */\n#endif\n  } else if (!(ctx->fp = fopen(ctx->outname, binmode ? \"wb\" : \"w\"))) {\n    fprintf(stderr, \"Error: cannot open output file '%s': %s\\n\",\n\t    ctx->outname, strerror(errno));\n    exit(1);\n  }\n\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n  case BUILD_coffasm:\n  case BUILD_machasm:\n    emit_asm(ctx);\n    emit_asm_debug(ctx);\n    break;\n  case BUILD_peobj:\n    emit_peobj(ctx);\n    break;\n  case BUILD_raw:\n    emit_raw(ctx);\n    break;\n  case BUILD_bcdef:\n    emit_bcdef(ctx);\n    emit_lib(ctx);\n    break;\n  case BUILD_vmdef:\n    emit_vmdef(ctx);\n    emit_lib(ctx);\n    break;\n  case BUILD_ffdef:\n  case BUILD_libdef:\n  case BUILD_recdef:\n    emit_lib(ctx);\n    break;\n  case BUILD_folddef:\n    emit_fold(ctx);\n    break;\n  default:\n    break;\n  }\n\n  fflush(ctx->fp);\n  if (ferror(ctx->fp)) {\n    fprintf(stderr, \"Error: cannot write to output file: %s\\n\",\n\t    strerror(errno));\n    exit(1);\n  }\n  fclose(ctx->fp);\n\n  return 0;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/buildvm.h",
    "content": "/*\n** LuaJIT VM builder.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _BUILDVM_H\n#define _BUILDVM_H\n\n#include <sys/types.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <errno.h>\n\n#include \"lj_def.h\"\n#include \"lj_arch.h\"\n\n/* Hardcoded limits. Increase as needed. */\n#define BUILD_MAX_RELOC\t\t200\t/* Max. number of relocations. */\n#define BUILD_MAX_FOLD\t\t4096\t/* Max. number of fold rules. */\n\n/* Prefix for scanned library definitions. */\n#define LIBDEF_PREFIX\t\t\"LJLIB_\"\n\n/* Prefix for scanned fold definitions. */\n#define FOLDDEF_PREFIX\t\t\"LJFOLD\"\n\n/* Prefixes for generated labels. */\n#define LABEL_PREFIX\t\t\"lj_\"\n#define LABEL_PREFIX_BC\t\tLABEL_PREFIX \"BC_\"\n#define LABEL_PREFIX_FF\t\tLABEL_PREFIX \"ff_\"\n#define LABEL_PREFIX_CF\t\tLABEL_PREFIX \"cf_\"\n#define LABEL_PREFIX_FFH\tLABEL_PREFIX \"ffh_\"\n#define LABEL_PREFIX_LIBCF\tLABEL_PREFIX \"lib_cf_\"\n#define LABEL_PREFIX_LIBINIT\tLABEL_PREFIX \"lib_init_\"\n\n/* Forward declaration. */\nstruct dasm_State;\n\n/* Build modes. */\n#define BUILDDEF(_) \\\n  _(elfasm) _(coffasm) _(machasm) _(peobj) _(raw) \\\n  _(bcdef) _(ffdef) _(libdef) _(recdef) _(vmdef) \\\n  _(folddef)\n\ntypedef enum {\n#define BUILDENUM(name)\t\tBUILD_##name,\nBUILDDEF(BUILDENUM)\n#undef BUILDENUM\n  BUILD__MAX\n} BuildMode;\n\n/* Code relocation. */\ntypedef struct BuildReloc {\n  int32_t ofs;\n  int sym;\n  int type;\n} BuildReloc;\n\ntypedef struct BuildSym {\n  const char *name;\n  int32_t ofs;\n} BuildSym;\n\n/* Build context structure. */\ntypedef struct BuildCtx {\n  /* DynASM state pointer. Should be first member. */\n  struct dasm_State *D;\n  /* Parsed command line. */\n  BuildMode mode;\n  FILE *fp;\n  const char *outname;\n  char **args;\n  /* Code and symbols generated by DynASM. */\n  uint8_t *code;\n  size_t codesz;\n  int npc, nglob, nsym, nreloc, nrelocsym;\n  void **glob;\n  BuildSym *sym;\n  const char **relocsym;\n  int32_t *bc_ofs;\n  const char *beginsym;\n  /* Strings generated by DynASM. */\n  const char *const *globnames;\n  const char *dasm_ident;\n  const char *dasm_arch;\n  /* Relocations. */\n  BuildReloc reloc[BUILD_MAX_RELOC];\n} BuildCtx;\n\nextern void owrite(BuildCtx *ctx, const void *ptr, size_t sz);\nextern void emit_asm(BuildCtx *ctx);\nextern void emit_peobj(BuildCtx *ctx);\nextern void emit_lib(BuildCtx *ctx);\nextern void emit_fold(BuildCtx *ctx);\n\nextern const char *const bc_names[];\nextern const char *const ir_names[];\nextern const char *const irt_names[];\nextern const char *const irfpm_names[];\nextern const char *const irfield_names[];\nextern const char *const ircall_names[];\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/buildvm_asm.c",
    "content": "/*\n** LuaJIT VM builder: Assembler source code emitter.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"buildvm.h\"\n#include \"lj_bc.h\"\n\n/* ------------------------------------------------------------------------ */\n\n#if LJ_TARGET_X86ORX64\n/* Emit bytes piecewise as assembler text. */\nstatic void emit_asm_bytes(BuildCtx *ctx, uint8_t *p, int n)\n{\n  int i;\n  for (i = 0; i < n; i++) {\n    if ((i & 15) == 0)\n      fprintf(ctx->fp, \"\\t.byte %d\", p[i]);\n    else\n      fprintf(ctx->fp, \",%d\", p[i]);\n    if ((i & 15) == 15) putc('\\n', ctx->fp);\n  }\n  if ((n & 15) != 0) putc('\\n', ctx->fp);\n}\n\n/* Emit relocation */\nstatic void emit_asm_reloc(BuildCtx *ctx, int type, const char *sym)\n{\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n    if (type)\n      fprintf(ctx->fp, \"\\t.long %s-.-4\\n\", sym);\n    else\n      fprintf(ctx->fp, \"\\t.long %s\\n\", sym);\n    break;\n  case BUILD_coffasm:\n    fprintf(ctx->fp, \"\\t.def %s; .scl 3; .type 32; .endef\\n\", sym);\n    if (type)\n      fprintf(ctx->fp, \"\\t.long %s-.-4\\n\", sym);\n    else\n      fprintf(ctx->fp, \"\\t.long %s\\n\", sym);\n    break;\n  default:  /* BUILD_machasm for relative relocations handled below. */\n    fprintf(ctx->fp, \"\\t.long %s\\n\", sym);\n    break;\n  }\n}\n\nstatic const char *const jccnames[] = {\n  \"jo\", \"jno\", \"jb\", \"jnb\", \"jz\", \"jnz\", \"jbe\", \"ja\",\n  \"js\", \"jns\", \"jpe\", \"jpo\", \"jl\", \"jge\", \"jle\", \"jg\"\n};\n\n/* Emit relocation for the incredibly stupid OSX assembler. */\nstatic void emit_asm_reloc_mach(BuildCtx *ctx, uint8_t *cp, int n,\n\t\t\t\tconst char *sym)\n{\n  const char *opname = NULL;\n  if (--n < 0) goto err;\n  if (cp[n] == 0xe8) {\n    opname = \"call\";\n  } else if (cp[n] == 0xe9) {\n    opname = \"jmp\";\n  } else if (cp[n] >= 0x80 && cp[n] <= 0x8f && n > 0 && cp[n-1] == 0x0f) {\n    opname = jccnames[cp[n]-0x80];\n    n--;\n  } else {\nerr:\n    fprintf(stderr, \"Error: unsupported opcode for %s symbol relocation.\\n\",\n\t    sym);\n    exit(1);\n  }\n  emit_asm_bytes(ctx, cp, n);\n  fprintf(ctx->fp, \"\\t%s %s\\n\", opname, sym);\n}\n#else\n/* Emit words piecewise as assembler text. */\nstatic void emit_asm_words(BuildCtx *ctx, uint8_t *p, int n)\n{\n  int i;\n  for (i = 0; i < n; i += 4) {\n    if ((i & 15) == 0)\n      fprintf(ctx->fp, \"\\t.long 0x%08x\", *(uint32_t *)(p+i));\n    else\n      fprintf(ctx->fp, \",0x%08x\", *(uint32_t *)(p+i));\n    if ((i & 15) == 12) putc('\\n', ctx->fp);\n  }\n  if ((n & 15) != 0) putc('\\n', ctx->fp);\n}\n\n/* Emit relocation as part of an instruction. */\nstatic void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n,\n\t\t\t       const char *sym)\n{\n  uint32_t ins;\n  emit_asm_words(ctx, p, n-4);\n  ins = *(uint32_t *)(p+n-4);\n#if LJ_TARGET_ARM\n  if ((ins & 0xff000000u) == 0xfa000000u) {\n    fprintf(ctx->fp, \"\\tblx %s\\n\", sym);\n  } else if ((ins & 0x0e000000u) == 0x0a000000u) {\n    fprintf(ctx->fp, \"\\t%s%.2s %s\\n\", (ins & 0x01000000u) ? \"bl\" : \"b\",\n\t    \"eqnecsccmiplvsvchilsgeltgtle\" + 2*(ins >> 28), sym);\n  } else {\n    fprintf(stderr,\n\t    \"Error: unsupported opcode %08x for %s symbol relocation.\\n\",\n\t    ins, sym);\n    exit(1);\n  }\n#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE\n#if LJ_TARGET_PS3\n#define TOCPREFIX \".\"\n#else\n#define TOCPREFIX \"\"\n#endif\n  if ((ins >> 26) == 16) {\n    fprintf(ctx->fp, \"\\t%s %d, %d, \" TOCPREFIX \"%s\\n\",\n\t    (ins & 1) ? \"bcl\" : \"bc\", (ins >> 21) & 31, (ins >> 16) & 31, sym);\n  } else if ((ins >> 26) == 18) {\n    fprintf(ctx->fp, \"\\t%s \" TOCPREFIX \"%s\\n\", (ins & 1) ? \"bl\" : \"b\", sym);\n  } else {\n    fprintf(stderr,\n\t    \"Error: unsupported opcode %08x for %s symbol relocation.\\n\",\n\t    ins, sym);\n    exit(1);\n  }\n#elif LJ_TARGET_MIPS\n  fprintf(stderr,\n\t  \"Error: unsupported opcode %08x for %s symbol relocation.\\n\",\n\t  ins, sym);\n  exit(1);\n#else\n#error \"missing relocation support for this architecture\"\n#endif\n}\n#endif\n\n#if LJ_TARGET_ARM\n#define ELFASM_PX\t\"%%\"\n#else\n#define ELFASM_PX\t\"@\"\n#endif\n\n/* Emit an assembler label. */\nstatic void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc)\n{\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n#if LJ_TARGET_PS3\n    if (!strncmp(name, \"lj_vm_\", 6) &&\n\tstrcmp(name, ctx->beginsym) &&\n\t!strstr(name, \"hook\")) {\n      fprintf(ctx->fp,\n\t\"\\n\\t.globl %s\\n\"\n\t\"\\t.section \\\".opd\\\",\\\"aw\\\"\\n\"\n\t\"%s:\\n\"\n\t\"\\t.long .%s,.TOC.@tocbase32\\n\"\n\t\"\\t.size %s,8\\n\"\n\t\"\\t.previous\\n\"\n\t\"\\t.globl .%s\\n\"\n\t\"\\t.hidden .%s\\n\"\n\t\"\\t.type .%s, \" ELFASM_PX \"function\\n\"\n\t\"\\t.size .%s, %d\\n\"\n\t\".%s:\\n\",\n\tname, name, name, name, name, name, name, name, size, name);\n      break;\n    }\n#endif\n    fprintf(ctx->fp,\n      \"\\n\\t.globl %s\\n\"\n      \"\\t.hidden %s\\n\"\n      \"\\t.type %s, \" ELFASM_PX \"%s\\n\"\n      \"\\t.size %s, %d\\n\"\n      \"%s:\\n\",\n      name, name, name, isfunc ? \"function\" : \"object\", name, size, name);\n    break;\n  case BUILD_coffasm:\n    fprintf(ctx->fp, \"\\n\\t.globl %s\\n\", name);\n    if (isfunc)\n      fprintf(ctx->fp, \"\\t.def %s; .scl 3; .type 32; .endef\\n\", name);\n    fprintf(ctx->fp, \"%s:\\n\", name);\n    break;\n  case BUILD_machasm:\n    fprintf(ctx->fp,\n      \"\\n\\t.private_extern %s\\n\"\n      \"%s:\\n\", name, name);\n    break;\n  default:\n    break;\n  }\n}\n\n/* Emit alignment. */\nstatic void emit_asm_align(BuildCtx *ctx, int bits)\n{\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n  case BUILD_coffasm:\n    fprintf(ctx->fp, \"\\t.p2align %d\\n\", bits);\n    break;\n  case BUILD_machasm:\n    fprintf(ctx->fp, \"\\t.align %d\\n\", bits);\n    break;\n  default:\n    break;\n  }\n}\n\n/* ------------------------------------------------------------------------ */\n\n/* Emit assembler source code. */\nvoid emit_asm(BuildCtx *ctx)\n{\n  int i, rel;\n\n  fprintf(ctx->fp, \"\\t.file \\\"buildvm_%s.dasc\\\"\\n\", ctx->dasm_arch);\n  fprintf(ctx->fp, \"\\t.text\\n\");\n  emit_asm_align(ctx, 4);\n\n#if LJ_TARGET_PS3\n  emit_asm_label(ctx, ctx->beginsym, ctx->codesz, 0);\n#else\n  emit_asm_label(ctx, ctx->beginsym, 0, 0);\n#endif\n  if (ctx->mode != BUILD_machasm)\n    fprintf(ctx->fp, \".Lbegin:\\n\");\n\n#if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND\n  /* This should really be moved into buildvm_arm.dasc. */\n  fprintf(ctx->fp,\n\t  \".fnstart\\n\"\n\t  \".save {r4, r5, r6, r7, r8, r9, r10, r11, lr}\\n\"\n\t  \".pad #28\\n\");\n#endif\n#if LJ_TARGET_MIPS\n  fprintf(ctx->fp, \".set nomips16\\n.abicalls\\n.set noreorder\\n.set nomacro\\n\");\n#endif\n\n  for (i = rel = 0; i < ctx->nsym; i++) {\n    int32_t ofs = ctx->sym[i].ofs;\n    int32_t next = ctx->sym[i+1].ofs;\n#if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND && LJ_HASFFI\n    if (!strcmp(ctx->sym[i].name, \"lj_vm_ffi_call\"))\n      fprintf(ctx->fp,\n\t      \".globl lj_err_unwind_arm\\n\"\n\t      \".personality lj_err_unwind_arm\\n\"\n\t      \".fnend\\n\"\n\t      \".fnstart\\n\"\n\t      \".save {r4, r5, r11, lr}\\n\"\n\t      \".setfp r11, sp\\n\");\n#endif\n    emit_asm_label(ctx, ctx->sym[i].name, next - ofs, 1);\n    while (rel < ctx->nreloc && ctx->reloc[rel].ofs <= next) {\n      BuildReloc *r = &ctx->reloc[rel];\n      int n = r->ofs - ofs;\n#if LJ_TARGET_X86ORX64\n      if (ctx->mode == BUILD_machasm && r->type != 0) {\n\temit_asm_reloc_mach(ctx, ctx->code+ofs, n, ctx->relocsym[r->sym]);\n      } else {\n\temit_asm_bytes(ctx, ctx->code+ofs, n);\n\temit_asm_reloc(ctx, r->type, ctx->relocsym[r->sym]);\n      }\n      ofs += n+4;\n#else\n      emit_asm_wordreloc(ctx, ctx->code+ofs, n, ctx->relocsym[r->sym]);\n      ofs += n;\n#endif\n      rel++;\n    }\n#if LJ_TARGET_X86ORX64\n    emit_asm_bytes(ctx, ctx->code+ofs, next-ofs);\n#else\n    emit_asm_words(ctx, ctx->code+ofs, next-ofs);\n#endif\n  }\n\n#if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND\n  fprintf(ctx->fp,\n#if !LJ_HASFFI\n\t  \".globl lj_err_unwind_arm\\n\"\n\t  \".personality lj_err_unwind_arm\\n\"\n#endif\n\t  \".fnend\\n\");\n#endif\n\n  fprintf(ctx->fp, \"\\n\");\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n#if !LJ_TARGET_PS3\n    fprintf(ctx->fp, \"\\t.section .note.GNU-stack,\\\"\\\",\" ELFASM_PX \"progbits\\n\");\n#endif\n#if LJ_TARGET_PPCSPE\n    /* Soft-float ABI + SPE. */\n    fprintf(ctx->fp, \"\\t.gnu_attribute 4, 2\\n\\t.gnu_attribute 8, 3\\n\");\n#elif LJ_TARGET_PPC && !LJ_TARGET_PS3\n    /* Hard-float ABI. */\n    fprintf(ctx->fp, \"\\t.gnu_attribute 4, 1\\n\");\n#endif\n    /* fallthrough */\n  case BUILD_coffasm:\n    fprintf(ctx->fp, \"\\t.ident \\\"%s\\\"\\n\", ctx->dasm_ident);\n    break;\n  case BUILD_machasm:\n    fprintf(ctx->fp,\n      \"\\t.cstring\\n\"\n      \"\\t.ascii \\\"%s\\\\0\\\"\\n\", ctx->dasm_ident);\n    break;\n  default:\n    break;\n  }\n  fprintf(ctx->fp, \"\\n\");\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/buildvm_fold.c",
    "content": "/*\n** LuaJIT VM builder: IR folding hash table generator.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"buildvm.h\"\n#include \"lj_obj.h\"\n#include \"lj_ir.h\"\n\n/* Context for the folding hash table generator. */\nstatic int lineno;\nstatic int funcidx;\nstatic uint32_t foldkeys[BUILD_MAX_FOLD];\nstatic uint32_t nkeys;\n\n/* Try to fill the hash table with keys using the hash parameters. */\nstatic int tryhash(uint32_t *htab, uint32_t sz, uint32_t r, int dorol)\n{\n  uint32_t i;\n  if (dorol && ((r & 31) == 0 || (r>>5) == 0))\n    return 0;  /* Avoid zero rotates. */\n  memset(htab, 0xff, (sz+1)*sizeof(uint32_t));\n  for (i = 0; i < nkeys; i++) {\n    uint32_t key = foldkeys[i];\n    uint32_t k = key & 0xffffff;\n    uint32_t h = (dorol ? lj_rol(lj_rol(k, r>>5) - k, r&31) :\n\t\t\t  (((k << (r>>5)) - k) << (r&31))) % sz;\n    if (htab[h] != 0xffffffff) {  /* Collision on primary slot. */\n      if (htab[h+1] != 0xffffffff) {  /* Collision on secondary slot. */\n\t/* Try to move the colliding key, if possible. */\n\tif (h < sz-1 && htab[h+2] == 0xffffffff) {\n\t  uint32_t k2 = htab[h+1] & 0xffffff;\n\t  uint32_t h2 = (dorol ? lj_rol(lj_rol(k2, r>>5) - k2, r&31) :\n\t\t\t\t (((k2 << (r>>5)) - k2) << (r&31))) % sz;\n\t  if (h2 != h+1) return 0;  /* Cannot resolve collision. */\n\t  htab[h+2] = htab[h+1];  /* Move colliding key to secondary slot. */\n\t} else {\n\t  return 0;  /* Collision. */\n\t}\n      }\n      htab[h+1] = key;\n    } else {\n      htab[h] = key;\n    }\n  }\n  return 1;  /* Success, all keys could be stored. */\n}\n\n/* Print the generated hash table. */\nstatic void printhash(BuildCtx *ctx, uint32_t *htab, uint32_t sz)\n{\n  uint32_t i;\n  fprintf(ctx->fp, \"static const uint32_t fold_hash[%d] = {\\n0x%08x\",\n\t  sz+1, htab[0]);\n  for (i = 1; i < sz+1; i++)\n    fprintf(ctx->fp, \",\\n0x%08x\", htab[i]);\n  fprintf(ctx->fp, \"\\n};\\n\\n\");\n}\n\n/* Exhaustive search for the shortest semi-perfect hash table. */\nstatic void makehash(BuildCtx *ctx)\n{\n  uint32_t htab[BUILD_MAX_FOLD*2+1];\n  uint32_t sz, r;\n  /* Search for the smallest hash table with an odd size. */\n  for (sz = (nkeys|1); sz < BUILD_MAX_FOLD*2; sz += 2) {\n    /* First try all shift hash combinations. */\n    for (r = 0; r < 32*32; r++) {\n      if (tryhash(htab, sz, r, 0)) {\n\tprinthash(ctx, htab, sz);\n\tfprintf(ctx->fp,\n\t\t\"#define fold_hashkey(k)\\t(((((k)<<%u)-(k))<<%u)%%%u)\\n\\n\",\n\t\tr>>5, r&31, sz);\n\treturn;\n      }\n    }\n    /* Then try all rotate hash combinations. */\n    for (r = 0; r < 32*32; r++) {\n      if (tryhash(htab, sz, r, 1)) {\n\tprinthash(ctx, htab, sz);\n\tfprintf(ctx->fp,\n\t  \"#define fold_hashkey(k)\\t(lj_rol(lj_rol((k),%u)-(k),%u)%%%u)\\n\\n\",\n\t\tr>>5, r&31, sz);\n\treturn;\n      }\n    }\n  }\n  fprintf(stderr, \"Error: search for perfect hash failed\\n\");\n  exit(1);\n}\n\n/* Parse one token of a fold rule. */\nstatic uint32_t nexttoken(char **pp, int allowlit, int allowany)\n{\n  char *p = *pp;\n  if (p) {\n    uint32_t i;\n    char *q = strchr(p, ' ');\n    if (q) *q++ = '\\0';\n    *pp = q;\n    if (allowlit && !strncmp(p, \"IRFPM_\", 6)) {\n      for (i = 0; irfpm_names[i]; i++)\n\tif (!strcmp(irfpm_names[i], p+6))\n\t  return i;\n    } else if (allowlit && !strncmp(p, \"IRFL_\", 5)) {\n      for (i = 0; irfield_names[i]; i++)\n\tif (!strcmp(irfield_names[i], p+5))\n\t  return i;\n    } else if (allowlit && !strncmp(p, \"IRCALL_\", 7)) {\n      for (i = 0; ircall_names[i]; i++)\n\tif (!strcmp(ircall_names[i], p+7))\n\t  return i;\n    } else if (allowlit && !strncmp(p, \"IRCONV_\", 7)) {\n      for (i = 0; irt_names[i]; i++) {\n\tconst char *r = strchr(p+7, '_');\n\tif (r && !strncmp(irt_names[i], p+7, r-(p+7))) {\n\t  uint32_t j;\n\t  for (j = 0; irt_names[j]; j++)\n\t    if (!strcmp(irt_names[j], r+1))\n\t      return (i << 5) + j;\n\t}\n      }\n    } else if (allowlit && *p >= '0' && *p <= '9') {\n      for (i = 0; *p >= '0' && *p <= '9'; p++)\n\ti = i*10 + (*p - '0');\n      if (*p == '\\0')\n\treturn i;\n    } else if (allowany && !strcmp(\"any\", p)) {\n      return allowany;\n    } else {\n      for (i = 0; ir_names[i]; i++)\n\tif (!strcmp(ir_names[i], p))\n\t  return i;\n    }\n    fprintf(stderr, \"Error: bad fold definition token \\\"%s\\\" at line %d\\n\", p, lineno);\n    exit(1);\n  }\n  return 0;\n}\n\n/* Parse a fold rule. */\nstatic void foldrule(char *p)\n{\n  uint32_t op = nexttoken(&p, 0, 0);\n  uint32_t left = nexttoken(&p, 0, 0x7f);\n  uint32_t right = nexttoken(&p, 1, 0x3ff);\n  uint32_t key = (funcidx << 24) | (op << 17) | (left << 10) | right;\n  uint32_t i;\n  if (nkeys >= BUILD_MAX_FOLD) {\n    fprintf(stderr, \"Error: too many fold rules, increase BUILD_MAX_FOLD.\\n\");\n    exit(1);\n  }\n  /* Simple insertion sort to detect duplicates. */\n  for (i = nkeys; i > 0; i--) {\n    if ((foldkeys[i-1]&0xffffff) < (key & 0xffffff))\n      break;\n    if ((foldkeys[i-1]&0xffffff) == (key & 0xffffff)) {\n      fprintf(stderr, \"Error: duplicate fold definition at line %d\\n\", lineno);\n      exit(1);\n    }\n    foldkeys[i] = foldkeys[i-1];\n  }\n  foldkeys[i] = key;\n  nkeys++;\n}\n\n/* Emit C source code for IR folding hash table. */\nvoid emit_fold(BuildCtx *ctx)\n{\n  char buf[256];  /* We don't care about analyzing lines longer than that. */\n  const char *fname = ctx->args[0];\n  FILE *fp;\n\n  if (fname == NULL) {\n    fprintf(stderr, \"Error: missing input filename\\n\");\n    exit(1);\n  }\n\n  if (fname[0] == '-' && fname[1] == '\\0') {\n    fp = stdin;\n  } else {\n    fp = fopen(fname, \"r\");\n    if (!fp) {\n      fprintf(stderr, \"Error: cannot open input file '%s': %s\\n\",\n\t      fname, strerror(errno));\n      exit(1);\n    }\n  }\n\n  fprintf(ctx->fp, \"/* This is a generated file. DO NOT EDIT! */\\n\\n\");\n  fprintf(ctx->fp, \"static const FoldFunc fold_func[] = {\\n\");\n\n  lineno = 0;\n  funcidx = 0;\n  nkeys = 0;\n  while (fgets(buf, sizeof(buf), fp) != NULL) {\n    lineno++;\n    /* The prefix must be at the start of a line, otherwise it's ignored. */\n    if (!strncmp(buf, FOLDDEF_PREFIX, sizeof(FOLDDEF_PREFIX)-1)) {\n      char *p = buf+sizeof(FOLDDEF_PREFIX)-1;\n      char *q = strchr(p, ')');\n      if (p[0] == '(' && q) {\n\tp++;\n\t*q = '\\0';\n\tfoldrule(p);\n      } else if ((p[0] == 'F' || p[0] == 'X') && p[1] == '(' && q) {\n\tp += 2;\n\t*q = '\\0';\n\tif (funcidx)\n\t  fprintf(ctx->fp, \",\\n\");\n\tif (p[-2] == 'X')\n\t  fprintf(ctx->fp, \"  %s\", p);\n\telse\n\t  fprintf(ctx->fp, \"  fold_%s\", p);\n\tfuncidx++;\n      } else {\n\tbuf[strlen(buf)-1] = '\\0';\n\tfprintf(stderr, \"Error: unknown fold definition tag %s%s at line %d\\n\",\n\t\tFOLDDEF_PREFIX, p, lineno);\n\texit(1);\n      }\n    }\n  }\n  fclose(fp);\n  fprintf(ctx->fp, \"\\n};\\n\\n\");\n\n  makehash(ctx);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/buildvm_lib.c",
    "content": "/*\n** LuaJIT VM builder: library definition compiler.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"buildvm.h\"\n#include \"lj_obj.h\"\n#include \"lj_lib.h\"\n\n/* Context for library definitions. */\nstatic uint8_t obuf[8192];\nstatic uint8_t *optr;\nstatic char modname[80];\nstatic size_t modnamelen;\nstatic char funcname[80];\nstatic int modstate, regfunc;\nstatic int ffid, recffid, ffasmfunc;\n\nenum {\n  REGFUNC_OK,\n  REGFUNC_NOREG,\n  REGFUNC_NOREGUV\n};\n\nstatic void libdef_name(const char *p, int kind)\n{\n  size_t n = strlen(p);\n  if (kind != LIBINIT_STRING) {\n    if (n > modnamelen && p[modnamelen] == '_' &&\n\t!strncmp(p, modname, modnamelen)) {\n      p += modnamelen+1;\n      n -= modnamelen+1;\n    }\n  }\n  if (n > LIBINIT_MAXSTR) {\n    fprintf(stderr, \"Error: string too long: '%s'\\n\",  p);\n    exit(1);\n  }\n  if (optr+1+n+2 > obuf+sizeof(obuf)) {  /* +2 for caller. */\n    fprintf(stderr, \"Error: output buffer overflow\\n\");\n    exit(1);\n  }\n  *optr++ = (uint8_t)(n | kind);\n  memcpy(optr, p, n);\n  optr += n;\n}\n\nstatic void libdef_endmodule(BuildCtx *ctx)\n{\n  if (modstate != 0) {\n    char line[80];\n    const uint8_t *p;\n    int n;\n    if (modstate == 1)\n      fprintf(ctx->fp, \"  (lua_CFunction)0\");\n    fprintf(ctx->fp, \"\\n};\\n\");\n    fprintf(ctx->fp, \"static const uint8_t %s%s[] = {\\n\",\n\t    LABEL_PREFIX_LIBINIT, modname);\n    line[0] = '\\0';\n    for (n = 0, p = obuf; p < optr; p++) {\n      n += sprintf(line+n, \"%d,\", *p);\n      if (n >= 75) {\n\tfprintf(ctx->fp, \"%s\\n\", line);\n\tn = 0;\n\tline[0] = '\\0';\n      }\n    }\n    fprintf(ctx->fp, \"%s%d\\n};\\n#endif\\n\\n\", line, LIBINIT_END);\n  }\n}\n\nstatic void libdef_module(BuildCtx *ctx, char *p, int arg)\n{\n  UNUSED(arg);\n  if (ctx->mode == BUILD_libdef) {\n    libdef_endmodule(ctx);\n    optr = obuf;\n    *optr++ = (uint8_t)ffid;\n    *optr++ = (uint8_t)ffasmfunc;\n    *optr++ = 0;  /* Hash table size. */\n    modstate = 1;\n    fprintf(ctx->fp, \"#ifdef %sMODULE_%s\\n\", LIBDEF_PREFIX, p);\n    fprintf(ctx->fp, \"#undef %sMODULE_%s\\n\", LIBDEF_PREFIX, p);\n    fprintf(ctx->fp, \"static const lua_CFunction %s%s[] = {\\n\",\n\t    LABEL_PREFIX_LIBCF, p);\n  }\n  modnamelen = strlen(p);\n  if (modnamelen > sizeof(modname)-1) {\n    fprintf(stderr, \"Error: module name too long: '%s'\\n\", p);\n    exit(1);\n  }\n  strcpy(modname, p);\n}\n\nstatic int find_ffofs(BuildCtx *ctx, const char *name)\n{\n  int i;\n  for (i = 0; i < ctx->nglob; i++) {\n    const char *gl = ctx->globnames[i];\n    if (gl[0] == 'f' && gl[1] == 'f' && gl[2] == '_' && !strcmp(gl+3, name)) {\n      return (int)((uint8_t *)ctx->glob[i] - ctx->code);\n    }\n  }\n  fprintf(stderr, \"Error: undefined fast function %s%s\\n\",\n\t  LABEL_PREFIX_FF, name);\n  exit(1);\n}\n\nstatic void libdef_func(BuildCtx *ctx, char *p, int arg)\n{\n  if (arg != LIBINIT_CF)\n    ffasmfunc++;\n  if (ctx->mode == BUILD_libdef) {\n    if (modstate == 0) {\n      fprintf(stderr, \"Error: no module for function definition %s\\n\", p);\n      exit(1);\n    }\n    if (regfunc == REGFUNC_NOREG) {\n      if (optr+1 > obuf+sizeof(obuf)) {\n\tfprintf(stderr, \"Error: output buffer overflow\\n\");\n\texit(1);\n      }\n      *optr++ = LIBINIT_FFID;\n    } else {\n      if (arg != LIBINIT_ASM_) {\n\tif (modstate != 1) fprintf(ctx->fp, \",\\n\");\n\tmodstate = 2;\n\tfprintf(ctx->fp, \"  %s%s\", arg ? LABEL_PREFIX_FFH : LABEL_PREFIX_CF, p);\n      }\n      if (regfunc != REGFUNC_NOREGUV) obuf[2]++;  /* Bump hash table size. */\n      libdef_name(regfunc == REGFUNC_NOREGUV ? \"\" : p, arg);\n    }\n  } else if (ctx->mode == BUILD_ffdef) {\n    fprintf(ctx->fp, \"FFDEF(%s)\\n\", p);\n  } else if (ctx->mode == BUILD_recdef) {\n    if (strlen(p) > sizeof(funcname)-1) {\n      fprintf(stderr, \"Error: function name too long: '%s'\\n\", p);\n      exit(1);\n    }\n    strcpy(funcname, p);\n  } else if (ctx->mode == BUILD_vmdef) {\n    int i;\n    for (i = 1; p[i] && modname[i-1]; i++)\n      if (p[i] == '_') p[i] = '.';\n    fprintf(ctx->fp, \"\\\"%s\\\",\\n\", p);\n  } else if (ctx->mode == BUILD_bcdef) {\n    if (arg != LIBINIT_CF)\n      fprintf(ctx->fp, \",\\n%d\", find_ffofs(ctx, p));\n  }\n  ffid++;\n  regfunc = REGFUNC_OK;\n}\n\nstatic uint32_t find_rec(char *name)\n{\n  char *p = (char *)obuf;\n  uint32_t n;\n  for (n = 2; *p; n++) {\n    if (strcmp(p, name) == 0)\n      return n;\n    p += strlen(p)+1;\n  }\n  if (p+strlen(name)+1 >= (char *)obuf+sizeof(obuf)) {\n    fprintf(stderr, \"Error: output buffer overflow\\n\");\n    exit(1);\n  }\n  strcpy(p, name);\n  return n;\n}\n\nstatic void libdef_rec(BuildCtx *ctx, char *p, int arg)\n{\n  UNUSED(arg);\n  if (ctx->mode == BUILD_recdef) {\n    char *q;\n    uint32_t n;\n    for (; recffid+1 < ffid; recffid++)\n      fprintf(ctx->fp, \",\\n0\");\n    recffid = ffid;\n    if (*p == '.') p = funcname;\n    q = strchr(p, ' ');\n    if (q) *q++ = '\\0';\n    n = find_rec(p);\n    if (q)\n      fprintf(ctx->fp, \",\\n0x%02x00+(%s)\", n, q);\n    else\n      fprintf(ctx->fp, \",\\n0x%02x00\", n);\n  }\n}\n\nstatic void memcpy_endian(void *dst, void *src, size_t n)\n{\n  union { uint8_t b; uint32_t u; } host_endian;\n  host_endian.u = 1;\n  if (host_endian.b == LJ_ENDIAN_SELECT(1, 0)) {\n    memcpy(dst, src, n);\n  } else {\n    size_t i;\n    for (i = 0; i < n; i++)\n      ((uint8_t *)dst)[i] = ((uint8_t *)src)[n-i-1];\n  }\n}\n\nstatic void libdef_push(BuildCtx *ctx, char *p, int arg)\n{\n  UNUSED(arg);\n  if (ctx->mode == BUILD_libdef) {\n    int len = (int)strlen(p);\n    if (*p == '\"') {\n      if (len > 1 && p[len-1] == '\"') {\n\tp[len-1] = '\\0';\n\tlibdef_name(p+1, LIBINIT_STRING);\n\treturn;\n      }\n    } else if (*p >= '0' && *p <= '9') {\n      char *ep;\n      double d = strtod(p, &ep);\n      if (*ep == '\\0') {\n\tif (optr+1+sizeof(double) > obuf+sizeof(obuf)) {\n\t  fprintf(stderr, \"Error: output buffer overflow\\n\");\n\t  exit(1);\n\t}\n\t*optr++ = LIBINIT_NUMBER;\n\tmemcpy_endian(optr, &d, sizeof(double));\n\toptr += sizeof(double);\n\treturn;\n      }\n    } else if (!strcmp(p, \"lastcl\")) {\n      if (optr+1 > obuf+sizeof(obuf)) {\n\tfprintf(stderr, \"Error: output buffer overflow\\n\");\n\texit(1);\n      }\n      *optr++ = LIBINIT_LASTCL;\n      return;\n    } else if (len > 4 && !strncmp(p, \"top-\", 4)) {\n      if (optr+2 > obuf+sizeof(obuf)) {\n\tfprintf(stderr, \"Error: output buffer overflow\\n\");\n\texit(1);\n      }\n      *optr++ = LIBINIT_COPY;\n      *optr++ = (uint8_t)atoi(p+4);\n      return;\n    }\n    fprintf(stderr, \"Error: bad value for %sPUSH(%s)\\n\", LIBDEF_PREFIX, p);\n    exit(1);\n  }\n}\n\nstatic void libdef_set(BuildCtx *ctx, char *p, int arg)\n{\n  UNUSED(arg);\n  if (ctx->mode == BUILD_libdef) {\n    if (p[0] == '!' && p[1] == '\\0') p[0] = '\\0';  /* Set env. */\n    libdef_name(p, LIBINIT_STRING);\n    *optr++ = LIBINIT_SET;\n    obuf[2]++;  /* Bump hash table size. */\n  }\n}\n\nstatic void libdef_regfunc(BuildCtx *ctx, char *p, int arg)\n{\n  UNUSED(ctx); UNUSED(p);\n  regfunc = arg;\n}\n\ntypedef void (*LibDefFunc)(BuildCtx *ctx, char *p, int arg);\n\ntypedef struct LibDefHandler {\n  const char *suffix;\n  const char *stop;\n  const LibDefFunc func;\n  const int arg;\n} LibDefHandler;\n\nstatic const LibDefHandler libdef_handlers[] = {\n  { \"MODULE_\",\t\" \\t\\r\\n\",\tlibdef_module,\t\t0 },\n  { \"CF(\",\t\")\",\t\tlibdef_func,\t\tLIBINIT_CF },\n  { \"ASM(\",\t\")\",\t\tlibdef_func,\t\tLIBINIT_ASM },\n  { \"ASM_(\",\t\")\",\t\tlibdef_func,\t\tLIBINIT_ASM_ },\n  { \"REC(\",\t\")\",\t\tlibdef_rec,\t\t0 },\n  { \"PUSH(\",\t\")\",\t\tlibdef_push,\t\t0 },\n  { \"SET(\",\t\")\",\t\tlibdef_set,\t\t0 },\n  { \"NOREGUV\",\tNULL,\t\tlibdef_regfunc,\t\tREGFUNC_NOREGUV },\n  { \"NOREG\",\tNULL,\t\tlibdef_regfunc,\t\tREGFUNC_NOREG },\n  { NULL,\tNULL,\t\t(LibDefFunc)0,\t\t0 }\n};\n\n/* Emit C source code for library function definitions. */\nvoid emit_lib(BuildCtx *ctx)\n{\n  const char *fname;\n\n  if (ctx->mode == BUILD_ffdef || ctx->mode == BUILD_libdef ||\n      ctx->mode == BUILD_recdef)\n    fprintf(ctx->fp, \"/* This is a generated file. DO NOT EDIT! */\\n\\n\");\n  else if (ctx->mode == BUILD_vmdef)\n    fprintf(ctx->fp, \"ffnames = {\\n[0]=\\\"Lua\\\",\\n\\\"C\\\",\\n\");\n  if (ctx->mode == BUILD_recdef)\n    fprintf(ctx->fp, \"static const uint16_t recff_idmap[] = {\\n0,\\n0x0100\");\n  recffid = ffid = FF_C+1;\n  ffasmfunc = 0;\n\n  while ((fname = *ctx->args++)) {\n    char buf[256];  /* We don't care about analyzing lines longer than that. */\n    FILE *fp;\n    if (fname[0] == '-' && fname[1] == '\\0') {\n      fp = stdin;\n    } else {\n      fp = fopen(fname, \"r\");\n      if (!fp) {\n\tfprintf(stderr, \"Error: cannot open input file '%s': %s\\n\",\n\t\tfname, strerror(errno));\n\texit(1);\n      }\n    }\n    modstate = 0;\n    regfunc = REGFUNC_OK;\n    while (fgets(buf, sizeof(buf), fp) != NULL) {\n      char *p;\n      /* Simplistic pre-processor. Only handles top-level #if/#endif. */\n      if (buf[0] == '#' && buf[1] == 'i' && buf[2] == 'f') {\n\tint ok = 1;\n\tif (!strcmp(buf, \"#if LJ_52\\n\"))\n\t  ok = LJ_52;\n\telse if (!strcmp(buf, \"#if LJ_HASJIT\\n\"))\n\t  ok = LJ_HASJIT;\n\telse if (!strcmp(buf, \"#if LJ_HASFFI\\n\"))\n\t  ok = LJ_HASFFI;\n\tif (!ok) {\n\t  int lvl = 1;\n\t  while (fgets(buf, sizeof(buf), fp) != NULL) {\n\t    if (buf[0] == '#' && buf[1] == 'e' && buf[2] == 'n') {\n\t      if (--lvl == 0) break;\n\t    } else if (buf[0] == '#' && buf[1] == 'i' && buf[2] == 'f') {\n\t      lvl++;\n\t    }\n\t  }\n\t  continue;\n\t}\n      }\n      for (p = buf; (p = strstr(p, LIBDEF_PREFIX)) != NULL; ) {\n\tconst LibDefHandler *ldh;\n\tp += sizeof(LIBDEF_PREFIX)-1;\n\tfor (ldh = libdef_handlers; ldh->suffix != NULL; ldh++) {\n\t  size_t n, len = strlen(ldh->suffix);\n\t  if (!strncmp(p, ldh->suffix, len)) {\n\t    p += len;\n\t    n = ldh->stop ? strcspn(p, ldh->stop) : 0;\n\t    if (!p[n]) break;\n\t    p[n] = '\\0';\n\t    ldh->func(ctx, p, ldh->arg);\n\t    p += n+1;\n\t    break;\n\t  }\n\t}\n\tif (ldh->suffix == NULL) {\n\t  buf[strlen(buf)-1] = '\\0';\n\t  fprintf(stderr, \"Error: unknown library definition tag %s%s\\n\",\n\t\t  LIBDEF_PREFIX, p);\n\t  exit(1);\n\t}\n      }\n    }\n    fclose(fp);\n    if (ctx->mode == BUILD_libdef) {\n      libdef_endmodule(ctx);\n    }\n  }\n\n  if (ctx->mode == BUILD_ffdef) {\n    fprintf(ctx->fp, \"\\n#undef FFDEF\\n\\n\");\n    fprintf(ctx->fp,\n      \"#ifndef FF_NUM_ASMFUNC\\n#define FF_NUM_ASMFUNC %d\\n#endif\\n\\n\",\n      ffasmfunc);\n  } else if (ctx->mode == BUILD_vmdef) {\n    fprintf(ctx->fp, \"}\\n\\n\");\n  } else if (ctx->mode == BUILD_bcdef) {\n    int i;\n    fprintf(ctx->fp, \"\\n};\\n\\n\");\n    fprintf(ctx->fp, \"LJ_DATADEF const uint16_t lj_bc_mode[] = {\\n\");\n    fprintf(ctx->fp, \"BCDEF(BCMODE)\\n\");\n    for (i = ffasmfunc-1; i > 0; i--)\n      fprintf(ctx->fp, \"BCMODE_FF,\\n\");\n    fprintf(ctx->fp, \"BCMODE_FF\\n};\\n\\n\");\n  } else if (ctx->mode == BUILD_recdef) {\n    char *p = (char *)obuf;\n    fprintf(ctx->fp, \"\\n};\\n\\n\");\n    fprintf(ctx->fp, \"static const RecordFunc recff_func[] = {\\n\"\n\t    \"recff_nyi,\\n\"\n\t    \"recff_c\");\n    while (*p) {\n      fprintf(ctx->fp, \",\\nrecff_%s\", p);\n      p += strlen(p)+1;\n    }\n    fprintf(ctx->fp, \"\\n};\\n\\n\");\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/buildvm_peobj.c",
    "content": "/*\n** LuaJIT VM builder: PE object emitter.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Only used for building on Windows, since we cannot assume the presence\n** of a suitable assembler. The host and target byte order must match.\n*/\n\n#include \"buildvm.h\"\n#include \"lj_bc.h\"\n\n#if LJ_TARGET_X86ORX64 || LJ_TARGET_PPC\n\n/* Context for PE object emitter. */\nstatic char *strtab;\nstatic size_t strtabofs;\n\n/* -- PE object definitions ----------------------------------------------- */\n\n/* PE header. */\ntypedef struct PEheader {\n  uint16_t arch;\n  uint16_t nsects;\n  uint32_t time;\n  uint32_t symtabofs;\n  uint32_t nsyms;\n  uint16_t opthdrsz;\n  uint16_t flags;\n} PEheader;\n\n/* PE section. */\ntypedef struct PEsection {\n  char name[8];\n  uint32_t vsize;\n  uint32_t vaddr;\n  uint32_t size;\n  uint32_t ofs;\n  uint32_t relocofs;\n  uint32_t lineofs;\n  uint16_t nreloc;\n  uint16_t nline;\n  uint32_t flags;\n} PEsection;\n\n/* PE relocation. */\ntypedef struct PEreloc {\n  uint32_t vaddr;\n  uint32_t symidx;\n  uint16_t type;\n} PEreloc;\n\n/* Cannot use sizeof, because it pads up to the max. alignment. */\n#define PEOBJ_RELOC_SIZE\t(4+4+2)\n\n/* PE symbol table entry. */\ntypedef struct PEsym {\n  union {\n    char name[8];\n    uint32_t nameref[2];\n  } n;\n  uint32_t value;\n  int16_t sect;\n  uint16_t type;\n  uint8_t scl;\n  uint8_t naux;\n} PEsym;\n\n/* PE symbol table auxiliary entry for a section. */\ntypedef struct PEsymaux {\n  uint32_t size;\n  uint16_t nreloc;\n  uint16_t nline;\n  uint32_t cksum;\n  uint16_t assoc;\n  uint8_t comdatsel;\n  uint8_t unused[3];\n} PEsymaux;\n\n/* Cannot use sizeof, because it pads up to the max. alignment. */\n#define PEOBJ_SYM_SIZE\t(8+4+2+2+1+1)\n\n/* PE object CPU specific defines. */\n#if LJ_TARGET_X86\n#define PEOBJ_ARCH_TARGET\t0x014c\n#define PEOBJ_RELOC_REL32\t0x14  /* MS: REL32, GNU: DISP32. */\n#define PEOBJ_RELOC_DIR32\t0x06\n#define PEOBJ_RELOC_OFS\t\t0\n#define PEOBJ_TEXT_FLAGS\t0x60500020  /* 60=r+x, 50=align16, 20=code. */\n#elif LJ_TARGET_X64\n#define PEOBJ_ARCH_TARGET\t0x8664\n#define PEOBJ_RELOC_REL32\t0x04  /* MS: REL32, GNU: DISP32. */\n#define PEOBJ_RELOC_DIR32\t0x02\n#define PEOBJ_RELOC_ADDR32NB\t0x03\n#define PEOBJ_RELOC_OFS\t\t0\n#define PEOBJ_TEXT_FLAGS\t0x60500020  /* 60=r+x, 50=align16, 20=code. */\n#elif LJ_TARGET_PPC\n#define PEOBJ_ARCH_TARGET\t0x01f2\n#define PEOBJ_RELOC_REL32\t0x06\n#define PEOBJ_RELOC_DIR32\t0x02\n#define PEOBJ_RELOC_OFS\t\t(-4)\n#define PEOBJ_TEXT_FLAGS\t0x60400020  /* 60=r+x, 40=align8, 20=code. */\n#endif\n\n/* Section numbers (0-based). */\nenum {\n  PEOBJ_SECT_ABS = -2,\n  PEOBJ_SECT_UNDEF = -1,\n  PEOBJ_SECT_TEXT,\n#if LJ_TARGET_X64\n  PEOBJ_SECT_PDATA,\n  PEOBJ_SECT_XDATA,\n#endif\n  PEOBJ_SECT_RDATA_Z,\n  PEOBJ_NSECTIONS\n};\n\n/* Symbol types. */\n#define PEOBJ_TYPE_NULL\t\t0\n#define PEOBJ_TYPE_FUNC\t\t0x20\n\n/* Symbol storage class. */\n#define PEOBJ_SCL_EXTERN\t2\n#define PEOBJ_SCL_STATIC\t3\n\n/* -- PE object emitter --------------------------------------------------- */\n\n/* Emit PE object symbol. */\nstatic void emit_peobj_sym(BuildCtx *ctx, const char *name, uint32_t value,\n\t\t\t   int sect, int type, int scl)\n{\n  PEsym sym;\n  size_t len = strlen(name);\n  if (!strtab) {  /* Pass 1: only calculate string table length. */\n    if (len > 8) strtabofs += len+1;\n    return;\n  }\n  if (len <= 8) {\n    memcpy(sym.n.name, name, len);\n    memset(sym.n.name+len, 0, 8-len);\n  } else {\n    sym.n.nameref[0] = 0;\n    sym.n.nameref[1] = (uint32_t)strtabofs;\n    memcpy(strtab + strtabofs, name, len);\n    strtab[strtabofs+len] = 0;\n    strtabofs += len+1;\n  }\n  sym.value = value;\n  sym.sect = (int16_t)(sect+1);  /* 1-based section number. */\n  sym.type = (uint16_t)type;\n  sym.scl = (uint8_t)scl;\n  sym.naux = 0;\n  owrite(ctx, &sym, PEOBJ_SYM_SIZE);\n}\n\n/* Emit PE object section symbol. */\nstatic void emit_peobj_sym_sect(BuildCtx *ctx, PEsection *pesect, int sect)\n{\n  PEsym sym;\n  PEsymaux aux;\n  if (!strtab) return;  /* Pass 1: no output. */\n  memcpy(sym.n.name, pesect[sect].name, 8);\n  sym.value = 0;\n  sym.sect = (int16_t)(sect+1);  /* 1-based section number. */\n  sym.type = PEOBJ_TYPE_NULL;\n  sym.scl = PEOBJ_SCL_STATIC;\n  sym.naux = 1;\n  owrite(ctx, &sym, PEOBJ_SYM_SIZE);\n  memset(&aux, 0, sizeof(PEsymaux));\n  aux.size = pesect[sect].size;\n  aux.nreloc = pesect[sect].nreloc;\n  owrite(ctx, &aux, PEOBJ_SYM_SIZE);\n}\n\n/* Emit Windows PE object file. */\nvoid emit_peobj(BuildCtx *ctx)\n{\n  PEheader pehdr;\n  PEsection pesect[PEOBJ_NSECTIONS];\n  uint32_t sofs;\n  int i, nrsym;\n  union { uint8_t b; uint32_t u; } host_endian;\n\n  sofs = sizeof(PEheader) + PEOBJ_NSECTIONS*sizeof(PEsection);\n\n  /* Fill in PE sections. */\n  memset(&pesect, 0, PEOBJ_NSECTIONS*sizeof(PEsection));\n  memcpy(pesect[PEOBJ_SECT_TEXT].name, \".text\", sizeof(\".text\")-1);\n  pesect[PEOBJ_SECT_TEXT].ofs = sofs;\n  sofs += (pesect[PEOBJ_SECT_TEXT].size = (uint32_t)ctx->codesz);\n  pesect[PEOBJ_SECT_TEXT].relocofs = sofs;\n  sofs += (pesect[PEOBJ_SECT_TEXT].nreloc = (uint16_t)ctx->nreloc) * PEOBJ_RELOC_SIZE;\n  /* Flags: 60 = read+execute, 50 = align16, 20 = code. */\n  pesect[PEOBJ_SECT_TEXT].flags = PEOBJ_TEXT_FLAGS;\n\n#if LJ_TARGET_X64\n  memcpy(pesect[PEOBJ_SECT_PDATA].name, \".pdata\", sizeof(\".pdata\")-1);\n  pesect[PEOBJ_SECT_PDATA].ofs = sofs;\n  sofs += (pesect[PEOBJ_SECT_PDATA].size = 6*4);\n  pesect[PEOBJ_SECT_PDATA].relocofs = sofs;\n  sofs += (pesect[PEOBJ_SECT_PDATA].nreloc = 6) * PEOBJ_RELOC_SIZE;\n  /* Flags: 40 = read, 30 = align4, 40 = initialized data. */\n  pesect[PEOBJ_SECT_PDATA].flags = 0x40300040;\n\n  memcpy(pesect[PEOBJ_SECT_XDATA].name, \".xdata\", sizeof(\".xdata\")-1);\n  pesect[PEOBJ_SECT_XDATA].ofs = sofs;\n  sofs += (pesect[PEOBJ_SECT_XDATA].size = 8*2+4+6*2);  /* See below. */\n  pesect[PEOBJ_SECT_XDATA].relocofs = sofs;\n  sofs += (pesect[PEOBJ_SECT_XDATA].nreloc = 1) * PEOBJ_RELOC_SIZE;\n  /* Flags: 40 = read, 30 = align4, 40 = initialized data. */\n  pesect[PEOBJ_SECT_XDATA].flags = 0x40300040;\n#endif\n\n  memcpy(pesect[PEOBJ_SECT_RDATA_Z].name, \".rdata$Z\", sizeof(\".rdata$Z\")-1);\n  pesect[PEOBJ_SECT_RDATA_Z].ofs = sofs;\n  sofs += (pesect[PEOBJ_SECT_RDATA_Z].size = (uint32_t)strlen(ctx->dasm_ident)+1);\n  /* Flags: 40 = read, 30 = align4, 40 = initialized data. */\n  pesect[PEOBJ_SECT_RDATA_Z].flags = 0x40300040;\n\n  /* Fill in PE header. */\n  pehdr.arch = PEOBJ_ARCH_TARGET;\n  pehdr.nsects = PEOBJ_NSECTIONS;\n  pehdr.time = 0;  /* Timestamp is optional. */\n  pehdr.symtabofs = sofs;\n  pehdr.opthdrsz = 0;\n  pehdr.flags = 0;\n\n  /* Compute the size of the symbol table:\n  ** @feat.00 + nsections*2\n  ** + asm_start + nsym\n  ** + nrsym\n  */\n  nrsym = ctx->nrelocsym;\n  pehdr.nsyms = 1+PEOBJ_NSECTIONS*2 + 1+ctx->nsym + nrsym;\n#if LJ_TARGET_X64\n  pehdr.nsyms += 1;  /* Symbol for lj_err_unwind_win64. */\n#endif\n\n  /* Write PE object header and all sections. */\n  owrite(ctx, &pehdr, sizeof(PEheader));\n  owrite(ctx, &pesect, sizeof(PEsection)*PEOBJ_NSECTIONS);\n\n  /* Write .text section. */\n  host_endian.u = 1;\n  if (host_endian.b != LJ_ENDIAN_SELECT(1, 0)) {\n#if LJ_TARGET_PPC\n    uint32_t *p = (uint32_t *)ctx->code;\n    int n = (int)(ctx->codesz >> 2);\n    for (i = 0; i < n; i++, p++)\n      *p = lj_bswap(*p);  /* Byteswap .text section. */\n#else\n    fprintf(stderr, \"Error: different byte order for host and target\\n\");\n    exit(1);\n#endif\n  }\n  owrite(ctx, ctx->code, ctx->codesz);\n  for (i = 0; i < ctx->nreloc; i++) {\n    PEreloc reloc;\n    reloc.vaddr = (uint32_t)ctx->reloc[i].ofs + PEOBJ_RELOC_OFS;\n    reloc.symidx = 1+2+ctx->reloc[i].sym;  /* Reloc syms are after .text sym. */\n    reloc.type = ctx->reloc[i].type ? PEOBJ_RELOC_REL32 : PEOBJ_RELOC_DIR32;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n  }\n\n#if LJ_TARGET_X64\n  { /* Write .pdata section. */\n    uint32_t fcofs = (uint32_t)ctx->sym[ctx->nsym-1].ofs;\n    uint32_t pdata[3];  /* Start of .text, end of .text and .xdata. */\n    PEreloc reloc;\n    pdata[0] = 0; pdata[1] = fcofs; pdata[2] = 0;\n    owrite(ctx, &pdata, sizeof(pdata));\n    pdata[0] = fcofs; pdata[1] = (uint32_t)ctx->codesz; pdata[2] = 20;\n    owrite(ctx, &pdata, sizeof(pdata));\n    reloc.vaddr = 0; reloc.symidx = 1+2+nrsym+2+2+1;\n    reloc.type = PEOBJ_RELOC_ADDR32NB;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n    reloc.vaddr = 4; reloc.symidx = 1+2+nrsym+2+2+1;\n    reloc.type = PEOBJ_RELOC_ADDR32NB;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n    reloc.vaddr = 8; reloc.symidx = 1+2+nrsym+2;\n    reloc.type = PEOBJ_RELOC_ADDR32NB;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n    reloc.vaddr = 12; reloc.symidx = 1+2+nrsym+2+2+1;\n    reloc.type = PEOBJ_RELOC_ADDR32NB;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n    reloc.vaddr = 16; reloc.symidx = 1+2+nrsym+2+2+1;\n    reloc.type = PEOBJ_RELOC_ADDR32NB;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n    reloc.vaddr = 20; reloc.symidx = 1+2+nrsym+2;\n    reloc.type = PEOBJ_RELOC_ADDR32NB;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n  }\n  { /* Write .xdata section. */\n    uint16_t xdata[8+2+6];\n    PEreloc reloc;\n    xdata[0] = 0x01|0x08|0x10;  /* Ver. 1, uhandler/ehandler, prolog size 0. */\n    xdata[1] = 0x0005;  /* Number of unwind codes, no frame pointer. */\n    xdata[2] = 0x4200;  /* Stack offset 4*8+8 = aword*5. */\n    xdata[3] = 0x3000;  /* Push rbx. */\n    xdata[4] = 0x6000;  /* Push rsi. */\n    xdata[5] = 0x7000;  /* Push rdi. */\n    xdata[6] = 0x5000;  /* Push rbp. */\n    xdata[7] = 0;  /* Alignment. */\n    xdata[8] = xdata[9] = 0;  /* Relocated address of exception handler. */\n    xdata[10] = 0x01;  /* Ver. 1, no handler, prolog size 0. */\n    xdata[11] = 0x1504;  /* Number of unwind codes, fp = rbp, fpofs = 16. */\n    xdata[12] = 0x0300;  /* set_fpreg. */\n    xdata[13] = 0x0200;  /* stack offset 0*8+8 = aword*1. */\n    xdata[14] = 0x3000;  /* Push rbx. */\n    xdata[15] = 0x5000;  /* Push rbp. */\n    owrite(ctx, &xdata, sizeof(xdata));\n    reloc.vaddr = 2*8; reloc.symidx = 1+2+nrsym+2+2;\n    reloc.type = PEOBJ_RELOC_ADDR32NB;\n    owrite(ctx, &reloc, PEOBJ_RELOC_SIZE);\n  }\n#endif\n\n  /* Write .rdata$Z section. */\n  owrite(ctx, ctx->dasm_ident, strlen(ctx->dasm_ident)+1);\n\n  /* Write symbol table. */\n  strtab = NULL;  /* 1st pass: collect string sizes. */\n  for (;;) {\n    strtabofs = 4;\n    /* Mark as SafeSEH compliant. */\n    emit_peobj_sym(ctx, \"@feat.00\", 1,\n\t\t   PEOBJ_SECT_ABS, PEOBJ_TYPE_NULL, PEOBJ_SCL_STATIC);\n\n    emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_TEXT);\n    for (i = 0; i < nrsym; i++)\n      emit_peobj_sym(ctx, ctx->relocsym[i], 0,\n\t\t     PEOBJ_SECT_UNDEF, PEOBJ_TYPE_FUNC, PEOBJ_SCL_EXTERN);\n\n#if LJ_TARGET_X64\n    emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_PDATA);\n    emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_XDATA);\n    emit_peobj_sym(ctx, \"lj_err_unwind_win64\", 0,\n\t\t   PEOBJ_SECT_UNDEF, PEOBJ_TYPE_FUNC, PEOBJ_SCL_EXTERN);\n#endif\n\n    emit_peobj_sym(ctx, ctx->beginsym, 0,\n\t\t   PEOBJ_SECT_TEXT, PEOBJ_TYPE_NULL, PEOBJ_SCL_EXTERN);\n    for (i = 0; i < ctx->nsym; i++)\n      emit_peobj_sym(ctx, ctx->sym[i].name, (uint32_t)ctx->sym[i].ofs,\n\t\t     PEOBJ_SECT_TEXT, PEOBJ_TYPE_FUNC, PEOBJ_SCL_EXTERN);\n\n    emit_peobj_sym_sect(ctx, pesect, PEOBJ_SECT_RDATA_Z);\n\n    if (strtab)\n      break;\n    /* 2nd pass: alloc strtab, write syms and copy strings. */\n    strtab = (char *)malloc(strtabofs);\n    *(uint32_t *)strtab = (uint32_t)strtabofs;\n  }\n\n  /* Write string table. */\n  owrite(ctx, strtab, strtabofs);\n}\n\n#else\n\nvoid emit_peobj(BuildCtx *ctx)\n{\n  UNUSED(ctx);\n  fprintf(stderr, \"Error: no PE object support for this target\\n\");\n  exit(1);\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/genminilua.lua",
    "content": "----------------------------------------------------------------------------\n-- Lua script to generate a customized, minified version of Lua.\n-- The resulting 'minilua' is used for the build process of LuaJIT.\n----------------------------------------------------------------------------\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n\nlocal sub, match, gsub = string.sub, string.match, string.gsub\n\nlocal LUA_VERSION = \"5.1.5\"\nlocal LUA_SOURCE\n\nlocal function usage()\n  io.stderr:write(\"Usage: \", arg and arg[0] or \"genminilua\",\n\t\t  \" lua-\", LUA_VERSION, \"-source-dir\\n\")\n  os.exit(1)\nend\n\nlocal function find_sources()\n  LUA_SOURCE = arg and arg[1]\n  if not LUA_SOURCE then usage() end\n  if sub(LUA_SOURCE, -1) ~= \"/\" then LUA_SOURCE = LUA_SOURCE..\"/\" end\n  local fp = io.open(LUA_SOURCE .. \"lua.h\")\n  if not fp then\n    LUA_SOURCE = LUA_SOURCE..\"src/\"\n    fp = io.open(LUA_SOURCE .. \"lua.h\")\n    if not fp then usage() end\n  end\n  local all = fp:read(\"*a\")\n  fp:close()\n  if not match(all, 'LUA_RELEASE%s*\"Lua '..LUA_VERSION..'\"') then\n    io.stderr:write(\"Error: version mismatch\\n\")\n    usage()\n  end\nend\n\nlocal LUA_FILES = {\n\"lmem.c\", \"lobject.c\", \"ltm.c\", \"lfunc.c\", \"ldo.c\", \"lstring.c\", \"ltable.c\",\n\"lgc.c\", \"lstate.c\", \"ldebug.c\", \"lzio.c\", \"lopcodes.c\",\n\"llex.c\", \"lcode.c\", \"lparser.c\", \"lvm.c\", \"lapi.c\", \"lauxlib.c\",\n\"lbaselib.c\", \"ltablib.c\", \"liolib.c\", \"loslib.c\", \"lstrlib.c\", \"linit.c\",\n}\n\nlocal REMOVE_LIB = {}\ngsub([[\ncollectgarbage dofile gcinfo getfenv getmetatable load print rawequal rawset\nselect tostring xpcall\nforeach foreachi getn maxn setn\npopen tmpfile seek setvbuf __tostring\nclock date difftime execute getenv rename setlocale time tmpname\ndump gfind len reverse\nLUA_LOADLIBNAME LUA_MATHLIBNAME LUA_DBLIBNAME\n]], \"%S+\", function(name)\n  REMOVE_LIB[name] = true\nend)\n\nlocal REMOVE_EXTINC = { [\"<assert.h>\"] = true, [\"<locale.h>\"] = true, }\n\nlocal CUSTOM_MAIN = [[\ntypedef unsigned int UB;\nstatic UB barg(lua_State *L,int idx){\nunion{lua_Number n;U64 b;}bn;\nbn.n=lua_tonumber(L,idx)+6755399441055744.0;\nif (bn.n==0.0&&!lua_isnumber(L,idx))luaL_typerror(L,idx,\"number\");\nreturn(UB)bn.b;\n}\n#define BRET(b) lua_pushnumber(L,(lua_Number)(int)(b));return 1;\nstatic int tobit(lua_State *L){\nBRET(barg(L,1))}\nstatic int bnot(lua_State *L){\nBRET(~barg(L,1))}\nstatic int band(lua_State *L){\nint i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b&=barg(L,i);BRET(b)}\nstatic int bor(lua_State *L){\nint i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b|=barg(L,i);BRET(b)}\nstatic int bxor(lua_State *L){\nint i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b^=barg(L,i);BRET(b)}\nstatic int lshift(lua_State *L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET(b<<n)}\nstatic int rshift(lua_State *L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET(b>>n)}\nstatic int arshift(lua_State *L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET((int)b>>n)}\nstatic int rol(lua_State *L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET((b<<n)|(b>>(32-n)))}\nstatic int ror(lua_State *L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET((b>>n)|(b<<(32-n)))}\nstatic int bswap(lua_State *L){\nUB b=barg(L,1);b=(b>>24)|((b>>8)&0xff00)|((b&0xff00)<<8)|(b<<24);BRET(b)}\nstatic int tohex(lua_State *L){\nUB b=barg(L,1);\nint n=lua_isnone(L,2)?8:(int)barg(L,2);\nconst char *hexdigits=\"0123456789abcdef\";\nchar buf[8];\nint i;\nif(n<0){n=-n;hexdigits=\"0123456789ABCDEF\";}\nif(n>8)n=8;\nfor(i=(int)n;--i>=0;){buf[i]=hexdigits[b&15];b>>=4;}\nlua_pushlstring(L,buf,(size_t)n);\nreturn 1;\n}\nstatic const struct luaL_Reg bitlib[] = {\n{\"tobit\",tobit},\n{\"bnot\",bnot},\n{\"band\",band},\n{\"bor\",bor},\n{\"bxor\",bxor},\n{\"lshift\",lshift},\n{\"rshift\",rshift},\n{\"arshift\",arshift},\n{\"rol\",rol},\n{\"ror\",ror},\n{\"bswap\",bswap},\n{\"tohex\",tohex},\n{NULL,NULL}\n};\nint main(int argc, char **argv){\n  lua_State *L = luaL_newstate();\n  int i;\n  luaL_openlibs(L);\n  luaL_register(L, \"bit\", bitlib);\n  if (argc < 2) return sizeof(void *);\n  lua_createtable(L, 0, 1);\n  lua_pushstring(L, argv[1]);\n  lua_rawseti(L, -2, 0);\n  lua_setglobal(L, \"arg\");\n  if (luaL_loadfile(L, argv[1]))\n    goto err;\n  for (i = 2; i < argc; i++)\n    lua_pushstring(L, argv[i]);\n  if (lua_pcall(L, argc - 2, 0, 0)) {\n  err:\n    fprintf(stderr, \"Error: %s\\n\", lua_tostring(L, -1));\n    return 1;\n  }\n  lua_close(L);\n  return 0;\n}\n]]\n\nlocal function read_sources()\n  local t = {}\n  for i, name in ipairs(LUA_FILES) do\n    local fp = assert(io.open(LUA_SOURCE..name, \"r\"))\n    t[i] = fp:read(\"*a\")\n    assert(fp:close())\n  end\n  t[#t+1] = CUSTOM_MAIN\n  return table.concat(t)\nend\n\nlocal includes = {}\n\nlocal function merge_includes(src)\n  return gsub(src, '#include%s*\"([^\"]*)\"%s*\\n', function(name)\n    if includes[name] then return \"\" end\n    includes[name] = true\n    local fp = assert(io.open(LUA_SOURCE..name, \"r\"))\n    local src = fp:read(\"*a\")\n    assert(fp:close())\n    src = gsub(src, \"#ifndef%s+%w+_h\\n#define%s+%w+_h\\n\", \"\")\n    src = gsub(src, \"#endif%s*$\", \"\")\n    return merge_includes(src)\n  end)\nend\n\nlocal function get_license(src)\n  return match(src, \"/%*+\\n%* Copyright %(.-%*/\\n\")\nend\n\nlocal function fold_lines(src)\n  return gsub(src, \"\\\\\\n\", \" \")\nend\n\nlocal strings = {}\n\nlocal function save_str(str)\n  local n = #strings+1\n  strings[n] = str\n  return \"\\1\"..n..\"\\2\"\nend\n\nlocal function save_strings(src)\n  src = gsub(src, '\"[^\"\\n]*\"', save_str)\n  return gsub(src, \"'[^'\\n]*'\", save_str)\nend\n\nlocal function restore_strings(src)\n  return gsub(src, \"\\1(%d+)\\2\", function(numstr)\n    return strings[tonumber(numstr)]\n  end)\nend\n\nlocal function def_istrue(def)\n  return def == \"INT_MAX > 2147483640L\" or\n\t def == \"LUAI_BITSINT >= 32\" or\n\t def == \"SIZE_Bx < LUAI_BITSINT-1\" or\n\t def == \"cast\" or\n\t def == \"defined(LUA_CORE)\" or\n\t def == \"MINSTRTABSIZE\" or\n\t def == \"LUA_MINBUFFER\" or\n\t def == \"HARDSTACKTESTS\" or\n\t def == \"UNUSED\"\nend\n\nlocal head, defs = {[[\n#ifdef _MSC_VER\ntypedef unsigned __int64 U64;\n#else\ntypedef unsigned long long U64;\n#endif\n]]}, {}\n\nlocal function preprocess(src)\n  local t = { match(src, \"^(.-)#\") }\n  local lvl, on, oldon = 0, true, {}\n  for pp, def, txt in string.gmatch(src, \"#(%w+) *([^\\n]*)\\n([^#]*)\") do\n    if pp == \"if\" or pp == \"ifdef\" or pp == \"ifndef\" then\n      lvl = lvl + 1\n      oldon[lvl] = on\n      on = def_istrue(def)\n    elseif pp == \"else\" then\n      if oldon[lvl] then\n\tif on == false then on = true else on = false end\n      end\n    elseif pp == \"elif\" then\n      if oldon[lvl] then\n\ton = def_istrue(def)\n      end\n    elseif pp == \"endif\" then\n      on = oldon[lvl]\n      lvl = lvl - 1\n    elseif on then\n      if pp == \"include\" then\n\tif not head[def] and not REMOVE_EXTINC[def] then\n\t  head[def] = true\n\t  head[#head+1] = \"#include \"..def..\"\\n\"\n\tend\n      elseif pp == \"define\" then\n\tlocal k, sp, v = match(def, \"([%w_]+)(%s*)(.*)\")\n\tif k and not (sp == \"\" and sub(v, 1, 1) == \"(\") then\n\t  defs[k] = gsub(v, \"%a[%w_]*\", function(tok)\n\t    return defs[tok] or tok\n\t  end)\n\telse\n\t  t[#t+1] = \"#define \"..def..\"\\n\"\n\tend\n      elseif pp ~= \"undef\" then\n\terror(\"unexpected directive: \"..pp..\" \"..def)\n      end\n    end\n    if on then t[#t+1] = txt end\n  end\n  return gsub(table.concat(t), \"%a[%w_]*\", function(tok)\n    return defs[tok] or tok\n  end)\nend\n\nlocal function merge_header(src, license)\n  local hdr = string.format([[\n/* This is a heavily customized and minimized copy of Lua %s. */\n/* It's only used to build LuaJIT. It does NOT have all standard functions! */\n]], LUA_VERSION)\n  return hdr..license..table.concat(head)..src\nend\n\nlocal function strip_unused1(src)\n  return gsub(src, '(  {\"?([%w_]+)\"?,%s+%a[%w_]*},\\n)', function(line, func)\n    return REMOVE_LIB[func] and \"\" or line\n  end)\nend\n\nlocal function strip_unused2(src)\n  return gsub(src, \"Symbolic Execution.-}=\", \"\")\nend\n\nlocal function strip_unused3(src)\n  src = gsub(src, \"extern\", \"static\")\n  src = gsub(src, \"\\nstatic([^\\n]-)%(([^)]*)%)%(\", \"\\nstatic%1 %2(\")\n  src = gsub(src, \"#define lua_assert[^\\n]*\\n\", \"\")\n  src = gsub(src, \"lua_assert%b();?\", \"\")\n  src = gsub(src, \"default:\\n}\", \"default:;\\n}\")\n  src = gsub(src, \"lua_lock%b();\", \"\")\n  src = gsub(src, \"lua_unlock%b();\", \"\")\n  src = gsub(src, \"luai_threadyield%b();\", \"\")\n  src = gsub(src, \"luai_userstateopen%b();\", \"{}\")\n  src = gsub(src, \"luai_userstate%w+%b();\", \"\")\n  src = gsub(src, \"%(%(c==.*luaY_parser%)\", \"luaY_parser\")\n  src = gsub(src, \"trydecpoint%(ls,seminfo%)\",\n\t\t  \"luaX_lexerror(ls,\\\"malformed number\\\",TK_NUMBER)\")\n  src = gsub(src, \"int c=luaZ_lookahead%b();\", \"\")\n  src = gsub(src, \"luaL_register%(L,[^,]*,co_funcs%);\\nreturn 2;\",\n\t\t  \"return 1;\")\n  src = gsub(src, \"getfuncname%b():\", \"NULL:\")\n  src = gsub(src, \"getobjname%b():\", \"NULL:\")\n  src = gsub(src, \"if%([^\\n]*hookmask[^\\n]*%)\\n[^\\n]*\\n\", \"\")\n  src = gsub(src, \"if%([^\\n]*hookmask[^\\n]*%)%b{}\\n\", \"\")\n  src = gsub(src, \"if%([^\\n]*hookmask[^\\n]*&&\\n[^\\n]*%b{}\\n\", \"\")\n  src = gsub(src, \"(twoto%b()%()\", \"%1(size_t)\")\n  src = gsub(src, \"i<sizenode\", \"i<(int)sizenode\")\n  return gsub(src, \"\\n\\n+\", \"\\n\")\nend\n\nlocal function strip_comments(src)\n  return gsub(src, \"/%*.-%*/\", \" \")\nend\n\nlocal function strip_whitespace(src)\n  src = gsub(src, \"^%s+\", \"\")\n  src = gsub(src, \"%s*\\n%s*\", \"\\n\")\n  src = gsub(src, \"[ \\t]+\", \" \")\n  src = gsub(src, \"(%W) \", \"%1\")\n  return gsub(src, \" (%W)\", \"%1\")\nend\n\nlocal function rename_tokens1(src)\n  src = gsub(src, \"getline\", \"getline_\")\n  src = gsub(src, \"struct ([%w_]+)\", \"ZX%1\")\n  return gsub(src, \"union ([%w_]+)\", \"ZY%1\")\nend\n\nlocal function rename_tokens2(src)\n  src = gsub(src, \"ZX([%w_]+)\", \"struct %1\")\n  return gsub(src, \"ZY([%w_]+)\", \"union %1\")\nend\n\nlocal function func_gather(src)\n  local nodes, list = {}, {}\n  local pos, len = 1, #src\n  while pos < len do\n    local d, w = match(src, \"^(#define ([%w_]+)[^\\n]*\\n)\", pos)\n    if d then\n      local n = #list+1\n      list[n] = d\n      nodes[w] = n\n    else\n      local s\n      d, w, s = match(src, \"^(([%w_]+)[^\\n]*([{;])\\n)\", pos)\n      if not d then\n\td, w, s = match(src, \"^(([%w_]+)[^(]*%b()([{;])\\n)\", pos)\n\tif not d then d = match(src, \"^[^\\n]*\\n\", pos) end\n      end\n      if s == \"{\" then\n\td = d..sub(match(src, \"^%b{}[^;\\n]*;?\\n\", pos+#d-2), 3)\n\tif sub(d, -2) == \"{\\n\" then\n\t  d = d..sub(match(src, \"^%b{}[^;\\n]*;?\\n\", pos+#d-2), 3)\n\tend\n      end\n      local k, v = nil, d\n      if w == \"typedef\" then\n\tif match(d, \"^typedef enum\") then\n\t  head[#head+1] = d\n\telse\n\t  k = match(d, \"([%w_]+);\\n$\")\n\t  if not k then k = match(d, \"^.-%(.-([%w_]+)%)%(\") end\n\tend\n      elseif w == \"enum\" then\n\thead[#head+1] = v\n      elseif w ~= nil then\n\tk = match(d, \"^[^\\n]-([%w_]+)[(%[=]\")\n\tif k then\n\t  if w ~= \"static\" and k ~= \"main\" then v = \"static \"..d end\n\telse\n\t  k = w\n\tend\n      end\n      if w and k then\n\tlocal o = nodes[k]\n\tif o then nodes[\"*\"..k] = o end\n\tlocal n = #list+1\n\tlist[n] = v\n\tnodes[k] = n\n      end\n    end\n    pos = pos + #d\n  end\n  return nodes, list\nend\n\nlocal function func_visit(nodes, list, used, n)\n  local i = nodes[n]\n  for m in string.gmatch(list[i], \"[%w_]+\") do\n    if nodes[m] then\n      local j = used[m]\n      if not j then\n\tused[m] = i\n\tfunc_visit(nodes, list, used, m)\n      elseif i < j then\n\tused[m] = i\n      end\n    end\n  end\nend\n\nlocal function func_collect(src)\n  local nodes, list = func_gather(src)\n  local used = {}\n  func_visit(nodes, list, used, \"main\")\n  for n,i in pairs(nodes) do\n    local j = used[n]\n    if j and j < i then used[\"*\"..n] = j end\n  end\n  for n,i in pairs(nodes) do\n    if not used[n] then list[i] = \"\" end\n  end\n  return table.concat(list)\nend\n\nfind_sources()\nlocal src = read_sources()\nsrc = merge_includes(src)\nlocal license = get_license(src)\nsrc = fold_lines(src)\nsrc = strip_unused1(src)\nsrc = save_strings(src)\nsrc = strip_unused2(src)\nsrc = strip_comments(src)\nsrc = preprocess(src)\nsrc = strip_whitespace(src)\nsrc = strip_unused3(src)\nsrc = rename_tokens1(src)\nsrc = func_collect(src)\nsrc = rename_tokens2(src)\nsrc = restore_strings(src)\nsrc = merge_header(src, license)\nio.write(src)\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/host/minilua.c",
    "content": "/* This is a heavily customized and minimized copy of Lua 5.1.5. */\n/* It's only used to build LuaJIT. It does NOT have all standard functions! */\n/******************************************************************************\n* Copyright (C) 1994-2012 Lua.org, PUC-Rio.  All rights reserved.\n*\n* Permission is hereby granted, free of charge, to any person obtaining\n* a copy of this software and associated documentation files (the\n* \"Software\"), to deal in the Software without restriction, including\n* without limitation the rights to use, copy, modify, merge, publish,\n* distribute, sublicense, and/or sell copies of the Software, and to\n* permit persons to whom the Software is furnished to do so, subject to\n* the following conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n******************************************************************************/\n#ifdef _MSC_VER\ntypedef unsigned __int64 U64;\n#else\ntypedef unsigned long long U64;\n#endif\n#include <stddef.h>\n#include <stdarg.h>\n#include <limits.h>\n#include <math.h>\n#include <ctype.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <setjmp.h>\n#include <errno.h>\n#include <time.h>\ntypedef enum{\nTM_INDEX,\nTM_NEWINDEX,\nTM_GC,\nTM_MODE,\nTM_EQ,\nTM_ADD,\nTM_SUB,\nTM_MUL,\nTM_DIV,\nTM_MOD,\nTM_POW,\nTM_UNM,\nTM_LEN,\nTM_LT,\nTM_LE,\nTM_CONCAT,\nTM_CALL,\nTM_N\n}TMS;\nenum OpMode{iABC,iABx,iAsBx};\ntypedef enum{\nOP_MOVE,\nOP_LOADK,\nOP_LOADBOOL,\nOP_LOADNIL,\nOP_GETUPVAL,\nOP_GETGLOBAL,\nOP_GETTABLE,\nOP_SETGLOBAL,\nOP_SETUPVAL,\nOP_SETTABLE,\nOP_NEWTABLE,\nOP_SELF,\nOP_ADD,\nOP_SUB,\nOP_MUL,\nOP_DIV,\nOP_MOD,\nOP_POW,\nOP_UNM,\nOP_NOT,\nOP_LEN,\nOP_CONCAT,\nOP_JMP,\nOP_EQ,\nOP_LT,\nOP_LE,\nOP_TEST,\nOP_TESTSET,\nOP_CALL,\nOP_TAILCALL,\nOP_RETURN,\nOP_FORLOOP,\nOP_FORPREP,\nOP_TFORLOOP,\nOP_SETLIST,\nOP_CLOSE,\nOP_CLOSURE,\nOP_VARARG\n}OpCode;\nenum OpArgMask{\nOpArgN,\nOpArgU,\nOpArgR,\nOpArgK\n};\ntypedef enum{\nVVOID,\nVNIL,\nVTRUE,\nVFALSE,\nVK,\nVKNUM,\nVLOCAL,\nVUPVAL,\nVGLOBAL,\nVINDEXED,\nVJMP,\nVRELOCABLE,\nVNONRELOC,\nVCALL,\nVVARARG\n}expkind;\nenum RESERVED{\nTK_AND=257,TK_BREAK,\nTK_DO,TK_ELSE,TK_ELSEIF,TK_END,TK_FALSE,TK_FOR,TK_FUNCTION,\nTK_IF,TK_IN,TK_LOCAL,TK_NIL,TK_NOT,TK_OR,TK_REPEAT,\nTK_RETURN,TK_THEN,TK_TRUE,TK_UNTIL,TK_WHILE,\nTK_CONCAT,TK_DOTS,TK_EQ,TK_GE,TK_LE,TK_NE,TK_NUMBER,\nTK_NAME,TK_STRING,TK_EOS\n};\ntypedef enum BinOpr{\nOPR_ADD,OPR_SUB,OPR_MUL,OPR_DIV,OPR_MOD,OPR_POW,\nOPR_CONCAT,\nOPR_NE,OPR_EQ,\nOPR_LT,OPR_LE,OPR_GT,OPR_GE,\nOPR_AND,OPR_OR,\nOPR_NOBINOPR\n}BinOpr;\ntypedef enum UnOpr{OPR_MINUS,OPR_NOT,OPR_LEN,OPR_NOUNOPR}UnOpr;\n#define LUA_QL(x)\"'\"x\"'\"\n#define luai_apicheck(L,o){(void)L;}\n#define lua_number2str(s,n)sprintf((s),\"%.14g\",(n))\n#define lua_str2number(s,p)strtod((s),(p))\n#define luai_numadd(a,b)((a)+(b))\n#define luai_numsub(a,b)((a)-(b))\n#define luai_nummul(a,b)((a)*(b))\n#define luai_numdiv(a,b)((a)/(b))\n#define luai_nummod(a,b)((a)-floor((a)/(b))*(b))\n#define luai_numpow(a,b)(pow(a,b))\n#define luai_numunm(a)(-(a))\n#define luai_numeq(a,b)((a)==(b))\n#define luai_numlt(a,b)((a)<(b))\n#define luai_numle(a,b)((a)<=(b))\n#define luai_numisnan(a)(!luai_numeq((a),(a)))\n#define lua_number2int(i,d)((i)=(int)(d))\n#define lua_number2integer(i,d)((i)=(lua_Integer)(d))\n#define LUAI_THROW(L,c)longjmp((c)->b,1)\n#define LUAI_TRY(L,c,a)if(setjmp((c)->b)==0){a}\n#define lua_pclose(L,file)((void)((void)L,file),0)\n#define lua_upvalueindex(i)((-10002)-(i))\ntypedef struct lua_State lua_State;\ntypedef int(*lua_CFunction)(lua_State*L);\ntypedef const char*(*lua_Reader)(lua_State*L,void*ud,size_t*sz);\ntypedef void*(*lua_Alloc)(void*ud,void*ptr,size_t osize,size_t nsize);\ntypedef double lua_Number;\ntypedef ptrdiff_t lua_Integer;\nstatic void lua_settop(lua_State*L,int idx);\nstatic int lua_type(lua_State*L,int idx);\nstatic const char* lua_tolstring(lua_State*L,int idx,size_t*len);\nstatic size_t lua_objlen(lua_State*L,int idx);\nstatic void lua_pushlstring(lua_State*L,const char*s,size_t l);\nstatic void lua_pushcclosure(lua_State*L,lua_CFunction fn,int n);\nstatic void lua_createtable(lua_State*L,int narr,int nrec);\nstatic void lua_setfield(lua_State*L,int idx,const char*k);\n#define lua_pop(L,n)lua_settop(L,-(n)-1)\n#define lua_newtable(L)lua_createtable(L,0,0)\n#define lua_pushcfunction(L,f)lua_pushcclosure(L,(f),0)\n#define lua_strlen(L,i)lua_objlen(L,(i))\n#define lua_isfunction(L,n)(lua_type(L,(n))==6)\n#define lua_istable(L,n)(lua_type(L,(n))==5)\n#define lua_isnil(L,n)(lua_type(L,(n))==0)\n#define lua_isboolean(L,n)(lua_type(L,(n))==1)\n#define lua_isnone(L,n)(lua_type(L,(n))==(-1))\n#define lua_isnoneornil(L,n)(lua_type(L,(n))<=0)\n#define lua_pushliteral(L,s)lua_pushlstring(L,\"\"s,(sizeof(s)/sizeof(char))-1)\n#define lua_setglobal(L,s)lua_setfield(L,(-10002),(s))\n#define lua_tostring(L,i)lua_tolstring(L,(i),NULL)\ntypedef struct lua_Debug lua_Debug;\ntypedef void(*lua_Hook)(lua_State*L,lua_Debug*ar);\nstruct lua_Debug{\nint event;\nconst char*name;\nconst char*namewhat;\nconst char*what;\nconst char*source;\nint currentline;\nint nups;\nint linedefined;\nint lastlinedefined;\nchar short_src[60];\nint i_ci;\n};\ntypedef unsigned int lu_int32;\ntypedef size_t lu_mem;\ntypedef ptrdiff_t l_mem;\ntypedef unsigned char lu_byte;\n#define IntPoint(p)((unsigned int)(lu_mem)(p))\ntypedef union{double u;void*s;long l;}L_Umaxalign;\ntypedef double l_uacNumber;\n#define check_exp(c,e)(e)\n#define UNUSED(x)((void)(x))\n#define cast(t,exp)((t)(exp))\n#define cast_byte(i)cast(lu_byte,(i))\n#define cast_num(i)cast(lua_Number,(i))\n#define cast_int(i)cast(int,(i))\ntypedef lu_int32 Instruction;\n#define condhardstacktests(x)((void)0)\ntypedef union GCObject GCObject;\ntypedef struct GCheader{\nGCObject*next;lu_byte tt;lu_byte marked;\n}GCheader;\ntypedef union{\nGCObject*gc;\nvoid*p;\nlua_Number n;\nint b;\n}Value;\ntypedef struct lua_TValue{\nValue value;int tt;\n}TValue;\n#define ttisnil(o)(ttype(o)==0)\n#define ttisnumber(o)(ttype(o)==3)\n#define ttisstring(o)(ttype(o)==4)\n#define ttistable(o)(ttype(o)==5)\n#define ttisfunction(o)(ttype(o)==6)\n#define ttisboolean(o)(ttype(o)==1)\n#define ttisuserdata(o)(ttype(o)==7)\n#define ttisthread(o)(ttype(o)==8)\n#define ttislightuserdata(o)(ttype(o)==2)\n#define ttype(o)((o)->tt)\n#define gcvalue(o)check_exp(iscollectable(o),(o)->value.gc)\n#define pvalue(o)check_exp(ttislightuserdata(o),(o)->value.p)\n#define nvalue(o)check_exp(ttisnumber(o),(o)->value.n)\n#define rawtsvalue(o)check_exp(ttisstring(o),&(o)->value.gc->ts)\n#define tsvalue(o)(&rawtsvalue(o)->tsv)\n#define rawuvalue(o)check_exp(ttisuserdata(o),&(o)->value.gc->u)\n#define uvalue(o)(&rawuvalue(o)->uv)\n#define clvalue(o)check_exp(ttisfunction(o),&(o)->value.gc->cl)\n#define hvalue(o)check_exp(ttistable(o),&(o)->value.gc->h)\n#define bvalue(o)check_exp(ttisboolean(o),(o)->value.b)\n#define thvalue(o)check_exp(ttisthread(o),&(o)->value.gc->th)\n#define l_isfalse(o)(ttisnil(o)||(ttisboolean(o)&&bvalue(o)==0))\n#define checkconsistency(obj)\n#define checkliveness(g,obj)\n#define setnilvalue(obj)((obj)->tt=0)\n#define setnvalue(obj,x){TValue*i_o=(obj);i_o->value.n=(x);i_o->tt=3;}\n#define setbvalue(obj,x){TValue*i_o=(obj);i_o->value.b=(x);i_o->tt=1;}\n#define setsvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=4;checkliveness(G(L),i_o);}\n#define setuvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=7;checkliveness(G(L),i_o);}\n#define setthvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=8;checkliveness(G(L),i_o);}\n#define setclvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=6;checkliveness(G(L),i_o);}\n#define sethvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=5;checkliveness(G(L),i_o);}\n#define setptvalue(L,obj,x){TValue*i_o=(obj);i_o->value.gc=cast(GCObject*,(x));i_o->tt=(8+1);checkliveness(G(L),i_o);}\n#define setobj(L,obj1,obj2){const TValue*o2=(obj2);TValue*o1=(obj1);o1->value=o2->value;o1->tt=o2->tt;checkliveness(G(L),o1);}\n#define setttype(obj,tt)(ttype(obj)=(tt))\n#define iscollectable(o)(ttype(o)>=4)\ntypedef TValue*StkId;\ntypedef union TString{\nL_Umaxalign dummy;\nstruct{\nGCObject*next;lu_byte tt;lu_byte marked;\nlu_byte reserved;\nunsigned int hash;\nsize_t len;\n}tsv;\n}TString;\n#define getstr(ts)cast(const char*,(ts)+1)\n#define svalue(o)getstr(rawtsvalue(o))\ntypedef union Udata{\nL_Umaxalign dummy;\nstruct{\nGCObject*next;lu_byte tt;lu_byte marked;\nstruct Table*metatable;\nstruct Table*env;\nsize_t len;\n}uv;\n}Udata;\ntypedef struct Proto{\nGCObject*next;lu_byte tt;lu_byte marked;\nTValue*k;\nInstruction*code;\nstruct Proto**p;\nint*lineinfo;\nstruct LocVar*locvars;\nTString**upvalues;\nTString*source;\nint sizeupvalues;\nint sizek;\nint sizecode;\nint sizelineinfo;\nint sizep;\nint sizelocvars;\nint linedefined;\nint lastlinedefined;\nGCObject*gclist;\nlu_byte nups;\nlu_byte numparams;\nlu_byte is_vararg;\nlu_byte maxstacksize;\n}Proto;\ntypedef struct LocVar{\nTString*varname;\nint startpc;\nint endpc;\n}LocVar;\ntypedef struct UpVal{\nGCObject*next;lu_byte tt;lu_byte marked;\nTValue*v;\nunion{\nTValue value;\nstruct{\nstruct UpVal*prev;\nstruct UpVal*next;\n}l;\n}u;\n}UpVal;\ntypedef struct CClosure{\nGCObject*next;lu_byte tt;lu_byte marked;lu_byte isC;lu_byte nupvalues;GCObject*gclist;struct Table*env;\nlua_CFunction f;\nTValue upvalue[1];\n}CClosure;\ntypedef struct LClosure{\nGCObject*next;lu_byte tt;lu_byte marked;lu_byte isC;lu_byte nupvalues;GCObject*gclist;struct Table*env;\nstruct Proto*p;\nUpVal*upvals[1];\n}LClosure;\ntypedef union Closure{\nCClosure c;\nLClosure l;\n}Closure;\n#define iscfunction(o)(ttype(o)==6&&clvalue(o)->c.isC)\ntypedef union TKey{\nstruct{\nValue value;int tt;\nstruct Node*next;\n}nk;\nTValue tvk;\n}TKey;\ntypedef struct Node{\nTValue i_val;\nTKey i_key;\n}Node;\ntypedef struct Table{\nGCObject*next;lu_byte tt;lu_byte marked;\nlu_byte flags;\nlu_byte lsizenode;\nstruct Table*metatable;\nTValue*array;\nNode*node;\nNode*lastfree;\nGCObject*gclist;\nint sizearray;\n}Table;\n#define lmod(s,size)(check_exp((size&(size-1))==0,(cast(int,(s)&((size)-1)))))\n#define twoto(x)((size_t)1<<(x))\n#define sizenode(t)(twoto((t)->lsizenode))\nstatic const TValue luaO_nilobject_;\n#define ceillog2(x)(luaO_log2((x)-1)+1)\nstatic int luaO_log2(unsigned int x);\n#define gfasttm(g,et,e)((et)==NULL?NULL:((et)->flags&(1u<<(e)))?NULL:luaT_gettm(et,e,(g)->tmname[e]))\n#define fasttm(l,et,e)gfasttm(G(l),et,e)\nstatic const TValue*luaT_gettm(Table*events,TMS event,TString*ename);\n#define luaM_reallocv(L,b,on,n,e)((cast(size_t,(n)+1)<=((size_t)(~(size_t)0)-2)/(e))?luaM_realloc_(L,(b),(on)*(e),(n)*(e)):luaM_toobig(L))\n#define luaM_freemem(L,b,s)luaM_realloc_(L,(b),(s),0)\n#define luaM_free(L,b)luaM_realloc_(L,(b),sizeof(*(b)),0)\n#define luaM_freearray(L,b,n,t)luaM_reallocv(L,(b),n,0,sizeof(t))\n#define luaM_malloc(L,t)luaM_realloc_(L,NULL,0,(t))\n#define luaM_new(L,t)cast(t*,luaM_malloc(L,sizeof(t)))\n#define luaM_newvector(L,n,t)cast(t*,luaM_reallocv(L,NULL,0,n,sizeof(t)))\n#define luaM_growvector(L,v,nelems,size,t,limit,e)if((nelems)+1>(size))((v)=cast(t*,luaM_growaux_(L,v,&(size),sizeof(t),limit,e)))\n#define luaM_reallocvector(L,v,oldn,n,t)((v)=cast(t*,luaM_reallocv(L,v,oldn,n,sizeof(t))))\nstatic void*luaM_realloc_(lua_State*L,void*block,size_t oldsize,\nsize_t size);\nstatic void*luaM_toobig(lua_State*L);\nstatic void*luaM_growaux_(lua_State*L,void*block,int*size,\nsize_t size_elem,int limit,\nconst char*errormsg);\ntypedef struct Zio ZIO;\n#define char2int(c)cast(int,cast(unsigned char,(c)))\n#define zgetc(z)(((z)->n--)>0?char2int(*(z)->p++):luaZ_fill(z))\ntypedef struct Mbuffer{\nchar*buffer;\nsize_t n;\nsize_t buffsize;\n}Mbuffer;\n#define luaZ_initbuffer(L,buff)((buff)->buffer=NULL,(buff)->buffsize=0)\n#define luaZ_buffer(buff)((buff)->buffer)\n#define luaZ_sizebuffer(buff)((buff)->buffsize)\n#define luaZ_bufflen(buff)((buff)->n)\n#define luaZ_resetbuffer(buff)((buff)->n=0)\n#define luaZ_resizebuffer(L,buff,size)(luaM_reallocvector(L,(buff)->buffer,(buff)->buffsize,size,char),(buff)->buffsize=size)\n#define luaZ_freebuffer(L,buff)luaZ_resizebuffer(L,buff,0)\nstruct Zio{\nsize_t n;\nconst char*p;\nlua_Reader reader;\nvoid*data;\nlua_State*L;\n};\nstatic int luaZ_fill(ZIO*z);\nstruct lua_longjmp;\n#define gt(L)(&L->l_gt)\n#define registry(L)(&G(L)->l_registry)\ntypedef struct stringtable{\nGCObject**hash;\nlu_int32 nuse;\nint size;\n}stringtable;\ntypedef struct CallInfo{\nStkId base;\nStkId func;\nStkId top;\nconst Instruction*savedpc;\nint nresults;\nint tailcalls;\n}CallInfo;\n#define curr_func(L)(clvalue(L->ci->func))\n#define ci_func(ci)(clvalue((ci)->func))\n#define f_isLua(ci)(!ci_func(ci)->c.isC)\n#define isLua(ci)(ttisfunction((ci)->func)&&f_isLua(ci))\ntypedef struct global_State{\nstringtable strt;\nlua_Alloc frealloc;\nvoid*ud;\nlu_byte currentwhite;\nlu_byte gcstate;\nint sweepstrgc;\nGCObject*rootgc;\nGCObject**sweepgc;\nGCObject*gray;\nGCObject*grayagain;\nGCObject*weak;\nGCObject*tmudata;\nMbuffer buff;\nlu_mem GCthreshold;\nlu_mem totalbytes;\nlu_mem estimate;\nlu_mem gcdept;\nint gcpause;\nint gcstepmul;\nlua_CFunction panic;\nTValue l_registry;\nstruct lua_State*mainthread;\nUpVal uvhead;\nstruct Table*mt[(8+1)];\nTString*tmname[TM_N];\n}global_State;\nstruct lua_State{\nGCObject*next;lu_byte tt;lu_byte marked;\nlu_byte status;\nStkId top;\nStkId base;\nglobal_State*l_G;\nCallInfo*ci;\nconst Instruction*savedpc;\nStkId stack_last;\nStkId stack;\nCallInfo*end_ci;\nCallInfo*base_ci;\nint stacksize;\nint size_ci;\nunsigned short nCcalls;\nunsigned short baseCcalls;\nlu_byte hookmask;\nlu_byte allowhook;\nint basehookcount;\nint hookcount;\nlua_Hook hook;\nTValue l_gt;\nTValue env;\nGCObject*openupval;\nGCObject*gclist;\nstruct lua_longjmp*errorJmp;\nptrdiff_t errfunc;\n};\n#define G(L)(L->l_G)\nunion GCObject{\nGCheader gch;\nunion TString ts;\nunion Udata u;\nunion Closure cl;\nstruct Table h;\nstruct Proto p;\nstruct UpVal uv;\nstruct lua_State th;\n};\n#define rawgco2ts(o)check_exp((o)->gch.tt==4,&((o)->ts))\n#define gco2ts(o)(&rawgco2ts(o)->tsv)\n#define rawgco2u(o)check_exp((o)->gch.tt==7,&((o)->u))\n#define gco2u(o)(&rawgco2u(o)->uv)\n#define gco2cl(o)check_exp((o)->gch.tt==6,&((o)->cl))\n#define gco2h(o)check_exp((o)->gch.tt==5,&((o)->h))\n#define gco2p(o)check_exp((o)->gch.tt==(8+1),&((o)->p))\n#define gco2uv(o)check_exp((o)->gch.tt==(8+2),&((o)->uv))\n#define ngcotouv(o)check_exp((o)==NULL||(o)->gch.tt==(8+2),&((o)->uv))\n#define gco2th(o)check_exp((o)->gch.tt==8,&((o)->th))\n#define obj2gco(v)(cast(GCObject*,(v)))\nstatic void luaE_freethread(lua_State*L,lua_State*L1);\n#define pcRel(pc,p)(cast(int,(pc)-(p)->code)-1)\n#define getline_(f,pc)(((f)->lineinfo)?(f)->lineinfo[pc]:0)\n#define resethookcount(L)(L->hookcount=L->basehookcount)\nstatic void luaG_typeerror(lua_State*L,const TValue*o,\nconst char*opname);\nstatic void luaG_runerror(lua_State*L,const char*fmt,...);\n#define luaD_checkstack(L,n)if((char*)L->stack_last-(char*)L->top<=(n)*(int)sizeof(TValue))luaD_growstack(L,n);else condhardstacktests(luaD_reallocstack(L,L->stacksize-5-1));\n#define incr_top(L){luaD_checkstack(L,1);L->top++;}\n#define savestack(L,p)((char*)(p)-(char*)L->stack)\n#define restorestack(L,n)((TValue*)((char*)L->stack+(n)))\n#define saveci(L,p)((char*)(p)-(char*)L->base_ci)\n#define restoreci(L,n)((CallInfo*)((char*)L->base_ci+(n)))\ntypedef void(*Pfunc)(lua_State*L,void*ud);\nstatic int luaD_poscall(lua_State*L,StkId firstResult);\nstatic void luaD_reallocCI(lua_State*L,int newsize);\nstatic void luaD_reallocstack(lua_State*L,int newsize);\nstatic void luaD_growstack(lua_State*L,int n);\nstatic void luaD_throw(lua_State*L,int errcode);\nstatic void*luaM_growaux_(lua_State*L,void*block,int*size,size_t size_elems,\nint limit,const char*errormsg){\nvoid*newblock;\nint newsize;\nif(*size>=limit/2){\nif(*size>=limit)\nluaG_runerror(L,errormsg);\nnewsize=limit;\n}\nelse{\nnewsize=(*size)*2;\nif(newsize<4)\nnewsize=4;\n}\nnewblock=luaM_reallocv(L,block,*size,newsize,size_elems);\n*size=newsize;\nreturn newblock;\n}\nstatic void*luaM_toobig(lua_State*L){\nluaG_runerror(L,\"memory allocation error: block too big\");\nreturn NULL;\n}\nstatic void*luaM_realloc_(lua_State*L,void*block,size_t osize,size_t nsize){\nglobal_State*g=G(L);\nblock=(*g->frealloc)(g->ud,block,osize,nsize);\nif(block==NULL&&nsize>0)\nluaD_throw(L,4);\ng->totalbytes=(g->totalbytes-osize)+nsize;\nreturn block;\n}\n#define resetbits(x,m)((x)&=cast(lu_byte,~(m)))\n#define setbits(x,m)((x)|=(m))\n#define testbits(x,m)((x)&(m))\n#define bitmask(b)(1<<(b))\n#define bit2mask(b1,b2)(bitmask(b1)|bitmask(b2))\n#define l_setbit(x,b)setbits(x,bitmask(b))\n#define resetbit(x,b)resetbits(x,bitmask(b))\n#define testbit(x,b)testbits(x,bitmask(b))\n#define set2bits(x,b1,b2)setbits(x,(bit2mask(b1,b2)))\n#define reset2bits(x,b1,b2)resetbits(x,(bit2mask(b1,b2)))\n#define test2bits(x,b1,b2)testbits(x,(bit2mask(b1,b2)))\n#define iswhite(x)test2bits((x)->gch.marked,0,1)\n#define isblack(x)testbit((x)->gch.marked,2)\n#define isgray(x)(!isblack(x)&&!iswhite(x))\n#define otherwhite(g)(g->currentwhite^bit2mask(0,1))\n#define isdead(g,v)((v)->gch.marked&otherwhite(g)&bit2mask(0,1))\n#define changewhite(x)((x)->gch.marked^=bit2mask(0,1))\n#define gray2black(x)l_setbit((x)->gch.marked,2)\n#define valiswhite(x)(iscollectable(x)&&iswhite(gcvalue(x)))\n#define luaC_white(g)cast(lu_byte,(g)->currentwhite&bit2mask(0,1))\n#define luaC_checkGC(L){condhardstacktests(luaD_reallocstack(L,L->stacksize-5-1));if(G(L)->totalbytes>=G(L)->GCthreshold)luaC_step(L);}\n#define luaC_barrier(L,p,v){if(valiswhite(v)&&isblack(obj2gco(p)))luaC_barrierf(L,obj2gco(p),gcvalue(v));}\n#define luaC_barriert(L,t,v){if(valiswhite(v)&&isblack(obj2gco(t)))luaC_barrierback(L,t);}\n#define luaC_objbarrier(L,p,o){if(iswhite(obj2gco(o))&&isblack(obj2gco(p)))luaC_barrierf(L,obj2gco(p),obj2gco(o));}\n#define luaC_objbarriert(L,t,o){if(iswhite(obj2gco(o))&&isblack(obj2gco(t)))luaC_barrierback(L,t);}\nstatic void luaC_step(lua_State*L);\nstatic void luaC_link(lua_State*L,GCObject*o,lu_byte tt);\nstatic void luaC_linkupval(lua_State*L,UpVal*uv);\nstatic void luaC_barrierf(lua_State*L,GCObject*o,GCObject*v);\nstatic void luaC_barrierback(lua_State*L,Table*t);\n#define sizestring(s)(sizeof(union TString)+((s)->len+1)*sizeof(char))\n#define sizeudata(u)(sizeof(union Udata)+(u)->len)\n#define luaS_new(L,s)(luaS_newlstr(L,s,strlen(s)))\n#define luaS_newliteral(L,s)(luaS_newlstr(L,\"\"s,(sizeof(s)/sizeof(char))-1))\n#define luaS_fix(s)l_setbit((s)->tsv.marked,5)\nstatic TString*luaS_newlstr(lua_State*L,const char*str,size_t l);\n#define tostring(L,o)((ttype(o)==4)||(luaV_tostring(L,o)))\n#define tonumber(o,n)(ttype(o)==3||(((o)=luaV_tonumber(o,n))!=NULL))\n#define equalobj(L,o1,o2)(ttype(o1)==ttype(o2)&&luaV_equalval(L,o1,o2))\nstatic int luaV_equalval(lua_State*L,const TValue*t1,const TValue*t2);\nstatic const TValue*luaV_tonumber(const TValue*obj,TValue*n);\nstatic int luaV_tostring(lua_State*L,StkId obj);\nstatic void luaV_execute(lua_State*L,int nexeccalls);\nstatic void luaV_concat(lua_State*L,int total,int last);\nstatic const TValue luaO_nilobject_={{NULL},0};\nstatic int luaO_int2fb(unsigned int x){\nint e=0;\nwhile(x>=16){\nx=(x+1)>>1;\ne++;\n}\nif(x<8)return x;\nelse return((e+1)<<3)|(cast_int(x)-8);\n}\nstatic int luaO_fb2int(int x){\nint e=(x>>3)&31;\nif(e==0)return x;\nelse return((x&7)+8)<<(e-1);\n}\nstatic int luaO_log2(unsigned int x){\nstatic const lu_byte log_2[256]={\n0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,\n6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,\n7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,\n8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,\n8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8\n};\nint l=-1;\nwhile(x>=256){l+=8;x>>=8;}\nreturn l+log_2[x];\n}\nstatic int luaO_rawequalObj(const TValue*t1,const TValue*t2){\nif(ttype(t1)!=ttype(t2))return 0;\nelse switch(ttype(t1)){\ncase 0:\nreturn 1;\ncase 3:\nreturn luai_numeq(nvalue(t1),nvalue(t2));\ncase 1:\nreturn bvalue(t1)==bvalue(t2);\ncase 2:\nreturn pvalue(t1)==pvalue(t2);\ndefault:\nreturn gcvalue(t1)==gcvalue(t2);\n}\n}\nstatic int luaO_str2d(const char*s,lua_Number*result){\nchar*endptr;\n*result=lua_str2number(s,&endptr);\nif(endptr==s)return 0;\nif(*endptr=='x'||*endptr=='X')\n*result=cast_num(strtoul(s,&endptr,16));\nif(*endptr=='\\0')return 1;\nwhile(isspace(cast(unsigned char,*endptr)))endptr++;\nif(*endptr!='\\0')return 0;\nreturn 1;\n}\nstatic void pushstr(lua_State*L,const char*str){\nsetsvalue(L,L->top,luaS_new(L,str));\nincr_top(L);\n}\nstatic const char*luaO_pushvfstring(lua_State*L,const char*fmt,va_list argp){\nint n=1;\npushstr(L,\"\");\nfor(;;){\nconst char*e=strchr(fmt,'%');\nif(e==NULL)break;\nsetsvalue(L,L->top,luaS_newlstr(L,fmt,e-fmt));\nincr_top(L);\nswitch(*(e+1)){\ncase's':{\nconst char*s=va_arg(argp,char*);\nif(s==NULL)s=\"(null)\";\npushstr(L,s);\nbreak;\n}\ncase'c':{\nchar buff[2];\nbuff[0]=cast(char,va_arg(argp,int));\nbuff[1]='\\0';\npushstr(L,buff);\nbreak;\n}\ncase'd':{\nsetnvalue(L->top,cast_num(va_arg(argp,int)));\nincr_top(L);\nbreak;\n}\ncase'f':{\nsetnvalue(L->top,cast_num(va_arg(argp,l_uacNumber)));\nincr_top(L);\nbreak;\n}\ncase'p':{\nchar buff[4*sizeof(void*)+8];\nsprintf(buff,\"%p\",va_arg(argp,void*));\npushstr(L,buff);\nbreak;\n}\ncase'%':{\npushstr(L,\"%\");\nbreak;\n}\ndefault:{\nchar buff[3];\nbuff[0]='%';\nbuff[1]=*(e+1);\nbuff[2]='\\0';\npushstr(L,buff);\nbreak;\n}\n}\nn+=2;\nfmt=e+2;\n}\npushstr(L,fmt);\nluaV_concat(L,n+1,cast_int(L->top-L->base)-1);\nL->top-=n;\nreturn svalue(L->top-1);\n}\nstatic const char*luaO_pushfstring(lua_State*L,const char*fmt,...){\nconst char*msg;\nva_list argp;\nva_start(argp,fmt);\nmsg=luaO_pushvfstring(L,fmt,argp);\nva_end(argp);\nreturn msg;\n}\nstatic void luaO_chunkid(char*out,const char*source,size_t bufflen){\nif(*source=='='){\nstrncpy(out,source+1,bufflen);\nout[bufflen-1]='\\0';\n}\nelse{\nif(*source=='@'){\nsize_t l;\nsource++;\nbufflen-=sizeof(\" '...' \");\nl=strlen(source);\nstrcpy(out,\"\");\nif(l>bufflen){\nsource+=(l-bufflen);\nstrcat(out,\"...\");\n}\nstrcat(out,source);\n}\nelse{\nsize_t len=strcspn(source,\"\\n\\r\");\nbufflen-=sizeof(\" [string \\\"...\\\"] \");\nif(len>bufflen)len=bufflen;\nstrcpy(out,\"[string \\\"\");\nif(source[len]!='\\0'){\nstrncat(out,source,len);\nstrcat(out,\"...\");\n}\nelse\nstrcat(out,source);\nstrcat(out,\"\\\"]\");\n}\n}\n}\n#define gnode(t,i)(&(t)->node[i])\n#define gkey(n)(&(n)->i_key.nk)\n#define gval(n)(&(n)->i_val)\n#define gnext(n)((n)->i_key.nk.next)\n#define key2tval(n)(&(n)->i_key.tvk)\nstatic TValue*luaH_setnum(lua_State*L,Table*t,int key);\nstatic const TValue*luaH_getstr(Table*t,TString*key);\nstatic TValue*luaH_set(lua_State*L,Table*t,const TValue*key);\nstatic const char*const luaT_typenames[]={\n\"nil\",\"boolean\",\"userdata\",\"number\",\n\"string\",\"table\",\"function\",\"userdata\",\"thread\",\n\"proto\",\"upval\"\n};\nstatic void luaT_init(lua_State*L){\nstatic const char*const luaT_eventname[]={\n\"__index\",\"__newindex\",\n\"__gc\",\"__mode\",\"__eq\",\n\"__add\",\"__sub\",\"__mul\",\"__div\",\"__mod\",\n\"__pow\",\"__unm\",\"__len\",\"__lt\",\"__le\",\n\"__concat\",\"__call\"\n};\nint i;\nfor(i=0;i<TM_N;i++){\nG(L)->tmname[i]=luaS_new(L,luaT_eventname[i]);\nluaS_fix(G(L)->tmname[i]);\n}\n}\nstatic const TValue*luaT_gettm(Table*events,TMS event,TString*ename){\nconst TValue*tm=luaH_getstr(events,ename);\nif(ttisnil(tm)){\nevents->flags|=cast_byte(1u<<event);\nreturn NULL;\n}\nelse return tm;\n}\nstatic const TValue*luaT_gettmbyobj(lua_State*L,const TValue*o,TMS event){\nTable*mt;\nswitch(ttype(o)){\ncase 5:\nmt=hvalue(o)->metatable;\nbreak;\ncase 7:\nmt=uvalue(o)->metatable;\nbreak;\ndefault:\nmt=G(L)->mt[ttype(o)];\n}\nreturn(mt?luaH_getstr(mt,G(L)->tmname[event]):(&luaO_nilobject_));\n}\n#define sizeCclosure(n)(cast(int,sizeof(CClosure))+cast(int,sizeof(TValue)*((n)-1)))\n#define sizeLclosure(n)(cast(int,sizeof(LClosure))+cast(int,sizeof(TValue*)*((n)-1)))\nstatic Closure*luaF_newCclosure(lua_State*L,int nelems,Table*e){\nClosure*c=cast(Closure*,luaM_malloc(L,sizeCclosure(nelems)));\nluaC_link(L,obj2gco(c),6);\nc->c.isC=1;\nc->c.env=e;\nc->c.nupvalues=cast_byte(nelems);\nreturn c;\n}\nstatic Closure*luaF_newLclosure(lua_State*L,int nelems,Table*e){\nClosure*c=cast(Closure*,luaM_malloc(L,sizeLclosure(nelems)));\nluaC_link(L,obj2gco(c),6);\nc->l.isC=0;\nc->l.env=e;\nc->l.nupvalues=cast_byte(nelems);\nwhile(nelems--)c->l.upvals[nelems]=NULL;\nreturn c;\n}\nstatic UpVal*luaF_newupval(lua_State*L){\nUpVal*uv=luaM_new(L,UpVal);\nluaC_link(L,obj2gco(uv),(8+2));\nuv->v=&uv->u.value;\nsetnilvalue(uv->v);\nreturn uv;\n}\nstatic UpVal*luaF_findupval(lua_State*L,StkId level){\nglobal_State*g=G(L);\nGCObject**pp=&L->openupval;\nUpVal*p;\nUpVal*uv;\nwhile(*pp!=NULL&&(p=ngcotouv(*pp))->v>=level){\nif(p->v==level){\nif(isdead(g,obj2gco(p)))\nchangewhite(obj2gco(p));\nreturn p;\n}\npp=&p->next;\n}\nuv=luaM_new(L,UpVal);\nuv->tt=(8+2);\nuv->marked=luaC_white(g);\nuv->v=level;\nuv->next=*pp;\n*pp=obj2gco(uv);\nuv->u.l.prev=&g->uvhead;\nuv->u.l.next=g->uvhead.u.l.next;\nuv->u.l.next->u.l.prev=uv;\ng->uvhead.u.l.next=uv;\nreturn uv;\n}\nstatic void unlinkupval(UpVal*uv){\nuv->u.l.next->u.l.prev=uv->u.l.prev;\nuv->u.l.prev->u.l.next=uv->u.l.next;\n}\nstatic void luaF_freeupval(lua_State*L,UpVal*uv){\nif(uv->v!=&uv->u.value)\nunlinkupval(uv);\nluaM_free(L,uv);\n}\nstatic void luaF_close(lua_State*L,StkId level){\nUpVal*uv;\nglobal_State*g=G(L);\nwhile(L->openupval!=NULL&&(uv=ngcotouv(L->openupval))->v>=level){\nGCObject*o=obj2gco(uv);\nL->openupval=uv->next;\nif(isdead(g,o))\nluaF_freeupval(L,uv);\nelse{\nunlinkupval(uv);\nsetobj(L,&uv->u.value,uv->v);\nuv->v=&uv->u.value;\nluaC_linkupval(L,uv);\n}\n}\n}\nstatic Proto*luaF_newproto(lua_State*L){\nProto*f=luaM_new(L,Proto);\nluaC_link(L,obj2gco(f),(8+1));\nf->k=NULL;\nf->sizek=0;\nf->p=NULL;\nf->sizep=0;\nf->code=NULL;\nf->sizecode=0;\nf->sizelineinfo=0;\nf->sizeupvalues=0;\nf->nups=0;\nf->upvalues=NULL;\nf->numparams=0;\nf->is_vararg=0;\nf->maxstacksize=0;\nf->lineinfo=NULL;\nf->sizelocvars=0;\nf->locvars=NULL;\nf->linedefined=0;\nf->lastlinedefined=0;\nf->source=NULL;\nreturn f;\n}\nstatic void luaF_freeproto(lua_State*L,Proto*f){\nluaM_freearray(L,f->code,f->sizecode,Instruction);\nluaM_freearray(L,f->p,f->sizep,Proto*);\nluaM_freearray(L,f->k,f->sizek,TValue);\nluaM_freearray(L,f->lineinfo,f->sizelineinfo,int);\nluaM_freearray(L,f->locvars,f->sizelocvars,struct LocVar);\nluaM_freearray(L,f->upvalues,f->sizeupvalues,TString*);\nluaM_free(L,f);\n}\nstatic void luaF_freeclosure(lua_State*L,Closure*c){\nint size=(c->c.isC)?sizeCclosure(c->c.nupvalues):\nsizeLclosure(c->l.nupvalues);\nluaM_freemem(L,c,size);\n}\n#define MASK1(n,p)((~((~(Instruction)0)<<n))<<p)\n#define MASK0(n,p)(~MASK1(n,p))\n#define GET_OPCODE(i)(cast(OpCode,((i)>>0)&MASK1(6,0)))\n#define SET_OPCODE(i,o)((i)=(((i)&MASK0(6,0))|((cast(Instruction,o)<<0)&MASK1(6,0))))\n#define GETARG_A(i)(cast(int,((i)>>(0+6))&MASK1(8,0)))\n#define SETARG_A(i,u)((i)=(((i)&MASK0(8,(0+6)))|((cast(Instruction,u)<<(0+6))&MASK1(8,(0+6)))))\n#define GETARG_B(i)(cast(int,((i)>>(((0+6)+8)+9))&MASK1(9,0)))\n#define SETARG_B(i,b)((i)=(((i)&MASK0(9,(((0+6)+8)+9)))|((cast(Instruction,b)<<(((0+6)+8)+9))&MASK1(9,(((0+6)+8)+9)))))\n#define GETARG_C(i)(cast(int,((i)>>((0+6)+8))&MASK1(9,0)))\n#define SETARG_C(i,b)((i)=(((i)&MASK0(9,((0+6)+8)))|((cast(Instruction,b)<<((0+6)+8))&MASK1(9,((0+6)+8)))))\n#define GETARG_Bx(i)(cast(int,((i)>>((0+6)+8))&MASK1((9+9),0)))\n#define SETARG_Bx(i,b)((i)=(((i)&MASK0((9+9),((0+6)+8)))|((cast(Instruction,b)<<((0+6)+8))&MASK1((9+9),((0+6)+8)))))\n#define GETARG_sBx(i)(GETARG_Bx(i)-(((1<<(9+9))-1)>>1))\n#define SETARG_sBx(i,b)SETARG_Bx((i),cast(unsigned int,(b)+(((1<<(9+9))-1)>>1)))\n#define CREATE_ABC(o,a,b,c)((cast(Instruction,o)<<0)|(cast(Instruction,a)<<(0+6))|(cast(Instruction,b)<<(((0+6)+8)+9))|(cast(Instruction,c)<<((0+6)+8)))\n#define CREATE_ABx(o,a,bc)((cast(Instruction,o)<<0)|(cast(Instruction,a)<<(0+6))|(cast(Instruction,bc)<<((0+6)+8)))\n#define ISK(x)((x)&(1<<(9-1)))\n#define INDEXK(r)((int)(r)&~(1<<(9-1)))\n#define RKASK(x)((x)|(1<<(9-1)))\nstatic const lu_byte luaP_opmodes[(cast(int,OP_VARARG)+1)];\n#define getBMode(m)(cast(enum OpArgMask,(luaP_opmodes[m]>>4)&3))\n#define getCMode(m)(cast(enum OpArgMask,(luaP_opmodes[m]>>2)&3))\n#define testTMode(m)(luaP_opmodes[m]&(1<<7))\ntypedef struct expdesc{\nexpkind k;\nunion{\nstruct{int info,aux;}s;\nlua_Number nval;\n}u;\nint t;\nint f;\n}expdesc;\ntypedef struct upvaldesc{\nlu_byte k;\nlu_byte info;\n}upvaldesc;\nstruct BlockCnt;\ntypedef struct FuncState{\nProto*f;\nTable*h;\nstruct FuncState*prev;\nstruct LexState*ls;\nstruct lua_State*L;\nstruct BlockCnt*bl;\nint pc;\nint lasttarget;\nint jpc;\nint freereg;\nint nk;\nint np;\nshort nlocvars;\nlu_byte nactvar;\nupvaldesc upvalues[60];\nunsigned short actvar[200];\n}FuncState;\nstatic Proto*luaY_parser(lua_State*L,ZIO*z,Mbuffer*buff,\nconst char*name);\nstruct lua_longjmp{\nstruct lua_longjmp*previous;\njmp_buf b;\nvolatile int status;\n};\nstatic void luaD_seterrorobj(lua_State*L,int errcode,StkId oldtop){\nswitch(errcode){\ncase 4:{\nsetsvalue(L,oldtop,luaS_newliteral(L,\"not enough memory\"));\nbreak;\n}\ncase 5:{\nsetsvalue(L,oldtop,luaS_newliteral(L,\"error in error handling\"));\nbreak;\n}\ncase 3:\ncase 2:{\nsetobj(L,oldtop,L->top-1);\nbreak;\n}\n}\nL->top=oldtop+1;\n}\nstatic void restore_stack_limit(lua_State*L){\nif(L->size_ci>20000){\nint inuse=cast_int(L->ci-L->base_ci);\nif(inuse+1<20000)\nluaD_reallocCI(L,20000);\n}\n}\nstatic void resetstack(lua_State*L,int status){\nL->ci=L->base_ci;\nL->base=L->ci->base;\nluaF_close(L,L->base);\nluaD_seterrorobj(L,status,L->base);\nL->nCcalls=L->baseCcalls;\nL->allowhook=1;\nrestore_stack_limit(L);\nL->errfunc=0;\nL->errorJmp=NULL;\n}\nstatic void luaD_throw(lua_State*L,int errcode){\nif(L->errorJmp){\nL->errorJmp->status=errcode;\nLUAI_THROW(L,L->errorJmp);\n}\nelse{\nL->status=cast_byte(errcode);\nif(G(L)->panic){\nresetstack(L,errcode);\nG(L)->panic(L);\n}\nexit(EXIT_FAILURE);\n}\n}\nstatic int luaD_rawrunprotected(lua_State*L,Pfunc f,void*ud){\nstruct lua_longjmp lj;\nlj.status=0;\nlj.previous=L->errorJmp;\nL->errorJmp=&lj;\nLUAI_TRY(L,&lj,\n(*f)(L,ud);\n);\nL->errorJmp=lj.previous;\nreturn lj.status;\n}\nstatic void correctstack(lua_State*L,TValue*oldstack){\nCallInfo*ci;\nGCObject*up;\nL->top=(L->top-oldstack)+L->stack;\nfor(up=L->openupval;up!=NULL;up=up->gch.next)\ngco2uv(up)->v=(gco2uv(up)->v-oldstack)+L->stack;\nfor(ci=L->base_ci;ci<=L->ci;ci++){\nci->top=(ci->top-oldstack)+L->stack;\nci->base=(ci->base-oldstack)+L->stack;\nci->func=(ci->func-oldstack)+L->stack;\n}\nL->base=(L->base-oldstack)+L->stack;\n}\nstatic void luaD_reallocstack(lua_State*L,int newsize){\nTValue*oldstack=L->stack;\nint realsize=newsize+1+5;\nluaM_reallocvector(L,L->stack,L->stacksize,realsize,TValue);\nL->stacksize=realsize;\nL->stack_last=L->stack+newsize;\ncorrectstack(L,oldstack);\n}\nstatic void luaD_reallocCI(lua_State*L,int newsize){\nCallInfo*oldci=L->base_ci;\nluaM_reallocvector(L,L->base_ci,L->size_ci,newsize,CallInfo);\nL->size_ci=newsize;\nL->ci=(L->ci-oldci)+L->base_ci;\nL->end_ci=L->base_ci+L->size_ci-1;\n}\nstatic void luaD_growstack(lua_State*L,int n){\nif(n<=L->stacksize)\nluaD_reallocstack(L,2*L->stacksize);\nelse\nluaD_reallocstack(L,L->stacksize+n);\n}\nstatic CallInfo*growCI(lua_State*L){\nif(L->size_ci>20000)\nluaD_throw(L,5);\nelse{\nluaD_reallocCI(L,2*L->size_ci);\nif(L->size_ci>20000)\nluaG_runerror(L,\"stack overflow\");\n}\nreturn++L->ci;\n}\nstatic StkId adjust_varargs(lua_State*L,Proto*p,int actual){\nint i;\nint nfixargs=p->numparams;\nTable*htab=NULL;\nStkId base,fixed;\nfor(;actual<nfixargs;++actual)\nsetnilvalue(L->top++);\nfixed=L->top-actual;\nbase=L->top;\nfor(i=0;i<nfixargs;i++){\nsetobj(L,L->top++,fixed+i);\nsetnilvalue(fixed+i);\n}\nif(htab){\nsethvalue(L,L->top++,htab);\n}\nreturn base;\n}\nstatic StkId tryfuncTM(lua_State*L,StkId func){\nconst TValue*tm=luaT_gettmbyobj(L,func,TM_CALL);\nStkId p;\nptrdiff_t funcr=savestack(L,func);\nif(!ttisfunction(tm))\nluaG_typeerror(L,func,\"call\");\nfor(p=L->top;p>func;p--)setobj(L,p,p-1);\nincr_top(L);\nfunc=restorestack(L,funcr);\nsetobj(L,func,tm);\nreturn func;\n}\n#define inc_ci(L)((L->ci==L->end_ci)?growCI(L):(condhardstacktests(luaD_reallocCI(L,L->size_ci)),++L->ci))\nstatic int luaD_precall(lua_State*L,StkId func,int nresults){\nLClosure*cl;\nptrdiff_t funcr;\nif(!ttisfunction(func))\nfunc=tryfuncTM(L,func);\nfuncr=savestack(L,func);\ncl=&clvalue(func)->l;\nL->ci->savedpc=L->savedpc;\nif(!cl->isC){\nCallInfo*ci;\nStkId st,base;\nProto*p=cl->p;\nluaD_checkstack(L,p->maxstacksize);\nfunc=restorestack(L,funcr);\nif(!p->is_vararg){\nbase=func+1;\nif(L->top>base+p->numparams)\nL->top=base+p->numparams;\n}\nelse{\nint nargs=cast_int(L->top-func)-1;\nbase=adjust_varargs(L,p,nargs);\nfunc=restorestack(L,funcr);\n}\nci=inc_ci(L);\nci->func=func;\nL->base=ci->base=base;\nci->top=L->base+p->maxstacksize;\nL->savedpc=p->code;\nci->tailcalls=0;\nci->nresults=nresults;\nfor(st=L->top;st<ci->top;st++)\nsetnilvalue(st);\nL->top=ci->top;\nreturn 0;\n}\nelse{\nCallInfo*ci;\nint n;\nluaD_checkstack(L,20);\nci=inc_ci(L);\nci->func=restorestack(L,funcr);\nL->base=ci->base=ci->func+1;\nci->top=L->top+20;\nci->nresults=nresults;\nn=(*curr_func(L)->c.f)(L);\nif(n<0)\nreturn 2;\nelse{\nluaD_poscall(L,L->top-n);\nreturn 1;\n}\n}\n}\nstatic int luaD_poscall(lua_State*L,StkId firstResult){\nStkId res;\nint wanted,i;\nCallInfo*ci;\nci=L->ci--;\nres=ci->func;\nwanted=ci->nresults;\nL->base=(ci-1)->base;\nL->savedpc=(ci-1)->savedpc;\nfor(i=wanted;i!=0&&firstResult<L->top;i--)\nsetobj(L,res++,firstResult++);\nwhile(i-->0)\nsetnilvalue(res++);\nL->top=res;\nreturn(wanted-(-1));\n}\nstatic void luaD_call(lua_State*L,StkId func,int nResults){\nif(++L->nCcalls>=200){\nif(L->nCcalls==200)\nluaG_runerror(L,\"C stack overflow\");\nelse if(L->nCcalls>=(200+(200>>3)))\nluaD_throw(L,5);\n}\nif(luaD_precall(L,func,nResults)==0)\nluaV_execute(L,1);\nL->nCcalls--;\nluaC_checkGC(L);\n}\nstatic int luaD_pcall(lua_State*L,Pfunc func,void*u,\nptrdiff_t old_top,ptrdiff_t ef){\nint status;\nunsigned short oldnCcalls=L->nCcalls;\nptrdiff_t old_ci=saveci(L,L->ci);\nlu_byte old_allowhooks=L->allowhook;\nptrdiff_t old_errfunc=L->errfunc;\nL->errfunc=ef;\nstatus=luaD_rawrunprotected(L,func,u);\nif(status!=0){\nStkId oldtop=restorestack(L,old_top);\nluaF_close(L,oldtop);\nluaD_seterrorobj(L,status,oldtop);\nL->nCcalls=oldnCcalls;\nL->ci=restoreci(L,old_ci);\nL->base=L->ci->base;\nL->savedpc=L->ci->savedpc;\nL->allowhook=old_allowhooks;\nrestore_stack_limit(L);\n}\nL->errfunc=old_errfunc;\nreturn status;\n}\nstruct SParser{\nZIO*z;\nMbuffer buff;\nconst char*name;\n};\nstatic void f_parser(lua_State*L,void*ud){\nint i;\nProto*tf;\nClosure*cl;\nstruct SParser*p=cast(struct SParser*,ud);\nluaC_checkGC(L);\ntf=luaY_parser(L,p->z,\n&p->buff,p->name);\ncl=luaF_newLclosure(L,tf->nups,hvalue(gt(L)));\ncl->l.p=tf;\nfor(i=0;i<tf->nups;i++)\ncl->l.upvals[i]=luaF_newupval(L);\nsetclvalue(L,L->top,cl);\nincr_top(L);\n}\nstatic int luaD_protectedparser(lua_State*L,ZIO*z,const char*name){\nstruct SParser p;\nint status;\np.z=z;p.name=name;\nluaZ_initbuffer(L,&p.buff);\nstatus=luaD_pcall(L,f_parser,&p,savestack(L,L->top),L->errfunc);\nluaZ_freebuffer(L,&p.buff);\nreturn status;\n}\nstatic void luaS_resize(lua_State*L,int newsize){\nGCObject**newhash;\nstringtable*tb;\nint i;\nif(G(L)->gcstate==2)\nreturn;\nnewhash=luaM_newvector(L,newsize,GCObject*);\ntb=&G(L)->strt;\nfor(i=0;i<newsize;i++)newhash[i]=NULL;\nfor(i=0;i<tb->size;i++){\nGCObject*p=tb->hash[i];\nwhile(p){\nGCObject*next=p->gch.next;\nunsigned int h=gco2ts(p)->hash;\nint h1=lmod(h,newsize);\np->gch.next=newhash[h1];\nnewhash[h1]=p;\np=next;\n}\n}\nluaM_freearray(L,tb->hash,tb->size,TString*);\ntb->size=newsize;\ntb->hash=newhash;\n}\nstatic TString*newlstr(lua_State*L,const char*str,size_t l,\nunsigned int h){\nTString*ts;\nstringtable*tb;\nif(l+1>(((size_t)(~(size_t)0)-2)-sizeof(TString))/sizeof(char))\nluaM_toobig(L);\nts=cast(TString*,luaM_malloc(L,(l+1)*sizeof(char)+sizeof(TString)));\nts->tsv.len=l;\nts->tsv.hash=h;\nts->tsv.marked=luaC_white(G(L));\nts->tsv.tt=4;\nts->tsv.reserved=0;\nmemcpy(ts+1,str,l*sizeof(char));\n((char*)(ts+1))[l]='\\0';\ntb=&G(L)->strt;\nh=lmod(h,tb->size);\nts->tsv.next=tb->hash[h];\ntb->hash[h]=obj2gco(ts);\ntb->nuse++;\nif(tb->nuse>cast(lu_int32,tb->size)&&tb->size<=(INT_MAX-2)/2)\nluaS_resize(L,tb->size*2);\nreturn ts;\n}\nstatic TString*luaS_newlstr(lua_State*L,const char*str,size_t l){\nGCObject*o;\nunsigned int h=cast(unsigned int,l);\nsize_t step=(l>>5)+1;\nsize_t l1;\nfor(l1=l;l1>=step;l1-=step)\nh=h^((h<<5)+(h>>2)+cast(unsigned char,str[l1-1]));\nfor(o=G(L)->strt.hash[lmod(h,G(L)->strt.size)];\no!=NULL;\no=o->gch.next){\nTString*ts=rawgco2ts(o);\nif(ts->tsv.len==l&&(memcmp(str,getstr(ts),l)==0)){\nif(isdead(G(L),o))changewhite(o);\nreturn ts;\n}\n}\nreturn newlstr(L,str,l,h);\n}\nstatic Udata*luaS_newudata(lua_State*L,size_t s,Table*e){\nUdata*u;\nif(s>((size_t)(~(size_t)0)-2)-sizeof(Udata))\nluaM_toobig(L);\nu=cast(Udata*,luaM_malloc(L,s+sizeof(Udata)));\nu->uv.marked=luaC_white(G(L));\nu->uv.tt=7;\nu->uv.len=s;\nu->uv.metatable=NULL;\nu->uv.env=e;\nu->uv.next=G(L)->mainthread->next;\nG(L)->mainthread->next=obj2gco(u);\nreturn u;\n}\n#define hashpow2(t,n)(gnode(t,lmod((n),sizenode(t))))\n#define hashstr(t,str)hashpow2(t,(str)->tsv.hash)\n#define hashboolean(t,p)hashpow2(t,p)\n#define hashmod(t,n)(gnode(t,((n)%((sizenode(t)-1)|1))))\n#define hashpointer(t,p)hashmod(t,IntPoint(p))\nstatic const Node dummynode_={\n{{NULL},0},\n{{{NULL},0,NULL}}\n};\nstatic Node*hashnum(const Table*t,lua_Number n){\nunsigned int a[cast_int(sizeof(lua_Number)/sizeof(int))];\nint i;\nif(luai_numeq(n,0))\nreturn gnode(t,0);\nmemcpy(a,&n,sizeof(a));\nfor(i=1;i<cast_int(sizeof(lua_Number)/sizeof(int));i++)a[0]+=a[i];\nreturn hashmod(t,a[0]);\n}\nstatic Node*mainposition(const Table*t,const TValue*key){\nswitch(ttype(key)){\ncase 3:\nreturn hashnum(t,nvalue(key));\ncase 4:\nreturn hashstr(t,rawtsvalue(key));\ncase 1:\nreturn hashboolean(t,bvalue(key));\ncase 2:\nreturn hashpointer(t,pvalue(key));\ndefault:\nreturn hashpointer(t,gcvalue(key));\n}\n}\nstatic int arrayindex(const TValue*key){\nif(ttisnumber(key)){\nlua_Number n=nvalue(key);\nint k;\nlua_number2int(k,n);\nif(luai_numeq(cast_num(k),n))\nreturn k;\n}\nreturn-1;\n}\nstatic int findindex(lua_State*L,Table*t,StkId key){\nint i;\nif(ttisnil(key))return-1;\ni=arrayindex(key);\nif(0<i&&i<=t->sizearray)\nreturn i-1;\nelse{\nNode*n=mainposition(t,key);\ndo{\nif(luaO_rawequalObj(key2tval(n),key)||\n(ttype(gkey(n))==(8+3)&&iscollectable(key)&&\ngcvalue(gkey(n))==gcvalue(key))){\ni=cast_int(n-gnode(t,0));\nreturn i+t->sizearray;\n}\nelse n=gnext(n);\n}while(n);\nluaG_runerror(L,\"invalid key to \"LUA_QL(\"next\"));\nreturn 0;\n}\n}\nstatic int luaH_next(lua_State*L,Table*t,StkId key){\nint i=findindex(L,t,key);\nfor(i++;i<t->sizearray;i++){\nif(!ttisnil(&t->array[i])){\nsetnvalue(key,cast_num(i+1));\nsetobj(L,key+1,&t->array[i]);\nreturn 1;\n}\n}\nfor(i-=t->sizearray;i<(int)sizenode(t);i++){\nif(!ttisnil(gval(gnode(t,i)))){\nsetobj(L,key,key2tval(gnode(t,i)));\nsetobj(L,key+1,gval(gnode(t,i)));\nreturn 1;\n}\n}\nreturn 0;\n}\nstatic int computesizes(int nums[],int*narray){\nint i;\nint twotoi;\nint a=0;\nint na=0;\nint n=0;\nfor(i=0,twotoi=1;twotoi/2<*narray;i++,twotoi*=2){\nif(nums[i]>0){\na+=nums[i];\nif(a>twotoi/2){\nn=twotoi;\nna=a;\n}\n}\nif(a==*narray)break;\n}\n*narray=n;\nreturn na;\n}\nstatic int countint(const TValue*key,int*nums){\nint k=arrayindex(key);\nif(0<k&&k<=(1<<(32-2))){\nnums[ceillog2(k)]++;\nreturn 1;\n}\nelse\nreturn 0;\n}\nstatic int numusearray(const Table*t,int*nums){\nint lg;\nint ttlg;\nint ause=0;\nint i=1;\nfor(lg=0,ttlg=1;lg<=(32-2);lg++,ttlg*=2){\nint lc=0;\nint lim=ttlg;\nif(lim>t->sizearray){\nlim=t->sizearray;\nif(i>lim)\nbreak;\n}\nfor(;i<=lim;i++){\nif(!ttisnil(&t->array[i-1]))\nlc++;\n}\nnums[lg]+=lc;\nause+=lc;\n}\nreturn ause;\n}\nstatic int numusehash(const Table*t,int*nums,int*pnasize){\nint totaluse=0;\nint ause=0;\nint i=sizenode(t);\nwhile(i--){\nNode*n=&t->node[i];\nif(!ttisnil(gval(n))){\nause+=countint(key2tval(n),nums);\ntotaluse++;\n}\n}\n*pnasize+=ause;\nreturn totaluse;\n}\nstatic void setarrayvector(lua_State*L,Table*t,int size){\nint i;\nluaM_reallocvector(L,t->array,t->sizearray,size,TValue);\nfor(i=t->sizearray;i<size;i++)\nsetnilvalue(&t->array[i]);\nt->sizearray=size;\n}\nstatic void setnodevector(lua_State*L,Table*t,int size){\nint lsize;\nif(size==0){\nt->node=cast(Node*,(&dummynode_));\nlsize=0;\n}\nelse{\nint i;\nlsize=ceillog2(size);\nif(lsize>(32-2))\nluaG_runerror(L,\"table overflow\");\nsize=twoto(lsize);\nt->node=luaM_newvector(L,size,Node);\nfor(i=0;i<size;i++){\nNode*n=gnode(t,i);\ngnext(n)=NULL;\nsetnilvalue(gkey(n));\nsetnilvalue(gval(n));\n}\n}\nt->lsizenode=cast_byte(lsize);\nt->lastfree=gnode(t,size);\n}\nstatic void resize(lua_State*L,Table*t,int nasize,int nhsize){\nint i;\nint oldasize=t->sizearray;\nint oldhsize=t->lsizenode;\nNode*nold=t->node;\nif(nasize>oldasize)\nsetarrayvector(L,t,nasize);\nsetnodevector(L,t,nhsize);\nif(nasize<oldasize){\nt->sizearray=nasize;\nfor(i=nasize;i<oldasize;i++){\nif(!ttisnil(&t->array[i]))\nsetobj(L,luaH_setnum(L,t,i+1),&t->array[i]);\n}\nluaM_reallocvector(L,t->array,oldasize,nasize,TValue);\n}\nfor(i=twoto(oldhsize)-1;i>=0;i--){\nNode*old=nold+i;\nif(!ttisnil(gval(old)))\nsetobj(L,luaH_set(L,t,key2tval(old)),gval(old));\n}\nif(nold!=(&dummynode_))\nluaM_freearray(L,nold,twoto(oldhsize),Node);\n}\nstatic void luaH_resizearray(lua_State*L,Table*t,int nasize){\nint nsize=(t->node==(&dummynode_))?0:sizenode(t);\nresize(L,t,nasize,nsize);\n}\nstatic void rehash(lua_State*L,Table*t,const TValue*ek){\nint nasize,na;\nint nums[(32-2)+1];\nint i;\nint totaluse;\nfor(i=0;i<=(32-2);i++)nums[i]=0;\nnasize=numusearray(t,nums);\ntotaluse=nasize;\ntotaluse+=numusehash(t,nums,&nasize);\nnasize+=countint(ek,nums);\ntotaluse++;\nna=computesizes(nums,&nasize);\nresize(L,t,nasize,totaluse-na);\n}\nstatic Table*luaH_new(lua_State*L,int narray,int nhash){\nTable*t=luaM_new(L,Table);\nluaC_link(L,obj2gco(t),5);\nt->metatable=NULL;\nt->flags=cast_byte(~0);\nt->array=NULL;\nt->sizearray=0;\nt->lsizenode=0;\nt->node=cast(Node*,(&dummynode_));\nsetarrayvector(L,t,narray);\nsetnodevector(L,t,nhash);\nreturn t;\n}\nstatic void luaH_free(lua_State*L,Table*t){\nif(t->node!=(&dummynode_))\nluaM_freearray(L,t->node,sizenode(t),Node);\nluaM_freearray(L,t->array,t->sizearray,TValue);\nluaM_free(L,t);\n}\nstatic Node*getfreepos(Table*t){\nwhile(t->lastfree-->t->node){\nif(ttisnil(gkey(t->lastfree)))\nreturn t->lastfree;\n}\nreturn NULL;\n}\nstatic TValue*newkey(lua_State*L,Table*t,const TValue*key){\nNode*mp=mainposition(t,key);\nif(!ttisnil(gval(mp))||mp==(&dummynode_)){\nNode*othern;\nNode*n=getfreepos(t);\nif(n==NULL){\nrehash(L,t,key);\nreturn luaH_set(L,t,key);\n}\nothern=mainposition(t,key2tval(mp));\nif(othern!=mp){\nwhile(gnext(othern)!=mp)othern=gnext(othern);\ngnext(othern)=n;\n*n=*mp;\ngnext(mp)=NULL;\nsetnilvalue(gval(mp));\n}\nelse{\ngnext(n)=gnext(mp);\ngnext(mp)=n;\nmp=n;\n}\n}\ngkey(mp)->value=key->value;gkey(mp)->tt=key->tt;\nluaC_barriert(L,t,key);\nreturn gval(mp);\n}\nstatic const TValue*luaH_getnum(Table*t,int key){\nif(cast(unsigned int,key-1)<cast(unsigned int,t->sizearray))\nreturn&t->array[key-1];\nelse{\nlua_Number nk=cast_num(key);\nNode*n=hashnum(t,nk);\ndo{\nif(ttisnumber(gkey(n))&&luai_numeq(nvalue(gkey(n)),nk))\nreturn gval(n);\nelse n=gnext(n);\n}while(n);\nreturn(&luaO_nilobject_);\n}\n}\nstatic const TValue*luaH_getstr(Table*t,TString*key){\nNode*n=hashstr(t,key);\ndo{\nif(ttisstring(gkey(n))&&rawtsvalue(gkey(n))==key)\nreturn gval(n);\nelse n=gnext(n);\n}while(n);\nreturn(&luaO_nilobject_);\n}\nstatic const TValue*luaH_get(Table*t,const TValue*key){\nswitch(ttype(key)){\ncase 0:return(&luaO_nilobject_);\ncase 4:return luaH_getstr(t,rawtsvalue(key));\ncase 3:{\nint k;\nlua_Number n=nvalue(key);\nlua_number2int(k,n);\nif(luai_numeq(cast_num(k),nvalue(key)))\nreturn luaH_getnum(t,k);\n}\ndefault:{\nNode*n=mainposition(t,key);\ndo{\nif(luaO_rawequalObj(key2tval(n),key))\nreturn gval(n);\nelse n=gnext(n);\n}while(n);\nreturn(&luaO_nilobject_);\n}\n}\n}\nstatic TValue*luaH_set(lua_State*L,Table*t,const TValue*key){\nconst TValue*p=luaH_get(t,key);\nt->flags=0;\nif(p!=(&luaO_nilobject_))\nreturn cast(TValue*,p);\nelse{\nif(ttisnil(key))luaG_runerror(L,\"table index is nil\");\nelse if(ttisnumber(key)&&luai_numisnan(nvalue(key)))\nluaG_runerror(L,\"table index is NaN\");\nreturn newkey(L,t,key);\n}\n}\nstatic TValue*luaH_setnum(lua_State*L,Table*t,int key){\nconst TValue*p=luaH_getnum(t,key);\nif(p!=(&luaO_nilobject_))\nreturn cast(TValue*,p);\nelse{\nTValue k;\nsetnvalue(&k,cast_num(key));\nreturn newkey(L,t,&k);\n}\n}\nstatic TValue*luaH_setstr(lua_State*L,Table*t,TString*key){\nconst TValue*p=luaH_getstr(t,key);\nif(p!=(&luaO_nilobject_))\nreturn cast(TValue*,p);\nelse{\nTValue k;\nsetsvalue(L,&k,key);\nreturn newkey(L,t,&k);\n}\n}\nstatic int unbound_search(Table*t,unsigned int j){\nunsigned int i=j;\nj++;\nwhile(!ttisnil(luaH_getnum(t,j))){\ni=j;\nj*=2;\nif(j>cast(unsigned int,(INT_MAX-2))){\ni=1;\nwhile(!ttisnil(luaH_getnum(t,i)))i++;\nreturn i-1;\n}\n}\nwhile(j-i>1){\nunsigned int m=(i+j)/2;\nif(ttisnil(luaH_getnum(t,m)))j=m;\nelse i=m;\n}\nreturn i;\n}\nstatic int luaH_getn(Table*t){\nunsigned int j=t->sizearray;\nif(j>0&&ttisnil(&t->array[j-1])){\nunsigned int i=0;\nwhile(j-i>1){\nunsigned int m=(i+j)/2;\nif(ttisnil(&t->array[m-1]))j=m;\nelse i=m;\n}\nreturn i;\n}\nelse if(t->node==(&dummynode_))\nreturn j;\nelse return unbound_search(t,j);\n}\n#define makewhite(g,x)((x)->gch.marked=cast_byte(((x)->gch.marked&cast_byte(~(bitmask(2)|bit2mask(0,1))))|luaC_white(g)))\n#define white2gray(x)reset2bits((x)->gch.marked,0,1)\n#define black2gray(x)resetbit((x)->gch.marked,2)\n#define stringmark(s)reset2bits((s)->tsv.marked,0,1)\n#define isfinalized(u)testbit((u)->marked,3)\n#define markfinalized(u)l_setbit((u)->marked,3)\n#define markvalue(g,o){checkconsistency(o);if(iscollectable(o)&&iswhite(gcvalue(o)))reallymarkobject(g,gcvalue(o));}\n#define markobject(g,t){if(iswhite(obj2gco(t)))reallymarkobject(g,obj2gco(t));}\n#define setthreshold(g)(g->GCthreshold=(g->estimate/100)*g->gcpause)\nstatic void removeentry(Node*n){\nif(iscollectable(gkey(n)))\nsetttype(gkey(n),(8+3));\n}\nstatic void reallymarkobject(global_State*g,GCObject*o){\nwhite2gray(o);\nswitch(o->gch.tt){\ncase 4:{\nreturn;\n}\ncase 7:{\nTable*mt=gco2u(o)->metatable;\ngray2black(o);\nif(mt)markobject(g,mt);\nmarkobject(g,gco2u(o)->env);\nreturn;\n}\ncase(8+2):{\nUpVal*uv=gco2uv(o);\nmarkvalue(g,uv->v);\nif(uv->v==&uv->u.value)\ngray2black(o);\nreturn;\n}\ncase 6:{\ngco2cl(o)->c.gclist=g->gray;\ng->gray=o;\nbreak;\n}\ncase 5:{\ngco2h(o)->gclist=g->gray;\ng->gray=o;\nbreak;\n}\ncase 8:{\ngco2th(o)->gclist=g->gray;\ng->gray=o;\nbreak;\n}\ncase(8+1):{\ngco2p(o)->gclist=g->gray;\ng->gray=o;\nbreak;\n}\ndefault:;\n}\n}\nstatic void marktmu(global_State*g){\nGCObject*u=g->tmudata;\nif(u){\ndo{\nu=u->gch.next;\nmakewhite(g,u);\nreallymarkobject(g,u);\n}while(u!=g->tmudata);\n}\n}\nstatic size_t luaC_separateudata(lua_State*L,int all){\nglobal_State*g=G(L);\nsize_t deadmem=0;\nGCObject**p=&g->mainthread->next;\nGCObject*curr;\nwhile((curr=*p)!=NULL){\nif(!(iswhite(curr)||all)||isfinalized(gco2u(curr)))\np=&curr->gch.next;\nelse if(fasttm(L,gco2u(curr)->metatable,TM_GC)==NULL){\nmarkfinalized(gco2u(curr));\np=&curr->gch.next;\n}\nelse{\ndeadmem+=sizeudata(gco2u(curr));\nmarkfinalized(gco2u(curr));\n*p=curr->gch.next;\nif(g->tmudata==NULL)\ng->tmudata=curr->gch.next=curr;\nelse{\ncurr->gch.next=g->tmudata->gch.next;\ng->tmudata->gch.next=curr;\ng->tmudata=curr;\n}\n}\n}\nreturn deadmem;\n}\nstatic int traversetable(global_State*g,Table*h){\nint i;\nint weakkey=0;\nint weakvalue=0;\nconst TValue*mode;\nif(h->metatable)\nmarkobject(g,h->metatable);\nmode=gfasttm(g,h->metatable,TM_MODE);\nif(mode&&ttisstring(mode)){\nweakkey=(strchr(svalue(mode),'k')!=NULL);\nweakvalue=(strchr(svalue(mode),'v')!=NULL);\nif(weakkey||weakvalue){\nh->marked&=~(bitmask(3)|bitmask(4));\nh->marked|=cast_byte((weakkey<<3)|\n(weakvalue<<4));\nh->gclist=g->weak;\ng->weak=obj2gco(h);\n}\n}\nif(weakkey&&weakvalue)return 1;\nif(!weakvalue){\ni=h->sizearray;\nwhile(i--)\nmarkvalue(g,&h->array[i]);\n}\ni=sizenode(h);\nwhile(i--){\nNode*n=gnode(h,i);\nif(ttisnil(gval(n)))\nremoveentry(n);\nelse{\nif(!weakkey)markvalue(g,gkey(n));\nif(!weakvalue)markvalue(g,gval(n));\n}\n}\nreturn weakkey||weakvalue;\n}\nstatic void traverseproto(global_State*g,Proto*f){\nint i;\nif(f->source)stringmark(f->source);\nfor(i=0;i<f->sizek;i++)\nmarkvalue(g,&f->k[i]);\nfor(i=0;i<f->sizeupvalues;i++){\nif(f->upvalues[i])\nstringmark(f->upvalues[i]);\n}\nfor(i=0;i<f->sizep;i++){\nif(f->p[i])\nmarkobject(g,f->p[i]);\n}\nfor(i=0;i<f->sizelocvars;i++){\nif(f->locvars[i].varname)\nstringmark(f->locvars[i].varname);\n}\n}\nstatic void traverseclosure(global_State*g,Closure*cl){\nmarkobject(g,cl->c.env);\nif(cl->c.isC){\nint i;\nfor(i=0;i<cl->c.nupvalues;i++)\nmarkvalue(g,&cl->c.upvalue[i]);\n}\nelse{\nint i;\nmarkobject(g,cl->l.p);\nfor(i=0;i<cl->l.nupvalues;i++)\nmarkobject(g,cl->l.upvals[i]);\n}\n}\nstatic void checkstacksizes(lua_State*L,StkId max){\nint ci_used=cast_int(L->ci-L->base_ci);\nint s_used=cast_int(max-L->stack);\nif(L->size_ci>20000)\nreturn;\nif(4*ci_used<L->size_ci&&2*8<L->size_ci)\nluaD_reallocCI(L,L->size_ci/2);\ncondhardstacktests(luaD_reallocCI(L,ci_used+1));\nif(4*s_used<L->stacksize&&\n2*((2*20)+5)<L->stacksize)\nluaD_reallocstack(L,L->stacksize/2);\ncondhardstacktests(luaD_reallocstack(L,s_used));\n}\nstatic void traversestack(global_State*g,lua_State*l){\nStkId o,lim;\nCallInfo*ci;\nmarkvalue(g,gt(l));\nlim=l->top;\nfor(ci=l->base_ci;ci<=l->ci;ci++){\nif(lim<ci->top)lim=ci->top;\n}\nfor(o=l->stack;o<l->top;o++)\nmarkvalue(g,o);\nfor(;o<=lim;o++)\nsetnilvalue(o);\ncheckstacksizes(l,lim);\n}\nstatic l_mem propagatemark(global_State*g){\nGCObject*o=g->gray;\ngray2black(o);\nswitch(o->gch.tt){\ncase 5:{\nTable*h=gco2h(o);\ng->gray=h->gclist;\nif(traversetable(g,h))\nblack2gray(o);\nreturn sizeof(Table)+sizeof(TValue)*h->sizearray+\nsizeof(Node)*sizenode(h);\n}\ncase 6:{\nClosure*cl=gco2cl(o);\ng->gray=cl->c.gclist;\ntraverseclosure(g,cl);\nreturn(cl->c.isC)?sizeCclosure(cl->c.nupvalues):\nsizeLclosure(cl->l.nupvalues);\n}\ncase 8:{\nlua_State*th=gco2th(o);\ng->gray=th->gclist;\nth->gclist=g->grayagain;\ng->grayagain=o;\nblack2gray(o);\ntraversestack(g,th);\nreturn sizeof(lua_State)+sizeof(TValue)*th->stacksize+\nsizeof(CallInfo)*th->size_ci;\n}\ncase(8+1):{\nProto*p=gco2p(o);\ng->gray=p->gclist;\ntraverseproto(g,p);\nreturn sizeof(Proto)+sizeof(Instruction)*p->sizecode+\nsizeof(Proto*)*p->sizep+\nsizeof(TValue)*p->sizek+\nsizeof(int)*p->sizelineinfo+\nsizeof(LocVar)*p->sizelocvars+\nsizeof(TString*)*p->sizeupvalues;\n}\ndefault:return 0;\n}\n}\nstatic size_t propagateall(global_State*g){\nsize_t m=0;\nwhile(g->gray)m+=propagatemark(g);\nreturn m;\n}\nstatic int iscleared(const TValue*o,int iskey){\nif(!iscollectable(o))return 0;\nif(ttisstring(o)){\nstringmark(rawtsvalue(o));\nreturn 0;\n}\nreturn iswhite(gcvalue(o))||\n(ttisuserdata(o)&&(!iskey&&isfinalized(uvalue(o))));\n}\nstatic void cleartable(GCObject*l){\nwhile(l){\nTable*h=gco2h(l);\nint i=h->sizearray;\nif(testbit(h->marked,4)){\nwhile(i--){\nTValue*o=&h->array[i];\nif(iscleared(o,0))\nsetnilvalue(o);\n}\n}\ni=sizenode(h);\nwhile(i--){\nNode*n=gnode(h,i);\nif(!ttisnil(gval(n))&&\n(iscleared(key2tval(n),1)||iscleared(gval(n),0))){\nsetnilvalue(gval(n));\nremoveentry(n);\n}\n}\nl=h->gclist;\n}\n}\nstatic void freeobj(lua_State*L,GCObject*o){\nswitch(o->gch.tt){\ncase(8+1):luaF_freeproto(L,gco2p(o));break;\ncase 6:luaF_freeclosure(L,gco2cl(o));break;\ncase(8+2):luaF_freeupval(L,gco2uv(o));break;\ncase 5:luaH_free(L,gco2h(o));break;\ncase 8:{\nluaE_freethread(L,gco2th(o));\nbreak;\n}\ncase 4:{\nG(L)->strt.nuse--;\nluaM_freemem(L,o,sizestring(gco2ts(o)));\nbreak;\n}\ncase 7:{\nluaM_freemem(L,o,sizeudata(gco2u(o)));\nbreak;\n}\ndefault:;\n}\n}\n#define sweepwholelist(L,p)sweeplist(L,p,((lu_mem)(~(lu_mem)0)-2))\nstatic GCObject**sweeplist(lua_State*L,GCObject**p,lu_mem count){\nGCObject*curr;\nglobal_State*g=G(L);\nint deadmask=otherwhite(g);\nwhile((curr=*p)!=NULL&&count-->0){\nif(curr->gch.tt==8)\nsweepwholelist(L,&gco2th(curr)->openupval);\nif((curr->gch.marked^bit2mask(0,1))&deadmask){\nmakewhite(g,curr);\np=&curr->gch.next;\n}\nelse{\n*p=curr->gch.next;\nif(curr==g->rootgc)\ng->rootgc=curr->gch.next;\nfreeobj(L,curr);\n}\n}\nreturn p;\n}\nstatic void checkSizes(lua_State*L){\nglobal_State*g=G(L);\nif(g->strt.nuse<cast(lu_int32,g->strt.size/4)&&\ng->strt.size>32*2)\nluaS_resize(L,g->strt.size/2);\nif(luaZ_sizebuffer(&g->buff)>32*2){\nsize_t newsize=luaZ_sizebuffer(&g->buff)/2;\nluaZ_resizebuffer(L,&g->buff,newsize);\n}\n}\nstatic void GCTM(lua_State*L){\nglobal_State*g=G(L);\nGCObject*o=g->tmudata->gch.next;\nUdata*udata=rawgco2u(o);\nconst TValue*tm;\nif(o==g->tmudata)\ng->tmudata=NULL;\nelse\ng->tmudata->gch.next=udata->uv.next;\nudata->uv.next=g->mainthread->next;\ng->mainthread->next=o;\nmakewhite(g,o);\ntm=fasttm(L,udata->uv.metatable,TM_GC);\nif(tm!=NULL){\nlu_byte oldah=L->allowhook;\nlu_mem oldt=g->GCthreshold;\nL->allowhook=0;\ng->GCthreshold=2*g->totalbytes;\nsetobj(L,L->top,tm);\nsetuvalue(L,L->top+1,udata);\nL->top+=2;\nluaD_call(L,L->top-2,0);\nL->allowhook=oldah;\ng->GCthreshold=oldt;\n}\n}\nstatic void luaC_callGCTM(lua_State*L){\nwhile(G(L)->tmudata)\nGCTM(L);\n}\nstatic void luaC_freeall(lua_State*L){\nglobal_State*g=G(L);\nint i;\ng->currentwhite=bit2mask(0,1)|bitmask(6);\nsweepwholelist(L,&g->rootgc);\nfor(i=0;i<g->strt.size;i++)\nsweepwholelist(L,&g->strt.hash[i]);\n}\nstatic void markmt(global_State*g){\nint i;\nfor(i=0;i<(8+1);i++)\nif(g->mt[i])markobject(g,g->mt[i]);\n}\nstatic void markroot(lua_State*L){\nglobal_State*g=G(L);\ng->gray=NULL;\ng->grayagain=NULL;\ng->weak=NULL;\nmarkobject(g,g->mainthread);\nmarkvalue(g,gt(g->mainthread));\nmarkvalue(g,registry(L));\nmarkmt(g);\ng->gcstate=1;\n}\nstatic void remarkupvals(global_State*g){\nUpVal*uv;\nfor(uv=g->uvhead.u.l.next;uv!=&g->uvhead;uv=uv->u.l.next){\nif(isgray(obj2gco(uv)))\nmarkvalue(g,uv->v);\n}\n}\nstatic void atomic(lua_State*L){\nglobal_State*g=G(L);\nsize_t udsize;\nremarkupvals(g);\npropagateall(g);\ng->gray=g->weak;\ng->weak=NULL;\nmarkobject(g,L);\nmarkmt(g);\npropagateall(g);\ng->gray=g->grayagain;\ng->grayagain=NULL;\npropagateall(g);\nudsize=luaC_separateudata(L,0);\nmarktmu(g);\nudsize+=propagateall(g);\ncleartable(g->weak);\ng->currentwhite=cast_byte(otherwhite(g));\ng->sweepstrgc=0;\ng->sweepgc=&g->rootgc;\ng->gcstate=2;\ng->estimate=g->totalbytes-udsize;\n}\nstatic l_mem singlestep(lua_State*L){\nglobal_State*g=G(L);\nswitch(g->gcstate){\ncase 0:{\nmarkroot(L);\nreturn 0;\n}\ncase 1:{\nif(g->gray)\nreturn propagatemark(g);\nelse{\natomic(L);\nreturn 0;\n}\n}\ncase 2:{\nlu_mem old=g->totalbytes;\nsweepwholelist(L,&g->strt.hash[g->sweepstrgc++]);\nif(g->sweepstrgc>=g->strt.size)\ng->gcstate=3;\ng->estimate-=old-g->totalbytes;\nreturn 10;\n}\ncase 3:{\nlu_mem old=g->totalbytes;\ng->sweepgc=sweeplist(L,g->sweepgc,40);\nif(*g->sweepgc==NULL){\ncheckSizes(L);\ng->gcstate=4;\n}\ng->estimate-=old-g->totalbytes;\nreturn 40*10;\n}\ncase 4:{\nif(g->tmudata){\nGCTM(L);\nif(g->estimate>100)\ng->estimate-=100;\nreturn 100;\n}\nelse{\ng->gcstate=0;\ng->gcdept=0;\nreturn 0;\n}\n}\ndefault:return 0;\n}\n}\nstatic void luaC_step(lua_State*L){\nglobal_State*g=G(L);\nl_mem lim=(1024u/100)*g->gcstepmul;\nif(lim==0)\nlim=(((lu_mem)(~(lu_mem)0)-2)-1)/2;\ng->gcdept+=g->totalbytes-g->GCthreshold;\ndo{\nlim-=singlestep(L);\nif(g->gcstate==0)\nbreak;\n}while(lim>0);\nif(g->gcstate!=0){\nif(g->gcdept<1024u)\ng->GCthreshold=g->totalbytes+1024u;\nelse{\ng->gcdept-=1024u;\ng->GCthreshold=g->totalbytes;\n}\n}\nelse{\nsetthreshold(g);\n}\n}\nstatic void luaC_barrierf(lua_State*L,GCObject*o,GCObject*v){\nglobal_State*g=G(L);\nif(g->gcstate==1)\nreallymarkobject(g,v);\nelse\nmakewhite(g,o);\n}\nstatic void luaC_barrierback(lua_State*L,Table*t){\nglobal_State*g=G(L);\nGCObject*o=obj2gco(t);\nblack2gray(o);\nt->gclist=g->grayagain;\ng->grayagain=o;\n}\nstatic void luaC_link(lua_State*L,GCObject*o,lu_byte tt){\nglobal_State*g=G(L);\no->gch.next=g->rootgc;\ng->rootgc=o;\no->gch.marked=luaC_white(g);\no->gch.tt=tt;\n}\nstatic void luaC_linkupval(lua_State*L,UpVal*uv){\nglobal_State*g=G(L);\nGCObject*o=obj2gco(uv);\no->gch.next=g->rootgc;\ng->rootgc=o;\nif(isgray(o)){\nif(g->gcstate==1){\ngray2black(o);\nluaC_barrier(L,uv,uv->v);\n}\nelse{\nmakewhite(g,o);\n}\n}\n}\ntypedef union{\nlua_Number r;\nTString*ts;\n}SemInfo;\ntypedef struct Token{\nint token;\nSemInfo seminfo;\n}Token;\ntypedef struct LexState{\nint current;\nint linenumber;\nint lastline;\nToken t;\nToken lookahead;\nstruct FuncState*fs;\nstruct lua_State*L;\nZIO*z;\nMbuffer*buff;\nTString*source;\nchar decpoint;\n}LexState;\nstatic void luaX_init(lua_State*L);\nstatic void luaX_lexerror(LexState*ls,const char*msg,int token);\n#define state_size(x)(sizeof(x)+0)\n#define fromstate(l)(cast(lu_byte*,(l))-0)\n#define tostate(l)(cast(lua_State*,cast(lu_byte*,l)+0))\ntypedef struct LG{\nlua_State l;\nglobal_State g;\n}LG;\nstatic void stack_init(lua_State*L1,lua_State*L){\nL1->base_ci=luaM_newvector(L,8,CallInfo);\nL1->ci=L1->base_ci;\nL1->size_ci=8;\nL1->end_ci=L1->base_ci+L1->size_ci-1;\nL1->stack=luaM_newvector(L,(2*20)+5,TValue);\nL1->stacksize=(2*20)+5;\nL1->top=L1->stack;\nL1->stack_last=L1->stack+(L1->stacksize-5)-1;\nL1->ci->func=L1->top;\nsetnilvalue(L1->top++);\nL1->base=L1->ci->base=L1->top;\nL1->ci->top=L1->top+20;\n}\nstatic void freestack(lua_State*L,lua_State*L1){\nluaM_freearray(L,L1->base_ci,L1->size_ci,CallInfo);\nluaM_freearray(L,L1->stack,L1->stacksize,TValue);\n}\nstatic void f_luaopen(lua_State*L,void*ud){\nglobal_State*g=G(L);\nUNUSED(ud);\nstack_init(L,L);\nsethvalue(L,gt(L),luaH_new(L,0,2));\nsethvalue(L,registry(L),luaH_new(L,0,2));\nluaS_resize(L,32);\nluaT_init(L);\nluaX_init(L);\nluaS_fix(luaS_newliteral(L,\"not enough memory\"));\ng->GCthreshold=4*g->totalbytes;\n}\nstatic void preinit_state(lua_State*L,global_State*g){\nG(L)=g;\nL->stack=NULL;\nL->stacksize=0;\nL->errorJmp=NULL;\nL->hook=NULL;\nL->hookmask=0;\nL->basehookcount=0;\nL->allowhook=1;\nresethookcount(L);\nL->openupval=NULL;\nL->size_ci=0;\nL->nCcalls=L->baseCcalls=0;\nL->status=0;\nL->base_ci=L->ci=NULL;\nL->savedpc=NULL;\nL->errfunc=0;\nsetnilvalue(gt(L));\n}\nstatic void close_state(lua_State*L){\nglobal_State*g=G(L);\nluaF_close(L,L->stack);\nluaC_freeall(L);\nluaM_freearray(L,G(L)->strt.hash,G(L)->strt.size,TString*);\nluaZ_freebuffer(L,&g->buff);\nfreestack(L,L);\n(*g->frealloc)(g->ud,fromstate(L),state_size(LG),0);\n}\nstatic void luaE_freethread(lua_State*L,lua_State*L1){\nluaF_close(L1,L1->stack);\nfreestack(L,L1);\nluaM_freemem(L,fromstate(L1),state_size(lua_State));\n}\nstatic lua_State*lua_newstate(lua_Alloc f,void*ud){\nint i;\nlua_State*L;\nglobal_State*g;\nvoid*l=(*f)(ud,NULL,0,state_size(LG));\nif(l==NULL)return NULL;\nL=tostate(l);\ng=&((LG*)L)->g;\nL->next=NULL;\nL->tt=8;\ng->currentwhite=bit2mask(0,5);\nL->marked=luaC_white(g);\nset2bits(L->marked,5,6);\npreinit_state(L,g);\ng->frealloc=f;\ng->ud=ud;\ng->mainthread=L;\ng->uvhead.u.l.prev=&g->uvhead;\ng->uvhead.u.l.next=&g->uvhead;\ng->GCthreshold=0;\ng->strt.size=0;\ng->strt.nuse=0;\ng->strt.hash=NULL;\nsetnilvalue(registry(L));\nluaZ_initbuffer(L,&g->buff);\ng->panic=NULL;\ng->gcstate=0;\ng->rootgc=obj2gco(L);\ng->sweepstrgc=0;\ng->sweepgc=&g->rootgc;\ng->gray=NULL;\ng->grayagain=NULL;\ng->weak=NULL;\ng->tmudata=NULL;\ng->totalbytes=sizeof(LG);\ng->gcpause=200;\ng->gcstepmul=200;\ng->gcdept=0;\nfor(i=0;i<(8+1);i++)g->mt[i]=NULL;\nif(luaD_rawrunprotected(L,f_luaopen,NULL)!=0){\nclose_state(L);\nL=NULL;\n}\nelse\n{}\nreturn L;\n}\nstatic void callallgcTM(lua_State*L,void*ud){\nUNUSED(ud);\nluaC_callGCTM(L);\n}\nstatic void lua_close(lua_State*L){\nL=G(L)->mainthread;\nluaF_close(L,L->stack);\nluaC_separateudata(L,1);\nL->errfunc=0;\ndo{\nL->ci=L->base_ci;\nL->base=L->top=L->ci->base;\nL->nCcalls=L->baseCcalls=0;\n}while(luaD_rawrunprotected(L,callallgcTM,NULL)!=0);\nclose_state(L);\n}\n#define getcode(fs,e)((fs)->f->code[(e)->u.s.info])\n#define luaK_codeAsBx(fs,o,A,sBx)luaK_codeABx(fs,o,A,(sBx)+(((1<<(9+9))-1)>>1))\n#define luaK_setmultret(fs,e)luaK_setreturns(fs,e,(-1))\nstatic int luaK_codeABx(FuncState*fs,OpCode o,int A,unsigned int Bx);\nstatic int luaK_codeABC(FuncState*fs,OpCode o,int A,int B,int C);\nstatic void luaK_setreturns(FuncState*fs,expdesc*e,int nresults);\nstatic void luaK_patchtohere(FuncState*fs,int list);\nstatic void luaK_concat(FuncState*fs,int*l1,int l2);\nstatic int currentpc(lua_State*L,CallInfo*ci){\nif(!isLua(ci))return-1;\nif(ci==L->ci)\nci->savedpc=L->savedpc;\nreturn pcRel(ci->savedpc,ci_func(ci)->l.p);\n}\nstatic int currentline(lua_State*L,CallInfo*ci){\nint pc=currentpc(L,ci);\nif(pc<0)\nreturn-1;\nelse\nreturn getline_(ci_func(ci)->l.p,pc);\n}\nstatic int lua_getstack(lua_State*L,int level,lua_Debug*ar){\nint status;\nCallInfo*ci;\nfor(ci=L->ci;level>0&&ci>L->base_ci;ci--){\nlevel--;\nif(f_isLua(ci))\nlevel-=ci->tailcalls;\n}\nif(level==0&&ci>L->base_ci){\nstatus=1;\nar->i_ci=cast_int(ci-L->base_ci);\n}\nelse if(level<0){\nstatus=1;\nar->i_ci=0;\n}\nelse status=0;\nreturn status;\n}\nstatic Proto*getluaproto(CallInfo*ci){\nreturn(isLua(ci)?ci_func(ci)->l.p:NULL);\n}\nstatic void funcinfo(lua_Debug*ar,Closure*cl){\nif(cl->c.isC){\nar->source=\"=[C]\";\nar->linedefined=-1;\nar->lastlinedefined=-1;\nar->what=\"C\";\n}\nelse{\nar->source=getstr(cl->l.p->source);\nar->linedefined=cl->l.p->linedefined;\nar->lastlinedefined=cl->l.p->lastlinedefined;\nar->what=(ar->linedefined==0)?\"main\":\"Lua\";\n}\nluaO_chunkid(ar->short_src,ar->source,60);\n}\nstatic void info_tailcall(lua_Debug*ar){\nar->name=ar->namewhat=\"\";\nar->what=\"tail\";\nar->lastlinedefined=ar->linedefined=ar->currentline=-1;\nar->source=\"=(tail call)\";\nluaO_chunkid(ar->short_src,ar->source,60);\nar->nups=0;\n}\nstatic void collectvalidlines(lua_State*L,Closure*f){\nif(f==NULL||f->c.isC){\nsetnilvalue(L->top);\n}\nelse{\nTable*t=luaH_new(L,0,0);\nint*lineinfo=f->l.p->lineinfo;\nint i;\nfor(i=0;i<f->l.p->sizelineinfo;i++)\nsetbvalue(luaH_setnum(L,t,lineinfo[i]),1);\nsethvalue(L,L->top,t);\n}\nincr_top(L);\n}\nstatic int auxgetinfo(lua_State*L,const char*what,lua_Debug*ar,\nClosure*f,CallInfo*ci){\nint status=1;\nif(f==NULL){\ninfo_tailcall(ar);\nreturn status;\n}\nfor(;*what;what++){\nswitch(*what){\ncase'S':{\nfuncinfo(ar,f);\nbreak;\n}\ncase'l':{\nar->currentline=(ci)?currentline(L,ci):-1;\nbreak;\n}\ncase'u':{\nar->nups=f->c.nupvalues;\nbreak;\n}\ncase'n':{\nar->namewhat=(ci)?NULL:NULL;\nif(ar->namewhat==NULL){\nar->namewhat=\"\";\nar->name=NULL;\n}\nbreak;\n}\ncase'L':\ncase'f':\nbreak;\ndefault:status=0;\n}\n}\nreturn status;\n}\nstatic int lua_getinfo(lua_State*L,const char*what,lua_Debug*ar){\nint status;\nClosure*f=NULL;\nCallInfo*ci=NULL;\nif(*what=='>'){\nStkId func=L->top-1;\nluai_apicheck(L,ttisfunction(func));\nwhat++;\nf=clvalue(func);\nL->top--;\n}\nelse if(ar->i_ci!=0){\nci=L->base_ci+ar->i_ci;\nf=clvalue(ci->func);\n}\nstatus=auxgetinfo(L,what,ar,f,ci);\nif(strchr(what,'f')){\nif(f==NULL)setnilvalue(L->top);\nelse setclvalue(L,L->top,f);\nincr_top(L);\n}\nif(strchr(what,'L'))\ncollectvalidlines(L,f);\nreturn status;\n}\nstatic int isinstack(CallInfo*ci,const TValue*o){\nStkId p;\nfor(p=ci->base;p<ci->top;p++)\nif(o==p)return 1;\nreturn 0;\n}\nstatic void luaG_typeerror(lua_State*L,const TValue*o,const char*op){\nconst char*name=NULL;\nconst char*t=luaT_typenames[ttype(o)];\nconst char*kind=(isinstack(L->ci,o))?\nNULL:\nNULL;\nif(kind)\nluaG_runerror(L,\"attempt to %s %s \"LUA_QL(\"%s\")\" (a %s value)\",\nop,kind,name,t);\nelse\nluaG_runerror(L,\"attempt to %s a %s value\",op,t);\n}\nstatic void luaG_concaterror(lua_State*L,StkId p1,StkId p2){\nif(ttisstring(p1)||ttisnumber(p1))p1=p2;\nluaG_typeerror(L,p1,\"concatenate\");\n}\nstatic void luaG_aritherror(lua_State*L,const TValue*p1,const TValue*p2){\nTValue temp;\nif(luaV_tonumber(p1,&temp)==NULL)\np2=p1;\nluaG_typeerror(L,p2,\"perform arithmetic on\");\n}\nstatic int luaG_ordererror(lua_State*L,const TValue*p1,const TValue*p2){\nconst char*t1=luaT_typenames[ttype(p1)];\nconst char*t2=luaT_typenames[ttype(p2)];\nif(t1[2]==t2[2])\nluaG_runerror(L,\"attempt to compare two %s values\",t1);\nelse\nluaG_runerror(L,\"attempt to compare %s with %s\",t1,t2);\nreturn 0;\n}\nstatic void addinfo(lua_State*L,const char*msg){\nCallInfo*ci=L->ci;\nif(isLua(ci)){\nchar buff[60];\nint line=currentline(L,ci);\nluaO_chunkid(buff,getstr(getluaproto(ci)->source),60);\nluaO_pushfstring(L,\"%s:%d: %s\",buff,line,msg);\n}\n}\nstatic void luaG_errormsg(lua_State*L){\nif(L->errfunc!=0){\nStkId errfunc=restorestack(L,L->errfunc);\nif(!ttisfunction(errfunc))luaD_throw(L,5);\nsetobj(L,L->top,L->top-1);\nsetobj(L,L->top-1,errfunc);\nincr_top(L);\nluaD_call(L,L->top-2,1);\n}\nluaD_throw(L,2);\n}\nstatic void luaG_runerror(lua_State*L,const char*fmt,...){\nva_list argp;\nva_start(argp,fmt);\naddinfo(L,luaO_pushvfstring(L,fmt,argp));\nva_end(argp);\nluaG_errormsg(L);\n}\nstatic int luaZ_fill(ZIO*z){\nsize_t size;\nlua_State*L=z->L;\nconst char*buff;\nbuff=z->reader(L,z->data,&size);\nif(buff==NULL||size==0)return(-1);\nz->n=size-1;\nz->p=buff;\nreturn char2int(*(z->p++));\n}\nstatic void luaZ_init(lua_State*L,ZIO*z,lua_Reader reader,void*data){\nz->L=L;\nz->reader=reader;\nz->data=data;\nz->n=0;\nz->p=NULL;\n}\nstatic char*luaZ_openspace(lua_State*L,Mbuffer*buff,size_t n){\nif(n>buff->buffsize){\nif(n<32)n=32;\nluaZ_resizebuffer(L,buff,n);\n}\nreturn buff->buffer;\n}\n#define opmode(t,a,b,c,m)(((t)<<7)|((a)<<6)|((b)<<4)|((c)<<2)|(m))\nstatic const lu_byte luaP_opmodes[(cast(int,OP_VARARG)+1)]={\nopmode(0,1,OpArgR,OpArgN,iABC)\n,opmode(0,1,OpArgK,OpArgN,iABx)\n,opmode(0,1,OpArgU,OpArgU,iABC)\n,opmode(0,1,OpArgR,OpArgN,iABC)\n,opmode(0,1,OpArgU,OpArgN,iABC)\n,opmode(0,1,OpArgK,OpArgN,iABx)\n,opmode(0,1,OpArgR,OpArgK,iABC)\n,opmode(0,0,OpArgK,OpArgN,iABx)\n,opmode(0,0,OpArgU,OpArgN,iABC)\n,opmode(0,0,OpArgK,OpArgK,iABC)\n,opmode(0,1,OpArgU,OpArgU,iABC)\n,opmode(0,1,OpArgR,OpArgK,iABC)\n,opmode(0,1,OpArgK,OpArgK,iABC)\n,opmode(0,1,OpArgK,OpArgK,iABC)\n,opmode(0,1,OpArgK,OpArgK,iABC)\n,opmode(0,1,OpArgK,OpArgK,iABC)\n,opmode(0,1,OpArgK,OpArgK,iABC)\n,opmode(0,1,OpArgK,OpArgK,iABC)\n,opmode(0,1,OpArgR,OpArgN,iABC)\n,opmode(0,1,OpArgR,OpArgN,iABC)\n,opmode(0,1,OpArgR,OpArgN,iABC)\n,opmode(0,1,OpArgR,OpArgR,iABC)\n,opmode(0,0,OpArgR,OpArgN,iAsBx)\n,opmode(1,0,OpArgK,OpArgK,iABC)\n,opmode(1,0,OpArgK,OpArgK,iABC)\n,opmode(1,0,OpArgK,OpArgK,iABC)\n,opmode(1,1,OpArgR,OpArgU,iABC)\n,opmode(1,1,OpArgR,OpArgU,iABC)\n,opmode(0,1,OpArgU,OpArgU,iABC)\n,opmode(0,1,OpArgU,OpArgU,iABC)\n,opmode(0,0,OpArgU,OpArgN,iABC)\n,opmode(0,1,OpArgR,OpArgN,iAsBx)\n,opmode(0,1,OpArgR,OpArgN,iAsBx)\n,opmode(1,0,OpArgN,OpArgU,iABC)\n,opmode(0,0,OpArgU,OpArgU,iABC)\n,opmode(0,0,OpArgN,OpArgN,iABC)\n,opmode(0,1,OpArgU,OpArgN,iABx)\n,opmode(0,1,OpArgU,OpArgN,iABC)\n};\n#define next(ls)(ls->current=zgetc(ls->z))\n#define currIsNewline(ls)(ls->current=='\\n'||ls->current=='\\r')\nstatic const char*const luaX_tokens[]={\n\"and\",\"break\",\"do\",\"else\",\"elseif\",\n\"end\",\"false\",\"for\",\"function\",\"if\",\n\"in\",\"local\",\"nil\",\"not\",\"or\",\"repeat\",\n\"return\",\"then\",\"true\",\"until\",\"while\",\n\"..\",\"...\",\"==\",\">=\",\"<=\",\"~=\",\n\"<number>\",\"<name>\",\"<string>\",\"<eof>\",\nNULL\n};\n#define save_and_next(ls)(save(ls,ls->current),next(ls))\nstatic void save(LexState*ls,int c){\nMbuffer*b=ls->buff;\nif(b->n+1>b->buffsize){\nsize_t newsize;\nif(b->buffsize>=((size_t)(~(size_t)0)-2)/2)\nluaX_lexerror(ls,\"lexical element too long\",0);\nnewsize=b->buffsize*2;\nluaZ_resizebuffer(ls->L,b,newsize);\n}\nb->buffer[b->n++]=cast(char,c);\n}\nstatic void luaX_init(lua_State*L){\nint i;\nfor(i=0;i<(cast(int,TK_WHILE-257+1));i++){\nTString*ts=luaS_new(L,luaX_tokens[i]);\nluaS_fix(ts);\nts->tsv.reserved=cast_byte(i+1);\n}\n}\nstatic const char*luaX_token2str(LexState*ls,int token){\nif(token<257){\nreturn(iscntrl(token))?luaO_pushfstring(ls->L,\"char(%d)\",token):\nluaO_pushfstring(ls->L,\"%c\",token);\n}\nelse\nreturn luaX_tokens[token-257];\n}\nstatic const char*txtToken(LexState*ls,int token){\nswitch(token){\ncase TK_NAME:\ncase TK_STRING:\ncase TK_NUMBER:\nsave(ls,'\\0');\nreturn luaZ_buffer(ls->buff);\ndefault:\nreturn luaX_token2str(ls,token);\n}\n}\nstatic void luaX_lexerror(LexState*ls,const char*msg,int token){\nchar buff[80];\nluaO_chunkid(buff,getstr(ls->source),80);\nmsg=luaO_pushfstring(ls->L,\"%s:%d: %s\",buff,ls->linenumber,msg);\nif(token)\nluaO_pushfstring(ls->L,\"%s near \"LUA_QL(\"%s\"),msg,txtToken(ls,token));\nluaD_throw(ls->L,3);\n}\nstatic void luaX_syntaxerror(LexState*ls,const char*msg){\nluaX_lexerror(ls,msg,ls->t.token);\n}\nstatic TString*luaX_newstring(LexState*ls,const char*str,size_t l){\nlua_State*L=ls->L;\nTString*ts=luaS_newlstr(L,str,l);\nTValue*o=luaH_setstr(L,ls->fs->h,ts);\nif(ttisnil(o)){\nsetbvalue(o,1);\nluaC_checkGC(L);\n}\nreturn ts;\n}\nstatic void inclinenumber(LexState*ls){\nint old=ls->current;\nnext(ls);\nif(currIsNewline(ls)&&ls->current!=old)\nnext(ls);\nif(++ls->linenumber>=(INT_MAX-2))\nluaX_syntaxerror(ls,\"chunk has too many lines\");\n}\nstatic void luaX_setinput(lua_State*L,LexState*ls,ZIO*z,TString*source){\nls->decpoint='.';\nls->L=L;\nls->lookahead.token=TK_EOS;\nls->z=z;\nls->fs=NULL;\nls->linenumber=1;\nls->lastline=1;\nls->source=source;\nluaZ_resizebuffer(ls->L,ls->buff,32);\nnext(ls);\n}\nstatic int check_next(LexState*ls,const char*set){\nif(!strchr(set,ls->current))\nreturn 0;\nsave_and_next(ls);\nreturn 1;\n}\nstatic void buffreplace(LexState*ls,char from,char to){\nsize_t n=luaZ_bufflen(ls->buff);\nchar*p=luaZ_buffer(ls->buff);\nwhile(n--)\nif(p[n]==from)p[n]=to;\n}\nstatic void read_numeral(LexState*ls,SemInfo*seminfo){\ndo{\nsave_and_next(ls);\n}while(isdigit(ls->current)||ls->current=='.');\nif(check_next(ls,\"Ee\"))\ncheck_next(ls,\"+-\");\nwhile(isalnum(ls->current)||ls->current=='_')\nsave_and_next(ls);\nsave(ls,'\\0');\nbuffreplace(ls,'.',ls->decpoint);\nif(!luaO_str2d(luaZ_buffer(ls->buff),&seminfo->r))\nluaX_lexerror(ls,\"malformed number\",TK_NUMBER);\n}\nstatic int skip_sep(LexState*ls){\nint count=0;\nint s=ls->current;\nsave_and_next(ls);\nwhile(ls->current=='='){\nsave_and_next(ls);\ncount++;\n}\nreturn(ls->current==s)?count:(-count)-1;\n}\nstatic void read_long_string(LexState*ls,SemInfo*seminfo,int sep){\nint cont=0;\n(void)(cont);\nsave_and_next(ls);\nif(currIsNewline(ls))\ninclinenumber(ls);\nfor(;;){\nswitch(ls->current){\ncase(-1):\nluaX_lexerror(ls,(seminfo)?\"unfinished long string\":\n\"unfinished long comment\",TK_EOS);\nbreak;\ncase']':{\nif(skip_sep(ls)==sep){\nsave_and_next(ls);\ngoto endloop;\n}\nbreak;\n}\ncase'\\n':\ncase'\\r':{\nsave(ls,'\\n');\ninclinenumber(ls);\nif(!seminfo)luaZ_resetbuffer(ls->buff);\nbreak;\n}\ndefault:{\nif(seminfo)save_and_next(ls);\nelse next(ls);\n}\n}\n}endloop:\nif(seminfo)\nseminfo->ts=luaX_newstring(ls,luaZ_buffer(ls->buff)+(2+sep),\nluaZ_bufflen(ls->buff)-2*(2+sep));\n}\nstatic void read_string(LexState*ls,int del,SemInfo*seminfo){\nsave_and_next(ls);\nwhile(ls->current!=del){\nswitch(ls->current){\ncase(-1):\nluaX_lexerror(ls,\"unfinished string\",TK_EOS);\ncontinue;\ncase'\\n':\ncase'\\r':\nluaX_lexerror(ls,\"unfinished string\",TK_STRING);\ncontinue;\ncase'\\\\':{\nint c;\nnext(ls);\nswitch(ls->current){\ncase'a':c='\\a';break;\ncase'b':c='\\b';break;\ncase'f':c='\\f';break;\ncase'n':c='\\n';break;\ncase'r':c='\\r';break;\ncase't':c='\\t';break;\ncase'v':c='\\v';break;\ncase'\\n':\ncase'\\r':save(ls,'\\n');inclinenumber(ls);continue;\ncase(-1):continue;\ndefault:{\nif(!isdigit(ls->current))\nsave_and_next(ls);\nelse{\nint i=0;\nc=0;\ndo{\nc=10*c+(ls->current-'0');\nnext(ls);\n}while(++i<3&&isdigit(ls->current));\nif(c>UCHAR_MAX)\nluaX_lexerror(ls,\"escape sequence too large\",TK_STRING);\nsave(ls,c);\n}\ncontinue;\n}\n}\nsave(ls,c);\nnext(ls);\ncontinue;\n}\ndefault:\nsave_and_next(ls);\n}\n}\nsave_and_next(ls);\nseminfo->ts=luaX_newstring(ls,luaZ_buffer(ls->buff)+1,\nluaZ_bufflen(ls->buff)-2);\n}\nstatic int llex(LexState*ls,SemInfo*seminfo){\nluaZ_resetbuffer(ls->buff);\nfor(;;){\nswitch(ls->current){\ncase'\\n':\ncase'\\r':{\ninclinenumber(ls);\ncontinue;\n}\ncase'-':{\nnext(ls);\nif(ls->current!='-')return'-';\nnext(ls);\nif(ls->current=='['){\nint sep=skip_sep(ls);\nluaZ_resetbuffer(ls->buff);\nif(sep>=0){\nread_long_string(ls,NULL,sep);\nluaZ_resetbuffer(ls->buff);\ncontinue;\n}\n}\nwhile(!currIsNewline(ls)&&ls->current!=(-1))\nnext(ls);\ncontinue;\n}\ncase'[':{\nint sep=skip_sep(ls);\nif(sep>=0){\nread_long_string(ls,seminfo,sep);\nreturn TK_STRING;\n}\nelse if(sep==-1)return'[';\nelse luaX_lexerror(ls,\"invalid long string delimiter\",TK_STRING);\n}\ncase'=':{\nnext(ls);\nif(ls->current!='=')return'=';\nelse{next(ls);return TK_EQ;}\n}\ncase'<':{\nnext(ls);\nif(ls->current!='=')return'<';\nelse{next(ls);return TK_LE;}\n}\ncase'>':{\nnext(ls);\nif(ls->current!='=')return'>';\nelse{next(ls);return TK_GE;}\n}\ncase'~':{\nnext(ls);\nif(ls->current!='=')return'~';\nelse{next(ls);return TK_NE;}\n}\ncase'\"':\ncase'\\'':{\nread_string(ls,ls->current,seminfo);\nreturn TK_STRING;\n}\ncase'.':{\nsave_and_next(ls);\nif(check_next(ls,\".\")){\nif(check_next(ls,\".\"))\nreturn TK_DOTS;\nelse return TK_CONCAT;\n}\nelse if(!isdigit(ls->current))return'.';\nelse{\nread_numeral(ls,seminfo);\nreturn TK_NUMBER;\n}\n}\ncase(-1):{\nreturn TK_EOS;\n}\ndefault:{\nif(isspace(ls->current)){\nnext(ls);\ncontinue;\n}\nelse if(isdigit(ls->current)){\nread_numeral(ls,seminfo);\nreturn TK_NUMBER;\n}\nelse if(isalpha(ls->current)||ls->current=='_'){\nTString*ts;\ndo{\nsave_and_next(ls);\n}while(isalnum(ls->current)||ls->current=='_');\nts=luaX_newstring(ls,luaZ_buffer(ls->buff),\nluaZ_bufflen(ls->buff));\nif(ts->tsv.reserved>0)\nreturn ts->tsv.reserved-1+257;\nelse{\nseminfo->ts=ts;\nreturn TK_NAME;\n}\n}\nelse{\nint c=ls->current;\nnext(ls);\nreturn c;\n}\n}\n}\n}\n}\nstatic void luaX_next(LexState*ls){\nls->lastline=ls->linenumber;\nif(ls->lookahead.token!=TK_EOS){\nls->t=ls->lookahead;\nls->lookahead.token=TK_EOS;\n}\nelse\nls->t.token=llex(ls,&ls->t.seminfo);\n}\nstatic void luaX_lookahead(LexState*ls){\nls->lookahead.token=llex(ls,&ls->lookahead.seminfo);\n}\n#define hasjumps(e)((e)->t!=(e)->f)\nstatic int isnumeral(expdesc*e){\nreturn(e->k==VKNUM&&e->t==(-1)&&e->f==(-1));\n}\nstatic void luaK_nil(FuncState*fs,int from,int n){\nInstruction*previous;\nif(fs->pc>fs->lasttarget){\nif(fs->pc==0){\nif(from>=fs->nactvar)\nreturn;\n}\nelse{\nprevious=&fs->f->code[fs->pc-1];\nif(GET_OPCODE(*previous)==OP_LOADNIL){\nint pfrom=GETARG_A(*previous);\nint pto=GETARG_B(*previous);\nif(pfrom<=from&&from<=pto+1){\nif(from+n-1>pto)\nSETARG_B(*previous,from+n-1);\nreturn;\n}\n}\n}\n}\nluaK_codeABC(fs,OP_LOADNIL,from,from+n-1,0);\n}\nstatic int luaK_jump(FuncState*fs){\nint jpc=fs->jpc;\nint j;\nfs->jpc=(-1);\nj=luaK_codeAsBx(fs,OP_JMP,0,(-1));\nluaK_concat(fs,&j,jpc);\nreturn j;\n}\nstatic void luaK_ret(FuncState*fs,int first,int nret){\nluaK_codeABC(fs,OP_RETURN,first,nret+1,0);\n}\nstatic int condjump(FuncState*fs,OpCode op,int A,int B,int C){\nluaK_codeABC(fs,op,A,B,C);\nreturn luaK_jump(fs);\n}\nstatic void fixjump(FuncState*fs,int pc,int dest){\nInstruction*jmp=&fs->f->code[pc];\nint offset=dest-(pc+1);\nif(abs(offset)>(((1<<(9+9))-1)>>1))\nluaX_syntaxerror(fs->ls,\"control structure too long\");\nSETARG_sBx(*jmp,offset);\n}\nstatic int luaK_getlabel(FuncState*fs){\nfs->lasttarget=fs->pc;\nreturn fs->pc;\n}\nstatic int getjump(FuncState*fs,int pc){\nint offset=GETARG_sBx(fs->f->code[pc]);\nif(offset==(-1))\nreturn(-1);\nelse\nreturn(pc+1)+offset;\n}\nstatic Instruction*getjumpcontrol(FuncState*fs,int pc){\nInstruction*pi=&fs->f->code[pc];\nif(pc>=1&&testTMode(GET_OPCODE(*(pi-1))))\nreturn pi-1;\nelse\nreturn pi;\n}\nstatic int need_value(FuncState*fs,int list){\nfor(;list!=(-1);list=getjump(fs,list)){\nInstruction i=*getjumpcontrol(fs,list);\nif(GET_OPCODE(i)!=OP_TESTSET)return 1;\n}\nreturn 0;\n}\nstatic int patchtestreg(FuncState*fs,int node,int reg){\nInstruction*i=getjumpcontrol(fs,node);\nif(GET_OPCODE(*i)!=OP_TESTSET)\nreturn 0;\nif(reg!=((1<<8)-1)&&reg!=GETARG_B(*i))\nSETARG_A(*i,reg);\nelse\n*i=CREATE_ABC(OP_TEST,GETARG_B(*i),0,GETARG_C(*i));\nreturn 1;\n}\nstatic void removevalues(FuncState*fs,int list){\nfor(;list!=(-1);list=getjump(fs,list))\npatchtestreg(fs,list,((1<<8)-1));\n}\nstatic void patchlistaux(FuncState*fs,int list,int vtarget,int reg,\nint dtarget){\nwhile(list!=(-1)){\nint next=getjump(fs,list);\nif(patchtestreg(fs,list,reg))\nfixjump(fs,list,vtarget);\nelse\nfixjump(fs,list,dtarget);\nlist=next;\n}\n}\nstatic void dischargejpc(FuncState*fs){\npatchlistaux(fs,fs->jpc,fs->pc,((1<<8)-1),fs->pc);\nfs->jpc=(-1);\n}\nstatic void luaK_patchlist(FuncState*fs,int list,int target){\nif(target==fs->pc)\nluaK_patchtohere(fs,list);\nelse{\npatchlistaux(fs,list,target,((1<<8)-1),target);\n}\n}\nstatic void luaK_patchtohere(FuncState*fs,int list){\nluaK_getlabel(fs);\nluaK_concat(fs,&fs->jpc,list);\n}\nstatic void luaK_concat(FuncState*fs,int*l1,int l2){\nif(l2==(-1))return;\nelse if(*l1==(-1))\n*l1=l2;\nelse{\nint list=*l1;\nint next;\nwhile((next=getjump(fs,list))!=(-1))\nlist=next;\nfixjump(fs,list,l2);\n}\n}\nstatic void luaK_checkstack(FuncState*fs,int n){\nint newstack=fs->freereg+n;\nif(newstack>fs->f->maxstacksize){\nif(newstack>=250)\nluaX_syntaxerror(fs->ls,\"function or expression too complex\");\nfs->f->maxstacksize=cast_byte(newstack);\n}\n}\nstatic void luaK_reserveregs(FuncState*fs,int n){\nluaK_checkstack(fs,n);\nfs->freereg+=n;\n}\nstatic void freereg(FuncState*fs,int reg){\nif(!ISK(reg)&&reg>=fs->nactvar){\nfs->freereg--;\n}\n}\nstatic void freeexp(FuncState*fs,expdesc*e){\nif(e->k==VNONRELOC)\nfreereg(fs,e->u.s.info);\n}\nstatic int addk(FuncState*fs,TValue*k,TValue*v){\nlua_State*L=fs->L;\nTValue*idx=luaH_set(L,fs->h,k);\nProto*f=fs->f;\nint oldsize=f->sizek;\nif(ttisnumber(idx)){\nreturn cast_int(nvalue(idx));\n}\nelse{\nsetnvalue(idx,cast_num(fs->nk));\nluaM_growvector(L,f->k,fs->nk,f->sizek,TValue,\n((1<<(9+9))-1),\"constant table overflow\");\nwhile(oldsize<f->sizek)setnilvalue(&f->k[oldsize++]);\nsetobj(L,&f->k[fs->nk],v);\nluaC_barrier(L,f,v);\nreturn fs->nk++;\n}\n}\nstatic int luaK_stringK(FuncState*fs,TString*s){\nTValue o;\nsetsvalue(fs->L,&o,s);\nreturn addk(fs,&o,&o);\n}\nstatic int luaK_numberK(FuncState*fs,lua_Number r){\nTValue o;\nsetnvalue(&o,r);\nreturn addk(fs,&o,&o);\n}\nstatic int boolK(FuncState*fs,int b){\nTValue o;\nsetbvalue(&o,b);\nreturn addk(fs,&o,&o);\n}\nstatic int nilK(FuncState*fs){\nTValue k,v;\nsetnilvalue(&v);\nsethvalue(fs->L,&k,fs->h);\nreturn addk(fs,&k,&v);\n}\nstatic void luaK_setreturns(FuncState*fs,expdesc*e,int nresults){\nif(e->k==VCALL){\nSETARG_C(getcode(fs,e),nresults+1);\n}\nelse if(e->k==VVARARG){\nSETARG_B(getcode(fs,e),nresults+1);\nSETARG_A(getcode(fs,e),fs->freereg);\nluaK_reserveregs(fs,1);\n}\n}\nstatic void luaK_setoneret(FuncState*fs,expdesc*e){\nif(e->k==VCALL){\ne->k=VNONRELOC;\ne->u.s.info=GETARG_A(getcode(fs,e));\n}\nelse if(e->k==VVARARG){\nSETARG_B(getcode(fs,e),2);\ne->k=VRELOCABLE;\n}\n}\nstatic void luaK_dischargevars(FuncState*fs,expdesc*e){\nswitch(e->k){\ncase VLOCAL:{\ne->k=VNONRELOC;\nbreak;\n}\ncase VUPVAL:{\ne->u.s.info=luaK_codeABC(fs,OP_GETUPVAL,0,e->u.s.info,0);\ne->k=VRELOCABLE;\nbreak;\n}\ncase VGLOBAL:{\ne->u.s.info=luaK_codeABx(fs,OP_GETGLOBAL,0,e->u.s.info);\ne->k=VRELOCABLE;\nbreak;\n}\ncase VINDEXED:{\nfreereg(fs,e->u.s.aux);\nfreereg(fs,e->u.s.info);\ne->u.s.info=luaK_codeABC(fs,OP_GETTABLE,0,e->u.s.info,e->u.s.aux);\ne->k=VRELOCABLE;\nbreak;\n}\ncase VVARARG:\ncase VCALL:{\nluaK_setoneret(fs,e);\nbreak;\n}\ndefault:break;\n}\n}\nstatic int code_label(FuncState*fs,int A,int b,int jump){\nluaK_getlabel(fs);\nreturn luaK_codeABC(fs,OP_LOADBOOL,A,b,jump);\n}\nstatic void discharge2reg(FuncState*fs,expdesc*e,int reg){\nluaK_dischargevars(fs,e);\nswitch(e->k){\ncase VNIL:{\nluaK_nil(fs,reg,1);\nbreak;\n}\ncase VFALSE:case VTRUE:{\nluaK_codeABC(fs,OP_LOADBOOL,reg,e->k==VTRUE,0);\nbreak;\n}\ncase VK:{\nluaK_codeABx(fs,OP_LOADK,reg,e->u.s.info);\nbreak;\n}\ncase VKNUM:{\nluaK_codeABx(fs,OP_LOADK,reg,luaK_numberK(fs,e->u.nval));\nbreak;\n}\ncase VRELOCABLE:{\nInstruction*pc=&getcode(fs,e);\nSETARG_A(*pc,reg);\nbreak;\n}\ncase VNONRELOC:{\nif(reg!=e->u.s.info)\nluaK_codeABC(fs,OP_MOVE,reg,e->u.s.info,0);\nbreak;\n}\ndefault:{\nreturn;\n}\n}\ne->u.s.info=reg;\ne->k=VNONRELOC;\n}\nstatic void discharge2anyreg(FuncState*fs,expdesc*e){\nif(e->k!=VNONRELOC){\nluaK_reserveregs(fs,1);\ndischarge2reg(fs,e,fs->freereg-1);\n}\n}\nstatic void exp2reg(FuncState*fs,expdesc*e,int reg){\ndischarge2reg(fs,e,reg);\nif(e->k==VJMP)\nluaK_concat(fs,&e->t,e->u.s.info);\nif(hasjumps(e)){\nint final;\nint p_f=(-1);\nint p_t=(-1);\nif(need_value(fs,e->t)||need_value(fs,e->f)){\nint fj=(e->k==VJMP)?(-1):luaK_jump(fs);\np_f=code_label(fs,reg,0,1);\np_t=code_label(fs,reg,1,0);\nluaK_patchtohere(fs,fj);\n}\nfinal=luaK_getlabel(fs);\npatchlistaux(fs,e->f,final,reg,p_f);\npatchlistaux(fs,e->t,final,reg,p_t);\n}\ne->f=e->t=(-1);\ne->u.s.info=reg;\ne->k=VNONRELOC;\n}\nstatic void luaK_exp2nextreg(FuncState*fs,expdesc*e){\nluaK_dischargevars(fs,e);\nfreeexp(fs,e);\nluaK_reserveregs(fs,1);\nexp2reg(fs,e,fs->freereg-1);\n}\nstatic int luaK_exp2anyreg(FuncState*fs,expdesc*e){\nluaK_dischargevars(fs,e);\nif(e->k==VNONRELOC){\nif(!hasjumps(e))return e->u.s.info;\nif(e->u.s.info>=fs->nactvar){\nexp2reg(fs,e,e->u.s.info);\nreturn e->u.s.info;\n}\n}\nluaK_exp2nextreg(fs,e);\nreturn e->u.s.info;\n}\nstatic void luaK_exp2val(FuncState*fs,expdesc*e){\nif(hasjumps(e))\nluaK_exp2anyreg(fs,e);\nelse\nluaK_dischargevars(fs,e);\n}\nstatic int luaK_exp2RK(FuncState*fs,expdesc*e){\nluaK_exp2val(fs,e);\nswitch(e->k){\ncase VKNUM:\ncase VTRUE:\ncase VFALSE:\ncase VNIL:{\nif(fs->nk<=((1<<(9-1))-1)){\ne->u.s.info=(e->k==VNIL)?nilK(fs):\n(e->k==VKNUM)?luaK_numberK(fs,e->u.nval):\nboolK(fs,(e->k==VTRUE));\ne->k=VK;\nreturn RKASK(e->u.s.info);\n}\nelse break;\n}\ncase VK:{\nif(e->u.s.info<=((1<<(9-1))-1))\nreturn RKASK(e->u.s.info);\nelse break;\n}\ndefault:break;\n}\nreturn luaK_exp2anyreg(fs,e);\n}\nstatic void luaK_storevar(FuncState*fs,expdesc*var,expdesc*ex){\nswitch(var->k){\ncase VLOCAL:{\nfreeexp(fs,ex);\nexp2reg(fs,ex,var->u.s.info);\nreturn;\n}\ncase VUPVAL:{\nint e=luaK_exp2anyreg(fs,ex);\nluaK_codeABC(fs,OP_SETUPVAL,e,var->u.s.info,0);\nbreak;\n}\ncase VGLOBAL:{\nint e=luaK_exp2anyreg(fs,ex);\nluaK_codeABx(fs,OP_SETGLOBAL,e,var->u.s.info);\nbreak;\n}\ncase VINDEXED:{\nint e=luaK_exp2RK(fs,ex);\nluaK_codeABC(fs,OP_SETTABLE,var->u.s.info,var->u.s.aux,e);\nbreak;\n}\ndefault:{\nbreak;\n}\n}\nfreeexp(fs,ex);\n}\nstatic void luaK_self(FuncState*fs,expdesc*e,expdesc*key){\nint func;\nluaK_exp2anyreg(fs,e);\nfreeexp(fs,e);\nfunc=fs->freereg;\nluaK_reserveregs(fs,2);\nluaK_codeABC(fs,OP_SELF,func,e->u.s.info,luaK_exp2RK(fs,key));\nfreeexp(fs,key);\ne->u.s.info=func;\ne->k=VNONRELOC;\n}\nstatic void invertjump(FuncState*fs,expdesc*e){\nInstruction*pc=getjumpcontrol(fs,e->u.s.info);\nSETARG_A(*pc,!(GETARG_A(*pc)));\n}\nstatic int jumponcond(FuncState*fs,expdesc*e,int cond){\nif(e->k==VRELOCABLE){\nInstruction ie=getcode(fs,e);\nif(GET_OPCODE(ie)==OP_NOT){\nfs->pc--;\nreturn condjump(fs,OP_TEST,GETARG_B(ie),0,!cond);\n}\n}\ndischarge2anyreg(fs,e);\nfreeexp(fs,e);\nreturn condjump(fs,OP_TESTSET,((1<<8)-1),e->u.s.info,cond);\n}\nstatic void luaK_goiftrue(FuncState*fs,expdesc*e){\nint pc;\nluaK_dischargevars(fs,e);\nswitch(e->k){\ncase VK:case VKNUM:case VTRUE:{\npc=(-1);\nbreak;\n}\ncase VJMP:{\ninvertjump(fs,e);\npc=e->u.s.info;\nbreak;\n}\ndefault:{\npc=jumponcond(fs,e,0);\nbreak;\n}\n}\nluaK_concat(fs,&e->f,pc);\nluaK_patchtohere(fs,e->t);\ne->t=(-1);\n}\nstatic void luaK_goiffalse(FuncState*fs,expdesc*e){\nint pc;\nluaK_dischargevars(fs,e);\nswitch(e->k){\ncase VNIL:case VFALSE:{\npc=(-1);\nbreak;\n}\ncase VJMP:{\npc=e->u.s.info;\nbreak;\n}\ndefault:{\npc=jumponcond(fs,e,1);\nbreak;\n}\n}\nluaK_concat(fs,&e->t,pc);\nluaK_patchtohere(fs,e->f);\ne->f=(-1);\n}\nstatic void codenot(FuncState*fs,expdesc*e){\nluaK_dischargevars(fs,e);\nswitch(e->k){\ncase VNIL:case VFALSE:{\ne->k=VTRUE;\nbreak;\n}\ncase VK:case VKNUM:case VTRUE:{\ne->k=VFALSE;\nbreak;\n}\ncase VJMP:{\ninvertjump(fs,e);\nbreak;\n}\ncase VRELOCABLE:\ncase VNONRELOC:{\ndischarge2anyreg(fs,e);\nfreeexp(fs,e);\ne->u.s.info=luaK_codeABC(fs,OP_NOT,0,e->u.s.info,0);\ne->k=VRELOCABLE;\nbreak;\n}\ndefault:{\nbreak;\n}\n}\n{int temp=e->f;e->f=e->t;e->t=temp;}\nremovevalues(fs,e->f);\nremovevalues(fs,e->t);\n}\nstatic void luaK_indexed(FuncState*fs,expdesc*t,expdesc*k){\nt->u.s.aux=luaK_exp2RK(fs,k);\nt->k=VINDEXED;\n}\nstatic int constfolding(OpCode op,expdesc*e1,expdesc*e2){\nlua_Number v1,v2,r;\nif(!isnumeral(e1)||!isnumeral(e2))return 0;\nv1=e1->u.nval;\nv2=e2->u.nval;\nswitch(op){\ncase OP_ADD:r=luai_numadd(v1,v2);break;\ncase OP_SUB:r=luai_numsub(v1,v2);break;\ncase OP_MUL:r=luai_nummul(v1,v2);break;\ncase OP_DIV:\nif(v2==0)return 0;\nr=luai_numdiv(v1,v2);break;\ncase OP_MOD:\nif(v2==0)return 0;\nr=luai_nummod(v1,v2);break;\ncase OP_POW:r=luai_numpow(v1,v2);break;\ncase OP_UNM:r=luai_numunm(v1);break;\ncase OP_LEN:return 0;\ndefault:r=0;break;\n}\nif(luai_numisnan(r))return 0;\ne1->u.nval=r;\nreturn 1;\n}\nstatic void codearith(FuncState*fs,OpCode op,expdesc*e1,expdesc*e2){\nif(constfolding(op,e1,e2))\nreturn;\nelse{\nint o2=(op!=OP_UNM&&op!=OP_LEN)?luaK_exp2RK(fs,e2):0;\nint o1=luaK_exp2RK(fs,e1);\nif(o1>o2){\nfreeexp(fs,e1);\nfreeexp(fs,e2);\n}\nelse{\nfreeexp(fs,e2);\nfreeexp(fs,e1);\n}\ne1->u.s.info=luaK_codeABC(fs,op,0,o1,o2);\ne1->k=VRELOCABLE;\n}\n}\nstatic void codecomp(FuncState*fs,OpCode op,int cond,expdesc*e1,\nexpdesc*e2){\nint o1=luaK_exp2RK(fs,e1);\nint o2=luaK_exp2RK(fs,e2);\nfreeexp(fs,e2);\nfreeexp(fs,e1);\nif(cond==0&&op!=OP_EQ){\nint temp;\ntemp=o1;o1=o2;o2=temp;\ncond=1;\n}\ne1->u.s.info=condjump(fs,op,cond,o1,o2);\ne1->k=VJMP;\n}\nstatic void luaK_prefix(FuncState*fs,UnOpr op,expdesc*e){\nexpdesc e2;\ne2.t=e2.f=(-1);e2.k=VKNUM;e2.u.nval=0;\nswitch(op){\ncase OPR_MINUS:{\nif(!isnumeral(e))\nluaK_exp2anyreg(fs,e);\ncodearith(fs,OP_UNM,e,&e2);\nbreak;\n}\ncase OPR_NOT:codenot(fs,e);break;\ncase OPR_LEN:{\nluaK_exp2anyreg(fs,e);\ncodearith(fs,OP_LEN,e,&e2);\nbreak;\n}\ndefault:;\n}\n}\nstatic void luaK_infix(FuncState*fs,BinOpr op,expdesc*v){\nswitch(op){\ncase OPR_AND:{\nluaK_goiftrue(fs,v);\nbreak;\n}\ncase OPR_OR:{\nluaK_goiffalse(fs,v);\nbreak;\n}\ncase OPR_CONCAT:{\nluaK_exp2nextreg(fs,v);\nbreak;\n}\ncase OPR_ADD:case OPR_SUB:case OPR_MUL:case OPR_DIV:\ncase OPR_MOD:case OPR_POW:{\nif(!isnumeral(v))luaK_exp2RK(fs,v);\nbreak;\n}\ndefault:{\nluaK_exp2RK(fs,v);\nbreak;\n}\n}\n}\nstatic void luaK_posfix(FuncState*fs,BinOpr op,expdesc*e1,expdesc*e2){\nswitch(op){\ncase OPR_AND:{\nluaK_dischargevars(fs,e2);\nluaK_concat(fs,&e2->f,e1->f);\n*e1=*e2;\nbreak;\n}\ncase OPR_OR:{\nluaK_dischargevars(fs,e2);\nluaK_concat(fs,&e2->t,e1->t);\n*e1=*e2;\nbreak;\n}\ncase OPR_CONCAT:{\nluaK_exp2val(fs,e2);\nif(e2->k==VRELOCABLE&&GET_OPCODE(getcode(fs,e2))==OP_CONCAT){\nfreeexp(fs,e1);\nSETARG_B(getcode(fs,e2),e1->u.s.info);\ne1->k=VRELOCABLE;e1->u.s.info=e2->u.s.info;\n}\nelse{\nluaK_exp2nextreg(fs,e2);\ncodearith(fs,OP_CONCAT,e1,e2);\n}\nbreak;\n}\ncase OPR_ADD:codearith(fs,OP_ADD,e1,e2);break;\ncase OPR_SUB:codearith(fs,OP_SUB,e1,e2);break;\ncase OPR_MUL:codearith(fs,OP_MUL,e1,e2);break;\ncase OPR_DIV:codearith(fs,OP_DIV,e1,e2);break;\ncase OPR_MOD:codearith(fs,OP_MOD,e1,e2);break;\ncase OPR_POW:codearith(fs,OP_POW,e1,e2);break;\ncase OPR_EQ:codecomp(fs,OP_EQ,1,e1,e2);break;\ncase OPR_NE:codecomp(fs,OP_EQ,0,e1,e2);break;\ncase OPR_LT:codecomp(fs,OP_LT,1,e1,e2);break;\ncase OPR_LE:codecomp(fs,OP_LE,1,e1,e2);break;\ncase OPR_GT:codecomp(fs,OP_LT,0,e1,e2);break;\ncase OPR_GE:codecomp(fs,OP_LE,0,e1,e2);break;\ndefault:;\n}\n}\nstatic void luaK_fixline(FuncState*fs,int line){\nfs->f->lineinfo[fs->pc-1]=line;\n}\nstatic int luaK_code(FuncState*fs,Instruction i,int line){\nProto*f=fs->f;\ndischargejpc(fs);\nluaM_growvector(fs->L,f->code,fs->pc,f->sizecode,Instruction,\n(INT_MAX-2),\"code size overflow\");\nf->code[fs->pc]=i;\nluaM_growvector(fs->L,f->lineinfo,fs->pc,f->sizelineinfo,int,\n(INT_MAX-2),\"code size overflow\");\nf->lineinfo[fs->pc]=line;\nreturn fs->pc++;\n}\nstatic int luaK_codeABC(FuncState*fs,OpCode o,int a,int b,int c){\nreturn luaK_code(fs,CREATE_ABC(o,a,b,c),fs->ls->lastline);\n}\nstatic int luaK_codeABx(FuncState*fs,OpCode o,int a,unsigned int bc){\nreturn luaK_code(fs,CREATE_ABx(o,a,bc),fs->ls->lastline);\n}\nstatic void luaK_setlist(FuncState*fs,int base,int nelems,int tostore){\nint c=(nelems-1)/50+1;\nint b=(tostore==(-1))?0:tostore;\nif(c<=((1<<9)-1))\nluaK_codeABC(fs,OP_SETLIST,base,b,c);\nelse{\nluaK_codeABC(fs,OP_SETLIST,base,b,0);\nluaK_code(fs,cast(Instruction,c),fs->ls->lastline);\n}\nfs->freereg=base+1;\n}\n#define hasmultret(k)((k)==VCALL||(k)==VVARARG)\n#define getlocvar(fs,i)((fs)->f->locvars[(fs)->actvar[i]])\n#define luaY_checklimit(fs,v,l,m)if((v)>(l))errorlimit(fs,l,m)\ntypedef struct BlockCnt{\nstruct BlockCnt*previous;\nint breaklist;\nlu_byte nactvar;\nlu_byte upval;\nlu_byte isbreakable;\n}BlockCnt;\nstatic void chunk(LexState*ls);\nstatic void expr(LexState*ls,expdesc*v);\nstatic void anchor_token(LexState*ls){\nif(ls->t.token==TK_NAME||ls->t.token==TK_STRING){\nTString*ts=ls->t.seminfo.ts;\nluaX_newstring(ls,getstr(ts),ts->tsv.len);\n}\n}\nstatic void error_expected(LexState*ls,int token){\nluaX_syntaxerror(ls,\nluaO_pushfstring(ls->L,LUA_QL(\"%s\")\" expected\",luaX_token2str(ls,token)));\n}\nstatic void errorlimit(FuncState*fs,int limit,const char*what){\nconst char*msg=(fs->f->linedefined==0)?\nluaO_pushfstring(fs->L,\"main function has more than %d %s\",limit,what):\nluaO_pushfstring(fs->L,\"function at line %d has more than %d %s\",\nfs->f->linedefined,limit,what);\nluaX_lexerror(fs->ls,msg,0);\n}\nstatic int testnext(LexState*ls,int c){\nif(ls->t.token==c){\nluaX_next(ls);\nreturn 1;\n}\nelse return 0;\n}\nstatic void check(LexState*ls,int c){\nif(ls->t.token!=c)\nerror_expected(ls,c);\n}\nstatic void checknext(LexState*ls,int c){\ncheck(ls,c);\nluaX_next(ls);\n}\n#define check_condition(ls,c,msg){if(!(c))luaX_syntaxerror(ls,msg);}\nstatic void check_match(LexState*ls,int what,int who,int where){\nif(!testnext(ls,what)){\nif(where==ls->linenumber)\nerror_expected(ls,what);\nelse{\nluaX_syntaxerror(ls,luaO_pushfstring(ls->L,\nLUA_QL(\"%s\")\" expected (to close \"LUA_QL(\"%s\")\" at line %d)\",\nluaX_token2str(ls,what),luaX_token2str(ls,who),where));\n}\n}\n}\nstatic TString*str_checkname(LexState*ls){\nTString*ts;\ncheck(ls,TK_NAME);\nts=ls->t.seminfo.ts;\nluaX_next(ls);\nreturn ts;\n}\nstatic void init_exp(expdesc*e,expkind k,int i){\ne->f=e->t=(-1);\ne->k=k;\ne->u.s.info=i;\n}\nstatic void codestring(LexState*ls,expdesc*e,TString*s){\ninit_exp(e,VK,luaK_stringK(ls->fs,s));\n}\nstatic void checkname(LexState*ls,expdesc*e){\ncodestring(ls,e,str_checkname(ls));\n}\nstatic int registerlocalvar(LexState*ls,TString*varname){\nFuncState*fs=ls->fs;\nProto*f=fs->f;\nint oldsize=f->sizelocvars;\nluaM_growvector(ls->L,f->locvars,fs->nlocvars,f->sizelocvars,\nLocVar,SHRT_MAX,\"too many local variables\");\nwhile(oldsize<f->sizelocvars)f->locvars[oldsize++].varname=NULL;\nf->locvars[fs->nlocvars].varname=varname;\nluaC_objbarrier(ls->L,f,varname);\nreturn fs->nlocvars++;\n}\n#define new_localvarliteral(ls,v,n)new_localvar(ls,luaX_newstring(ls,\"\"v,(sizeof(v)/sizeof(char))-1),n)\nstatic void new_localvar(LexState*ls,TString*name,int n){\nFuncState*fs=ls->fs;\nluaY_checklimit(fs,fs->nactvar+n+1,200,\"local variables\");\nfs->actvar[fs->nactvar+n]=cast(unsigned short,registerlocalvar(ls,name));\n}\nstatic void adjustlocalvars(LexState*ls,int nvars){\nFuncState*fs=ls->fs;\nfs->nactvar=cast_byte(fs->nactvar+nvars);\nfor(;nvars;nvars--){\ngetlocvar(fs,fs->nactvar-nvars).startpc=fs->pc;\n}\n}\nstatic void removevars(LexState*ls,int tolevel){\nFuncState*fs=ls->fs;\nwhile(fs->nactvar>tolevel)\ngetlocvar(fs,--fs->nactvar).endpc=fs->pc;\n}\nstatic int indexupvalue(FuncState*fs,TString*name,expdesc*v){\nint i;\nProto*f=fs->f;\nint oldsize=f->sizeupvalues;\nfor(i=0;i<f->nups;i++){\nif(fs->upvalues[i].k==v->k&&fs->upvalues[i].info==v->u.s.info){\nreturn i;\n}\n}\nluaY_checklimit(fs,f->nups+1,60,\"upvalues\");\nluaM_growvector(fs->L,f->upvalues,f->nups,f->sizeupvalues,\nTString*,(INT_MAX-2),\"\");\nwhile(oldsize<f->sizeupvalues)f->upvalues[oldsize++]=NULL;\nf->upvalues[f->nups]=name;\nluaC_objbarrier(fs->L,f,name);\nfs->upvalues[f->nups].k=cast_byte(v->k);\nfs->upvalues[f->nups].info=cast_byte(v->u.s.info);\nreturn f->nups++;\n}\nstatic int searchvar(FuncState*fs,TString*n){\nint i;\nfor(i=fs->nactvar-1;i>=0;i--){\nif(n==getlocvar(fs,i).varname)\nreturn i;\n}\nreturn-1;\n}\nstatic void markupval(FuncState*fs,int level){\nBlockCnt*bl=fs->bl;\nwhile(bl&&bl->nactvar>level)bl=bl->previous;\nif(bl)bl->upval=1;\n}\nstatic int singlevaraux(FuncState*fs,TString*n,expdesc*var,int base){\nif(fs==NULL){\ninit_exp(var,VGLOBAL,((1<<8)-1));\nreturn VGLOBAL;\n}\nelse{\nint v=searchvar(fs,n);\nif(v>=0){\ninit_exp(var,VLOCAL,v);\nif(!base)\nmarkupval(fs,v);\nreturn VLOCAL;\n}\nelse{\nif(singlevaraux(fs->prev,n,var,0)==VGLOBAL)\nreturn VGLOBAL;\nvar->u.s.info=indexupvalue(fs,n,var);\nvar->k=VUPVAL;\nreturn VUPVAL;\n}\n}\n}\nstatic void singlevar(LexState*ls,expdesc*var){\nTString*varname=str_checkname(ls);\nFuncState*fs=ls->fs;\nif(singlevaraux(fs,varname,var,1)==VGLOBAL)\nvar->u.s.info=luaK_stringK(fs,varname);\n}\nstatic void adjust_assign(LexState*ls,int nvars,int nexps,expdesc*e){\nFuncState*fs=ls->fs;\nint extra=nvars-nexps;\nif(hasmultret(e->k)){\nextra++;\nif(extra<0)extra=0;\nluaK_setreturns(fs,e,extra);\nif(extra>1)luaK_reserveregs(fs,extra-1);\n}\nelse{\nif(e->k!=VVOID)luaK_exp2nextreg(fs,e);\nif(extra>0){\nint reg=fs->freereg;\nluaK_reserveregs(fs,extra);\nluaK_nil(fs,reg,extra);\n}\n}\n}\nstatic void enterlevel(LexState*ls){\nif(++ls->L->nCcalls>200)\nluaX_lexerror(ls,\"chunk has too many syntax levels\",0);\n}\n#define leavelevel(ls)((ls)->L->nCcalls--)\nstatic void enterblock(FuncState*fs,BlockCnt*bl,lu_byte isbreakable){\nbl->breaklist=(-1);\nbl->isbreakable=isbreakable;\nbl->nactvar=fs->nactvar;\nbl->upval=0;\nbl->previous=fs->bl;\nfs->bl=bl;\n}\nstatic void leaveblock(FuncState*fs){\nBlockCnt*bl=fs->bl;\nfs->bl=bl->previous;\nremovevars(fs->ls,bl->nactvar);\nif(bl->upval)\nluaK_codeABC(fs,OP_CLOSE,bl->nactvar,0,0);\nfs->freereg=fs->nactvar;\nluaK_patchtohere(fs,bl->breaklist);\n}\nstatic void pushclosure(LexState*ls,FuncState*func,expdesc*v){\nFuncState*fs=ls->fs;\nProto*f=fs->f;\nint oldsize=f->sizep;\nint i;\nluaM_growvector(ls->L,f->p,fs->np,f->sizep,Proto*,\n((1<<(9+9))-1),\"constant table overflow\");\nwhile(oldsize<f->sizep)f->p[oldsize++]=NULL;\nf->p[fs->np++]=func->f;\nluaC_objbarrier(ls->L,f,func->f);\ninit_exp(v,VRELOCABLE,luaK_codeABx(fs,OP_CLOSURE,0,fs->np-1));\nfor(i=0;i<func->f->nups;i++){\nOpCode o=(func->upvalues[i].k==VLOCAL)?OP_MOVE:OP_GETUPVAL;\nluaK_codeABC(fs,o,0,func->upvalues[i].info,0);\n}\n}\nstatic void open_func(LexState*ls,FuncState*fs){\nlua_State*L=ls->L;\nProto*f=luaF_newproto(L);\nfs->f=f;\nfs->prev=ls->fs;\nfs->ls=ls;\nfs->L=L;\nls->fs=fs;\nfs->pc=0;\nfs->lasttarget=-1;\nfs->jpc=(-1);\nfs->freereg=0;\nfs->nk=0;\nfs->np=0;\nfs->nlocvars=0;\nfs->nactvar=0;\nfs->bl=NULL;\nf->source=ls->source;\nf->maxstacksize=2;\nfs->h=luaH_new(L,0,0);\nsethvalue(L,L->top,fs->h);\nincr_top(L);\nsetptvalue(L,L->top,f);\nincr_top(L);\n}\nstatic void close_func(LexState*ls){\nlua_State*L=ls->L;\nFuncState*fs=ls->fs;\nProto*f=fs->f;\nremovevars(ls,0);\nluaK_ret(fs,0,0);\nluaM_reallocvector(L,f->code,f->sizecode,fs->pc,Instruction);\nf->sizecode=fs->pc;\nluaM_reallocvector(L,f->lineinfo,f->sizelineinfo,fs->pc,int);\nf->sizelineinfo=fs->pc;\nluaM_reallocvector(L,f->k,f->sizek,fs->nk,TValue);\nf->sizek=fs->nk;\nluaM_reallocvector(L,f->p,f->sizep,fs->np,Proto*);\nf->sizep=fs->np;\nluaM_reallocvector(L,f->locvars,f->sizelocvars,fs->nlocvars,LocVar);\nf->sizelocvars=fs->nlocvars;\nluaM_reallocvector(L,f->upvalues,f->sizeupvalues,f->nups,TString*);\nf->sizeupvalues=f->nups;\nls->fs=fs->prev;\nif(fs)anchor_token(ls);\nL->top-=2;\n}\nstatic Proto*luaY_parser(lua_State*L,ZIO*z,Mbuffer*buff,const char*name){\nstruct LexState lexstate;\nstruct FuncState funcstate;\nlexstate.buff=buff;\nluaX_setinput(L,&lexstate,z,luaS_new(L,name));\nopen_func(&lexstate,&funcstate);\nfuncstate.f->is_vararg=2;\nluaX_next(&lexstate);\nchunk(&lexstate);\ncheck(&lexstate,TK_EOS);\nclose_func(&lexstate);\nreturn funcstate.f;\n}\nstatic void field(LexState*ls,expdesc*v){\nFuncState*fs=ls->fs;\nexpdesc key;\nluaK_exp2anyreg(fs,v);\nluaX_next(ls);\ncheckname(ls,&key);\nluaK_indexed(fs,v,&key);\n}\nstatic void yindex(LexState*ls,expdesc*v){\nluaX_next(ls);\nexpr(ls,v);\nluaK_exp2val(ls->fs,v);\nchecknext(ls,']');\n}\nstruct ConsControl{\nexpdesc v;\nexpdesc*t;\nint nh;\nint na;\nint tostore;\n};\nstatic void recfield(LexState*ls,struct ConsControl*cc){\nFuncState*fs=ls->fs;\nint reg=ls->fs->freereg;\nexpdesc key,val;\nint rkkey;\nif(ls->t.token==TK_NAME){\nluaY_checklimit(fs,cc->nh,(INT_MAX-2),\"items in a constructor\");\ncheckname(ls,&key);\n}\nelse\nyindex(ls,&key);\ncc->nh++;\nchecknext(ls,'=');\nrkkey=luaK_exp2RK(fs,&key);\nexpr(ls,&val);\nluaK_codeABC(fs,OP_SETTABLE,cc->t->u.s.info,rkkey,luaK_exp2RK(fs,&val));\nfs->freereg=reg;\n}\nstatic void closelistfield(FuncState*fs,struct ConsControl*cc){\nif(cc->v.k==VVOID)return;\nluaK_exp2nextreg(fs,&cc->v);\ncc->v.k=VVOID;\nif(cc->tostore==50){\nluaK_setlist(fs,cc->t->u.s.info,cc->na,cc->tostore);\ncc->tostore=0;\n}\n}\nstatic void lastlistfield(FuncState*fs,struct ConsControl*cc){\nif(cc->tostore==0)return;\nif(hasmultret(cc->v.k)){\nluaK_setmultret(fs,&cc->v);\nluaK_setlist(fs,cc->t->u.s.info,cc->na,(-1));\ncc->na--;\n}\nelse{\nif(cc->v.k!=VVOID)\nluaK_exp2nextreg(fs,&cc->v);\nluaK_setlist(fs,cc->t->u.s.info,cc->na,cc->tostore);\n}\n}\nstatic void listfield(LexState*ls,struct ConsControl*cc){\nexpr(ls,&cc->v);\nluaY_checklimit(ls->fs,cc->na,(INT_MAX-2),\"items in a constructor\");\ncc->na++;\ncc->tostore++;\n}\nstatic void constructor(LexState*ls,expdesc*t){\nFuncState*fs=ls->fs;\nint line=ls->linenumber;\nint pc=luaK_codeABC(fs,OP_NEWTABLE,0,0,0);\nstruct ConsControl cc;\ncc.na=cc.nh=cc.tostore=0;\ncc.t=t;\ninit_exp(t,VRELOCABLE,pc);\ninit_exp(&cc.v,VVOID,0);\nluaK_exp2nextreg(ls->fs,t);\nchecknext(ls,'{');\ndo{\nif(ls->t.token=='}')break;\ncloselistfield(fs,&cc);\nswitch(ls->t.token){\ncase TK_NAME:{\nluaX_lookahead(ls);\nif(ls->lookahead.token!='=')\nlistfield(ls,&cc);\nelse\nrecfield(ls,&cc);\nbreak;\n}\ncase'[':{\nrecfield(ls,&cc);\nbreak;\n}\ndefault:{\nlistfield(ls,&cc);\nbreak;\n}\n}\n}while(testnext(ls,',')||testnext(ls,';'));\ncheck_match(ls,'}','{',line);\nlastlistfield(fs,&cc);\nSETARG_B(fs->f->code[pc],luaO_int2fb(cc.na));\nSETARG_C(fs->f->code[pc],luaO_int2fb(cc.nh));\n}\nstatic void parlist(LexState*ls){\nFuncState*fs=ls->fs;\nProto*f=fs->f;\nint nparams=0;\nf->is_vararg=0;\nif(ls->t.token!=')'){\ndo{\nswitch(ls->t.token){\ncase TK_NAME:{\nnew_localvar(ls,str_checkname(ls),nparams++);\nbreak;\n}\ncase TK_DOTS:{\nluaX_next(ls);\nf->is_vararg|=2;\nbreak;\n}\ndefault:luaX_syntaxerror(ls,\"<name> or \"LUA_QL(\"...\")\" expected\");\n}\n}while(!f->is_vararg&&testnext(ls,','));\n}\nadjustlocalvars(ls,nparams);\nf->numparams=cast_byte(fs->nactvar-(f->is_vararg&1));\nluaK_reserveregs(fs,fs->nactvar);\n}\nstatic void body(LexState*ls,expdesc*e,int needself,int line){\nFuncState new_fs;\nopen_func(ls,&new_fs);\nnew_fs.f->linedefined=line;\nchecknext(ls,'(');\nif(needself){\nnew_localvarliteral(ls,\"self\",0);\nadjustlocalvars(ls,1);\n}\nparlist(ls);\nchecknext(ls,')');\nchunk(ls);\nnew_fs.f->lastlinedefined=ls->linenumber;\ncheck_match(ls,TK_END,TK_FUNCTION,line);\nclose_func(ls);\npushclosure(ls,&new_fs,e);\n}\nstatic int explist1(LexState*ls,expdesc*v){\nint n=1;\nexpr(ls,v);\nwhile(testnext(ls,',')){\nluaK_exp2nextreg(ls->fs,v);\nexpr(ls,v);\nn++;\n}\nreturn n;\n}\nstatic void funcargs(LexState*ls,expdesc*f){\nFuncState*fs=ls->fs;\nexpdesc args;\nint base,nparams;\nint line=ls->linenumber;\nswitch(ls->t.token){\ncase'(':{\nif(line!=ls->lastline)\nluaX_syntaxerror(ls,\"ambiguous syntax (function call x new statement)\");\nluaX_next(ls);\nif(ls->t.token==')')\nargs.k=VVOID;\nelse{\nexplist1(ls,&args);\nluaK_setmultret(fs,&args);\n}\ncheck_match(ls,')','(',line);\nbreak;\n}\ncase'{':{\nconstructor(ls,&args);\nbreak;\n}\ncase TK_STRING:{\ncodestring(ls,&args,ls->t.seminfo.ts);\nluaX_next(ls);\nbreak;\n}\ndefault:{\nluaX_syntaxerror(ls,\"function arguments expected\");\nreturn;\n}\n}\nbase=f->u.s.info;\nif(hasmultret(args.k))\nnparams=(-1);\nelse{\nif(args.k!=VVOID)\nluaK_exp2nextreg(fs,&args);\nnparams=fs->freereg-(base+1);\n}\ninit_exp(f,VCALL,luaK_codeABC(fs,OP_CALL,base,nparams+1,2));\nluaK_fixline(fs,line);\nfs->freereg=base+1;\n}\nstatic void prefixexp(LexState*ls,expdesc*v){\nswitch(ls->t.token){\ncase'(':{\nint line=ls->linenumber;\nluaX_next(ls);\nexpr(ls,v);\ncheck_match(ls,')','(',line);\nluaK_dischargevars(ls->fs,v);\nreturn;\n}\ncase TK_NAME:{\nsinglevar(ls,v);\nreturn;\n}\ndefault:{\nluaX_syntaxerror(ls,\"unexpected symbol\");\nreturn;\n}\n}\n}\nstatic void primaryexp(LexState*ls,expdesc*v){\nFuncState*fs=ls->fs;\nprefixexp(ls,v);\nfor(;;){\nswitch(ls->t.token){\ncase'.':{\nfield(ls,v);\nbreak;\n}\ncase'[':{\nexpdesc key;\nluaK_exp2anyreg(fs,v);\nyindex(ls,&key);\nluaK_indexed(fs,v,&key);\nbreak;\n}\ncase':':{\nexpdesc key;\nluaX_next(ls);\ncheckname(ls,&key);\nluaK_self(fs,v,&key);\nfuncargs(ls,v);\nbreak;\n}\ncase'(':case TK_STRING:case'{':{\nluaK_exp2nextreg(fs,v);\nfuncargs(ls,v);\nbreak;\n}\ndefault:return;\n}\n}\n}\nstatic void simpleexp(LexState*ls,expdesc*v){\nswitch(ls->t.token){\ncase TK_NUMBER:{\ninit_exp(v,VKNUM,0);\nv->u.nval=ls->t.seminfo.r;\nbreak;\n}\ncase TK_STRING:{\ncodestring(ls,v,ls->t.seminfo.ts);\nbreak;\n}\ncase TK_NIL:{\ninit_exp(v,VNIL,0);\nbreak;\n}\ncase TK_TRUE:{\ninit_exp(v,VTRUE,0);\nbreak;\n}\ncase TK_FALSE:{\ninit_exp(v,VFALSE,0);\nbreak;\n}\ncase TK_DOTS:{\nFuncState*fs=ls->fs;\ncheck_condition(ls,fs->f->is_vararg,\n\"cannot use \"LUA_QL(\"...\")\" outside a vararg function\");\nfs->f->is_vararg&=~4;\ninit_exp(v,VVARARG,luaK_codeABC(fs,OP_VARARG,0,1,0));\nbreak;\n}\ncase'{':{\nconstructor(ls,v);\nreturn;\n}\ncase TK_FUNCTION:{\nluaX_next(ls);\nbody(ls,v,0,ls->linenumber);\nreturn;\n}\ndefault:{\nprimaryexp(ls,v);\nreturn;\n}\n}\nluaX_next(ls);\n}\nstatic UnOpr getunopr(int op){\nswitch(op){\ncase TK_NOT:return OPR_NOT;\ncase'-':return OPR_MINUS;\ncase'#':return OPR_LEN;\ndefault:return OPR_NOUNOPR;\n}\n}\nstatic BinOpr getbinopr(int op){\nswitch(op){\ncase'+':return OPR_ADD;\ncase'-':return OPR_SUB;\ncase'*':return OPR_MUL;\ncase'/':return OPR_DIV;\ncase'%':return OPR_MOD;\ncase'^':return OPR_POW;\ncase TK_CONCAT:return OPR_CONCAT;\ncase TK_NE:return OPR_NE;\ncase TK_EQ:return OPR_EQ;\ncase'<':return OPR_LT;\ncase TK_LE:return OPR_LE;\ncase'>':return OPR_GT;\ncase TK_GE:return OPR_GE;\ncase TK_AND:return OPR_AND;\ncase TK_OR:return OPR_OR;\ndefault:return OPR_NOBINOPR;\n}\n}\nstatic const struct{\nlu_byte left;\nlu_byte right;\n}priority[]={\n{6,6},{6,6},{7,7},{7,7},{7,7},\n{10,9},{5,4},\n{3,3},{3,3},\n{3,3},{3,3},{3,3},{3,3},\n{2,2},{1,1}\n};\nstatic BinOpr subexpr(LexState*ls,expdesc*v,unsigned int limit){\nBinOpr op;\nUnOpr uop;\nenterlevel(ls);\nuop=getunopr(ls->t.token);\nif(uop!=OPR_NOUNOPR){\nluaX_next(ls);\nsubexpr(ls,v,8);\nluaK_prefix(ls->fs,uop,v);\n}\nelse simpleexp(ls,v);\nop=getbinopr(ls->t.token);\nwhile(op!=OPR_NOBINOPR&&priority[op].left>limit){\nexpdesc v2;\nBinOpr nextop;\nluaX_next(ls);\nluaK_infix(ls->fs,op,v);\nnextop=subexpr(ls,&v2,priority[op].right);\nluaK_posfix(ls->fs,op,v,&v2);\nop=nextop;\n}\nleavelevel(ls);\nreturn op;\n}\nstatic void expr(LexState*ls,expdesc*v){\nsubexpr(ls,v,0);\n}\nstatic int block_follow(int token){\nswitch(token){\ncase TK_ELSE:case TK_ELSEIF:case TK_END:\ncase TK_UNTIL:case TK_EOS:\nreturn 1;\ndefault:return 0;\n}\n}\nstatic void block(LexState*ls){\nFuncState*fs=ls->fs;\nBlockCnt bl;\nenterblock(fs,&bl,0);\nchunk(ls);\nleaveblock(fs);\n}\nstruct LHS_assign{\nstruct LHS_assign*prev;\nexpdesc v;\n};\nstatic void check_conflict(LexState*ls,struct LHS_assign*lh,expdesc*v){\nFuncState*fs=ls->fs;\nint extra=fs->freereg;\nint conflict=0;\nfor(;lh;lh=lh->prev){\nif(lh->v.k==VINDEXED){\nif(lh->v.u.s.info==v->u.s.info){\nconflict=1;\nlh->v.u.s.info=extra;\n}\nif(lh->v.u.s.aux==v->u.s.info){\nconflict=1;\nlh->v.u.s.aux=extra;\n}\n}\n}\nif(conflict){\nluaK_codeABC(fs,OP_MOVE,fs->freereg,v->u.s.info,0);\nluaK_reserveregs(fs,1);\n}\n}\nstatic void assignment(LexState*ls,struct LHS_assign*lh,int nvars){\nexpdesc e;\ncheck_condition(ls,VLOCAL<=lh->v.k&&lh->v.k<=VINDEXED,\n\"syntax error\");\nif(testnext(ls,',')){\nstruct LHS_assign nv;\nnv.prev=lh;\nprimaryexp(ls,&nv.v);\nif(nv.v.k==VLOCAL)\ncheck_conflict(ls,lh,&nv.v);\nluaY_checklimit(ls->fs,nvars,200-ls->L->nCcalls,\n\"variables in assignment\");\nassignment(ls,&nv,nvars+1);\n}\nelse{\nint nexps;\nchecknext(ls,'=');\nnexps=explist1(ls,&e);\nif(nexps!=nvars){\nadjust_assign(ls,nvars,nexps,&e);\nif(nexps>nvars)\nls->fs->freereg-=nexps-nvars;\n}\nelse{\nluaK_setoneret(ls->fs,&e);\nluaK_storevar(ls->fs,&lh->v,&e);\nreturn;\n}\n}\ninit_exp(&e,VNONRELOC,ls->fs->freereg-1);\nluaK_storevar(ls->fs,&lh->v,&e);\n}\nstatic int cond(LexState*ls){\nexpdesc v;\nexpr(ls,&v);\nif(v.k==VNIL)v.k=VFALSE;\nluaK_goiftrue(ls->fs,&v);\nreturn v.f;\n}\nstatic void breakstat(LexState*ls){\nFuncState*fs=ls->fs;\nBlockCnt*bl=fs->bl;\nint upval=0;\nwhile(bl&&!bl->isbreakable){\nupval|=bl->upval;\nbl=bl->previous;\n}\nif(!bl)\nluaX_syntaxerror(ls,\"no loop to break\");\nif(upval)\nluaK_codeABC(fs,OP_CLOSE,bl->nactvar,0,0);\nluaK_concat(fs,&bl->breaklist,luaK_jump(fs));\n}\nstatic void whilestat(LexState*ls,int line){\nFuncState*fs=ls->fs;\nint whileinit;\nint condexit;\nBlockCnt bl;\nluaX_next(ls);\nwhileinit=luaK_getlabel(fs);\ncondexit=cond(ls);\nenterblock(fs,&bl,1);\nchecknext(ls,TK_DO);\nblock(ls);\nluaK_patchlist(fs,luaK_jump(fs),whileinit);\ncheck_match(ls,TK_END,TK_WHILE,line);\nleaveblock(fs);\nluaK_patchtohere(fs,condexit);\n}\nstatic void repeatstat(LexState*ls,int line){\nint condexit;\nFuncState*fs=ls->fs;\nint repeat_init=luaK_getlabel(fs);\nBlockCnt bl1,bl2;\nenterblock(fs,&bl1,1);\nenterblock(fs,&bl2,0);\nluaX_next(ls);\nchunk(ls);\ncheck_match(ls,TK_UNTIL,TK_REPEAT,line);\ncondexit=cond(ls);\nif(!bl2.upval){\nleaveblock(fs);\nluaK_patchlist(ls->fs,condexit,repeat_init);\n}\nelse{\nbreakstat(ls);\nluaK_patchtohere(ls->fs,condexit);\nleaveblock(fs);\nluaK_patchlist(ls->fs,luaK_jump(fs),repeat_init);\n}\nleaveblock(fs);\n}\nstatic int exp1(LexState*ls){\nexpdesc e;\nint k;\nexpr(ls,&e);\nk=e.k;\nluaK_exp2nextreg(ls->fs,&e);\nreturn k;\n}\nstatic void forbody(LexState*ls,int base,int line,int nvars,int isnum){\nBlockCnt bl;\nFuncState*fs=ls->fs;\nint prep,endfor;\nadjustlocalvars(ls,3);\nchecknext(ls,TK_DO);\nprep=isnum?luaK_codeAsBx(fs,OP_FORPREP,base,(-1)):luaK_jump(fs);\nenterblock(fs,&bl,0);\nadjustlocalvars(ls,nvars);\nluaK_reserveregs(fs,nvars);\nblock(ls);\nleaveblock(fs);\nluaK_patchtohere(fs,prep);\nendfor=(isnum)?luaK_codeAsBx(fs,OP_FORLOOP,base,(-1)):\nluaK_codeABC(fs,OP_TFORLOOP,base,0,nvars);\nluaK_fixline(fs,line);\nluaK_patchlist(fs,(isnum?endfor:luaK_jump(fs)),prep+1);\n}\nstatic void fornum(LexState*ls,TString*varname,int line){\nFuncState*fs=ls->fs;\nint base=fs->freereg;\nnew_localvarliteral(ls,\"(for index)\",0);\nnew_localvarliteral(ls,\"(for limit)\",1);\nnew_localvarliteral(ls,\"(for step)\",2);\nnew_localvar(ls,varname,3);\nchecknext(ls,'=');\nexp1(ls);\nchecknext(ls,',');\nexp1(ls);\nif(testnext(ls,','))\nexp1(ls);\nelse{\nluaK_codeABx(fs,OP_LOADK,fs->freereg,luaK_numberK(fs,1));\nluaK_reserveregs(fs,1);\n}\nforbody(ls,base,line,1,1);\n}\nstatic void forlist(LexState*ls,TString*indexname){\nFuncState*fs=ls->fs;\nexpdesc e;\nint nvars=0;\nint line;\nint base=fs->freereg;\nnew_localvarliteral(ls,\"(for generator)\",nvars++);\nnew_localvarliteral(ls,\"(for state)\",nvars++);\nnew_localvarliteral(ls,\"(for control)\",nvars++);\nnew_localvar(ls,indexname,nvars++);\nwhile(testnext(ls,','))\nnew_localvar(ls,str_checkname(ls),nvars++);\nchecknext(ls,TK_IN);\nline=ls->linenumber;\nadjust_assign(ls,3,explist1(ls,&e),&e);\nluaK_checkstack(fs,3);\nforbody(ls,base,line,nvars-3,0);\n}\nstatic void forstat(LexState*ls,int line){\nFuncState*fs=ls->fs;\nTString*varname;\nBlockCnt bl;\nenterblock(fs,&bl,1);\nluaX_next(ls);\nvarname=str_checkname(ls);\nswitch(ls->t.token){\ncase'=':fornum(ls,varname,line);break;\ncase',':case TK_IN:forlist(ls,varname);break;\ndefault:luaX_syntaxerror(ls,LUA_QL(\"=\")\" or \"LUA_QL(\"in\")\" expected\");\n}\ncheck_match(ls,TK_END,TK_FOR,line);\nleaveblock(fs);\n}\nstatic int test_then_block(LexState*ls){\nint condexit;\nluaX_next(ls);\ncondexit=cond(ls);\nchecknext(ls,TK_THEN);\nblock(ls);\nreturn condexit;\n}\nstatic void ifstat(LexState*ls,int line){\nFuncState*fs=ls->fs;\nint flist;\nint escapelist=(-1);\nflist=test_then_block(ls);\nwhile(ls->t.token==TK_ELSEIF){\nluaK_concat(fs,&escapelist,luaK_jump(fs));\nluaK_patchtohere(fs,flist);\nflist=test_then_block(ls);\n}\nif(ls->t.token==TK_ELSE){\nluaK_concat(fs,&escapelist,luaK_jump(fs));\nluaK_patchtohere(fs,flist);\nluaX_next(ls);\nblock(ls);\n}\nelse\nluaK_concat(fs,&escapelist,flist);\nluaK_patchtohere(fs,escapelist);\ncheck_match(ls,TK_END,TK_IF,line);\n}\nstatic void localfunc(LexState*ls){\nexpdesc v,b;\nFuncState*fs=ls->fs;\nnew_localvar(ls,str_checkname(ls),0);\ninit_exp(&v,VLOCAL,fs->freereg);\nluaK_reserveregs(fs,1);\nadjustlocalvars(ls,1);\nbody(ls,&b,0,ls->linenumber);\nluaK_storevar(fs,&v,&b);\ngetlocvar(fs,fs->nactvar-1).startpc=fs->pc;\n}\nstatic void localstat(LexState*ls){\nint nvars=0;\nint nexps;\nexpdesc e;\ndo{\nnew_localvar(ls,str_checkname(ls),nvars++);\n}while(testnext(ls,','));\nif(testnext(ls,'='))\nnexps=explist1(ls,&e);\nelse{\ne.k=VVOID;\nnexps=0;\n}\nadjust_assign(ls,nvars,nexps,&e);\nadjustlocalvars(ls,nvars);\n}\nstatic int funcname(LexState*ls,expdesc*v){\nint needself=0;\nsinglevar(ls,v);\nwhile(ls->t.token=='.')\nfield(ls,v);\nif(ls->t.token==':'){\nneedself=1;\nfield(ls,v);\n}\nreturn needself;\n}\nstatic void funcstat(LexState*ls,int line){\nint needself;\nexpdesc v,b;\nluaX_next(ls);\nneedself=funcname(ls,&v);\nbody(ls,&b,needself,line);\nluaK_storevar(ls->fs,&v,&b);\nluaK_fixline(ls->fs,line);\n}\nstatic void exprstat(LexState*ls){\nFuncState*fs=ls->fs;\nstruct LHS_assign v;\nprimaryexp(ls,&v.v);\nif(v.v.k==VCALL)\nSETARG_C(getcode(fs,&v.v),1);\nelse{\nv.prev=NULL;\nassignment(ls,&v,1);\n}\n}\nstatic void retstat(LexState*ls){\nFuncState*fs=ls->fs;\nexpdesc e;\nint first,nret;\nluaX_next(ls);\nif(block_follow(ls->t.token)||ls->t.token==';')\nfirst=nret=0;\nelse{\nnret=explist1(ls,&e);\nif(hasmultret(e.k)){\nluaK_setmultret(fs,&e);\nif(e.k==VCALL&&nret==1){\nSET_OPCODE(getcode(fs,&e),OP_TAILCALL);\n}\nfirst=fs->nactvar;\nnret=(-1);\n}\nelse{\nif(nret==1)\nfirst=luaK_exp2anyreg(fs,&e);\nelse{\nluaK_exp2nextreg(fs,&e);\nfirst=fs->nactvar;\n}\n}\n}\nluaK_ret(fs,first,nret);\n}\nstatic int statement(LexState*ls){\nint line=ls->linenumber;\nswitch(ls->t.token){\ncase TK_IF:{\nifstat(ls,line);\nreturn 0;\n}\ncase TK_WHILE:{\nwhilestat(ls,line);\nreturn 0;\n}\ncase TK_DO:{\nluaX_next(ls);\nblock(ls);\ncheck_match(ls,TK_END,TK_DO,line);\nreturn 0;\n}\ncase TK_FOR:{\nforstat(ls,line);\nreturn 0;\n}\ncase TK_REPEAT:{\nrepeatstat(ls,line);\nreturn 0;\n}\ncase TK_FUNCTION:{\nfuncstat(ls,line);\nreturn 0;\n}\ncase TK_LOCAL:{\nluaX_next(ls);\nif(testnext(ls,TK_FUNCTION))\nlocalfunc(ls);\nelse\nlocalstat(ls);\nreturn 0;\n}\ncase TK_RETURN:{\nretstat(ls);\nreturn 1;\n}\ncase TK_BREAK:{\nluaX_next(ls);\nbreakstat(ls);\nreturn 1;\n}\ndefault:{\nexprstat(ls);\nreturn 0;\n}\n}\n}\nstatic void chunk(LexState*ls){\nint islast=0;\nenterlevel(ls);\nwhile(!islast&&!block_follow(ls->t.token)){\nislast=statement(ls);\ntestnext(ls,';');\nls->fs->freereg=ls->fs->nactvar;\n}\nleavelevel(ls);\n}\nstatic const TValue*luaV_tonumber(const TValue*obj,TValue*n){\nlua_Number num;\nif(ttisnumber(obj))return obj;\nif(ttisstring(obj)&&luaO_str2d(svalue(obj),&num)){\nsetnvalue(n,num);\nreturn n;\n}\nelse\nreturn NULL;\n}\nstatic int luaV_tostring(lua_State*L,StkId obj){\nif(!ttisnumber(obj))\nreturn 0;\nelse{\nchar s[32];\nlua_Number n=nvalue(obj);\nlua_number2str(s,n);\nsetsvalue(L,obj,luaS_new(L,s));\nreturn 1;\n}\n}\nstatic void callTMres(lua_State*L,StkId res,const TValue*f,\nconst TValue*p1,const TValue*p2){\nptrdiff_t result=savestack(L,res);\nsetobj(L,L->top,f);\nsetobj(L,L->top+1,p1);\nsetobj(L,L->top+2,p2);\nluaD_checkstack(L,3);\nL->top+=3;\nluaD_call(L,L->top-3,1);\nres=restorestack(L,result);\nL->top--;\nsetobj(L,res,L->top);\n}\nstatic void callTM(lua_State*L,const TValue*f,const TValue*p1,\nconst TValue*p2,const TValue*p3){\nsetobj(L,L->top,f);\nsetobj(L,L->top+1,p1);\nsetobj(L,L->top+2,p2);\nsetobj(L,L->top+3,p3);\nluaD_checkstack(L,4);\nL->top+=4;\nluaD_call(L,L->top-4,0);\n}\nstatic void luaV_gettable(lua_State*L,const TValue*t,TValue*key,StkId val){\nint loop;\nfor(loop=0;loop<100;loop++){\nconst TValue*tm;\nif(ttistable(t)){\nTable*h=hvalue(t);\nconst TValue*res=luaH_get(h,key);\nif(!ttisnil(res)||\n(tm=fasttm(L,h->metatable,TM_INDEX))==NULL){\nsetobj(L,val,res);\nreturn;\n}\n}\nelse if(ttisnil(tm=luaT_gettmbyobj(L,t,TM_INDEX)))\nluaG_typeerror(L,t,\"index\");\nif(ttisfunction(tm)){\ncallTMres(L,val,tm,t,key);\nreturn;\n}\nt=tm;\n}\nluaG_runerror(L,\"loop in gettable\");\n}\nstatic void luaV_settable(lua_State*L,const TValue*t,TValue*key,StkId val){\nint loop;\nTValue temp;\nfor(loop=0;loop<100;loop++){\nconst TValue*tm;\nif(ttistable(t)){\nTable*h=hvalue(t);\nTValue*oldval=luaH_set(L,h,key);\nif(!ttisnil(oldval)||\n(tm=fasttm(L,h->metatable,TM_NEWINDEX))==NULL){\nsetobj(L,oldval,val);\nh->flags=0;\nluaC_barriert(L,h,val);\nreturn;\n}\n}\nelse if(ttisnil(tm=luaT_gettmbyobj(L,t,TM_NEWINDEX)))\nluaG_typeerror(L,t,\"index\");\nif(ttisfunction(tm)){\ncallTM(L,tm,t,key,val);\nreturn;\n}\nsetobj(L,&temp,tm);\nt=&temp;\n}\nluaG_runerror(L,\"loop in settable\");\n}\nstatic int call_binTM(lua_State*L,const TValue*p1,const TValue*p2,\nStkId res,TMS event){\nconst TValue*tm=luaT_gettmbyobj(L,p1,event);\nif(ttisnil(tm))\ntm=luaT_gettmbyobj(L,p2,event);\nif(ttisnil(tm))return 0;\ncallTMres(L,res,tm,p1,p2);\nreturn 1;\n}\nstatic const TValue*get_compTM(lua_State*L,Table*mt1,Table*mt2,\nTMS event){\nconst TValue*tm1=fasttm(L,mt1,event);\nconst TValue*tm2;\nif(tm1==NULL)return NULL;\nif(mt1==mt2)return tm1;\ntm2=fasttm(L,mt2,event);\nif(tm2==NULL)return NULL;\nif(luaO_rawequalObj(tm1,tm2))\nreturn tm1;\nreturn NULL;\n}\nstatic int call_orderTM(lua_State*L,const TValue*p1,const TValue*p2,\nTMS event){\nconst TValue*tm1=luaT_gettmbyobj(L,p1,event);\nconst TValue*tm2;\nif(ttisnil(tm1))return-1;\ntm2=luaT_gettmbyobj(L,p2,event);\nif(!luaO_rawequalObj(tm1,tm2))\nreturn-1;\ncallTMres(L,L->top,tm1,p1,p2);\nreturn!l_isfalse(L->top);\n}\nstatic int l_strcmp(const TString*ls,const TString*rs){\nconst char*l=getstr(ls);\nsize_t ll=ls->tsv.len;\nconst char*r=getstr(rs);\nsize_t lr=rs->tsv.len;\nfor(;;){\nint temp=strcoll(l,r);\nif(temp!=0)return temp;\nelse{\nsize_t len=strlen(l);\nif(len==lr)\nreturn(len==ll)?0:1;\nelse if(len==ll)\nreturn-1;\nlen++;\nl+=len;ll-=len;r+=len;lr-=len;\n}\n}\n}\nstatic int luaV_lessthan(lua_State*L,const TValue*l,const TValue*r){\nint res;\nif(ttype(l)!=ttype(r))\nreturn luaG_ordererror(L,l,r);\nelse if(ttisnumber(l))\nreturn luai_numlt(nvalue(l),nvalue(r));\nelse if(ttisstring(l))\nreturn l_strcmp(rawtsvalue(l),rawtsvalue(r))<0;\nelse if((res=call_orderTM(L,l,r,TM_LT))!=-1)\nreturn res;\nreturn luaG_ordererror(L,l,r);\n}\nstatic int lessequal(lua_State*L,const TValue*l,const TValue*r){\nint res;\nif(ttype(l)!=ttype(r))\nreturn luaG_ordererror(L,l,r);\nelse if(ttisnumber(l))\nreturn luai_numle(nvalue(l),nvalue(r));\nelse if(ttisstring(l))\nreturn l_strcmp(rawtsvalue(l),rawtsvalue(r))<=0;\nelse if((res=call_orderTM(L,l,r,TM_LE))!=-1)\nreturn res;\nelse if((res=call_orderTM(L,r,l,TM_LT))!=-1)\nreturn!res;\nreturn luaG_ordererror(L,l,r);\n}\nstatic int luaV_equalval(lua_State*L,const TValue*t1,const TValue*t2){\nconst TValue*tm;\nswitch(ttype(t1)){\ncase 0:return 1;\ncase 3:return luai_numeq(nvalue(t1),nvalue(t2));\ncase 1:return bvalue(t1)==bvalue(t2);\ncase 2:return pvalue(t1)==pvalue(t2);\ncase 7:{\nif(uvalue(t1)==uvalue(t2))return 1;\ntm=get_compTM(L,uvalue(t1)->metatable,uvalue(t2)->metatable,\nTM_EQ);\nbreak;\n}\ncase 5:{\nif(hvalue(t1)==hvalue(t2))return 1;\ntm=get_compTM(L,hvalue(t1)->metatable,hvalue(t2)->metatable,TM_EQ);\nbreak;\n}\ndefault:return gcvalue(t1)==gcvalue(t2);\n}\nif(tm==NULL)return 0;\ncallTMres(L,L->top,tm,t1,t2);\nreturn!l_isfalse(L->top);\n}\nstatic void luaV_concat(lua_State*L,int total,int last){\ndo{\nStkId top=L->base+last+1;\nint n=2;\nif(!(ttisstring(top-2)||ttisnumber(top-2))||!tostring(L,top-1)){\nif(!call_binTM(L,top-2,top-1,top-2,TM_CONCAT))\nluaG_concaterror(L,top-2,top-1);\n}else if(tsvalue(top-1)->len==0)\n(void)tostring(L,top-2);\nelse{\nsize_t tl=tsvalue(top-1)->len;\nchar*buffer;\nint i;\nfor(n=1;n<total&&tostring(L,top-n-1);n++){\nsize_t l=tsvalue(top-n-1)->len;\nif(l>=((size_t)(~(size_t)0)-2)-tl)luaG_runerror(L,\"string length overflow\");\ntl+=l;\n}\nbuffer=luaZ_openspace(L,&G(L)->buff,tl);\ntl=0;\nfor(i=n;i>0;i--){\nsize_t l=tsvalue(top-i)->len;\nmemcpy(buffer+tl,svalue(top-i),l);\ntl+=l;\n}\nsetsvalue(L,top-n,luaS_newlstr(L,buffer,tl));\n}\ntotal-=n-1;\nlast-=n-1;\n}while(total>1);\n}\nstatic void Arith(lua_State*L,StkId ra,const TValue*rb,\nconst TValue*rc,TMS op){\nTValue tempb,tempc;\nconst TValue*b,*c;\nif((b=luaV_tonumber(rb,&tempb))!=NULL&&\n(c=luaV_tonumber(rc,&tempc))!=NULL){\nlua_Number nb=nvalue(b),nc=nvalue(c);\nswitch(op){\ncase TM_ADD:setnvalue(ra,luai_numadd(nb,nc));break;\ncase TM_SUB:setnvalue(ra,luai_numsub(nb,nc));break;\ncase TM_MUL:setnvalue(ra,luai_nummul(nb,nc));break;\ncase TM_DIV:setnvalue(ra,luai_numdiv(nb,nc));break;\ncase TM_MOD:setnvalue(ra,luai_nummod(nb,nc));break;\ncase TM_POW:setnvalue(ra,luai_numpow(nb,nc));break;\ncase TM_UNM:setnvalue(ra,luai_numunm(nb));break;\ndefault:break;\n}\n}\nelse if(!call_binTM(L,rb,rc,ra,op))\nluaG_aritherror(L,rb,rc);\n}\n#define runtime_check(L,c){if(!(c))break;}\n#define RA(i)(base+GETARG_A(i))\n#define RB(i)check_exp(getBMode(GET_OPCODE(i))==OpArgR,base+GETARG_B(i))\n#define RKB(i)check_exp(getBMode(GET_OPCODE(i))==OpArgK,ISK(GETARG_B(i))?k+INDEXK(GETARG_B(i)):base+GETARG_B(i))\n#define RKC(i)check_exp(getCMode(GET_OPCODE(i))==OpArgK,ISK(GETARG_C(i))?k+INDEXK(GETARG_C(i)):base+GETARG_C(i))\n#define KBx(i)check_exp(getBMode(GET_OPCODE(i))==OpArgK,k+GETARG_Bx(i))\n#define dojump(L,pc,i){(pc)+=(i);}\n#define Protect(x){L->savedpc=pc;{x;};base=L->base;}\n#define arith_op(op,tm){TValue*rb=RKB(i);TValue*rc=RKC(i);if(ttisnumber(rb)&&ttisnumber(rc)){lua_Number nb=nvalue(rb),nc=nvalue(rc);setnvalue(ra,op(nb,nc));}else Protect(Arith(L,ra,rb,rc,tm));}\nstatic void luaV_execute(lua_State*L,int nexeccalls){\nLClosure*cl;\nStkId base;\nTValue*k;\nconst Instruction*pc;\nreentry:\npc=L->savedpc;\ncl=&clvalue(L->ci->func)->l;\nbase=L->base;\nk=cl->p->k;\nfor(;;){\nconst Instruction i=*pc++;\nStkId ra;\nra=RA(i);\nswitch(GET_OPCODE(i)){\ncase OP_MOVE:{\nsetobj(L,ra,RB(i));\ncontinue;\n}\ncase OP_LOADK:{\nsetobj(L,ra,KBx(i));\ncontinue;\n}\ncase OP_LOADBOOL:{\nsetbvalue(ra,GETARG_B(i));\nif(GETARG_C(i))pc++;\ncontinue;\n}\ncase OP_LOADNIL:{\nTValue*rb=RB(i);\ndo{\nsetnilvalue(rb--);\n}while(rb>=ra);\ncontinue;\n}\ncase OP_GETUPVAL:{\nint b=GETARG_B(i);\nsetobj(L,ra,cl->upvals[b]->v);\ncontinue;\n}\ncase OP_GETGLOBAL:{\nTValue g;\nTValue*rb=KBx(i);\nsethvalue(L,&g,cl->env);\nProtect(luaV_gettable(L,&g,rb,ra));\ncontinue;\n}\ncase OP_GETTABLE:{\nProtect(luaV_gettable(L,RB(i),RKC(i),ra));\ncontinue;\n}\ncase OP_SETGLOBAL:{\nTValue g;\nsethvalue(L,&g,cl->env);\nProtect(luaV_settable(L,&g,KBx(i),ra));\ncontinue;\n}\ncase OP_SETUPVAL:{\nUpVal*uv=cl->upvals[GETARG_B(i)];\nsetobj(L,uv->v,ra);\nluaC_barrier(L,uv,ra);\ncontinue;\n}\ncase OP_SETTABLE:{\nProtect(luaV_settable(L,ra,RKB(i),RKC(i)));\ncontinue;\n}\ncase OP_NEWTABLE:{\nint b=GETARG_B(i);\nint c=GETARG_C(i);\nsethvalue(L,ra,luaH_new(L,luaO_fb2int(b),luaO_fb2int(c)));\nProtect(luaC_checkGC(L));\ncontinue;\n}\ncase OP_SELF:{\nStkId rb=RB(i);\nsetobj(L,ra+1,rb);\nProtect(luaV_gettable(L,rb,RKC(i),ra));\ncontinue;\n}\ncase OP_ADD:{\narith_op(luai_numadd,TM_ADD);\ncontinue;\n}\ncase OP_SUB:{\narith_op(luai_numsub,TM_SUB);\ncontinue;\n}\ncase OP_MUL:{\narith_op(luai_nummul,TM_MUL);\ncontinue;\n}\ncase OP_DIV:{\narith_op(luai_numdiv,TM_DIV);\ncontinue;\n}\ncase OP_MOD:{\narith_op(luai_nummod,TM_MOD);\ncontinue;\n}\ncase OP_POW:{\narith_op(luai_numpow,TM_POW);\ncontinue;\n}\ncase OP_UNM:{\nTValue*rb=RB(i);\nif(ttisnumber(rb)){\nlua_Number nb=nvalue(rb);\nsetnvalue(ra,luai_numunm(nb));\n}\nelse{\nProtect(Arith(L,ra,rb,rb,TM_UNM));\n}\ncontinue;\n}\ncase OP_NOT:{\nint res=l_isfalse(RB(i));\nsetbvalue(ra,res);\ncontinue;\n}\ncase OP_LEN:{\nconst TValue*rb=RB(i);\nswitch(ttype(rb)){\ncase 5:{\nsetnvalue(ra,cast_num(luaH_getn(hvalue(rb))));\nbreak;\n}\ncase 4:{\nsetnvalue(ra,cast_num(tsvalue(rb)->len));\nbreak;\n}\ndefault:{\nProtect(\nif(!call_binTM(L,rb,(&luaO_nilobject_),ra,TM_LEN))\nluaG_typeerror(L,rb,\"get length of\");\n)\n}\n}\ncontinue;\n}\ncase OP_CONCAT:{\nint b=GETARG_B(i);\nint c=GETARG_C(i);\nProtect(luaV_concat(L,c-b+1,c);luaC_checkGC(L));\nsetobj(L,RA(i),base+b);\ncontinue;\n}\ncase OP_JMP:{\ndojump(L,pc,GETARG_sBx(i));\ncontinue;\n}\ncase OP_EQ:{\nTValue*rb=RKB(i);\nTValue*rc=RKC(i);\nProtect(\nif(equalobj(L,rb,rc)==GETARG_A(i))\ndojump(L,pc,GETARG_sBx(*pc));\n)\npc++;\ncontinue;\n}\ncase OP_LT:{\nProtect(\nif(luaV_lessthan(L,RKB(i),RKC(i))==GETARG_A(i))\ndojump(L,pc,GETARG_sBx(*pc));\n)\npc++;\ncontinue;\n}\ncase OP_LE:{\nProtect(\nif(lessequal(L,RKB(i),RKC(i))==GETARG_A(i))\ndojump(L,pc,GETARG_sBx(*pc));\n)\npc++;\ncontinue;\n}\ncase OP_TEST:{\nif(l_isfalse(ra)!=GETARG_C(i))\ndojump(L,pc,GETARG_sBx(*pc));\npc++;\ncontinue;\n}\ncase OP_TESTSET:{\nTValue*rb=RB(i);\nif(l_isfalse(rb)!=GETARG_C(i)){\nsetobj(L,ra,rb);\ndojump(L,pc,GETARG_sBx(*pc));\n}\npc++;\ncontinue;\n}\ncase OP_CALL:{\nint b=GETARG_B(i);\nint nresults=GETARG_C(i)-1;\nif(b!=0)L->top=ra+b;\nL->savedpc=pc;\nswitch(luaD_precall(L,ra,nresults)){\ncase 0:{\nnexeccalls++;\ngoto reentry;\n}\ncase 1:{\nif(nresults>=0)L->top=L->ci->top;\nbase=L->base;\ncontinue;\n}\ndefault:{\nreturn;\n}\n}\n}\ncase OP_TAILCALL:{\nint b=GETARG_B(i);\nif(b!=0)L->top=ra+b;\nL->savedpc=pc;\nswitch(luaD_precall(L,ra,(-1))){\ncase 0:{\nCallInfo*ci=L->ci-1;\nint aux;\nStkId func=ci->func;\nStkId pfunc=(ci+1)->func;\nif(L->openupval)luaF_close(L,ci->base);\nL->base=ci->base=ci->func+((ci+1)->base-pfunc);\nfor(aux=0;pfunc+aux<L->top;aux++)\nsetobj(L,func+aux,pfunc+aux);\nci->top=L->top=func+aux;\nci->savedpc=L->savedpc;\nci->tailcalls++;\nL->ci--;\ngoto reentry;\n}\ncase 1:{\nbase=L->base;\ncontinue;\n}\ndefault:{\nreturn;\n}\n}\n}\ncase OP_RETURN:{\nint b=GETARG_B(i);\nif(b!=0)L->top=ra+b-1;\nif(L->openupval)luaF_close(L,base);\nL->savedpc=pc;\nb=luaD_poscall(L,ra);\nif(--nexeccalls==0)\nreturn;\nelse{\nif(b)L->top=L->ci->top;\ngoto reentry;\n}\n}\ncase OP_FORLOOP:{\nlua_Number step=nvalue(ra+2);\nlua_Number idx=luai_numadd(nvalue(ra),step);\nlua_Number limit=nvalue(ra+1);\nif(luai_numlt(0,step)?luai_numle(idx,limit)\n:luai_numle(limit,idx)){\ndojump(L,pc,GETARG_sBx(i));\nsetnvalue(ra,idx);\nsetnvalue(ra+3,idx);\n}\ncontinue;\n}\ncase OP_FORPREP:{\nconst TValue*init=ra;\nconst TValue*plimit=ra+1;\nconst TValue*pstep=ra+2;\nL->savedpc=pc;\nif(!tonumber(init,ra))\nluaG_runerror(L,LUA_QL(\"for\")\" initial value must be a number\");\nelse if(!tonumber(plimit,ra+1))\nluaG_runerror(L,LUA_QL(\"for\")\" limit must be a number\");\nelse if(!tonumber(pstep,ra+2))\nluaG_runerror(L,LUA_QL(\"for\")\" step must be a number\");\nsetnvalue(ra,luai_numsub(nvalue(ra),nvalue(pstep)));\ndojump(L,pc,GETARG_sBx(i));\ncontinue;\n}\ncase OP_TFORLOOP:{\nStkId cb=ra+3;\nsetobj(L,cb+2,ra+2);\nsetobj(L,cb+1,ra+1);\nsetobj(L,cb,ra);\nL->top=cb+3;\nProtect(luaD_call(L,cb,GETARG_C(i)));\nL->top=L->ci->top;\ncb=RA(i)+3;\nif(!ttisnil(cb)){\nsetobj(L,cb-1,cb);\ndojump(L,pc,GETARG_sBx(*pc));\n}\npc++;\ncontinue;\n}\ncase OP_SETLIST:{\nint n=GETARG_B(i);\nint c=GETARG_C(i);\nint last;\nTable*h;\nif(n==0){\nn=cast_int(L->top-ra)-1;\nL->top=L->ci->top;\n}\nif(c==0)c=cast_int(*pc++);\nruntime_check(L,ttistable(ra));\nh=hvalue(ra);\nlast=((c-1)*50)+n;\nif(last>h->sizearray)\nluaH_resizearray(L,h,last);\nfor(;n>0;n--){\nTValue*val=ra+n;\nsetobj(L,luaH_setnum(L,h,last--),val);\nluaC_barriert(L,h,val);\n}\ncontinue;\n}\ncase OP_CLOSE:{\nluaF_close(L,ra);\ncontinue;\n}\ncase OP_CLOSURE:{\nProto*p;\nClosure*ncl;\nint nup,j;\np=cl->p->p[GETARG_Bx(i)];\nnup=p->nups;\nncl=luaF_newLclosure(L,nup,cl->env);\nncl->l.p=p;\nfor(j=0;j<nup;j++,pc++){\nif(GET_OPCODE(*pc)==OP_GETUPVAL)\nncl->l.upvals[j]=cl->upvals[GETARG_B(*pc)];\nelse{\nncl->l.upvals[j]=luaF_findupval(L,base+GETARG_B(*pc));\n}\n}\nsetclvalue(L,ra,ncl);\nProtect(luaC_checkGC(L));\ncontinue;\n}\ncase OP_VARARG:{\nint b=GETARG_B(i)-1;\nint j;\nCallInfo*ci=L->ci;\nint n=cast_int(ci->base-ci->func)-cl->p->numparams-1;\nif(b==(-1)){\nProtect(luaD_checkstack(L,n));\nra=RA(i);\nb=n;\nL->top=ra+n;\n}\nfor(j=0;j<b;j++){\nif(j<n){\nsetobj(L,ra+j,ci->base-n+j);\n}\nelse{\nsetnilvalue(ra+j);\n}\n}\ncontinue;\n}\n}\n}\n}\n#define api_checknelems(L,n)luai_apicheck(L,(n)<=(L->top-L->base))\n#define api_checkvalidindex(L,i)luai_apicheck(L,(i)!=(&luaO_nilobject_))\n#define api_incr_top(L){luai_apicheck(L,L->top<L->ci->top);L->top++;}\nstatic TValue*index2adr(lua_State*L,int idx){\nif(idx>0){\nTValue*o=L->base+(idx-1);\nluai_apicheck(L,idx<=L->ci->top-L->base);\nif(o>=L->top)return cast(TValue*,(&luaO_nilobject_));\nelse return o;\n}\nelse if(idx>(-10000)){\nluai_apicheck(L,idx!=0&&-idx<=L->top-L->base);\nreturn L->top+idx;\n}\nelse switch(idx){\ncase(-10000):return registry(L);\ncase(-10001):{\nClosure*func=curr_func(L);\nsethvalue(L,&L->env,func->c.env);\nreturn&L->env;\n}\ncase(-10002):return gt(L);\ndefault:{\nClosure*func=curr_func(L);\nidx=(-10002)-idx;\nreturn(idx<=func->c.nupvalues)\n?&func->c.upvalue[idx-1]\n:cast(TValue*,(&luaO_nilobject_));\n}\n}\n}\nstatic Table*getcurrenv(lua_State*L){\nif(L->ci==L->base_ci)\nreturn hvalue(gt(L));\nelse{\nClosure*func=curr_func(L);\nreturn func->c.env;\n}\n}\nstatic int lua_checkstack(lua_State*L,int size){\nint res=1;\nif(size>8000||(L->top-L->base+size)>8000)\nres=0;\nelse if(size>0){\nluaD_checkstack(L,size);\nif(L->ci->top<L->top+size)\nL->ci->top=L->top+size;\n}\nreturn res;\n}\nstatic lua_CFunction lua_atpanic(lua_State*L,lua_CFunction panicf){\nlua_CFunction old;\nold=G(L)->panic;\nG(L)->panic=panicf;\nreturn old;\n}\nstatic int lua_gettop(lua_State*L){\nreturn cast_int(L->top-L->base);\n}\nstatic void lua_settop(lua_State*L,int idx){\nif(idx>=0){\nluai_apicheck(L,idx<=L->stack_last-L->base);\nwhile(L->top<L->base+idx)\nsetnilvalue(L->top++);\nL->top=L->base+idx;\n}\nelse{\nluai_apicheck(L,-(idx+1)<=(L->top-L->base));\nL->top+=idx+1;\n}\n}\nstatic void lua_remove(lua_State*L,int idx){\nStkId p;\np=index2adr(L,idx);\napi_checkvalidindex(L,p);\nwhile(++p<L->top)setobj(L,p-1,p);\nL->top--;\n}\nstatic void lua_insert(lua_State*L,int idx){\nStkId p;\nStkId q;\np=index2adr(L,idx);\napi_checkvalidindex(L,p);\nfor(q=L->top;q>p;q--)setobj(L,q,q-1);\nsetobj(L,p,L->top);\n}\nstatic void lua_replace(lua_State*L,int idx){\nStkId o;\nif(idx==(-10001)&&L->ci==L->base_ci)\nluaG_runerror(L,\"no calling environment\");\napi_checknelems(L,1);\no=index2adr(L,idx);\napi_checkvalidindex(L,o);\nif(idx==(-10001)){\nClosure*func=curr_func(L);\nluai_apicheck(L,ttistable(L->top-1));\nfunc->c.env=hvalue(L->top-1);\nluaC_barrier(L,func,L->top-1);\n}\nelse{\nsetobj(L,o,L->top-1);\nif(idx<(-10002))\nluaC_barrier(L,curr_func(L),L->top-1);\n}\nL->top--;\n}\nstatic void lua_pushvalue(lua_State*L,int idx){\nsetobj(L,L->top,index2adr(L,idx));\napi_incr_top(L);\n}\nstatic int lua_type(lua_State*L,int idx){\nStkId o=index2adr(L,idx);\nreturn(o==(&luaO_nilobject_))?(-1):ttype(o);\n}\nstatic const char*lua_typename(lua_State*L,int t){\nUNUSED(L);\nreturn(t==(-1))?\"no value\":luaT_typenames[t];\n}\nstatic int lua_iscfunction(lua_State*L,int idx){\nStkId o=index2adr(L,idx);\nreturn iscfunction(o);\n}\nstatic int lua_isnumber(lua_State*L,int idx){\nTValue n;\nconst TValue*o=index2adr(L,idx);\nreturn tonumber(o,&n);\n}\nstatic int lua_isstring(lua_State*L,int idx){\nint t=lua_type(L,idx);\nreturn(t==4||t==3);\n}\nstatic int lua_rawequal(lua_State*L,int index1,int index2){\nStkId o1=index2adr(L,index1);\nStkId o2=index2adr(L,index2);\nreturn(o1==(&luaO_nilobject_)||o2==(&luaO_nilobject_))?0\n:luaO_rawequalObj(o1,o2);\n}\nstatic int lua_lessthan(lua_State*L,int index1,int index2){\nStkId o1,o2;\nint i;\no1=index2adr(L,index1);\no2=index2adr(L,index2);\ni=(o1==(&luaO_nilobject_)||o2==(&luaO_nilobject_))?0\n:luaV_lessthan(L,o1,o2);\nreturn i;\n}\nstatic lua_Number lua_tonumber(lua_State*L,int idx){\nTValue n;\nconst TValue*o=index2adr(L,idx);\nif(tonumber(o,&n))\nreturn nvalue(o);\nelse\nreturn 0;\n}\nstatic lua_Integer lua_tointeger(lua_State*L,int idx){\nTValue n;\nconst TValue*o=index2adr(L,idx);\nif(tonumber(o,&n)){\nlua_Integer res;\nlua_Number num=nvalue(o);\nlua_number2integer(res,num);\nreturn res;\n}\nelse\nreturn 0;\n}\nstatic int lua_toboolean(lua_State*L,int idx){\nconst TValue*o=index2adr(L,idx);\nreturn!l_isfalse(o);\n}\nstatic const char*lua_tolstring(lua_State*L,int idx,size_t*len){\nStkId o=index2adr(L,idx);\nif(!ttisstring(o)){\nif(!luaV_tostring(L,o)){\nif(len!=NULL)*len=0;\nreturn NULL;\n}\nluaC_checkGC(L);\no=index2adr(L,idx);\n}\nif(len!=NULL)*len=tsvalue(o)->len;\nreturn svalue(o);\n}\nstatic size_t lua_objlen(lua_State*L,int idx){\nStkId o=index2adr(L,idx);\nswitch(ttype(o)){\ncase 4:return tsvalue(o)->len;\ncase 7:return uvalue(o)->len;\ncase 5:return luaH_getn(hvalue(o));\ncase 3:{\nsize_t l;\nl=(luaV_tostring(L,o)?tsvalue(o)->len:0);\nreturn l;\n}\ndefault:return 0;\n}\n}\nstatic lua_CFunction lua_tocfunction(lua_State*L,int idx){\nStkId o=index2adr(L,idx);\nreturn(!iscfunction(o))?NULL:clvalue(o)->c.f;\n}\nstatic void*lua_touserdata(lua_State*L,int idx){\nStkId o=index2adr(L,idx);\nswitch(ttype(o)){\ncase 7:return(rawuvalue(o)+1);\ncase 2:return pvalue(o);\ndefault:return NULL;\n}\n}\nstatic void lua_pushnil(lua_State*L){\nsetnilvalue(L->top);\napi_incr_top(L);\n}\nstatic void lua_pushnumber(lua_State*L,lua_Number n){\nsetnvalue(L->top,n);\napi_incr_top(L);\n}\nstatic void lua_pushinteger(lua_State*L,lua_Integer n){\nsetnvalue(L->top,cast_num(n));\napi_incr_top(L);\n}\nstatic void lua_pushlstring(lua_State*L,const char*s,size_t len){\nluaC_checkGC(L);\nsetsvalue(L,L->top,luaS_newlstr(L,s,len));\napi_incr_top(L);\n}\nstatic void lua_pushstring(lua_State*L,const char*s){\nif(s==NULL)\nlua_pushnil(L);\nelse\nlua_pushlstring(L,s,strlen(s));\n}\nstatic const char*lua_pushvfstring(lua_State*L,const char*fmt,\nva_list argp){\nconst char*ret;\nluaC_checkGC(L);\nret=luaO_pushvfstring(L,fmt,argp);\nreturn ret;\n}\nstatic const char*lua_pushfstring(lua_State*L,const char*fmt,...){\nconst char*ret;\nva_list argp;\nluaC_checkGC(L);\nva_start(argp,fmt);\nret=luaO_pushvfstring(L,fmt,argp);\nva_end(argp);\nreturn ret;\n}\nstatic void lua_pushcclosure(lua_State*L,lua_CFunction fn,int n){\nClosure*cl;\nluaC_checkGC(L);\napi_checknelems(L,n);\ncl=luaF_newCclosure(L,n,getcurrenv(L));\ncl->c.f=fn;\nL->top-=n;\nwhile(n--)\nsetobj(L,&cl->c.upvalue[n],L->top+n);\nsetclvalue(L,L->top,cl);\napi_incr_top(L);\n}\nstatic void lua_pushboolean(lua_State*L,int b){\nsetbvalue(L->top,(b!=0));\napi_incr_top(L);\n}\nstatic int lua_pushthread(lua_State*L){\nsetthvalue(L,L->top,L);\napi_incr_top(L);\nreturn(G(L)->mainthread==L);\n}\nstatic void lua_gettable(lua_State*L,int idx){\nStkId t;\nt=index2adr(L,idx);\napi_checkvalidindex(L,t);\nluaV_gettable(L,t,L->top-1,L->top-1);\n}\nstatic void lua_getfield(lua_State*L,int idx,const char*k){\nStkId t;\nTValue key;\nt=index2adr(L,idx);\napi_checkvalidindex(L,t);\nsetsvalue(L,&key,luaS_new(L,k));\nluaV_gettable(L,t,&key,L->top);\napi_incr_top(L);\n}\nstatic void lua_rawget(lua_State*L,int idx){\nStkId t;\nt=index2adr(L,idx);\nluai_apicheck(L,ttistable(t));\nsetobj(L,L->top-1,luaH_get(hvalue(t),L->top-1));\n}\nstatic void lua_rawgeti(lua_State*L,int idx,int n){\nStkId o;\no=index2adr(L,idx);\nluai_apicheck(L,ttistable(o));\nsetobj(L,L->top,luaH_getnum(hvalue(o),n));\napi_incr_top(L);\n}\nstatic void lua_createtable(lua_State*L,int narray,int nrec){\nluaC_checkGC(L);\nsethvalue(L,L->top,luaH_new(L,narray,nrec));\napi_incr_top(L);\n}\nstatic int lua_getmetatable(lua_State*L,int objindex){\nconst TValue*obj;\nTable*mt=NULL;\nint res;\nobj=index2adr(L,objindex);\nswitch(ttype(obj)){\ncase 5:\nmt=hvalue(obj)->metatable;\nbreak;\ncase 7:\nmt=uvalue(obj)->metatable;\nbreak;\ndefault:\nmt=G(L)->mt[ttype(obj)];\nbreak;\n}\nif(mt==NULL)\nres=0;\nelse{\nsethvalue(L,L->top,mt);\napi_incr_top(L);\nres=1;\n}\nreturn res;\n}\nstatic void lua_getfenv(lua_State*L,int idx){\nStkId o;\no=index2adr(L,idx);\napi_checkvalidindex(L,o);\nswitch(ttype(o)){\ncase 6:\nsethvalue(L,L->top,clvalue(o)->c.env);\nbreak;\ncase 7:\nsethvalue(L,L->top,uvalue(o)->env);\nbreak;\ncase 8:\nsetobj(L,L->top,gt(thvalue(o)));\nbreak;\ndefault:\nsetnilvalue(L->top);\nbreak;\n}\napi_incr_top(L);\n}\nstatic void lua_settable(lua_State*L,int idx){\nStkId t;\napi_checknelems(L,2);\nt=index2adr(L,idx);\napi_checkvalidindex(L,t);\nluaV_settable(L,t,L->top-2,L->top-1);\nL->top-=2;\n}\nstatic void lua_setfield(lua_State*L,int idx,const char*k){\nStkId t;\nTValue key;\napi_checknelems(L,1);\nt=index2adr(L,idx);\napi_checkvalidindex(L,t);\nsetsvalue(L,&key,luaS_new(L,k));\nluaV_settable(L,t,&key,L->top-1);\nL->top--;\n}\nstatic void lua_rawset(lua_State*L,int idx){\nStkId t;\napi_checknelems(L,2);\nt=index2adr(L,idx);\nluai_apicheck(L,ttistable(t));\nsetobj(L,luaH_set(L,hvalue(t),L->top-2),L->top-1);\nluaC_barriert(L,hvalue(t),L->top-1);\nL->top-=2;\n}\nstatic void lua_rawseti(lua_State*L,int idx,int n){\nStkId o;\napi_checknelems(L,1);\no=index2adr(L,idx);\nluai_apicheck(L,ttistable(o));\nsetobj(L,luaH_setnum(L,hvalue(o),n),L->top-1);\nluaC_barriert(L,hvalue(o),L->top-1);\nL->top--;\n}\nstatic int lua_setmetatable(lua_State*L,int objindex){\nTValue*obj;\nTable*mt;\napi_checknelems(L,1);\nobj=index2adr(L,objindex);\napi_checkvalidindex(L,obj);\nif(ttisnil(L->top-1))\nmt=NULL;\nelse{\nluai_apicheck(L,ttistable(L->top-1));\nmt=hvalue(L->top-1);\n}\nswitch(ttype(obj)){\ncase 5:{\nhvalue(obj)->metatable=mt;\nif(mt)\nluaC_objbarriert(L,hvalue(obj),mt);\nbreak;\n}\ncase 7:{\nuvalue(obj)->metatable=mt;\nif(mt)\nluaC_objbarrier(L,rawuvalue(obj),mt);\nbreak;\n}\ndefault:{\nG(L)->mt[ttype(obj)]=mt;\nbreak;\n}\n}\nL->top--;\nreturn 1;\n}\nstatic int lua_setfenv(lua_State*L,int idx){\nStkId o;\nint res=1;\napi_checknelems(L,1);\no=index2adr(L,idx);\napi_checkvalidindex(L,o);\nluai_apicheck(L,ttistable(L->top-1));\nswitch(ttype(o)){\ncase 6:\nclvalue(o)->c.env=hvalue(L->top-1);\nbreak;\ncase 7:\nuvalue(o)->env=hvalue(L->top-1);\nbreak;\ncase 8:\nsethvalue(L,gt(thvalue(o)),hvalue(L->top-1));\nbreak;\ndefault:\nres=0;\nbreak;\n}\nif(res)luaC_objbarrier(L,gcvalue(o),hvalue(L->top-1));\nL->top--;\nreturn res;\n}\n#define adjustresults(L,nres){if(nres==(-1)&&L->top>=L->ci->top)L->ci->top=L->top;}\n#define checkresults(L,na,nr)luai_apicheck(L,(nr)==(-1)||(L->ci->top-L->top>=(nr)-(na)))\nstatic void lua_call(lua_State*L,int nargs,int nresults){\nStkId func;\napi_checknelems(L,nargs+1);\ncheckresults(L,nargs,nresults);\nfunc=L->top-(nargs+1);\nluaD_call(L,func,nresults);\nadjustresults(L,nresults);\n}\nstruct CallS{\nStkId func;\nint nresults;\n};\nstatic void f_call(lua_State*L,void*ud){\nstruct CallS*c=cast(struct CallS*,ud);\nluaD_call(L,c->func,c->nresults);\n}\nstatic int lua_pcall(lua_State*L,int nargs,int nresults,int errfunc){\nstruct CallS c;\nint status;\nptrdiff_t func;\napi_checknelems(L,nargs+1);\ncheckresults(L,nargs,nresults);\nif(errfunc==0)\nfunc=0;\nelse{\nStkId o=index2adr(L,errfunc);\napi_checkvalidindex(L,o);\nfunc=savestack(L,o);\n}\nc.func=L->top-(nargs+1);\nc.nresults=nresults;\nstatus=luaD_pcall(L,f_call,&c,savestack(L,c.func),func);\nadjustresults(L,nresults);\nreturn status;\n}\nstatic int lua_load(lua_State*L,lua_Reader reader,void*data,\nconst char*chunkname){\nZIO z;\nint status;\nif(!chunkname)chunkname=\"?\";\nluaZ_init(L,&z,reader,data);\nstatus=luaD_protectedparser(L,&z,chunkname);\nreturn status;\n}\nstatic int lua_error(lua_State*L){\napi_checknelems(L,1);\nluaG_errormsg(L);\nreturn 0;\n}\nstatic int lua_next(lua_State*L,int idx){\nStkId t;\nint more;\nt=index2adr(L,idx);\nluai_apicheck(L,ttistable(t));\nmore=luaH_next(L,hvalue(t),L->top-1);\nif(more){\napi_incr_top(L);\n}\nelse\nL->top-=1;\nreturn more;\n}\nstatic void lua_concat(lua_State*L,int n){\napi_checknelems(L,n);\nif(n>=2){\nluaC_checkGC(L);\nluaV_concat(L,n,cast_int(L->top-L->base)-1);\nL->top-=(n-1);\n}\nelse if(n==0){\nsetsvalue(L,L->top,luaS_newlstr(L,\"\",0));\napi_incr_top(L);\n}\n}\nstatic void*lua_newuserdata(lua_State*L,size_t size){\nUdata*u;\nluaC_checkGC(L);\nu=luaS_newudata(L,size,getcurrenv(L));\nsetuvalue(L,L->top,u);\napi_incr_top(L);\nreturn u+1;\n}\n#define luaL_getn(L,i)((int)lua_objlen(L,i))\n#define luaL_setn(L,i,j)((void)0)\ntypedef struct luaL_Reg{\nconst char*name;\nlua_CFunction func;\n}luaL_Reg;\nstatic void luaI_openlib(lua_State*L,const char*libname,\nconst luaL_Reg*l,int nup);\nstatic int luaL_argerror(lua_State*L,int numarg,const char*extramsg);\nstatic const char* luaL_checklstring(lua_State*L,int numArg,\nsize_t*l);\nstatic const char* luaL_optlstring(lua_State*L,int numArg,\nconst char*def,size_t*l);\nstatic lua_Integer luaL_checkinteger(lua_State*L,int numArg);\nstatic lua_Integer luaL_optinteger(lua_State*L,int nArg,\nlua_Integer def);\nstatic int luaL_error(lua_State*L,const char*fmt,...);\nstatic const char* luaL_findtable(lua_State*L,int idx,\nconst char*fname,int szhint);\n#define luaL_argcheck(L,cond,numarg,extramsg)((void)((cond)||luaL_argerror(L,(numarg),(extramsg))))\n#define luaL_checkstring(L,n)(luaL_checklstring(L,(n),NULL))\n#define luaL_optstring(L,n,d)(luaL_optlstring(L,(n),(d),NULL))\n#define luaL_checkint(L,n)((int)luaL_checkinteger(L,(n)))\n#define luaL_optint(L,n,d)((int)luaL_optinteger(L,(n),(d)))\n#define luaL_typename(L,i)lua_typename(L,lua_type(L,(i)))\n#define luaL_getmetatable(L,n)(lua_getfield(L,(-10000),(n)))\n#define luaL_opt(L,f,n,d)(lua_isnoneornil(L,(n))?(d):f(L,(n)))\ntypedef struct luaL_Buffer{\nchar*p;\nint lvl;\nlua_State*L;\nchar buffer[BUFSIZ];\n}luaL_Buffer;\n#define luaL_addchar(B,c)((void)((B)->p<((B)->buffer+BUFSIZ)||luaL_prepbuffer(B)),(*(B)->p++=(char)(c)))\n#define luaL_addsize(B,n)((B)->p+=(n))\nstatic char* luaL_prepbuffer(luaL_Buffer*B);\nstatic int luaL_argerror(lua_State*L,int narg,const char*extramsg){\nlua_Debug ar;\nif(!lua_getstack(L,0,&ar))\nreturn luaL_error(L,\"bad argument #%d (%s)\",narg,extramsg);\nlua_getinfo(L,\"n\",&ar);\nif(strcmp(ar.namewhat,\"method\")==0){\nnarg--;\nif(narg==0)\nreturn luaL_error(L,\"calling \"LUA_QL(\"%s\")\" on bad self (%s)\",\nar.name,extramsg);\n}\nif(ar.name==NULL)\nar.name=\"?\";\nreturn luaL_error(L,\"bad argument #%d to \"LUA_QL(\"%s\")\" (%s)\",\nnarg,ar.name,extramsg);\n}\nstatic int luaL_typerror(lua_State*L,int narg,const char*tname){\nconst char*msg=lua_pushfstring(L,\"%s expected, got %s\",\ntname,luaL_typename(L,narg));\nreturn luaL_argerror(L,narg,msg);\n}\nstatic void tag_error(lua_State*L,int narg,int tag){\nluaL_typerror(L,narg,lua_typename(L,tag));\n}\nstatic void luaL_where(lua_State*L,int level){\nlua_Debug ar;\nif(lua_getstack(L,level,&ar)){\nlua_getinfo(L,\"Sl\",&ar);\nif(ar.currentline>0){\nlua_pushfstring(L,\"%s:%d: \",ar.short_src,ar.currentline);\nreturn;\n}\n}\nlua_pushliteral(L,\"\");\n}\nstatic int luaL_error(lua_State*L,const char*fmt,...){\nva_list argp;\nva_start(argp,fmt);\nluaL_where(L,1);\nlua_pushvfstring(L,fmt,argp);\nva_end(argp);\nlua_concat(L,2);\nreturn lua_error(L);\n}\nstatic int luaL_newmetatable(lua_State*L,const char*tname){\nlua_getfield(L,(-10000),tname);\nif(!lua_isnil(L,-1))\nreturn 0;\nlua_pop(L,1);\nlua_newtable(L);\nlua_pushvalue(L,-1);\nlua_setfield(L,(-10000),tname);\nreturn 1;\n}\nstatic void*luaL_checkudata(lua_State*L,int ud,const char*tname){\nvoid*p=lua_touserdata(L,ud);\nif(p!=NULL){\nif(lua_getmetatable(L,ud)){\nlua_getfield(L,(-10000),tname);\nif(lua_rawequal(L,-1,-2)){\nlua_pop(L,2);\nreturn p;\n}\n}\n}\nluaL_typerror(L,ud,tname);\nreturn NULL;\n}\nstatic void luaL_checkstack(lua_State*L,int space,const char*mes){\nif(!lua_checkstack(L,space))\nluaL_error(L,\"stack overflow (%s)\",mes);\n}\nstatic void luaL_checktype(lua_State*L,int narg,int t){\nif(lua_type(L,narg)!=t)\ntag_error(L,narg,t);\n}\nstatic void luaL_checkany(lua_State*L,int narg){\nif(lua_type(L,narg)==(-1))\nluaL_argerror(L,narg,\"value expected\");\n}\nstatic const char*luaL_checklstring(lua_State*L,int narg,size_t*len){\nconst char*s=lua_tolstring(L,narg,len);\nif(!s)tag_error(L,narg,4);\nreturn s;\n}\nstatic const char*luaL_optlstring(lua_State*L,int narg,\nconst char*def,size_t*len){\nif(lua_isnoneornil(L,narg)){\nif(len)\n*len=(def?strlen(def):0);\nreturn def;\n}\nelse return luaL_checklstring(L,narg,len);\n}\nstatic lua_Number luaL_checknumber(lua_State*L,int narg){\nlua_Number d=lua_tonumber(L,narg);\nif(d==0&&!lua_isnumber(L,narg))\ntag_error(L,narg,3);\nreturn d;\n}\nstatic lua_Integer luaL_checkinteger(lua_State*L,int narg){\nlua_Integer d=lua_tointeger(L,narg);\nif(d==0&&!lua_isnumber(L,narg))\ntag_error(L,narg,3);\nreturn d;\n}\nstatic lua_Integer luaL_optinteger(lua_State*L,int narg,\nlua_Integer def){\nreturn luaL_opt(L,luaL_checkinteger,narg,def);\n}\nstatic int luaL_getmetafield(lua_State*L,int obj,const char*event){\nif(!lua_getmetatable(L,obj))\nreturn 0;\nlua_pushstring(L,event);\nlua_rawget(L,-2);\nif(lua_isnil(L,-1)){\nlua_pop(L,2);\nreturn 0;\n}\nelse{\nlua_remove(L,-2);\nreturn 1;\n}\n}\nstatic void luaL_register(lua_State*L,const char*libname,\nconst luaL_Reg*l){\nluaI_openlib(L,libname,l,0);\n}\nstatic int libsize(const luaL_Reg*l){\nint size=0;\nfor(;l->name;l++)size++;\nreturn size;\n}\nstatic void luaI_openlib(lua_State*L,const char*libname,\nconst luaL_Reg*l,int nup){\nif(libname){\nint size=libsize(l);\nluaL_findtable(L,(-10000),\"_LOADED\",1);\nlua_getfield(L,-1,libname);\nif(!lua_istable(L,-1)){\nlua_pop(L,1);\nif(luaL_findtable(L,(-10002),libname,size)!=NULL)\nluaL_error(L,\"name conflict for module \"LUA_QL(\"%s\"),libname);\nlua_pushvalue(L,-1);\nlua_setfield(L,-3,libname);\n}\nlua_remove(L,-2);\nlua_insert(L,-(nup+1));\n}\nfor(;l->name;l++){\nint i;\nfor(i=0;i<nup;i++)\nlua_pushvalue(L,-nup);\nlua_pushcclosure(L,l->func,nup);\nlua_setfield(L,-(nup+2),l->name);\n}\nlua_pop(L,nup);\n}\nstatic const char*luaL_findtable(lua_State*L,int idx,\nconst char*fname,int szhint){\nconst char*e;\nlua_pushvalue(L,idx);\ndo{\ne=strchr(fname,'.');\nif(e==NULL)e=fname+strlen(fname);\nlua_pushlstring(L,fname,e-fname);\nlua_rawget(L,-2);\nif(lua_isnil(L,-1)){\nlua_pop(L,1);\nlua_createtable(L,0,(*e=='.'?1:szhint));\nlua_pushlstring(L,fname,e-fname);\nlua_pushvalue(L,-2);\nlua_settable(L,-4);\n}\nelse if(!lua_istable(L,-1)){\nlua_pop(L,2);\nreturn fname;\n}\nlua_remove(L,-2);\nfname=e+1;\n}while(*e=='.');\nreturn NULL;\n}\n#define bufflen(B)((B)->p-(B)->buffer)\n#define bufffree(B)((size_t)(BUFSIZ-bufflen(B)))\nstatic int emptybuffer(luaL_Buffer*B){\nsize_t l=bufflen(B);\nif(l==0)return 0;\nelse{\nlua_pushlstring(B->L,B->buffer,l);\nB->p=B->buffer;\nB->lvl++;\nreturn 1;\n}\n}\nstatic void adjuststack(luaL_Buffer*B){\nif(B->lvl>1){\nlua_State*L=B->L;\nint toget=1;\nsize_t toplen=lua_strlen(L,-1);\ndo{\nsize_t l=lua_strlen(L,-(toget+1));\nif(B->lvl-toget+1>=(20/2)||toplen>l){\ntoplen+=l;\ntoget++;\n}\nelse break;\n}while(toget<B->lvl);\nlua_concat(L,toget);\nB->lvl=B->lvl-toget+1;\n}\n}\nstatic char*luaL_prepbuffer(luaL_Buffer*B){\nif(emptybuffer(B))\nadjuststack(B);\nreturn B->buffer;\n}\nstatic void luaL_addlstring(luaL_Buffer*B,const char*s,size_t l){\nwhile(l--)\nluaL_addchar(B,*s++);\n}\nstatic void luaL_pushresult(luaL_Buffer*B){\nemptybuffer(B);\nlua_concat(B->L,B->lvl);\nB->lvl=1;\n}\nstatic void luaL_addvalue(luaL_Buffer*B){\nlua_State*L=B->L;\nsize_t vl;\nconst char*s=lua_tolstring(L,-1,&vl);\nif(vl<=bufffree(B)){\nmemcpy(B->p,s,vl);\nB->p+=vl;\nlua_pop(L,1);\n}\nelse{\nif(emptybuffer(B))\nlua_insert(L,-2);\nB->lvl++;\nadjuststack(B);\n}\n}\nstatic void luaL_buffinit(lua_State*L,luaL_Buffer*B){\nB->L=L;\nB->p=B->buffer;\nB->lvl=0;\n}\ntypedef struct LoadF{\nint extraline;\nFILE*f;\nchar buff[BUFSIZ];\n}LoadF;\nstatic const char*getF(lua_State*L,void*ud,size_t*size){\nLoadF*lf=(LoadF*)ud;\n(void)L;\nif(lf->extraline){\nlf->extraline=0;\n*size=1;\nreturn\"\\n\";\n}\nif(feof(lf->f))return NULL;\n*size=fread(lf->buff,1,sizeof(lf->buff),lf->f);\nreturn(*size>0)?lf->buff:NULL;\n}\nstatic int errfile(lua_State*L,const char*what,int fnameindex){\nconst char*serr=strerror(errno);\nconst char*filename=lua_tostring(L,fnameindex)+1;\nlua_pushfstring(L,\"cannot %s %s: %s\",what,filename,serr);\nlua_remove(L,fnameindex);\nreturn(5+1);\n}\nstatic int luaL_loadfile(lua_State*L,const char*filename){\nLoadF lf;\nint status,readstatus;\nint c;\nint fnameindex=lua_gettop(L)+1;\nlf.extraline=0;\nif(filename==NULL){\nlua_pushliteral(L,\"=stdin\");\nlf.f=stdin;\n}\nelse{\nlua_pushfstring(L,\"@%s\",filename);\nlf.f=fopen(filename,\"r\");\nif(lf.f==NULL)return errfile(L,\"open\",fnameindex);\n}\nc=getc(lf.f);\nif(c=='#'){\nlf.extraline=1;\nwhile((c=getc(lf.f))!=EOF&&c!='\\n');\nif(c=='\\n')c=getc(lf.f);\n}\nif(c==\"\\033Lua\"[0]&&filename){\nlf.f=freopen(filename,\"rb\",lf.f);\nif(lf.f==NULL)return errfile(L,\"reopen\",fnameindex);\nwhile((c=getc(lf.f))!=EOF&&c!=\"\\033Lua\"[0]);\nlf.extraline=0;\n}\nungetc(c,lf.f);\nstatus=lua_load(L,getF,&lf,lua_tostring(L,-1));\nreadstatus=ferror(lf.f);\nif(filename)fclose(lf.f);\nif(readstatus){\nlua_settop(L,fnameindex);\nreturn errfile(L,\"read\",fnameindex);\n}\nlua_remove(L,fnameindex);\nreturn status;\n}\ntypedef struct LoadS{\nconst char*s;\nsize_t size;\n}LoadS;\nstatic const char*getS(lua_State*L,void*ud,size_t*size){\nLoadS*ls=(LoadS*)ud;\n(void)L;\nif(ls->size==0)return NULL;\n*size=ls->size;\nls->size=0;\nreturn ls->s;\n}\nstatic int luaL_loadbuffer(lua_State*L,const char*buff,size_t size,\nconst char*name){\nLoadS ls;\nls.s=buff;\nls.size=size;\nreturn lua_load(L,getS,&ls,name);\n}\nstatic void*l_alloc(void*ud,void*ptr,size_t osize,size_t nsize){\n(void)ud;\n(void)osize;\nif(nsize==0){\nfree(ptr);\nreturn NULL;\n}\nelse\nreturn realloc(ptr,nsize);\n}\nstatic int panic(lua_State*L){\n(void)L;\nfprintf(stderr,\"PANIC: unprotected error in call to Lua API (%s)\\n\",\nlua_tostring(L,-1));\nreturn 0;\n}\nstatic lua_State*luaL_newstate(void){\nlua_State*L=lua_newstate(l_alloc,NULL);\nif(L)lua_atpanic(L,&panic);\nreturn L;\n}\nstatic int luaB_tonumber(lua_State*L){\nint base=luaL_optint(L,2,10);\nif(base==10){\nluaL_checkany(L,1);\nif(lua_isnumber(L,1)){\nlua_pushnumber(L,lua_tonumber(L,1));\nreturn 1;\n}\n}\nelse{\nconst char*s1=luaL_checkstring(L,1);\nchar*s2;\nunsigned long n;\nluaL_argcheck(L,2<=base&&base<=36,2,\"base out of range\");\nn=strtoul(s1,&s2,base);\nif(s1!=s2){\nwhile(isspace((unsigned char)(*s2)))s2++;\nif(*s2=='\\0'){\nlua_pushnumber(L,(lua_Number)n);\nreturn 1;\n}\n}\n}\nlua_pushnil(L);\nreturn 1;\n}\nstatic int luaB_error(lua_State*L){\nint level=luaL_optint(L,2,1);\nlua_settop(L,1);\nif(lua_isstring(L,1)&&level>0){\nluaL_where(L,level);\nlua_pushvalue(L,1);\nlua_concat(L,2);\n}\nreturn lua_error(L);\n}\nstatic int luaB_setmetatable(lua_State*L){\nint t=lua_type(L,2);\nluaL_checktype(L,1,5);\nluaL_argcheck(L,t==0||t==5,2,\n\"nil or table expected\");\nif(luaL_getmetafield(L,1,\"__metatable\"))\nluaL_error(L,\"cannot change a protected metatable\");\nlua_settop(L,2);\nlua_setmetatable(L,1);\nreturn 1;\n}\nstatic void getfunc(lua_State*L,int opt){\nif(lua_isfunction(L,1))lua_pushvalue(L,1);\nelse{\nlua_Debug ar;\nint level=opt?luaL_optint(L,1,1):luaL_checkint(L,1);\nluaL_argcheck(L,level>=0,1,\"level must be non-negative\");\nif(lua_getstack(L,level,&ar)==0)\nluaL_argerror(L,1,\"invalid level\");\nlua_getinfo(L,\"f\",&ar);\nif(lua_isnil(L,-1))\nluaL_error(L,\"no function environment for tail call at level %d\",\nlevel);\n}\n}\nstatic int luaB_setfenv(lua_State*L){\nluaL_checktype(L,2,5);\ngetfunc(L,0);\nlua_pushvalue(L,2);\nif(lua_isnumber(L,1)&&lua_tonumber(L,1)==0){\nlua_pushthread(L);\nlua_insert(L,-2);\nlua_setfenv(L,-2);\nreturn 0;\n}\nelse if(lua_iscfunction(L,-2)||lua_setfenv(L,-2)==0)\nluaL_error(L,\nLUA_QL(\"setfenv\")\" cannot change environment of given object\");\nreturn 1;\n}\nstatic int luaB_rawget(lua_State*L){\nluaL_checktype(L,1,5);\nluaL_checkany(L,2);\nlua_settop(L,2);\nlua_rawget(L,1);\nreturn 1;\n}\nstatic int luaB_type(lua_State*L){\nluaL_checkany(L,1);\nlua_pushstring(L,luaL_typename(L,1));\nreturn 1;\n}\nstatic int luaB_next(lua_State*L){\nluaL_checktype(L,1,5);\nlua_settop(L,2);\nif(lua_next(L,1))\nreturn 2;\nelse{\nlua_pushnil(L);\nreturn 1;\n}\n}\nstatic int luaB_pairs(lua_State*L){\nluaL_checktype(L,1,5);\nlua_pushvalue(L,lua_upvalueindex(1));\nlua_pushvalue(L,1);\nlua_pushnil(L);\nreturn 3;\n}\nstatic int ipairsaux(lua_State*L){\nint i=luaL_checkint(L,2);\nluaL_checktype(L,1,5);\ni++;\nlua_pushinteger(L,i);\nlua_rawgeti(L,1,i);\nreturn(lua_isnil(L,-1))?0:2;\n}\nstatic int luaB_ipairs(lua_State*L){\nluaL_checktype(L,1,5);\nlua_pushvalue(L,lua_upvalueindex(1));\nlua_pushvalue(L,1);\nlua_pushinteger(L,0);\nreturn 3;\n}\nstatic int load_aux(lua_State*L,int status){\nif(status==0)\nreturn 1;\nelse{\nlua_pushnil(L);\nlua_insert(L,-2);\nreturn 2;\n}\n}\nstatic int luaB_loadstring(lua_State*L){\nsize_t l;\nconst char*s=luaL_checklstring(L,1,&l);\nconst char*chunkname=luaL_optstring(L,2,s);\nreturn load_aux(L,luaL_loadbuffer(L,s,l,chunkname));\n}\nstatic int luaB_loadfile(lua_State*L){\nconst char*fname=luaL_optstring(L,1,NULL);\nreturn load_aux(L,luaL_loadfile(L,fname));\n}\nstatic int luaB_assert(lua_State*L){\nluaL_checkany(L,1);\nif(!lua_toboolean(L,1))\nreturn luaL_error(L,\"%s\",luaL_optstring(L,2,\"assertion failed!\"));\nreturn lua_gettop(L);\n}\nstatic int luaB_unpack(lua_State*L){\nint i,e,n;\nluaL_checktype(L,1,5);\ni=luaL_optint(L,2,1);\ne=luaL_opt(L,luaL_checkint,3,luaL_getn(L,1));\nif(i>e)return 0;\nn=e-i+1;\nif(n<=0||!lua_checkstack(L,n))\nreturn luaL_error(L,\"too many results to unpack\");\nlua_rawgeti(L,1,i);\nwhile(i++<e)\nlua_rawgeti(L,1,i);\nreturn n;\n}\nstatic int luaB_pcall(lua_State*L){\nint status;\nluaL_checkany(L,1);\nstatus=lua_pcall(L,lua_gettop(L)-1,(-1),0);\nlua_pushboolean(L,(status==0));\nlua_insert(L,1);\nreturn lua_gettop(L);\n}\nstatic int luaB_newproxy(lua_State*L){\nlua_settop(L,1);\nlua_newuserdata(L,0);\nif(lua_toboolean(L,1)==0)\nreturn 1;\nelse if(lua_isboolean(L,1)){\nlua_newtable(L);\nlua_pushvalue(L,-1);\nlua_pushboolean(L,1);\nlua_rawset(L,lua_upvalueindex(1));\n}\nelse{\nint validproxy=0;\nif(lua_getmetatable(L,1)){\nlua_rawget(L,lua_upvalueindex(1));\nvalidproxy=lua_toboolean(L,-1);\nlua_pop(L,1);\n}\nluaL_argcheck(L,validproxy,1,\"boolean or proxy expected\");\nlua_getmetatable(L,1);\n}\nlua_setmetatable(L,2);\nreturn 1;\n}\nstatic const luaL_Reg base_funcs[]={\n{\"assert\",luaB_assert},\n{\"error\",luaB_error},\n{\"loadfile\",luaB_loadfile},\n{\"loadstring\",luaB_loadstring},\n{\"next\",luaB_next},\n{\"pcall\",luaB_pcall},\n{\"rawget\",luaB_rawget},\n{\"setfenv\",luaB_setfenv},\n{\"setmetatable\",luaB_setmetatable},\n{\"tonumber\",luaB_tonumber},\n{\"type\",luaB_type},\n{\"unpack\",luaB_unpack},\n{NULL,NULL}\n};\nstatic void auxopen(lua_State*L,const char*name,\nlua_CFunction f,lua_CFunction u){\nlua_pushcfunction(L,u);\nlua_pushcclosure(L,f,1);\nlua_setfield(L,-2,name);\n}\nstatic void base_open(lua_State*L){\nlua_pushvalue(L,(-10002));\nlua_setglobal(L,\"_G\");\nluaL_register(L,\"_G\",base_funcs);\nlua_pushliteral(L,\"Lua 5.1\");\nlua_setglobal(L,\"_VERSION\");\nauxopen(L,\"ipairs\",luaB_ipairs,ipairsaux);\nauxopen(L,\"pairs\",luaB_pairs,luaB_next);\nlua_createtable(L,0,1);\nlua_pushvalue(L,-1);\nlua_setmetatable(L,-2);\nlua_pushliteral(L,\"kv\");\nlua_setfield(L,-2,\"__mode\");\nlua_pushcclosure(L,luaB_newproxy,1);\nlua_setglobal(L,\"newproxy\");\n}\nstatic int luaopen_base(lua_State*L){\nbase_open(L);\nreturn 1;\n}\n#define aux_getn(L,n)(luaL_checktype(L,n,5),luaL_getn(L,n))\nstatic int tinsert(lua_State*L){\nint e=aux_getn(L,1)+1;\nint pos;\nswitch(lua_gettop(L)){\ncase 2:{\npos=e;\nbreak;\n}\ncase 3:{\nint i;\npos=luaL_checkint(L,2);\nif(pos>e)e=pos;\nfor(i=e;i>pos;i--){\nlua_rawgeti(L,1,i-1);\nlua_rawseti(L,1,i);\n}\nbreak;\n}\ndefault:{\nreturn luaL_error(L,\"wrong number of arguments to \"LUA_QL(\"insert\"));\n}\n}\nluaL_setn(L,1,e);\nlua_rawseti(L,1,pos);\nreturn 0;\n}\nstatic int tremove(lua_State*L){\nint e=aux_getn(L,1);\nint pos=luaL_optint(L,2,e);\nif(!(1<=pos&&pos<=e))\nreturn 0;\nluaL_setn(L,1,e-1);\nlua_rawgeti(L,1,pos);\nfor(;pos<e;pos++){\nlua_rawgeti(L,1,pos+1);\nlua_rawseti(L,1,pos);\n}\nlua_pushnil(L);\nlua_rawseti(L,1,e);\nreturn 1;\n}\nstatic void addfield(lua_State*L,luaL_Buffer*b,int i){\nlua_rawgeti(L,1,i);\nif(!lua_isstring(L,-1))\nluaL_error(L,\"invalid value (%s) at index %d in table for \"\nLUA_QL(\"concat\"),luaL_typename(L,-1),i);\nluaL_addvalue(b);\n}\nstatic int tconcat(lua_State*L){\nluaL_Buffer b;\nsize_t lsep;\nint i,last;\nconst char*sep=luaL_optlstring(L,2,\"\",&lsep);\nluaL_checktype(L,1,5);\ni=luaL_optint(L,3,1);\nlast=luaL_opt(L,luaL_checkint,4,luaL_getn(L,1));\nluaL_buffinit(L,&b);\nfor(;i<last;i++){\naddfield(L,&b,i);\nluaL_addlstring(&b,sep,lsep);\n}\nif(i==last)\naddfield(L,&b,i);\nluaL_pushresult(&b);\nreturn 1;\n}\nstatic void set2(lua_State*L,int i,int j){\nlua_rawseti(L,1,i);\nlua_rawseti(L,1,j);\n}\nstatic int sort_comp(lua_State*L,int a,int b){\nif(!lua_isnil(L,2)){\nint res;\nlua_pushvalue(L,2);\nlua_pushvalue(L,a-1);\nlua_pushvalue(L,b-2);\nlua_call(L,2,1);\nres=lua_toboolean(L,-1);\nlua_pop(L,1);\nreturn res;\n}\nelse\nreturn lua_lessthan(L,a,b);\n}\nstatic void auxsort(lua_State*L,int l,int u){\nwhile(l<u){\nint i,j;\nlua_rawgeti(L,1,l);\nlua_rawgeti(L,1,u);\nif(sort_comp(L,-1,-2))\nset2(L,l,u);\nelse\nlua_pop(L,2);\nif(u-l==1)break;\ni=(l+u)/2;\nlua_rawgeti(L,1,i);\nlua_rawgeti(L,1,l);\nif(sort_comp(L,-2,-1))\nset2(L,i,l);\nelse{\nlua_pop(L,1);\nlua_rawgeti(L,1,u);\nif(sort_comp(L,-1,-2))\nset2(L,i,u);\nelse\nlua_pop(L,2);\n}\nif(u-l==2)break;\nlua_rawgeti(L,1,i);\nlua_pushvalue(L,-1);\nlua_rawgeti(L,1,u-1);\nset2(L,i,u-1);\ni=l;j=u-1;\nfor(;;){\nwhile(lua_rawgeti(L,1,++i),sort_comp(L,-1,-2)){\nif(i>u)luaL_error(L,\"invalid order function for sorting\");\nlua_pop(L,1);\n}\nwhile(lua_rawgeti(L,1,--j),sort_comp(L,-3,-1)){\nif(j<l)luaL_error(L,\"invalid order function for sorting\");\nlua_pop(L,1);\n}\nif(j<i){\nlua_pop(L,3);\nbreak;\n}\nset2(L,i,j);\n}\nlua_rawgeti(L,1,u-1);\nlua_rawgeti(L,1,i);\nset2(L,u-1,i);\nif(i-l<u-i){\nj=l;i=i-1;l=i+2;\n}\nelse{\nj=i+1;i=u;u=j-2;\n}\nauxsort(L,j,i);\n}\n}\nstatic int sort(lua_State*L){\nint n=aux_getn(L,1);\nluaL_checkstack(L,40,\"\");\nif(!lua_isnoneornil(L,2))\nluaL_checktype(L,2,6);\nlua_settop(L,2);\nauxsort(L,1,n);\nreturn 0;\n}\nstatic const luaL_Reg tab_funcs[]={\n{\"concat\",tconcat},\n{\"insert\",tinsert},\n{\"remove\",tremove},\n{\"sort\",sort},\n{NULL,NULL}\n};\nstatic int luaopen_table(lua_State*L){\nluaL_register(L,\"table\",tab_funcs);\nreturn 1;\n}\nstatic const char*const fnames[]={\"input\",\"output\"};\nstatic int pushresult(lua_State*L,int i,const char*filename){\nint en=errno;\nif(i){\nlua_pushboolean(L,1);\nreturn 1;\n}\nelse{\nlua_pushnil(L);\nif(filename)\nlua_pushfstring(L,\"%s: %s\",filename,strerror(en));\nelse\nlua_pushfstring(L,\"%s\",strerror(en));\nlua_pushinteger(L,en);\nreturn 3;\n}\n}\nstatic void fileerror(lua_State*L,int arg,const char*filename){\nlua_pushfstring(L,\"%s: %s\",filename,strerror(errno));\nluaL_argerror(L,arg,lua_tostring(L,-1));\n}\n#define tofilep(L)((FILE**)luaL_checkudata(L,1,\"FILE*\"))\nstatic int io_type(lua_State*L){\nvoid*ud;\nluaL_checkany(L,1);\nud=lua_touserdata(L,1);\nlua_getfield(L,(-10000),\"FILE*\");\nif(ud==NULL||!lua_getmetatable(L,1)||!lua_rawequal(L,-2,-1))\nlua_pushnil(L);\nelse if(*((FILE**)ud)==NULL)\nlua_pushliteral(L,\"closed file\");\nelse\nlua_pushliteral(L,\"file\");\nreturn 1;\n}\nstatic FILE*tofile(lua_State*L){\nFILE**f=tofilep(L);\nif(*f==NULL)\nluaL_error(L,\"attempt to use a closed file\");\nreturn*f;\n}\nstatic FILE**newfile(lua_State*L){\nFILE**pf=(FILE**)lua_newuserdata(L,sizeof(FILE*));\n*pf=NULL;\nluaL_getmetatable(L,\"FILE*\");\nlua_setmetatable(L,-2);\nreturn pf;\n}\nstatic int io_noclose(lua_State*L){\nlua_pushnil(L);\nlua_pushliteral(L,\"cannot close standard file\");\nreturn 2;\n}\nstatic int io_pclose(lua_State*L){\nFILE**p=tofilep(L);\nint ok=lua_pclose(L,*p);\n*p=NULL;\nreturn pushresult(L,ok,NULL);\n}\nstatic int io_fclose(lua_State*L){\nFILE**p=tofilep(L);\nint ok=(fclose(*p)==0);\n*p=NULL;\nreturn pushresult(L,ok,NULL);\n}\nstatic int aux_close(lua_State*L){\nlua_getfenv(L,1);\nlua_getfield(L,-1,\"__close\");\nreturn(lua_tocfunction(L,-1))(L);\n}\nstatic int io_close(lua_State*L){\nif(lua_isnone(L,1))\nlua_rawgeti(L,(-10001),2);\ntofile(L);\nreturn aux_close(L);\n}\nstatic int io_gc(lua_State*L){\nFILE*f=*tofilep(L);\nif(f!=NULL)\naux_close(L);\nreturn 0;\n}\nstatic int io_open(lua_State*L){\nconst char*filename=luaL_checkstring(L,1);\nconst char*mode=luaL_optstring(L,2,\"r\");\nFILE**pf=newfile(L);\n*pf=fopen(filename,mode);\nreturn(*pf==NULL)?pushresult(L,0,filename):1;\n}\nstatic FILE*getiofile(lua_State*L,int findex){\nFILE*f;\nlua_rawgeti(L,(-10001),findex);\nf=*(FILE**)lua_touserdata(L,-1);\nif(f==NULL)\nluaL_error(L,\"standard %s file is closed\",fnames[findex-1]);\nreturn f;\n}\nstatic int g_iofile(lua_State*L,int f,const char*mode){\nif(!lua_isnoneornil(L,1)){\nconst char*filename=lua_tostring(L,1);\nif(filename){\nFILE**pf=newfile(L);\n*pf=fopen(filename,mode);\nif(*pf==NULL)\nfileerror(L,1,filename);\n}\nelse{\ntofile(L);\nlua_pushvalue(L,1);\n}\nlua_rawseti(L,(-10001),f);\n}\nlua_rawgeti(L,(-10001),f);\nreturn 1;\n}\nstatic int io_input(lua_State*L){\nreturn g_iofile(L,1,\"r\");\n}\nstatic int io_output(lua_State*L){\nreturn g_iofile(L,2,\"w\");\n}\nstatic int io_readline(lua_State*L);\nstatic void aux_lines(lua_State*L,int idx,int toclose){\nlua_pushvalue(L,idx);\nlua_pushboolean(L,toclose);\nlua_pushcclosure(L,io_readline,2);\n}\nstatic int f_lines(lua_State*L){\ntofile(L);\naux_lines(L,1,0);\nreturn 1;\n}\nstatic int io_lines(lua_State*L){\nif(lua_isnoneornil(L,1)){\nlua_rawgeti(L,(-10001),1);\nreturn f_lines(L);\n}\nelse{\nconst char*filename=luaL_checkstring(L,1);\nFILE**pf=newfile(L);\n*pf=fopen(filename,\"r\");\nif(*pf==NULL)\nfileerror(L,1,filename);\naux_lines(L,lua_gettop(L),1);\nreturn 1;\n}\n}\nstatic int read_number(lua_State*L,FILE*f){\nlua_Number d;\nif(fscanf(f,\"%lf\",&d)==1){\nlua_pushnumber(L,d);\nreturn 1;\n}\nelse{\nlua_pushnil(L);\nreturn 0;\n}\n}\nstatic int test_eof(lua_State*L,FILE*f){\nint c=getc(f);\nungetc(c,f);\nlua_pushlstring(L,NULL,0);\nreturn(c!=EOF);\n}\nstatic int read_line(lua_State*L,FILE*f){\nluaL_Buffer b;\nluaL_buffinit(L,&b);\nfor(;;){\nsize_t l;\nchar*p=luaL_prepbuffer(&b);\nif(fgets(p,BUFSIZ,f)==NULL){\nluaL_pushresult(&b);\nreturn(lua_objlen(L,-1)>0);\n}\nl=strlen(p);\nif(l==0||p[l-1]!='\\n')\nluaL_addsize(&b,l);\nelse{\nluaL_addsize(&b,l-1);\nluaL_pushresult(&b);\nreturn 1;\n}\n}\n}\nstatic int read_chars(lua_State*L,FILE*f,size_t n){\nsize_t rlen;\nsize_t nr;\nluaL_Buffer b;\nluaL_buffinit(L,&b);\nrlen=BUFSIZ;\ndo{\nchar*p=luaL_prepbuffer(&b);\nif(rlen>n)rlen=n;\nnr=fread(p,sizeof(char),rlen,f);\nluaL_addsize(&b,nr);\nn-=nr;\n}while(n>0&&nr==rlen);\nluaL_pushresult(&b);\nreturn(n==0||lua_objlen(L,-1)>0);\n}\nstatic int g_read(lua_State*L,FILE*f,int first){\nint nargs=lua_gettop(L)-1;\nint success;\nint n;\nclearerr(f);\nif(nargs==0){\nsuccess=read_line(L,f);\nn=first+1;\n}\nelse{\nluaL_checkstack(L,nargs+20,\"too many arguments\");\nsuccess=1;\nfor(n=first;nargs--&&success;n++){\nif(lua_type(L,n)==3){\nsize_t l=(size_t)lua_tointeger(L,n);\nsuccess=(l==0)?test_eof(L,f):read_chars(L,f,l);\n}\nelse{\nconst char*p=lua_tostring(L,n);\nluaL_argcheck(L,p&&p[0]=='*',n,\"invalid option\");\nswitch(p[1]){\ncase'n':\nsuccess=read_number(L,f);\nbreak;\ncase'l':\nsuccess=read_line(L,f);\nbreak;\ncase'a':\nread_chars(L,f,~((size_t)0));\nsuccess=1;\nbreak;\ndefault:\nreturn luaL_argerror(L,n,\"invalid format\");\n}\n}\n}\n}\nif(ferror(f))\nreturn pushresult(L,0,NULL);\nif(!success){\nlua_pop(L,1);\nlua_pushnil(L);\n}\nreturn n-first;\n}\nstatic int io_read(lua_State*L){\nreturn g_read(L,getiofile(L,1),1);\n}\nstatic int f_read(lua_State*L){\nreturn g_read(L,tofile(L),2);\n}\nstatic int io_readline(lua_State*L){\nFILE*f=*(FILE**)lua_touserdata(L,lua_upvalueindex(1));\nint sucess;\nif(f==NULL)\nluaL_error(L,\"file is already closed\");\nsucess=read_line(L,f);\nif(ferror(f))\nreturn luaL_error(L,\"%s\",strerror(errno));\nif(sucess)return 1;\nelse{\nif(lua_toboolean(L,lua_upvalueindex(2))){\nlua_settop(L,0);\nlua_pushvalue(L,lua_upvalueindex(1));\naux_close(L);\n}\nreturn 0;\n}\n}\nstatic int g_write(lua_State*L,FILE*f,int arg){\nint nargs=lua_gettop(L)-1;\nint status=1;\nfor(;nargs--;arg++){\nif(lua_type(L,arg)==3){\nstatus=status&&\nfprintf(f,\"%.14g\",lua_tonumber(L,arg))>0;\n}\nelse{\nsize_t l;\nconst char*s=luaL_checklstring(L,arg,&l);\nstatus=status&&(fwrite(s,sizeof(char),l,f)==l);\n}\n}\nreturn pushresult(L,status,NULL);\n}\nstatic int io_write(lua_State*L){\nreturn g_write(L,getiofile(L,2),1);\n}\nstatic int f_write(lua_State*L){\nreturn g_write(L,tofile(L),2);\n}\nstatic int io_flush(lua_State*L){\nreturn pushresult(L,fflush(getiofile(L,2))==0,NULL);\n}\nstatic int f_flush(lua_State*L){\nreturn pushresult(L,fflush(tofile(L))==0,NULL);\n}\nstatic const luaL_Reg iolib[]={\n{\"close\",io_close},\n{\"flush\",io_flush},\n{\"input\",io_input},\n{\"lines\",io_lines},\n{\"open\",io_open},\n{\"output\",io_output},\n{\"read\",io_read},\n{\"type\",io_type},\n{\"write\",io_write},\n{NULL,NULL}\n};\nstatic const luaL_Reg flib[]={\n{\"close\",io_close},\n{\"flush\",f_flush},\n{\"lines\",f_lines},\n{\"read\",f_read},\n{\"write\",f_write},\n{\"__gc\",io_gc},\n{NULL,NULL}\n};\nstatic void createmeta(lua_State*L){\nluaL_newmetatable(L,\"FILE*\");\nlua_pushvalue(L,-1);\nlua_setfield(L,-2,\"__index\");\nluaL_register(L,NULL,flib);\n}\nstatic void createstdfile(lua_State*L,FILE*f,int k,const char*fname){\n*newfile(L)=f;\nif(k>0){\nlua_pushvalue(L,-1);\nlua_rawseti(L,(-10001),k);\n}\nlua_pushvalue(L,-2);\nlua_setfenv(L,-2);\nlua_setfield(L,-3,fname);\n}\nstatic void newfenv(lua_State*L,lua_CFunction cls){\nlua_createtable(L,0,1);\nlua_pushcfunction(L,cls);\nlua_setfield(L,-2,\"__close\");\n}\nstatic int luaopen_io(lua_State*L){\ncreatemeta(L);\nnewfenv(L,io_fclose);\nlua_replace(L,(-10001));\nluaL_register(L,\"io\",iolib);\nnewfenv(L,io_noclose);\ncreatestdfile(L,stdin,1,\"stdin\");\ncreatestdfile(L,stdout,2,\"stdout\");\ncreatestdfile(L,stderr,0,\"stderr\");\nlua_pop(L,1);\nlua_getfield(L,-1,\"popen\");\nnewfenv(L,io_pclose);\nlua_setfenv(L,-2);\nlua_pop(L,1);\nreturn 1;\n}\nstatic int os_pushresult(lua_State*L,int i,const char*filename){\nint en=errno;\nif(i){\nlua_pushboolean(L,1);\nreturn 1;\n}\nelse{\nlua_pushnil(L);\nlua_pushfstring(L,\"%s: %s\",filename,strerror(en));\nlua_pushinteger(L,en);\nreturn 3;\n}\n}\nstatic int os_remove(lua_State*L){\nconst char*filename=luaL_checkstring(L,1);\nreturn os_pushresult(L,remove(filename)==0,filename);\n}\nstatic int os_exit(lua_State*L){\nexit(luaL_optint(L,1,EXIT_SUCCESS));\n}\nstatic const luaL_Reg syslib[]={\n{\"exit\",os_exit},\n{\"remove\",os_remove},\n{NULL,NULL}\n};\nstatic int luaopen_os(lua_State*L){\nluaL_register(L,\"os\",syslib);\nreturn 1;\n}\n#define uchar(c)((unsigned char)(c))\nstatic ptrdiff_t posrelat(ptrdiff_t pos,size_t len){\nif(pos<0)pos+=(ptrdiff_t)len+1;\nreturn(pos>=0)?pos:0;\n}\nstatic int str_sub(lua_State*L){\nsize_t l;\nconst char*s=luaL_checklstring(L,1,&l);\nptrdiff_t start=posrelat(luaL_checkinteger(L,2),l);\nptrdiff_t end=posrelat(luaL_optinteger(L,3,-1),l);\nif(start<1)start=1;\nif(end>(ptrdiff_t)l)end=(ptrdiff_t)l;\nif(start<=end)\nlua_pushlstring(L,s+start-1,end-start+1);\nelse lua_pushliteral(L,\"\");\nreturn 1;\n}\nstatic int str_lower(lua_State*L){\nsize_t l;\nsize_t i;\nluaL_Buffer b;\nconst char*s=luaL_checklstring(L,1,&l);\nluaL_buffinit(L,&b);\nfor(i=0;i<l;i++)\nluaL_addchar(&b,tolower(uchar(s[i])));\nluaL_pushresult(&b);\nreturn 1;\n}\nstatic int str_upper(lua_State*L){\nsize_t l;\nsize_t i;\nluaL_Buffer b;\nconst char*s=luaL_checklstring(L,1,&l);\nluaL_buffinit(L,&b);\nfor(i=0;i<l;i++)\nluaL_addchar(&b,toupper(uchar(s[i])));\nluaL_pushresult(&b);\nreturn 1;\n}\nstatic int str_rep(lua_State*L){\nsize_t l;\nluaL_Buffer b;\nconst char*s=luaL_checklstring(L,1,&l);\nint n=luaL_checkint(L,2);\nluaL_buffinit(L,&b);\nwhile(n-->0)\nluaL_addlstring(&b,s,l);\nluaL_pushresult(&b);\nreturn 1;\n}\nstatic int str_byte(lua_State*L){\nsize_t l;\nconst char*s=luaL_checklstring(L,1,&l);\nptrdiff_t posi=posrelat(luaL_optinteger(L,2,1),l);\nptrdiff_t pose=posrelat(luaL_optinteger(L,3,posi),l);\nint n,i;\nif(posi<=0)posi=1;\nif((size_t)pose>l)pose=l;\nif(posi>pose)return 0;\nn=(int)(pose-posi+1);\nif(posi+n<=pose)\nluaL_error(L,\"string slice too long\");\nluaL_checkstack(L,n,\"string slice too long\");\nfor(i=0;i<n;i++)\nlua_pushinteger(L,uchar(s[posi+i-1]));\nreturn n;\n}\nstatic int str_char(lua_State*L){\nint n=lua_gettop(L);\nint i;\nluaL_Buffer b;\nluaL_buffinit(L,&b);\nfor(i=1;i<=n;i++){\nint c=luaL_checkint(L,i);\nluaL_argcheck(L,uchar(c)==c,i,\"invalid value\");\nluaL_addchar(&b,uchar(c));\n}\nluaL_pushresult(&b);\nreturn 1;\n}\ntypedef struct MatchState{\nconst char*src_init;\nconst char*src_end;\nlua_State*L;\nint level;\nstruct{\nconst char*init;\nptrdiff_t len;\n}capture[32];\n}MatchState;\nstatic int check_capture(MatchState*ms,int l){\nl-='1';\nif(l<0||l>=ms->level||ms->capture[l].len==(-1))\nreturn luaL_error(ms->L,\"invalid capture index\");\nreturn l;\n}\nstatic int capture_to_close(MatchState*ms){\nint level=ms->level;\nfor(level--;level>=0;level--)\nif(ms->capture[level].len==(-1))return level;\nreturn luaL_error(ms->L,\"invalid pattern capture\");\n}\nstatic const char*classend(MatchState*ms,const char*p){\nswitch(*p++){\ncase'%':{\nif(*p=='\\0')\nluaL_error(ms->L,\"malformed pattern (ends with \"LUA_QL(\"%%\")\")\");\nreturn p+1;\n}\ncase'[':{\nif(*p=='^')p++;\ndo{\nif(*p=='\\0')\nluaL_error(ms->L,\"malformed pattern (missing \"LUA_QL(\"]\")\")\");\nif(*(p++)=='%'&&*p!='\\0')\np++;\n}while(*p!=']');\nreturn p+1;\n}\ndefault:{\nreturn p;\n}\n}\n}\nstatic int match_class(int c,int cl){\nint res;\nswitch(tolower(cl)){\ncase'a':res=isalpha(c);break;\ncase'c':res=iscntrl(c);break;\ncase'd':res=isdigit(c);break;\ncase'l':res=islower(c);break;\ncase'p':res=ispunct(c);break;\ncase's':res=isspace(c);break;\ncase'u':res=isupper(c);break;\ncase'w':res=isalnum(c);break;\ncase'x':res=isxdigit(c);break;\ncase'z':res=(c==0);break;\ndefault:return(cl==c);\n}\nreturn(islower(cl)?res:!res);\n}\nstatic int matchbracketclass(int c,const char*p,const char*ec){\nint sig=1;\nif(*(p+1)=='^'){\nsig=0;\np++;\n}\nwhile(++p<ec){\nif(*p=='%'){\np++;\nif(match_class(c,uchar(*p)))\nreturn sig;\n}\nelse if((*(p+1)=='-')&&(p+2<ec)){\np+=2;\nif(uchar(*(p-2))<=c&&c<=uchar(*p))\nreturn sig;\n}\nelse if(uchar(*p)==c)return sig;\n}\nreturn!sig;\n}\nstatic int singlematch(int c,const char*p,const char*ep){\nswitch(*p){\ncase'.':return 1;\ncase'%':return match_class(c,uchar(*(p+1)));\ncase'[':return matchbracketclass(c,p,ep-1);\ndefault:return(uchar(*p)==c);\n}\n}\nstatic const char*match(MatchState*ms,const char*s,const char*p);\nstatic const char*matchbalance(MatchState*ms,const char*s,\nconst char*p){\nif(*p==0||*(p+1)==0)\nluaL_error(ms->L,\"unbalanced pattern\");\nif(*s!=*p)return NULL;\nelse{\nint b=*p;\nint e=*(p+1);\nint cont=1;\nwhile(++s<ms->src_end){\nif(*s==e){\nif(--cont==0)return s+1;\n}\nelse if(*s==b)cont++;\n}\n}\nreturn NULL;\n}\nstatic const char*max_expand(MatchState*ms,const char*s,\nconst char*p,const char*ep){\nptrdiff_t i=0;\nwhile((s+i)<ms->src_end&&singlematch(uchar(*(s+i)),p,ep))\ni++;\nwhile(i>=0){\nconst char*res=match(ms,(s+i),ep+1);\nif(res)return res;\ni--;\n}\nreturn NULL;\n}\nstatic const char*min_expand(MatchState*ms,const char*s,\nconst char*p,const char*ep){\nfor(;;){\nconst char*res=match(ms,s,ep+1);\nif(res!=NULL)\nreturn res;\nelse if(s<ms->src_end&&singlematch(uchar(*s),p,ep))\ns++;\nelse return NULL;\n}\n}\nstatic const char*start_capture(MatchState*ms,const char*s,\nconst char*p,int what){\nconst char*res;\nint level=ms->level;\nif(level>=32)luaL_error(ms->L,\"too many captures\");\nms->capture[level].init=s;\nms->capture[level].len=what;\nms->level=level+1;\nif((res=match(ms,s,p))==NULL)\nms->level--;\nreturn res;\n}\nstatic const char*end_capture(MatchState*ms,const char*s,\nconst char*p){\nint l=capture_to_close(ms);\nconst char*res;\nms->capture[l].len=s-ms->capture[l].init;\nif((res=match(ms,s,p))==NULL)\nms->capture[l].len=(-1);\nreturn res;\n}\nstatic const char*match_capture(MatchState*ms,const char*s,int l){\nsize_t len;\nl=check_capture(ms,l);\nlen=ms->capture[l].len;\nif((size_t)(ms->src_end-s)>=len&&\nmemcmp(ms->capture[l].init,s,len)==0)\nreturn s+len;\nelse return NULL;\n}\nstatic const char*match(MatchState*ms,const char*s,const char*p){\ninit:\nswitch(*p){\ncase'(':{\nif(*(p+1)==')')\nreturn start_capture(ms,s,p+2,(-2));\nelse\nreturn start_capture(ms,s,p+1,(-1));\n}\ncase')':{\nreturn end_capture(ms,s,p+1);\n}\ncase'%':{\nswitch(*(p+1)){\ncase'b':{\ns=matchbalance(ms,s,p+2);\nif(s==NULL)return NULL;\np+=4;goto init;\n}\ncase'f':{\nconst char*ep;char previous;\np+=2;\nif(*p!='[')\nluaL_error(ms->L,\"missing \"LUA_QL(\"[\")\" after \"\nLUA_QL(\"%%f\")\" in pattern\");\nep=classend(ms,p);\nprevious=(s==ms->src_init)?'\\0':*(s-1);\nif(matchbracketclass(uchar(previous),p,ep-1)||\n!matchbracketclass(uchar(*s),p,ep-1))return NULL;\np=ep;goto init;\n}\ndefault:{\nif(isdigit(uchar(*(p+1)))){\ns=match_capture(ms,s,uchar(*(p+1)));\nif(s==NULL)return NULL;\np+=2;goto init;\n}\ngoto dflt;\n}\n}\n}\ncase'\\0':{\nreturn s;\n}\ncase'$':{\nif(*(p+1)=='\\0')\nreturn(s==ms->src_end)?s:NULL;\nelse goto dflt;\n}\ndefault:dflt:{\nconst char*ep=classend(ms,p);\nint m=s<ms->src_end&&singlematch(uchar(*s),p,ep);\nswitch(*ep){\ncase'?':{\nconst char*res;\nif(m&&((res=match(ms,s+1,ep+1))!=NULL))\nreturn res;\np=ep+1;goto init;\n}\ncase'*':{\nreturn max_expand(ms,s,p,ep);\n}\ncase'+':{\nreturn(m?max_expand(ms,s+1,p,ep):NULL);\n}\ncase'-':{\nreturn min_expand(ms,s,p,ep);\n}\ndefault:{\nif(!m)return NULL;\ns++;p=ep;goto init;\n}\n}\n}\n}\n}\nstatic const char*lmemfind(const char*s1,size_t l1,\nconst char*s2,size_t l2){\nif(l2==0)return s1;\nelse if(l2>l1)return NULL;\nelse{\nconst char*init;\nl2--;\nl1=l1-l2;\nwhile(l1>0&&(init=(const char*)memchr(s1,*s2,l1))!=NULL){\ninit++;\nif(memcmp(init,s2+1,l2)==0)\nreturn init-1;\nelse{\nl1-=init-s1;\ns1=init;\n}\n}\nreturn NULL;\n}\n}\nstatic void push_onecapture(MatchState*ms,int i,const char*s,\nconst char*e){\nif(i>=ms->level){\nif(i==0)\nlua_pushlstring(ms->L,s,e-s);\nelse\nluaL_error(ms->L,\"invalid capture index\");\n}\nelse{\nptrdiff_t l=ms->capture[i].len;\nif(l==(-1))luaL_error(ms->L,\"unfinished capture\");\nif(l==(-2))\nlua_pushinteger(ms->L,ms->capture[i].init-ms->src_init+1);\nelse\nlua_pushlstring(ms->L,ms->capture[i].init,l);\n}\n}\nstatic int push_captures(MatchState*ms,const char*s,const char*e){\nint i;\nint nlevels=(ms->level==0&&s)?1:ms->level;\nluaL_checkstack(ms->L,nlevels,\"too many captures\");\nfor(i=0;i<nlevels;i++)\npush_onecapture(ms,i,s,e);\nreturn nlevels;\n}\nstatic int str_find_aux(lua_State*L,int find){\nsize_t l1,l2;\nconst char*s=luaL_checklstring(L,1,&l1);\nconst char*p=luaL_checklstring(L,2,&l2);\nptrdiff_t init=posrelat(luaL_optinteger(L,3,1),l1)-1;\nif(init<0)init=0;\nelse if((size_t)(init)>l1)init=(ptrdiff_t)l1;\nif(find&&(lua_toboolean(L,4)||\nstrpbrk(p,\"^$*+?.([%-\")==NULL)){\nconst char*s2=lmemfind(s+init,l1-init,p,l2);\nif(s2){\nlua_pushinteger(L,s2-s+1);\nlua_pushinteger(L,s2-s+l2);\nreturn 2;\n}\n}\nelse{\nMatchState ms;\nint anchor=(*p=='^')?(p++,1):0;\nconst char*s1=s+init;\nms.L=L;\nms.src_init=s;\nms.src_end=s+l1;\ndo{\nconst char*res;\nms.level=0;\nif((res=match(&ms,s1,p))!=NULL){\nif(find){\nlua_pushinteger(L,s1-s+1);\nlua_pushinteger(L,res-s);\nreturn push_captures(&ms,NULL,0)+2;\n}\nelse\nreturn push_captures(&ms,s1,res);\n}\n}while(s1++<ms.src_end&&!anchor);\n}\nlua_pushnil(L);\nreturn 1;\n}\nstatic int str_find(lua_State*L){\nreturn str_find_aux(L,1);\n}\nstatic int str_match(lua_State*L){\nreturn str_find_aux(L,0);\n}\nstatic int gmatch_aux(lua_State*L){\nMatchState ms;\nsize_t ls;\nconst char*s=lua_tolstring(L,lua_upvalueindex(1),&ls);\nconst char*p=lua_tostring(L,lua_upvalueindex(2));\nconst char*src;\nms.L=L;\nms.src_init=s;\nms.src_end=s+ls;\nfor(src=s+(size_t)lua_tointeger(L,lua_upvalueindex(3));\nsrc<=ms.src_end;\nsrc++){\nconst char*e;\nms.level=0;\nif((e=match(&ms,src,p))!=NULL){\nlua_Integer newstart=e-s;\nif(e==src)newstart++;\nlua_pushinteger(L,newstart);\nlua_replace(L,lua_upvalueindex(3));\nreturn push_captures(&ms,src,e);\n}\n}\nreturn 0;\n}\nstatic int gmatch(lua_State*L){\nluaL_checkstring(L,1);\nluaL_checkstring(L,2);\nlua_settop(L,2);\nlua_pushinteger(L,0);\nlua_pushcclosure(L,gmatch_aux,3);\nreturn 1;\n}\nstatic void add_s(MatchState*ms,luaL_Buffer*b,const char*s,\nconst char*e){\nsize_t l,i;\nconst char*news=lua_tolstring(ms->L,3,&l);\nfor(i=0;i<l;i++){\nif(news[i]!='%')\nluaL_addchar(b,news[i]);\nelse{\ni++;\nif(!isdigit(uchar(news[i])))\nluaL_addchar(b,news[i]);\nelse if(news[i]=='0')\nluaL_addlstring(b,s,e-s);\nelse{\npush_onecapture(ms,news[i]-'1',s,e);\nluaL_addvalue(b);\n}\n}\n}\n}\nstatic void add_value(MatchState*ms,luaL_Buffer*b,const char*s,\nconst char*e){\nlua_State*L=ms->L;\nswitch(lua_type(L,3)){\ncase 3:\ncase 4:{\nadd_s(ms,b,s,e);\nreturn;\n}\ncase 6:{\nint n;\nlua_pushvalue(L,3);\nn=push_captures(ms,s,e);\nlua_call(L,n,1);\nbreak;\n}\ncase 5:{\npush_onecapture(ms,0,s,e);\nlua_gettable(L,3);\nbreak;\n}\n}\nif(!lua_toboolean(L,-1)){\nlua_pop(L,1);\nlua_pushlstring(L,s,e-s);\n}\nelse if(!lua_isstring(L,-1))\nluaL_error(L,\"invalid replacement value (a %s)\",luaL_typename(L,-1));\nluaL_addvalue(b);\n}\nstatic int str_gsub(lua_State*L){\nsize_t srcl;\nconst char*src=luaL_checklstring(L,1,&srcl);\nconst char*p=luaL_checkstring(L,2);\nint tr=lua_type(L,3);\nint max_s=luaL_optint(L,4,srcl+1);\nint anchor=(*p=='^')?(p++,1):0;\nint n=0;\nMatchState ms;\nluaL_Buffer b;\nluaL_argcheck(L,tr==3||tr==4||\ntr==6||tr==5,3,\n\"string/function/table expected\");\nluaL_buffinit(L,&b);\nms.L=L;\nms.src_init=src;\nms.src_end=src+srcl;\nwhile(n<max_s){\nconst char*e;\nms.level=0;\ne=match(&ms,src,p);\nif(e){\nn++;\nadd_value(&ms,&b,src,e);\n}\nif(e&&e>src)\nsrc=e;\nelse if(src<ms.src_end)\nluaL_addchar(&b,*src++);\nelse break;\nif(anchor)break;\n}\nluaL_addlstring(&b,src,ms.src_end-src);\nluaL_pushresult(&b);\nlua_pushinteger(L,n);\nreturn 2;\n}\nstatic void addquoted(lua_State*L,luaL_Buffer*b,int arg){\nsize_t l;\nconst char*s=luaL_checklstring(L,arg,&l);\nluaL_addchar(b,'\"');\nwhile(l--){\nswitch(*s){\ncase'\"':case'\\\\':case'\\n':{\nluaL_addchar(b,'\\\\');\nluaL_addchar(b,*s);\nbreak;\n}\ncase'\\r':{\nluaL_addlstring(b,\"\\\\r\",2);\nbreak;\n}\ncase'\\0':{\nluaL_addlstring(b,\"\\\\000\",4);\nbreak;\n}\ndefault:{\nluaL_addchar(b,*s);\nbreak;\n}\n}\ns++;\n}\nluaL_addchar(b,'\"');\n}\nstatic const char*scanformat(lua_State*L,const char*strfrmt,char*form){\nconst char*p=strfrmt;\nwhile(*p!='\\0'&&strchr(\"-+ #0\",*p)!=NULL)p++;\nif((size_t)(p-strfrmt)>=sizeof(\"-+ #0\"))\nluaL_error(L,\"invalid format (repeated flags)\");\nif(isdigit(uchar(*p)))p++;\nif(isdigit(uchar(*p)))p++;\nif(*p=='.'){\np++;\nif(isdigit(uchar(*p)))p++;\nif(isdigit(uchar(*p)))p++;\n}\nif(isdigit(uchar(*p)))\nluaL_error(L,\"invalid format (width or precision too long)\");\n*(form++)='%';\nstrncpy(form,strfrmt,p-strfrmt+1);\nform+=p-strfrmt+1;\n*form='\\0';\nreturn p;\n}\nstatic void addintlen(char*form){\nsize_t l=strlen(form);\nchar spec=form[l-1];\nstrcpy(form+l-1,\"l\");\nform[l+sizeof(\"l\")-2]=spec;\nform[l+sizeof(\"l\")-1]='\\0';\n}\nstatic int str_format(lua_State*L){\nint top=lua_gettop(L);\nint arg=1;\nsize_t sfl;\nconst char*strfrmt=luaL_checklstring(L,arg,&sfl);\nconst char*strfrmt_end=strfrmt+sfl;\nluaL_Buffer b;\nluaL_buffinit(L,&b);\nwhile(strfrmt<strfrmt_end){\nif(*strfrmt!='%')\nluaL_addchar(&b,*strfrmt++);\nelse if(*++strfrmt=='%')\nluaL_addchar(&b,*strfrmt++);\nelse{\nchar form[(sizeof(\"-+ #0\")+sizeof(\"l\")+10)];\nchar buff[512];\nif(++arg>top)\nluaL_argerror(L,arg,\"no value\");\nstrfrmt=scanformat(L,strfrmt,form);\nswitch(*strfrmt++){\ncase'c':{\nsprintf(buff,form,(int)luaL_checknumber(L,arg));\nbreak;\n}\ncase'd':case'i':{\naddintlen(form);\nsprintf(buff,form,(long)luaL_checknumber(L,arg));\nbreak;\n}\ncase'o':case'u':case'x':case'X':{\naddintlen(form);\nsprintf(buff,form,(unsigned long)luaL_checknumber(L,arg));\nbreak;\n}\ncase'e':case'E':case'f':\ncase'g':case'G':{\nsprintf(buff,form,(double)luaL_checknumber(L,arg));\nbreak;\n}\ncase'q':{\naddquoted(L,&b,arg);\ncontinue;\n}\ncase's':{\nsize_t l;\nconst char*s=luaL_checklstring(L,arg,&l);\nif(!strchr(form,'.')&&l>=100){\nlua_pushvalue(L,arg);\nluaL_addvalue(&b);\ncontinue;\n}\nelse{\nsprintf(buff,form,s);\nbreak;\n}\n}\ndefault:{\nreturn luaL_error(L,\"invalid option \"LUA_QL(\"%%%c\")\" to \"\nLUA_QL(\"format\"),*(strfrmt-1));\n}\n}\nluaL_addlstring(&b,buff,strlen(buff));\n}\n}\nluaL_pushresult(&b);\nreturn 1;\n}\nstatic const luaL_Reg strlib[]={\n{\"byte\",str_byte},\n{\"char\",str_char},\n{\"find\",str_find},\n{\"format\",str_format},\n{\"gmatch\",gmatch},\n{\"gsub\",str_gsub},\n{\"lower\",str_lower},\n{\"match\",str_match},\n{\"rep\",str_rep},\n{\"sub\",str_sub},\n{\"upper\",str_upper},\n{NULL,NULL}\n};\nstatic void createmetatable(lua_State*L){\nlua_createtable(L,0,1);\nlua_pushliteral(L,\"\");\nlua_pushvalue(L,-2);\nlua_setmetatable(L,-2);\nlua_pop(L,1);\nlua_pushvalue(L,-2);\nlua_setfield(L,-2,\"__index\");\nlua_pop(L,1);\n}\nstatic int luaopen_string(lua_State*L){\nluaL_register(L,\"string\",strlib);\ncreatemetatable(L);\nreturn 1;\n}\nstatic const luaL_Reg lualibs[]={\n{\"\",luaopen_base},\n{\"table\",luaopen_table},\n{\"io\",luaopen_io},\n{\"os\",luaopen_os},\n{\"string\",luaopen_string},\n{NULL,NULL}\n};\nstatic void luaL_openlibs(lua_State*L){\nconst luaL_Reg*lib=lualibs;\nfor(;lib->func;lib++){\nlua_pushcfunction(L,lib->func);\nlua_pushstring(L,lib->name);\nlua_call(L,1,0);\n}\n}\ntypedef unsigned int UB;\nstatic UB barg(lua_State*L,int idx){\nunion{lua_Number n;U64 b;}bn;\nbn.n=lua_tonumber(L,idx)+6755399441055744.0;\nif(bn.n==0.0&&!lua_isnumber(L,idx))luaL_typerror(L,idx,\"number\");\nreturn(UB)bn.b;\n}\n#define BRET(b)lua_pushnumber(L,(lua_Number)(int)(b));return 1;\nstatic int tobit(lua_State*L){\nBRET(barg(L,1))}\nstatic int bnot(lua_State*L){\nBRET(~barg(L,1))}\nstatic int band(lua_State*L){\nint i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b&=barg(L,i);BRET(b)}\nstatic int bor(lua_State*L){\nint i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b|=barg(L,i);BRET(b)}\nstatic int bxor(lua_State*L){\nint i;UB b=barg(L,1);for(i=lua_gettop(L);i>1;i--)b^=barg(L,i);BRET(b)}\nstatic int lshift(lua_State*L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET(b<<n)}\nstatic int rshift(lua_State*L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET(b>>n)}\nstatic int arshift(lua_State*L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET((int)b>>n)}\nstatic int rol(lua_State*L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET((b<<n)|(b>>(32-n)))}\nstatic int ror(lua_State*L){\nUB b=barg(L,1),n=barg(L,2)&31;BRET((b>>n)|(b<<(32-n)))}\nstatic int bswap(lua_State*L){\nUB b=barg(L,1);b=(b>>24)|((b>>8)&0xff00)|((b&0xff00)<<8)|(b<<24);BRET(b)}\nstatic int tohex(lua_State*L){\nUB b=barg(L,1);\nint n=lua_isnone(L,2)?8:(int)barg(L,2);\nconst char*hexdigits=\"0123456789abcdef\";\nchar buf[8];\nint i;\nif(n<0){n=-n;hexdigits=\"0123456789ABCDEF\";}\nif(n>8)n=8;\nfor(i=(int)n;--i>=0;){buf[i]=hexdigits[b&15];b>>=4;}\nlua_pushlstring(L,buf,(size_t)n);\nreturn 1;\n}\nstatic const struct luaL_Reg bitlib[]={\n{\"tobit\",tobit},\n{\"bnot\",bnot},\n{\"band\",band},\n{\"bor\",bor},\n{\"bxor\",bxor},\n{\"lshift\",lshift},\n{\"rshift\",rshift},\n{\"arshift\",arshift},\n{\"rol\",rol},\n{\"ror\",ror},\n{\"bswap\",bswap},\n{\"tohex\",tohex},\n{NULL,NULL}\n};\nint main(int argc,char**argv){\nlua_State*L=luaL_newstate();\nint i;\nluaL_openlibs(L);\nluaL_register(L,\"bit\",bitlib);\nif(argc<2)return sizeof(void*);\nlua_createtable(L,0,1);\nlua_pushstring(L,argv[1]);\nlua_rawseti(L,-2,0);\nlua_setglobal(L,\"arg\");\nif(luaL_loadfile(L,argv[1]))\ngoto err;\nfor(i=2;i<argc;i++)\nlua_pushstring(L,argv[i]);\nif(lua_pcall(L,argc-2,0,0)){\nerr:\nfprintf(stderr,\"Error: %s\\n\",lua_tostring(L,-1));\nreturn 1;\n}\nlua_close(L);\nreturn 0;\n}\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/bc.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT bytecode listing module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n--\n-- This module lists the bytecode of a Lua function. If it's loaded by -jbc\n-- it hooks into the parser and lists all functions of a chunk as they\n-- are parsed.\n--\n-- Example usage:\n--\n--   luajit -jbc -e 'local x=0; for i=1,1e6 do x=x+i end; print(x)'\n--   luajit -jbc=- foo.lua\n--   luajit -jbc=foo.list foo.lua\n--\n-- Default output is to stderr. To redirect the output to a file, pass a\n-- filename as an argument (use '-' for stdout) or set the environment\n-- variable LUAJIT_LISTFILE. The file is overwritten every time the module\n-- is started.\n--\n-- This module can also be used programmatically:\n--\n--   local bc = require(\"jit.bc\")\n--\n--   local function foo() print(\"hello\") end\n--\n--   bc.dump(foo)           --> -- BYTECODE -- [...]\n--   print(bc.line(foo, 2)) --> 0002    KSTR     1   1      ; \"hello\"\n--\n--   local out = {\n--     -- Do something with each line:\n--     write = function(t, ...) io.write(...) end,\n--     close = function(t) end,\n--     flush = function(t) end,\n--   }\n--   bc.dump(foo, out)\n--\n------------------------------------------------------------------------------\n\n-- Cache some library functions and objects.\nlocal jit = require(\"jit\")\nassert(jit.version_num == 20001, \"LuaJIT core/library version mismatch\")\nlocal jutil = require(\"jit.util\")\nlocal vmdef = require(\"jit.vmdef\")\nlocal bit = require(\"bit\")\nlocal sub, gsub, format = string.sub, string.gsub, string.format\nlocal byte, band, shr = string.byte, bit.band, bit.rshift\nlocal funcinfo, funcbc, funck = jutil.funcinfo, jutil.funcbc, jutil.funck\nlocal funcuvname = jutil.funcuvname\nlocal bcnames = vmdef.bcnames\nlocal stdout, stderr = io.stdout, io.stderr\n\n------------------------------------------------------------------------------\n\nlocal function ctlsub(c)\n  if c == \"\\n\" then return \"\\\\n\"\n  elseif c == \"\\r\" then return \"\\\\r\"\n  elseif c == \"\\t\" then return \"\\\\t\"\n  else return format(\"\\\\%03d\", byte(c))\n  end\nend\n\n-- Return one bytecode line.\nlocal function bcline(func, pc, prefix)\n  local ins, m = funcbc(func, pc)\n  if not ins then return end\n  local ma, mb, mc = band(m, 7), band(m, 15*8), band(m, 15*128)\n  local a = band(shr(ins, 8), 0xff)\n  local oidx = 6*band(ins, 0xff)\n  local op = sub(bcnames, oidx+1, oidx+6)\n  local s = format(\"%04d %s %-6s %3s \",\n    pc, prefix or \"  \", op, ma == 0 and \"\" or a)\n  local d = shr(ins, 16)\n  if mc == 13*128 then -- BCMjump\n    return format(\"%s=> %04d\\n\", s, pc+d-0x7fff)\n  end\n  if mb ~= 0 then\n    d = band(d, 0xff)\n  elseif mc == 0 then\n    return s..\"\\n\"\n  end\n  local kc\n  if mc == 10*128 then -- BCMstr\n    kc = funck(func, -d-1)\n    kc = format(#kc > 40 and '\"%.40s\"~' or '\"%s\"', gsub(kc, \"%c\", ctlsub))\n  elseif mc == 9*128 then -- BCMnum\n    kc = funck(func, d)\n    if op == \"TSETM \" then kc = kc - 2^52 end\n  elseif mc == 12*128 then -- BCMfunc\n    local fi = funcinfo(funck(func, -d-1))\n    if fi.ffid then\n      kc = vmdef.ffnames[fi.ffid]\n    else\n      kc = fi.loc\n    end\n  elseif mc == 5*128 then -- BCMuv\n    kc = funcuvname(func, d)\n  end\n  if ma == 5 then -- BCMuv\n    local ka = funcuvname(func, a)\n    if kc then kc = ka..\" ; \"..kc else kc = ka end\n  end\n  if mb ~= 0 then\n    local b = shr(ins, 24)\n    if kc then return format(\"%s%3d %3d  ; %s\\n\", s, b, d, kc) end\n    return format(\"%s%3d %3d\\n\", s, b, d)\n  end\n  if kc then return format(\"%s%3d      ; %s\\n\", s, d, kc) end\n  if mc == 7*128 and d > 32767 then d = d - 65536 end -- BCMlits\n  return format(\"%s%3d\\n\", s, d)\nend\n\n-- Collect branch targets of a function.\nlocal function bctargets(func)\n  local target = {}\n  for pc=1,1000000000 do\n    local ins, m = funcbc(func, pc)\n    if not ins then break end\n    if band(m, 15*128) == 13*128 then target[pc+shr(ins, 16)-0x7fff] = true end\n  end\n  return target\nend\n\n-- Dump bytecode instructions of a function.\nlocal function bcdump(func, out, all)\n  if not out then out = stdout end\n  local fi = funcinfo(func)\n  if all and fi.children then\n    for n=-1,-1000000000,-1 do\n      local k = funck(func, n)\n      if not k then break end\n      if type(k) == \"proto\" then bcdump(k, out, true) end\n    end\n  end\n  out:write(format(\"-- BYTECODE -- %s-%d\\n\", fi.loc, fi.lastlinedefined))\n  local target = bctargets(func)\n  for pc=1,1000000000 do\n    local s = bcline(func, pc, target[pc] and \"=>\")\n    if not s then break end\n    out:write(s)\n  end\n  out:write(\"\\n\")\n  out:flush()\nend\n\n------------------------------------------------------------------------------\n\n-- Active flag and output file handle.\nlocal active, out\n\n-- List handler.\nlocal function h_list(func)\n  return bcdump(func, out)\nend\n\n-- Detach list handler.\nlocal function bclistoff()\n  if active then\n    active = false\n    jit.attach(h_list)\n    if out and out ~= stdout and out ~= stderr then out:close() end\n    out = nil\n  end\nend\n\n-- Open the output file and attach list handler.\nlocal function bcliston(outfile)\n  if active then bclistoff() end\n  if not outfile then outfile = os.getenv(\"LUAJIT_LISTFILE\") end\n  if outfile then\n    out = outfile == \"-\" and stdout or assert(io.open(outfile, \"w\"))\n  else\n    out = stderr\n  end\n  jit.attach(h_list, \"bc\")\n  active = true\nend\n\n-- Public module functions.\nmodule(...)\n\nline = bcline\ndump = bcdump\ntargets = bctargets\n\non = bcliston\noff = bclistoff\nstart = bcliston -- For -j command line option.\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/bcsave.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT module to save/list bytecode.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n--\n-- This module saves or lists the bytecode for an input file.\n-- It's run by the -b command line option.\n--\n------------------------------------------------------------------------------\n\nlocal jit = require(\"jit\")\nassert(jit.version_num == 20001, \"LuaJIT core/library version mismatch\")\nlocal bit = require(\"bit\")\n\n-- Symbol name prefix for LuaJIT bytecode.\nlocal LJBC_PREFIX = \"luaJIT_BC_\"\n\n------------------------------------------------------------------------------\n\nlocal function usage()\n  io.stderr:write[[\nSave LuaJIT bytecode: luajit -b[options] input output\n  -l        Only list bytecode.\n  -s        Strip debug info (default).\n  -g        Keep debug info.\n  -n name   Set module name (default: auto-detect from input name).\n  -t type   Set output file type (default: auto-detect from output name).\n  -a arch   Override architecture for object files (default: native).\n  -o os     Override OS for object files (default: native).\n  -e chunk  Use chunk string as input.\n  --        Stop handling options.\n  -         Use stdin as input and/or stdout as output.\n\nFile types: c h obj o raw (default)\n]]\n  os.exit(1)\nend\n\nlocal function check(ok, ...)\n  if ok then return ok, ... end\n  io.stderr:write(\"luajit: \", ...)\n  io.stderr:write(\"\\n\")\n  os.exit(1)\nend\n\nlocal function readfile(input)\n  if type(input) == \"function\" then return input end\n  if input == \"-\" then input = nil end\n  return check(loadfile(input))\nend\n\nlocal function savefile(name, mode)\n  if name == \"-\" then return io.stdout end\n  return check(io.open(name, mode))\nend\n\n------------------------------------------------------------------------------\n\nlocal map_type = {\n  raw = \"raw\", c = \"c\", h = \"h\", o = \"obj\", obj = \"obj\",\n}\n\nlocal map_arch = {\n  x86 = true, x64 = true, arm = true, ppc = true, ppcspe = true,\n  mips = true, mipsel = true,\n}\n\nlocal map_os = {\n  linux = true, windows = true, osx = true, freebsd = true, netbsd = true,\n  openbsd = true, solaris = true,\n}\n\nlocal function checkarg(str, map, err)\n  str = string.lower(str)\n  local s = check(map[str], \"unknown \", err)\n  return s == true and str or s\nend\n\nlocal function detecttype(str)\n  local ext = string.match(string.lower(str), \"%.(%a+)$\")\n  return map_type[ext] or \"raw\"\nend\n\nlocal function checkmodname(str)\n  check(string.match(str, \"^[%w_.%-]+$\"), \"bad module name\")\n  return string.gsub(str, \"[%.%-]\", \"_\")\nend\n\nlocal function detectmodname(str)\n  if type(str) == \"string\" then\n    local tail = string.match(str, \"[^/\\\\]+$\")\n    if tail then str = tail end\n    local head = string.match(str, \"^(.*)%.[^.]*$\")\n    if head then str = head end\n    str = string.match(str, \"^[%w_.%-]+\")\n  else\n    str = nil\n  end\n  check(str, \"cannot derive module name, use -n name\")\n  return string.gsub(str, \"[%.%-]\", \"_\")\nend\n\n------------------------------------------------------------------------------\n\nlocal function bcsave_tail(fp, output, s)\n  local ok, err = fp:write(s)\n  if ok and output ~= \"-\" then ok, err = fp:close() end\n  check(ok, \"cannot write \", output, \": \", err)\nend\n\nlocal function bcsave_raw(output, s)\n  local fp = savefile(output, \"wb\")\n  bcsave_tail(fp, output, s)\nend\n\nlocal function bcsave_c(ctx, output, s)\n  local fp = savefile(output, \"w\")\n  if ctx.type == \"c\" then\n    fp:write(string.format([[\n#ifdef _cplusplus\nextern \"C\"\n#endif\n#ifdef _WIN32\n__declspec(dllexport)\n#endif\nconst char %s%s[] = {\n]], LJBC_PREFIX, ctx.modname))\n  else\n    fp:write(string.format([[\n#define %s%s_SIZE %d\nstatic const char %s%s[] = {\n]], LJBC_PREFIX, ctx.modname, #s, LJBC_PREFIX, ctx.modname))\n  end\n  local t, n, m = {}, 0, 0\n  for i=1,#s do\n    local b = tostring(string.byte(s, i))\n    m = m + #b + 1\n    if m > 78 then\n      fp:write(table.concat(t, \",\", 1, n), \",\\n\")\n      n, m = 0, #b + 1\n    end\n    n = n + 1\n    t[n] = b\n  end\n  bcsave_tail(fp, output, table.concat(t, \",\", 1, n)..\"\\n};\\n\")\nend\n\nlocal function bcsave_elfobj(ctx, output, s, ffi)\n  ffi.cdef[[\ntypedef struct {\n  uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7];\n  uint16_t type, machine;\n  uint32_t version;\n  uint32_t entry, phofs, shofs;\n  uint32_t flags;\n  uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx;\n} ELF32header;\ntypedef struct {\n  uint8_t emagic[4], eclass, eendian, eversion, eosabi, eabiversion, epad[7];\n  uint16_t type, machine;\n  uint32_t version;\n  uint64_t entry, phofs, shofs;\n  uint32_t flags;\n  uint16_t ehsize, phentsize, phnum, shentsize, shnum, shstridx;\n} ELF64header;\ntypedef struct {\n  uint32_t name, type, flags, addr, ofs, size, link, info, align, entsize;\n} ELF32sectheader;\ntypedef struct {\n  uint32_t name, type;\n  uint64_t flags, addr, ofs, size;\n  uint32_t link, info;\n  uint64_t align, entsize;\n} ELF64sectheader;\ntypedef struct {\n  uint32_t name, value, size;\n  uint8_t info, other;\n  uint16_t sectidx;\n} ELF32symbol;\ntypedef struct {\n  uint32_t name;\n  uint8_t info, other;\n  uint16_t sectidx;\n  uint64_t value, size;\n} ELF64symbol;\ntypedef struct {\n  ELF32header hdr;\n  ELF32sectheader sect[6];\n  ELF32symbol sym[2];\n  uint8_t space[4096];\n} ELF32obj;\ntypedef struct {\n  ELF64header hdr;\n  ELF64sectheader sect[6];\n  ELF64symbol sym[2];\n  uint8_t space[4096];\n} ELF64obj;\n]]\n  local symname = LJBC_PREFIX..ctx.modname\n  local is64, isbe = false, false\n  if ctx.arch == \"x64\" then\n    is64 = true\n  elseif ctx.arch == \"ppc\" or ctx.arch == \"ppcspe\" or ctx.arch == \"mips\" then\n    isbe = true\n  end\n\n  -- Handle different host/target endianess.\n  local function f32(x) return x end\n  local f16, fofs = f32, f32\n  if ffi.abi(\"be\") ~= isbe then\n    f32 = bit.bswap\n    function f16(x) return bit.rshift(bit.bswap(x), 16) end\n    if is64 then\n      local two32 = ffi.cast(\"int64_t\", 2^32)\n      function fofs(x) return bit.bswap(x)*two32 end\n    else\n      fofs = f32\n    end\n  end\n\n  -- Create ELF object and fill in header.\n  local o = ffi.new(is64 and \"ELF64obj\" or \"ELF32obj\")\n  local hdr = o.hdr\n  if ctx.os == \"bsd\" or ctx.os == \"other\" then -- Determine native hdr.eosabi.\n    local bf = assert(io.open(\"/bin/ls\", \"rb\"))\n    local bs = bf:read(9)\n    bf:close()\n    ffi.copy(o, bs, 9)\n    check(hdr.emagic[0] == 127, \"no support for writing native object files\")\n  else\n    hdr.emagic = \"\\127ELF\"\n    hdr.eosabi = ({ freebsd=9, netbsd=2, openbsd=12, solaris=6 })[ctx.os] or 0\n  end\n  hdr.eclass = is64 and 2 or 1\n  hdr.eendian = isbe and 2 or 1\n  hdr.eversion = 1\n  hdr.type = f16(1)\n  hdr.machine = f16(({ x86=3, x64=62, arm=40, ppc=20, ppcspe=20, mips=8, mipsel=8 })[ctx.arch])\n  if ctx.arch == \"mips\" or ctx.arch == \"mipsel\" then\n    hdr.flags = 0x50001006\n  end\n  hdr.version = f32(1)\n  hdr.shofs = fofs(ffi.offsetof(o, \"sect\"))\n  hdr.ehsize = f16(ffi.sizeof(hdr))\n  hdr.shentsize = f16(ffi.sizeof(o.sect[0]))\n  hdr.shnum = f16(6)\n  hdr.shstridx = f16(2)\n\n  -- Fill in sections and symbols.\n  local sofs, ofs = ffi.offsetof(o, \"space\"), 1\n  for i,name in ipairs{\n      \".symtab\", \".shstrtab\", \".strtab\", \".rodata\", \".note.GNU-stack\",\n    } do\n    local sect = o.sect[i]\n    sect.align = fofs(1)\n    sect.name = f32(ofs)\n    ffi.copy(o.space+ofs, name)\n    ofs = ofs + #name+1\n  end\n  o.sect[1].type = f32(2) -- .symtab\n  o.sect[1].link = f32(3)\n  o.sect[1].info = f32(1)\n  o.sect[1].align = fofs(8)\n  o.sect[1].ofs = fofs(ffi.offsetof(o, \"sym\"))\n  o.sect[1].entsize = fofs(ffi.sizeof(o.sym[0]))\n  o.sect[1].size = fofs(ffi.sizeof(o.sym))\n  o.sym[1].name = f32(1)\n  o.sym[1].sectidx = f16(4)\n  o.sym[1].size = fofs(#s)\n  o.sym[1].info = 17\n  o.sect[2].type = f32(3) -- .shstrtab\n  o.sect[2].ofs = fofs(sofs)\n  o.sect[2].size = fofs(ofs)\n  o.sect[3].type = f32(3) -- .strtab\n  o.sect[3].ofs = fofs(sofs + ofs)\n  o.sect[3].size = fofs(#symname+1)\n  ffi.copy(o.space+ofs+1, symname)\n  ofs = ofs + #symname + 2\n  o.sect[4].type = f32(1) -- .rodata\n  o.sect[4].flags = fofs(2)\n  o.sect[4].ofs = fofs(sofs + ofs)\n  o.sect[4].size = fofs(#s)\n  o.sect[5].type = f32(1) -- .note.GNU-stack\n  o.sect[5].ofs = fofs(sofs + ofs + #s)\n\n  -- Write ELF object file.\n  local fp = savefile(output, \"wb\")\n  fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs))\n  bcsave_tail(fp, output, s)\nend\n\nlocal function bcsave_peobj(ctx, output, s, ffi)\n  ffi.cdef[[\ntypedef struct {\n  uint16_t arch, nsects;\n  uint32_t time, symtabofs, nsyms;\n  uint16_t opthdrsz, flags;\n} PEheader;\ntypedef struct {\n  char name[8];\n  uint32_t vsize, vaddr, size, ofs, relocofs, lineofs;\n  uint16_t nreloc, nline;\n  uint32_t flags;\n} PEsection;\ntypedef struct __attribute((packed)) {\n  union {\n    char name[8];\n    uint32_t nameref[2];\n  };\n  uint32_t value;\n  int16_t sect;\n  uint16_t type;\n  uint8_t scl, naux;\n} PEsym;\ntypedef struct __attribute((packed)) {\n  uint32_t size;\n  uint16_t nreloc, nline;\n  uint32_t cksum;\n  uint16_t assoc;\n  uint8_t comdatsel, unused[3];\n} PEsymaux;\ntypedef struct {\n  PEheader hdr;\n  PEsection sect[2];\n  // Must be an even number of symbol structs.\n  PEsym sym0;\n  PEsymaux sym0aux;\n  PEsym sym1;\n  PEsymaux sym1aux;\n  PEsym sym2;\n  PEsym sym3;\n  uint32_t strtabsize;\n  uint8_t space[4096];\n} PEobj;\n]]\n  local symname = LJBC_PREFIX..ctx.modname\n  local is64 = false\n  if ctx.arch == \"x86\" then\n    symname = \"_\"..symname\n  elseif ctx.arch == \"x64\" then\n    is64 = true\n  end\n  local symexport = \"   /EXPORT:\"..symname..\",DATA \"\n\n  -- The file format is always little-endian. Swap if the host is big-endian.\n  local function f32(x) return x end\n  local f16 = f32\n  if ffi.abi(\"be\") then\n    f32 = bit.bswap\n    function f16(x) return bit.rshift(bit.bswap(x), 16) end\n  end\n\n  -- Create PE object and fill in header.\n  local o = ffi.new(\"PEobj\")\n  local hdr = o.hdr\n  hdr.arch = f16(({ x86=0x14c, x64=0x8664, arm=0x1c0, ppc=0x1f2, mips=0x366, mipsel=0x366 })[ctx.arch])\n  hdr.nsects = f16(2)\n  hdr.symtabofs = f32(ffi.offsetof(o, \"sym0\"))\n  hdr.nsyms = f32(6)\n\n  -- Fill in sections and symbols.\n  o.sect[0].name = \".drectve\"\n  o.sect[0].size = f32(#symexport)\n  o.sect[0].flags = f32(0x00100a00)\n  o.sym0.sect = f16(1)\n  o.sym0.scl = 3\n  o.sym0.name = \".drectve\"\n  o.sym0.naux = 1\n  o.sym0aux.size = f32(#symexport)\n  o.sect[1].name = \".rdata\"\n  o.sect[1].size = f32(#s)\n  o.sect[1].flags = f32(0x40300040)\n  o.sym1.sect = f16(2)\n  o.sym1.scl = 3\n  o.sym1.name = \".rdata\"\n  o.sym1.naux = 1\n  o.sym1aux.size = f32(#s)\n  o.sym2.sect = f16(2)\n  o.sym2.scl = 2\n  o.sym2.nameref[1] = f32(4)\n  o.sym3.sect = f16(-1)\n  o.sym3.scl = 2\n  o.sym3.value = f32(1)\n  o.sym3.name = \"@feat.00\" -- Mark as SafeSEH compliant.\n  ffi.copy(o.space, symname)\n  local ofs = #symname + 1\n  o.strtabsize = f32(ofs + 4)\n  o.sect[0].ofs = f32(ffi.offsetof(o, \"space\") + ofs)\n  ffi.copy(o.space + ofs, symexport)\n  ofs = ofs + #symexport\n  o.sect[1].ofs = f32(ffi.offsetof(o, \"space\") + ofs)\n\n  -- Write PE object file.\n  local fp = savefile(output, \"wb\")\n  fp:write(ffi.string(o, ffi.sizeof(o)-4096+ofs))\n  bcsave_tail(fp, output, s)\nend\n\nlocal function bcsave_machobj(ctx, output, s, ffi)\n  ffi.cdef[[\ntypedef struct\n{\n  uint32_t magic, cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags;\n} mach_header;\ntypedef struct\n{\n  mach_header; uint32_t reserved;\n} mach_header_64;\ntypedef struct {\n  uint32_t cmd, cmdsize;\n  char segname[16];\n  uint32_t vmaddr, vmsize, fileoff, filesize;\n  uint32_t maxprot, initprot, nsects, flags;\n} mach_segment_command;\ntypedef struct {\n  uint32_t cmd, cmdsize;\n  char segname[16];\n  uint64_t vmaddr, vmsize, fileoff, filesize;\n  uint32_t maxprot, initprot, nsects, flags;\n} mach_segment_command_64;\ntypedef struct {\n  char sectname[16], segname[16];\n  uint32_t addr, size;\n  uint32_t offset, align, reloff, nreloc, flags;\n  uint32_t reserved1, reserved2;\n} mach_section;\ntypedef struct {\n  char sectname[16], segname[16];\n  uint64_t addr, size;\n  uint32_t offset, align, reloff, nreloc, flags;\n  uint32_t reserved1, reserved2, reserved3;\n} mach_section_64;\ntypedef struct {\n  uint32_t cmd, cmdsize, symoff, nsyms, stroff, strsize;\n} mach_symtab_command;\ntypedef struct {\n  int32_t strx;\n  uint8_t type, sect;\n  int16_t desc;\n  uint32_t value;\n} mach_nlist;\ntypedef struct {\n  uint32_t strx;\n  uint8_t type, sect;\n  uint16_t desc;\n  uint64_t value;\n} mach_nlist_64;\ntypedef struct\n{\n  uint32_t magic, nfat_arch;\n} mach_fat_header;\ntypedef struct\n{\n  uint32_t cputype, cpusubtype, offset, size, align;\n} mach_fat_arch;\ntypedef struct {\n  struct {\n    mach_header hdr;\n    mach_segment_command seg;\n    mach_section sec;\n    mach_symtab_command sym;\n  } arch[1];\n  mach_nlist sym_entry;\n  uint8_t space[4096];\n} mach_obj;\ntypedef struct {\n  struct {\n    mach_header_64 hdr;\n    mach_segment_command_64 seg;\n    mach_section_64 sec;\n    mach_symtab_command sym;\n  } arch[1];\n  mach_nlist_64 sym_entry;\n  uint8_t space[4096];\n} mach_obj_64;\ntypedef struct {\n  mach_fat_header fat;\n  mach_fat_arch fat_arch[4];\n  struct {\n    mach_header hdr;\n    mach_segment_command seg;\n    mach_section sec;\n    mach_symtab_command sym;\n  } arch[4];\n  mach_nlist sym_entry;\n  uint8_t space[4096];\n} mach_fat_obj;\n]]\n  local symname = '_'..LJBC_PREFIX..ctx.modname\n  local isfat, is64, align, mobj = false, false, 4, \"mach_obj\"\n  if ctx.arch == \"x64\" then\n    is64, align, mobj = true, 8, \"mach_obj_64\"\n  elseif ctx.arch == \"arm\" then\n    isfat, mobj = true, \"mach_fat_obj\"\n  else\n    check(ctx.arch == \"x86\", \"unsupported architecture for OSX\")\n  end\n  local function aligned(v, a) return bit.band(v+a-1, -a) end\n  local be32 = bit.bswap -- Mach-O FAT is BE, supported archs are LE.\n\n  -- Create Mach-O object and fill in header.\n  local o = ffi.new(mobj)\n  local mach_size = aligned(ffi.offsetof(o, \"space\")+#symname+2, align)\n  local cputype = ({ x86={7}, x64={0x01000007}, arm={7,12,12,12} })[ctx.arch]\n  local cpusubtype = ({ x86={3}, x64={3}, arm={3,6,9,11} })[ctx.arch]\n  if isfat then\n    o.fat.magic = be32(0xcafebabe)\n    o.fat.nfat_arch = be32(#cpusubtype)\n  end\n\n  -- Fill in sections and symbols.\n  for i=0,#cpusubtype-1 do\n    local ofs = 0\n    if isfat then\n      local a = o.fat_arch[i]\n      a.cputype = be32(cputype[i+1])\n      a.cpusubtype = be32(cpusubtype[i+1])\n      -- Subsequent slices overlap each other to share data.\n      ofs = ffi.offsetof(o, \"arch\") + i*ffi.sizeof(o.arch[0])\n      a.offset = be32(ofs)\n      a.size = be32(mach_size-ofs+#s)\n    end\n    local a = o.arch[i]\n    a.hdr.magic = is64 and 0xfeedfacf or 0xfeedface\n    a.hdr.cputype = cputype[i+1]\n    a.hdr.cpusubtype = cpusubtype[i+1]\n    a.hdr.filetype = 1\n    a.hdr.ncmds = 2\n    a.hdr.sizeofcmds = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)+ffi.sizeof(a.sym)\n    a.seg.cmd = is64 and 0x19 or 0x1\n    a.seg.cmdsize = ffi.sizeof(a.seg)+ffi.sizeof(a.sec)\n    a.seg.vmsize = #s\n    a.seg.fileoff = mach_size-ofs\n    a.seg.filesize = #s\n    a.seg.maxprot = 1\n    a.seg.initprot = 1\n    a.seg.nsects = 1\n    ffi.copy(a.sec.sectname, \"__data\")\n    ffi.copy(a.sec.segname, \"__DATA\")\n    a.sec.size = #s\n    a.sec.offset = mach_size-ofs\n    a.sym.cmd = 2\n    a.sym.cmdsize = ffi.sizeof(a.sym)\n    a.sym.symoff = ffi.offsetof(o, \"sym_entry\")-ofs\n    a.sym.nsyms = 1\n    a.sym.stroff = ffi.offsetof(o, \"sym_entry\")+ffi.sizeof(o.sym_entry)-ofs\n    a.sym.strsize = aligned(#symname+2, align)\n  end\n  o.sym_entry.type = 0xf\n  o.sym_entry.sect = 1\n  o.sym_entry.strx = 1\n  ffi.copy(o.space+1, symname)\n\n  -- Write Macho-O object file.\n  local fp = savefile(output, \"wb\")\n  fp:write(ffi.string(o, mach_size))\n  bcsave_tail(fp, output, s)\nend\n\nlocal function bcsave_obj(ctx, output, s)\n  local ok, ffi = pcall(require, \"ffi\")\n  check(ok, \"FFI library required to write this file type\")\n  if ctx.os == \"windows\" then\n    return bcsave_peobj(ctx, output, s, ffi)\n  elseif ctx.os == \"osx\" then\n    return bcsave_machobj(ctx, output, s, ffi)\n  else\n    return bcsave_elfobj(ctx, output, s, ffi)\n  end\nend\n\n------------------------------------------------------------------------------\n\nlocal function bclist(input, output)\n  local f = readfile(input)\n  require(\"jit.bc\").dump(f, savefile(output, \"w\"), true)\nend\n\nlocal function bcsave(ctx, input, output)\n  local f = readfile(input)\n  local s = string.dump(f, ctx.strip)\n  local t = ctx.type\n  if not t then\n    t = detecttype(output)\n    ctx.type = t\n  end\n  if t == \"raw\" then\n    bcsave_raw(output, s)\n  else\n    if not ctx.modname then ctx.modname = detectmodname(input) end\n    if t == \"obj\" then\n      bcsave_obj(ctx, output, s)\n    else\n      bcsave_c(ctx, output, s)\n    end\n  end\nend\n\nlocal function docmd(...)\n  local arg = {...}\n  local n = 1\n  local list = false\n  local ctx = {\n    strip = true, arch = jit.arch, os = string.lower(jit.os),\n    type = false, modname = false,\n  }\n  while n <= #arg do\n    local a = arg[n]\n    if type(a) == \"string\" and string.sub(a, 1, 1) == \"-\" and a ~= \"-\" then\n      table.remove(arg, n)\n      if a == \"--\" then break end\n      for m=2,#a do\n\tlocal opt = string.sub(a, m, m)\n\tif opt == \"l\" then\n\t  list = true\n\telseif opt == \"s\" then\n\t  ctx.strip = true\n\telseif opt == \"g\" then\n\t  ctx.strip = false\n\telse\n\t  if arg[n] == nil or m ~= #a then usage() end\n\t  if opt == \"e\" then\n\t    if n ~= 1 then usage() end\n\t    arg[1] = check(loadstring(arg[1]))\n\t  elseif opt == \"n\" then\n\t    ctx.modname = checkmodname(table.remove(arg, n))\n\t  elseif opt == \"t\" then\n\t    ctx.type = checkarg(table.remove(arg, n), map_type, \"file type\")\n\t  elseif opt == \"a\" then\n\t    ctx.arch = checkarg(table.remove(arg, n), map_arch, \"architecture\")\n\t  elseif opt == \"o\" then\n\t    ctx.os = checkarg(table.remove(arg, n), map_os, \"OS name\")\n\t  else\n\t    usage()\n\t  end\n\tend\n      end\n    else\n      n = n + 1\n    end\n  end\n  if list then\n    if #arg == 0 or #arg > 2 then usage() end\n    bclist(arg[1], arg[2] or \"-\")\n  else\n    if #arg ~= 2 then usage() end\n    bcsave(ctx, arg[1], arg[2])\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Public module functions.\nmodule(...)\n\nstart = docmd -- Process -b command line option.\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/dis_arm.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT ARM disassembler module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n-- This is a helper module used by the LuaJIT machine code dumper module.\n--\n-- It disassembles most user-mode ARMv7 instructions\n-- NYI: Advanced SIMD and VFP instructions.\n------------------------------------------------------------------------------\n\nlocal type = type\nlocal sub, byte, format = string.sub, string.byte, string.format\nlocal match, gmatch, gsub = string.match, string.gmatch, string.gsub\nlocal concat = table.concat\nlocal bit = require(\"bit\")\nlocal band, bor, ror, tohex = bit.band, bit.bor, bit.ror, bit.tohex\nlocal lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift\n\n------------------------------------------------------------------------------\n-- Opcode maps\n------------------------------------------------------------------------------\n\nlocal map_loadc = {\n  shift = 8, mask = 15,\n  [10] = {\n    shift = 20, mask = 1,\n    [0] = {\n      shift = 23, mask = 3,\n      [0] = \"vmovFmDN\", \"vstmFNdr\",\n      _ = {\n\tshift = 21, mask = 1,\n\t[0] = \"vstrFdl\",\n\t{ shift = 16, mask = 15, [13] = \"vpushFdr\", _ = \"vstmdbFNdr\", }\n      },\n    },\n    {\n      shift = 23, mask = 3,\n      [0] = \"vmovFDNm\",\n      { shift = 16, mask = 15, [13] = \"vpopFdr\", _ = \"vldmFNdr\", },\n      _ = {\n\tshift = 21, mask = 1,\n\t[0] = \"vldrFdl\", \"vldmdbFNdr\",\n      },\n    },\n  },\n  [11] = {\n    shift = 20, mask = 1,\n    [0] = {\n      shift = 23, mask = 3,\n      [0] = \"vmovGmDN\", \"vstmGNdr\",\n      _ = {\n\tshift = 21, mask = 1,\n\t[0] = \"vstrGdl\",\n\t{ shift = 16, mask = 15, [13] = \"vpushGdr\", _ = \"vstmdbGNdr\", }\n      },\n    },\n    {\n      shift = 23, mask = 3,\n      [0] = \"vmovGDNm\",\n      { shift = 16, mask = 15, [13] = \"vpopGdr\", _ = \"vldmGNdr\", },\n      _ = {\n\tshift = 21, mask = 1,\n\t[0] = \"vldrGdl\", \"vldmdbGNdr\",\n      },\n    },\n  },\n  _ = {\n    shift = 0, mask = 0 -- NYI ldc, mcrr, mrrc.\n  },\n}\n\nlocal map_vfps = {\n  shift = 6, mask = 0x2c001,\n  [0] = \"vmlaF.dnm\", \"vmlsF.dnm\",\n  [0x04000] = \"vnmlsF.dnm\", [0x04001] = \"vnmlaF.dnm\",\n  [0x08000] = \"vmulF.dnm\", [0x08001] = \"vnmulF.dnm\",\n  [0x0c000] = \"vaddF.dnm\", [0x0c001] = \"vsubF.dnm\",\n  [0x20000] = \"vdivF.dnm\",\n  [0x24000] = \"vfnmsF.dnm\", [0x24001] = \"vfnmaF.dnm\",\n  [0x28000] = \"vfmaF.dnm\", [0x28001] = \"vfmsF.dnm\",\n  [0x2c000] = \"vmovF.dY\",\n  [0x2c001] = {\n    shift = 7, mask = 0x1e01,\n    [0] = \"vmovF.dm\", \"vabsF.dm\",\n    [0x0200] = \"vnegF.dm\", [0x0201] = \"vsqrtF.dm\",\n    [0x0800] = \"vcmpF.dm\", [0x0801] = \"vcmpeF.dm\",\n    [0x0a00] = \"vcmpzF.d\", [0x0a01] = \"vcmpzeF.d\",\n    [0x0e01] = \"vcvtG.dF.m\",\n    [0x1000] = \"vcvt.f32.u32Fdm\", [0x1001] = \"vcvt.f32.s32Fdm\",\n    [0x1800] = \"vcvtr.u32F.dm\", [0x1801] = \"vcvt.u32F.dm\",\n    [0x1a00] = \"vcvtr.s32F.dm\", [0x1a01] = \"vcvt.s32F.dm\",\n  },\n}\n\nlocal map_vfpd = {\n  shift = 6, mask = 0x2c001,\n  [0] = \"vmlaG.dnm\", \"vmlsG.dnm\",\n  [0x04000] = \"vnmlsG.dnm\", [0x04001] = \"vnmlaG.dnm\",\n  [0x08000] = \"vmulG.dnm\", [0x08001] = \"vnmulG.dnm\",\n  [0x0c000] = \"vaddG.dnm\", [0x0c001] = \"vsubG.dnm\",\n  [0x20000] = \"vdivG.dnm\",\n  [0x24000] = \"vfnmsG.dnm\", [0x24001] = \"vfnmaG.dnm\",\n  [0x28000] = \"vfmaG.dnm\", [0x28001] = \"vfmsG.dnm\",\n  [0x2c000] = \"vmovG.dY\",\n  [0x2c001] = {\n    shift = 7, mask = 0x1e01,\n    [0] = \"vmovG.dm\", \"vabsG.dm\",\n    [0x0200] = \"vnegG.dm\", [0x0201] = \"vsqrtG.dm\",\n    [0x0800] = \"vcmpG.dm\", [0x0801] = \"vcmpeG.dm\",\n    [0x0a00] = \"vcmpzG.d\", [0x0a01] = \"vcmpzeG.d\",\n    [0x0e01] = \"vcvtF.dG.m\",\n    [0x1000] = \"vcvt.f64.u32GdFm\", [0x1001] = \"vcvt.f64.s32GdFm\",\n    [0x1800] = \"vcvtr.u32FdG.m\", [0x1801] = \"vcvt.u32FdG.m\",\n    [0x1a00] = \"vcvtr.s32FdG.m\", [0x1a01] = \"vcvt.s32FdG.m\",\n  },\n}\n\nlocal map_datac = {\n  shift = 24, mask = 1,\n  [0] = {\n    shift = 4, mask = 1,\n    [0] = {\n      shift = 8, mask = 15,\n      [10] = map_vfps,\n      [11] = map_vfpd,\n      -- NYI cdp, mcr, mrc.\n    },\n    {\n      shift = 8, mask = 15,\n      [10] = {\n\tshift = 20, mask = 15,\n\t[0] = \"vmovFnD\", \"vmovFDn\",\n\t[14] = \"vmsrD\",\n\t[15] = { shift = 12, mask = 15, [15] = \"vmrs\", _ = \"vmrsD\", },\n      },\n    },\n  },\n  \"svcT\",\n}\n\nlocal map_loadcu = {\n  shift = 0, mask = 0, -- NYI unconditional CP load/store.\n}\n\nlocal map_datacu = {\n  shift = 0, mask = 0, -- NYI unconditional CP data.\n}\n\nlocal map_simddata = {\n  shift = 0, mask = 0, -- NYI SIMD data.\n}\n\nlocal map_simdload = {\n  shift = 0, mask = 0, -- NYI SIMD load/store, preload.\n}\n\nlocal map_preload = {\n  shift = 0, mask = 0, -- NYI preload.\n}\n\nlocal map_media = {\n  shift = 20, mask = 31,\n  [0] = false,\n  { --01\n    shift = 5, mask = 7,\n    [0] = \"sadd16DNM\", \"sasxDNM\", \"ssaxDNM\", \"ssub16DNM\",\n    \"sadd8DNM\", false, false, \"ssub8DNM\",\n  },\n  { --02\n    shift = 5, mask = 7,\n    [0] = \"qadd16DNM\", \"qasxDNM\", \"qsaxDNM\", \"qsub16DNM\",\n    \"qadd8DNM\", false, false, \"qsub8DNM\",\n  },\n  { --03\n    shift = 5, mask = 7,\n    [0] = \"shadd16DNM\", \"shasxDNM\", \"shsaxDNM\", \"shsub16DNM\",\n    \"shadd8DNM\", false, false, \"shsub8DNM\",\n  },\n  false,\n  { --05\n    shift = 5, mask = 7,\n    [0] = \"uadd16DNM\", \"uasxDNM\", \"usaxDNM\", \"usub16DNM\",\n    \"uadd8DNM\", false, false, \"usub8DNM\",\n  },\n  { --06\n    shift = 5, mask = 7,\n    [0] = \"uqadd16DNM\", \"uqasxDNM\", \"uqsaxDNM\", \"uqsub16DNM\",\n    \"uqadd8DNM\", false, false, \"uqsub8DNM\",\n  },\n  { --07\n    shift = 5, mask = 7,\n    [0] = \"uhadd16DNM\", \"uhasxDNM\", \"uhsaxDNM\", \"uhsub16DNM\",\n    \"uhadd8DNM\", false, false, \"uhsub8DNM\",\n  },\n  { --08\n    shift = 5, mask = 7,\n    [0] = \"pkhbtDNMU\", false, \"pkhtbDNMU\",\n    { shift = 16, mask = 15, [15] = \"sxtb16DMU\", _ = \"sxtab16DNMU\", },\n    \"pkhbtDNMU\", \"selDNM\", \"pkhtbDNMU\",\n  },\n  false,\n  { --0a\n    shift = 5, mask = 7,\n    [0] = \"ssatDxMu\", \"ssat16DxM\", \"ssatDxMu\",\n    { shift = 16, mask = 15, [15] = \"sxtbDMU\", _ = \"sxtabDNMU\", },\n    \"ssatDxMu\", false, \"ssatDxMu\",\n  },\n  { --0b\n    shift = 5, mask = 7,\n    [0] = \"ssatDxMu\", \"revDM\", \"ssatDxMu\",\n    { shift = 16, mask = 15, [15] = \"sxthDMU\", _ = \"sxtahDNMU\", },\n    \"ssatDxMu\", \"rev16DM\", \"ssatDxMu\",\n  },\n  { --0c\n    shift = 5, mask = 7,\n    [3] = { shift = 16, mask = 15, [15] = \"uxtb16DMU\", _ = \"uxtab16DNMU\", },\n  },\n  false,\n  { --0e\n    shift = 5, mask = 7,\n    [0] = \"usatDwMu\", \"usat16DwM\", \"usatDwMu\",\n    { shift = 16, mask = 15, [15] = \"uxtbDMU\", _ = \"uxtabDNMU\", },\n    \"usatDwMu\", false, \"usatDwMu\",\n  },\n  { --0f\n    shift = 5, mask = 7,\n    [0] = \"usatDwMu\", \"rbitDM\", \"usatDwMu\",\n    { shift = 16, mask = 15, [15] = \"uxthDMU\", _ = \"uxtahDNMU\", },\n    \"usatDwMu\", \"revshDM\", \"usatDwMu\",\n  },\n  { --10\n    shift = 12, mask = 15,\n    [15] = {\n      shift = 5, mask = 7,\n      \"smuadNMS\", \"smuadxNMS\", \"smusdNMS\", \"smusdxNMS\",\n    },\n    _ = {\n      shift = 5, mask = 7,\n      [0] = \"smladNMSD\", \"smladxNMSD\", \"smlsdNMSD\", \"smlsdxNMSD\",\n    },\n  },\n  false, false, false,\n  { --14\n    shift = 5, mask = 7,\n    [0] = \"smlaldDNMS\", \"smlaldxDNMS\", \"smlsldDNMS\", \"smlsldxDNMS\",\n  },\n  { --15\n    shift = 5, mask = 7,\n    [0] = { shift = 12, mask = 15, [15] = \"smmulNMS\", _ = \"smmlaNMSD\", },\n    { shift = 12, mask = 15, [15] = \"smmulrNMS\", _ = \"smmlarNMSD\", },\n    false, false, false, false,\n    \"smmlsNMSD\", \"smmlsrNMSD\",\n  },\n  false, false,\n  { --18\n    shift = 5, mask = 7,\n    [0] = { shift = 12, mask = 15, [15] = \"usad8NMS\", _ = \"usada8NMSD\", },\n  },\n  false,\n  { --1a\n    shift = 5, mask = 3, [2] = \"sbfxDMvw\",\n  },\n  { --1b\n    shift = 5, mask = 3, [2] = \"sbfxDMvw\",\n  },\n  { --1c\n    shift = 5, mask = 3,\n    [0] = { shift = 0, mask = 15, [15] = \"bfcDvX\", _ = \"bfiDMvX\", },\n  },\n  { --1d\n    shift = 5, mask = 3,\n    [0] = { shift = 0, mask = 15, [15] = \"bfcDvX\", _ = \"bfiDMvX\", },\n  },\n  { --1e\n    shift = 5, mask = 3, [2] = \"ubfxDMvw\",\n  },\n  { --1f\n    shift = 5, mask = 3, [2] = \"ubfxDMvw\",\n  },\n}\n\nlocal map_load = {\n  shift = 21, mask = 9,\n  {\n    shift = 20, mask = 5,\n    [0] = \"strtDL\", \"ldrtDL\", [4] = \"strbtDL\", [5] = \"ldrbtDL\",\n  },\n  _ = {\n    shift = 20, mask = 5,\n    [0] = \"strDL\", \"ldrDL\", [4] = \"strbDL\", [5] = \"ldrbDL\",\n  }\n}\n\nlocal map_load1 = {\n  shift = 4, mask = 1,\n  [0] = map_load, map_media,\n}\n\nlocal map_loadm = {\n  shift = 20, mask = 1,\n  [0] = {\n    shift = 23, mask = 3,\n    [0] = \"stmdaNR\", \"stmNR\",\n    { shift = 16, mask = 63, [45] = \"pushR\", _ = \"stmdbNR\", }, \"stmibNR\",\n  },\n  {\n    shift = 23, mask = 3,\n    [0] = \"ldmdaNR\", { shift = 16, mask = 63, [61] = \"popR\", _ = \"ldmNR\", },\n    \"ldmdbNR\", \"ldmibNR\",\n  },\n}\n\nlocal map_data = {\n  shift = 21, mask = 15,\n  [0] = \"andDNPs\", \"eorDNPs\", \"subDNPs\", \"rsbDNPs\",\n  \"addDNPs\", \"adcDNPs\", \"sbcDNPs\", \"rscDNPs\",\n  \"tstNP\", \"teqNP\", \"cmpNP\", \"cmnNP\",\n  \"orrDNPs\", \"movDPs\", \"bicDNPs\", \"mvnDPs\",\n}\n\nlocal map_mul = {\n  shift = 21, mask = 7,\n  [0] = \"mulNMSs\", \"mlaNMSDs\", \"umaalDNMS\", \"mlsDNMS\",\n  \"umullDNMSs\", \"umlalDNMSs\", \"smullDNMSs\", \"smlalDNMSs\",\n}\n\nlocal map_sync = {\n  shift = 20, mask = 15, -- NYI: brackets around N. R(D+1) for ldrexd/strexd.\n  [0] = \"swpDMN\", false, false, false,\n  \"swpbDMN\", false, false, false,\n  \"strexDMN\", \"ldrexDN\", \"strexdDN\", \"ldrexdDN\",\n  \"strexbDMN\", \"ldrexbDN\", \"strexhDN\", \"ldrexhDN\",\n}\n\nlocal map_mulh = {\n  shift = 21, mask = 3,\n  [0] = { shift = 5, mask = 3,\n    [0] = \"smlabbNMSD\", \"smlatbNMSD\", \"smlabtNMSD\", \"smlattNMSD\", },\n  { shift = 5, mask = 3,\n    [0] = \"smlawbNMSD\", \"smulwbNMS\", \"smlawtNMSD\", \"smulwtNMS\", },\n  { shift = 5, mask = 3,\n    [0] = \"smlalbbDNMS\", \"smlaltbDNMS\", \"smlalbtDNMS\", \"smlalttDNMS\", },\n  { shift = 5, mask = 3,\n    [0] = \"smulbbNMS\", \"smultbNMS\", \"smulbtNMS\", \"smulttNMS\", },\n}\n\nlocal map_misc = {\n  shift = 4, mask = 7,\n  -- NYI: decode PSR bits of msr.\n  [0] = { shift = 21, mask = 1, [0] = \"mrsD\", \"msrM\", },\n  { shift = 21, mask = 3, \"bxM\", false, \"clzDM\", },\n  { shift = 21, mask = 3, \"bxjM\", },\n  { shift = 21, mask = 3, \"blxM\", },\n  false,\n  { shift = 21, mask = 3, [0] = \"qaddDMN\", \"qsubDMN\", \"qdaddDMN\", \"qdsubDMN\", },\n  false,\n  { shift = 21, mask = 3, \"bkptK\", },\n}\n\nlocal map_datar = {\n  shift = 4, mask = 9,\n  [9] = {\n    shift = 5, mask = 3,\n    [0] = { shift = 24, mask = 1, [0] = map_mul, map_sync, },\n    { shift = 20, mask = 1, [0] = \"strhDL\", \"ldrhDL\", },\n    { shift = 20, mask = 1, [0] = \"ldrdDL\", \"ldrsbDL\", },\n    { shift = 20, mask = 1, [0] = \"strdDL\", \"ldrshDL\", },\n  },\n  _ = {\n    shift = 20, mask = 25,\n    [16] = { shift = 7, mask = 1, [0] = map_misc, map_mulh, },\n    _ = {\n      shift = 0, mask = 0xffffffff,\n      [bor(0xe1a00000)] = \"nop\",\n      _ = map_data,\n    }\n  },\n}\n\nlocal map_datai = {\n  shift = 20, mask = 31, -- NYI: decode PSR bits of msr. Decode imm12.\n  [16] = \"movwDW\", [20] = \"movtDW\",\n  [18] = { shift = 0, mask = 0xf00ff, [0] = \"nopv6\", _ = \"msrNW\", },\n  [22] = \"msrNW\",\n  _ = map_data,\n}\n\nlocal map_branch = {\n  shift = 24, mask = 1,\n  [0] = \"bB\", \"blB\"\n}\n\nlocal map_condins = {\n  [0] = map_datar, map_datai, map_load, map_load1,\n  map_loadm, map_branch, map_loadc, map_datac\n}\n\n-- NYI: setend.\nlocal map_uncondins = {\n  [0] = false, map_simddata, map_simdload, map_preload,\n  false, \"blxB\", map_loadcu, map_datacu,\n}\n\n------------------------------------------------------------------------------\n\nlocal map_gpr = {\n  [0] = \"r0\", \"r1\", \"r2\", \"r3\", \"r4\", \"r5\", \"r6\", \"r7\",\n  \"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"sp\", \"lr\", \"pc\",\n}\n\nlocal map_cond = {\n  [0] = \"eq\", \"ne\", \"hs\", \"lo\", \"mi\", \"pl\", \"vs\", \"vc\",\n  \"hi\", \"ls\", \"ge\", \"lt\", \"gt\", \"le\", \"al\",\n}\n\nlocal map_shift = { [0] = \"lsl\", \"lsr\", \"asr\", \"ror\", }\n\n------------------------------------------------------------------------------\n\n-- Output a nicely formatted line with an opcode and operands.\nlocal function putop(ctx, text, operands)\n  local pos = ctx.pos\n  local extra = \"\"\n  if ctx.rel then\n    local sym = ctx.symtab[ctx.rel]\n    if sym then\n      extra = \"\\t->\"..sym\n    elseif band(ctx.op, 0x0e000000) ~= 0x0a000000 then\n      extra = \"\\t; 0x\"..tohex(ctx.rel)\n    end\n  end\n  if ctx.hexdump > 0 then\n    ctx.out(format(\"%08x  %s  %-5s %s%s\\n\",\n\t    ctx.addr+pos, tohex(ctx.op), text, concat(operands, \", \"), extra))\n  else\n    ctx.out(format(\"%08x  %-5s %s%s\\n\",\n\t    ctx.addr+pos, text, concat(operands, \", \"), extra))\n  end\n  ctx.pos = pos + 4\nend\n\n-- Fallback for unknown opcodes.\nlocal function unknown(ctx)\n  return putop(ctx, \".long\", { \"0x\"..tohex(ctx.op) })\nend\n\n-- Format operand 2 of load/store opcodes.\nlocal function fmtload(ctx, op, pos)\n  local base = map_gpr[band(rshift(op, 16), 15)]\n  local x, ofs\n  local ext = (band(op, 0x04000000) == 0)\n  if not ext and band(op, 0x02000000) == 0 then\n    ofs = band(op, 4095)\n    if band(op, 0x00800000) == 0 then ofs = -ofs end\n    if base == \"pc\" then ctx.rel = ctx.addr + pos + 8 + ofs end\n    ofs = \"#\"..ofs\n  elseif ext and band(op, 0x00400000) ~= 0 then\n    ofs = band(op, 15) + band(rshift(op, 4), 0xf0)\n    if band(op, 0x00800000) == 0 then ofs = -ofs end\n    if base == \"pc\" then ctx.rel = ctx.addr + pos + 8 + ofs end\n    ofs = \"#\"..ofs\n  else\n    ofs = map_gpr[band(op, 15)]\n    if ext or band(op, 0xfe0) == 0 then\n    elseif band(op, 0xfe0) == 0x60 then\n      ofs = format(\"%s, rrx\", ofs)\n    else\n      local sh = band(rshift(op, 7), 31)\n      if sh == 0 then sh = 32 end\n      ofs = format(\"%s, %s #%d\", ofs, map_shift[band(rshift(op, 5), 3)], sh)\n    end\n    if band(op, 0x00800000) == 0 then ofs = \"-\"..ofs end\n  end\n  if ofs == \"#0\" then\n    x = format(\"[%s]\", base)\n  elseif band(op, 0x01000000) == 0 then\n    x = format(\"[%s], %s\", base, ofs)\n  else\n    x = format(\"[%s, %s]\", base, ofs)\n  end\n  if band(op, 0x01200000) == 0x01200000 then x = x..\"!\" end\n  return x\nend\n\n-- Format operand 2 of vector load/store opcodes.\nlocal function fmtvload(ctx, op, pos)\n  local base = map_gpr[band(rshift(op, 16), 15)]\n  local ofs = band(op, 255)*4\n  if band(op, 0x00800000) == 0 then ofs = -ofs end\n  if base == \"pc\" then ctx.rel = ctx.addr + pos + 8 + ofs end\n  if ofs == 0 then\n    return format(\"[%s]\", base)\n  else\n    return format(\"[%s, #%d]\", base, ofs)\n  end\nend\n\nlocal function fmtvr(op, vr, sh0, sh1)\n  if vr == \"s\" then\n    return format(\"s%d\", 2*band(rshift(op, sh0), 15)+band(rshift(op, sh1), 1))\n  else\n    return format(\"d%d\", band(rshift(op, sh0), 15)+band(rshift(op, sh1-4), 16))\n  end\nend\n\n-- Disassemble a single instruction.\nlocal function disass_ins(ctx)\n  local pos = ctx.pos\n  local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4)\n  local op = bor(lshift(b3, 24), lshift(b2, 16), lshift(b1, 8), b0)\n  local operands = {}\n  local suffix = \"\"\n  local last, name, pat\n  local vr\n  ctx.op = op\n  ctx.rel = nil\n\n  local cond = rshift(op, 28)\n  local opat\n  if cond == 15 then\n    opat = map_uncondins[band(rshift(op, 25), 7)]\n  else\n    if cond ~= 14 then suffix = map_cond[cond] end\n    opat = map_condins[band(rshift(op, 25), 7)]\n  end\n  while type(opat) ~= \"string\" do\n    if not opat then return unknown(ctx) end\n    opat = opat[band(rshift(op, opat.shift), opat.mask)] or opat._\n  end\n  name, pat = match(opat, \"^([a-z0-9]*)(.*)\")\n  if sub(pat, 1, 1) == \".\" then\n    local s2, p2 = match(pat, \"^([a-z0-9.]*)(.*)\")\n    suffix = suffix..s2\n    pat = p2\n  end\n\n  for p in gmatch(pat, \".\") do\n    local x = nil\n    if p == \"D\" then\n      x = map_gpr[band(rshift(op, 12), 15)]\n    elseif p == \"N\" then\n      x = map_gpr[band(rshift(op, 16), 15)]\n    elseif p == \"S\" then\n      x = map_gpr[band(rshift(op, 8), 15)]\n    elseif p == \"M\" then\n      x = map_gpr[band(op, 15)]\n    elseif p == \"d\" then\n      x = fmtvr(op, vr, 12, 22)\n    elseif p == \"n\" then\n      x = fmtvr(op, vr, 16, 7)\n    elseif p == \"m\" then\n      x = fmtvr(op, vr, 0, 5)\n    elseif p == \"P\" then\n      if band(op, 0x02000000) ~= 0 then\n\tx = ror(band(op, 255), 2*band(rshift(op, 8), 15))\n      else\n\tx = map_gpr[band(op, 15)]\n\tif band(op, 0xff0) ~= 0 then\n\t  operands[#operands+1] = x\n\t  local s = map_shift[band(rshift(op, 5), 3)]\n\t  local r = nil\n\t  if band(op, 0xf90) == 0 then\n\t    if s == \"ror\" then s = \"rrx\" else r = \"#32\" end\n\t  elseif band(op, 0x10) == 0 then\n\t    r = \"#\"..band(rshift(op, 7), 31)\n\t  else\n\t    r = map_gpr[band(rshift(op, 8), 15)]\n\t  end\n\t  if name == \"mov\" then name = s; x = r\n\t  elseif r then x = format(\"%s %s\", s, r)\n\t  else x = s end\n\tend\n      end\n    elseif p == \"L\" then\n      x = fmtload(ctx, op, pos)\n    elseif p == \"l\" then\n      x = fmtvload(ctx, op, pos)\n    elseif p == \"B\" then\n      local addr = ctx.addr + pos + 8 + arshift(lshift(op, 8), 6)\n      if cond == 15 then addr = addr + band(rshift(op, 23), 2) end\n      ctx.rel = addr\n      x = \"0x\"..tohex(addr)\n    elseif p == \"F\" then\n      vr = \"s\"\n    elseif p == \"G\" then\n      vr = \"d\"\n    elseif p == \".\" then\n      suffix = suffix..(vr == \"s\" and \".f32\" or \".f64\")\n    elseif p == \"R\" then\n      if band(op, 0x00200000) ~= 0 and #operands == 1 then\n\toperands[1] = operands[1]..\"!\"\n      end\n      local t = {}\n      for i=0,15 do\n\tif band(rshift(op, i), 1) == 1 then t[#t+1] = map_gpr[i] end\n      end\n      x = \"{\"..concat(t, \", \")..\"}\"\n    elseif p == \"r\" then\n      if band(op, 0x00200000) ~= 0 and #operands == 2 then\n\toperands[1] = operands[1]..\"!\"\n      end\n      local s = tonumber(sub(last, 2))\n      local n = band(op, 255)\n      if vr == \"d\" then n = rshift(n, 1) end\n      operands[#operands] = format(\"{%s-%s%d}\", last, vr, s+n-1)\n    elseif p == \"W\" then\n      x = band(op, 0x0fff) + band(rshift(op, 4), 0xf000)\n    elseif p == \"T\" then\n      x = \"#0x\"..tohex(band(op, 0x00ffffff), 6)\n    elseif p == \"U\" then\n      x = band(rshift(op, 7), 31)\n      if x == 0 then x = nil end\n    elseif p == \"u\" then\n      x = band(rshift(op, 7), 31)\n      if band(op, 0x40) == 0 then\n\tif x == 0 then x = nil else x = \"lsl #\"..x end\n      else\n\tif x == 0 then x = \"asr #32\" else x = \"asr #\"..x end\n      end\n    elseif p == \"v\" then\n      x = band(rshift(op, 7), 31)\n    elseif p == \"w\" then\n      x = band(rshift(op, 16), 31)\n    elseif p == \"x\" then\n      x = band(rshift(op, 16), 31) + 1\n    elseif p == \"X\" then\n      x = band(rshift(op, 16), 31) - last + 1\n    elseif p == \"Y\" then\n      x = band(rshift(op, 12), 0xf0) + band(op, 0x0f)\n    elseif p == \"K\" then\n      x = \"#0x\"..tohex(band(rshift(op, 4), 0x0000fff0) + band(op, 15), 4)\n    elseif p == \"s\" then\n      if band(op, 0x00100000) ~= 0 then suffix = \"s\"..suffix end\n    else\n      assert(false)\n    end\n    if x then\n      last = x\n      if type(x) == \"number\" then x = \"#\"..x end\n      operands[#operands+1] = x\n    end\n  end\n\n  return putop(ctx, name..suffix, operands)\nend\n\n------------------------------------------------------------------------------\n\n-- Disassemble a block of code.\nlocal function disass_block(ctx, ofs, len)\n  if not ofs then ofs = 0 end\n  local stop = len and ofs+len or #ctx.code\n  ctx.pos = ofs\n  ctx.rel = nil\n  while ctx.pos < stop do disass_ins(ctx) end\nend\n\n-- Extended API: create a disassembler context. Then call ctx:disass(ofs, len).\nlocal function create_(code, addr, out)\n  local ctx = {}\n  ctx.code = code\n  ctx.addr = addr or 0\n  ctx.out = out or io.write\n  ctx.symtab = {}\n  ctx.disass = disass_block\n  ctx.hexdump = 8\n  return ctx\nend\n\n-- Simple API: disassemble code (a string) at address and output via out.\nlocal function disass_(code, addr, out)\n  create_(code, addr, out):disass()\nend\n\n-- Return register name for RID.\nlocal function regname_(r)\n  if r < 16 then return map_gpr[r] end\n  return \"d\"..(r-16)\nend\n\n-- Public module functions.\nmodule(...)\n\ncreate = create_\ndisass = disass_\nregname = regname_\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/dis_mips.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT MIPS disassembler module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT/X license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n-- This is a helper module used by the LuaJIT machine code dumper module.\n--\n-- It disassembles all standard MIPS32R1/R2 instructions.\n-- Default mode is big-endian, but see: dis_mipsel.lua\n------------------------------------------------------------------------------\n\nlocal type = type\nlocal sub, byte, format = string.sub, string.byte, string.format\nlocal match, gmatch, gsub = string.match, string.gmatch, string.gsub\nlocal concat = table.concat\nlocal bit = require(\"bit\")\nlocal band, bor, tohex = bit.band, bit.bor, bit.tohex\nlocal lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift\n\n------------------------------------------------------------------------------\n-- Primary and extended opcode maps\n------------------------------------------------------------------------------\n\nlocal map_movci = { shift = 16, mask = 1, [0] = \"movfDSC\", \"movtDSC\", }\nlocal map_srl = { shift = 21, mask = 1, [0] = \"srlDTA\", \"rotrDTA\", }\nlocal map_srlv = { shift = 6, mask = 1, [0] = \"srlvDTS\", \"rotrvDTS\", }\n\nlocal map_special = {\n  shift = 0, mask = 63,\n  [0] = { shift = 0, mask = -1, [0] = \"nop\", _ = \"sllDTA\" },\n  map_movci,\tmap_srl,\t\"sraDTA\",\n  \"sllvDTS\",\tfalse,\t\tmap_srlv,\t\"sravDTS\",\n  \"jrS\",\t\"jalrD1S\",\t\"movzDST\",\t\"movnDST\",\n  \"syscallY\",\t\"breakY\",\tfalse,\t\t\"sync\",\n  \"mfhiD\",\t\"mthiS\",\t\"mfloD\",\t\"mtloS\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"multST\",\t\"multuST\",\t\"divST\",\t\"divuST\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"addDST\",\t\"addu|moveDST0\", \"subDST\",\t\"subu|neguDS0T\",\n  \"andDST\",\t\"orDST\",\t\"xorDST\",\t\"nor|notDST0\",\n  false,\tfalse,\t\t\"sltDST\",\t\"sltuDST\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"tgeSTZ\",\t\"tgeuSTZ\",\t\"tltSTZ\",\t\"tltuSTZ\",\n  \"teqSTZ\",\tfalse,\t\t\"tneSTZ\",\n}\n\nlocal map_special2 = {\n  shift = 0, mask = 63,\n  [0] = \"maddST\", \"madduST\",\t\"mulDST\",\tfalse,\n  \"msubST\",\t\"msubuST\",\n  [32] = \"clzDS\", [33] = \"cloDS\",\n  [63] = \"sdbbpY\",\n}\n\nlocal map_bshfl = {\n  shift = 6, mask = 31,\n  [2] = \"wsbhDT\",\n  [16] = \"sebDT\",\n  [24] = \"sehDT\",\n}\n\nlocal map_special3 = {\n  shift = 0, mask = 63,\n  [0] = \"extTSAK\", [4] = \"insTSAL\",\n  [32] = map_bshfl,\n  [59] = \"rdhwrTD\",\n}\n\nlocal map_regimm = {\n  shift = 16, mask = 31,\n  [0] = \"bltzSB\",\t\"bgezSB\",\t\"bltzlSB\",\t\"bgezlSB\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"tgeiSI\",\t\"tgeiuSI\",\t\"tltiSI\",\t\"tltiuSI\",\n  \"teqiSI\",\tfalse,\t\t\"tneiSI\",\tfalse,\n  \"bltzalSB\",\t\"bgezalSB\",\t\"bltzallSB\",\t\"bgezallSB\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\t\"synciSO\",\n}\n\nlocal map_cop0 = {\n  shift = 25, mask = 1,\n  [0] = {\n    shift = 21, mask = 15,\n    [0] = \"mfc0TDW\", [4] = \"mtc0TDW\",\n    [10] = \"rdpgprDT\",\n    [11] = { shift = 5, mask = 1, [0] = \"diT0\", \"eiT0\", },\n    [14] = \"wrpgprDT\",\n  }, {\n    shift = 0, mask = 63,\n    [1] = \"tlbr\", [2] = \"tlbwi\", [6] = \"tlbwr\", [8] = \"tlbp\",\n    [24] = \"eret\", [31] = \"deret\",\n    [32] = \"wait\",\n  },\n}\n\nlocal map_cop1s = {\n  shift = 0, mask = 63,\n  [0] = \"add.sFGH\",\t\"sub.sFGH\",\t\"mul.sFGH\",\t\"div.sFGH\",\n  \"sqrt.sFG\",\t\t\"abs.sFG\",\t\"mov.sFG\",\t\"neg.sFG\",\n  \"round.l.sFG\",\t\"trunc.l.sFG\",\t\"ceil.l.sFG\",\t\"floor.l.sFG\",\n  \"round.w.sFG\",\t\"trunc.w.sFG\",\t\"ceil.w.sFG\",\t\"floor.w.sFG\",\n  false,\n  { shift = 16, mask = 1, [0] = \"movf.sFGC\", \"movt.sFGC\" },\n  \"movz.sFGT\",\t\"movn.sFGT\",\n  false,\t\"recip.sFG\",\t\"rsqrt.sFG\",\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\t\"cvt.d.sFG\",\tfalse,\t\tfalse,\n  \"cvt.w.sFG\",\t\"cvt.l.sFG\",\t\"cvt.ps.sFGH\",\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"c.f.sVGH\",\t\"c.un.sVGH\",\t\"c.eq.sVGH\",\t\"c.ueq.sVGH\",\n  \"c.olt.sVGH\",\t\"c.ult.sVGH\",\t\"c.ole.sVGH\",\t\"c.ule.sVGH\",\n  \"c.sf.sVGH\",\t\"c.ngle.sVGH\",\t\"c.seq.sVGH\",\t\"c.ngl.sVGH\",\n  \"c.lt.sVGH\",\t\"c.nge.sVGH\",\t\"c.le.sVGH\",\t\"c.ngt.sVGH\",\n}\n\nlocal map_cop1d = {\n  shift = 0, mask = 63,\n  [0] = \"add.dFGH\",\t\"sub.dFGH\",\t\"mul.dFGH\",\t\"div.dFGH\",\n  \"sqrt.dFG\",\t\t\"abs.dFG\",\t\"mov.dFG\",\t\"neg.dFG\",\n  \"round.l.dFG\",\t\"trunc.l.dFG\",\t\"ceil.l.dFG\",\t\"floor.l.dFG\",\n  \"round.w.dFG\",\t\"trunc.w.dFG\",\t\"ceil.w.dFG\",\t\"floor.w.dFG\",\n  false,\n  { shift = 16, mask = 1, [0] = \"movf.dFGC\", \"movt.dFGC\" },\n  \"movz.dFGT\",\t\"movn.dFGT\",\n  false,\t\"recip.dFG\",\t\"rsqrt.dFG\",\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"cvt.s.dFG\",\tfalse,\t\tfalse,\t\tfalse,\n  \"cvt.w.dFG\",\t\"cvt.l.dFG\",\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"c.f.dVGH\",\t\"c.un.dVGH\",\t\"c.eq.dVGH\",\t\"c.ueq.dVGH\",\n  \"c.olt.dVGH\",\t\"c.ult.dVGH\",\t\"c.ole.dVGH\",\t\"c.ule.dVGH\",\n  \"c.df.dVGH\",\t\"c.ngle.dVGH\",\t\"c.deq.dVGH\",\t\"c.ngl.dVGH\",\n  \"c.lt.dVGH\",\t\"c.nge.dVGH\",\t\"c.le.dVGH\",\t\"c.ngt.dVGH\",\n}\n\nlocal map_cop1ps = {\n  shift = 0, mask = 63,\n  [0] = \"add.psFGH\",\t\"sub.psFGH\",\t\"mul.psFGH\",\tfalse,\n  false,\t\t\"abs.psFG\",\t\"mov.psFG\",\t\"neg.psFG\",\n  false,\t\tfalse,\t\tfalse,\t\tfalse,\n  false,\t\tfalse,\t\tfalse,\t\tfalse,\n  false,\n  { shift = 16, mask = 1, [0] = \"movf.psFGC\", \"movt.psFGC\" },\n  \"movz.psFGT\",\t\"movn.psFGT\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"cvt.s.puFG\",\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  \"cvt.s.plFG\",\tfalse,\t\tfalse,\t\tfalse,\n  \"pll.psFGH\",\t\"plu.psFGH\",\t\"pul.psFGH\",\t\"puu.psFGH\",\n  \"c.f.psVGH\",\t\"c.un.psVGH\",\t\"c.eq.psVGH\",\t\"c.ueq.psVGH\",\n  \"c.olt.psVGH\", \"c.ult.psVGH\",\t\"c.ole.psVGH\",\t\"c.ule.psVGH\",\n  \"c.psf.psVGH\", \"c.ngle.psVGH\", \"c.pseq.psVGH\", \"c.ngl.psVGH\",\n  \"c.lt.psVGH\",\t\"c.nge.psVGH\",\t\"c.le.psVGH\",\t\"c.ngt.psVGH\",\n}\n\nlocal map_cop1w = {\n  shift = 0, mask = 63,\n  [32] = \"cvt.s.wFG\", [33] = \"cvt.d.wFG\",\n}\n\nlocal map_cop1l = {\n  shift = 0, mask = 63,\n  [32] = \"cvt.s.lFG\", [33] = \"cvt.d.lFG\",\n}\n\nlocal map_cop1bc = {\n  shift = 16, mask = 3,\n  [0] = \"bc1fCB\", \"bc1tCB\",\t\"bc1flCB\",\t\"bc1tlCB\",\n}\n\nlocal map_cop1 = {\n  shift = 21, mask = 31,\n  [0] = \"mfc1TG\", false,\t\"cfc1TG\",\t\"mfhc1TG\",\n  \"mtc1TG\",\tfalse,\t\t\"ctc1TG\",\t\"mthc1TG\",\n  map_cop1bc,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  map_cop1s,\tmap_cop1d,\tfalse,\t\tfalse,\n  map_cop1w,\tmap_cop1l,\tmap_cop1ps,\n}\n\nlocal map_cop1x = {\n  shift = 0, mask = 63,\n  [0] = \"lwxc1FSX\",\t\"ldxc1FSX\",\tfalse,\t\tfalse,\n  false,\t\"luxc1FSX\",\tfalse,\t\tfalse,\n  \"swxc1FSX\",\t\"sdxc1FSX\",\tfalse,\t\tfalse,\n  false,\t\"suxc1FSX\",\tfalse,\t\t\"prefxMSX\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  false,\tfalse,\t\t\"alnv.psFGHS\",\tfalse,\n  \"madd.sFRGH\",\t\"madd.dFRGH\",\tfalse,\t\tfalse,\n  false,\tfalse,\t\t\"madd.psFRGH\",\tfalse,\n  \"msub.sFRGH\",\t\"msub.dFRGH\",\tfalse,\t\tfalse,\n  false,\tfalse,\t\t\"msub.psFRGH\",\tfalse,\n  \"nmadd.sFRGH\", \"nmadd.dFRGH\",\tfalse,\t\tfalse,\n  false,\tfalse,\t\t\"nmadd.psFRGH\",\tfalse,\n  \"nmsub.sFRGH\", \"nmsub.dFRGH\",\tfalse,\t\tfalse,\n  false,\tfalse,\t\t\"nmsub.psFRGH\",\tfalse,\n}\n\nlocal map_pri = {\n  [0] = map_special,\tmap_regimm,\t\"jJ\",\t\"jalJ\",\n  \"beq|beqz|bST00B\",\t\"bne|bnezST0B\",\t\t\"blezSB\",\t\"bgtzSB\",\n  \"addiTSI\",\t\"addiu|liTS0I\",\t\"sltiTSI\",\t\"sltiuTSI\",\n  \"andiTSU\",\t\"ori|liTS0U\",\t\"xoriTSU\",\t\"luiTU\",\n  map_cop0,\tmap_cop1,\tfalse,\t\tmap_cop1x,\n  \"beql|beqzlST0B\",\t\"bnel|bnezlST0B\",\t\"blezlSB\",\t\"bgtzlSB\",\n  false,\tfalse,\t\tfalse,\t\tfalse,\n  map_special2,\tfalse,\t\tfalse,\t\tmap_special3,\n  \"lbTSO\",\t\"lhTSO\",\t\"lwlTSO\",\t\"lwTSO\",\n  \"lbuTSO\",\t\"lhuTSO\",\t\"lwrTSO\",\tfalse,\n  \"sbTSO\",\t\"shTSO\",\t\"swlTSO\",\t\"swTSO\",\n  false,\tfalse,\t\t\"swrTSO\",\t\"cacheNSO\",\n  \"llTSO\",\t\"lwc1HSO\",\t\"lwc2TSO\",\t\"prefNSO\",\n  false,\t\"ldc1HSO\",\t\"ldc2TSO\",\tfalse,\n  \"scTSO\",\t\"swc1HSO\",\t\"swc2TSO\",\tfalse,\n  false,\t\"sdc1HSO\",\t\"sdc2TSO\",\tfalse,\n}\n\n------------------------------------------------------------------------------\n\nlocal map_gpr = {\n  [0] = \"r0\", \"r1\", \"r2\", \"r3\", \"r4\", \"r5\", \"r6\", \"r7\",\n  \"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"r14\", \"r15\",\n  \"r16\", \"r17\", \"r18\", \"r19\", \"r20\", \"r21\", \"r22\", \"r23\",\n  \"r24\", \"r25\", \"r26\", \"r27\", \"r28\", \"sp\", \"r30\", \"ra\",\n}\n\n------------------------------------------------------------------------------\n\n-- Output a nicely formatted line with an opcode and operands.\nlocal function putop(ctx, text, operands)\n  local pos = ctx.pos\n  local extra = \"\"\n  if ctx.rel then\n    local sym = ctx.symtab[ctx.rel]\n    if sym then extra = \"\\t->\"..sym end\n  end\n  if ctx.hexdump > 0 then\n    ctx.out(format(\"%08x  %s  %-7s %s%s\\n\",\n\t    ctx.addr+pos, tohex(ctx.op), text, concat(operands, \", \"), extra))\n  else\n    ctx.out(format(\"%08x  %-7s %s%s\\n\",\n\t    ctx.addr+pos, text, concat(operands, \", \"), extra))\n  end\n  ctx.pos = pos + 4\nend\n\n-- Fallback for unknown opcodes.\nlocal function unknown(ctx)\n  return putop(ctx, \".long\", { \"0x\"..tohex(ctx.op) })\nend\n\nlocal function get_be(ctx)\n  local pos = ctx.pos\n  local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4)\n  return bor(lshift(b0, 24), lshift(b1, 16), lshift(b2, 8), b3)\nend\n\nlocal function get_le(ctx)\n  local pos = ctx.pos\n  local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4)\n  return bor(lshift(b3, 24), lshift(b2, 16), lshift(b1, 8), b0)\nend\n\n-- Disassemble a single instruction.\nlocal function disass_ins(ctx)\n  local op = ctx:get()\n  local operands = {}\n  local last = nil\n  ctx.op = op\n  ctx.rel = nil\n\n  local opat = map_pri[rshift(op, 26)]\n  while type(opat) ~= \"string\" do\n    if not opat then return unknown(ctx) end\n    opat = opat[band(rshift(op, opat.shift), opat.mask)] or opat._\n  end\n  local name, pat = match(opat, \"^([a-z0-9_.]*)(.*)\")\n  local altname, pat2 = match(pat, \"|([a-z0-9_.|]*)(.*)\")\n  if altname then pat = pat2 end\n\n  for p in gmatch(pat, \".\") do\n    local x = nil\n    if p == \"S\" then\n      x = map_gpr[band(rshift(op, 21), 31)]\n    elseif p == \"T\" then\n      x = map_gpr[band(rshift(op, 16), 31)]\n    elseif p == \"D\" then\n      x = map_gpr[band(rshift(op, 11), 31)]\n    elseif p == \"F\" then\n      x = \"f\"..band(rshift(op, 6), 31)\n    elseif p == \"G\" then\n      x = \"f\"..band(rshift(op, 11), 31)\n    elseif p == \"H\" then\n      x = \"f\"..band(rshift(op, 16), 31)\n    elseif p == \"R\" then\n      x = \"f\"..band(rshift(op, 21), 31)\n    elseif p == \"A\" then\n      x = band(rshift(op, 6), 31)\n    elseif p == \"M\" then\n      x = band(rshift(op, 11), 31)\n    elseif p == \"N\" then\n      x = band(rshift(op, 16), 31)\n    elseif p == \"C\" then\n      x = band(rshift(op, 18), 7)\n      if x == 0 then x = nil end\n    elseif p == \"K\" then\n      x = band(rshift(op, 11), 31) + 1\n    elseif p == \"L\" then\n      x = band(rshift(op, 11), 31) - last + 1\n    elseif p == \"I\" then\n      x = arshift(lshift(op, 16), 16)\n    elseif p == \"U\" then\n      x = band(op, 0xffff)\n    elseif p == \"O\" then\n      local disp = arshift(lshift(op, 16), 16)\n      operands[#operands] = format(\"%d(%s)\", disp, last)\n    elseif p == \"X\" then\n      local index = map_gpr[band(rshift(op, 16), 31)]\n      operands[#operands] = format(\"%s(%s)\", index, last)\n    elseif p == \"B\" then\n      x = ctx.addr + ctx.pos + arshift(lshift(op, 16), 16)*4 + 4\n      ctx.rel = x\n      x = \"0x\"..tohex(x)\n    elseif p == \"J\" then\n      x = band(ctx.addr + ctx.pos, 0xf0000000) + band(op, 0x03ffffff)*4\n      ctx.rel = x\n      x = \"0x\"..tohex(x)\n    elseif p == \"V\" then\n      x = band(rshift(op, 8), 7)\n      if x == 0 then x = nil end\n    elseif p == \"W\" then\n      x = band(op, 7)\n      if x == 0 then x = nil end\n    elseif p == \"Y\" then\n      x = band(rshift(op, 6), 0x000fffff)\n      if x == 0 then x = nil end\n    elseif p == \"Z\" then\n      x = band(rshift(op, 6), 1023)\n      if x == 0 then x = nil end\n    elseif p == \"0\" then\n      if last == \"r0\" or last == 0 then\n\tlocal n = #operands\n\toperands[n] = nil\n\tlast = operands[n-1]\n\tif altname then\n\t  local a1, a2 = match(altname, \"([^|]*)|(.*)\")\n\t  if a1 then name, altname = a1, a2\n\t  else name = altname end\n\tend\n      end\n    elseif p == \"1\" then\n      if last == \"ra\" then\n\toperands[#operands] = nil\n      end\n    else\n      assert(false)\n    end\n    if x then operands[#operands+1] = x; last = x end\n  end\n\n  return putop(ctx, name, operands)\nend\n\n------------------------------------------------------------------------------\n\n-- Disassemble a block of code.\nlocal function disass_block(ctx, ofs, len)\n  if not ofs then ofs = 0 end\n  local stop = len and ofs+len or #ctx.code\n  stop = stop - stop % 4\n  ctx.pos = ofs - ofs % 4\n  ctx.rel = nil\n  while ctx.pos < stop do disass_ins(ctx) end\nend\n\n-- Extended API: create a disassembler context. Then call ctx:disass(ofs, len).\nlocal function create_(code, addr, out)\n  local ctx = {}\n  ctx.code = code\n  ctx.addr = addr or 0\n  ctx.out = out or io.write\n  ctx.symtab = {}\n  ctx.disass = disass_block\n  ctx.hexdump = 8\n  ctx.get = get_be\n  return ctx\nend\n\nlocal function create_el_(code, addr, out)\n  local ctx = create_(code, addr, out)\n  ctx.get = get_le\n  return ctx\nend\n\n-- Simple API: disassemble code (a string) at address and output via out.\nlocal function disass_(code, addr, out)\n  create_(code, addr, out):disass()\nend\n\nlocal function disass_el_(code, addr, out)\n  create_el_(code, addr, out):disass()\nend\n\n-- Return register name for RID.\nlocal function regname_(r)\n  if r < 32 then return map_gpr[r] end\n  return \"f\"..(r-32)\nend\n\n-- Public module functions.\nmodule(...)\n\ncreate = create_\ncreate_el = create_el_\ndisass = disass_\ndisass_el = disass_el_\nregname = regname_\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/dis_mipsel.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT MIPSEL disassembler wrapper module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n-- This module just exports the little-endian functions from the\n-- MIPS disassembler module. All the interesting stuff is there.\n------------------------------------------------------------------------------\n\nlocal require = require\n\nmodule(...)\n\nlocal dis_mips = require(_PACKAGE..\"dis_mips\")\n\ncreate = dis_mips.create_el\ndisass = dis_mips.disass_el\nregname = dis_mips.regname\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/dis_ppc.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT PPC disassembler module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT/X license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n-- This is a helper module used by the LuaJIT machine code dumper module.\n--\n-- It disassembles all common, non-privileged 32/64 bit PowerPC instructions\n-- plus the e500 SPE instructions and some Cell/Xenon extensions.\n--\n-- NYI: VMX, VMX128\n------------------------------------------------------------------------------\n\nlocal type = type\nlocal sub, byte, format = string.sub, string.byte, string.format\nlocal match, gmatch, gsub = string.match, string.gmatch, string.gsub\nlocal concat = table.concat\nlocal bit = require(\"bit\")\nlocal band, bor, tohex = bit.band, bit.bor, bit.tohex\nlocal lshift, rshift, arshift = bit.lshift, bit.rshift, bit.arshift\n\n------------------------------------------------------------------------------\n-- Primary and extended opcode maps\n------------------------------------------------------------------------------\n\nlocal map_crops = {\n  shift = 1, mask = 1023,\n  [0] = \"mcrfXX\",\n  [33] = \"crnor|crnotCCC=\", [129] = \"crandcCCC\",\n  [193] = \"crxor|crclrCCC%\", [225] = \"crnandCCC\",\n  [257] = \"crandCCC\", [289] = \"creqv|crsetCCC%\",\n  [417] = \"crorcCCC\", [449] = \"cror|crmoveCCC=\",\n  [16] = \"b_lrKB\", [528] = \"b_ctrKB\",\n  [150] = \"isync\",\n}\n\nlocal map_rlwinm = setmetatable({\n  shift = 0, mask = -1,\n},\n{ __index = function(t, x)\n    local rot = band(rshift(x, 11), 31)\n    local mb = band(rshift(x, 6), 31)\n    local me = band(rshift(x, 1), 31)\n    if mb == 0 and me == 31-rot then\n      return \"slwiRR~A.\"\n    elseif me == 31 and mb == 32-rot then\n      return \"srwiRR~-A.\"\n    else\n      return \"rlwinmRR~AAA.\"\n    end\n  end\n})\n\nlocal map_rld = {\n  shift = 2, mask = 7,\n  [0] = \"rldiclRR~HM.\", \"rldicrRR~HM.\", \"rldicRR~HM.\", \"rldimiRR~HM.\",\n  {\n    shift = 1, mask = 1,\n    [0] = \"rldclRR~RM.\", \"rldcrRR~RM.\",\n  },\n}\n\nlocal map_ext = setmetatable({\n  shift = 1, mask = 1023,\n\n  [0] = \"cmp_YLRR\", [32] = \"cmpl_YLRR\",\n  [4] = \"twARR\", [68] = \"tdARR\",\n\n  [8] = \"subfcRRR.\", [40] = \"subfRRR.\",\n  [104] = \"negRR.\", [136] = \"subfeRRR.\",\n  [200] = \"subfzeRR.\", [232] = \"subfmeRR.\",\n  [520] = \"subfcoRRR.\", [552] = \"subfoRRR.\",\n  [616] = \"negoRR.\", [648] = \"subfeoRRR.\",\n  [712] = \"subfzeoRR.\", [744] = \"subfmeoRR.\",\n\n  [9] = \"mulhduRRR.\", [73] = \"mulhdRRR.\", [233] = \"mulldRRR.\",\n  [457] = \"divduRRR.\", [489] = \"divdRRR.\",\n  [745] = \"mulldoRRR.\",\n  [969] = \"divduoRRR.\", [1001] = \"divdoRRR.\",\n\n  [10] = \"addcRRR.\", [138] = \"addeRRR.\",\n  [202] = \"addzeRR.\", [234] = \"addmeRR.\", [266] = \"addRRR.\",\n  [522] = \"addcoRRR.\", [650] = \"addeoRRR.\",\n  [714] = \"addzeoRR.\", [746] = \"addmeoRR.\", [778] = \"addoRRR.\",\n\n  [11] = \"mulhwuRRR.\", [75] = \"mulhwRRR.\", [235] = \"mullwRRR.\",\n  [459] = \"divwuRRR.\", [491] = \"divwRRR.\",\n  [747] = \"mullwoRRR.\",\n  [971] = \"divwouRRR.\", [1003] = \"divwoRRR.\",\n\n  [15] = \"iselltRRR\", [47] = \"iselgtRRR\", [79] = \"iseleqRRR\",\n\n  [144] = { shift = 20, mask = 1, [0] = \"mtcrfRZ~\", \"mtocrfRZ~\", },\n  [19] = { shift = 20, mask = 1, [0] = \"mfcrR\", \"mfocrfRZ\", },\n  [371] = { shift = 11, mask = 1023, [392] = \"mftbR\", [424] = \"mftbuR\", },\n  [339] = {\n    shift = 11, mask = 1023,\n    [32] = \"mferR\", [256] = \"mflrR\", [288] = \"mfctrR\", [16] = \"mfspefscrR\",\n  },\n  [467] = {\n    shift = 11, mask = 1023,\n    [32] = \"mtxerR\", [256] = \"mtlrR\", [288] = \"mtctrR\", [16] = \"mtspefscrR\",\n  },\n\n  [20] = \"lwarxRR0R\", [84] = \"ldarxRR0R\",\n\n  [21] = \"ldxRR0R\", [53] = \"lduxRRR\",\n  [149] = \"stdxRR0R\", [181] = \"stduxRRR\",\n  [341] = \"lwaxRR0R\", [373] = \"lwauxRRR\",\n\n  [23] = \"lwzxRR0R\", [55] = \"lwzuxRRR\",\n  [87] = \"lbzxRR0R\", [119] = \"lbzuxRRR\",\n  [151] = \"stwxRR0R\", [183] = \"stwuxRRR\",\n  [215] = \"stbxRR0R\", [247] = \"stbuxRRR\",\n  [279] = \"lhzxRR0R\", [311] = \"lhzuxRRR\",\n  [343] = \"lhaxRR0R\", [375] = \"lhauxRRR\",\n  [407] = \"sthxRR0R\", [439] = \"sthuxRRR\",\n\n  [54] = \"dcbst-R0R\", [86] = \"dcbf-R0R\",\n  [150] = \"stwcxRR0R.\", [214] = \"stdcxRR0R.\",\n  [246] = \"dcbtst-R0R\", [278] = \"dcbt-R0R\",\n  [310] = \"eciwxRR0R\", [438] = \"ecowxRR0R\",\n  [470] = \"dcbi-RR\",\n\n  [598] = {\n    shift = 21, mask = 3,\n    [0] = \"sync\", \"lwsync\", \"ptesync\",\n  },\n  [758] = \"dcba-RR\",\n  [854] = \"eieio\", [982] = \"icbi-R0R\", [1014] = \"dcbz-R0R\",\n\n  [26] = \"cntlzwRR~\", [58] = \"cntlzdRR~\",\n  [122] = \"popcntbRR~\",\n  [154] = \"prtywRR~\", [186] = \"prtydRR~\",\n\n  [28] = \"andRR~R.\", [60] = \"andcRR~R.\", [124] = \"nor|notRR~R=.\",\n  [284] = \"eqvRR~R.\", [316] = \"xorRR~R.\",\n  [412] = \"orcRR~R.\", [444] = \"or|mrRR~R=.\", [476] = \"nandRR~R.\",\n  [508] = \"cmpbRR~R\",\n\n  [512] = \"mcrxrX\",\n\n  [532] = \"ldbrxRR0R\", [660] = \"stdbrxRR0R\",\n\n  [533] = \"lswxRR0R\", [597] = \"lswiRR0A\",\n  [661] = \"stswxRR0R\", [725] = \"stswiRR0A\",\n\n  [534] = \"lwbrxRR0R\", [662] = \"stwbrxRR0R\",\n  [790] = \"lhbrxRR0R\", [918] = \"sthbrxRR0R\",\n\n  [535] = \"lfsxFR0R\", [567] = \"lfsuxFRR\",\n  [599] = \"lfdxFR0R\", [631] = \"lfduxFRR\",\n  [663] = \"stfsxFR0R\", [695] = \"stfsuxFRR\",\n  [727] = \"stfdxFR0R\", [759] = \"stfduxFR0R\",\n  [855] = \"lfiwaxFR0R\",\n  [983] = \"stfiwxFR0R\",\n\n  [24] = \"slwRR~R.\",\n\n  [27] = \"sldRR~R.\", [536] = \"srwRR~R.\",\n  [792] = \"srawRR~R.\", [824] = \"srawiRR~A.\",\n\n  [794] = \"sradRR~R.\", [826] = \"sradiRR~H.\", [827] = \"sradiRR~H.\",\n  [922] = \"extshRR~.\", [954] = \"extsbRR~.\", [986] = \"extswRR~.\",\n\n  [539] = \"srdRR~R.\",\n},\n{ __index = function(t, x)\n    if band(x, 31) == 15 then return \"iselRRRC\" end\n  end\n})\n\nlocal map_ld = {\n  shift = 0, mask = 3,\n  [0] = \"ldRRE\", \"lduRRE\", \"lwaRRE\",\n}\n\nlocal map_std = {\n  shift = 0, mask = 3,\n  [0] = \"stdRRE\", \"stduRRE\",\n}\n\nlocal map_fps = {\n  shift = 5, mask = 1,\n  {\n    shift = 1, mask = 15,\n    [0] = false, false, \"fdivsFFF.\", false,\n    \"fsubsFFF.\", \"faddsFFF.\", \"fsqrtsF-F.\", false,\n    \"fresF-F.\", \"fmulsFF-F.\", \"frsqrtesF-F.\", false,\n    \"fmsubsFFFF~.\", \"fmaddsFFFF~.\", \"fnmsubsFFFF~.\", \"fnmaddsFFFF~.\",\n  }\n}\n\nlocal map_fpd = {\n  shift = 5, mask = 1,\n  [0] = {\n    shift = 1, mask = 1023,\n    [0] = \"fcmpuXFF\", [32] = \"fcmpoXFF\", [64] = \"mcrfsXX\",\n    [38] = \"mtfsb1A.\", [70] = \"mtfsb0A.\", [134] = \"mtfsfiA>>-A>\",\n    [8] = \"fcpsgnFFF.\", [40] = \"fnegF-F.\", [72] = \"fmrF-F.\",\n    [136] = \"fnabsF-F.\", [264] = \"fabsF-F.\",\n    [12] = \"frspF-F.\",\n    [14] = \"fctiwF-F.\", [15] = \"fctiwzF-F.\",\n    [583] = \"mffsF.\", [711] = \"mtfsfZF.\",\n    [392] = \"frinF-F.\", [424] = \"frizF-F.\",\n    [456] = \"fripF-F.\", [488] = \"frimF-F.\",\n    [814] = \"fctidF-F.\", [815] = \"fctidzF-F.\", [846] = \"fcfidF-F.\",\n  },\n  {\n    shift = 1, mask = 15,\n    [0] = false, false, \"fdivFFF.\", false,\n    \"fsubFFF.\", \"faddFFF.\", \"fsqrtF-F.\", \"fselFFFF~.\",\n    \"freF-F.\", \"fmulFF-F.\", \"frsqrteF-F.\", false,\n    \"fmsubFFFF~.\", \"fmaddFFFF~.\", \"fnmsubFFFF~.\", \"fnmaddFFFF~.\",\n  }\n}\n\nlocal map_spe = {\n  shift = 0, mask = 2047,\n\n  [512] = \"evaddwRRR\", [514] = \"evaddiwRAR~\",\n  [516] = \"evsubwRRR~\", [518] = \"evsubiwRAR~\",\n  [520] = \"evabsRR\", [521] = \"evnegRR\",\n  [522] = \"evextsbRR\", [523] = \"evextshRR\", [524] = \"evrndwRR\",\n  [525] = \"evcntlzwRR\", [526] = \"evcntlswRR\",\n\n  [527] = \"brincRRR\",\n\n  [529] = \"evandRRR\", [530] = \"evandcRRR\", [534] = \"evxorRRR\",\n  [535] = \"evor|evmrRRR=\", [536] = \"evnor|evnotRRR=\",\n  [537] = \"eveqvRRR\", [539] = \"evorcRRR\", [542] = \"evnandRRR\",\n\n  [544] = \"evsrwuRRR\", [545] = \"evsrwsRRR\",\n  [546] = \"evsrwiuRRA\", [547] = \"evsrwisRRA\",\n  [548] = \"evslwRRR\", [550] = \"evslwiRRA\",\n  [552] = \"evrlwRRR\", [553] = \"evsplatiRS\",\n  [554] = \"evrlwiRRA\", [555] = \"evsplatfiRS\",\n  [556] = \"evmergehiRRR\", [557] = \"evmergeloRRR\",\n  [558] = \"evmergehiloRRR\", [559] = \"evmergelohiRRR\",\n\n  [560] = \"evcmpgtuYRR\", [561] = \"evcmpgtsYRR\",\n  [562] = \"evcmpltuYRR\", [563] = \"evcmpltsYRR\",\n  [564] = \"evcmpeqYRR\",\n\n  [632] = \"evselRRR\", [633] = \"evselRRRW\",\n  [634] = \"evselRRRW\", [635] = \"evselRRRW\",\n  [636] = \"evselRRRW\", [637] = \"evselRRRW\",\n  [638] = \"evselRRRW\", [639] = \"evselRRRW\",\n\n  [640] = \"evfsaddRRR\", [641] = \"evfssubRRR\",\n  [644] = \"evfsabsRR\", [645] = \"evfsnabsRR\", [646] = \"evfsnegRR\",\n  [648] = \"evfsmulRRR\", [649] = \"evfsdivRRR\",\n  [652] = \"evfscmpgtYRR\", [653] = \"evfscmpltYRR\", [654] = \"evfscmpeqYRR\",\n  [656] = \"evfscfuiR-R\", [657] = \"evfscfsiR-R\",\n  [658] = \"evfscfufR-R\", [659] = \"evfscfsfR-R\",\n  [660] = \"evfsctuiR-R\", [661] = \"evfsctsiR-R\",\n  [662] = \"evfsctufR-R\", [663] = \"evfsctsfR-R\",\n  [664] = \"evfsctuizR-R\", [666] = \"evfsctsizR-R\",\n  [668] = \"evfststgtYRR\", [669] = \"evfststltYRR\", [670] = \"evfststeqYRR\",\n\n  [704] = \"efsaddRRR\", [705] = \"efssubRRR\",\n  [708] = \"efsabsRR\", [709] = \"efsnabsRR\", [710] = \"efsnegRR\",\n  [712] = \"efsmulRRR\", [713] = \"efsdivRRR\",\n  [716] = \"efscmpgtYRR\", [717] = \"efscmpltYRR\", [718] = \"efscmpeqYRR\",\n  [719] = \"efscfdR-R\",\n  [720] = \"efscfuiR-R\", [721] = \"efscfsiR-R\",\n  [722] = \"efscfufR-R\", [723] = \"efscfsfR-R\",\n  [724] = \"efsctuiR-R\", [725] = \"efsctsiR-R\",\n  [726] = \"efsctufR-R\", [727] = \"efsctsfR-R\",\n  [728] = \"efsctuizR-R\", [730] = \"efsctsizR-R\",\n  [732] = \"efststgtYRR\", [733] = \"efststltYRR\", [734] = \"efststeqYRR\",\n\n  [736] = \"efdaddRRR\", [737] = \"efdsubRRR\",\n  [738] = \"efdcfuidR-R\", [739] = \"efdcfsidR-R\",\n  [740] = \"efdabsRR\", [741] = \"efdnabsRR\", [742] = \"efdnegRR\",\n  [744] = \"efdmulRRR\", [745] = \"efddivRRR\",\n  [746] = \"efdctuidzR-R\", [747] = \"efdctsidzR-R\",\n  [748] = \"efdcmpgtYRR\", [749] = \"efdcmpltYRR\", [750] = \"efdcmpeqYRR\",\n  [751] = \"efdcfsR-R\",\n  [752] = \"efdcfuiR-R\", [753] = \"efdcfsiR-R\",\n  [754] = \"efdcfufR-R\", [755] = \"efdcfsfR-R\",\n  [756] = \"efdctuiR-R\", [757] = \"efdctsiR-R\",\n  [758] = \"efdctufR-R\", [759] = \"efdctsfR-R\",\n  [760] = \"efdctuizR-R\", [762] = \"efdctsizR-R\",\n  [764] = \"efdtstgtYRR\", [765] = \"efdtstltYRR\", [766] = \"efdtsteqYRR\",\n\n  [768] = \"evlddxRR0R\", [769] = \"evlddRR8\",\n  [770] = \"evldwxRR0R\", [771] = \"evldwRR8\",\n  [772] = \"evldhxRR0R\", [773] = \"evldhRR8\",\n  [776] = \"evlhhesplatxRR0R\", [777] = \"evlhhesplatRR2\",\n  [780] = \"evlhhousplatxRR0R\", [781] = \"evlhhousplatRR2\",\n  [782] = \"evlhhossplatxRR0R\", [783] = \"evlhhossplatRR2\",\n  [784] = \"evlwhexRR0R\", [785] = \"evlwheRR4\",\n  [788] = \"evlwhouxRR0R\", [789] = \"evlwhouRR4\",\n  [790] = \"evlwhosxRR0R\", [791] = \"evlwhosRR4\",\n  [792] = \"evlwwsplatxRR0R\", [793] = \"evlwwsplatRR4\",\n  [796] = \"evlwhsplatxRR0R\", [797] = \"evlwhsplatRR4\",\n\n  [800] = \"evstddxRR0R\", [801] = \"evstddRR8\",\n  [802] = \"evstdwxRR0R\", [803] = \"evstdwRR8\",\n  [804] = \"evstdhxRR0R\", [805] = \"evstdhRR8\",\n  [816] = \"evstwhexRR0R\", [817] = \"evstwheRR4\",\n  [820] = \"evstwhoxRR0R\", [821] = \"evstwhoRR4\",\n  [824] = \"evstwwexRR0R\", [825] = \"evstwweRR4\",\n  [828] = \"evstwwoxRR0R\", [829] = \"evstwwoRR4\",\n\n  [1027] = \"evmhessfRRR\", [1031] = \"evmhossfRRR\", [1032] = \"evmheumiRRR\",\n  [1033] = \"evmhesmiRRR\", [1035] = \"evmhesmfRRR\", [1036] = \"evmhoumiRRR\",\n  [1037] = \"evmhosmiRRR\", [1039] = \"evmhosmfRRR\", [1059] = \"evmhessfaRRR\",\n  [1063] = \"evmhossfaRRR\", [1064] = \"evmheumiaRRR\", [1065] = \"evmhesmiaRRR\",\n  [1067] = \"evmhesmfaRRR\", [1068] = \"evmhoumiaRRR\", [1069] = \"evmhosmiaRRR\",\n  [1071] = \"evmhosmfaRRR\", [1095] = \"evmwhssfRRR\", [1096] = \"evmwlumiRRR\",\n  [1100] = \"evmwhumiRRR\", [1101] = \"evmwhsmiRRR\", [1103] = \"evmwhsmfRRR\",\n  [1107] = \"evmwssfRRR\", [1112] = \"evmwumiRRR\", [1113] = \"evmwsmiRRR\",\n  [1115] = \"evmwsmfRRR\", [1127] = \"evmwhssfaRRR\", [1128] = \"evmwlumiaRRR\",\n  [1132] = \"evmwhumiaRRR\", [1133] = \"evmwhsmiaRRR\", [1135] = \"evmwhsmfaRRR\",\n  [1139] = \"evmwssfaRRR\", [1144] = \"evmwumiaRRR\", [1145] = \"evmwsmiaRRR\",\n  [1147] = \"evmwsmfaRRR\",\n\n  [1216] = \"evaddusiaawRR\", [1217] = \"evaddssiaawRR\",\n  [1218] = \"evsubfusiaawRR\", [1219] = \"evsubfssiaawRR\",\n  [1220] = \"evmraRR\",\n  [1222] = \"evdivwsRRR\", [1223] = \"evdivwuRRR\",\n  [1224] = \"evaddumiaawRR\", [1225] = \"evaddsmiaawRR\",\n  [1226] = \"evsubfumiaawRR\", [1227] = \"evsubfsmiaawRR\",\n\n  [1280] = \"evmheusiaawRRR\", [1281] = \"evmhessiaawRRR\",\n  [1283] = \"evmhessfaawRRR\", [1284] = \"evmhousiaawRRR\",\n  [1285] = \"evmhossiaawRRR\", [1287] = \"evmhossfaawRRR\",\n  [1288] = \"evmheumiaawRRR\", [1289] = \"evmhesmiaawRRR\",\n  [1291] = \"evmhesmfaawRRR\", [1292] = \"evmhoumiaawRRR\",\n  [1293] = \"evmhosmiaawRRR\", [1295] = \"evmhosmfaawRRR\",\n  [1320] = \"evmhegumiaaRRR\", [1321] = \"evmhegsmiaaRRR\",\n  [1323] = \"evmhegsmfaaRRR\", [1324] = \"evmhogumiaaRRR\",\n  [1325] = \"evmhogsmiaaRRR\", [1327] = \"evmhogsmfaaRRR\",\n  [1344] = \"evmwlusiaawRRR\", [1345] = \"evmwlssiaawRRR\",\n  [1352] = \"evmwlumiaawRRR\", [1353] = \"evmwlsmiaawRRR\",\n  [1363] = \"evmwssfaaRRR\", [1368] = \"evmwumiaaRRR\",\n  [1369] = \"evmwsmiaaRRR\", [1371] = \"evmwsmfaaRRR\",\n  [1408] = \"evmheusianwRRR\", [1409] = \"evmhessianwRRR\",\n  [1411] = \"evmhessfanwRRR\", [1412] = \"evmhousianwRRR\",\n  [1413] = \"evmhossianwRRR\", [1415] = \"evmhossfanwRRR\",\n  [1416] = \"evmheumianwRRR\", [1417] = \"evmhesmianwRRR\",\n  [1419] = \"evmhesmfanwRRR\", [1420] = \"evmhoumianwRRR\",\n  [1421] = \"evmhosmianwRRR\", [1423] = \"evmhosmfanwRRR\",\n  [1448] = \"evmhegumianRRR\", [1449] = \"evmhegsmianRRR\",\n  [1451] = \"evmhegsmfanRRR\", [1452] = \"evmhogumianRRR\",\n  [1453] = \"evmhogsmianRRR\", [1455] = \"evmhogsmfanRRR\",\n  [1472] = \"evmwlusianwRRR\", [1473] = \"evmwlssianwRRR\",\n  [1480] = \"evmwlumianwRRR\", [1481] = \"evmwlsmianwRRR\",\n  [1491] = \"evmwssfanRRR\", [1496] = \"evmwumianRRR\",\n  [1497] = \"evmwsmianRRR\", [1499] = \"evmwsmfanRRR\",\n}\n\nlocal map_pri = {\n  [0] = false,\tfalse,\t\t\"tdiARI\",\t\"twiARI\",\n  map_spe,\tfalse,\t\tfalse,\t\t\"mulliRRI\",\n  \"subficRRI\",\tfalse,\t\t\"cmpl_iYLRU\",\t\"cmp_iYLRI\",\n  \"addicRRI\",\t\"addic.RRI\",\t\"addi|liRR0I\",\t\"addis|lisRR0I\",\n  \"b_KBJ\",\t\"sc\",\t\t \"bKJ\",\t\tmap_crops,\n  \"rlwimiRR~AAA.\", map_rlwinm,\tfalse,\t\t\"rlwnmRR~RAA.\",\n  \"oriNRR~U\",\t\"orisRR~U\",\t\"xoriRR~U\",\t\"xorisRR~U\",\n  \"andi.RR~U\",\t\"andis.RR~U\",\tmap_rld,\tmap_ext,\n  \"lwzRRD\",\t\"lwzuRRD\",\t\"lbzRRD\",\t\"lbzuRRD\",\n  \"stwRRD\",\t\"stwuRRD\",\t\"stbRRD\",\t\"stbuRRD\",\n  \"lhzRRD\",\t\"lhzuRRD\",\t\"lhaRRD\",\t\"lhauRRD\",\n  \"sthRRD\",\t\"sthuRRD\",\t\"lmwRRD\",\t\"stmwRRD\",\n  \"lfsFRD\",\t\"lfsuFRD\",\t\"lfdFRD\",\t\"lfduFRD\",\n  \"stfsFRD\",\t\"stfsuFRD\",\t\"stfdFRD\",\t\"stfduFRD\",\n  false,\tfalse,\t\tmap_ld,\t\tmap_fps,\n  false,\tfalse,\t\tmap_std,\tmap_fpd,\n}\n\n------------------------------------------------------------------------------\n\nlocal map_gpr = {\n  [0] = \"r0\", \"sp\", \"r2\", \"r3\", \"r4\", \"r5\", \"r6\", \"r7\",\n  \"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"r14\", \"r15\",\n  \"r16\", \"r17\", \"r18\", \"r19\", \"r20\", \"r21\", \"r22\", \"r23\",\n  \"r24\", \"r25\", \"r26\", \"r27\", \"r28\", \"r29\", \"r30\", \"r31\",\n}\n\nlocal map_cond = { [0] = \"lt\", \"gt\", \"eq\", \"so\", \"ge\", \"le\", \"ne\", \"ns\", }\n\n-- Format a condition bit.\nlocal function condfmt(cond)\n  if cond <= 3 then\n    return map_cond[band(cond, 3)]\n  else\n    return format(\"4*cr%d+%s\", rshift(cond, 2), map_cond[band(cond, 3)])\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Output a nicely formatted line with an opcode and operands.\nlocal function putop(ctx, text, operands)\n  local pos = ctx.pos\n  local extra = \"\"\n  if ctx.rel then\n    local sym = ctx.symtab[ctx.rel]\n    if sym then extra = \"\\t->\"..sym end\n  end\n  if ctx.hexdump > 0 then\n    ctx.out(format(\"%08x  %s  %-7s %s%s\\n\",\n\t    ctx.addr+pos, tohex(ctx.op), text, concat(operands, \", \"), extra))\n  else\n    ctx.out(format(\"%08x  %-7s %s%s\\n\",\n\t    ctx.addr+pos, text, concat(operands, \", \"), extra))\n  end\n  ctx.pos = pos + 4\nend\n\n-- Fallback for unknown opcodes.\nlocal function unknown(ctx)\n  return putop(ctx, \".long\", { \"0x\"..tohex(ctx.op) })\nend\n\n-- Disassemble a single instruction.\nlocal function disass_ins(ctx)\n  local pos = ctx.pos\n  local b0, b1, b2, b3 = byte(ctx.code, pos+1, pos+4)\n  local op = bor(lshift(b0, 24), lshift(b1, 16), lshift(b2, 8), b3)\n  local operands = {}\n  local last = nil\n  local rs = 21\n  ctx.op = op\n  ctx.rel = nil\n\n  local opat = map_pri[rshift(b0, 2)]\n  while type(opat) ~= \"string\" do\n    if not opat then return unknown(ctx) end\n    opat = opat[band(rshift(op, opat.shift), opat.mask)]\n  end\n  local name, pat = match(opat, \"^([a-z0-9_.]*)(.*)\")\n  local altname, pat2 = match(pat, \"|([a-z0-9_.]*)(.*)\")\n  if altname then pat = pat2 end\n\n  for p in gmatch(pat, \".\") do\n    local x = nil\n    if p == \"R\" then\n      x = map_gpr[band(rshift(op, rs), 31)]\n      rs = rs - 5\n    elseif p == \"F\" then\n      x = \"f\"..band(rshift(op, rs), 31)\n      rs = rs - 5\n    elseif p == \"A\" then\n      x = band(rshift(op, rs), 31)\n      rs = rs - 5\n    elseif p == \"S\" then\n      x = arshift(lshift(op, 27-rs), 27)\n      rs = rs - 5\n    elseif p == \"I\" then\n      x = arshift(lshift(op, 16), 16)\n    elseif p == \"U\" then\n      x = band(op, 0xffff)\n    elseif p == \"D\" or p == \"E\" then\n      local disp = arshift(lshift(op, 16), 16)\n      if p == \"E\" then disp = band(disp, -4) end\n      if last == \"r0\" then last = \"0\" end\n      operands[#operands] = format(\"%d(%s)\", disp, last)\n    elseif p >= \"2\" and p <= \"8\" then\n      local disp = band(rshift(op, rs), 31) * p\n      if last == \"r0\" then last = \"0\" end\n      operands[#operands] = format(\"%d(%s)\", disp, last)\n    elseif p == \"H\" then\n      x = band(rshift(op, rs), 31) + lshift(band(op, 2), 4)\n      rs = rs - 5\n    elseif p == \"M\" then\n      x = band(rshift(op, rs), 31) + band(op, 0x20)\n    elseif p == \"C\" then\n      x = condfmt(band(rshift(op, rs), 31))\n      rs = rs - 5\n    elseif p == \"B\" then\n      local bo = rshift(op, 21)\n      local cond = band(rshift(op, 16), 31)\n      local cn = \"\"\n      rs = rs - 10\n      if band(bo, 4) == 0 then\n\tcn = band(bo, 2) == 0 and \"dnz\" or \"dz\"\n\tif band(bo, 0x10) == 0 then\n\t  cn = cn..(band(bo, 8) == 0 and \"f\" or \"t\")\n\tend\n\tif band(bo, 0x10) == 0 then x = condfmt(cond) end\n\tname = name..(band(bo, 1) == band(rshift(op, 15), 1) and \"-\" or \"+\")\n      elseif band(bo, 0x10) == 0 then\n\tcn = map_cond[band(cond, 3) + (band(bo, 8) == 0 and 4 or 0)]\n\tif cond > 3 then x = \"cr\"..rshift(cond, 2) end\n\tname = name..(band(bo, 1) == band(rshift(op, 15), 1) and \"-\" or \"+\")\n      end\n      name = gsub(name, \"_\", cn)\n    elseif p == \"J\" then\n      x = arshift(lshift(op, 27-rs), 29-rs)*4\n      if band(op, 2) == 0 then x = ctx.addr + pos + x end\n      ctx.rel = x\n      x = \"0x\"..tohex(x)\n    elseif p == \"K\" then\n      if band(op, 1) ~= 0 then name = name..\"l\" end\n      if band(op, 2) ~= 0 then name = name..\"a\" end\n    elseif p == \"X\" or p == \"Y\" then\n      x = band(rshift(op, rs+2), 7)\n      if x == 0 and p == \"Y\" then x = nil else x = \"cr\"..x end\n      rs = rs - 5\n    elseif p == \"W\" then\n      x = \"cr\"..band(op, 7)\n    elseif p == \"Z\" then\n      x = band(rshift(op, rs-4), 255)\n      rs = rs - 10\n    elseif p == \">\" then\n      operands[#operands] = rshift(operands[#operands], 1)\n    elseif p == \"0\" then\n      if last == \"r0\" then\n\toperands[#operands] = nil\n\tif altname then name = altname end\n      end\n    elseif p == \"L\" then\n      name = gsub(name, \"_\", band(op, 0x00200000) ~= 0 and \"d\" or \"w\")\n    elseif p == \".\" then\n      if band(op, 1) == 1 then name = name..\".\" end\n    elseif p == \"N\" then\n      if op == 0x60000000 then name = \"nop\"; break end\n    elseif p == \"~\" then\n      local n = #operands\n      operands[n-1],  operands[n] = operands[n], operands[n-1]\n    elseif p == \"=\" then\n      local n = #operands\n      if last == operands[n-1] then\n\toperands[n] = nil\n\tname = altname\n      end\n    elseif p == \"%\" then\n      local n = #operands\n      if last == operands[n-1] and last == operands[n-2] then\n\toperands[n] = nil\n\toperands[n-1] = nil\n\tname = altname\n      end\n    elseif p == \"-\" then\n      rs = rs - 5\n    else\n      assert(false)\n    end\n    if x then operands[#operands+1] = x; last = x end\n  end\n\n  return putop(ctx, name, operands)\nend\n\n------------------------------------------------------------------------------\n\n-- Disassemble a block of code.\nlocal function disass_block(ctx, ofs, len)\n  if not ofs then ofs = 0 end\n  local stop = len and ofs+len or #ctx.code\n  stop = stop - stop % 4\n  ctx.pos = ofs - ofs % 4\n  ctx.rel = nil\n  while ctx.pos < stop do disass_ins(ctx) end\nend\n\n-- Extended API: create a disassembler context. Then call ctx:disass(ofs, len).\nlocal function create_(code, addr, out)\n  local ctx = {}\n  ctx.code = code\n  ctx.addr = addr or 0\n  ctx.out = out or io.write\n  ctx.symtab = {}\n  ctx.disass = disass_block\n  ctx.hexdump = 8\n  return ctx\nend\n\n-- Simple API: disassemble code (a string) at address and output via out.\nlocal function disass_(code, addr, out)\n  create_(code, addr, out):disass()\nend\n\n-- Return register name for RID.\nlocal function regname_(r)\n  if r < 32 then return map_gpr[r] end\n  return \"f\"..(r-32)\nend\n\n-- Public module functions.\nmodule(...)\n\ncreate = create_\ndisass = disass_\nregname = regname_\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/dis_x64.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT x64 disassembler wrapper module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n-- This module just exports the 64 bit functions from the combined\n-- x86/x64 disassembler module. All the interesting stuff is there.\n------------------------------------------------------------------------------\n\nlocal require = require\n\nmodule(...)\n\nlocal dis_x86 = require(_PACKAGE..\"dis_x86\")\n\ncreate = dis_x86.create64\ndisass = dis_x86.disass64\nregname = dis_x86.regname64\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/dis_x86.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT x86/x64 disassembler module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n-- This is a helper module used by the LuaJIT machine code dumper module.\n--\n-- Sending small code snippets to an external disassembler and mixing the\n-- output with our own stuff was too fragile. So I had to bite the bullet\n-- and write yet another x86 disassembler. Oh well ...\n--\n-- The output format is very similar to what ndisasm generates. But it has\n-- been developed independently by looking at the opcode tables from the\n-- Intel and AMD manuals. The supported instruction set is quite extensive\n-- and reflects what a current generation Intel or AMD CPU implements in\n-- 32 bit and 64 bit mode. Yes, this includes MMX, SSE, SSE2, SSE3, SSSE3,\n-- SSE4.1, SSE4.2, SSE4a and even privileged and hypervisor (VMX/SVM)\n-- instructions.\n--\n-- Notes:\n-- * The (useless) a16 prefix, 3DNow and pre-586 opcodes are unsupported.\n-- * No attempt at optimization has been made -- it's fast enough for my needs.\n-- * The public API may change when more architectures are added.\n------------------------------------------------------------------------------\n\nlocal type = type\nlocal sub, byte, format = string.sub, string.byte, string.format\nlocal match, gmatch, gsub = string.match, string.gmatch, string.gsub\nlocal lower, rep = string.lower, string.rep\n\n-- Map for 1st opcode byte in 32 bit mode. Ugly? Well ... read on.\nlocal map_opc1_32 = {\n--0x\n[0]=\"addBmr\",\"addVmr\",\"addBrm\",\"addVrm\",\"addBai\",\"addVai\",\"push es\",\"pop es\",\n\"orBmr\",\"orVmr\",\"orBrm\",\"orVrm\",\"orBai\",\"orVai\",\"push cs\",\"opc2*\",\n--1x\n\"adcBmr\",\"adcVmr\",\"adcBrm\",\"adcVrm\",\"adcBai\",\"adcVai\",\"push ss\",\"pop ss\",\n\"sbbBmr\",\"sbbVmr\",\"sbbBrm\",\"sbbVrm\",\"sbbBai\",\"sbbVai\",\"push ds\",\"pop ds\",\n--2x\n\"andBmr\",\"andVmr\",\"andBrm\",\"andVrm\",\"andBai\",\"andVai\",\"es:seg\",\"daa\",\n\"subBmr\",\"subVmr\",\"subBrm\",\"subVrm\",\"subBai\",\"subVai\",\"cs:seg\",\"das\",\n--3x\n\"xorBmr\",\"xorVmr\",\"xorBrm\",\"xorVrm\",\"xorBai\",\"xorVai\",\"ss:seg\",\"aaa\",\n\"cmpBmr\",\"cmpVmr\",\"cmpBrm\",\"cmpVrm\",\"cmpBai\",\"cmpVai\",\"ds:seg\",\"aas\",\n--4x\n\"incVR\",\"incVR\",\"incVR\",\"incVR\",\"incVR\",\"incVR\",\"incVR\",\"incVR\",\n\"decVR\",\"decVR\",\"decVR\",\"decVR\",\"decVR\",\"decVR\",\"decVR\",\"decVR\",\n--5x\n\"pushUR\",\"pushUR\",\"pushUR\",\"pushUR\",\"pushUR\",\"pushUR\",\"pushUR\",\"pushUR\",\n\"popUR\",\"popUR\",\"popUR\",\"popUR\",\"popUR\",\"popUR\",\"popUR\",\"popUR\",\n--6x\n\"sz*pushaw,pusha\",\"sz*popaw,popa\",\"boundVrm\",\"arplWmr\",\n\"fs:seg\",\"gs:seg\",\"o16:\",\"a16\",\n\"pushUi\",\"imulVrmi\",\"pushBs\",\"imulVrms\",\n\"insb\",\"insVS\",\"outsb\",\"outsVS\",\n--7x\n\"joBj\",\"jnoBj\",\"jbBj\",\"jnbBj\",\"jzBj\",\"jnzBj\",\"jbeBj\",\"jaBj\",\n\"jsBj\",\"jnsBj\",\"jpeBj\",\"jpoBj\",\"jlBj\",\"jgeBj\",\"jleBj\",\"jgBj\",\n--8x\n\"arith!Bmi\",\"arith!Vmi\",\"arith!Bmi\",\"arith!Vms\",\n\"testBmr\",\"testVmr\",\"xchgBrm\",\"xchgVrm\",\n\"movBmr\",\"movVmr\",\"movBrm\",\"movVrm\",\n\"movVmg\",\"leaVrm\",\"movWgm\",\"popUm\",\n--9x\n\"nop*xchgVaR|pause|xchgWaR|repne nop\",\"xchgVaR\",\"xchgVaR\",\"xchgVaR\",\n\"xchgVaR\",\"xchgVaR\",\"xchgVaR\",\"xchgVaR\",\n\"sz*cbw,cwde,cdqe\",\"sz*cwd,cdq,cqo\",\"call farViw\",\"wait\",\n\"sz*pushfw,pushf\",\"sz*popfw,popf\",\"sahf\",\"lahf\",\n--Ax\n\"movBao\",\"movVao\",\"movBoa\",\"movVoa\",\n\"movsb\",\"movsVS\",\"cmpsb\",\"cmpsVS\",\n\"testBai\",\"testVai\",\"stosb\",\"stosVS\",\n\"lodsb\",\"lodsVS\",\"scasb\",\"scasVS\",\n--Bx\n\"movBRi\",\"movBRi\",\"movBRi\",\"movBRi\",\"movBRi\",\"movBRi\",\"movBRi\",\"movBRi\",\n\"movVRI\",\"movVRI\",\"movVRI\",\"movVRI\",\"movVRI\",\"movVRI\",\"movVRI\",\"movVRI\",\n--Cx\n\"shift!Bmu\",\"shift!Vmu\",\"retBw\",\"ret\",\"$lesVrm\",\"$ldsVrm\",\"movBmi\",\"movVmi\",\n\"enterBwu\",\"leave\",\"retfBw\",\"retf\",\"int3\",\"intBu\",\"into\",\"iretVS\",\n--Dx\n\"shift!Bm1\",\"shift!Vm1\",\"shift!Bmc\",\"shift!Vmc\",\"aamBu\",\"aadBu\",\"salc\",\"xlatb\",\n\"fp*0\",\"fp*1\",\"fp*2\",\"fp*3\",\"fp*4\",\"fp*5\",\"fp*6\",\"fp*7\",\n--Ex\n\"loopneBj\",\"loopeBj\",\"loopBj\",\"sz*jcxzBj,jecxzBj,jrcxzBj\",\n\"inBau\",\"inVau\",\"outBua\",\"outVua\",\n\"callVj\",\"jmpVj\",\"jmp farViw\",\"jmpBj\",\"inBad\",\"inVad\",\"outBda\",\"outVda\",\n--Fx\n\"lock:\",\"int1\",\"repne:rep\",\"rep:\",\"hlt\",\"cmc\",\"testb!Bm\",\"testv!Vm\",\n\"clc\",\"stc\",\"cli\",\"sti\",\"cld\",\"std\",\"incb!Bm\",\"incd!Vm\",\n}\nassert(#map_opc1_32 == 255)\n\n-- Map for 1st opcode byte in 64 bit mode (overrides only).\nlocal map_opc1_64 = setmetatable({\n  [0x06]=false, [0x07]=false, [0x0e]=false,\n  [0x16]=false, [0x17]=false, [0x1e]=false, [0x1f]=false,\n  [0x27]=false, [0x2f]=false, [0x37]=false, [0x3f]=false,\n  [0x60]=false, [0x61]=false, [0x62]=false, [0x63]=\"movsxdVrDmt\", [0x67]=\"a32:\",\n  [0x40]=\"rex*\",   [0x41]=\"rex*b\",   [0x42]=\"rex*x\",   [0x43]=\"rex*xb\",\n  [0x44]=\"rex*r\",  [0x45]=\"rex*rb\",  [0x46]=\"rex*rx\",  [0x47]=\"rex*rxb\",\n  [0x48]=\"rex*w\",  [0x49]=\"rex*wb\",  [0x4a]=\"rex*wx\",  [0x4b]=\"rex*wxb\",\n  [0x4c]=\"rex*wr\", [0x4d]=\"rex*wrb\", [0x4e]=\"rex*wrx\", [0x4f]=\"rex*wrxb\",\n  [0x82]=false, [0x9a]=false, [0xc4]=false, [0xc5]=false, [0xce]=false,\n  [0xd4]=false, [0xd5]=false, [0xd6]=false, [0xea]=false,\n}, { __index = map_opc1_32 })\n\n-- Map for 2nd opcode byte (0F xx). True CISC hell. Hey, I told you.\n-- Prefix dependent MMX/SSE opcodes: (none)|rep|o16|repne, -|F3|66|F2\nlocal map_opc2 = {\n--0x\n[0]=\"sldt!Dmp\",\"sgdt!Ump\",\"larVrm\",\"lslVrm\",nil,\"syscall\",\"clts\",\"sysret\",\n\"invd\",\"wbinvd\",nil,\"ud1\",nil,\"$prefetch!Bm\",\"femms\",\"3dnowMrmu\",\n--1x\n\"movupsXrm|movssXrm|movupdXrm|movsdXrm\",\n\"movupsXmr|movssXmr|movupdXmr|movsdXmr\",\n\"movhlpsXrm$movlpsXrm|movsldupXrm|movlpdXrm|movddupXrm\",\n\"movlpsXmr||movlpdXmr\",\n\"unpcklpsXrm||unpcklpdXrm\",\n\"unpckhpsXrm||unpckhpdXrm\",\n\"movlhpsXrm$movhpsXrm|movshdupXrm|movhpdXrm\",\n\"movhpsXmr||movhpdXmr\",\n\"$prefetcht!Bm\",\"hintnopVm\",\"hintnopVm\",\"hintnopVm\",\n\"hintnopVm\",\"hintnopVm\",\"hintnopVm\",\"hintnopVm\",\n--2x\n\"movUmx$\",\"movUmy$\",\"movUxm$\",\"movUym$\",\"movUmz$\",nil,\"movUzm$\",nil,\n\"movapsXrm||movapdXrm\",\n\"movapsXmr||movapdXmr\",\n\"cvtpi2psXrMm|cvtsi2ssXrVmt|cvtpi2pdXrMm|cvtsi2sdXrVmt\",\n\"movntpsXmr|movntssXmr|movntpdXmr|movntsdXmr\",\n\"cvttps2piMrXm|cvttss2siVrXm|cvttpd2piMrXm|cvttsd2siVrXm\",\n\"cvtps2piMrXm|cvtss2siVrXm|cvtpd2piMrXm|cvtsd2siVrXm\",\n\"ucomissXrm||ucomisdXrm\",\n\"comissXrm||comisdXrm\",\n--3x\n\"wrmsr\",\"rdtsc\",\"rdmsr\",\"rdpmc\",\"sysenter\",\"sysexit\",nil,\"getsec\",\n\"opc3*38\",nil,\"opc3*3a\",nil,nil,nil,nil,nil,\n--4x\n\"cmovoVrm\",\"cmovnoVrm\",\"cmovbVrm\",\"cmovnbVrm\",\n\"cmovzVrm\",\"cmovnzVrm\",\"cmovbeVrm\",\"cmovaVrm\",\n\"cmovsVrm\",\"cmovnsVrm\",\"cmovpeVrm\",\"cmovpoVrm\",\n\"cmovlVrm\",\"cmovgeVrm\",\"cmovleVrm\",\"cmovgVrm\",\n--5x\n\"movmskpsVrXm$||movmskpdVrXm$\",\"sqrtpsXrm|sqrtssXrm|sqrtpdXrm|sqrtsdXrm\",\n\"rsqrtpsXrm|rsqrtssXrm\",\"rcppsXrm|rcpssXrm\",\n\"andpsXrm||andpdXrm\",\"andnpsXrm||andnpdXrm\",\n\"orpsXrm||orpdXrm\",\"xorpsXrm||xorpdXrm\",\n\"addpsXrm|addssXrm|addpdXrm|addsdXrm\",\"mulpsXrm|mulssXrm|mulpdXrm|mulsdXrm\",\n\"cvtps2pdXrm|cvtss2sdXrm|cvtpd2psXrm|cvtsd2ssXrm\",\n\"cvtdq2psXrm|cvttps2dqXrm|cvtps2dqXrm\",\n\"subpsXrm|subssXrm|subpdXrm|subsdXrm\",\"minpsXrm|minssXrm|minpdXrm|minsdXrm\",\n\"divpsXrm|divssXrm|divpdXrm|divsdXrm\",\"maxpsXrm|maxssXrm|maxpdXrm|maxsdXrm\",\n--6x\n\"punpcklbwPrm\",\"punpcklwdPrm\",\"punpckldqPrm\",\"packsswbPrm\",\n\"pcmpgtbPrm\",\"pcmpgtwPrm\",\"pcmpgtdPrm\",\"packuswbPrm\",\n\"punpckhbwPrm\",\"punpckhwdPrm\",\"punpckhdqPrm\",\"packssdwPrm\",\n\"||punpcklqdqXrm\",\"||punpckhqdqXrm\",\n\"movPrVSm\",\"movqMrm|movdquXrm|movdqaXrm\",\n--7x\n\"pshufwMrmu|pshufhwXrmu|pshufdXrmu|pshuflwXrmu\",\"pshiftw!Pmu\",\n\"pshiftd!Pmu\",\"pshiftq!Mmu||pshiftdq!Xmu\",\n\"pcmpeqbPrm\",\"pcmpeqwPrm\",\"pcmpeqdPrm\",\"emms|\",\n\"vmreadUmr||extrqXmuu$|insertqXrmuu$\",\"vmwriteUrm||extrqXrm$|insertqXrm$\",\nnil,nil,\n\"||haddpdXrm|haddpsXrm\",\"||hsubpdXrm|hsubpsXrm\",\n\"movVSmMr|movqXrm|movVSmXr\",\"movqMmr|movdquXmr|movdqaXmr\",\n--8x\n\"joVj\",\"jnoVj\",\"jbVj\",\"jnbVj\",\"jzVj\",\"jnzVj\",\"jbeVj\",\"jaVj\",\n\"jsVj\",\"jnsVj\",\"jpeVj\",\"jpoVj\",\"jlVj\",\"jgeVj\",\"jleVj\",\"jgVj\",\n--9x\n\"setoBm\",\"setnoBm\",\"setbBm\",\"setnbBm\",\"setzBm\",\"setnzBm\",\"setbeBm\",\"setaBm\",\n\"setsBm\",\"setnsBm\",\"setpeBm\",\"setpoBm\",\"setlBm\",\"setgeBm\",\"setleBm\",\"setgBm\",\n--Ax\n\"push fs\",\"pop fs\",\"cpuid\",\"btVmr\",\"shldVmru\",\"shldVmrc\",nil,nil,\n\"push gs\",\"pop gs\",\"rsm\",\"btsVmr\",\"shrdVmru\",\"shrdVmrc\",\"fxsave!Dmp\",\"imulVrm\",\n--Bx\n\"cmpxchgBmr\",\"cmpxchgVmr\",\"$lssVrm\",\"btrVmr\",\n\"$lfsVrm\",\"$lgsVrm\",\"movzxVrBmt\",\"movzxVrWmt\",\n\"|popcntVrm\",\"ud2Dp\",\"bt!Vmu\",\"btcVmr\",\n\"bsfVrm\",\"bsrVrm|lzcntVrm|bsrWrm\",\"movsxVrBmt\",\"movsxVrWmt\",\n--Cx\n\"xaddBmr\",\"xaddVmr\",\n\"cmppsXrmu|cmpssXrmu|cmppdXrmu|cmpsdXrmu\",\"$movntiVmr|\",\n\"pinsrwPrWmu\",\"pextrwDrPmu\",\n\"shufpsXrmu||shufpdXrmu\",\"$cmpxchg!Qmp\",\n\"bswapVR\",\"bswapVR\",\"bswapVR\",\"bswapVR\",\"bswapVR\",\"bswapVR\",\"bswapVR\",\"bswapVR\",\n--Dx\n\"||addsubpdXrm|addsubpsXrm\",\"psrlwPrm\",\"psrldPrm\",\"psrlqPrm\",\n\"paddqPrm\",\"pmullwPrm\",\n\"|movq2dqXrMm|movqXmr|movdq2qMrXm$\",\"pmovmskbVrMm||pmovmskbVrXm\",\n\"psubusbPrm\",\"psubuswPrm\",\"pminubPrm\",\"pandPrm\",\n\"paddusbPrm\",\"padduswPrm\",\"pmaxubPrm\",\"pandnPrm\",\n--Ex\n\"pavgbPrm\",\"psrawPrm\",\"psradPrm\",\"pavgwPrm\",\n\"pmulhuwPrm\",\"pmulhwPrm\",\n\"|cvtdq2pdXrm|cvttpd2dqXrm|cvtpd2dqXrm\",\"$movntqMmr||$movntdqXmr\",\n\"psubsbPrm\",\"psubswPrm\",\"pminswPrm\",\"porPrm\",\n\"paddsbPrm\",\"paddswPrm\",\"pmaxswPrm\",\"pxorPrm\",\n--Fx\n\"|||lddquXrm\",\"psllwPrm\",\"pslldPrm\",\"psllqPrm\",\n\"pmuludqPrm\",\"pmaddwdPrm\",\"psadbwPrm\",\"maskmovqMrm||maskmovdquXrm$\",\n\"psubbPrm\",\"psubwPrm\",\"psubdPrm\",\"psubqPrm\",\n\"paddbPrm\",\"paddwPrm\",\"padddPrm\",\"ud\",\n}\nassert(map_opc2[255] == \"ud\")\n\n-- Map for three-byte opcodes. Can't wait for their next invention.\nlocal map_opc3 = {\n[\"38\"] = { -- [66] 0f 38 xx\n--0x\n[0]=\"pshufbPrm\",\"phaddwPrm\",\"phadddPrm\",\"phaddswPrm\",\n\"pmaddubswPrm\",\"phsubwPrm\",\"phsubdPrm\",\"phsubswPrm\",\n\"psignbPrm\",\"psignwPrm\",\"psigndPrm\",\"pmulhrswPrm\",\nnil,nil,nil,nil,\n--1x\n\"||pblendvbXrma\",nil,nil,nil,\n\"||blendvpsXrma\",\"||blendvpdXrma\",nil,\"||ptestXrm\",\nnil,nil,nil,nil,\n\"pabsbPrm\",\"pabswPrm\",\"pabsdPrm\",nil,\n--2x\n\"||pmovsxbwXrm\",\"||pmovsxbdXrm\",\"||pmovsxbqXrm\",\"||pmovsxwdXrm\",\n\"||pmovsxwqXrm\",\"||pmovsxdqXrm\",nil,nil,\n\"||pmuldqXrm\",\"||pcmpeqqXrm\",\"||$movntdqaXrm\",\"||packusdwXrm\",\nnil,nil,nil,nil,\n--3x\n\"||pmovzxbwXrm\",\"||pmovzxbdXrm\",\"||pmovzxbqXrm\",\"||pmovzxwdXrm\",\n\"||pmovzxwqXrm\",\"||pmovzxdqXrm\",nil,\"||pcmpgtqXrm\",\n\"||pminsbXrm\",\"||pminsdXrm\",\"||pminuwXrm\",\"||pminudXrm\",\n\"||pmaxsbXrm\",\"||pmaxsdXrm\",\"||pmaxuwXrm\",\"||pmaxudXrm\",\n--4x\n\"||pmulddXrm\",\"||phminposuwXrm\",\n--Fx\n[0xf0] = \"|||crc32TrBmt\",[0xf1] = \"|||crc32TrVmt\",\n},\n\n[\"3a\"] = { -- [66] 0f 3a xx\n--0x\n[0x00]=nil,nil,nil,nil,nil,nil,nil,nil,\n\"||roundpsXrmu\",\"||roundpdXrmu\",\"||roundssXrmu\",\"||roundsdXrmu\",\n\"||blendpsXrmu\",\"||blendpdXrmu\",\"||pblendwXrmu\",\"palignrPrmu\",\n--1x\nnil,nil,nil,nil,\n\"||pextrbVmXru\",\"||pextrwVmXru\",\"||pextrVmSXru\",\"||extractpsVmXru\",\nnil,nil,nil,nil,nil,nil,nil,nil,\n--2x\n\"||pinsrbXrVmu\",\"||insertpsXrmu\",\"||pinsrXrVmuS\",nil,\n--4x\n[0x40] = \"||dppsXrmu\",\n[0x41] = \"||dppdXrmu\",\n[0x42] = \"||mpsadbwXrmu\",\n--6x\n[0x60] = \"||pcmpestrmXrmu\",[0x61] = \"||pcmpestriXrmu\",\n[0x62] = \"||pcmpistrmXrmu\",[0x63] = \"||pcmpistriXrmu\",\n},\n}\n\n-- Map for VMX/SVM opcodes 0F 01 C0-FF (sgdt group with register operands).\nlocal map_opcvm = {\n[0xc1]=\"vmcall\",[0xc2]=\"vmlaunch\",[0xc3]=\"vmresume\",[0xc4]=\"vmxoff\",\n[0xc8]=\"monitor\",[0xc9]=\"mwait\",\n[0xd8]=\"vmrun\",[0xd9]=\"vmmcall\",[0xda]=\"vmload\",[0xdb]=\"vmsave\",\n[0xdc]=\"stgi\",[0xdd]=\"clgi\",[0xde]=\"skinit\",[0xdf]=\"invlpga\",\n[0xf8]=\"swapgs\",[0xf9]=\"rdtscp\",\n}\n\n-- Map for FP opcodes. And you thought stack machines are simple?\nlocal map_opcfp = {\n-- D8-DF 00-BF: opcodes with a memory operand.\n-- D8\n[0]=\"faddFm\",\"fmulFm\",\"fcomFm\",\"fcompFm\",\"fsubFm\",\"fsubrFm\",\"fdivFm\",\"fdivrFm\",\n\"fldFm\",nil,\"fstFm\",\"fstpFm\",\"fldenvVm\",\"fldcwWm\",\"fnstenvVm\",\"fnstcwWm\",\n-- DA\n\"fiaddDm\",\"fimulDm\",\"ficomDm\",\"ficompDm\",\n\"fisubDm\",\"fisubrDm\",\"fidivDm\",\"fidivrDm\",\n-- DB\n\"fildDm\",\"fisttpDm\",\"fistDm\",\"fistpDm\",nil,\"fld twordFmp\",nil,\"fstp twordFmp\",\n-- DC\n\"faddGm\",\"fmulGm\",\"fcomGm\",\"fcompGm\",\"fsubGm\",\"fsubrGm\",\"fdivGm\",\"fdivrGm\",\n-- DD\n\"fldGm\",\"fisttpQm\",\"fstGm\",\"fstpGm\",\"frstorDmp\",nil,\"fnsaveDmp\",\"fnstswWm\",\n-- DE\n\"fiaddWm\",\"fimulWm\",\"ficomWm\",\"ficompWm\",\n\"fisubWm\",\"fisubrWm\",\"fidivWm\",\"fidivrWm\",\n-- DF\n\"fildWm\",\"fisttpWm\",\"fistWm\",\"fistpWm\",\n\"fbld twordFmp\",\"fildQm\",\"fbstp twordFmp\",\"fistpQm\",\n-- xx C0-FF: opcodes with a pseudo-register operand.\n-- D8\n\"faddFf\",\"fmulFf\",\"fcomFf\",\"fcompFf\",\"fsubFf\",\"fsubrFf\",\"fdivFf\",\"fdivrFf\",\n-- D9\n\"fldFf\",\"fxchFf\",{\"fnop\"},nil,\n{\"fchs\",\"fabs\",nil,nil,\"ftst\",\"fxam\"},\n{\"fld1\",\"fldl2t\",\"fldl2e\",\"fldpi\",\"fldlg2\",\"fldln2\",\"fldz\"},\n{\"f2xm1\",\"fyl2x\",\"fptan\",\"fpatan\",\"fxtract\",\"fprem1\",\"fdecstp\",\"fincstp\"},\n{\"fprem\",\"fyl2xp1\",\"fsqrt\",\"fsincos\",\"frndint\",\"fscale\",\"fsin\",\"fcos\"},\n-- DA\n\"fcmovbFf\",\"fcmoveFf\",\"fcmovbeFf\",\"fcmovuFf\",nil,{nil,\"fucompp\"},nil,nil,\n-- DB\n\"fcmovnbFf\",\"fcmovneFf\",\"fcmovnbeFf\",\"fcmovnuFf\",\n{nil,nil,\"fnclex\",\"fninit\"},\"fucomiFf\",\"fcomiFf\",nil,\n-- DC\n\"fadd toFf\",\"fmul toFf\",nil,nil,\n\"fsub toFf\",\"fsubr toFf\",\"fdivr toFf\",\"fdiv toFf\",\n-- DD\n\"ffreeFf\",nil,\"fstFf\",\"fstpFf\",\"fucomFf\",\"fucompFf\",nil,nil,\n-- DE\n\"faddpFf\",\"fmulpFf\",nil,{nil,\"fcompp\"},\n\"fsubrpFf\",\"fsubpFf\",\"fdivrpFf\",\"fdivpFf\",\n-- DF\nnil,nil,nil,nil,{\"fnstsw ax\"},\"fucomipFf\",\"fcomipFf\",nil,\n}\nassert(map_opcfp[126] == \"fcomipFf\")\n\n-- Map for opcode groups. The subkey is sp from the ModRM byte.\nlocal map_opcgroup = {\n  arith = { \"add\", \"or\", \"adc\", \"sbb\", \"and\", \"sub\", \"xor\", \"cmp\" },\n  shift = { \"rol\", \"ror\", \"rcl\", \"rcr\", \"shl\", \"shr\", \"sal\", \"sar\" },\n  testb = { \"testBmi\", \"testBmi\", \"not\", \"neg\", \"mul\", \"imul\", \"div\", \"idiv\" },\n  testv = { \"testVmi\", \"testVmi\", \"not\", \"neg\", \"mul\", \"imul\", \"div\", \"idiv\" },\n  incb = { \"inc\", \"dec\" },\n  incd = { \"inc\", \"dec\", \"callUmp\", \"$call farDmp\",\n\t   \"jmpUmp\", \"$jmp farDmp\", \"pushUm\" },\n  sldt = { \"sldt\", \"str\", \"lldt\", \"ltr\", \"verr\", \"verw\" },\n  sgdt = { \"vm*$sgdt\", \"vm*$sidt\", \"$lgdt\", \"vm*$lidt\",\n\t   \"smsw\", nil, \"lmsw\", \"vm*$invlpg\" },\n  bt = { nil, nil, nil, nil, \"bt\", \"bts\", \"btr\", \"btc\" },\n  cmpxchg = { nil, \"sz*,cmpxchg8bQmp,cmpxchg16bXmp\", nil, nil,\n\t      nil, nil, \"vmptrld|vmxon|vmclear\", \"vmptrst\" },\n  pshiftw = { nil, nil, \"psrlw\", nil, \"psraw\", nil, \"psllw\" },\n  pshiftd = { nil, nil, \"psrld\", nil, \"psrad\", nil, \"pslld\" },\n  pshiftq = { nil, nil, \"psrlq\", nil, nil, nil, \"psllq\" },\n  pshiftdq = { nil, nil, \"psrlq\", \"psrldq\", nil, nil, \"psllq\", \"pslldq\" },\n  fxsave = { \"$fxsave\", \"$fxrstor\", \"$ldmxcsr\", \"$stmxcsr\",\n\t     nil, \"lfenceDp$\", \"mfenceDp$\", \"sfenceDp$clflush\" },\n  prefetch = { \"prefetch\", \"prefetchw\" },\n  prefetcht = { \"prefetchnta\", \"prefetcht0\", \"prefetcht1\", \"prefetcht2\" },\n}\n\n------------------------------------------------------------------------------\n\n-- Maps for register names.\nlocal map_regs = {\n  B = { \"al\", \"cl\", \"dl\", \"bl\", \"ah\", \"ch\", \"dh\", \"bh\",\n\t\"r8b\", \"r9b\", \"r10b\", \"r11b\", \"r12b\", \"r13b\", \"r14b\", \"r15b\" },\n  B64 = { \"al\", \"cl\", \"dl\", \"bl\", \"spl\", \"bpl\", \"sil\", \"dil\",\n\t  \"r8b\", \"r9b\", \"r10b\", \"r11b\", \"r12b\", \"r13b\", \"r14b\", \"r15b\" },\n  W = { \"ax\", \"cx\", \"dx\", \"bx\", \"sp\", \"bp\", \"si\", \"di\",\n\t\"r8w\", \"r9w\", \"r10w\", \"r11w\", \"r12w\", \"r13w\", \"r14w\", \"r15w\" },\n  D = { \"eax\", \"ecx\", \"edx\", \"ebx\", \"esp\", \"ebp\", \"esi\", \"edi\",\n\t\"r8d\", \"r9d\", \"r10d\", \"r11d\", \"r12d\", \"r13d\", \"r14d\", \"r15d\" },\n  Q = { \"rax\", \"rcx\", \"rdx\", \"rbx\", \"rsp\", \"rbp\", \"rsi\", \"rdi\",\n\t\"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"r14\", \"r15\" },\n  M = { \"mm0\", \"mm1\", \"mm2\", \"mm3\", \"mm4\", \"mm5\", \"mm6\", \"mm7\",\n\t\"mm0\", \"mm1\", \"mm2\", \"mm3\", \"mm4\", \"mm5\", \"mm6\", \"mm7\" }, -- No x64 ext!\n  X = { \"xmm0\", \"xmm1\", \"xmm2\", \"xmm3\", \"xmm4\", \"xmm5\", \"xmm6\", \"xmm7\",\n\t\"xmm8\", \"xmm9\", \"xmm10\", \"xmm11\", \"xmm12\", \"xmm13\", \"xmm14\", \"xmm15\" },\n}\nlocal map_segregs = { \"es\", \"cs\", \"ss\", \"ds\", \"fs\", \"gs\", \"segr6\", \"segr7\" }\n\n-- Maps for size names.\nlocal map_sz2n = {\n  B = 1, W = 2, D = 4, Q = 8, M = 8, X = 16,\n}\nlocal map_sz2prefix = {\n  B = \"byte\", W = \"word\", D = \"dword\",\n  Q = \"qword\",\n  M = \"qword\", X = \"xword\",\n  F = \"dword\", G = \"qword\", -- No need for sizes/register names for these two.\n}\n\n------------------------------------------------------------------------------\n\n-- Output a nicely formatted line with an opcode and operands.\nlocal function putop(ctx, text, operands)\n  local code, pos, hex = ctx.code, ctx.pos, \"\"\n  local hmax = ctx.hexdump\n  if hmax > 0 then\n    for i=ctx.start,pos-1 do\n      hex = hex..format(\"%02X\", byte(code, i, i))\n    end\n    if #hex > hmax then hex = sub(hex, 1, hmax)..\". \"\n    else hex = hex..rep(\" \", hmax-#hex+2) end\n  end\n  if operands then text = text..\" \"..operands end\n  if ctx.o16 then text = \"o16 \"..text; ctx.o16 = false end\n  if ctx.a32 then text = \"a32 \"..text; ctx.a32 = false end\n  if ctx.rep then text = ctx.rep..\" \"..text; ctx.rep = false end\n  if ctx.rex then\n    local t = (ctx.rexw and \"w\" or \"\")..(ctx.rexr and \"r\" or \"\")..\n\t      (ctx.rexx and \"x\" or \"\")..(ctx.rexb and \"b\" or \"\")\n    if t ~= \"\" then text = \"rex.\"..t..\" \"..text end\n    ctx.rexw = false; ctx.rexr = false; ctx.rexx = false; ctx.rexb = false\n    ctx.rex = false\n  end\n  if ctx.seg then\n    local text2, n = gsub(text, \"%[\", \"[\"..ctx.seg..\":\")\n    if n == 0 then text = ctx.seg..\" \"..text else text = text2 end\n    ctx.seg = false\n  end\n  if ctx.lock then text = \"lock \"..text; ctx.lock = false end\n  local imm = ctx.imm\n  if imm then\n    local sym = ctx.symtab[imm]\n    if sym then text = text..\"\\t->\"..sym end\n  end\n  ctx.out(format(\"%08x  %s%s\\n\", ctx.addr+ctx.start, hex, text))\n  ctx.mrm = false\n  ctx.start = pos\n  ctx.imm = nil\nend\n\n-- Clear all prefix flags.\nlocal function clearprefixes(ctx)\n  ctx.o16 = false; ctx.seg = false; ctx.lock = false; ctx.rep = false\n  ctx.rexw = false; ctx.rexr = false; ctx.rexx = false; ctx.rexb = false\n  ctx.rex = false; ctx.a32 = false\nend\n\n-- Fallback for incomplete opcodes at the end.\nlocal function incomplete(ctx)\n  ctx.pos = ctx.stop+1\n  clearprefixes(ctx)\n  return putop(ctx, \"(incomplete)\")\nend\n\n-- Fallback for unknown opcodes.\nlocal function unknown(ctx)\n  clearprefixes(ctx)\n  return putop(ctx, \"(unknown)\")\nend\n\n-- Return an immediate of the specified size.\nlocal function getimm(ctx, pos, n)\n  if pos+n-1 > ctx.stop then return incomplete(ctx) end\n  local code = ctx.code\n  if n == 1 then\n    local b1 = byte(code, pos, pos)\n    return b1\n  elseif n == 2 then\n    local b1, b2 = byte(code, pos, pos+1)\n    return b1+b2*256\n  else\n    local b1, b2, b3, b4 = byte(code, pos, pos+3)\n    local imm = b1+b2*256+b3*65536+b4*16777216\n    ctx.imm = imm\n    return imm\n  end\nend\n\n-- Process pattern string and generate the operands.\nlocal function putpat(ctx, name, pat)\n  local operands, regs, sz, mode, sp, rm, sc, rx, sdisp\n  local code, pos, stop = ctx.code, ctx.pos, ctx.stop\n\n  -- Chars used: 1DFGIMPQRSTUVWXacdfgijmoprstuwxyz\n  for p in gmatch(pat, \".\") do\n    local x = nil\n    if p == \"V\" or p == \"U\" then\n      if ctx.rexw then sz = \"Q\"; ctx.rexw = false\n      elseif ctx.o16 then sz = \"W\"; ctx.o16 = false\n      elseif p == \"U\" and ctx.x64 then sz = \"Q\"\n      else sz = \"D\" end\n      regs = map_regs[sz]\n    elseif p == \"T\" then\n      if ctx.rexw then sz = \"Q\"; ctx.rexw = false else sz = \"D\" end\n      regs = map_regs[sz]\n    elseif p == \"B\" then\n      sz = \"B\"\n      regs = ctx.rex and map_regs.B64 or map_regs.B\n    elseif match(p, \"[WDQMXFG]\") then\n      sz = p\n      regs = map_regs[sz]\n    elseif p == \"P\" then\n      sz = ctx.o16 and \"X\" or \"M\"; ctx.o16 = false\n      regs = map_regs[sz]\n    elseif p == \"S\" then\n      name = name..lower(sz)\n    elseif p == \"s\" then\n      local imm = getimm(ctx, pos, 1); if not imm then return end\n      x = imm <= 127 and format(\"+0x%02x\", imm)\n\t\t     or format(\"-0x%02x\", 256-imm)\n      pos = pos+1\n    elseif p == \"u\" then\n      local imm = getimm(ctx, pos, 1); if not imm then return end\n      x = format(\"0x%02x\", imm)\n      pos = pos+1\n    elseif p == \"w\" then\n      local imm = getimm(ctx, pos, 2); if not imm then return end\n      x = format(\"0x%x\", imm)\n      pos = pos+2\n    elseif p == \"o\" then -- [offset]\n      if ctx.x64 then\n\tlocal imm1 = getimm(ctx, pos, 4); if not imm1 then return end\n\tlocal imm2 = getimm(ctx, pos+4, 4); if not imm2 then return end\n\tx = format(\"[0x%08x%08x]\", imm2, imm1)\n\tpos = pos+8\n      else\n\tlocal imm = getimm(ctx, pos, 4); if not imm then return end\n\tx = format(\"[0x%08x]\", imm)\n\tpos = pos+4\n      end\n    elseif p == \"i\" or p == \"I\" then\n      local n = map_sz2n[sz]\n      if n == 8 and ctx.x64 and p == \"I\" then\n\tlocal imm1 = getimm(ctx, pos, 4); if not imm1 then return end\n\tlocal imm2 = getimm(ctx, pos+4, 4); if not imm2 then return end\n\tx = format(\"0x%08x%08x\", imm2, imm1)\n      else\n\tif n == 8 then n = 4 end\n\tlocal imm = getimm(ctx, pos, n); if not imm then return end\n\tif sz == \"Q\" and (imm < 0 or imm > 0x7fffffff) then\n\t  imm = (0xffffffff+1)-imm\n\t  x = format(imm > 65535 and \"-0x%08x\" or \"-0x%x\", imm)\n\telse\n\t  x = format(imm > 65535 and \"0x%08x\" or \"0x%x\", imm)\n\tend\n      end\n      pos = pos+n\n    elseif p == \"j\" then\n      local n = map_sz2n[sz]\n      if n == 8 then n = 4 end\n      local imm = getimm(ctx, pos, n); if not imm then return end\n      if sz == \"B\" and imm > 127 then imm = imm-256\n      elseif imm > 2147483647 then imm = imm-4294967296 end\n      pos = pos+n\n      imm = imm + pos + ctx.addr\n      if imm > 4294967295 and not ctx.x64 then imm = imm-4294967296 end\n      ctx.imm = imm\n      if sz == \"W\" then\n\tx = format(\"word 0x%04x\", imm%65536)\n      elseif ctx.x64 then\n\tlocal lo = imm % 0x1000000\n\tx = format(\"0x%02x%06x\", (imm-lo) / 0x1000000, lo)\n      else\n\tx = format(\"0x%08x\", imm)\n      end\n    elseif p == \"R\" then\n      local r = byte(code, pos-1, pos-1)%8\n      if ctx.rexb then r = r + 8; ctx.rexb = false end\n      x = regs[r+1]\n    elseif p == \"a\" then x = regs[1]\n    elseif p == \"c\" then x = \"cl\"\n    elseif p == \"d\" then x = \"dx\"\n    elseif p == \"1\" then x = \"1\"\n    else\n      if not mode then\n\tmode = ctx.mrm\n\tif not mode then\n\t  if pos > stop then return incomplete(ctx) end\n\t  mode = byte(code, pos, pos)\n\t  pos = pos+1\n\tend\n\trm = mode%8; mode = (mode-rm)/8\n\tsp = mode%8; mode = (mode-sp)/8\n\tsdisp = \"\"\n\tif mode < 3 then\n\t  if rm == 4 then\n\t    if pos > stop then return incomplete(ctx) end\n\t    sc = byte(code, pos, pos)\n\t    pos = pos+1\n\t    rm = sc%8; sc = (sc-rm)/8\n\t    rx = sc%8; sc = (sc-rx)/8\n\t    if ctx.rexx then rx = rx + 8; ctx.rexx = false end\n\t    if rx == 4 then rx = nil end\n\t  end\n\t  if mode > 0 or rm == 5 then\n\t    local dsz = mode\n\t    if dsz ~= 1 then dsz = 4 end\n\t    local disp = getimm(ctx, pos, dsz); if not disp then return end\n\t    if mode == 0 then rm = nil end\n\t    if rm or rx or (not sc and ctx.x64 and not ctx.a32) then\n\t      if dsz == 1 and disp > 127 then\n\t\tsdisp = format(\"-0x%x\", 256-disp)\n\t      elseif disp >= 0 and disp <= 0x7fffffff then\n\t\tsdisp = format(\"+0x%x\", disp)\n\t      else\n\t\tsdisp = format(\"-0x%x\", (0xffffffff+1)-disp)\n\t      end\n\t    else\n\t      sdisp = format(ctx.x64 and not ctx.a32 and\n\t\tnot (disp >= 0 and disp <= 0x7fffffff)\n\t\tand \"0xffffffff%08x\" or \"0x%08x\", disp)\n\t    end\n\t    pos = pos+dsz\n\t  end\n\tend\n\tif rm and ctx.rexb then rm = rm + 8; ctx.rexb = false end\n\tif ctx.rexr then sp = sp + 8; ctx.rexr = false end\n      end\n      if p == \"m\" then\n\tif mode == 3 then x = regs[rm+1]\n\telse\n\t  local aregs = ctx.a32 and map_regs.D or ctx.aregs\n\t  local srm, srx = \"\", \"\"\n\t  if rm then srm = aregs[rm+1]\n\t  elseif not sc and ctx.x64 and not ctx.a32 then srm = \"rip\" end\n\t  ctx.a32 = false\n\t  if rx then\n\t    if rm then srm = srm..\"+\" end\n\t    srx = aregs[rx+1]\n\t    if sc > 0 then srx = srx..\"*\"..(2^sc) end\n\t  end\n\t  x = format(\"[%s%s%s]\", srm, srx, sdisp)\n\tend\n\tif mode < 3 and\n\t   (not match(pat, \"[aRrgp]\") or match(pat, \"t\")) then -- Yuck.\n\t  x = map_sz2prefix[sz]..\" \"..x\n\tend\n      elseif p == \"r\" then x = regs[sp+1]\n      elseif p == \"g\" then x = map_segregs[sp+1]\n      elseif p == \"p\" then -- Suppress prefix.\n      elseif p == \"f\" then x = \"st\"..rm\n      elseif p == \"x\" then\n\tif sp == 0 and ctx.lock and not ctx.x64 then\n\t  x = \"CR8\"; ctx.lock = false\n\telse\n\t  x = \"CR\"..sp\n\tend\n      elseif p == \"y\" then x = \"DR\"..sp\n      elseif p == \"z\" then x = \"TR\"..sp\n      elseif p == \"t\" then\n      else\n\terror(\"bad pattern `\"..pat..\"'\")\n      end\n    end\n    if x then operands = operands and operands..\", \"..x or x end\n  end\n  ctx.pos = pos\n  return putop(ctx, name, operands)\nend\n\n-- Forward declaration.\nlocal map_act\n\n-- Fetch and cache MRM byte.\nlocal function getmrm(ctx)\n  local mrm = ctx.mrm\n  if not mrm then\n    local pos = ctx.pos\n    if pos > ctx.stop then return nil end\n    mrm = byte(ctx.code, pos, pos)\n    ctx.pos = pos+1\n    ctx.mrm = mrm\n  end\n  return mrm\nend\n\n-- Dispatch to handler depending on pattern.\nlocal function dispatch(ctx, opat, patgrp)\n  if not opat then return unknown(ctx) end\n  if match(opat, \"%|\") then -- MMX/SSE variants depending on prefix.\n    local p\n    if ctx.rep then\n      p = ctx.rep==\"rep\" and \"%|([^%|]*)\" or \"%|[^%|]*%|[^%|]*%|([^%|]*)\"\n      ctx.rep = false\n    elseif ctx.o16 then p = \"%|[^%|]*%|([^%|]*)\"; ctx.o16 = false\n    else p = \"^[^%|]*\" end\n    opat = match(opat, p)\n    if not opat then return unknown(ctx) end\n--    ctx.rep = false; ctx.o16 = false\n    --XXX fails for 66 f2 0f 38 f1 06  crc32 eax,WORD PTR [esi]\n    --XXX remove in branches?\n  end\n  if match(opat, \"%$\") then -- reg$mem variants.\n    local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end\n    opat = match(opat, mrm >= 192 and \"^[^%$]*\" or \"%$(.*)\")\n    if opat == \"\" then return unknown(ctx) end\n  end\n  if opat == \"\" then return unknown(ctx) end\n  local name, pat = match(opat, \"^([a-z0-9 ]*)(.*)\")\n  if pat == \"\" and patgrp then pat = patgrp end\n  return map_act[sub(pat, 1, 1)](ctx, name, pat)\nend\n\n-- Get a pattern from an opcode map and dispatch to handler.\nlocal function dispatchmap(ctx, opcmap)\n  local pos = ctx.pos\n  local opat = opcmap[byte(ctx.code, pos, pos)]\n  pos = pos + 1\n  ctx.pos = pos\n  return dispatch(ctx, opat)\nend\n\n-- Map for action codes. The key is the first char after the name.\nmap_act = {\n  -- Simple opcodes without operands.\n  [\"\"] = function(ctx, name, pat)\n    return putop(ctx, name)\n  end,\n\n  -- Operand size chars fall right through.\n  B = putpat, W = putpat, D = putpat, Q = putpat,\n  V = putpat, U = putpat, T = putpat,\n  M = putpat, X = putpat, P = putpat,\n  F = putpat, G = putpat,\n\n  -- Collect prefixes.\n  [\":\"] = function(ctx, name, pat)\n    ctx[pat == \":\" and name or sub(pat, 2)] = name\n    if ctx.pos - ctx.start > 5 then return unknown(ctx) end -- Limit #prefixes.\n  end,\n\n  -- Chain to special handler specified by name.\n  [\"*\"] = function(ctx, name, pat)\n    return map_act[name](ctx, name, sub(pat, 2))\n  end,\n\n  -- Use named subtable for opcode group.\n  [\"!\"] = function(ctx, name, pat)\n    local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end\n    return dispatch(ctx, map_opcgroup[name][((mrm-(mrm%8))/8)%8+1], sub(pat, 2))\n  end,\n\n  -- o16,o32[,o64] variants.\n  sz = function(ctx, name, pat)\n    if ctx.o16 then ctx.o16 = false\n    else\n      pat = match(pat, \",(.*)\")\n      if ctx.rexw then\n\tlocal p = match(pat, \",(.*)\")\n\tif p then pat = p; ctx.rexw = false end\n      end\n    end\n    pat = match(pat, \"^[^,]*\")\n    return dispatch(ctx, pat)\n  end,\n\n  -- Two-byte opcode dispatch.\n  opc2 = function(ctx, name, pat)\n    return dispatchmap(ctx, map_opc2)\n  end,\n\n  -- Three-byte opcode dispatch.\n  opc3 = function(ctx, name, pat)\n    return dispatchmap(ctx, map_opc3[pat])\n  end,\n\n  -- VMX/SVM dispatch.\n  vm = function(ctx, name, pat)\n    return dispatch(ctx, map_opcvm[ctx.mrm])\n  end,\n\n  -- Floating point opcode dispatch.\n  fp = function(ctx, name, pat)\n    local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end\n    local rm = mrm%8\n    local idx = pat*8 + ((mrm-rm)/8)%8\n    if mrm >= 192 then idx = idx + 64 end\n    local opat = map_opcfp[idx]\n    if type(opat) == \"table\" then opat = opat[rm+1] end\n    return dispatch(ctx, opat)\n  end,\n\n  -- REX prefix.\n  rex = function(ctx, name, pat)\n    if ctx.rex then return unknown(ctx) end -- Only 1 REX prefix allowed.\n    for p in gmatch(pat, \".\") do ctx[\"rex\"..p] = true end\n    ctx.rex = true\n  end,\n\n  -- Special case for nop with REX prefix.\n  nop = function(ctx, name, pat)\n    return dispatch(ctx, ctx.rex and pat or \"nop\")\n  end,\n}\n\n------------------------------------------------------------------------------\n\n-- Disassemble a block of code.\nlocal function disass_block(ctx, ofs, len)\n  if not ofs then ofs = 0 end\n  local stop = len and ofs+len or #ctx.code\n  ofs = ofs + 1\n  ctx.start = ofs\n  ctx.pos = ofs\n  ctx.stop = stop\n  ctx.imm = nil\n  ctx.mrm = false\n  clearprefixes(ctx)\n  while ctx.pos <= stop do dispatchmap(ctx, ctx.map1) end\n  if ctx.pos ~= ctx.start then incomplete(ctx) end\nend\n\n-- Extended API: create a disassembler context. Then call ctx:disass(ofs, len).\nlocal function create_(code, addr, out)\n  local ctx = {}\n  ctx.code = code\n  ctx.addr = (addr or 0) - 1\n  ctx.out = out or io.write\n  ctx.symtab = {}\n  ctx.disass = disass_block\n  ctx.hexdump = 16\n  ctx.x64 = false\n  ctx.map1 = map_opc1_32\n  ctx.aregs = map_regs.D\n  return ctx\nend\n\nlocal function create64_(code, addr, out)\n  local ctx = create_(code, addr, out)\n  ctx.x64 = true\n  ctx.map1 = map_opc1_64\n  ctx.aregs = map_regs.Q\n  return ctx\nend\n\n-- Simple API: disassemble code (a string) at address and output via out.\nlocal function disass_(code, addr, out)\n  create_(code, addr, out):disass()\nend\n\nlocal function disass64_(code, addr, out)\n  create64_(code, addr, out):disass()\nend\n\n-- Return register name for RID.\nlocal function regname_(r)\n  if r < 8 then return map_regs.D[r+1] end\n  return map_regs.X[r-7]\nend\n\nlocal function regname64_(r)\n  if r < 16 then return map_regs.Q[r+1] end\n  return map_regs.X[r-15]\nend\n\n-- Public module functions.\nmodule(...)\n\ncreate = create_\ncreate64 = create64_\ndisass = disass_\ndisass64 = disass64_\nregname = regname_\nregname64 = regname64_\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/dump.lua",
    "content": "----------------------------------------------------------------------------\n-- LuaJIT compiler dump module.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n--\n-- This module can be used to debug the JIT compiler itself. It dumps the\n-- code representations and structures used in various compiler stages.\n--\n-- Example usage:\n--\n--   luajit -jdump -e \"local x=0; for i=1,1e6 do x=x+i end; print(x)\"\n--   luajit -jdump=im -e \"for i=1,1000 do for j=1,1000 do end end\" | less -R\n--   luajit -jdump=is myapp.lua | less -R\n--   luajit -jdump=-b myapp.lua\n--   luajit -jdump=+aH,myapp.html myapp.lua\n--   luajit -jdump=ixT,myapp.dump myapp.lua\n--\n-- The first argument specifies the dump mode. The second argument gives\n-- the output file name. Default output is to stdout, unless the environment\n-- variable LUAJIT_DUMPFILE is set. The file is overwritten every time the\n-- module is started.\n--\n-- Different features can be turned on or off with the dump mode. If the\n-- mode starts with a '+', the following features are added to the default\n-- set of features; a '-' removes them. Otherwise the features are replaced.\n--\n-- The following dump features are available (* marks the default):\n--\n--  * t  Print a line for each started, ended or aborted trace (see also -jv).\n--  * b  Dump the traced bytecode.\n--  * i  Dump the IR (intermediate representation).\n--    r  Augment the IR with register/stack slots.\n--    s  Dump the snapshot map.\n--  * m  Dump the generated machine code.\n--    x  Print each taken trace exit.\n--    X  Print each taken trace exit and the contents of all registers.\n--\n-- The output format can be set with the following characters:\n--\n--    T  Plain text output.\n--    A  ANSI-colored text output\n--    H  Colorized HTML + CSS output.\n--\n-- The default output format is plain text. It's set to ANSI-colored text\n-- if the COLORTERM variable is set. Note: this is independent of any output\n-- redirection, which is actually considered a feature.\n--\n-- You probably want to use less -R to enjoy viewing ANSI-colored text from\n-- a pipe or a file. Add this to your ~/.bashrc: export LESS=\"-R\"\n--\n------------------------------------------------------------------------------\n\n-- Cache some library functions and objects.\nlocal jit = require(\"jit\")\nassert(jit.version_num == 20001, \"LuaJIT core/library version mismatch\")\nlocal jutil = require(\"jit.util\")\nlocal vmdef = require(\"jit.vmdef\")\nlocal funcinfo, funcbc = jutil.funcinfo, jutil.funcbc\nlocal traceinfo, traceir, tracek = jutil.traceinfo, jutil.traceir, jutil.tracek\nlocal tracemc, tracesnap = jutil.tracemc, jutil.tracesnap\nlocal traceexitstub, ircalladdr = jutil.traceexitstub, jutil.ircalladdr\nlocal bit = require(\"bit\")\nlocal band, shl, shr = bit.band, bit.lshift, bit.rshift\nlocal sub, gsub, format = string.sub, string.gsub, string.format\nlocal byte, char, rep = string.byte, string.char, string.rep\nlocal type, tostring = type, tostring\nlocal stdout, stderr = io.stdout, io.stderr\n\n-- Load other modules on-demand.\nlocal bcline, disass\n\n-- Active flag, output file handle and dump mode.\nlocal active, out, dumpmode\n\n------------------------------------------------------------------------------\n\nlocal symtabmt = { __index = false }\nlocal symtab = {}\nlocal nexitsym = 0\n\n-- Fill nested symbol table with per-trace exit stub addresses.\nlocal function fillsymtab_tr(tr, nexit)\n  local t = {}\n  symtabmt.__index = t\n  if jit.arch == \"mips\" or jit.arch == \"mipsel\" then\n    t[traceexitstub(tr, 0)] = \"exit\"\n    return\n  end\n  for i=0,nexit-1 do\n    local addr = traceexitstub(tr, i)\n    t[addr] = tostring(i)\n  end\n  local addr = traceexitstub(tr, nexit)\n  if addr then t[addr] = \"stack_check\" end\nend\n\n-- Fill symbol table with trace exit stub addresses.\nlocal function fillsymtab(tr, nexit)\n  local t = symtab\n  if nexitsym == 0 then\n    local ircall = vmdef.ircall\n    for i=0,#ircall do\n      local addr = ircalladdr(i)\n      if addr ~= 0 then t[addr] = ircall[i] end\n    end\n  end\n  if nexitsym == 1000000 then -- Per-trace exit stubs.\n    fillsymtab_tr(tr, nexit)\n  elseif nexit > nexitsym then -- Shared exit stubs.\n    for i=nexitsym,nexit-1 do\n      local addr = traceexitstub(i)\n      if addr == nil then -- Fall back to per-trace exit stubs.\n\tfillsymtab_tr(tr, nexit)\n\tsetmetatable(symtab, symtabmt)\n\tnexit = 1000000\n\tbreak\n      end\n      t[addr] = tostring(i)\n    end\n    nexitsym = nexit\n  end\n  return t\nend\n\nlocal function dumpwrite(s)\n  out:write(s)\nend\n\n-- Disassemble machine code.\nlocal function dump_mcode(tr)\n  local info = traceinfo(tr)\n  if not info then return end\n  local mcode, addr, loop = tracemc(tr)\n  if not mcode then return end\n  if not disass then disass = require(\"jit.dis_\"..jit.arch) end\n  out:write(\"---- TRACE \", tr, \" mcode \", #mcode, \"\\n\")\n  local ctx = disass.create(mcode, addr, dumpwrite)\n  ctx.hexdump = 0\n  ctx.symtab = fillsymtab(tr, info.nexit)\n  if loop ~= 0 then\n    symtab[addr+loop] = \"LOOP\"\n    ctx:disass(0, loop)\n    out:write(\"->LOOP:\\n\")\n    ctx:disass(loop, #mcode-loop)\n    symtab[addr+loop] = nil\n  else\n    ctx:disass(0, #mcode)\n  end\nend\n\n------------------------------------------------------------------------------\n\nlocal irtype_text = {\n  [0] = \"nil\",\n  \"fal\",\n  \"tru\",\n  \"lud\",\n  \"str\",\n  \"p32\",\n  \"thr\",\n  \"pro\",\n  \"fun\",\n  \"p64\",\n  \"cdt\",\n  \"tab\",\n  \"udt\",\n  \"flt\",\n  \"num\",\n  \"i8 \",\n  \"u8 \",\n  \"i16\",\n  \"u16\",\n  \"int\",\n  \"u32\",\n  \"i64\",\n  \"u64\",\n  \"sfp\",\n}\n\nlocal colortype_ansi = {\n  [0] = \"%s\",\n  \"%s\",\n  \"%s\",\n  \"\\027[36m%s\\027[m\",\n  \"\\027[32m%s\\027[m\",\n  \"%s\",\n  \"\\027[1m%s\\027[m\",\n  \"%s\",\n  \"\\027[1m%s\\027[m\",\n  \"%s\",\n  \"\\027[33m%s\\027[m\",\n  \"\\027[31m%s\\027[m\",\n  \"\\027[36m%s\\027[m\",\n  \"\\027[34m%s\\027[m\",\n  \"\\027[34m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n  \"\\027[35m%s\\027[m\",\n}\n\nlocal function colorize_text(s, t)\n  return s\nend\n\nlocal function colorize_ansi(s, t)\n  return format(colortype_ansi[t], s)\nend\n\nlocal irtype_ansi = setmetatable({},\n  { __index = function(tab, t)\n      local s = colorize_ansi(irtype_text[t], t); tab[t] = s; return s; end })\n\nlocal html_escape = { [\"<\"] = \"&lt;\", [\">\"] = \"&gt;\", [\"&\"] = \"&amp;\", }\n\nlocal function colorize_html(s, t)\n  s = gsub(s, \"[<>&]\", html_escape)\n  return format('<span class=\"irt_%s\">%s</span>', irtype_text[t], s)\nend\n\nlocal irtype_html = setmetatable({},\n  { __index = function(tab, t)\n      local s = colorize_html(irtype_text[t], t); tab[t] = s; return s; end })\n\nlocal header_html = [[\n<style type=\"text/css\">\nbackground { background: #ffffff; color: #000000; }\npre.ljdump {\nfont-size: 10pt;\nbackground: #f0f4ff;\ncolor: #000000;\nborder: 1px solid #bfcfff;\npadding: 0.5em;\nmargin-left: 2em;\nmargin-right: 2em;\n}\nspan.irt_str { color: #00a000; }\nspan.irt_thr, span.irt_fun { color: #404040; font-weight: bold; }\nspan.irt_tab { color: #c00000; }\nspan.irt_udt, span.irt_lud { color: #00c0c0; }\nspan.irt_num { color: #4040c0; }\nspan.irt_int, span.irt_i8, span.irt_u8, span.irt_i16, span.irt_u16 { color: #b040b0; }\n</style>\n]]\n\nlocal colorize, irtype\n\n-- Lookup tables to convert some literals into names.\nlocal litname = {\n  [\"SLOAD \"] = setmetatable({}, { __index = function(t, mode)\n    local s = \"\"\n    if band(mode, 1) ~= 0 then s = s..\"P\" end\n    if band(mode, 2) ~= 0 then s = s..\"F\" end\n    if band(mode, 4) ~= 0 then s = s..\"T\" end\n    if band(mode, 8) ~= 0 then s = s..\"C\" end\n    if band(mode, 16) ~= 0 then s = s..\"R\" end\n    if band(mode, 32) ~= 0 then s = s..\"I\" end\n    t[mode] = s\n    return s\n  end}),\n  [\"XLOAD \"] = { [0] = \"\", \"R\", \"V\", \"RV\", \"U\", \"RU\", \"VU\", \"RVU\", },\n  [\"CONV  \"] = setmetatable({}, { __index = function(t, mode)\n    local s = irtype[band(mode, 31)]\n    s = irtype[band(shr(mode, 5), 31)]..\".\"..s\n    if band(mode, 0x400) ~= 0 then s = s..\" trunc\"\n    elseif band(mode, 0x800) ~= 0 then s = s..\" sext\" end\n    local c = shr(mode, 14)\n    if c == 2 then s = s..\" index\" elseif c == 3 then s = s..\" check\" end\n    t[mode] = s\n    return s\n  end}),\n  [\"FLOAD \"] = vmdef.irfield,\n  [\"FREF  \"] = vmdef.irfield,\n  [\"FPMATH\"] = vmdef.irfpm,\n}\n\nlocal function ctlsub(c)\n  if c == \"\\n\" then return \"\\\\n\"\n  elseif c == \"\\r\" then return \"\\\\r\"\n  elseif c == \"\\t\" then return \"\\\\t\"\n  else return format(\"\\\\%03d\", byte(c))\n  end\nend\n\nlocal function fmtfunc(func, pc)\n  local fi = funcinfo(func, pc)\n  if fi.loc then\n    return fi.loc\n  elseif fi.ffid then\n    return vmdef.ffnames[fi.ffid]\n  elseif fi.addr then\n    return format(\"C:%x\", fi.addr)\n  else\n    return \"(?)\"\n  end\nend\n\nlocal function formatk(tr, idx)\n  local k, t, slot = tracek(tr, idx)\n  local tn = type(k)\n  local s\n  if tn == \"number\" then\n    if k == 2^52+2^51 then\n      s = \"bias\"\n    else\n      s = format(\"%+.14g\", k)\n    end\n  elseif tn == \"string\" then\n    s = format(#k > 20 and '\"%.20s\"~' or '\"%s\"', gsub(k, \"%c\", ctlsub))\n  elseif tn == \"function\" then\n    s = fmtfunc(k)\n  elseif tn == \"table\" then\n    s = format(\"{%p}\", k)\n  elseif tn == \"userdata\" then\n    if t == 12 then\n      s = format(\"userdata:%p\", k)\n    else\n      s = format(\"[%p]\", k)\n      if s == \"[0x00000000]\" then s = \"NULL\" end\n    end\n  elseif t == 21 then -- int64_t\n    s = sub(tostring(k), 1, -3)\n    if sub(s, 1, 1) ~= \"-\" then s = \"+\"..s end\n  else\n    s = tostring(k) -- For primitives.\n  end\n  s = colorize(format(\"%-4s\", s), t)\n  if slot then\n    s = format(\"%s @%d\", s, slot)\n  end\n  return s\nend\n\nlocal function printsnap(tr, snap)\n  local n = 2\n  for s=0,snap[1]-1 do\n    local sn = snap[n]\n    if shr(sn, 24) == s then\n      n = n + 1\n      local ref = band(sn, 0xffff) - 0x8000 -- REF_BIAS\n      if ref < 0 then\n\tout:write(formatk(tr, ref))\n      elseif band(sn, 0x80000) ~= 0 then -- SNAP_SOFTFPNUM\n\tout:write(colorize(format(\"%04d/%04d\", ref, ref+1), 14))\n      else\n\tlocal m, ot, op1, op2 = traceir(tr, ref)\n\tout:write(colorize(format(\"%04d\", ref), band(ot, 31)))\n      end\n      out:write(band(sn, 0x10000) == 0 and \" \" or \"|\") -- SNAP_FRAME\n    else\n      out:write(\"---- \")\n    end\n  end\n  out:write(\"]\\n\")\nend\n\n-- Dump snapshots (not interleaved with IR).\nlocal function dump_snap(tr)\n  out:write(\"---- TRACE \", tr, \" snapshots\\n\")\n  for i=0,1000000000 do\n    local snap = tracesnap(tr, i)\n    if not snap then break end\n    out:write(format(\"#%-3d %04d [ \", i, snap[0]))\n    printsnap(tr, snap)\n  end\nend\n\n-- Return a register name or stack slot for a rid/sp location.\nlocal function ridsp_name(ridsp, ins)\n  if not disass then disass = require(\"jit.dis_\"..jit.arch) end\n  local rid, slot = band(ridsp, 0xff), shr(ridsp, 8)\n  if rid == 253 or rid == 254 then\n    return (slot == 0 or slot == 255) and \" {sink\" or format(\" {%04d\", ins-slot)\n  end\n  if ridsp > 255 then return format(\"[%x]\", slot*4) end\n  if rid < 128 then return disass.regname(rid) end\n  return \"\"\nend\n\n-- Dump CALL* function ref and return optional ctype.\nlocal function dumpcallfunc(tr, ins)\n  local ctype\n  if ins > 0 then\n    local m, ot, op1, op2 = traceir(tr, ins)\n    if band(ot, 31) == 0 then -- nil type means CARG(func, ctype).\n      ins = op1\n      ctype = formatk(tr, op2)\n    end\n  end\n  if ins < 0 then\n    out:write(format(\"[0x%x](\", tonumber((tracek(tr, ins)))))\n  else\n    out:write(format(\"%04d (\", ins))\n  end\n  return ctype\nend\n\n-- Recursively gather CALL* args and dump them.\nlocal function dumpcallargs(tr, ins)\n  if ins < 0 then\n    out:write(formatk(tr, ins))\n  else\n    local m, ot, op1, op2 = traceir(tr, ins)\n    local oidx = 6*shr(ot, 8)\n    local op = sub(vmdef.irnames, oidx+1, oidx+6)\n    if op == \"CARG  \" then\n      dumpcallargs(tr, op1)\n      if op2 < 0 then\n\tout:write(\" \", formatk(tr, op2))\n      else\n\tout:write(\" \", format(\"%04d\", op2))\n      end\n    else\n      out:write(format(\"%04d\", ins))\n    end\n  end\nend\n\n-- Dump IR and interleaved snapshots.\nlocal function dump_ir(tr, dumpsnap, dumpreg)\n  local info = traceinfo(tr)\n  if not info then return end\n  local nins = info.nins\n  out:write(\"---- TRACE \", tr, \" IR\\n\")\n  local irnames = vmdef.irnames\n  local snapref = 65536\n  local snap, snapno\n  if dumpsnap then\n    snap = tracesnap(tr, 0)\n    snapref = snap[0]\n    snapno = 0\n  end\n  for ins=1,nins do\n    if ins >= snapref then\n      if dumpreg then\n\tout:write(format(\"....              SNAP   #%-3d [ \", snapno))\n      else\n\tout:write(format(\"....        SNAP   #%-3d [ \", snapno))\n      end\n      printsnap(tr, snap)\n      snapno = snapno + 1\n      snap = tracesnap(tr, snapno)\n      snapref = snap and snap[0] or 65536\n    end\n    local m, ot, op1, op2, ridsp = traceir(tr, ins)\n    local oidx, t = 6*shr(ot, 8), band(ot, 31)\n    local op = sub(irnames, oidx+1, oidx+6)\n    if op == \"LOOP  \" then\n      if dumpreg then\n\tout:write(format(\"%04d ------------ LOOP ------------\\n\", ins))\n      else\n\tout:write(format(\"%04d ------ LOOP ------------\\n\", ins))\n      end\n    elseif op ~= \"NOP   \" and op ~= \"CARG  \" and\n\t   (dumpreg or op ~= \"RENAME\") then\n      local rid = band(ridsp, 255)\n      if dumpreg then\n\tout:write(format(\"%04d %-6s\", ins, ridsp_name(ridsp, ins)))\n      else\n\tout:write(format(\"%04d \", ins))\n      end\n      out:write(format(\"%s%s %s %s \",\n\t\t       (rid == 254 or rid == 253) and \"}\" or\n\t\t       (band(ot, 128) == 0 and \" \" or \">\"),\n\t\t       band(ot, 64) == 0 and \" \" or \"+\",\n\t\t       irtype[t], op))\n      local m1, m2 = band(m, 3), band(m, 3*4)\n      if sub(op, 1, 4) == \"CALL\" then\n\tlocal ctype\n\tif m2 == 1*4 then -- op2 == IRMlit\n\t  out:write(format(\"%-10s  (\", vmdef.ircall[op2]))\n\telse\n\t  ctype = dumpcallfunc(tr, op2)\n\tend\n\tif op1 ~= -1 then dumpcallargs(tr, op1) end\n\tout:write(\")\")\n\tif ctype then out:write(\" ctype \", ctype) end\n      elseif op == \"CNEW  \" and op2 == -1 then\n\tout:write(formatk(tr, op1))\n      elseif m1 ~= 3 then -- op1 != IRMnone\n\tif op1 < 0 then\n\t  out:write(formatk(tr, op1))\n\telse\n\t  out:write(format(m1 == 0 and \"%04d\" or \"#%-3d\", op1))\n\tend\n\tif m2 ~= 3*4 then -- op2 != IRMnone\n\t  if m2 == 1*4 then -- op2 == IRMlit\n\t    local litn = litname[op]\n\t    if litn and litn[op2] then\n\t      out:write(\"  \", litn[op2])\n\t    elseif op == \"UREFO \" or op == \"UREFC \" then\n\t      out:write(format(\"  #%-3d\", shr(op2, 8)))\n\t    else\n\t      out:write(format(\"  #%-3d\", op2))\n\t    end\n\t  elseif op2 < 0 then\n\t    out:write(\"  \", formatk(tr, op2))\n\t  else\n\t    out:write(format(\"  %04d\", op2))\n\t  end\n\tend\n      end\n      out:write(\"\\n\")\n    end\n  end\n  if snap then\n    if dumpreg then\n      out:write(format(\"....              SNAP   #%-3d [ \", snapno))\n    else\n      out:write(format(\"....        SNAP   #%-3d [ \", snapno))\n    end\n    printsnap(tr, snap)\n  end\nend\n\n------------------------------------------------------------------------------\n\nlocal recprefix = \"\"\nlocal recdepth = 0\n\n-- Format trace error message.\nlocal function fmterr(err, info)\n  if type(err) == \"number\" then\n    if type(info) == \"function\" then info = fmtfunc(info) end\n    err = format(vmdef.traceerr[err], info)\n  end\n  return err\nend\n\n-- Dump trace states.\nlocal function dump_trace(what, tr, func, pc, otr, oex)\n  if what == \"stop\" or (what == \"abort\" and dumpmode.a) then\n    if dumpmode.i then dump_ir(tr, dumpmode.s, dumpmode.r and what == \"stop\")\n    elseif dumpmode.s then dump_snap(tr) end\n    if dumpmode.m then dump_mcode(tr) end\n  end\n  if what == \"start\" then\n    if dumpmode.H then out:write('<pre class=\"ljdump\">\\n') end\n    out:write(\"---- TRACE \", tr, \" \", what)\n    if otr then out:write(\" \", otr, \"/\", oex) end\n    out:write(\" \", fmtfunc(func, pc), \"\\n\")\n    recprefix = \"\"\n  elseif what == \"stop\" or what == \"abort\" then\n    out:write(\"---- TRACE \", tr, \" \", what)\n    recprefix = nil\n    if what == \"abort\" then\n      out:write(\" \", fmtfunc(func, pc), \" -- \", fmterr(otr, oex), \"\\n\")\n    else\n      local info = traceinfo(tr)\n      local link, ltype = info.link, info.linktype\n      if link == tr or link == 0 then\n\tout:write(\" -> \", ltype, \"\\n\")\n      elseif ltype == \"root\" then\n\tout:write(\" -> \", link, \"\\n\")\n      else\n\tout:write(\" -> \", link, \" \", ltype, \"\\n\")\n      end\n    end\n    if dumpmode.H then out:write(\"</pre>\\n\\n\") else out:write(\"\\n\") end\n  else\n    out:write(\"---- TRACE \", what, \"\\n\\n\")\n  end\n  out:flush()\nend\n\n-- Dump recorded bytecode.\nlocal function dump_record(tr, func, pc, depth, callee)\n  if depth ~= recdepth then\n    recdepth = depth\n    recprefix = rep(\" .\", depth)\n  end\n  local line\n  if pc >= 0 then\n    line = bcline(func, pc, recprefix)\n    if dumpmode.H then line = gsub(line, \"[<>&]\", html_escape) end\n  else\n    line = \"0000 \"..recprefix..\" FUNCC      \\n\"\n    callee = func\n  end\n  if pc <= 0 then\n    out:write(sub(line, 1, -2), \"         ; \", fmtfunc(func), \"\\n\")\n  else\n    out:write(line)\n  end\n  if pc >= 0 and band(funcbc(func, pc), 0xff) < 16 then -- ORDER BC\n    out:write(bcline(func, pc+1, recprefix)) -- Write JMP for cond.\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Dump taken trace exits.\nlocal function dump_texit(tr, ex, ngpr, nfpr, ...)\n  out:write(\"---- TRACE \", tr, \" exit \", ex, \"\\n\")\n  if dumpmode.X then\n    local regs = {...}\n    if jit.arch == \"x64\" then\n      for i=1,ngpr do\n\tout:write(format(\" %016x\", regs[i]))\n\tif i % 4 == 0 then out:write(\"\\n\") end\n      end\n    else\n      for i=1,ngpr do\n\tout:write(format(\" %08x\", regs[i]))\n\tif i % 8 == 0 then out:write(\"\\n\") end\n      end\n    end\n    if jit.arch == \"mips\" or jit.arch == \"mipsel\" then\n      for i=1,nfpr,2 do\n\tout:write(format(\" %+17.14g\", regs[ngpr+i]))\n\tif i % 8 == 7 then out:write(\"\\n\") end\n      end\n    else\n      for i=1,nfpr do\n\tout:write(format(\" %+17.14g\", regs[ngpr+i]))\n\tif i % 4 == 0 then out:write(\"\\n\") end\n      end\n    end\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Detach dump handlers.\nlocal function dumpoff()\n  if active then\n    active = false\n    jit.attach(dump_texit)\n    jit.attach(dump_record)\n    jit.attach(dump_trace)\n    if out and out ~= stdout and out ~= stderr then out:close() end\n    out = nil\n  end\nend\n\n-- Open the output file and attach dump handlers.\nlocal function dumpon(opt, outfile)\n  if active then dumpoff() end\n\n  local colormode = os.getenv(\"COLORTERM\") and \"A\" or \"T\"\n  if opt then\n    opt = gsub(opt, \"[TAH]\", function(mode) colormode = mode; return \"\"; end)\n  end\n\n  local m = { t=true, b=true, i=true, m=true, }\n  if opt and opt ~= \"\" then\n    local o = sub(opt, 1, 1)\n    if o ~= \"+\" and o ~= \"-\" then m = {} end\n    for i=1,#opt do m[sub(opt, i, i)] = (o ~= \"-\") end\n  end\n  dumpmode = m\n\n  if m.t or m.b or m.i or m.s or m.m then\n    jit.attach(dump_trace, \"trace\")\n  end\n  if m.b then\n    jit.attach(dump_record, \"record\")\n    if not bcline then bcline = require(\"jit.bc\").line end\n  end\n  if m.x or m.X then\n    jit.attach(dump_texit, \"texit\")\n  end\n\n  if not outfile then outfile = os.getenv(\"LUAJIT_DUMPFILE\") end\n  if outfile then\n    out = outfile == \"-\" and stdout or assert(io.open(outfile, \"w\"))\n  else\n    out = stdout\n  end\n\n  m[colormode] = true\n  if colormode == \"A\" then\n    colorize = colorize_ansi\n    irtype = irtype_ansi\n  elseif colormode == \"H\" then\n    colorize = colorize_html\n    irtype = irtype_html\n    out:write(header_html)\n  else\n    colorize = colorize_text\n    irtype = irtype_text\n  end\n\n  active = true\nend\n\n-- Public module functions.\nmodule(...)\n\non = dumpon\noff = dumpoff\nstart = dumpon -- For -j command line option.\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/jit/v.lua",
    "content": "----------------------------------------------------------------------------\n-- Verbose mode of the LuaJIT compiler.\n--\n-- Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n-- Released under the MIT license. See Copyright Notice in luajit.h\n----------------------------------------------------------------------------\n--\n-- This module shows verbose information about the progress of the\n-- JIT compiler. It prints one line for each generated trace. This module\n-- is useful to see which code has been compiled or where the compiler\n-- punts and falls back to the interpreter.\n--\n-- Example usage:\n--\n--   luajit -jv -e \"for i=1,1000 do for j=1,1000 do end end\"\n--   luajit -jv=myapp.out myapp.lua\n--\n-- Default output is to stderr. To redirect the output to a file, pass a\n-- filename as an argument (use '-' for stdout) or set the environment\n-- variable LUAJIT_VERBOSEFILE. The file is overwritten every time the\n-- module is started.\n--\n-- The output from the first example should look like this:\n--\n-- [TRACE   1 (command line):1 loop]\n-- [TRACE   2 (1/3) (command line):1 -> 1]\n--\n-- The first number in each line is the internal trace number. Next are\n-- the file name ('(command line)') and the line number (':1') where the\n-- trace has started. Side traces also show the parent trace number and\n-- the exit number where they are attached to in parentheses ('(1/3)').\n-- An arrow at the end shows where the trace links to ('-> 1'), unless\n-- it loops to itself.\n--\n-- In this case the inner loop gets hot and is traced first, generating\n-- a root trace. Then the last exit from the 1st trace gets hot, too,\n-- and triggers generation of the 2nd trace. The side trace follows the\n-- path along the outer loop and *around* the inner loop, back to its\n-- start, and then links to the 1st trace. Yes, this may seem unusual,\n-- if you know how traditional compilers work. Trace compilers are full\n-- of surprises like this -- have fun! :-)\n--\n-- Aborted traces are shown like this:\n--\n-- [TRACE --- foo.lua:44 -- leaving loop in root trace at foo:lua:50]\n--\n-- Don't worry -- trace aborts are quite common, even in programs which\n-- can be fully compiled. The compiler may retry several times until it\n-- finds a suitable trace.\n--\n-- Of course this doesn't work with features that are not-yet-implemented\n-- (NYI error messages). The VM simply falls back to the interpreter. This\n-- may not matter at all if the particular trace is not very high up in\n-- the CPU usage profile. Oh, and the interpreter is quite fast, too.\n--\n-- Also check out the -jdump module, which prints all the gory details.\n--\n------------------------------------------------------------------------------\n\n-- Cache some library functions and objects.\nlocal jit = require(\"jit\")\nassert(jit.version_num == 20001, \"LuaJIT core/library version mismatch\")\nlocal jutil = require(\"jit.util\")\nlocal vmdef = require(\"jit.vmdef\")\nlocal funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo\nlocal type, format = type, string.format\nlocal stdout, stderr = io.stdout, io.stderr\n\n-- Active flag and output file handle.\nlocal active, out\n\n------------------------------------------------------------------------------\n\nlocal startloc, startex\n\nlocal function fmtfunc(func, pc)\n  local fi = funcinfo(func, pc)\n  if fi.loc then\n    return fi.loc\n  elseif fi.ffid then\n    return vmdef.ffnames[fi.ffid]\n  elseif fi.addr then\n    return format(\"C:%x\", fi.addr)\n  else\n    return \"(?)\"\n  end\nend\n\n-- Format trace error message.\nlocal function fmterr(err, info)\n  if type(err) == \"number\" then\n    if type(info) == \"function\" then info = fmtfunc(info) end\n    err = format(vmdef.traceerr[err], info)\n  end\n  return err\nend\n\n-- Dump trace states.\nlocal function dump_trace(what, tr, func, pc, otr, oex)\n  if what == \"start\" then\n    startloc = fmtfunc(func, pc)\n    startex = otr and \"(\"..otr..\"/\"..oex..\") \" or \"\"\n  else\n    if what == \"abort\" then\n      local loc = fmtfunc(func, pc)\n      if loc ~= startloc then\n\tout:write(format(\"[TRACE --- %s%s -- %s at %s]\\n\",\n\t  startex, startloc, fmterr(otr, oex), loc))\n      else\n\tout:write(format(\"[TRACE --- %s%s -- %s]\\n\",\n\t  startex, startloc, fmterr(otr, oex)))\n      end\n    elseif what == \"stop\" then\n      local info = traceinfo(tr)\n      local link, ltype = info.link, info.linktype\n      if ltype == \"interpreter\" then\n\tout:write(format(\"[TRACE %3s %s%s -- fallback to interpreter]\\n\",\n\t  tr, startex, startloc))\n      elseif link == tr or link == 0 then\n\tout:write(format(\"[TRACE %3s %s%s %s]\\n\",\n\t  tr, startex, startloc, ltype))\n      elseif ltype == \"root\" then\n\tout:write(format(\"[TRACE %3s %s%s -> %d]\\n\",\n\t  tr, startex, startloc, link))\n      else\n\tout:write(format(\"[TRACE %3s %s%s -> %d %s]\\n\",\n\t  tr, startex, startloc, link, ltype))\n      end\n    else\n      out:write(format(\"[TRACE %s]\\n\", what))\n    end\n    out:flush()\n  end\nend\n\n------------------------------------------------------------------------------\n\n-- Detach dump handlers.\nlocal function dumpoff()\n  if active then\n    active = false\n    jit.attach(dump_trace)\n    if out and out ~= stdout and out ~= stderr then out:close() end\n    out = nil\n  end\nend\n\n-- Open the output file and attach dump handlers.\nlocal function dumpon(outfile)\n  if active then dumpoff() end\n  if not outfile then outfile = os.getenv(\"LUAJIT_VERBOSEFILE\") end\n  if outfile then\n    out = outfile == \"-\" and stdout or assert(io.open(outfile, \"w\"))\n  else\n    out = stderr\n  end\n  jit.attach(dump_trace, \"trace\")\n  active = true\nend\n\n-- Public module functions.\nmodule(...)\n\non = dumpon\noff = dumpoff\nstart = dumpon -- For -j command line option.\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lauxlib.h",
    "content": "/*\n** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $\n** Auxiliary functions for building Lua libraries\n** See Copyright Notice in lua.h\n*/\n\n\n#ifndef lauxlib_h\n#define lauxlib_h\n\n\n#include <stddef.h>\n#include <stdio.h>\n\n#include \"lua.h\"\n\n\n#define luaL_getn(L,i)          ((int)lua_objlen(L, i))\n#define luaL_setn(L,i,j)        ((void)0)  /* no op! */\n\n/* extra error code for `luaL_load' */\n#define LUA_ERRFILE     (LUA_ERRERR+1)\n\ntypedef struct luaL_Reg {\n  const char *name;\n  lua_CFunction func;\n} luaL_Reg;\n\nLUALIB_API void (luaL_openlib) (lua_State *L, const char *libname,\n                                const luaL_Reg *l, int nup);\nLUALIB_API void (luaL_register) (lua_State *L, const char *libname,\n                                const luaL_Reg *l);\nLUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e);\nLUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e);\nLUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname);\nLUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg);\nLUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg,\n                                                          size_t *l);\nLUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg,\n                                          const char *def, size_t *l);\nLUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg);\nLUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def);\n\nLUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg);\nLUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg,\n                                          lua_Integer def);\n\nLUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg);\nLUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t);\nLUALIB_API void (luaL_checkany) (lua_State *L, int narg);\n\nLUALIB_API int   (luaL_newmetatable) (lua_State *L, const char *tname);\nLUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);\n\nLUALIB_API void (luaL_where) (lua_State *L, int lvl);\nLUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);\n\nLUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,\n                                   const char *const lst[]);\n\nLUALIB_API int (luaL_ref) (lua_State *L, int t);\nLUALIB_API void (luaL_unref) (lua_State *L, int t, int ref);\n\nLUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename);\nLUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz,\n                                  const char *name);\nLUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);\n\nLUALIB_API lua_State *(luaL_newstate) (void);\n\n\nLUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,\n                                                  const char *r);\n\nLUALIB_API const char *(luaL_findtable) (lua_State *L, int idx,\n                                         const char *fname, int szhint);\n\n/* From Lua 5.2. */\nLUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname);\nLUALIB_API int luaL_execresult(lua_State *L, int stat);\nLUALIB_API int (luaL_loadfilex) (lua_State *L, const char *filename,\n\t\t\t\t const char *mode);\nLUALIB_API int (luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz,\n\t\t\t\t   const char *name, const char *mode);\nLUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,\n\t\t\t\tint level);\n\n\n/*\n** ===============================================================\n** some useful macros\n** ===============================================================\n*/\n\n#define luaL_argcheck(L, cond,numarg,extramsg)\t\\\n\t\t((void)((cond) || luaL_argerror(L, (numarg), (extramsg))))\n#define luaL_checkstring(L,n)\t(luaL_checklstring(L, (n), NULL))\n#define luaL_optstring(L,n,d)\t(luaL_optlstring(L, (n), (d), NULL))\n#define luaL_checkint(L,n)\t((int)luaL_checkinteger(L, (n)))\n#define luaL_optint(L,n,d)\t((int)luaL_optinteger(L, (n), (d)))\n#define luaL_checklong(L,n)\t((long)luaL_checkinteger(L, (n)))\n#define luaL_optlong(L,n,d)\t((long)luaL_optinteger(L, (n), (d)))\n\n#define luaL_typename(L,i)\tlua_typename(L, lua_type(L,(i)))\n\n#define luaL_dofile(L, fn) \\\n\t(luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\n#define luaL_dostring(L, s) \\\n\t(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))\n\n#define luaL_getmetatable(L,n)\t(lua_getfield(L, LUA_REGISTRYINDEX, (n)))\n\n#define luaL_opt(L,f,n,d)\t(lua_isnoneornil(L,(n)) ? (d) : f(L,(n)))\n\n/*\n** {======================================================\n** Generic Buffer manipulation\n** =======================================================\n*/\n\n\n\ntypedef struct luaL_Buffer {\n  char *p;\t\t\t/* current position in buffer */\n  int lvl;  /* number of strings in the stack (level) */\n  lua_State *L;\n  char buffer[LUAL_BUFFERSIZE];\n} luaL_Buffer;\n\n#define luaL_addchar(B,c) \\\n  ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \\\n   (*(B)->p++ = (char)(c)))\n\n/* compatibility only */\n#define luaL_putchar(B,c)\tluaL_addchar(B,c)\n\n#define luaL_addsize(B,n)\t((B)->p += (n))\n\nLUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B);\nLUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B);\nLUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);\nLUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s);\nLUALIB_API void (luaL_addvalue) (luaL_Buffer *B);\nLUALIB_API void (luaL_pushresult) (luaL_Buffer *B);\n\n\n/* }====================================================== */\n\n\n/* compatibility with ref system */\n\n/* pre-defined references */\n#define LUA_NOREF       (-2)\n#define LUA_REFNIL      (-1)\n\n#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \\\n      (lua_pushstring(L, \"unlocked references are obsolete\"), lua_error(L), 0))\n\n#define lua_unref(L,ref)        luaL_unref(L, LUA_REGISTRYINDEX, (ref))\n\n#define lua_getref(L,ref)       lua_rawgeti(L, LUA_REGISTRYINDEX, (ref))\n\n\n#define luaL_reg\tluaL_Reg\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_aux.c",
    "content": "/*\n** Auxiliary library for the Lua/C API.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major parts taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#include <errno.h>\n#include <stdarg.h>\n#include <stdio.h>\n\n#define lib_aux_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_state.h\"\n#include \"lj_trace.h\"\n#include \"lj_lib.h\"\n\n#if LJ_TARGET_POSIX\n#include <sys/wait.h>\n#endif\n\n/* -- I/O error handling -------------------------------------------------- */\n\nLUALIB_API int luaL_fileresult(lua_State *L, int stat, const char *fname)\n{\n  if (stat) {\n    setboolV(L->top++, 1);\n    return 1;\n  } else {\n    int en = errno;  /* Lua API calls may change this value. */\n    setnilV(L->top++);\n    if (fname)\n      lua_pushfstring(L, \"%s: %s\", fname, strerror(en));\n    else\n      lua_pushfstring(L, \"%s\", strerror(en));\n    setintV(L->top++, en);\n    lj_trace_abort(G(L));\n    return 3;\n  }\n}\n\nLUALIB_API int luaL_execresult(lua_State *L, int stat)\n{\n  if (stat != -1) {\n#if LJ_TARGET_POSIX\n    if (WIFSIGNALED(stat)) {\n      stat = WTERMSIG(stat);\n      setnilV(L->top++);\n      lua_pushliteral(L, \"signal\");\n    } else {\n      if (WIFEXITED(stat))\n\tstat = WEXITSTATUS(stat);\n      if (stat == 0)\n\tsetboolV(L->top++, 1);\n      else\n\tsetnilV(L->top++);\n      lua_pushliteral(L, \"exit\");\n    }\n#else\n    if (stat == 0)\n      setboolV(L->top++, 1);\n    else\n      setnilV(L->top++);\n    lua_pushliteral(L, \"exit\");\n#endif\n    setintV(L->top++, stat);\n    return 3;\n  }\n  return luaL_fileresult(L, 0, NULL);\n}\n\n/* -- Module registration ------------------------------------------------- */\n\nLUALIB_API const char *luaL_findtable(lua_State *L, int idx,\n\t\t\t\t      const char *fname, int szhint)\n{\n  const char *e;\n  lua_pushvalue(L, idx);\n  do {\n    e = strchr(fname, '.');\n    if (e == NULL) e = fname + strlen(fname);\n    lua_pushlstring(L, fname, (size_t)(e - fname));\n    lua_rawget(L, -2);\n    if (lua_isnil(L, -1)) {  /* no such field? */\n      lua_pop(L, 1);  /* remove this nil */\n      lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */\n      lua_pushlstring(L, fname, (size_t)(e - fname));\n      lua_pushvalue(L, -2);\n      lua_settable(L, -4);  /* set new table into field */\n    } else if (!lua_istable(L, -1)) {  /* field has a non-table value? */\n      lua_pop(L, 2);  /* remove table and value */\n      return fname;  /* return problematic part of the name */\n    }\n    lua_remove(L, -2);  /* remove previous table */\n    fname = e + 1;\n  } while (*e == '.');\n  return NULL;\n}\n\nstatic int libsize(const luaL_Reg *l)\n{\n  int size = 0;\n  for (; l->name; l++) size++;\n  return size;\n}\n\nLUALIB_API void luaL_openlib(lua_State *L, const char *libname,\n\t\t\t     const luaL_Reg *l, int nup)\n{\n  lj_lib_checkfpu(L);\n  if (libname) {\n    int size = libsize(l);\n    /* check whether lib already exists */\n    luaL_findtable(L, LUA_REGISTRYINDEX, \"_LOADED\", 16);\n    lua_getfield(L, -1, libname);  /* get _LOADED[libname] */\n    if (!lua_istable(L, -1)) {  /* not found? */\n      lua_pop(L, 1);  /* remove previous result */\n      /* try global variable (and create one if it does not exist) */\n      if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL)\n\tlj_err_callerv(L, LJ_ERR_BADMODN, libname);\n      lua_pushvalue(L, -1);\n      lua_setfield(L, -3, libname);  /* _LOADED[libname] = new table */\n    }\n    lua_remove(L, -2);  /* remove _LOADED table */\n    lua_insert(L, -(nup+1));  /* move library table to below upvalues */\n  }\n  for (; l->name; l++) {\n    int i;\n    for (i = 0; i < nup; i++)  /* copy upvalues to the top */\n      lua_pushvalue(L, -nup);\n    lua_pushcclosure(L, l->func, nup);\n    lua_setfield(L, -(nup+2), l->name);\n  }\n  lua_pop(L, nup);  /* remove upvalues */\n}\n\nLUALIB_API void luaL_register(lua_State *L, const char *libname,\n\t\t\t      const luaL_Reg *l)\n{\n  luaL_openlib(L, libname, l, 0);\n}\n\nLUALIB_API const char *luaL_gsub(lua_State *L, const char *s,\n\t\t\t\t const char *p, const char *r)\n{\n  const char *wild;\n  size_t l = strlen(p);\n  luaL_Buffer b;\n  luaL_buffinit(L, &b);\n  while ((wild = strstr(s, p)) != NULL) {\n    luaL_addlstring(&b, s, (size_t)(wild - s));  /* push prefix */\n    luaL_addstring(&b, r);  /* push replacement in place of pattern */\n    s = wild + l;  /* continue after `p' */\n  }\n  luaL_addstring(&b, s);  /* push last suffix */\n  luaL_pushresult(&b);\n  return lua_tostring(L, -1);\n}\n\n/* -- Buffer handling ----------------------------------------------------- */\n\n#define bufflen(B)\t((size_t)((B)->p - (B)->buffer))\n#define bufffree(B)\t((size_t)(LUAL_BUFFERSIZE - bufflen(B)))\n\nstatic int emptybuffer(luaL_Buffer *B)\n{\n  size_t l = bufflen(B);\n  if (l == 0)\n    return 0;  /* put nothing on stack */\n  lua_pushlstring(B->L, B->buffer, l);\n  B->p = B->buffer;\n  B->lvl++;\n  return 1;\n}\n\nstatic void adjuststack(luaL_Buffer *B)\n{\n  if (B->lvl > 1) {\n    lua_State *L = B->L;\n    int toget = 1;  /* number of levels to concat */\n    size_t toplen = lua_strlen(L, -1);\n    do {\n      size_t l = lua_strlen(L, -(toget+1));\n      if (!(B->lvl - toget + 1 >= LUA_MINSTACK/2 || toplen > l))\n\tbreak;\n      toplen += l;\n      toget++;\n    } while (toget < B->lvl);\n    lua_concat(L, toget);\n    B->lvl = B->lvl - toget + 1;\n  }\n}\n\nLUALIB_API char *luaL_prepbuffer(luaL_Buffer *B)\n{\n  if (emptybuffer(B))\n    adjuststack(B);\n  return B->buffer;\n}\n\nLUALIB_API void luaL_addlstring(luaL_Buffer *B, const char *s, size_t l)\n{\n  while (l--)\n    luaL_addchar(B, *s++);\n}\n\nLUALIB_API void luaL_addstring(luaL_Buffer *B, const char *s)\n{\n  luaL_addlstring(B, s, strlen(s));\n}\n\nLUALIB_API void luaL_pushresult(luaL_Buffer *B)\n{\n  emptybuffer(B);\n  lua_concat(B->L, B->lvl);\n  B->lvl = 1;\n}\n\nLUALIB_API void luaL_addvalue(luaL_Buffer *B)\n{\n  lua_State *L = B->L;\n  size_t vl;\n  const char *s = lua_tolstring(L, -1, &vl);\n  if (vl <= bufffree(B)) {  /* fit into buffer? */\n    memcpy(B->p, s, vl);  /* put it there */\n    B->p += vl;\n    lua_pop(L, 1);  /* remove from stack */\n  } else {\n    if (emptybuffer(B))\n      lua_insert(L, -2);  /* put buffer before new value */\n    B->lvl++;  /* add new value into B stack */\n    adjuststack(B);\n  }\n}\n\nLUALIB_API void luaL_buffinit(lua_State *L, luaL_Buffer *B)\n{\n  B->L = L;\n  B->p = B->buffer;\n  B->lvl = 0;\n}\n\n/* -- Reference management ------------------------------------------------ */\n\n#define FREELIST_REF\t0\n\n/* Convert a stack index to an absolute index. */\n#define abs_index(L, i) \\\n  ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)\n\nLUALIB_API int luaL_ref(lua_State *L, int t)\n{\n  int ref;\n  t = abs_index(L, t);\n  if (lua_isnil(L, -1)) {\n    lua_pop(L, 1);  /* remove from stack */\n    return LUA_REFNIL;  /* `nil' has a unique fixed reference */\n  }\n  lua_rawgeti(L, t, FREELIST_REF);  /* get first free element */\n  ref = (int)lua_tointeger(L, -1);  /* ref = t[FREELIST_REF] */\n  lua_pop(L, 1);  /* remove it from stack */\n  if (ref != 0) {  /* any free element? */\n    lua_rawgeti(L, t, ref);  /* remove it from list */\n    lua_rawseti(L, t, FREELIST_REF);  /* (t[FREELIST_REF] = t[ref]) */\n  } else {  /* no free elements */\n    ref = (int)lua_objlen(L, t);\n    ref++;  /* create new reference */\n  }\n  lua_rawseti(L, t, ref);\n  return ref;\n}\n\nLUALIB_API void luaL_unref(lua_State *L, int t, int ref)\n{\n  if (ref >= 0) {\n    t = abs_index(L, t);\n    lua_rawgeti(L, t, FREELIST_REF);\n    lua_rawseti(L, t, ref);  /* t[ref] = t[FREELIST_REF] */\n    lua_pushinteger(L, ref);\n    lua_rawseti(L, t, FREELIST_REF);  /* t[FREELIST_REF] = ref */\n  }\n}\n\n/* -- Default allocator and panic function -------------------------------- */\n\nstatic int panic(lua_State *L)\n{\n  const char *s = lua_tostring(L, -1);\n  fputs(\"PANIC: unprotected error in call to Lua API (\", stderr);\n  fputs(s ? s : \"?\", stderr);\n  fputc(')', stderr); fputc('\\n', stderr);\n  fflush(stderr);\n  return 0;\n}\n\n#ifdef LUAJIT_USE_SYSMALLOC\n\n#if LJ_64\n#error \"Must use builtin allocator for 64 bit target\"\n#endif\n\nstatic void *mem_alloc(void *ud, void *ptr, size_t osize, size_t nsize)\n{\n  (void)ud;\n  (void)osize;\n  if (nsize == 0) {\n    free(ptr);\n    return NULL;\n  } else {\n    return realloc(ptr, nsize);\n  }\n}\n\nLUALIB_API lua_State *luaL_newstate(void)\n{\n  lua_State *L = lua_newstate(mem_alloc, NULL);\n  if (L) G(L)->panic = panic;\n  return L;\n}\n\n#else\n\n#include \"lj_alloc.h\"\n\nLUALIB_API lua_State *luaL_newstate(void)\n{\n  lua_State *L;\n  void *ud = lj_alloc_create();\n  if (ud == NULL) return NULL;\n#if LJ_64\n  L = lj_state_newstate(lj_alloc_f, ud);\n#else\n  L = lua_newstate(lj_alloc_f, ud);\n#endif\n  if (L) G(L)->panic = panic;\n  return L;\n}\n\n#if LJ_64\nLUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)\n{\n  UNUSED(f); UNUSED(ud);\n  fputs(\"Must use luaL_newstate() for 64 bit target\\n\", stderr);\n  return NULL;\n}\n#endif\n\n#endif\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_base.c",
    "content": "/*\n** Base and coroutine library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2011 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#include <stdio.h>\n\n#define lib_base_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_meta.h\"\n#include \"lj_state.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#include \"lj_cconv.h\"\n#endif\n#include \"lj_bc.h\"\n#include \"lj_ff.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_char.h\"\n#include \"lj_strscan.h\"\n#include \"lj_lib.h\"\n\n/* -- Base library: checks ------------------------------------------------ */\n\n#define LJLIB_MODULE_base\n\nLJLIB_ASM(assert)\t\tLJLIB_REC(.)\n{\n  GCstr *s;\n  lj_lib_checkany(L, 1);\n  s = lj_lib_optstr(L, 2);\n  if (s)\n    lj_err_callermsg(L, strdata(s));\n  else\n    lj_err_caller(L, LJ_ERR_ASSERT);\n  return FFH_UNREACHABLE;\n}\n\n/* ORDER LJ_T */\nLJLIB_PUSH(\"nil\")\nLJLIB_PUSH(\"boolean\")\nLJLIB_PUSH(top-1)  /* boolean */\nLJLIB_PUSH(\"userdata\")\nLJLIB_PUSH(\"string\")\nLJLIB_PUSH(\"upval\")\nLJLIB_PUSH(\"thread\")\nLJLIB_PUSH(\"proto\")\nLJLIB_PUSH(\"function\")\nLJLIB_PUSH(\"trace\")\nLJLIB_PUSH(\"cdata\")\nLJLIB_PUSH(\"table\")\nLJLIB_PUSH(top-9)  /* userdata */\nLJLIB_PUSH(\"number\")\nLJLIB_ASM_(type)\t\tLJLIB_REC(.)\n/* Recycle the lj_lib_checkany(L, 1) from assert. */\n\n/* -- Base library: iterators --------------------------------------------- */\n\n/* This solves a circular dependency problem -- change FF_next_N as needed. */\nLJ_STATIC_ASSERT((int)FF_next == FF_next_N);\n\nLJLIB_ASM(next)\n{\n  lj_lib_checktab(L, 1);\n  return FFH_UNREACHABLE;\n}\n\n#if LJ_52 || LJ_HASFFI\nstatic int ffh_pairs(lua_State *L, MMS mm)\n{\n  TValue *o = lj_lib_checkany(L, 1);\n  cTValue *mo = lj_meta_lookup(L, o, mm);\n  if ((LJ_52 || tviscdata(o)) && !tvisnil(mo)) {\n    L->top = o+1;  /* Only keep one argument. */\n    copyTV(L, L->base-1, mo);  /* Replace callable. */\n    return FFH_TAILCALL;\n  } else {\n    if (!tvistab(o)) lj_err_argt(L, 1, LUA_TTABLE);\n    setfuncV(L, o-1, funcV(lj_lib_upvalue(L, 1)));\n    if (mm == MM_pairs) setnilV(o+1); else setintV(o+1, 0);\n    return FFH_RES(3);\n  }\n}\n#else\n#define ffh_pairs(L, mm)\t(lj_lib_checktab(L, 1), FFH_UNREACHABLE)\n#endif\n\nLJLIB_PUSH(lastcl)\nLJLIB_ASM(pairs)\n{\n  return ffh_pairs(L, MM_pairs);\n}\n\nLJLIB_NOREGUV LJLIB_ASM(ipairs_aux)\tLJLIB_REC(.)\n{\n  lj_lib_checktab(L, 1);\n  lj_lib_checkint(L, 2);\n  return FFH_UNREACHABLE;\n}\n\nLJLIB_PUSH(lastcl)\nLJLIB_ASM(ipairs)\t\tLJLIB_REC(.)\n{\n  return ffh_pairs(L, MM_ipairs);\n}\n\n/* -- Base library: getters and setters ----------------------------------- */\n\nLJLIB_ASM_(getmetatable)\tLJLIB_REC(.)\n/* Recycle the lj_lib_checkany(L, 1) from assert. */\n\nLJLIB_ASM(setmetatable)\t\tLJLIB_REC(.)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  GCtab *mt = lj_lib_checktabornil(L, 2);\n  if (!tvisnil(lj_meta_lookup(L, L->base, MM_metatable)))\n    lj_err_caller(L, LJ_ERR_PROTMT);\n  setgcref(t->metatable, obj2gco(mt));\n  if (mt) { lj_gc_objbarriert(L, t, mt); }\n  settabV(L, L->base-1, t);\n  return FFH_RES(1);\n}\n\nLJLIB_CF(getfenv)\n{\n  GCfunc *fn;\n  cTValue *o = L->base;\n  if (!(o < L->top && tvisfunc(o))) {\n    int level = lj_lib_optint(L, 1, 1);\n    o = lj_debug_frame(L, level, &level);\n    if (o == NULL)\n      lj_err_arg(L, 1, LJ_ERR_INVLVL);\n  }\n  fn = &gcval(o)->fn;\n  settabV(L, L->top++, isluafunc(fn) ? tabref(fn->l.env) : tabref(L->env));\n  return 1;\n}\n\nLJLIB_CF(setfenv)\n{\n  GCfunc *fn;\n  GCtab *t = lj_lib_checktab(L, 2);\n  cTValue *o = L->base;\n  if (!(o < L->top && tvisfunc(o))) {\n    int level = lj_lib_checkint(L, 1);\n    if (level == 0) {\n      /* NOBARRIER: A thread (i.e. L) is never black. */\n      setgcref(L->env, obj2gco(t));\n      return 0;\n    }\n    o = lj_debug_frame(L, level, &level);\n    if (o == NULL)\n      lj_err_arg(L, 1, LJ_ERR_INVLVL);\n  }\n  fn = &gcval(o)->fn;\n  if (!isluafunc(fn))\n    lj_err_caller(L, LJ_ERR_SETFENV);\n  setgcref(fn->l.env, obj2gco(t));\n  lj_gc_objbarrier(L, obj2gco(fn), t);\n  setfuncV(L, L->top++, fn);\n  return 1;\n}\n\nLJLIB_ASM(rawget)\t\tLJLIB_REC(.)\n{\n  lj_lib_checktab(L, 1);\n  lj_lib_checkany(L, 2);\n  return FFH_UNREACHABLE;\n}\n\nLJLIB_CF(rawset)\t\tLJLIB_REC(.)\n{\n  lj_lib_checktab(L, 1);\n  lj_lib_checkany(L, 2);\n  L->top = 1+lj_lib_checkany(L, 3);\n  lua_rawset(L, 1);\n  return 1;\n}\n\nLJLIB_CF(rawequal)\t\tLJLIB_REC(.)\n{\n  cTValue *o1 = lj_lib_checkany(L, 1);\n  cTValue *o2 = lj_lib_checkany(L, 2);\n  setboolV(L->top-1, lj_obj_equal(o1, o2));\n  return 1;\n}\n\n#if LJ_52\nLJLIB_CF(rawlen)\t\tLJLIB_REC(.)\n{\n  cTValue *o = L->base;\n  int32_t len;\n  if (L->top > o && tvisstr(o))\n    len = (int32_t)strV(o)->len;\n  else\n    len = (int32_t)lj_tab_len(lj_lib_checktab(L, 1));\n  setintV(L->top-1, len);\n  return 1;\n}\n#endif\n\nLJLIB_CF(unpack)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  int32_t n, i = lj_lib_optint(L, 2, 1);\n  int32_t e = (L->base+3-1 < L->top && !tvisnil(L->base+3-1)) ?\n\t      lj_lib_checkint(L, 3) : (int32_t)lj_tab_len(t);\n  if (i > e) return 0;\n  n = e - i + 1;\n  if (n <= 0 || !lua_checkstack(L, n))\n    lj_err_caller(L, LJ_ERR_UNPACK);\n  do {\n    cTValue *tv = lj_tab_getint(t, i);\n    if (tv) {\n      copyTV(L, L->top++, tv);\n    } else {\n      setnilV(L->top++);\n    }\n  } while (i++ < e);\n  return n;\n}\n\nLJLIB_CF(select)\t\tLJLIB_REC(.)\n{\n  int32_t n = (int32_t)(L->top - L->base);\n  if (n >= 1 && tvisstr(L->base) && *strVdata(L->base) == '#') {\n    setintV(L->top-1, n-1);\n    return 1;\n  } else {\n    int32_t i = lj_lib_checkint(L, 1);\n    if (i < 0) i = n + i; else if (i > n) i = n;\n    if (i < 1)\n      lj_err_arg(L, 1, LJ_ERR_IDXRNG);\n    return n - i;\n  }\n}\n\n/* -- Base library: conversions ------------------------------------------- */\n\nLJLIB_ASM(tonumber)\t\tLJLIB_REC(.)\n{\n  int32_t base = lj_lib_optint(L, 2, 10);\n  if (base == 10) {\n    TValue *o = lj_lib_checkany(L, 1);\n    if (lj_strscan_numberobj(o)) {\n      copyTV(L, L->base-1, o);\n      return FFH_RES(1);\n    }\n#if LJ_HASFFI\n    if (tviscdata(o)) {\n      CTState *cts = ctype_cts(L);\n      CType *ct = lj_ctype_rawref(cts, cdataV(o)->ctypeid);\n      if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);\n      if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) {\n\tif (LJ_DUALNUM && ctype_isinteger_or_bool(ct->info) &&\n\t    ct->size <= 4 && !(ct->size == 4 && (ct->info & CTF_UNSIGNED))) {\n\t  int32_t i;\n\t  lj_cconv_ct_tv(cts, ctype_get(cts, CTID_INT32), (uint8_t *)&i, o, 0);\n\t  setintV(L->base-1, i);\n\t  return FFH_RES(1);\n\t}\n\tlj_cconv_ct_tv(cts, ctype_get(cts, CTID_DOUBLE),\n\t\t       (uint8_t *)&(L->base-1)->n, o, 0);\n\treturn FFH_RES(1);\n      }\n    }\n#endif\n  } else {\n    const char *p = strdata(lj_lib_checkstr(L, 1));\n    char *ep;\n    unsigned long ul;\n    if (base < 2 || base > 36)\n      lj_err_arg(L, 2, LJ_ERR_BASERNG);\n    ul = strtoul(p, &ep, base);\n    if (p != ep) {\n      while (lj_char_isspace((unsigned char)(*ep))) ep++;\n      if (*ep == '\\0') {\n\tif (LJ_DUALNUM && LJ_LIKELY(ul < 0x80000000u))\n\t  setintV(L->base-1, (int32_t)ul);\n\telse\n\t  setnumV(L->base-1, (lua_Number)ul);\n\treturn FFH_RES(1);\n      }\n    }\n  }\n  setnilV(L->base-1);\n  return FFH_RES(1);\n}\n\nLJLIB_PUSH(\"nil\")\nLJLIB_PUSH(\"false\")\nLJLIB_PUSH(\"true\")\nLJLIB_ASM(tostring)\t\tLJLIB_REC(.)\n{\n  TValue *o = lj_lib_checkany(L, 1);\n  cTValue *mo;\n  L->top = o+1;  /* Only keep one argument. */\n  if (!tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) {\n    copyTV(L, L->base-1, mo);  /* Replace callable. */\n    return FFH_TAILCALL;\n  } else {\n    GCstr *s;\n    if (tvisnumber(o)) {\n      s = lj_str_fromnumber(L, o);\n    } else if (tvispri(o)) {\n      s = strV(lj_lib_upvalue(L, -(int32_t)itype(o)));\n    } else {\n      if (tvisfunc(o) && isffunc(funcV(o)))\n\tlua_pushfstring(L, \"function: builtin#%d\", funcV(o)->c.ffid);\n      else\n\tlua_pushfstring(L, \"%s: %p\", lj_typename(o), lua_topointer(L, 1));\n      /* Note: lua_pushfstring calls the GC which may invalidate o. */\n      s = strV(L->top-1);\n    }\n    setstrV(L, L->base-1, s);\n    return FFH_RES(1);\n  }\n}\n\n/* -- Base library: throw and catch errors -------------------------------- */\n\nLJLIB_CF(error)\n{\n  int32_t level = lj_lib_optint(L, 2, 1);\n  lua_settop(L, 1);\n  if (lua_isstring(L, 1) && level > 0) {\n    luaL_where(L, level);\n    lua_pushvalue(L, 1);\n    lua_concat(L, 2);\n  }\n  return lua_error(L);\n}\n\nLJLIB_ASM(pcall)\t\tLJLIB_REC(.)\n{\n  lj_lib_checkany(L, 1);\n  lj_lib_checkfunc(L, 2);  /* For xpcall only. */\n  return FFH_UNREACHABLE;\n}\nLJLIB_ASM_(xpcall)\t\tLJLIB_REC(.)\n\n/* -- Base library: load Lua code ----------------------------------------- */\n\nstatic int load_aux(lua_State *L, int status, int envarg)\n{\n  if (status == 0) {\n    if (tvistab(L->base+envarg-1)) {\n      GCfunc *fn = funcV(L->top-1);\n      GCtab *t = tabV(L->base+envarg-1);\n      setgcref(fn->c.env, obj2gco(t));\n      lj_gc_objbarrier(L, fn, t);\n    }\n    return 1;\n  } else {\n    setnilV(L->top-2);\n    return 2;\n  }\n}\n\nLJLIB_CF(loadfile)\n{\n  GCstr *fname = lj_lib_optstr(L, 1);\n  GCstr *mode = lj_lib_optstr(L, 2);\n  int status;\n  lua_settop(L, 3);  /* Ensure env arg exists. */\n  status = luaL_loadfilex(L, fname ? strdata(fname) : NULL,\n\t\t\t  mode ? strdata(mode) : NULL);\n  return load_aux(L, status, 3);\n}\n\nstatic const char *reader_func(lua_State *L, void *ud, size_t *size)\n{\n  UNUSED(ud);\n  luaL_checkstack(L, 2, \"too many nested functions\");\n  copyTV(L, L->top++, L->base);\n  lua_call(L, 0, 1);  /* Call user-supplied function. */\n  L->top--;\n  if (tvisnil(L->top)) {\n    *size = 0;\n    return NULL;\n  } else if (tvisstr(L->top) || tvisnumber(L->top)) {\n    copyTV(L, L->base+4, L->top);  /* Anchor string in reserved stack slot. */\n    return lua_tolstring(L, 5, size);\n  } else {\n    lj_err_caller(L, LJ_ERR_RDRSTR);\n    return NULL;\n  }\n}\n\nLJLIB_CF(load)\n{\n  GCstr *name = lj_lib_optstr(L, 2);\n  GCstr *mode = lj_lib_optstr(L, 3);\n  int status;\n  if (L->base < L->top && (tvisstr(L->base) || tvisnumber(L->base))) {\n    GCstr *s = lj_lib_checkstr(L, 1);\n    lua_settop(L, 4);  /* Ensure env arg exists. */\n    status = luaL_loadbufferx(L, strdata(s), s->len, strdata(name ? name : s),\n\t\t\t      mode ? strdata(mode) : NULL);\n  } else {\n    lj_lib_checkfunc(L, 1);\n    lua_settop(L, 5);  /* Reserve a slot for the string from the reader. */\n    status = lua_loadx(L, reader_func, NULL, name ? strdata(name) : \"=(load)\",\n\t\t       mode ? strdata(mode) : NULL);\n  }\n  return load_aux(L, status, 4);\n}\n\nLJLIB_CF(loadstring)\n{\n  return lj_cf_load(L);\n}\n\nLJLIB_CF(dofile)\n{\n  GCstr *fname = lj_lib_optstr(L, 1);\n  setnilV(L->top);\n  L->top = L->base+1;\n  if (luaL_loadfile(L, fname ? strdata(fname) : NULL) != 0)\n    lua_error(L);\n  lua_call(L, 0, LUA_MULTRET);\n  return (int)(L->top - L->base) - 1;\n}\n\n/* -- Base library: GC control -------------------------------------------- */\n\nLJLIB_CF(gcinfo)\n{\n  setintV(L->top++, (G(L)->gc.total >> 10));\n  return 1;\n}\n\nLJLIB_CF(collectgarbage)\n{\n  int opt = lj_lib_checkopt(L, 1, LUA_GCCOLLECT,  /* ORDER LUA_GC* */\n    \"\\4stop\\7restart\\7collect\\5count\\1\\377\\4step\\10setpause\\12setstepmul\");\n  int32_t data = lj_lib_optint(L, 2, 0);\n  if (opt == LUA_GCCOUNT) {\n    setnumV(L->top, (lua_Number)G(L)->gc.total/1024.0);\n  } else {\n    int res = lua_gc(L, opt, data);\n    if (opt == LUA_GCSTEP)\n      setboolV(L->top, res);\n    else\n      setintV(L->top, res);\n  }\n  L->top++;\n  return 1;\n}\n\n/* -- Base library: miscellaneous functions ------------------------------- */\n\nLJLIB_PUSH(top-2)  /* Upvalue holds weak table. */\nLJLIB_CF(newproxy)\n{\n  lua_settop(L, 1);\n  lua_newuserdata(L, 0);\n  if (lua_toboolean(L, 1) == 0) {  /* newproxy(): without metatable. */\n    return 1;\n  } else if (lua_isboolean(L, 1)) {  /* newproxy(true): with metatable. */\n    lua_newtable(L);\n    lua_pushvalue(L, -1);\n    lua_pushboolean(L, 1);\n    lua_rawset(L, lua_upvalueindex(1));  /* Remember mt in weak table. */\n  } else {  /* newproxy(proxy): inherit metatable. */\n    int validproxy = 0;\n    if (lua_getmetatable(L, 1)) {\n      lua_rawget(L, lua_upvalueindex(1));\n      validproxy = lua_toboolean(L, -1);\n      lua_pop(L, 1);\n    }\n    if (!validproxy)\n      lj_err_arg(L, 1, LJ_ERR_NOPROXY);\n    lua_getmetatable(L, 1);\n  }\n  lua_setmetatable(L, 2);\n  return 1;\n}\n\nLJLIB_PUSH(\"tostring\")\nLJLIB_CF(print)\n{\n  ptrdiff_t i, nargs = L->top - L->base;\n  cTValue *tv = lj_tab_getstr(tabref(L->env), strV(lj_lib_upvalue(L, 1)));\n  int shortcut;\n  if (tv && !tvisnil(tv)) {\n    copyTV(L, L->top++, tv);\n  } else {\n    setstrV(L, L->top++, strV(lj_lib_upvalue(L, 1)));\n    lua_gettable(L, LUA_GLOBALSINDEX);\n    tv = L->top-1;\n  }\n  shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring);\n  for (i = 0; i < nargs; i++) {\n    const char *str;\n    size_t size;\n    cTValue *o = &L->base[i];\n    if (shortcut && tvisstr(o)) {\n      str = strVdata(o);\n      size = strV(o)->len;\n    } else if (shortcut && tvisint(o)) {\n      char buf[LJ_STR_INTBUF];\n      char *p = lj_str_bufint(buf, intV(o));\n      size = (size_t)(buf+LJ_STR_INTBUF-p);\n      str = p;\n    } else if (shortcut && tvisnum(o)) {\n      char buf[LJ_STR_NUMBUF];\n      size = lj_str_bufnum(buf, o);\n      str = buf;\n    } else {\n      copyTV(L, L->top+1, o);\n      copyTV(L, L->top, L->top-1);\n      L->top += 2;\n      lua_call(L, 1, 1);\n      str = lua_tolstring(L, -1, &size);\n      if (!str)\n\tlj_err_caller(L, LJ_ERR_PRTOSTR);\n      L->top--;\n    }\n    if (i)\n      putchar('\\t');\n    fwrite(str, 1, size, stdout);\n  }\n  putchar('\\n');\n  return 0;\n}\n\nLJLIB_PUSH(top-3)\nLJLIB_SET(_VERSION)\n\n#include \"lj_libdef.h\"\n\n/* -- Coroutine library --------------------------------------------------- */\n\n#define LJLIB_MODULE_coroutine\n\nLJLIB_CF(coroutine_status)\n{\n  const char *s;\n  lua_State *co;\n  if (!(L->top > L->base && tvisthread(L->base)))\n    lj_err_arg(L, 1, LJ_ERR_NOCORO);\n  co = threadV(L->base);\n  if (co == L) s = \"running\";\n  else if (co->status == LUA_YIELD) s = \"suspended\";\n  else if (co->status != 0) s = \"dead\";\n  else if (co->base > tvref(co->stack)+1) s = \"normal\";\n  else if (co->top == co->base) s = \"dead\";\n  else s = \"suspended\";\n  lua_pushstring(L, s);\n  return 1;\n}\n\nLJLIB_CF(coroutine_running)\n{\n#if LJ_52\n  int ismain = lua_pushthread(L);\n  setboolV(L->top++, ismain);\n  return 2;\n#else\n  if (lua_pushthread(L))\n    setnilV(L->top++);\n  return 1;\n#endif\n}\n\nLJLIB_CF(coroutine_create)\n{\n  lua_State *L1;\n  if (!(L->base < L->top && tvisfunc(L->base)))\n    lj_err_argt(L, 1, LUA_TFUNCTION);\n  L1 = lua_newthread(L);\n  setfuncV(L, L1->top++, funcV(L->base));\n  return 1;\n}\n\nLJLIB_ASM(coroutine_yield)\n{\n  lj_err_caller(L, LJ_ERR_CYIELD);\n  return FFH_UNREACHABLE;\n}\n\nstatic int ffh_resume(lua_State *L, lua_State *co, int wrap)\n{\n  if (co->cframe != NULL || co->status > LUA_YIELD ||\n      (co->status == 0 && co->top == co->base)) {\n    ErrMsg em = co->cframe ? LJ_ERR_CORUN : LJ_ERR_CODEAD;\n    if (wrap) lj_err_caller(L, em);\n    setboolV(L->base-1, 0);\n    setstrV(L, L->base, lj_err_str(L, em));\n    return FFH_RES(2);\n  }\n  lj_state_growstack(co, (MSize)(L->top - L->base));\n  return FFH_RETRY;\n}\n\nLJLIB_ASM(coroutine_resume)\n{\n  if (!(L->top > L->base && tvisthread(L->base)))\n    lj_err_arg(L, 1, LJ_ERR_NOCORO);\n  return ffh_resume(L, threadV(L->base), 0);\n}\n\nLJLIB_NOREG LJLIB_ASM(coroutine_wrap_aux)\n{\n  return ffh_resume(L, threadV(lj_lib_upvalue(L, 1)), 1);\n}\n\n/* Inline declarations. */\nLJ_ASMF void lj_ff_coroutine_wrap_aux(void);\n#if !(LJ_TARGET_MIPS && defined(ljamalg_c))\nLJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L,\n\t\t\t\t\t\t\t  lua_State *co);\n#endif\n\n/* Error handler, called from assembler VM. */\nvoid LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, lua_State *co)\n{\n  co->top--; copyTV(L, L->top, co->top); L->top++;\n  if (tvisstr(L->top-1))\n    lj_err_callermsg(L, strVdata(L->top-1));\n  else\n    lj_err_run(L);\n}\n\n/* Forward declaration. */\nstatic void setpc_wrap_aux(lua_State *L, GCfunc *fn);\n\nLJLIB_CF(coroutine_wrap)\n{\n  lj_cf_coroutine_create(L);\n  lj_lib_pushcc(L, lj_ffh_coroutine_wrap_aux, FF_coroutine_wrap_aux, 1);\n  setpc_wrap_aux(L, funcV(L->top-1));\n  return 1;\n}\n\n#include \"lj_libdef.h\"\n\n/* Fix the PC of wrap_aux. Really ugly workaround. */\nstatic void setpc_wrap_aux(lua_State *L, GCfunc *fn)\n{\n  setmref(fn->c.pc, &L2GG(L)->bcff[lj_lib_init_coroutine[1]+2]);\n}\n\n/* ------------------------------------------------------------------------ */\n\nstatic void newproxy_weaktable(lua_State *L)\n{\n  /* NOBARRIER: The table is new (marked white). */\n  GCtab *t = lj_tab_new(L, 0, 1);\n  settabV(L, L->top++, t);\n  setgcref(t->metatable, obj2gco(t));\n  setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, \"__mode\")),\n\t    lj_str_newlit(L, \"kv\"));\n  t->nomm = (uint8_t)(~(1u<<MM_mode));\n}\n\nLUALIB_API int luaopen_base(lua_State *L)\n{\n  /* NOBARRIER: Table and value are the same. */\n  GCtab *env = tabref(L->env);\n  settabV(L, lj_tab_setstr(L, env, lj_str_newlit(L, \"_G\")), env);\n  lua_pushliteral(L, LUA_VERSION);  /* top-3. */\n  newproxy_weaktable(L);  /* top-2. */\n  LJ_LIB_REG(L, \"_G\", base);\n  LJ_LIB_REG(L, LUA_COLIBNAME, coroutine);\n  return 2;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_bit.c",
    "content": "/*\n** Bit manipulation library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lib_bit_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_lib.h\"\n\n/* ------------------------------------------------------------------------ */\n\n#define LJLIB_MODULE_bit\n\nLJLIB_ASM(bit_tobit)\t\tLJLIB_REC(bit_unary IR_TOBIT)\n{\n  lj_lib_checknumber(L, 1);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(bit_bnot)\t\tLJLIB_REC(bit_unary IR_BNOT)\nLJLIB_ASM_(bit_bswap)\t\tLJLIB_REC(bit_unary IR_BSWAP)\n\nLJLIB_ASM(bit_lshift)\t\tLJLIB_REC(bit_shift IR_BSHL)\n{\n  lj_lib_checknumber(L, 1);\n  lj_lib_checkbit(L, 2);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(bit_rshift)\t\tLJLIB_REC(bit_shift IR_BSHR)\nLJLIB_ASM_(bit_arshift)\t\tLJLIB_REC(bit_shift IR_BSAR)\nLJLIB_ASM_(bit_rol)\t\tLJLIB_REC(bit_shift IR_BROL)\nLJLIB_ASM_(bit_ror)\t\tLJLIB_REC(bit_shift IR_BROR)\n\nLJLIB_ASM(bit_band)\t\tLJLIB_REC(bit_nary IR_BAND)\n{\n  int i = 0;\n  do { lj_lib_checknumber(L, ++i); } while (L->base+i < L->top);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(bit_bor)\t\tLJLIB_REC(bit_nary IR_BOR)\nLJLIB_ASM_(bit_bxor)\t\tLJLIB_REC(bit_nary IR_BXOR)\n\n/* ------------------------------------------------------------------------ */\n\nLJLIB_CF(bit_tohex)\n{\n  uint32_t b = (uint32_t)lj_lib_checkbit(L, 1);\n  int32_t i, n = L->base+1 >= L->top ? 8 : lj_lib_checkbit(L, 2);\n  const char *hexdigits = \"0123456789abcdef\";\n  char buf[8];\n  if (n < 0) { n = -n; hexdigits = \"0123456789ABCDEF\"; }\n  if (n > 8) n = 8;\n  for (i = n; --i >= 0; ) { buf[i] = hexdigits[b & 15]; b >>= 4; }\n  lua_pushlstring(L, buf, (size_t)n);\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\n#include \"lj_libdef.h\"\n\nLUALIB_API int luaopen_bit(lua_State *L)\n{\n  LJ_LIB_REG(L, LUA_BITLIBNAME, bit);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_debug.c",
    "content": "/*\n** Debug library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lib_debug_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_lib.h\"\n\n/* ------------------------------------------------------------------------ */\n\n#define LJLIB_MODULE_debug\n\nLJLIB_CF(debug_getregistry)\n{\n  copyTV(L, L->top++, registry(L));\n  return 1;\n}\n\nLJLIB_CF(debug_getmetatable)\n{\n  lj_lib_checkany(L, 1);\n  if (!lua_getmetatable(L, 1)) {\n    setnilV(L->top-1);\n  }\n  return 1;\n}\n\nLJLIB_CF(debug_setmetatable)\n{\n  lj_lib_checktabornil(L, 2);\n  L->top = L->base+2;\n  lua_setmetatable(L, 1);\n#if !LJ_52\n  setboolV(L->top-1, 1);\n#endif\n  return 1;\n}\n\nLJLIB_CF(debug_getfenv)\n{\n  lj_lib_checkany(L, 1);\n  lua_getfenv(L, 1);\n  return 1;\n}\n\nLJLIB_CF(debug_setfenv)\n{\n  lj_lib_checktab(L, 2);\n  L->top = L->base+2;\n  if (!lua_setfenv(L, 1))\n    lj_err_caller(L, LJ_ERR_SETFENV);\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\nstatic void settabss(lua_State *L, const char *i, const char *v)\n{\n  lua_pushstring(L, v);\n  lua_setfield(L, -2, i);\n}\n\nstatic void settabsi(lua_State *L, const char *i, int v)\n{\n  lua_pushinteger(L, v);\n  lua_setfield(L, -2, i);\n}\n\nstatic void settabsb(lua_State *L, const char *i, int v)\n{\n  lua_pushboolean(L, v);\n  lua_setfield(L, -2, i);\n}\n\nstatic lua_State *getthread(lua_State *L, int *arg)\n{\n  if (L->base < L->top && tvisthread(L->base)) {\n    *arg = 1;\n    return threadV(L->base);\n  } else {\n    *arg = 0;\n    return L;\n  }\n}\n\nstatic void treatstackoption(lua_State *L, lua_State *L1, const char *fname)\n{\n  if (L == L1) {\n    lua_pushvalue(L, -2);\n    lua_remove(L, -3);\n  }\n  else\n    lua_xmove(L1, L, 1);\n  lua_setfield(L, -2, fname);\n}\n\nLJLIB_CF(debug_getinfo)\n{\n  lj_Debug ar;\n  int arg, opt_f = 0, opt_L = 0;\n  lua_State *L1 = getthread(L, &arg);\n  const char *options = luaL_optstring(L, arg+2, \"flnSu\");\n  if (lua_isnumber(L, arg+1)) {\n    if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), (lua_Debug *)&ar)) {\n      setnilV(L->top-1);\n      return 1;\n    }\n  } else if (L->base+arg < L->top && tvisfunc(L->base+arg)) {\n    options = lua_pushfstring(L, \">%s\", options);\n    setfuncV(L1, L1->top++, funcV(L->base+arg));\n  } else {\n    lj_err_arg(L, arg+1, LJ_ERR_NOFUNCL);\n  }\n  if (!lj_debug_getinfo(L1, options, &ar, 1))\n    lj_err_arg(L, arg+2, LJ_ERR_INVOPT);\n  lua_createtable(L, 0, 16);  /* Create result table. */\n  for (; *options; options++) {\n    switch (*options) {\n    case 'S':\n      settabss(L, \"source\", ar.source);\n      settabss(L, \"short_src\", ar.short_src);\n      settabsi(L, \"linedefined\", ar.linedefined);\n      settabsi(L, \"lastlinedefined\", ar.lastlinedefined);\n      settabss(L, \"what\", ar.what);\n      break;\n    case 'l':\n      settabsi(L, \"currentline\", ar.currentline);\n      break;\n    case 'u':\n      settabsi(L, \"nups\", ar.nups);\n      settabsi(L, \"nparams\", ar.nparams);\n      settabsb(L, \"isvararg\", ar.isvararg);\n      break;\n    case 'n':\n      settabss(L, \"name\", ar.name);\n      settabss(L, \"namewhat\", ar.namewhat);\n      break;\n    case 'f': opt_f = 1; break;\n    case 'L': opt_L = 1; break;\n    default: break;\n    }\n  }\n  if (opt_L) treatstackoption(L, L1, \"activelines\");\n  if (opt_f) treatstackoption(L, L1, \"func\");\n  return 1;  /* Return result table. */\n}\n\nLJLIB_CF(debug_getlocal)\n{\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  lua_Debug ar;\n  const char *name;\n  int slot = lj_lib_checkint(L, arg+2);\n  if (tvisfunc(L->base+arg)) {\n    L->top = L->base+arg+1;\n    lua_pushstring(L, lua_getlocal(L, NULL, slot));\n    return 1;\n  }\n  if (!lua_getstack(L1, lj_lib_checkint(L, arg+1), &ar))\n    lj_err_arg(L, arg+1, LJ_ERR_LVLRNG);\n  name = lua_getlocal(L1, &ar, slot);\n  if (name) {\n    lua_xmove(L1, L, 1);\n    lua_pushstring(L, name);\n    lua_pushvalue(L, -2);\n    return 2;\n  } else {\n    setnilV(L->top-1);\n    return 1;\n  }\n}\n\nLJLIB_CF(debug_setlocal)\n{\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  lua_Debug ar;\n  TValue *tv;\n  if (!lua_getstack(L1, lj_lib_checkint(L, arg+1), &ar))\n    lj_err_arg(L, arg+1, LJ_ERR_LVLRNG);\n  tv = lj_lib_checkany(L, arg+3);\n  copyTV(L1, L1->top++, tv);\n  lua_pushstring(L, lua_setlocal(L1, &ar, lj_lib_checkint(L, arg+2)));\n  return 1;\n}\n\nstatic int debug_getupvalue(lua_State *L, int get)\n{\n  int32_t n = lj_lib_checkint(L, 2);\n  const char *name;\n  lj_lib_checkfunc(L, 1);\n  name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);\n  if (name) {\n    lua_pushstring(L, name);\n    if (!get) return 1;\n    copyTV(L, L->top, L->top-2);\n    L->top++;\n    return 2;\n  }\n  return 0;\n}\n\nLJLIB_CF(debug_getupvalue)\n{\n  return debug_getupvalue(L, 1);\n}\n\nLJLIB_CF(debug_setupvalue)\n{\n  lj_lib_checkany(L, 3);\n  return debug_getupvalue(L, 0);\n}\n\nLJLIB_CF(debug_upvalueid)\n{\n  GCfunc *fn = lj_lib_checkfunc(L, 1);\n  int32_t n = lj_lib_checkint(L, 2) - 1;\n  if ((uint32_t)n >= fn->l.nupvalues)\n    lj_err_arg(L, 2, LJ_ERR_IDXRNG);\n  setlightudV(L->top-1, isluafunc(fn) ? (void *)gcref(fn->l.uvptr[n]) :\n\t\t\t\t\t(void *)&fn->c.upvalue[n]);\n  return 1;\n}\n\nLJLIB_CF(debug_upvaluejoin)\n{\n  GCfunc *fn[2];\n  GCRef *p[2];\n  int i;\n  for (i = 0; i < 2; i++) {\n    int32_t n;\n    fn[i] = lj_lib_checkfunc(L, 2*i+1);\n    if (!isluafunc(fn[i]))\n      lj_err_arg(L, 2*i+1, LJ_ERR_NOLFUNC);\n    n = lj_lib_checkint(L, 2*i+2) - 1;\n    if ((uint32_t)n >= fn[i]->l.nupvalues)\n      lj_err_arg(L, 2*i+2, LJ_ERR_IDXRNG);\n    p[i] = &fn[i]->l.uvptr[n];\n  }\n  setgcrefr(*p[0], *p[1]);\n  lj_gc_objbarrier(L, fn[0], gcref(*p[1]));\n  return 0;\n}\n\n#if LJ_52\nLJLIB_CF(debug_getuservalue)\n{\n  TValue *o = L->base;\n  if (o < L->top && tvisudata(o))\n    settabV(L, o, tabref(udataV(o)->env));\n  else\n    setnilV(o);\n  L->top = o+1;\n  return 1;\n}\n\nLJLIB_CF(debug_setuservalue)\n{\n  TValue *o = L->base;\n  if (!(o < L->top && tvisudata(o)))\n    lj_err_argt(L, 1, LUA_TUSERDATA);\n  if (!(o+1 < L->top && tvistab(o+1)))\n    lj_err_argt(L, 2, LUA_TTABLE);\n  L->top = o+2;\n  lua_setfenv(L, 1);\n  return 1;\n}\n#endif\n\n/* ------------------------------------------------------------------------ */\n\nstatic const char KEY_HOOK = 'h';\n\nstatic void hookf(lua_State *L, lua_Debug *ar)\n{\n  static const char *const hooknames[] =\n    {\"call\", \"return\", \"line\", \"count\", \"tail return\"};\n  lua_pushlightuserdata(L, (void *)&KEY_HOOK);\n  lua_rawget(L, LUA_REGISTRYINDEX);\n  if (lua_isfunction(L, -1)) {\n    lua_pushstring(L, hooknames[(int)ar->event]);\n    if (ar->currentline >= 0)\n      lua_pushinteger(L, ar->currentline);\n    else lua_pushnil(L);\n    lua_call(L, 2, 0);\n  }\n}\n\nstatic int makemask(const char *smask, int count)\n{\n  int mask = 0;\n  if (strchr(smask, 'c')) mask |= LUA_MASKCALL;\n  if (strchr(smask, 'r')) mask |= LUA_MASKRET;\n  if (strchr(smask, 'l')) mask |= LUA_MASKLINE;\n  if (count > 0) mask |= LUA_MASKCOUNT;\n  return mask;\n}\n\nstatic char *unmakemask(int mask, char *smask)\n{\n  int i = 0;\n  if (mask & LUA_MASKCALL) smask[i++] = 'c';\n  if (mask & LUA_MASKRET) smask[i++] = 'r';\n  if (mask & LUA_MASKLINE) smask[i++] = 'l';\n  smask[i] = '\\0';\n  return smask;\n}\n\nLJLIB_CF(debug_sethook)\n{\n  int arg, mask, count;\n  lua_Hook func;\n  (void)getthread(L, &arg);\n  if (lua_isnoneornil(L, arg+1)) {\n    lua_settop(L, arg+1);\n    func = NULL; mask = 0; count = 0;  /* turn off hooks */\n  } else {\n    const char *smask = luaL_checkstring(L, arg+2);\n    luaL_checktype(L, arg+1, LUA_TFUNCTION);\n    count = luaL_optint(L, arg+3, 0);\n    func = hookf; mask = makemask(smask, count);\n  }\n  lua_pushlightuserdata(L, (void *)&KEY_HOOK);\n  lua_pushvalue(L, arg+1);\n  lua_rawset(L, LUA_REGISTRYINDEX);\n  lua_sethook(L, func, mask, count);\n  return 0;\n}\n\nLJLIB_CF(debug_gethook)\n{\n  char buff[5];\n  int mask = lua_gethookmask(L);\n  lua_Hook hook = lua_gethook(L);\n  if (hook != NULL && hook != hookf) {  /* external hook? */\n    lua_pushliteral(L, \"external hook\");\n  } else {\n    lua_pushlightuserdata(L, (void *)&KEY_HOOK);\n    lua_rawget(L, LUA_REGISTRYINDEX);   /* get hook */\n  }\n  lua_pushstring(L, unmakemask(mask, buff));\n  lua_pushinteger(L, lua_gethookcount(L));\n  return 3;\n}\n\n/* ------------------------------------------------------------------------ */\n\nLJLIB_CF(debug_debug)\n{\n  for (;;) {\n    char buffer[250];\n    fputs(\"lua_debug> \", stderr);\n    if (fgets(buffer, sizeof(buffer), stdin) == 0 ||\n\tstrcmp(buffer, \"cont\\n\") == 0)\n      return 0;\n    if (luaL_loadbuffer(L, buffer, strlen(buffer), \"=(debug command)\") ||\n\tlua_pcall(L, 0, 0, 0)) {\n      fputs(lua_tostring(L, -1), stderr);\n      fputs(\"\\n\", stderr);\n    }\n    lua_settop(L, 0);  /* remove eventual returns */\n  }\n}\n\n/* ------------------------------------------------------------------------ */\n\n#define LEVELS1\t12\t/* size of the first part of the stack */\n#define LEVELS2\t10\t/* size of the second part of the stack */\n\nLJLIB_CF(debug_traceback)\n{\n  int arg;\n  lua_State *L1 = getthread(L, &arg);\n  const char *msg = lua_tostring(L, arg+1);\n  if (msg == NULL && L->top > L->base+arg)\n    L->top = L->base+arg+1;\n  else\n    luaL_traceback(L, L1, msg, lj_lib_optint(L, arg+2, (L == L1)));\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\n#include \"lj_libdef.h\"\n\nLUALIB_API int luaopen_debug(lua_State *L)\n{\n  LJ_LIB_REG(L, LUA_DBLIBNAME, debug);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_ffi.c",
    "content": "/*\n** FFI library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lib_ffi_c\n#define LUA_LIB\n\n#include <errno.h>\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_meta.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cparse.h\"\n#include \"lj_cdata.h\"\n#include \"lj_cconv.h\"\n#include \"lj_carith.h\"\n#include \"lj_ccall.h\"\n#include \"lj_ccallback.h\"\n#include \"lj_clib.h\"\n#include \"lj_ff.h\"\n#include \"lj_lib.h\"\n\n/* -- C type checks ------------------------------------------------------- */\n\n/* Check first argument for a C type and returns its ID. */\nstatic CTypeID ffi_checkctype(lua_State *L, CTState *cts, TValue *param)\n{\n  TValue *o = L->base;\n  if (!(o < L->top)) {\n  err_argtype:\n    lj_err_argtype(L, 1, \"C type\");\n  }\n  if (tvisstr(o)) {  /* Parse an abstract C type declaration. */\n    GCstr *s = strV(o);\n    CPState cp;\n    int errcode;\n    cp.L = L;\n    cp.cts = cts;\n    cp.srcname = strdata(s);\n    cp.p = strdata(s);\n    cp.param = param;\n    cp.mode = CPARSE_MODE_ABSTRACT|CPARSE_MODE_NOIMPLICIT;\n    errcode = lj_cparse(&cp);\n    if (errcode) lj_err_throw(L, errcode);  /* Propagate errors. */\n    return cp.val.id;\n  } else {\n    GCcdata *cd;\n    if (!tviscdata(o)) goto err_argtype;\n    if (param && param < L->top) lj_err_arg(L, 1, LJ_ERR_FFI_NUMPARAM);\n    cd = cdataV(o);\n    return cd->ctypeid == CTID_CTYPEID ? *(CTypeID *)cdataptr(cd) : cd->ctypeid;\n  }\n}\n\n/* Check argument for C data and return it. */\nstatic GCcdata *ffi_checkcdata(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (!(o < L->top && tviscdata(o)))\n    lj_err_argt(L, narg, LUA_TCDATA);\n  return cdataV(o);\n}\n\n/* Convert argument to C pointer. */\nstatic void *ffi_checkptr(lua_State *L, int narg, CTypeID id)\n{\n  CTState *cts = ctype_cts(L);\n  TValue *o = L->base + narg-1;\n  void *p;\n  if (o >= L->top)\n    lj_err_arg(L, narg, LJ_ERR_NOVAL);\n  lj_cconv_ct_tv(cts, ctype_get(cts, id), (uint8_t *)&p, o, CCF_ARG(narg));\n  return p;\n}\n\n/* Convert argument to int32_t. */\nstatic int32_t ffi_checkint(lua_State *L, int narg)\n{\n  CTState *cts = ctype_cts(L);\n  TValue *o = L->base + narg-1;\n  int32_t i;\n  if (o >= L->top)\n    lj_err_arg(L, narg, LJ_ERR_NOVAL);\n  lj_cconv_ct_tv(cts, ctype_get(cts, CTID_INT32), (uint8_t *)&i, o,\n\t\t CCF_ARG(narg));\n  return i;\n}\n\n/* -- C type metamethods -------------------------------------------------- */\n\n#define LJLIB_MODULE_ffi_meta\n\n/* Handle ctype __index/__newindex metamethods. */\nstatic int ffi_index_meta(lua_State *L, CTState *cts, CType *ct, MMS mm)\n{\n  CTypeID id = ctype_typeid(cts, ct);\n  cTValue *tv = lj_ctype_meta(cts, id, mm);\n  TValue *base = L->base;\n  if (!tv) {\n    const char *s;\n  err_index:\n    s = strdata(lj_ctype_repr(L, id, NULL));\n    if (tvisstr(L->base+1)) {\n      lj_err_callerv(L, LJ_ERR_FFI_BADMEMBER, s, strVdata(L->base+1));\n    } else {\n      const char *key = tviscdata(L->base+1) ?\n\tstrdata(lj_ctype_repr(L, cdataV(L->base+1)->ctypeid, NULL)) :\n\tlj_typename(L->base+1);\n      lj_err_callerv(L, LJ_ERR_FFI_BADIDXW, s, key);\n    }\n  }\n  if (!tvisfunc(tv)) {\n    if (mm == MM_index) {\n      cTValue *o = lj_meta_tget(L, tv, base+1);\n      if (o) {\n\tif (tvisnil(o)) goto err_index;\n\tcopyTV(L, L->top-1, o);\n\treturn 1;\n      }\n    } else {\n      TValue *o = lj_meta_tset(L, tv, base+1);\n      if (o) {\n\tcopyTV(L, o, base+2);\n\treturn 0;\n      }\n    }\n    tv = L->top-1;\n  }\n  return lj_meta_tailcall(L, tv);\n}\n\nLJLIB_CF(ffi_meta___index)\tLJLIB_REC(cdata_index 0)\n{\n  CTState *cts = ctype_cts(L);\n  CTInfo qual = 0;\n  CType *ct;\n  uint8_t *p;\n  TValue *o = L->base;\n  if (!(o+1 < L->top && tviscdata(o)))  /* Also checks for presence of key. */\n    lj_err_argt(L, 1, LUA_TCDATA);\n  ct = lj_cdata_index(cts, cdataV(o), o+1, &p, &qual);\n  if ((qual & 1))\n    return ffi_index_meta(L, cts, ct, MM_index);\n  if (lj_cdata_get(cts, ct, L->top-1, p))\n    lj_gc_check(L);\n  return 1;\n}\n\nLJLIB_CF(ffi_meta___newindex)\tLJLIB_REC(cdata_index 1)\n{\n  CTState *cts = ctype_cts(L);\n  CTInfo qual = 0;\n  CType *ct;\n  uint8_t *p;\n  TValue *o = L->base;\n  if (!(o+2 < L->top && tviscdata(o)))  /* Also checks for key and value. */\n    lj_err_argt(L, 1, LUA_TCDATA);\n  ct = lj_cdata_index(cts, cdataV(o), o+1, &p, &qual);\n  if ((qual & 1)) {\n    if ((qual & CTF_CONST))\n      lj_err_caller(L, LJ_ERR_FFI_WRCONST);\n    return ffi_index_meta(L, cts, ct, MM_newindex);\n  }\n  lj_cdata_set(cts, ct, p, o+2, qual);\n  return 0;\n}\n\n/* Common handler for cdata arithmetic. */\nstatic int ffi_arith(lua_State *L)\n{\n  MMS mm = (MMS)(curr_func(L)->c.ffid - (int)FF_ffi_meta___eq + (int)MM_eq);\n  return lj_carith_op(L, mm);\n}\n\n/* The following functions must be in contiguous ORDER MM. */\nLJLIB_CF(ffi_meta___eq)\t\tLJLIB_REC(cdata_arith MM_eq)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___len)\tLJLIB_REC(cdata_arith MM_len)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___lt)\t\tLJLIB_REC(cdata_arith MM_lt)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___le)\t\tLJLIB_REC(cdata_arith MM_le)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___concat)\tLJLIB_REC(cdata_arith MM_concat)\n{\n  return ffi_arith(L);\n}\n\n/* Forward declaration. */\nstatic int lj_cf_ffi_new(lua_State *L);\n\nLJLIB_CF(ffi_meta___call)\tLJLIB_REC(cdata_call)\n{\n  CTState *cts = ctype_cts(L);\n  GCcdata *cd = ffi_checkcdata(L, 1);\n  CTypeID id = cd->ctypeid;\n  CType *ct;\n  cTValue *tv;\n  MMS mm = MM_call;\n  if (cd->ctypeid == CTID_CTYPEID) {\n    id = *(CTypeID *)cdataptr(cd);\n    mm = MM_new;\n  } else {\n    int ret = lj_ccall_func(L, cd);\n    if (ret >= 0)\n      return ret;\n  }\n  /* Handle ctype __call/__new metamethod. */\n  ct = ctype_raw(cts, id);\n  if (ctype_isptr(ct->info)) id = ctype_cid(ct->info);\n  tv = lj_ctype_meta(cts, id, mm);\n  if (tv)\n    return lj_meta_tailcall(L, tv);\n  else if (mm == MM_call)\n    lj_err_callerv(L, LJ_ERR_FFI_BADCALL, strdata(lj_ctype_repr(L, id, NULL)));\n  return lj_cf_ffi_new(L);\n}\n\nLJLIB_CF(ffi_meta___add)\tLJLIB_REC(cdata_arith MM_add)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___sub)\tLJLIB_REC(cdata_arith MM_sub)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___mul)\tLJLIB_REC(cdata_arith MM_mul)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___div)\tLJLIB_REC(cdata_arith MM_div)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___mod)\tLJLIB_REC(cdata_arith MM_mod)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___pow)\tLJLIB_REC(cdata_arith MM_pow)\n{\n  return ffi_arith(L);\n}\n\nLJLIB_CF(ffi_meta___unm)\tLJLIB_REC(cdata_arith MM_unm)\n{\n  return ffi_arith(L);\n}\n/* End of contiguous ORDER MM. */\n\nLJLIB_CF(ffi_meta___tostring)\n{\n  GCcdata *cd = ffi_checkcdata(L, 1);\n  const char *msg = \"cdata<%s>: %p\";\n  CTypeID id = cd->ctypeid;\n  void *p = cdataptr(cd);\n  if (id == CTID_CTYPEID) {\n    msg = \"ctype<%s>\";\n    id = *(CTypeID *)p;\n  } else {\n    CTState *cts = ctype_cts(L);\n    CType *ct = ctype_raw(cts, id);\n    if (ctype_isref(ct->info)) {\n      p = *(void **)p;\n      ct = ctype_rawchild(cts, ct);\n    }\n    if (ctype_iscomplex(ct->info)) {\n      setstrV(L, L->top-1, lj_ctype_repr_complex(L, cdataptr(cd), ct->size));\n      goto checkgc;\n    } else if (ct->size == 8 && ctype_isinteger(ct->info)) {\n      setstrV(L, L->top-1, lj_ctype_repr_int64(L, *(uint64_t *)cdataptr(cd),\n\t\t\t\t\t       (ct->info & CTF_UNSIGNED)));\n      goto checkgc;\n    } else if (ctype_isfunc(ct->info)) {\n      p = *(void **)p;\n    } else if (ctype_isenum(ct->info)) {\n      msg = \"cdata<%s>: %d\";\n      p = (void *)(uintptr_t)*(uint32_t **)p;\n    } else {\n      if (ctype_isptr(ct->info)) {\n\tp = cdata_getptr(p, ct->size);\n\tct = ctype_rawchild(cts, ct);\n      }\n      if (ctype_isstruct(ct->info) || ctype_isvector(ct->info)) {\n\t/* Handle ctype __tostring metamethod. */\n\tcTValue *tv = lj_ctype_meta(cts, ctype_typeid(cts, ct), MM_tostring);\n\tif (tv)\n\t  return lj_meta_tailcall(L, tv);\n      }\n    }\n  }\n  lj_str_pushf(L, msg, strdata(lj_ctype_repr(L, id, NULL)), p);\ncheckgc:\n  lj_gc_check(L);\n  return 1;\n}\n\nstatic int ffi_pairs(lua_State *L, MMS mm)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkcdata(L, 1)->ctypeid;\n  CType *ct = ctype_raw(cts, id);\n  cTValue *tv;\n  if (ctype_isptr(ct->info)) id = ctype_cid(ct->info);\n  tv = lj_ctype_meta(cts, id, mm);\n  if (!tv)\n    lj_err_callerv(L, LJ_ERR_FFI_BADMM, strdata(lj_ctype_repr(L, id, NULL)),\n\t\t   strdata(mmname_str(G(L), mm)));\n  return lj_meta_tailcall(L, tv);\n}\n\nLJLIB_CF(ffi_meta___pairs)\n{\n  return ffi_pairs(L, MM_pairs);\n}\n\nLJLIB_CF(ffi_meta___ipairs)\n{\n  return ffi_pairs(L, MM_ipairs);\n}\n\nLJLIB_PUSH(\"ffi\") LJLIB_SET(__metatable)\n\n#include \"lj_libdef.h\"\n\n/* -- C library metamethods ----------------------------------------------- */\n\n#define LJLIB_MODULE_ffi_clib\n\n/* Index C library by a name. */\nstatic TValue *ffi_clib_index(lua_State *L)\n{\n  TValue *o = L->base;\n  CLibrary *cl;\n  if (!(o < L->top && tvisudata(o) && udataV(o)->udtype == UDTYPE_FFI_CLIB))\n    lj_err_argt(L, 1, LUA_TUSERDATA);\n  cl = (CLibrary *)uddata(udataV(o));\n  if (!(o+1 < L->top && tvisstr(o+1)))\n    lj_err_argt(L, 2, LUA_TSTRING);\n  return lj_clib_index(L, cl, strV(o+1));\n}\n\nLJLIB_CF(ffi_clib___index)\tLJLIB_REC(clib_index 1)\n{\n  TValue *tv = ffi_clib_index(L);\n  if (tviscdata(tv)) {\n    CTState *cts = ctype_cts(L);\n    GCcdata *cd = cdataV(tv);\n    CType *s = ctype_get(cts, cd->ctypeid);\n    if (ctype_isextern(s->info)) {\n      CTypeID sid = ctype_cid(s->info);\n      void *sp = *(void **)cdataptr(cd);\n      CType *ct = ctype_raw(cts, sid);\n      if (lj_cconv_tv_ct(cts, ct, sid, L->top-1, sp))\n\tlj_gc_check(L);\n      return 1;\n    }\n  }\n  copyTV(L, L->top-1, tv);\n  return 1;\n}\n\nLJLIB_CF(ffi_clib___newindex)\tLJLIB_REC(clib_index 0)\n{\n  TValue *tv = ffi_clib_index(L);\n  TValue *o = L->base+2;\n  if (o < L->top && tviscdata(tv)) {\n    CTState *cts = ctype_cts(L);\n    GCcdata *cd = cdataV(tv);\n    CType *d = ctype_get(cts, cd->ctypeid);\n    if (ctype_isextern(d->info)) {\n      CTInfo qual = 0;\n      for (;;) {  /* Skip attributes and collect qualifiers. */\n\td = ctype_child(cts, d);\n\tif (!ctype_isattrib(d->info)) break;\n\tif (ctype_attrib(d->info) == CTA_QUAL) qual |= d->size;\n      }\n      if (!((d->info|qual) & CTF_CONST)) {\n\tlj_cconv_ct_tv(cts, d, *(void **)cdataptr(cd), o, 0);\n\treturn 0;\n      }\n    }\n  }\n  lj_err_caller(L, LJ_ERR_FFI_WRCONST);\n  return 0;  /* unreachable */\n}\n\nLJLIB_CF(ffi_clib___gc)\n{\n  TValue *o = L->base;\n  if (o < L->top && tvisudata(o) && udataV(o)->udtype == UDTYPE_FFI_CLIB)\n    lj_clib_unload((CLibrary *)uddata(udataV(o)));\n  return 0;\n}\n\n#include \"lj_libdef.h\"\n\n/* -- Callback function metamethods --------------------------------------- */\n\n#define LJLIB_MODULE_ffi_callback\n\nstatic int ffi_callback_set(lua_State *L, GCfunc *fn)\n{\n  GCcdata *cd = ffi_checkcdata(L, 1);\n  CTState *cts = ctype_cts(L);\n  CType *ct = ctype_raw(cts, cd->ctypeid);\n  if (ctype_isptr(ct->info) && (LJ_32 || ct->size == 8)) {\n    MSize slot = lj_ccallback_ptr2slot(cts, *(void **)cdataptr(cd));\n    if (slot < cts->cb.sizeid && cts->cb.cbid[slot] != 0) {\n      GCtab *t = cts->miscmap;\n      TValue *tv = lj_tab_setint(L, t, (int32_t)slot);\n      if (fn) {\n\tsetfuncV(L, tv, fn);\n\tlj_gc_anybarriert(L, t);\n      } else {\n\tsetnilV(tv);\n\tcts->cb.cbid[slot] = 0;\n\tcts->cb.topid = slot < cts->cb.topid ? slot : cts->cb.topid;\n      }\n      return 0;\n    }\n  }\n  lj_err_caller(L, LJ_ERR_FFI_BADCBACK);\n  return 0;\n}\n\nLJLIB_CF(ffi_callback_free)\n{\n  return ffi_callback_set(L, NULL);\n}\n\nLJLIB_CF(ffi_callback_set)\n{\n  GCfunc *fn = lj_lib_checkfunc(L, 2);\n  return ffi_callback_set(L, fn);\n}\n\nLJLIB_PUSH(top-1) LJLIB_SET(__index)\n\n#include \"lj_libdef.h\"\n\n/* -- FFI library functions ----------------------------------------------- */\n\n#define LJLIB_MODULE_ffi\n\nLJLIB_CF(ffi_cdef)\n{\n  GCstr *s = lj_lib_checkstr(L, 1);\n  CPState cp;\n  int errcode;\n  cp.L = L;\n  cp.cts = ctype_cts(L);\n  cp.srcname = strdata(s);\n  cp.p = strdata(s);\n  cp.param = L->base+1;\n  cp.mode = CPARSE_MODE_MULTI|CPARSE_MODE_DIRECT;\n  errcode = lj_cparse(&cp);\n  if (errcode) lj_err_throw(L, errcode);  /* Propagate errors. */\n  lj_gc_check(L);\n  return 0;\n}\n\nLJLIB_CF(ffi_new)\tLJLIB_REC(.)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkctype(L, cts, NULL);\n  CType *ct = ctype_raw(cts, id);\n  CTSize sz;\n  CTInfo info = lj_ctype_info(cts, id, &sz);\n  TValue *o = L->base+1;\n  GCcdata *cd;\n  if ((info & CTF_VLA)) {\n    o++;\n    sz = lj_ctype_vlsize(cts, ct, (CTSize)ffi_checkint(L, 2));\n  }\n  if (sz == CTSIZE_INVALID)\n    lj_err_arg(L, 1, LJ_ERR_FFI_INVSIZE);\n  if (!(info & CTF_VLA) && ctype_align(info) <= CT_MEMALIGN)\n    cd = lj_cdata_new(cts, id, sz);\n  else\n    cd = lj_cdata_newv(cts, id, sz, ctype_align(info));\n  setcdataV(L, o-1, cd);  /* Anchor the uninitialized cdata. */\n  lj_cconv_ct_init(cts, ct, sz, cdataptr(cd),\n\t\t   o, (MSize)(L->top - o));  /* Initialize cdata. */\n  if (ctype_isstruct(ct->info)) {\n    /* Handle ctype __gc metamethod. Use the fast lookup here. */\n    cTValue *tv = lj_tab_getinth(cts->miscmap, -(int32_t)id);\n    if (tv && tvistab(tv) && (tv = lj_meta_fast(L, tabV(tv), MM_gc))) {\n      GCtab *t = cts->finalizer;\n      if (gcref(t->metatable)) {\n\t/* Add to finalizer table, if still enabled. */\n\tcopyTV(L, lj_tab_set(L, t, o-1), tv);\n\tlj_gc_anybarriert(L, t);\n\tcd->marked |= LJ_GC_CDATA_FIN;\n      }\n    }\n  }\n  L->top = o;  /* Only return the cdata itself. */\n  lj_gc_check(L);\n  return 1;\n}\n\nLJLIB_CF(ffi_cast)\tLJLIB_REC(ffi_new)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkctype(L, cts, NULL);\n  CType *d = ctype_raw(cts, id);\n  TValue *o = lj_lib_checkany(L, 2);\n  L->top = o+1;  /* Make sure this is the last item on the stack. */\n  if (!(ctype_isnum(d->info) || ctype_isptr(d->info) || ctype_isenum(d->info)))\n    lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE);\n  if (!(tviscdata(o) && cdataV(o)->ctypeid == id)) {\n    GCcdata *cd = lj_cdata_new(cts, id, d->size);\n    lj_cconv_ct_tv(cts, d, cdataptr(cd), o, CCF_CAST);\n    setcdataV(L, o, cd);\n    lj_gc_check(L);\n  }\n  return 1;\n}\n\nLJLIB_CF(ffi_typeof)\tLJLIB_REC(.)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkctype(L, cts, L->base+1);\n  GCcdata *cd = lj_cdata_new(cts, CTID_CTYPEID, 4);\n  *(CTypeID *)cdataptr(cd) = id;\n  setcdataV(L, L->top-1, cd);\n  lj_gc_check(L);\n  return 1;\n}\n\nLJLIB_CF(ffi_istype)\tLJLIB_REC(.)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id1 = ffi_checkctype(L, cts, NULL);\n  TValue *o = lj_lib_checkany(L, 2);\n  int b = 0;\n  if (tviscdata(o)) {\n    GCcdata *cd = cdataV(o);\n    CTypeID id2 = cd->ctypeid == CTID_CTYPEID ? *(CTypeID *)cdataptr(cd) :\n\t\t\t\t\t\tcd->ctypeid;\n    CType *ct1 = lj_ctype_rawref(cts, id1);\n    CType *ct2 = lj_ctype_rawref(cts, id2);\n    if (ct1 == ct2) {\n      b = 1;\n    } else if (ctype_type(ct1->info) == ctype_type(ct2->info) &&\n\t       ct1->size == ct2->size) {\n      if (ctype_ispointer(ct1->info))\n\tb = lj_cconv_compatptr(cts, ct1, ct2, CCF_IGNQUAL);\n      else if (ctype_isnum(ct1->info) || ctype_isvoid(ct1->info))\n\tb = (((ct1->info ^ ct2->info) & ~CTF_QUAL) == 0);\n    } else if (ctype_isstruct(ct1->info) && ctype_isptr(ct2->info) &&\n\t       ct1 == ctype_rawchild(cts, ct2)) {\n      b = 1;\n    }\n  }\n  setboolV(L->top-1, b);\n  setboolV(&G(L)->tmptv2, b);  /* Remember for trace recorder. */\n  return 1;\n}\n\nLJLIB_CF(ffi_sizeof)\tLJLIB_REC(ffi_xof FF_ffi_sizeof)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkctype(L, cts, NULL);\n  CTSize sz;\n  if (LJ_UNLIKELY(tviscdata(L->base) && cdataisv(cdataV(L->base)))) {\n    sz = cdatavlen(cdataV(L->base));\n  } else {\n    CType *ct = lj_ctype_rawref(cts, id);\n    if (ctype_isvltype(ct->info))\n      sz = lj_ctype_vlsize(cts, ct, (CTSize)ffi_checkint(L, 2));\n    else\n      sz = ctype_hassize(ct->info) ? ct->size : CTSIZE_INVALID;\n    if (LJ_UNLIKELY(sz == CTSIZE_INVALID)) {\n      setnilV(L->top-1);\n      return 1;\n    }\n  }\n  setintV(L->top-1, (int32_t)sz);\n  return 1;\n}\n\nLJLIB_CF(ffi_alignof)\tLJLIB_REC(ffi_xof FF_ffi_alignof)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkctype(L, cts, NULL);\n  CTSize sz = 0;\n  CTInfo info = lj_ctype_info(cts, id, &sz);\n  setintV(L->top-1, 1 << ctype_align(info));\n  return 1;\n}\n\nLJLIB_CF(ffi_offsetof)\tLJLIB_REC(ffi_xof FF_ffi_offsetof)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkctype(L, cts, NULL);\n  GCstr *name = lj_lib_checkstr(L, 2);\n  CType *ct = lj_ctype_rawref(cts, id);\n  CTSize ofs;\n  if (ctype_isstruct(ct->info) && ct->size != CTSIZE_INVALID) {\n    CType *fct = lj_ctype_getfield(cts, ct, name, &ofs);\n    if (fct) {\n      setintV(L->top-1, ofs);\n      if (ctype_isfield(fct->info)) {\n\treturn 1;\n      } else if (ctype_isbitfield(fct->info)) {\n\tsetintV(L->top++, ctype_bitpos(fct->info));\n\tsetintV(L->top++, ctype_bitbsz(fct->info));\n\treturn 3;\n      }\n    }\n  }\n  return 0;\n}\n\nLJLIB_CF(ffi_errno)\tLJLIB_REC(.)\n{\n  int err = errno;\n  if (L->top > L->base)\n    errno = ffi_checkint(L, 1);\n  setintV(L->top++, err);\n  return 1;\n}\n\nLJLIB_CF(ffi_string)\tLJLIB_REC(.)\n{\n  CTState *cts = ctype_cts(L);\n  TValue *o = lj_lib_checkany(L, 1);\n  const char *p;\n  size_t len;\n  if (o+1 < L->top) {\n    len = (size_t)ffi_checkint(L, 2);\n    lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CVOID), (uint8_t *)&p, o,\n\t\t   CCF_ARG(1));\n  } else {\n    lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CCHAR), (uint8_t *)&p, o,\n\t\t   CCF_ARG(1));\n    len = strlen(p);\n  }\n  L->top = o+1;  /* Make sure this is the last item on the stack. */\n  setstrV(L, o, lj_str_new(L, p, len));\n  lj_gc_check(L);\n  return 1;\n}\n\nLJLIB_CF(ffi_copy)\tLJLIB_REC(.)\n{\n  void *dp = ffi_checkptr(L, 1, CTID_P_VOID);\n  void *sp = ffi_checkptr(L, 2, CTID_P_CVOID);\n  TValue *o = L->base+1;\n  CTSize len;\n  if (tvisstr(o) && o+1 >= L->top)\n    len = strV(o)->len+1;  /* Copy Lua string including trailing '\\0'. */\n  else\n    len = (CTSize)ffi_checkint(L, 3);\n  memcpy(dp, sp, len);\n  return 0;\n}\n\nLJLIB_CF(ffi_fill)\tLJLIB_REC(.)\n{\n  void *dp = ffi_checkptr(L, 1, CTID_P_VOID);\n  CTSize len = (CTSize)ffi_checkint(L, 2);\n  int32_t fill = 0;\n  if (L->base+2 < L->top && !tvisnil(L->base+2)) fill = ffi_checkint(L, 3);\n  memset(dp, fill, len);\n  return 0;\n}\n\n#define H_(le, be)\tLJ_ENDIAN_SELECT(0x##le, 0x##be)\n\n/* Test ABI string. */\nLJLIB_CF(ffi_abi)\tLJLIB_REC(.)\n{\n  GCstr *s = lj_lib_checkstr(L, 1);\n  int b = 0;\n  switch (s->hash) {\n#if LJ_64\n  case H_(849858eb,ad35fd06): b = 1; break;  /* 64bit */\n#else\n  case H_(662d3c79,d0e22477): b = 1; break;  /* 32bit */\n#endif\n#if LJ_ARCH_HASFPU\n  case H_(e33ee463,e33ee463): b = 1; break;  /* fpu */\n#endif\n#if LJ_ABI_SOFTFP\n  case H_(61211a23,c2e8c81c): b = 1; break;  /* softfp */\n#else\n  case H_(539417a8,8ce0812f): b = 1; break;  /* hardfp */\n#endif\n#if LJ_ABI_EABI\n  case H_(2182df8f,f2ed1152): b = 1; break;  /* eabi */\n#endif\n#if LJ_ABI_WIN\n  case H_(4ab624a8,4ab624a8): b = 1; break;  /* win */\n#endif\n  case H_(3af93066,1f001464): b = 1; break;  /* le/be */\n  default:\n    break;\n  }\n  setboolV(L->top-1, b);\n  setboolV(&G(L)->tmptv2, b);  /* Remember for trace recorder. */\n  return 1;\n}\n\n#undef H_\n\nLJLIB_PUSH(top-8) LJLIB_SET(!)  /* Store reference to miscmap table. */\n\nLJLIB_CF(ffi_metatype)\n{\n  CTState *cts = ctype_cts(L);\n  CTypeID id = ffi_checkctype(L, cts, NULL);\n  GCtab *mt = lj_lib_checktab(L, 2);\n  GCtab *t = cts->miscmap;\n  CType *ct = ctype_get(cts, id);  /* Only allow raw types. */\n  TValue *tv;\n  GCcdata *cd;\n  if (!(ctype_isstruct(ct->info) || ctype_iscomplex(ct->info) ||\n\tctype_isvector(ct->info)))\n    lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE);\n  tv = lj_tab_setinth(L, t, -(int32_t)id);\n  if (!tvisnil(tv))\n    lj_err_caller(L, LJ_ERR_PROTMT);\n  settabV(L, tv, mt);\n  lj_gc_anybarriert(L, t);\n  cd = lj_cdata_new(cts, CTID_CTYPEID, 4);\n  *(CTypeID *)cdataptr(cd) = id;\n  setcdataV(L, L->top-1, cd);\n  lj_gc_check(L);\n  return 1;\n}\n\nLJLIB_PUSH(top-7) LJLIB_SET(!)  /* Store reference to finalizer table. */\n\nLJLIB_CF(ffi_gc)\tLJLIB_REC(.)\n{\n  GCcdata *cd = ffi_checkcdata(L, 1);\n  TValue *fin = lj_lib_checkany(L, 2);\n  CTState *cts = ctype_cts(L);\n  GCtab *t = cts->finalizer;\n  CType *ct = ctype_raw(cts, cd->ctypeid);\n  if (!(ctype_isptr(ct->info) || ctype_isstruct(ct->info) ||\n\tctype_isrefarray(ct->info)))\n    lj_err_arg(L, 1, LJ_ERR_FFI_INVTYPE);\n  if (gcref(t->metatable)) {  /* Update finalizer table, if still enabled. */\n    copyTV(L, lj_tab_set(L, t, L->base), fin);\n    lj_gc_anybarriert(L, t);\n    if (!tvisnil(fin))\n      cd->marked |= LJ_GC_CDATA_FIN;\n    else\n      cd->marked &= ~LJ_GC_CDATA_FIN;\n  }\n  L->top = L->base+1;  /* Pass through the cdata object. */\n  return 1;\n}\n\nLJLIB_PUSH(top-5) LJLIB_SET(!)  /* Store clib metatable in func environment. */\n\nLJLIB_CF(ffi_load)\n{\n  GCstr *name = lj_lib_checkstr(L, 1);\n  int global = (L->base+1 < L->top && tvistruecond(L->base+1));\n  lj_clib_load(L, tabref(curr_func(L)->c.env), name, global);\n  return 1;\n}\n\nLJLIB_PUSH(top-4) LJLIB_SET(C)\nLJLIB_PUSH(top-3) LJLIB_SET(os)\nLJLIB_PUSH(top-2) LJLIB_SET(arch)\n\n#include \"lj_libdef.h\"\n\n/* ------------------------------------------------------------------------ */\n\n/* Create special weak-keyed finalizer table. */\nstatic GCtab *ffi_finalizer(lua_State *L)\n{\n  /* NOBARRIER: The table is new (marked white). */\n  GCtab *t = lj_tab_new(L, 0, 1);\n  settabV(L, L->top++, t);\n  setgcref(t->metatable, obj2gco(t));\n  setstrV(L, lj_tab_setstr(L, t, lj_str_newlit(L, \"__mode\")),\n\t  lj_str_newlit(L, \"K\"));\n  t->nomm = (uint8_t)(~(1u<<MM_mode));\n  return t;\n}\n\n/* Register FFI module as loaded. */\nstatic void ffi_register_module(lua_State *L)\n{\n  cTValue *tmp = lj_tab_getstr(tabV(registry(L)), lj_str_newlit(L, \"_LOADED\"));\n  if (tmp && tvistab(tmp)) {\n    GCtab *t = tabV(tmp);\n    copyTV(L, lj_tab_setstr(L, t, lj_str_newlit(L, LUA_FFILIBNAME)), L->top-1);\n    lj_gc_anybarriert(L, t);\n  }\n}\n\nLUALIB_API int luaopen_ffi(lua_State *L)\n{\n  CTState *cts = lj_ctype_init(L);\n  settabV(L, L->top++, (cts->miscmap = lj_tab_new(L, 0, 1)));\n  cts->finalizer = ffi_finalizer(L);\n  LJ_LIB_REG(L, NULL, ffi_meta);\n  /* NOBARRIER: basemt is a GC root. */\n  setgcref(basemt_it(G(L), LJ_TCDATA), obj2gco(tabV(L->top-1)));\n  LJ_LIB_REG(L, NULL, ffi_clib);\n  LJ_LIB_REG(L, NULL, ffi_callback);\n  /* NOBARRIER: the key is new and lj_tab_newkey() handles the barrier. */\n  settabV(L, lj_tab_setstr(L, cts->miscmap, &cts->g->strempty), tabV(L->top-1));\n  L->top--;\n  lj_clib_default(L, tabV(L->top-1));  /* Create ffi.C default namespace. */\n  lua_pushliteral(L, LJ_OS_NAME);\n  lua_pushliteral(L, LJ_ARCH_NAME);\n  LJ_LIB_REG(L, NULL, ffi);  /* Note: no global \"ffi\" created! */\n  ffi_register_module(L);\n  return 1;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_init.c",
    "content": "/*\n** Library initialization.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major parts taken verbatim from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lib_init_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_arch.h\"\n\nstatic const luaL_Reg lj_lib_load[] = {\n  { \"\",\t\t\tluaopen_base },\n  { LUA_LOADLIBNAME,\tluaopen_package },\n  { LUA_TABLIBNAME,\tluaopen_table },\n  { LUA_IOLIBNAME,\tluaopen_io },\n  { LUA_OSLIBNAME,\tluaopen_os },\n  { LUA_STRLIBNAME,\tluaopen_string },\n  { LUA_MATHLIBNAME,\tluaopen_math },\n  { LUA_DBLIBNAME,\tluaopen_debug },\n  { LUA_BITLIBNAME,\tluaopen_bit },\n  { LUA_JITLIBNAME,\tluaopen_jit },\n  { NULL,\t\tNULL }\n};\n\nstatic const luaL_Reg lj_lib_preload[] = {\n#if LJ_HASFFI\n  { LUA_FFILIBNAME,\tluaopen_ffi },\n#endif\n  { NULL,\t\tNULL }\n};\n\nLUALIB_API void luaL_openlibs(lua_State *L)\n{\n  const luaL_Reg *lib;\n  for (lib = lj_lib_load; lib->func; lib++) {\n    lua_pushcfunction(L, lib->func);\n    lua_pushstring(L, lib->name);\n    lua_call(L, 1, 0);\n  }\n  luaL_findtable(L, LUA_REGISTRYINDEX, \"_PRELOAD\",\n\t\t sizeof(lj_lib_preload)/sizeof(lj_lib_preload[0])-1);\n  for (lib = lj_lib_preload; lib->func; lib++) {\n    lua_pushcfunction(L, lib->func);\n    lua_setfield(L, -2, lib->name);\n  }\n  lua_pop(L, 1);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_io.c",
    "content": "/*\n** I/O library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2011 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#include <errno.h>\n#include <stdio.h>\n\n#define lib_io_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_state.h\"\n#include \"lj_ff.h\"\n#include \"lj_lib.h\"\n\n/* Userdata payload for I/O file. */\ntypedef struct IOFileUD {\n  FILE *fp;\t\t/* File handle. */\n  uint32_t type;\t/* File type. */\n} IOFileUD;\n\n#define IOFILE_TYPE_FILE\t0\t/* Regular file. */\n#define IOFILE_TYPE_PIPE\t1\t/* Pipe. */\n#define IOFILE_TYPE_STDF\t2\t/* Standard file handle. */\n#define IOFILE_TYPE_MASK\t3\n\n#define IOFILE_FLAG_CLOSE\t4\t/* Close after io.lines() iterator. */\n\n#define IOSTDF_UD(L, id)\t(&gcref(G(L)->gcroot[(id)])->ud)\n#define IOSTDF_IOF(L, id)\t((IOFileUD *)uddata(IOSTDF_UD(L, (id))))\n\n/* -- Open/close helpers -------------------------------------------------- */\n\nstatic IOFileUD *io_tofilep(lua_State *L)\n{\n  if (!(L->base < L->top && tvisudata(L->base) &&\n\tudataV(L->base)->udtype == UDTYPE_IO_FILE))\n    lj_err_argtype(L, 1, \"FILE*\");\n  return (IOFileUD *)uddata(udataV(L->base));\n}\n\nstatic IOFileUD *io_tofile(lua_State *L)\n{\n  IOFileUD *iof = io_tofilep(L);\n  if (iof->fp == NULL)\n    lj_err_caller(L, LJ_ERR_IOCLFL);\n  return iof;\n}\n\nstatic FILE *io_stdfile(lua_State *L, ptrdiff_t id)\n{\n  IOFileUD *iof = IOSTDF_IOF(L, id);\n  if (iof->fp == NULL)\n    lj_err_caller(L, LJ_ERR_IOSTDCL);\n  return iof->fp;\n}\n\nstatic IOFileUD *io_file_new(lua_State *L)\n{\n  IOFileUD *iof = (IOFileUD *)lua_newuserdata(L, sizeof(IOFileUD));\n  GCudata *ud = udataV(L->top-1);\n  ud->udtype = UDTYPE_IO_FILE;\n  /* NOBARRIER: The GCudata is new (marked white). */\n  setgcrefr(ud->metatable, curr_func(L)->c.env);\n  iof->fp = NULL;\n  iof->type = IOFILE_TYPE_FILE;\n  return iof;\n}\n\nstatic IOFileUD *io_file_open(lua_State *L, const char *mode)\n{\n  const char *fname = strdata(lj_lib_checkstr(L, 1));\n  IOFileUD *iof = io_file_new(L);\n  iof->fp = fopen(fname, mode);\n  if (iof->fp == NULL)\n    luaL_argerror(L, 1, lj_str_pushf(L, \"%s: %s\", fname, strerror(errno)));\n  return iof;\n}\n\nstatic int io_file_close(lua_State *L, IOFileUD *iof)\n{\n  int ok;\n  if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_FILE) {\n    ok = (fclose(iof->fp) == 0);\n  } else if ((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_PIPE) {\n    int stat = -1;\n#if LJ_TARGET_POSIX\n    stat = pclose(iof->fp);\n#elif LJ_TARGET_WINDOWS\n    stat = _pclose(iof->fp);\n#else\n    lua_assert(0);\n    return 0;\n#endif\n#if LJ_52\n    iof->fp = NULL;\n    return luaL_execresult(L, stat);\n#else\n    ok = (stat != -1);\n#endif\n  } else {\n    lua_assert((iof->type & IOFILE_TYPE_MASK) == IOFILE_TYPE_STDF);\n    setnilV(L->top++);\n    lua_pushliteral(L, \"cannot close standard file\");\n    return 2;\n  }\n  iof->fp = NULL;\n  return luaL_fileresult(L, ok, NULL);\n}\n\n/* -- Read/write helpers -------------------------------------------------- */\n\nstatic int io_file_readnum(lua_State *L, FILE *fp)\n{\n  lua_Number d;\n  if (fscanf(fp, LUA_NUMBER_SCAN, &d) == 1) {\n    if (LJ_DUALNUM) {\n      int32_t i = lj_num2int(d);\n      if (d == (lua_Number)i && !tvismzero((cTValue *)&d)) {\n\tsetintV(L->top++, i);\n\treturn 1;\n      }\n    }\n    setnumV(L->top++, d);\n    return 1;\n  } else {\n    setnilV(L->top++);\n    return 0;\n  }\n}\n\nstatic int io_file_readline(lua_State *L, FILE *fp, MSize chop)\n{\n  MSize m = LUAL_BUFFERSIZE, n = 0, ok = 0;\n  char *buf;\n  for (;;) {\n    buf = lj_str_needbuf(L, &G(L)->tmpbuf, m);\n    if (fgets(buf+n, m-n, fp) == NULL) break;\n    n += (MSize)strlen(buf+n);\n    ok |= n;\n    if (n && buf[n-1] == '\\n') { n -= chop; break; }\n    if (n >= m - 64) m += m;\n  }\n  setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n));\n  lj_gc_check(L);\n  return (int)ok;\n}\n\nstatic void io_file_readall(lua_State *L, FILE *fp)\n{\n  MSize m, n;\n  for (m = LUAL_BUFFERSIZE, n = 0; ; m += m) {\n    char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m);\n    n += (MSize)fread(buf+n, 1, m-n, fp);\n    if (n != m) {\n      setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n));\n      lj_gc_check(L);\n      return;\n    }\n  }\n}\n\nstatic int io_file_readlen(lua_State *L, FILE *fp, MSize m)\n{\n  if (m) {\n    char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m);\n    MSize n = (MSize)fread(buf, 1, m, fp);\n    setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n));\n    lj_gc_check(L);\n    return (n > 0 || m == 0);\n  } else {\n    int c = getc(fp);\n    ungetc(c, fp);\n    setstrV(L, L->top++, &G(L)->strempty);\n    return (c != EOF);\n  }\n}\n\nstatic int io_file_read(lua_State *L, FILE *fp, int start)\n{\n  int ok, n, nargs = (int)(L->top - L->base) - start;\n  clearerr(fp);\n  if (nargs == 0) {\n    ok = io_file_readline(L, fp, 1);\n    n = start+1;  /* Return 1 result. */\n  } else {\n    /* The results plus the buffers go on top of the args. */\n    luaL_checkstack(L, nargs+LUA_MINSTACK, \"too many arguments\");\n    ok = 1;\n    for (n = start; nargs-- && ok; n++) {\n      if (tvisstr(L->base+n)) {\n\tconst char *p = strVdata(L->base+n);\n\tif (p[0] != '*')\n\t  lj_err_arg(L, n+1, LJ_ERR_INVOPT);\n\tif (p[1] == 'n')\n\t  ok = io_file_readnum(L, fp);\n\telse if ((p[1] & ~0x20) == 'L')\n\t  ok = io_file_readline(L, fp, (p[1] == 'l'));\n\telse if (p[1] == 'a')\n\t  io_file_readall(L, fp);\n\telse\n\t  lj_err_arg(L, n+1, LJ_ERR_INVFMT);\n      } else if (tvisnumber(L->base+n)) {\n\tok = io_file_readlen(L, fp, (MSize)lj_lib_checkint(L, n+1));\n      } else {\n\tlj_err_arg(L, n+1, LJ_ERR_INVOPT);\n      }\n    }\n  }\n  if (ferror(fp))\n    return luaL_fileresult(L, 0, NULL);\n  if (!ok)\n    setnilV(L->top-1);  /* Replace last result with nil. */\n  return n - start;\n}\n\nstatic int io_file_write(lua_State *L, FILE *fp, int start)\n{\n  cTValue *tv;\n  int status = 1;\n  for (tv = L->base+start; tv < L->top; tv++) {\n    if (tvisstr(tv)) {\n      MSize len = strV(tv)->len;\n      status = status && (fwrite(strVdata(tv), 1, len, fp) == len);\n    } else if (tvisint(tv)) {\n      char buf[LJ_STR_INTBUF];\n      char *p = lj_str_bufint(buf, intV(tv));\n      size_t len = (size_t)(buf+LJ_STR_INTBUF-p);\n      status = status && (fwrite(p, 1, len, fp) == len);\n    } else if (tvisnum(tv)) {\n      status = status && (fprintf(fp, LUA_NUMBER_FMT, numV(tv)) > 0);\n    } else {\n      lj_err_argt(L, (int)(tv - L->base) + 1, LUA_TSTRING);\n    }\n  }\n  if (LJ_52 && status) {\n    L->top = L->base+1;\n    if (start == 0)\n      setudataV(L, L->base, IOSTDF_UD(L, GCROOT_IO_OUTPUT));\n    return 1;\n  }\n  return luaL_fileresult(L, status, NULL);\n}\n\nstatic int io_file_iter(lua_State *L)\n{\n  GCfunc *fn = curr_func(L);\n  IOFileUD *iof = uddata(udataV(&fn->c.upvalue[0]));\n  int n = fn->c.nupvalues - 1;\n  if (iof->fp == NULL)\n    lj_err_caller(L, LJ_ERR_IOCLFL);\n  L->top = L->base;\n  if (n) {  /* Copy upvalues with options to stack. */\n    if (n > LUAI_MAXCSTACK)\n      lj_err_caller(L, LJ_ERR_STKOV);\n    lj_state_checkstack(L, (MSize)n);\n    memcpy(L->top, &fn->c.upvalue[1], n*sizeof(TValue));\n    L->top += n;\n  }\n  n = io_file_read(L, iof->fp, 0);\n  if (ferror(iof->fp))\n    lj_err_callermsg(L, strVdata(L->top-2));\n  if (tvisnil(L->base) && (iof->type & IOFILE_FLAG_CLOSE)) {\n    io_file_close(L, iof);  /* Return values are ignored. */\n    return 0;\n  }\n  return n;\n}\n\n/* -- I/O file methods ---------------------------------------------------- */\n\n#define LJLIB_MODULE_io_method\n\nLJLIB_CF(io_method_close)\n{\n  IOFileUD *iof = L->base < L->top ? io_tofile(L) :\n\t\t  IOSTDF_IOF(L, GCROOT_IO_OUTPUT);\n  return io_file_close(L, iof);\n}\n\nLJLIB_CF(io_method_read)\n{\n  return io_file_read(L, io_tofile(L)->fp, 1);\n}\n\nLJLIB_CF(io_method_write)\t\tLJLIB_REC(io_write 0)\n{\n  return io_file_write(L, io_tofile(L)->fp, 1);\n}\n\nLJLIB_CF(io_method_flush)\t\tLJLIB_REC(io_flush 0)\n{\n  return luaL_fileresult(L, fflush(io_tofile(L)->fp) == 0, NULL);\n}\n\nLJLIB_CF(io_method_seek)\n{\n  FILE *fp = io_tofile(L)->fp;\n  int opt = lj_lib_checkopt(L, 2, 1, \"\\3set\\3cur\\3end\");\n  int64_t ofs = 0;\n  cTValue *o;\n  int res;\n  if (opt == 0) opt = SEEK_SET;\n  else if (opt == 1) opt = SEEK_CUR;\n  else if (opt == 2) opt = SEEK_END;\n  o = L->base+2;\n  if (o < L->top) {\n    if (tvisint(o))\n      ofs = (int64_t)intV(o);\n    else if (tvisnum(o))\n      ofs = (int64_t)numV(o);\n    else if (!tvisnil(o))\n      lj_err_argt(L, 3, LUA_TNUMBER);\n  }\n#if LJ_TARGET_POSIX\n  res = fseeko(fp, ofs, opt);\n#elif _MSC_VER >= 1400\n  res = _fseeki64(fp, ofs, opt);\n#elif defined(__MINGW32__)\n  res = fseeko64(fp, ofs, opt);\n#else\n  res = fseek(fp, (long)ofs, opt);\n#endif\n  if (res)\n    return luaL_fileresult(L, 0, NULL);\n#if LJ_TARGET_POSIX\n  ofs = ftello(fp);\n#elif _MSC_VER >= 1400\n  ofs = _ftelli64(fp);\n#elif defined(__MINGW32__)\n  ofs = ftello64(fp);\n#else\n  ofs = (int64_t)ftell(fp);\n#endif\n  setint64V(L->top-1, ofs);\n  return 1;\n}\n\nLJLIB_CF(io_method_setvbuf)\n{\n  FILE *fp = io_tofile(L)->fp;\n  int opt = lj_lib_checkopt(L, 2, -1, \"\\4full\\4line\\2no\");\n  size_t sz = (size_t)lj_lib_optint(L, 3, LUAL_BUFFERSIZE);\n  if (opt == 0) opt = _IOFBF;\n  else if (opt == 1) opt = _IOLBF;\n  else if (opt == 2) opt = _IONBF;\n  return luaL_fileresult(L, setvbuf(fp, NULL, opt, sz) == 0, NULL);\n}\n\nLJLIB_CF(io_method_lines)\n{\n  io_tofile(L);\n  lua_pushcclosure(L, io_file_iter, (int)(L->top - L->base));\n  return 1;\n}\n\nLJLIB_CF(io_method___gc)\n{\n  IOFileUD *iof = io_tofilep(L);\n  if (iof->fp != NULL && (iof->type & IOFILE_TYPE_MASK) != IOFILE_TYPE_STDF)\n    io_file_close(L, iof);\n  return 0;\n}\n\nLJLIB_CF(io_method___tostring)\n{\n  IOFileUD *iof = io_tofilep(L);\n  if (iof->fp != NULL)\n    lua_pushfstring(L, \"file (%p)\", iof->fp);\n  else\n    lua_pushliteral(L, \"file (closed)\");\n  return 1;\n}\n\nLJLIB_PUSH(top-1) LJLIB_SET(__index)\n\n#include \"lj_libdef.h\"\n\n/* -- I/O library functions ----------------------------------------------- */\n\n#define LJLIB_MODULE_io\n\nLJLIB_PUSH(top-2) LJLIB_SET(!)  /* Set environment. */\n\nLJLIB_CF(io_open)\n{\n  const char *fname = strdata(lj_lib_checkstr(L, 1));\n  GCstr *s = lj_lib_optstr(L, 2);\n  const char *mode = s ? strdata(s) : \"r\";\n  IOFileUD *iof = io_file_new(L);\n  iof->fp = fopen(fname, mode);\n  return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, fname);\n}\n\nLJLIB_CF(io_popen)\n{\n#if LJ_TARGET_POSIX || LJ_TARGET_WINDOWS\n  const char *fname = strdata(lj_lib_checkstr(L, 1));\n  GCstr *s = lj_lib_optstr(L, 2);\n  const char *mode = s ? strdata(s) : \"r\";\n  IOFileUD *iof = io_file_new(L);\n  iof->type = IOFILE_TYPE_PIPE;\n#if LJ_TARGET_POSIX\n  fflush(NULL);\n  iof->fp = popen(fname, mode);\n#else\n  iof->fp = _popen(fname, mode);\n#endif\n  return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, fname);\n#else\n  return luaL_error(L, LUA_QL(\"popen\") \" not supported\");\n#endif\n}\n\nLJLIB_CF(io_tmpfile)\n{\n  IOFileUD *iof = io_file_new(L);\n#if LJ_TARGET_PS3\n  iof->fp = NULL; errno = ENOSYS;\n#else\n  iof->fp = tmpfile();\n#endif\n  return iof->fp != NULL ? 1 : luaL_fileresult(L, 0, NULL);\n}\n\nLJLIB_CF(io_close)\n{\n  return lj_cf_io_method_close(L);\n}\n\nLJLIB_CF(io_read)\n{\n  return io_file_read(L, io_stdfile(L, GCROOT_IO_INPUT), 0);\n}\n\nLJLIB_CF(io_write)\t\tLJLIB_REC(io_write GCROOT_IO_OUTPUT)\n{\n  return io_file_write(L, io_stdfile(L, GCROOT_IO_OUTPUT), 0);\n}\n\nLJLIB_CF(io_flush)\t\tLJLIB_REC(io_flush GCROOT_IO_OUTPUT)\n{\n  return luaL_fileresult(L, fflush(io_stdfile(L, GCROOT_IO_OUTPUT)) == 0, NULL);\n}\n\nstatic int io_std_getset(lua_State *L, ptrdiff_t id, const char *mode)\n{\n  if (L->base < L->top && !tvisnil(L->base)) {\n    if (tvisudata(L->base)) {\n      io_tofile(L);\n      L->top = L->base+1;\n    } else {\n      io_file_open(L, mode);\n    }\n    /* NOBARRIER: The standard I/O handles are GC roots. */\n    setgcref(G(L)->gcroot[id], gcV(L->top-1));\n  } else {\n    setudataV(L, L->top++, IOSTDF_UD(L, id));\n  }\n  return 1;\n}\n\nLJLIB_CF(io_input)\n{\n  return io_std_getset(L, GCROOT_IO_INPUT, \"r\");\n}\n\nLJLIB_CF(io_output)\n{\n  return io_std_getset(L, GCROOT_IO_OUTPUT, \"w\");\n}\n\nLJLIB_CF(io_lines)\n{\n  if (L->base == L->top) setnilV(L->top++);\n  if (!tvisnil(L->base)) {  /* io.lines(fname) */\n    IOFileUD *iof = io_file_open(L, \"r\");\n    iof->type = IOFILE_TYPE_FILE|IOFILE_FLAG_CLOSE;\n    L->top--;\n    setudataV(L, L->base, udataV(L->top));\n  } else {  /* io.lines() iterates over stdin. */\n    setudataV(L, L->base, IOSTDF_UD(L, GCROOT_IO_INPUT));\n  }\n  lua_pushcclosure(L, io_file_iter, (int)(L->top - L->base));\n  return 1;\n}\n\nLJLIB_CF(io_type)\n{\n  cTValue *o = lj_lib_checkany(L, 1);\n  if (!(tvisudata(o) && udataV(o)->udtype == UDTYPE_IO_FILE))\n    setnilV(L->top++);\n  else if (((IOFileUD *)uddata(udataV(o)))->fp != NULL)\n    lua_pushliteral(L, \"file\");\n  else\n    lua_pushliteral(L, \"closed file\");\n  return 1;\n}\n\n#include \"lj_libdef.h\"\n\n/* ------------------------------------------------------------------------ */\n\nstatic GCobj *io_std_new(lua_State *L, FILE *fp, const char *name)\n{\n  IOFileUD *iof = (IOFileUD *)lua_newuserdata(L, sizeof(IOFileUD));\n  GCudata *ud = udataV(L->top-1);\n  ud->udtype = UDTYPE_IO_FILE;\n  /* NOBARRIER: The GCudata is new (marked white). */\n  setgcref(ud->metatable, gcV(L->top-3));\n  iof->fp = fp;\n  iof->type = IOFILE_TYPE_STDF;\n  lua_setfield(L, -2, name);\n  return obj2gco(ud);\n}\n\nLUALIB_API int luaopen_io(lua_State *L)\n{\n  LJ_LIB_REG(L, NULL, io_method);\n  copyTV(L, L->top, L->top-1); L->top++;\n  lua_setfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE);\n  LJ_LIB_REG(L, LUA_IOLIBNAME, io);\n  setgcref(G(L)->gcroot[GCROOT_IO_INPUT], io_std_new(L, stdin, \"stdin\"));\n  setgcref(G(L)->gcroot[GCROOT_IO_OUTPUT], io_std_new(L, stdout, \"stdout\"));\n  io_std_new(L, stderr, \"stderr\");\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_jit.c",
    "content": "/*\n** JIT library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lib_jit_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_arch.h\"\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_bc.h\"\n#if LJ_HASJIT\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_ircall.h\"\n#include \"lj_iropt.h\"\n#include \"lj_target.h\"\n#endif\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"lj_vmevent.h\"\n#include \"lj_lib.h\"\n\n#include \"luajit.h\"\n\n/* -- jit.* functions ----------------------------------------------------- */\n\n#define LJLIB_MODULE_jit\n\nstatic int setjitmode(lua_State *L, int mode)\n{\n  int idx = 0;\n  if (L->base == L->top || tvisnil(L->base)) {  /* jit.on/off/flush([nil]) */\n    mode |= LUAJIT_MODE_ENGINE;\n  } else {\n    /* jit.on/off/flush(func|proto, nil|true|false) */\n    if (tvisfunc(L->base) || tvisproto(L->base))\n      idx = 1;\n    else if (!tvistrue(L->base))  /* jit.on/off/flush(true, nil|true|false) */\n      goto err;\n    if (L->base+1 < L->top && tvisbool(L->base+1))\n      mode |= boolV(L->base+1) ? LUAJIT_MODE_ALLFUNC : LUAJIT_MODE_ALLSUBFUNC;\n    else\n      mode |= LUAJIT_MODE_FUNC;\n  }\n  if (luaJIT_setmode(L, idx, mode) != 1) {\n    if ((mode & LUAJIT_MODE_MASK) == LUAJIT_MODE_ENGINE)\n      lj_err_caller(L, LJ_ERR_NOJIT);\n  err:\n    lj_err_argt(L, 1, LUA_TFUNCTION);\n  }\n  return 0;\n}\n\nLJLIB_CF(jit_on)\n{\n  return setjitmode(L, LUAJIT_MODE_ON);\n}\n\nLJLIB_CF(jit_off)\n{\n  return setjitmode(L, LUAJIT_MODE_OFF);\n}\n\nLJLIB_CF(jit_flush)\n{\n#if LJ_HASJIT\n  if (L->base < L->top && !tvisnil(L->base)) {\n    int traceno = lj_lib_checkint(L, 1);\n    luaJIT_setmode(L, traceno, LUAJIT_MODE_FLUSH|LUAJIT_MODE_TRACE);\n    return 0;\n  }\n#endif\n  return setjitmode(L, LUAJIT_MODE_FLUSH);\n}\n\n#if LJ_HASJIT\n/* Push a string for every flag bit that is set. */\nstatic void flagbits_to_strings(lua_State *L, uint32_t flags, uint32_t base,\n\t\t\t\tconst char *str)\n{\n  for (; *str; base <<= 1, str += 1+*str)\n    if (flags & base)\n      setstrV(L, L->top++, lj_str_new(L, str+1, *(uint8_t *)str));\n}\n#endif\n\nLJLIB_CF(jit_status)\n{\n#if LJ_HASJIT\n  jit_State *J = L2J(L);\n  L->top = L->base;\n  setboolV(L->top++, (J->flags & JIT_F_ON) ? 1 : 0);\n  flagbits_to_strings(L, J->flags, JIT_F_CPU_FIRST, JIT_F_CPUSTRING);\n  flagbits_to_strings(L, J->flags, JIT_F_OPT_FIRST, JIT_F_OPTSTRING);\n  return (int)(L->top - L->base);\n#else\n  setboolV(L->top++, 0);\n  return 1;\n#endif\n}\n\nLJLIB_CF(jit_attach)\n{\n#ifdef LUAJIT_DISABLE_VMEVENT\n  luaL_error(L, \"vmevent API disabled\");\n#else\n  GCfunc *fn = lj_lib_checkfunc(L, 1);\n  GCstr *s = lj_lib_optstr(L, 2);\n  luaL_findtable(L, LUA_REGISTRYINDEX, LJ_VMEVENTS_REGKEY, LJ_VMEVENTS_HSIZE);\n  if (s) {  /* Attach to given event. */\n    const uint8_t *p = (const uint8_t *)strdata(s);\n    uint32_t h = s->len;\n    while (*p) h = h ^ (lj_rol(h, 6) + *p++);\n    lua_pushvalue(L, 1);\n    lua_rawseti(L, -2, VMEVENT_HASHIDX(h));\n    G(L)->vmevmask = VMEVENT_NOCACHE;  /* Invalidate cache. */\n  } else {  /* Detach if no event given. */\n    setnilV(L->top++);\n    while (lua_next(L, -2)) {\n      L->top--;\n      if (tvisfunc(L->top) && funcV(L->top) == fn) {\n\tsetnilV(lj_tab_set(L, tabV(L->top-2), L->top-1));\n      }\n    }\n  }\n#endif\n  return 0;\n}\n\nLJLIB_PUSH(top-5) LJLIB_SET(os)\nLJLIB_PUSH(top-4) LJLIB_SET(arch)\nLJLIB_PUSH(top-3) LJLIB_SET(version_num)\nLJLIB_PUSH(top-2) LJLIB_SET(version)\n\n#include \"lj_libdef.h\"\n\n/* -- jit.util.* functions ------------------------------------------------ */\n\n#define LJLIB_MODULE_jit_util\n\n/* -- Reflection API for Lua functions ------------------------------------ */\n\n/* Return prototype of first argument (Lua function or prototype object) */\nstatic GCproto *check_Lproto(lua_State *L, int nolua)\n{\n  TValue *o = L->base;\n  if (L->top > o) {\n    if (tvisproto(o)) {\n      return protoV(o);\n    } else if (tvisfunc(o)) {\n      if (isluafunc(funcV(o)))\n\treturn funcproto(funcV(o));\n      else if (nolua)\n\treturn NULL;\n    }\n  }\n  lj_err_argt(L, 1, LUA_TFUNCTION);\n  return NULL;  /* unreachable */\n}\n\nstatic void setintfield(lua_State *L, GCtab *t, const char *name, int32_t val)\n{\n  setintV(lj_tab_setstr(L, t, lj_str_newz(L, name)), val);\n}\n\n/* local info = jit.util.funcinfo(func [,pc]) */\nLJLIB_CF(jit_util_funcinfo)\n{\n  GCproto *pt = check_Lproto(L, 1);\n  if (pt) {\n    BCPos pc = (BCPos)lj_lib_optint(L, 2, 0);\n    GCtab *t;\n    lua_createtable(L, 0, 16);  /* Increment hash size if fields are added. */\n    t = tabV(L->top-1);\n    setintfield(L, t, \"linedefined\", pt->firstline);\n    setintfield(L, t, \"lastlinedefined\", pt->firstline + pt->numline);\n    setintfield(L, t, \"stackslots\", pt->framesize);\n    setintfield(L, t, \"params\", pt->numparams);\n    setintfield(L, t, \"bytecodes\", (int32_t)pt->sizebc);\n    setintfield(L, t, \"gcconsts\", (int32_t)pt->sizekgc);\n    setintfield(L, t, \"nconsts\", (int32_t)pt->sizekn);\n    setintfield(L, t, \"upvalues\", (int32_t)pt->sizeuv);\n    if (pc < pt->sizebc)\n      setintfield(L, t, \"currentline\", lj_debug_line(pt, pc));\n    lua_pushboolean(L, (pt->flags & PROTO_VARARG));\n    lua_setfield(L, -2, \"isvararg\");\n    lua_pushboolean(L, (pt->flags & PROTO_CHILD));\n    lua_setfield(L, -2, \"children\");\n    setstrV(L, L->top++, proto_chunkname(pt));\n    lua_setfield(L, -2, \"source\");\n    lj_debug_pushloc(L, pt, pc);\n    lua_setfield(L, -2, \"loc\");\n  } else {\n    GCfunc *fn = funcV(L->base);\n    GCtab *t;\n    lua_createtable(L, 0, 4);  /* Increment hash size if fields are added. */\n    t = tabV(L->top-1);\n    if (!iscfunc(fn))\n      setintfield(L, t, \"ffid\", fn->c.ffid);\n    setintptrV(lj_tab_setstr(L, t, lj_str_newlit(L, \"addr\")),\n\t       (intptr_t)(void *)fn->c.f);\n    setintfield(L, t, \"upvalues\", fn->c.nupvalues);\n  }\n  return 1;\n}\n\n/* local ins, m = jit.util.funcbc(func, pc) */\nLJLIB_CF(jit_util_funcbc)\n{\n  GCproto *pt = check_Lproto(L, 0);\n  BCPos pc = (BCPos)lj_lib_checkint(L, 2);\n  if (pc < pt->sizebc) {\n    BCIns ins = proto_bc(pt)[pc];\n    BCOp op = bc_op(ins);\n    lua_assert(op < BC__MAX);\n    setintV(L->top, ins);\n    setintV(L->top+1, lj_bc_mode[op]);\n    L->top += 2;\n    return 2;\n  }\n  return 0;\n}\n\n/* local k = jit.util.funck(func, idx) */\nLJLIB_CF(jit_util_funck)\n{\n  GCproto *pt = check_Lproto(L, 0);\n  ptrdiff_t idx = (ptrdiff_t)lj_lib_checkint(L, 2);\n  if (idx >= 0) {\n    if (idx < (ptrdiff_t)pt->sizekn) {\n      copyTV(L, L->top-1, proto_knumtv(pt, idx));\n      return 1;\n    }\n  } else {\n    if (~idx < (ptrdiff_t)pt->sizekgc) {\n      GCobj *gc = proto_kgc(pt, idx);\n      setgcV(L, L->top-1, gc, ~gc->gch.gct);\n      return 1;\n    }\n  }\n  return 0;\n}\n\n/* local name = jit.util.funcuvname(func, idx) */\nLJLIB_CF(jit_util_funcuvname)\n{\n  GCproto *pt = check_Lproto(L, 0);\n  uint32_t idx = (uint32_t)lj_lib_checkint(L, 2);\n  if (idx < pt->sizeuv) {\n    setstrV(L, L->top-1, lj_str_newz(L, lj_debug_uvname(pt, idx)));\n    return 1;\n  }\n  return 0;\n}\n\n/* -- Reflection API for traces ------------------------------------------- */\n\n#if LJ_HASJIT\n\n/* Check trace argument. Must not throw for non-existent trace numbers. */\nstatic GCtrace *jit_checktrace(lua_State *L)\n{\n  TraceNo tr = (TraceNo)lj_lib_checkint(L, 1);\n  jit_State *J = L2J(L);\n  if (tr > 0 && tr < J->sizetrace)\n    return traceref(J, tr);\n  return NULL;\n}\n\n/* Names of link types. ORDER LJ_TRLINK */\nstatic const char *const jit_trlinkname[] = {\n  \"none\", \"root\", \"loop\", \"tail-recursion\", \"up-recursion\", \"down-recursion\",\n  \"interpreter\", \"return\"\n};\n\n/* local info = jit.util.traceinfo(tr) */\nLJLIB_CF(jit_util_traceinfo)\n{\n  GCtrace *T = jit_checktrace(L);\n  if (T) {\n    GCtab *t;\n    lua_createtable(L, 0, 8);  /* Increment hash size if fields are added. */\n    t = tabV(L->top-1);\n    setintfield(L, t, \"nins\", (int32_t)T->nins - REF_BIAS - 1);\n    setintfield(L, t, \"nk\", REF_BIAS - (int32_t)T->nk);\n    setintfield(L, t, \"link\", T->link);\n    setintfield(L, t, \"nexit\", T->nsnap);\n    setstrV(L, L->top++, lj_str_newz(L, jit_trlinkname[T->linktype]));\n    lua_setfield(L, -2, \"linktype\");\n    /* There are many more fields. Add them only when needed. */\n    return 1;\n  }\n  return 0;\n}\n\n/* local m, ot, op1, op2, prev = jit.util.traceir(tr, idx) */\nLJLIB_CF(jit_util_traceir)\n{\n  GCtrace *T = jit_checktrace(L);\n  IRRef ref = (IRRef)lj_lib_checkint(L, 2) + REF_BIAS;\n  if (T && ref >= REF_BIAS && ref < T->nins) {\n    IRIns *ir = &T->ir[ref];\n    int32_t m = lj_ir_mode[ir->o];\n    setintV(L->top-2, m);\n    setintV(L->top-1, ir->ot);\n    setintV(L->top++, (int32_t)ir->op1 - (irm_op1(m)==IRMref ? REF_BIAS : 0));\n    setintV(L->top++, (int32_t)ir->op2 - (irm_op2(m)==IRMref ? REF_BIAS : 0));\n    setintV(L->top++, ir->prev);\n    return 5;\n  }\n  return 0;\n}\n\n/* local k, t [, slot] = jit.util.tracek(tr, idx) */\nLJLIB_CF(jit_util_tracek)\n{\n  GCtrace *T = jit_checktrace(L);\n  IRRef ref = (IRRef)lj_lib_checkint(L, 2) + REF_BIAS;\n  if (T && ref >= T->nk && ref < REF_BIAS) {\n    IRIns *ir = &T->ir[ref];\n    int32_t slot = -1;\n    if (ir->o == IR_KSLOT) {\n      slot = ir->op2;\n      ir = &T->ir[ir->op1];\n    }\n    lj_ir_kvalue(L, L->top-2, ir);\n    setintV(L->top-1, (int32_t)irt_type(ir->t));\n    if (slot == -1)\n      return 2;\n    setintV(L->top++, slot);\n    return 3;\n  }\n  return 0;\n}\n\n/* local snap = jit.util.tracesnap(tr, sn) */\nLJLIB_CF(jit_util_tracesnap)\n{\n  GCtrace *T = jit_checktrace(L);\n  SnapNo sn = (SnapNo)lj_lib_checkint(L, 2);\n  if (T && sn < T->nsnap) {\n    SnapShot *snap = &T->snap[sn];\n    SnapEntry *map = &T->snapmap[snap->mapofs];\n    MSize n, nent = snap->nent;\n    GCtab *t;\n    lua_createtable(L, nent+2, 0);\n    t = tabV(L->top-1);\n    setintV(lj_tab_setint(L, t, 0), (int32_t)snap->ref - REF_BIAS);\n    setintV(lj_tab_setint(L, t, 1), (int32_t)snap->nslots);\n    for (n = 0; n < nent; n++)\n      setintV(lj_tab_setint(L, t, (int32_t)(n+2)), (int32_t)map[n]);\n    setintV(lj_tab_setint(L, t, (int32_t)(nent+2)), (int32_t)SNAP(255, 0, 0));\n    return 1;\n  }\n  return 0;\n}\n\n/* local mcode, addr, loop = jit.util.tracemc(tr) */\nLJLIB_CF(jit_util_tracemc)\n{\n  GCtrace *T = jit_checktrace(L);\n  if (T && T->mcode != NULL) {\n    setstrV(L, L->top-1, lj_str_new(L, (const char *)T->mcode, T->szmcode));\n    setintptrV(L->top++, (intptr_t)(void *)T->mcode);\n    setintV(L->top++, T->mcloop);\n    return 3;\n  }\n  return 0;\n}\n\n/* local addr = jit.util.traceexitstub([tr,] exitno) */\nLJLIB_CF(jit_util_traceexitstub)\n{\n#ifdef EXITSTUBS_PER_GROUP\n  ExitNo exitno = (ExitNo)lj_lib_checkint(L, 1);\n  jit_State *J = L2J(L);\n  if (exitno < EXITSTUBS_PER_GROUP*LJ_MAX_EXITSTUBGR) {\n    setintptrV(L->top-1, (intptr_t)(void *)exitstub_addr(J, exitno));\n    return 1;\n  }\n#else\n  if (L->top > L->base+1) {  /* Don't throw for one-argument variant. */\n    GCtrace *T = jit_checktrace(L);\n    ExitNo exitno = (ExitNo)lj_lib_checkint(L, 2);\n    ExitNo maxexit = T->root ? T->nsnap+1 : T->nsnap;\n    if (T && T->mcode != NULL && exitno < maxexit) {\n      setintptrV(L->top-1, (intptr_t)(void *)exitstub_trace_addr(T, exitno));\n      return 1;\n    }\n  }\n#endif\n  return 0;\n}\n\n/* local addr = jit.util.ircalladdr(idx) */\nLJLIB_CF(jit_util_ircalladdr)\n{\n  uint32_t idx = (uint32_t)lj_lib_checkint(L, 1);\n  if (idx < IRCALL__MAX) {\n    setintptrV(L->top-1, (intptr_t)(void *)lj_ir_callinfo[idx].func);\n    return 1;\n  }\n  return 0;\n}\n\n#endif\n\n#include \"lj_libdef.h\"\n\n/* -- jit.opt module ------------------------------------------------------ */\n\n#if LJ_HASJIT\n\n#define LJLIB_MODULE_jit_opt\n\n/* Parse optimization level. */\nstatic int jitopt_level(jit_State *J, const char *str)\n{\n  if (str[0] >= '0' && str[0] <= '9' && str[1] == '\\0') {\n    uint32_t flags;\n    if (str[0] == '0') flags = JIT_F_OPT_0;\n    else if (str[0] == '1') flags = JIT_F_OPT_1;\n    else if (str[0] == '2') flags = JIT_F_OPT_2;\n    else flags = JIT_F_OPT_3;\n    J->flags = (J->flags & ~JIT_F_OPT_MASK) | flags;\n    return 1;  /* Ok. */\n  }\n  return 0;  /* No match. */\n}\n\n/* Parse optimization flag. */\nstatic int jitopt_flag(jit_State *J, const char *str)\n{\n  const char *lst = JIT_F_OPTSTRING;\n  uint32_t opt;\n  int set = 1;\n  if (str[0] == '+') {\n    str++;\n  } else if (str[0] == '-') {\n    str++;\n    set = 0;\n  } else if (str[0] == 'n' && str[1] == 'o') {\n    str += str[2] == '-' ? 3 : 2;\n    set = 0;\n  }\n  for (opt = JIT_F_OPT_FIRST; ; opt <<= 1) {\n    size_t len = *(const uint8_t *)lst;\n    if (len == 0)\n      break;\n    if (strncmp(str, lst+1, len) == 0 && str[len] == '\\0') {\n      if (set) J->flags |= opt; else J->flags &= ~opt;\n      return 1;  /* Ok. */\n    }\n    lst += 1+len;\n  }\n  return 0;  /* No match. */\n}\n\n/* Parse optimization parameter. */\nstatic int jitopt_param(jit_State *J, const char *str)\n{\n  const char *lst = JIT_P_STRING;\n  int i;\n  for (i = 0; i < JIT_P__MAX; i++) {\n    size_t len = *(const uint8_t *)lst;\n    lua_assert(len != 0);\n    if (strncmp(str, lst+1, len) == 0 && str[len] == '=') {\n      int32_t n = 0;\n      const char *p = &str[len+1];\n      while (*p >= '0' && *p <= '9')\n\tn = n*10 + (*p++ - '0');\n      if (*p) return 0;  /* Malformed number. */\n      J->param[i] = n;\n      if (i == JIT_P_hotloop)\n\tlj_dispatch_init_hotcount(J2G(J));\n      return 1;  /* Ok. */\n    }\n    lst += 1+len;\n  }\n  return 0;  /* No match. */\n}\n\n/* jit.opt.start(flags...) */\nLJLIB_CF(jit_opt_start)\n{\n  jit_State *J = L2J(L);\n  int nargs = (int)(L->top - L->base);\n  if (nargs == 0) {\n    J->flags = (J->flags & ~JIT_F_OPT_MASK) | JIT_F_OPT_DEFAULT;\n  } else {\n    int i;\n    for (i = 1; i <= nargs; i++) {\n      const char *str = strdata(lj_lib_checkstr(L, i));\n      if (!jitopt_level(J, str) &&\n\t  !jitopt_flag(J, str) &&\n\t  !jitopt_param(J, str))\n\tlj_err_callerv(L, LJ_ERR_JITOPT, str);\n    }\n  }\n  return 0;\n}\n\n#include \"lj_libdef.h\"\n\n#endif\n\n/* -- JIT compiler initialization ----------------------------------------- */\n\n#if LJ_HASJIT\n/* Default values for JIT parameters. */\nstatic const int32_t jit_param_default[JIT_P__MAX+1] = {\n#define JIT_PARAMINIT(len, name, value)\t(value),\nJIT_PARAMDEF(JIT_PARAMINIT)\n#undef JIT_PARAMINIT\n  0\n};\n#endif\n\n#if LJ_TARGET_ARM && LJ_TARGET_LINUX\n#include <sys/utsname.h>\n#endif\n\n/* Arch-dependent CPU detection. */\nstatic uint32_t jit_cpudetect(lua_State *L)\n{\n  uint32_t flags = 0;\n#if LJ_TARGET_X86ORX64\n  uint32_t vendor[4];\n  uint32_t features[4];\n  if (lj_vm_cpuid(0, vendor) && lj_vm_cpuid(1, features)) {\n#if !LJ_HASJIT\n#define JIT_F_CMOV\t1\n#define JIT_F_SSE2\t2\n#endif\n    flags |= ((features[3] >> 15)&1) * JIT_F_CMOV;\n    flags |= ((features[3] >> 26)&1) * JIT_F_SSE2;\n#if LJ_HASJIT\n    flags |= ((features[2] >> 0)&1) * JIT_F_SSE3;\n    flags |= ((features[2] >> 19)&1) * JIT_F_SSE4_1;\n    if (vendor[2] == 0x6c65746e) {  /* Intel. */\n      if ((features[0] & 0x0ff00f00) == 0x00000f00)  /* P4. */\n\tflags |= JIT_F_P4;  /* Currently unused. */\n      else if ((features[0] & 0x0fff0ff0) == 0x000106c0)  /* Atom. */\n\tflags |= JIT_F_LEA_AGU;\n    } else if (vendor[2] == 0x444d4163) {  /* AMD. */\n      uint32_t fam = (features[0] & 0x0ff00f00);\n      if (fam == 0x00000f00)  /* K8. */\n\tflags |= JIT_F_SPLIT_XMM;\n      if (fam >= 0x00000f00)  /* K8, K10. */\n\tflags |= JIT_F_PREFER_IMUL;\n    }\n#endif\n  }\n  /* Check for required instruction set support on x86 (unnecessary on x64). */\n#if LJ_TARGET_X86\n#if !defined(LUAJIT_CPU_NOCMOV)\n  if (!(flags & JIT_F_CMOV))\n    luaL_error(L, \"CPU not supported\");\n#endif\n#if defined(LUAJIT_CPU_SSE2)\n  if (!(flags & JIT_F_SSE2))\n    luaL_error(L, \"CPU does not support SSE2 (recompile without -DLUAJIT_CPU_SSE2)\");\n#endif\n#endif\n#elif LJ_TARGET_ARM\n#if LJ_HASJIT\n  int ver = LJ_ARCH_VERSION;  /* Compile-time ARM CPU detection. */\n#if LJ_TARGET_LINUX\n  if (ver < 70) {  /* Runtime ARM CPU detection. */\n    struct utsname ut;\n    uname(&ut);\n    if (strncmp(ut.machine, \"armv\", 4) == 0) {\n      if (ut.machine[4] >= '7')\n\tver = 70;\n      else if (ut.machine[4] == '6')\n\tver = 60;\n    }\n  }\n#endif\n  flags |= ver >= 70 ? JIT_F_ARMV7 :\n\t   ver >= 61 ? JIT_F_ARMV6T2_ :\n\t   ver >= 60 ? JIT_F_ARMV6_ : 0;\n  flags |= LJ_ARCH_HASFPU == 0 ? 0 : ver >= 70 ? JIT_F_VFPV3 : JIT_F_VFPV2;\n#endif\n#elif LJ_TARGET_PPC\n#if LJ_HASJIT\n#if LJ_ARCH_SQRT\n  flags |= JIT_F_SQRT;\n#endif\n#if LJ_ARCH_ROUND\n  flags |= JIT_F_ROUND;\n#endif\n#endif\n#elif LJ_TARGET_PPCSPE\n  /* Nothing to do. */\n#elif LJ_TARGET_MIPS\n#if LJ_HASJIT\n  /* Compile-time MIPS CPU detection. */\n#if LJ_ARCH_VERSION >= 20\n  flags |= JIT_F_MIPS32R2;\n#endif\n  /* Runtime MIPS CPU detection. */\n#if defined(__GNUC__)\n  if (!(flags & JIT_F_MIPS32R2)) {\n    int x;\n    /* On MIPS32R1 rotr is treated as srl. rotr r2,r2,1 -> srl r2,r2,1. */\n    __asm__(\"li $2, 1\\n\\t.long 0x00221042\\n\\tmove %0, $2\" : \"=r\"(x) : : \"$2\");\n    if (x) flags |= JIT_F_MIPS32R2;  /* Either 0x80000000 (R2) or 0 (R1). */\n  }\n#endif\n#endif\n#else\n#error \"Missing CPU detection for this architecture\"\n#endif\n  UNUSED(L);\n  return flags;\n}\n\n/* Initialize JIT compiler. */\nstatic void jit_init(lua_State *L)\n{\n  uint32_t flags = jit_cpudetect(L);\n#if LJ_HASJIT\n  jit_State *J = L2J(L);\n#if LJ_TARGET_X86\n  /* Silently turn off the JIT compiler on CPUs without SSE2. */\n  if ((flags & JIT_F_SSE2))\n#endif\n    J->flags = flags | JIT_F_ON | JIT_F_OPT_DEFAULT;\n  memcpy(J->param, jit_param_default, sizeof(J->param));\n  lj_dispatch_update(G(L));\n#else\n  UNUSED(flags);\n#endif\n}\n\nLUALIB_API int luaopen_jit(lua_State *L)\n{\n  lua_pushliteral(L, LJ_OS_NAME);\n  lua_pushliteral(L, LJ_ARCH_NAME);\n  lua_pushinteger(L, LUAJIT_VERSION_NUM);\n  lua_pushliteral(L, LUAJIT_VERSION);\n  LJ_LIB_REG(L, LUA_JITLIBNAME, jit);\n#ifndef LUAJIT_DISABLE_JITUTIL\n  LJ_LIB_REG(L, \"jit.util\", jit_util);\n#endif\n#if LJ_HASJIT\n  LJ_LIB_REG(L, \"jit.opt\", jit_opt);\n#endif\n  L->top -= 2;\n  jit_init(L);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_math.c",
    "content": "/*\n** Math library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include <math.h>\n\n#define lib_math_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_lib.h\"\n#include \"lj_vm.h\"\n\n/* ------------------------------------------------------------------------ */\n\n#define LJLIB_MODULE_math\n\nLJLIB_ASM(math_abs)\t\tLJLIB_REC(.)\n{\n  lj_lib_checknumber(L, 1);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(math_floor)\t\tLJLIB_REC(math_round IRFPM_FLOOR)\nLJLIB_ASM_(math_ceil)\t\tLJLIB_REC(math_round IRFPM_CEIL)\n\nLJLIB_ASM(math_sqrt)\t\tLJLIB_REC(math_unary IRFPM_SQRT)\n{\n  lj_lib_checknum(L, 1);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(math_log10)\t\tLJLIB_REC(math_unary IRFPM_LOG10)\nLJLIB_ASM_(math_exp)\t\tLJLIB_REC(math_unary IRFPM_EXP)\nLJLIB_ASM_(math_sin)\t\tLJLIB_REC(math_unary IRFPM_SIN)\nLJLIB_ASM_(math_cos)\t\tLJLIB_REC(math_unary IRFPM_COS)\nLJLIB_ASM_(math_tan)\t\tLJLIB_REC(math_unary IRFPM_TAN)\nLJLIB_ASM_(math_asin)\t\tLJLIB_REC(math_atrig FF_math_asin)\nLJLIB_ASM_(math_acos)\t\tLJLIB_REC(math_atrig FF_math_acos)\nLJLIB_ASM_(math_atan)\t\tLJLIB_REC(math_atrig FF_math_atan)\nLJLIB_ASM_(math_sinh)\t\tLJLIB_REC(math_htrig IRCALL_sinh)\nLJLIB_ASM_(math_cosh)\t\tLJLIB_REC(math_htrig IRCALL_cosh)\nLJLIB_ASM_(math_tanh)\t\tLJLIB_REC(math_htrig IRCALL_tanh)\nLJLIB_ASM_(math_frexp)\nLJLIB_ASM_(math_modf)\t\tLJLIB_REC(.)\n\nLJLIB_ASM(math_log)\t\tLJLIB_REC(math_log)\n{\n  double x = lj_lib_checknum(L, 1);\n  if (L->base+1 < L->top) {\n    double y = lj_lib_checknum(L, 2);\n#ifdef LUAJIT_NO_LOG2\n    x = log(x); y = 1.0 / log(y);\n#else\n    x = lj_vm_log2(x); y = 1.0 / lj_vm_log2(y);\n#endif\n    setnumV(L->base-1, x*y);  /* Do NOT join the expression to x / y. */\n    return FFH_RES(1);\n  }\n  return FFH_RETRY;\n}\n\nLJLIB_PUSH(57.29577951308232)\nLJLIB_ASM_(math_deg)\t\tLJLIB_REC(math_degrad)\n\nLJLIB_PUSH(0.017453292519943295)\nLJLIB_ASM_(math_rad)\t\tLJLIB_REC(math_degrad)\n\nLJLIB_ASM(math_atan2)\t\tLJLIB_REC(.)\n{\n  lj_lib_checknum(L, 1);\n  lj_lib_checknum(L, 2);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(math_pow)\t\tLJLIB_REC(.)\nLJLIB_ASM_(math_fmod)\n\nLJLIB_ASM(math_ldexp)\t\tLJLIB_REC(.)\n{\n  lj_lib_checknum(L, 1);\n#if LJ_DUALNUM && !LJ_TARGET_X86ORX64\n  lj_lib_checkint(L, 2);\n#else\n  lj_lib_checknum(L, 2);\n#endif\n  return FFH_RETRY;\n}\n\nLJLIB_ASM(math_min)\t\tLJLIB_REC(math_minmax IR_MIN)\n{\n  int i = 0;\n  do { lj_lib_checknumber(L, ++i); } while (L->base+i < L->top);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(math_max)\t\tLJLIB_REC(math_minmax IR_MAX)\n\nLJLIB_PUSH(3.14159265358979323846) LJLIB_SET(pi)\nLJLIB_PUSH(1e310) LJLIB_SET(huge)\n\n/* ------------------------------------------------------------------------ */\n\n/* This implements a Tausworthe PRNG with period 2^223. Based on:\n**   Tables of maximally-equidistributed combined LFSR generators,\n**   Pierre L'Ecuyer, 1991, table 3, 1st entry.\n** Full-period ME-CF generator with L=64, J=4, k=223, N1=49.\n*/\n\n/* PRNG state. */\nstruct RandomState {\n  uint64_t gen[4];\t/* State of the 4 LFSR generators. */\n  int valid;\t\t/* State is valid. */\n};\n\n/* Union needed for bit-pattern conversion between uint64_t and double. */\ntypedef union { uint64_t u64; double d; } U64double;\n\n/* Update generator i and compute a running xor of all states. */\n#define TW223_GEN(i, k, q, s) \\\n  z = rs->gen[i]; \\\n  z = (((z<<q)^z) >> (k-s)) ^ ((z&((uint64_t)(int64_t)-1 << (64-k)))<<s); \\\n  r ^= z; rs->gen[i] = z;\n\n/* PRNG step function. Returns a double in the range 1.0 <= d < 2.0. */\nLJ_NOINLINE uint64_t LJ_FASTCALL lj_math_random_step(RandomState *rs)\n{\n  uint64_t z, r = 0;\n  TW223_GEN(0, 63, 31, 18)\n  TW223_GEN(1, 58, 19, 28)\n  TW223_GEN(2, 55, 24,  7)\n  TW223_GEN(3, 47, 21,  8)\n  return (r & U64x(000fffff,ffffffff)) | U64x(3ff00000,00000000);\n}\n\n/* PRNG initialization function. */\nstatic void random_init(RandomState *rs, double d)\n{\n  uint32_t r = 0x11090601;  /* 64-k[i] as four 8 bit constants. */\n  int i;\n  for (i = 0; i < 4; i++) {\n    U64double u;\n    uint32_t m = 1u << (r&255);\n    r >>= 8;\n    u.d = d = d * 3.14159265358979323846 + 2.7182818284590452354;\n    if (u.u64 < m) u.u64 += m;  /* Ensure k[i] MSB of gen[i] are non-zero. */\n    rs->gen[i] = u.u64;\n  }\n  rs->valid = 1;\n  for (i = 0; i < 10; i++)\n    lj_math_random_step(rs);\n}\n\n/* PRNG extract function. */\nLJLIB_PUSH(top-2)  /* Upvalue holds userdata with RandomState. */\nLJLIB_CF(math_random)\t\tLJLIB_REC(.)\n{\n  int n = (int)(L->top - L->base);\n  RandomState *rs = (RandomState *)(uddata(udataV(lj_lib_upvalue(L, 1))));\n  U64double u;\n  double d;\n  if (LJ_UNLIKELY(!rs->valid)) random_init(rs, 0.0);\n  u.u64 = lj_math_random_step(rs);\n  d = u.d - 1.0;\n  if (n > 0) {\n#if LJ_DUALNUM\n    int isint = 1;\n    double r1;\n    lj_lib_checknumber(L, 1);\n    if (tvisint(L->base)) {\n      r1 = (lua_Number)intV(L->base);\n    } else {\n      isint = 0;\n      r1 = numV(L->base);\n    }\n#else\n    double r1 = lj_lib_checknum(L, 1);\n#endif\n    if (n == 1) {\n      d = lj_vm_floor(d*r1) + 1.0;  /* d is an int in range [1, r1] */\n    } else {\n#if LJ_DUALNUM\n      double r2;\n      lj_lib_checknumber(L, 2);\n      if (tvisint(L->base+1)) {\n\tr2 = (lua_Number)intV(L->base+1);\n      } else {\n\tisint = 0;\n\tr2 = numV(L->base+1);\n      }\n#else\n      double r2 = lj_lib_checknum(L, 2);\n#endif\n      d = lj_vm_floor(d*(r2-r1+1.0)) + r1;  /* d is an int in range [r1, r2] */\n    }\n#if LJ_DUALNUM\n    if (isint) {\n      setintV(L->top-1, lj_num2int(d));\n      return 1;\n    }\n#endif\n  }  /* else: d is a double in range [0, 1] */\n  setnumV(L->top++, d);\n  return 1;\n}\n\n/* PRNG seed function. */\nLJLIB_PUSH(top-2)  /* Upvalue holds userdata with RandomState. */\nLJLIB_CF(math_randomseed)\n{\n  RandomState *rs = (RandomState *)(uddata(udataV(lj_lib_upvalue(L, 1))));\n  random_init(rs, lj_lib_checknum(L, 1));\n  return 0;\n}\n\n/* ------------------------------------------------------------------------ */\n\n#include \"lj_libdef.h\"\n\nLUALIB_API int luaopen_math(lua_State *L)\n{\n  RandomState *rs;\n  rs = (RandomState *)lua_newuserdata(L, sizeof(RandomState));\n  rs->valid = 0;  /* Use lazy initialization to save some time on startup. */\n  LJ_LIB_REG(L, LUA_MATHLIBNAME, math);\n#if defined(LUA_COMPAT_MOD) && !LJ_52\n  lua_getfield(L, -1, \"fmod\");\n  lua_setfield(L, -2, \"mod\");\n#endif\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_os.c",
    "content": "/*\n** OS library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#include <errno.h>\n#include <locale.h>\n#include <time.h>\n\n#define lib_os_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_lib.h\"\n\n#if LJ_TARGET_POSIX\n#include <unistd.h>\n#else\n#include <stdio.h>\n#endif\n\n/* ------------------------------------------------------------------------ */\n\n#define LJLIB_MODULE_os\n\nLJLIB_CF(os_execute)\n{\n#if LJ_TARGET_CONSOLE\n#if LJ_52\n  errno = ENOSYS;\n  return luaL_fileresult(L, 0, NULL);\n#else\n  lua_pushinteger(L, -1);\n  return 1;\n#endif\n#else\n  const char *cmd = luaL_optstring(L, 1, NULL);\n  int stat = system(cmd);\n#if LJ_52\n  if (cmd)\n    return luaL_execresult(L, stat);\n  setboolV(L->top++, 1);\n#else\n  setintV(L->top++, stat);\n#endif\n  return 1;\n#endif\n}\n\nLJLIB_CF(os_remove)\n{\n  const char *filename = luaL_checkstring(L, 1);\n  return luaL_fileresult(L, remove(filename) == 0, filename);\n}\n\nLJLIB_CF(os_rename)\n{\n  const char *fromname = luaL_checkstring(L, 1);\n  const char *toname = luaL_checkstring(L, 2);\n  return luaL_fileresult(L, rename(fromname, toname) == 0, fromname);\n}\n\nLJLIB_CF(os_tmpname)\n{\n#if LJ_TARGET_PS3\n  lj_err_caller(L, LJ_ERR_OSUNIQF);\n  return 0;\n#else\n#if LJ_TARGET_POSIX\n  char buf[15+1];\n  int fp;\n  strcpy(buf, \"/tmp/lua_XXXXXX\");\n  fp = mkstemp(buf);\n  if (fp != -1)\n    close(fp);\n  else\n    lj_err_caller(L, LJ_ERR_OSUNIQF);\n#else\n  char buf[L_tmpnam];\n  if (tmpnam(buf) == NULL)\n    lj_err_caller(L, LJ_ERR_OSUNIQF);\n#endif\n  lua_pushstring(L, buf);\n  return 1;\n#endif\n}\n\nLJLIB_CF(os_getenv)\n{\n#if LJ_TARGET_CONSOLE\n  lua_pushnil(L);\n#else\n  lua_pushstring(L, getenv(luaL_checkstring(L, 1)));  /* if NULL push nil */\n#endif\n  return 1;\n}\n\nLJLIB_CF(os_exit)\n{\n  int status;\n  if (L->base < L->top && tvisbool(L->base))\n    status = boolV(L->base) ? EXIT_SUCCESS : EXIT_FAILURE;\n  else\n    status = lj_lib_optint(L, 1, EXIT_SUCCESS);\n  if (L->base+1 < L->top && tvistruecond(L->base+1))\n    lua_close(L);\n  exit(status);\n  return 0;  /* Unreachable. */\n}\n\nLJLIB_CF(os_clock)\n{\n  setnumV(L->top++, ((lua_Number)clock())*(1.0/(lua_Number)CLOCKS_PER_SEC));\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\nstatic void setfield(lua_State *L, const char *key, int value)\n{\n  lua_pushinteger(L, value);\n  lua_setfield(L, -2, key);\n}\n\nstatic void setboolfield(lua_State *L, const char *key, int value)\n{\n  if (value < 0)  /* undefined? */\n    return;  /* does not set field */\n  lua_pushboolean(L, value);\n  lua_setfield(L, -2, key);\n}\n\nstatic int getboolfield(lua_State *L, const char *key)\n{\n  int res;\n  lua_getfield(L, -1, key);\n  res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1);\n  lua_pop(L, 1);\n  return res;\n}\n\nstatic int getfield(lua_State *L, const char *key, int d)\n{\n  int res;\n  lua_getfield(L, -1, key);\n  if (lua_isnumber(L, -1)) {\n    res = (int)lua_tointeger(L, -1);\n  } else {\n    if (d < 0)\n      lj_err_callerv(L, LJ_ERR_OSDATEF, key);\n    res = d;\n  }\n  lua_pop(L, 1);\n  return res;\n}\n\nLJLIB_CF(os_date)\n{\n  const char *s = luaL_optstring(L, 1, \"%c\");\n  time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL));\n  struct tm *stm;\n#if LJ_TARGET_POSIX\n  struct tm rtm;\n#endif\n  if (*s == '!') {  /* UTC? */\n    s++;  /* Skip '!' */\n#if LJ_TARGET_POSIX\n    stm = gmtime_r(&t, &rtm);\n#else\n    stm = gmtime(&t);\n#endif\n  } else {\n#if LJ_TARGET_POSIX\n    stm = localtime_r(&t, &rtm);\n#else\n    stm = localtime(&t);\n#endif\n  }\n  if (stm == NULL) {  /* Invalid date? */\n    setnilV(L->top-1);\n  } else if (strcmp(s, \"*t\") == 0) {\n    lua_createtable(L, 0, 9);  /* 9 = number of fields */\n    setfield(L, \"sec\", stm->tm_sec);\n    setfield(L, \"min\", stm->tm_min);\n    setfield(L, \"hour\", stm->tm_hour);\n    setfield(L, \"day\", stm->tm_mday);\n    setfield(L, \"month\", stm->tm_mon+1);\n    setfield(L, \"year\", stm->tm_year+1900);\n    setfield(L, \"wday\", stm->tm_wday+1);\n    setfield(L, \"yday\", stm->tm_yday+1);\n    setboolfield(L, \"isdst\", stm->tm_isdst);\n  } else {\n    char cc[3];\n    luaL_Buffer b;\n    cc[0] = '%'; cc[2] = '\\0';\n    luaL_buffinit(L, &b);\n    for (; *s; s++) {\n      if (*s != '%' || *(s + 1) == '\\0') {  /* No conversion specifier? */\n\tluaL_addchar(&b, *s);\n      } else {\n\tsize_t reslen;\n\tchar buff[200];  /* Should be big enough for any conversion result. */\n\tcc[1] = *(++s);\n\treslen = strftime(buff, sizeof(buff), cc, stm);\n\tluaL_addlstring(&b, buff, reslen);\n      }\n    }\n    luaL_pushresult(&b);\n  }\n  return 1;\n}\n\nLJLIB_CF(os_time)\n{\n  time_t t;\n  if (lua_isnoneornil(L, 1)) {  /* called without args? */\n    t = time(NULL);  /* get current time */\n  } else {\n    struct tm ts;\n    luaL_checktype(L, 1, LUA_TTABLE);\n    lua_settop(L, 1);  /* make sure table is at the top */\n    ts.tm_sec = getfield(L, \"sec\", 0);\n    ts.tm_min = getfield(L, \"min\", 0);\n    ts.tm_hour = getfield(L, \"hour\", 12);\n    ts.tm_mday = getfield(L, \"day\", -1);\n    ts.tm_mon = getfield(L, \"month\", -1) - 1;\n    ts.tm_year = getfield(L, \"year\", -1) - 1900;\n    ts.tm_isdst = getboolfield(L, \"isdst\");\n    t = mktime(&ts);\n  }\n  if (t == (time_t)(-1))\n    lua_pushnil(L);\n  else\n    lua_pushnumber(L, (lua_Number)t);\n  return 1;\n}\n\nLJLIB_CF(os_difftime)\n{\n  lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)),\n\t\t\t     (time_t)(luaL_optnumber(L, 2, (lua_Number)0))));\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\nLJLIB_CF(os_setlocale)\n{\n  GCstr *s = lj_lib_optstr(L, 1);\n  const char *str = s ? strdata(s) : NULL;\n  int opt = lj_lib_checkopt(L, 2, 6,\n    \"\\5ctype\\7numeric\\4time\\7collate\\10monetary\\1\\377\\3all\");\n  if (opt == 0) opt = LC_CTYPE;\n  else if (opt == 1) opt = LC_NUMERIC;\n  else if (opt == 2) opt = LC_TIME;\n  else if (opt == 3) opt = LC_COLLATE;\n  else if (opt == 4) opt = LC_MONETARY;\n  else if (opt == 6) opt = LC_ALL;\n  lua_pushstring(L, setlocale(opt, str));\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\n#include \"lj_libdef.h\"\n\nLUALIB_API int luaopen_os(lua_State *L)\n{\n  LJ_LIB_REG(L, LUA_OSLIBNAME, os);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_package.c",
    "content": "/*\n** Package library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2012 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lib_package_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_lib.h\"\n\n/* ------------------------------------------------------------------------ */\n\n/* Error codes for ll_loadfunc. */\n#define PACKAGE_ERR_LIB\t\t1\n#define PACKAGE_ERR_FUNC\t2\n#define PACKAGE_ERR_LOAD\t3\n\n/* Redefined in platform specific part. */\n#define PACKAGE_LIB_FAIL\t\"open\"\n#define setprogdir(L)\t\t((void)0)\n\n/* Symbol name prefixes. */\n#define SYMPREFIX_CF\t\t\"luaopen_%s\"\n#define SYMPREFIX_BC\t\t\"luaJIT_BC_%s\"\n\n#if LJ_TARGET_DLOPEN\n\n#include <dlfcn.h>\n\nstatic void ll_unloadlib(void *lib)\n{\n  dlclose(lib);\n}\n\nstatic void *ll_load(lua_State *L, const char *path, int gl)\n{\n  void *lib = dlopen(path, RTLD_NOW | (gl ? RTLD_GLOBAL : RTLD_LOCAL));\n  if (lib == NULL) lua_pushstring(L, dlerror());\n  return lib;\n}\n\nstatic lua_CFunction ll_sym(lua_State *L, void *lib, const char *sym)\n{\n  lua_CFunction f = (lua_CFunction)dlsym(lib, sym);\n  if (f == NULL) lua_pushstring(L, dlerror());\n  return f;\n}\n\nstatic const char *ll_bcsym(void *lib, const char *sym)\n{\n#if defined(RTLD_DEFAULT)\n  if (lib == NULL) lib = RTLD_DEFAULT;\n#elif LJ_TARGET_OSX || LJ_TARGET_BSD\n  if (lib == NULL) lib = (void *)(intptr_t)-2;\n#endif\n  return (const char *)dlsym(lib, sym);\n}\n\n#elif LJ_TARGET_WINDOWS\n\n#define WIN32_LEAN_AND_MEAN\n#ifndef WINVER\n#define WINVER 0x0500\n#endif\n#include <windows.h>\n\n#ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS\n#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS  4\n#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT  2\nBOOL WINAPI GetModuleHandleExA(DWORD, LPCSTR, HMODULE*);\n#endif\n\n#undef setprogdir\n\nstatic void setprogdir(lua_State *L)\n{\n  char buff[MAX_PATH + 1];\n  char *lb;\n  DWORD nsize = sizeof(buff);\n  DWORD n = GetModuleFileNameA(NULL, buff, nsize);\n  if (n == 0 || n == nsize || (lb = strrchr(buff, '\\\\')) == NULL) {\n    luaL_error(L, \"unable to get ModuleFileName\");\n  } else {\n    *lb = '\\0';\n    luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff);\n    lua_remove(L, -2);  /* remove original string */\n  }\n}\n\nstatic void pusherror(lua_State *L)\n{\n  DWORD error = GetLastError();\n  char buffer[128];\n  if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,\n      NULL, error, 0, buffer, sizeof(buffer), NULL))\n    lua_pushstring(L, buffer);\n  else\n    lua_pushfstring(L, \"system error %d\\n\", error);\n}\n\nstatic void ll_unloadlib(void *lib)\n{\n  FreeLibrary((HINSTANCE)lib);\n}\n\nstatic void *ll_load(lua_State *L, const char *path, int gl)\n{\n  HINSTANCE lib = LoadLibraryA(path);\n  if (lib == NULL) pusherror(L);\n  UNUSED(gl);\n  return lib;\n}\n\nstatic lua_CFunction ll_sym(lua_State *L, void *lib, const char *sym)\n{\n  lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym);\n  if (f == NULL) pusherror(L);\n  return f;\n}\n\nstatic const char *ll_bcsym(void *lib, const char *sym)\n{\n  if (lib) {\n    return (const char *)GetProcAddress((HINSTANCE)lib, sym);\n  } else {\n    HINSTANCE h = GetModuleHandleA(NULL);\n    const char *p = (const char *)GetProcAddress(h, sym);\n    if (p == NULL && GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,\n\t\t\t\t\t(const char *)ll_bcsym, &h))\n      p = (const char *)GetProcAddress(h, sym);\n    return p;\n  }\n}\n\n#else\n\n#undef PACKAGE_LIB_FAIL\n#define PACKAGE_LIB_FAIL\t\"absent\"\n\n#define DLMSG\t\"dynamic libraries not enabled; no support for target OS\"\n\nstatic void ll_unloadlib(void *lib)\n{\n  UNUSED(lib);\n}\n\nstatic void *ll_load(lua_State *L, const char *path, int gl)\n{\n  UNUSED(path); UNUSED(gl);\n  lua_pushliteral(L, DLMSG);\n  return NULL;\n}\n\nstatic lua_CFunction ll_sym(lua_State *L, void *lib, const char *sym)\n{\n  UNUSED(lib); UNUSED(sym);\n  lua_pushliteral(L, DLMSG);\n  return NULL;\n}\n\nstatic const char *ll_bcsym(void *lib, const char *sym)\n{\n  UNUSED(lib); UNUSED(sym);\n  return NULL;\n}\n\n#endif\n\n/* ------------------------------------------------------------------------ */\n\nstatic void **ll_register(lua_State *L, const char *path)\n{\n  void **plib;\n  lua_pushfstring(L, \"LOADLIB: %s\", path);\n  lua_gettable(L, LUA_REGISTRYINDEX);  /* check library in registry? */\n  if (!lua_isnil(L, -1)) {  /* is there an entry? */\n    plib = (void **)lua_touserdata(L, -1);\n  } else {  /* no entry yet; create one */\n    lua_pop(L, 1);\n    plib = (void **)lua_newuserdata(L, sizeof(void *));\n    *plib = NULL;\n    luaL_getmetatable(L, \"_LOADLIB\");\n    lua_setmetatable(L, -2);\n    lua_pushfstring(L, \"LOADLIB: %s\", path);\n    lua_pushvalue(L, -2);\n    lua_settable(L, LUA_REGISTRYINDEX);\n  }\n  return plib;\n}\n\nstatic const char *mksymname(lua_State *L, const char *modname,\n\t\t\t     const char *prefix)\n{\n  const char *funcname;\n  const char *mark = strchr(modname, *LUA_IGMARK);\n  if (mark) modname = mark + 1;\n  funcname = luaL_gsub(L, modname, \".\", \"_\");\n  funcname = lua_pushfstring(L, prefix, funcname);\n  lua_remove(L, -2);  /* remove 'gsub' result */\n  return funcname;\n}\n\nstatic int ll_loadfunc(lua_State *L, const char *path, const char *name, int r)\n{\n  void **reg = ll_register(L, path);\n  if (*reg == NULL) *reg = ll_load(L, path, (*name == '*'));\n  if (*reg == NULL) {\n    return PACKAGE_ERR_LIB;  /* Unable to load library. */\n  } else if (*name == '*') {  /* Only load library into global namespace. */\n    lua_pushboolean(L, 1);\n    return 0;\n  } else {\n    const char *sym = r ? name : mksymname(L, name, SYMPREFIX_CF);\n    lua_CFunction f = ll_sym(L, *reg, sym);\n    if (f) {\n      lua_pushcfunction(L, f);\n      return 0;\n    }\n    if (!r) {\n      const char *bcdata = ll_bcsym(*reg, mksymname(L, name, SYMPREFIX_BC));\n      lua_pop(L, 1);\n      if (bcdata) {\n\tif (luaL_loadbuffer(L, bcdata, ~(size_t)0, name) != 0)\n\t  return PACKAGE_ERR_LOAD;\n\treturn 0;\n      }\n    }\n    return PACKAGE_ERR_FUNC;  /* Unable to find function. */\n  }\n}\n\nstatic int lj_cf_package_loadlib(lua_State *L)\n{\n  const char *path = luaL_checkstring(L, 1);\n  const char *init = luaL_checkstring(L, 2);\n  int st = ll_loadfunc(L, path, init, 1);\n  if (st == 0) {  /* no errors? */\n    return 1;  /* return the loaded function */\n  } else {  /* error; error message is on stack top */\n    lua_pushnil(L);\n    lua_insert(L, -2);\n    lua_pushstring(L, (st == PACKAGE_ERR_LIB) ?  PACKAGE_LIB_FAIL : \"init\");\n    return 3;  /* return nil, error message, and where */\n  }\n}\n\nstatic int lj_cf_package_unloadlib(lua_State *L)\n{\n  void **lib = (void **)luaL_checkudata(L, 1, \"_LOADLIB\");\n  if (*lib) ll_unloadlib(*lib);\n  *lib = NULL;  /* mark library as closed */\n  return 0;\n}\n\n/* ------------------------------------------------------------------------ */\n\nstatic int readable(const char *filename)\n{\n  FILE *f = fopen(filename, \"r\");  /* try to open file */\n  if (f == NULL) return 0;  /* open failed */\n  fclose(f);\n  return 1;\n}\n\nstatic const char *pushnexttemplate(lua_State *L, const char *path)\n{\n  const char *l;\n  while (*path == *LUA_PATHSEP) path++;  /* skip separators */\n  if (*path == '\\0') return NULL;  /* no more templates */\n  l = strchr(path, *LUA_PATHSEP);  /* find next separator */\n  if (l == NULL) l = path + strlen(path);\n  lua_pushlstring(L, path, (size_t)(l - path));  /* template */\n  return l;\n}\n\nstatic const char *searchpath (lua_State *L, const char *name,\n\t\t\t       const char *path, const char *sep,\n\t\t\t       const char *dirsep)\n{\n  luaL_Buffer msg;  /* to build error message */\n  luaL_buffinit(L, &msg);\n  if (*sep != '\\0')  /* non-empty separator? */\n    name = luaL_gsub(L, name, sep, dirsep);  /* replace it by 'dirsep' */\n  while ((path = pushnexttemplate(L, path)) != NULL) {\n    const char *filename = luaL_gsub(L, lua_tostring(L, -1),\n\t\t\t\t     LUA_PATH_MARK, name);\n    lua_remove(L, -2);  /* remove path template */\n    if (readable(filename))  /* does file exist and is readable? */\n      return filename;  /* return that file name */\n    lua_pushfstring(L, \"\\n\\tno file \" LUA_QS, filename);\n    lua_remove(L, -2);  /* remove file name */\n    luaL_addvalue(&msg);  /* concatenate error msg. entry */\n  }\n  luaL_pushresult(&msg);  /* create error message */\n  return NULL;  /* not found */\n}\n\nstatic int lj_cf_package_searchpath(lua_State *L)\n{\n  const char *f = searchpath(L, luaL_checkstring(L, 1),\n\t\t\t\tluaL_checkstring(L, 2),\n\t\t\t\tluaL_optstring(L, 3, \".\"),\n\t\t\t\tluaL_optstring(L, 4, LUA_DIRSEP));\n  if (f != NULL) {\n    return 1;\n  } else {  /* error message is on top of the stack */\n    lua_pushnil(L);\n    lua_insert(L, -2);\n    return 2;  /* return nil + error message */\n  }\n}\n\nstatic const char *findfile(lua_State *L, const char *name,\n\t\t\t    const char *pname)\n{\n  const char *path;\n  lua_getfield(L, LUA_ENVIRONINDEX, pname);\n  path = lua_tostring(L, -1);\n  if (path == NULL)\n    luaL_error(L, LUA_QL(\"package.%s\") \" must be a string\", pname);\n  return searchpath(L, name, path, \".\", LUA_DIRSEP);\n}\n\nstatic void loaderror(lua_State *L, const char *filename)\n{\n  luaL_error(L, \"error loading module \" LUA_QS \" from file \" LUA_QS \":\\n\\t%s\",\n\t     lua_tostring(L, 1), filename, lua_tostring(L, -1));\n}\n\nstatic int lj_cf_package_loader_lua(lua_State *L)\n{\n  const char *filename;\n  const char *name = luaL_checkstring(L, 1);\n  filename = findfile(L, name, \"path\");\n  if (filename == NULL) return 1;  /* library not found in this path */\n  if (luaL_loadfile(L, filename) != 0)\n    loaderror(L, filename);\n  return 1;  /* library loaded successfully */\n}\n\nstatic int lj_cf_package_loader_c(lua_State *L)\n{\n  const char *name = luaL_checkstring(L, 1);\n  const char *filename = findfile(L, name, \"cpath\");\n  if (filename == NULL) return 1;  /* library not found in this path */\n  if (ll_loadfunc(L, filename, name, 0) != 0)\n    loaderror(L, filename);\n  return 1;  /* library loaded successfully */\n}\n\nstatic int lj_cf_package_loader_croot(lua_State *L)\n{\n  const char *filename;\n  const char *name = luaL_checkstring(L, 1);\n  const char *p = strchr(name, '.');\n  int st;\n  if (p == NULL) return 0;  /* is root */\n  lua_pushlstring(L, name, (size_t)(p - name));\n  filename = findfile(L, lua_tostring(L, -1), \"cpath\");\n  if (filename == NULL) return 1;  /* root not found */\n  if ((st = ll_loadfunc(L, filename, name, 0)) != 0) {\n    if (st != PACKAGE_ERR_FUNC) loaderror(L, filename);  /* real error */\n    lua_pushfstring(L, \"\\n\\tno module \" LUA_QS \" in file \" LUA_QS,\n\t\t    name, filename);\n    return 1;  /* function not found */\n  }\n  return 1;\n}\n\nstatic int lj_cf_package_loader_preload(lua_State *L)\n{\n  const char *name = luaL_checkstring(L, 1);\n  lua_getfield(L, LUA_ENVIRONINDEX, \"preload\");\n  if (!lua_istable(L, -1))\n    luaL_error(L, LUA_QL(\"package.preload\") \" must be a table\");\n  lua_getfield(L, -1, name);\n  if (lua_isnil(L, -1)) {  /* Not found? */\n    const char *bcname = mksymname(L, name, SYMPREFIX_BC);\n    const char *bcdata = ll_bcsym(NULL, bcname);\n    if (bcdata == NULL || luaL_loadbuffer(L, bcdata, ~(size_t)0, name) != 0)\n      lua_pushfstring(L, \"\\n\\tno field package.preload['%s']\", name);\n  }\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\nstatic const int sentinel_ = 0;\n#define sentinel\t((void *)&sentinel_)\n\nstatic int lj_cf_package_require(lua_State *L)\n{\n  const char *name = luaL_checkstring(L, 1);\n  int i;\n  lua_settop(L, 1);  /* _LOADED table will be at index 2 */\n  lua_getfield(L, LUA_REGISTRYINDEX, \"_LOADED\");\n  lua_getfield(L, 2, name);\n  if (lua_toboolean(L, -1)) {  /* is it there? */\n    if (lua_touserdata(L, -1) == sentinel)  /* check loops */\n      luaL_error(L, \"loop or previous error loading module \" LUA_QS, name);\n    return 1;  /* package is already loaded */\n  }\n  /* else must load it; iterate over available loaders */\n  lua_getfield(L, LUA_ENVIRONINDEX, \"loaders\");\n  if (!lua_istable(L, -1))\n    luaL_error(L, LUA_QL(\"package.loaders\") \" must be a table\");\n  lua_pushliteral(L, \"\");  /* error message accumulator */\n  for (i = 1; ; i++) {\n    lua_rawgeti(L, -2, i);  /* get a loader */\n    if (lua_isnil(L, -1))\n      luaL_error(L, \"module \" LUA_QS \" not found:%s\",\n\t\t name, lua_tostring(L, -2));\n    lua_pushstring(L, name);\n    lua_call(L, 1, 1);  /* call it */\n    if (lua_isfunction(L, -1))  /* did it find module? */\n      break;  /* module loaded successfully */\n    else if (lua_isstring(L, -1))  /* loader returned error message? */\n      lua_concat(L, 2);  /* accumulate it */\n    else\n      lua_pop(L, 1);\n  }\n  lua_pushlightuserdata(L, sentinel);\n  lua_setfield(L, 2, name);  /* _LOADED[name] = sentinel */\n  lua_pushstring(L, name);  /* pass name as argument to module */\n  lua_call(L, 1, 1);  /* run loaded module */\n  if (!lua_isnil(L, -1))  /* non-nil return? */\n    lua_setfield(L, 2, name);  /* _LOADED[name] = returned value */\n  lua_getfield(L, 2, name);\n  if (lua_touserdata(L, -1) == sentinel) {   /* module did not set a value? */\n    lua_pushboolean(L, 1);  /* use true as result */\n    lua_pushvalue(L, -1);  /* extra copy to be returned */\n    lua_setfield(L, 2, name);  /* _LOADED[name] = true */\n  }\n  lj_lib_checkfpu(L);\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\nstatic void setfenv(lua_State *L)\n{\n  lua_Debug ar;\n  if (lua_getstack(L, 1, &ar) == 0 ||\n      lua_getinfo(L, \"f\", &ar) == 0 ||  /* get calling function */\n      lua_iscfunction(L, -1))\n    luaL_error(L, LUA_QL(\"module\") \" not called from a Lua function\");\n  lua_pushvalue(L, -2);\n  lua_setfenv(L, -2);\n  lua_pop(L, 1);\n}\n\nstatic void dooptions(lua_State *L, int n)\n{\n  int i;\n  for (i = 2; i <= n; i++) {\n    lua_pushvalue(L, i);  /* get option (a function) */\n    lua_pushvalue(L, -2);  /* module */\n    lua_call(L, 1, 0);\n  }\n}\n\nstatic void modinit(lua_State *L, const char *modname)\n{\n  const char *dot;\n  lua_pushvalue(L, -1);\n  lua_setfield(L, -2, \"_M\");  /* module._M = module */\n  lua_pushstring(L, modname);\n  lua_setfield(L, -2, \"_NAME\");\n  dot = strrchr(modname, '.');  /* look for last dot in module name */\n  if (dot == NULL) dot = modname; else dot++;\n  /* set _PACKAGE as package name (full module name minus last part) */\n  lua_pushlstring(L, modname, (size_t)(dot - modname));\n  lua_setfield(L, -2, \"_PACKAGE\");\n}\n\nstatic int lj_cf_package_module(lua_State *L)\n{\n  const char *modname = luaL_checkstring(L, 1);\n  int loaded = lua_gettop(L) + 1;  /* index of _LOADED table */\n  lua_getfield(L, LUA_REGISTRYINDEX, \"_LOADED\");\n  lua_getfield(L, loaded, modname);  /* get _LOADED[modname] */\n  if (!lua_istable(L, -1)) {  /* not found? */\n    lua_pop(L, 1);  /* remove previous result */\n    /* try global variable (and create one if it does not exist) */\n    if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1) != NULL)\n      lj_err_callerv(L, LJ_ERR_BADMODN, modname);\n    lua_pushvalue(L, -1);\n    lua_setfield(L, loaded, modname);  /* _LOADED[modname] = new table */\n  }\n  /* check whether table already has a _NAME field */\n  lua_getfield(L, -1, \"_NAME\");\n  if (!lua_isnil(L, -1)) {  /* is table an initialized module? */\n    lua_pop(L, 1);\n  } else {  /* no; initialize it */\n    lua_pop(L, 1);\n    modinit(L, modname);\n  }\n  lua_pushvalue(L, -1);\n  setfenv(L);\n  dooptions(L, loaded - 1);\n  return 0;\n}\n\nstatic int lj_cf_package_seeall(lua_State *L)\n{\n  luaL_checktype(L, 1, LUA_TTABLE);\n  if (!lua_getmetatable(L, 1)) {\n    lua_createtable(L, 0, 1); /* create new metatable */\n    lua_pushvalue(L, -1);\n    lua_setmetatable(L, 1);\n  }\n  lua_pushvalue(L, LUA_GLOBALSINDEX);\n  lua_setfield(L, -2, \"__index\");  /* mt.__index = _G */\n  return 0;\n}\n\n/* ------------------------------------------------------------------------ */\n\n#define AUXMARK\t\t\"\\1\"\n\nstatic void setpath(lua_State *L, const char *fieldname, const char *envname,\n\t\t    const char *def, int noenv)\n{\n#if LJ_TARGET_CONSOLE\n  const char *path = NULL;\n  UNUSED(envname);\n#else\n  const char *path = getenv(envname);\n#endif\n  if (path == NULL || noenv) {\n    lua_pushstring(L, def);\n  } else {\n    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,\n\t\t\t      LUA_PATHSEP AUXMARK LUA_PATHSEP);\n    luaL_gsub(L, path, AUXMARK, def);\n    lua_remove(L, -2);\n  }\n  setprogdir(L);\n  lua_setfield(L, -2, fieldname);\n}\n\nstatic const luaL_Reg package_lib[] = {\n  { \"loadlib\",\tlj_cf_package_loadlib },\n  { \"searchpath\",  lj_cf_package_searchpath },\n  { \"seeall\",\tlj_cf_package_seeall },\n  { NULL, NULL }\n};\n\nstatic const luaL_Reg package_global[] = {\n  { \"module\",\tlj_cf_package_module },\n  { \"require\",\tlj_cf_package_require },\n  { NULL, NULL }\n};\n\nstatic const lua_CFunction package_loaders[] =\n{\n  lj_cf_package_loader_preload,\n  lj_cf_package_loader_lua,\n  lj_cf_package_loader_c,\n  lj_cf_package_loader_croot,\n  NULL\n};\n\nLUALIB_API int luaopen_package(lua_State *L)\n{\n  int i;\n  int noenv;\n  luaL_newmetatable(L, \"_LOADLIB\");\n  lj_lib_pushcf(L, lj_cf_package_unloadlib, 1);\n  lua_setfield(L, -2, \"__gc\");\n  luaL_register(L, LUA_LOADLIBNAME, package_lib);\n  lua_pushvalue(L, -1);\n  lua_replace(L, LUA_ENVIRONINDEX);\n  lua_createtable(L, sizeof(package_loaders)/sizeof(package_loaders[0])-1, 0);\n  for (i = 0; package_loaders[i] != NULL; i++) {\n    lj_lib_pushcf(L, package_loaders[i], 1);\n    lua_rawseti(L, -2, i+1);\n  }\n  lua_setfield(L, -2, \"loaders\");\n  lua_getfield(L, LUA_REGISTRYINDEX, \"LUA_NOENV\");\n  noenv = lua_toboolean(L, -1);\n  lua_pop(L, 1);\n  setpath(L, \"path\", LUA_PATH, LUA_PATH_DEFAULT, noenv);\n  setpath(L, \"cpath\", LUA_CPATH, LUA_CPATH_DEFAULT, noenv);\n  lua_pushliteral(L, LUA_PATH_CONFIG);\n  lua_setfield(L, -2, \"config\");\n  luaL_findtable(L, LUA_REGISTRYINDEX, \"_LOADED\", 16);\n  lua_setfield(L, -2, \"loaded\");\n  luaL_findtable(L, LUA_REGISTRYINDEX, \"_PRELOAD\", 4);\n  lua_setfield(L, -2, \"preload\");\n  lua_pushvalue(L, LUA_GLOBALSINDEX);\n  luaL_register(L, NULL, package_global);\n  lua_pop(L, 1);\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_string.c",
    "content": "/*\n** String library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#include <stdio.h>\n\n#define lib_string_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_meta.h\"\n#include \"lj_state.h\"\n#include \"lj_ff.h\"\n#include \"lj_bcdump.h\"\n#include \"lj_char.h\"\n#include \"lj_lib.h\"\n\n/* ------------------------------------------------------------------------ */\n\n#define LJLIB_MODULE_string\n\nLJLIB_ASM(string_len)\t\tLJLIB_REC(.)\n{\n  lj_lib_checkstr(L, 1);\n  return FFH_RETRY;\n}\n\nLJLIB_ASM(string_byte)\t\tLJLIB_REC(string_range 0)\n{\n  GCstr *s = lj_lib_checkstr(L, 1);\n  int32_t len = (int32_t)s->len;\n  int32_t start = lj_lib_optint(L, 2, 1);\n  int32_t stop = lj_lib_optint(L, 3, start);\n  int32_t n, i;\n  const unsigned char *p;\n  if (stop < 0) stop += len+1;\n  if (start < 0) start += len+1;\n  if (start <= 0) start = 1;\n  if (stop > len) stop = len;\n  if (start > stop) return FFH_RES(0);  /* Empty interval: return no results. */\n  start--;\n  n = stop - start;\n  if ((uint32_t)n > LUAI_MAXCSTACK)\n    lj_err_caller(L, LJ_ERR_STRSLC);\n  lj_state_checkstack(L, (MSize)n);\n  p = (const unsigned char *)strdata(s) + start;\n  for (i = 0; i < n; i++)\n    setintV(L->base + i-1, p[i]);\n  return FFH_RES(n);\n}\n\nLJLIB_ASM(string_char)\n{\n  int i, nargs = (int)(L->top - L->base);\n  char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, (size_t)nargs);\n  for (i = 1; i <= nargs; i++) {\n    int32_t k = lj_lib_checkint(L, i);\n    if (!checku8(k))\n      lj_err_arg(L, i, LJ_ERR_BADVAL);\n    buf[i-1] = (char)k;\n  }\n  setstrV(L, L->base-1, lj_str_new(L, buf, (size_t)nargs));\n  return FFH_RES(1);\n}\n\nLJLIB_ASM(string_sub)\t\tLJLIB_REC(string_range 1)\n{\n  lj_lib_checkstr(L, 1);\n  lj_lib_checkint(L, 2);\n  setintV(L->base+2, lj_lib_optint(L, 3, -1));\n  return FFH_RETRY;\n}\n\nLJLIB_ASM(string_rep)\n{\n  GCstr *s = lj_lib_checkstr(L, 1);\n  int32_t k = lj_lib_checkint(L, 2);\n  GCstr *sep = lj_lib_optstr(L, 3);\n  int32_t len = (int32_t)s->len;\n  global_State *g = G(L);\n  int64_t tlen;\n  const char *src;\n  char *buf;\n  if (k <= 0) {\n  empty:\n    setstrV(L, L->base-1, &g->strempty);\n    return FFH_RES(1);\n  }\n  if (sep) {\n    tlen = (int64_t)len + sep->len;\n    if (tlen > LJ_MAX_STR)\n      lj_err_caller(L, LJ_ERR_STROV);\n    tlen *= k;\n    if (tlen > LJ_MAX_STR)\n      lj_err_caller(L, LJ_ERR_STROV);\n  } else {\n    tlen = (int64_t)k * len;\n    if (tlen > LJ_MAX_STR)\n      lj_err_caller(L, LJ_ERR_STROV);\n  }\n  if (tlen == 0) goto empty;\n  buf = lj_str_needbuf(L, &g->tmpbuf, (MSize)tlen);\n  src = strdata(s);\n  if (sep) {\n    tlen -= sep->len;  /* Ignore trailing separator. */\n    if (k > 1) {  /* Paste one string and one separator. */\n      int32_t i;\n      i = 0; while (i < len) *buf++ = src[i++];\n      src = strdata(sep); len = sep->len;\n      i = 0; while (i < len) *buf++ = src[i++];\n      src = g->tmpbuf.buf; len += s->len; k--;  /* Now copy that k-1 times. */\n    }\n  }\n  do {\n    int32_t i = 0;\n    do { *buf++ = src[i++]; } while (i < len);\n  } while (--k > 0);\n  setstrV(L, L->base-1, lj_str_new(L, g->tmpbuf.buf, (size_t)tlen));\n  return FFH_RES(1);\n}\n\nLJLIB_ASM(string_reverse)\n{\n  GCstr *s = lj_lib_checkstr(L, 1);\n  lj_str_needbuf(L, &G(L)->tmpbuf, s->len);\n  return FFH_RETRY;\n}\nLJLIB_ASM_(string_lower)\nLJLIB_ASM_(string_upper)\n\n/* ------------------------------------------------------------------------ */\n\nstatic int writer_buf(lua_State *L, const void *p, size_t size, void *b)\n{\n  luaL_addlstring((luaL_Buffer *)b, (const char *)p, size);\n  UNUSED(L);\n  return 0;\n}\n\nLJLIB_CF(string_dump)\n{\n  GCfunc *fn = lj_lib_checkfunc(L, 1);\n  int strip = L->base+1 < L->top && tvistruecond(L->base+1);\n  luaL_Buffer b;\n  L->top = L->base+1;\n  luaL_buffinit(L, &b);\n  if (!isluafunc(fn) || lj_bcwrite(L, funcproto(fn), writer_buf, &b, strip))\n    lj_err_caller(L, LJ_ERR_STRDUMP);\n  luaL_pushresult(&b);\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\n/* macro to `unsign' a character */\n#define uchar(c)        ((unsigned char)(c))\n\n#define CAP_UNFINISHED\t(-1)\n#define CAP_POSITION\t(-2)\n\ntypedef struct MatchState {\n  const char *src_init;  /* init of source string */\n  const char *src_end;  /* end (`\\0') of source string */\n  lua_State *L;\n  int level;  /* total number of captures (finished or unfinished) */\n  int depth;\n  struct {\n    const char *init;\n    ptrdiff_t len;\n  } capture[LUA_MAXCAPTURES];\n} MatchState;\n\n#define L_ESC\t\t'%'\n#define SPECIALS\t\"^$*+?.([%-\"\n\nstatic int check_capture(MatchState *ms, int l)\n{\n  l -= '1';\n  if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED)\n    lj_err_caller(ms->L, LJ_ERR_STRCAPI);\n  return l;\n}\n\nstatic int capture_to_close(MatchState *ms)\n{\n  int level = ms->level;\n  for (level--; level>=0; level--)\n    if (ms->capture[level].len == CAP_UNFINISHED) return level;\n  lj_err_caller(ms->L, LJ_ERR_STRPATC);\n  return 0;  /* unreachable */\n}\n\nstatic const char *classend(MatchState *ms, const char *p)\n{\n  switch (*p++) {\n  case L_ESC:\n    if (*p == '\\0')\n      lj_err_caller(ms->L, LJ_ERR_STRPATE);\n    return p+1;\n  case '[':\n    if (*p == '^') p++;\n    do {  /* look for a `]' */\n      if (*p == '\\0')\n\tlj_err_caller(ms->L, LJ_ERR_STRPATM);\n      if (*(p++) == L_ESC && *p != '\\0')\n\tp++;  /* skip escapes (e.g. `%]') */\n    } while (*p != ']');\n    return p+1;\n  default:\n    return p;\n  }\n}\n\nstatic const unsigned char match_class_map[32] = {\n  0,LJ_CHAR_ALPHA,0,LJ_CHAR_CNTRL,LJ_CHAR_DIGIT,0,0,LJ_CHAR_GRAPH,0,0,0,0,\n  LJ_CHAR_LOWER,0,0,0,LJ_CHAR_PUNCT,0,0,LJ_CHAR_SPACE,0,\n  LJ_CHAR_UPPER,0,LJ_CHAR_ALNUM,LJ_CHAR_XDIGIT,0,0,0,0,0,0,0\n};\n\nstatic int match_class(int c, int cl)\n{\n  if ((cl & 0xc0) == 0x40) {\n    int t = match_class_map[(cl&0x1f)];\n    if (t) {\n      t = lj_char_isa(c, t);\n      return (cl & 0x20) ? t : !t;\n    }\n    if (cl == 'z') return c == 0;\n    if (cl == 'Z') return c != 0;\n  }\n  return (cl == c);\n}\n\nstatic int matchbracketclass(int c, const char *p, const char *ec)\n{\n  int sig = 1;\n  if (*(p+1) == '^') {\n    sig = 0;\n    p++;  /* skip the `^' */\n  }\n  while (++p < ec) {\n    if (*p == L_ESC) {\n      p++;\n      if (match_class(c, uchar(*p)))\n\treturn sig;\n    }\n    else if ((*(p+1) == '-') && (p+2 < ec)) {\n      p+=2;\n      if (uchar(*(p-2)) <= c && c <= uchar(*p))\n\treturn sig;\n    }\n    else if (uchar(*p) == c) return sig;\n  }\n  return !sig;\n}\n\nstatic int singlematch(int c, const char *p, const char *ep)\n{\n  switch (*p) {\n  case '.': return 1;  /* matches any char */\n  case L_ESC: return match_class(c, uchar(*(p+1)));\n  case '[': return matchbracketclass(c, p, ep-1);\n  default:  return (uchar(*p) == c);\n  }\n}\n\nstatic const char *match(MatchState *ms, const char *s, const char *p);\n\nstatic const char *matchbalance(MatchState *ms, const char *s, const char *p)\n{\n  if (*p == 0 || *(p+1) == 0)\n    lj_err_caller(ms->L, LJ_ERR_STRPATU);\n  if (*s != *p) {\n    return NULL;\n  } else {\n    int b = *p;\n    int e = *(p+1);\n    int cont = 1;\n    while (++s < ms->src_end) {\n      if (*s == e) {\n\tif (--cont == 0) return s+1;\n      } else if (*s == b) {\n\tcont++;\n      }\n    }\n  }\n  return NULL;  /* string ends out of balance */\n}\n\nstatic const char *max_expand(MatchState *ms, const char *s,\n\t\t\t      const char *p, const char *ep)\n{\n  ptrdiff_t i = 0;  /* counts maximum expand for item */\n  while ((s+i)<ms->src_end && singlematch(uchar(*(s+i)), p, ep))\n    i++;\n  /* keeps trying to match with the maximum repetitions */\n  while (i>=0) {\n    const char *res = match(ms, (s+i), ep+1);\n    if (res) return res;\n    i--;  /* else didn't match; reduce 1 repetition to try again */\n  }\n  return NULL;\n}\n\nstatic const char *min_expand(MatchState *ms, const char *s,\n\t\t\t      const char *p, const char *ep)\n{\n  for (;;) {\n    const char *res = match(ms, s, ep+1);\n    if (res != NULL)\n      return res;\n    else if (s<ms->src_end && singlematch(uchar(*s), p, ep))\n      s++;  /* try with one more repetition */\n    else\n      return NULL;\n  }\n}\n\nstatic const char *start_capture(MatchState *ms, const char *s,\n\t\t\t\t const char *p, int what)\n{\n  const char *res;\n  int level = ms->level;\n  if (level >= LUA_MAXCAPTURES) lj_err_caller(ms->L, LJ_ERR_STRCAPN);\n  ms->capture[level].init = s;\n  ms->capture[level].len = what;\n  ms->level = level+1;\n  if ((res=match(ms, s, p)) == NULL)  /* match failed? */\n    ms->level--;  /* undo capture */\n  return res;\n}\n\nstatic const char *end_capture(MatchState *ms, const char *s,\n\t\t\t       const char *p)\n{\n  int l = capture_to_close(ms);\n  const char *res;\n  ms->capture[l].len = s - ms->capture[l].init;  /* close capture */\n  if ((res = match(ms, s, p)) == NULL)  /* match failed? */\n    ms->capture[l].len = CAP_UNFINISHED;  /* undo capture */\n  return res;\n}\n\nstatic const char *match_capture(MatchState *ms, const char *s, int l)\n{\n  size_t len;\n  l = check_capture(ms, l);\n  len = (size_t)ms->capture[l].len;\n  if ((size_t)(ms->src_end-s) >= len &&\n      memcmp(ms->capture[l].init, s, len) == 0)\n    return s+len;\n  else\n    return NULL;\n}\n\nstatic const char *match(MatchState *ms, const char *s, const char *p)\n{\n  if (++ms->depth > LJ_MAX_XLEVEL)\n    lj_err_caller(ms->L, LJ_ERR_STRPATX);\n  init: /* using goto's to optimize tail recursion */\n  switch (*p) {\n  case '(':  /* start capture */\n    if (*(p+1) == ')')  /* position capture? */\n      s = start_capture(ms, s, p+2, CAP_POSITION);\n    else\n      s = start_capture(ms, s, p+1, CAP_UNFINISHED);\n    break;\n  case ')':  /* end capture */\n    s = end_capture(ms, s, p+1);\n    break;\n  case L_ESC:\n    switch (*(p+1)) {\n    case 'b':  /* balanced string? */\n      s = matchbalance(ms, s, p+2);\n      if (s == NULL) break;\n      p+=4;\n      goto init;  /* else s = match(ms, s, p+4); */\n    case 'f': {  /* frontier? */\n      const char *ep; char previous;\n      p += 2;\n      if (*p != '[')\n\tlj_err_caller(ms->L, LJ_ERR_STRPATB);\n      ep = classend(ms, p);  /* points to what is next */\n      previous = (s == ms->src_init) ? '\\0' : *(s-1);\n      if (matchbracketclass(uchar(previous), p, ep-1) ||\n\t !matchbracketclass(uchar(*s), p, ep-1)) { s = NULL; break; }\n      p=ep;\n      goto init;  /* else s = match(ms, s, ep); */\n      }\n    default:\n      if (lj_char_isdigit(uchar(*(p+1)))) {  /* capture results (%0-%9)? */\n\ts = match_capture(ms, s, uchar(*(p+1)));\n\tif (s == NULL) break;\n\tp+=2;\n\tgoto init;  /* else s = match(ms, s, p+2) */\n      }\n      goto dflt;  /* case default */\n    }\n    break;\n  case '\\0':  /* end of pattern */\n    break;  /* match succeeded */\n  case '$':\n    /* is the `$' the last char in pattern? */\n    if (*(p+1) != '\\0') goto dflt;\n    if (s != ms->src_end) s = NULL;  /* check end of string */\n    break;\n  default: dflt: {  /* it is a pattern item */\n    const char *ep = classend(ms, p);  /* points to what is next */\n    int m = s<ms->src_end && singlematch(uchar(*s), p, ep);\n    switch (*ep) {\n    case '?': {  /* optional */\n      const char *res;\n      if (m && ((res=match(ms, s+1, ep+1)) != NULL)) {\n\ts = res;\n\tbreak;\n      }\n      p=ep+1;\n      goto init;  /* else s = match(ms, s, ep+1); */\n      }\n    case '*':  /* 0 or more repetitions */\n      s = max_expand(ms, s, p, ep);\n      break;\n    case '+':  /* 1 or more repetitions */\n      s = (m ? max_expand(ms, s+1, p, ep) : NULL);\n      break;\n    case '-':  /* 0 or more repetitions (minimum) */\n      s = min_expand(ms, s, p, ep);\n      break;\n    default:\n      if (m) { s++; p=ep; goto init; }  /* else s = match(ms, s+1, ep); */\n      s = NULL;\n      break;\n    }\n    break;\n    }\n  }\n  ms->depth--;\n  return s;\n}\n\nstatic const char *lmemfind(const char *s1, size_t l1,\n\t\t\t    const char *s2, size_t l2)\n{\n  if (l2 == 0) {\n    return s1;  /* empty strings are everywhere */\n  } else if (l2 > l1) {\n    return NULL;  /* avoids a negative `l1' */\n  } else {\n    const char *init;  /* to search for a `*s2' inside `s1' */\n    l2--;  /* 1st char will be checked by `memchr' */\n    l1 = l1-l2;  /* `s2' cannot be found after that */\n    while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) {\n      init++;   /* 1st char is already checked */\n      if (memcmp(init, s2+1, l2) == 0) {\n\treturn init-1;\n      } else {  /* correct `l1' and `s1' to try again */\n\tl1 -= (size_t)(init-s1);\n\ts1 = init;\n      }\n    }\n    return NULL;  /* not found */\n  }\n}\n\nstatic void push_onecapture(MatchState *ms, int i, const char *s, const char *e)\n{\n  if (i >= ms->level) {\n    if (i == 0)  /* ms->level == 0, too */\n      lua_pushlstring(ms->L, s, (size_t)(e - s));  /* add whole match */\n    else\n      lj_err_caller(ms->L, LJ_ERR_STRCAPI);\n  } else {\n    ptrdiff_t l = ms->capture[i].len;\n    if (l == CAP_UNFINISHED) lj_err_caller(ms->L, LJ_ERR_STRCAPU);\n    if (l == CAP_POSITION)\n      lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1);\n    else\n      lua_pushlstring(ms->L, ms->capture[i].init, (size_t)l);\n  }\n}\n\nstatic int push_captures(MatchState *ms, const char *s, const char *e)\n{\n  int i;\n  int nlevels = (ms->level == 0 && s) ? 1 : ms->level;\n  luaL_checkstack(ms->L, nlevels, \"too many captures\");\n  for (i = 0; i < nlevels; i++)\n    push_onecapture(ms, i, s, e);\n  return nlevels;  /* number of strings pushed */\n}\n\nstatic ptrdiff_t posrelat(ptrdiff_t pos, size_t len)\n{\n  /* relative string position: negative means back from end */\n  if (pos < 0) pos += (ptrdiff_t)len + 1;\n  return (pos >= 0) ? pos : 0;\n}\n\nstatic int str_find_aux(lua_State *L, int find)\n{\n  size_t l1, l2;\n  const char *s = luaL_checklstring(L, 1, &l1);\n  const char *p = luaL_checklstring(L, 2, &l2);\n  ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1;\n  if (init < 0) {\n    init = 0;\n  } else if ((size_t)(init) > l1) {\n#if LJ_52\n    setnilV(L->top-1);\n    return 1;\n#else\n    init = (ptrdiff_t)l1;\n#endif\n  }\n  if (find && (lua_toboolean(L, 4) ||  /* explicit request? */\n      strpbrk(p, SPECIALS) == NULL)) {  /* or no special characters? */\n    /* do a plain search */\n    const char *s2 = lmemfind(s+init, l1-(size_t)init, p, l2);\n    if (s2) {\n      lua_pushinteger(L, s2-s+1);\n      lua_pushinteger(L, s2-s+(ptrdiff_t)l2);\n      return 2;\n    }\n  } else {\n    MatchState ms;\n    int anchor = (*p == '^') ? (p++, 1) : 0;\n    const char *s1=s+init;\n    ms.L = L;\n    ms.src_init = s;\n    ms.src_end = s+l1;\n    do {\n      const char *res;\n      ms.level = ms.depth = 0;\n      if ((res=match(&ms, s1, p)) != NULL) {\n\tif (find) {\n\t  lua_pushinteger(L, s1-s+1);  /* start */\n\t  lua_pushinteger(L, res-s);   /* end */\n\t  return push_captures(&ms, NULL, 0) + 2;\n\t} else {\n\t  return push_captures(&ms, s1, res);\n\t}\n      }\n    } while (s1++ < ms.src_end && !anchor);\n  }\n  lua_pushnil(L);  /* not found */\n  return 1;\n}\n\nLJLIB_CF(string_find)\n{\n  return str_find_aux(L, 1);\n}\n\nLJLIB_CF(string_match)\n{\n  return str_find_aux(L, 0);\n}\n\nLJLIB_NOREG LJLIB_CF(string_gmatch_aux)\n{\n  const char *p = strVdata(lj_lib_upvalue(L, 2));\n  GCstr *str = strV(lj_lib_upvalue(L, 1));\n  const char *s = strdata(str);\n  TValue *tvpos = lj_lib_upvalue(L, 3);\n  const char *src = s + tvpos->u32.lo;\n  MatchState ms;\n  ms.L = L;\n  ms.src_init = s;\n  ms.src_end = s + str->len;\n  for (; src <= ms.src_end; src++) {\n    const char *e;\n    ms.level = ms.depth = 0;\n    if ((e = match(&ms, src, p)) != NULL) {\n      int32_t pos = (int32_t)(e - s);\n      if (e == src) pos++;  /* Ensure progress for empty match. */\n      tvpos->u32.lo = (uint32_t)pos;\n      return push_captures(&ms, src, e);\n    }\n  }\n  return 0;  /* not found */\n}\n\nLJLIB_CF(string_gmatch)\n{\n  lj_lib_checkstr(L, 1);\n  lj_lib_checkstr(L, 2);\n  L->top = L->base+3;\n  (L->top-1)->u64 = 0;\n  lj_lib_pushcc(L, lj_cf_string_gmatch_aux, FF_string_gmatch_aux, 3);\n  return 1;\n}\n\nstatic void add_s(MatchState *ms, luaL_Buffer *b, const char *s, const char *e)\n{\n  size_t l, i;\n  const char *news = lua_tolstring(ms->L, 3, &l);\n  for (i = 0; i < l; i++) {\n    if (news[i] != L_ESC) {\n      luaL_addchar(b, news[i]);\n    } else {\n      i++;  /* skip ESC */\n      if (!lj_char_isdigit(uchar(news[i]))) {\n\tluaL_addchar(b, news[i]);\n      } else if (news[i] == '0') {\n\tluaL_addlstring(b, s, (size_t)(e - s));\n      } else {\n\tpush_onecapture(ms, news[i] - '1', s, e);\n\tluaL_addvalue(b);  /* add capture to accumulated result */\n      }\n    }\n  }\n}\n\nstatic void add_value(MatchState *ms, luaL_Buffer *b,\n\t\t      const char *s, const char *e)\n{\n  lua_State *L = ms->L;\n  switch (lua_type(L, 3)) {\n    case LUA_TNUMBER:\n    case LUA_TSTRING: {\n      add_s(ms, b, s, e);\n      return;\n    }\n    case LUA_TFUNCTION: {\n      int n;\n      lua_pushvalue(L, 3);\n      n = push_captures(ms, s, e);\n      lua_call(L, n, 1);\n      break;\n    }\n    case LUA_TTABLE: {\n      push_onecapture(ms, 0, s, e);\n      lua_gettable(L, 3);\n      break;\n    }\n  }\n  if (!lua_toboolean(L, -1)) {  /* nil or false? */\n    lua_pop(L, 1);\n    lua_pushlstring(L, s, (size_t)(e - s));  /* keep original text */\n  } else if (!lua_isstring(L, -1)) {\n    lj_err_callerv(L, LJ_ERR_STRGSRV, luaL_typename(L, -1));\n  }\n  luaL_addvalue(b);  /* add result to accumulator */\n}\n\nLJLIB_CF(string_gsub)\n{\n  size_t srcl;\n  const char *src = luaL_checklstring(L, 1, &srcl);\n  const char *p = luaL_checkstring(L, 2);\n  int  tr = lua_type(L, 3);\n  int max_s = luaL_optint(L, 4, (int)(srcl+1));\n  int anchor = (*p == '^') ? (p++, 1) : 0;\n  int n = 0;\n  MatchState ms;\n  luaL_Buffer b;\n  if (!(tr == LUA_TNUMBER || tr == LUA_TSTRING ||\n\ttr == LUA_TFUNCTION || tr == LUA_TTABLE))\n    lj_err_arg(L, 3, LJ_ERR_NOSFT);\n  luaL_buffinit(L, &b);\n  ms.L = L;\n  ms.src_init = src;\n  ms.src_end = src+srcl;\n  while (n < max_s) {\n    const char *e;\n    ms.level = ms.depth = 0;\n    e = match(&ms, src, p);\n    if (e) {\n      n++;\n      add_value(&ms, &b, src, e);\n    }\n    if (e && e>src) /* non empty match? */\n      src = e;  /* skip it */\n    else if (src < ms.src_end)\n      luaL_addchar(&b, *src++);\n    else\n      break;\n    if (anchor)\n      break;\n  }\n  luaL_addlstring(&b, src, (size_t)(ms.src_end-src));\n  luaL_pushresult(&b);\n  lua_pushinteger(L, n);  /* number of substitutions */\n  return 2;\n}\n\n/* ------------------------------------------------------------------------ */\n\n/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */\n#define MAX_FMTITEM\t512\n/* valid flags in a format specification */\n#define FMT_FLAGS\t\"-+ #0\"\n/*\n** maximum size of each format specification (such as '%-099.99d')\n** (+10 accounts for %99.99x plus margin of error)\n*/\n#define MAX_FMTSPEC\t(sizeof(FMT_FLAGS) + sizeof(LUA_INTFRMLEN) + 10)\n\nstatic void addquoted(lua_State *L, luaL_Buffer *b, int arg)\n{\n  GCstr *str = lj_lib_checkstr(L, arg);\n  int32_t len = (int32_t)str->len;\n  const char *s = strdata(str);\n  luaL_addchar(b, '\"');\n  while (len--) {\n    uint32_t c = uchar(*s);\n    if (c == '\"' || c == '\\\\' || c == '\\n') {\n      luaL_addchar(b, '\\\\');\n    } else if (lj_char_iscntrl(c)) {  /* This can only be 0-31 or 127. */\n      uint32_t d;\n      luaL_addchar(b, '\\\\');\n      if (c >= 100 || lj_char_isdigit(uchar(s[1]))) {\n\tluaL_addchar(b, '0'+(c >= 100)); if (c >= 100) c -= 100;\n\tgoto tens;\n      } else if (c >= 10) {\n      tens:\n\td = (c * 205) >> 11; c -= d * 10; luaL_addchar(b, '0'+d);\n      }\n      c += '0';\n    }\n    luaL_addchar(b, c);\n    s++;\n  }\n  luaL_addchar(b, '\"');\n}\n\nstatic const char *scanformat(lua_State *L, const char *strfrmt, char *form)\n{\n  const char *p = strfrmt;\n  while (*p != '\\0' && strchr(FMT_FLAGS, *p) != NULL) p++;  /* skip flags */\n  if ((size_t)(p - strfrmt) >= sizeof(FMT_FLAGS))\n    lj_err_caller(L, LJ_ERR_STRFMTR);\n  if (lj_char_isdigit(uchar(*p))) p++;  /* skip width */\n  if (lj_char_isdigit(uchar(*p))) p++;  /* (2 digits at most) */\n  if (*p == '.') {\n    p++;\n    if (lj_char_isdigit(uchar(*p))) p++;  /* skip precision */\n    if (lj_char_isdigit(uchar(*p))) p++;  /* (2 digits at most) */\n  }\n  if (lj_char_isdigit(uchar(*p)))\n    lj_err_caller(L, LJ_ERR_STRFMTW);\n  *(form++) = '%';\n  strncpy(form, strfrmt, (size_t)(p - strfrmt + 1));\n  form += p - strfrmt + 1;\n  *form = '\\0';\n  return p;\n}\n\nstatic void addintlen(char *form)\n{\n  size_t l = strlen(form);\n  char spec = form[l - 1];\n  strcpy(form + l - 1, LUA_INTFRMLEN);\n  form[l + sizeof(LUA_INTFRMLEN) - 2] = spec;\n  form[l + sizeof(LUA_INTFRMLEN) - 1] = '\\0';\n}\n\nstatic unsigned LUA_INTFRM_T num2intfrm(lua_State *L, int arg)\n{\n  if (sizeof(LUA_INTFRM_T) == 4) {\n    return (LUA_INTFRM_T)lj_lib_checkbit(L, arg);\n  } else {\n    cTValue *o;\n    lj_lib_checknumber(L, arg);\n    o = L->base+arg-1;\n    if (tvisint(o))\n      return (LUA_INTFRM_T)intV(o);\n    else\n      return (LUA_INTFRM_T)numV(o);\n  }\n}\n\nstatic unsigned LUA_INTFRM_T num2uintfrm(lua_State *L, int arg)\n{\n  if (sizeof(LUA_INTFRM_T) == 4) {\n    return (unsigned LUA_INTFRM_T)lj_lib_checkbit(L, arg);\n  } else {\n    cTValue *o;\n    lj_lib_checknumber(L, arg);\n    o = L->base+arg-1;\n    if (tvisint(o))\n      return (unsigned LUA_INTFRM_T)intV(o);\n    else if ((int32_t)o->u32.hi < 0)\n      return (unsigned LUA_INTFRM_T)(LUA_INTFRM_T)numV(o);\n    else\n      return (unsigned LUA_INTFRM_T)numV(o);\n  }\n}\n\nstatic GCstr *meta_tostring(lua_State *L, int arg)\n{\n  TValue *o = L->base+arg-1;\n  cTValue *mo;\n  lua_assert(o < L->top);  /* Caller already checks for existence. */\n  if (LJ_LIKELY(tvisstr(o)))\n    return strV(o);\n  if (!tvisnil(mo = lj_meta_lookup(L, o, MM_tostring))) {\n    copyTV(L, L->top++, mo);\n    copyTV(L, L->top++, o);\n    lua_call(L, 1, 1);\n    L->top--;\n    if (tvisstr(L->top))\n      return strV(L->top);\n    o = L->base+arg-1;\n    copyTV(L, o, L->top);\n  }\n  if (tvisnumber(o)) {\n    return lj_str_fromnumber(L, o);\n  } else if (tvisnil(o)) {\n    return lj_str_newlit(L, \"nil\");\n  } else if (tvisfalse(o)) {\n    return lj_str_newlit(L, \"false\");\n  } else if (tvistrue(o)) {\n    return lj_str_newlit(L, \"true\");\n  } else {\n    if (tvisfunc(o) && isffunc(funcV(o)))\n      lj_str_pushf(L, \"function: builtin#%d\", funcV(o)->c.ffid);\n    else\n      lj_str_pushf(L, \"%s: %p\", lj_typename(o), lua_topointer(L, arg));\n    L->top--;\n    return strV(L->top);\n  }\n}\n\nLJLIB_CF(string_format)\n{\n  int arg = 1, top = (int)(L->top - L->base);\n  GCstr *fmt = lj_lib_checkstr(L, arg);\n  const char *strfrmt = strdata(fmt);\n  const char *strfrmt_end = strfrmt + fmt->len;\n  luaL_Buffer b;\n  luaL_buffinit(L, &b);\n  while (strfrmt < strfrmt_end) {\n    if (*strfrmt != L_ESC) {\n      luaL_addchar(&b, *strfrmt++);\n    } else if (*++strfrmt == L_ESC) {\n      luaL_addchar(&b, *strfrmt++);  /* %% */\n    } else { /* format item */\n      char form[MAX_FMTSPEC];  /* to store the format (`%...') */\n      char buff[MAX_FMTITEM];  /* to store the formatted item */\n      if (++arg > top)\n\tluaL_argerror(L, arg, lj_obj_typename[0]);\n      strfrmt = scanformat(L, strfrmt, form);\n      switch (*strfrmt++) {\n      case 'c':\n\tsprintf(buff, form, lj_lib_checkint(L, arg));\n\tbreak;\n      case 'd':  case 'i':\n\taddintlen(form);\n\tsprintf(buff, form, num2intfrm(L, arg));\n\tbreak;\n      case 'o':  case 'u':  case 'x':  case 'X':\n\taddintlen(form);\n\tsprintf(buff, form, num2uintfrm(L, arg));\n\tbreak;\n      case 'e':  case 'E': case 'f': case 'g': case 'G': case 'a': case 'A': {\n\tTValue tv;\n\ttv.n = lj_lib_checknum(L, arg);\n\tif (LJ_UNLIKELY((tv.u32.hi << 1) >= 0xffe00000)) {\n\t  /* Canonicalize output of non-finite values. */\n\t  char *p, nbuf[LJ_STR_NUMBUF];\n\t  size_t len = lj_str_bufnum(nbuf, &tv);\n\t  if (strfrmt[-1] < 'a') {\n\t    nbuf[len-3] = nbuf[len-3] - 0x20;\n\t    nbuf[len-2] = nbuf[len-2] - 0x20;\n\t    nbuf[len-1] = nbuf[len-1] - 0x20;\n\t  }\n\t  nbuf[len] = '\\0';\n\t  for (p = form; *p < 'A' && *p != '.'; p++) ;\n\t  *p++ = 's'; *p = '\\0';\n\t  sprintf(buff, form, nbuf);\n\t  break;\n\t}\n\tsprintf(buff, form, (double)tv.n);\n\tbreak;\n\t}\n      case 'q':\n\taddquoted(L, &b, arg);\n\tcontinue;\n      case 'p':\n\tlj_str_pushf(L, \"%p\", lua_topointer(L, arg));\n\tluaL_addvalue(&b);\n\tcontinue;\n      case 's': {\n\tGCstr *str = meta_tostring(L, arg);\n\tif (!strchr(form, '.') && str->len >= 100) {\n\t  /* no precision and string is too long to be formatted;\n\t     keep original string */\n\t  setstrV(L, L->top++, str);\n\t  luaL_addvalue(&b);\n\t  continue;\n\t}\n\tsprintf(buff, form, strdata(str));\n\tbreak;\n\t}\n      default:\n\tlj_err_callerv(L, LJ_ERR_STRFMTO, *(strfrmt -1));\n\tbreak;\n      }\n      luaL_addlstring(&b, buff, strlen(buff));\n    }\n  }\n  luaL_pushresult(&b);\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\n#include \"lj_libdef.h\"\n\nLUALIB_API int luaopen_string(lua_State *L)\n{\n  GCtab *mt;\n  global_State *g;\n  LJ_LIB_REG(L, LUA_STRLIBNAME, string);\n#if defined(LUA_COMPAT_GFIND) && !LJ_52\n  lua_getfield(L, -1, \"gmatch\");\n  lua_setfield(L, -2, \"gfind\");\n#endif\n  mt = lj_tab_new(L, 0, 1);\n  /* NOBARRIER: basemt is a GC root. */\n  g = G(L);\n  setgcref(basemt_it(g, LJ_TSTR), obj2gco(mt));\n  settabV(L, lj_tab_setstr(L, mt, mmname_str(g, MM_index)), tabV(L->top-1));\n  mt->nomm = (uint8_t)(~(1u<<MM_index));\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lib_table.c",
    "content": "/*\n** Table library.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lib_table_c\n#define LUA_LIB\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_tab.h\"\n#include \"lj_lib.h\"\n\n/* ------------------------------------------------------------------------ */\n\n#define LJLIB_MODULE_table\n\nLJLIB_CF(table_foreachi)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  GCfunc *func = lj_lib_checkfunc(L, 2);\n  MSize i, n = lj_tab_len(t);\n  for (i = 1; i <= n; i++) {\n    cTValue *val;\n    setfuncV(L, L->top, func);\n    setintV(L->top+1, i);\n    val = lj_tab_getint(t, (int32_t)i);\n    if (val) { copyTV(L, L->top+2, val); } else { setnilV(L->top+2); }\n    L->top += 3;\n    lua_call(L, 2, 1);\n    if (!tvisnil(L->top-1))\n      return 1;\n    L->top--;\n  }\n  return 0;\n}\n\nLJLIB_CF(table_foreach)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  GCfunc *func = lj_lib_checkfunc(L, 2);\n  L->top = L->base+3;\n  setnilV(L->top-1);\n  while (lj_tab_next(L, t, L->top-1)) {\n    copyTV(L, L->top+2, L->top);\n    copyTV(L, L->top+1, L->top-1);\n    setfuncV(L, L->top, func);\n    L->top += 3;\n    lua_call(L, 2, 1);\n    if (!tvisnil(L->top-1))\n      return 1;\n    L->top--;\n  }\n  return 0;\n}\n\nLJLIB_ASM(table_getn)\t\tLJLIB_REC(.)\n{\n  lj_lib_checktab(L, 1);\n  return FFH_UNREACHABLE;\n}\n\nLJLIB_CF(table_maxn)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  TValue *array = tvref(t->array);\n  Node *node;\n  lua_Number m = 0;\n  ptrdiff_t i;\n  for (i = (ptrdiff_t)t->asize - 1; i >= 0; i--)\n    if (!tvisnil(&array[i])) {\n      m = (lua_Number)(int32_t)i;\n      break;\n    }\n  node = noderef(t->node);\n  for (i = (ptrdiff_t)t->hmask; i >= 0; i--)\n    if (!tvisnil(&node[i].val) && tvisnumber(&node[i].key)) {\n      lua_Number n = numberVnum(&node[i].key);\n      if (n > m) m = n;\n    }\n  setnumV(L->top-1, m);\n  return 1;\n}\n\nLJLIB_CF(table_insert)\t\tLJLIB_REC(.)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  int32_t n, i = (int32_t)lj_tab_len(t) + 1;\n  int nargs = (int)((char *)L->top - (char *)L->base);\n  if (nargs != 2*sizeof(TValue)) {\n    if (nargs != 3*sizeof(TValue))\n      lj_err_caller(L, LJ_ERR_TABINS);\n    /* NOBARRIER: This just moves existing elements around. */\n    for (n = lj_lib_checkint(L, 2); i > n; i--) {\n      /* The set may invalidate the get pointer, so need to do it first! */\n      TValue *dst = lj_tab_setint(L, t, i);\n      cTValue *src = lj_tab_getint(t, i-1);\n      if (src) {\n\tcopyTV(L, dst, src);\n      } else {\n\tsetnilV(dst);\n      }\n    }\n    i = n;\n  }\n  {\n    TValue *dst = lj_tab_setint(L, t, i);\n    copyTV(L, dst, L->top-1);  /* Set new value. */\n    lj_gc_barriert(L, t, dst);\n  }\n  return 0;\n}\n\nLJLIB_CF(table_remove)\t\tLJLIB_REC(.)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  int32_t e = (int32_t)lj_tab_len(t);\n  int32_t pos = lj_lib_optint(L, 2, e);\n  if (!(1 <= pos && pos <= e))  /* Nothing to remove? */\n    return 0;\n  lua_rawgeti(L, 1, pos);  /* Get previous value. */\n  /* NOBARRIER: This just moves existing elements around. */\n  for (; pos < e; pos++) {\n    cTValue *src = lj_tab_getint(t, pos+1);\n    TValue *dst = lj_tab_setint(L, t, pos);\n    if (src) {\n      copyTV(L, dst, src);\n    } else {\n      setnilV(dst);\n    }\n  }\n  setnilV(lj_tab_setint(L, t, e));  /* Remove (last) value. */\n  return 1;  /* Return previous value. */\n}\n\nLJLIB_CF(table_concat)\n{\n  luaL_Buffer b;\n  GCtab *t = lj_lib_checktab(L, 1);\n  GCstr *sep = lj_lib_optstr(L, 2);\n  MSize seplen = sep ? sep->len : 0;\n  int32_t i = lj_lib_optint(L, 3, 1);\n  int32_t e = L->base+3 < L->top ? lj_lib_checkint(L, 4) :\n\t\t\t\t   (int32_t)lj_tab_len(t);\n  luaL_buffinit(L, &b);\n  if (i <= e) {\n    for (;;) {\n      cTValue *o;\n      lua_rawgeti(L, 1, i);\n      o = L->top-1;\n      if (!(tvisstr(o) || tvisnumber(o)))\n\tlj_err_callerv(L, LJ_ERR_TABCAT, lj_typename(o), i);\n      luaL_addvalue(&b);\n      if (i++ == e) break;\n      if (seplen)\n\tluaL_addlstring(&b, strdata(sep), seplen);\n    }\n  }\n  luaL_pushresult(&b);\n  return 1;\n}\n\n/* ------------------------------------------------------------------------ */\n\nstatic void set2(lua_State *L, int i, int j)\n{\n  lua_rawseti(L, 1, i);\n  lua_rawseti(L, 1, j);\n}\n\nstatic int sort_comp(lua_State *L, int a, int b)\n{\n  if (!lua_isnil(L, 2)) {  /* function? */\n    int res;\n    lua_pushvalue(L, 2);\n    lua_pushvalue(L, a-1);  /* -1 to compensate function */\n    lua_pushvalue(L, b-2);  /* -2 to compensate function and `a' */\n    lua_call(L, 2, 1);\n    res = lua_toboolean(L, -1);\n    lua_pop(L, 1);\n    return res;\n  } else {  /* a < b? */\n    return lua_lessthan(L, a, b);\n  }\n}\n\nstatic void auxsort(lua_State *L, int l, int u)\n{\n  while (l < u) {  /* for tail recursion */\n    int i, j;\n    /* sort elements a[l], a[(l+u)/2] and a[u] */\n    lua_rawgeti(L, 1, l);\n    lua_rawgeti(L, 1, u);\n    if (sort_comp(L, -1, -2))  /* a[u] < a[l]? */\n      set2(L, l, u);  /* swap a[l] - a[u] */\n    else\n      lua_pop(L, 2);\n    if (u-l == 1) break;  /* only 2 elements */\n    i = (l+u)/2;\n    lua_rawgeti(L, 1, i);\n    lua_rawgeti(L, 1, l);\n    if (sort_comp(L, -2, -1)) {  /* a[i]<a[l]? */\n      set2(L, i, l);\n    } else {\n      lua_pop(L, 1);  /* remove a[l] */\n      lua_rawgeti(L, 1, u);\n      if (sort_comp(L, -1, -2))  /* a[u]<a[i]? */\n\tset2(L, i, u);\n      else\n\tlua_pop(L, 2);\n    }\n    if (u-l == 2) break;  /* only 3 elements */\n    lua_rawgeti(L, 1, i);  /* Pivot */\n    lua_pushvalue(L, -1);\n    lua_rawgeti(L, 1, u-1);\n    set2(L, i, u-1);\n    /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */\n    i = l; j = u-1;\n    for (;;) {  /* invariant: a[l..i] <= P <= a[j..u] */\n      /* repeat ++i until a[i] >= P */\n      while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) {\n\tif (i>=u) lj_err_caller(L, LJ_ERR_TABSORT);\n\tlua_pop(L, 1);  /* remove a[i] */\n      }\n      /* repeat --j until a[j] <= P */\n      while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) {\n\tif (j<=l) lj_err_caller(L, LJ_ERR_TABSORT);\n\tlua_pop(L, 1);  /* remove a[j] */\n      }\n      if (j<i) {\n\tlua_pop(L, 3);  /* pop pivot, a[i], a[j] */\n\tbreak;\n      }\n      set2(L, i, j);\n    }\n    lua_rawgeti(L, 1, u-1);\n    lua_rawgeti(L, 1, i);\n    set2(L, u-1, i);  /* swap pivot (a[u-1]) with a[i] */\n    /* a[l..i-1] <= a[i] == P <= a[i+1..u] */\n    /* adjust so that smaller half is in [j..i] and larger one in [l..u] */\n    if (i-l < u-i) {\n      j=l; i=i-1; l=i+2;\n    } else {\n      j=i+1; i=u; u=j-2;\n    }\n    auxsort(L, j, i);  /* call recursively the smaller one */\n  }  /* repeat the routine for the larger one */\n}\n\nLJLIB_CF(table_sort)\n{\n  GCtab *t = lj_lib_checktab(L, 1);\n  int32_t n = (int32_t)lj_tab_len(t);\n  lua_settop(L, 2);\n  if (!tvisnil(L->base+1))\n    lj_lib_checkfunc(L, 2);\n  auxsort(L, 1, n);\n  return 0;\n}\n\n#if LJ_52\nLJLIB_PUSH(\"n\")\nLJLIB_CF(table_pack)\n{\n  TValue *array, *base = L->base;\n  MSize i, n = (uint32_t)(L->top - base);\n  GCtab *t = lj_tab_new(L, n ? n+1 : 0, 1);\n  /* NOBARRIER: The table is new (marked white). */\n  setintV(lj_tab_setstr(L, t, strV(lj_lib_upvalue(L, 1))), (int32_t)n);\n  for (array = tvref(t->array) + 1, i = 0; i < n; i++)\n    copyTV(L, &array[i], &base[i]);\n  settabV(L, base, t);\n  L->top = base+1;\n  lj_gc_check(L);\n  return 1;\n}\n#endif\n\n/* ------------------------------------------------------------------------ */\n\n#include \"lj_libdef.h\"\n\nLUALIB_API int luaopen_table(lua_State *L)\n{\n  LJ_LIB_REG(L, LUA_TABLIBNAME, table);\n#if LJ_52\n  lua_getglobal(L, \"unpack\");\n  lua_setfield(L, -2, \"unpack\");\n#endif\n  return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj.supp",
    "content": "# Valgrind suppression file for LuaJIT 2.0.\n{\n   Optimized string compare\n   Memcheck:Addr4\n   fun:lj_str_cmp\n}\n{\n   Optimized string compare\n   Memcheck:Addr1\n   fun:lj_str_cmp\n}\n{\n   Optimized string compare\n   Memcheck:Addr4\n   fun:lj_str_new\n}\n{\n   Optimized string compare\n   Memcheck:Addr1\n   fun:lj_str_new\n}\n{\n   Optimized string compare\n   Memcheck:Cond\n   fun:lj_str_new\n}\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_alloc.c",
    "content": "/*\n** Bundled memory allocator.\n**\n** Beware: this is a HEAVILY CUSTOMIZED version of dlmalloc.\n** The original bears the following remark:\n**\n**   This is a version (aka dlmalloc) of malloc/free/realloc written by\n**   Doug Lea and released to the public domain, as explained at\n**   http://creativecommons.org/licenses/publicdomain.\n**\n**   * Version pre-2.8.4 Wed Mar 29 19:46:29 2006    (dl at gee)\n**\n** No additional copyright is claimed over the customizations.\n** Please do NOT bother the original author about this version here!\n**\n** If you want to use dlmalloc in another project, you should get\n** the original from: ftp://gee.cs.oswego.edu/pub/misc/\n** For thread-safe derivatives, take a look at:\n** - ptmalloc: http://www.malloc.de/\n** - nedmalloc: http://www.nedprod.com/programs/portable/nedmalloc/\n*/\n\n#define lj_alloc_c\n#define LUA_CORE\n\n/* To get the mremap prototype. Must be defined before any system includes. */\n#if defined(__linux__) && !defined(_GNU_SOURCE)\n#define _GNU_SOURCE\n#endif\n\n#include \"lj_def.h\"\n#include \"lj_arch.h\"\n#include \"lj_alloc.h\"\n\n#ifndef LUAJIT_USE_SYSMALLOC\n\n#define MAX_SIZE_T\t\t(~(size_t)0)\n#define MALLOC_ALIGNMENT\t((size_t)8U)\n\n#define DEFAULT_GRANULARITY\t((size_t)128U * (size_t)1024U)\n#define DEFAULT_TRIM_THRESHOLD\t((size_t)2U * (size_t)1024U * (size_t)1024U)\n#define DEFAULT_MMAP_THRESHOLD\t((size_t)128U * (size_t)1024U)\n#define MAX_RELEASE_CHECK_RATE\t255\n\n/* ------------------- size_t and alignment properties -------------------- */\n\n/* The byte and bit size of a size_t */\n#define SIZE_T_SIZE\t\t(sizeof(size_t))\n#define SIZE_T_BITSIZE\t\t(sizeof(size_t) << 3)\n\n/* Some constants coerced to size_t */\n/* Annoying but necessary to avoid errors on some platforms */\n#define SIZE_T_ZERO\t\t((size_t)0)\n#define SIZE_T_ONE\t\t((size_t)1)\n#define SIZE_T_TWO\t\t((size_t)2)\n#define TWO_SIZE_T_SIZES\t(SIZE_T_SIZE<<1)\n#define FOUR_SIZE_T_SIZES\t(SIZE_T_SIZE<<2)\n#define SIX_SIZE_T_SIZES\t(FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)\n\n/* The bit mask value corresponding to MALLOC_ALIGNMENT */\n#define CHUNK_ALIGN_MASK\t(MALLOC_ALIGNMENT - SIZE_T_ONE)\n\n/* the number of bytes to offset an address to align it */\n#define align_offset(A)\\\n ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\\\n  ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))\n\n/* -------------------------- MMAP support ------------------------------- */\n\n#define MFAIL\t\t\t((void *)(MAX_SIZE_T))\n#define CMFAIL\t\t\t((char *)(MFAIL)) /* defined for convenience */\n\n#define IS_DIRECT_BIT\t\t(SIZE_T_ONE)\n\n#if LJ_TARGET_WINDOWS\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n#if LJ_64\n\n/* Undocumented, but hey, that's what we all love so much about Windows. */\ntypedef long (*PNTAVM)(HANDLE handle, void **addr, ULONG zbits,\n\t\t       size_t *size, ULONG alloctype, ULONG prot);\nstatic PNTAVM ntavm;\n\n/* Number of top bits of the lower 32 bits of an address that must be zero.\n** Apparently 0 gives us full 64 bit addresses and 1 gives us the lower 2GB.\n*/\n#define NTAVM_ZEROBITS\t\t1\n\nstatic void INIT_MMAP(void)\n{\n  ntavm = (PNTAVM)GetProcAddress(GetModuleHandleA(\"ntdll.dll\"),\n\t\t\t\t \"NtAllocateVirtualMemory\");\n}\n\n/* Win64 32 bit MMAP via NtAllocateVirtualMemory. */\nstatic LJ_AINLINE void *CALL_MMAP(size_t size)\n{\n  DWORD olderr = GetLastError();\n  void *ptr = NULL;\n  long st = ntavm(INVALID_HANDLE_VALUE, &ptr, NTAVM_ZEROBITS, &size,\n\t\t  MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);\n  SetLastError(olderr);\n  return st == 0 ? ptr : MFAIL;\n}\n\n/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */\nstatic LJ_AINLINE void *DIRECT_MMAP(size_t size)\n{\n  DWORD olderr = GetLastError();\n  void *ptr = NULL;\n  long st = ntavm(INVALID_HANDLE_VALUE, &ptr, NTAVM_ZEROBITS, &size,\n\t\t  MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, PAGE_READWRITE);\n  SetLastError(olderr);\n  return st == 0 ? ptr : MFAIL;\n}\n\n#else\n\n#define INIT_MMAP()\t\t((void)0)\n\n/* Win32 MMAP via VirtualAlloc */\nstatic LJ_AINLINE void *CALL_MMAP(size_t size)\n{\n  DWORD olderr = GetLastError();\n  void *ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);\n  SetLastError(olderr);\n  return ptr ? ptr : MFAIL;\n}\n\n/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */\nstatic LJ_AINLINE void *DIRECT_MMAP(size_t size)\n{\n  DWORD olderr = GetLastError();\n  void *ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN,\n\t\t\t   PAGE_READWRITE);\n  SetLastError(olderr);\n  return ptr ? ptr : MFAIL;\n}\n\n#endif\n\n/* This function supports releasing coalesed segments */\nstatic LJ_AINLINE int CALL_MUNMAP(void *ptr, size_t size)\n{\n  DWORD olderr = GetLastError();\n  MEMORY_BASIC_INFORMATION minfo;\n  char *cptr = (char *)ptr;\n  while (size) {\n    if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0)\n      return -1;\n    if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr ||\n\tminfo.State != MEM_COMMIT || minfo.RegionSize > size)\n      return -1;\n    if (VirtualFree(cptr, 0, MEM_RELEASE) == 0)\n      return -1;\n    cptr += minfo.RegionSize;\n    size -= minfo.RegionSize;\n  }\n  SetLastError(olderr);\n  return 0;\n}\n\n#else\n\n#include <errno.h>\n#include <sys/mman.h>\n\n#define MMAP_PROT\t\t(PROT_READ|PROT_WRITE)\n#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)\n#define MAP_ANONYMOUS\t\tMAP_ANON\n#endif\n#define MMAP_FLAGS\t\t(MAP_PRIVATE|MAP_ANONYMOUS)\n\n#if LJ_64\n/* 64 bit mode needs special support for allocating memory in the lower 2GB. */\n\n#if LJ_TARGET_LINUX\n\n/* Actually this only gives us max. 1GB in current Linux kernels. */\nstatic LJ_AINLINE void *CALL_MMAP(size_t size)\n{\n  int olderr = errno;\n  void *ptr = mmap(NULL, size, MMAP_PROT, MAP_32BIT|MMAP_FLAGS, -1, 0);\n  errno = olderr;\n  return ptr;\n}\n\n#elif LJ_TARGET_OSX || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)\n\n/* OSX and FreeBSD mmap() use a naive first-fit linear search.\n** That's perfect for us. Except that -pagezero_size must be set for OSX,\n** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs\n** to be reduced to 250MB on FreeBSD.\n*/\n#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)\n#include <sys/resource.h>\n#define MMAP_REGION_START\t((uintptr_t)0x10000000)\n#else\n#define MMAP_REGION_START\t((uintptr_t)0x10000)\n#endif\n#define MMAP_REGION_END\t\t((uintptr_t)0x80000000)\n\nstatic LJ_AINLINE void *CALL_MMAP(size_t size)\n{\n  int olderr = errno;\n  /* Hint for next allocation. Doesn't need to be thread-safe. */\n  static uintptr_t alloc_hint = MMAP_REGION_START;\n  int retry = 0;\n#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)\n  static int rlimit_modified = 0;\n  if (LJ_UNLIKELY(rlimit_modified == 0)) {\n    struct rlimit rlim;\n    rlim.rlim_cur = rlim.rlim_max = MMAP_REGION_START;\n    setrlimit(RLIMIT_DATA, &rlim);  /* Ignore result. May fail below. */\n    rlimit_modified = 1;\n  }\n#endif\n  for (;;) {\n    void *p = mmap((void *)alloc_hint, size, MMAP_PROT, MMAP_FLAGS, -1, 0);\n    if ((uintptr_t)p >= MMAP_REGION_START &&\n\t(uintptr_t)p + size < MMAP_REGION_END) {\n      alloc_hint = (uintptr_t)p + size;\n      errno = olderr;\n      return p;\n    }\n    if (p != CMFAIL) munmap(p, size);\n    if (retry) break;\n    retry = 1;\n    alloc_hint = MMAP_REGION_START;\n  }\n  errno = olderr;\n  return CMFAIL;\n}\n\n#else\n\n#error \"NYI: need an equivalent of MAP_32BIT for this 64 bit OS\"\n\n#endif\n\n#else\n\n/* 32 bit mode is easy. */\nstatic LJ_AINLINE void *CALL_MMAP(size_t size)\n{\n  int olderr = errno;\n  void *ptr = mmap(NULL, size, MMAP_PROT, MMAP_FLAGS, -1, 0);\n  errno = olderr;\n  return ptr;\n}\n\n#endif\n\n#define INIT_MMAP()\t\t((void)0)\n#define DIRECT_MMAP(s)\t\tCALL_MMAP(s)\n\nstatic LJ_AINLINE int CALL_MUNMAP(void *ptr, size_t size)\n{\n  int olderr = errno;\n  int ret = munmap(ptr, size);\n  errno = olderr;\n  return ret;\n}\n\n#if LJ_TARGET_LINUX\n/* Need to define _GNU_SOURCE to get the mremap prototype. */\nstatic LJ_AINLINE void *CALL_MREMAP_(void *ptr, size_t osz, size_t nsz,\n\t\t\t\t     int flags)\n{\n  int olderr = errno;\n  ptr = mremap(ptr, osz, nsz, flags);\n  errno = olderr;\n  return ptr;\n}\n\n#define CALL_MREMAP(addr, osz, nsz, mv) CALL_MREMAP_((addr), (osz), (nsz), (mv))\n#define CALL_MREMAP_NOMOVE\t0\n#define CALL_MREMAP_MAYMOVE\t1\n#if LJ_64\n#define CALL_MREMAP_MV\t\tCALL_MREMAP_NOMOVE\n#else\n#define CALL_MREMAP_MV\t\tCALL_MREMAP_MAYMOVE\n#endif\n#endif\n\n#endif\n\n#ifndef CALL_MREMAP\n#define CALL_MREMAP(addr, osz, nsz, mv) ((void)osz, MFAIL)\n#endif\n\n/* -----------------------  Chunk representations ------------------------ */\n\nstruct malloc_chunk {\n  size_t               prev_foot;  /* Size of previous chunk (if free).  */\n  size_t               head;       /* Size and inuse bits. */\n  struct malloc_chunk *fd;         /* double links -- used only if free. */\n  struct malloc_chunk *bk;\n};\n\ntypedef struct malloc_chunk  mchunk;\ntypedef struct malloc_chunk *mchunkptr;\ntypedef struct malloc_chunk *sbinptr;  /* The type of bins of chunks */\ntypedef size_t bindex_t;               /* Described below */\ntypedef unsigned int binmap_t;         /* Described below */\ntypedef unsigned int flag_t;           /* The type of various bit flag sets */\n\n/* ------------------- Chunks sizes and alignments ----------------------- */\n\n#define MCHUNK_SIZE\t\t(sizeof(mchunk))\n\n#define CHUNK_OVERHEAD\t\t(SIZE_T_SIZE)\n\n/* Direct chunks need a second word of overhead ... */\n#define DIRECT_CHUNK_OVERHEAD\t(TWO_SIZE_T_SIZES)\n/* ... and additional padding for fake next-chunk at foot */\n#define DIRECT_FOOT_PAD\t\t(FOUR_SIZE_T_SIZES)\n\n/* The smallest size we can malloc is an aligned minimal chunk */\n#define MIN_CHUNK_SIZE\\\n  ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)\n\n/* conversion from malloc headers to user pointers, and back */\n#define chunk2mem(p)\t\t((void *)((char *)(p) + TWO_SIZE_T_SIZES))\n#define mem2chunk(mem)\t\t((mchunkptr)((char *)(mem) - TWO_SIZE_T_SIZES))\n/* chunk associated with aligned address A */\n#define align_as_chunk(A)\t(mchunkptr)((A) + align_offset(chunk2mem(A)))\n\n/* Bounds on request (not chunk) sizes. */\n#define MAX_REQUEST\t\t((~MIN_CHUNK_SIZE+1) << 2)\n#define MIN_REQUEST\t\t(MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)\n\n/* pad request bytes into a usable size */\n#define pad_request(req) \\\n   (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)\n\n/* pad request, checking for minimum (but not maximum) */\n#define request2size(req) \\\n  (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))\n\n/* ------------------ Operations on head and foot fields ----------------- */\n\n#define PINUSE_BIT\t\t(SIZE_T_ONE)\n#define CINUSE_BIT\t\t(SIZE_T_TWO)\n#define INUSE_BITS\t\t(PINUSE_BIT|CINUSE_BIT)\n\n/* Head value for fenceposts */\n#define FENCEPOST_HEAD\t\t(INUSE_BITS|SIZE_T_SIZE)\n\n/* extraction of fields from head words */\n#define cinuse(p)\t\t((p)->head & CINUSE_BIT)\n#define pinuse(p)\t\t((p)->head & PINUSE_BIT)\n#define chunksize(p)\t\t((p)->head & ~(INUSE_BITS))\n\n#define clear_pinuse(p)\t\t((p)->head &= ~PINUSE_BIT)\n#define clear_cinuse(p)\t\t((p)->head &= ~CINUSE_BIT)\n\n/* Treat space at ptr +/- offset as a chunk */\n#define chunk_plus_offset(p, s)\t\t((mchunkptr)(((char *)(p)) + (s)))\n#define chunk_minus_offset(p, s)\t((mchunkptr)(((char *)(p)) - (s)))\n\n/* Ptr to next or previous physical malloc_chunk. */\n#define next_chunk(p)\t((mchunkptr)(((char *)(p)) + ((p)->head & ~INUSE_BITS)))\n#define prev_chunk(p)\t((mchunkptr)(((char *)(p)) - ((p)->prev_foot) ))\n\n/* extract next chunk's pinuse bit */\n#define next_pinuse(p)\t((next_chunk(p)->head) & PINUSE_BIT)\n\n/* Get/set size at footer */\n#define get_foot(p, s)\t(((mchunkptr)((char *)(p) + (s)))->prev_foot)\n#define set_foot(p, s)\t(((mchunkptr)((char *)(p) + (s)))->prev_foot = (s))\n\n/* Set size, pinuse bit, and foot */\n#define set_size_and_pinuse_of_free_chunk(p, s)\\\n  ((p)->head = (s|PINUSE_BIT), set_foot(p, s))\n\n/* Set size, pinuse bit, foot, and clear next pinuse */\n#define set_free_with_pinuse(p, s, n)\\\n  (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))\n\n#define is_direct(p)\\\n  (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_DIRECT_BIT))\n\n/* Get the internal overhead associated with chunk p */\n#define overhead_for(p)\\\n (is_direct(p)? DIRECT_CHUNK_OVERHEAD : CHUNK_OVERHEAD)\n\n/* ---------------------- Overlaid data structures ----------------------- */\n\nstruct malloc_tree_chunk {\n  /* The first four fields must be compatible with malloc_chunk */\n  size_t                    prev_foot;\n  size_t                    head;\n  struct malloc_tree_chunk *fd;\n  struct malloc_tree_chunk *bk;\n\n  struct malloc_tree_chunk *child[2];\n  struct malloc_tree_chunk *parent;\n  bindex_t                  index;\n};\n\ntypedef struct malloc_tree_chunk  tchunk;\ntypedef struct malloc_tree_chunk *tchunkptr;\ntypedef struct malloc_tree_chunk *tbinptr; /* The type of bins of trees */\n\n/* A little helper macro for trees */\n#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])\n\n/* ----------------------------- Segments -------------------------------- */\n\nstruct malloc_segment {\n  char        *base;             /* base address */\n  size_t       size;             /* allocated size */\n  struct malloc_segment *next;   /* ptr to next segment */\n};\n\ntypedef struct malloc_segment  msegment;\ntypedef struct malloc_segment *msegmentptr;\n\n/* ---------------------------- malloc_state ----------------------------- */\n\n/* Bin types, widths and sizes */\n#define NSMALLBINS\t\t(32U)\n#define NTREEBINS\t\t(32U)\n#define SMALLBIN_SHIFT\t\t(3U)\n#define SMALLBIN_WIDTH\t\t(SIZE_T_ONE << SMALLBIN_SHIFT)\n#define TREEBIN_SHIFT\t\t(8U)\n#define MIN_LARGE_SIZE\t\t(SIZE_T_ONE << TREEBIN_SHIFT)\n#define MAX_SMALL_SIZE\t\t(MIN_LARGE_SIZE - SIZE_T_ONE)\n#define MAX_SMALL_REQUEST  (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)\n\nstruct malloc_state {\n  binmap_t   smallmap;\n  binmap_t   treemap;\n  size_t     dvsize;\n  size_t     topsize;\n  mchunkptr  dv;\n  mchunkptr  top;\n  size_t     trim_check;\n  size_t     release_checks;\n  mchunkptr  smallbins[(NSMALLBINS+1)*2];\n  tbinptr    treebins[NTREEBINS];\n  msegment   seg;\n};\n\ntypedef struct malloc_state *mstate;\n\n#define is_initialized(M)\t((M)->top != 0)\n\n/* -------------------------- system alloc setup ------------------------- */\n\n/* page-align a size */\n#define page_align(S)\\\n (((S) + (LJ_PAGESIZE - SIZE_T_ONE)) & ~(LJ_PAGESIZE - SIZE_T_ONE))\n\n/* granularity-align a size */\n#define granularity_align(S)\\\n  (((S) + (DEFAULT_GRANULARITY - SIZE_T_ONE))\\\n   & ~(DEFAULT_GRANULARITY - SIZE_T_ONE))\n\n#if LJ_TARGET_WINDOWS\n#define mmap_align(S)\tgranularity_align(S)\n#else\n#define mmap_align(S)\tpage_align(S)\n#endif\n\n/*  True if segment S holds address A */\n#define segment_holds(S, A)\\\n  ((char *)(A) >= S->base && (char *)(A) < S->base + S->size)\n\n/* Return segment holding given address */\nstatic msegmentptr segment_holding(mstate m, char *addr)\n{\n  msegmentptr sp = &m->seg;\n  for (;;) {\n    if (addr >= sp->base && addr < sp->base + sp->size)\n      return sp;\n    if ((sp = sp->next) == 0)\n      return 0;\n  }\n}\n\n/* Return true if segment contains a segment link */\nstatic int has_segment_link(mstate m, msegmentptr ss)\n{\n  msegmentptr sp = &m->seg;\n  for (;;) {\n    if ((char *)sp >= ss->base && (char *)sp < ss->base + ss->size)\n      return 1;\n    if ((sp = sp->next) == 0)\n      return 0;\n  }\n}\n\n/*\n  TOP_FOOT_SIZE is padding at the end of a segment, including space\n  that may be needed to place segment records and fenceposts when new\n  noncontiguous segments are added.\n*/\n#define TOP_FOOT_SIZE\\\n  (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)\n\n/* ---------------------------- Indexing Bins ---------------------------- */\n\n#define is_small(s)\t\t(((s) >> SMALLBIN_SHIFT) < NSMALLBINS)\n#define small_index(s)\t\t((s)  >> SMALLBIN_SHIFT)\n#define small_index2size(i)\t((i)  << SMALLBIN_SHIFT)\n#define MIN_SMALL_INDEX\t\t(small_index(MIN_CHUNK_SIZE))\n\n/* addressing by index. See above about smallbin repositioning */\n#define smallbin_at(M, i)\t((sbinptr)((char *)&((M)->smallbins[(i)<<1])))\n#define treebin_at(M,i)\t\t(&((M)->treebins[i]))\n\n/* assign tree index for size S to variable I */\n#define compute_tree_index(S, I)\\\n{\\\n  unsigned int X = (unsigned int)(S >> TREEBIN_SHIFT);\\\n  if (X == 0) {\\\n    I = 0;\\\n  } else if (X > 0xFFFF) {\\\n    I = NTREEBINS-1;\\\n  } else {\\\n    unsigned int K = lj_fls(X);\\\n    I =  (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\\\n  }\\\n}\n\n/* Bit representing maximum resolved size in a treebin at i */\n#define bit_for_tree_index(i) \\\n   (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)\n\n/* Shift placing maximum resolved bit in a treebin at i as sign bit */\n#define leftshift_for_tree_index(i) \\\n   ((i == NTREEBINS-1)? 0 : \\\n    ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))\n\n/* The size of the smallest chunk held in bin with index i */\n#define minsize_for_tree_index(i) \\\n   ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) |  \\\n   (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))\n\n/* ------------------------ Operations on bin maps ----------------------- */\n\n/* bit corresponding to given index */\n#define idx2bit(i)\t\t((binmap_t)(1) << (i))\n\n/* Mark/Clear bits with given index */\n#define mark_smallmap(M,i)\t((M)->smallmap |=  idx2bit(i))\n#define clear_smallmap(M,i)\t((M)->smallmap &= ~idx2bit(i))\n#define smallmap_is_marked(M,i)\t((M)->smallmap &   idx2bit(i))\n\n#define mark_treemap(M,i)\t((M)->treemap  |=  idx2bit(i))\n#define clear_treemap(M,i)\t((M)->treemap  &= ~idx2bit(i))\n#define treemap_is_marked(M,i)\t((M)->treemap  &   idx2bit(i))\n\n/* mask with all bits to left of least bit of x on */\n#define left_bits(x)\t\t((x<<1) | (~(x<<1)+1))\n\n/* Set cinuse bit and pinuse bit of next chunk */\n#define set_inuse(M,p,s)\\\n  ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\\\n  ((mchunkptr)(((char *)(p)) + (s)))->head |= PINUSE_BIT)\n\n/* Set cinuse and pinuse of this chunk and pinuse of next chunk */\n#define set_inuse_and_pinuse(M,p,s)\\\n  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\\\n  ((mchunkptr)(((char *)(p)) + (s)))->head |= PINUSE_BIT)\n\n/* Set size, cinuse and pinuse bit of this chunk */\n#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\\\n  ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))\n\n/* ----------------------- Operations on smallbins ----------------------- */\n\n/* Link a free chunk into a smallbin  */\n#define insert_small_chunk(M, P, S) {\\\n  bindex_t I = small_index(S);\\\n  mchunkptr B = smallbin_at(M, I);\\\n  mchunkptr F = B;\\\n  if (!smallmap_is_marked(M, I))\\\n    mark_smallmap(M, I);\\\n  else\\\n    F = B->fd;\\\n  B->fd = P;\\\n  F->bk = P;\\\n  P->fd = F;\\\n  P->bk = B;\\\n}\n\n/* Unlink a chunk from a smallbin  */\n#define unlink_small_chunk(M, P, S) {\\\n  mchunkptr F = P->fd;\\\n  mchunkptr B = P->bk;\\\n  bindex_t I = small_index(S);\\\n  if (F == B) {\\\n    clear_smallmap(M, I);\\\n  } else {\\\n    F->bk = B;\\\n    B->fd = F;\\\n  }\\\n}\n\n/* Unlink the first chunk from a smallbin */\n#define unlink_first_small_chunk(M, B, P, I) {\\\n  mchunkptr F = P->fd;\\\n  if (B == F) {\\\n    clear_smallmap(M, I);\\\n  } else {\\\n    B->fd = F;\\\n    F->bk = B;\\\n  }\\\n}\n\n/* Replace dv node, binning the old one */\n/* Used only when dvsize known to be small */\n#define replace_dv(M, P, S) {\\\n  size_t DVS = M->dvsize;\\\n  if (DVS != 0) {\\\n    mchunkptr DV = M->dv;\\\n    insert_small_chunk(M, DV, DVS);\\\n  }\\\n  M->dvsize = S;\\\n  M->dv = P;\\\n}\n\n/* ------------------------- Operations on trees ------------------------- */\n\n/* Insert chunk into tree */\n#define insert_large_chunk(M, X, S) {\\\n  tbinptr *H;\\\n  bindex_t I;\\\n  compute_tree_index(S, I);\\\n  H = treebin_at(M, I);\\\n  X->index = I;\\\n  X->child[0] = X->child[1] = 0;\\\n  if (!treemap_is_marked(M, I)) {\\\n    mark_treemap(M, I);\\\n    *H = X;\\\n    X->parent = (tchunkptr)H;\\\n    X->fd = X->bk = X;\\\n  } else {\\\n    tchunkptr T = *H;\\\n    size_t K = S << leftshift_for_tree_index(I);\\\n    for (;;) {\\\n      if (chunksize(T) != S) {\\\n\ttchunkptr *C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\\\n\tK <<= 1;\\\n\tif (*C != 0) {\\\n\t  T = *C;\\\n\t} else {\\\n\t  *C = X;\\\n\t  X->parent = T;\\\n\t  X->fd = X->bk = X;\\\n\t  break;\\\n\t}\\\n      } else {\\\n\ttchunkptr F = T->fd;\\\n\tT->fd = F->bk = X;\\\n\tX->fd = F;\\\n\tX->bk = T;\\\n\tX->parent = 0;\\\n\tbreak;\\\n      }\\\n    }\\\n  }\\\n}\n\n#define unlink_large_chunk(M, X) {\\\n  tchunkptr XP = X->parent;\\\n  tchunkptr R;\\\n  if (X->bk != X) {\\\n    tchunkptr F = X->fd;\\\n    R = X->bk;\\\n    F->bk = R;\\\n    R->fd = F;\\\n  } else {\\\n    tchunkptr *RP;\\\n    if (((R = *(RP = &(X->child[1]))) != 0) ||\\\n\t((R = *(RP = &(X->child[0]))) != 0)) {\\\n      tchunkptr *CP;\\\n      while ((*(CP = &(R->child[1])) != 0) ||\\\n\t     (*(CP = &(R->child[0])) != 0)) {\\\n\tR = *(RP = CP);\\\n      }\\\n      *RP = 0;\\\n    }\\\n  }\\\n  if (XP != 0) {\\\n    tbinptr *H = treebin_at(M, X->index);\\\n    if (X == *H) {\\\n      if ((*H = R) == 0) \\\n\tclear_treemap(M, X->index);\\\n    } else {\\\n      if (XP->child[0] == X) \\\n\tXP->child[0] = R;\\\n      else \\\n\tXP->child[1] = R;\\\n    }\\\n    if (R != 0) {\\\n      tchunkptr C0, C1;\\\n      R->parent = XP;\\\n      if ((C0 = X->child[0]) != 0) {\\\n\tR->child[0] = C0;\\\n\tC0->parent = R;\\\n      }\\\n      if ((C1 = X->child[1]) != 0) {\\\n\tR->child[1] = C1;\\\n\tC1->parent = R;\\\n      }\\\n    }\\\n  }\\\n}\n\n/* Relays to large vs small bin operations */\n\n#define insert_chunk(M, P, S)\\\n  if (is_small(S)) { insert_small_chunk(M, P, S)\\\n  } else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }\n\n#define unlink_chunk(M, P, S)\\\n  if (is_small(S)) { unlink_small_chunk(M, P, S)\\\n  } else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }\n\n/* -----------------------  Direct-mmapping chunks ----------------------- */\n\nstatic void *direct_alloc(size_t nb)\n{\n  size_t mmsize = mmap_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);\n  if (LJ_LIKELY(mmsize > nb)) {     /* Check for wrap around 0 */\n    char *mm = (char *)(DIRECT_MMAP(mmsize));\n    if (mm != CMFAIL) {\n      size_t offset = align_offset(chunk2mem(mm));\n      size_t psize = mmsize - offset - DIRECT_FOOT_PAD;\n      mchunkptr p = (mchunkptr)(mm + offset);\n      p->prev_foot = offset | IS_DIRECT_BIT;\n      p->head = psize|CINUSE_BIT;\n      chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;\n      chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0;\n      return chunk2mem(p);\n    }\n  }\n  return NULL;\n}\n\nstatic mchunkptr direct_resize(mchunkptr oldp, size_t nb)\n{\n  size_t oldsize = chunksize(oldp);\n  if (is_small(nb)) /* Can't shrink direct regions below small size */\n    return NULL;\n  /* Keep old chunk if big enough but not too big */\n  if (oldsize >= nb + SIZE_T_SIZE &&\n      (oldsize - nb) <= (DEFAULT_GRANULARITY >> 1)) {\n    return oldp;\n  } else {\n    size_t offset = oldp->prev_foot & ~IS_DIRECT_BIT;\n    size_t oldmmsize = oldsize + offset + DIRECT_FOOT_PAD;\n    size_t newmmsize = mmap_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);\n    char *cp = (char *)CALL_MREMAP((char *)oldp - offset,\n\t\t\t\t   oldmmsize, newmmsize, CALL_MREMAP_MV);\n    if (cp != CMFAIL) {\n      mchunkptr newp = (mchunkptr)(cp + offset);\n      size_t psize = newmmsize - offset - DIRECT_FOOT_PAD;\n      newp->head = psize|CINUSE_BIT;\n      chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD;\n      chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0;\n      return newp;\n    }\n  }\n  return NULL;\n}\n\n/* -------------------------- mspace management -------------------------- */\n\n/* Initialize top chunk and its size */\nstatic void init_top(mstate m, mchunkptr p, size_t psize)\n{\n  /* Ensure alignment */\n  size_t offset = align_offset(chunk2mem(p));\n  p = (mchunkptr)((char *)p + offset);\n  psize -= offset;\n\n  m->top = p;\n  m->topsize = psize;\n  p->head = psize | PINUSE_BIT;\n  /* set size of fake trailing chunk holding overhead space only once */\n  chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE;\n  m->trim_check = DEFAULT_TRIM_THRESHOLD; /* reset on each update */\n}\n\n/* Initialize bins for a new mstate that is otherwise zeroed out */\nstatic void init_bins(mstate m)\n{\n  /* Establish circular links for smallbins */\n  bindex_t i;\n  for (i = 0; i < NSMALLBINS; i++) {\n    sbinptr bin = smallbin_at(m,i);\n    bin->fd = bin->bk = bin;\n  }\n}\n\n/* Allocate chunk and prepend remainder with chunk in successor base. */\nstatic void *prepend_alloc(mstate m, char *newbase, char *oldbase, size_t nb)\n{\n  mchunkptr p = align_as_chunk(newbase);\n  mchunkptr oldfirst = align_as_chunk(oldbase);\n  size_t psize = (size_t)((char *)oldfirst - (char *)p);\n  mchunkptr q = chunk_plus_offset(p, nb);\n  size_t qsize = psize - nb;\n  set_size_and_pinuse_of_inuse_chunk(m, p, nb);\n\n  /* consolidate remainder with first chunk of old base */\n  if (oldfirst == m->top) {\n    size_t tsize = m->topsize += qsize;\n    m->top = q;\n    q->head = tsize | PINUSE_BIT;\n  } else if (oldfirst == m->dv) {\n    size_t dsize = m->dvsize += qsize;\n    m->dv = q;\n    set_size_and_pinuse_of_free_chunk(q, dsize);\n  } else {\n    if (!cinuse(oldfirst)) {\n      size_t nsize = chunksize(oldfirst);\n      unlink_chunk(m, oldfirst, nsize);\n      oldfirst = chunk_plus_offset(oldfirst, nsize);\n      qsize += nsize;\n    }\n    set_free_with_pinuse(q, qsize, oldfirst);\n    insert_chunk(m, q, qsize);\n  }\n\n  return chunk2mem(p);\n}\n\n/* Add a segment to hold a new noncontiguous region */\nstatic void add_segment(mstate m, char *tbase, size_t tsize)\n{\n  /* Determine locations and sizes of segment, fenceposts, old top */\n  char *old_top = (char *)m->top;\n  msegmentptr oldsp = segment_holding(m, old_top);\n  char *old_end = oldsp->base + oldsp->size;\n  size_t ssize = pad_request(sizeof(struct malloc_segment));\n  char *rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);\n  size_t offset = align_offset(chunk2mem(rawsp));\n  char *asp = rawsp + offset;\n  char *csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp;\n  mchunkptr sp = (mchunkptr)csp;\n  msegmentptr ss = (msegmentptr)(chunk2mem(sp));\n  mchunkptr tnext = chunk_plus_offset(sp, ssize);\n  mchunkptr p = tnext;\n\n  /* reset top to new space */\n  init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);\n\n  /* Set up segment record */\n  set_size_and_pinuse_of_inuse_chunk(m, sp, ssize);\n  *ss = m->seg; /* Push current record */\n  m->seg.base = tbase;\n  m->seg.size = tsize;\n  m->seg.next = ss;\n\n  /* Insert trailing fenceposts */\n  for (;;) {\n    mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);\n    p->head = FENCEPOST_HEAD;\n    if ((char *)(&(nextp->head)) < old_end)\n      p = nextp;\n    else\n      break;\n  }\n\n  /* Insert the rest of old top into a bin as an ordinary free chunk */\n  if (csp != old_top) {\n    mchunkptr q = (mchunkptr)old_top;\n    size_t psize = (size_t)(csp - old_top);\n    mchunkptr tn = chunk_plus_offset(q, psize);\n    set_free_with_pinuse(q, psize, tn);\n    insert_chunk(m, q, psize);\n  }\n}\n\n/* -------------------------- System allocation -------------------------- */\n\nstatic void *alloc_sys(mstate m, size_t nb)\n{\n  char *tbase = CMFAIL;\n  size_t tsize = 0;\n\n  /* Directly map large chunks */\n  if (LJ_UNLIKELY(nb >= DEFAULT_MMAP_THRESHOLD)) {\n    void *mem = direct_alloc(nb);\n    if (mem != 0)\n      return mem;\n  }\n\n  {\n    size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE;\n    size_t rsize = granularity_align(req);\n    if (LJ_LIKELY(rsize > nb)) { /* Fail if wraps around zero */\n      char *mp = (char *)(CALL_MMAP(rsize));\n      if (mp != CMFAIL) {\n\ttbase = mp;\n\ttsize = rsize;\n      }\n    }\n  }\n\n  if (tbase != CMFAIL) {\n    msegmentptr sp = &m->seg;\n    /* Try to merge with an existing segment */\n    while (sp != 0 && tbase != sp->base + sp->size)\n      sp = sp->next;\n    if (sp != 0 && segment_holds(sp, m->top)) { /* append */\n      sp->size += tsize;\n      init_top(m, m->top, m->topsize + tsize);\n    } else {\n      sp = &m->seg;\n      while (sp != 0 && sp->base != tbase + tsize)\n\tsp = sp->next;\n      if (sp != 0) {\n\tchar *oldbase = sp->base;\n\tsp->base = tbase;\n\tsp->size += tsize;\n\treturn prepend_alloc(m, tbase, oldbase, nb);\n      } else {\n\tadd_segment(m, tbase, tsize);\n      }\n    }\n\n    if (nb < m->topsize) { /* Allocate from new or extended top space */\n      size_t rsize = m->topsize -= nb;\n      mchunkptr p = m->top;\n      mchunkptr r = m->top = chunk_plus_offset(p, nb);\n      r->head = rsize | PINUSE_BIT;\n      set_size_and_pinuse_of_inuse_chunk(m, p, nb);\n      return chunk2mem(p);\n    }\n  }\n\n  return NULL;\n}\n\n/* -----------------------  system deallocation -------------------------- */\n\n/* Unmap and unlink any mmapped segments that don't contain used chunks */\nstatic size_t release_unused_segments(mstate m)\n{\n  size_t released = 0;\n  size_t nsegs = 0;\n  msegmentptr pred = &m->seg;\n  msegmentptr sp = pred->next;\n  while (sp != 0) {\n    char *base = sp->base;\n    size_t size = sp->size;\n    msegmentptr next = sp->next;\n    nsegs++;\n    {\n      mchunkptr p = align_as_chunk(base);\n      size_t psize = chunksize(p);\n      /* Can unmap if first chunk holds entire segment and not pinned */\n      if (!cinuse(p) && (char *)p + psize >= base + size - TOP_FOOT_SIZE) {\n\ttchunkptr tp = (tchunkptr)p;\n\tif (p == m->dv) {\n\t  m->dv = 0;\n\t  m->dvsize = 0;\n\t} else {\n\t  unlink_large_chunk(m, tp);\n\t}\n\tif (CALL_MUNMAP(base, size) == 0) {\n\t  released += size;\n\t  /* unlink obsoleted record */\n\t  sp = pred;\n\t  sp->next = next;\n\t} else { /* back out if cannot unmap */\n\t  insert_large_chunk(m, tp, psize);\n\t}\n      }\n    }\n    pred = sp;\n    sp = next;\n  }\n  /* Reset check counter */\n  m->release_checks = nsegs > MAX_RELEASE_CHECK_RATE ?\n\t\t      nsegs : MAX_RELEASE_CHECK_RATE;\n  return released;\n}\n\nstatic int alloc_trim(mstate m, size_t pad)\n{\n  size_t released = 0;\n  if (pad < MAX_REQUEST && is_initialized(m)) {\n    pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */\n\n    if (m->topsize > pad) {\n      /* Shrink top space in granularity-size units, keeping at least one */\n      size_t unit = DEFAULT_GRANULARITY;\n      size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit -\n\t\t      SIZE_T_ONE) * unit;\n      msegmentptr sp = segment_holding(m, (char *)m->top);\n\n      if (sp->size >= extra &&\n\t  !has_segment_link(m, sp)) { /* can't shrink if pinned */\n\tsize_t newsize = sp->size - extra;\n\t/* Prefer mremap, fall back to munmap */\n\tif ((CALL_MREMAP(sp->base, sp->size, newsize, CALL_MREMAP_NOMOVE) != MFAIL) ||\n\t    (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {\n\t  released = extra;\n\t}\n      }\n\n      if (released != 0) {\n\tsp->size -= released;\n\tinit_top(m, m->top, m->topsize - released);\n      }\n    }\n\n    /* Unmap any unused mmapped segments */\n    released += release_unused_segments(m);\n\n    /* On failure, disable autotrim to avoid repeated failed future calls */\n    if (released == 0 && m->topsize > m->trim_check)\n      m->trim_check = MAX_SIZE_T;\n  }\n\n  return (released != 0)? 1 : 0;\n}\n\n/* ---------------------------- malloc support --------------------------- */\n\n/* allocate a large request from the best fitting chunk in a treebin */\nstatic void *tmalloc_large(mstate m, size_t nb)\n{\n  tchunkptr v = 0;\n  size_t rsize = ~nb+1; /* Unsigned negation */\n  tchunkptr t;\n  bindex_t idx;\n  compute_tree_index(nb, idx);\n\n  if ((t = *treebin_at(m, idx)) != 0) {\n    /* Traverse tree for this bin looking for node with size == nb */\n    size_t sizebits = nb << leftshift_for_tree_index(idx);\n    tchunkptr rst = 0;  /* The deepest untaken right subtree */\n    for (;;) {\n      tchunkptr rt;\n      size_t trem = chunksize(t) - nb;\n      if (trem < rsize) {\n\tv = t;\n\tif ((rsize = trem) == 0)\n\t  break;\n      }\n      rt = t->child[1];\n      t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];\n      if (rt != 0 && rt != t)\n\trst = rt;\n      if (t == 0) {\n\tt = rst; /* set t to least subtree holding sizes > nb */\n\tbreak;\n      }\n      sizebits <<= 1;\n    }\n  }\n\n  if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */\n    binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap;\n    if (leftbits != 0)\n      t = *treebin_at(m, lj_ffs(leftbits));\n  }\n\n  while (t != 0) { /* find smallest of tree or subtree */\n    size_t trem = chunksize(t) - nb;\n    if (trem < rsize) {\n      rsize = trem;\n      v = t;\n    }\n    t = leftmost_child(t);\n  }\n\n  /*  If dv is a better fit, return NULL so malloc will use it */\n  if (v != 0 && rsize < (size_t)(m->dvsize - nb)) {\n    mchunkptr r = chunk_plus_offset(v, nb);\n    unlink_large_chunk(m, v);\n    if (rsize < MIN_CHUNK_SIZE) {\n      set_inuse_and_pinuse(m, v, (rsize + nb));\n    } else {\n      set_size_and_pinuse_of_inuse_chunk(m, v, nb);\n      set_size_and_pinuse_of_free_chunk(r, rsize);\n      insert_chunk(m, r, rsize);\n    }\n    return chunk2mem(v);\n  }\n  return NULL;\n}\n\n/* allocate a small request from the best fitting chunk in a treebin */\nstatic void *tmalloc_small(mstate m, size_t nb)\n{\n  tchunkptr t, v;\n  mchunkptr r;\n  size_t rsize;\n  bindex_t i = lj_ffs(m->treemap);\n\n  v = t = *treebin_at(m, i);\n  rsize = chunksize(t) - nb;\n\n  while ((t = leftmost_child(t)) != 0) {\n    size_t trem = chunksize(t) - nb;\n    if (trem < rsize) {\n      rsize = trem;\n      v = t;\n    }\n  }\n\n  r = chunk_plus_offset(v, nb);\n  unlink_large_chunk(m, v);\n  if (rsize < MIN_CHUNK_SIZE) {\n    set_inuse_and_pinuse(m, v, (rsize + nb));\n  } else {\n    set_size_and_pinuse_of_inuse_chunk(m, v, nb);\n    set_size_and_pinuse_of_free_chunk(r, rsize);\n    replace_dv(m, r, rsize);\n  }\n  return chunk2mem(v);\n}\n\n/* ----------------------------------------------------------------------- */\n\nvoid *lj_alloc_create(void)\n{\n  size_t tsize = DEFAULT_GRANULARITY;\n  char *tbase;\n  INIT_MMAP();\n  tbase = (char *)(CALL_MMAP(tsize));\n  if (tbase != CMFAIL) {\n    size_t msize = pad_request(sizeof(struct malloc_state));\n    mchunkptr mn;\n    mchunkptr msp = align_as_chunk(tbase);\n    mstate m = (mstate)(chunk2mem(msp));\n    memset(m, 0, msize);\n    msp->head = (msize|PINUSE_BIT|CINUSE_BIT);\n    m->seg.base = tbase;\n    m->seg.size = tsize;\n    m->release_checks = MAX_RELEASE_CHECK_RATE;\n    init_bins(m);\n    mn = next_chunk(mem2chunk(m));\n    init_top(m, mn, (size_t)((tbase + tsize) - (char *)mn) - TOP_FOOT_SIZE);\n    return m;\n  }\n  return NULL;\n}\n\nvoid lj_alloc_destroy(void *msp)\n{\n  mstate ms = (mstate)msp;\n  msegmentptr sp = &ms->seg;\n  while (sp != 0) {\n    char *base = sp->base;\n    size_t size = sp->size;\n    sp = sp->next;\n    CALL_MUNMAP(base, size);\n  }\n}\n\nstatic LJ_NOINLINE void *lj_alloc_malloc(void *msp, size_t nsize)\n{\n  mstate ms = (mstate)msp;\n  void *mem;\n  size_t nb;\n  if (nsize <= MAX_SMALL_REQUEST) {\n    bindex_t idx;\n    binmap_t smallbits;\n    nb = (nsize < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(nsize);\n    idx = small_index(nb);\n    smallbits = ms->smallmap >> idx;\n\n    if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */\n      mchunkptr b, p;\n      idx += ~smallbits & 1;       /* Uses next bin if idx empty */\n      b = smallbin_at(ms, idx);\n      p = b->fd;\n      unlink_first_small_chunk(ms, b, p, idx);\n      set_inuse_and_pinuse(ms, p, small_index2size(idx));\n      mem = chunk2mem(p);\n      return mem;\n    } else if (nb > ms->dvsize) {\n      if (smallbits != 0) { /* Use chunk in next nonempty smallbin */\n\tmchunkptr b, p, r;\n\tsize_t rsize;\n\tbinmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));\n\tbindex_t i = lj_ffs(leftbits);\n\tb = smallbin_at(ms, i);\n\tp = b->fd;\n\tunlink_first_small_chunk(ms, b, p, i);\n\trsize = small_index2size(i) - nb;\n\t/* Fit here cannot be remainderless if 4byte sizes */\n\tif (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE) {\n\t  set_inuse_and_pinuse(ms, p, small_index2size(i));\n\t} else {\n\t  set_size_and_pinuse_of_inuse_chunk(ms, p, nb);\n\t  r = chunk_plus_offset(p, nb);\n\t  set_size_and_pinuse_of_free_chunk(r, rsize);\n\t  replace_dv(ms, r, rsize);\n\t}\n\tmem = chunk2mem(p);\n\treturn mem;\n      } else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) {\n\treturn mem;\n      }\n    }\n  } else if (nsize >= MAX_REQUEST) {\n    nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */\n  } else {\n    nb = pad_request(nsize);\n    if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) {\n      return mem;\n    }\n  }\n\n  if (nb <= ms->dvsize) {\n    size_t rsize = ms->dvsize - nb;\n    mchunkptr p = ms->dv;\n    if (rsize >= MIN_CHUNK_SIZE) { /* split dv */\n      mchunkptr r = ms->dv = chunk_plus_offset(p, nb);\n      ms->dvsize = rsize;\n      set_size_and_pinuse_of_free_chunk(r, rsize);\n      set_size_and_pinuse_of_inuse_chunk(ms, p, nb);\n    } else { /* exhaust dv */\n      size_t dvs = ms->dvsize;\n      ms->dvsize = 0;\n      ms->dv = 0;\n      set_inuse_and_pinuse(ms, p, dvs);\n    }\n    mem = chunk2mem(p);\n    return mem;\n  } else if (nb < ms->topsize) { /* Split top */\n    size_t rsize = ms->topsize -= nb;\n    mchunkptr p = ms->top;\n    mchunkptr r = ms->top = chunk_plus_offset(p, nb);\n    r->head = rsize | PINUSE_BIT;\n    set_size_and_pinuse_of_inuse_chunk(ms, p, nb);\n    mem = chunk2mem(p);\n    return mem;\n  }\n  return alloc_sys(ms, nb);\n}\n\nstatic LJ_NOINLINE void *lj_alloc_free(void *msp, void *ptr)\n{\n  if (ptr != 0) {\n    mchunkptr p = mem2chunk(ptr);\n    mstate fm = (mstate)msp;\n    size_t psize = chunksize(p);\n    mchunkptr next = chunk_plus_offset(p, psize);\n    if (!pinuse(p)) {\n      size_t prevsize = p->prev_foot;\n      if ((prevsize & IS_DIRECT_BIT) != 0) {\n\tprevsize &= ~IS_DIRECT_BIT;\n\tpsize += prevsize + DIRECT_FOOT_PAD;\n\tCALL_MUNMAP((char *)p - prevsize, psize);\n\treturn NULL;\n      } else {\n\tmchunkptr prev = chunk_minus_offset(p, prevsize);\n\tpsize += prevsize;\n\tp = prev;\n\t/* consolidate backward */\n\tif (p != fm->dv) {\n\t  unlink_chunk(fm, p, prevsize);\n\t} else if ((next->head & INUSE_BITS) == INUSE_BITS) {\n\t  fm->dvsize = psize;\n\t  set_free_with_pinuse(p, psize, next);\n\t  return NULL;\n\t}\n      }\n    }\n    if (!cinuse(next)) {  /* consolidate forward */\n      if (next == fm->top) {\n\tsize_t tsize = fm->topsize += psize;\n\tfm->top = p;\n\tp->head = tsize | PINUSE_BIT;\n\tif (p == fm->dv) {\n\t  fm->dv = 0;\n\t  fm->dvsize = 0;\n\t}\n\tif (tsize > fm->trim_check)\n\t  alloc_trim(fm, 0);\n\treturn NULL;\n      } else if (next == fm->dv) {\n\tsize_t dsize = fm->dvsize += psize;\n\tfm->dv = p;\n\tset_size_and_pinuse_of_free_chunk(p, dsize);\n\treturn NULL;\n      } else {\n\tsize_t nsize = chunksize(next);\n\tpsize += nsize;\n\tunlink_chunk(fm, next, nsize);\n\tset_size_and_pinuse_of_free_chunk(p, psize);\n\tif (p == fm->dv) {\n\t  fm->dvsize = psize;\n\t  return NULL;\n\t}\n      }\n    } else {\n      set_free_with_pinuse(p, psize, next);\n    }\n\n    if (is_small(psize)) {\n      insert_small_chunk(fm, p, psize);\n    } else {\n      tchunkptr tp = (tchunkptr)p;\n      insert_large_chunk(fm, tp, psize);\n      if (--fm->release_checks == 0)\n\trelease_unused_segments(fm);\n    }\n  }\n  return NULL;\n}\n\nstatic LJ_NOINLINE void *lj_alloc_realloc(void *msp, void *ptr, size_t nsize)\n{\n  if (nsize >= MAX_REQUEST) {\n    return NULL;\n  } else {\n    mstate m = (mstate)msp;\n    mchunkptr oldp = mem2chunk(ptr);\n    size_t oldsize = chunksize(oldp);\n    mchunkptr next = chunk_plus_offset(oldp, oldsize);\n    mchunkptr newp = 0;\n    size_t nb = request2size(nsize);\n\n    /* Try to either shrink or extend into top. Else malloc-copy-free */\n    if (is_direct(oldp)) {\n      newp = direct_resize(oldp, nb);  /* this may return NULL. */\n    } else if (oldsize >= nb) { /* already big enough */\n      size_t rsize = oldsize - nb;\n      newp = oldp;\n      if (rsize >= MIN_CHUNK_SIZE) {\n\tmchunkptr rem = chunk_plus_offset(newp, nb);\n\tset_inuse(m, newp, nb);\n\tset_inuse(m, rem, rsize);\n\tlj_alloc_free(m, chunk2mem(rem));\n      }\n    } else if (next == m->top && oldsize + m->topsize > nb) {\n      /* Expand into top */\n      size_t newsize = oldsize + m->topsize;\n      size_t newtopsize = newsize - nb;\n      mchunkptr newtop = chunk_plus_offset(oldp, nb);\n      set_inuse(m, oldp, nb);\n      newtop->head = newtopsize |PINUSE_BIT;\n      m->top = newtop;\n      m->topsize = newtopsize;\n      newp = oldp;\n    }\n\n    if (newp != 0) {\n      return chunk2mem(newp);\n    } else {\n      void *newmem = lj_alloc_malloc(m, nsize);\n      if (newmem != 0) {\n\tsize_t oc = oldsize - overhead_for(oldp);\n\tmemcpy(newmem, ptr, oc < nsize ? oc : nsize);\n\tlj_alloc_free(m, ptr);\n      }\n      return newmem;\n    }\n  }\n}\n\nvoid *lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize)\n{\n  (void)osize;\n  if (nsize == 0) {\n    return lj_alloc_free(msp, ptr);\n  } else if (ptr == NULL) {\n    return lj_alloc_malloc(msp, nsize);\n  } else {\n    return lj_alloc_realloc(msp, ptr, nsize);\n  }\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_alloc.h",
    "content": "/*\n** Bundled memory allocator.\n** Donated to the public domain.\n*/\n\n#ifndef _LJ_ALLOC_H\n#define _LJ_ALLOC_H\n\n#include \"lj_def.h\"\n\n#ifndef LUAJIT_USE_SYSMALLOC\nLJ_FUNC void *lj_alloc_create(void);\nLJ_FUNC void lj_alloc_destroy(void *msp);\nLJ_FUNC void *lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_api.c",
    "content": "/*\n** Public Lua/C API.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_api_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_func.h\"\n#include \"lj_udata.h\"\n#include \"lj_meta.h\"\n#include \"lj_state.h\"\n#include \"lj_bc.h\"\n#include \"lj_frame.h\"\n#include \"lj_trace.h\"\n#include \"lj_vm.h\"\n#include \"lj_strscan.h\"\n\n/* -- Common helper functions --------------------------------------------- */\n\n#define api_checknelems(L, n)\t\tapi_check(L, (n) <= (L->top - L->base))\n#define api_checkvalidindex(L, i)\tapi_check(L, (i) != niltv(L))\n\nstatic TValue *index2adr(lua_State *L, int idx)\n{\n  if (idx > 0) {\n    TValue *o = L->base + (idx - 1);\n    return o < L->top ? o : niltv(L);\n  } else if (idx > LUA_REGISTRYINDEX) {\n    api_check(L, idx != 0 && -idx <= L->top - L->base);\n    return L->top + idx;\n  } else if (idx == LUA_GLOBALSINDEX) {\n    TValue *o = &G(L)->tmptv;\n    settabV(L, o, tabref(L->env));\n    return o;\n  } else if (idx == LUA_REGISTRYINDEX) {\n    return registry(L);\n  } else {\n    GCfunc *fn = curr_func(L);\n    api_check(L, fn->c.gct == ~LJ_TFUNC && !isluafunc(fn));\n    if (idx == LUA_ENVIRONINDEX) {\n      TValue *o = &G(L)->tmptv;\n      settabV(L, o, tabref(fn->c.env));\n      return o;\n    } else {\n      idx = LUA_GLOBALSINDEX - idx;\n      return idx <= fn->c.nupvalues ? &fn->c.upvalue[idx-1] : niltv(L);\n    }\n  }\n}\n\nstatic TValue *stkindex2adr(lua_State *L, int idx)\n{\n  if (idx > 0) {\n    TValue *o = L->base + (idx - 1);\n    return o < L->top ? o : niltv(L);\n  } else {\n    api_check(L, idx != 0 && -idx <= L->top - L->base);\n    return L->top + idx;\n  }\n}\n\nstatic GCtab *getcurrenv(lua_State *L)\n{\n  GCfunc *fn = curr_func(L);\n  return fn->c.gct == ~LJ_TFUNC ? tabref(fn->c.env) : tabref(L->env);\n}\n\n/* -- Miscellaneous API functions ----------------------------------------- */\n\nLUA_API int lua_status(lua_State *L)\n{\n  return L->status;\n}\n\nLUA_API int lua_checkstack(lua_State *L, int size)\n{\n  if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) {\n    return 0;  /* Stack overflow. */\n  } else if (size > 0) {\n    lj_state_checkstack(L, (MSize)size);\n  }\n  return 1;\n}\n\nLUALIB_API void luaL_checkstack(lua_State *L, int size, const char *msg)\n{\n  if (!lua_checkstack(L, size))\n    lj_err_callerv(L, LJ_ERR_STKOVM, msg);\n}\n\nLUA_API void lua_xmove(lua_State *from, lua_State *to, int n)\n{\n  TValue *f, *t;\n  if (from == to) return;\n  api_checknelems(from, n);\n  api_check(from, G(from) == G(to));\n  lj_state_checkstack(to, (MSize)n);\n  f = from->top;\n  t = to->top = to->top + n;\n  while (--n >= 0) copyTV(to, --t, --f);\n  from->top = f;\n}\n\n/* -- Stack manipulation -------------------------------------------------- */\n\nLUA_API int lua_gettop(lua_State *L)\n{\n  return (int)(L->top - L->base);\n}\n\nLUA_API void lua_settop(lua_State *L, int idx)\n{\n  if (idx >= 0) {\n    api_check(L, idx <= tvref(L->maxstack) - L->base);\n    if (L->base + idx > L->top) {\n      if (L->base + idx >= tvref(L->maxstack))\n\tlj_state_growstack(L, (MSize)idx - (MSize)(L->top - L->base));\n      do { setnilV(L->top++); } while (L->top < L->base + idx);\n    } else {\n      L->top = L->base + idx;\n    }\n  } else {\n    api_check(L, -(idx+1) <= (L->top - L->base));\n    L->top += idx+1;  /* Shrinks top (idx < 0). */\n  }\n}\n\nLUA_API void lua_remove(lua_State *L, int idx)\n{\n  TValue *p = stkindex2adr(L, idx);\n  api_checkvalidindex(L, p);\n  while (++p < L->top) copyTV(L, p-1, p);\n  L->top--;\n}\n\nLUA_API void lua_insert(lua_State *L, int idx)\n{\n  TValue *q, *p = stkindex2adr(L, idx);\n  api_checkvalidindex(L, p);\n  for (q = L->top; q > p; q--) copyTV(L, q, q-1);\n  copyTV(L, p, L->top);\n}\n\nLUA_API void lua_replace(lua_State *L, int idx)\n{\n  api_checknelems(L, 1);\n  if (idx == LUA_GLOBALSINDEX) {\n    api_check(L, tvistab(L->top-1));\n    /* NOBARRIER: A thread (i.e. L) is never black. */\n    setgcref(L->env, obj2gco(tabV(L->top-1)));\n  } else if (idx == LUA_ENVIRONINDEX) {\n    GCfunc *fn = curr_func(L);\n    if (fn->c.gct != ~LJ_TFUNC)\n      lj_err_msg(L, LJ_ERR_NOENV);\n    api_check(L, tvistab(L->top-1));\n    setgcref(fn->c.env, obj2gco(tabV(L->top-1)));\n    lj_gc_barrier(L, fn, L->top-1);\n  } else {\n    TValue *o = index2adr(L, idx);\n    api_checkvalidindex(L, o);\n    copyTV(L, o, L->top-1);\n    if (idx < LUA_GLOBALSINDEX)  /* Need a barrier for upvalues. */\n      lj_gc_barrier(L, curr_func(L), L->top-1);\n  }\n  L->top--;\n}\n\nLUA_API void lua_pushvalue(lua_State *L, int idx)\n{\n  copyTV(L, L->top, index2adr(L, idx));\n  incr_top(L);\n}\n\n/* -- Stack getters ------------------------------------------------------- */\n\nLUA_API int lua_type(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  if (tvisnumber(o)) {\n    return LUA_TNUMBER;\n#if LJ_64\n  } else if (tvislightud(o)) {\n    return LUA_TLIGHTUSERDATA;\n#endif\n  } else if (o == niltv(L)) {\n    return LUA_TNONE;\n  } else {  /* Magic internal/external tag conversion. ORDER LJ_T */\n    uint32_t t = ~itype(o);\n#if LJ_64\n    int tt = (int)((U64x(75a06,98042110) >> 4*t) & 15u);\n#else\n    int tt = (int)(((t < 8 ? 0x98042110u : 0x75a06u) >> 4*(t&7)) & 15u);\n#endif\n    lua_assert(tt != LUA_TNIL || tvisnil(o));\n    return tt;\n  }\n}\n\nLUALIB_API void luaL_checktype(lua_State *L, int idx, int tt)\n{\n  if (lua_type(L, idx) != tt)\n    lj_err_argt(L, idx, tt);\n}\n\nLUALIB_API void luaL_checkany(lua_State *L, int idx)\n{\n  if (index2adr(L, idx) == niltv(L))\n    lj_err_arg(L, idx, LJ_ERR_NOVAL);\n}\n\nLUA_API const char *lua_typename(lua_State *L, int t)\n{\n  UNUSED(L);\n  return lj_obj_typename[t+1];\n}\n\nLUA_API int lua_iscfunction(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  return tvisfunc(o) && !isluafunc(funcV(o));\n}\n\nLUA_API int lua_isnumber(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  TValue tmp;\n  return (tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), &tmp)));\n}\n\nLUA_API int lua_isstring(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  return (tvisstr(o) || tvisnumber(o));\n}\n\nLUA_API int lua_isuserdata(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  return (tvisudata(o) || tvislightud(o));\n}\n\nLUA_API int lua_rawequal(lua_State *L, int idx1, int idx2)\n{\n  cTValue *o1 = index2adr(L, idx1);\n  cTValue *o2 = index2adr(L, idx2);\n  return (o1 == niltv(L) || o2 == niltv(L)) ? 0 : lj_obj_equal(o1, o2);\n}\n\nLUA_API int lua_equal(lua_State *L, int idx1, int idx2)\n{\n  cTValue *o1 = index2adr(L, idx1);\n  cTValue *o2 = index2adr(L, idx2);\n  if (tvisint(o1) && tvisint(o2)) {\n    return intV(o1) == intV(o2);\n  } else if (tvisnumber(o1) && tvisnumber(o2)) {\n    return numberVnum(o1) == numberVnum(o2);\n  } else if (itype(o1) != itype(o2)) {\n    return 0;\n  } else if (tvispri(o1)) {\n    return o1 != niltv(L) && o2 != niltv(L);\n#if LJ_64\n  } else if (tvislightud(o1)) {\n    return o1->u64 == o2->u64;\n#endif\n  } else if (gcrefeq(o1->gcr, o2->gcr)) {\n    return 1;\n  } else if (!tvistabud(o1)) {\n    return 0;\n  } else {\n    TValue *base = lj_meta_equal(L, gcV(o1), gcV(o2), 0);\n    if ((uintptr_t)base <= 1) {\n      return (int)(uintptr_t)base;\n    } else {\n      L->top = base+2;\n      lj_vm_call(L, base, 1+1);\n      L->top -= 2;\n      return tvistruecond(L->top+1);\n    }\n  }\n}\n\nLUA_API int lua_lessthan(lua_State *L, int idx1, int idx2)\n{\n  cTValue *o1 = index2adr(L, idx1);\n  cTValue *o2 = index2adr(L, idx2);\n  if (o1 == niltv(L) || o2 == niltv(L)) {\n    return 0;\n  } else if (tvisint(o1) && tvisint(o2)) {\n    return intV(o1) < intV(o2);\n  } else if (tvisnumber(o1) && tvisnumber(o2)) {\n    return numberVnum(o1) < numberVnum(o2);\n  } else {\n    TValue *base = lj_meta_comp(L, o1, o2, 0);\n    if ((uintptr_t)base <= 1) {\n      return (int)(uintptr_t)base;\n    } else {\n      L->top = base+2;\n      lj_vm_call(L, base, 1+1);\n      L->top -= 2;\n      return tvistruecond(L->top+1);\n    }\n  }\n}\n\nLUA_API lua_Number lua_tonumber(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  TValue tmp;\n  if (LJ_LIKELY(tvisnumber(o)))\n    return numberVnum(o);\n  else if (tvisstr(o) && lj_strscan_num(strV(o), &tmp))\n    return numV(&tmp);\n  else\n    return 0;\n}\n\nLUALIB_API lua_Number luaL_checknumber(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  TValue tmp;\n  if (LJ_LIKELY(tvisnumber(o)))\n    return numberVnum(o);\n  else if (!(tvisstr(o) && lj_strscan_num(strV(o), &tmp)))\n    lj_err_argt(L, idx, LUA_TNUMBER);\n  return numV(&tmp);\n}\n\nLUALIB_API lua_Number luaL_optnumber(lua_State *L, int idx, lua_Number def)\n{\n  cTValue *o = index2adr(L, idx);\n  TValue tmp;\n  if (LJ_LIKELY(tvisnumber(o)))\n    return numberVnum(o);\n  else if (tvisnil(o))\n    return def;\n  else if (!(tvisstr(o) && lj_strscan_num(strV(o), &tmp)))\n    lj_err_argt(L, idx, LUA_TNUMBER);\n  return numV(&tmp);\n}\n\nLUA_API lua_Integer lua_tointeger(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  TValue tmp;\n  lua_Number n;\n  if (LJ_LIKELY(tvisint(o))) {\n    return intV(o);\n  } else if (LJ_LIKELY(tvisnum(o))) {\n    n = numV(o);\n  } else {\n    if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp)))\n      return 0;\n    if (tvisint(&tmp))\n      return (lua_Integer)intV(&tmp);\n    n = numV(&tmp);\n  }\n#if LJ_64\n  return (lua_Integer)n;\n#else\n  return lj_num2int(n);\n#endif\n}\n\nLUALIB_API lua_Integer luaL_checkinteger(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  TValue tmp;\n  lua_Number n;\n  if (LJ_LIKELY(tvisint(o))) {\n    return intV(o);\n  } else if (LJ_LIKELY(tvisnum(o))) {\n    n = numV(o);\n  } else {\n    if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp)))\n      lj_err_argt(L, idx, LUA_TNUMBER);\n    if (tvisint(&tmp))\n      return (lua_Integer)intV(&tmp);\n    n = numV(&tmp);\n  }\n#if LJ_64\n  return (lua_Integer)n;\n#else\n  return lj_num2int(n);\n#endif\n}\n\nLUALIB_API lua_Integer luaL_optinteger(lua_State *L, int idx, lua_Integer def)\n{\n  cTValue *o = index2adr(L, idx);\n  TValue tmp;\n  lua_Number n;\n  if (LJ_LIKELY(tvisint(o))) {\n    return intV(o);\n  } else if (LJ_LIKELY(tvisnum(o))) {\n    n = numV(o);\n  } else if (tvisnil(o)) {\n    return def;\n  } else {\n    if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp)))\n      lj_err_argt(L, idx, LUA_TNUMBER);\n    if (tvisint(&tmp))\n      return (lua_Integer)intV(&tmp);\n    n = numV(&tmp);\n  }\n#if LJ_64\n  return (lua_Integer)n;\n#else\n  return lj_num2int(n);\n#endif\n}\n\nLUA_API int lua_toboolean(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  return tvistruecond(o);\n}\n\nLUA_API const char *lua_tolstring(lua_State *L, int idx, size_t *len)\n{\n  TValue *o = index2adr(L, idx);\n  GCstr *s;\n  if (LJ_LIKELY(tvisstr(o))) {\n    s = strV(o);\n  } else if (tvisnumber(o)) {\n    lj_gc_check(L);\n    o = index2adr(L, idx);  /* GC may move the stack. */\n    s = lj_str_fromnumber(L, o);\n    setstrV(L, o, s);\n  } else {\n    if (len != NULL) *len = 0;\n    return NULL;\n  }\n  if (len != NULL) *len = s->len;\n  return strdata(s);\n}\n\nLUALIB_API const char *luaL_checklstring(lua_State *L, int idx, size_t *len)\n{\n  TValue *o = index2adr(L, idx);\n  GCstr *s;\n  if (LJ_LIKELY(tvisstr(o))) {\n    s = strV(o);\n  } else if (tvisnumber(o)) {\n    lj_gc_check(L);\n    o = index2adr(L, idx);  /* GC may move the stack. */\n    s = lj_str_fromnumber(L, o);\n    setstrV(L, o, s);\n  } else {\n    lj_err_argt(L, idx, LUA_TSTRING);\n  }\n  if (len != NULL) *len = s->len;\n  return strdata(s);\n}\n\nLUALIB_API const char *luaL_optlstring(lua_State *L, int idx,\n\t\t\t\t       const char *def, size_t *len)\n{\n  TValue *o = index2adr(L, idx);\n  GCstr *s;\n  if (LJ_LIKELY(tvisstr(o))) {\n    s = strV(o);\n  } else if (tvisnil(o)) {\n    if (len != NULL) *len = def ? strlen(def) : 0;\n    return def;\n  } else if (tvisnumber(o)) {\n    lj_gc_check(L);\n    o = index2adr(L, idx);  /* GC may move the stack. */\n    s = lj_str_fromnumber(L, o);\n    setstrV(L, o, s);\n  } else {\n    lj_err_argt(L, idx, LUA_TSTRING);\n  }\n  if (len != NULL) *len = s->len;\n  return strdata(s);\n}\n\nLUALIB_API int luaL_checkoption(lua_State *L, int idx, const char *def,\n\t\t\t\tconst char *const lst[])\n{\n  ptrdiff_t i;\n  const char *s = lua_tolstring(L, idx, NULL);\n  if (s == NULL && (s = def) == NULL)\n    lj_err_argt(L, idx, LUA_TSTRING);\n  for (i = 0; lst[i]; i++)\n    if (strcmp(lst[i], s) == 0)\n      return (int)i;\n  lj_err_argv(L, idx, LJ_ERR_INVOPTM, s);\n}\n\nLUA_API size_t lua_objlen(lua_State *L, int idx)\n{\n  TValue *o = index2adr(L, idx);\n  if (tvisstr(o)) {\n    return strV(o)->len;\n  } else if (tvistab(o)) {\n    return (size_t)lj_tab_len(tabV(o));\n  } else if (tvisudata(o)) {\n    return udataV(o)->len;\n  } else if (tvisnumber(o)) {\n    GCstr *s = lj_str_fromnumber(L, o);\n    setstrV(L, o, s);\n    return s->len;\n  } else {\n    return 0;\n  }\n}\n\nLUA_API lua_CFunction lua_tocfunction(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  if (tvisfunc(o)) {\n    BCOp op = bc_op(*mref(funcV(o)->c.pc, BCIns));\n    if (op == BC_FUNCC || op == BC_FUNCCW)\n      return funcV(o)->c.f;\n  }\n  return NULL;\n}\n\nLUA_API void *lua_touserdata(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  if (tvisudata(o))\n    return uddata(udataV(o));\n  else if (tvislightud(o))\n    return lightudV(o);\n  else\n    return NULL;\n}\n\nLUA_API lua_State *lua_tothread(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  return (!tvisthread(o)) ? NULL : threadV(o);\n}\n\nLUA_API const void *lua_topointer(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  if (tvisudata(o))\n    return uddata(udataV(o));\n  else if (tvislightud(o))\n    return lightudV(o);\n  else if (tviscdata(o))\n    return cdataptr(cdataV(o));\n  else if (tvisgcv(o))\n    return gcV(o);\n  else\n    return NULL;\n}\n\n/* -- Stack setters (object creation) ------------------------------------- */\n\nLUA_API void lua_pushnil(lua_State *L)\n{\n  setnilV(L->top);\n  incr_top(L);\n}\n\nLUA_API void lua_pushnumber(lua_State *L, lua_Number n)\n{\n  setnumV(L->top, n);\n  if (LJ_UNLIKELY(tvisnan(L->top)))\n    setnanV(L->top);  /* Canonicalize injected NaNs. */\n  incr_top(L);\n}\n\nLUA_API void lua_pushinteger(lua_State *L, lua_Integer n)\n{\n  setintptrV(L->top, n);\n  incr_top(L);\n}\n\nLUA_API void lua_pushlstring(lua_State *L, const char *str, size_t len)\n{\n  GCstr *s;\n  lj_gc_check(L);\n  s = lj_str_new(L, str, len);\n  setstrV(L, L->top, s);\n  incr_top(L);\n}\n\nLUA_API void lua_pushstring(lua_State *L, const char *str)\n{\n  if (str == NULL) {\n    setnilV(L->top);\n  } else {\n    GCstr *s;\n    lj_gc_check(L);\n    s = lj_str_newz(L, str);\n    setstrV(L, L->top, s);\n  }\n  incr_top(L);\n}\n\nLUA_API const char *lua_pushvfstring(lua_State *L, const char *fmt,\n\t\t\t\t     va_list argp)\n{\n  lj_gc_check(L);\n  return lj_str_pushvf(L, fmt, argp);\n}\n\nLUA_API const char *lua_pushfstring(lua_State *L, const char *fmt, ...)\n{\n  const char *ret;\n  va_list argp;\n  lj_gc_check(L);\n  va_start(argp, fmt);\n  ret = lj_str_pushvf(L, fmt, argp);\n  va_end(argp);\n  return ret;\n}\n\nLUA_API void lua_pushcclosure(lua_State *L, lua_CFunction f, int n)\n{\n  GCfunc *fn;\n  lj_gc_check(L);\n  api_checknelems(L, n);\n  fn = lj_func_newC(L, (MSize)n, getcurrenv(L));\n  fn->c.f = f;\n  L->top -= n;\n  while (n--)\n    copyTV(L, &fn->c.upvalue[n], L->top+n);\n  setfuncV(L, L->top, fn);\n  lua_assert(iswhite(obj2gco(fn)));\n  incr_top(L);\n}\n\nLUA_API void lua_pushboolean(lua_State *L, int b)\n{\n  setboolV(L->top, (b != 0));\n  incr_top(L);\n}\n\nLUA_API void lua_pushlightuserdata(lua_State *L, void *p)\n{\n  setlightudV(L->top, checklightudptr(L, p));\n  incr_top(L);\n}\n\nLUA_API void lua_createtable(lua_State *L, int narray, int nrec)\n{\n  GCtab *t;\n  lj_gc_check(L);\n  t = lj_tab_new(L, (uint32_t)(narray > 0 ? narray+1 : 0), hsize2hbits(nrec));\n  settabV(L, L->top, t);\n  incr_top(L);\n}\n\nLUALIB_API int luaL_newmetatable(lua_State *L, const char *tname)\n{\n  GCtab *regt = tabV(registry(L));\n  TValue *tv = lj_tab_setstr(L, regt, lj_str_newz(L, tname));\n  if (tvisnil(tv)) {\n    GCtab *mt = lj_tab_new(L, 0, 1);\n    settabV(L, tv, mt);\n    settabV(L, L->top++, mt);\n    lj_gc_anybarriert(L, regt);\n    return 1;\n  } else {\n    copyTV(L, L->top++, tv);\n    return 0;\n  }\n}\n\nLUA_API int lua_pushthread(lua_State *L)\n{\n  setthreadV(L, L->top, L);\n  incr_top(L);\n  return (mainthread(G(L)) == L);\n}\n\nLUA_API lua_State *lua_newthread(lua_State *L)\n{\n  lua_State *L1;\n  lj_gc_check(L);\n  L1 = lj_state_new(L);\n  setthreadV(L, L->top, L1);\n  incr_top(L);\n  return L1;\n}\n\nLUA_API void *lua_newuserdata(lua_State *L, size_t size)\n{\n  GCudata *ud;\n  lj_gc_check(L);\n  if (size > LJ_MAX_UDATA)\n    lj_err_msg(L, LJ_ERR_UDATAOV);\n  ud = lj_udata_new(L, (MSize)size, getcurrenv(L));\n  setudataV(L, L->top, ud);\n  incr_top(L);\n  return uddata(ud);\n}\n\nLUA_API void lua_concat(lua_State *L, int n)\n{\n  api_checknelems(L, n);\n  if (n >= 2) {\n    n--;\n    do {\n      TValue *top = lj_meta_cat(L, L->top-1, -n);\n      if (top == NULL) {\n\tL->top -= n;\n\tbreak;\n      }\n      n -= (int)(L->top - top);\n      L->top = top+2;\n      lj_vm_call(L, top, 1+1);\n      L->top--;\n      copyTV(L, L->top-1, L->top);\n    } while (--n > 0);\n  } else if (n == 0) {  /* Push empty string. */\n    setstrV(L, L->top, &G(L)->strempty);\n    incr_top(L);\n  }\n  /* else n == 1: nothing to do. */\n}\n\n/* -- Object getters ------------------------------------------------------ */\n\nLUA_API void lua_gettable(lua_State *L, int idx)\n{\n  cTValue *v, *t = index2adr(L, idx);\n  api_checkvalidindex(L, t);\n  v = lj_meta_tget(L, t, L->top-1);\n  if (v == NULL) {\n    L->top += 2;\n    lj_vm_call(L, L->top-2, 1+1);\n    L->top -= 2;\n    v = L->top+1;\n  }\n  copyTV(L, L->top-1, v);\n}\n\nLUA_API void lua_getfield(lua_State *L, int idx, const char *k)\n{\n  cTValue *v, *t = index2adr(L, idx);\n  TValue key;\n  api_checkvalidindex(L, t);\n  setstrV(L, &key, lj_str_newz(L, k));\n  v = lj_meta_tget(L, t, &key);\n  if (v == NULL) {\n    L->top += 2;\n    lj_vm_call(L, L->top-2, 1+1);\n    L->top -= 2;\n    v = L->top+1;\n  }\n  copyTV(L, L->top, v);\n  incr_top(L);\n}\n\nLUA_API void lua_rawget(lua_State *L, int idx)\n{\n  cTValue *t = index2adr(L, idx);\n  api_check(L, tvistab(t));\n  copyTV(L, L->top-1, lj_tab_get(L, tabV(t), L->top-1));\n}\n\nLUA_API void lua_rawgeti(lua_State *L, int idx, int n)\n{\n  cTValue *v, *t = index2adr(L, idx);\n  api_check(L, tvistab(t));\n  v = lj_tab_getint(tabV(t), n);\n  if (v) {\n    copyTV(L, L->top, v);\n  } else {\n    setnilV(L->top);\n  }\n  incr_top(L);\n}\n\nLUA_API int lua_getmetatable(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  GCtab *mt = NULL;\n  if (tvistab(o))\n    mt = tabref(tabV(o)->metatable);\n  else if (tvisudata(o))\n    mt = tabref(udataV(o)->metatable);\n  else\n    mt = tabref(basemt_obj(G(L), o));\n  if (mt == NULL)\n    return 0;\n  settabV(L, L->top, mt);\n  incr_top(L);\n  return 1;\n}\n\nLUALIB_API int luaL_getmetafield(lua_State *L, int idx, const char *field)\n{\n  if (lua_getmetatable(L, idx)) {\n    cTValue *tv = lj_tab_getstr(tabV(L->top-1), lj_str_newz(L, field));\n    if (tv && !tvisnil(tv)) {\n      copyTV(L, L->top-1, tv);\n      return 1;\n    }\n    L->top--;\n  }\n  return 0;\n}\n\nLUA_API void lua_getfenv(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  api_checkvalidindex(L, o);\n  if (tvisfunc(o)) {\n    settabV(L, L->top, tabref(funcV(o)->c.env));\n  } else if (tvisudata(o)) {\n    settabV(L, L->top, tabref(udataV(o)->env));\n  } else if (tvisthread(o)) {\n    settabV(L, L->top, tabref(threadV(o)->env));\n  } else {\n    setnilV(L->top);\n  }\n  incr_top(L);\n}\n\nLUA_API int lua_next(lua_State *L, int idx)\n{\n  cTValue *t = index2adr(L, idx);\n  int more;\n  api_check(L, tvistab(t));\n  more = lj_tab_next(L, tabV(t), L->top-1);\n  if (more) {\n    incr_top(L);  /* Return new key and value slot. */\n  } else {  /* End of traversal. */\n    L->top--;  /* Remove key slot. */\n  }\n  return more;\n}\n\nLUA_API const char *lua_getupvalue(lua_State *L, int idx, int n)\n{\n  TValue *val;\n  const char *name = lj_debug_uvnamev(index2adr(L, idx), (uint32_t)(n-1), &val);\n  if (name) {\n    copyTV(L, L->top, val);\n    incr_top(L);\n  }\n  return name;\n}\n\nLUA_API void *lua_upvalueid(lua_State *L, int idx, int n)\n{\n  GCfunc *fn = funcV(index2adr(L, idx));\n  n--;\n  api_check(L, (uint32_t)n < fn->l.nupvalues);\n  return isluafunc(fn) ? (void *)gcref(fn->l.uvptr[n]) :\n\t\t\t (void *)&fn->c.upvalue[n];\n}\n\nLUA_API void lua_upvaluejoin(lua_State *L, int idx1, int n1, int idx2, int n2)\n{\n  GCfunc *fn1 = funcV(index2adr(L, idx1));\n  GCfunc *fn2 = funcV(index2adr(L, idx2));\n  n1--; n2--;\n  api_check(L, isluafunc(fn1) && (uint32_t)n1 < fn1->l.nupvalues);\n  api_check(L, isluafunc(fn2) && (uint32_t)n2 < fn2->l.nupvalues);\n  setgcrefr(fn1->l.uvptr[n1], fn2->l.uvptr[n2]);\n  lj_gc_objbarrier(L, fn1, gcref(fn1->l.uvptr[n1]));\n}\n\nLUALIB_API void *luaL_checkudata(lua_State *L, int idx, const char *tname)\n{\n  cTValue *o = index2adr(L, idx);\n  if (tvisudata(o)) {\n    GCudata *ud = udataV(o);\n    cTValue *tv = lj_tab_getstr(tabV(registry(L)), lj_str_newz(L, tname));\n    if (tv && tvistab(tv) && tabV(tv) == tabref(ud->metatable))\n      return uddata(ud);\n  }\n  lj_err_argtype(L, idx, tname);\n  return NULL;  /* unreachable */\n}\n\n/* -- Object setters ------------------------------------------------------ */\n\nLUA_API void lua_settable(lua_State *L, int idx)\n{\n  TValue *o;\n  cTValue *t = index2adr(L, idx);\n  api_checknelems(L, 2);\n  api_checkvalidindex(L, t);\n  o = lj_meta_tset(L, t, L->top-2);\n  if (o) {\n    /* NOBARRIER: lj_meta_tset ensures the table is not black. */\n    copyTV(L, o, L->top-1);\n    L->top -= 2;\n  } else {\n    L->top += 3;\n    copyTV(L, L->top-1, L->top-6);\n    lj_vm_call(L, L->top-3, 0+1);\n    L->top -= 3;\n  }\n}\n\nLUA_API void lua_setfield(lua_State *L, int idx, const char *k)\n{\n  TValue *o;\n  TValue key;\n  cTValue *t = index2adr(L, idx);\n  api_checknelems(L, 1);\n  api_checkvalidindex(L, t);\n  setstrV(L, &key, lj_str_newz(L, k));\n  o = lj_meta_tset(L, t, &key);\n  if (o) {\n    L->top--;\n    /* NOBARRIER: lj_meta_tset ensures the table is not black. */\n    copyTV(L, o, L->top);\n  } else {\n    L->top += 3;\n    copyTV(L, L->top-1, L->top-6);\n    lj_vm_call(L, L->top-3, 0+1);\n    L->top -= 2;\n  }\n}\n\nLUA_API void lua_rawset(lua_State *L, int idx)\n{\n  GCtab *t = tabV(index2adr(L, idx));\n  TValue *dst, *key;\n  api_checknelems(L, 2);\n  key = L->top-2;\n  dst = lj_tab_set(L, t, key);\n  copyTV(L, dst, key+1);\n  lj_gc_anybarriert(L, t);\n  L->top = key;\n}\n\nLUA_API void lua_rawseti(lua_State *L, int idx, int n)\n{\n  GCtab *t = tabV(index2adr(L, idx));\n  TValue *dst, *src;\n  api_checknelems(L, 1);\n  dst = lj_tab_setint(L, t, n);\n  src = L->top-1;\n  copyTV(L, dst, src);\n  lj_gc_barriert(L, t, dst);\n  L->top = src;\n}\n\nLUA_API int lua_setmetatable(lua_State *L, int idx)\n{\n  global_State *g;\n  GCtab *mt;\n  cTValue *o = index2adr(L, idx);\n  api_checknelems(L, 1);\n  api_checkvalidindex(L, o);\n  if (tvisnil(L->top-1)) {\n    mt = NULL;\n  } else {\n    api_check(L, tvistab(L->top-1));\n    mt = tabV(L->top-1);\n  }\n  g = G(L);\n  if (tvistab(o)) {\n    setgcref(tabV(o)->metatable, obj2gco(mt));\n    if (mt)\n      lj_gc_objbarriert(L, tabV(o), mt);\n  } else if (tvisudata(o)) {\n    setgcref(udataV(o)->metatable, obj2gco(mt));\n    if (mt)\n      lj_gc_objbarrier(L, udataV(o), mt);\n  } else {\n    /* Flush cache, since traces specialize to basemt. But not during __gc. */\n    if (lj_trace_flushall(L))\n      lj_err_caller(L, LJ_ERR_NOGCMM);\n    if (tvisbool(o)) {\n      /* NOBARRIER: basemt is a GC root. */\n      setgcref(basemt_it(g, LJ_TTRUE), obj2gco(mt));\n      setgcref(basemt_it(g, LJ_TFALSE), obj2gco(mt));\n    } else {\n      /* NOBARRIER: basemt is a GC root. */\n      setgcref(basemt_obj(g, o), obj2gco(mt));\n    }\n  }\n  L->top--;\n  return 1;\n}\n\nLUA_API int lua_setfenv(lua_State *L, int idx)\n{\n  cTValue *o = index2adr(L, idx);\n  GCtab *t;\n  api_checknelems(L, 1);\n  api_checkvalidindex(L, o);\n  api_check(L, tvistab(L->top-1));\n  t = tabV(L->top-1);\n  if (tvisfunc(o)) {\n    setgcref(funcV(o)->c.env, obj2gco(t));\n  } else if (tvisudata(o)) {\n    setgcref(udataV(o)->env, obj2gco(t));\n  } else if (tvisthread(o)) {\n    setgcref(threadV(o)->env, obj2gco(t));\n  } else {\n    L->top--;\n    return 0;\n  }\n  lj_gc_objbarrier(L, gcV(o), t);\n  L->top--;\n  return 1;\n}\n\nLUA_API const char *lua_setupvalue(lua_State *L, int idx, int n)\n{\n  cTValue *f = index2adr(L, idx);\n  TValue *val;\n  const char *name;\n  api_checknelems(L, 1);\n  name = lj_debug_uvnamev(f, (uint32_t)(n-1), &val);\n  if (name) {\n    L->top--;\n    copyTV(L, val, L->top);\n    lj_gc_barrier(L, funcV(f), L->top);\n  }\n  return name;\n}\n\n/* -- Calls --------------------------------------------------------------- */\n\nLUA_API void lua_call(lua_State *L, int nargs, int nresults)\n{\n  api_check(L, L->status == 0 || L->status == LUA_ERRERR);\n  api_checknelems(L, nargs+1);\n  lj_vm_call(L, L->top - nargs, nresults+1);\n}\n\nLUA_API int lua_pcall(lua_State *L, int nargs, int nresults, int errfunc)\n{\n  global_State *g = G(L);\n  uint8_t oldh = hook_save(g);\n  ptrdiff_t ef;\n  int status;\n  api_check(L, L->status == 0 || L->status == LUA_ERRERR);\n  api_checknelems(L, nargs+1);\n  if (errfunc == 0) {\n    ef = 0;\n  } else {\n    cTValue *o = stkindex2adr(L, errfunc);\n    api_checkvalidindex(L, o);\n    ef = savestack(L, o);\n  }\n  status = lj_vm_pcall(L, L->top - nargs, nresults+1, ef);\n  if (status) hook_restore(g, oldh);\n  return status;\n}\n\nstatic TValue *cpcall(lua_State *L, lua_CFunction func, void *ud)\n{\n  GCfunc *fn = lj_func_newC(L, 0, getcurrenv(L));\n  fn->c.f = func;\n  setfuncV(L, L->top, fn);\n  setlightudV(L->top+1, checklightudptr(L, ud));\n  cframe_nres(L->cframe) = 1+0;  /* Zero results. */\n  L->top += 2;\n  return L->top-1;  /* Now call the newly allocated C function. */\n}\n\nLUA_API int lua_cpcall(lua_State *L, lua_CFunction func, void *ud)\n{\n  global_State *g = G(L);\n  uint8_t oldh = hook_save(g);\n  int status;\n  api_check(L, L->status == 0 || L->status == LUA_ERRERR);\n  status = lj_vm_cpcall(L, func, ud, cpcall);\n  if (status) hook_restore(g, oldh);\n  return status;\n}\n\nLUALIB_API int luaL_callmeta(lua_State *L, int idx, const char *field)\n{\n  if (luaL_getmetafield(L, idx, field)) {\n    TValue *base = L->top--;\n    copyTV(L, base, index2adr(L, idx));\n    L->top = base+1;\n    lj_vm_call(L, base, 1+1);\n    return 1;\n  }\n  return 0;\n}\n\n/* -- Coroutine yield and resume ------------------------------------------ */\n\nLUA_API int lua_yield(lua_State *L, int nresults)\n{\n  void *cf = L->cframe;\n  global_State *g = G(L);\n  if (cframe_canyield(cf)) {\n    cf = cframe_raw(cf);\n    if (!hook_active(g)) {  /* Regular yield: move results down if needed. */\n      cTValue *f = L->top - nresults;\n      if (f > L->base) {\n\tTValue *t = L->base;\n\twhile (--nresults >= 0) copyTV(L, t++, f++);\n\tL->top = t;\n      }\n      L->cframe = NULL;\n      L->status = LUA_YIELD;\n      return -1;\n    } else {  /* Yield from hook: add a pseudo-frame. */\n      TValue *top = L->top;\n      hook_leave(g);\n      top->u64 = cframe_multres(cf);\n      setcont(top+1, lj_cont_hook);\n      setframe_pc(top+1, cframe_pc(cf)-1);\n      setframe_gc(top+2, obj2gco(L));\n      setframe_ftsz(top+2, (int)((char *)(top+3)-(char *)L->base)+FRAME_CONT);\n      L->top = L->base = top+3;\n#if LJ_TARGET_X64\n      lj_err_throw(L, LUA_YIELD);\n#else\n      L->cframe = NULL;\n      L->status = LUA_YIELD;\n      lj_vm_unwind_c(cf, LUA_YIELD);\n#endif\n    }\n  }\n  lj_err_msg(L, LJ_ERR_CYIELD);\n  return 0;  /* unreachable */\n}\n\nLUA_API int lua_resume(lua_State *L, int nargs)\n{\n  if (L->cframe == NULL && L->status <= LUA_YIELD)\n    return lj_vm_resume(L, L->top - nargs, 0, 0);\n  L->top = L->base;\n  setstrV(L, L->top, lj_err_str(L, LJ_ERR_COSUSP));\n  incr_top(L);\n  return LUA_ERRRUN;\n}\n\n/* -- GC and memory management -------------------------------------------- */\n\nLUA_API int lua_gc(lua_State *L, int what, int data)\n{\n  global_State *g = G(L);\n  int res = 0;\n  switch (what) {\n  case LUA_GCSTOP:\n    g->gc.threshold = LJ_MAX_MEM;\n    break;\n  case LUA_GCRESTART:\n    g->gc.threshold = data == -1 ? (g->gc.total/100)*g->gc.pause : g->gc.total;\n    break;\n  case LUA_GCCOLLECT:\n    lj_gc_fullgc(L);\n    break;\n  case LUA_GCCOUNT:\n    res = (int)(g->gc.total >> 10);\n    break;\n  case LUA_GCCOUNTB:\n    res = (int)(g->gc.total & 0x3ff);\n    break;\n  case LUA_GCSTEP: {\n    MSize a = (MSize)data << 10;\n    g->gc.threshold = (a <= g->gc.total) ? (g->gc.total - a) : 0;\n    while (g->gc.total >= g->gc.threshold)\n      if (lj_gc_step(L)) {\n\tres = 1;\n\tbreak;\n      }\n    break;\n  }\n  case LUA_GCSETPAUSE:\n    res = (int)(g->gc.pause);\n    g->gc.pause = (MSize)data;\n    break;\n  case LUA_GCSETSTEPMUL:\n    res = (int)(g->gc.stepmul);\n    g->gc.stepmul = (MSize)data;\n    break;\n  default:\n    res = -1;  /* Invalid option. */\n  }\n  return res;\n}\n\nLUA_API lua_Alloc lua_getallocf(lua_State *L, void **ud)\n{\n  global_State *g = G(L);\n  if (ud) *ud = g->allocd;\n  return g->allocf;\n}\n\nLUA_API void lua_setallocf(lua_State *L, lua_Alloc f, void *ud)\n{\n  global_State *g = G(L);\n  g->allocd = ud;\n  g->allocf = f;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_arch.h",
    "content": "/*\n** Target architecture selection.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_ARCH_H\n#define _LJ_ARCH_H\n\n#include \"lua.h\"\n\n/* Target endianess. */\n#define LUAJIT_LE\t0\n#define LUAJIT_BE\t1\n\n/* Target architectures. */\n#define LUAJIT_ARCH_X86\t\t1\n#define LUAJIT_ARCH_x86\t\t1\n#define LUAJIT_ARCH_X64\t\t2\n#define LUAJIT_ARCH_x64\t\t2\n#define LUAJIT_ARCH_ARM\t\t3\n#define LUAJIT_ARCH_arm\t\t3\n#define LUAJIT_ARCH_PPC\t\t4\n#define LUAJIT_ARCH_ppc\t\t4\n#define LUAJIT_ARCH_PPCSPE\t5\n#define LUAJIT_ARCH_ppcspe\t5\n#define LUAJIT_ARCH_MIPS\t6\n#define LUAJIT_ARCH_mips\t6\n\n/* Target OS. */\n#define LUAJIT_OS_OTHER\t\t0\n#define LUAJIT_OS_WINDOWS\t1\n#define LUAJIT_OS_LINUX\t\t2\n#define LUAJIT_OS_OSX\t\t3\n#define LUAJIT_OS_BSD\t\t4\n#define LUAJIT_OS_POSIX\t\t5\n\n/* Select native target if no target defined. */\n#ifndef LUAJIT_TARGET\n\n#if defined(__i386) || defined(__i386__) || defined(_M_IX86)\n#define LUAJIT_TARGET\tLUAJIT_ARCH_X86\n#elif defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)\n#define LUAJIT_TARGET\tLUAJIT_ARCH_X64\n#elif defined(__arm__) || defined(__arm) || defined(__ARM__) || defined(__ARM)\n#define LUAJIT_TARGET\tLUAJIT_ARCH_ARM\n#elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC)\n#ifdef __NO_FPRS__\n#define LUAJIT_TARGET\tLUAJIT_ARCH_PPCSPE\n#else\n#define LUAJIT_TARGET\tLUAJIT_ARCH_PPC\n#endif\n#elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS)\n#define LUAJIT_TARGET\tLUAJIT_ARCH_MIPS\n#else\n#error \"No support for this architecture (yet)\"\n#endif\n\n#endif\n\n/* Select native OS if no target OS defined. */\n#ifndef LUAJIT_OS\n\n#if defined(_WIN32) && !defined(_XBOX_VER)\n#define LUAJIT_OS\tLUAJIT_OS_WINDOWS\n#elif defined(__linux__)\n#define LUAJIT_OS\tLUAJIT_OS_LINUX\n#elif defined(__MACH__) && defined(__APPLE__)\n#define LUAJIT_OS\tLUAJIT_OS_OSX\n#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \\\n      defined(__NetBSD__) || defined(__OpenBSD__)\n#define LUAJIT_OS\tLUAJIT_OS_BSD\n#elif (defined(__sun__) && defined(__svr4__)) || defined(__CYGWIN__)\n#define LUAJIT_OS\tLUAJIT_OS_POSIX\n#else\n#define LUAJIT_OS\tLUAJIT_OS_OTHER\n#endif\n\n#endif\n\n/* Set target OS properties. */\n#if LUAJIT_OS == LUAJIT_OS_WINDOWS\n#define LJ_OS_NAME\t\"Windows\"\n#elif LUAJIT_OS == LUAJIT_OS_LINUX\n#define LJ_OS_NAME\t\"Linux\"\n#elif LUAJIT_OS == LUAJIT_OS_OSX\n#define LJ_OS_NAME\t\"OSX\"\n#elif LUAJIT_OS == LUAJIT_OS_BSD\n#define LJ_OS_NAME\t\"BSD\"\n#elif LUAJIT_OS == LUAJIT_OS_POSIX\n#define LJ_OS_NAME\t\"POSIX\"\n#else\n#define LJ_OS_NAME\t\"Other\"\n#endif\n\n#define LJ_TARGET_WINDOWS\t(LUAJIT_OS == LUAJIT_OS_WINDOWS)\n#define LJ_TARGET_LINUX\t\t(LUAJIT_OS == LUAJIT_OS_LINUX)\n#define LJ_TARGET_OSX\t\t(LUAJIT_OS == LUAJIT_OS_OSX)\n#define LJ_TARGET_IOS\t\t(LJ_TARGET_OSX && LUAJIT_TARGET == LUAJIT_ARCH_ARM)\n#define LJ_TARGET_POSIX\t\t(LUAJIT_OS > LUAJIT_OS_WINDOWS)\n#define LJ_TARGET_DLOPEN\tLJ_TARGET_POSIX\n\n#ifdef __CELLOS_LV2__\n#define LJ_TARGET_PS3\t\t1\n#define LJ_TARGET_CONSOLE\t1\n#endif\n\n#if _XBOX_VER >= 200\n#define LJ_TARGET_XBOX360\t1\n#define LJ_TARGET_CONSOLE\t1\n#endif\n\n#define LJ_NUMMODE_SINGLE\t0\t/* Single-number mode only. */\n#define LJ_NUMMODE_SINGLE_DUAL\t1\t/* Default to single-number mode. */\n#define LJ_NUMMODE_DUAL\t\t2\t/* Dual-number mode only. */\n#define LJ_NUMMODE_DUAL_SINGLE\t3\t/* Default to dual-number mode. */\n\n/* Set target architecture properties. */\n#if LUAJIT_TARGET == LUAJIT_ARCH_X86\n\n#define LJ_ARCH_NAME\t\t\"x86\"\n#define LJ_ARCH_BITS\t\t32\n#define LJ_ARCH_ENDIAN\t\tLUAJIT_LE\n#if LJ_TARGET_WINDOWS || __CYGWIN__\n#define LJ_ABI_WIN\t\t1\n#else\n#define LJ_ABI_WIN\t\t0\n#endif\n#define LJ_TARGET_X86\t\t1\n#define LJ_TARGET_X86ORX64\t1\n#define LJ_TARGET_EHRETREG\t0\n#define LJ_TARGET_MASKSHIFT\t1\n#define LJ_TARGET_MASKROT\t1\n#define LJ_TARGET_UNALIGNED\t1\n#define LJ_ARCH_NUMMODE\t\tLJ_NUMMODE_SINGLE_DUAL\n\n#elif LUAJIT_TARGET == LUAJIT_ARCH_X64\n\n#define LJ_ARCH_NAME\t\t\"x64\"\n#define LJ_ARCH_BITS\t\t64\n#define LJ_ARCH_ENDIAN\t\tLUAJIT_LE\n#define LJ_ABI_WIN\t\tLJ_TARGET_WINDOWS\n#define LJ_TARGET_X64\t\t1\n#define LJ_TARGET_X86ORX64\t1\n#define LJ_TARGET_EHRETREG\t0\n#define LJ_TARGET_JUMPRANGE\t31\t/* +-2^31 = +-2GB */\n#define LJ_TARGET_MASKSHIFT\t1\n#define LJ_TARGET_MASKROT\t1\n#define LJ_TARGET_UNALIGNED\t1\n#define LJ_ARCH_NUMMODE\t\tLJ_NUMMODE_SINGLE_DUAL\n\n#elif LUAJIT_TARGET == LUAJIT_ARCH_ARM\n\n#define LJ_ARCH_NAME\t\t\"arm\"\n#define LJ_ARCH_BITS\t\t32\n#define LJ_ARCH_ENDIAN\t\tLUAJIT_LE\n#if !defined(LJ_ARCH_HASFPU) && __SOFTFP__\n#define LJ_ARCH_HASFPU\t\t0\n#endif\n#if !defined(LJ_ABI_SOFTFP) && !__ARM_PCS_VFP\n#define LJ_ABI_SOFTFP\t\t1\n#endif\n#define LJ_ABI_EABI\t\t1\n#define LJ_TARGET_ARM\t\t1\n#define LJ_TARGET_EHRETREG\t0\n#define LJ_TARGET_JUMPRANGE\t25\t/* +-2^25 = +-32MB */\n#define LJ_TARGET_MASKSHIFT\t0\n#define LJ_TARGET_MASKROT\t1\n#define LJ_TARGET_UNIFYROT\t2\t/* Want only IR_BROR. */\n#define LJ_ARCH_NUMMODE\t\tLJ_NUMMODE_DUAL\n\n#if __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH_7S__\n#define LJ_ARCH_VERSION\t\t70\n#elif __ARM_ARCH_6T2__\n#define LJ_ARCH_VERSION\t\t61\n#elif __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6K__ || __ARM_ARCH_6Z__ || __ARM_ARCH_6ZK__\n#define LJ_ARCH_VERSION\t\t60\n#else\n#define LJ_ARCH_VERSION\t\t50\n#endif\n\n#elif LUAJIT_TARGET == LUAJIT_ARCH_PPC\n\n#define LJ_ARCH_NAME\t\t\"ppc\"\n#if _LP64\n#define LJ_ARCH_BITS\t\t64\n#else\n#define LJ_ARCH_BITS\t\t32\n#endif\n#define LJ_ARCH_ENDIAN\t\tLUAJIT_BE\n#define LJ_TARGET_PPC\t\t1\n#define LJ_TARGET_EHRETREG\t3\n#define LJ_TARGET_JUMPRANGE\t25\t/* +-2^25 = +-32MB */\n#define LJ_TARGET_MASKSHIFT\t0\n#define LJ_TARGET_MASKROT\t1\n#define LJ_TARGET_UNIFYROT\t1\t/* Want only IR_BROL. */\n#define LJ_ARCH_NUMMODE\t\tLJ_NUMMODE_DUAL_SINGLE\n\n#if _ARCH_PWR7\n#define LJ_ARCH_VERSION\t\t70\n#elif _ARCH_PWR6\n#define LJ_ARCH_VERSION\t\t60\n#elif _ARCH_PWR5X\n#define LJ_ARCH_VERSION\t\t51\n#elif _ARCH_PWR5\n#define LJ_ARCH_VERSION\t\t50\n#elif _ARCH_PWR4\n#define LJ_ARCH_VERSION\t\t40\n#else\n#define LJ_ARCH_VERSION\t\t0\n#endif\n#if __PPC64__ || __powerpc64__ || LJ_TARGET_CONSOLE\n#define LJ_ARCH_PPC64\t\t1\n#define LJ_ARCH_NOFFI\t\t1\n#endif\n#if _ARCH_PPCSQ\n#define LJ_ARCH_SQRT\t\t1\n#endif\n#if _ARCH_PWR5X\n#define LJ_ARCH_ROUND\t\t1\n#endif\n#if __PPU__\n#define LJ_ARCH_CELL\t\t1\n#endif\n#if LJ_TARGET_XBOX360\n#define LJ_ARCH_XENON\t\t1\n#endif\n\n#elif LUAJIT_TARGET == LUAJIT_ARCH_PPCSPE\n\n#define LJ_ARCH_NAME\t\t\"ppcspe\"\n#define LJ_ARCH_BITS\t\t32\n#define LJ_ARCH_ENDIAN\t\tLUAJIT_BE\n#ifndef LJ_ABI_SOFTFP\n#define LJ_ABI_SOFTFP\t\t1\n#endif\n#define LJ_ABI_EABI\t\t1\n#define LJ_TARGET_PPCSPE\t1\n#define LJ_TARGET_EHRETREG\t3\n#define LJ_TARGET_JUMPRANGE\t25\t/* +-2^25 = +-32MB */\n#define LJ_TARGET_MASKSHIFT\t0\n#define LJ_TARGET_MASKROT\t1\n#define LJ_TARGET_UNIFYROT\t1\t/* Want only IR_BROL. */\n#define LJ_ARCH_NUMMODE\t\tLJ_NUMMODE_SINGLE\n#define LJ_ARCH_NOFFI\t\t1\t/* NYI: comparisons, calls. */\n#define LJ_ARCH_NOJIT\t\t1\n\n#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS\n\n#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)\n#define LJ_ARCH_NAME\t\t\"mipsel\"\n#define LJ_ARCH_ENDIAN\t\tLUAJIT_LE\n#else\n#define LJ_ARCH_NAME\t\t\"mips\"\n#define LJ_ARCH_ENDIAN\t\tLUAJIT_BE\n#endif\n#define LJ_ARCH_BITS\t\t32\n#define LJ_TARGET_MIPS\t\t1\n#define LJ_TARGET_EHRETREG\t4\n#define LJ_TARGET_JUMPRANGE\t27\t/* 2*2^27 = 256MB-aligned region */\n#define LJ_TARGET_MASKSHIFT\t1\n#define LJ_TARGET_MASKROT\t1\n#define LJ_TARGET_UNIFYROT\t2\t/* Want only IR_BROR. */\n#define LJ_ARCH_NUMMODE\t\tLJ_NUMMODE_SINGLE\n\n#if _MIPS_ARCH_MIPS32R2\n#define LJ_ARCH_VERSION\t\t20\n#else\n#define LJ_ARCH_VERSION\t\t10\n#endif\n\n#else\n#error \"No target architecture defined\"\n#endif\n\n#ifndef LJ_PAGESIZE\n#define LJ_PAGESIZE\t\t4096\n#endif\n\n/* Check for minimum required compiler versions. */\n#if defined(__GNUC__)\n#if LJ_TARGET_X86\n#if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4)\n#error \"Need at least GCC 3.4 or newer\"\n#endif\n#elif LJ_TARGET_X64\n#if __GNUC__ < 4\n#error \"Need at least GCC 4.0 or newer\"\n#endif\n#elif LJ_TARGET_ARM\n#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 2)\n#error \"Need at least GCC 4.2 or newer\"\n#endif\n#elif !LJ_TARGET_PS3\n#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)\n#error \"Need at least GCC 4.3 or newer\"\n#endif\n#endif\n#endif\n\n/* Check target-specific constraints. */\n#ifndef _BUILDVM_H\n#if LJ_TARGET_X64\n#if __USING_SJLJ_EXCEPTIONS__\n#error \"Need a C compiler with native exception handling on x64\"\n#endif\n#elif LJ_TARGET_ARM\n#if defined(__ARMEB__)\n#error \"No support for big-endian ARM\"\n#endif\n#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__\n#error \"No support for Cortex-M CPUs\"\n#endif\n#if !(__ARM_EABI__ || LJ_TARGET_IOS)\n#error \"Only ARM EABI or iOS 3.0+ ABI is supported\"\n#endif\n#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE\n#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)\n#error \"No support for PowerPC CPUs without double-precision FPU\"\n#endif\n#if defined(_LITTLE_ENDIAN)\n#error \"No support for little-endian PowerPC\"\n#endif\n#if defined(_LP64)\n#error \"No support for PowerPC 64 bit mode\"\n#endif\n#elif LJ_TARGET_MIPS\n#if defined(__mips_soft_float)\n#error \"No support for MIPS CPUs without FPU\"\n#endif\n#endif\n#endif\n\n/* Enable or disable the dual-number mode for the VM. */\n#if (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE && LUAJIT_NUMMODE == 2) || \\\n    (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL && LUAJIT_NUMMODE == 1)\n#error \"No support for this number mode on this architecture\"\n#endif\n#if LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL || \\\n    (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL_SINGLE && LUAJIT_NUMMODE != 1) || \\\n    (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE_DUAL && LUAJIT_NUMMODE == 2)\n#define LJ_DUALNUM\t\t1\n#else\n#define LJ_DUALNUM\t\t0\n#endif\n\n#if LJ_TARGET_IOS || LJ_TARGET_CONSOLE\n/* Runtime code generation is restricted on iOS. Complain to Apple, not me. */\n/* Ditto for the consoles. Complain to Sony or MS, not me. */\n#ifndef LUAJIT_ENABLE_JIT\n#define LJ_OS_NOJIT\t\t1\n#endif\n#endif\n\n/* Disable or enable the JIT compiler. */\n#if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) || defined(LJ_OS_NOJIT)\n#define LJ_HASJIT\t\t0\n#else\n#define LJ_HASJIT\t\t1\n#endif\n\n/* Disable or enable the FFI extension. */\n#if defined(LUAJIT_DISABLE_FFI) || defined(LJ_ARCH_NOFFI)\n#define LJ_HASFFI\t\t0\n#else\n#define LJ_HASFFI\t\t1\n#endif\n\n#ifndef LJ_ARCH_HASFPU\n#define LJ_ARCH_HASFPU\t\t1\n#endif\n#ifndef LJ_ABI_SOFTFP\n#define LJ_ABI_SOFTFP\t\t0\n#endif\n#define LJ_SOFTFP\t\t(!LJ_ARCH_HASFPU)\n\n#if LJ_ARCH_ENDIAN == LUAJIT_BE\n#define LJ_LE\t\t\t0\n#define LJ_BE\t\t\t1\n#define LJ_ENDIAN_SELECT(le, be)\tbe\n#define LJ_ENDIAN_LOHI(lo, hi)\t\thi lo\n#else\n#define LJ_LE\t\t\t1\n#define LJ_BE\t\t\t0\n#define LJ_ENDIAN_SELECT(le, be)\tle\n#define LJ_ENDIAN_LOHI(lo, hi)\t\tlo hi\n#endif\n\n#if LJ_ARCH_BITS == 32\n#define LJ_32\t\t\t1\n#define LJ_64\t\t\t0\n#else\n#define LJ_32\t\t\t0\n#define LJ_64\t\t\t1\n#endif\n\n#ifndef LJ_TARGET_UNALIGNED\n#define LJ_TARGET_UNALIGNED\t0\n#endif\n\n/* Various workarounds for embedded operating systems. */\n#if (defined(__ANDROID__) && !defined(LJ_TARGET_X86ORX64)) || defined(__symbian__) || LJ_TARGET_XBOX360\n#define LUAJIT_NO_LOG2\n#endif\n#if defined(__symbian__)\n#define LUAJIT_NO_EXP2\n#endif\n\n#if defined(LUAJIT_NO_UNWIND) || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3\n#define LJ_NO_UNWIND\t\t1\n#endif\n\n/* Compatibility with Lua 5.1 vs. 5.2. */\n#ifdef LUAJIT_ENABLE_LUA52COMPAT\n#define LJ_52\t\t\t1\n#else\n#define LJ_52\t\t\t0\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_asm.c",
    "content": "/*\n** IR assembler (SSA IR -> machine code).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_asm_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_gc.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_frame.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#endif\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_ircall.h\"\n#include \"lj_iropt.h\"\n#include \"lj_mcode.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#include \"lj_snap.h\"\n#include \"lj_asm.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"lj_target.h\"\n\n/* -- Assembler state and common macros ----------------------------------- */\n\n/* Assembler state. */\ntypedef struct ASMState {\n  RegCost cost[RID_MAX];  /* Reference and blended allocation cost for regs. */\n\n  MCode *mcp;\t\t/* Current MCode pointer (grows down). */\n  MCode *mclim;\t\t/* Lower limit for MCode memory + red zone. */\n\n  IRIns *ir;\t\t/* Copy of pointer to IR instructions/constants. */\n  jit_State *J;\t\t/* JIT compiler state. */\n\n#if LJ_TARGET_X86ORX64\n  x86ModRM mrm;\t\t/* Fused x86 address operand. */\n#endif\n\n  RegSet freeset;\t/* Set of free registers. */\n  RegSet modset;\t/* Set of registers modified inside the loop. */\n  RegSet weakset;\t/* Set of weakly referenced registers. */\n  RegSet phiset;\t/* Set of PHI registers. */\n\n  uint32_t flags;\t/* Copy of JIT compiler flags. */\n  int loopinv;\t\t/* Loop branch inversion (0:no, 1:yes, 2:yes+CC_P). */\n\n  int32_t evenspill;\t/* Next even spill slot. */\n  int32_t oddspill;\t/* Next odd spill slot (or 0). */\n\n  IRRef curins;\t\t/* Reference of current instruction. */\n  IRRef stopins;\t/* Stop assembly before hitting this instruction. */\n  IRRef orignins;\t/* Original T->nins. */\n\n  IRRef snapref;\t/* Current snapshot is active after this reference. */\n  IRRef snaprename;\t/* Rename highwater mark for snapshot check. */\n  SnapNo snapno;\t/* Current snapshot number. */\n  SnapNo loopsnapno;\t/* Loop snapshot number. */\n\n  IRRef fuseref;\t/* Fusion limit (loopref, 0 or FUSE_DISABLED). */\n  IRRef sectref;\t/* Section base reference (loopref or 0). */\n  IRRef loopref;\t/* Reference of LOOP instruction (or 0). */\n\n  BCReg topslot;\t/* Number of slots for stack check (unless 0). */\n  int32_t gcsteps;\t/* Accumulated number of GC steps (per section). */\n\n  GCtrace *T;\t\t/* Trace to assemble. */\n  GCtrace *parent;\t/* Parent trace (or NULL). */\n\n  MCode *mcbot;\t\t/* Bottom of reserved MCode. */\n  MCode *mctop;\t\t/* Top of generated MCode. */\n  MCode *mcloop;\t/* Pointer to loop MCode (or NULL). */\n  MCode *invmcp;\t/* Points to invertible loop branch (or NULL). */\n  MCode *flagmcp;\t/* Pending opportunity to merge flag setting ins. */\n  MCode *realign;\t/* Realign loop if not NULL. */\n\n#ifdef RID_NUM_KREF\n  int32_t krefk[RID_NUM_KREF];\n#endif\n  IRRef1 phireg[RID_MAX];  /* PHI register references. */\n  uint16_t parentmap[LJ_MAX_JSLOTS];  /* Parent instruction to RegSP map. */\n} ASMState;\n\n#define IR(ref)\t\t\t(&as->ir[(ref)])\n\n#define ASMREF_TMP1\t\tREF_TRUE\t/* Temp. register. */\n#define ASMREF_TMP2\t\tREF_FALSE\t/* Temp. register. */\n#define ASMREF_L\t\tREF_NIL\t\t/* Stores register for L. */\n\n/* Check for variant to invariant references. */\n#define iscrossref(as, ref)\t((ref) < as->sectref)\n\n/* Inhibit memory op fusion from variant to invariant references. */\n#define FUSE_DISABLED\t\t(~(IRRef)0)\n#define mayfuse(as, ref)\t((ref) > as->fuseref)\n#define neverfuse(as)\t\t(as->fuseref == FUSE_DISABLED)\n#define canfuse(as, ir)\t\t(!neverfuse(as) && !irt_isphi((ir)->t))\n#define opisfusableload(o) \\\n  ((o) == IR_ALOAD || (o) == IR_HLOAD || (o) == IR_ULOAD || \\\n   (o) == IR_FLOAD || (o) == IR_XLOAD || (o) == IR_SLOAD || (o) == IR_VLOAD)\n\n/* Sparse limit checks using a red zone before the actual limit. */\n#define MCLIM_REDZONE\t64\n#define checkmclim(as) \\\n  if (LJ_UNLIKELY(as->mcp < as->mclim)) asm_mclimit(as)\n\nstatic LJ_NORET LJ_NOINLINE void asm_mclimit(ASMState *as)\n{\n  lj_mcode_limiterr(as->J, (size_t)(as->mctop - as->mcp + 4*MCLIM_REDZONE));\n}\n\n#ifdef RID_NUM_KREF\n#define ra_iskref(ref)\t\t((ref) < RID_NUM_KREF)\n#define ra_krefreg(ref)\t\t((Reg)(RID_MIN_KREF + (Reg)(ref)))\n#define ra_krefk(as, ref)\t(as->krefk[(ref)])\n\nstatic LJ_AINLINE void ra_setkref(ASMState *as, Reg r, int32_t k)\n{\n  IRRef ref = (IRRef)(r - RID_MIN_KREF);\n  as->krefk[ref] = k;\n  as->cost[r] = REGCOST(ref, ref);\n}\n\n#else\n#define ra_iskref(ref)\t\t0\n#define ra_krefreg(ref)\t\tRID_MIN_GPR\n#define ra_krefk(as, ref)\t0\n#endif\n\n/* Arch-specific field offsets. */\nstatic const uint8_t field_ofs[IRFL__MAX+1] = {\n#define FLOFS(name, ofs)\t(uint8_t)(ofs),\nIRFLDEF(FLOFS)\n#undef FLOFS\n  0\n};\n\n/* -- Target-specific instruction emitter --------------------------------- */\n\n#if LJ_TARGET_X86ORX64\n#include \"lj_emit_x86.h\"\n#elif LJ_TARGET_ARM\n#include \"lj_emit_arm.h\"\n#elif LJ_TARGET_PPC\n#include \"lj_emit_ppc.h\"\n#elif LJ_TARGET_MIPS\n#include \"lj_emit_mips.h\"\n#else\n#error \"Missing instruction emitter for target CPU\"\n#endif\n\n/* -- Register allocator debugging ---------------------------------------- */\n\n/* #define LUAJIT_DEBUG_RA */\n\n#ifdef LUAJIT_DEBUG_RA\n\n#include <stdio.h>\n#include <stdarg.h>\n\n#define RIDNAME(name)\t#name,\nstatic const char *const ra_regname[] = {\n  GPRDEF(RIDNAME)\n  FPRDEF(RIDNAME)\n  VRIDDEF(RIDNAME)\n  NULL\n};\n#undef RIDNAME\n\nstatic char ra_dbg_buf[65536];\nstatic char *ra_dbg_p;\nstatic char *ra_dbg_merge;\nstatic MCode *ra_dbg_mcp;\n\nstatic void ra_dstart(void)\n{\n  ra_dbg_p = ra_dbg_buf;\n  ra_dbg_merge = NULL;\n  ra_dbg_mcp = NULL;\n}\n\nstatic void ra_dflush(void)\n{\n  fwrite(ra_dbg_buf, 1, (size_t)(ra_dbg_p-ra_dbg_buf), stdout);\n  ra_dstart();\n}\n\nstatic void ra_dprintf(ASMState *as, const char *fmt, ...)\n{\n  char *p;\n  va_list argp;\n  va_start(argp, fmt);\n  p = ra_dbg_mcp == as->mcp ? ra_dbg_merge : ra_dbg_p;\n  ra_dbg_mcp = NULL;\n  p += sprintf(p, \"%08x  \\e[36m%04d \", (uintptr_t)as->mcp, as->curins-REF_BIAS);\n  for (;;) {\n    const char *e = strchr(fmt, '$');\n    if (e == NULL) break;\n    memcpy(p, fmt, (size_t)(e-fmt));\n    p += e-fmt;\n    if (e[1] == 'r') {\n      Reg r = va_arg(argp, Reg) & RID_MASK;\n      if (r <= RID_MAX) {\n\tconst char *q;\n\tfor (q = ra_regname[r]; *q; q++)\n\t  *p++ = *q >= 'A' && *q <= 'Z' ? *q + 0x20 : *q;\n      } else {\n\t*p++ = '?';\n\tlua_assert(0);\n      }\n    } else if (e[1] == 'f' || e[1] == 'i') {\n      IRRef ref;\n      if (e[1] == 'f')\n\tref = va_arg(argp, IRRef);\n      else\n\tref = va_arg(argp, IRIns *) - as->ir;\n      if (ref >= REF_BIAS)\n\tp += sprintf(p, \"%04d\", ref - REF_BIAS);\n      else\n\tp += sprintf(p, \"K%03d\", REF_BIAS - ref);\n    } else if (e[1] == 's') {\n      uint32_t slot = va_arg(argp, uint32_t);\n      p += sprintf(p, \"[sp+0x%x]\", sps_scale(slot));\n    } else if (e[1] == 'x') {\n      p += sprintf(p, \"%08x\", va_arg(argp, int32_t));\n    } else {\n      lua_assert(0);\n    }\n    fmt = e+2;\n  }\n  va_end(argp);\n  while (*fmt)\n    *p++ = *fmt++;\n  *p++ = '\\e'; *p++ = '['; *p++ = 'm'; *p++ = '\\n';\n  if (p > ra_dbg_buf+sizeof(ra_dbg_buf)-256) {\n    fwrite(ra_dbg_buf, 1, (size_t)(p-ra_dbg_buf), stdout);\n    p = ra_dbg_buf;\n  }\n  ra_dbg_p = p;\n}\n\n#define RA_DBG_START()\tra_dstart()\n#define RA_DBG_FLUSH()\tra_dflush()\n#define RA_DBG_REF() \\\n  do { char *_p = ra_dbg_p; ra_dprintf(as, \"\"); \\\n       ra_dbg_merge = _p; ra_dbg_mcp = as->mcp; } while (0)\n#define RA_DBGX(x)\tra_dprintf x\n\n#else\n#define RA_DBG_START()\t((void)0)\n#define RA_DBG_FLUSH()\t((void)0)\n#define RA_DBG_REF()\t((void)0)\n#define RA_DBGX(x)\t((void)0)\n#endif\n\n/* -- Register allocator -------------------------------------------------- */\n\n#define ra_free(as, r)\t\trset_set(as->freeset, (r))\n#define ra_modified(as, r)\trset_set(as->modset, (r))\n#define ra_weak(as, r)\t\trset_set(as->weakset, (r))\n#define ra_noweak(as, r)\trset_clear(as->weakset, (r))\n\n#define ra_used(ir)\t\t(ra_hasreg((ir)->r) || ra_hasspill((ir)->s))\n\n/* Setup register allocator. */\nstatic void ra_setup(ASMState *as)\n{\n  Reg r;\n  /* Initially all regs (except the stack pointer) are free for use. */\n  as->freeset = RSET_INIT;\n  as->modset = RSET_EMPTY;\n  as->weakset = RSET_EMPTY;\n  as->phiset = RSET_EMPTY;\n  memset(as->phireg, 0, sizeof(as->phireg));\n  for (r = RID_MIN_GPR; r < RID_MAX; r++)\n    as->cost[r] = REGCOST(~0u, 0u);\n}\n\n/* Rematerialize constants. */\nstatic Reg ra_rematk(ASMState *as, IRRef ref)\n{\n  IRIns *ir;\n  Reg r;\n  if (ra_iskref(ref)) {\n    r = ra_krefreg(ref);\n    lua_assert(!rset_test(as->freeset, r));\n    ra_free(as, r);\n    ra_modified(as, r);\n    emit_loadi(as, r, ra_krefk(as, ref));\n    return r;\n  }\n  ir = IR(ref);\n  r = ir->r;\n  lua_assert(ra_hasreg(r) && !ra_hasspill(ir->s));\n  ra_free(as, r);\n  ra_modified(as, r);\n  ir->r = RID_INIT;  /* Do not keep any hint. */\n  RA_DBGX((as, \"remat     $i $r\", ir, r));\n#if !LJ_SOFTFP\n  if (ir->o == IR_KNUM) {\n    emit_loadn(as, r, ir_knum(ir));\n  } else\n#endif\n  if (emit_canremat(REF_BASE) && ir->o == IR_BASE) {\n    ra_sethint(ir->r, RID_BASE);  /* Restore BASE register hint. */\n    emit_getgl(as, r, jit_base);\n  } else if (emit_canremat(ASMREF_L) && ir->o == IR_KPRI) {\n    lua_assert(irt_isnil(ir->t));  /* REF_NIL stores ASMREF_L register. */\n    emit_getgl(as, r, jit_L);\n#if LJ_64\n  } else if (ir->o == IR_KINT64) {\n    emit_loadu64(as, r, ir_kint64(ir)->u64);\n#endif\n  } else {\n    lua_assert(ir->o == IR_KINT || ir->o == IR_KGC ||\n\t       ir->o == IR_KPTR || ir->o == IR_KKPTR || ir->o == IR_KNULL);\n    emit_loadi(as, r, ir->i);\n  }\n  return r;\n}\n\n/* Force a spill. Allocate a new spill slot if needed. */\nstatic int32_t ra_spill(ASMState *as, IRIns *ir)\n{\n  int32_t slot = ir->s;\n  if (!ra_hasspill(slot)) {\n    if (irt_is64(ir->t)) {\n      slot = as->evenspill;\n      as->evenspill += 2;\n    } else if (as->oddspill) {\n      slot = as->oddspill;\n      as->oddspill = 0;\n    } else {\n      slot = as->evenspill;\n      as->oddspill = slot+1;\n      as->evenspill += 2;\n    }\n    if (as->evenspill > 256)\n      lj_trace_err(as->J, LJ_TRERR_SPILLOV);\n    ir->s = (uint8_t)slot;\n  }\n  return sps_scale(slot);\n}\n\n/* Release the temporarily allocated register in ASMREF_TMP1/ASMREF_TMP2. */\nstatic Reg ra_releasetmp(ASMState *as, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  Reg r = ir->r;\n  lua_assert(ra_hasreg(r) && !ra_hasspill(ir->s));\n  ra_free(as, r);\n  ra_modified(as, r);\n  ir->r = RID_INIT;\n  return r;\n}\n\n/* Restore a register (marked as free). Rematerialize or force a spill. */\nstatic Reg ra_restore(ASMState *as, IRRef ref)\n{\n  if (emit_canremat(ref)) {\n    return ra_rematk(as, ref);\n  } else {\n    IRIns *ir = IR(ref);\n    int32_t ofs = ra_spill(as, ir);  /* Force a spill slot. */\n    Reg r = ir->r;\n    lua_assert(ra_hasreg(r));\n    ra_sethint(ir->r, r);  /* Keep hint. */\n    ra_free(as, r);\n    if (!rset_test(as->weakset, r)) {  /* Only restore non-weak references. */\n      ra_modified(as, r);\n      RA_DBGX((as, \"restore   $i $r\", ir, r));\n      emit_spload(as, ir, r, ofs);\n    }\n    return r;\n  }\n}\n\n/* Save a register to a spill slot. */\nstatic void ra_save(ASMState *as, IRIns *ir, Reg r)\n{\n  RA_DBGX((as, \"save      $i $r\", ir, r));\n  emit_spstore(as, ir, r, sps_scale(ir->s));\n}\n\n#define MINCOST(name) \\\n  if (rset_test(RSET_ALL, RID_##name) && \\\n      LJ_LIKELY(allow&RID2RSET(RID_##name)) && as->cost[RID_##name] < cost) \\\n    cost = as->cost[RID_##name];\n\n/* Evict the register with the lowest cost, forcing a restore. */\nstatic Reg ra_evict(ASMState *as, RegSet allow)\n{\n  IRRef ref;\n  RegCost cost = ~(RegCost)0;\n  lua_assert(allow != RSET_EMPTY);\n  if (RID_NUM_FPR == 0 || allow < RID2RSET(RID_MAX_GPR)) {\n    GPRDEF(MINCOST)\n  } else {\n    FPRDEF(MINCOST)\n  }\n  ref = regcost_ref(cost);\n  lua_assert(ra_iskref(ref) || (ref >= as->T->nk && ref < as->T->nins));\n  /* Preferably pick any weak ref instead of a non-weak, non-const ref. */\n  if (!irref_isk(ref) && (as->weakset & allow)) {\n    IRIns *ir = IR(ref);\n    if (!rset_test(as->weakset, ir->r))\n      ref = regcost_ref(as->cost[rset_pickbot((as->weakset & allow))]);\n  }\n  return ra_restore(as, ref);\n}\n\n/* Pick any register (marked as free). Evict on-demand. */\nstatic Reg ra_pick(ASMState *as, RegSet allow)\n{\n  RegSet pick = as->freeset & allow;\n  if (!pick)\n    return ra_evict(as, allow);\n  else\n    return rset_picktop(pick);\n}\n\n/* Get a scratch register (marked as free). */\nstatic Reg ra_scratch(ASMState *as, RegSet allow)\n{\n  Reg r = ra_pick(as, allow);\n  ra_modified(as, r);\n  RA_DBGX((as, \"scratch        $r\", r));\n  return r;\n}\n\n/* Evict all registers from a set (if not free). */\nstatic void ra_evictset(ASMState *as, RegSet drop)\n{\n  RegSet work;\n  as->modset |= drop;\n#if !LJ_SOFTFP\n  work = (drop & ~as->freeset) & RSET_FPR;\n  while (work) {\n    Reg r = rset_pickbot(work);\n    ra_restore(as, regcost_ref(as->cost[r]));\n    rset_clear(work, r);\n    checkmclim(as);\n  }\n#endif\n  work = (drop & ~as->freeset);\n  while (work) {\n    Reg r = rset_pickbot(work);\n    ra_restore(as, regcost_ref(as->cost[r]));\n    rset_clear(work, r);\n    checkmclim(as);\n  }\n}\n\n/* Evict (rematerialize) all registers allocated to constants. */\nstatic void ra_evictk(ASMState *as)\n{\n  RegSet work;\n#if !LJ_SOFTFP\n  work = ~as->freeset & RSET_FPR;\n  while (work) {\n    Reg r = rset_pickbot(work);\n    IRRef ref = regcost_ref(as->cost[r]);\n    if (emit_canremat(ref) && irref_isk(ref)) {\n      ra_rematk(as, ref);\n      checkmclim(as);\n    }\n    rset_clear(work, r);\n  }\n#endif\n  work = ~as->freeset & RSET_GPR;\n  while (work) {\n    Reg r = rset_pickbot(work);\n    IRRef ref = regcost_ref(as->cost[r]);\n    if (emit_canremat(ref) && irref_isk(ref)) {\n      ra_rematk(as, ref);\n      checkmclim(as);\n    }\n    rset_clear(work, r);\n  }\n}\n\n#ifdef RID_NUM_KREF\n/* Allocate a register for a constant. */\nstatic Reg ra_allock(ASMState *as, int32_t k, RegSet allow)\n{\n  /* First try to find a register which already holds the same constant. */\n  RegSet pick, work = ~as->freeset & RSET_GPR;\n  Reg r;\n  while (work) {\n    IRRef ref;\n    r = rset_pickbot(work);\n    ref = regcost_ref(as->cost[r]);\n    if (ref < ASMREF_L &&\n\tk == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i))\n      return r;\n    rset_clear(work, r);\n  }\n  pick = as->freeset & allow;\n  if (pick) {\n    /* Constants should preferably get unmodified registers. */\n    if ((pick & ~as->modset))\n      pick &= ~as->modset;\n    r = rset_pickbot(pick);  /* Reduce conflicts with inverse allocation. */\n  } else {\n    r = ra_evict(as, allow);\n  }\n  RA_DBGX((as, \"allock    $x $r\", k, r));\n  ra_setkref(as, r, k);\n  rset_clear(as->freeset, r);\n  ra_noweak(as, r);\n  return r;\n}\n\n/* Allocate a specific register for a constant. */\nstatic void ra_allockreg(ASMState *as, int32_t k, Reg r)\n{\n  Reg kr = ra_allock(as, k, RID2RSET(r));\n  if (kr != r) {\n    IRIns irdummy;\n    irdummy.t.irt = IRT_INT;\n    ra_scratch(as, RID2RSET(r));\n    emit_movrr(as, &irdummy, r, kr);\n  }\n}\n#else\n#define ra_allockreg(as, k, r)\t\temit_loadi(as, (r), (k))\n#endif\n\n/* Allocate a register for ref from the allowed set of registers.\n** Note: this function assumes the ref does NOT have a register yet!\n** Picks an optimal register, sets the cost and marks the register as non-free.\n*/\nstatic Reg ra_allocref(ASMState *as, IRRef ref, RegSet allow)\n{\n  IRIns *ir = IR(ref);\n  RegSet pick = as->freeset & allow;\n  Reg r;\n  lua_assert(ra_noreg(ir->r));\n  if (pick) {\n    /* First check register hint from propagation or PHI. */\n    if (ra_hashint(ir->r)) {\n      r = ra_gethint(ir->r);\n      if (rset_test(pick, r))  /* Use hint register if possible. */\n\tgoto found;\n      /* Rematerialization is cheaper than missing a hint. */\n      if (rset_test(allow, r) && emit_canremat(regcost_ref(as->cost[r]))) {\n\tra_rematk(as, regcost_ref(as->cost[r]));\n\tgoto found;\n      }\n      RA_DBGX((as, \"hintmiss  $f $r\", ref, r));\n    }\n    /* Invariants should preferably get unmodified registers. */\n    if (ref < as->loopref && !irt_isphi(ir->t)) {\n      if ((pick & ~as->modset))\n\tpick &= ~as->modset;\n      r = rset_pickbot(pick);  /* Reduce conflicts with inverse allocation. */\n    } else {\n      /* We've got plenty of regs, so get callee-save regs if possible. */\n      if (RID_NUM_GPR > 8 && (pick & ~RSET_SCRATCH))\n\tpick &= ~RSET_SCRATCH;\n      r = rset_picktop(pick);\n    }\n  } else {\n    r = ra_evict(as, allow);\n  }\nfound:\n  RA_DBGX((as, \"alloc     $f $r\", ref, r));\n  ir->r = (uint8_t)r;\n  rset_clear(as->freeset, r);\n  ra_noweak(as, r);\n  as->cost[r] = REGCOST_REF_T(ref, irt_t(ir->t));\n  return r;\n}\n\n/* Allocate a register on-demand. */\nstatic Reg ra_alloc1(ASMState *as, IRRef ref, RegSet allow)\n{\n  Reg r = IR(ref)->r;\n  /* Note: allow is ignored if the register is already allocated. */\n  if (ra_noreg(r)) r = ra_allocref(as, ref, allow);\n  ra_noweak(as, r);\n  return r;\n}\n\n/* Rename register allocation and emit move. */\nstatic void ra_rename(ASMState *as, Reg down, Reg up)\n{\n  IRRef ren, ref = regcost_ref(as->cost[up] = as->cost[down]);\n  IRIns *ir = IR(ref);\n  ir->r = (uint8_t)up;\n  as->cost[down] = 0;\n  lua_assert((down < RID_MAX_GPR) == (up < RID_MAX_GPR));\n  lua_assert(!rset_test(as->freeset, down) && rset_test(as->freeset, up));\n  ra_free(as, down);  /* 'down' is free ... */\n  ra_modified(as, down);\n  rset_clear(as->freeset, up);  /* ... and 'up' is now allocated. */\n  ra_noweak(as, up);\n  RA_DBGX((as, \"rename    $f $r $r\", regcost_ref(as->cost[up]), down, up));\n  emit_movrr(as, ir, down, up);  /* Backwards codegen needs inverse move. */\n  if (!ra_hasspill(IR(ref)->s)) {  /* Add the rename to the IR. */\n    lj_ir_set(as->J, IRT(IR_RENAME, IRT_NIL), ref, as->snapno);\n    ren = tref_ref(lj_ir_emit(as->J));\n    as->ir = as->T->ir;  /* The IR may have been reallocated. */\n    IR(ren)->r = (uint8_t)down;\n    IR(ren)->s = SPS_NONE;\n  }\n}\n\n/* Pick a destination register (marked as free).\n** Caveat: allow is ignored if there's already a destination register.\n** Use ra_destreg() to get a specific register.\n*/\nstatic Reg ra_dest(ASMState *as, IRIns *ir, RegSet allow)\n{\n  Reg dest = ir->r;\n  if (ra_hasreg(dest)) {\n    ra_free(as, dest);\n    ra_modified(as, dest);\n  } else {\n    if (ra_hashint(dest) && rset_test((as->freeset&allow), ra_gethint(dest))) {\n      dest = ra_gethint(dest);\n      ra_modified(as, dest);\n      RA_DBGX((as, \"dest           $r\", dest));\n    } else {\n      dest = ra_scratch(as, allow);\n    }\n    ir->r = dest;\n  }\n  if (LJ_UNLIKELY(ra_hasspill(ir->s))) ra_save(as, ir, dest);\n  return dest;\n}\n\n/* Force a specific destination register (marked as free). */\nstatic void ra_destreg(ASMState *as, IRIns *ir, Reg r)\n{\n  Reg dest = ra_dest(as, ir, RID2RSET(r));\n  if (dest != r) {\n    lua_assert(rset_test(as->freeset, r));\n    ra_modified(as, r);\n    emit_movrr(as, ir, dest, r);\n  }\n}\n\n#if LJ_TARGET_X86ORX64\n/* Propagate dest register to left reference. Emit moves as needed.\n** This is a required fixup step for all 2-operand machine instructions.\n*/\nstatic void ra_left(ASMState *as, Reg dest, IRRef lref)\n{\n  IRIns *ir = IR(lref);\n  Reg left = ir->r;\n  if (ra_noreg(left)) {\n    if (irref_isk(lref)) {\n      if (ir->o == IR_KNUM) {\n\tcTValue *tv = ir_knum(ir);\n\t/* FP remat needs a load except for +0. Still better than eviction. */\n\tif (tvispzero(tv) || !(as->freeset & RSET_FPR)) {\n\t  emit_loadn(as, dest, tv);\n\t  return;\n\t}\n#if LJ_64\n      } else if (ir->o == IR_KINT64) {\n\temit_loadu64(as, dest, ir_kint64(ir)->u64);\n\treturn;\n#endif\n      } else {\n\tlua_assert(ir->o == IR_KINT || ir->o == IR_KGC ||\n\t\t   ir->o == IR_KPTR || ir->o == IR_KKPTR || ir->o == IR_KNULL);\n\temit_loadi(as, dest, ir->i);\n\treturn;\n      }\n    }\n    if (!ra_hashint(left) && !iscrossref(as, lref))\n      ra_sethint(ir->r, dest);  /* Propagate register hint. */\n    left = ra_allocref(as, lref, dest < RID_MAX_GPR ? RSET_GPR : RSET_FPR);\n  }\n  ra_noweak(as, left);\n  /* Move needed for true 3-operand instruction: y=a+b ==> y=a; y+=b. */\n  if (dest != left) {\n    /* Use register renaming if dest is the PHI reg. */\n    if (irt_isphi(ir->t) && as->phireg[dest] == lref) {\n      ra_modified(as, left);\n      ra_rename(as, left, dest);\n    } else {\n      emit_movrr(as, ir, dest, left);\n    }\n  }\n}\n#else\n/* Similar to ra_left, except we override any hints. */\nstatic void ra_leftov(ASMState *as, Reg dest, IRRef lref)\n{\n  IRIns *ir = IR(lref);\n  Reg left = ir->r;\n  if (ra_noreg(left)) {\n    ra_sethint(ir->r, dest);  /* Propagate register hint. */\n    left = ra_allocref(as, lref,\n\t\t       (LJ_SOFTFP || dest < RID_MAX_GPR) ? RSET_GPR : RSET_FPR);\n  }\n  ra_noweak(as, left);\n  if (dest != left) {\n    /* Use register renaming if dest is the PHI reg. */\n    if (irt_isphi(ir->t) && as->phireg[dest] == lref) {\n      ra_modified(as, left);\n      ra_rename(as, left, dest);\n    } else {\n      emit_movrr(as, ir, dest, left);\n    }\n  }\n}\n#endif\n\n#if !LJ_64\n/* Force a RID_RETLO/RID_RETHI destination register pair (marked as free). */\nstatic void ra_destpair(ASMState *as, IRIns *ir)\n{\n  Reg destlo = ir->r, desthi = (ir+1)->r;\n  /* First spill unrelated refs blocking the destination registers. */\n  if (!rset_test(as->freeset, RID_RETLO) &&\n      destlo != RID_RETLO && desthi != RID_RETLO)\n    ra_restore(as, regcost_ref(as->cost[RID_RETLO]));\n  if (!rset_test(as->freeset, RID_RETHI) &&\n      destlo != RID_RETHI && desthi != RID_RETHI)\n    ra_restore(as, regcost_ref(as->cost[RID_RETHI]));\n  /* Next free the destination registers (if any). */\n  if (ra_hasreg(destlo)) {\n    ra_free(as, destlo);\n    ra_modified(as, destlo);\n  } else {\n    destlo = RID_RETLO;\n  }\n  if (ra_hasreg(desthi)) {\n    ra_free(as, desthi);\n    ra_modified(as, desthi);\n  } else {\n    desthi = RID_RETHI;\n  }\n  /* Check for conflicts and shuffle the registers as needed. */\n  if (destlo == RID_RETHI) {\n    if (desthi == RID_RETLO) {\n#if LJ_TARGET_X86\n      *--as->mcp = XI_XCHGa + RID_RETHI;\n#else\n      emit_movrr(as, ir, RID_RETHI, RID_TMP);\n      emit_movrr(as, ir, RID_RETLO, RID_RETHI);\n      emit_movrr(as, ir, RID_TMP, RID_RETLO);\n#endif\n    } else {\n      emit_movrr(as, ir, RID_RETHI, RID_RETLO);\n      if (desthi != RID_RETHI) emit_movrr(as, ir, desthi, RID_RETHI);\n    }\n  } else if (desthi == RID_RETLO) {\n    emit_movrr(as, ir, RID_RETLO, RID_RETHI);\n    if (destlo != RID_RETLO) emit_movrr(as, ir, destlo, RID_RETLO);\n  } else {\n    if (desthi != RID_RETHI) emit_movrr(as, ir, desthi, RID_RETHI);\n    if (destlo != RID_RETLO) emit_movrr(as, ir, destlo, RID_RETLO);\n  }\n  /* Restore spill slots (if any). */\n  if (ra_hasspill((ir+1)->s)) ra_save(as, ir+1, RID_RETHI);\n  if (ra_hasspill(ir->s)) ra_save(as, ir, RID_RETLO);\n}\n#endif\n\n/* -- Snapshot handling --------- ----------------------------------------- */\n\n/* Can we rematerialize a KNUM instead of forcing a spill? */\nstatic int asm_snap_canremat(ASMState *as)\n{\n  Reg r;\n  for (r = RID_MIN_FPR; r < RID_MAX_FPR; r++)\n    if (irref_isk(regcost_ref(as->cost[r])))\n      return 1;\n  return 0;\n}\n\n/* Check whether a sunk store corresponds to an allocation. */\nstatic int asm_sunk_store(ASMState *as, IRIns *ira, IRIns *irs)\n{\n  if (irs->s == 255) {\n    if (irs->o == IR_ASTORE || irs->o == IR_HSTORE ||\n\tirs->o == IR_FSTORE || irs->o == IR_XSTORE) {\n      IRIns *irk = IR(irs->op1);\n      if (irk->o == IR_AREF || irk->o == IR_HREFK)\n\tirk = IR(irk->op1);\n      return (IR(irk->op1) == ira);\n    }\n    return 0;\n  } else {\n    return (ira + irs->s == irs);  /* Quick check. */\n  }\n}\n\n/* Allocate register or spill slot for a ref that escapes to a snapshot. */\nstatic void asm_snap_alloc1(ASMState *as, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (!irref_isk(ref) && (!(ra_used(ir) || ir->r == RID_SUNK))) {\n    if (ir->r == RID_SINK) {\n      ir->r = RID_SUNK;\n#if LJ_HASFFI\n      if (ir->o == IR_CNEWI) {  /* Allocate CNEWI value. */\n\tasm_snap_alloc1(as, ir->op2);\n\tif (LJ_32 && (ir+1)->o == IR_HIOP)\n\t  asm_snap_alloc1(as, (ir+1)->op2);\n      } else\n#endif\n      {  /* Allocate stored values for TNEW, TDUP and CNEW. */\n\tIRIns *irs;\n\tlua_assert(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW);\n\tfor (irs = IR(as->snapref-1); irs > ir; irs--)\n\t  if (irs->r == RID_SINK && asm_sunk_store(as, ir, irs)) {\n\t    lua_assert(irs->o == IR_ASTORE || irs->o == IR_HSTORE ||\n\t\t       irs->o == IR_FSTORE || irs->o == IR_XSTORE);\n\t    asm_snap_alloc1(as, irs->op2);\n\t    if (LJ_32 && (irs+1)->o == IR_HIOP)\n\t      asm_snap_alloc1(as, (irs+1)->op2);\n\t  }\n      }\n    } else {\n      RegSet allow;\n      if (ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT) {\n\tIRIns *irc;\n\tfor (irc = IR(as->curins); irc > ir; irc--)\n\t  if ((irc->op1 == ref || irc->op2 == ref) &&\n\t      !(irc->r == RID_SINK || irc->r == RID_SUNK))\n\t    goto nosink;  /* Don't sink conversion if result is used. */\n\tasm_snap_alloc1(as, ir->op1);\n\treturn;\n      }\n    nosink:\n      allow = (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR;\n      if ((as->freeset & allow) ||\n\t       (allow == RSET_FPR && asm_snap_canremat(as))) {\n\t/* Get a weak register if we have a free one or can rematerialize. */\n\tReg r = ra_allocref(as, ref, allow);  /* Allocate a register. */\n\tif (!irt_isphi(ir->t))\n\t  ra_weak(as, r);  /* But mark it as weakly referenced. */\n\tcheckmclim(as);\n\tRA_DBGX((as, \"snapreg   $f $r\", ref, ir->r));\n      } else {\n\tra_spill(as, ir);  /* Otherwise force a spill slot. */\n\tRA_DBGX((as, \"snapspill $f $s\", ref, ir->s));\n      }\n    }\n  }\n}\n\n/* Allocate refs escaping to a snapshot. */\nstatic void asm_snap_alloc(ASMState *as)\n{\n  SnapShot *snap = &as->T->snap[as->snapno];\n  SnapEntry *map = &as->T->snapmap[snap->mapofs];\n  MSize n, nent = snap->nent;\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    IRRef ref = snap_ref(sn);\n    if (!irref_isk(ref)) {\n      asm_snap_alloc1(as, ref);\n      if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM)) {\n\tlua_assert(irt_type(IR(ref+1)->t) == IRT_SOFTFP);\n\tasm_snap_alloc1(as, ref+1);\n      }\n    }\n  }\n}\n\n/* All guards for a snapshot use the same exitno. This is currently the\n** same as the snapshot number. Since the exact origin of the exit cannot\n** be determined, all guards for the same snapshot must exit with the same\n** RegSP mapping.\n** A renamed ref which has been used in a prior guard for the same snapshot\n** would cause an inconsistency. The easy way out is to force a spill slot.\n*/\nstatic int asm_snap_checkrename(ASMState *as, IRRef ren)\n{\n  SnapShot *snap = &as->T->snap[as->snapno];\n  SnapEntry *map = &as->T->snapmap[snap->mapofs];\n  MSize n, nent = snap->nent;\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    IRRef ref = snap_ref(sn);\n    if (ref == ren || (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && ++ref == ren)) {\n      IRIns *ir = IR(ref);\n      ra_spill(as, ir);  /* Register renamed, so force a spill slot. */\n      RA_DBGX((as, \"snaprensp $f $s\", ref, ir->s));\n      return 1;  /* Found. */\n    }\n  }\n  return 0;  /* Not found. */\n}\n\n/* Prepare snapshot for next guard instruction. */\nstatic void asm_snap_prep(ASMState *as)\n{\n  if (as->curins < as->snapref) {\n    do {\n      if (as->snapno == 0) return;  /* Called by sunk stores before snap #0. */\n      as->snapno--;\n      as->snapref = as->T->snap[as->snapno].ref;\n    } while (as->curins < as->snapref);\n    asm_snap_alloc(as);\n    as->snaprename = as->T->nins;\n  } else {\n    /* Process any renames above the highwater mark. */\n    for (; as->snaprename < as->T->nins; as->snaprename++) {\n      IRIns *ir = IR(as->snaprename);\n      if (asm_snap_checkrename(as, ir->op1))\n\tir->op2 = REF_BIAS-1;  /* Kill rename. */\n    }\n  }\n}\n\n/* -- Miscellaneous helpers ----------------------------------------------- */\n\n/* Collect arguments from CALL* and CARG instructions. */\nstatic void asm_collectargs(ASMState *as, IRIns *ir,\n\t\t\t    const CCallInfo *ci, IRRef *args)\n{\n  uint32_t n = CCI_NARGS(ci);\n  lua_assert(n <= CCI_NARGS_MAX);\n  if ((ci->flags & CCI_L)) { *args++ = ASMREF_L; n--; }\n  while (n-- > 1) {\n    ir = IR(ir->op1);\n    lua_assert(ir->o == IR_CARG);\n    args[n] = ir->op2 == REF_NIL ? 0 : ir->op2;\n  }\n  args[0] = ir->op1 == REF_NIL ? 0 : ir->op1;\n  lua_assert(IR(ir->op1)->o != IR_CARG);\n}\n\n/* Reconstruct CCallInfo flags for CALLX*. */\nstatic uint32_t asm_callx_flags(ASMState *as, IRIns *ir)\n{\n  uint32_t nargs = 0;\n  if (ir->op1 != REF_NIL) {  /* Count number of arguments first. */\n    IRIns *ira = IR(ir->op1);\n    nargs++;\n    while (ira->o == IR_CARG) { nargs++; ira = IR(ira->op1); }\n  }\n#if LJ_HASFFI\n  if (IR(ir->op2)->o == IR_CARG) {  /* Copy calling convention info. */\n    CTypeID id = (CTypeID)IR(IR(ir->op2)->op2)->i;\n    CType *ct = ctype_get(ctype_ctsG(J2G(as->J)), id);\n    nargs |= ((ct->info & CTF_VARARG) ? CCI_VARARG : 0);\n#if LJ_TARGET_X86\n    nargs |= (ctype_cconv(ct->info) << CCI_CC_SHIFT);\n#endif\n  }\n#endif\n  return (nargs | (ir->t.irt << CCI_OTSHIFT));\n}\n\n/* Calculate stack adjustment. */\nstatic int32_t asm_stack_adjust(ASMState *as)\n{\n  if (as->evenspill <= SPS_FIXED)\n    return 0;\n  return sps_scale(sps_align(as->evenspill));\n}\n\n/* Must match with hash*() in lj_tab.c. */\nstatic uint32_t ir_khash(IRIns *ir)\n{\n  uint32_t lo, hi;\n  if (irt_isstr(ir->t)) {\n    return ir_kstr(ir)->hash;\n  } else if (irt_isnum(ir->t)) {\n    lo = ir_knum(ir)->u32.lo;\n    hi = ir_knum(ir)->u32.hi << 1;\n  } else if (irt_ispri(ir->t)) {\n    lua_assert(!irt_isnil(ir->t));\n    return irt_type(ir->t)-IRT_FALSE;\n  } else {\n    lua_assert(irt_isgcv(ir->t));\n    lo = u32ptr(ir_kgc(ir));\n    hi = lo + HASH_BIAS;\n  }\n  return hashrot(lo, hi);\n}\n\n/* -- Allocations --------------------------------------------------------- */\n\nstatic void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args);\nstatic void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci);\n\nstatic void asm_snew(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_new];\n  IRRef args[3];\n  args[0] = ASMREF_L;  /* lua_State *L    */\n  args[1] = ir->op1;   /* const char *str */\n  args[2] = ir->op2;   /* size_t len      */\n  as->gcsteps++;\n  asm_setupresult(as, ir, ci);  /* GCstr * */\n  asm_gencall(as, ci, args);\n}\n\nstatic void asm_tnew(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_new1];\n  IRRef args[2];\n  args[0] = ASMREF_L;     /* lua_State *L    */\n  args[1] = ASMREF_TMP1;  /* uint32_t ahsize */\n  as->gcsteps++;\n  asm_setupresult(as, ir, ci);  /* GCtab * */\n  asm_gencall(as, ci, args);\n  ra_allockreg(as, ir->op1 | (ir->op2 << 24), ra_releasetmp(as, ASMREF_TMP1));\n}\n\nstatic void asm_tdup(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_dup];\n  IRRef args[2];\n  args[0] = ASMREF_L;  /* lua_State *L    */\n  args[1] = ir->op1;   /* const GCtab *kt */\n  as->gcsteps++;\n  asm_setupresult(as, ir, ci);  /* GCtab * */\n  asm_gencall(as, ci, args);\n}\n\nstatic void asm_gc_check(ASMState *as);\n\n/* Explicit GC step. */\nstatic void asm_gcstep(ASMState *as, IRIns *ir)\n{\n  IRIns *ira;\n  for (ira = IR(as->stopins+1); ira < ir; ira++)\n    if ((ira->o == IR_TNEW || ira->o == IR_TDUP ||\n\t (LJ_HASFFI && (ira->o == IR_CNEW || ira->o == IR_CNEWI))) &&\n\tra_used(ira))\n      as->gcsteps++;\n  if (as->gcsteps)\n    asm_gc_check(as);\n  as->gcsteps = 0x80000000;  /* Prevent implicit GC check further up. */\n}\n\n/* -- PHI and loop handling ----------------------------------------------- */\n\n/* Break a PHI cycle by renaming to a free register (evict if needed). */\nstatic void asm_phi_break(ASMState *as, RegSet blocked, RegSet blockedby,\n\t\t\t  RegSet allow)\n{\n  RegSet candidates = blocked & allow;\n  if (candidates) {  /* If this register file has candidates. */\n    /* Note: the set for ra_pick cannot be empty, since each register file\n    ** has some registers never allocated to PHIs.\n    */\n    Reg down, up = ra_pick(as, ~blocked & allow);  /* Get a free register. */\n    if (candidates & ~blockedby)  /* Optimize shifts, else it's a cycle. */\n      candidates = candidates & ~blockedby;\n    down = rset_picktop(candidates);  /* Pick candidate PHI register. */\n    ra_rename(as, down, up);  /* And rename it to the free register. */\n  }\n}\n\n/* PHI register shuffling.\n**\n** The allocator tries hard to preserve PHI register assignments across\n** the loop body. Most of the time this loop does nothing, since there\n** are no register mismatches.\n**\n** If a register mismatch is detected and ...\n** - the register is currently free: rename it.\n** - the register is blocked by an invariant: restore/remat and rename it.\n** - Otherwise the register is used by another PHI, so mark it as blocked.\n**\n** The renames are order-sensitive, so just retry the loop if a register\n** is marked as blocked, but has been freed in the meantime. A cycle is\n** detected if all of the blocked registers are allocated. To break the\n** cycle rename one of them to a free register and retry.\n**\n** Note that PHI spill slots are kept in sync and don't need to be shuffled.\n*/\nstatic void asm_phi_shuffle(ASMState *as)\n{\n  RegSet work;\n\n  /* Find and resolve PHI register mismatches. */\n  for (;;) {\n    RegSet blocked = RSET_EMPTY;\n    RegSet blockedby = RSET_EMPTY;\n    RegSet phiset = as->phiset;\n    while (phiset) {  /* Check all left PHI operand registers. */\n      Reg r = rset_pickbot(phiset);\n      IRIns *irl = IR(as->phireg[r]);\n      Reg left = irl->r;\n      if (r != left) {  /* Mismatch? */\n\tif (!rset_test(as->freeset, r)) {  /* PHI register blocked? */\n\t  IRRef ref = regcost_ref(as->cost[r]);\n\t  /* Blocked by other PHI (w/reg)? */\n\t  if (!ra_iskref(ref) && irt_ismarked(IR(ref)->t)) {\n\t    rset_set(blocked, r);\n\t    if (ra_hasreg(left))\n\t      rset_set(blockedby, left);\n\t    left = RID_NONE;\n\t  } else {  /* Otherwise grab register from invariant. */\n\t    ra_restore(as, ref);\n\t    checkmclim(as);\n\t  }\n\t}\n\tif (ra_hasreg(left)) {\n\t  ra_rename(as, left, r);\n\t  checkmclim(as);\n\t}\n      }\n      rset_clear(phiset, r);\n    }\n    if (!blocked) break;  /* Finished. */\n    if (!(as->freeset & blocked)) {  /* Break cycles if none are free. */\n      asm_phi_break(as, blocked, blockedby, RSET_GPR);\n      if (!LJ_SOFTFP) asm_phi_break(as, blocked, blockedby, RSET_FPR);\n      checkmclim(as);\n    }  /* Else retry some more renames. */\n  }\n\n  /* Restore/remat invariants whose registers are modified inside the loop. */\n#if !LJ_SOFTFP\n  work = as->modset & ~(as->freeset | as->phiset) & RSET_FPR;\n  while (work) {\n    Reg r = rset_pickbot(work);\n    ra_restore(as, regcost_ref(as->cost[r]));\n    rset_clear(work, r);\n    checkmclim(as);\n  }\n#endif\n  work = as->modset & ~(as->freeset | as->phiset);\n  while (work) {\n    Reg r = rset_pickbot(work);\n    ra_restore(as, regcost_ref(as->cost[r]));\n    rset_clear(work, r);\n    checkmclim(as);\n  }\n\n  /* Allocate and save all unsaved PHI regs and clear marks. */\n  work = as->phiset;\n  while (work) {\n    Reg r = rset_picktop(work);\n    IRRef lref = as->phireg[r];\n    IRIns *ir = IR(lref);\n    if (ra_hasspill(ir->s)) {  /* Left PHI gained a spill slot? */\n      irt_clearmark(ir->t);  /* Handled here, so clear marker now. */\n      ra_alloc1(as, lref, RID2RSET(r));\n      ra_save(as, ir, r);  /* Save to spill slot inside the loop. */\n      checkmclim(as);\n    }\n    rset_clear(work, r);\n  }\n}\n\n/* Copy unsynced left/right PHI spill slots. Rarely needed. */\nstatic void asm_phi_copyspill(ASMState *as)\n{\n  int need = 0;\n  IRIns *ir;\n  for (ir = IR(as->orignins-1); ir->o == IR_PHI; ir--)\n    if (ra_hasspill(ir->s) && ra_hasspill(IR(ir->op1)->s))\n      need |= irt_isfp(ir->t) ? 2 : 1;  /* Unsynced spill slot? */\n  if ((need & 1)) {  /* Copy integer spill slots. */\n#if !LJ_TARGET_X86ORX64\n    Reg r = RID_TMP;\n#else\n    Reg r = RID_RET;\n    if ((as->freeset & RSET_GPR))\n      r = rset_pickbot((as->freeset & RSET_GPR));\n    else\n      emit_spload(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP);\n#endif\n    for (ir = IR(as->orignins-1); ir->o == IR_PHI; ir--) {\n      if (ra_hasspill(ir->s)) {\n\tIRIns *irl = IR(ir->op1);\n\tif (ra_hasspill(irl->s) && !irt_isfp(ir->t)) {\n\t  emit_spstore(as, irl, r, sps_scale(irl->s));\n\t  emit_spload(as, ir, r, sps_scale(ir->s));\n\t}\n      }\n    }\n#if LJ_TARGET_X86ORX64\n    if (!rset_test(as->freeset, r))\n      emit_spstore(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP);\n#endif\n  }\n#if !LJ_SOFTFP\n  if ((need & 2)) {  /* Copy FP spill slots. */\n#if LJ_TARGET_X86\n    Reg r = RID_XMM0;\n#else\n    Reg r = RID_FPRET;\n#endif\n    if ((as->freeset & RSET_FPR))\n      r = rset_pickbot((as->freeset & RSET_FPR));\n    if (!rset_test(as->freeset, r))\n      emit_spload(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP);\n    for (ir = IR(as->orignins-1); ir->o == IR_PHI; ir--) {\n      if (ra_hasspill(ir->s)) {\n\tIRIns *irl = IR(ir->op1);\n\tif (ra_hasspill(irl->s) && irt_isfp(ir->t)) {\n\t  emit_spstore(as, irl, r, sps_scale(irl->s));\n\t  emit_spload(as, ir, r, sps_scale(ir->s));\n\t}\n      }\n    }\n    if (!rset_test(as->freeset, r))\n      emit_spstore(as, IR(regcost_ref(as->cost[r])), r, SPOFS_TMP);\n  }\n#endif\n}\n\n/* Emit renames for left PHIs which are only spilled outside the loop. */\nstatic void asm_phi_fixup(ASMState *as)\n{\n  RegSet work = as->phiset;\n  while (work) {\n    Reg r = rset_picktop(work);\n    IRRef lref = as->phireg[r];\n    IRIns *ir = IR(lref);\n    /* Left PHI gained a spill slot before the loop? */\n    if (irt_ismarked(ir->t) && ra_hasspill(ir->s)) {\n      IRRef ren;\n      lj_ir_set(as->J, IRT(IR_RENAME, IRT_NIL), lref, as->loopsnapno);\n      ren = tref_ref(lj_ir_emit(as->J));\n      as->ir = as->T->ir;  /* The IR may have been reallocated. */\n      IR(ren)->r = (uint8_t)r;\n      IR(ren)->s = SPS_NONE;\n    }\n    irt_clearmark(ir->t);  /* Always clear marker. */\n    rset_clear(work, r);\n  }\n}\n\n/* Setup right PHI reference. */\nstatic void asm_phi(ASMState *as, IRIns *ir)\n{\n  RegSet allow = ((!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR) &\n\t\t ~as->phiset;\n  RegSet afree = (as->freeset & allow);\n  IRIns *irl = IR(ir->op1);\n  IRIns *irr = IR(ir->op2);\n  if (ir->r == RID_SINK)  /* Sink PHI. */\n    return;\n  /* Spill slot shuffling is not implemented yet (but rarely needed). */\n  if (ra_hasspill(irl->s) || ra_hasspill(irr->s))\n    lj_trace_err(as->J, LJ_TRERR_NYIPHI);\n  /* Leave at least one register free for non-PHIs (and PHI cycle breaking). */\n  if ((afree & (afree-1))) {  /* Two or more free registers? */\n    Reg r;\n    if (ra_noreg(irr->r)) {  /* Get a register for the right PHI. */\n      r = ra_allocref(as, ir->op2, allow);\n    } else {  /* Duplicate right PHI, need a copy (rare). */\n      r = ra_scratch(as, allow);\n      emit_movrr(as, irr, r, irr->r);\n    }\n    ir->r = (uint8_t)r;\n    rset_set(as->phiset, r);\n    as->phireg[r] = (IRRef1)ir->op1;\n    irt_setmark(irl->t);  /* Marks left PHIs _with_ register. */\n    if (ra_noreg(irl->r))\n      ra_sethint(irl->r, r); /* Set register hint for left PHI. */\n  } else {  /* Otherwise allocate a spill slot. */\n    /* This is overly restrictive, but it triggers only on synthetic code. */\n    if (ra_hasreg(irl->r) || ra_hasreg(irr->r))\n      lj_trace_err(as->J, LJ_TRERR_NYIPHI);\n    ra_spill(as, ir);\n    irr->s = ir->s;  /* Set right PHI spill slot. Sync left slot later. */\n  }\n}\n\nstatic void asm_loop_fixup(ASMState *as);\n\n/* Middle part of a loop. */\nstatic void asm_loop(ASMState *as)\n{\n  MCode *mcspill;\n  /* LOOP is a guard, so the snapno is up to date. */\n  as->loopsnapno = as->snapno;\n  if (as->gcsteps)\n    asm_gc_check(as);\n  /* LOOP marks the transition from the variant to the invariant part. */\n  as->flagmcp = as->invmcp = NULL;\n  as->sectref = 0;\n  if (!neverfuse(as)) as->fuseref = 0;\n  asm_phi_shuffle(as);\n  mcspill = as->mcp;\n  asm_phi_copyspill(as);\n  asm_loop_fixup(as);\n  as->mcloop = as->mcp;\n  RA_DBGX((as, \"===== LOOP =====\"));\n  if (!as->realign) RA_DBG_FLUSH();\n  if (as->mcp != mcspill)\n    emit_jmp(as, mcspill);\n}\n\n/* -- Target-specific assembler ------------------------------------------- */\n\n#if LJ_TARGET_X86ORX64\n#include \"lj_asm_x86.h\"\n#elif LJ_TARGET_ARM\n#include \"lj_asm_arm.h\"\n#elif LJ_TARGET_PPC\n#include \"lj_asm_ppc.h\"\n#elif LJ_TARGET_MIPS\n#include \"lj_asm_mips.h\"\n#else\n#error \"Missing assembler for target CPU\"\n#endif\n\n/* -- Head of trace ------------------------------------------------------- */\n\n/* Head of a root trace. */\nstatic void asm_head_root(ASMState *as)\n{\n  int32_t spadj;\n  asm_head_root_base(as);\n  emit_setvmstate(as, (int32_t)as->T->traceno);\n  spadj = asm_stack_adjust(as);\n  as->T->spadjust = (uint16_t)spadj;\n  emit_spsub(as, spadj);\n  /* Root traces assume a checked stack for the starting proto. */\n  as->T->topslot = gcref(as->T->startpt)->pt.framesize;\n}\n\n/* Head of a side trace.\n**\n** The current simplistic algorithm requires that all slots inherited\n** from the parent are live in a register between pass 2 and pass 3. This\n** avoids the complexity of stack slot shuffling. But of course this may\n** overflow the register set in some cases and cause the dreaded error:\n** \"NYI: register coalescing too complex\". A refined algorithm is needed.\n*/\nstatic void asm_head_side(ASMState *as)\n{\n  IRRef1 sloadins[RID_MAX];\n  RegSet allow = RSET_ALL;  /* Inverse of all coalesced registers. */\n  RegSet live = RSET_EMPTY;  /* Live parent registers. */\n  IRIns *irp = &as->parent->ir[REF_BASE];  /* Parent base. */\n  int32_t spadj, spdelta;\n  int pass2 = 0;\n  int pass3 = 0;\n  IRRef i;\n\n  allow = asm_head_side_base(as, irp, allow);\n\n  /* Scan all parent SLOADs and collect register dependencies. */\n  for (i = as->stopins; i > REF_BASE; i--) {\n    IRIns *ir = IR(i);\n    RegSP rs;\n    lua_assert((ir->o == IR_SLOAD && (ir->op2 & IRSLOAD_PARENT)) ||\n\t       (LJ_SOFTFP && ir->o == IR_HIOP) || ir->o == IR_PVAL);\n    rs = as->parentmap[i - REF_FIRST];\n    if (ra_hasreg(ir->r)) {\n      rset_clear(allow, ir->r);\n      if (ra_hasspill(ir->s)) {\n\tra_save(as, ir, ir->r);\n\tcheckmclim(as);\n      }\n    } else if (ra_hasspill(ir->s)) {\n      irt_setmark(ir->t);\n      pass2 = 1;\n    }\n    if (ir->r == rs) {  /* Coalesce matching registers right now. */\n      ra_free(as, ir->r);\n    } else if (ra_hasspill(regsp_spill(rs))) {\n      if (ra_hasreg(ir->r))\n\tpass3 = 1;\n    } else if (ra_used(ir)) {\n      sloadins[rs] = (IRRef1)i;\n      rset_set(live, rs);  /* Block live parent register. */\n    }\n  }\n\n  /* Calculate stack frame adjustment. */\n  spadj = asm_stack_adjust(as);\n  spdelta = spadj - (int32_t)as->parent->spadjust;\n  if (spdelta < 0) {  /* Don't shrink the stack frame. */\n    spadj = (int32_t)as->parent->spadjust;\n    spdelta = 0;\n  }\n  as->T->spadjust = (uint16_t)spadj;\n\n  /* Reload spilled target registers. */\n  if (pass2) {\n    for (i = as->stopins; i > REF_BASE; i--) {\n      IRIns *ir = IR(i);\n      if (irt_ismarked(ir->t)) {\n\tRegSet mask;\n\tReg r;\n\tRegSP rs;\n\tirt_clearmark(ir->t);\n\trs = as->parentmap[i - REF_FIRST];\n\tif (!ra_hasspill(regsp_spill(rs)))\n\t  ra_sethint(ir->r, rs);  /* Hint may be gone, set it again. */\n\telse if (sps_scale(regsp_spill(rs))+spdelta == sps_scale(ir->s))\n\t  continue;  /* Same spill slot, do nothing. */\n\tmask = ((!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR) & allow;\n\tif (mask == RSET_EMPTY)\n\t  lj_trace_err(as->J, LJ_TRERR_NYICOAL);\n\tr = ra_allocref(as, i, mask);\n\tra_save(as, ir, r);\n\trset_clear(allow, r);\n\tif (r == rs) {  /* Coalesce matching registers right now. */\n\t  ra_free(as, r);\n\t  rset_clear(live, r);\n\t} else if (ra_hasspill(regsp_spill(rs))) {\n\t  pass3 = 1;\n\t}\n\tcheckmclim(as);\n      }\n    }\n  }\n\n  /* Store trace number and adjust stack frame relative to the parent. */\n  emit_setvmstate(as, (int32_t)as->T->traceno);\n  emit_spsub(as, spdelta);\n\n#if !LJ_TARGET_X86ORX64\n  /* Restore BASE register from parent spill slot. */\n  if (ra_hasspill(irp->s))\n    emit_spload(as, IR(REF_BASE), IR(REF_BASE)->r, sps_scale(irp->s));\n#endif\n\n  /* Restore target registers from parent spill slots. */\n  if (pass3) {\n    RegSet work = ~as->freeset & RSET_ALL;\n    while (work) {\n      Reg r = rset_pickbot(work);\n      IRRef ref = regcost_ref(as->cost[r]);\n      RegSP rs = as->parentmap[ref - REF_FIRST];\n      rset_clear(work, r);\n      if (ra_hasspill(regsp_spill(rs))) {\n\tint32_t ofs = sps_scale(regsp_spill(rs));\n\tra_free(as, r);\n\temit_spload(as, IR(ref), r, ofs);\n\tcheckmclim(as);\n      }\n    }\n  }\n\n  /* Shuffle registers to match up target regs with parent regs. */\n  for (;;) {\n    RegSet work;\n\n    /* Repeatedly coalesce free live registers by moving to their target. */\n    while ((work = as->freeset & live) != RSET_EMPTY) {\n      Reg rp = rset_pickbot(work);\n      IRIns *ir = IR(sloadins[rp]);\n      rset_clear(live, rp);\n      rset_clear(allow, rp);\n      ra_free(as, ir->r);\n      emit_movrr(as, ir, ir->r, rp);\n      checkmclim(as);\n    }\n\n    /* We're done if no live registers remain. */\n    if (live == RSET_EMPTY)\n      break;\n\n    /* Break cycles by renaming one target to a temp. register. */\n    if (live & RSET_GPR) {\n      RegSet tmpset = as->freeset & ~live & allow & RSET_GPR;\n      if (tmpset == RSET_EMPTY)\n\tlj_trace_err(as->J, LJ_TRERR_NYICOAL);\n      ra_rename(as, rset_pickbot(live & RSET_GPR), rset_pickbot(tmpset));\n    }\n    if (!LJ_SOFTFP && (live & RSET_FPR)) {\n      RegSet tmpset = as->freeset & ~live & allow & RSET_FPR;\n      if (tmpset == RSET_EMPTY)\n\tlj_trace_err(as->J, LJ_TRERR_NYICOAL);\n      ra_rename(as, rset_pickbot(live & RSET_FPR), rset_pickbot(tmpset));\n    }\n    checkmclim(as);\n    /* Continue with coalescing to fix up the broken cycle(s). */\n  }\n\n  /* Inherit top stack slot already checked by parent trace. */\n  as->T->topslot = as->parent->topslot;\n  if (as->topslot > as->T->topslot) {  /* Need to check for higher slot? */\n#ifdef EXITSTATE_CHECKEXIT\n    /* Highest exit + 1 indicates stack check. */\n    ExitNo exitno = as->T->nsnap;\n#else\n    /* Reuse the parent exit in the context of the parent trace. */\n    ExitNo exitno = as->J->exitno;\n#endif\n    as->T->topslot = (uint8_t)as->topslot;  /* Remember for child traces. */\n    asm_stack_check(as, as->topslot, irp, allow & RSET_GPR, exitno);\n  }\n}\n\n/* -- Tail of trace ------------------------------------------------------- */\n\n/* Get base slot for a snapshot. */\nstatic BCReg asm_baseslot(ASMState *as, SnapShot *snap, int *gotframe)\n{\n  SnapEntry *map = &as->T->snapmap[snap->mapofs];\n  MSize n;\n  for (n = snap->nent; n > 0; n--) {\n    SnapEntry sn = map[n-1];\n    if ((sn & SNAP_FRAME)) {\n      *gotframe = 1;\n      return snap_slot(sn);\n    }\n  }\n  return 0;\n}\n\n/* Link to another trace. */\nstatic void asm_tail_link(ASMState *as)\n{\n  SnapNo snapno = as->T->nsnap-1;  /* Last snapshot. */\n  SnapShot *snap = &as->T->snap[snapno];\n  int gotframe = 0;\n  BCReg baseslot = asm_baseslot(as, snap, &gotframe);\n\n  as->topslot = snap->topslot;\n  checkmclim(as);\n  ra_allocref(as, REF_BASE, RID2RSET(RID_BASE));\n\n  if (as->T->link == 0) {\n    /* Setup fixed registers for exit to interpreter. */\n    const BCIns *pc = snap_pc(as->T->snapmap[snap->mapofs + snap->nent]);\n    int32_t mres;\n    if (bc_op(*pc) == BC_JLOOP) {  /* NYI: find a better way to do this. */\n      BCIns *retpc = &traceref(as->J, bc_d(*pc))->startins;\n      if (bc_isret(bc_op(*retpc)))\n\tpc = retpc;\n    }\n    ra_allockreg(as, i32ptr(J2GG(as->J)->dispatch), RID_DISPATCH);\n    ra_allockreg(as, i32ptr(pc), RID_LPC);\n    mres = (int32_t)(snap->nslots - baseslot);\n    switch (bc_op(*pc)) {\n    case BC_CALLM: case BC_CALLMT:\n      mres -= (int32_t)(1 + bc_a(*pc) + bc_c(*pc)); break;\n    case BC_RETM: mres -= (int32_t)(bc_a(*pc) + bc_d(*pc)); break;\n    case BC_TSETM: mres -= (int32_t)bc_a(*pc); break;\n    default: if (bc_op(*pc) < BC_FUNCF) mres = 0; break;\n    }\n    ra_allockreg(as, mres, RID_RET);  /* Return MULTRES or 0. */\n  } else if (baseslot) {\n    /* Save modified BASE for linking to trace with higher start frame. */\n    emit_setgl(as, RID_BASE, jit_base);\n  }\n  emit_addptr(as, RID_BASE, 8*(int32_t)baseslot);\n\n  /* Sync the interpreter state with the on-trace state. */\n  asm_stack_restore(as, snap);\n\n  /* Root traces that add frames need to check the stack at the end. */\n  if (!as->parent && gotframe)\n    asm_stack_check(as, as->topslot, NULL, as->freeset & RSET_GPR, snapno);\n}\n\n/* -- Trace setup --------------------------------------------------------- */\n\n/* Clear reg/sp for all instructions and add register hints. */\nstatic void asm_setup_regsp(ASMState *as)\n{\n  GCtrace *T = as->T;\n  int sink = T->sinktags;\n  IRRef nins = T->nins;\n  IRIns *ir, *lastir;\n  int inloop;\n#if LJ_TARGET_ARM\n  uint32_t rload = 0xa6402a64;\n#endif\n\n  ra_setup(as);\n\n  /* Clear reg/sp for constants. */\n  for (ir = IR(T->nk), lastir = IR(REF_BASE); ir < lastir; ir++)\n    ir->prev = REGSP_INIT;\n\n  /* REF_BASE is used for implicit references to the BASE register. */\n  lastir->prev = REGSP_HINT(RID_BASE);\n\n  ir = IR(nins-1);\n  if (ir->o == IR_RENAME) {\n    do { ir--; nins--; } while (ir->o == IR_RENAME);\n    T->nins = nins;  /* Remove any renames left over from ASM restart. */\n  }\n  as->snaprename = nins;\n  as->snapref = nins;\n  as->snapno = T->nsnap;\n\n  as->stopins = REF_BASE;\n  as->orignins = nins;\n  as->curins = nins;\n\n  /* Setup register hints for parent link instructions. */\n  ir = IR(REF_FIRST);\n  if (as->parent) {\n    uint16_t *p;\n    lastir = lj_snap_regspmap(as->parent, as->J->exitno, ir);\n    if (lastir - ir > LJ_MAX_JSLOTS)\n      lj_trace_err(as->J, LJ_TRERR_NYICOAL);\n    as->stopins = (IRRef)((lastir-1) - as->ir);\n    for (p = as->parentmap; ir < lastir; ir++) {\n      RegSP rs = ir->prev;\n      *p++ = (uint16_t)rs;  /* Copy original parent RegSP to parentmap. */\n      if (!ra_hasspill(regsp_spill(rs)))\n\tir->prev = (uint16_t)REGSP_HINT(regsp_reg(rs));\n      else\n\tir->prev = REGSP_INIT;\n    }\n  }\n\n  inloop = 0;\n  as->evenspill = SPS_FIRST;\n  for (lastir = IR(nins); ir < lastir; ir++) {\n    if (sink) {\n      if (ir->r == RID_SINK)\n\tcontinue;\n      if (ir->r == RID_SUNK) {  /* Revert after ASM restart. */\n\tir->r = RID_SINK;\n\tcontinue;\n      }\n    }\n    switch (ir->o) {\n    case IR_LOOP:\n      inloop = 1;\n      break;\n#if LJ_TARGET_ARM\n    case IR_SLOAD:\n      if (!((ir->op2 & IRSLOAD_TYPECHECK) || (ir+1)->o == IR_HIOP))\n\tbreak;\n      /* fallthrough */\n    case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n      if (!LJ_SOFTFP && irt_isnum(ir->t)) break;\n      ir->prev = (uint16_t)REGSP_HINT((rload & 15));\n      rload = lj_ror(rload, 4);\n      continue;\n#endif\n    case IR_CALLXS: {\n      CCallInfo ci;\n      ci.flags = asm_callx_flags(as, ir);\n      ir->prev = asm_setup_call_slots(as, ir, &ci);\n      if (inloop)\n\tas->modset |= RSET_SCRATCH;\n      continue;\n      }\n    case IR_CALLN: case IR_CALLL: case IR_CALLS: {\n      const CCallInfo *ci = &lj_ir_callinfo[ir->op2];\n      ir->prev = asm_setup_call_slots(as, ir, ci);\n      if (inloop)\n\tas->modset |= (ci->flags & CCI_NOFPRCLOBBER) ?\n\t\t      (RSET_SCRATCH & ~RSET_FPR) : RSET_SCRATCH;\n      continue;\n      }\n#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI)\n    case IR_HIOP:\n      switch ((ir-1)->o) {\n#if LJ_SOFTFP && LJ_TARGET_ARM\n      case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n\tif (ra_hashint((ir-1)->r)) {\n\t  ir->prev = (ir-1)->prev + 1;\n\t  continue;\n\t}\n\tbreak;\n#endif\n#if !LJ_SOFTFP && LJ_NEED_FP64\n      case IR_CONV:\n\tif (irt_isfp((ir-1)->t)) {\n\t  ir->prev = REGSP_HINT(RID_FPRET);\n\t  continue;\n\t}\n\t/* fallthrough */\n#endif\n      case IR_CALLN: case IR_CALLXS:\n#if LJ_SOFTFP\n      case IR_MIN: case IR_MAX:\n#endif\n\t(ir-1)->prev = REGSP_HINT(RID_RETLO);\n\tir->prev = REGSP_HINT(RID_RETHI);\n\tcontinue;\n      default:\n\tbreak;\n      }\n      break;\n#endif\n#if LJ_SOFTFP\n    case IR_MIN: case IR_MAX:\n      if ((ir+1)->o != IR_HIOP) break;\n      /* fallthrough */\n#endif\n    /* C calls evict all scratch regs and return results in RID_RET. */\n    case IR_SNEW: case IR_XSNEW: case IR_NEWREF:\n      if (REGARG_NUMGPR < 3 && as->evenspill < 3)\n\tas->evenspill = 3;  /* lj_str_new and lj_tab_newkey need 3 args. */\n    case IR_TNEW: case IR_TDUP: case IR_CNEW: case IR_CNEWI: case IR_TOSTR:\n      ir->prev = REGSP_HINT(RID_RET);\n      if (inloop)\n\tas->modset = RSET_SCRATCH;\n      continue;\n    case IR_STRTO: case IR_OBAR:\n      if (inloop)\n\tas->modset = RSET_SCRATCH;\n      break;\n#if !LJ_TARGET_X86ORX64 && !LJ_SOFTFP\n    case IR_ATAN2: case IR_LDEXP:\n#endif\n    case IR_POW:\n      if (!LJ_SOFTFP && irt_isnum(ir->t)) {\n#if LJ_TARGET_X86ORX64\n\tir->prev = REGSP_HINT(RID_XMM0);\n\tif (inloop)\n\t  as->modset |= RSET_RANGE(RID_XMM0, RID_XMM1+1)|RID2RSET(RID_EAX);\n#else\n\tir->prev = REGSP_HINT(RID_FPRET);\n\tif (inloop)\n\t  as->modset |= RSET_SCRATCH;\n#endif\n\tcontinue;\n      }\n      /* fallthrough for integer POW */\n    case IR_DIV: case IR_MOD:\n      if (!irt_isnum(ir->t)) {\n\tir->prev = REGSP_HINT(RID_RET);\n\tif (inloop)\n\t  as->modset |= (RSET_SCRATCH & RSET_GPR);\n\tcontinue;\n      }\n      break;\n    case IR_FPMATH:\n#if LJ_TARGET_X86ORX64\n      if (ir->op2 == IRFPM_EXP2) {  /* May be joined to lj_vm_pow_sse. */\n\tir->prev = REGSP_HINT(RID_XMM0);\n#if !LJ_64\n\tif (as->evenspill < 4)  /* Leave room for 16 byte scratch area. */\n\t  as->evenspill = 4;\n#endif\n\tif (inloop)\n\t  as->modset |= RSET_RANGE(RID_XMM0, RID_XMM2+1)|RID2RSET(RID_EAX);\n\tcontinue;\n      } else if (ir->op2 <= IRFPM_TRUNC && !(as->flags & JIT_F_SSE4_1)) {\n\tir->prev = REGSP_HINT(RID_XMM0);\n\tif (inloop)\n\t  as->modset |= RSET_RANGE(RID_XMM0, RID_XMM3+1)|RID2RSET(RID_EAX);\n\tcontinue;\n      }\n      break;\n#else\n      ir->prev = REGSP_HINT(RID_FPRET);\n      if (inloop)\n\tas->modset |= RSET_SCRATCH;\n      continue;\n#endif\n#if LJ_TARGET_X86ORX64\n    /* Non-constant shift counts need to be in RID_ECX on x86/x64. */\n    case IR_BSHL: case IR_BSHR: case IR_BSAR: case IR_BROL: case IR_BROR:\n      if (!irref_isk(ir->op2) && !ra_hashint(IR(ir->op2)->r)) {\n\tIR(ir->op2)->r = REGSP_HINT(RID_ECX);\n\tif (inloop)\n\t  rset_set(as->modset, RID_ECX);\n      }\n      break;\n#endif\n    /* Do not propagate hints across type conversions or loads. */\n    case IR_TOBIT:\n    case IR_XLOAD:\n#if !LJ_TARGET_ARM\n    case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n#endif\n      break;\n    case IR_CONV:\n      if (irt_isfp(ir->t) || (ir->op2 & IRCONV_SRCMASK) == IRT_NUM ||\n\t  (ir->op2 & IRCONV_SRCMASK) == IRT_FLOAT)\n\tbreak;\n      /* fallthrough */\n    default:\n      /* Propagate hints across likely 'op reg, imm' or 'op reg'. */\n      if (irref_isk(ir->op2) && !irref_isk(ir->op1) &&\n\t  ra_hashint(regsp_reg(IR(ir->op1)->prev))) {\n\tir->prev = IR(ir->op1)->prev;\n\tcontinue;\n      }\n      break;\n    }\n    ir->prev = REGSP_INIT;\n  }\n  if ((as->evenspill & 1))\n    as->oddspill = as->evenspill++;\n  else\n    as->oddspill = 0;\n}\n\n/* -- Assembler core ------------------------------------------------------ */\n\n/* Assemble a trace. */\nvoid lj_asm_trace(jit_State *J, GCtrace *T)\n{\n  ASMState as_;\n  ASMState *as = &as_;\n  MCode *origtop;\n\n  /* Ensure an initialized instruction beyond the last one for HIOP checks. */\n  J->cur.nins = lj_ir_nextins(J);\n  J->cur.ir[J->cur.nins].o = IR_NOP;\n\n  /* Setup initial state. Copy some fields to reduce indirections. */\n  as->J = J;\n  as->T = T;\n  as->ir = T->ir;\n  as->flags = J->flags;\n  as->loopref = J->loopref;\n  as->realign = NULL;\n  as->loopinv = 0;\n  as->parent = J->parent ? traceref(J, J->parent) : NULL;\n\n  /* Reserve MCode memory. */\n  as->mctop = origtop = lj_mcode_reserve(J, &as->mcbot);\n  as->mcp = as->mctop;\n  as->mclim = as->mcbot + MCLIM_REDZONE;\n  asm_setup_target(as);\n\n  do {\n    as->mcp = as->mctop;\n    as->curins = T->nins;\n    RA_DBG_START();\n    RA_DBGX((as, \"===== STOP =====\"));\n\n    /* General trace setup. Emit tail of trace. */\n    asm_tail_prep(as);\n    as->mcloop = NULL;\n    as->flagmcp = NULL;\n    as->topslot = 0;\n    as->gcsteps = 0;\n    as->sectref = as->loopref;\n    as->fuseref = (as->flags & JIT_F_OPT_FUSE) ? as->loopref : FUSE_DISABLED;\n    asm_setup_regsp(as);\n    if (!as->loopref)\n      asm_tail_link(as);\n\n    /* Assemble a trace in linear backwards order. */\n    for (as->curins--; as->curins > as->stopins; as->curins--) {\n      IRIns *ir = IR(as->curins);\n      lua_assert(!(LJ_32 && irt_isint64(ir->t)));  /* Handled by SPLIT. */\n      if (!ra_used(ir) && !ir_sideeff(ir) && (as->flags & JIT_F_OPT_DCE))\n\tcontinue;  /* Dead-code elimination can be soooo easy. */\n      if (irt_isguard(ir->t))\n\tasm_snap_prep(as);\n      RA_DBG_REF();\n      checkmclim(as);\n      asm_ir(as, ir);\n    }\n  } while (as->realign);  /* Retry in case the MCode needs to be realigned. */\n\n  /* Emit head of trace. */\n  RA_DBG_REF();\n  checkmclim(as);\n  if (as->gcsteps > 0) {\n    as->curins = as->T->snap[0].ref;\n    asm_snap_prep(as);  /* The GC check is a guard. */\n    asm_gc_check(as);\n  }\n  ra_evictk(as);\n  if (as->parent)\n    asm_head_side(as);\n  else\n    asm_head_root(as);\n  asm_phi_fixup(as);\n\n  RA_DBGX((as, \"===== START ====\"));\n  RA_DBG_FLUSH();\n  if (as->freeset != RSET_ALL)\n    lj_trace_err(as->J, LJ_TRERR_BADRA);  /* Ouch! Should never happen. */\n\n  /* Set trace entry point before fixing up tail to allow link to self. */\n  T->mcode = as->mcp;\n  T->mcloop = as->mcloop ? (MSize)((char *)as->mcloop - (char *)as->mcp) : 0;\n  if (!as->loopref)\n    asm_tail_fixup(as, T->link);  /* Note: this may change as->mctop! */\n  T->szmcode = (MSize)((char *)as->mctop - (char *)as->mcp);\n  lj_mcode_sync(T->mcode, origtop);\n}\n\n#undef IR\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_asm.h",
    "content": "/*\n** IR assembler (SSA IR -> machine code).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_ASM_H\n#define _LJ_ASM_H\n\n#include \"lj_jit.h\"\n\n#if LJ_HASJIT\nLJ_FUNC void lj_asm_trace(jit_State *J, GCtrace *T);\nLJ_FUNC void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno,\n\t\t\t      MCode *target);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_asm_arm.h",
    "content": "/*\n** ARM IR assembler (SSA IR -> machine code).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Register allocator extensions --------------------------------------- */\n\n/* Allocate a register with a hint. */\nstatic Reg ra_hintalloc(ASMState *as, IRRef ref, Reg hint, RegSet allow)\n{\n  Reg r = IR(ref)->r;\n  if (ra_noreg(r)) {\n    if (!ra_hashint(r) && !iscrossref(as, ref))\n      ra_sethint(IR(ref)->r, hint);  /* Propagate register hint. */\n    r = ra_allocref(as, ref, allow);\n  }\n  ra_noweak(as, r);\n  return r;\n}\n\n/* Allocate a scratch register pair. */\nstatic Reg ra_scratchpair(ASMState *as, RegSet allow)\n{\n  RegSet pick1 = as->freeset & allow;\n  RegSet pick2 = pick1 & (pick1 >> 1) & RSET_GPREVEN;\n  Reg r;\n  if (pick2) {\n    r = rset_picktop(pick2);\n  } else {\n    RegSet pick = pick1 & (allow >> 1) & RSET_GPREVEN;\n    if (pick) {\n      r = rset_picktop(pick);\n      ra_restore(as, regcost_ref(as->cost[r+1]));\n    } else {\n      pick = pick1 & (allow << 1) & RSET_GPRODD;\n      if (pick) {\n\tr = ra_restore(as, regcost_ref(as->cost[rset_picktop(pick)-1]));\n      } else {\n\tr = ra_evict(as, allow & (allow >> 1) & RSET_GPREVEN);\n\tra_restore(as, regcost_ref(as->cost[r+1]));\n      }\n    }\n  }\n  lua_assert(rset_test(RSET_GPREVEN, r));\n  ra_modified(as, r);\n  ra_modified(as, r+1);\n  RA_DBGX((as, \"scratchpair    $r $r\", r, r+1));\n  return r;\n}\n\n#if !LJ_SOFTFP\n/* Allocate two source registers for three-operand instructions. */\nstatic Reg ra_alloc2(ASMState *as, IRIns *ir, RegSet allow)\n{\n  IRIns *irl = IR(ir->op1), *irr = IR(ir->op2);\n  Reg left = irl->r, right = irr->r;\n  if (ra_hasreg(left)) {\n    ra_noweak(as, left);\n    if (ra_noreg(right))\n      right = ra_allocref(as, ir->op2, rset_exclude(allow, left));\n    else\n      ra_noweak(as, right);\n  } else if (ra_hasreg(right)) {\n    ra_noweak(as, right);\n    left = ra_allocref(as, ir->op1, rset_exclude(allow, right));\n  } else if (ra_hashint(right)) {\n    right = ra_allocref(as, ir->op2, allow);\n    left = ra_alloc1(as, ir->op1, rset_exclude(allow, right));\n  } else {\n    left = ra_allocref(as, ir->op1, allow);\n    right = ra_alloc1(as, ir->op2, rset_exclude(allow, left));\n  }\n  return left | (right << 8);\n}\n#endif\n\n/* -- Guard handling ------------------------------------------------------ */\n\n/* Generate an exit stub group at the bottom of the reserved MCode memory. */\nstatic MCode *asm_exitstub_gen(ASMState *as, ExitNo group)\n{\n  MCode *mxp = as->mcbot;\n  int i;\n  if (mxp + 4*4+4*EXITSTUBS_PER_GROUP >= as->mctop)\n    asm_mclimit(as);\n  /* str lr, [sp]; bl ->vm_exit_handler; .long DISPATCH_address, group. */\n  *mxp++ = ARMI_STR|ARMI_LS_P|ARMI_LS_U|ARMF_D(RID_LR)|ARMF_N(RID_SP);\n  *mxp = ARMI_BL|((((MCode *)(void *)lj_vm_exit_handler-mxp)-2)&0x00ffffffu);\n  mxp++;\n  *mxp++ = (MCode)i32ptr(J2GG(as->J)->dispatch);  /* DISPATCH address */\n  *mxp++ = group*EXITSTUBS_PER_GROUP;\n  for (i = 0; i < EXITSTUBS_PER_GROUP; i++)\n    *mxp++ = ARMI_B|((-6-i)&0x00ffffffu);\n  lj_mcode_sync(as->mcbot, mxp);\n  lj_mcode_commitbot(as->J, mxp);\n  as->mcbot = mxp;\n  as->mclim = as->mcbot + MCLIM_REDZONE;\n  return mxp - EXITSTUBS_PER_GROUP;\n}\n\n/* Setup all needed exit stubs. */\nstatic void asm_exitstub_setup(ASMState *as, ExitNo nexits)\n{\n  ExitNo i;\n  if (nexits >= EXITSTUBS_PER_GROUP*LJ_MAX_EXITSTUBGR)\n    lj_trace_err(as->J, LJ_TRERR_SNAPOV);\n  for (i = 0; i < (nexits+EXITSTUBS_PER_GROUP-1)/EXITSTUBS_PER_GROUP; i++)\n    if (as->J->exitstubgroup[i] == NULL)\n      as->J->exitstubgroup[i] = asm_exitstub_gen(as, i);\n}\n\n/* Emit conditional branch to exit for guard. */\nstatic void asm_guardcc(ASMState *as, ARMCC cc)\n{\n  MCode *target = exitstub_addr(as->J, as->snapno);\n  MCode *p = as->mcp;\n  if (LJ_UNLIKELY(p == as->invmcp)) {\n    as->loopinv = 1;\n    *p = ARMI_BL | ((target-p-2) & 0x00ffffffu);\n    emit_branch(as, ARMF_CC(ARMI_B, cc^1), p+1);\n    return;\n  }\n  emit_branch(as, ARMF_CC(ARMI_BL, cc), target);\n}\n\n/* -- Operand fusion ------------------------------------------------------ */\n\n/* Limit linear search to this distance. Avoids O(n^2) behavior. */\n#define CONFLICT_SEARCH_LIM\t31\n\n/* Check if there's no conflicting instruction between curins and ref. */\nstatic int noconflict(ASMState *as, IRRef ref, IROp conflict)\n{\n  IRIns *ir = as->ir;\n  IRRef i = as->curins;\n  if (i > ref + CONFLICT_SEARCH_LIM)\n    return 0;  /* Give up, ref is too far away. */\n  while (--i > ref)\n    if (ir[i].o == conflict)\n      return 0;  /* Conflict found. */\n  return 1;  /* Ok, no conflict. */\n}\n\n/* Fuse the array base of colocated arrays. */\nstatic int32_t asm_fuseabase(ASMState *as, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (ir->o == IR_TNEW && ir->op1 <= LJ_MAX_COLOSIZE &&\n      !neverfuse(as) && noconflict(as, ref, IR_NEWREF))\n    return (int32_t)sizeof(GCtab);\n  return 0;\n}\n\n/* Fuse array/hash/upvalue reference into register+offset operand. */\nstatic Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow,\n\t\t\t  int lim)\n{\n  IRIns *ir = IR(ref);\n  if (ra_noreg(ir->r)) {\n    if (ir->o == IR_AREF) {\n      if (mayfuse(as, ref)) {\n\tif (irref_isk(ir->op2)) {\n\t  IRRef tab = IR(ir->op1)->op1;\n\t  int32_t ofs = asm_fuseabase(as, tab);\n\t  IRRef refa = ofs ? tab : ir->op1;\n\t  ofs += 8*IR(ir->op2)->i;\n\t  if (ofs > -lim && ofs < lim) {\n\t    *ofsp = ofs;\n\t    return ra_alloc1(as, refa, allow);\n\t  }\n\t}\n      }\n    } else if (ir->o == IR_HREFK) {\n      if (mayfuse(as, ref)) {\n\tint32_t ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node));\n\tif (ofs < lim) {\n\t  *ofsp = ofs;\n\t  return ra_alloc1(as, ir->op1, allow);\n\t}\n      }\n    } else if (ir->o == IR_UREFC) {\n      if (irref_isk(ir->op1)) {\n\tGCfunc *fn = ir_kfunc(IR(ir->op1));\n\tint32_t ofs = i32ptr(&gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.tv);\n\t*ofsp = (ofs & 255);  /* Mask out less bits to allow LDRD. */\n\treturn ra_allock(as, (ofs & ~255), allow);\n      }\n    }\n  }\n  *ofsp = 0;\n  return ra_alloc1(as, ref, allow);\n}\n\n/* Fuse m operand into arithmetic/logic instructions. */\nstatic uint32_t asm_fuseopm(ASMState *as, ARMIns ai, IRRef ref, RegSet allow)\n{\n  IRIns *ir = IR(ref);\n  if (ra_hasreg(ir->r)) {\n    ra_noweak(as, ir->r);\n    return ARMF_M(ir->r);\n  } else if (irref_isk(ref)) {\n    uint32_t k = emit_isk12(ai, ir->i);\n    if (k)\n      return k;\n  } else if (mayfuse(as, ref)) {\n    if (ir->o >= IR_BSHL && ir->o <= IR_BROR) {\n      Reg m = ra_alloc1(as, ir->op1, allow);\n      ARMShift sh = ir->o == IR_BSHL ? ARMSH_LSL :\n\t\t    ir->o == IR_BSHR ? ARMSH_LSR :\n\t\t    ir->o == IR_BSAR ? ARMSH_ASR : ARMSH_ROR;\n      if (irref_isk(ir->op2)) {\n\treturn m | ARMF_SH(sh, (IR(ir->op2)->i & 31));\n      } else {\n\tReg s = ra_alloc1(as, ir->op2, rset_exclude(allow, m));\n\treturn m | ARMF_RSH(sh, s);\n      }\n    } else if (ir->o == IR_ADD && ir->op1 == ir->op2) {\n      Reg m = ra_alloc1(as, ir->op1, allow);\n      return m | ARMF_SH(ARMSH_LSL, 1);\n    }\n  }\n  return ra_allocref(as, ref, allow);\n}\n\n/* Fuse shifts into loads/stores. Only bother with BSHL 2 => lsl #2. */\nstatic IRRef asm_fuselsl2(ASMState *as, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (ra_noreg(ir->r) && mayfuse(as, ref) && ir->o == IR_BSHL &&\n      irref_isk(ir->op2) && IR(ir->op2)->i == 2)\n    return ir->op1;\n  return 0;  /* No fusion. */\n}\n\n/* Fuse XLOAD/XSTORE reference into load/store operand. */\nstatic void asm_fusexref(ASMState *as, ARMIns ai, Reg rd, IRRef ref,\n\t\t\t RegSet allow, int32_t ofs)\n{\n  IRIns *ir = IR(ref);\n  Reg base;\n  if (ra_noreg(ir->r) && canfuse(as, ir)) {\n    int32_t lim = (!LJ_SOFTFP && (ai & 0x08000000)) ? 1024 :\n\t\t   (ai & 0x04000000) ? 4096 : 256;\n    if (ir->o == IR_ADD) {\n      int32_t ofs2;\n      if (irref_isk(ir->op2) &&\n\t  (ofs2 = ofs + IR(ir->op2)->i) > -lim && ofs2 < lim &&\n\t  (!(!LJ_SOFTFP && (ai & 0x08000000)) || !(ofs2 & 3))) {\n\tofs = ofs2;\n\tref = ir->op1;\n      } else if (ofs == 0 && !(!LJ_SOFTFP && (ai & 0x08000000))) {\n\tIRRef lref = ir->op1, rref = ir->op2;\n\tReg rn, rm;\n\tif ((ai & 0x04000000)) {\n\t  IRRef sref = asm_fuselsl2(as, rref);\n\t  if (sref) {\n\t    rref = sref;\n\t    ai |= ARMF_SH(ARMSH_LSL, 2);\n\t  } else if ((sref = asm_fuselsl2(as, lref)) != 0) {\n\t    lref = rref;\n\t    rref = sref;\n\t    ai |= ARMF_SH(ARMSH_LSL, 2);\n\t  }\n\t}\n\trn = ra_alloc1(as, lref, allow);\n\trm = ra_alloc1(as, rref, rset_exclude(allow, rn));\n\tif ((ai & 0x04000000)) ai |= ARMI_LS_R;\n\temit_dnm(as, ai|ARMI_LS_P|ARMI_LS_U, rd, rn, rm);\n\treturn;\n      }\n    } else if (ir->o == IR_STRREF && !(!LJ_SOFTFP && (ai & 0x08000000))) {\n      lua_assert(ofs == 0);\n      ofs = (int32_t)sizeof(GCstr);\n      if (irref_isk(ir->op2)) {\n\tofs += IR(ir->op2)->i;\n\tref = ir->op1;\n      } else if (irref_isk(ir->op1)) {\n\tofs += IR(ir->op1)->i;\n\tref = ir->op2;\n      } else {\n\t/* NYI: Fuse ADD with constant. */\n\tReg rn = ra_alloc1(as, ir->op1, allow);\n\tuint32_t m = asm_fuseopm(as, 0, ir->op2, rset_exclude(allow, rn));\n\tif ((ai & 0x04000000))\n\t  emit_lso(as, ai, rd, rd, ofs);\n\telse\n\t  emit_lsox(as, ai, rd, rd, ofs);\n\temit_dn(as, ARMI_ADD^m, rd, rn);\n\treturn;\n      }\n      if (ofs <= -lim || ofs >= lim) {\n\tReg rn = ra_alloc1(as, ref, allow);\n\tReg rm = ra_allock(as, ofs, rset_exclude(allow, rn));\n\tif ((ai & 0x04000000)) ai |= ARMI_LS_R;\n\temit_dnm(as, ai|ARMI_LS_P|ARMI_LS_U, rd, rn, rm);\n\treturn;\n      }\n    }\n  }\n  base = ra_alloc1(as, ref, allow);\n#if !LJ_SOFTFP\n  if ((ai & 0x08000000))\n    emit_vlso(as, ai, rd, base, ofs);\n  else\n#endif\n  if ((ai & 0x04000000))\n    emit_lso(as, ai, rd, base, ofs);\n  else\n    emit_lsox(as, ai, rd, base, ofs);\n}\n\n#if !LJ_SOFTFP\n/* Fuse to multiply-add/sub instruction. */\nstatic int asm_fusemadd(ASMState *as, IRIns *ir, ARMIns ai, ARMIns air)\n{\n  IRRef lref = ir->op1, rref = ir->op2;\n  IRIns *irm;\n  if (lref != rref &&\n      ((mayfuse(as, lref) && (irm = IR(lref), irm->o == IR_MUL) &&\n\tra_noreg(irm->r)) ||\n       (mayfuse(as, rref) && (irm = IR(rref), irm->o == IR_MUL) &&\n\t(rref = lref, ai = air, ra_noreg(irm->r))))) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    Reg add = ra_hintalloc(as, rref, dest, RSET_FPR);\n    Reg right, left = ra_alloc2(as, irm,\n\t\t\trset_exclude(rset_exclude(RSET_FPR, dest), add));\n    right = (left >> 8); left &= 255;\n    emit_dnm(as, ai, (dest & 15), (left & 15), (right & 15));\n    if (dest != add) emit_dm(as, ARMI_VMOV_D, (dest & 15), (add & 15));\n    return 1;\n  }\n  return 0;\n}\n#endif\n\n/* -- Calls --------------------------------------------------------------- */\n\n/* Generate a call to a C function. */\nstatic void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)\n{\n  uint32_t n, nargs = CCI_NARGS(ci);\n  int32_t ofs = 0;\n#if LJ_SOFTFP\n  Reg gpr = REGARG_FIRSTGPR;\n#else\n  Reg gpr, fpr = REGARG_FIRSTFPR, fprodd = 0;\n#endif\n  if ((void *)ci->func)\n    emit_call(as, (void *)ci->func);\n#if !LJ_SOFTFP\n  for (gpr = REGARG_FIRSTGPR; gpr <= REGARG_LASTGPR; gpr++)\n    as->cost[gpr] = REGCOST(~0u, ASMREF_L);\n  gpr = REGARG_FIRSTGPR;\n#endif\n  for (n = 0; n < nargs; n++) {  /* Setup args. */\n    IRRef ref = args[n];\n    IRIns *ir = IR(ref);\n#if !LJ_SOFTFP\n    if (ref && irt_isfp(ir->t)) {\n      RegSet of = as->freeset;\n      Reg src;\n      if (!LJ_ABI_SOFTFP && !(ci->flags & CCI_VARARG)) {\n\tif (irt_isnum(ir->t)) {\n\t  if (fpr <= REGARG_LASTFPR) {\n\t    ra_leftov(as, fpr, ref);\n\t    fpr++;\n\t    continue;\n\t  }\n\t} else if (fprodd) {  /* Ick. */\n\t  src = ra_alloc1(as, ref, RSET_FPR);\n\t  emit_dm(as, ARMI_VMOV_S, (fprodd & 15), (src & 15) | 0x00400000);\n\t  fprodd = 0;\n\t  continue;\n\t} else if (fpr <= REGARG_LASTFPR) {\n\t  ra_leftov(as, fpr, ref);\n\t  fprodd = fpr++;\n\t  continue;\n\t}\n\t/* Workaround to protect argument GPRs from being used for remat. */\n\tas->freeset &= ~RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1);\n\tsrc = ra_alloc1(as, ref, RSET_FPR);  /* May alloc GPR to remat FPR. */\n\tas->freeset |= (of & RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1));\n\tfprodd = 0;\n\tgoto stackfp;\n      }\n      /* Workaround to protect argument GPRs from being used for remat. */\n      as->freeset &= ~RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1);\n      src = ra_alloc1(as, ref, RSET_FPR);  /* May alloc GPR to remat FPR. */\n      as->freeset |= (of & RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1));\n      if (irt_isnum(ir->t)) gpr = (gpr+1) & ~1u;\n      if (gpr <= REGARG_LASTGPR) {\n\tlua_assert(rset_test(as->freeset, gpr));  /* Must have been evicted. */\n\tif (irt_isnum(ir->t)) {\n\t  lua_assert(rset_test(as->freeset, gpr+1));  /* Ditto. */\n\t  emit_dnm(as, ARMI_VMOV_RR_D, gpr, gpr+1, (src & 15));\n\t  gpr += 2;\n\t} else {\n\t  emit_dn(as, ARMI_VMOV_R_S, gpr, (src & 15));\n\t  gpr++;\n\t}\n      } else {\n      stackfp:\n\tif (irt_isnum(ir->t)) ofs = (ofs + 4) & ~4;\n\temit_spstore(as, ir, src, ofs);\n\tofs += irt_isnum(ir->t) ? 8 : 4;\n      }\n    } else\n#endif\n    {\n      if (gpr <= REGARG_LASTGPR) {\n\tlua_assert(rset_test(as->freeset, gpr));  /* Must have been evicted. */\n\tif (ref) ra_leftov(as, gpr, ref);\n\tgpr++;\n      } else {\n\tif (ref) {\n\t  Reg r = ra_alloc1(as, ref, RSET_GPR);\n\t  emit_spstore(as, ir, r, ofs);\n\t}\n\tofs += 4;\n      }\n    }\n  }\n}\n\n/* Setup result reg/sp for call. Evict scratch regs. */\nstatic void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  RegSet drop = RSET_SCRATCH;\n  int hiop = ((ir+1)->o == IR_HIOP);\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  if (hiop && ra_hasreg((ir+1)->r))\n    rset_clear(drop, (ir+1)->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);  /* Evictions must be performed first. */\n  if (ra_used(ir)) {\n    lua_assert(!irt_ispri(ir->t));\n    if (!LJ_SOFTFP && irt_isfp(ir->t)) {\n      if (LJ_ABI_SOFTFP || (ci->flags & (CCI_CASTU64|CCI_VARARG))) {\n\tReg dest = (ra_dest(as, ir, RSET_FPR) & 15);\n\tif (irt_isnum(ir->t))\n\t  emit_dnm(as, ARMI_VMOV_D_RR, RID_RETLO, RID_RETHI, dest);\n\telse\n\t  emit_dn(as, ARMI_VMOV_S_R, RID_RET, dest);\n      } else {\n\tra_destreg(as, ir, RID_FPRET);\n      }\n    } else if (hiop) {\n      ra_destpair(as, ir);\n    } else {\n      ra_destreg(as, ir, RID_RET);\n    }\n  }\n  UNUSED(ci);\n}\n\nstatic void asm_call(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  const CCallInfo *ci = &lj_ir_callinfo[ir->op2];\n  asm_collectargs(as, ir, ci, args);\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\nstatic void asm_callx(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  CCallInfo ci;\n  IRRef func;\n  IRIns *irf;\n  ci.flags = asm_callx_flags(as, ir);\n  asm_collectargs(as, ir, &ci, args);\n  asm_setupresult(as, ir, &ci);\n  func = ir->op2; irf = IR(func);\n  if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); }\n  if (irref_isk(func)) {  /* Call to constant address. */\n    ci.func = (ASMFunction)(void *)(irf->i);\n  } else {  /* Need a non-argument register for indirect calls. */\n    Reg freg = ra_alloc1(as, func, RSET_RANGE(RID_R4, RID_R12+1));\n    emit_m(as, ARMI_BLXr, freg);\n    ci.func = (ASMFunction)(void *)0;\n  }\n  asm_gencall(as, &ci, args);\n}\n\n/* -- Returns ------------------------------------------------------------- */\n\n/* Return to lower frame. Guard that it goes to the right spot. */\nstatic void asm_retf(ASMState *as, IRIns *ir)\n{\n  Reg base = ra_alloc1(as, REF_BASE, RSET_GPR);\n  void *pc = ir_kptr(IR(ir->op2));\n  int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));\n  as->topslot -= (BCReg)delta;\n  if ((int32_t)as->topslot < 0) as->topslot = 0;\n  /* Need to force a spill on REF_BASE now to update the stack slot. */\n  emit_lso(as, ARMI_STR, base, RID_SP, ra_spill(as, IR(REF_BASE)));\n  emit_setgl(as, base, jit_base);\n  emit_addptr(as, base, -8*delta);\n  asm_guardcc(as, CC_NE);\n  emit_nm(as, ARMI_CMP, RID_TMP,\n\t  ra_allock(as, i32ptr(pc), rset_exclude(RSET_GPR, base)));\n  emit_lso(as, ARMI_LDR, RID_TMP, base, -4);\n}\n\n/* -- Type conversions ---------------------------------------------------- */\n\n#if !LJ_SOFTFP\nstatic void asm_tointg(ASMState *as, IRIns *ir, Reg left)\n{\n  Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left));\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  asm_guardcc(as, CC_NE);\n  emit_d(as, ARMI_VMRS, 0);\n  emit_dm(as, ARMI_VCMP_D, (tmp & 15), (left & 15));\n  emit_dm(as, ARMI_VCVT_F64_S32, (tmp & 15), (tmp & 15));\n  emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15));\n  emit_dm(as, ARMI_VCVT_S32_F64, (tmp & 15), (left & 15));\n}\n\nstatic void asm_tobit(ASMState *as, IRIns *ir)\n{\n  RegSet allow = RSET_FPR;\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, allow);\n  Reg right = ra_alloc1(as, ir->op2, rset_clear(allow, left));\n  Reg tmp = ra_scratch(as, rset_clear(allow, right));\n  emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15));\n  emit_dnm(as, ARMI_VADD_D, (tmp & 15), (left & 15), (right & 15));\n}\n#endif\n\nstatic void asm_conv(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);\n#if !LJ_SOFTFP\n  int stfp = (st == IRT_NUM || st == IRT_FLOAT);\n#endif\n  IRRef lref = ir->op1;\n  /* 64 bit integer conversions are handled by SPLIT. */\n  lua_assert(!irt_isint64(ir->t) && !(st == IRT_I64 || st == IRT_U64));\n#if LJ_SOFTFP\n  /* FP conversions are handled by SPLIT. */\n  lua_assert(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT));\n  /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */\n#else\n  lua_assert(irt_type(ir->t) != st);\n  if (irt_isfp(ir->t)) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    if (stfp) {  /* FP to FP conversion. */\n      emit_dm(as, st == IRT_NUM ? ARMI_VCVT_F32_F64 : ARMI_VCVT_F64_F32,\n\t      (dest & 15), (ra_alloc1(as, lref, RSET_FPR) & 15));\n    } else {  /* Integer to FP conversion. */\n      Reg left = ra_alloc1(as, lref, RSET_GPR);\n      ARMIns ai = irt_isfloat(ir->t) ?\n\t(st == IRT_INT ? ARMI_VCVT_F32_S32 : ARMI_VCVT_F32_U32) :\n\t(st == IRT_INT ? ARMI_VCVT_F64_S32 : ARMI_VCVT_F64_U32);\n      emit_dm(as, ai, (dest & 15), (dest & 15));\n      emit_dn(as, ARMI_VMOV_S_R, left, (dest & 15));\n    }\n  } else if (stfp) {  /* FP to integer conversion. */\n    if (irt_isguard(ir->t)) {\n      /* Checked conversions are only supported from number to int. */\n      lua_assert(irt_isint(ir->t) && st == IRT_NUM);\n      asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR));\n    } else {\n      Reg dest = ra_dest(as, ir, RSET_GPR);\n      Reg left = ra_alloc1(as, lref, RSET_FPR);\n      Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left));\n      ARMIns ai;\n      emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15));\n      ai = irt_isint(ir->t) ?\n\t(st == IRT_NUM ? ARMI_VCVT_S32_F64 : ARMI_VCVT_S32_F32) :\n\t(st == IRT_NUM ? ARMI_VCVT_U32_F64 : ARMI_VCVT_U32_F32);\n      emit_dm(as, ai, (tmp & 15), (left & 15));\n    }\n  } else\n#endif\n  {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    if (st >= IRT_I8 && st <= IRT_U16) {  /* Extend to 32 bit integer. */\n      Reg left = ra_alloc1(as, lref, RSET_GPR);\n      lua_assert(irt_isint(ir->t) || irt_isu32(ir->t));\n      if ((as->flags & JIT_F_ARMV6)) {\n\tARMIns ai = st == IRT_I8 ? ARMI_SXTB :\n\t\t    st == IRT_U8 ? ARMI_UXTB :\n\t\t    st == IRT_I16 ? ARMI_SXTH : ARMI_UXTH;\n\temit_dm(as, ai, dest, left);\n      } else if (st == IRT_U8) {\n\temit_dn(as, ARMI_AND|ARMI_K12|255, dest, left);\n      } else {\n\tuint32_t shift = st == IRT_I8 ? 24 : 16;\n\tARMShift sh = st == IRT_U16 ? ARMSH_LSR : ARMSH_ASR;\n\temit_dm(as, ARMI_MOV|ARMF_SH(sh, shift), dest, RID_TMP);\n\temit_dm(as, ARMI_MOV|ARMF_SH(ARMSH_LSL, shift), RID_TMP, left);\n      }\n    } else {  /* Handle 32/32 bit no-op (cast). */\n      ra_leftov(as, dest, lref);  /* Do nothing, but may need to move regs. */\n    }\n  }\n}\n\n#if !LJ_SOFTFP && LJ_HASFFI\nstatic void asm_conv64(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK);\n  IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH);\n  IRCallID id;\n  CCallInfo ci;\n  IRRef args[2];\n  args[0] = (ir-1)->op1;\n  args[1] = ir->op1;\n  if (st == IRT_NUM || st == IRT_FLOAT) {\n    id = IRCALL_fp64_d2l + ((st == IRT_FLOAT) ? 2 : 0) + (dt - IRT_I64);\n    ir--;\n  } else {\n    id = IRCALL_fp64_l2d + ((dt == IRT_FLOAT) ? 2 : 0) + (st - IRT_I64);\n  }\n  ci = lj_ir_callinfo[id];\n#if !LJ_ABI_SOFTFP\n  ci.flags |= CCI_VARARG;  /* These calls don't use the hard-float ABI! */\n#endif\n  asm_setupresult(as, ir, &ci);\n  asm_gencall(as, &ci, args);\n}\n#endif\n\nstatic void asm_strto(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num];\n  IRRef args[2];\n  Reg rlo = 0, rhi = 0, tmp;\n  int destused = ra_used(ir);\n  int32_t ofs = 0;\n  ra_evictset(as, RSET_SCRATCH);\n#if LJ_SOFTFP\n  if (destused) {\n    if (ra_hasspill(ir->s) && ra_hasspill((ir+1)->s) &&\n\t(ir->s & 1) == 0 && ir->s + 1 == (ir+1)->s) {\n      int i;\n      for (i = 0; i < 2; i++) {\n\tReg r = (ir+i)->r;\n\tif (ra_hasreg(r)) {\n\t  ra_free(as, r);\n\t  ra_modified(as, r);\n\t  emit_spload(as, ir+i, r, sps_scale((ir+i)->s));\n\t}\n      }\n      ofs = sps_scale(ir->s);\n      destused = 0;\n    } else {\n      rhi = ra_dest(as, ir+1, RSET_GPR);\n      rlo = ra_dest(as, ir, rset_exclude(RSET_GPR, rhi));\n    }\n  }\n  asm_guardcc(as, CC_EQ);\n  if (destused) {\n    emit_lso(as, ARMI_LDR, rhi, RID_SP, 4);\n    emit_lso(as, ARMI_LDR, rlo, RID_SP, 0);\n  }\n#else\n  UNUSED(rhi);\n  if (destused) {\n    if (ra_hasspill(ir->s)) {\n      ofs = sps_scale(ir->s);\n      destused = 0;\n      if (ra_hasreg(ir->r)) {\n\tra_free(as, ir->r);\n\tra_modified(as, ir->r);\n\temit_spload(as, ir, ir->r, ofs);\n      }\n    } else {\n      rlo = ra_dest(as, ir, RSET_FPR);\n    }\n  }\n  asm_guardcc(as, CC_EQ);\n  if (destused)\n    emit_vlso(as, ARMI_VLDR_D, rlo, RID_SP, 0);\n#endif\n  emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET);  /* Test return status. */\n  args[0] = ir->op1;      /* GCstr *str */\n  args[1] = ASMREF_TMP1;  /* TValue *n  */\n  asm_gencall(as, ci, args);\n  tmp = ra_releasetmp(as, ASMREF_TMP1);\n  if (ofs == 0)\n    emit_dm(as, ARMI_MOV, tmp, RID_SP);\n  else\n    emit_opk(as, ARMI_ADD, tmp, RID_SP, ofs, RSET_GPR);\n}\n\n/* Get pointer to TValue. */\nstatic void asm_tvptr(ASMState *as, Reg dest, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (irt_isnum(ir->t)) {\n    if (irref_isk(ref)) {\n      /* Use the number constant itself as a TValue. */\n      ra_allockreg(as, i32ptr(ir_knum(ir)), dest);\n    } else {\n#if LJ_SOFTFP\n      lua_assert(0);\n#else\n      /* Otherwise force a spill and use the spill slot. */\n      emit_opk(as, ARMI_ADD, dest, RID_SP, ra_spill(as, ir), RSET_GPR);\n#endif\n    }\n  } else {\n    /* Otherwise use [sp] and [sp+4] to hold the TValue. */\n    RegSet allow = rset_exclude(RSET_GPR, dest);\n    Reg type;\n    emit_dm(as, ARMI_MOV, dest, RID_SP);\n    if (!irt_ispri(ir->t)) {\n      Reg src = ra_alloc1(as, ref, allow);\n      emit_lso(as, ARMI_STR, src, RID_SP, 0);\n    }\n    if ((ir+1)->o == IR_HIOP)\n      type = ra_alloc1(as, ref+1, allow);\n    else\n      type = ra_allock(as, irt_toitype(ir->t), allow);\n    emit_lso(as, ARMI_STR, type, RID_SP, 4);\n  }\n}\n\nstatic void asm_tostr(ASMState *as, IRIns *ir)\n{\n  IRRef args[2];\n  args[0] = ASMREF_L;\n  as->gcsteps++;\n  if (irt_isnum(IR(ir->op1)->t) || (ir+1)->o == IR_HIOP) {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum];\n    args[1] = ASMREF_TMP1;  /* const lua_Number * */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n    asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op1);\n  } else {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint];\n    args[1] = ir->op1;  /* int32_t k */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n  }\n}\n\n/* -- Memory references --------------------------------------------------- */\n\nstatic void asm_aref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg idx, base;\n  if (irref_isk(ir->op2)) {\n    IRRef tab = IR(ir->op1)->op1;\n    int32_t ofs = asm_fuseabase(as, tab);\n    IRRef refa = ofs ? tab : ir->op1;\n    uint32_t k = emit_isk12(ARMI_ADD, ofs + 8*IR(ir->op2)->i);\n    if (k) {\n      base = ra_alloc1(as, refa, RSET_GPR);\n      emit_dn(as, ARMI_ADD^k, dest, base);\n      return;\n    }\n  }\n  base = ra_alloc1(as, ir->op1, RSET_GPR);\n  idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base));\n  emit_dnm(as, ARMI_ADD|ARMF_SH(ARMSH_LSL, 3), dest, base, idx);\n}\n\n/* Inlined hash lookup. Specialized for key type and for const keys.\n** The equivalent C code is:\n**   Node *n = hashkey(t, key);\n**   do {\n**     if (lj_obj_equal(&n->key, key)) return &n->val;\n**   } while ((n = nextnode(n)));\n**   return niltv(L);\n*/\nstatic void asm_href(ASMState *as, IRIns *ir, IROp merge)\n{\n  RegSet allow = RSET_GPR;\n  int destused = ra_used(ir);\n  Reg dest = ra_dest(as, ir, allow);\n  Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest));\n  Reg key = 0, keyhi = 0, keynumhi = RID_NONE, tmp = RID_TMP;\n  IRRef refkey = ir->op2;\n  IRIns *irkey = IR(refkey);\n  IRType1 kt = irkey->t;\n  int32_t k = 0, khi = emit_isk12(ARMI_CMP, irt_toitype(kt));\n  uint32_t khash;\n  MCLabel l_end, l_loop;\n  rset_clear(allow, tab);\n  if (!irref_isk(refkey) || irt_isstr(kt)) {\n#if LJ_SOFTFP\n    key = ra_alloc1(as, refkey, allow);\n    rset_clear(allow, key);\n    if (irkey[1].o == IR_HIOP) {\n      if (ra_hasreg((irkey+1)->r)) {\n\tkeynumhi = (irkey+1)->r;\n\tkeyhi = RID_TMP;\n\tra_noweak(as, keynumhi);\n      } else {\n\tkeyhi = keynumhi = ra_allocref(as, refkey+1, allow);\n      }\n      rset_clear(allow, keynumhi);\n      khi = 0;\n    }\n#else\n    if (irt_isnum(kt)) {\n      key = ra_scratch(as, allow);\n      rset_clear(allow, key);\n      keyhi = keynumhi = ra_scratch(as, allow);\n      rset_clear(allow, keyhi);\n      khi = 0;\n    } else {\n      key = ra_alloc1(as, refkey, allow);\n      rset_clear(allow, key);\n    }\n#endif\n  } else if (irt_isnum(kt)) {\n    int32_t val = (int32_t)ir_knum(irkey)->u32.lo;\n    k = emit_isk12(ARMI_CMP, val);\n    if (!k) {\n      key = ra_allock(as, val, allow);\n      rset_clear(allow, key);\n    }\n    val = (int32_t)ir_knum(irkey)->u32.hi;\n    khi = emit_isk12(ARMI_CMP, val);\n    if (!khi) {\n      keyhi = ra_allock(as, val, allow);\n      rset_clear(allow, keyhi);\n    }\n  } else if (!irt_ispri(kt)) {\n    k = emit_isk12(ARMI_CMP, irkey->i);\n    if (!k) {\n      key = ra_alloc1(as, refkey, allow);\n      rset_clear(allow, key);\n    }\n  }\n  if (!irt_ispri(kt))\n    tmp = ra_scratchpair(as, allow);\n\n  /* Key not found in chain: jump to exit (if merged) or load niltv. */\n  l_end = emit_label(as);\n  as->invmcp = NULL;\n  if (merge == IR_NE)\n    asm_guardcc(as, CC_AL);\n  else if (destused)\n    emit_loada(as, dest, niltvg(J2G(as->J)));\n\n  /* Follow hash chain until the end. */\n  l_loop = --as->mcp;\n  emit_n(as, ARMI_CMP|ARMI_K12|0, dest);\n  emit_lso(as, ARMI_LDR, dest, dest, (int32_t)offsetof(Node, next));\n\n  /* Type and value comparison. */\n  if (merge == IR_EQ)\n    asm_guardcc(as, CC_EQ);\n  else\n    emit_branch(as, ARMF_CC(ARMI_B, CC_EQ), l_end);\n  if (!irt_ispri(kt)) {\n    emit_nm(as, ARMF_CC(ARMI_CMP, CC_EQ)^k, tmp, key);\n    emit_nm(as, ARMI_CMP^khi, tmp+1, keyhi);\n    emit_lsox(as, ARMI_LDRD, tmp, dest, (int32_t)offsetof(Node, key));\n  } else {\n    emit_n(as, ARMI_CMP^khi, tmp);\n    emit_lso(as, ARMI_LDR, tmp, dest, (int32_t)offsetof(Node, key.it));\n  }\n  *l_loop = ARMF_CC(ARMI_B, CC_NE) | ((as->mcp-l_loop-2) & 0x00ffffffu);\n\n  /* Load main position relative to tab->node into dest. */\n  khash = irref_isk(refkey) ? ir_khash(irkey) : 1;\n  if (khash == 0) {\n    emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node));\n  } else {\n    emit_dnm(as, ARMI_ADD|ARMF_SH(ARMSH_LSL, 3), dest, dest, tmp);\n    emit_dnm(as, ARMI_ADD|ARMF_SH(ARMSH_LSL, 1), tmp, tmp, tmp);\n    if (irt_isstr(kt)) {  /* Fetch of str->hash is cheaper than ra_allock. */\n      emit_dnm(as, ARMI_AND, tmp, tmp+1, RID_TMP);\n      emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node));\n      emit_lso(as, ARMI_LDR, tmp+1, key, (int32_t)offsetof(GCstr, hash));\n      emit_lso(as, ARMI_LDR, RID_TMP, tab, (int32_t)offsetof(GCtab, hmask));\n    } else if (irref_isk(refkey)) {\n      emit_opk(as, ARMI_AND, tmp, RID_TMP, (int32_t)khash,\n\t       rset_exclude(rset_exclude(RSET_GPR, tab), dest));\n      emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node));\n      emit_lso(as, ARMI_LDR, RID_TMP, tab, (int32_t)offsetof(GCtab, hmask));\n    } else {  /* Must match with hash*() in lj_tab.c. */\n      if (ra_hasreg(keynumhi)) {  /* Canonicalize +-0.0 to 0.0. */\n\tif (keyhi == RID_TMP)\n\t  emit_dm(as, ARMF_CC(ARMI_MOV, CC_NE), keyhi, keynumhi);\n\temit_d(as, ARMF_CC(ARMI_MOV, CC_EQ)|ARMI_K12|0, keyhi);\n      }\n      emit_dnm(as, ARMI_AND, tmp, tmp, RID_TMP);\n      emit_dnm(as, ARMI_SUB|ARMF_SH(ARMSH_ROR, 32-HASH_ROT3), tmp, tmp, tmp+1);\n      emit_lso(as, ARMI_LDR, dest, tab, (int32_t)offsetof(GCtab, node));\n      emit_dnm(as, ARMI_EOR|ARMF_SH(ARMSH_ROR, 32-((HASH_ROT2+HASH_ROT1)&31)),\n\t       tmp, tmp+1, tmp);\n      emit_lso(as, ARMI_LDR, RID_TMP, tab, (int32_t)offsetof(GCtab, hmask));\n      emit_dnm(as, ARMI_SUB|ARMF_SH(ARMSH_ROR, 32-HASH_ROT1), tmp+1, tmp+1, tmp);\n      if (ra_hasreg(keynumhi)) {\n\temit_dnm(as, ARMI_EOR, tmp+1, tmp, key);\n\temit_dnm(as, ARMI_ORR|ARMI_S, RID_TMP, tmp, key);  /* Test for +-0.0. */\n\temit_dnm(as, ARMI_ADD, tmp, keynumhi, keynumhi);\n#if !LJ_SOFTFP\n\temit_dnm(as, ARMI_VMOV_RR_D, key, keynumhi,\n\t\t (ra_alloc1(as, refkey, RSET_FPR) & 15));\n#endif\n      } else {\n\temit_dnm(as, ARMI_EOR, tmp+1, tmp, key);\n\temit_opk(as, ARMI_ADD, tmp, key, (int32_t)HASH_BIAS,\n\t\t rset_exclude(rset_exclude(RSET_GPR, tab), key));\n      }\n    }\n  }\n}\n\nstatic void asm_hrefk(ASMState *as, IRIns *ir)\n{\n  IRIns *kslot = IR(ir->op2);\n  IRIns *irkey = IR(kslot->op1);\n  int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node));\n  int32_t kofs = ofs + (int32_t)offsetof(Node, key);\n  Reg dest = (ra_used(ir) || ofs > 4095) ? ra_dest(as, ir, RSET_GPR) : RID_NONE;\n  Reg node = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg key = RID_NONE, type = RID_TMP, idx = node;\n  RegSet allow = rset_exclude(RSET_GPR, node);\n  lua_assert(ofs % sizeof(Node) == 0);\n  if (ofs > 4095) {\n    idx = dest;\n    rset_clear(allow, dest);\n    kofs = (int32_t)offsetof(Node, key);\n  } else if (ra_hasreg(dest)) {\n    emit_opk(as, ARMI_ADD, dest, node, ofs, allow);\n  }\n  asm_guardcc(as, CC_NE);\n  if (!irt_ispri(irkey->t)) {\n    RegSet even = (as->freeset & allow);\n    even = even & (even >> 1) & RSET_GPREVEN;\n    if (even) {\n      key = ra_scratch(as, even);\n      if (rset_test(as->freeset, key+1)) {\n\ttype = key+1;\n\tra_modified(as, type);\n      }\n    } else {\n      key = ra_scratch(as, allow);\n    }\n    rset_clear(allow, key);\n  }\n  rset_clear(allow, type);\n  if (irt_isnum(irkey->t)) {\n    emit_opk(as, ARMF_CC(ARMI_CMP, CC_EQ), 0, type,\n\t     (int32_t)ir_knum(irkey)->u32.hi, allow);\n    emit_opk(as, ARMI_CMP, 0, key,\n\t     (int32_t)ir_knum(irkey)->u32.lo, allow);\n  } else {\n    if (ra_hasreg(key))\n      emit_opk(as, ARMF_CC(ARMI_CMP, CC_EQ), 0, key, irkey->i, allow);\n    emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype(irkey->t), type);\n  }\n  emit_lso(as, ARMI_LDR, type, idx, kofs+4);\n  if (ra_hasreg(key)) emit_lso(as, ARMI_LDR, key, idx, kofs);\n  if (ofs > 4095)\n    emit_opk(as, ARMI_ADD, dest, node, ofs, RSET_GPR);\n}\n\nstatic void asm_newref(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];\n  IRRef args[3];\n  if (ir->r == RID_SINK)\n    return;\n  args[0] = ASMREF_L;     /* lua_State *L */\n  args[1] = ir->op1;      /* GCtab *t     */\n  args[2] = ASMREF_TMP1;  /* cTValue *key */\n  asm_setupresult(as, ir, ci);  /* TValue * */\n  asm_gencall(as, ci, args);\n  asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2);\n}\n\nstatic void asm_uref(ASMState *as, IRIns *ir)\n{\n  /* NYI: Check that UREFO is still open and not aliasing a slot. */\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  if (irref_isk(ir->op1)) {\n    GCfunc *fn = ir_kfunc(IR(ir->op1));\n    MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v;\n    emit_lsptr(as, ARMI_LDR, dest, v);\n  } else {\n    Reg uv = ra_scratch(as, RSET_GPR);\n    Reg func = ra_alloc1(as, ir->op1, RSET_GPR);\n    if (ir->o == IR_UREFC) {\n      asm_guardcc(as, CC_NE);\n      emit_n(as, ARMI_CMP|ARMI_K12|1, RID_TMP);\n      emit_opk(as, ARMI_ADD, dest, uv,\n\t       (int32_t)offsetof(GCupval, tv), RSET_GPR);\n      emit_lso(as, ARMI_LDRB, RID_TMP, uv, (int32_t)offsetof(GCupval, closed));\n    } else {\n      emit_lso(as, ARMI_LDR, dest, uv, (int32_t)offsetof(GCupval, v));\n    }\n    emit_lso(as, ARMI_LDR, uv, func,\n\t     (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8));\n  }\n}\n\nstatic void asm_fref(ASMState *as, IRIns *ir)\n{\n  UNUSED(as); UNUSED(ir);\n  lua_assert(!ra_used(ir));\n}\n\nstatic void asm_strref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  IRRef ref = ir->op2, refk = ir->op1;\n  Reg r;\n  if (irref_isk(ref)) {\n    IRRef tmp = refk; refk = ref; ref = tmp;\n  } else if (!irref_isk(refk)) {\n    uint32_t k, m = ARMI_K12|sizeof(GCstr);\n    Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR);\n    IRIns *irr = IR(ir->op2);\n    if (ra_hasreg(irr->r)) {\n      ra_noweak(as, irr->r);\n      right = irr->r;\n    } else if (mayfuse(as, irr->op2) &&\n\t       irr->o == IR_ADD && irref_isk(irr->op2) &&\n\t       (k = emit_isk12(ARMI_ADD,\n\t\t\t       (int32_t)sizeof(GCstr) + IR(irr->op2)->i))) {\n      m = k;\n      right = ra_alloc1(as, irr->op1, rset_exclude(RSET_GPR, left));\n    } else {\n      right = ra_allocref(as, ir->op2, rset_exclude(RSET_GPR, left));\n    }\n    emit_dn(as, ARMI_ADD^m, dest, dest);\n    emit_dnm(as, ARMI_ADD, dest, left, right);\n    return;\n  }\n  r = ra_alloc1(as, ref, RSET_GPR);\n  emit_opk(as, ARMI_ADD, dest, r,\n\t   sizeof(GCstr) + IR(refk)->i, rset_exclude(RSET_GPR, r));\n}\n\n/* -- Loads and stores ---------------------------------------------------- */\n\nstatic ARMIns asm_fxloadins(IRIns *ir)\n{\n  switch (irt_type(ir->t)) {\n  case IRT_I8: return ARMI_LDRSB;\n  case IRT_U8: return ARMI_LDRB;\n  case IRT_I16: return ARMI_LDRSH;\n  case IRT_U16: return ARMI_LDRH;\n  case IRT_NUM: lua_assert(!LJ_SOFTFP); return ARMI_VLDR_D;\n  case IRT_FLOAT: if (!LJ_SOFTFP) return ARMI_VLDR_S;\n  default: return ARMI_LDR;\n  }\n}\n\nstatic ARMIns asm_fxstoreins(IRIns *ir)\n{\n  switch (irt_type(ir->t)) {\n  case IRT_I8: case IRT_U8: return ARMI_STRB;\n  case IRT_I16: case IRT_U16: return ARMI_STRH;\n  case IRT_NUM: lua_assert(!LJ_SOFTFP); return ARMI_VSTR_D;\n  case IRT_FLOAT: if (!LJ_SOFTFP) return ARMI_VSTR_S;\n  default: return ARMI_STR;\n  }\n}\n\nstatic void asm_fload(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg idx = ra_alloc1(as, ir->op1, RSET_GPR);\n  ARMIns ai = asm_fxloadins(ir);\n  int32_t ofs;\n  if (ir->op2 == IRFL_TAB_ARRAY) {\n    ofs = asm_fuseabase(as, ir->op1);\n    if (ofs) {  /* Turn the t->array load into an add for colocated arrays. */\n      emit_dn(as, ARMI_ADD|ARMI_K12|ofs, dest, idx);\n      return;\n    }\n  }\n  ofs = field_ofs[ir->op2];\n  if ((ai & 0x04000000))\n    emit_lso(as, ai, dest, idx, ofs);\n  else\n    emit_lsox(as, ai, dest, idx, ofs);\n}\n\nstatic void asm_fstore(ASMState *as, IRIns *ir)\n{\n  if (ir->r != RID_SINK) {\n    Reg src = ra_alloc1(as, ir->op2, RSET_GPR);\n    IRIns *irf = IR(ir->op1);\n    Reg idx = ra_alloc1(as, irf->op1, rset_exclude(RSET_GPR, src));\n    int32_t ofs = field_ofs[irf->op2];\n    ARMIns ai = asm_fxstoreins(ir);\n    if ((ai & 0x04000000))\n      emit_lso(as, ai, src, idx, ofs);\n    else\n      emit_lsox(as, ai, src, idx, ofs);\n  }\n}\n\nstatic void asm_xload(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir,\n\t\t     (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);\n  lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED));\n  asm_fusexref(as, asm_fxloadins(ir), dest, ir->op1, RSET_GPR, 0);\n}\n\nstatic void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs)\n{\n  if (ir->r != RID_SINK) {\n    Reg src = ra_alloc1(as, ir->op2,\n\t\t\t(!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);\n    asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1,\n\t\t rset_exclude(RSET_GPR, src), ofs);\n  }\n}\n\nstatic void asm_ahuvload(ASMState *as, IRIns *ir)\n{\n  int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP);\n  IRType t = hiop ? IRT_NUM : irt_type(ir->t);\n  Reg dest = RID_NONE, type = RID_NONE, idx;\n  RegSet allow = RSET_GPR;\n  int32_t ofs = 0;\n  if (hiop && ra_used(ir+1)) {\n    type = ra_dest(as, ir+1, allow);\n    rset_clear(allow, type);\n  }\n  if (ra_used(ir)) {\n    lua_assert((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) ||\n\t       irt_isint(ir->t) || irt_isaddr(ir->t));\n    dest = ra_dest(as, ir, (!LJ_SOFTFP && t == IRT_NUM) ? RSET_FPR : allow);\n    rset_clear(allow, dest);\n  }\n  idx = asm_fuseahuref(as, ir->op1, &ofs, allow,\n\t\t       (!LJ_SOFTFP && t == IRT_NUM) ? 1024 : 4096);\n  if (!hiop || type == RID_NONE) {\n    rset_clear(allow, idx);\n    if (ofs < 256 && ra_hasreg(dest) && (dest & 1) == 0 &&\n\trset_test((as->freeset & allow), dest+1)) {\n      type = dest+1;\n      ra_modified(as, type);\n    } else {\n      type = RID_TMP;\n    }\n  }\n  asm_guardcc(as, t == IRT_NUM ? CC_HS : CC_NE);\n  emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype_(t), type);\n  if (ra_hasreg(dest)) {\n#if !LJ_SOFTFP\n    if (t == IRT_NUM)\n      emit_vlso(as, ARMI_VLDR_D, dest, idx, ofs);\n    else\n#endif\n      emit_lso(as, ARMI_LDR, dest, idx, ofs);\n  }\n  emit_lso(as, ARMI_LDR, type, idx, ofs+4);\n}\n\nstatic void asm_ahustore(ASMState *as, IRIns *ir)\n{\n  if (ir->r != RID_SINK) {\n    RegSet allow = RSET_GPR;\n    Reg idx, src = RID_NONE, type = RID_NONE;\n    int32_t ofs = 0;\n#if !LJ_SOFTFP\n    if (irt_isnum(ir->t)) {\n      src = ra_alloc1(as, ir->op2, RSET_FPR);\n      idx = asm_fuseahuref(as, ir->op1, &ofs, allow, 1024);\n      emit_vlso(as, ARMI_VSTR_D, src, idx, ofs);\n    } else\n#endif\n    {\n      int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP);\n      if (!irt_ispri(ir->t)) {\n\tsrc = ra_alloc1(as, ir->op2, allow);\n\trset_clear(allow, src);\n      }\n      if (hiop)\n\ttype = ra_alloc1(as, (ir+1)->op2, allow);\n      else\n\ttype = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);\n      idx = asm_fuseahuref(as, ir->op1, &ofs, rset_exclude(allow, type), 4096);\n      if (ra_hasreg(src)) emit_lso(as, ARMI_STR, src, idx, ofs);\n      emit_lso(as, ARMI_STR, type, idx, ofs+4);\n    }\n  }\n}\n\nstatic void asm_sload(ASMState *as, IRIns *ir)\n{\n  int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 4 : 0);\n  int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP);\n  IRType t = hiop ? IRT_NUM : irt_type(ir->t);\n  Reg dest = RID_NONE, type = RID_NONE, base;\n  RegSet allow = RSET_GPR;\n  lua_assert(!(ir->op2 & IRSLOAD_PARENT));  /* Handled by asm_head_side(). */\n  lua_assert(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK));\n#if LJ_SOFTFP\n  lua_assert(!(ir->op2 & IRSLOAD_CONVERT));  /* Handled by LJ_SOFTFP SPLIT. */\n  if (hiop && ra_used(ir+1)) {\n    type = ra_dest(as, ir+1, allow);\n    rset_clear(allow, type);\n  }\n#else\n  if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(ir->t) && t == IRT_INT) {\n    dest = ra_scratch(as, RSET_FPR);\n    asm_tointg(as, ir, dest);\n    t = IRT_NUM;  /* Continue with a regular number type check. */\n  } else\n#endif\n  if (ra_used(ir)) {\n    lua_assert((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) ||\n\t       irt_isint(ir->t) || irt_isaddr(ir->t));\n    dest = ra_dest(as, ir, (!LJ_SOFTFP && t == IRT_NUM) ? RSET_FPR : allow);\n    rset_clear(allow, dest);\n    base = ra_alloc1(as, REF_BASE, allow);\n    if ((ir->op2 & IRSLOAD_CONVERT)) {\n      if (t == IRT_INT) {\n\tReg tmp = ra_scratch(as, RSET_FPR);\n\temit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15));\n\temit_dm(as, ARMI_VCVT_S32_F64, (tmp & 15), (tmp & 15));\n\tdest = tmp;\n\tt = IRT_NUM;  /* Check for original type. */\n      } else {\n\tReg tmp = ra_scratch(as, RSET_GPR);\n\temit_dm(as, ARMI_VCVT_F64_S32, (dest & 15), (dest & 15));\n\temit_dn(as, ARMI_VMOV_S_R, tmp, (dest & 15));\n\tdest = tmp;\n\tt = IRT_INT;  /* Check for original type. */\n      }\n    }\n    goto dotypecheck;\n  }\n  base = ra_alloc1(as, REF_BASE, allow);\ndotypecheck:\n  rset_clear(allow, base);\n  if ((ir->op2 & IRSLOAD_TYPECHECK)) {\n    if (ra_noreg(type)) {\n      if (ofs < 256 && ra_hasreg(dest) && (dest & 1) == 0 &&\n\t  rset_test((as->freeset & allow), dest+1)) {\n\ttype = dest+1;\n\tra_modified(as, type);\n      } else {\n\ttype = RID_TMP;\n      }\n    }\n    asm_guardcc(as, t == IRT_NUM ? CC_HS : CC_NE);\n    emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype_(t), type);\n  }\n  if (ra_hasreg(dest)) {\n#if !LJ_SOFTFP\n    if (t == IRT_NUM) {\n      if (ofs < 1024) {\n\temit_vlso(as, ARMI_VLDR_D, dest, base, ofs);\n      } else {\n\tif (ra_hasreg(type)) emit_lso(as, ARMI_LDR, type, base, ofs+4);\n\temit_vlso(as, ARMI_VLDR_D, dest, RID_TMP, 0);\n\temit_opk(as, ARMI_ADD, RID_TMP, base, ofs, allow);\n\treturn;\n      }\n    } else\n#endif\n      emit_lso(as, ARMI_LDR, dest, base, ofs);\n  }\n  if (ra_hasreg(type)) emit_lso(as, ARMI_LDR, type, base, ofs+4);\n}\n\n/* -- Allocations --------------------------------------------------------- */\n\n#if LJ_HASFFI\nstatic void asm_cnew(ASMState *as, IRIns *ir)\n{\n  CTState *cts = ctype_ctsG(J2G(as->J));\n  CTypeID ctypeid = (CTypeID)IR(ir->op1)->i;\n  CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ?\n\t      lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i;\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco];\n  IRRef args[2];\n  RegSet allow = (RSET_GPR & ~RSET_SCRATCH);\n  RegSet drop = RSET_SCRATCH;\n  lua_assert(sz != CTSIZE_INVALID);\n\n  args[0] = ASMREF_L;     /* lua_State *L */\n  args[1] = ASMREF_TMP1;  /* MSize size   */\n  as->gcsteps++;\n\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);\n  if (ra_used(ir))\n    ra_destreg(as, ir, RID_RET);  /* GCcdata * */\n\n  /* Initialize immutable cdata object. */\n  if (ir->o == IR_CNEWI) {\n    int32_t ofs = sizeof(GCcdata);\n    lua_assert(sz == 4 || sz == 8);\n    if (sz == 8) {\n      ofs += 4; ir++;\n      lua_assert(ir->o == IR_HIOP);\n    }\n    for (;;) {\n      Reg r = ra_alloc1(as, ir->op2, allow);\n      emit_lso(as, ARMI_STR, r, RID_RET, ofs);\n      rset_clear(allow, r);\n      if (ofs == sizeof(GCcdata)) break;\n      ofs -= 4; ir--;\n    }\n  }\n  /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */\n  {\n    uint32_t k = emit_isk12(ARMI_MOV, ctypeid);\n    Reg r = k ? RID_R1 : ra_allock(as, ctypeid, allow);\n    emit_lso(as, ARMI_STRB, RID_TMP, RID_RET, offsetof(GCcdata, gct));\n    emit_lsox(as, ARMI_STRH, r, RID_RET, offsetof(GCcdata, ctypeid));\n    emit_d(as, ARMI_MOV|ARMI_K12|~LJ_TCDATA, RID_TMP);\n    if (k) emit_d(as, ARMI_MOV^k, RID_R1);\n  }\n  asm_gencall(as, ci, args);\n  ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)),\n\t       ra_releasetmp(as, ASMREF_TMP1));\n}\n#else\n#define asm_cnew(as, ir)\t((void)0)\n#endif\n\n/* -- Write barriers ------------------------------------------------------ */\n\nstatic void asm_tbar(ASMState *as, IRIns *ir)\n{\n  Reg tab = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg link = ra_scratch(as, rset_exclude(RSET_GPR, tab));\n  Reg gr = ra_allock(as, i32ptr(J2G(as->J)),\n\t\t     rset_exclude(rset_exclude(RSET_GPR, tab), link));\n  Reg mark = RID_TMP;\n  MCLabel l_end = emit_label(as);\n  emit_lso(as, ARMI_STR, link, tab, (int32_t)offsetof(GCtab, gclist));\n  emit_lso(as, ARMI_STRB, mark, tab, (int32_t)offsetof(GCtab, marked));\n  emit_lso(as, ARMI_STR, tab, gr,\n\t   (int32_t)offsetof(global_State, gc.grayagain));\n  emit_dn(as, ARMI_BIC|ARMI_K12|LJ_GC_BLACK, mark, mark);\n  emit_lso(as, ARMI_LDR, link, gr,\n\t   (int32_t)offsetof(global_State, gc.grayagain));\n  emit_branch(as, ARMF_CC(ARMI_B, CC_EQ), l_end);\n  emit_n(as, ARMI_TST|ARMI_K12|LJ_GC_BLACK, mark);\n  emit_lso(as, ARMI_LDRB, mark, tab, (int32_t)offsetof(GCtab, marked));\n}\n\nstatic void asm_obar(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg obj, val, tmp;\n  /* No need for other object barriers (yet). */\n  lua_assert(IR(ir->op1)->o == IR_UREFC);\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ir->op1;      /* TValue *tv      */\n  asm_gencall(as, ci, args);\n  if ((l_end[-1] >> 28) == CC_AL)\n    l_end[-1] = ARMF_CC(l_end[-1], CC_NE);\n  else\n    emit_branch(as, ARMF_CC(ARMI_B, CC_EQ), l_end);\n  ra_allockreg(as, i32ptr(J2G(as->J)), ra_releasetmp(as, ASMREF_TMP1));\n  obj = IR(ir->op1)->r;\n  tmp = ra_scratch(as, rset_exclude(RSET_GPR, obj));\n  emit_n(as, ARMF_CC(ARMI_TST, CC_NE)|ARMI_K12|LJ_GC_BLACK, tmp);\n  emit_n(as, ARMI_TST|ARMI_K12|LJ_GC_WHITES, RID_TMP);\n  val = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, obj));\n  emit_lso(as, ARMI_LDRB, tmp, obj,\n\t   (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv));\n  emit_lso(as, ARMI_LDRB, RID_TMP, val, (int32_t)offsetof(GChead, marked));\n}\n\n/* -- Arithmetic and logic operations ------------------------------------- */\n\n#if !LJ_SOFTFP\nstatic void asm_fparith(ASMState *as, IRIns *ir, ARMIns ai)\n{\n  Reg dest = ra_dest(as, ir, RSET_FPR);\n  Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n  right = (left >> 8); left &= 255;\n  emit_dnm(as, ai, (dest & 15), (left & 15), (right & 15));\n}\n\nstatic void asm_fpunary(ASMState *as, IRIns *ir, ARMIns ai)\n{\n  Reg dest = ra_dest(as, ir, RSET_FPR);\n  Reg left = ra_hintalloc(as, ir->op1, dest, RSET_FPR);\n  emit_dm(as, ai, (dest & 15), (left & 15));\n}\n\nstatic int asm_fpjoin_pow(ASMState *as, IRIns *ir)\n{\n  IRIns *irp = IR(ir->op1);\n  if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) {\n    IRIns *irpp = IR(irp->op1);\n    if (irpp == ir-2 && irpp->o == IR_FPMATH &&\n\tirpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) {\n      const CCallInfo *ci = &lj_ir_callinfo[IRCALL_pow];\n      IRRef args[2];\n      args[0] = irpp->op1;\n      args[1] = irp->op2;\n      asm_setupresult(as, ir, ci);\n      asm_gencall(as, ci, args);\n      return 1;\n    }\n  }\n  return 0;\n}\n#endif\n\nstatic int asm_swapops(ASMState *as, IRRef lref, IRRef rref)\n{\n  IRIns *ir;\n  if (irref_isk(rref))\n    return 0;  /* Don't swap constants to the left. */\n  if (irref_isk(lref))\n    return 1;  /* But swap constants to the right. */\n  ir = IR(rref);\n  if ((ir->o >= IR_BSHL && ir->o <= IR_BROR) ||\n      (ir->o == IR_ADD && ir->op1 == ir->op2))\n    return 0;  /* Don't swap fusable operands to the left. */\n  ir = IR(lref);\n  if ((ir->o >= IR_BSHL && ir->o <= IR_BROR) ||\n      (ir->o == IR_ADD && ir->op1 == ir->op2))\n    return 1;  /* But swap fusable operands to the right. */\n  return 0;  /* Otherwise don't swap. */\n}\n\nstatic void asm_intop(ASMState *as, IRIns *ir, ARMIns ai)\n{\n  IRRef lref = ir->op1, rref = ir->op2;\n  Reg left, dest = ra_dest(as, ir, RSET_GPR);\n  uint32_t m;\n  if (asm_swapops(as, lref, rref)) {\n    IRRef tmp = lref; lref = rref; rref = tmp;\n    if ((ai & ~ARMI_S) == ARMI_SUB || (ai & ~ARMI_S) == ARMI_SBC)\n      ai ^= (ARMI_SUB^ARMI_RSB);\n  }\n  left = ra_hintalloc(as, lref, dest, RSET_GPR);\n  m = asm_fuseopm(as, ai, rref, rset_exclude(RSET_GPR, left));\n  if (irt_isguard(ir->t)) {  /* For IR_ADDOV etc. */\n    asm_guardcc(as, CC_VS);\n    ai |= ARMI_S;\n  }\n  emit_dn(as, ai^m, dest, left);\n}\n\nstatic void asm_intop_s(ASMState *as, IRIns *ir, ARMIns ai)\n{\n  if (as->flagmcp == as->mcp) {  /* Drop cmp r, #0. */\n    as->flagmcp = NULL;\n    as->mcp++;\n    ai |= ARMI_S;\n  }\n  asm_intop(as, ir, ai);\n}\n\nstatic void asm_bitop(ASMState *as, IRIns *ir, ARMIns ai)\n{\n  if (as->flagmcp == as->mcp) {  /* Try to drop cmp r, #0. */\n    uint32_t cc = (as->mcp[1] >> 28);\n    as->flagmcp = NULL;\n    if (cc <= CC_NE) {\n      as->mcp++;\n      ai |= ARMI_S;\n    } else if (cc == CC_GE) {\n      *++as->mcp ^= ((CC_GE^CC_PL) << 28);\n      ai |= ARMI_S;\n    } else if (cc == CC_LT) {\n      *++as->mcp ^= ((CC_LT^CC_MI) << 28);\n      ai |= ARMI_S;\n    }  /* else: other conds don't work with bit ops. */\n  }\n  if (ir->op2 == 0) {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    uint32_t m = asm_fuseopm(as, ai, ir->op1, RSET_GPR);\n    emit_d(as, ai^m, dest);\n  } else {\n    /* NYI: Turn BAND !k12 into uxtb, uxth or bfc or shl+shr. */\n    asm_intop(as, ir, ai);\n  }\n}\n\nstatic void asm_intneg(ASMState *as, IRIns *ir, ARMIns ai)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n  emit_dn(as, ai|ARMI_K12|0, dest, left);\n}\n\n/* NYI: use add/shift for MUL(OV) with constants. FOLD only does 2^k. */\nstatic void asm_intmul(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, rset_exclude(RSET_GPR, dest));\n  Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  Reg tmp = RID_NONE;\n  /* ARMv5 restriction: dest != left and dest_hi != left. */\n  if (dest == left && left != right) { left = right; right = dest; }\n  if (irt_isguard(ir->t)) {  /* IR_MULOV */\n    if (!(as->flags & JIT_F_ARMV6) && dest == left)\n      tmp = left = ra_scratch(as, rset_exclude(RSET_FPR, left));\n    asm_guardcc(as, CC_NE);\n    emit_nm(as, ARMI_TEQ|ARMF_SH(ARMSH_ASR, 31), RID_TMP, dest);\n    emit_dnm(as, ARMI_SMULL|ARMF_S(right), dest, RID_TMP, left);\n  } else {\n    if (!(as->flags & JIT_F_ARMV6) && dest == left) tmp = left = RID_TMP;\n    emit_nm(as, ARMI_MUL|ARMF_S(right), dest, left);\n  }\n  /* Only need this for the dest == left == right case. */\n  if (ra_hasreg(tmp)) emit_dm(as, ARMI_MOV, tmp, right);\n}\n\nstatic void asm_add(ASMState *as, IRIns *ir)\n{\n#if !LJ_SOFTFP\n  if (irt_isnum(ir->t)) {\n    if (!asm_fusemadd(as, ir, ARMI_VMLA_D, ARMI_VMLA_D))\n      asm_fparith(as, ir, ARMI_VADD_D);\n    return;\n  }\n#endif\n  asm_intop_s(as, ir, ARMI_ADD);\n}\n\nstatic void asm_sub(ASMState *as, IRIns *ir)\n{\n#if !LJ_SOFTFP\n  if (irt_isnum(ir->t)) {\n    if (!asm_fusemadd(as, ir, ARMI_VNMLS_D, ARMI_VMLS_D))\n      asm_fparith(as, ir, ARMI_VSUB_D);\n    return;\n  }\n#endif\n  asm_intop_s(as, ir, ARMI_SUB);\n}\n\nstatic void asm_mul(ASMState *as, IRIns *ir)\n{\n#if !LJ_SOFTFP\n  if (irt_isnum(ir->t)) {\n    asm_fparith(as, ir, ARMI_VMUL_D);\n    return;\n  }\n#endif\n  asm_intmul(as, ir);\n}\n\nstatic void asm_neg(ASMState *as, IRIns *ir)\n{\n#if !LJ_SOFTFP\n  if (irt_isnum(ir->t)) {\n    asm_fpunary(as, ir, ARMI_VNEG_D);\n    return;\n  }\n#endif\n  asm_intneg(as, ir, ARMI_RSB);\n}\n\nstatic void asm_callid(ASMState *as, IRIns *ir, IRCallID id)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[id];\n  IRRef args[2];\n  args[0] = ir->op1;\n  args[1] = ir->op2;\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\n#if !LJ_SOFTFP\nstatic void asm_callround(ASMState *as, IRIns *ir, int id)\n{\n  /* The modified regs must match with the *.dasc implementation. */\n  RegSet drop = RID2RSET(RID_R0)|RID2RSET(RID_R1)|RID2RSET(RID_R2)|\n\t\tRID2RSET(RID_R3)|RID2RSET(RID_R12);\n  RegSet of;\n  Reg dest, src;\n  ra_evictset(as, drop);\n  dest = ra_dest(as, ir, RSET_FPR);\n  emit_dnm(as, ARMI_VMOV_D_RR, RID_RETLO, RID_RETHI, (dest & 15));\n  emit_call(as, id == IRFPM_FLOOR ? (void *)lj_vm_floor_sf :\n\t\tid == IRFPM_CEIL ? (void *)lj_vm_ceil_sf :\n\t\t\t\t   (void *)lj_vm_trunc_sf);\n  /* Workaround to protect argument GPRs from being used for remat. */\n  of = as->freeset;\n  as->freeset &= ~RSET_RANGE(RID_R0, RID_R1+1);\n  as->cost[RID_R0] = as->cost[RID_R1] = REGCOST(~0u, ASMREF_L);\n  src = ra_alloc1(as, ir->op1, RSET_FPR);  /* May alloc GPR to remat FPR. */\n  as->freeset |= (of & RSET_RANGE(RID_R0, RID_R1+1));\n  emit_dnm(as, ARMI_VMOV_RR_D, RID_R0, RID_R1, (src & 15));\n}\n#endif\n\nstatic void asm_bitswap(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n  if ((as->flags & JIT_F_ARMV6)) {\n    emit_dm(as, ARMI_REV, dest, left);\n  } else {\n    Reg tmp2 = dest;\n    if (tmp2 == left)\n      tmp2 = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, dest), left));\n    emit_dnm(as, ARMI_EOR|ARMF_SH(ARMSH_LSR, 8), dest, tmp2, RID_TMP);\n    emit_dm(as, ARMI_MOV|ARMF_SH(ARMSH_ROR, 8), tmp2, left);\n    emit_dn(as, ARMI_BIC|ARMI_K12|256*8|255, RID_TMP, RID_TMP);\n    emit_dnm(as, ARMI_EOR|ARMF_SH(ARMSH_ROR, 16), RID_TMP, left, left);\n  }\n}\n\nstatic void asm_bitshift(ASMState *as, IRIns *ir, ARMShift sh)\n{\n  if (irref_isk(ir->op2)) {  /* Constant shifts. */\n    /* NYI: Turn SHL+SHR or BAND+SHR into uxtb, uxth or ubfx. */\n    /* NYI: Turn SHL+ASR into sxtb, sxth or sbfx. */\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n    int32_t shift = (IR(ir->op2)->i & 31);\n    emit_dm(as, ARMI_MOV|ARMF_SH(sh, shift), dest, left);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n    Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n    emit_dm(as, ARMI_MOV|ARMF_RSH(sh, right), dest, left);\n  }\n}\n\nstatic void asm_intmin_max(ASMState *as, IRIns *ir, int cc)\n{\n  uint32_t kcmp = 0, kmov = 0;\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n  Reg right = 0;\n  if (irref_isk(ir->op2)) {\n    kcmp = emit_isk12(ARMI_CMP, IR(ir->op2)->i);\n    if (kcmp) kmov = emit_isk12(ARMI_MOV, IR(ir->op2)->i);\n  }\n  if (!kmov) {\n    kcmp = 0;\n    right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  }\n  if (kmov || dest != right) {\n    emit_dm(as, ARMF_CC(ARMI_MOV, cc)^kmov, dest, right);\n    cc ^= 1;  /* Must use opposite conditions for paired moves. */\n  } else {\n    cc ^= (CC_LT^CC_GT);  /* Otherwise may swap CC_LT <-> CC_GT. */\n  }\n  if (dest != left) emit_dm(as, ARMF_CC(ARMI_MOV, cc), dest, left);\n  emit_nm(as, ARMI_CMP^kcmp, left, right);\n}\n\n#if LJ_SOFTFP\nstatic void asm_sfpmin_max(ASMState *as, IRIns *ir, int cc)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp];\n  RegSet drop = RSET_SCRATCH;\n  Reg r;\n  IRRef args[4];\n  args[0] = ir->op1; args[1] = (ir+1)->op1;\n  args[2] = ir->op2; args[3] = (ir+1)->op2;\n  /* __aeabi_cdcmple preserves r0-r3. */\n  if (ra_hasreg(ir->r)) rset_clear(drop, ir->r);\n  if (ra_hasreg((ir+1)->r)) rset_clear(drop, (ir+1)->r);\n  if (!rset_test(as->freeset, RID_R2) &&\n      regcost_ref(as->cost[RID_R2]) == args[2]) rset_clear(drop, RID_R2);\n  if (!rset_test(as->freeset, RID_R3) &&\n      regcost_ref(as->cost[RID_R3]) == args[3]) rset_clear(drop, RID_R3);\n  ra_evictset(as, drop);\n  ra_destpair(as, ir);\n  emit_dm(as, ARMF_CC(ARMI_MOV, cc), RID_RETHI, RID_R3);\n  emit_dm(as, ARMF_CC(ARMI_MOV, cc), RID_RETLO, RID_R2);\n  emit_call(as, (void *)ci->func);\n  for (r = RID_R0; r <= RID_R3; r++)\n    ra_leftov(as, r, args[r-RID_R0]);\n}\n#else\nstatic void asm_fpmin_max(ASMState *as, IRIns *ir, int cc)\n{\n  Reg dest = (ra_dest(as, ir, RSET_FPR) & 15);\n  Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n  right = ((left >> 8) & 15); left &= 15;\n  if (dest != left) emit_dm(as, ARMF_CC(ARMI_VMOV_D, cc^1), dest, left);\n  if (dest != right) emit_dm(as, ARMF_CC(ARMI_VMOV_D, cc), dest, right);\n  emit_d(as, ARMI_VMRS, 0);\n  emit_dm(as, ARMI_VCMP_D, left, right);\n}\n#endif\n\nstatic void asm_min_max(ASMState *as, IRIns *ir, int cc, int fcc)\n{\n#if LJ_SOFTFP\n  UNUSED(fcc);\n#else\n  if (irt_isnum(ir->t))\n    asm_fpmin_max(as, ir, fcc);\n  else\n#endif\n    asm_intmin_max(as, ir, cc);\n}\n\n/* -- Comparisons --------------------------------------------------------- */\n\n/* Map of comparisons to flags. ORDER IR. */\nstatic const uint8_t asm_compmap[IR_ABC+1] = {\n  /* op  FP swp  int cc   FP cc */\n  /* LT       */ CC_GE + (CC_HS << 4),\n  /* GE    x  */ CC_LT + (CC_HI << 4),\n  /* LE       */ CC_GT + (CC_HI << 4),\n  /* GT    x  */ CC_LE + (CC_HS << 4),\n  /* ULT   x  */ CC_HS + (CC_LS << 4),\n  /* UGE      */ CC_LO + (CC_LO << 4),\n  /* ULE   x  */ CC_HI + (CC_LO << 4),\n  /* UGT      */ CC_LS + (CC_LS << 4),\n  /* EQ       */ CC_NE + (CC_NE << 4),\n  /* NE       */ CC_EQ + (CC_EQ << 4),\n  /* ABC      */ CC_LS + (CC_LS << 4)  /* Same as UGT. */\n};\n\n#if LJ_SOFTFP\n/* FP comparisons. */\nstatic void asm_sfpcomp(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp];\n  RegSet drop = RSET_SCRATCH;\n  Reg r;\n  IRRef args[4];\n  int swp = (((ir->o ^ (ir->o >> 2)) & ~(ir->o >> 3) & 1) << 1);\n  args[swp^0] = ir->op1; args[swp^1] = (ir+1)->op1;\n  args[swp^2] = ir->op2; args[swp^3] = (ir+1)->op2;\n  /* __aeabi_cdcmple preserves r0-r3. This helps to reduce spills. */\n  for (r = RID_R0; r <= RID_R3; r++)\n    if (!rset_test(as->freeset, r) &&\n\tregcost_ref(as->cost[r]) == args[r-RID_R0]) rset_clear(drop, r);\n  ra_evictset(as, drop);\n  asm_guardcc(as, (asm_compmap[ir->o] >> 4));\n  emit_call(as, (void *)ci->func);\n  for (r = RID_R0; r <= RID_R3; r++)\n    ra_leftov(as, r, args[r-RID_R0]);\n}\n#else\n/* FP comparisons. */\nstatic void asm_fpcomp(ASMState *as, IRIns *ir)\n{\n  Reg left, right;\n  ARMIns ai;\n  int swp = ((ir->o ^ (ir->o >> 2)) & ~(ir->o >> 3) & 1);\n  if (!swp && irref_isk(ir->op2) && ir_knum(IR(ir->op2))->u64 == 0) {\n    left = (ra_alloc1(as, ir->op1, RSET_FPR) & 15);\n    right = 0;\n    ai = ARMI_VCMPZ_D;\n  } else {\n    left = ra_alloc2(as, ir, RSET_FPR);\n    if (swp) {\n      right = (left & 15); left = ((left >> 8) & 15);\n    } else {\n      right = ((left >> 8) & 15); left &= 15;\n    }\n    ai = ARMI_VCMP_D;\n  }\n  asm_guardcc(as, (asm_compmap[ir->o] >> 4));\n  emit_d(as, ARMI_VMRS, 0);\n  emit_dm(as, ai, left, right);\n}\n#endif\n\n/* Integer comparisons. */\nstatic void asm_intcomp(ASMState *as, IRIns *ir)\n{\n  ARMCC cc = (asm_compmap[ir->o] & 15);\n  IRRef lref = ir->op1, rref = ir->op2;\n  Reg left;\n  uint32_t m;\n  int cmpprev0 = 0;\n  lua_assert(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t));\n  if (asm_swapops(as, lref, rref)) {\n    Reg tmp = lref; lref = rref; rref = tmp;\n    if (cc >= CC_GE) cc ^= 7;  /* LT <-> GT, LE <-> GE */\n    else if (cc > CC_NE) cc ^= 11;  /* LO <-> HI, LS <-> HS */\n  }\n  if (irref_isk(rref) && IR(rref)->i == 0) {\n    IRIns *irl = IR(lref);\n    cmpprev0 = (irl+1 == ir);\n    /* Combine comp(BAND(left, right), 0) into tst left, right. */\n    if (cmpprev0 && irl->o == IR_BAND && !ra_used(irl)) {\n      IRRef blref = irl->op1, brref = irl->op2;\n      uint32_t m2 = 0;\n      Reg bleft;\n      if (asm_swapops(as, blref, brref)) {\n\tReg tmp = blref; blref = brref; brref = tmp;\n      }\n      if (irref_isk(brref)) {\n\tm2 = emit_isk12(ARMI_AND, IR(brref)->i);\n\tif ((m2 & (ARMI_AND^ARMI_BIC)))\n\t  goto notst;  /* Not beneficial if we miss a constant operand. */\n      }\n      if (cc == CC_GE) cc = CC_PL;\n      else if (cc == CC_LT) cc = CC_MI;\n      else if (cc > CC_NE) goto notst;  /* Other conds don't work with tst. */\n      bleft = ra_alloc1(as, blref, RSET_GPR);\n      if (!m2) m2 = asm_fuseopm(as, 0, brref, rset_exclude(RSET_GPR, bleft));\n      asm_guardcc(as, cc);\n      emit_n(as, ARMI_TST^m2, bleft);\n      return;\n    }\n  }\nnotst:\n  left = ra_alloc1(as, lref, RSET_GPR);\n  m = asm_fuseopm(as, ARMI_CMP, rref, rset_exclude(RSET_GPR, left));\n  asm_guardcc(as, cc);\n  emit_n(as, ARMI_CMP^m, left);\n  /* Signed comparison with zero and referencing previous ins? */\n  if (cmpprev0 && (cc <= CC_NE || cc >= CC_GE))\n    as->flagmcp = as->mcp;  /* Allow elimination of the compare. */\n}\n\n/* 64 bit integer comparisons. */\nstatic void asm_int64comp(ASMState *as, IRIns *ir)\n{\n  int signedcomp = (ir->o <= IR_GT);\n  ARMCC cclo, cchi;\n  Reg leftlo, lefthi;\n  uint32_t mlo, mhi;\n  RegSet allow = RSET_GPR, oldfree;\n\n  /* Always use unsigned comparison for loword. */\n  cclo = asm_compmap[ir->o + (signedcomp ? 4 : 0)] & 15;\n  leftlo = ra_alloc1(as, ir->op1, allow);\n  oldfree = as->freeset;\n  mlo = asm_fuseopm(as, ARMI_CMP, ir->op2, rset_clear(allow, leftlo));\n  allow &= ~(oldfree & ~as->freeset);  /* Update for allocs of asm_fuseopm. */\n\n  /* Use signed or unsigned comparison for hiword. */\n  cchi = asm_compmap[ir->o] & 15;\n  lefthi = ra_alloc1(as, (ir+1)->op1, allow);\n  mhi = asm_fuseopm(as, ARMI_CMP, (ir+1)->op2, rset_clear(allow, lefthi));\n\n  /* All register allocations must be performed _before_ this point. */\n  if (signedcomp) {\n    MCLabel l_around = emit_label(as);\n    asm_guardcc(as, cclo);\n    emit_n(as, ARMI_CMP^mlo, leftlo);\n    emit_branch(as, ARMF_CC(ARMI_B, CC_NE), l_around);\n    if (cchi == CC_GE || cchi == CC_LE) cchi ^= 6;  /* GE -> GT, LE -> LT */\n    asm_guardcc(as, cchi);\n  } else {\n    asm_guardcc(as, cclo);\n    emit_n(as, ARMF_CC(ARMI_CMP, CC_EQ)^mlo, leftlo);\n  }\n  emit_n(as, ARMI_CMP^mhi, lefthi);\n}\n\n/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */\n\n/* Hiword op of a split 64 bit op. Previous op must be the loword op. */\nstatic void asm_hiop(ASMState *as, IRIns *ir)\n{\n#if LJ_HASFFI || LJ_SOFTFP\n  /* HIOP is marked as a store because it needs its own DCE logic. */\n  int uselo = ra_used(ir-1), usehi = ra_used(ir);  /* Loword/hiword used? */\n  if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1;\n  if ((ir-1)->o <= IR_NE) {  /* 64 bit integer or FP comparisons. ORDER IR. */\n    as->curins--;  /* Always skip the loword comparison. */\n#if LJ_SOFTFP\n    if (!irt_isint(ir->t))\n      asm_sfpcomp(as, ir-1);\n    else\n#endif\n      asm_int64comp(as, ir-1);\n    return;\n#if LJ_SOFTFP\n  } else if ((ir-1)->o == IR_MIN || (ir-1)->o == IR_MAX) {\n    as->curins--;  /* Always skip the loword min/max. */\n    if (uselo || usehi)\n      asm_sfpmin_max(as, ir-1, (ir-1)->o == IR_MIN ? CC_HI : CC_LO);\n    return;\n#elif LJ_HASFFI\n  } else if ((ir-1)->o == IR_CONV) {\n    as->curins--;  /* Always skip the CONV. */\n    if (usehi || uselo)\n      asm_conv64(as, ir);\n    return;\n#endif\n  } else if ((ir-1)->o == IR_XSTORE) {\n    if ((ir-1)->r != RID_SINK)\n      asm_xstore(as, ir, 4);\n    return;\n  }\n  if (!usehi) return;  /* Skip unused hiword op for all remaining ops. */\n  switch ((ir-1)->o) {\n#if LJ_HASFFI\n  case IR_ADD:\n    as->curins--;\n    asm_intop(as, ir, ARMI_ADC);\n    asm_intop(as, ir-1, ARMI_ADD|ARMI_S);\n    break;\n  case IR_SUB:\n    as->curins--;\n    asm_intop(as, ir, ARMI_SBC);\n    asm_intop(as, ir-1, ARMI_SUB|ARMI_S);\n    break;\n  case IR_NEG:\n    as->curins--;\n    asm_intneg(as, ir, ARMI_RSC);\n    asm_intneg(as, ir-1, ARMI_RSB|ARMI_S);\n    break;\n#endif\n#if LJ_SOFTFP\n  case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n  case IR_STRTO:\n    if (!uselo)\n      ra_allocref(as, ir->op1, RSET_GPR);  /* Mark lo op as used. */\n    break;\n#endif\n  case IR_CALLN:\n  case IR_CALLS:\n  case IR_CALLXS:\n    if (!uselo)\n      ra_allocref(as, ir->op1, RID2RSET(RID_RETLO));  /* Mark lo op as used. */\n    break;\n#if LJ_SOFTFP\n  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR:\n#endif\n  case IR_CNEWI:\n    /* Nothing to do here. Handled by lo op itself. */\n    break;\n  default: lua_assert(0); break;\n  }\n#else\n  UNUSED(as); UNUSED(ir); lua_assert(0);\n#endif\n}\n\n/* -- Stack handling ------------------------------------------------------ */\n\n/* Check Lua stack size for overflow. Use exit handler as fallback. */\nstatic void asm_stack_check(ASMState *as, BCReg topslot,\n\t\t\t    IRIns *irp, RegSet allow, ExitNo exitno)\n{\n  Reg pbase;\n  uint32_t k;\n  if (irp) {\n    if (!ra_hasspill(irp->s)) {\n      pbase = irp->r;\n      lua_assert(ra_hasreg(pbase));\n    } else if (allow) {\n      pbase = rset_pickbot(allow);\n    } else {\n      pbase = RID_RET;\n      emit_lso(as, ARMI_LDR, RID_RET, RID_SP, 0);  /* Restore temp. register. */\n    }\n  } else {\n    pbase = RID_BASE;\n  }\n  emit_branch(as, ARMF_CC(ARMI_BL, CC_LS), exitstub_addr(as->J, exitno));\n  k = emit_isk12(0, (int32_t)(8*topslot));\n  lua_assert(k);\n  emit_n(as, ARMI_CMP^k, RID_TMP);\n  emit_dnm(as, ARMI_SUB, RID_TMP, RID_TMP, pbase);\n  emit_lso(as, ARMI_LDR, RID_TMP, RID_TMP,\n\t   (int32_t)offsetof(lua_State, maxstack));\n  if (irp) {  /* Must not spill arbitrary registers in head of side trace. */\n    int32_t i = i32ptr(&J2G(as->J)->jit_L);\n    if (ra_hasspill(irp->s))\n      emit_lso(as, ARMI_LDR, pbase, RID_SP, sps_scale(irp->s));\n    emit_lso(as, ARMI_LDR, RID_TMP, RID_TMP, (i & 4095));\n    if (ra_hasspill(irp->s) && !allow)\n      emit_lso(as, ARMI_STR, RID_RET, RID_SP, 0);  /* Save temp. register. */\n    emit_loadi(as, RID_TMP, (i & ~4095));\n  } else {\n    emit_getgl(as, RID_TMP, jit_L);\n  }\n}\n\n/* Restore Lua stack from on-trace state. */\nstatic void asm_stack_restore(ASMState *as, SnapShot *snap)\n{\n  SnapEntry *map = &as->T->snapmap[snap->mapofs];\n  SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1];\n  MSize n, nent = snap->nent;\n  /* Store the value of all modified slots to the Lua stack. */\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    BCReg s = snap_slot(sn);\n    int32_t ofs = 8*((int32_t)s-1);\n    IRRef ref = snap_ref(sn);\n    IRIns *ir = IR(ref);\n    if ((sn & SNAP_NORESTORE))\n      continue;\n    if (irt_isnum(ir->t)) {\n#if LJ_SOFTFP\n      RegSet odd = rset_exclude(RSET_GPRODD, RID_BASE);\n      Reg tmp;\n      lua_assert(irref_isk(ref));  /* LJ_SOFTFP: must be a number constant. */\n      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.lo,\n\t\t      rset_exclude(RSET_GPREVEN, RID_BASE));\n      emit_lso(as, ARMI_STR, tmp, RID_BASE, ofs);\n      if (rset_test(as->freeset, tmp+1)) odd = RID2RSET(tmp+1);\n      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, odd);\n      emit_lso(as, ARMI_STR, tmp, RID_BASE, ofs+4);\n#else\n      Reg src = ra_alloc1(as, ref, RSET_FPR);\n      emit_vlso(as, ARMI_VSTR_D, src, RID_BASE, ofs);\n#endif\n    } else {\n      RegSet odd = rset_exclude(RSET_GPRODD, RID_BASE);\n      Reg type;\n      lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t));\n      if (!irt_ispri(ir->t)) {\n\tReg src = ra_alloc1(as, ref, rset_exclude(RSET_GPREVEN, RID_BASE));\n\temit_lso(as, ARMI_STR, src, RID_BASE, ofs);\n\tif (rset_test(as->freeset, src+1)) odd = RID2RSET(src+1);\n      }\n      if ((sn & (SNAP_CONT|SNAP_FRAME))) {\n\tif (s == 0) continue;  /* Do not overwrite link to previous frame. */\n\ttype = ra_allock(as, (int32_t)(*flinks--), odd);\n#if LJ_SOFTFP\n      } else if ((sn & SNAP_SOFTFPNUM)) {\n\ttype = ra_alloc1(as, ref+1, rset_exclude(RSET_GPRODD, RID_BASE));\n#endif\n      } else {\n\ttype = ra_allock(as, (int32_t)irt_toitype(ir->t), odd);\n      }\n      emit_lso(as, ARMI_STR, type, RID_BASE, ofs+4);\n    }\n    checkmclim(as);\n  }\n  lua_assert(map + nent == flinks);\n}\n\n/* -- GC handling --------------------------------------------------------- */\n\n/* Check GC threshold and do one or more GC steps. */\nstatic void asm_gc_check(ASMState *as)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg tmp1, tmp2;\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */\n  asm_guardcc(as, CC_NE);  /* Assumes asm_snap_prep() already done. */\n  emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ASMREF_TMP2;  /* MSize steps     */\n  asm_gencall(as, ci, args);\n  tmp1 = ra_releasetmp(as, ASMREF_TMP1);\n  tmp2 = ra_releasetmp(as, ASMREF_TMP2);\n  emit_loadi(as, tmp2, as->gcsteps);\n  /* Jump around GC step if GC total < GC threshold. */\n  emit_branch(as, ARMF_CC(ARMI_B, CC_LS), l_end);\n  emit_nm(as, ARMI_CMP, RID_TMP, tmp2);\n  emit_lso(as, ARMI_LDR, tmp2, tmp1,\n\t   (int32_t)offsetof(global_State, gc.threshold));\n  emit_lso(as, ARMI_LDR, RID_TMP, tmp1,\n\t   (int32_t)offsetof(global_State, gc.total));\n  ra_allockreg(as, i32ptr(J2G(as->J)), tmp1);\n  as->gcsteps = 0;\n  checkmclim(as);\n}\n\n/* -- Loop handling ------------------------------------------------------- */\n\n/* Fixup the loop branch. */\nstatic void asm_loop_fixup(ASMState *as)\n{\n  MCode *p = as->mctop;\n  MCode *target = as->mcp;\n  if (as->loopinv) {  /* Inverted loop branch? */\n    /* asm_guardcc already inverted the bcc and patched the final bl. */\n    p[-2] |= ((uint32_t)(target-p) & 0x00ffffffu);\n  } else {\n    p[-1] = ARMI_B | ((uint32_t)((target-p)-1) & 0x00ffffffu);\n  }\n}\n\n/* -- Head of trace ------------------------------------------------------- */\n\n/* Reload L register from g->jit_L. */\nstatic void asm_head_lreg(ASMState *as)\n{\n  IRIns *ir = IR(ASMREF_L);\n  if (ra_used(ir)) {\n    Reg r = ra_dest(as, ir, RSET_GPR);\n    emit_getgl(as, r, jit_L);\n    ra_evictk(as);\n  }\n}\n\n/* Coalesce BASE register for a root trace. */\nstatic void asm_head_root_base(ASMState *as)\n{\n  IRIns *ir;\n  asm_head_lreg(as);\n  ir = IR(REF_BASE);\n  if (ra_hasreg(ir->r) && rset_test(as->modset, ir->r)) ra_spill(as, ir);\n  ra_destreg(as, ir, RID_BASE);\n}\n\n/* Coalesce BASE register for a side trace. */\nstatic RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)\n{\n  IRIns *ir;\n  asm_head_lreg(as);\n  ir = IR(REF_BASE);\n  if (ra_hasreg(ir->r) && rset_test(as->modset, ir->r)) ra_spill(as, ir);\n  if (ra_hasspill(irp->s)) {\n    rset_clear(allow, ra_dest(as, ir, allow));\n  } else {\n    Reg r = irp->r;\n    lua_assert(ra_hasreg(r));\n    rset_clear(allow, r);\n    if (r != ir->r && !rset_test(as->freeset, r))\n      ra_restore(as, regcost_ref(as->cost[r]));\n    ra_destreg(as, ir, r);\n  }\n  return allow;\n}\n\n/* -- Tail of trace ------------------------------------------------------- */\n\n/* Fixup the tail code. */\nstatic void asm_tail_fixup(ASMState *as, TraceNo lnk)\n{\n  MCode *p = as->mctop;\n  MCode *target;\n  int32_t spadj = as->T->spadjust;\n  if (spadj == 0) {\n    as->mctop = --p;\n  } else {\n    /* Patch stack adjustment. */\n    uint32_t k = emit_isk12(ARMI_ADD, spadj);\n    lua_assert(k);\n    p[-2] = (ARMI_ADD^k) | ARMF_D(RID_SP) | ARMF_N(RID_SP);\n  }\n  /* Patch exit branch. */\n  target = lnk ? traceref(as->J, lnk)->mcode : (MCode *)lj_vm_exit_interp;\n  p[-1] = ARMI_B|(((target-p)-1)&0x00ffffffu);\n}\n\n/* Prepare tail of code. */\nstatic void asm_tail_prep(ASMState *as)\n{\n  MCode *p = as->mctop - 1;  /* Leave room for exit branch. */\n  if (as->loopref) {\n    as->invmcp = as->mcp = p;\n  } else {\n    as->mcp = p-1;  /* Leave room for stack pointer adjustment. */\n    as->invmcp = NULL;\n  }\n  *p = 0;  /* Prevent load/store merging. */\n}\n\n/* -- Instruction dispatch ------------------------------------------------ */\n\n/* Assemble a single instruction. */\nstatic void asm_ir(ASMState *as, IRIns *ir)\n{\n  switch ((IROp)ir->o) {\n  /* Miscellaneous ops. */\n  case IR_LOOP: asm_loop(as); break;\n  case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break;\n  case IR_USE:\n    ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break;\n  case IR_PHI: asm_phi(as, ir); break;\n  case IR_HIOP: asm_hiop(as, ir); break;\n  case IR_GCSTEP: asm_gcstep(as, ir); break;\n\n  /* Guarded assertions. */\n  case IR_EQ: case IR_NE:\n    if ((ir-1)->o == IR_HREF && ir->op1 == as->curins-1) {\n      as->curins--;\n      asm_href(as, ir-1, (IROp)ir->o);\n      break;\n    }\n    /* fallthrough */\n  case IR_LT: case IR_GE: case IR_LE: case IR_GT:\n  case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT:\n  case IR_ABC:\n#if !LJ_SOFTFP\n    if (irt_isnum(ir->t)) { asm_fpcomp(as, ir); break; }\n#endif\n    asm_intcomp(as, ir);\n    break;\n\n  case IR_RETF: asm_retf(as, ir); break;\n\n  /* Bit ops. */\n  case IR_BNOT: asm_bitop(as, ir, ARMI_MVN); break;\n  case IR_BSWAP: asm_bitswap(as, ir); break;\n\n  case IR_BAND: asm_bitop(as, ir, ARMI_AND); break;\n  case IR_BOR:  asm_bitop(as, ir, ARMI_ORR); break;\n  case IR_BXOR: asm_bitop(as, ir, ARMI_EOR); break;\n\n  case IR_BSHL: asm_bitshift(as, ir, ARMSH_LSL); break;\n  case IR_BSHR: asm_bitshift(as, ir, ARMSH_LSR); break;\n  case IR_BSAR: asm_bitshift(as, ir, ARMSH_ASR); break;\n  case IR_BROR: asm_bitshift(as, ir, ARMSH_ROR); break;\n  case IR_BROL: lua_assert(0); break;\n\n  /* Arithmetic ops. */\n  case IR_ADD: case IR_ADDOV: asm_add(as, ir); break;\n  case IR_SUB: case IR_SUBOV: asm_sub(as, ir); break;\n  case IR_MUL: case IR_MULOV: asm_mul(as, ir); break;\n  case IR_MOD: asm_callid(as, ir, IRCALL_lj_vm_modi); break;\n  case IR_NEG: asm_neg(as, ir); break;\n\n#if LJ_SOFTFP\n  case IR_DIV: case IR_POW: case IR_ABS:\n  case IR_ATAN2: case IR_LDEXP: case IR_FPMATH: case IR_TOBIT:\n    lua_assert(0);  /* Unused for LJ_SOFTFP. */\n    break;\n#else\n  case IR_DIV: asm_fparith(as, ir, ARMI_VDIV_D); break;\n  case IR_POW: asm_callid(as, ir, IRCALL_lj_vm_powi); break;\n  case IR_ABS: asm_fpunary(as, ir, ARMI_VABS_D); break;\n  case IR_ATAN2: asm_callid(as, ir, IRCALL_atan2); break;\n  case IR_LDEXP: asm_callid(as, ir, IRCALL_ldexp); break;\n  case IR_FPMATH:\n    if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir))\n      break;\n    if (ir->op2 <= IRFPM_TRUNC)\n      asm_callround(as, ir, ir->op2);\n    else if (ir->op2 == IRFPM_SQRT)\n      asm_fpunary(as, ir, ARMI_VSQRT_D);\n    else\n      asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);\n    break;\n  case IR_TOBIT: asm_tobit(as, ir); break;\n#endif\n\n  case IR_MIN: asm_min_max(as, ir, CC_GT, CC_HI); break;\n  case IR_MAX: asm_min_max(as, ir, CC_LT, CC_LO); break;\n\n  /* Memory references. */\n  case IR_AREF: asm_aref(as, ir); break;\n  case IR_HREF: asm_href(as, ir, 0); break;\n  case IR_HREFK: asm_hrefk(as, ir); break;\n  case IR_NEWREF: asm_newref(as, ir); break;\n  case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break;\n  case IR_FREF: asm_fref(as, ir); break;\n  case IR_STRREF: asm_strref(as, ir); break;\n\n  /* Loads and stores. */\n  case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n    asm_ahuvload(as, ir);\n    break;\n  case IR_FLOAD: asm_fload(as, ir); break;\n  case IR_XLOAD: asm_xload(as, ir); break;\n  case IR_SLOAD: asm_sload(as, ir); break;\n\n  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break;\n  case IR_FSTORE: asm_fstore(as, ir); break;\n  case IR_XSTORE: asm_xstore(as, ir, 0); break;\n\n  /* Allocations. */\n  case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break;\n  case IR_TNEW: asm_tnew(as, ir); break;\n  case IR_TDUP: asm_tdup(as, ir); break;\n  case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break;\n\n  /* Write barriers. */\n  case IR_TBAR: asm_tbar(as, ir); break;\n  case IR_OBAR: asm_obar(as, ir); break;\n\n  /* Type conversions. */\n  case IR_CONV: asm_conv(as, ir); break;\n  case IR_TOSTR: asm_tostr(as, ir); break;\n  case IR_STRTO: asm_strto(as, ir); break;\n\n  /* Calls. */\n  case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break;\n  case IR_CALLXS: asm_callx(as, ir); break;\n  case IR_CARG: break;\n\n  default:\n    setintV(&as->J->errinfo, ir->o);\n    lj_trace_err_info(as->J, LJ_TRERR_NYIIR);\n    break;\n  }\n}\n\n/* -- Trace setup --------------------------------------------------------- */\n\n/* Ensure there are enough stack slots for call arguments. */\nstatic Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  IRRef args[CCI_NARGS_MAX];\n  uint32_t i, nargs = (int)CCI_NARGS(ci);\n  int nslots = 0, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR, fprodd = 0;\n  asm_collectargs(as, ir, ci, args);\n  for (i = 0; i < nargs; i++) {\n    if (!LJ_SOFTFP && args[i] && irt_isfp(IR(args[i])->t)) {\n      if (!LJ_ABI_SOFTFP && !(ci->flags & CCI_VARARG)) {\n\tif (irt_isnum(IR(args[i])->t)) {\n\t  if (nfpr > 0) nfpr--;\n\t  else fprodd = 0, nslots = (nslots + 3) & ~1;\n\t} else {\n\t  if (fprodd) fprodd--;\n\t  else if (nfpr > 0) fprodd = 1, nfpr--;\n\t  else nslots++;\n\t}\n      } else if (irt_isnum(IR(args[i])->t)) {\n\tngpr &= ~1;\n\tif (ngpr > 0) ngpr -= 2; else nslots += 2;\n      } else {\n\tif (ngpr > 0) ngpr--; else nslots++;\n      }\n    } else {\n      if (ngpr > 0) ngpr--; else nslots++;\n    }\n  }\n  if (nslots > as->evenspill)  /* Leave room for args in stack slots. */\n    as->evenspill = nslots;\n  return REGSP_HINT(RID_RET);\n}\n\nstatic void asm_setup_target(ASMState *as)\n{\n  /* May need extra exit for asm_stack_check on side traces. */\n  asm_exitstub_setup(as, as->T->nsnap + (as->parent ? 1 : 0));\n}\n\n/* -- Trace patching ------------------------------------------------------ */\n\n/* Patch exit jumps of existing machine code to a new target. */\nvoid lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target)\n{\n  MCode *p = T->mcode;\n  MCode *pe = (MCode *)((char *)p + T->szmcode);\n  MCode *cstart = NULL, *cend = p;\n  MCode *mcarea = lj_mcode_patch(J, p, 0);\n  MCode *px = exitstub_addr(J, exitno) - 2;\n  for (; p < pe; p++) {\n    /* Look for bl_cc exitstub, replace with b_cc target. */\n    uint32_t ins = *p;\n    if ((ins & 0x0f000000u) == 0x0b000000u && ins < 0xf0000000u &&\n\t((ins ^ (px-p)) & 0x00ffffffu) == 0) {\n      *p = (ins & 0xfe000000u) | (((target-p)-2) & 0x00ffffffu);\n      cend = p+1;\n      if (!cstart) cstart = p;\n    }\n  }\n  lua_assert(cstart != NULL);\n  lj_mcode_sync(cstart, cend);\n  lj_mcode_patch(J, mcarea, 1);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_asm_mips.h",
    "content": "/*\n** MIPS IR assembler (SSA IR -> machine code).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Register allocator extensions --------------------------------------- */\n\n/* Allocate a register with a hint. */\nstatic Reg ra_hintalloc(ASMState *as, IRRef ref, Reg hint, RegSet allow)\n{\n  Reg r = IR(ref)->r;\n  if (ra_noreg(r)) {\n    if (!ra_hashint(r) && !iscrossref(as, ref))\n      ra_sethint(IR(ref)->r, hint);  /* Propagate register hint. */\n    r = ra_allocref(as, ref, allow);\n  }\n  ra_noweak(as, r);\n  return r;\n}\n\n/* Allocate a register or RID_ZERO. */\nstatic Reg ra_alloc1z(ASMState *as, IRRef ref, RegSet allow)\n{\n  Reg r = IR(ref)->r;\n  if (ra_noreg(r)) {\n    if (!(allow & RSET_FPR) && irref_isk(ref) && IR(ref)->i == 0)\n      return RID_ZERO;\n    r = ra_allocref(as, ref, allow);\n  } else {\n    ra_noweak(as, r);\n  }\n  return r;\n}\n\n/* Allocate two source registers for three-operand instructions. */\nstatic Reg ra_alloc2(ASMState *as, IRIns *ir, RegSet allow)\n{\n  IRIns *irl = IR(ir->op1), *irr = IR(ir->op2);\n  Reg left = irl->r, right = irr->r;\n  if (ra_hasreg(left)) {\n    ra_noweak(as, left);\n    if (ra_noreg(right))\n      right = ra_alloc1z(as, ir->op2, rset_exclude(allow, left));\n    else\n      ra_noweak(as, right);\n  } else if (ra_hasreg(right)) {\n    ra_noweak(as, right);\n    left = ra_alloc1z(as, ir->op1, rset_exclude(allow, right));\n  } else if (ra_hashint(right)) {\n    right = ra_alloc1z(as, ir->op2, allow);\n    left = ra_alloc1z(as, ir->op1, rset_exclude(allow, right));\n  } else {\n    left = ra_alloc1z(as, ir->op1, allow);\n    right = ra_alloc1z(as, ir->op2, rset_exclude(allow, left));\n  }\n  return left | (right << 8);\n}\n\n/* -- Guard handling ------------------------------------------------------ */\n\n/* Need some spare long-range jump slots, for out-of-range branches. */\n#define MIPS_SPAREJUMP\t\t4\n\n/* Setup spare long-range jump slots per mcarea. */\nstatic void asm_sparejump_setup(ASMState *as)\n{\n  MCode *mxp = as->mcbot;\n  /* Assumes sizeof(MCLink) == 8. */\n  if (((uintptr_t)mxp & (LJ_PAGESIZE-1)) == 8) {\n    lua_assert(MIPSI_NOP == 0);\n    memset(mxp+2, 0, MIPS_SPAREJUMP*8);\n    mxp += MIPS_SPAREJUMP*2;\n    lua_assert(mxp < as->mctop);\n    lj_mcode_sync(as->mcbot, mxp);\n    lj_mcode_commitbot(as->J, mxp);\n    as->mcbot = mxp;\n    as->mclim = as->mcbot + MCLIM_REDZONE;\n  }\n}\n\n/* Setup exit stub after the end of each trace. */\nstatic void asm_exitstub_setup(ASMState *as)\n{\n  MCode *mxp = as->mctop;\n  /* sw TMP, 0(sp); j ->vm_exit_handler; li TMP, traceno */\n  *--mxp = MIPSI_LI|MIPSF_T(RID_TMP)|as->T->traceno;\n  *--mxp = MIPSI_J|((((uintptr_t)(void *)lj_vm_exit_handler)>>2)&0x03ffffffu);\n  lua_assert(((uintptr_t)mxp ^ (uintptr_t)(void *)lj_vm_exit_handler)>>28 == 0);\n  *--mxp = MIPSI_SW|MIPSF_T(RID_TMP)|MIPSF_S(RID_SP)|0;\n  as->mctop = mxp;\n}\n\n/* Keep this in-sync with exitstub_trace_addr(). */\n#define asm_exitstub_addr(as)\t((as)->mctop)\n\n/* Emit conditional branch to exit for guard. */\nstatic void asm_guard(ASMState *as, MIPSIns mi, Reg rs, Reg rt)\n{\n  MCode *target = asm_exitstub_addr(as);\n  MCode *p = as->mcp;\n  if (LJ_UNLIKELY(p == as->invmcp)) {\n    as->invmcp = NULL;\n    as->loopinv = 1;\n    as->mcp = p+1;\n    mi = mi ^ ((mi>>28) == 1 ? 0x04000000u : 0x00010000u);  /* Invert cond. */\n    target = p;  /* Patch target later in asm_loop_fixup. */\n  }\n  emit_ti(as, MIPSI_LI, RID_TMP, as->snapno);\n  emit_branch(as, mi, rs, rt, target);\n}\n\n/* -- Operand fusion ------------------------------------------------------ */\n\n/* Limit linear search to this distance. Avoids O(n^2) behavior. */\n#define CONFLICT_SEARCH_LIM\t31\n\n/* Check if there's no conflicting instruction between curins and ref. */\nstatic int noconflict(ASMState *as, IRRef ref, IROp conflict)\n{\n  IRIns *ir = as->ir;\n  IRRef i = as->curins;\n  if (i > ref + CONFLICT_SEARCH_LIM)\n    return 0;  /* Give up, ref is too far away. */\n  while (--i > ref)\n    if (ir[i].o == conflict)\n      return 0;  /* Conflict found. */\n  return 1;  /* Ok, no conflict. */\n}\n\n/* Fuse the array base of colocated arrays. */\nstatic int32_t asm_fuseabase(ASMState *as, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (ir->o == IR_TNEW && ir->op1 <= LJ_MAX_COLOSIZE &&\n      !neverfuse(as) && noconflict(as, ref, IR_NEWREF))\n    return (int32_t)sizeof(GCtab);\n  return 0;\n}\n\n/* Fuse array/hash/upvalue reference into register+offset operand. */\nstatic Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow)\n{\n  IRIns *ir = IR(ref);\n  if (ra_noreg(ir->r)) {\n    if (ir->o == IR_AREF) {\n      if (mayfuse(as, ref)) {\n\tif (irref_isk(ir->op2)) {\n\t  IRRef tab = IR(ir->op1)->op1;\n\t  int32_t ofs = asm_fuseabase(as, tab);\n\t  IRRef refa = ofs ? tab : ir->op1;\n\t  ofs += 8*IR(ir->op2)->i;\n\t  if (checki16(ofs)) {\n\t    *ofsp = ofs;\n\t    return ra_alloc1(as, refa, allow);\n\t  }\n\t}\n      }\n    } else if (ir->o == IR_HREFK) {\n      if (mayfuse(as, ref)) {\n\tint32_t ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node));\n\tif (checki16(ofs)) {\n\t  *ofsp = ofs;\n\t  return ra_alloc1(as, ir->op1, allow);\n\t}\n      }\n    } else if (ir->o == IR_UREFC) {\n      if (irref_isk(ir->op1)) {\n\tGCfunc *fn = ir_kfunc(IR(ir->op1));\n\tint32_t ofs = i32ptr(&gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.tv);\n\tint32_t jgl = (intptr_t)J2G(as->J);\n\tif ((uint32_t)(ofs-jgl) < 65536) {\n\t  *ofsp = ofs-jgl-32768;\n\t  return RID_JGL;\n\t} else {\n\t  *ofsp = (int16_t)ofs;\n\t  return ra_allock(as, ofs-(int16_t)ofs, allow);\n\t}\n      }\n    }\n  }\n  *ofsp = 0;\n  return ra_alloc1(as, ref, allow);\n}\n\n/* Fuse XLOAD/XSTORE reference into load/store operand. */\nstatic void asm_fusexref(ASMState *as, MIPSIns mi, Reg rt, IRRef ref,\n\t\t\t RegSet allow, int32_t ofs)\n{\n  IRIns *ir = IR(ref);\n  Reg base;\n  if (ra_noreg(ir->r) && canfuse(as, ir)) {\n    if (ir->o == IR_ADD) {\n      int32_t ofs2;\n      if (irref_isk(ir->op2) && (ofs2 = ofs + IR(ir->op2)->i, checki16(ofs2))) {\n\tref = ir->op1;\n\tofs = ofs2;\n      }\n    } else if (ir->o == IR_STRREF) {\n      int32_t ofs2 = 65536;\n      lua_assert(ofs == 0);\n      ofs = (int32_t)sizeof(GCstr);\n      if (irref_isk(ir->op2)) {\n\tofs2 = ofs + IR(ir->op2)->i;\n\tref = ir->op1;\n      } else if (irref_isk(ir->op1)) {\n\tofs2 = ofs + IR(ir->op1)->i;\n\tref = ir->op2;\n      }\n      if (!checki16(ofs2)) {\n\t/* NYI: Fuse ADD with constant. */\n\tReg right, left = ra_alloc2(as, ir, allow);\n\tright = (left >> 8); left &= 255;\n\temit_hsi(as, mi, rt, RID_TMP, ofs);\n\temit_dst(as, MIPSI_ADDU, RID_TMP, left, right);\n\treturn;\n      }\n      ofs = ofs2;\n    }\n  }\n  base = ra_alloc1(as, ref, allow);\n  emit_hsi(as, mi, rt, base, ofs);\n}\n\n/* -- Calls --------------------------------------------------------------- */\n\n/* Generate a call to a C function. */\nstatic void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)\n{\n  uint32_t n, nargs = CCI_NARGS(ci);\n  int32_t ofs = 16;\n  Reg gpr, fpr = REGARG_FIRSTFPR;\n  if ((void *)ci->func)\n    emit_call(as, (void *)ci->func);\n  for (gpr = REGARG_FIRSTGPR; gpr <= REGARG_LASTGPR; gpr++)\n    as->cost[gpr] = REGCOST(~0u, ASMREF_L);\n  gpr = REGARG_FIRSTGPR;\n  for (n = 0; n < nargs; n++) {  /* Setup args. */\n    IRRef ref = args[n];\n    if (ref) {\n      IRIns *ir = IR(ref);\n      if (irt_isfp(ir->t) && fpr <= REGARG_LASTFPR &&\n\t  !(ci->flags & CCI_VARARG)) {\n\tlua_assert(rset_test(as->freeset, fpr));  /* Already evicted. */\n\tra_leftov(as, fpr, ref);\n\tfpr += 2;\n\tgpr += irt_isnum(ir->t) ? 2 : 1;\n      } else {\n\tfpr = REGARG_LASTFPR+1;\n\tif (irt_isnum(ir->t)) gpr = (gpr+1) & ~1;\n\tif (gpr <= REGARG_LASTGPR) {\n\t  lua_assert(rset_test(as->freeset, gpr));  /* Already evicted. */\n\t  if (irt_isfp(ir->t)) {\n\t    RegSet of = as->freeset;\n\t    Reg r;\n\t    /* Workaround to protect argument GPRs from being used for remat. */\n\t    as->freeset &= ~RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1);\n\t    r = ra_alloc1(as, ref, RSET_FPR);\n\t    as->freeset |= (of & RSET_RANGE(REGARG_FIRSTGPR, REGARG_LASTGPR+1));\n\t    if (irt_isnum(ir->t)) {\n\t      emit_tg(as, MIPSI_MFC1, gpr+(LJ_BE?0:1), r+1);\n\t      emit_tg(as, MIPSI_MFC1, gpr+(LJ_BE?1:0), r);\n\t      lua_assert(rset_test(as->freeset, gpr+1));  /* Already evicted. */\n\t      gpr += 2;\n\t    } else if (irt_isfloat(ir->t)) {\n\t      emit_tg(as, MIPSI_MFC1, gpr, r);\n\t      gpr++;\n\t    }\n\t  } else {\n\t    ra_leftov(as, gpr, ref);\n\t    gpr++;\n\t  }\n\t} else {\n\t  Reg r = ra_alloc1z(as, ref, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);\n\t  if (irt_isnum(ir->t)) ofs = (ofs + 4) & ~4;\n\t  emit_spstore(as, ir, r, ofs);\n\t  ofs += irt_isnum(ir->t) ? 8 : 4;\n\t}\n      }\n    } else {\n      fpr = REGARG_LASTFPR+1;\n      if (gpr <= REGARG_LASTGPR)\n\tgpr++;\n      else\n\tofs += 4;\n    }\n  }\n}\n\n/* Setup result reg/sp for call. Evict scratch regs. */\nstatic void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  RegSet drop = RSET_SCRATCH;\n  int hiop = ((ir+1)->o == IR_HIOP);\n  if ((ci->flags & CCI_NOFPRCLOBBER))\n    drop &= ~RSET_FPR;\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  if (hiop && ra_hasreg((ir+1)->r))\n    rset_clear(drop, (ir+1)->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);  /* Evictions must be performed first. */\n  if (ra_used(ir)) {\n    lua_assert(!irt_ispri(ir->t));\n    if (irt_isfp(ir->t)) {\n      if ((ci->flags & CCI_CASTU64)) {\n\tint32_t ofs = sps_scale(ir->s);\n\tReg dest = ir->r;\n\tif (ra_hasreg(dest)) {\n\t  ra_free(as, dest);\n\t  ra_modified(as, dest);\n\t  emit_tg(as, MIPSI_MTC1, RID_RETHI, dest+1);\n\t  emit_tg(as, MIPSI_MTC1, RID_RETLO, dest);\n\t}\n\tif (ofs) {\n\t  emit_tsi(as, MIPSI_SW, RID_RETLO, RID_SP, ofs+(LJ_BE?4:0));\n\t  emit_tsi(as, MIPSI_SW, RID_RETHI, RID_SP, ofs+(LJ_BE?0:4));\n\t}\n      } else {\n\tra_destreg(as, ir, RID_FPRET);\n      }\n    } else if (hiop) {\n      ra_destpair(as, ir);\n    } else {\n      ra_destreg(as, ir, RID_RET);\n    }\n  }\n}\n\nstatic void asm_call(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  const CCallInfo *ci = &lj_ir_callinfo[ir->op2];\n  asm_collectargs(as, ir, ci, args);\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\nstatic void asm_callx(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  CCallInfo ci;\n  IRRef func;\n  IRIns *irf;\n  ci.flags = asm_callx_flags(as, ir);\n  asm_collectargs(as, ir, &ci, args);\n  asm_setupresult(as, ir, &ci);\n  func = ir->op2; irf = IR(func);\n  if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); }\n  if (irref_isk(func)) {  /* Call to constant address. */\n    ci.func = (ASMFunction)(void *)(irf->i);\n  } else {  /* Need specific register for indirect calls. */\n    Reg r = ra_alloc1(as, func, RID2RSET(RID_CFUNCADDR));\n    MCode *p = as->mcp;\n    if (r == RID_CFUNCADDR)\n      *--p = MIPSI_NOP;\n    else\n      *--p = MIPSI_MOVE | MIPSF_D(RID_CFUNCADDR) | MIPSF_S(r);\n    *--p = MIPSI_JALR | MIPSF_S(r);\n    as->mcp = p;\n    ci.func = (ASMFunction)(void *)0;\n  }\n  asm_gencall(as, &ci, args);\n}\n\nstatic void asm_callid(ASMState *as, IRIns *ir, IRCallID id)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[id];\n  IRRef args[2];\n  args[0] = ir->op1;\n  args[1] = ir->op2;\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\nstatic void asm_callround(ASMState *as, IRIns *ir, IRCallID id)\n{\n  /* The modified regs must match with the *.dasc implementation. */\n  RegSet drop = RID2RSET(RID_R1)|RID2RSET(RID_R12)|RID2RSET(RID_FPRET)|\n\t\tRID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(REGARG_FIRSTFPR);\n  if (ra_hasreg(ir->r)) rset_clear(drop, ir->r);\n  ra_evictset(as, drop);\n  ra_destreg(as, ir, RID_FPRET);\n  emit_call(as, (void *)lj_ir_callinfo[id].func);\n  ra_leftov(as, REGARG_FIRSTFPR, ir->op1);\n}\n\n/* -- Returns ------------------------------------------------------------- */\n\n/* Return to lower frame. Guard that it goes to the right spot. */\nstatic void asm_retf(ASMState *as, IRIns *ir)\n{\n  Reg base = ra_alloc1(as, REF_BASE, RSET_GPR);\n  void *pc = ir_kptr(IR(ir->op2));\n  int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));\n  as->topslot -= (BCReg)delta;\n  if ((int32_t)as->topslot < 0) as->topslot = 0;\n  emit_setgl(as, base, jit_base);\n  emit_addptr(as, base, -8*delta);\n  asm_guard(as, MIPSI_BNE, RID_TMP,\n\t    ra_allock(as, i32ptr(pc), rset_exclude(RSET_GPR, base)));\n  emit_tsi(as, MIPSI_LW, RID_TMP, base, -8);\n}\n\n/* -- Type conversions ---------------------------------------------------- */\n\nstatic void asm_tointg(ASMState *as, IRIns *ir, Reg left)\n{\n  Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left));\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  asm_guard(as, MIPSI_BC1F, 0, 0);\n  emit_fgh(as, MIPSI_C_EQ_D, 0, tmp, left);\n  emit_fg(as, MIPSI_CVT_D_W, tmp, tmp);\n  emit_tg(as, MIPSI_MFC1, dest, tmp);\n  emit_fg(as, MIPSI_CVT_W_D, tmp, left);\n}\n\nstatic void asm_tobit(ASMState *as, IRIns *ir)\n{\n  RegSet allow = RSET_FPR;\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, allow);\n  Reg right = ra_alloc1(as, ir->op2, rset_clear(allow, left));\n  Reg tmp = ra_scratch(as, rset_clear(allow, right));\n  emit_tg(as, MIPSI_MFC1, dest, tmp);\n  emit_fgh(as, MIPSI_ADD_D, tmp, left, right);\n}\n\nstatic void asm_conv(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);\n  int stfp = (st == IRT_NUM || st == IRT_FLOAT);\n  IRRef lref = ir->op1;\n  lua_assert(irt_type(ir->t) != st);\n  lua_assert(!(irt_isint64(ir->t) ||\n\t       (st == IRT_I64 || st == IRT_U64))); /* Handled by SPLIT. */\n  if (irt_isfp(ir->t)) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    if (stfp) {  /* FP to FP conversion. */\n      emit_fg(as, st == IRT_NUM ? MIPSI_CVT_S_D : MIPSI_CVT_D_S,\n\t      dest, ra_alloc1(as, lref, RSET_FPR));\n    } else if (st == IRT_U32) {  /* U32 to FP conversion. */\n      /* y = (x ^ 0x8000000) + 2147483648.0 */\n      Reg left = ra_alloc1(as, lref, RSET_GPR);\n      Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, dest));\n      emit_fgh(as, irt_isfloat(ir->t) ? MIPSI_ADD_S : MIPSI_ADD_D,\n\t       dest, dest, tmp);\n      emit_fg(as, irt_isfloat(ir->t) ? MIPSI_CVT_S_W : MIPSI_CVT_D_W,\n\t      dest, dest);\n      if (irt_isfloat(ir->t))\n\temit_lsptr(as, MIPSI_LWC1, (tmp & 31),\n\t\t   (void *)lj_ir_k64_find(as->J, U64x(4f000000,4f000000)),\n\t\t   RSET_GPR);\n      else\n\temit_lsptr(as, MIPSI_LDC1, (tmp & 31),\n\t\t   (void *)lj_ir_k64_find(as->J, U64x(41e00000,00000000)),\n\t\t   RSET_GPR);\n      emit_tg(as, MIPSI_MTC1, RID_TMP, dest);\n      emit_dst(as, MIPSI_XOR, RID_TMP, RID_TMP, left);\n      emit_ti(as, MIPSI_LUI, RID_TMP, 0x8000);\n    } else {  /* Integer to FP conversion. */\n      Reg left = ra_alloc1(as, lref, RSET_GPR);\n      emit_fg(as, irt_isfloat(ir->t) ? MIPSI_CVT_S_W : MIPSI_CVT_D_W,\n\t      dest, dest);\n      emit_tg(as, MIPSI_MTC1, left, dest);\n    }\n  } else if (stfp) {  /* FP to integer conversion. */\n    if (irt_isguard(ir->t)) {\n      /* Checked conversions are only supported from number to int. */\n      lua_assert(irt_isint(ir->t) && st == IRT_NUM);\n      asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR));\n    } else {\n      Reg dest = ra_dest(as, ir, RSET_GPR);\n      Reg left = ra_alloc1(as, lref, RSET_FPR);\n      Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left));\n      if (irt_isu32(ir->t)) {\n\t/* y = (int)floor(x - 2147483648.0) ^ 0x80000000 */\n\temit_dst(as, MIPSI_XOR, dest, dest, RID_TMP);\n\temit_ti(as, MIPSI_LUI, RID_TMP, 0x8000);\n\temit_tg(as, MIPSI_MFC1, dest, tmp);\n\temit_fg(as, st == IRT_FLOAT ? MIPSI_FLOOR_W_S : MIPSI_FLOOR_W_D,\n\t\ttmp, tmp);\n\temit_fgh(as, st == IRT_FLOAT ? MIPSI_SUB_S : MIPSI_SUB_D,\n\t\t tmp, left, tmp);\n\tif (st == IRT_FLOAT)\n\t  emit_lsptr(as, MIPSI_LWC1, (tmp & 31),\n\t\t     (void *)lj_ir_k64_find(as->J, U64x(4f000000,4f000000)),\n\t\t     RSET_GPR);\n\telse\n\t  emit_lsptr(as, MIPSI_LDC1, (tmp & 31),\n\t\t     (void *)lj_ir_k64_find(as->J, U64x(41e00000,00000000)),\n\t\t     RSET_GPR);\n      } else {\n\temit_tg(as, MIPSI_MFC1, dest, tmp);\n\temit_fg(as, st == IRT_FLOAT ? MIPSI_TRUNC_W_S : MIPSI_TRUNC_W_D,\n\t\ttmp, left);\n      }\n    }\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    if (st >= IRT_I8 && st <= IRT_U16) {  /* Extend to 32 bit integer. */\n      Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n      lua_assert(irt_isint(ir->t) || irt_isu32(ir->t));\n      if ((ir->op2 & IRCONV_SEXT)) {\n\tif ((as->flags & JIT_F_MIPS32R2)) {\n\t  emit_dst(as, st == IRT_I8 ? MIPSI_SEB : MIPSI_SEH, dest, 0, left);\n\t} else {\n\t  uint32_t shift = st == IRT_I8 ? 24 : 16;\n\t  emit_dta(as, MIPSI_SRA, dest, dest, shift);\n\t  emit_dta(as, MIPSI_SLL, dest, left, shift);\n\t}\n      } else {\n\temit_tsi(as, MIPSI_ANDI, dest, left,\n\t\t (int32_t)(st == IRT_U8 ? 0xff : 0xffff));\n      }\n    } else {  /* 32/64 bit integer conversions. */\n      /* Only need to handle 32/32 bit no-op (cast) on 32 bit archs. */\n      ra_leftov(as, dest, lref);  /* Do nothing, but may need to move regs. */\n    }\n  }\n}\n\n#if LJ_HASFFI\nstatic void asm_conv64(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK);\n  IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH);\n  IRCallID id;\n  const CCallInfo *ci;\n  IRRef args[2];\n  args[LJ_BE?0:1] = ir->op1;\n  args[LJ_BE?1:0] = (ir-1)->op1;\n  if (st == IRT_NUM || st == IRT_FLOAT) {\n    id = IRCALL_fp64_d2l + ((st == IRT_FLOAT) ? 2 : 0) + (dt - IRT_I64);\n    ir--;\n  } else {\n    id = IRCALL_fp64_l2d + ((dt == IRT_FLOAT) ? 2 : 0) + (st - IRT_I64);\n  }\n  ci = &lj_ir_callinfo[id];\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n#endif\n\nstatic void asm_strto(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num];\n  IRRef args[2];\n  RegSet drop = RSET_SCRATCH;\n  if (ra_hasreg(ir->r)) rset_set(drop, ir->r);  /* Spill dest reg (if any). */\n  ra_evictset(as, drop);\n  asm_guard(as, MIPSI_BEQ, RID_RET, RID_ZERO);  /* Test return status. */\n  args[0] = ir->op1;      /* GCstr *str */\n  args[1] = ASMREF_TMP1;  /* TValue *n  */\n  asm_gencall(as, ci, args);\n  /* Store the result to the spill slot or temp slots. */\n  emit_tsi(as, MIPSI_ADDIU, ra_releasetmp(as, ASMREF_TMP1),\n\t   RID_SP, sps_scale(ir->s));\n}\n\n/* Get pointer to TValue. */\nstatic void asm_tvptr(ASMState *as, Reg dest, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (irt_isnum(ir->t)) {\n    if (irref_isk(ref))  /* Use the number constant itself as a TValue. */\n      ra_allockreg(as, i32ptr(ir_knum(ir)), dest);\n    else  /* Otherwise force a spill and use the spill slot. */\n      emit_tsi(as, MIPSI_ADDIU, dest, RID_SP, ra_spill(as, ir));\n  } else {\n    /* Otherwise use g->tmptv to hold the TValue. */\n    RegSet allow = rset_exclude(RSET_GPR, dest);\n    Reg type;\n    emit_tsi(as, MIPSI_ADDIU, dest, RID_JGL, offsetof(global_State, tmptv)-32768);\n    if (!irt_ispri(ir->t)) {\n      Reg src = ra_alloc1(as, ref, allow);\n      emit_setgl(as, src, tmptv.gcr);\n    }\n    type = ra_allock(as, irt_toitype(ir->t), allow);\n    emit_setgl(as, type, tmptv.it);\n  }\n}\n\nstatic void asm_tostr(ASMState *as, IRIns *ir)\n{\n  IRRef args[2];\n  args[0] = ASMREF_L;\n  as->gcsteps++;\n  if (irt_isnum(IR(ir->op1)->t) || (ir+1)->o == IR_HIOP) {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum];\n    args[1] = ASMREF_TMP1;  /* const lua_Number * */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n    asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op1);\n  } else {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint];\n    args[1] = ir->op1;  /* int32_t k */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n  }\n}\n\n/* -- Memory references --------------------------------------------------- */\n\nstatic void asm_aref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg idx, base;\n  if (irref_isk(ir->op2)) {\n    IRRef tab = IR(ir->op1)->op1;\n    int32_t ofs = asm_fuseabase(as, tab);\n    IRRef refa = ofs ? tab : ir->op1;\n    ofs += 8*IR(ir->op2)->i;\n    if (checki16(ofs)) {\n      base = ra_alloc1(as, refa, RSET_GPR);\n      emit_tsi(as, MIPSI_ADDIU, dest, base, ofs);\n      return;\n    }\n  }\n  base = ra_alloc1(as, ir->op1, RSET_GPR);\n  idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base));\n  emit_dst(as, MIPSI_ADDU, dest, RID_TMP, base);\n  emit_dta(as, MIPSI_SLL, RID_TMP, idx, 3);\n}\n\n/* Inlined hash lookup. Specialized for key type and for const keys.\n** The equivalent C code is:\n**   Node *n = hashkey(t, key);\n**   do {\n**     if (lj_obj_equal(&n->key, key)) return &n->val;\n**   } while ((n = nextnode(n)));\n**   return niltv(L);\n*/\nstatic void asm_href(ASMState *as, IRIns *ir)\n{\n  RegSet allow = RSET_GPR;\n  int destused = ra_used(ir);\n  Reg dest = ra_dest(as, ir, allow);\n  Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest));\n  Reg key = RID_NONE, type = RID_NONE, tmpnum = RID_NONE, tmp1 = RID_TMP, tmp2;\n  IRRef refkey = ir->op2;\n  IRIns *irkey = IR(refkey);\n  IRType1 kt = irkey->t;\n  uint32_t khash;\n  MCLabel l_end, l_loop, l_next;\n\n  rset_clear(allow, tab);\n  if (irt_isnum(kt)) {\n    key = ra_alloc1(as, refkey, RSET_FPR);\n    tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key));\n  } else if (!irt_ispri(kt)) {\n    key = ra_alloc1(as, refkey, allow);\n    rset_clear(allow, key);\n    type = ra_allock(as, irt_toitype(irkey->t), allow);\n    rset_clear(allow, type);\n  }\n  tmp2 = ra_scratch(as, allow);\n  rset_clear(allow, tmp2);\n\n  /* Key not found in chain: load niltv. */\n  l_end = emit_label(as);\n  if (destused)\n    emit_loada(as, dest, niltvg(J2G(as->J)));\n  else\n    *--as->mcp = MIPSI_NOP;\n  /* Follow hash chain until the end. */\n  emit_move(as, dest, tmp1);\n  l_loop = --as->mcp;\n  emit_tsi(as, MIPSI_LW, tmp1, dest, (int32_t)offsetof(Node, next));\n  l_next = emit_label(as);\n\n  /* Type and value comparison. */\n  if (irt_isnum(kt)) {\n    emit_branch(as, MIPSI_BC1T, 0, 0, l_end);\n    emit_fgh(as, MIPSI_C_EQ_D, 0, tmpnum, key);\n\temit_tg(as, MIPSI_MFC1, tmp1, key+1);\n    emit_branch(as, MIPSI_BEQ, tmp1, RID_ZERO, l_next);\n    emit_tsi(as, MIPSI_SLTIU, tmp1, tmp1, (int32_t)LJ_TISNUM);\n    emit_hsi(as, MIPSI_LDC1, tmpnum, dest, (int32_t)offsetof(Node, key.n));\n  } else {\n    if (irt_ispri(kt)) {\n      emit_branch(as, MIPSI_BEQ, tmp1, type, l_end);\n    } else {\n      emit_branch(as, MIPSI_BEQ, tmp2, key, l_end);\n      emit_tsi(as, MIPSI_LW, tmp2, dest, (int32_t)offsetof(Node, key.gcr));\n      emit_branch(as, MIPSI_BNE, tmp1, type, l_next);\n    }\n  }\n  emit_tsi(as, MIPSI_LW, tmp1, dest, (int32_t)offsetof(Node, key.it));\n  *l_loop = MIPSI_BNE | MIPSF_S(tmp1) | ((as->mcp-l_loop-1) & 0xffffu);\n\n  /* Load main position relative to tab->node into dest. */\n  khash = irref_isk(refkey) ? ir_khash(irkey) : 1;\n  if (khash == 0) {\n    emit_tsi(as, MIPSI_LW, dest, tab, (int32_t)offsetof(GCtab, node));\n  } else {\n    Reg tmphash = tmp1;\n    if (irref_isk(refkey))\n      tmphash = ra_allock(as, khash, allow);\n    emit_dst(as, MIPSI_ADDU, dest, dest, tmp1);\n    lua_assert(sizeof(Node) == 24);\n    emit_dst(as, MIPSI_SUBU, tmp1, tmp2, tmp1);\n    emit_dta(as, MIPSI_SLL, tmp1, tmp1, 3);\n    emit_dta(as, MIPSI_SLL, tmp2, tmp1, 5);\n    emit_dst(as, MIPSI_AND, tmp1, tmp2, tmphash);\n    emit_tsi(as, MIPSI_LW, dest, tab, (int32_t)offsetof(GCtab, node));\n    emit_tsi(as, MIPSI_LW, tmp2, tab, (int32_t)offsetof(GCtab, hmask));\n    if (irref_isk(refkey)) {\n      /* Nothing to do. */\n    } else if (irt_isstr(kt)) {\n      emit_tsi(as, MIPSI_LW, tmp1, key, (int32_t)offsetof(GCstr, hash));\n    } else {  /* Must match with hash*() in lj_tab.c. */\n      emit_dst(as, MIPSI_SUBU, tmp1, tmp1, tmp2);\n      emit_rotr(as, tmp2, tmp2, dest, (-HASH_ROT3)&31);\n      emit_dst(as, MIPSI_XOR, tmp1, tmp1, tmp2);\n      emit_rotr(as, tmp1, tmp1, dest, (-HASH_ROT2-HASH_ROT1)&31);\n      emit_dst(as, MIPSI_SUBU, tmp2, tmp2, dest);\n      if (irt_isnum(kt)) {\n\temit_dst(as, MIPSI_XOR, tmp2, tmp2, tmp1);\n\tif ((as->flags & JIT_F_MIPS32R2)) {\n\t  emit_dta(as, MIPSI_ROTR, dest, tmp1, (-HASH_ROT1)&31);\n\t} else {\n\t  emit_dst(as, MIPSI_OR, dest, dest, tmp1);\n\t  emit_dta(as, MIPSI_SLL, tmp1, tmp1, HASH_ROT1);\n\t  emit_dta(as, MIPSI_SRL, dest, tmp1, (-HASH_ROT1)&31);\n\t}\n\temit_dst(as, MIPSI_ADDU, tmp1, tmp1, tmp1);\n\temit_tg(as, MIPSI_MFC1, tmp2, key);\n\temit_tg(as, MIPSI_MFC1, tmp1, key+1);\n      } else {\n\temit_dst(as, MIPSI_XOR, tmp2, key, tmp1);\n\temit_rotr(as, dest, tmp1, tmp2, (-HASH_ROT1)&31);\n\temit_dst(as, MIPSI_ADDU, tmp1, key, ra_allock(as, HASH_BIAS, allow));\n      }\n    }\n  }\n}\n\nstatic void asm_hrefk(ASMState *as, IRIns *ir)\n{\n  IRIns *kslot = IR(ir->op2);\n  IRIns *irkey = IR(kslot->op1);\n  int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node));\n  int32_t kofs = ofs + (int32_t)offsetof(Node, key);\n  Reg dest = (ra_used(ir)||ofs > 32736) ? ra_dest(as, ir, RSET_GPR) : RID_NONE;\n  Reg node = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg key = RID_NONE, type = RID_TMP, idx = node;\n  RegSet allow = rset_exclude(RSET_GPR, node);\n  int32_t lo, hi;\n  lua_assert(ofs % sizeof(Node) == 0);\n  if (ofs > 32736) {\n    idx = dest;\n    rset_clear(allow, dest);\n    kofs = (int32_t)offsetof(Node, key);\n  } else if (ra_hasreg(dest)) {\n    emit_tsi(as, MIPSI_ADDIU, dest, node, ofs);\n  }\n  if (!irt_ispri(irkey->t)) {\n    key = ra_scratch(as, allow);\n    rset_clear(allow, key);\n  }\n  if (irt_isnum(irkey->t)) {\n    lo = (int32_t)ir_knum(irkey)->u32.lo;\n    hi = (int32_t)ir_knum(irkey)->u32.hi;\n  } else {\n    lo = irkey->i;\n    hi = irt_toitype(irkey->t);\n    if (!ra_hasreg(key))\n      goto nolo;\n  }\n  asm_guard(as, MIPSI_BNE, key, lo ? ra_allock(as, lo, allow) : RID_ZERO);\nnolo:\n  asm_guard(as, MIPSI_BNE, type, hi ? ra_allock(as, hi, allow) : RID_ZERO);\n  if (ra_hasreg(key)) emit_tsi(as, MIPSI_LW, key, idx, kofs+(LJ_BE?4:0));\n  emit_tsi(as, MIPSI_LW, type, idx, kofs+(LJ_BE?0:4));\n  if (ofs > 32736)\n    emit_tsi(as, MIPSI_ADDU, dest, node, ra_allock(as, ofs, allow));\n}\n\nstatic void asm_newref(ASMState *as, IRIns *ir)\n{\n  if (ir->r != RID_SINK) {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];\n    IRRef args[3];\n    args[0] = ASMREF_L;     /* lua_State *L */\n    args[1] = ir->op1;      /* GCtab *t     */\n    args[2] = ASMREF_TMP1;  /* cTValue *key */\n    asm_setupresult(as, ir, ci);  /* TValue * */\n    asm_gencall(as, ci, args);\n    asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2);\n  }\n}\n\nstatic void asm_uref(ASMState *as, IRIns *ir)\n{\n  /* NYI: Check that UREFO is still open and not aliasing a slot. */\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  if (irref_isk(ir->op1)) {\n    GCfunc *fn = ir_kfunc(IR(ir->op1));\n    MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v;\n    emit_lsptr(as, MIPSI_LW, dest, v, RSET_GPR);\n  } else {\n    Reg uv = ra_scratch(as, RSET_GPR);\n    Reg func = ra_alloc1(as, ir->op1, RSET_GPR);\n    if (ir->o == IR_UREFC) {\n      asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO);\n      emit_tsi(as, MIPSI_ADDIU, dest, uv, (int32_t)offsetof(GCupval, tv));\n      emit_tsi(as, MIPSI_LBU, RID_TMP, uv, (int32_t)offsetof(GCupval, closed));\n    } else {\n      emit_tsi(as, MIPSI_LW, dest, uv, (int32_t)offsetof(GCupval, v));\n    }\n    emit_tsi(as, MIPSI_LW, uv, func,\n\t     (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8));\n  }\n}\n\nstatic void asm_fref(ASMState *as, IRIns *ir)\n{\n  UNUSED(as); UNUSED(ir);\n  lua_assert(!ra_used(ir));\n}\n\nstatic void asm_strref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  IRRef ref = ir->op2, refk = ir->op1;\n  int32_t ofs = (int32_t)sizeof(GCstr);\n  Reg r;\n  if (irref_isk(ref)) {\n    IRRef tmp = refk; refk = ref; ref = tmp;\n  } else if (!irref_isk(refk)) {\n    Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR);\n    IRIns *irr = IR(ir->op2);\n    if (ra_hasreg(irr->r)) {\n      ra_noweak(as, irr->r);\n      right = irr->r;\n    } else if (mayfuse(as, irr->op2) &&\n\t       irr->o == IR_ADD && irref_isk(irr->op2) &&\n\t       checki16(ofs + IR(irr->op2)->i)) {\n      ofs += IR(irr->op2)->i;\n      right = ra_alloc1(as, irr->op1, rset_exclude(RSET_GPR, left));\n    } else {\n      right = ra_allocref(as, ir->op2, rset_exclude(RSET_GPR, left));\n    }\n    emit_tsi(as, MIPSI_ADDIU, dest, dest, ofs);\n    emit_dst(as, MIPSI_ADDU, dest, left, right);\n    return;\n  }\n  r = ra_alloc1(as, ref, RSET_GPR);\n  ofs += IR(refk)->i;\n  if (checki16(ofs))\n    emit_tsi(as, MIPSI_ADDIU, dest, r, ofs);\n  else\n    emit_dst(as, MIPSI_ADDU, dest, r,\n\t     ra_allock(as, ofs, rset_exclude(RSET_GPR, r)));\n}\n\n/* -- Loads and stores ---------------------------------------------------- */\n\nstatic MIPSIns asm_fxloadins(IRIns *ir)\n{\n  switch (irt_type(ir->t)) {\n  case IRT_I8: return MIPSI_LB;\n  case IRT_U8: return MIPSI_LBU;\n  case IRT_I16: return MIPSI_LH;\n  case IRT_U16: return MIPSI_LHU;\n  case IRT_NUM: return MIPSI_LDC1;\n  case IRT_FLOAT: return MIPSI_LWC1;\n  default: return MIPSI_LW;\n  }\n}\n\nstatic MIPSIns asm_fxstoreins(IRIns *ir)\n{\n  switch (irt_type(ir->t)) {\n  case IRT_I8: case IRT_U8: return MIPSI_SB;\n  case IRT_I16: case IRT_U16: return MIPSI_SH;\n  case IRT_NUM: return MIPSI_SDC1;\n  case IRT_FLOAT: return MIPSI_SWC1;\n  default: return MIPSI_SW;\n  }\n}\n\nstatic void asm_fload(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg idx = ra_alloc1(as, ir->op1, RSET_GPR);\n  MIPSIns mi = asm_fxloadins(ir);\n  int32_t ofs;\n  if (ir->op2 == IRFL_TAB_ARRAY) {\n    ofs = asm_fuseabase(as, ir->op1);\n    if (ofs) {  /* Turn the t->array load into an add for colocated arrays. */\n      emit_tsi(as, MIPSI_ADDIU, dest, idx, ofs);\n      return;\n    }\n  }\n  ofs = field_ofs[ir->op2];\n  lua_assert(!irt_isfp(ir->t));\n  emit_tsi(as, mi, dest, idx, ofs);\n}\n\nstatic void asm_fstore(ASMState *as, IRIns *ir)\n{\n  if (ir->r != RID_SINK) {\n    Reg src = ra_alloc1z(as, ir->op2, RSET_GPR);\n    IRIns *irf = IR(ir->op1);\n    Reg idx = ra_alloc1(as, irf->op1, rset_exclude(RSET_GPR, src));\n    int32_t ofs = field_ofs[irf->op2];\n    MIPSIns mi = asm_fxstoreins(ir);\n    lua_assert(!irt_isfp(ir->t));\n    emit_tsi(as, mi, src, idx, ofs);\n  }\n}\n\nstatic void asm_xload(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);\n  lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED));\n  asm_fusexref(as, asm_fxloadins(ir), dest, ir->op1, RSET_GPR, 0);\n}\n\nstatic void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs)\n{\n  if (ir->r != RID_SINK) {\n    Reg src = ra_alloc1z(as, ir->op2, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);\n    asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1,\n\t\t rset_exclude(RSET_GPR, src), ofs);\n  }\n}\n\nstatic void asm_ahuvload(ASMState *as, IRIns *ir)\n{\n  IRType1 t = ir->t;\n  Reg dest = RID_NONE, type = RID_TMP, idx;\n  RegSet allow = RSET_GPR;\n  int32_t ofs = 0;\n  if (ra_used(ir)) {\n    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));\n    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);\n    rset_clear(allow, dest);\n  }\n  idx = asm_fuseahuref(as, ir->op1, &ofs, allow);\n  rset_clear(allow, idx);\n  if (irt_isnum(t)) {\n    asm_guard(as, MIPSI_BEQ, type, RID_ZERO);\n    emit_tsi(as, MIPSI_SLTIU, type, type, (int32_t)LJ_TISNUM);\n    if (ra_hasreg(dest))\n      emit_hsi(as, MIPSI_LDC1, dest, idx, ofs);\n  } else {\n    asm_guard(as, MIPSI_BNE, type, ra_allock(as, irt_toitype(t), allow));\n    if (ra_hasreg(dest)) emit_tsi(as, MIPSI_LW, dest, idx, ofs+(LJ_BE?4:0));\n  }\n  emit_tsi(as, MIPSI_LW, type, idx, ofs+(LJ_BE?0:4));\n}\n\nstatic void asm_ahustore(ASMState *as, IRIns *ir)\n{\n  RegSet allow = RSET_GPR;\n  Reg idx, src = RID_NONE, type = RID_NONE;\n  int32_t ofs = 0;\n  if (ir->r == RID_SINK)\n    return;\n  if (irt_isnum(ir->t)) {\n    src = ra_alloc1(as, ir->op2, RSET_FPR);\n  } else {\n    if (!irt_ispri(ir->t)) {\n      src = ra_alloc1(as, ir->op2, allow);\n      rset_clear(allow, src);\n    }\n    type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);\n    rset_clear(allow, type);\n  }\n  idx = asm_fuseahuref(as, ir->op1, &ofs, allow);\n  if (irt_isnum(ir->t)) {\n    emit_hsi(as, MIPSI_SDC1, src, idx, ofs);\n  } else {\n    if (ra_hasreg(src))\n      emit_tsi(as, MIPSI_SW, src, idx, ofs+(LJ_BE?4:0));\n    emit_tsi(as, MIPSI_SW, type, idx, ofs+(LJ_BE?0:4));\n  }\n}\n\nstatic void asm_sload(ASMState *as, IRIns *ir)\n{\n  int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 4 : 0);\n  IRType1 t = ir->t;\n  Reg dest = RID_NONE, type = RID_NONE, base;\n  RegSet allow = RSET_GPR;\n  lua_assert(!(ir->op2 & IRSLOAD_PARENT));  /* Handled by asm_head_side(). */\n  lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK));\n  lua_assert(!irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME)));\n  if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) {\n    dest = ra_scratch(as, RSET_FPR);\n    asm_tointg(as, ir, dest);\n    t.irt = IRT_NUM;  /* Continue with a regular number type check. */\n  } else if (ra_used(ir)) {\n    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));\n    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);\n    rset_clear(allow, dest);\n    base = ra_alloc1(as, REF_BASE, allow);\n    rset_clear(allow, base);\n    if ((ir->op2 & IRSLOAD_CONVERT)) {\n      if (irt_isint(t)) {\n\tReg tmp = ra_scratch(as, RSET_FPR);\n\temit_tg(as, MIPSI_MFC1, dest, tmp);\n\temit_fg(as, MIPSI_CVT_W_D, tmp, tmp);\n\tdest = tmp;\n\tt.irt = IRT_NUM;  /* Check for original type. */\n      } else {\n\tReg tmp = ra_scratch(as, RSET_GPR);\n\temit_fg(as, MIPSI_CVT_D_W, dest, dest);\n\temit_tg(as, MIPSI_MTC1, tmp, dest);\n\tdest = tmp;\n\tt.irt = IRT_INT;  /* Check for original type. */\n      }\n    }\n    goto dotypecheck;\n  }\n  base = ra_alloc1(as, REF_BASE, allow);\n  rset_clear(allow, base);\ndotypecheck:\n  if (irt_isnum(t)) {\n    if ((ir->op2 & IRSLOAD_TYPECHECK)) {\n      asm_guard(as, MIPSI_BEQ, RID_TMP, RID_ZERO);\n      emit_tsi(as, MIPSI_SLTIU, RID_TMP, RID_TMP, (int32_t)LJ_TISNUM);\n      type = RID_TMP;\n    }\n    if (ra_hasreg(dest)) emit_hsi(as, MIPSI_LDC1, dest, base, ofs);\n  } else {\n    if ((ir->op2 & IRSLOAD_TYPECHECK)) {\n      Reg ktype = ra_allock(as, irt_toitype(t), allow);\n      asm_guard(as, MIPSI_BNE, RID_TMP, ktype);\n      type = RID_TMP;\n    }\n    if (ra_hasreg(dest)) emit_tsi(as, MIPSI_LW, dest, base, ofs ^ (LJ_BE?4:0));\n  }\n  if (ra_hasreg(type)) emit_tsi(as, MIPSI_LW, type, base, ofs ^ (LJ_BE?0:4));\n}\n\n/* -- Allocations --------------------------------------------------------- */\n\n#if LJ_HASFFI\nstatic void asm_cnew(ASMState *as, IRIns *ir)\n{\n  CTState *cts = ctype_ctsG(J2G(as->J));\n  CTypeID ctypeid = (CTypeID)IR(ir->op1)->i;\n  CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ?\n\t      lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i;\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco];\n  IRRef args[2];\n  RegSet allow = (RSET_GPR & ~RSET_SCRATCH);\n  RegSet drop = RSET_SCRATCH;\n  lua_assert(sz != CTSIZE_INVALID);\n\n  args[0] = ASMREF_L;     /* lua_State *L */\n  args[1] = ASMREF_TMP1;  /* MSize size   */\n  as->gcsteps++;\n\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);\n  if (ra_used(ir))\n    ra_destreg(as, ir, RID_RET);  /* GCcdata * */\n\n  /* Initialize immutable cdata object. */\n  if (ir->o == IR_CNEWI) {\n    int32_t ofs = sizeof(GCcdata);\n    lua_assert(sz == 4 || sz == 8);\n    if (sz == 8) {\n      ofs += 4;\n      lua_assert((ir+1)->o == IR_HIOP);\n      if (LJ_LE) ir++;\n    }\n    for (;;) {\n      Reg r = ra_alloc1z(as, ir->op2, allow);\n      emit_tsi(as, MIPSI_SW, r, RID_RET, ofs);\n      rset_clear(allow, r);\n      if (ofs == sizeof(GCcdata)) break;\n      ofs -= 4; if (LJ_BE) ir++; else ir--;\n    }\n  }\n  /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */\n  emit_tsi(as, MIPSI_SB, RID_RET+1, RID_RET, offsetof(GCcdata, gct));\n  emit_tsi(as, MIPSI_SH, RID_TMP, RID_RET, offsetof(GCcdata, ctypeid));\n  emit_ti(as, MIPSI_LI, RID_RET+1, ~LJ_TCDATA);\n  emit_ti(as, MIPSI_LI, RID_TMP, ctypeid); /* Lower 16 bit used. Sign-ext ok. */\n  asm_gencall(as, ci, args);\n  ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)),\n\t       ra_releasetmp(as, ASMREF_TMP1));\n}\n#else\n#define asm_cnew(as, ir)\t((void)0)\n#endif\n\n/* -- Write barriers ------------------------------------------------------ */\n\nstatic void asm_tbar(ASMState *as, IRIns *ir)\n{\n  Reg tab = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg mark = ra_scratch(as, rset_exclude(RSET_GPR, tab));\n  Reg link = RID_TMP;\n  MCLabel l_end = emit_label(as);\n  emit_tsi(as, MIPSI_SW, link, tab, (int32_t)offsetof(GCtab, gclist));\n  emit_tsi(as, MIPSI_SB, mark, tab, (int32_t)offsetof(GCtab, marked));\n  emit_setgl(as, tab, gc.grayagain);\n  emit_getgl(as, link, gc.grayagain);\n  emit_dst(as, MIPSI_XOR, mark, mark, RID_TMP);  /* Clear black bit. */\n  emit_branch(as, MIPSI_BEQ, RID_TMP, RID_ZERO, l_end);\n  emit_tsi(as, MIPSI_ANDI, RID_TMP, mark, LJ_GC_BLACK);\n  emit_tsi(as, MIPSI_LBU, mark, tab, (int32_t)offsetof(GCtab, marked));\n}\n\nstatic void asm_obar(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg obj, val, tmp;\n  /* No need for other object barriers (yet). */\n  lua_assert(IR(ir->op1)->o == IR_UREFC);\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ir->op1;      /* TValue *tv      */\n  asm_gencall(as, ci, args);\n  emit_tsi(as, MIPSI_ADDIU, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768);\n  obj = IR(ir->op1)->r;\n  tmp = ra_scratch(as, rset_exclude(RSET_GPR, obj));\n  emit_branch(as, MIPSI_BEQ, RID_TMP, RID_ZERO, l_end);\n  emit_tsi(as, MIPSI_ANDI, tmp, tmp, LJ_GC_BLACK);\n  emit_branch(as, MIPSI_BEQ, RID_TMP, RID_ZERO, l_end);\n  emit_tsi(as, MIPSI_ANDI, RID_TMP, RID_TMP, LJ_GC_WHITES);\n  val = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, obj));\n  emit_tsi(as, MIPSI_LBU, tmp, obj,\n\t   (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv));\n  emit_tsi(as, MIPSI_LBU, RID_TMP, val, (int32_t)offsetof(GChead, marked));\n}\n\n/* -- Arithmetic and logic operations ------------------------------------- */\n\nstatic void asm_fparith(ASMState *as, IRIns *ir, MIPSIns mi)\n{\n  Reg dest = ra_dest(as, ir, RSET_FPR);\n  Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n  right = (left >> 8); left &= 255;\n  emit_fgh(as, mi, dest, left, right);\n}\n\nstatic void asm_fpunary(ASMState *as, IRIns *ir, MIPSIns mi)\n{\n  Reg dest = ra_dest(as, ir, RSET_FPR);\n  Reg left = ra_hintalloc(as, ir->op1, dest, RSET_FPR);\n  emit_fg(as, mi, dest, left);\n}\n\nstatic int asm_fpjoin_pow(ASMState *as, IRIns *ir)\n{\n  IRIns *irp = IR(ir->op1);\n  if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) {\n    IRIns *irpp = IR(irp->op1);\n    if (irpp == ir-2 && irpp->o == IR_FPMATH &&\n\tirpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) {\n      const CCallInfo *ci = &lj_ir_callinfo[IRCALL_pow];\n      IRRef args[2];\n      args[0] = irpp->op1;\n      args[1] = irp->op2;\n      asm_setupresult(as, ir, ci);\n      asm_gencall(as, ci, args);\n      return 1;\n    }\n  }\n  return 0;\n}\n\nstatic void asm_add(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    asm_fparith(as, ir, MIPSI_ADD_D);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n    if (irref_isk(ir->op2)) {\n      int32_t k = IR(ir->op2)->i;\n      if (checki16(k)) {\n\temit_tsi(as, MIPSI_ADDIU, dest, left, k);\n\treturn;\n      }\n    }\n    right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n    emit_dst(as, MIPSI_ADDU, dest, left, right);\n  }\n}\n\nstatic void asm_sub(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    asm_fparith(as, ir, MIPSI_SUB_D);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg right, left = ra_alloc2(as, ir, RSET_GPR);\n    right = (left >> 8); left &= 255;\n    emit_dst(as, MIPSI_SUBU, dest, left, right);\n  }\n}\n\nstatic void asm_mul(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    asm_fparith(as, ir, MIPSI_MUL_D);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg right, left = ra_alloc2(as, ir, RSET_GPR);\n    right = (left >> 8); left &= 255;\n    emit_dst(as, MIPSI_MUL, dest, left, right);\n  }\n}\n\nstatic void asm_neg(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    asm_fpunary(as, ir, MIPSI_NEG_D);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n    emit_dst(as, MIPSI_SUBU, dest, RID_ZERO, left);\n  }\n}\n\nstatic void asm_arithov(ASMState *as, IRIns *ir)\n{\n  Reg right, left, tmp, dest = ra_dest(as, ir, RSET_GPR);\n  if (irref_isk(ir->op2)) {\n    int k = IR(ir->op2)->i;\n    if (ir->o == IR_SUBOV) k = -k;\n    if (checki16(k)) {  /* (dest < left) == (k >= 0 ? 1 : 0) */\n      left = ra_alloc1(as, ir->op1, RSET_GPR);\n      asm_guard(as, k >= 0 ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO);\n      emit_dst(as, MIPSI_SLT, RID_TMP, dest, dest == left ? RID_TMP : left);\n      emit_tsi(as, MIPSI_ADDIU, dest, left, k);\n      if (dest == left) emit_move(as, RID_TMP, left);\n      return;\n    }\n  }\n  left = ra_alloc2(as, ir, RSET_GPR);\n  right = (left >> 8); left &= 255;\n  tmp = ra_scratch(as, rset_exclude(rset_exclude(rset_exclude(RSET_GPR, left),\n\t\t\t\t\t\t right), dest));\n  asm_guard(as, MIPSI_BLTZ, RID_TMP, 0);\n  emit_dst(as, MIPSI_AND, RID_TMP, RID_TMP, tmp);\n  if (ir->o == IR_ADDOV) {  /* ((dest^left) & (dest^right)) < 0 */\n    emit_dst(as, MIPSI_XOR, RID_TMP, dest, dest == right ? RID_TMP : right);\n  } else {  /* ((dest^left) & (dest^~right)) < 0 */\n    emit_dst(as, MIPSI_XOR, RID_TMP, RID_TMP, dest);\n    emit_dst(as, MIPSI_NOR, RID_TMP, dest == right ? RID_TMP : right, RID_ZERO);\n  }\n  emit_dst(as, MIPSI_XOR, tmp, dest, dest == left ? RID_TMP : left);\n  emit_dst(as, ir->o == IR_ADDOV ? MIPSI_ADDU : MIPSI_SUBU, dest, left, right);\n  if (dest == left || dest == right)\n    emit_move(as, RID_TMP, dest == left ? left : right);\n}\n\nstatic void asm_mulov(ASMState *as, IRIns *ir)\n{\n#if LJ_DUALNUM\n#error \"NYI: MULOV\"\n#else\n  UNUSED(as); UNUSED(ir); lua_assert(0);  /* Unused in single-number mode. */\n#endif\n}\n\n#if LJ_HASFFI\nstatic void asm_add64(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR);\n  if (irref_isk(ir->op2)) {\n    int32_t k = IR(ir->op2)->i;\n    if (k == 0) {\n      emit_dst(as, MIPSI_ADDU, dest, left, RID_TMP);\n      goto loarith;\n    } else if (checki16(k)) {\n      emit_dst(as, MIPSI_ADDU, dest, dest, RID_TMP);\n      emit_tsi(as, MIPSI_ADDIU, dest, left, k);\n      goto loarith;\n    }\n  }\n  emit_dst(as, MIPSI_ADDU, dest, dest, RID_TMP);\n  right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  emit_dst(as, MIPSI_ADDU, dest, left, right);\nloarith:\n  ir--;\n  dest = ra_dest(as, ir, RSET_GPR);\n  left = ra_alloc1(as, ir->op1, RSET_GPR);\n  if (irref_isk(ir->op2)) {\n    int32_t k = IR(ir->op2)->i;\n    if (k == 0) {\n      if (dest != left)\n\temit_move(as, dest, left);\n      return;\n    } else if (checki16(k)) {\n      if (dest == left) {\n\tReg tmp = ra_scratch(as, rset_exclude(RSET_GPR, left));\n\temit_move(as, dest, tmp);\n\tdest = tmp;\n      }\n      emit_dst(as, MIPSI_SLTU, RID_TMP, dest, left);\n      emit_tsi(as, MIPSI_ADDIU, dest, left, k);\n      return;\n    }\n  }\n  right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  if (dest == left && dest == right) {\n    Reg tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), right));\n    emit_move(as, dest, tmp);\n    dest = tmp;\n  }\n  emit_dst(as, MIPSI_SLTU, RID_TMP, dest, dest == left ? right : left);\n  emit_dst(as, MIPSI_ADDU, dest, left, right);\n}\n\nstatic void asm_sub64(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg right, left = ra_alloc2(as, ir, RSET_GPR);\n  right = (left >> 8); left &= 255;\n  emit_dst(as, MIPSI_SUBU, dest, dest, RID_TMP);\n  emit_dst(as, MIPSI_SUBU, dest, left, right);\n  ir--;\n  dest = ra_dest(as, ir, RSET_GPR);\n  left = ra_alloc2(as, ir, RSET_GPR);\n  right = (left >> 8); left &= 255;\n  if (dest == left) {\n    Reg tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), right));\n    emit_move(as, dest, tmp);\n    dest = tmp;\n  }\n  emit_dst(as, MIPSI_SLTU, RID_TMP, left, dest);\n  emit_dst(as, MIPSI_SUBU, dest, left, right);\n}\n\nstatic void asm_neg64(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n  emit_dst(as, MIPSI_SUBU, dest, dest, RID_TMP);\n  emit_dst(as, MIPSI_SUBU, dest, RID_ZERO, left);\n  ir--;\n  dest = ra_dest(as, ir, RSET_GPR);\n  left = ra_alloc1(as, ir->op1, RSET_GPR);\n  emit_dst(as, MIPSI_SLTU, RID_TMP, RID_ZERO, dest);\n  emit_dst(as, MIPSI_SUBU, dest, RID_ZERO, left);\n}\n#endif\n\nstatic void asm_bitnot(ASMState *as, IRIns *ir)\n{\n  Reg left, right, dest = ra_dest(as, ir, RSET_GPR);\n  IRIns *irl = IR(ir->op1);\n  if (mayfuse(as, ir->op1) && irl->o == IR_BOR) {\n    left = ra_alloc2(as, irl, RSET_GPR);\n    right = (left >> 8); left &= 255;\n  } else {\n    left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n    right = RID_ZERO;\n  }\n  emit_dst(as, MIPSI_NOR, dest, left, right);\n}\n\nstatic void asm_bitswap(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n  if ((as->flags & JIT_F_MIPS32R2)) {\n    emit_dta(as, MIPSI_ROTR, dest, RID_TMP, 16);\n    emit_dst(as, MIPSI_WSBH, RID_TMP, 0, left);\n  } else {\n    Reg tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), dest));\n    emit_dst(as, MIPSI_OR, dest, dest, tmp);\n    emit_dst(as, MIPSI_OR, dest, dest, RID_TMP);\n    emit_tsi(as, MIPSI_ANDI, dest, dest, 0xff00);\n    emit_dta(as, MIPSI_SLL, RID_TMP, RID_TMP, 8);\n    emit_dta(as, MIPSI_SRL, dest, left, 8);\n    emit_tsi(as, MIPSI_ANDI, RID_TMP, left, 0xff00);\n    emit_dst(as, MIPSI_OR, tmp, tmp, RID_TMP);\n    emit_dta(as, MIPSI_SRL, tmp, left, 24);\n    emit_dta(as, MIPSI_SLL, RID_TMP, left, 24);\n  }\n}\n\nstatic void asm_bitop(ASMState *as, IRIns *ir, MIPSIns mi, MIPSIns mik)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n  if (irref_isk(ir->op2)) {\n    int32_t k = IR(ir->op2)->i;\n    if (checku16(k)) {\n      emit_tsi(as, mik, dest, left, k);\n      return;\n    }\n  }\n  right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  emit_dst(as, mi, dest, left, right);\n}\n\nstatic void asm_bitshift(ASMState *as, IRIns *ir, MIPSIns mi, MIPSIns mik)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  if (irref_isk(ir->op2)) {  /* Constant shifts. */\n    uint32_t shift = (uint32_t)(IR(ir->op2)->i & 31);\n    emit_dta(as, mik, dest, ra_hintalloc(as, ir->op1, dest, RSET_GPR), shift);\n  } else {\n    Reg right, left = ra_alloc2(as, ir, RSET_GPR);\n    right = (left >> 8); left &= 255;\n    emit_dst(as, mi, dest, right, left);  /* Shift amount is in rs. */\n  }\n}\n\nstatic void asm_bitror(ASMState *as, IRIns *ir)\n{\n  if ((as->flags & JIT_F_MIPS32R2)) {\n    asm_bitshift(as, ir, MIPSI_ROTRV, MIPSI_ROTR);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    if (irref_isk(ir->op2)) {  /* Constant shifts. */\n      uint32_t shift = (uint32_t)(IR(ir->op2)->i & 31);\n      Reg left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n      emit_rotr(as, dest, left, RID_TMP, shift);\n    } else {\n      Reg right, left = ra_alloc2(as, ir, RSET_GPR);\n      right = (left >> 8); left &= 255;\n      emit_dst(as, MIPSI_OR, dest, dest, RID_TMP);\n      emit_dst(as, MIPSI_SRLV, dest, right, left);\n      emit_dst(as, MIPSI_SLLV, RID_TMP, RID_TMP, left);\n      emit_dst(as, MIPSI_SUBU, RID_TMP, ra_allock(as, 32, RSET_GPR), right);\n    }\n  }\n}\n\nstatic void asm_min_max(ASMState *as, IRIns *ir, int ismax)\n{\n  if (irt_isnum(ir->t)) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n    right = (left >> 8); left &= 255;\n    if (dest == left) {\n      emit_fg(as, MIPSI_MOVT_D, dest, right);\n    } else {\n      emit_fg(as, MIPSI_MOVF_D, dest, left);\n      if (dest != right) emit_fg(as, MIPSI_MOV_D, dest, right);\n    }\n    emit_fgh(as, MIPSI_C_OLT_D, 0, ismax ? left : right, ismax ? right : left);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg right, left = ra_alloc2(as, ir, RSET_GPR);\n    right = (left >> 8); left &= 255;\n    if (dest == left) {\n      emit_dst(as, MIPSI_MOVN, dest, right, RID_TMP);\n    } else {\n      emit_dst(as, MIPSI_MOVZ, dest, left, RID_TMP);\n      if (dest != right) emit_move(as, dest, right);\n    }\n    emit_dst(as, MIPSI_SLT, RID_TMP,\n\t     ismax ? left : right, ismax ? right : left);\n  }\n}\n\n/* -- Comparisons --------------------------------------------------------- */\n\nstatic void asm_comp(ASMState *as, IRIns *ir)\n{\n  /* ORDER IR: LT GE LE GT  ULT UGE ULE UGT. */\n  IROp op = ir->o;\n  if (irt_isnum(ir->t)) {\n    Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n    right = (left >> 8); left &= 255;\n    asm_guard(as, (op&1) ? MIPSI_BC1T : MIPSI_BC1F, 0, 0);\n    emit_fgh(as, MIPSI_C_OLT_D + ((op&3) ^ ((op>>2)&1)), 0, left, right);\n  } else {\n    Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR);\n    if (op == IR_ABC) op = IR_UGT;\n    if ((op&4) == 0 && irref_isk(ir->op2) && IR(ir->op2)->i == 0) {\n      MIPSIns mi = (op&2) ? ((op&1) ? MIPSI_BLEZ : MIPSI_BGTZ) :\n\t\t\t    ((op&1) ? MIPSI_BLTZ : MIPSI_BGEZ);\n      asm_guard(as, mi, left, 0);\n    } else {\n      if (irref_isk(ir->op2)) {\n\tint32_t k = IR(ir->op2)->i;\n\tif ((op&2)) k++;\n\tif (checki16(k)) {\n\t  asm_guard(as, (op&1) ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO);\n\t  emit_tsi(as, (op&4) ? MIPSI_SLTIU : MIPSI_SLTI,\n\t\t   RID_TMP, left, k);\n\t  return;\n\t}\n      }\n      right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n      asm_guard(as, ((op^(op>>1))&1) ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO);\n      emit_dst(as, (op&4) ? MIPSI_SLTU : MIPSI_SLT,\n\t       RID_TMP, (op&2) ? right : left, (op&2) ? left : right);\n    }\n  }\n}\n\nstatic void asm_compeq(ASMState *as, IRIns *ir)\n{\n  Reg right, left = ra_alloc2(as, ir, irt_isnum(ir->t) ? RSET_FPR : RSET_GPR);\n  right = (left >> 8); left &= 255;\n  if (irt_isnum(ir->t)) {\n    asm_guard(as, (ir->o & 1) ? MIPSI_BC1T : MIPSI_BC1F, 0, 0);\n    emit_fgh(as, MIPSI_C_EQ_D, 0, left, right);\n  } else {\n    asm_guard(as, (ir->o & 1) ? MIPSI_BEQ : MIPSI_BNE, left, right);\n  }\n}\n\n#if LJ_HASFFI\n/* 64 bit integer comparisons. */\nstatic void asm_comp64(ASMState *as, IRIns *ir)\n{\n  /* ORDER IR: LT GE LE GT  ULT UGE ULE UGT. */\n  IROp op = (ir-1)->o;\n  MCLabel l_end;\n  Reg rightlo, leftlo, righthi, lefthi = ra_alloc2(as, ir, RSET_GPR);\n  righthi = (lefthi >> 8); lefthi &= 255;\n  leftlo = ra_alloc2(as, ir-1,\n\t\t     rset_exclude(rset_exclude(RSET_GPR, lefthi), righthi));\n  rightlo = (leftlo >> 8); leftlo &= 255;\n  asm_guard(as, ((op^(op>>1))&1) ? MIPSI_BNE : MIPSI_BEQ, RID_TMP, RID_ZERO);\n  l_end = emit_label(as);\n  if (lefthi != righthi)\n    emit_dst(as, (op&4) ? MIPSI_SLTU : MIPSI_SLT, RID_TMP,\n\t     (op&2) ? righthi : lefthi, (op&2) ? lefthi : righthi);\n  emit_dst(as, MIPSI_SLTU, RID_TMP,\n\t   (op&2) ? rightlo : leftlo, (op&2) ? leftlo : rightlo);\n  if (lefthi != righthi)\n    emit_branch(as, MIPSI_BEQ, lefthi, righthi, l_end);\n}\n\nstatic void asm_comp64eq(ASMState *as, IRIns *ir)\n{\n  Reg tmp, right, left = ra_alloc2(as, ir, RSET_GPR);\n  right = (left >> 8); left &= 255;\n  asm_guard(as, ((ir-1)->o & 1) ? MIPSI_BEQ : MIPSI_BNE, RID_TMP, RID_ZERO);\n  tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR, left), right));\n  emit_dst(as, MIPSI_OR, RID_TMP, RID_TMP, tmp);\n  emit_dst(as, MIPSI_XOR, tmp, left, right);\n  left = ra_alloc2(as, ir-1, RSET_GPR);\n  right = (left >> 8); left &= 255;\n  emit_dst(as, MIPSI_XOR, RID_TMP, left, right);\n}\n#endif\n\n/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */\n\n/* Hiword op of a split 64 bit op. Previous op must be the loword op. */\nstatic void asm_hiop(ASMState *as, IRIns *ir)\n{\n#if LJ_HASFFI\n  /* HIOP is marked as a store because it needs its own DCE logic. */\n  int uselo = ra_used(ir-1), usehi = ra_used(ir);  /* Loword/hiword used? */\n  if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1;\n  if ((ir-1)->o == IR_CONV) {  /* Conversions to/from 64 bit. */\n    as->curins--;  /* Always skip the CONV. */\n    if (usehi || uselo)\n      asm_conv64(as, ir);\n    return;\n  } else if ((ir-1)->o < IR_EQ) {  /* 64 bit integer comparisons. ORDER IR. */\n    as->curins--;  /* Always skip the loword comparison. */\n    asm_comp64(as, ir);\n    return;\n  } else if ((ir-1)->o <= IR_NE) {  /* 64 bit integer comparisons. ORDER IR. */\n    as->curins--;  /* Always skip the loword comparison. */\n    asm_comp64eq(as, ir);\n    return;\n  } else if ((ir-1)->o == IR_XSTORE) {\n    as->curins--;  /* Handle both stores here. */\n    if ((ir-1)->r != RID_SINK) {\n      asm_xstore(as, ir, LJ_LE ? 4 : 0);\n      asm_xstore(as, ir-1, LJ_LE ? 0 : 4);\n    }\n    return;\n  }\n  if (!usehi) return;  /* Skip unused hiword op for all remaining ops. */\n  switch ((ir-1)->o) {\n  case IR_ADD: as->curins--; asm_add64(as, ir); break;\n  case IR_SUB: as->curins--; asm_sub64(as, ir); break;\n  case IR_NEG: as->curins--; asm_neg64(as, ir); break;\n  case IR_CALLN:\n  case IR_CALLXS:\n    if (!uselo)\n      ra_allocref(as, ir->op1, RID2RSET(RID_RETLO));  /* Mark lo op as used. */\n    break;\n  case IR_CNEWI:\n    /* Nothing to do here. Handled by lo op itself. */\n    break;\n  default: lua_assert(0); break;\n  }\n#else\n  UNUSED(as); UNUSED(ir); lua_assert(0);  /* Unused without FFI. */\n#endif\n}\n\n/* -- Stack handling ------------------------------------------------------ */\n\n/* Check Lua stack size for overflow. Use exit handler as fallback. */\nstatic void asm_stack_check(ASMState *as, BCReg topslot,\n\t\t\t    IRIns *irp, RegSet allow, ExitNo exitno)\n{\n  /* Try to get an unused temp. register, otherwise spill/restore RID_RET*. */\n  Reg tmp, pbase = irp ? (ra_hasreg(irp->r) ? irp->r : RID_TMP) : RID_BASE;\n  ExitNo oldsnap = as->snapno;\n  rset_clear(allow, pbase);\n  tmp = allow ? rset_pickbot(allow) :\n\t\t(pbase == RID_RETHI ? RID_RETLO : RID_RETHI);\n  as->snapno = exitno;\n  asm_guard(as, MIPSI_BNE, RID_TMP, RID_ZERO);\n  as->snapno = oldsnap;\n  if (allow == RSET_EMPTY)  /* Restore temp. register. */\n    emit_tsi(as, MIPSI_LW, tmp, RID_SP, 0);\n  else\n    ra_modified(as, tmp);\n  emit_tsi(as, MIPSI_SLTIU, RID_TMP, RID_TMP, (int32_t)(8*topslot));\n  emit_dst(as, MIPSI_SUBU, RID_TMP, tmp, pbase);\n  emit_tsi(as, MIPSI_LW, tmp, tmp, offsetof(lua_State, maxstack));\n  if (pbase == RID_TMP)\n    emit_getgl(as, RID_TMP, jit_base);\n  emit_getgl(as, tmp, jit_L);\n  if (allow == RSET_EMPTY)  /* Spill temp. register. */\n    emit_tsi(as, MIPSI_SW, tmp, RID_SP, 0);\n}\n\n/* Restore Lua stack from on-trace state. */\nstatic void asm_stack_restore(ASMState *as, SnapShot *snap)\n{\n  SnapEntry *map = &as->T->snapmap[snap->mapofs];\n  SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1];\n  MSize n, nent = snap->nent;\n  /* Store the value of all modified slots to the Lua stack. */\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    BCReg s = snap_slot(sn);\n    int32_t ofs = 8*((int32_t)s-1);\n    IRRef ref = snap_ref(sn);\n    IRIns *ir = IR(ref);\n    if ((sn & SNAP_NORESTORE))\n      continue;\n    if (irt_isnum(ir->t)) {\n      Reg src = ra_alloc1(as, ref, RSET_FPR);\n      emit_hsi(as, MIPSI_SDC1, src, RID_BASE, ofs);\n    } else {\n      Reg type;\n      RegSet allow = rset_exclude(RSET_GPR, RID_BASE);\n      lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t));\n      if (!irt_ispri(ir->t)) {\n\tReg src = ra_alloc1(as, ref, allow);\n\trset_clear(allow, src);\n\temit_tsi(as, MIPSI_SW, src, RID_BASE, ofs+(LJ_BE?4:0));\n      }\n      if ((sn & (SNAP_CONT|SNAP_FRAME))) {\n\tif (s == 0) continue;  /* Do not overwrite link to previous frame. */\n\ttype = ra_allock(as, (int32_t)(*flinks--), allow);\n      } else {\n\ttype = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);\n      }\n      emit_tsi(as, MIPSI_SW, type, RID_BASE, ofs+(LJ_BE?0:4));\n    }\n    checkmclim(as);\n  }\n  lua_assert(map + nent == flinks);\n}\n\n/* -- GC handling --------------------------------------------------------- */\n\n/* Check GC threshold and do one or more GC steps. */\nstatic void asm_gc_check(ASMState *as)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg tmp;\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */\n  /* Assumes asm_snap_prep() already done. */\n  asm_guard(as, MIPSI_BNE, RID_RET, RID_ZERO);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ASMREF_TMP2;  /* MSize steps     */\n  asm_gencall(as, ci, args);\n  emit_tsi(as, MIPSI_ADDIU, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768);\n  tmp = ra_releasetmp(as, ASMREF_TMP2);\n  emit_loadi(as, tmp, as->gcsteps);\n  /* Jump around GC step if GC total < GC threshold. */\n  emit_branch(as, MIPSI_BNE, RID_TMP, RID_ZERO, l_end);\n  emit_dst(as, MIPSI_SLTU, RID_TMP, RID_TMP, tmp);\n  emit_getgl(as, tmp, gc.threshold);\n  emit_getgl(as, RID_TMP, gc.total);\n  as->gcsteps = 0;\n  checkmclim(as);\n}\n\n/* -- Loop handling ------------------------------------------------------- */\n\n/* Fixup the loop branch. */\nstatic void asm_loop_fixup(ASMState *as)\n{\n  MCode *p = as->mctop;\n  MCode *target = as->mcp;\n  p[-1] = MIPSI_NOP;\n  if (as->loopinv) {  /* Inverted loop branch? */\n    /* asm_guard already inverted the cond branch. Only patch the target. */\n    p[-3] |= ((target-p+2) & 0x0000ffffu);\n  } else {\n    p[-2] = MIPSI_J|(((uintptr_t)target>>2)&0x03ffffffu);\n  }\n}\n\n/* -- Head of trace ------------------------------------------------------- */\n\n/* Coalesce BASE register for a root trace. */\nstatic void asm_head_root_base(ASMState *as)\n{\n  IRIns *ir = IR(REF_BASE);\n  Reg r = ir->r;\n  if (as->loopinv) as->mctop--;\n  if (ra_hasreg(r)) {\n    ra_free(as, r);\n    if (rset_test(as->modset, r))\n      ir->r = RID_INIT;  /* No inheritance for modified BASE register. */\n    if (r != RID_BASE)\n      emit_move(as, r, RID_BASE);\n  }\n}\n\n/* Coalesce BASE register for a side trace. */\nstatic RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)\n{\n  IRIns *ir = IR(REF_BASE);\n  Reg r = ir->r;\n  if (as->loopinv) as->mctop--;\n  if (ra_hasreg(r)) {\n    ra_free(as, r);\n    if (rset_test(as->modset, r))\n      ir->r = RID_INIT;  /* No inheritance for modified BASE register. */\n    if (irp->r == r) {\n      rset_clear(allow, r);  /* Mark same BASE register as coalesced. */\n    } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) {\n      rset_clear(allow, irp->r);\n      emit_move(as, r, irp->r);  /* Move from coalesced parent reg. */\n    } else {\n      emit_getgl(as, r, jit_base);  /* Otherwise reload BASE. */\n    }\n  }\n  return allow;\n}\n\n/* -- Tail of trace ------------------------------------------------------- */\n\n/* Fixup the tail code. */\nstatic void asm_tail_fixup(ASMState *as, TraceNo lnk)\n{\n  MCode *target = lnk ? traceref(as->J,lnk)->mcode : (MCode *)lj_vm_exit_interp;\n  int32_t spadj = as->T->spadjust;\n  MCode *p = as->mctop-1;\n  *p = spadj ? (MIPSI_ADDIU|MIPSF_T(RID_SP)|MIPSF_S(RID_SP)|spadj) : MIPSI_NOP;\n  p[-1] = MIPSI_J|(((uintptr_t)target>>2)&0x03ffffffu);\n}\n\n/* Prepare tail of code. */\nstatic void asm_tail_prep(ASMState *as)\n{\n  as->mcp = as->mctop-2;  /* Leave room for branch plus nop or stack adj. */\n  as->invmcp = as->loopref ? as->mcp : NULL;\n}\n\n/* -- Instruction dispatch ------------------------------------------------ */\n\n/* Assemble a single instruction. */\nstatic void asm_ir(ASMState *as, IRIns *ir)\n{\n  switch ((IROp)ir->o) {\n  /* Miscellaneous ops. */\n  case IR_LOOP: asm_loop(as); break;\n  case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break;\n  case IR_USE:\n    ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break;\n  case IR_PHI: asm_phi(as, ir); break;\n  case IR_HIOP: asm_hiop(as, ir); break;\n  case IR_GCSTEP: asm_gcstep(as, ir); break;\n\n  /* Guarded assertions. */\n  case IR_EQ: case IR_NE: asm_compeq(as, ir); break;\n  case IR_LT: case IR_GE: case IR_LE: case IR_GT:\n  case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT:\n  case IR_ABC:\n    asm_comp(as, ir);\n    break;\n\n  case IR_RETF: asm_retf(as, ir); break;\n\n  /* Bit ops. */\n  case IR_BNOT: asm_bitnot(as, ir); break;\n  case IR_BSWAP: asm_bitswap(as, ir); break;\n\n  case IR_BAND: asm_bitop(as, ir, MIPSI_AND, MIPSI_ANDI); break;\n  case IR_BOR:  asm_bitop(as, ir, MIPSI_OR, MIPSI_ORI); break;\n  case IR_BXOR: asm_bitop(as, ir, MIPSI_XOR, MIPSI_XORI); break;\n\n  case IR_BSHL: asm_bitshift(as, ir, MIPSI_SLLV, MIPSI_SLL); break;\n  case IR_BSHR: asm_bitshift(as, ir, MIPSI_SRLV, MIPSI_SRL); break;\n  case IR_BSAR: asm_bitshift(as, ir, MIPSI_SRAV, MIPSI_SRA); break;\n  case IR_BROL: lua_assert(0); break;\n  case IR_BROR: asm_bitror(as, ir); break;\n\n  /* Arithmetic ops. */\n  case IR_ADD: asm_add(as, ir); break;\n  case IR_SUB: asm_sub(as, ir); break;\n  case IR_MUL: asm_mul(as, ir); break;\n  case IR_DIV: asm_fparith(as, ir, MIPSI_DIV_D); break;\n  case IR_MOD: asm_callid(as, ir, IRCALL_lj_vm_modi); break;\n  case IR_POW: asm_callid(as, ir, IRCALL_lj_vm_powi); break;\n  case IR_NEG: asm_neg(as, ir); break;\n\n  case IR_ABS: asm_fpunary(as, ir, MIPSI_ABS_D); break;\n  case IR_ATAN2: asm_callid(as, ir, IRCALL_atan2); break;\n  case IR_LDEXP: asm_callid(as, ir, IRCALL_ldexp); break;\n  case IR_MIN: asm_min_max(as, ir, 0); break;\n  case IR_MAX: asm_min_max(as, ir, 1); break;\n  case IR_FPMATH:\n    if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir))\n      break;\n    if (ir->op2 <= IRFPM_TRUNC)\n      asm_callround(as, ir, IRCALL_lj_vm_floor + ir->op2);\n    else if (ir->op2 == IRFPM_SQRT)\n      asm_fpunary(as, ir, MIPSI_SQRT_D);\n    else\n      asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);\n    break;\n\n  /* Overflow-checking arithmetic ops. */\n  case IR_ADDOV: asm_arithov(as, ir); break;\n  case IR_SUBOV: asm_arithov(as, ir); break;\n  case IR_MULOV: asm_mulov(as, ir); break;\n\n  /* Memory references. */\n  case IR_AREF: asm_aref(as, ir); break;\n  case IR_HREF: asm_href(as, ir); break;\n  case IR_HREFK: asm_hrefk(as, ir); break;\n  case IR_NEWREF: asm_newref(as, ir); break;\n  case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break;\n  case IR_FREF: asm_fref(as, ir); break;\n  case IR_STRREF: asm_strref(as, ir); break;\n\n  /* Loads and stores. */\n  case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n    asm_ahuvload(as, ir);\n    break;\n  case IR_FLOAD: asm_fload(as, ir); break;\n  case IR_XLOAD: asm_xload(as, ir); break;\n  case IR_SLOAD: asm_sload(as, ir); break;\n\n  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break;\n  case IR_FSTORE: asm_fstore(as, ir); break;\n  case IR_XSTORE: asm_xstore(as, ir, 0); break;\n\n  /* Allocations. */\n  case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break;\n  case IR_TNEW: asm_tnew(as, ir); break;\n  case IR_TDUP: asm_tdup(as, ir); break;\n  case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break;\n\n  /* Write barriers. */\n  case IR_TBAR: asm_tbar(as, ir); break;\n  case IR_OBAR: asm_obar(as, ir); break;\n\n  /* Type conversions. */\n  case IR_CONV: asm_conv(as, ir); break;\n  case IR_TOBIT: asm_tobit(as, ir); break;\n  case IR_TOSTR: asm_tostr(as, ir); break;\n  case IR_STRTO: asm_strto(as, ir); break;\n\n  /* Calls. */\n  case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break;\n  case IR_CALLXS: asm_callx(as, ir); break;\n  case IR_CARG: break;\n\n  default:\n    setintV(&as->J->errinfo, ir->o);\n    lj_trace_err_info(as->J, LJ_TRERR_NYIIR);\n    break;\n  }\n}\n\n/* -- Trace setup --------------------------------------------------------- */\n\n/* Ensure there are enough stack slots for call arguments. */\nstatic Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  IRRef args[CCI_NARGS_MAX];\n  uint32_t i, nargs = (int)CCI_NARGS(ci);\n  int nslots = 4, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;\n  asm_collectargs(as, ir, ci, args);\n  for (i = 0; i < nargs; i++) {\n    if (args[i] && irt_isfp(IR(args[i])->t) &&\n\tnfpr > 0 && !(ci->flags & CCI_VARARG)) {\n      nfpr--;\n      ngpr -= irt_isnum(IR(args[i])->t) ? 2 : 1;\n    } else if (args[i] && irt_isnum(IR(args[i])->t)) {\n      nfpr = 0;\n      ngpr = ngpr & ~1;\n      if (ngpr > 0) ngpr -= 2; else nslots = (nslots+3) & ~1;\n    } else {\n      nfpr = 0;\n      if (ngpr > 0) ngpr--; else nslots++;\n    }\n  }\n  if (nslots > as->evenspill)  /* Leave room for args in stack slots. */\n    as->evenspill = nslots;\n  return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET);\n}\n\nstatic void asm_setup_target(ASMState *as)\n{\n  asm_sparejump_setup(as);\n  asm_exitstub_setup(as);\n}\n\n/* -- Trace patching ------------------------------------------------------ */\n\n/* Patch exit jumps of existing machine code to a new target. */\nvoid lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target)\n{\n  MCode *p = T->mcode;\n  MCode *pe = (MCode *)((char *)p + T->szmcode);\n  MCode *px = exitstub_trace_addr(T, exitno);\n  MCode *cstart = NULL, *cstop = NULL;\n  MCode *mcarea = lj_mcode_patch(J, p, 0);\n  MCode exitload = MIPSI_LI | MIPSF_T(RID_TMP) | exitno;\n  MCode tjump = MIPSI_J|(((uintptr_t)target>>2)&0x03ffffffu);\n  for (p++; p < pe; p++) {\n    if (*p == exitload) {  /* Look for load of exit number. */\n      if (((p[-1] ^ (px-p)) & 0xffffu) == 0) {  /* Look for exitstub branch. */\n\tptrdiff_t delta = target - p;\n\tif (((delta + 0x8000) >> 16) == 0) {  /* Patch in-range branch. */\n\tpatchbranch:\n\t  p[-1] = (p[-1] & 0xffff0000u) | (delta & 0xffffu);\n\t  *p = MIPSI_NOP;  /* Replace the load of the exit number. */\n\t  cstop = p;\n\t  if (!cstart) cstart = p-1;\n\t} else {  /* Branch out of range. Use spare jump slot in mcarea. */\n\t  int i;\n\t  for (i = 2; i < 2+MIPS_SPAREJUMP*2; i += 2) {\n\t    if (mcarea[i] == tjump) {\n\t      delta = mcarea+i - p;\n\t      goto patchbranch;\n\t    } else if (mcarea[i] == MIPSI_NOP) {\n\t      mcarea[i] = tjump;\n\t      cstart = mcarea+i;\n\t      delta = mcarea+i - p;\n\t      goto patchbranch;\n\t    }\n\t  }\n\t  /* Ignore jump slot overflow. Child trace is simply not attached. */\n\t}\n      } else if (p+1 == pe) {\n\t/* Patch NOP after code for inverted loop branch. Use of J is ok. */\n\tlua_assert(p[1] == MIPSI_NOP);\n\tp[1] = tjump;\n\t*p = MIPSI_NOP;  /* Replace the load of the exit number. */\n\tcstop = p+2;\n\tif (!cstart) cstart = p+1;\n      }\n    }\n  }\n  if (cstart) lj_mcode_sync(cstart, cstop);\n  lj_mcode_patch(J, mcarea, 1);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_asm_ppc.h",
    "content": "/*\n** PPC IR assembler (SSA IR -> machine code).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Register allocator extensions --------------------------------------- */\n\n/* Allocate a register with a hint. */\nstatic Reg ra_hintalloc(ASMState *as, IRRef ref, Reg hint, RegSet allow)\n{\n  Reg r = IR(ref)->r;\n  if (ra_noreg(r)) {\n    if (!ra_hashint(r) && !iscrossref(as, ref))\n      ra_sethint(IR(ref)->r, hint);  /* Propagate register hint. */\n    r = ra_allocref(as, ref, allow);\n  }\n  ra_noweak(as, r);\n  return r;\n}\n\n/* Allocate two source registers for three-operand instructions. */\nstatic Reg ra_alloc2(ASMState *as, IRIns *ir, RegSet allow)\n{\n  IRIns *irl = IR(ir->op1), *irr = IR(ir->op2);\n  Reg left = irl->r, right = irr->r;\n  if (ra_hasreg(left)) {\n    ra_noweak(as, left);\n    if (ra_noreg(right))\n      right = ra_allocref(as, ir->op2, rset_exclude(allow, left));\n    else\n      ra_noweak(as, right);\n  } else if (ra_hasreg(right)) {\n    ra_noweak(as, right);\n    left = ra_allocref(as, ir->op1, rset_exclude(allow, right));\n  } else if (ra_hashint(right)) {\n    right = ra_allocref(as, ir->op2, allow);\n    left = ra_alloc1(as, ir->op1, rset_exclude(allow, right));\n  } else {\n    left = ra_allocref(as, ir->op1, allow);\n    right = ra_alloc1(as, ir->op2, rset_exclude(allow, left));\n  }\n  return left | (right << 8);\n}\n\n/* -- Guard handling ------------------------------------------------------ */\n\n/* Setup exit stubs after the end of each trace. */\nstatic void asm_exitstub_setup(ASMState *as, ExitNo nexits)\n{\n  ExitNo i;\n  MCode *mxp = as->mctop;\n  /* 1: mflr r0; bl ->vm_exit_handler; li r0, traceno; bl <1; bl <1; ... */\n  for (i = nexits-1; (int32_t)i >= 0; i--)\n    *--mxp = PPCI_BL|(((-3-i)&0x00ffffffu)<<2);\n  *--mxp = PPCI_LI|PPCF_T(RID_TMP)|as->T->traceno;  /* Read by exit handler. */\n  mxp--;\n  *mxp = PPCI_BL|((((MCode *)(void *)lj_vm_exit_handler-mxp)&0x00ffffffu)<<2);\n  *--mxp = PPCI_MFLR|PPCF_T(RID_TMP);\n  as->mctop = mxp;\n}\n\nstatic MCode *asm_exitstub_addr(ASMState *as, ExitNo exitno)\n{\n  /* Keep this in-sync with exitstub_trace_addr(). */\n  return as->mctop + exitno + 3;\n}\n\n/* Emit conditional branch to exit for guard. */\nstatic void asm_guardcc(ASMState *as, PPCCC cc)\n{\n  MCode *target = asm_exitstub_addr(as, as->snapno);\n  MCode *p = as->mcp;\n  if (LJ_UNLIKELY(p == as->invmcp)) {\n    as->loopinv = 1;\n    *p = PPCI_B | (((target-p) & 0x00ffffffu) << 2);\n    emit_condbranch(as, PPCI_BC, cc^4, p);\n    return;\n  }\n  emit_condbranch(as, PPCI_BC, cc, target);\n}\n\n/* -- Operand fusion ------------------------------------------------------ */\n\n/* Limit linear search to this distance. Avoids O(n^2) behavior. */\n#define CONFLICT_SEARCH_LIM\t31\n\n/* Check if there's no conflicting instruction between curins and ref. */\nstatic int noconflict(ASMState *as, IRRef ref, IROp conflict)\n{\n  IRIns *ir = as->ir;\n  IRRef i = as->curins;\n  if (i > ref + CONFLICT_SEARCH_LIM)\n    return 0;  /* Give up, ref is too far away. */\n  while (--i > ref)\n    if (ir[i].o == conflict)\n      return 0;  /* Conflict found. */\n  return 1;  /* Ok, no conflict. */\n}\n\n/* Fuse the array base of colocated arrays. */\nstatic int32_t asm_fuseabase(ASMState *as, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (ir->o == IR_TNEW && ir->op1 <= LJ_MAX_COLOSIZE &&\n      !neverfuse(as) && noconflict(as, ref, IR_NEWREF))\n    return (int32_t)sizeof(GCtab);\n  return 0;\n}\n\n/* Indicates load/store indexed is ok. */\n#define AHUREF_LSX\t((int32_t)0x80000000)\n\n/* Fuse array/hash/upvalue reference into register+offset operand. */\nstatic Reg asm_fuseahuref(ASMState *as, IRRef ref, int32_t *ofsp, RegSet allow)\n{\n  IRIns *ir = IR(ref);\n  if (ra_noreg(ir->r)) {\n    if (ir->o == IR_AREF) {\n      if (mayfuse(as, ref)) {\n\tif (irref_isk(ir->op2)) {\n\t  IRRef tab = IR(ir->op1)->op1;\n\t  int32_t ofs = asm_fuseabase(as, tab);\n\t  IRRef refa = ofs ? tab : ir->op1;\n\t  ofs += 8*IR(ir->op2)->i;\n\t  if (checki16(ofs)) {\n\t    *ofsp = ofs;\n\t    return ra_alloc1(as, refa, allow);\n\t  }\n\t}\n\tif (*ofsp == AHUREF_LSX) {\n\t  Reg base = ra_alloc1(as, ir->op1, allow);\n\t  Reg idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base));\n\t  return base | (idx << 8);\n\t}\n      }\n    } else if (ir->o == IR_HREFK) {\n      if (mayfuse(as, ref)) {\n\tint32_t ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node));\n\tif (checki16(ofs)) {\n\t  *ofsp = ofs;\n\t  return ra_alloc1(as, ir->op1, allow);\n\t}\n      }\n    } else if (ir->o == IR_UREFC) {\n      if (irref_isk(ir->op1)) {\n\tGCfunc *fn = ir_kfunc(IR(ir->op1));\n\tint32_t ofs = i32ptr(&gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.tv);\n\tint32_t jgl = (intptr_t)J2G(as->J);\n\tif ((uint32_t)(ofs-jgl) < 65536) {\n\t  *ofsp = ofs-jgl-32768;\n\t  return RID_JGL;\n\t} else {\n\t  *ofsp = (int16_t)ofs;\n\t  return ra_allock(as, ofs-(int16_t)ofs, allow);\n\t}\n      }\n    }\n  }\n  *ofsp = 0;\n  return ra_alloc1(as, ref, allow);\n}\n\n/* Fuse XLOAD/XSTORE reference into load/store operand. */\nstatic void asm_fusexref(ASMState *as, PPCIns pi, Reg rt, IRRef ref,\n\t\t\t RegSet allow, int32_t ofs)\n{\n  IRIns *ir = IR(ref);\n  Reg base;\n  if (ra_noreg(ir->r) && canfuse(as, ir)) {\n    if (ir->o == IR_ADD) {\n      int32_t ofs2;\n      if (irref_isk(ir->op2) && (ofs2 = ofs + IR(ir->op2)->i, checki16(ofs2))) {\n\tofs = ofs2;\n\tref = ir->op1;\n      } else if (ofs == 0) {\n\tReg right, left = ra_alloc2(as, ir, allow);\n\tright = (left >> 8); left &= 255;\n\temit_fab(as, PPCI_LWZX | ((pi >> 20) & 0x780), rt, left, right);\n\treturn;\n      }\n    } else if (ir->o == IR_STRREF) {\n      lua_assert(ofs == 0);\n      ofs = (int32_t)sizeof(GCstr);\n      if (irref_isk(ir->op2)) {\n\tofs += IR(ir->op2)->i;\n\tref = ir->op1;\n      } else if (irref_isk(ir->op1)) {\n\tofs += IR(ir->op1)->i;\n\tref = ir->op2;\n      } else {\n\t/* NYI: Fuse ADD with constant. */\n\tReg tmp, right, left = ra_alloc2(as, ir, allow);\n\tright = (left >> 8); left &= 255;\n\ttmp = ra_scratch(as, rset_exclude(rset_exclude(allow, left), right));\n\temit_fai(as, pi, rt, tmp, ofs);\n\temit_tab(as, PPCI_ADD, tmp, left, right);\n\treturn;\n      }\n      if (!checki16(ofs)) {\n\tReg left = ra_alloc1(as, ref, allow);\n\tReg right = ra_allock(as, ofs, rset_exclude(allow, left));\n\temit_fab(as, PPCI_LWZX | ((pi >> 20) & 0x780), rt, left, right);\n\treturn;\n      }\n    }\n  }\n  base = ra_alloc1(as, ref, allow);\n  emit_fai(as, pi, rt, base, ofs);\n}\n\n/* Fuse XLOAD/XSTORE reference into indexed-only load/store operand. */\nstatic void asm_fusexrefx(ASMState *as, PPCIns pi, Reg rt, IRRef ref,\n\t\t\t  RegSet allow)\n{\n  IRIns *ira = IR(ref);\n  Reg right, left;\n  if (canfuse(as, ira) && ira->o == IR_ADD && ra_noreg(ira->r)) {\n    left = ra_alloc2(as, ira, allow);\n    right = (left >> 8); left &= 255;\n  } else {\n    right = ra_alloc1(as, ref, allow);\n    left = RID_R0;\n  }\n  emit_tab(as, pi, rt, left, right);\n}\n\n/* Fuse to multiply-add/sub instruction. */\nstatic int asm_fusemadd(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pir)\n{\n  IRRef lref = ir->op1, rref = ir->op2;\n  IRIns *irm;\n  if (lref != rref &&\n      ((mayfuse(as, lref) && (irm = IR(lref), irm->o == IR_MUL) &&\n\tra_noreg(irm->r)) ||\n       (mayfuse(as, rref) && (irm = IR(rref), irm->o == IR_MUL) &&\n\t(rref = lref, pi = pir, ra_noreg(irm->r))))) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    Reg add = ra_alloc1(as, rref, RSET_FPR);\n    Reg right, left = ra_alloc2(as, irm, rset_exclude(RSET_FPR, add));\n    right = (left >> 8); left &= 255;\n    emit_facb(as, pi, dest, left, right, add);\n    return 1;\n  }\n  return 0;\n}\n\n/* -- Calls --------------------------------------------------------------- */\n\n/* Generate a call to a C function. */\nstatic void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)\n{\n  uint32_t n, nargs = CCI_NARGS(ci);\n  int32_t ofs = 8;\n  Reg gpr = REGARG_FIRSTGPR, fpr = REGARG_FIRSTFPR;\n  if ((void *)ci->func)\n    emit_call(as, (void *)ci->func);\n  for (n = 0; n < nargs; n++) {  /* Setup args. */\n    IRRef ref = args[n];\n    if (ref) {\n      IRIns *ir = IR(ref);\n      if (irt_isfp(ir->t)) {\n\tif (fpr <= REGARG_LASTFPR) {\n\t  lua_assert(rset_test(as->freeset, fpr));  /* Already evicted. */\n\t  ra_leftov(as, fpr, ref);\n\t  fpr++;\n\t} else {\n\t  Reg r = ra_alloc1(as, ref, RSET_FPR);\n\t  if (irt_isnum(ir->t)) ofs = (ofs + 4) & ~4;\n\t  emit_spstore(as, ir, r, ofs);\n\t  ofs += irt_isnum(ir->t) ? 8 : 4;\n\t}\n      } else {\n\tif (gpr <= REGARG_LASTGPR) {\n\t  lua_assert(rset_test(as->freeset, gpr));  /* Already evicted. */\n\t  ra_leftov(as, gpr, ref);\n\t  gpr++;\n\t} else {\n\t  Reg r = ra_alloc1(as, ref, RSET_GPR);\n\t  emit_spstore(as, ir, r, ofs);\n\t  ofs += 4;\n\t}\n      }\n    } else {\n      if (gpr <= REGARG_LASTGPR)\n\tgpr++;\n      else\n\tofs += 4;\n    }\n  }\n  if ((ci->flags & CCI_VARARG))  /* Vararg calls need to know about FPR use. */\n    emit_tab(as, fpr == REGARG_FIRSTFPR ? PPCI_CRXOR : PPCI_CREQV, 6, 6, 6);\n}\n\n/* Setup result reg/sp for call. Evict scratch regs. */\nstatic void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  RegSet drop = RSET_SCRATCH;\n  int hiop = ((ir+1)->o == IR_HIOP);\n  if ((ci->flags & CCI_NOFPRCLOBBER))\n    drop &= ~RSET_FPR;\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  if (hiop && ra_hasreg((ir+1)->r))\n    rset_clear(drop, (ir+1)->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);  /* Evictions must be performed first. */\n  if (ra_used(ir)) {\n    lua_assert(!irt_ispri(ir->t));\n    if (irt_isfp(ir->t)) {\n      if ((ci->flags & CCI_CASTU64)) {\n\t/* Use spill slot or temp slots. */\n\tint32_t ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;\n\tReg dest = ir->r;\n\tif (ra_hasreg(dest)) {\n\t  ra_free(as, dest);\n\t  ra_modified(as, dest);\n\t  emit_fai(as, PPCI_LFD, dest, RID_SP, ofs);\n\t}\n\temit_tai(as, PPCI_STW, RID_RETHI, RID_SP, ofs);\n\temit_tai(as, PPCI_STW, RID_RETLO, RID_SP, ofs+4);\n      } else {\n\tra_destreg(as, ir, RID_FPRET);\n      }\n    } else if (hiop) {\n      ra_destpair(as, ir);\n    } else {\n      ra_destreg(as, ir, RID_RET);\n    }\n  }\n}\n\nstatic void asm_call(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  const CCallInfo *ci = &lj_ir_callinfo[ir->op2];\n  asm_collectargs(as, ir, ci, args);\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\nstatic void asm_callx(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  CCallInfo ci;\n  IRRef func;\n  IRIns *irf;\n  ci.flags = asm_callx_flags(as, ir);\n  asm_collectargs(as, ir, &ci, args);\n  asm_setupresult(as, ir, &ci);\n  func = ir->op2; irf = IR(func);\n  if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); }\n  if (irref_isk(func)) {  /* Call to constant address. */\n    ci.func = (ASMFunction)(void *)(irf->i);\n  } else {  /* Need a non-argument register for indirect calls. */\n    RegSet allow = RSET_GPR & ~RSET_RANGE(RID_R0, REGARG_LASTGPR+1);\n    Reg freg = ra_alloc1(as, func, allow);\n    *--as->mcp = PPCI_BCTRL;\n    *--as->mcp = PPCI_MTCTR | PPCF_T(freg);\n    ci.func = (ASMFunction)(void *)0;\n  }\n  asm_gencall(as, &ci, args);\n}\n\nstatic void asm_callid(ASMState *as, IRIns *ir, IRCallID id)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[id];\n  IRRef args[2];\n  args[0] = ir->op1;\n  args[1] = ir->op2;\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\n/* -- Returns ------------------------------------------------------------- */\n\n/* Return to lower frame. Guard that it goes to the right spot. */\nstatic void asm_retf(ASMState *as, IRIns *ir)\n{\n  Reg base = ra_alloc1(as, REF_BASE, RSET_GPR);\n  void *pc = ir_kptr(IR(ir->op2));\n  int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));\n  as->topslot -= (BCReg)delta;\n  if ((int32_t)as->topslot < 0) as->topslot = 0;\n  emit_setgl(as, base, jit_base);\n  emit_addptr(as, base, -8*delta);\n  asm_guardcc(as, CC_NE);\n  emit_ab(as, PPCI_CMPW, RID_TMP,\n\t  ra_allock(as, i32ptr(pc), rset_exclude(RSET_GPR, base)));\n  emit_tai(as, PPCI_LWZ, RID_TMP, base, -8);\n}\n\n/* -- Type conversions ---------------------------------------------------- */\n\nstatic void asm_tointg(ASMState *as, IRIns *ir, Reg left)\n{\n  RegSet allow = RSET_FPR;\n  Reg tmp = ra_scratch(as, rset_clear(allow, left));\n  Reg fbias = ra_scratch(as, rset_clear(allow, tmp));\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg hibias = ra_allock(as, 0x43300000, rset_exclude(RSET_GPR, dest));\n  asm_guardcc(as, CC_NE);\n  emit_fab(as, PPCI_FCMPU, 0, tmp, left);\n  emit_fab(as, PPCI_FSUB, tmp, tmp, fbias);\n  emit_fai(as, PPCI_LFD, tmp, RID_SP, SPOFS_TMP);\n  emit_tai(as, PPCI_STW, RID_TMP, RID_SP, SPOFS_TMPLO);\n  emit_tai(as, PPCI_STW, hibias, RID_SP, SPOFS_TMPHI);\n  emit_asi(as, PPCI_XORIS, RID_TMP, dest, 0x8000);\n  emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO);\n  emit_lsptr(as, PPCI_LFS, (fbias & 31),\n\t     (void *)lj_ir_k64_find(as->J, U64x(59800004,59800000)),\n\t     RSET_GPR);\n  emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);\n  emit_fb(as, PPCI_FCTIWZ, tmp, left);\n}\n\nstatic void asm_tobit(ASMState *as, IRIns *ir)\n{\n  RegSet allow = RSET_FPR;\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, allow);\n  Reg right = ra_alloc1(as, ir->op2, rset_clear(allow, left));\n  Reg tmp = ra_scratch(as, rset_clear(allow, right));\n  emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO);\n  emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);\n  emit_fab(as, PPCI_FADD, tmp, left, right);\n}\n\nstatic void asm_conv(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);\n  int stfp = (st == IRT_NUM || st == IRT_FLOAT);\n  IRRef lref = ir->op1;\n  lua_assert(irt_type(ir->t) != st);\n  lua_assert(!(irt_isint64(ir->t) ||\n\t       (st == IRT_I64 || st == IRT_U64))); /* Handled by SPLIT. */\n  if (irt_isfp(ir->t)) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    if (stfp) {  /* FP to FP conversion. */\n      if (st == IRT_NUM)  /* double -> float conversion. */\n\temit_fb(as, PPCI_FRSP, dest, ra_alloc1(as, lref, RSET_FPR));\n      else  /* float -> double conversion is a no-op on PPC. */\n\tra_leftov(as, dest, lref);  /* Do nothing, but may need to move regs. */\n    } else {  /* Integer to FP conversion. */\n      /* IRT_INT: Flip hibit, bias with 2^52, subtract 2^52+2^31. */\n      /* IRT_U32: Bias with 2^52, subtract 2^52. */\n      RegSet allow = RSET_GPR;\n      Reg left = ra_alloc1(as, lref, allow);\n      Reg hibias = ra_allock(as, 0x43300000, rset_clear(allow, left));\n      Reg fbias = ra_scratch(as, rset_exclude(RSET_FPR, dest));\n      const float *kbias;\n      if (irt_isfloat(ir->t)) emit_fb(as, PPCI_FRSP, dest, dest);\n      emit_fab(as, PPCI_FSUB, dest, dest, fbias);\n      emit_fai(as, PPCI_LFD, dest, RID_SP, SPOFS_TMP);\n      kbias = (const float *)lj_ir_k64_find(as->J, U64x(59800004,59800000));\n      if (st == IRT_U32) kbias++;\n      emit_lsptr(as, PPCI_LFS, (fbias & 31), (void *)kbias,\n\t\t rset_clear(allow, hibias));\n      emit_tai(as, PPCI_STW, st == IRT_U32 ? left : RID_TMP,\n\t       RID_SP, SPOFS_TMPLO);\n      emit_tai(as, PPCI_STW, hibias, RID_SP, SPOFS_TMPHI);\n      if (st != IRT_U32) emit_asi(as, PPCI_XORIS, RID_TMP, left, 0x8000);\n    }\n  } else if (stfp) {  /* FP to integer conversion. */\n    if (irt_isguard(ir->t)) {\n      /* Checked conversions are only supported from number to int. */\n      lua_assert(irt_isint(ir->t) && st == IRT_NUM);\n      asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR));\n    } else {\n      Reg dest = ra_dest(as, ir, RSET_GPR);\n      Reg left = ra_alloc1(as, lref, RSET_FPR);\n      Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left));\n      if (irt_isu32(ir->t)) {\n\t/* Convert both x and x-2^31 to int and merge results. */\n\tReg tmpi = ra_scratch(as, rset_exclude(RSET_GPR, dest));\n\temit_asb(as, PPCI_OR, dest, dest, tmpi);  /* Select with mask idiom. */\n\temit_asb(as, PPCI_AND, tmpi, tmpi, RID_TMP);\n\temit_asb(as, PPCI_ANDC, dest, dest, RID_TMP);\n\temit_tai(as, PPCI_LWZ, tmpi, RID_SP, SPOFS_TMPLO);  /* tmp = (int)(x) */\n\temit_tai(as, PPCI_ADDIS, dest, dest, 0x8000);  /* dest += 2^31 */\n\temit_asb(as, PPCI_SRAWI, RID_TMP, dest, 31);  /* mask = -(dest < 0) */\n\temit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);\n\temit_tai(as, PPCI_LWZ, dest,\n\t\t RID_SP, SPOFS_TMPLO);  /* dest = (int)(x-2^31) */\n\temit_fb(as, PPCI_FCTIWZ, tmp, left);\n\temit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);\n\temit_fb(as, PPCI_FCTIWZ, tmp, tmp);\n\temit_fab(as, PPCI_FSUB, tmp, left, tmp);\n\temit_lsptr(as, PPCI_LFS, (tmp & 31),\n\t\t   (void *)lj_ir_k64_find(as->J, U64x(4f000000,00000000)),\n\t\t   RSET_GPR);\n      } else {\n\temit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO);\n\temit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);\n\temit_fb(as, PPCI_FCTIWZ, tmp, left);\n      }\n    }\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    if (st >= IRT_I8 && st <= IRT_U16) {  /* Extend to 32 bit integer. */\n      Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n      lua_assert(irt_isint(ir->t) || irt_isu32(ir->t));\n      if ((ir->op2 & IRCONV_SEXT))\n\temit_as(as, st == IRT_I8 ? PPCI_EXTSB : PPCI_EXTSH, dest, left);\n      else\n\temit_rot(as, PPCI_RLWINM, dest, left, 0, st == IRT_U8 ? 24 : 16, 31);\n    } else {  /* 32/64 bit integer conversions. */\n      /* Only need to handle 32/32 bit no-op (cast) on 32 bit archs. */\n      ra_leftov(as, dest, lref);  /* Do nothing, but may need to move regs. */\n    }\n  }\n}\n\n#if LJ_HASFFI\nstatic void asm_conv64(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK);\n  IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH);\n  IRCallID id;\n  const CCallInfo *ci;\n  IRRef args[2];\n  args[0] = ir->op1;\n  args[1] = (ir-1)->op1;\n  if (st == IRT_NUM || st == IRT_FLOAT) {\n    id = IRCALL_fp64_d2l + ((st == IRT_FLOAT) ? 2 : 0) + (dt - IRT_I64);\n    ir--;\n  } else {\n    id = IRCALL_fp64_l2d + ((dt == IRT_FLOAT) ? 2 : 0) + (st - IRT_I64);\n  }\n  ci = &lj_ir_callinfo[id];\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n#endif\n\nstatic void asm_strto(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num];\n  IRRef args[2];\n  int32_t ofs;\n  RegSet drop = RSET_SCRATCH;\n  if (ra_hasreg(ir->r)) rset_set(drop, ir->r);  /* Spill dest reg (if any). */\n  ra_evictset(as, drop);\n  asm_guardcc(as, CC_EQ);\n  emit_ai(as, PPCI_CMPWI, RID_RET, 0);  /* Test return status. */\n  args[0] = ir->op1;      /* GCstr *str */\n  args[1] = ASMREF_TMP1;  /* TValue *n  */\n  asm_gencall(as, ci, args);\n  /* Store the result to the spill slot or temp slots. */\n  ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;\n  emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_SP, ofs);\n}\n\n/* Get pointer to TValue. */\nstatic void asm_tvptr(ASMState *as, Reg dest, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (irt_isnum(ir->t)) {\n    if (irref_isk(ref))  /* Use the number constant itself as a TValue. */\n      ra_allockreg(as, i32ptr(ir_knum(ir)), dest);\n    else  /* Otherwise force a spill and use the spill slot. */\n      emit_tai(as, PPCI_ADDI, dest, RID_SP, ra_spill(as, ir));\n  } else {\n    /* Otherwise use g->tmptv to hold the TValue. */\n    RegSet allow = rset_exclude(RSET_GPR, dest);\n    Reg type;\n    emit_tai(as, PPCI_ADDI, dest, RID_JGL, offsetof(global_State, tmptv)-32768);\n    if (!irt_ispri(ir->t)) {\n      Reg src = ra_alloc1(as, ref, allow);\n      emit_setgl(as, src, tmptv.gcr);\n    }\n    type = ra_allock(as, irt_toitype(ir->t), allow);\n    emit_setgl(as, type, tmptv.it);\n  }\n}\n\nstatic void asm_tostr(ASMState *as, IRIns *ir)\n{\n  IRRef args[2];\n  args[0] = ASMREF_L;\n  as->gcsteps++;\n  if (irt_isnum(IR(ir->op1)->t) || (ir+1)->o == IR_HIOP) {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum];\n    args[1] = ASMREF_TMP1;  /* const lua_Number * */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n    asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op1);\n  } else {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint];\n    args[1] = ir->op1;  /* int32_t k */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n  }\n}\n\n/* -- Memory references --------------------------------------------------- */\n\nstatic void asm_aref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg idx, base;\n  if (irref_isk(ir->op2)) {\n    IRRef tab = IR(ir->op1)->op1;\n    int32_t ofs = asm_fuseabase(as, tab);\n    IRRef refa = ofs ? tab : ir->op1;\n    ofs += 8*IR(ir->op2)->i;\n    if (checki16(ofs)) {\n      base = ra_alloc1(as, refa, RSET_GPR);\n      emit_tai(as, PPCI_ADDI, dest, base, ofs);\n      return;\n    }\n  }\n  base = ra_alloc1(as, ir->op1, RSET_GPR);\n  idx = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, base));\n  emit_tab(as, PPCI_ADD, dest, RID_TMP, base);\n  emit_slwi(as, RID_TMP, idx, 3);\n}\n\n/* Inlined hash lookup. Specialized for key type and for const keys.\n** The equivalent C code is:\n**   Node *n = hashkey(t, key);\n**   do {\n**     if (lj_obj_equal(&n->key, key)) return &n->val;\n**   } while ((n = nextnode(n)));\n**   return niltv(L);\n*/\nstatic void asm_href(ASMState *as, IRIns *ir, IROp merge)\n{\n  RegSet allow = RSET_GPR;\n  int destused = ra_used(ir);\n  Reg dest = ra_dest(as, ir, allow);\n  Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest));\n  Reg key = RID_NONE, tmp1 = RID_TMP, tmp2;\n  Reg tisnum = RID_NONE, tmpnum = RID_NONE;\n  IRRef refkey = ir->op2;\n  IRIns *irkey = IR(refkey);\n  IRType1 kt = irkey->t;\n  uint32_t khash;\n  MCLabel l_end, l_loop, l_next;\n\n  rset_clear(allow, tab);\n  if (irt_isnum(kt)) {\n    key = ra_alloc1(as, refkey, RSET_FPR);\n    tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key));\n    tisnum = ra_allock(as, (int32_t)LJ_TISNUM, allow);\n    rset_clear(allow, tisnum);\n  } else if (!irt_ispri(kt)) {\n    key = ra_alloc1(as, refkey, allow);\n    rset_clear(allow, key);\n  }\n  tmp2 = ra_scratch(as, allow);\n  rset_clear(allow, tmp2);\n\n  /* Key not found in chain: jump to exit (if merged) or load niltv. */\n  l_end = emit_label(as);\n  as->invmcp = NULL;\n  if (merge == IR_NE)\n    asm_guardcc(as, CC_EQ);\n  else if (destused)\n    emit_loada(as, dest, niltvg(J2G(as->J)));\n\n  /* Follow hash chain until the end. */\n  l_loop = --as->mcp;\n  emit_ai(as, PPCI_CMPWI, dest, 0);\n  emit_tai(as, PPCI_LWZ, dest, dest, (int32_t)offsetof(Node, next));\n  l_next = emit_label(as);\n\n  /* Type and value comparison. */\n  if (merge == IR_EQ)\n    asm_guardcc(as, CC_EQ);\n  else\n    emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end);\n  if (irt_isnum(kt)) {\n    emit_fab(as, PPCI_FCMPU, 0, tmpnum, key);\n    emit_condbranch(as, PPCI_BC, CC_GE, l_next);\n    emit_ab(as, PPCI_CMPLW, tmp1, tisnum);\n    emit_fai(as, PPCI_LFD, tmpnum, dest, (int32_t)offsetof(Node, key.n));\n  } else {\n    if (!irt_ispri(kt)) {\n      emit_ab(as, PPCI_CMPW, tmp2, key);\n      emit_condbranch(as, PPCI_BC, CC_NE, l_next);\n    }\n    emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t));\n    if (!irt_ispri(kt))\n      emit_tai(as, PPCI_LWZ, tmp2, dest, (int32_t)offsetof(Node, key.gcr));\n  }\n  emit_tai(as, PPCI_LWZ, tmp1, dest, (int32_t)offsetof(Node, key.it));\n  *l_loop = PPCI_BC | PPCF_Y | PPCF_CC(CC_NE) |\n\t    (((char *)as->mcp-(char *)l_loop) & 0xffffu);\n\n  /* Load main position relative to tab->node into dest. */\n  khash = irref_isk(refkey) ? ir_khash(irkey) : 1;\n  if (khash == 0) {\n    emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));\n  } else {\n    Reg tmphash = tmp1;\n    if (irref_isk(refkey))\n      tmphash = ra_allock(as, khash, allow);\n    emit_tab(as, PPCI_ADD, dest, dest, tmp1);\n    emit_tai(as, PPCI_MULLI, tmp1, tmp1, sizeof(Node));\n    emit_asb(as, PPCI_AND, tmp1, tmp2, tmphash);\n    emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));\n    emit_tai(as, PPCI_LWZ, tmp2, tab, (int32_t)offsetof(GCtab, hmask));\n    if (irref_isk(refkey)) {\n      /* Nothing to do. */\n    } else if (irt_isstr(kt)) {\n      emit_tai(as, PPCI_LWZ, tmp1, key, (int32_t)offsetof(GCstr, hash));\n    } else {  /* Must match with hash*() in lj_tab.c. */\n      emit_tab(as, PPCI_SUBF, tmp1, tmp2, tmp1);\n      emit_rotlwi(as, tmp2, tmp2, HASH_ROT3);\n      emit_asb(as, PPCI_XOR, tmp1, tmp1, tmp2);\n      emit_rotlwi(as, tmp1, tmp1, (HASH_ROT2+HASH_ROT1)&31);\n      emit_tab(as, PPCI_SUBF, tmp2, dest, tmp2);\n      if (irt_isnum(kt)) {\n\tint32_t ofs = ra_spill(as, irkey);\n\temit_asb(as, PPCI_XOR, tmp2, tmp2, tmp1);\n\temit_rotlwi(as, dest, tmp1, HASH_ROT1);\n\temit_tab(as, PPCI_ADD, tmp1, tmp1, tmp1);\n\temit_tai(as, PPCI_LWZ, tmp2, RID_SP, ofs+4);\n\temit_tai(as, PPCI_LWZ, tmp1, RID_SP, ofs);\n      } else {\n\temit_asb(as, PPCI_XOR, tmp2, key, tmp1);\n\temit_rotlwi(as, dest, tmp1, HASH_ROT1);\n\temit_tai(as, PPCI_ADDI, tmp1, tmp2, HASH_BIAS);\n\temit_tai(as, PPCI_ADDIS, tmp2, key, (HASH_BIAS + 32768)>>16);\n      }\n    }\n  }\n}\n\nstatic void asm_hrefk(ASMState *as, IRIns *ir)\n{\n  IRIns *kslot = IR(ir->op2);\n  IRIns *irkey = IR(kslot->op1);\n  int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node));\n  int32_t kofs = ofs + (int32_t)offsetof(Node, key);\n  Reg dest = (ra_used(ir)||ofs > 32736) ? ra_dest(as, ir, RSET_GPR) : RID_NONE;\n  Reg node = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg key = RID_NONE, type = RID_TMP, idx = node;\n  RegSet allow = rset_exclude(RSET_GPR, node);\n  lua_assert(ofs % sizeof(Node) == 0);\n  if (ofs > 32736) {\n    idx = dest;\n    rset_clear(allow, dest);\n    kofs = (int32_t)offsetof(Node, key);\n  } else if (ra_hasreg(dest)) {\n    emit_tai(as, PPCI_ADDI, dest, node, ofs);\n  }\n  asm_guardcc(as, CC_NE);\n  if (!irt_ispri(irkey->t)) {\n    key = ra_scratch(as, allow);\n    rset_clear(allow, key);\n  }\n  rset_clear(allow, type);\n  if (irt_isnum(irkey->t)) {\n    emit_cmpi(as, key, (int32_t)ir_knum(irkey)->u32.lo);\n    asm_guardcc(as, CC_NE);\n    emit_cmpi(as, type, (int32_t)ir_knum(irkey)->u32.hi);\n  } else {\n    if (ra_hasreg(key)) {\n      emit_cmpi(as, key, irkey->i);  /* May use RID_TMP, i.e. type. */\n      asm_guardcc(as, CC_NE);\n    }\n    emit_ai(as, PPCI_CMPWI, type, irt_toitype(irkey->t));\n  }\n  if (ra_hasreg(key)) emit_tai(as, PPCI_LWZ, key, idx, kofs+4);\n  emit_tai(as, PPCI_LWZ, type, idx, kofs);\n  if (ofs > 32736) {\n    emit_tai(as, PPCI_ADDIS, dest, dest, (ofs + 32768) >> 16);\n    emit_tai(as, PPCI_ADDI, dest, node, ofs);\n  }\n}\n\nstatic void asm_newref(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];\n  IRRef args[3];\n  if (ir->r == RID_SINK)\n    return;\n  args[0] = ASMREF_L;     /* lua_State *L */\n  args[1] = ir->op1;      /* GCtab *t     */\n  args[2] = ASMREF_TMP1;  /* cTValue *key */\n  asm_setupresult(as, ir, ci);  /* TValue * */\n  asm_gencall(as, ci, args);\n  asm_tvptr(as, ra_releasetmp(as, ASMREF_TMP1), ir->op2);\n}\n\nstatic void asm_uref(ASMState *as, IRIns *ir)\n{\n  /* NYI: Check that UREFO is still open and not aliasing a slot. */\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  if (irref_isk(ir->op1)) {\n    GCfunc *fn = ir_kfunc(IR(ir->op1));\n    MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v;\n    emit_lsptr(as, PPCI_LWZ, dest, v, RSET_GPR);\n  } else {\n    Reg uv = ra_scratch(as, RSET_GPR);\n    Reg func = ra_alloc1(as, ir->op1, RSET_GPR);\n    if (ir->o == IR_UREFC) {\n      asm_guardcc(as, CC_NE);\n      emit_ai(as, PPCI_CMPWI, RID_TMP, 1);\n      emit_tai(as, PPCI_ADDI, dest, uv, (int32_t)offsetof(GCupval, tv));\n      emit_tai(as, PPCI_LBZ, RID_TMP, uv, (int32_t)offsetof(GCupval, closed));\n    } else {\n      emit_tai(as, PPCI_LWZ, dest, uv, (int32_t)offsetof(GCupval, v));\n    }\n    emit_tai(as, PPCI_LWZ, uv, func,\n\t     (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8));\n  }\n}\n\nstatic void asm_fref(ASMState *as, IRIns *ir)\n{\n  UNUSED(as); UNUSED(ir);\n  lua_assert(!ra_used(ir));\n}\n\nstatic void asm_strref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  IRRef ref = ir->op2, refk = ir->op1;\n  int32_t ofs = (int32_t)sizeof(GCstr);\n  Reg r;\n  if (irref_isk(ref)) {\n    IRRef tmp = refk; refk = ref; ref = tmp;\n  } else if (!irref_isk(refk)) {\n    Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR);\n    IRIns *irr = IR(ir->op2);\n    if (ra_hasreg(irr->r)) {\n      ra_noweak(as, irr->r);\n      right = irr->r;\n    } else if (mayfuse(as, irr->op2) &&\n\t       irr->o == IR_ADD && irref_isk(irr->op2) &&\n\t       checki16(ofs + IR(irr->op2)->i)) {\n      ofs += IR(irr->op2)->i;\n      right = ra_alloc1(as, irr->op1, rset_exclude(RSET_GPR, left));\n    } else {\n      right = ra_allocref(as, ir->op2, rset_exclude(RSET_GPR, left));\n    }\n    emit_tai(as, PPCI_ADDI, dest, dest, ofs);\n    emit_tab(as, PPCI_ADD, dest, left, right);\n    return;\n  }\n  r = ra_alloc1(as, ref, RSET_GPR);\n  ofs += IR(refk)->i;\n  if (checki16(ofs))\n    emit_tai(as, PPCI_ADDI, dest, r, ofs);\n  else\n    emit_tab(as, PPCI_ADD, dest, r,\n\t     ra_allock(as, ofs, rset_exclude(RSET_GPR, r)));\n}\n\n/* -- Loads and stores ---------------------------------------------------- */\n\nstatic PPCIns asm_fxloadins(IRIns *ir)\n{\n  switch (irt_type(ir->t)) {\n  case IRT_I8: return PPCI_LBZ;  /* Needs sign-extension. */\n  case IRT_U8: return PPCI_LBZ;\n  case IRT_I16: return PPCI_LHA;\n  case IRT_U16: return PPCI_LHZ;\n  case IRT_NUM: return PPCI_LFD;\n  case IRT_FLOAT: return PPCI_LFS;\n  default: return PPCI_LWZ;\n  }\n}\n\nstatic PPCIns asm_fxstoreins(IRIns *ir)\n{\n  switch (irt_type(ir->t)) {\n  case IRT_I8: case IRT_U8: return PPCI_STB;\n  case IRT_I16: case IRT_U16: return PPCI_STH;\n  case IRT_NUM: return PPCI_STFD;\n  case IRT_FLOAT: return PPCI_STFS;\n  default: return PPCI_STW;\n  }\n}\n\nstatic void asm_fload(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg idx = ra_alloc1(as, ir->op1, RSET_GPR);\n  PPCIns pi = asm_fxloadins(ir);\n  int32_t ofs;\n  if (ir->op2 == IRFL_TAB_ARRAY) {\n    ofs = asm_fuseabase(as, ir->op1);\n    if (ofs) {  /* Turn the t->array load into an add for colocated arrays. */\n      emit_tai(as, PPCI_ADDI, dest, idx, ofs);\n      return;\n    }\n  }\n  ofs = field_ofs[ir->op2];\n  lua_assert(!irt_isi8(ir->t));\n  emit_tai(as, pi, dest, idx, ofs);\n}\n\nstatic void asm_fstore(ASMState *as, IRIns *ir)\n{\n  if (ir->r != RID_SINK) {\n    Reg src = ra_alloc1(as, ir->op2, RSET_GPR);\n    IRIns *irf = IR(ir->op1);\n    Reg idx = ra_alloc1(as, irf->op1, rset_exclude(RSET_GPR, src));\n    int32_t ofs = field_ofs[irf->op2];\n    PPCIns pi = asm_fxstoreins(ir);\n    emit_tai(as, pi, src, idx, ofs);\n  }\n}\n\nstatic void asm_xload(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);\n  lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED));\n  if (irt_isi8(ir->t))\n    emit_as(as, PPCI_EXTSB, dest, dest);\n  asm_fusexref(as, asm_fxloadins(ir), dest, ir->op1, RSET_GPR, 0);\n}\n\nstatic void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs)\n{\n  IRIns *irb;\n  if (ir->r == RID_SINK)\n    return;\n  if (ofs == 0 && mayfuse(as, ir->op2) && (irb = IR(ir->op2))->o == IR_BSWAP &&\n      ra_noreg(irb->r) && (irt_isint(ir->t) || irt_isu32(ir->t))) {\n    /* Fuse BSWAP with XSTORE to stwbrx. */\n    Reg src = ra_alloc1(as, irb->op1, RSET_GPR);\n    asm_fusexrefx(as, PPCI_STWBRX, src, ir->op1, rset_exclude(RSET_GPR, src));\n  } else {\n    Reg src = ra_alloc1(as, ir->op2, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);\n    asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1,\n\t\t rset_exclude(RSET_GPR, src), ofs);\n  }\n}\n\nstatic void asm_ahuvload(ASMState *as, IRIns *ir)\n{\n  IRType1 t = ir->t;\n  Reg dest = RID_NONE, type = RID_TMP, tmp = RID_TMP, idx;\n  RegSet allow = RSET_GPR;\n  int32_t ofs = AHUREF_LSX;\n  if (ra_used(ir)) {\n    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));\n    if (!irt_isnum(t)) ofs = 0;\n    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);\n    rset_clear(allow, dest);\n  }\n  idx = asm_fuseahuref(as, ir->op1, &ofs, allow);\n  if (irt_isnum(t)) {\n    Reg tisnum = ra_allock(as, (int32_t)LJ_TISNUM, rset_exclude(allow, idx));\n    asm_guardcc(as, CC_GE);\n    emit_ab(as, PPCI_CMPLW, type, tisnum);\n    if (ra_hasreg(dest)) {\n      if (ofs == AHUREF_LSX) {\n\ttmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR,\n\t\t\t\t\t\t       (idx&255)), (idx>>8)));\n\temit_fab(as, PPCI_LFDX, dest, (idx&255), tmp);\n      } else {\n\temit_fai(as, PPCI_LFD, dest, idx, ofs);\n      }\n    }\n  } else {\n    asm_guardcc(as, CC_NE);\n    emit_ai(as, PPCI_CMPWI, type, irt_toitype(t));\n    if (ra_hasreg(dest)) emit_tai(as, PPCI_LWZ, dest, idx, ofs+4);\n  }\n  if (ofs == AHUREF_LSX) {\n    emit_tab(as, PPCI_LWZX, type, (idx&255), tmp);\n    emit_slwi(as, tmp, (idx>>8), 3);\n  } else {\n    emit_tai(as, PPCI_LWZ, type, idx, ofs);\n  }\n}\n\nstatic void asm_ahustore(ASMState *as, IRIns *ir)\n{\n  RegSet allow = RSET_GPR;\n  Reg idx, src = RID_NONE, type = RID_NONE;\n  int32_t ofs = AHUREF_LSX;\n  if (ir->r == RID_SINK)\n    return;\n  if (irt_isnum(ir->t)) {\n    src = ra_alloc1(as, ir->op2, RSET_FPR);\n  } else {\n    if (!irt_ispri(ir->t)) {\n      src = ra_alloc1(as, ir->op2, allow);\n      rset_clear(allow, src);\n      ofs = 0;\n    }\n    type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);\n    rset_clear(allow, type);\n  }\n  idx = asm_fuseahuref(as, ir->op1, &ofs, allow);\n  if (irt_isnum(ir->t)) {\n    if (ofs == AHUREF_LSX) {\n      emit_fab(as, PPCI_STFDX, src, (idx&255), RID_TMP);\n      emit_slwi(as, RID_TMP, (idx>>8), 3);\n    } else {\n      emit_fai(as, PPCI_STFD, src, idx, ofs);\n    }\n  } else {\n    if (ra_hasreg(src))\n      emit_tai(as, PPCI_STW, src, idx, ofs+4);\n    if (ofs == AHUREF_LSX) {\n      emit_tab(as, PPCI_STWX, type, (idx&255), RID_TMP);\n      emit_slwi(as, RID_TMP, (idx>>8), 3);\n    } else {\n      emit_tai(as, PPCI_STW, type, idx, ofs);\n    }\n  }\n}\n\nstatic void asm_sload(ASMState *as, IRIns *ir)\n{\n  int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 0 : 4);\n  IRType1 t = ir->t;\n  Reg dest = RID_NONE, type = RID_NONE, base;\n  RegSet allow = RSET_GPR;\n  lua_assert(!(ir->op2 & IRSLOAD_PARENT));  /* Handled by asm_head_side(). */\n  lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK));\n  lua_assert(LJ_DUALNUM ||\n\t     !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME)));\n  if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) {\n    dest = ra_scratch(as, RSET_FPR);\n    asm_tointg(as, ir, dest);\n    t.irt = IRT_NUM;  /* Continue with a regular number type check. */\n  } else if (ra_used(ir)) {\n    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));\n    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);\n    rset_clear(allow, dest);\n    base = ra_alloc1(as, REF_BASE, allow);\n    rset_clear(allow, base);\n    if ((ir->op2 & IRSLOAD_CONVERT)) {\n      if (irt_isint(t)) {\n\temit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO);\n\tdest = ra_scratch(as, RSET_FPR);\n\temit_fai(as, PPCI_STFD, dest, RID_SP, SPOFS_TMP);\n\temit_fb(as, PPCI_FCTIWZ, dest, dest);\n\tt.irt = IRT_NUM;  /* Check for original type. */\n      } else {\n\tReg tmp = ra_scratch(as, allow);\n\tReg hibias = ra_allock(as, 0x43300000, rset_clear(allow, tmp));\n\tReg fbias = ra_scratch(as, rset_exclude(RSET_FPR, dest));\n\temit_fab(as, PPCI_FSUB, dest, dest, fbias);\n\temit_fai(as, PPCI_LFD, dest, RID_SP, SPOFS_TMP);\n\temit_lsptr(as, PPCI_LFS, (fbias & 31),\n\t\t   (void *)lj_ir_k64_find(as->J, U64x(59800004,59800000)),\n\t\t   rset_clear(allow, hibias));\n\temit_tai(as, PPCI_STW, tmp, RID_SP, SPOFS_TMPLO);\n\temit_tai(as, PPCI_STW, hibias, RID_SP, SPOFS_TMPHI);\n\temit_asi(as, PPCI_XORIS, tmp, tmp, 0x8000);\n\tdest = tmp;\n\tt.irt = IRT_INT;  /* Check for original type. */\n      }\n    }\n    goto dotypecheck;\n  }\n  base = ra_alloc1(as, REF_BASE, allow);\n  rset_clear(allow, base);\ndotypecheck:\n  if (irt_isnum(t)) {\n    if ((ir->op2 & IRSLOAD_TYPECHECK)) {\n      Reg tisnum = ra_allock(as, (int32_t)LJ_TISNUM, allow);\n      asm_guardcc(as, CC_GE);\n      emit_ab(as, PPCI_CMPLW, RID_TMP, tisnum);\n      type = RID_TMP;\n    }\n    if (ra_hasreg(dest)) emit_fai(as, PPCI_LFD, dest, base, ofs-4);\n  } else {\n    if ((ir->op2 & IRSLOAD_TYPECHECK)) {\n      asm_guardcc(as, CC_NE);\n      emit_ai(as, PPCI_CMPWI, RID_TMP, irt_toitype(t));\n      type = RID_TMP;\n    }\n    if (ra_hasreg(dest)) emit_tai(as, PPCI_LWZ, dest, base, ofs);\n  }\n  if (ra_hasreg(type)) emit_tai(as, PPCI_LWZ, type, base, ofs-4);\n}\n\n/* -- Allocations --------------------------------------------------------- */\n\n#if LJ_HASFFI\nstatic void asm_cnew(ASMState *as, IRIns *ir)\n{\n  CTState *cts = ctype_ctsG(J2G(as->J));\n  CTypeID ctypeid = (CTypeID)IR(ir->op1)->i;\n  CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ?\n\t      lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i;\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco];\n  IRRef args[2];\n  RegSet allow = (RSET_GPR & ~RSET_SCRATCH);\n  RegSet drop = RSET_SCRATCH;\n  lua_assert(sz != CTSIZE_INVALID);\n\n  args[0] = ASMREF_L;     /* lua_State *L */\n  args[1] = ASMREF_TMP1;  /* MSize size   */\n  as->gcsteps++;\n\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);\n  if (ra_used(ir))\n    ra_destreg(as, ir, RID_RET);  /* GCcdata * */\n\n  /* Initialize immutable cdata object. */\n  if (ir->o == IR_CNEWI) {\n    int32_t ofs = sizeof(GCcdata);\n    lua_assert(sz == 4 || sz == 8);\n    if (sz == 8) {\n      ofs += 4;\n      lua_assert((ir+1)->o == IR_HIOP);\n    }\n    for (;;) {\n      Reg r = ra_alloc1(as, ir->op2, allow);\n      emit_tai(as, PPCI_STW, r, RID_RET, ofs);\n      rset_clear(allow, r);\n      if (ofs == sizeof(GCcdata)) break;\n      ofs -= 4; ir++;\n    }\n  }\n  /* Initialize gct and ctypeid. lj_mem_newgco() already sets marked. */\n  emit_tai(as, PPCI_STB, RID_RET+1, RID_RET, offsetof(GCcdata, gct));\n  emit_tai(as, PPCI_STH, RID_TMP, RID_RET, offsetof(GCcdata, ctypeid));\n  emit_ti(as, PPCI_LI, RID_RET+1, ~LJ_TCDATA);\n  emit_ti(as, PPCI_LI, RID_TMP, ctypeid);  /* Lower 16 bit used. Sign-ext ok. */\n  asm_gencall(as, ci, args);\n  ra_allockreg(as, (int32_t)(sz+sizeof(GCcdata)),\n\t       ra_releasetmp(as, ASMREF_TMP1));\n}\n#else\n#define asm_cnew(as, ir)\t((void)0)\n#endif\n\n/* -- Write barriers ------------------------------------------------------ */\n\nstatic void asm_tbar(ASMState *as, IRIns *ir)\n{\n  Reg tab = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg mark = ra_scratch(as, rset_exclude(RSET_GPR, tab));\n  Reg link = RID_TMP;\n  MCLabel l_end = emit_label(as);\n  emit_tai(as, PPCI_STW, link, tab, (int32_t)offsetof(GCtab, gclist));\n  emit_tai(as, PPCI_STB, mark, tab, (int32_t)offsetof(GCtab, marked));\n  emit_setgl(as, tab, gc.grayagain);\n  lua_assert(LJ_GC_BLACK == 0x04);\n  emit_rot(as, PPCI_RLWINM, mark, mark, 0, 30, 28);  /* Clear black bit. */\n  emit_getgl(as, link, gc.grayagain);\n  emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end);\n  emit_asi(as, PPCI_ANDIDOT, RID_TMP, mark, LJ_GC_BLACK);\n  emit_tai(as, PPCI_LBZ, mark, tab, (int32_t)offsetof(GCtab, marked));\n}\n\nstatic void asm_obar(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg obj, val, tmp;\n  /* No need for other object barriers (yet). */\n  lua_assert(IR(ir->op1)->o == IR_UREFC);\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ir->op1;      /* TValue *tv      */\n  asm_gencall(as, ci, args);\n  emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768);\n  obj = IR(ir->op1)->r;\n  tmp = ra_scratch(as, rset_exclude(RSET_GPR, obj));\n  emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end);\n  emit_asi(as, PPCI_ANDIDOT, tmp, tmp, LJ_GC_BLACK);\n  emit_condbranch(as, PPCI_BC, CC_EQ, l_end);\n  emit_asi(as, PPCI_ANDIDOT, RID_TMP, RID_TMP, LJ_GC_WHITES);\n  val = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, obj));\n  emit_tai(as, PPCI_LBZ, tmp, obj,\n\t   (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv));\n  emit_tai(as, PPCI_LBZ, RID_TMP, val, (int32_t)offsetof(GChead, marked));\n}\n\n/* -- Arithmetic and logic operations ------------------------------------- */\n\nstatic void asm_fparith(ASMState *as, IRIns *ir, PPCIns pi)\n{\n  Reg dest = ra_dest(as, ir, RSET_FPR);\n  Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n  right = (left >> 8); left &= 255;\n  if (pi == PPCI_FMUL)\n    emit_fac(as, pi, dest, left, right);\n  else\n    emit_fab(as, pi, dest, left, right);\n}\n\nstatic void asm_fpunary(ASMState *as, IRIns *ir, PPCIns pi)\n{\n  Reg dest = ra_dest(as, ir, RSET_FPR);\n  Reg left = ra_hintalloc(as, ir->op1, dest, RSET_FPR);\n  emit_fb(as, pi, dest, left);\n}\n\nstatic int asm_fpjoin_pow(ASMState *as, IRIns *ir)\n{\n  IRIns *irp = IR(ir->op1);\n  if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) {\n    IRIns *irpp = IR(irp->op1);\n    if (irpp == ir-2 && irpp->o == IR_FPMATH &&\n\tirpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) {\n      const CCallInfo *ci = &lj_ir_callinfo[IRCALL_pow];\n      IRRef args[2];\n      args[0] = irpp->op1;\n      args[1] = irp->op2;\n      asm_setupresult(as, ir, ci);\n      asm_gencall(as, ci, args);\n      return 1;\n    }\n  }\n  return 0;\n}\n\nstatic void asm_add(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    if (!asm_fusemadd(as, ir, PPCI_FMADD, PPCI_FMADD))\n      asm_fparith(as, ir, PPCI_FADD);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n    PPCIns pi;\n    if (irref_isk(ir->op2)) {\n      int32_t k = IR(ir->op2)->i;\n      if (checki16(k)) {\n\tpi = PPCI_ADDI;\n\t/* May fail due to spills/restores above, but simplifies the logic. */\n\tif (as->flagmcp == as->mcp) {\n\t  as->flagmcp = NULL;\n\t  as->mcp++;\n\t  pi = PPCI_ADDICDOT;\n\t}\n\temit_tai(as, pi, dest, left, k);\n\treturn;\n      } else if ((k & 0xffff) == 0) {\n\temit_tai(as, PPCI_ADDIS, dest, left, (k >> 16));\n\treturn;\n      } else if (!as->sectref) {\n\temit_tai(as, PPCI_ADDIS, dest, dest, (k + 32768) >> 16);\n\temit_tai(as, PPCI_ADDI, dest, left, k);\n\treturn;\n      }\n    }\n    pi = PPCI_ADD;\n    /* May fail due to spills/restores above, but simplifies the logic. */\n    if (as->flagmcp == as->mcp) {\n      as->flagmcp = NULL;\n      as->mcp++;\n      pi |= PPCF_DOT;\n    }\n    right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n    emit_tab(as, pi, dest, left, right);\n  }\n}\n\nstatic void asm_sub(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    if (!asm_fusemadd(as, ir, PPCI_FMSUB, PPCI_FNMSUB))\n      asm_fparith(as, ir, PPCI_FSUB);\n  } else {\n    PPCIns pi = PPCI_SUBF;\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg left, right;\n    if (irref_isk(ir->op1)) {\n      int32_t k = IR(ir->op1)->i;\n      if (checki16(k)) {\n\tright = ra_alloc1(as, ir->op2, RSET_GPR);\n\temit_tai(as, PPCI_SUBFIC, dest, right, k);\n\treturn;\n      }\n    }\n    /* May fail due to spills/restores above, but simplifies the logic. */\n    if (as->flagmcp == as->mcp) {\n      as->flagmcp = NULL;\n      as->mcp++;\n      pi |= PPCF_DOT;\n    }\n    left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n    right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n    emit_tab(as, pi, dest, right, left);  /* Subtract right _from_ left. */\n  }\n}\n\nstatic void asm_mul(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    asm_fparith(as, ir, PPCI_FMUL);\n  } else {\n    PPCIns pi = PPCI_MULLW;\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n    if (irref_isk(ir->op2)) {\n      int32_t k = IR(ir->op2)->i;\n      if (checki16(k)) {\n\temit_tai(as, PPCI_MULLI, dest, left, k);\n\treturn;\n      }\n    }\n    /* May fail due to spills/restores above, but simplifies the logic. */\n    if (as->flagmcp == as->mcp) {\n      as->flagmcp = NULL;\n      as->mcp++;\n      pi |= PPCF_DOT;\n    }\n    right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n    emit_tab(as, pi, dest, left, right);\n  }\n}\n\nstatic void asm_neg(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t)) {\n    asm_fpunary(as, ir, PPCI_FNEG);\n  } else {\n    Reg dest, left;\n    PPCIns pi = PPCI_NEG;\n    if (as->flagmcp == as->mcp) {\n      as->flagmcp = NULL;\n      as->mcp++;\n      pi |= PPCF_DOT;\n    }\n    dest = ra_dest(as, ir, RSET_GPR);\n    left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n    emit_tab(as, pi, dest, left, 0);\n  }\n}\n\nstatic void asm_arithov(ASMState *as, IRIns *ir, PPCIns pi)\n{\n  Reg dest, left, right;\n  if (as->flagmcp == as->mcp) {\n    as->flagmcp = NULL;\n    as->mcp++;\n  }\n  asm_guardcc(as, CC_SO);\n  dest = ra_dest(as, ir, RSET_GPR);\n  left = ra_alloc2(as, ir, RSET_GPR);\n  right = (left >> 8); left &= 255;\n  if (pi == PPCI_SUBFO) { Reg tmp = left; left = right; right = tmp; }\n  emit_tab(as, pi|PPCF_DOT, dest, left, right);\n}\n\n#if LJ_HASFFI\nstatic void asm_add64(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg right, left = ra_alloc1(as, ir->op1, RSET_GPR);\n  PPCIns pi = PPCI_ADDE;\n  if (irref_isk(ir->op2)) {\n    int32_t k = IR(ir->op2)->i;\n    if (k == 0)\n      pi = PPCI_ADDZE;\n    else if (k == -1)\n      pi = PPCI_ADDME;\n    else\n      goto needright;\n    right = 0;\n  } else {\n  needright:\n    right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  }\n  emit_tab(as, pi, dest, left, right);\n  ir--;\n  dest = ra_dest(as, ir, RSET_GPR);\n  left = ra_alloc1(as, ir->op1, RSET_GPR);\n  if (irref_isk(ir->op2)) {\n    int32_t k = IR(ir->op2)->i;\n    if (checki16(k)) {\n      emit_tai(as, PPCI_ADDIC, dest, left, k);\n      return;\n    }\n  }\n  right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  emit_tab(as, PPCI_ADDC, dest, left, right);\n}\n\nstatic void asm_sub64(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left, right = ra_alloc1(as, ir->op2, RSET_GPR);\n  PPCIns pi = PPCI_SUBFE;\n  if (irref_isk(ir->op1)) {\n    int32_t k = IR(ir->op1)->i;\n    if (k == 0)\n      pi = PPCI_SUBFZE;\n    else if (k == -1)\n      pi = PPCI_SUBFME;\n    else\n      goto needleft;\n    left = 0;\n  } else {\n  needleft:\n    left = ra_alloc1(as, ir->op1, rset_exclude(RSET_GPR, right));\n  }\n  emit_tab(as, pi, dest, right, left);  /* Subtract right _from_ left. */\n  ir--;\n  dest = ra_dest(as, ir, RSET_GPR);\n  right = ra_alloc1(as, ir->op2, RSET_GPR);\n  if (irref_isk(ir->op1)) {\n    int32_t k = IR(ir->op1)->i;\n    if (checki16(k)) {\n      emit_tai(as, PPCI_SUBFIC, dest, right, k);\n      return;\n    }\n  }\n  left = ra_alloc1(as, ir->op1, rset_exclude(RSET_GPR, right));\n  emit_tab(as, PPCI_SUBFC, dest, right, left);\n}\n\nstatic void asm_neg64(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n  emit_tab(as, PPCI_SUBFZE, dest, left, 0);\n  ir--;\n  dest = ra_dest(as, ir, RSET_GPR);\n  left = ra_alloc1(as, ir->op1, RSET_GPR);\n  emit_tai(as, PPCI_SUBFIC, dest, left, 0);\n}\n#endif\n\nstatic void asm_bitnot(ASMState *as, IRIns *ir)\n{\n  Reg dest, left, right;\n  PPCIns pi = PPCI_NOR;\n  if (as->flagmcp == as->mcp) {\n    as->flagmcp = NULL;\n    as->mcp++;\n    pi |= PPCF_DOT;\n  }\n  dest = ra_dest(as, ir, RSET_GPR);\n  if (mayfuse(as, ir->op1)) {\n    IRIns *irl = IR(ir->op1);\n    if (irl->o == IR_BAND)\n      pi ^= (PPCI_NOR ^ PPCI_NAND);\n    else if (irl->o == IR_BXOR)\n      pi ^= (PPCI_NOR ^ PPCI_EQV);\n    else if (irl->o != IR_BOR)\n      goto nofuse;\n    left = ra_hintalloc(as, irl->op1, dest, RSET_GPR);\n    right = ra_alloc1(as, irl->op2, rset_exclude(RSET_GPR, left));\n  } else {\nnofuse:\n    left = right = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n  }\n  emit_asb(as, pi, dest, left, right);\n}\n\nstatic void asm_bitswap(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  IRIns *irx;\n  if (mayfuse(as, ir->op1) && (irx = IR(ir->op1))->o == IR_XLOAD &&\n      ra_noreg(irx->r) && (irt_isint(irx->t) || irt_isu32(irx->t))) {\n    /* Fuse BSWAP with XLOAD to lwbrx. */\n    asm_fusexrefx(as, PPCI_LWBRX, dest, irx->op1, RSET_GPR);\n  } else {\n    Reg left = ra_alloc1(as, ir->op1, RSET_GPR);\n    Reg tmp = dest;\n    if (tmp == left) {\n      tmp = RID_TMP;\n      emit_mr(as, dest, RID_TMP);\n    }\n    emit_rot(as, PPCI_RLWIMI, tmp, left, 24, 16, 23);\n    emit_rot(as, PPCI_RLWIMI, tmp, left, 24, 0, 7);\n    emit_rotlwi(as, tmp, left, 8);\n  }\n}\n\nstatic void asm_bitop(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pik)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);\n  if (irref_isk(ir->op2)) {\n    int32_t k = IR(ir->op2)->i;\n    Reg tmp = left;\n    if ((checku16(k) || (k & 0xffff) == 0) || (tmp = dest, !as->sectref)) {\n      if (!checku16(k)) {\n\temit_asi(as, pik ^ (PPCI_ORI ^ PPCI_ORIS), dest, tmp, (k >> 16));\n\tif ((k & 0xffff) == 0) return;\n      }\n      emit_asi(as, pik, dest, left, k);\n      return;\n    }\n  }\n  /* May fail due to spills/restores above, but simplifies the logic. */\n  if (as->flagmcp == as->mcp) {\n    as->flagmcp = NULL;\n    as->mcp++;\n    pi |= PPCF_DOT;\n  }\n  right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n  emit_asb(as, pi, dest, left, right);\n}\n\n/* Fuse BAND with contiguous bitmask and a shift to rlwinm. */\nstatic void asm_fuseandsh(ASMState *as, PPCIns pi, int32_t mask, IRRef ref)\n{\n  IRIns *ir;\n  Reg left;\n  if (mayfuse(as, ref) && (ir = IR(ref), ra_noreg(ir->r)) &&\n      irref_isk(ir->op2) && ir->o >= IR_BSHL && ir->o <= IR_BROR) {\n    int32_t sh = (IR(ir->op2)->i & 31);\n    switch (ir->o) {\n    case IR_BSHL:\n      if ((mask & ((1u<<sh)-1))) goto nofuse;\n      break;\n    case IR_BSHR:\n      if ((mask & ~((~0u)>>sh))) goto nofuse;\n      sh = ((32-sh)&31);\n      break;\n    case IR_BROL:\n      break;\n    default:\n      goto nofuse;\n    }\n    left = ra_alloc1(as, ir->op1, RSET_GPR);\n    *--as->mcp = pi | PPCF_T(left) | PPCF_B(sh);\n    return;\n  }\nnofuse:\n  left = ra_alloc1(as, ref, RSET_GPR);\n  *--as->mcp = pi | PPCF_T(left);\n}\n\nstatic void asm_bitand(ASMState *as, IRIns *ir)\n{\n  Reg dest, left, right;\n  IRRef lref = ir->op1;\n  PPCIns dot = 0;\n  IRRef op2;\n  if (as->flagmcp == as->mcp) {\n    as->flagmcp = NULL;\n    as->mcp++;\n    dot = PPCF_DOT;\n  }\n  dest = ra_dest(as, ir, RSET_GPR);\n  if (irref_isk(ir->op2)) {\n    int32_t k = IR(ir->op2)->i;\n    if (k) {\n      /* First check for a contiguous bitmask as used by rlwinm. */\n      uint32_t s1 = lj_ffs((uint32_t)k);\n      uint32_t k1 = ((uint32_t)k >> s1);\n      if ((k1 & (k1+1)) == 0) {\n\tasm_fuseandsh(as, PPCI_RLWINM|dot | PPCF_A(dest) |\n\t\t\t  PPCF_MB(31-lj_fls((uint32_t)k)) | PPCF_ME(31-s1),\n\t\t\t  k, lref);\n\treturn;\n      }\n      if (~(uint32_t)k) {\n\tuint32_t s2 = lj_ffs(~(uint32_t)k);\n\tuint32_t k2 = (~(uint32_t)k >> s2);\n\tif ((k2 & (k2+1)) == 0) {\n\t  asm_fuseandsh(as, PPCI_RLWINM|dot | PPCF_A(dest) |\n\t\t\t    PPCF_MB(32-s2) | PPCF_ME(30-lj_fls(~(uint32_t)k)),\n\t\t\t    k, lref);\n\t  return;\n\t}\n      }\n    }\n    if (checku16(k)) {\n      left = ra_alloc1(as, lref, RSET_GPR);\n      emit_asi(as, PPCI_ANDIDOT, dest, left, k);\n      return;\n    } else if ((k & 0xffff) == 0) {\n      left = ra_alloc1(as, lref, RSET_GPR);\n      emit_asi(as, PPCI_ANDISDOT, dest, left, (k >> 16));\n      return;\n    }\n  }\n  op2 = ir->op2;\n  if (mayfuse(as, op2) && IR(op2)->o == IR_BNOT && ra_noreg(IR(op2)->r)) {\n    dot ^= (PPCI_AND ^ PPCI_ANDC);\n    op2 = IR(op2)->op1;\n  }\n  left = ra_hintalloc(as, lref, dest, RSET_GPR);\n  right = ra_alloc1(as, op2, rset_exclude(RSET_GPR, left));\n  emit_asb(as, PPCI_AND ^ dot, dest, left, right);\n}\n\nstatic void asm_bitshift(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pik)\n{\n  Reg dest, left;\n  Reg dot = 0;\n  if (as->flagmcp == as->mcp) {\n    as->flagmcp = NULL;\n    as->mcp++;\n    dot = PPCF_DOT;\n  }\n  dest = ra_dest(as, ir, RSET_GPR);\n  left = ra_alloc1(as, ir->op1, RSET_GPR);\n  if (irref_isk(ir->op2)) {  /* Constant shifts. */\n    int32_t shift = (IR(ir->op2)->i & 31);\n    if (pik == 0)  /* SLWI */\n      emit_rot(as, PPCI_RLWINM|dot, dest, left, shift, 0, 31-shift);\n    else if (pik == 1)  /* SRWI */\n      emit_rot(as, PPCI_RLWINM|dot, dest, left, (32-shift)&31, shift, 31);\n    else\n      emit_asb(as, pik|dot, dest, left, shift);\n  } else {\n    Reg right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left));\n    emit_asb(as, pi|dot, dest, left, right);\n  }\n}\n\nstatic void asm_min_max(ASMState *as, IRIns *ir, int ismax)\n{\n  if (irt_isnum(ir->t)) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    Reg tmp = dest;\n    Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n    right = (left >> 8); left &= 255;\n    if (tmp == left || tmp == right)\n      tmp = ra_scratch(as, rset_exclude(rset_exclude(rset_exclude(RSET_FPR,\n\t\t\t\t\tdest), left), right));\n    emit_facb(as, PPCI_FSEL, dest, tmp,\n\t      ismax ? left : right, ismax ? right : left);\n    emit_fab(as, PPCI_FSUB, tmp, left, right);\n  } else {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    Reg tmp1 = RID_TMP, tmp2 = dest;\n    Reg right, left = ra_alloc2(as, ir, RSET_GPR);\n    right = (left >> 8); left &= 255;\n    if (tmp2 == left || tmp2 == right)\n      tmp2 = ra_scratch(as, rset_exclude(rset_exclude(rset_exclude(RSET_GPR,\n\t\t\t\t\t dest), left), right));\n    emit_tab(as, PPCI_ADD, dest, tmp2, right);\n    emit_asb(as, ismax ? PPCI_ANDC : PPCI_AND, tmp2, tmp2, tmp1);\n    emit_tab(as, PPCI_SUBFE, tmp1, tmp1, tmp1);\n    emit_tab(as, PPCI_SUBFC, tmp2, tmp2, tmp1);\n    emit_asi(as, PPCI_XORIS, tmp2, right, 0x8000);\n    emit_asi(as, PPCI_XORIS, tmp1, left, 0x8000);\n  }\n}\n\n/* -- Comparisons --------------------------------------------------------- */\n\n#define CC_UNSIGNED\t0x08\t/* Unsigned integer comparison. */\n#define CC_TWO\t\t0x80\t/* Check two flags for FP comparison. */\n\n/* Map of comparisons to flags. ORDER IR. */\nstatic const uint8_t asm_compmap[IR_ABC+1] = {\n  /* op     int cc                 FP cc */\n  /* LT  */ CC_GE               + (CC_GE<<4),\n  /* GE  */ CC_LT               + (CC_LE<<4) + CC_TWO,\n  /* LE  */ CC_GT               + (CC_GE<<4) + CC_TWO,\n  /* GT  */ CC_LE               + (CC_LE<<4),\n  /* ULT */ CC_GE + CC_UNSIGNED + (CC_GT<<4) + CC_TWO,\n  /* UGE */ CC_LT + CC_UNSIGNED + (CC_LT<<4),\n  /* ULE */ CC_GT + CC_UNSIGNED + (CC_GT<<4),\n  /* UGT */ CC_LE + CC_UNSIGNED + (CC_LT<<4) + CC_TWO,\n  /* EQ  */ CC_NE               + (CC_NE<<4),\n  /* NE  */ CC_EQ               + (CC_EQ<<4),\n  /* ABC */ CC_LE + CC_UNSIGNED + (CC_LT<<4) + CC_TWO  /* Same as UGT. */\n};\n\nstatic void asm_intcomp_(ASMState *as, IRRef lref, IRRef rref, Reg cr, PPCCC cc)\n{\n  Reg right, left = ra_alloc1(as, lref, RSET_GPR);\n  if (irref_isk(rref)) {\n    int32_t k = IR(rref)->i;\n    if ((cc & CC_UNSIGNED) == 0) {  /* Signed comparison with constant. */\n      if (checki16(k)) {\n\temit_tai(as, PPCI_CMPWI, cr, left, k);\n\t/* Signed comparison with zero and referencing previous ins? */\n\tif (k == 0 && lref == as->curins-1)\n\t  as->flagmcp = as->mcp;  /* Allow elimination of the compare. */\n\treturn;\n      } else if ((cc & 3) == (CC_EQ & 3)) {  /* Use CMPLWI for EQ or NE. */\n\tif (checku16(k)) {\n\t  emit_tai(as, PPCI_CMPLWI, cr, left, k);\n\t  return;\n\t} else if (!as->sectref && ra_noreg(IR(rref)->r)) {\n\t  emit_tai(as, PPCI_CMPLWI, cr, RID_TMP, k);\n\t  emit_asi(as, PPCI_XORIS, RID_TMP, left, (k >> 16));\n\t  return;\n\t}\n      }\n    } else {  /* Unsigned comparison with constant. */\n      if (checku16(k)) {\n\temit_tai(as, PPCI_CMPLWI, cr, left, k);\n\treturn;\n      }\n    }\n  }\n  right = ra_alloc1(as, rref, rset_exclude(RSET_GPR, left));\n  emit_tab(as, (cc & CC_UNSIGNED) ? PPCI_CMPLW : PPCI_CMPW, cr, left, right);\n}\n\nstatic void asm_comp(ASMState *as, IRIns *ir)\n{\n  PPCCC cc = asm_compmap[ir->o];\n  if (irt_isnum(ir->t)) {\n    Reg right, left = ra_alloc2(as, ir, RSET_FPR);\n    right = (left >> 8); left &= 255;\n    asm_guardcc(as, (cc >> 4));\n    if ((cc & CC_TWO))\n      emit_tab(as, PPCI_CROR, ((cc>>4)&3), ((cc>>4)&3), (CC_EQ&3));\n    emit_fab(as, PPCI_FCMPU, 0, left, right);\n  } else {\n    IRRef lref = ir->op1, rref = ir->op2;\n    if (irref_isk(lref) && !irref_isk(rref)) {\n      /* Swap constants to the right (only for ABC). */\n      IRRef tmp = lref; lref = rref; rref = tmp;\n      if ((cc & 2) == 0) cc ^= 1;  /* LT <-> GT, LE <-> GE */\n    }\n    asm_guardcc(as, cc);\n    asm_intcomp_(as, lref, rref, 0, cc);\n  }\n}\n\n#if LJ_HASFFI\n/* 64 bit integer comparisons. */\nstatic void asm_comp64(ASMState *as, IRIns *ir)\n{\n  PPCCC cc = asm_compmap[(ir-1)->o];\n  if ((cc&3) == (CC_EQ&3)) {\n    asm_guardcc(as, cc);\n    emit_tab(as, (cc&4) ? PPCI_CRAND : PPCI_CROR,\n\t     (CC_EQ&3), (CC_EQ&3), 4+(CC_EQ&3));\n  } else {\n    asm_guardcc(as, CC_EQ);\n    emit_tab(as, PPCI_CROR, (CC_EQ&3), (CC_EQ&3), ((cc^~(cc>>2))&1));\n    emit_tab(as, (cc&4) ? PPCI_CRAND : PPCI_CRANDC,\n\t     (CC_EQ&3), (CC_EQ&3), 4+(cc&3));\n  }\n  /* Loword comparison sets cr1 and is unsigned, except for equality. */\n  asm_intcomp_(as, (ir-1)->op1, (ir-1)->op2, 4,\n\t       cc | ((cc&3) == (CC_EQ&3) ? 0 : CC_UNSIGNED));\n  /* Hiword comparison sets cr0. */\n  asm_intcomp_(as, ir->op1, ir->op2, 0, cc);\n  as->flagmcp = NULL;  /* Doesn't work here. */\n}\n#endif\n\n/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */\n\n/* Hiword op of a split 64 bit op. Previous op must be the loword op. */\nstatic void asm_hiop(ASMState *as, IRIns *ir)\n{\n#if LJ_HASFFI\n  /* HIOP is marked as a store because it needs its own DCE logic. */\n  int uselo = ra_used(ir-1), usehi = ra_used(ir);  /* Loword/hiword used? */\n  if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1;\n  if ((ir-1)->o == IR_CONV) {  /* Conversions to/from 64 bit. */\n    as->curins--;  /* Always skip the CONV. */\n    if (usehi || uselo)\n      asm_conv64(as, ir);\n    return;\n  } else if ((ir-1)->o <= IR_NE) {  /* 64 bit integer comparisons. ORDER IR. */\n    as->curins--;  /* Always skip the loword comparison. */\n    asm_comp64(as, ir);\n    return;\n  } else if ((ir-1)->o == IR_XSTORE) {\n    as->curins--;  /* Handle both stores here. */\n    if ((ir-1)->r != RID_SINK) {\n      asm_xstore(as, ir, 0);\n      asm_xstore(as, ir-1, 4);\n    }\n    return;\n  }\n  if (!usehi) return;  /* Skip unused hiword op for all remaining ops. */\n  switch ((ir-1)->o) {\n  case IR_ADD: as->curins--; asm_add64(as, ir); break;\n  case IR_SUB: as->curins--; asm_sub64(as, ir); break;\n  case IR_NEG: as->curins--; asm_neg64(as, ir); break;\n  case IR_CALLN:\n  case IR_CALLXS:\n    if (!uselo)\n      ra_allocref(as, ir->op1, RID2RSET(RID_RETLO));  /* Mark lo op as used. */\n    break;\n  case IR_CNEWI:\n    /* Nothing to do here. Handled by lo op itself. */\n    break;\n  default: lua_assert(0); break;\n  }\n#else\n  UNUSED(as); UNUSED(ir); lua_assert(0);  /* Unused without FFI. */\n#endif\n}\n\n/* -- Stack handling ------------------------------------------------------ */\n\n/* Check Lua stack size for overflow. Use exit handler as fallback. */\nstatic void asm_stack_check(ASMState *as, BCReg topslot,\n\t\t\t    IRIns *irp, RegSet allow, ExitNo exitno)\n{\n  /* Try to get an unused temp. register, otherwise spill/restore RID_RET*. */\n  Reg tmp, pbase = irp ? (ra_hasreg(irp->r) ? irp->r : RID_TMP) : RID_BASE;\n  rset_clear(allow, pbase);\n  tmp = allow ? rset_pickbot(allow) :\n\t\t(pbase == RID_RETHI ? RID_RETLO : RID_RETHI);\n  emit_condbranch(as, PPCI_BC, CC_LT, asm_exitstub_addr(as, exitno));\n  if (allow == RSET_EMPTY)  /* Restore temp. register. */\n    emit_tai(as, PPCI_LWZ, tmp, RID_SP, SPOFS_TMPW);\n  else\n    ra_modified(as, tmp);\n  emit_ai(as, PPCI_CMPLWI, RID_TMP, (int32_t)(8*topslot));\n  emit_tab(as, PPCI_SUBF, RID_TMP, pbase, tmp);\n  emit_tai(as, PPCI_LWZ, tmp, tmp, offsetof(lua_State, maxstack));\n  if (pbase == RID_TMP)\n    emit_getgl(as, RID_TMP, jit_base);\n  emit_getgl(as, tmp, jit_L);\n  if (allow == RSET_EMPTY)  /* Spill temp. register. */\n    emit_tai(as, PPCI_STW, tmp, RID_SP, SPOFS_TMPW);\n}\n\n/* Restore Lua stack from on-trace state. */\nstatic void asm_stack_restore(ASMState *as, SnapShot *snap)\n{\n  SnapEntry *map = &as->T->snapmap[snap->mapofs];\n  SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1];\n  MSize n, nent = snap->nent;\n  /* Store the value of all modified slots to the Lua stack. */\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    BCReg s = snap_slot(sn);\n    int32_t ofs = 8*((int32_t)s-1);\n    IRRef ref = snap_ref(sn);\n    IRIns *ir = IR(ref);\n    if ((sn & SNAP_NORESTORE))\n      continue;\n    if (irt_isnum(ir->t)) {\n      Reg src = ra_alloc1(as, ref, RSET_FPR);\n      emit_fai(as, PPCI_STFD, src, RID_BASE, ofs);\n    } else {\n      Reg type;\n      RegSet allow = rset_exclude(RSET_GPR, RID_BASE);\n      lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) || irt_isinteger(ir->t));\n      if (!irt_ispri(ir->t)) {\n\tReg src = ra_alloc1(as, ref, allow);\n\trset_clear(allow, src);\n\temit_tai(as, PPCI_STW, src, RID_BASE, ofs+4);\n      }\n      if ((sn & (SNAP_CONT|SNAP_FRAME))) {\n\tif (s == 0) continue;  /* Do not overwrite link to previous frame. */\n\ttype = ra_allock(as, (int32_t)(*flinks--), allow);\n      } else {\n\ttype = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);\n      }\n      emit_tai(as, PPCI_STW, type, RID_BASE, ofs);\n    }\n    checkmclim(as);\n  }\n  lua_assert(map + nent == flinks);\n}\n\n/* -- GC handling --------------------------------------------------------- */\n\n/* Check GC threshold and do one or more GC steps. */\nstatic void asm_gc_check(ASMState *as)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg tmp;\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */\n  asm_guardcc(as, CC_NE);  /* Assumes asm_snap_prep() already done. */\n  emit_ai(as, PPCI_CMPWI, RID_RET, 0);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ASMREF_TMP2;  /* MSize steps     */\n  asm_gencall(as, ci, args);\n  emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768);\n  tmp = ra_releasetmp(as, ASMREF_TMP2);\n  emit_loadi(as, tmp, as->gcsteps);\n  /* Jump around GC step if GC total < GC threshold. */\n  emit_condbranch(as, PPCI_BC|PPCF_Y, CC_LT, l_end);\n  emit_ab(as, PPCI_CMPLW, RID_TMP, tmp);\n  emit_getgl(as, tmp, gc.threshold);\n  emit_getgl(as, RID_TMP, gc.total);\n  as->gcsteps = 0;\n  checkmclim(as);\n}\n\n/* -- Loop handling ------------------------------------------------------- */\n\n/* Fixup the loop branch. */\nstatic void asm_loop_fixup(ASMState *as)\n{\n  MCode *p = as->mctop;\n  MCode *target = as->mcp;\n  if (as->loopinv) {  /* Inverted loop branch? */\n    /* asm_guardcc already inverted the cond branch and patched the final b. */\n    p[-2] = (p[-2] & (0xffff0000u & ~PPCF_Y)) | (((target-p+2) & 0x3fffu) << 2);\n  } else {\n    p[-1] = PPCI_B|(((target-p+1)&0x00ffffffu)<<2);\n  }\n}\n\n/* -- Head of trace ------------------------------------------------------- */\n\n/* Coalesce BASE register for a root trace. */\nstatic void asm_head_root_base(ASMState *as)\n{\n  IRIns *ir = IR(REF_BASE);\n  Reg r = ir->r;\n  if (ra_hasreg(r)) {\n    ra_free(as, r);\n    if (rset_test(as->modset, r))\n      ir->r = RID_INIT;  /* No inheritance for modified BASE register. */\n    if (r != RID_BASE)\n      emit_mr(as, r, RID_BASE);\n  }\n}\n\n/* Coalesce BASE register for a side trace. */\nstatic RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)\n{\n  IRIns *ir = IR(REF_BASE);\n  Reg r = ir->r;\n  if (ra_hasreg(r)) {\n    ra_free(as, r);\n    if (rset_test(as->modset, r))\n      ir->r = RID_INIT;  /* No inheritance for modified BASE register. */\n    if (irp->r == r) {\n      rset_clear(allow, r);  /* Mark same BASE register as coalesced. */\n    } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) {\n      rset_clear(allow, irp->r);\n      emit_mr(as, r, irp->r);  /* Move from coalesced parent reg. */\n    } else {\n      emit_getgl(as, r, jit_base);  /* Otherwise reload BASE. */\n    }\n  }\n  return allow;\n}\n\n/* -- Tail of trace ------------------------------------------------------- */\n\n/* Fixup the tail code. */\nstatic void asm_tail_fixup(ASMState *as, TraceNo lnk)\n{\n  MCode *p = as->mctop;\n  MCode *target;\n  int32_t spadj = as->T->spadjust;\n  if (spadj == 0) {\n    *--p = PPCI_NOP;\n    *--p = PPCI_NOP;\n    as->mctop = p;\n  } else {\n    /* Patch stack adjustment. */\n    lua_assert(checki16(CFRAME_SIZE+spadj));\n    p[-3] = PPCI_ADDI | PPCF_T(RID_TMP) | PPCF_A(RID_SP) | (CFRAME_SIZE+spadj);\n    p[-2] = PPCI_STWU | PPCF_T(RID_TMP) | PPCF_A(RID_SP) | spadj;\n  }\n  /* Patch exit branch. */\n  target = lnk ? traceref(as->J, lnk)->mcode : (MCode *)lj_vm_exit_interp;\n  p[-1] = PPCI_B|(((target-p+1)&0x00ffffffu)<<2);\n}\n\n/* Prepare tail of code. */\nstatic void asm_tail_prep(ASMState *as)\n{\n  MCode *p = as->mctop - 1;  /* Leave room for exit branch. */\n  if (as->loopref) {\n    as->invmcp = as->mcp = p;\n  } else {\n    as->mcp = p-2;  /* Leave room for stack pointer adjustment. */\n    as->invmcp = NULL;\n  }\n}\n\n/* -- Instruction dispatch ------------------------------------------------ */\n\n/* Assemble a single instruction. */\nstatic void asm_ir(ASMState *as, IRIns *ir)\n{\n  switch ((IROp)ir->o) {\n  /* Miscellaneous ops. */\n  case IR_LOOP: asm_loop(as); break;\n  case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break;\n  case IR_USE:\n    ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break;\n  case IR_PHI: asm_phi(as, ir); break;\n  case IR_HIOP: asm_hiop(as, ir); break;\n  case IR_GCSTEP: asm_gcstep(as, ir); break;\n\n  /* Guarded assertions. */\n  case IR_EQ: case IR_NE:\n    if ((ir-1)->o == IR_HREF && ir->op1 == as->curins-1) {\n      as->curins--;\n      asm_href(as, ir-1, (IROp)ir->o);\n      break;\n    }\n    /* fallthrough */\n  case IR_LT: case IR_GE: case IR_LE: case IR_GT:\n  case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT:\n  case IR_ABC:\n    asm_comp(as, ir);\n    break;\n\n  case IR_RETF: asm_retf(as, ir); break;\n\n  /* Bit ops. */\n  case IR_BNOT: asm_bitnot(as, ir); break;\n  case IR_BSWAP: asm_bitswap(as, ir); break;\n\n  case IR_BAND: asm_bitand(as, ir); break;\n  case IR_BOR:  asm_bitop(as, ir, PPCI_OR, PPCI_ORI); break;\n  case IR_BXOR: asm_bitop(as, ir, PPCI_XOR, PPCI_XORI); break;\n\n  case IR_BSHL: asm_bitshift(as, ir, PPCI_SLW, 0); break;\n  case IR_BSHR: asm_bitshift(as, ir, PPCI_SRW, 1); break;\n  case IR_BSAR: asm_bitshift(as, ir, PPCI_SRAW, PPCI_SRAWI); break;\n  case IR_BROL: asm_bitshift(as, ir, PPCI_RLWNM|PPCF_MB(0)|PPCF_ME(31),\n\t\t\t     PPCI_RLWINM|PPCF_MB(0)|PPCF_ME(31)); break;\n  case IR_BROR: lua_assert(0); break;\n\n  /* Arithmetic ops. */\n  case IR_ADD: asm_add(as, ir); break;\n  case IR_SUB: asm_sub(as, ir); break;\n  case IR_MUL: asm_mul(as, ir); break;\n  case IR_DIV: asm_fparith(as, ir, PPCI_FDIV); break;\n  case IR_MOD: asm_callid(as, ir, IRCALL_lj_vm_modi); break;\n  case IR_POW: asm_callid(as, ir, IRCALL_lj_vm_powi); break;\n  case IR_NEG: asm_neg(as, ir); break;\n\n  case IR_ABS: asm_fpunary(as, ir, PPCI_FABS); break;\n  case IR_ATAN2: asm_callid(as, ir, IRCALL_atan2); break;\n  case IR_LDEXP: asm_callid(as, ir, IRCALL_ldexp); break;\n  case IR_MIN: asm_min_max(as, ir, 0); break;\n  case IR_MAX: asm_min_max(as, ir, 1); break;\n  case IR_FPMATH:\n    if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir))\n      break;\n    if (ir->op2 == IRFPM_SQRT && (as->flags & JIT_F_SQRT))\n      asm_fpunary(as, ir, PPCI_FSQRT);\n    else\n      asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);\n    break;\n\n  /* Overflow-checking arithmetic ops. */\n  case IR_ADDOV: asm_arithov(as, ir, PPCI_ADDO); break;\n  case IR_SUBOV: asm_arithov(as, ir, PPCI_SUBFO); break;\n  case IR_MULOV: asm_arithov(as, ir, PPCI_MULLWO); break;\n\n  /* Memory references. */\n  case IR_AREF: asm_aref(as, ir); break;\n  case IR_HREF: asm_href(as, ir, 0); break;\n  case IR_HREFK: asm_hrefk(as, ir); break;\n  case IR_NEWREF: asm_newref(as, ir); break;\n  case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break;\n  case IR_FREF: asm_fref(as, ir); break;\n  case IR_STRREF: asm_strref(as, ir); break;\n\n  /* Loads and stores. */\n  case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n    asm_ahuvload(as, ir);\n    break;\n  case IR_FLOAD: asm_fload(as, ir); break;\n  case IR_XLOAD: asm_xload(as, ir); break;\n  case IR_SLOAD: asm_sload(as, ir); break;\n\n  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break;\n  case IR_FSTORE: asm_fstore(as, ir); break;\n  case IR_XSTORE: asm_xstore(as, ir, 0); break;\n\n  /* Allocations. */\n  case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break;\n  case IR_TNEW: asm_tnew(as, ir); break;\n  case IR_TDUP: asm_tdup(as, ir); break;\n  case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break;\n\n  /* Write barriers. */\n  case IR_TBAR: asm_tbar(as, ir); break;\n  case IR_OBAR: asm_obar(as, ir); break;\n\n  /* Type conversions. */\n  case IR_CONV: asm_conv(as, ir); break;\n  case IR_TOBIT: asm_tobit(as, ir); break;\n  case IR_TOSTR: asm_tostr(as, ir); break;\n  case IR_STRTO: asm_strto(as, ir); break;\n\n  /* Calls. */\n  case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break;\n  case IR_CALLXS: asm_callx(as, ir); break;\n  case IR_CARG: break;\n\n  default:\n    setintV(&as->J->errinfo, ir->o);\n    lj_trace_err_info(as->J, LJ_TRERR_NYIIR);\n    break;\n  }\n}\n\n/* -- Trace setup --------------------------------------------------------- */\n\n/* Ensure there are enough stack slots for call arguments. */\nstatic Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  IRRef args[CCI_NARGS_MAX];\n  uint32_t i, nargs = (int)CCI_NARGS(ci);\n  int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;\n  asm_collectargs(as, ir, ci, args);\n  for (i = 0; i < nargs; i++)\n    if (args[i] && irt_isfp(IR(args[i])->t)) {\n      if (nfpr > 0) nfpr--; else nslots = (nslots+3) & ~1;\n    } else {\n      if (ngpr > 0) ngpr--; else nslots++;\n    }\n  if (nslots > as->evenspill)  /* Leave room for args in stack slots. */\n    as->evenspill = nslots;\n  return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET);\n}\n\nstatic void asm_setup_target(ASMState *as)\n{\n  asm_exitstub_setup(as, as->T->nsnap + (as->parent ? 1 : 0));\n}\n\n/* -- Trace patching ------------------------------------------------------ */\n\n/* Patch exit jumps of existing machine code to a new target. */\nvoid lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target)\n{\n  MCode *p = T->mcode;\n  MCode *pe = (MCode *)((char *)p + T->szmcode);\n  MCode *px = exitstub_trace_addr(T, exitno);\n  MCode *cstart = NULL;\n  MCode *mcarea = lj_mcode_patch(J, p, 0);\n  int clearso = 0;\n  for (; p < pe; p++) {\n    /* Look for exitstub branch, try to replace with branch to target. */\n    uint32_t ins = *p;\n    if ((ins & 0xfc000000u) == 0x40000000u &&\n\t((ins ^ ((char *)px-(char *)p)) & 0xffffu) == 0) {\n      ptrdiff_t delta = (char *)target - (char *)p;\n      if (((ins >> 16) & 3) == (CC_SO&3)) {\n\tclearso = sizeof(MCode);\n\tdelta -= sizeof(MCode);\n      }\n      /* Many, but not all short-range branches can be patched directly. */\n      if (((delta + 0x8000) >> 16) == 0) {\n\t*p = (ins & 0xffdf0000u) | ((uint32_t)delta & 0xffffu) |\n\t     ((delta & 0x8000) * (PPCF_Y/0x8000));\n\tif (!cstart) cstart = p;\n      }\n    } else if ((ins & 0xfc000000u) == PPCI_B &&\n\t       ((ins ^ ((char *)px-(char *)p)) & 0x03ffffffu) == 0) {\n      ptrdiff_t delta = (char *)target - (char *)p;\n      lua_assert(((delta + 0x02000000) >> 26) == 0);\n      *p = PPCI_B | ((uint32_t)delta & 0x03ffffffu);\n      if (!cstart) cstart = p;\n    }\n  }\n  {  /* Always patch long-range branch in exit stub itself. */\n    ptrdiff_t delta = (char *)target - (char *)px - clearso;\n    lua_assert(((delta + 0x02000000) >> 26) == 0);\n    *px = PPCI_B | ((uint32_t)delta & 0x03ffffffu);\n  }\n  if (!cstart) cstart = px;\n  lj_mcode_sync(cstart, px+1);\n  if (clearso) {  /* Extend the current trace. Ugly workaround. */\n    MCode *pp = J->cur.mcode;\n    J->cur.szmcode += sizeof(MCode);\n    *--pp = PPCI_MCRXR;  /* Clear SO flag. */\n    J->cur.mcode = pp;\n    lj_mcode_sync(pp, pp+1);\n  }\n  lj_mcode_patch(J, mcarea, 1);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_asm_x86.h",
    "content": "/*\n** x86/x64 IR assembler (SSA IR -> machine code).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Guard handling ------------------------------------------------------ */\n\n/* Generate an exit stub group at the bottom of the reserved MCode memory. */\nstatic MCode *asm_exitstub_gen(ASMState *as, ExitNo group)\n{\n  ExitNo i, groupofs = (group*EXITSTUBS_PER_GROUP) & 0xff;\n  MCode *mxp = as->mcbot;\n  MCode *mxpstart = mxp;\n  if (mxp + (2+2)*EXITSTUBS_PER_GROUP+8+5 >= as->mctop)\n    asm_mclimit(as);\n  /* Push low byte of exitno for each exit stub. */\n  *mxp++ = XI_PUSHi8; *mxp++ = (MCode)groupofs;\n  for (i = 1; i < EXITSTUBS_PER_GROUP; i++) {\n    *mxp++ = XI_JMPs; *mxp++ = (MCode)((2+2)*(EXITSTUBS_PER_GROUP - i) - 2);\n    *mxp++ = XI_PUSHi8; *mxp++ = (MCode)(groupofs + i);\n  }\n  /* Push the high byte of the exitno for each exit stub group. */\n  *mxp++ = XI_PUSHi8; *mxp++ = (MCode)((group*EXITSTUBS_PER_GROUP)>>8);\n  /* Store DISPATCH at original stack slot 0. Account for the two push ops. */\n  *mxp++ = XI_MOVmi;\n  *mxp++ = MODRM(XM_OFS8, 0, RID_ESP);\n  *mxp++ = MODRM(XM_SCALE1, RID_ESP, RID_ESP);\n  *mxp++ = 2*sizeof(void *);\n  *(int32_t *)mxp = ptr2addr(J2GG(as->J)->dispatch); mxp += 4;\n  /* Jump to exit handler which fills in the ExitState. */\n  *mxp++ = XI_JMP; mxp += 4;\n  *((int32_t *)(mxp-4)) = jmprel(mxp, (MCode *)(void *)lj_vm_exit_handler);\n  /* Commit the code for this group (even if assembly fails later on). */\n  lj_mcode_commitbot(as->J, mxp);\n  as->mcbot = mxp;\n  as->mclim = as->mcbot + MCLIM_REDZONE;\n  return mxpstart;\n}\n\n/* Setup all needed exit stubs. */\nstatic void asm_exitstub_setup(ASMState *as, ExitNo nexits)\n{\n  ExitNo i;\n  if (nexits >= EXITSTUBS_PER_GROUP*LJ_MAX_EXITSTUBGR)\n    lj_trace_err(as->J, LJ_TRERR_SNAPOV);\n  for (i = 0; i < (nexits+EXITSTUBS_PER_GROUP-1)/EXITSTUBS_PER_GROUP; i++)\n    if (as->J->exitstubgroup[i] == NULL)\n      as->J->exitstubgroup[i] = asm_exitstub_gen(as, i);\n}\n\n/* Emit conditional branch to exit for guard.\n** It's important to emit this *after* all registers have been allocated,\n** because rematerializations may invalidate the flags.\n*/\nstatic void asm_guardcc(ASMState *as, int cc)\n{\n  MCode *target = exitstub_addr(as->J, as->snapno);\n  MCode *p = as->mcp;\n  if (LJ_UNLIKELY(p == as->invmcp)) {\n    as->loopinv = 1;\n    *(int32_t *)(p+1) = jmprel(p+5, target);\n    target = p;\n    cc ^= 1;\n    if (as->realign) {\n      emit_sjcc(as, cc, target);\n      return;\n    }\n  }\n  emit_jcc(as, cc, target);\n}\n\n/* -- Memory operand fusion ----------------------------------------------- */\n\n/* Limit linear search to this distance. Avoids O(n^2) behavior. */\n#define CONFLICT_SEARCH_LIM\t31\n\n/* Check if a reference is a signed 32 bit constant. */\nstatic int asm_isk32(ASMState *as, IRRef ref, int32_t *k)\n{\n  if (irref_isk(ref)) {\n    IRIns *ir = IR(ref);\n    if (ir->o != IR_KINT64) {\n      *k = ir->i;\n      return 1;\n    } else if (checki32((int64_t)ir_kint64(ir)->u64)) {\n      *k = (int32_t)ir_kint64(ir)->u64;\n      return 1;\n    }\n  }\n  return 0;\n}\n\n/* Check if there's no conflicting instruction between curins and ref.\n** Also avoid fusing loads if there are multiple references.\n*/\nstatic int noconflict(ASMState *as, IRRef ref, IROp conflict, int noload)\n{\n  IRIns *ir = as->ir;\n  IRRef i = as->curins;\n  if (i > ref + CONFLICT_SEARCH_LIM)\n    return 0;  /* Give up, ref is too far away. */\n  while (--i > ref) {\n    if (ir[i].o == conflict)\n      return 0;  /* Conflict found. */\n    else if (!noload && (ir[i].op1 == ref || ir[i].op2 == ref))\n      return 0;\n  }\n  return 1;  /* Ok, no conflict. */\n}\n\n/* Fuse array base into memory operand. */\nstatic IRRef asm_fuseabase(ASMState *as, IRRef ref)\n{\n  IRIns *irb = IR(ref);\n  as->mrm.ofs = 0;\n  if (irb->o == IR_FLOAD) {\n    IRIns *ira = IR(irb->op1);\n    lua_assert(irb->op2 == IRFL_TAB_ARRAY);\n    /* We can avoid the FLOAD of t->array for colocated arrays. */\n    if (ira->o == IR_TNEW && ira->op1 <= LJ_MAX_COLOSIZE &&\n\t!neverfuse(as) && noconflict(as, irb->op1, IR_NEWREF, 1)) {\n      as->mrm.ofs = (int32_t)sizeof(GCtab);  /* Ofs to colocated array. */\n      return irb->op1;  /* Table obj. */\n    }\n  } else if (irb->o == IR_ADD && irref_isk(irb->op2)) {\n    /* Fuse base offset (vararg load). */\n    as->mrm.ofs = IR(irb->op2)->i;\n    return irb->op1;\n  }\n  return ref;  /* Otherwise use the given array base. */\n}\n\n/* Fuse array reference into memory operand. */\nstatic void asm_fusearef(ASMState *as, IRIns *ir, RegSet allow)\n{\n  IRIns *irx;\n  lua_assert(ir->o == IR_AREF);\n  as->mrm.base = (uint8_t)ra_alloc1(as, asm_fuseabase(as, ir->op1), allow);\n  irx = IR(ir->op2);\n  if (irref_isk(ir->op2)) {\n    as->mrm.ofs += 8*irx->i;\n    as->mrm.idx = RID_NONE;\n  } else {\n    rset_clear(allow, as->mrm.base);\n    as->mrm.scale = XM_SCALE8;\n    /* Fuse a constant ADD (e.g. t[i+1]) into the offset.\n    ** Doesn't help much without ABCelim, but reduces register pressure.\n    */\n    if (!LJ_64 &&  /* Has bad effects with negative index on x64. */\n\tmayfuse(as, ir->op2) && ra_noreg(irx->r) &&\n\tirx->o == IR_ADD && irref_isk(irx->op2)) {\n      as->mrm.ofs += 8*IR(irx->op2)->i;\n      as->mrm.idx = (uint8_t)ra_alloc1(as, irx->op1, allow);\n    } else {\n      as->mrm.idx = (uint8_t)ra_alloc1(as, ir->op2, allow);\n    }\n  }\n}\n\n/* Fuse array/hash/upvalue reference into memory operand.\n** Caveat: this may allocate GPRs for the base/idx registers. Be sure to\n** pass the final allow mask, excluding any GPRs used for other inputs.\n** In particular: 2-operand GPR instructions need to call ra_dest() first!\n*/\nstatic void asm_fuseahuref(ASMState *as, IRRef ref, RegSet allow)\n{\n  IRIns *ir = IR(ref);\n  if (ra_noreg(ir->r)) {\n    switch ((IROp)ir->o) {\n    case IR_AREF:\n      if (mayfuse(as, ref)) {\n\tasm_fusearef(as, ir, allow);\n\treturn;\n      }\n      break;\n    case IR_HREFK:\n      if (mayfuse(as, ref)) {\n\tas->mrm.base = (uint8_t)ra_alloc1(as, ir->op1, allow);\n\tas->mrm.ofs = (int32_t)(IR(ir->op2)->op2 * sizeof(Node));\n\tas->mrm.idx = RID_NONE;\n\treturn;\n      }\n      break;\n    case IR_UREFC:\n      if (irref_isk(ir->op1)) {\n\tGCfunc *fn = ir_kfunc(IR(ir->op1));\n\tGCupval *uv = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv;\n\tas->mrm.ofs = ptr2addr(&uv->tv);\n\tas->mrm.base = as->mrm.idx = RID_NONE;\n\treturn;\n      }\n      break;\n    default:\n      lua_assert(ir->o == IR_HREF || ir->o == IR_NEWREF || ir->o == IR_UREFO ||\n\t\t ir->o == IR_KKPTR);\n      break;\n    }\n  }\n  as->mrm.base = (uint8_t)ra_alloc1(as, ref, allow);\n  as->mrm.ofs = 0;\n  as->mrm.idx = RID_NONE;\n}\n\n/* Fuse FLOAD/FREF reference into memory operand. */\nstatic void asm_fusefref(ASMState *as, IRIns *ir, RegSet allow)\n{\n  lua_assert(ir->o == IR_FLOAD || ir->o == IR_FREF);\n  as->mrm.ofs = field_ofs[ir->op2];\n  as->mrm.idx = RID_NONE;\n  if (irref_isk(ir->op1)) {\n    as->mrm.ofs += IR(ir->op1)->i;\n    as->mrm.base = RID_NONE;\n  } else {\n    as->mrm.base = (uint8_t)ra_alloc1(as, ir->op1, allow);\n  }\n}\n\n/* Fuse string reference into memory operand. */\nstatic void asm_fusestrref(ASMState *as, IRIns *ir, RegSet allow)\n{\n  IRIns *irr;\n  lua_assert(ir->o == IR_STRREF);\n  as->mrm.base = as->mrm.idx = RID_NONE;\n  as->mrm.scale = XM_SCALE1;\n  as->mrm.ofs = sizeof(GCstr);\n  if (irref_isk(ir->op1)) {\n    as->mrm.ofs += IR(ir->op1)->i;\n  } else {\n    Reg r = ra_alloc1(as, ir->op1, allow);\n    rset_clear(allow, r);\n    as->mrm.base = (uint8_t)r;\n  }\n  irr = IR(ir->op2);\n  if (irref_isk(ir->op2)) {\n    as->mrm.ofs += irr->i;\n  } else {\n    Reg r;\n    /* Fuse a constant add into the offset, e.g. string.sub(s, i+10). */\n    if (!LJ_64 &&  /* Has bad effects with negative index on x64. */\n\tmayfuse(as, ir->op2) && irr->o == IR_ADD && irref_isk(irr->op2)) {\n      as->mrm.ofs += IR(irr->op2)->i;\n      r = ra_alloc1(as, irr->op1, allow);\n    } else {\n      r = ra_alloc1(as, ir->op2, allow);\n    }\n    if (as->mrm.base == RID_NONE)\n      as->mrm.base = (uint8_t)r;\n    else\n      as->mrm.idx = (uint8_t)r;\n  }\n}\n\nstatic void asm_fusexref(ASMState *as, IRRef ref, RegSet allow)\n{\n  IRIns *ir = IR(ref);\n  as->mrm.idx = RID_NONE;\n  if (ir->o == IR_KPTR || ir->o == IR_KKPTR) {\n    as->mrm.ofs = ir->i;\n    as->mrm.base = RID_NONE;\n  } else if (ir->o == IR_STRREF) {\n    asm_fusestrref(as, ir, allow);\n  } else {\n    as->mrm.ofs = 0;\n    if (canfuse(as, ir) && ir->o == IR_ADD && ra_noreg(ir->r)) {\n      /* Gather (base+idx*sz)+ofs as emitted by cdata ptr/array indexing. */\n      IRIns *irx;\n      IRRef idx;\n      Reg r;\n      if (asm_isk32(as, ir->op2, &as->mrm.ofs)) {  /* Recognize x+ofs. */\n\tref = ir->op1;\n\tir = IR(ref);\n\tif (!(ir->o == IR_ADD && canfuse(as, ir) && ra_noreg(ir->r)))\n\t  goto noadd;\n      }\n      as->mrm.scale = XM_SCALE1;\n      idx = ir->op1;\n      ref = ir->op2;\n      irx = IR(idx);\n      if (!(irx->o == IR_BSHL || irx->o == IR_ADD)) {  /* Try other operand. */\n\tidx = ir->op2;\n\tref = ir->op1;\n\tirx = IR(idx);\n      }\n      if (canfuse(as, irx) && ra_noreg(irx->r)) {\n\tif (irx->o == IR_BSHL && irref_isk(irx->op2) && IR(irx->op2)->i <= 3) {\n\t  /* Recognize idx<<b with b = 0-3, corresponding to sz = (1),2,4,8. */\n\t  idx = irx->op1;\n\t  as->mrm.scale = (uint8_t)(IR(irx->op2)->i << 6);\n\t} else if (irx->o == IR_ADD && irx->op1 == irx->op2) {\n\t  /* FOLD does idx*2 ==> idx<<1 ==> idx+idx. */\n\t  idx = irx->op1;\n\t  as->mrm.scale = XM_SCALE2;\n\t}\n      }\n      r = ra_alloc1(as, idx, allow);\n      rset_clear(allow, r);\n      as->mrm.idx = (uint8_t)r;\n    }\n  noadd:\n    as->mrm.base = (uint8_t)ra_alloc1(as, ref, allow);\n  }\n}\n\n/* Fuse load into memory operand. */\nstatic Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow)\n{\n  IRIns *ir = IR(ref);\n  if (ra_hasreg(ir->r)) {\n    if (allow != RSET_EMPTY) {  /* Fast path. */\n      ra_noweak(as, ir->r);\n      return ir->r;\n    }\n  fusespill:\n    /* Force a spill if only memory operands are allowed (asm_x87load). */\n    as->mrm.base = RID_ESP;\n    as->mrm.ofs = ra_spill(as, ir);\n    as->mrm.idx = RID_NONE;\n    return RID_MRM;\n  }\n  if (ir->o == IR_KNUM) {\n    RegSet avail = as->freeset & ~as->modset & RSET_FPR;\n    lua_assert(allow != RSET_EMPTY);\n    if (!(avail & (avail-1))) {  /* Fuse if less than two regs available. */\n      as->mrm.ofs = ptr2addr(ir_knum(ir));\n      as->mrm.base = as->mrm.idx = RID_NONE;\n      return RID_MRM;\n    }\n  } else if (mayfuse(as, ref)) {\n    RegSet xallow = (allow & RSET_GPR) ? allow : RSET_GPR;\n    if (ir->o == IR_SLOAD) {\n      if (!(ir->op2 & (IRSLOAD_PARENT|IRSLOAD_CONVERT)) &&\n\t  noconflict(as, ref, IR_RETF, 0)) {\n\tas->mrm.base = (uint8_t)ra_alloc1(as, REF_BASE, xallow);\n\tas->mrm.ofs = 8*((int32_t)ir->op1-1) + ((ir->op2&IRSLOAD_FRAME)?4:0);\n\tas->mrm.idx = RID_NONE;\n\treturn RID_MRM;\n      }\n    } else if (ir->o == IR_FLOAD) {\n      /* Generic fusion is only ok for 32 bit operand (but see asm_comp). */\n      if ((irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t)) &&\n\t  noconflict(as, ref, IR_FSTORE, 0)) {\n\tasm_fusefref(as, ir, xallow);\n\treturn RID_MRM;\n      }\n    } else if (ir->o == IR_ALOAD || ir->o == IR_HLOAD || ir->o == IR_ULOAD) {\n      if (noconflict(as, ref, ir->o + IRDELTA_L2S, 0)) {\n\tasm_fuseahuref(as, ir->op1, xallow);\n\treturn RID_MRM;\n      }\n    } else if (ir->o == IR_XLOAD) {\n      /* Generic fusion is not ok for 8/16 bit operands (but see asm_comp).\n      ** Fusing unaligned memory operands is ok on x86 (except for SIMD types).\n      */\n      if ((!irt_typerange(ir->t, IRT_I8, IRT_U16)) &&\n\t  noconflict(as, ref, IR_XSTORE, 0)) {\n\tasm_fusexref(as, ir->op1, xallow);\n\treturn RID_MRM;\n      }\n    } else if (ir->o == IR_VLOAD) {\n      asm_fuseahuref(as, ir->op1, xallow);\n      return RID_MRM;\n    }\n  }\n  if (!(as->freeset & allow) &&\n      (allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref)))\n    goto fusespill;\n  return ra_allocref(as, ref, allow);\n}\n\n#if LJ_64\n/* Don't fuse a 32 bit load into a 64 bit operation. */\nstatic Reg asm_fuseloadm(ASMState *as, IRRef ref, RegSet allow, int is64)\n{\n  if (is64 && !irt_is64(IR(ref)->t))\n    return ra_alloc1(as, ref, allow);\n  return asm_fuseload(as, ref, allow);\n}\n#else\n#define asm_fuseloadm(as, ref, allow, is64)  asm_fuseload(as, (ref), (allow))\n#endif\n\n/* -- Calls --------------------------------------------------------------- */\n\n/* Count the required number of stack slots for a call. */\nstatic int asm_count_call_slots(ASMState *as, const CCallInfo *ci, IRRef *args)\n{\n  uint32_t i, nargs = CCI_NARGS(ci);\n  int nslots = 0;\n#if LJ_64\n  if (LJ_ABI_WIN) {\n    nslots = (int)(nargs*2);  /* Only matters for more than four args. */\n  } else {\n    int ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;\n    for (i = 0; i < nargs; i++)\n      if (args[i] && irt_isfp(IR(args[i])->t)) {\n\tif (nfpr > 0) nfpr--; else nslots += 2;\n      } else {\n\tif (ngpr > 0) ngpr--; else nslots += 2;\n      }\n  }\n#else\n  int ngpr = 0;\n  if ((ci->flags & CCI_CC_MASK) == CCI_CC_FASTCALL)\n    ngpr = 2;\n  else if ((ci->flags & CCI_CC_MASK) == CCI_CC_THISCALL)\n    ngpr = 1;\n  for (i = 0; i < nargs; i++)\n    if (args[i] && irt_isfp(IR(args[i])->t)) {\n      nslots += irt_isnum(IR(args[i])->t) ? 2 : 1;\n    } else {\n      if (ngpr > 0) ngpr--; else nslots++;\n    }\n#endif\n  return nslots;\n}\n\n/* Generate a call to a C function. */\nstatic void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)\n{\n  uint32_t n, nargs = CCI_NARGS(ci);\n  int32_t ofs = STACKARG_OFS;\n#if LJ_64\n  uint32_t gprs = REGARG_GPRS;\n  Reg fpr = REGARG_FIRSTFPR;\n#if !LJ_ABI_WIN\n  MCode *patchnfpr = NULL;\n#endif\n#else\n  uint32_t gprs = 0;\n  if ((ci->flags & CCI_CC_MASK) != CCI_CC_CDECL) {\n    if ((ci->flags & CCI_CC_MASK) == CCI_CC_THISCALL)\n      gprs = (REGARG_GPRS & 31);\n    else if ((ci->flags & CCI_CC_MASK) == CCI_CC_FASTCALL)\n      gprs = REGARG_GPRS;\n  }\n#endif\n  if ((void *)ci->func)\n    emit_call(as, ci->func);\n#if LJ_64\n  if ((ci->flags & CCI_VARARG)) {  /* Special handling for vararg calls. */\n#if LJ_ABI_WIN\n    for (n = 0; n < 4 && n < nargs; n++) {\n      IRIns *ir = IR(args[n]);\n      if (irt_isfp(ir->t))  /* Duplicate FPRs in GPRs. */\n\temit_rr(as, XO_MOVDto, (irt_isnum(ir->t) ? REX_64 : 0) | (fpr+n),\n\t\t((gprs >> (n*5)) & 31));  /* Either MOVD or MOVQ. */\n    }\n#else\n    patchnfpr = --as->mcp;  /* Indicate number of used FPRs in register al. */\n    *--as->mcp = XI_MOVrib | RID_EAX;\n#endif\n  }\n#endif\n  for (n = 0; n < nargs; n++) {  /* Setup args. */\n    IRRef ref = args[n];\n    IRIns *ir = IR(ref);\n    Reg r;\n#if LJ_64 && LJ_ABI_WIN\n    /* Windows/x64 argument registers are strictly positional. */\n    r = irt_isfp(ir->t) ? (fpr <= REGARG_LASTFPR ? fpr : 0) : (gprs & 31);\n    fpr++; gprs >>= 5;\n#elif LJ_64\n    /* POSIX/x64 argument registers are used in order of appearance. */\n    if (irt_isfp(ir->t)) {\n      r = fpr <= REGARG_LASTFPR ? fpr++ : 0;\n    } else {\n      r = gprs & 31; gprs >>= 5;\n    }\n#else\n    if (ref && irt_isfp(ir->t)) {\n      r = 0;\n    } else {\n      r = gprs & 31; gprs >>= 5;\n      if (!ref) continue;\n    }\n#endif\n    if (r) {  /* Argument is in a register. */\n      if (r < RID_MAX_GPR && ref < ASMREF_TMP1) {\n#if LJ_64\n\tif (ir->o == IR_KINT64)\n\t  emit_loadu64(as, r, ir_kint64(ir)->u64);\n\telse\n#endif\n\t  emit_loadi(as, r, ir->i);\n      } else {\n\tlua_assert(rset_test(as->freeset, r));  /* Must have been evicted. */\n\tif (ra_hasreg(ir->r)) {\n\t  ra_noweak(as, ir->r);\n\t  emit_movrr(as, ir, r, ir->r);\n\t} else {\n\t  ra_allocref(as, ref, RID2RSET(r));\n\t}\n      }\n    } else if (irt_isfp(ir->t)) {  /* FP argument is on stack. */\n      lua_assert(!(irt_isfloat(ir->t) && irref_isk(ref)));  /* No float k. */\n      if (LJ_32 && (ofs & 4) && irref_isk(ref)) {\n\t/* Split stores for unaligned FP consts. */\n\temit_movmroi(as, RID_ESP, ofs, (int32_t)ir_knum(ir)->u32.lo);\n\temit_movmroi(as, RID_ESP, ofs+4, (int32_t)ir_knum(ir)->u32.hi);\n      } else {\n\tr = ra_alloc1(as, ref, RSET_FPR);\n\temit_rmro(as, irt_isnum(ir->t) ? XO_MOVSDto : XO_MOVSSto,\n\t\t  r, RID_ESP, ofs);\n      }\n      ofs += (LJ_32 && irt_isfloat(ir->t)) ? 4 : 8;\n    } else {  /* Non-FP argument is on stack. */\n      if (LJ_32 && ref < ASMREF_TMP1) {\n\temit_movmroi(as, RID_ESP, ofs, ir->i);\n      } else {\n\tr = ra_alloc1(as, ref, RSET_GPR);\n\temit_movtomro(as, REX_64 + r, RID_ESP, ofs);\n      }\n      ofs += sizeof(intptr_t);\n    }\n  }\n#if LJ_64 && !LJ_ABI_WIN\n  if (patchnfpr) *patchnfpr = fpr - REGARG_FIRSTFPR;\n#endif\n}\n\n/* Setup result reg/sp for call. Evict scratch regs. */\nstatic void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  RegSet drop = RSET_SCRATCH;\n  int hiop = (LJ_32 && (ir+1)->o == IR_HIOP);\n  if ((ci->flags & CCI_NOFPRCLOBBER))\n    drop &= ~RSET_FPR;\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  if (hiop && ra_hasreg((ir+1)->r))\n    rset_clear(drop, (ir+1)->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);  /* Evictions must be performed first. */\n  if (ra_used(ir)) {\n    if (irt_isfp(ir->t)) {\n      int32_t ofs = sps_scale(ir->s);  /* Use spill slot or temp slots. */\n#if LJ_64\n      if ((ci->flags & CCI_CASTU64)) {\n\tReg dest = ir->r;\n\tif (ra_hasreg(dest)) {\n\t  ra_free(as, dest);\n\t  ra_modified(as, dest);\n\t  emit_rr(as, XO_MOVD, dest|REX_64, RID_RET);  /* Really MOVQ. */\n\t}\n\tif (ofs) emit_movtomro(as, RID_RET|REX_64, RID_ESP, ofs);\n      } else {\n\tra_destreg(as, ir, RID_FPRET);\n      }\n#else\n      /* Number result is in x87 st0 for x86 calling convention. */\n      Reg dest = ir->r;\n      if (ra_hasreg(dest)) {\n\tra_free(as, dest);\n\tra_modified(as, dest);\n\temit_rmro(as, irt_isnum(ir->t) ? XMM_MOVRM(as) : XO_MOVSS,\n\t\t  dest, RID_ESP, ofs);\n      }\n      if ((ci->flags & CCI_CASTU64)) {\n\temit_movtomro(as, RID_RETLO, RID_ESP, ofs);\n\temit_movtomro(as, RID_RETHI, RID_ESP, ofs+4);\n      } else {\n\temit_rmro(as, irt_isnum(ir->t) ? XO_FSTPq : XO_FSTPd,\n\t\t  irt_isnum(ir->t) ? XOg_FSTPq : XOg_FSTPd, RID_ESP, ofs);\n      }\n#endif\n#if LJ_32\n    } else if (hiop) {\n      ra_destpair(as, ir);\n#endif\n    } else {\n      lua_assert(!irt_ispri(ir->t));\n      ra_destreg(as, ir, RID_RET);\n    }\n  } else if (LJ_32 && irt_isfp(ir->t)) {\n    emit_x87op(as, XI_FPOP);  /* Pop unused result from x87 st0. */\n  }\n}\n\nstatic void asm_call(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  const CCallInfo *ci = &lj_ir_callinfo[ir->op2];\n  asm_collectargs(as, ir, ci, args);\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\n/* Return a constant function pointer or NULL for indirect calls. */\nstatic void *asm_callx_func(ASMState *as, IRIns *irf, IRRef func)\n{\n#if LJ_32\n  UNUSED(as);\n  if (irref_isk(func))\n    return (void *)irf->i;\n#else\n  if (irref_isk(func)) {\n    MCode *p;\n    if (irf->o == IR_KINT64)\n      p = (MCode *)(void *)ir_k64(irf)->u64;\n    else\n      p = (MCode *)(void *)(uintptr_t)(uint32_t)irf->i;\n    if (p - as->mcp == (int32_t)(p - as->mcp))\n      return p;  /* Call target is still in +-2GB range. */\n    /* Avoid the indirect case of emit_call(). Try to hoist func addr. */\n  }\n#endif\n  return NULL;\n}\n\nstatic void asm_callx(ASMState *as, IRIns *ir)\n{\n  IRRef args[CCI_NARGS_MAX];\n  CCallInfo ci;\n  IRRef func;\n  IRIns *irf;\n  int32_t spadj = 0;\n  ci.flags = asm_callx_flags(as, ir);\n  asm_collectargs(as, ir, &ci, args);\n  asm_setupresult(as, ir, &ci);\n#if LJ_32\n  /* Have to readjust stack after non-cdecl calls due to callee cleanup. */\n  if ((ci.flags & CCI_CC_MASK) != CCI_CC_CDECL)\n    spadj = 4 * asm_count_call_slots(as, &ci, args);\n#endif\n  func = ir->op2; irf = IR(func);\n  if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); }\n  ci.func = (ASMFunction)asm_callx_func(as, irf, func);\n  if (!(void *)ci.func) {\n    /* Use a (hoistable) non-scratch register for indirect calls. */\n    RegSet allow = (RSET_GPR & ~RSET_SCRATCH);\n    Reg r = ra_alloc1(as, func, allow);\n    if (LJ_32) emit_spsub(as, spadj);  /* Above code may cause restores! */\n    emit_rr(as, XO_GROUP5, XOg_CALL, r);\n  } else if (LJ_32) {\n    emit_spsub(as, spadj);\n  }\n  asm_gencall(as, &ci, args);\n}\n\n/* -- Returns ------------------------------------------------------------- */\n\n/* Return to lower frame. Guard that it goes to the right spot. */\nstatic void asm_retf(ASMState *as, IRIns *ir)\n{\n  Reg base = ra_alloc1(as, REF_BASE, RSET_GPR);\n  void *pc = ir_kptr(IR(ir->op2));\n  int32_t delta = 1+bc_a(*((const BCIns *)pc - 1));\n  as->topslot -= (BCReg)delta;\n  if ((int32_t)as->topslot < 0) as->topslot = 0;\n  emit_setgl(as, base, jit_base);\n  emit_addptr(as, base, -8*delta);\n  asm_guardcc(as, CC_NE);\n  emit_gmroi(as, XG_ARITHi(XOg_CMP), base, -4, ptr2addr(pc));\n}\n\n/* -- Type conversions ---------------------------------------------------- */\n\nstatic void asm_tointg(ASMState *as, IRIns *ir, Reg left)\n{\n  Reg tmp = ra_scratch(as, rset_exclude(RSET_FPR, left));\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  asm_guardcc(as, CC_P);\n  asm_guardcc(as, CC_NE);\n  emit_rr(as, XO_UCOMISD, left, tmp);\n  emit_rr(as, XO_CVTSI2SD, tmp, dest);\n  if (!(as->flags & JIT_F_SPLIT_XMM))\n    emit_rr(as, XO_XORPS, tmp, tmp);  /* Avoid partial register stall. */\n  emit_rr(as, XO_CVTTSD2SI, dest, left);\n  /* Can't fuse since left is needed twice. */\n}\n\nstatic void asm_tobit(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  Reg tmp = ra_noreg(IR(ir->op1)->r) ?\n\t      ra_alloc1(as, ir->op1, RSET_FPR) :\n\t      ra_scratch(as, RSET_FPR);\n  Reg right = asm_fuseload(as, ir->op2, rset_exclude(RSET_FPR, tmp));\n  emit_rr(as, XO_MOVDto, tmp, dest);\n  emit_mrm(as, XO_ADDSD, tmp, right);\n  ra_left(as, tmp, ir->op1);\n}\n\nstatic void asm_conv(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);\n  int st64 = (st == IRT_I64 || st == IRT_U64 || (LJ_64 && st == IRT_P64));\n  int stfp = (st == IRT_NUM || st == IRT_FLOAT);\n  IRRef lref = ir->op1;\n  lua_assert(irt_type(ir->t) != st);\n  lua_assert(!(LJ_32 && (irt_isint64(ir->t) || st64)));  /* Handled by SPLIT. */\n  if (irt_isfp(ir->t)) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    if (stfp) {  /* FP to FP conversion. */\n      Reg left = asm_fuseload(as, lref, RSET_FPR);\n      emit_mrm(as, st == IRT_NUM ? XO_CVTSD2SS : XO_CVTSS2SD, dest, left);\n      if (left == dest) return;  /* Avoid the XO_XORPS. */\n    } else if (LJ_32 && st == IRT_U32) {  /* U32 to FP conversion on x86. */\n      /* number = (2^52+2^51 .. u32) - (2^52+2^51) */\n      cTValue *k = lj_ir_k64_find(as->J, U64x(43380000,00000000));\n      Reg bias = ra_scratch(as, rset_exclude(RSET_FPR, dest));\n      if (irt_isfloat(ir->t))\n\temit_rr(as, XO_CVTSD2SS, dest, dest);\n      emit_rr(as, XO_SUBSD, dest, bias);  /* Subtract 2^52+2^51 bias. */\n      emit_rr(as, XO_XORPS, dest, bias);  /* Merge bias and integer. */\n      emit_loadn(as, bias, k);\n      emit_mrm(as, XO_MOVD, dest, asm_fuseload(as, lref, RSET_GPR));\n      return;\n    } else {  /* Integer to FP conversion. */\n      Reg left = (LJ_64 && (st == IRT_U32 || st == IRT_U64)) ?\n\t\t ra_alloc1(as, lref, RSET_GPR) :\n\t\t asm_fuseloadm(as, lref, RSET_GPR, st64);\n      if (LJ_64 && st == IRT_U64) {\n\tMCLabel l_end = emit_label(as);\n\tconst void *k = lj_ir_k64_find(as->J, U64x(43f00000,00000000));\n\temit_rma(as, XO_ADDSD, dest, k);  /* Add 2^64 to compensate. */\n\temit_sjcc(as, CC_NS, l_end);\n\temit_rr(as, XO_TEST, left|REX_64, left);  /* Check if u64 >= 2^63. */\n      }\n      emit_mrm(as, irt_isnum(ir->t) ? XO_CVTSI2SD : XO_CVTSI2SS,\n\t       dest|((LJ_64 && (st64 || st == IRT_U32)) ? REX_64 : 0), left);\n    }\n    if (!(as->flags & JIT_F_SPLIT_XMM))\n      emit_rr(as, XO_XORPS, dest, dest);  /* Avoid partial register stall. */\n  } else if (stfp) {  /* FP to integer conversion. */\n    if (irt_isguard(ir->t)) {\n      /* Checked conversions are only supported from number to int. */\n      lua_assert(irt_isint(ir->t) && st == IRT_NUM);\n      asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR));\n    } else {\n      Reg dest = ra_dest(as, ir, RSET_GPR);\n      x86Op op = st == IRT_NUM ?\n\t\t ((ir->op2 & IRCONV_TRUNC) ? XO_CVTTSD2SI : XO_CVTSD2SI) :\n\t\t ((ir->op2 & IRCONV_TRUNC) ? XO_CVTTSS2SI : XO_CVTSS2SI);\n      if (LJ_64 ? irt_isu64(ir->t) : irt_isu32(ir->t)) {\n\t/* LJ_64: For inputs >= 2^63 add -2^64, convert again. */\n\t/* LJ_32: For inputs >= 2^31 add -2^31, convert again and add 2^31. */\n\tReg tmp = ra_noreg(IR(lref)->r) ? ra_alloc1(as, lref, RSET_FPR) :\n\t\t\t\t\t  ra_scratch(as, RSET_FPR);\n\tMCLabel l_end = emit_label(as);\n\tif (LJ_32)\n\t  emit_gri(as, XG_ARITHi(XOg_ADD), dest, (int32_t)0x80000000);\n\temit_rr(as, op, dest|REX_64, tmp);\n\tif (st == IRT_NUM)\n\t  emit_rma(as, XO_ADDSD, tmp, lj_ir_k64_find(as->J,\n\t\t   LJ_64 ? U64x(c3f00000,00000000) : U64x(c1e00000,00000000)));\n\telse\n\t  emit_rma(as, XO_ADDSS, tmp, lj_ir_k64_find(as->J,\n\t\t   LJ_64 ? U64x(00000000,df800000) : U64x(00000000,cf000000)));\n\temit_sjcc(as, CC_NS, l_end);\n\temit_rr(as, XO_TEST, dest|REX_64, dest);  /* Check if dest negative. */\n\temit_rr(as, op, dest|REX_64, tmp);\n\tra_left(as, tmp, lref);\n      } else {\n\tReg left = asm_fuseload(as, lref, RSET_FPR);\n\tif (LJ_64 && irt_isu32(ir->t))\n\t  emit_rr(as, XO_MOV, dest, dest);  /* Zero hiword. */\n\temit_mrm(as, op,\n\t\t dest|((LJ_64 &&\n\t\t\t(irt_is64(ir->t) || irt_isu32(ir->t))) ? REX_64 : 0),\n\t\t left);\n      }\n    }\n  } else if (st >= IRT_I8 && st <= IRT_U16) {  /* Extend to 32 bit integer. */\n    Reg left, dest = ra_dest(as, ir, RSET_GPR);\n    RegSet allow = RSET_GPR;\n    x86Op op;\n    lua_assert(irt_isint(ir->t) || irt_isu32(ir->t));\n    if (st == IRT_I8) {\n      op = XO_MOVSXb; allow = RSET_GPR8; dest |= FORCE_REX;\n    } else if (st == IRT_U8) {\n      op = XO_MOVZXb; allow = RSET_GPR8; dest |= FORCE_REX;\n    } else if (st == IRT_I16) {\n      op = XO_MOVSXw;\n    } else {\n      op = XO_MOVZXw;\n    }\n    left = asm_fuseload(as, lref, allow);\n    /* Add extra MOV if source is already in wrong register. */\n    if (!LJ_64 && left != RID_MRM && !rset_test(allow, left)) {\n      Reg tmp = ra_scratch(as, allow);\n      emit_rr(as, op, dest, tmp);\n      emit_rr(as, XO_MOV, tmp, left);\n    } else {\n      emit_mrm(as, op, dest, left);\n    }\n  } else {  /* 32/64 bit integer conversions. */\n    if (LJ_32) {  /* Only need to handle 32/32 bit no-op (cast) on x86. */\n      Reg dest = ra_dest(as, ir, RSET_GPR);\n      ra_left(as, dest, lref);  /* Do nothing, but may need to move regs. */\n    } else if (irt_is64(ir->t)) {\n      Reg dest = ra_dest(as, ir, RSET_GPR);\n      if (st64 || !(ir->op2 & IRCONV_SEXT)) {\n\t/* 64/64 bit no-op (cast) or 32 to 64 bit zero extension. */\n\tra_left(as, dest, lref);  /* Do nothing, but may need to move regs. */\n      } else {  /* 32 to 64 bit sign extension. */\n\tReg left = asm_fuseload(as, lref, RSET_GPR);\n\temit_mrm(as, XO_MOVSXd, dest|REX_64, left);\n      }\n    } else {\n      Reg dest = ra_dest(as, ir, RSET_GPR);\n      if (st64) {\n\tReg left = asm_fuseload(as, lref, RSET_GPR);\n\t/* This is either a 32 bit reg/reg mov which zeroes the hiword\n\t** or a load of the loword from a 64 bit address.\n\t*/\n\temit_mrm(as, XO_MOV, dest, left);\n      } else {  /* 32/32 bit no-op (cast). */\n\tra_left(as, dest, lref);  /* Do nothing, but may need to move regs. */\n      }\n    }\n  }\n}\n\n#if LJ_32 && LJ_HASFFI\n/* No SSE conversions to/from 64 bit on x86, so resort to ugly x87 code. */\n\n/* 64 bit integer to FP conversion in 32 bit mode. */\nstatic void asm_conv_fp_int64(ASMState *as, IRIns *ir)\n{\n  Reg hi = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg lo = ra_alloc1(as, (ir-1)->op1, rset_exclude(RSET_GPR, hi));\n  int32_t ofs = sps_scale(ir->s);  /* Use spill slot or temp slots. */\n  Reg dest = ir->r;\n  if (ra_hasreg(dest)) {\n    ra_free(as, dest);\n    ra_modified(as, dest);\n    emit_rmro(as, irt_isnum(ir->t) ? XMM_MOVRM(as) : XO_MOVSS,\n\t      dest, RID_ESP, ofs);\n  }\n  emit_rmro(as, irt_isnum(ir->t) ? XO_FSTPq : XO_FSTPd,\n\t    irt_isnum(ir->t) ? XOg_FSTPq : XOg_FSTPd, RID_ESP, ofs);\n  if (((ir-1)->op2 & IRCONV_SRCMASK) == IRT_U64) {\n    /* For inputs in [2^63,2^64-1] add 2^64 to compensate. */\n    MCLabel l_end = emit_label(as);\n    emit_rma(as, XO_FADDq, XOg_FADDq,\n\t     lj_ir_k64_find(as->J, U64x(43f00000,00000000)));\n    emit_sjcc(as, CC_NS, l_end);\n    emit_rr(as, XO_TEST, hi, hi);  /* Check if u64 >= 2^63. */\n  } else {\n    lua_assert(((ir-1)->op2 & IRCONV_SRCMASK) == IRT_I64);\n  }\n  emit_rmro(as, XO_FILDq, XOg_FILDq, RID_ESP, 0);\n  /* NYI: Avoid narrow-to-wide store-to-load forwarding stall. */\n  emit_rmro(as, XO_MOVto, hi, RID_ESP, 4);\n  emit_rmro(as, XO_MOVto, lo, RID_ESP, 0);\n}\n\n/* FP to 64 bit integer conversion in 32 bit mode. */\nstatic void asm_conv_int64_fp(ASMState *as, IRIns *ir)\n{\n  IRType st = (IRType)((ir-1)->op2 & IRCONV_SRCMASK);\n  IRType dt = (((ir-1)->op2 & IRCONV_DSTMASK) >> IRCONV_DSH);\n  Reg lo, hi;\n  lua_assert(st == IRT_NUM || st == IRT_FLOAT);\n  lua_assert(dt == IRT_I64 || dt == IRT_U64);\n  lua_assert(((ir-1)->op2 & IRCONV_TRUNC));\n  hi = ra_dest(as, ir, RSET_GPR);\n  lo = ra_dest(as, ir-1, rset_exclude(RSET_GPR, hi));\n  if (ra_used(ir-1)) emit_rmro(as, XO_MOV, lo, RID_ESP, 0);\n  /* NYI: Avoid wide-to-narrow store-to-load forwarding stall. */\n  if (!(as->flags & JIT_F_SSE3)) {  /* Set FPU rounding mode to default. */\n    emit_rmro(as, XO_FLDCW, XOg_FLDCW, RID_ESP, 4);\n    emit_rmro(as, XO_MOVto, lo, RID_ESP, 4);\n    emit_gri(as, XG_ARITHi(XOg_AND), lo, 0xf3ff);\n  }\n  if (dt == IRT_U64) {\n    /* For inputs in [2^63,2^64-1] add -2^64 and convert again. */\n    MCLabel l_pop, l_end = emit_label(as);\n    emit_x87op(as, XI_FPOP);\n    l_pop = emit_label(as);\n    emit_sjmp(as, l_end);\n    emit_rmro(as, XO_MOV, hi, RID_ESP, 4);\n    if ((as->flags & JIT_F_SSE3))\n      emit_rmro(as, XO_FISTTPq, XOg_FISTTPq, RID_ESP, 0);\n    else\n      emit_rmro(as, XO_FISTPq, XOg_FISTPq, RID_ESP, 0);\n    emit_rma(as, XO_FADDq, XOg_FADDq,\n\t     lj_ir_k64_find(as->J, U64x(c3f00000,00000000)));\n    emit_sjcc(as, CC_NS, l_pop);\n    emit_rr(as, XO_TEST, hi, hi);  /* Check if out-of-range (2^63). */\n  }\n  emit_rmro(as, XO_MOV, hi, RID_ESP, 4);\n  if ((as->flags & JIT_F_SSE3)) {  /* Truncation is easy with SSE3. */\n    emit_rmro(as, XO_FISTTPq, XOg_FISTTPq, RID_ESP, 0);\n  } else {  /* Otherwise set FPU rounding mode to truncate before the store. */\n    emit_rmro(as, XO_FISTPq, XOg_FISTPq, RID_ESP, 0);\n    emit_rmro(as, XO_FLDCW, XOg_FLDCW, RID_ESP, 0);\n    emit_rmro(as, XO_MOVtow, lo, RID_ESP, 0);\n    emit_rmro(as, XO_ARITHw(XOg_OR), lo, RID_ESP, 0);\n    emit_loadi(as, lo, 0xc00);\n    emit_rmro(as, XO_FNSTCW, XOg_FNSTCW, RID_ESP, 0);\n  }\n  if (dt == IRT_U64)\n    emit_x87op(as, XI_FDUP);\n  emit_mrm(as, st == IRT_NUM ? XO_FLDq : XO_FLDd,\n\t   st == IRT_NUM ? XOg_FLDq: XOg_FLDd,\n\t   asm_fuseload(as, ir->op1, RSET_EMPTY));\n}\n#endif\n\nstatic void asm_strto(ASMState *as, IRIns *ir)\n{\n  /* Force a spill slot for the destination register (if any). */\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num];\n  IRRef args[2];\n  RegSet drop = RSET_SCRATCH;\n  if ((drop & RSET_FPR) != RSET_FPR && ra_hasreg(ir->r))\n    rset_set(drop, ir->r);  /* WIN64 doesn't spill all FPRs. */\n  ra_evictset(as, drop);\n  asm_guardcc(as, CC_E);\n  emit_rr(as, XO_TEST, RID_RET, RID_RET);  /* Test return status. */\n  args[0] = ir->op1;      /* GCstr *str */\n  args[1] = ASMREF_TMP1;  /* TValue *n  */\n  asm_gencall(as, ci, args);\n  /* Store the result to the spill slot or temp slots. */\n  emit_rmro(as, XO_LEA, ra_releasetmp(as, ASMREF_TMP1)|REX_64,\n\t    RID_ESP, sps_scale(ir->s));\n}\n\nstatic void asm_tostr(ASMState *as, IRIns *ir)\n{\n  IRIns *irl = IR(ir->op1);\n  IRRef args[2];\n  args[0] = ASMREF_L;\n  as->gcsteps++;\n  if (irt_isnum(irl->t)) {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromnum];\n    args[1] = ASMREF_TMP1;  /* const lua_Number * */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n    emit_rmro(as, XO_LEA, ra_releasetmp(as, ASMREF_TMP1)|REX_64,\n\t      RID_ESP, ra_spill(as, irl));\n  } else {\n    const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_str_fromint];\n    args[1] = ir->op1;  /* int32_t k */\n    asm_setupresult(as, ir, ci);  /* GCstr * */\n    asm_gencall(as, ci, args);\n  }\n}\n\n/* -- Memory references --------------------------------------------------- */\n\nstatic void asm_aref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  asm_fusearef(as, ir, RSET_GPR);\n  if (!(as->mrm.idx == RID_NONE && as->mrm.ofs == 0))\n    emit_mrm(as, XO_LEA, dest, RID_MRM);\n  else if (as->mrm.base != dest)\n    emit_rr(as, XO_MOV, dest, as->mrm.base);\n}\n\n/* Merge NE(HREF, niltv) check. */\nstatic MCode *merge_href_niltv(ASMState *as, IRIns *ir)\n{\n  /* Assumes nothing else generates NE of HREF. */\n  if ((ir[1].o == IR_NE || ir[1].o == IR_EQ) && ir[1].op1 == as->curins &&\n      ra_hasreg(ir->r)) {\n    MCode *p = as->mcp;\n    p += (LJ_64 && *p != XI_ARITHi) ? 7+6 : 6+6;\n    /* Ensure no loop branch inversion happened. */\n    if (p[-6] == 0x0f && p[-5] == XI_JCCn+(CC_NE^(ir[1].o & 1))) {\n      as->mcp = p;  /* Kill cmp reg, imm32 + jz exit. */\n      return p + *(int32_t *)(p-4);  /* Return exit address. */\n    }\n  }\n  return NULL;\n}\n\n/* Inlined hash lookup. Specialized for key type and for const keys.\n** The equivalent C code is:\n**   Node *n = hashkey(t, key);\n**   do {\n**     if (lj_obj_equal(&n->key, key)) return &n->val;\n**   } while ((n = nextnode(n)));\n**   return niltv(L);\n*/\nstatic void asm_href(ASMState *as, IRIns *ir)\n{\n  MCode *nilexit = merge_href_niltv(as, ir);  /* Do this before any restores. */\n  RegSet allow = RSET_GPR;\n  Reg dest = ra_dest(as, ir, allow);\n  Reg tab = ra_alloc1(as, ir->op1, rset_clear(allow, dest));\n  Reg key = RID_NONE, tmp = RID_NONE;\n  IRIns *irkey = IR(ir->op2);\n  int isk = irref_isk(ir->op2);\n  IRType1 kt = irkey->t;\n  uint32_t khash;\n  MCLabel l_end, l_loop, l_next;\n\n  if (!isk) {\n    rset_clear(allow, tab);\n    key = ra_alloc1(as, ir->op2, irt_isnum(kt) ? RSET_FPR : allow);\n    if (!irt_isstr(kt))\n      tmp = ra_scratch(as, rset_exclude(allow, key));\n  }\n\n  /* Key not found in chain: jump to exit (if merged with NE) or load niltv. */\n  l_end = emit_label(as);\n  if (nilexit && ir[1].o == IR_NE) {\n    emit_jcc(as, CC_E, nilexit);  /* XI_JMP is not found by lj_asm_patchexit. */\n    nilexit = NULL;\n  } else {\n    emit_loada(as, dest, niltvg(J2G(as->J)));\n  }\n\n  /* Follow hash chain until the end. */\n  l_loop = emit_sjcc_label(as, CC_NZ);\n  emit_rr(as, XO_TEST, dest, dest);\n  emit_rmro(as, XO_MOV, dest, dest, offsetof(Node, next));\n  l_next = emit_label(as);\n\n  /* Type and value comparison. */\n  if (nilexit)\n    emit_jcc(as, CC_E, nilexit);\n  else\n    emit_sjcc(as, CC_E, l_end);\n  if (irt_isnum(kt)) {\n    if (isk) {\n      /* Assumes -0.0 is already canonicalized to +0.0. */\n      emit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.u32.lo),\n\t\t (int32_t)ir_knum(irkey)->u32.lo);\n      emit_sjcc(as, CC_NE, l_next);\n      emit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.u32.hi),\n\t\t (int32_t)ir_knum(irkey)->u32.hi);\n    } else {\n      emit_sjcc(as, CC_P, l_next);\n      emit_rmro(as, XO_UCOMISD, key, dest, offsetof(Node, key.n));\n      emit_sjcc(as, CC_AE, l_next);\n      /* The type check avoids NaN penalties and complaints from Valgrind. */\n#if LJ_64\n      emit_u32(as, LJ_TISNUM);\n      emit_rmro(as, XO_ARITHi, XOg_CMP, dest, offsetof(Node, key.it));\n#else\n      emit_i8(as, LJ_TISNUM);\n      emit_rmro(as, XO_ARITHi8, XOg_CMP, dest, offsetof(Node, key.it));\n#endif\n    }\n#if LJ_64\n  } else if (irt_islightud(kt)) {\n    emit_rmro(as, XO_CMP, key|REX_64, dest, offsetof(Node, key.u64));\n#endif\n  } else {\n    if (!irt_ispri(kt)) {\n      lua_assert(irt_isaddr(kt));\n      if (isk)\n\temit_gmroi(as, XG_ARITHi(XOg_CMP), dest, offsetof(Node, key.gcr),\n\t\t   ptr2addr(ir_kgc(irkey)));\n      else\n\temit_rmro(as, XO_CMP, key, dest, offsetof(Node, key.gcr));\n      emit_sjcc(as, CC_NE, l_next);\n    }\n    lua_assert(!irt_isnil(kt));\n    emit_i8(as, irt_toitype(kt));\n    emit_rmro(as, XO_ARITHi8, XOg_CMP, dest, offsetof(Node, key.it));\n  }\n  emit_sfixup(as, l_loop);\n  checkmclim(as);\n\n  /* Load main position relative to tab->node into dest. */\n  khash = isk ? ir_khash(irkey) : 1;\n  if (khash == 0) {\n    emit_rmro(as, XO_MOV, dest, tab, offsetof(GCtab, node));\n  } else {\n    emit_rmro(as, XO_ARITH(XOg_ADD), dest, tab, offsetof(GCtab, node));\n    if ((as->flags & JIT_F_PREFER_IMUL)) {\n      emit_i8(as, sizeof(Node));\n      emit_rr(as, XO_IMULi8, dest, dest);\n    } else {\n      emit_shifti(as, XOg_SHL, dest, 3);\n      emit_rmrxo(as, XO_LEA, dest, dest, dest, XM_SCALE2, 0);\n    }\n    if (isk) {\n      emit_gri(as, XG_ARITHi(XOg_AND), dest, (int32_t)khash);\n      emit_rmro(as, XO_MOV, dest, tab, offsetof(GCtab, hmask));\n    } else if (irt_isstr(kt)) {\n      emit_rmro(as, XO_ARITH(XOg_AND), dest, key, offsetof(GCstr, hash));\n      emit_rmro(as, XO_MOV, dest, tab, offsetof(GCtab, hmask));\n    } else {  /* Must match with hashrot() in lj_tab.c. */\n      emit_rmro(as, XO_ARITH(XOg_AND), dest, tab, offsetof(GCtab, hmask));\n      emit_rr(as, XO_ARITH(XOg_SUB), dest, tmp);\n      emit_shifti(as, XOg_ROL, tmp, HASH_ROT3);\n      emit_rr(as, XO_ARITH(XOg_XOR), dest, tmp);\n      emit_shifti(as, XOg_ROL, dest, HASH_ROT2);\n      emit_rr(as, XO_ARITH(XOg_SUB), tmp, dest);\n      emit_shifti(as, XOg_ROL, dest, HASH_ROT1);\n      emit_rr(as, XO_ARITH(XOg_XOR), tmp, dest);\n      if (irt_isnum(kt)) {\n\temit_rr(as, XO_ARITH(XOg_ADD), dest, dest);\n#if LJ_64\n\temit_shifti(as, XOg_SHR|REX_64, dest, 32);\n\temit_rr(as, XO_MOV, tmp, dest);\n\temit_rr(as, XO_MOVDto, key|REX_64, dest);\n#else\n\temit_rmro(as, XO_MOV, dest, RID_ESP, ra_spill(as, irkey)+4);\n\temit_rr(as, XO_MOVDto, key, tmp);\n#endif\n      } else {\n\temit_rr(as, XO_MOV, tmp, key);\n\temit_rmro(as, XO_LEA, dest, key, HASH_BIAS);\n      }\n    }\n  }\n}\n\nstatic void asm_hrefk(ASMState *as, IRIns *ir)\n{\n  IRIns *kslot = IR(ir->op2);\n  IRIns *irkey = IR(kslot->op1);\n  int32_t ofs = (int32_t)(kslot->op2 * sizeof(Node));\n  Reg dest = ra_used(ir) ? ra_dest(as, ir, RSET_GPR) : RID_NONE;\n  Reg node = ra_alloc1(as, ir->op1, RSET_GPR);\n#if !LJ_64\n  MCLabel l_exit;\n#endif\n  lua_assert(ofs % sizeof(Node) == 0);\n  if (ra_hasreg(dest)) {\n    if (ofs != 0) {\n      if (dest == node && !(as->flags & JIT_F_LEA_AGU))\n\temit_gri(as, XG_ARITHi(XOg_ADD), dest, ofs);\n      else\n\temit_rmro(as, XO_LEA, dest, node, ofs);\n    } else if (dest != node) {\n      emit_rr(as, XO_MOV, dest, node);\n    }\n  }\n  asm_guardcc(as, CC_NE);\n#if LJ_64\n  if (!irt_ispri(irkey->t)) {\n    Reg key = ra_scratch(as, rset_exclude(RSET_GPR, node));\n    emit_rmro(as, XO_CMP, key|REX_64, node,\n\t       ofs + (int32_t)offsetof(Node, key.u64));\n    lua_assert(irt_isnum(irkey->t) || irt_isgcv(irkey->t));\n    /* Assumes -0.0 is already canonicalized to +0.0. */\n    emit_loadu64(as, key, irt_isnum(irkey->t) ? ir_knum(irkey)->u64 :\n\t\t\t  ((uint64_t)irt_toitype(irkey->t) << 32) |\n\t\t\t  (uint64_t)(uint32_t)ptr2addr(ir_kgc(irkey)));\n  } else {\n    lua_assert(!irt_isnil(irkey->t));\n    emit_i8(as, irt_toitype(irkey->t));\n    emit_rmro(as, XO_ARITHi8, XOg_CMP, node,\n\t      ofs + (int32_t)offsetof(Node, key.it));\n  }\n#else\n  l_exit = emit_label(as);\n  if (irt_isnum(irkey->t)) {\n    /* Assumes -0.0 is already canonicalized to +0.0. */\n    emit_gmroi(as, XG_ARITHi(XOg_CMP), node,\n\t       ofs + (int32_t)offsetof(Node, key.u32.lo),\n\t       (int32_t)ir_knum(irkey)->u32.lo);\n    emit_sjcc(as, CC_NE, l_exit);\n    emit_gmroi(as, XG_ARITHi(XOg_CMP), node,\n\t       ofs + (int32_t)offsetof(Node, key.u32.hi),\n\t       (int32_t)ir_knum(irkey)->u32.hi);\n  } else {\n    if (!irt_ispri(irkey->t)) {\n      lua_assert(irt_isgcv(irkey->t));\n      emit_gmroi(as, XG_ARITHi(XOg_CMP), node,\n\t\t ofs + (int32_t)offsetof(Node, key.gcr),\n\t\t ptr2addr(ir_kgc(irkey)));\n      emit_sjcc(as, CC_NE, l_exit);\n    }\n    lua_assert(!irt_isnil(irkey->t));\n    emit_i8(as, irt_toitype(irkey->t));\n    emit_rmro(as, XO_ARITHi8, XOg_CMP, node,\n\t      ofs + (int32_t)offsetof(Node, key.it));\n  }\n#endif\n}\n\nstatic void asm_newref(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];\n  IRRef args[3];\n  IRIns *irkey;\n  Reg tmp;\n  if (ir->r == RID_SINK)\n    return;\n  args[0] = ASMREF_L;     /* lua_State *L */\n  args[1] = ir->op1;      /* GCtab *t     */\n  args[2] = ASMREF_TMP1;  /* cTValue *key */\n  asm_setupresult(as, ir, ci);  /* TValue * */\n  asm_gencall(as, ci, args);\n  tmp = ra_releasetmp(as, ASMREF_TMP1);\n  irkey = IR(ir->op2);\n  if (irt_isnum(irkey->t)) {\n    /* For numbers use the constant itself or a spill slot as a TValue. */\n    if (irref_isk(ir->op2))\n      emit_loada(as, tmp, ir_knum(irkey));\n    else\n      emit_rmro(as, XO_LEA, tmp|REX_64, RID_ESP, ra_spill(as, irkey));\n  } else {\n    /* Otherwise use g->tmptv to hold the TValue. */\n    if (!irref_isk(ir->op2)) {\n      Reg src = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, tmp));\n      emit_movtomro(as, REX_64IR(irkey, src), tmp, 0);\n    } else if (!irt_ispri(irkey->t)) {\n      emit_movmroi(as, tmp, 0, irkey->i);\n    }\n    if (!(LJ_64 && irt_islightud(irkey->t)))\n      emit_movmroi(as, tmp, 4, irt_toitype(irkey->t));\n    emit_loada(as, tmp, &J2G(as->J)->tmptv);\n  }\n}\n\nstatic void asm_uref(ASMState *as, IRIns *ir)\n{\n  /* NYI: Check that UREFO is still open and not aliasing a slot. */\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  if (irref_isk(ir->op1)) {\n    GCfunc *fn = ir_kfunc(IR(ir->op1));\n    MRef *v = &gcref(fn->l.uvptr[(ir->op2 >> 8)])->uv.v;\n    emit_rma(as, XO_MOV, dest, v);\n  } else {\n    Reg uv = ra_scratch(as, RSET_GPR);\n    Reg func = ra_alloc1(as, ir->op1, RSET_GPR);\n    if (ir->o == IR_UREFC) {\n      emit_rmro(as, XO_LEA, dest, uv, offsetof(GCupval, tv));\n      asm_guardcc(as, CC_NE);\n      emit_i8(as, 1);\n      emit_rmro(as, XO_ARITHib, XOg_CMP, uv, offsetof(GCupval, closed));\n    } else {\n      emit_rmro(as, XO_MOV, dest, uv, offsetof(GCupval, v));\n    }\n    emit_rmro(as, XO_MOV, uv, func,\n\t      (int32_t)offsetof(GCfuncL, uvptr) + 4*(int32_t)(ir->op2 >> 8));\n  }\n}\n\nstatic void asm_fref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  asm_fusefref(as, ir, RSET_GPR);\n  emit_mrm(as, XO_LEA, dest, RID_MRM);\n}\n\nstatic void asm_strref(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  asm_fusestrref(as, ir, RSET_GPR);\n  if (as->mrm.base == RID_NONE)\n    emit_loadi(as, dest, as->mrm.ofs);\n  else if (as->mrm.base == dest && as->mrm.idx == RID_NONE)\n    emit_gri(as, XG_ARITHi(XOg_ADD), dest, as->mrm.ofs);\n  else\n    emit_mrm(as, XO_LEA, dest, RID_MRM);\n}\n\n/* -- Loads and stores ---------------------------------------------------- */\n\nstatic void asm_fxload(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);\n  x86Op xo;\n  if (ir->o == IR_FLOAD)\n    asm_fusefref(as, ir, RSET_GPR);\n  else\n    asm_fusexref(as, ir->op1, RSET_GPR);\n  /* ir->op2 is ignored -- unaligned loads are ok on x86. */\n  switch (irt_type(ir->t)) {\n  case IRT_I8: xo = XO_MOVSXb; break;\n  case IRT_U8: xo = XO_MOVZXb; break;\n  case IRT_I16: xo = XO_MOVSXw; break;\n  case IRT_U16: xo = XO_MOVZXw; break;\n  case IRT_NUM: xo = XMM_MOVRM(as); break;\n  case IRT_FLOAT: xo = XO_MOVSS; break;\n  default:\n    if (LJ_64 && irt_is64(ir->t))\n      dest |= REX_64;\n    else\n      lua_assert(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t));\n    xo = XO_MOV;\n    break;\n  }\n  emit_mrm(as, xo, dest, RID_MRM);\n}\n\nstatic void asm_fxstore(ASMState *as, IRIns *ir)\n{\n  RegSet allow = RSET_GPR;\n  Reg src = RID_NONE, osrc = RID_NONE;\n  int32_t k = 0;\n  if (ir->r == RID_SINK)\n    return;\n  /* The IRT_I16/IRT_U16 stores should never be simplified for constant\n  ** values since mov word [mem], imm16 has a length-changing prefix.\n  */\n  if (irt_isi16(ir->t) || irt_isu16(ir->t) || irt_isfp(ir->t) ||\n      !asm_isk32(as, ir->op2, &k)) {\n    RegSet allow8 = irt_isfp(ir->t) ? RSET_FPR :\n\t\t    (irt_isi8(ir->t) || irt_isu8(ir->t)) ? RSET_GPR8 : RSET_GPR;\n    src = osrc = ra_alloc1(as, ir->op2, allow8);\n    if (!LJ_64 && !rset_test(allow8, src)) {  /* Already in wrong register. */\n      rset_clear(allow, osrc);\n      src = ra_scratch(as, allow8);\n    }\n    rset_clear(allow, src);\n  }\n  if (ir->o == IR_FSTORE) {\n    asm_fusefref(as, IR(ir->op1), allow);\n  } else {\n    asm_fusexref(as, ir->op1, allow);\n    if (LJ_32 && ir->o == IR_HIOP) as->mrm.ofs += 4;\n  }\n  if (ra_hasreg(src)) {\n    x86Op xo;\n    switch (irt_type(ir->t)) {\n    case IRT_I8: case IRT_U8: xo = XO_MOVtob; src |= FORCE_REX; break;\n    case IRT_I16: case IRT_U16: xo = XO_MOVtow; break;\n    case IRT_NUM: xo = XO_MOVSDto; break;\n    case IRT_FLOAT: xo = XO_MOVSSto; break;\n#if LJ_64\n    case IRT_LIGHTUD: lua_assert(0);  /* NYI: mask 64 bit lightuserdata. */\n#endif\n    default:\n      if (LJ_64 && irt_is64(ir->t))\n\tsrc |= REX_64;\n      else\n\tlua_assert(irt_isint(ir->t) || irt_isu32(ir->t) || irt_isaddr(ir->t));\n      xo = XO_MOVto;\n      break;\n    }\n    emit_mrm(as, xo, src, RID_MRM);\n    if (!LJ_64 && src != osrc) {\n      ra_noweak(as, osrc);\n      emit_rr(as, XO_MOV, src, osrc);\n    }\n  } else {\n    if (irt_isi8(ir->t) || irt_isu8(ir->t)) {\n      emit_i8(as, k);\n      emit_mrm(as, XO_MOVmib, 0, RID_MRM);\n    } else {\n      lua_assert(irt_is64(ir->t) || irt_isint(ir->t) || irt_isu32(ir->t) ||\n\t\t irt_isaddr(ir->t));\n      emit_i32(as, k);\n      emit_mrm(as, XO_MOVmi, REX_64IR(ir, 0), RID_MRM);\n    }\n  }\n}\n\n#if LJ_64\nstatic Reg asm_load_lightud64(ASMState *as, IRIns *ir, int typecheck)\n{\n  if (ra_used(ir) || typecheck) {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    if (typecheck) {\n      Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, dest));\n      asm_guardcc(as, CC_NE);\n      emit_i8(as, -2);\n      emit_rr(as, XO_ARITHi8, XOg_CMP, tmp);\n      emit_shifti(as, XOg_SAR|REX_64, tmp, 47);\n      emit_rr(as, XO_MOV, tmp|REX_64, dest);\n    }\n    return dest;\n  } else {\n    return RID_NONE;\n  }\n}\n#endif\n\nstatic void asm_ahuvload(ASMState *as, IRIns *ir)\n{\n  lua_assert(irt_isnum(ir->t) || irt_ispri(ir->t) || irt_isaddr(ir->t) ||\n\t     (LJ_DUALNUM && irt_isint(ir->t)));\n#if LJ_64\n  if (irt_islightud(ir->t)) {\n    Reg dest = asm_load_lightud64(as, ir, 1);\n    if (ra_hasreg(dest)) {\n      asm_fuseahuref(as, ir->op1, RSET_GPR);\n      emit_mrm(as, XO_MOV, dest|REX_64, RID_MRM);\n    }\n    return;\n  } else\n#endif\n  if (ra_used(ir)) {\n    RegSet allow = irt_isnum(ir->t) ? RSET_FPR : RSET_GPR;\n    Reg dest = ra_dest(as, ir, allow);\n    asm_fuseahuref(as, ir->op1, RSET_GPR);\n    emit_mrm(as, dest < RID_MAX_GPR ? XO_MOV : XMM_MOVRM(as), dest, RID_MRM);\n  } else {\n    asm_fuseahuref(as, ir->op1, RSET_GPR);\n  }\n  /* Always do the type check, even if the load result is unused. */\n  as->mrm.ofs += 4;\n  asm_guardcc(as, irt_isnum(ir->t) ? CC_AE : CC_NE);\n  if (LJ_64 && irt_type(ir->t) >= IRT_NUM) {\n    lua_assert(irt_isinteger(ir->t) || irt_isnum(ir->t));\n    emit_u32(as, LJ_TISNUM);\n    emit_mrm(as, XO_ARITHi, XOg_CMP, RID_MRM);\n  } else {\n    emit_i8(as, irt_toitype(ir->t));\n    emit_mrm(as, XO_ARITHi8, XOg_CMP, RID_MRM);\n  }\n}\n\nstatic void asm_ahustore(ASMState *as, IRIns *ir)\n{\n  if (ir->r == RID_SINK)\n    return;\n  if (irt_isnum(ir->t)) {\n    Reg src = ra_alloc1(as, ir->op2, RSET_FPR);\n    asm_fuseahuref(as, ir->op1, RSET_GPR);\n    emit_mrm(as, XO_MOVSDto, src, RID_MRM);\n#if LJ_64\n  } else if (irt_islightud(ir->t)) {\n    Reg src = ra_alloc1(as, ir->op2, RSET_GPR);\n    asm_fuseahuref(as, ir->op1, rset_exclude(RSET_GPR, src));\n    emit_mrm(as, XO_MOVto, src|REX_64, RID_MRM);\n#endif\n  } else {\n    IRIns *irr = IR(ir->op2);\n    RegSet allow = RSET_GPR;\n    Reg src = RID_NONE;\n    if (!irref_isk(ir->op2)) {\n      src = ra_alloc1(as, ir->op2, allow);\n      rset_clear(allow, src);\n    }\n    asm_fuseahuref(as, ir->op1, allow);\n    if (ra_hasreg(src)) {\n      emit_mrm(as, XO_MOVto, src, RID_MRM);\n    } else if (!irt_ispri(irr->t)) {\n      lua_assert(irt_isaddr(ir->t) || (LJ_DUALNUM && irt_isinteger(ir->t)));\n      emit_i32(as, irr->i);\n      emit_mrm(as, XO_MOVmi, 0, RID_MRM);\n    }\n    as->mrm.ofs += 4;\n    emit_i32(as, (int32_t)irt_toitype(ir->t));\n    emit_mrm(as, XO_MOVmi, 0, RID_MRM);\n  }\n}\n\nstatic void asm_sload(ASMState *as, IRIns *ir)\n{\n  int32_t ofs = 8*((int32_t)ir->op1-1) + ((ir->op2 & IRSLOAD_FRAME) ? 4 : 0);\n  IRType1 t = ir->t;\n  Reg base;\n  lua_assert(!(ir->op2 & IRSLOAD_PARENT));  /* Handled by asm_head_side(). */\n  lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK));\n  lua_assert(LJ_DUALNUM ||\n\t     !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME)));\n  if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) {\n    Reg left = ra_scratch(as, RSET_FPR);\n    asm_tointg(as, ir, left);  /* Frees dest reg. Do this before base alloc. */\n    base = ra_alloc1(as, REF_BASE, RSET_GPR);\n    emit_rmro(as, XMM_MOVRM(as), left, base, ofs);\n    t.irt = IRT_NUM;  /* Continue with a regular number type check. */\n#if LJ_64\n  } else if (irt_islightud(t)) {\n    Reg dest = asm_load_lightud64(as, ir, (ir->op2 & IRSLOAD_TYPECHECK));\n    if (ra_hasreg(dest)) {\n      base = ra_alloc1(as, REF_BASE, RSET_GPR);\n      emit_rmro(as, XO_MOV, dest|REX_64, base, ofs);\n    }\n    return;\n#endif\n  } else if (ra_used(ir)) {\n    RegSet allow = irt_isnum(t) ? RSET_FPR : RSET_GPR;\n    Reg dest = ra_dest(as, ir, allow);\n    base = ra_alloc1(as, REF_BASE, RSET_GPR);\n    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));\n    if ((ir->op2 & IRSLOAD_CONVERT)) {\n      t.irt = irt_isint(t) ? IRT_NUM : IRT_INT;  /* Check for original type. */\n      emit_rmro(as, irt_isint(t) ? XO_CVTSI2SD : XO_CVTSD2SI, dest, base, ofs);\n    } else if (irt_isnum(t)) {\n      emit_rmro(as, XMM_MOVRM(as), dest, base, ofs);\n    } else {\n      emit_rmro(as, XO_MOV, dest, base, ofs);\n    }\n  } else {\n    if (!(ir->op2 & IRSLOAD_TYPECHECK))\n      return;  /* No type check: avoid base alloc. */\n    base = ra_alloc1(as, REF_BASE, RSET_GPR);\n  }\n  if ((ir->op2 & IRSLOAD_TYPECHECK)) {\n    /* Need type check, even if the load result is unused. */\n    asm_guardcc(as, irt_isnum(t) ? CC_AE : CC_NE);\n    if (LJ_64 && irt_type(t) >= IRT_NUM) {\n      lua_assert(irt_isinteger(t) || irt_isnum(t));\n      emit_u32(as, LJ_TISNUM);\n      emit_rmro(as, XO_ARITHi, XOg_CMP, base, ofs+4);\n    } else {\n      emit_i8(as, irt_toitype(t));\n      emit_rmro(as, XO_ARITHi8, XOg_CMP, base, ofs+4);\n    }\n  }\n}\n\n/* -- Allocations --------------------------------------------------------- */\n\n#if LJ_HASFFI\nstatic void asm_cnew(ASMState *as, IRIns *ir)\n{\n  CTState *cts = ctype_ctsG(J2G(as->J));\n  CTypeID ctypeid = (CTypeID)IR(ir->op1)->i;\n  CTSize sz = (ir->o == IR_CNEWI || ir->op2 == REF_NIL) ?\n\t      lj_ctype_size(cts, ctypeid) : (CTSize)IR(ir->op2)->i;\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_mem_newgco];\n  IRRef args[2];\n  lua_assert(sz != CTSIZE_INVALID);\n\n  args[0] = ASMREF_L;     /* lua_State *L */\n  args[1] = ASMREF_TMP1;  /* MSize size   */\n  as->gcsteps++;\n  asm_setupresult(as, ir, ci);  /* GCcdata * */\n\n  /* Initialize immutable cdata object. */\n  if (ir->o == IR_CNEWI) {\n    RegSet allow = (RSET_GPR & ~RSET_SCRATCH);\n#if LJ_64\n    Reg r64 = sz == 8 ? REX_64 : 0;\n    if (irref_isk(ir->op2)) {\n      IRIns *irk = IR(ir->op2);\n      uint64_t k = irk->o == IR_KINT64 ? ir_k64(irk)->u64 :\n\t\t\t\t\t (uint64_t)(uint32_t)irk->i;\n      if (sz == 4 || checki32((int64_t)k)) {\n\temit_i32(as, (int32_t)k);\n\temit_rmro(as, XO_MOVmi, r64, RID_RET, sizeof(GCcdata));\n      } else {\n\temit_movtomro(as, RID_ECX + r64, RID_RET, sizeof(GCcdata));\n\temit_loadu64(as, RID_ECX, k);\n      }\n    } else {\n      Reg r = ra_alloc1(as, ir->op2, allow);\n      emit_movtomro(as, r + r64, RID_RET, sizeof(GCcdata));\n    }\n#else\n    int32_t ofs = sizeof(GCcdata);\n    if (sz == 8) {\n      ofs += 4; ir++;\n      lua_assert(ir->o == IR_HIOP);\n    }\n    do {\n      if (irref_isk(ir->op2)) {\n\temit_movmroi(as, RID_RET, ofs, IR(ir->op2)->i);\n      } else {\n\tReg r = ra_alloc1(as, ir->op2, allow);\n\temit_movtomro(as, r, RID_RET, ofs);\n\trset_clear(allow, r);\n      }\n      if (ofs == sizeof(GCcdata)) break;\n      ofs -= 4; ir--;\n    } while (1);\n#endif\n    lua_assert(sz == 4 || sz == 8);\n  }\n\n  /* Combine initialization of marked, gct and ctypeid. */\n  emit_movtomro(as, RID_ECX, RID_RET, offsetof(GCcdata, marked));\n  emit_gri(as, XG_ARITHi(XOg_OR), RID_ECX,\n\t   (int32_t)((~LJ_TCDATA<<8)+(ctypeid<<16)));\n  emit_gri(as, XG_ARITHi(XOg_AND), RID_ECX, LJ_GC_WHITES);\n  emit_opgl(as, XO_MOVZXb, RID_ECX, gc.currentwhite);\n\n  asm_gencall(as, ci, args);\n  emit_loadi(as, ra_releasetmp(as, ASMREF_TMP1), (int32_t)(sz+sizeof(GCcdata)));\n}\n#else\n#define asm_cnew(as, ir)\t((void)0)\n#endif\n\n/* -- Write barriers ------------------------------------------------------ */\n\nstatic void asm_tbar(ASMState *as, IRIns *ir)\n{\n  Reg tab = ra_alloc1(as, ir->op1, RSET_GPR);\n  Reg tmp = ra_scratch(as, rset_exclude(RSET_GPR, tab));\n  MCLabel l_end = emit_label(as);\n  emit_movtomro(as, tmp, tab, offsetof(GCtab, gclist));\n  emit_setgl(as, tab, gc.grayagain);\n  emit_getgl(as, tmp, gc.grayagain);\n  emit_i8(as, ~LJ_GC_BLACK);\n  emit_rmro(as, XO_ARITHib, XOg_AND, tab, offsetof(GCtab, marked));\n  emit_sjcc(as, CC_Z, l_end);\n  emit_i8(as, LJ_GC_BLACK);\n  emit_rmro(as, XO_GROUP3b, XOg_TEST, tab, offsetof(GCtab, marked));\n}\n\nstatic void asm_obar(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_barrieruv];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg obj;\n  /* No need for other object barriers (yet). */\n  lua_assert(IR(ir->op1)->o == IR_UREFC);\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ir->op1;      /* TValue *tv      */\n  asm_gencall(as, ci, args);\n  emit_loada(as, ra_releasetmp(as, ASMREF_TMP1), J2G(as->J));\n  obj = IR(ir->op1)->r;\n  emit_sjcc(as, CC_Z, l_end);\n  emit_i8(as, LJ_GC_WHITES);\n  if (irref_isk(ir->op2)) {\n    GCobj *vp = ir_kgc(IR(ir->op2));\n    emit_rma(as, XO_GROUP3b, XOg_TEST, &vp->gch.marked);\n  } else {\n    Reg val = ra_alloc1(as, ir->op2, rset_exclude(RSET_SCRATCH&RSET_GPR, obj));\n    emit_rmro(as, XO_GROUP3b, XOg_TEST, val, (int32_t)offsetof(GChead, marked));\n  }\n  emit_sjcc(as, CC_Z, l_end);\n  emit_i8(as, LJ_GC_BLACK);\n  emit_rmro(as, XO_GROUP3b, XOg_TEST, obj,\n\t    (int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv));\n}\n\n/* -- FP/int arithmetic and logic operations ------------------------------ */\n\n/* Load reference onto x87 stack. Force a spill to memory if needed. */\nstatic void asm_x87load(ASMState *as, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (ir->o == IR_KNUM) {\n    cTValue *tv = ir_knum(ir);\n    if (tvispzero(tv))  /* Use fldz only for +0. */\n      emit_x87op(as, XI_FLDZ);\n    else if (tvispone(tv))\n      emit_x87op(as, XI_FLD1);\n    else\n      emit_rma(as, XO_FLDq, XOg_FLDq, tv);\n  } else if (ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT && !ra_used(ir) &&\n\t     !irref_isk(ir->op1) && mayfuse(as, ir->op1)) {\n    IRIns *iri = IR(ir->op1);\n    emit_rmro(as, XO_FILDd, XOg_FILDd, RID_ESP, ra_spill(as, iri));\n  } else {\n    emit_mrm(as, XO_FLDq, XOg_FLDq, asm_fuseload(as, ref, RSET_EMPTY));\n  }\n}\n\n/* Try to rejoin pow from EXP2, MUL and LOG2 (if still unsplit). */\nstatic int fpmjoin_pow(ASMState *as, IRIns *ir)\n{\n  IRIns *irp = IR(ir->op1);\n  if (irp == ir-1 && irp->o == IR_MUL && !ra_used(irp)) {\n    IRIns *irpp = IR(irp->op1);\n    if (irpp == ir-2 && irpp->o == IR_FPMATH &&\n\tirpp->op2 == IRFPM_LOG2 && !ra_used(irpp)) {\n      /* The modified regs must match with the *.dasc implementation. */\n      RegSet drop = RSET_RANGE(RID_XMM0, RID_XMM2+1)|RID2RSET(RID_EAX);\n      IRIns *irx;\n      if (ra_hasreg(ir->r))\n\trset_clear(drop, ir->r);  /* Dest reg handled below. */\n      ra_evictset(as, drop);\n      ra_destreg(as, ir, RID_XMM0);\n      emit_call(as, lj_vm_pow_sse);\n      irx = IR(irpp->op1);\n      if (ra_noreg(irx->r) && ra_gethint(irx->r) == RID_XMM1)\n\tirx->r = RID_INIT;  /* Avoid allocating xmm1 for x. */\n      ra_left(as, RID_XMM0, irpp->op1);\n      ra_left(as, RID_XMM1, irp->op2);\n      return 1;\n    }\n  }\n  return 0;\n}\n\nstatic void asm_fpmath(ASMState *as, IRIns *ir)\n{\n  IRFPMathOp fpm = ir->o == IR_FPMATH ? (IRFPMathOp)ir->op2 : IRFPM_OTHER;\n  if (fpm == IRFPM_SQRT) {\n    Reg dest = ra_dest(as, ir, RSET_FPR);\n    Reg left = asm_fuseload(as, ir->op1, RSET_FPR);\n    emit_mrm(as, XO_SQRTSD, dest, left);\n  } else if (fpm <= IRFPM_TRUNC) {\n    if (as->flags & JIT_F_SSE4_1) {  /* SSE4.1 has a rounding instruction. */\n      Reg dest = ra_dest(as, ir, RSET_FPR);\n      Reg left = asm_fuseload(as, ir->op1, RSET_FPR);\n      /* ROUNDSD has a 4-byte opcode which doesn't fit in x86Op.\n      ** Let's pretend it's a 3-byte opcode, and compensate afterwards.\n      ** This is atrocious, but the alternatives are much worse.\n      */\n      /* Round down/up/trunc == 1001/1010/1011. */\n      emit_i8(as, 0x09 + fpm);\n      emit_mrm(as, XO_ROUNDSD, dest, left);\n      if (LJ_64 && as->mcp[1] != (MCode)(XO_ROUNDSD >> 16)) {\n\tas->mcp[0] = as->mcp[1]; as->mcp[1] = 0x0f;  /* Swap 0F and REX. */\n      }\n      *--as->mcp = 0x66;  /* 1st byte of ROUNDSD opcode. */\n    } else {  /* Call helper functions for SSE2 variant. */\n      /* The modified regs must match with the *.dasc implementation. */\n      RegSet drop = RSET_RANGE(RID_XMM0, RID_XMM3+1)|RID2RSET(RID_EAX);\n      if (ra_hasreg(ir->r))\n\trset_clear(drop, ir->r);  /* Dest reg handled below. */\n      ra_evictset(as, drop);\n      ra_destreg(as, ir, RID_XMM0);\n      emit_call(as, fpm == IRFPM_FLOOR ? lj_vm_floor_sse :\n\t\t    fpm == IRFPM_CEIL ? lj_vm_ceil_sse : lj_vm_trunc_sse);\n      ra_left(as, RID_XMM0, ir->op1);\n    }\n  } else if (fpm == IRFPM_EXP2 && fpmjoin_pow(as, ir)) {\n    /* Rejoined to pow(). */\n  } else {  /* Handle x87 ops. */\n    int32_t ofs = sps_scale(ir->s);  /* Use spill slot or temp slots. */\n    Reg dest = ir->r;\n    if (ra_hasreg(dest)) {\n      ra_free(as, dest);\n      ra_modified(as, dest);\n      emit_rmro(as, XMM_MOVRM(as), dest, RID_ESP, ofs);\n    }\n    emit_rmro(as, XO_FSTPq, XOg_FSTPq, RID_ESP, ofs);\n    switch (fpm) {  /* st0 = lj_vm_*(st0) */\n    case IRFPM_EXP: emit_call(as, lj_vm_exp_x87); break;\n    case IRFPM_EXP2: emit_call(as, lj_vm_exp2_x87); break;\n    case IRFPM_SIN: emit_x87op(as, XI_FSIN); break;\n    case IRFPM_COS: emit_x87op(as, XI_FCOS); break;\n    case IRFPM_TAN: emit_x87op(as, XI_FPOP); emit_x87op(as, XI_FPTAN); break;\n    case IRFPM_LOG: case IRFPM_LOG2: case IRFPM_LOG10:\n      /* Note: the use of fyl2xp1 would be pointless here. When computing\n      ** log(1.0+eps) the precision is already lost after 1.0 is added.\n      ** Subtracting 1.0 won't recover it. OTOH math.log1p would make sense.\n      */\n      emit_x87op(as, XI_FYL2X); break;\n    case IRFPM_OTHER:\n      switch (ir->o) {\n      case IR_ATAN2:\n\temit_x87op(as, XI_FPATAN); asm_x87load(as, ir->op2); break;\n      case IR_LDEXP:\n\temit_x87op(as, XI_FPOP1); emit_x87op(as, XI_FSCALE); break;\n      default: lua_assert(0); break;\n      }\n      break;\n    default: lua_assert(0); break;\n    }\n    asm_x87load(as, ir->op1);\n    switch (fpm) {\n    case IRFPM_LOG: emit_x87op(as, XI_FLDLN2); break;\n    case IRFPM_LOG2: emit_x87op(as, XI_FLD1); break;\n    case IRFPM_LOG10: emit_x87op(as, XI_FLDLG2); break;\n    case IRFPM_OTHER:\n      if (ir->o == IR_LDEXP) asm_x87load(as, ir->op2);\n      break;\n    default: break;\n    }\n  }\n}\n\nstatic void asm_fppowi(ASMState *as, IRIns *ir)\n{\n  /* The modified regs must match with the *.dasc implementation. */\n  RegSet drop = RSET_RANGE(RID_XMM0, RID_XMM1+1)|RID2RSET(RID_EAX);\n  if (ra_hasreg(ir->r))\n    rset_clear(drop, ir->r);  /* Dest reg handled below. */\n  ra_evictset(as, drop);\n  ra_destreg(as, ir, RID_XMM0);\n  emit_call(as, lj_vm_powi_sse);\n  ra_left(as, RID_XMM0, ir->op1);\n  ra_left(as, RID_EAX, ir->op2);\n}\n\n#if LJ_64 && LJ_HASFFI\nstatic void asm_arith64(ASMState *as, IRIns *ir, IRCallID id)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[id];\n  IRRef args[2];\n  args[0] = ir->op1;\n  args[1] = ir->op2;\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n#endif\n\nstatic void asm_intmod(ASMState *as, IRIns *ir)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_vm_modi];\n  IRRef args[2];\n  args[0] = ir->op1;\n  args[1] = ir->op2;\n  asm_setupresult(as, ir, ci);\n  asm_gencall(as, ci, args);\n}\n\nstatic int asm_swapops(ASMState *as, IRIns *ir)\n{\n  IRIns *irl = IR(ir->op1);\n  IRIns *irr = IR(ir->op2);\n  lua_assert(ra_noreg(irr->r));\n  if (!irm_iscomm(lj_ir_mode[ir->o]))\n    return 0;  /* Can't swap non-commutative operations. */\n  if (irref_isk(ir->op2))\n    return 0;  /* Don't swap constants to the left. */\n  if (ra_hasreg(irl->r))\n    return 1;  /* Swap if left already has a register. */\n  if (ra_samehint(ir->r, irr->r))\n    return 1;  /* Swap if dest and right have matching hints. */\n  if (as->curins > as->loopref) {  /* In variant part? */\n    if (ir->op2 < as->loopref && !irt_isphi(irr->t))\n      return 0;  /* Keep invariants on the right. */\n    if (ir->op1 < as->loopref && !irt_isphi(irl->t))\n      return 1;  /* Swap invariants to the right. */\n  }\n  if (opisfusableload(irl->o))\n    return 1;  /* Swap fusable loads to the right. */\n  return 0;  /* Otherwise don't swap. */\n}\n\nstatic void asm_fparith(ASMState *as, IRIns *ir, x86Op xo)\n{\n  IRRef lref = ir->op1;\n  IRRef rref = ir->op2;\n  RegSet allow = RSET_FPR;\n  Reg dest;\n  Reg right = IR(rref)->r;\n  if (ra_hasreg(right)) {\n    rset_clear(allow, right);\n    ra_noweak(as, right);\n  }\n  dest = ra_dest(as, ir, allow);\n  if (lref == rref) {\n    right = dest;\n  } else if (ra_noreg(right)) {\n    if (asm_swapops(as, ir)) {\n      IRRef tmp = lref; lref = rref; rref = tmp;\n    }\n    right = asm_fuseload(as, rref, rset_clear(allow, dest));\n  }\n  emit_mrm(as, xo, dest, right);\n  ra_left(as, dest, lref);\n}\n\nstatic void asm_intarith(ASMState *as, IRIns *ir, x86Arith xa)\n{\n  IRRef lref = ir->op1;\n  IRRef rref = ir->op2;\n  RegSet allow = RSET_GPR;\n  Reg dest, right;\n  int32_t k = 0;\n  if (as->flagmcp == as->mcp) {  /* Drop test r,r instruction. */\n    as->flagmcp = NULL;\n    as->mcp += (LJ_64 && *as->mcp < XI_TESTb) ? 3 : 2;\n  }\n  right = IR(rref)->r;\n  if (ra_hasreg(right)) {\n    rset_clear(allow, right);\n    ra_noweak(as, right);\n  }\n  dest = ra_dest(as, ir, allow);\n  if (lref == rref) {\n    right = dest;\n  } else if (ra_noreg(right) && !asm_isk32(as, rref, &k)) {\n    if (asm_swapops(as, ir)) {\n      IRRef tmp = lref; lref = rref; rref = tmp;\n    }\n    right = asm_fuseloadm(as, rref, rset_clear(allow, dest), irt_is64(ir->t));\n  }\n  if (irt_isguard(ir->t))  /* For IR_ADDOV etc. */\n    asm_guardcc(as, CC_O);\n  if (xa != XOg_X_IMUL) {\n    if (ra_hasreg(right))\n      emit_mrm(as, XO_ARITH(xa), REX_64IR(ir, dest), right);\n    else\n      emit_gri(as, XG_ARITHi(xa), REX_64IR(ir, dest), k);\n  } else if (ra_hasreg(right)) {  /* IMUL r, mrm. */\n    emit_mrm(as, XO_IMUL, REX_64IR(ir, dest), right);\n  } else {  /* IMUL r, r, k. */\n    /* NYI: use lea/shl/add/sub (FOLD only does 2^k) depending on CPU. */\n    Reg left = asm_fuseloadm(as, lref, RSET_GPR, irt_is64(ir->t));\n    x86Op xo;\n    if (checki8(k)) { emit_i8(as, k); xo = XO_IMULi8;\n    } else { emit_i32(as, k); xo = XO_IMULi; }\n    emit_mrm(as, xo, REX_64IR(ir, dest), left);\n    return;\n  }\n  ra_left(as, dest, lref);\n}\n\n/* LEA is really a 4-operand ADD with an independent destination register,\n** up to two source registers and an immediate. One register can be scaled\n** by 1, 2, 4 or 8. This can be used to avoid moves or to fuse several\n** instructions.\n**\n** Currently only a few common cases are supported:\n** - 3-operand ADD:    y = a+b; y = a+k   with a and b already allocated\n** - Left ADD fusion:  y = (a+b)+k; y = (a+k)+b\n** - Right ADD fusion: y = a+(b+k)\n** The ommited variants have already been reduced by FOLD.\n**\n** There are more fusion opportunities, like gathering shifts or joining\n** common references. But these are probably not worth the trouble, since\n** array indexing is not decomposed and already makes use of all fields\n** of the ModRM operand.\n*/\nstatic int asm_lea(ASMState *as, IRIns *ir)\n{\n  IRIns *irl = IR(ir->op1);\n  IRIns *irr = IR(ir->op2);\n  RegSet allow = RSET_GPR;\n  Reg dest;\n  as->mrm.base = as->mrm.idx = RID_NONE;\n  as->mrm.scale = XM_SCALE1;\n  as->mrm.ofs = 0;\n  if (ra_hasreg(irl->r)) {\n    rset_clear(allow, irl->r);\n    ra_noweak(as, irl->r);\n    as->mrm.base = irl->r;\n    if (irref_isk(ir->op2) || ra_hasreg(irr->r)) {\n      /* The PHI renaming logic does a better job in some cases. */\n      if (ra_hasreg(ir->r) &&\n\t  ((irt_isphi(irl->t) && as->phireg[ir->r] == ir->op1) ||\n\t   (irt_isphi(irr->t) && as->phireg[ir->r] == ir->op2)))\n\treturn 0;\n      if (irref_isk(ir->op2)) {\n\tas->mrm.ofs = irr->i;\n      } else {\n\trset_clear(allow, irr->r);\n\tra_noweak(as, irr->r);\n\tas->mrm.idx = irr->r;\n      }\n    } else if (irr->o == IR_ADD && mayfuse(as, ir->op2) &&\n\t       irref_isk(irr->op2)) {\n      Reg idx = ra_alloc1(as, irr->op1, allow);\n      rset_clear(allow, idx);\n      as->mrm.idx = (uint8_t)idx;\n      as->mrm.ofs = IR(irr->op2)->i;\n    } else {\n      return 0;\n    }\n  } else if (ir->op1 != ir->op2 && irl->o == IR_ADD && mayfuse(as, ir->op1) &&\n\t     (irref_isk(ir->op2) || irref_isk(irl->op2))) {\n    Reg idx, base = ra_alloc1(as, irl->op1, allow);\n    rset_clear(allow, base);\n    as->mrm.base = (uint8_t)base;\n    if (irref_isk(ir->op2)) {\n      as->mrm.ofs = irr->i;\n      idx = ra_alloc1(as, irl->op2, allow);\n    } else {\n      as->mrm.ofs = IR(irl->op2)->i;\n      idx = ra_alloc1(as, ir->op2, allow);\n    }\n    rset_clear(allow, idx);\n    as->mrm.idx = (uint8_t)idx;\n  } else {\n    return 0;\n  }\n  dest = ra_dest(as, ir, allow);\n  emit_mrm(as, XO_LEA, dest, RID_MRM);\n  return 1;  /* Success. */\n}\n\nstatic void asm_add(ASMState *as, IRIns *ir)\n{\n  if (irt_isnum(ir->t))\n    asm_fparith(as, ir, XO_ADDSD);\n  else if ((as->flags & JIT_F_LEA_AGU) || as->flagmcp == as->mcp ||\n\t   irt_is64(ir->t) || !asm_lea(as, ir))\n    asm_intarith(as, ir, XOg_ADD);\n}\n\nstatic void asm_neg_not(ASMState *as, IRIns *ir, x86Group3 xg)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  emit_rr(as, XO_GROUP3, REX_64IR(ir, xg), dest);\n  ra_left(as, dest, ir->op1);\n}\n\nstatic void asm_min_max(ASMState *as, IRIns *ir, int cc)\n{\n  Reg right, dest = ra_dest(as, ir, RSET_GPR);\n  IRRef lref = ir->op1, rref = ir->op2;\n  if (irref_isk(rref)) { lref = rref; rref = ir->op1; }\n  right = ra_alloc1(as, rref, rset_exclude(RSET_GPR, dest));\n  emit_rr(as, XO_CMOV + (cc<<24), REX_64IR(ir, dest), right);\n  emit_rr(as, XO_CMP, REX_64IR(ir, dest), right);\n  ra_left(as, dest, lref);\n}\n\nstatic void asm_bitswap(ASMState *as, IRIns *ir)\n{\n  Reg dest = ra_dest(as, ir, RSET_GPR);\n  as->mcp = emit_op(XO_BSWAP + ((dest&7) << 24),\n\t\t    REX_64IR(ir, 0), dest, 0, as->mcp, 1);\n  ra_left(as, dest, ir->op1);\n}\n\nstatic void asm_bitshift(ASMState *as, IRIns *ir, x86Shift xs)\n{\n  IRRef rref = ir->op2;\n  IRIns *irr = IR(rref);\n  Reg dest;\n  if (irref_isk(rref)) {  /* Constant shifts. */\n    int shift;\n    dest = ra_dest(as, ir, RSET_GPR);\n    shift = irr->i & (irt_is64(ir->t) ? 63 : 31);\n    switch (shift) {\n    case 0: break;\n    case 1: emit_rr(as, XO_SHIFT1, REX_64IR(ir, xs), dest); break;\n    default: emit_shifti(as, REX_64IR(ir, xs), dest, shift); break;\n    }\n  } else {  /* Variable shifts implicitly use register cl (i.e. ecx). */\n    Reg right;\n    dest = ra_dest(as, ir, rset_exclude(RSET_GPR, RID_ECX));\n    if (dest == RID_ECX) {\n      dest = ra_scratch(as, rset_exclude(RSET_GPR, RID_ECX));\n      emit_rr(as, XO_MOV, RID_ECX, dest);\n    }\n    right = irr->r;\n    if (ra_noreg(right))\n      right = ra_allocref(as, rref, RID2RSET(RID_ECX));\n    else if (right != RID_ECX)\n      ra_scratch(as, RID2RSET(RID_ECX));\n    emit_rr(as, XO_SHIFTcl, REX_64IR(ir, xs), dest);\n    ra_noweak(as, right);\n    if (right != RID_ECX)\n      emit_rr(as, XO_MOV, RID_ECX, right);\n  }\n  ra_left(as, dest, ir->op1);\n  /*\n  ** Note: avoid using the flags resulting from a shift or rotate!\n  ** All of them cause a partial flag stall, except for r,1 shifts\n  ** (but not rotates). And a shift count of 0 leaves the flags unmodified.\n  */\n}\n\n/* -- Comparisons --------------------------------------------------------- */\n\n/* Virtual flags for unordered FP comparisons. */\n#define VCC_U\t0x1000\t\t/* Unordered. */\n#define VCC_P\t0x2000\t\t/* Needs extra CC_P branch. */\n#define VCC_S\t0x4000\t\t/* Swap avoids CC_P branch. */\n#define VCC_PS\t(VCC_P|VCC_S)\n\n/* Map of comparisons to flags. ORDER IR. */\n#define COMPFLAGS(ci, cin, cu, cf)\t((ci)+((cu)<<4)+((cin)<<8)+(cf))\nstatic const uint16_t asm_compmap[IR_ABC+1] = {\n  /*                 signed non-eq unsigned flags */\n  /* LT  */ COMPFLAGS(CC_GE, CC_G,  CC_AE, VCC_PS),\n  /* GE  */ COMPFLAGS(CC_L,  CC_L,  CC_B,  0),\n  /* LE  */ COMPFLAGS(CC_G,  CC_G,  CC_A,  VCC_PS),\n  /* GT  */ COMPFLAGS(CC_LE, CC_L,  CC_BE, 0),\n  /* ULT */ COMPFLAGS(CC_AE, CC_A,  CC_AE, VCC_U),\n  /* UGE */ COMPFLAGS(CC_B,  CC_B,  CC_B,  VCC_U|VCC_PS),\n  /* ULE */ COMPFLAGS(CC_A,  CC_A,  CC_A,  VCC_U),\n  /* UGT */ COMPFLAGS(CC_BE, CC_B,  CC_BE, VCC_U|VCC_PS),\n  /* EQ  */ COMPFLAGS(CC_NE, CC_NE, CC_NE, VCC_P),\n  /* NE  */ COMPFLAGS(CC_E,  CC_E,  CC_E,  VCC_U|VCC_P),\n  /* ABC */ COMPFLAGS(CC_BE, CC_B,  CC_BE, VCC_U|VCC_PS)  /* Same as UGT. */\n};\n\n/* FP and integer comparisons. */\nstatic void asm_comp(ASMState *as, IRIns *ir, uint32_t cc)\n{\n  if (irt_isnum(ir->t)) {\n    IRRef lref = ir->op1;\n    IRRef rref = ir->op2;\n    Reg left, right;\n    MCLabel l_around;\n    /*\n    ** An extra CC_P branch is required to preserve ordered/unordered\n    ** semantics for FP comparisons. This can be avoided by swapping\n    ** the operands and inverting the condition (except for EQ and UNE).\n    ** So always try to swap if possible.\n    **\n    ** Another option would be to swap operands to achieve better memory\n    ** operand fusion. But it's unlikely that this outweighs the cost\n    ** of the extra branches.\n    */\n    if (cc & VCC_S) {  /* Swap? */\n      IRRef tmp = lref; lref = rref; rref = tmp;\n      cc ^= (VCC_PS|(5<<4));  /* A <-> B, AE <-> BE, PS <-> none */\n    }\n    left = ra_alloc1(as, lref, RSET_FPR);\n    right = asm_fuseload(as, rref, rset_exclude(RSET_FPR, left));\n    l_around = emit_label(as);\n    asm_guardcc(as, cc >> 4);\n    if (cc & VCC_P) {  /* Extra CC_P branch required? */\n      if (!(cc & VCC_U)) {\n\tasm_guardcc(as, CC_P);  /* Branch to exit for ordered comparisons. */\n      } else if (l_around != as->invmcp) {\n\temit_sjcc(as, CC_P, l_around);  /* Branch around for unordered. */\n      } else {\n\t/* Patched to mcloop by asm_loop_fixup. */\n\tas->loopinv = 2;\n\tif (as->realign)\n\t  emit_sjcc(as, CC_P, as->mcp);\n\telse\n\t  emit_jcc(as, CC_P, as->mcp);\n      }\n    }\n    emit_mrm(as, XO_UCOMISD, left, right);\n  } else {\n    IRRef lref = ir->op1, rref = ir->op2;\n    IROp leftop = (IROp)(IR(lref)->o);\n    Reg r64 = REX_64IR(ir, 0);\n    int32_t imm = 0;\n    lua_assert(irt_is64(ir->t) || irt_isint(ir->t) ||\n\t       irt_isu32(ir->t) || irt_isaddr(ir->t) || irt_isu8(ir->t));\n    /* Swap constants (only for ABC) and fusable loads to the right. */\n    if (irref_isk(lref) || (!irref_isk(rref) && opisfusableload(leftop))) {\n      if ((cc & 0xc) == 0xc) cc ^= 0x53;  /* L <-> G, LE <-> GE */\n      else if ((cc & 0xa) == 0x2) cc ^= 0x55;  /* A <-> B, AE <-> BE */\n      lref = ir->op2; rref = ir->op1;\n    }\n    if (asm_isk32(as, rref, &imm)) {\n      IRIns *irl = IR(lref);\n      /* Check wether we can use test ins. Not for unsigned, since CF=0. */\n      int usetest = (imm == 0 && (cc & 0xa) != 0x2);\n      if (usetest && irl->o == IR_BAND && irl+1 == ir && !ra_used(irl)) {\n\t/* Combine comp(BAND(ref, r/imm), 0) into test mrm, r/imm. */\n\tReg right, left = RID_NONE;\n\tRegSet allow = RSET_GPR;\n\tif (!asm_isk32(as, irl->op2, &imm)) {\n\t  left = ra_alloc1(as, irl->op2, allow);\n\t  rset_clear(allow, left);\n\t} else {  /* Try to Fuse IRT_I8/IRT_U8 loads, too. See below. */\n\t  IRIns *irll = IR(irl->op1);\n\t  if (opisfusableload((IROp)irll->o) &&\n\t      (irt_isi8(irll->t) || irt_isu8(irll->t))) {\n\t    IRType1 origt = irll->t;  /* Temporarily flip types. */\n\t    irll->t.irt = (irll->t.irt & ~IRT_TYPE) | IRT_INT;\n\t    as->curins--;  /* Skip to BAND to avoid failing in noconflict(). */\n\t    right = asm_fuseload(as, irl->op1, RSET_GPR);\n\t    as->curins++;\n\t    irll->t = origt;\n\t    if (right != RID_MRM) goto test_nofuse;\n\t    /* Fusion succeeded, emit test byte mrm, imm8. */\n\t    asm_guardcc(as, cc);\n\t    emit_i8(as, (imm & 0xff));\n\t    emit_mrm(as, XO_GROUP3b, XOg_TEST, RID_MRM);\n\t    return;\n\t  }\n\t}\n\tas->curins--;  /* Skip to BAND to avoid failing in noconflict(). */\n\tright = asm_fuseloadm(as, irl->op1, allow, r64);\n\tas->curins++;  /* Undo the above. */\n      test_nofuse:\n\tasm_guardcc(as, cc);\n\tif (ra_noreg(left)) {\n\t  emit_i32(as, imm);\n\t  emit_mrm(as, XO_GROUP3, r64 + XOg_TEST, right);\n\t} else {\n\t  emit_mrm(as, XO_TEST, r64 + left, right);\n\t}\n      } else {\n\tReg left;\n\tif (opisfusableload((IROp)irl->o) &&\n\t    ((irt_isu8(irl->t) && checku8(imm)) ||\n\t     ((irt_isi8(irl->t) || irt_isi16(irl->t)) && checki8(imm)) ||\n\t     (irt_isu16(irl->t) && checku16(imm) && checki8((int16_t)imm)))) {\n\t  /* Only the IRT_INT case is fused by asm_fuseload.\n\t  ** The IRT_I8/IRT_U8 loads and some IRT_I16/IRT_U16 loads\n\t  ** are handled here.\n\t  ** Note that cmp word [mem], imm16 should not be generated,\n\t  ** since it has a length-changing prefix. Compares of a word\n\t  ** against a sign-extended imm8 are ok, however.\n\t  */\n\t  IRType1 origt = irl->t;  /* Temporarily flip types. */\n\t  irl->t.irt = (irl->t.irt & ~IRT_TYPE) | IRT_INT;\n\t  left = asm_fuseload(as, lref, RSET_GPR);\n\t  irl->t = origt;\n\t  if (left == RID_MRM) {  /* Fusion succeeded? */\n\t    if (irt_isu8(irl->t) || irt_isu16(irl->t))\n\t      cc >>= 4;  /* Need unsigned compare. */\n\t    asm_guardcc(as, cc);\n\t    emit_i8(as, imm);\n\t    emit_mrm(as, (irt_isi8(origt) || irt_isu8(origt)) ?\n\t\t\t XO_ARITHib : XO_ARITHiw8, r64 + XOg_CMP, RID_MRM);\n\t    return;\n\t  }  /* Otherwise handle register case as usual. */\n\t} else {\n\t  left = asm_fuseloadm(as, lref,\n\t\t\t       irt_isu8(ir->t) ? RSET_GPR8 : RSET_GPR, r64);\n\t}\n\tasm_guardcc(as, cc);\n\tif (usetest && left != RID_MRM) {\n\t  /* Use test r,r instead of cmp r,0. */\n\t  x86Op xo = XO_TEST;\n\t  if (irt_isu8(ir->t)) {\n\t    lua_assert(ir->o == IR_EQ || ir->o == IR_NE);\n\t    xo = XO_TESTb;\n\t    if (!rset_test(RSET_RANGE(RID_EAX, RID_EBX+1), left)) {\n\t      if (LJ_64) {\n\t\tleft |= FORCE_REX;\n\t      } else {\n\t\temit_i32(as, 0xff);\n\t\temit_mrm(as, XO_GROUP3, XOg_TEST, left);\n\t\treturn;\n\t      }\n\t    }\n\t  }\n\t  emit_rr(as, xo, r64 + left, left);\n\t  if (irl+1 == ir)  /* Referencing previous ins? */\n\t    as->flagmcp = as->mcp;  /* Set flag to drop test r,r if possible. */\n\t} else {\n\t  emit_gmrmi(as, XG_ARITHi(XOg_CMP), r64 + left, imm);\n\t}\n      }\n    } else {\n      Reg left = ra_alloc1(as, lref, RSET_GPR);\n      Reg right = asm_fuseloadm(as, rref, rset_exclude(RSET_GPR, left), r64);\n      asm_guardcc(as, cc);\n      emit_mrm(as, XO_CMP, r64 + left, right);\n    }\n  }\n}\n\n#if LJ_32 && LJ_HASFFI\n/* 64 bit integer comparisons in 32 bit mode. */\nstatic void asm_comp_int64(ASMState *as, IRIns *ir)\n{\n  uint32_t cc = asm_compmap[(ir-1)->o];\n  RegSet allow = RSET_GPR;\n  Reg lefthi = RID_NONE, leftlo = RID_NONE;\n  Reg righthi = RID_NONE, rightlo = RID_NONE;\n  MCLabel l_around;\n  x86ModRM mrm;\n\n  as->curins--;  /* Skip loword ins. Avoids failing in noconflict(), too. */\n\n  /* Allocate/fuse hiword operands. */\n  if (irref_isk(ir->op2)) {\n    lefthi = asm_fuseload(as, ir->op1, allow);\n  } else {\n    lefthi = ra_alloc1(as, ir->op1, allow);\n    righthi = asm_fuseload(as, ir->op2, allow);\n    if (righthi == RID_MRM) {\n      if (as->mrm.base != RID_NONE) rset_clear(allow, as->mrm.base);\n      if (as->mrm.idx != RID_NONE) rset_clear(allow, as->mrm.idx);\n    } else {\n      rset_clear(allow, righthi);\n    }\n  }\n  mrm = as->mrm;  /* Save state for hiword instruction. */\n\n  /* Allocate/fuse loword operands. */\n  if (irref_isk((ir-1)->op2)) {\n    leftlo = asm_fuseload(as, (ir-1)->op1, allow);\n  } else {\n    leftlo = ra_alloc1(as, (ir-1)->op1, allow);\n    rightlo = asm_fuseload(as, (ir-1)->op2, allow);\n    if (rightlo == RID_MRM) {\n      if (as->mrm.base != RID_NONE) rset_clear(allow, as->mrm.base);\n      if (as->mrm.idx != RID_NONE) rset_clear(allow, as->mrm.idx);\n    } else {\n      rset_clear(allow, rightlo);\n    }\n  }\n\n  /* All register allocations must be performed _before_ this point. */\n  l_around = emit_label(as);\n  as->invmcp = as->flagmcp = NULL;  /* Cannot use these optimizations. */\n\n  /* Loword comparison and branch. */\n  asm_guardcc(as, cc >> 4);  /* Always use unsigned compare for loword. */\n  if (ra_noreg(rightlo)) {\n    int32_t imm = IR((ir-1)->op2)->i;\n    if (imm == 0 && ((cc >> 4) & 0xa) != 0x2 && leftlo != RID_MRM)\n      emit_rr(as, XO_TEST, leftlo, leftlo);\n    else\n      emit_gmrmi(as, XG_ARITHi(XOg_CMP), leftlo, imm);\n  } else {\n    emit_mrm(as, XO_CMP, leftlo, rightlo);\n  }\n\n  /* Hiword comparison and branches. */\n  if ((cc & 15) != CC_NE)\n    emit_sjcc(as, CC_NE, l_around);  /* Hiword unequal: skip loword compare. */\n  if ((cc & 15) != CC_E)\n    asm_guardcc(as, cc >> 8);  /* Hiword compare without equality check. */\n  as->mrm = mrm;  /* Restore state. */\n  if (ra_noreg(righthi)) {\n    int32_t imm = IR(ir->op2)->i;\n    if (imm == 0 && (cc & 0xa) != 0x2 && lefthi != RID_MRM)\n      emit_rr(as, XO_TEST, lefthi, lefthi);\n    else\n      emit_gmrmi(as, XG_ARITHi(XOg_CMP), lefthi, imm);\n  } else {\n    emit_mrm(as, XO_CMP, lefthi, righthi);\n  }\n}\n#endif\n\n/* -- Support for 64 bit ops in 32 bit mode ------------------------------- */\n\n/* Hiword op of a split 64 bit op. Previous op must be the loword op. */\nstatic void asm_hiop(ASMState *as, IRIns *ir)\n{\n#if LJ_32 && LJ_HASFFI\n  /* HIOP is marked as a store because it needs its own DCE logic. */\n  int uselo = ra_used(ir-1), usehi = ra_used(ir);  /* Loword/hiword used? */\n  if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1;\n  if ((ir-1)->o == IR_CONV) {  /* Conversions to/from 64 bit. */\n    if (usehi || uselo) {\n      if (irt_isfp(ir->t))\n\tasm_conv_fp_int64(as, ir);\n      else\n\tasm_conv_int64_fp(as, ir);\n    }\n    as->curins--;  /* Always skip the CONV. */\n    return;\n  } else if ((ir-1)->o <= IR_NE) {  /* 64 bit integer comparisons. ORDER IR. */\n    asm_comp_int64(as, ir);\n    return;\n  } else if ((ir-1)->o == IR_XSTORE) {\n    if ((ir-1)->r != RID_SINK)\n      asm_fxstore(as, ir);\n    return;\n  }\n  if (!usehi) return;  /* Skip unused hiword op for all remaining ops. */\n  switch ((ir-1)->o) {\n  case IR_ADD:\n    as->flagmcp = NULL;\n    as->curins--;\n    asm_intarith(as, ir, XOg_ADC);\n    asm_intarith(as, ir-1, XOg_ADD);\n    break;\n  case IR_SUB:\n    as->flagmcp = NULL;\n    as->curins--;\n    asm_intarith(as, ir, XOg_SBB);\n    asm_intarith(as, ir-1, XOg_SUB);\n    break;\n  case IR_NEG: {\n    Reg dest = ra_dest(as, ir, RSET_GPR);\n    emit_rr(as, XO_GROUP3, XOg_NEG, dest);\n    emit_i8(as, 0);\n    emit_rr(as, XO_ARITHi8, XOg_ADC, dest);\n    ra_left(as, dest, ir->op1);\n    as->curins--;\n    asm_neg_not(as, ir-1, XOg_NEG);\n    break;\n    }\n  case IR_CALLN:\n  case IR_CALLXS:\n    if (!uselo)\n      ra_allocref(as, ir->op1, RID2RSET(RID_RETLO));  /* Mark lo op as used. */\n    break;\n  case IR_CNEWI:\n    /* Nothing to do here. Handled by CNEWI itself. */\n    break;\n  default: lua_assert(0); break;\n  }\n#else\n  UNUSED(as); UNUSED(ir); lua_assert(0);  /* Unused on x64 or without FFI. */\n#endif\n}\n\n/* -- Stack handling ------------------------------------------------------ */\n\n/* Check Lua stack size for overflow. Use exit handler as fallback. */\nstatic void asm_stack_check(ASMState *as, BCReg topslot,\n\t\t\t    IRIns *irp, RegSet allow, ExitNo exitno)\n{\n  /* Try to get an unused temp. register, otherwise spill/restore eax. */\n  Reg pbase = irp ? irp->r : RID_BASE;\n  Reg r = allow ? rset_pickbot(allow) : RID_EAX;\n  emit_jcc(as, CC_B, exitstub_addr(as->J, exitno));\n  if (allow == RSET_EMPTY)  /* Restore temp. register. */\n    emit_rmro(as, XO_MOV, r|REX_64, RID_ESP, 0);\n  else\n    ra_modified(as, r);\n  emit_gri(as, XG_ARITHi(XOg_CMP), r, (int32_t)(8*topslot));\n  if (ra_hasreg(pbase) && pbase != r)\n    emit_rr(as, XO_ARITH(XOg_SUB), r, pbase);\n  else\n    emit_rmro(as, XO_ARITH(XOg_SUB), r, RID_NONE,\n\t      ptr2addr(&J2G(as->J)->jit_base));\n  emit_rmro(as, XO_MOV, r, r, offsetof(lua_State, maxstack));\n  emit_getgl(as, r, jit_L);\n  if (allow == RSET_EMPTY)  /* Spill temp. register. */\n    emit_rmro(as, XO_MOVto, r|REX_64, RID_ESP, 0);\n}\n\n/* Restore Lua stack from on-trace state. */\nstatic void asm_stack_restore(ASMState *as, SnapShot *snap)\n{\n  SnapEntry *map = &as->T->snapmap[snap->mapofs];\n  SnapEntry *flinks = &as->T->snapmap[snap_nextofs(as->T, snap)-1];\n  MSize n, nent = snap->nent;\n  /* Store the value of all modified slots to the Lua stack. */\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    BCReg s = snap_slot(sn);\n    int32_t ofs = 8*((int32_t)s-1);\n    IRRef ref = snap_ref(sn);\n    IRIns *ir = IR(ref);\n    if ((sn & SNAP_NORESTORE))\n      continue;\n    if (irt_isnum(ir->t)) {\n      Reg src = ra_alloc1(as, ref, RSET_FPR);\n      emit_rmro(as, XO_MOVSDto, src, RID_BASE, ofs);\n    } else {\n      lua_assert(irt_ispri(ir->t) || irt_isaddr(ir->t) ||\n\t\t (LJ_DUALNUM && irt_isinteger(ir->t)));\n      if (!irref_isk(ref)) {\n\tReg src = ra_alloc1(as, ref, rset_exclude(RSET_GPR, RID_BASE));\n\temit_movtomro(as, REX_64IR(ir, src), RID_BASE, ofs);\n      } else if (!irt_ispri(ir->t)) {\n\temit_movmroi(as, RID_BASE, ofs, ir->i);\n      }\n      if ((sn & (SNAP_CONT|SNAP_FRAME))) {\n\tif (s != 0)  /* Do not overwrite link to previous frame. */\n\t  emit_movmroi(as, RID_BASE, ofs+4, (int32_t)(*flinks--));\n      } else {\n\tif (!(LJ_64 && irt_islightud(ir->t)))\n\t  emit_movmroi(as, RID_BASE, ofs+4, irt_toitype(ir->t));\n      }\n    }\n    checkmclim(as);\n  }\n  lua_assert(map + nent == flinks);\n}\n\n/* -- GC handling --------------------------------------------------------- */\n\n/* Check GC threshold and do one or more GC steps. */\nstatic void asm_gc_check(ASMState *as)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_gc_step_jit];\n  IRRef args[2];\n  MCLabel l_end;\n  Reg tmp;\n  ra_evictset(as, RSET_SCRATCH);\n  l_end = emit_label(as);\n  /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */\n  asm_guardcc(as, CC_NE);  /* Assumes asm_snap_prep() already done. */\n  emit_rr(as, XO_TEST, RID_RET, RID_RET);\n  args[0] = ASMREF_TMP1;  /* global_State *g */\n  args[1] = ASMREF_TMP2;  /* MSize steps     */\n  asm_gencall(as, ci, args);\n  tmp = ra_releasetmp(as, ASMREF_TMP1);\n  emit_loada(as, tmp, J2G(as->J));\n  emit_loadi(as, ra_releasetmp(as, ASMREF_TMP2), as->gcsteps);\n  /* Jump around GC step if GC total < GC threshold. */\n  emit_sjcc(as, CC_B, l_end);\n  emit_opgl(as, XO_ARITH(XOg_CMP), tmp, gc.threshold);\n  emit_getgl(as, tmp, gc.total);\n  as->gcsteps = 0;\n  checkmclim(as);\n}\n\n/* -- Loop handling ------------------------------------------------------- */\n\n/* Fixup the loop branch. */\nstatic void asm_loop_fixup(ASMState *as)\n{\n  MCode *p = as->mctop;\n  MCode *target = as->mcp;\n  if (as->realign) {  /* Realigned loops use short jumps. */\n    as->realign = NULL;  /* Stop another retry. */\n    lua_assert(((intptr_t)target & 15) == 0);\n    if (as->loopinv) {  /* Inverted loop branch? */\n      p -= 5;\n      p[0] = XI_JMP;\n      lua_assert(target - p >= -128);\n      p[-1] = (MCode)(target - p);  /* Patch sjcc. */\n      if (as->loopinv == 2)\n\tp[-3] = (MCode)(target - p + 2);  /* Patch opt. short jp. */\n    } else {\n      lua_assert(target - p >= -128);\n      p[-1] = (MCode)(int8_t)(target - p);  /* Patch short jmp. */\n      p[-2] = XI_JMPs;\n    }\n  } else {\n    MCode *newloop;\n    p[-5] = XI_JMP;\n    if (as->loopinv) {  /* Inverted loop branch? */\n      /* asm_guardcc already inverted the jcc and patched the jmp. */\n      p -= 5;\n      newloop = target+4;\n      *(int32_t *)(p-4) = (int32_t)(target - p);  /* Patch jcc. */\n      if (as->loopinv == 2) {\n\t*(int32_t *)(p-10) = (int32_t)(target - p + 6);  /* Patch opt. jp. */\n\tnewloop = target+8;\n      }\n    } else {  /* Otherwise just patch jmp. */\n      *(int32_t *)(p-4) = (int32_t)(target - p);\n      newloop = target+3;\n    }\n    /* Realign small loops and shorten the loop branch. */\n    if (newloop >= p - 128) {\n      as->realign = newloop;  /* Force a retry and remember alignment. */\n      as->curins = as->stopins;  /* Abort asm_trace now. */\n      as->T->nins = as->orignins;  /* Remove any added renames. */\n    }\n  }\n}\n\n/* -- Head of trace ------------------------------------------------------- */\n\n/* Coalesce BASE register for a root trace. */\nstatic void asm_head_root_base(ASMState *as)\n{\n  IRIns *ir = IR(REF_BASE);\n  Reg r = ir->r;\n  if (ra_hasreg(r)) {\n    ra_free(as, r);\n    if (rset_test(as->modset, r))\n      ir->r = RID_INIT;  /* No inheritance for modified BASE register. */\n    if (r != RID_BASE)\n      emit_rr(as, XO_MOV, r, RID_BASE);\n  }\n}\n\n/* Coalesce or reload BASE register for a side trace. */\nstatic RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)\n{\n  IRIns *ir = IR(REF_BASE);\n  Reg r = ir->r;\n  if (ra_hasreg(r)) {\n    ra_free(as, r);\n    if (rset_test(as->modset, r))\n      ir->r = RID_INIT;  /* No inheritance for modified BASE register. */\n    if (irp->r == r) {\n      rset_clear(allow, r);  /* Mark same BASE register as coalesced. */\n    } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) {\n      rset_clear(allow, irp->r);\n      emit_rr(as, XO_MOV, r, irp->r);  /* Move from coalesced parent reg. */\n    } else {\n      emit_getgl(as, r, jit_base);  /* Otherwise reload BASE. */\n    }\n  }\n  return allow;\n}\n\n/* -- Tail of trace ------------------------------------------------------- */\n\n/* Fixup the tail code. */\nstatic void asm_tail_fixup(ASMState *as, TraceNo lnk)\n{\n  /* Note: don't use as->mcp swap + emit_*: emit_op overwrites more bytes. */\n  MCode *p = as->mctop;\n  MCode *target, *q;\n  int32_t spadj = as->T->spadjust;\n  if (spadj == 0) {\n    p -= ((as->flags & JIT_F_LEA_AGU) ? 7 : 6) + (LJ_64 ? 1 : 0);\n  } else {\n    MCode *p1;\n    /* Patch stack adjustment. */\n    if (checki8(spadj)) {\n      p -= 3;\n      p1 = p-6;\n      *p1 = (MCode)spadj;\n    } else {\n      p1 = p-9;\n      *(int32_t *)p1 = spadj;\n    }\n    if ((as->flags & JIT_F_LEA_AGU)) {\n#if LJ_64\n      p1[-4] = 0x48;\n#endif\n      p1[-3] = (MCode)XI_LEA;\n      p1[-2] = MODRM(checki8(spadj) ? XM_OFS8 : XM_OFS32, RID_ESP, RID_ESP);\n      p1[-1] = MODRM(XM_SCALE1, RID_ESP, RID_ESP);\n    } else {\n#if LJ_64\n      p1[-3] = 0x48;\n#endif\n      p1[-2] = (MCode)(checki8(spadj) ? XI_ARITHi8 : XI_ARITHi);\n      p1[-1] = MODRM(XM_REG, XOg_ADD, RID_ESP);\n    }\n  }\n  /* Patch exit branch. */\n  target = lnk ? traceref(as->J, lnk)->mcode : (MCode *)lj_vm_exit_interp;\n  *(int32_t *)(p-4) = jmprel(p, target);\n  p[-5] = XI_JMP;\n  /* Drop unused mcode tail. Fill with NOPs to make the prefetcher happy. */\n  for (q = as->mctop-1; q >= p; q--)\n    *q = XI_NOP;\n  as->mctop = p;\n}\n\n/* Prepare tail of code. */\nstatic void asm_tail_prep(ASMState *as)\n{\n  MCode *p = as->mctop;\n  /* Realign and leave room for backwards loop branch or exit branch. */\n  if (as->realign) {\n    int i = ((int)(intptr_t)as->realign) & 15;\n    /* Fill unused mcode tail with NOPs to make the prefetcher happy. */\n    while (i-- > 0)\n      *--p = XI_NOP;\n    as->mctop = p;\n    p -= (as->loopinv ? 5 : 2);  /* Space for short/near jmp. */\n  } else {\n    p -= 5;  /* Space for exit branch (near jmp). */\n  }\n  if (as->loopref) {\n    as->invmcp = as->mcp = p;\n  } else {\n    /* Leave room for ESP adjustment: add esp, imm or lea esp, [esp+imm] */\n    as->mcp = p - (((as->flags & JIT_F_LEA_AGU) ? 7 : 6)  + (LJ_64 ? 1 : 0));\n    as->invmcp = NULL;\n  }\n}\n\n/* -- Instruction dispatch ------------------------------------------------ */\n\n/* Assemble a single instruction. */\nstatic void asm_ir(ASMState *as, IRIns *ir)\n{\n  switch ((IROp)ir->o) {\n  /* Miscellaneous ops. */\n  case IR_LOOP: asm_loop(as); break;\n  case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break;\n  case IR_USE:\n    ra_alloc1(as, ir->op1, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR); break;\n  case IR_PHI: asm_phi(as, ir); break;\n  case IR_HIOP: asm_hiop(as, ir); break;\n  case IR_GCSTEP: asm_gcstep(as, ir); break;\n\n  /* Guarded assertions. */\n  case IR_LT: case IR_GE: case IR_LE: case IR_GT:\n  case IR_ULT: case IR_UGE: case IR_ULE: case IR_UGT:\n  case IR_EQ: case IR_NE: case IR_ABC:\n    asm_comp(as, ir, asm_compmap[ir->o]);\n    break;\n\n  case IR_RETF: asm_retf(as, ir); break;\n\n  /* Bit ops. */\n  case IR_BNOT: asm_neg_not(as, ir, XOg_NOT); break;\n  case IR_BSWAP: asm_bitswap(as, ir); break;\n\n  case IR_BAND: asm_intarith(as, ir, XOg_AND); break;\n  case IR_BOR:  asm_intarith(as, ir, XOg_OR); break;\n  case IR_BXOR: asm_intarith(as, ir, XOg_XOR); break;\n\n  case IR_BSHL: asm_bitshift(as, ir, XOg_SHL); break;\n  case IR_BSHR: asm_bitshift(as, ir, XOg_SHR); break;\n  case IR_BSAR: asm_bitshift(as, ir, XOg_SAR); break;\n  case IR_BROL: asm_bitshift(as, ir, XOg_ROL); break;\n  case IR_BROR: asm_bitshift(as, ir, XOg_ROR); break;\n\n  /* Arithmetic ops. */\n  case IR_ADD: asm_add(as, ir); break;\n  case IR_SUB:\n    if (irt_isnum(ir->t))\n      asm_fparith(as, ir, XO_SUBSD);\n    else  /* Note: no need for LEA trick here. i-k is encoded as i+(-k). */\n      asm_intarith(as, ir, XOg_SUB);\n    break;\n  case IR_MUL:\n    if (irt_isnum(ir->t))\n      asm_fparith(as, ir, XO_MULSD);\n    else\n      asm_intarith(as, ir, XOg_X_IMUL);\n    break;\n  case IR_DIV:\n#if LJ_64 && LJ_HASFFI\n    if (!irt_isnum(ir->t))\n      asm_arith64(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_divi64 :\n\t\t\t\t\t     IRCALL_lj_carith_divu64);\n    else\n#endif\n      asm_fparith(as, ir, XO_DIVSD);\n    break;\n  case IR_MOD:\n#if LJ_64 && LJ_HASFFI\n    if (!irt_isint(ir->t))\n      asm_arith64(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_modi64 :\n\t\t\t\t\t     IRCALL_lj_carith_modu64);\n    else\n#endif\n      asm_intmod(as, ir);\n    break;\n\n  case IR_NEG:\n    if (irt_isnum(ir->t))\n      asm_fparith(as, ir, XO_XORPS);\n    else\n      asm_neg_not(as, ir, XOg_NEG);\n    break;\n  case IR_ABS: asm_fparith(as, ir, XO_ANDPS); break;\n\n  case IR_MIN:\n    if (irt_isnum(ir->t))\n      asm_fparith(as, ir, XO_MINSD);\n    else\n      asm_min_max(as, ir, CC_G);\n    break;\n  case IR_MAX:\n    if (irt_isnum(ir->t))\n      asm_fparith(as, ir, XO_MAXSD);\n    else\n      asm_min_max(as, ir, CC_L);\n    break;\n\n  case IR_FPMATH: case IR_ATAN2: case IR_LDEXP:\n    asm_fpmath(as, ir);\n    break;\n  case IR_POW:\n#if LJ_64 && LJ_HASFFI\n    if (!irt_isnum(ir->t))\n      asm_arith64(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_powi64 :\n\t\t\t\t\t     IRCALL_lj_carith_powu64);\n    else\n#endif\n      asm_fppowi(as, ir);\n    break;\n\n  /* Overflow-checking arithmetic ops. Note: don't use LEA here! */\n  case IR_ADDOV: asm_intarith(as, ir, XOg_ADD); break;\n  case IR_SUBOV: asm_intarith(as, ir, XOg_SUB); break;\n  case IR_MULOV: asm_intarith(as, ir, XOg_X_IMUL); break;\n\n  /* Memory references. */\n  case IR_AREF: asm_aref(as, ir); break;\n  case IR_HREF: asm_href(as, ir); break;\n  case IR_HREFK: asm_hrefk(as, ir); break;\n  case IR_NEWREF: asm_newref(as, ir); break;\n  case IR_UREFO: case IR_UREFC: asm_uref(as, ir); break;\n  case IR_FREF: asm_fref(as, ir); break;\n  case IR_STRREF: asm_strref(as, ir); break;\n\n  /* Loads and stores. */\n  case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n    asm_ahuvload(as, ir);\n    break;\n  case IR_FLOAD: case IR_XLOAD: asm_fxload(as, ir); break;\n  case IR_SLOAD: asm_sload(as, ir); break;\n\n  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: asm_ahustore(as, ir); break;\n  case IR_FSTORE: case IR_XSTORE: asm_fxstore(as, ir); break;\n\n  /* Allocations. */\n  case IR_SNEW: case IR_XSNEW: asm_snew(as, ir); break;\n  case IR_TNEW: asm_tnew(as, ir); break;\n  case IR_TDUP: asm_tdup(as, ir); break;\n  case IR_CNEW: case IR_CNEWI: asm_cnew(as, ir); break;\n\n  /* Write barriers. */\n  case IR_TBAR: asm_tbar(as, ir); break;\n  case IR_OBAR: asm_obar(as, ir); break;\n\n  /* Type conversions. */\n  case IR_TOBIT: asm_tobit(as, ir); break;\n  case IR_CONV: asm_conv(as, ir); break;\n  case IR_TOSTR: asm_tostr(as, ir); break;\n  case IR_STRTO: asm_strto(as, ir); break;\n\n  /* Calls. */\n  case IR_CALLN: case IR_CALLL: case IR_CALLS: asm_call(as, ir); break;\n  case IR_CALLXS: asm_callx(as, ir); break;\n  case IR_CARG: break;\n\n  default:\n    setintV(&as->J->errinfo, ir->o);\n    lj_trace_err_info(as->J, LJ_TRERR_NYIIR);\n    break;\n  }\n}\n\n/* -- Trace setup --------------------------------------------------------- */\n\n/* Ensure there are enough stack slots for call arguments. */\nstatic Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci)\n{\n  IRRef args[CCI_NARGS_MAX];\n  int nslots;\n  asm_collectargs(as, ir, ci, args);\n  nslots = asm_count_call_slots(as, ci, args);\n  if (nslots > as->evenspill)  /* Leave room for args in stack slots. */\n    as->evenspill = nslots;\n#if LJ_64\n  return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET);\n#else\n  return irt_isfp(ir->t) ? REGSP_INIT : REGSP_HINT(RID_RET);\n#endif\n}\n\n/* Target-specific setup. */\nstatic void asm_setup_target(ASMState *as)\n{\n  asm_exitstub_setup(as, as->T->nsnap);\n}\n\n/* -- Trace patching ------------------------------------------------------ */\n\n/* Patch exit jumps of existing machine code to a new target. */\nvoid lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target)\n{\n  MCode *p = T->mcode;\n  MCode *mcarea = lj_mcode_patch(J, p, 0);\n  MSize len = T->szmcode;\n  MCode *px = exitstub_addr(J, exitno) - 6;\n  MCode *pe = p+len-6;\n  uint32_t stateaddr = u32ptr(&J2G(J)->vmstate);\n  if (len > 5 && p[len-5] == XI_JMP && p+len-6 + *(int32_t *)(p+len-4) == px)\n    *(int32_t *)(p+len-4) = jmprel(p+len, target);\n  /* Do not patch parent exit for a stack check. Skip beyond vmstate update. */\n  for (; p < pe; p++)\n    if (*(uint32_t *)(p+(LJ_64 ? 3 : 2)) == stateaddr && p[0] == XI_MOVmi) {\n      p += LJ_64 ? 11 : 10;\n      break;\n    }\n  lua_assert(p < pe);\n  for (; p < pe; p++) {\n    if ((*(uint16_t *)p & 0xf0ff) == 0x800f && p + *(int32_t *)(p+2) == px) {\n      *(int32_t *)(p+2) = jmprel(p+6, target);\n      p += 5;\n    }\n  }\n  lj_mcode_sync(T->mcode, T->mcode + T->szmcode);\n  lj_mcode_patch(J, mcarea, 1);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_bc.c",
    "content": "/*\n** Bytecode instruction modes.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_bc_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_bc.h\"\n\n/* Bytecode offsets and bytecode instruction modes. */\n#include \"lj_bcdef.h\"\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_bc.h",
    "content": "/*\n** Bytecode instruction format.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_BC_H\n#define _LJ_BC_H\n\n#include \"lj_def.h\"\n#include \"lj_arch.h\"\n\n/* Bytecode instruction format, 32 bit wide, fields of 8 or 16 bit:\n**\n** +----+----+----+----+\n** | B  | C  | A  | OP | Format ABC\n** +----+----+----+----+\n** |    D    | A  | OP | Format AD\n** +--------------------\n** MSB               LSB\n**\n** In-memory instructions are always stored in host byte order.\n*/\n\n/* Operand ranges and related constants. */\n#define BCMAX_A\t\t0xff\n#define BCMAX_B\t\t0xff\n#define BCMAX_C\t\t0xff\n#define BCMAX_D\t\t0xffff\n#define BCBIAS_J\t0x8000\n#define NO_REG\t\tBCMAX_A\n#define NO_JMP\t\t(~(BCPos)0)\n\n/* Macros to get instruction fields. */\n#define bc_op(i)\t((BCOp)((i)&0xff))\n#define bc_a(i)\t\t((BCReg)(((i)>>8)&0xff))\n#define bc_b(i)\t\t((BCReg)((i)>>24))\n#define bc_c(i)\t\t((BCReg)(((i)>>16)&0xff))\n#define bc_d(i)\t\t((BCReg)((i)>>16))\n#define bc_j(i)\t\t((ptrdiff_t)bc_d(i)-BCBIAS_J)\n\n/* Macros to set instruction fields. */\n#define setbc_byte(p, x, ofs) \\\n  ((uint8_t *)(p))[LJ_ENDIAN_SELECT(ofs, 3-ofs)] = (uint8_t)(x)\n#define setbc_op(p, x)\tsetbc_byte(p, (x), 0)\n#define setbc_a(p, x)\tsetbc_byte(p, (x), 1)\n#define setbc_b(p, x)\tsetbc_byte(p, (x), 3)\n#define setbc_c(p, x)\tsetbc_byte(p, (x), 2)\n#define setbc_d(p, x) \\\n  ((uint16_t *)(p))[LJ_ENDIAN_SELECT(1, 0)] = (uint16_t)(x)\n#define setbc_j(p, x)\tsetbc_d(p, (BCPos)((int32_t)(x)+BCBIAS_J))\n\n/* Macros to compose instructions. */\n#define BCINS_ABC(o, a, b, c) \\\n  (((BCIns)(o))|((BCIns)(a)<<8)|((BCIns)(b)<<24)|((BCIns)(c)<<16))\n#define BCINS_AD(o, a, d) \\\n  (((BCIns)(o))|((BCIns)(a)<<8)|((BCIns)(d)<<16))\n#define BCINS_AJ(o, a, j)\tBCINS_AD(o, a, (BCPos)((int32_t)(j)+BCBIAS_J))\n\n/* Bytecode instruction definition. Order matters, see below.\n**\n** (name, filler, Amode, Bmode, Cmode or Dmode, metamethod)\n**\n** The opcode name suffixes specify the type for RB/RC or RD:\n** V = variable slot\n** S = string const\n** N = number const\n** P = primitive type (~itype)\n** B = unsigned byte literal\n** M = multiple args/results\n*/\n#define BCDEF(_) \\\n  /* Comparison ops. ORDER OPR. */ \\\n  _(ISLT,\tvar,\t___,\tvar,\tlt) \\\n  _(ISGE,\tvar,\t___,\tvar,\tlt) \\\n  _(ISLE,\tvar,\t___,\tvar,\tle) \\\n  _(ISGT,\tvar,\t___,\tvar,\tle) \\\n  \\\n  _(ISEQV,\tvar,\t___,\tvar,\teq) \\\n  _(ISNEV,\tvar,\t___,\tvar,\teq) \\\n  _(ISEQS,\tvar,\t___,\tstr,\teq) \\\n  _(ISNES,\tvar,\t___,\tstr,\teq) \\\n  _(ISEQN,\tvar,\t___,\tnum,\teq) \\\n  _(ISNEN,\tvar,\t___,\tnum,\teq) \\\n  _(ISEQP,\tvar,\t___,\tpri,\teq) \\\n  _(ISNEP,\tvar,\t___,\tpri,\teq) \\\n  \\\n  /* Unary test and copy ops. */ \\\n  _(ISTC,\tdst,\t___,\tvar,\t___) \\\n  _(ISFC,\tdst,\t___,\tvar,\t___) \\\n  _(IST,\t___,\t___,\tvar,\t___) \\\n  _(ISF,\t___,\t___,\tvar,\t___) \\\n  \\\n  /* Unary ops. */ \\\n  _(MOV,\tdst,\t___,\tvar,\t___) \\\n  _(NOT,\tdst,\t___,\tvar,\t___) \\\n  _(UNM,\tdst,\t___,\tvar,\tunm) \\\n  _(LEN,\tdst,\t___,\tvar,\tlen) \\\n  \\\n  /* Binary ops. ORDER OPR. VV last, POW must be next. */ \\\n  _(ADDVN,\tdst,\tvar,\tnum,\tadd) \\\n  _(SUBVN,\tdst,\tvar,\tnum,\tsub) \\\n  _(MULVN,\tdst,\tvar,\tnum,\tmul) \\\n  _(DIVVN,\tdst,\tvar,\tnum,\tdiv) \\\n  _(MODVN,\tdst,\tvar,\tnum,\tmod) \\\n  \\\n  _(ADDNV,\tdst,\tvar,\tnum,\tadd) \\\n  _(SUBNV,\tdst,\tvar,\tnum,\tsub) \\\n  _(MULNV,\tdst,\tvar,\tnum,\tmul) \\\n  _(DIVNV,\tdst,\tvar,\tnum,\tdiv) \\\n  _(MODNV,\tdst,\tvar,\tnum,\tmod) \\\n  \\\n  _(ADDVV,\tdst,\tvar,\tvar,\tadd) \\\n  _(SUBVV,\tdst,\tvar,\tvar,\tsub) \\\n  _(MULVV,\tdst,\tvar,\tvar,\tmul) \\\n  _(DIVVV,\tdst,\tvar,\tvar,\tdiv) \\\n  _(MODVV,\tdst,\tvar,\tvar,\tmod) \\\n  \\\n  _(POW,\tdst,\tvar,\tvar,\tpow) \\\n  _(CAT,\tdst,\trbase,\trbase,\tconcat) \\\n  \\\n  /* Constant ops. */ \\\n  _(KSTR,\tdst,\t___,\tstr,\t___) \\\n  _(KCDATA,\tdst,\t___,\tcdata,\t___) \\\n  _(KSHORT,\tdst,\t___,\tlits,\t___) \\\n  _(KNUM,\tdst,\t___,\tnum,\t___) \\\n  _(KPRI,\tdst,\t___,\tpri,\t___) \\\n  _(KNIL,\tbase,\t___,\tbase,\t___) \\\n  \\\n  /* Upvalue and function ops. */ \\\n  _(UGET,\tdst,\t___,\tuv,\t___) \\\n  _(USETV,\tuv,\t___,\tvar,\t___) \\\n  _(USETS,\tuv,\t___,\tstr,\t___) \\\n  _(USETN,\tuv,\t___,\tnum,\t___) \\\n  _(USETP,\tuv,\t___,\tpri,\t___) \\\n  _(UCLO,\trbase,\t___,\tjump,\t___) \\\n  _(FNEW,\tdst,\t___,\tfunc,\tgc) \\\n  \\\n  /* Table ops. */ \\\n  _(TNEW,\tdst,\t___,\tlit,\tgc) \\\n  _(TDUP,\tdst,\t___,\ttab,\tgc) \\\n  _(GGET,\tdst,\t___,\tstr,\tindex) \\\n  _(GSET,\tvar,\t___,\tstr,\tnewindex) \\\n  _(TGETV,\tdst,\tvar,\tvar,\tindex) \\\n  _(TGETS,\tdst,\tvar,\tstr,\tindex) \\\n  _(TGETB,\tdst,\tvar,\tlit,\tindex) \\\n  _(TSETV,\tvar,\tvar,\tvar,\tnewindex) \\\n  _(TSETS,\tvar,\tvar,\tstr,\tnewindex) \\\n  _(TSETB,\tvar,\tvar,\tlit,\tnewindex) \\\n  _(TSETM,\tbase,\t___,\tnum,\tnewindex) \\\n  \\\n  /* Calls and vararg handling. T = tail call. */ \\\n  _(CALLM,\tbase,\tlit,\tlit,\tcall) \\\n  _(CALL,\tbase,\tlit,\tlit,\tcall) \\\n  _(CALLMT,\tbase,\t___,\tlit,\tcall) \\\n  _(CALLT,\tbase,\t___,\tlit,\tcall) \\\n  _(ITERC,\tbase,\tlit,\tlit,\tcall) \\\n  _(ITERN,\tbase,\tlit,\tlit,\tcall) \\\n  _(VARG,\tbase,\tlit,\tlit,\t___) \\\n  _(ISNEXT,\tbase,\t___,\tjump,\t___) \\\n  \\\n  /* Returns. */ \\\n  _(RETM,\tbase,\t___,\tlit,\t___) \\\n  _(RET,\trbase,\t___,\tlit,\t___) \\\n  _(RET0,\trbase,\t___,\tlit,\t___) \\\n  _(RET1,\trbase,\t___,\tlit,\t___) \\\n  \\\n  /* Loops and branches. I/J = interp/JIT, I/C/L = init/call/loop. */ \\\n  _(FORI,\tbase,\t___,\tjump,\t___) \\\n  _(JFORI,\tbase,\t___,\tjump,\t___) \\\n  \\\n  _(FORL,\tbase,\t___,\tjump,\t___) \\\n  _(IFORL,\tbase,\t___,\tjump,\t___) \\\n  _(JFORL,\tbase,\t___,\tlit,\t___) \\\n  \\\n  _(ITERL,\tbase,\t___,\tjump,\t___) \\\n  _(IITERL,\tbase,\t___,\tjump,\t___) \\\n  _(JITERL,\tbase,\t___,\tlit,\t___) \\\n  \\\n  _(LOOP,\trbase,\t___,\tjump,\t___) \\\n  _(ILOOP,\trbase,\t___,\tjump,\t___) \\\n  _(JLOOP,\trbase,\t___,\tlit,\t___) \\\n  \\\n  _(JMP,\trbase,\t___,\tjump,\t___) \\\n  \\\n  /* Function headers. I/J = interp/JIT, F/V/C = fixarg/vararg/C func. */ \\\n  _(FUNCF,\trbase,\t___,\t___,\t___) \\\n  _(IFUNCF,\trbase,\t___,\t___,\t___) \\\n  _(JFUNCF,\trbase,\t___,\tlit,\t___) \\\n  _(FUNCV,\trbase,\t___,\t___,\t___) \\\n  _(IFUNCV,\trbase,\t___,\t___,\t___) \\\n  _(JFUNCV,\trbase,\t___,\tlit,\t___) \\\n  _(FUNCC,\trbase,\t___,\t___,\t___) \\\n  _(FUNCCW,\trbase,\t___,\t___,\t___)\n\n/* Bytecode opcode numbers. */\ntypedef enum {\n#define BCENUM(name, ma, mb, mc, mt)\tBC_##name,\nBCDEF(BCENUM)\n#undef BCENUM\n  BC__MAX\n} BCOp;\n\nLJ_STATIC_ASSERT((int)BC_ISEQV+1 == (int)BC_ISNEV);\nLJ_STATIC_ASSERT(((int)BC_ISEQV^1) == (int)BC_ISNEV);\nLJ_STATIC_ASSERT(((int)BC_ISEQS^1) == (int)BC_ISNES);\nLJ_STATIC_ASSERT(((int)BC_ISEQN^1) == (int)BC_ISNEN);\nLJ_STATIC_ASSERT(((int)BC_ISEQP^1) == (int)BC_ISNEP);\nLJ_STATIC_ASSERT(((int)BC_ISLT^1) == (int)BC_ISGE);\nLJ_STATIC_ASSERT(((int)BC_ISLE^1) == (int)BC_ISGT);\nLJ_STATIC_ASSERT(((int)BC_ISLT^3) == (int)BC_ISGT);\nLJ_STATIC_ASSERT((int)BC_IST-(int)BC_ISTC == (int)BC_ISF-(int)BC_ISFC);\nLJ_STATIC_ASSERT((int)BC_CALLT-(int)BC_CALL == (int)BC_CALLMT-(int)BC_CALLM);\nLJ_STATIC_ASSERT((int)BC_CALLMT + 1 == (int)BC_CALLT);\nLJ_STATIC_ASSERT((int)BC_RETM + 1 == (int)BC_RET);\nLJ_STATIC_ASSERT((int)BC_FORL + 1 == (int)BC_IFORL);\nLJ_STATIC_ASSERT((int)BC_FORL + 2 == (int)BC_JFORL);\nLJ_STATIC_ASSERT((int)BC_ITERL + 1 == (int)BC_IITERL);\nLJ_STATIC_ASSERT((int)BC_ITERL + 2 == (int)BC_JITERL);\nLJ_STATIC_ASSERT((int)BC_LOOP + 1 == (int)BC_ILOOP);\nLJ_STATIC_ASSERT((int)BC_LOOP + 2 == (int)BC_JLOOP);\nLJ_STATIC_ASSERT((int)BC_FUNCF + 1 == (int)BC_IFUNCF);\nLJ_STATIC_ASSERT((int)BC_FUNCF + 2 == (int)BC_JFUNCF);\nLJ_STATIC_ASSERT((int)BC_FUNCV + 1 == (int)BC_IFUNCV);\nLJ_STATIC_ASSERT((int)BC_FUNCV + 2 == (int)BC_JFUNCV);\n\n/* This solves a circular dependency problem, change as needed. */\n#define FF_next_N\t4\n\n/* Stack slots used by FORI/FORL, relative to operand A. */\nenum {\n  FORL_IDX, FORL_STOP, FORL_STEP, FORL_EXT\n};\n\n/* Bytecode operand modes. ORDER BCMode */\ntypedef enum {\n  BCMnone, BCMdst, BCMbase, BCMvar, BCMrbase, BCMuv,  /* Mode A must be <= 7 */\n  BCMlit, BCMlits, BCMpri, BCMnum, BCMstr, BCMtab, BCMfunc, BCMjump, BCMcdata,\n  BCM_max\n} BCMode;\n#define BCM___\t\tBCMnone\n\n#define bcmode_a(op)\t((BCMode)(lj_bc_mode[op] & 7))\n#define bcmode_b(op)\t((BCMode)((lj_bc_mode[op]>>3) & 15))\n#define bcmode_c(op)\t((BCMode)((lj_bc_mode[op]>>7) & 15))\n#define bcmode_d(op)\tbcmode_c(op)\n#define bcmode_hasd(op)\t((lj_bc_mode[op] & (15<<3)) == (BCMnone<<3))\n#define bcmode_mm(op)\t((MMS)(lj_bc_mode[op]>>11))\n\n#define BCMODE(name, ma, mb, mc, mm) \\\n  (BCM##ma|(BCM##mb<<3)|(BCM##mc<<7)|(MM_##mm<<11)),\n#define BCMODE_FF\t0\n\nstatic LJ_AINLINE int bc_isret(BCOp op)\n{\n  return (op == BC_RETM || op == BC_RET || op == BC_RET0 || op == BC_RET1);\n}\n\nLJ_DATA const uint16_t lj_bc_mode[];\nLJ_DATA const uint16_t lj_bc_ofs[];\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_bcdump.h",
    "content": "/*\n** Bytecode dump definitions.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_BCDUMP_H\n#define _LJ_BCDUMP_H\n\n#include \"lj_obj.h\"\n#include \"lj_lex.h\"\n\n/* -- Bytecode dump format ------------------------------------------------ */\n\n/*\n** dump   = header proto+ 0U\n** header = ESC 'L' 'J' versionB flagsU [namelenU nameB*]\n** proto  = lengthU pdata\n** pdata  = phead bcinsW* uvdataH* kgc* knum* [debugB*]\n** phead  = flagsB numparamsB framesizeB numuvB numkgcU numknU numbcU\n**          [debuglenU [firstlineU numlineU]]\n** kgc    = kgctypeU { ktab | (loU hiU) | (rloU rhiU iloU ihiU) | strB* }\n** knum   = intU0 | (loU1 hiU)\n** ktab   = narrayU nhashU karray* khash*\n** karray = ktabk\n** khash  = ktabk ktabk\n** ktabk  = ktabtypeU { intU | (loU hiU) | strB* }\n**\n** B = 8 bit, H = 16 bit, W = 32 bit, U = ULEB128 of W, U0/U1 = ULEB128 of W+1\n*/\n\n/* Bytecode dump header. */\n#define BCDUMP_HEAD1\t\t0x1b\n#define BCDUMP_HEAD2\t\t0x4c\n#define BCDUMP_HEAD3\t\t0x4a\n\n/* If you perform *any* kind of private modifications to the bytecode itself\n** or to the dump format, you *must* set BCDUMP_VERSION to 0x80 or higher.\n*/\n#define BCDUMP_VERSION\t\t1\n\n/* Compatibility flags. */\n#define BCDUMP_F_BE\t\t0x01\n#define BCDUMP_F_STRIP\t\t0x02\n#define BCDUMP_F_FFI\t\t0x04\n\n#define BCDUMP_F_KNOWN\t\t(BCDUMP_F_FFI*2-1)\n\n/* Type codes for the GC constants of a prototype. Plus length for strings. */\nenum {\n  BCDUMP_KGC_CHILD, BCDUMP_KGC_TAB, BCDUMP_KGC_I64, BCDUMP_KGC_U64,\n  BCDUMP_KGC_COMPLEX, BCDUMP_KGC_STR\n};\n\n/* Type codes for the keys/values of a constant table. */\nenum {\n  BCDUMP_KTAB_NIL, BCDUMP_KTAB_FALSE, BCDUMP_KTAB_TRUE,\n  BCDUMP_KTAB_INT, BCDUMP_KTAB_NUM, BCDUMP_KTAB_STR\n};\n\n/* -- Bytecode reader/writer ---------------------------------------------- */\n\nLJ_FUNC int lj_bcwrite(lua_State *L, GCproto *pt, lua_Writer writer,\n\t\t       void *data, int strip);\nLJ_FUNC GCproto *lj_bcread(LexState *ls);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_bcread.c",
    "content": "/*\n** Bytecode reader.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_bcread_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_bc.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#include \"lj_cdata.h\"\n#include \"lualib.h\"\n#endif\n#include \"lj_lex.h\"\n#include \"lj_bcdump.h\"\n#include \"lj_state.h\"\n\n/* Reuse some lexer fields for our own purposes. */\n#define bcread_flags(ls)\tls->level\n#define bcread_swap(ls) \\\n  ((bcread_flags(ls) & BCDUMP_F_BE) != LJ_BE*BCDUMP_F_BE)\n#define bcread_oldtop(L, ls)\trestorestack(L, ls->lastline)\n#define bcread_savetop(L, ls, top) \\\n  ls->lastline = (BCLine)savestack(L, (top))\n\n/* -- Input buffer handling ----------------------------------------------- */\n\n/* Throw reader error. */\nstatic LJ_NOINLINE void bcread_error(LexState *ls, ErrMsg em)\n{\n  lua_State *L = ls->L;\n  const char *name = ls->chunkarg;\n  if (*name == BCDUMP_HEAD1) name = \"(binary)\";\n  else if (*name == '@' || *name == '=') name++;\n  lj_str_pushf(L, \"%s: %s\", name, err2msg(em));\n  lj_err_throw(L, LUA_ERRSYNTAX);\n}\n\n/* Resize input buffer. */\nstatic void bcread_resize(LexState *ls, MSize len)\n{\n  if (ls->sb.sz < len) {\n    MSize sz = ls->sb.sz * 2;\n    while (len > sz) sz = sz * 2;\n    lj_str_resizebuf(ls->L, &ls->sb, sz);\n    /* Caveat: this may change ls->sb.buf which may affect ls->p. */\n  }\n}\n\n/* Refill buffer if needed. */\nstatic LJ_NOINLINE void bcread_fill(LexState *ls, MSize len, int need)\n{\n  lua_assert(len != 0);\n  if (len > LJ_MAX_MEM || ls->current < 0)\n    bcread_error(ls, LJ_ERR_BCBAD);\n  do {\n    const char *buf;\n    size_t size;\n    if (ls->n) {  /* Copy remainder to buffer. */\n      if (ls->sb.n) {  /* Move down in buffer. */\n\tlua_assert(ls->p + ls->n == ls->sb.buf + ls->sb.n);\n\tif (ls->n != ls->sb.n)\n\t  memmove(ls->sb.buf, ls->p, ls->n);\n      } else {  /* Copy from buffer provided by reader. */\n\tbcread_resize(ls, len);\n\tmemcpy(ls->sb.buf, ls->p, ls->n);\n      }\n      ls->p = ls->sb.buf;\n    }\n    ls->sb.n = ls->n;\n    buf = ls->rfunc(ls->L, ls->rdata, &size);  /* Get more data from reader. */\n    if (buf == NULL || size == 0) {  /* EOF? */\n      if (need) bcread_error(ls, LJ_ERR_BCBAD);\n      ls->current = -1;  /* Only bad if we get called again. */\n      break;\n    }\n    if (ls->sb.n) {  /* Append to buffer. */\n      MSize n = ls->sb.n + (MSize)size;\n      bcread_resize(ls, n < len ? len : n);\n      memcpy(ls->sb.buf + ls->sb.n, buf, size);\n      ls->n = ls->sb.n = n;\n      ls->p = ls->sb.buf;\n    } else {  /* Return buffer provided by reader. */\n      ls->n = (MSize)size;\n      ls->p = buf;\n    }\n  } while (ls->n < len);\n}\n\n/* Need a certain number of bytes. */\nstatic LJ_AINLINE void bcread_need(LexState *ls, MSize len)\n{\n  if (LJ_UNLIKELY(ls->n < len))\n    bcread_fill(ls, len, 1);\n}\n\n/* Want to read up to a certain number of bytes, but may need less. */\nstatic LJ_AINLINE void bcread_want(LexState *ls, MSize len)\n{\n  if (LJ_UNLIKELY(ls->n < len))\n    bcread_fill(ls, len, 0);\n}\n\n#define bcread_dec(ls)\t\tcheck_exp(ls->n > 0, ls->n--)\n#define bcread_consume(ls, len)\tcheck_exp(ls->n >= (len), ls->n -= (len))\n\n/* Return memory block from buffer. */\nstatic uint8_t *bcread_mem(LexState *ls, MSize len)\n{\n  uint8_t *p = (uint8_t *)ls->p;\n  bcread_consume(ls, len);\n  ls->p = (char *)p + len;\n  return p;\n}\n\n/* Copy memory block from buffer. */\nstatic void bcread_block(LexState *ls, void *q, MSize len)\n{\n  memcpy(q, bcread_mem(ls, len), len);\n}\n\n/* Read byte from buffer. */\nstatic LJ_AINLINE uint32_t bcread_byte(LexState *ls)\n{\n  bcread_dec(ls);\n  return (uint32_t)(uint8_t)*ls->p++;\n}\n\n/* Read ULEB128 value from buffer. */\nstatic uint32_t bcread_uleb128(LexState *ls)\n{\n  const uint8_t *p = (const uint8_t *)ls->p;\n  uint32_t v = *p++;\n  if (LJ_UNLIKELY(v >= 0x80)) {\n    int sh = 0;\n    v &= 0x7f;\n    do {\n     v |= ((*p & 0x7f) << (sh += 7));\n     bcread_dec(ls);\n   } while (*p++ >= 0x80);\n  }\n  bcread_dec(ls);\n  ls->p = (char *)p;\n  return v;\n}\n\n/* Read top 32 bits of 33 bit ULEB128 value from buffer. */\nstatic uint32_t bcread_uleb128_33(LexState *ls)\n{\n  const uint8_t *p = (const uint8_t *)ls->p;\n  uint32_t v = (*p++ >> 1);\n  if (LJ_UNLIKELY(v >= 0x40)) {\n    int sh = -1;\n    v &= 0x3f;\n    do {\n     v |= ((*p & 0x7f) << (sh += 7));\n     bcread_dec(ls);\n   } while (*p++ >= 0x80);\n  }\n  bcread_dec(ls);\n  ls->p = (char *)p;\n  return v;\n}\n\n/* -- Bytecode reader ----------------------------------------------------- */\n\n/* Read debug info of a prototype. */\nstatic void bcread_dbg(LexState *ls, GCproto *pt, MSize sizedbg)\n{\n  void *lineinfo = (void *)proto_lineinfo(pt);\n  bcread_block(ls, lineinfo, sizedbg);\n  /* Swap lineinfo if the endianess differs. */\n  if (bcread_swap(ls) && pt->numline >= 256) {\n    MSize i, n = pt->sizebc-1;\n    if (pt->numline < 65536) {\n      uint16_t *p = (uint16_t *)lineinfo;\n      for (i = 0; i < n; i++) p[i] = (uint16_t)((p[i] >> 8)|(p[i] << 8));\n    } else {\n      uint32_t *p = (uint32_t *)lineinfo;\n      for (i = 0; i < n; i++) p[i] = lj_bswap(p[i]);\n    }\n  }\n}\n\n/* Find pointer to varinfo. */\nstatic const void *bcread_varinfo(GCproto *pt)\n{\n  const uint8_t *p = proto_uvinfo(pt);\n  MSize n = pt->sizeuv;\n  if (n) while (*p++ || --n) ;\n  return p;\n}\n\n/* Read a single constant key/value of a template table. */\nstatic void bcread_ktabk(LexState *ls, TValue *o)\n{\n  MSize tp = bcread_uleb128(ls);\n  if (tp >= BCDUMP_KTAB_STR) {\n    MSize len = tp - BCDUMP_KTAB_STR;\n    const char *p = (const char *)bcread_mem(ls, len);\n    setstrV(ls->L, o, lj_str_new(ls->L, p, len));\n  } else if (tp == BCDUMP_KTAB_INT) {\n    setintV(o, (int32_t)bcread_uleb128(ls));\n  } else if (tp == BCDUMP_KTAB_NUM) {\n    o->u32.lo = bcread_uleb128(ls);\n    o->u32.hi = bcread_uleb128(ls);\n  } else {\n    lua_assert(tp <= BCDUMP_KTAB_TRUE);\n    setitype(o, ~tp);\n  }\n}\n\n/* Read a template table. */\nstatic GCtab *bcread_ktab(LexState *ls)\n{\n  MSize narray = bcread_uleb128(ls);\n  MSize nhash = bcread_uleb128(ls);\n  GCtab *t = lj_tab_new(ls->L, narray, hsize2hbits(nhash));\n  if (narray) {  /* Read array entries. */\n    MSize i;\n    TValue *o = tvref(t->array);\n    for (i = 0; i < narray; i++, o++)\n      bcread_ktabk(ls, o);\n  }\n  if (nhash) {  /* Read hash entries. */\n    MSize i;\n    for (i = 0; i < nhash; i++) {\n      TValue key;\n      bcread_ktabk(ls, &key);\n      lua_assert(!tvisnil(&key));\n      bcread_ktabk(ls, lj_tab_set(ls->L, t, &key));\n    }\n  }\n  return t;\n}\n\n/* Read GC constants of a prototype. */\nstatic void bcread_kgc(LexState *ls, GCproto *pt, MSize sizekgc)\n{\n  MSize i;\n  GCRef *kr = mref(pt->k, GCRef) - (ptrdiff_t)sizekgc;\n  for (i = 0; i < sizekgc; i++, kr++) {\n    MSize tp = bcread_uleb128(ls);\n    if (tp >= BCDUMP_KGC_STR) {\n      MSize len = tp - BCDUMP_KGC_STR;\n      const char *p = (const char *)bcread_mem(ls, len);\n      setgcref(*kr, obj2gco(lj_str_new(ls->L, p, len)));\n    } else if (tp == BCDUMP_KGC_TAB) {\n      setgcref(*kr, obj2gco(bcread_ktab(ls)));\n#if LJ_HASFFI\n    } else if (tp != BCDUMP_KGC_CHILD) {\n      CTypeID id = tp == BCDUMP_KGC_COMPLEX ? CTID_COMPLEX_DOUBLE :\n\t\t   tp == BCDUMP_KGC_I64 ? CTID_INT64 : CTID_UINT64;\n      CTSize sz = tp == BCDUMP_KGC_COMPLEX ? 16 : 8;\n      GCcdata *cd = lj_cdata_new_(ls->L, id, sz);\n      TValue *p = (TValue *)cdataptr(cd);\n      setgcref(*kr, obj2gco(cd));\n      p[0].u32.lo = bcread_uleb128(ls);\n      p[0].u32.hi = bcread_uleb128(ls);\n      if (tp == BCDUMP_KGC_COMPLEX) {\n\tp[1].u32.lo = bcread_uleb128(ls);\n\tp[1].u32.hi = bcread_uleb128(ls);\n      }\n#endif\n    } else {\n      lua_State *L = ls->L;\n      lua_assert(tp == BCDUMP_KGC_CHILD);\n      if (L->top <= bcread_oldtop(L, ls))  /* Stack underflow? */\n\tbcread_error(ls, LJ_ERR_BCBAD);\n      L->top--;\n      setgcref(*kr, obj2gco(protoV(L->top)));\n    }\n  }\n}\n\n/* Read number constants of a prototype. */\nstatic void bcread_knum(LexState *ls, GCproto *pt, MSize sizekn)\n{\n  MSize i;\n  TValue *o = mref(pt->k, TValue);\n  for (i = 0; i < sizekn; i++, o++) {\n    int isnum = (ls->p[0] & 1);\n    uint32_t lo = bcread_uleb128_33(ls);\n    if (isnum) {\n      o->u32.lo = lo;\n      o->u32.hi = bcread_uleb128(ls);\n    } else {\n      setintV(o, lo);\n    }\n  }\n}\n\n/* Read bytecode instructions. */\nstatic void bcread_bytecode(LexState *ls, GCproto *pt, MSize sizebc)\n{\n  BCIns *bc = proto_bc(pt);\n  bc[0] = BCINS_AD((pt->flags & PROTO_VARARG) ? BC_FUNCV : BC_FUNCF,\n\t\t   pt->framesize, 0);\n  bcread_block(ls, bc+1, (sizebc-1)*(MSize)sizeof(BCIns));\n  /* Swap bytecode instructions if the endianess differs. */\n  if (bcread_swap(ls)) {\n    MSize i;\n    for (i = 1; i < sizebc; i++) bc[i] = lj_bswap(bc[i]);\n  }\n}\n\n/* Read upvalue refs. */\nstatic void bcread_uv(LexState *ls, GCproto *pt, MSize sizeuv)\n{\n  if (sizeuv) {\n    uint16_t *uv = proto_uv(pt);\n    bcread_block(ls, uv, sizeuv*2);\n    /* Swap upvalue refs if the endianess differs. */\n    if (bcread_swap(ls)) {\n      MSize i;\n      for (i = 0; i < sizeuv; i++)\n\tuv[i] = (uint16_t)((uv[i] >> 8)|(uv[i] << 8));\n    }\n  }\n}\n\n/* Read a prototype. */\nstatic GCproto *bcread_proto(LexState *ls)\n{\n  GCproto *pt;\n  MSize framesize, numparams, flags, sizeuv, sizekgc, sizekn, sizebc, sizept;\n  MSize ofsk, ofsuv, ofsdbg;\n  MSize sizedbg = 0;\n  BCLine firstline = 0, numline = 0;\n  MSize len, startn;\n\n  /* Read length. */\n  if (ls->n > 0 && ls->p[0] == 0) {  /* Shortcut EOF. */\n    ls->n--; ls->p++;\n    return NULL;\n  }\n  bcread_want(ls, 5);\n  len = bcread_uleb128(ls);\n  if (!len) return NULL;  /* EOF */\n  bcread_need(ls, len);\n  startn = ls->n;\n\n  /* Read prototype header. */\n  flags = bcread_byte(ls);\n  numparams = bcread_byte(ls);\n  framesize = bcread_byte(ls);\n  sizeuv = bcread_byte(ls);\n  sizekgc = bcread_uleb128(ls);\n  sizekn = bcread_uleb128(ls);\n  sizebc = bcread_uleb128(ls) + 1;\n  if (!(bcread_flags(ls) & BCDUMP_F_STRIP)) {\n    sizedbg = bcread_uleb128(ls);\n    if (sizedbg) {\n      firstline = bcread_uleb128(ls);\n      numline = bcread_uleb128(ls);\n    }\n  }\n\n  /* Calculate total size of prototype including all colocated arrays. */\n  sizept = (MSize)sizeof(GCproto) +\n\t   sizebc*(MSize)sizeof(BCIns) +\n\t   sizekgc*(MSize)sizeof(GCRef);\n  sizept = (sizept + (MSize)sizeof(TValue)-1) & ~((MSize)sizeof(TValue)-1);\n  ofsk = sizept; sizept += sizekn*(MSize)sizeof(TValue);\n  ofsuv = sizept; sizept += ((sizeuv+1)&~1)*2;\n  ofsdbg = sizept; sizept += sizedbg;\n\n  /* Allocate prototype object and initialize its fields. */\n  pt = (GCproto *)lj_mem_newgco(ls->L, (MSize)sizept);\n  pt->gct = ~LJ_TPROTO;\n  pt->numparams = (uint8_t)numparams;\n  pt->framesize = (uint8_t)framesize;\n  pt->sizebc = sizebc;\n  setmref(pt->k, (char *)pt + ofsk);\n  setmref(pt->uv, (char *)pt + ofsuv);\n  pt->sizekgc = 0;  /* Set to zero until fully initialized. */\n  pt->sizekn = sizekn;\n  pt->sizept = sizept;\n  pt->sizeuv = (uint8_t)sizeuv;\n  pt->flags = (uint8_t)flags;\n  pt->trace = 0;\n  setgcref(pt->chunkname, obj2gco(ls->chunkname));\n\n  /* Close potentially uninitialized gap between bc and kgc. */\n  *(uint32_t *)((char *)pt + ofsk - sizeof(GCRef)*(sizekgc+1)) = 0;\n\n  /* Read bytecode instructions and upvalue refs. */\n  bcread_bytecode(ls, pt, sizebc);\n  bcread_uv(ls, pt, sizeuv);\n\n  /* Read constants. */\n  bcread_kgc(ls, pt, sizekgc);\n  pt->sizekgc = sizekgc;\n  bcread_knum(ls, pt, sizekn);\n\n  /* Read and initialize debug info. */\n  pt->firstline = firstline;\n  pt->numline = numline;\n  if (sizedbg) {\n    MSize sizeli = (sizebc-1) << (numline < 256 ? 0 : numline < 65536 ? 1 : 2);\n    setmref(pt->lineinfo, (char *)pt + ofsdbg);\n    setmref(pt->uvinfo, (char *)pt + ofsdbg + sizeli);\n    bcread_dbg(ls, pt, sizedbg);\n    setmref(pt->varinfo, bcread_varinfo(pt));\n  } else {\n    setmref(pt->lineinfo, NULL);\n    setmref(pt->uvinfo, NULL);\n    setmref(pt->varinfo, NULL);\n  }\n\n  if (len != startn - ls->n)\n    bcread_error(ls, LJ_ERR_BCBAD);\n  return pt;\n}\n\n/* Read and check header of bytecode dump. */\nstatic int bcread_header(LexState *ls)\n{\n  uint32_t flags;\n  bcread_want(ls, 3+5+5);\n  if (bcread_byte(ls) != BCDUMP_HEAD2 ||\n      bcread_byte(ls) != BCDUMP_HEAD3 ||\n      bcread_byte(ls) != BCDUMP_VERSION) return 0;\n  bcread_flags(ls) = flags = bcread_uleb128(ls);\n  if ((flags & ~(BCDUMP_F_KNOWN)) != 0) return 0;\n  if ((flags & BCDUMP_F_FFI)) {\n#if LJ_HASFFI\n    lua_State *L = ls->L;\n    if (!ctype_ctsG(G(L))) {\n      ptrdiff_t oldtop = savestack(L, L->top);\n      luaopen_ffi(L);  /* Load FFI library on-demand. */\n      L->top = restorestack(L, oldtop);\n    }\n#else\n    return 0;\n#endif\n  }\n  if ((flags & BCDUMP_F_STRIP)) {\n    ls->chunkname = lj_str_newz(ls->L, ls->chunkarg);\n  } else {\n    MSize len = bcread_uleb128(ls);\n    bcread_need(ls, len);\n    ls->chunkname = lj_str_new(ls->L, (const char *)bcread_mem(ls, len), len);\n  }\n  return 1;  /* Ok. */\n}\n\n/* Read a bytecode dump. */\nGCproto *lj_bcread(LexState *ls)\n{\n  lua_State *L = ls->L;\n  lua_assert(ls->current == BCDUMP_HEAD1);\n  bcread_savetop(L, ls, L->top);\n  lj_str_resetbuf(&ls->sb);\n  /* Check for a valid bytecode dump header. */\n  if (!bcread_header(ls))\n    bcread_error(ls, LJ_ERR_BCFMT);\n  for (;;) {  /* Process all prototypes in the bytecode dump. */\n    GCproto *pt = bcread_proto(ls);\n    if (!pt) break;\n    setprotoV(L, L->top, pt);\n    incr_top(L);\n  }\n  if ((int32_t)ls->n > 0 || L->top-1 != bcread_oldtop(L, ls))\n    bcread_error(ls, LJ_ERR_BCBAD);\n  /* Pop off last prototype. */\n  L->top--;\n  return protoV(L->top);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_bcwrite.c",
    "content": "/*\n** Bytecode writer.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_bcwrite_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_str.h\"\n#include \"lj_bc.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#endif\n#if LJ_HASJIT\n#include \"lj_dispatch.h\"\n#include \"lj_jit.h\"\n#endif\n#include \"lj_bcdump.h\"\n#include \"lj_vm.h\"\n\n/* Context for bytecode writer. */\ntypedef struct BCWriteCtx {\n  SBuf sb;\t\t\t/* Output buffer. */\n  lua_State *L;\t\t\t/* Lua state. */\n  GCproto *pt;\t\t\t/* Root prototype. */\n  lua_Writer wfunc;\t\t/* Writer callback. */\n  void *wdata;\t\t\t/* Writer callback data. */\n  int strip;\t\t\t/* Strip debug info. */\n  int status;\t\t\t/* Status from writer callback. */\n} BCWriteCtx;\n\n/* -- Output buffer handling ---------------------------------------------- */\n\n/* Resize buffer if needed. */\nstatic LJ_NOINLINE void bcwrite_resize(BCWriteCtx *ctx, MSize len)\n{\n  MSize sz = ctx->sb.sz * 2;\n  while (ctx->sb.n + len > sz) sz = sz * 2;\n  lj_str_resizebuf(ctx->L, &ctx->sb, sz);\n}\n\n/* Need a certain amount of buffer space. */\nstatic LJ_AINLINE void bcwrite_need(BCWriteCtx *ctx, MSize len)\n{\n  if (LJ_UNLIKELY(ctx->sb.n + len > ctx->sb.sz))\n    bcwrite_resize(ctx, len);\n}\n\n/* Add memory block to buffer. */\nstatic void bcwrite_block(BCWriteCtx *ctx, const void *p, MSize len)\n{\n  uint8_t *q = (uint8_t *)(ctx->sb.buf + ctx->sb.n);\n  MSize i;\n  ctx->sb.n += len;\n  for (i = 0; i < len; i++) q[i] = ((uint8_t *)p)[i];\n}\n\n/* Add byte to buffer. */\nstatic LJ_AINLINE void bcwrite_byte(BCWriteCtx *ctx, uint8_t b)\n{\n  ctx->sb.buf[ctx->sb.n++] = b;\n}\n\n/* Add ULEB128 value to buffer. */\nstatic void bcwrite_uleb128(BCWriteCtx *ctx, uint32_t v)\n{\n  MSize n = ctx->sb.n;\n  uint8_t *p = (uint8_t *)ctx->sb.buf;\n  for (; v >= 0x80; v >>= 7)\n    p[n++] = (uint8_t)((v & 0x7f) | 0x80);\n  p[n++] = (uint8_t)v;\n  ctx->sb.n = n;\n}\n\n/* -- Bytecode writer ----------------------------------------------------- */\n\n/* Write a single constant key/value of a template table. */\nstatic void bcwrite_ktabk(BCWriteCtx *ctx, cTValue *o, int narrow)\n{\n  bcwrite_need(ctx, 1+10);\n  if (tvisstr(o)) {\n    const GCstr *str = strV(o);\n    MSize len = str->len;\n    bcwrite_need(ctx, 5+len);\n    bcwrite_uleb128(ctx, BCDUMP_KTAB_STR+len);\n    bcwrite_block(ctx, strdata(str), len);\n  } else if (tvisint(o)) {\n    bcwrite_byte(ctx, BCDUMP_KTAB_INT);\n    bcwrite_uleb128(ctx, intV(o));\n  } else if (tvisnum(o)) {\n    if (!LJ_DUALNUM && narrow) {  /* Narrow number constants to integers. */\n      lua_Number num = numV(o);\n      int32_t k = lj_num2int(num);\n      if (num == (lua_Number)k) {  /* -0 is never a constant. */\n\tbcwrite_byte(ctx, BCDUMP_KTAB_INT);\n\tbcwrite_uleb128(ctx, k);\n\treturn;\n      }\n    }\n    bcwrite_byte(ctx, BCDUMP_KTAB_NUM);\n    bcwrite_uleb128(ctx, o->u32.lo);\n    bcwrite_uleb128(ctx, o->u32.hi);\n  } else {\n    lua_assert(tvispri(o));\n    bcwrite_byte(ctx, BCDUMP_KTAB_NIL+~itype(o));\n  }\n}\n\n/* Write a template table. */\nstatic void bcwrite_ktab(BCWriteCtx *ctx, const GCtab *t)\n{\n  MSize narray = 0, nhash = 0;\n  if (t->asize > 0) {  /* Determine max. length of array part. */\n    ptrdiff_t i;\n    TValue *array = tvref(t->array);\n    for (i = (ptrdiff_t)t->asize-1; i >= 0; i--)\n      if (!tvisnil(&array[i]))\n\tbreak;\n    narray = (MSize)(i+1);\n  }\n  if (t->hmask > 0) {  /* Count number of used hash slots. */\n    MSize i, hmask = t->hmask;\n    Node *node = noderef(t->node);\n    for (i = 0; i <= hmask; i++)\n      nhash += !tvisnil(&node[i].val);\n  }\n  /* Write number of array slots and hash slots. */\n  bcwrite_uleb128(ctx, narray);\n  bcwrite_uleb128(ctx, nhash);\n  if (narray) {  /* Write array entries (may contain nil). */\n    MSize i;\n    TValue *o = tvref(t->array);\n    for (i = 0; i < narray; i++, o++)\n      bcwrite_ktabk(ctx, o, 1);\n  }\n  if (nhash) {  /* Write hash entries. */\n    MSize i = nhash;\n    Node *node = noderef(t->node) + t->hmask;\n    for (;; node--)\n      if (!tvisnil(&node->val)) {\n\tbcwrite_ktabk(ctx, &node->key, 0);\n\tbcwrite_ktabk(ctx, &node->val, 1);\n\tif (--i == 0) break;\n      }\n  }\n}\n\n/* Write GC constants of a prototype. */\nstatic void bcwrite_kgc(BCWriteCtx *ctx, GCproto *pt)\n{\n  MSize i, sizekgc = pt->sizekgc;\n  GCRef *kr = mref(pt->k, GCRef) - (ptrdiff_t)sizekgc;\n  for (i = 0; i < sizekgc; i++, kr++) {\n    GCobj *o = gcref(*kr);\n    MSize tp, need = 1;\n    /* Determine constant type and needed size. */\n    if (o->gch.gct == ~LJ_TSTR) {\n      tp = BCDUMP_KGC_STR + gco2str(o)->len;\n      need = 5+gco2str(o)->len;\n    } else if (o->gch.gct == ~LJ_TPROTO) {\n      lua_assert((pt->flags & PROTO_CHILD));\n      tp = BCDUMP_KGC_CHILD;\n#if LJ_HASFFI\n    } else if (o->gch.gct == ~LJ_TCDATA) {\n      CTypeID id = gco2cd(o)->ctypeid;\n      need = 1+4*5;\n      if (id == CTID_INT64) {\n\ttp = BCDUMP_KGC_I64;\n      } else if (id == CTID_UINT64) {\n\ttp = BCDUMP_KGC_U64;\n      } else {\n\tlua_assert(id == CTID_COMPLEX_DOUBLE);\n\ttp = BCDUMP_KGC_COMPLEX;\n      }\n#endif\n    } else {\n      lua_assert(o->gch.gct == ~LJ_TTAB);\n      tp = BCDUMP_KGC_TAB;\n      need = 1+2*5;\n    }\n    /* Write constant type. */\n    bcwrite_need(ctx, need);\n    bcwrite_uleb128(ctx, tp);\n    /* Write constant data (if any). */\n    if (tp >= BCDUMP_KGC_STR) {\n      bcwrite_block(ctx, strdata(gco2str(o)), gco2str(o)->len);\n    } else if (tp == BCDUMP_KGC_TAB) {\n      bcwrite_ktab(ctx, gco2tab(o));\n#if LJ_HASFFI\n    } else if (tp != BCDUMP_KGC_CHILD) {\n      cTValue *p = (TValue *)cdataptr(gco2cd(o));\n      bcwrite_uleb128(ctx, p[0].u32.lo);\n      bcwrite_uleb128(ctx, p[0].u32.hi);\n      if (tp == BCDUMP_KGC_COMPLEX) {\n\tbcwrite_uleb128(ctx, p[1].u32.lo);\n\tbcwrite_uleb128(ctx, p[1].u32.hi);\n      }\n#endif\n    }\n  }\n}\n\n/* Write number constants of a prototype. */\nstatic void bcwrite_knum(BCWriteCtx *ctx, GCproto *pt)\n{\n  MSize i, sizekn = pt->sizekn;\n  cTValue *o = mref(pt->k, TValue);\n  bcwrite_need(ctx, 10*sizekn);\n  for (i = 0; i < sizekn; i++, o++) {\n    int32_t k;\n    if (tvisint(o)) {\n      k = intV(o);\n      goto save_int;\n    } else {\n      /* Write a 33 bit ULEB128 for the int (lsb=0) or loword (lsb=1). */\n      if (!LJ_DUALNUM) {  /* Narrow number constants to integers. */\n\tlua_Number num = numV(o);\n\tk = lj_num2int(num);\n\tif (num == (lua_Number)k) {  /* -0 is never a constant. */\n\tsave_int:\n\t  bcwrite_uleb128(ctx, 2*(uint32_t)k | ((uint32_t)k & 0x80000000u));\n\t  if (k < 0) {\n\t    char *p = &ctx->sb.buf[ctx->sb.n-1];\n\t    *p = (*p & 7) | ((k>>27) & 0x18);\n\t  }\n\t  continue;\n\t}\n      }\n      bcwrite_uleb128(ctx, 1+(2*o->u32.lo | (o->u32.lo & 0x80000000u)));\n      if (o->u32.lo >= 0x80000000u) {\n\tchar *p = &ctx->sb.buf[ctx->sb.n-1];\n\t*p = (*p & 7) | ((o->u32.lo>>27) & 0x18);\n      }\n      bcwrite_uleb128(ctx, o->u32.hi);\n    }\n  }\n}\n\n/* Write bytecode instructions. */\nstatic void bcwrite_bytecode(BCWriteCtx *ctx, GCproto *pt)\n{\n  MSize nbc = pt->sizebc-1;  /* Omit the [JI]FUNC* header. */\n#if LJ_HASJIT\n  uint8_t *p = (uint8_t *)&ctx->sb.buf[ctx->sb.n];\n#endif\n  bcwrite_block(ctx, proto_bc(pt)+1, nbc*(MSize)sizeof(BCIns));\n#if LJ_HASJIT\n  /* Unpatch modified bytecode containing ILOOP/JLOOP etc. */\n  if ((pt->flags & PROTO_ILOOP) || pt->trace) {\n    jit_State *J = L2J(ctx->L);\n    MSize i;\n    for (i = 0; i < nbc; i++, p += sizeof(BCIns)) {\n      BCOp op = (BCOp)p[LJ_ENDIAN_SELECT(0, 3)];\n      if (op == BC_IFORL || op == BC_IITERL || op == BC_ILOOP ||\n\t  op == BC_JFORI) {\n\tp[LJ_ENDIAN_SELECT(0, 3)] = (uint8_t)(op-BC_IFORL+BC_FORL);\n      } else if (op == BC_JFORL || op == BC_JITERL || op == BC_JLOOP) {\n\tBCReg rd = p[LJ_ENDIAN_SELECT(2, 1)] + (p[LJ_ENDIAN_SELECT(3, 0)] << 8);\n\tBCIns ins = traceref(J, rd)->startins;\n\tp[LJ_ENDIAN_SELECT(0, 3)] = (uint8_t)(op-BC_JFORL+BC_FORL);\n\tp[LJ_ENDIAN_SELECT(2, 1)] = bc_c(ins);\n\tp[LJ_ENDIAN_SELECT(3, 0)] = bc_b(ins);\n      }\n    }\n  }\n#endif\n}\n\n/* Write prototype. */\nstatic void bcwrite_proto(BCWriteCtx *ctx, GCproto *pt)\n{\n  MSize sizedbg = 0;\n\n  /* Recursively write children of prototype. */\n  if ((pt->flags & PROTO_CHILD)) {\n    ptrdiff_t i, n = pt->sizekgc;\n    GCRef *kr = mref(pt->k, GCRef) - 1;\n    for (i = 0; i < n; i++, kr--) {\n      GCobj *o = gcref(*kr);\n      if (o->gch.gct == ~LJ_TPROTO)\n\tbcwrite_proto(ctx, gco2pt(o));\n    }\n  }\n\n  /* Start writing the prototype info to a buffer. */\n  lj_str_resetbuf(&ctx->sb);\n  ctx->sb.n = 5;  /* Leave room for final size. */\n  bcwrite_need(ctx, 4+6*5+(pt->sizebc-1)*(MSize)sizeof(BCIns)+pt->sizeuv*2);\n\n  /* Write prototype header. */\n  bcwrite_byte(ctx, (pt->flags & (PROTO_CHILD|PROTO_VARARG|PROTO_FFI)));\n  bcwrite_byte(ctx, pt->numparams);\n  bcwrite_byte(ctx, pt->framesize);\n  bcwrite_byte(ctx, pt->sizeuv);\n  bcwrite_uleb128(ctx, pt->sizekgc);\n  bcwrite_uleb128(ctx, pt->sizekn);\n  bcwrite_uleb128(ctx, pt->sizebc-1);\n  if (!ctx->strip) {\n    if (proto_lineinfo(pt))\n      sizedbg = pt->sizept - (MSize)((char *)proto_lineinfo(pt) - (char *)pt);\n    bcwrite_uleb128(ctx, sizedbg);\n    if (sizedbg) {\n      bcwrite_uleb128(ctx, pt->firstline);\n      bcwrite_uleb128(ctx, pt->numline);\n    }\n  }\n\n  /* Write bytecode instructions and upvalue refs. */\n  bcwrite_bytecode(ctx, pt);\n  bcwrite_block(ctx, proto_uv(pt), pt->sizeuv*2);\n\n  /* Write constants. */\n  bcwrite_kgc(ctx, pt);\n  bcwrite_knum(ctx, pt);\n\n  /* Write debug info, if not stripped. */\n  if (sizedbg) {\n    bcwrite_need(ctx, sizedbg);\n    bcwrite_block(ctx, proto_lineinfo(pt), sizedbg);\n  }\n\n  /* Pass buffer to writer function. */\n  if (ctx->status == 0) {\n    MSize n = ctx->sb.n - 5;\n    MSize nn = (lj_fls(n)+8)*9 >> 6;\n    ctx->sb.n = 5 - nn;\n    bcwrite_uleb128(ctx, n);  /* Fill in final size. */\n    lua_assert(ctx->sb.n == 5);\n    ctx->status = ctx->wfunc(ctx->L, ctx->sb.buf+5-nn, nn+n, ctx->wdata);\n  }\n}\n\n/* Write header of bytecode dump. */\nstatic void bcwrite_header(BCWriteCtx *ctx)\n{\n  GCstr *chunkname = proto_chunkname(ctx->pt);\n  const char *name = strdata(chunkname);\n  MSize len = chunkname->len;\n  lj_str_resetbuf(&ctx->sb);\n  bcwrite_need(ctx, 5+5+len);\n  bcwrite_byte(ctx, BCDUMP_HEAD1);\n  bcwrite_byte(ctx, BCDUMP_HEAD2);\n  bcwrite_byte(ctx, BCDUMP_HEAD3);\n  bcwrite_byte(ctx, BCDUMP_VERSION);\n  bcwrite_byte(ctx, (ctx->strip ? BCDUMP_F_STRIP : 0) +\n\t\t   (LJ_BE ? BCDUMP_F_BE : 0) +\n\t\t   ((ctx->pt->flags & PROTO_FFI) ? BCDUMP_F_FFI : 0));\n  if (!ctx->strip) {\n    bcwrite_uleb128(ctx, len);\n    bcwrite_block(ctx, name, len);\n  }\n  ctx->status = ctx->wfunc(ctx->L, ctx->sb.buf, ctx->sb.n, ctx->wdata);\n}\n\n/* Write footer of bytecode dump. */\nstatic void bcwrite_footer(BCWriteCtx *ctx)\n{\n  if (ctx->status == 0) {\n    uint8_t zero = 0;\n    ctx->status = ctx->wfunc(ctx->L, &zero, 1, ctx->wdata);\n  }\n}\n\n/* Protected callback for bytecode writer. */\nstatic TValue *cpwriter(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  BCWriteCtx *ctx = (BCWriteCtx *)ud;\n  UNUSED(dummy);\n  lj_str_resizebuf(L, &ctx->sb, 1024);  /* Avoids resize for most prototypes. */\n  bcwrite_header(ctx);\n  bcwrite_proto(ctx, ctx->pt);\n  bcwrite_footer(ctx);\n  return NULL;\n}\n\n/* Write bytecode for a prototype. */\nint lj_bcwrite(lua_State *L, GCproto *pt, lua_Writer writer, void *data,\n\t      int strip)\n{\n  BCWriteCtx ctx;\n  int status;\n  ctx.L = L;\n  ctx.pt = pt;\n  ctx.wfunc = writer;\n  ctx.wdata = data;\n  ctx.strip = strip;\n  ctx.status = 0;\n  lj_str_initbuf(&ctx.sb);\n  status = lj_vm_cpcall(L, NULL, &ctx, cpwriter);\n  if (status == 0) status = ctx.status;\n  lj_str_freebuf(G(ctx.L), &ctx.sb);\n  return status;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_carith.c",
    "content": "/*\n** C data arithmetic.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_tab.h\"\n#include \"lj_meta.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cconv.h\"\n#include \"lj_cdata.h\"\n#include \"lj_carith.h\"\n\n/* -- C data arithmetic --------------------------------------------------- */\n\n/* Binary operands of an operator converted to ctypes. */\ntypedef struct CDArith {\n  uint8_t *p[2];\n  CType *ct[2];\n} CDArith;\n\n/* Check arguments for arithmetic metamethods. */\nstatic int carith_checkarg(lua_State *L, CTState *cts, CDArith *ca)\n{\n  TValue *o = L->base;\n  int ok = 1;\n  MSize i;\n  if (o+1 >= L->top)\n    lj_err_argt(L, 1, LUA_TCDATA);\n  for (i = 0; i < 2; i++, o++) {\n    if (tviscdata(o)) {\n      GCcdata *cd = cdataV(o);\n      CTypeID id = (CTypeID)cd->ctypeid;\n      CType *ct = ctype_raw(cts, id);\n      uint8_t *p = (uint8_t *)cdataptr(cd);\n      if (ctype_isptr(ct->info)) {\n\tp = (uint8_t *)cdata_getptr(p, ct->size);\n\tif (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct);\n      } else if (ctype_isfunc(ct->info)) {\n\tp = (uint8_t *)*(void **)p;\n\tct = ctype_get(cts,\n\t  lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR));\n      }\n      if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);\n      ca->ct[i] = ct;\n      ca->p[i] = p;\n    } else if (tvisint(o)) {\n      ca->ct[i] = ctype_get(cts, CTID_INT32);\n      ca->p[i] = (uint8_t *)&o->i;\n    } else if (tvisnum(o)) {\n      ca->ct[i] = ctype_get(cts, CTID_DOUBLE);\n      ca->p[i] = (uint8_t *)&o->n;\n    } else if (tvisnil(o)) {\n      ca->ct[i] = ctype_get(cts, CTID_P_VOID);\n      ca->p[i] = (uint8_t *)0;\n    } else if (tvisstr(o)) {\n      TValue *o2 = i == 0 ? o+1 : o-1;\n      CType *ct = ctype_raw(cts, cdataV(o2)->ctypeid);\n      ca->ct[i] = NULL;\n      ca->p[i] = NULL;\n      ok = 0;\n      if (ctype_isenum(ct->info)) {\n\tCTSize ofs;\n\tCType *cct = lj_ctype_getfield(cts, ct, strV(o), &ofs);\n\tif (cct && ctype_isconstval(cct->info)) {\n\t  ca->ct[i] = ctype_child(cts, cct);\n\t  ca->p[i] = (uint8_t *)&cct->size;  /* Assumes ct does not grow. */\n\t  ok = 1;\n\t} else {\n\t  ca->ct[1-i] = ct;  /* Use enum to improve error message. */\n\t  ca->p[1-i] = NULL;\n\t  break;\n\t}\n      }\n    } else {\n      ca->ct[i] = NULL;\n      ca->p[i] = NULL;\n      ok = 0;\n    }\n  }\n  return ok;\n}\n\n/* Pointer arithmetic. */\nstatic int carith_ptr(lua_State *L, CTState *cts, CDArith *ca, MMS mm)\n{\n  CType *ctp = ca->ct[0];\n  uint8_t *pp = ca->p[0];\n  ptrdiff_t idx;\n  CTSize sz;\n  CTypeID id;\n  GCcdata *cd;\n  if (ctype_isptr(ctp->info) || ctype_isrefarray(ctp->info)) {\n    if ((mm == MM_sub || mm == MM_eq || mm == MM_lt || mm == MM_le) &&\n\t(ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) {\n      uint8_t *pp2 = ca->p[1];\n      if (mm == MM_eq) {  /* Pointer equality. Incompatible pointers are ok. */\n\tsetboolV(L->top-1, (pp == pp2));\n\treturn 1;\n      }\n      if (!lj_cconv_compatptr(cts, ctp, ca->ct[1], CCF_IGNQUAL))\n\treturn 0;\n      if (mm == MM_sub) {  /* Pointer difference. */\n\tintptr_t diff;\n\tsz = lj_ctype_size(cts, ctype_cid(ctp->info));  /* Element size. */\n\tif (sz == 0 || sz == CTSIZE_INVALID)\n\t  return 0;\n\tdiff = ((intptr_t)pp - (intptr_t)pp2) / (int32_t)sz;\n\t/* All valid pointer differences on x64 are in (-2^47, +2^47),\n\t** which fits into a double without loss of precision.\n\t*/\n\tsetintptrV(L->top-1, (int32_t)diff);\n\treturn 1;\n      } else if (mm == MM_lt) {  /* Pointer comparison (unsigned). */\n\tsetboolV(L->top-1, ((uintptr_t)pp < (uintptr_t)pp2));\n\treturn 1;\n      } else {\n\tlua_assert(mm == MM_le);\n\tsetboolV(L->top-1, ((uintptr_t)pp <= (uintptr_t)pp2));\n\treturn 1;\n      }\n    }\n    if (!((mm == MM_add || mm == MM_sub) && ctype_isnum(ca->ct[1]->info)))\n      return 0;\n    lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[1],\n\t\t   (uint8_t *)&idx, ca->p[1], 0);\n    if (mm == MM_sub) idx = -idx;\n  } else if (mm == MM_add && ctype_isnum(ctp->info) &&\n      (ctype_isptr(ca->ct[1]->info) || ctype_isrefarray(ca->ct[1]->info))) {\n    /* Swap pointer and index. */\n    ctp = ca->ct[1]; pp = ca->p[1];\n    lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ca->ct[0],\n\t\t   (uint8_t *)&idx, ca->p[0], 0);\n  } else {\n    return 0;\n  }\n  sz = lj_ctype_size(cts, ctype_cid(ctp->info));  /* Element size. */\n  if (sz == CTSIZE_INVALID)\n    return 0;\n  pp += idx*(int32_t)sz;  /* Compute pointer + index. */\n  id = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(ctp->info)),\n\t\t       CTSIZE_PTR);\n  cd = lj_cdata_new(cts, id, CTSIZE_PTR);\n  *(uint8_t **)cdataptr(cd) = pp;\n  setcdataV(L, L->top-1, cd);\n  lj_gc_check(L);\n  return 1;\n}\n\n/* 64 bit integer arithmetic. */\nstatic int carith_int64(lua_State *L, CTState *cts, CDArith *ca, MMS mm)\n{\n  if (ctype_isnum(ca->ct[0]->info) && ca->ct[0]->size <= 8 &&\n      ctype_isnum(ca->ct[1]->info) && ca->ct[1]->size <= 8) {\n    CTypeID id = (((ca->ct[0]->info & CTF_UNSIGNED) && ca->ct[0]->size == 8) ||\n\t\t  ((ca->ct[1]->info & CTF_UNSIGNED) && ca->ct[1]->size == 8)) ?\n\t\t CTID_UINT64 : CTID_INT64;\n    CType *ct = ctype_get(cts, id);\n    GCcdata *cd;\n    uint64_t u0, u1, *up;\n    lj_cconv_ct_ct(cts, ct, ca->ct[0], (uint8_t *)&u0, ca->p[0], 0);\n    if (mm != MM_unm)\n      lj_cconv_ct_ct(cts, ct, ca->ct[1], (uint8_t *)&u1, ca->p[1], 0);\n    switch (mm) {\n    case MM_eq:\n      setboolV(L->top-1, (u0 == u1));\n      return 1;\n    case MM_lt:\n      setboolV(L->top-1,\n\t       id == CTID_INT64 ? ((int64_t)u0 < (int64_t)u1) : (u0 < u1));\n      return 1;\n    case MM_le:\n      setboolV(L->top-1,\n\t       id == CTID_INT64 ? ((int64_t)u0 <= (int64_t)u1) : (u0 <= u1));\n      return 1;\n    default: break;\n    }\n    cd = lj_cdata_new(cts, id, 8);\n    up = (uint64_t *)cdataptr(cd);\n    setcdataV(L, L->top-1, cd);\n    switch (mm) {\n    case MM_add: *up = u0 + u1; break;\n    case MM_sub: *up = u0 - u1; break;\n    case MM_mul: *up = u0 * u1; break;\n    case MM_div:\n      if (id == CTID_INT64)\n\t*up = (uint64_t)lj_carith_divi64((int64_t)u0, (int64_t)u1);\n      else\n\t*up = lj_carith_divu64(u0, u1);\n      break;\n    case MM_mod:\n      if (id == CTID_INT64)\n\t*up = (uint64_t)lj_carith_modi64((int64_t)u0, (int64_t)u1);\n      else\n\t*up = lj_carith_modu64(u0, u1);\n      break;\n    case MM_pow:\n      if (id == CTID_INT64)\n\t*up = (uint64_t)lj_carith_powi64((int64_t)u0, (int64_t)u1);\n      else\n\t*up = lj_carith_powu64(u0, u1);\n      break;\n    case MM_unm: *up = (uint64_t)-(int64_t)u0; break;\n    default: lua_assert(0); break;\n    }\n    lj_gc_check(L);\n    return 1;\n  }\n  return 0;\n}\n\n/* Handle ctype arithmetic metamethods. */\nstatic int lj_carith_meta(lua_State *L, CTState *cts, CDArith *ca, MMS mm)\n{\n  cTValue *tv = NULL;\n  if (tviscdata(L->base)) {\n    CTypeID id = cdataV(L->base)->ctypeid;\n    CType *ct = ctype_raw(cts, id);\n    if (ctype_isptr(ct->info)) id = ctype_cid(ct->info);\n    tv = lj_ctype_meta(cts, id, mm);\n  }\n  if (!tv && L->base+1 < L->top && tviscdata(L->base+1)) {\n    CTypeID id = cdataV(L->base+1)->ctypeid;\n    CType *ct = ctype_raw(cts, id);\n    if (ctype_isptr(ct->info)) id = ctype_cid(ct->info);\n    tv = lj_ctype_meta(cts, id, mm);\n  }\n  if (!tv) {\n    const char *repr[2];\n    int i, isenum = -1, isstr = -1;\n    if (mm == MM_eq) {  /* Equality checks never raise an error. */\n      setboolV(L->top-1, 0);\n      return 1;\n    }\n    for (i = 0; i < 2; i++) {\n      if (ca->ct[i]) {\n\tif (ctype_isenum(ca->ct[i]->info)) isenum = i;\n\trepr[i] = strdata(lj_ctype_repr(L, ctype_typeid(cts, ca->ct[i]), NULL));\n      } else {\n\tif (tvisstr(&L->base[i])) isstr = i;\n\trepr[i] = lj_typename(&L->base[i]);\n      }\n    }\n    if ((isenum ^ isstr) == 1)\n      lj_err_callerv(L, LJ_ERR_FFI_BADCONV, repr[isstr], repr[isenum]);\n    lj_err_callerv(L, mm == MM_len ? LJ_ERR_FFI_BADLEN :\n\t\t      mm == MM_concat ? LJ_ERR_FFI_BADCONCAT :\n\t\t      mm < MM_add ? LJ_ERR_FFI_BADCOMP : LJ_ERR_FFI_BADARITH,\n\t\t   repr[0], repr[1]);\n  }\n  return lj_meta_tailcall(L, tv);\n}\n\n/* Arithmetic operators for cdata. */\nint lj_carith_op(lua_State *L, MMS mm)\n{\n  CTState *cts = ctype_cts(L);\n  CDArith ca;\n  if (carith_checkarg(L, cts, &ca)) {\n    if (carith_int64(L, cts, &ca, mm) || carith_ptr(L, cts, &ca, mm)) {\n      copyTV(L, &G(L)->tmptv2, L->top-1);  /* Remember for trace recorder. */\n      return 1;\n    }\n  }\n  return lj_carith_meta(L, cts, &ca, mm);\n}\n\n/* -- 64 bit integer arithmetic helpers ----------------------------------- */\n\n#if LJ_32 && LJ_HASJIT\n/* Signed/unsigned 64 bit multiplication. */\nint64_t lj_carith_mul64(int64_t a, int64_t b)\n{\n  return a * b;\n}\n#endif\n\n/* Unsigned 64 bit division. */\nuint64_t lj_carith_divu64(uint64_t a, uint64_t b)\n{\n  if (b == 0) return U64x(80000000,00000000);\n  return a / b;\n}\n\n/* Signed 64 bit division. */\nint64_t lj_carith_divi64(int64_t a, int64_t b)\n{\n  if (b == 0 || (a == (int64_t)U64x(80000000,00000000) && b == -1))\n    return U64x(80000000,00000000);\n  return a / b;\n}\n\n/* Unsigned 64 bit modulo. */\nuint64_t lj_carith_modu64(uint64_t a, uint64_t b)\n{\n  if (b == 0) return U64x(80000000,00000000);\n  return a % b;\n}\n\n/* Signed 64 bit modulo. */\nint64_t lj_carith_modi64(int64_t a, int64_t b)\n{\n  if (b == 0) return U64x(80000000,00000000);\n  if (a == (int64_t)U64x(80000000,00000000) && b == -1) return 0;\n  return a % b;\n}\n\n/* Unsigned 64 bit x^k. */\nuint64_t lj_carith_powu64(uint64_t x, uint64_t k)\n{\n  uint64_t y;\n  if (k == 0)\n    return 1;\n  for (; (k & 1) == 0; k >>= 1) x *= x;\n  y = x;\n  if ((k >>= 1) != 0) {\n    for (;;) {\n      x *= x;\n      if (k == 1) break;\n      if (k & 1) y *= x;\n      k >>= 1;\n    }\n    y *= x;\n  }\n  return y;\n}\n\n/* Signed 64 bit x^k. */\nint64_t lj_carith_powi64(int64_t x, int64_t k)\n{\n  if (k == 0)\n    return 1;\n  if (k < 0) {\n    if (x == 0)\n      return U64x(7fffffff,ffffffff);\n    else if (x == 1)\n      return 1;\n    else if (x == -1)\n      return (k & 1) ? -1 : 1;\n    else\n      return 0;\n  }\n  return (int64_t)lj_carith_powu64((uint64_t)x, (uint64_t)k);\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_carith.h",
    "content": "/*\n** C data arithmetic.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CARITH_H\n#define _LJ_CARITH_H\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\nLJ_FUNC int lj_carith_op(lua_State *L, MMS mm);\n\n#if LJ_32 && LJ_HASJIT\nLJ_FUNC int64_t lj_carith_mul64(int64_t x, int64_t k);\n#endif\nLJ_FUNC uint64_t lj_carith_divu64(uint64_t a, uint64_t b);\nLJ_FUNC int64_t lj_carith_divi64(int64_t a, int64_t b);\nLJ_FUNC uint64_t lj_carith_modu64(uint64_t a, uint64_t b);\nLJ_FUNC int64_t lj_carith_modi64(int64_t a, int64_t b);\nLJ_FUNC uint64_t lj_carith_powu64(uint64_t x, uint64_t k);\nLJ_FUNC int64_t lj_carith_powi64(int64_t x, int64_t k);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ccall.c",
    "content": "/*\n** FFI C call handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cconv.h\"\n#include \"lj_cdata.h\"\n#include \"lj_ccall.h\"\n#include \"lj_trace.h\"\n\n/* Target-specific handling of register arguments. */\n#if LJ_TARGET_X86\n/* -- x86 calling conventions --------------------------------------------- */\n\n#if LJ_ABI_WIN\n\n#define CCALL_HANDLE_STRUCTRET \\\n  /* Return structs bigger than 8 by reference (on stack only). */ \\\n  cc->retref = (sz > 8); \\\n  if (cc->retref) cc->stack[nsp++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET CCALL_HANDLE_STRUCTRET\n\n#else\n\n#define CCALL_HANDLE_STRUCTRET \\\n  cc->retref = 1;  /* Return all structs by reference (in reg or on stack). */ \\\n  if (ngpr < maxgpr) \\\n    cc->gpr[ngpr++] = (GPRArg)dp; \\\n  else \\\n    cc->stack[nsp++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET \\\n  /* Return complex float in GPRs and complex double by reference. */ \\\n  cc->retref = (sz > 8); \\\n  if (cc->retref) { \\\n    if (ngpr < maxgpr) \\\n      cc->gpr[ngpr++] = (GPRArg)dp; \\\n    else \\\n      cc->stack[nsp++] = (GPRArg)dp; \\\n  }\n\n#endif\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  if (!cc->retref) \\\n    *(int64_t *)dp = *(int64_t *)sp;  /* Copy complex float from GPRs. */\n\n#define CCALL_HANDLE_STRUCTARG \\\n  ngpr = maxgpr;  /* Pass all structs by value on the stack. */\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  isfp = 1;  /* Pass complex by value on stack. */\n\n#define CCALL_HANDLE_REGARG \\\n  if (!isfp) {  /* Only non-FP values may be passed in registers. */ \\\n    if (n > 1) {  /* Anything > 32 bit is passed on the stack. */ \\\n      if (!LJ_ABI_WIN) ngpr = maxgpr;  /* Prevent reordering. */ \\\n    } else if (ngpr + 1 <= maxgpr) { \\\n      dp = &cc->gpr[ngpr]; \\\n      ngpr += n; \\\n      goto done; \\\n    } \\\n  }\n\n#elif LJ_TARGET_X64 && LJ_ABI_WIN\n/* -- Windows/x64 calling conventions ------------------------------------- */\n\n#define CCALL_HANDLE_STRUCTRET \\\n  /* Return structs of size 1, 2, 4 or 8 in a GPR. */ \\\n  cc->retref = !(sz == 1 || sz == 2 || sz == 4 || sz == 8); \\\n  if (cc->retref) cc->gpr[ngpr++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET CCALL_HANDLE_STRUCTRET\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  if (!cc->retref) \\\n    *(int64_t *)dp = *(int64_t *)sp;  /* Copy complex float from GPRs. */\n\n#define CCALL_HANDLE_STRUCTARG \\\n  /* Pass structs of size 1, 2, 4 or 8 in a GPR by value. */ \\\n  if (!(sz == 1 || sz == 2 || sz == 4 || sz == 8)) { \\\n    rp = cdataptr(lj_cdata_new(cts, did, sz)); \\\n    sz = CTSIZE_PTR;  /* Pass all other structs by reference. */ \\\n  }\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  /* Pass complex float in a GPR and complex double by reference. */ \\\n  if (sz != 2*sizeof(float)) { \\\n    rp = cdataptr(lj_cdata_new(cts, did, sz)); \\\n    sz = CTSIZE_PTR; \\\n  }\n\n/* Windows/x64 argument registers are strictly positional (use ngpr). */\n#define CCALL_HANDLE_REGARG \\\n  if (isfp) { \\\n    if (ngpr < 4) { dp = &cc->fpr[ngpr++]; nfpr = ngpr; goto done; } \\\n  } else { \\\n    if (ngpr < 4) { dp = &cc->gpr[ngpr++]; goto done; } \\\n  }\n\n#elif LJ_TARGET_X64\n/* -- POSIX/x64 calling conventions --------------------------------------- */\n\n#define CCALL_HANDLE_STRUCTRET \\\n  int rcl[2]; rcl[0] = rcl[1] = 0; \\\n  if (ccall_classify_struct(cts, ctr, rcl, 0)) { \\\n    cc->retref = 1;  /* Return struct by reference. */ \\\n    cc->gpr[ngpr++] = (GPRArg)dp; \\\n  } else { \\\n    cc->retref = 0;  /* Return small structs in registers. */ \\\n  }\n\n#define CCALL_HANDLE_STRUCTRET2 \\\n  int rcl[2]; rcl[0] = rcl[1] = 0; \\\n  ccall_classify_struct(cts, ctr, rcl, 0); \\\n  ccall_struct_ret(cc, rcl, dp, ctr->size);\n\n#define CCALL_HANDLE_COMPLEXRET \\\n  /* Complex values are returned in one or two FPRs. */ \\\n  cc->retref = 0;\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  if (ctr->size == 2*sizeof(float)) {  /* Copy complex float from FPR. */ \\\n    *(int64_t *)dp = cc->fpr[0].l[0]; \\\n  } else {  /* Copy non-contiguous complex double from FPRs. */ \\\n    ((int64_t *)dp)[0] = cc->fpr[0].l[0]; \\\n    ((int64_t *)dp)[1] = cc->fpr[1].l[0]; \\\n  }\n\n#define CCALL_HANDLE_STRUCTARG \\\n  int rcl[2]; rcl[0] = rcl[1] = 0; \\\n  if (!ccall_classify_struct(cts, d, rcl, 0)) { \\\n    cc->nsp = nsp; cc->ngpr = ngpr; cc->nfpr = nfpr; \\\n    if (ccall_struct_arg(cc, cts, d, rcl, o, narg)) goto err_nyi; \\\n    nsp = cc->nsp; ngpr = cc->ngpr; nfpr = cc->nfpr; \\\n    continue; \\\n  }  /* Pass all other structs by value on stack. */\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  isfp = 2;  /* Pass complex in FPRs or on stack. Needs postprocessing. */\n\n#define CCALL_HANDLE_REGARG \\\n  if (isfp) {  /* Try to pass argument in FPRs. */ \\\n    if (nfpr + n <= CCALL_NARG_FPR) { \\\n      dp = &cc->fpr[nfpr]; \\\n      nfpr += n; \\\n      goto done; \\\n    } \\\n  } else {  /* Try to pass argument in GPRs. */ \\\n    /* Note that reordering is explicitly allowed in the x64 ABI. */ \\\n    if (n <= 2 && ngpr + n <= maxgpr) { \\\n      dp = &cc->gpr[ngpr]; \\\n      ngpr += n; \\\n      goto done; \\\n    } \\\n  }\n\n#elif LJ_TARGET_ARM\n/* -- ARM calling conventions --------------------------------------------- */\n\n#if LJ_ABI_SOFTFP\n\n#define CCALL_HANDLE_STRUCTRET \\\n  /* Return structs of size <= 4 in a GPR. */ \\\n  cc->retref = !(sz <= 4); \\\n  if (cc->retref) cc->gpr[ngpr++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET \\\n  cc->retref = 1;  /* Return all complex values by reference. */ \\\n  cc->gpr[ngpr++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  UNUSED(dp); /* Nothing to do. */\n\n#define CCALL_HANDLE_STRUCTARG \\\n  /* Pass all structs by value in registers and/or on the stack. */\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  /* Pass complex by value in 2 or 4 GPRs. */\n\n#define CCALL_HANDLE_REGARG_FP1\n#define CCALL_HANDLE_REGARG_FP2\n\n#else\n\n#define CCALL_HANDLE_STRUCTRET \\\n  cc->retref = !ccall_classify_struct(cts, ctr, ct); \\\n  if (cc->retref) cc->gpr[ngpr++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_STRUCTRET2 \\\n  if (ccall_classify_struct(cts, ctr, ct) > 1) sp = (uint8_t *)&cc->fpr[0]; \\\n  memcpy(dp, sp, ctr->size);\n\n#define CCALL_HANDLE_COMPLEXRET \\\n  if (!(ct->info & CTF_VARARG)) cc->retref = 0;  /* Return complex in FPRs. */\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  if (!(ct->info & CTF_VARARG)) memcpy(dp, &cc->fpr[0], ctr->size);\n\n#define CCALL_HANDLE_STRUCTARG \\\n  isfp = (ccall_classify_struct(cts, d, ct) > 1);\n  /* Pass all structs by value in registers and/or on the stack. */\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  isfp = 1;  /* Pass complex by value in FPRs or on stack. */\n\n#define CCALL_HANDLE_REGARG_FP1 \\\n  if (isfp && !(ct->info & CTF_VARARG)) { \\\n    if ((d->info & CTF_ALIGN) > CTALIGN_PTR) { \\\n      if (nfpr + (n >> 1) <= CCALL_NARG_FPR) { \\\n\tdp = &cc->fpr[nfpr]; \\\n\tnfpr += (n >> 1); \\\n\tgoto done; \\\n      } \\\n    } else { \\\n      if (sz > 1 && fprodd != nfpr) fprodd = 0; \\\n      if (fprodd) { \\\n\tif (2*nfpr+n <= 2*CCALL_NARG_FPR+1) { \\\n\t  dp = (void *)&cc->fpr[fprodd-1].f[1]; \\\n\t  nfpr += (n >> 1); \\\n\t  if ((n & 1)) fprodd = 0; else fprodd = nfpr-1; \\\n\t  goto done; \\\n\t} \\\n      } else { \\\n\tif (2*nfpr+n <= 2*CCALL_NARG_FPR) { \\\n\t  dp = (void *)&cc->fpr[nfpr]; \\\n\t  nfpr += (n >> 1); \\\n\t  if ((n & 1)) fprodd = ++nfpr; else fprodd = 0; \\\n\t  goto done; \\\n\t} \\\n      } \\\n    } \\\n    fprodd = 0;  /* No reordering after the first FP value is on stack. */ \\\n  } else {\n\n#define CCALL_HANDLE_REGARG_FP2\t}\n\n#endif\n\n#define CCALL_HANDLE_REGARG \\\n  CCALL_HANDLE_REGARG_FP1 \\\n  if ((d->info & CTF_ALIGN) > CTALIGN_PTR) { \\\n    if (ngpr < maxgpr) \\\n      ngpr = (ngpr + 1u) & ~1u;  /* Align to regpair. */ \\\n  } \\\n  if (ngpr < maxgpr) { \\\n    dp = &cc->gpr[ngpr]; \\\n    if (ngpr + n > maxgpr) { \\\n      nsp += ngpr + n - maxgpr;  /* Assumes contiguous gpr/stack fields. */ \\\n      if (nsp > CCALL_MAXSTACK) goto err_nyi;  /* Too many arguments. */ \\\n      ngpr = maxgpr; \\\n    } else { \\\n      ngpr += n; \\\n    } \\\n    goto done; \\\n  } CCALL_HANDLE_REGARG_FP2\n\n#define CCALL_HANDLE_RET \\\n  if ((ct->info & CTF_VARARG)) sp = (uint8_t *)&cc->gpr[0];\n\n#elif LJ_TARGET_PPC\n/* -- PPC calling conventions --------------------------------------------- */\n\n#define CCALL_HANDLE_STRUCTRET \\\n  cc->retref = 1;  /* Return all structs by reference. */ \\\n  cc->gpr[ngpr++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET \\\n  /* Complex values are returned in 2 or 4 GPRs. */ \\\n  cc->retref = 0;\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  memcpy(dp, sp, ctr->size);  /* Copy complex from GPRs. */\n\n#define CCALL_HANDLE_STRUCTARG \\\n  rp = cdataptr(lj_cdata_new(cts, did, sz)); \\\n  sz = CTSIZE_PTR;  /* Pass all structs by reference. */\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  /* Pass complex by value in 2 or 4 GPRs. */\n\n#define CCALL_HANDLE_REGARG \\\n  if (isfp) {  /* Try to pass argument in FPRs. */ \\\n    if (nfpr + 1 <= CCALL_NARG_FPR) { \\\n      dp = &cc->fpr[nfpr]; \\\n      nfpr += 1; \\\n      d = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */ \\\n      goto done; \\\n    } \\\n  } else {  /* Try to pass argument in GPRs. */ \\\n    if (n > 1) { \\\n      lua_assert(n == 2 || n == 4);  /* int64_t or complex (float). */ \\\n      if (ctype_isinteger(d->info)) \\\n\tngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \\\n      else if (ngpr + n > maxgpr) \\\n\tngpr = maxgpr;  /* Prevent reordering. */ \\\n    } \\\n    if (ngpr + n <= maxgpr) { \\\n      dp = &cc->gpr[ngpr]; \\\n      ngpr += n; \\\n      goto done; \\\n    } \\\n  }\n\n#define CCALL_HANDLE_RET \\\n  if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \\\n    ctr = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */\n\n#elif LJ_TARGET_PPCSPE\n/* -- PPC/SPE calling conventions ----------------------------------------- */\n\n#define CCALL_HANDLE_STRUCTRET \\\n  cc->retref = 1;  /* Return all structs by reference. */ \\\n  cc->gpr[ngpr++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET \\\n  /* Complex values are returned in 2 or 4 GPRs. */ \\\n  cc->retref = 0;\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  memcpy(dp, sp, ctr->size);  /* Copy complex from GPRs. */\n\n#define CCALL_HANDLE_STRUCTARG \\\n  rp = cdataptr(lj_cdata_new(cts, did, sz)); \\\n  sz = CTSIZE_PTR;  /* Pass all structs by reference. */\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  /* Pass complex by value in 2 or 4 GPRs. */\n\n/* PPC/SPE has a softfp ABI. */\n#define CCALL_HANDLE_REGARG \\\n  if (n > 1) {  /* Doesn't fit in a single GPR? */ \\\n    lua_assert(n == 2 || n == 4);  /* int64_t, double or complex (float). */ \\\n    if (n == 2) \\\n      ngpr = (ngpr + 1u) & ~1u;  /* Only align 64 bit value to regpair. */ \\\n    else if (ngpr + n > maxgpr) \\\n      ngpr = maxgpr;  /* Prevent reordering. */ \\\n  } \\\n  if (ngpr + n <= maxgpr) { \\\n    dp = &cc->gpr[ngpr]; \\\n    ngpr += n; \\\n    goto done; \\\n  }\n\n#elif LJ_TARGET_MIPS\n/* -- MIPS calling conventions -------------------------------------------- */\n\n#define CCALL_HANDLE_STRUCTRET \\\n  cc->retref = 1;  /* Return all structs by reference. */ \\\n  cc->gpr[ngpr++] = (GPRArg)dp;\n\n#define CCALL_HANDLE_COMPLEXRET \\\n  /* Complex values are returned in 1 or 2 FPRs. */ \\\n  cc->retref = 0;\n\n#define CCALL_HANDLE_COMPLEXRET2 \\\n  if (ctr->size == 2*sizeof(float)) {  /* Copy complex float from FPRs. */ \\\n    ((float *)dp)[0] = cc->fpr[0].f; \\\n    ((float *)dp)[1] = cc->fpr[1].f; \\\n  } else {  /* Copy complex double from FPRs. */ \\\n    ((double *)dp)[0] = cc->fpr[0].d; \\\n    ((double *)dp)[1] = cc->fpr[1].d; \\\n  }\n\n#define CCALL_HANDLE_STRUCTARG \\\n  /* Pass all structs by value in registers and/or on the stack. */\n\n#define CCALL_HANDLE_COMPLEXARG \\\n  /* Pass complex by value in 2 or 4 GPRs. */\n\n#define CCALL_HANDLE_REGARG \\\n  if (isfp && nfpr < CCALL_NARG_FPR && !(ct->info & CTF_VARARG)) { \\\n    /* Try to pass argument in FPRs. */ \\\n    dp = n == 1 ? (void *)&cc->fpr[nfpr].f : (void *)&cc->fpr[nfpr].d; \\\n    nfpr++; ngpr += n; \\\n    goto done; \\\n  } else {  /* Try to pass argument in GPRs. */ \\\n    nfpr = CCALL_NARG_FPR; \\\n    if ((d->info & CTF_ALIGN) > CTALIGN_PTR) \\\n      ngpr = (ngpr + 1u) & ~1u;  /* Align to regpair. */ \\\n    if (ngpr < maxgpr) { \\\n      dp = &cc->gpr[ngpr]; \\\n      if (ngpr + n > maxgpr) { \\\n\tnsp += ngpr + n - maxgpr;  /* Assumes contiguous gpr/stack fields. */ \\\n\tif (nsp > CCALL_MAXSTACK) goto err_nyi;  /* Too many arguments. */ \\\n\tngpr = maxgpr; \\\n      } else { \\\n\tngpr += n; \\\n      } \\\n      goto done; \\\n    } \\\n  }\n\n#define CCALL_HANDLE_RET \\\n  if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \\\n    sp = (uint8_t *)&cc->fpr[0].f;\n\n#else\n#error \"Missing calling convention definitions for this architecture\"\n#endif\n\n#ifndef CCALL_HANDLE_STRUCTRET2\n#define CCALL_HANDLE_STRUCTRET2 \\\n  memcpy(dp, sp, ctr->size);  /* Copy struct return value from GPRs. */\n#endif\n\n/* -- x64 struct classification ------------------------------------------- */\n\n#if LJ_TARGET_X64 && !LJ_ABI_WIN\n\n/* Register classes for x64 struct classification. */\n#define CCALL_RCL_INT\t1\n#define CCALL_RCL_SSE\t2\n#define CCALL_RCL_MEM\t4\n/* NYI: classify vectors. */\n\nstatic int ccall_classify_struct(CTState *cts, CType *ct, int *rcl, CTSize ofs);\n\n/* Classify a C type. */\nstatic void ccall_classify_ct(CTState *cts, CType *ct, int *rcl, CTSize ofs)\n{\n  if (ctype_isarray(ct->info)) {\n    CType *cct = ctype_rawchild(cts, ct);\n    CTSize eofs, esz = cct->size, asz = ct->size;\n    for (eofs = 0; eofs < asz; eofs += esz)\n      ccall_classify_ct(cts, cct, rcl, ofs+eofs);\n  } else if (ctype_isstruct(ct->info)) {\n    ccall_classify_struct(cts, ct, rcl, ofs);\n  } else {\n    int cl = ctype_isfp(ct->info) ? CCALL_RCL_SSE : CCALL_RCL_INT;\n    lua_assert(ctype_hassize(ct->info));\n    if ((ofs & (ct->size-1))) cl = CCALL_RCL_MEM;  /* Unaligned. */\n    rcl[(ofs >= 8)] |= cl;\n  }\n}\n\n/* Recursively classify a struct based on its fields. */\nstatic int ccall_classify_struct(CTState *cts, CType *ct, int *rcl, CTSize ofs)\n{\n  if (ct->size > 16) return CCALL_RCL_MEM;  /* Too big, gets memory class. */\n  while (ct->sib) {\n    CTSize fofs;\n    ct = ctype_get(cts, ct->sib);\n    fofs = ofs+ct->size;\n    if (ctype_isfield(ct->info))\n      ccall_classify_ct(cts, ctype_rawchild(cts, ct), rcl, fofs);\n    else if (ctype_isbitfield(ct->info))\n      rcl[(fofs >= 8)] |= CCALL_RCL_INT;  /* NYI: unaligned bitfields? */\n    else if (ctype_isxattrib(ct->info, CTA_SUBTYPE))\n      ccall_classify_struct(cts, ctype_rawchild(cts, ct), rcl, fofs);\n  }\n  return ((rcl[0]|rcl[1]) & CCALL_RCL_MEM);  /* Memory class? */\n}\n\n/* Try to split up a small struct into registers. */\nstatic int ccall_struct_reg(CCallState *cc, GPRArg *dp, int *rcl)\n{\n  MSize ngpr = cc->ngpr, nfpr = cc->nfpr;\n  uint32_t i;\n  for (i = 0; i < 2; i++) {\n    lua_assert(!(rcl[i] & CCALL_RCL_MEM));\n    if ((rcl[i] & CCALL_RCL_INT)) {  /* Integer class takes precedence. */\n      if (ngpr >= CCALL_NARG_GPR) return 1;  /* Register overflow. */\n      cc->gpr[ngpr++] = dp[i];\n    } else if ((rcl[i] & CCALL_RCL_SSE)) {\n      if (nfpr >= CCALL_NARG_FPR) return 1;  /* Register overflow. */\n      cc->fpr[nfpr++].l[0] = dp[i];\n    }\n  }\n  cc->ngpr = ngpr; cc->nfpr = nfpr;\n  return 0;  /* Ok. */\n}\n\n/* Pass a small struct argument. */\nstatic int ccall_struct_arg(CCallState *cc, CTState *cts, CType *d, int *rcl,\n\t\t\t    TValue *o, int narg)\n{\n  GPRArg dp[2];\n  dp[0] = dp[1] = 0;\n  /* Convert to temp. struct. */\n  lj_cconv_ct_tv(cts, d, (uint8_t *)dp, o, CCF_ARG(narg));\n  if (ccall_struct_reg(cc, dp, rcl)) {  /* Register overflow? Pass on stack. */\n    MSize nsp = cc->nsp, n = rcl[1] ? 2 : 1;\n    if (nsp + n > CCALL_MAXSTACK) return 1;  /* Too many arguments. */\n    cc->nsp = nsp + n;\n    memcpy(&cc->stack[nsp], dp, n*CTSIZE_PTR);\n  }\n  return 0;  /* Ok. */\n}\n\n/* Combine returned small struct. */\nstatic void ccall_struct_ret(CCallState *cc, int *rcl, uint8_t *dp, CTSize sz)\n{\n  GPRArg sp[2];\n  MSize ngpr = 0, nfpr = 0;\n  uint32_t i;\n  for (i = 0; i < 2; i++) {\n    if ((rcl[i] & CCALL_RCL_INT)) {  /* Integer class takes precedence. */\n      sp[i] = cc->gpr[ngpr++];\n    } else if ((rcl[i] & CCALL_RCL_SSE)) {\n      sp[i] = cc->fpr[nfpr++].l[0];\n    }\n  }\n  memcpy(dp, sp, sz);\n}\n#endif\n\n/* -- ARM hard-float ABI struct classification ---------------------------- */\n\n#if LJ_TARGET_ARM && !LJ_ABI_SOFTFP\n\n/* Classify a struct based on its fields. */\nstatic unsigned int ccall_classify_struct(CTState *cts, CType *ct, CType *ctf)\n{\n  CTSize sz = ct->size;\n  unsigned int r = 0, n = 0, isu = (ct->info & CTF_UNION);\n  if ((ctf->info & CTF_VARARG)) goto noth;\n  while (ct->sib) {\n    ct = ctype_get(cts, ct->sib);\n    if (ctype_isfield(ct->info)) {\n      CType *sct = ctype_rawchild(cts, ct);\n      if (ctype_isfp(sct->info)) {\n\tr |= sct->size;\n\tif (!isu) n++; else if (n == 0) n = 1;\n      } else if (ctype_iscomplex(sct->info)) {\n\tr |= (sct->size >> 1);\n\tif (!isu) n += 2; else if (n < 2) n = 2;\n      } else {\n\tgoto noth;\n      }\n    } else if (ctype_isbitfield(ct->info)) {\n      goto noth;\n    } else if (ctype_isxattrib(ct->info, CTA_SUBTYPE)) {\n      CType *sct = ctype_rawchild(cts, ct);\n      if (sct->size > 0) {\n\tunsigned int s = ccall_classify_struct(cts, sct, ctf);\n\tif (s <= 1) goto noth;\n\tr |= (s & 255);\n\tif (!isu) n += (s >> 8); else if (n < (s >>8)) n = (s >> 8);\n      }\n    }\n  }\n  if ((r == 4 || r == 8) && n <= 4)\n    return r + (n << 8);\nnoth:  /* Not a homogeneous float/double aggregate. */\n  return (sz <= 4);  /* Return structs of size <= 4 in a GPR. */\n}\n\n#endif\n\n/* -- Common C call handling ---------------------------------------------- */\n\n/* Infer the destination CTypeID for a vararg argument. */\nCTypeID lj_ccall_ctid_vararg(CTState *cts, cTValue *o)\n{\n  if (tvisnumber(o)) {\n    return CTID_DOUBLE;\n  } else if (tviscdata(o)) {\n    CTypeID id = cdataV(o)->ctypeid;\n    CType *s = ctype_get(cts, id);\n    if (ctype_isrefarray(s->info)) {\n      return lj_ctype_intern(cts,\n\t       CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(s->info)), CTSIZE_PTR);\n    } else if (ctype_isstruct(s->info) || ctype_isfunc(s->info)) {\n      /* NYI: how to pass a struct by value in a vararg argument? */\n      return lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR);\n    } else if (ctype_isfp(s->info) && s->size == sizeof(float)) {\n      return CTID_DOUBLE;\n    } else {\n      return id;\n    }\n  } else if (tvisstr(o)) {\n    return CTID_P_CCHAR;\n  } else if (tvisbool(o)) {\n    return CTID_BOOL;\n  } else {\n    return CTID_P_VOID;\n  }\n}\n\n/* Setup arguments for C call. */\nstatic int ccall_set_args(lua_State *L, CTState *cts, CType *ct,\n\t\t\t  CCallState *cc)\n{\n  int gcsteps = 0;\n  TValue *o, *top = L->top;\n  CTypeID fid;\n  CType *ctr;\n  MSize maxgpr, ngpr = 0, nsp = 0, narg;\n#if CCALL_NARG_FPR\n  MSize nfpr = 0;\n#if LJ_TARGET_ARM\n  MSize fprodd = 0;\n#endif\n#endif\n\n  /* Clear unused regs to get some determinism in case of misdeclaration. */\n  memset(cc->gpr, 0, sizeof(cc->gpr));\n#if CCALL_NUM_FPR\n  memset(cc->fpr, 0, sizeof(cc->fpr));\n#endif\n\n#if LJ_TARGET_X86\n  /* x86 has several different calling conventions. */\n  cc->resx87 = 0;\n  switch (ctype_cconv(ct->info)) {\n  case CTCC_FASTCALL: maxgpr = 2; break;\n  case CTCC_THISCALL: maxgpr = 1; break;\n  default: maxgpr = 0; break;\n  }\n#else\n  maxgpr = CCALL_NARG_GPR;\n#endif\n\n  /* Perform required setup for some result types. */\n  ctr = ctype_rawchild(cts, ct);\n  if (ctype_isvector(ctr->info)) {\n    if (!(CCALL_VECTOR_REG && (ctr->size == 8 || ctr->size == 16)))\n      goto err_nyi;\n  } else if (ctype_iscomplex(ctr->info) || ctype_isstruct(ctr->info)) {\n    /* Preallocate cdata object and anchor it after arguments. */\n    CTSize sz = ctr->size;\n    GCcdata *cd = lj_cdata_new(cts, ctype_cid(ct->info), sz);\n    void *dp = cdataptr(cd);\n    setcdataV(L, L->top++, cd);\n    if (ctype_isstruct(ctr->info)) {\n      CCALL_HANDLE_STRUCTRET\n    } else {\n      CCALL_HANDLE_COMPLEXRET\n    }\n#if LJ_TARGET_X86\n  } else if (ctype_isfp(ctr->info)) {\n    cc->resx87 = ctr->size == sizeof(float) ? 1 : 2;\n#endif\n  }\n\n  /* Skip initial attributes. */\n  fid = ct->sib;\n  while (fid) {\n    CType *ctf = ctype_get(cts, fid);\n    if (!ctype_isattrib(ctf->info)) break;\n    fid = ctf->sib;\n  }\n\n  /* Walk through all passed arguments. */\n  for (o = L->base+1, narg = 1; o < top; o++, narg++) {\n    CTypeID did;\n    CType *d;\n    CTSize sz;\n    MSize n, isfp = 0, isva = 0;\n    void *dp, *rp = NULL;\n\n    if (fid) {  /* Get argument type from field. */\n      CType *ctf = ctype_get(cts, fid);\n      fid = ctf->sib;\n      lua_assert(ctype_isfield(ctf->info));\n      did = ctype_cid(ctf->info);\n    } else {\n      if (!(ct->info & CTF_VARARG))\n\tlj_err_caller(L, LJ_ERR_FFI_NUMARG);  /* Too many arguments. */\n      did = lj_ccall_ctid_vararg(cts, o);  /* Infer vararg type. */\n      isva = 1;\n    }\n    d = ctype_raw(cts, did);\n    sz = d->size;\n\n    /* Find out how (by value/ref) and where (GPR/FPR) to pass an argument. */\n    if (ctype_isnum(d->info)) {\n      if (sz > 8) goto err_nyi;\n      if ((d->info & CTF_FP))\n\tisfp = 1;\n    } else if (ctype_isvector(d->info)) {\n      if (CCALL_VECTOR_REG && (sz == 8 || sz == 16))\n\tisfp = 1;\n      else\n\tgoto err_nyi;\n    } else if (ctype_isstruct(d->info)) {\n      CCALL_HANDLE_STRUCTARG\n    } else if (ctype_iscomplex(d->info)) {\n      CCALL_HANDLE_COMPLEXARG\n    } else {\n      sz = CTSIZE_PTR;\n    }\n    sz = (sz + CTSIZE_PTR-1) & ~(CTSIZE_PTR-1);\n    n = sz / CTSIZE_PTR;  /* Number of GPRs or stack slots needed. */\n\n    CCALL_HANDLE_REGARG  /* Handle register arguments. */\n\n    /* Otherwise pass argument on stack. */\n    if (CCALL_ALIGN_STACKARG && !rp && (d->info & CTF_ALIGN) > CTALIGN_PTR) {\n      MSize align = (1u << ctype_align(d->info-CTALIGN_PTR)) -1;\n      nsp = (nsp + align) & ~align;  /* Align argument on stack. */\n    }\n    if (nsp + n > CCALL_MAXSTACK) {  /* Too many arguments. */\n    err_nyi:\n      lj_err_caller(L, LJ_ERR_FFI_NYICALL);\n    }\n    dp = &cc->stack[nsp];\n    nsp += n;\n    isva = 0;\n\n  done:\n    if (rp) {  /* Pass by reference. */\n      gcsteps++;\n      *(void **)dp = rp;\n      dp = rp;\n    }\n    lj_cconv_ct_tv(cts, d, (uint8_t *)dp, o, CCF_ARG(narg));\n    /* Extend passed integers to 32 bits at least. */\n    if (ctype_isinteger_or_bool(d->info) && d->size < 4) {\n      if (d->info & CTF_UNSIGNED)\n\t*(uint32_t *)dp = d->size == 1 ? (uint32_t)*(uint8_t *)dp :\n\t\t\t\t\t (uint32_t)*(uint16_t *)dp;\n      else\n\t*(int32_t *)dp = d->size == 1 ? (int32_t)*(int8_t *)dp :\n\t\t\t\t\t(int32_t)*(int16_t *)dp;\n    }\n#if LJ_TARGET_X64 && LJ_ABI_WIN\n    if (isva) {  /* Windows/x64 mirrors varargs in both register sets. */\n      if (nfpr == ngpr)\n\tcc->gpr[ngpr-1] = cc->fpr[ngpr-1].l[0];\n      else\n\tcc->fpr[ngpr-1].l[0] = cc->gpr[ngpr-1];\n    }\n#else\n    UNUSED(isva);\n#endif\n#if LJ_TARGET_X64 && !LJ_ABI_WIN\n    if (isfp == 2 && n == 2 && (uint8_t *)dp == (uint8_t *)&cc->fpr[nfpr-2]) {\n      cc->fpr[nfpr-1].d[0] = cc->fpr[nfpr-2].d[1];  /* Split complex double. */\n      cc->fpr[nfpr-2].d[1] = 0;\n    }\n#else\n    UNUSED(isfp);\n#endif\n  }\n  if (fid) lj_err_caller(L, LJ_ERR_FFI_NUMARG);  /* Too few arguments. */\n\n#if LJ_TARGET_X64 || LJ_TARGET_PPC\n  cc->nfpr = nfpr;  /* Required for vararg functions. */\n#endif\n  cc->nsp = nsp;\n  cc->spadj = (CCALL_SPS_FREE + CCALL_SPS_EXTRA)*CTSIZE_PTR;\n  if (nsp > CCALL_SPS_FREE)\n    cc->spadj += (((nsp-CCALL_SPS_FREE)*CTSIZE_PTR + 15u) & ~15u);\n  return gcsteps;\n}\n\n/* Get results from C call. */\nstatic int ccall_get_results(lua_State *L, CTState *cts, CType *ct,\n\t\t\t     CCallState *cc, int *ret)\n{\n  CType *ctr = ctype_rawchild(cts, ct);\n  uint8_t *sp = (uint8_t *)&cc->gpr[0];\n  if (ctype_isvoid(ctr->info)) {\n    *ret = 0;  /* Zero results. */\n    return 0;  /* No additional GC step. */\n  }\n  *ret = 1;  /* One result. */\n  if (ctype_isstruct(ctr->info)) {\n    /* Return cdata object which is already on top of stack. */\n    if (!cc->retref) {\n      void *dp = cdataptr(cdataV(L->top-1));  /* Use preallocated object. */\n      CCALL_HANDLE_STRUCTRET2\n    }\n    return 1;  /* One GC step. */\n  }\n  if (ctype_iscomplex(ctr->info)) {\n    /* Return cdata object which is already on top of stack. */\n    void *dp = cdataptr(cdataV(L->top-1));  /* Use preallocated object. */\n    CCALL_HANDLE_COMPLEXRET2\n    return 1;  /* One GC step. */\n  }\n  if (LJ_BE && ctype_isinteger_or_bool(ctr->info) && ctr->size < CTSIZE_PTR)\n    sp += (CTSIZE_PTR - ctr->size);\n#if CCALL_NUM_FPR\n  if (ctype_isfp(ctr->info) || ctype_isvector(ctr->info))\n    sp = (uint8_t *)&cc->fpr[0];\n#endif\n#ifdef CCALL_HANDLE_RET\n  CCALL_HANDLE_RET\n#endif\n  /* No reference types end up here, so there's no need for the CTypeID. */\n  lua_assert(!(ctype_isrefarray(ctr->info) || ctype_isstruct(ctr->info)));\n  return lj_cconv_tv_ct(cts, ctr, 0, L->top-1, sp);\n}\n\n/* Call C function. */\nint lj_ccall_func(lua_State *L, GCcdata *cd)\n{\n  CTState *cts = ctype_cts(L);\n  CType *ct = ctype_raw(cts, cd->ctypeid);\n  CTSize sz = CTSIZE_PTR;\n  if (ctype_isptr(ct->info)) {\n    sz = ct->size;\n    ct = ctype_rawchild(cts, ct);\n  }\n  if (ctype_isfunc(ct->info)) {\n    CCallState cc;\n    int gcsteps, ret;\n    cc.func = (void (*)(void))cdata_getptr(cdataptr(cd), sz);\n    gcsteps = ccall_set_args(L, cts, ct, &cc);\n    ct = (CType *)((intptr_t)ct-(intptr_t)cts->tab);\n    cts->cb.slot = ~0u;\n    lj_vm_ffi_call(&cc);\n    if (cts->cb.slot != ~0u) {  /* Blacklist function that called a callback. */\n      TValue tv;\n      setlightudV(&tv, (void *)cc.func);\n      setboolV(lj_tab_set(L, cts->miscmap, &tv), 1);\n    }\n    ct = (CType *)((intptr_t)ct+(intptr_t)cts->tab);  /* May be reallocated. */\n    gcsteps += ccall_get_results(L, cts, ct, &cc, &ret);\n#if LJ_TARGET_X86 && LJ_ABI_WIN\n    /* Automatically detect __stdcall and fix up C function declaration. */\n    if (cc.spadj && ctype_cconv(ct->info) == CTCC_CDECL) {\n      CTF_INSERT(ct->info, CCONV, CTCC_STDCALL);\n      lj_trace_abort(G(L));\n    }\n#endif\n    while (gcsteps-- > 0)\n      lj_gc_check(L);\n    return ret;\n  }\n  return -1;  /* Not a function. */\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ccall.h",
    "content": "/*\n** FFI C call handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CCALL_H\n#define _LJ_CCALL_H\n\n#include \"lj_obj.h\"\n#include \"lj_ctype.h\"\n\n#if LJ_HASFFI\n\n/* -- C calling conventions ----------------------------------------------- */\n\n#if LJ_TARGET_X86ORX64\n\n#if LJ_TARGET_X86\n#define CCALL_NARG_GPR\t\t2\t/* For fastcall arguments. */\n#define CCALL_NARG_FPR\t\t0\n#define CCALL_NRET_GPR\t\t2\n#define CCALL_NRET_FPR\t\t1\t/* For FP results on x87 stack. */\n#define CCALL_ALIGN_STACKARG\t0\t/* Don't align argument on stack. */\n#elif LJ_ABI_WIN\n#define CCALL_NARG_GPR\t\t4\n#define CCALL_NARG_FPR\t\t4\n#define CCALL_NRET_GPR\t\t1\n#define CCALL_NRET_FPR\t\t1\n#define CCALL_SPS_EXTRA\t\t4\n#else\n#define CCALL_NARG_GPR\t\t6\n#define CCALL_NARG_FPR\t\t8\n#define CCALL_NRET_GPR\t\t2\n#define CCALL_NRET_FPR\t\t2\n#define CCALL_VECTOR_REG\t1\t/* Pass vectors in registers. */\n#endif\n\n#define CCALL_SPS_FREE\t\t1\n#define CCALL_ALIGN_CALLSTATE\t16\n\ntypedef LJ_ALIGN(16) union FPRArg {\n  double d[2];\n  float f[4];\n  uint8_t b[16];\n  uint16_t s[8];\n  int i[4];\n  int64_t l[2];\n} FPRArg;\n\ntypedef intptr_t GPRArg;\n\n#elif LJ_TARGET_ARM\n\n#define CCALL_NARG_GPR\t\t4\n#define CCALL_NRET_GPR\t\t2\t/* For softfp double. */\n#if LJ_ABI_SOFTFP\n#define CCALL_NARG_FPR\t\t0\n#define CCALL_NRET_FPR\t\t0\n#else\n#define CCALL_NARG_FPR\t\t8\n#define CCALL_NRET_FPR\t\t4\n#endif\n#define CCALL_SPS_FREE\t\t0\n\ntypedef intptr_t GPRArg;\ntypedef union FPRArg {\n  double d;\n  float f[2];\n} FPRArg;\n\n#elif LJ_TARGET_PPC\n\n#define CCALL_NARG_GPR\t\t8\n#define CCALL_NARG_FPR\t\t8\n#define CCALL_NRET_GPR\t\t4\t/* For complex double. */\n#define CCALL_NRET_FPR\t\t1\n#define CCALL_SPS_EXTRA\t\t4\n#define CCALL_SPS_FREE\t\t0\n\ntypedef intptr_t GPRArg;\ntypedef double FPRArg;\n\n#elif LJ_TARGET_PPCSPE\n\n#define CCALL_NARG_GPR\t\t8\n#define CCALL_NARG_FPR\t\t0\n#define CCALL_NRET_GPR\t\t4\t/* For softfp complex double. */\n#define CCALL_NRET_FPR\t\t0\n#define CCALL_SPS_FREE\t\t0\t/* NYI */\n\ntypedef intptr_t GPRArg;\n\n#elif LJ_TARGET_MIPS\n\n#define CCALL_NARG_GPR\t\t4\n#define CCALL_NARG_FPR\t\t2\n#define CCALL_NRET_GPR\t\t2\n#define CCALL_NRET_FPR\t\t2\n#define CCALL_SPS_EXTRA\t\t7\n#define CCALL_SPS_FREE\t\t1\n\ntypedef intptr_t GPRArg;\ntypedef union FPRArg {\n  double d;\n  struct { LJ_ENDIAN_LOHI(float f; , float g;) };\n} FPRArg;\n\n#else\n#error \"Missing calling convention definitions for this architecture\"\n#endif\n\n#ifndef CCALL_SPS_EXTRA\n#define CCALL_SPS_EXTRA\t\t0\n#endif\n#ifndef CCALL_VECTOR_REG\n#define CCALL_VECTOR_REG\t0\n#endif\n#ifndef CCALL_ALIGN_STACKARG\n#define CCALL_ALIGN_STACKARG\t1\n#endif\n#ifndef CCALL_ALIGN_CALLSTATE\n#define CCALL_ALIGN_CALLSTATE\t8\n#endif\n\n#define CCALL_NUM_GPR \\\n  (CCALL_NARG_GPR > CCALL_NRET_GPR ? CCALL_NARG_GPR : CCALL_NRET_GPR)\n#define CCALL_NUM_FPR \\\n  (CCALL_NARG_FPR > CCALL_NRET_FPR ? CCALL_NARG_FPR : CCALL_NRET_FPR)\n\n/* Check against constants in lj_ctype.h. */\nLJ_STATIC_ASSERT(CCALL_NUM_GPR <= CCALL_MAX_GPR);\nLJ_STATIC_ASSERT(CCALL_NUM_FPR <= CCALL_MAX_FPR);\n\n#define CCALL_MAXSTACK\t\t32\n\n/* -- C call state -------------------------------------------------------- */\n\ntypedef LJ_ALIGN(CCALL_ALIGN_CALLSTATE) struct CCallState {\n  void (*func)(void);\t\t/* Pointer to called function. */\n  uint32_t spadj;\t\t/* Stack pointer adjustment. */\n  uint8_t nsp;\t\t\t/* Number of stack slots. */\n  uint8_t retref;\t\t/* Return value by reference. */\n#if LJ_TARGET_X64\n  uint8_t ngpr;\t\t\t/* Number of arguments in GPRs. */\n  uint8_t nfpr;\t\t\t/* Number of arguments in FPRs. */\n#elif LJ_TARGET_X86\n  uint8_t resx87;\t\t/* Result on x87 stack: 1:float, 2:double. */\n#elif LJ_TARGET_PPC\n  uint8_t nfpr;\t\t\t/* Number of arguments in FPRs. */\n#endif\n#if LJ_32\n  int32_t align1;\n#endif\n#if CCALL_NUM_FPR\n  FPRArg fpr[CCALL_NUM_FPR];\t/* Arguments/results in FPRs. */\n#endif\n  GPRArg gpr[CCALL_NUM_GPR];\t/* Arguments/results in GPRs. */\n  GPRArg stack[CCALL_MAXSTACK];\t/* Stack slots. */\n} CCallState;\n\n/* -- C call handling ----------------------------------------------------- */\n\n/* Really belongs to lj_vm.h. */\nLJ_ASMF void LJ_FASTCALL lj_vm_ffi_call(CCallState *cc);\n\nLJ_FUNC CTypeID lj_ccall_ctid_vararg(CTState *cts, cTValue *o);\nLJ_FUNC int lj_ccall_func(lua_State *L, GCcdata *cd);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ccallback.c",
    "content": "/*\n** FFI C callback handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_tab.h\"\n#include \"lj_state.h\"\n#include \"lj_frame.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cconv.h\"\n#include \"lj_ccall.h\"\n#include \"lj_ccallback.h\"\n#include \"lj_target.h\"\n#include \"lj_mcode.h\"\n#include \"lj_trace.h\"\n#include \"lj_vm.h\"\n\n/* -- Target-specific handling of callback slots -------------------------- */\n\n#define CALLBACK_MCODE_SIZE\t(LJ_PAGESIZE * LJ_NUM_CBPAGE)\n\n#if LJ_OS_NOJIT\n\n/* Disabled callback support. */\n#define CALLBACK_SLOT2OFS(slot)\t(0*(slot))\n#define CALLBACK_OFS2SLOT(ofs)\t(0*(ofs))\n#define CALLBACK_MAX_SLOT\t0\n\n#elif LJ_TARGET_X86ORX64\n\n#define CALLBACK_MCODE_HEAD\t(LJ_64 ? 8 : 0)\n#define CALLBACK_MCODE_GROUP\t(-2+1+2+5+(LJ_64 ? 6 : 5))\n\n#define CALLBACK_SLOT2OFS(slot) \\\n  (CALLBACK_MCODE_HEAD + CALLBACK_MCODE_GROUP*((slot)/32) + 4*(slot))\n\nstatic MSize CALLBACK_OFS2SLOT(MSize ofs)\n{\n  MSize group;\n  ofs -= CALLBACK_MCODE_HEAD;\n  group = ofs / (32*4 + CALLBACK_MCODE_GROUP);\n  return (ofs % (32*4 + CALLBACK_MCODE_GROUP))/4 + group*32;\n}\n\n#define CALLBACK_MAX_SLOT \\\n  (((CALLBACK_MCODE_SIZE-CALLBACK_MCODE_HEAD)/(CALLBACK_MCODE_GROUP+4*32))*32)\n\n#elif LJ_TARGET_ARM\n\n#define CALLBACK_MCODE_HEAD\t\t32\n#define CALLBACK_SLOT2OFS(slot)\t\t(CALLBACK_MCODE_HEAD + 8*(slot))\n#define CALLBACK_OFS2SLOT(ofs)\t\t(((ofs)-CALLBACK_MCODE_HEAD)/8)\n#define CALLBACK_MAX_SLOT\t\t(CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE))\n\n#elif LJ_TARGET_PPC\n\n#define CALLBACK_MCODE_HEAD\t\t24\n#define CALLBACK_SLOT2OFS(slot)\t\t(CALLBACK_MCODE_HEAD + 8*(slot))\n#define CALLBACK_OFS2SLOT(ofs)\t\t(((ofs)-CALLBACK_MCODE_HEAD)/8)\n#define CALLBACK_MAX_SLOT\t\t(CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE))\n\n#elif LJ_TARGET_MIPS\n\n#define CALLBACK_MCODE_HEAD\t\t24\n#define CALLBACK_SLOT2OFS(slot)\t\t(CALLBACK_MCODE_HEAD + 8*(slot))\n#define CALLBACK_OFS2SLOT(ofs)\t\t(((ofs)-CALLBACK_MCODE_HEAD)/8)\n#define CALLBACK_MAX_SLOT\t\t(CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE))\n\n#else\n\n/* Missing support for this architecture. */\n#define CALLBACK_SLOT2OFS(slot)\t(0*(slot))\n#define CALLBACK_OFS2SLOT(ofs)\t(0*(ofs))\n#define CALLBACK_MAX_SLOT\t0\n\n#endif\n\n/* Convert callback slot number to callback function pointer. */\nstatic void *callback_slot2ptr(CTState *cts, MSize slot)\n{\n  return (uint8_t *)cts->cb.mcode + CALLBACK_SLOT2OFS(slot);\n}\n\n/* Convert callback function pointer to slot number. */\nMSize lj_ccallback_ptr2slot(CTState *cts, void *p)\n{\n  uintptr_t ofs = (uintptr_t)((uint8_t *)p -(uint8_t *)cts->cb.mcode);\n  if (ofs < CALLBACK_MCODE_SIZE) {\n    MSize slot = CALLBACK_OFS2SLOT((MSize)ofs);\n    if (CALLBACK_SLOT2OFS(slot) == (MSize)ofs)\n      return slot;\n  }\n  return ~0u;  /* Not a known callback function pointer. */\n}\n\n/* Initialize machine code for callback function pointers. */\n#if LJ_OS_NOJIT\n/* Disabled callback support. */\n#define callback_mcode_init(g, p)\tUNUSED(p)\n#elif LJ_TARGET_X86ORX64\nstatic void callback_mcode_init(global_State *g, uint8_t *page)\n{\n  uint8_t *p = page;\n  uint8_t *target = (uint8_t *)(void *)lj_vm_ffi_callback;\n  MSize slot;\n#if LJ_64\n  *(void **)p = target; p += 8;\n#endif\n  for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) {\n    /* mov al, slot; jmp group */\n    *p++ = XI_MOVrib | RID_EAX; *p++ = (uint8_t)slot;\n    if ((slot & 31) == 31 || slot == CALLBACK_MAX_SLOT-1) {\n      /* push ebp/rbp; mov ah, slot>>8; mov ebp, &g. */\n      *p++ = XI_PUSH + RID_EBP;\n      *p++ = XI_MOVrib | (RID_EAX+4); *p++ = (uint8_t)(slot >> 8);\n      *p++ = XI_MOVri | RID_EBP;\n      *(int32_t *)p = i32ptr(g); p += 4;\n#if LJ_64\n      /* jmp [rip-pageofs] where lj_vm_ffi_callback is stored. */\n      *p++ = XI_GROUP5; *p++ = XM_OFS0 + (XOg_JMP<<3) + RID_EBP;\n      *(int32_t *)p = (int32_t)(page-(p+4)); p += 4;\n#else\n      /* jmp lj_vm_ffi_callback. */\n      *p++ = XI_JMP; *(int32_t *)p = target-(p+4); p += 4;\n#endif\n    } else {\n      *p++ = XI_JMPs; *p++ = (uint8_t)((2+2)*(31-(slot&31)) - 2);\n    }\n  }\n  lua_assert(p - page <= CALLBACK_MCODE_SIZE);\n}\n#elif LJ_TARGET_ARM\nstatic void callback_mcode_init(global_State *g, uint32_t *page)\n{\n  uint32_t *p = page;\n  void *target = (void *)lj_vm_ffi_callback;\n  MSize slot;\n  /* This must match with the saveregs macro in buildvm_arm.dasc. */\n  *p++ = ARMI_SUB|ARMF_D(RID_R12)|ARMF_N(RID_R12)|ARMF_M(RID_PC);\n  *p++ = ARMI_PUSH|ARMF_N(RID_SP)|RSET_RANGE(RID_R4,RID_R11+1)|RID2RSET(RID_LR);\n  *p++ = ARMI_SUB|ARMI_K12|ARMF_D(RID_R12)|ARMF_N(RID_R12)|CALLBACK_MCODE_HEAD;\n  *p++ = ARMI_STR|ARMI_LS_P|ARMI_LS_W|ARMF_D(RID_R12)|ARMF_N(RID_SP)|(CFRAME_SIZE-4*9);\n  *p++ = ARMI_LDR|ARMI_LS_P|ARMI_LS_U|ARMF_D(RID_R12)|ARMF_N(RID_PC);\n  *p++ = ARMI_LDR|ARMI_LS_P|ARMI_LS_U|ARMF_D(RID_PC)|ARMF_N(RID_PC);\n  *p++ = u32ptr(g);\n  *p++ = u32ptr(target);\n  for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) {\n    *p++ = ARMI_MOV|ARMF_D(RID_R12)|ARMF_M(RID_PC);\n    *p = ARMI_B | ((page-p-2) & 0x00ffffffu);\n    p++;\n  }\n  lua_assert(p - page <= CALLBACK_MCODE_SIZE);\n}\n#elif LJ_TARGET_PPC\nstatic void callback_mcode_init(global_State *g, uint32_t *page)\n{\n  uint32_t *p = page;\n  void *target = (void *)lj_vm_ffi_callback;\n  MSize slot;\n  *p++ = PPCI_LIS | PPCF_T(RID_TMP) | (u32ptr(target) >> 16);\n  *p++ = PPCI_LIS | PPCF_T(RID_R12) | (u32ptr(g) >> 16);\n  *p++ = PPCI_ORI | PPCF_A(RID_TMP)|PPCF_T(RID_TMP) | (u32ptr(target) & 0xffff);\n  *p++ = PPCI_ORI | PPCF_A(RID_R12)|PPCF_T(RID_R12) | (u32ptr(g) & 0xffff);\n  *p++ = PPCI_MTCTR | PPCF_T(RID_TMP);\n  *p++ = PPCI_BCTR;\n  for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) {\n    *p++ = PPCI_LI | PPCF_T(RID_R11) | slot;\n    *p = PPCI_B | (((page-p) & 0x00ffffffu) << 2);\n    p++;\n  }\n  lua_assert(p - page <= CALLBACK_MCODE_SIZE);\n}\n#elif LJ_TARGET_MIPS\nstatic void callback_mcode_init(global_State *g, uint32_t *page)\n{\n  uint32_t *p = page;\n  void *target = (void *)lj_vm_ffi_callback;\n  MSize slot;\n  *p++ = MIPSI_SW | MIPSF_T(RID_R1)|MIPSF_S(RID_SP) | 0;\n  *p++ = MIPSI_LUI | MIPSF_T(RID_R3) | (u32ptr(target) >> 16);\n  *p++ = MIPSI_LUI | MIPSF_T(RID_R2) | (u32ptr(g) >> 16);\n  *p++ = MIPSI_ORI | MIPSF_T(RID_R3)|MIPSF_S(RID_R3) |(u32ptr(target)&0xffff);\n  *p++ = MIPSI_JR | MIPSF_S(RID_R3);\n  *p++ = MIPSI_ORI | MIPSF_T(RID_R2)|MIPSF_S(RID_R2) | (u32ptr(g)&0xffff);\n  for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) {\n    *p = MIPSI_B | ((page-p-1) & 0x0000ffffu);\n    p++;\n    *p++ = MIPSI_LI | MIPSF_T(RID_R1) | slot;\n  }\n  lua_assert(p - page <= CALLBACK_MCODE_SIZE);\n}\n#else\n/* Missing support for this architecture. */\n#define callback_mcode_init(g, p)\tUNUSED(p)\n#endif\n\n/* -- Machine code management --------------------------------------------- */\n\n#if LJ_TARGET_WINDOWS\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n#elif LJ_TARGET_POSIX\n\n#include <sys/mman.h>\n#ifndef MAP_ANONYMOUS\n#define MAP_ANONYMOUS   MAP_ANON\n#endif\n\n#endif\n\n/* Allocate and initialize area for callback function pointers. */\nstatic void callback_mcode_new(CTState *cts)\n{\n  size_t sz = (size_t)CALLBACK_MCODE_SIZE;\n  void *p;\n  if (CALLBACK_MAX_SLOT == 0)\n    lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV);\n#if LJ_TARGET_WINDOWS\n  p = VirtualAlloc(NULL, sz, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);\n  if (!p)\n    lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV);\n#elif LJ_TARGET_POSIX\n  p = mmap(NULL, sz, (PROT_READ|PROT_WRITE), MAP_PRIVATE|MAP_ANONYMOUS,\n\t   -1, 0);\n  if (p == MAP_FAILED)\n    lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV);\n#else\n  /* Fallback allocator. Fails if memory is not executable by default. */\n  p = lj_mem_new(cts->L, sz);\n#endif\n  cts->cb.mcode = p;\n  callback_mcode_init(cts->g, p);\n  lj_mcode_sync(p, (char *)p + sz);\n#if LJ_TARGET_WINDOWS\n  {\n    DWORD oprot;\n    VirtualProtect(p, sz, PAGE_EXECUTE_READ, &oprot);\n  }\n#elif LJ_TARGET_POSIX\n  mprotect(p, sz, (PROT_READ|PROT_EXEC));\n#endif\n}\n\n/* Free area for callback function pointers. */\nvoid lj_ccallback_mcode_free(CTState *cts)\n{\n  size_t sz = (size_t)CALLBACK_MCODE_SIZE;\n  void *p = cts->cb.mcode;\n  if (p == NULL) return;\n#if LJ_TARGET_WINDOWS\n  VirtualFree(p, 0, MEM_RELEASE);\n  UNUSED(sz);\n#elif LJ_TARGET_POSIX\n  munmap(p, sz);\n#else\n  lj_mem_free(cts->g, p, sz);\n#endif\n}\n\n/* -- C callback entry ---------------------------------------------------- */\n\n/* Target-specific handling of register arguments. Similar to lj_ccall.c. */\n#if LJ_TARGET_X86\n\n#define CALLBACK_HANDLE_REGARG \\\n  if (!isfp) {  /* Only non-FP values may be passed in registers. */ \\\n    if (n > 1) {  /* Anything > 32 bit is passed on the stack. */ \\\n      if (!LJ_ABI_WIN) ngpr = maxgpr;  /* Prevent reordering. */ \\\n    } else if (ngpr + 1 <= maxgpr) { \\\n      sp = &cts->cb.gpr[ngpr]; \\\n      ngpr += n; \\\n      goto done; \\\n    } \\\n  }\n\n#elif LJ_TARGET_X64 && LJ_ABI_WIN\n\n/* Windows/x64 argument registers are strictly positional (use ngpr). */\n#define CALLBACK_HANDLE_REGARG \\\n  if (isfp) { \\\n    if (ngpr < 4) { sp = &cts->cb.fpr[ngpr++]; nfpr = ngpr; goto done; } \\\n  } else { \\\n    if (ngpr < 4) { sp = &cts->cb.gpr[ngpr++]; goto done; } \\\n  }\n\n#elif LJ_TARGET_X64\n\n#define CALLBACK_HANDLE_REGARG \\\n  if (isfp) { \\\n    if (nfpr + n <= CCALL_NARG_FPR) { \\\n      sp = &cts->cb.fpr[nfpr]; \\\n      nfpr += n; \\\n      goto done; \\\n    } \\\n  } else { \\\n    if (ngpr + n <= maxgpr) { \\\n      sp = &cts->cb.gpr[ngpr]; \\\n      ngpr += n; \\\n      goto done; \\\n    } \\\n  }\n\n#elif LJ_TARGET_ARM\n\n#if LJ_ABI_SOFTFP\n\n#define CALLBACK_HANDLE_REGARG_FP1\tUNUSED(isfp);\n#define CALLBACK_HANDLE_REGARG_FP2\n\n#else\n\n#define CALLBACK_HANDLE_REGARG_FP1 \\\n  if (isfp) { \\\n    if (n == 1) { \\\n      if (fprodd) { \\\n\tsp = &cts->cb.fpr[fprodd-1]; \\\n\tfprodd = 0; \\\n\tgoto done; \\\n      } else if (nfpr + 1 <= CCALL_NARG_FPR) { \\\n\tsp = &cts->cb.fpr[nfpr++]; \\\n\tfprodd = nfpr; \\\n\tgoto done; \\\n      } \\\n    } else { \\\n      if (nfpr + 1 <= CCALL_NARG_FPR) { \\\n\tsp = &cts->cb.fpr[nfpr++]; \\\n\tgoto done; \\\n      } \\\n    } \\\n    fprodd = 0;  /* No reordering after the first FP value is on stack. */ \\\n  } else {\n\n#define CALLBACK_HANDLE_REGARG_FP2\t}\n\n#endif\n\n#define CALLBACK_HANDLE_REGARG \\\n  CALLBACK_HANDLE_REGARG_FP1 \\\n  if (n > 1) ngpr = (ngpr + 1u) & ~1u;  /* Align to regpair. */ \\\n  if (ngpr + n <= maxgpr) { \\\n    sp = &cts->cb.gpr[ngpr]; \\\n    ngpr += n; \\\n    goto done; \\\n  } CALLBACK_HANDLE_REGARG_FP2\n\n#elif LJ_TARGET_PPC\n\n#define CALLBACK_HANDLE_REGARG \\\n  if (isfp) { \\\n    if (nfpr + 1 <= CCALL_NARG_FPR) { \\\n      sp = &cts->cb.fpr[nfpr++]; \\\n      cta = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */ \\\n      goto done; \\\n    } \\\n  } else {  /* Try to pass argument in GPRs. */ \\\n    if (n > 1) { \\\n      lua_assert(ctype_isinteger(cta->info) && n == 2);  /* int64_t. */ \\\n      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \\\n    } \\\n    if (ngpr + n <= maxgpr) { \\\n      sp = &cts->cb.gpr[ngpr]; \\\n      ngpr += n; \\\n      goto done; \\\n    } \\\n  }\n\n#define CALLBACK_HANDLE_RET \\\n  if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \\\n    *(double *)dp = *(float *)dp;  /* FPRs always hold doubles. */\n\n#elif LJ_TARGET_MIPS\n\n#define CALLBACK_HANDLE_REGARG \\\n  if (isfp && nfpr < CCALL_NARG_FPR) {  /* Try to pass argument in FPRs. */ \\\n    sp = (void *)((uint8_t *)&cts->cb.fpr[nfpr] + ((LJ_BE && n==1) ? 4 : 0)); \\\n    nfpr++; ngpr += n; \\\n    goto done; \\\n  } else {  /* Try to pass argument in GPRs. */ \\\n    nfpr = CCALL_NARG_FPR; \\\n    if (n > 1) ngpr = (ngpr + 1u) & ~1u;  /* Align to regpair. */ \\\n    if (ngpr + n <= maxgpr) { \\\n      sp = &cts->cb.gpr[ngpr]; \\\n      ngpr += n; \\\n      goto done; \\\n    } \\\n  }\n\n#define CALLBACK_HANDLE_RET \\\n  if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \\\n    ((float *)dp)[1] = *(float *)dp;\n\n#else\n#error \"Missing calling convention definitions for this architecture\"\n#endif\n\n/* Convert and push callback arguments to Lua stack. */\nstatic void callback_conv_args(CTState *cts, lua_State *L)\n{\n  TValue *o = L->top;\n  intptr_t *stack = cts->cb.stack;\n  MSize slot = cts->cb.slot;\n  CTypeID id = 0, rid, fid;\n  CType *ct;\n  GCfunc *fn;\n  MSize ngpr = 0, nsp = 0, maxgpr = CCALL_NARG_GPR;\n#if CCALL_NARG_FPR\n  MSize nfpr = 0;\n#if LJ_TARGET_ARM\n  MSize fprodd = 0;\n#endif\n#endif\n\n  if (slot < cts->cb.sizeid && (id = cts->cb.cbid[slot]) != 0) {\n    ct = ctype_get(cts, id);\n    rid = ctype_cid(ct->info);\n    fn = funcV(lj_tab_getint(cts->miscmap, (int32_t)slot));\n  } else {  /* Must set up frame first, before throwing the error. */\n    ct = NULL;\n    rid = 0;\n    fn = (GCfunc *)L;\n  }\n  o->u32.lo = LJ_CONT_FFI_CALLBACK;  /* Continuation returns from callback. */\n  o->u32.hi = rid;  /* Return type. x86: +(spadj<<16). */\n  o++;\n  setframe_gc(o, obj2gco(fn));\n  setframe_ftsz(o, (int)((char *)(o+1) - (char *)L->base) + FRAME_CONT);\n  L->top = L->base = ++o;\n  if (!ct)\n    lj_err_caller(cts->L, LJ_ERR_FFI_BADCBACK);\n  if (isluafunc(fn))\n    setcframe_pc(L->cframe, proto_bc(funcproto(fn))+1);\n  lj_state_checkstack(L, LUA_MINSTACK);  /* May throw. */\n  o = L->base;  /* Might have been reallocated. */\n\n#if LJ_TARGET_X86\n  /* x86 has several different calling conventions. */\n  switch (ctype_cconv(ct->info)) {\n  case CTCC_FASTCALL: maxgpr = 2; break;\n  case CTCC_THISCALL: maxgpr = 1; break;\n  default: maxgpr = 0; break;\n  }\n#endif\n\n  fid = ct->sib;\n  while (fid) {\n    CType *ctf = ctype_get(cts, fid);\n    if (!ctype_isattrib(ctf->info)) {\n      CType *cta;\n      void *sp;\n      CTSize sz;\n      int isfp;\n      MSize n;\n      lua_assert(ctype_isfield(ctf->info));\n      cta = ctype_rawchild(cts, ctf);\n      isfp = ctype_isfp(cta->info);\n      sz = (cta->size + CTSIZE_PTR-1) & ~(CTSIZE_PTR-1);\n      n = sz / CTSIZE_PTR;  /* Number of GPRs or stack slots needed. */\n\n      CALLBACK_HANDLE_REGARG  /* Handle register arguments. */\n\n      /* Otherwise pass argument on stack. */\n      if (CCALL_ALIGN_STACKARG && LJ_32 && sz == 8)\n\tnsp = (nsp + 1) & ~1u;  /* Align 64 bit argument on stack. */\n      sp = &stack[nsp];\n      nsp += n;\n\n    done:\n      if (LJ_BE && cta->size < CTSIZE_PTR)\n\tsp = (void *)((uint8_t *)sp + CTSIZE_PTR-cta->size);\n      lj_cconv_tv_ct(cts, cta, 0, o++, sp);\n    }\n    fid = ctf->sib;\n  }\n  L->top = o;\n#if LJ_TARGET_X86\n  /* Store stack adjustment for returns from non-cdecl callbacks. */\n  if (ctype_cconv(ct->info) != CTCC_CDECL)\n    (L->base-2)->u32.hi |= (nsp << (16+2));\n#endif\n}\n\n/* Convert Lua object to callback result. */\nstatic void callback_conv_result(CTState *cts, lua_State *L, TValue *o)\n{\n  CType *ctr = ctype_raw(cts, (uint16_t)(L->base-2)->u32.hi);\n#if LJ_TARGET_X86\n  cts->cb.gpr[2] = 0;\n#endif\n  if (!ctype_isvoid(ctr->info)) {\n    uint8_t *dp = (uint8_t *)&cts->cb.gpr[0];\n#if CCALL_NUM_FPR\n    if (ctype_isfp(ctr->info))\n      dp = (uint8_t *)&cts->cb.fpr[0];\n#endif\n    lj_cconv_ct_tv(cts, ctr, dp, o, 0);\n#ifdef CALLBACK_HANDLE_RET\n    CALLBACK_HANDLE_RET\n#endif\n    /* Extend returned integers to (at least) 32 bits. */\n    if (ctype_isinteger_or_bool(ctr->info) && ctr->size < 4) {\n      if (ctr->info & CTF_UNSIGNED)\n\t*(uint32_t *)dp = ctr->size == 1 ? (uint32_t)*(uint8_t *)dp :\n\t\t\t\t\t   (uint32_t)*(uint16_t *)dp;\n      else\n\t*(int32_t *)dp = ctr->size == 1 ? (int32_t)*(int8_t *)dp :\n\t\t\t\t\t  (int32_t)*(int16_t *)dp;\n    }\n#if LJ_TARGET_X86\n    if (ctype_isfp(ctr->info))\n      cts->cb.gpr[2] = ctr->size == sizeof(float) ? 1 : 2;\n#endif\n  }\n}\n\n/* Enter callback. */\nlua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf)\n{\n  lua_State *L = cts->L;\n  global_State *g = cts->g;\n  lua_assert(L != NULL);\n  if (gcref(g->jit_L)) {\n    setstrV(L, L->top++, lj_err_str(L, LJ_ERR_FFI_BADCBACK));\n    if (g->panic) g->panic(L);\n    exit(EXIT_FAILURE);\n  }\n  lj_trace_abort(g);  /* Never record across callback. */\n  /* Setup C frame. */\n  cframe_prev(cf) = L->cframe;\n  setcframe_L(cf, L);\n  cframe_errfunc(cf) = -1;\n  cframe_nres(cf) = 0;\n  L->cframe = cf;\n  callback_conv_args(cts, L);\n  return L;  /* Now call the function on this stack. */\n}\n\n/* Leave callback. */\nvoid LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o)\n{\n  lua_State *L = cts->L;\n  GCfunc *fn;\n  TValue *obase = L->base;\n  L->base = L->top;  /* Keep continuation frame for throwing errors. */\n  if (o >= L->base) {\n    /* PC of RET* is lost. Point to last line for result conv. errors. */\n    fn = curr_func(L);\n    if (isluafunc(fn)) {\n      GCproto *pt = funcproto(fn);\n      setcframe_pc(L->cframe, proto_bc(pt)+pt->sizebc+1);\n    }\n  }\n  callback_conv_result(cts, L, o);\n  /* Finally drop C frame and continuation frame. */\n  L->cframe = cframe_prev(L->cframe);\n  L->top -= 2;\n  L->base = obase;\n  cts->cb.slot = 0;  /* Blacklist C function that called the callback. */\n}\n\n/* -- C callback management ----------------------------------------------- */\n\n/* Get an unused slot in the callback slot table. */\nstatic MSize callback_slot_new(CTState *cts, CType *ct)\n{\n  CTypeID id = ctype_typeid(cts, ct);\n  CTypeID1 *cbid = cts->cb.cbid;\n  MSize top;\n  for (top = cts->cb.topid; top < cts->cb.sizeid; top++)\n    if (LJ_LIKELY(cbid[top] == 0))\n      goto found;\n#if CALLBACK_MAX_SLOT\n  if (top >= CALLBACK_MAX_SLOT)\n#endif\n    lj_err_caller(cts->L, LJ_ERR_FFI_CBACKOV);\n  if (!cts->cb.mcode)\n    callback_mcode_new(cts);\n  lj_mem_growvec(cts->L, cbid, cts->cb.sizeid, CALLBACK_MAX_SLOT, CTypeID1);\n  cts->cb.cbid = cbid;\n  memset(cbid+top, 0, (cts->cb.sizeid-top)*sizeof(CTypeID1));\nfound:\n  cbid[top] = id;\n  cts->cb.topid = top+1;\n  return top;\n}\n\n/* Check for function pointer and supported argument/result types. */\nstatic CType *callback_checkfunc(CTState *cts, CType *ct)\n{\n  int narg = 0;\n  if (!ctype_isptr(ct->info) || (LJ_64 && ct->size != CTSIZE_PTR))\n    return NULL;\n  ct = ctype_rawchild(cts, ct);\n  if (ctype_isfunc(ct->info)) {\n    CType *ctr = ctype_rawchild(cts, ct);\n    CTypeID fid = ct->sib;\n    if (!(ctype_isvoid(ctr->info) || ctype_isenum(ctr->info) ||\n\t  ctype_isptr(ctr->info) || (ctype_isnum(ctr->info) && ctr->size <= 8)))\n      return NULL;\n    if ((ct->info & CTF_VARARG))\n      return NULL;\n    while (fid) {\n      CType *ctf = ctype_get(cts, fid);\n      if (!ctype_isattrib(ctf->info)) {\n\tCType *cta;\n\tlua_assert(ctype_isfield(ctf->info));\n\tcta = ctype_rawchild(cts, ctf);\n\tif (!(ctype_isenum(cta->info) || ctype_isptr(cta->info) ||\n\t      (ctype_isnum(cta->info) && cta->size <= 8)) ||\n\t    ++narg >= LUA_MINSTACK-3)\n\t  return NULL;\n      }\n      fid = ctf->sib;\n    }\n    return ct;\n  }\n  return NULL;\n}\n\n/* Create a new callback and return the callback function pointer. */\nvoid *lj_ccallback_new(CTState *cts, CType *ct, GCfunc *fn)\n{\n  ct = callback_checkfunc(cts, ct);\n  if (ct) {\n    MSize slot = callback_slot_new(cts, ct);\n    GCtab *t = cts->miscmap;\n    setfuncV(cts->L, lj_tab_setint(cts->L, t, (int32_t)slot), fn);\n    lj_gc_anybarriert(cts->L, t);\n    return callback_slot2ptr(cts, slot);\n  }\n  return NULL;  /* Bad conversion. */\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ccallback.h",
    "content": "/*\n** FFI C callback handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CCALLBACK_H\n#define _LJ_CCALLBACK_H\n\n#include \"lj_obj.h\"\n#include \"lj_ctype.h\"\n\n#if LJ_HASFFI\n\n/* Really belongs to lj_vm.h. */\nLJ_ASMF void lj_vm_ffi_callback(void);\n\nLJ_FUNC MSize lj_ccallback_ptr2slot(CTState *cts, void *p);\nLJ_FUNCA lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf);\nLJ_FUNCA void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o);\nLJ_FUNC void *lj_ccallback_new(CTState *cts, CType *ct, GCfunc *fn);\nLJ_FUNC void lj_ccallback_mcode_free(CTState *cts);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_cconv.c",
    "content": "/*\n** C type conversions.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_err.h\"\n#include \"lj_tab.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cdata.h\"\n#include \"lj_cconv.h\"\n#include \"lj_ccallback.h\"\n\n/* -- Conversion errors --------------------------------------------------- */\n\n/* Bad conversion. */\nLJ_NORET static void cconv_err_conv(CTState *cts, CType *d, CType *s,\n\t\t\t\t    CTInfo flags)\n{\n  const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL));\n  const char *src;\n  if ((flags & CCF_FROMTV))\n    src = lj_obj_typename[1+(ctype_isnum(s->info) ? LUA_TNUMBER :\n\t\t\t     ctype_isarray(s->info) ? LUA_TSTRING : LUA_TNIL)];\n  else\n    src = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, s), NULL));\n  if (CCF_GETARG(flags))\n    lj_err_argv(cts->L, CCF_GETARG(flags), LJ_ERR_FFI_BADCONV, src, dst);\n  else\n    lj_err_callerv(cts->L, LJ_ERR_FFI_BADCONV, src, dst);\n}\n\n/* Bad conversion from TValue. */\nLJ_NORET static void cconv_err_convtv(CTState *cts, CType *d, TValue *o,\n\t\t\t\t      CTInfo flags)\n{\n  const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL));\n  const char *src = lj_typename(o);\n  if (CCF_GETARG(flags))\n    lj_err_argv(cts->L, CCF_GETARG(flags), LJ_ERR_FFI_BADCONV, src, dst);\n  else\n    lj_err_callerv(cts->L, LJ_ERR_FFI_BADCONV, src, dst);\n}\n\n/* Initializer overflow. */\nLJ_NORET static void cconv_err_initov(CTState *cts, CType *d)\n{\n  const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL));\n  lj_err_callerv(cts->L, LJ_ERR_FFI_INITOV, dst);\n}\n\n/* -- C type compatibility checks ----------------------------------------- */\n\n/* Get raw type and qualifiers for a child type. Resolves enums, too. */\nstatic CType *cconv_childqual(CTState *cts, CType *ct, CTInfo *qual)\n{\n  ct = ctype_child(cts, ct);\n  for (;;) {\n    if (ctype_isattrib(ct->info)) {\n      if (ctype_attrib(ct->info) == CTA_QUAL) *qual |= ct->size;\n    } else if (!ctype_isenum(ct->info)) {\n      break;\n    }\n    ct = ctype_child(cts, ct);\n  }\n  *qual |= (ct->info & CTF_QUAL);\n  return ct;\n}\n\n/* Check for compatible types when converting to a pointer.\n** Note: these checks are more relaxed than what C99 mandates.\n*/\nint lj_cconv_compatptr(CTState *cts, CType *d, CType *s, CTInfo flags)\n{\n  if (!((flags & CCF_CAST) || d == s)) {\n    CTInfo dqual = 0, squal = 0;\n    d = cconv_childqual(cts, d, &dqual);\n    if (!ctype_isstruct(s->info))\n      s = cconv_childqual(cts, s, &squal);\n    if ((flags & CCF_SAME)) {\n      if (dqual != squal)\n\treturn 0;  /* Different qualifiers. */\n    } else if (!(flags & CCF_IGNQUAL)) {\n      if ((dqual & squal) != squal)\n\treturn 0;  /* Discarded qualifiers. */\n      if (ctype_isvoid(d->info) || ctype_isvoid(s->info))\n\treturn 1;  /* Converting to/from void * is always ok. */\n    }\n    if (ctype_type(d->info) != ctype_type(s->info) ||\n\td->size != s->size)\n      return 0;  /* Different type or different size. */\n    if (ctype_isnum(d->info)) {\n      if (((d->info ^ s->info) & (CTF_BOOL|CTF_FP)))\n\treturn 0;  /* Different numeric types. */\n    } else if (ctype_ispointer(d->info)) {\n      /* Check child types for compatibility. */\n      return lj_cconv_compatptr(cts, d, s, flags|CCF_SAME);\n    } else if (ctype_isstruct(d->info)) {\n      if (d != s)\n\treturn 0;  /* Must be exact same type for struct/union. */\n    } else if (ctype_isfunc(d->info)) {\n      /* NYI: structural equality of functions. */\n    }\n  }\n  return 1;  /* Types are compatible. */\n}\n\n/* -- C type to C type conversion ----------------------------------------- */\n\n/* Convert C type to C type. Caveat: expects to get the raw CType!\n**\n** Note: This is only used by the interpreter and not optimized at all.\n** The JIT compiler will do a much better job specializing for each case.\n*/\nvoid lj_cconv_ct_ct(CTState *cts, CType *d, CType *s,\n\t\t    uint8_t *dp, uint8_t *sp, CTInfo flags)\n{\n  CTSize dsize = d->size, ssize = s->size;\n  CTInfo dinfo = d->info, sinfo = s->info;\n  void *tmpptr;\n\n  lua_assert(!ctype_isenum(dinfo) && !ctype_isenum(sinfo));\n  lua_assert(!ctype_isattrib(dinfo) && !ctype_isattrib(sinfo));\n\n  if (ctype_type(dinfo) > CT_MAYCONVERT || ctype_type(sinfo) > CT_MAYCONVERT)\n    goto err_conv;\n\n  /* Some basic sanity checks. */\n  lua_assert(!ctype_isnum(dinfo) || dsize > 0);\n  lua_assert(!ctype_isnum(sinfo) || ssize > 0);\n  lua_assert(!ctype_isbool(dinfo) || dsize == 1 || dsize == 4);\n  lua_assert(!ctype_isbool(sinfo) || ssize == 1 || ssize == 4);\n  lua_assert(!ctype_isinteger(dinfo) || (1u<<lj_fls(dsize)) == dsize);\n  lua_assert(!ctype_isinteger(sinfo) || (1u<<lj_fls(ssize)) == ssize);\n\n  switch (cconv_idx2(dinfo, sinfo)) {\n  /* Destination is a bool. */\n  case CCX(B, B):\n    /* Source operand is already normalized. */\n    if (dsize == 1) *dp = *sp; else *(int *)dp = *sp;\n    break;\n  case CCX(B, I): {\n    MSize i;\n    uint8_t b = 0;\n    for (i = 0; i < ssize; i++) b |= sp[i];\n    b = (b != 0);\n    if (dsize == 1) *dp = b; else *(int *)dp = b;\n    break;\n    }\n  case CCX(B, F): {\n    uint8_t b;\n    if (ssize == sizeof(double)) b = (*(double *)sp != 0);\n    else if (ssize == sizeof(float)) b = (*(float *)sp != 0);\n    else goto err_conv;  /* NYI: long double. */\n    if (dsize == 1) *dp = b; else *(int *)dp = b;\n    break;\n    }\n\n  /* Destination is an integer. */\n  case CCX(I, B):\n  case CCX(I, I):\n  conv_I_I:\n    if (dsize > ssize) {  /* Zero-extend or sign-extend LSB. */\n#if LJ_LE\n      uint8_t fill = (!(sinfo & CTF_UNSIGNED) && (sp[ssize-1]&0x80)) ? 0xff : 0;\n      memcpy(dp, sp, ssize);\n      memset(dp + ssize, fill, dsize-ssize);\n#else\n      uint8_t fill = (!(sinfo & CTF_UNSIGNED) && (sp[0]&0x80)) ? 0xff : 0;\n      memset(dp, fill, dsize-ssize);\n      memcpy(dp + (dsize-ssize), sp, ssize);\n#endif\n    } else {  /* Copy LSB. */\n#if LJ_LE\n      memcpy(dp, sp, dsize);\n#else\n      memcpy(dp, sp + (ssize-dsize), dsize);\n#endif\n    }\n    break;\n  case CCX(I, F): {\n    double n;  /* Always convert via double. */\n  conv_I_F:\n    /* Convert source to double. */\n    if (ssize == sizeof(double)) n = *(double *)sp;\n    else if (ssize == sizeof(float)) n = (double)*(float *)sp;\n    else goto err_conv;  /* NYI: long double. */\n    /* Then convert double to integer. */\n    /* The conversion must exactly match the semantics of JIT-compiled code! */\n    if (dsize < 4 || (dsize == 4 && !(dinfo & CTF_UNSIGNED))) {\n      int32_t i = (int32_t)n;\n      if (dsize == 4) *(int32_t *)dp = i;\n      else if (dsize == 2) *(int16_t *)dp = (int16_t)i;\n      else *(int8_t *)dp = (int8_t)i;\n    } else if (dsize == 4) {\n      *(uint32_t *)dp = (uint32_t)n;\n    } else if (dsize == 8) {\n      if (!(dinfo & CTF_UNSIGNED))\n\t*(int64_t *)dp = (int64_t)n;\n      else\n\t*(uint64_t *)dp = lj_num2u64(n);\n    } else {\n      goto err_conv;  /* NYI: conversion to >64 bit integers. */\n    }\n    break;\n    }\n  case CCX(I, C):\n    s = ctype_child(cts, s);\n    sinfo = s->info;\n    ssize = s->size;\n    goto conv_I_F;  /* Just convert re. */\n  case CCX(I, P):\n    if (!(flags & CCF_CAST)) goto err_conv;\n    sinfo = CTINFO(CT_NUM, CTF_UNSIGNED);\n    goto conv_I_I;\n  case CCX(I, A):\n    if (!(flags & CCF_CAST)) goto err_conv;\n    sinfo = CTINFO(CT_NUM, CTF_UNSIGNED);\n    ssize = CTSIZE_PTR;\n    tmpptr = sp;\n    sp = (uint8_t *)&tmpptr;\n    goto conv_I_I;\n\n  /* Destination is a floating-point number. */\n  case CCX(F, B):\n  case CCX(F, I): {\n    double n;  /* Always convert via double. */\n  conv_F_I:\n    /* First convert source to double. */\n    /* The conversion must exactly match the semantics of JIT-compiled code! */\n    if (ssize < 4 || (ssize == 4 && !(sinfo & CTF_UNSIGNED))) {\n      int32_t i;\n      if (ssize == 4) {\n\ti = *(int32_t *)sp;\n      } else if (!(sinfo & CTF_UNSIGNED)) {\n\tif (ssize == 2) i = *(int16_t *)sp;\n\telse i = *(int8_t *)sp;\n      } else {\n\tif (ssize == 2) i = *(uint16_t *)sp;\n\telse i = *(uint8_t *)sp;\n      }\n      n = (double)i;\n    } else if (ssize == 4) {\n      n = (double)*(uint32_t *)sp;\n    } else if (ssize == 8) {\n      if (!(sinfo & CTF_UNSIGNED)) n = (double)*(int64_t *)sp;\n      else n = (double)*(uint64_t *)sp;\n    } else {\n      goto err_conv;  /* NYI: conversion from >64 bit integers. */\n    }\n    /* Convert double to destination. */\n    if (dsize == sizeof(double)) *(double *)dp = n;\n    else if (dsize == sizeof(float)) *(float *)dp = (float)n;\n    else goto err_conv;  /* NYI: long double. */\n    break;\n    }\n  case CCX(F, F): {\n    double n;  /* Always convert via double. */\n  conv_F_F:\n    if (ssize == dsize) goto copyval;\n    /* Convert source to double. */\n    if (ssize == sizeof(double)) n = *(double *)sp;\n    else if (ssize == sizeof(float)) n = (double)*(float *)sp;\n    else goto err_conv;  /* NYI: long double. */\n    /* Convert double to destination. */\n    if (dsize == sizeof(double)) *(double *)dp = n;\n    else if (dsize == sizeof(float)) *(float *)dp = (float)n;\n    else goto err_conv;  /* NYI: long double. */\n    break;\n    }\n  case CCX(F, C):\n    s = ctype_child(cts, s);\n    sinfo = s->info;\n    ssize = s->size;\n    goto conv_F_F;  /* Ignore im, and convert from re. */\n\n  /* Destination is a complex number. */\n  case CCX(C, I):\n    d = ctype_child(cts, d);\n    dinfo = d->info;\n    dsize = d->size;\n    memset(dp + dsize, 0, dsize);  /* Clear im. */\n    goto conv_F_I;  /* Convert to re. */\n  case CCX(C, F):\n    d = ctype_child(cts, d);\n    dinfo = d->info;\n    dsize = d->size;\n    memset(dp + dsize, 0, dsize);  /* Clear im. */\n    goto conv_F_F;  /* Convert to re. */\n\n  case CCX(C, C):\n    if (dsize != ssize) {  /* Different types: convert re/im separately. */\n      CType *dc = ctype_child(cts, d);\n      CType *sc = ctype_child(cts, s);\n      lj_cconv_ct_ct(cts, dc, sc, dp, sp, flags);\n      lj_cconv_ct_ct(cts, dc, sc, dp + dc->size, sp + sc->size, flags);\n      return;\n    }\n    goto copyval;  /* Otherwise this is easy. */\n\n  /* Destination is a vector. */\n  case CCX(V, I):\n  case CCX(V, F):\n  case CCX(V, C): {\n    CType *dc = ctype_child(cts, d);\n    CTSize esize;\n    /* First convert the scalar to the first element. */\n    lj_cconv_ct_ct(cts, dc, s, dp, sp, flags);\n    /* Then replicate it to the other elements (splat). */\n    for (sp = dp, esize = dc->size; dsize > esize; dsize -= esize) {\n      dp += esize;\n      memcpy(dp, sp, esize);\n    }\n    break;\n    }\n\n  case CCX(V, V):\n    /* Copy same-sized vectors, even for different lengths/element-types. */\n    if (dsize != ssize) goto err_conv;\n    goto copyval;\n\n  /* Destination is a pointer. */\n  case CCX(P, I):\n    if (!(flags & CCF_CAST)) goto err_conv;\n    dinfo = CTINFO(CT_NUM, CTF_UNSIGNED);\n    goto conv_I_I;\n\n  case CCX(P, F):\n    if (!(flags & CCF_CAST) || !(flags & CCF_FROMTV)) goto err_conv;\n    /* The signed conversion is cheaper. x64 really has 47 bit pointers. */\n    dinfo = CTINFO(CT_NUM, (LJ_64 && dsize == 8) ? 0 : CTF_UNSIGNED);\n    goto conv_I_F;\n\n  case CCX(P, P):\n    if (!lj_cconv_compatptr(cts, d, s, flags)) goto err_conv;\n    cdata_setptr(dp, dsize, cdata_getptr(sp, ssize));\n    break;\n\n  case CCX(P, A):\n  case CCX(P, S):\n    if (!lj_cconv_compatptr(cts, d, s, flags)) goto err_conv;\n    cdata_setptr(dp, dsize, sp);\n    break;\n\n  /* Destination is an array. */\n  case CCX(A, A):\n    if ((flags & CCF_CAST) || (d->info & CTF_VLA) || dsize != ssize ||\n\td->size == CTSIZE_INVALID || !lj_cconv_compatptr(cts, d, s, flags))\n      goto err_conv;\n    goto copyval;\n\n  /* Destination is a struct/union. */\n  case CCX(S, S):\n    if ((flags & CCF_CAST) || (d->info & CTF_VLA) || d != s)\n      goto err_conv;  /* Must be exact same type. */\ncopyval:  /* Copy value. */\n    lua_assert(dsize == ssize);\n    memcpy(dp, sp, dsize);\n    break;\n\n  default:\n  err_conv:\n    cconv_err_conv(cts, d, s, flags);\n  }\n}\n\n/* -- C type to TValue conversion ----------------------------------------- */\n\n/* Convert C type to TValue. Caveat: expects to get the raw CType! */\nint lj_cconv_tv_ct(CTState *cts, CType *s, CTypeID sid,\n\t\t   TValue *o, uint8_t *sp)\n{\n  CTInfo sinfo = s->info;\n  if (ctype_isnum(sinfo)) {\n    if (!ctype_isbool(sinfo)) {\n      if (ctype_isinteger(sinfo) && s->size > 4) goto copyval;\n      if (LJ_DUALNUM && ctype_isinteger(sinfo)) {\n\tint32_t i;\n\tlj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT32), s,\n\t\t       (uint8_t *)&i, sp, 0);\n\tif ((sinfo & CTF_UNSIGNED) && i < 0)\n\t  setnumV(o, (lua_Number)(uint32_t)i);\n\telse\n\t  setintV(o, i);\n      } else {\n\tlj_cconv_ct_ct(cts, ctype_get(cts, CTID_DOUBLE), s,\n\t\t       (uint8_t *)&o->n, sp, 0);\n\t/* Numbers are NOT canonicalized here! Beware of uninitialized data. */\n\tlua_assert(tvisnum(o));\n      }\n    } else {\n      uint32_t b = s->size == 1 ? (*sp != 0) : (*(int *)sp != 0);\n      setboolV(o, b);\n      setboolV(&cts->g->tmptv2, b);  /* Remember for trace recorder. */\n    }\n    return 0;\n  } else if (ctype_isrefarray(sinfo) || ctype_isstruct(sinfo)) {\n    /* Create reference. */\n    setcdataV(cts->L, o, lj_cdata_newref(cts, sp, sid));\n    return 1;  /* Need GC step. */\n  } else {\n    GCcdata *cd;\n    CTSize sz;\n  copyval:  /* Copy value. */\n    sz = s->size;\n    lua_assert(sz != CTSIZE_INVALID);\n    /* Attributes are stripped, qualifiers are kept (but mostly ignored). */\n    cd = lj_cdata_new(cts, ctype_typeid(cts, s), sz);\n    setcdataV(cts->L, o, cd);\n    memcpy(cdataptr(cd), sp, sz);\n    return 1;  /* Need GC step. */\n  }\n}\n\n/* Convert bitfield to TValue. */\nint lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp)\n{\n  CTInfo info = s->info;\n  CTSize pos, bsz;\n  uint32_t val;\n  lua_assert(ctype_isbitfield(info));\n  /* NYI: packed bitfields may cause misaligned reads. */\n  switch (ctype_bitcsz(info)) {\n  case 4: val = *(uint32_t *)sp; break;\n  case 2: val = *(uint16_t *)sp; break;\n  case 1: val = *(uint8_t *)sp; break;\n  default: lua_assert(0); val = 0; break;\n  }\n  /* Check if a packed bitfield crosses a container boundary. */\n  pos = ctype_bitpos(info);\n  bsz = ctype_bitbsz(info);\n  lua_assert(pos < 8*ctype_bitcsz(info));\n  lua_assert(bsz > 0 && bsz <= 8*ctype_bitcsz(info));\n  if (pos + bsz > 8*ctype_bitcsz(info))\n    lj_err_caller(cts->L, LJ_ERR_FFI_NYIPACKBIT);\n  if (!(info & CTF_BOOL)) {\n    CTSize shift = 32 - bsz;\n    if (!(info & CTF_UNSIGNED)) {\n      setintV(o, (int32_t)(val << (shift-pos)) >> shift);\n    } else {\n      val = (val << (shift-pos)) >> shift;\n      if (!LJ_DUALNUM || (int32_t)val < 0)\n\tsetnumV(o, (lua_Number)(uint32_t)val);\n      else\n\tsetintV(o, (int32_t)val);\n    }\n  } else {\n    lua_assert(bsz == 1);\n    setboolV(o, (val >> pos) & 1);\n  }\n  return 0;  /* No GC step needed. */\n}\n\n/* -- TValue to C type conversion ----------------------------------------- */\n\n/* Convert table to array. */\nstatic void cconv_array_tab(CTState *cts, CType *d,\n\t\t\t    uint8_t *dp, GCtab *t, CTInfo flags)\n{\n  int32_t i;\n  CType *dc = ctype_rawchild(cts, d);  /* Array element type. */\n  CTSize size = d->size, esize = dc->size, ofs = 0;\n  for (i = 0; ; i++) {\n    TValue *tv = (TValue *)lj_tab_getint(t, i);\n    if (!tv || tvisnil(tv)) {\n      if (i == 0) continue;  /* Try again for 1-based tables. */\n      break;  /* Stop at first nil. */\n    }\n    if (ofs >= size)\n      cconv_err_initov(cts, d);\n    lj_cconv_ct_tv(cts, dc, dp + ofs, tv, flags);\n    ofs += esize;\n  }\n  if (size != CTSIZE_INVALID) {  /* Only fill up arrays with known size. */\n    if (ofs == esize) {  /* Replicate a single element. */\n      for (; ofs < size; ofs += esize) memcpy(dp + ofs, dp, esize);\n    } else {  /* Otherwise fill the remainder with zero. */\n      memset(dp + ofs, 0, size - ofs);\n    }\n  }\n}\n\n/* Convert table to sub-struct/union. */\nstatic void cconv_substruct_tab(CTState *cts, CType *d, uint8_t *dp,\n\t\t\t\tGCtab *t, int32_t *ip, CTInfo flags)\n{\n  CTypeID id = d->sib;\n  while (id) {\n    CType *df = ctype_get(cts, id);\n    id = df->sib;\n    if (ctype_isfield(df->info) || ctype_isbitfield(df->info)) {\n      TValue *tv;\n      int32_t i = *ip, iz = i;\n      if (!gcref(df->name)) continue;  /* Ignore unnamed fields. */\n      if (i >= 0) {\n      retry:\n\ttv = (TValue *)lj_tab_getint(t, i);\n\tif (!tv || tvisnil(tv)) {\n\t  if (i == 0) { i = 1; goto retry; }  /* 1-based tables. */\n\t  if (iz == 0) { *ip = i = -1; goto tryname; }  /* Init named fields. */\n\t  break;  /* Stop at first nil. */\n\t}\n\t*ip = i + 1;\n      } else {\n      tryname:\n\ttv = (TValue *)lj_tab_getstr(t, gco2str(gcref(df->name)));\n\tif (!tv || tvisnil(tv)) continue;\n      }\n      if (ctype_isfield(df->info))\n\tlj_cconv_ct_tv(cts, ctype_rawchild(cts, df), dp+df->size, tv, flags);\n      else\n\tlj_cconv_bf_tv(cts, df, dp+df->size, tv);\n      if ((d->info & CTF_UNION)) break;\n    } else if (ctype_isxattrib(df->info, CTA_SUBTYPE)) {\n      cconv_substruct_tab(cts, ctype_rawchild(cts, df),\n\t\t\t  dp+df->size, t, ip, flags);\n    }  /* Ignore all other entries in the chain. */\n  }\n}\n\n/* Convert table to struct/union. */\nstatic void cconv_struct_tab(CTState *cts, CType *d,\n\t\t\t     uint8_t *dp, GCtab *t, CTInfo flags)\n{\n  int32_t i = 0;\n  memset(dp, 0, d->size);  /* Much simpler to clear the struct first. */\n  cconv_substruct_tab(cts, d, dp, t, &i, flags);\n}\n\n/* Convert TValue to C type. Caveat: expects to get the raw CType! */\nvoid lj_cconv_ct_tv(CTState *cts, CType *d,\n\t\t    uint8_t *dp, TValue *o, CTInfo flags)\n{\n  CTypeID sid = CTID_P_VOID;\n  CType *s;\n  void *tmpptr;\n  uint8_t tmpbool, *sp = (uint8_t *)&tmpptr;\n  if (LJ_LIKELY(tvisint(o))) {\n    sp = (uint8_t *)&o->i;\n    sid = CTID_INT32;\n    flags |= CCF_FROMTV;\n  } else if (LJ_LIKELY(tvisnum(o))) {\n    sp = (uint8_t *)&o->n;\n    sid = CTID_DOUBLE;\n    flags |= CCF_FROMTV;\n  } else if (tviscdata(o)) {\n    sp = cdataptr(cdataV(o));\n    sid = cdataV(o)->ctypeid;\n    s = ctype_get(cts, sid);\n    if (ctype_isref(s->info)) {  /* Resolve reference for value. */\n      lua_assert(s->size == CTSIZE_PTR);\n      sp = *(void **)sp;\n      sid = ctype_cid(s->info);\n    }\n    s = ctype_raw(cts, sid);\n    if (ctype_isfunc(s->info)) {\n      sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR);\n    } else {\n      if (ctype_isenum(s->info)) s = ctype_child(cts, s);\n      goto doconv;\n    }\n  } else if (tvisstr(o)) {\n    GCstr *str = strV(o);\n    if (ctype_isenum(d->info)) {  /* Match string against enum constant. */\n      CTSize ofs;\n      CType *cct = lj_ctype_getfield(cts, d, str, &ofs);\n      if (!cct || !ctype_isconstval(cct->info))\n\tgoto err_conv;\n      lua_assert(d->size == 4);\n      sp = (uint8_t *)&cct->size;\n      sid = ctype_cid(cct->info);\n    } else if (ctype_isrefarray(d->info)) {  /* Copy string to array. */\n      CType *dc = ctype_rawchild(cts, d);\n      CTSize sz = str->len+1;\n      if (!ctype_isinteger(dc->info) || dc->size != 1)\n\tgoto err_conv;\n      if (d->size != 0 && d->size < sz)\n\tsz = d->size;\n      memcpy(dp, strdata(str), sz);\n      return;\n    } else {  /* Otherwise pass it as a const char[]. */\n      sp = (uint8_t *)strdata(str);\n      sid = CTID_A_CCHAR;\n      flags |= CCF_FROMTV;\n    }\n  } else if (tvistab(o)) {\n    if (ctype_isarray(d->info)) {\n      cconv_array_tab(cts, d, dp, tabV(o), flags);\n      return;\n    } else if (ctype_isstruct(d->info)) {\n      cconv_struct_tab(cts, d, dp, tabV(o), flags);\n      return;\n    } else {\n      goto err_conv;\n    }\n  } else if (tvisbool(o)) {\n    tmpbool = boolV(o);\n    sp = &tmpbool;\n    sid = CTID_BOOL;\n  } else if (tvisnil(o)) {\n    tmpptr = (void *)0;\n    flags |= CCF_FROMTV;\n  } else if (tvisudata(o)) {\n    GCudata *ud = udataV(o);\n    tmpptr = uddata(ud);\n    if (ud->udtype == UDTYPE_IO_FILE)\n      tmpptr = *(void **)tmpptr;\n  } else if (tvislightud(o)) {\n    tmpptr = lightudV(o);\n  } else if (tvisfunc(o)) {\n    void *p = lj_ccallback_new(cts, d, funcV(o));\n    if (p) {\n      *(void **)dp = p;\n      return;\n    }\n    goto err_conv;\n  } else {\n  err_conv:\n    cconv_err_convtv(cts, d, o, flags);\n  }\n  s = ctype_get(cts, sid);\ndoconv:\n  if (ctype_isenum(d->info)) d = ctype_child(cts, d);\n  lj_cconv_ct_ct(cts, d, s, dp, sp, flags);\n}\n\n/* Convert TValue to bitfield. */\nvoid lj_cconv_bf_tv(CTState *cts, CType *d, uint8_t *dp, TValue *o)\n{\n  CTInfo info = d->info;\n  CTSize pos, bsz;\n  uint32_t val, mask;\n  lua_assert(ctype_isbitfield(info));\n  if ((info & CTF_BOOL)) {\n    uint8_t tmpbool;\n    lua_assert(ctype_bitbsz(info) == 1);\n    lj_cconv_ct_tv(cts, ctype_get(cts, CTID_BOOL), &tmpbool, o, 0);\n    val = tmpbool;\n  } else {\n    CTypeID did = (info & CTF_UNSIGNED) ? CTID_UINT32 : CTID_INT32;\n    lj_cconv_ct_tv(cts, ctype_get(cts, did), (uint8_t *)&val, o, 0);\n  }\n  pos = ctype_bitpos(info);\n  bsz = ctype_bitbsz(info);\n  lua_assert(pos < 8*ctype_bitcsz(info));\n  lua_assert(bsz > 0 && bsz <= 8*ctype_bitcsz(info));\n  /* Check if a packed bitfield crosses a container boundary. */\n  if (pos + bsz > 8*ctype_bitcsz(info))\n    lj_err_caller(cts->L, LJ_ERR_FFI_NYIPACKBIT);\n  mask = ((1u << bsz) - 1u) << pos;\n  val = (val << pos) & mask;\n  /* NYI: packed bitfields may cause misaligned reads/writes. */\n  switch (ctype_bitcsz(info)) {\n  case 4: *(uint32_t *)dp = (*(uint32_t *)dp & ~mask) | (uint32_t)val; break;\n  case 2: *(uint16_t *)dp = (*(uint16_t *)dp & ~mask) | (uint16_t)val; break;\n  case 1: *(uint8_t *)dp = (*(uint8_t *)dp & ~mask) | (uint8_t)val; break;\n  default: lua_assert(0); break;\n  }\n}\n\n/* -- Initialize C type with TValues -------------------------------------- */\n\n/* Initialize an array with TValues. */\nstatic void cconv_array_init(CTState *cts, CType *d, CTSize sz, uint8_t *dp,\n\t\t\t     TValue *o, MSize len)\n{\n  CType *dc = ctype_rawchild(cts, d);  /* Array element type. */\n  CTSize ofs, esize = dc->size;\n  MSize i;\n  if (len*esize > sz)\n    cconv_err_initov(cts, d);\n  for (i = 0, ofs = 0; i < len; i++, ofs += esize)\n    lj_cconv_ct_tv(cts, dc, dp + ofs, o + i, 0);\n  if (ofs == esize) {  /* Replicate a single element. */\n    for (; ofs < sz; ofs += esize) memcpy(dp + ofs, dp, esize);\n  } else {  /* Otherwise fill the remainder with zero. */\n    memset(dp + ofs, 0, sz - ofs);\n  }\n}\n\n/* Initialize a sub-struct/union with TValues. */\nstatic void cconv_substruct_init(CTState *cts, CType *d, uint8_t *dp,\n\t\t\t\t TValue *o, MSize len, MSize *ip)\n{\n  CTypeID id = d->sib;\n  while (id) {\n    CType *df = ctype_get(cts, id);\n    id = df->sib;\n    if (ctype_isfield(df->info) || ctype_isbitfield(df->info)) {\n      MSize i = *ip;\n      if (!gcref(df->name)) continue;  /* Ignore unnamed fields. */\n      if (i >= len) break;\n      *ip = i + 1;\n      if (ctype_isfield(df->info))\n\tlj_cconv_ct_tv(cts, ctype_rawchild(cts, df), dp+df->size, o + i, 0);\n      else\n\tlj_cconv_bf_tv(cts, df, dp+df->size, o + i);\n      if ((d->info & CTF_UNION)) break;\n    } else if (ctype_isxattrib(df->info, CTA_SUBTYPE)) {\n      cconv_substruct_init(cts, ctype_rawchild(cts, df),\n\t\t\t   dp+df->size, o, len, ip);\n    }  /* Ignore all other entries in the chain. */\n  }\n}\n\n/* Initialize a struct/union with TValues. */\nstatic void cconv_struct_init(CTState *cts, CType *d, CTSize sz, uint8_t *dp,\n\t\t\t      TValue *o, MSize len)\n{\n  MSize i = 0;\n  memset(dp, 0, sz);  /* Much simpler to clear the struct first. */\n  cconv_substruct_init(cts, d, dp, o, len, &i);\n  if (i < len)\n    cconv_err_initov(cts, d);\n}\n\n/* Check whether to use a multi-value initializer.\n** This is true if an aggregate is to be initialized with a value.\n** Valarrays are treated as values here so ct_tv handles (V|C, I|F).\n*/\nint lj_cconv_multi_init(CTState *cts, CType *d, TValue *o)\n{\n  if (!(ctype_isrefarray(d->info) || ctype_isstruct(d->info)))\n    return 0;  /* Destination is not an aggregate. */\n  if (tvistab(o) || (tvisstr(o) && !ctype_isstruct(d->info)))\n    return 0;  /* Initializer is not a value. */\n  if (tviscdata(o) && lj_ctype_rawref(cts, cdataV(o)->ctypeid) == d)\n    return 0;  /* Source and destination are identical aggregates. */\n  return 1;  /* Otherwise the initializer is a value. */\n}\n\n/* Initialize C type with TValues. Caveat: expects to get the raw CType! */\nvoid lj_cconv_ct_init(CTState *cts, CType *d, CTSize sz,\n\t\t      uint8_t *dp, TValue *o, MSize len)\n{\n  if (len == 0)\n    memset(dp, 0, sz);\n  else if (len == 1 && !lj_cconv_multi_init(cts, d, o))\n    lj_cconv_ct_tv(cts, d, dp, o, 0);\n  else if (ctype_isarray(d->info))  /* Also handles valarray init with len>1. */\n    cconv_array_init(cts, d, sz, dp, o, len);\n  else if (ctype_isstruct(d->info))\n    cconv_struct_init(cts, d, sz, dp, o, len);\n  else\n    cconv_err_initov(cts, d);\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_cconv.h",
    "content": "/*\n** C type conversions.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CCONV_H\n#define _LJ_CCONV_H\n\n#include \"lj_obj.h\"\n#include \"lj_ctype.h\"\n\n#if LJ_HASFFI\n\n/* Compressed C type index. ORDER CCX. */\nenum {\n  CCX_B,\t/* Bool. */\n  CCX_I,\t/* Integer. */\n  CCX_F,\t/* Floating-point number. */\n  CCX_C,\t/* Complex. */\n  CCX_V,\t/* Vector. */\n  CCX_P,\t/* Pointer. */\n  CCX_A,\t/* Refarray. */\n  CCX_S\t\t/* Struct/union. */\n};\n\n/* Convert C type info to compressed C type index. ORDER CT. ORDER CCX. */\nstatic LJ_AINLINE uint32_t cconv_idx(CTInfo info)\n{\n  uint32_t idx = ((info >> 26) & 15u);  /* Dispatch bits. */\n  lua_assert(ctype_type(info) <= CT_MAYCONVERT);\n#if LJ_64\n  idx = ((U64x(f436fff5,fff7f021) >> 4*idx) & 15u);\n#else\n  idx = (((idx < 8 ? 0xfff7f021u : 0xf436fff5) >> 4*(idx & 7u)) & 15u);\n#endif\n  lua_assert(idx < 8);\n  return idx;\n}\n\n#define cconv_idx2(dinfo, sinfo) \\\n  ((cconv_idx((dinfo)) << 3) + cconv_idx((sinfo)))\n\n#define CCX(dst, src)\t\t((CCX_##dst << 3) + CCX_##src)\n\n/* Conversion flags. */\n#define CCF_CAST\t0x00000001u\n#define CCF_FROMTV\t0x00000002u\n#define CCF_SAME\t0x00000004u\n#define CCF_IGNQUAL\t0x00000008u\n\n#define CCF_ARG_SHIFT\t8\n#define CCF_ARG(n)\t((n) << CCF_ARG_SHIFT)\n#define CCF_GETARG(f)\t((f) >> CCF_ARG_SHIFT)\n\nLJ_FUNC int lj_cconv_compatptr(CTState *cts, CType *d, CType *s, CTInfo flags);\nLJ_FUNC void lj_cconv_ct_ct(CTState *cts, CType *d, CType *s,\n\t\t\t    uint8_t *dp, uint8_t *sp, CTInfo flags);\nLJ_FUNC int lj_cconv_tv_ct(CTState *cts, CType *s, CTypeID sid,\n\t\t\t   TValue *o, uint8_t *sp);\nLJ_FUNC int lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp);\nLJ_FUNC void lj_cconv_ct_tv(CTState *cts, CType *d,\n\t\t\t    uint8_t *dp, TValue *o, CTInfo flags);\nLJ_FUNC void lj_cconv_bf_tv(CTState *cts, CType *d, uint8_t *dp, TValue *o);\nLJ_FUNC int lj_cconv_multi_init(CTState *cts, CType *d, TValue *o);\nLJ_FUNC void lj_cconv_ct_init(CTState *cts, CType *d, CTSize sz,\n\t\t\t      uint8_t *dp, TValue *o, MSize len);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_cdata.c",
    "content": "/*\n** C data management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cconv.h\"\n#include \"lj_cdata.h\"\n\n/* -- C data allocation --------------------------------------------------- */\n\n/* Allocate a new C data object holding a reference to another object. */\nGCcdata *lj_cdata_newref(CTState *cts, const void *p, CTypeID id)\n{\n  CTypeID refid = lj_ctype_intern(cts, CTINFO_REF(id), CTSIZE_PTR);\n  GCcdata *cd = lj_cdata_new(cts, refid, CTSIZE_PTR);\n  *(const void **)cdataptr(cd) = p;\n  return cd;\n}\n\n/* Allocate variable-sized or specially aligned C data object. */\nGCcdata *lj_cdata_newv(CTState *cts, CTypeID id, CTSize sz, CTSize align)\n{\n  global_State *g;\n  MSize extra = sizeof(GCcdataVar) + sizeof(GCcdata) +\n\t\t(align > CT_MEMALIGN ? (1u<<align) - (1u<<CT_MEMALIGN) : 0);\n  char *p = lj_mem_newt(cts->L, extra + sz, char);\n  uintptr_t adata = (uintptr_t)p + sizeof(GCcdataVar) + sizeof(GCcdata);\n  uintptr_t almask = (1u << align) - 1u;\n  GCcdata *cd = (GCcdata *)(((adata + almask) & ~almask) - sizeof(GCcdata));\n  lua_assert((char *)cd - p < 65536);\n  cdatav(cd)->offset = (uint16_t)((char *)cd - p);\n  cdatav(cd)->extra = extra;\n  cdatav(cd)->len = sz;\n  g = cts->g;\n  setgcrefr(cd->nextgc, g->gc.root);\n  setgcref(g->gc.root, obj2gco(cd));\n  newwhite(g, obj2gco(cd));\n  cd->marked |= 0x80;\n  cd->gct = ~LJ_TCDATA;\n  cd->ctypeid = id;\n  return cd;\n}\n\n/* Free a C data object. */\nvoid LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd)\n{\n  if (LJ_UNLIKELY(cd->marked & LJ_GC_CDATA_FIN)) {\n    GCobj *root;\n    makewhite(g, obj2gco(cd));\n    markfinalized(obj2gco(cd));\n    if ((root = gcref(g->gc.mmudata)) != NULL) {\n      setgcrefr(cd->nextgc, root->gch.nextgc);\n      setgcref(root->gch.nextgc, obj2gco(cd));\n      setgcref(g->gc.mmudata, obj2gco(cd));\n    } else {\n      setgcref(cd->nextgc, obj2gco(cd));\n      setgcref(g->gc.mmudata, obj2gco(cd));\n    }\n  } else if (LJ_LIKELY(!cdataisv(cd))) {\n    CType *ct = ctype_raw(ctype_ctsG(g), cd->ctypeid);\n    CTSize sz = ctype_hassize(ct->info) ? ct->size : CTSIZE_PTR;\n    lua_assert(ctype_hassize(ct->info) || ctype_isfunc(ct->info) ||\n\t       ctype_isextern(ct->info));\n    lj_mem_free(g, cd, sizeof(GCcdata) + sz);\n  } else {\n    lj_mem_free(g, memcdatav(cd), sizecdatav(cd));\n  }\n}\n\nTValue * LJ_FASTCALL lj_cdata_setfin(lua_State *L, GCcdata *cd)\n{\n  global_State *g = G(L);\n  GCtab *t = ctype_ctsG(g)->finalizer;\n  if (gcref(t->metatable)) {\n    /* Add cdata to finalizer table, if still enabled. */\n    TValue *tv, tmp;\n    setcdataV(L, &tmp, cd);\n    lj_gc_anybarriert(L, t);\n    tv = lj_tab_set(L, t, &tmp);\n    cd->marked |= LJ_GC_CDATA_FIN;\n    return tv;\n  } else {\n    /* Otherwise return dummy TValue. */\n    return &g->tmptv;\n  }\n}\n\n/* -- C data indexing ----------------------------------------------------- */\n\n/* Index C data by a TValue. Return CType and pointer. */\nCType *lj_cdata_index(CTState *cts, GCcdata *cd, cTValue *key, uint8_t **pp,\n\t\t      CTInfo *qual)\n{\n  uint8_t *p = (uint8_t *)cdataptr(cd);\n  CType *ct = ctype_get(cts, cd->ctypeid);\n  ptrdiff_t idx;\n\n  /* Resolve reference for cdata object. */\n  if (ctype_isref(ct->info)) {\n    lua_assert(ct->size == CTSIZE_PTR);\n    p = *(uint8_t **)p;\n    ct = ctype_child(cts, ct);\n  }\n\ncollect_attrib:\n  /* Skip attributes and collect qualifiers. */\n  while (ctype_isattrib(ct->info)) {\n    if (ctype_attrib(ct->info) == CTA_QUAL) *qual |= ct->size;\n    ct = ctype_child(cts, ct);\n  }\n  lua_assert(!ctype_isref(ct->info));  /* Interning rejects refs to refs. */\n\n  if (tvisint(key)) {\n    idx = (ptrdiff_t)intV(key);\n    goto integer_key;\n  } else if (tvisnum(key)) {  /* Numeric key. */\n    idx = LJ_64 ? (ptrdiff_t)numV(key) : (ptrdiff_t)lj_num2int(numV(key));\n  integer_key:\n    if (ctype_ispointer(ct->info)) {\n      CTSize sz = lj_ctype_size(cts, ctype_cid(ct->info));  /* Element size. */\n      if (sz != CTSIZE_INVALID) {\n\tif (ctype_isptr(ct->info)) {\n\t  p = (uint8_t *)cdata_getptr(p, ct->size);\n\t} else if ((ct->info & (CTF_VECTOR|CTF_COMPLEX))) {\n\t  if ((ct->info & CTF_COMPLEX)) idx &= 1;\n\t  *qual |= CTF_CONST;  /* Valarray elements are constant. */\n\t}\n\t*pp = p + idx*(int32_t)sz;\n\treturn ct;\n      }\n    }\n  } else if (tviscdata(key)) {  /* Integer cdata key. */\n    GCcdata *cdk = cdataV(key);\n    CType *ctk = ctype_raw(cts, cdk->ctypeid);\n    if (ctype_isenum(ctk->info)) ctk = ctype_child(cts, ctk);\n    if (ctype_isinteger(ctk->info)) {\n      lj_cconv_ct_ct(cts, ctype_get(cts, CTID_INT_PSZ), ctk,\n\t\t     (uint8_t *)&idx, cdataptr(cdk), 0);\n      goto integer_key;\n    }\n  } else if (tvisstr(key)) {  /* String key. */\n    GCstr *name = strV(key);\n    if (ctype_isstruct(ct->info)) {\n      CTSize ofs;\n      CType *fct = lj_ctype_getfieldq(cts, ct, name, &ofs, qual);\n      if (fct) {\n\t*pp = p + ofs;\n\treturn fct;\n      }\n    } else if (ctype_iscomplex(ct->info)) {\n      if (name->len == 2) {\n\t*qual |= CTF_CONST;  /* Complex fields are constant. */\n\tif (strdata(name)[0] == 'r' && strdata(name)[1] == 'e') {\n\t  *pp = p;\n\t  return ct;\n\t} else if (strdata(name)[0] == 'i' && strdata(name)[1] == 'm') {\n\t  *pp = p + (ct->size >> 1);\n\t  return ct;\n\t}\n      }\n    } else if (cd->ctypeid == CTID_CTYPEID) {\n      /* Allow indexing a (pointer to) struct constructor to get constants. */\n      CType *sct = ctype_raw(cts, *(CTypeID *)p);\n      if (ctype_isptr(sct->info))\n\tsct = ctype_rawchild(cts, sct);\n      if (ctype_isstruct(sct->info)) {\n\tCTSize ofs;\n\tCType *fct = lj_ctype_getfield(cts, sct, name, &ofs);\n\tif (fct && ctype_isconstval(fct->info))\n\t  return fct;\n      }\n      ct = sct;  /* Allow resolving metamethods for constructors, too. */\n    }\n  }\n  if (ctype_isptr(ct->info)) {  /* Automatically perform '->'. */\n    if (ctype_isstruct(ctype_rawchild(cts, ct)->info)) {\n      p = (uint8_t *)cdata_getptr(p, ct->size);\n      ct = ctype_child(cts, ct);\n      goto collect_attrib;\n    }\n  }\n  *qual |= 1;  /* Lookup failed. */\n  return ct;  /* But return the resolved raw type. */\n}\n\n/* -- C data getters ------------------------------------------------------ */\n\n/* Get constant value and convert to TValue. */\nstatic void cdata_getconst(CTState *cts, TValue *o, CType *ct)\n{\n  CType *ctt = ctype_child(cts, ct);\n  lua_assert(ctype_isinteger(ctt->info) && ctt->size <= 4);\n  /* Constants are already zero-extended/sign-extended to 32 bits. */\n  if ((ctt->info & CTF_UNSIGNED) && (int32_t)ct->size < 0)\n    setnumV(o, (lua_Number)(uint32_t)ct->size);\n  else\n    setintV(o, (int32_t)ct->size);\n}\n\n/* Get C data value and convert to TValue. */\nint lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp)\n{\n  CTypeID sid;\n\n  if (ctype_isconstval(s->info)) {\n    cdata_getconst(cts, o, s);\n    return 0;  /* No GC step needed. */\n  } else if (ctype_isbitfield(s->info)) {\n    return lj_cconv_tv_bf(cts, s, o, sp);\n  }\n\n  /* Get child type of pointer/array/field. */\n  lua_assert(ctype_ispointer(s->info) || ctype_isfield(s->info));\n  sid = ctype_cid(s->info);\n  s = ctype_get(cts, sid);\n\n  /* Resolve reference for field. */\n  if (ctype_isref(s->info)) {\n    lua_assert(s->size == CTSIZE_PTR);\n    sp = *(uint8_t **)sp;\n    sid = ctype_cid(s->info);\n    s = ctype_get(cts, sid);\n  }\n\n  /* Skip attributes. */\n  while (ctype_isattrib(s->info))\n    s = ctype_child(cts, s);\n\n  return lj_cconv_tv_ct(cts, s, sid, o, sp);\n}\n\n/* -- C data setters ------------------------------------------------------ */\n\n/* Convert TValue and set C data value. */\nvoid lj_cdata_set(CTState *cts, CType *d, uint8_t *dp, TValue *o, CTInfo qual)\n{\n  if (ctype_isconstval(d->info)) {\n    goto err_const;\n  } else if (ctype_isbitfield(d->info)) {\n    if (((d->info|qual) & CTF_CONST)) goto err_const;\n    lj_cconv_bf_tv(cts, d, dp, o);\n    return;\n  }\n\n  /* Get child type of pointer/array/field. */\n  lua_assert(ctype_ispointer(d->info) || ctype_isfield(d->info));\n  d = ctype_child(cts, d);\n\n  /* Resolve reference for field. */\n  if (ctype_isref(d->info)) {\n    lua_assert(d->size == CTSIZE_PTR);\n    dp = *(uint8_t **)dp;\n    d = ctype_child(cts, d);\n  }\n\n  /* Skip attributes and collect qualifiers. */\n  for (;;) {\n    if (ctype_isattrib(d->info)) {\n      if (ctype_attrib(d->info) == CTA_QUAL) qual |= d->size;\n    } else {\n      break;\n    }\n    d = ctype_child(cts, d);\n  }\n\n  lua_assert(ctype_hassize(d->info) && !ctype_isvoid(d->info));\n\n  if (((d->info|qual) & CTF_CONST)) {\n  err_const:\n    lj_err_caller(cts->L, LJ_ERR_FFI_WRCONST);\n  }\n\n  lj_cconv_ct_tv(cts, d, dp, o, 0);\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_cdata.h",
    "content": "/*\n** C data management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CDATA_H\n#define _LJ_CDATA_H\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_ctype.h\"\n\n#if LJ_HASFFI\n\n/* Get C data pointer. */\nstatic LJ_AINLINE void *cdata_getptr(void *p, CTSize sz)\n{\n  if (LJ_64 && sz == 4) {  /* Support 32 bit pointers on 64 bit targets. */\n    return ((void *)(uintptr_t)*(uint32_t *)p);\n  } else {\n    lua_assert(sz == CTSIZE_PTR);\n    return *(void **)p;\n  }\n}\n\n/* Set C data pointer. */\nstatic LJ_AINLINE void cdata_setptr(void *p, CTSize sz, const void *v)\n{\n  if (LJ_64 && sz == 4) {  /* Support 32 bit pointers on 64 bit targets. */\n    *(uint32_t *)p = (uint32_t)(uintptr_t)v;\n  } else {\n    lua_assert(sz == CTSIZE_PTR);\n    *(void **)p = (void *)v;\n  }\n}\n\n/* Allocate fixed-size C data object. */\nstatic LJ_AINLINE GCcdata *lj_cdata_new(CTState *cts, CTypeID id, CTSize sz)\n{\n  GCcdata *cd;\n#ifdef LUA_USE_ASSERT\n  CType *ct = ctype_raw(cts, id);\n  lua_assert((ctype_hassize(ct->info) ? ct->size : CTSIZE_PTR) == sz);\n#endif\n  cd = (GCcdata *)lj_mem_newgco(cts->L, sizeof(GCcdata) + sz);\n  cd->gct = ~LJ_TCDATA;\n  cd->ctypeid = ctype_check(cts, id);\n  return cd;\n}\n\n/* Variant which works without a valid CTState. */\nstatic LJ_AINLINE GCcdata *lj_cdata_new_(lua_State *L, CTypeID id, CTSize sz)\n{\n  GCcdata *cd = (GCcdata *)lj_mem_newgco(L, sizeof(GCcdata) + sz);\n  cd->gct = ~LJ_TCDATA;\n  cd->ctypeid = id;\n  return cd;\n}\n\nLJ_FUNC GCcdata *lj_cdata_newref(CTState *cts, const void *pp, CTypeID id);\nLJ_FUNC GCcdata *lj_cdata_newv(CTState *cts, CTypeID id, CTSize sz,\n\t\t\t       CTSize align);\n\nLJ_FUNC void LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd);\nLJ_FUNCA TValue * LJ_FASTCALL lj_cdata_setfin(lua_State *L, GCcdata *cd);\n\nLJ_FUNC CType *lj_cdata_index(CTState *cts, GCcdata *cd, cTValue *key,\n\t\t\t      uint8_t **pp, CTInfo *qual);\nLJ_FUNC int lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp);\nLJ_FUNC void lj_cdata_set(CTState *cts, CType *d, uint8_t *dp, TValue *o,\n\t\t\t  CTInfo qual);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_char.c",
    "content": "/*\n** Character types.\n** Donated to the public domain.\n**\n** This is intended to replace the problematic libc single-byte NLS functions.\n** These just don't make sense anymore with UTF-8 locales becoming the norm\n** on POSIX systems. It never worked too well on Windows systems since hardly\n** anyone bothered to call setlocale().\n**\n** This table is hardcoded for ASCII. Identifiers include the characters\n** 128-255, too. This allows for the use of all non-ASCII chars as identifiers\n** in the lexer. This is a broad definition, but works well in practice\n** for both UTF-8 locales and most single-byte locales (such as ISO-8859-*).\n**\n** If you really need proper character types for UTF-8 strings, please use\n** an add-on library such as slnunicode: http://luaforge.net/projects/sln/\n*/\n\n#define lj_char_c\n#define LUA_CORE\n\n#include \"lj_char.h\"\n\nLJ_DATADEF const uint8_t lj_char_bits[257] = {\n    0,\n    1,  1,  1,  1,  1,  1,  1,  1,  1,  3,  3,  3,  3,  3,  1,  1,\n    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,\n    2,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,  4,\n  152,152,152,152,152,152,152,152,152,152,  4,  4,  4,  4,  4,  4,\n    4,176,176,176,176,176,176,160,160,160,160,160,160,160,160,160,\n  160,160,160,160,160,160,160,160,160,160,160,  4,  4,  4,  4,132,\n    4,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192,\n  192,192,192,192,192,192,192,192,192,192,192,  4,  4,  4,  4,  1,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,\n  128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128\n};\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_char.h",
    "content": "/*\n** Character types.\n** Donated to the public domain.\n*/\n\n#ifndef _LJ_CHAR_H\n#define _LJ_CHAR_H\n\n#include \"lj_def.h\"\n\n#define LJ_CHAR_CNTRL\t0x01\n#define LJ_CHAR_SPACE\t0x02\n#define LJ_CHAR_PUNCT\t0x04\n#define LJ_CHAR_DIGIT\t0x08\n#define LJ_CHAR_XDIGIT\t0x10\n#define LJ_CHAR_UPPER\t0x20\n#define LJ_CHAR_LOWER\t0x40\n#define LJ_CHAR_IDENT\t0x80\n#define LJ_CHAR_ALPHA\t(LJ_CHAR_LOWER|LJ_CHAR_UPPER)\n#define LJ_CHAR_ALNUM\t(LJ_CHAR_ALPHA|LJ_CHAR_DIGIT)\n#define LJ_CHAR_GRAPH\t(LJ_CHAR_ALNUM|LJ_CHAR_PUNCT)\n\n/* Only pass -1 or 0..255 to these macros. Never pass a signed char! */\n#define lj_char_isa(c, t)\t((lj_char_bits+1)[(c)] & t)\n#define lj_char_iscntrl(c)\tlj_char_isa((c), LJ_CHAR_CNTRL)\n#define lj_char_isspace(c)\tlj_char_isa((c), LJ_CHAR_SPACE)\n#define lj_char_ispunct(c)\tlj_char_isa((c), LJ_CHAR_PUNCT)\n#define lj_char_isdigit(c)\tlj_char_isa((c), LJ_CHAR_DIGIT)\n#define lj_char_isxdigit(c)\tlj_char_isa((c), LJ_CHAR_XDIGIT)\n#define lj_char_isupper(c)\tlj_char_isa((c), LJ_CHAR_UPPER)\n#define lj_char_islower(c)\tlj_char_isa((c), LJ_CHAR_LOWER)\n#define lj_char_isident(c)\tlj_char_isa((c), LJ_CHAR_IDENT)\n#define lj_char_isalpha(c)\tlj_char_isa((c), LJ_CHAR_ALPHA)\n#define lj_char_isalnum(c)\tlj_char_isa((c), LJ_CHAR_ALNUM)\n#define lj_char_isgraph(c)\tlj_char_isa((c), LJ_CHAR_GRAPH)\n\n#define lj_char_toupper(c)\t((c) - (lj_char_islower(c) >> 1))\n#define lj_char_tolower(c)\t((c) + lj_char_isupper(c))\n\nLJ_DATA const uint8_t lj_char_bits[257];\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_clib.c",
    "content": "/*\n** FFI C library loader.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_tab.h\"\n#include \"lj_str.h\"\n#include \"lj_udata.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cconv.h\"\n#include \"lj_cdata.h\"\n#include \"lj_clib.h\"\n\n/* -- OS-specific functions ----------------------------------------------- */\n\n#if LJ_TARGET_DLOPEN\n\n#include <dlfcn.h>\n#include <stdio.h>\n\n#if defined(RTLD_DEFAULT)\n#define CLIB_DEFHANDLE\tRTLD_DEFAULT\n#elif LJ_TARGET_OSX || LJ_TARGET_BSD\n#define CLIB_DEFHANDLE\t((void *)(intptr_t)-2)\n#else\n#define CLIB_DEFHANDLE\tNULL\n#endif\n\nLJ_NORET LJ_NOINLINE static void clib_error_(lua_State *L)\n{\n  lj_err_callermsg(L, dlerror());\n}\n\n#define clib_error(L, fmt, name)\tclib_error_(L)\n\n#if defined(__CYGWIN__)\n#define CLIB_SOPREFIX\t\"cyg\"\n#else\n#define CLIB_SOPREFIX\t\"lib\"\n#endif\n\n#if LJ_TARGET_OSX\n#define CLIB_SOEXT\t\"%s.dylib\"\n#elif defined(__CYGWIN__)\n#define CLIB_SOEXT\t\"%s.dll\"\n#else\n#define CLIB_SOEXT\t\"%s.so\"\n#endif\n\nstatic const char *clib_extname(lua_State *L, const char *name)\n{\n  if (!strchr(name, '/')\n#ifdef __CYGWIN__\n      && !strchr(name, '\\\\')\n#endif\n     ) {\n    if (!strchr(name, '.')) {\n      name = lj_str_pushf(L, CLIB_SOEXT, name);\n      L->top--;\n#ifdef __CYGWIN__\n    } else {\n      return name;\n#endif\n    }\n    if (!(name[0] == CLIB_SOPREFIX[0] && name[1] == CLIB_SOPREFIX[1] &&\n\t  name[2] == CLIB_SOPREFIX[2])) {\n      name = lj_str_pushf(L, CLIB_SOPREFIX \"%s\", name);\n      L->top--;\n    }\n  }\n  return name;\n}\n\n/* Check for a recognized ld script line. */\nstatic const char *clib_check_lds(lua_State *L, const char *buf)\n{\n  char *p, *e;\n  if ((!strncmp(buf, \"GROUP\", 5) || !strncmp(buf, \"INPUT\", 5)) &&\n      (p = strchr(buf, '('))) {\n    while (*++p == ' ') ;\n    for (e = p; *e && *e != ' ' && *e != ')'; e++) ;\n    return strdata(lj_str_new(L, p, e-p));\n  }\n  return NULL;\n}\n\n/* Quick and dirty solution to resolve shared library name from ld script. */\nstatic const char *clib_resolve_lds(lua_State *L, const char *name)\n{\n  FILE *fp = fopen(name, \"r\");\n  const char *p = NULL;\n  if (fp) {\n    char buf[256];\n    if (fgets(buf, sizeof(buf), fp)) {\n      if (!strncmp(buf, \"/* GNU ld script\", 16)) {  /* ld script magic? */\n\twhile (fgets(buf, sizeof(buf), fp)) {  /* Check all lines. */\n\t  p = clib_check_lds(L, buf);\n\t  if (p) break;\n\t}\n      } else {  /* Otherwise check only the first line. */\n\tp = clib_check_lds(L, buf);\n      }\n    }\n    fclose(fp);\n  }\n  return p;\n}\n\nstatic void *clib_loadlib(lua_State *L, const char *name, int global)\n{\n  void *h = dlopen(clib_extname(L, name),\n\t\t   RTLD_LAZY | (global?RTLD_GLOBAL:RTLD_LOCAL));\n  if (!h) {\n    const char *e, *err = dlerror();\n    if (*err == '/' && (e = strchr(err, ':')) &&\n\t(name = clib_resolve_lds(L, strdata(lj_str_new(L, err, e-err))))) {\n      h = dlopen(name, RTLD_LAZY | (global?RTLD_GLOBAL:RTLD_LOCAL));\n      if (h) return h;\n      err = dlerror();\n    }\n    lj_err_callermsg(L, err);\n  }\n  return h;\n}\n\nstatic void clib_unloadlib(CLibrary *cl)\n{\n  if (cl->handle && cl->handle != CLIB_DEFHANDLE)\n    dlclose(cl->handle);\n}\n\nstatic void *clib_getsym(CLibrary *cl, const char *name)\n{\n  void *p = dlsym(cl->handle, name);\n  return p;\n}\n\n#elif LJ_TARGET_WINDOWS\n\n#define WIN32_LEAN_AND_MEAN\n#ifndef WINVER\n#define WINVER 0x0500\n#endif\n#include <windows.h>\n\n#ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS\n#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS\t4\n#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT\t2\nBOOL WINAPI GetModuleHandleExA(DWORD, LPCSTR, HMODULE*);\n#endif\n\n#define CLIB_DEFHANDLE\t((void *)-1)\n\n/* Default libraries. */\nenum {\n  CLIB_HANDLE_EXE,\n  CLIB_HANDLE_DLL,\n  CLIB_HANDLE_CRT,\n  CLIB_HANDLE_KERNEL32,\n  CLIB_HANDLE_USER32,\n  CLIB_HANDLE_GDI32,\n  CLIB_HANDLE_MAX\n};\n\nstatic void *clib_def_handle[CLIB_HANDLE_MAX];\n\nLJ_NORET LJ_NOINLINE static void clib_error(lua_State *L, const char *fmt,\n\t\t\t\t\t    const char *name)\n{\n  DWORD err = GetLastError();\n  char buf[128];\n  if (!FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS|FORMAT_MESSAGE_FROM_SYSTEM,\n\t\t      NULL, err, 0, buf, sizeof(buf), NULL))\n    buf[0] = '\\0';\n  lj_err_callermsg(L, lj_str_pushf(L, fmt, name, buf));\n}\n\nstatic int clib_needext(const char *s)\n{\n  while (*s) {\n    if (*s == '/' || *s == '\\\\' || *s == '.') return 0;\n    s++;\n  }\n  return 1;\n}\n\nstatic const char *clib_extname(lua_State *L, const char *name)\n{\n  if (clib_needext(name)) {\n    name = lj_str_pushf(L, \"%s.dll\", name);\n    L->top--;\n  }\n  return name;\n}\n\nstatic void *clib_loadlib(lua_State *L, const char *name, int global)\n{\n  DWORD oldwerr = GetLastError();\n  void *h = (void *)LoadLibraryA(clib_extname(L, name));\n  if (!h) clib_error(L, \"cannot load module \" LUA_QS \": %s\", name);\n  SetLastError(oldwerr);\n  UNUSED(global);\n  return h;\n}\n\nstatic void clib_unloadlib(CLibrary *cl)\n{\n  if (cl->handle == CLIB_DEFHANDLE) {\n    MSize i;\n    for (i = CLIB_HANDLE_KERNEL32; i < CLIB_HANDLE_MAX; i++) {\n      void *h = clib_def_handle[i];\n      if (h) {\n\tclib_def_handle[i] = NULL;\n\tFreeLibrary((HINSTANCE)h);\n      }\n    }\n  } else if (!cl->handle) {\n    FreeLibrary((HINSTANCE)cl->handle);\n  }\n}\n\nstatic void *clib_getsym(CLibrary *cl, const char *name)\n{\n  void *p = NULL;\n  if (cl->handle == CLIB_DEFHANDLE) {  /* Search default libraries. */\n    MSize i;\n    for (i = 0; i < CLIB_HANDLE_MAX; i++) {\n      HINSTANCE h = (HINSTANCE)clib_def_handle[i];\n      if (!(void *)h) {  /* Resolve default library handles (once). */\n\tswitch (i) {\n\tcase CLIB_HANDLE_EXE: GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, NULL, &h); break;\n\tcase CLIB_HANDLE_DLL:\n\t  GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,\n\t\t\t     (const char *)clib_def_handle, &h);\n\t  break;\n\tcase CLIB_HANDLE_CRT:\n\t  GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,\n\t\t\t     (const char *)&_fmode, &h);\n\t  break;\n\tcase CLIB_HANDLE_KERNEL32: h = LoadLibraryA(\"kernel32.dll\"); break;\n\tcase CLIB_HANDLE_USER32: h = LoadLibraryA(\"user32.dll\"); break;\n\tcase CLIB_HANDLE_GDI32: h = LoadLibraryA(\"gdi32.dll\"); break;\n\t}\n\tif (!h) continue;\n\tclib_def_handle[i] = (void *)h;\n      }\n      p = (void *)GetProcAddress(h, name);\n      if (p) break;\n    }\n  } else {\n    p = (void *)GetProcAddress((HINSTANCE)cl->handle, name);\n  }\n  return p;\n}\n\n#else\n\n#define CLIB_DEFHANDLE\tNULL\n\nLJ_NORET LJ_NOINLINE static void clib_error(lua_State *L, const char *fmt,\n\t\t\t\t\t    const char *name)\n{\n  lj_err_callermsg(L, lj_str_pushf(L, fmt, name, \"no support for this OS\"));\n}\n\nstatic void *clib_loadlib(lua_State *L, const char *name, int global)\n{\n  lj_err_callermsg(L, \"no support for loading dynamic libraries for this OS\");\n  UNUSED(name); UNUSED(global);\n  return NULL;\n}\n\nstatic void clib_unloadlib(CLibrary *cl)\n{\n  UNUSED(cl);\n}\n\nstatic void *clib_getsym(CLibrary *cl, const char *name)\n{\n  UNUSED(cl); UNUSED(name);\n  return NULL;\n}\n\n#endif\n\n/* -- C library indexing -------------------------------------------------- */\n\n#if LJ_TARGET_X86 && LJ_ABI_WIN\n/* Compute argument size for fastcall/stdcall functions. */\nstatic CTSize clib_func_argsize(CTState *cts, CType *ct)\n{\n  CTSize n = 0;\n  while (ct->sib) {\n    CType *d;\n    ct = ctype_get(cts, ct->sib);\n    if (ctype_isfield(ct->info)) {\n      d = ctype_rawchild(cts, ct);\n      n += ((d->size + 3) & ~3);\n    }\n  }\n  return n;\n}\n#endif\n\n/* Get redirected or mangled external symbol. */\nstatic const char *clib_extsym(CTState *cts, CType *ct, GCstr *name)\n{\n  if (ct->sib) {\n    CType *ctf = ctype_get(cts, ct->sib);\n    if (ctype_isxattrib(ctf->info, CTA_REDIR))\n      return strdata(gco2str(gcref(ctf->name)));\n  }\n  return strdata(name);\n}\n\n/* Index a C library by name. */\nTValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name)\n{\n  TValue *tv = lj_tab_setstr(L, cl->cache, name);\n  if (LJ_UNLIKELY(tvisnil(tv))) {\n    CTState *cts = ctype_cts(L);\n    CType *ct;\n    CTypeID id = lj_ctype_getname(cts, &ct, name, CLNS_INDEX);\n    if (!id)\n      lj_err_callerv(L, LJ_ERR_FFI_NODECL, strdata(name));\n    if (ctype_isconstval(ct->info)) {\n      CType *ctt = ctype_child(cts, ct);\n      lua_assert(ctype_isinteger(ctt->info) && ctt->size <= 4);\n      if ((ctt->info & CTF_UNSIGNED) && (int32_t)ct->size < 0)\n\tsetnumV(tv, (lua_Number)(uint32_t)ct->size);\n      else\n\tsetintV(tv, (int32_t)ct->size);\n    } else {\n      const char *sym = clib_extsym(cts, ct, name);\n#if LJ_TARGET_WINDOWS\n      DWORD oldwerr = GetLastError();\n#endif\n      void *p = clib_getsym(cl, sym);\n      GCcdata *cd;\n      lua_assert(ctype_isfunc(ct->info) || ctype_isextern(ct->info));\n#if LJ_TARGET_X86 && LJ_ABI_WIN\n      /* Retry with decorated name for fastcall/stdcall functions. */\n      if (!p && ctype_isfunc(ct->info)) {\n\tCTInfo cconv = ctype_cconv(ct->info);\n\tif (cconv == CTCC_FASTCALL || cconv == CTCC_STDCALL) {\n\t  CTSize sz = clib_func_argsize(cts, ct);\n\t  const char *symd = lj_str_pushf(L,\n\t\t\t       cconv == CTCC_FASTCALL ? \"@%s@%d\" : \"_%s@%d\",\n\t\t\t       sym, sz);\n\t  L->top--;\n\t  p = clib_getsym(cl, symd);\n\t}\n      }\n#endif\n      if (!p)\n\tclib_error(L, \"cannot resolve symbol \" LUA_QS \": %s\", sym);\n#if LJ_TARGET_WINDOWS\n      SetLastError(oldwerr);\n#endif\n      cd = lj_cdata_new(cts, id, CTSIZE_PTR);\n      *(void **)cdataptr(cd) = p;\n      setcdataV(L, tv, cd);\n    }\n  }\n  return tv;\n}\n\n/* -- C library management ------------------------------------------------ */\n\n/* Create a new CLibrary object and push it on the stack. */\nstatic CLibrary *clib_new(lua_State *L, GCtab *mt)\n{\n  GCtab *t = lj_tab_new(L, 0, 0);\n  GCudata *ud = lj_udata_new(L, sizeof(CLibrary), t);\n  CLibrary *cl = (CLibrary *)uddata(ud);\n  cl->cache = t;\n  ud->udtype = UDTYPE_FFI_CLIB;\n  /* NOBARRIER: The GCudata is new (marked white). */\n  setgcref(ud->metatable, obj2gco(mt));\n  setudataV(L, L->top++, ud);\n  return cl;\n}\n\n/* Load a C library. */\nvoid lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global)\n{\n  void *handle = clib_loadlib(L, strdata(name), global);\n  CLibrary *cl = clib_new(L, mt);\n  cl->handle = handle;\n}\n\n/* Unload a C library. */\nvoid lj_clib_unload(CLibrary *cl)\n{\n  clib_unloadlib(cl);\n  cl->handle = NULL;\n}\n\n/* Create the default C library object. */\nvoid lj_clib_default(lua_State *L, GCtab *mt)\n{\n  CLibrary *cl = clib_new(L, mt);\n  cl->handle = CLIB_DEFHANDLE;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_clib.h",
    "content": "/*\n** FFI C library loader.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CLIB_H\n#define _LJ_CLIB_H\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n/* Namespace for C library indexing. */\n#define CLNS_INDEX\t((1u<<CT_FUNC)|(1u<<CT_EXTERN)|(1u<<CT_CONSTVAL))\n\n/* C library namespace. */\ntypedef struct CLibrary {\n  void *handle;\t\t/* Opaque handle for dynamic library loader. */\n  GCtab *cache;\t\t/* Cache for resolved symbols. Anchored in ud->env. */\n} CLibrary;\n\nLJ_FUNC TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name);\nLJ_FUNC void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global);\nLJ_FUNC void lj_clib_unload(CLibrary *cl);\nLJ_FUNC void lj_clib_default(lua_State *L, GCtab *mt);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_cparse.c",
    "content": "/*\n** C declaration parser.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cparse.h\"\n#include \"lj_frame.h\"\n#include \"lj_vm.h\"\n#include \"lj_char.h\"\n#include \"lj_strscan.h\"\n\n/*\n** Important note: this is NOT a validating C parser! This is a minimal\n** C declaration parser, solely for use by the LuaJIT FFI.\n**\n** It ought to return correct results for properly formed C declarations,\n** but it may accept some invalid declarations, too (and return nonsense).\n** Also, it shows rather generic error messages to avoid unnecessary bloat.\n** If in doubt, please check the input against your favorite C compiler.\n*/\n\n/* -- C lexer ------------------------------------------------------------- */\n\n/* C lexer token names. */\nstatic const char *const ctoknames[] = {\n#define CTOKSTR(name, str)\tstr,\nCTOKDEF(CTOKSTR)\n#undef CTOKSTR\n  NULL\n};\n\n/* Forward declaration. */\nLJ_NORET static void cp_err(CPState *cp, ErrMsg em);\n\nstatic const char *cp_tok2str(CPState *cp, CPToken tok)\n{\n  lua_assert(tok < CTOK_FIRSTDECL);\n  if (tok > CTOK_OFS)\n    return ctoknames[tok-CTOK_OFS-1];\n  else if (!lj_char_iscntrl(tok))\n    return lj_str_pushf(cp->L, \"%c\", tok);\n  else\n    return lj_str_pushf(cp->L, \"char(%d)\", tok);\n}\n\n/* End-of-line? */\nstatic LJ_AINLINE int cp_iseol(CPChar c)\n{\n  return (c == '\\n' || c == '\\r');\n}\n\nstatic LJ_AINLINE CPChar cp_get(CPState *cp);\n\n/* Peek next raw character. */\nstatic LJ_AINLINE CPChar cp_rawpeek(CPState *cp)\n{\n  return (CPChar)(uint8_t)(*cp->p);\n}\n\n/* Transparently skip backslash-escaped line breaks. */\nstatic LJ_NOINLINE CPChar cp_get_bs(CPState *cp)\n{\n  CPChar c2, c = cp_rawpeek(cp);\n  if (!cp_iseol(c)) return cp->c;\n  cp->p++;\n  c2 = cp_rawpeek(cp);\n  if (cp_iseol(c2) && c2 != c) cp->p++;\n  cp->linenumber++;\n  return cp_get(cp);\n}\n\n/* Get next character. */\nstatic LJ_AINLINE CPChar cp_get(CPState *cp)\n{\n  cp->c = (CPChar)(uint8_t)(*cp->p++);\n  if (LJ_LIKELY(cp->c != '\\\\')) return cp->c;\n  return cp_get_bs(cp);\n}\n\n/* Grow save buffer. */\nstatic LJ_NOINLINE void cp_save_grow(CPState *cp, CPChar c)\n{\n  MSize newsize;\n  if (cp->sb.sz >= CPARSE_MAX_BUF/2)\n    cp_err(cp, LJ_ERR_XELEM);\n  newsize = cp->sb.sz * 2;\n  lj_str_resizebuf(cp->L, &cp->sb, newsize);\n  cp->sb.buf[cp->sb.n++] = (char)c;\n}\n\n/* Save character in buffer. */\nstatic LJ_AINLINE void cp_save(CPState *cp, CPChar c)\n{\n  if (LJ_UNLIKELY(cp->sb.n + 1 > cp->sb.sz))\n    cp_save_grow(cp, c);\n  else\n    cp->sb.buf[cp->sb.n++] = (char)c;\n}\n\n/* Skip line break. Handles \"\\n\", \"\\r\", \"\\r\\n\" or \"\\n\\r\". */\nstatic void cp_newline(CPState *cp)\n{\n  CPChar c = cp_rawpeek(cp);\n  if (cp_iseol(c) && c != cp->c) cp->p++;\n  cp->linenumber++;\n}\n\nLJ_NORET static void cp_errmsg(CPState *cp, CPToken tok, ErrMsg em, ...)\n{\n  const char *msg, *tokstr;\n  lua_State *L;\n  va_list argp;\n  if (tok == 0) {\n    tokstr = NULL;\n  } else if (tok == CTOK_IDENT || tok == CTOK_INTEGER || tok == CTOK_STRING ||\n\t     tok >= CTOK_FIRSTDECL) {\n    if (cp->sb.n == 0) cp_save(cp, '$');\n    cp_save(cp, '\\0');\n    tokstr = cp->sb.buf;\n  } else {\n    tokstr = cp_tok2str(cp, tok);\n  }\n  L = cp->L;\n  va_start(argp, em);\n  msg = lj_str_pushvf(L, err2msg(em), argp);\n  va_end(argp);\n  if (tokstr)\n    msg = lj_str_pushf(L, err2msg(LJ_ERR_XNEAR), msg, tokstr);\n  if (cp->linenumber > 1)\n    msg = lj_str_pushf(L, \"%s at line %d\", msg, cp->linenumber);\n  lj_err_callermsg(L, msg);\n}\n\nLJ_NORET LJ_NOINLINE static void cp_err_token(CPState *cp, CPToken tok)\n{\n  cp_errmsg(cp, cp->tok, LJ_ERR_XTOKEN, cp_tok2str(cp, tok));\n}\n\nLJ_NORET LJ_NOINLINE static void cp_err_badidx(CPState *cp, CType *ct)\n{\n  GCstr *s = lj_ctype_repr(cp->cts->L, ctype_typeid(cp->cts, ct), NULL);\n  cp_errmsg(cp, 0, LJ_ERR_FFI_BADIDX, strdata(s));\n}\n\nLJ_NORET LJ_NOINLINE static void cp_err(CPState *cp, ErrMsg em)\n{\n  cp_errmsg(cp, 0, em);\n}\n\n/* -- Main lexical scanner ------------------------------------------------ */\n\n/* Parse number literal. Only handles int32_t/uint32_t right now. */\nstatic CPToken cp_number(CPState *cp)\n{\n  StrScanFmt fmt;\n  TValue o;\n  do { cp_save(cp, cp->c); } while (lj_char_isident(cp_get(cp)));\n  cp_save(cp, '\\0');\n  fmt = lj_strscan_scan((const uint8_t *)cp->sb.buf, &o, STRSCAN_OPT_C);\n  if (fmt == STRSCAN_INT) cp->val.id = CTID_INT32;\n  else if (fmt == STRSCAN_U32) cp->val.id = CTID_UINT32;\n  else if (!(cp->mode & CPARSE_MODE_SKIP))\n    cp_errmsg(cp, CTOK_INTEGER, LJ_ERR_XNUMBER);\n  cp->val.u32 = (uint32_t)o.i;\n  return CTOK_INTEGER;\n}\n\n/* Parse identifier or keyword. */\nstatic CPToken cp_ident(CPState *cp)\n{\n  do { cp_save(cp, cp->c); } while (lj_char_isident(cp_get(cp)));\n  cp->str = lj_str_new(cp->L, cp->sb.buf, cp->sb.n);\n  cp->val.id = lj_ctype_getname(cp->cts, &cp->ct, cp->str, cp->tmask);\n  if (ctype_type(cp->ct->info) == CT_KW)\n    return ctype_cid(cp->ct->info);\n  return CTOK_IDENT;\n}\n\n/* Parse parameter. */\nstatic CPToken cp_param(CPState *cp)\n{\n  CPChar c = cp_get(cp);\n  TValue *o = cp->param;\n  if (lj_char_isident(c) || c == '$')  /* Reserve $xyz for future extensions. */\n    cp_errmsg(cp, c, LJ_ERR_XSYNTAX);\n  if (!o || o >= cp->L->top)\n    cp_err(cp, LJ_ERR_FFI_NUMPARAM);\n  cp->param = o+1;\n  if (tvisstr(o)) {\n    cp->str = strV(o);\n    cp->val.id = 0;\n    cp->ct = &cp->cts->tab[0];\n    return CTOK_IDENT;\n  } else if (tvisnumber(o)) {\n    cp->val.i32 = numberVint(o);\n    cp->val.id = CTID_INT32;\n    return CTOK_INTEGER;\n  } else {\n    GCcdata *cd;\n    if (!tviscdata(o))\n      lj_err_argtype(cp->L, (int)(o-cp->L->base)+1, \"type parameter\");\n    cd = cdataV(o);\n    if (cd->ctypeid == CTID_CTYPEID)\n      cp->val.id = *(CTypeID *)cdataptr(cd);\n    else\n      cp->val.id = cd->ctypeid;\n    return '$';\n  }\n}\n\n/* Parse string or character constant. */\nstatic CPToken cp_string(CPState *cp)\n{\n  CPChar delim = cp->c;\n  cp_get(cp);\n  while (cp->c != delim) {\n    CPChar c = cp->c;\n    if (c == '\\0') cp_errmsg(cp, CTOK_EOF, LJ_ERR_XSTR);\n    if (c == '\\\\') {\n      c = cp_get(cp);\n      switch (c) {\n      case '\\0': cp_errmsg(cp, CTOK_EOF, LJ_ERR_XSTR); break;\n      case 'a': c = '\\a'; break;\n      case 'b': c = '\\b'; break;\n      case 'f': c = '\\f'; break;\n      case 'n': c = '\\n'; break;\n      case 'r': c = '\\r'; break;\n      case 't': c = '\\t'; break;\n      case 'v': c = '\\v'; break;\n      case 'e': c = 27; break;\n      case 'x':\n\tc = 0;\n\twhile (lj_char_isxdigit(cp_get(cp)))\n\t  c = (c<<4) + (lj_char_isdigit(cp->c) ? cp->c-'0' : (cp->c&15)+9);\n\tcp_save(cp, (c & 0xff));\n\tcontinue;\n      default:\n\tif (lj_char_isdigit(c)) {\n\t  c -= '0';\n\t  if (lj_char_isdigit(cp_get(cp))) {\n\t    c = c*8 + (cp->c - '0');\n\t    if (lj_char_isdigit(cp_get(cp))) {\n\t      c = c*8 + (cp->c - '0');\n\t      cp_get(cp);\n\t    }\n\t  }\n\t  cp_save(cp, (c & 0xff));\n\t  continue;\n\t}\n\tbreak;\n      }\n    }\n    cp_save(cp, c);\n    cp_get(cp);\n  }\n  cp_get(cp);\n  if (delim == '\"') {\n    cp->str = lj_str_new(cp->L, cp->sb.buf, cp->sb.n);\n    return CTOK_STRING;\n  } else {\n    if (cp->sb.n != 1) cp_err_token(cp, '\\'');\n    cp->val.i32 = (int32_t)(char)cp->sb.buf[0];\n    cp->val.id = CTID_INT32;\n    return CTOK_INTEGER;\n  }\n}\n\n/* Skip C comment. */\nstatic void cp_comment_c(CPState *cp)\n{\n  do {\n    if (cp_get(cp) == '*') {\n      do {\n\tif (cp_get(cp) == '/') { cp_get(cp); return; }\n      } while (cp->c == '*');\n    }\n    if (cp_iseol(cp->c)) cp_newline(cp);\n  } while (cp->c != '\\0');\n}\n\n/* Skip C++ comment. */\nstatic void cp_comment_cpp(CPState *cp)\n{\n  while (!cp_iseol(cp_get(cp)) && cp->c != '\\0')\n    ;\n}\n\n/* Lexical scanner for C. Only a minimal subset is implemented. */\nstatic CPToken cp_next_(CPState *cp)\n{\n  lj_str_resetbuf(&cp->sb);\n  for (;;) {\n    if (lj_char_isident(cp->c))\n      return lj_char_isdigit(cp->c) ? cp_number(cp) : cp_ident(cp);\n    switch (cp->c) {\n    case '\\n': case '\\r': cp_newline(cp);  /* fallthrough. */\n    case ' ': case '\\t': case '\\v': case '\\f': cp_get(cp); break;\n    case '\"': case '\\'': return cp_string(cp);\n    case '/':\n      if (cp_get(cp) == '*') cp_comment_c(cp);\n      else if (cp->c == '/') cp_comment_cpp(cp);\n      else return '/';\n      break;\n    case '|':\n      if (cp_get(cp) != '|') return '|'; cp_get(cp); return CTOK_OROR;\n    case '&':\n      if (cp_get(cp) != '&') return '&'; cp_get(cp); return CTOK_ANDAND;\n    case '=':\n      if (cp_get(cp) != '=') return '='; cp_get(cp); return CTOK_EQ;\n    case '!':\n      if (cp_get(cp) != '=') return '!'; cp_get(cp); return CTOK_NE;\n    case '<':\n      if (cp_get(cp) == '=') { cp_get(cp); return CTOK_LE; }\n      else if (cp->c == '<') { cp_get(cp); return CTOK_SHL; }\n      return '<';\n    case '>':\n      if (cp_get(cp) == '=') { cp_get(cp); return CTOK_GE; }\n      else if (cp->c == '>') { cp_get(cp); return CTOK_SHR; }\n      return '>';\n    case '-':\n      if (cp_get(cp) != '>') return '-'; cp_get(cp); return CTOK_DEREF;\n    case '$':\n      return cp_param(cp);\n    case '\\0': return CTOK_EOF;\n    default: { CPToken c = cp->c; cp_get(cp); return c; }\n    }\n  }\n}\n\nstatic LJ_NOINLINE CPToken cp_next(CPState *cp)\n{\n  return (cp->tok = cp_next_(cp));\n}\n\n/* -- C parser ------------------------------------------------------------ */\n\n/* Namespaces for resolving identifiers. */\n#define CPNS_DEFAULT \\\n  ((1u<<CT_KW)|(1u<<CT_TYPEDEF)|(1u<<CT_FUNC)|(1u<<CT_EXTERN)|(1u<<CT_CONSTVAL))\n#define CPNS_STRUCT\t((1u<<CT_KW)|(1u<<CT_STRUCT)|(1u<<CT_ENUM))\n\ntypedef CTypeID CPDeclIdx;\t/* Index into declaration stack. */\ntypedef uint32_t CPscl;\t\t/* Storage class flags. */\n\n/* Type declaration context. */\ntypedef struct CPDecl {\n  CPDeclIdx top;\t/* Top of declaration stack. */\n  CPDeclIdx pos;\t/* Insertion position in declaration chain. */\n  CPDeclIdx specpos;\t/* Saved position for declaration specifier. */\n  uint32_t mode;\t/* Declarator mode. */\n  CPState *cp;\t\t/* C parser state. */\n  GCstr *name;\t\t/* Name of declared identifier (if direct). */\n  GCstr *redir;\t\t/* Redirected symbol name. */\n  CTypeID nameid;\t/* Existing typedef for declared identifier. */\n  CTInfo attr;\t\t/* Attributes. */\n  CTInfo fattr;\t\t/* Function attributes. */\n  CTInfo specattr;\t/* Saved attributes. */\n  CTInfo specfattr;\t/* Saved function attributes. */\n  CTSize bits;\t\t/* Field size in bits (if any). */\n  CType stack[CPARSE_MAX_DECLSTACK];  /* Type declaration stack. */\n} CPDecl;\n\n/* Forward declarations. */\nstatic CPscl cp_decl_spec(CPState *cp, CPDecl *decl, CPscl scl);\nstatic void cp_declarator(CPState *cp, CPDecl *decl);\nstatic CTypeID cp_decl_abstract(CPState *cp);\n\n/* Initialize C parser state. Caller must set up: L, p, srcname, mode. */\nstatic void cp_init(CPState *cp)\n{\n  cp->linenumber = 1;\n  cp->depth = 0;\n  cp->curpack = 0;\n  cp->packstack[0] = 255;\n  lj_str_initbuf(&cp->sb);\n  lj_str_resizebuf(cp->L, &cp->sb, LJ_MIN_SBUF);\n  lua_assert(cp->p != NULL);\n  cp_get(cp);  /* Read-ahead first char. */\n  cp->tok = 0;\n  cp->tmask = CPNS_DEFAULT;\n  cp_next(cp);  /* Read-ahead first token. */\n}\n\n/* Cleanup C parser state. */\nstatic void cp_cleanup(CPState *cp)\n{\n  global_State *g = G(cp->L);\n  lj_str_freebuf(g, &cp->sb);\n}\n\n/* Check and consume optional token. */\nstatic int cp_opt(CPState *cp, CPToken tok)\n{\n  if (cp->tok == tok) { cp_next(cp); return 1; }\n  return 0;\n}\n\n/* Check and consume token. */\nstatic void cp_check(CPState *cp, CPToken tok)\n{\n  if (cp->tok != tok) cp_err_token(cp, tok);\n  cp_next(cp);\n}\n\n/* Check if the next token may start a type declaration. */\nstatic int cp_istypedecl(CPState *cp)\n{\n  if (cp->tok >= CTOK_FIRSTDECL && cp->tok <= CTOK_LASTDECL) return 1;\n  if (cp->tok == CTOK_IDENT && ctype_istypedef(cp->ct->info)) return 1;\n  if (cp->tok == '$') return 1;\n  return 0;\n}\n\n/* -- Constant expression evaluator --------------------------------------- */\n\n/* Forward declarations. */\nstatic void cp_expr_unary(CPState *cp, CPValue *k);\nstatic void cp_expr_sub(CPState *cp, CPValue *k, int pri);\n\n/* Please note that type handling is very weak here. Most ops simply\n** assume integer operands. Accessors are only needed to compute types and\n** return synthetic values. The only purpose of the expression evaluator\n** is to compute the values of constant expressions one would typically\n** find in C header files. And again: this is NOT a validating C parser!\n*/\n\n/* Parse comma separated expression and return last result. */\nstatic void cp_expr_comma(CPState *cp, CPValue *k)\n{\n  do { cp_expr_sub(cp, k, 0); } while (cp_opt(cp, ','));\n}\n\n/* Parse sizeof/alignof operator. */\nstatic void cp_expr_sizeof(CPState *cp, CPValue *k, int wantsz)\n{\n  CTSize sz;\n  CTInfo info;\n  if (cp_opt(cp, '(')) {\n    if (cp_istypedecl(cp))\n      k->id = cp_decl_abstract(cp);\n    else\n      cp_expr_comma(cp, k);\n    cp_check(cp, ')');\n  } else {\n    cp_expr_unary(cp, k);\n  }\n  info = lj_ctype_info(cp->cts, k->id, &sz);\n  if (wantsz) {\n    if (sz != CTSIZE_INVALID)\n      k->u32 = sz;\n    else if (k->id != CTID_A_CCHAR)  /* Special case for sizeof(\"string\"). */\n      cp_err(cp, LJ_ERR_FFI_INVSIZE);\n  } else {\n    k->u32 = 1u << ctype_align(info);\n  }\n  k->id = CTID_UINT32;  /* Really size_t. */\n}\n\n/* Parse prefix operators. */\nstatic void cp_expr_prefix(CPState *cp, CPValue *k)\n{\n  if (cp->tok == CTOK_INTEGER) {\n    *k = cp->val; cp_next(cp);\n  } else if (cp_opt(cp, '+')) {\n    cp_expr_unary(cp, k);  /* Nothing to do (well, integer promotion). */\n  } else if (cp_opt(cp, '-')) {\n    cp_expr_unary(cp, k); k->i32 = -k->i32;\n  } else if (cp_opt(cp, '~')) {\n    cp_expr_unary(cp, k); k->i32 = ~k->i32;\n  } else if (cp_opt(cp, '!')) {\n    cp_expr_unary(cp, k); k->i32 = !k->i32; k->id = CTID_INT32;\n  } else if (cp_opt(cp, '(')) {\n    if (cp_istypedecl(cp)) {  /* Cast operator. */\n      CTypeID id = cp_decl_abstract(cp);\n      cp_check(cp, ')');\n      cp_expr_unary(cp, k);\n      k->id = id;  /* No conversion performed. */\n    } else {  /* Sub-expression. */\n      cp_expr_comma(cp, k);\n      cp_check(cp, ')');\n    }\n  } else if (cp_opt(cp, '*')) {  /* Indirection. */\n    CType *ct;\n    cp_expr_unary(cp, k);\n    ct = lj_ctype_rawref(cp->cts, k->id);\n    if (!ctype_ispointer(ct->info))\n      cp_err_badidx(cp, ct);\n    k->u32 = 0; k->id = ctype_cid(ct->info);\n  } else if (cp_opt(cp, '&')) {  /* Address operator. */\n    cp_expr_unary(cp, k);\n    k->id = lj_ctype_intern(cp->cts, CTINFO(CT_PTR, CTALIGN_PTR+k->id),\n\t\t\t    CTSIZE_PTR);\n  } else if (cp_opt(cp, CTOK_SIZEOF)) {\n    cp_expr_sizeof(cp, k, 1);\n  } else if (cp_opt(cp, CTOK_ALIGNOF)) {\n    cp_expr_sizeof(cp, k, 0);\n  } else if (cp->tok == CTOK_IDENT) {\n    if (ctype_type(cp->ct->info) == CT_CONSTVAL) {\n      k->u32 = cp->ct->size; k->id = ctype_cid(cp->ct->info);\n    } else if (ctype_type(cp->ct->info) == CT_EXTERN) {\n      k->u32 = cp->val.id; k->id = ctype_cid(cp->ct->info);\n    } else if (ctype_type(cp->ct->info) == CT_FUNC) {\n      k->u32 = cp->val.id; k->id = cp->val.id;\n    } else {\n      goto err_expr;\n    }\n    cp_next(cp);\n  } else if (cp->tok == CTOK_STRING) {\n    CTSize sz = cp->str->len;\n    while (cp_next(cp) == CTOK_STRING)\n      sz += cp->str->len;\n    k->u32 = sz + 1;\n    k->id = CTID_A_CCHAR;\n  } else {\n  err_expr:\n    cp_errmsg(cp, cp->tok, LJ_ERR_XSYMBOL);\n  }\n}\n\n/* Parse postfix operators. */\nstatic void cp_expr_postfix(CPState *cp, CPValue *k)\n{\n  for (;;) {\n    CType *ct;\n    if (cp_opt(cp, '[')) {  /* Array/pointer index. */\n      CPValue k2;\n      cp_expr_comma(cp, &k2);\n      ct = lj_ctype_rawref(cp->cts, k->id);\n      if (!ctype_ispointer(ct->info)) {\n\tct = lj_ctype_rawref(cp->cts, k2.id);\n\tif (!ctype_ispointer(ct->info))\n\t  cp_err_badidx(cp, ct);\n      }\n      cp_check(cp, ']');\n      k->u32 = 0;\n    } else if (cp->tok == '.' || cp->tok == CTOK_DEREF) {  /* Struct deref. */\n      CTSize ofs;\n      CType *fct;\n      ct = lj_ctype_rawref(cp->cts, k->id);\n      if (cp->tok == CTOK_DEREF) {\n\tif (!ctype_ispointer(ct->info))\n\t  cp_err_badidx(cp, ct);\n\tct = lj_ctype_rawref(cp->cts, ctype_cid(ct->info));\n      }\n      cp_next(cp);\n      if (cp->tok != CTOK_IDENT) cp_err_token(cp, CTOK_IDENT);\n      if (!ctype_isstruct(ct->info) || ct->size == CTSIZE_INVALID ||\n\t  !(fct = lj_ctype_getfield(cp->cts, ct, cp->str, &ofs)) ||\n\t  ctype_isbitfield(fct->info)) {\n\tGCstr *s = lj_ctype_repr(cp->cts->L, ctype_typeid(cp->cts, ct), NULL);\n\tcp_errmsg(cp, 0, LJ_ERR_FFI_BADMEMBER, strdata(s), strdata(cp->str));\n      }\n      ct = fct;\n      k->u32 = ctype_isconstval(ct->info) ? ct->size : 0;\n      cp_next(cp);\n    } else {\n      return;\n    }\n    k->id = ctype_cid(ct->info);\n  }\n}\n\n/* Parse infix operators. */\nstatic void cp_expr_infix(CPState *cp, CPValue *k, int pri)\n{\n  CPValue k2;\n  k2.u32 = 0; k2.id = 0;  /* Silence the compiler. */\n  for (;;) {\n    switch (pri) {\n    case 0:\n      if (cp_opt(cp, '?')) {\n\tCPValue k3;\n\tcp_expr_comma(cp, &k2);  /* Right-associative. */\n\tcp_check(cp, ':');\n\tcp_expr_sub(cp, &k3, 0);\n\tk->u32 = k->u32 ? k2.u32 : k3.u32;\n\tk->id = k2.id > k3.id ? k2.id : k3.id;\n\tcontinue;\n      }\n    case 1:\n      if (cp_opt(cp, CTOK_OROR)) {\n\tcp_expr_sub(cp, &k2, 2); k->i32 = k->u32 || k2.u32; k->id = CTID_INT32;\n\tcontinue;\n      }\n    case 2:\n      if (cp_opt(cp, CTOK_ANDAND)) {\n\tcp_expr_sub(cp, &k2, 3); k->i32 = k->u32 && k2.u32; k->id = CTID_INT32;\n\tcontinue;\n      }\n    case 3:\n      if (cp_opt(cp, '|')) {\n\tcp_expr_sub(cp, &k2, 4); k->u32 = k->u32 | k2.u32; goto arith_result;\n      }\n    case 4:\n      if (cp_opt(cp, '^')) {\n\tcp_expr_sub(cp, &k2, 5); k->u32 = k->u32 ^ k2.u32; goto arith_result;\n      }\n    case 5:\n      if (cp_opt(cp, '&')) {\n\tcp_expr_sub(cp, &k2, 6); k->u32 = k->u32 & k2.u32; goto arith_result;\n      }\n    case 6:\n      if (cp_opt(cp, CTOK_EQ)) {\n\tcp_expr_sub(cp, &k2, 7); k->i32 = k->u32 == k2.u32; k->id = CTID_INT32;\n\tcontinue;\n      } else if (cp_opt(cp, CTOK_NE)) {\n\tcp_expr_sub(cp, &k2, 7); k->i32 = k->u32 != k2.u32; k->id = CTID_INT32;\n\tcontinue;\n      }\n    case 7:\n      if (cp_opt(cp, '<')) {\n\tcp_expr_sub(cp, &k2, 8);\n\tif (k->id == CTID_INT32 && k2.id == CTID_INT32)\n\t  k->i32 = k->i32 < k2.i32;\n\telse\n\t  k->i32 = k->u32 < k2.u32;\n\tk->id = CTID_INT32;\n\tcontinue;\n      } else if (cp_opt(cp, '>')) {\n\tcp_expr_sub(cp, &k2, 8);\n\tif (k->id == CTID_INT32 && k2.id == CTID_INT32)\n\t  k->i32 = k->i32 > k2.i32;\n\telse\n\t  k->i32 = k->u32 > k2.u32;\n\tk->id = CTID_INT32;\n\tcontinue;\n      } else if (cp_opt(cp, CTOK_LE)) {\n\tcp_expr_sub(cp, &k2, 8);\n\tif (k->id == CTID_INT32 && k2.id == CTID_INT32)\n\t  k->i32 = k->i32 <= k2.i32;\n\telse\n\t  k->i32 = k->u32 <= k2.u32;\n\tk->id = CTID_INT32;\n\tcontinue;\n      } else if (cp_opt(cp, CTOK_GE)) {\n\tcp_expr_sub(cp, &k2, 8);\n\tif (k->id == CTID_INT32 && k2.id == CTID_INT32)\n\t  k->i32 = k->i32 >= k2.i32;\n\telse\n\t  k->i32 = k->u32 >= k2.u32;\n\tk->id = CTID_INT32;\n\tcontinue;\n      }\n    case 8:\n      if (cp_opt(cp, CTOK_SHL)) {\n\tcp_expr_sub(cp, &k2, 9); k->u32 = k->u32 << k2.u32;\n\tcontinue;\n      } else if (cp_opt(cp, CTOK_SHR)) {\n\tcp_expr_sub(cp, &k2, 9);\n\tif (k->id == CTID_INT32)\n\t  k->i32 = k->i32 >> k2.i32;\n\telse\n\t  k->u32 = k->u32 >> k2.u32;\n\tcontinue;\n      }\n    case 9:\n      if (cp_opt(cp, '+')) {\n\tcp_expr_sub(cp, &k2, 10); k->u32 = k->u32 + k2.u32;\n      arith_result:\n\tif (k2.id > k->id) k->id = k2.id;  /* Trivial promotion to unsigned. */\n\tcontinue;\n      } else if (cp_opt(cp, '-')) {\n\tcp_expr_sub(cp, &k2, 10); k->u32 = k->u32 - k2.u32; goto arith_result;\n      }\n    case 10:\n      if (cp_opt(cp, '*')) {\n\tcp_expr_unary(cp, &k2); k->u32 = k->u32 * k2.u32; goto arith_result;\n      } else if (cp_opt(cp, '/')) {\n\tcp_expr_unary(cp, &k2);\n\tif (k2.id > k->id) k->id = k2.id;  /* Trivial promotion to unsigned. */\n\tif (k2.u32 == 0 ||\n\t    (k->id == CTID_INT32 && k->u32 == 0x80000000u && k2.i32 == -1))\n\t  cp_err(cp, LJ_ERR_BADVAL);\n\tif (k->id == CTID_INT32)\n\t  k->i32 = k->i32 / k2.i32;\n\telse\n\t  k->u32 = k->u32 / k2.u32;\n\tcontinue;\n      } else if (cp_opt(cp, '%')) {\n\tcp_expr_unary(cp, &k2);\n\tif (k2.id > k->id) k->id = k2.id;  /* Trivial promotion to unsigned. */\n\tif (k2.u32 == 0 ||\n\t    (k->id == CTID_INT32 && k->u32 == 0x80000000u && k2.i32 == -1))\n\t  cp_err(cp, LJ_ERR_BADVAL);\n\tif (k->id == CTID_INT32)\n\t  k->i32 = k->i32 % k2.i32;\n\telse\n\t  k->u32 = k->u32 % k2.u32;\n\tcontinue;\n      }\n    default:\n      return;\n    }\n  }\n}\n\n/* Parse and evaluate unary expression. */\nstatic void cp_expr_unary(CPState *cp, CPValue *k)\n{\n  if (++cp->depth > CPARSE_MAX_DECLDEPTH) cp_err(cp, LJ_ERR_XLEVELS);\n  cp_expr_prefix(cp, k);\n  cp_expr_postfix(cp, k);\n  cp->depth--;\n}\n\n/* Parse and evaluate sub-expression. */\nstatic void cp_expr_sub(CPState *cp, CPValue *k, int pri)\n{\n  cp_expr_unary(cp, k);\n  cp_expr_infix(cp, k, pri);\n}\n\n/* Parse constant integer expression. */\nstatic void cp_expr_kint(CPState *cp, CPValue *k)\n{\n  CType *ct;\n  cp_expr_sub(cp, k, 0);\n  ct = ctype_raw(cp->cts, k->id);\n  if (!ctype_isinteger(ct->info)) cp_err(cp, LJ_ERR_BADVAL);\n}\n\n/* Parse (non-negative) size expression. */\nstatic CTSize cp_expr_ksize(CPState *cp)\n{\n  CPValue k;\n  cp_expr_kint(cp, &k);\n  if (k.u32 >= 0x80000000u) cp_err(cp, LJ_ERR_FFI_INVSIZE);\n  return k.u32;\n}\n\n/* -- Type declaration stack management ----------------------------------- */\n\n/* Add declaration element behind the insertion position. */\nstatic CPDeclIdx cp_add(CPDecl *decl, CTInfo info, CTSize size)\n{\n  CPDeclIdx top = decl->top;\n  if (top >= CPARSE_MAX_DECLSTACK) cp_err(decl->cp, LJ_ERR_XLEVELS);\n  decl->stack[top].info = info;\n  decl->stack[top].size = size;\n  decl->stack[top].sib = 0;\n  setgcrefnull(decl->stack[top].name);\n  decl->stack[top].next = decl->stack[decl->pos].next;\n  decl->stack[decl->pos].next = (CTypeID1)top;\n  decl->top = top+1;\n  return top;\n}\n\n/* Push declaration element before the insertion position. */\nstatic CPDeclIdx cp_push(CPDecl *decl, CTInfo info, CTSize size)\n{\n  return (decl->pos = cp_add(decl, info, size));\n}\n\n/* Push or merge attributes. */\nstatic void cp_push_attributes(CPDecl *decl)\n{\n  CType *ct = &decl->stack[decl->pos];\n  if (ctype_isfunc(ct->info)) {  /* Ok to modify in-place. */\n#if LJ_TARGET_X86\n    if ((decl->fattr & CTFP_CCONV))\n      ct->info = (ct->info & (CTMASK_NUM|CTF_VARARG|CTMASK_CID)) +\n\t\t (decl->fattr & ~CTMASK_CID);\n#endif\n  } else {\n    if ((decl->attr & CTFP_ALIGNED) && !(decl->mode & CPARSE_MODE_FIELD))\n      cp_push(decl, CTINFO(CT_ATTRIB, CTATTRIB(CTA_ALIGN)),\n\t      ctype_align(decl->attr));\n  }\n}\n\n/* Push unrolled type to declaration stack and merge qualifiers. */\nstatic void cp_push_type(CPDecl *decl, CTypeID id)\n{\n  CType *ct = ctype_get(decl->cp->cts, id);\n  CTInfo info = ct->info;\n  CTSize size = ct->size;\n  switch (ctype_type(info)) {\n  case CT_STRUCT: case CT_ENUM:\n    cp_push(decl, CTINFO(CT_TYPEDEF, id), 0);  /* Don't copy unique types. */\n    if ((decl->attr & CTF_QUAL)) {  /* Push unmerged qualifiers. */\n      cp_push(decl, CTINFO(CT_ATTRIB, CTATTRIB(CTA_QUAL)),\n\t      (decl->attr & CTF_QUAL));\n      decl->attr &= ~CTF_QUAL;\n    }\n    break;\n  case CT_ATTRIB:\n    if (ctype_isxattrib(info, CTA_QUAL))\n      decl->attr &= ~size;  /* Remove redundant qualifiers. */\n    cp_push_type(decl, ctype_cid(info));  /* Unroll. */\n    cp_push(decl, info & ~CTMASK_CID, size);  /* Copy type. */\n    break;\n  case CT_ARRAY:\n    cp_push_type(decl, ctype_cid(info));  /* Unroll. */\n    cp_push(decl, info & ~CTMASK_CID, size);  /* Copy type. */\n    decl->stack[decl->pos].sib = 1;  /* Mark as already checked and sized. */\n    /* Note: this is not copied to the ct->sib in the C type table. */\n    break;\n  case CT_FUNC:\n    /* Copy type, link parameters (shared). */\n    decl->stack[cp_push(decl, info, size)].sib = ct->sib;\n    break;\n  default:\n    /* Copy type, merge common qualifiers. */\n    cp_push(decl, info|(decl->attr & CTF_QUAL), size);\n    decl->attr &= ~CTF_QUAL;\n    break;\n  }\n}\n\n/* Consume the declaration element chain and intern the C type. */\nstatic CTypeID cp_decl_intern(CPState *cp, CPDecl *decl)\n{\n  CTypeID id = 0;\n  CPDeclIdx idx = 0;\n  CTSize csize = CTSIZE_INVALID;\n  CTSize cinfo = 0;\n  do {\n    CType *ct = &decl->stack[idx];\n    CTInfo info = ct->info;\n    CTInfo size = ct->size;\n    /* The cid is already part of info for copies of pointers/functions. */\n    idx = ct->next;\n    if (ctype_istypedef(info)) {\n      lua_assert(id == 0);\n      id = ctype_cid(info);\n      /* Always refetch info/size, since struct/enum may have been completed. */\n      cinfo = ctype_get(cp->cts, id)->info;\n      csize = ctype_get(cp->cts, id)->size;\n      lua_assert(ctype_isstruct(cinfo) || ctype_isenum(cinfo));\n    } else if (ctype_isfunc(info)) {  /* Intern function. */\n      CType *fct;\n      CTypeID fid;\n      CTypeID sib;\n      if (id) {\n\tCType *refct = ctype_raw(cp->cts, id);\n\t/* Reject function or refarray return types. */\n\tif (ctype_isfunc(refct->info) || ctype_isrefarray(refct->info))\n\t  cp_err(cp, LJ_ERR_FFI_INVTYPE);\n      }\n      /* No intervening attributes allowed, skip forward. */\n      while (idx) {\n\tCType *ctn = &decl->stack[idx];\n\tif (!ctype_isattrib(ctn->info)) break;\n\tidx = ctn->next;  /* Skip attribute. */\n      }\n      sib = ct->sib;  /* Next line may reallocate the C type table. */\n      fid = lj_ctype_new(cp->cts, &fct);\n      csize = CTSIZE_INVALID;\n      fct->info = cinfo = info + id;\n      fct->size = size;\n      fct->sib = sib;\n      id = fid;\n    } else if (ctype_isattrib(info)) {\n      if (ctype_isxattrib(info, CTA_QUAL))\n\tcinfo |= size;\n      else if (ctype_isxattrib(info, CTA_ALIGN))\n\tCTF_INSERT(cinfo, ALIGN, size);\n      id = lj_ctype_intern(cp->cts, info+id, size);\n      /* Inherit csize/cinfo from original type. */\n    } else {\n      if (ctype_isnum(info)) {  /* Handle mode/vector-size attributes. */\n\tlua_assert(id == 0);\n\tif (!(info & CTF_BOOL)) {\n\t  CTSize msize = ctype_msizeP(decl->attr);\n\t  CTSize vsize = ctype_vsizeP(decl->attr);\n\t  if (msize && (!(info & CTF_FP) || (msize == 4 || msize == 8))) {\n\t    CTSize malign = lj_fls(msize);\n\t    if (malign > 4) malign = 4;  /* Limit alignment. */\n\t    CTF_INSERT(info, ALIGN, malign);\n\t    size = msize;  /* Override size via mode. */\n\t  }\n\t  if (vsize) {  /* Vector size set? */\n\t    CTSize esize = lj_fls(size);\n\t    if (vsize >= esize) {\n\t      /* Intern the element type first. */\n\t      id = lj_ctype_intern(cp->cts, info, size);\n\t      /* Then create a vector (array) with vsize alignment. */\n\t      size = (1u << vsize);\n\t      if (vsize > 4) vsize = 4;  /* Limit alignment. */\n\t      if (ctype_align(info) > vsize) vsize = ctype_align(info);\n\t      info = CTINFO(CT_ARRAY, (info & CTF_QUAL) + CTF_VECTOR +\n\t\t\t\t      CTALIGN(vsize));\n\t    }\n\t  }\n\t}\n      } else if (ctype_isptr(info)) {\n\t/* Reject pointer/ref to ref. */\n\tif (id && ctype_isref(ctype_raw(cp->cts, id)->info))\n\t  cp_err(cp, LJ_ERR_FFI_INVTYPE);\n\tif (ctype_isref(info)) {\n\t  info &= ~CTF_VOLATILE;  /* Refs are always const, never volatile. */\n\t  /* No intervening attributes allowed, skip forward. */\n\t  while (idx) {\n\t    CType *ctn = &decl->stack[idx];\n\t    if (!ctype_isattrib(ctn->info)) break;\n\t    idx = ctn->next;  /* Skip attribute. */\n\t  }\n\t}\n      } else if (ctype_isarray(info)) {  /* Check for valid array size etc. */\n\tif (ct->sib == 0) {  /* Only check/size arrays not copied by unroll. */\n\t  if (ctype_isref(cinfo))  /* Reject arrays of refs. */\n\t    cp_err(cp, LJ_ERR_FFI_INVTYPE);\n\t  /* Reject VLS or unknown-sized types. */\n\t  if (ctype_isvltype(cinfo) || csize == CTSIZE_INVALID)\n\t    cp_err(cp, LJ_ERR_FFI_INVSIZE);\n\t  /* a[] and a[?] keep their invalid size. */\n\t  if (size != CTSIZE_INVALID) {\n\t    uint64_t xsz = (uint64_t)size * csize;\n\t    if (xsz >= 0x80000000u) cp_err(cp, LJ_ERR_FFI_INVSIZE);\n\t    size = (CTSize)xsz;\n\t  }\n\t}\n\tif ((cinfo & CTF_ALIGN) > (info & CTF_ALIGN))  /* Find max. align. */\n\t  info = (info & ~CTF_ALIGN) | (cinfo & CTF_ALIGN);\n\tinfo |= (cinfo & CTF_QUAL);  /* Inherit qual. */\n      } else {\n\tlua_assert(ctype_isvoid(info));\n      }\n      csize = size;\n      cinfo = info+id;\n      id = lj_ctype_intern(cp->cts, info+id, size);\n    }\n  } while (idx);\n  return id;\n}\n\n/* -- C declaration parser ------------------------------------------------ */\n\n#define H_(le, be)\tLJ_ENDIAN_SELECT(0x##le, 0x##be)\n\n/* Reset declaration state to declaration specifier. */\nstatic void cp_decl_reset(CPDecl *decl)\n{\n  decl->pos = decl->specpos;\n  decl->top = decl->specpos+1;\n  decl->stack[decl->specpos].next = 0;\n  decl->attr = decl->specattr;\n  decl->fattr = decl->specfattr;\n  decl->name = NULL;\n  decl->redir = NULL;\n}\n\n/* Parse constant initializer. */\n/* NYI: FP constants and strings as initializers. */\nstatic CTypeID cp_decl_constinit(CPState *cp, CType **ctp, CTypeID ctypeid)\n{\n  CType *ctt = ctype_get(cp->cts, ctypeid);\n  CTInfo info;\n  CTSize size;\n  CPValue k;\n  CTypeID constid;\n  while (ctype_isattrib(ctt->info)) {  /* Skip attributes. */\n    ctypeid = ctype_cid(ctt->info);  /* Update ID, too. */\n    ctt = ctype_get(cp->cts, ctypeid);\n  }\n  info = ctt->info;\n  size = ctt->size;\n  if (!ctype_isinteger(info) || !(info & CTF_CONST) || size > 4)\n    cp_err(cp, LJ_ERR_FFI_INVTYPE);\n  cp_check(cp, '=');\n  cp_expr_sub(cp, &k, 0);\n  constid = lj_ctype_new(cp->cts, ctp);\n  (*ctp)->info = CTINFO(CT_CONSTVAL, CTF_CONST|ctypeid);\n  k.u32 <<= 8*(4-size);\n  if ((info & CTF_UNSIGNED))\n    k.u32 >>= 8*(4-size);\n  else\n    k.u32 = (uint32_t)((int32_t)k.u32 >> 8*(4-size));\n  (*ctp)->size = k.u32;\n  return constid;\n}\n\n/* Parse size in parentheses as part of attribute. */\nstatic CTSize cp_decl_sizeattr(CPState *cp)\n{\n  CTSize sz;\n  uint32_t oldtmask = cp->tmask;\n  cp->tmask = CPNS_DEFAULT;  /* Required for expression evaluator. */\n  cp_check(cp, '(');\n  sz = cp_expr_ksize(cp);\n  cp->tmask = oldtmask;\n  cp_check(cp, ')');\n  return sz;\n}\n\n/* Parse alignment attribute. */\nstatic void cp_decl_align(CPState *cp, CPDecl *decl)\n{\n  CTSize al = 4;  /* Unspecified alignment is 16 bytes. */\n  if (cp->tok == '(') {\n    al = cp_decl_sizeattr(cp);\n    al = al ? lj_fls(al) : 0;\n  }\n  CTF_INSERT(decl->attr, ALIGN, al);\n  decl->attr |= CTFP_ALIGNED;\n}\n\n/* Parse GCC asm(\"name\") redirect. */\nstatic void cp_decl_asm(CPState *cp, CPDecl *decl)\n{\n  UNUSED(decl);\n  cp_next(cp);\n  cp_check(cp, '(');\n  if (cp->tok == CTOK_STRING) {\n    GCstr *str = cp->str;\n    while (cp_next(cp) == CTOK_STRING) {\n      lj_str_pushf(cp->L, \"%s%s\", strdata(str), strdata(cp->str));\n      cp->L->top--;\n      str = strV(cp->L->top);\n    }\n    decl->redir = str;\n  }\n  cp_check(cp, ')');\n}\n\n/* Parse GCC __attribute__((mode(...))). */\nstatic void cp_decl_mode(CPState *cp, CPDecl *decl)\n{\n  cp_check(cp, '(');\n  if (cp->tok == CTOK_IDENT) {\n    const char *s = strdata(cp->str);\n    CTSize sz = 0, vlen = 0;\n    if (s[0] == '_' && s[1] == '_') s += 2;\n    if (*s == 'V') {\n      s++;\n      vlen = *s++ - '0';\n      if (*s >= '0' && *s <= '9')\n\tvlen = vlen*10 + (*s++ - '0');\n    }\n    switch (*s++) {\n    case 'Q': sz = 1; break;\n    case 'H': sz = 2; break;\n    case 'S': sz = 4; break;\n    case 'D': sz = 8; break;\n    case 'T': sz = 16; break;\n    case 'O': sz = 32; break;\n    default: goto bad_size;\n    }\n    if (*s == 'I' || *s == 'F') {\n      CTF_INSERT(decl->attr, MSIZEP, sz);\n      if (vlen) CTF_INSERT(decl->attr, VSIZEP, lj_fls(vlen*sz));\n    }\n  bad_size:\n    cp_next(cp);\n  }\n  cp_check(cp, ')');\n}\n\n/* Parse GCC __attribute__((...)). */\nstatic void cp_decl_gccattribute(CPState *cp, CPDecl *decl)\n{\n  cp_next(cp);\n  cp_check(cp, '(');\n  cp_check(cp, '(');\n  while (cp->tok != ')') {\n    if (cp->tok == CTOK_IDENT) {\n      GCstr *attrstr = cp->str;\n      cp_next(cp);\n      switch (attrstr->hash) {\n      case H_(64a9208e,8ce14319): case H_(8e6331b2,95a282af):  /* aligned */\n\tcp_decl_align(cp, decl);\n\tbreak;\n      case H_(42eb47de,f0ede26c): case H_(29f48a09,cf383e0c):  /* packed */\n\tdecl->attr |= CTFP_PACKED;\n\tbreak;\n      case H_(0a84eef6,8dfab04c): case H_(995cf92c,d5696591):  /* mode */\n\tcp_decl_mode(cp, decl);\n\tbreak;\n      case H_(0ab31997,2d5213fa): case H_(bf875611,200e9990):  /* vector_size */\n\t{\n\t  CTSize vsize = cp_decl_sizeattr(cp);\n\t  if (vsize) CTF_INSERT(decl->attr, VSIZEP, lj_fls(vsize));\n\t}\n\tbreak;\n#if LJ_TARGET_X86\n      case H_(5ad22db8,c689b848): case H_(439150fa,65ea78cb):  /* regparm */\n\tCTF_INSERT(decl->fattr, REGPARM, cp_decl_sizeattr(cp));\n\tdecl->fattr |= CTFP_CCONV;\n\tbreak;\n      case H_(18fc0b98,7ff4c074): case H_(4e62abed,0a747424):  /* cdecl */\n\tCTF_INSERT(decl->fattr, CCONV, CTCC_CDECL);\n\tdecl->fattr |= CTFP_CCONV;\n\tbreak;\n      case H_(72b2e41b,494c5a44): case H_(f2356d59,f25fc9bd):  /* thiscall */\n\tCTF_INSERT(decl->fattr, CCONV, CTCC_THISCALL);\n\tdecl->fattr |= CTFP_CCONV;\n\tbreak;\n      case H_(0d0ffc42,ab746f88): case H_(21c54ba1,7f0ca7e3):  /* fastcall */\n\tCTF_INSERT(decl->fattr, CCONV, CTCC_FASTCALL);\n\tdecl->fattr |= CTFP_CCONV;\n\tbreak;\n      case H_(ef76b040,9412e06a): case H_(de56697b,c750e6e1):  /* stdcall */\n\tCTF_INSERT(decl->fattr, CCONV, CTCC_STDCALL);\n\tdecl->fattr |= CTFP_CCONV;\n\tbreak;\n      case H_(ea78b622,f234bd8e): case H_(252ffb06,8d50f34b):  /* sseregparm */\n\tdecl->fattr |= CTF_SSEREGPARM;\n\tdecl->fattr |= CTFP_CCONV;\n\tbreak;\n#endif\n      default:  /* Skip all other attributes. */\n\tgoto skip_attr;\n      }\n    } else if (cp->tok >= CTOK_FIRSTDECL) {  /* For __attribute((const)) etc. */\n      cp_next(cp);\n    skip_attr:\n      if (cp_opt(cp, '(')) {\n\twhile (cp->tok != ')' && cp->tok != CTOK_EOF) cp_next(cp);\n\tcp_check(cp, ')');\n      }\n    } else {\n      break;\n    }\n    if (!cp_opt(cp, ',')) break;\n  }\n  cp_check(cp, ')');\n  cp_check(cp, ')');\n}\n\n/* Parse MSVC __declspec(...). */\nstatic void cp_decl_msvcattribute(CPState *cp, CPDecl *decl)\n{\n  cp_next(cp);\n  cp_check(cp, '(');\n  while (cp->tok == CTOK_IDENT) {\n    GCstr *attrstr = cp->str;\n    cp_next(cp);\n    switch (attrstr->hash) {\n    case H_(bc2395fa,98f267f8):  /* align */\n      cp_decl_align(cp, decl);\n      break;\n    default:  /* Ignore all other attributes. */\n      if (cp_opt(cp, '(')) {\n\twhile (cp->tok != ')' && cp->tok != CTOK_EOF) cp_next(cp);\n\tcp_check(cp, ')');\n      }\n      break;\n    }\n  }\n  cp_check(cp, ')');\n}\n\n/* Parse declaration attributes (and common qualifiers). */\nstatic void cp_decl_attributes(CPState *cp, CPDecl *decl)\n{\n  for (;;) {\n    switch (cp->tok) {\n    case CTOK_CONST: decl->attr |= CTF_CONST; break;\n    case CTOK_VOLATILE: decl->attr |= CTF_VOLATILE; break;\n    case CTOK_RESTRICT: break;  /* Ignore. */\n    case CTOK_EXTENSION: break;  /* Ignore. */\n    case CTOK_ATTRIBUTE: cp_decl_gccattribute(cp, decl); continue;\n    case CTOK_ASM: cp_decl_asm(cp, decl); continue;\n    case CTOK_DECLSPEC: cp_decl_msvcattribute(cp, decl); continue;\n    case CTOK_CCDECL:\n#if LJ_TARGET_X86\n      CTF_INSERT(decl->fattr, CCONV, cp->ct->size);\n      decl->fattr |= CTFP_CCONV;\n#endif\n      break;\n    case CTOK_PTRSZ:\n#if LJ_64\n      CTF_INSERT(decl->attr, MSIZEP, cp->ct->size);\n#endif\n      break;\n    default: return;\n    }\n    cp_next(cp);\n  }\n}\n\n/* Parse struct/union/enum name. */\nstatic CTypeID cp_struct_name(CPState *cp, CPDecl *sdecl, CTInfo info)\n{\n  CTypeID sid;\n  CType *ct;\n  cp->tmask = CPNS_STRUCT;\n  cp_next(cp);\n  cp_decl_attributes(cp, sdecl);\n  cp->tmask = CPNS_DEFAULT;\n  if (cp->tok != '{') {\n    if (cp->tok != CTOK_IDENT) cp_err_token(cp, CTOK_IDENT);\n    if (cp->val.id) {  /* Name of existing struct/union/enum. */\n      sid = cp->val.id;\n      ct = cp->ct;\n      if ((ct->info ^ info) & (CTMASK_NUM|CTF_UNION))  /* Wrong type. */\n\tcp_errmsg(cp, 0, LJ_ERR_FFI_REDEF, strdata(gco2str(gcref(ct->name))));\n    } else {  /* Create named, incomplete struct/union/enum. */\n      if ((cp->mode & CPARSE_MODE_NOIMPLICIT))\n\tcp_errmsg(cp, 0, LJ_ERR_FFI_BADTAG, strdata(cp->str));\n      sid = lj_ctype_new(cp->cts, &ct);\n      ct->info = info;\n      ct->size = CTSIZE_INVALID;\n      ctype_setname(ct, cp->str);\n      lj_ctype_addname(cp->cts, ct, sid);\n    }\n    cp_next(cp);\n  } else {  /* Create anonymous, incomplete struct/union/enum. */\n    sid = lj_ctype_new(cp->cts, &ct);\n    ct->info = info;\n    ct->size = CTSIZE_INVALID;\n  }\n  if (cp->tok == '{') {\n    if (ct->size != CTSIZE_INVALID || ct->sib)\n      cp_errmsg(cp, 0, LJ_ERR_FFI_REDEF, strdata(gco2str(gcref(ct->name))));\n    ct->sib = 1;  /* Indicate the type is currently being defined. */\n  }\n  return sid;\n}\n\n/* Determine field alignment. */\nstatic CTSize cp_field_align(CPState *cp, CType *ct, CTInfo info)\n{\n  CTSize align = ctype_align(info);\n  UNUSED(cp); UNUSED(ct);\n#if (LJ_TARGET_X86 && !LJ_ABI_WIN) || (LJ_TARGET_ARM && __APPLE__)\n  /* The SYSV i386 and iOS ABIs limit alignment of non-vector fields to 2^2. */\n  if (align > 2 && !(info & CTFP_ALIGNED)) {\n    if (ctype_isarray(info) && !(info & CTF_VECTOR)) {\n      do {\n\tct = ctype_rawchild(cp->cts, ct);\n\tinfo = ct->info;\n      } while (ctype_isarray(info) && !(info & CTF_VECTOR));\n    }\n    if (ctype_isnum(info) || ctype_isenum(info))\n      align = 2;\n  }\n#endif\n  return align;\n}\n\n/* Layout struct/union fields. */\nstatic void cp_struct_layout(CPState *cp, CTypeID sid, CTInfo sattr)\n{\n  CTSize bofs = 0, bmaxofs = 0;  /* Bit offset and max. bit offset. */\n  CTSize maxalign = ctype_align(sattr);\n  CType *sct = ctype_get(cp->cts, sid);\n  CTInfo sinfo = sct->info;\n  CTypeID fieldid = sct->sib;\n  while (fieldid) {\n    CType *ct = ctype_get(cp->cts, fieldid);\n    CTInfo attr = ct->size;  /* Field declaration attributes (temp.). */\n\n    if (ctype_isfield(ct->info) ||\n\t(ctype_isxattrib(ct->info, CTA_SUBTYPE) && attr)) {\n      CTSize align, amask;  /* Alignment (pow2) and alignment mask (bits). */\n      CTSize sz;\n      CTInfo info = lj_ctype_info(cp->cts, ctype_cid(ct->info), &sz);\n      CTSize bsz, csz = 8*sz;  /* Field size and container size (in bits). */\n      sinfo |= (info & (CTF_QUAL|CTF_VLA));  /* Merge pseudo-qualifiers. */\n\n      /* Check for size overflow and determine alignment. */\n      if (sz >= 0x20000000u || bofs + csz < bofs) {\n\tif (!(sz == CTSIZE_INVALID && ctype_isarray(info) &&\n\t      !(sinfo & CTF_UNION)))\n\t  cp_err(cp, LJ_ERR_FFI_INVSIZE);\n\tcsz = sz = 0;  /* Treat a[] and a[?] as zero-sized. */\n      }\n      align = cp_field_align(cp, ct, info);\n      if (((attr|sattr) & CTFP_PACKED) ||\n\t  ((attr & CTFP_ALIGNED) && ctype_align(attr) > align))\n\talign = ctype_align(attr);\n      if (cp->packstack[cp->curpack] < align)\n\talign = cp->packstack[cp->curpack];\n      if (align > maxalign) maxalign = align;\n      amask = (8u << align) - 1;\n\n      bsz = ctype_bitcsz(ct->info);  /* Bitfield size (temp.). */\n      if (bsz == CTBSZ_FIELD || !ctype_isfield(ct->info)) {\n\tbsz = csz;  /* Regular fields or subtypes always fill the container. */\n\tbofs = (bofs + amask) & ~amask;  /* Start new aligned field. */\n\tct->size = (bofs >> 3);  /* Store field offset. */\n      } else {  /* Bitfield. */\n\tif (bsz == 0 || (attr & CTFP_ALIGNED) ||\n\t    (!((attr|sattr) & CTFP_PACKED) && (bofs & amask) + bsz > csz))\n\t  bofs = (bofs + amask) & ~amask;  /* Start new aligned field. */\n\n\t/* Prefer regular field over bitfield. */\n\tif (bsz == csz && (bofs & amask) == 0) {\n\t  ct->info = CTINFO(CT_FIELD, ctype_cid(ct->info));\n\t  ct->size = (bofs >> 3);  /* Store field offset. */\n\t} else {\n\t  ct->info = CTINFO(CT_BITFIELD,\n\t    (info & (CTF_QUAL|CTF_UNSIGNED|CTF_BOOL)) +\n\t    (csz << (CTSHIFT_BITCSZ-3)) + (bsz << CTSHIFT_BITBSZ));\n#if LJ_BE\n\t  ct->info += ((csz - (bofs & (csz-1)) - bsz) << CTSHIFT_BITPOS);\n#else\n\t  ct->info += ((bofs & (csz-1)) << CTSHIFT_BITPOS);\n#endif\n\t  ct->size = ((bofs & ~(csz-1)) >> 3);  /* Store container offset. */\n\t}\n      }\n\n      /* Determine next offset or max. offset. */\n      if ((sinfo & CTF_UNION)) {\n\tif (bsz > bmaxofs) bmaxofs = bsz;\n      } else {\n\tbofs += bsz;\n      }\n    }  /* All other fields in the chain are already set up. */\n\n    fieldid = ct->sib;\n  }\n\n  /* Complete struct/union. */\n  sct->info = sinfo + CTALIGN(maxalign);\n  bofs = (sinfo & CTF_UNION) ? bmaxofs : bofs;\n  maxalign = (8u << maxalign) - 1;\n  sct->size = (((bofs + maxalign) & ~maxalign) >> 3);\n}\n\n/* Parse struct/union declaration. */\nstatic CTypeID cp_decl_struct(CPState *cp, CPDecl *sdecl, CTInfo sinfo)\n{\n  CTypeID sid = cp_struct_name(cp, sdecl, sinfo);\n  if (cp_opt(cp, '{')) {  /* Struct/union definition. */\n    CTypeID lastid = sid;\n    int lastdecl = 0;\n    while (cp->tok != '}') {\n      CPDecl decl;\n      CPscl scl = cp_decl_spec(cp, &decl, CDF_STATIC);\n      decl.mode = scl ? CPARSE_MODE_DIRECT :\n\tCPARSE_MODE_DIRECT|CPARSE_MODE_ABSTRACT|CPARSE_MODE_FIELD;\n\n      for (;;) {\n\tCTypeID ctypeid;\n\n\tif (lastdecl) cp_err_token(cp, '}');\n\n\t/* Parse field declarator. */\n\tdecl.bits = CTSIZE_INVALID;\n\tcp_declarator(cp, &decl);\n\tctypeid = cp_decl_intern(cp, &decl);\n\n\tif ((scl & CDF_STATIC)) {  /* Static constant in struct namespace. */\n\t  CType *ct;\n\t  CTypeID fieldid = cp_decl_constinit(cp, &ct, ctypeid);\n\t  ctype_get(cp->cts, lastid)->sib = fieldid;\n\t  lastid = fieldid;\n\t  ctype_setname(ct, decl.name);\n\t} else {\n\t  CTSize bsz = CTBSZ_FIELD;  /* Temp. for layout phase. */\n\t  CType *ct;\n\t  CTypeID fieldid = lj_ctype_new(cp->cts, &ct);  /* Do this first. */\n\t  CType *tct = ctype_raw(cp->cts, ctypeid);\n\n\t  if (decl.bits == CTSIZE_INVALID) {  /* Regular field. */\n\t    if (ctype_isarray(tct->info) && tct->size == CTSIZE_INVALID)\n\t      lastdecl = 1;  /* a[] or a[?] must be the last declared field. */\n\n\t    /* Accept transparent struct/union/enum. */\n\t    if (!decl.name) {\n\t      if (!((ctype_isstruct(tct->info) && !(tct->info & CTF_VLA)) ||\n\t\t    ctype_isenum(tct->info)))\n\t\tcp_err_token(cp, CTOK_IDENT);\n\t      ct->info = CTINFO(CT_ATTRIB, CTATTRIB(CTA_SUBTYPE) + ctypeid);\n\t      ct->size = ctype_isstruct(tct->info) ?\n\t\t\t (decl.attr|0x80000000u) : 0;  /* For layout phase. */\n\t      goto add_field;\n\t    }\n\t  } else {  /* Bitfield. */\n\t    bsz = decl.bits;\n\t    if (!ctype_isinteger_or_bool(tct->info) ||\n\t\t(bsz == 0 && decl.name) || 8*tct->size > CTBSZ_MAX ||\n\t\tbsz > ((tct->info & CTF_BOOL) ? 1 : 8*tct->size))\n\t      cp_errmsg(cp, ':', LJ_ERR_BADVAL);\n\t  }\n\n\t  /* Create temporary field for layout phase. */\n\t  ct->info = CTINFO(CT_FIELD, ctypeid + (bsz << CTSHIFT_BITCSZ));\n\t  ct->size = decl.attr;\n\t  if (decl.name) ctype_setname(ct, decl.name);\n\n\tadd_field:\n\t  ctype_get(cp->cts, lastid)->sib = fieldid;\n\t  lastid = fieldid;\n\t}\n\tif (!cp_opt(cp, ',')) break;\n\tcp_decl_reset(&decl);\n      }\n      cp_check(cp, ';');\n    }\n    cp_check(cp, '}');\n    ctype_get(cp->cts, lastid)->sib = 0;  /* Drop sib = 1 for empty structs. */\n    cp_decl_attributes(cp, sdecl);  /* Layout phase needs postfix attributes. */\n    cp_struct_layout(cp, sid, sdecl->attr);\n  }\n  return sid;\n}\n\n/* Parse enum declaration. */\nstatic CTypeID cp_decl_enum(CPState *cp, CPDecl *sdecl)\n{\n  CTypeID eid = cp_struct_name(cp, sdecl, CTINFO(CT_ENUM, CTID_VOID));\n  CTInfo einfo = CTINFO(CT_ENUM, CTALIGN(2) + CTID_UINT32);\n  CTSize esize = 4;  /* Only 32 bit enums are supported. */\n  if (cp_opt(cp, '{')) {  /* Enum definition. */\n    CPValue k;\n    CTypeID lastid = eid;\n    k.u32 = 0;\n    k.id = CTID_INT32;\n    do {\n      GCstr *name = cp->str;\n      if (cp->tok != CTOK_IDENT) cp_err_token(cp, CTOK_IDENT);\n      if (cp->val.id) cp_errmsg(cp, 0, LJ_ERR_FFI_REDEF, strdata(name));\n      cp_next(cp);\n      if (cp_opt(cp, '=')) {\n\tcp_expr_kint(cp, &k);\n\tif (k.id == CTID_UINT32) {\n\t  /* C99 says that enum constants are always (signed) integers.\n\t  ** But since unsigned constants like 0x80000000 are quite common,\n\t  ** those are left as uint32_t.\n\t  */\n\t  if (k.i32 >= 0) k.id = CTID_INT32;\n\t} else {\n\t  /* OTOH it's common practice and even mandated by some ABIs\n\t  ** that the enum type itself is unsigned, unless there are any\n\t  ** negative constants.\n\t  */\n\t  k.id = CTID_INT32;\n\t  if (k.i32 < 0) einfo = CTINFO(CT_ENUM, CTALIGN(2) + CTID_INT32);\n\t}\n      }\n      /* Add named enum constant. */\n      {\n\tCType *ct;\n\tCTypeID constid = lj_ctype_new(cp->cts, &ct);\n\tctype_get(cp->cts, lastid)->sib = constid;\n\tlastid = constid;\n\tctype_setname(ct, name);\n\tct->info = CTINFO(CT_CONSTVAL, CTF_CONST|k.id);\n\tct->size = k.u32++;\n\tif (k.u32 == 0x80000000u) k.id = CTID_UINT32;\n\tlj_ctype_addname(cp->cts, ct, constid);\n      }\n      if (!cp_opt(cp, ',')) break;\n    } while (cp->tok != '}');  /* Trailing ',' is ok. */\n    cp_check(cp, '}');\n    /* Complete enum. */\n    ctype_get(cp->cts, eid)->info = einfo;\n    ctype_get(cp->cts, eid)->size = esize;\n  }\n  return eid;\n}\n\n/* Parse declaration specifiers. */\nstatic CPscl cp_decl_spec(CPState *cp, CPDecl *decl, CPscl scl)\n{\n  uint32_t cds = 0, sz = 0;\n  CTypeID tdef = 0;\n\n  decl->cp = cp;\n  decl->mode = cp->mode;\n  decl->name = NULL;\n  decl->redir = NULL;\n  decl->attr = 0;\n  decl->fattr = 0;\n  decl->pos = decl->top = 0;\n  decl->stack[0].next = 0;\n\n  for (;;) {  /* Parse basic types. */\n    cp_decl_attributes(cp, decl);\n    if (cp->tok >= CTOK_FIRSTDECL && cp->tok <= CTOK_LASTDECLFLAG) {\n      uint32_t cbit;\n      if (cp->ct->size) {\n\tif (sz) goto end_decl;\n\tsz = cp->ct->size;\n      }\n      cbit = (1u << (cp->tok - CTOK_FIRSTDECL));\n      cds = cds | cbit | ((cbit & cds & CDF_LONG) << 1);\n      if (cp->tok >= CTOK_FIRSTSCL) {\n\tif (!(scl & cbit)) cp_errmsg(cp, cp->tok, LJ_ERR_FFI_BADSCL);\n      } else if (tdef) {\n\tgoto end_decl;\n      }\n      cp_next(cp);\n      continue;\n    }\n    if (sz || tdef ||\n\t(cds & (CDF_SHORT|CDF_LONG|CDF_SIGNED|CDF_UNSIGNED|CDF_COMPLEX)))\n      break;\n    switch (cp->tok) {\n    case CTOK_STRUCT:\n      tdef = cp_decl_struct(cp, decl, CTINFO(CT_STRUCT, 0));\n      continue;\n    case CTOK_UNION:\n      tdef = cp_decl_struct(cp, decl, CTINFO(CT_STRUCT, CTF_UNION));\n      continue;\n    case CTOK_ENUM:\n      tdef = cp_decl_enum(cp, decl);\n      continue;\n    case CTOK_IDENT:\n      if (ctype_istypedef(cp->ct->info)) {\n\ttdef = ctype_cid(cp->ct->info);  /* Get typedef. */\n\tcp_next(cp);\n\tcontinue;\n      }\n      break;\n    case '$':\n      tdef = cp->val.id;\n      cp_next(cp);\n      continue;\n    default:\n      break;\n    }\n    break;\n  }\nend_decl:\n\n  if ((cds & CDF_COMPLEX))  /* Use predefined complex types. */\n    tdef = sz == 4 ? CTID_COMPLEX_FLOAT : CTID_COMPLEX_DOUBLE;\n\n  if (tdef) {\n    cp_push_type(decl, tdef);\n  } else if ((cds & CDF_VOID)) {\n    cp_push(decl, CTINFO(CT_VOID, (decl->attr & CTF_QUAL)), CTSIZE_INVALID);\n    decl->attr &= ~CTF_QUAL;\n  } else {\n    /* Determine type info and size. */\n    CTInfo info = CTINFO(CT_NUM, (cds & CDF_UNSIGNED) ? CTF_UNSIGNED : 0);\n    if ((cds & CDF_BOOL)) {\n      if ((cds & ~(CDF_SCL|CDF_BOOL|CDF_INT|CDF_SIGNED|CDF_UNSIGNED)))\n\tcp_errmsg(cp, 0, LJ_ERR_FFI_INVTYPE);\n      info |= CTF_BOOL;\n      if (!(cds & CDF_SIGNED)) info |= CTF_UNSIGNED;\n      if (!sz) {\n\tsz = 1;\n      }\n    } else if ((cds & CDF_FP)) {\n      info = CTINFO(CT_NUM, CTF_FP);\n      if ((cds & CDF_LONG)) sz = sizeof(long double);\n    } else if ((cds & CDF_CHAR)) {\n      if ((cds & (CDF_CHAR|CDF_SIGNED|CDF_UNSIGNED)) == CDF_CHAR)\n\tinfo |= CTF_UCHAR;  /* Handle platforms where char is unsigned. */\n    } else if ((cds & CDF_SHORT)) {\n      sz = sizeof(short);\n    } else if ((cds & CDF_LONGLONG)) {\n      sz = 8;\n    } else if ((cds & CDF_LONG)) {\n      info |= CTF_LONG;\n      sz = sizeof(long);\n    } else if (!sz) {\n      if (!(cds & (CDF_SIGNED|CDF_UNSIGNED)))\n\tcp_errmsg(cp, cp->tok, LJ_ERR_FFI_DECLSPEC);\n      sz = sizeof(int);\n    }\n    lua_assert(sz != 0);\n    info += CTALIGN(lj_fls(sz));  /* Use natural alignment. */\n    info += (decl->attr & CTF_QUAL);  /* Merge qualifiers. */\n    cp_push(decl, info, sz);\n    decl->attr &= ~CTF_QUAL;\n  }\n  decl->specpos = decl->pos;\n  decl->specattr = decl->attr;\n  decl->specfattr = decl->fattr;\n  return (cds & CDF_SCL);  /* Return storage class. */\n}\n\n/* Parse array declaration. */\nstatic void cp_decl_array(CPState *cp, CPDecl *decl)\n{\n  CTInfo info = CTINFO(CT_ARRAY, 0);\n  CTSize nelem = CTSIZE_INVALID;  /* Default size for a[] or a[?]. */\n  cp_decl_attributes(cp, decl);\n  if (cp_opt(cp, '?'))\n    info |= CTF_VLA;  /* Create variable-length array a[?]. */\n  else if (cp->tok != ']')\n    nelem = cp_expr_ksize(cp);\n  cp_check(cp, ']');\n  cp_add(decl, info, nelem);\n}\n\n/* Parse function declaration. */\nstatic void cp_decl_func(CPState *cp, CPDecl *fdecl)\n{\n  CTSize nargs = 0;\n  CTInfo info = CTINFO(CT_FUNC, 0);\n  CTypeID lastid = 0, anchor = 0;\n  if (cp->tok != ')') {\n    do {\n      CPDecl decl;\n      CTypeID ctypeid, fieldid;\n      CType *ct;\n      if (cp_opt(cp, '.')) {  /* Vararg function. */\n\tcp_check(cp, '.');  /* Workaround for the minimalistic lexer. */\n\tcp_check(cp, '.');\n\tinfo |= CTF_VARARG;\n\tbreak;\n      }\n      cp_decl_spec(cp, &decl, CDF_REGISTER);\n      decl.mode = CPARSE_MODE_DIRECT|CPARSE_MODE_ABSTRACT;\n      cp_declarator(cp, &decl);\n      ctypeid = cp_decl_intern(cp, &decl);\n      ct = ctype_raw(cp->cts, ctypeid);\n      if (ctype_isvoid(ct->info))\n\tbreak;\n      else if (ctype_isrefarray(ct->info))\n\tctypeid = lj_ctype_intern(cp->cts,\n\t  CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(ct->info)), CTSIZE_PTR);\n      else if (ctype_isfunc(ct->info))\n\tctypeid = lj_ctype_intern(cp->cts,\n\t  CTINFO(CT_PTR, CTALIGN_PTR|ctypeid), CTSIZE_PTR);\n      /* Add new parameter. */\n      fieldid = lj_ctype_new(cp->cts, &ct);\n      if (anchor)\n\tctype_get(cp->cts, lastid)->sib = fieldid;\n      else\n\tanchor = fieldid;\n      lastid = fieldid;\n      if (decl.name) ctype_setname(ct, decl.name);\n      ct->info = CTINFO(CT_FIELD, ctypeid);\n      ct->size = nargs++;\n    } while (cp_opt(cp, ','));\n  }\n  cp_check(cp, ')');\n  if (cp_opt(cp, '{')) {  /* Skip function definition. */\n    int level = 1;\n    cp->mode |= CPARSE_MODE_SKIP;\n    for (;;) {\n      if (cp->tok == '{') level++;\n      else if (cp->tok == '}' && --level == 0) break;\n      else if (cp->tok == CTOK_EOF) cp_err_token(cp, '}');\n      cp_next(cp);\n    }\n    cp->mode &= ~CPARSE_MODE_SKIP;\n    cp->tok = ';';  /* Ok for cp_decl_multi(), error in cp_decl_single(). */\n  }\n  info |= (fdecl->fattr & ~CTMASK_CID);\n  fdecl->fattr = 0;\n  fdecl->stack[cp_add(fdecl, info, nargs)].sib = anchor;\n}\n\n/* Parse declarator. */\nstatic void cp_declarator(CPState *cp, CPDecl *decl)\n{\n  if (++cp->depth > CPARSE_MAX_DECLDEPTH) cp_err(cp, LJ_ERR_XLEVELS);\n\n  for (;;) {  /* Head of declarator. */\n    if (cp_opt(cp, '*')) {  /* Pointer. */\n      CTSize sz;\n      CTInfo info;\n      cp_decl_attributes(cp, decl);\n      sz = CTSIZE_PTR;\n      info = CTINFO(CT_PTR, CTALIGN_PTR);\n#if LJ_64\n      if (ctype_msizeP(decl->attr) == 4) {\n\tsz = 4;\n\tinfo = CTINFO(CT_PTR, CTALIGN(2));\n      }\n#endif\n      info += (decl->attr & (CTF_QUAL|CTF_REF));\n      decl->attr &= ~(CTF_QUAL|(CTMASK_MSIZEP<<CTSHIFT_MSIZEP));\n      cp_push(decl, info, sz);\n    } else if (cp_opt(cp, '&') || cp_opt(cp, CTOK_ANDAND)) {  /* Reference. */\n      decl->attr &= ~(CTF_QUAL|(CTMASK_MSIZEP<<CTSHIFT_MSIZEP));\n      cp_push(decl, CTINFO_REF(0), CTSIZE_PTR);\n    } else {\n      break;\n    }\n  }\n\n  if (cp_opt(cp, '(')) {  /* Inner declarator. */\n    CPDeclIdx pos;\n    cp_decl_attributes(cp, decl);\n    /* Resolve ambiguity between inner declarator and 1st function parameter. */\n    if ((decl->mode & CPARSE_MODE_ABSTRACT) &&\n\t(cp->tok == ')' || cp_istypedecl(cp))) goto func_decl;\n    pos = decl->pos;\n    cp_declarator(cp, decl);\n    cp_check(cp, ')');\n    decl->pos = pos;\n  } else if (cp->tok == CTOK_IDENT) {  /* Direct declarator. */\n    if (!(decl->mode & CPARSE_MODE_DIRECT)) cp_err_token(cp, CTOK_EOF);\n    decl->name = cp->str;\n    decl->nameid = cp->val.id;\n    cp_next(cp);\n  } else {  /* Abstract declarator. */\n    if (!(decl->mode & CPARSE_MODE_ABSTRACT)) cp_err_token(cp, CTOK_IDENT);\n  }\n\n  for (;;) {  /* Tail of declarator. */\n    if (cp_opt(cp, '[')) {  /* Array. */\n      cp_decl_array(cp, decl);\n    } else if (cp_opt(cp, '(')) {  /* Function. */\n    func_decl:\n      cp_decl_func(cp, decl);\n    } else {\n      break;\n    }\n  }\n\n  if ((decl->mode & CPARSE_MODE_FIELD) && cp_opt(cp, ':'))  /* Field width. */\n    decl->bits = cp_expr_ksize(cp);\n\n  /* Process postfix attributes. */\n  cp_decl_attributes(cp, decl);\n  cp_push_attributes(decl);\n\n  cp->depth--;\n}\n\n/* Parse an abstract type declaration and return it's C type ID. */\nstatic CTypeID cp_decl_abstract(CPState *cp)\n{\n  CPDecl decl;\n  cp_decl_spec(cp, &decl, 0);\n  decl.mode = CPARSE_MODE_ABSTRACT;\n  cp_declarator(cp, &decl);\n  return cp_decl_intern(cp, &decl);\n}\n\n/* Handle pragmas. */\nstatic void cp_pragma(CPState *cp, BCLine pragmaline)\n{\n  cp_next(cp);\n  if (cp->tok == CTOK_IDENT &&\n      cp->str->hash == H_(e79b999f,42ca3e85))  {  /* pack */\n    cp_next(cp);\n    cp_check(cp, '(');\n    if (cp->tok == CTOK_IDENT) {\n      if (cp->str->hash == H_(738e923c,a1b65954)) {  /* push */\n\tif (cp->curpack < CPARSE_MAX_PACKSTACK) {\n\t  cp->packstack[cp->curpack+1] = cp->packstack[cp->curpack];\n\t  cp->curpack++;\n\t}\n      } else if (cp->str->hash == H_(6c71cf27,6c71cf27)) {  /* pop */\n\tif (cp->curpack > 0) cp->curpack--;\n      } else {\n\tcp_errmsg(cp, cp->tok, LJ_ERR_XSYMBOL);\n      }\n      cp_next(cp);\n      if (!cp_opt(cp, ',')) goto end_pack;\n    }\n    if (cp->tok == CTOK_INTEGER) {\n      cp->packstack[cp->curpack] = cp->val.u32 ? lj_fls(cp->val.u32) : 0;\n      cp_next(cp);\n    } else {\n      cp->packstack[cp->curpack] = 255;\n    }\n  end_pack:\n    cp_check(cp, ')');\n  } else {  /* Ignore all other pragmas. */\n    while (cp->tok != CTOK_EOF && cp->linenumber == pragmaline)\n      cp_next(cp);\n  }\n}\n\n/* Parse multiple C declarations of types or extern identifiers. */\nstatic void cp_decl_multi(CPState *cp)\n{\n  int first = 1;\n  while (cp->tok != CTOK_EOF) {\n    CPDecl decl;\n    CPscl scl;\n    if (cp_opt(cp, ';')) {  /* Skip empty statements. */\n      first = 0;\n      continue;\n    }\n    if (cp->tok == '#') {  /* Workaround, since we have no preprocessor, yet. */\n      BCLine pragmaline = cp->linenumber;\n      if (!(cp_next(cp) == CTOK_IDENT &&\n\t    cp->str->hash == H_(f5e6b4f8,1d509107)))  /* pragma */\n\tcp_errmsg(cp, cp->tok, LJ_ERR_XSYMBOL);\n      cp_pragma(cp, pragmaline);\n      continue;\n    }\n    scl = cp_decl_spec(cp, &decl, CDF_TYPEDEF|CDF_EXTERN|CDF_STATIC);\n    if ((cp->tok == ';' || cp->tok == CTOK_EOF) &&\n\tctype_istypedef(decl.stack[0].info)) {\n      CTInfo info = ctype_rawchild(cp->cts, &decl.stack[0])->info;\n      if (ctype_isstruct(info) || ctype_isenum(info))\n\tgoto decl_end;  /* Accept empty declaration of struct/union/enum. */\n    }\n    for (;;) {\n      CTypeID ctypeid;\n      cp_declarator(cp, &decl);\n      ctypeid = cp_decl_intern(cp, &decl);\n      if (decl.name && !decl.nameid) {  /* NYI: redeclarations are ignored. */\n\tCType *ct;\n\tCTypeID id;\n\tif ((scl & CDF_TYPEDEF)) {  /* Create new typedef. */\n\t  id = lj_ctype_new(cp->cts, &ct);\n\t  ct->info = CTINFO(CT_TYPEDEF, ctypeid);\n\t  goto noredir;\n\t} else if (ctype_isfunc(ctype_get(cp->cts, ctypeid)->info)) {\n\t  /* Treat both static and extern function declarations as extern. */\n\t  ct = ctype_get(cp->cts, ctypeid);\n\t  /* We always get new anonymous functions (typedefs are copied). */\n\t  lua_assert(gcref(ct->name) == NULL);\n\t  id = ctypeid;  /* Just name it. */\n\t} else if ((scl & CDF_STATIC)) {  /* Accept static constants. */\n\t  id = cp_decl_constinit(cp, &ct, ctypeid);\n\t  goto noredir;\n\t} else {  /* External references have extern or no storage class. */\n\t  id = lj_ctype_new(cp->cts, &ct);\n\t  ct->info = CTINFO(CT_EXTERN, ctypeid);\n\t}\n\tif (decl.redir) {  /* Add attribute for redirected symbol name. */\n\t  CType *cta;\n\t  CTypeID aid = lj_ctype_new(cp->cts, &cta);\n\t  ct = ctype_get(cp->cts, id);  /* Table may have been reallocated. */\n\t  cta->info = CTINFO(CT_ATTRIB, CTATTRIB(CTA_REDIR));\n\t  cta->sib = ct->sib;\n\t  ct->sib = aid;\n\t  ctype_setname(cta, decl.redir);\n\t}\n      noredir:\n\tctype_setname(ct, decl.name);\n\tlj_ctype_addname(cp->cts, ct, id);\n      }\n      if (!cp_opt(cp, ',')) break;\n      cp_decl_reset(&decl);\n    }\n  decl_end:\n    if (cp->tok == CTOK_EOF && first) break;  /* May omit ';' for 1 decl. */\n    first = 0;\n    cp_check(cp, ';');\n  }\n}\n\n/* Parse a single C type declaration. */\nstatic void cp_decl_single(CPState *cp)\n{\n  CPDecl decl;\n  cp_decl_spec(cp, &decl, 0);\n  cp_declarator(cp, &decl);\n  cp->val.id = cp_decl_intern(cp, &decl);\n  if (cp->tok != CTOK_EOF) cp_err_token(cp, CTOK_EOF);\n}\n\n#undef H_\n\n/* ------------------------------------------------------------------------ */\n\n/* Protected callback for C parser. */\nstatic TValue *cpcparser(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  CPState *cp = (CPState *)ud;\n  UNUSED(dummy);\n  cframe_errfunc(L->cframe) = -1;  /* Inherit error function. */\n  cp_init(cp);\n  if ((cp->mode & CPARSE_MODE_MULTI))\n    cp_decl_multi(cp);\n  else\n    cp_decl_single(cp);\n  if (cp->param && cp->param != cp->L->top)\n    cp_err(cp, LJ_ERR_FFI_NUMPARAM);\n  lua_assert(cp->depth == 0);\n  return NULL;\n}\n\n/* C parser. */\nint lj_cparse(CPState *cp)\n{\n  LJ_CTYPE_SAVE(cp->cts);\n  int errcode = lj_vm_cpcall(cp->L, NULL, cp, cpcparser);\n  if (errcode)\n    LJ_CTYPE_RESTORE(cp->cts);\n  cp_cleanup(cp);\n  return errcode;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_cparse.h",
    "content": "/*\n** C declaration parser.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CPARSE_H\n#define _LJ_CPARSE_H\n\n#include \"lj_obj.h\"\n#include \"lj_ctype.h\"\n\n#if LJ_HASFFI\n\n/* C parser limits. */\n#define CPARSE_MAX_BUF\t\t32768\t/* Max. token buffer size. */\n#define CPARSE_MAX_DECLSTACK\t100\t/* Max. declaration stack depth. */\n#define CPARSE_MAX_DECLDEPTH\t20\t/* Max. recursive declaration depth. */\n#define CPARSE_MAX_PACKSTACK\t7\t/* Max. pack pragma stack depth. */\n\n/* Flags for C parser mode. */\n#define CPARSE_MODE_MULTI\t1\t/* Process multiple declarations. */\n#define CPARSE_MODE_ABSTRACT\t2\t/* Accept abstract declarators. */\n#define CPARSE_MODE_DIRECT\t4\t/* Accept direct declarators. */\n#define CPARSE_MODE_FIELD\t8\t/* Accept field width in bits, too. */\n#define CPARSE_MODE_NOIMPLICIT\t16\t/* Reject implicit declarations. */\n#define CPARSE_MODE_SKIP\t32\t/* Skip definitions, ignore errors. */\n\ntypedef int CPChar;\t/* C parser character. Unsigned ext. from char. */\ntypedef int CPToken;\t/* C parser token. */\n\n/* C parser internal value representation. */\ntypedef struct CPValue {\n  union {\n    int32_t i32;\t/* Value for CTID_INT32. */\n    uint32_t u32;\t/* Value for CTID_UINT32. */\n  };\n  CTypeID id;\t\t/* C Type ID of the value. */\n} CPValue;\n\n/* C parser state. */\ntypedef struct CPState {\n  CPChar c;\t\t/* Current character. */\n  CPToken tok;\t\t/* Current token. */\n  CPValue val;\t\t/* Token value. */\n  GCstr *str;\t\t/* Interned string of identifier/keyword. */\n  CType *ct;\t\t/* C type table entry. */\n  const char *p;\t/* Current position in input buffer. */\n  SBuf sb;\t\t/* String buffer for tokens. */\n  lua_State *L;\t\t/* Lua state. */\n  CTState *cts;\t\t/* C type state. */\n  TValue *param;\t/* C type parameters. */\n  const char *srcname;\t/* Current source name. */\n  BCLine linenumber;\t/* Input line counter. */\n  int depth;\t\t/* Recursive declaration depth. */\n  uint32_t tmask;\t/* Type mask for next identifier. */\n  uint32_t mode;\t/* C parser mode. */\n  uint8_t packstack[CPARSE_MAX_PACKSTACK];  /* Stack for pack pragmas. */\n  uint8_t curpack;\t/* Current position in pack pragma stack. */\n} CPState;\n\nLJ_FUNC int lj_cparse(CPState *cp);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_crecord.c",
    "content": "/*\n** Trace recorder for C data operations.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_ffrecord_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT && LJ_HASFFI\n\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_frame.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cdata.h\"\n#include \"lj_cparse.h\"\n#include \"lj_cconv.h\"\n#include \"lj_clib.h\"\n#include \"lj_ccall.h\"\n#include \"lj_ff.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_ircall.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#include \"lj_record.h\"\n#include \"lj_ffrecord.h\"\n#include \"lj_snap.h\"\n#include \"lj_crecord.h\"\n#include \"lj_dispatch.h\"\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t\t(&J->cur.ir[(ref)])\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n#define emitconv(a, dt, st, flags) \\\n  emitir(IRT(IR_CONV, (dt)), (a), (st)|((dt) << 5)|(flags))\n\n/* -- C type checks ------------------------------------------------------- */\n\nstatic GCcdata *argv2cdata(jit_State *J, TRef tr, cTValue *o)\n{\n  GCcdata *cd;\n  TRef trtypeid;\n  if (!tref_iscdata(tr))\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  cd = cdataV(o);\n  /* Specialize to the CTypeID. */\n  trtypeid = emitir(IRT(IR_FLOAD, IRT_U16), tr, IRFL_CDATA_CTYPEID);\n  emitir(IRTG(IR_EQ, IRT_INT), trtypeid, lj_ir_kint(J, (int32_t)cd->ctypeid));\n  return cd;\n}\n\n/* Specialize to the CTypeID held by a cdata constructor. */\nstatic CTypeID crec_constructor(jit_State *J, GCcdata *cd, TRef tr)\n{\n  CTypeID id;\n  lua_assert(tref_iscdata(tr) && cd->ctypeid == CTID_CTYPEID);\n  id = *(CTypeID *)cdataptr(cd);\n  tr = emitir(IRT(IR_FLOAD, IRT_INT), tr, IRFL_CDATA_INT);\n  emitir(IRTG(IR_EQ, IRT_INT), tr, lj_ir_kint(J, (int32_t)id));\n  return id;\n}\n\nstatic CTypeID argv2ctype(jit_State *J, TRef tr, cTValue *o)\n{\n  if (tref_isstr(tr)) {\n    GCstr *s = strV(o);\n    CPState cp;\n    CTypeID oldtop;\n    /* Specialize to the string containing the C type declaration. */\n    emitir(IRTG(IR_EQ, IRT_STR), tr, lj_ir_kstr(J, s));\n    cp.L = J->L;\n    cp.cts = ctype_ctsG(J2G(J));\n    oldtop = cp.cts->top;\n    cp.srcname = strdata(s);\n    cp.p = strdata(s);\n    cp.param = NULL;\n    cp.mode = CPARSE_MODE_ABSTRACT|CPARSE_MODE_NOIMPLICIT;\n    if (lj_cparse(&cp) || cp.cts->top > oldtop)  /* Avoid new struct defs. */\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n    return cp.val.id;\n  } else {\n    GCcdata *cd = argv2cdata(J, tr, o);\n    return cd->ctypeid == CTID_CTYPEID ? crec_constructor(J, cd, tr) :\n\t\t\t\t\tcd->ctypeid;\n  }\n}\n\n/* Convert CType to IRType (if possible). */\nstatic IRType crec_ct2irt(CTState *cts, CType *ct)\n{\n  if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);\n  if (LJ_LIKELY(ctype_isnum(ct->info))) {\n    if ((ct->info & CTF_FP)) {\n      if (ct->size == sizeof(double))\n\treturn IRT_NUM;\n      else if (ct->size == sizeof(float))\n\treturn IRT_FLOAT;\n    } else {\n      uint32_t b = lj_fls(ct->size);\n      if (b <= 3)\n\treturn IRT_I8 + 2*b + ((ct->info & CTF_UNSIGNED) ? 1 : 0);\n    }\n  } else if (ctype_isptr(ct->info)) {\n    return (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32;\n  } else if (ctype_iscomplex(ct->info)) {\n    if (ct->size == 2*sizeof(double))\n      return IRT_NUM;\n    else if (ct->size == 2*sizeof(float))\n      return IRT_FLOAT;\n  }\n  return IRT_CDATA;\n}\n\n/* -- Optimized memory fill and copy -------------------------------------- */\n\n/* Maximum length and unroll of inlined copy/fill. */\n#define CREC_COPY_MAXUNROLL\t\t16\n#define CREC_COPY_MAXLEN\t\t128\n\n#define CREC_FILL_MAXUNROLL\t\t16\n#if LJ_TARGET_UNALIGNED\n#define CREC_FILL_MAXLEN\t\t(CTSIZE_PTR * CREC_FILL_MAXUNROLL)\n#else\n#define CREC_FILL_MAXLEN\t\tCREC_FILL_MAXUNROLL\n#endif\n\n/* Number of windowed registers used for optimized memory copy. */\n#if LJ_TARGET_X86\n#define CREC_COPY_REGWIN\t\t2\n#elif LJ_TARGET_PPC || LJ_TARGET_MIPS\n#define CREC_COPY_REGWIN\t\t8\n#else\n#define CREC_COPY_REGWIN\t\t4\n#endif\n\n/* List of memory offsets for copy/fill. */\ntypedef struct CRecMemList {\n  CTSize ofs;\t\t/* Offset in bytes. */\n  IRType tp;\t\t/* Type of load/store. */\n  TRef trofs;\t\t/* TRef of interned offset. */\n  TRef trval;\t\t/* TRef of load value. */\n} CRecMemList;\n\n/* Generate copy list for element-wise struct copy. */\nstatic MSize crec_copy_struct(CRecMemList *ml, CTState *cts, CType *ct)\n{\n  CTypeID fid = ct->sib;\n  MSize mlp = 0;\n  while (fid) {\n    CType *df = ctype_get(cts, fid);\n    fid = df->sib;\n    if (ctype_isfield(df->info)) {\n      CType *cct;\n      IRType tp;\n      if (!gcref(df->name)) continue;  /* Ignore unnamed fields. */\n      cct = ctype_rawchild(cts, df);  /* Field type. */\n      tp = crec_ct2irt(cts, cct);\n      if (tp == IRT_CDATA) return 0;  /* NYI: aggregates. */\n      if (mlp >= CREC_COPY_MAXUNROLL) return 0;\n      ml[mlp].ofs = df->size;\n      ml[mlp].tp = tp;\n      mlp++;\n      if (ctype_iscomplex(cct->info)) {\n\tif (mlp >= CREC_COPY_MAXUNROLL) return 0;\n\tml[mlp].ofs = df->size + (cct->size >> 1);\n\tml[mlp].tp = tp;\n\tmlp++;\n      }\n    } else if (!ctype_isconstval(df->info)) {\n      /* NYI: bitfields and sub-structures. */\n      return 0;\n    }\n  }\n  return mlp;\n}\n\n/* Generate unrolled copy list, from highest to lowest step size/alignment. */\nstatic MSize crec_copy_unroll(CRecMemList *ml, CTSize len, CTSize step,\n\t\t\t      IRType tp)\n{\n  CTSize ofs = 0;\n  MSize mlp = 0;\n  if (tp == IRT_CDATA) tp = IRT_U8 + 2*lj_fls(step);\n  do {\n    while (ofs + step <= len) {\n      if (mlp >= CREC_COPY_MAXUNROLL) return 0;\n      ml[mlp].ofs = ofs;\n      ml[mlp].tp = tp;\n      mlp++;\n      ofs += step;\n    }\n    step >>= 1;\n    tp -= 2;\n  } while (ofs < len);\n  return mlp;\n}\n\n/*\n** Emit copy list with windowed loads/stores.\n** LJ_TARGET_UNALIGNED: may emit unaligned loads/stores (not marked as such).\n*/\nstatic void crec_copy_emit(jit_State *J, CRecMemList *ml, MSize mlp,\n\t\t\t   TRef trdst, TRef trsrc)\n{\n  MSize i, j, rwin = 0;\n  for (i = 0, j = 0; i < mlp; ) {\n    TRef trofs = lj_ir_kintp(J, ml[i].ofs);\n    TRef trsptr = emitir(IRT(IR_ADD, IRT_PTR), trsrc, trofs);\n    ml[i].trval = emitir(IRT(IR_XLOAD, ml[i].tp), trsptr, 0);\n    ml[i].trofs = trofs;\n    i++;\n    rwin += (LJ_SOFTFP && ml[i].tp == IRT_NUM) ? 2 : 1;\n    if (rwin >= CREC_COPY_REGWIN || i >= mlp) {  /* Flush buffered stores. */\n      rwin = 0;\n      for ( ; j < i; j++) {\n\tTRef trdptr = emitir(IRT(IR_ADD, IRT_PTR), trdst, ml[j].trofs);\n\temitir(IRT(IR_XSTORE, ml[j].tp), trdptr, ml[j].trval);\n      }\n    }\n  }\n}\n\n/* Optimized memory copy. */\nstatic void crec_copy(jit_State *J, TRef trdst, TRef trsrc, TRef trlen,\n\t\t      CType *ct)\n{\n  if (tref_isk(trlen)) {  /* Length must be constant. */\n    CRecMemList ml[CREC_COPY_MAXUNROLL];\n    MSize mlp = 0;\n    CTSize step = 1, len = (CTSize)IR(tref_ref(trlen))->i;\n    IRType tp = IRT_CDATA;\n    int needxbar = 0;\n    if (len == 0) return;  /* Shortcut. */\n    if (len > CREC_COPY_MAXLEN) goto fallback;\n    if (ct) {\n      CTState *cts = ctype_ctsG(J2G(J));\n      lua_assert(ctype_isarray(ct->info) || ctype_isstruct(ct->info));\n      if (ctype_isarray(ct->info)) {\n\tCType *cct = ctype_rawchild(cts, ct);\n\ttp = crec_ct2irt(cts, cct);\n\tif (tp == IRT_CDATA) goto rawcopy;\n\tstep = lj_ir_type_size[tp];\n\tlua_assert((len & (step-1)) == 0);\n      } else if ((ct->info & CTF_UNION)) {\n\tstep = (1u << ctype_align(ct->info));\n\tgoto rawcopy;\n      } else {\n\tmlp = crec_copy_struct(ml, cts, ct);\n\tgoto emitcopy;\n      }\n    } else {\n    rawcopy:\n      needxbar = 1;\n      if (LJ_TARGET_UNALIGNED || step >= CTSIZE_PTR)\n\tstep = CTSIZE_PTR;\n    }\n    mlp = crec_copy_unroll(ml, len, step, tp);\n  emitcopy:\n    if (mlp) {\n      crec_copy_emit(J, ml, mlp, trdst, trsrc);\n      if (needxbar)\n\temitir(IRT(IR_XBAR, IRT_NIL), 0, 0);\n      return;\n    }\n  }\nfallback:\n  /* Call memcpy. Always needs a barrier to disable alias analysis. */\n  lj_ir_call(J, IRCALL_memcpy, trdst, trsrc, trlen);\n  emitir(IRT(IR_XBAR, IRT_NIL), 0, 0);\n}\n\n/* Generate unrolled fill list, from highest to lowest step size/alignment. */\nstatic MSize crec_fill_unroll(CRecMemList *ml, CTSize len, CTSize step)\n{\n  CTSize ofs = 0;\n  MSize mlp = 0;\n  IRType tp = IRT_U8 + 2*lj_fls(step);\n  do {\n    while (ofs + step <= len) {\n      if (mlp >= CREC_COPY_MAXUNROLL) return 0;\n      ml[mlp].ofs = ofs;\n      ml[mlp].tp = tp;\n      mlp++;\n      ofs += step;\n    }\n    step >>= 1;\n    tp -= 2;\n  } while (ofs < len);\n  return mlp;\n}\n\n/*\n** Emit stores for fill list.\n** LJ_TARGET_UNALIGNED: may emit unaligned stores (not marked as such).\n*/\nstatic void crec_fill_emit(jit_State *J, CRecMemList *ml, MSize mlp,\n\t\t\t   TRef trdst, TRef trfill)\n{\n  MSize i;\n  for (i = 0; i < mlp; i++) {\n    TRef trofs = lj_ir_kintp(J, ml[i].ofs);\n    TRef trdptr = emitir(IRT(IR_ADD, IRT_PTR), trdst, trofs);\n    emitir(IRT(IR_XSTORE, ml[i].tp), trdptr, trfill);\n  }\n}\n\n/* Optimized memory fill. */\nstatic void crec_fill(jit_State *J, TRef trdst, TRef trlen, TRef trfill,\n\t\t      CTSize step)\n{\n  if (tref_isk(trlen)) {  /* Length must be constant. */\n    CRecMemList ml[CREC_FILL_MAXUNROLL];\n    MSize mlp;\n    CTSize len = (CTSize)IR(tref_ref(trlen))->i;\n    if (len == 0) return;  /* Shortcut. */\n    if (len > CREC_FILL_MAXLEN) goto fallback;\n    if (LJ_TARGET_UNALIGNED || step >= CTSIZE_PTR)\n      step = CTSIZE_PTR;\n    mlp = crec_fill_unroll(ml, len, step);\n    if (!mlp) goto fallback;\n    if (tref_isk(trfill) || ml[0].tp != IRT_U8)\n      trfill = emitconv(trfill, IRT_INT, IRT_U8, 0);\n    if (ml[0].tp != IRT_U8) {  /* Scatter U8 to U16/U32/U64. */\n      if (CTSIZE_PTR == 8 && ml[0].tp == IRT_U64) {\n\tif (tref_isk(trfill))  /* Pointless on x64 with zero-extended regs. */\n\t  trfill = emitconv(trfill, IRT_U64, IRT_U32, 0);\n\ttrfill = emitir(IRT(IR_MUL, IRT_U64), trfill,\n\t\t\tlj_ir_kint64(J, U64x(01010101,01010101)));\n      } else {\n\ttrfill = emitir(IRTI(IR_MUL), trfill,\n\t\t   lj_ir_kint(J, ml[0].tp == IRT_U16 ? 0x0101 : 0x01010101));\n      }\n    }\n    crec_fill_emit(J, ml, mlp, trdst, trfill);\n  } else {\nfallback:\n    /* Call memset. Always needs a barrier to disable alias analysis. */\n    lj_ir_call(J, IRCALL_memset, trdst, trfill, trlen);  /* Note: arg order! */\n  }\n  emitir(IRT(IR_XBAR, IRT_NIL), 0, 0);\n}\n\n/* -- Convert C type to C type -------------------------------------------- */\n\n/*\n** This code mirrors the code in lj_cconv.c. It performs the same steps\n** for the trace recorder that lj_cconv.c does for the interpreter.\n**\n** One major difference is that we can get away with much fewer checks\n** here. E.g. checks for casts, constness or correct types can often be\n** omitted, even if they might fail. The interpreter subsequently throws\n** an error, which aborts the trace.\n**\n** All operations are specialized to their C types, so the on-trace\n** outcome must be the same as the outcome in the interpreter. If the\n** interpreter doesn't throw an error, then the trace is correct, too.\n** Care must be taken not to generate invalid (temporary) IR or to\n** trigger asserts.\n*/\n\n/* Determine whether a passed number or cdata number is non-zero. */\nstatic int crec_isnonzero(CType *s, void *p)\n{\n  if (p == (void *)0)\n    return 0;\n  if (p == (void *)1)\n    return 1;\n  if ((s->info & CTF_FP)) {\n    if (s->size == sizeof(float))\n      return (*(float *)p != 0);\n    else\n      return (*(double *)p != 0);\n  } else {\n    if (s->size == 1)\n      return (*(uint8_t *)p != 0);\n    else if (s->size == 2)\n      return (*(uint16_t *)p != 0);\n    else if (s->size == 4)\n      return (*(uint32_t *)p != 0);\n    else\n      return (*(uint64_t *)p != 0);\n  }\n}\n\nstatic TRef crec_ct_ct(jit_State *J, CType *d, CType *s, TRef dp, TRef sp,\n\t\t       void *svisnz)\n{\n  IRType dt = crec_ct2irt(ctype_ctsG(J2G(J)), d);\n  IRType st = crec_ct2irt(ctype_ctsG(J2G(J)), s);\n  CTSize dsize = d->size, ssize = s->size;\n  CTInfo dinfo = d->info, sinfo = s->info;\n\n  if (ctype_type(dinfo) > CT_MAYCONVERT || ctype_type(sinfo) > CT_MAYCONVERT)\n    goto err_conv;\n\n  /*\n  ** Note: Unlike lj_cconv_ct_ct(), sp holds the _value_ of pointers and\n  ** numbers up to 8 bytes. Otherwise sp holds a pointer.\n  */\n\n  switch (cconv_idx2(dinfo, sinfo)) {\n  /* Destination is a bool. */\n  case CCX(B, B):\n    goto xstore;  /* Source operand is already normalized. */\n  case CCX(B, I):\n  case CCX(B, F):\n    if (st != IRT_CDATA) {\n      /* Specialize to the result of a comparison against 0. */\n      TRef zero = (st == IRT_NUM  || st == IRT_FLOAT) ? lj_ir_knum(J, 0) :\n\t\t  (st == IRT_I64 || st == IRT_U64) ? lj_ir_kint64(J, 0) :\n\t\t  lj_ir_kint(J, 0);\n      int isnz = crec_isnonzero(s, svisnz);\n      emitir(IRTG(isnz ? IR_NE : IR_EQ, st), sp, zero);\n      sp = lj_ir_kint(J, isnz);\n      goto xstore;\n    }\n    goto err_nyi;\n\n  /* Destination is an integer. */\n  case CCX(I, B):\n  case CCX(I, I):\n  conv_I_I:\n    if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi;\n    /* Extend 32 to 64 bit integer. */\n    if (dsize == 8 && ssize < 8 && !(LJ_64 && (sinfo & CTF_UNSIGNED)))\n      sp = emitconv(sp, dt, ssize < 4 ? IRT_INT : st,\n\t\t    (sinfo & CTF_UNSIGNED) ? 0 : IRCONV_SEXT);\n    else if (dsize < 8 && ssize == 8)  /* Truncate from 64 bit integer. */\n      sp = emitconv(sp, dsize < 4 ? IRT_INT : dt, st, 0);\n    else if (st == IRT_INT)\n      sp = lj_opt_narrow_toint(J, sp);\n  xstore:\n    if (dt == IRT_I64 || dt == IRT_U64) lj_needsplit(J);\n    if (dp == 0) return sp;\n    emitir(IRT(IR_XSTORE, dt), dp, sp);\n    break;\n  case CCX(I, C):\n    sp = emitir(IRT(IR_XLOAD, st), sp, 0);  /* Load re. */\n    /* fallthrough */\n  case CCX(I, F):\n    if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi;\n    sp = emitconv(sp, dsize < 4 ? IRT_INT : dt, st, IRCONV_TRUNC|IRCONV_ANY);\n    goto xstore;\n  case CCX(I, P):\n  case CCX(I, A):\n    sinfo = CTINFO(CT_NUM, CTF_UNSIGNED);\n    ssize = CTSIZE_PTR;\n    st = IRT_UINTP;\n    goto conv_I_I;\n\n  /* Destination is a floating-point number. */\n  case CCX(F, B):\n  case CCX(F, I):\n  conv_F_I:\n    if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi;\n    sp = emitconv(sp, dt, ssize < 4 ? IRT_INT : st, 0);\n    goto xstore;\n  case CCX(F, C):\n    sp = emitir(IRT(IR_XLOAD, st), sp, 0);  /* Load re. */\n    /* fallthrough */\n  case CCX(F, F):\n  conv_F_F:\n    if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi;\n    if (dt != st) sp = emitconv(sp, dt, st, 0);\n    goto xstore;\n\n  /* Destination is a complex number. */\n  case CCX(C, I):\n  case CCX(C, F):\n    {  /* Clear im. */\n      TRef ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, (dsize >> 1)));\n      emitir(IRT(IR_XSTORE, dt), ptr, lj_ir_knum(J, 0));\n    }\n    /* Convert to re. */\n    if ((sinfo & CTF_FP)) goto conv_F_F; else goto conv_F_I;\n\n  case CCX(C, C):\n    if (dt == IRT_CDATA || st == IRT_CDATA) goto err_nyi;\n    {\n      TRef re, im, ptr;\n      re = emitir(IRT(IR_XLOAD, st), sp, 0);\n      ptr = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, (ssize >> 1)));\n      im = emitir(IRT(IR_XLOAD, st), ptr, 0);\n      if (dt != st) {\n\tre = emitconv(re, dt, st, 0);\n\tim = emitconv(im, dt, st, 0);\n      }\n      emitir(IRT(IR_XSTORE, dt), dp, re);\n      ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, (dsize >> 1)));\n      emitir(IRT(IR_XSTORE, dt), ptr, im);\n    }\n    break;\n\n  /* Destination is a vector. */\n  case CCX(V, I):\n  case CCX(V, F):\n  case CCX(V, C):\n  case CCX(V, V):\n    goto err_nyi;\n\n  /* Destination is a pointer. */\n  case CCX(P, P):\n  case CCX(P, A):\n  case CCX(P, S):\n    /* There are only 32 bit pointers/addresses on 32 bit machines.\n    ** Also ok on x64, since all 32 bit ops clear the upper part of the reg.\n    */\n    goto xstore;\n  case CCX(P, I):\n    if (st == IRT_CDATA) goto err_nyi;\n    if (!LJ_64 && ssize == 8)  /* Truncate from 64 bit integer. */\n      sp = emitconv(sp, IRT_U32, st, 0);\n    goto xstore;\n  case CCX(P, F):\n    if (st == IRT_CDATA) goto err_nyi;\n    /* The signed conversion is cheaper. x64 really has 47 bit pointers. */\n    sp = emitconv(sp, (LJ_64 && dsize == 8) ? IRT_I64 : IRT_U32,\n\t\t  st, IRCONV_TRUNC|IRCONV_ANY);\n    goto xstore;\n\n  /* Destination is an array. */\n  case CCX(A, A):\n  /* Destination is a struct/union. */\n  case CCX(S, S):\n    if (dp == 0) goto err_conv;\n    crec_copy(J, dp, sp, lj_ir_kint(J, dsize), d);\n    break;\n\n  default:\n  err_conv:\n  err_nyi:\n    lj_trace_err(J, LJ_TRERR_NYICONV);\n    break;\n  }\n  return 0;\n}\n\n/* -- Convert C type to TValue (load) ------------------------------------- */\n\nstatic TRef crec_tv_ct(jit_State *J, CType *s, CTypeID sid, TRef sp)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  IRType t = crec_ct2irt(cts, s);\n  CTInfo sinfo = s->info;\n  if (ctype_isnum(sinfo)) {\n    TRef tr;\n    if (t == IRT_CDATA)\n      goto err_nyi;  /* NYI: copyval of >64 bit integers. */\n    tr = emitir(IRT(IR_XLOAD, t), sp, 0);\n    if (t == IRT_FLOAT || t == IRT_U32) {  /* Keep uint32_t/float as numbers. */\n      return emitconv(tr, IRT_NUM, t, 0);\n    } else if (t == IRT_I64 || t == IRT_U64) {  /* Box 64 bit integer. */\n      sp = tr;\n      lj_needsplit(J);\n    } else if ((sinfo & CTF_BOOL)) {\n      /* Assume not equal to zero. Fixup and emit pending guard later. */\n      lj_ir_set(J, IRTGI(IR_NE), tr, lj_ir_kint(J, 0));\n      J->postproc = LJ_POST_FIXGUARD;\n      return TREF_TRUE;\n    } else {\n      return tr;\n    }\n  } else if (ctype_isptr(sinfo) || ctype_isenum(sinfo)) {\n    sp = emitir(IRT(IR_XLOAD, t), sp, 0);  /* Box pointers and enums. */\n  } else if (ctype_isrefarray(sinfo) || ctype_isstruct(sinfo)) {\n    cts->L = J->L;\n    sid = lj_ctype_intern(cts, CTINFO_REF(sid), CTSIZE_PTR);  /* Create ref. */\n  } else if (ctype_iscomplex(sinfo)) {  /* Unbox/box complex. */\n    ptrdiff_t esz = (ptrdiff_t)(s->size >> 1);\n    TRef ptr, tr1, tr2, dp;\n    dp = emitir(IRTG(IR_CNEW, IRT_CDATA), lj_ir_kint(J, sid), TREF_NIL);\n    tr1 = emitir(IRT(IR_XLOAD, t), sp, 0);\n    ptr = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, esz));\n    tr2 = emitir(IRT(IR_XLOAD, t), ptr, 0);\n    ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, sizeof(GCcdata)));\n    emitir(IRT(IR_XSTORE, t), ptr, tr1);\n    ptr = emitir(IRT(IR_ADD, IRT_PTR), dp, lj_ir_kintp(J, sizeof(GCcdata)+esz));\n    emitir(IRT(IR_XSTORE, t), ptr, tr2);\n    return dp;\n  } else {\n    /* NYI: copyval of vectors. */\n  err_nyi:\n    lj_trace_err(J, LJ_TRERR_NYICONV);\n  }\n  /* Box pointer, ref, enum or 64 bit integer. */\n  return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, sid), sp);\n}\n\n/* -- Convert TValue to C type (store) ------------------------------------ */\n\nstatic TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  CTypeID sid = CTID_P_VOID;\n  void *svisnz = 0;\n  CType *s;\n  if (LJ_LIKELY(tref_isinteger(sp))) {\n    sid = CTID_INT32;\n    svisnz = (void *)(intptr_t)(tvisint(sval)?(intV(sval)!=0):!tviszero(sval));\n  } else if (tref_isnum(sp)) {\n    sid = CTID_DOUBLE;\n    svisnz = (void *)(intptr_t)(tvisint(sval)?(intV(sval)!=0):!tviszero(sval));\n  } else if (tref_isbool(sp)) {\n    sp = lj_ir_kint(J, tref_istrue(sp) ? 1 : 0);\n    sid = CTID_BOOL;\n  } else if (tref_isnil(sp)) {\n    sp = lj_ir_kptr(J, NULL);\n  } else if (tref_isudata(sp)) {\n    GCudata *ud = udataV(sval);\n    if (ud->udtype == UDTYPE_IO_FILE) {\n      TRef tr = emitir(IRT(IR_FLOAD, IRT_U8), sp, IRFL_UDATA_UDTYPE);\n      emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, UDTYPE_IO_FILE));\n      sp = emitir(IRT(IR_FLOAD, IRT_PTR), sp, IRFL_UDATA_FILE);\n    } else {\n      sp = emitir(IRT(IR_ADD, IRT_P32), sp, lj_ir_kint(J, sizeof(GCudata)));\n    }\n  } else if (tref_isstr(sp)) {\n    if (ctype_isenum(d->info)) {  /* Match string against enum constant. */\n      GCstr *str = strV(sval);\n      CTSize ofs;\n      CType *cct = lj_ctype_getfield(cts, d, str, &ofs);\n      /* Specialize to the name of the enum constant. */\n      emitir(IRTG(IR_EQ, IRT_STR), sp, lj_ir_kstr(J, str));\n      if (cct && ctype_isconstval(cct->info)) {\n\tlua_assert(ctype_child(cts, cct)->size == 4);\n\tsvisnz = (void *)(intptr_t)(ofs != 0);\n\tsp = lj_ir_kint(J, (int32_t)ofs);\n\tsid = ctype_cid(cct->info);\n      }  /* else: interpreter will throw. */\n    } else if (ctype_isrefarray(d->info)) {  /* Copy string to array. */\n      lj_trace_err(J, LJ_TRERR_BADTYPE);  /* NYI */\n    } else {  /* Otherwise pass the string data as a const char[]. */\n      sp = emitir(IRT(IR_STRREF, IRT_P32), sp, lj_ir_kint(J, 0));\n      sid = CTID_A_CCHAR;\n    }\n  } else {  /* NYI: tref_istab(sp), tref_islightud(sp). */\n    IRType t;\n    sid = argv2cdata(J, sp, sval)->ctypeid;\n    s = ctype_raw(cts, sid);\n    svisnz = cdataptr(cdataV(sval));\n    t = crec_ct2irt(cts, s);\n    if (ctype_isptr(s->info)) {\n      sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_PTR);\n      if (ctype_isref(s->info)) {\n\tsvisnz = *(void **)svisnz;\n\ts = ctype_rawchild(cts, s);\n\tif (ctype_isenum(s->info)) s = ctype_child(cts, s);\n\tt = crec_ct2irt(cts, s);\n      } else {\n\tgoto doconv;\n      }\n    } else if (t == IRT_I64 || t == IRT_U64) {\n      sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_INT64);\n      lj_needsplit(J);\n      goto doconv;\n    } else if (t == IRT_INT || t == IRT_U32) {\n      if (ctype_isenum(s->info)) s = ctype_child(cts, s);\n      sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_INT);\n      goto doconv;\n    } else {\n      sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCcdata)));\n    }\n    if (ctype_isnum(s->info) && t != IRT_CDATA)\n      sp = emitir(IRT(IR_XLOAD, t), sp, 0);  /* Load number value. */\n    goto doconv;\n  }\n  s = ctype_get(cts, sid);\ndoconv:\n  if (ctype_isenum(d->info)) d = ctype_child(cts, d);\n  return crec_ct_ct(J, d, s, dp, sp, svisnz);\n}\n\n/* -- C data metamethods -------------------------------------------------- */\n\n/* This would be rather difficult in FOLD, so do it here:\n** (base+k)+(idx*sz)+ofs ==> (base+idx*sz)+(ofs+k)\n** (base+(idx+k)*sz)+ofs ==> (base+idx*sz)+(ofs+k*sz)\n*/\nstatic TRef crec_reassoc_ofs(jit_State *J, TRef tr, ptrdiff_t *ofsp, MSize sz)\n{\n  IRIns *ir = IR(tref_ref(tr));\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && irref_isk(ir->op2) &&\n      (ir->o == IR_ADD || ir->o == IR_ADDOV || ir->o == IR_SUBOV)) {\n    IRIns *irk = IR(ir->op2);\n    ptrdiff_t k;\n    if (LJ_64 && irk->o == IR_KINT64)\n      k = (ptrdiff_t)ir_kint64(irk)->u64 * sz;\n    else\n      k = (ptrdiff_t)irk->i * sz;\n    if (ir->o == IR_SUBOV) *ofsp -= k; else *ofsp += k;\n    tr = ir->op1;  /* Not a TRef, but the caller doesn't care. */\n  }\n  return tr;\n}\n\n/* Record ctype __index/__newindex metamethods. */\nstatic void crec_index_meta(jit_State *J, CTState *cts, CType *ct,\n\t\t\t    RecordFFData *rd)\n{\n  CTypeID id = ctype_typeid(cts, ct);\n  cTValue *tv = lj_ctype_meta(cts, id, rd->data ? MM_newindex : MM_index);\n  if (!tv)\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  if (tvisfunc(tv)) {\n    J->base[-1] = lj_ir_kfunc(J, funcV(tv)) | TREF_FRAME;\n    rd->nres = -1;  /* Pending tailcall. */\n  } else if (rd->data == 0 && tvistab(tv) && tref_isstr(J->base[1])) {\n    /* Specialize to result of __index lookup. */\n    cTValue *o = lj_tab_get(J->L, tabV(tv), &rd->argv[1]);\n    J->base[0] = lj_record_constify(J, o);\n    if (!J->base[0])\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n    /* Always specialize to the key. */\n    emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1])));\n  } else {\n    /* NYI: resolving of non-function metamethods. */\n    /* NYI: non-string keys for __index table. */\n    /* NYI: stores to __newindex table. */\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  }\n}\n\nvoid LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd)\n{\n  TRef idx, ptr = J->base[0];\n  ptrdiff_t ofs = sizeof(GCcdata);\n  GCcdata *cd = argv2cdata(J, ptr, &rd->argv[0]);\n  CTState *cts = ctype_ctsG(J2G(J));\n  CType *ct = ctype_raw(cts, cd->ctypeid);\n  CTypeID sid = 0;\n\n  /* Resolve pointer or reference for cdata object. */\n  if (ctype_isptr(ct->info)) {\n    IRType t = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32;\n    if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct);\n    ptr = emitir(IRT(IR_FLOAD, t), ptr, IRFL_CDATA_PTR);\n    ofs = 0;\n    ptr = crec_reassoc_ofs(J, ptr, &ofs, 1);\n  }\n\nagain:\n  idx = J->base[1];\n  if (tref_isnumber(idx)) {\n    idx = lj_opt_narrow_cindex(J, idx);\n    if (ctype_ispointer(ct->info)) {\n      CTSize sz;\n  integer_key:\n      if ((ct->info & CTF_COMPLEX))\n\tidx = emitir(IRT(IR_BAND, IRT_INTP), idx, lj_ir_kintp(J, 1));\n      sz = lj_ctype_size(cts, (sid = ctype_cid(ct->info)));\n      idx = crec_reassoc_ofs(J, idx, &ofs, sz);\n#if LJ_TARGET_ARM || LJ_TARGET_PPC\n      /* Hoist base add to allow fusion of index/shift into operands. */\n      if (LJ_LIKELY(J->flags & JIT_F_OPT_LOOP) && ofs\n#if LJ_TARGET_ARM\n\t  && (sz == 1 || sz == 4)\n#endif\n\t  ) {\n\tptr = emitir(IRT(IR_ADD, IRT_PTR), ptr, lj_ir_kintp(J, ofs));\n\tofs = 0;\n      }\n#endif\n      idx = emitir(IRT(IR_MUL, IRT_INTP), idx, lj_ir_kintp(J, sz));\n      ptr = emitir(IRT(IR_ADD, IRT_PTR), idx, ptr);\n    }\n  } else if (tref_iscdata(idx)) {\n    GCcdata *cdk = cdataV(&rd->argv[1]);\n    CType *ctk = ctype_raw(cts, cdk->ctypeid);\n    IRType t = crec_ct2irt(cts, ctk);\n    if (ctype_ispointer(ct->info) && t >= IRT_I8 && t <= IRT_U64) {\n      if (ctk->size == 8) {\n\tidx = emitir(IRT(IR_FLOAD, t), idx, IRFL_CDATA_INT64);\n      } else if (ctk->size == 4) {\n\tidx = emitir(IRT(IR_FLOAD, t), idx, IRFL_CDATA_INT);\n      } else {\n\tidx = emitir(IRT(IR_ADD, IRT_PTR), idx,\n\t\t     lj_ir_kintp(J, sizeof(GCcdata)));\n\tidx = emitir(IRT(IR_XLOAD, t), idx, 0);\n      }\n      if (LJ_64 && ctk->size < sizeof(intptr_t) && !(ctk->info & CTF_UNSIGNED))\n\tidx = emitconv(idx, IRT_INTP, IRT_INT, IRCONV_SEXT);\n      if (!LJ_64 && ctk->size > sizeof(intptr_t)) {\n\tidx = emitconv(idx, IRT_INTP, t, 0);\n\tlj_needsplit(J);\n      }\n      goto integer_key;\n    }\n  } else if (tref_isstr(idx)) {\n    GCstr *name = strV(&rd->argv[1]);\n    if (cd->ctypeid == CTID_CTYPEID)\n      ct = ctype_raw(cts, crec_constructor(J, cd, ptr));\n    if (ctype_isstruct(ct->info)) {\n      CTSize fofs;\n      CType *fct;\n      fct = lj_ctype_getfield(cts, ct, name, &fofs);\n      if (fct) {\n\t/* Always specialize to the field name. */\n\temitir(IRTG(IR_EQ, IRT_STR), idx, lj_ir_kstr(J, name));\n\tif (ctype_isconstval(fct->info)) {\n\t  if (fct->size >= 0x80000000u &&\n\t      (ctype_child(cts, fct)->info & CTF_UNSIGNED)) {\n\t    J->base[0] = lj_ir_knum(J, (lua_Number)(uint32_t)fct->size);\n\t    return;\n\t  }\n\t  J->base[0] = lj_ir_kint(J, (int32_t)fct->size);\n\t  return;  /* Interpreter will throw for newindex. */\n\t} else if (ctype_isbitfield(fct->info)) {\n\t  lj_trace_err(J, LJ_TRERR_NYICONV);\n\t} else {\n\t  lua_assert(ctype_isfield(fct->info));\n\t  sid = ctype_cid(fct->info);\n\t}\n\tofs += (ptrdiff_t)fofs;\n      }\n    } else if (ctype_iscomplex(ct->info)) {\n      if (name->len == 2 &&\n\t  ((strdata(name)[0] == 'r' && strdata(name)[1] == 'e') ||\n\t   (strdata(name)[0] == 'i' && strdata(name)[1] == 'm'))) {\n\t/* Always specialize to the field name. */\n\temitir(IRTG(IR_EQ, IRT_STR), idx, lj_ir_kstr(J, name));\n\tif (strdata(name)[0] == 'i') ofs += (ct->size >> 1);\n\tsid = ctype_cid(ct->info);\n      }\n    }\n  }\n  if (!sid) {\n    if (ctype_isptr(ct->info)) {  /* Automatically perform '->'. */\n      CType *cct = ctype_rawchild(cts, ct);\n      if (ctype_isstruct(cct->info)) {\n\tct = cct;\n\tif (tref_isstr(idx)) goto again;\n      }\n    }\n    crec_index_meta(J, cts, ct, rd);\n    return;\n  }\n\n  if (ofs)\n    ptr = emitir(IRT(IR_ADD, IRT_PTR), ptr, lj_ir_kintp(J, ofs));\n\n  /* Resolve reference for field. */\n  ct = ctype_get(cts, sid);\n  if (ctype_isref(ct->info))\n    ptr = emitir(IRT(IR_XLOAD, IRT_PTR), ptr, 0);\n\n  while (ctype_isattrib(ct->info))\n    ct = ctype_child(cts, ct);  /* Skip attributes. */\n\n  if (rd->data == 0) {  /* __index metamethod. */\n    J->base[0] = crec_tv_ct(J, ct, sid, ptr);\n  } else {  /* __newindex metamethod. */\n    rd->nres = 0;\n    J->needsnap = 1;\n    crec_ct_tv(J, ct, ptr, J->base[2], &rd->argv[2]);\n  }\n}\n\n/* Record setting a finalizer. */\nstatic void crec_finalizer(jit_State *J, TRef trcd, cTValue *fin)\n{\n  TRef trlo = lj_ir_call(J, IRCALL_lj_cdata_setfin, trcd);\n  TRef trhi = emitir(IRT(IR_ADD, IRT_P32), trlo, lj_ir_kint(J, 4));\n  if (LJ_BE) { TRef tmp = trlo; trlo = trhi; trhi = tmp; }\n  if (tvisfunc(fin)) {\n    emitir(IRT(IR_XSTORE, IRT_P32), trlo, lj_ir_kfunc(J, funcV(fin)));\n    emitir(IRTI(IR_XSTORE), trhi, lj_ir_kint(J, LJ_TFUNC));\n  } else if (tviscdata(fin)) {\n    emitir(IRT(IR_XSTORE, IRT_P32), trlo,\n\t   lj_ir_kgc(J, obj2gco(cdataV(fin)), IRT_CDATA));\n    emitir(IRTI(IR_XSTORE), trhi, lj_ir_kint(J, LJ_TCDATA));\n  } else {\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  }\n  J->needsnap = 1;\n}\n\n/* Record cdata allocation. */\nstatic void crec_alloc(jit_State *J, RecordFFData *rd, CTypeID id)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  CTSize sz;\n  CTInfo info = lj_ctype_info(cts, id, &sz);\n  CType *d = ctype_raw(cts, id);\n  TRef trid;\n  if (!sz || sz > 128 || (info & CTF_VLA) || ctype_align(info) > CT_MEMALIGN)\n    lj_trace_err(J, LJ_TRERR_NYICONV);  /* NYI: large/special allocations. */\n  trid = lj_ir_kint(J, id);\n  /* Use special instruction to box pointer or 32/64 bit integer. */\n  if (ctype_isptr(info) || (ctype_isinteger(info) && (sz == 4 || sz == 8))) {\n    TRef sp = J->base[1] ? crec_ct_tv(J, d, 0, J->base[1], &rd->argv[1]) :\n\t      ctype_isptr(info) ? lj_ir_kptr(J, NULL) :\n\t      sz == 4 ? lj_ir_kint(J, 0) :\n\t      (lj_needsplit(J), lj_ir_kint64(J, 0));\n    J->base[0] = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, sp);\n  } else {\n    TRef trcd = emitir(IRTG(IR_CNEW, IRT_CDATA), trid, TREF_NIL);\n    cTValue *fin;\n    J->base[0] = trcd;\n    if (J->base[1] && !J->base[2] &&\n\t!lj_cconv_multi_init(cts, d, &rd->argv[1])) {\n      goto single_init;\n    } else if (ctype_isarray(d->info)) {\n      CType *dc = ctype_rawchild(cts, d);  /* Array element type. */\n      CTSize ofs, esize = dc->size;\n      TRef sp = 0;\n      TValue tv;\n      TValue *sval = &tv;\n      MSize i;\n      tv.u64 = 0;\n      if (!(ctype_isnum(dc->info) || ctype_isptr(dc->info)))\n\tlj_trace_err(J, LJ_TRERR_NYICONV);  /* NYI: init array of aggregates. */\n      for (i = 1, ofs = 0; ofs < sz; ofs += esize) {\n\tTRef dp = emitir(IRT(IR_ADD, IRT_PTR), trcd,\n\t\t\t lj_ir_kintp(J, ofs + sizeof(GCcdata)));\n\tif (J->base[i]) {\n\t  sp = J->base[i];\n\t  sval = &rd->argv[i];\n\t  i++;\n\t} else if (i != 2) {\n\t  sp = ctype_isnum(dc->info) ? lj_ir_kint(J, 0) : TREF_NIL;\n\t}\n\tcrec_ct_tv(J, dc, dp, sp, sval);\n      }\n    } else if (ctype_isstruct(d->info)) {\n      CTypeID fid = d->sib;\n      MSize i = 1;\n      while (fid) {\n\tCType *df = ctype_get(cts, fid);\n\tfid = df->sib;\n\tif (ctype_isfield(df->info)) {\n\t  CType *dc;\n\t  TRef sp, dp;\n\t  TValue tv;\n\t  TValue *sval = &tv;\n\t  setintV(&tv, 0);\n\t  if (!gcref(df->name)) continue;  /* Ignore unnamed fields. */\n\t  dc = ctype_rawchild(cts, df);  /* Field type. */\n\t  if (!(ctype_isnum(dc->info) || ctype_isptr(dc->info) ||\n\t\tctype_isenum(dc->info)))\n\t    lj_trace_err(J, LJ_TRERR_NYICONV);  /* NYI: init aggregates. */\n\t  if (J->base[i]) {\n\t    sp = J->base[i];\n\t    sval = &rd->argv[i];\n\t    i++;\n\t  } else {\n\t    sp = ctype_isptr(dc->info) ? TREF_NIL : lj_ir_kint(J, 0);\n\t  }\n\t  dp = emitir(IRT(IR_ADD, IRT_PTR), trcd,\n\t\t      lj_ir_kintp(J, df->size + sizeof(GCcdata)));\n\t  crec_ct_tv(J, dc, dp, sp, sval);\n\t} else if (!ctype_isconstval(df->info)) {\n\t  /* NYI: init bitfields and sub-structures. */\n\t  lj_trace_err(J, LJ_TRERR_NYICONV);\n\t}\n      }\n    } else {\n      TRef dp;\n    single_init:\n      dp = emitir(IRT(IR_ADD, IRT_PTR), trcd, lj_ir_kintp(J, sizeof(GCcdata)));\n      if (J->base[1]) {\n\tcrec_ct_tv(J, d, dp, J->base[1], &rd->argv[1]);\n      } else {\n\tTValue tv;\n\ttv.u64 = 0;\n\tcrec_ct_tv(J, d, dp, lj_ir_kint(J, 0), &tv);\n      }\n    }\n    /* Handle __gc metamethod. */\n    fin = lj_ctype_meta(cts, id, MM_gc);\n    if (fin)\n      crec_finalizer(J, trcd, fin);\n  }\n}\n\n/* Record argument conversions. */\nstatic TRef crec_call_args(jit_State *J, RecordFFData *rd,\n\t\t\t   CTState *cts, CType *ct)\n{\n  TRef args[CCI_NARGS_MAX];\n  CTypeID fid;\n  MSize i, n;\n  TRef tr, *base;\n  cTValue *o;\n#if LJ_TARGET_X86\n#if LJ_ABI_WIN\n  TRef *arg0 = NULL, *arg1 = NULL;\n#endif\n  int ngpr = 0;\n  if (ctype_cconv(ct->info) == CTCC_THISCALL)\n    ngpr = 1;\n  else if (ctype_cconv(ct->info) == CTCC_FASTCALL)\n    ngpr = 2;\n#endif\n\n  /* Skip initial attributes. */\n  fid = ct->sib;\n  while (fid) {\n    CType *ctf = ctype_get(cts, fid);\n    if (!ctype_isattrib(ctf->info)) break;\n    fid = ctf->sib;\n  }\n  args[0] = TREF_NIL;\n  for (n = 0, base = J->base+1, o = rd->argv+1; *base; n++, base++, o++) {\n    CTypeID did;\n    CType *d;\n\n    if (n >= CCI_NARGS_MAX)\n      lj_trace_err(J, LJ_TRERR_NYICALL);\n\n    if (fid) {  /* Get argument type from field. */\n      CType *ctf = ctype_get(cts, fid);\n      fid = ctf->sib;\n      lua_assert(ctype_isfield(ctf->info));\n      did = ctype_cid(ctf->info);\n    } else {\n      if (!(ct->info & CTF_VARARG))\n\tlj_trace_err(J, LJ_TRERR_NYICALL);  /* Too many arguments. */\n      did = lj_ccall_ctid_vararg(cts, o);  /* Infer vararg type. */\n    }\n    d = ctype_raw(cts, did);\n    if (!(ctype_isnum(d->info) || ctype_isptr(d->info) ||\n\t  ctype_isenum(d->info)))\n      lj_trace_err(J, LJ_TRERR_NYICALL);\n    tr = crec_ct_tv(J, d, 0, *base, o);\n    if (ctype_isinteger_or_bool(d->info)) {\n      if (d->size < 4) {\n\tif ((d->info & CTF_UNSIGNED))\n\t  tr = emitconv(tr, IRT_INT, d->size==1 ? IRT_U8 : IRT_U16, 0);\n\telse\n\t  tr = emitconv(tr, IRT_INT, d->size==1 ? IRT_I8 : IRT_I16,IRCONV_SEXT);\n      }\n    } else if (LJ_SOFTFP && ctype_isfp(d->info) && d->size > 4) {\n      lj_needsplit(J);\n    }\n#if LJ_TARGET_X86\n    /* 64 bit args must not end up in registers for fastcall/thiscall. */\n#if LJ_ABI_WIN\n    if (!ctype_isfp(d->info)) {\n      /* Sigh, the Windows/x86 ABI allows reordering across 64 bit args. */\n      if (tref_typerange(tr, IRT_I64, IRT_U64)) {\n\tif (ngpr) {\n\t  arg0 = &args[n]; args[n++] = TREF_NIL; ngpr--;\n\t  if (ngpr) {\n\t    arg1 = &args[n]; args[n++] = TREF_NIL; ngpr--;\n\t  }\n\t}\n      } else {\n\tif (arg0) { *arg0 = tr; arg0 = NULL; n--; continue; }\n\tif (arg1) { *arg1 = tr; arg1 = NULL; n--; continue; }\n\tif (ngpr) ngpr--;\n      }\n    }\n#else\n    if (!ctype_isfp(d->info) && ngpr) {\n      if (tref_typerange(tr, IRT_I64, IRT_U64)) {\n\t/* No reordering for other x86 ABIs. Simply add alignment args. */\n\tdo { args[n++] = TREF_NIL; } while (--ngpr);\n      } else {\n\tngpr--;\n      }\n    }\n#endif\n#endif\n    args[n] = tr;\n  }\n  tr = args[0];\n  for (i = 1; i < n; i++)\n    tr = emitir(IRT(IR_CARG, IRT_NIL), tr, args[i]);\n  return tr;\n}\n\n/* Create a snapshot for the caller, simulating a 'false' return value. */\nstatic void crec_snap_caller(jit_State *J)\n{\n  lua_State *L = J->L;\n  TValue *base = L->base, *top = L->top;\n  const BCIns *pc = J->pc;\n  TRef ftr = J->base[-1];\n  ptrdiff_t delta;\n  if (!frame_islua(base-1))\n    lj_trace_err(J, LJ_TRERR_NYICALL);\n  J->pc = frame_pc(base-1); delta = 1+bc_a(J->pc[-1]);\n  L->top = base; L->base = base - delta;\n  J->base[-1] = TREF_FALSE;\n  J->base -= delta; J->baseslot -= (BCReg)delta;\n  J->maxslot = (BCReg)delta; J->framedepth--;\n  lj_snap_add(J);\n  L->base = base; L->top = top;\n  J->framedepth++; J->maxslot = 1;\n  J->base += delta; J->baseslot += (BCReg)delta;\n  J->base[-1] = ftr; J->pc = pc;\n}\n\n/* Record function call. */\nstatic int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  CType *ct = ctype_raw(cts, cd->ctypeid);\n  IRType tp = IRT_PTR;\n  if (ctype_isptr(ct->info)) {\n    tp = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32;\n    ct = ctype_rawchild(cts, ct);\n  }\n  if (ctype_isfunc(ct->info)) {\n    TRef func = emitir(IRT(IR_FLOAD, tp), J->base[0], IRFL_CDATA_PTR);\n    CType *ctr = ctype_rawchild(cts, ct);\n    IRType t = crec_ct2irt(cts, ctr);\n    TRef tr;\n    TValue tv;\n    /* Check for blacklisted C functions that might call a callback. */\n    setlightudV(&tv,\n\t\tcdata_getptr(cdataptr(cd), (LJ_64 && tp == IRT_P64) ? 8 : 4));\n    if (tvistrue(lj_tab_get(J->L, cts->miscmap, &tv)))\n      lj_trace_err(J, LJ_TRERR_BLACKL);\n    if (ctype_isvoid(ctr->info)) {\n      t = IRT_NIL;\n      rd->nres = 0;\n    } else if (!(ctype_isnum(ctr->info) || ctype_isptr(ctr->info) ||\n\t\t ctype_isenum(ctr->info)) || t == IRT_CDATA) {\n      lj_trace_err(J, LJ_TRERR_NYICALL);\n    }\n    if ((ct->info & CTF_VARARG)\n#if LJ_TARGET_X86\n\t|| ctype_cconv(ct->info) != CTCC_CDECL\n#endif\n\t)\n      func = emitir(IRT(IR_CARG, IRT_NIL), func,\n\t\t    lj_ir_kint(J, ctype_typeid(cts, ct)));\n    tr = emitir(IRT(IR_CALLXS, t), crec_call_args(J, rd, cts, ct), func);\n    if (ctype_isbool(ctr->info)) {\n      if (frame_islua(J->L->base-1) && bc_b(frame_pc(J->L->base-1)[-1]) == 1) {\n\t/* Don't check result if ignored. */\n\ttr = TREF_NIL;\n      } else {\n\tcrec_snap_caller(J);\n#if LJ_TARGET_X86ORX64\n\t/* Note: only the x86/x64 backend supports U8 and only for EQ(tr, 0). */\n\tlj_ir_set(J, IRTG(IR_NE, IRT_U8), tr, lj_ir_kint(J, 0));\n#else\n\tlj_ir_set(J, IRTGI(IR_NE), tr, lj_ir_kint(J, 0));\n#endif\n\tJ->postproc = LJ_POST_FIXGUARDSNAP;\n\ttr = TREF_TRUE;\n      }\n    } else if (t == IRT_PTR || (LJ_64 && t == IRT_P32) ||\n\t       t == IRT_I64 || t == IRT_U64 || ctype_isenum(ctr->info)) {\n      TRef trid = lj_ir_kint(J, ctype_cid(ct->info));\n      tr = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, tr);\n      if (t == IRT_I64 || t == IRT_U64) lj_needsplit(J);\n    } else if (t == IRT_FLOAT || t == IRT_U32) {\n      tr = emitconv(tr, IRT_NUM, t, 0);\n    } else if (t == IRT_I8 || t == IRT_I16) {\n      tr = emitconv(tr, IRT_INT, t, IRCONV_SEXT);\n    } else if (t == IRT_U8 || t == IRT_U16) {\n      tr = emitconv(tr, IRT_INT, t, 0);\n    }\n    J->base[0] = tr;\n    J->needsnap = 1;\n    return 1;\n  }\n  return 0;\n}\n\nvoid LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  GCcdata *cd = argv2cdata(J, J->base[0], &rd->argv[0]);\n  CTypeID id = cd->ctypeid;\n  CType *ct;\n  cTValue *tv;\n  MMS mm = MM_call;\n  if (id == CTID_CTYPEID) {\n    id = crec_constructor(J, cd, J->base[0]);\n    mm = MM_new;\n  } else if (crec_call(J, rd, cd)) {\n    return;\n  }\n  /* Record ctype __call/__new metamethod. */\n  ct = ctype_raw(cts, id);\n  tv = lj_ctype_meta(cts, ctype_isptr(ct->info) ? ctype_cid(ct->info) : id, mm);\n  if (tv) {\n    if (tvisfunc(tv)) {\n      J->base[-1] = lj_ir_kfunc(J, funcV(tv)) | TREF_FRAME;\n      rd->nres = -1;  /* Pending tailcall. */\n      return;\n    }\n  } else if (mm == MM_new) {\n    crec_alloc(J, rd, id);\n    return;\n  }\n  /* No metamethod or NYI: non-function metamethods. */\n  lj_trace_err(J, LJ_TRERR_BADTYPE);\n}\n\nstatic TRef crec_arith_int64(jit_State *J, TRef *sp, CType **s, MMS mm)\n{\n  if (ctype_isnum(s[0]->info) && ctype_isnum(s[1]->info)) {\n    IRType dt;\n    CTypeID id;\n    TRef tr;\n    MSize i;\n    IROp op;\n    lj_needsplit(J);\n    if (((s[0]->info & CTF_UNSIGNED) && s[0]->size == 8) ||\n\t((s[1]->info & CTF_UNSIGNED) && s[1]->size == 8)) {\n      dt = IRT_U64; id = CTID_UINT64;\n    } else {\n      dt = IRT_I64; id = CTID_INT64;\n      if (mm < MM_add &&\n\t  !((s[0]->info | s[1]->info) & CTF_FP) &&\n\t  s[0]->size == 4 && s[1]->size == 4) {  /* Try to narrow comparison. */\n\tif (!((s[0]->info ^ s[1]->info) & CTF_UNSIGNED) ||\n\t    (tref_isk(sp[1]) && IR(tref_ref(sp[1]))->i >= 0)) {\n\t  dt = (s[0]->info & CTF_UNSIGNED) ? IRT_U32 : IRT_INT;\n\t  goto comp;\n\t} else if (tref_isk(sp[0]) && IR(tref_ref(sp[0]))->i >= 0) {\n\t  dt = (s[1]->info & CTF_UNSIGNED) ? IRT_U32 : IRT_INT;\n\t  goto comp;\n\t}\n      }\n    }\n    for (i = 0; i < 2; i++) {\n      IRType st = tref_type(sp[i]);\n      if (st == IRT_NUM || st == IRT_FLOAT)\n\tsp[i] = emitconv(sp[i], dt, st, IRCONV_TRUNC|IRCONV_ANY);\n      else if (!(st == IRT_I64 || st == IRT_U64))\n\tsp[i] = emitconv(sp[i], dt, IRT_INT,\n\t\t\t (s[i]->info & CTF_UNSIGNED) ? 0 : IRCONV_SEXT);\n    }\n    if (mm < MM_add) {\n    comp:\n      /* Assume true comparison. Fixup and emit pending guard later. */\n      if (mm == MM_eq) {\n\top = IR_EQ;\n      } else {\n\top = mm == MM_lt ? IR_LT : IR_LE;\n\tif (dt == IRT_U32 || dt == IRT_U64)\n\t  op += (IR_ULT-IR_LT);\n      }\n      lj_ir_set(J, IRTG(op, dt), sp[0], sp[1]);\n      J->postproc = LJ_POST_FIXGUARD;\n      return TREF_TRUE;\n    } else {\n      tr = emitir(IRT(mm+(int)IR_ADD-(int)MM_add, dt), sp[0], sp[1]);\n    }\n    return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr);\n  }\n  return 0;\n}\n\nstatic TRef crec_arith_ptr(jit_State *J, TRef *sp, CType **s, MMS mm)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  CType *ctp = s[0];\n  if (ctype_isptr(ctp->info) || ctype_isrefarray(ctp->info)) {\n    if ((mm == MM_sub || mm == MM_eq || mm == MM_lt || mm == MM_le) &&\n\t(ctype_isptr(s[1]->info) || ctype_isrefarray(s[1]->info))) {\n      if (mm == MM_sub) {  /* Pointer difference. */\n\tTRef tr;\n\tCTSize sz = lj_ctype_size(cts, ctype_cid(ctp->info));\n\tif (sz == 0 || (sz & (sz-1)) != 0)\n\t  return 0;  /* NYI: integer division. */\n\ttr = emitir(IRT(IR_SUB, IRT_INTP), sp[0], sp[1]);\n\ttr = emitir(IRT(IR_BSAR, IRT_INTP), tr, lj_ir_kint(J, lj_fls(sz)));\n#if LJ_64\n\ttr = emitconv(tr, IRT_NUM, IRT_INTP, 0);\n#endif\n\treturn tr;\n      } else {  /* Pointer comparison (unsigned). */\n\t/* Assume true comparison. Fixup and emit pending guard later. */\n\tIROp op = mm == MM_eq ? IR_EQ : mm == MM_lt ? IR_ULT : IR_ULE;\n\tlj_ir_set(J, IRTG(op, IRT_PTR), sp[0], sp[1]);\n\tJ->postproc = LJ_POST_FIXGUARD;\n\treturn TREF_TRUE;\n      }\n    }\n    if (!((mm == MM_add || mm == MM_sub) && ctype_isnum(s[1]->info)))\n      return 0;\n  } else if (mm == MM_add && ctype_isnum(ctp->info) &&\n\t     (ctype_isptr(s[1]->info) || ctype_isrefarray(s[1]->info))) {\n    TRef tr = sp[0]; sp[0] = sp[1]; sp[1] = tr;  /* Swap pointer and index. */\n    ctp = s[1];\n  } else {\n    return 0;\n  }\n  {\n    TRef tr = sp[1];\n    IRType t = tref_type(tr);\n    CTSize sz = lj_ctype_size(cts, ctype_cid(ctp->info));\n    CTypeID id;\n#if LJ_64\n    if (t == IRT_NUM || t == IRT_FLOAT)\n      tr = emitconv(tr, IRT_INTP, t, IRCONV_TRUNC|IRCONV_ANY);\n    else if (!(t == IRT_I64 || t == IRT_U64))\n      tr = emitconv(tr, IRT_INTP, IRT_INT,\n\t\t    ((t - IRT_I8) & 1) ? 0 : IRCONV_SEXT);\n#else\n    if (!tref_typerange(sp[1], IRT_I8, IRT_U32)) {\n      tr = emitconv(tr, IRT_INTP, t,\n\t\t    (t == IRT_NUM || t == IRT_FLOAT) ?\n\t\t    IRCONV_TRUNC|IRCONV_ANY : 0);\n    }\n#endif\n    tr = emitir(IRT(IR_MUL, IRT_INTP), tr, lj_ir_kintp(J, sz));\n    tr = emitir(IRT(mm+(int)IR_ADD-(int)MM_add, IRT_PTR), sp[0], tr);\n    id = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|ctype_cid(ctp->info)),\n\t\t\t CTSIZE_PTR);\n    return emitir(IRTG(IR_CNEWI, IRT_CDATA), lj_ir_kint(J, id), tr);\n  }\n}\n\n/* Record ctype arithmetic metamethods. */\nstatic void crec_arith_meta(jit_State *J, CTState *cts, RecordFFData *rd)\n{\n  cTValue *tv = NULL;\n  if (J->base[0]) {\n    if (tviscdata(&rd->argv[0])) {\n      CTypeID id = argv2cdata(J, J->base[0], &rd->argv[0])->ctypeid;\n      CType *ct = ctype_raw(cts, id);\n      if (ctype_isptr(ct->info)) id = ctype_cid(ct->info);\n      tv = lj_ctype_meta(cts, id, (MMS)rd->data);\n    }\n    if (!tv && J->base[1] && tviscdata(&rd->argv[1])) {\n      CTypeID id = argv2cdata(J, J->base[1], &rd->argv[1])->ctypeid;\n      CType *ct = ctype_raw(cts, id);\n      if (ctype_isptr(ct->info)) id = ctype_cid(ct->info);\n      tv = lj_ctype_meta(cts, id, (MMS)rd->data);\n    }\n  }\n  if (tv) {\n    if (tvisfunc(tv)) {\n      J->base[-1] = lj_ir_kfunc(J, funcV(tv)) | TREF_FRAME;\n      rd->nres = -1;  /* Pending tailcall. */\n      return;\n    }  /* NYI: non-function metamethods. */\n  } else if ((MMS)rd->data == MM_eq) {\n    J->base[0] = TREF_FALSE;\n    return;\n  }\n  lj_trace_err(J, LJ_TRERR_BADTYPE);\n}\n\nvoid LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  TRef sp[2];\n  CType *s[2];\n  MSize i;\n  for (i = 0; i < 2; i++) {\n    TRef tr = J->base[i];\n    CType *ct = ctype_get(cts, CTID_DOUBLE);\n    if (!tr) {\n      goto trymeta;\n    } else if (tref_iscdata(tr)) {\n      CTypeID id = argv2cdata(J, tr, &rd->argv[i])->ctypeid;\n      IRType t;\n      ct = ctype_raw(cts, id);\n      t = crec_ct2irt(cts, ct);\n      if (ctype_isptr(ct->info)) {  /* Resolve pointer or reference. */\n\ttr = emitir(IRT(IR_FLOAD, t), tr, IRFL_CDATA_PTR);\n\tif (ctype_isref(ct->info)) {\n\t  ct = ctype_rawchild(cts, ct);\n\t  t = crec_ct2irt(cts, ct);\n\t}\n      } else if (t == IRT_I64 || t == IRT_U64) {\n\ttr = emitir(IRT(IR_FLOAD, t), tr, IRFL_CDATA_INT64);\n\tlj_needsplit(J);\n\tgoto ok;\n      } else if (t == IRT_INT || t == IRT_U32) {\n\ttr = emitir(IRT(IR_FLOAD, t), tr, IRFL_CDATA_INT);\n\tif (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);\n\tgoto ok;\n      } else if (ctype_isfunc(ct->info)) {\n\ttr = emitir(IRT(IR_FLOAD, IRT_PTR), tr, IRFL_CDATA_PTR);\n\tct = ctype_get(cts,\n\t  lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|id), CTSIZE_PTR));\n\tgoto ok;\n      } else {\n\ttr = emitir(IRT(IR_ADD, IRT_PTR), tr, lj_ir_kintp(J, sizeof(GCcdata)));\n      }\n      if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);\n      if (ctype_isnum(ct->info)) {\n\tif (t == IRT_CDATA) goto trymeta;\n\tif (t == IRT_I64 || t == IRT_U64) lj_needsplit(J);\n\ttr = emitir(IRT(IR_XLOAD, t), tr, 0);\n      } else if (!(ctype_isptr(ct->info) || ctype_isrefarray(ct->info))) {\n\tgoto trymeta;\n      }\n    } else if (tref_isnil(tr)) {\n      tr = lj_ir_kptr(J, NULL);\n      ct = ctype_get(cts, CTID_P_VOID);\n    } else if (tref_isinteger(tr)) {\n      ct = ctype_get(cts, CTID_INT32);\n    } else if (tref_isstr(tr)) {\n      TRef tr2 = J->base[1-i];\n      CTypeID id = argv2cdata(J, tr2, &rd->argv[1-i])->ctypeid;\n      ct = ctype_raw(cts, id);\n      if (ctype_isenum(ct->info)) {  /* Match string against enum constant. */\n\tGCstr *str = strV(&rd->argv[i]);\n\tCTSize ofs;\n\tCType *cct = lj_ctype_getfield(cts, ct, str, &ofs);\n\tif (cct && ctype_isconstval(cct->info)) {\n\t  /* Specialize to the name of the enum constant. */\n\t  emitir(IRTG(IR_EQ, IRT_STR), tr, lj_ir_kstr(J, str));\n\t  ct = ctype_child(cts, cct);\n\t  tr = lj_ir_kint(J, (int32_t)ofs);\n\t}  /* else: interpreter will throw. */\n      }  /* else: interpreter will throw. */\n    } else if (!tref_isnum(tr)) {\n      goto trymeta;\n    }\n  ok:\n    s[i] = ct;\n    sp[i] = tr;\n  }\n  {\n    TRef tr;\n    if ((tr = crec_arith_int64(J, sp, s, (MMS)rd->data)) ||\n\t(tr = crec_arith_ptr(J, sp, s, (MMS)rd->data))) {\n      J->base[0] = tr;\n      /* Fixup cdata comparisons, too. Avoids some cdata escapes. */\n      if (J->postproc == LJ_POST_FIXGUARD && frame_iscont(J->L->base-1) &&\n\t  !irt_isguard(J->guardemit)) {\n\tconst BCIns *pc = frame_contpc(J->L->base-1) - 1;\n\tif (bc_op(*pc) <= BC_ISNEP) {\n\t  setframe_pc(&J2G(J)->tmptv, pc);\n\t  J2G(J)->tmptv.u32.lo = ((tref_istrue(tr) ^ bc_op(*pc)) & 1);\n\t  J->postproc = LJ_POST_FIXCOMP;\n\t}\n      }\n    } else {\n    trymeta:\n      crec_arith_meta(J, cts, rd);\n    }\n  }\n}\n\n/* -- C library namespace metamethods ------------------------------------- */\n\nvoid LJ_FASTCALL recff_clib_index(jit_State *J, RecordFFData *rd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  if (tref_isudata(J->base[0]) && tref_isstr(J->base[1]) &&\n      udataV(&rd->argv[0])->udtype == UDTYPE_FFI_CLIB) {\n    CLibrary *cl = (CLibrary *)uddata(udataV(&rd->argv[0]));\n    GCstr *name = strV(&rd->argv[1]);\n    CType *ct;\n    CTypeID id = lj_ctype_getname(cts, &ct, name, CLNS_INDEX);\n    cTValue *tv = lj_tab_getstr(cl->cache, name);\n    rd->nres = rd->data;\n    if (id && tv && !tvisnil(tv)) {\n      /* Specialize to the symbol name and make the result a constant. */\n      emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, name));\n      if (ctype_isconstval(ct->info)) {\n\tif (ct->size >= 0x80000000u &&\n\t    (ctype_child(cts, ct)->info & CTF_UNSIGNED))\n\t  J->base[0] = lj_ir_knum(J, (lua_Number)(uint32_t)ct->size);\n\telse\n\t  J->base[0] = lj_ir_kint(J, (int32_t)ct->size);\n      } else if (ctype_isextern(ct->info)) {\n\tCTypeID sid = ctype_cid(ct->info);\n\tvoid *sp = *(void **)cdataptr(cdataV(tv));\n\tTRef ptr;\n\tct = ctype_raw(cts, sid);\n\tif (LJ_64 && !checkptr32(sp))\n\t  ptr = lj_ir_kintp(J, (uintptr_t)sp);\n\telse\n\t  ptr = lj_ir_kptr(J, sp);\n\tif (rd->data) {\n\t  J->base[0] = crec_tv_ct(J, ct, sid, ptr);\n\t} else {\n\t  J->needsnap = 1;\n\t  crec_ct_tv(J, ct, ptr, J->base[2], &rd->argv[2]);\n\t}\n      } else {\n\tJ->base[0] = lj_ir_kgc(J, obj2gco(cdataV(tv)), IRT_CDATA);\n      }\n    } else {\n      lj_trace_err(J, LJ_TRERR_NOCACHE);\n    }\n  }  /* else: interpreter will throw. */\n}\n\n/* -- FFI library functions ----------------------------------------------- */\n\nstatic TRef crec_toint(jit_State *J, CTState *cts, TRef sp, TValue *sval)\n{\n  return crec_ct_tv(J, ctype_get(cts, CTID_INT32), 0, sp, sval);\n}\n\nvoid LJ_FASTCALL recff_ffi_new(jit_State *J, RecordFFData *rd)\n{\n  crec_alloc(J, rd, argv2ctype(J, J->base[0], &rd->argv[0]));\n}\n\nvoid LJ_FASTCALL recff_ffi_errno(jit_State *J, RecordFFData *rd)\n{\n  UNUSED(rd);\n  if (J->base[0])\n    lj_trace_err(J, LJ_TRERR_NYICALL);\n  J->base[0] = lj_ir_call(J, IRCALL_lj_vm_errno);\n}\n\nvoid LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  TRef tr = J->base[0];\n  if (tr) {\n    TRef trlen = J->base[1];\n    if (trlen) {\n      trlen = crec_toint(J, cts, trlen, &rd->argv[1]);\n      tr = crec_ct_tv(J, ctype_get(cts, CTID_P_CVOID), 0, tr, &rd->argv[0]);\n    } else {\n      tr = crec_ct_tv(J, ctype_get(cts, CTID_P_CCHAR), 0, tr, &rd->argv[0]);\n      trlen = lj_ir_call(J, IRCALL_strlen, tr);\n    }\n    J->base[0] = emitir(IRT(IR_XSNEW, IRT_STR), tr, trlen);\n  }  /* else: interpreter will throw. */\n}\n\nvoid LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  TRef trdst = J->base[0], trsrc = J->base[1], trlen = J->base[2];\n  if (trdst && trsrc && (trlen || tref_isstr(trsrc))) {\n    trdst = crec_ct_tv(J, ctype_get(cts, CTID_P_VOID), 0, trdst, &rd->argv[0]);\n    trsrc = crec_ct_tv(J, ctype_get(cts, CTID_P_CVOID), 0, trsrc, &rd->argv[1]);\n    if (trlen) {\n      trlen = crec_toint(J, cts, trlen, &rd->argv[2]);\n    } else {\n      trlen = emitir(IRTI(IR_FLOAD), J->base[1], IRFL_STR_LEN);\n      trlen = emitir(IRTI(IR_ADD), trlen, lj_ir_kint(J, 1));\n    }\n    rd->nres = 0;\n    crec_copy(J, trdst, trsrc, trlen, NULL);\n  }  /* else: interpreter will throw. */\n}\n\nvoid LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  TRef trdst = J->base[0], trlen = J->base[1], trfill = J->base[2];\n  if (trdst && trlen) {\n    CTSize step = 1;\n    if (tviscdata(&rd->argv[0])) {  /* Get alignment of original destination. */\n      CTSize sz;\n      CType *ct = ctype_raw(cts, cdataV(&rd->argv[0])->ctypeid);\n      if (ctype_isptr(ct->info))\n\tct = ctype_rawchild(cts, ct);\n      step = (1u<<ctype_align(lj_ctype_info(cts, ctype_typeid(cts, ct), &sz)));\n    }\n    trdst = crec_ct_tv(J, ctype_get(cts, CTID_P_VOID), 0, trdst, &rd->argv[0]);\n    trlen = crec_toint(J, cts, trlen, &rd->argv[1]);\n    if (trfill)\n      trfill = crec_toint(J, cts, trfill, &rd->argv[2]);\n    else\n      trfill = lj_ir_kint(J, 0);\n    rd->nres = 0;\n    crec_fill(J, trdst, trlen, trfill, step);\n  }  /* else: interpreter will throw. */\n}\n\nvoid LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd)\n{\n  if (tref_iscdata(J->base[0])) {\n    TRef trid = lj_ir_kint(J, argv2ctype(J, J->base[0], &rd->argv[0]));\n    J->base[0] = emitir(IRTG(IR_CNEWI, IRT_CDATA),\n\t\t\tlj_ir_kint(J, CTID_CTYPEID), trid);\n  } else {\n    setfuncV(J->L, &J->errinfo, J->fn);\n    lj_trace_err_info(J, LJ_TRERR_NYIFFU);\n  }\n}\n\nvoid LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd)\n{\n  argv2ctype(J, J->base[0], &rd->argv[0]);\n  if (tref_iscdata(J->base[1])) {\n    argv2ctype(J, J->base[1], &rd->argv[1]);\n    J->postproc = LJ_POST_FIXBOOL;\n    J->base[0] = TREF_TRUE;\n  } else {\n    J->base[0] = TREF_FALSE;\n  }\n}\n\nvoid LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd)\n{\n  if (tref_isstr(J->base[0])) {\n    /* Specialize to the ABI string to make the boolean result a constant. */\n    emitir(IRTG(IR_EQ, IRT_STR), J->base[0], lj_ir_kstr(J, strV(&rd->argv[0])));\n    J->postproc = LJ_POST_FIXBOOL;\n    J->base[0] = TREF_TRUE;\n  } else {\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  }\n}\n\n/* Record ffi.sizeof(), ffi.alignof(), ffi.offsetof(). */\nvoid LJ_FASTCALL recff_ffi_xof(jit_State *J, RecordFFData *rd)\n{\n  CTypeID id = argv2ctype(J, J->base[0], &rd->argv[0]);\n  if (rd->data == FF_ffi_sizeof) {\n    CType *ct = lj_ctype_rawref(ctype_ctsG(J2G(J)), id);\n    if (ctype_isvltype(ct->info))\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n  } else if (rd->data == FF_ffi_offsetof) {  /* Specialize to the field name. */\n    if (!tref_isstr(J->base[1]))\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n    emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1])));\n    rd->nres = 3;  /* Just in case. */\n  }\n  J->postproc = LJ_POST_FIXCONST;\n  J->base[0] = J->base[1] = J->base[2] = TREF_NIL;\n}\n\nvoid LJ_FASTCALL recff_ffi_gc(jit_State *J, RecordFFData *rd)\n{\n  argv2cdata(J, J->base[0], &rd->argv[0]);\n  crec_finalizer(J, J->base[0], &rd->argv[1]);\n}\n\n/* -- Miscellaneous library functions ------------------------------------- */\n\nvoid LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd)\n{\n  CTState *cts = ctype_ctsG(J2G(J));\n  CType *d, *ct = lj_ctype_rawref(cts, cdataV(&rd->argv[0])->ctypeid);\n  if (ctype_isenum(ct->info)) ct = ctype_child(cts, ct);\n  if (ctype_isnum(ct->info) || ctype_iscomplex(ct->info)) {\n    if (ctype_isinteger_or_bool(ct->info) && ct->size <= 4 &&\n\t!(ct->size == 4 && (ct->info & CTF_UNSIGNED)))\n      d = ctype_get(cts, CTID_INT32);\n    else\n      d = ctype_get(cts, CTID_DOUBLE);\n    J->base[0] = crec_ct_tv(J, d, 0, J->base[0], &rd->argv[0]);\n  } else {\n    J->base[0] = TREF_NIL;\n  }\n}\n\n#undef IR\n#undef emitir\n#undef emitconv\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_crecord.h",
    "content": "/*\n** Trace recorder for C data operations.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CRECORD_H\n#define _LJ_CRECORD_H\n\n#include \"lj_obj.h\"\n#include \"lj_jit.h\"\n#include \"lj_ffrecord.h\"\n\n#if LJ_HASJIT && LJ_HASFFI\nLJ_FUNC void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_clib_index(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_new(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_errno(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_xof(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL recff_ffi_gc(jit_State *J, RecordFFData *rd);\nLJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ctype.c",
    "content": "/*\n** C type management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include \"lj_obj.h\"\n\n#if LJ_HASFFI\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_ctype.h\"\n#include \"lj_ccallback.h\"\n\n/* -- C type definitions -------------------------------------------------- */\n\n/* Predefined typedefs. */\n#define CTTDDEF(_) \\\n  /* Vararg handling. */ \\\n  _(\"va_list\",\t\t\tP_VOID) \\\n  _(\"__builtin_va_list\",\tP_VOID) \\\n  _(\"__gnuc_va_list\",\t\tP_VOID) \\\n  /* From stddef.h. */ \\\n  _(\"ptrdiff_t\",\t\tINT_PSZ) \\\n  _(\"size_t\",\t\t\tUINT_PSZ) \\\n  _(\"wchar_t\",\t\t\tWCHAR) \\\n  /* Subset of stdint.h. */ \\\n  _(\"int8_t\",\t\t\tINT8) \\\n  _(\"int16_t\",\t\t\tINT16) \\\n  _(\"int32_t\",\t\t\tINT32) \\\n  _(\"int64_t\",\t\t\tINT64) \\\n  _(\"uint8_t\",\t\t\tUINT8) \\\n  _(\"uint16_t\",\t\t\tUINT16) \\\n  _(\"uint32_t\",\t\t\tUINT32) \\\n  _(\"uint64_t\",\t\t\tUINT64) \\\n  _(\"intptr_t\",\t\t\tINT_PSZ) \\\n  _(\"uintptr_t\",\t\tUINT_PSZ) \\\n  /* End of typedef list. */\n\n/* Keywords (only the ones we actually care for). */\n#define CTKWDEF(_) \\\n  /* Type specifiers. */ \\\n  _(\"void\",\t\t-1,\tCTOK_VOID) \\\n  _(\"_Bool\",\t\t0,\tCTOK_BOOL) \\\n  _(\"bool\",\t\t1,\tCTOK_BOOL) \\\n  _(\"char\",\t\t1,\tCTOK_CHAR) \\\n  _(\"int\",\t\t4,\tCTOK_INT) \\\n  _(\"__int8\",\t\t1,\tCTOK_INT) \\\n  _(\"__int16\",\t\t2,\tCTOK_INT) \\\n  _(\"__int32\",\t\t4,\tCTOK_INT) \\\n  _(\"__int64\",\t\t8,\tCTOK_INT) \\\n  _(\"float\",\t\t4,\tCTOK_FP) \\\n  _(\"double\",\t\t8,\tCTOK_FP) \\\n  _(\"long\",\t\t0,\tCTOK_LONG) \\\n  _(\"short\",\t\t0,\tCTOK_SHORT) \\\n  _(\"_Complex\",\t\t0,\tCTOK_COMPLEX) \\\n  _(\"complex\",\t\t0,\tCTOK_COMPLEX) \\\n  _(\"__complex\",\t0,\tCTOK_COMPLEX) \\\n  _(\"__complex__\",\t0,\tCTOK_COMPLEX) \\\n  _(\"signed\",\t\t0,\tCTOK_SIGNED) \\\n  _(\"__signed\",\t\t0,\tCTOK_SIGNED) \\\n  _(\"__signed__\",\t0,\tCTOK_SIGNED) \\\n  _(\"unsigned\",\t\t0,\tCTOK_UNSIGNED) \\\n  /* Type qualifiers. */ \\\n  _(\"const\",\t\t0,\tCTOK_CONST) \\\n  _(\"__const\",\t\t0,\tCTOK_CONST) \\\n  _(\"__const__\",\t0,\tCTOK_CONST) \\\n  _(\"volatile\",\t\t0,\tCTOK_VOLATILE) \\\n  _(\"__volatile\",\t0,\tCTOK_VOLATILE) \\\n  _(\"__volatile__\",\t0,\tCTOK_VOLATILE) \\\n  _(\"restrict\",\t\t0,\tCTOK_RESTRICT) \\\n  _(\"__restrict\",\t0,\tCTOK_RESTRICT) \\\n  _(\"__restrict__\",\t0,\tCTOK_RESTRICT) \\\n  _(\"inline\",\t\t0,\tCTOK_INLINE) \\\n  _(\"__inline\",\t\t0,\tCTOK_INLINE) \\\n  _(\"__inline__\",\t0,\tCTOK_INLINE) \\\n  /* Storage class specifiers. */ \\\n  _(\"typedef\",\t\t0,\tCTOK_TYPEDEF) \\\n  _(\"extern\",\t\t0,\tCTOK_EXTERN) \\\n  _(\"static\",\t\t0,\tCTOK_STATIC) \\\n  _(\"auto\",\t\t0,\tCTOK_AUTO) \\\n  _(\"register\",\t\t0,\tCTOK_REGISTER) \\\n  /* GCC Attributes. */ \\\n  _(\"__extension__\",\t0,\tCTOK_EXTENSION) \\\n  _(\"__attribute\",\t0,\tCTOK_ATTRIBUTE) \\\n  _(\"__attribute__\",\t0,\tCTOK_ATTRIBUTE) \\\n  _(\"asm\",\t\t0,\tCTOK_ASM) \\\n  _(\"__asm\",\t\t0,\tCTOK_ASM) \\\n  _(\"__asm__\",\t\t0,\tCTOK_ASM) \\\n  /* MSVC Attributes. */ \\\n  _(\"__declspec\",\t0,\tCTOK_DECLSPEC) \\\n  _(\"__cdecl\",\t\tCTCC_CDECL,\tCTOK_CCDECL) \\\n  _(\"__thiscall\",\tCTCC_THISCALL,\tCTOK_CCDECL) \\\n  _(\"__fastcall\",\tCTCC_FASTCALL,\tCTOK_CCDECL) \\\n  _(\"__stdcall\",\tCTCC_STDCALL,\tCTOK_CCDECL) \\\n  _(\"__ptr32\",\t\t4,\tCTOK_PTRSZ) \\\n  _(\"__ptr64\",\t\t8,\tCTOK_PTRSZ) \\\n  /* Other type specifiers. */ \\\n  _(\"struct\",\t\t0,\tCTOK_STRUCT) \\\n  _(\"union\",\t\t0,\tCTOK_UNION) \\\n  _(\"enum\",\t\t0,\tCTOK_ENUM) \\\n  /* Operators. */ \\\n  _(\"sizeof\",\t\t0,\tCTOK_SIZEOF) \\\n  _(\"__alignof\",\t0,\tCTOK_ALIGNOF) \\\n  _(\"__alignof__\",\t0,\tCTOK_ALIGNOF) \\\n  /* End of keyword list. */\n\n/* Type info for predefined types. Size merged in. */\nstatic CTInfo lj_ctype_typeinfo[] = {\n#define CTTYINFODEF(id, sz, ct, info)\tCTINFO((ct),(((sz)&0x3fu)<<10)+(info)),\n#define CTTDINFODEF(name, id)\t\tCTINFO(CT_TYPEDEF, CTID_##id),\n#define CTKWINFODEF(name, sz, kw)\tCTINFO(CT_KW,(((sz)&0x3fu)<<10)+(kw)),\nCTTYDEF(CTTYINFODEF)\nCTTDDEF(CTTDINFODEF)\nCTKWDEF(CTKWINFODEF)\n#undef CTTYINFODEF\n#undef CTTDINFODEF\n#undef CTKWINFODEF\n  0\n};\n\n/* Predefined type names collected in a single string. */\nstatic const char * const lj_ctype_typenames =\n#define CTTDNAMEDEF(name, id)\t\tname \"\\0\"\n#define CTKWNAMEDEF(name, sz, cds)\tname \"\\0\"\nCTTDDEF(CTTDNAMEDEF)\nCTKWDEF(CTKWNAMEDEF)\n#undef CTTDNAMEDEF\n#undef CTKWNAMEDEF\n;\n\n#define CTTYPEINFO_NUM\t\t(sizeof(lj_ctype_typeinfo)/sizeof(CTInfo)-1)\n#ifdef LUAJIT_CTYPE_CHECK_ANCHOR\n#define CTTYPETAB_MIN\t\tCTTYPEINFO_NUM\n#else\n#define CTTYPETAB_MIN\t\t128\n#endif\n\n/* -- C type interning ---------------------------------------------------- */\n\n#define ct_hashtype(info, size)\t(hashrot(info, size) & CTHASH_MASK)\n#define ct_hashname(name) \\\n  (hashrot(u32ptr(name), u32ptr(name) + HASH_BIAS) & CTHASH_MASK)\n\n/* Create new type element. */\nCTypeID lj_ctype_new(CTState *cts, CType **ctp)\n{\n  CTypeID id = cts->top;\n  CType *ct;\n  lua_assert(cts->L);\n  if (LJ_UNLIKELY(id >= cts->sizetab)) {\n    if (id >= CTID_MAX) lj_err_msg(cts->L, LJ_ERR_TABOV);\n#ifdef LUAJIT_CTYPE_CHECK_ANCHOR\n    ct = lj_mem_newvec(cts->L, id+1, CType);\n    memcpy(ct, cts->tab, id*sizeof(CType));\n    memset(cts->tab, 0, id*sizeof(CType));\n    lj_mem_freevec(cts->g, cts->tab, cts->sizetab, CType);\n    cts->tab = ct;\n    cts->sizetab = id+1;\n#else\n    lj_mem_growvec(cts->L, cts->tab, cts->sizetab, CTID_MAX, CType);\n#endif\n  }\n  cts->top = id+1;\n  *ctp = ct = &cts->tab[id];\n  ct->info = 0;\n  ct->size = 0;\n  ct->sib = 0;\n  ct->next = 0;\n  setgcrefnull(ct->name);\n  return id;\n}\n\n/* Intern a type element. */\nCTypeID lj_ctype_intern(CTState *cts, CTInfo info, CTSize size)\n{\n  uint32_t h = ct_hashtype(info, size);\n  CTypeID id = cts->hash[h];\n  lua_assert(cts->L);\n  while (id) {\n    CType *ct = ctype_get(cts, id);\n    if (ct->info == info && ct->size == size)\n      return id;\n    id = ct->next;\n  }\n  id = cts->top;\n  if (LJ_UNLIKELY(id >= cts->sizetab)) {\n    if (id >= CTID_MAX) lj_err_msg(cts->L, LJ_ERR_TABOV);\n    lj_mem_growvec(cts->L, cts->tab, cts->sizetab, CTID_MAX, CType);\n  }\n  cts->top = id+1;\n  cts->tab[id].info = info;\n  cts->tab[id].size = size;\n  cts->tab[id].sib = 0;\n  cts->tab[id].next = cts->hash[h];\n  setgcrefnull(cts->tab[id].name);\n  cts->hash[h] = (CTypeID1)id;\n  return id;\n}\n\n/* Add type element to hash table. */\nstatic void ctype_addtype(CTState *cts, CType *ct, CTypeID id)\n{\n  uint32_t h = ct_hashtype(ct->info, ct->size);\n  ct->next = cts->hash[h];\n  cts->hash[h] = (CTypeID1)id;\n}\n\n/* Add named element to hash table. */\nvoid lj_ctype_addname(CTState *cts, CType *ct, CTypeID id)\n{\n  uint32_t h = ct_hashname(gcref(ct->name));\n  ct->next = cts->hash[h];\n  cts->hash[h] = (CTypeID1)id;\n}\n\n/* Get a C type by name, matching the type mask. */\nCTypeID lj_ctype_getname(CTState *cts, CType **ctp, GCstr *name, uint32_t tmask)\n{\n  CTypeID id = cts->hash[ct_hashname(name)];\n  while (id) {\n    CType *ct = ctype_get(cts, id);\n    if (gcref(ct->name) == obj2gco(name) &&\n\t((tmask >> ctype_type(ct->info)) & 1)) {\n      *ctp = ct;\n      return id;\n    }\n    id = ct->next;\n  }\n  *ctp = &cts->tab[0];  /* Simplify caller logic. ctype_get() would assert. */\n  return 0;\n}\n\n/* Get a struct/union/enum/function field by name. */\nCType *lj_ctype_getfieldq(CTState *cts, CType *ct, GCstr *name, CTSize *ofs,\n\t\t\t  CTInfo *qual)\n{\n  while (ct->sib) {\n    ct = ctype_get(cts, ct->sib);\n    if (gcref(ct->name) == obj2gco(name)) {\n      *ofs = ct->size;\n      return ct;\n    }\n    if (ctype_isxattrib(ct->info, CTA_SUBTYPE)) {\n      CType *fct, *cct = ctype_child(cts, ct);\n      CTInfo q = 0;\n      while (ctype_isattrib(cct->info)) {\n\tif (ctype_attrib(cct->info) == CTA_QUAL) q |= cct->size;\n\tcct = ctype_child(cts, cct);\n      }\n      fct = lj_ctype_getfieldq(cts, cct, name, ofs, qual);\n      if (fct) {\n\tif (qual) *qual |= q;\n\t*ofs += ct->size;\n\treturn fct;\n      }\n    }\n  }\n  return NULL;  /* Not found. */\n}\n\n/* -- C type information -------------------------------------------------- */\n\n/* Follow references and get raw type for a C type ID. */\nCType *lj_ctype_rawref(CTState *cts, CTypeID id)\n{\n  CType *ct = ctype_get(cts, id);\n  while (ctype_isattrib(ct->info) || ctype_isref(ct->info))\n    ct = ctype_child(cts, ct);\n  return ct;\n}\n\n/* Get size for a C type ID. Does NOT support VLA/VLS. */\nCTSize lj_ctype_size(CTState *cts, CTypeID id)\n{\n  CType *ct = ctype_raw(cts, id);\n  return ctype_hassize(ct->info) ? ct->size : CTSIZE_INVALID;\n}\n\n/* Get size for a variable-length C type. Does NOT support other C types. */\nCTSize lj_ctype_vlsize(CTState *cts, CType *ct, CTSize nelem)\n{\n  uint64_t xsz = 0;\n  if (ctype_isstruct(ct->info)) {\n    CTypeID arrid = 0, fid = ct->sib;\n    xsz = ct->size;  /* Add the struct size. */\n    while (fid) {\n      CType *ctf = ctype_get(cts, fid);\n      if (ctype_type(ctf->info) == CT_FIELD)\n\tarrid = ctype_cid(ctf->info);  /* Remember last field of VLS. */\n      fid = ctf->sib;\n    }\n    ct = ctype_raw(cts, arrid);\n  }\n  lua_assert(ctype_isvlarray(ct->info));  /* Must be a VLA. */\n  ct = ctype_rawchild(cts, ct);  /* Get array element. */\n  lua_assert(ctype_hassize(ct->info));\n  /* Calculate actual size of VLA and check for overflow. */\n  xsz += (uint64_t)ct->size * nelem;\n  return xsz < 0x80000000u ? (CTSize)xsz : CTSIZE_INVALID;\n}\n\n/* Get type, qualifiers, size and alignment for a C type ID. */\nCTInfo lj_ctype_info(CTState *cts, CTypeID id, CTSize *szp)\n{\n  CTInfo qual = 0;\n  CType *ct = ctype_get(cts, id);\n  for (;;) {\n    CTInfo info = ct->info;\n    if (ctype_isenum(info)) {\n      /* Follow child. Need to look at its attributes, too. */\n    } else if (ctype_isattrib(info)) {\n      if (ctype_isxattrib(info, CTA_QUAL))\n\tqual |= ct->size;\n      else if (ctype_isxattrib(info, CTA_ALIGN) && !(qual & CTFP_ALIGNED))\n\tqual |= CTFP_ALIGNED + CTALIGN(ct->size);\n    } else {\n      if (!(qual & CTFP_ALIGNED)) qual |= (info & CTF_ALIGN);\n      qual |= (info & ~(CTF_ALIGN|CTMASK_CID));\n      lua_assert(ctype_hassize(info) || ctype_isfunc(info));\n      *szp = ctype_isfunc(info) ? CTSIZE_INVALID : ct->size;\n      break;\n    }\n    ct = ctype_get(cts, ctype_cid(info));\n  }\n  return qual;\n}\n\n/* Get ctype metamethod. */\ncTValue *lj_ctype_meta(CTState *cts, CTypeID id, MMS mm)\n{\n  CType *ct = ctype_get(cts, id);\n  cTValue *tv;\n  while (ctype_isattrib(ct->info) || ctype_isref(ct->info)) {\n    id = ctype_cid(ct->info);\n    ct = ctype_get(cts, id);\n  }\n  if (ctype_isptr(ct->info) &&\n      ctype_isfunc(ctype_get(cts, ctype_cid(ct->info))->info))\n    tv = lj_tab_getstr(cts->miscmap, &cts->g->strempty);\n  else\n    tv = lj_tab_getinth(cts->miscmap, -(int32_t)id);\n  if (tv && tvistab(tv) &&\n      (tv = lj_tab_getstr(tabV(tv), mmname_str(cts->g, mm))) && !tvisnil(tv))\n    return tv;\n  return NULL;\n}\n\n/* -- C type representation ----------------------------------------------- */\n\n/* Fixed max. length of a C type representation. */\n#define CTREPR_MAX\t\t512\n\ntypedef struct CTRepr {\n  char *pb, *pe;\n  CTState *cts;\n  lua_State *L;\n  int needsp;\n  int ok;\n  char buf[CTREPR_MAX];\n} CTRepr;\n\n/* Prepend string. */\nstatic void ctype_prepstr(CTRepr *ctr, const char *str, MSize len)\n{\n  char *p = ctr->pb;\n  if (ctr->buf + len+1 > p) { ctr->ok = 0; return; }\n  if (ctr->needsp) *--p = ' ';\n  ctr->needsp = 1;\n  p -= len;\n  while (len-- > 0) p[len] = str[len];\n  ctr->pb = p;\n}\n\n#define ctype_preplit(ctr, str)\tctype_prepstr((ctr), \"\" str, sizeof(str)-1)\n\n/* Prepend char. */\nstatic void ctype_prepc(CTRepr *ctr, int c)\n{\n  if (ctr->buf >= ctr->pb) { ctr->ok = 0; return; }\n  *--ctr->pb = c;\n}\n\n/* Prepend number. */\nstatic void ctype_prepnum(CTRepr *ctr, uint32_t n)\n{\n  char *p = ctr->pb;\n  if (ctr->buf + 10+1 > p) { ctr->ok = 0; return; }\n  do { *--p = (char)('0' + n % 10); } while (n /= 10);\n  ctr->pb = p;\n  ctr->needsp = 0;\n}\n\n/* Append char. */\nstatic void ctype_appc(CTRepr *ctr, int c)\n{\n  if (ctr->pe >= ctr->buf + CTREPR_MAX) { ctr->ok = 0; return; }\n  *ctr->pe++ = c;\n}\n\n/* Append number. */\nstatic void ctype_appnum(CTRepr *ctr, uint32_t n)\n{\n  char buf[10];\n  char *p = buf+sizeof(buf);\n  char *q = ctr->pe;\n  if (q > ctr->buf + CTREPR_MAX - 10) { ctr->ok = 0; return; }\n  do { *--p = (char)('0' + n % 10); } while (n /= 10);\n  do { *q++ = *p++; } while (p < buf+sizeof(buf));\n  ctr->pe = q;\n}\n\n/* Prepend qualifiers. */\nstatic void ctype_prepqual(CTRepr *ctr, CTInfo info)\n{\n  if ((info & CTF_VOLATILE)) ctype_preplit(ctr, \"volatile\");\n  if ((info & CTF_CONST)) ctype_preplit(ctr, \"const\");\n}\n\n/* Prepend named type. */\nstatic void ctype_preptype(CTRepr *ctr, CType *ct, CTInfo qual, const char *t)\n{\n  if (gcref(ct->name)) {\n    GCstr *str = gco2str(gcref(ct->name));\n    ctype_prepstr(ctr, strdata(str), str->len);\n  } else {\n    if (ctr->needsp) ctype_prepc(ctr, ' ');\n    ctype_prepnum(ctr, ctype_typeid(ctr->cts, ct));\n    ctr->needsp = 1;\n  }\n  ctype_prepstr(ctr, t, (MSize)strlen(t));\n  ctype_prepqual(ctr, qual);\n}\n\nstatic void ctype_repr(CTRepr *ctr, CTypeID id)\n{\n  CType *ct = ctype_get(ctr->cts, id);\n  CTInfo qual = 0;\n  int ptrto = 0;\n  for (;;) {\n    CTInfo info = ct->info;\n    CTSize size = ct->size;\n    switch (ctype_type(info)) {\n    case CT_NUM:\n      if ((info & CTF_BOOL)) {\n\tctype_preplit(ctr, \"bool\");\n      } else if ((info & CTF_FP)) {\n\tif (size == sizeof(double)) ctype_preplit(ctr, \"double\");\n\telse if (size == sizeof(float)) ctype_preplit(ctr, \"float\");\n\telse ctype_preplit(ctr, \"long double\");\n      } else if (size == 1) {\n\tif (!((info ^ CTF_UCHAR) & CTF_UNSIGNED)) ctype_preplit(ctr, \"char\");\n\telse if (CTF_UCHAR) ctype_preplit(ctr, \"signed char\");\n\telse ctype_preplit(ctr, \"unsigned char\");\n      } else if (size < 8) {\n\tif (size == 4) ctype_preplit(ctr, \"int\");\n\telse ctype_preplit(ctr, \"short\");\n\tif ((info & CTF_UNSIGNED)) ctype_preplit(ctr, \"unsigned\");\n      } else {\n\tctype_preplit(ctr, \"_t\");\n\tctype_prepnum(ctr, size*8);\n\tctype_preplit(ctr, \"int\");\n\tif ((info & CTF_UNSIGNED)) ctype_prepc(ctr, 'u');\n      }\n      ctype_prepqual(ctr, (qual|info));\n      return;\n    case CT_VOID:\n      ctype_preplit(ctr, \"void\");\n      ctype_prepqual(ctr, (qual|info));\n      return;\n    case CT_STRUCT:\n      ctype_preptype(ctr, ct, qual, (info & CTF_UNION) ? \"union\" : \"struct\");\n      return;\n    case CT_ENUM:\n      if (id == CTID_CTYPEID) {\n\tctype_preplit(ctr, \"ctype\");\n\treturn;\n      }\n      ctype_preptype(ctr, ct, qual, \"enum\");\n      return;\n    case CT_ATTRIB:\n      if (ctype_attrib(info) == CTA_QUAL) qual |= size;\n      break;\n    case CT_PTR:\n      if ((info & CTF_REF)) {\n\tctype_prepc(ctr, '&');\n      } else {\n\tctype_prepqual(ctr, (qual|info));\n\tif (LJ_64 && size == 4) ctype_preplit(ctr, \"__ptr32\");\n\tctype_prepc(ctr, '*');\n      }\n      qual = 0;\n      ptrto = 1;\n      ctr->needsp = 1;\n      break;\n    case CT_ARRAY:\n      if (ctype_isrefarray(info)) {\n\tctr->needsp = 1;\n\tif (ptrto) { ptrto = 0; ctype_prepc(ctr, '('); ctype_appc(ctr, ')'); }\n\tctype_appc(ctr, '[');\n\tif (size != CTSIZE_INVALID) {\n\t  CTSize csize = ctype_child(ctr->cts, ct)->size;\n\t  ctype_appnum(ctr, csize ? size/csize : 0);\n\t} else if ((info & CTF_VLA)) {\n\t  ctype_appc(ctr, '?');\n\t}\n\tctype_appc(ctr, ']');\n      } else if ((info & CTF_COMPLEX)) {\n\tif (size == 2*sizeof(float)) ctype_preplit(ctr, \"float\");\n\tctype_preplit(ctr, \"complex\");\n\treturn;\n      } else {\n\tctype_preplit(ctr, \")))\");\n\tctype_prepnum(ctr, size);\n\tctype_preplit(ctr, \"__attribute__((vector_size(\");\n      }\n      break;\n    case CT_FUNC:\n      ctr->needsp = 1;\n      if (ptrto) { ptrto = 0; ctype_prepc(ctr, '('); ctype_appc(ctr, ')'); }\n      ctype_appc(ctr, '(');\n      ctype_appc(ctr, ')');\n      break;\n    default:\n      lua_assert(0);\n      break;\n    }\n    ct = ctype_get(ctr->cts, ctype_cid(info));\n  }\n}\n\n/* Return a printable representation of a C type. */\nGCstr *lj_ctype_repr(lua_State *L, CTypeID id, GCstr *name)\n{\n  global_State *g = G(L);\n  CTRepr ctr;\n  ctr.pb = ctr.pe = &ctr.buf[CTREPR_MAX/2];\n  ctr.cts = ctype_ctsG(g);\n  ctr.L = L;\n  ctr.ok = 1;\n  ctr.needsp = 0;\n  if (name) ctype_prepstr(&ctr, strdata(name), name->len);\n  ctype_repr(&ctr, id);\n  if (LJ_UNLIKELY(!ctr.ok)) return lj_str_newlit(L, \"?\");\n  return lj_str_new(L, ctr.pb, ctr.pe - ctr.pb);\n}\n\n/* Convert int64_t/uint64_t to string with 'LL' or 'ULL' suffix. */\nGCstr *lj_ctype_repr_int64(lua_State *L, uint64_t n, int isunsigned)\n{\n  char buf[1+20+3];\n  char *p = buf+sizeof(buf);\n  int sign = 0;\n  *--p = 'L'; *--p = 'L';\n  if (isunsigned) {\n    *--p = 'U';\n  } else if ((int64_t)n < 0) {\n    n = (uint64_t)-(int64_t)n;\n    sign = 1;\n  }\n  do { *--p = (char)('0' + n % 10); } while (n /= 10);\n  if (sign) *--p = '-';\n  return lj_str_new(L, p, (size_t)(buf+sizeof(buf)-p));\n}\n\n/* Convert complex to string with 'i' or 'I' suffix. */\nGCstr *lj_ctype_repr_complex(lua_State *L, void *sp, CTSize size)\n{\n  char buf[2*LJ_STR_NUMBUF+2+1];\n  TValue re, im;\n  size_t len;\n  if (size == 2*sizeof(double)) {\n    re.n = *(double *)sp; im.n = ((double *)sp)[1];\n  } else {\n    re.n = (double)*(float *)sp; im.n = (double)((float *)sp)[1];\n  }\n  len = lj_str_bufnum(buf, &re);\n  if (!(im.u32.hi & 0x80000000u) || im.n != im.n) buf[len++] = '+';\n  len += lj_str_bufnum(buf+len, &im);\n  buf[len] = buf[len-1] >= 'a' ? 'I' : 'i';\n  return lj_str_new(L, buf, len+1);\n}\n\n/* -- C type state -------------------------------------------------------- */\n\n/* Initialize C type table and state. */\nCTState *lj_ctype_init(lua_State *L)\n{\n  CTState *cts = lj_mem_newt(L, sizeof(CTState), CTState);\n  CType *ct = lj_mem_newvec(L, CTTYPETAB_MIN, CType);\n  const char *name = lj_ctype_typenames;\n  CTypeID id;\n  memset(cts, 0, sizeof(CTState));\n  cts->tab = ct;\n  cts->sizetab = CTTYPETAB_MIN;\n  cts->top = CTTYPEINFO_NUM;\n  cts->L = NULL;\n  cts->g = G(L);\n  for (id = 0; id < CTTYPEINFO_NUM; id++, ct++) {\n    CTInfo info = lj_ctype_typeinfo[id];\n    ct->size = (CTSize)((int32_t)(info << 16) >> 26);\n    ct->info = info & 0xffff03ffu;\n    ct->sib = 0;\n    if (ctype_type(info) == CT_KW || ctype_istypedef(info)) {\n      size_t len = strlen(name);\n      GCstr *str = lj_str_new(L, name, len);\n      ctype_setname(ct, str);\n      name += len+1;\n      lj_ctype_addname(cts, ct, id);\n    } else {\n      setgcrefnull(ct->name);\n      ct->next = 0;\n      if (!ctype_isenum(info)) ctype_addtype(cts, ct, id);\n    }\n  }\n  setmref(G(L)->ctype_state, cts);\n  return cts;\n}\n\n/* Free C type table and state. */\nvoid lj_ctype_freestate(global_State *g)\n{\n  CTState *cts = ctype_ctsG(g);\n  if (cts) {\n    lj_ccallback_mcode_free(cts);\n    lj_mem_freevec(g, cts->tab, cts->sizetab, CType);\n    lj_mem_freevec(g, cts->cb.cbid, cts->cb.sizeid, CTypeID1);\n    lj_mem_freet(g, cts);\n  }\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ctype.h",
    "content": "/*\n** C type management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_CTYPE_H\n#define _LJ_CTYPE_H\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n\n#if LJ_HASFFI\n\n/* -- C type definitions -------------------------------------------------- */\n\n/* C type numbers. Highest 4 bits of C type info. ORDER CT. */\nenum {\n  /* Externally visible types. */\n  CT_NUM,\t\t/* Integer or floating-point numbers. */\n  CT_STRUCT,\t\t/* Struct or union. */\n  CT_PTR,\t\t/* Pointer or reference. */\n  CT_ARRAY,\t\t/* Array or complex type. */\n  CT_MAYCONVERT = CT_ARRAY,\n  CT_VOID,\t\t/* Void type. */\n  CT_ENUM,\t\t/* Enumeration. */\n  CT_HASSIZE = CT_ENUM,  /* Last type where ct->size holds the actual size. */\n  CT_FUNC,\t\t/* Function. */\n  CT_TYPEDEF,\t\t/* Typedef. */\n  CT_ATTRIB,\t\t/* Miscellaneous attributes. */\n  /* Internal element types. */\n  CT_FIELD,\t\t/* Struct/union field or function parameter. */\n  CT_BITFIELD,\t\t/* Struct/union bitfield. */\n  CT_CONSTVAL,\t\t/* Constant value. */\n  CT_EXTERN,\t\t/* External reference. */\n  CT_KW\t\t\t/* Keyword. */\n};\n\nLJ_STATIC_ASSERT(((int)CT_PTR & (int)CT_ARRAY) == CT_PTR);\nLJ_STATIC_ASSERT(((int)CT_STRUCT & (int)CT_ARRAY) == CT_STRUCT);\n\n/*\n**  ---------- info ------------\n** |type      flags...  A   cid | size   |  sib  | next  | name  |\n** +----------------------------+--------+-------+-------+-------+--\n** |NUM       BFvcUL..  A       | size   |       | type  |       |\n** |STRUCT    ..vcU..V  A       | size   | field | name? | name? |\n** |PTR       ..vcR...  A   cid | size   |       | type  |       |\n** |ARRAY     VCvc...V  A   cid | size   |       | type  |       |\n** |VOID      ..vc....  A       | size   |       | type  |       |\n** |ENUM                A   cid | size   | const | name? | name? |\n** |FUNC      ....VS.. cc   cid | nargs  | field | name? | name? |\n** |TYPEDEF                 cid |        |       | name  | name  |\n** |ATTRIB        attrnum   cid | attr   | sib?  | type? |       |\n** |FIELD                   cid | offset | field |       | name? |\n** |BITFIELD  B.vcU csz bsz pos | offset | field |       | name? |\n** |CONSTVAL     c          cid | value  | const | name  | name  |\n** |EXTERN                  cid |        | sib?  | name  | name  |\n** |KW                      tok | size   |       | name  | name  |\n** +----------------------------+--------+-------+-------+-------+--\n**        ^^  ^^--- bits used for C type conversion dispatch\n*/\n\n/* C type info flags.     TFFArrrr  */\n#define CTF_BOOL\t0x08000000u\t/* Boolean: NUM, BITFIELD. */\n#define CTF_FP\t\t0x04000000u\t/* Floating-point: NUM. */\n#define CTF_CONST\t0x02000000u\t/* Const qualifier. */\n#define CTF_VOLATILE\t0x01000000u\t/* Volatile qualifier. */\n#define CTF_UNSIGNED\t0x00800000u\t/* Unsigned: NUM, BITFIELD. */\n#define CTF_LONG\t0x00400000u\t/* Long: NUM. */\n#define CTF_VLA\t\t0x00100000u\t/* Variable-length: ARRAY, STRUCT. */\n#define CTF_REF\t\t0x00800000u\t/* Reference: PTR. */\n#define CTF_VECTOR\t0x08000000u\t/* Vector: ARRAY. */\n#define CTF_COMPLEX\t0x04000000u\t/* Complex: ARRAY. */\n#define CTF_UNION\t0x00800000u\t/* Union: STRUCT. */\n#define CTF_VARARG\t0x00800000u\t/* Vararg: FUNC. */\n#define CTF_SSEREGPARM\t0x00400000u\t/* SSE register parameters: FUNC. */\n\n#define CTF_QUAL\t(CTF_CONST|CTF_VOLATILE)\n#define CTF_ALIGN\t(CTMASK_ALIGN<<CTSHIFT_ALIGN)\n#define CTF_UCHAR\t((char)-1 > 0 ? CTF_UNSIGNED : 0)\n\n/* Flags used in parser.  .F.Ammvf   cp->attr  */\n#define CTFP_ALIGNED\t0x00000001u\t/* cp->attr + ALIGN */\n#define CTFP_PACKED\t0x00000002u\t/* cp->attr */\n/*                        ...C...f   cp->fattr */\n#define CTFP_CCONV\t0x00000001u\t/* cp->fattr + CCONV/[SSE]REGPARM */\n\n/* C type info bitfields. */\n#define CTMASK_CID\t0x0000ffffu\t/* Max. 65536 type IDs. */\n#define CTMASK_NUM\t0xf0000000u\t/* Max. 16 type numbers. */\n#define CTSHIFT_NUM\t28\n#define CTMASK_ALIGN\t15\t\t/* Max. alignment is 2^15. */\n#define CTSHIFT_ALIGN\t16\n#define CTMASK_ATTRIB\t255\t\t/* Max. 256 attributes. */\n#define CTSHIFT_ATTRIB\t16\n#define CTMASK_CCONV\t3\t\t/* Max. 4 calling conventions. */\n#define CTSHIFT_CCONV\t16\n#define CTMASK_REGPARM\t3\t\t/* Max. 0-3 regparms. */\n#define CTSHIFT_REGPARM\t18\n/* Bitfields only used in parser. */\n#define CTMASK_VSIZEP\t15\t\t/* Max. vector size is 2^15. */\n#define CTSHIFT_VSIZEP\t4\n#define CTMASK_MSIZEP\t255\t\t/* Max. type size (via mode) is 128. */\n#define CTSHIFT_MSIZEP\t8\n\n/* Info bits for BITFIELD. Max. size of bitfield is 64 bits. */\n#define CTBSZ_MAX\t32\t\t/* Max. size of bitfield is 32 bit. */\n#define CTBSZ_FIELD\t127\t\t/* Temp. marker for regular field. */\n#define CTMASK_BITPOS\t127\n#define CTMASK_BITBSZ\t127\n#define CTMASK_BITCSZ\t127\n#define CTSHIFT_BITPOS\t0\n#define CTSHIFT_BITBSZ\t8\n#define CTSHIFT_BITCSZ\t16\n\n#define CTF_INSERT(info, field, val) \\\n  info = (info & ~(CTMASK_##field<<CTSHIFT_##field)) | \\\n\t  (((CTSize)(val) & CTMASK_##field) << CTSHIFT_##field)\n\n/* Calling conventions. ORDER CC */\nenum { CTCC_CDECL, CTCC_THISCALL, CTCC_FASTCALL, CTCC_STDCALL };\n\n/* Attribute numbers. */\nenum {\n  CTA_NONE,\t\t/* Ignored attribute. Must be zero. */\n  CTA_QUAL,\t\t/* Unmerged qualifiers. */\n  CTA_ALIGN,\t\t/* Alignment override. */\n  CTA_SUBTYPE,\t\t/* Transparent sub-type. */\n  CTA_REDIR,\t\t/* Redirected symbol name. */\n  CTA_BAD,\t\t/* To catch bad IDs. */\n  CTA__MAX\n};\n\n/* Special sizes. */\n#define CTSIZE_INVALID\t0xffffffffu\n\ntypedef uint32_t CTInfo;\t/* Type info. */\ntypedef uint32_t CTSize;\t/* Type size. */\ntypedef uint32_t CTypeID;\t/* Type ID. */\ntypedef uint16_t CTypeID1;\t/* Minimum-sized type ID. */\n\n/* C type table element. */\ntypedef struct CType {\n  CTInfo info;\t\t/* Type info. */\n  CTSize size;\t\t/* Type size or other info. */\n  CTypeID1 sib;\t\t/* Sibling element. */\n  CTypeID1 next;\t/* Next element in hash chain. */\n  GCRef name;\t\t/* Element name (GCstr). */\n} CType;\n\n#define CTHASH_SIZE\t128\t/* Number of hash anchors. */\n#define CTHASH_MASK\t(CTHASH_SIZE-1)\n\n/* Simplify target-specific configuration. Checked in lj_ccall.h. */\n#define CCALL_MAX_GPR\t\t8\n#define CCALL_MAX_FPR\t\t8\n\ntypedef LJ_ALIGN(8) union FPRCBArg { double d; float f[2]; } FPRCBArg;\n\n/* C callback state. Defined here, to avoid dragging in lj_ccall.h. */\n\ntypedef LJ_ALIGN(8) struct CCallback {\n  FPRCBArg fpr[CCALL_MAX_FPR];\t/* Arguments/results in FPRs. */\n  intptr_t gpr[CCALL_MAX_GPR];\t/* Arguments/results in GPRs. */\n  intptr_t *stack;\t\t/* Pointer to arguments on stack. */\n  void *mcode;\t\t\t/* Machine code for callback func. pointers. */\n  CTypeID1 *cbid;\t\t/* Callback type table. */\n  MSize sizeid;\t\t\t/* Size of callback type table. */\n  MSize topid;\t\t\t/* Highest unused callback type table slot. */\n  MSize slot;\t\t\t/* Current callback slot. */\n} CCallback;\n\n/* C type state. */\ntypedef struct CTState {\n  CType *tab;\t\t/* C type table. */\n  CTypeID top;\t\t/* Current top of C type table. */\n  MSize sizetab;\t/* Size of C type table. */\n  lua_State *L;\t\t/* Lua state (needed for errors and allocations). */\n  global_State *g;\t/* Global state. */\n  GCtab *finalizer;\t/* Map of cdata to finalizer. */\n  GCtab *miscmap;\t/* Map of -CTypeID to metatable and cb slot to func. */\n  CCallback cb;\t\t/* Temporary callback state. */\n  CTypeID1 hash[CTHASH_SIZE];  /* Hash anchors for C type table. */\n} CTState;\n\n#define CTINFO(ct, flags)\t(((CTInfo)(ct) << CTSHIFT_NUM) + (flags))\n#define CTALIGN(al)\t\t((CTSize)(al) << CTSHIFT_ALIGN)\n#define CTATTRIB(at)\t\t((CTInfo)(at) << CTSHIFT_ATTRIB)\n\n#define ctype_type(info)\t((info) >> CTSHIFT_NUM)\n#define ctype_cid(info)\t\t((CTypeID)((info) & CTMASK_CID))\n#define ctype_align(info)\t(((info) >> CTSHIFT_ALIGN) & CTMASK_ALIGN)\n#define ctype_attrib(info)\t(((info) >> CTSHIFT_ATTRIB) & CTMASK_ATTRIB)\n#define ctype_bitpos(info)\t(((info) >> CTSHIFT_BITPOS) & CTMASK_BITPOS)\n#define ctype_bitbsz(info)\t(((info) >> CTSHIFT_BITBSZ) & CTMASK_BITBSZ)\n#define ctype_bitcsz(info)\t(((info) >> CTSHIFT_BITCSZ) & CTMASK_BITCSZ)\n#define ctype_vsizeP(info)\t(((info) >> CTSHIFT_VSIZEP) & CTMASK_VSIZEP)\n#define ctype_msizeP(info)\t(((info) >> CTSHIFT_MSIZEP) & CTMASK_MSIZEP)\n#define ctype_cconv(info)\t(((info) >> CTSHIFT_CCONV) & CTMASK_CCONV)\n\n/* Simple type checks. */\n#define ctype_isnum(info)\t(ctype_type((info)) == CT_NUM)\n#define ctype_isvoid(info)\t(ctype_type((info)) == CT_VOID)\n#define ctype_isptr(info)\t(ctype_type((info)) == CT_PTR)\n#define ctype_isarray(info)\t(ctype_type((info)) == CT_ARRAY)\n#define ctype_isstruct(info)\t(ctype_type((info)) == CT_STRUCT)\n#define ctype_isfunc(info)\t(ctype_type((info)) == CT_FUNC)\n#define ctype_isenum(info)\t(ctype_type((info)) == CT_ENUM)\n#define ctype_istypedef(info)\t(ctype_type((info)) == CT_TYPEDEF)\n#define ctype_isattrib(info)\t(ctype_type((info)) == CT_ATTRIB)\n#define ctype_isfield(info)\t(ctype_type((info)) == CT_FIELD)\n#define ctype_isbitfield(info)\t(ctype_type((info)) == CT_BITFIELD)\n#define ctype_isconstval(info)\t(ctype_type((info)) == CT_CONSTVAL)\n#define ctype_isextern(info)\t(ctype_type((info)) == CT_EXTERN)\n#define ctype_hassize(info)\t(ctype_type((info)) <= CT_HASSIZE)\n\n/* Combined type and flag checks. */\n#define ctype_isinteger(info) \\\n  (((info) & (CTMASK_NUM|CTF_BOOL|CTF_FP)) == CTINFO(CT_NUM, 0))\n#define ctype_isinteger_or_bool(info) \\\n  (((info) & (CTMASK_NUM|CTF_FP)) == CTINFO(CT_NUM, 0))\n#define ctype_isbool(info) \\\n  (((info) & (CTMASK_NUM|CTF_BOOL)) == CTINFO(CT_NUM, CTF_BOOL))\n#define ctype_isfp(info) \\\n  (((info) & (CTMASK_NUM|CTF_FP)) == CTINFO(CT_NUM, CTF_FP))\n\n#define ctype_ispointer(info) \\\n  ((ctype_type(info) >> 1) == (CT_PTR >> 1))  /* Pointer or array. */\n#define ctype_isref(info) \\\n  (((info) & (CTMASK_NUM|CTF_REF)) == CTINFO(CT_PTR, CTF_REF))\n\n#define ctype_isrefarray(info) \\\n  (((info) & (CTMASK_NUM|CTF_VECTOR|CTF_COMPLEX)) == CTINFO(CT_ARRAY, 0))\n#define ctype_isvector(info) \\\n  (((info) & (CTMASK_NUM|CTF_VECTOR)) == CTINFO(CT_ARRAY, CTF_VECTOR))\n#define ctype_iscomplex(info) \\\n  (((info) & (CTMASK_NUM|CTF_COMPLEX)) == CTINFO(CT_ARRAY, CTF_COMPLEX))\n\n#define ctype_isvltype(info) \\\n  (((info) & ((CTMASK_NUM|CTF_VLA) - (2u<<CTSHIFT_NUM))) == \\\n   CTINFO(CT_STRUCT, CTF_VLA))  /* VL array or VL struct. */\n#define ctype_isvlarray(info) \\\n  (((info) & (CTMASK_NUM|CTF_VLA)) == CTINFO(CT_ARRAY, CTF_VLA))\n\n#define ctype_isxattrib(info, at) \\\n  (((info) & (CTMASK_NUM|CTATTRIB(CTMASK_ATTRIB))) == \\\n   CTINFO(CT_ATTRIB, CTATTRIB(at)))\n\n/* Target-dependent sizes and alignments. */\n#if LJ_64\n#define CTSIZE_PTR\t8\n#define CTALIGN_PTR\tCTALIGN(3)\n#else\n#define CTSIZE_PTR\t4\n#define CTALIGN_PTR\tCTALIGN(2)\n#endif\n\n#define CTINFO_REF(ref) \\\n  CTINFO(CT_PTR, (CTF_CONST|CTF_REF|CTALIGN_PTR) + (ref))\n\n#define CT_MEMALIGN\t3\t/* Alignment guaranteed by memory allocator. */\n\n/* -- Predefined types ---------------------------------------------------- */\n\n/* Target-dependent types. */\n#if LJ_TARGET_PPC || LJ_TARGET_PPCSPE\n#define CTTYDEFP(_) \\\n  _(LINT32,\t\t4,\tCT_NUM, CTF_LONG|CTALIGN(2))\n#else\n#define CTTYDEFP(_)\n#endif\n\n/* Common types. */\n#define CTTYDEF(_) \\\n  _(NONE,\t\t0,\tCT_ATTRIB, CTATTRIB(CTA_BAD)) \\\n  _(VOID,\t\t-1,\tCT_VOID, CTALIGN(0)) \\\n  _(CVOID,\t\t-1,\tCT_VOID, CTF_CONST|CTALIGN(0)) \\\n  _(BOOL,\t\t1,\tCT_NUM, CTF_BOOL|CTF_UNSIGNED|CTALIGN(0)) \\\n  _(CCHAR,\t\t1,\tCT_NUM, CTF_CONST|CTF_UCHAR|CTALIGN(0)) \\\n  _(INT8,\t\t1,\tCT_NUM, CTALIGN(0)) \\\n  _(UINT8,\t\t1,\tCT_NUM, CTF_UNSIGNED|CTALIGN(0)) \\\n  _(INT16,\t\t2,\tCT_NUM, CTALIGN(1)) \\\n  _(UINT16,\t\t2,\tCT_NUM, CTF_UNSIGNED|CTALIGN(1)) \\\n  _(INT32,\t\t4,\tCT_NUM, CTALIGN(2)) \\\n  _(UINT32,\t\t4,\tCT_NUM, CTF_UNSIGNED|CTALIGN(2)) \\\n  _(INT64,\t\t8,\tCT_NUM, CTF_LONG|CTALIGN(3)) \\\n  _(UINT64,\t\t8,\tCT_NUM, CTF_UNSIGNED|CTF_LONG|CTALIGN(3)) \\\n  _(FLOAT,\t\t4,\tCT_NUM, CTF_FP|CTALIGN(2)) \\\n  _(DOUBLE,\t\t8,\tCT_NUM, CTF_FP|CTALIGN(3)) \\\n  _(COMPLEX_FLOAT,\t8,\tCT_ARRAY, CTF_COMPLEX|CTALIGN(2)|CTID_FLOAT) \\\n  _(COMPLEX_DOUBLE,\t16,\tCT_ARRAY, CTF_COMPLEX|CTALIGN(3)|CTID_DOUBLE) \\\n  _(P_VOID,\tCTSIZE_PTR,\tCT_PTR, CTALIGN_PTR|CTID_VOID) \\\n  _(P_CVOID,\tCTSIZE_PTR,\tCT_PTR, CTALIGN_PTR|CTID_CVOID) \\\n  _(P_CCHAR,\tCTSIZE_PTR,\tCT_PTR, CTALIGN_PTR|CTID_CCHAR) \\\n  _(A_CCHAR,\t\t-1,\tCT_ARRAY, CTF_CONST|CTALIGN(0)|CTID_CCHAR) \\\n  _(CTYPEID,\t\t4,\tCT_ENUM, CTALIGN(2)|CTID_INT32) \\\n  CTTYDEFP(_) \\\n  /* End of type list. */\n\n/* Public predefined type IDs. */\nenum {\n#define CTTYIDDEF(id, sz, ct, info)\tCTID_##id,\nCTTYDEF(CTTYIDDEF)\n#undef CTTYIDDEF\n  /* Predefined typedefs and keywords follow. */\n  CTID_MAX = 65536\n};\n\n/* Target-dependent type IDs. */\n#if LJ_64\n#define CTID_INT_PSZ\tCTID_INT64\n#define CTID_UINT_PSZ\tCTID_UINT64\n#else\n#define CTID_INT_PSZ\tCTID_INT32\n#define CTID_UINT_PSZ\tCTID_UINT32\n#endif\n\n#if LJ_ABI_WIN\n#define CTID_WCHAR\tCTID_UINT16\n#elif LJ_TARGET_PPC\n#define CTID_WCHAR\tCTID_LINT32\n#else\n#define CTID_WCHAR\tCTID_INT32\n#endif\n\n/* -- C tokens and keywords ----------------------------------------------- */\n\n/* C lexer keywords. */\n#define CTOKDEF(_) \\\n  _(IDENT, \"<identifier>\") _(STRING, \"<string>\") \\\n  _(INTEGER, \"<integer>\") _(EOF, \"<eof>\") \\\n  _(OROR, \"||\") _(ANDAND, \"&&\") _(EQ, \"==\") _(NE, \"!=\") \\\n  _(LE, \"<=\") _(GE, \">=\") _(SHL, \"<<\") _(SHR, \">>\") _(DEREF, \"->\")\n\n/* Simple declaration specifiers. */\n#define CDSDEF(_) \\\n  _(VOID) _(BOOL) _(CHAR) _(INT) _(FP) \\\n  _(LONG) _(LONGLONG) _(SHORT) _(COMPLEX) _(SIGNED) _(UNSIGNED) \\\n  _(CONST) _(VOLATILE) _(RESTRICT) _(INLINE) \\\n  _(TYPEDEF) _(EXTERN) _(STATIC) _(AUTO) _(REGISTER)\n\n/* C keywords. */\n#define CKWDEF(_) \\\n  CDSDEF(_) _(EXTENSION) _(ASM) _(ATTRIBUTE) \\\n  _(DECLSPEC) _(CCDECL) _(PTRSZ) \\\n  _(STRUCT) _(UNION) _(ENUM) \\\n  _(SIZEOF) _(ALIGNOF)\n\n/* C token numbers. */\nenum {\n  CTOK_OFS = 255,\n#define CTOKNUM(name, sym)\tCTOK_##name,\n#define CKWNUM(name)\t\tCTOK_##name,\nCTOKDEF(CTOKNUM)\nCKWDEF(CKWNUM)\n#undef CTOKNUM\n#undef CKWNUM\n  CTOK_FIRSTDECL = CTOK_VOID,\n  CTOK_FIRSTSCL = CTOK_TYPEDEF,\n  CTOK_LASTDECLFLAG = CTOK_REGISTER,\n  CTOK_LASTDECL = CTOK_ENUM\n};\n\n/* Declaration specifier flags. */\nenum {\n#define CDSFLAG(name)\tCDF_##name = (1u << (CTOK_##name - CTOK_FIRSTDECL)),\nCDSDEF(CDSFLAG)\n#undef CDSFLAG\n  CDF__END\n};\n\n#define CDF_SCL  (CDF_TYPEDEF|CDF_EXTERN|CDF_STATIC|CDF_AUTO|CDF_REGISTER)\n\n/* -- C type management --------------------------------------------------- */\n\n#define ctype_ctsG(g)\t\t(mref((g)->ctype_state, CTState))\n\n/* Get C type state. */\nstatic LJ_AINLINE CTState *ctype_cts(lua_State *L)\n{\n  CTState *cts = ctype_ctsG(G(L));\n  cts->L = L;  /* Save L for errors and allocations. */\n  return cts;\n}\n\n/* Save and restore state of C type table. */\n#define LJ_CTYPE_SAVE(cts)\tCTState savects_ = *(cts)\n#define LJ_CTYPE_RESTORE(cts) \\\n  ((cts)->top = savects_.top, \\\n   memcpy((cts)->hash, savects_.hash, sizeof(savects_.hash)))\n\n/* Check C type ID for validity when assertions are enabled. */\nstatic LJ_AINLINE CTypeID ctype_check(CTState *cts, CTypeID id)\n{\n  lua_assert(id > 0 && id < cts->top); UNUSED(cts);\n  return id;\n}\n\n/* Get C type for C type ID. */\nstatic LJ_AINLINE CType *ctype_get(CTState *cts, CTypeID id)\n{\n  return &cts->tab[ctype_check(cts, id)];\n}\n\n/* Get C type ID for a C type. */\n#define ctype_typeid(cts, ct)\t((CTypeID)((ct) - (cts)->tab))\n\n/* Get child C type. */\nstatic LJ_AINLINE CType *ctype_child(CTState *cts, CType *ct)\n{\n  lua_assert(!(ctype_isvoid(ct->info) || ctype_isstruct(ct->info) ||\n\t     ctype_isbitfield(ct->info)));  /* These don't have children. */\n  return ctype_get(cts, ctype_cid(ct->info));\n}\n\n/* Get raw type for a C type ID. */\nstatic LJ_AINLINE CType *ctype_raw(CTState *cts, CTypeID id)\n{\n  CType *ct = ctype_get(cts, id);\n  while (ctype_isattrib(ct->info)) ct = ctype_child(cts, ct);\n  return ct;\n}\n\n/* Get raw type of the child of a C type. */\nstatic LJ_AINLINE CType *ctype_rawchild(CTState *cts, CType *ct)\n{\n  do { ct = ctype_child(cts, ct); } while (ctype_isattrib(ct->info));\n  return ct;\n}\n\n/* Set the name of a C type table element. */\nstatic LJ_AINLINE void ctype_setname(CType *ct, GCstr *s)\n{\n  /* NOBARRIER: mark string as fixed -- the C type table is never collected. */\n  fixstring(s);\n  setgcref(ct->name, obj2gco(s));\n}\n\nLJ_FUNC CTypeID lj_ctype_new(CTState *cts, CType **ctp);\nLJ_FUNC CTypeID lj_ctype_intern(CTState *cts, CTInfo info, CTSize size);\nLJ_FUNC void lj_ctype_addname(CTState *cts, CType *ct, CTypeID id);\nLJ_FUNC CTypeID lj_ctype_getname(CTState *cts, CType **ctp, GCstr *name,\n\t\t\t\t uint32_t tmask);\nLJ_FUNC CType *lj_ctype_getfieldq(CTState *cts, CType *ct, GCstr *name,\n\t\t\t\t  CTSize *ofs, CTInfo *qual);\n#define lj_ctype_getfield(cts, ct, name, ofs) \\\n  lj_ctype_getfieldq((cts), (ct), (name), (ofs), NULL)\nLJ_FUNC CType *lj_ctype_rawref(CTState *cts, CTypeID id);\nLJ_FUNC CTSize lj_ctype_size(CTState *cts, CTypeID id);\nLJ_FUNC CTSize lj_ctype_vlsize(CTState *cts, CType *ct, CTSize nelem);\nLJ_FUNC CTInfo lj_ctype_info(CTState *cts, CTypeID id, CTSize *szp);\nLJ_FUNC cTValue *lj_ctype_meta(CTState *cts, CTypeID id, MMS mm);\nLJ_FUNC GCstr *lj_ctype_repr(lua_State *L, CTypeID id, GCstr *name);\nLJ_FUNC GCstr *lj_ctype_repr_int64(lua_State *L, uint64_t n, int isunsigned);\nLJ_FUNC GCstr *lj_ctype_repr_complex(lua_State *L, void *sp, CTSize size);\nLJ_FUNC CTState *lj_ctype_init(lua_State *L);\nLJ_FUNC void lj_ctype_freestate(global_State *g);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_debug.c",
    "content": "/*\n** Debugging and introspection.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_debug_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_state.h\"\n#include \"lj_frame.h\"\n#include \"lj_bc.h\"\n#if LJ_HASJIT\n#include \"lj_jit.h\"\n#endif\n\n/* -- Frames -------------------------------------------------------------- */\n\n/* Get frame corresponding to a level. */\ncTValue *lj_debug_frame(lua_State *L, int level, int *size)\n{\n  cTValue *frame, *nextframe, *bot = tvref(L->stack);\n  /* Traverse frames backwards. */\n  for (nextframe = frame = L->base-1; frame > bot; ) {\n    if (frame_gc(frame) == obj2gco(L))\n      level++;  /* Skip dummy frames. See lj_meta_call(). */\n    if (level-- == 0) {\n      *size = (int)(nextframe - frame);\n      return frame;  /* Level found. */\n    }\n    nextframe = frame;\n    if (frame_islua(frame)) {\n      frame = frame_prevl(frame);\n    } else {\n      if (frame_isvarg(frame))\n\tlevel++;  /* Skip vararg pseudo-frame. */\n      frame = frame_prevd(frame);\n    }\n  }\n  *size = level;\n  return NULL;  /* Level not found. */\n}\n\n/* Invalid bytecode position. */\n#define NO_BCPOS\t(~(BCPos)0)\n\n/* Return bytecode position for function/frame or NO_BCPOS. */\nstatic BCPos debug_framepc(lua_State *L, GCfunc *fn, cTValue *nextframe)\n{\n  const BCIns *ins;\n  GCproto *pt;\n  BCPos pos;\n  lua_assert(fn->c.gct == ~LJ_TFUNC || fn->c.gct == ~LJ_TTHREAD);\n  if (!isluafunc(fn)) {  /* Cannot derive a PC for non-Lua functions. */\n    return NO_BCPOS;\n  } else if (nextframe == NULL) {  /* Lua function on top. */\n    void *cf = cframe_raw(L->cframe);\n    if (cf == NULL || (char *)cframe_pc(cf) == (char *)cframe_L(cf))\n      return NO_BCPOS;\n    ins = cframe_pc(cf);  /* Only happens during error/hook handling. */\n  } else {\n    if (frame_islua(nextframe)) {\n      ins = frame_pc(nextframe);\n    } else if (frame_iscont(nextframe)) {\n      ins = frame_contpc(nextframe);\n    } else {\n      /* Lua function below errfunc/gc/hook: find cframe to get the PC. */\n      void *cf = cframe_raw(L->cframe);\n      TValue *f = L->base-1;\n      if (cf == NULL)\n\treturn NO_BCPOS;\n      while (f > nextframe) {\n\tif (frame_islua(f)) {\n\t  f = frame_prevl(f);\n\t} else {\n\t  if (frame_isc(f))\n\t    cf = cframe_raw(cframe_prev(cf));\n\t  f = frame_prevd(f);\n\t}\n      }\n      if (cframe_prev(cf))\n\tcf = cframe_raw(cframe_prev(cf));\n      ins = cframe_pc(cf);\n    }\n  }\n  pt = funcproto(fn);\n  pos = proto_bcpos(pt, ins) - 1;\n#if LJ_HASJIT\n  if (pos > pt->sizebc) {  /* Undo the effects of lj_trace_exit for JLOOP. */\n    GCtrace *T = (GCtrace *)((char *)(ins-1) - offsetof(GCtrace, startins));\n    lua_assert(bc_isret(bc_op(ins[-1])));\n    pos = proto_bcpos(pt, mref(T->startpc, const BCIns));\n  }\n#endif\n  return pos;\n}\n\n/* -- Line numbers -------------------------------------------------------- */\n\n/* Get line number for a bytecode position. */\nBCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc)\n{\n  const void *lineinfo = proto_lineinfo(pt);\n  if (pc <= pt->sizebc && lineinfo) {\n    BCLine first = pt->firstline;\n    if (pc == pt->sizebc) return first + pt->numline;\n    if (pc-- == 0) return first;\n    if (pt->numline < 256)\n      return first + (BCLine)((const uint8_t *)lineinfo)[pc];\n    else if (pt->numline < 65536)\n      return first + (BCLine)((const uint16_t *)lineinfo)[pc];\n    else\n      return first + (BCLine)((const uint32_t *)lineinfo)[pc];\n  }\n  return 0;\n}\n\n/* Get line number for function/frame. */\nstatic BCLine debug_frameline(lua_State *L, GCfunc *fn, cTValue *nextframe)\n{\n  BCPos pc = debug_framepc(L, fn, nextframe);\n  if (pc != NO_BCPOS) {\n    GCproto *pt = funcproto(fn);\n    lua_assert(pc <= pt->sizebc);\n    return lj_debug_line(pt, pc);\n  }\n  return -1;\n}\n\n/* -- Variable names ------------------------------------------------------ */\n\n/* Read ULEB128 value. */\nstatic uint32_t debug_read_uleb128(const uint8_t **pp)\n{\n  const uint8_t *p = *pp;\n  uint32_t v = *p++;\n  if (LJ_UNLIKELY(v >= 0x80)) {\n    int sh = 0;\n    v &= 0x7f;\n    do { v |= ((*p & 0x7f) << (sh += 7)); } while (*p++ >= 0x80);\n  }\n  *pp = p;\n  return v;\n}\n\n/* Get name of a local variable from slot number and PC. */\nstatic const char *debug_varname(const GCproto *pt, BCPos pc, BCReg slot)\n{\n  const uint8_t *p = proto_varinfo(pt);\n  if (p) {\n    BCPos lastpc = 0;\n    for (;;) {\n      const char *name = (const char *)p;\n      uint32_t vn = *p++;\n      BCPos startpc, endpc;\n      if (vn < VARNAME__MAX) {\n\tif (vn == VARNAME_END) break;  /* End of varinfo. */\n      } else {\n\twhile (*p++) ;  /* Skip over variable name string. */\n      }\n      lastpc = startpc = lastpc + debug_read_uleb128(&p);\n      if (startpc > pc) break;\n      endpc = startpc + debug_read_uleb128(&p);\n      if (pc < endpc && slot-- == 0) {\n\tif (vn < VARNAME__MAX) {\n#define VARNAMESTR(name, str)\tstr \"\\0\"\n\t  name = VARNAMEDEF(VARNAMESTR);\n#undef VARNAMESTR\n\t  if (--vn) while (*name++ || --vn) ;\n\t}\n\treturn name;\n      }\n    }\n  }\n  return NULL;\n}\n\n/* Get name of local variable from 1-based slot number and function/frame. */\nstatic TValue *debug_localname(lua_State *L, const lua_Debug *ar,\n\t\t\t       const char **name, BCReg slot1)\n{\n  uint32_t offset = (uint32_t)ar->i_ci & 0xffff;\n  uint32_t size = (uint32_t)ar->i_ci >> 16;\n  TValue *frame = tvref(L->stack) + offset;\n  TValue *nextframe = size ? frame + size : NULL;\n  GCfunc *fn = frame_func(frame);\n  BCPos pc = debug_framepc(L, fn, nextframe);\n  if (!nextframe) nextframe = L->top;\n  if ((int)slot1 < 0) {  /* Negative slot number is for varargs. */\n    if (pc != NO_BCPOS) {\n      GCproto *pt = funcproto(fn);\n      if ((pt->flags & PROTO_VARARG)) {\n\tslot1 = pt->numparams + (BCReg)(-(int)slot1);\n\tif (frame_isvarg(frame)) {  /* Vararg frame has been set up? (pc!=0) */\n\t  nextframe = frame;\n\t  frame = frame_prevd(frame);\n\t}\n\tif (frame + slot1 < nextframe) {\n\t  *name = \"(*vararg)\";\n\t  return frame+slot1;\n\t}\n      }\n    }\n    return NULL;\n  }\n  if (pc != NO_BCPOS &&\n      (*name = debug_varname(funcproto(fn), pc, slot1-1)) != NULL)\n    ;\n  else if (slot1 > 0 && frame + slot1 < nextframe)\n    *name = \"(*temporary)\";\n  return frame+slot1;\n}\n\n/* Get name of upvalue. */\nconst char *lj_debug_uvname(GCproto *pt, uint32_t idx)\n{\n  const uint8_t *p = proto_uvinfo(pt);\n  lua_assert(idx < pt->sizeuv);\n  if (!p) return \"\";\n  if (idx) while (*p++ || --idx) ;\n  return (const char *)p;\n}\n\n/* Get name and value of upvalue. */\nconst char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp)\n{\n  if (tvisfunc(o)) {\n    GCfunc *fn = funcV(o);\n    if (isluafunc(fn)) {\n      GCproto *pt = funcproto(fn);\n      if (idx < pt->sizeuv) {\n\t*tvp = uvval(&gcref(fn->l.uvptr[idx])->uv);\n\treturn lj_debug_uvname(pt, idx);\n      }\n    } else {\n      if (idx < fn->c.nupvalues) {\n\t*tvp = &fn->c.upvalue[idx];\n\treturn \"\";\n      }\n    }\n  }\n  return NULL;\n}\n\n/* Deduce name of an object from slot number and PC. */\nconst char *lj_debug_slotname(GCproto *pt, const BCIns *ip, BCReg slot,\n\t\t\t      const char **name)\n{\n  const char *lname;\nrestart:\n  lname = debug_varname(pt, proto_bcpos(pt, ip), slot);\n  if (lname != NULL) { *name = lname; return \"local\"; }\n  while (--ip > proto_bc(pt)) {\n    BCIns ins = *ip;\n    BCOp op = bc_op(ins);\n    BCReg ra = bc_a(ins);\n    if (bcmode_a(op) == BCMbase) {\n      if (slot >= ra && (op != BC_KNIL || slot <= bc_d(ins)))\n\treturn NULL;\n    } else if (bcmode_a(op) == BCMdst && ra == slot) {\n      switch (bc_op(ins)) {\n      case BC_MOV:\n\tif (ra == slot) { slot = bc_d(ins); goto restart; }\n\tbreak;\n      case BC_GGET:\n\t*name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_d(ins))));\n\treturn \"global\";\n      case BC_TGETS:\n\t*name = strdata(gco2str(proto_kgc(pt, ~(ptrdiff_t)bc_c(ins))));\n\tif (ip > proto_bc(pt)) {\n\t  BCIns insp = ip[-1];\n\t  if (bc_op(insp) == BC_MOV && bc_a(insp) == ra+1 &&\n\t      bc_d(insp) == bc_b(ins))\n\t    return \"method\";\n\t}\n\treturn \"field\";\n      case BC_UGET:\n\t*name = lj_debug_uvname(pt, bc_d(ins));\n\treturn \"upvalue\";\n      default:\n\treturn NULL;\n      }\n    }\n  }\n  return NULL;\n}\n\n/* Deduce function name from caller of a frame. */\nconst char *lj_debug_funcname(lua_State *L, TValue *frame, const char **name)\n{\n  TValue *pframe;\n  GCfunc *fn;\n  BCPos pc;\n  if (frame <= tvref(L->stack))\n    return NULL;\n  if (frame_isvarg(frame))\n    frame = frame_prevd(frame);\n  pframe = frame_prev(frame);\n  fn = frame_func(pframe);\n  pc = debug_framepc(L, fn, frame);\n  if (pc != NO_BCPOS) {\n    GCproto *pt = funcproto(fn);\n    const BCIns *ip = &proto_bc(pt)[check_exp(pc < pt->sizebc, pc)];\n    MMS mm = bcmode_mm(bc_op(*ip));\n    if (mm == MM_call) {\n      BCReg slot = bc_a(*ip);\n      if (bc_op(*ip) == BC_ITERC) slot -= 3;\n      return lj_debug_slotname(pt, ip, slot, name);\n    } else if (mm != MM__MAX) {\n      *name = strdata(mmname_str(G(L), mm));\n      return \"metamethod\";\n    }\n  }\n  return NULL;\n}\n\n/* -- Source code locations ----------------------------------------------- */\n\n/* Generate shortened source name. */\nvoid lj_debug_shortname(char *out, GCstr *str)\n{\n  const char *src = strdata(str);\n  if (*src == '=') {\n    strncpy(out, src+1, LUA_IDSIZE);  /* Remove first char. */\n    out[LUA_IDSIZE-1] = '\\0';  /* Ensures null termination. */\n  } else if (*src == '@') {  /* Output \"source\", or \"...source\". */\n    size_t len = str->len-1;\n    src++;  /* Skip the `@' */\n    if (len >= LUA_IDSIZE) {\n      src += len-(LUA_IDSIZE-4);  /* Get last part of file name. */\n      *out++ = '.'; *out++ = '.'; *out++ = '.';\n    }\n    strcpy(out, src);\n  } else {  /* Output [string \"string\"]. */\n    size_t len;  /* Length, up to first control char. */\n    for (len = 0; len < LUA_IDSIZE-12; len++)\n      if (((const unsigned char *)src)[len] < ' ') break;\n    strcpy(out, \"[string \\\"\"); out += 9;\n    if (src[len] != '\\0') {  /* Must truncate? */\n      if (len > LUA_IDSIZE-15) len = LUA_IDSIZE-15;\n      strncpy(out, src, len); out += len;\n      strcpy(out, \"...\"); out += 3;\n    } else {\n      strcpy(out, src); out += len;\n    }\n    strcpy(out, \"\\\"]\");\n  }\n}\n\n/* Add current location of a frame to error message. */\nvoid lj_debug_addloc(lua_State *L, const char *msg,\n\t\t     cTValue *frame, cTValue *nextframe)\n{\n  if (frame) {\n    GCfunc *fn = frame_func(frame);\n    if (isluafunc(fn)) {\n      BCLine line = debug_frameline(L, fn, nextframe);\n      if (line >= 0) {\n\tchar buf[LUA_IDSIZE];\n\tlj_debug_shortname(buf, proto_chunkname(funcproto(fn)));\n\tlj_str_pushf(L, \"%s:%d: %s\", buf, line, msg);\n\treturn;\n      }\n    }\n  }\n  lj_str_pushf(L, \"%s\", msg);\n}\n\n/* Push location string for a bytecode position to Lua stack. */\nvoid lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc)\n{\n  GCstr *name = proto_chunkname(pt);\n  const char *s = strdata(name);\n  MSize i, len = name->len;\n  BCLine line = lj_debug_line(pt, pc);\n  if (*s == '@') {\n    s++; len--;\n    for (i = len; i > 0; i--)\n      if (s[i] == '/' || s[i] == '\\\\') {\n\ts += i+1;\n\tbreak;\n      }\n    lj_str_pushf(L, \"%s:%d\", s, line);\n  } else if (len > 40) {\n    lj_str_pushf(L, \"%p:%d\", pt, line);\n  } else if (*s == '=') {\n    lj_str_pushf(L, \"%s:%d\", s+1, line);\n  } else {\n    lj_str_pushf(L, \"\\\"%s\\\":%d\", s, line);\n  }\n}\n\n/* -- Public debug API ---------------------------------------------------- */\n\n/* lua_getupvalue() and lua_setupvalue() are in lj_api.c. */\n\nLUA_API const char *lua_getlocal(lua_State *L, const lua_Debug *ar, int n)\n{\n  const char *name = NULL;\n  if (ar) {\n    TValue *o = debug_localname(L, ar, &name, (BCReg)n);\n    if (name) {\n      copyTV(L, L->top, o);\n      incr_top(L);\n    }\n  } else if (tvisfunc(L->top-1) && isluafunc(funcV(L->top-1))) {\n    name = debug_varname(funcproto(funcV(L->top-1)), 0, (BCReg)n-1);\n  }\n  return name;\n}\n\nLUA_API const char *lua_setlocal(lua_State *L, const lua_Debug *ar, int n)\n{\n  const char *name = NULL;\n  TValue *o = debug_localname(L, ar, &name, (BCReg)n);\n  if (name)\n    copyTV(L, o, L->top-1);\n  L->top--;\n  return name;\n}\n\nint lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, int ext)\n{\n  int opt_f = 0, opt_L = 0;\n  TValue *frame = NULL;\n  TValue *nextframe = NULL;\n  GCfunc *fn;\n  if (*what == '>') {\n    TValue *func = L->top - 1;\n    api_check(L, tvisfunc(func));\n    fn = funcV(func);\n    L->top--;\n    what++;\n  } else {\n    uint32_t offset = (uint32_t)ar->i_ci & 0xffff;\n    uint32_t size = (uint32_t)ar->i_ci >> 16;\n    lua_assert(offset != 0);\n    frame = tvref(L->stack) + offset;\n    if (size) nextframe = frame + size;\n    lua_assert(frame <= tvref(L->maxstack) &&\n\t       (!nextframe || nextframe <= tvref(L->maxstack)));\n    fn = frame_func(frame);\n    lua_assert(fn->c.gct == ~LJ_TFUNC);\n  }\n  for (; *what; what++) {\n    if (*what == 'S') {\n      if (isluafunc(fn)) {\n\tGCproto *pt = funcproto(fn);\n\tBCLine firstline = pt->firstline;\n\tGCstr *name = proto_chunkname(pt);\n\tar->source = strdata(name);\n\tlj_debug_shortname(ar->short_src, name);\n\tar->linedefined = (int)firstline;\n\tar->lastlinedefined = (int)(firstline + pt->numline);\n\tar->what = firstline ? \"Lua\" : \"main\";\n      } else {\n\tar->source = \"=[C]\";\n\tar->short_src[0] = '[';\n\tar->short_src[1] = 'C';\n\tar->short_src[2] = ']';\n\tar->short_src[3] = '\\0';\n\tar->linedefined = -1;\n\tar->lastlinedefined = -1;\n\tar->what = \"C\";\n      }\n    } else if (*what == 'l') {\n      ar->currentline = frame ? debug_frameline(L, fn, nextframe) : -1;\n    } else if (*what == 'u') {\n      ar->nups = fn->c.nupvalues;\n      if (ext) {\n\tif (isluafunc(fn)) {\n\t  GCproto *pt = funcproto(fn);\n\t  ar->nparams = pt->numparams;\n\t  ar->isvararg = !!(pt->flags & PROTO_VARARG);\n\t} else {\n\t  ar->nparams = 0;\n\t  ar->isvararg = 1;\n\t}\n      }\n    } else if (*what == 'n') {\n      ar->namewhat = frame ? lj_debug_funcname(L, frame, &ar->name) : NULL;\n      if (ar->namewhat == NULL) {\n\tar->namewhat = \"\";\n\tar->name = NULL;\n      }\n    } else if (*what == 'f') {\n      opt_f = 1;\n    } else if (*what == 'L') {\n      opt_L = 1;\n    } else {\n      return 0;  /* Bad option. */\n    }\n  }\n  if (opt_f) {\n    setfuncV(L, L->top, fn);\n    incr_top(L);\n  }\n  if (opt_L) {\n    if (isluafunc(fn)) {\n      GCtab *t = lj_tab_new(L, 0, 0);\n      GCproto *pt = funcproto(fn);\n      const void *lineinfo = proto_lineinfo(pt);\n      if (lineinfo) {\n\tBCLine first = pt->firstline;\n\tint sz = pt->numline < 256 ? 1 : pt->numline < 65536 ? 2 : 4;\n\tMSize i, szl = pt->sizebc-1;\n\tfor (i = 0; i < szl; i++) {\n\t  BCLine line = first +\n\t    (sz == 1 ? (BCLine)((const uint8_t *)lineinfo)[i] :\n\t     sz == 2 ? (BCLine)((const uint16_t *)lineinfo)[i] :\n\t     (BCLine)((const uint32_t *)lineinfo)[i]);\n\t  setboolV(lj_tab_setint(L, t, line), 1);\n\t}\n      }\n      settabV(L, L->top, t);\n    } else {\n      setnilV(L->top);\n    }\n    incr_top(L);\n  }\n  return 1;  /* Ok. */\n}\n\nLUA_API int lua_getinfo(lua_State *L, const char *what, lua_Debug *ar)\n{\n  return lj_debug_getinfo(L, what, (lj_Debug *)ar, 0);\n}\n\nLUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar)\n{\n  int size;\n  cTValue *frame = lj_debug_frame(L, level, &size);\n  if (frame) {\n    ar->i_ci = (size << 16) + (int)(frame - tvref(L->stack));\n    return 1;\n  } else {\n    ar->i_ci = level - size;\n    return 0;\n  }\n}\n\n/* Number of frames for the leading and trailing part of a traceback. */\n#define TRACEBACK_LEVELS1\t12\n#define TRACEBACK_LEVELS2\t10\n\nLUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, const char *msg,\n\t\t\t\tint level)\n{\n  int top = (int)(L->top - L->base);\n  int lim = TRACEBACK_LEVELS1;\n  lua_Debug ar;\n  if (msg) lua_pushfstring(L, \"%s\\n\", msg);\n  lua_pushliteral(L, \"stack traceback:\");\n  while (lua_getstack(L1, level++, &ar)) {\n    GCfunc *fn;\n    if (level > lim) {\n      if (!lua_getstack(L1, level + TRACEBACK_LEVELS2, &ar)) {\n\tlevel--;\n      } else {\n\tlua_pushliteral(L, \"\\n\\t...\");\n\tlua_getstack(L1, -10, &ar);\n\tlevel = ar.i_ci - TRACEBACK_LEVELS2;\n      }\n      lim = 2147483647;\n      continue;\n    }\n    lua_getinfo(L1, \"Snlf\", &ar);\n    fn = funcV(L1->top-1); L1->top--;\n    if (isffunc(fn) && !*ar.namewhat)\n      lua_pushfstring(L, \"\\n\\t[builtin#%d]:\", fn->c.ffid);\n    else\n      lua_pushfstring(L, \"\\n\\t%s:\", ar.short_src);\n    if (ar.currentline > 0)\n      lua_pushfstring(L, \"%d:\", ar.currentline);\n    if (*ar.namewhat) {\n      lua_pushfstring(L, \" in function \" LUA_QS, ar.name);\n    } else {\n      if (*ar.what == 'm') {\n\tlua_pushliteral(L, \" in main chunk\");\n      } else if (*ar.what == 'C') {\n\tlua_pushfstring(L, \" at %p\", fn->c.f);\n      } else {\n\tlua_pushfstring(L, \" in function <%s:%d>\",\n\t\t\tar.short_src, ar.linedefined);\n      }\n    }\n    if ((int)(L->top - L->base) - top >= 15)\n      lua_concat(L, (int)(L->top - L->base) - top);\n  }\n  lua_concat(L, (int)(L->top - L->base) - top);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_debug.h",
    "content": "/*\n** Debugging and introspection.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_DEBUG_H\n#define _LJ_DEBUG_H\n\n#include \"lj_obj.h\"\n\ntypedef struct lj_Debug {\n  /* Common fields. Must be in the same order as in lua.h. */\n  int event;\n  const char *name;\n  const char *namewhat;\n  const char *what;\n  const char *source;\n  int currentline;\n  int nups;\n  int linedefined;\n  int lastlinedefined;\n  char short_src[LUA_IDSIZE];\n  int i_ci;\n  /* Extended fields. Only valid if lj_debug_getinfo() is called with ext = 1.*/\n  int nparams;\n  int isvararg;\n} lj_Debug;\n\nLJ_FUNC cTValue *lj_debug_frame(lua_State *L, int level, int *size);\nLJ_FUNC BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc);\nLJ_FUNC const char *lj_debug_uvname(GCproto *pt, uint32_t idx);\nLJ_FUNC const char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp);\nLJ_FUNC const char *lj_debug_slotname(GCproto *pt, const BCIns *pc,\n\t\t\t\t      BCReg slot, const char **name);\nLJ_FUNC const char *lj_debug_funcname(lua_State *L, TValue *frame,\n\t\t\t\t      const char **name);\nLJ_FUNC void lj_debug_shortname(char *out, GCstr *str);\nLJ_FUNC void lj_debug_addloc(lua_State *L, const char *msg,\n\t\t\t     cTValue *frame, cTValue *nextframe);\nLJ_FUNC void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc);\nLJ_FUNC int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar,\n\t\t\t     int ext);\n\n/* Fixed internal variable names. */\n#define VARNAMEDEF(_) \\\n  _(FOR_IDX, \"(for index)\") \\\n  _(FOR_STOP, \"(for limit)\") \\\n  _(FOR_STEP, \"(for step)\") \\\n  _(FOR_GEN, \"(for generator)\") \\\n  _(FOR_STATE, \"(for state)\") \\\n  _(FOR_CTL, \"(for control)\")\n\nenum {\n  VARNAME_END,\n#define VARNAMEENUM(name, str)\tVARNAME_##name,\n  VARNAMEDEF(VARNAMEENUM)\n#undef VARNAMEENUM\n  VARNAME__MAX\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_def.h",
    "content": "/*\n** LuaJIT common internal definitions.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_DEF_H\n#define _LJ_DEF_H\n\n#include \"lua.h\"\n\n#if defined(_MSC_VER)\n/* MSVC is stuck in the last century and doesn't have C99's stdint.h. */\ntypedef __int8 int8_t;\ntypedef __int16 int16_t;\ntypedef __int32 int32_t;\ntypedef __int64 int64_t;\ntypedef unsigned __int8 uint8_t;\ntypedef unsigned __int16 uint16_t;\ntypedef unsigned __int32 uint32_t;\ntypedef unsigned __int64 uint64_t;\n#ifdef _WIN64\ntypedef __int64 intptr_t;\ntypedef unsigned __int64 uintptr_t;\n#else\ntypedef __int32 intptr_t;\ntypedef unsigned __int32 uintptr_t;\n#endif\n#elif defined(__symbian__)\n/* Cough. */\ntypedef signed char int8_t;\ntypedef short int int16_t;\ntypedef int int32_t;\ntypedef long long int64_t;\ntypedef unsigned char uint8_t;\ntypedef unsigned short int uint16_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long uint64_t;\ntypedef int intptr_t;\ntypedef unsigned int uintptr_t;\n#else\n#include <stdint.h>\n#endif\n\n/* Needed everywhere. */\n#include <string.h>\n#include <stdlib.h>\n\n/* Various VM limits. */\n#define LJ_MAX_MEM\t0x7fffff00\t/* Max. total memory allocation. */\n#define LJ_MAX_ALLOC\tLJ_MAX_MEM\t/* Max. individual allocation length. */\n#define LJ_MAX_STR\tLJ_MAX_MEM\t/* Max. string length. */\n#define LJ_MAX_UDATA\tLJ_MAX_MEM\t/* Max. userdata length. */\n\n#define LJ_MAX_STRTAB\t(1<<26)\t\t/* Max. string table size. */\n#define LJ_MAX_HBITS\t26\t\t/* Max. hash bits. */\n#define LJ_MAX_ABITS\t28\t\t/* Max. bits of array key. */\n#define LJ_MAX_ASIZE\t((1<<(LJ_MAX_ABITS-1))+1)  /* Max. array part size. */\n#define LJ_MAX_COLOSIZE\t16\t\t/* Max. elems for colocated array. */\n\n#define LJ_MAX_LINE\tLJ_MAX_MEM\t/* Max. source code line number. */\n#define LJ_MAX_XLEVEL\t200\t\t/* Max. syntactic nesting level. */\n#define LJ_MAX_BCINS\t(1<<26)\t\t/* Max. # of bytecode instructions. */\n#define LJ_MAX_SLOTS\t250\t\t/* Max. # of slots in a Lua func. */\n#define LJ_MAX_LOCVAR\t200\t\t/* Max. # of local variables. */\n#define LJ_MAX_UPVAL\t60\t\t/* Max. # of upvalues. */\n\n#define LJ_MAX_IDXCHAIN\t100\t\t/* __index/__newindex chain limit. */\n#define LJ_STACK_EXTRA\t5\t\t/* Extra stack space (metamethods). */\n\n#define LJ_NUM_CBPAGE\t1\t\t/* Number of FFI callback pages. */\n\n/* Minimum table/buffer sizes. */\n#define LJ_MIN_GLOBAL\t6\t\t/* Min. global table size (hbits). */\n#define LJ_MIN_REGISTRY\t2\t\t/* Min. registry size (hbits). */\n#define LJ_MIN_STRTAB\t256\t\t/* Min. string table size (pow2). */\n#define LJ_MIN_SBUF\t32\t\t/* Min. string buffer length. */\n#define LJ_MIN_VECSZ\t8\t\t/* Min. size for growable vectors. */\n#define LJ_MIN_IRSZ\t32\t\t/* Min. size for growable IR. */\n#define LJ_MIN_K64SZ\t16\t\t/* Min. size for chained K64Array. */\n\n/* JIT compiler limits. */\n#define LJ_MAX_JSLOTS\t250\t\t/* Max. # of stack slots for a trace. */\n#define LJ_MAX_PHI\t64\t\t/* Max. # of PHIs for a loop. */\n#define LJ_MAX_EXITSTUBGR\t16\t/* Max. # of exit stub groups. */\n\n/* Various macros. */\n#ifndef UNUSED\n#define UNUSED(x)\t((void)(x))\t/* to avoid warnings */\n#endif\n\n#define U64x(hi, lo)\t(((uint64_t)0x##hi << 32) + (uint64_t)0x##lo)\n#define i32ptr(p)\t((int32_t)(intptr_t)(void *)(p))\n#define u32ptr(p)\t((uint32_t)(intptr_t)(void *)(p))\n\n#define checki8(x)\t((x) == (int32_t)(int8_t)(x))\n#define checku8(x)\t((x) == (int32_t)(uint8_t)(x))\n#define checki16(x)\t((x) == (int32_t)(int16_t)(x))\n#define checku16(x)\t((x) == (int32_t)(uint16_t)(x))\n#define checki32(x)\t((x) == (int32_t)(x))\n#define checku32(x)\t((x) == (uint32_t)(x))\n#define checkptr32(x)\t((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))\n\n/* Every half-decent C compiler transforms this into a rotate instruction. */\n#define lj_rol(x, n)\t(((x)<<(n)) | ((x)>>(8*sizeof(x)-(n))))\n#define lj_ror(x, n)\t(((x)<<(8*sizeof(x)-(n))) | ((x)>>(n)))\n\n/* A really naive Bloom filter. But sufficient for our needs. */\ntypedef uintptr_t BloomFilter;\n#define BLOOM_MASK\t(8*sizeof(BloomFilter) - 1)\n#define bloombit(x)\t((uintptr_t)1 << ((x) & BLOOM_MASK))\n#define bloomset(b, x)\t((b) |= bloombit((x)))\n#define bloomtest(b, x)\t((b) & bloombit((x)))\n\n#if defined(__GNUC__)\n\n#define LJ_NORET\t__attribute__((noreturn))\n#define LJ_ALIGN(n)\t__attribute__((aligned(n)))\n#define LJ_INLINE\tinline\n#define LJ_AINLINE\tinline __attribute__((always_inline))\n#define LJ_NOINLINE\t__attribute__((noinline))\n\n#if defined(__ELF__) || defined(__MACH__)\n#if !((defined(__sun__) && defined(__svr4__)) || defined(__CELLOS_LV2__))\n#define LJ_NOAPI\textern __attribute__((visibility(\"hidden\")))\n#endif\n#endif\n\n/* Note: it's only beneficial to use fastcall on x86 and then only for up to\n** two non-FP args. The amalgamated compile covers all LJ_FUNC cases. Only\n** indirect calls and related tail-called C functions are marked as fastcall.\n*/\n#if defined(__i386__)\n#define LJ_FASTCALL\t__attribute__((fastcall))\n#endif\n\n#define LJ_LIKELY(x)\t__builtin_expect(!!(x), 1)\n#define LJ_UNLIKELY(x)\t__builtin_expect(!!(x), 0)\n\n#define lj_ffs(x)\t((uint32_t)__builtin_ctz(x))\n/* Don't ask ... */\n#if defined(__INTEL_COMPILER) && (defined(__i386__) || defined(__x86_64__))\nstatic LJ_AINLINE uint32_t lj_fls(uint32_t x)\n{\n  uint32_t r; __asm__(\"bsrl %1, %0\" : \"=r\" (r) : \"rm\" (x) : \"cc\"); return r;\n}\n#else\n#define lj_fls(x)\t((uint32_t)(__builtin_clz(x)^31))\n#endif\n\n#if defined(__arm__)\nstatic LJ_AINLINE uint32_t lj_bswap(uint32_t x)\n{\n  uint32_t r;\n#if __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6T2__ || __ARM_ARCH_6Z__ ||\\\n    __ARM_ARCH_6ZK__ || __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__\n  __asm__(\"rev %0, %1\" : \"=r\" (r) : \"r\" (x));\n  return r;\n#else\n#ifdef __thumb__\n  r = x ^ lj_ror(x, 16);\n#else\n  __asm__(\"eor %0, %1, %1, ror #16\" : \"=r\" (r) : \"r\" (x));\n#endif\n  return ((r & 0xff00ffffu) >> 8) ^ lj_ror(x, 8);\n#endif\n}\n\nstatic LJ_AINLINE uint64_t lj_bswap64(uint64_t x)\n{\n  return ((uint64_t)lj_bswap((uint32_t)x)<<32) | lj_bswap((uint32_t)(x>>32));\n}\n#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)\nstatic LJ_AINLINE uint32_t lj_bswap(uint32_t x)\n{\n  return (uint32_t)__builtin_bswap32((int32_t)x);\n}\n\nstatic LJ_AINLINE uint64_t lj_bswap64(uint64_t x)\n{\n  return (uint64_t)__builtin_bswap64((int64_t)x);\n}\n#elif defined(__i386__) || defined(__x86_64__)\nstatic LJ_AINLINE uint32_t lj_bswap(uint32_t x)\n{\n  uint32_t r; __asm__(\"bswap %0\" : \"=r\" (r) : \"0\" (x)); return r;\n}\n\n#if defined(__i386__)\nstatic LJ_AINLINE uint64_t lj_bswap64(uint64_t x)\n{\n  return ((uint64_t)lj_bswap((uint32_t)x)<<32) | lj_bswap((uint32_t)(x>>32));\n}\n#else\nstatic LJ_AINLINE uint64_t lj_bswap64(uint64_t x)\n{\n  uint64_t r; __asm__(\"bswap %0\" : \"=r\" (r) : \"0\" (x)); return r;\n}\n#endif\n#else\nstatic LJ_AINLINE uint32_t lj_bswap(uint32_t x)\n{\n  return (x << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | (x >> 24);\n}\n\nstatic LJ_AINLINE uint64_t lj_bswap64(uint64_t x)\n{\n  return (uint64_t)lj_bswap((uint32_t)(x >> 32)) |\n\t ((uint64_t)lj_bswap((uint32_t)x) << 32);\n}\n#endif\n\ntypedef union __attribute__((packed)) Unaligned16 {\n  uint16_t u;\n  uint8_t b[2];\n} Unaligned16;\n\ntypedef union __attribute__((packed)) Unaligned32 {\n  uint32_t u;\n  uint8_t b[4];\n} Unaligned32;\n\n/* Unaligned load of uint16_t. */\nstatic LJ_AINLINE uint16_t lj_getu16(const void *p)\n{\n  return ((const Unaligned16 *)p)->u;\n}\n\n/* Unaligned load of uint32_t. */\nstatic LJ_AINLINE uint32_t lj_getu32(const void *p)\n{\n  return ((const Unaligned32 *)p)->u;\n}\n\n#elif defined(_MSC_VER)\n\n#define LJ_NORET\t__declspec(noreturn)\n#define LJ_ALIGN(n)\t__declspec(align(n))\n#define LJ_INLINE\t__inline\n#define LJ_AINLINE\t__forceinline\n#define LJ_NOINLINE\t__declspec(noinline)\n#if defined(_M_IX86)\n#define LJ_FASTCALL\t__fastcall\n#endif\n\n#ifdef _M_PPC\nunsigned int _CountLeadingZeros(long);\n#pragma intrinsic(_CountLeadingZeros)\nstatic LJ_AINLINE uint32_t lj_fls(uint32_t x)\n{\n  return _CountLeadingZeros(x) ^ 31;\n}\n#else\nunsigned char _BitScanForward(uint32_t *, unsigned long);\nunsigned char _BitScanReverse(uint32_t *, unsigned long);\n#pragma intrinsic(_BitScanForward)\n#pragma intrinsic(_BitScanReverse)\n\nstatic LJ_AINLINE uint32_t lj_ffs(uint32_t x)\n{\n  uint32_t r; _BitScanForward(&r, x); return r;\n}\n\nstatic LJ_AINLINE uint32_t lj_fls(uint32_t x)\n{\n  uint32_t r; _BitScanReverse(&r, x); return r;\n}\n#endif\n\nunsigned long _byteswap_ulong(unsigned long);\nuint64_t _byteswap_uint64(uint64_t);\n#define lj_bswap(x)\t(_byteswap_ulong((x)))\n#define lj_bswap64(x)\t(_byteswap_uint64((x)))\n\n#if defined(_M_PPC) && defined(LUAJIT_NO_UNALIGNED)\n/*\n** Replacement for unaligned loads on Xbox 360. Disabled by default since it's\n** usually more costly than the occasional stall when crossing a cache-line.\n*/\nstatic LJ_AINLINE uint16_t lj_getu16(const void *v)\n{\n  const uint8_t *p = (const uint8_t *)v;\n  return (uint16_t)((p[0]<<8) | p[1]);\n}\nstatic LJ_AINLINE uint32_t lj_getu32(const void *v)\n{\n  const uint8_t *p = (const uint8_t *)v;\n  return (uint32_t)((p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3]);\n}\n#else\n/* Unaligned loads are generally ok on x86/x64. */\n#define lj_getu16(p)\t(*(uint16_t *)(p))\n#define lj_getu32(p)\t(*(uint32_t *)(p))\n#endif\n\n#else\n#error \"missing defines for your compiler\"\n#endif\n\n/* Optional defines. */\n#ifndef LJ_FASTCALL\n#define LJ_FASTCALL\n#endif\n#ifndef LJ_NORET\n#define LJ_NORET\n#endif\n#ifndef LJ_NOAPI\n#define LJ_NOAPI\textern\n#endif\n#ifndef LJ_LIKELY\n#define LJ_LIKELY(x)\t(x)\n#define LJ_UNLIKELY(x)\t(x)\n#endif\n\n/* Attributes for internal functions. */\n#define LJ_DATA\t\tLJ_NOAPI\n#define LJ_DATADEF\n#define LJ_ASMF\t\tLJ_NOAPI\n#define LJ_FUNCA\tLJ_NOAPI\n#if defined(ljamalg_c)\n#define LJ_FUNC\t\tstatic\n#else\n#define LJ_FUNC\t\tLJ_NOAPI\n#endif\n#define LJ_FUNC_NORET\tLJ_FUNC LJ_NORET\n#define LJ_FUNCA_NORET\tLJ_FUNCA LJ_NORET\n#define LJ_ASMF_NORET\tLJ_ASMF LJ_NORET\n\n/* Runtime assertions. */\n#ifdef lua_assert\n#define check_exp(c, e)\t\t(lua_assert(c), (e))\n#define api_check(l, e)\t\tlua_assert(e)\n#else\n#define lua_assert(c)\t\t((void)0)\n#define check_exp(c, e)\t\t(e)\n#define api_check\t\tluai_apicheck\n#endif\n\n/* Static assertions. */\n#define LJ_ASSERT_NAME2(name, line)\tname ## line\n#define LJ_ASSERT_NAME(line)\t\tLJ_ASSERT_NAME2(lj_assert_, line)\n#ifdef __COUNTER__\n#define LJ_STATIC_ASSERT(cond) \\\n  extern void LJ_ASSERT_NAME(__COUNTER__)(int STATIC_ASSERTION_FAILED[(cond)?1:-1])\n#else\n#define LJ_STATIC_ASSERT(cond) \\\n  extern void LJ_ASSERT_NAME(__LINE__)(int STATIC_ASSERTION_FAILED[(cond)?1:-1])\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_dispatch.c",
    "content": "/*\n** Instruction dispatch handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_dispatch_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_func.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_meta.h\"\n#include \"lj_debug.h\"\n#include \"lj_state.h\"\n#include \"lj_frame.h\"\n#include \"lj_bc.h\"\n#include \"lj_ff.h\"\n#if LJ_HASJIT\n#include \"lj_jit.h\"\n#endif\n#if LJ_HASFFI\n#include \"lj_ccallback.h\"\n#endif\n#include \"lj_trace.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"luajit.h\"\n\n/* Bump GG_NUM_ASMFF in lj_dispatch.h as needed. Ugly. */\nLJ_STATIC_ASSERT(GG_NUM_ASMFF == FF_NUM_ASMFUNC);\n\n/* -- Dispatch table management ------------------------------------------- */\n\n#if LJ_TARGET_MIPS\n#include <math.h>\nLJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L,\n\t\t\t\t\t\t\t  lua_State *co);\n\n#define GOTFUNC(name)\t(ASMFunction)name,\nstatic const ASMFunction dispatch_got[] = {\n  GOTDEF(GOTFUNC)\n};\n#undef GOTFUNC\n#endif\n\n/* Initialize instruction dispatch table and hot counters. */\nvoid lj_dispatch_init(GG_State *GG)\n{\n  uint32_t i;\n  ASMFunction *disp = GG->dispatch;\n  for (i = 0; i < GG_LEN_SDISP; i++)\n    disp[GG_LEN_DDISP+i] = disp[i] = makeasmfunc(lj_bc_ofs[i]);\n  for (i = GG_LEN_SDISP; i < GG_LEN_DDISP; i++)\n    disp[i] = makeasmfunc(lj_bc_ofs[i]);\n  /* The JIT engine is off by default. luaopen_jit() turns it on. */\n  disp[BC_FORL] = disp[BC_IFORL];\n  disp[BC_ITERL] = disp[BC_IITERL];\n  disp[BC_LOOP] = disp[BC_ILOOP];\n  disp[BC_FUNCF] = disp[BC_IFUNCF];\n  disp[BC_FUNCV] = disp[BC_IFUNCV];\n  GG->g.bc_cfunc_ext = GG->g.bc_cfunc_int = BCINS_AD(BC_FUNCC, LUA_MINSTACK, 0);\n  for (i = 0; i < GG_NUM_ASMFF; i++)\n    GG->bcff[i] = BCINS_AD(BC__MAX+i, 0, 0);\n#if LJ_TARGET_MIPS\n  memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4);\n#endif\n}\n\n#if LJ_HASJIT\n/* Initialize hotcount table. */\nvoid lj_dispatch_init_hotcount(global_State *g)\n{\n  int32_t hotloop = G2J(g)->param[JIT_P_hotloop];\n  HotCount start = (HotCount)(hotloop*HOTCOUNT_LOOP - 1);\n  HotCount *hotcount = G2GG(g)->hotcount;\n  uint32_t i;\n  for (i = 0; i < HOTCOUNT_SIZE; i++)\n    hotcount[i] = start;\n}\n#endif\n\n/* Internal dispatch mode bits. */\n#define DISPMODE_JIT\t0x01\t/* JIT compiler on. */\n#define DISPMODE_REC\t0x02\t/* Recording active. */\n#define DISPMODE_INS\t0x04\t/* Override instruction dispatch. */\n#define DISPMODE_CALL\t0x08\t/* Override call dispatch. */\n#define DISPMODE_RET\t0x10\t/* Override return dispatch. */\n\n/* Update dispatch table depending on various flags. */\nvoid lj_dispatch_update(global_State *g)\n{\n  uint8_t oldmode = g->dispatchmode;\n  uint8_t mode = 0;\n#if LJ_HASJIT\n  mode |= (G2J(g)->flags & JIT_F_ON) ? DISPMODE_JIT : 0;\n  mode |= G2J(g)->state != LJ_TRACE_IDLE ?\n\t    (DISPMODE_REC|DISPMODE_INS|DISPMODE_CALL) : 0;\n#endif\n  mode |= (g->hookmask & (LUA_MASKLINE|LUA_MASKCOUNT)) ? DISPMODE_INS : 0;\n  mode |= (g->hookmask & LUA_MASKCALL) ? DISPMODE_CALL : 0;\n  mode |= (g->hookmask & LUA_MASKRET) ? DISPMODE_RET : 0;\n  if (oldmode != mode) {  /* Mode changed? */\n    ASMFunction *disp = G2GG(g)->dispatch;\n    ASMFunction f_forl, f_iterl, f_loop, f_funcf, f_funcv;\n    g->dispatchmode = mode;\n\n    /* Hotcount if JIT is on, but not while recording. */\n    if ((mode & (DISPMODE_JIT|DISPMODE_REC)) == DISPMODE_JIT) {\n      f_forl = makeasmfunc(lj_bc_ofs[BC_FORL]);\n      f_iterl = makeasmfunc(lj_bc_ofs[BC_ITERL]);\n      f_loop = makeasmfunc(lj_bc_ofs[BC_LOOP]);\n      f_funcf = makeasmfunc(lj_bc_ofs[BC_FUNCF]);\n      f_funcv = makeasmfunc(lj_bc_ofs[BC_FUNCV]);\n    } else {  /* Otherwise use the non-hotcounting instructions. */\n      f_forl = disp[GG_LEN_DDISP+BC_IFORL];\n      f_iterl = disp[GG_LEN_DDISP+BC_IITERL];\n      f_loop = disp[GG_LEN_DDISP+BC_ILOOP];\n      f_funcf = makeasmfunc(lj_bc_ofs[BC_IFUNCF]);\n      f_funcv = makeasmfunc(lj_bc_ofs[BC_IFUNCV]);\n    }\n    /* Init static counting instruction dispatch first (may be copied below). */\n    disp[GG_LEN_DDISP+BC_FORL] = f_forl;\n    disp[GG_LEN_DDISP+BC_ITERL] = f_iterl;\n    disp[GG_LEN_DDISP+BC_LOOP] = f_loop;\n\n    /* Set dynamic instruction dispatch. */\n    if ((oldmode ^ mode) & (DISPMODE_REC|DISPMODE_INS)) {\n      /* Need to update the whole table. */\n      if (!(mode & (DISPMODE_REC|DISPMODE_INS))) {  /* No ins dispatch? */\n\t/* Copy static dispatch table to dynamic dispatch table. */\n\tmemcpy(&disp[0], &disp[GG_LEN_DDISP], GG_LEN_SDISP*sizeof(ASMFunction));\n\t/* Overwrite with dynamic return dispatch. */\n\tif ((mode & DISPMODE_RET)) {\n\t  disp[BC_RETM] = lj_vm_rethook;\n\t  disp[BC_RET] = lj_vm_rethook;\n\t  disp[BC_RET0] = lj_vm_rethook;\n\t  disp[BC_RET1] = lj_vm_rethook;\n\t}\n      } else {\n\t/* The recording dispatch also checks for hooks. */\n\tASMFunction f = (mode & DISPMODE_REC) ? lj_vm_record : lj_vm_inshook;\n\tuint32_t i;\n\tfor (i = 0; i < GG_LEN_SDISP; i++)\n\t  disp[i] = f;\n      }\n    } else if (!(mode & (DISPMODE_REC|DISPMODE_INS))) {\n      /* Otherwise set dynamic counting ins. */\n      disp[BC_FORL] = f_forl;\n      disp[BC_ITERL] = f_iterl;\n      disp[BC_LOOP] = f_loop;\n      /* Set dynamic return dispatch. */\n      if ((mode & DISPMODE_RET)) {\n\tdisp[BC_RETM] = lj_vm_rethook;\n\tdisp[BC_RET] = lj_vm_rethook;\n\tdisp[BC_RET0] = lj_vm_rethook;\n\tdisp[BC_RET1] = lj_vm_rethook;\n      } else {\n\tdisp[BC_RETM] = disp[GG_LEN_DDISP+BC_RETM];\n\tdisp[BC_RET] = disp[GG_LEN_DDISP+BC_RET];\n\tdisp[BC_RET0] = disp[GG_LEN_DDISP+BC_RET0];\n\tdisp[BC_RET1] = disp[GG_LEN_DDISP+BC_RET1];\n      }\n    }\n\n    /* Set dynamic call dispatch. */\n    if ((oldmode ^ mode) & DISPMODE_CALL) {  /* Update the whole table? */\n      uint32_t i;\n      if ((mode & DISPMODE_CALL) == 0) {  /* No call hooks? */\n\tfor (i = GG_LEN_SDISP; i < GG_LEN_DDISP; i++)\n\t  disp[i] = makeasmfunc(lj_bc_ofs[i]);\n      } else {\n\tfor (i = GG_LEN_SDISP; i < GG_LEN_DDISP; i++)\n\t  disp[i] = lj_vm_callhook;\n      }\n    }\n    if (!(mode & DISPMODE_CALL)) {  /* Overwrite dynamic counting ins. */\n      disp[BC_FUNCF] = f_funcf;\n      disp[BC_FUNCV] = f_funcv;\n    }\n\n#if LJ_HASJIT\n    /* Reset hotcounts for JIT off to on transition. */\n    if ((mode & DISPMODE_JIT) && !(oldmode & DISPMODE_JIT))\n      lj_dispatch_init_hotcount(g);\n#endif\n  }\n}\n\n/* -- JIT mode setting ---------------------------------------------------- */\n\n#if LJ_HASJIT\n/* Set JIT mode for a single prototype. */\nstatic void setptmode(global_State *g, GCproto *pt, int mode)\n{\n  if ((mode & LUAJIT_MODE_ON)) {  /* (Re-)enable JIT compilation. */\n    pt->flags &= ~PROTO_NOJIT;\n    lj_trace_reenableproto(pt);  /* Unpatch all ILOOP etc. bytecodes. */\n  } else {  /* Flush and/or disable JIT compilation. */\n    if (!(mode & LUAJIT_MODE_FLUSH))\n      pt->flags |= PROTO_NOJIT;\n    lj_trace_flushproto(g, pt);  /* Flush all traces of prototype. */\n  }\n}\n\n/* Recursively set the JIT mode for all children of a prototype. */\nstatic void setptmode_all(global_State *g, GCproto *pt, int mode)\n{\n  ptrdiff_t i;\n  if (!(pt->flags & PROTO_CHILD)) return;\n  for (i = -(ptrdiff_t)pt->sizekgc; i < 0; i++) {\n    GCobj *o = proto_kgc(pt, i);\n    if (o->gch.gct == ~LJ_TPROTO) {\n      setptmode(g, gco2pt(o), mode);\n      setptmode_all(g, gco2pt(o), mode);\n    }\n  }\n}\n#endif\n\n/* Public API function: control the JIT engine. */\nint luaJIT_setmode(lua_State *L, int idx, int mode)\n{\n  global_State *g = G(L);\n  int mm = mode & LUAJIT_MODE_MASK;\n  lj_trace_abort(g);  /* Abort recording on any state change. */\n  /* Avoid pulling the rug from under our own feet. */\n  if ((g->hookmask & HOOK_GC))\n    lj_err_caller(L, LJ_ERR_NOGCMM);\n  switch (mm) {\n#if LJ_HASJIT\n  case LUAJIT_MODE_ENGINE:\n    if ((mode & LUAJIT_MODE_FLUSH)) {\n      lj_trace_flushall(L);\n    } else {\n      if (!(mode & LUAJIT_MODE_ON))\n\tG2J(g)->flags &= ~(uint32_t)JIT_F_ON;\n#if LJ_TARGET_X86ORX64\n      else if ((G2J(g)->flags & JIT_F_SSE2))\n\tG2J(g)->flags |= (uint32_t)JIT_F_ON;\n      else\n\treturn 0;  /* Don't turn on JIT compiler without SSE2 support. */\n#else\n      else\n\tG2J(g)->flags |= (uint32_t)JIT_F_ON;\n#endif\n      lj_dispatch_update(g);\n    }\n    break;\n  case LUAJIT_MODE_FUNC:\n  case LUAJIT_MODE_ALLFUNC:\n  case LUAJIT_MODE_ALLSUBFUNC: {\n    cTValue *tv = idx == 0 ? frame_prev(L->base-1) :\n\t\t  idx > 0 ? L->base + (idx-1) : L->top + idx;\n    GCproto *pt;\n    if ((idx == 0 || tvisfunc(tv)) && isluafunc(&gcval(tv)->fn))\n      pt = funcproto(&gcval(tv)->fn);  /* Cannot use funcV() for frame slot. */\n    else if (tvisproto(tv))\n      pt = protoV(tv);\n    else\n      return 0;  /* Failed. */\n    if (mm != LUAJIT_MODE_ALLSUBFUNC)\n      setptmode(g, pt, mode);\n    if (mm != LUAJIT_MODE_FUNC)\n      setptmode_all(g, pt, mode);\n    break;\n    }\n  case LUAJIT_MODE_TRACE:\n    if (!(mode & LUAJIT_MODE_FLUSH))\n      return 0;  /* Failed. */\n    lj_trace_flush(G2J(g), idx);\n    break;\n#else\n  case LUAJIT_MODE_ENGINE:\n  case LUAJIT_MODE_FUNC:\n  case LUAJIT_MODE_ALLFUNC:\n  case LUAJIT_MODE_ALLSUBFUNC:\n    UNUSED(idx);\n    if ((mode & LUAJIT_MODE_ON))\n      return 0;  /* Failed. */\n    break;\n#endif\n  case LUAJIT_MODE_WRAPCFUNC:\n    if ((mode & LUAJIT_MODE_ON)) {\n      if (idx != 0) {\n\tcTValue *tv = idx > 0 ? L->base + (idx-1) : L->top + idx;\n\tif (tvislightud(tv))\n\t  g->wrapf = (lua_CFunction)lightudV(tv);\n\telse\n\t  return 0;  /* Failed. */\n      } else {\n\treturn 0;  /* Failed. */\n      }\n      g->bc_cfunc_ext = BCINS_AD(BC_FUNCCW, 0, 0);\n    } else {\n      g->bc_cfunc_ext = BCINS_AD(BC_FUNCC, 0, 0);\n    }\n    break;\n  default:\n    return 0;  /* Failed. */\n  }\n  return 1;  /* OK. */\n}\n\n/* Enforce (dynamic) linker error for version mismatches. See luajit.c. */\nLUA_API void LUAJIT_VERSION_SYM(void)\n{\n}\n\n/* -- Hooks --------------------------------------------------------------- */\n\n/* This function can be called asynchronously (e.g. during a signal). */\nLUA_API int lua_sethook(lua_State *L, lua_Hook func, int mask, int count)\n{\n  global_State *g = G(L);\n  mask &= HOOK_EVENTMASK;\n  if (func == NULL || mask == 0) { mask = 0; func = NULL; }  /* Consistency. */\n  g->hookf = func;\n  g->hookcount = g->hookcstart = (int32_t)count;\n  g->hookmask = (uint8_t)((g->hookmask & ~HOOK_EVENTMASK) | mask);\n  lj_trace_abort(g);  /* Abort recording on any hook change. */\n  lj_dispatch_update(g);\n  return 1;\n}\n\nLUA_API lua_Hook lua_gethook(lua_State *L)\n{\n  return G(L)->hookf;\n}\n\nLUA_API int lua_gethookmask(lua_State *L)\n{\n  return G(L)->hookmask & HOOK_EVENTMASK;\n}\n\nLUA_API int lua_gethookcount(lua_State *L)\n{\n  return (int)G(L)->hookcstart;\n}\n\n/* Call a hook. */\nstatic void callhook(lua_State *L, int event, BCLine line)\n{\n  global_State *g = G(L);\n  lua_Hook hookf = g->hookf;\n  if (hookf && !hook_active(g)) {\n    lua_Debug ar;\n    lj_trace_abort(g);  /* Abort recording on any hook call. */\n    ar.event = event;\n    ar.currentline = line;\n    /* Top frame, nextframe = NULL. */\n    ar.i_ci = (int)((L->base-1) - tvref(L->stack));\n    lj_state_checkstack(L, 1+LUA_MINSTACK);\n    hook_enter(g);\n    hookf(L, &ar);\n    lua_assert(hook_active(g));\n    hook_leave(g);\n  }\n}\n\n/* -- Dispatch callbacks -------------------------------------------------- */\n\n/* Calculate number of used stack slots in the current frame. */\nstatic BCReg cur_topslot(GCproto *pt, const BCIns *pc, uint32_t nres)\n{\n  BCIns ins = pc[-1];\n  if (bc_op(ins) == BC_UCLO)\n    ins = pc[bc_j(ins)];\n  switch (bc_op(ins)) {\n  case BC_CALLM: case BC_CALLMT: return bc_a(ins) + bc_c(ins) + nres-1+1;\n  case BC_RETM: return bc_a(ins) + bc_d(ins) + nres-1;\n  case BC_TSETM: return bc_a(ins) + nres-1;\n  default: return pt->framesize;\n  }\n}\n\n/* Instruction dispatch. Used by instr/line/return hooks or when recording. */\nvoid LJ_FASTCALL lj_dispatch_ins(lua_State *L, const BCIns *pc)\n{\n  ERRNO_SAVE\n  GCfunc *fn = curr_func(L);\n  GCproto *pt = funcproto(fn);\n  void *cf = cframe_raw(L->cframe);\n  const BCIns *oldpc = cframe_pc(cf);\n  global_State *g = G(L);\n  BCReg slots;\n  setcframe_pc(cf, pc);\n  slots = cur_topslot(pt, pc, cframe_multres_n(cf));\n  L->top = L->base + slots;  /* Fix top. */\n#if LJ_HASJIT\n  {\n    jit_State *J = G2J(g);\n    if (J->state != LJ_TRACE_IDLE) {\n#ifdef LUA_USE_ASSERT\n      ptrdiff_t delta = L->top - L->base;\n#endif\n      J->L = L;\n      lj_trace_ins(J, pc-1);  /* The interpreter bytecode PC is offset by 1. */\n      lua_assert(L->top - L->base == delta);\n    }\n  }\n#endif\n  if ((g->hookmask & LUA_MASKCOUNT) && g->hookcount == 0) {\n    g->hookcount = g->hookcstart;\n    callhook(L, LUA_HOOKCOUNT, -1);\n    L->top = L->base + slots;  /* Fix top again. */\n  }\n  if ((g->hookmask & LUA_MASKLINE)) {\n    BCPos npc = proto_bcpos(pt, pc) - 1;\n    BCPos opc = proto_bcpos(pt, oldpc) - 1;\n    BCLine line = lj_debug_line(pt, npc);\n    if (pc <= oldpc || opc >= pt->sizebc || line != lj_debug_line(pt, opc)) {\n      callhook(L, LUA_HOOKLINE, line);\n      L->top = L->base + slots;  /* Fix top again. */\n    }\n  }\n  if ((g->hookmask & LUA_MASKRET) && bc_isret(bc_op(pc[-1])))\n    callhook(L, LUA_HOOKRET, -1);\n  ERRNO_RESTORE\n}\n\n/* Initialize call. Ensure stack space and return # of missing parameters. */\nstatic int call_init(lua_State *L, GCfunc *fn)\n{\n  if (isluafunc(fn)) {\n    GCproto *pt = funcproto(fn);\n    int numparams = pt->numparams;\n    int gotparams = (int)(L->top - L->base);\n    int need = pt->framesize;\n    if ((pt->flags & PROTO_VARARG)) need += 1+gotparams;\n    lj_state_checkstack(L, (MSize)need);\n    numparams -= gotparams;\n    return numparams >= 0 ? numparams : 0;\n  } else {\n    lj_state_checkstack(L, LUA_MINSTACK);\n    return 0;\n  }\n}\n\n/* Call dispatch. Used by call hooks, hot calls or when recording. */\nASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns *pc)\n{\n  ERRNO_SAVE\n  GCfunc *fn = curr_func(L);\n  BCOp op;\n  global_State *g = G(L);\n#if LJ_HASJIT\n  jit_State *J = G2J(g);\n#endif\n  int missing = call_init(L, fn);\n#if LJ_HASJIT\n  J->L = L;\n  if ((uintptr_t)pc & 1) {  /* Marker for hot call. */\n#ifdef LUA_USE_ASSERT\n    ptrdiff_t delta = L->top - L->base;\n#endif\n    pc = (const BCIns *)((uintptr_t)pc & ~(uintptr_t)1);\n    lj_trace_hot(J, pc);\n    lua_assert(L->top - L->base == delta);\n    goto out;\n  } else if (J->state != LJ_TRACE_IDLE &&\n\t     !(g->hookmask & (HOOK_GC|HOOK_VMEVENT))) {\n#ifdef LUA_USE_ASSERT\n    ptrdiff_t delta = L->top - L->base;\n#endif\n    /* Record the FUNC* bytecodes, too. */\n    lj_trace_ins(J, pc-1);  /* The interpreter bytecode PC is offset by 1. */\n    lua_assert(L->top - L->base == delta);\n  }\n#endif\n  if ((g->hookmask & LUA_MASKCALL)) {\n    int i;\n    for (i = 0; i < missing; i++)  /* Add missing parameters. */\n      setnilV(L->top++);\n    callhook(L, LUA_HOOKCALL, -1);\n    /* Preserve modifications of missing parameters by lua_setlocal(). */\n    while (missing-- > 0 && tvisnil(L->top - 1))\n      L->top--;\n  }\n#if LJ_HASJIT\nout:\n#endif\n  op = bc_op(pc[-1]);  /* Get FUNC* op. */\n#if LJ_HASJIT\n  /* Use the non-hotcounting variants if JIT is off or while recording. */\n  if ((!(J->flags & JIT_F_ON) || J->state != LJ_TRACE_IDLE) &&\n      (op == BC_FUNCF || op == BC_FUNCV))\n    op = (BCOp)((int)op+(int)BC_IFUNCF-(int)BC_FUNCF);\n#endif\n  ERRNO_RESTORE\n  return makeasmfunc(lj_bc_ofs[op]);  /* Return static dispatch target. */\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_dispatch.h",
    "content": "/*\n** Instruction dispatch handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_DISPATCH_H\n#define _LJ_DISPATCH_H\n\n#include \"lj_obj.h\"\n#include \"lj_bc.h\"\n#if LJ_HASJIT\n#include \"lj_jit.h\"\n#endif\n\n#if LJ_TARGET_MIPS\n/* Need our own global offset table for the dreaded MIPS calling conventions. */\n#if LJ_HASJIT\n#define JITGOTDEF(_)\t_(lj_trace_exit) _(lj_trace_hot)\n#else\n#define JITGOTDEF(_)\n#endif\n#if LJ_HASFFI\n#define FFIGOTDEF(_) \\\n  _(lj_meta_equal_cd) _(lj_ccallback_enter) _(lj_ccallback_leave)\n#else\n#define FFIGOTDEF(_)\n#endif\n#define GOTDEF(_) \\\n  _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \\\n  _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \\\n  _(pow) _(fmod) _(ldexp) \\\n  _(lj_dispatch_call) _(lj_dispatch_ins) _(lj_err_throw) \\\n  _(lj_ffh_coroutine_wrap_err) _(lj_func_closeuv) _(lj_func_newL_gc) \\\n  _(lj_gc_barrieruv) _(lj_gc_step) _(lj_gc_step_fixtop) _(lj_meta_arith) \\\n  _(lj_meta_call) _(lj_meta_cat) _(lj_meta_comp) _(lj_meta_equal) \\\n  _(lj_meta_for) _(lj_meta_len) _(lj_meta_tget) _(lj_meta_tset) \\\n  _(lj_state_growstack) _(lj_str_fromnum) _(lj_str_fromnumber) _(lj_str_new) \\\n  _(lj_tab_dup) _(lj_tab_get) _(lj_tab_getinth) _(lj_tab_len) _(lj_tab_new) \\\n  _(lj_tab_newkey) _(lj_tab_next) _(lj_tab_reasize) \\\n  JITGOTDEF(_) FFIGOTDEF(_)\n\nenum {\n#define GOTENUM(name) LJ_GOT_##name,\nGOTDEF(GOTENUM)\n#undef GOTENUM\n  LJ_GOT__MAX\n};\n#endif\n\n/* Type of hot counter. Must match the code in the assembler VM. */\n/* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */\ntypedef uint16_t HotCount;\n\n/* Number of hot counter hash table entries (must be a power of two). */\n#define HOTCOUNT_SIZE\t\t64\n#define HOTCOUNT_PCMASK\t\t((HOTCOUNT_SIZE-1)*sizeof(HotCount))\n\n/* Hotcount decrements. */\n#define HOTCOUNT_LOOP\t\t2\n#define HOTCOUNT_CALL\t\t1\n\n/* This solves a circular dependency problem -- bump as needed. Sigh. */\n#define GG_NUM_ASMFF\t62\n\n#define GG_LEN_DDISP\t(BC__MAX + GG_NUM_ASMFF)\n#define GG_LEN_SDISP\tBC_FUNCF\n#define GG_LEN_DISP\t(GG_LEN_DDISP + GG_LEN_SDISP)\n\n/* Global state, main thread and extra fields are allocated together. */\ntypedef struct GG_State {\n  lua_State L;\t\t\t\t/* Main thread. */\n  global_State g;\t\t\t/* Global state. */\n#if LJ_TARGET_MIPS\n  ASMFunction got[LJ_GOT__MAX];\t\t/* Global offset table. */\n#endif\n#if LJ_HASJIT\n  jit_State J;\t\t\t\t/* JIT state. */\n  HotCount hotcount[HOTCOUNT_SIZE];\t/* Hot counters. */\n#endif\n  ASMFunction dispatch[GG_LEN_DISP];\t/* Instruction dispatch tables. */\n  BCIns bcff[GG_NUM_ASMFF];\t\t/* Bytecode for ASM fast functions. */\n} GG_State;\n\n#define GG_OFS(field)\t((int)offsetof(GG_State, field))\n#define G2GG(gl)\t((GG_State *)((char *)(gl) - GG_OFS(g)))\n#define J2GG(j)\t\t((GG_State *)((char *)(j) - GG_OFS(J)))\n#define L2GG(L)\t\t(G2GG(G(L)))\n#define J2G(J)\t\t(&J2GG(J)->g)\n#define G2J(gl)\t\t(&G2GG(gl)->J)\n#define L2J(L)\t\t(&L2GG(L)->J)\n#define GG_G2DISP\t(GG_OFS(dispatch) - GG_OFS(g))\n#define GG_DISP2G\t(GG_OFS(g) - GG_OFS(dispatch))\n#define GG_DISP2J\t(GG_OFS(J) - GG_OFS(dispatch))\n#define GG_DISP2HOT\t(GG_OFS(hotcount) - GG_OFS(dispatch))\n#define GG_DISP2STATIC\t(GG_LEN_DDISP*(int)sizeof(ASMFunction))\n\n#define hotcount_get(gg, pc) \\\n  (gg)->hotcount[(u32ptr(pc)>>2) & (HOTCOUNT_SIZE-1)]\n#define hotcount_set(gg, pc, val) \\\n  (hotcount_get((gg), (pc)) = (HotCount)(val))\n\n/* Dispatch table management. */\nLJ_FUNC void lj_dispatch_init(GG_State *GG);\n#if LJ_HASJIT\nLJ_FUNC void lj_dispatch_init_hotcount(global_State *g);\n#endif\nLJ_FUNC void lj_dispatch_update(global_State *g);\n\n/* Instruction dispatch callback for hooks or when recording. */\nLJ_FUNCA void LJ_FASTCALL lj_dispatch_ins(lua_State *L, const BCIns *pc);\nLJ_FUNCA ASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns*pc);\nLJ_FUNCA void LJ_FASTCALL lj_dispatch_return(lua_State *L, const BCIns *pc);\n\n#if LJ_HASFFI && !defined(_BUILDVM_H)\n/* Save/restore errno and GetLastError() around hooks, exits and recording. */\n#include <errno.h>\n#if LJ_TARGET_WINDOWS\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n#define ERRNO_SAVE\tint olderr = errno; DWORD oldwerr = GetLastError();\n#define ERRNO_RESTORE\terrno = olderr; SetLastError(oldwerr);\n#else\n#define ERRNO_SAVE\tint olderr = errno;\n#define ERRNO_RESTORE\terrno = olderr;\n#endif\n#else\n#define ERRNO_SAVE\n#define ERRNO_RESTORE\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_emit_arm.h",
    "content": "/*\n** ARM instruction emitter.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Constant encoding --------------------------------------------------- */\n\nstatic uint8_t emit_invai[16] = {\n  /* AND */ (ARMI_AND^ARMI_BIC) >> 21,\n  /* EOR */ 0,\n  /* SUB */ (ARMI_SUB^ARMI_ADD) >> 21,\n  /* RSB */ 0,\n  /* ADD */ (ARMI_ADD^ARMI_SUB) >> 21,\n  /* ADC */ (ARMI_ADC^ARMI_SBC) >> 21,\n  /* SBC */ (ARMI_SBC^ARMI_ADC) >> 21,\n  /* RSC */ 0,\n  /* TST */ 0,\n  /* TEQ */ 0,\n  /* CMP */ (ARMI_CMP^ARMI_CMN) >> 21,\n  /* CMN */ (ARMI_CMN^ARMI_CMP) >> 21,\n  /* ORR */ 0,\n  /* MOV */ (ARMI_MOV^ARMI_MVN) >> 21,\n  /* BIC */ (ARMI_BIC^ARMI_AND) >> 21,\n  /* MVN */ (ARMI_MVN^ARMI_MOV) >> 21\n};\n\n/* Encode constant in K12 format for data processing instructions. */\nstatic uint32_t emit_isk12(ARMIns ai, int32_t n)\n{\n  uint32_t invai, i, m = (uint32_t)n;\n  /* K12: unsigned 8 bit value, rotated in steps of two bits. */\n  for (i = 0; i < 4096; i += 256, m = lj_rol(m, 2))\n    if (m <= 255) return ARMI_K12|m|i;\n  /* Otherwise try negation/complement with the inverse instruction. */\n  invai = emit_invai[((ai >> 21) & 15)];\n  if (!invai) return 0;  /* Failed. No inverse instruction. */\n  m = ~(uint32_t)n;\n  if (invai == ((ARMI_SUB^ARMI_ADD) >> 21) ||\n      invai == (ARMI_CMP^ARMI_CMN) >> 21) m++;\n  for (i = 0; i < 4096; i += 256, m = lj_rol(m, 2))\n    if (m <= 255) return ARMI_K12|(invai<<21)|m|i;\n  return 0;  /* Failed. */\n}\n\n/* -- Emit basic instructions --------------------------------------------- */\n\nstatic void emit_dnm(ASMState *as, ARMIns ai, Reg rd, Reg rn, Reg rm)\n{\n  *--as->mcp = ai | ARMF_D(rd) | ARMF_N(rn) | ARMF_M(rm);\n}\n\nstatic void emit_dm(ASMState *as, ARMIns ai, Reg rd, Reg rm)\n{\n  *--as->mcp = ai | ARMF_D(rd) | ARMF_M(rm);\n}\n\nstatic void emit_dn(ASMState *as, ARMIns ai, Reg rd, Reg rn)\n{\n  *--as->mcp = ai | ARMF_D(rd) | ARMF_N(rn);\n}\n\nstatic void emit_nm(ASMState *as, ARMIns ai, Reg rn, Reg rm)\n{\n  *--as->mcp = ai | ARMF_N(rn) | ARMF_M(rm);\n}\n\nstatic void emit_d(ASMState *as, ARMIns ai, Reg rd)\n{\n  *--as->mcp = ai | ARMF_D(rd);\n}\n\nstatic void emit_n(ASMState *as, ARMIns ai, Reg rn)\n{\n  *--as->mcp = ai | ARMF_N(rn);\n}\n\nstatic void emit_m(ASMState *as, ARMIns ai, Reg rm)\n{\n  *--as->mcp = ai | ARMF_M(rm);\n}\n\nstatic void emit_lsox(ASMState *as, ARMIns ai, Reg rd, Reg rn, int32_t ofs)\n{\n  lua_assert(ofs >= -255 && ofs <= 255);\n  if (ofs < 0) ofs = -ofs; else ai |= ARMI_LS_U;\n  *--as->mcp = ai | ARMI_LS_P | ARMI_LSX_I | ARMF_D(rd) | ARMF_N(rn) |\n\t       ((ofs & 0xf0) << 4) | (ofs & 0x0f);\n}\n\nstatic void emit_lso(ASMState *as, ARMIns ai, Reg rd, Reg rn, int32_t ofs)\n{\n  lua_assert(ofs >= -4095 && ofs <= 4095);\n  /* Combine LDR/STR pairs to LDRD/STRD. */\n  if (*as->mcp == (ai|ARMI_LS_P|ARMI_LS_U|ARMF_D(rd^1)|ARMF_N(rn)|(ofs^4)) &&\n      (ai & ~(ARMI_LDR^ARMI_STR)) == ARMI_STR && rd != rn &&\n      (uint32_t)ofs <= 252 && !(ofs & 3) && !((rd ^ (ofs >>2)) & 1) &&\n      as->mcp != as->mcloop) {\n    as->mcp++;\n    emit_lsox(as, ai == ARMI_LDR ? ARMI_LDRD : ARMI_STRD, rd&~1, rn, ofs&~4);\n    return;\n  }\n  if (ofs < 0) ofs = -ofs; else ai |= ARMI_LS_U;\n  *--as->mcp = ai | ARMI_LS_P | ARMF_D(rd) | ARMF_N(rn) | ofs;\n}\n\n#if !LJ_SOFTFP\nstatic void emit_vlso(ASMState *as, ARMIns ai, Reg rd, Reg rn, int32_t ofs)\n{\n  lua_assert(ofs >= -1020 && ofs <= 1020 && (ofs&3) == 0);\n  if (ofs < 0) ofs = -ofs; else ai |= ARMI_LS_U;\n  *--as->mcp = ai | ARMI_LS_P | ARMF_D(rd & 15) | ARMF_N(rn) | (ofs >> 2);\n}\n#endif\n\n/* -- Emit loads/stores --------------------------------------------------- */\n\n/* Prefer spills of BASE/L. */\n#define emit_canremat(ref)\t((ref) < ASMREF_L)\n\n/* Try to find a one step delta relative to another constant. */\nstatic int emit_kdelta1(ASMState *as, Reg d, int32_t i)\n{\n  RegSet work = ~as->freeset & RSET_GPR;\n  while (work) {\n    Reg r = rset_picktop(work);\n    IRRef ref = regcost_ref(as->cost[r]);\n    lua_assert(r != d);\n    if (emit_canremat(ref)) {\n      int32_t delta = i - (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i);\n      uint32_t k = emit_isk12(ARMI_ADD, delta);\n      if (k) {\n\tif (k == ARMI_K12)\n\t  emit_dm(as, ARMI_MOV, d, r);\n\telse\n\t  emit_dn(as, ARMI_ADD^k, d, r);\n\treturn 1;\n      }\n    }\n    rset_clear(work, r);\n  }\n  return 0;  /* Failed. */\n}\n\n/* Try to find a two step delta relative to another constant. */\nstatic int emit_kdelta2(ASMState *as, Reg d, int32_t i)\n{\n  RegSet work = ~as->freeset & RSET_GPR;\n  while (work) {\n    Reg r = rset_picktop(work);\n    IRRef ref = regcost_ref(as->cost[r]);\n    lua_assert(r != d);\n    if (emit_canremat(ref)) {\n      int32_t other = ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i;\n      if (other) {\n\tint32_t delta = i - other;\n\tuint32_t sh, inv = 0, k2, k;\n\tif (delta < 0) { delta = -delta; inv = ARMI_ADD^ARMI_SUB; }\n\tsh = lj_ffs(delta) & ~1;\n\tk2 = emit_isk12(0, delta & (255 << sh));\n\tk = emit_isk12(0, delta & ~(255 << sh));\n\tif (k) {\n\t  emit_dn(as, ARMI_ADD^k2^inv, d, d);\n\t  emit_dn(as, ARMI_ADD^k^inv, d, r);\n\t  return 1;\n\t}\n      }\n    }\n    rset_clear(work, r);\n  }\n  return 0;  /* Failed. */\n}\n\n/* Load a 32 bit constant into a GPR. */\nstatic void emit_loadi(ASMState *as, Reg r, int32_t i)\n{\n  uint32_t k = emit_isk12(ARMI_MOV, i);\n  lua_assert(rset_test(as->freeset, r) || r == RID_TMP);\n  if (k) {\n    /* Standard K12 constant. */\n    emit_d(as, ARMI_MOV^k, r);\n  } else if ((as->flags & JIT_F_ARMV6T2) && (uint32_t)i < 0x00010000u) {\n    /* 16 bit loword constant for ARMv6T2. */\n    emit_d(as, ARMI_MOVW|(i & 0x0fff)|((i & 0xf000)<<4), r);\n  } else if (emit_kdelta1(as, r, i)) {\n    /* One step delta relative to another constant. */\n  } else if ((as->flags & JIT_F_ARMV6T2)) {\n    /* 32 bit hiword/loword constant for ARMv6T2. */\n    emit_d(as, ARMI_MOVT|((i>>16) & 0x0fff)|(((i>>16) & 0xf000)<<4), r);\n    emit_d(as, ARMI_MOVW|(i & 0x0fff)|((i & 0xf000)<<4), r);\n  } else if (emit_kdelta2(as, r, i)) {\n    /* Two step delta relative to another constant. */\n  } else {\n    /* Otherwise construct the constant with up to 4 instructions. */\n    /* NYI: use mvn+bic, use pc-relative loads. */\n    for (;;) {\n      uint32_t sh = lj_ffs(i) & ~1;\n      int32_t m = i & (255 << sh);\n      i &= ~(255 << sh);\n      if (i == 0) {\n\temit_d(as, ARMI_MOV ^ emit_isk12(0, m), r);\n\tbreak;\n      }\n      emit_dn(as, ARMI_ORR ^ emit_isk12(0, m), r, r);\n    }\n  }\n}\n\n#define emit_loada(as, r, addr)\t\temit_loadi(as, (r), i32ptr((addr)))\n\nstatic Reg ra_allock(ASMState *as, int32_t k, RegSet allow);\n\n/* Get/set from constant pointer. */\nstatic void emit_lsptr(ASMState *as, ARMIns ai, Reg r, void *p)\n{\n  int32_t i = i32ptr(p);\n  emit_lso(as, ai, r, ra_allock(as, (i & ~4095), rset_exclude(RSET_GPR, r)),\n\t   (i & 4095));\n}\n\n#if !LJ_SOFTFP\n/* Load a number constant into an FPR. */\nstatic void emit_loadn(ASMState *as, Reg r, cTValue *tv)\n{\n  int32_t i;\n  if ((as->flags & JIT_F_VFPV3) && !tv->u32.lo) {\n    uint32_t hi = tv->u32.hi;\n    uint32_t b = ((hi >> 22) & 0x1ff);\n    if (!(hi & 0xffff) && (b == 0x100 || b == 0x0ff)) {\n      *--as->mcp = ARMI_VMOVI_D | ARMF_D(r & 15) |\n\t\t   ((tv->u32.hi >> 12) & 0x00080000) |\n\t\t   ((tv->u32.hi >> 4) & 0x00070000) |\n\t\t   ((tv->u32.hi >> 16) & 0x0000000f);\n      return;\n    }\n  }\n  i = i32ptr(tv);\n  emit_vlso(as, ARMI_VLDR_D, r,\n\t    ra_allock(as, (i & ~1020), RSET_GPR), (i & 1020));\n}\n#endif\n\n/* Get/set global_State fields. */\n#define emit_getgl(as, r, field) \\\n  emit_lsptr(as, ARMI_LDR, (r), (void *)&J2G(as->J)->field)\n#define emit_setgl(as, r, field) \\\n  emit_lsptr(as, ARMI_STR, (r), (void *)&J2G(as->J)->field)\n\n/* Trace number is determined from pc of exit instruction. */\n#define emit_setvmstate(as, i)\t\tUNUSED(i)\n\n/* -- Emit control-flow instructions -------------------------------------- */\n\n/* Label for internal jumps. */\ntypedef MCode *MCLabel;\n\n/* Return label pointing to current PC. */\n#define emit_label(as)\t\t((as)->mcp)\n\nstatic void emit_branch(ASMState *as, ARMIns ai, MCode *target)\n{\n  MCode *p = as->mcp;\n  ptrdiff_t delta = (target - p) - 1;\n  lua_assert(((delta + 0x00800000) >> 24) == 0);\n  *--p = ai | ((uint32_t)delta & 0x00ffffffu);\n  as->mcp = p;\n}\n\n#define emit_jmp(as, target) emit_branch(as, ARMI_B, (target))\n\nstatic void emit_call(ASMState *as, void *target)\n{\n  MCode *p = --as->mcp;\n  ptrdiff_t delta = ((char *)target - (char *)p) - 8;\n  if ((((delta>>2) + 0x00800000) >> 24) == 0) {\n    if ((delta & 1))\n      *p = ARMI_BLX | ((uint32_t)(delta>>2) & 0x00ffffffu) | ((delta&2) << 27);\n    else\n      *p = ARMI_BL | ((uint32_t)(delta>>2) & 0x00ffffffu);\n  } else {  /* Target out of range: need indirect call. But don't use R0-R3. */\n    Reg r = ra_allock(as, i32ptr(target), RSET_RANGE(RID_R4, RID_R12+1));\n    *p = ARMI_BLXr | ARMF_M(r);\n  }\n}\n\n/* -- Emit generic operations --------------------------------------------- */\n\n/* Generic move between two regs. */\nstatic void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src)\n{\n#if LJ_SOFTFP\n  lua_assert(!irt_isnum(ir->t)); UNUSED(ir);\n#else\n  if (dst >= RID_MAX_GPR) {\n    emit_dm(as, irt_isnum(ir->t) ? ARMI_VMOV_D : ARMI_VMOV_S,\n\t    (dst & 15), (src & 15));\n    return;\n  }\n#endif\n  if (as->mcp != as->mcloop) {  /* Swap early registers for loads/stores. */\n    MCode ins = *as->mcp, swp = (src^dst);\n    if ((ins & 0x0c000000) == 0x04000000 && (ins & 0x02000010) != 0x02000010) {\n      if (!((ins ^ (dst << 16)) & 0x000f0000))\n\t*as->mcp = ins ^ (swp << 16);  /* Swap N in load/store. */\n      if (!(ins & 0x00100000) && !((ins ^ (dst << 12)) & 0x0000f000))\n\t*as->mcp = ins ^ (swp << 12);  /* Swap D in store. */\n    }\n  }\n  emit_dm(as, ARMI_MOV, dst, src);\n}\n\n/* Generic load of register from stack slot. */\nstatic void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n#if LJ_SOFTFP\n  lua_assert(!irt_isnum(ir->t)); UNUSED(ir);\n#else\n  if (r >= RID_MAX_GPR)\n    emit_vlso(as, irt_isnum(ir->t) ? ARMI_VLDR_D : ARMI_VLDR_S, r, RID_SP, ofs);\n  else\n#endif\n    emit_lso(as, ARMI_LDR, r, RID_SP, ofs);\n}\n\n/* Generic store of register to stack slot. */\nstatic void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n#if LJ_SOFTFP\n  lua_assert(!irt_isnum(ir->t)); UNUSED(ir);\n#else\n  if (r >= RID_MAX_GPR)\n    emit_vlso(as, irt_isnum(ir->t) ? ARMI_VSTR_D : ARMI_VSTR_S, r, RID_SP, ofs);\n  else\n#endif\n    emit_lso(as, ARMI_STR, r, RID_SP, ofs);\n}\n\n/* Emit an arithmetic/logic operation with a constant operand. */\nstatic void emit_opk(ASMState *as, ARMIns ai, Reg dest, Reg src,\n\t\t     int32_t i, RegSet allow)\n{\n  uint32_t k = emit_isk12(ai, i);\n  if (k)\n    emit_dn(as, ai^k, dest, src);\n  else\n    emit_dnm(as, ai, dest, src, ra_allock(as, i, allow));\n}\n\n/* Add offset to pointer. */\nstatic void emit_addptr(ASMState *as, Reg r, int32_t ofs)\n{\n  if (ofs)\n    emit_opk(as, ARMI_ADD, r, r, ofs, rset_exclude(RSET_GPR, r));\n}\n\n#define emit_spsub(as, ofs)\temit_addptr(as, RID_SP, -(ofs))\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_emit_mips.h",
    "content": "/*\n** MIPS instruction emitter.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Emit basic instructions --------------------------------------------- */\n\nstatic void emit_dst(ASMState *as, MIPSIns mi, Reg rd, Reg rs, Reg rt)\n{\n  *--as->mcp = mi | MIPSF_D(rd) | MIPSF_S(rs) | MIPSF_T(rt);\n}\n\nstatic void emit_dta(ASMState *as, MIPSIns mi, Reg rd, Reg rt, uint32_t a)\n{\n  *--as->mcp = mi | MIPSF_D(rd) | MIPSF_T(rt) | MIPSF_A(a);\n}\n\n#define emit_ds(as, mi, rd, rs)\t\temit_dst(as, (mi), (rd), (rs), 0)\n#define emit_tg(as, mi, rt, rg)\t\temit_dst(as, (mi), (rg)&31, 0, (rt))\n\nstatic void emit_tsi(ASMState *as, MIPSIns mi, Reg rt, Reg rs, int32_t i)\n{\n  *--as->mcp = mi | MIPSF_T(rt) | MIPSF_S(rs) | (i & 0xffff);\n}\n\n#define emit_ti(as, mi, rt, i)\t\temit_tsi(as, (mi), (rt), 0, (i))\n#define emit_hsi(as, mi, rh, rs, i)\temit_tsi(as, (mi), (rh) & 31, (rs), (i))\n\nstatic void emit_fgh(ASMState *as, MIPSIns mi, Reg rf, Reg rg, Reg rh)\n{\n  *--as->mcp = mi | MIPSF_F(rf&31) | MIPSF_G(rg&31) | MIPSF_H(rh&31);\n}\n\n#define emit_fg(as, mi, rf, rg)\t\temit_fgh(as, (mi), (rf), (rg), 0)\n\nstatic void emit_rotr(ASMState *as, Reg dest, Reg src, Reg tmp, uint32_t shift)\n{\n  if ((as->flags & JIT_F_MIPS32R2)) {\n    emit_dta(as, MIPSI_ROTR, dest, src, shift);\n  } else {\n    emit_dst(as, MIPSI_OR, dest, dest, tmp);\n    emit_dta(as, MIPSI_SLL, dest, src, (-shift)&31);\n    emit_dta(as, MIPSI_SRL, tmp, src, shift);\n  }\n}\n\n/* -- Emit loads/stores --------------------------------------------------- */\n\n/* Prefer rematerialization of BASE/L from global_State over spills. */\n#define emit_canremat(ref)\t((ref) <= REF_BASE)\n\n/* Try to find a one step delta relative to another constant. */\nstatic int emit_kdelta1(ASMState *as, Reg t, int32_t i)\n{\n  RegSet work = ~as->freeset & RSET_GPR;\n  while (work) {\n    Reg r = rset_picktop(work);\n    IRRef ref = regcost_ref(as->cost[r]);\n    lua_assert(r != t);\n    if (ref < ASMREF_L) {\n      int32_t delta = i - (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i);\n      if (checki16(delta)) {\n\temit_tsi(as, MIPSI_ADDIU, t, r, delta);\n\treturn 1;\n      }\n    }\n    rset_clear(work, r);\n  }\n  return 0;  /* Failed. */\n}\n\n/* Load a 32 bit constant into a GPR. */\nstatic void emit_loadi(ASMState *as, Reg r, int32_t i)\n{\n  if (checki16(i)) {\n    emit_ti(as, MIPSI_LI, r, i);\n  } else {\n    if ((i & 0xffff)) {\n      int32_t jgl = i32ptr(J2G(as->J));\n      if ((uint32_t)(i-jgl) < 65536) {\n\temit_tsi(as, MIPSI_ADDIU, r, RID_JGL, i-jgl-32768);\n\treturn;\n      } else if (emit_kdelta1(as, r, i)) {\n\treturn;\n      } else if ((i >> 16) == 0) {\n\temit_tsi(as, MIPSI_ORI, r, RID_ZERO, i);\n\treturn;\n      }\n      emit_tsi(as, MIPSI_ORI, r, r, i);\n    }\n    emit_ti(as, MIPSI_LUI, r, (i >> 16));\n  }\n}\n\n#define emit_loada(as, r, addr)\t\temit_loadi(as, (r), i32ptr((addr)))\n\nstatic Reg ra_allock(ASMState *as, int32_t k, RegSet allow);\nstatic void ra_allockreg(ASMState *as, int32_t k, Reg r);\n\n/* Get/set from constant pointer. */\nstatic void emit_lsptr(ASMState *as, MIPSIns mi, Reg r, void *p, RegSet allow)\n{\n  int32_t jgl = i32ptr(J2G(as->J));\n  int32_t i = i32ptr(p);\n  Reg base;\n  if ((uint32_t)(i-jgl) < 65536) {\n    i = i-jgl-32768;\n    base = RID_JGL;\n  } else {\n    base = ra_allock(as, i-(int16_t)i, allow);\n  }\n  emit_tsi(as, mi, r, base, i);\n}\n\n#define emit_loadn(as, r, tv) \\\n  emit_lsptr(as, MIPSI_LDC1, ((r) & 31), (void *)(tv), RSET_GPR)\n\n/* Get/set global_State fields. */\nstatic void emit_lsglptr(ASMState *as, MIPSIns mi, Reg r, int32_t ofs)\n{\n  emit_tsi(as, mi, r, RID_JGL, ofs-32768);\n}\n\n#define emit_getgl(as, r, field) \\\n  emit_lsglptr(as, MIPSI_LW, (r), (int32_t)offsetof(global_State, field))\n#define emit_setgl(as, r, field) \\\n  emit_lsglptr(as, MIPSI_SW, (r), (int32_t)offsetof(global_State, field))\n\n/* Trace number is determined from per-trace exit stubs. */\n#define emit_setvmstate(as, i)\t\tUNUSED(i)\n\n/* -- Emit control-flow instructions -------------------------------------- */\n\n/* Label for internal jumps. */\ntypedef MCode *MCLabel;\n\n/* Return label pointing to current PC. */\n#define emit_label(as)\t\t((as)->mcp)\n\nstatic void emit_branch(ASMState *as, MIPSIns mi, Reg rs, Reg rt, MCode *target)\n{\n  MCode *p = as->mcp;\n  ptrdiff_t delta = target - p;\n  lua_assert(((delta + 0x8000) >> 16) == 0);\n  *--p = mi | MIPSF_S(rs) | MIPSF_T(rt) | ((uint32_t)delta & 0xffffu);\n  as->mcp = p;\n}\n\nstatic void emit_jmp(ASMState *as, MCode *target)\n{\n  *--as->mcp = MIPSI_NOP;\n  emit_branch(as, MIPSI_B, RID_ZERO, RID_ZERO, (target));\n}\n\nstatic void emit_call(ASMState *as, void *target)\n{\n  MCode *p = as->mcp;\n  *--p = MIPSI_NOP;\n  if ((((uintptr_t)target ^ (uintptr_t)p) >> 28) == 0)\n    *--p = MIPSI_JAL | (((uintptr_t)target >>2) & 0x03ffffffu);\n  else  /* Target out of range: need indirect call. */\n    *--p = MIPSI_JALR | MIPSF_S(RID_CFUNCADDR);\n  as->mcp = p;\n  ra_allockreg(as, i32ptr(target), RID_CFUNCADDR);\n}\n\n/* -- Emit generic operations --------------------------------------------- */\n\n#define emit_move(as, dst, src) \\\n  emit_ds(as, MIPSI_MOVE, (dst), (src))\n\n/* Generic move between two regs. */\nstatic void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src)\n{\n  if (dst < RID_MAX_GPR)\n    emit_move(as, dst, src);\n  else\n    emit_fg(as, irt_isnum(ir->t) ? MIPSI_MOV_D : MIPSI_MOV_S, dst, src);\n}\n\n/* Generic load of register from stack slot. */\nstatic void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n  if (r < RID_MAX_GPR)\n    emit_tsi(as, MIPSI_LW, r, RID_SP, ofs);\n  else\n    emit_tsi(as, irt_isnum(ir->t) ? MIPSI_LDC1 : MIPSI_LWC1,\n\t     (r & 31), RID_SP, ofs);\n}\n\n/* Generic store of register to stack slot. */\nstatic void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n  if (r < RID_MAX_GPR)\n    emit_tsi(as, MIPSI_SW, r, RID_SP, ofs);\n  else\n    emit_tsi(as, irt_isnum(ir->t) ? MIPSI_SDC1 : MIPSI_SWC1,\n\t     (r&31), RID_SP, ofs);\n}\n\n/* Add offset to pointer. */\nstatic void emit_addptr(ASMState *as, Reg r, int32_t ofs)\n{\n  if (ofs) {\n    lua_assert(checki16(ofs));\n    emit_tsi(as, MIPSI_ADDIU, r, r, ofs);\n  }\n}\n\n#define emit_spsub(as, ofs)\temit_addptr(as, RID_SP, -(ofs))\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_emit_ppc.h",
    "content": "/*\n** PPC instruction emitter.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Emit basic instructions --------------------------------------------- */\n\nstatic void emit_tab(ASMState *as, PPCIns pi, Reg rt, Reg ra, Reg rb)\n{\n  *--as->mcp = pi | PPCF_T(rt) | PPCF_A(ra) | PPCF_B(rb);\n}\n\n#define emit_asb(as, pi, ra, rs, rb)\temit_tab(as, (pi), (rs), (ra), (rb))\n#define emit_as(as, pi, ra, rs)\t\temit_tab(as, (pi), (rs), (ra), 0)\n#define emit_ab(as, pi, ra, rb)\t\temit_tab(as, (pi), 0, (ra), (rb))\n\nstatic void emit_tai(ASMState *as, PPCIns pi, Reg rt, Reg ra, int32_t i)\n{\n  *--as->mcp = pi | PPCF_T(rt) | PPCF_A(ra) | (i & 0xffff);\n}\n\n#define emit_ti(as, pi, rt, i)\t\temit_tai(as, (pi), (rt), 0, (i))\n#define emit_ai(as, pi, ra, i)\t\temit_tai(as, (pi), 0, (ra), (i))\n#define emit_asi(as, pi, ra, rs, i)\temit_tai(as, (pi), (rs), (ra), (i))\n\n#define emit_fab(as, pi, rf, ra, rb) \\\n  emit_tab(as, (pi), (rf)&31, (ra)&31, (rb)&31)\n#define emit_fb(as, pi, rf, rb)\t\temit_tab(as, (pi), (rf)&31, 0, (rb)&31)\n#define emit_fac(as, pi, rf, ra, rc) \\\n  emit_tab(as, (pi) | PPCF_C((rc) & 31), (rf)&31, (ra)&31, 0)\n#define emit_facb(as, pi, rf, ra, rc, rb) \\\n  emit_tab(as, (pi) | PPCF_C((rc) & 31), (rf)&31, (ra)&31, (rb)&31)\n#define emit_fai(as, pi, rf, ra, i)\temit_tai(as, (pi), (rf)&31, (ra), (i))\n\nstatic void emit_rot(ASMState *as, PPCIns pi, Reg ra, Reg rs,\n\t\t     int32_t n, int32_t b, int32_t e)\n{\n  *--as->mcp = pi | PPCF_T(rs) | PPCF_A(ra) | PPCF_B(n) |\n\t       PPCF_MB(b) | PPCF_ME(e);\n}\n\nstatic void emit_slwi(ASMState *as, Reg ra, Reg rs, int32_t n)\n{\n  lua_assert(n >= 0 && n < 32);\n  emit_rot(as, PPCI_RLWINM, ra, rs, n, 0, 31-n);\n}\n\nstatic void emit_rotlwi(ASMState *as, Reg ra, Reg rs, int32_t n)\n{\n  lua_assert(n >= 0 && n < 32);\n  emit_rot(as, PPCI_RLWINM, ra, rs, n, 0, 31);\n}\n\n/* -- Emit loads/stores --------------------------------------------------- */\n\n/* Prefer rematerialization of BASE/L from global_State over spills. */\n#define emit_canremat(ref)\t((ref) <= REF_BASE)\n\n/* Try to find a one step delta relative to another constant. */\nstatic int emit_kdelta1(ASMState *as, Reg t, int32_t i)\n{\n  RegSet work = ~as->freeset & RSET_GPR;\n  while (work) {\n    Reg r = rset_picktop(work);\n    IRRef ref = regcost_ref(as->cost[r]);\n    lua_assert(r != t);\n    if (ref < ASMREF_L) {\n      int32_t delta = i - (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i);\n      if (checki16(delta)) {\n\temit_tai(as, PPCI_ADDI, t, r, delta);\n\treturn 1;\n      }\n    }\n    rset_clear(work, r);\n  }\n  return 0;  /* Failed. */\n}\n\n/* Load a 32 bit constant into a GPR. */\nstatic void emit_loadi(ASMState *as, Reg r, int32_t i)\n{\n  if (checki16(i)) {\n    emit_ti(as, PPCI_LI, r, i);\n  } else {\n    if ((i & 0xffff)) {\n      int32_t jgl = i32ptr(J2G(as->J));\n      if ((uint32_t)(i-jgl) < 65536) {\n\temit_tai(as, PPCI_ADDI, r, RID_JGL, i-jgl-32768);\n\treturn;\n      } else if (emit_kdelta1(as, r, i)) {\n\treturn;\n      }\n      emit_asi(as, PPCI_ORI, r, r, i);\n    }\n    emit_ti(as, PPCI_LIS, r, (i >> 16));\n  }\n}\n\n#define emit_loada(as, r, addr)\t\temit_loadi(as, (r), i32ptr((addr)))\n\nstatic Reg ra_allock(ASMState *as, int32_t k, RegSet allow);\n\n/* Get/set from constant pointer. */\nstatic void emit_lsptr(ASMState *as, PPCIns pi, Reg r, void *p, RegSet allow)\n{\n  int32_t jgl = i32ptr(J2G(as->J));\n  int32_t i = i32ptr(p);\n  Reg base;\n  if ((uint32_t)(i-jgl) < 65536) {\n    i = i-jgl-32768;\n    base = RID_JGL;\n  } else {\n    base = ra_allock(as, i-(int16_t)i, allow);\n  }\n  emit_tai(as, pi, r, base, i);\n}\n\n#define emit_loadn(as, r, tv) \\\n  emit_lsptr(as, PPCI_LFD, ((r) & 31), (void *)(tv), RSET_GPR)\n\n/* Get/set global_State fields. */\nstatic void emit_lsglptr(ASMState *as, PPCIns pi, Reg r, int32_t ofs)\n{\n  emit_tai(as, pi, r, RID_JGL, ofs-32768);\n}\n\n#define emit_getgl(as, r, field) \\\n  emit_lsglptr(as, PPCI_LWZ, (r), (int32_t)offsetof(global_State, field))\n#define emit_setgl(as, r, field) \\\n  emit_lsglptr(as, PPCI_STW, (r), (int32_t)offsetof(global_State, field))\n\n/* Trace number is determined from per-trace exit stubs. */\n#define emit_setvmstate(as, i)\t\tUNUSED(i)\n\n/* -- Emit control-flow instructions -------------------------------------- */\n\n/* Label for internal jumps. */\ntypedef MCode *MCLabel;\n\n/* Return label pointing to current PC. */\n#define emit_label(as)\t\t((as)->mcp)\n\nstatic void emit_condbranch(ASMState *as, PPCIns pi, PPCCC cc, MCode *target)\n{\n  MCode *p = --as->mcp;\n  ptrdiff_t delta = (char *)target - (char *)p;\n  lua_assert(((delta + 0x8000) >> 16) == 0);\n  pi ^= (delta & 0x8000) * (PPCF_Y/0x8000);\n  *p = pi | PPCF_CC(cc) | ((uint32_t)delta & 0xffffu);\n}\n\nstatic void emit_jmp(ASMState *as, MCode *target)\n{\n  MCode *p = --as->mcp;\n  ptrdiff_t delta = (char *)target - (char *)p;\n  *p = PPCI_B | (delta & 0x03fffffcu);\n}\n\nstatic void emit_call(ASMState *as, void *target)\n{\n  MCode *p = --as->mcp;\n  ptrdiff_t delta = (char *)target - (char *)p;\n  if ((((delta>>2) + 0x00800000) >> 24) == 0) {\n    *p = PPCI_BL | (delta & 0x03fffffcu);\n  } else {  /* Target out of range: need indirect call. Don't use arg reg. */\n    RegSet allow = RSET_GPR & ~RSET_RANGE(RID_R0, REGARG_LASTGPR+1);\n    Reg r = ra_allock(as, i32ptr(target), allow);\n    *p = PPCI_BCTRL;\n    p[-1] = PPCI_MTCTR | PPCF_T(r);\n    as->mcp = p-1;\n  }\n}\n\n/* -- Emit generic operations --------------------------------------------- */\n\n#define emit_mr(as, dst, src) \\\n  emit_asb(as, PPCI_MR, (dst), (src), (src))\n\n/* Generic move between two regs. */\nstatic void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src)\n{\n  UNUSED(ir);\n  if (dst < RID_MAX_GPR)\n    emit_mr(as, dst, src);\n  else\n    emit_fb(as, PPCI_FMR, dst, src);\n}\n\n/* Generic load of register from stack slot. */\nstatic void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n  if (r < RID_MAX_GPR)\n    emit_tai(as, PPCI_LWZ, r, RID_SP, ofs);\n  else\n    emit_fai(as, irt_isnum(ir->t) ? PPCI_LFD : PPCI_LFS, r, RID_SP, ofs);\n}\n\n/* Generic store of register to stack slot. */\nstatic void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n  if (r < RID_MAX_GPR)\n    emit_tai(as, PPCI_STW, r, RID_SP, ofs);\n  else\n    emit_fai(as, irt_isnum(ir->t) ? PPCI_STFD : PPCI_STFS, r, RID_SP, ofs);\n}\n\n/* Emit a compare (for equality) with a constant operand. */\nstatic void emit_cmpi(ASMState *as, Reg r, int32_t k)\n{\n  if (checki16(k)) {\n    emit_ai(as, PPCI_CMPWI, r, k);\n  } else if (checku16(k)) {\n    emit_ai(as, PPCI_CMPLWI, r, k);\n  } else {\n    emit_ai(as, PPCI_CMPLWI, RID_TMP, k);\n    emit_asi(as, PPCI_XORIS, RID_TMP, r, (k >> 16));\n  }\n}\n\n/* Add offset to pointer. */\nstatic void emit_addptr(ASMState *as, Reg r, int32_t ofs)\n{\n  if (ofs) {\n    emit_tai(as, PPCI_ADDI, r, r, ofs);\n    if (!checki16(ofs))\n      emit_tai(as, PPCI_ADDIS, r, r, (ofs + 32768) >> 16);\n  }\n}\n\nstatic void emit_spsub(ASMState *as, int32_t ofs)\n{\n  if (ofs) {\n    emit_tai(as, PPCI_STWU, RID_TMP, RID_SP, -ofs);\n    emit_tai(as, PPCI_ADDI, RID_TMP, RID_SP,\n\t     CFRAME_SIZE + (as->parent ? as->parent->spadjust : 0));\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_emit_x86.h",
    "content": "/*\n** x86/x64 instruction emitter.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* -- Emit basic instructions --------------------------------------------- */\n\n#define MODRM(mode, r1, r2)\t((MCode)((mode)+(((r1)&7)<<3)+((r2)&7)))\n\n#if LJ_64\n#define REXRB(p, rr, rb) \\\n    { MCode rex = 0x40 + (((rr)>>1)&4) + (((rb)>>3)&1); \\\n      if (rex != 0x40) *--(p) = rex; }\n#define FORCE_REX\t\t0x200\n#define REX_64\t\t\t(FORCE_REX|0x080000)\n#else\n#define REXRB(p, rr, rb)\t((void)0)\n#define FORCE_REX\t\t0\n#define REX_64\t\t\t0\n#endif\n\n#define emit_i8(as, i)\t\t(*--as->mcp = (MCode)(i))\n#define emit_i32(as, i)\t\t(*(int32_t *)(as->mcp-4) = (i), as->mcp -= 4)\n#define emit_u32(as, u)\t\t(*(uint32_t *)(as->mcp-4) = (u), as->mcp -= 4)\n\n#define emit_x87op(as, xo) \\\n  (*(uint16_t *)(as->mcp-2) = (uint16_t)(xo), as->mcp -= 2)\n\n/* op */\nstatic LJ_AINLINE MCode *emit_op(x86Op xo, Reg rr, Reg rb, Reg rx,\n\t\t\t\t MCode *p, int delta)\n{\n  int n = (int8_t)xo;\n#if defined(__GNUC__)\n  if (__builtin_constant_p(xo) && n == -2)\n    p[delta-2] = (MCode)(xo >> 24);\n  else if (__builtin_constant_p(xo) && n == -3)\n    *(uint16_t *)(p+delta-3) = (uint16_t)(xo >> 16);\n  else\n#endif\n    *(uint32_t *)(p+delta-5) = (uint32_t)xo;\n  p += n + delta;\n#if LJ_64\n  {\n    uint32_t rex = 0x40 + ((rr>>1)&(4+(FORCE_REX>>1)))+((rx>>2)&2)+((rb>>3)&1);\n    if (rex != 0x40) {\n      rex |= (rr >> 16);\n      if (n == -4) { *p = (MCode)rex; rex = (MCode)(xo >> 8); }\n      else if ((xo & 0xffffff) == 0x6600fd) { *p = (MCode)rex; rex = 0x66; }\n      *--p = (MCode)rex;\n    }\n  }\n#else\n  UNUSED(rr); UNUSED(rb); UNUSED(rx);\n#endif\n  return p;\n}\n\n/* op + modrm */\n#define emit_opm(xo, mode, rr, rb, p, delta) \\\n  (p[(delta)-1] = MODRM((mode), (rr), (rb)), \\\n   emit_op((xo), (rr), (rb), 0, (p), (delta)))\n\n/* op + modrm + sib */\n#define emit_opmx(xo, mode, scale, rr, rb, rx, p) \\\n  (p[-1] = MODRM((scale), (rx), (rb)), \\\n   p[-2] = MODRM((mode), (rr), RID_ESP), \\\n   emit_op((xo), (rr), (rb), (rx), (p), -1))\n\n/* op r1, r2 */\nstatic void emit_rr(ASMState *as, x86Op xo, Reg r1, Reg r2)\n{\n  MCode *p = as->mcp;\n  as->mcp = emit_opm(xo, XM_REG, r1, r2, p, 0);\n}\n\n#if LJ_64 && defined(LUA_USE_ASSERT)\n/* [addr] is sign-extended in x64 and must be in lower 2G (not 4G). */\nstatic int32_t ptr2addr(const void *p)\n{\n  lua_assert((uintptr_t)p < (uintptr_t)0x80000000);\n  return i32ptr(p);\n}\n#else\n#define ptr2addr(p)\t(i32ptr((p)))\n#endif\n\n/* op r, [addr] */\nstatic void emit_rma(ASMState *as, x86Op xo, Reg rr, const void *addr)\n{\n  MCode *p = as->mcp;\n  *(int32_t *)(p-4) = ptr2addr(addr);\n#if LJ_64\n  p[-5] = MODRM(XM_SCALE1, RID_ESP, RID_EBP);\n  as->mcp = emit_opm(xo, XM_OFS0, rr, RID_ESP, p, -5);\n#else\n  as->mcp = emit_opm(xo, XM_OFS0, rr, RID_EBP, p, -4);\n#endif\n}\n\n/* op r, [base+ofs] */\nstatic void emit_rmro(ASMState *as, x86Op xo, Reg rr, Reg rb, int32_t ofs)\n{\n  MCode *p = as->mcp;\n  x86Mode mode;\n  if (ra_hasreg(rb)) {\n    if (ofs == 0 && (rb&7) != RID_EBP) {\n      mode = XM_OFS0;\n    } else if (checki8(ofs)) {\n      *--p = (MCode)ofs;\n      mode = XM_OFS8;\n    } else {\n      p -= 4;\n      *(int32_t *)p = ofs;\n      mode = XM_OFS32;\n    }\n    if ((rb&7) == RID_ESP)\n      *--p = MODRM(XM_SCALE1, RID_ESP, RID_ESP);\n  } else {\n    *(int32_t *)(p-4) = ofs;\n#if LJ_64\n    p[-5] = MODRM(XM_SCALE1, RID_ESP, RID_EBP);\n    p -= 5;\n    rb = RID_ESP;\n#else\n    p -= 4;\n    rb = RID_EBP;\n#endif\n    mode = XM_OFS0;\n  }\n  as->mcp = emit_opm(xo, mode, rr, rb, p, 0);\n}\n\n/* op r, [base+idx*scale+ofs] */\nstatic void emit_rmrxo(ASMState *as, x86Op xo, Reg rr, Reg rb, Reg rx,\n\t\t       x86Mode scale, int32_t ofs)\n{\n  MCode *p = as->mcp;\n  x86Mode mode;\n  if (ofs == 0 && (rb&7) != RID_EBP) {\n    mode = XM_OFS0;\n  } else if (checki8(ofs)) {\n    mode = XM_OFS8;\n    *--p = (MCode)ofs;\n  } else {\n    mode = XM_OFS32;\n    p -= 4;\n    *(int32_t *)p = ofs;\n  }\n  as->mcp = emit_opmx(xo, mode, scale, rr, rb, rx, p);\n}\n\n/* op r, i */\nstatic void emit_gri(ASMState *as, x86Group xg, Reg rb, int32_t i)\n{\n  MCode *p = as->mcp;\n  x86Op xo;\n  if (checki8(i)) {\n    *--p = (MCode)i;\n    xo = XG_TOXOi8(xg);\n  } else {\n    p -= 4;\n    *(int32_t *)p = i;\n    xo = XG_TOXOi(xg);\n  }\n  as->mcp = emit_opm(xo, XM_REG, (Reg)(xg & 7) | (rb & REX_64), rb, p, 0);\n}\n\n/* op [base+ofs], i */\nstatic void emit_gmroi(ASMState *as, x86Group xg, Reg rb, int32_t ofs,\n\t\t       int32_t i)\n{\n  x86Op xo;\n  if (checki8(i)) {\n    emit_i8(as, i);\n    xo = XG_TOXOi8(xg);\n  } else {\n    emit_i32(as, i);\n    xo = XG_TOXOi(xg);\n  }\n  emit_rmro(as, xo, (Reg)(xg & 7), rb, ofs);\n}\n\n#define emit_shifti(as, xg, r, i) \\\n  (emit_i8(as, (i)), emit_rr(as, XO_SHIFTi, (Reg)(xg), (r)))\n\n/* op r, rm/mrm */\nstatic void emit_mrm(ASMState *as, x86Op xo, Reg rr, Reg rb)\n{\n  MCode *p = as->mcp;\n  x86Mode mode = XM_REG;\n  if (rb == RID_MRM) {\n    rb = as->mrm.base;\n    if (rb == RID_NONE) {\n      rb = RID_EBP;\n      mode = XM_OFS0;\n      p -= 4;\n      *(int32_t *)p = as->mrm.ofs;\n      if (as->mrm.idx != RID_NONE)\n\tgoto mrmidx;\n#if LJ_64\n      *--p = MODRM(XM_SCALE1, RID_ESP, RID_EBP);\n      rb = RID_ESP;\n#endif\n    } else {\n      if (as->mrm.ofs == 0 && (rb&7) != RID_EBP) {\n\tmode = XM_OFS0;\n      } else if (checki8(as->mrm.ofs)) {\n\t*--p = (MCode)as->mrm.ofs;\n\tmode = XM_OFS8;\n      } else {\n\tp -= 4;\n\t*(int32_t *)p = as->mrm.ofs;\n\tmode = XM_OFS32;\n      }\n      if (as->mrm.idx != RID_NONE) {\n      mrmidx:\n\tas->mcp = emit_opmx(xo, mode, as->mrm.scale, rr, rb, as->mrm.idx, p);\n\treturn;\n      }\n      if ((rb&7) == RID_ESP)\n\t*--p = MODRM(XM_SCALE1, RID_ESP, RID_ESP);\n    }\n  }\n  as->mcp = emit_opm(xo, mode, rr, rb, p, 0);\n}\n\n/* op rm/mrm, i */\nstatic void emit_gmrmi(ASMState *as, x86Group xg, Reg rb, int32_t i)\n{\n  x86Op xo;\n  if (checki8(i)) {\n    emit_i8(as, i);\n    xo = XG_TOXOi8(xg);\n  } else {\n    emit_i32(as, i);\n    xo = XG_TOXOi(xg);\n  }\n  emit_mrm(as, xo, (Reg)(xg & 7) | (rb & REX_64), (rb & ~REX_64));\n}\n\n/* -- Emit loads/stores --------------------------------------------------- */\n\n/* Instruction selection for XMM moves. */\n#define XMM_MOVRR(as)\t((as->flags & JIT_F_SPLIT_XMM) ? XO_MOVSD : XO_MOVAPS)\n#define XMM_MOVRM(as)\t((as->flags & JIT_F_SPLIT_XMM) ? XO_MOVLPD : XO_MOVSD)\n\n/* mov [base+ofs], i */\nstatic void emit_movmroi(ASMState *as, Reg base, int32_t ofs, int32_t i)\n{\n  emit_i32(as, i);\n  emit_rmro(as, XO_MOVmi, 0, base, ofs);\n}\n\n/* mov [base+ofs], r */\n#define emit_movtomro(as, r, base, ofs) \\\n  emit_rmro(as, XO_MOVto, (r), (base), (ofs))\n\n/* Get/set global_State fields. */\n#define emit_opgl(as, xo, r, field) \\\n  emit_rma(as, (xo), (r), (void *)&J2G(as->J)->field)\n#define emit_getgl(as, r, field)\temit_opgl(as, XO_MOV, (r), field)\n#define emit_setgl(as, r, field)\temit_opgl(as, XO_MOVto, (r), field)\n\n#define emit_setvmstate(as, i) \\\n  (emit_i32(as, i), emit_opgl(as, XO_MOVmi, 0, vmstate))\n\n/* mov r, i / xor r, r */\nstatic void emit_loadi(ASMState *as, Reg r, int32_t i)\n{\n  /* XOR r,r is shorter, but modifies the flags. This is bad for HIOP. */\n  if (i == 0 && !(LJ_32 && (IR(as->curins)->o == IR_HIOP ||\n\t\t\t    (as->curins+1 < as->T->nins &&\n\t\t\t     IR(as->curins+1)->o == IR_HIOP)))) {\n    emit_rr(as, XO_ARITH(XOg_XOR), r, r);\n  } else {\n    MCode *p = as->mcp;\n    *(int32_t *)(p-4) = i;\n    p[-5] = (MCode)(XI_MOVri+(r&7));\n    p -= 5;\n    REXRB(p, 0, r);\n    as->mcp = p;\n  }\n}\n\n/* mov r, addr */\n#define emit_loada(as, r, addr) \\\n  emit_loadi(as, (r), ptr2addr((addr)))\n\n#if LJ_64\n/* mov r, imm64 or shorter 32 bit extended load. */\nstatic void emit_loadu64(ASMState *as, Reg r, uint64_t u64)\n{\n  if (checku32(u64)) {  /* 32 bit load clears upper 32 bits. */\n    emit_loadi(as, r, (int32_t)u64);\n  } else if (checki32((int64_t)u64)) {  /* Sign-extended 32 bit load. */\n    MCode *p = as->mcp;\n    *(int32_t *)(p-4) = (int32_t)u64;\n    as->mcp = emit_opm(XO_MOVmi, XM_REG, REX_64, r, p, -4);\n  } else {  /* Full-size 64 bit load. */\n    MCode *p = as->mcp;\n    *(uint64_t *)(p-8) = u64;\n    p[-9] = (MCode)(XI_MOVri+(r&7));\n    p[-10] = 0x48 + ((r>>3)&1);\n    p -= 10;\n    as->mcp = p;\n  }\n}\n#endif\n\n/* movsd r, [&tv->n] / xorps r, r */\nstatic void emit_loadn(ASMState *as, Reg r, cTValue *tv)\n{\n  if (tvispzero(tv))  /* Use xor only for +0. */\n    emit_rr(as, XO_XORPS, r, r);\n  else\n    emit_rma(as, XMM_MOVRM(as), r, &tv->n);\n}\n\n/* -- Emit control-flow instructions -------------------------------------- */\n\n/* Label for short jumps. */\ntypedef MCode *MCLabel;\n\n#if LJ_32 && LJ_HASFFI\n/* jmp short target */\nstatic void emit_sjmp(ASMState *as, MCLabel target)\n{\n  MCode *p = as->mcp;\n  ptrdiff_t delta = target - p;\n  lua_assert(delta == (int8_t)delta);\n  p[-1] = (MCode)(int8_t)delta;\n  p[-2] = XI_JMPs;\n  as->mcp = p - 2;\n}\n#endif\n\n/* jcc short target */\nstatic void emit_sjcc(ASMState *as, int cc, MCLabel target)\n{\n  MCode *p = as->mcp;\n  ptrdiff_t delta = target - p;\n  lua_assert(delta == (int8_t)delta);\n  p[-1] = (MCode)(int8_t)delta;\n  p[-2] = (MCode)(XI_JCCs+(cc&15));\n  as->mcp = p - 2;\n}\n\n/* jcc short (pending target) */\nstatic MCLabel emit_sjcc_label(ASMState *as, int cc)\n{\n  MCode *p = as->mcp;\n  p[-1] = 0;\n  p[-2] = (MCode)(XI_JCCs+(cc&15));\n  as->mcp = p - 2;\n  return p;\n}\n\n/* Fixup jcc short target. */\nstatic void emit_sfixup(ASMState *as, MCLabel source)\n{\n  source[-1] = (MCode)(as->mcp-source);\n}\n\n/* Return label pointing to current PC. */\n#define emit_label(as)\t\t((as)->mcp)\n\n/* Compute relative 32 bit offset for jump and call instructions. */\nstatic LJ_AINLINE int32_t jmprel(MCode *p, MCode *target)\n{\n  ptrdiff_t delta = target - p;\n  lua_assert(delta == (int32_t)delta);\n  return (int32_t)delta;\n}\n\n/* jcc target */\nstatic void emit_jcc(ASMState *as, int cc, MCode *target)\n{\n  MCode *p = as->mcp;\n  *(int32_t *)(p-4) = jmprel(p, target);\n  p[-5] = (MCode)(XI_JCCn+(cc&15));\n  p[-6] = 0x0f;\n  as->mcp = p - 6;\n}\n\n/* jmp target */\nstatic void emit_jmp(ASMState *as, MCode *target)\n{\n  MCode *p = as->mcp;\n  *(int32_t *)(p-4) = jmprel(p, target);\n  p[-5] = XI_JMP;\n  as->mcp = p - 5;\n}\n\n/* call target */\nstatic void emit_call_(ASMState *as, MCode *target)\n{\n  MCode *p = as->mcp;\n#if LJ_64\n  if (target-p != (int32_t)(target-p)) {\n    /* Assumes RID_RET is never an argument to calls and always clobbered. */\n    emit_rr(as, XO_GROUP5, XOg_CALL, RID_RET);\n    emit_loadu64(as, RID_RET, (uint64_t)target);\n    return;\n  }\n#endif\n  *(int32_t *)(p-4) = jmprel(p, target);\n  p[-5] = XI_CALL;\n  as->mcp = p - 5;\n}\n\n#define emit_call(as, f)\temit_call_(as, (MCode *)(void *)(f))\n\n/* -- Emit generic operations --------------------------------------------- */\n\n/* Use 64 bit operations to handle 64 bit IR types. */\n#if LJ_64\n#define REX_64IR(ir, r)\t\t((r) + (irt_is64((ir)->t) ? REX_64 : 0))\n#else\n#define REX_64IR(ir, r)\t\t(r)\n#endif\n\n/* Generic move between two regs. */\nstatic void emit_movrr(ASMState *as, IRIns *ir, Reg dst, Reg src)\n{\n  UNUSED(ir);\n  if (dst < RID_MAX_GPR)\n    emit_rr(as, XO_MOV, REX_64IR(ir, dst), src);\n  else\n    emit_rr(as, XMM_MOVRR(as), dst, src);\n}\n\n/* Generic load of register from stack slot. */\nstatic void emit_spload(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n  if (r < RID_MAX_GPR)\n    emit_rmro(as, XO_MOV, REX_64IR(ir, r), RID_ESP, ofs);\n  else\n    emit_rmro(as, irt_isnum(ir->t) ? XMM_MOVRM(as) : XO_MOVSS, r, RID_ESP, ofs);\n}\n\n/* Generic store of register to stack slot. */\nstatic void emit_spstore(ASMState *as, IRIns *ir, Reg r, int32_t ofs)\n{\n  if (r < RID_MAX_GPR)\n    emit_rmro(as, XO_MOVto, REX_64IR(ir, r), RID_ESP, ofs);\n  else\n    emit_rmro(as, irt_isnum(ir->t) ? XO_MOVSDto : XO_MOVSSto, r, RID_ESP, ofs);\n}\n\n/* Add offset to pointer. */\nstatic void emit_addptr(ASMState *as, Reg r, int32_t ofs)\n{\n  if (ofs) {\n    if ((as->flags & JIT_F_LEA_AGU))\n      emit_rmro(as, XO_LEA, r, r, ofs);\n    else\n      emit_gri(as, XG_ARITHi(XOg_ADD), r, ofs);\n  }\n}\n\n#define emit_spsub(as, ofs)\temit_addptr(as, RID_ESP|REX_64, -(ofs))\n\n/* Prefer rematerialization of BASE/L from global_State over spills. */\n#define emit_canremat(ref)\t((ref) <= REF_BASE)\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_err.c",
    "content": "/*\n** Error handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_err_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_str.h\"\n#include \"lj_func.h\"\n#include \"lj_state.h\"\n#include \"lj_frame.h\"\n#include \"lj_ff.h\"\n#include \"lj_trace.h\"\n#include \"lj_vm.h\"\n\n/*\n** LuaJIT can either use internal or external frame unwinding:\n**\n** - Internal frame unwinding (INT) is free-standing and doesn't require\n**   any OS or library support.\n**\n** - External frame unwinding (EXT) uses the system-provided unwind handler.\n**\n** Pros and Cons:\n**\n** - EXT requires unwind tables for *all* functions on the C stack between\n**   the pcall/catch and the error/throw. This is the default on x64,\n**   but needs to be manually enabled on x86/PPC for non-C++ code.\n**\n** - INT is faster when actually throwing errors (but this happens rarely).\n**   Setting up error handlers is zero-cost in any case.\n**\n** - EXT provides full interoperability with C++ exceptions. You can throw\n**   Lua errors or C++ exceptions through a mix of Lua frames and C++ frames.\n**   C++ destructors are called as needed. C++ exceptions caught by pcall\n**   are converted to the string \"C++ exception\". Lua errors can be caught\n**   with catch (...) in C++.\n**\n** - INT has only limited support for automatically catching C++ exceptions\n**   on POSIX systems using DWARF2 stack unwinding. Other systems may use\n**   the wrapper function feature. Lua errors thrown through C++ frames\n**   cannot be caught by C++ code and C++ destructors are not run.\n**\n** EXT is the default on x64 systems, INT is the default on all other systems.\n**\n** EXT can be manually enabled on POSIX systems using GCC and DWARF2 stack\n** unwinding with -DLUAJIT_UNWIND_EXTERNAL. *All* C code must be compiled\n** with -funwind-tables (or -fexceptions). This includes LuaJIT itself (set\n** TARGET_CFLAGS), all of your C/Lua binding code, all loadable C modules\n** and all C libraries that have callbacks which may be used to call back\n** into Lua. C++ code must *not* be compiled with -fno-exceptions.\n**\n** EXT cannot be enabled on WIN32 since system exceptions use code-driven SEH.\n** EXT is mandatory on WIN64 since the calling convention has an abundance\n** of callee-saved registers (rbx, rbp, rsi, rdi, r12-r15, xmm6-xmm15).\n** EXT is mandatory on POSIX/x64 since the interpreter doesn't save r12/r13.\n*/\n\n#if defined(__GNUC__) && (LJ_TARGET_X64 || defined(LUAJIT_UNWIND_EXTERNAL))\n#define LJ_UNWIND_EXT\t1\n#elif LJ_TARGET_X64 && LJ_TARGET_WINDOWS\n#define LJ_UNWIND_EXT\t1\n#endif\n\n/* -- Error messages ------------------------------------------------------ */\n\n/* Error message strings. */\nLJ_DATADEF const char *lj_err_allmsg =\n#define ERRDEF(name, msg)\tmsg \"\\0\"\n#include \"lj_errmsg.h\"\n;\n\n/* -- Internal frame unwinding -------------------------------------------- */\n\n/* Unwind Lua stack and move error message to new top. */\nLJ_NOINLINE static void unwindstack(lua_State *L, TValue *top)\n{\n  lj_func_closeuv(L, top);\n  if (top < L->top-1) {\n    copyTV(L, top, L->top-1);\n    L->top = top+1;\n  }\n  lj_state_relimitstack(L);\n}\n\n/* Unwind until stop frame. Optionally cleanup frames. */\nstatic void *err_unwind(lua_State *L, void *stopcf, int errcode)\n{\n  TValue *frame = L->base-1;\n  void *cf = L->cframe;\n  while (cf) {\n    int32_t nres = cframe_nres(cframe_raw(cf));\n    if (nres < 0) {  /* C frame without Lua frame? */\n      TValue *top = restorestack(L, -nres);\n      if (frame < top) {  /* Frame reached? */\n\tif (errcode) {\n\t  L->cframe = cframe_prev(cf);\n\t  L->base = frame+1;\n\t  unwindstack(L, top);\n\t}\n\treturn cf;\n      }\n    }\n    if (frame <= tvref(L->stack))\n      break;\n    switch (frame_typep(frame)) {\n    case FRAME_LUA:  /* Lua frame. */\n    case FRAME_LUAP:\n      frame = frame_prevl(frame);\n      break;\n    case FRAME_C:  /* C frame. */\n#if LJ_HASFFI\n    unwind_c:\n#endif\n#if LJ_UNWIND_EXT\n      if (errcode) {\n\tL->cframe = cframe_prev(cf);\n\tL->base = frame_prevd(frame) + 1;\n\tunwindstack(L, frame);\n      } else if (cf != stopcf) {\n\tcf = cframe_prev(cf);\n\tframe = frame_prevd(frame);\n\tbreak;\n      }\n      return NULL;  /* Continue unwinding. */\n#else\n      UNUSED(stopcf);\n      cf = cframe_prev(cf);\n      frame = frame_prevd(frame);\n      break;\n#endif\n    case FRAME_CP:  /* Protected C frame. */\n      if (cframe_canyield(cf)) {  /* Resume? */\n\tif (errcode) {\n\t  hook_leave(G(L));  /* Assumes nobody uses coroutines inside hooks. */\n\t  L->cframe = NULL;\n\t  L->status = (uint8_t)errcode;\n\t}\n\treturn cf;\n      }\n      if (errcode) {\n\tL->cframe = cframe_prev(cf);\n\tL->base = frame_prevd(frame) + 1;\n\tunwindstack(L, frame);\n      }\n      return cf;\n    case FRAME_CONT:  /* Continuation frame. */\n#if LJ_HASFFI\n      if ((frame-1)->u32.lo == LJ_CONT_FFI_CALLBACK)\n\tgoto unwind_c;\n#endif\n    case FRAME_VARG:  /* Vararg frame. */\n      frame = frame_prevd(frame);\n      break;\n    case FRAME_PCALL:  /* FF pcall() frame. */\n    case FRAME_PCALLH:  /* FF pcall() frame inside hook. */\n      if (errcode) {\n\tif (errcode == LUA_YIELD) {\n\t  frame = frame_prevd(frame);\n\t  break;\n\t}\n\tif (frame_typep(frame) == FRAME_PCALL)\n\t  hook_leave(G(L));\n\tL->cframe = cf;\n\tL->base = frame_prevd(frame) + 1;\n\tunwindstack(L, L->base);\n      }\n      return (void *)((intptr_t)cf | CFRAME_UNWIND_FF);\n    }\n  }\n  /* No C frame. */\n  if (errcode) {\n    L->cframe = NULL;\n    L->base = tvref(L->stack)+1;\n    unwindstack(L, L->base);\n    if (G(L)->panic)\n      G(L)->panic(L);\n    exit(EXIT_FAILURE);\n  }\n  return L;  /* Anything non-NULL will do. */\n}\n\n/* -- External frame unwinding -------------------------------------------- */\n\n#if defined(__GNUC__) && !LJ_NO_UNWIND && !LJ_TARGET_WINDOWS\n\n/*\n** We have to use our own definitions instead of the mandatory (!) unwind.h,\n** since various OS, distros and compilers mess up the header installation.\n*/\n\ntypedef struct _Unwind_Exception\n{\n  uint64_t exclass;\n  void (*excleanup)(int, struct _Unwind_Exception);\n  uintptr_t p1, p2;\n} __attribute__((__aligned__)) _Unwind_Exception;\n\ntypedef struct _Unwind_Context _Unwind_Context;\n\n#define _URC_OK\t\t\t0\n#define _URC_FATAL_PHASE1_ERROR\t3\n#define _URC_HANDLER_FOUND\t6\n#define _URC_INSTALL_CONTEXT\t7\n#define _URC_CONTINUE_UNWIND\t8\n#define _URC_FAILURE\t\t9\n\n#if !LJ_TARGET_ARM\n\nextern uintptr_t _Unwind_GetCFA(_Unwind_Context *);\nextern void _Unwind_SetGR(_Unwind_Context *, int, uintptr_t);\nextern void _Unwind_SetIP(_Unwind_Context *, uintptr_t);\nextern void _Unwind_DeleteException(_Unwind_Exception *);\nextern int _Unwind_RaiseException(_Unwind_Exception *);\n\n#define _UA_SEARCH_PHASE\t1\n#define _UA_CLEANUP_PHASE\t2\n#define _UA_HANDLER_FRAME\t4\n#define _UA_FORCE_UNWIND\t8\n\n#define LJ_UEXCLASS\t\t0x4c55414a49543200ULL\t/* LUAJIT2\\0 */\n#define LJ_UEXCLASS_MAKE(c)\t(LJ_UEXCLASS | (uint64_t)(c))\n#define LJ_UEXCLASS_CHECK(cl)\t(((cl) ^ LJ_UEXCLASS) <= 0xff)\n#define LJ_UEXCLASS_ERRCODE(cl)\t((int)((cl) & 0xff))\n\n/* DWARF2 personality handler referenced from interpreter .eh_frame. */\nLJ_FUNCA int lj_err_unwind_dwarf(int version, int actions,\n  uint64_t uexclass, _Unwind_Exception *uex, _Unwind_Context *ctx)\n{\n  void *cf;\n  lua_State *L;\n  if (version != 1)\n    return _URC_FATAL_PHASE1_ERROR;\n  UNUSED(uexclass);\n  cf = (void *)_Unwind_GetCFA(ctx);\n  L = cframe_L(cf);\n  if ((actions & _UA_SEARCH_PHASE)) {\n#if LJ_UNWIND_EXT\n    if (err_unwind(L, cf, 0) == NULL)\n      return _URC_CONTINUE_UNWIND;\n#endif\n    if (!LJ_UEXCLASS_CHECK(uexclass)) {\n      setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP));\n    }\n    return _URC_HANDLER_FOUND;\n  }\n  if ((actions & _UA_CLEANUP_PHASE)) {\n    int errcode;\n    if (LJ_UEXCLASS_CHECK(uexclass)) {\n      errcode = LJ_UEXCLASS_ERRCODE(uexclass);\n    } else {\n      if ((actions & _UA_HANDLER_FRAME))\n\t_Unwind_DeleteException(uex);\n      errcode = LUA_ERRRUN;\n    }\n#if LJ_UNWIND_EXT\n    cf = err_unwind(L, cf, errcode);\n    if ((actions & _UA_FORCE_UNWIND)) {\n      return _URC_CONTINUE_UNWIND;\n    } else if (cf) {\n      _Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode);\n      _Unwind_SetIP(ctx, (uintptr_t)(cframe_unwind_ff(cf) ?\n\t\t\t\t     lj_vm_unwind_ff_eh :\n\t\t\t\t     lj_vm_unwind_c_eh));\n      return _URC_INSTALL_CONTEXT;\n    }\n#if LJ_TARGET_X86ORX64\n    else if ((actions & _UA_HANDLER_FRAME)) {\n      /* Workaround for ancient libgcc bug. Still present in RHEL 5.5. :-/\n      ** Real fix: http://gcc.gnu.org/viewcvs/trunk/gcc/unwind-dw2.c?r1=121165&r2=124837&pathrev=153877&diff_format=h\n      */\n      _Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode);\n      _Unwind_SetIP(ctx, (uintptr_t)lj_vm_unwind_rethrow);\n      return _URC_INSTALL_CONTEXT;\n    }\n#endif\n#else\n    /* This is not the proper way to escape from the unwinder. We get away with\n    ** it on non-x64 because the interpreter restores all callee-saved regs.\n    */\n    lj_err_throw(L, errcode);\n#endif\n  }\n  return _URC_CONTINUE_UNWIND;\n}\n\n#if LJ_UNWIND_EXT\n#if LJ_TARGET_OSX || defined(__OpenBSD__)\n/* Sorry, no thread safety for OSX. Complain to Apple, not me. */\nstatic _Unwind_Exception static_uex;\n#else\nstatic __thread _Unwind_Exception static_uex;\n#endif\n\n/* Raise DWARF2 exception. */\nstatic void err_raise_ext(int errcode)\n{\n  static_uex.exclass = LJ_UEXCLASS_MAKE(errcode);\n  static_uex.excleanup = NULL;\n  _Unwind_RaiseException(&static_uex);\n}\n#endif\n\n#else\n\nextern void _Unwind_DeleteException(void *);\nextern int __gnu_unwind_frame (void *, _Unwind_Context *);\nextern int _Unwind_VRS_Set(_Unwind_Context *, int, uint32_t, int, void *);\nextern int _Unwind_VRS_Get(_Unwind_Context *, int, uint32_t, int, void *);\n\nstatic inline uint32_t _Unwind_GetGR(_Unwind_Context *ctx, int r)\n{\n  uint32_t v;\n  _Unwind_VRS_Get(ctx, 0, r, 0, &v);\n  return v;\n}\n\nstatic inline void _Unwind_SetGR(_Unwind_Context *ctx, int r, uint32_t v)\n{\n  _Unwind_VRS_Set(ctx, 0, r, 0, &v);\n}\n\n#define _US_VIRTUAL_UNWIND_FRAME\t0\n#define _US_UNWIND_FRAME_STARTING\t1\n#define _US_ACTION_MASK\t\t\t3\n#define _US_FORCE_UNWIND\t\t8\n\n/* ARM unwinder personality handler referenced from interpreter .ARM.extab. */\nLJ_FUNCA int lj_err_unwind_arm(int state, void *ucb, _Unwind_Context *ctx)\n{\n  void *cf = (void *)_Unwind_GetGR(ctx, 13);\n  lua_State *L = cframe_L(cf);\n  if ((state & _US_ACTION_MASK) == _US_VIRTUAL_UNWIND_FRAME) {\n    setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP));\n    return _URC_HANDLER_FOUND;\n  }\n  if ((state&(_US_ACTION_MASK|_US_FORCE_UNWIND)) == _US_UNWIND_FRAME_STARTING) {\n    _Unwind_DeleteException(ucb);\n    _Unwind_SetGR(ctx, 15, (uint32_t)(void *)lj_err_throw);\n    _Unwind_SetGR(ctx, 0, (uint32_t)L);\n    _Unwind_SetGR(ctx, 1, (uint32_t)LUA_ERRRUN);\n    return _URC_INSTALL_CONTEXT;\n  }\n  if (__gnu_unwind_frame(ucb, ctx) != _URC_OK)\n    return _URC_FAILURE;\n  return _URC_CONTINUE_UNWIND;\n}\n\n#endif\n\n#elif LJ_TARGET_X64 && LJ_TARGET_WINDOWS\n\n/*\n** Someone in Redmond owes me several days of my life. A lot of this is\n** undocumented or just plain wrong on MSDN. Some of it can be gathered\n** from 3rd party docs or must be found by trial-and-error. They really\n** don't want you to write your own language-specific exception handler\n** or to interact gracefully with MSVC. :-(\n**\n** Apparently MSVC doesn't call C++ destructors for foreign exceptions\n** unless you compile your C++ code with /EHa. Unfortunately this means\n** catch (...) also catches things like access violations. The use of\n** _set_se_translator doesn't really help, because it requires /EHa, too.\n*/\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n/* Taken from: http://www.nynaeve.net/?p=99 */\ntypedef struct UndocumentedDispatcherContext {\n  ULONG64 ControlPc;\n  ULONG64 ImageBase;\n  PRUNTIME_FUNCTION FunctionEntry;\n  ULONG64 EstablisherFrame;\n  ULONG64 TargetIp;\n  PCONTEXT ContextRecord;\n  PEXCEPTION_ROUTINE LanguageHandler;\n  PVOID HandlerData;\n  PUNWIND_HISTORY_TABLE HistoryTable;\n  ULONG ScopeIndex;\n  ULONG Fill0;\n} UndocumentedDispatcherContext;\n\n#ifdef _MSC_VER\n/* Another wild guess. */\nextern __DestructExceptionObject(EXCEPTION_RECORD *rec, int nothrow);\n#endif\n\n#define LJ_MSVC_EXCODE\t\t((DWORD)0xe06d7363)\n\n#define LJ_EXCODE\t\t((DWORD)0xe24c4a00)\n#define LJ_EXCODE_MAKE(c)\t(LJ_EXCODE | (DWORD)(c))\n#define LJ_EXCODE_CHECK(cl)\t(((cl) ^ LJ_EXCODE) <= 0xff)\n#define LJ_EXCODE_ERRCODE(cl)\t((int)((cl) & 0xff))\n\n/* Win64 exception handler for interpreter frame. */\nLJ_FUNCA EXCEPTION_DISPOSITION lj_err_unwind_win64(EXCEPTION_RECORD *rec,\n  void *cf, CONTEXT *ctx, UndocumentedDispatcherContext *dispatch)\n{\n  lua_State *L = cframe_L(cf);\n  int errcode = LJ_EXCODE_CHECK(rec->ExceptionCode) ?\n\t\tLJ_EXCODE_ERRCODE(rec->ExceptionCode) : LUA_ERRRUN;\n  if ((rec->ExceptionFlags & 6)) {  /* EH_UNWINDING|EH_EXIT_UNWIND */\n    /* Unwind internal frames. */\n    err_unwind(L, cf, errcode);\n  } else {\n    void *cf2 = err_unwind(L, cf, 0);\n    if (cf2) {  /* We catch it, so start unwinding the upper frames. */\n      if (rec->ExceptionCode == LJ_MSVC_EXCODE) {\n#ifdef _MSC_VER\n\t__DestructExceptionObject(rec, 1);\n#endif\n\tsetstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRCPP));\n      } else if (!LJ_EXCODE_CHECK(rec->ExceptionCode)) {\n\t/* Don't catch access violations etc. */\n\treturn ExceptionContinueSearch;\n      }\n      /* Unwind the stack and call all handlers for all lower C frames\n      ** (including ourselves) again with EH_UNWINDING set. Then set\n      ** rsp = cf, rax = errcode and jump to the specified target.\n      */\n      RtlUnwindEx(cf, (void *)((cframe_unwind_ff(cf2) && errcode != LUA_YIELD) ?\n\t\t\t       lj_vm_unwind_ff_eh :\n\t\t\t       lj_vm_unwind_c_eh),\n\t\t  rec, (void *)errcode, ctx, dispatch->HistoryTable);\n      /* RtlUnwindEx should never return. */\n    }\n  }\n  return ExceptionContinueSearch;\n}\n\n/* Raise Windows exception. */\nstatic void err_raise_ext(int errcode)\n{\n  RaiseException(LJ_EXCODE_MAKE(errcode), 1 /* EH_NONCONTINUABLE */, 0, NULL);\n}\n\n#endif\n\n/* -- Error handling ------------------------------------------------------ */\n\n/* Throw error. Find catch frame, unwind stack and continue. */\nLJ_NOINLINE void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode)\n{\n  global_State *g = G(L);\n  lj_trace_abort(g);\n  setgcrefnull(g->jit_L);\n  L->status = 0;\n#if LJ_UNWIND_EXT\n  err_raise_ext(errcode);\n  /*\n  ** A return from this function signals a corrupt C stack that cannot be\n  ** unwound. We have no choice but to call the panic function and exit.\n  **\n  ** Usually this is caused by a C function without unwind information.\n  ** This should never happen on x64, but may happen if you've manually\n  ** enabled LUAJIT_UNWIND_EXTERNAL and forgot to recompile *every*\n  ** non-C++ file with -funwind-tables.\n  */\n  if (G(L)->panic)\n    G(L)->panic(L);\n#else\n  {\n    void *cf = err_unwind(L, NULL, errcode);\n    if (cframe_unwind_ff(cf))\n      lj_vm_unwind_ff(cframe_raw(cf));\n    else\n      lj_vm_unwind_c(cframe_raw(cf), errcode);\n  }\n#endif\n  exit(EXIT_FAILURE);\n}\n\n/* Return string object for error message. */\nLJ_NOINLINE GCstr *lj_err_str(lua_State *L, ErrMsg em)\n{\n  return lj_str_newz(L, err2msg(em));\n}\n\n/* Out-of-memory error. */\nLJ_NOINLINE void lj_err_mem(lua_State *L)\n{\n  if (L->status == LUA_ERRERR+1)  /* Don't touch the stack during lua_open. */\n    lj_vm_unwind_c(L->cframe, LUA_ERRMEM);\n  setstrV(L, L->top++, lj_err_str(L, LJ_ERR_ERRMEM));\n  lj_err_throw(L, LUA_ERRMEM);\n}\n\n/* Find error function for runtime errors. Requires an extra stack traversal. */\nstatic ptrdiff_t finderrfunc(lua_State *L)\n{\n  cTValue *frame = L->base-1, *bot = tvref(L->stack);\n  void *cf = L->cframe;\n  while (frame > bot) {\n    lua_assert(cf != NULL);\n    while (cframe_nres(cframe_raw(cf)) < 0) {  /* cframe without frame? */\n      if (frame >= restorestack(L, -cframe_nres(cf)))\n\tbreak;\n      if (cframe_errfunc(cf) >= 0)  /* Error handler not inherited (-1)? */\n\treturn cframe_errfunc(cf);\n      cf = cframe_prev(cf);  /* Else unwind cframe and continue searching. */\n      if (cf == NULL)\n\treturn 0;\n    }\n    switch (frame_typep(frame)) {\n    case FRAME_LUA:\n    case FRAME_LUAP:\n      frame = frame_prevl(frame);\n      break;\n    case FRAME_C:\n      cf = cframe_prev(cf);\n      /* fallthrough */\n    case FRAME_CONT:\n#if LJ_HASFFI\n      if ((frame-1)->u32.lo == LJ_CONT_FFI_CALLBACK)\n\tcf = cframe_prev(cf);\n#endif\n    case FRAME_VARG:\n      frame = frame_prevd(frame);\n      break;\n    case FRAME_CP:\n      if (cframe_canyield(cf)) return 0;\n      if (cframe_errfunc(cf) >= 0)\n\treturn cframe_errfunc(cf);\n      frame = frame_prevd(frame);\n      break;\n    case FRAME_PCALL:\n    case FRAME_PCALLH:\n      if (frame_ftsz(frame) >= (ptrdiff_t)(2*sizeof(TValue)))  /* xpcall? */\n\treturn savestack(L, frame-1);  /* Point to xpcall's errorfunc. */\n      return 0;\n    default:\n      lua_assert(0);\n      return 0;\n    }\n  }\n  return 0;\n}\n\n/* Runtime error. */\nLJ_NOINLINE void lj_err_run(lua_State *L)\n{\n  ptrdiff_t ef = finderrfunc(L);\n  if (ef) {\n    TValue *errfunc = restorestack(L, ef);\n    TValue *top = L->top;\n    lj_trace_abort(G(L));\n    if (!tvisfunc(errfunc) || L->status == LUA_ERRERR) {\n      setstrV(L, top-1, lj_err_str(L, LJ_ERR_ERRERR));\n      lj_err_throw(L, LUA_ERRERR);\n    }\n    L->status = LUA_ERRERR;\n    copyTV(L, top, top-1);\n    copyTV(L, top-1, errfunc);\n    L->top = top+1;\n    lj_vm_call(L, top, 1+1);  /* Stack: |errfunc|msg| -> |msg| */\n  }\n  lj_err_throw(L, LUA_ERRRUN);\n}\n\n/* Formatted runtime error message. */\nLJ_NORET LJ_NOINLINE static void err_msgv(lua_State *L, ErrMsg em, ...)\n{\n  const char *msg;\n  va_list argp;\n  va_start(argp, em);\n  if (curr_funcisL(L)) L->top = curr_topL(L);\n  msg = lj_str_pushvf(L, err2msg(em), argp);\n  va_end(argp);\n  lj_debug_addloc(L, msg, L->base-1, NULL);\n  lj_err_run(L);\n}\n\n/* Non-vararg variant for better calling conventions. */\nLJ_NOINLINE void lj_err_msg(lua_State *L, ErrMsg em)\n{\n  err_msgv(L, em);\n}\n\n/* Lexer error. */\nLJ_NOINLINE void lj_err_lex(lua_State *L, GCstr *src, const char *tok,\n\t\t\t    BCLine line, ErrMsg em, va_list argp)\n{\n  char buff[LUA_IDSIZE];\n  const char *msg;\n  lj_debug_shortname(buff, src);\n  msg = lj_str_pushvf(L, err2msg(em), argp);\n  msg = lj_str_pushf(L, \"%s:%d: %s\", buff, line, msg);\n  if (tok)\n    lj_str_pushf(L, err2msg(LJ_ERR_XNEAR), msg, tok);\n  lj_err_throw(L, LUA_ERRSYNTAX);\n}\n\n/* Typecheck error for operands. */\nLJ_NOINLINE void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm)\n{\n  const char *tname = lj_typename(o);\n  const char *opname = err2msg(opm);\n  if (curr_funcisL(L)) {\n    GCproto *pt = curr_proto(L);\n    const BCIns *pc = cframe_Lpc(L) - 1;\n    const char *oname = NULL;\n    const char *kind = lj_debug_slotname(pt, pc, (BCReg)(o-L->base), &oname);\n    if (kind)\n      err_msgv(L, LJ_ERR_BADOPRT, opname, kind, oname, tname);\n  }\n  err_msgv(L, LJ_ERR_BADOPRV, opname, tname);\n}\n\n/* Typecheck error for ordered comparisons. */\nLJ_NOINLINE void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2)\n{\n  const char *t1 = lj_typename(o1);\n  const char *t2 = lj_typename(o2);\n  err_msgv(L, t1 == t2 ? LJ_ERR_BADCMPV : LJ_ERR_BADCMPT, t1, t2);\n  /* This assumes the two \"boolean\" entries are commoned by the C compiler. */\n}\n\n/* Typecheck error for __call. */\nLJ_NOINLINE void lj_err_optype_call(lua_State *L, TValue *o)\n{\n  /* Gross hack if lua_[p]call or pcall/xpcall fail for a non-callable object:\n  ** L->base still points to the caller. So add a dummy frame with L instead\n  ** of a function. See lua_getstack().\n  */\n  const BCIns *pc = cframe_Lpc(L);\n  if (((ptrdiff_t)pc & FRAME_TYPE) != FRAME_LUA) {\n    const char *tname = lj_typename(o);\n    setframe_pc(o, pc);\n    setframe_gc(o, obj2gco(L));\n    L->top = L->base = o+1;\n    err_msgv(L, LJ_ERR_BADCALL, tname);\n  }\n  lj_err_optype(L, o, LJ_ERR_OPCALL);\n}\n\n/* Error in context of caller. */\nLJ_NOINLINE void lj_err_callermsg(lua_State *L, const char *msg)\n{\n  TValue *frame = L->base-1;\n  TValue *pframe = NULL;\n  if (frame_islua(frame)) {\n    pframe = frame_prevl(frame);\n  } else if (frame_iscont(frame)) {\n#if LJ_HASFFI\n    if ((frame-1)->u32.lo == LJ_CONT_FFI_CALLBACK) {\n      pframe = frame;\n      frame = NULL;\n    } else\n#endif\n    {\n      pframe = frame_prevd(frame);\n#if LJ_HASFFI\n      /* Remove frame for FFI metamethods. */\n      if (frame_func(frame)->c.ffid >= FF_ffi_meta___index &&\n\t  frame_func(frame)->c.ffid <= FF_ffi_meta___tostring) {\n\tL->base = pframe+1;\n\tL->top = frame;\n\tsetcframe_pc(cframe_raw(L->cframe), frame_contpc(frame));\n      }\n#endif\n    }\n  }\n  lj_debug_addloc(L, msg, pframe, frame);\n  lj_err_run(L);\n}\n\n/* Formatted error in context of caller. */\nLJ_NOINLINE void lj_err_callerv(lua_State *L, ErrMsg em, ...)\n{\n  const char *msg;\n  va_list argp;\n  va_start(argp, em);\n  msg = lj_str_pushvf(L, err2msg(em), argp);\n  va_end(argp);\n  lj_err_callermsg(L, msg);\n}\n\n/* Error in context of caller. */\nLJ_NOINLINE void lj_err_caller(lua_State *L, ErrMsg em)\n{\n  lj_err_callermsg(L, err2msg(em));\n}\n\n/* Argument error message. */\nLJ_NORET LJ_NOINLINE static void err_argmsg(lua_State *L, int narg,\n\t\t\t\t\t    const char *msg)\n{\n  const char *fname = \"?\";\n  const char *ftype = lj_debug_funcname(L, L->base - 1, &fname);\n  if (narg < 0 && narg > LUA_REGISTRYINDEX)\n    narg = (int)(L->top - L->base) + narg + 1;\n  if (ftype && ftype[3] == 'h' && --narg == 0)  /* Check for \"method\". */\n    msg = lj_str_pushf(L, err2msg(LJ_ERR_BADSELF), fname, msg);\n  else\n    msg = lj_str_pushf(L, err2msg(LJ_ERR_BADARG), narg, fname, msg);\n  lj_err_callermsg(L, msg);\n}\n\n/* Formatted argument error. */\nLJ_NOINLINE void lj_err_argv(lua_State *L, int narg, ErrMsg em, ...)\n{\n  const char *msg;\n  va_list argp;\n  va_start(argp, em);\n  msg = lj_str_pushvf(L, err2msg(em), argp);\n  va_end(argp);\n  err_argmsg(L, narg, msg);\n}\n\n/* Argument error. */\nLJ_NOINLINE void lj_err_arg(lua_State *L, int narg, ErrMsg em)\n{\n  err_argmsg(L, narg, err2msg(em));\n}\n\n/* Typecheck error for arguments. */\nLJ_NOINLINE void lj_err_argtype(lua_State *L, int narg, const char *xname)\n{\n  TValue *o = narg < 0 ? L->top + narg : L->base + narg-1;\n  const char *tname = o < L->top ? lj_typename(o) : lj_obj_typename[0];\n  const char *msg = lj_str_pushf(L, err2msg(LJ_ERR_BADTYPE), xname, tname);\n  err_argmsg(L, narg, msg);\n}\n\n/* Typecheck error for arguments. */\nLJ_NOINLINE void lj_err_argt(lua_State *L, int narg, int tt)\n{\n  lj_err_argtype(L, narg, lj_obj_typename[tt+1]);\n}\n\n/* -- Public error handling API ------------------------------------------- */\n\nLUA_API lua_CFunction lua_atpanic(lua_State *L, lua_CFunction panicf)\n{\n  lua_CFunction old = G(L)->panic;\n  G(L)->panic = panicf;\n  return old;\n}\n\n/* Forwarders for the public API (C calling convention and no LJ_NORET). */\nLUA_API int lua_error(lua_State *L)\n{\n  lj_err_run(L);\n  return 0;  /* unreachable */\n}\n\nLUALIB_API int luaL_argerror(lua_State *L, int narg, const char *msg)\n{\n  err_argmsg(L, narg, msg);\n  return 0;  /* unreachable */\n}\n\nLUALIB_API int luaL_typerror(lua_State *L, int narg, const char *xname)\n{\n  lj_err_argtype(L, narg, xname);\n  return 0;  /* unreachable */\n}\n\nLUALIB_API void luaL_where(lua_State *L, int level)\n{\n  int size;\n  cTValue *frame = lj_debug_frame(L, level, &size);\n  lj_debug_addloc(L, \"\", frame, size ? frame+size : NULL);\n}\n\nLUALIB_API int luaL_error(lua_State *L, const char *fmt, ...)\n{\n  const char *msg;\n  va_list argp;\n  va_start(argp, fmt);\n  msg = lj_str_pushvf(L, fmt, argp);\n  va_end(argp);\n  lj_err_callermsg(L, msg);\n  return 0;  /* unreachable */\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_err.h",
    "content": "/*\n** Error handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_ERR_H\n#define _LJ_ERR_H\n\n#include <stdarg.h>\n\n#include \"lj_obj.h\"\n\ntypedef enum {\n#define ERRDEF(name, msg) \\\n  LJ_ERR_##name, LJ_ERR_##name##_ = LJ_ERR_##name + sizeof(msg)-1,\n#include \"lj_errmsg.h\"\n  LJ_ERR__MAX\n} ErrMsg;\n\nLJ_DATA const char *lj_err_allmsg;\n#define err2msg(em)\t(lj_err_allmsg+(int)(em))\n\nLJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em);\nLJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode);\nLJ_FUNC_NORET void lj_err_mem(lua_State *L);\nLJ_FUNC_NORET void lj_err_run(lua_State *L);\nLJ_FUNC_NORET void lj_err_msg(lua_State *L, ErrMsg em);\nLJ_FUNC_NORET void lj_err_lex(lua_State *L, GCstr *src, const char *tok,\n\t\t\t      BCLine line, ErrMsg em, va_list argp);\nLJ_FUNC_NORET void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm);\nLJ_FUNC_NORET void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2);\nLJ_FUNC_NORET void lj_err_optype_call(lua_State *L, TValue *o);\nLJ_FUNC_NORET void lj_err_callermsg(lua_State *L, const char *msg);\nLJ_FUNC_NORET void lj_err_callerv(lua_State *L, ErrMsg em, ...);\nLJ_FUNC_NORET void lj_err_caller(lua_State *L, ErrMsg em);\nLJ_FUNC_NORET void lj_err_arg(lua_State *L, int narg, ErrMsg em);\nLJ_FUNC_NORET void lj_err_argv(lua_State *L, int narg, ErrMsg em, ...);\nLJ_FUNC_NORET void lj_err_argtype(lua_State *L, int narg, const char *xname);\nLJ_FUNC_NORET void lj_err_argt(lua_State *L, int narg, int tt);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_errmsg.h",
    "content": "/*\n** VM error messages.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* This file may be included multiple times with different ERRDEF macros. */\n\n/* Basic error handling. */\nERRDEF(ERRMEM,\t\"not enough memory\")\nERRDEF(ERRERR,\t\"error in error handling\")\nERRDEF(ERRCPP,\t\"C++ exception\")\n\n/* Allocations. */\nERRDEF(STROV,\t\"string length overflow\")\nERRDEF(UDATAOV,\t\"userdata length overflow\")\nERRDEF(STKOV,\t\"stack overflow\")\nERRDEF(STKOVM,\t\"stack overflow (%s)\")\nERRDEF(TABOV,\t\"table overflow\")\n\n/* Table indexing. */\nERRDEF(NANIDX,\t\"table index is NaN\")\nERRDEF(NILIDX,\t\"table index is nil\")\nERRDEF(NEXTIDX,\t\"invalid key to \" LUA_QL(\"next\"))\n\n/* Metamethod resolving. */\nERRDEF(BADCALL,\t\"attempt to call a %s value\")\nERRDEF(BADOPRT,\t\"attempt to %s %s \" LUA_QS \" (a %s value)\")\nERRDEF(BADOPRV,\t\"attempt to %s a %s value\")\nERRDEF(BADCMPT,\t\"attempt to compare %s with %s\")\nERRDEF(BADCMPV,\t\"attempt to compare two %s values\")\nERRDEF(GETLOOP,\t\"loop in gettable\")\nERRDEF(SETLOOP,\t\"loop in settable\")\nERRDEF(OPCALL,\t\"call\")\nERRDEF(OPINDEX,\t\"index\")\nERRDEF(OPARITH,\t\"perform arithmetic on\")\nERRDEF(OPCAT,\t\"concatenate\")\nERRDEF(OPLEN,\t\"get length of\")\n\n/* Type checks. */\nERRDEF(BADSELF,\t\"calling \" LUA_QS \" on bad self (%s)\")\nERRDEF(BADARG,\t\"bad argument #%d to \" LUA_QS \" (%s)\")\nERRDEF(BADTYPE,\t\"%s expected, got %s\")\nERRDEF(BADVAL,\t\"invalid value\")\nERRDEF(NOVAL,\t\"value expected\")\nERRDEF(NOCORO,\t\"coroutine expected\")\nERRDEF(NOTABN,\t\"nil or table expected\")\nERRDEF(NOLFUNC,\t\"Lua function expected\")\nERRDEF(NOFUNCL,\t\"function or level expected\")\nERRDEF(NOSFT,\t\"string/function/table expected\")\nERRDEF(NOPROXY,\t\"boolean or proxy expected\")\nERRDEF(FORINIT,\tLUA_QL(\"for\") \" initial value must be a number\")\nERRDEF(FORLIM,\tLUA_QL(\"for\") \" limit must be a number\")\nERRDEF(FORSTEP,\tLUA_QL(\"for\") \" step must be a number\")\n\n/* C API checks. */\nERRDEF(NOENV,\t\"no calling environment\")\nERRDEF(CYIELD,\t\"attempt to yield across C-call boundary\")\nERRDEF(BADLU,\t\"bad light userdata pointer\")\nERRDEF(NOGCMM,\t\"bad action while in __gc metamethod\")\n#if LJ_TARGET_WINDOWS\nERRDEF(BADFPU,\t\"bad FPU precision (use D3DCREATE_FPU_PRESERVE with DirectX)\")\n#endif\n\n/* Standard library function errors. */\nERRDEF(ASSERT,\t\"assertion failed!\")\nERRDEF(PROTMT,\t\"cannot change a protected metatable\")\nERRDEF(UNPACK,\t\"too many results to unpack\")\nERRDEF(RDRSTR,\t\"reader function must return a string\")\nERRDEF(PRTOSTR,\tLUA_QL(\"tostring\") \" must return a string to \" LUA_QL(\"print\"))\nERRDEF(IDXRNG,\t\"index out of range\")\nERRDEF(BASERNG,\t\"base out of range\")\nERRDEF(LVLRNG,\t\"level out of range\")\nERRDEF(INVLVL,\t\"invalid level\")\nERRDEF(INVOPT,\t\"invalid option\")\nERRDEF(INVOPTM,\t\"invalid option \" LUA_QS)\nERRDEF(INVFMT,\t\"invalid format\")\nERRDEF(SETFENV,\tLUA_QL(\"setfenv\") \" cannot change environment of given object\")\nERRDEF(CORUN,\t\"cannot resume running coroutine\")\nERRDEF(CODEAD,\t\"cannot resume dead coroutine\")\nERRDEF(COSUSP,\t\"cannot resume non-suspended coroutine\")\nERRDEF(TABINS,\t\"wrong number of arguments to \" LUA_QL(\"insert\"))\nERRDEF(TABCAT,\t\"invalid value (%s) at index %d in table for \" LUA_QL(\"concat\"))\nERRDEF(TABSORT,\t\"invalid order function for sorting\")\nERRDEF(IOCLFL,\t\"attempt to use a closed file\")\nERRDEF(IOSTDCL,\t\"standard file is closed\")\nERRDEF(OSUNIQF,\t\"unable to generate a unique filename\")\nERRDEF(OSDATEF,\t\"field \" LUA_QS \" missing in date table\")\nERRDEF(STRDUMP,\t\"unable to dump given function\")\nERRDEF(STRSLC,\t\"string slice too long\")\nERRDEF(STRPATB,\t\"missing \" LUA_QL(\"[\") \" after \" LUA_QL(\"%f\") \" in pattern\")\nERRDEF(STRPATC,\t\"invalid pattern capture\")\nERRDEF(STRPATE,\t\"malformed pattern (ends with \" LUA_QL(\"%\") \")\")\nERRDEF(STRPATM,\t\"malformed pattern (missing \" LUA_QL(\"]\") \")\")\nERRDEF(STRPATU,\t\"unbalanced pattern\")\nERRDEF(STRPATX,\t\"pattern too complex\")\nERRDEF(STRCAPI,\t\"invalid capture index\")\nERRDEF(STRCAPN,\t\"too many captures\")\nERRDEF(STRCAPU,\t\"unfinished capture\")\nERRDEF(STRFMTO,\t\"invalid option \" LUA_QL(\"%%%c\") \" to \" LUA_QL(\"format\"))\nERRDEF(STRFMTR,\t\"invalid format (repeated flags)\")\nERRDEF(STRFMTW,\t\"invalid format (width or precision too long)\")\nERRDEF(STRGSRV,\t\"invalid replacement value (a %s)\")\nERRDEF(BADMODN,\t\"name conflict for module \" LUA_QS)\n#if LJ_HASJIT\n#if LJ_TARGET_X86ORX64\nERRDEF(NOJIT,\t\"JIT compiler disabled, CPU does not support SSE2\")\n#else\nERRDEF(NOJIT,\t\"JIT compiler disabled\")\n#endif\n#elif defined(LJ_ARCH_NOJIT)\nERRDEF(NOJIT,\t\"no JIT compiler for this architecture (yet)\")\n#else\nERRDEF(NOJIT,\t\"JIT compiler permanently disabled by build option\")\n#endif\nERRDEF(JITOPT,\t\"unknown or malformed optimization flag \" LUA_QS)\n\n/* Lexer/parser errors. */\nERRDEF(XMODE,\t\"attempt to load chunk with wrong mode\")\nERRDEF(XNEAR,\t\"%s near \" LUA_QS)\nERRDEF(XELEM,\t\"lexical element too long\")\nERRDEF(XLINES,\t\"chunk has too many lines\")\nERRDEF(XLEVELS,\t\"chunk has too many syntax levels\")\nERRDEF(XNUMBER,\t\"malformed number\")\nERRDEF(XLSTR,\t\"unfinished long string\")\nERRDEF(XLCOM,\t\"unfinished long comment\")\nERRDEF(XSTR,\t\"unfinished string\")\nERRDEF(XESC,\t\"invalid escape sequence\")\nERRDEF(XLDELIM,\t\"invalid long string delimiter\")\nERRDEF(XTOKEN,\tLUA_QS \" expected\")\nERRDEF(XJUMP,\t\"control structure too long\")\nERRDEF(XSLOTS,\t\"function or expression too complex\")\nERRDEF(XLIMC,\t\"chunk has more than %d local variables\")\nERRDEF(XLIMM,\t\"main function has more than %d %s\")\nERRDEF(XLIMF,\t\"function at line %d has more than %d %s\")\nERRDEF(XMATCH,\tLUA_QS \" expected (to close \" LUA_QS \" at line %d)\")\nERRDEF(XFIXUP,\t\"function too long for return fixup\")\nERRDEF(XPARAM,\t\"<name> or \" LUA_QL(\"...\") \" expected\")\n#if !LJ_52\nERRDEF(XAMBIG,\t\"ambiguous syntax (function call x new statement)\")\n#endif\nERRDEF(XFUNARG,\t\"function arguments expected\")\nERRDEF(XSYMBOL,\t\"unexpected symbol\")\nERRDEF(XDOTS,\t\"cannot use \" LUA_QL(\"...\") \" outside a vararg function\")\nERRDEF(XSYNTAX,\t\"syntax error\")\nERRDEF(XFOR,\tLUA_QL(\"=\") \" or \" LUA_QL(\"in\") \" expected\")\nERRDEF(XBREAK,\t\"no loop to break\")\nERRDEF(XLUNDEF,\t\"undefined label \" LUA_QS)\nERRDEF(XLDUP,\t\"duplicate label \" LUA_QS)\nERRDEF(XGSCOPE,\t\"<goto %s> jumps into the scope of local \" LUA_QS)\n\n/* Bytecode reader errors. */\nERRDEF(BCFMT,\t\"cannot load incompatible bytecode\")\nERRDEF(BCBAD,\t\"cannot load malformed bytecode\")\n\n#if LJ_HASFFI\n/* FFI errors. */\nERRDEF(FFI_INVTYPE,\t\"invalid C type\")\nERRDEF(FFI_INVSIZE,\t\"size of C type is unknown or too large\")\nERRDEF(FFI_BADSCL,\t\"bad storage class\")\nERRDEF(FFI_DECLSPEC,\t\"declaration specifier expected\")\nERRDEF(FFI_BADTAG,\t\"undeclared or implicit tag \" LUA_QS)\nERRDEF(FFI_REDEF,\t\"attempt to redefine \" LUA_QS)\nERRDEF(FFI_NUMPARAM,\t\"wrong number of type parameters\")\nERRDEF(FFI_INITOV,\t\"too many initializers for \" LUA_QS)\nERRDEF(FFI_BADCONV,\t\"cannot convert \" LUA_QS \" to \" LUA_QS)\nERRDEF(FFI_BADLEN,\t\"attempt to get length of \" LUA_QS)\nERRDEF(FFI_BADCONCAT,\t\"attempt to concatenate \" LUA_QS \" and \" LUA_QS)\nERRDEF(FFI_BADARITH,\t\"attempt to perform arithmetic on \" LUA_QS \" and \" LUA_QS)\nERRDEF(FFI_BADCOMP,\t\"attempt to compare \" LUA_QS \" with \" LUA_QS)\nERRDEF(FFI_BADCALL,\tLUA_QS \" is not callable\")\nERRDEF(FFI_NUMARG,\t\"wrong number of arguments for function call\")\nERRDEF(FFI_BADMEMBER,\tLUA_QS \" has no member named \" LUA_QS)\nERRDEF(FFI_BADIDX,\tLUA_QS \" cannot be indexed\")\nERRDEF(FFI_BADIDXW,\tLUA_QS \" cannot be indexed with \" LUA_QS)\nERRDEF(FFI_BADMM,\tLUA_QS \" has no \" LUA_QS \" metamethod\")\nERRDEF(FFI_WRCONST,\t\"attempt to write to constant location\")\nERRDEF(FFI_NODECL,\t\"missing declaration for symbol \" LUA_QS)\nERRDEF(FFI_BADCBACK,\t\"bad callback\")\n#if LJ_OS_NOJIT\nERRDEF(FFI_CBACKOV,\t\"no support for callbacks on this OS\")\n#else\nERRDEF(FFI_CBACKOV,\t\"too many callbacks\")\n#endif\nERRDEF(FFI_NYIPACKBIT,\t\"NYI: packed bit fields\")\nERRDEF(FFI_NYICALL,\t\"NYI: cannot call this C function (yet)\")\n#endif\n\n#undef ERRDEF\n\n/* Detecting unused error messages:\n   awk -F, '/^ERRDEF/ { gsub(/ERRDEF./, \"\"); printf \"grep -q LJ_ERR_%s *.[ch] || echo %s\\n\", $1, $1}' lj_errmsg.h | sh\n*/\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ff.h",
    "content": "/*\n** Fast function IDs.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_FF_H\n#define _LJ_FF_H\n\n/* Fast function ID. */\ntypedef enum {\n  FF_LUA_ = FF_LUA,\t/* Lua function (must be 0). */\n  FF_C_ = FF_C,\t\t/* Regular C function (must be 1). */\n#define FFDEF(name)\tFF_##name,\n#include \"lj_ffdef.h\"\n  FF__MAX\n} FastFunc;\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ffrecord.c",
    "content": "/*\n** Fast function call recorder.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_ffrecord_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_frame.h\"\n#include \"lj_bc.h\"\n#include \"lj_ff.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_ircall.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#include \"lj_record.h\"\n#include \"lj_ffrecord.h\"\n#include \"lj_crecord.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"lj_strscan.h\"\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t\t(&J->cur.ir[(ref)])\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n/* -- Fast function recording handlers ------------------------------------ */\n\n/* Conventions for fast function call handlers:\n**\n** The argument slots start at J->base[0]. All of them are guaranteed to be\n** valid and type-specialized references. J->base[J->maxslot] is set to 0\n** as a sentinel. The runtime argument values start at rd->argv[0].\n**\n** In general fast functions should check for presence of all of their\n** arguments and for the correct argument types. Some simplifications\n** are allowed if the interpreter throws instead. But even if recording\n** is aborted, the generated IR must be consistent (no zero-refs).\n**\n** The number of results in rd->nres is set to 1. Handlers that return\n** a different number of results need to override it. A negative value\n** prevents return processing (e.g. for pending calls).\n**\n** Results need to be stored starting at J->base[0]. Return processing\n** moves them to the right slots later.\n**\n** The per-ffid auxiliary data is the value of the 2nd part of the\n** LJLIB_REC() annotation. This allows handling similar functionality\n** in a common handler.\n*/\n\n/* Type of handler to record a fast function. */\ntypedef void (LJ_FASTCALL *RecordFunc)(jit_State *J, RecordFFData *rd);\n\n/* Get runtime value of int argument. */\nstatic int32_t argv2int(jit_State *J, TValue *o)\n{\n  if (!lj_strscan_numberobj(o))\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  return tvisint(o) ? intV(o) : lj_num2int(numV(o));\n}\n\n/* Get runtime value of string argument. */\nstatic GCstr *argv2str(jit_State *J, TValue *o)\n{\n  if (LJ_LIKELY(tvisstr(o))) {\n    return strV(o);\n  } else {\n    GCstr *s;\n    if (!tvisnumber(o))\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n    if (tvisint(o))\n      s = lj_str_fromint(J->L, intV(o));\n    else\n      s = lj_str_fromnum(J->L, &o->n);\n    setstrV(J->L, o, s);\n    return s;\n  }\n}\n\n/* Return number of results wanted by caller. */\nstatic ptrdiff_t results_wanted(jit_State *J)\n{\n  TValue *frame = J->L->base-1;\n  if (frame_islua(frame))\n    return (ptrdiff_t)bc_b(frame_pc(frame)[-1]) - 1;\n  else\n    return -1;\n}\n\n/* Throw error for unsupported variant of fast function. */\nLJ_NORET static void recff_nyiu(jit_State *J)\n{\n  setfuncV(J->L, &J->errinfo, J->fn);\n  lj_trace_err_info(J, LJ_TRERR_NYIFFU);\n}\n\n/* Fallback handler for all fast functions that are not recorded (yet). */\nstatic void LJ_FASTCALL recff_nyi(jit_State *J, RecordFFData *rd)\n{\n  setfuncV(J->L, &J->errinfo, J->fn);\n  lj_trace_err_info(J, LJ_TRERR_NYIFF);\n  UNUSED(rd);\n}\n\n/* C functions can have arbitrary side-effects and are not recorded (yet). */\nstatic void LJ_FASTCALL recff_c(jit_State *J, RecordFFData *rd)\n{\n  setfuncV(J->L, &J->errinfo, J->fn);\n  lj_trace_err_info(J, LJ_TRERR_NYICF);\n  UNUSED(rd);\n}\n\n/* -- Base library fast functions ----------------------------------------- */\n\nstatic void LJ_FASTCALL recff_assert(jit_State *J, RecordFFData *rd)\n{\n  /* Arguments already specialized. The interpreter throws for nil/false. */\n  rd->nres = J->maxslot;  /* Pass through all arguments. */\n}\n\nstatic void LJ_FASTCALL recff_type(jit_State *J, RecordFFData *rd)\n{\n  /* Arguments already specialized. Result is a constant string. Neat, huh? */\n  uint32_t t;\n  if (tvisnumber(&rd->argv[0]))\n    t = ~LJ_TNUMX;\n  else if (LJ_64 && tvislightud(&rd->argv[0]))\n    t = ~LJ_TLIGHTUD;\n  else\n    t = ~itype(&rd->argv[0]);\n  J->base[0] = lj_ir_kstr(J, strV(&J->fn->c.upvalue[t]));\n  UNUSED(rd);\n}\n\nstatic void LJ_FASTCALL recff_getmetatable(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  if (tr) {\n    RecordIndex ix;\n    ix.tab = tr;\n    copyTV(J->L, &ix.tabv, &rd->argv[0]);\n    if (lj_record_mm_lookup(J, &ix, MM_metatable))\n      J->base[0] = ix.mobj;\n    else\n      J->base[0] = ix.mt;\n  }  /* else: Interpreter will throw. */\n}\n\nstatic void LJ_FASTCALL recff_setmetatable(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  TRef mt = J->base[1];\n  if (tref_istab(tr) && (tref_istab(mt) || (mt && tref_isnil(mt)))) {\n    TRef fref, mtref;\n    RecordIndex ix;\n    ix.tab = tr;\n    copyTV(J->L, &ix.tabv, &rd->argv[0]);\n    lj_record_mm_lookup(J, &ix, MM_metatable); /* Guard for no __metatable. */\n    fref = emitir(IRT(IR_FREF, IRT_P32), tr, IRFL_TAB_META);\n    mtref = tref_isnil(mt) ? lj_ir_knull(J, IRT_TAB) : mt;\n    emitir(IRT(IR_FSTORE, IRT_TAB), fref, mtref);\n    if (!tref_isnil(mt))\n      emitir(IRT(IR_TBAR, IRT_TAB), tr, 0);\n    J->base[0] = tr;\n    J->needsnap = 1;\n  }  /* else: Interpreter will throw. */\n}\n\nstatic void LJ_FASTCALL recff_rawget(jit_State *J, RecordFFData *rd)\n{\n  RecordIndex ix;\n  ix.tab = J->base[0]; ix.key = J->base[1];\n  if (tref_istab(ix.tab) && ix.key) {\n    ix.val = 0; ix.idxchain = 0;\n    settabV(J->L, &ix.tabv, tabV(&rd->argv[0]));\n    copyTV(J->L, &ix.keyv, &rd->argv[1]);\n    J->base[0] = lj_record_idx(J, &ix);\n  }  /* else: Interpreter will throw. */\n}\n\nstatic void LJ_FASTCALL recff_rawset(jit_State *J, RecordFFData *rd)\n{\n  RecordIndex ix;\n  ix.tab = J->base[0]; ix.key = J->base[1]; ix.val = J->base[2];\n  if (tref_istab(ix.tab) && ix.key && ix.val) {\n    ix.idxchain = 0;\n    settabV(J->L, &ix.tabv, tabV(&rd->argv[0]));\n    copyTV(J->L, &ix.keyv, &rd->argv[1]);\n    copyTV(J->L, &ix.valv, &rd->argv[2]);\n    lj_record_idx(J, &ix);\n    /* Pass through table at J->base[0] as result. */\n  }  /* else: Interpreter will throw. */\n}\n\nstatic void LJ_FASTCALL recff_rawequal(jit_State *J, RecordFFData *rd)\n{\n  TRef tra = J->base[0];\n  TRef trb = J->base[1];\n  if (tra && trb) {\n    int diff = lj_record_objcmp(J, tra, trb, &rd->argv[0], &rd->argv[1]);\n    J->base[0] = diff ? TREF_FALSE : TREF_TRUE;\n  }  /* else: Interpreter will throw. */\n}\n\n#if LJ_52\nstatic void LJ_FASTCALL recff_rawlen(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  if (tref_isstr(tr))\n    J->base[0] = emitir(IRTI(IR_FLOAD), tr, IRFL_STR_LEN);\n  else if (tref_istab(tr))\n    J->base[0] = lj_ir_call(J, IRCALL_lj_tab_len, tr);\n  /* else: Interpreter will throw. */\n  UNUSED(rd);\n}\n#endif\n\n/* Determine mode of select() call. */\nint32_t lj_ffrecord_select_mode(jit_State *J, TRef tr, TValue *tv)\n{\n  if (tref_isstr(tr) && *strVdata(tv) == '#') {  /* select('#', ...) */\n    if (strV(tv)->len == 1) {\n      emitir(IRTG(IR_EQ, IRT_STR), tr, lj_ir_kstr(J, strV(tv)));\n    } else {\n      TRef trptr = emitir(IRT(IR_STRREF, IRT_P32), tr, lj_ir_kint(J, 0));\n      TRef trchar = emitir(IRT(IR_XLOAD, IRT_U8), trptr, IRXLOAD_READONLY);\n      emitir(IRTG(IR_EQ, IRT_INT), trchar, lj_ir_kint(J, '#'));\n    }\n    return 0;\n  } else {  /* select(n, ...) */\n    int32_t start = argv2int(J, tv);\n    if (start == 0) lj_trace_err(J, LJ_TRERR_BADTYPE);  /* A bit misleading. */\n    return start;\n  }\n}\n\nstatic void LJ_FASTCALL recff_select(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  if (tr) {\n    ptrdiff_t start = lj_ffrecord_select_mode(J, tr, &rd->argv[0]);\n    if (start == 0) {  /* select('#', ...) */\n      J->base[0] = lj_ir_kint(J, J->maxslot - 1);\n    } else if (tref_isk(tr)) {  /* select(k, ...) */\n      ptrdiff_t n = (ptrdiff_t)J->maxslot;\n      if (start < 0) start += n;\n      else if (start > n) start = n;\n      rd->nres = n - start;\n      if (start >= 1) {\n\tptrdiff_t i;\n\tfor (i = 0; i < n - start; i++)\n\t  J->base[i] = J->base[start+i];\n      }  /* else: Interpreter will throw. */\n    } else {\n      recff_nyiu(J);\n    }\n  }  /* else: Interpreter will throw. */\n}\n\nstatic void LJ_FASTCALL recff_tonumber(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  TRef base = J->base[1];\n  if (tr && base) {\n    base = lj_opt_narrow_toint(J, base);\n    if (!tref_isk(base) || IR(tref_ref(base))->i != 10)\n      recff_nyiu(J);\n  }\n  if (tref_isnumber_str(tr)) {\n    if (tref_isstr(tr)) {\n      TValue tmp;\n      if (!lj_strscan_num(strV(&rd->argv[0]), &tmp))\n\trecff_nyiu(J);  /* Would need an inverted STRTO for this case. */\n      tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0);\n    }\n#if LJ_HASFFI\n  } else if (tref_iscdata(tr)) {\n    lj_crecord_tonumber(J, rd);\n    return;\n#endif\n  } else {\n    tr = TREF_NIL;\n  }\n  J->base[0] = tr;\n  UNUSED(rd);\n}\n\nstatic TValue *recff_metacall_cp(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  jit_State *J = (jit_State *)ud;\n  lj_record_tailcall(J, 0, 1);\n  UNUSED(L); UNUSED(dummy);\n  return NULL;\n}\n\nstatic int recff_metacall(jit_State *J, RecordFFData *rd, MMS mm)\n{\n  RecordIndex ix;\n  ix.tab = J->base[0];\n  copyTV(J->L, &ix.tabv, &rd->argv[0]);\n  if (lj_record_mm_lookup(J, &ix, mm)) {  /* Has metamethod? */\n    int errcode;\n    TValue argv0;\n    /* Temporarily insert metamethod below object. */\n    J->base[1] = J->base[0];\n    J->base[0] = ix.mobj;\n    copyTV(J->L, &argv0, &rd->argv[0]);\n    copyTV(J->L, &rd->argv[1], &rd->argv[0]);\n    copyTV(J->L, &rd->argv[0], &ix.mobjv);\n    /* Need to protect lj_record_tailcall because it may throw. */\n    errcode = lj_vm_cpcall(J->L, NULL, J, recff_metacall_cp);\n    /* Always undo Lua stack changes to avoid confusing the interpreter. */\n    copyTV(J->L, &rd->argv[0], &argv0);\n    if (errcode)\n      lj_err_throw(J->L, errcode);  /* Propagate errors. */\n    rd->nres = -1;  /* Pending call. */\n    return 1;  /* Tailcalled to metamethod. */\n  }\n  return 0;\n}\n\nstatic void LJ_FASTCALL recff_tostring(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  if (tref_isstr(tr)) {\n    /* Ignore __tostring in the string base metatable. */\n    /* Pass on result in J->base[0]. */\n  } else if (!recff_metacall(J, rd, MM_tostring)) {\n    if (tref_isnumber(tr)) {\n      J->base[0] = emitir(IRT(IR_TOSTR, IRT_STR), tr, 0);\n    } else if (tref_ispri(tr)) {\n      J->base[0] = lj_ir_kstr(J, strV(&J->fn->c.upvalue[tref_type(tr)]));\n    } else {\n      recff_nyiu(J);\n    }\n  }\n}\n\nstatic void LJ_FASTCALL recff_ipairs_aux(jit_State *J, RecordFFData *rd)\n{\n  RecordIndex ix;\n  ix.tab = J->base[0];\n  if (tref_istab(ix.tab)) {\n    if (!tvisnumber(&rd->argv[1]))  /* No support for string coercion. */\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n    setintV(&ix.keyv, numberVint(&rd->argv[1])+1);\n    settabV(J->L, &ix.tabv, tabV(&rd->argv[0]));\n    ix.val = 0; ix.idxchain = 0;\n    ix.key = lj_opt_narrow_toint(J, J->base[1]);\n    J->base[0] = ix.key = emitir(IRTI(IR_ADD), ix.key, lj_ir_kint(J, 1));\n    J->base[1] = lj_record_idx(J, &ix);\n    rd->nres = tref_isnil(J->base[1]) ? 0 : 2;\n  }  /* else: Interpreter will throw. */\n}\n\nstatic void LJ_FASTCALL recff_ipairs(jit_State *J, RecordFFData *rd)\n{\n  if (!(LJ_52 && recff_metacall(J, rd, MM_ipairs))) {\n    TRef tab = J->base[0];\n    if (tref_istab(tab)) {\n      J->base[0] = lj_ir_kfunc(J, funcV(&J->fn->c.upvalue[0]));\n      J->base[1] = tab;\n      J->base[2] = lj_ir_kint(J, 0);\n      rd->nres = 3;\n    }  /* else: Interpreter will throw. */\n  }\n}\n\nstatic void LJ_FASTCALL recff_pcall(jit_State *J, RecordFFData *rd)\n{\n  if (J->maxslot >= 1) {\n    lj_record_call(J, 0, J->maxslot - 1);\n    rd->nres = -1;  /* Pending call. */\n  }  /* else: Interpreter will throw. */\n}\n\nstatic TValue *recff_xpcall_cp(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  jit_State *J = (jit_State *)ud;\n  lj_record_call(J, 1, J->maxslot - 2);\n  UNUSED(L); UNUSED(dummy);\n  return NULL;\n}\n\nstatic void LJ_FASTCALL recff_xpcall(jit_State *J, RecordFFData *rd)\n{\n  if (J->maxslot >= 2) {\n    TValue argv0, argv1;\n    TRef tmp;\n    int errcode;\n    /* Swap function and traceback. */\n    tmp = J->base[0]; J->base[0] = J->base[1]; J->base[1] = tmp;\n    copyTV(J->L, &argv0, &rd->argv[0]);\n    copyTV(J->L, &argv1, &rd->argv[1]);\n    copyTV(J->L, &rd->argv[0], &argv1);\n    copyTV(J->L, &rd->argv[1], &argv0);\n    /* Need to protect lj_record_call because it may throw. */\n    errcode = lj_vm_cpcall(J->L, NULL, J, recff_xpcall_cp);\n    /* Always undo Lua stack swap to avoid confusing the interpreter. */\n    copyTV(J->L, &rd->argv[0], &argv0);\n    copyTV(J->L, &rd->argv[1], &argv1);\n    if (errcode)\n      lj_err_throw(J->L, errcode);  /* Propagate errors. */\n    rd->nres = -1;  /* Pending call. */\n  }  /* else: Interpreter will throw. */\n}\n\n/* -- Math library fast functions ----------------------------------------- */\n\nstatic void LJ_FASTCALL recff_math_abs(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonum(J, J->base[0]);\n  J->base[0] = emitir(IRTN(IR_ABS), tr, lj_ir_knum_abs(J));\n  UNUSED(rd);\n}\n\n/* Record rounding functions math.floor and math.ceil. */\nstatic void LJ_FASTCALL recff_math_round(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  if (!tref_isinteger(tr)) {  /* Pass through integers unmodified. */\n    tr = emitir(IRTN(IR_FPMATH), lj_ir_tonum(J, tr), rd->data);\n    /* Result is integral (or NaN/Inf), but may not fit an int32_t. */\n    if (LJ_DUALNUM) {  /* Try to narrow using a guarded conversion to int. */\n      lua_Number n = lj_vm_foldfpm(numberVnum(&rd->argv[0]), rd->data);\n      if (n == (lua_Number)lj_num2int(n))\n\ttr = emitir(IRTGI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_CHECK);\n    }\n    J->base[0] = tr;\n  }\n}\n\n/* Record unary math.* functions, mapped to IR_FPMATH opcode. */\nstatic void LJ_FASTCALL recff_math_unary(jit_State *J, RecordFFData *rd)\n{\n  J->base[0] = emitir(IRTN(IR_FPMATH), lj_ir_tonum(J, J->base[0]), rd->data);\n}\n\n/* Record math.log. */\nstatic void LJ_FASTCALL recff_math_log(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonum(J, J->base[0]);\n  if (J->base[1]) {\n#ifdef LUAJIT_NO_LOG2\n    uint32_t fpm = IRFPM_LOG;\n#else\n    uint32_t fpm = IRFPM_LOG2;\n#endif\n    TRef trb = lj_ir_tonum(J, J->base[1]);\n    tr = emitir(IRTN(IR_FPMATH), tr, fpm);\n    trb = emitir(IRTN(IR_FPMATH), trb, fpm);\n    trb = emitir(IRTN(IR_DIV), lj_ir_knum_one(J), trb);\n    tr = emitir(IRTN(IR_MUL), tr, trb);\n  } else {\n    tr = emitir(IRTN(IR_FPMATH), tr, IRFPM_LOG);\n  }\n  J->base[0] = tr;\n  UNUSED(rd);\n}\n\n/* Record math.atan2. */\nstatic void LJ_FASTCALL recff_math_atan2(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonum(J, J->base[0]);\n  TRef tr2 = lj_ir_tonum(J, J->base[1]);\n  J->base[0] = emitir(IRTN(IR_ATAN2), tr, tr2);\n  UNUSED(rd);\n}\n\n/* Record math.ldexp. */\nstatic void LJ_FASTCALL recff_math_ldexp(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonum(J, J->base[0]);\n#if LJ_TARGET_X86ORX64\n  TRef tr2 = lj_ir_tonum(J, J->base[1]);\n#else\n  TRef tr2 = lj_opt_narrow_toint(J, J->base[1]);\n#endif\n  J->base[0] = emitir(IRTN(IR_LDEXP), tr, tr2);\n  UNUSED(rd);\n}\n\n/* Record math.asin, math.acos, math.atan. */\nstatic void LJ_FASTCALL recff_math_atrig(jit_State *J, RecordFFData *rd)\n{\n  TRef y = lj_ir_tonum(J, J->base[0]);\n  TRef x = lj_ir_knum_one(J);\n  uint32_t ffid = rd->data;\n  if (ffid != FF_math_atan) {\n    TRef tmp = emitir(IRTN(IR_MUL), y, y);\n    tmp = emitir(IRTN(IR_SUB), x, tmp);\n    tmp = emitir(IRTN(IR_FPMATH), tmp, IRFPM_SQRT);\n    if (ffid == FF_math_asin) { x = tmp; } else { x = y; y = tmp; }\n  }\n  J->base[0] = emitir(IRTN(IR_ATAN2), y, x);\n}\n\nstatic void LJ_FASTCALL recff_math_htrig(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonum(J, J->base[0]);\n  J->base[0] = emitir(IRTN(IR_CALLN), tr, rd->data);\n}\n\nstatic void LJ_FASTCALL recff_math_modf(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = J->base[0];\n  if (tref_isinteger(tr)) {\n    J->base[0] = tr;\n    J->base[1] = lj_ir_kint(J, 0);\n  } else {\n    TRef trt;\n    tr = lj_ir_tonum(J, tr);\n    trt = emitir(IRTN(IR_FPMATH), tr, IRFPM_TRUNC);\n    J->base[0] = trt;\n    J->base[1] = emitir(IRTN(IR_SUB), tr, trt);\n  }\n  rd->nres = 2;\n}\n\nstatic void LJ_FASTCALL recff_math_degrad(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonum(J, J->base[0]);\n  TRef trm = lj_ir_knum(J, numV(&J->fn->c.upvalue[0]));\n  J->base[0] = emitir(IRTN(IR_MUL), tr, trm);\n  UNUSED(rd);\n}\n\nstatic void LJ_FASTCALL recff_math_pow(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonum(J, J->base[0]);\n  if (!tref_isnumber_str(J->base[1]))\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  J->base[0] = lj_opt_narrow_pow(J, tr, J->base[1], &rd->argv[1]);\n  UNUSED(rd);\n}\n\nstatic void LJ_FASTCALL recff_math_minmax(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_ir_tonumber(J, J->base[0]);\n  uint32_t op = rd->data;\n  BCReg i;\n  for (i = 1; J->base[i] != 0; i++) {\n    TRef tr2 = lj_ir_tonumber(J, J->base[i]);\n    IRType t = IRT_INT;\n    if (!(tref_isinteger(tr) && tref_isinteger(tr2))) {\n      if (tref_isinteger(tr)) tr = emitir(IRTN(IR_CONV), tr, IRCONV_NUM_INT);\n      if (tref_isinteger(tr2)) tr2 = emitir(IRTN(IR_CONV), tr2, IRCONV_NUM_INT);\n      t = IRT_NUM;\n    }\n    tr = emitir(IRT(op, t), tr, tr2);\n  }\n  J->base[0] = tr;\n}\n\nstatic void LJ_FASTCALL recff_math_random(jit_State *J, RecordFFData *rd)\n{\n  GCudata *ud = udataV(&J->fn->c.upvalue[0]);\n  TRef tr, one;\n  lj_ir_kgc(J, obj2gco(ud), IRT_UDATA);  /* Prevent collection. */\n  tr = lj_ir_call(J, IRCALL_lj_math_random_step, lj_ir_kptr(J, uddata(ud)));\n  one = lj_ir_knum_one(J);\n  tr = emitir(IRTN(IR_SUB), tr, one);\n  if (J->base[0]) {\n    TRef tr1 = lj_ir_tonum(J, J->base[0]);\n    if (J->base[1]) {  /* d = floor(d*(r2-r1+1.0)) + r1 */\n      TRef tr2 = lj_ir_tonum(J, J->base[1]);\n      tr2 = emitir(IRTN(IR_SUB), tr2, tr1);\n      tr2 = emitir(IRTN(IR_ADD), tr2, one);\n      tr = emitir(IRTN(IR_MUL), tr, tr2);\n      tr = emitir(IRTN(IR_FPMATH), tr, IRFPM_FLOOR);\n      tr = emitir(IRTN(IR_ADD), tr, tr1);\n    } else {  /* d = floor(d*r1) + 1.0 */\n      tr = emitir(IRTN(IR_MUL), tr, tr1);\n      tr = emitir(IRTN(IR_FPMATH), tr, IRFPM_FLOOR);\n      tr = emitir(IRTN(IR_ADD), tr, one);\n    }\n  }\n  J->base[0] = tr;\n  UNUSED(rd);\n}\n\n/* -- Bit library fast functions ------------------------------------------ */\n\n/* Record unary bit.tobit, bit.bnot, bit.bswap. */\nstatic void LJ_FASTCALL recff_bit_unary(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_opt_narrow_tobit(J, J->base[0]);\n  J->base[0] = (rd->data == IR_TOBIT) ? tr : emitir(IRTI(rd->data), tr, 0);\n}\n\n/* Record N-ary bit.band, bit.bor, bit.bxor. */\nstatic void LJ_FASTCALL recff_bit_nary(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_opt_narrow_tobit(J, J->base[0]);\n  uint32_t op = rd->data;\n  BCReg i;\n  for (i = 1; J->base[i] != 0; i++)\n    tr = emitir(IRTI(op), tr, lj_opt_narrow_tobit(J, J->base[i]));\n  J->base[0] = tr;\n}\n\n/* Record bit shifts. */\nstatic void LJ_FASTCALL recff_bit_shift(jit_State *J, RecordFFData *rd)\n{\n  TRef tr = lj_opt_narrow_tobit(J, J->base[0]);\n  TRef tsh = lj_opt_narrow_tobit(J, J->base[1]);\n  IROp op = (IROp)rd->data;\n  if (!(op < IR_BROL ? LJ_TARGET_MASKSHIFT : LJ_TARGET_MASKROT) &&\n      !tref_isk(tsh))\n    tsh = emitir(IRTI(IR_BAND), tsh, lj_ir_kint(J, 31));\n#ifdef LJ_TARGET_UNIFYROT\n  if (op == (LJ_TARGET_UNIFYROT == 1 ? IR_BROR : IR_BROL)) {\n    op = LJ_TARGET_UNIFYROT == 1 ? IR_BROL : IR_BROR;\n    tsh = emitir(IRTI(IR_NEG), tsh, tsh);\n  }\n#endif\n  J->base[0] = emitir(IRTI(op), tr, tsh);\n}\n\n/* -- String library fast functions --------------------------------------- */\n\nstatic void LJ_FASTCALL recff_string_len(jit_State *J, RecordFFData *rd)\n{\n  J->base[0] = emitir(IRTI(IR_FLOAD), lj_ir_tostr(J, J->base[0]), IRFL_STR_LEN);\n  UNUSED(rd);\n}\n\n/* Handle string.byte (rd->data = 0) and string.sub (rd->data = 1). */\nstatic void LJ_FASTCALL recff_string_range(jit_State *J, RecordFFData *rd)\n{\n  TRef trstr = lj_ir_tostr(J, J->base[0]);\n  TRef trlen = emitir(IRTI(IR_FLOAD), trstr, IRFL_STR_LEN);\n  TRef tr0 = lj_ir_kint(J, 0);\n  TRef trstart, trend;\n  GCstr *str = argv2str(J, &rd->argv[0]);\n  int32_t start, end;\n  if (rd->data) {  /* string.sub(str, start [,end]) */\n    start = argv2int(J, &rd->argv[1]);\n    trstart = lj_opt_narrow_toint(J, J->base[1]);\n    trend = J->base[2];\n    if (tref_isnil(trend)) {\n      trend = lj_ir_kint(J, -1);\n      end = -1;\n    } else {\n      trend = lj_opt_narrow_toint(J, trend);\n      end = argv2int(J, &rd->argv[2]);\n    }\n  } else {  /* string.byte(str, [,start [,end]]) */\n    if (J->base[1]) {\n      start = argv2int(J, &rd->argv[1]);\n      trstart = lj_opt_narrow_toint(J, J->base[1]);\n      trend = J->base[2];\n      if (tref_isnil(trend)) {\n\ttrend = trstart;\n\tend = start;\n      } else {\n\ttrend = lj_opt_narrow_toint(J, trend);\n\tend = argv2int(J, &rd->argv[2]);\n      }\n    } else {\n      trend = trstart = lj_ir_kint(J, 1);\n      end = start = 1;\n    }\n  }\n  if (end < 0) {\n    emitir(IRTGI(IR_LT), trend, tr0);\n    trend = emitir(IRTI(IR_ADD), emitir(IRTI(IR_ADD), trlen, trend),\n\t\t   lj_ir_kint(J, 1));\n    end = end+(int32_t)str->len+1;\n  } else if ((MSize)end <= str->len) {\n    emitir(IRTGI(IR_ULE), trend, trlen);\n  } else {\n    emitir(IRTGI(IR_GT), trend, trlen);\n    end = (int32_t)str->len;\n    trend = trlen;\n  }\n  if (start < 0) {\n    emitir(IRTGI(IR_LT), trstart, tr0);\n    trstart = emitir(IRTI(IR_ADD), trlen, trstart);\n    start = start+(int32_t)str->len;\n    emitir(start < 0 ? IRTGI(IR_LT) : IRTGI(IR_GE), trstart, tr0);\n    if (start < 0) {\n      trstart = tr0;\n      start = 0;\n    }\n  } else {\n    if (start == 0) {\n      emitir(IRTGI(IR_EQ), trstart, tr0);\n      trstart = tr0;\n    } else {\n      trstart = emitir(IRTI(IR_ADD), trstart, lj_ir_kint(J, -1));\n      emitir(IRTGI(IR_GE), trstart, tr0);\n      start--;\n    }\n  }\n  if (rd->data) {  /* Return string.sub result. */\n    if (end - start >= 0) {\n      /* Also handle empty range here, to avoid extra traces. */\n      TRef trptr, trslen = emitir(IRTI(IR_SUB), trend, trstart);\n      emitir(IRTGI(IR_GE), trslen, tr0);\n      trptr = emitir(IRT(IR_STRREF, IRT_P32), trstr, trstart);\n      J->base[0] = emitir(IRT(IR_SNEW, IRT_STR), trptr, trslen);\n    } else {  /* Range underflow: return empty string. */\n      emitir(IRTGI(IR_LT), trend, trstart);\n      J->base[0] = lj_ir_kstr(J, lj_str_new(J->L, strdata(str), 0));\n    }\n  } else {  /* Return string.byte result(s). */\n    ptrdiff_t i, len = end - start;\n    if (len > 0) {\n      TRef trslen = emitir(IRTI(IR_SUB), trend, trstart);\n      emitir(IRTGI(IR_EQ), trslen, lj_ir_kint(J, (int32_t)len));\n      if (J->baseslot + len > LJ_MAX_JSLOTS)\n\tlj_trace_err_info(J, LJ_TRERR_STACKOV);\n      rd->nres = len;\n      for (i = 0; i < len; i++) {\n\tTRef tmp = emitir(IRTI(IR_ADD), trstart, lj_ir_kint(J, (int32_t)i));\n\ttmp = emitir(IRT(IR_STRREF, IRT_P32), trstr, tmp);\n\tJ->base[i] = emitir(IRT(IR_XLOAD, IRT_U8), tmp, IRXLOAD_READONLY);\n      }\n    } else {  /* Empty range or range underflow: return no results. */\n      emitir(IRTGI(IR_LE), trend, trstart);\n      rd->nres = 0;\n    }\n  }\n}\n\n/* -- Table library fast functions ---------------------------------------- */\n\nstatic void LJ_FASTCALL recff_table_getn(jit_State *J, RecordFFData *rd)\n{\n  if (tref_istab(J->base[0]))\n    J->base[0] = lj_ir_call(J, IRCALL_lj_tab_len, J->base[0]);\n  /* else: Interpreter will throw. */\n  UNUSED(rd);\n}\n\nstatic void LJ_FASTCALL recff_table_remove(jit_State *J, RecordFFData *rd)\n{\n  TRef tab = J->base[0];\n  rd->nres = 0;\n  if (tref_istab(tab)) {\n    if (!J->base[1] || tref_isnil(J->base[1])) {  /* Simple pop: t[#t] = nil */\n      TRef trlen = lj_ir_call(J, IRCALL_lj_tab_len, tab);\n      GCtab *t = tabV(&rd->argv[0]);\n      MSize len = lj_tab_len(t);\n      emitir(IRTGI(len ? IR_NE : IR_EQ), trlen, lj_ir_kint(J, 0));\n      if (len) {\n\tRecordIndex ix;\n\tix.tab = tab;\n\tix.key = trlen;\n\tsettabV(J->L, &ix.tabv, t);\n\tsetintV(&ix.keyv, len);\n\tix.idxchain = 0;\n\tif (results_wanted(J) != 0) {  /* Specialize load only if needed. */\n\t  ix.val = 0;\n\t  J->base[0] = lj_record_idx(J, &ix);  /* Load previous value. */\n\t  rd->nres = 1;\n\t  /* Assumes ix.key/ix.tab is not modified for raw lj_record_idx(). */\n\t}\n\tix.val = TREF_NIL;\n\tlj_record_idx(J, &ix);  /* Remove value. */\n      }\n    } else {  /* Complex case: remove in the middle. */\n      recff_nyiu(J);\n    }\n  }  /* else: Interpreter will throw. */\n}\n\nstatic void LJ_FASTCALL recff_table_insert(jit_State *J, RecordFFData *rd)\n{\n  RecordIndex ix;\n  ix.tab = J->base[0];\n  ix.val = J->base[1];\n  rd->nres = 0;\n  if (tref_istab(ix.tab) && ix.val) {\n    if (!J->base[2]) {  /* Simple push: t[#t+1] = v */\n      TRef trlen = lj_ir_call(J, IRCALL_lj_tab_len, ix.tab);\n      GCtab *t = tabV(&rd->argv[0]);\n      ix.key = emitir(IRTI(IR_ADD), trlen, lj_ir_kint(J, 1));\n      settabV(J->L, &ix.tabv, t);\n      setintV(&ix.keyv, lj_tab_len(t) + 1);\n      ix.idxchain = 0;\n      lj_record_idx(J, &ix);  /* Set new value. */\n    } else {  /* Complex case: insert in the middle. */\n      recff_nyiu(J);\n    }\n  }  /* else: Interpreter will throw. */\n}\n\n/* -- I/O library fast functions ------------------------------------------ */\n\n/* Get FILE* for I/O function. Any I/O error aborts recording, so there's\n** no need to encode the alternate cases for any of the guards.\n*/\nstatic TRef recff_io_fp(jit_State *J, TRef *udp, int32_t id)\n{\n  TRef tr, ud, fp;\n  if (id) {  /* io.func() */\n    tr = lj_ir_kptr(J, &J2G(J)->gcroot[id]);\n    ud = emitir(IRT(IR_XLOAD, IRT_UDATA), tr, 0);\n  } else {  /* fp:method() */\n    ud = J->base[0];\n    if (!tref_isudata(ud))\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n    tr = emitir(IRT(IR_FLOAD, IRT_U8), ud, IRFL_UDATA_UDTYPE);\n    emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, UDTYPE_IO_FILE));\n  }\n  *udp = ud;\n  fp = emitir(IRT(IR_FLOAD, IRT_PTR), ud, IRFL_UDATA_FILE);\n  emitir(IRTG(IR_NE, IRT_PTR), fp, lj_ir_knull(J, IRT_PTR));\n  return fp;\n}\n\nstatic void LJ_FASTCALL recff_io_write(jit_State *J, RecordFFData *rd)\n{\n  TRef ud, fp = recff_io_fp(J, &ud, rd->data);\n  TRef zero = lj_ir_kint(J, 0);\n  TRef one = lj_ir_kint(J, 1);\n  ptrdiff_t i = rd->data == 0 ? 1 : 0;\n  for (; J->base[i]; i++) {\n    TRef str = lj_ir_tostr(J, J->base[i]);\n    TRef buf = emitir(IRT(IR_STRREF, IRT_P32), str, zero);\n    TRef len = emitir(IRTI(IR_FLOAD), str, IRFL_STR_LEN);\n    if (tref_isk(len) && IR(tref_ref(len))->i == 1) {\n      TRef tr = emitir(IRT(IR_XLOAD, IRT_U8), buf, IRXLOAD_READONLY);\n      tr = lj_ir_call(J, IRCALL_fputc, tr, fp);\n      if (results_wanted(J) != 0)  /* Check result only if not ignored. */\n\temitir(IRTGI(IR_NE), tr, lj_ir_kint(J, -1));\n    } else {\n      TRef tr = lj_ir_call(J, IRCALL_fwrite, buf, one, len, fp);\n      if (results_wanted(J) != 0)  /* Check result only if not ignored. */\n\temitir(IRTGI(IR_EQ), tr, len);\n    }\n  }\n  J->base[0] = LJ_52 ? ud : TREF_TRUE;\n}\n\nstatic void LJ_FASTCALL recff_io_flush(jit_State *J, RecordFFData *rd)\n{\n  TRef ud, fp = recff_io_fp(J, &ud, rd->data);\n  TRef tr = lj_ir_call(J, IRCALL_fflush, fp);\n  if (results_wanted(J) != 0)  /* Check result only if not ignored. */\n    emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, 0));\n  J->base[0] = TREF_TRUE;\n}\n\n/* -- Record calls to fast functions -------------------------------------- */\n\n#include \"lj_recdef.h\"\n\nstatic uint32_t recdef_lookup(GCfunc *fn)\n{\n  if (fn->c.ffid < sizeof(recff_idmap)/sizeof(recff_idmap[0]))\n    return recff_idmap[fn->c.ffid];\n  else\n    return 0;\n}\n\n/* Record entry to a fast function or C function. */\nvoid lj_ffrecord_func(jit_State *J)\n{\n  RecordFFData rd;\n  uint32_t m = recdef_lookup(J->fn);\n  rd.data = m & 0xff;\n  rd.nres = 1;  /* Default is one result. */\n  rd.argv = J->L->base;\n  J->base[J->maxslot] = 0;  /* Mark end of arguments. */\n  (recff_func[m >> 8])(J, &rd);  /* Call recff_* handler. */\n  if (rd.nres >= 0) {\n    if (J->postproc == LJ_POST_NONE) J->postproc = LJ_POST_FFRETRY;\n    lj_record_ret(J, 0, rd.nres);\n  }\n}\n\n#undef IR\n#undef emitir\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ffrecord.h",
    "content": "/*\n** Fast function call recorder.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_FFRECORD_H\n#define _LJ_FFRECORD_H\n\n#include \"lj_obj.h\"\n#include \"lj_jit.h\"\n\n#if LJ_HASJIT\n/* Data used by handlers to record a fast function. */\ntypedef struct RecordFFData {\n  TValue *argv;\t\t/* Runtime argument values. */\n  ptrdiff_t nres;\t/* Number of returned results (defaults to 1). */\n  uint32_t data;\t/* Per-ffid auxiliary data (opcode, literal etc.). */\n} RecordFFData;\n\nLJ_FUNC int32_t lj_ffrecord_select_mode(jit_State *J, TRef tr, TValue *tv);\nLJ_FUNC void lj_ffrecord_func(jit_State *J);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_frame.h",
    "content": "/*\n** Stack frames.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_FRAME_H\n#define _LJ_FRAME_H\n\n#include \"lj_obj.h\"\n#include \"lj_bc.h\"\n\n/* -- Lua stack frame ----------------------------------------------------- */\n\n/* Frame type markers in callee function slot (callee base-1). */\nenum {\n  FRAME_LUA, FRAME_C, FRAME_CONT, FRAME_VARG,\n  FRAME_LUAP, FRAME_CP, FRAME_PCALL, FRAME_PCALLH\n};\n#define FRAME_TYPE\t\t3\n#define FRAME_P\t\t\t4\n#define FRAME_TYPEP\t\t(FRAME_TYPE|FRAME_P)\n\n/* Macros to access and modify Lua frames. */\n#define frame_gc(f)\t\t(gcref((f)->fr.func))\n#define frame_func(f)\t\t(&frame_gc(f)->fn)\n#define frame_ftsz(f)\t\t((f)->fr.tp.ftsz)\n\n#define frame_type(f)\t\t(frame_ftsz(f) & FRAME_TYPE)\n#define frame_typep(f)\t\t(frame_ftsz(f) & FRAME_TYPEP)\n#define frame_islua(f)\t\t(frame_type(f) == FRAME_LUA)\n#define frame_isc(f)\t\t(frame_type(f) == FRAME_C)\n#define frame_iscont(f)\t\t(frame_typep(f) == FRAME_CONT)\n#define frame_isvarg(f)\t\t(frame_typep(f) == FRAME_VARG)\n#define frame_ispcall(f)\t((frame_ftsz(f) & 6) == FRAME_PCALL)\n\n#define frame_pc(f)\t\t(mref((f)->fr.tp.pcr, const BCIns))\n#define frame_contpc(f)\t\t(frame_pc((f)-1))\n#if LJ_64\n#define frame_contf(f) \\\n  ((ASMFunction)(void *)((intptr_t)lj_vm_asm_begin + \\\n\t\t\t (intptr_t)(int32_t)((f)-1)->u32.lo))\n#else\n#define frame_contf(f)\t\t((ASMFunction)gcrefp(((f)-1)->gcr, void))\n#endif\n#define frame_delta(f)\t\t(frame_ftsz(f) >> 3)\n#define frame_sized(f)\t\t(frame_ftsz(f) & ~FRAME_TYPEP)\n\n#define frame_prevl(f)\t\t((f) - (1+bc_a(frame_pc(f)[-1])))\n#define frame_prevd(f)\t\t((TValue *)((char *)(f) - frame_sized(f)))\n#define frame_prev(f)\t\t(frame_islua(f)?frame_prevl(f):frame_prevd(f))\n/* Note: this macro does not skip over FRAME_VARG. */\n\n#define setframe_pc(f, pc)\t(setmref((f)->fr.tp.pcr, (pc)))\n#define setframe_ftsz(f, sz)\t((f)->fr.tp.ftsz = (sz))\n#define setframe_gc(f, p)\t(setgcref((f)->fr.func, (p)))\n\n/* -- C stack frame ------------------------------------------------------- */\n\n/* Macros to access and modify the C stack frame chain. */\n\n/* These definitions must match with the arch-specific *.dasc files. */\n#if LJ_TARGET_X86\n#define CFRAME_OFS_ERRF\t\t(15*4)\n#define CFRAME_OFS_NRES\t\t(14*4)\n#define CFRAME_OFS_PREV\t\t(13*4)\n#define CFRAME_OFS_L\t\t(12*4)\n#define CFRAME_OFS_PC\t\t(6*4)\n#define CFRAME_OFS_MULTRES\t(5*4)\n#define CFRAME_SIZE\t\t(12*4)\n#define CFRAME_SHIFT_MULTRES\t0\n#elif LJ_TARGET_X64\n#if LJ_ABI_WIN\n#define CFRAME_OFS_PREV\t\t(13*8)\n#define CFRAME_OFS_PC\t\t(25*4)\n#define CFRAME_OFS_L\t\t(24*4)\n#define CFRAME_OFS_ERRF\t\t(23*4)\n#define CFRAME_OFS_NRES\t\t(22*4)\n#define CFRAME_OFS_MULTRES\t(21*4)\n#define CFRAME_SIZE\t\t(10*8)\n#define CFRAME_SIZE_JIT\t\t(CFRAME_SIZE + 9*16 + 4*8)\n#define CFRAME_SHIFT_MULTRES\t0\n#else\n#define CFRAME_OFS_PREV\t\t(4*8)\n#define CFRAME_OFS_PC\t\t(7*4)\n#define CFRAME_OFS_L\t\t(6*4)\n#define CFRAME_OFS_ERRF\t\t(5*4)\n#define CFRAME_OFS_NRES\t\t(4*4)\n#define CFRAME_OFS_MULTRES\t(1*4)\n#define CFRAME_SIZE\t\t(10*8)\n#define CFRAME_SIZE_JIT\t\t(CFRAME_SIZE + 16)\n#define CFRAME_SHIFT_MULTRES\t0\n#endif\n#elif LJ_TARGET_ARM\n#define CFRAME_OFS_ERRF\t\t24\n#define CFRAME_OFS_NRES\t\t20\n#define CFRAME_OFS_PREV\t\t16\n#define CFRAME_OFS_L\t\t12\n#define CFRAME_OFS_PC\t\t8\n#define CFRAME_OFS_MULTRES\t4\n#if LJ_ARCH_HASFPU\n#define CFRAME_SIZE\t\t128\n#else\n#define CFRAME_SIZE\t\t64\n#endif\n#define CFRAME_SHIFT_MULTRES\t3\n#elif LJ_TARGET_PPC\n#if LJ_TARGET_XBOX360\n#define CFRAME_OFS_ERRF\t\t424\n#define CFRAME_OFS_NRES\t\t420\n#define CFRAME_OFS_PREV\t\t400\n#define CFRAME_OFS_L\t\t416\n#define CFRAME_OFS_PC\t\t412\n#define CFRAME_OFS_MULTRES\t408\n#define CFRAME_SIZE\t\t384\n#define CFRAME_SHIFT_MULTRES\t3\n#elif LJ_ARCH_PPC64\n#define CFRAME_OFS_ERRF\t\t472\n#define CFRAME_OFS_NRES\t\t468\n#define CFRAME_OFS_PREV\t\t448\n#define CFRAME_OFS_L\t\t464\n#define CFRAME_OFS_PC\t\t460\n#define CFRAME_OFS_MULTRES\t456\n#define CFRAME_SIZE\t\t400\n#define CFRAME_SHIFT_MULTRES\t3\n#else\n#define CFRAME_OFS_ERRF\t\t48\n#define CFRAME_OFS_NRES\t\t44\n#define CFRAME_OFS_PREV\t\t40\n#define CFRAME_OFS_L\t\t36\n#define CFRAME_OFS_PC\t\t32\n#define CFRAME_OFS_MULTRES\t28\n#define CFRAME_SIZE\t\t272\n#define CFRAME_SHIFT_MULTRES\t3\n#endif\n#elif LJ_TARGET_PPCSPE\n#define CFRAME_OFS_ERRF\t\t28\n#define CFRAME_OFS_NRES\t\t24\n#define CFRAME_OFS_PREV\t\t20\n#define CFRAME_OFS_L\t\t16\n#define CFRAME_OFS_PC\t\t12\n#define CFRAME_OFS_MULTRES\t8\n#define CFRAME_SIZE\t\t184\n#define CFRAME_SHIFT_MULTRES\t3\n#elif LJ_TARGET_MIPS\n#define CFRAME_OFS_ERRF\t\t124\n#define CFRAME_OFS_NRES\t\t120\n#define CFRAME_OFS_PREV\t\t116\n#define CFRAME_OFS_L\t\t112\n#define CFRAME_OFS_PC\t\t20\n#define CFRAME_OFS_MULTRES\t16\n#define CFRAME_SIZE\t\t112\n#define CFRAME_SHIFT_MULTRES\t3\n#else\n#error \"Missing CFRAME_* definitions for this architecture\"\n#endif\n\n#ifndef CFRAME_SIZE_JIT\n#define CFRAME_SIZE_JIT\t\tCFRAME_SIZE\n#endif\n\n#define CFRAME_RESUME\t\t1\n#define CFRAME_UNWIND_FF\t2  /* Only used in unwinder. */\n#define CFRAME_RAWMASK\t\t(~(intptr_t)(CFRAME_RESUME|CFRAME_UNWIND_FF))\n\n#define cframe_errfunc(cf)\t(*(int32_t *)(((char *)(cf))+CFRAME_OFS_ERRF))\n#define cframe_nres(cf)\t\t(*(int32_t *)(((char *)(cf))+CFRAME_OFS_NRES))\n#define cframe_prev(cf)\t\t(*(void **)(((char *)(cf))+CFRAME_OFS_PREV))\n#define cframe_multres(cf)  (*(uint32_t *)(((char *)(cf))+CFRAME_OFS_MULTRES))\n#define cframe_multres_n(cf)\t(cframe_multres((cf)) >> CFRAME_SHIFT_MULTRES)\n#define cframe_L(cf) \\\n  (&gcref(*(GCRef *)(((char *)(cf))+CFRAME_OFS_L))->th)\n#define cframe_pc(cf) \\\n  (mref(*(MRef *)(((char *)(cf))+CFRAME_OFS_PC), const BCIns))\n#define setcframe_L(cf, L) \\\n  (setmref(*(MRef *)(((char *)(cf))+CFRAME_OFS_L), (L)))\n#define setcframe_pc(cf, pc) \\\n  (setmref(*(MRef *)(((char *)(cf))+CFRAME_OFS_PC), (pc)))\n#define cframe_canyield(cf)\t((intptr_t)(cf) & CFRAME_RESUME)\n#define cframe_unwind_ff(cf)\t((intptr_t)(cf) & CFRAME_UNWIND_FF)\n#define cframe_raw(cf)\t\t((void *)((intptr_t)(cf) & CFRAME_RAWMASK))\n#define cframe_Lpc(L)\t\tcframe_pc(cframe_raw(L->cframe))\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_func.c",
    "content": "/*\n** Function handling (prototypes, functions and upvalues).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_func_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_func.h\"\n#include \"lj_trace.h\"\n#include \"lj_vm.h\"\n\n/* -- Prototypes ---------------------------------------------------------- */\n\nvoid LJ_FASTCALL lj_func_freeproto(global_State *g, GCproto *pt)\n{\n  lj_mem_free(g, pt, pt->sizept);\n}\n\n/* -- Upvalues ------------------------------------------------------------ */\n\nstatic void unlinkuv(GCupval *uv)\n{\n  lua_assert(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv);\n  setgcrefr(uvnext(uv)->prev, uv->prev);\n  setgcrefr(uvprev(uv)->next, uv->next);\n}\n\n/* Find existing open upvalue for a stack slot or create a new one. */\nstatic GCupval *func_finduv(lua_State *L, TValue *slot)\n{\n  global_State *g = G(L);\n  GCRef *pp = &L->openupval;\n  GCupval *p;\n  GCupval *uv;\n  /* Search the sorted list of open upvalues. */\n  while (gcref(*pp) != NULL && uvval((p = gco2uv(gcref(*pp)))) >= slot) {\n    lua_assert(!p->closed && uvval(p) != &p->tv);\n    if (uvval(p) == slot) {  /* Found open upvalue pointing to same slot? */\n      if (isdead(g, obj2gco(p)))  /* Resurrect it, if it's dead. */\n\tflipwhite(obj2gco(p));\n      return p;\n    }\n    pp = &p->nextgc;\n  }\n  /* No matching upvalue found. Create a new one. */\n  uv = lj_mem_newt(L, sizeof(GCupval), GCupval);\n  newwhite(g, uv);\n  uv->gct = ~LJ_TUPVAL;\n  uv->closed = 0;  /* Still open. */\n  setmref(uv->v, slot);  /* Pointing to the stack slot. */\n  /* NOBARRIER: The GCupval is new (marked white) and open. */\n  setgcrefr(uv->nextgc, *pp);  /* Insert into sorted list of open upvalues. */\n  setgcref(*pp, obj2gco(uv));\n  setgcref(uv->prev, obj2gco(&g->uvhead));  /* Insert into GC list, too. */\n  setgcrefr(uv->next, g->uvhead.next);\n  setgcref(uvnext(uv)->prev, obj2gco(uv));\n  setgcref(g->uvhead.next, obj2gco(uv));\n  lua_assert(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv);\n  return uv;\n}\n\n/* Create an empty and closed upvalue. */\nstatic GCupval *func_emptyuv(lua_State *L)\n{\n  GCupval *uv = (GCupval *)lj_mem_newgco(L, sizeof(GCupval));\n  uv->gct = ~LJ_TUPVAL;\n  uv->closed = 1;\n  setnilV(&uv->tv);\n  setmref(uv->v, &uv->tv);\n  return uv;\n}\n\n/* Close all open upvalues pointing to some stack level or above. */\nvoid LJ_FASTCALL lj_func_closeuv(lua_State *L, TValue *level)\n{\n  GCupval *uv;\n  global_State *g = G(L);\n  while (gcref(L->openupval) != NULL &&\n\t uvval((uv = gco2uv(gcref(L->openupval)))) >= level) {\n    GCobj *o = obj2gco(uv);\n    lua_assert(!isblack(o) && !uv->closed && uvval(uv) != &uv->tv);\n    setgcrefr(L->openupval, uv->nextgc);  /* No longer in open list. */\n    if (isdead(g, o)) {\n      lj_func_freeuv(g, uv);\n    } else {\n      unlinkuv(uv);\n      lj_gc_closeuv(g, uv);\n    }\n  }\n}\n\nvoid LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv)\n{\n  if (!uv->closed)\n    unlinkuv(uv);\n  lj_mem_freet(g, uv);\n}\n\n/* -- Functions (closures) ------------------------------------------------ */\n\nGCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env)\n{\n  GCfunc *fn = (GCfunc *)lj_mem_newgco(L, sizeCfunc(nelems));\n  fn->c.gct = ~LJ_TFUNC;\n  fn->c.ffid = FF_C;\n  fn->c.nupvalues = (uint8_t)nelems;\n  /* NOBARRIER: The GCfunc is new (marked white). */\n  setmref(fn->c.pc, &G(L)->bc_cfunc_ext);\n  setgcref(fn->c.env, obj2gco(env));\n  return fn;\n}\n\nstatic GCfunc *func_newL(lua_State *L, GCproto *pt, GCtab *env)\n{\n  uint32_t count;\n  GCfunc *fn = (GCfunc *)lj_mem_newgco(L, sizeLfunc((MSize)pt->sizeuv));\n  fn->l.gct = ~LJ_TFUNC;\n  fn->l.ffid = FF_LUA;\n  fn->l.nupvalues = 0;  /* Set to zero until upvalues are initialized. */\n  /* NOBARRIER: Really a setgcref. But the GCfunc is new (marked white). */\n  setmref(fn->l.pc, proto_bc(pt));\n  setgcref(fn->l.env, obj2gco(env));\n  /* Saturating 3 bit counter (0..7) for created closures. */\n  count = (uint32_t)pt->flags + PROTO_CLCOUNT;\n  pt->flags = (uint8_t)(count - ((count >> PROTO_CLC_BITS) & PROTO_CLCOUNT));\n  return fn;\n}\n\n/* Create a new Lua function with empty upvalues. */\nGCfunc *lj_func_newL_empty(lua_State *L, GCproto *pt, GCtab *env)\n{\n  GCfunc *fn = func_newL(L, pt, env);\n  MSize i, nuv = pt->sizeuv;\n  /* NOBARRIER: The GCfunc is new (marked white). */\n  for (i = 0; i < nuv; i++) {\n    GCupval *uv = func_emptyuv(L);\n    uv->dhash = (uint32_t)(uintptr_t)pt ^ ((uint32_t)proto_uv(pt)[i] << 24);\n    setgcref(fn->l.uvptr[i], obj2gco(uv));\n  }\n  fn->l.nupvalues = (uint8_t)nuv;\n  return fn;\n}\n\n/* Do a GC check and create a new Lua function with inherited upvalues. */\nGCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent)\n{\n  GCfunc *fn;\n  GCRef *puv;\n  MSize i, nuv;\n  TValue *base;\n  lj_gc_check_fixtop(L);\n  fn = func_newL(L, pt, tabref(parent->env));\n  /* NOBARRIER: The GCfunc is new (marked white). */\n  puv = parent->uvptr;\n  nuv = pt->sizeuv;\n  base = L->base;\n  for (i = 0; i < nuv; i++) {\n    uint32_t v = proto_uv(pt)[i];\n    GCupval *uv;\n    if ((v & PROTO_UV_LOCAL)) {\n      uv = func_finduv(L, base + (v & 0xff));\n      uv->immutable = ((v / PROTO_UV_IMMUTABLE) & 1);\n      uv->dhash = (uint32_t)(uintptr_t)mref(parent->pc, char) ^ (v << 24);\n    } else {\n      uv = &gcref(puv[v])->uv;\n    }\n    setgcref(fn->l.uvptr[i], obj2gco(uv));\n  }\n  fn->l.nupvalues = (uint8_t)nuv;\n  return fn;\n}\n\nvoid LJ_FASTCALL lj_func_free(global_State *g, GCfunc *fn)\n{\n  MSize size = isluafunc(fn) ? sizeLfunc((MSize)fn->l.nupvalues) :\n\t\t\t       sizeCfunc((MSize)fn->c.nupvalues);\n  lj_mem_free(g, fn, size);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_func.h",
    "content": "/*\n** Function handling (prototypes, functions and upvalues).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_FUNC_H\n#define _LJ_FUNC_H\n\n#include \"lj_obj.h\"\n\n/* Prototypes. */\nLJ_FUNC void LJ_FASTCALL lj_func_freeproto(global_State *g, GCproto *pt);\n\n/* Upvalues. */\nLJ_FUNCA void LJ_FASTCALL lj_func_closeuv(lua_State *L, TValue *level);\nLJ_FUNC void LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv);\n\n/* Functions (closures). */\nLJ_FUNC GCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env);\nLJ_FUNC GCfunc *lj_func_newL_empty(lua_State *L, GCproto *pt, GCtab *env);\nLJ_FUNCA GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent);\nLJ_FUNC void LJ_FASTCALL lj_func_free(global_State *g, GCfunc *c);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_gc.c",
    "content": "/*\n** Garbage collector.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_gc_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_func.h\"\n#include \"lj_udata.h\"\n#include \"lj_meta.h\"\n#include \"lj_state.h\"\n#include \"lj_frame.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#include \"lj_cdata.h\"\n#endif\n#include \"lj_trace.h\"\n#include \"lj_vm.h\"\n\n#define GCSTEPSIZE\t1024u\n#define GCSWEEPMAX\t40\n#define GCSWEEPCOST\t10\n#define GCFINALIZECOST\t100\n\n/* Macros to set GCobj colors and flags. */\n#define white2gray(x)\t\t((x)->gch.marked &= (uint8_t)~LJ_GC_WHITES)\n#define gray2black(x)\t\t((x)->gch.marked |= LJ_GC_BLACK)\n#define isfinalized(u)\t\t((u)->marked & LJ_GC_FINALIZED)\n\n/* -- Mark phase ---------------------------------------------------------- */\n\n/* Mark a TValue (if needed). */\n#define gc_marktv(g, tv) \\\n  { lua_assert(!tvisgcv(tv) || (~itype(tv) == gcval(tv)->gch.gct)); \\\n    if (tviswhite(tv)) gc_mark(g, gcV(tv)); }\n\n/* Mark a GCobj (if needed). */\n#define gc_markobj(g, o) \\\n  { if (iswhite(obj2gco(o))) gc_mark(g, obj2gco(o)); }\n\n/* Mark a string object. */\n#define gc_mark_str(s)\t\t((s)->marked &= (uint8_t)~LJ_GC_WHITES)\n\n/* Mark a white GCobj. */\nstatic void gc_mark(global_State *g, GCobj *o)\n{\n  int gct = o->gch.gct;\n  lua_assert(iswhite(o) && !isdead(g, o));\n  white2gray(o);\n  if (LJ_UNLIKELY(gct == ~LJ_TUDATA)) {\n    GCtab *mt = tabref(gco2ud(o)->metatable);\n    gray2black(o);  /* Userdata are never gray. */\n    if (mt) gc_markobj(g, mt);\n    gc_markobj(g, tabref(gco2ud(o)->env));\n  } else if (LJ_UNLIKELY(gct == ~LJ_TUPVAL)) {\n    GCupval *uv = gco2uv(o);\n    gc_marktv(g, uvval(uv));\n    if (uv->closed)\n      gray2black(o);  /* Closed upvalues are never gray. */\n  } else if (gct != ~LJ_TSTR && gct != ~LJ_TCDATA) {\n    lua_assert(gct == ~LJ_TFUNC || gct == ~LJ_TTAB ||\n\t       gct == ~LJ_TTHREAD || gct == ~LJ_TPROTO);\n    setgcrefr(o->gch.gclist, g->gc.gray);\n    setgcref(g->gc.gray, o);\n  }\n}\n\n/* Mark GC roots. */\nstatic void gc_mark_gcroot(global_State *g)\n{\n  ptrdiff_t i;\n  for (i = 0; i < GCROOT_MAX; i++)\n    if (gcref(g->gcroot[i]) != NULL)\n      gc_markobj(g, gcref(g->gcroot[i]));\n}\n\n/* Start a GC cycle and mark the root set. */\nstatic void gc_mark_start(global_State *g)\n{\n  setgcrefnull(g->gc.gray);\n  setgcrefnull(g->gc.grayagain);\n  setgcrefnull(g->gc.weak);\n  gc_markobj(g, mainthread(g));\n  gc_markobj(g, tabref(mainthread(g)->env));\n  gc_marktv(g, &g->registrytv);\n  gc_mark_gcroot(g);\n  g->gc.state = GCSpropagate;\n}\n\n/* Mark open upvalues. */\nstatic void gc_mark_uv(global_State *g)\n{\n  GCupval *uv;\n  for (uv = uvnext(&g->uvhead); uv != &g->uvhead; uv = uvnext(uv)) {\n    lua_assert(uvprev(uvnext(uv)) == uv && uvnext(uvprev(uv)) == uv);\n    if (isgray(obj2gco(uv)))\n      gc_marktv(g, uvval(uv));\n  }\n}\n\n/* Mark userdata in mmudata list. */\nstatic void gc_mark_mmudata(global_State *g)\n{\n  GCobj *root = gcref(g->gc.mmudata);\n  GCobj *u = root;\n  if (u) {\n    do {\n      u = gcnext(u);\n      makewhite(g, u);  /* Could be from previous GC. */\n      gc_mark(g, u);\n    } while (u != root);\n  }\n}\n\n/* Separate userdata objects to be finalized to mmudata list. */\nsize_t lj_gc_separateudata(global_State *g, int all)\n{\n  size_t m = 0;\n  GCRef *p = &mainthread(g)->nextgc;\n  GCobj *o;\n  while ((o = gcref(*p)) != NULL) {\n    if (!(iswhite(o) || all) || isfinalized(gco2ud(o))) {\n      p = &o->gch.nextgc;  /* Nothing to do. */\n    } else if (!lj_meta_fastg(g, tabref(gco2ud(o)->metatable), MM_gc)) {\n      markfinalized(o);  /* Done, as there's no __gc metamethod. */\n      p = &o->gch.nextgc;\n    } else {  /* Otherwise move userdata to be finalized to mmudata list. */\n      m += sizeudata(gco2ud(o));\n      markfinalized(o);\n      *p = o->gch.nextgc;\n      if (gcref(g->gc.mmudata)) {  /* Link to end of mmudata list. */\n\tGCobj *root = gcref(g->gc.mmudata);\n\tsetgcrefr(o->gch.nextgc, root->gch.nextgc);\n\tsetgcref(root->gch.nextgc, o);\n\tsetgcref(g->gc.mmudata, o);\n      } else {  /* Create circular list. */\n\tsetgcref(o->gch.nextgc, o);\n\tsetgcref(g->gc.mmudata, o);\n      }\n    }\n  }\n  return m;\n}\n\n/* -- Propagation phase --------------------------------------------------- */\n\n/* Traverse a table. */\nstatic int gc_traverse_tab(global_State *g, GCtab *t)\n{\n  int weak = 0;\n  cTValue *mode;\n  GCtab *mt = tabref(t->metatable);\n  if (mt)\n    gc_markobj(g, mt);\n  mode = lj_meta_fastg(g, mt, MM_mode);\n  if (mode && tvisstr(mode)) {  /* Valid __mode field? */\n    const char *modestr = strVdata(mode);\n    int c;\n    while ((c = *modestr++)) {\n      if (c == 'k') weak |= LJ_GC_WEAKKEY;\n      else if (c == 'v') weak |= LJ_GC_WEAKVAL;\n      else if (c == 'K') weak = (int)(~0u & ~LJ_GC_WEAKVAL);\n    }\n    if (weak > 0) {  /* Weak tables are cleared in the atomic phase. */\n      t->marked = (uint8_t)((t->marked & ~LJ_GC_WEAK) | weak);\n      setgcrefr(t->gclist, g->gc.weak);\n      setgcref(g->gc.weak, obj2gco(t));\n    }\n  }\n  if (weak == LJ_GC_WEAK)  /* Nothing to mark if both keys/values are weak. */\n    return 1;\n  if (!(weak & LJ_GC_WEAKVAL)) {  /* Mark array part. */\n    MSize i, asize = t->asize;\n    for (i = 0; i < asize; i++)\n      gc_marktv(g, arrayslot(t, i));\n  }\n  if (t->hmask > 0) {  /* Mark hash part. */\n    Node *node = noderef(t->node);\n    MSize i, hmask = t->hmask;\n    for (i = 0; i <= hmask; i++) {\n      Node *n = &node[i];\n      if (!tvisnil(&n->val)) {  /* Mark non-empty slot. */\n\tlua_assert(!tvisnil(&n->key));\n\tif (!(weak & LJ_GC_WEAKKEY)) gc_marktv(g, &n->key);\n\tif (!(weak & LJ_GC_WEAKVAL)) gc_marktv(g, &n->val);\n      }\n    }\n  }\n  return weak;\n}\n\n/* Traverse a function. */\nstatic void gc_traverse_func(global_State *g, GCfunc *fn)\n{\n  gc_markobj(g, tabref(fn->c.env));\n  if (isluafunc(fn)) {\n    uint32_t i;\n    lua_assert(fn->l.nupvalues <= funcproto(fn)->sizeuv);\n    gc_markobj(g, funcproto(fn));\n    for (i = 0; i < fn->l.nupvalues; i++)  /* Mark Lua function upvalues. */\n      gc_markobj(g, &gcref(fn->l.uvptr[i])->uv);\n  } else {\n    uint32_t i;\n    for (i = 0; i < fn->c.nupvalues; i++)  /* Mark C function upvalues. */\n      gc_marktv(g, &fn->c.upvalue[i]);\n  }\n}\n\n#if LJ_HASJIT\n/* Mark a trace. */\nstatic void gc_marktrace(global_State *g, TraceNo traceno)\n{\n  GCobj *o = obj2gco(traceref(G2J(g), traceno));\n  lua_assert(traceno != G2J(g)->cur.traceno);\n  if (iswhite(o)) {\n    white2gray(o);\n    setgcrefr(o->gch.gclist, g->gc.gray);\n    setgcref(g->gc.gray, o);\n  }\n}\n\n/* Traverse a trace. */\nstatic void gc_traverse_trace(global_State *g, GCtrace *T)\n{\n  IRRef ref;\n  if (T->traceno == 0) return;\n  for (ref = T->nk; ref < REF_TRUE; ref++) {\n    IRIns *ir = &T->ir[ref];\n    if (ir->o == IR_KGC)\n      gc_markobj(g, ir_kgc(ir));\n  }\n  if (T->link) gc_marktrace(g, T->link);\n  if (T->nextroot) gc_marktrace(g, T->nextroot);\n  if (T->nextside) gc_marktrace(g, T->nextside);\n  gc_markobj(g, gcref(T->startpt));\n}\n\n/* The current trace is a GC root while not anchored in the prototype (yet). */\n#define gc_traverse_curtrace(g)\tgc_traverse_trace(g, &G2J(g)->cur)\n#else\n#define gc_traverse_curtrace(g)\tUNUSED(g)\n#endif\n\n/* Traverse a prototype. */\nstatic void gc_traverse_proto(global_State *g, GCproto *pt)\n{\n  ptrdiff_t i;\n  gc_mark_str(proto_chunkname(pt));\n  for (i = -(ptrdiff_t)pt->sizekgc; i < 0; i++)  /* Mark collectable consts. */\n    gc_markobj(g, proto_kgc(pt, i));\n#if LJ_HASJIT\n  if (pt->trace) gc_marktrace(g, pt->trace);\n#endif\n}\n\n/* Traverse the frame structure of a stack. */\nstatic MSize gc_traverse_frames(global_State *g, lua_State *th)\n{\n  TValue *frame, *top = th->top-1, *bot = tvref(th->stack);\n  /* Note: extra vararg frame not skipped, marks function twice (harmless). */\n  for (frame = th->base-1; frame > bot; frame = frame_prev(frame)) {\n    GCfunc *fn = frame_func(frame);\n    TValue *ftop = frame;\n    if (isluafunc(fn)) ftop += funcproto(fn)->framesize;\n    if (ftop > top) top = ftop;\n    gc_markobj(g, fn);  /* Need to mark hidden function (or L). */\n  }\n  top++;  /* Correct bias of -1 (frame == base-1). */\n  if (top > tvref(th->maxstack)) top = tvref(th->maxstack);\n  return (MSize)(top - bot);  /* Return minimum needed stack size. */\n}\n\n/* Traverse a thread object. */\nstatic void gc_traverse_thread(global_State *g, lua_State *th)\n{\n  TValue *o, *top = th->top;\n  for (o = tvref(th->stack)+1; o < top; o++)\n    gc_marktv(g, o);\n  if (g->gc.state == GCSatomic) {\n    top = tvref(th->stack) + th->stacksize;\n    for (; o < top; o++)  /* Clear unmarked slots. */\n      setnilV(o);\n  }\n  gc_markobj(g, tabref(th->env));\n  lj_state_shrinkstack(th, gc_traverse_frames(g, th));\n}\n\n/* Propagate one gray object. Traverse it and turn it black. */\nstatic size_t propagatemark(global_State *g)\n{\n  GCobj *o = gcref(g->gc.gray);\n  int gct = o->gch.gct;\n  lua_assert(isgray(o));\n  gray2black(o);\n  setgcrefr(g->gc.gray, o->gch.gclist);  /* Remove from gray list. */\n  if (LJ_LIKELY(gct == ~LJ_TTAB)) {\n    GCtab *t = gco2tab(o);\n    if (gc_traverse_tab(g, t) > 0)\n      black2gray(o);  /* Keep weak tables gray. */\n    return sizeof(GCtab) + sizeof(TValue) * t->asize +\n\t\t\t   sizeof(Node) * (t->hmask + 1);\n  } else if (LJ_LIKELY(gct == ~LJ_TFUNC)) {\n    GCfunc *fn = gco2func(o);\n    gc_traverse_func(g, fn);\n    return isluafunc(fn) ? sizeLfunc((MSize)fn->l.nupvalues) :\n\t\t\t   sizeCfunc((MSize)fn->c.nupvalues);\n  } else if (LJ_LIKELY(gct == ~LJ_TPROTO)) {\n    GCproto *pt = gco2pt(o);\n    gc_traverse_proto(g, pt);\n    return pt->sizept;\n  } else if (LJ_LIKELY(gct == ~LJ_TTHREAD)) {\n    lua_State *th = gco2th(o);\n    setgcrefr(th->gclist, g->gc.grayagain);\n    setgcref(g->gc.grayagain, o);\n    black2gray(o);  /* Threads are never black. */\n    gc_traverse_thread(g, th);\n    return sizeof(lua_State) + sizeof(TValue) * th->stacksize;\n  } else {\n#if LJ_HASJIT\n    GCtrace *T = gco2trace(o);\n    gc_traverse_trace(g, T);\n    return ((sizeof(GCtrace)+7)&~7) + (T->nins-T->nk)*sizeof(IRIns) +\n\t   T->nsnap*sizeof(SnapShot) + T->nsnapmap*sizeof(SnapEntry);\n#else\n    lua_assert(0);\n    return 0;\n#endif\n  }\n}\n\n/* Propagate all gray objects. */\nstatic size_t gc_propagate_gray(global_State *g)\n{\n  size_t m = 0;\n  while (gcref(g->gc.gray) != NULL)\n    m += propagatemark(g);\n  return m;\n}\n\n/* -- Sweep phase --------------------------------------------------------- */\n\n/* Try to shrink some common data structures. */\nstatic void gc_shrink(global_State *g, lua_State *L)\n{\n  if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1)\n    lj_str_resize(L, g->strmask >> 1);  /* Shrink string table. */\n  if (g->tmpbuf.sz > LJ_MIN_SBUF*2)\n    lj_str_resizebuf(L, &g->tmpbuf, g->tmpbuf.sz >> 1);  /* Shrink temp buf. */\n}\n\n/* Type of GC free functions. */\ntypedef void (LJ_FASTCALL *GCFreeFunc)(global_State *g, GCobj *o);\n\n/* GC free functions for LJ_TSTR .. LJ_TUDATA. ORDER LJ_T */\nstatic const GCFreeFunc gc_freefunc[] = {\n  (GCFreeFunc)lj_str_free,\n  (GCFreeFunc)lj_func_freeuv,\n  (GCFreeFunc)lj_state_free,\n  (GCFreeFunc)lj_func_freeproto,\n  (GCFreeFunc)lj_func_free,\n#if LJ_HASJIT\n  (GCFreeFunc)lj_trace_free,\n#else\n  (GCFreeFunc)0,\n#endif\n#if LJ_HASFFI\n  (GCFreeFunc)lj_cdata_free,\n#else\n  (GCFreeFunc)0,\n#endif\n  (GCFreeFunc)lj_tab_free,\n  (GCFreeFunc)lj_udata_free\n};\n\n/* Full sweep of a GC list. */\n#define gc_fullsweep(g, p)\tgc_sweep(g, (p), LJ_MAX_MEM)\n\n/* Partial sweep of a GC list. */\nstatic GCRef *gc_sweep(global_State *g, GCRef *p, uint32_t lim)\n{\n  /* Mask with other white and LJ_GC_FIXED. Or LJ_GC_SFIXED on shutdown. */\n  int ow = otherwhite(g);\n  GCobj *o;\n  while ((o = gcref(*p)) != NULL && lim-- > 0) {\n    if (o->gch.gct == ~LJ_TTHREAD)  /* Need to sweep open upvalues, too. */\n      gc_fullsweep(g, &gco2th(o)->openupval);\n    if (((o->gch.marked ^ LJ_GC_WHITES) & ow)) {  /* Black or current white? */\n      lua_assert(!isdead(g, o) || (o->gch.marked & LJ_GC_FIXED));\n      makewhite(g, o);  /* Value is alive, change to the current white. */\n      p = &o->gch.nextgc;\n    } else {  /* Otherwise value is dead, free it. */\n      lua_assert(isdead(g, o) || ow == LJ_GC_SFIXED);\n      setgcrefr(*p, o->gch.nextgc);\n      if (o == gcref(g->gc.root))\n\tsetgcrefr(g->gc.root, o->gch.nextgc);  /* Adjust list anchor. */\n      gc_freefunc[o->gch.gct - ~LJ_TSTR](g, o);\n    }\n  }\n  return p;\n}\n\n/* Check whether we can clear a key or a value slot from a table. */\nstatic int gc_mayclear(cTValue *o, int val)\n{\n  if (tvisgcv(o)) {  /* Only collectable objects can be weak references. */\n    if (tvisstr(o)) {  /* But strings cannot be used as weak references. */\n      gc_mark_str(strV(o));  /* And need to be marked. */\n      return 0;\n    }\n    if (iswhite(gcV(o)))\n      return 1;  /* Object is about to be collected. */\n    if (tvisudata(o) && val && isfinalized(udataV(o)))\n      return 1;  /* Finalized userdata is dropped only from values. */\n  }\n  return 0;  /* Cannot clear. */\n}\n\n/* Clear collected entries from weak tables. */\nstatic void gc_clearweak(GCobj *o)\n{\n  while (o) {\n    GCtab *t = gco2tab(o);\n    lua_assert((t->marked & LJ_GC_WEAK));\n    if ((t->marked & LJ_GC_WEAKVAL)) {\n      MSize i, asize = t->asize;\n      for (i = 0; i < asize; i++) {\n\t/* Clear array slot when value is about to be collected. */\n\tTValue *tv = arrayslot(t, i);\n\tif (gc_mayclear(tv, 1))\n\t  setnilV(tv);\n      }\n    }\n    if (t->hmask > 0) {\n      Node *node = noderef(t->node);\n      MSize i, hmask = t->hmask;\n      for (i = 0; i <= hmask; i++) {\n\tNode *n = &node[i];\n\t/* Clear hash slot when key or value is about to be collected. */\n\tif (!tvisnil(&n->val) && (gc_mayclear(&n->key, 0) ||\n\t\t\t\t  gc_mayclear(&n->val, 1)))\n\t  setnilV(&n->val);\n      }\n    }\n    o = gcref(t->gclist);\n  }\n}\n\n/* Call a userdata or cdata finalizer. */\nstatic void gc_call_finalizer(global_State *g, lua_State *L,\n\t\t\t      cTValue *mo, GCobj *o)\n{\n  /* Save and restore lots of state around the __gc callback. */\n  uint8_t oldh = hook_save(g);\n  MSize oldt = g->gc.threshold;\n  int errcode;\n  TValue *top;\n  lj_trace_abort(g);\n  top = L->top;\n  L->top = top+2;\n  hook_entergc(g);  /* Disable hooks and new traces during __gc. */\n  g->gc.threshold = LJ_MAX_MEM;  /* Prevent GC steps. */\n  copyTV(L, top, mo);\n  setgcV(L, top+1, o, ~o->gch.gct);\n  errcode = lj_vm_pcall(L, top+1, 1+0, -1);  /* Stack: |mo|o| -> | */\n  hook_restore(g, oldh);\n  g->gc.threshold = oldt;  /* Restore GC threshold. */\n  if (errcode)\n    lj_err_throw(L, errcode);  /* Propagate errors. */\n}\n\n/* Finalize one userdata or cdata object from the mmudata list. */\nstatic void gc_finalize(lua_State *L)\n{\n  global_State *g = G(L);\n  GCobj *o = gcnext(gcref(g->gc.mmudata));\n  cTValue *mo;\n  lua_assert(gcref(g->jit_L) == NULL);  /* Must not be called on trace. */\n  /* Unchain from list of userdata to be finalized. */\n  if (o == gcref(g->gc.mmudata))\n    setgcrefnull(g->gc.mmudata);\n  else\n    setgcrefr(gcref(g->gc.mmudata)->gch.nextgc, o->gch.nextgc);\n#if LJ_HASFFI\n  if (o->gch.gct == ~LJ_TCDATA) {\n    TValue tmp, *tv;\n    /* Add cdata back to the GC list and make it white. */\n    setgcrefr(o->gch.nextgc, g->gc.root);\n    setgcref(g->gc.root, o);\n    makewhite(g, o);\n    o->gch.marked &= (uint8_t)~LJ_GC_CDATA_FIN;\n    /* Resolve finalizer. */\n    setcdataV(L, &tmp, gco2cd(o));\n    tv = lj_tab_set(L, ctype_ctsG(g)->finalizer, &tmp);\n    if (!tvisnil(tv)) {\n      copyTV(L, &tmp, tv);\n      setnilV(tv);  /* Clear entry in finalizer table. */\n      gc_call_finalizer(g, L, &tmp, o);\n    }\n    return;\n  }\n#endif\n  /* Add userdata back to the main userdata list and make it white. */\n  setgcrefr(o->gch.nextgc, mainthread(g)->nextgc);\n  setgcref(mainthread(g)->nextgc, o);\n  makewhite(g, o);\n  /* Resolve the __gc metamethod. */\n  mo = lj_meta_fastg(g, tabref(gco2ud(o)->metatable), MM_gc);\n  if (mo)\n    gc_call_finalizer(g, L, mo, o);\n}\n\n/* Finalize all userdata objects from mmudata list. */\nvoid lj_gc_finalize_udata(lua_State *L)\n{\n  while (gcref(G(L)->gc.mmudata) != NULL)\n    gc_finalize(L);\n}\n\n#if LJ_HASFFI\n/* Finalize all cdata objects from finalizer table. */\nvoid lj_gc_finalize_cdata(lua_State *L)\n{\n  global_State *g = G(L);\n  CTState *cts = ctype_ctsG(g);\n  if (cts) {\n    GCtab *t = cts->finalizer;\n    Node *node = noderef(t->node);\n    ptrdiff_t i;\n    setgcrefnull(t->metatable);  /* Mark finalizer table as disabled. */\n    for (i = (ptrdiff_t)t->hmask; i >= 0; i--)\n      if (!tvisnil(&node[i].val) && tviscdata(&node[i].key)) {\n\tGCobj *o = gcV(&node[i].key);\n\tTValue tmp;\n\tmakewhite(g, o);\n\to->gch.marked &= (uint8_t)~LJ_GC_CDATA_FIN;\n\tcopyTV(L, &tmp, &node[i].val);\n\tsetnilV(&node[i].val);\n\tgc_call_finalizer(g, L, &tmp, o);\n      }\n  }\n}\n#endif\n\n/* Free all remaining GC objects. */\nvoid lj_gc_freeall(global_State *g)\n{\n  MSize i, strmask;\n  /* Free everything, except super-fixed objects (the main thread). */\n  g->gc.currentwhite = LJ_GC_WHITES | LJ_GC_SFIXED;\n  gc_fullsweep(g, &g->gc.root);\n  strmask = g->strmask;\n  for (i = 0; i <= strmask; i++)  /* Free all string hash chains. */\n    gc_fullsweep(g, &g->strhash[i]);\n}\n\n/* -- Collector ----------------------------------------------------------- */\n\n/* Atomic part of the GC cycle, transitioning from mark to sweep phase. */\nstatic void atomic(global_State *g, lua_State *L)\n{\n  size_t udsize;\n\n  gc_mark_uv(g);  /* Need to remark open upvalues (the thread may be dead). */\n  gc_propagate_gray(g);  /* Propagate any left-overs. */\n\n  setgcrefr(g->gc.gray, g->gc.weak);  /* Empty the list of weak tables. */\n  setgcrefnull(g->gc.weak);\n  lua_assert(!iswhite(obj2gco(mainthread(g))));\n  gc_markobj(g, L);  /* Mark running thread. */\n  gc_traverse_curtrace(g);  /* Traverse current trace. */\n  gc_mark_gcroot(g);  /* Mark GC roots (again). */\n  gc_propagate_gray(g);  /* Propagate all of the above. */\n\n  setgcrefr(g->gc.gray, g->gc.grayagain);  /* Empty the 2nd chance list. */\n  setgcrefnull(g->gc.grayagain);\n  gc_propagate_gray(g);  /* Propagate it. */\n\n  udsize = lj_gc_separateudata(g, 0);  /* Separate userdata to be finalized. */\n  gc_mark_mmudata(g);  /* Mark them. */\n  udsize += gc_propagate_gray(g);  /* And propagate the marks. */\n\n  /* All marking done, clear weak tables. */\n  gc_clearweak(gcref(g->gc.weak));\n\n  /* Prepare for sweep phase. */\n  g->gc.currentwhite = (uint8_t)otherwhite(g);  /* Flip current white. */\n  g->strempty.marked = g->gc.currentwhite;\n  setmref(g->gc.sweep, &g->gc.root);\n  g->gc.estimate = g->gc.total - (MSize)udsize;  /* Initial estimate. */\n}\n\n/* GC state machine. Returns a cost estimate for each step performed. */\nstatic size_t gc_onestep(lua_State *L)\n{\n  global_State *g = G(L);\n  switch (g->gc.state) {\n  case GCSpause:\n    gc_mark_start(g);  /* Start a new GC cycle by marking all GC roots. */\n    return 0;\n  case GCSpropagate:\n    if (gcref(g->gc.gray) != NULL)\n      return propagatemark(g);  /* Propagate one gray object. */\n    g->gc.state = GCSatomic;  /* End of mark phase. */\n    return 0;\n  case GCSatomic:\n    if (gcref(g->jit_L))  /* Don't run atomic phase on trace. */\n      return LJ_MAX_MEM;\n    atomic(g, L);\n    g->gc.state = GCSsweepstring;  /* Start of sweep phase. */\n    g->gc.sweepstr = 0;\n    return 0;\n  case GCSsweepstring: {\n    MSize old = g->gc.total;\n    gc_fullsweep(g, &g->strhash[g->gc.sweepstr++]);  /* Sweep one chain. */\n    if (g->gc.sweepstr > g->strmask)\n      g->gc.state = GCSsweep;  /* All string hash chains sweeped. */\n    lua_assert(old >= g->gc.total);\n    g->gc.estimate -= old - g->gc.total;\n    return GCSWEEPCOST;\n    }\n  case GCSsweep: {\n    MSize old = g->gc.total;\n    setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX));\n    if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) {\n      gc_shrink(g, L);\n      if (gcref(g->gc.mmudata)) {  /* Need any finalizations? */\n\tg->gc.state = GCSfinalize;\n      } else {  /* Otherwise skip this phase to help the JIT. */\n\tg->gc.state = GCSpause;  /* End of GC cycle. */\n\tg->gc.debt = 0;\n      }\n    }\n    lua_assert(old >= g->gc.total);\n    g->gc.estimate -= old - g->gc.total;\n    return GCSWEEPMAX*GCSWEEPCOST;\n    }\n  case GCSfinalize:\n    if (gcref(g->gc.mmudata) != NULL) {\n      if (gcref(g->jit_L))  /* Don't call finalizers on trace. */\n\treturn LJ_MAX_MEM;\n      gc_finalize(L);  /* Finalize one userdata object. */\n      if (g->gc.estimate > GCFINALIZECOST)\n\tg->gc.estimate -= GCFINALIZECOST;\n      return GCFINALIZECOST;\n    }\n    g->gc.state = GCSpause;  /* End of GC cycle. */\n    g->gc.debt = 0;\n    return 0;\n  default:\n    lua_assert(0);\n    return 0;\n  }\n}\n\n/* Perform a limited amount of incremental GC steps. */\nint LJ_FASTCALL lj_gc_step(lua_State *L)\n{\n  global_State *g = G(L);\n  MSize lim;\n  int32_t ostate = g->vmstate;\n  setvmstate(g, GC);\n  lim = (GCSTEPSIZE/100) * g->gc.stepmul;\n  if (lim == 0)\n    lim = LJ_MAX_MEM;\n  g->gc.debt += g->gc.total - g->gc.threshold;\n  do {\n    lim -= (MSize)gc_onestep(L);\n    if (g->gc.state == GCSpause) {\n      g->gc.threshold = (g->gc.estimate/100) * g->gc.pause;\n      g->vmstate = ostate;\n      return 1;  /* Finished a GC cycle. */\n    }\n  } while ((int32_t)lim > 0);\n  if (g->gc.debt < GCSTEPSIZE) {\n    g->gc.threshold = g->gc.total + GCSTEPSIZE;\n  } else {\n    g->gc.debt -= GCSTEPSIZE;\n    g->gc.threshold = g->gc.total;\n  }\n  g->vmstate = ostate;\n  return 0;\n}\n\n/* Ditto, but fix the stack top first. */\nvoid LJ_FASTCALL lj_gc_step_fixtop(lua_State *L)\n{\n  if (curr_funcisL(L)) L->top = curr_topL(L);\n  lj_gc_step(L);\n}\n\n#if LJ_HASJIT\n/* Perform multiple GC steps. Called from JIT-compiled code. */\nint LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps)\n{\n  lua_State *L = gco2th(gcref(g->jit_L));\n  L->base = mref(G(L)->jit_base, TValue);\n  L->top = curr_topL(L);\n  while (steps-- > 0 && lj_gc_step(L) == 0)\n    ;\n  /* Return 1 to force a trace exit. */\n  return (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize);\n}\n#endif\n\n/* Perform a full GC cycle. */\nvoid lj_gc_fullgc(lua_State *L)\n{\n  global_State *g = G(L);\n  int32_t ostate = g->vmstate;\n  setvmstate(g, GC);\n  if (g->gc.state <= GCSatomic) {  /* Caught somewhere in the middle. */\n    setmref(g->gc.sweep, &g->gc.root);  /* Sweep everything (preserving it). */\n    setgcrefnull(g->gc.gray);  /* Reset lists from partial propagation. */\n    setgcrefnull(g->gc.grayagain);\n    setgcrefnull(g->gc.weak);\n    g->gc.state = GCSsweepstring;  /* Fast forward to the sweep phase. */\n    g->gc.sweepstr = 0;\n  }\n  while (g->gc.state == GCSsweepstring || g->gc.state == GCSsweep)\n    gc_onestep(L);  /* Finish sweep. */\n  lua_assert(g->gc.state == GCSfinalize || g->gc.state == GCSpause);\n  /* Now perform a full GC. */\n  g->gc.state = GCSpause;\n  do { gc_onestep(L); } while (g->gc.state != GCSpause);\n  g->gc.threshold = (g->gc.estimate/100) * g->gc.pause;\n  g->vmstate = ostate;\n}\n\n/* -- Write barriers ------------------------------------------------------ */\n\n/* Move the GC propagation frontier forward. */\nvoid lj_gc_barrierf(global_State *g, GCobj *o, GCobj *v)\n{\n  lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o));\n  lua_assert(g->gc.state != GCSfinalize && g->gc.state != GCSpause);\n  lua_assert(o->gch.gct != ~LJ_TTAB);\n  /* Preserve invariant during propagation. Otherwise it doesn't matter. */\n  if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic)\n    gc_mark(g, v);  /* Move frontier forward. */\n  else\n    makewhite(g, o);  /* Make it white to avoid the following barrier. */\n}\n\n/* Specialized barrier for closed upvalue. Pass &uv->tv. */\nvoid LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv)\n{\n#define TV2MARKED(x) \\\n  (*((uint8_t *)(x) - offsetof(GCupval, tv) + offsetof(GCupval, marked)))\n  if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic)\n    gc_mark(g, gcV(tv));\n  else\n    TV2MARKED(tv) = (TV2MARKED(tv) & (uint8_t)~LJ_GC_COLORS) | curwhite(g);\n#undef TV2MARKED\n}\n\n/* Close upvalue. Also needs a write barrier. */\nvoid lj_gc_closeuv(global_State *g, GCupval *uv)\n{\n  GCobj *o = obj2gco(uv);\n  /* Copy stack slot to upvalue itself and point to the copy. */\n  copyTV(mainthread(g), &uv->tv, uvval(uv));\n  setmref(uv->v, &uv->tv);\n  uv->closed = 1;\n  setgcrefr(o->gch.nextgc, g->gc.root);\n  setgcref(g->gc.root, o);\n  if (isgray(o)) {  /* A closed upvalue is never gray, so fix this. */\n    if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic) {\n      gray2black(o);  /* Make it black and preserve invariant. */\n      if (tviswhite(&uv->tv))\n\tlj_gc_barrierf(g, o, gcV(&uv->tv));\n    } else {\n      makewhite(g, o);  /* Make it white, i.e. sweep the upvalue. */\n      lua_assert(g->gc.state != GCSfinalize && g->gc.state != GCSpause);\n    }\n  }\n}\n\n#if LJ_HASJIT\n/* Mark a trace if it's saved during the propagation phase. */\nvoid lj_gc_barriertrace(global_State *g, uint32_t traceno)\n{\n  if (g->gc.state == GCSpropagate || g->gc.state == GCSatomic)\n    gc_marktrace(g, traceno);\n}\n#endif\n\n/* -- Allocator ----------------------------------------------------------- */\n\n/* Call pluggable memory allocator to allocate or resize a fragment. */\nvoid *lj_mem_realloc(lua_State *L, void *p, MSize osz, MSize nsz)\n{\n  global_State *g = G(L);\n  lua_assert((osz == 0) == (p == NULL));\n  p = g->allocf(g->allocd, p, osz, nsz);\n  if (p == NULL && nsz > 0)\n    lj_err_mem(L);\n  lua_assert((nsz == 0) == (p == NULL));\n  lua_assert(checkptr32(p));\n  g->gc.total = (g->gc.total - osz) + nsz;\n  return p;\n}\n\n/* Allocate new GC object and link it to the root set. */\nvoid * LJ_FASTCALL lj_mem_newgco(lua_State *L, MSize size)\n{\n  global_State *g = G(L);\n  GCobj *o = (GCobj *)g->allocf(g->allocd, NULL, 0, size);\n  if (o == NULL)\n    lj_err_mem(L);\n  lua_assert(checkptr32(o));\n  g->gc.total += size;\n  setgcrefr(o->gch.nextgc, g->gc.root);\n  setgcref(g->gc.root, o);\n  newwhite(g, o);\n  return o;\n}\n\n/* Resize growable vector. */\nvoid *lj_mem_grow(lua_State *L, void *p, MSize *szp, MSize lim, MSize esz)\n{\n  MSize sz = (*szp) << 1;\n  if (sz < LJ_MIN_VECSZ)\n    sz = LJ_MIN_VECSZ;\n  if (sz > lim)\n    sz = lim;\n  p = lj_mem_realloc(L, p, (*szp)*esz, sz*esz);\n  *szp = sz;\n  return p;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_gc.h",
    "content": "/*\n** Garbage collector.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_GC_H\n#define _LJ_GC_H\n\n#include \"lj_obj.h\"\n\n/* Garbage collector states. Order matters. */\nenum {\n  GCSpause, GCSpropagate, GCSatomic, GCSsweepstring, GCSsweep, GCSfinalize\n};\n\n/* Bitmasks for marked field of GCobj. */\n#define LJ_GC_WHITE0\t0x01\n#define LJ_GC_WHITE1\t0x02\n#define LJ_GC_BLACK\t0x04\n#define LJ_GC_FINALIZED\t0x08\n#define LJ_GC_WEAKKEY\t0x08\n#define LJ_GC_WEAKVAL\t0x10\n#define LJ_GC_CDATA_FIN\t0x10\n#define LJ_GC_FIXED\t0x20\n#define LJ_GC_SFIXED\t0x40\n\n#define LJ_GC_WHITES\t(LJ_GC_WHITE0 | LJ_GC_WHITE1)\n#define LJ_GC_COLORS\t(LJ_GC_WHITES | LJ_GC_BLACK)\n#define LJ_GC_WEAK\t(LJ_GC_WEAKKEY | LJ_GC_WEAKVAL)\n\n/* Macros to test and set GCobj colors. */\n#define iswhite(x)\t((x)->gch.marked & LJ_GC_WHITES)\n#define isblack(x)\t((x)->gch.marked & LJ_GC_BLACK)\n#define isgray(x)\t(!((x)->gch.marked & (LJ_GC_BLACK|LJ_GC_WHITES)))\n#define tviswhite(x)\t(tvisgcv(x) && iswhite(gcV(x)))\n#define otherwhite(g)\t(g->gc.currentwhite ^ LJ_GC_WHITES)\n#define isdead(g, v)\t((v)->gch.marked & otherwhite(g) & LJ_GC_WHITES)\n\n#define curwhite(g)\t((g)->gc.currentwhite & LJ_GC_WHITES)\n#define newwhite(g, x)\t(obj2gco(x)->gch.marked = (uint8_t)curwhite(g))\n#define makewhite(g, x) \\\n  ((x)->gch.marked = ((x)->gch.marked & (uint8_t)~LJ_GC_COLORS) | curwhite(g))\n#define flipwhite(x)\t((x)->gch.marked ^= LJ_GC_WHITES)\n#define black2gray(x)\t((x)->gch.marked &= (uint8_t)~LJ_GC_BLACK)\n#define fixstring(s)\t((s)->marked |= LJ_GC_FIXED)\n#define markfinalized(x)\t((x)->gch.marked |= LJ_GC_FINALIZED)\n\n/* Collector. */\nLJ_FUNC size_t lj_gc_separateudata(global_State *g, int all);\nLJ_FUNC void lj_gc_finalize_udata(lua_State *L);\n#if LJ_HASFFI\nLJ_FUNC void lj_gc_finalize_cdata(lua_State *L);\n#else\n#define lj_gc_finalize_cdata(L)\t\tUNUSED(L)\n#endif\nLJ_FUNC void lj_gc_freeall(global_State *g);\nLJ_FUNCA int LJ_FASTCALL lj_gc_step(lua_State *L);\nLJ_FUNCA void LJ_FASTCALL lj_gc_step_fixtop(lua_State *L);\n#if LJ_HASJIT\nLJ_FUNC int LJ_FASTCALL lj_gc_step_jit(global_State *g, MSize steps);\n#endif\nLJ_FUNC void lj_gc_fullgc(lua_State *L);\n\n/* GC check: drive collector forward if the GC threshold has been reached. */\n#define lj_gc_check(L) \\\n  { if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) \\\n      lj_gc_step(L); }\n#define lj_gc_check_fixtop(L) \\\n  { if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) \\\n      lj_gc_step_fixtop(L); }\n\n/* Write barriers. */\nLJ_FUNC void lj_gc_barrierf(global_State *g, GCobj *o, GCobj *v);\nLJ_FUNCA void LJ_FASTCALL lj_gc_barrieruv(global_State *g, TValue *tv);\nLJ_FUNC void lj_gc_closeuv(global_State *g, GCupval *uv);\n#if LJ_HASJIT\nLJ_FUNC void lj_gc_barriertrace(global_State *g, uint32_t traceno);\n#endif\n\n/* Move the GC propagation frontier back for tables (make it gray again). */\nstatic LJ_AINLINE void lj_gc_barrierback(global_State *g, GCtab *t)\n{\n  GCobj *o = obj2gco(t);\n  lua_assert(isblack(o) && !isdead(g, o));\n  lua_assert(g->gc.state != GCSfinalize && g->gc.state != GCSpause);\n  black2gray(o);\n  setgcrefr(t->gclist, g->gc.grayagain);\n  setgcref(g->gc.grayagain, o);\n}\n\n/* Barrier for stores to table objects. TValue and GCobj variant. */\n#define lj_gc_anybarriert(L, t)  \\\n  { if (LJ_UNLIKELY(isblack(obj2gco(t)))) lj_gc_barrierback(G(L), (t)); }\n#define lj_gc_barriert(L, t, tv) \\\n  { if (tviswhite(tv) && isblack(obj2gco(t))) \\\n      lj_gc_barrierback(G(L), (t)); }\n#define lj_gc_objbarriert(L, t, o)  \\\n  { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) \\\n      lj_gc_barrierback(G(L), (t)); }\n\n/* Barrier for stores to any other object. TValue and GCobj variant. */\n#define lj_gc_barrier(L, p, tv) \\\n  { if (tviswhite(tv) && isblack(obj2gco(p))) \\\n      lj_gc_barrierf(G(L), obj2gco(p), gcV(tv)); }\n#define lj_gc_objbarrier(L, p, o) \\\n  { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \\\n      lj_gc_barrierf(G(L), obj2gco(p), obj2gco(o)); }\n\n/* Allocator. */\nLJ_FUNC void *lj_mem_realloc(lua_State *L, void *p, MSize osz, MSize nsz);\nLJ_FUNC void * LJ_FASTCALL lj_mem_newgco(lua_State *L, MSize size);\nLJ_FUNC void *lj_mem_grow(lua_State *L, void *p,\n\t\t\t  MSize *szp, MSize lim, MSize esz);\n\n#define lj_mem_new(L, s)\tlj_mem_realloc(L, NULL, 0, (s))\n\nstatic LJ_AINLINE void lj_mem_free(global_State *g, void *p, size_t osize)\n{\n  g->gc.total -= (MSize)osize;\n  g->allocf(g->allocd, p, osize, 0);\n}\n\n#define lj_mem_newvec(L, n, t)\t((t *)lj_mem_new(L, (MSize)((n)*sizeof(t))))\n#define lj_mem_reallocvec(L, p, on, n, t) \\\n  ((p) = (t *)lj_mem_realloc(L, p, (on)*sizeof(t), (MSize)((n)*sizeof(t))))\n#define lj_mem_growvec(L, p, n, m, t) \\\n  ((p) = (t *)lj_mem_grow(L, (p), &(n), (m), (MSize)sizeof(t)))\n#define lj_mem_freevec(g, p, n, t)\tlj_mem_free(g, (p), (n)*sizeof(t))\n\n#define lj_mem_newobj(L, t)\t((t *)lj_mem_newgco(L, sizeof(t)))\n#define lj_mem_newt(L, s, t)\t((t *)lj_mem_new(L, (s)))\n#define lj_mem_freet(g, p)\tlj_mem_free(g, (p), sizeof(*(p)))\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_gdbjit.c",
    "content": "/*\n** Client for the GDB JIT API.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_gdbjit_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_frame.h\"\n#include \"lj_jit.h\"\n#include \"lj_dispatch.h\"\n\n/* This is not compiled in by default.\n** Enable with -DLUAJIT_USE_GDBJIT in the Makefile and recompile everything.\n*/\n#ifdef LUAJIT_USE_GDBJIT\n\n/* The GDB JIT API allows JIT compilers to pass debug information about\n** JIT-compiled code back to GDB. You need at least GDB 7.0 or higher\n** to see it in action.\n**\n** This is a passive API, so it works even when not running under GDB\n** or when attaching to an already running process. Alas, this implies\n** enabling it always has a non-negligible overhead -- do not use in\n** release mode!\n**\n** The LuaJIT GDB JIT client is rather minimal at the moment. It gives\n** each trace a symbol name and adds a source location and frame unwind\n** information. Obviously LuaJIT itself and any embedding C application\n** should be compiled with debug symbols, too (see the Makefile).\n**\n** Traces are named TRACE_1, TRACE_2, ... these correspond to the trace\n** numbers from -jv or -jdump. Use \"break TRACE_1\" or \"tbreak TRACE_1\" etc.\n** to set breakpoints on specific traces (even ahead of their creation).\n**\n** The source location for each trace allows listing the corresponding\n** source lines with the GDB command \"list\" (but only if the Lua source\n** has been loaded from a file). Currently this is always set to the\n** location where the trace has been started.\n**\n** Frame unwind information can be inspected with the GDB command\n** \"info frame\". This also allows proper backtraces across JIT-compiled\n** code with the GDB command \"bt\".\n**\n** You probably want to add the following settings to a .gdbinit file\n** (or add them to ~/.gdbinit):\n**   set disassembly-flavor intel\n**   set breakpoint pending on\n**\n** Here's a sample GDB session:\n** ------------------------------------------------------------------------\n\n$ cat >x.lua\nfor outer=1,100 do\n  for inner=1,100 do end\nend\n^D\n\n$ luajit -jv x.lua\n[TRACE   1 x.lua:2]\n[TRACE   2 (1/3) x.lua:1 -> 1]\n\n$ gdb --quiet --args luajit x.lua\n(gdb) tbreak TRACE_1\nFunction \"TRACE_1\" not defined.\nTemporary breakpoint 1 (TRACE_1) pending.\n(gdb) run\nStarting program: luajit x.lua\n\nTemporary breakpoint 1, TRACE_1 () at x.lua:2\n2\t  for inner=1,100 do end\n(gdb) list\n1\tfor outer=1,100 do\n2\t  for inner=1,100 do end\n3\tend\n(gdb) bt\n#0  TRACE_1 () at x.lua:2\n#1  0x08053690 in lua_pcall [...]\n[...]\n#7  0x0806ff90 in main [...]\n(gdb) disass TRACE_1\nDump of assembler code for function TRACE_1:\n0xf7fd9fba <TRACE_1+0>:\tmov    DWORD PTR ds:0xf7e0e2a0,0x1\n0xf7fd9fc4 <TRACE_1+10>:\tmovsd  xmm7,QWORD PTR [edx+0x20]\n[...]\n0xf7fd9ff8 <TRACE_1+62>:\tjmp    0xf7fd2014\nEnd of assembler dump.\n(gdb) tbreak TRACE_2\nFunction \"TRACE_2\" not defined.\nTemporary breakpoint 2 (TRACE_2) pending.\n(gdb) cont\nContinuing.\n\nTemporary breakpoint 2, TRACE_2 () at x.lua:1\n1\tfor outer=1,100 do\n(gdb) info frame\nStack level 0, frame at 0xffffd7c0:\n eip = 0xf7fd9f60 in TRACE_2 (x.lua:1); saved eip 0x8053690\n called by frame at 0xffffd7e0\n source language unknown.\n Arglist at 0xffffd78c, args:\n Locals at 0xffffd78c, Previous frame's sp is 0xffffd7c0\n Saved registers:\n  ebx at 0xffffd7ac, ebp at 0xffffd7b8, esi at 0xffffd7b0, edi at 0xffffd7b4,\n  eip at 0xffffd7bc\n(gdb)\n\n** ------------------------------------------------------------------------\n*/\n\n/* -- GDB JIT API --------------------------------------------------------- */\n\n/* GDB JIT actions. */\nenum {\n  GDBJIT_NOACTION = 0,\n  GDBJIT_REGISTER,\n  GDBJIT_UNREGISTER\n};\n\n/* GDB JIT entry. */\ntypedef struct GDBJITentry {\n  struct GDBJITentry *next_entry;\n  struct GDBJITentry *prev_entry;\n  const char *symfile_addr;\n  uint64_t symfile_size;\n} GDBJITentry;\n\n/* GDB JIT descriptor. */\ntypedef struct GDBJITdesc {\n  uint32_t version;\n  uint32_t action_flag;\n  GDBJITentry *relevant_entry;\n  GDBJITentry *first_entry;\n} GDBJITdesc;\n\nGDBJITdesc __jit_debug_descriptor = {\n  1, GDBJIT_NOACTION, NULL, NULL\n};\n\n/* GDB sets a breakpoint at this function. */\nvoid LJ_NOINLINE __jit_debug_register_code()\n{\n  __asm__ __volatile__(\"\");\n};\n\n/* -- In-memory ELF object definitions ------------------------------------ */\n\n/* ELF definitions. */\ntypedef struct ELFheader {\n  uint8_t emagic[4];\n  uint8_t eclass;\n  uint8_t eendian;\n  uint8_t eversion;\n  uint8_t eosabi;\n  uint8_t eabiversion;\n  uint8_t epad[7];\n  uint16_t type;\n  uint16_t machine;\n  uint32_t version;\n  uintptr_t entry;\n  uintptr_t phofs;\n  uintptr_t shofs;\n  uint32_t flags;\n  uint16_t ehsize;\n  uint16_t phentsize;\n  uint16_t phnum;\n  uint16_t shentsize;\n  uint16_t shnum;\n  uint16_t shstridx;\n} ELFheader;\n\ntypedef struct ELFsectheader {\n  uint32_t name;\n  uint32_t type;\n  uintptr_t flags;\n  uintptr_t addr;\n  uintptr_t ofs;\n  uintptr_t size;\n  uint32_t link;\n  uint32_t info;\n  uintptr_t align;\n  uintptr_t entsize;\n} ELFsectheader;\n\n#define ELFSECT_IDX_ABS\t\t0xfff1\n\nenum {\n  ELFSECT_TYPE_PROGBITS = 1,\n  ELFSECT_TYPE_SYMTAB = 2,\n  ELFSECT_TYPE_STRTAB = 3,\n  ELFSECT_TYPE_NOBITS = 8\n};\n\n#define ELFSECT_FLAGS_WRITE\t1\n#define ELFSECT_FLAGS_ALLOC\t2\n#define ELFSECT_FLAGS_EXEC\t4\n\ntypedef struct ELFsymbol {\n#if LJ_64\n  uint32_t name;\n  uint8_t info;\n  uint8_t other;\n  uint16_t sectidx;\n  uintptr_t value;\n  uint64_t size;\n#else\n  uint32_t name;\n  uintptr_t value;\n  uint32_t size;\n  uint8_t info;\n  uint8_t other;\n  uint16_t sectidx;\n#endif\n} ELFsymbol;\n\nenum {\n  ELFSYM_TYPE_FUNC = 2,\n  ELFSYM_TYPE_FILE = 4,\n  ELFSYM_BIND_LOCAL = 0 << 4,\n  ELFSYM_BIND_GLOBAL = 1 << 4,\n};\n\n/* DWARF definitions. */\n#define DW_CIE_VERSION\t1\n\nenum {\n  DW_CFA_nop = 0x0,\n  DW_CFA_offset_extended = 0x5,\n  DW_CFA_def_cfa = 0xc,\n  DW_CFA_def_cfa_offset = 0xe,\n  DW_CFA_offset_extended_sf = 0x11,\n  DW_CFA_advance_loc = 0x40,\n  DW_CFA_offset = 0x80\n};\n\nenum {\n  DW_EH_PE_udata4 = 3,\n  DW_EH_PE_textrel = 0x20\n};\n\nenum {\n  DW_TAG_compile_unit = 0x11\n};\n\nenum {\n  DW_children_no = 0,\n  DW_children_yes = 1\n};\n\nenum {\n  DW_AT_name = 0x03,\n  DW_AT_stmt_list = 0x10,\n  DW_AT_low_pc = 0x11,\n  DW_AT_high_pc = 0x12\n};\n\nenum {\n  DW_FORM_addr = 0x01,\n  DW_FORM_data4 = 0x06,\n  DW_FORM_string = 0x08\n};\n\nenum {\n  DW_LNS_extended_op = 0,\n  DW_LNS_copy = 1,\n  DW_LNS_advance_pc = 2,\n  DW_LNS_advance_line = 3\n};\n\nenum {\n  DW_LNE_end_sequence = 1,\n  DW_LNE_set_address = 2\n};\n\nenum {\n#if LJ_TARGET_X86\n  DW_REG_AX, DW_REG_CX, DW_REG_DX, DW_REG_BX,\n  DW_REG_SP, DW_REG_BP, DW_REG_SI, DW_REG_DI,\n  DW_REG_RA,\n#elif LJ_TARGET_X64\n  /* Yes, the order is strange, but correct. */\n  DW_REG_AX, DW_REG_DX, DW_REG_CX, DW_REG_BX,\n  DW_REG_SI, DW_REG_DI, DW_REG_BP, DW_REG_SP,\n  DW_REG_8, DW_REG_9, DW_REG_10, DW_REG_11,\n  DW_REG_12, DW_REG_13, DW_REG_14, DW_REG_15,\n  DW_REG_RA,\n#elif LJ_TARGET_ARM\n  DW_REG_SP = 13,\n  DW_REG_RA = 14,\n#elif LJ_TARGET_PPC\n  DW_REG_SP = 1,\n  DW_REG_RA = 65,\n  DW_REG_CR = 70,\n#elif LJ_TARGET_MIPS\n  DW_REG_SP = 29,\n  DW_REG_RA = 31,\n#else\n#error \"Unsupported target architecture\"\n#endif\n};\n\n/* Minimal list of sections for the in-memory ELF object. */\nenum {\n  GDBJIT_SECT_NULL,\n  GDBJIT_SECT_text,\n  GDBJIT_SECT_eh_frame,\n  GDBJIT_SECT_shstrtab,\n  GDBJIT_SECT_strtab,\n  GDBJIT_SECT_symtab,\n  GDBJIT_SECT_debug_info,\n  GDBJIT_SECT_debug_abbrev,\n  GDBJIT_SECT_debug_line,\n  GDBJIT_SECT__MAX\n};\n\nenum {\n  GDBJIT_SYM_UNDEF,\n  GDBJIT_SYM_FILE,\n  GDBJIT_SYM_FUNC,\n  GDBJIT_SYM__MAX\n};\n\n/* In-memory ELF object. */\ntypedef struct GDBJITobj {\n  ELFheader hdr;\t\t\t/* ELF header. */\n  ELFsectheader sect[GDBJIT_SECT__MAX];\t/* ELF sections. */\n  ELFsymbol sym[GDBJIT_SYM__MAX];\t/* ELF symbol table. */\n  uint8_t space[4096];\t\t\t/* Space for various section data. */\n} GDBJITobj;\n\n/* Combined structure for GDB JIT entry and ELF object. */\ntypedef struct GDBJITentryobj {\n  GDBJITentry entry;\n  size_t sz;\n  GDBJITobj obj;\n} GDBJITentryobj;\n\n/* Template for in-memory ELF header. */\nstatic const ELFheader elfhdr_template = {\n  .emagic = { 0x7f, 'E', 'L', 'F' },\n  .eclass = LJ_64 ? 2 : 1,\n  .eendian = LJ_ENDIAN_SELECT(1, 2),\n  .eversion = 1,\n#if LJ_TARGET_LINUX\n  .eosabi = 0,  /* Nope, it's not 3. */\n#elif defined(__FreeBSD__)\n  .eosabi = 9,\n#elif defined(__NetBSD__)\n  .eosabi = 2,\n#elif defined(__OpenBSD__)\n  .eosabi = 12,\n#elif (defined(__sun__) && defined(__svr4__))\n  .eosabi = 6,\n#else\n  .eosabi = 0,\n#endif\n  .eabiversion = 0,\n  .epad = { 0, 0, 0, 0, 0, 0, 0 },\n  .type = 1,\n#if LJ_TARGET_X86\n  .machine = 3,\n#elif LJ_TARGET_X64\n  .machine = 62,\n#elif LJ_TARGET_ARM\n  .machine = 40,\n#elif LJ_TARGET_PPC\n  .machine = 20,\n#elif LJ_TARGET_MIPS\n  .machine = 8,\n#else\n#error \"Unsupported target architecture\"\n#endif\n  .version = 1,\n  .entry = 0,\n  .phofs = 0,\n  .shofs = offsetof(GDBJITobj, sect),\n  .flags = 0,\n  .ehsize = sizeof(ELFheader),\n  .phentsize = 0,\n  .phnum = 0,\n  .shentsize = sizeof(ELFsectheader),\n  .shnum = GDBJIT_SECT__MAX,\n  .shstridx = GDBJIT_SECT_shstrtab\n};\n\n/* -- In-memory ELF object generation ------------------------------------- */\n\n/* Context for generating the ELF object for the GDB JIT API. */\ntypedef struct GDBJITctx {\n  uint8_t *p;\t\t/* Pointer to next address in obj.space. */\n  uint8_t *startp;\t/* Pointer to start address in obj.space. */\n  GCtrace *T;\t\t/* Generate symbols for this trace. */\n  uintptr_t mcaddr;\t/* Machine code address. */\n  MSize szmcode;\t/* Size of machine code. */\n  MSize spadjp;\t\t/* Stack adjustment for parent trace or interpreter. */\n  MSize spadj;\t\t/* Stack adjustment for trace itself. */\n  BCLine lineno;\t/* Starting line number. */\n  const char *filename;\t/* Starting file name. */\n  size_t objsize;\t/* Final size of ELF object. */\n  GDBJITobj obj;\t/* In-memory ELF object. */\n} GDBJITctx;\n\n/* Add a zero-terminated string. */\nstatic uint32_t gdbjit_strz(GDBJITctx *ctx, const char *str)\n{\n  uint8_t *p = ctx->p;\n  uint32_t ofs = (uint32_t)(p - ctx->startp);\n  do {\n    *p++ = (uint8_t)*str;\n  } while (*str++);\n  ctx->p = p;\n  return ofs;\n}\n\n/* Append a decimal number. */\nstatic void gdbjit_catnum(GDBJITctx *ctx, uint32_t n)\n{\n  if (n >= 10) { uint32_t m = n / 10; n = n % 10; gdbjit_catnum(ctx, m); }\n  *ctx->p++ = '0' + n;\n}\n\n/* Add a ULEB128 value. */\nstatic void gdbjit_uleb128(GDBJITctx *ctx, uint32_t v)\n{\n  uint8_t *p = ctx->p;\n  for (; v >= 0x80; v >>= 7)\n    *p++ = (uint8_t)((v & 0x7f) | 0x80);\n  *p++ = (uint8_t)v;\n  ctx->p = p;\n}\n\n/* Add a SLEB128 value. */\nstatic void gdbjit_sleb128(GDBJITctx *ctx, int32_t v)\n{\n  uint8_t *p = ctx->p;\n  for (; (uint32_t)(v+0x40) >= 0x80; v >>= 7)\n    *p++ = (uint8_t)((v & 0x7f) | 0x80);\n  *p++ = (uint8_t)(v & 0x7f);\n  ctx->p = p;\n}\n\n/* Shortcuts to generate DWARF structures. */\n#define DB(x)\t\t(*p++ = (x))\n#define DI8(x)\t\t(*(int8_t *)p = (x), p++)\n#define DU16(x)\t\t(*(uint16_t *)p = (x), p += 2)\n#define DU32(x)\t\t(*(uint32_t *)p = (x), p += 4)\n#define DADDR(x)\t(*(uintptr_t *)p = (x), p += sizeof(uintptr_t))\n#define DUV(x)\t\t(ctx->p = p, gdbjit_uleb128(ctx, (x)), p = ctx->p)\n#define DSV(x)\t\t(ctx->p = p, gdbjit_sleb128(ctx, (x)), p = ctx->p)\n#define DSTR(str)\t(ctx->p = p, gdbjit_strz(ctx, (str)), p = ctx->p)\n#define DALIGNNOP(s)\twhile ((uintptr_t)p & ((s)-1)) *p++ = DW_CFA_nop\n#define DSECT(name, stmt) \\\n  { uint32_t *szp_##name = (uint32_t *)p; p += 4; stmt \\\n    *szp_##name = (uint32_t)((p-(uint8_t *)szp_##name)-4); } \\\n\n/* Initialize ELF section headers. */\nstatic void LJ_FASTCALL gdbjit_secthdr(GDBJITctx *ctx)\n{\n  ELFsectheader *sect;\n\n  *ctx->p++ = '\\0';  /* Empty string at start of string table. */\n\n#define SECTDEF(id, tp, al) \\\n  sect = &ctx->obj.sect[GDBJIT_SECT_##id]; \\\n  sect->name = gdbjit_strz(ctx, \".\" #id); \\\n  sect->type = ELFSECT_TYPE_##tp; \\\n  sect->align = (al)\n\n  SECTDEF(text, NOBITS, 16);\n  sect->flags = ELFSECT_FLAGS_ALLOC|ELFSECT_FLAGS_EXEC;\n  sect->addr = ctx->mcaddr;\n  sect->ofs = 0;\n  sect->size = ctx->szmcode;\n\n  SECTDEF(eh_frame, PROGBITS, sizeof(uintptr_t));\n  sect->flags = ELFSECT_FLAGS_ALLOC;\n\n  SECTDEF(shstrtab, STRTAB, 1);\n  SECTDEF(strtab, STRTAB, 1);\n\n  SECTDEF(symtab, SYMTAB, sizeof(uintptr_t));\n  sect->ofs = offsetof(GDBJITobj, sym);\n  sect->size = sizeof(ctx->obj.sym);\n  sect->link = GDBJIT_SECT_strtab;\n  sect->entsize = sizeof(ELFsymbol);\n  sect->info = GDBJIT_SYM_FUNC;\n\n  SECTDEF(debug_info, PROGBITS, 1);\n  SECTDEF(debug_abbrev, PROGBITS, 1);\n  SECTDEF(debug_line, PROGBITS, 1);\n\n#undef SECTDEF\n}\n\n/* Initialize symbol table. */\nstatic void LJ_FASTCALL gdbjit_symtab(GDBJITctx *ctx)\n{\n  ELFsymbol *sym;\n\n  *ctx->p++ = '\\0';  /* Empty string at start of string table. */\n\n  sym = &ctx->obj.sym[GDBJIT_SYM_FILE];\n  sym->name = gdbjit_strz(ctx, \"JIT mcode\");\n  sym->sectidx = ELFSECT_IDX_ABS;\n  sym->info = ELFSYM_TYPE_FILE|ELFSYM_BIND_LOCAL;\n\n  sym = &ctx->obj.sym[GDBJIT_SYM_FUNC];\n  sym->name = gdbjit_strz(ctx, \"TRACE_\"); ctx->p--;\n  gdbjit_catnum(ctx, ctx->T->traceno); *ctx->p++ = '\\0';\n  sym->sectidx = GDBJIT_SECT_text;\n  sym->value = 0;\n  sym->size = ctx->szmcode;\n  sym->info = ELFSYM_TYPE_FUNC|ELFSYM_BIND_GLOBAL;\n}\n\n/* Initialize .eh_frame section. */\nstatic void LJ_FASTCALL gdbjit_ehframe(GDBJITctx *ctx)\n{\n  uint8_t *p = ctx->p;\n  uint8_t *framep = p;\n\n  /* Emit DWARF EH CIE. */\n  DSECT(CIE,\n    DU32(0);\t\t\t/* Offset to CIE itself. */\n    DB(DW_CIE_VERSION);\n    DSTR(\"zR\");\t\t\t/* Augmentation. */\n    DUV(1);\t\t\t/* Code alignment factor. */\n    DSV(-(int32_t)sizeof(uintptr_t));  /* Data alignment factor. */\n    DB(DW_REG_RA);\t\t/* Return address register. */\n    DB(1); DB(DW_EH_PE_textrel|DW_EH_PE_udata4);  /* Augmentation data. */\n    DB(DW_CFA_def_cfa); DUV(DW_REG_SP); DUV(sizeof(uintptr_t));\n#if LJ_TARGET_PPC\n    DB(DW_CFA_offset_extended_sf); DB(DW_REG_RA); DSV(-1);\n#else\n    DB(DW_CFA_offset|DW_REG_RA); DUV(1);\n#endif\n    DALIGNNOP(sizeof(uintptr_t));\n  )\n\n  /* Emit DWARF EH FDE. */\n  DSECT(FDE,\n    DU32((uint32_t)(p-framep));\t/* Offset to CIE. */\n    DU32(0);\t\t\t/* Machine code offset relative to .text. */\n    DU32(ctx->szmcode);\t\t/* Machine code length. */\n    DB(0);\t\t\t/* Augmentation data. */\n    /* Registers saved in CFRAME. */\n#if LJ_TARGET_X86\n    DB(DW_CFA_offset|DW_REG_BP); DUV(2);\n    DB(DW_CFA_offset|DW_REG_DI); DUV(3);\n    DB(DW_CFA_offset|DW_REG_SI); DUV(4);\n    DB(DW_CFA_offset|DW_REG_BX); DUV(5);\n#elif LJ_TARGET_X64\n    DB(DW_CFA_offset|DW_REG_BP); DUV(2);\n    DB(DW_CFA_offset|DW_REG_BX); DUV(3);\n    DB(DW_CFA_offset|DW_REG_15); DUV(4);\n    DB(DW_CFA_offset|DW_REG_14); DUV(5);\n    /* Extra registers saved for JIT-compiled code. */\n    DB(DW_CFA_offset|DW_REG_13); DUV(9);\n    DB(DW_CFA_offset|DW_REG_12); DUV(10);\n#elif LJ_TARGET_ARM\n    {\n      int i;\n      for (i = 11; i >= 4; i--) { DB(DW_CFA_offset|i); DUV(2+(11-i)); }\n    }\n#elif LJ_TARGET_PPC\n    {\n      int i;\n      DB(DW_CFA_offset_extended); DB(DW_REG_CR); DUV(55);\n      for (i = 14; i <= 31; i++) {\n\tDB(DW_CFA_offset|i); DUV(37+(31-i));\n\tDB(DW_CFA_offset|32|i); DUV(2+2*(31-i));\n      }\n    }\n#elif LJ_TARGET_MIPS\n    {\n      int i;\n      DB(DW_CFA_offset|30); DUV(2);\n      for (i = 23; i >= 16; i--) { DB(DW_CFA_offset|i); DUV(26-i); }\n      for (i = 30; i >= 20; i -= 2) { DB(DW_CFA_offset|32|i); DUV(42-i); }\n    }\n#else\n#error \"Unsupported target architecture\"\n#endif\n    if (ctx->spadjp != ctx->spadj) {  /* Parent/interpreter stack frame size. */\n      DB(DW_CFA_def_cfa_offset); DUV(ctx->spadjp);\n      DB(DW_CFA_advance_loc|1);  /* Only an approximation. */\n    }\n    DB(DW_CFA_def_cfa_offset); DUV(ctx->spadj);  /* Trace stack frame size. */\n    DALIGNNOP(sizeof(uintptr_t));\n  )\n\n  ctx->p = p;\n}\n\n/* Initialize .debug_info section. */\nstatic void LJ_FASTCALL gdbjit_debuginfo(GDBJITctx *ctx)\n{\n  uint8_t *p = ctx->p;\n\n  DSECT(info,\n    DU16(2);\t\t\t/* DWARF version. */\n    DU32(0);\t\t\t/* Abbrev offset. */\n    DB(sizeof(uintptr_t));\t/* Pointer size. */\n\n    DUV(1);\t\t\t/* Abbrev #1: DW_TAG_compile_unit. */\n    DSTR(ctx->filename);\t/* DW_AT_name. */\n    DADDR(ctx->mcaddr);\t\t/* DW_AT_low_pc. */\n    DADDR(ctx->mcaddr + ctx->szmcode);  /* DW_AT_high_pc. */\n    DU32(0);\t\t\t/* DW_AT_stmt_list. */\n  )\n\n  ctx->p = p;\n}\n\n/* Initialize .debug_abbrev section. */\nstatic void LJ_FASTCALL gdbjit_debugabbrev(GDBJITctx *ctx)\n{\n  uint8_t *p = ctx->p;\n\n  /* Abbrev #1: DW_TAG_compile_unit. */\n  DUV(1); DUV(DW_TAG_compile_unit);\n  DB(DW_children_no);\n  DUV(DW_AT_name);\tDUV(DW_FORM_string);\n  DUV(DW_AT_low_pc);\tDUV(DW_FORM_addr);\n  DUV(DW_AT_high_pc);\tDUV(DW_FORM_addr);\n  DUV(DW_AT_stmt_list);\tDUV(DW_FORM_data4);\n  DB(0); DB(0);\n\n  ctx->p = p;\n}\n\n#define DLNE(op, s)\t(DB(DW_LNS_extended_op), DUV(1+(s)), DB((op)))\n\n/* Initialize .debug_line section. */\nstatic void LJ_FASTCALL gdbjit_debugline(GDBJITctx *ctx)\n{\n  uint8_t *p = ctx->p;\n\n  DSECT(line,\n    DU16(2);\t\t\t/* DWARF version. */\n    DSECT(header,\n      DB(1);\t\t\t/* Minimum instruction length. */\n      DB(1);\t\t\t/* is_stmt. */\n      DI8(0);\t\t\t/* Line base for special opcodes. */\n      DB(2);\t\t\t/* Line range for special opcodes. */\n      DB(3+1);\t\t\t/* Opcode base at DW_LNS_advance_line+1. */\n      DB(0); DB(1); DB(1);\t/* Standard opcode lengths. */\n      /* Directory table. */\n      DB(0);\n      /* File name table. */\n      DSTR(ctx->filename); DUV(0); DUV(0); DUV(0);\n      DB(0);\n    )\n\n    DLNE(DW_LNE_set_address, sizeof(uintptr_t)); DADDR(ctx->mcaddr);\n    if (ctx->lineno) {\n      DB(DW_LNS_advance_line); DSV(ctx->lineno-1);\n    }\n    DB(DW_LNS_copy);\n    DB(DW_LNS_advance_pc); DUV(ctx->szmcode);\n    DLNE(DW_LNE_end_sequence, 0);\n  )\n\n  ctx->p = p;\n}\n\n#undef DLNE\n\n/* Undef shortcuts. */\n#undef DB\n#undef DI8\n#undef DU16\n#undef DU32\n#undef DADDR\n#undef DUV\n#undef DSV\n#undef DSTR\n#undef DALIGNNOP\n#undef DSECT\n\n/* Type of a section initializer callback. */\ntypedef void (LJ_FASTCALL *GDBJITinitf)(GDBJITctx *ctx);\n\n/* Call section initializer and set the section offset and size. */\nstatic void gdbjit_initsect(GDBJITctx *ctx, int sect, GDBJITinitf initf)\n{\n  ctx->startp = ctx->p;\n  ctx->obj.sect[sect].ofs = (uintptr_t)((char *)ctx->p - (char *)&ctx->obj);\n  initf(ctx);\n  ctx->obj.sect[sect].size = (uintptr_t)(ctx->p - ctx->startp);\n}\n\n#define SECTALIGN(p, a) \\\n  ((p) = (uint8_t *)(((uintptr_t)(p) + ((a)-1)) & ~(uintptr_t)((a)-1)))\n\n/* Build in-memory ELF object. */\nstatic void gdbjit_buildobj(GDBJITctx *ctx)\n{\n  GDBJITobj *obj = &ctx->obj;\n  /* Fill in ELF header and clear structures. */\n  memcpy(&obj->hdr, &elfhdr_template, sizeof(ELFheader));\n  memset(&obj->sect, 0, sizeof(ELFsectheader)*GDBJIT_SECT__MAX);\n  memset(&obj->sym, 0, sizeof(ELFsymbol)*GDBJIT_SYM__MAX);\n  /* Initialize sections. */\n  ctx->p = obj->space;\n  gdbjit_initsect(ctx, GDBJIT_SECT_shstrtab, gdbjit_secthdr);\n  gdbjit_initsect(ctx, GDBJIT_SECT_strtab, gdbjit_symtab);\n  gdbjit_initsect(ctx, GDBJIT_SECT_debug_info, gdbjit_debuginfo);\n  gdbjit_initsect(ctx, GDBJIT_SECT_debug_abbrev, gdbjit_debugabbrev);\n  gdbjit_initsect(ctx, GDBJIT_SECT_debug_line, gdbjit_debugline);\n  SECTALIGN(ctx->p, sizeof(uintptr_t));\n  gdbjit_initsect(ctx, GDBJIT_SECT_eh_frame, gdbjit_ehframe);\n  ctx->objsize = (size_t)((char *)ctx->p - (char *)obj);\n  lua_assert(ctx->objsize < sizeof(GDBJITobj));\n}\n\n#undef SECTALIGN\n\n/* -- Interface to GDB JIT API -------------------------------------------- */\n\n/* Add new entry to GDB JIT symbol chain. */\nstatic void gdbjit_newentry(lua_State *L, GDBJITctx *ctx)\n{\n  /* Allocate memory for GDB JIT entry and ELF object. */\n  MSize sz = (MSize)(sizeof(GDBJITentryobj) - sizeof(GDBJITobj) + ctx->objsize);\n  GDBJITentryobj *eo = lj_mem_newt(L, sz, GDBJITentryobj);\n  memcpy(&eo->obj, &ctx->obj, ctx->objsize);  /* Copy ELF object. */\n  eo->sz = sz;\n  ctx->T->gdbjit_entry = (void *)eo;\n  /* Link new entry to chain and register it. */\n  eo->entry.prev_entry = NULL;\n  eo->entry.next_entry = __jit_debug_descriptor.first_entry;\n  if (eo->entry.next_entry)\n    eo->entry.next_entry->prev_entry = &eo->entry;\n  eo->entry.symfile_addr = (const char *)&eo->obj;\n  eo->entry.symfile_size = ctx->objsize;\n  __jit_debug_descriptor.first_entry = &eo->entry;\n  __jit_debug_descriptor.relevant_entry = &eo->entry;\n  __jit_debug_descriptor.action_flag = GDBJIT_REGISTER;\n  __jit_debug_register_code();\n}\n\n/* Add debug info for newly compiled trace and notify GDB. */\nvoid lj_gdbjit_addtrace(jit_State *J, GCtrace *T)\n{\n  GDBJITctx ctx;\n  GCproto *pt = &gcref(T->startpt)->pt;\n  TraceNo parent = T->ir[REF_BASE].op1;\n  const BCIns *startpc = mref(T->startpc, const BCIns);\n  ctx.T = T;\n  ctx.mcaddr = (uintptr_t)T->mcode;\n  ctx.szmcode = T->szmcode;\n  ctx.spadjp = CFRAME_SIZE_JIT +\n\t       (MSize)(parent ? traceref(J, parent)->spadjust : 0);\n  ctx.spadj = CFRAME_SIZE_JIT + T->spadjust;\n  lua_assert(startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc);\n  ctx.lineno = lj_debug_line(pt, proto_bcpos(pt, startpc));\n  ctx.filename = proto_chunknamestr(pt);\n  if (*ctx.filename == '@' || *ctx.filename == '=')\n    ctx.filename++;\n  else\n    ctx.filename = \"(string)\";\n  gdbjit_buildobj(&ctx);\n  gdbjit_newentry(J->L, &ctx);\n}\n\n/* Delete debug info for trace and notify GDB. */\nvoid lj_gdbjit_deltrace(jit_State *J, GCtrace *T)\n{\n  GDBJITentryobj *eo = (GDBJITentryobj *)T->gdbjit_entry;\n  if (eo) {\n    if (eo->entry.prev_entry)\n      eo->entry.prev_entry->next_entry = eo->entry.next_entry;\n    else\n      __jit_debug_descriptor.first_entry = eo->entry.next_entry;\n    if (eo->entry.next_entry)\n      eo->entry.next_entry->prev_entry = eo->entry.prev_entry;\n    __jit_debug_descriptor.relevant_entry = &eo->entry;\n    __jit_debug_descriptor.action_flag = GDBJIT_UNREGISTER;\n    __jit_debug_register_code();\n    lj_mem_free(J2G(J), eo, eo->sz);\n  }\n}\n\n#endif\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_gdbjit.h",
    "content": "/*\n** Client for the GDB JIT API.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_GDBJIT_H\n#define _LJ_GDBJIT_H\n\n#include \"lj_obj.h\"\n#include \"lj_jit.h\"\n\n#if LJ_HASJIT && defined(LUAJIT_USE_GDBJIT)\n\nLJ_FUNC void lj_gdbjit_addtrace(jit_State *J, GCtrace *T);\nLJ_FUNC void lj_gdbjit_deltrace(jit_State *J, GCtrace *T);\n\n#else\n#define lj_gdbjit_addtrace(J, T)\tUNUSED(T)\n#define lj_gdbjit_deltrace(J, T)\tUNUSED(T)\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ir.c",
    "content": "/*\n** SSA IR (Intermediate Representation) emitter.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_ir_c\n#define LUA_CORE\n\n/* For pointers to libc/libm functions. */\n#include <stdio.h>\n#include <math.h>\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_gc.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_ircall.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#include \"lj_cdata.h\"\n#include \"lj_carith.h\"\n#endif\n#include \"lj_vm.h\"\n#include \"lj_strscan.h\"\n#include \"lj_lib.h\"\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t\t(&J->cur.ir[(ref)])\n#define fins\t\t\t(&J->fold.ins)\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)        (lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n/* -- IR tables ----------------------------------------------------------- */\n\n/* IR instruction modes. */\nLJ_DATADEF const uint8_t lj_ir_mode[IR__MAX+1] = {\nIRDEF(IRMODE)\n  0\n};\n\n/* IR type sizes. */\nLJ_DATADEF const uint8_t lj_ir_type_size[IRT__MAX+1] = {\n#define IRTSIZE(name, size)\tsize,\nIRTDEF(IRTSIZE)\n#undef IRTSIZE\n  0\n};\n\n/* C call info for CALL* instructions. */\nLJ_DATADEF const CCallInfo lj_ir_callinfo[] = {\n#define IRCALLCI(cond, name, nargs, kind, type, flags) \\\n  { (ASMFunction)IRCALLCOND_##cond(name), \\\n    (nargs)|(CCI_CALL_##kind)|(IRT_##type<<CCI_OTSHIFT)|(flags) },\nIRCALLDEF(IRCALLCI)\n#undef IRCALLCI\n  { NULL, 0 }\n};\n\n/* -- IR emitter ---------------------------------------------------------- */\n\n/* Grow IR buffer at the top. */\nvoid LJ_FASTCALL lj_ir_growtop(jit_State *J)\n{\n  IRIns *baseir = J->irbuf + J->irbotlim;\n  MSize szins = J->irtoplim - J->irbotlim;\n  if (szins) {\n    baseir = (IRIns *)lj_mem_realloc(J->L, baseir, szins*sizeof(IRIns),\n\t\t\t\t     2*szins*sizeof(IRIns));\n    J->irtoplim = J->irbotlim + 2*szins;\n  } else {\n    baseir = (IRIns *)lj_mem_realloc(J->L, NULL, 0, LJ_MIN_IRSZ*sizeof(IRIns));\n    J->irbotlim = REF_BASE - LJ_MIN_IRSZ/4;\n    J->irtoplim = J->irbotlim + LJ_MIN_IRSZ;\n  }\n  J->cur.ir = J->irbuf = baseir - J->irbotlim;\n}\n\n/* Grow IR buffer at the bottom or shift it up. */\nstatic void lj_ir_growbot(jit_State *J)\n{\n  IRIns *baseir = J->irbuf + J->irbotlim;\n  MSize szins = J->irtoplim - J->irbotlim;\n  lua_assert(szins != 0);\n  lua_assert(J->cur.nk == J->irbotlim);\n  if (J->cur.nins + (szins >> 1) < J->irtoplim) {\n    /* More than half of the buffer is free on top: shift up by a quarter. */\n    MSize ofs = szins >> 2;\n    memmove(baseir + ofs, baseir, (J->cur.nins - J->irbotlim)*sizeof(IRIns));\n    J->irbotlim -= ofs;\n    J->irtoplim -= ofs;\n    J->cur.ir = J->irbuf = baseir - J->irbotlim;\n  } else {\n    /* Double the buffer size, but split the growth amongst top/bottom. */\n    IRIns *newbase = lj_mem_newt(J->L, 2*szins*sizeof(IRIns), IRIns);\n    MSize ofs = szins >= 256 ? 128 : (szins >> 1);  /* Limit bottom growth. */\n    memcpy(newbase + ofs, baseir, (J->cur.nins - J->irbotlim)*sizeof(IRIns));\n    lj_mem_free(G(J->L), baseir, szins*sizeof(IRIns));\n    J->irbotlim -= ofs;\n    J->irtoplim = J->irbotlim + 2*szins;\n    J->cur.ir = J->irbuf = newbase - J->irbotlim;\n  }\n}\n\n/* Emit IR without any optimizations. */\nTRef LJ_FASTCALL lj_ir_emit(jit_State *J)\n{\n  IRRef ref = lj_ir_nextins(J);\n  IRIns *ir = IR(ref);\n  IROp op = fins->o;\n  ir->prev = J->chain[op];\n  J->chain[op] = (IRRef1)ref;\n  ir->o = op;\n  ir->op1 = fins->op1;\n  ir->op2 = fins->op2;\n  J->guardemit.irt |= fins->t.irt;\n  return TREF(ref, irt_t((ir->t = fins->t)));\n}\n\n/* Emit call to a C function. */\nTRef lj_ir_call(jit_State *J, IRCallID id, ...)\n{\n  const CCallInfo *ci = &lj_ir_callinfo[id];\n  uint32_t n = CCI_NARGS(ci);\n  TRef tr = TREF_NIL;\n  va_list argp;\n  va_start(argp, id);\n  if ((ci->flags & CCI_L)) n--;\n  if (n > 0)\n    tr = va_arg(argp, IRRef);\n  while (n-- > 1)\n    tr = emitir(IRT(IR_CARG, IRT_NIL), tr, va_arg(argp, IRRef));\n  va_end(argp);\n  if (CCI_OP(ci) == IR_CALLS)\n    J->needsnap = 1;  /* Need snapshot after call with side effect. */\n  return emitir(CCI_OPTYPE(ci), tr, id);\n}\n\n/* -- Interning of constants ---------------------------------------------- */\n\n/*\n** IR instructions for constants are kept between J->cur.nk >= ref < REF_BIAS.\n** They are chained like all other instructions, but grow downwards.\n** The are interned (like strings in the VM) to facilitate reference\n** comparisons. The same constant must get the same reference.\n*/\n\n/* Get ref of next IR constant and optionally grow IR.\n** Note: this may invalidate all IRIns *!\n*/\nstatic LJ_AINLINE IRRef ir_nextk(jit_State *J)\n{\n  IRRef ref = J->cur.nk;\n  if (LJ_UNLIKELY(ref <= J->irbotlim)) lj_ir_growbot(J);\n  J->cur.nk = --ref;\n  return ref;\n}\n\n/* Intern int32_t constant. */\nTRef LJ_FASTCALL lj_ir_kint(jit_State *J, int32_t k)\n{\n  IRIns *ir, *cir = J->cur.ir;\n  IRRef ref;\n  for (ref = J->chain[IR_KINT]; ref; ref = cir[ref].prev)\n    if (cir[ref].i == k)\n      goto found;\n  ref = ir_nextk(J);\n  ir = IR(ref);\n  ir->i = k;\n  ir->t.irt = IRT_INT;\n  ir->o = IR_KINT;\n  ir->prev = J->chain[IR_KINT];\n  J->chain[IR_KINT] = (IRRef1)ref;\nfound:\n  return TREF(ref, IRT_INT);\n}\n\n/* The MRef inside the KNUM/KINT64 IR instructions holds the address of the\n** 64 bit constant. The constants themselves are stored in a chained array\n** and shared across traces.\n**\n** Rationale for choosing this data structure:\n** - The address of the constants is embedded in the generated machine code\n**   and must never move. A resizable array or hash table wouldn't work.\n** - Most apps need very few non-32 bit integer constants (less than a dozen).\n** - Linear search is hard to beat in terms of speed and low complexity.\n*/\ntypedef struct K64Array {\n  MRef next;\t\t\t/* Pointer to next list. */\n  MSize numk;\t\t\t/* Number of used elements in this array. */\n  TValue k[LJ_MIN_K64SZ];\t/* Array of constants. */\n} K64Array;\n\n/* Free all chained arrays. */\nvoid lj_ir_k64_freeall(jit_State *J)\n{\n  K64Array *k;\n  for (k = mref(J->k64, K64Array); k; ) {\n    K64Array *next = mref(k->next, K64Array);\n    lj_mem_free(J2G(J), k, sizeof(K64Array));\n    k = next;\n  }\n}\n\n/* Find 64 bit constant in chained array or add it. */\ncTValue *lj_ir_k64_find(jit_State *J, uint64_t u64)\n{\n  K64Array *k, *kp = NULL;\n  TValue *ntv;\n  MSize idx;\n  /* Search for the constant in the whole chain of arrays. */\n  for (k = mref(J->k64, K64Array); k; k = mref(k->next, K64Array)) {\n    kp = k;  /* Remember previous element in list. */\n    for (idx = 0; idx < k->numk; idx++) {  /* Search one array. */\n      TValue *tv = &k->k[idx];\n      if (tv->u64 == u64)  /* Needed for +-0/NaN/absmask. */\n\treturn tv;\n    }\n  }\n  /* Constant was not found, need to add it. */\n  if (!(kp && kp->numk < LJ_MIN_K64SZ)) {  /* Allocate a new array. */\n    K64Array *kn = lj_mem_newt(J->L, sizeof(K64Array), K64Array);\n    setmref(kn->next, NULL);\n    kn->numk = 0;\n    if (kp)\n      setmref(kp->next, kn);  /* Chain to the end of the list. */\n    else\n      setmref(J->k64, kn);  /* Link first array. */\n    kp = kn;\n  }\n  ntv = &kp->k[kp->numk++];  /* Add to current array. */\n  ntv->u64 = u64;\n  return ntv;\n}\n\n/* Intern 64 bit constant, given by its address. */\nTRef lj_ir_k64(jit_State *J, IROp op, cTValue *tv)\n{\n  IRIns *ir, *cir = J->cur.ir;\n  IRRef ref;\n  IRType t = op == IR_KNUM ? IRT_NUM : IRT_I64;\n  for (ref = J->chain[op]; ref; ref = cir[ref].prev)\n    if (ir_k64(&cir[ref]) == tv)\n      goto found;\n  ref = ir_nextk(J);\n  ir = IR(ref);\n  lua_assert(checkptr32(tv));\n  setmref(ir->ptr, tv);\n  ir->t.irt = t;\n  ir->o = op;\n  ir->prev = J->chain[op];\n  J->chain[op] = (IRRef1)ref;\nfound:\n  return TREF(ref, t);\n}\n\n/* Intern FP constant, given by its 64 bit pattern. */\nTRef lj_ir_knum_u64(jit_State *J, uint64_t u64)\n{\n  return lj_ir_k64(J, IR_KNUM, lj_ir_k64_find(J, u64));\n}\n\n/* Intern 64 bit integer constant. */\nTRef lj_ir_kint64(jit_State *J, uint64_t u64)\n{\n  return lj_ir_k64(J, IR_KINT64, lj_ir_k64_find(J, u64));\n}\n\n/* Check whether a number is int and return it. -0 is NOT considered an int. */\nstatic int numistrueint(lua_Number n, int32_t *kp)\n{\n  int32_t k = lj_num2int(n);\n  if (n == (lua_Number)k) {\n    if (kp) *kp = k;\n    if (k == 0) {  /* Special check for -0. */\n      TValue tv;\n      setnumV(&tv, n);\n      if (tv.u32.hi != 0)\n\treturn 0;\n    }\n    return 1;\n  }\n  return 0;\n}\n\n/* Intern number as int32_t constant if possible, otherwise as FP constant. */\nTRef lj_ir_knumint(jit_State *J, lua_Number n)\n{\n  int32_t k;\n  if (numistrueint(n, &k))\n    return lj_ir_kint(J, k);\n  else\n    return lj_ir_knum(J, n);\n}\n\n/* Intern GC object \"constant\". */\nTRef lj_ir_kgc(jit_State *J, GCobj *o, IRType t)\n{\n  IRIns *ir, *cir = J->cur.ir;\n  IRRef ref;\n  lua_assert(!isdead(J2G(J), o));\n  for (ref = J->chain[IR_KGC]; ref; ref = cir[ref].prev)\n    if (ir_kgc(&cir[ref]) == o)\n      goto found;\n  ref = ir_nextk(J);\n  ir = IR(ref);\n  /* NOBARRIER: Current trace is a GC root. */\n  setgcref(ir->gcr, o);\n  ir->t.irt = (uint8_t)t;\n  ir->o = IR_KGC;\n  ir->prev = J->chain[IR_KGC];\n  J->chain[IR_KGC] = (IRRef1)ref;\nfound:\n  return TREF(ref, t);\n}\n\n/* Intern 32 bit pointer constant. */\nTRef lj_ir_kptr_(jit_State *J, IROp op, void *ptr)\n{\n  IRIns *ir, *cir = J->cur.ir;\n  IRRef ref;\n  lua_assert((void *)(intptr_t)i32ptr(ptr) == ptr);\n  for (ref = J->chain[op]; ref; ref = cir[ref].prev)\n    if (mref(cir[ref].ptr, void) == ptr)\n      goto found;\n  ref = ir_nextk(J);\n  ir = IR(ref);\n  setmref(ir->ptr, ptr);\n  ir->t.irt = IRT_P32;\n  ir->o = op;\n  ir->prev = J->chain[op];\n  J->chain[op] = (IRRef1)ref;\nfound:\n  return TREF(ref, IRT_P32);\n}\n\n/* Intern typed NULL constant. */\nTRef lj_ir_knull(jit_State *J, IRType t)\n{\n  IRIns *ir, *cir = J->cur.ir;\n  IRRef ref;\n  for (ref = J->chain[IR_KNULL]; ref; ref = cir[ref].prev)\n    if (irt_t(cir[ref].t) == t)\n      goto found;\n  ref = ir_nextk(J);\n  ir = IR(ref);\n  ir->i = 0;\n  ir->t.irt = (uint8_t)t;\n  ir->o = IR_KNULL;\n  ir->prev = J->chain[IR_KNULL];\n  J->chain[IR_KNULL] = (IRRef1)ref;\nfound:\n  return TREF(ref, t);\n}\n\n/* Intern key slot. */\nTRef lj_ir_kslot(jit_State *J, TRef key, IRRef slot)\n{\n  IRIns *ir, *cir = J->cur.ir;\n  IRRef2 op12 = IRREF2((IRRef1)key, (IRRef1)slot);\n  IRRef ref;\n  /* Const part is not touched by CSE/DCE, so 0-65535 is ok for IRMlit here. */\n  lua_assert(tref_isk(key) && slot == (IRRef)(IRRef1)slot);\n  for (ref = J->chain[IR_KSLOT]; ref; ref = cir[ref].prev)\n    if (cir[ref].op12 == op12)\n      goto found;\n  ref = ir_nextk(J);\n  ir = IR(ref);\n  ir->op12 = op12;\n  ir->t.irt = IRT_P32;\n  ir->o = IR_KSLOT;\n  ir->prev = J->chain[IR_KSLOT];\n  J->chain[IR_KSLOT] = (IRRef1)ref;\nfound:\n  return TREF(ref, IRT_P32);\n}\n\n/* -- Access to IR constants ---------------------------------------------- */\n\n/* Copy value of IR constant. */\nvoid lj_ir_kvalue(lua_State *L, TValue *tv, const IRIns *ir)\n{\n  UNUSED(L);\n  lua_assert(ir->o != IR_KSLOT);  /* Common mistake. */\n  switch (ir->o) {\n  case IR_KPRI: setitype(tv, irt_toitype(ir->t)); break;\n  case IR_KINT: setintV(tv, ir->i); break;\n  case IR_KGC: setgcV(L, tv, ir_kgc(ir), irt_toitype(ir->t)); break;\n  case IR_KPTR: case IR_KKPTR: case IR_KNULL:\n    setlightudV(tv, mref(ir->ptr, void));\n    break;\n  case IR_KNUM: setnumV(tv, ir_knum(ir)->n); break;\n#if LJ_HASFFI\n  case IR_KINT64: {\n    GCcdata *cd = lj_cdata_new_(L, CTID_INT64, 8);\n    *(uint64_t *)cdataptr(cd) = ir_kint64(ir)->u64;\n    setcdataV(L, tv, cd);\n    break;\n    }\n#endif\n  default: lua_assert(0); break;\n  }\n}\n\n/* -- Convert IR operand types -------------------------------------------- */\n\n/* Convert from string to number. */\nTRef LJ_FASTCALL lj_ir_tonumber(jit_State *J, TRef tr)\n{\n  if (!tref_isnumber(tr)) {\n    if (tref_isstr(tr))\n      tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0);\n    else\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n  }\n  return tr;\n}\n\n/* Convert from integer or string to number. */\nTRef LJ_FASTCALL lj_ir_tonum(jit_State *J, TRef tr)\n{\n  if (!tref_isnum(tr)) {\n    if (tref_isinteger(tr))\n      tr = emitir(IRTN(IR_CONV), tr, IRCONV_NUM_INT);\n    else if (tref_isstr(tr))\n      tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0);\n    else\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n  }\n  return tr;\n}\n\n/* Convert from integer or number to string. */\nTRef LJ_FASTCALL lj_ir_tostr(jit_State *J, TRef tr)\n{\n  if (!tref_isstr(tr)) {\n    if (!tref_isnumber(tr))\n      lj_trace_err(J, LJ_TRERR_BADTYPE);\n    tr = emitir(IRT(IR_TOSTR, IRT_STR), tr, 0);\n  }\n  return tr;\n}\n\n/* -- Miscellaneous IR ops ------------------------------------------------ */\n\n/* Evaluate numeric comparison. */\nint lj_ir_numcmp(lua_Number a, lua_Number b, IROp op)\n{\n  switch (op) {\n  case IR_EQ: return (a == b);\n  case IR_NE: return (a != b);\n  case IR_LT: return (a < b);\n  case IR_GE: return (a >= b);\n  case IR_LE: return (a <= b);\n  case IR_GT: return (a > b);\n  case IR_ULT: return !(a >= b);\n  case IR_UGE: return !(a < b);\n  case IR_ULE: return !(a > b);\n  case IR_UGT: return !(a <= b);\n  default: lua_assert(0); return 0;\n  }\n}\n\n/* Evaluate string comparison. */\nint lj_ir_strcmp(GCstr *a, GCstr *b, IROp op)\n{\n  int res = lj_str_cmp(a, b);\n  switch (op) {\n  case IR_LT: return (res < 0);\n  case IR_GE: return (res >= 0);\n  case IR_LE: return (res <= 0);\n  case IR_GT: return (res > 0);\n  default: lua_assert(0); return 0;\n  }\n}\n\n/* Rollback IR to previous state. */\nvoid lj_ir_rollback(jit_State *J, IRRef ref)\n{\n  IRRef nins = J->cur.nins;\n  while (nins > ref) {\n    IRIns *ir;\n    nins--;\n    ir = IR(nins);\n    J->chain[ir->o] = ir->prev;\n  }\n  J->cur.nins = nins;\n}\n\n#undef IR\n#undef fins\n#undef emitir\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ir.h",
    "content": "/*\n** SSA IR (Intermediate Representation) format.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_IR_H\n#define _LJ_IR_H\n\n#include \"lj_obj.h\"\n\n/* -- IR instructions ----------------------------------------------------- */\n\n/* IR instruction definition. Order matters, see below. ORDER IR */\n#define IRDEF(_) \\\n  /* Guarded assertions. */ \\\n  /* Must be properly aligned to flip opposites (^1) and (un)ordered (^4). */ \\\n  _(LT,\t\tN , ref, ref) \\\n  _(GE,\t\tN , ref, ref) \\\n  _(LE,\t\tN , ref, ref) \\\n  _(GT,\t\tN , ref, ref) \\\n  \\\n  _(ULT,\tN , ref, ref) \\\n  _(UGE,\tN , ref, ref) \\\n  _(ULE,\tN , ref, ref) \\\n  _(UGT,\tN , ref, ref) \\\n  \\\n  _(EQ,\t\tC , ref, ref) \\\n  _(NE,\t\tC , ref, ref) \\\n  \\\n  _(ABC,\tN , ref, ref) \\\n  _(RETF,\tS , ref, ref) \\\n  \\\n  /* Miscellaneous ops. */ \\\n  _(NOP,\tN , ___, ___) \\\n  _(BASE,\tN , lit, lit) \\\n  _(PVAL,\tN , lit, ___) \\\n  _(GCSTEP,\tS , ___, ___) \\\n  _(HIOP,\tS , ref, ref) \\\n  _(LOOP,\tS , ___, ___) \\\n  _(USE,\tS , ref, ___) \\\n  _(PHI,\tS , ref, ref) \\\n  _(RENAME,\tS , ref, lit) \\\n  \\\n  /* Constants. */ \\\n  _(KPRI,\tN , ___, ___) \\\n  _(KINT,\tN , cst, ___) \\\n  _(KGC,\tN , cst, ___) \\\n  _(KPTR,\tN , cst, ___) \\\n  _(KKPTR,\tN , cst, ___) \\\n  _(KNULL,\tN , cst, ___) \\\n  _(KNUM,\tN , cst, ___) \\\n  _(KINT64,\tN , cst, ___) \\\n  _(KSLOT,\tN , ref, lit) \\\n  \\\n  /* Bit ops. */ \\\n  _(BNOT,\tN , ref, ___) \\\n  _(BSWAP,\tN , ref, ___) \\\n  _(BAND,\tC , ref, ref) \\\n  _(BOR,\tC , ref, ref) \\\n  _(BXOR,\tC , ref, ref) \\\n  _(BSHL,\tN , ref, ref) \\\n  _(BSHR,\tN , ref, ref) \\\n  _(BSAR,\tN , ref, ref) \\\n  _(BROL,\tN , ref, ref) \\\n  _(BROR,\tN , ref, ref) \\\n  \\\n  /* Arithmetic ops. ORDER ARITH */ \\\n  _(ADD,\tC , ref, ref) \\\n  _(SUB,\tN , ref, ref) \\\n  _(MUL,\tC , ref, ref) \\\n  _(DIV,\tN , ref, ref) \\\n  _(MOD,\tN , ref, ref) \\\n  _(POW,\tN , ref, ref) \\\n  _(NEG,\tN , ref, ref) \\\n  \\\n  _(ABS,\tN , ref, ref) \\\n  _(ATAN2,\tN , ref, ref) \\\n  _(LDEXP,\tN , ref, ref) \\\n  _(MIN,\tC , ref, ref) \\\n  _(MAX,\tC , ref, ref) \\\n  _(FPMATH,\tN , ref, lit) \\\n  \\\n  /* Overflow-checking arithmetic ops. */ \\\n  _(ADDOV,\tCW, ref, ref) \\\n  _(SUBOV,\tNW, ref, ref) \\\n  _(MULOV,\tCW, ref, ref) \\\n  \\\n  /* Memory ops. A = array, H = hash, U = upvalue, F = field, S = stack. */ \\\n  \\\n  /* Memory references. */ \\\n  _(AREF,\tR , ref, ref) \\\n  _(HREFK,\tR , ref, ref) \\\n  _(HREF,\tL , ref, ref) \\\n  _(NEWREF,\tS , ref, ref) \\\n  _(UREFO,\tLW, ref, lit) \\\n  _(UREFC,\tLW, ref, lit) \\\n  _(FREF,\tR , ref, lit) \\\n  _(STRREF,\tN , ref, ref) \\\n  \\\n  /* Loads and Stores. These must be in the same order. */ \\\n  _(ALOAD,\tL , ref, ___) \\\n  _(HLOAD,\tL , ref, ___) \\\n  _(ULOAD,\tL , ref, ___) \\\n  _(FLOAD,\tL , ref, lit) \\\n  _(XLOAD,\tL , ref, lit) \\\n  _(SLOAD,\tL , lit, lit) \\\n  _(VLOAD,\tL , ref, ___) \\\n  \\\n  _(ASTORE,\tS , ref, ref) \\\n  _(HSTORE,\tS , ref, ref) \\\n  _(USTORE,\tS , ref, ref) \\\n  _(FSTORE,\tS , ref, ref) \\\n  _(XSTORE,\tS , ref, ref) \\\n  \\\n  /* Allocations. */ \\\n  _(SNEW,\tN , ref, ref)  /* CSE is ok, not marked as A. */ \\\n  _(XSNEW,\tA , ref, ref) \\\n  _(TNEW,\tAW, lit, lit) \\\n  _(TDUP,\tAW, ref, ___) \\\n  _(CNEW,\tAW, ref, ref) \\\n  _(CNEWI,\tNW, ref, ref)  /* CSE is ok, not marked as A. */ \\\n  \\\n  /* Barriers. */ \\\n  _(TBAR,\tS , ref, ___) \\\n  _(OBAR,\tS , ref, ref) \\\n  _(XBAR,\tS , ___, ___) \\\n  \\\n  /* Type conversions. */ \\\n  _(CONV,\tNW, ref, lit) \\\n  _(TOBIT,\tN , ref, ref) \\\n  _(TOSTR,\tN , ref, ___) \\\n  _(STRTO,\tN , ref, ___) \\\n  \\\n  /* Calls. */ \\\n  _(CALLN,\tN , ref, lit) \\\n  _(CALLL,\tL , ref, lit) \\\n  _(CALLS,\tS , ref, lit) \\\n  _(CALLXS,\tS , ref, ref) \\\n  _(CARG,\tN , ref, ref) \\\n  \\\n  /* End of list. */\n\n/* IR opcodes (max. 256). */\ntypedef enum {\n#define IRENUM(name, m, m1, m2)\tIR_##name,\nIRDEF(IRENUM)\n#undef IRENUM\n  IR__MAX\n} IROp;\n\n/* Stored opcode. */\ntypedef uint8_t IROp1;\n\nLJ_STATIC_ASSERT(((int)IR_EQ^1) == (int)IR_NE);\nLJ_STATIC_ASSERT(((int)IR_LT^1) == (int)IR_GE);\nLJ_STATIC_ASSERT(((int)IR_LE^1) == (int)IR_GT);\nLJ_STATIC_ASSERT(((int)IR_LT^3) == (int)IR_GT);\nLJ_STATIC_ASSERT(((int)IR_LT^4) == (int)IR_ULT);\n\n/* Delta between xLOAD and xSTORE. */\n#define IRDELTA_L2S\t\t((int)IR_ASTORE - (int)IR_ALOAD)\n\nLJ_STATIC_ASSERT((int)IR_HLOAD + IRDELTA_L2S == (int)IR_HSTORE);\nLJ_STATIC_ASSERT((int)IR_ULOAD + IRDELTA_L2S == (int)IR_USTORE);\nLJ_STATIC_ASSERT((int)IR_FLOAD + IRDELTA_L2S == (int)IR_FSTORE);\nLJ_STATIC_ASSERT((int)IR_XLOAD + IRDELTA_L2S == (int)IR_XSTORE);\n\n/* -- Named IR literals --------------------------------------------------- */\n\n/* FPMATH sub-functions. ORDER FPM. */\n#define IRFPMDEF(_) \\\n  _(FLOOR) _(CEIL) _(TRUNC)  /* Must be first and in this order. */ \\\n  _(SQRT) _(EXP) _(EXP2) _(LOG) _(LOG2) _(LOG10) \\\n  _(SIN) _(COS) _(TAN) \\\n  _(OTHER)\n\ntypedef enum {\n#define FPMENUM(name)\t\tIRFPM_##name,\nIRFPMDEF(FPMENUM)\n#undef FPMENUM\n  IRFPM__MAX\n} IRFPMathOp;\n\n/* FLOAD fields. */\n#define IRFLDEF(_) \\\n  _(STR_LEN,\toffsetof(GCstr, len)) \\\n  _(FUNC_ENV,\toffsetof(GCfunc, l.env)) \\\n  _(FUNC_PC,\toffsetof(GCfunc, l.pc)) \\\n  _(TAB_META,\toffsetof(GCtab, metatable)) \\\n  _(TAB_ARRAY,\toffsetof(GCtab, array)) \\\n  _(TAB_NODE,\toffsetof(GCtab, node)) \\\n  _(TAB_ASIZE,\toffsetof(GCtab, asize)) \\\n  _(TAB_HMASK,\toffsetof(GCtab, hmask)) \\\n  _(TAB_NOMM,\toffsetof(GCtab, nomm)) \\\n  _(UDATA_META,\toffsetof(GCudata, metatable)) \\\n  _(UDATA_UDTYPE, offsetof(GCudata, udtype)) \\\n  _(UDATA_FILE,\tsizeof(GCudata)) \\\n  _(CDATA_CTYPEID, offsetof(GCcdata, ctypeid)) \\\n  _(CDATA_PTR,\tsizeof(GCcdata)) \\\n  _(CDATA_INT, sizeof(GCcdata)) \\\n  _(CDATA_INT64, sizeof(GCcdata)) \\\n  _(CDATA_INT64_4, sizeof(GCcdata) + 4)\n\ntypedef enum {\n#define FLENUM(name, ofs)\tIRFL_##name,\nIRFLDEF(FLENUM)\n#undef FLENUM\n  IRFL__MAX\n} IRFieldID;\n\n/* SLOAD mode bits, stored in op2. */\n#define IRSLOAD_PARENT\t\t0x01\t/* Coalesce with parent trace. */\n#define IRSLOAD_FRAME\t\t0x02\t/* Load hiword of frame. */\n#define IRSLOAD_TYPECHECK\t0x04\t/* Needs type check. */\n#define IRSLOAD_CONVERT\t\t0x08\t/* Number to integer conversion. */\n#define IRSLOAD_READONLY\t0x10\t/* Read-only, omit slot store. */\n#define IRSLOAD_INHERIT\t\t0x20\t/* Inherited by exits/side traces. */\n\n/* XLOAD mode, stored in op2. */\n#define IRXLOAD_READONLY\t1\t/* Load from read-only data. */\n#define IRXLOAD_VOLATILE\t2\t/* Load from volatile data. */\n#define IRXLOAD_UNALIGNED\t4\t/* Unaligned load. */\n\n/* CONV mode, stored in op2. */\n#define IRCONV_SRCMASK\t\t0x001f\t/* Source IRType. */\n#define IRCONV_DSTMASK\t\t0x03e0\t/* Dest. IRType (also in ir->t). */\n#define IRCONV_DSH\t\t5\n#define IRCONV_NUM_INT\t\t((IRT_NUM<<IRCONV_DSH)|IRT_INT)\n#define IRCONV_INT_NUM\t\t((IRT_INT<<IRCONV_DSH)|IRT_NUM)\n#define IRCONV_TRUNC\t\t0x0400\t/* Truncate number to integer. */\n#define IRCONV_SEXT\t\t0x0800\t/* Sign-extend integer to integer. */\n#define IRCONV_MODEMASK\t\t0x0fff\n#define IRCONV_CONVMASK\t\t0xf000\n#define IRCONV_CSH\t\t12\n/* Number to integer conversion mode. Ordered by strength of the checks. */\n#define IRCONV_TOBIT  (0<<IRCONV_CSH)\t/* None. Cache only: TOBIT conv. */\n#define IRCONV_ANY    (1<<IRCONV_CSH)\t/* Any FP number is ok. */\n#define IRCONV_INDEX  (2<<IRCONV_CSH)\t/* Check + special backprop rules. */\n#define IRCONV_CHECK  (3<<IRCONV_CSH)\t/* Number checked for integerness. */\n\n/* -- IR operands --------------------------------------------------------- */\n\n/* IR operand mode (2 bit). */\ntypedef enum {\n  IRMref,\t\t/* IR reference. */\n  IRMlit,\t\t/* 16 bit unsigned literal. */\n  IRMcst,\t\t/* Constant literal: i, gcr or ptr. */\n  IRMnone\t\t/* Unused operand. */\n} IRMode;\n#define IRM___\t\tIRMnone\n\n/* Mode bits: Commutative, {Normal/Ref, Alloc, Load, Store}, Non-weak guard. */\n#define IRM_C\t\t\t0x10\n\n#define IRM_N\t\t\t0x00\n#define IRM_R\t\t\tIRM_N\n#define IRM_A\t\t\t0x20\n#define IRM_L\t\t\t0x40\n#define IRM_S\t\t\t0x60\n\n#define IRM_W\t\t\t0x80\n\n#define IRM_NW\t\t\t(IRM_N|IRM_W)\n#define IRM_CW\t\t\t(IRM_C|IRM_W)\n#define IRM_AW\t\t\t(IRM_A|IRM_W)\n#define IRM_LW\t\t\t(IRM_L|IRM_W)\n\n#define irm_op1(m)\t\t((IRMode)((m)&3))\n#define irm_op2(m)\t\t((IRMode)(((m)>>2)&3))\n#define irm_iscomm(m)\t\t((m) & IRM_C)\n#define irm_kind(m)\t\t((m) & IRM_S)\n\n#define IRMODE(name, m, m1, m2)\t(((IRM##m1)|((IRM##m2)<<2)|(IRM_##m))^IRM_W),\n\nLJ_DATA const uint8_t lj_ir_mode[IR__MAX+1];\n\n/* -- IR instruction types ------------------------------------------------ */\n\n/* Map of itypes to non-negative numbers. ORDER LJ_T.\n** LJ_TUPVAL/LJ_TTRACE never appear in a TValue. Use these itypes for\n** IRT_P32 and IRT_P64, which never escape the IR.\n** The various integers are only used in the IR and can only escape to\n** a TValue after implicit or explicit conversion. Their types must be\n** contiguous and next to IRT_NUM (see the typerange macros below).\n*/\n#define IRTDEF(_) \\\n  _(NIL, 4) _(FALSE, 4) _(TRUE, 4) _(LIGHTUD, LJ_64 ? 8 : 4) _(STR, 4) \\\n  _(P32, 4) _(THREAD, 4) _(PROTO, 4) _(FUNC, 4) _(P64, 8) _(CDATA, 4) \\\n  _(TAB, 4) _(UDATA, 4) \\\n  _(FLOAT, 4) _(NUM, 8) _(I8, 1) _(U8, 1) _(I16, 2) _(U16, 2) \\\n  _(INT, 4) _(U32, 4) _(I64, 8) _(U64, 8) \\\n  _(SOFTFP, 4)  /* There is room for 9 more types. */\n\n/* IR result type and flags (8 bit). */\ntypedef enum {\n#define IRTENUM(name, size)\tIRT_##name,\nIRTDEF(IRTENUM)\n#undef IRTENUM\n  IRT__MAX,\n\n  /* Native pointer type and the corresponding integer type. */\n  IRT_PTR = LJ_64 ? IRT_P64 : IRT_P32,\n  IRT_INTP = LJ_64 ? IRT_I64 : IRT_INT,\n  IRT_UINTP = LJ_64 ? IRT_U64 : IRT_U32,\n\n  /* Additional flags. */\n  IRT_MARK = 0x20,\t/* Marker for misc. purposes. */\n  IRT_ISPHI = 0x40,\t/* Instruction is left or right PHI operand. */\n  IRT_GUARD = 0x80,\t/* Instruction is a guard. */\n\n  /* Masks. */\n  IRT_TYPE = 0x1f,\n  IRT_T = 0xff\n} IRType;\n\n#define irtype_ispri(irt)\t((uint32_t)(irt) <= IRT_TRUE)\n\n/* Stored IRType. */\ntypedef struct IRType1 { uint8_t irt; } IRType1;\n\n#define IRT(o, t)\t\t((uint32_t)(((o)<<8) | (t)))\n#define IRTI(o)\t\t\t(IRT((o), IRT_INT))\n#define IRTN(o)\t\t\t(IRT((o), IRT_NUM))\n#define IRTG(o, t)\t\t(IRT((o), IRT_GUARD|(t)))\n#define IRTGI(o)\t\t(IRT((o), IRT_GUARD|IRT_INT))\n\n#define irt_t(t)\t\t((IRType)(t).irt)\n#define irt_type(t)\t\t((IRType)((t).irt & IRT_TYPE))\n#define irt_sametype(t1, t2)\t((((t1).irt ^ (t2).irt) & IRT_TYPE) == 0)\n#define irt_typerange(t, first, last) \\\n  ((uint32_t)((t).irt & IRT_TYPE) - (uint32_t)(first) <= (uint32_t)(last-first))\n\n#define irt_isnil(t)\t\t(irt_type(t) == IRT_NIL)\n#define irt_ispri(t)\t\t((uint32_t)irt_type(t) <= IRT_TRUE)\n#define irt_islightud(t)\t(irt_type(t) == IRT_LIGHTUD)\n#define irt_isstr(t)\t\t(irt_type(t) == IRT_STR)\n#define irt_istab(t)\t\t(irt_type(t) == IRT_TAB)\n#define irt_iscdata(t)\t\t(irt_type(t) == IRT_CDATA)\n#define irt_isfloat(t)\t\t(irt_type(t) == IRT_FLOAT)\n#define irt_isnum(t)\t\t(irt_type(t) == IRT_NUM)\n#define irt_isint(t)\t\t(irt_type(t) == IRT_INT)\n#define irt_isi8(t)\t\t(irt_type(t) == IRT_I8)\n#define irt_isu8(t)\t\t(irt_type(t) == IRT_U8)\n#define irt_isi16(t)\t\t(irt_type(t) == IRT_I16)\n#define irt_isu16(t)\t\t(irt_type(t) == IRT_U16)\n#define irt_isu32(t)\t\t(irt_type(t) == IRT_U32)\n#define irt_isi64(t)\t\t(irt_type(t) == IRT_I64)\n#define irt_isu64(t)\t\t(irt_type(t) == IRT_U64)\n\n#define irt_isfp(t)\t\t(irt_isnum(t) || irt_isfloat(t))\n#define irt_isinteger(t)\t(irt_typerange((t), IRT_I8, IRT_INT))\n#define irt_isgcv(t)\t\t(irt_typerange((t), IRT_STR, IRT_UDATA))\n#define irt_isaddr(t)\t\t(irt_typerange((t), IRT_LIGHTUD, IRT_UDATA))\n#define irt_isint64(t)\t\t(irt_typerange((t), IRT_I64, IRT_U64))\n\n#if LJ_64\n#define IRT_IS64 \\\n  ((1u<<IRT_NUM)|(1u<<IRT_I64)|(1u<<IRT_U64)|(1u<<IRT_P64)|(1u<<IRT_LIGHTUD))\n#else\n#define IRT_IS64 \\\n  ((1u<<IRT_NUM)|(1u<<IRT_I64)|(1u<<IRT_U64))\n#endif\n\n#define irt_is64(t)\t\t((IRT_IS64 >> irt_type(t)) & 1)\n#define irt_is64orfp(t)\t\t(((IRT_IS64|(1u<<IRT_FLOAT))>>irt_type(t)) & 1)\n\n#define irt_size(t)\t\t(lj_ir_type_size[irt_t((t))])\n\nLJ_DATA const uint8_t lj_ir_type_size[];\n\nstatic LJ_AINLINE IRType itype2irt(const TValue *tv)\n{\n  if (tvisint(tv))\n    return IRT_INT;\n  else if (tvisnum(tv))\n    return IRT_NUM;\n#if LJ_64\n  else if (tvislightud(tv))\n    return IRT_LIGHTUD;\n#endif\n  else\n    return (IRType)~itype(tv);\n}\n\nstatic LJ_AINLINE uint32_t irt_toitype_(IRType t)\n{\n  lua_assert(!LJ_64 || t != IRT_LIGHTUD);\n  if (LJ_DUALNUM && t > IRT_NUM) {\n    return LJ_TISNUM;\n  } else {\n    lua_assert(t <= IRT_NUM);\n    return ~(uint32_t)t;\n  }\n}\n\n#define irt_toitype(t)\t\tirt_toitype_(irt_type((t)))\n\n#define irt_isguard(t)\t\t((t).irt & IRT_GUARD)\n#define irt_ismarked(t)\t\t((t).irt & IRT_MARK)\n#define irt_setmark(t)\t\t((t).irt |= IRT_MARK)\n#define irt_clearmark(t)\t((t).irt &= ~IRT_MARK)\n#define irt_isphi(t)\t\t((t).irt & IRT_ISPHI)\n#define irt_setphi(t)\t\t((t).irt |= IRT_ISPHI)\n#define irt_clearphi(t)\t\t((t).irt &= ~IRT_ISPHI)\n\n/* Stored combined IR opcode and type. */\ntypedef uint16_t IROpT;\n\n/* -- IR references ------------------------------------------------------- */\n\n/* IR references. */\ntypedef uint16_t IRRef1;\t/* One stored reference. */\ntypedef uint32_t IRRef2;\t/* Two stored references. */\ntypedef uint32_t IRRef;\t\t/* Used to pass around references. */\n\n/* Fixed references. */\nenum {\n  REF_BIAS =\t0x8000,\n  REF_TRUE =\tREF_BIAS-3,\n  REF_FALSE =\tREF_BIAS-2,\n  REF_NIL =\tREF_BIAS-1,\t/* \\--- Constants grow downwards. */\n  REF_BASE =\tREF_BIAS,\t/* /--- IR grows upwards. */\n  REF_FIRST =\tREF_BIAS+1,\n  REF_DROP =\t0xffff\n};\n\n/* Note: IRMlit operands must be < REF_BIAS, too!\n** This allows for fast and uniform manipulation of all operands\n** without looking up the operand mode in lj_ir_mode:\n** - CSE calculates the maximum reference of two operands.\n**   This must work with mixed reference/literal operands, too.\n** - DCE marking only checks for operand >= REF_BIAS.\n** - LOOP needs to substitute reference operands.\n**   Constant references and literals must not be modified.\n*/\n\n#define IRREF2(lo, hi)\t\t((IRRef2)(lo) | ((IRRef2)(hi) << 16))\n\n#define irref_isk(ref)\t\t((ref) < REF_BIAS)\n\n/* Tagged IR references (32 bit).\n**\n** +-------+-------+---------------+\n** |  irt  | flags |      ref      |\n** +-------+-------+---------------+\n**\n** The tag holds a copy of the IRType and speeds up IR type checks.\n*/\ntypedef uint32_t TRef;\n\n#define TREF_REFMASK\t\t0x0000ffff\n#define TREF_FRAME\t\t0x00010000\n#define TREF_CONT\t\t0x00020000\n\n#define TREF(ref, t)\t\t((TRef)((ref) + ((t)<<24)))\n\n#define tref_ref(tr)\t\t((IRRef1)(tr))\n#define tref_t(tr)\t\t((IRType)((tr)>>24))\n#define tref_type(tr)\t\t((IRType)(((tr)>>24) & IRT_TYPE))\n#define tref_typerange(tr, first, last) \\\n  ((((tr)>>24) & IRT_TYPE) - (TRef)(first) <= (TRef)(last-first))\n\n#define tref_istype(tr, t)\t(((tr) & (IRT_TYPE<<24)) == ((t)<<24))\n#define tref_isnil(tr)\t\t(tref_istype((tr), IRT_NIL))\n#define tref_isfalse(tr)\t(tref_istype((tr), IRT_FALSE))\n#define tref_istrue(tr)\t\t(tref_istype((tr), IRT_TRUE))\n#define tref_isstr(tr)\t\t(tref_istype((tr), IRT_STR))\n#define tref_isfunc(tr)\t\t(tref_istype((tr), IRT_FUNC))\n#define tref_iscdata(tr)\t(tref_istype((tr), IRT_CDATA))\n#define tref_istab(tr)\t\t(tref_istype((tr), IRT_TAB))\n#define tref_isudata(tr)\t(tref_istype((tr), IRT_UDATA))\n#define tref_isnum(tr)\t\t(tref_istype((tr), IRT_NUM))\n#define tref_isint(tr)\t\t(tref_istype((tr), IRT_INT))\n\n#define tref_isbool(tr)\t\t(tref_typerange((tr), IRT_FALSE, IRT_TRUE))\n#define tref_ispri(tr)\t\t(tref_typerange((tr), IRT_NIL, IRT_TRUE))\n#define tref_istruecond(tr)\t(!tref_typerange((tr), IRT_NIL, IRT_FALSE))\n#define tref_isinteger(tr)\t(tref_typerange((tr), IRT_I8, IRT_INT))\n#define tref_isnumber(tr)\t(tref_typerange((tr), IRT_NUM, IRT_INT))\n#define tref_isnumber_str(tr)\t(tref_isnumber((tr)) || tref_isstr((tr)))\n#define tref_isgcv(tr)\t\t(tref_typerange((tr), IRT_STR, IRT_UDATA))\n\n#define tref_isk(tr)\t\t(irref_isk(tref_ref((tr))))\n#define tref_isk2(tr1, tr2)\t(irref_isk(tref_ref((tr1) | (tr2))))\n\n#define TREF_PRI(t)\t\t(TREF(REF_NIL-(t), (t)))\n#define TREF_NIL\t\t(TREF_PRI(IRT_NIL))\n#define TREF_FALSE\t\t(TREF_PRI(IRT_FALSE))\n#define TREF_TRUE\t\t(TREF_PRI(IRT_TRUE))\n\n/* -- IR format ----------------------------------------------------------- */\n\n/* IR instruction format (64 bit).\n**\n**    16      16     8   8   8   8\n** +-------+-------+---+---+---+---+\n** |  op1  |  op2  | t | o | r | s |\n** +-------+-------+---+---+---+---+\n** |  op12/i/gco   |   ot  | prev  | (alternative fields in union)\n** +---------------+-------+-------+\n**        32           16      16\n**\n** prev is only valid prior to register allocation and then reused for r + s.\n*/\n\ntypedef union IRIns {\n  struct {\n    LJ_ENDIAN_LOHI(\n      IRRef1 op1;\t/* IR operand 1. */\n    , IRRef1 op2;\t/* IR operand 2. */\n    )\n    IROpT ot;\t\t/* IR opcode and type (overlaps t and o). */\n    IRRef1 prev;\t/* Previous ins in same chain (overlaps r and s). */\n  };\n  struct {\n    IRRef2 op12;\t/* IR operand 1 and 2 (overlaps op1 and op2). */\n    LJ_ENDIAN_LOHI(\n      IRType1 t;\t/* IR type. */\n    , IROp1 o;\t\t/* IR opcode. */\n    )\n    LJ_ENDIAN_LOHI(\n      uint8_t r;\t/* Register allocation (overlaps prev). */\n    , uint8_t s;\t/* Spill slot allocation (overlaps prev). */\n    )\n  };\n  int32_t i;\t\t/* 32 bit signed integer literal (overlaps op12). */\n  GCRef gcr;\t\t/* GCobj constant (overlaps op12). */\n  MRef ptr;\t\t/* Pointer constant (overlaps op12). */\n} IRIns;\n\n#define ir_kgc(ir)\tcheck_exp((ir)->o == IR_KGC, gcref((ir)->gcr))\n#define ir_kstr(ir)\t(gco2str(ir_kgc((ir))))\n#define ir_ktab(ir)\t(gco2tab(ir_kgc((ir))))\n#define ir_kfunc(ir)\t(gco2func(ir_kgc((ir))))\n#define ir_kcdata(ir)\t(gco2cd(ir_kgc((ir))))\n#define ir_knum(ir)\tcheck_exp((ir)->o == IR_KNUM, mref((ir)->ptr, cTValue))\n#define ir_kint64(ir)\tcheck_exp((ir)->o == IR_KINT64, mref((ir)->ptr,cTValue))\n#define ir_k64(ir) \\\n  check_exp((ir)->o == IR_KNUM || (ir)->o == IR_KINT64, mref((ir)->ptr,cTValue))\n#define ir_kptr(ir) \\\n  check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, mref((ir)->ptr, void))\n\n/* A store or any other op with a non-weak guard has a side-effect. */\nstatic LJ_AINLINE int ir_sideeff(IRIns *ir)\n{\n  return (((ir->t.irt | ~IRT_GUARD) & lj_ir_mode[ir->o]) >= IRM_S);\n}\n\nLJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_ircall.h",
    "content": "/*\n** IR CALL* instruction definitions.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_IRCALL_H\n#define _LJ_IRCALL_H\n\n#include \"lj_obj.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n\n/* C call info for CALL* instructions. */\ntypedef struct CCallInfo {\n  ASMFunction func;\t\t/* Function pointer. */\n  uint32_t flags;\t\t/* Number of arguments and flags. */\n} CCallInfo;\n\n#define CCI_NARGS(ci)\t\t((ci)->flags & 0xff)\t/* Extract # of args. */\n#define CCI_NARGS_MAX\t\t32\t\t\t/* Max. # of args. */\n\n#define CCI_OTSHIFT\t\t16\n#define CCI_OPTYPE(ci)\t\t((ci)->flags >> CCI_OTSHIFT)  /* Get op/type. */\n#define CCI_OPSHIFT\t\t24\n#define CCI_OP(ci)\t\t((ci)->flags >> CCI_OPSHIFT)  /* Get op. */\n\n#define CCI_CALL_N\t\t(IR_CALLN << CCI_OPSHIFT)\n#define CCI_CALL_L\t\t(IR_CALLL << CCI_OPSHIFT)\n#define CCI_CALL_S\t\t(IR_CALLS << CCI_OPSHIFT)\n#define CCI_CALL_FN\t\t(CCI_CALL_N|CCI_CC_FASTCALL)\n#define CCI_CALL_FL\t\t(CCI_CALL_L|CCI_CC_FASTCALL)\n#define CCI_CALL_FS\t\t(CCI_CALL_S|CCI_CC_FASTCALL)\n\n/* C call info flags. */\n#define CCI_L\t\t\t0x0100\t/* Implicit L arg. */\n#define CCI_CASTU64\t\t0x0200\t/* Cast u64 result to number. */\n#define CCI_NOFPRCLOBBER\t0x0400\t/* Does not clobber any FPRs. */\n#define CCI_VARARG\t\t0x0800\t/* Vararg function. */\n\n#define CCI_CC_MASK\t\t0x3000\t/* Calling convention mask. */\n#define CCI_CC_SHIFT\t\t12\n/* ORDER CC */\n#define CCI_CC_CDECL\t\t0x0000\t/* Default cdecl calling convention. */\n#define CCI_CC_THISCALL\t\t0x1000\t/* Thiscall calling convention. */\n#define CCI_CC_FASTCALL\t\t0x2000\t/* Fastcall calling convention. */\n#define CCI_CC_STDCALL\t\t0x3000\t/* Stdcall calling convention. */\n\n/* Helpers for conditional function definitions. */\n#define IRCALLCOND_ANY(x)\t\tx\n\n#if LJ_TARGET_X86ORX64\n#define IRCALLCOND_FPMATH(x)\t\tNULL\n#else\n#define IRCALLCOND_FPMATH(x)\t\tx\n#endif\n\n#if LJ_SOFTFP\n#define IRCALLCOND_SOFTFP(x)\t\tx\n#if LJ_HASFFI\n#define IRCALLCOND_SOFTFP_FFI(x)\tx\n#else\n#define IRCALLCOND_SOFTFP_FFI(x)\tNULL\n#endif\n#else\n#define IRCALLCOND_SOFTFP(x)\t\tNULL\n#define IRCALLCOND_SOFTFP_FFI(x)\tNULL\n#endif\n\n#define LJ_NEED_FP64\t(LJ_TARGET_ARM || LJ_TARGET_PPC || LJ_TARGET_MIPS)\n\n#if LJ_HASFFI && (LJ_SOFTFP || LJ_NEED_FP64)\n#define IRCALLCOND_FP64_FFI(x)\t\tx\n#else\n#define IRCALLCOND_FP64_FFI(x)\t\tNULL\n#endif\n\n#if LJ_HASFFI\n#define IRCALLCOND_FFI(x)\t\tx\n#if LJ_32\n#define IRCALLCOND_FFI32(x)\t\tx\n#else\n#define IRCALLCOND_FFI32(x)\t\tNULL\n#endif\n#else\n#define IRCALLCOND_FFI(x)\t\tNULL\n#define IRCALLCOND_FFI32(x)\t\tNULL\n#endif\n\n#if LJ_SOFTFP\n#define ARG1_FP\t\t2\t/* Treat as 2 32 bit arguments. */\n#else\n#define ARG1_FP\t\t1\n#endif\n\n#if LJ_32\n#define ARG2_64\t\t4\t/* Treat as 4 32 bit arguments. */\n#else\n#define ARG2_64\t\t2\n#endif\n\n/* Function definitions for CALL* instructions. */\n#define IRCALLDEF(_) \\\n  _(ANY,\tlj_str_cmp,\t\t2,  FN, INT, CCI_NOFPRCLOBBER) \\\n  _(ANY,\tlj_str_new,\t\t3,   S, STR, CCI_L) \\\n  _(ANY,\tlj_strscan_num,\t\t2,  FN, INT, 0) \\\n  _(ANY,\tlj_str_fromint,\t\t2,  FN, STR, CCI_L) \\\n  _(ANY,\tlj_str_fromnum,\t\t2,  FN, STR, CCI_L) \\\n  _(ANY,\tlj_tab_new1,\t\t2,  FS, TAB, CCI_L) \\\n  _(ANY,\tlj_tab_dup,\t\t2,  FS, TAB, CCI_L) \\\n  _(ANY,\tlj_tab_newkey,\t\t3,   S, P32, CCI_L) \\\n  _(ANY,\tlj_tab_len,\t\t1,  FL, INT, 0) \\\n  _(ANY,\tlj_gc_step_jit,\t\t2,  FS, NIL, CCI_L) \\\n  _(ANY,\tlj_gc_barrieruv,\t2,  FS, NIL, 0) \\\n  _(ANY,\tlj_mem_newgco,\t\t2,  FS, P32, CCI_L) \\\n  _(ANY,\tlj_math_random_step, 1, FS, NUM, CCI_CASTU64|CCI_NOFPRCLOBBER) \\\n  _(ANY,\tlj_vm_modi,\t\t2,  FN, INT, 0) \\\n  _(ANY,\tsinh,\t\t\tARG1_FP,  N, NUM, 0) \\\n  _(ANY,\tcosh,\t\t\tARG1_FP,  N, NUM, 0) \\\n  _(ANY,\ttanh,\t\t\tARG1_FP,  N, NUM, 0) \\\n  _(ANY,\tfputc,\t\t\t2,  S, INT, 0) \\\n  _(ANY,\tfwrite,\t\t\t4,  S, INT, 0) \\\n  _(ANY,\tfflush,\t\t\t1,  S, INT, 0) \\\n  /* ORDER FPM */ \\\n  _(FPMATH,\tlj_vm_floor,\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tlj_vm_ceil,\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tlj_vm_trunc,\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tsqrt,\t\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\texp,\t\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tlj_vm_exp2,\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tlog,\t\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tlj_vm_log2,\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tlog10,\t\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tsin,\t\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tcos,\t\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\ttan,\t\t\tARG1_FP,   N, NUM, 0) \\\n  _(FPMATH,\tlj_vm_powi,\t\tARG1_FP+1, N, NUM, 0) \\\n  _(FPMATH,\tpow,\t\t\tARG1_FP*2, N, NUM, 0) \\\n  _(FPMATH,\tatan2,\t\t\tARG1_FP*2, N, NUM, 0) \\\n  _(FPMATH,\tldexp,\t\t\tARG1_FP+1, N, NUM, 0) \\\n  _(SOFTFP,\tlj_vm_tobit,\t\t2,   N, INT, 0) \\\n  _(SOFTFP,\tsoftfp_add,\t\t4,   N, NUM, 0) \\\n  _(SOFTFP,\tsoftfp_sub,\t\t4,   N, NUM, 0) \\\n  _(SOFTFP,\tsoftfp_mul,\t\t4,   N, NUM, 0) \\\n  _(SOFTFP,\tsoftfp_div,\t\t4,   N, NUM, 0) \\\n  _(SOFTFP,\tsoftfp_cmp,\t\t4,   N, NIL, 0) \\\n  _(SOFTFP,\tsoftfp_i2d,\t\t1,   N, NUM, 0) \\\n  _(SOFTFP,\tsoftfp_d2i,\t\t2,   N, INT, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_ui2d,\t\t1,   N, NUM, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_f2d,\t\t1,   N, NUM, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_d2ui,\t\t2,   N, INT, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_d2f,\t\t2,   N, FLOAT, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_i2f,\t\t1,   N, FLOAT, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_ui2f,\t\t1,   N, FLOAT, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_f2i,\t\t1,   N, INT, 0) \\\n  _(SOFTFP_FFI,\tsoftfp_f2ui,\t\t1,   N, INT, 0) \\\n  _(FP64_FFI,\tfp64_l2d,\t\t2,   N, NUM, 0) \\\n  _(FP64_FFI,\tfp64_ul2d,\t\t2,   N, NUM, 0) \\\n  _(FP64_FFI,\tfp64_l2f,\t\t2,   N, FLOAT, 0) \\\n  _(FP64_FFI,\tfp64_ul2f,\t\t2,   N, FLOAT, 0) \\\n  _(FP64_FFI,\tfp64_d2l,\t\tARG1_FP,   N, I64, 0) \\\n  _(FP64_FFI,\tfp64_d2ul,\t\tARG1_FP,   N, U64, 0) \\\n  _(FP64_FFI,\tfp64_f2l,\t\t1,   N, I64, 0) \\\n  _(FP64_FFI,\tfp64_f2ul,\t\t1,   N, U64, 0) \\\n  _(FFI,\tlj_carith_divi64,\tARG2_64,   N, I64, CCI_NOFPRCLOBBER) \\\n  _(FFI,\tlj_carith_divu64,\tARG2_64,   N, U64, CCI_NOFPRCLOBBER) \\\n  _(FFI,\tlj_carith_modi64,\tARG2_64,   N, I64, CCI_NOFPRCLOBBER) \\\n  _(FFI,\tlj_carith_modu64,\tARG2_64,   N, U64, CCI_NOFPRCLOBBER) \\\n  _(FFI,\tlj_carith_powi64,\tARG2_64,   N, I64, CCI_NOFPRCLOBBER) \\\n  _(FFI,\tlj_carith_powu64,\tARG2_64,   N, U64, CCI_NOFPRCLOBBER) \\\n  _(FFI,\tlj_cdata_setfin,\t2,        FN, P32, CCI_L) \\\n  _(FFI,\tstrlen,\t\t\t1,         L, INTP, 0) \\\n  _(FFI,\tmemcpy,\t\t\t3,         S, PTR, 0) \\\n  _(FFI,\tmemset,\t\t\t3,         S, PTR, 0) \\\n  _(FFI,\tlj_vm_errno,\t\t0,         S, INT, CCI_NOFPRCLOBBER) \\\n  _(FFI32,\tlj_carith_mul64,\tARG2_64,   N, I64, CCI_NOFPRCLOBBER)\n  \\\n  /* End of list. */\n\ntypedef enum {\n#define IRCALLENUM(cond, name, nargs, kind, type, flags)\tIRCALL_##name,\nIRCALLDEF(IRCALLENUM)\n#undef IRCALLENUM\n  IRCALL__MAX\n} IRCallID;\n\nLJ_FUNC TRef lj_ir_call(jit_State *J, IRCallID id, ...);\n\nLJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];\n\n/* Soft-float declarations. */\n#if LJ_SOFTFP\n#if LJ_TARGET_ARM\n#define softfp_add __aeabi_dadd\n#define softfp_sub __aeabi_dsub\n#define softfp_mul __aeabi_dmul\n#define softfp_div __aeabi_ddiv\n#define softfp_cmp __aeabi_cdcmple\n#define softfp_i2d __aeabi_i2d\n#define softfp_d2i __aeabi_d2iz\n#define softfp_ui2d __aeabi_ui2d\n#define softfp_f2d __aeabi_f2d\n#define softfp_d2ui __aeabi_d2uiz\n#define softfp_d2f __aeabi_d2f\n#define softfp_i2f __aeabi_i2f\n#define softfp_ui2f __aeabi_ui2f\n#define softfp_f2i __aeabi_f2iz\n#define softfp_f2ui __aeabi_f2uiz\n#define fp64_l2d __aeabi_l2d\n#define fp64_ul2d __aeabi_ul2d\n#define fp64_l2f __aeabi_l2f\n#define fp64_ul2f __aeabi_ul2f\n#if LJ_TARGET_IOS\n#define fp64_d2l __fixdfdi\n#define fp64_d2ul __fixunsdfdi\n#define fp64_f2l __fixsfdi\n#define fp64_f2ul __fixunssfdi\n#else\n#define fp64_d2l __aeabi_d2lz\n#define fp64_d2ul __aeabi_d2ulz\n#define fp64_f2l __aeabi_f2lz\n#define fp64_f2ul __aeabi_f2ulz\n#endif\n#else\n#error \"Missing soft-float definitions for target architecture\"\n#endif\nextern double softfp_add(double a, double b);\nextern double softfp_sub(double a, double b);\nextern double softfp_mul(double a, double b);\nextern double softfp_div(double a, double b);\nextern void softfp_cmp(double a, double b);\nextern double softfp_i2d(int32_t a);\nextern int32_t softfp_d2i(double a);\n#if LJ_HASFFI\nextern double softfp_ui2d(uint32_t a);\nextern double softfp_f2d(float a);\nextern uint32_t softfp_d2ui(double a);\nextern float softfp_d2f(double a);\nextern float softfp_i2f(int32_t a);\nextern float softfp_ui2f(uint32_t a);\nextern int32_t softfp_f2i(float a);\nextern uint32_t softfp_f2ui(float a);\n#endif\n#endif\n\n#if LJ_HASFFI && LJ_NEED_FP64 && !(LJ_TARGET_ARM && LJ_SOFTFP)\n#ifdef __GNUC__\n#define fp64_l2d __floatdidf\n#define fp64_ul2d __floatundidf\n#define fp64_l2f __floatdisf\n#define fp64_ul2f __floatundisf\n#define fp64_d2l __fixdfdi\n#define fp64_d2ul __fixunsdfdi\n#define fp64_f2l __fixsfdi\n#define fp64_f2ul __fixunssfdi\n#else\n#error \"Missing fp64 helper definitions for this compiler\"\n#endif\n#endif\n\n#if LJ_HASFFI && (LJ_SOFTFP || LJ_NEED_FP64)\nextern double fp64_l2d(int64_t a);\nextern double fp64_ul2d(uint64_t a);\nextern float fp64_l2f(int64_t a);\nextern float fp64_ul2f(uint64_t a);\nextern int64_t fp64_d2l(double a);\nextern uint64_t fp64_d2ul(double a);\nextern int64_t fp64_f2l(float a);\nextern uint64_t fp64_f2ul(float a);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_iropt.h",
    "content": "/*\n** Common header for IR emitter and optimizations.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_IROPT_H\n#define _LJ_IROPT_H\n\n#include <stdarg.h>\n\n#include \"lj_obj.h\"\n#include \"lj_jit.h\"\n\n#if LJ_HASJIT\n/* IR emitter. */\nLJ_FUNC void LJ_FASTCALL lj_ir_growtop(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_ir_emit(jit_State *J);\n\n/* Save current IR in J->fold.ins, but do not emit it (yet). */\nstatic LJ_AINLINE void lj_ir_set_(jit_State *J, uint16_t ot, IRRef1 a, IRRef1 b)\n{\n  J->fold.ins.ot = ot; J->fold.ins.op1 = a; J->fold.ins.op2 = b;\n}\n\n#define lj_ir_set(J, ot, a, b) \\\n  lj_ir_set_(J, (uint16_t)(ot), (IRRef1)(a), (IRRef1)(b))\n\n/* Get ref of next IR instruction and optionally grow IR.\n** Note: this may invalidate all IRIns*!\n*/\nstatic LJ_AINLINE IRRef lj_ir_nextins(jit_State *J)\n{\n  IRRef ref = J->cur.nins;\n  if (LJ_UNLIKELY(ref >= J->irtoplim)) lj_ir_growtop(J);\n  J->cur.nins = ref + 1;\n  return ref;\n}\n\n/* Interning of constants. */\nLJ_FUNC TRef LJ_FASTCALL lj_ir_kint(jit_State *J, int32_t k);\nLJ_FUNC void lj_ir_k64_freeall(jit_State *J);\nLJ_FUNC TRef lj_ir_k64(jit_State *J, IROp op, cTValue *tv);\nLJ_FUNC cTValue *lj_ir_k64_find(jit_State *J, uint64_t u64);\nLJ_FUNC TRef lj_ir_knum_u64(jit_State *J, uint64_t u64);\nLJ_FUNC TRef lj_ir_knumint(jit_State *J, lua_Number n);\nLJ_FUNC TRef lj_ir_kint64(jit_State *J, uint64_t u64);\nLJ_FUNC TRef lj_ir_kgc(jit_State *J, GCobj *o, IRType t);\nLJ_FUNC TRef lj_ir_kptr_(jit_State *J, IROp op, void *ptr);\nLJ_FUNC TRef lj_ir_knull(jit_State *J, IRType t);\nLJ_FUNC TRef lj_ir_kslot(jit_State *J, TRef key, IRRef slot);\n\n#if LJ_64\n#define lj_ir_kintp(J, k)\tlj_ir_kint64(J, (uint64_t)(k))\n#else\n#define lj_ir_kintp(J, k)\tlj_ir_kint(J, (int32_t)(k))\n#endif\n\nstatic LJ_AINLINE TRef lj_ir_knum(jit_State *J, lua_Number n)\n{\n  TValue tv;\n  tv.n = n;\n  return lj_ir_knum_u64(J, tv.u64);\n}\n\n#define lj_ir_kstr(J, str)\tlj_ir_kgc(J, obj2gco((str)), IRT_STR)\n#define lj_ir_ktab(J, tab)\tlj_ir_kgc(J, obj2gco((tab)), IRT_TAB)\n#define lj_ir_kfunc(J, func)\tlj_ir_kgc(J, obj2gco((func)), IRT_FUNC)\n#define lj_ir_kptr(J, ptr)\tlj_ir_kptr_(J, IR_KPTR, (ptr))\n#define lj_ir_kkptr(J, ptr)\tlj_ir_kptr_(J, IR_KKPTR, (ptr))\n\n/* Special FP constants. */\n#define lj_ir_knum_zero(J)\tlj_ir_knum_u64(J, U64x(00000000,00000000))\n#define lj_ir_knum_one(J)\tlj_ir_knum_u64(J, U64x(3ff00000,00000000))\n#define lj_ir_knum_tobit(J)\tlj_ir_knum_u64(J, U64x(43380000,00000000))\n\n/* Special 128 bit SIMD constants. */\n#define lj_ir_knum_abs(J)\tlj_ir_k64(J, IR_KNUM, LJ_KSIMD(J, LJ_KSIMD_ABS))\n#define lj_ir_knum_neg(J)\tlj_ir_k64(J, IR_KNUM, LJ_KSIMD(J, LJ_KSIMD_NEG))\n\n/* Access to constants. */\nLJ_FUNC void lj_ir_kvalue(lua_State *L, TValue *tv, const IRIns *ir);\n\n/* Convert IR operand types. */\nLJ_FUNC TRef LJ_FASTCALL lj_ir_tonumber(jit_State *J, TRef tr);\nLJ_FUNC TRef LJ_FASTCALL lj_ir_tonum(jit_State *J, TRef tr);\nLJ_FUNC TRef LJ_FASTCALL lj_ir_tostr(jit_State *J, TRef tr);\n\n/* Miscellaneous IR ops. */\nLJ_FUNC int lj_ir_numcmp(lua_Number a, lua_Number b, IROp op);\nLJ_FUNC int lj_ir_strcmp(GCstr *a, GCstr *b, IROp op);\nLJ_FUNC void lj_ir_rollback(jit_State *J, IRRef ref);\n\n/* Emit IR instructions with on-the-fly optimizations. */\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fold(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_cse(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_cselim(jit_State *J, IRRef lim);\n\n/* Special return values for the fold functions. */\nenum {\n  NEXTFOLD,\t\t/* Couldn't fold, pass on. */\n  RETRYFOLD,\t\t/* Retry fold with modified fins. */\n  KINTFOLD,\t\t/* Return ref for int constant in fins->i. */\n  FAILFOLD,\t\t/* Guard would always fail. */\n  DROPFOLD,\t\t/* Guard eliminated. */\n  MAX_FOLD\n};\n\n#define INTFOLD(k)\t((J->fold.ins.i = (k)), (TRef)KINTFOLD)\n#define INT64FOLD(k)\t(lj_ir_kint64(J, (k)))\n#define CONDFOLD(cond)\t((TRef)FAILFOLD + (TRef)(cond))\n#define LEFTFOLD\t(J->fold.ins.op1)\n#define RIGHTFOLD\t(J->fold.ins.op2)\n#define CSEFOLD\t\t(lj_opt_cse(J))\n#define EMITFOLD\t(lj_ir_emit(J))\n\n/* Load/store forwarding. */\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_aload(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_hload(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_uload(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_fload(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_tab_len(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_fwd_hrefk(jit_State *J);\nLJ_FUNC int LJ_FASTCALL lj_opt_fwd_href_nokey(jit_State *J);\nLJ_FUNC int LJ_FASTCALL lj_opt_fwd_tptr(jit_State *J, IRRef lim);\nLJ_FUNC int lj_opt_fwd_wasnonnil(jit_State *J, IROpT loadop, IRRef xref);\n\n/* Dead-store elimination. */\nLJ_FUNC TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_dse_ustore(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_dse_fstore(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_dse_xstore(jit_State *J);\n\n/* Narrowing. */\nLJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_convert(jit_State *J);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_index(jit_State *J, TRef key);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_toint(jit_State *J, TRef tr);\nLJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_tobit(jit_State *J, TRef tr);\n#if LJ_HASFFI\nLJ_FUNC TRef LJ_FASTCALL lj_opt_narrow_cindex(jit_State *J, TRef key);\n#endif\nLJ_FUNC TRef lj_opt_narrow_arith(jit_State *J, TRef rb, TRef rc,\n\t\t\t\t TValue *vb, TValue *vc, IROp op);\nLJ_FUNC TRef lj_opt_narrow_unm(jit_State *J, TRef rc, TValue *vc);\nLJ_FUNC TRef lj_opt_narrow_mod(jit_State *J, TRef rb, TRef rc, TValue *vc);\nLJ_FUNC TRef lj_opt_narrow_pow(jit_State *J, TRef rb, TRef rc, TValue *vc);\nLJ_FUNC IRType lj_opt_narrow_forl(jit_State *J, cTValue *forbase);\n\n/* Optimization passes. */\nLJ_FUNC void lj_opt_dce(jit_State *J);\nLJ_FUNC int lj_opt_loop(jit_State *J);\n#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI)\nLJ_FUNC void lj_opt_split(jit_State *J);\n#else\n#define lj_opt_split(J)\t\tUNUSED(J)\n#endif\nLJ_FUNC void lj_opt_sink(jit_State *J);\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_jit.h",
    "content": "/*\n** Common definitions for the JIT compiler.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_JIT_H\n#define _LJ_JIT_H\n\n#include \"lj_obj.h\"\n#include \"lj_ir.h\"\n\n/* JIT engine flags. */\n#define JIT_F_ON\t\t0x00000001\n\n/* CPU-specific JIT engine flags. */\n#if LJ_TARGET_X86ORX64\n#define JIT_F_CMOV\t\t0x00000010\n#define JIT_F_SSE2\t\t0x00000020\n#define JIT_F_SSE3\t\t0x00000040\n#define JIT_F_SSE4_1\t\t0x00000080\n#define JIT_F_P4\t\t0x00000100\n#define JIT_F_PREFER_IMUL\t0x00000200\n#define JIT_F_SPLIT_XMM\t\t0x00000400\n#define JIT_F_LEA_AGU\t\t0x00000800\n\n/* Names for the CPU-specific flags. Must match the order above. */\n#define JIT_F_CPU_FIRST\t\tJIT_F_CMOV\n#define JIT_F_CPUSTRING\t\t\"\\4CMOV\\4SSE2\\4SSE3\\6SSE4.1\\2P4\\3AMD\\2K8\\4ATOM\"\n#elif LJ_TARGET_ARM\n#define JIT_F_ARMV6_\t\t0x00000010\n#define JIT_F_ARMV6T2_\t\t0x00000020\n#define JIT_F_ARMV7\t\t0x00000040\n#define JIT_F_VFPV2\t\t0x00000080\n#define JIT_F_VFPV3\t\t0x00000100\n\n#define JIT_F_ARMV6\t\t(JIT_F_ARMV6_|JIT_F_ARMV6T2_|JIT_F_ARMV7)\n#define JIT_F_ARMV6T2\t\t(JIT_F_ARMV6T2_|JIT_F_ARMV7)\n#define JIT_F_VFP\t\t(JIT_F_VFPV2|JIT_F_VFPV3)\n\n/* Names for the CPU-specific flags. Must match the order above. */\n#define JIT_F_CPU_FIRST\t\tJIT_F_ARMV6_\n#define JIT_F_CPUSTRING\t\t\"\\5ARMv6\\7ARMv6T2\\5ARMv7\\5VFPv2\\5VFPv3\"\n#elif LJ_TARGET_PPC\n#define JIT_F_SQRT\t\t0x00000010\n#define JIT_F_ROUND\t\t0x00000020\n\n/* Names for the CPU-specific flags. Must match the order above. */\n#define JIT_F_CPU_FIRST\t\tJIT_F_SQRT\n#define JIT_F_CPUSTRING\t\t\"\\4SQRT\\5ROUND\"\n#elif LJ_TARGET_MIPS\n#define JIT_F_MIPS32R2\t\t0x00000010\n\n/* Names for the CPU-specific flags. Must match the order above. */\n#define JIT_F_CPU_FIRST\t\tJIT_F_MIPS32R2\n#define JIT_F_CPUSTRING\t\t\"\\010MIPS32R2\"\n#else\n#define JIT_F_CPU_FIRST\t\t0\n#define JIT_F_CPUSTRING\t\t\"\"\n#endif\n\n/* Optimization flags. */\n#define JIT_F_OPT_MASK\t\t0x0fff0000\n\n#define JIT_F_OPT_FOLD\t\t0x00010000\n#define JIT_F_OPT_CSE\t\t0x00020000\n#define JIT_F_OPT_DCE\t\t0x00040000\n#define JIT_F_OPT_FWD\t\t0x00080000\n#define JIT_F_OPT_DSE\t\t0x00100000\n#define JIT_F_OPT_NARROW\t0x00200000\n#define JIT_F_OPT_LOOP\t\t0x00400000\n#define JIT_F_OPT_ABC\t\t0x00800000\n#define JIT_F_OPT_SINK\t\t0x01000000\n#define JIT_F_OPT_FUSE\t\t0x02000000\n\n/* Optimizations names for -O. Must match the order above. */\n#define JIT_F_OPT_FIRST\t\tJIT_F_OPT_FOLD\n#define JIT_F_OPTSTRING\t\\\n  \"\\4fold\\3cse\\3dce\\3fwd\\3dse\\6narrow\\4loop\\3abc\\4sink\\4fuse\"\n\n/* Optimization levels set a fixed combination of flags. */\n#define JIT_F_OPT_0\t0\n#define JIT_F_OPT_1\t(JIT_F_OPT_FOLD|JIT_F_OPT_CSE|JIT_F_OPT_DCE)\n#define JIT_F_OPT_2\t(JIT_F_OPT_1|JIT_F_OPT_NARROW|JIT_F_OPT_LOOP)\n#define JIT_F_OPT_3\t(JIT_F_OPT_2|\\\n  JIT_F_OPT_FWD|JIT_F_OPT_DSE|JIT_F_OPT_ABC|JIT_F_OPT_SINK|JIT_F_OPT_FUSE)\n#define JIT_F_OPT_DEFAULT\tJIT_F_OPT_3\n\n#if LJ_TARGET_WINDOWS || LJ_64\n/* See: http://blogs.msdn.com/oldnewthing/archive/2003/10/08/55239.aspx */\n#define JIT_P_sizemcode_DEFAULT\t\t64\n#else\n/* Could go as low as 4K, but the mmap() overhead would be rather high. */\n#define JIT_P_sizemcode_DEFAULT\t\t32\n#endif\n\n/* Optimization parameters and their defaults. Length is a char in octal! */\n#define JIT_PARAMDEF(_) \\\n  _(\\010, maxtrace,\t1000)\t/* Max. # of traces in cache. */ \\\n  _(\\011, maxrecord,\t4000)\t/* Max. # of recorded IR instructions. */ \\\n  _(\\012, maxirconst,\t500)\t/* Max. # of IR constants of a trace. */ \\\n  _(\\007, maxside,\t100)\t/* Max. # of side traces of a root trace. */ \\\n  _(\\007, maxsnap,\t500)\t/* Max. # of snapshots for a trace. */ \\\n  \\\n  _(\\007, hotloop,\t56)\t/* # of iter. to detect a hot loop/call. */ \\\n  _(\\007, hotexit,\t10)\t/* # of taken exits to start a side trace. */ \\\n  _(\\007, tryside,\t4)\t/* # of attempts to compile a side trace. */ \\\n  \\\n  _(\\012, instunroll,\t4)\t/* Max. unroll for instable loops. */ \\\n  _(\\012, loopunroll,\t15)\t/* Max. unroll for loop ops in side traces. */ \\\n  _(\\012, callunroll,\t3)\t/* Max. unroll for recursive calls. */ \\\n  _(\\011, recunroll,\t2)\t/* Min. unroll for true recursion. */ \\\n  \\\n  /* Size of each machine code area (in KBytes). */ \\\n  _(\\011, sizemcode,\tJIT_P_sizemcode_DEFAULT) \\\n  /* Max. total size of all machine code areas (in KBytes). */ \\\n  _(\\010, maxmcode,\t512) \\\n  /* End of list. */\n\nenum {\n#define JIT_PARAMENUM(len, name, value)\tJIT_P_##name,\nJIT_PARAMDEF(JIT_PARAMENUM)\n#undef JIT_PARAMENUM\n  JIT_P__MAX\n};\n\n#define JIT_PARAMSTR(len, name, value)\t#len #name\n#define JIT_P_STRING\tJIT_PARAMDEF(JIT_PARAMSTR)\n\n/* Trace compiler state. */\ntypedef enum {\n  LJ_TRACE_IDLE,\t/* Trace compiler idle. */\n  LJ_TRACE_ACTIVE = 0x10,\n  LJ_TRACE_RECORD,\t/* Bytecode recording active. */\n  LJ_TRACE_START,\t/* New trace started. */\n  LJ_TRACE_END,\t\t/* End of trace. */\n  LJ_TRACE_ASM,\t\t/* Assemble trace. */\n  LJ_TRACE_ERR\t\t/* Trace aborted with error. */\n} TraceState;\n\n/* Post-processing action. */\ntypedef enum {\n  LJ_POST_NONE,\t\t/* No action. */\n  LJ_POST_FIXCOMP,\t/* Fixup comparison and emit pending guard. */\n  LJ_POST_FIXGUARD,\t/* Fixup and emit pending guard. */\n  LJ_POST_FIXGUARDSNAP,\t/* Fixup and emit pending guard and snapshot. */\n  LJ_POST_FIXBOOL,\t/* Fixup boolean result. */\n  LJ_POST_FIXCONST,\t/* Fixup constant results. */\n  LJ_POST_FFRETRY\t/* Suppress recording of retried fast functions. */\n} PostProc;\n\n/* Machine code type. */\n#if LJ_TARGET_X86ORX64\ntypedef uint8_t MCode;\n#else\ntypedef uint32_t MCode;\n#endif\n\n/* Stack snapshot header. */\ntypedef struct SnapShot {\n  uint16_t mapofs;\t/* Offset into snapshot map. */\n  IRRef1 ref;\t\t/* First IR ref for this snapshot. */\n  uint8_t nslots;\t/* Number of valid slots. */\n  uint8_t topslot;\t/* Maximum frame extent. */\n  uint8_t nent;\t\t/* Number of compressed entries. */\n  uint8_t count;\t/* Count of taken exits for this snapshot. */\n} SnapShot;\n\n#define SNAPCOUNT_DONE\t255\t/* Already compiled and linked a side trace. */\n\n/* Compressed snapshot entry. */\ntypedef uint32_t SnapEntry;\n\n#define SNAP_FRAME\t\t0x010000\t/* Frame slot. */\n#define SNAP_CONT\t\t0x020000\t/* Continuation slot. */\n#define SNAP_NORESTORE\t\t0x040000\t/* No need to restore slot. */\n#define SNAP_SOFTFPNUM\t\t0x080000\t/* Soft-float number. */\nLJ_STATIC_ASSERT(SNAP_FRAME == TREF_FRAME);\nLJ_STATIC_ASSERT(SNAP_CONT == TREF_CONT);\n\n#define SNAP(slot, flags, ref)\t(((SnapEntry)(slot) << 24) + (flags) + (ref))\n#define SNAP_TR(slot, tr) \\\n  (((SnapEntry)(slot) << 24) + ((tr) & (TREF_CONT|TREF_FRAME|TREF_REFMASK)))\n#define SNAP_MKPC(pc)\t\t((SnapEntry)u32ptr(pc))\n#define SNAP_MKFTSZ(ftsz)\t((SnapEntry)(ftsz))\n#define snap_ref(sn)\t\t((sn) & 0xffff)\n#define snap_slot(sn)\t\t((BCReg)((sn) >> 24))\n#define snap_isframe(sn)\t((sn) & SNAP_FRAME)\n#define snap_pc(sn)\t\t((const BCIns *)(uintptr_t)(sn))\n#define snap_setref(sn, ref)\t(((sn) & (0xffff0000&~SNAP_NORESTORE)) | (ref))\n\n/* Snapshot and exit numbers. */\ntypedef uint32_t SnapNo;\ntypedef uint32_t ExitNo;\n\n/* Trace number. */\ntypedef uint32_t TraceNo;\t/* Used to pass around trace numbers. */\ntypedef uint16_t TraceNo1;\t/* Stored trace number. */\n\n/* Type of link. ORDER LJ_TRLINK */\ntypedef enum {\n  LJ_TRLINK_NONE,\t\t/* Incomplete trace. No link, yet. */\n  LJ_TRLINK_ROOT,\t\t/* Link to other root trace. */\n  LJ_TRLINK_LOOP,\t\t/* Loop to same trace. */\n  LJ_TRLINK_TAILREC,\t\t/* Tail-recursion. */\n  LJ_TRLINK_UPREC,\t\t/* Up-recursion. */\n  LJ_TRLINK_DOWNREC,\t\t/* Down-recursion. */\n  LJ_TRLINK_INTERP,\t\t/* Fallback to interpreter. */\n  LJ_TRLINK_RETURN\t\t/* Return to interpreter. */\n} TraceLink;\n\n/* Trace object. */\ntypedef struct GCtrace {\n  GCHeader;\n  uint8_t topslot;\t/* Top stack slot already checked to be allocated. */\n  uint8_t linktype;\t/* Type of link. */\n  IRRef nins;\t\t/* Next IR instruction. Biased with REF_BIAS. */\n  GCRef gclist;\n  IRIns *ir;\t\t/* IR instructions/constants. Biased with REF_BIAS. */\n  IRRef nk;\t\t/* Lowest IR constant. Biased with REF_BIAS. */\n  uint16_t nsnap;\t/* Number of snapshots. */\n  uint16_t nsnapmap;\t/* Number of snapshot map elements. */\n  SnapShot *snap;\t/* Snapshot array. */\n  SnapEntry *snapmap;\t/* Snapshot map. */\n  GCRef startpt;\t/* Starting prototype. */\n  MRef startpc;\t\t/* Bytecode PC of starting instruction. */\n  BCIns startins;\t/* Original bytecode of starting instruction. */\n  MSize szmcode;\t/* Size of machine code. */\n  MCode *mcode;\t\t/* Start of machine code. */\n  MSize mcloop;\t\t/* Offset of loop start in machine code. */\n  uint16_t nchild;\t/* Number of child traces (root trace only). */\n  uint16_t spadjust;\t/* Stack pointer adjustment (offset in bytes). */\n  TraceNo1 traceno;\t/* Trace number. */\n  TraceNo1 link;\t/* Linked trace (or self for loops). */\n  TraceNo1 root;\t/* Root trace of side trace (or 0 for root traces). */\n  TraceNo1 nextroot;\t/* Next root trace for same prototype. */\n  TraceNo1 nextside;\t/* Next side trace of same root trace. */\n  uint8_t sinktags;\t/* Trace has SINK tags. */\n  uint8_t unused1;\n#ifdef LUAJIT_USE_GDBJIT\n  void *gdbjit_entry;\t/* GDB JIT entry. */\n#endif\n} GCtrace;\n\n#define gco2trace(o)\tcheck_exp((o)->gch.gct == ~LJ_TTRACE, (GCtrace *)(o))\n#define traceref(J, n) \\\n  check_exp((n)>0 && (MSize)(n)<J->sizetrace, (GCtrace *)gcref(J->trace[(n)]))\n\nLJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCtrace, gclist));\n\nstatic LJ_AINLINE MSize snap_nextofs(GCtrace *T, SnapShot *snap)\n{\n  if (snap+1 == &T->snap[T->nsnap])\n    return T->nsnapmap;\n  else\n    return (snap+1)->mapofs;\n}\n\n/* Round-robin penalty cache for bytecodes leading to aborted traces. */\ntypedef struct HotPenalty {\n  MRef pc;\t\t/* Starting bytecode PC. */\n  uint16_t val;\t\t/* Penalty value, i.e. hotcount start. */\n  uint16_t reason;\t/* Abort reason (really TraceErr). */\n} HotPenalty;\n\n#define PENALTY_SLOTS\t64\t/* Penalty cache slot. Must be a power of 2. */\n#define PENALTY_MIN\t(36*2)\t/* Minimum penalty value. */\n#define PENALTY_MAX\t60000\t/* Maximum penalty value. */\n#define PENALTY_RNDBITS\t4\t/* # of random bits to add to penalty value. */\n\n/* Round-robin backpropagation cache for narrowing conversions. */\ntypedef struct BPropEntry {\n  IRRef1 key;\t\t/* Key: original reference. */\n  IRRef1 val;\t\t/* Value: reference after conversion. */\n  IRRef mode;\t\t/* Mode for this entry (currently IRCONV_*). */\n} BPropEntry;\n\n/* Number of slots for the backpropagation cache. Must be a power of 2. */\n#define BPROP_SLOTS\t16\n\n/* Scalar evolution analysis cache. */\ntypedef struct ScEvEntry {\n  IRRef1 idx;\t\t/* Index reference. */\n  IRRef1 start;\t\t/* Constant start reference. */\n  IRRef1 stop;\t\t/* Constant stop reference. */\n  IRRef1 step;\t\t/* Constant step reference. */\n  IRType1 t;\t\t/* Scalar type. */\n  uint8_t dir;\t\t/* Direction. 1: +, 0: -. */\n} ScEvEntry;\n\n/* 128 bit SIMD constants. */\nenum {\n  LJ_KSIMD_ABS,\n  LJ_KSIMD_NEG,\n  LJ_KSIMD__MAX\n};\n\n/* Get 16 byte aligned pointer to SIMD constant. */\n#define LJ_KSIMD(J, n) \\\n  ((TValue *)(((intptr_t)&J->ksimd[2*(n)] + 15) & ~(intptr_t)15))\n\n/* Set/reset flag to activate the SPLIT pass for the current trace. */\n#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI)\n#define lj_needsplit(J)\t\t(J->needsplit = 1)\n#define lj_resetsplit(J)\t(J->needsplit = 0)\n#else\n#define lj_needsplit(J)\t\tUNUSED(J)\n#define lj_resetsplit(J)\tUNUSED(J)\n#endif\n\n/* Fold state is used to fold instructions on-the-fly. */\ntypedef struct FoldState {\n  IRIns ins;\t\t/* Currently emitted instruction. */\n  IRIns left;\t\t/* Instruction referenced by left operand. */\n  IRIns right;\t\t/* Instruction referenced by right operand. */\n} FoldState;\n\n/* JIT compiler state. */\ntypedef struct jit_State {\n  GCtrace cur;\t\t/* Current trace. */\n\n  lua_State *L;\t\t/* Current Lua state. */\n  const BCIns *pc;\t/* Current PC. */\n  GCfunc *fn;\t\t/* Current function. */\n  GCproto *pt;\t\t/* Current prototype. */\n  TRef *base;\t\t/* Current frame base, points into J->slots. */\n\n  uint32_t flags;\t/* JIT engine flags. */\n  BCReg maxslot;\t/* Relative to baseslot. */\n  BCReg baseslot;\t/* Current frame base, offset into J->slots. */\n\n  uint8_t mergesnap;\t/* Allowed to merge with next snapshot. */\n  uint8_t needsnap;\t/* Need snapshot before recording next bytecode. */\n  IRType1 guardemit;\t/* Accumulated IRT_GUARD for emitted instructions. */\n  uint8_t bcskip;\t/* Number of bytecode instructions to skip. */\n\n  FoldState fold;\t/* Fold state. */\n\n  const BCIns *bc_min;\t/* Start of allowed bytecode range for root trace. */\n  MSize bc_extent;\t/* Extent of the range. */\n\n  TraceState state;\t/* Trace compiler state. */\n\n  int32_t instunroll;\t/* Unroll counter for instable loops. */\n  int32_t loopunroll;\t/* Unroll counter for loop ops in side traces. */\n  int32_t tailcalled;\t/* Number of successive tailcalls. */\n  int32_t framedepth;\t/* Current frame depth. */\n  int32_t retdepth;\t/* Return frame depth (count of RETF). */\n\n  MRef k64;\t\t/* Pointer to chained array of 64 bit constants. */\n  TValue ksimd[LJ_KSIMD__MAX*2+1];  /* 16 byte aligned SIMD constants. */\n\n  IRIns *irbuf;\t\t/* Temp. IR instruction buffer. Biased with REF_BIAS. */\n  IRRef irtoplim;\t/* Upper limit of instuction buffer (biased). */\n  IRRef irbotlim;\t/* Lower limit of instuction buffer (biased). */\n  IRRef loopref;\t/* Last loop reference or ref of final LOOP (or 0). */\n\n  MSize sizesnap;\t/* Size of temp. snapshot buffer. */\n  SnapShot *snapbuf;\t/* Temp. snapshot buffer. */\n  SnapEntry *snapmapbuf;  /* Temp. snapshot map buffer. */\n  MSize sizesnapmap;\t/* Size of temp. snapshot map buffer. */\n\n  PostProc postproc;\t/* Required post-processing after execution. */\n#if LJ_SOFTFP || (LJ_32 && LJ_HASFFI)\n  int needsplit;\t/* Need SPLIT pass. */\n#endif\n\n  GCRef *trace;\t\t/* Array of traces. */\n  TraceNo freetrace;\t/* Start of scan for next free trace. */\n  MSize sizetrace;\t/* Size of trace array. */\n\n  IRRef1 chain[IR__MAX];  /* IR instruction skip-list chain anchors. */\n  TRef slot[LJ_MAX_JSLOTS+LJ_STACK_EXTRA];  /* Stack slot map. */\n\n  int32_t param[JIT_P__MAX];  /* JIT engine parameters. */\n\n  MCode *exitstubgroup[LJ_MAX_EXITSTUBGR];  /* Exit stub group addresses. */\n\n  HotPenalty penalty[PENALTY_SLOTS];  /* Penalty slots. */\n  uint32_t penaltyslot;\t/* Round-robin index into penalty slots. */\n  uint32_t prngstate;\t/* PRNG state. */\n\n  BPropEntry bpropcache[BPROP_SLOTS];  /* Backpropagation cache slots. */\n  uint32_t bpropslot;\t/* Round-robin index into bpropcache slots. */\n\n  ScEvEntry scev;\t/* Scalar evolution analysis cache slots. */\n\n  const BCIns *startpc;\t/* Bytecode PC of starting instruction. */\n  TraceNo parent;\t/* Parent of current side trace (0 for root traces). */\n  ExitNo exitno;\t/* Exit number in parent of current side trace. */\n\n  BCIns *patchpc;\t/* PC for pending re-patch. */\n  BCIns patchins;\t/* Instruction for pending re-patch. */\n\n  int mcprot;\t\t/* Protection of current mcode area. */\n  MCode *mcarea;\t/* Base of current mcode area. */\n  MCode *mctop;\t\t/* Top of current mcode area. */\n  MCode *mcbot;\t\t/* Bottom of current mcode area. */\n  size_t szmcarea;\t/* Size of current mcode area. */\n  size_t szallmcarea;\t/* Total size of all allocated mcode areas. */\n\n  TValue errinfo;\t/* Additional info element for trace errors. */\n}\n#if LJ_TARGET_ARM\nLJ_ALIGN(16)\t\t/* For DISPATCH-relative addresses in assembler part. */\n#endif\njit_State;\n\n/* Trivial PRNG e.g. used for penalty randomization. */\nstatic LJ_AINLINE uint32_t LJ_PRNG_BITS(jit_State *J, int bits)\n{\n  /* Yes, this LCG is very weak, but that doesn't matter for our use case. */\n  J->prngstate = J->prngstate * 1103515245 + 12345;\n  return J->prngstate >> (32-bits);\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_lex.c",
    "content": "/*\n** Lexical analyzer.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_lex_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#if LJ_HASFFI\n#include \"lj_tab.h\"\n#include \"lj_ctype.h\"\n#include \"lj_cdata.h\"\n#include \"lualib.h\"\n#endif\n#include \"lj_state.h\"\n#include \"lj_lex.h\"\n#include \"lj_parse.h\"\n#include \"lj_char.h\"\n#include \"lj_strscan.h\"\n\n/* Lua lexer token names. */\nstatic const char *const tokennames[] = {\n#define TKSTR1(name)\t\t#name,\n#define TKSTR2(name, sym)\t#sym,\nTKDEF(TKSTR1, TKSTR2)\n#undef TKSTR1\n#undef TKSTR2\n  NULL\n};\n\n/* -- Buffer handling ----------------------------------------------------- */\n\n#define char2int(c)\t\t((int)(uint8_t)(c))\n#define next(ls) \\\n  (ls->current = (ls->n--) > 0 ? char2int(*ls->p++) : fillbuf(ls))\n#define save_and_next(ls)\t(save(ls, ls->current), next(ls))\n#define currIsNewline(ls)\t(ls->current == '\\n' || ls->current == '\\r')\n#define END_OF_STREAM\t\t(-1)\n\nstatic int fillbuf(LexState *ls)\n{\n  size_t sz;\n  const char *buf = ls->rfunc(ls->L, ls->rdata, &sz);\n  if (buf == NULL || sz == 0) return END_OF_STREAM;\n  ls->n = (MSize)sz - 1;\n  ls->p = buf;\n  return char2int(*(ls->p++));\n}\n\nstatic LJ_NOINLINE void save_grow(LexState *ls, int c)\n{\n  MSize newsize;\n  if (ls->sb.sz >= LJ_MAX_STR/2)\n    lj_lex_error(ls, 0, LJ_ERR_XELEM);\n  newsize = ls->sb.sz * 2;\n  lj_str_resizebuf(ls->L, &ls->sb, newsize);\n  ls->sb.buf[ls->sb.n++] = (char)c;\n}\n\nstatic LJ_AINLINE void save(LexState *ls, int c)\n{\n  if (LJ_UNLIKELY(ls->sb.n + 1 > ls->sb.sz))\n    save_grow(ls, c);\n  else\n    ls->sb.buf[ls->sb.n++] = (char)c;\n}\n\nstatic void inclinenumber(LexState *ls)\n{\n  int old = ls->current;\n  lua_assert(currIsNewline(ls));\n  next(ls);  /* skip `\\n' or `\\r' */\n  if (currIsNewline(ls) && ls->current != old)\n    next(ls);  /* skip `\\n\\r' or `\\r\\n' */\n  if (++ls->linenumber >= LJ_MAX_LINE)\n    lj_lex_error(ls, ls->token, LJ_ERR_XLINES);\n}\n\n/* -- Scanner for terminals ----------------------------------------------- */\n\n/* Parse a number literal. */\nstatic void lex_number(LexState *ls, TValue *tv)\n{\n  StrScanFmt fmt;\n  int c, xp = 'e';\n  lua_assert(lj_char_isdigit(ls->current));\n  if ((c = ls->current) == '0') {\n    save_and_next(ls);\n    if ((ls->current | 0x20) == 'x') xp = 'p';\n  }\n  while (lj_char_isident(ls->current) || ls->current == '.' ||\n\t ((ls->current == '-' || ls->current == '+') && (c | 0x20) == xp)) {\n    c = ls->current;\n    save_and_next(ls);\n  }\n  save(ls, '\\0');\n  fmt = lj_strscan_scan((const uint8_t *)ls->sb.buf, tv,\n\t  (LJ_DUALNUM ? STRSCAN_OPT_TOINT : STRSCAN_OPT_TONUM) |\n\t  (LJ_HASFFI ? (STRSCAN_OPT_LL|STRSCAN_OPT_IMAG) : 0));\n  if (LJ_DUALNUM && fmt == STRSCAN_INT) {\n    setitype(tv, LJ_TISNUM);\n  } else if (fmt == STRSCAN_NUM) {\n    /* Already in correct format. */\n#if LJ_HASFFI\n  } else if (fmt != STRSCAN_ERROR) {\n    lua_State *L = ls->L;\n    GCcdata *cd;\n    lua_assert(fmt == STRSCAN_I64 || fmt == STRSCAN_U64 || fmt == STRSCAN_IMAG);\n    if (!ctype_ctsG(G(L))) {\n      ptrdiff_t oldtop = savestack(L, L->top);\n      luaopen_ffi(L);  /* Load FFI library on-demand. */\n      L->top = restorestack(L, oldtop);\n    }\n    if (fmt == STRSCAN_IMAG) {\n      cd = lj_cdata_new_(L, CTID_COMPLEX_DOUBLE, 2*sizeof(double));\n      ((double *)cdataptr(cd))[0] = 0;\n      ((double *)cdataptr(cd))[1] = numV(tv);\n    } else {\n      cd = lj_cdata_new_(L, fmt==STRSCAN_I64 ? CTID_INT64 : CTID_UINT64, 8);\n      *(uint64_t *)cdataptr(cd) = tv->u64;\n    }\n    lj_parse_keepcdata(ls, tv, cd);\n#endif\n  } else {\n    lua_assert(fmt == STRSCAN_ERROR);\n    lj_lex_error(ls, TK_number, LJ_ERR_XNUMBER);\n  }\n}\n\nstatic int skip_sep(LexState *ls)\n{\n  int count = 0;\n  int s = ls->current;\n  lua_assert(s == '[' || s == ']');\n  save_and_next(ls);\n  while (ls->current == '=') {\n    save_and_next(ls);\n    count++;\n  }\n  return (ls->current == s) ? count : (-count) - 1;\n}\n\nstatic void read_long_string(LexState *ls, TValue *tv, int sep)\n{\n  save_and_next(ls);  /* skip 2nd `[' */\n  if (currIsNewline(ls))  /* string starts with a newline? */\n    inclinenumber(ls);  /* skip it */\n  for (;;) {\n    switch (ls->current) {\n    case END_OF_STREAM:\n      lj_lex_error(ls, TK_eof, tv ? LJ_ERR_XLSTR : LJ_ERR_XLCOM);\n      break;\n    case ']':\n      if (skip_sep(ls) == sep) {\n\tsave_and_next(ls);  /* skip 2nd `]' */\n\tgoto endloop;\n      }\n      break;\n    case '\\n':\n    case '\\r':\n      save(ls, '\\n');\n      inclinenumber(ls);\n      if (!tv) lj_str_resetbuf(&ls->sb);  /* avoid wasting space */\n      break;\n    default:\n      if (tv) save_and_next(ls);\n      else next(ls);\n      break;\n    }\n  } endloop:\n  if (tv) {\n    GCstr *str = lj_parse_keepstr(ls, ls->sb.buf + (2 + (MSize)sep),\n\t\t\t\t      ls->sb.n - 2*(2 + (MSize)sep));\n    setstrV(ls->L, tv, str);\n  }\n}\n\nstatic void read_string(LexState *ls, int delim, TValue *tv)\n{\n  save_and_next(ls);\n  while (ls->current != delim) {\n    switch (ls->current) {\n    case END_OF_STREAM:\n      lj_lex_error(ls, TK_eof, LJ_ERR_XSTR);\n      continue;\n    case '\\n':\n    case '\\r':\n      lj_lex_error(ls, TK_string, LJ_ERR_XSTR);\n      continue;\n    case '\\\\': {\n      int c = next(ls);  /* Skip the '\\\\'. */\n      switch (c) {\n      case 'a': c = '\\a'; break;\n      case 'b': c = '\\b'; break;\n      case 'f': c = '\\f'; break;\n      case 'n': c = '\\n'; break;\n      case 'r': c = '\\r'; break;\n      case 't': c = '\\t'; break;\n      case 'v': c = '\\v'; break;\n      case 'x':  /* Hexadecimal escape '\\xXX'. */\n\tc = (next(ls) & 15u) << 4;\n\tif (!lj_char_isdigit(ls->current)) {\n\t  if (!lj_char_isxdigit(ls->current)) goto err_xesc;\n\t  c += 9 << 4;\n\t}\n\tc += (next(ls) & 15u);\n\tif (!lj_char_isdigit(ls->current)) {\n\t  if (!lj_char_isxdigit(ls->current)) goto err_xesc;\n\t  c += 9;\n\t}\n\tbreak;\n      case 'z':  /* Skip whitespace. */\n\tnext(ls);\n\twhile (lj_char_isspace(ls->current))\n\t  if (currIsNewline(ls)) inclinenumber(ls); else next(ls);\n\tcontinue;\n      case '\\n': case '\\r': save(ls, '\\n'); inclinenumber(ls); continue;\n      case '\\\\': case '\\\"': case '\\'': break;\n      case END_OF_STREAM: continue;\n      default:\n\tif (!lj_char_isdigit(c))\n\t  goto err_xesc;\n\tc -= '0';  /* Decimal escape '\\ddd'. */\n\tif (lj_char_isdigit(next(ls))) {\n\t  c = c*10 + (ls->current - '0');\n\t  if (lj_char_isdigit(next(ls))) {\n\t    c = c*10 + (ls->current - '0');\n\t    if (c > 255) {\n\t    err_xesc:\n\t      lj_lex_error(ls, TK_string, LJ_ERR_XESC);\n\t    }\n\t    next(ls);\n\t  }\n\t}\n\tsave(ls, c);\n\tcontinue;\n      }\n      save(ls, c);\n      next(ls);\n      continue;\n      }\n    default:\n      save_and_next(ls);\n      break;\n    }\n  }\n  save_and_next(ls);  /* skip delimiter */\n  setstrV(ls->L, tv, lj_parse_keepstr(ls, ls->sb.buf + 1, ls->sb.n - 2));\n}\n\n/* -- Main lexical scanner ------------------------------------------------ */\n\nstatic int llex(LexState *ls, TValue *tv)\n{\n  lj_str_resetbuf(&ls->sb);\n  for (;;) {\n    if (lj_char_isident(ls->current)) {\n      GCstr *s;\n      if (lj_char_isdigit(ls->current)) {  /* Numeric literal. */\n\tlex_number(ls, tv);\n\treturn TK_number;\n      }\n      /* Identifier or reserved word. */\n      do {\n\tsave_and_next(ls);\n      } while (lj_char_isident(ls->current));\n      s = lj_parse_keepstr(ls, ls->sb.buf, ls->sb.n);\n      setstrV(ls->L, tv, s);\n      if (s->reserved > 0)  /* Reserved word? */\n\treturn TK_OFS + s->reserved;\n      return TK_name;\n    }\n    switch (ls->current) {\n    case '\\n':\n    case '\\r':\n      inclinenumber(ls);\n      continue;\n    case ' ':\n    case '\\t':\n    case '\\v':\n    case '\\f':\n      next(ls);\n      continue;\n    case '-':\n      next(ls);\n      if (ls->current != '-') return '-';\n      /* else is a comment */\n      next(ls);\n      if (ls->current == '[') {\n\tint sep = skip_sep(ls);\n\tlj_str_resetbuf(&ls->sb);  /* `skip_sep' may dirty the buffer */\n\tif (sep >= 0) {\n\t  read_long_string(ls, NULL, sep);  /* long comment */\n\t  lj_str_resetbuf(&ls->sb);\n\t  continue;\n\t}\n      }\n      /* else short comment */\n      while (!currIsNewline(ls) && ls->current != END_OF_STREAM)\n\tnext(ls);\n      continue;\n    case '[': {\n      int sep = skip_sep(ls);\n      if (sep >= 0) {\n\tread_long_string(ls, tv, sep);\n\treturn TK_string;\n      } else if (sep == -1) {\n\treturn '[';\n      } else {\n\tlj_lex_error(ls, TK_string, LJ_ERR_XLDELIM);\n\tcontinue;\n      }\n      }\n    case '=':\n      next(ls);\n      if (ls->current != '=') return '='; else { next(ls); return TK_eq; }\n    case '<':\n      next(ls);\n      if (ls->current != '=') return '<'; else { next(ls); return TK_le; }\n    case '>':\n      next(ls);\n      if (ls->current != '=') return '>'; else { next(ls); return TK_ge; }\n    case '~':\n      next(ls);\n      if (ls->current != '=') return '~'; else { next(ls); return TK_ne; }\n    case ':':\n      next(ls);\n      if (ls->current != ':') return ':'; else { next(ls); return TK_label; }\n    case '\"':\n    case '\\'':\n      read_string(ls, ls->current, tv);\n      return TK_string;\n    case '.':\n      save_and_next(ls);\n      if (ls->current == '.') {\n\tnext(ls);\n\tif (ls->current == '.') {\n\t  next(ls);\n\t  return TK_dots;   /* ... */\n\t}\n\treturn TK_concat;   /* .. */\n      } else if (!lj_char_isdigit(ls->current)) {\n\treturn '.';\n      } else {\n\tlex_number(ls, tv);\n\treturn TK_number;\n      }\n    case END_OF_STREAM:\n      return TK_eof;\n    default: {\n      int c = ls->current;\n      next(ls);\n      return c;  /* Single-char tokens (+ - / ...). */\n    }\n    }\n  }\n}\n\n/* -- Lexer API ----------------------------------------------------------- */\n\n/* Setup lexer state. */\nint lj_lex_setup(lua_State *L, LexState *ls)\n{\n  int header = 0;\n  ls->L = L;\n  ls->fs = NULL;\n  ls->n = 0;\n  ls->p = NULL;\n  ls->vstack = NULL;\n  ls->sizevstack = 0;\n  ls->vtop = 0;\n  ls->bcstack = NULL;\n  ls->sizebcstack = 0;\n  ls->lookahead = TK_eof;  /* No look-ahead token. */\n  ls->linenumber = 1;\n  ls->lastline = 1;\n  lj_str_resizebuf(ls->L, &ls->sb, LJ_MIN_SBUF);\n  next(ls);  /* Read-ahead first char. */\n  if (ls->current == 0xef && ls->n >= 2 && char2int(ls->p[0]) == 0xbb &&\n      char2int(ls->p[1]) == 0xbf) {  /* Skip UTF-8 BOM (if buffered). */\n    ls->n -= 2;\n    ls->p += 2;\n    next(ls);\n    header = 1;\n  }\n  if (ls->current == '#') {  /* Skip POSIX #! header line. */\n    do {\n      next(ls);\n      if (ls->current == END_OF_STREAM) return 0;\n    } while (!currIsNewline(ls));\n    inclinenumber(ls);\n    header = 1;\n  }\n  if (ls->current == LUA_SIGNATURE[0]) {  /* Bytecode dump. */\n    if (header) {\n      /*\n      ** Loading bytecode with an extra header is disabled for security\n      ** reasons. This may circumvent the usual check for bytecode vs.\n      ** Lua code by looking at the first char. Since this is a potential\n      ** security violation no attempt is made to echo the chunkname either.\n      */\n      setstrV(L, L->top++, lj_err_str(L, LJ_ERR_BCBAD));\n      lj_err_throw(L, LUA_ERRSYNTAX);\n    }\n    return 1;\n  }\n  return 0;\n}\n\n/* Cleanup lexer state. */\nvoid lj_lex_cleanup(lua_State *L, LexState *ls)\n{\n  global_State *g = G(L);\n  lj_mem_freevec(g, ls->bcstack, ls->sizebcstack, BCInsLine);\n  lj_mem_freevec(g, ls->vstack, ls->sizevstack, VarInfo);\n  lj_str_freebuf(g, &ls->sb);\n}\n\nvoid lj_lex_next(LexState *ls)\n{\n  ls->lastline = ls->linenumber;\n  if (LJ_LIKELY(ls->lookahead == TK_eof)) {  /* No lookahead token? */\n    ls->token = llex(ls, &ls->tokenval);  /* Get next token. */\n  } else {  /* Otherwise return lookahead token. */\n    ls->token = ls->lookahead;\n    ls->lookahead = TK_eof;\n    ls->tokenval = ls->lookaheadval;\n  }\n}\n\nLexToken lj_lex_lookahead(LexState *ls)\n{\n  lua_assert(ls->lookahead == TK_eof);\n  ls->lookahead = llex(ls, &ls->lookaheadval);\n  return ls->lookahead;\n}\n\nconst char *lj_lex_token2str(LexState *ls, LexToken token)\n{\n  if (token > TK_OFS)\n    return tokennames[token-TK_OFS-1];\n  else if (!lj_char_iscntrl(token))\n    return lj_str_pushf(ls->L, \"%c\", token);\n  else\n    return lj_str_pushf(ls->L, \"char(%d)\", token);\n}\n\nvoid lj_lex_error(LexState *ls, LexToken token, ErrMsg em, ...)\n{\n  const char *tok;\n  va_list argp;\n  if (token == 0) {\n    tok = NULL;\n  } else if (token == TK_name || token == TK_string || token == TK_number) {\n    save(ls, '\\0');\n    tok = ls->sb.buf;\n  } else {\n    tok = lj_lex_token2str(ls, token);\n  }\n  va_start(argp, em);\n  lj_err_lex(ls->L, ls->chunkname, tok, ls->linenumber, em, argp);\n  va_end(argp);\n}\n\nvoid lj_lex_init(lua_State *L)\n{\n  uint32_t i;\n  for (i = 0; i < TK_RESERVED; i++) {\n    GCstr *s = lj_str_newz(L, tokennames[i]);\n    fixstring(s);  /* Reserved words are never collected. */\n    s->reserved = (uint8_t)(i+1);\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_lex.h",
    "content": "/*\n** Lexical analyzer.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_LEX_H\n#define _LJ_LEX_H\n\n#include <stdarg.h>\n\n#include \"lj_obj.h\"\n#include \"lj_err.h\"\n\n/* Lua lexer tokens. */\n#define TKDEF(_, __) \\\n  _(and) _(break) _(do) _(else) _(elseif) _(end) _(false) \\\n  _(for) _(function) _(goto) _(if) _(in) _(local) _(nil) _(not) _(or) \\\n  _(repeat) _(return) _(then) _(true) _(until) _(while) \\\n  __(concat, ..) __(dots, ...) __(eq, ==) __(ge, >=) __(le, <=) __(ne, ~=) \\\n  __(label, ::) __(number, <number>) __(name, <name>) __(string, <string>) \\\n  __(eof, <eof>)\n\nenum {\n  TK_OFS = 256,\n#define TKENUM1(name)\t\tTK_##name,\n#define TKENUM2(name, sym)\tTK_##name,\nTKDEF(TKENUM1, TKENUM2)\n#undef TKENUM1\n#undef TKENUM2\n  TK_RESERVED = TK_while - TK_OFS\n};\n\ntypedef int LexToken;\n\n/* Combined bytecode ins/line. Only used during bytecode generation. */\ntypedef struct BCInsLine {\n  BCIns ins;\t\t/* Bytecode instruction. */\n  BCLine line;\t\t/* Line number for this bytecode. */\n} BCInsLine;\n\n/* Info for local variables. Only used during bytecode generation. */\ntypedef struct VarInfo {\n  GCRef name;\t\t/* Local variable name or goto/label name. */\n  BCPos startpc;\t/* First point where the local variable is active. */\n  BCPos endpc;\t\t/* First point where the local variable is dead. */\n  uint8_t slot;\t\t/* Variable slot. */\n  uint8_t info;\t\t/* Variable/goto/label info. */\n} VarInfo;\n\n/* Lua lexer state. */\ntypedef struct LexState {\n  struct FuncState *fs;\t/* Current FuncState. Defined in lj_parse.c. */\n  struct lua_State *L;\t/* Lua state. */\n  TValue tokenval;\t/* Current token value. */\n  TValue lookaheadval;\t/* Lookahead token value. */\n  int current;\t\t/* Current character (charint). */\n  LexToken token;\t/* Current token. */\n  LexToken lookahead;\t/* Lookahead token. */\n  MSize n;\t\t/* Bytes left in input buffer. */\n  const char *p;\t/* Current position in input buffer. */\n  SBuf sb;\t\t/* String buffer for tokens. */\n  lua_Reader rfunc;\t/* Reader callback. */\n  void *rdata;\t\t/* Reader callback data. */\n  BCLine linenumber;\t/* Input line counter. */\n  BCLine lastline;\t/* Line of last token. */\n  GCstr *chunkname;\t/* Current chunk name (interned string). */\n  const char *chunkarg;\t/* Chunk name argument. */\n  const char *mode;\t/* Allow loading bytecode (b) and/or source text (t). */\n  VarInfo *vstack;\t/* Stack for names and extents of local variables. */\n  MSize sizevstack;\t/* Size of variable stack. */\n  MSize vtop;\t\t/* Top of variable stack. */\n  BCInsLine *bcstack;\t/* Stack for bytecode instructions/line numbers. */\n  MSize sizebcstack;\t/* Size of bytecode stack. */\n  uint32_t level;\t/* Syntactical nesting level. */\n} LexState;\n\nLJ_FUNC int lj_lex_setup(lua_State *L, LexState *ls);\nLJ_FUNC void lj_lex_cleanup(lua_State *L, LexState *ls);\nLJ_FUNC void lj_lex_next(LexState *ls);\nLJ_FUNC LexToken lj_lex_lookahead(LexState *ls);\nLJ_FUNC const char *lj_lex_token2str(LexState *ls, LexToken token);\nLJ_FUNC_NORET void lj_lex_error(LexState *ls, LexToken token, ErrMsg em, ...);\nLJ_FUNC void lj_lex_init(lua_State *L);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_lib.c",
    "content": "/*\n** Library function support.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_lib_c\n#define LUA_CORE\n\n#include \"lauxlib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_func.h\"\n#include \"lj_bc.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"lj_strscan.h\"\n#include \"lj_lib.h\"\n\n/* -- Library initialization ---------------------------------------------- */\n\nstatic GCtab *lib_create_table(lua_State *L, const char *libname, int hsize)\n{\n  if (libname) {\n    luaL_findtable(L, LUA_REGISTRYINDEX, \"_LOADED\", 16);\n    lua_getfield(L, -1, libname);\n    if (!tvistab(L->top-1)) {\n      L->top--;\n      if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, hsize) != NULL)\n\tlj_err_callerv(L, LJ_ERR_BADMODN, libname);\n      settabV(L, L->top, tabV(L->top-1));\n      L->top++;\n      lua_setfield(L, -3, libname);  /* _LOADED[libname] = new table */\n    }\n    L->top--;\n    settabV(L, L->top-1, tabV(L->top));\n  } else {\n    lua_createtable(L, 0, hsize);\n  }\n  return tabV(L->top-1);\n}\n\nvoid lj_lib_register(lua_State *L, const char *libname,\n\t\t     const uint8_t *p, const lua_CFunction *cf)\n{\n  GCtab *env = tabref(L->env);\n  GCfunc *ofn = NULL;\n  int ffid = *p++;\n  BCIns *bcff = &L2GG(L)->bcff[*p++];\n  GCtab *tab = lib_create_table(L, libname, *p++);\n  ptrdiff_t tpos = L->top - L->base;\n\n  /* Avoid barriers further down. */\n  lj_gc_anybarriert(L, tab);\n  tab->nomm = 0;\n\n  for (;;) {\n    uint32_t tag = *p++;\n    MSize len = tag & LIBINIT_LENMASK;\n    tag &= LIBINIT_TAGMASK;\n    if (tag != LIBINIT_STRING) {\n      const char *name;\n      MSize nuv = (MSize)(L->top - L->base - tpos);\n      GCfunc *fn = lj_func_newC(L, nuv, env);\n      if (nuv) {\n\tL->top = L->base + tpos;\n\tmemcpy(fn->c.upvalue, L->top, sizeof(TValue)*nuv);\n      }\n      fn->c.ffid = (uint8_t)(ffid++);\n      name = (const char *)p;\n      p += len;\n      if (tag == LIBINIT_CF)\n\tsetmref(fn->c.pc, &G(L)->bc_cfunc_int);\n      else\n\tsetmref(fn->c.pc, bcff++);\n      if (tag == LIBINIT_ASM_)\n\tfn->c.f = ofn->c.f;  /* Copy handler from previous function. */\n      else\n\tfn->c.f = *cf++;  /* Get cf or handler from C function table. */\n      if (len) {\n\t/* NOBARRIER: See above for common barrier. */\n\tsetfuncV(L, lj_tab_setstr(L, tab, lj_str_new(L, name, len)), fn);\n      }\n      ofn = fn;\n    } else {\n      switch (tag | len) {\n      case LIBINIT_SET:\n\tL->top -= 2;\n\tif (tvisstr(L->top+1) && strV(L->top+1)->len == 0)\n\t  env = tabV(L->top);\n\telse  /* NOBARRIER: See above for common barrier. */\n\t  copyTV(L, lj_tab_set(L, tab, L->top+1), L->top);\n\tbreak;\n      case LIBINIT_NUMBER:\n\tmemcpy(&L->top->n, p, sizeof(double));\n\tL->top++;\n\tp += sizeof(double);\n\tbreak;\n      case LIBINIT_COPY:\n\tcopyTV(L, L->top, L->top - *p++);\n\tL->top++;\n\tbreak;\n      case LIBINIT_LASTCL:\n\tsetfuncV(L, L->top++, ofn);\n\tbreak;\n      case LIBINIT_FFID:\n\tffid++;\n\tbreak;\n      case LIBINIT_END:\n\treturn;\n      default:\n\tsetstrV(L, L->top++, lj_str_new(L, (const char *)p, len));\n\tp += len;\n\tbreak;\n      }\n    }\n  }\n}\n\n/* -- Type checks --------------------------------------------------------- */\n\nTValue *lj_lib_checkany(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (o >= L->top)\n    lj_err_arg(L, narg, LJ_ERR_NOVAL);\n  return o;\n}\n\nGCstr *lj_lib_checkstr(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (o < L->top) {\n    if (LJ_LIKELY(tvisstr(o))) {\n      return strV(o);\n    } else if (tvisnumber(o)) {\n      GCstr *s = lj_str_fromnumber(L, o);\n      setstrV(L, o, s);\n      return s;\n    }\n  }\n  lj_err_argt(L, narg, LUA_TSTRING);\n  return NULL;  /* unreachable */\n}\n\nGCstr *lj_lib_optstr(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  return (o < L->top && !tvisnil(o)) ? lj_lib_checkstr(L, narg) : NULL;\n}\n\n#if LJ_DUALNUM\nvoid lj_lib_checknumber(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (!(o < L->top && lj_strscan_numberobj(o)))\n    lj_err_argt(L, narg, LUA_TNUMBER);\n}\n#endif\n\nlua_Number lj_lib_checknum(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (!(o < L->top &&\n\t(tvisnumber(o) || (tvisstr(o) && lj_strscan_num(strV(o), o)))))\n    lj_err_argt(L, narg, LUA_TNUMBER);\n  if (LJ_UNLIKELY(tvisint(o))) {\n    lua_Number n = (lua_Number)intV(o);\n    setnumV(o, n);\n    return n;\n  } else {\n    return numV(o);\n  }\n}\n\nint32_t lj_lib_checkint(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (!(o < L->top && lj_strscan_numberobj(o)))\n    lj_err_argt(L, narg, LUA_TNUMBER);\n  if (LJ_LIKELY(tvisint(o))) {\n    return intV(o);\n  } else {\n    int32_t i = lj_num2int(numV(o));\n    if (LJ_DUALNUM) setintV(o, i);\n    return i;\n  }\n}\n\nint32_t lj_lib_optint(lua_State *L, int narg, int32_t def)\n{\n  TValue *o = L->base + narg-1;\n  return (o < L->top && !tvisnil(o)) ? lj_lib_checkint(L, narg) : def;\n}\n\nint32_t lj_lib_checkbit(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (!(o < L->top && lj_strscan_numberobj(o)))\n    lj_err_argt(L, narg, LUA_TNUMBER);\n  if (LJ_LIKELY(tvisint(o))) {\n    return intV(o);\n  } else {\n    int32_t i = lj_num2bit(numV(o));\n    if (LJ_DUALNUM) setintV(o, i);\n    return i;\n  }\n}\n\nGCfunc *lj_lib_checkfunc(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (!(o < L->top && tvisfunc(o)))\n    lj_err_argt(L, narg, LUA_TFUNCTION);\n  return funcV(o);\n}\n\nGCtab *lj_lib_checktab(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (!(o < L->top && tvistab(o)))\n    lj_err_argt(L, narg, LUA_TTABLE);\n  return tabV(o);\n}\n\nGCtab *lj_lib_checktabornil(lua_State *L, int narg)\n{\n  TValue *o = L->base + narg-1;\n  if (o < L->top) {\n    if (tvistab(o))\n      return tabV(o);\n    else if (tvisnil(o))\n      return NULL;\n  }\n  lj_err_arg(L, narg, LJ_ERR_NOTABN);\n  return NULL;  /* unreachable */\n}\n\nint lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst)\n{\n  GCstr *s = def >= 0 ? lj_lib_optstr(L, narg) : lj_lib_checkstr(L, narg);\n  if (s) {\n    const char *opt = strdata(s);\n    MSize len = s->len;\n    int i;\n    for (i = 0; *(const uint8_t *)lst; i++) {\n      if (*(const uint8_t *)lst == len && memcmp(opt, lst+1, len) == 0)\n\treturn i;\n      lst += 1+*(const uint8_t *)lst;\n    }\n    lj_err_argv(L, narg, LJ_ERR_INVOPTM, opt);\n  }\n  return def;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_lib.h",
    "content": "/*\n** Library function support.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_LIB_H\n#define _LJ_LIB_H\n\n#include \"lj_obj.h\"\n\n/*\n** A fallback handler is called by the assembler VM if the fast path fails:\n**\n** - too few arguments:   unrecoverable.\n** - wrong argument type:   recoverable, if coercion succeeds.\n** - bad argument value:  unrecoverable.\n** - stack overflow:        recoverable, if stack reallocation succeeds.\n** - extra handling:        recoverable.\n**\n** The unrecoverable cases throw an error with lj_err_arg(), lj_err_argtype(),\n** lj_err_caller() or lj_err_callermsg().\n** The recoverable cases return 0 or the number of results + 1.\n** The assembler VM retries the fast path only if 0 is returned.\n** This time the fallback must not be called again or it gets stuck in a loop.\n*/\n\n/* Return values from fallback handler. */\n#define FFH_RETRY\t0\n#define FFH_UNREACHABLE\tFFH_RETRY\n#define FFH_RES(n)\t((n)+1)\n#define FFH_TAILCALL\t(-1)\n\nLJ_FUNC TValue *lj_lib_checkany(lua_State *L, int narg);\nLJ_FUNC GCstr *lj_lib_checkstr(lua_State *L, int narg);\nLJ_FUNC GCstr *lj_lib_optstr(lua_State *L, int narg);\n#if LJ_DUALNUM\nLJ_FUNC void lj_lib_checknumber(lua_State *L, int narg);\n#else\n#define lj_lib_checknumber(L, narg)\tlj_lib_checknum((L), (narg))\n#endif\nLJ_FUNC lua_Number lj_lib_checknum(lua_State *L, int narg);\nLJ_FUNC int32_t lj_lib_checkint(lua_State *L, int narg);\nLJ_FUNC int32_t lj_lib_optint(lua_State *L, int narg, int32_t def);\nLJ_FUNC int32_t lj_lib_checkbit(lua_State *L, int narg);\nLJ_FUNC GCfunc *lj_lib_checkfunc(lua_State *L, int narg);\nLJ_FUNC GCtab *lj_lib_checktab(lua_State *L, int narg);\nLJ_FUNC GCtab *lj_lib_checktabornil(lua_State *L, int narg);\nLJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst);\n\n/* Avoid including lj_frame.h. */\n#define lj_lib_upvalue(L, n) \\\n  (&gcref((L->base-1)->fr.func)->fn.c.upvalue[(n)-1])\n\n#if LJ_TARGET_WINDOWS\n#define lj_lib_checkfpu(L) \\\n  do { setnumV(L->top++, (lua_Number)1437217655); \\\n    if (lua_tointeger(L, -1) != 1437217655) lj_err_caller(L, LJ_ERR_BADFPU); \\\n    L->top--; } while (0)\n#else\n#define lj_lib_checkfpu(L)\tUNUSED(L)\n#endif\n\n/* Push internal function on the stack. */\nstatic LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f,\n\t\t\t\t     int id, int n)\n{\n  GCfunc *fn;\n  lua_pushcclosure(L, f, n);\n  fn = funcV(L->top-1);\n  fn->c.ffid = (uint8_t)id;\n  setmref(fn->c.pc, &G(L)->bc_cfunc_int);\n}\n\n#define lj_lib_pushcf(L, fn, id)\t(lj_lib_pushcc(L, (fn), (id), 0))\n\n/* Library function declarations. Scanned by buildvm. */\n#define LJLIB_CF(name)\t\tstatic int lj_cf_##name(lua_State *L)\n#define LJLIB_ASM(name)\t\tstatic int lj_ffh_##name(lua_State *L)\n#define LJLIB_ASM_(name)\n#define LJLIB_SET(name)\n#define LJLIB_PUSH(arg)\n#define LJLIB_REC(handler)\n#define LJLIB_NOREGUV\n#define LJLIB_NOREG\n\n#define LJ_LIB_REG(L, regname, name) \\\n  lj_lib_register(L, regname, lj_lib_init_##name, lj_lib_cf_##name)\n\nLJ_FUNC void lj_lib_register(lua_State *L, const char *libname,\n\t\t\t     const uint8_t *init, const lua_CFunction *cf);\n\n/* Library init data tags. */\n#define LIBINIT_LENMASK\t0x3f\n#define LIBINIT_TAGMASK\t0xc0\n#define LIBINIT_CF\t0x00\n#define LIBINIT_ASM\t0x40\n#define LIBINIT_ASM_\t0x80\n#define LIBINIT_STRING\t0xc0\n#define LIBINIT_MAXSTR\t0x39\n#define LIBINIT_SET\t0xfa\n#define LIBINIT_NUMBER\t0xfb\n#define LIBINIT_COPY\t0xfc\n#define LIBINIT_LASTCL\t0xfd\n#define LIBINIT_FFID\t0xfe\n#define LIBINIT_END\t0xff\n\n/* Exported library functions. */\n\ntypedef struct RandomState RandomState;\nLJ_FUNC uint64_t LJ_FASTCALL lj_math_random_step(RandomState *rs);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_load.c",
    "content": "/*\n** Load and dump code.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include <errno.h>\n#include <stdio.h>\n\n#define lj_load_c\n#define LUA_CORE\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_func.h\"\n#include \"lj_frame.h\"\n#include \"lj_vm.h\"\n#include \"lj_lex.h\"\n#include \"lj_bcdump.h\"\n#include \"lj_parse.h\"\n\n/* -- Load Lua source code and bytecode ----------------------------------- */\n\nstatic TValue *cpparser(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  LexState *ls = (LexState *)ud;\n  GCproto *pt;\n  GCfunc *fn;\n  int bc;\n  UNUSED(dummy);\n  cframe_errfunc(L->cframe) = -1;  /* Inherit error function. */\n  bc = lj_lex_setup(L, ls);\n  if (ls->mode && !strchr(ls->mode, bc ? 'b' : 't')) {\n    setstrV(L, L->top++, lj_err_str(L, LJ_ERR_XMODE));\n    lj_err_throw(L, LUA_ERRSYNTAX);\n  }\n  pt = bc ? lj_bcread(ls) : lj_parse(ls);\n  fn = lj_func_newL_empty(L, pt, tabref(L->env));\n  /* Don't combine above/below into one statement. */\n  setfuncV(L, L->top++, fn);\n  return NULL;\n}\n\nLUA_API int lua_loadx(lua_State *L, lua_Reader reader, void *data,\n\t\t      const char *chunkname, const char *mode)\n{\n  LexState ls;\n  int status;\n  ls.rfunc = reader;\n  ls.rdata = data;\n  ls.chunkarg = chunkname ? chunkname : \"?\";\n  ls.mode = mode;\n  lj_str_initbuf(&ls.sb);\n  status = lj_vm_cpcall(L, NULL, &ls, cpparser);\n  lj_lex_cleanup(L, &ls);\n  lj_gc_check(L);\n  return status;\n}\n\nLUA_API int lua_load(lua_State *L, lua_Reader reader, void *data,\n\t\t     const char *chunkname)\n{\n  return lua_loadx(L, reader, data, chunkname, NULL);\n}\n\ntypedef struct FileReaderCtx {\n  FILE *fp;\n  char buf[LUAL_BUFFERSIZE];\n} FileReaderCtx;\n\nstatic const char *reader_file(lua_State *L, void *ud, size_t *size)\n{\n  FileReaderCtx *ctx = (FileReaderCtx *)ud;\n  UNUSED(L);\n  if (feof(ctx->fp)) return NULL;\n  *size = fread(ctx->buf, 1, sizeof(ctx->buf), ctx->fp);\n  return *size > 0 ? ctx->buf : NULL;\n}\n\nLUALIB_API int luaL_loadfilex(lua_State *L, const char *filename,\n\t\t\t      const char *mode)\n{\n  FileReaderCtx ctx;\n  int status;\n  const char *chunkname;\n  if (filename) {\n    ctx.fp = fopen(filename, \"rb\");\n    if (ctx.fp == NULL) {\n      lua_pushfstring(L, \"cannot open %s: %s\", filename, strerror(errno));\n      return LUA_ERRFILE;\n    }\n    chunkname = lua_pushfstring(L, \"@%s\", filename);\n  } else {\n    ctx.fp = stdin;\n    chunkname = \"=stdin\";\n  }\n  status = lua_loadx(L, reader_file, &ctx, chunkname, mode);\n  if (ferror(ctx.fp)) {\n    L->top -= filename ? 2 : 1;\n    lua_pushfstring(L, \"cannot read %s: %s\", chunkname+1, strerror(errno));\n    if (filename)\n      fclose(ctx.fp);\n    return LUA_ERRFILE;\n  }\n  if (filename) {\n    L->top--;\n    copyTV(L, L->top-1, L->top);\n    fclose(ctx.fp);\n  }\n  return status;\n}\n\nLUALIB_API int luaL_loadfile(lua_State *L, const char *filename)\n{\n  return luaL_loadfilex(L, filename, NULL);\n}\n\ntypedef struct StringReaderCtx {\n  const char *str;\n  size_t size;\n} StringReaderCtx;\n\nstatic const char *reader_string(lua_State *L, void *ud, size_t *size)\n{\n  StringReaderCtx *ctx = (StringReaderCtx *)ud;\n  UNUSED(L);\n  if (ctx->size == 0) return NULL;\n  *size = ctx->size;\n  ctx->size = 0;\n  return ctx->str;\n}\n\nLUALIB_API int luaL_loadbufferx(lua_State *L, const char *buf, size_t size,\n\t\t\t\tconst char *name, const char *mode)\n{\n  StringReaderCtx ctx;\n  ctx.str = buf;\n  ctx.size = size;\n  return lua_loadx(L, reader_string, &ctx, name, mode);\n}\n\nLUALIB_API int luaL_loadbuffer(lua_State *L, const char *buf, size_t size,\n\t\t\t       const char *name)\n{\n  return luaL_loadbufferx(L, buf, size, name, NULL);\n}\n\nLUALIB_API int luaL_loadstring(lua_State *L, const char *s)\n{\n  return luaL_loadbuffer(L, s, strlen(s), s);\n}\n\n/* -- Dump bytecode ------------------------------------------------------- */\n\nLUA_API int lua_dump(lua_State *L, lua_Writer writer, void *data)\n{\n  cTValue *o = L->top-1;\n  api_check(L, L->top > L->base);\n  if (tvisfunc(o) && isluafunc(funcV(o)))\n    return lj_bcwrite(L, funcproto(funcV(o)), writer, data, 0);\n  else\n    return 1;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_mcode.c",
    "content": "/*\n** Machine code management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_mcode_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#if LJ_HASJIT\n#include \"lj_gc.h\"\n#include \"lj_jit.h\"\n#include \"lj_mcode.h\"\n#include \"lj_trace.h\"\n#include \"lj_dispatch.h\"\n#endif\n#if LJ_HASJIT || LJ_HASFFI\n#include \"lj_vm.h\"\n#endif\n\n/* -- OS-specific functions ----------------------------------------------- */\n\n#if LJ_HASJIT || LJ_HASFFI\n\n/* Define this if you want to run LuaJIT with Valgrind. */\n#ifdef LUAJIT_USE_VALGRIND\n#include <valgrind/valgrind.h>\n#endif\n\n#if LJ_TARGET_IOS\nvoid sys_icache_invalidate(void *start, size_t len);\n#endif\n\n/* Synchronize data/instruction cache. */\nvoid lj_mcode_sync(void *start, void *end)\n{\n#ifdef LUAJIT_USE_VALGRIND\n  VALGRIND_DISCARD_TRANSLATIONS(start, (char *)end-(char *)start);\n#endif\n#if LJ_TARGET_X86ORX64\n  UNUSED(start); UNUSED(end);\n#elif LJ_TARGET_IOS\n  sys_icache_invalidate(start, (char *)end-(char *)start);\n#elif LJ_TARGET_PPC\n  lj_vm_cachesync(start, end);\n#elif defined(__GNUC__)\n  __clear_cache(start, end);\n#else\n#error \"Missing builtin to flush instruction cache\"\n#endif\n}\n\n#endif\n\n#if LJ_HASJIT\n\n#if LJ_TARGET_WINDOWS\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n#define MCPROT_RW\tPAGE_READWRITE\n#define MCPROT_RX\tPAGE_EXECUTE_READ\n#define MCPROT_RWX\tPAGE_EXECUTE_READWRITE\n\nstatic void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, DWORD prot)\n{\n  void *p = VirtualAlloc((void *)hint, sz,\n\t\t\t MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN, prot);\n  if (!p && !hint)\n    lj_trace_err(J, LJ_TRERR_MCODEAL);\n  return p;\n}\n\nstatic void mcode_free(jit_State *J, void *p, size_t sz)\n{\n  UNUSED(J); UNUSED(sz);\n  VirtualFree(p, 0, MEM_RELEASE);\n}\n\nstatic void mcode_setprot(void *p, size_t sz, DWORD prot)\n{\n  DWORD oprot;\n  VirtualProtect(p, sz, prot, &oprot);\n}\n\n#elif LJ_TARGET_POSIX\n\n#include <sys/mman.h>\n\n#ifndef MAP_ANONYMOUS\n#define MAP_ANONYMOUS\tMAP_ANON\n#endif\n\n#define MCPROT_RW\t(PROT_READ|PROT_WRITE)\n#define MCPROT_RX\t(PROT_READ|PROT_EXEC)\n#define MCPROT_RWX\t(PROT_READ|PROT_WRITE|PROT_EXEC)\n\nstatic void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, int prot)\n{\n  void *p = mmap((void *)hint, sz, prot, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);\n  if (p == MAP_FAILED) {\n    if (!hint) lj_trace_err(J, LJ_TRERR_MCODEAL);\n    p = NULL;\n  }\n  return p;\n}\n\nstatic void mcode_free(jit_State *J, void *p, size_t sz)\n{\n  UNUSED(J);\n  munmap(p, sz);\n}\n\nstatic void mcode_setprot(void *p, size_t sz, int prot)\n{\n  mprotect(p, sz, prot);\n}\n\n#elif LJ_64\n\n#error \"Missing OS support for explicit placement of executable memory\"\n\n#else\n\n/* Fallback allocator. This will fail if memory is not executable by default. */\n#define LUAJIT_UNPROTECT_MCODE\n#define MCPROT_RW\t0\n#define MCPROT_RX\t0\n#define MCPROT_RWX\t0\n\nstatic void *mcode_alloc_at(jit_State *J, uintptr_t hint, size_t sz, int prot)\n{\n  UNUSED(hint); UNUSED(prot);\n  return lj_mem_new(J->L, sz);\n}\n\nstatic void mcode_free(jit_State *J, void *p, size_t sz)\n{\n  lj_mem_free(J2G(J), p, sz);\n}\n\n#define mcode_setprot(p, sz, prot)\tUNUSED(p)\n\n#endif\n\n/* -- MCode area protection ----------------------------------------------- */\n\n/* Define this ONLY if the page protection twiddling becomes a bottleneck. */\n#ifdef LUAJIT_UNPROTECT_MCODE\n\n/* It's generally considered to be a potential security risk to have\n** pages with simultaneous write *and* execute access in a process.\n**\n** Do not even think about using this mode for server processes or\n** apps handling untrusted external data (such as a browser).\n**\n** The security risk is not in LuaJIT itself -- but if an adversary finds\n** any *other* flaw in your C application logic, then any RWX memory page\n** simplifies writing an exploit considerably.\n*/\n#define MCPROT_GEN\tMCPROT_RWX\n#define MCPROT_RUN\tMCPROT_RWX\n\nstatic void mcode_protect(jit_State *J, int prot)\n{\n  UNUSED(J); UNUSED(prot);\n}\n\n#else\n\n/* This is the default behaviour and much safer:\n**\n** Most of the time the memory pages holding machine code are executable,\n** but NONE of them is writable.\n**\n** The current memory area is marked read-write (but NOT executable) only\n** during the short time window while the assembler generates machine code.\n*/\n#define MCPROT_GEN\tMCPROT_RW\n#define MCPROT_RUN\tMCPROT_RX\n\n/* Change protection of MCode area. */\nstatic void mcode_protect(jit_State *J, int prot)\n{\n  if (J->mcprot != prot) {\n    mcode_setprot(J->mcarea, J->szmcarea, prot);\n    J->mcprot = prot;\n  }\n}\n\n#endif\n\n/* -- MCode area allocation ----------------------------------------------- */\n\n#if LJ_TARGET_X64\n#define mcode_validptr(p)\t((p) && (uintptr_t)(p) < (uintptr_t)1<<47)\n#else\n#define mcode_validptr(p)\t((p) && (uintptr_t)(p) < 0xffff0000)\n#endif\n\n#ifdef LJ_TARGET_JUMPRANGE\n\n/* Get memory within relative jump distance of our code in 64 bit mode. */\nstatic void *mcode_alloc(jit_State *J, size_t sz)\n{\n  /* Target an address in the static assembler code (64K aligned).\n  ** Try addresses within a distance of target-range/2+1MB..target+range/2-1MB.\n  */\n#if LJ_TARGET_MIPS\n  /* Use the middle of the 256MB-aligned region. */\n  uintptr_t target = ((uintptr_t)(void *)lj_vm_exit_handler & 0xf0000000u) +\n\t\t     0x08000000u;\n#else\n  uintptr_t target = (uintptr_t)(void *)lj_vm_exit_handler & ~(uintptr_t)0xffff;\n#endif\n  const uintptr_t range = (1u << LJ_TARGET_JUMPRANGE) - (1u << 21);\n  /* First try a contiguous area below the last one. */\n  uintptr_t hint = J->mcarea ? (uintptr_t)J->mcarea - sz : 0;\n  int i;\n  for (i = 0; i < 32; i++) {  /* 32 attempts ought to be enough ... */\n    if (mcode_validptr(hint)) {\n      void *p = mcode_alloc_at(J, hint, sz, MCPROT_GEN);\n\n      if (mcode_validptr(p) &&\n\t  ((uintptr_t)p + sz - target < range || target - (uintptr_t)p < range))\n\treturn p;\n      if (p) mcode_free(J, p, sz);  /* Free badly placed area. */\n    }\n    /* Next try probing pseudo-random addresses. */\n    do {\n      hint = (0x78fb ^ LJ_PRNG_BITS(J, 15)) << 16;  /* 64K aligned. */\n    } while (!(hint + sz < range));\n    hint = target + hint - (range>>1);\n  }\n  lj_trace_err(J, LJ_TRERR_MCODEAL);  /* Give up. OS probably ignores hints? */\n  return NULL;\n}\n\n#else\n\n/* All memory addresses are reachable by relative jumps. */\n#define mcode_alloc(J, sz)\tmcode_alloc_at((J), 0, (sz), MCPROT_GEN)\n\n#endif\n\n/* -- MCode area management ----------------------------------------------- */\n\n/* Linked list of MCode areas. */\ntypedef struct MCLink {\n  MCode *next;\t\t/* Next area. */\n  size_t size;\t\t/* Size of current area. */\n} MCLink;\n\n/* Allocate a new MCode area. */\nstatic void mcode_allocarea(jit_State *J)\n{\n  MCode *oldarea = J->mcarea;\n  size_t sz = (size_t)J->param[JIT_P_sizemcode] << 10;\n  sz = (sz + LJ_PAGESIZE-1) & ~(size_t)(LJ_PAGESIZE - 1);\n  J->mcarea = (MCode *)mcode_alloc(J, sz);\n  J->szmcarea = sz;\n  J->mcprot = MCPROT_GEN;\n  J->mctop = (MCode *)((char *)J->mcarea + J->szmcarea);\n  J->mcbot = (MCode *)((char *)J->mcarea + sizeof(MCLink));\n  ((MCLink *)J->mcarea)->next = oldarea;\n  ((MCLink *)J->mcarea)->size = sz;\n  J->szallmcarea += sz;\n}\n\n/* Free all MCode areas. */\nvoid lj_mcode_free(jit_State *J)\n{\n  MCode *mc = J->mcarea;\n  J->mcarea = NULL;\n  J->szallmcarea = 0;\n  while (mc) {\n    MCode *next = ((MCLink *)mc)->next;\n    mcode_free(J, mc, ((MCLink *)mc)->size);\n    mc = next;\n  }\n}\n\n/* -- MCode transactions -------------------------------------------------- */\n\n/* Reserve the remainder of the current MCode area. */\nMCode *lj_mcode_reserve(jit_State *J, MCode **lim)\n{\n  if (!J->mcarea)\n    mcode_allocarea(J);\n  else\n    mcode_protect(J, MCPROT_GEN);\n  *lim = J->mcbot;\n  return J->mctop;\n}\n\n/* Commit the top part of the current MCode area. */\nvoid lj_mcode_commit(jit_State *J, MCode *top)\n{\n  J->mctop = top;\n  mcode_protect(J, MCPROT_RUN);\n}\n\n/* Abort the reservation. */\nvoid lj_mcode_abort(jit_State *J)\n{\n  mcode_protect(J, MCPROT_RUN);\n}\n\n/* Set/reset protection to allow patching of MCode areas. */\nMCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish)\n{\n#ifdef LUAJIT_UNPROTECT_MCODE\n  UNUSED(J); UNUSED(ptr); UNUSED(finish);\n  return NULL;\n#else\n  if (finish) {\n    if (J->mcarea == ptr)\n      mcode_protect(J, MCPROT_RUN);\n    else\n      mcode_setprot(ptr, ((MCLink *)ptr)->size, MCPROT_RUN);\n    return NULL;\n  } else {\n    MCode *mc = J->mcarea;\n    /* Try current area first to use the protection cache. */\n    if (ptr >= mc && ptr < (MCode *)((char *)mc + J->szmcarea)) {\n      mcode_protect(J, MCPROT_GEN);\n      return mc;\n    }\n    /* Otherwise search through the list of MCode areas. */\n    for (;;) {\n      mc = ((MCLink *)mc)->next;\n      lua_assert(mc != NULL);\n      if (ptr >= mc && ptr < (MCode *)((char *)mc + ((MCLink *)mc)->size)) {\n\tmcode_setprot(mc, ((MCLink *)mc)->size, MCPROT_GEN);\n\treturn mc;\n      }\n    }\n  }\n#endif\n}\n\n/* Limit of MCode reservation reached. */\nvoid lj_mcode_limiterr(jit_State *J, size_t need)\n{\n  size_t sizemcode, maxmcode;\n  lj_mcode_abort(J);\n  sizemcode = (size_t)J->param[JIT_P_sizemcode] << 10;\n  sizemcode = (sizemcode + LJ_PAGESIZE-1) & ~(size_t)(LJ_PAGESIZE - 1);\n  maxmcode = (size_t)J->param[JIT_P_maxmcode] << 10;\n  if ((size_t)need > sizemcode)\n    lj_trace_err(J, LJ_TRERR_MCODEOV);  /* Too long for any area. */\n  if (J->szallmcarea + sizemcode > maxmcode)\n    lj_trace_err(J, LJ_TRERR_MCODEAL);\n  mcode_allocarea(J);\n  lj_trace_err(J, LJ_TRERR_MCODELM);  /* Retry with new area. */\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_mcode.h",
    "content": "/*\n** Machine code management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_MCODE_H\n#define _LJ_MCODE_H\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT || LJ_HASFFI\nLJ_FUNC void lj_mcode_sync(void *start, void *end);\n#endif\n\n#if LJ_HASJIT\n\n#include \"lj_jit.h\"\n\nLJ_FUNC void lj_mcode_free(jit_State *J);\nLJ_FUNC MCode *lj_mcode_reserve(jit_State *J, MCode **lim);\nLJ_FUNC void lj_mcode_commit(jit_State *J, MCode *m);\nLJ_FUNC void lj_mcode_abort(jit_State *J);\nLJ_FUNC MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish);\nLJ_FUNC_NORET void lj_mcode_limiterr(jit_State *J, size_t need);\n\n#define lj_mcode_commitbot(J, m)\t(J->mcbot = (m))\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_meta.c",
    "content": "/*\n** Metamethod handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_meta_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_meta.h\"\n#include \"lj_frame.h\"\n#include \"lj_bc.h\"\n#include \"lj_vm.h\"\n#include \"lj_strscan.h\"\n\n/* -- Metamethod handling ------------------------------------------------- */\n\n/* String interning of metamethod names for fast indexing. */\nvoid lj_meta_init(lua_State *L)\n{\n#define MMNAME(name)\t\"__\" #name\n  const char *metanames = MMDEF(MMNAME);\n#undef MMNAME\n  global_State *g = G(L);\n  const char *p, *q;\n  uint32_t mm;\n  for (mm = 0, p = metanames; *p; mm++, p = q) {\n    GCstr *s;\n    for (q = p+2; *q && *q != '_'; q++) ;\n    s = lj_str_new(L, p, (size_t)(q-p));\n    /* NOBARRIER: g->gcroot[] is a GC root. */\n    setgcref(g->gcroot[GCROOT_MMNAME+mm], obj2gco(s));\n  }\n}\n\n/* Negative caching of a few fast metamethods. See the lj_meta_fast() macro. */\ncTValue *lj_meta_cache(GCtab *mt, MMS mm, GCstr *name)\n{\n  cTValue *mo = lj_tab_getstr(mt, name);\n  lua_assert(mm <= MM_FAST);\n  if (!mo || tvisnil(mo)) {  /* No metamethod? */\n    mt->nomm |= (uint8_t)(1u<<mm);  /* Set negative cache flag. */\n    return NULL;\n  }\n  return mo;\n}\n\n/* Lookup metamethod for object. */\ncTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm)\n{\n  GCtab *mt;\n  if (tvistab(o))\n    mt = tabref(tabV(o)->metatable);\n  else if (tvisudata(o))\n    mt = tabref(udataV(o)->metatable);\n  else\n    mt = tabref(basemt_obj(G(L), o));\n  if (mt) {\n    cTValue *mo = lj_tab_getstr(mt, mmname_str(G(L), mm));\n    if (mo)\n      return mo;\n  }\n  return niltv(L);\n}\n\n#if LJ_HASFFI\n/* Tailcall from C function. */\nint lj_meta_tailcall(lua_State *L, cTValue *tv)\n{\n  TValue *base = L->base;\n  TValue *top = L->top;\n  const BCIns *pc = frame_pc(base-1);  /* Preserve old PC from frame. */\n  copyTV(L, base-1, tv);  /* Replace frame with new object. */\n  top->u32.lo = LJ_CONT_TAILCALL;\n  setframe_pc(top, pc);\n  setframe_gc(top+1, obj2gco(L));  /* Dummy frame object. */\n  setframe_ftsz(top+1, (int)((char *)(top+2) - (char *)base) + FRAME_CONT);\n  L->base = L->top = top+2;\n  /*\n  ** before:   [old_mo|PC]    [... ...]\n  **                         ^base     ^top\n  ** after:    [new_mo|itype] [... ...] [NULL|PC] [dummy|delta]\n  **                                                           ^base/top\n  ** tailcall: [new_mo|PC]    [... ...]\n  **                         ^base     ^top\n  */\n  return 0;\n}\n#endif\n\n/* Setup call to metamethod to be run by Assembler VM. */\nstatic TValue *mmcall(lua_State *L, ASMFunction cont, cTValue *mo,\n\t\t    cTValue *a, cTValue *b)\n{\n  /*\n  **           |-- framesize -> top       top+1       top+2 top+3\n  ** before:   [func slots ...]\n  ** mm setup: [func slots ...] [cont|?]  [mo|tmtype] [a]   [b]\n  ** in asm:   [func slots ...] [cont|PC] [mo|delta]  [a]   [b]\n  **           ^-- func base                          ^-- mm base\n  ** after mm: [func slots ...]           [result]\n  **                ^-- copy to base[PC_RA] --/     for lj_cont_ra\n  **                          istruecond + branch   for lj_cont_cond*\n  **                                       ignore   for lj_cont_nop\n  ** next PC:  [func slots ...]\n  */\n  TValue *top = L->top;\n  if (curr_funcisL(L)) top = curr_topL(L);\n  setcont(top, cont);  /* Assembler VM stores PC in upper word. */\n  copyTV(L, top+1, mo);  /* Store metamethod and two arguments. */\n  copyTV(L, top+2, a);\n  copyTV(L, top+3, b);\n  return top+2;  /* Return new base. */\n}\n\n/* -- C helpers for some instructions, called from assembler VM ----------- */\n\n/* Helper for TGET*. __index chain and metamethod. */\ncTValue *lj_meta_tget(lua_State *L, cTValue *o, cTValue *k)\n{\n  int loop;\n  for (loop = 0; loop < LJ_MAX_IDXCHAIN; loop++) {\n    cTValue *mo;\n    if (LJ_LIKELY(tvistab(o))) {\n      GCtab *t = tabV(o);\n      cTValue *tv = lj_tab_get(L, t, k);\n      if (!tvisnil(tv) ||\n\t  !(mo = lj_meta_fast(L, tabref(t->metatable), MM_index)))\n\treturn tv;\n    } else if (tvisnil(mo = lj_meta_lookup(L, o, MM_index))) {\n      lj_err_optype(L, o, LJ_ERR_OPINDEX);\n      return NULL;  /* unreachable */\n    }\n    if (tvisfunc(mo)) {\n      L->top = mmcall(L, lj_cont_ra, mo, o, k);\n      return NULL;  /* Trigger metamethod call. */\n    }\n    o = mo;\n  }\n  lj_err_msg(L, LJ_ERR_GETLOOP);\n  return NULL;  /* unreachable */\n}\n\n/* Helper for TSET*. __newindex chain and metamethod. */\nTValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k)\n{\n  TValue tmp;\n  int loop;\n  for (loop = 0; loop < LJ_MAX_IDXCHAIN; loop++) {\n    cTValue *mo;\n    if (LJ_LIKELY(tvistab(o))) {\n      GCtab *t = tabV(o);\n      cTValue *tv = lj_tab_get(L, t, k);\n      if (LJ_LIKELY(!tvisnil(tv))) {\n\tt->nomm = 0;  /* Invalidate negative metamethod cache. */\n\tlj_gc_anybarriert(L, t);\n\treturn (TValue *)tv;\n      } else if (!(mo = lj_meta_fast(L, tabref(t->metatable), MM_newindex))) {\n\tt->nomm = 0;  /* Invalidate negative metamethod cache. */\n\tlj_gc_anybarriert(L, t);\n\tif (tv != niltv(L))\n\t  return (TValue *)tv;\n\tif (tvisnil(k)) lj_err_msg(L, LJ_ERR_NILIDX);\n\telse if (tvisint(k)) { setnumV(&tmp, (lua_Number)intV(k)); k = &tmp; }\n\telse if (tvisnum(k) && tvisnan(k)) lj_err_msg(L, LJ_ERR_NANIDX);\n\treturn lj_tab_newkey(L, t, k);\n      }\n    } else if (tvisnil(mo = lj_meta_lookup(L, o, MM_newindex))) {\n      lj_err_optype(L, o, LJ_ERR_OPINDEX);\n      return NULL;  /* unreachable */\n    }\n    if (tvisfunc(mo)) {\n      L->top = mmcall(L, lj_cont_nop, mo, o, k);\n      /* L->top+2 = v filled in by caller. */\n      return NULL;  /* Trigger metamethod call. */\n    }\n    copyTV(L, &tmp, mo);\n    o = &tmp;\n  }\n  lj_err_msg(L, LJ_ERR_SETLOOP);\n  return NULL;  /* unreachable */\n}\n\nstatic cTValue *str2num(cTValue *o, TValue *n)\n{\n  if (tvisnum(o))\n    return o;\n  else if (tvisint(o))\n    return (setnumV(n, (lua_Number)intV(o)), n);\n  else if (tvisstr(o) && lj_strscan_num(strV(o), n))\n    return n;\n  else\n    return NULL;\n}\n\n/* Helper for arithmetic instructions. Coercion, metamethod. */\nTValue *lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb, cTValue *rc,\n\t\t      BCReg op)\n{\n  MMS mm = bcmode_mm(op);\n  TValue tempb, tempc;\n  cTValue *b, *c;\n  if ((b = str2num(rb, &tempb)) != NULL &&\n      (c = str2num(rc, &tempc)) != NULL) {  /* Try coercion first. */\n    setnumV(ra, lj_vm_foldarith(numV(b), numV(c), (int)mm-MM_add));\n    return NULL;\n  } else {\n    cTValue *mo = lj_meta_lookup(L, rb, mm);\n    if (tvisnil(mo)) {\n      mo = lj_meta_lookup(L, rc, mm);\n      if (tvisnil(mo)) {\n\tif (str2num(rb, &tempb) == NULL) rc = rb;\n\tlj_err_optype(L, rc, LJ_ERR_OPARITH);\n\treturn NULL;  /* unreachable */\n      }\n    }\n    return mmcall(L, lj_cont_ra, mo, rb, rc);\n  }\n}\n\n/* In-place coercion of a number to a string. */\nstatic LJ_AINLINE int tostring(lua_State *L, TValue *o)\n{\n  if (tvisstr(o)) {\n    return 1;\n  } else if (tvisnumber(o)) {\n    setstrV(L, o, lj_str_fromnumber(L, o));\n    return 1;\n  } else {\n    return 0;\n  }\n}\n\n/* Helper for CAT. Coercion, iterative concat, __concat metamethod. */\nTValue *lj_meta_cat(lua_State *L, TValue *top, int left)\n{\n  int fromc = 0;\n  if (left < 0) { left = -left; fromc = 1; }\n  do {\n    int n = 1;\n    if (!(tvisstr(top-1) || tvisnumber(top-1)) || !tostring(L, top)) {\n      cTValue *mo = lj_meta_lookup(L, top-1, MM_concat);\n      if (tvisnil(mo)) {\n\tmo = lj_meta_lookup(L, top, MM_concat);\n\tif (tvisnil(mo)) {\n\t  if (tvisstr(top-1) || tvisnumber(top-1)) top++;\n\t  lj_err_optype(L, top-1, LJ_ERR_OPCAT);\n\t  return NULL;  /* unreachable */\n\t}\n      }\n      /* One of the top two elements is not a string, call __cat metamethod:\n      **\n      ** before:    [...][CAT stack .........................]\n      **                                 top-1     top         top+1 top+2\n      ** pick two:  [...][CAT stack ...] [o1]      [o2]\n      ** setup mm:  [...][CAT stack ...] [cont|?]  [mo|tmtype] [o1]  [o2]\n      ** in asm:    [...][CAT stack ...] [cont|PC] [mo|delta]  [o1]  [o2]\n      **            ^-- func base                              ^-- mm base\n      ** after mm:  [...][CAT stack ...] <--push-- [result]\n      ** next step: [...][CAT stack .............]\n      */\n      copyTV(L, top+2, top);  /* Careful with the order of stack copies! */\n      copyTV(L, top+1, top-1);\n      copyTV(L, top, mo);\n      setcont(top-1, lj_cont_cat);\n      return top+1;  /* Trigger metamethod call. */\n    } else if (strV(top)->len == 0) {  /* Shortcut. */\n      (void)tostring(L, top-1);\n    } else {\n      /* Pick as many strings as possible from the top and concatenate them:\n      **\n      ** before:    [...][CAT stack ...........................]\n      ** pick str:  [...][CAT stack ...] [...... strings ......]\n      ** concat:    [...][CAT stack ...] [result]\n      ** next step: [...][CAT stack ............]\n      */\n      MSize tlen = strV(top)->len;\n      char *buffer;\n      int i;\n      for (n = 1; n <= left && tostring(L, top-n); n++) {\n\tMSize len = strV(top-n)->len;\n\tif (len >= LJ_MAX_STR - tlen)\n\t  lj_err_msg(L, LJ_ERR_STROV);\n\ttlen += len;\n      }\n      buffer = lj_str_needbuf(L, &G(L)->tmpbuf, tlen);\n      n--;\n      tlen = 0;\n      for (i = n; i >= 0; i--) {\n\tMSize len = strV(top-i)->len;\n\tmemcpy(buffer + tlen, strVdata(top-i), len);\n\ttlen += len;\n      }\n      setstrV(L, top-n, lj_str_new(L, buffer, tlen));\n    }\n    left -= n;\n    top -= n;\n  } while (left >= 1);\n  if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) {\n    if (!fromc) L->top = curr_topL(L);\n    lj_gc_step(L);\n  }\n  return NULL;\n}\n\n/* Helper for LEN. __len metamethod. */\nTValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o)\n{\n  cTValue *mo = lj_meta_lookup(L, o, MM_len);\n  if (tvisnil(mo)) {\n    if (LJ_52 && tvistab(o))\n      tabref(tabV(o)->metatable)->nomm |= (uint8_t)(1u<<MM_len);\n    else\n      lj_err_optype(L, o, LJ_ERR_OPLEN);\n    return NULL;\n  }\n  return mmcall(L, lj_cont_ra, mo, o, LJ_52 ? o : niltv(L));\n}\n\n/* Helper for equality comparisons. __eq metamethod. */\nTValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne)\n{\n  /* Field metatable must be at same offset for GCtab and GCudata! */\n  cTValue *mo = lj_meta_fast(L, tabref(o1->gch.metatable), MM_eq);\n  if (mo) {\n    TValue *top;\n    uint32_t it;\n    if (tabref(o1->gch.metatable) != tabref(o2->gch.metatable)) {\n      cTValue *mo2 = lj_meta_fast(L, tabref(o2->gch.metatable), MM_eq);\n      if (mo2 == NULL || !lj_obj_equal(mo, mo2))\n\treturn (TValue *)(intptr_t)ne;\n    }\n    top = curr_top(L);\n    setcont(top, ne ? lj_cont_condf : lj_cont_condt);\n    copyTV(L, top+1, mo);\n    it = ~(uint32_t)o1->gch.gct;\n    setgcV(L, top+2, o1, it);\n    setgcV(L, top+3, o2, it);\n    return top+2;  /* Trigger metamethod call. */\n  }\n  return (TValue *)(intptr_t)ne;\n}\n\n#if LJ_HASFFI\nTValue * LJ_FASTCALL lj_meta_equal_cd(lua_State *L, BCIns ins)\n{\n  ASMFunction cont = (bc_op(ins) & 1) ? lj_cont_condf : lj_cont_condt;\n  int op = (int)bc_op(ins) & ~1;\n  TValue tv;\n  cTValue *mo, *o2, *o1 = &L->base[bc_a(ins)];\n  cTValue *o1mm = o1;\n  if (op == BC_ISEQV) {\n    o2 = &L->base[bc_d(ins)];\n    if (!tviscdata(o1mm)) o1mm = o2;\n  } else if (op == BC_ISEQS) {\n    setstrV(L, &tv, gco2str(proto_kgc(curr_proto(L), ~(ptrdiff_t)bc_d(ins))));\n    o2 = &tv;\n  } else if (op == BC_ISEQN) {\n    o2 = &mref(curr_proto(L)->k, cTValue)[bc_d(ins)];\n  } else {\n    lua_assert(op == BC_ISEQP);\n    setitype(&tv, ~bc_d(ins));\n    o2 = &tv;\n  }\n  mo = lj_meta_lookup(L, o1mm, MM_eq);\n  if (LJ_LIKELY(!tvisnil(mo)))\n    return mmcall(L, cont, mo, o1, o2);\n  else\n    return (TValue *)(intptr_t)(bc_op(ins) & 1);\n}\n#endif\n\n/* Helper for ordered comparisons. String compare, __lt/__le metamethods. */\nTValue *lj_meta_comp(lua_State *L, cTValue *o1, cTValue *o2, int op)\n{\n  if (LJ_HASFFI && (tviscdata(o1) || tviscdata(o2))) {\n    ASMFunction cont = (op & 1) ? lj_cont_condf : lj_cont_condt;\n    MMS mm = (op & 2) ? MM_le : MM_lt;\n    cTValue *mo = lj_meta_lookup(L, tviscdata(o1) ? o1 : o2, mm);\n    if (LJ_UNLIKELY(tvisnil(mo))) goto err;\n    return mmcall(L, cont, mo, o1, o2);\n  } else if (LJ_52 || itype(o1) == itype(o2)) {\n    /* Never called with two numbers. */\n    if (tvisstr(o1) && tvisstr(o2)) {\n      int32_t res = lj_str_cmp(strV(o1), strV(o2));\n      return (TValue *)(intptr_t)(((op&2) ? res <= 0 : res < 0) ^ (op&1));\n    } else {\n    trymt:\n      while (1) {\n\tASMFunction cont = (op & 1) ? lj_cont_condf : lj_cont_condt;\n\tMMS mm = (op & 2) ? MM_le : MM_lt;\n\tcTValue *mo = lj_meta_lookup(L, o1, mm);\n#if LJ_52\n\tif (tvisnil(mo) && tvisnil((mo = lj_meta_lookup(L, o2, mm))))\n#else\n\tcTValue *mo2 = lj_meta_lookup(L, o2, mm);\n\tif (tvisnil(mo) || !lj_obj_equal(mo, mo2))\n#endif\n\t{\n\t  if (op & 2) {  /* MM_le not found: retry with MM_lt. */\n\t    cTValue *ot = o1; o1 = o2; o2 = ot;  /* Swap operands. */\n\t    op ^= 3;  /* Use LT and flip condition. */\n\t    continue;\n\t  }\n\t  goto err;\n\t}\n\treturn mmcall(L, cont, mo, o1, o2);\n      }\n    }\n  } else if (tvisbool(o1) && tvisbool(o2)) {\n    goto trymt;\n  } else {\n  err:\n    lj_err_comp(L, o1, o2);\n    return NULL;\n  }\n}\n\n/* Helper for calls. __call metamethod. */\nvoid lj_meta_call(lua_State *L, TValue *func, TValue *top)\n{\n  cTValue *mo = lj_meta_lookup(L, func, MM_call);\n  TValue *p;\n  if (!tvisfunc(mo))\n    lj_err_optype_call(L, func);\n  for (p = top; p > func; p--) copyTV(L, p, p-1);\n  copyTV(L, func, mo);\n}\n\n/* Helper for FORI. Coercion. */\nvoid LJ_FASTCALL lj_meta_for(lua_State *L, TValue *o)\n{\n  if (!lj_strscan_numberobj(o)) lj_err_msg(L, LJ_ERR_FORINIT);\n  if (!lj_strscan_numberobj(o+1)) lj_err_msg(L, LJ_ERR_FORLIM);\n  if (!lj_strscan_numberobj(o+2)) lj_err_msg(L, LJ_ERR_FORSTEP);\n  if (LJ_DUALNUM) {\n    /* Ensure all slots are integers or all slots are numbers. */\n    int32_t k[3];\n    int nint = 0;\n    ptrdiff_t i;\n    for (i = 0; i <= 2; i++) {\n      if (tvisint(o+i)) {\n\tk[i] = intV(o+i); nint++;\n      } else {\n\tk[i] = lj_num2int(numV(o+i)); nint += ((lua_Number)k[i] == numV(o+i));\n      }\n    }\n    if (nint == 3) {  /* Narrow to integers. */\n      setintV(o, k[0]);\n      setintV(o+1, k[1]);\n      setintV(o+2, k[2]);\n    } else if (nint != 0) {  /* Widen to numbers. */\n      if (tvisint(o)) setnumV(o, (lua_Number)intV(o));\n      if (tvisint(o+1)) setnumV(o+1, (lua_Number)intV(o+1));\n      if (tvisint(o+2)) setnumV(o+2, (lua_Number)intV(o+2));\n    }\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_meta.h",
    "content": "/*\n** Metamethod handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_META_H\n#define _LJ_META_H\n\n#include \"lj_obj.h\"\n\n/* Metamethod handling */\nLJ_FUNC void lj_meta_init(lua_State *L);\nLJ_FUNC cTValue *lj_meta_cache(GCtab *mt, MMS mm, GCstr *name);\nLJ_FUNC cTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm);\n#if LJ_HASFFI\nLJ_FUNC int lj_meta_tailcall(lua_State *L, cTValue *tv);\n#endif\n\n#define lj_meta_fastg(g, mt, mm) \\\n  ((mt) == NULL ? NULL : ((mt)->nomm & (1u<<(mm))) ? NULL : \\\n   lj_meta_cache(mt, mm, mmname_str(g, mm)))\n#define lj_meta_fast(L, mt, mm)\tlj_meta_fastg(G(L), mt, mm)\n\n/* C helpers for some instructions, called from assembler VM. */\nLJ_FUNCA cTValue *lj_meta_tget(lua_State *L, cTValue *o, cTValue *k);\nLJ_FUNCA TValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k);\nLJ_FUNCA TValue *lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb,\n\t\t\t       cTValue *rc, BCReg op);\nLJ_FUNCA TValue *lj_meta_cat(lua_State *L, TValue *top, int left);\nLJ_FUNCA TValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o);\nLJ_FUNCA TValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne);\nLJ_FUNCA TValue * LJ_FASTCALL lj_meta_equal_cd(lua_State *L, BCIns ins);\nLJ_FUNCA TValue *lj_meta_comp(lua_State *L, cTValue *o1, cTValue *o2, int op);\nLJ_FUNCA void lj_meta_call(lua_State *L, TValue *func, TValue *top);\nLJ_FUNCA void LJ_FASTCALL lj_meta_for(lua_State *L, TValue *o);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_obj.c",
    "content": "/*\n** Miscellaneous object handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_obj_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n/* Object type names. */\nLJ_DATADEF const char *const lj_obj_typename[] = {  /* ORDER LUA_T */\n  \"no value\", \"nil\", \"boolean\", \"userdata\", \"number\", \"string\",\n  \"table\", \"function\", \"userdata\", \"thread\", \"proto\", \"cdata\"\n};\n\nLJ_DATADEF const char *const lj_obj_itypename[] = {  /* ORDER LJ_T */\n  \"nil\", \"boolean\", \"boolean\", \"userdata\", \"string\", \"upval\", \"thread\",\n  \"proto\", \"function\", \"trace\", \"cdata\", \"table\", \"userdata\", \"number\"\n};\n\n/* Compare two objects without calling metamethods. */\nint lj_obj_equal(cTValue *o1, cTValue *o2)\n{\n  if (itype(o1) == itype(o2)) {\n    if (tvispri(o1))\n      return 1;\n    if (!tvisnum(o1))\n      return gcrefeq(o1->gcr, o2->gcr);\n  } else if (!tvisnumber(o1) || !tvisnumber(o2)) {\n    return 0;\n  }\n  return numberVnum(o1) == numberVnum(o2);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_obj.h",
    "content": "/*\n** LuaJIT VM tags, values and objects.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#ifndef _LJ_OBJ_H\n#define _LJ_OBJ_H\n\n#include \"lua.h\"\n#include \"lj_def.h\"\n#include \"lj_arch.h\"\n\n/* -- Memory references (32 bit address space) ---------------------------- */\n\n/* Memory size. */\ntypedef uint32_t MSize;\n\n/* Memory reference */\ntypedef struct MRef {\n  uint32_t ptr32;\t/* Pseudo 32 bit pointer. */\n} MRef;\n\n#define mref(r, t)\t((t *)(void *)(uintptr_t)(r).ptr32)\n\n#define setmref(r, p)\t((r).ptr32 = (uint32_t)(uintptr_t)(void *)(p))\n#define setmrefr(r, v)\t((r).ptr32 = (v).ptr32)\n\n/* -- GC object references (32 bit address space) ------------------------- */\n\n/* GCobj reference */\ntypedef struct GCRef {\n  uint32_t gcptr32;\t/* Pseudo 32 bit pointer. */\n} GCRef;\n\n/* Common GC header for all collectable objects. */\n#define GCHeader\tGCRef nextgc; uint8_t marked; uint8_t gct\n/* This occupies 6 bytes, so use the next 2 bytes for non-32 bit fields. */\n\n#define gcref(r)\t((GCobj *)(uintptr_t)(r).gcptr32)\n#define gcrefp(r, t)\t((t *)(void *)(uintptr_t)(r).gcptr32)\n#define gcrefu(r)\t((r).gcptr32)\n#define gcrefi(r)\t((int32_t)(r).gcptr32)\n#define gcrefeq(r1, r2)\t((r1).gcptr32 == (r2).gcptr32)\n#define gcnext(gc)\t(gcref((gc)->gch.nextgc))\n\n#define setgcref(r, gc)\t((r).gcptr32 = (uint32_t)(uintptr_t)&(gc)->gch)\n#define setgcrefi(r, i)\t((r).gcptr32 = (uint32_t)(i))\n#define setgcrefp(r, p)\t((r).gcptr32 = (uint32_t)(uintptr_t)(p))\n#define setgcrefnull(r)\t((r).gcptr32 = 0)\n#define setgcrefr(r, v)\t((r).gcptr32 = (v).gcptr32)\n\n/* IMPORTANT NOTE:\n**\n** All uses of the setgcref* macros MUST be accompanied with a write barrier.\n**\n** This is to ensure the integrity of the incremental GC. The invariant\n** to preserve is that a black object never points to a white object.\n** I.e. never store a white object into a field of a black object.\n**\n** It's ok to LEAVE OUT the write barrier ONLY in the following cases:\n** - The source is not a GC object (NULL).\n** - The target is a GC root. I.e. everything in global_State.\n** - The target is a lua_State field (threads are never black).\n** - The target is a stack slot, see setgcV et al.\n** - The target is an open upvalue, i.e. pointing to a stack slot.\n** - The target is a newly created object (i.e. marked white). But make\n**   sure nothing invokes the GC inbetween.\n** - The target and the source are the same object (self-reference).\n** - The target already contains the object (e.g. moving elements around).\n**\n** The most common case is a store to a stack slot. All other cases where\n** a barrier has been omitted are annotated with a NOBARRIER comment.\n**\n** The same logic applies for stores to table slots (array part or hash\n** part). ALL uses of lj_tab_set* require a barrier for the stored value\n** *and* the stored key, based on the above rules. In practice this means\n** a barrier is needed if *either* of the key or value are a GC object.\n**\n** It's ok to LEAVE OUT the write barrier in the following special cases:\n** - The stored value is nil. The key doesn't matter because it's either\n**   not resurrected or lj_tab_newkey() will take care of the key barrier.\n** - The key doesn't matter if the *previously* stored value is guaranteed\n**   to be non-nil (because the key is kept alive in the table).\n** - The key doesn't matter if it's guaranteed not to be part of the table,\n**   since lj_tab_newkey() takes care of the key barrier. This applies\n**   trivially to new tables, but watch out for resurrected keys. Storing\n**   a nil value leaves the key in the table!\n**\n** In case of doubt use lj_gc_anybarriert() as it's rather cheap. It's used\n** by the interpreter for all table stores.\n**\n** Note: In contrast to Lua's GC, LuaJIT's GC does *not* specially mark\n** dead keys in tables. The reference is left in, but it's guaranteed to\n** be never dereferenced as long as the value is nil. It's ok if the key is\n** freed or if any object subsequently gets the same address.\n**\n** Not destroying dead keys helps to keep key hash slots stable. This avoids\n** specialization back-off for HREFK when a value flips between nil and\n** non-nil and the GC gets in the way. It also allows safely hoisting\n** HREF/HREFK across GC steps. Dead keys are only removed if a table is\n** resized (i.e. by NEWREF) and xREF must not be CSEd across a resize.\n**\n** The trade-off is that a write barrier for tables must take the key into\n** account, too. Implicitly resurrecting the key by storing a non-nil value\n** may invalidate the incremental GC invariant.\n*/\n\n/* -- Common type definitions --------------------------------------------- */\n\n/* Types for handling bytecodes. Need this here, details in lj_bc.h. */\ntypedef uint32_t BCIns;  /* Bytecode instruction. */\ntypedef uint32_t BCPos;  /* Bytecode position. */\ntypedef uint32_t BCReg;  /* Bytecode register. */\ntypedef int32_t BCLine;  /* Bytecode line number. */\n\n/* Internal assembler functions. Never call these directly from C. */\ntypedef void (*ASMFunction)(void);\n\n/* Resizable string buffer. Need this here, details in lj_str.h. */\ntypedef struct SBuf {\n  char *buf;\t\t/* String buffer base. */\n  MSize n;\t\t/* String buffer length. */\n  MSize sz;\t\t/* String buffer size. */\n} SBuf;\n\n/* -- Tags and values ----------------------------------------------------- */\n\n/* Frame link. */\ntypedef union {\n  int32_t ftsz;\t\t/* Frame type and size of previous frame. */\n  MRef pcr;\t\t/* Overlaps PC for Lua frames. */\n} FrameLink;\n\n/* Tagged value. */\ntypedef LJ_ALIGN(8) union TValue {\n  uint64_t u64;\t\t/* 64 bit pattern overlaps number. */\n  lua_Number n;\t\t/* Number object overlaps split tag/value object. */\n  struct {\n    LJ_ENDIAN_LOHI(\n      union {\n\tGCRef gcr;\t/* GCobj reference (if any). */\n\tint32_t i;\t/* Integer value. */\n      };\n    , uint32_t it;\t/* Internal object tag. Must overlap MSW of number. */\n    )\n  };\n  struct {\n    LJ_ENDIAN_LOHI(\n      GCRef func;\t/* Function for next frame (or dummy L). */\n    , FrameLink tp;\t/* Link to previous frame. */\n    )\n  } fr;\n  struct {\n    LJ_ENDIAN_LOHI(\n      uint32_t lo;\t/* Lower 32 bits of number. */\n    , uint32_t hi;\t/* Upper 32 bits of number. */\n    )\n  } u32;\n} TValue;\n\ntypedef const TValue cTValue;\n\n#define tvref(r)\t(mref(r, TValue))\n\n/* More external and GCobj tags for internal objects. */\n#define LAST_TT\t\tLUA_TTHREAD\n#define LUA_TPROTO\t(LAST_TT+1)\n#define LUA_TCDATA\t(LAST_TT+2)\n\n/* Internal object tags.\n**\n** Internal tags overlap the MSW of a number object (must be a double).\n** Interpreted as a double these are special NaNs. The FPU only generates\n** one type of NaN (0xfff8_0000_0000_0000). So MSWs > 0xfff80000 are available\n** for use as internal tags. Small negative numbers are used to shorten the\n** encoding of type comparisons (reg/mem against sign-ext. 8 bit immediate).\n**\n**                  ---MSW---.---LSW---\n** primitive types |  itype  |         |\n** lightuserdata   |  itype  |  void * |  (32 bit platforms)\n** lightuserdata   |ffff|    void *    |  (64 bit platforms, 47 bit pointers)\n** GC objects      |  itype  |  GCRef  |\n** int (LJ_DUALNUM)|  itype  |   int   |\n** number           -------double------\n**\n** ORDER LJ_T\n** Primitive types nil/false/true must be first, lightuserdata next.\n** GC objects are at the end, table/userdata must be lowest.\n** Also check lj_ir.h for similar ordering constraints.\n*/\n#define LJ_TNIL\t\t\t(~0u)\n#define LJ_TFALSE\t\t(~1u)\n#define LJ_TTRUE\t\t(~2u)\n#define LJ_TLIGHTUD\t\t(~3u)\n#define LJ_TSTR\t\t\t(~4u)\n#define LJ_TUPVAL\t\t(~5u)\n#define LJ_TTHREAD\t\t(~6u)\n#define LJ_TPROTO\t\t(~7u)\n#define LJ_TFUNC\t\t(~8u)\n#define LJ_TTRACE\t\t(~9u)\n#define LJ_TCDATA\t\t(~10u)\n#define LJ_TTAB\t\t\t(~11u)\n#define LJ_TUDATA\t\t(~12u)\n/* This is just the canonical number type used in some places. */\n#define LJ_TNUMX\t\t(~13u)\n\n/* Integers have itype == LJ_TISNUM doubles have itype < LJ_TISNUM */\n#if LJ_64\n#define LJ_TISNUM\t\t0xfffeffffu\n#else\n#define LJ_TISNUM\t\tLJ_TNUMX\n#endif\n#define LJ_TISTRUECOND\t\tLJ_TFALSE\n#define LJ_TISPRI\t\tLJ_TTRUE\n#define LJ_TISGCV\t\t(LJ_TSTR+1)\n#define LJ_TISTABUD\t\tLJ_TTAB\n\n/* -- String object ------------------------------------------------------- */\n\n/* String object header. String payload follows. */\ntypedef struct GCstr {\n  GCHeader;\n  uint8_t reserved;\t/* Used by lexer for fast lookup of reserved words. */\n  uint8_t unused;\n  MSize hash;\t\t/* Hash of string. */\n  MSize len;\t\t/* Size of string. */\n} GCstr;\n\n#define strref(r)\t(&gcref((r))->str)\n#define strdata(s)\t((const char *)((s)+1))\n#define strdatawr(s)\t((char *)((s)+1))\n#define strVdata(o)\tstrdata(strV(o))\n#define sizestring(s)\t(sizeof(struct GCstr)+(s)->len+1)\n\n/* -- Userdata object ----------------------------------------------------- */\n\n/* Userdata object. Payload follows. */\ntypedef struct GCudata {\n  GCHeader;\n  uint8_t udtype;\t/* Userdata type. */\n  uint8_t unused2;\n  GCRef env;\t\t/* Should be at same offset in GCfunc. */\n  MSize len;\t\t/* Size of payload. */\n  GCRef metatable;\t/* Must be at same offset in GCtab. */\n  uint32_t align1;\t/* To force 8 byte alignment of the payload. */\n} GCudata;\n\n/* Userdata types. */\nenum {\n  UDTYPE_USERDATA,\t/* Regular userdata. */\n  UDTYPE_IO_FILE,\t/* I/O library FILE. */\n  UDTYPE_FFI_CLIB,\t/* FFI C library namespace. */\n  UDTYPE__MAX\n};\n\n#define uddata(u)\t((void *)((u)+1))\n#define sizeudata(u)\t(sizeof(struct GCudata)+(u)->len)\n\n/* -- C data object ------------------------------------------------------- */\n\n/* C data object. Payload follows. */\ntypedef struct GCcdata {\n  GCHeader;\n  uint16_t ctypeid;\t/* C type ID. */\n} GCcdata;\n\n/* Prepended to variable-sized or realigned C data objects. */\ntypedef struct GCcdataVar {\n  uint16_t offset;\t/* Offset to allocated memory (relative to GCcdata). */\n  uint16_t extra;\t/* Extra space allocated (incl. GCcdata + GCcdatav). */\n  MSize len;\t\t/* Size of payload. */\n} GCcdataVar;\n\n#define cdataptr(cd)\t((void *)((cd)+1))\n#define cdataisv(cd)\t((cd)->marked & 0x80)\n#define cdatav(cd)\t((GCcdataVar *)((char *)(cd) - sizeof(GCcdataVar)))\n#define cdatavlen(cd)\tcheck_exp(cdataisv(cd), cdatav(cd)->len)\n#define sizecdatav(cd)\t(cdatavlen(cd) + cdatav(cd)->extra)\n#define memcdatav(cd)\t((void *)((char *)(cd) - cdatav(cd)->offset))\n\n/* -- Prototype object ---------------------------------------------------- */\n\n#define SCALE_NUM_GCO\t((int32_t)sizeof(lua_Number)/sizeof(GCRef))\n#define round_nkgc(n)\t(((n) + SCALE_NUM_GCO-1) & ~(SCALE_NUM_GCO-1))\n\ntypedef struct GCproto {\n  GCHeader;\n  uint8_t numparams;\t/* Number of parameters. */\n  uint8_t framesize;\t/* Fixed frame size. */\n  MSize sizebc;\t\t/* Number of bytecode instructions. */\n  GCRef gclist;\n  MRef k;\t\t/* Split constant array (points to the middle). */\n  MRef uv;\t\t/* Upvalue list. local slot|0x8000 or parent uv idx. */\n  MSize sizekgc;\t/* Number of collectable constants. */\n  MSize sizekn;\t\t/* Number of lua_Number constants. */\n  MSize sizept;\t\t/* Total size including colocated arrays. */\n  uint8_t sizeuv;\t/* Number of upvalues. */\n  uint8_t flags;\t/* Miscellaneous flags (see below). */\n  uint16_t trace;\t/* Anchor for chain of root traces. */\n  /* ------ The following fields are for debugging/tracebacks only ------ */\n  GCRef chunkname;\t/* Name of the chunk this function was defined in. */\n  BCLine firstline;\t/* First line of the function definition. */\n  BCLine numline;\t/* Number of lines for the function definition. */\n  MRef lineinfo;\t/* Compressed map from bytecode ins. to source line. */\n  MRef uvinfo;\t\t/* Upvalue names. */\n  MRef varinfo;\t\t/* Names and compressed extents of local variables. */\n} GCproto;\n\n/* Flags for prototype. */\n#define PROTO_CHILD\t\t0x01\t/* Has child prototypes. */\n#define PROTO_VARARG\t\t0x02\t/* Vararg function. */\n#define PROTO_FFI\t\t0x04\t/* Uses BC_KCDATA for FFI datatypes. */\n#define PROTO_NOJIT\t\t0x08\t/* JIT disabled for this function. */\n#define PROTO_ILOOP\t\t0x10\t/* Patched bytecode with ILOOP etc. */\n/* Only used during parsing. */\n#define PROTO_HAS_RETURN\t0x20\t/* Already emitted a return. */\n#define PROTO_FIXUP_RETURN\t0x40\t/* Need to fixup emitted returns. */\n/* Top bits used for counting created closures. */\n#define PROTO_CLCOUNT\t\t0x20\t/* Base of saturating 3 bit counter. */\n#define PROTO_CLC_BITS\t\t3\n#define PROTO_CLC_POLY\t\t(3*PROTO_CLCOUNT)  /* Polymorphic threshold. */\n\n#define PROTO_UV_LOCAL\t\t0x8000\t/* Upvalue for local slot. */\n#define PROTO_UV_IMMUTABLE\t0x4000\t/* Immutable upvalue. */\n\n#define proto_kgc(pt, idx) \\\n  check_exp((uintptr_t)(intptr_t)(idx) >= (uintptr_t)-(intptr_t)(pt)->sizekgc, \\\n\t    gcref(mref((pt)->k, GCRef)[(idx)]))\n#define proto_knumtv(pt, idx) \\\n  check_exp((uintptr_t)(idx) < (pt)->sizekn, &mref((pt)->k, TValue)[(idx)])\n#define proto_bc(pt)\t\t((BCIns *)((char *)(pt) + sizeof(GCproto)))\n#define proto_bcpos(pt, pc)\t((BCPos)((pc) - proto_bc(pt)))\n#define proto_uv(pt)\t\t(mref((pt)->uv, uint16_t))\n\n#define proto_chunkname(pt)\t(strref((pt)->chunkname))\n#define proto_chunknamestr(pt)\t(strdata(proto_chunkname((pt))))\n#define proto_lineinfo(pt)\t(mref((pt)->lineinfo, const void))\n#define proto_uvinfo(pt)\t(mref((pt)->uvinfo, const uint8_t))\n#define proto_varinfo(pt)\t(mref((pt)->varinfo, const uint8_t))\n\n/* -- Upvalue object ------------------------------------------------------ */\n\ntypedef struct GCupval {\n  GCHeader;\n  uint8_t closed;\t/* Set if closed (i.e. uv->v == &uv->u.value). */\n  uint8_t immutable;\t/* Immutable value. */\n  union {\n    TValue tv;\t\t/* If closed: the value itself. */\n    struct {\t\t/* If open: double linked list, anchored at thread. */\n      GCRef prev;\n      GCRef next;\n    };\n  };\n  MRef v;\t\t/* Points to stack slot (open) or above (closed). */\n  uint32_t dhash;\t/* Disambiguation hash: dh1 != dh2 => cannot alias. */\n} GCupval;\n\n#define uvprev(uv_)\t(&gcref((uv_)->prev)->uv)\n#define uvnext(uv_)\t(&gcref((uv_)->next)->uv)\n#define uvval(uv_)\t(mref((uv_)->v, TValue))\n\n/* -- Function object (closures) ------------------------------------------ */\n\n/* Common header for functions. env should be at same offset in GCudata. */\n#define GCfuncHeader \\\n  GCHeader; uint8_t ffid; uint8_t nupvalues; \\\n  GCRef env; GCRef gclist; MRef pc\n\ntypedef struct GCfuncC {\n  GCfuncHeader;\n  lua_CFunction f;\t/* C function to be called. */\n  TValue upvalue[1];\t/* Array of upvalues (TValue). */\n} GCfuncC;\n\ntypedef struct GCfuncL {\n  GCfuncHeader;\n  GCRef uvptr[1];\t/* Array of _pointers_ to upvalue objects (GCupval). */\n} GCfuncL;\n\ntypedef union GCfunc {\n  GCfuncC c;\n  GCfuncL l;\n} GCfunc;\n\n#define FF_LUA\t\t0\n#define FF_C\t\t1\n#define isluafunc(fn)\t((fn)->c.ffid == FF_LUA)\n#define iscfunc(fn)\t((fn)->c.ffid == FF_C)\n#define isffunc(fn)\t((fn)->c.ffid > FF_C)\n#define funcproto(fn) \\\n  check_exp(isluafunc(fn), (GCproto *)(mref((fn)->l.pc, char)-sizeof(GCproto)))\n#define sizeCfunc(n)\t(sizeof(GCfuncC)-sizeof(TValue)+sizeof(TValue)*(n))\n#define sizeLfunc(n)\t(sizeof(GCfuncL)-sizeof(GCRef)+sizeof(GCRef)*(n))\n\n/* -- Table object -------------------------------------------------------- */\n\n/* Hash node. */\ntypedef struct Node {\n  TValue val;\t\t/* Value object. Must be first field. */\n  TValue key;\t\t/* Key object. */\n  MRef next;\t\t/* Hash chain. */\n  MRef freetop;\t\t/* Top of free elements (stored in t->node[0]). */\n} Node;\n\nLJ_STATIC_ASSERT(offsetof(Node, val) == 0);\n\ntypedef struct GCtab {\n  GCHeader;\n  uint8_t nomm;\t\t/* Negative cache for fast metamethods. */\n  int8_t colo;\t\t/* Array colocation. */\n  MRef array;\t\t/* Array part. */\n  GCRef gclist;\n  GCRef metatable;\t/* Must be at same offset in GCudata. */\n  MRef node;\t\t/* Hash part. */\n  uint32_t asize;\t/* Size of array part (keys [0, asize-1]). */\n  uint32_t hmask;\t/* Hash part mask (size of hash part - 1). */\n} GCtab;\n\n#define sizetabcolo(n)\t((n)*sizeof(TValue) + sizeof(GCtab))\n#define tabref(r)\t(&gcref((r))->tab)\n#define noderef(r)\t(mref((r), Node))\n#define nextnode(n)\t(mref((n)->next, Node))\n\n/* -- State objects ------------------------------------------------------- */\n\n/* VM states. */\nenum {\n  LJ_VMST_INTERP,\t/* Interpreter. */\n  LJ_VMST_C,\t\t/* C function. */\n  LJ_VMST_GC,\t\t/* Garbage collector. */\n  LJ_VMST_EXIT,\t\t/* Trace exit handler. */\n  LJ_VMST_RECORD,\t/* Trace recorder. */\n  LJ_VMST_OPT,\t\t/* Optimizer. */\n  LJ_VMST_ASM,\t\t/* Assembler. */\n  LJ_VMST__MAX\n};\n\n#define setvmstate(g, st)\t((g)->vmstate = ~LJ_VMST_##st)\n\n/* Metamethods. ORDER MM */\n#ifdef LJ_HASFFI\n#define MMDEF_FFI(_) _(new)\n#else\n#define MMDEF_FFI(_)\n#endif\n\n#if LJ_52 || LJ_HASFFI\n#define MMDEF_PAIRS(_) _(pairs) _(ipairs)\n#else\n#define MMDEF_PAIRS(_)\n#define MM_pairs\t255\n#define MM_ipairs\t255\n#endif\n\n#define MMDEF(_) \\\n  _(index) _(newindex) _(gc) _(mode) _(eq) _(len) \\\n  /* Only the above (fast) metamethods are negative cached (max. 8). */ \\\n  _(lt) _(le) _(concat) _(call) \\\n  /* The following must be in ORDER ARITH. */ \\\n  _(add) _(sub) _(mul) _(div) _(mod) _(pow) _(unm) \\\n  /* The following are used in the standard libraries. */ \\\n  _(metatable) _(tostring) MMDEF_FFI(_) MMDEF_PAIRS(_)\n\ntypedef enum {\n#define MMENUM(name)\tMM_##name,\nMMDEF(MMENUM)\n#undef MMENUM\n  MM__MAX,\n  MM____ = MM__MAX,\n  MM_FAST = MM_len\n} MMS;\n\n/* GC root IDs. */\ntypedef enum {\n  GCROOT_MMNAME,\t/* Metamethod names. */\n  GCROOT_MMNAME_LAST = GCROOT_MMNAME + MM__MAX-1,\n  GCROOT_BASEMT,\t/* Metatables for base types. */\n  GCROOT_BASEMT_NUM = GCROOT_BASEMT + ~LJ_TNUMX,\n  GCROOT_IO_INPUT,\t/* Userdata for default I/O input file. */\n  GCROOT_IO_OUTPUT,\t/* Userdata for default I/O output file. */\n  GCROOT_MAX\n} GCRootID;\n\n#define basemt_it(g, it)\t((g)->gcroot[GCROOT_BASEMT+~(it)])\n#define basemt_obj(g, o)\t((g)->gcroot[GCROOT_BASEMT+itypemap(o)])\n#define mmname_str(g, mm)\t(strref((g)->gcroot[GCROOT_MMNAME+(mm)]))\n\ntypedef struct GCState {\n  MSize total;\t\t/* Memory currently allocated. */\n  MSize threshold;\t/* Memory threshold. */\n  uint8_t currentwhite;\t/* Current white color. */\n  uint8_t state;\t/* GC state. */\n  uint8_t unused1;\n  uint8_t unused2;\n  MSize sweepstr;\t/* Sweep position in string table. */\n  GCRef root;\t\t/* List of all collectable objects. */\n  MRef sweep;\t\t/* Sweep position in root list. */\n  GCRef gray;\t\t/* List of gray objects. */\n  GCRef grayagain;\t/* List of objects for atomic traversal. */\n  GCRef weak;\t\t/* List of weak tables (to be cleared). */\n  GCRef mmudata;\t/* List of userdata (to be finalized). */\n  MSize stepmul;\t/* Incremental GC step granularity. */\n  MSize debt;\t\t/* Debt (how much GC is behind schedule). */\n  MSize estimate;\t/* Estimate of memory actually in use. */\n  MSize pause;\t\t/* Pause between successive GC cycles. */\n} GCState;\n\n/* Global state, shared by all threads of a Lua universe. */\ntypedef struct global_State {\n  GCRef *strhash;\t/* String hash table (hash chain anchors). */\n  MSize strmask;\t/* String hash mask (size of hash table - 1). */\n  MSize strnum;\t\t/* Number of strings in hash table. */\n  lua_Alloc allocf;\t/* Memory allocator. */\n  void *allocd;\t\t/* Memory allocator data. */\n  GCState gc;\t\t/* Garbage collector. */\n  SBuf tmpbuf;\t\t/* Temporary buffer for string concatenation. */\n  Node nilnode;\t\t/* Fallback 1-element hash part (nil key and value). */\n  GCstr strempty;\t/* Empty string. */\n  uint8_t stremptyz;\t/* Zero terminator of empty string. */\n  uint8_t hookmask;\t/* Hook mask. */\n  uint8_t dispatchmode;\t/* Dispatch mode. */\n  uint8_t vmevmask;\t/* VM event mask. */\n  GCRef mainthref;\t/* Link to main thread. */\n  TValue registrytv;\t/* Anchor for registry. */\n  TValue tmptv, tmptv2;\t/* Temporary TValues. */\n  GCupval uvhead;\t/* Head of double-linked list of all open upvalues. */\n  int32_t hookcount;\t/* Instruction hook countdown. */\n  int32_t hookcstart;\t/* Start count for instruction hook counter. */\n  lua_Hook hookf;\t/* Hook function. */\n  lua_CFunction wrapf;\t/* Wrapper for C function calls. */\n  lua_CFunction panic;\t/* Called as a last resort for errors. */\n  volatile int32_t vmstate;  /* VM state or current JIT code trace number. */\n  BCIns bc_cfunc_int;\t/* Bytecode for internal C function calls. */\n  BCIns bc_cfunc_ext;\t/* Bytecode for external C function calls. */\n  GCRef jit_L;\t\t/* Current JIT code lua_State or NULL. */\n  MRef jit_base;\t/* Current JIT code L->base. */\n  MRef ctype_state;\t/* Pointer to C type state. */\n  GCRef gcroot[GCROOT_MAX];  /* GC roots. */\n} global_State;\n\n#define mainthread(g)\t(&gcref(g->mainthref)->th)\n#define niltv(L) \\\n  check_exp(tvisnil(&G(L)->nilnode.val), &G(L)->nilnode.val)\n#define niltvg(g) \\\n  check_exp(tvisnil(&(g)->nilnode.val), &(g)->nilnode.val)\n\n/* Hook management. Hook event masks are defined in lua.h. */\n#define HOOK_EVENTMASK\t\t0x0f\n#define HOOK_ACTIVE\t\t0x10\n#define HOOK_ACTIVE_SHIFT\t4\n#define HOOK_VMEVENT\t\t0x20\n#define HOOK_GC\t\t\t0x40\n#define hook_active(g)\t\t((g)->hookmask & HOOK_ACTIVE)\n#define hook_enter(g)\t\t((g)->hookmask |= HOOK_ACTIVE)\n#define hook_entergc(g)\t\t((g)->hookmask |= (HOOK_ACTIVE|HOOK_GC))\n#define hook_vmevent(g)\t\t((g)->hookmask |= (HOOK_ACTIVE|HOOK_VMEVENT))\n#define hook_leave(g)\t\t((g)->hookmask &= ~HOOK_ACTIVE)\n#define hook_save(g)\t\t((g)->hookmask & ~HOOK_EVENTMASK)\n#define hook_restore(g, h) \\\n  ((g)->hookmask = ((g)->hookmask & HOOK_EVENTMASK) | (h))\n\n/* Per-thread state object. */\nstruct lua_State {\n  GCHeader;\n  uint8_t dummy_ffid;\t/* Fake FF_C for curr_funcisL() on dummy frames. */\n  uint8_t status;\t/* Thread status. */\n  MRef glref;\t\t/* Link to global state. */\n  GCRef gclist;\t\t/* GC chain. */\n  TValue *base;\t\t/* Base of currently executing function. */\n  TValue *top;\t\t/* First free slot in the stack. */\n  MRef maxstack;\t/* Last free slot in the stack. */\n  MRef stack;\t\t/* Stack base. */\n  GCRef openupval;\t/* List of open upvalues in the stack. */\n  GCRef env;\t\t/* Thread environment (table of globals). */\n  void *cframe;\t\t/* End of C stack frame chain. */\n  MSize stacksize;\t/* True stack size (incl. LJ_STACK_EXTRA). */\n};\n\n#define G(L)\t\t\t(mref(L->glref, global_State))\n#define registry(L)\t\t(&G(L)->registrytv)\n\n/* Macros to access the currently executing (Lua) function. */\n#define curr_func(L)\t\t(&gcref((L->base-1)->fr.func)->fn)\n#define curr_funcisL(L)\t\t(isluafunc(curr_func(L)))\n#define curr_proto(L)\t\t(funcproto(curr_func(L)))\n#define curr_topL(L)\t\t(L->base + curr_proto(L)->framesize)\n#define curr_top(L)\t\t(curr_funcisL(L) ? curr_topL(L) : L->top)\n\n/* -- GC object definition and conversions -------------------------------- */\n\n/* GC header for generic access to common fields of GC objects. */\ntypedef struct GChead {\n  GCHeader;\n  uint8_t unused1;\n  uint8_t unused2;\n  GCRef env;\n  GCRef gclist;\n  GCRef metatable;\n} GChead;\n\n/* The env field SHOULD be at the same offset for all GC objects. */\nLJ_STATIC_ASSERT(offsetof(GChead, env) == offsetof(GCfuncL, env));\nLJ_STATIC_ASSERT(offsetof(GChead, env) == offsetof(GCudata, env));\n\n/* The metatable field MUST be at the same offset for all GC objects. */\nLJ_STATIC_ASSERT(offsetof(GChead, metatable) == offsetof(GCtab, metatable));\nLJ_STATIC_ASSERT(offsetof(GChead, metatable) == offsetof(GCudata, metatable));\n\n/* The gclist field MUST be at the same offset for all GC objects. */\nLJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(lua_State, gclist));\nLJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCproto, gclist));\nLJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCfuncL, gclist));\nLJ_STATIC_ASSERT(offsetof(GChead, gclist) == offsetof(GCtab, gclist));\n\ntypedef union GCobj {\n  GChead gch;\n  GCstr str;\n  GCupval uv;\n  lua_State th;\n  GCproto pt;\n  GCfunc fn;\n  GCcdata cd;\n  GCtab tab;\n  GCudata ud;\n} GCobj;\n\n/* Macros to convert a GCobj pointer into a specific value. */\n#define gco2str(o)\tcheck_exp((o)->gch.gct == ~LJ_TSTR, &(o)->str)\n#define gco2uv(o)\tcheck_exp((o)->gch.gct == ~LJ_TUPVAL, &(o)->uv)\n#define gco2th(o)\tcheck_exp((o)->gch.gct == ~LJ_TTHREAD, &(o)->th)\n#define gco2pt(o)\tcheck_exp((o)->gch.gct == ~LJ_TPROTO, &(o)->pt)\n#define gco2func(o)\tcheck_exp((o)->gch.gct == ~LJ_TFUNC, &(o)->fn)\n#define gco2cd(o)\tcheck_exp((o)->gch.gct == ~LJ_TCDATA, &(o)->cd)\n#define gco2tab(o)\tcheck_exp((o)->gch.gct == ~LJ_TTAB, &(o)->tab)\n#define gco2ud(o)\tcheck_exp((o)->gch.gct == ~LJ_TUDATA, &(o)->ud)\n\n/* Macro to convert any collectable object into a GCobj pointer. */\n#define obj2gco(v)\t((GCobj *)(v))\n\n/* -- TValue getters/setters ---------------------------------------------- */\n\n#ifdef LUA_USE_ASSERT\n#include \"lj_gc.h\"\n#endif\n\n/* Macros to test types. */\n#define itype(o)\t((o)->it)\n#define tvisnil(o)\t(itype(o) == LJ_TNIL)\n#define tvisfalse(o)\t(itype(o) == LJ_TFALSE)\n#define tvistrue(o)\t(itype(o) == LJ_TTRUE)\n#define tvisbool(o)\t(tvisfalse(o) || tvistrue(o))\n#if LJ_64\n#define tvislightud(o)\t(((int32_t)itype(o) >> 15) == -2)\n#else\n#define tvislightud(o)\t(itype(o) == LJ_TLIGHTUD)\n#endif\n#define tvisstr(o)\t(itype(o) == LJ_TSTR)\n#define tvisfunc(o)\t(itype(o) == LJ_TFUNC)\n#define tvisthread(o)\t(itype(o) == LJ_TTHREAD)\n#define tvisproto(o)\t(itype(o) == LJ_TPROTO)\n#define tviscdata(o)\t(itype(o) == LJ_TCDATA)\n#define tvistab(o)\t(itype(o) == LJ_TTAB)\n#define tvisudata(o)\t(itype(o) == LJ_TUDATA)\n#define tvisnumber(o)\t(itype(o) <= LJ_TISNUM)\n#define tvisint(o)\t(LJ_DUALNUM && itype(o) == LJ_TISNUM)\n#define tvisnum(o)\t(itype(o) < LJ_TISNUM)\n\n#define tvistruecond(o)\t(itype(o) < LJ_TISTRUECOND)\n#define tvispri(o)\t(itype(o) >= LJ_TISPRI)\n#define tvistabud(o)\t(itype(o) <= LJ_TISTABUD)  /* && !tvisnum() */\n#define tvisgcv(o)\t((itype(o) - LJ_TISGCV) > (LJ_TNUMX - LJ_TISGCV))\n\n/* Special macros to test numbers for NaN, +0, -0, +1 and raw equality. */\n#define tvisnan(o)\t((o)->n != (o)->n)\n#if LJ_64\n#define tviszero(o)\t(((o)->u64 << 1) == 0)\n#else\n#define tviszero(o)\t(((o)->u32.lo | ((o)->u32.hi << 1)) == 0)\n#endif\n#define tvispzero(o)\t((o)->u64 == 0)\n#define tvismzero(o)\t((o)->u64 == U64x(80000000,00000000))\n#define tvispone(o)\t((o)->u64 == U64x(3ff00000,00000000))\n#define rawnumequal(o1, o2)\t((o1)->u64 == (o2)->u64)\n\n/* Macros to convert type ids. */\n#if LJ_64\n#define itypemap(o) \\\n  (tvisnumber(o) ? ~LJ_TNUMX : tvislightud(o) ? ~LJ_TLIGHTUD : ~itype(o))\n#else\n#define itypemap(o)\t(tvisnumber(o) ? ~LJ_TNUMX : ~itype(o))\n#endif\n\n/* Macros to get tagged values. */\n#define gcval(o)\t(gcref((o)->gcr))\n#define boolV(o)\tcheck_exp(tvisbool(o), (LJ_TFALSE - (o)->it))\n#if LJ_64\n#define lightudV(o) \\\n  check_exp(tvislightud(o), (void *)((o)->u64 & U64x(00007fff,ffffffff)))\n#else\n#define lightudV(o)\tcheck_exp(tvislightud(o), gcrefp((o)->gcr, void))\n#endif\n#define gcV(o)\t\tcheck_exp(tvisgcv(o), gcval(o))\n#define strV(o)\t\tcheck_exp(tvisstr(o), &gcval(o)->str)\n#define funcV(o)\tcheck_exp(tvisfunc(o), &gcval(o)->fn)\n#define threadV(o)\tcheck_exp(tvisthread(o), &gcval(o)->th)\n#define protoV(o)\tcheck_exp(tvisproto(o), &gcval(o)->pt)\n#define cdataV(o)\tcheck_exp(tviscdata(o), &gcval(o)->cd)\n#define tabV(o)\t\tcheck_exp(tvistab(o), &gcval(o)->tab)\n#define udataV(o)\tcheck_exp(tvisudata(o), &gcval(o)->ud)\n#define numV(o)\t\tcheck_exp(tvisnum(o), (o)->n)\n#define intV(o)\t\tcheck_exp(tvisint(o), (int32_t)(o)->i)\n\n/* Macros to set tagged values. */\n#define setitype(o, i)\t\t((o)->it = (i))\n#define setnilV(o)\t\t((o)->it = LJ_TNIL)\n#define setboolV(o, x)\t\t((o)->it = LJ_TFALSE-(uint32_t)(x))\n\nstatic LJ_AINLINE void setlightudV(TValue *o, void *p)\n{\n#if LJ_64\n  o->u64 = (uint64_t)p | (((uint64_t)0xffff) << 48);\n#else\n  setgcrefp(o->gcr, p); setitype(o, LJ_TLIGHTUD);\n#endif\n}\n\n#if LJ_64\n#define checklightudptr(L, p) \\\n  (((uint64_t)(p) >> 47) ? (lj_err_msg(L, LJ_ERR_BADLU), NULL) : (p))\n#define setcont(o, f) \\\n  ((o)->u64 = (uint64_t)(void *)(f) - (uint64_t)lj_vm_asm_begin)\n#else\n#define checklightudptr(L, p)\t(p)\n#define setcont(o, f)\t\tsetlightudV((o), (void *)(f))\n#endif\n\n#define tvchecklive(L, o) \\\n  UNUSED(L), lua_assert(!tvisgcv(o) || \\\n  ((~itype(o) == gcval(o)->gch.gct) && !isdead(G(L), gcval(o))))\n\nstatic LJ_AINLINE void setgcV(lua_State *L, TValue *o, GCobj *v, uint32_t itype)\n{\n  setgcref(o->gcr, v); setitype(o, itype); tvchecklive(L, o);\n}\n\n#define define_setV(name, type, tag) \\\nstatic LJ_AINLINE void name(lua_State *L, TValue *o, type *v) \\\n{ \\\n  setgcV(L, o, obj2gco(v), tag); \\\n}\ndefine_setV(setstrV, GCstr, LJ_TSTR)\ndefine_setV(setthreadV, lua_State, LJ_TTHREAD)\ndefine_setV(setprotoV, GCproto, LJ_TPROTO)\ndefine_setV(setfuncV, GCfunc, LJ_TFUNC)\ndefine_setV(setcdataV, GCcdata, LJ_TCDATA)\ndefine_setV(settabV, GCtab, LJ_TTAB)\ndefine_setV(setudataV, GCudata, LJ_TUDATA)\n\n#define setnumV(o, x)\t\t((o)->n = (x))\n#define setnanV(o)\t\t((o)->u64 = U64x(fff80000,00000000))\n#define setpinfV(o)\t\t((o)->u64 = U64x(7ff00000,00000000))\n#define setminfV(o)\t\t((o)->u64 = U64x(fff00000,00000000))\n\nstatic LJ_AINLINE void setintV(TValue *o, int32_t i)\n{\n#if LJ_DUALNUM\n  o->i = (uint32_t)i; setitype(o, LJ_TISNUM);\n#else\n  o->n = (lua_Number)i;\n#endif\n}\n\nstatic LJ_AINLINE void setint64V(TValue *o, int64_t i)\n{\n  if (LJ_DUALNUM && LJ_LIKELY(i == (int64_t)(int32_t)i))\n    setintV(o, (int32_t)i);\n  else\n    setnumV(o, (lua_Number)i);\n}\n\n#if LJ_64\n#define setintptrV(o, i)\tsetint64V((o), (i))\n#else\n#define setintptrV(o, i)\tsetintV((o), (i))\n#endif\n\n/* Copy tagged values. */\nstatic LJ_AINLINE void copyTV(lua_State *L, TValue *o1, const TValue *o2)\n{\n  *o1 = *o2; tvchecklive(L, o1);\n}\n\n/* -- Number to integer conversion ---------------------------------------- */\n\n#if LJ_SOFTFP\nLJ_ASMF int32_t lj_vm_tobit(double x);\n#endif\n\nstatic LJ_AINLINE int32_t lj_num2bit(lua_Number n)\n{\n#if LJ_SOFTFP\n  return lj_vm_tobit(n);\n#else\n  TValue o;\n  o.n = n + 6755399441055744.0;  /* 2^52 + 2^51 */\n  return (int32_t)o.u32.lo;\n#endif\n}\n\n#if LJ_TARGET_X86 && !defined(__SSE2__)\n#define lj_num2int(n)   lj_num2bit((n))\n#else\n#define lj_num2int(n)   ((int32_t)(n))\n#endif\n\nstatic LJ_AINLINE uint64_t lj_num2u64(lua_Number n)\n{\n#ifdef _MSC_VER\n  if (n >= 9223372036854775808.0)  /* They think it's a feature. */\n    return (uint64_t)(int64_t)(n - 18446744073709551616.0);\n  else\n#endif\n    return (uint64_t)n;\n}\n\nstatic LJ_AINLINE int32_t numberVint(cTValue *o)\n{\n  if (LJ_LIKELY(tvisint(o)))\n    return intV(o);\n  else\n    return lj_num2int(numV(o));\n}\n\nstatic LJ_AINLINE lua_Number numberVnum(cTValue *o)\n{\n  if (LJ_UNLIKELY(tvisint(o)))\n    return (lua_Number)intV(o);\n  else\n    return numV(o);\n}\n\n/* -- Miscellaneous object handling --------------------------------------- */\n\n/* Names and maps for internal and external object tags. */\nLJ_DATA const char *const lj_obj_typename[1+LUA_TCDATA+1];\nLJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+1];\n\n#define lj_typename(o)\t(lj_obj_itypename[itypemap(o)])\n\n/* Compare two objects without calling metamethods. */\nLJ_FUNC int lj_obj_equal(cTValue *o1, cTValue *o2);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_opt_dce.c",
    "content": "/*\n** DCE: Dead Code Elimination. Pre-LOOP only -- ASM already performs DCE.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_opt_dce_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t(&J->cur.ir[(ref)])\n\n/* Scan through all snapshots and mark all referenced instructions. */\nstatic void dce_marksnap(jit_State *J)\n{\n  SnapNo i, nsnap = J->cur.nsnap;\n  for (i = 0; i < nsnap; i++) {\n    SnapShot *snap = &J->cur.snap[i];\n    SnapEntry *map = &J->cur.snapmap[snap->mapofs];\n    MSize n, nent = snap->nent;\n    for (n = 0; n < nent; n++) {\n      IRRef ref = snap_ref(map[n]);\n      if (ref >= REF_FIRST)\n\tirt_setmark(IR(ref)->t);\n    }\n  }\n}\n\n/* Backwards propagate marks. Replace unused instructions with NOPs. */\nstatic void dce_propagate(jit_State *J)\n{\n  IRRef1 *pchain[IR__MAX];\n  IRRef ins;\n  uint32_t i;\n  for (i = 0; i < IR__MAX; i++) pchain[i] = &J->chain[i];\n  for (ins = J->cur.nins-1; ins >= REF_FIRST; ins--) {\n    IRIns *ir = IR(ins);\n    if (irt_ismarked(ir->t)) {\n      irt_clearmark(ir->t);\n      pchain[ir->o] = &ir->prev;\n    } else if (!ir_sideeff(ir)) {\n      *pchain[ir->o] = ir->prev;  /* Reroute original instruction chain. */\n      ir->t.irt = IRT_NIL;\n      ir->o = IR_NOP;  /* Replace instruction with NOP. */\n      ir->op1 = ir->op2 = 0;\n      ir->prev = 0;\n      continue;\n    }\n    if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t);\n    if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t);\n  }\n}\n\n/* Dead Code Elimination.\n**\n** First backpropagate marks for all used instructions. Then replace\n** the unused ones with a NOP. Note that compressing the IR to eliminate\n** the NOPs does not pay off.\n*/\nvoid lj_opt_dce(jit_State *J)\n{\n  if ((J->flags & JIT_F_OPT_DCE)) {\n    dce_marksnap(J);\n    dce_propagate(J);\n  }\n}\n\n#undef IR\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_opt_fold.c",
    "content": "/*\n** FOLD: Constant Folding, Algebraic Simplifications and Reassociation.\n** ABCelim: Array Bounds Check Elimination.\n** CSE: Common-Subexpression Elimination.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_opt_fold_c\n#define LUA_CORE\n\n#include <math.h>\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#endif\n#include \"lj_carith.h\"\n#include \"lj_vm.h\"\n#include \"lj_strscan.h\"\n\n/* Here's a short description how the FOLD engine processes instructions:\n**\n** The FOLD engine receives a single instruction stored in fins (J->fold.ins).\n** The instruction and its operands are used to select matching fold rules.\n** These are applied iteratively until a fixed point is reached.\n**\n** The 8 bit opcode of the instruction itself plus the opcodes of the\n** two instructions referenced by its operands form a 24 bit key\n** 'ins left right' (unused operands -> 0, literals -> lowest 8 bits).\n**\n** This key is used for partial matching against the fold rules. The\n** left/right operand fields of the key are successively masked with\n** the 'any' wildcard, from most specific to least specific:\n**\n**   ins left right\n**   ins any  right\n**   ins left any\n**   ins any  any\n**\n** The masked key is used to lookup a matching fold rule in a semi-perfect\n** hash table. If a matching rule is found, the related fold function is run.\n** Multiple rules can share the same fold function. A fold rule may return\n** one of several special values:\n**\n** - NEXTFOLD means no folding was applied, because an additional test\n**   inside the fold function failed. Matching continues against less\n**   specific fold rules. Finally the instruction is passed on to CSE.\n**\n** - RETRYFOLD means the instruction was modified in-place. Folding is\n**   retried as if this instruction had just been received.\n**\n** All other return values are terminal actions -- no further folding is\n** applied:\n**\n** - INTFOLD(i) returns a reference to the integer constant i.\n**\n** - LEFTFOLD and RIGHTFOLD return the left/right operand reference\n**   without emitting an instruction.\n**\n** - CSEFOLD and EMITFOLD pass the instruction directly to CSE or emit\n**   it without passing through any further optimizations.\n**\n** - FAILFOLD, DROPFOLD and CONDFOLD only apply to instructions which have\n**   no result (e.g. guarded assertions): FAILFOLD means the guard would\n**   always fail, i.e. the current trace is pointless. DROPFOLD means\n**   the guard is always true and has been eliminated. CONDFOLD is a\n**   shortcut for FAILFOLD + cond (i.e. drop if true, otherwise fail).\n**\n** - Any other return value is interpreted as an IRRef or TRef. This\n**   can be a reference to an existing or a newly created instruction.\n**   Only the least-significant 16 bits (IRRef1) are used to form a TRef\n**   which is finally returned to the caller.\n**\n** The FOLD engine receives instructions both from the trace recorder and\n** substituted instructions from LOOP unrolling. This means all types\n** of instructions may end up here, even though the recorder bypasses\n** FOLD in some cases. Thus all loads, stores and allocations must have\n** an any/any rule to avoid being passed on to CSE.\n**\n** Carefully read the following requirements before adding or modifying\n** any fold rules:\n**\n** Requirement #1: All fold rules must preserve their destination type.\n**\n** Consistently use INTFOLD() (KINT result) or lj_ir_knum() (KNUM result).\n** Never use lj_ir_knumint() which can have either a KINT or KNUM result.\n**\n** Requirement #2: Fold rules should not create *new* instructions which\n** reference operands *across* PHIs.\n**\n** E.g. a RETRYFOLD with 'fins->op1 = fleft->op1' is invalid if the\n** left operand is a PHI. Then fleft->op1 would point across the PHI\n** frontier to an invariant instruction. Adding a PHI for this instruction\n** would be counterproductive. The solution is to add a barrier which\n** prevents folding across PHIs, i.e. 'PHIBARRIER(fleft)' in this case.\n** The only exception is for recurrences with high latencies like\n** repeated int->num->int conversions.\n**\n** One could relax this condition a bit if the referenced instruction is\n** a PHI, too. But this often leads to worse code due to excessive\n** register shuffling.\n**\n** Note: returning *existing* instructions (e.g. LEFTFOLD) is ok, though.\n** Even returning fleft->op1 would be ok, because a new PHI will added,\n** if needed. But again, this leads to excessive register shuffling and\n** should be avoided.\n**\n** Requirement #3: The set of all fold rules must be monotonic to guarantee\n** termination.\n**\n** The goal is optimization, so one primarily wants to add strength-reducing\n** rules. This means eliminating an instruction or replacing an instruction\n** with one or more simpler instructions. Don't add fold rules which point\n** into the other direction.\n**\n** Some rules (like commutativity) do not directly reduce the strength of\n** an instruction, but enable other fold rules (e.g. by moving constants\n** to the right operand). These rules must be made unidirectional to avoid\n** cycles.\n**\n** Rule of thumb: the trace recorder expands the IR and FOLD shrinks it.\n*/\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t(&J->cur.ir[(ref)])\n#define fins\t\t(&J->fold.ins)\n#define fleft\t\t(&J->fold.left)\n#define fright\t\t(&J->fold.right)\n#define knumleft\t(ir_knum(fleft)->n)\n#define knumright\t(ir_knum(fright)->n)\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n/* Fold function type. Fastcall on x86 significantly reduces their size. */\ntypedef IRRef (LJ_FASTCALL *FoldFunc)(jit_State *J);\n\n/* Macros for the fold specs, so buildvm can recognize them. */\n#define LJFOLD(x)\n#define LJFOLDX(x)\n#define LJFOLDF(name)\tstatic TRef LJ_FASTCALL fold_##name(jit_State *J)\n/* Note: They must be at the start of a line or buildvm ignores them! */\n\n/* Barrier to prevent using operands across PHIs. */\n#define PHIBARRIER(ir)\tif (irt_isphi((ir)->t)) return NEXTFOLD\n\n/* Barrier to prevent folding across a GC step.\n** GC steps can only happen at the head of a trace and at LOOP.\n** And the GC is only driven forward if there is at least one allocation.\n*/\n#define gcstep_barrier(J, ref) \\\n  ((ref) < J->chain[IR_LOOP] && \\\n   (J->chain[IR_SNEW] || J->chain[IR_XSNEW] || \\\n    J->chain[IR_TNEW] || J->chain[IR_TDUP] || \\\n    J->chain[IR_CNEW] || J->chain[IR_CNEWI] || J->chain[IR_TOSTR]))\n\n/* -- Constant folding for FP numbers ------------------------------------- */\n\nLJFOLD(ADD KNUM KNUM)\nLJFOLD(SUB KNUM KNUM)\nLJFOLD(MUL KNUM KNUM)\nLJFOLD(DIV KNUM KNUM)\nLJFOLD(NEG KNUM KNUM)\nLJFOLD(ABS KNUM KNUM)\nLJFOLD(ATAN2 KNUM KNUM)\nLJFOLD(LDEXP KNUM KNUM)\nLJFOLD(MIN KNUM KNUM)\nLJFOLD(MAX KNUM KNUM)\nLJFOLDF(kfold_numarith)\n{\n  lua_Number a = knumleft;\n  lua_Number b = knumright;\n  lua_Number y = lj_vm_foldarith(a, b, fins->o - IR_ADD);\n  return lj_ir_knum(J, y);\n}\n\nLJFOLD(LDEXP KNUM KINT)\nLJFOLDF(kfold_ldexp)\n{\n#if LJ_TARGET_X86ORX64\n  UNUSED(J);\n  return NEXTFOLD;\n#else\n  return lj_ir_knum(J, ldexp(knumleft, fright->i));\n#endif\n}\n\nLJFOLD(FPMATH KNUM any)\nLJFOLDF(kfold_fpmath)\n{\n  lua_Number a = knumleft;\n  lua_Number y = lj_vm_foldfpm(a, fins->op2);\n  return lj_ir_knum(J, y);\n}\n\nLJFOLD(POW KNUM KINT)\nLJFOLDF(kfold_numpow)\n{\n  lua_Number a = knumleft;\n  lua_Number b = (lua_Number)fright->i;\n  lua_Number y = lj_vm_foldarith(a, b, IR_POW - IR_ADD);\n  return lj_ir_knum(J, y);\n}\n\n/* Must not use kfold_kref for numbers (could be NaN). */\nLJFOLD(EQ KNUM KNUM)\nLJFOLD(NE KNUM KNUM)\nLJFOLD(LT KNUM KNUM)\nLJFOLD(GE KNUM KNUM)\nLJFOLD(LE KNUM KNUM)\nLJFOLD(GT KNUM KNUM)\nLJFOLD(ULT KNUM KNUM)\nLJFOLD(UGE KNUM KNUM)\nLJFOLD(ULE KNUM KNUM)\nLJFOLD(UGT KNUM KNUM)\nLJFOLDF(kfold_numcomp)\n{\n  return CONDFOLD(lj_ir_numcmp(knumleft, knumright, (IROp)fins->o));\n}\n\n/* -- Constant folding for 32 bit integers -------------------------------- */\n\nstatic int32_t kfold_intop(int32_t k1, int32_t k2, IROp op)\n{\n  switch (op) {\n  case IR_ADD: k1 += k2; break;\n  case IR_SUB: k1 -= k2; break;\n  case IR_MUL: k1 *= k2; break;\n  case IR_MOD: k1 = lj_vm_modi(k1, k2); break;\n  case IR_NEG: k1 = -k1; break;\n  case IR_BAND: k1 &= k2; break;\n  case IR_BOR: k1 |= k2; break;\n  case IR_BXOR: k1 ^= k2; break;\n  case IR_BSHL: k1 <<= (k2 & 31); break;\n  case IR_BSHR: k1 = (int32_t)((uint32_t)k1 >> (k2 & 31)); break;\n  case IR_BSAR: k1 >>= (k2 & 31); break;\n  case IR_BROL: k1 = (int32_t)lj_rol((uint32_t)k1, (k2 & 31)); break;\n  case IR_BROR: k1 = (int32_t)lj_ror((uint32_t)k1, (k2 & 31)); break;\n  case IR_MIN: k1 = k1 < k2 ? k1 : k2; break;\n  case IR_MAX: k1 = k1 > k2 ? k1 : k2; break;\n  default: lua_assert(0); break;\n  }\n  return k1;\n}\n\nLJFOLD(ADD KINT KINT)\nLJFOLD(SUB KINT KINT)\nLJFOLD(MUL KINT KINT)\nLJFOLD(MOD KINT KINT)\nLJFOLD(NEG KINT KINT)\nLJFOLD(BAND KINT KINT)\nLJFOLD(BOR KINT KINT)\nLJFOLD(BXOR KINT KINT)\nLJFOLD(BSHL KINT KINT)\nLJFOLD(BSHR KINT KINT)\nLJFOLD(BSAR KINT KINT)\nLJFOLD(BROL KINT KINT)\nLJFOLD(BROR KINT KINT)\nLJFOLD(MIN KINT KINT)\nLJFOLD(MAX KINT KINT)\nLJFOLDF(kfold_intarith)\n{\n  return INTFOLD(kfold_intop(fleft->i, fright->i, (IROp)fins->o));\n}\n\nLJFOLD(ADDOV KINT KINT)\nLJFOLD(SUBOV KINT KINT)\nLJFOLD(MULOV KINT KINT)\nLJFOLDF(kfold_intovarith)\n{\n  lua_Number n = lj_vm_foldarith((lua_Number)fleft->i, (lua_Number)fright->i,\n\t\t\t\t fins->o - IR_ADDOV);\n  int32_t k = lj_num2int(n);\n  if (n != (lua_Number)k)\n    return FAILFOLD;\n  return INTFOLD(k);\n}\n\nLJFOLD(BNOT KINT)\nLJFOLDF(kfold_bnot)\n{\n  return INTFOLD(~fleft->i);\n}\n\nLJFOLD(BSWAP KINT)\nLJFOLDF(kfold_bswap)\n{\n  return INTFOLD((int32_t)lj_bswap((uint32_t)fleft->i));\n}\n\nLJFOLD(LT KINT KINT)\nLJFOLD(GE KINT KINT)\nLJFOLD(LE KINT KINT)\nLJFOLD(GT KINT KINT)\nLJFOLD(ULT KINT KINT)\nLJFOLD(UGE KINT KINT)\nLJFOLD(ULE KINT KINT)\nLJFOLD(UGT KINT KINT)\nLJFOLD(ABC KINT KINT)\nLJFOLDF(kfold_intcomp)\n{\n  int32_t a = fleft->i, b = fright->i;\n  switch ((IROp)fins->o) {\n  case IR_LT: return CONDFOLD(a < b);\n  case IR_GE: return CONDFOLD(a >= b);\n  case IR_LE: return CONDFOLD(a <= b);\n  case IR_GT: return CONDFOLD(a > b);\n  case IR_ULT: return CONDFOLD((uint32_t)a < (uint32_t)b);\n  case IR_UGE: return CONDFOLD((uint32_t)a >= (uint32_t)b);\n  case IR_ULE: return CONDFOLD((uint32_t)a <= (uint32_t)b);\n  case IR_ABC:\n  case IR_UGT: return CONDFOLD((uint32_t)a > (uint32_t)b);\n  default: lua_assert(0); return FAILFOLD;\n  }\n}\n\nLJFOLD(UGE any KINT)\nLJFOLDF(kfold_intcomp0)\n{\n  if (fright->i == 0)\n    return DROPFOLD;\n  return NEXTFOLD;\n}\n\n/* -- Constant folding for 64 bit integers -------------------------------- */\n\nstatic uint64_t kfold_int64arith(uint64_t k1, uint64_t k2, IROp op)\n{\n  switch (op) {\n#if LJ_64 || LJ_HASFFI\n  case IR_ADD: k1 += k2; break;\n  case IR_SUB: k1 -= k2; break;\n#endif\n#if LJ_HASFFI\n  case IR_MUL: k1 *= k2; break;\n  case IR_BAND: k1 &= k2; break;\n  case IR_BOR: k1 |= k2; break;\n  case IR_BXOR: k1 ^= k2; break;\n#endif\n  default: UNUSED(k2); lua_assert(0); break;\n  }\n  return k1;\n}\n\nLJFOLD(ADD KINT64 KINT64)\nLJFOLD(SUB KINT64 KINT64)\nLJFOLD(MUL KINT64 KINT64)\nLJFOLD(BAND KINT64 KINT64)\nLJFOLD(BOR KINT64 KINT64)\nLJFOLD(BXOR KINT64 KINT64)\nLJFOLDF(kfold_int64arith)\n{\n  return INT64FOLD(kfold_int64arith(ir_k64(fleft)->u64,\n\t\t\t\t    ir_k64(fright)->u64, (IROp)fins->o));\n}\n\nLJFOLD(DIV KINT64 KINT64)\nLJFOLD(MOD KINT64 KINT64)\nLJFOLD(POW KINT64 KINT64)\nLJFOLDF(kfold_int64arith2)\n{\n#if LJ_HASFFI\n  uint64_t k1 = ir_k64(fleft)->u64, k2 = ir_k64(fright)->u64;\n  if (irt_isi64(fins->t)) {\n    k1 = fins->o == IR_DIV ? lj_carith_divi64((int64_t)k1, (int64_t)k2) :\n\t fins->o == IR_MOD ? lj_carith_modi64((int64_t)k1, (int64_t)k2) :\n\t\t\t     lj_carith_powi64((int64_t)k1, (int64_t)k2);\n  } else {\n    k1 = fins->o == IR_DIV ? lj_carith_divu64(k1, k2) :\n\t fins->o == IR_MOD ? lj_carith_modu64(k1, k2) :\n\t\t\t     lj_carith_powu64(k1, k2);\n  }\n  return INT64FOLD(k1);\n#else\n  UNUSED(J); lua_assert(0); return FAILFOLD;\n#endif\n}\n\nLJFOLD(BSHL KINT64 KINT)\nLJFOLD(BSHR KINT64 KINT)\nLJFOLD(BSAR KINT64 KINT)\nLJFOLD(BROL KINT64 KINT)\nLJFOLD(BROR KINT64 KINT)\nLJFOLDF(kfold_int64shift)\n{\n#if LJ_HASFFI || LJ_64\n  uint64_t k = ir_k64(fleft)->u64;\n  int32_t sh = (fright->i & 63);\n  switch ((IROp)fins->o) {\n  case IR_BSHL: k <<= sh; break;\n#if LJ_HASFFI\n  case IR_BSHR: k >>= sh; break;\n  case IR_BSAR: k = (uint64_t)((int64_t)k >> sh); break;\n  case IR_BROL: k = lj_rol(k, sh); break;\n  case IR_BROR: k = lj_ror(k, sh); break;\n#endif\n  default: lua_assert(0); break;\n  }\n  return INT64FOLD(k);\n#else\n  UNUSED(J); lua_assert(0); return FAILFOLD;\n#endif\n}\n\nLJFOLD(BNOT KINT64)\nLJFOLDF(kfold_bnot64)\n{\n#if LJ_HASFFI\n  return INT64FOLD(~ir_k64(fleft)->u64);\n#else\n  UNUSED(J); lua_assert(0); return FAILFOLD;\n#endif\n}\n\nLJFOLD(BSWAP KINT64)\nLJFOLDF(kfold_bswap64)\n{\n#if LJ_HASFFI\n  return INT64FOLD(lj_bswap64(ir_k64(fleft)->u64));\n#else\n  UNUSED(J); lua_assert(0); return FAILFOLD;\n#endif\n}\n\nLJFOLD(LT KINT64 KINT64)\nLJFOLD(GE KINT64 KINT64)\nLJFOLD(LE KINT64 KINT64)\nLJFOLD(GT KINT64 KINT64)\nLJFOLD(ULT KINT64 KINT64)\nLJFOLD(UGE KINT64 KINT64)\nLJFOLD(ULE KINT64 KINT64)\nLJFOLD(UGT KINT64 KINT64)\nLJFOLDF(kfold_int64comp)\n{\n#if LJ_HASFFI\n  uint64_t a = ir_k64(fleft)->u64, b = ir_k64(fright)->u64;\n  switch ((IROp)fins->o) {\n  case IR_LT: return CONDFOLD(a < b);\n  case IR_GE: return CONDFOLD(a >= b);\n  case IR_LE: return CONDFOLD(a <= b);\n  case IR_GT: return CONDFOLD(a > b);\n  case IR_ULT: return CONDFOLD((uint64_t)a < (uint64_t)b);\n  case IR_UGE: return CONDFOLD((uint64_t)a >= (uint64_t)b);\n  case IR_ULE: return CONDFOLD((uint64_t)a <= (uint64_t)b);\n  case IR_UGT: return CONDFOLD((uint64_t)a > (uint64_t)b);\n  default: lua_assert(0); return FAILFOLD;\n  }\n#else\n  UNUSED(J); lua_assert(0); return FAILFOLD;\n#endif\n}\n\nLJFOLD(UGE any KINT64)\nLJFOLDF(kfold_int64comp0)\n{\n#if LJ_HASFFI\n  if (ir_k64(fright)->u64 == 0)\n    return DROPFOLD;\n  return NEXTFOLD;\n#else\n  UNUSED(J); lua_assert(0); return FAILFOLD;\n#endif\n}\n\n/* -- Constant folding for strings ---------------------------------------- */\n\nLJFOLD(SNEW KKPTR KINT)\nLJFOLDF(kfold_snew_kptr)\n{\n  GCstr *s = lj_str_new(J->L, (const char *)ir_kptr(fleft), (size_t)fright->i);\n  return lj_ir_kstr(J, s);\n}\n\nLJFOLD(SNEW any KINT)\nLJFOLDF(kfold_snew_empty)\n{\n  if (fright->i == 0)\n    return lj_ir_kstr(J, &J2G(J)->strempty);\n  return NEXTFOLD;\n}\n\nLJFOLD(STRREF KGC KINT)\nLJFOLDF(kfold_strref)\n{\n  GCstr *str = ir_kstr(fleft);\n  lua_assert((MSize)fright->i <= str->len);\n  return lj_ir_kkptr(J, (char *)strdata(str) + fright->i);\n}\n\nLJFOLD(STRREF SNEW any)\nLJFOLDF(kfold_strref_snew)\n{\n  PHIBARRIER(fleft);\n  if (irref_isk(fins->op2) && fright->i == 0) {\n    return fleft->op1;  /* strref(snew(ptr, len), 0) ==> ptr */\n  } else {\n    /* Reassociate: strref(snew(strref(str, a), len), b) ==> strref(str, a+b) */\n    IRIns *ir = IR(fleft->op1);\n    IRRef1 str = ir->op1;  /* IRIns * is not valid across emitir. */\n    lua_assert(ir->o == IR_STRREF);\n    PHIBARRIER(ir);\n    fins->op2 = emitir(IRTI(IR_ADD), ir->op2, fins->op2);  /* Clobbers fins! */\n    fins->op1 = str;\n    fins->ot = IRT(IR_STRREF, IRT_P32);\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(CALLN CARG IRCALL_lj_str_cmp)\nLJFOLDF(kfold_strcmp)\n{\n  if (irref_isk(fleft->op1) && irref_isk(fleft->op2)) {\n    GCstr *a = ir_kstr(IR(fleft->op1));\n    GCstr *b = ir_kstr(IR(fleft->op2));\n    return INTFOLD(lj_str_cmp(a, b));\n  }\n  return NEXTFOLD;\n}\n\n/* -- Constant folding of pointer arithmetic ------------------------------ */\n\nLJFOLD(ADD KGC KINT)\nLJFOLD(ADD KGC KINT64)\nLJFOLDF(kfold_add_kgc)\n{\n  GCobj *o = ir_kgc(fleft);\n#if LJ_64\n  ptrdiff_t ofs = (ptrdiff_t)ir_kint64(fright)->u64;\n#else\n  ptrdiff_t ofs = fright->i;\n#endif\n#if LJ_HASFFI\n  if (irt_iscdata(fleft->t)) {\n    CType *ct = ctype_raw(ctype_ctsG(J2G(J)), gco2cd(o)->ctypeid);\n    if (ctype_isnum(ct->info) || ctype_isenum(ct->info) ||\n\tctype_isptr(ct->info) || ctype_isfunc(ct->info) ||\n\tctype_iscomplex(ct->info) || ctype_isvector(ct->info))\n      return lj_ir_kkptr(J, (char *)o + ofs);\n  }\n#endif\n  return lj_ir_kptr(J, (char *)o + ofs);\n}\n\nLJFOLD(ADD KPTR KINT)\nLJFOLD(ADD KPTR KINT64)\nLJFOLD(ADD KKPTR KINT)\nLJFOLD(ADD KKPTR KINT64)\nLJFOLDF(kfold_add_kptr)\n{\n  void *p = ir_kptr(fleft);\n#if LJ_64\n  ptrdiff_t ofs = (ptrdiff_t)ir_kint64(fright)->u64;\n#else\n  ptrdiff_t ofs = fright->i;\n#endif\n  return lj_ir_kptr_(J, fleft->o, (char *)p + ofs);\n}\n\nLJFOLD(ADD any KGC)\nLJFOLD(ADD any KPTR)\nLJFOLD(ADD any KKPTR)\nLJFOLDF(kfold_add_kright)\n{\n  if (fleft->o == IR_KINT || fleft->o == IR_KINT64) {\n    IRRef1 tmp = fins->op1; fins->op1 = fins->op2; fins->op2 = tmp;\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\n/* -- Constant folding of conversions ------------------------------------- */\n\nLJFOLD(TOBIT KNUM KNUM)\nLJFOLDF(kfold_tobit)\n{\n  return INTFOLD(lj_num2bit(knumleft));\n}\n\nLJFOLD(CONV KINT IRCONV_NUM_INT)\nLJFOLDF(kfold_conv_kint_num)\n{\n  return lj_ir_knum(J, (lua_Number)fleft->i);\n}\n\nLJFOLD(CONV KINT IRCONV_NUM_U32)\nLJFOLDF(kfold_conv_kintu32_num)\n{\n  return lj_ir_knum(J, (lua_Number)(uint32_t)fleft->i);\n}\n\nLJFOLD(CONV KINT IRCONV_INT_I8)\nLJFOLD(CONV KINT IRCONV_INT_U8)\nLJFOLD(CONV KINT IRCONV_INT_I16)\nLJFOLD(CONV KINT IRCONV_INT_U16)\nLJFOLDF(kfold_conv_kint_ext)\n{\n  int32_t k = fleft->i;\n  if ((fins->op2 & IRCONV_SRCMASK) == IRT_I8) k = (int8_t)k;\n  else if ((fins->op2 & IRCONV_SRCMASK) == IRT_U8) k = (uint8_t)k;\n  else if ((fins->op2 & IRCONV_SRCMASK) == IRT_I16) k = (int16_t)k;\n  else k = (uint16_t)k;\n  return INTFOLD(k);\n}\n\nLJFOLD(CONV KINT IRCONV_I64_INT)\nLJFOLD(CONV KINT IRCONV_U64_INT)\nLJFOLD(CONV KINT IRCONV_I64_U32)\nLJFOLD(CONV KINT IRCONV_U64_U32)\nLJFOLDF(kfold_conv_kint_i64)\n{\n  if ((fins->op2 & IRCONV_SEXT))\n    return INT64FOLD((uint64_t)(int64_t)fleft->i);\n  else\n    return INT64FOLD((uint64_t)(int64_t)(uint32_t)fleft->i);\n}\n\nLJFOLD(CONV KINT64 IRCONV_NUM_I64)\nLJFOLDF(kfold_conv_kint64_num_i64)\n{\n  return lj_ir_knum(J, (lua_Number)(int64_t)ir_kint64(fleft)->u64);\n}\n\nLJFOLD(CONV KINT64 IRCONV_NUM_U64)\nLJFOLDF(kfold_conv_kint64_num_u64)\n{\n  return lj_ir_knum(J, (lua_Number)ir_kint64(fleft)->u64);\n}\n\nLJFOLD(CONV KINT64 IRCONV_INT_I64)\nLJFOLD(CONV KINT64 IRCONV_U32_I64)\nLJFOLDF(kfold_conv_kint64_int_i64)\n{\n  return INTFOLD((int32_t)ir_kint64(fleft)->u64);\n}\n\nLJFOLD(CONV KNUM IRCONV_INT_NUM)\nLJFOLDF(kfold_conv_knum_int_num)\n{\n  lua_Number n = knumleft;\n  if (!(fins->op2 & IRCONV_TRUNC)) {\n    int32_t k = lj_num2int(n);\n    if (irt_isguard(fins->t) && n != (lua_Number)k) {\n      /* We're about to create a guard which always fails, like CONV +1.5.\n      ** Some pathological loops cause this during LICM, e.g.:\n      **   local x,k,t = 0,1.5,{1,[1.5]=2}\n      **   for i=1,200 do x = x+ t[k]; k = k == 1 and 1.5 or 1 end\n      **   assert(x == 300)\n      */\n      return FAILFOLD;\n    }\n    return INTFOLD(k);\n  } else {\n    return INTFOLD((int32_t)n);\n  }\n}\n\nLJFOLD(CONV KNUM IRCONV_U32_NUM)\nLJFOLDF(kfold_conv_knum_u32_num)\n{\n  lua_assert((fins->op2 & IRCONV_TRUNC));\n#ifdef _MSC_VER\n  {  /* Workaround for MSVC bug. */\n    volatile uint32_t u = (uint32_t)knumleft;\n    return INTFOLD((int32_t)u);\n  }\n#else\n  return INTFOLD((int32_t)(uint32_t)knumleft);\n#endif\n}\n\nLJFOLD(CONV KNUM IRCONV_I64_NUM)\nLJFOLDF(kfold_conv_knum_i64_num)\n{\n  lua_assert((fins->op2 & IRCONV_TRUNC));\n  return INT64FOLD((uint64_t)(int64_t)knumleft);\n}\n\nLJFOLD(CONV KNUM IRCONV_U64_NUM)\nLJFOLDF(kfold_conv_knum_u64_num)\n{\n  lua_assert((fins->op2 & IRCONV_TRUNC));\n  return INT64FOLD(lj_num2u64(knumleft));\n}\n\nLJFOLD(TOSTR KNUM)\nLJFOLDF(kfold_tostr_knum)\n{\n  return lj_ir_kstr(J, lj_str_fromnum(J->L, &knumleft));\n}\n\nLJFOLD(TOSTR KINT)\nLJFOLDF(kfold_tostr_kint)\n{\n  return lj_ir_kstr(J, lj_str_fromint(J->L, fleft->i));\n}\n\nLJFOLD(STRTO KGC)\nLJFOLDF(kfold_strto)\n{\n  TValue n;\n  if (lj_strscan_num(ir_kstr(fleft), &n))\n    return lj_ir_knum(J, numV(&n));\n  return FAILFOLD;\n}\n\n/* -- Constant folding of equality checks --------------------------------- */\n\n/* Don't constant-fold away FLOAD checks against KNULL. */\nLJFOLD(EQ FLOAD KNULL)\nLJFOLD(NE FLOAD KNULL)\nLJFOLDX(lj_opt_cse)\n\n/* But fold all other KNULL compares, since only KNULL is equal to KNULL. */\nLJFOLD(EQ any KNULL)\nLJFOLD(NE any KNULL)\nLJFOLD(EQ KNULL any)\nLJFOLD(NE KNULL any)\nLJFOLD(EQ KINT KINT)  /* Constants are unique, so same refs <==> same value. */\nLJFOLD(NE KINT KINT)\nLJFOLD(EQ KINT64 KINT64)\nLJFOLD(NE KINT64 KINT64)\nLJFOLD(EQ KGC KGC)\nLJFOLD(NE KGC KGC)\nLJFOLDF(kfold_kref)\n{\n  return CONDFOLD((fins->op1 == fins->op2) ^ (fins->o == IR_NE));\n}\n\n/* -- Algebraic shortcuts ------------------------------------------------- */\n\nLJFOLD(FPMATH FPMATH IRFPM_FLOOR)\nLJFOLD(FPMATH FPMATH IRFPM_CEIL)\nLJFOLD(FPMATH FPMATH IRFPM_TRUNC)\nLJFOLDF(shortcut_round)\n{\n  IRFPMathOp op = (IRFPMathOp)fleft->op2;\n  if (op == IRFPM_FLOOR || op == IRFPM_CEIL || op == IRFPM_TRUNC)\n    return LEFTFOLD;  /* round(round_left(x)) = round_left(x) */\n  return NEXTFOLD;\n}\n\nLJFOLD(ABS ABS KNUM)\nLJFOLDF(shortcut_left)\n{\n  return LEFTFOLD;  /* f(g(x)) ==> g(x) */\n}\n\nLJFOLD(ABS NEG KNUM)\nLJFOLDF(shortcut_dropleft)\n{\n  PHIBARRIER(fleft);\n  fins->op1 = fleft->op1;  /* abs(neg(x)) ==> abs(x) */\n  return RETRYFOLD;\n}\n\n/* Note: no safe shortcuts with STRTO and TOSTR (\"1e2\" ==> +100 ==> \"100\"). */\nLJFOLD(NEG NEG any)\nLJFOLD(BNOT BNOT)\nLJFOLD(BSWAP BSWAP)\nLJFOLDF(shortcut_leftleft)\n{\n  PHIBARRIER(fleft);  /* See above. Fold would be ok, but not beneficial. */\n  return fleft->op1;  /* f(g(x)) ==> x */\n}\n\n/* -- FP algebraic simplifications ---------------------------------------- */\n\n/* FP arithmetic is tricky -- there's not much to simplify.\n** Please note the following common pitfalls before sending \"improvements\":\n**   x+0 ==> x  is INVALID for x=-0\n**   0-x ==> -x is INVALID for x=+0\n**   x*0 ==> 0  is INVALID for x=-0, x=+-Inf or x=NaN\n*/\n\nLJFOLD(ADD NEG any)\nLJFOLDF(simplify_numadd_negx)\n{\n  PHIBARRIER(fleft);\n  fins->o = IR_SUB;  /* (-a) + b ==> b - a */\n  fins->op1 = fins->op2;\n  fins->op2 = fleft->op1;\n  return RETRYFOLD;\n}\n\nLJFOLD(ADD any NEG)\nLJFOLDF(simplify_numadd_xneg)\n{\n  PHIBARRIER(fright);\n  fins->o = IR_SUB;  /* a + (-b) ==> a - b */\n  fins->op2 = fright->op1;\n  return RETRYFOLD;\n}\n\nLJFOLD(SUB any KNUM)\nLJFOLDF(simplify_numsub_k)\n{\n  lua_Number n = knumright;\n  if (n == 0.0)  /* x - (+-0) ==> x */\n    return LEFTFOLD;\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB NEG KNUM)\nLJFOLDF(simplify_numsub_negk)\n{\n  PHIBARRIER(fleft);\n  fins->op2 = fleft->op1;  /* (-x) - k ==> (-k) - x */\n  fins->op1 = (IRRef1)lj_ir_knum(J, -knumright);\n  return RETRYFOLD;\n}\n\nLJFOLD(SUB any NEG)\nLJFOLDF(simplify_numsub_xneg)\n{\n  PHIBARRIER(fright);\n  fins->o = IR_ADD;  /* a - (-b) ==> a + b */\n  fins->op2 = fright->op1;\n  return RETRYFOLD;\n}\n\nLJFOLD(MUL any KNUM)\nLJFOLD(DIV any KNUM)\nLJFOLDF(simplify_nummuldiv_k)\n{\n  lua_Number n = knumright;\n  if (n == 1.0) {  /* x o 1 ==> x */\n    return LEFTFOLD;\n  } else if (n == -1.0) {  /* x o -1 ==> -x */\n    fins->o = IR_NEG;\n    fins->op2 = (IRRef1)lj_ir_knum_neg(J);\n    return RETRYFOLD;\n  } else if (fins->o == IR_MUL && n == 2.0) {  /* x * 2 ==> x + x */\n    fins->o = IR_ADD;\n    fins->op2 = fins->op1;\n    return RETRYFOLD;\n  } else if (fins->o == IR_DIV) {  /* x / 2^k ==> x * 2^-k */\n    uint64_t u = ir_knum(fright)->u64;\n    uint32_t ex = ((uint32_t)(u >> 52) & 0x7ff);\n    if ((u & U64x(000fffff,ffffffff)) == 0 && ex - 1 < 0x7fd) {\n      u = (u & ((uint64_t)1 << 63)) | ((uint64_t)(0x7fe - ex) << 52);\n      fins->o = IR_MUL;  /* Multiply by exact reciprocal. */\n      fins->op2 = lj_ir_knum_u64(J, u);\n      return RETRYFOLD;\n    }\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(MUL NEG KNUM)\nLJFOLD(DIV NEG KNUM)\nLJFOLDF(simplify_nummuldiv_negk)\n{\n  PHIBARRIER(fleft);\n  fins->op1 = fleft->op1;  /* (-a) o k ==> a o (-k) */\n  fins->op2 = (IRRef1)lj_ir_knum(J, -knumright);\n  return RETRYFOLD;\n}\n\nLJFOLD(MUL NEG NEG)\nLJFOLD(DIV NEG NEG)\nLJFOLDF(simplify_nummuldiv_negneg)\n{\n  PHIBARRIER(fleft);\n  PHIBARRIER(fright);\n  fins->op1 = fleft->op1;  /* (-a) o (-b) ==> a o b */\n  fins->op2 = fright->op1;\n  return RETRYFOLD;\n}\n\nLJFOLD(POW any KINT)\nLJFOLDF(simplify_numpow_xk)\n{\n  int32_t k = fright->i;\n  TRef ref = fins->op1;\n  if (k == 0)  /* x ^ 0 ==> 1 */\n    return lj_ir_knum_one(J);  /* Result must be a number, not an int. */\n  if (k == 1)  /* x ^ 1 ==> x */\n    return LEFTFOLD;\n  if ((uint32_t)(k+65536) > 2*65536u)  /* Limit code explosion. */\n    return NEXTFOLD;\n  if (k < 0) {  /* x ^ (-k) ==> (1/x) ^ k. */\n    ref = emitir(IRTN(IR_DIV), lj_ir_knum_one(J), ref);\n    k = -k;\n  }\n  /* Unroll x^k for 1 <= k <= 65536. */\n  for (; (k & 1) == 0; k >>= 1)  /* Handle leading zeros. */\n    ref = emitir(IRTN(IR_MUL), ref, ref);\n  if ((k >>= 1) != 0) {  /* Handle trailing bits. */\n    TRef tmp = emitir(IRTN(IR_MUL), ref, ref);\n    for (; k != 1; k >>= 1) {\n      if (k & 1)\n\tref = emitir(IRTN(IR_MUL), ref, tmp);\n      tmp = emitir(IRTN(IR_MUL), tmp, tmp);\n    }\n    ref = emitir(IRTN(IR_MUL), ref, tmp);\n  }\n  return ref;\n}\n\nLJFOLD(POW KNUM any)\nLJFOLDF(simplify_numpow_kx)\n{\n  lua_Number n = knumleft;\n  if (n == 2.0) {  /* 2.0 ^ i ==> ldexp(1.0, tonum(i)) */\n    fins->o = IR_CONV;\n#if LJ_TARGET_X86ORX64\n    fins->op1 = fins->op2;\n    fins->op2 = IRCONV_NUM_INT;\n    fins->op2 = (IRRef1)lj_opt_fold(J);\n#endif\n    fins->op1 = (IRRef1)lj_ir_knum_one(J);\n    fins->o = IR_LDEXP;\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\n/* -- Simplify conversions ------------------------------------------------ */\n\nLJFOLD(CONV CONV IRCONV_NUM_INT)  /* _NUM */\nLJFOLDF(shortcut_conv_num_int)\n{\n  PHIBARRIER(fleft);\n  /* Only safe with a guarded conversion to int. */\n  if ((fleft->op2 & IRCONV_SRCMASK) == IRT_NUM && irt_isguard(fleft->t))\n    return fleft->op1;  /* f(g(x)) ==> x */\n  return NEXTFOLD;\n}\n\nLJFOLD(CONV CONV IRCONV_INT_NUM)  /* _INT */\nLJFOLD(CONV CONV IRCONV_U32_NUM)  /* _U32*/\nLJFOLDF(simplify_conv_int_num)\n{\n  /* Fold even across PHI to avoid expensive num->int conversions in loop. */\n  if ((fleft->op2 & IRCONV_SRCMASK) ==\n      ((fins->op2 & IRCONV_DSTMASK) >> IRCONV_DSH))\n    return fleft->op1;\n  return NEXTFOLD;\n}\n\nLJFOLD(CONV CONV IRCONV_I64_NUM)  /* _INT or _U32 */\nLJFOLD(CONV CONV IRCONV_U64_NUM)  /* _INT or _U32 */\nLJFOLDF(simplify_conv_i64_num)\n{\n  PHIBARRIER(fleft);\n  if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT) {\n    /* Reduce to a sign-extension. */\n    fins->op1 = fleft->op1;\n    fins->op2 = ((IRT_I64<<5)|IRT_INT|IRCONV_SEXT);\n    return RETRYFOLD;\n  } else if ((fleft->op2 & IRCONV_SRCMASK) == IRT_U32) {\n#if LJ_TARGET_X64\n    return fleft->op1;\n#else\n    /* Reduce to a zero-extension. */\n    fins->op1 = fleft->op1;\n    fins->op2 = (IRT_I64<<5)|IRT_U32;\n    return RETRYFOLD;\n#endif\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(CONV CONV IRCONV_INT_I64)  /* _INT or _U32 */\nLJFOLD(CONV CONV IRCONV_INT_U64)  /* _INT or _U32 */\nLJFOLD(CONV CONV IRCONV_U32_I64)  /* _INT or _U32 */\nLJFOLD(CONV CONV IRCONV_U32_U64)  /* _INT or _U32 */\nLJFOLDF(simplify_conv_int_i64)\n{\n  int src;\n  PHIBARRIER(fleft);\n  src = (fleft->op2 & IRCONV_SRCMASK);\n  if (src == IRT_INT || src == IRT_U32) {\n    if (src == ((fins->op2 & IRCONV_DSTMASK) >> IRCONV_DSH)) {\n      return fleft->op1;\n    } else {\n      fins->op2 = ((fins->op2 & IRCONV_DSTMASK) | src);\n      fins->op1 = fleft->op1;\n      return RETRYFOLD;\n    }\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(CONV CONV IRCONV_FLOAT_NUM)  /* _FLOAT */\nLJFOLDF(simplify_conv_flt_num)\n{\n  PHIBARRIER(fleft);\n  if ((fleft->op2 & IRCONV_SRCMASK) == IRT_FLOAT)\n    return fleft->op1;\n  return NEXTFOLD;\n}\n\n/* Shortcut TOBIT + IRT_NUM <- IRT_INT/IRT_U32 conversion. */\nLJFOLD(TOBIT CONV KNUM)\nLJFOLDF(simplify_tobit_conv)\n{\n  if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT ||\n      (fleft->op2 & IRCONV_SRCMASK) == IRT_U32) {\n    /* Fold even across PHI to avoid expensive num->int conversions in loop. */\n    lua_assert(irt_isnum(fleft->t));\n    return fleft->op1;\n  }\n  return NEXTFOLD;\n}\n\n/* Shortcut floor/ceil/round + IRT_NUM <- IRT_INT/IRT_U32 conversion. */\nLJFOLD(FPMATH CONV IRFPM_FLOOR)\nLJFOLD(FPMATH CONV IRFPM_CEIL)\nLJFOLD(FPMATH CONV IRFPM_TRUNC)\nLJFOLDF(simplify_floor_conv)\n{\n  if ((fleft->op2 & IRCONV_SRCMASK) == IRT_INT ||\n      (fleft->op2 & IRCONV_SRCMASK) == IRT_U32)\n    return LEFTFOLD;\n  return NEXTFOLD;\n}\n\n/* Strength reduction of widening. */\nLJFOLD(CONV any IRCONV_I64_INT)\nLJFOLD(CONV any IRCONV_U64_INT)\nLJFOLDF(simplify_conv_sext)\n{\n  IRRef ref = fins->op1;\n  int64_t ofs = 0;\n  if (!(fins->op2 & IRCONV_SEXT))\n    return NEXTFOLD;\n  PHIBARRIER(fleft);\n  if (fleft->o == IR_XLOAD && (irt_isu8(fleft->t) || irt_isu16(fleft->t)))\n    goto ok_reduce;\n  if (fleft->o == IR_ADD && irref_isk(fleft->op2)) {\n    ofs = (int64_t)IR(fleft->op2)->i;\n    ref = fleft->op1;\n  }\n  /* Use scalar evolution analysis results to strength-reduce sign-extension. */\n  if (ref == J->scev.idx) {\n    IRRef lo = J->scev.dir ? J->scev.start : J->scev.stop;\n    lua_assert(irt_isint(J->scev.t));\n    if (lo && IR(lo)->i + ofs >= 0) {\n    ok_reduce:\n#if LJ_TARGET_X64\n      /* Eliminate widening. All 32 bit ops do an implicit zero-extension. */\n      return LEFTFOLD;\n#else\n      /* Reduce to a (cheaper) zero-extension. */\n      fins->op2 &= ~IRCONV_SEXT;\n      return RETRYFOLD;\n#endif\n    }\n  }\n  return NEXTFOLD;\n}\n\n/* Strength reduction of narrowing. */\nLJFOLD(CONV ADD IRCONV_INT_I64)\nLJFOLD(CONV SUB IRCONV_INT_I64)\nLJFOLD(CONV MUL IRCONV_INT_I64)\nLJFOLD(CONV ADD IRCONV_INT_U64)\nLJFOLD(CONV SUB IRCONV_INT_U64)\nLJFOLD(CONV MUL IRCONV_INT_U64)\nLJFOLD(CONV ADD IRCONV_U32_I64)\nLJFOLD(CONV SUB IRCONV_U32_I64)\nLJFOLD(CONV MUL IRCONV_U32_I64)\nLJFOLD(CONV ADD IRCONV_U32_U64)\nLJFOLD(CONV SUB IRCONV_U32_U64)\nLJFOLD(CONV MUL IRCONV_U32_U64)\nLJFOLDF(simplify_conv_narrow)\n{\n  IROp op = (IROp)fleft->o;\n  IRType t = irt_type(fins->t);\n  IRRef op1 = fleft->op1, op2 = fleft->op2, mode = fins->op2;\n  PHIBARRIER(fleft);\n  op1 = emitir(IRTI(IR_CONV), op1, mode);\n  op2 = emitir(IRTI(IR_CONV), op2, mode);\n  fins->ot = IRT(op, t);\n  fins->op1 = op1;\n  fins->op2 = op2;\n  return RETRYFOLD;\n}\n\n/* Special CSE rule for CONV. */\nLJFOLD(CONV any any)\nLJFOLDF(cse_conv)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) {\n    IRRef op1 = fins->op1, op2 = (fins->op2 & IRCONV_MODEMASK);\n    uint8_t guard = irt_isguard(fins->t);\n    IRRef ref = J->chain[IR_CONV];\n    while (ref > op1) {\n      IRIns *ir = IR(ref);\n      /* Commoning with stronger checks is ok. */\n      if (ir->op1 == op1 && (ir->op2 & IRCONV_MODEMASK) == op2 &&\n\t  irt_isguard(ir->t) >= guard)\n\treturn ref;\n      ref = ir->prev;\n    }\n  }\n  return EMITFOLD;  /* No fallthrough to regular CSE. */\n}\n\n/* FP conversion narrowing. */\nLJFOLD(TOBIT ADD KNUM)\nLJFOLD(TOBIT SUB KNUM)\nLJFOLD(CONV ADD IRCONV_INT_NUM)\nLJFOLD(CONV SUB IRCONV_INT_NUM)\nLJFOLD(CONV ADD IRCONV_I64_NUM)\nLJFOLD(CONV SUB IRCONV_I64_NUM)\nLJFOLDF(narrow_convert)\n{\n  PHIBARRIER(fleft);\n  /* Narrowing ignores PHIs and repeating it inside the loop is not useful. */\n  if (J->chain[IR_LOOP])\n    return NEXTFOLD;\n  lua_assert(fins->o != IR_CONV || (fins->op2&IRCONV_CONVMASK) != IRCONV_TOBIT);\n  return lj_opt_narrow_convert(J);\n}\n\n/* -- Integer algebraic simplifications ----------------------------------- */\n\nLJFOLD(ADD any KINT)\nLJFOLD(ADDOV any KINT)\nLJFOLD(SUBOV any KINT)\nLJFOLDF(simplify_intadd_k)\n{\n  if (fright->i == 0)  /* i o 0 ==> i */\n    return LEFTFOLD;\n  return NEXTFOLD;\n}\n\nLJFOLD(MULOV any KINT)\nLJFOLDF(simplify_intmul_k)\n{\n  if (fright->i == 0)  /* i * 0 ==> 0 */\n    return RIGHTFOLD;\n  if (fright->i == 1)  /* i * 1 ==> i */\n    return LEFTFOLD;\n  if (fright->i == 2) {  /* i * 2 ==> i + i */\n    fins->o = IR_ADDOV;\n    fins->op2 = fins->op1;\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB any KINT)\nLJFOLDF(simplify_intsub_k)\n{\n  if (fright->i == 0)  /* i - 0 ==> i */\n    return LEFTFOLD;\n  fins->o = IR_ADD;  /* i - k ==> i + (-k) */\n  fins->op2 = (IRRef1)lj_ir_kint(J, -fright->i);  /* Overflow for -2^31 ok. */\n  return RETRYFOLD;\n}\n\nLJFOLD(SUB KINT any)\nLJFOLD(SUB KINT64 any)\nLJFOLDF(simplify_intsub_kleft)\n{\n  if (fleft->o == IR_KINT ? (fleft->i == 0) : (ir_kint64(fleft)->u64 == 0)) {\n    fins->o = IR_NEG;  /* 0 - i ==> -i */\n    fins->op1 = fins->op2;\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(ADD any KINT64)\nLJFOLDF(simplify_intadd_k64)\n{\n  if (ir_kint64(fright)->u64 == 0)  /* i + 0 ==> i */\n    return LEFTFOLD;\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB any KINT64)\nLJFOLDF(simplify_intsub_k64)\n{\n  uint64_t k = ir_kint64(fright)->u64;\n  if (k == 0)  /* i - 0 ==> i */\n    return LEFTFOLD;\n  fins->o = IR_ADD;  /* i - k ==> i + (-k) */\n  fins->op2 = (IRRef1)lj_ir_kint64(J, (uint64_t)-(int64_t)k);\n  return RETRYFOLD;\n}\n\nstatic TRef simplify_intmul_k(jit_State *J, int32_t k)\n{\n  /* Note: many more simplifications are possible, e.g. 2^k1 +- 2^k2.\n  ** But this is mainly intended for simple address arithmetic.\n  ** Also it's easier for the backend to optimize the original multiplies.\n  */\n  if (k == 1) {  /* i * 1 ==> i */\n    return LEFTFOLD;\n  } else if ((k & (k-1)) == 0) {  /* i * 2^k ==> i << k */\n    fins->o = IR_BSHL;\n    fins->op2 = lj_ir_kint(J, lj_fls((uint32_t)k));\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(MUL any KINT)\nLJFOLDF(simplify_intmul_k32)\n{\n  if (fright->i == 0)  /* i * 0 ==> 0 */\n    return INTFOLD(0);\n  else if (fright->i > 0)\n    return simplify_intmul_k(J, fright->i);\n  return NEXTFOLD;\n}\n\nLJFOLD(MUL any KINT64)\nLJFOLDF(simplify_intmul_k64)\n{\n  if (ir_kint64(fright)->u64 == 0)  /* i * 0 ==> 0 */\n    return INT64FOLD(0);\n#if LJ_64\n  /* NYI: SPLIT for BSHL and 32 bit backend support. */\n  else if (ir_kint64(fright)->u64 < 0x80000000u)\n    return simplify_intmul_k(J, (int32_t)ir_kint64(fright)->u64);\n#endif\n  return NEXTFOLD;\n}\n\nLJFOLD(MOD any KINT)\nLJFOLDF(simplify_intmod_k)\n{\n  int32_t k = fright->i;\n  lua_assert(k != 0);\n  if (k > 0 && (k & (k-1)) == 0) {  /* i % (2^k) ==> i & (2^k-1) */\n    fins->o = IR_BAND;\n    fins->op2 = lj_ir_kint(J, k-1);\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(MOD KINT any)\nLJFOLDF(simplify_intmod_kleft)\n{\n  if (fleft->i == 0)\n    return INTFOLD(0);\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB any any)\nLJFOLD(SUBOV any any)\nLJFOLDF(simplify_intsub)\n{\n  if (fins->op1 == fins->op2 && !irt_isnum(fins->t))  /* i - i ==> 0 */\n    return irt_is64(fins->t) ? INT64FOLD(0) : INTFOLD(0);\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB ADD any)\nLJFOLDF(simplify_intsubadd_leftcancel)\n{\n  if (!irt_isnum(fins->t)) {\n    PHIBARRIER(fleft);\n    if (fins->op2 == fleft->op1)  /* (i + j) - i ==> j */\n      return fleft->op2;\n    if (fins->op2 == fleft->op2)  /* (i + j) - j ==> i */\n      return fleft->op1;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB SUB any)\nLJFOLDF(simplify_intsubsub_leftcancel)\n{\n  if (!irt_isnum(fins->t)) {\n    PHIBARRIER(fleft);\n    if (fins->op2 == fleft->op1) {  /* (i - j) - i ==> 0 - j */\n      fins->op1 = (IRRef1)lj_ir_kint(J, 0);\n      fins->op2 = fleft->op2;\n      return RETRYFOLD;\n    }\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB any SUB)\nLJFOLDF(simplify_intsubsub_rightcancel)\n{\n  if (!irt_isnum(fins->t)) {\n    PHIBARRIER(fright);\n    if (fins->op1 == fright->op1)  /* i - (i - j) ==> j */\n      return fright->op2;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB any ADD)\nLJFOLDF(simplify_intsubadd_rightcancel)\n{\n  if (!irt_isnum(fins->t)) {\n    PHIBARRIER(fright);\n    if (fins->op1 == fright->op1) {  /* i - (i + j) ==> 0 - j */\n      fins->op2 = fright->op2;\n      fins->op1 = (IRRef1)lj_ir_kint(J, 0);\n      return RETRYFOLD;\n    }\n    if (fins->op1 == fright->op2) {  /* i - (j + i) ==> 0 - j */\n      fins->op2 = fright->op1;\n      fins->op1 = (IRRef1)lj_ir_kint(J, 0);\n      return RETRYFOLD;\n    }\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(SUB ADD ADD)\nLJFOLDF(simplify_intsubaddadd_cancel)\n{\n  if (!irt_isnum(fins->t)) {\n    PHIBARRIER(fleft);\n    PHIBARRIER(fright);\n    if (fleft->op1 == fright->op1) {  /* (i + j1) - (i + j2) ==> j1 - j2 */\n      fins->op1 = fleft->op2;\n      fins->op2 = fright->op2;\n      return RETRYFOLD;\n    }\n    if (fleft->op1 == fright->op2) {  /* (i + j1) - (j2 + i) ==> j1 - j2 */\n      fins->op1 = fleft->op2;\n      fins->op2 = fright->op1;\n      return RETRYFOLD;\n    }\n    if (fleft->op2 == fright->op1) {  /* (j1 + i) - (i + j2) ==> j1 - j2 */\n      fins->op1 = fleft->op1;\n      fins->op2 = fright->op2;\n      return RETRYFOLD;\n    }\n    if (fleft->op2 == fright->op2) {  /* (j1 + i) - (j2 + i) ==> j1 - j2 */\n      fins->op1 = fleft->op1;\n      fins->op2 = fright->op1;\n      return RETRYFOLD;\n    }\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(BAND any KINT)\nLJFOLD(BAND any KINT64)\nLJFOLDF(simplify_band_k)\n{\n  int64_t k = fright->o == IR_KINT ? (int64_t)fright->i :\n\t\t\t\t     (int64_t)ir_k64(fright)->u64;\n  if (k == 0)  /* i & 0 ==> 0 */\n    return RIGHTFOLD;\n  if (k == -1)  /* i & -1 ==> i */\n    return LEFTFOLD;\n  return NEXTFOLD;\n}\n\nLJFOLD(BOR any KINT)\nLJFOLD(BOR any KINT64)\nLJFOLDF(simplify_bor_k)\n{\n  int64_t k = fright->o == IR_KINT ? (int64_t)fright->i :\n\t\t\t\t     (int64_t)ir_k64(fright)->u64;\n  if (k == 0)  /* i | 0 ==> i */\n    return LEFTFOLD;\n  if (k == -1)  /* i | -1 ==> -1 */\n    return RIGHTFOLD;\n  return NEXTFOLD;\n}\n\nLJFOLD(BXOR any KINT)\nLJFOLD(BXOR any KINT64)\nLJFOLDF(simplify_bxor_k)\n{\n  int64_t k = fright->o == IR_KINT ? (int64_t)fright->i :\n\t\t\t\t     (int64_t)ir_k64(fright)->u64;\n  if (k == 0)  /* i xor 0 ==> i */\n    return LEFTFOLD;\n  if (k == -1) {  /* i xor -1 ==> ~i */\n    fins->o = IR_BNOT;\n    fins->op2 = 0;\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(BSHL any KINT)\nLJFOLD(BSHR any KINT)\nLJFOLD(BSAR any KINT)\nLJFOLD(BROL any KINT)\nLJFOLD(BROR any KINT)\nLJFOLDF(simplify_shift_ik)\n{\n  int32_t mask = irt_is64(fins->t) ? 63 : 31;\n  int32_t k = (fright->i & mask);\n  if (k == 0)  /* i o 0 ==> i */\n    return LEFTFOLD;\n  if (k == 1 && fins->o == IR_BSHL) {  /* i << 1 ==> i + i */\n    fins->o = IR_ADD;\n    fins->op2 = fins->op1;\n    return RETRYFOLD;\n  }\n  if (k != fright->i) {  /* i o k ==> i o (k & mask) */\n    fins->op2 = (IRRef1)lj_ir_kint(J, k);\n    return RETRYFOLD;\n  }\n#ifndef LJ_TARGET_UNIFYROT\n  if (fins->o == IR_BROR) {  /* bror(i, k) ==> brol(i, (-k)&mask) */\n    fins->o = IR_BROL;\n    fins->op2 = (IRRef1)lj_ir_kint(J, (-k)&mask);\n    return RETRYFOLD;\n  }\n#endif\n  return NEXTFOLD;\n}\n\nLJFOLD(BSHL any BAND)\nLJFOLD(BSHR any BAND)\nLJFOLD(BSAR any BAND)\nLJFOLD(BROL any BAND)\nLJFOLD(BROR any BAND)\nLJFOLDF(simplify_shift_andk)\n{\n  IRIns *irk = IR(fright->op2);\n  PHIBARRIER(fright);\n  if ((fins->o < IR_BROL ? LJ_TARGET_MASKSHIFT : LJ_TARGET_MASKROT) &&\n      irk->o == IR_KINT) {  /* i o (j & mask) ==> i o j */\n    int32_t mask = irt_is64(fins->t) ? 63 : 31;\n    int32_t k = irk->i & mask;\n    if (k == mask) {\n      fins->op2 = fright->op1;\n      return RETRYFOLD;\n    }\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(BSHL KINT any)\nLJFOLD(BSHR KINT any)\nLJFOLD(BSHL KINT64 any)\nLJFOLD(BSHR KINT64 any)\nLJFOLDF(simplify_shift1_ki)\n{\n  int64_t k = fleft->o == IR_KINT ? (int64_t)fleft->i :\n\t\t\t\t    (int64_t)ir_k64(fleft)->u64;\n  if (k == 0)  /* 0 o i ==> 0 */\n    return LEFTFOLD;\n  return NEXTFOLD;\n}\n\nLJFOLD(BSAR KINT any)\nLJFOLD(BROL KINT any)\nLJFOLD(BROR KINT any)\nLJFOLD(BSAR KINT64 any)\nLJFOLD(BROL KINT64 any)\nLJFOLD(BROR KINT64 any)\nLJFOLDF(simplify_shift2_ki)\n{\n  int64_t k = fleft->o == IR_KINT ? (int64_t)fleft->i :\n\t\t\t\t    (int64_t)ir_k64(fleft)->u64;\n  if (k == 0 || k == -1)  /* 0 o i ==> 0; -1 o i ==> -1 */\n    return LEFTFOLD;\n  return NEXTFOLD;\n}\n\nLJFOLD(BSHL BAND KINT)\nLJFOLD(BSHR BAND KINT)\nLJFOLD(BROL BAND KINT)\nLJFOLD(BROR BAND KINT)\nLJFOLDF(simplify_shiftk_andk)\n{\n  IRIns *irk = IR(fleft->op2);\n  PHIBARRIER(fleft);\n  if (irk->o == IR_KINT) {  /* (i & k1) o k2 ==> (i o k2) & (k1 o k2) */\n    int32_t k = kfold_intop(irk->i, fright->i, (IROp)fins->o);\n    fins->op1 = fleft->op1;\n    fins->op1 = (IRRef1)lj_opt_fold(J);\n    fins->op2 = (IRRef1)lj_ir_kint(J, k);\n    fins->ot = IRTI(IR_BAND);\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(BAND BSHL KINT)\nLJFOLD(BAND BSHR KINT)\nLJFOLDF(simplify_andk_shiftk)\n{\n  IRIns *irk = IR(fleft->op2);\n  if (irk->o == IR_KINT &&\n      kfold_intop(-1, irk->i, (IROp)fleft->o) == fright->i)\n    return LEFTFOLD;  /* (i o k1) & k2 ==> i, if (-1 o k1) == k2 */\n  return NEXTFOLD;\n}\n\n/* -- Reassociation ------------------------------------------------------- */\n\nLJFOLD(ADD ADD KINT)\nLJFOLD(MUL MUL KINT)\nLJFOLD(BAND BAND KINT)\nLJFOLD(BOR BOR KINT)\nLJFOLD(BXOR BXOR KINT)\nLJFOLDF(reassoc_intarith_k)\n{\n  IRIns *irk = IR(fleft->op2);\n  if (irk->o == IR_KINT) {\n    int32_t k = kfold_intop(irk->i, fright->i, (IROp)fins->o);\n    if (k == irk->i)  /* (i o k1) o k2 ==> i o k1, if (k1 o k2) == k1. */\n      return LEFTFOLD;\n    PHIBARRIER(fleft);\n    fins->op1 = fleft->op1;\n    fins->op2 = (IRRef1)lj_ir_kint(J, k);\n    return RETRYFOLD;  /* (i o k1) o k2 ==> i o (k1 o k2) */\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(ADD ADD KINT64)\nLJFOLD(MUL MUL KINT64)\nLJFOLD(BAND BAND KINT64)\nLJFOLD(BOR BOR KINT64)\nLJFOLD(BXOR BXOR KINT64)\nLJFOLDF(reassoc_intarith_k64)\n{\n#if LJ_HASFFI || LJ_64\n  IRIns *irk = IR(fleft->op2);\n  if (irk->o == IR_KINT64) {\n    uint64_t k = kfold_int64arith(ir_k64(irk)->u64,\n\t\t\t\t  ir_k64(fright)->u64, (IROp)fins->o);\n    PHIBARRIER(fleft);\n    fins->op1 = fleft->op1;\n    fins->op2 = (IRRef1)lj_ir_kint64(J, k);\n    return RETRYFOLD;  /* (i o k1) o k2 ==> i o (k1 o k2) */\n  }\n  return NEXTFOLD;\n#else\n  UNUSED(J); lua_assert(0); return FAILFOLD;\n#endif\n}\n\nLJFOLD(MIN MIN any)\nLJFOLD(MAX MAX any)\nLJFOLD(BAND BAND any)\nLJFOLD(BOR BOR any)\nLJFOLDF(reassoc_dup)\n{\n  if (fins->op2 == fleft->op1 || fins->op2 == fleft->op2)\n    return LEFTFOLD;  /* (a o b) o a ==> a o b; (a o b) o b ==> a o b */\n  return NEXTFOLD;\n}\n\nLJFOLD(BXOR BXOR any)\nLJFOLDF(reassoc_bxor)\n{\n  PHIBARRIER(fleft);\n  if (fins->op2 == fleft->op1)  /* (a xor b) xor a ==> b */\n    return fleft->op2;\n  if (fins->op2 == fleft->op2)  /* (a xor b) xor b ==> a */\n    return fleft->op1;\n  return NEXTFOLD;\n}\n\nLJFOLD(BSHL BSHL KINT)\nLJFOLD(BSHR BSHR KINT)\nLJFOLD(BSAR BSAR KINT)\nLJFOLD(BROL BROL KINT)\nLJFOLD(BROR BROR KINT)\nLJFOLDF(reassoc_shift)\n{\n  IRIns *irk = IR(fleft->op2);\n  PHIBARRIER(fleft);  /* The (shift any KINT) rule covers k2 == 0 and more. */\n  if (irk->o == IR_KINT) {  /* (i o k1) o k2 ==> i o (k1 + k2) */\n    int32_t mask = irt_is64(fins->t) ? 63 : 31;\n    int32_t k = (irk->i & mask) + (fright->i & mask);\n    if (k > mask) {  /* Combined shift too wide? */\n      if (fins->o == IR_BSHL || fins->o == IR_BSHR)\n\treturn mask == 31 ? INTFOLD(0) : INT64FOLD(0);\n      else if (fins->o == IR_BSAR)\n\tk = mask;\n      else\n\tk &= mask;\n    }\n    fins->op1 = fleft->op1;\n    fins->op2 = (IRRef1)lj_ir_kint(J, k);\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(MIN MIN KNUM)\nLJFOLD(MAX MAX KNUM)\nLJFOLD(MIN MIN KINT)\nLJFOLD(MAX MAX KINT)\nLJFOLDF(reassoc_minmax_k)\n{\n  IRIns *irk = IR(fleft->op2);\n  if (irk->o == IR_KNUM) {\n    lua_Number a = ir_knum(irk)->n;\n    lua_Number y = lj_vm_foldarith(a, knumright, fins->o - IR_ADD);\n    if (a == y)  /* (x o k1) o k2 ==> x o k1, if (k1 o k2) == k1. */\n      return LEFTFOLD;\n    PHIBARRIER(fleft);\n    fins->op1 = fleft->op1;\n    fins->op2 = (IRRef1)lj_ir_knum(J, y);\n    return RETRYFOLD;  /* (x o k1) o k2 ==> x o (k1 o k2) */\n  } else if (irk->o == IR_KINT) {\n    int32_t a = irk->i;\n    int32_t y = kfold_intop(a, fright->i, fins->o);\n    if (a == y)  /* (x o k1) o k2 ==> x o k1, if (k1 o k2) == k1. */\n      return LEFTFOLD;\n    PHIBARRIER(fleft);\n    fins->op1 = fleft->op1;\n    fins->op2 = (IRRef1)lj_ir_kint(J, y);\n    return RETRYFOLD;  /* (x o k1) o k2 ==> x o (k1 o k2) */\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(MIN MAX any)\nLJFOLD(MAX MIN any)\nLJFOLDF(reassoc_minmax_left)\n{\n  if (fins->op2 == fleft->op1 || fins->op2 == fleft->op2)\n    return RIGHTFOLD;  /* (b o1 a) o2 b ==> b; (a o1 b) o2 b ==> b */\n  return NEXTFOLD;\n}\n\nLJFOLD(MIN any MAX)\nLJFOLD(MAX any MIN)\nLJFOLDF(reassoc_minmax_right)\n{\n  if (fins->op1 == fright->op1 || fins->op1 == fright->op2)\n    return LEFTFOLD;  /* a o2 (a o1 b) ==> a; a o2 (b o1 a) ==> a */\n  return NEXTFOLD;\n}\n\n/* -- Array bounds check elimination -------------------------------------- */\n\n/* Eliminate ABC across PHIs to handle t[i-1] forwarding case.\n** ABC(asize, (i+k)+(-k)) ==> ABC(asize, i), but only if it already exists.\n** Could be generalized to (i+k1)+k2 ==> i+(k1+k2), but needs better disambig.\n*/\nLJFOLD(ABC any ADD)\nLJFOLDF(abc_fwd)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_ABC)) {\n    if (irref_isk(fright->op2)) {\n      IRIns *add2 = IR(fright->op1);\n      if (add2->o == IR_ADD && irref_isk(add2->op2) &&\n\t  IR(fright->op2)->i == -IR(add2->op2)->i) {\n\tIRRef ref = J->chain[IR_ABC];\n\tIRRef lim = add2->op1;\n\tif (fins->op1 > lim) lim = fins->op1;\n\twhile (ref > lim) {\n\t  IRIns *ir = IR(ref);\n\t  if (ir->op1 == fins->op1 && ir->op2 == add2->op1)\n\t    return DROPFOLD;\n\t  ref = ir->prev;\n\t}\n      }\n    }\n  }\n  return NEXTFOLD;\n}\n\n/* Eliminate ABC for constants.\n** ABC(asize, k1), ABC(asize k2) ==> ABC(asize, max(k1, k2))\n** Drop second ABC if k2 is lower. Otherwise patch first ABC with k2.\n*/\nLJFOLD(ABC any KINT)\nLJFOLDF(abc_k)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_ABC)) {\n    IRRef ref = J->chain[IR_ABC];\n    IRRef asize = fins->op1;\n    while (ref > asize) {\n      IRIns *ir = IR(ref);\n      if (ir->op1 == asize && irref_isk(ir->op2)) {\n\tint32_t k = IR(ir->op2)->i;\n\tif (fright->i > k)\n\t  ir->op2 = fins->op2;\n\treturn DROPFOLD;\n      }\n      ref = ir->prev;\n    }\n    return EMITFOLD;  /* Already performed CSE. */\n  }\n  return NEXTFOLD;\n}\n\n/* Eliminate invariant ABC inside loop. */\nLJFOLD(ABC any any)\nLJFOLDF(abc_invar)\n{\n  if (!irt_isint(fins->t) && J->chain[IR_LOOP])  /* Currently marked as PTR. */\n    return DROPFOLD;\n  return NEXTFOLD;\n}\n\n/* -- Commutativity ------------------------------------------------------- */\n\n/* The refs of commutative ops are canonicalized. Lower refs go to the right.\n** Rationale behind this:\n** - It (also) moves constants to the right.\n** - It reduces the number of FOLD rules (e.g. (BOR any KINT) suffices).\n** - It helps CSE to find more matches.\n** - The assembler generates better code with constants at the right.\n*/\n\nLJFOLD(ADD any any)\nLJFOLD(MUL any any)\nLJFOLD(ADDOV any any)\nLJFOLD(MULOV any any)\nLJFOLDF(comm_swap)\n{\n  if (fins->op1 < fins->op2) {  /* Move lower ref to the right. */\n    IRRef1 tmp = fins->op1;\n    fins->op1 = fins->op2;\n    fins->op2 = tmp;\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(EQ any any)\nLJFOLD(NE any any)\nLJFOLDF(comm_equal)\n{\n  /* For non-numbers only: x == x ==> drop; x ~= x ==> fail */\n  if (fins->op1 == fins->op2 && !irt_isnum(fins->t))\n    return CONDFOLD(fins->o == IR_EQ);\n  return fold_comm_swap(J);\n}\n\nLJFOLD(LT any any)\nLJFOLD(GE any any)\nLJFOLD(LE any any)\nLJFOLD(GT any any)\nLJFOLD(ULT any any)\nLJFOLD(UGE any any)\nLJFOLD(ULE any any)\nLJFOLD(UGT any any)\nLJFOLDF(comm_comp)\n{\n  /* For non-numbers only: x <=> x ==> drop; x <> x ==> fail */\n  if (fins->op1 == fins->op2 && !irt_isnum(fins->t))\n    return CONDFOLD((fins->o ^ (fins->o >> 1)) & 1);\n  if (fins->op1 < fins->op2) {  /* Move lower ref to the right. */\n    IRRef1 tmp = fins->op1;\n    fins->op1 = fins->op2;\n    fins->op2 = tmp;\n    fins->o ^= 3; /* GT <-> LT, GE <-> LE, does not affect U */\n    return RETRYFOLD;\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(BAND any any)\nLJFOLD(BOR any any)\nLJFOLD(MIN any any)\nLJFOLD(MAX any any)\nLJFOLDF(comm_dup)\n{\n  if (fins->op1 == fins->op2)  /* x o x ==> x */\n    return LEFTFOLD;\n  return fold_comm_swap(J);\n}\n\nLJFOLD(BXOR any any)\nLJFOLDF(comm_bxor)\n{\n  if (fins->op1 == fins->op2)  /* i xor i ==> 0 */\n    return irt_is64(fins->t) ? INT64FOLD(0) : INTFOLD(0);\n  return fold_comm_swap(J);\n}\n\n/* -- Simplification of compound expressions ------------------------------ */\n\nstatic TRef kfold_xload(jit_State *J, IRIns *ir, const void *p)\n{\n  int32_t k;\n  switch (irt_type(ir->t)) {\n  case IRT_NUM: return lj_ir_knum_u64(J, *(uint64_t *)p);\n  case IRT_I8: k = (int32_t)*(int8_t *)p; break;\n  case IRT_U8: k = (int32_t)*(uint8_t *)p; break;\n  case IRT_I16: k = (int32_t)(int16_t)lj_getu16(p); break;\n  case IRT_U16: k = (int32_t)(uint16_t)lj_getu16(p); break;\n  case IRT_INT: case IRT_U32: k = (int32_t)lj_getu32(p); break;\n  case IRT_I64: case IRT_U64: return lj_ir_kint64(J, *(uint64_t *)p);\n  default: return 0;\n  }\n  return lj_ir_kint(J, k);\n}\n\n/* Turn: string.sub(str, a, b) == kstr\n** into: string.byte(str, a) == string.byte(kstr, 1) etc.\n** Note: this creates unaligned XLOADs on x86/x64.\n*/\nLJFOLD(EQ SNEW KGC)\nLJFOLD(NE SNEW KGC)\nLJFOLDF(merge_eqne_snew_kgc)\n{\n  GCstr *kstr = ir_kstr(fright);\n  int32_t len = (int32_t)kstr->len;\n  lua_assert(irt_isstr(fins->t));\n\n#if LJ_TARGET_UNALIGNED\n#define FOLD_SNEW_MAX_LEN\t4  /* Handle string lengths 0, 1, 2, 3, 4. */\n#define FOLD_SNEW_TYPE8\t\tIRT_I8\t/* Creates shorter immediates. */\n#else\n#define FOLD_SNEW_MAX_LEN\t1  /* Handle string lengths 0 or 1. */\n#define FOLD_SNEW_TYPE8\t\tIRT_U8  /* Prefer unsigned loads. */\n#endif\n\n  if (len <= FOLD_SNEW_MAX_LEN) {\n    IROp op = (IROp)fins->o;\n    IRRef strref = fleft->op1;\n    lua_assert(IR(strref)->o == IR_STRREF);\n    if (op == IR_EQ) {\n      emitir(IRTGI(IR_EQ), fleft->op2, lj_ir_kint(J, len));\n      /* Caveat: fins/fleft/fright is no longer valid after emitir. */\n    } else {\n      /* NE is not expanded since this would need an OR of two conds. */\n      if (!irref_isk(fleft->op2))  /* Only handle the constant length case. */\n\treturn NEXTFOLD;\n      if (IR(fleft->op2)->i != len)\n\treturn DROPFOLD;\n    }\n    if (len > 0) {\n      /* A 4 byte load for length 3 is ok -- all strings have an extra NUL. */\n      uint16_t ot = (uint16_t)(len == 1 ? IRT(IR_XLOAD, FOLD_SNEW_TYPE8) :\n\t\t\t       len == 2 ? IRT(IR_XLOAD, IRT_U16) :\n\t\t\t       IRTI(IR_XLOAD));\n      TRef tmp = emitir(ot, strref,\n\t\t\tIRXLOAD_READONLY | (len > 1 ? IRXLOAD_UNALIGNED : 0));\n      TRef val = kfold_xload(J, IR(tref_ref(tmp)), strdata(kstr));\n      if (len == 3)\n\ttmp = emitir(IRTI(IR_BAND), tmp,\n\t\t     lj_ir_kint(J, LJ_ENDIAN_SELECT(0x00ffffff, 0xffffff00)));\n      fins->op1 = (IRRef1)tmp;\n      fins->op2 = (IRRef1)val;\n      fins->ot = (IROpT)IRTGI(op);\n      return RETRYFOLD;\n    } else {\n      return DROPFOLD;\n    }\n  }\n  return NEXTFOLD;\n}\n\n/* -- Loads --------------------------------------------------------------- */\n\n/* Loads cannot be folded or passed on to CSE in general.\n** Alias analysis is needed to check for forwarding opportunities.\n**\n** Caveat: *all* loads must be listed here or they end up at CSE!\n*/\n\nLJFOLD(ALOAD any)\nLJFOLDX(lj_opt_fwd_aload)\n\n/* From HREF fwd (see below). Must eliminate, not supported by fwd/backend. */\nLJFOLD(HLOAD KKPTR)\nLJFOLDF(kfold_hload_kkptr)\n{\n  UNUSED(J);\n  lua_assert(ir_kptr(fleft) == niltvg(J2G(J)));\n  return TREF_NIL;\n}\n\nLJFOLD(HLOAD any)\nLJFOLDX(lj_opt_fwd_hload)\n\nLJFOLD(ULOAD any)\nLJFOLDX(lj_opt_fwd_uload)\n\nLJFOLD(CALLL any IRCALL_lj_tab_len)\nLJFOLDX(lj_opt_fwd_tab_len)\n\n/* Upvalue refs are really loads, but there are no corresponding stores.\n** So CSE is ok for them, except for UREFO across a GC step (see below).\n** If the referenced function is const, its upvalue addresses are const, too.\n** This can be used to improve CSE by looking for the same address,\n** even if the upvalues originate from a different function.\n*/\nLJFOLD(UREFO KGC any)\nLJFOLD(UREFC KGC any)\nLJFOLDF(cse_uref)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) {\n    IRRef ref = J->chain[fins->o];\n    GCfunc *fn = ir_kfunc(fleft);\n    GCupval *uv = gco2uv(gcref(fn->l.uvptr[(fins->op2 >> 8)]));\n    while (ref > 0) {\n      IRIns *ir = IR(ref);\n      if (irref_isk(ir->op1)) {\n\tGCfunc *fn2 = ir_kfunc(IR(ir->op1));\n\tif (gco2uv(gcref(fn2->l.uvptr[(ir->op2 >> 8)])) == uv) {\n\t  if (fins->o == IR_UREFO && gcstep_barrier(J, ref))\n\t    break;\n\t  return ref;\n\t}\n      }\n      ref = ir->prev;\n    }\n  }\n  return EMITFOLD;\n}\n\nLJFOLD(HREFK any any)\nLJFOLDX(lj_opt_fwd_hrefk)\n\nLJFOLD(HREF TNEW any)\nLJFOLDF(fwd_href_tnew)\n{\n  if (lj_opt_fwd_href_nokey(J))\n    return lj_ir_kkptr(J, niltvg(J2G(J)));\n  return NEXTFOLD;\n}\n\nLJFOLD(HREF TDUP KPRI)\nLJFOLD(HREF TDUP KGC)\nLJFOLD(HREF TDUP KNUM)\nLJFOLDF(fwd_href_tdup)\n{\n  TValue keyv;\n  lj_ir_kvalue(J->L, &keyv, fright);\n  if (lj_tab_get(J->L, ir_ktab(IR(fleft->op1)), &keyv) == niltvg(J2G(J)) &&\n      lj_opt_fwd_href_nokey(J))\n    return lj_ir_kkptr(J, niltvg(J2G(J)));\n  return NEXTFOLD;\n}\n\n/* We can safely FOLD/CSE array/hash refs and field loads, since there\n** are no corresponding stores. But we need to check for any NEWREF with\n** an aliased table, as it may invalidate all of the pointers and fields.\n** Only HREF needs the NEWREF check -- AREF and HREFK already depend on\n** FLOADs. And NEWREF itself is treated like a store (see below).\n*/\nLJFOLD(FLOAD TNEW IRFL_TAB_ASIZE)\nLJFOLDF(fload_tab_tnew_asize)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1))\n    return INTFOLD(fleft->op1);\n  return NEXTFOLD;\n}\n\nLJFOLD(FLOAD TNEW IRFL_TAB_HMASK)\nLJFOLDF(fload_tab_tnew_hmask)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1))\n    return INTFOLD((1 << fleft->op2)-1);\n  return NEXTFOLD;\n}\n\nLJFOLD(FLOAD TDUP IRFL_TAB_ASIZE)\nLJFOLDF(fload_tab_tdup_asize)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1))\n    return INTFOLD((int32_t)ir_ktab(IR(fleft->op1))->asize);\n  return NEXTFOLD;\n}\n\nLJFOLD(FLOAD TDUP IRFL_TAB_HMASK)\nLJFOLDF(fload_tab_tdup_hmask)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD) && lj_opt_fwd_tptr(J, fins->op1))\n    return INTFOLD((int32_t)ir_ktab(IR(fleft->op1))->hmask);\n  return NEXTFOLD;\n}\n\nLJFOLD(HREF any any)\nLJFOLD(FLOAD any IRFL_TAB_ARRAY)\nLJFOLD(FLOAD any IRFL_TAB_NODE)\nLJFOLD(FLOAD any IRFL_TAB_ASIZE)\nLJFOLD(FLOAD any IRFL_TAB_HMASK)\nLJFOLDF(fload_tab_ah)\n{\n  TRef tr = lj_opt_cse(J);\n  return lj_opt_fwd_tptr(J, tref_ref(tr)) ? tr : EMITFOLD;\n}\n\n/* Strings are immutable, so we can safely FOLD/CSE the related FLOAD. */\nLJFOLD(FLOAD KGC IRFL_STR_LEN)\nLJFOLDF(fload_str_len_kgc)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD))\n    return INTFOLD((int32_t)ir_kstr(fleft)->len);\n  return NEXTFOLD;\n}\n\nLJFOLD(FLOAD SNEW IRFL_STR_LEN)\nLJFOLDF(fload_str_len_snew)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) {\n    PHIBARRIER(fleft);\n    return fleft->op2;\n  }\n  return NEXTFOLD;\n}\n\n/* The C type ID of cdata objects is immutable. */\nLJFOLD(FLOAD KGC IRFL_CDATA_CTYPEID)\nLJFOLDF(fload_cdata_typeid_kgc)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD))\n    return INTFOLD((int32_t)ir_kcdata(fleft)->ctypeid);\n  return NEXTFOLD;\n}\n\n/* Get the contents of immutable cdata objects. */\nLJFOLD(FLOAD KGC IRFL_CDATA_PTR)\nLJFOLD(FLOAD KGC IRFL_CDATA_INT)\nLJFOLD(FLOAD KGC IRFL_CDATA_INT64)\nLJFOLDF(fload_cdata_int64_kgc)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD)) {\n    void *p = cdataptr(ir_kcdata(fleft));\n    if (irt_is64(fins->t))\n      return INT64FOLD(*(uint64_t *)p);\n    else\n      return INTFOLD(*(int32_t *)p);\n  }\n  return NEXTFOLD;\n}\n\nLJFOLD(FLOAD CNEW IRFL_CDATA_CTYPEID)\nLJFOLD(FLOAD CNEWI IRFL_CDATA_CTYPEID)\nLJFOLDF(fload_cdata_typeid_cnew)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD))\n    return fleft->op1;  /* No PHI barrier needed. CNEW/CNEWI op1 is const. */\n  return NEXTFOLD;\n}\n\n/* Pointer, int and int64 cdata objects are immutable. */\nLJFOLD(FLOAD CNEWI IRFL_CDATA_PTR)\nLJFOLD(FLOAD CNEWI IRFL_CDATA_INT)\nLJFOLD(FLOAD CNEWI IRFL_CDATA_INT64)\nLJFOLDF(fload_cdata_ptr_int64_cnew)\n{\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_FOLD))\n    return fleft->op2;  /* Fold even across PHI to avoid allocations. */\n  return NEXTFOLD;\n}\n\nLJFOLD(FLOAD any IRFL_STR_LEN)\nLJFOLD(FLOAD any IRFL_CDATA_CTYPEID)\nLJFOLD(FLOAD any IRFL_CDATA_PTR)\nLJFOLD(FLOAD any IRFL_CDATA_INT)\nLJFOLD(FLOAD any IRFL_CDATA_INT64)\nLJFOLD(VLOAD any any)  /* Vararg loads have no corresponding stores. */\nLJFOLDX(lj_opt_cse)\n\n/* All other field loads need alias analysis. */\nLJFOLD(FLOAD any any)\nLJFOLDX(lj_opt_fwd_fload)\n\n/* This is for LOOP only. Recording handles SLOADs internally. */\nLJFOLD(SLOAD any any)\nLJFOLDF(fwd_sload)\n{\n  if ((fins->op2 & IRSLOAD_FRAME)) {\n    TRef tr = lj_opt_cse(J);\n    return tref_ref(tr) < J->chain[IR_RETF] ? EMITFOLD : tr;\n  } else {\n    lua_assert(J->slot[fins->op1] != 0);\n    return J->slot[fins->op1];\n  }\n}\n\n/* Only fold for KKPTR. The pointer _and_ the contents must be const. */\nLJFOLD(XLOAD KKPTR any)\nLJFOLDF(xload_kptr)\n{\n  TRef tr = kfold_xload(J, fins, ir_kptr(fleft));\n  return tr ? tr : NEXTFOLD;\n}\n\nLJFOLD(XLOAD any any)\nLJFOLDX(lj_opt_fwd_xload)\n\n/* -- Write barriers ------------------------------------------------------ */\n\n/* Write barriers are amenable to CSE, but not across any incremental\n** GC steps.\n**\n** The same logic applies to open upvalue references, because a stack\n** may be resized during a GC step (not the current stack, but maybe that\n** of a coroutine).\n*/\nLJFOLD(TBAR any)\nLJFOLD(OBAR any any)\nLJFOLD(UREFO any any)\nLJFOLDF(barrier_tab)\n{\n  TRef tr = lj_opt_cse(J);\n  if (gcstep_barrier(J, tref_ref(tr)))  /* CSE across GC step? */\n    return EMITFOLD;  /* Raw emit. Assumes fins is left intact by CSE. */\n  return tr;\n}\n\nLJFOLD(TBAR TNEW)\nLJFOLD(TBAR TDUP)\nLJFOLDF(barrier_tnew_tdup)\n{\n  /* New tables are always white and never need a barrier. */\n  if (fins->op1 < J->chain[IR_LOOP])  /* Except across a GC step. */\n    return NEXTFOLD;\n  return DROPFOLD;\n}\n\n/* -- Stores and allocations ---------------------------------------------- */\n\n/* Stores and allocations cannot be folded or passed on to CSE in general.\n** But some stores can be eliminated with dead-store elimination (DSE).\n**\n** Caveat: *all* stores and allocs must be listed here or they end up at CSE!\n*/\n\nLJFOLD(ASTORE any any)\nLJFOLD(HSTORE any any)\nLJFOLDX(lj_opt_dse_ahstore)\n\nLJFOLD(USTORE any any)\nLJFOLDX(lj_opt_dse_ustore)\n\nLJFOLD(FSTORE any any)\nLJFOLDX(lj_opt_dse_fstore)\n\nLJFOLD(XSTORE any any)\nLJFOLDX(lj_opt_dse_xstore)\n\nLJFOLD(NEWREF any any)  /* Treated like a store. */\nLJFOLD(CALLS any any)\nLJFOLD(CALLL any any)  /* Safeguard fallback. */\nLJFOLD(CALLXS any any)\nLJFOLD(XBAR)\nLJFOLD(RETF any any)  /* Modifies BASE. */\nLJFOLD(TNEW any any)\nLJFOLD(TDUP any)\nLJFOLD(CNEW any any)\nLJFOLD(XSNEW any any)\nLJFOLDX(lj_ir_emit)\n\n/* ------------------------------------------------------------------------ */\n\n/* Every entry in the generated hash table is a 32 bit pattern:\n**\n** xxxxxxxx iiiiiii lllllll rrrrrrrrrr\n**\n**   xxxxxxxx = 8 bit index into fold function table\n**    iiiiiii = 7 bit folded instruction opcode\n**    lllllll = 7 bit left instruction opcode\n** rrrrrrrrrr = 8 bit right instruction opcode or 10 bits from literal field\n*/\n\n#include \"lj_folddef.h\"\n\n/* ------------------------------------------------------------------------ */\n\n/* Fold IR instruction. */\nTRef LJ_FASTCALL lj_opt_fold(jit_State *J)\n{\n  uint32_t key, any;\n  IRRef ref;\n\n  if (LJ_UNLIKELY((J->flags & JIT_F_OPT_MASK) != JIT_F_OPT_DEFAULT)) {\n    lua_assert(((JIT_F_OPT_FOLD|JIT_F_OPT_FWD|JIT_F_OPT_CSE|JIT_F_OPT_DSE) |\n\t\tJIT_F_OPT_DEFAULT) == JIT_F_OPT_DEFAULT);\n    /* Folding disabled? Chain to CSE, but not for loads/stores/allocs. */\n    if (!(J->flags & JIT_F_OPT_FOLD) && irm_kind(lj_ir_mode[fins->o]) == IRM_N)\n      return lj_opt_cse(J);\n\n    /* Forwarding or CSE disabled? Emit raw IR for loads, except for SLOAD. */\n    if ((J->flags & (JIT_F_OPT_FWD|JIT_F_OPT_CSE)) !=\n\t\t    (JIT_F_OPT_FWD|JIT_F_OPT_CSE) &&\n\tirm_kind(lj_ir_mode[fins->o]) == IRM_L && fins->o != IR_SLOAD)\n      return lj_ir_emit(J);\n\n    /* DSE disabled? Emit raw IR for stores. */\n    if (!(J->flags & JIT_F_OPT_DSE) && irm_kind(lj_ir_mode[fins->o]) == IRM_S)\n      return lj_ir_emit(J);\n  }\n\n  /* Fold engine start/retry point. */\nretry:\n  /* Construct key from opcode and operand opcodes (unless literal/none). */\n  key = ((uint32_t)fins->o << 17);\n  if (fins->op1 >= J->cur.nk) {\n    key += (uint32_t)IR(fins->op1)->o << 10;\n    *fleft = *IR(fins->op1);\n  }\n  if (fins->op2 >= J->cur.nk) {\n    key += (uint32_t)IR(fins->op2)->o;\n    *fright = *IR(fins->op2);\n  } else {\n    key += (fins->op2 & 0x3ffu);  /* Literal mask. Must include IRCONV_*MASK. */\n  }\n\n  /* Check for a match in order from most specific to least specific. */\n  any = 0;\n  for (;;) {\n    uint32_t k = key | (any & 0x1ffff);\n    uint32_t h = fold_hashkey(k);\n    uint32_t fh = fold_hash[h];  /* Lookup key in semi-perfect hash table. */\n    if ((fh & 0xffffff) == k || (fh = fold_hash[h+1], (fh & 0xffffff) == k)) {\n      ref = (IRRef)tref_ref(fold_func[fh >> 24](J));\n      if (ref != NEXTFOLD)\n\tbreak;\n    }\n    if (any == 0xfffff)  /* Exhausted folding. Pass on to CSE. */\n      return lj_opt_cse(J);\n    any = (any | (any >> 10)) ^ 0xffc00;\n  }\n\n  /* Return value processing, ordered by frequency. */\n  if (LJ_LIKELY(ref >= MAX_FOLD))\n    return TREF(ref, irt_t(IR(ref)->t));\n  if (ref == RETRYFOLD)\n    goto retry;\n  if (ref == KINTFOLD)\n    return lj_ir_kint(J, fins->i);\n  if (ref == FAILFOLD)\n    lj_trace_err(J, LJ_TRERR_GFAIL);\n  lua_assert(ref == DROPFOLD);\n  return REF_DROP;\n}\n\n/* -- Common-Subexpression Elimination ------------------------------------ */\n\n/* CSE an IR instruction. This is very fast due to the skip-list chains. */\nTRef LJ_FASTCALL lj_opt_cse(jit_State *J)\n{\n  /* Avoid narrow to wide store-to-load forwarding stall */\n  IRRef2 op12 = (IRRef2)fins->op1 + ((IRRef2)fins->op2 << 16);\n  IROp op = fins->o;\n  if (LJ_LIKELY(J->flags & JIT_F_OPT_CSE)) {\n    /* Limited search for same operands in per-opcode chain. */\n    IRRef ref = J->chain[op];\n    IRRef lim = fins->op1;\n    if (fins->op2 > lim) lim = fins->op2;  /* Relies on lit < REF_BIAS. */\n    while (ref > lim) {\n      if (IR(ref)->op12 == op12)\n\treturn TREF(ref, irt_t(IR(ref)->t));  /* Common subexpression found. */\n      ref = IR(ref)->prev;\n    }\n  }\n  /* Otherwise emit IR (inlined for speed). */\n  {\n    IRRef ref = lj_ir_nextins(J);\n    IRIns *ir = IR(ref);\n    ir->prev = J->chain[op];\n    ir->op12 = op12;\n    J->chain[op] = (IRRef1)ref;\n    ir->o = fins->o;\n    J->guardemit.irt |= fins->t.irt;\n    return TREF(ref, irt_t((ir->t = fins->t)));\n  }\n}\n\n/* CSE with explicit search limit. */\nTRef LJ_FASTCALL lj_opt_cselim(jit_State *J, IRRef lim)\n{\n  IRRef ref = J->chain[fins->o];\n  IRRef2 op12 = (IRRef2)fins->op1 + ((IRRef2)fins->op2 << 16);\n  while (ref > lim) {\n    if (IR(ref)->op12 == op12)\n      return ref;\n    ref = IR(ref)->prev;\n  }\n  return lj_ir_emit(J);\n}\n\n/* ------------------------------------------------------------------------ */\n\n#undef IR\n#undef fins\n#undef fleft\n#undef fright\n#undef knumleft\n#undef knumright\n#undef emitir\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_opt_loop.c",
    "content": "/*\n** LOOP: Loop Optimizations.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_opt_loop_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#include \"lj_snap.h\"\n#include \"lj_vm.h\"\n\n/* Loop optimization:\n**\n** Traditional Loop-Invariant Code Motion (LICM) splits the instructions\n** of a loop into invariant and variant instructions. The invariant\n** instructions are hoisted out of the loop and only the variant\n** instructions remain inside the loop body.\n**\n** Unfortunately LICM is mostly useless for compiling dynamic languages.\n** The IR has many guards and most of the subsequent instructions are\n** control-dependent on them. The first non-hoistable guard would\n** effectively prevent hoisting of all subsequent instructions.\n**\n** That's why we use a special form of unrolling using copy-substitution,\n** combined with redundancy elimination:\n**\n** The recorded instruction stream is re-emitted to the compiler pipeline\n** with substituted operands. The substitution table is filled with the\n** refs returned by re-emitting each instruction. This can be done\n** on-the-fly, because the IR is in strict SSA form, where every ref is\n** defined before its use.\n**\n** This aproach generates two code sections, separated by the LOOP\n** instruction:\n**\n** 1. The recorded instructions form a kind of pre-roll for the loop. It\n** contains a mix of invariant and variant instructions and performs\n** exactly one loop iteration (but not necessarily the 1st iteration).\n**\n** 2. The loop body contains only the variant instructions and performs\n** all remaining loop iterations.\n**\n** On first sight that looks like a waste of space, because the variant\n** instructions are present twice. But the key insight is that the\n** pre-roll honors the control-dependencies for *both* the pre-roll itself\n** *and* the loop body!\n**\n** It also means one doesn't have to explicitly model control-dependencies\n** (which, BTW, wouldn't help LICM much). And it's much easier to\n** integrate sparse snapshotting with this approach.\n**\n** One of the nicest aspects of this approach is that all of the\n** optimizations of the compiler pipeline (FOLD, CSE, FWD, etc.) can be\n** reused with only minor restrictions (e.g. one should not fold\n** instructions across loop-carried dependencies).\n**\n** But in general all optimizations can be applied which only need to look\n** backwards into the generated instruction stream. At any point in time\n** during the copy-substitution process this contains both a static loop\n** iteration (the pre-roll) and a dynamic one (from the to-be-copied\n** instruction up to the end of the partial loop body).\n**\n** Since control-dependencies are implicitly kept, CSE also applies to all\n** kinds of guards. The major advantage is that all invariant guards can\n** be hoisted, too.\n**\n** Load/store forwarding works across loop iterations, too. This is\n** important if loop-carried dependencies are kept in upvalues or tables.\n** E.g. 'self.idx = self.idx + 1' deep down in some OO-style method may\n** become a forwarded loop-recurrence after inlining.\n**\n** Since the IR is in SSA form, loop-carried dependencies have to be\n** modeled with PHI instructions. The potential candidates for PHIs are\n** collected on-the-fly during copy-substitution. After eliminating the\n** redundant ones, PHI instructions are emitted *below* the loop body.\n**\n** Note that this departure from traditional SSA form doesn't change the\n** semantics of the PHI instructions themselves. But it greatly simplifies\n** on-the-fly generation of the IR and the machine code.\n*/\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t(&J->cur.ir[(ref)])\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n/* Emit raw IR without passing through optimizations. */\n#define emitir_raw(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J))\n\n/* -- PHI elimination ----------------------------------------------------- */\n\n/* Emit or eliminate collected PHIs. */\nstatic void loop_emit_phi(jit_State *J, IRRef1 *subst, IRRef1 *phi, IRRef nphi,\n\t\t\t  SnapNo onsnap)\n{\n  int passx = 0;\n  IRRef i, nslots;\n  IRRef invar = J->chain[IR_LOOP];\n  /* Pass #1: mark redundant and potentially redundant PHIs. */\n  for (i = 0; i < nphi; i++) {\n    IRRef lref = phi[i];\n    IRRef rref = subst[lref];\n    if (lref == rref || rref == REF_DROP) {  /* Invariants are redundant. */\n      irt_setmark(IR(lref)->t);\n    } else if (!(IR(rref)->op1 == lref || IR(rref)->op2 == lref)) {\n      /* Quick check for simple recurrences failed, need pass2. */\n      irt_setmark(IR(lref)->t);\n      passx = 1;\n    }\n  }\n  /* Pass #2: traverse variant part and clear marks of non-redundant PHIs. */\n  if (passx) {\n    SnapNo s;\n    for (i = J->cur.nins-1; i > invar; i--) {\n      IRIns *ir = IR(i);\n      if (!irref_isk(ir->op2)) irt_clearmark(IR(ir->op2)->t);\n      if (!irref_isk(ir->op1)) {\n\tirt_clearmark(IR(ir->op1)->t);\n\tif (ir->op1 < invar &&\n\t    ir->o >= IR_CALLN && ir->o <= IR_CARG) {  /* ORDER IR */\n\t  ir = IR(ir->op1);\n\t  while (ir->o == IR_CARG) {\n\t    if (!irref_isk(ir->op2)) irt_clearmark(IR(ir->op2)->t);\n\t    if (irref_isk(ir->op1)) break;\n\t    ir = IR(ir->op1);\n\t    irt_clearmark(ir->t);\n\t  }\n\t}\n      }\n    }\n    for (s = J->cur.nsnap-1; s >= onsnap; s--) {\n      SnapShot *snap = &J->cur.snap[s];\n      SnapEntry *map = &J->cur.snapmap[snap->mapofs];\n      MSize n, nent = snap->nent;\n      for (n = 0; n < nent; n++) {\n\tIRRef ref = snap_ref(map[n]);\n\tif (!irref_isk(ref)) irt_clearmark(IR(ref)->t);\n      }\n    }\n  }\n  /* Pass #3: add PHIs for variant slots without a corresponding SLOAD. */\n  nslots = J->baseslot+J->maxslot;\n  for (i = 1; i < nslots; i++) {\n    IRRef ref = tref_ref(J->slot[i]);\n    while (!irref_isk(ref) && ref != subst[ref]) {\n      IRIns *ir = IR(ref);\n      irt_clearmark(ir->t);  /* Unmark potential uses, too. */\n      if (irt_isphi(ir->t) || irt_ispri(ir->t))\n\tbreak;\n      irt_setphi(ir->t);\n      if (nphi >= LJ_MAX_PHI)\n\tlj_trace_err(J, LJ_TRERR_PHIOV);\n      phi[nphi++] = (IRRef1)ref;\n      ref = subst[ref];\n      if (ref > invar)\n\tbreak;\n    }\n  }\n  /* Pass #4: propagate non-redundant PHIs. */\n  while (passx) {\n    passx = 0;\n    for (i = 0; i < nphi; i++) {\n      IRRef lref = phi[i];\n      IRIns *ir = IR(lref);\n      if (!irt_ismarked(ir->t)) {  /* Propagate only from unmarked PHIs. */\n\tIRRef rref = subst[lref];\n\tif (lref == rref) {  /* Mark redundant PHI. */\n\t  irt_setmark(ir->t);\n\t} else {\n\t  IRIns *irr = IR(rref);\n\t  if (irt_ismarked(irr->t)) {  /* Right ref points to other PHI? */\n\t    irt_clearmark(irr->t);  /* Mark that PHI as non-redundant. */\n\t    passx = 1;  /* Retry. */\n\t  }\n\t}\n      }\n    }\n  }\n  /* Pass #5: emit PHI instructions or eliminate PHIs. */\n  for (i = 0; i < nphi; i++) {\n    IRRef lref = phi[i];\n    IRIns *ir = IR(lref);\n    if (!irt_ismarked(ir->t)) {  /* Emit PHI if not marked. */\n      IRRef rref = subst[lref];\n      if (rref > invar)\n\tirt_setphi(IR(rref)->t);\n      emitir_raw(IRT(IR_PHI, irt_type(ir->t)), lref, rref);\n    } else {  /* Otherwise eliminate PHI. */\n      irt_clearmark(ir->t);\n      irt_clearphi(ir->t);\n    }\n  }\n}\n\n/* -- Loop unrolling using copy-substitution ------------------------------ */\n\n/* Copy-substitute snapshot. */\nstatic void loop_subst_snap(jit_State *J, SnapShot *osnap,\n\t\t\t    SnapEntry *loopmap, IRRef1 *subst)\n{\n  SnapEntry *nmap, *omap = &J->cur.snapmap[osnap->mapofs];\n  SnapEntry *nextmap = &J->cur.snapmap[snap_nextofs(&J->cur, osnap)];\n  MSize nmapofs;\n  MSize on, ln, nn, onent = osnap->nent;\n  BCReg nslots = osnap->nslots;\n  SnapShot *snap = &J->cur.snap[J->cur.nsnap];\n  if (irt_isguard(J->guardemit)) {  /* Guard inbetween? */\n    nmapofs = J->cur.nsnapmap;\n    J->cur.nsnap++;  /* Add new snapshot. */\n  } else {  /* Otherwise overwrite previous snapshot. */\n    snap--;\n    nmapofs = snap->mapofs;\n  }\n  J->guardemit.irt = 0;\n  /* Setup new snapshot. */\n  snap->mapofs = (uint16_t)nmapofs;\n  snap->ref = (IRRef1)J->cur.nins;\n  snap->nslots = nslots;\n  snap->topslot = osnap->topslot;\n  snap->count = 0;\n  nmap = &J->cur.snapmap[nmapofs];\n  /* Substitute snapshot slots. */\n  on = ln = nn = 0;\n  while (on < onent) {\n    SnapEntry osn = omap[on], lsn = loopmap[ln];\n    if (snap_slot(lsn) < snap_slot(osn)) {  /* Copy slot from loop map. */\n      nmap[nn++] = lsn;\n      ln++;\n    } else {  /* Copy substituted slot from snapshot map. */\n      if (snap_slot(lsn) == snap_slot(osn)) ln++;  /* Shadowed loop slot. */\n      if (!irref_isk(snap_ref(osn)))\n\tosn = snap_setref(osn, subst[snap_ref(osn)]);\n      nmap[nn++] = osn;\n      on++;\n    }\n  }\n  while (snap_slot(loopmap[ln]) < nslots)  /* Copy remaining loop slots. */\n    nmap[nn++] = loopmap[ln++];\n  snap->nent = (uint8_t)nn;\n  omap += onent;\n  nmap += nn;\n  while (omap < nextmap)  /* Copy PC + frame links. */\n    *nmap++ = *omap++;\n  J->cur.nsnapmap = (uint16_t)(nmap - J->cur.snapmap);\n}\n\n/* Unroll loop. */\nstatic void loop_unroll(jit_State *J)\n{\n  IRRef1 phi[LJ_MAX_PHI];\n  uint32_t nphi = 0;\n  IRRef1 *subst;\n  SnapNo onsnap;\n  SnapShot *osnap, *loopsnap;\n  SnapEntry *loopmap, *psentinel;\n  IRRef ins, invar;\n\n  /* Use temp buffer for substitution table.\n  ** Only non-constant refs in [REF_BIAS,invar) are valid indexes.\n  ** Caveat: don't call into the VM or run the GC or the buffer may be gone.\n  */\n  invar = J->cur.nins;\n  subst = (IRRef1 *)lj_str_needbuf(J->L, &G(J->L)->tmpbuf,\n\t\t\t\t   (invar-REF_BIAS)*sizeof(IRRef1)) - REF_BIAS;\n  subst[REF_BASE] = REF_BASE;\n\n  /* LOOP separates the pre-roll from the loop body. */\n  emitir_raw(IRTG(IR_LOOP, IRT_NIL), 0, 0);\n\n  /* Grow snapshot buffer and map for copy-substituted snapshots.\n  ** Need up to twice the number of snapshots minus #0 and loop snapshot.\n  ** Need up to twice the number of entries plus fallback substitutions\n  ** from the loop snapshot entries for each new snapshot.\n  ** Caveat: both calls may reallocate J->cur.snap and J->cur.snapmap!\n  */\n  onsnap = J->cur.nsnap;\n  lj_snap_grow_buf(J, 2*onsnap-2);\n  lj_snap_grow_map(J, J->cur.nsnapmap*2+(onsnap-2)*J->cur.snap[onsnap-1].nent);\n\n  /* The loop snapshot is used for fallback substitutions. */\n  loopsnap = &J->cur.snap[onsnap-1];\n  loopmap = &J->cur.snapmap[loopsnap->mapofs];\n  /* The PC of snapshot #0 and the loop snapshot must match. */\n  psentinel = &loopmap[loopsnap->nent];\n  lua_assert(*psentinel == J->cur.snapmap[J->cur.snap[0].nent]);\n  *psentinel = SNAP(255, 0, 0);  /* Replace PC with temporary sentinel. */\n\n  /* Start substitution with snapshot #1 (#0 is empty for root traces). */\n  osnap = &J->cur.snap[1];\n\n  /* Copy and substitute all recorded instructions and snapshots. */\n  for (ins = REF_FIRST; ins < invar; ins++) {\n    IRIns *ir;\n    IRRef op1, op2;\n\n    if (ins >= osnap->ref)  /* Instruction belongs to next snapshot? */\n      loop_subst_snap(J, osnap++, loopmap, subst);  /* Copy-substitute it. */\n\n    /* Substitute instruction operands. */\n    ir = IR(ins);\n    op1 = ir->op1;\n    if (!irref_isk(op1)) op1 = subst[op1];\n    op2 = ir->op2;\n    if (!irref_isk(op2)) op2 = subst[op2];\n    if (irm_kind(lj_ir_mode[ir->o]) == IRM_N &&\n\top1 == ir->op1 && op2 == ir->op2) {  /* Regular invariant ins? */\n      subst[ins] = (IRRef1)ins;  /* Shortcut. */\n    } else {\n      /* Re-emit substituted instruction to the FOLD/CSE/etc. pipeline. */\n      IRType1 t = ir->t;  /* Get this first, since emitir may invalidate ir. */\n      IRRef ref = tref_ref(emitir(ir->ot & ~IRT_ISPHI, op1, op2));\n      subst[ins] = (IRRef1)ref;\n      if (ref != ins) {\n\tIRIns *irr = IR(ref);\n\tif (ref < invar) {  /* Loop-carried dependency? */\n\t  /* Potential PHI? */\n\t  if (!irref_isk(ref) && !irt_isphi(irr->t) && !irt_ispri(irr->t)) {\n\t    irt_setphi(irr->t);\n\t    if (nphi >= LJ_MAX_PHI)\n\t      lj_trace_err(J, LJ_TRERR_PHIOV);\n\t    phi[nphi++] = (IRRef1)ref;\n\t  }\n\t  /* Check all loop-carried dependencies for type instability. */\n\t  if (!irt_sametype(t, irr->t)) {\n\t    if (irt_isinteger(t) && irt_isinteger(irr->t))\n\t      continue;\n\t    else if (irt_isnum(t) && irt_isinteger(irr->t))  /* Fix int->num. */\n\t      ref = tref_ref(emitir(IRTN(IR_CONV), ref, IRCONV_NUM_INT));\n\t    else if (irt_isnum(irr->t) && irt_isinteger(t))  /* Fix num->int. */\n\t      ref = tref_ref(emitir(IRTGI(IR_CONV), ref,\n\t\t\t\t    IRCONV_INT_NUM|IRCONV_CHECK));\n\t    else\n\t      lj_trace_err(J, LJ_TRERR_TYPEINS);\n\t    subst[ins] = (IRRef1)ref;\n\t    irr = IR(ref);\n\t    goto phiconv;\n\t  }\n\t} else if (ref != REF_DROP && irr->o == IR_CONV &&\n\t\t   ref > invar && irr->op1 < invar) {\n\t  /* May need an extra PHI for a CONV. */\n\t  ref = irr->op1;\n\t  irr = IR(ref);\n\tphiconv:\n\t  if (ref < invar && !irref_isk(ref) && !irt_isphi(irr->t)) {\n\t    irt_setphi(irr->t);\n\t    if (nphi >= LJ_MAX_PHI)\n\t      lj_trace_err(J, LJ_TRERR_PHIOV);\n\t    phi[nphi++] = (IRRef1)ref;\n\t  }\n\t}\n      }\n    }\n  }\n  if (!irt_isguard(J->guardemit))  /* Drop redundant snapshot. */\n    J->cur.nsnapmap = (uint16_t)J->cur.snap[--J->cur.nsnap].mapofs;\n  lua_assert(J->cur.nsnapmap <= J->sizesnapmap);\n  *psentinel = J->cur.snapmap[J->cur.snap[0].nent];  /* Restore PC. */\n\n  loop_emit_phi(J, subst, phi, nphi, onsnap);\n}\n\n/* Undo any partial changes made by the loop optimization. */\nstatic void loop_undo(jit_State *J, IRRef ins, SnapNo nsnap, MSize nsnapmap)\n{\n  ptrdiff_t i;\n  SnapShot *snap = &J->cur.snap[nsnap-1];\n  SnapEntry *map = J->cur.snapmap;\n  map[snap->mapofs + snap->nent] = map[J->cur.snap[0].nent];  /* Restore PC. */\n  J->cur.nsnapmap = (uint16_t)nsnapmap;\n  J->cur.nsnap = nsnap;\n  J->guardemit.irt = 0;\n  lj_ir_rollback(J, ins);\n  for (i = 0; i < BPROP_SLOTS; i++) {  /* Remove backprop. cache entries. */\n    BPropEntry *bp = &J->bpropcache[i];\n    if (bp->val >= ins)\n      bp->key = 0;\n  }\n  for (ins--; ins >= REF_FIRST; ins--) {  /* Remove flags. */\n    IRIns *ir = IR(ins);\n    irt_clearphi(ir->t);\n    irt_clearmark(ir->t);\n  }\n}\n\n/* Protected callback for loop optimization. */\nstatic TValue *cploop_opt(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  UNUSED(L); UNUSED(dummy);\n  loop_unroll((jit_State *)ud);\n  return NULL;\n}\n\n/* Loop optimization. */\nint lj_opt_loop(jit_State *J)\n{\n  IRRef nins = J->cur.nins;\n  SnapNo nsnap = J->cur.nsnap;\n  MSize nsnapmap = J->cur.nsnapmap;\n  int errcode = lj_vm_cpcall(J->L, NULL, J, cploop_opt);\n  if (LJ_UNLIKELY(errcode)) {\n    lua_State *L = J->L;\n    if (errcode == LUA_ERRRUN && tvisnumber(L->top-1)) {  /* Trace error? */\n      int32_t e = numberVint(L->top-1);\n      switch ((TraceError)e) {\n      case LJ_TRERR_TYPEINS:  /* Type instability. */\n      case LJ_TRERR_GFAIL:  /* Guard would always fail. */\n\t/* Unrolling via recording fixes many cases, e.g. a flipped boolean. */\n\tif (--J->instunroll < 0)  /* But do not unroll forever. */\n\t  break;\n\tL->top--;  /* Remove error object. */\n\tloop_undo(J, nins, nsnap, nsnapmap);\n\treturn 1;  /* Loop optimization failed, continue recording. */\n      default:\n\tbreak;\n      }\n    }\n    lj_err_throw(L, errcode);  /* Propagate all other errors. */\n  }\n  return 0;  /* Loop optimization is ok. */\n}\n\n#undef IR\n#undef emitir\n#undef emitir_raw\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_opt_mem.c",
    "content": "/*\n** Memory access optimizations.\n** AA: Alias Analysis using high-level semantic disambiguation.\n** FWD: Load Forwarding (L2L) + Store Forwarding (S2L).\n** DSE: Dead-Store Elimination.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_opt_mem_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_tab.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t(&J->cur.ir[(ref)])\n#define fins\t\t(&J->fold.ins)\n#define fleft\t\t(&J->fold.left)\n#define fright\t\t(&J->fold.right)\n\n/*\n** Caveat #1: return value is not always a TRef -- only use with tref_ref().\n** Caveat #2: FWD relies on active CSE for xREF operands -- see lj_opt_fold().\n*/\n\n/* Return values from alias analysis. */\ntypedef enum {\n  ALIAS_NO,\t/* The two refs CANNOT alias (exact). */\n  ALIAS_MAY,\t/* The two refs MAY alias (inexact). */\n  ALIAS_MUST\t/* The two refs MUST alias (exact). */\n} AliasRet;\n\n/* -- ALOAD/HLOAD forwarding and ASTORE/HSTORE elimination ---------------- */\n\n/* Simplified escape analysis: check for intervening stores. */\nstatic AliasRet aa_escape(jit_State *J, IRIns *ir, IRIns *stop)\n{\n  IRRef ref = (IRRef)(ir - J->cur.ir);  /* The ref that might be stored. */\n  for (ir++; ir < stop; ir++)\n    if (ir->op2 == ref &&\n\t(ir->o == IR_ASTORE || ir->o == IR_HSTORE ||\n\t ir->o == IR_USTORE || ir->o == IR_FSTORE))\n      return ALIAS_MAY;  /* Reference was stored and might alias. */\n  return ALIAS_NO;  /* Reference was not stored. */\n}\n\n/* Alias analysis for two different table references. */\nstatic AliasRet aa_table(jit_State *J, IRRef ta, IRRef tb)\n{\n  IRIns *taba = IR(ta), *tabb = IR(tb);\n  int newa, newb;\n  lua_assert(ta != tb);\n  lua_assert(irt_istab(taba->t) && irt_istab(tabb->t));\n  /* Disambiguate new allocations. */\n  newa = (taba->o == IR_TNEW || taba->o == IR_TDUP);\n  newb = (tabb->o == IR_TNEW || tabb->o == IR_TDUP);\n  if (newa && newb)\n    return ALIAS_NO;  /* Two different allocations never alias. */\n  if (newb) {  /* At least one allocation? */\n    IRIns *tmp = taba; taba = tabb; tabb = tmp;\n  } else if (!newa) {\n    return ALIAS_MAY;  /* Anything else: we just don't know. */\n  }\n  return aa_escape(J, taba, tabb);\n}\n\n/* Alias analysis for array and hash access using key-based disambiguation. */\nstatic AliasRet aa_ahref(jit_State *J, IRIns *refa, IRIns *refb)\n{\n  IRRef ka = refa->op2;\n  IRRef kb = refb->op2;\n  IRIns *keya, *keyb;\n  IRRef ta, tb;\n  if (refa == refb)\n    return ALIAS_MUST;  /* Shortcut for same refs. */\n  keya = IR(ka);\n  if (keya->o == IR_KSLOT) { ka = keya->op1; keya = IR(ka); }\n  keyb = IR(kb);\n  if (keyb->o == IR_KSLOT) { kb = keyb->op1; keyb = IR(kb); }\n  ta = (refa->o==IR_HREFK || refa->o==IR_AREF) ? IR(refa->op1)->op1 : refa->op1;\n  tb = (refb->o==IR_HREFK || refb->o==IR_AREF) ? IR(refb->op1)->op1 : refb->op1;\n  if (ka == kb) {\n    /* Same key. Check for same table with different ref (NEWREF vs. HREF). */\n    if (ta == tb)\n      return ALIAS_MUST;  /* Same key, same table. */\n    else\n      return aa_table(J, ta, tb);  /* Same key, possibly different table. */\n  }\n  if (irref_isk(ka) && irref_isk(kb))\n    return ALIAS_NO;  /* Different constant keys. */\n  if (refa->o == IR_AREF) {\n    /* Disambiguate array references based on index arithmetic. */\n    int32_t ofsa = 0, ofsb = 0;\n    IRRef basea = ka, baseb = kb;\n    lua_assert(refb->o == IR_AREF);\n    /* Gather base and offset from t[base] or t[base+-ofs]. */\n    if (keya->o == IR_ADD && irref_isk(keya->op2)) {\n      basea = keya->op1;\n      ofsa = IR(keya->op2)->i;\n      if (basea == kb && ofsa != 0)\n\treturn ALIAS_NO;  /* t[base+-ofs] vs. t[base]. */\n    }\n    if (keyb->o == IR_ADD && irref_isk(keyb->op2)) {\n      baseb = keyb->op1;\n      ofsb = IR(keyb->op2)->i;\n      if (ka == baseb && ofsb != 0)\n\treturn ALIAS_NO;  /* t[base] vs. t[base+-ofs]. */\n    }\n    if (basea == baseb && ofsa != ofsb)\n      return ALIAS_NO;  /* t[base+-o1] vs. t[base+-o2] and o1 != o2. */\n  } else {\n    /* Disambiguate hash references based on the type of their keys. */\n    lua_assert((refa->o==IR_HREF || refa->o==IR_HREFK || refa->o==IR_NEWREF) &&\n\t       (refb->o==IR_HREF || refb->o==IR_HREFK || refb->o==IR_NEWREF));\n    if (!irt_sametype(keya->t, keyb->t))\n      return ALIAS_NO;  /* Different key types. */\n  }\n  if (ta == tb)\n    return ALIAS_MAY;  /* Same table, cannot disambiguate keys. */\n  else\n    return aa_table(J, ta, tb);  /* Try to disambiguate tables. */\n}\n\n/* Array and hash load forwarding. */\nstatic TRef fwd_ahload(jit_State *J, IRRef xref)\n{\n  IRIns *xr = IR(xref);\n  IRRef lim = xref;  /* Search limit. */\n  IRRef ref;\n\n  /* Search for conflicting stores. */\n  ref = J->chain[fins->o+IRDELTA_L2S];\n  while (ref > xref) {\n    IRIns *store = IR(ref);\n    switch (aa_ahref(J, xr, IR(store->op1))) {\n    case ALIAS_NO:   break;  /* Continue searching. */\n    case ALIAS_MAY:  lim = ref; goto cselim;  /* Limit search for load. */\n    case ALIAS_MUST: return store->op2;  /* Store forwarding. */\n    }\n    ref = store->prev;\n  }\n\n  /* No conflicting store (yet): const-fold loads from allocations. */\n  {\n    IRIns *ir = (xr->o == IR_HREFK || xr->o == IR_AREF) ? IR(xr->op1) : xr;\n    IRRef tab = ir->op1;\n    ir = IR(tab);\n    if (ir->o == IR_TNEW || (ir->o == IR_TDUP && irref_isk(xr->op2))) {\n      /* A NEWREF with a number key may end up pointing to the array part.\n      ** But it's referenced from HSTORE and not found in the ASTORE chain.\n      ** For now simply consider this a conflict without forwarding anything.\n      */\n      if (xr->o == IR_AREF) {\n\tIRRef ref2 = J->chain[IR_NEWREF];\n\twhile (ref2 > tab) {\n\t  IRIns *newref = IR(ref2);\n\t  if (irt_isnum(IR(newref->op2)->t))\n\t    goto cselim;\n\t  ref2 = newref->prev;\n\t}\n      }\n      /* NEWREF inhibits CSE for HREF, and dependent FLOADs from HREFK/AREF.\n      ** But the above search for conflicting stores was limited by xref.\n      ** So continue searching, limited by the TNEW/TDUP. Store forwarding\n      ** is ok, too. A conflict does NOT limit the search for a matching load.\n      */\n      while (ref > tab) {\n\tIRIns *store = IR(ref);\n\tswitch (aa_ahref(J, xr, IR(store->op1))) {\n\tcase ALIAS_NO:   break;  /* Continue searching. */\n\tcase ALIAS_MAY:  goto cselim;  /* Conflicting store. */\n\tcase ALIAS_MUST: return store->op2;  /* Store forwarding. */\n\t}\n\tref = store->prev;\n      }\n      lua_assert(ir->o != IR_TNEW || irt_isnil(fins->t));\n      if (irt_ispri(fins->t)) {\n\treturn TREF_PRI(irt_type(fins->t));\n      } else if (irt_isnum(fins->t) || (LJ_DUALNUM && irt_isint(fins->t)) ||\n\t\t irt_isstr(fins->t)) {\n\tTValue keyv;\n\tcTValue *tv;\n\tIRIns *key = IR(xr->op2);\n\tif (key->o == IR_KSLOT) key = IR(key->op1);\n\tlj_ir_kvalue(J->L, &keyv, key);\n\ttv = lj_tab_get(J->L, ir_ktab(IR(ir->op1)), &keyv);\n\tlua_assert(itype2irt(tv) == irt_type(fins->t));\n\tif (irt_isnum(fins->t))\n\t  return lj_ir_knum_u64(J, tv->u64);\n\telse if (LJ_DUALNUM && irt_isint(fins->t))\n\t  return lj_ir_kint(J, intV(tv));\n\telse\n\t  return lj_ir_kstr(J, strV(tv));\n      }\n      /* Othwerwise: don't intern as a constant. */\n    }\n  }\n\ncselim:\n  /* Try to find a matching load. Below the conflicting store, if any. */\n  ref = J->chain[fins->o];\n  while (ref > lim) {\n    IRIns *load = IR(ref);\n    if (load->op1 == xref)\n      return ref;  /* Load forwarding. */\n    ref = load->prev;\n  }\n  return 0;  /* Conflict or no match. */\n}\n\n/* Reassociate ALOAD across PHIs to handle t[i-1] forwarding case. */\nstatic TRef fwd_aload_reassoc(jit_State *J)\n{\n  IRIns *irx = IR(fins->op1);\n  IRIns *key = IR(irx->op2);\n  if (key->o == IR_ADD && irref_isk(key->op2)) {\n    IRIns *add2 = IR(key->op1);\n    if (add2->o == IR_ADD && irref_isk(add2->op2) &&\n\tIR(key->op2)->i == -IR(add2->op2)->i) {\n      IRRef ref = J->chain[IR_AREF];\n      IRRef lim = add2->op1;\n      if (irx->op1 > lim) lim = irx->op1;\n      while (ref > lim) {\n\tIRIns *ir = IR(ref);\n\tif (ir->op1 == irx->op1 && ir->op2 == add2->op1)\n\t  return fwd_ahload(J, ref);\n\tref = ir->prev;\n      }\n    }\n  }\n  return 0;\n}\n\n/* ALOAD forwarding. */\nTRef LJ_FASTCALL lj_opt_fwd_aload(jit_State *J)\n{\n  IRRef ref;\n  if ((ref = fwd_ahload(J, fins->op1)) ||\n      (ref = fwd_aload_reassoc(J)))\n    return ref;\n  return EMITFOLD;\n}\n\n/* HLOAD forwarding. */\nTRef LJ_FASTCALL lj_opt_fwd_hload(jit_State *J)\n{\n  IRRef ref = fwd_ahload(J, fins->op1);\n  if (ref)\n    return ref;\n  return EMITFOLD;\n}\n\n/* HREFK forwarding. */\nTRef LJ_FASTCALL lj_opt_fwd_hrefk(jit_State *J)\n{\n  IRRef tab = fleft->op1;\n  IRRef ref = J->chain[IR_NEWREF];\n  while (ref > tab) {\n    IRIns *newref = IR(ref);\n    if (tab == newref->op1) {\n      if (fright->op1 == newref->op2)\n\treturn ref;  /* Forward from NEWREF. */\n      else\n\tgoto docse;\n    } else if (aa_table(J, tab, newref->op1) != ALIAS_NO) {\n      goto docse;\n    }\n    ref = newref->prev;\n  }\n  /* No conflicting NEWREF: key location unchanged for HREFK of TDUP. */\n  if (IR(tab)->o == IR_TDUP)\n    fins->t.irt &= ~IRT_GUARD;  /* Drop HREFK guard. */\ndocse:\n  return CSEFOLD;\n}\n\n/* Check whether HREF of TNEW/TDUP can be folded to niltv. */\nint LJ_FASTCALL lj_opt_fwd_href_nokey(jit_State *J)\n{\n  IRRef lim = fins->op1;  /* Search limit. */\n  IRRef ref;\n\n  /* The key for an ASTORE may end up in the hash part after a NEWREF. */\n  if (irt_isnum(fright->t) && J->chain[IR_NEWREF] > lim) {\n    ref = J->chain[IR_ASTORE];\n    while (ref > lim) {\n      if (ref < J->chain[IR_NEWREF])\n\treturn 0;  /* Conflict. */\n      ref = IR(ref)->prev;\n    }\n  }\n\n  /* Search for conflicting stores. */\n  ref = J->chain[IR_HSTORE];\n  while (ref > lim) {\n    IRIns *store = IR(ref);\n    if (aa_ahref(J, fins, IR(store->op1)) != ALIAS_NO)\n      return 0;  /* Conflict. */\n    ref = store->prev;\n  }\n\n  return 1;  /* No conflict. Can fold to niltv. */\n}\n\n/* Check whether there's no aliasing NEWREF for the left operand. */\nint LJ_FASTCALL lj_opt_fwd_tptr(jit_State *J, IRRef lim)\n{\n  IRRef ta = fins->op1;\n  IRRef ref = J->chain[IR_NEWREF];\n  while (ref > lim) {\n    IRIns *newref = IR(ref);\n    if (ta == newref->op1 || aa_table(J, ta, newref->op1) != ALIAS_NO)\n      return 0;  /* Conflict. */\n    ref = newref->prev;\n  }\n  return 1;  /* No conflict. Can safely FOLD/CSE. */\n}\n\n/* ASTORE/HSTORE elimination. */\nTRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J)\n{\n  IRRef xref = fins->op1;  /* xREF reference. */\n  IRRef val = fins->op2;  /* Stored value reference. */\n  IRIns *xr = IR(xref);\n  IRRef1 *refp = &J->chain[fins->o];\n  IRRef ref = *refp;\n  while (ref > xref) {  /* Search for redundant or conflicting stores. */\n    IRIns *store = IR(ref);\n    switch (aa_ahref(J, xr, IR(store->op1))) {\n    case ALIAS_NO:\n      break;  /* Continue searching. */\n    case ALIAS_MAY:\t/* Store to MAYBE the same location. */\n      if (store->op2 != val)  /* Conflict if the value is different. */\n\tgoto doemit;\n      break;  /* Otherwise continue searching. */\n    case ALIAS_MUST:\t/* Store to the same location. */\n      if (store->op2 == val)  /* Same value: drop the new store. */\n\treturn DROPFOLD;\n      /* Different value: try to eliminate the redundant store. */\n      if (ref > J->chain[IR_LOOP]) {  /* Quick check to avoid crossing LOOP. */\n\tIRIns *ir;\n\t/* Check for any intervening guards (includes conflicting loads). */\n\tfor (ir = IR(J->cur.nins-1); ir > store; ir--)\n\t  if (irt_isguard(ir->t))\n\t    goto doemit;  /* No elimination possible. */\n\t/* Remove redundant store from chain and replace with NOP. */\n\t*refp = store->prev;\n\tstore->o = IR_NOP;\n\tstore->t.irt = IRT_NIL;\n\tstore->op1 = store->op2 = 0;\n\tstore->prev = 0;\n\t/* Now emit the new store instead. */\n      }\n      goto doemit;\n    }\n    ref = *(refp = &store->prev);\n  }\ndoemit:\n  return EMITFOLD;  /* Otherwise we have a conflict or simply no match. */\n}\n\n/* -- ULOAD forwarding ---------------------------------------------------- */\n\n/* The current alias analysis for upvalues is very simplistic. It only\n** disambiguates between the unique upvalues of the same function.\n** This is good enough for now, since most upvalues are read-only.\n**\n** A more precise analysis would be feasible with the help of the parser:\n** generate a unique key for every upvalue, even across all prototypes.\n** Lacking a realistic use-case, it's unclear whether this is beneficial.\n*/\nstatic AliasRet aa_uref(IRIns *refa, IRIns *refb)\n{\n  if (refa->o != refb->o)\n    return ALIAS_NO;  /* Different UREFx type. */\n  if (refa->op1 == refb->op1) {  /* Same function. */\n    if (refa->op2 == refb->op2)\n      return ALIAS_MUST;  /* Same function, same upvalue idx. */\n    else\n      return ALIAS_NO;  /* Same function, different upvalue idx. */\n  } else {  /* Different functions, check disambiguation hash values. */\n    if (((refa->op2 ^ refb->op2) & 0xff))\n      return ALIAS_NO;  /* Upvalues with different hash values cannot alias. */\n    else\n      return ALIAS_MAY;  /* No conclusion can be drawn for same hash value. */\n  }\n}\n\n/* ULOAD forwarding. */\nTRef LJ_FASTCALL lj_opt_fwd_uload(jit_State *J)\n{\n  IRRef uref = fins->op1;\n  IRRef lim = uref;  /* Search limit. */\n  IRIns *xr = IR(uref);\n  IRRef ref;\n\n  /* Search for conflicting stores. */\n  ref = J->chain[IR_USTORE];\n  while (ref > uref) {\n    IRIns *store = IR(ref);\n    switch (aa_uref(xr, IR(store->op1))) {\n    case ALIAS_NO:   break;  /* Continue searching. */\n    case ALIAS_MAY:  lim = ref; goto cselim;  /* Limit search for load. */\n    case ALIAS_MUST: return store->op2;  /* Store forwarding. */\n    }\n    ref = store->prev;\n  }\n\ncselim:\n  /* Try to find a matching load. Below the conflicting store, if any. */\n  return lj_opt_cselim(J, lim);\n}\n\n/* USTORE elimination. */\nTRef LJ_FASTCALL lj_opt_dse_ustore(jit_State *J)\n{\n  IRRef xref = fins->op1;  /* xREF reference. */\n  IRRef val = fins->op2;  /* Stored value reference. */\n  IRIns *xr = IR(xref);\n  IRRef1 *refp = &J->chain[IR_USTORE];\n  IRRef ref = *refp;\n  while (ref > xref) {  /* Search for redundant or conflicting stores. */\n    IRIns *store = IR(ref);\n    switch (aa_uref(xr, IR(store->op1))) {\n    case ALIAS_NO:\n      break;  /* Continue searching. */\n    case ALIAS_MAY:\t/* Store to MAYBE the same location. */\n      if (store->op2 != val)  /* Conflict if the value is different. */\n\tgoto doemit;\n      break;  /* Otherwise continue searching. */\n    case ALIAS_MUST:\t/* Store to the same location. */\n      if (store->op2 == val)  /* Same value: drop the new store. */\n\treturn DROPFOLD;\n      /* Different value: try to eliminate the redundant store. */\n      if (ref > J->chain[IR_LOOP]) {  /* Quick check to avoid crossing LOOP. */\n\tIRIns *ir;\n\t/* Check for any intervening guards (includes conflicting loads). */\n\tfor (ir = IR(J->cur.nins-1); ir > store; ir--)\n\t  if (irt_isguard(ir->t))\n\t    goto doemit;  /* No elimination possible. */\n\t/* Remove redundant store from chain and replace with NOP. */\n\t*refp = store->prev;\n\tstore->o = IR_NOP;\n\tstore->t.irt = IRT_NIL;\n\tstore->op1 = store->op2 = 0;\n\tstore->prev = 0;\n\tif (ref+1 < J->cur.nins &&\n\t    store[1].o == IR_OBAR && store[1].op1 == xref) {\n\t  IRRef1 *bp = &J->chain[IR_OBAR];\n\t  IRIns *obar;\n\t  for (obar = IR(*bp); *bp > ref+1; obar = IR(*bp))\n\t    bp = &obar->prev;\n\t  /* Remove OBAR, too. */\n\t  *bp = obar->prev;\n\t  obar->o = IR_NOP;\n\t  obar->t.irt = IRT_NIL;\n\t  obar->op1 = obar->op2 = 0;\n\t  obar->prev = 0;\n\t}\n\t/* Now emit the new store instead. */\n      }\n      goto doemit;\n    }\n    ref = *(refp = &store->prev);\n  }\ndoemit:\n  return EMITFOLD;  /* Otherwise we have a conflict or simply no match. */\n}\n\n/* -- FLOAD forwarding and FSTORE elimination ----------------------------- */\n\n/* Alias analysis for field access.\n** Field loads are cheap and field stores are rare.\n** Simple disambiguation based on field types is good enough.\n*/\nstatic AliasRet aa_fref(jit_State *J, IRIns *refa, IRIns *refb)\n{\n  if (refa->op2 != refb->op2)\n    return ALIAS_NO;  /* Different fields. */\n  if (refa->op1 == refb->op1)\n    return ALIAS_MUST;  /* Same field, same object. */\n  else if (refa->op2 >= IRFL_TAB_META && refa->op2 <= IRFL_TAB_NOMM)\n    return aa_table(J, refa->op1, refb->op1);  /* Disambiguate tables. */\n  else\n    return ALIAS_MAY;  /* Same field, possibly different object. */\n}\n\n/* Only the loads for mutable fields end up here (see FOLD). */\nTRef LJ_FASTCALL lj_opt_fwd_fload(jit_State *J)\n{\n  IRRef oref = fins->op1;  /* Object reference. */\n  IRRef fid = fins->op2;  /* Field ID. */\n  IRRef lim = oref;  /* Search limit. */\n  IRRef ref;\n\n  /* Search for conflicting stores. */\n  ref = J->chain[IR_FSTORE];\n  while (ref > oref) {\n    IRIns *store = IR(ref);\n    switch (aa_fref(J, fins, IR(store->op1))) {\n    case ALIAS_NO:   break;  /* Continue searching. */\n    case ALIAS_MAY:  lim = ref; goto cselim;  /* Limit search for load. */\n    case ALIAS_MUST: return store->op2;  /* Store forwarding. */\n    }\n    ref = store->prev;\n  }\n\n  /* No conflicting store: const-fold field loads from allocations. */\n  if (fid == IRFL_TAB_META) {\n    IRIns *ir = IR(oref);\n    if (ir->o == IR_TNEW || ir->o == IR_TDUP)\n      return lj_ir_knull(J, IRT_TAB);\n  }\n\ncselim:\n  /* Try to find a matching load. Below the conflicting store, if any. */\n  return lj_opt_cselim(J, lim);\n}\n\n/* FSTORE elimination. */\nTRef LJ_FASTCALL lj_opt_dse_fstore(jit_State *J)\n{\n  IRRef fref = fins->op1;  /* FREF reference. */\n  IRRef val = fins->op2;  /* Stored value reference. */\n  IRIns *xr = IR(fref);\n  IRRef1 *refp = &J->chain[IR_FSTORE];\n  IRRef ref = *refp;\n  while (ref > fref) {  /* Search for redundant or conflicting stores. */\n    IRIns *store = IR(ref);\n    switch (aa_fref(J, xr, IR(store->op1))) {\n    case ALIAS_NO:\n      break;  /* Continue searching. */\n    case ALIAS_MAY:\n      if (store->op2 != val)  /* Conflict if the value is different. */\n\tgoto doemit;\n      break;  /* Otherwise continue searching. */\n    case ALIAS_MUST:\n      if (store->op2 == val)  /* Same value: drop the new store. */\n\treturn DROPFOLD;\n      /* Different value: try to eliminate the redundant store. */\n      if (ref > J->chain[IR_LOOP]) {  /* Quick check to avoid crossing LOOP. */\n\tIRIns *ir;\n\t/* Check for any intervening guards or conflicting loads. */\n\tfor (ir = IR(J->cur.nins-1); ir > store; ir--)\n\t  if (irt_isguard(ir->t) || (ir->o == IR_FLOAD && ir->op2 == xr->op2))\n\t    goto doemit;  /* No elimination possible. */\n\t/* Remove redundant store from chain and replace with NOP. */\n\t*refp = store->prev;\n\tstore->o = IR_NOP;\n\tstore->t.irt = IRT_NIL;\n\tstore->op1 = store->op2 = 0;\n\tstore->prev = 0;\n\t/* Now emit the new store instead. */\n      }\n      goto doemit;\n    }\n    ref = *(refp = &store->prev);\n  }\ndoemit:\n  return EMITFOLD;  /* Otherwise we have a conflict or simply no match. */\n}\n\n/* -- XLOAD forwarding and XSTORE elimination ----------------------------- */\n\n/* Find cdata allocation for a reference (if any). */\nstatic IRIns *aa_findcnew(jit_State *J, IRIns *ir)\n{\n  while (ir->o == IR_ADD) {\n    if (!irref_isk(ir->op1)) {\n      IRIns *ir1 = aa_findcnew(J, IR(ir->op1));  /* Left-recursion. */\n      if (ir1) return ir1;\n    }\n    if (irref_isk(ir->op2)) return NULL;\n    ir = IR(ir->op2);  /* Flatten right-recursion. */\n  }\n  return ir->o == IR_CNEW ? ir : NULL;\n}\n\n/* Alias analysis for two cdata allocations. */\nstatic AliasRet aa_cnew(jit_State *J, IRIns *refa, IRIns *refb)\n{\n  IRIns *cnewa = aa_findcnew(J, refa);\n  IRIns *cnewb = aa_findcnew(J, refb);\n  if (cnewa == cnewb)\n    return ALIAS_MAY;  /* Same allocation or neither is an allocation. */\n  if (cnewa && cnewb)\n    return ALIAS_NO;  /* Two different allocations never alias. */\n  if (cnewb) { cnewa = cnewb; refb = refa; }\n  return aa_escape(J, cnewa, refb);\n}\n\n/* Alias analysis for XLOAD/XSTORE. */\nstatic AliasRet aa_xref(jit_State *J, IRIns *refa, IRIns *xa, IRIns *xb)\n{\n  ptrdiff_t ofsa = 0, ofsb = 0;\n  IRIns *refb = IR(xb->op1);\n  IRIns *basea = refa, *baseb = refb;\n  if (refa == refb && irt_sametype(xa->t, xb->t))\n    return ALIAS_MUST;  /* Shortcut for same refs with identical type. */\n  /* Offset-based disambiguation. */\n  if (refa->o == IR_ADD && irref_isk(refa->op2)) {\n    IRIns *irk = IR(refa->op2);\n    basea = IR(refa->op1);\n    ofsa = (LJ_64 && irk->o == IR_KINT64) ? (ptrdiff_t)ir_k64(irk)->u64 :\n\t\t\t\t\t    (ptrdiff_t)irk->i;\n    if (basea == refb && ofsa != 0)\n      return ALIAS_NO;  /* base+-ofs vs. base. */\n  }\n  if (refb->o == IR_ADD && irref_isk(refb->op2)) {\n    IRIns *irk = IR(refb->op2);\n    baseb = IR(refb->op1);\n    ofsb = (LJ_64 && irk->o == IR_KINT64) ? (ptrdiff_t)ir_k64(irk)->u64 :\n\t\t\t\t\t    (ptrdiff_t)irk->i;\n    if (refa == baseb && ofsb != 0)\n      return ALIAS_NO;  /* base vs. base+-ofs. */\n  }\n  /* This implements (very) strict aliasing rules.\n  ** Different types do NOT alias, except for differences in signedness.\n  ** Type punning through unions is allowed (but forces a reload).\n  */\n  if (basea == baseb) {\n    ptrdiff_t sza = irt_size(xa->t), szb = irt_size(xb->t);\n    if (ofsa == ofsb) {\n      if (sza == szb && irt_isfp(xa->t) == irt_isfp(xb->t))\n\treturn ALIAS_MUST;  /* Same-sized, same-kind. May need to convert. */\n    } else if (ofsa + sza <= ofsb || ofsb + szb <= ofsa) {\n      return ALIAS_NO;  /* Non-overlapping base+-o1 vs. base+-o2. */\n    }\n    /* NYI: extract, extend or reinterpret bits (int <-> fp). */\n    return ALIAS_MAY;  /* Overlapping or type punning: force reload. */\n  }\n  if (!irt_sametype(xa->t, xb->t) &&\n      !(irt_typerange(xa->t, IRT_I8, IRT_U64) &&\n\t((xa->t.irt - IRT_I8) ^ (xb->t.irt - IRT_I8)) == 1))\n    return ALIAS_NO;\n  /* NYI: structural disambiguation. */\n  return aa_cnew(J, basea, baseb);  /* Try to disambiguate allocations. */\n}\n\n/* Return CSEd reference or 0. Caveat: swaps lower ref to the right! */\nstatic IRRef reassoc_trycse(jit_State *J, IROp op, IRRef op1, IRRef op2)\n{\n  IRRef ref = J->chain[op];\n  IRRef lim = op1;\n  if (op2 > lim) { lim = op2; op2 = op1; op1 = lim; }\n  while (ref > lim) {\n    IRIns *ir = IR(ref);\n    if (ir->op1 == op1 && ir->op2 == op2)\n      return ref;\n    ref = ir->prev;\n  }\n  return 0;\n}\n\n/* Reassociate index references. */\nstatic IRRef reassoc_xref(jit_State *J, IRIns *ir)\n{\n  ptrdiff_t ofs = 0;\n  if (ir->o == IR_ADD && irref_isk(ir->op2)) {  /* Get constant offset. */\n    IRIns *irk = IR(ir->op2);\n    ofs = (LJ_64 && irk->o == IR_KINT64) ? (ptrdiff_t)ir_k64(irk)->u64 :\n\t\t\t\t\t   (ptrdiff_t)irk->i;\n    ir = IR(ir->op1);\n  }\n  if (ir->o == IR_ADD) {  /* Add of base + index. */\n    /* Index ref > base ref for loop-carried dependences. Only check op1. */\n    IRIns *ir2, *ir1 = IR(ir->op1);\n    int32_t shift = 0;\n    IRRef idxref;\n    /* Determine index shifts. Don't bother with IR_MUL here. */\n    if (ir1->o == IR_BSHL && irref_isk(ir1->op2))\n      shift = IR(ir1->op2)->i;\n    else if (ir1->o == IR_ADD && ir1->op1 == ir1->op2)\n      shift = 1;\n    else\n      ir1 = ir;\n    ir2 = IR(ir1->op1);\n    /* A non-reassociated add. Must be a loop-carried dependence. */\n    if (ir2->o == IR_ADD && irt_isint(ir2->t) && irref_isk(ir2->op2))\n      ofs += (ptrdiff_t)IR(ir2->op2)->i << shift;\n    else\n      return 0;\n    idxref = ir2->op1;\n    /* Try to CSE the reassociated chain. Give up if not found. */\n    if (ir1 != ir &&\n\t!(idxref = reassoc_trycse(J, ir1->o, idxref,\n\t\t\t\t  ir1->o == IR_BSHL ? ir1->op2 : idxref)))\n      return 0;\n    if (!(idxref = reassoc_trycse(J, IR_ADD, idxref, ir->op2)))\n      return 0;\n    if (ofs != 0) {\n      IRRef refk = tref_ref(lj_ir_kintp(J, ofs));\n      if (!(idxref = reassoc_trycse(J, IR_ADD, idxref, refk)))\n\treturn 0;\n    }\n    return idxref;  /* Success, found a reassociated index reference. Phew. */\n  }\n  return 0;  /* Failure. */\n}\n\n/* XLOAD forwarding. */\nTRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J)\n{\n  IRRef xref = fins->op1;\n  IRIns *xr = IR(xref);\n  IRRef lim = xref;  /* Search limit. */\n  IRRef ref;\n\n  if ((fins->op2 & IRXLOAD_READONLY))\n    goto cselim;\n  if ((fins->op2 & IRXLOAD_VOLATILE))\n    goto doemit;\n\n  /* Search for conflicting stores. */\n  ref = J->chain[IR_XSTORE];\nretry:\n  if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];\n  if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR];\n  while (ref > lim) {\n    IRIns *store = IR(ref);\n    switch (aa_xref(J, xr, fins, store)) {\n    case ALIAS_NO:   break;  /* Continue searching. */\n    case ALIAS_MAY:  lim = ref; goto cselim;  /* Limit search for load. */\n    case ALIAS_MUST:\n      /* Emit conversion if the loaded type doesn't match the forwarded type. */\n      if (!irt_sametype(fins->t, IR(store->op2)->t)) {\n\tIRType st = irt_type(fins->t);\n\tif (st == IRT_I8 || st == IRT_I16) {  /* Trunc + sign-extend. */\n\t  st |= IRCONV_SEXT;\n\t} else if (st == IRT_U8 || st == IRT_U16) {  /* Trunc + zero-extend. */\n\t} else if (st == IRT_INT) {\n\t  st = irt_type(IR(store->op2)->t);  /* Needs dummy CONV.int.*. */\n\t} else {  /* I64/U64 are boxed, U32 is hidden behind a CONV.num.u32. */\n\t  goto store_fwd;\n\t}\n\tfins->ot = IRTI(IR_CONV);\n\tfins->op1 = store->op2;\n\tfins->op2 = (IRT_INT<<5)|st;\n\treturn RETRYFOLD;\n      }\n    store_fwd:\n      return store->op2;  /* Store forwarding. */\n    }\n    ref = store->prev;\n  }\n\ncselim:\n  /* Try to find a matching load. Below the conflicting store, if any. */\n  ref = J->chain[IR_XLOAD];\n  while (ref > lim) {\n    /* CSE for XLOAD depends on the type, but not on the IRXLOAD_* flags. */\n    if (IR(ref)->op1 == xref && irt_sametype(IR(ref)->t, fins->t))\n      return ref;\n    ref = IR(ref)->prev;\n  }\n\n  /* Reassociate XLOAD across PHIs to handle a[i-1] forwarding case. */\n  if (!(fins->op2 & IRXLOAD_READONLY) && J->chain[IR_LOOP] &&\n      xref == fins->op1 && (xref = reassoc_xref(J, xr)) != 0) {\n    ref = J->chain[IR_XSTORE];\n    while (ref > lim)  /* Skip stores that have already been checked. */\n      ref = IR(ref)->prev;\n    lim = xref;\n    xr = IR(xref);\n    goto retry;  /* Retry with the reassociated reference. */\n  }\ndoemit:\n  return EMITFOLD;\n}\n\n/* XSTORE elimination. */\nTRef LJ_FASTCALL lj_opt_dse_xstore(jit_State *J)\n{\n  IRRef xref = fins->op1;\n  IRIns *xr = IR(xref);\n  IRRef lim = xref;  /* Search limit. */\n  IRRef val = fins->op2;  /* Stored value reference. */\n  IRRef1 *refp = &J->chain[IR_XSTORE];\n  IRRef ref = *refp;\n  if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];\n  if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR];\n  while (ref > lim) {  /* Search for redundant or conflicting stores. */\n    IRIns *store = IR(ref);\n    switch (aa_xref(J, xr, fins, store)) {\n    case ALIAS_NO:\n      break;  /* Continue searching. */\n    case ALIAS_MAY:\n      if (store->op2 != val)  /* Conflict if the value is different. */\n\tgoto doemit;\n      break;  /* Otherwise continue searching. */\n    case ALIAS_MUST:\n      if (store->op2 == val)  /* Same value: drop the new store. */\n\treturn DROPFOLD;\n      /* Different value: try to eliminate the redundant store. */\n      if (ref > J->chain[IR_LOOP]) {  /* Quick check to avoid crossing LOOP. */\n\tIRIns *ir;\n\t/* Check for any intervening guards or any XLOADs (no AA performed). */\n\tfor (ir = IR(J->cur.nins-1); ir > store; ir--)\n\t  if (irt_isguard(ir->t) || ir->o == IR_XLOAD)\n\t    goto doemit;  /* No elimination possible. */\n\t/* Remove redundant store from chain and replace with NOP. */\n\t*refp = store->prev;\n\tstore->o = IR_NOP;\n\tstore->t.irt = IRT_NIL;\n\tstore->op1 = store->op2 = 0;\n\tstore->prev = 0;\n\t/* Now emit the new store instead. */\n      }\n      goto doemit;\n    }\n    ref = *(refp = &store->prev);\n  }\ndoemit:\n  return EMITFOLD;  /* Otherwise we have a conflict or simply no match. */\n}\n\n/* -- Forwarding of lj_tab_len -------------------------------------------- */\n\n/* This is rather simplistic right now, but better than nothing. */\nTRef LJ_FASTCALL lj_opt_fwd_tab_len(jit_State *J)\n{\n  IRRef tab = fins->op1;  /* Table reference. */\n  IRRef lim = tab;  /* Search limit. */\n  IRRef ref;\n\n  /* Any ASTORE is a conflict and limits the search. */\n  if (J->chain[IR_ASTORE] > lim) lim = J->chain[IR_ASTORE];\n\n  /* Search for conflicting HSTORE with numeric key. */\n  ref = J->chain[IR_HSTORE];\n  while (ref > lim) {\n    IRIns *store = IR(ref);\n    IRIns *href = IR(store->op1);\n    IRIns *key = IR(href->op2);\n    if (irt_isnum(key->o == IR_KSLOT ? IR(key->op1)->t : key->t)) {\n      lim = ref;  /* Conflicting store found, limits search for TLEN. */\n      break;\n    }\n    ref = store->prev;\n  }\n\n  /* Try to find a matching load. Below the conflicting store, if any. */\n  return lj_opt_cselim(J, lim);\n}\n\n/* -- ASTORE/HSTORE previous type analysis -------------------------------- */\n\n/* Check whether the previous value for a table store is non-nil.\n** This can be derived either from a previous store or from a previous\n** load (because all loads from tables perform a type check).\n**\n** The result of the analysis can be used to avoid the metatable check\n** and the guard against HREF returning niltv. Both of these are cheap,\n** so let's not spend too much effort on the analysis.\n**\n** A result of 1 is exact: previous value CANNOT be nil.\n** A result of 0 is inexact: previous value MAY be nil.\n*/\nint lj_opt_fwd_wasnonnil(jit_State *J, IROpT loadop, IRRef xref)\n{\n  /* First check stores. */\n  IRRef ref = J->chain[loadop+IRDELTA_L2S];\n  while (ref > xref) {\n    IRIns *store = IR(ref);\n    if (store->op1 == xref) {  /* Same xREF. */\n      /* A nil store MAY alias, but a non-nil store MUST alias. */\n      return !irt_isnil(store->t);\n    } else if (irt_isnil(store->t)) {  /* Must check any nil store. */\n      IRRef skref = IR(store->op1)->op2;\n      IRRef xkref = IR(xref)->op2;\n      /* Same key type MAY alias. Need ALOAD check due to multiple int types. */\n      if (loadop == IR_ALOAD || irt_sametype(IR(skref)->t, IR(xkref)->t)) {\n\tif (skref == xkref || !irref_isk(skref) || !irref_isk(xkref))\n\t  return 0;  /* A nil store with same const key or var key MAY alias. */\n\t/* Different const keys CANNOT alias. */\n      }  /* Different key types CANNOT alias. */\n    }  /* Other non-nil stores MAY alias. */\n    ref = store->prev;\n  }\n\n  /* Check loads since nothing could be derived from stores. */\n  ref = J->chain[loadop];\n  while (ref > xref) {\n    IRIns *load = IR(ref);\n    if (load->op1 == xref) {  /* Same xREF. */\n      /* A nil load MAY alias, but a non-nil load MUST alias. */\n      return !irt_isnil(load->t);\n    }  /* Other non-nil loads MAY alias. */\n    ref = load->prev;\n  }\n  return 0;  /* Nothing derived at all, previous value MAY be nil. */\n}\n\n/* ------------------------------------------------------------------------ */\n\n#undef IR\n#undef fins\n#undef fleft\n#undef fright\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_opt_narrow.c",
    "content": "/*\n** NARROW: Narrowing of numbers to integers (double to int32_t).\n** STRIPOV: Stripping of overflow checks.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_opt_narrow_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_bc.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#include \"lj_vm.h\"\n#include \"lj_strscan.h\"\n\n/* Rationale for narrowing optimizations:\n**\n** Lua has only a single number type and this is a FP double by default.\n** Narrowing doubles to integers does not pay off for the interpreter on a\n** current-generation x86/x64 machine. Most FP operations need the same\n** amount of execution resources as their integer counterparts, except\n** with slightly longer latencies. Longer latencies are a non-issue for\n** the interpreter, since they are usually hidden by other overhead.\n**\n** The total CPU execution bandwidth is the sum of the bandwidth of the FP\n** and the integer units, because they execute in parallel. The FP units\n** have an equal or higher bandwidth than the integer units. Not using\n** them means losing execution bandwidth. Moving work away from them to\n** the already quite busy integer units is a losing proposition.\n**\n** The situation for JIT-compiled code is a bit different: the higher code\n** density makes the extra latencies much more visible. Tight loops expose\n** the latencies for updating the induction variables. Array indexing\n** requires narrowing conversions with high latencies and additional\n** guards (to check that the index is really an integer). And many common\n** optimizations only work on integers.\n**\n** One solution would be speculative, eager narrowing of all number loads.\n** This causes many problems, like losing -0 or the need to resolve type\n** mismatches between traces. It also effectively forces the integer type\n** to have overflow-checking semantics. This impedes many basic\n** optimizations and requires adding overflow checks to all integer\n** arithmetic operations (whereas FP arithmetics can do without).\n**\n** Always replacing an FP op with an integer op plus an overflow check is\n** counter-productive on a current-generation super-scalar CPU. Although\n** the overflow check branches are highly predictable, they will clog the\n** execution port for the branch unit and tie up reorder buffers. This is\n** turning a pure data-flow dependency into a different data-flow\n** dependency (with slightly lower latency) *plus* a control dependency.\n** In general, you don't want to do this since latencies due to data-flow\n** dependencies can be well hidden by out-of-order execution.\n**\n** A better solution is to keep all numbers as FP values and only narrow\n** when it's beneficial to do so. LuaJIT uses predictive narrowing for\n** induction variables and demand-driven narrowing for index expressions,\n** integer arguments and bit operations. Additionally it can eliminate or\n** hoist most of the resulting overflow checks. Regular arithmetic\n** computations are never narrowed to integers.\n**\n** The integer type in the IR has convenient wrap-around semantics and\n** ignores overflow. Extra operations have been added for\n** overflow-checking arithmetic (ADDOV/SUBOV) instead of an extra type.\n** Apart from reducing overall complexity of the compiler, this also\n** nicely solves the problem where you want to apply algebraic\n** simplifications to ADD, but not to ADDOV. And the x86/x64 assembler can\n** use lea instead of an add for integer ADD, but not for ADDOV (lea does\n** not affect the flags, but it helps to avoid register moves).\n**\n**\n** All of the above has to be reconsidered for architectures with slow FP\n** operations or without a hardware FPU. The dual-number mode of LuaJIT\n** addresses this issue. Arithmetic operations are performed on integers\n** as far as possible and overflow checks are added as needed.\n**\n** This implies that narrowing for integer arguments and bit operations\n** should also strip overflow checks, e.g. replace ADDOV with ADD. The\n** original overflow guards are weak and can be eliminated by DCE, if\n** there's no other use.\n**\n** A slight twist is that it's usually beneficial to use overflow-checked\n** integer arithmetics if all inputs are already integers. This is the only\n** change that affects the single-number mode, too.\n*/\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t\t(&J->cur.ir[(ref)])\n#define fins\t\t\t(&J->fold.ins)\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n#define emitir_raw(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J))\n\n/* -- Elimination of narrowing type conversions --------------------------- */\n\n/* Narrowing of index expressions and bit operations is demand-driven. The\n** trace recorder emits a narrowing type conversion (CONV.int.num or TOBIT)\n** in all of these cases (e.g. array indexing or string indexing). FOLD\n** already takes care of eliminating simple redundant conversions like\n** CONV.int.num(CONV.num.int(x)) ==> x.\n**\n** But the surrounding code is FP-heavy and arithmetic operations are\n** performed on FP numbers (for the single-number mode). Consider a common\n** example such as 'x=t[i+1]', with 'i' already an integer (due to induction\n** variable narrowing). The index expression would be recorded as\n**   CONV.int.num(ADD(CONV.num.int(i), 1))\n** which is clearly suboptimal.\n**\n** One can do better by recursively backpropagating the narrowing type\n** conversion across FP arithmetic operations. This turns FP ops into\n** their corresponding integer counterparts. Depending on the semantics of\n** the conversion they also need to check for overflow. Currently only ADD\n** and SUB are supported.\n**\n** The above example can be rewritten as\n**   ADDOV(CONV.int.num(CONV.num.int(i)), 1)\n** and then into ADDOV(i, 1) after folding of the conversions. The original\n** FP ops remain in the IR and are eliminated by DCE since all references to\n** them are gone.\n**\n** [In dual-number mode the trace recorder already emits ADDOV etc., but\n** this can be further reduced. See below.]\n**\n** Special care has to be taken to avoid narrowing across an operation\n** which is potentially operating on non-integral operands. One obvious\n** case is when an expression contains a non-integral constant, but ends\n** up as an integer index at runtime (like t[x+1.5] with x=0.5).\n**\n** Operations with two non-constant operands illustrate a similar problem\n** (like t[a+b] with a=1.5 and b=2.5). Backpropagation has to stop there,\n** unless it can be proven that either operand is integral (e.g. by CSEing\n** a previous conversion). As a not-so-obvious corollary this logic also\n** applies for a whole expression tree (e.g. t[(a+1)+(b+1)]).\n**\n** Correctness of the transformation is guaranteed by avoiding to expand\n** the tree by adding more conversions than the one we would need to emit\n** if not backpropagating. TOBIT employs a more optimistic rule, because\n** the conversion has special semantics, designed to make the life of the\n** compiler writer easier. ;-)\n**\n** Using on-the-fly backpropagation of an expression tree doesn't work\n** because it's unknown whether the transform is correct until the end.\n** This either requires IR rollback and cache invalidation for every\n** subtree or a two-pass algorithm. The former didn't work out too well,\n** so the code now combines a recursive collector with a stack-based\n** emitter.\n**\n** [A recursive backpropagation algorithm with backtracking, employing\n** skip-list lookup and round-robin caching, emitting stack operations\n** on-the-fly for a stack-based interpreter -- and all of that in a meager\n** kilobyte? Yep, compilers are a great treasure chest. Throw away your\n** textbooks and read the codebase of a compiler today!]\n**\n** There's another optimization opportunity for array indexing: it's\n** always accompanied by an array bounds-check. The outermost overflow\n** check may be delegated to the ABC operation. This works because ABC is\n** an unsigned comparison and wrap-around due to overflow creates negative\n** numbers.\n**\n** But this optimization is only valid for constants that cannot overflow\n** an int32_t into the range of valid array indexes [0..2^27+1). A check\n** for +-2^30 is safe since -2^31 - 2^30 wraps to 2^30 and 2^31-1 + 2^30\n** wraps to -2^30-1.\n**\n** It's also good enough in practice, since e.g. t[i+1] or t[i-10] are\n** quite common. So the above example finally ends up as ADD(i, 1)!\n**\n** Later on, the assembler is able to fuse the whole array reference and\n** the ADD into the memory operands of loads and other instructions. This\n** is why LuaJIT is able to generate very pretty (and fast) machine code\n** for array indexing. And that, my dear, concludes another story about\n** one of the hidden secrets of LuaJIT ...\n*/\n\n/* Maximum backpropagation depth and maximum stack size. */\n#define NARROW_MAX_BACKPROP\t100\n#define NARROW_MAX_STACK\t256\n\n/* The stack machine has a 32 bit instruction format: [IROpT | IRRef1]\n** The lower 16 bits hold a reference (or 0). The upper 16 bits hold\n** the IR opcode + type or one of the following special opcodes:\n*/\nenum {\n  NARROW_REF,\t\t/* Push ref. */\n  NARROW_CONV,\t\t/* Push conversion of ref. */\n  NARROW_SEXT,\t\t/* Push sign-extension of ref. */\n  NARROW_INT\t\t/* Push KINT ref. The next code holds an int32_t. */\n};\n\ntypedef uint32_t NarrowIns;\n\n#define NARROWINS(op, ref)\t(((op) << 16) + (ref))\n#define narrow_op(ins)\t\t((IROpT)((ins) >> 16))\n#define narrow_ref(ins)\t\t((IRRef1)(ins))\n\n/* Context used for narrowing of type conversions. */\ntypedef struct NarrowConv {\n  jit_State *J;\t\t/* JIT compiler state. */\n  NarrowIns *sp;\t/* Current stack pointer. */\n  NarrowIns *maxsp;\t/* Maximum stack pointer minus redzone. */\n  int lim;\t\t/* Limit on the number of emitted conversions. */\n  IRRef mode;\t\t/* Conversion mode (IRCONV_*). */\n  IRType t;\t\t/* Destination type: IRT_INT or IRT_I64. */\n  NarrowIns stack[NARROW_MAX_STACK];  /* Stack holding stack-machine code. */\n} NarrowConv;\n\n/* Lookup a reference in the backpropagation cache. */\nstatic BPropEntry *narrow_bpc_get(jit_State *J, IRRef1 key, IRRef mode)\n{\n  ptrdiff_t i;\n  for (i = 0; i < BPROP_SLOTS; i++) {\n    BPropEntry *bp = &J->bpropcache[i];\n    /* Stronger checks are ok, too. */\n    if (bp->key == key && bp->mode >= mode &&\n\t((bp->mode ^ mode) & IRCONV_MODEMASK) == 0)\n      return bp;\n  }\n  return NULL;\n}\n\n/* Add an entry to the backpropagation cache. */\nstatic void narrow_bpc_set(jit_State *J, IRRef1 key, IRRef1 val, IRRef mode)\n{\n  uint32_t slot = J->bpropslot;\n  BPropEntry *bp = &J->bpropcache[slot];\n  J->bpropslot = (slot + 1) & (BPROP_SLOTS-1);\n  bp->key = key;\n  bp->val = val;\n  bp->mode = mode;\n}\n\n/* Backpropagate overflow stripping. */\nstatic void narrow_stripov_backprop(NarrowConv *nc, IRRef ref, int depth)\n{\n  jit_State *J = nc->J;\n  IRIns *ir = IR(ref);\n  if (ir->o == IR_ADDOV || ir->o == IR_SUBOV ||\n      (ir->o == IR_MULOV && (nc->mode & IRCONV_CONVMASK) == IRCONV_ANY)) {\n    BPropEntry *bp = narrow_bpc_get(nc->J, ref, IRCONV_TOBIT);\n    if (bp) {\n      ref = bp->val;\n    } else if (++depth < NARROW_MAX_BACKPROP && nc->sp < nc->maxsp) {\n      narrow_stripov_backprop(nc, ir->op1, depth);\n      narrow_stripov_backprop(nc, ir->op2, depth);\n      *nc->sp++ = NARROWINS(IRT(ir->o - IR_ADDOV + IR_ADD, IRT_INT), ref);\n      return;\n    }\n  }\n  *nc->sp++ = NARROWINS(NARROW_REF, ref);\n}\n\n/* Backpropagate narrowing conversion. Return number of needed conversions. */\nstatic int narrow_conv_backprop(NarrowConv *nc, IRRef ref, int depth)\n{\n  jit_State *J = nc->J;\n  IRIns *ir = IR(ref);\n  IRRef cref;\n\n  /* Check the easy cases first. */\n  if (ir->o == IR_CONV && (ir->op2 & IRCONV_SRCMASK) == IRT_INT) {\n    if ((nc->mode & IRCONV_CONVMASK) <= IRCONV_ANY)\n      narrow_stripov_backprop(nc, ir->op1, depth+1);\n    else\n      *nc->sp++ = NARROWINS(NARROW_REF, ir->op1);  /* Undo conversion. */\n    if (nc->t == IRT_I64)\n      *nc->sp++ = NARROWINS(NARROW_SEXT, 0);  /* Sign-extend integer. */\n    return 0;\n  } else if (ir->o == IR_KNUM) {  /* Narrow FP constant. */\n    lua_Number n = ir_knum(ir)->n;\n    if ((nc->mode & IRCONV_CONVMASK) == IRCONV_TOBIT) {\n      /* Allows a wider range of constants. */\n      int64_t k64 = (int64_t)n;\n      if (n == (lua_Number)k64) {  /* Only if const doesn't lose precision. */\n\t*nc->sp++ = NARROWINS(NARROW_INT, 0);\n\t*nc->sp++ = (NarrowIns)k64;  /* But always truncate to 32 bits. */\n\treturn 0;\n      }\n    } else {\n      int32_t k = lj_num2int(n);\n      /* Only if constant is a small integer. */\n      if (checki16(k) && n == (lua_Number)k) {\n\t*nc->sp++ = NARROWINS(NARROW_INT, 0);\n\t*nc->sp++ = (NarrowIns)k;\n\treturn 0;\n      }\n    }\n    return 10;  /* Never narrow other FP constants (this is rare). */\n  }\n\n  /* Try to CSE the conversion. Stronger checks are ok, too. */\n  cref = J->chain[fins->o];\n  while (cref > ref) {\n    IRIns *cr = IR(cref);\n    if (cr->op1 == ref &&\n\t(fins->o == IR_TOBIT ||\n\t ((cr->op2 & IRCONV_MODEMASK) == (nc->mode & IRCONV_MODEMASK) &&\n\t  irt_isguard(cr->t) >= irt_isguard(fins->t)))) {\n      *nc->sp++ = NARROWINS(NARROW_REF, cref);\n      return 0;  /* Already there, no additional conversion needed. */\n    }\n    cref = cr->prev;\n  }\n\n  /* Backpropagate across ADD/SUB. */\n  if (ir->o == IR_ADD || ir->o == IR_SUB) {\n    /* Try cache lookup first. */\n    IRRef mode = nc->mode;\n    BPropEntry *bp;\n    /* Inner conversions need a stronger check. */\n    if ((mode & IRCONV_CONVMASK) == IRCONV_INDEX && depth > 0)\n      mode += IRCONV_CHECK-IRCONV_INDEX;\n    bp = narrow_bpc_get(nc->J, (IRRef1)ref, mode);\n    if (bp) {\n      *nc->sp++ = NARROWINS(NARROW_REF, bp->val);\n      return 0;\n    } else if (nc->t == IRT_I64) {\n      /* Try sign-extending from an existing (checked) conversion to int. */\n      mode = (IRT_INT<<5)|IRT_NUM|IRCONV_INDEX;\n      bp = narrow_bpc_get(nc->J, (IRRef1)ref, mode);\n      if (bp) {\n\t*nc->sp++ = NARROWINS(NARROW_REF, bp->val);\n\t*nc->sp++ = NARROWINS(NARROW_SEXT, 0);\n\treturn 0;\n      }\n    }\n    if (++depth < NARROW_MAX_BACKPROP && nc->sp < nc->maxsp) {\n      NarrowIns *savesp = nc->sp;\n      int count = narrow_conv_backprop(nc, ir->op1, depth);\n      count += narrow_conv_backprop(nc, ir->op2, depth);\n      if (count <= nc->lim) {  /* Limit total number of conversions. */\n\t*nc->sp++ = NARROWINS(IRT(ir->o, nc->t), ref);\n\treturn count;\n      }\n      nc->sp = savesp;  /* Too many conversions, need to backtrack. */\n    }\n  }\n\n  /* Otherwise add a conversion. */\n  *nc->sp++ = NARROWINS(NARROW_CONV, ref);\n  return 1;\n}\n\n/* Emit the conversions collected during backpropagation. */\nstatic IRRef narrow_conv_emit(jit_State *J, NarrowConv *nc)\n{\n  /* The fins fields must be saved now -- emitir() overwrites them. */\n  IROpT guardot = irt_isguard(fins->t) ? IRTG(IR_ADDOV-IR_ADD, 0) : 0;\n  IROpT convot = fins->ot;\n  IRRef1 convop2 = fins->op2;\n  NarrowIns *next = nc->stack;  /* List of instructions from backpropagation. */\n  NarrowIns *last = nc->sp;\n  NarrowIns *sp = nc->stack;  /* Recycle the stack to store operands. */\n  while (next < last) {  /* Simple stack machine to process the ins. list. */\n    NarrowIns ref = *next++;\n    IROpT op = narrow_op(ref);\n    if (op == NARROW_REF) {\n      *sp++ = ref;\n    } else if (op == NARROW_CONV) {\n      *sp++ = emitir_raw(convot, ref, convop2);  /* Raw emit avoids a loop. */\n    } else if (op == NARROW_SEXT) {\n      lua_assert(sp >= nc->stack+1);\n      sp[-1] = emitir(IRT(IR_CONV, IRT_I64), sp[-1],\n\t\t      (IRT_I64<<5)|IRT_INT|IRCONV_SEXT);\n    } else if (op == NARROW_INT) {\n      lua_assert(next < last);\n      *sp++ = nc->t == IRT_I64 ?\n\t      lj_ir_kint64(J, (int64_t)(int32_t)*next++) :\n\t      lj_ir_kint(J, *next++);\n    } else {  /* Regular IROpT. Pops two operands and pushes one result. */\n      IRRef mode = nc->mode;\n      lua_assert(sp >= nc->stack+2);\n      sp--;\n      /* Omit some overflow checks for array indexing. See comments above. */\n      if ((mode & IRCONV_CONVMASK) == IRCONV_INDEX) {\n\tif (next == last && irref_isk(narrow_ref(sp[0])) &&\n\t  (uint32_t)IR(narrow_ref(sp[0]))->i + 0x40000000u < 0x80000000u)\n\t  guardot = 0;\n\telse  /* Otherwise cache a stronger check. */\n\t  mode += IRCONV_CHECK-IRCONV_INDEX;\n      }\n      sp[-1] = emitir(op+guardot, sp[-1], sp[0]);\n      /* Add to cache. */\n      if (narrow_ref(ref))\n\tnarrow_bpc_set(J, narrow_ref(ref), narrow_ref(sp[-1]), mode);\n    }\n  }\n  lua_assert(sp == nc->stack+1);\n  return nc->stack[0];\n}\n\n/* Narrow a type conversion of an arithmetic operation. */\nTRef LJ_FASTCALL lj_opt_narrow_convert(jit_State *J)\n{\n  if ((J->flags & JIT_F_OPT_NARROW)) {\n    NarrowConv nc;\n    nc.J = J;\n    nc.sp = nc.stack;\n    nc.maxsp = &nc.stack[NARROW_MAX_STACK-4];\n    nc.t = irt_type(fins->t);\n    if (fins->o == IR_TOBIT) {\n      nc.mode = IRCONV_TOBIT;  /* Used only in the backpropagation cache. */\n      nc.lim = 2;  /* TOBIT can use a more optimistic rule. */\n    } else {\n      nc.mode = fins->op2;\n      nc.lim = 1;\n    }\n    if (narrow_conv_backprop(&nc, fins->op1, 0) <= nc.lim)\n      return narrow_conv_emit(J, &nc);\n  }\n  return NEXTFOLD;\n}\n\n/* -- Narrowing of implicit conversions ----------------------------------- */\n\n/* Recursively strip overflow checks. */\nstatic TRef narrow_stripov(jit_State *J, TRef tr, int lastop, IRRef mode)\n{\n  IRRef ref = tref_ref(tr);\n  IRIns *ir = IR(ref);\n  int op = ir->o;\n  if (op >= IR_ADDOV && op <= lastop) {\n    BPropEntry *bp = narrow_bpc_get(J, ref, mode);\n    if (bp) {\n      return TREF(bp->val, irt_t(IR(bp->val)->t));\n    } else {\n      IRRef op1 = ir->op1, op2 = ir->op2;  /* The IR may be reallocated. */\n      op1 = narrow_stripov(J, op1, lastop, mode);\n      op2 = narrow_stripov(J, op2, lastop, mode);\n      tr = emitir(IRT(op - IR_ADDOV + IR_ADD,\n\t\t      ((mode & IRCONV_DSTMASK) >> IRCONV_DSH)), op1, op2);\n      narrow_bpc_set(J, ref, tref_ref(tr), mode);\n    }\n  } else if (LJ_64 && (mode & IRCONV_SEXT) && !irt_is64(ir->t)) {\n    tr = emitir(IRT(IR_CONV, IRT_INTP), tr, mode);\n  }\n  return tr;\n}\n\n/* Narrow array index. */\nTRef LJ_FASTCALL lj_opt_narrow_index(jit_State *J, TRef tr)\n{\n  IRIns *ir;\n  lua_assert(tref_isnumber(tr));\n  if (tref_isnum(tr))  /* Conversion may be narrowed, too. See above. */\n    return emitir(IRTGI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_INDEX);\n  /* Omit some overflow checks for array indexing. See comments above. */\n  ir = IR(tref_ref(tr));\n  if ((ir->o == IR_ADDOV || ir->o == IR_SUBOV) && irref_isk(ir->op2) &&\n      (uint32_t)IR(ir->op2)->i + 0x40000000u < 0x80000000u)\n    return emitir(IRTI(ir->o - IR_ADDOV + IR_ADD), ir->op1, ir->op2);\n  return tr;\n}\n\n/* Narrow conversion to integer operand (overflow undefined). */\nTRef LJ_FASTCALL lj_opt_narrow_toint(jit_State *J, TRef tr)\n{\n  if (tref_isstr(tr))\n    tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0);\n  if (tref_isnum(tr))  /* Conversion may be narrowed, too. See above. */\n    return emitir(IRTI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_ANY);\n  if (!tref_isinteger(tr))\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  /*\n  ** Undefined overflow semantics allow stripping of ADDOV, SUBOV and MULOV.\n  ** Use IRCONV_TOBIT for the cache entries, since the semantics are the same.\n  */\n  return narrow_stripov(J, tr, IR_MULOV, (IRT_INT<<5)|IRT_INT|IRCONV_TOBIT);\n}\n\n/* Narrow conversion to bitop operand (overflow wrapped). */\nTRef LJ_FASTCALL lj_opt_narrow_tobit(jit_State *J, TRef tr)\n{\n  if (tref_isstr(tr))\n    tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0);\n  if (tref_isnum(tr))  /* Conversion may be narrowed, too. See above. */\n    return emitir(IRTI(IR_TOBIT), tr, lj_ir_knum_tobit(J));\n  if (!tref_isinteger(tr))\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  /*\n  ** Wrapped overflow semantics allow stripping of ADDOV and SUBOV.\n  ** MULOV cannot be stripped due to precision widening.\n  */\n  return narrow_stripov(J, tr, IR_SUBOV, (IRT_INT<<5)|IRT_INT|IRCONV_TOBIT);\n}\n\n#if LJ_HASFFI\n/* Narrow C array index (overflow undefined). */\nTRef LJ_FASTCALL lj_opt_narrow_cindex(jit_State *J, TRef tr)\n{\n  lua_assert(tref_isnumber(tr));\n  if (tref_isnum(tr))\n    return emitir(IRT(IR_CONV, IRT_INTP), tr,\n\t\t  (IRT_INTP<<5)|IRT_NUM|IRCONV_TRUNC|IRCONV_ANY);\n  /* Undefined overflow semantics allow stripping of ADDOV, SUBOV and MULOV. */\n  return narrow_stripov(J, tr, IR_MULOV,\n\t\t\tLJ_64 ? ((IRT_INTP<<5)|IRT_INT|IRCONV_SEXT) :\n\t\t\t\t((IRT_INTP<<5)|IRT_INT|IRCONV_TOBIT));\n}\n#endif\n\n/* -- Narrowing of arithmetic operators ----------------------------------- */\n\n/* Check whether a number fits into an int32_t (-0 is ok, too). */\nstatic int numisint(lua_Number n)\n{\n  return (n == (lua_Number)lj_num2int(n));\n}\n\n/* Narrowing of arithmetic operations. */\nTRef lj_opt_narrow_arith(jit_State *J, TRef rb, TRef rc,\n\t\t\t TValue *vb, TValue *vc, IROp op)\n{\n  if (tref_isstr(rb)) {\n    rb = emitir(IRTG(IR_STRTO, IRT_NUM), rb, 0);\n    lj_strscan_num(strV(vb), vb);\n  }\n  if (tref_isstr(rc)) {\n    rc = emitir(IRTG(IR_STRTO, IRT_NUM), rc, 0);\n    lj_strscan_num(strV(vc), vc);\n  }\n  /* Must not narrow MUL in non-DUALNUM variant, because it loses -0. */\n  if ((op >= IR_ADD && op <= (LJ_DUALNUM ? IR_MUL : IR_SUB)) &&\n      tref_isinteger(rb) && tref_isinteger(rc) &&\n      numisint(lj_vm_foldarith(numberVnum(vb), numberVnum(vc),\n\t\t\t       (int)op - (int)IR_ADD)))\n    return emitir(IRTGI((int)op - (int)IR_ADD + (int)IR_ADDOV), rb, rc);\n  if (!tref_isnum(rb)) rb = emitir(IRTN(IR_CONV), rb, IRCONV_NUM_INT);\n  if (!tref_isnum(rc)) rc = emitir(IRTN(IR_CONV), rc, IRCONV_NUM_INT);\n  return emitir(IRTN(op), rb, rc);\n}\n\n/* Narrowing of unary minus operator. */\nTRef lj_opt_narrow_unm(jit_State *J, TRef rc, TValue *vc)\n{\n  if (tref_isstr(rc)) {\n    rc = emitir(IRTG(IR_STRTO, IRT_NUM), rc, 0);\n    lj_strscan_num(strV(vc), vc);\n  }\n  if (tref_isinteger(rc)) {\n    if ((uint32_t)numberVint(vc) != 0x80000000u)\n      return emitir(IRTGI(IR_SUBOV), lj_ir_kint(J, 0), rc);\n    rc = emitir(IRTN(IR_CONV), rc, IRCONV_NUM_INT);\n  }\n  return emitir(IRTN(IR_NEG), rc, lj_ir_knum_neg(J));\n}\n\n/* Narrowing of modulo operator. */\nTRef lj_opt_narrow_mod(jit_State *J, TRef rb, TRef rc, TValue *vc)\n{\n  TRef tmp;\n  if (tvisstr(vc) && !lj_strscan_num(strV(vc), vc))\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  if ((LJ_DUALNUM || (J->flags & JIT_F_OPT_NARROW)) &&\n      tref_isinteger(rb) && tref_isinteger(rc) &&\n      (tvisint(vc) ? intV(vc) != 0 : !tviszero(vc))) {\n    emitir(IRTGI(IR_NE), rc, lj_ir_kint(J, 0));\n    return emitir(IRTI(IR_MOD), rb, rc);\n  }\n  /* b % c ==> b - floor(b/c)*c */\n  rb = lj_ir_tonum(J, rb);\n  rc = lj_ir_tonum(J, rc);\n  tmp = emitir(IRTN(IR_DIV), rb, rc);\n  tmp = emitir(IRTN(IR_FPMATH), tmp, IRFPM_FLOOR);\n  tmp = emitir(IRTN(IR_MUL), tmp, rc);\n  return emitir(IRTN(IR_SUB), rb, tmp);\n}\n\n/* Narrowing of power operator or math.pow. */\nTRef lj_opt_narrow_pow(jit_State *J, TRef rb, TRef rc, TValue *vc)\n{\n  if (tvisstr(vc) && !lj_strscan_num(strV(vc), vc))\n    lj_trace_err(J, LJ_TRERR_BADTYPE);\n  /* Narrowing must be unconditional to preserve (-x)^i semantics. */\n  if (tvisint(vc) || numisint(numV(vc))) {\n    int checkrange = 0;\n    /* Split pow is faster for bigger exponents. But do this only for (+k)^i. */\n    if (tref_isk(rb) && (int32_t)ir_knum(IR(tref_ref(rb)))->u32.hi >= 0) {\n      int32_t k = numberVint(vc);\n      if (!(k >= -65536 && k <= 65536)) goto split_pow;\n      checkrange = 1;\n    }\n    if (!tref_isinteger(rc)) {\n      if (tref_isstr(rc))\n\trc = emitir(IRTG(IR_STRTO, IRT_NUM), rc, 0);\n      /* Guarded conversion to integer! */\n      rc = emitir(IRTGI(IR_CONV), rc, IRCONV_INT_NUM|IRCONV_CHECK);\n    }\n    if (checkrange && !tref_isk(rc)) {  /* Range guard: -65536 <= i <= 65536 */\n      TRef tmp = emitir(IRTI(IR_ADD), rc, lj_ir_kint(J, 65536));\n      emitir(IRTGI(IR_ULE), tmp, lj_ir_kint(J, 2*65536));\n    }\n    return emitir(IRTN(IR_POW), rb, rc);\n  }\nsplit_pow:\n  /* FOLD covers most cases, but some are easier to do here. */\n  if (tref_isk(rb) && tvispone(ir_knum(IR(tref_ref(rb)))))\n    return rb;  /* 1 ^ x ==> 1 */\n  rc = lj_ir_tonum(J, rc);\n  if (tref_isk(rc) && ir_knum(IR(tref_ref(rc)))->n == 0.5)\n    return emitir(IRTN(IR_FPMATH), rb, IRFPM_SQRT);  /* x ^ 0.5 ==> sqrt(x) */\n  /* Split up b^c into exp2(c*log2(b)). Assembler may rejoin later. */\n  rb = emitir(IRTN(IR_FPMATH), rb, IRFPM_LOG2);\n  rc = emitir(IRTN(IR_MUL), rb, rc);\n  return emitir(IRTN(IR_FPMATH), rc, IRFPM_EXP2);\n}\n\n/* -- Predictive narrowing of induction variables ------------------------- */\n\n/* Narrow a single runtime value. */\nstatic int narrow_forl(jit_State *J, cTValue *o)\n{\n  if (tvisint(o)) return 1;\n  if (LJ_DUALNUM || (J->flags & JIT_F_OPT_NARROW)) return numisint(numV(o));\n  return 0;\n}\n\n/* Narrow the FORL index type by looking at the runtime values. */\nIRType lj_opt_narrow_forl(jit_State *J, cTValue *tv)\n{\n  lua_assert(tvisnumber(&tv[FORL_IDX]) &&\n\t     tvisnumber(&tv[FORL_STOP]) &&\n\t     tvisnumber(&tv[FORL_STEP]));\n  /* Narrow only if the runtime values of start/stop/step are all integers. */\n  if (narrow_forl(J, &tv[FORL_IDX]) &&\n      narrow_forl(J, &tv[FORL_STOP]) &&\n      narrow_forl(J, &tv[FORL_STEP])) {\n    /* And if the loop index can't possibly overflow. */\n    lua_Number step = numberVnum(&tv[FORL_STEP]);\n    lua_Number sum = numberVnum(&tv[FORL_STOP]) + step;\n    if (0 <= step ? (sum <= 2147483647.0) : (sum >= -2147483648.0))\n      return IRT_INT;\n  }\n  return IRT_NUM;\n}\n\n#undef IR\n#undef fins\n#undef emitir\n#undef emitir_raw\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_opt_sink.c",
    "content": "/*\n** SINK: Allocation Sinking and Store Sinking.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_opt_sink_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n#include \"lj_target.h\"\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t(&J->cur.ir[(ref)])\n\n/* Check whether the store ref points to an eligible allocation. */\nstatic IRIns *sink_checkalloc(jit_State *J, IRIns *irs)\n{\n  IRIns *ir = IR(irs->op1);\n  if (!irref_isk(ir->op2))\n    return NULL;  /* Non-constant key. */\n  if (ir->o == IR_HREFK || ir->o == IR_AREF)\n    ir = IR(ir->op1);\n  else if (!(ir->o == IR_HREF || ir->o == IR_NEWREF ||\n\t     ir->o == IR_FREF || ir->o == IR_ADD))\n    return NULL;  /* Unhandled reference type (for XSTORE). */\n  ir = IR(ir->op1);\n  if (!(ir->o == IR_TNEW || ir->o == IR_TDUP || ir->o == IR_CNEW))\n    return NULL;  /* Not an allocation. */\n  return ir;  /* Return allocation. */\n}\n\n/* Recursively check whether a value depends on a PHI. */\nstatic int sink_phidep(jit_State *J, IRRef ref)\n{\n  IRIns *ir = IR(ref);\n  if (irt_isphi(ir->t)) return 1;\n  if (ir->op1 >= REF_FIRST && sink_phidep(J, ir->op1)) return 1;\n  if (ir->op2 >= REF_FIRST && sink_phidep(J, ir->op2)) return 1;\n  return 0;\n}\n\n/* Check whether a value is a sinkable PHI or loop-invariant. */\nstatic int sink_checkphi(jit_State *J, IRIns *ira, IRRef ref)\n{\n  if (ref >= REF_FIRST) {\n    IRIns *ir = IR(ref);\n    if (irt_isphi(ir->t) || (ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT &&\n\t\t\t     irt_isphi(IR(ir->op1)->t))) {\n      ira->prev++;\n      return 1;  /* Sinkable PHI. */\n    }\n    /* Otherwise the value must be loop-invariant. */\n    return ref < J->loopref && !sink_phidep(J, ref);\n  }\n  return 1;  /* Constant (non-PHI). */\n}\n\n/* Mark non-sinkable allocations using single-pass backward propagation.\n**\n** Roots for the marking process are:\n** - Some PHIs or snapshots (see below).\n** - Non-PHI, non-constant values stored to PHI allocations.\n** - All guards.\n** - Any remaining loads not eliminated by store-to-load forwarding.\n** - Stores with non-constant keys.\n** - All stored values.\n*/\nstatic void sink_mark_ins(jit_State *J)\n{\n  IRIns *ir, *irlast = IR(J->cur.nins-1);\n  for (ir = irlast ; ; ir--) {\n    switch (ir->o) {\n    case IR_BASE:\n      return;  /* Finished. */\n    case IR_CALLL:  /* IRCALL_lj_tab_len */\n    case IR_ALOAD: case IR_HLOAD: case IR_XLOAD: case IR_TBAR:\n      irt_setmark(IR(ir->op1)->t);  /* Mark ref for remaining loads. */\n      break;\n    case IR_FLOAD:\n      if (irt_ismarked(ir->t) || ir->op2 == IRFL_TAB_META)\n\tirt_setmark(IR(ir->op1)->t);  /* Mark table for remaining loads. */\n      break;\n    case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: {\n      IRIns *ira = sink_checkalloc(J, ir);\n      if (!ira || (irt_isphi(ira->t) && !sink_checkphi(J, ira, ir->op2)))\n\tirt_setmark(IR(ir->op1)->t);  /* Mark ineligible ref. */\n      irt_setmark(IR(ir->op2)->t);  /* Mark stored value. */\n      break;\n      }\n#if LJ_HASFFI\n    case IR_CNEWI:\n      if (irt_isphi(ir->t) &&\n\t  (!sink_checkphi(J, ir, ir->op2) ||\n\t   (LJ_32 && ir+1 < irlast && (ir+1)->o == IR_HIOP &&\n\t    !sink_checkphi(J, ir, (ir+1)->op2))))\n\tirt_setmark(ir->t);  /* Mark ineligible allocation. */\n      /* fallthrough */\n#endif\n    case IR_USTORE:\n      irt_setmark(IR(ir->op2)->t);  /* Mark stored value. */\n      break;\n#if LJ_HASFFI\n    case IR_CALLXS:\n#endif\n    case IR_CALLS:\n      irt_setmark(IR(ir->op1)->t);  /* Mark (potentially) stored values. */\n      break;\n    case IR_PHI: {\n      IRIns *irl = IR(ir->op1), *irr = IR(ir->op2);\n      irl->prev = irr->prev = 0;  /* Clear PHI value counts. */\n      if (irl->o == irr->o &&\n\t  (irl->o == IR_TNEW || irl->o == IR_TDUP ||\n\t   (LJ_HASFFI && (irl->o == IR_CNEW || irl->o == IR_CNEWI))))\n\tbreak;\n      irt_setmark(irl->t);\n      irt_setmark(irr->t);\n      break;\n      }\n    default:\n      if (irt_ismarked(ir->t) || irt_isguard(ir->t)) {  /* Propagate mark. */\n\tif (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t);\n\tif (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t);\n      }\n      break;\n    }\n  }\n}\n\n/* Mark all instructions referenced by a snapshot. */\nstatic void sink_mark_snap(jit_State *J, SnapShot *snap)\n{\n  SnapEntry *map = &J->cur.snapmap[snap->mapofs];\n  MSize n, nent = snap->nent;\n  for (n = 0; n < nent; n++) {\n    IRRef ref = snap_ref(map[n]);\n    if (!irref_isk(ref))\n      irt_setmark(IR(ref)->t);\n  }\n}\n\n/* Iteratively remark PHI refs with differing marks or PHI value counts. */\nstatic void sink_remark_phi(jit_State *J)\n{\n  IRIns *ir;\n  int remark;\n  do {\n    remark = 0;\n    for (ir = IR(J->cur.nins-1); ir->o == IR_PHI; ir--) {\n      IRIns *irl = IR(ir->op1), *irr = IR(ir->op2);\n      if (((irl->t.irt ^ irr->t.irt) & IRT_MARK))\n\tremark = 1;\n      else if (irl->prev == irr->prev)\n\tcontinue;\n      irt_setmark(IR(ir->op1)->t);\n      irt_setmark(IR(ir->op2)->t);\n    }\n  } while (remark);\n}\n\n/* Sweep instructions and tag sunken allocations and stores. */\nstatic void sink_sweep_ins(jit_State *J)\n{\n  IRIns *ir, *irfirst = IR(J->cur.nk);\n  for (ir = IR(J->cur.nins-1) ; ir >= irfirst; ir--) {\n    switch (ir->o) {\n    case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: {\n      IRIns *ira = sink_checkalloc(J, ir);\n      if (ira && !irt_ismarked(ira->t)) {\n\tint delta = (int)(ir - ira);\n\tir->prev = REGSP(RID_SINK, delta > 255 ? 255 : delta);\n      } else {\n\tir->prev = REGSP_INIT;\n      }\n      break;\n      }\n    case IR_NEWREF:\n      if (!irt_ismarked(IR(ir->op1)->t)) {\n\tir->prev = REGSP(RID_SINK, 0);\n      } else {\n\tirt_clearmark(ir->t);\n\tir->prev = REGSP_INIT;\n      }\n      break;\n#if LJ_HASFFI\n    case IR_CNEW: case IR_CNEWI:\n#endif\n    case IR_TNEW: case IR_TDUP:\n      if (!irt_ismarked(ir->t)) {\n\tir->t.irt &= ~IRT_GUARD;\n\tir->prev = REGSP(RID_SINK, 0);\n\tJ->cur.sinktags = 1;  /* Signal present SINK tags to assembler. */\n      } else {\n\tirt_clearmark(ir->t);\n\tir->prev = REGSP_INIT;\n      }\n      break;\n    case IR_PHI: {\n      IRIns *ira = IR(ir->op2);\n      if (!irt_ismarked(ira->t) &&\n\t  (ira->o == IR_TNEW || ira->o == IR_TDUP ||\n\t   (LJ_HASFFI && (ira->o == IR_CNEW || ira->o == IR_CNEWI)))) {\n\tir->prev = REGSP(RID_SINK, 0);\n      } else {\n\tir->prev = REGSP_INIT;\n      }\n      break;\n      }\n    default:\n      irt_clearmark(ir->t);\n      ir->prev = REGSP_INIT;\n      break;\n    }\n  }\n}\n\n/* Allocation sinking and store sinking.\n**\n** 1. Mark all non-sinkable allocations.\n** 2. Then sink all remaining allocations and the related stores.\n*/\nvoid lj_opt_sink(jit_State *J)\n{\n  const uint32_t need = (JIT_F_OPT_SINK|JIT_F_OPT_FWD|\n\t\t\t JIT_F_OPT_DCE|JIT_F_OPT_CSE|JIT_F_OPT_FOLD);\n  if ((J->flags & need) == need &&\n      (J->chain[IR_TNEW] || J->chain[IR_TDUP] ||\n       (LJ_HASFFI && (J->chain[IR_CNEW] || J->chain[IR_CNEWI])))) {\n    if (!J->loopref)\n      sink_mark_snap(J, &J->cur.snap[J->cur.nsnap-1]);\n    sink_mark_ins(J);\n    if (J->loopref)\n      sink_remark_phi(J);\n    sink_sweep_ins(J);\n  }\n}\n\n#undef IR\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_opt_split.c",
    "content": "/*\n** SPLIT: Split 64 bit IR instructions into 32 bit IR instructions.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_opt_split_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT && (LJ_SOFTFP || (LJ_32 && LJ_HASFFI))\n\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_ircall.h\"\n#include \"lj_iropt.h\"\n#include \"lj_vm.h\"\n\n/* SPLIT pass:\n**\n** This pass splits up 64 bit IR instructions into multiple 32 bit IR\n** instructions. It's only active for soft-float targets or for 32 bit CPUs\n** which lack native 64 bit integer operations (the FFI is currently the\n** only emitter for 64 bit integer instructions).\n**\n** Splitting the IR in a separate pass keeps each 32 bit IR assembler\n** backend simple. Only a small amount of extra functionality needs to be\n** implemented. This is much easier than adding support for allocating\n** register pairs to each backend (believe me, I tried). A few simple, but\n** important optimizations can be performed by the SPLIT pass, which would\n** be tedious to do in the backend.\n**\n** The basic idea is to replace each 64 bit IR instruction with its 32 bit\n** equivalent plus an extra HIOP instruction. The splitted IR is not passed\n** through FOLD or any other optimizations, so each HIOP is guaranteed to\n** immediately follow it's counterpart. The actual functionality of HIOP is\n** inferred from the previous instruction.\n**\n** The operands of HIOP hold the hiword input references. The output of HIOP\n** is the hiword output reference, which is also used to hold the hiword\n** register or spill slot information. The register allocator treats this\n** instruction independently of any other instruction, which improves code\n** quality compared to using fixed register pairs.\n**\n** It's easier to split up some instructions into two regular 32 bit\n** instructions. E.g. XLOAD is split up into two XLOADs with two different\n** addresses. Obviously 64 bit constants need to be split up into two 32 bit\n** constants, too. Some hiword instructions can be entirely omitted, e.g.\n** when zero-extending a 32 bit value to 64 bits. 64 bit arguments for calls\n** are split up into two 32 bit arguments each.\n**\n** On soft-float targets, floating-point instructions are directly converted\n** to soft-float calls by the SPLIT pass (except for comparisons and MIN/MAX).\n** HIOP for number results has the type IRT_SOFTFP (\"sfp\" in -jdump).\n**\n** Here's the IR and x64 machine code for 'x.b = x.a + 1' for a struct with\n** two int64_t fields:\n**\n** 0100    p32 ADD    base  +8\n** 0101    i64 XLOAD  0100\n** 0102    i64 ADD    0101  +1\n** 0103    p32 ADD    base  +16\n** 0104    i64 XSTORE 0103  0102\n**\n**         mov rax, [esi+0x8]\n**         add rax, +0x01\n**         mov [esi+0x10], rax\n**\n** Here's the transformed IR and the x86 machine code after the SPLIT pass:\n**\n** 0100    p32 ADD    base  +8\n** 0101    int XLOAD  0100\n** 0102    p32 ADD    base  +12\n** 0103    int XLOAD  0102\n** 0104    int ADD    0101  +1\n** 0105    int HIOP   0103  +0\n** 0106    p32 ADD    base  +16\n** 0107    int XSTORE 0106  0104\n** 0108    int HIOP   0106  0105\n**\n**         mov eax, [esi+0x8]\n**         mov ecx, [esi+0xc]\n**         add eax, +0x01\n**         adc ecx, +0x00\n**         mov [esi+0x10], eax\n**         mov [esi+0x14], ecx\n**\n** You may notice the reassociated hiword address computation, which is\n** later fused into the mov operands by the assembler.\n*/\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t(&J->cur.ir[(ref)])\n\n/* Directly emit the transformed IR without updating chains etc. */\nstatic IRRef split_emit(jit_State *J, uint16_t ot, IRRef1 op1, IRRef1 op2)\n{\n  IRRef nref = lj_ir_nextins(J);\n  IRIns *ir = IR(nref);\n  ir->ot = ot;\n  ir->op1 = op1;\n  ir->op2 = op2;\n  return nref;\n}\n\n#if LJ_SOFTFP\n/* Emit a (checked) number to integer conversion. */\nstatic IRRef split_num2int(jit_State *J, IRRef lo, IRRef hi, int check)\n{\n  IRRef tmp, res;\n#if LJ_LE\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), lo, hi);\n#else\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hi, lo);\n#endif\n  res = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_softfp_d2i);\n  if (check) {\n    tmp = split_emit(J, IRTI(IR_CALLN), res, IRCALL_softfp_i2d);\n    split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp);\n    split_emit(J, IRTGI(IR_EQ), tmp, lo);\n    split_emit(J, IRTG(IR_HIOP, IRT_SOFTFP), tmp+1, hi);\n  }\n  return res;\n}\n\n/* Emit a CALLN with one split 64 bit argument. */\nstatic IRRef split_call_l(jit_State *J, IRRef1 *hisubst, IRIns *oir,\n\t\t\t  IRIns *ir, IRCallID id)\n{\n  IRRef tmp, op1 = ir->op1;\n  J->cur.nins--;\n#if LJ_LE\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]);\n#else\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev);\n#endif\n  ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, id);\n  return split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp);\n}\n\n/* Emit a CALLN with one split 64 bit argument and a 32 bit argument. */\nstatic IRRef split_call_li(jit_State *J, IRRef1 *hisubst, IRIns *oir,\n\t\t\t   IRIns *ir, IRCallID id)\n{\n  IRRef tmp, op1 = ir->op1, op2 = ir->op2;\n  J->cur.nins--;\n#if LJ_LE\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]);\n#else\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev);\n#endif\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, oir[op2].prev);\n  ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, id);\n  return split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp);\n}\n#endif\n\n/* Emit a CALLN with two split 64 bit arguments. */\nstatic IRRef split_call_ll(jit_State *J, IRRef1 *hisubst, IRIns *oir,\n\t\t\t   IRIns *ir, IRCallID id)\n{\n  IRRef tmp, op1 = ir->op1, op2 = ir->op2;\n  J->cur.nins--;\n#if LJ_LE\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]);\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, oir[op2].prev);\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, hisubst[op2]);\n#else\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev);\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, hisubst[op2]);\n  tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, oir[op2].prev);\n#endif\n  ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, id);\n  return split_emit(J,\n    IRT(IR_HIOP, (LJ_SOFTFP && irt_isnum(ir->t)) ? IRT_SOFTFP : IRT_INT),\n    tmp, tmp);\n}\n\n/* Get a pointer to the other 32 bit word (LE: hiword, BE: loword). */\nstatic IRRef split_ptr(jit_State *J, IRIns *oir, IRRef ref)\n{\n  IRRef nref = oir[ref].prev;\n  IRIns *ir = IR(nref);\n  int32_t ofs = 4;\n  if (ir->o == IR_KPTR)\n    return lj_ir_kptr(J, (char *)ir_kptr(ir) + ofs);\n  if (ir->o == IR_ADD && irref_isk(ir->op2) && !irt_isphi(oir[ref].t)) {\n    /* Reassociate address. */\n    ofs += IR(ir->op2)->i;\n    nref = ir->op1;\n    if (ofs == 0) return nref;\n  }\n  return split_emit(J, IRTI(IR_ADD), nref, lj_ir_kint(J, ofs));\n}\n\n/* Transform the old IR to the new IR. */\nstatic void split_ir(jit_State *J)\n{\n  IRRef nins = J->cur.nins, nk = J->cur.nk;\n  MSize irlen = nins - nk;\n  MSize need = (irlen+1)*(sizeof(IRIns) + sizeof(IRRef1));\n  IRIns *oir = (IRIns *)lj_str_needbuf(J->L, &G(J->L)->tmpbuf, need);\n  IRRef1 *hisubst;\n  IRRef ref;\n\n  /* Copy old IR to buffer. */\n  memcpy(oir, IR(nk), irlen*sizeof(IRIns));\n  /* Bias hiword substitution table and old IR. Loword kept in field prev. */\n  hisubst = (IRRef1 *)&oir[irlen] - nk;\n  oir -= nk;\n\n  /* Remove all IR instructions, but retain IR constants. */\n  J->cur.nins = REF_FIRST;\n  J->loopref = 0;\n\n  /* Process constants and fixed references. */\n  for (ref = nk; ref <= REF_BASE; ref++) {\n    IRIns *ir = &oir[ref];\n    if ((LJ_SOFTFP && ir->o == IR_KNUM) || ir->o == IR_KINT64) {\n      /* Split up 64 bit constant. */\n      TValue tv = *ir_k64(ir);\n      ir->prev = lj_ir_kint(J, (int32_t)tv.u32.lo);\n      hisubst[ref] = lj_ir_kint(J, (int32_t)tv.u32.hi);\n    } else {\n      ir->prev = ref;  /* Identity substitution for loword. */\n      hisubst[ref] = 0;\n    }\n  }\n\n  /* Process old IR instructions. */\n  for (ref = REF_FIRST; ref < nins; ref++) {\n    IRIns *ir = &oir[ref];\n    IRRef nref = lj_ir_nextins(J);\n    IRIns *nir = IR(nref);\n    IRRef hi = 0;\n\n    /* Copy-substitute old instruction to new instruction. */\n    nir->op1 = ir->op1 < nk ? ir->op1 : oir[ir->op1].prev;\n    nir->op2 = ir->op2 < nk ? ir->op2 : oir[ir->op2].prev;\n    ir->prev = nref;  /* Loword substitution. */\n    nir->o = ir->o;\n    nir->t.irt = ir->t.irt & ~(IRT_MARK|IRT_ISPHI);\n    hisubst[ref] = 0;\n\n    /* Split 64 bit instructions. */\n#if LJ_SOFTFP\n    if (irt_isnum(ir->t)) {\n      nir->t.irt = IRT_INT | (nir->t.irt & IRT_GUARD);  /* Turn into INT op. */\n      /* Note: hi ref = lo ref + 1! Required for SNAP_SOFTFPNUM logic. */\n      switch (ir->o) {\n      case IR_ADD:\n\thi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_add);\n\tbreak;\n      case IR_SUB:\n\thi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_sub);\n\tbreak;\n      case IR_MUL:\n\thi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_mul);\n\tbreak;\n      case IR_DIV:\n\thi = split_call_ll(J, hisubst, oir, ir, IRCALL_softfp_div);\n\tbreak;\n      case IR_POW:\n\thi = split_call_li(J, hisubst, oir, ir, IRCALL_lj_vm_powi);\n\tbreak;\n      case IR_FPMATH:\n\t/* Try to rejoin pow from EXP2, MUL and LOG2. */\n\tif (nir->op2 == IRFPM_EXP2 && nir->op1 > J->loopref) {\n\t  IRIns *irp = IR(nir->op1);\n\t  if (irp->o == IR_CALLN && irp->op2 == IRCALL_softfp_mul) {\n\t    IRIns *irm4 = IR(irp->op1);\n\t    IRIns *irm3 = IR(irm4->op1);\n\t    IRIns *irm12 = IR(irm3->op1);\n\t    IRIns *irl1 = IR(irm12->op1);\n\t    if (irm12->op1 > J->loopref && irl1->o == IR_CALLN &&\n\t\tirl1->op2 == IRCALL_lj_vm_log2) {\n\t      IRRef tmp = irl1->op1;  /* Recycle first two args from LOG2. */\n\t      IRRef arg3 = irm3->op2, arg4 = irm4->op2;\n\t      J->cur.nins--;\n\t      tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg3);\n\t      tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), tmp, arg4);\n\t      ir->prev = tmp = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_pow);\n\t      hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), tmp, tmp);\n\t      break;\n\t    }\n\t  }\n\t}\n\thi = split_call_l(J, hisubst, oir, ir, IRCALL_lj_vm_floor + ir->op2);\n\tbreak;\n      case IR_ATAN2:\n\thi = split_call_ll(J, hisubst, oir, ir, IRCALL_atan2);\n\tbreak;\n      case IR_LDEXP:\n\thi = split_call_li(J, hisubst, oir, ir, IRCALL_ldexp);\n\tbreak;\n      case IR_NEG: case IR_ABS:\n\tnir->o = IR_CONV;  /* Pass through loword. */\n\tnir->op2 = (IRT_INT << 5) | IRT_INT;\n\thi = split_emit(J, IRT(ir->o == IR_NEG ? IR_BXOR : IR_BAND, IRT_SOFTFP),\n\t\t\thisubst[ir->op1], hisubst[ir->op2]);\n\tbreak;\n      case IR_SLOAD:\n\tif ((nir->op2 & IRSLOAD_CONVERT)) {  /* Convert from int to number. */\n\t  nir->op2 &= ~IRSLOAD_CONVERT;\n\t  ir->prev = nref = split_emit(J, IRTI(IR_CALLN), nref,\n\t\t\t\t       IRCALL_softfp_i2d);\n\t  hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref);\n\t  break;\n\t}\n\t/* fallthrough */\n      case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:\n      case IR_STRTO:\n\thi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref);\n\tbreak;\n      case IR_XLOAD: {\n\tIRIns inslo = *nir;  /* Save/undo the emit of the lo XLOAD. */\n\tJ->cur.nins--;\n\thi = split_ptr(J, oir, ir->op1);  /* Insert the hiref ADD. */\n\tnref = lj_ir_nextins(J);\n\tnir = IR(nref);\n\t*nir = inslo;  /* Re-emit lo XLOAD immediately before hi XLOAD. */\n\thi = split_emit(J, IRT(IR_XLOAD, IRT_SOFTFP), hi, ir->op2);\n#if LJ_LE\n\tir->prev = nref;\n#else\n\tir->prev = hi; hi = nref;\n#endif\n\tbreak;\n\t}\n      case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_XSTORE:\n\tsplit_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nir->op1, hisubst[ir->op2]);\n\tbreak;\n      case IR_CONV: {  /* Conversion to number. Others handled below. */\n\tIRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);\n\tUNUSED(st);\n#if LJ_32 && LJ_HASFFI\n\tif (st == IRT_I64 || st == IRT_U64) {\n\t  hi = split_call_l(J, hisubst, oir, ir,\n\t\t st == IRT_I64 ? IRCALL_fp64_l2d : IRCALL_fp64_ul2d);\n\t  break;\n\t}\n#endif\n\tlua_assert(st == IRT_INT ||\n\t\t   (LJ_32 && LJ_HASFFI && (st == IRT_U32 || st == IRT_FLOAT)));\n\tnir->o = IR_CALLN;\n#if LJ_32 && LJ_HASFFI\n\tnir->op2 = st == IRT_INT ? IRCALL_softfp_i2d :\n\t\t   st == IRT_FLOAT ? IRCALL_softfp_f2d :\n\t\t   IRCALL_softfp_ui2d;\n#else\n\tnir->op2 = IRCALL_softfp_i2d;\n#endif\n\thi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref);\n\tbreak;\n\t}\n      case IR_CALLN:\n      case IR_CALLL:\n      case IR_CALLS:\n      case IR_CALLXS:\n\tgoto split_call;\n      case IR_PHI:\n\tif (nir->op1 == nir->op2)\n\t  J->cur.nins--;  /* Drop useless PHIs. */\n\tif (hisubst[ir->op1] != hisubst[ir->op2])\n\t  split_emit(J, IRT(IR_PHI, IRT_SOFTFP),\n\t\t     hisubst[ir->op1], hisubst[ir->op2]);\n\tbreak;\n      case IR_HIOP:\n\tJ->cur.nins--;  /* Drop joining HIOP. */\n\tir->prev = nir->op1;\n\thi = nir->op2;\n\tbreak;\n      default:\n\tlua_assert(ir->o <= IR_NE || ir->o == IR_MIN || ir->o == IR_MAX);\n\thi = split_emit(J, IRTG(IR_HIOP, IRT_SOFTFP),\n\t\t\thisubst[ir->op1], hisubst[ir->op2]);\n\tbreak;\n      }\n    } else\n#endif\n#if LJ_32 && LJ_HASFFI\n    if (irt_isint64(ir->t)) {\n      IRRef hiref = hisubst[ir->op1];\n      nir->t.irt = IRT_INT | (nir->t.irt & IRT_GUARD);  /* Turn into INT op. */\n      switch (ir->o) {\n      case IR_ADD:\n      case IR_SUB:\n\t/* Use plain op for hiword if loword cannot produce a carry/borrow. */\n\tif (irref_isk(nir->op2) && IR(nir->op2)->i == 0) {\n\t  ir->prev = nir->op1;  /* Pass through loword. */\n\t  nir->op1 = hiref; nir->op2 = hisubst[ir->op2];\n\t  hi = nref;\n\t  break;\n\t}\n\t/* fallthrough */\n      case IR_NEG:\n\thi = split_emit(J, IRTI(IR_HIOP), hiref, hisubst[ir->op2]);\n\tbreak;\n      case IR_MUL:\n\thi = split_call_ll(J, hisubst, oir, ir, IRCALL_lj_carith_mul64);\n\tbreak;\n      case IR_DIV:\n\thi = split_call_ll(J, hisubst, oir, ir,\n\t\t\t   irt_isi64(ir->t) ? IRCALL_lj_carith_divi64 :\n\t\t\t\t\t      IRCALL_lj_carith_divu64);\n\tbreak;\n      case IR_MOD:\n\thi = split_call_ll(J, hisubst, oir, ir,\n\t\t\t   irt_isi64(ir->t) ? IRCALL_lj_carith_modi64 :\n\t\t\t\t\t      IRCALL_lj_carith_modu64);\n\tbreak;\n      case IR_POW:\n\thi = split_call_ll(J, hisubst, oir, ir,\n\t\t\t   irt_isi64(ir->t) ? IRCALL_lj_carith_powi64 :\n\t\t\t\t\t      IRCALL_lj_carith_powu64);\n\tbreak;\n      case IR_FLOAD:\n\tlua_assert(ir->op2 == IRFL_CDATA_INT64);\n\thi = split_emit(J, IRTI(IR_FLOAD), nir->op1, IRFL_CDATA_INT64_4);\n#if LJ_BE\n\tir->prev = hi; hi = nref;\n#endif\n\tbreak;\n      case IR_XLOAD:\n\thi = split_emit(J, IRTI(IR_XLOAD), split_ptr(J, oir, ir->op1), ir->op2);\n#if LJ_BE\n\tir->prev = hi; hi = nref;\n#endif\n\tbreak;\n      case IR_XSTORE:\n\tsplit_emit(J, IRTI(IR_HIOP), nir->op1, hisubst[ir->op2]);\n\tbreak;\n      case IR_CONV: {  /* Conversion to 64 bit integer. Others handled below. */\n\tIRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);\n#if LJ_SOFTFP\n\tif (st == IRT_NUM) {  /* NUM to 64 bit int conv. */\n\t  hi = split_call_l(J, hisubst, oir, ir,\n\t\t irt_isi64(ir->t) ? IRCALL_fp64_d2l : IRCALL_fp64_d2ul);\n\t} else if (st == IRT_FLOAT) {  /* FLOAT to 64 bit int conv. */\n\t  nir->o = IR_CALLN;\n\t  nir->op2 = irt_isi64(ir->t) ? IRCALL_fp64_f2l : IRCALL_fp64_f2ul;\n\t  hi = split_emit(J, IRTI(IR_HIOP), nref, nref);\n\t}\n#else\n\tif (st == IRT_NUM || st == IRT_FLOAT) {  /* FP to 64 bit int conv. */\n\t  hi = split_emit(J, IRTI(IR_HIOP), nir->op1, nref);\n\t}\n#endif\n\telse if (st == IRT_I64 || st == IRT_U64) {  /* 64/64 bit cast. */\n\t  /* Drop cast, since assembler doesn't care. */\n\t  goto fwdlo;\n\t} else if ((ir->op2 & IRCONV_SEXT)) {  /* Sign-extend to 64 bit. */\n\t  IRRef k31 = lj_ir_kint(J, 31);\n\t  nir = IR(nref);  /* May have been reallocated. */\n\t  ir->prev = nir->op1;  /* Pass through loword. */\n\t  nir->o = IR_BSAR;  /* hi = bsar(lo, 31). */\n\t  nir->op2 = k31;\n\t  hi = nref;\n\t} else {  /* Zero-extend to 64 bit. */\n\t  hi = lj_ir_kint(J, 0);\n\t  goto fwdlo;\n\t}\n\tbreak;\n\t}\n      case IR_CALLXS:\n\tgoto split_call;\n      case IR_PHI: {\n\tIRRef hiref2;\n\tif ((irref_isk(nir->op1) && irref_isk(nir->op2)) ||\n\t    nir->op1 == nir->op2)\n\t  J->cur.nins--;  /* Drop useless PHIs. */\n\thiref2 = hisubst[ir->op2];\n\tif (!((irref_isk(hiref) && irref_isk(hiref2)) || hiref == hiref2))\n\t  split_emit(J, IRTI(IR_PHI), hiref, hiref2);\n\tbreak;\n\t}\n      case IR_HIOP:\n\tJ->cur.nins--;  /* Drop joining HIOP. */\n\tir->prev = nir->op1;\n\thi = nir->op2;\n\tbreak;\n      default:\n\tlua_assert(ir->o <= IR_NE);  /* Comparisons. */\n\tsplit_emit(J, IRTGI(IR_HIOP), hiref, hisubst[ir->op2]);\n\tbreak;\n      }\n    } else\n#endif\n#if LJ_SOFTFP\n    if (ir->o == IR_SLOAD) {\n      if ((nir->op2 & IRSLOAD_CONVERT)) {  /* Convert from number to int. */\n\tnir->op2 &= ~IRSLOAD_CONVERT;\n\tif (!(nir->op2 & IRSLOAD_TYPECHECK))\n\t  nir->t.irt = IRT_INT;  /* Drop guard. */\n\tsplit_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref);\n\tir->prev = split_num2int(J, nref, nref+1, irt_isguard(ir->t));\n      }\n    } else if (ir->o == IR_TOBIT) {\n      IRRef tmp, op1 = ir->op1;\n      J->cur.nins--;\n#if LJ_LE\n      tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), oir[op1].prev, hisubst[op1]);\n#else\n      tmp = split_emit(J, IRT(IR_CARG, IRT_NIL), hisubst[op1], oir[op1].prev);\n#endif\n      ir->prev = split_emit(J, IRTI(IR_CALLN), tmp, IRCALL_lj_vm_tobit);\n    } else if (ir->o == IR_TOSTR) {\n      if (hisubst[ir->op1]) {\n\tif (irref_isk(ir->op1))\n\t  nir->op1 = ir->op1;\n\telse\n\t  split_emit(J, IRT(IR_HIOP, IRT_NIL), hisubst[ir->op1], nref);\n      }\n    } else if (ir->o == IR_HREF || ir->o == IR_NEWREF) {\n      if (irref_isk(ir->op2) && hisubst[ir->op2])\n\tnir->op2 = ir->op2;\n    } else\n#endif\n    if (ir->o == IR_CONV) {  /* See above, too. */\n      IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);\n#if LJ_32 && LJ_HASFFI\n      if (st == IRT_I64 || st == IRT_U64) {  /* Conversion from 64 bit int. */\n#if LJ_SOFTFP\n\tif (irt_isfloat(ir->t)) {\n\t  split_call_l(J, hisubst, oir, ir,\n\t\t       st == IRT_I64 ? IRCALL_fp64_l2f : IRCALL_fp64_ul2f);\n\t  J->cur.nins--;  /* Drop unused HIOP. */\n\t}\n#else\n\tif (irt_isfp(ir->t)) {  /* 64 bit integer to FP conversion. */\n\t  ir->prev = split_emit(J, IRT(IR_HIOP, irt_type(ir->t)),\n\t\t\t\thisubst[ir->op1], nref);\n\t}\n#endif\n\telse {  /* Truncate to lower 32 bits. */\n\tfwdlo:\n\t  ir->prev = nir->op1;  /* Forward loword. */\n\t  /* Replace with NOP to avoid messing up the snapshot logic. */\n\t  nir->ot = IRT(IR_NOP, IRT_NIL);\n\t  nir->op1 = nir->op2 = 0;\n\t}\n      }\n#endif\n#if LJ_SOFTFP && LJ_32 && LJ_HASFFI\n      else if (irt_isfloat(ir->t)) {\n\tif (st == IRT_NUM) {\n\t  split_call_l(J, hisubst, oir, ir, IRCALL_softfp_d2f);\n\t  J->cur.nins--;  /* Drop unused HIOP. */\n\t} else {\n\t  nir->o = IR_CALLN;\n\t  nir->op2 = st == IRT_INT ? IRCALL_softfp_i2f : IRCALL_softfp_ui2f;\n\t}\n      } else if (st == IRT_FLOAT) {\n\tnir->o = IR_CALLN;\n\tnir->op2 = irt_isint(ir->t) ? IRCALL_softfp_f2i : IRCALL_softfp_f2ui;\n      } else\n#endif\n#if LJ_SOFTFP\n      if (st == IRT_NUM || (LJ_32 && LJ_HASFFI && st == IRT_FLOAT)) {\n\tif (irt_isguard(ir->t)) {\n\t  lua_assert(st == IRT_NUM && irt_isint(ir->t));\n\t  J->cur.nins--;\n\t  ir->prev = split_num2int(J, nir->op1, hisubst[ir->op1], 1);\n\t} else {\n\t  split_call_l(J, hisubst, oir, ir,\n#if LJ_32 && LJ_HASFFI\n\t    st == IRT_NUM ?\n\t      (irt_isint(ir->t) ? IRCALL_softfp_d2i : IRCALL_softfp_d2ui) :\n\t      (irt_isint(ir->t) ? IRCALL_softfp_f2i : IRCALL_softfp_f2ui)\n#else\n\t    IRCALL_softfp_d2i\n#endif\n\t  );\n\t  J->cur.nins--;  /* Drop unused HIOP. */\n\t}\n      }\n#endif\n    } else if (ir->o == IR_CALLXS) {\n      IRRef hiref;\n    split_call:\n      hiref = hisubst[ir->op1];\n      if (hiref) {\n\tIROpT ot = nir->ot;\n\tIRRef op2 = nir->op2;\n\tnir->ot = IRT(IR_CARG, IRT_NIL);\n#if LJ_LE\n\tnir->op2 = hiref;\n#else\n\tnir->op2 = nir->op1; nir->op1 = hiref;\n#endif\n\tir->prev = nref = split_emit(J, ot, nref, op2);\n      }\n      if (LJ_SOFTFP ? irt_is64(ir->t) : irt_isint64(ir->t))\n\thi = split_emit(J,\n\t  IRT(IR_HIOP, (LJ_SOFTFP && irt_isnum(ir->t)) ? IRT_SOFTFP : IRT_INT),\n\t  nref, nref);\n    } else if (ir->o == IR_CARG) {\n      IRRef hiref = hisubst[ir->op1];\n      if (hiref) {\n\tIRRef op2 = nir->op2;\n#if LJ_LE\n\tnir->op2 = hiref;\n#else\n\tnir->op2 = nir->op1; nir->op1 = hiref;\n#endif\n\tir->prev = nref = split_emit(J, IRT(IR_CARG, IRT_NIL), nref, op2);\n\tnir = IR(nref);\n      }\n      hiref = hisubst[ir->op2];\n      if (hiref) {\n#if !LJ_TARGET_X86\n\tint carg = 0;\n\tIRIns *cir;\n\tfor (cir = IR(nir->op1); cir->o == IR_CARG; cir = IR(cir->op1))\n\t  carg++;\n\tif ((carg & 1) == 0) {  /* Align 64 bit arguments. */\n\t  IRRef op2 = nir->op2;\n\t  nir->op2 = REF_NIL;\n\t  nref = split_emit(J, IRT(IR_CARG, IRT_NIL), nref, op2);\n\t  nir = IR(nref);\n\t}\n#endif\n#if LJ_BE\n\t{ IRRef tmp = nir->op2; nir->op2 = hiref; hiref = tmp; }\n#endif\n\tir->prev = split_emit(J, IRT(IR_CARG, IRT_NIL), nref, hiref);\n      }\n    } else if (ir->o == IR_CNEWI) {\n      if (hisubst[ir->op2])\n\tsplit_emit(J, IRT(IR_HIOP, IRT_NIL), nref, hisubst[ir->op2]);\n    } else if (ir->o == IR_LOOP) {\n      J->loopref = nref;  /* Needed by assembler. */\n    }\n    hisubst[ref] = hi;  /* Store hiword substitution. */\n  }\n\n  /* Add PHI marks. */\n  for (ref = J->cur.nins-1; ref >= REF_FIRST; ref--) {\n    IRIns *ir = IR(ref);\n    if (ir->o != IR_PHI) break;\n    if (!irref_isk(ir->op1)) irt_setphi(IR(ir->op1)->t);\n    if (ir->op2 > J->loopref) irt_setphi(IR(ir->op2)->t);\n  }\n\n  /* Substitute snapshot maps. */\n  oir[nins].prev = J->cur.nins;  /* Substitution for last snapshot. */\n  {\n    SnapNo i, nsnap = J->cur.nsnap;\n    for (i = 0; i < nsnap; i++) {\n      SnapShot *snap = &J->cur.snap[i];\n      SnapEntry *map = &J->cur.snapmap[snap->mapofs];\n      MSize n, nent = snap->nent;\n      snap->ref = snap->ref == REF_FIRST ? REF_FIRST : oir[snap->ref].prev;\n      for (n = 0; n < nent; n++) {\n\tSnapEntry sn = map[n];\n\tIRIns *ir = &oir[snap_ref(sn)];\n\tif (!(LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && irref_isk(snap_ref(sn))))\n\t  map[n] = ((sn & 0xffff0000) | ir->prev);\n      }\n    }\n  }\n}\n\n/* Protected callback for split pass. */\nstatic TValue *cpsplit(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  jit_State *J = (jit_State *)ud;\n  split_ir(J);\n  UNUSED(L); UNUSED(dummy);\n  return NULL;\n}\n\n#if defined(LUA_USE_ASSERT) || LJ_SOFTFP\n/* Slow, but sure way to check whether a SPLIT pass is needed. */\nstatic int split_needsplit(jit_State *J)\n{\n  IRIns *ir, *irend;\n  IRRef ref;\n  for (ir = IR(REF_FIRST), irend = IR(J->cur.nins); ir < irend; ir++)\n    if (LJ_SOFTFP ? irt_is64orfp(ir->t) : irt_isint64(ir->t))\n      return 1;\n  if (LJ_SOFTFP) {\n    for (ref = J->chain[IR_SLOAD]; ref; ref = IR(ref)->prev)\n      if ((IR(ref)->op2 & IRSLOAD_CONVERT))\n\treturn 1;\n    if (J->chain[IR_TOBIT])\n      return 1;\n  }\n  for (ref = J->chain[IR_CONV]; ref; ref = IR(ref)->prev) {\n    IRType st = (IR(ref)->op2 & IRCONV_SRCMASK);\n    if ((LJ_SOFTFP && (st == IRT_NUM || st == IRT_FLOAT)) ||\n\tst == IRT_I64 || st == IRT_U64)\n      return 1;\n  }\n  return 0;  /* Nope. */\n}\n#endif\n\n/* SPLIT pass. */\nvoid lj_opt_split(jit_State *J)\n{\n#if LJ_SOFTFP\n  if (!J->needsplit)\n    J->needsplit = split_needsplit(J);\n#else\n  lua_assert(J->needsplit >= split_needsplit(J));  /* Verify flag. */\n#endif\n  if (J->needsplit) {\n    int errcode = lj_vm_cpcall(J->L, NULL, J, cpsplit);\n    if (errcode) {\n      /* Completely reset the trace to avoid inconsistent dump on abort. */\n      J->cur.nins = J->cur.nk = REF_BASE;\n      J->cur.nsnap = 0;\n      lj_err_throw(J->L, errcode);  /* Propagate errors. */\n    }\n  }\n}\n\n#undef IR\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_parse.c",
    "content": "/*\n** Lua parser (source code -> bytecode).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_parse_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_func.h\"\n#include \"lj_state.h\"\n#include \"lj_bc.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#endif\n#include \"lj_lex.h\"\n#include \"lj_parse.h\"\n#include \"lj_vm.h\"\n#include \"lj_vmevent.h\"\n\n/* -- Parser structures and definitions ----------------------------------- */\n\n/* Expression kinds. */\ntypedef enum {\n  /* Constant expressions must be first and in this order: */\n  VKNIL,\n  VKFALSE,\n  VKTRUE,\n  VKSTR,\t/* sval = string value */\n  VKNUM,\t/* nval = number value */\n  VKLAST = VKNUM,\n  VKCDATA,\t/* nval = cdata value, not treated as a constant expression */\n  /* Non-constant expressions follow: */\n  VLOCAL,\t/* info = local register, aux = vstack index */\n  VUPVAL,\t/* info = upvalue index, aux = vstack index */\n  VGLOBAL,\t/* sval = string value */\n  VINDEXED,\t/* info = table register, aux = index reg/byte/string const */\n  VJMP,\t\t/* info = instruction PC */\n  VRELOCABLE,\t/* info = instruction PC */\n  VNONRELOC,\t/* info = result register */\n  VCALL,\t/* info = instruction PC, aux = base */\n  VVOID\n} ExpKind;\n\n/* Expression descriptor. */\ntypedef struct ExpDesc {\n  union {\n    struct {\n      uint32_t info;\t/* Primary info. */\n      uint32_t aux;\t/* Secondary info. */\n    } s;\n    TValue nval;\t/* Number value. */\n    GCstr *sval;\t/* String value. */\n  } u;\n  ExpKind k;\n  BCPos t;\t\t/* True condition jump list. */\n  BCPos f;\t\t/* False condition jump list. */\n} ExpDesc;\n\n/* Macros for expressions. */\n#define expr_hasjump(e)\t\t((e)->t != (e)->f)\n\n#define expr_isk(e)\t\t((e)->k <= VKLAST)\n#define expr_isk_nojump(e)\t(expr_isk(e) && !expr_hasjump(e))\n#define expr_isnumk(e)\t\t((e)->k == VKNUM)\n#define expr_isnumk_nojump(e)\t(expr_isnumk(e) && !expr_hasjump(e))\n#define expr_isstrk(e)\t\t((e)->k == VKSTR)\n\n#define expr_numtv(e)\t\tcheck_exp(expr_isnumk((e)), &(e)->u.nval)\n#define expr_numberV(e)\t\tnumberVnum(expr_numtv((e)))\n\n/* Initialize expression. */\nstatic LJ_AINLINE void expr_init(ExpDesc *e, ExpKind k, uint32_t info)\n{\n  e->k = k;\n  e->u.s.info = info;\n  e->f = e->t = NO_JMP;\n}\n\n/* Check number constant for +-0. */\nstatic int expr_numiszero(ExpDesc *e)\n{\n  TValue *o = expr_numtv(e);\n  return tvisint(o) ? (intV(o) == 0) : tviszero(o);\n}\n\n/* Per-function linked list of scope blocks. */\ntypedef struct FuncScope {\n  struct FuncScope *prev;\t/* Link to outer scope. */\n  MSize vstart;\t\t\t/* Start of block-local variables. */\n  uint8_t nactvar;\t\t/* Number of active vars outside the scope. */\n  uint8_t flags;\t\t/* Scope flags. */\n} FuncScope;\n\n#define FSCOPE_LOOP\t\t0x01\t/* Scope is a (breakable) loop. */\n#define FSCOPE_BREAK\t\t0x02\t/* Break used in scope. */\n#define FSCOPE_GOLA\t\t0x04\t/* Goto or label used in scope. */\n#define FSCOPE_UPVAL\t\t0x08\t/* Upvalue in scope. */\n#define FSCOPE_NOCLOSE\t\t0x10\t/* Do not close upvalues. */\n\n#define NAME_BREAK\t\t((GCstr *)(uintptr_t)1)\n\n/* Index into variable stack. */\ntypedef uint16_t VarIndex;\n#define LJ_MAX_VSTACK\t\t(65536 - LJ_MAX_UPVAL)\n\n/* Variable/goto/label info. */\n#define VSTACK_VAR_RW\t\t0x01\t/* R/W variable. */\n#define VSTACK_GOTO\t\t0x02\t/* Pending goto. */\n#define VSTACK_LABEL\t\t0x04\t/* Label. */\n\n/* Per-function state. */\ntypedef struct FuncState {\n  GCtab *kt;\t\t\t/* Hash table for constants. */\n  LexState *ls;\t\t\t/* Lexer state. */\n  lua_State *L;\t\t\t/* Lua state. */\n  FuncScope *bl;\t\t/* Current scope. */\n  struct FuncState *prev;\t/* Enclosing function. */\n  BCPos pc;\t\t\t/* Next bytecode position. */\n  BCPos lasttarget;\t\t/* Bytecode position of last jump target. */\n  BCPos jpc;\t\t\t/* Pending jump list to next bytecode. */\n  BCReg freereg;\t\t/* First free register. */\n  BCReg nactvar;\t\t/* Number of active local variables. */\n  BCReg nkn, nkgc;\t\t/* Number of lua_Number/GCobj constants */\n  BCLine linedefined;\t\t/* First line of the function definition. */\n  BCInsLine *bcbase;\t\t/* Base of bytecode stack. */\n  BCPos bclim;\t\t\t/* Limit of bytecode stack. */\n  MSize vbase;\t\t\t/* Base of variable stack for this function. */\n  uint8_t flags;\t\t/* Prototype flags. */\n  uint8_t numparams;\t\t/* Number of parameters. */\n  uint8_t framesize;\t\t/* Fixed frame size. */\n  uint8_t nuv;\t\t\t/* Number of upvalues */\n  VarIndex varmap[LJ_MAX_LOCVAR];  /* Map from register to variable idx. */\n  VarIndex uvmap[LJ_MAX_UPVAL];\t/* Map from upvalue to variable idx. */\n  VarIndex uvtmp[LJ_MAX_UPVAL];\t/* Temporary upvalue map. */\n} FuncState;\n\n/* Binary and unary operators. ORDER OPR */\ntypedef enum BinOpr {\n  OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW,  /* ORDER ARITH */\n  OPR_CONCAT,\n  OPR_NE, OPR_EQ,\n  OPR_LT, OPR_GE, OPR_LE, OPR_GT,\n  OPR_AND, OPR_OR,\n  OPR_NOBINOPR\n} BinOpr;\n\nLJ_STATIC_ASSERT((int)BC_ISGE-(int)BC_ISLT == (int)OPR_GE-(int)OPR_LT);\nLJ_STATIC_ASSERT((int)BC_ISLE-(int)BC_ISLT == (int)OPR_LE-(int)OPR_LT);\nLJ_STATIC_ASSERT((int)BC_ISGT-(int)BC_ISLT == (int)OPR_GT-(int)OPR_LT);\nLJ_STATIC_ASSERT((int)BC_SUBVV-(int)BC_ADDVV == (int)OPR_SUB-(int)OPR_ADD);\nLJ_STATIC_ASSERT((int)BC_MULVV-(int)BC_ADDVV == (int)OPR_MUL-(int)OPR_ADD);\nLJ_STATIC_ASSERT((int)BC_DIVVV-(int)BC_ADDVV == (int)OPR_DIV-(int)OPR_ADD);\nLJ_STATIC_ASSERT((int)BC_MODVV-(int)BC_ADDVV == (int)OPR_MOD-(int)OPR_ADD);\n\n/* -- Error handling ------------------------------------------------------ */\n\nLJ_NORET LJ_NOINLINE static void err_syntax(LexState *ls, ErrMsg em)\n{\n  lj_lex_error(ls, ls->token, em);\n}\n\nLJ_NORET LJ_NOINLINE static void err_token(LexState *ls, LexToken token)\n{\n  lj_lex_error(ls, ls->token, LJ_ERR_XTOKEN, lj_lex_token2str(ls, token));\n}\n\nLJ_NORET static void err_limit(FuncState *fs, uint32_t limit, const char *what)\n{\n  if (fs->linedefined == 0)\n    lj_lex_error(fs->ls, 0, LJ_ERR_XLIMM, limit, what);\n  else\n    lj_lex_error(fs->ls, 0, LJ_ERR_XLIMF, fs->linedefined, limit, what);\n}\n\n#define checklimit(fs, v, l, m)\t\tif ((v) >= (l)) err_limit(fs, l, m)\n#define checklimitgt(fs, v, l, m)\tif ((v) > (l)) err_limit(fs, l, m)\n#define checkcond(ls, c, em)\t\t{ if (!(c)) err_syntax(ls, em); }\n\n/* -- Management of constants --------------------------------------------- */\n\n/* Return bytecode encoding for primitive constant. */\n#define const_pri(e)\t\tcheck_exp((e)->k <= VKTRUE, (e)->k)\n\n#define tvhaskslot(o)\t((o)->u32.hi == 0)\n#define tvkslot(o)\t((o)->u32.lo)\n\n/* Add a number constant. */\nstatic BCReg const_num(FuncState *fs, ExpDesc *e)\n{\n  lua_State *L = fs->L;\n  TValue *o;\n  lua_assert(expr_isnumk(e));\n  o = lj_tab_set(L, fs->kt, &e->u.nval);\n  if (tvhaskslot(o))\n    return tvkslot(o);\n  o->u64 = fs->nkn;\n  return fs->nkn++;\n}\n\n/* Add a GC object constant. */\nstatic BCReg const_gc(FuncState *fs, GCobj *gc, uint32_t itype)\n{\n  lua_State *L = fs->L;\n  TValue key, *o;\n  setgcV(L, &key, gc, itype);\n  /* NOBARRIER: the key is new or kept alive. */\n  o = lj_tab_set(L, fs->kt, &key);\n  if (tvhaskslot(o))\n    return tvkslot(o);\n  o->u64 = fs->nkgc;\n  return fs->nkgc++;\n}\n\n/* Add a string constant. */\nstatic BCReg const_str(FuncState *fs, ExpDesc *e)\n{\n  lua_assert(expr_isstrk(e) || e->k == VGLOBAL);\n  return const_gc(fs, obj2gco(e->u.sval), LJ_TSTR);\n}\n\n/* Anchor string constant to avoid GC. */\nGCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t len)\n{\n  /* NOBARRIER: the key is new or kept alive. */\n  lua_State *L = ls->L;\n  GCstr *s = lj_str_new(L, str, len);\n  TValue *tv = lj_tab_setstr(L, ls->fs->kt, s);\n  if (tvisnil(tv)) setboolV(tv, 1);\n  lj_gc_check(L);\n  return s;\n}\n\n#if LJ_HASFFI\n/* Anchor cdata to avoid GC. */\nvoid lj_parse_keepcdata(LexState *ls, TValue *tv, GCcdata *cd)\n{\n  /* NOBARRIER: the key is new or kept alive. */\n  lua_State *L = ls->L;\n  setcdataV(L, tv, cd);\n  setboolV(lj_tab_set(L, ls->fs->kt, tv), 1);\n}\n#endif\n\n/* -- Jump list handling -------------------------------------------------- */\n\n/* Get next element in jump list. */\nstatic BCPos jmp_next(FuncState *fs, BCPos pc)\n{\n  ptrdiff_t delta = bc_j(fs->bcbase[pc].ins);\n  if ((BCPos)delta == NO_JMP)\n    return NO_JMP;\n  else\n    return (BCPos)(((ptrdiff_t)pc+1)+delta);\n}\n\n/* Check if any of the instructions on the jump list produce no value. */\nstatic int jmp_novalue(FuncState *fs, BCPos list)\n{\n  for (; list != NO_JMP; list = jmp_next(fs, list)) {\n    BCIns p = fs->bcbase[list >= 1 ? list-1 : list].ins;\n    if (!(bc_op(p) == BC_ISTC || bc_op(p) == BC_ISFC || bc_a(p) == NO_REG))\n      return 1;\n  }\n  return 0;\n}\n\n/* Patch register of test instructions. */\nstatic int jmp_patchtestreg(FuncState *fs, BCPos pc, BCReg reg)\n{\n  BCInsLine *ilp = &fs->bcbase[pc >= 1 ? pc-1 : pc];\n  BCOp op = bc_op(ilp->ins);\n  if (op == BC_ISTC || op == BC_ISFC) {\n    if (reg != NO_REG && reg != bc_d(ilp->ins)) {\n      setbc_a(&ilp->ins, reg);\n    } else {  /* Nothing to store or already in the right register. */\n      setbc_op(&ilp->ins, op+(BC_IST-BC_ISTC));\n      setbc_a(&ilp->ins, 0);\n    }\n  } else if (bc_a(ilp->ins) == NO_REG) {\n    if (reg == NO_REG) {\n      ilp->ins = BCINS_AJ(BC_JMP, bc_a(fs->bcbase[pc].ins), 0);\n    } else {\n      setbc_a(&ilp->ins, reg);\n      if (reg >= bc_a(ilp[1].ins))\n\tsetbc_a(&ilp[1].ins, reg+1);\n    }\n  } else {\n    return 0;  /* Cannot patch other instructions. */\n  }\n  return 1;\n}\n\n/* Drop values for all instructions on jump list. */\nstatic void jmp_dropval(FuncState *fs, BCPos list)\n{\n  for (; list != NO_JMP; list = jmp_next(fs, list))\n    jmp_patchtestreg(fs, list, NO_REG);\n}\n\n/* Patch jump instruction to target. */\nstatic void jmp_patchins(FuncState *fs, BCPos pc, BCPos dest)\n{\n  BCIns *jmp = &fs->bcbase[pc].ins;\n  BCPos offset = dest-(pc+1)+BCBIAS_J;\n  lua_assert(dest != NO_JMP);\n  if (offset > BCMAX_D)\n    err_syntax(fs->ls, LJ_ERR_XJUMP);\n  setbc_d(jmp, offset);\n}\n\n/* Append to jump list. */\nstatic void jmp_append(FuncState *fs, BCPos *l1, BCPos l2)\n{\n  if (l2 == NO_JMP) {\n    return;\n  } else if (*l1 == NO_JMP) {\n    *l1 = l2;\n  } else {\n    BCPos list = *l1;\n    BCPos next;\n    while ((next = jmp_next(fs, list)) != NO_JMP)  /* Find last element. */\n      list = next;\n    jmp_patchins(fs, list, l2);\n  }\n}\n\n/* Patch jump list and preserve produced values. */\nstatic void jmp_patchval(FuncState *fs, BCPos list, BCPos vtarget,\n\t\t\t BCReg reg, BCPos dtarget)\n{\n  while (list != NO_JMP) {\n    BCPos next = jmp_next(fs, list);\n    if (jmp_patchtestreg(fs, list, reg))\n      jmp_patchins(fs, list, vtarget);  /* Jump to target with value. */\n    else\n      jmp_patchins(fs, list, dtarget);  /* Jump to default target. */\n    list = next;\n  }\n}\n\n/* Jump to following instruction. Append to list of pending jumps. */\nstatic void jmp_tohere(FuncState *fs, BCPos list)\n{\n  fs->lasttarget = fs->pc;\n  jmp_append(fs, &fs->jpc, list);\n}\n\n/* Patch jump list to target. */\nstatic void jmp_patch(FuncState *fs, BCPos list, BCPos target)\n{\n  if (target == fs->pc) {\n    jmp_tohere(fs, list);\n  } else {\n    lua_assert(target < fs->pc);\n    jmp_patchval(fs, list, target, NO_REG, target);\n  }\n}\n\n/* -- Bytecode register allocator ----------------------------------------- */\n\n/* Bump frame size. */\nstatic void bcreg_bump(FuncState *fs, BCReg n)\n{\n  BCReg sz = fs->freereg + n;\n  if (sz > fs->framesize) {\n    if (sz >= LJ_MAX_SLOTS)\n      err_syntax(fs->ls, LJ_ERR_XSLOTS);\n    fs->framesize = (uint8_t)sz;\n  }\n}\n\n/* Reserve registers. */\nstatic void bcreg_reserve(FuncState *fs, BCReg n)\n{\n  bcreg_bump(fs, n);\n  fs->freereg += n;\n}\n\n/* Free register. */\nstatic void bcreg_free(FuncState *fs, BCReg reg)\n{\n  if (reg >= fs->nactvar) {\n    fs->freereg--;\n    lua_assert(reg == fs->freereg);\n  }\n}\n\n/* Free register for expression. */\nstatic void expr_free(FuncState *fs, ExpDesc *e)\n{\n  if (e->k == VNONRELOC)\n    bcreg_free(fs, e->u.s.info);\n}\n\n/* -- Bytecode emitter ---------------------------------------------------- */\n\n/* Emit bytecode instruction. */\nstatic BCPos bcemit_INS(FuncState *fs, BCIns ins)\n{\n  BCPos pc = fs->pc;\n  LexState *ls = fs->ls;\n  jmp_patchval(fs, fs->jpc, pc, NO_REG, pc);\n  fs->jpc = NO_JMP;\n  if (LJ_UNLIKELY(pc >= fs->bclim)) {\n    ptrdiff_t base = fs->bcbase - ls->bcstack;\n    checklimit(fs, ls->sizebcstack, LJ_MAX_BCINS, \"bytecode instructions\");\n    lj_mem_growvec(fs->L, ls->bcstack, ls->sizebcstack, LJ_MAX_BCINS,BCInsLine);\n    fs->bclim = (BCPos)(ls->sizebcstack - base);\n    fs->bcbase = ls->bcstack + base;\n  }\n  fs->bcbase[pc].ins = ins;\n  fs->bcbase[pc].line = ls->lastline;\n  fs->pc = pc+1;\n  return pc;\n}\n\n#define bcemit_ABC(fs, o, a, b, c)\tbcemit_INS(fs, BCINS_ABC(o, a, b, c))\n#define bcemit_AD(fs, o, a, d)\t\tbcemit_INS(fs, BCINS_AD(o, a, d))\n#define bcemit_AJ(fs, o, a, j)\t\tbcemit_INS(fs, BCINS_AJ(o, a, j))\n\n#define bcptr(fs, e)\t\t\t(&(fs)->bcbase[(e)->u.s.info].ins)\n\n/* -- Bytecode emitter for expressions ------------------------------------ */\n\n/* Discharge non-constant expression to any register. */\nstatic void expr_discharge(FuncState *fs, ExpDesc *e)\n{\n  BCIns ins;\n  if (e->k == VUPVAL) {\n    ins = BCINS_AD(BC_UGET, 0, e->u.s.info);\n  } else if (e->k == VGLOBAL) {\n    ins = BCINS_AD(BC_GGET, 0, const_str(fs, e));\n  } else if (e->k == VINDEXED) {\n    BCReg rc = e->u.s.aux;\n    if ((int32_t)rc < 0) {\n      ins = BCINS_ABC(BC_TGETS, 0, e->u.s.info, ~rc);\n    } else if (rc > BCMAX_C) {\n      ins = BCINS_ABC(BC_TGETB, 0, e->u.s.info, rc-(BCMAX_C+1));\n    } else {\n      bcreg_free(fs, rc);\n      ins = BCINS_ABC(BC_TGETV, 0, e->u.s.info, rc);\n    }\n    bcreg_free(fs, e->u.s.info);\n  } else if (e->k == VCALL) {\n    e->u.s.info = e->u.s.aux;\n    e->k = VNONRELOC;\n    return;\n  } else if (e->k == VLOCAL) {\n    e->k = VNONRELOC;\n    return;\n  } else {\n    return;\n  }\n  e->u.s.info = bcemit_INS(fs, ins);\n  e->k = VRELOCABLE;\n}\n\n/* Emit bytecode to set a range of registers to nil. */\nstatic void bcemit_nil(FuncState *fs, BCReg from, BCReg n)\n{\n  if (fs->pc > fs->lasttarget) {  /* No jumps to current position? */\n    BCIns *ip = &fs->bcbase[fs->pc-1].ins;\n    BCReg pto, pfrom = bc_a(*ip);\n    switch (bc_op(*ip)) {  /* Try to merge with the previous instruction. */\n    case BC_KPRI:\n      if (bc_d(*ip) != ~LJ_TNIL) break;\n      if (from == pfrom) {\n\tif (n == 1) return;\n      } else if (from == pfrom+1) {\n\tfrom = pfrom;\n\tn++;\n      } else {\n\tbreak;\n      }\n      *ip = BCINS_AD(BC_KNIL, from, from+n-1);  /* Replace KPRI. */\n      return;\n    case BC_KNIL:\n      pto = bc_d(*ip);\n      if (pfrom <= from && from <= pto+1) {  /* Can we connect both ranges? */\n\tif (from+n-1 > pto)\n\t  setbc_d(ip, from+n-1);  /* Patch previous instruction range. */\n\treturn;\n      }\n      break;\n    default:\n      break;\n    }\n  }\n  /* Emit new instruction or replace old instruction. */\n  bcemit_INS(fs, n == 1 ? BCINS_AD(BC_KPRI, from, VKNIL) :\n\t\t\t  BCINS_AD(BC_KNIL, from, from+n-1));\n}\n\n/* Discharge an expression to a specific register. Ignore branches. */\nstatic void expr_toreg_nobranch(FuncState *fs, ExpDesc *e, BCReg reg)\n{\n  BCIns ins;\n  expr_discharge(fs, e);\n  if (e->k == VKSTR) {\n    ins = BCINS_AD(BC_KSTR, reg, const_str(fs, e));\n  } else if (e->k == VKNUM) {\n#if LJ_DUALNUM\n    cTValue *tv = expr_numtv(e);\n    if (tvisint(tv) && checki16(intV(tv)))\n      ins = BCINS_AD(BC_KSHORT, reg, (BCReg)(uint16_t)intV(tv));\n    else\n#else\n    lua_Number n = expr_numberV(e);\n    int32_t k = lj_num2int(n);\n    if (checki16(k) && n == (lua_Number)k)\n      ins = BCINS_AD(BC_KSHORT, reg, (BCReg)(uint16_t)k);\n    else\n#endif\n      ins = BCINS_AD(BC_KNUM, reg, const_num(fs, e));\n#if LJ_HASFFI\n  } else if (e->k == VKCDATA) {\n    fs->flags |= PROTO_FFI;\n    ins = BCINS_AD(BC_KCDATA, reg,\n\t\t   const_gc(fs, obj2gco(cdataV(&e->u.nval)), LJ_TCDATA));\n#endif\n  } else if (e->k == VRELOCABLE) {\n    setbc_a(bcptr(fs, e), reg);\n    goto noins;\n  } else if (e->k == VNONRELOC) {\n    if (reg == e->u.s.info)\n      goto noins;\n    ins = BCINS_AD(BC_MOV, reg, e->u.s.info);\n  } else if (e->k == VKNIL) {\n    bcemit_nil(fs, reg, 1);\n    goto noins;\n  } else if (e->k <= VKTRUE) {\n    ins = BCINS_AD(BC_KPRI, reg, const_pri(e));\n  } else {\n    lua_assert(e->k == VVOID || e->k == VJMP);\n    return;\n  }\n  bcemit_INS(fs, ins);\nnoins:\n  e->u.s.info = reg;\n  e->k = VNONRELOC;\n}\n\n/* Forward declaration. */\nstatic BCPos bcemit_jmp(FuncState *fs);\n\n/* Discharge an expression to a specific register. */\nstatic void expr_toreg(FuncState *fs, ExpDesc *e, BCReg reg)\n{\n  expr_toreg_nobranch(fs, e, reg);\n  if (e->k == VJMP)\n    jmp_append(fs, &e->t, e->u.s.info);  /* Add it to the true jump list. */\n  if (expr_hasjump(e)) {  /* Discharge expression with branches. */\n    BCPos jend, jfalse = NO_JMP, jtrue = NO_JMP;\n    if (jmp_novalue(fs, e->t) || jmp_novalue(fs, e->f)) {\n      BCPos jval = (e->k == VJMP) ? NO_JMP : bcemit_jmp(fs);\n      jfalse = bcemit_AD(fs, BC_KPRI, reg, VKFALSE);\n      bcemit_AJ(fs, BC_JMP, fs->freereg, 1);\n      jtrue = bcemit_AD(fs, BC_KPRI, reg, VKTRUE);\n      jmp_tohere(fs, jval);\n    }\n    jend = fs->pc;\n    fs->lasttarget = jend;\n    jmp_patchval(fs, e->f, jend, reg, jfalse);\n    jmp_patchval(fs, e->t, jend, reg, jtrue);\n  }\n  e->f = e->t = NO_JMP;\n  e->u.s.info = reg;\n  e->k = VNONRELOC;\n}\n\n/* Discharge an expression to the next free register. */\nstatic void expr_tonextreg(FuncState *fs, ExpDesc *e)\n{\n  expr_discharge(fs, e);\n  expr_free(fs, e);\n  bcreg_reserve(fs, 1);\n  expr_toreg(fs, e, fs->freereg - 1);\n}\n\n/* Discharge an expression to any register. */\nstatic BCReg expr_toanyreg(FuncState *fs, ExpDesc *e)\n{\n  expr_discharge(fs, e);\n  if (e->k == VNONRELOC) {\n    if (!expr_hasjump(e)) return e->u.s.info;  /* Already in a register. */\n    if (e->u.s.info >= fs->nactvar) {\n      expr_toreg(fs, e, e->u.s.info);  /* Discharge to temp. register. */\n      return e->u.s.info;\n    }\n  }\n  expr_tonextreg(fs, e);  /* Discharge to next register. */\n  return e->u.s.info;\n}\n\n/* Partially discharge expression to a value. */\nstatic void expr_toval(FuncState *fs, ExpDesc *e)\n{\n  if (expr_hasjump(e))\n    expr_toanyreg(fs, e);\n  else\n    expr_discharge(fs, e);\n}\n\n/* Emit store for LHS expression. */\nstatic void bcemit_store(FuncState *fs, ExpDesc *var, ExpDesc *e)\n{\n  BCIns ins;\n  if (var->k == VLOCAL) {\n    fs->ls->vstack[var->u.s.aux].info |= VSTACK_VAR_RW;\n    expr_free(fs, e);\n    expr_toreg(fs, e, var->u.s.info);\n    return;\n  } else if (var->k == VUPVAL) {\n    fs->ls->vstack[var->u.s.aux].info |= VSTACK_VAR_RW;\n    expr_toval(fs, e);\n    if (e->k <= VKTRUE)\n      ins = BCINS_AD(BC_USETP, var->u.s.info, const_pri(e));\n    else if (e->k == VKSTR)\n      ins = BCINS_AD(BC_USETS, var->u.s.info, const_str(fs, e));\n    else if (e->k == VKNUM)\n      ins = BCINS_AD(BC_USETN, var->u.s.info, const_num(fs, e));\n    else\n      ins = BCINS_AD(BC_USETV, var->u.s.info, expr_toanyreg(fs, e));\n  } else if (var->k == VGLOBAL) {\n    BCReg ra = expr_toanyreg(fs, e);\n    ins = BCINS_AD(BC_GSET, ra, const_str(fs, var));\n  } else {\n    BCReg ra, rc;\n    lua_assert(var->k == VINDEXED);\n    ra = expr_toanyreg(fs, e);\n    rc = var->u.s.aux;\n    if ((int32_t)rc < 0) {\n      ins = BCINS_ABC(BC_TSETS, ra, var->u.s.info, ~rc);\n    } else if (rc > BCMAX_C) {\n      ins = BCINS_ABC(BC_TSETB, ra, var->u.s.info, rc-(BCMAX_C+1));\n    } else {\n      /* Free late alloced key reg to avoid assert on free of value reg. */\n      /* This can only happen when called from expr_table(). */\n      lua_assert(e->k != VNONRELOC || ra < fs->nactvar ||\n\t\t rc < ra || (bcreg_free(fs, rc),1));\n      ins = BCINS_ABC(BC_TSETV, ra, var->u.s.info, rc);\n    }\n  }\n  bcemit_INS(fs, ins);\n  expr_free(fs, e);\n}\n\n/* Emit method lookup expression. */\nstatic void bcemit_method(FuncState *fs, ExpDesc *e, ExpDesc *key)\n{\n  BCReg idx, func, obj = expr_toanyreg(fs, e);\n  expr_free(fs, e);\n  func = fs->freereg;\n  bcemit_AD(fs, BC_MOV, func+1, obj);  /* Copy object to first argument. */\n  lua_assert(expr_isstrk(key));\n  idx = const_str(fs, key);\n  if (idx <= BCMAX_C) {\n    bcreg_reserve(fs, 2);\n    bcemit_ABC(fs, BC_TGETS, func, obj, idx);\n  } else {\n    bcreg_reserve(fs, 3);\n    bcemit_AD(fs, BC_KSTR, func+2, idx);\n    bcemit_ABC(fs, BC_TGETV, func, obj, func+2);\n    fs->freereg--;\n  }\n  e->u.s.info = func;\n  e->k = VNONRELOC;\n}\n\n/* -- Bytecode emitter for branches --------------------------------------- */\n\n/* Emit unconditional branch. */\nstatic BCPos bcemit_jmp(FuncState *fs)\n{\n  BCPos jpc = fs->jpc;\n  BCPos j = fs->pc - 1;\n  BCIns *ip = &fs->bcbase[j].ins;\n  fs->jpc = NO_JMP;\n  if ((int32_t)j >= (int32_t)fs->lasttarget && bc_op(*ip) == BC_UCLO)\n    setbc_j(ip, NO_JMP);\n  else\n    j = bcemit_AJ(fs, BC_JMP, fs->freereg, NO_JMP);\n  jmp_append(fs, &j, jpc);\n  return j;\n}\n\n/* Invert branch condition of bytecode instruction. */\nstatic void invertcond(FuncState *fs, ExpDesc *e)\n{\n  BCIns *ip = &fs->bcbase[e->u.s.info - 1].ins;\n  setbc_op(ip, bc_op(*ip)^1);\n}\n\n/* Emit conditional branch. */\nstatic BCPos bcemit_branch(FuncState *fs, ExpDesc *e, int cond)\n{\n  BCPos pc;\n  if (e->k == VRELOCABLE) {\n    BCIns *ip = bcptr(fs, e);\n    if (bc_op(*ip) == BC_NOT) {\n      *ip = BCINS_AD(cond ? BC_ISF : BC_IST, 0, bc_d(*ip));\n      return bcemit_jmp(fs);\n    }\n  }\n  if (e->k != VNONRELOC) {\n    bcreg_reserve(fs, 1);\n    expr_toreg_nobranch(fs, e, fs->freereg-1);\n  }\n  bcemit_AD(fs, cond ? BC_ISTC : BC_ISFC, NO_REG, e->u.s.info);\n  pc = bcemit_jmp(fs);\n  expr_free(fs, e);\n  return pc;\n}\n\n/* Emit branch on true condition. */\nstatic void bcemit_branch_t(FuncState *fs, ExpDesc *e)\n{\n  BCPos pc;\n  expr_discharge(fs, e);\n  if (e->k == VKSTR || e->k == VKNUM || e->k == VKTRUE)\n    pc = NO_JMP;  /* Never jump. */\n  else if (e->k == VJMP)\n    invertcond(fs, e), pc = e->u.s.info;\n  else if (e->k == VKFALSE || e->k == VKNIL)\n    expr_toreg_nobranch(fs, e, NO_REG), pc = bcemit_jmp(fs);\n  else\n    pc = bcemit_branch(fs, e, 0);\n  jmp_append(fs, &e->f, pc);\n  jmp_tohere(fs, e->t);\n  e->t = NO_JMP;\n}\n\n/* Emit branch on false condition. */\nstatic void bcemit_branch_f(FuncState *fs, ExpDesc *e)\n{\n  BCPos pc;\n  expr_discharge(fs, e);\n  if (e->k == VKNIL || e->k == VKFALSE)\n    pc = NO_JMP;  /* Never jump. */\n  else if (e->k == VJMP)\n    pc = e->u.s.info;\n  else if (e->k == VKSTR || e->k == VKNUM || e->k == VKTRUE)\n    expr_toreg_nobranch(fs, e, NO_REG), pc = bcemit_jmp(fs);\n  else\n    pc = bcemit_branch(fs, e, 1);\n  jmp_append(fs, &e->t, pc);\n  jmp_tohere(fs, e->f);\n  e->f = NO_JMP;\n}\n\n/* -- Bytecode emitter for operators -------------------------------------- */\n\n/* Try constant-folding of arithmetic operators. */\nstatic int foldarith(BinOpr opr, ExpDesc *e1, ExpDesc *e2)\n{\n  TValue o;\n  lua_Number n;\n  if (!expr_isnumk_nojump(e1) || !expr_isnumk_nojump(e2)) return 0;\n  n = lj_vm_foldarith(expr_numberV(e1), expr_numberV(e2), (int)opr-OPR_ADD);\n  setnumV(&o, n);\n  if (tvisnan(&o) || tvismzero(&o)) return 0;  /* Avoid NaN and -0 as consts. */\n  if (LJ_DUALNUM) {\n    int32_t k = lj_num2int(n);\n    if ((lua_Number)k == n) {\n      setintV(&e1->u.nval, k);\n      return 1;\n    }\n  }\n  setnumV(&e1->u.nval, n);\n  return 1;\n}\n\n/* Emit arithmetic operator. */\nstatic void bcemit_arith(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2)\n{\n  BCReg rb, rc, t;\n  uint32_t op;\n  if (foldarith(opr, e1, e2))\n    return;\n  if (opr == OPR_POW) {\n    op = BC_POW;\n    rc = expr_toanyreg(fs, e2);\n    rb = expr_toanyreg(fs, e1);\n  } else {\n    op = opr-OPR_ADD+BC_ADDVV;\n    /* Must discharge 2nd operand first since VINDEXED might free regs. */\n    expr_toval(fs, e2);\n    if (expr_isnumk(e2) && (rc = const_num(fs, e2)) <= BCMAX_C)\n      op -= BC_ADDVV-BC_ADDVN;\n    else\n      rc = expr_toanyreg(fs, e2);\n    /* 1st operand discharged by bcemit_binop_left, but need KNUM/KSHORT. */\n    lua_assert(expr_isnumk(e1) || e1->k == VNONRELOC);\n    expr_toval(fs, e1);\n    /* Avoid two consts to satisfy bytecode constraints. */\n    if (expr_isnumk(e1) && !expr_isnumk(e2) &&\n\t(t = const_num(fs, e1)) <= BCMAX_B) {\n      rb = rc; rc = t; op -= BC_ADDVV-BC_ADDNV;\n    } else {\n      rb = expr_toanyreg(fs, e1);\n    }\n  }\n  /* Using expr_free might cause asserts if the order is wrong. */\n  if (e1->k == VNONRELOC && e1->u.s.info >= fs->nactvar) fs->freereg--;\n  if (e2->k == VNONRELOC && e2->u.s.info >= fs->nactvar) fs->freereg--;\n  e1->u.s.info = bcemit_ABC(fs, op, 0, rb, rc);\n  e1->k = VRELOCABLE;\n}\n\n/* Emit comparison operator. */\nstatic void bcemit_comp(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2)\n{\n  ExpDesc *eret = e1;\n  BCIns ins;\n  expr_toval(fs, e1);\n  if (opr == OPR_EQ || opr == OPR_NE) {\n    BCOp op = opr == OPR_EQ ? BC_ISEQV : BC_ISNEV;\n    BCReg ra;\n    if (expr_isk(e1)) { e1 = e2; e2 = eret; }  /* Need constant in 2nd arg. */\n    ra = expr_toanyreg(fs, e1);  /* First arg must be in a reg. */\n    expr_toval(fs, e2);\n    switch (e2->k) {\n    case VKNIL: case VKFALSE: case VKTRUE:\n      ins = BCINS_AD(op+(BC_ISEQP-BC_ISEQV), ra, const_pri(e2));\n      break;\n    case VKSTR:\n      ins = BCINS_AD(op+(BC_ISEQS-BC_ISEQV), ra, const_str(fs, e2));\n      break;\n    case VKNUM:\n      ins = BCINS_AD(op+(BC_ISEQN-BC_ISEQV), ra, const_num(fs, e2));\n      break;\n    default:\n      ins = BCINS_AD(op, ra, expr_toanyreg(fs, e2));\n      break;\n    }\n  } else {\n    uint32_t op = opr-OPR_LT+BC_ISLT;\n    BCReg ra, rd;\n    if ((op-BC_ISLT) & 1) {  /* GT -> LT, GE -> LE */\n      e1 = e2; e2 = eret;  /* Swap operands. */\n      op = ((op-BC_ISLT)^3)+BC_ISLT;\n      expr_toval(fs, e1);\n    }\n    rd = expr_toanyreg(fs, e2);\n    ra = expr_toanyreg(fs, e1);\n    ins = BCINS_AD(op, ra, rd);\n  }\n  /* Using expr_free might cause asserts if the order is wrong. */\n  if (e1->k == VNONRELOC && e1->u.s.info >= fs->nactvar) fs->freereg--;\n  if (e2->k == VNONRELOC && e2->u.s.info >= fs->nactvar) fs->freereg--;\n  bcemit_INS(fs, ins);\n  eret->u.s.info = bcemit_jmp(fs);\n  eret->k = VJMP;\n}\n\n/* Fixup left side of binary operator. */\nstatic void bcemit_binop_left(FuncState *fs, BinOpr op, ExpDesc *e)\n{\n  if (op == OPR_AND) {\n    bcemit_branch_t(fs, e);\n  } else if (op == OPR_OR) {\n    bcemit_branch_f(fs, e);\n  } else if (op == OPR_CONCAT) {\n    expr_tonextreg(fs, e);\n  } else if (op == OPR_EQ || op == OPR_NE) {\n    if (!expr_isk_nojump(e)) expr_toanyreg(fs, e);\n  } else {\n    if (!expr_isnumk_nojump(e)) expr_toanyreg(fs, e);\n  }\n}\n\n/* Emit binary operator. */\nstatic void bcemit_binop(FuncState *fs, BinOpr op, ExpDesc *e1, ExpDesc *e2)\n{\n  if (op <= OPR_POW) {\n    bcemit_arith(fs, op, e1, e2);\n  } else if (op == OPR_AND) {\n    lua_assert(e1->t == NO_JMP);  /* List must be closed. */\n    expr_discharge(fs, e2);\n    jmp_append(fs, &e2->f, e1->f);\n    *e1 = *e2;\n  } else if (op == OPR_OR) {\n    lua_assert(e1->f == NO_JMP);  /* List must be closed. */\n    expr_discharge(fs, e2);\n    jmp_append(fs, &e2->t, e1->t);\n    *e1 = *e2;\n  } else if (op == OPR_CONCAT) {\n    expr_toval(fs, e2);\n    if (e2->k == VRELOCABLE && bc_op(*bcptr(fs, e2)) == BC_CAT) {\n      lua_assert(e1->u.s.info == bc_b(*bcptr(fs, e2))-1);\n      expr_free(fs, e1);\n      setbc_b(bcptr(fs, e2), e1->u.s.info);\n      e1->u.s.info = e2->u.s.info;\n    } else {\n      expr_tonextreg(fs, e2);\n      expr_free(fs, e2);\n      expr_free(fs, e1);\n      e1->u.s.info = bcemit_ABC(fs, BC_CAT, 0, e1->u.s.info, e2->u.s.info);\n    }\n    e1->k = VRELOCABLE;\n  } else {\n    lua_assert(op == OPR_NE || op == OPR_EQ ||\n\t       op == OPR_LT || op == OPR_GE || op == OPR_LE || op == OPR_GT);\n    bcemit_comp(fs, op, e1, e2);\n  }\n}\n\n/* Emit unary operator. */\nstatic void bcemit_unop(FuncState *fs, BCOp op, ExpDesc *e)\n{\n  if (op == BC_NOT) {\n    /* Swap true and false lists. */\n    { BCPos temp = e->f; e->f = e->t; e->t = temp; }\n    jmp_dropval(fs, e->f);\n    jmp_dropval(fs, e->t);\n    expr_discharge(fs, e);\n    if (e->k == VKNIL || e->k == VKFALSE) {\n      e->k = VKTRUE;\n      return;\n    } else if (expr_isk(e) || (LJ_HASFFI && e->k == VKCDATA)) {\n      e->k = VKFALSE;\n      return;\n    } else if (e->k == VJMP) {\n      invertcond(fs, e);\n      return;\n    } else if (e->k == VRELOCABLE) {\n      bcreg_reserve(fs, 1);\n      setbc_a(bcptr(fs, e), fs->freereg-1);\n      e->u.s.info = fs->freereg-1;\n      e->k = VNONRELOC;\n    } else {\n      lua_assert(e->k == VNONRELOC);\n    }\n  } else {\n    lua_assert(op == BC_UNM || op == BC_LEN);\n    if (op == BC_UNM && !expr_hasjump(e)) {  /* Constant-fold negations. */\n#if LJ_HASFFI\n      if (e->k == VKCDATA) {  /* Fold in-place since cdata is not interned. */\n\tGCcdata *cd = cdataV(&e->u.nval);\n\tint64_t *p = (int64_t *)cdataptr(cd);\n\tif (cd->ctypeid == CTID_COMPLEX_DOUBLE)\n\t  p[1] ^= (int64_t)U64x(80000000,00000000);\n\telse\n\t  *p = -*p;\n\treturn;\n      } else\n#endif\n      if (expr_isnumk(e) && !expr_numiszero(e)) {  /* Avoid folding to -0. */\n\tTValue *o = expr_numtv(e);\n\tif (tvisint(o)) {\n\t  int32_t k = intV(o);\n\t  if (k == -k)\n\t    setnumV(o, -(lua_Number)k);\n\t  else\n\t    setintV(o, -k);\n\t  return;\n\t} else {\n\t  o->u64 ^= U64x(80000000,00000000);\n\t  return;\n\t}\n      }\n    }\n    expr_toanyreg(fs, e);\n  }\n  expr_free(fs, e);\n  e->u.s.info = bcemit_AD(fs, op, 0, e->u.s.info);\n  e->k = VRELOCABLE;\n}\n\n/* -- Lexer support ------------------------------------------------------- */\n\n/* Check and consume optional token. */\nstatic int lex_opt(LexState *ls, LexToken tok)\n{\n  if (ls->token == tok) {\n    lj_lex_next(ls);\n    return 1;\n  }\n  return 0;\n}\n\n/* Check and consume token. */\nstatic void lex_check(LexState *ls, LexToken tok)\n{\n  if (ls->token != tok)\n    err_token(ls, tok);\n  lj_lex_next(ls);\n}\n\n/* Check for matching token. */\nstatic void lex_match(LexState *ls, LexToken what, LexToken who, BCLine line)\n{\n  if (!lex_opt(ls, what)) {\n    if (line == ls->linenumber) {\n      err_token(ls, what);\n    } else {\n      const char *swhat = lj_lex_token2str(ls, what);\n      const char *swho = lj_lex_token2str(ls, who);\n      lj_lex_error(ls, ls->token, LJ_ERR_XMATCH, swhat, swho, line);\n    }\n  }\n}\n\n/* Check for string token. */\nstatic GCstr *lex_str(LexState *ls)\n{\n  GCstr *s;\n  if (ls->token != TK_name && (LJ_52 || ls->token != TK_goto))\n    err_token(ls, TK_name);\n  s = strV(&ls->tokenval);\n  lj_lex_next(ls);\n  return s;\n}\n\n/* -- Variable handling --------------------------------------------------- */\n\n#define var_get(ls, fs, i)\t((ls)->vstack[(fs)->varmap[(i)]])\n\n/* Define a new local variable. */\nstatic void var_new(LexState *ls, BCReg n, GCstr *name)\n{\n  FuncState *fs = ls->fs;\n  MSize vtop = ls->vtop;\n  checklimit(fs, fs->nactvar+n, LJ_MAX_LOCVAR, \"local variables\");\n  if (LJ_UNLIKELY(vtop >= ls->sizevstack)) {\n    if (ls->sizevstack >= LJ_MAX_VSTACK)\n      lj_lex_error(ls, 0, LJ_ERR_XLIMC, LJ_MAX_VSTACK);\n    lj_mem_growvec(ls->L, ls->vstack, ls->sizevstack, LJ_MAX_VSTACK, VarInfo);\n  }\n  lua_assert((uintptr_t)name < VARNAME__MAX ||\n\t     lj_tab_getstr(fs->kt, name) != NULL);\n  /* NOBARRIER: name is anchored in fs->kt and ls->vstack is not a GCobj. */\n  setgcref(ls->vstack[vtop].name, obj2gco(name));\n  fs->varmap[fs->nactvar+n] = (uint16_t)vtop;\n  ls->vtop = vtop+1;\n}\n\n#define var_new_lit(ls, n, v) \\\n  var_new(ls, (n), lj_parse_keepstr(ls, \"\" v, sizeof(v)-1))\n\n#define var_new_fixed(ls, n, vn) \\\n  var_new(ls, (n), (GCstr *)(uintptr_t)(vn))\n\n/* Add local variables. */\nstatic void var_add(LexState *ls, BCReg nvars)\n{\n  FuncState *fs = ls->fs;\n  BCReg nactvar = fs->nactvar;\n  while (nvars--) {\n    VarInfo *v = &var_get(ls, fs, nactvar);\n    v->startpc = fs->pc;\n    v->slot = nactvar++;\n    v->info = 0;\n  }\n  fs->nactvar = nactvar;\n}\n\n/* Remove local variables. */\nstatic void var_remove(LexState *ls, BCReg tolevel)\n{\n  FuncState *fs = ls->fs;\n  while (fs->nactvar > tolevel)\n    var_get(ls, fs, --fs->nactvar).endpc = fs->pc;\n}\n\n/* Lookup local variable name. */\nstatic BCReg var_lookup_local(FuncState *fs, GCstr *n)\n{\n  int i;\n  for (i = fs->nactvar-1; i >= 0; i--) {\n    if (n == strref(var_get(fs->ls, fs, i).name))\n      return (BCReg)i;\n  }\n  return (BCReg)-1;  /* Not found. */\n}\n\n/* Lookup or add upvalue index. */\nstatic MSize var_lookup_uv(FuncState *fs, MSize vidx, ExpDesc *e)\n{\n  MSize i, n = fs->nuv;\n  for (i = 0; i < n; i++)\n    if (fs->uvmap[i] == vidx)\n      return i;  /* Already exists. */\n  /* Otherwise create a new one. */\n  checklimit(fs, fs->nuv, LJ_MAX_UPVAL, \"upvalues\");\n  lua_assert(e->k == VLOCAL || e->k == VUPVAL);\n  fs->uvmap[n] = (uint16_t)vidx;\n  fs->uvtmp[n] = (uint16_t)(e->k == VLOCAL ? vidx : LJ_MAX_VSTACK+e->u.s.info);\n  fs->nuv = n+1;\n  return n;\n}\n\n/* Forward declaration. */\nstatic void fscope_uvmark(FuncState *fs, BCReg level);\n\n/* Recursively lookup variables in enclosing functions. */\nstatic MSize var_lookup_(FuncState *fs, GCstr *name, ExpDesc *e, int first)\n{\n  if (fs) {\n    BCReg reg = var_lookup_local(fs, name);\n    if ((int32_t)reg >= 0) {  /* Local in this function? */\n      expr_init(e, VLOCAL, reg);\n      if (!first)\n\tfscope_uvmark(fs, reg);  /* Scope now has an upvalue. */\n      return (MSize)(e->u.s.aux = (uint32_t)fs->varmap[reg]);\n    } else {\n      MSize vidx = var_lookup_(fs->prev, name, e, 0);  /* Var in outer func? */\n      if ((int32_t)vidx >= 0) {  /* Yes, make it an upvalue here. */\n\te->u.s.info = (uint8_t)var_lookup_uv(fs, vidx, e);\n\te->k = VUPVAL;\n\treturn vidx;\n      }\n    }\n  } else {  /* Not found in any function, must be a global. */\n    expr_init(e, VGLOBAL, 0);\n    e->u.sval = name;\n  }\n  return (MSize)-1;  /* Global. */\n}\n\n/* Lookup variable name. */\n#define var_lookup(ls, e) \\\n  var_lookup_((ls)->fs, lex_str(ls), (e), 1)\n\n/* -- Goto an label handling ---------------------------------------------- */\n\n/* Add a new goto or label. */\nstatic MSize gola_new(LexState *ls, GCstr *name, uint8_t info, BCPos pc)\n{\n  FuncState *fs = ls->fs;\n  MSize vtop = ls->vtop;\n  if (LJ_UNLIKELY(vtop >= ls->sizevstack)) {\n    if (ls->sizevstack >= LJ_MAX_VSTACK)\n      lj_lex_error(ls, 0, LJ_ERR_XLIMC, LJ_MAX_VSTACK);\n    lj_mem_growvec(ls->L, ls->vstack, ls->sizevstack, LJ_MAX_VSTACK, VarInfo);\n  }\n  lua_assert(name == NAME_BREAK || lj_tab_getstr(fs->kt, name) != NULL);\n  /* NOBARRIER: name is anchored in fs->kt and ls->vstack is not a GCobj. */\n  setgcref(ls->vstack[vtop].name, obj2gco(name));\n  ls->vstack[vtop].startpc = pc;\n  ls->vstack[vtop].slot = (uint8_t)fs->nactvar;\n  ls->vstack[vtop].info = info;\n  ls->vtop = vtop+1;\n  return vtop;\n}\n\n#define gola_isgoto(v)\t\t((v)->info & VSTACK_GOTO)\n#define gola_islabel(v)\t\t((v)->info & VSTACK_LABEL)\n#define gola_isgotolabel(v)\t((v)->info & (VSTACK_GOTO|VSTACK_LABEL))\n\n/* Patch goto to jump to label. */\nstatic void gola_patch(LexState *ls, VarInfo *vg, VarInfo *vl)\n{\n  FuncState *fs = ls->fs;\n  BCPos pc = vg->startpc;\n  setgcrefnull(vg->name);  /* Invalidate pending goto. */\n  setbc_a(&fs->bcbase[pc].ins, vl->slot);\n  jmp_patch(fs, pc, vl->startpc);\n}\n\n/* Patch goto to close upvalues. */\nstatic void gola_close(LexState *ls, VarInfo *vg)\n{\n  FuncState *fs = ls->fs;\n  BCPos pc = vg->startpc;\n  BCIns *ip = &fs->bcbase[pc].ins;\n  lua_assert(gola_isgoto(vg));\n  lua_assert(bc_op(*ip) == BC_JMP || bc_op(*ip) == BC_UCLO);\n  setbc_a(ip, vg->slot);\n  if (bc_op(*ip) == BC_JMP) {\n    BCPos next = jmp_next(fs, pc);\n    if (next != NO_JMP) jmp_patch(fs, next, pc);  /* Jump to UCLO. */\n    setbc_op(ip, BC_UCLO);  /* Turn into UCLO. */\n    setbc_j(ip, NO_JMP);\n  }\n}\n\n/* Resolve pending forward gotos for label. */\nstatic void gola_resolve(LexState *ls, FuncScope *bl, MSize idx)\n{\n  VarInfo *vg = ls->vstack + bl->vstart;\n  VarInfo *vl = ls->vstack + idx;\n  for (; vg < vl; vg++)\n    if (gcrefeq(vg->name, vl->name) && gola_isgoto(vg)) {\n      if (vg->slot < vl->slot) {\n\tGCstr *name = strref(var_get(ls, ls->fs, vg->slot).name);\n\tlua_assert((uintptr_t)name >= VARNAME__MAX);\n\tls->linenumber = ls->fs->bcbase[vg->startpc].line;\n\tlua_assert(strref(vg->name) != NAME_BREAK);\n\tlj_lex_error(ls, 0, LJ_ERR_XGSCOPE,\n\t\t     strdata(strref(vg->name)), strdata(name));\n      }\n      gola_patch(ls, vg, vl);\n    }\n}\n\n/* Fixup remaining gotos and labels for scope. */\nstatic void gola_fixup(LexState *ls, FuncScope *bl)\n{\n  VarInfo *v = ls->vstack + bl->vstart;\n  VarInfo *ve = ls->vstack + ls->vtop;\n  for (; v < ve; v++) {\n    GCstr *name = strref(v->name);\n    if (name != NULL) {  /* Only consider remaining valid gotos/labels. */\n      if (gola_islabel(v)) {\n\tVarInfo *vg;\n\tsetgcrefnull(v->name);  /* Invalidate label that goes out of scope. */\n\tfor (vg = v+1; vg < ve; vg++)  /* Resolve pending backward gotos. */\n\t  if (strref(vg->name) == name && gola_isgoto(vg)) {\n\t    if ((bl->flags&FSCOPE_UPVAL) && vg->slot > v->slot)\n\t      gola_close(ls, vg);\n\t    gola_patch(ls, vg, v);\n\t  }\n      } else if (gola_isgoto(v)) {\n\tif (bl->prev) {  /* Propagate goto or break to outer scope. */\n\t  bl->prev->flags |= name == NAME_BREAK ? FSCOPE_BREAK : FSCOPE_GOLA;\n\t  v->slot = bl->nactvar;\n\t  if ((bl->flags & FSCOPE_UPVAL))\n\t    gola_close(ls, v);\n\t} else {  /* No outer scope: undefined goto label or no loop. */\n\t  ls->linenumber = ls->fs->bcbase[v->startpc].line;\n\t  if (name == NAME_BREAK)\n\t    lj_lex_error(ls, 0, LJ_ERR_XBREAK);\n\t  else\n\t    lj_lex_error(ls, 0, LJ_ERR_XLUNDEF, strdata(name));\n\t}\n      }\n    }\n  }\n}\n\n/* Find existing label. */\nstatic VarInfo *gola_findlabel(LexState *ls, GCstr *name)\n{\n  VarInfo *v = ls->vstack + ls->fs->bl->vstart;\n  VarInfo *ve = ls->vstack + ls->vtop;\n  for (; v < ve; v++)\n    if (strref(v->name) == name && gola_islabel(v))\n      return v;\n  return NULL;\n}\n\n/* -- Scope handling ------------------------------------------------------ */\n\n/* Begin a scope. */\nstatic void fscope_begin(FuncState *fs, FuncScope *bl, int flags)\n{\n  bl->nactvar = (uint8_t)fs->nactvar;\n  bl->flags = flags;\n  bl->vstart = fs->ls->vtop;\n  bl->prev = fs->bl;\n  fs->bl = bl;\n  lua_assert(fs->freereg == fs->nactvar);\n}\n\n/* End a scope. */\nstatic void fscope_end(FuncState *fs)\n{\n  FuncScope *bl = fs->bl;\n  LexState *ls = fs->ls;\n  fs->bl = bl->prev;\n  var_remove(ls, bl->nactvar);\n  fs->freereg = fs->nactvar;\n  lua_assert(bl->nactvar == fs->nactvar);\n  if ((bl->flags & (FSCOPE_UPVAL|FSCOPE_NOCLOSE)) == FSCOPE_UPVAL)\n    bcemit_AJ(fs, BC_UCLO, bl->nactvar, 0);\n  if ((bl->flags & FSCOPE_BREAK)) {\n    if ((bl->flags & FSCOPE_LOOP)) {\n      MSize idx = gola_new(ls, NAME_BREAK, VSTACK_LABEL, fs->pc);\n      ls->vtop = idx;  /* Drop break label immediately. */\n      gola_resolve(ls, bl, idx);\n      return;\n    }  /* else: need the fixup step to propagate the breaks. */\n  } else if (!(bl->flags & FSCOPE_GOLA)) {\n    return;\n  }\n  gola_fixup(ls, bl);\n}\n\n/* Mark scope as having an upvalue. */\nstatic void fscope_uvmark(FuncState *fs, BCReg level)\n{\n  FuncScope *bl;\n  for (bl = fs->bl; bl && bl->nactvar > level; bl = bl->prev)\n    ;\n  if (bl)\n    bl->flags |= FSCOPE_UPVAL;\n}\n\n/* -- Function state management ------------------------------------------- */\n\n/* Fixup bytecode for prototype. */\nstatic void fs_fixup_bc(FuncState *fs, GCproto *pt, BCIns *bc, MSize n)\n{\n  BCInsLine *base = fs->bcbase;\n  MSize i;\n  pt->sizebc = n;\n  bc[0] = BCINS_AD((fs->flags & PROTO_VARARG) ? BC_FUNCV : BC_FUNCF,\n\t\t   fs->framesize, 0);\n  for (i = 1; i < n; i++)\n    bc[i] = base[i].ins;\n}\n\n/* Fixup upvalues for child prototype, step #2. */\nstatic void fs_fixup_uv2(FuncState *fs, GCproto *pt)\n{\n  VarInfo *vstack = fs->ls->vstack;\n  uint16_t *uv = proto_uv(pt);\n  MSize i, n = pt->sizeuv;\n  for (i = 0; i < n; i++) {\n    VarIndex vidx = uv[i];\n    if (vidx >= LJ_MAX_VSTACK)\n      uv[i] = vidx - LJ_MAX_VSTACK;\n    else if ((vstack[vidx].info & VSTACK_VAR_RW))\n      uv[i] = vstack[vidx].slot | PROTO_UV_LOCAL;\n    else\n      uv[i] = vstack[vidx].slot | PROTO_UV_LOCAL | PROTO_UV_IMMUTABLE;\n  }\n}\n\n/* Fixup constants for prototype. */\nstatic void fs_fixup_k(FuncState *fs, GCproto *pt, void *kptr)\n{\n  GCtab *kt;\n  TValue *array;\n  Node *node;\n  MSize i, hmask;\n  checklimitgt(fs, fs->nkn, BCMAX_D+1, \"constants\");\n  checklimitgt(fs, fs->nkgc, BCMAX_D+1, \"constants\");\n  setmref(pt->k, kptr);\n  pt->sizekn = fs->nkn;\n  pt->sizekgc = fs->nkgc;\n  kt = fs->kt;\n  array = tvref(kt->array);\n  for (i = 0; i < kt->asize; i++)\n    if (tvhaskslot(&array[i])) {\n      TValue *tv = &((TValue *)kptr)[tvkslot(&array[i])];\n      if (LJ_DUALNUM)\n\tsetintV(tv, (int32_t)i);\n      else\n\tsetnumV(tv, (lua_Number)i);\n    }\n  node = noderef(kt->node);\n  hmask = kt->hmask;\n  for (i = 0; i <= hmask; i++) {\n    Node *n = &node[i];\n    if (tvhaskslot(&n->val)) {\n      ptrdiff_t kidx = (ptrdiff_t)tvkslot(&n->val);\n      lua_assert(!tvisint(&n->key));\n      if (tvisnum(&n->key)) {\n\tTValue *tv = &((TValue *)kptr)[kidx];\n\tif (LJ_DUALNUM) {\n\t  lua_Number nn = numV(&n->key);\n\t  int32_t k = lj_num2int(nn);\n\t  lua_assert(!tvismzero(&n->key));\n\t  if ((lua_Number)k == nn)\n\t    setintV(tv, k);\n\t  else\n\t    *tv = n->key;\n\t} else {\n\t  *tv = n->key;\n\t}\n      } else {\n\tGCobj *o = gcV(&n->key);\n\tsetgcref(((GCRef *)kptr)[~kidx], o);\n\tlj_gc_objbarrier(fs->L, pt, o);\n\tif (tvisproto(&n->key))\n\t  fs_fixup_uv2(fs, gco2pt(o));\n      }\n    }\n  }\n}\n\n/* Fixup upvalues for prototype, step #1. */\nstatic void fs_fixup_uv1(FuncState *fs, GCproto *pt, uint16_t *uv)\n{\n  setmref(pt->uv, uv);\n  pt->sizeuv = fs->nuv;\n  memcpy(uv, fs->uvtmp, fs->nuv*sizeof(VarIndex));\n}\n\n#ifndef LUAJIT_DISABLE_DEBUGINFO\n/* Prepare lineinfo for prototype. */\nstatic size_t fs_prep_line(FuncState *fs, BCLine numline)\n{\n  return (fs->pc-1) << (numline < 256 ? 0 : numline < 65536 ? 1 : 2);\n}\n\n/* Fixup lineinfo for prototype. */\nstatic void fs_fixup_line(FuncState *fs, GCproto *pt,\n\t\t\t  void *lineinfo, BCLine numline)\n{\n  BCInsLine *base = fs->bcbase + 1;\n  BCLine first = fs->linedefined;\n  MSize i = 0, n = fs->pc-1;\n  pt->firstline = fs->linedefined;\n  pt->numline = numline;\n  setmref(pt->lineinfo, lineinfo);\n  if (LJ_LIKELY(numline < 256)) {\n    uint8_t *li = (uint8_t *)lineinfo;\n    do {\n      BCLine delta = base[i].line - first;\n      lua_assert(delta >= 0 && delta < 256);\n      li[i] = (uint8_t)delta;\n    } while (++i < n);\n  } else if (LJ_LIKELY(numline < 65536)) {\n    uint16_t *li = (uint16_t *)lineinfo;\n    do {\n      BCLine delta = base[i].line - first;\n      lua_assert(delta >= 0 && delta < 65536);\n      li[i] = (uint16_t)delta;\n    } while (++i < n);\n  } else {\n    uint32_t *li = (uint32_t *)lineinfo;\n    do {\n      BCLine delta = base[i].line - first;\n      lua_assert(delta >= 0);\n      li[i] = (uint32_t)delta;\n    } while (++i < n);\n  }\n}\n\n/* Resize buffer if needed. */\nstatic LJ_NOINLINE void fs_buf_resize(LexState *ls, MSize len)\n{\n  MSize sz = ls->sb.sz * 2;\n  while (ls->sb.n + len > sz) sz = sz * 2;\n  lj_str_resizebuf(ls->L, &ls->sb, sz);\n}\n\nstatic LJ_AINLINE void fs_buf_need(LexState *ls, MSize len)\n{\n  if (LJ_UNLIKELY(ls->sb.n + len > ls->sb.sz))\n    fs_buf_resize(ls, len);\n}\n\n/* Add string to buffer. */\nstatic void fs_buf_str(LexState *ls, const char *str, MSize len)\n{\n  char *p = ls->sb.buf + ls->sb.n;\n  MSize i;\n  ls->sb.n += len;\n  for (i = 0; i < len; i++) p[i] = str[i];\n}\n\n/* Add ULEB128 value to buffer. */\nstatic void fs_buf_uleb128(LexState *ls, uint32_t v)\n{\n  MSize n = ls->sb.n;\n  uint8_t *p = (uint8_t *)ls->sb.buf;\n  for (; v >= 0x80; v >>= 7)\n    p[n++] = (uint8_t)((v & 0x7f) | 0x80);\n  p[n++] = (uint8_t)v;\n  ls->sb.n = n;\n}\n\n/* Prepare variable info for prototype. */\nstatic size_t fs_prep_var(LexState *ls, FuncState *fs, size_t *ofsvar)\n{\n  VarInfo *vs =ls->vstack, *ve;\n  MSize i, n;\n  BCPos lastpc;\n  lj_str_resetbuf(&ls->sb);  /* Copy to temp. string buffer. */\n  /* Store upvalue names. */\n  for (i = 0, n = fs->nuv; i < n; i++) {\n    GCstr *s = strref(vs[fs->uvmap[i]].name);\n    MSize len = s->len+1;\n    fs_buf_need(ls, len);\n    fs_buf_str(ls, strdata(s), len);\n  }\n  *ofsvar = ls->sb.n;\n  lastpc = 0;\n  /* Store local variable names and compressed ranges. */\n  for (ve = vs + ls->vtop, vs += fs->vbase; vs < ve; vs++) {\n    if (!gola_isgotolabel(vs)) {\n      GCstr *s = strref(vs->name);\n      BCPos startpc;\n      if ((uintptr_t)s < VARNAME__MAX) {\n\tfs_buf_need(ls, 1 + 2*5);\n\tls->sb.buf[ls->sb.n++] = (uint8_t)(uintptr_t)s;\n      } else {\n\tMSize len = s->len+1;\n\tfs_buf_need(ls, len + 2*5);\n\tfs_buf_str(ls, strdata(s), len);\n      }\n      startpc = vs->startpc;\n      fs_buf_uleb128(ls, startpc-lastpc);\n      fs_buf_uleb128(ls, vs->endpc-startpc);\n      lastpc = startpc;\n    }\n  }\n  fs_buf_need(ls, 1);\n  ls->sb.buf[ls->sb.n++] = '\\0';  /* Terminator for varinfo. */\n  return ls->sb.n;\n}\n\n/* Fixup variable info for prototype. */\nstatic void fs_fixup_var(LexState *ls, GCproto *pt, uint8_t *p, size_t ofsvar)\n{\n  setmref(pt->uvinfo, p);\n  setmref(pt->varinfo, (char *)p + ofsvar);\n  memcpy(p, ls->sb.buf, ls->sb.n);  /* Copy from temp. string buffer. */\n}\n#else\n\n/* Initialize with empty debug info, if disabled. */\n#define fs_prep_line(fs, numline)\t\t(UNUSED(numline), 0)\n#define fs_fixup_line(fs, pt, li, numline) \\\n  pt->firstline = pt->numline = 0, setmref((pt)->lineinfo, NULL)\n#define fs_prep_var(ls, fs, ofsvar)\t\t(UNUSED(ofsvar), 0)\n#define fs_fixup_var(ls, pt, p, ofsvar) \\\n  setmref((pt)->uvinfo, NULL), setmref((pt)->varinfo, NULL)\n\n#endif\n\n/* Check if bytecode op returns. */\nstatic int bcopisret(BCOp op)\n{\n  switch (op) {\n  case BC_CALLMT: case BC_CALLT:\n  case BC_RETM: case BC_RET: case BC_RET0: case BC_RET1:\n    return 1;\n  default:\n    return 0;\n  }\n}\n\n/* Fixup return instruction for prototype. */\nstatic void fs_fixup_ret(FuncState *fs)\n{\n  BCPos lastpc = fs->pc;\n  if (lastpc <= fs->lasttarget || !bcopisret(bc_op(fs->bcbase[lastpc-1].ins))) {\n    if ((fs->bl->flags & FSCOPE_UPVAL))\n      bcemit_AJ(fs, BC_UCLO, 0, 0);\n    bcemit_AD(fs, BC_RET0, 0, 1);  /* Need final return. */\n  }\n  fs->bl->flags |= FSCOPE_NOCLOSE;  /* Handled above. */\n  fscope_end(fs);\n  lua_assert(fs->bl == NULL);\n  /* May need to fixup returns encoded before first function was created. */\n  if (fs->flags & PROTO_FIXUP_RETURN) {\n    BCPos pc;\n    for (pc = 1; pc < lastpc; pc++) {\n      BCIns ins = fs->bcbase[pc].ins;\n      BCPos offset;\n      switch (bc_op(ins)) {\n      case BC_CALLMT: case BC_CALLT:\n      case BC_RETM: case BC_RET: case BC_RET0: case BC_RET1:\n\toffset = bcemit_INS(fs, ins)-(pc+1)+BCBIAS_J;  /* Copy return ins. */\n\tif (offset > BCMAX_D)\n\t  err_syntax(fs->ls, LJ_ERR_XFIXUP);\n\t/* Replace with UCLO plus branch. */\n\tfs->bcbase[pc].ins = BCINS_AD(BC_UCLO, 0, offset);\n\tbreak;\n      case BC_UCLO:\n\treturn;  /* We're done. */\n      default:\n\tbreak;\n      }\n    }\n  }\n}\n\n/* Finish a FuncState and return the new prototype. */\nstatic GCproto *fs_finish(LexState *ls, BCLine line)\n{\n  lua_State *L = ls->L;\n  FuncState *fs = ls->fs;\n  BCLine numline = line - fs->linedefined;\n  size_t sizept, ofsk, ofsuv, ofsli, ofsdbg, ofsvar;\n  GCproto *pt;\n\n  /* Apply final fixups. */\n  fs_fixup_ret(fs);\n\n  /* Calculate total size of prototype including all colocated arrays. */\n  sizept = sizeof(GCproto) + fs->pc*sizeof(BCIns) + fs->nkgc*sizeof(GCRef);\n  sizept = (sizept + sizeof(TValue)-1) & ~(sizeof(TValue)-1);\n  ofsk = sizept; sizept += fs->nkn*sizeof(TValue);\n  ofsuv = sizept; sizept += ((fs->nuv+1)&~1)*2;\n  ofsli = sizept; sizept += fs_prep_line(fs, numline);\n  ofsdbg = sizept; sizept += fs_prep_var(ls, fs, &ofsvar);\n\n  /* Allocate prototype and initialize its fields. */\n  pt = (GCproto *)lj_mem_newgco(L, (MSize)sizept);\n  pt->gct = ~LJ_TPROTO;\n  pt->sizept = (MSize)sizept;\n  pt->trace = 0;\n  pt->flags = (uint8_t)(fs->flags & ~(PROTO_HAS_RETURN|PROTO_FIXUP_RETURN));\n  pt->numparams = fs->numparams;\n  pt->framesize = fs->framesize;\n  setgcref(pt->chunkname, obj2gco(ls->chunkname));\n\n  /* Close potentially uninitialized gap between bc and kgc. */\n  *(uint32_t *)((char *)pt + ofsk - sizeof(GCRef)*(fs->nkgc+1)) = 0;\n  fs_fixup_bc(fs, pt, (BCIns *)((char *)pt + sizeof(GCproto)), fs->pc);\n  fs_fixup_k(fs, pt, (void *)((char *)pt + ofsk));\n  fs_fixup_uv1(fs, pt, (uint16_t *)((char *)pt + ofsuv));\n  fs_fixup_line(fs, pt, (void *)((char *)pt + ofsli), numline);\n  fs_fixup_var(ls, pt, (uint8_t *)((char *)pt + ofsdbg), ofsvar);\n\n  lj_vmevent_send(L, BC,\n    setprotoV(L, L->top++, pt);\n  );\n\n  L->top--;  /* Pop table of constants. */\n  ls->vtop = fs->vbase;  /* Reset variable stack. */\n  ls->fs = fs->prev;\n  lua_assert(ls->fs != NULL || ls->token == TK_eof);\n  return pt;\n}\n\n/* Initialize a new FuncState. */\nstatic void fs_init(LexState *ls, FuncState *fs)\n{\n  lua_State *L = ls->L;\n  fs->prev = ls->fs; ls->fs = fs;  /* Append to list. */\n  fs->ls = ls;\n  fs->vbase = ls->vtop;\n  fs->L = L;\n  fs->pc = 0;\n  fs->lasttarget = 0;\n  fs->jpc = NO_JMP;\n  fs->freereg = 0;\n  fs->nkgc = 0;\n  fs->nkn = 0;\n  fs->nactvar = 0;\n  fs->nuv = 0;\n  fs->bl = NULL;\n  fs->flags = 0;\n  fs->framesize = 1;  /* Minimum frame size. */\n  fs->kt = lj_tab_new(L, 0, 0);\n  /* Anchor table of constants in stack to avoid being collected. */\n  settabV(L, L->top, fs->kt);\n  incr_top(L);\n}\n\n/* -- Expressions --------------------------------------------------------- */\n\n/* Forward declaration. */\nstatic void expr(LexState *ls, ExpDesc *v);\n\n/* Return string expression. */\nstatic void expr_str(LexState *ls, ExpDesc *e)\n{\n  expr_init(e, VKSTR, 0);\n  e->u.sval = lex_str(ls);\n}\n\n/* Return index expression. */\nstatic void expr_index(FuncState *fs, ExpDesc *t, ExpDesc *e)\n{\n  /* Already called: expr_toval(fs, e). */\n  t->k = VINDEXED;\n  if (expr_isnumk(e)) {\n#if LJ_DUALNUM\n    if (tvisint(expr_numtv(e))) {\n      int32_t k = intV(expr_numtv(e));\n      if (checku8(k)) {\n\tt->u.s.aux = BCMAX_C+1+(uint32_t)k;  /* 256..511: const byte key */\n\treturn;\n      }\n    }\n#else\n    lua_Number n = expr_numberV(e);\n    int32_t k = lj_num2int(n);\n    if (checku8(k) && n == (lua_Number)k) {\n      t->u.s.aux = BCMAX_C+1+(uint32_t)k;  /* 256..511: const byte key */\n      return;\n    }\n#endif\n  } else if (expr_isstrk(e)) {\n    BCReg idx = const_str(fs, e);\n    if (idx <= BCMAX_C) {\n      t->u.s.aux = ~idx;  /* -256..-1: const string key */\n      return;\n    }\n  }\n  t->u.s.aux = expr_toanyreg(fs, e);  /* 0..255: register */\n}\n\n/* Parse index expression with named field. */\nstatic void expr_field(LexState *ls, ExpDesc *v)\n{\n  FuncState *fs = ls->fs;\n  ExpDesc key;\n  expr_toanyreg(fs, v);\n  lj_lex_next(ls);  /* Skip dot or colon. */\n  expr_str(ls, &key);\n  expr_index(fs, v, &key);\n}\n\n/* Parse index expression with brackets. */\nstatic void expr_bracket(LexState *ls, ExpDesc *v)\n{\n  lj_lex_next(ls);  /* Skip '['. */\n  expr(ls, v);\n  expr_toval(ls->fs, v);\n  lex_check(ls, ']');\n}\n\n/* Get value of constant expression. */\nstatic void expr_kvalue(TValue *v, ExpDesc *e)\n{\n  if (e->k <= VKTRUE) {\n    setitype(v, ~(uint32_t)e->k);\n  } else if (e->k == VKSTR) {\n    setgcref(v->gcr, obj2gco(e->u.sval));\n    setitype(v, LJ_TSTR);\n  } else {\n    lua_assert(tvisnumber(expr_numtv(e)));\n    *v = *expr_numtv(e);\n  }\n}\n\n/* Parse table constructor expression. */\nstatic void expr_table(LexState *ls, ExpDesc *e)\n{\n  FuncState *fs = ls->fs;\n  BCLine line = ls->linenumber;\n  GCtab *t = NULL;\n  int vcall = 0, needarr = 0, fixt = 0;\n  uint32_t narr = 1;  /* First array index. */\n  uint32_t nhash = 0;  /* Number of hash entries. */\n  BCReg freg = fs->freereg;\n  BCPos pc = bcemit_AD(fs, BC_TNEW, freg, 0);\n  expr_init(e, VNONRELOC, freg);\n  bcreg_reserve(fs, 1);\n  freg++;\n  lex_check(ls, '{');\n  while (ls->token != '}') {\n    ExpDesc key, val;\n    vcall = 0;\n    if (ls->token == '[') {\n      expr_bracket(ls, &key);  /* Already calls expr_toval. */\n      if (!expr_isk(&key)) expr_index(fs, e, &key);\n      if (expr_isnumk(&key) && expr_numiszero(&key)) needarr = 1; else nhash++;\n      lex_check(ls, '=');\n    } else if ((ls->token == TK_name || (!LJ_52 && ls->token == TK_goto)) &&\n\t       lj_lex_lookahead(ls) == '=') {\n      expr_str(ls, &key);\n      lex_check(ls, '=');\n      nhash++;\n    } else {\n      expr_init(&key, VKNUM, 0);\n      setintV(&key.u.nval, (int)narr);\n      narr++;\n      needarr = vcall = 1;\n    }\n    expr(ls, &val);\n    if (expr_isk(&key) && key.k != VKNIL &&\n\t(key.k == VKSTR || expr_isk_nojump(&val))) {\n      TValue k, *v;\n      if (!t) {  /* Create template table on demand. */\n\tBCReg kidx;\n\tt = lj_tab_new(fs->L, needarr ? narr : 0, hsize2hbits(nhash));\n\tkidx = const_gc(fs, obj2gco(t), LJ_TTAB);\n\tfs->bcbase[pc].ins = BCINS_AD(BC_TDUP, freg-1, kidx);\n      }\n      vcall = 0;\n      expr_kvalue(&k, &key);\n      v = lj_tab_set(fs->L, t, &k);\n      lj_gc_anybarriert(fs->L, t);\n      if (expr_isk_nojump(&val)) {  /* Add const key/value to template table. */\n\texpr_kvalue(v, &val);\n      } else {  /* Otherwise create dummy string key (avoids lj_tab_newkey). */\n\tsettabV(fs->L, v, t);  /* Preserve key with table itself as value. */\n\tfixt = 1;   /* Fix this later, after all resizes. */\n\tgoto nonconst;\n      }\n    } else {\n    nonconst:\n      if (val.k != VCALL) { expr_toanyreg(fs, &val); vcall = 0; }\n      if (expr_isk(&key)) expr_index(fs, e, &key);\n      bcemit_store(fs, e, &val);\n    }\n    fs->freereg = freg;\n    if (!lex_opt(ls, ',') && !lex_opt(ls, ';')) break;\n  }\n  lex_match(ls, '}', '{', line);\n  if (vcall) {\n    BCInsLine *ilp = &fs->bcbase[fs->pc-1];\n    ExpDesc en;\n    lua_assert(bc_a(ilp->ins) == freg &&\n\t       bc_op(ilp->ins) == (narr > 256 ? BC_TSETV : BC_TSETB));\n    expr_init(&en, VKNUM, 0);\n    en.u.nval.u32.lo = narr-1;\n    en.u.nval.u32.hi = 0x43300000;  /* Biased integer to avoid denormals. */\n    if (narr > 256) { fs->pc--; ilp--; }\n    ilp->ins = BCINS_AD(BC_TSETM, freg, const_num(fs, &en));\n    setbc_b(&ilp[-1].ins, 0);\n  }\n  if (pc == fs->pc-1) {  /* Make expr relocable if possible. */\n    e->u.s.info = pc;\n    fs->freereg--;\n    e->k = VRELOCABLE;\n  } else {\n    e->k = VNONRELOC;  /* May have been changed by expr_index. */\n  }\n  if (!t) {  /* Construct TNEW RD: hhhhhaaaaaaaaaaa. */\n    BCIns *ip = &fs->bcbase[pc].ins;\n    if (!needarr) narr = 0;\n    else if (narr < 3) narr = 3;\n    else if (narr > 0x7ff) narr = 0x7ff;\n    setbc_d(ip, narr|(hsize2hbits(nhash)<<11));\n  } else {\n    if (needarr && t->asize < narr)\n      lj_tab_reasize(fs->L, t, narr-1);\n    if (fixt) {  /* Fix value for dummy keys in template table. */\n      Node *node = noderef(t->node);\n      uint32_t i, hmask = t->hmask;\n      for (i = 0; i <= hmask; i++) {\n\tNode *n = &node[i];\n\tif (tvistab(&n->val)) {\n\t  lua_assert(tabV(&n->val) == t);\n\t  setnilV(&n->val);  /* Turn value into nil. */\n\t}\n      }\n    }\n    lj_gc_check(fs->L);\n  }\n}\n\n/* Parse function parameters. */\nstatic BCReg parse_params(LexState *ls, int needself)\n{\n  FuncState *fs = ls->fs;\n  BCReg nparams = 0;\n  lex_check(ls, '(');\n  if (needself)\n    var_new_lit(ls, nparams++, \"self\");\n  if (ls->token != ')') {\n    do {\n      if (ls->token == TK_name || (!LJ_52 && ls->token == TK_goto)) {\n\tvar_new(ls, nparams++, lex_str(ls));\n      } else if (ls->token == TK_dots) {\n\tlj_lex_next(ls);\n\tfs->flags |= PROTO_VARARG;\n\tbreak;\n      } else {\n\terr_syntax(ls, LJ_ERR_XPARAM);\n      }\n    } while (lex_opt(ls, ','));\n  }\n  var_add(ls, nparams);\n  lua_assert(fs->nactvar == nparams);\n  bcreg_reserve(fs, nparams);\n  lex_check(ls, ')');\n  return nparams;\n}\n\n/* Forward declaration. */\nstatic void parse_chunk(LexState *ls);\n\n/* Parse body of a function. */\nstatic void parse_body(LexState *ls, ExpDesc *e, int needself, BCLine line)\n{\n  FuncState fs, *pfs = ls->fs;\n  FuncScope bl;\n  GCproto *pt;\n  ptrdiff_t oldbase = pfs->bcbase - ls->bcstack;\n  fs_init(ls, &fs);\n  fscope_begin(&fs, &bl, 0);\n  fs.linedefined = line;\n  fs.numparams = (uint8_t)parse_params(ls, needself);\n  fs.bcbase = pfs->bcbase + pfs->pc;\n  fs.bclim = pfs->bclim - pfs->pc;\n  bcemit_AD(&fs, BC_FUNCF, 0, 0);  /* Placeholder. */\n  parse_chunk(ls);\n  if (ls->token != TK_end) lex_match(ls, TK_end, TK_function, line);\n  pt = fs_finish(ls, (ls->lastline = ls->linenumber));\n  pfs->bcbase = ls->bcstack + oldbase;  /* May have been reallocated. */\n  pfs->bclim = (BCPos)(ls->sizebcstack - oldbase);\n  /* Store new prototype in the constant array of the parent. */\n  expr_init(e, VRELOCABLE,\n\t    bcemit_AD(pfs, BC_FNEW, 0, const_gc(pfs, obj2gco(pt), LJ_TPROTO)));\n#if LJ_HASFFI\n  pfs->flags |= (fs.flags & PROTO_FFI);\n#endif\n  if (!(pfs->flags & PROTO_CHILD)) {\n    if (pfs->flags & PROTO_HAS_RETURN)\n      pfs->flags |= PROTO_FIXUP_RETURN;\n    pfs->flags |= PROTO_CHILD;\n  }\n  lj_lex_next(ls);\n}\n\n/* Parse expression list. Last expression is left open. */\nstatic BCReg expr_list(LexState *ls, ExpDesc *v)\n{\n  BCReg n = 1;\n  expr(ls, v);\n  while (lex_opt(ls, ',')) {\n    expr_tonextreg(ls->fs, v);\n    expr(ls, v);\n    n++;\n  }\n  return n;\n}\n\n/* Parse function argument list. */\nstatic void parse_args(LexState *ls, ExpDesc *e)\n{\n  FuncState *fs = ls->fs;\n  ExpDesc args;\n  BCIns ins;\n  BCReg base;\n  BCLine line = ls->linenumber;\n  if (ls->token == '(') {\n#if !LJ_52\n    if (line != ls->lastline)\n      err_syntax(ls, LJ_ERR_XAMBIG);\n#endif\n    lj_lex_next(ls);\n    if (ls->token == ')') {  /* f(). */\n      args.k = VVOID;\n    } else {\n      expr_list(ls, &args);\n      if (args.k == VCALL)  /* f(a, b, g()) or f(a, b, ...). */\n\tsetbc_b(bcptr(fs, &args), 0);  /* Pass on multiple results. */\n    }\n    lex_match(ls, ')', '(', line);\n  } else if (ls->token == '{') {\n    expr_table(ls, &args);\n  } else if (ls->token == TK_string) {\n    expr_init(&args, VKSTR, 0);\n    args.u.sval = strV(&ls->tokenval);\n    lj_lex_next(ls);\n  } else {\n    err_syntax(ls, LJ_ERR_XFUNARG);\n    return;  /* Silence compiler. */\n  }\n  lua_assert(e->k == VNONRELOC);\n  base = e->u.s.info;  /* Base register for call. */\n  if (args.k == VCALL) {\n    ins = BCINS_ABC(BC_CALLM, base, 2, args.u.s.aux - base - 1);\n  } else {\n    if (args.k != VVOID)\n      expr_tonextreg(fs, &args);\n    ins = BCINS_ABC(BC_CALL, base, 2, fs->freereg - base);\n  }\n  expr_init(e, VCALL, bcemit_INS(fs, ins));\n  e->u.s.aux = base;\n  fs->bcbase[fs->pc - 1].line = line;\n  fs->freereg = base+1;  /* Leave one result by default. */\n}\n\n/* Parse primary expression. */\nstatic void expr_primary(LexState *ls, ExpDesc *v)\n{\n  FuncState *fs = ls->fs;\n  /* Parse prefix expression. */\n  if (ls->token == '(') {\n    BCLine line = ls->linenumber;\n    lj_lex_next(ls);\n    expr(ls, v);\n    lex_match(ls, ')', '(', line);\n    expr_discharge(ls->fs, v);\n  } else if (ls->token == TK_name || (!LJ_52 && ls->token == TK_goto)) {\n    var_lookup(ls, v);\n  } else {\n    err_syntax(ls, LJ_ERR_XSYMBOL);\n  }\n  for (;;) {  /* Parse multiple expression suffixes. */\n    if (ls->token == '.') {\n      expr_field(ls, v);\n    } else if (ls->token == '[') {\n      ExpDesc key;\n      expr_toanyreg(fs, v);\n      expr_bracket(ls, &key);\n      expr_index(fs, v, &key);\n    } else if (ls->token == ':') {\n      ExpDesc key;\n      lj_lex_next(ls);\n      expr_str(ls, &key);\n      bcemit_method(fs, v, &key);\n      parse_args(ls, v);\n    } else if (ls->token == '(' || ls->token == TK_string || ls->token == '{') {\n      expr_tonextreg(fs, v);\n      parse_args(ls, v);\n    } else {\n      break;\n    }\n  }\n}\n\n/* Parse simple expression. */\nstatic void expr_simple(LexState *ls, ExpDesc *v)\n{\n  switch (ls->token) {\n  case TK_number:\n    expr_init(v, (LJ_HASFFI && tviscdata(&ls->tokenval)) ? VKCDATA : VKNUM, 0);\n    copyTV(ls->L, &v->u.nval, &ls->tokenval);\n    break;\n  case TK_string:\n    expr_init(v, VKSTR, 0);\n    v->u.sval = strV(&ls->tokenval);\n    break;\n  case TK_nil:\n    expr_init(v, VKNIL, 0);\n    break;\n  case TK_true:\n    expr_init(v, VKTRUE, 0);\n    break;\n  case TK_false:\n    expr_init(v, VKFALSE, 0);\n    break;\n  case TK_dots: {  /* Vararg. */\n    FuncState *fs = ls->fs;\n    BCReg base;\n    checkcond(ls, fs->flags & PROTO_VARARG, LJ_ERR_XDOTS);\n    bcreg_reserve(fs, 1);\n    base = fs->freereg-1;\n    expr_init(v, VCALL, bcemit_ABC(fs, BC_VARG, base, 2, fs->numparams));\n    v->u.s.aux = base;\n    break;\n  }\n  case '{':  /* Table constructor. */\n    expr_table(ls, v);\n    return;\n  case TK_function:\n    lj_lex_next(ls);\n    parse_body(ls, v, 0, ls->linenumber);\n    return;\n  default:\n    expr_primary(ls, v);\n    return;\n  }\n  lj_lex_next(ls);\n}\n\n/* Manage syntactic levels to avoid blowing up the stack. */\nstatic void synlevel_begin(LexState *ls)\n{\n  if (++ls->level >= LJ_MAX_XLEVEL)\n    lj_lex_error(ls, 0, LJ_ERR_XLEVELS);\n}\n\n#define synlevel_end(ls)\t((ls)->level--)\n\n/* Convert token to binary operator. */\nstatic BinOpr token2binop(LexToken tok)\n{\n  switch (tok) {\n  case '+':\treturn OPR_ADD;\n  case '-':\treturn OPR_SUB;\n  case '*':\treturn OPR_MUL;\n  case '/':\treturn OPR_DIV;\n  case '%':\treturn OPR_MOD;\n  case '^':\treturn OPR_POW;\n  case TK_concat: return OPR_CONCAT;\n  case TK_ne:\treturn OPR_NE;\n  case TK_eq:\treturn OPR_EQ;\n  case '<':\treturn OPR_LT;\n  case TK_le:\treturn OPR_LE;\n  case '>':\treturn OPR_GT;\n  case TK_ge:\treturn OPR_GE;\n  case TK_and:\treturn OPR_AND;\n  case TK_or:\treturn OPR_OR;\n  default:\treturn OPR_NOBINOPR;\n  }\n}\n\n/* Priorities for each binary operator. ORDER OPR. */\nstatic const struct {\n  uint8_t left;\t\t/* Left priority. */\n  uint8_t right;\t/* Right priority. */\n} priority[] = {\n  {6,6}, {6,6}, {7,7}, {7,7}, {7,7},\t/* ADD SUB MUL DIV MOD */\n  {10,9}, {5,4},\t\t\t/* POW CONCAT (right associative) */\n  {3,3}, {3,3},\t\t\t\t/* EQ NE */\n  {3,3}, {3,3}, {3,3}, {3,3},\t\t/* LT GE GT LE */\n  {2,2}, {1,1}\t\t\t\t/* AND OR */\n};\n\n#define UNARY_PRIORITY\t\t8  /* Priority for unary operators. */\n\n/* Forward declaration. */\nstatic BinOpr expr_binop(LexState *ls, ExpDesc *v, uint32_t limit);\n\n/* Parse unary expression. */\nstatic void expr_unop(LexState *ls, ExpDesc *v)\n{\n  BCOp op;\n  if (ls->token == TK_not) {\n    op = BC_NOT;\n  } else if (ls->token == '-') {\n    op = BC_UNM;\n  } else if (ls->token == '#') {\n    op = BC_LEN;\n  } else {\n    expr_simple(ls, v);\n    return;\n  }\n  lj_lex_next(ls);\n  expr_binop(ls, v, UNARY_PRIORITY);\n  bcemit_unop(ls->fs, op, v);\n}\n\n/* Parse binary expressions with priority higher than the limit. */\nstatic BinOpr expr_binop(LexState *ls, ExpDesc *v, uint32_t limit)\n{\n  BinOpr op;\n  synlevel_begin(ls);\n  expr_unop(ls, v);\n  op = token2binop(ls->token);\n  while (op != OPR_NOBINOPR && priority[op].left > limit) {\n    ExpDesc v2;\n    BinOpr nextop;\n    lj_lex_next(ls);\n    bcemit_binop_left(ls->fs, op, v);\n    /* Parse binary expression with higher priority. */\n    nextop = expr_binop(ls, &v2, priority[op].right);\n    bcemit_binop(ls->fs, op, v, &v2);\n    op = nextop;\n  }\n  synlevel_end(ls);\n  return op;  /* Return unconsumed binary operator (if any). */\n}\n\n/* Parse expression. */\nstatic void expr(LexState *ls, ExpDesc *v)\n{\n  expr_binop(ls, v, 0);  /* Priority 0: parse whole expression. */\n}\n\n/* Assign expression to the next register. */\nstatic void expr_next(LexState *ls)\n{\n  ExpDesc e;\n  expr(ls, &e);\n  expr_tonextreg(ls->fs, &e);\n}\n\n/* Parse conditional expression. */\nstatic BCPos expr_cond(LexState *ls)\n{\n  ExpDesc v;\n  expr(ls, &v);\n  if (v.k == VKNIL) v.k = VKFALSE;\n  bcemit_branch_t(ls->fs, &v);\n  return v.f;\n}\n\n/* -- Assignments --------------------------------------------------------- */\n\n/* List of LHS variables. */\ntypedef struct LHSVarList {\n  ExpDesc v;\t\t\t/* LHS variable. */\n  struct LHSVarList *prev;\t/* Link to previous LHS variable. */\n} LHSVarList;\n\n/* Eliminate write-after-read hazards for local variable assignment. */\nstatic void assign_hazard(LexState *ls, LHSVarList *lh, const ExpDesc *v)\n{\n  FuncState *fs = ls->fs;\n  BCReg reg = v->u.s.info;  /* Check against this variable. */\n  BCReg tmp = fs->freereg;  /* Rename to this temp. register (if needed). */\n  int hazard = 0;\n  for (; lh; lh = lh->prev) {\n    if (lh->v.k == VINDEXED) {\n      if (lh->v.u.s.info == reg) {  /* t[i], t = 1, 2 */\n\thazard = 1;\n\tlh->v.u.s.info = tmp;\n      }\n      if (lh->v.u.s.aux == reg) {  /* t[i], i = 1, 2 */\n\thazard = 1;\n\tlh->v.u.s.aux = tmp;\n      }\n    }\n  }\n  if (hazard) {\n    bcemit_AD(fs, BC_MOV, tmp, reg);  /* Rename conflicting variable. */\n    bcreg_reserve(fs, 1);\n  }\n}\n\n/* Adjust LHS/RHS of an assignment. */\nstatic void assign_adjust(LexState *ls, BCReg nvars, BCReg nexps, ExpDesc *e)\n{\n  FuncState *fs = ls->fs;\n  int32_t extra = (int32_t)nvars - (int32_t)nexps;\n  if (e->k == VCALL) {\n    extra++;  /* Compensate for the VCALL itself. */\n    if (extra < 0) extra = 0;\n    setbc_b(bcptr(fs, e), extra+1);  /* Fixup call results. */\n    if (extra > 1) bcreg_reserve(fs, (BCReg)extra-1);\n  } else {\n    if (e->k != VVOID)\n      expr_tonextreg(fs, e);  /* Close last expression. */\n    if (extra > 0) {  /* Leftover LHS are set to nil. */\n      BCReg reg = fs->freereg;\n      bcreg_reserve(fs, (BCReg)extra);\n      bcemit_nil(fs, reg, (BCReg)extra);\n    }\n  }\n}\n\n/* Recursively parse assignment statement. */\nstatic void parse_assignment(LexState *ls, LHSVarList *lh, BCReg nvars)\n{\n  ExpDesc e;\n  checkcond(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED, LJ_ERR_XSYNTAX);\n  if (lex_opt(ls, ',')) {  /* Collect LHS list and recurse upwards. */\n    LHSVarList vl;\n    vl.prev = lh;\n    expr_primary(ls, &vl.v);\n    if (vl.v.k == VLOCAL)\n      assign_hazard(ls, lh, &vl.v);\n    checklimit(ls->fs, ls->level + nvars, LJ_MAX_XLEVEL, \"variable names\");\n    parse_assignment(ls, &vl, nvars+1);\n  } else {  /* Parse RHS. */\n    BCReg nexps;\n    lex_check(ls, '=');\n    nexps = expr_list(ls, &e);\n    if (nexps == nvars) {\n      if (e.k == VCALL) {\n\tif (bc_op(*bcptr(ls->fs, &e)) == BC_VARG) {  /* Vararg assignment. */\n\t  ls->fs->freereg--;\n\t  e.k = VRELOCABLE;\n\t} else {  /* Multiple call results. */\n\t  e.u.s.info = e.u.s.aux;  /* Base of call is not relocatable. */\n\t  e.k = VNONRELOC;\n\t}\n      }\n      bcemit_store(ls->fs, &lh->v, &e);\n      return;\n    }\n    assign_adjust(ls, nvars, nexps, &e);\n    if (nexps > nvars)\n      ls->fs->freereg -= nexps - nvars;  /* Drop leftover regs. */\n  }\n  /* Assign RHS to LHS and recurse downwards. */\n  expr_init(&e, VNONRELOC, ls->fs->freereg-1);\n  bcemit_store(ls->fs, &lh->v, &e);\n}\n\n/* Parse call statement or assignment. */\nstatic void parse_call_assign(LexState *ls)\n{\n  FuncState *fs = ls->fs;\n  LHSVarList vl;\n  expr_primary(ls, &vl.v);\n  if (vl.v.k == VCALL) {  /* Function call statement. */\n    setbc_b(bcptr(fs, &vl.v), 1);  /* No results. */\n  } else {  /* Start of an assignment. */\n    vl.prev = NULL;\n    parse_assignment(ls, &vl, 1);\n  }\n}\n\n/* Parse 'local' statement. */\nstatic void parse_local(LexState *ls)\n{\n  if (lex_opt(ls, TK_function)) {  /* Local function declaration. */\n    ExpDesc v, b;\n    FuncState *fs = ls->fs;\n    var_new(ls, 0, lex_str(ls));\n    expr_init(&v, VLOCAL, fs->freereg);\n    v.u.s.aux = fs->varmap[fs->freereg];\n    bcreg_reserve(fs, 1);\n    var_add(ls, 1);\n    parse_body(ls, &b, 0, ls->linenumber);\n    /* bcemit_store(fs, &v, &b) without setting VSTACK_VAR_RW. */\n    expr_free(fs, &b);\n    expr_toreg(fs, &b, v.u.s.info);\n    /* The upvalue is in scope, but the local is only valid after the store. */\n    var_get(ls, fs, fs->nactvar - 1).startpc = fs->pc;\n  } else {  /* Local variable declaration. */\n    ExpDesc e;\n    BCReg nexps, nvars = 0;\n    do {  /* Collect LHS. */\n      var_new(ls, nvars++, lex_str(ls));\n    } while (lex_opt(ls, ','));\n    if (lex_opt(ls, '=')) {  /* Optional RHS. */\n      nexps = expr_list(ls, &e);\n    } else {  /* Or implicitly set to nil. */\n      e.k = VVOID;\n      nexps = 0;\n    }\n    assign_adjust(ls, nvars, nexps, &e);\n    var_add(ls, nvars);\n  }\n}\n\n/* Parse 'function' statement. */\nstatic void parse_func(LexState *ls, BCLine line)\n{\n  FuncState *fs;\n  ExpDesc v, b;\n  int needself = 0;\n  lj_lex_next(ls);  /* Skip 'function'. */\n  /* Parse function name. */\n  var_lookup(ls, &v);\n  while (ls->token == '.')  /* Multiple dot-separated fields. */\n    expr_field(ls, &v);\n  if (ls->token == ':') {  /* Optional colon to signify method call. */\n    needself = 1;\n    expr_field(ls, &v);\n  }\n  parse_body(ls, &b, needself, line);\n  fs = ls->fs;\n  bcemit_store(fs, &v, &b);\n  fs->bcbase[fs->pc - 1].line = line;  /* Set line for the store. */\n}\n\n/* -- Control transfer statements ----------------------------------------- */\n\n/* Check for end of block. */\nstatic int endofblock(LexToken token)\n{\n  switch (token) {\n  case TK_else: case TK_elseif: case TK_end: case TK_until: case TK_eof:\n    return 1;\n  default:\n    return 0;\n  }\n}\n\n/* Parse 'return' statement. */\nstatic void parse_return(LexState *ls)\n{\n  BCIns ins;\n  FuncState *fs = ls->fs;\n  lj_lex_next(ls);  /* Skip 'return'. */\n  fs->flags |= PROTO_HAS_RETURN;\n  if (endofblock(ls->token) || ls->token == ';') {  /* Bare return. */\n    ins = BCINS_AD(BC_RET0, 0, 1);\n  } else {  /* Return with one or more values. */\n    ExpDesc e;  /* Receives the _last_ expression in the list. */\n    BCReg nret = expr_list(ls, &e);\n    if (nret == 1) {  /* Return one result. */\n      if (e.k == VCALL) {  /* Check for tail call. */\n\tBCIns *ip = bcptr(fs, &e);\n\t/* It doesn't pay off to add BC_VARGT just for 'return ...'. */\n\tif (bc_op(*ip) == BC_VARG) goto notailcall;\n\tfs->pc--;\n\tins = BCINS_AD(bc_op(*ip)-BC_CALL+BC_CALLT, bc_a(*ip), bc_c(*ip));\n      } else {  /* Can return the result from any register. */\n\tins = BCINS_AD(BC_RET1, expr_toanyreg(fs, &e), 2);\n      }\n    } else {\n      if (e.k == VCALL) {  /* Append all results from a call. */\n      notailcall:\n\tsetbc_b(bcptr(fs, &e), 0);\n\tins = BCINS_AD(BC_RETM, fs->nactvar, e.u.s.aux - fs->nactvar);\n      } else {\n\texpr_tonextreg(fs, &e);  /* Force contiguous registers. */\n\tins = BCINS_AD(BC_RET, fs->nactvar, nret+1);\n      }\n    }\n  }\n  if (fs->flags & PROTO_CHILD)\n    bcemit_AJ(fs, BC_UCLO, 0, 0);  /* May need to close upvalues first. */\n  bcemit_INS(fs, ins);\n}\n\n/* Parse 'break' statement. */\nstatic void parse_break(LexState *ls)\n{\n  ls->fs->bl->flags |= FSCOPE_BREAK;\n  gola_new(ls, NAME_BREAK, VSTACK_GOTO, bcemit_jmp(ls->fs));\n}\n\n/* Parse 'goto' statement. */\nstatic void parse_goto(LexState *ls)\n{\n  FuncState *fs = ls->fs;\n  GCstr *name = lex_str(ls);\n  VarInfo *vl = gola_findlabel(ls, name);\n  if (vl)  /* Treat backwards goto within same scope like a loop. */\n    bcemit_AJ(fs, BC_LOOP, vl->slot, -1);  /* No BC range check. */\n  fs->bl->flags |= FSCOPE_GOLA;\n  gola_new(ls, name, VSTACK_GOTO, bcemit_jmp(fs));\n}\n\n/* Parse label. */\nstatic void parse_label(LexState *ls)\n{\n  FuncState *fs = ls->fs;\n  GCstr *name;\n  MSize idx;\n  fs->lasttarget = fs->pc;\n  fs->bl->flags |= FSCOPE_GOLA;\n  lj_lex_next(ls);  /* Skip '::'. */\n  name = lex_str(ls);\n  if (gola_findlabel(ls, name))\n    lj_lex_error(ls, 0, LJ_ERR_XLDUP, strdata(name));\n  idx = gola_new(ls, name, VSTACK_LABEL, fs->pc);\n  lex_check(ls, TK_label);\n  /* Recursively parse trailing statements: labels and ';' (Lua 5.2 only). */\n  for (;;) {\n    if (ls->token == TK_label) {\n      synlevel_begin(ls);\n      parse_label(ls);\n      synlevel_end(ls);\n    } else if (LJ_52 && ls->token == ';') {\n      lj_lex_next(ls);\n    } else {\n      break;\n    }\n  }\n  /* Trailing label is considered to be outside of scope. */\n  if (endofblock(ls->token) && ls->token != TK_until)\n    ls->vstack[idx].slot = fs->bl->nactvar;\n  gola_resolve(ls, fs->bl, idx);\n}\n\n/* -- Blocks, loops and conditional statements ---------------------------- */\n\n/* Parse a block. */\nstatic void parse_block(LexState *ls)\n{\n  FuncState *fs = ls->fs;\n  FuncScope bl;\n  fscope_begin(fs, &bl, 0);\n  parse_chunk(ls);\n  fscope_end(fs);\n}\n\n/* Parse 'while' statement. */\nstatic void parse_while(LexState *ls, BCLine line)\n{\n  FuncState *fs = ls->fs;\n  BCPos start, loop, condexit;\n  FuncScope bl;\n  lj_lex_next(ls);  /* Skip 'while'. */\n  start = fs->lasttarget = fs->pc;\n  condexit = expr_cond(ls);\n  fscope_begin(fs, &bl, FSCOPE_LOOP);\n  lex_check(ls, TK_do);\n  loop = bcemit_AD(fs, BC_LOOP, fs->nactvar, 0);\n  parse_block(ls);\n  jmp_patch(fs, bcemit_jmp(fs), start);\n  lex_match(ls, TK_end, TK_while, line);\n  fscope_end(fs);\n  jmp_tohere(fs, condexit);\n  jmp_patchins(fs, loop, fs->pc);\n}\n\n/* Parse 'repeat' statement. */\nstatic void parse_repeat(LexState *ls, BCLine line)\n{\n  FuncState *fs = ls->fs;\n  BCPos loop = fs->lasttarget = fs->pc;\n  BCPos condexit;\n  FuncScope bl1, bl2;\n  fscope_begin(fs, &bl1, FSCOPE_LOOP);  /* Breakable loop scope. */\n  fscope_begin(fs, &bl2, 0);  /* Inner scope. */\n  lj_lex_next(ls);  /* Skip 'repeat'. */\n  bcemit_AD(fs, BC_LOOP, fs->nactvar, 0);\n  parse_chunk(ls);\n  lex_match(ls, TK_until, TK_repeat, line);\n  condexit = expr_cond(ls);  /* Parse condition (still inside inner scope). */\n  if (!(bl2.flags & FSCOPE_UPVAL)) {  /* No upvalues? Just end inner scope. */\n    fscope_end(fs);\n  } else {  /* Otherwise generate: cond: UCLO+JMP out, !cond: UCLO+JMP loop. */\n    parse_break(ls);  /* Break from loop and close upvalues. */\n    jmp_tohere(fs, condexit);\n    fscope_end(fs);  /* End inner scope and close upvalues. */\n    condexit = bcemit_jmp(fs);\n  }\n  jmp_patch(fs, condexit, loop);  /* Jump backwards if !cond. */\n  jmp_patchins(fs, loop, fs->pc);\n  fscope_end(fs);  /* End loop scope. */\n}\n\n/* Parse numeric 'for'. */\nstatic void parse_for_num(LexState *ls, GCstr *varname, BCLine line)\n{\n  FuncState *fs = ls->fs;\n  BCReg base = fs->freereg;\n  FuncScope bl;\n  BCPos loop, loopend;\n  /* Hidden control variables. */\n  var_new_fixed(ls, FORL_IDX, VARNAME_FOR_IDX);\n  var_new_fixed(ls, FORL_STOP, VARNAME_FOR_STOP);\n  var_new_fixed(ls, FORL_STEP, VARNAME_FOR_STEP);\n  /* Visible copy of index variable. */\n  var_new(ls, FORL_EXT, varname);\n  lex_check(ls, '=');\n  expr_next(ls);\n  lex_check(ls, ',');\n  expr_next(ls);\n  if (lex_opt(ls, ',')) {\n    expr_next(ls);\n  } else {\n    bcemit_AD(fs, BC_KSHORT, fs->freereg, 1);  /* Default step is 1. */\n    bcreg_reserve(fs, 1);\n  }\n  var_add(ls, 3);  /* Hidden control variables. */\n  lex_check(ls, TK_do);\n  loop = bcemit_AJ(fs, BC_FORI, base, NO_JMP);\n  fscope_begin(fs, &bl, 0);  /* Scope for visible variables. */\n  var_add(ls, 1);\n  bcreg_reserve(fs, 1);\n  parse_block(ls);\n  fscope_end(fs);\n  /* Perform loop inversion. Loop control instructions are at the end. */\n  loopend = bcemit_AJ(fs, BC_FORL, base, NO_JMP);\n  fs->bcbase[loopend].line = line;  /* Fix line for control ins. */\n  jmp_patchins(fs, loopend, loop+1);\n  jmp_patchins(fs, loop, fs->pc);\n}\n\n/* Try to predict whether the iterator is next() and specialize the bytecode.\n** Detecting next() and pairs() by name is simplistic, but quite effective.\n** The interpreter backs off if the check for the closure fails at runtime.\n*/\nstatic int predict_next(LexState *ls, FuncState *fs, BCPos pc)\n{\n  BCIns ins = fs->bcbase[pc].ins;\n  GCstr *name;\n  cTValue *o;\n  switch (bc_op(ins)) {\n  case BC_MOV:\n    name = gco2str(gcref(var_get(ls, fs, bc_d(ins)).name));\n    break;\n  case BC_UGET:\n    name = gco2str(gcref(ls->vstack[fs->uvmap[bc_d(ins)]].name));\n    break;\n  case BC_GGET:\n    /* There's no inverse index (yet), so lookup the strings. */\n    o = lj_tab_getstr(fs->kt, lj_str_newlit(ls->L, \"pairs\"));\n    if (o && tvhaskslot(o) && tvkslot(o) == bc_d(ins))\n      return 1;\n    o = lj_tab_getstr(fs->kt, lj_str_newlit(ls->L, \"next\"));\n    if (o && tvhaskslot(o) && tvkslot(o) == bc_d(ins))\n      return 1;\n    return 0;\n  default:\n    return 0;\n  }\n  return (name->len == 5 && !strcmp(strdata(name), \"pairs\")) ||\n\t (name->len == 4 && !strcmp(strdata(name), \"next\"));\n}\n\n/* Parse 'for' iterator. */\nstatic void parse_for_iter(LexState *ls, GCstr *indexname)\n{\n  FuncState *fs = ls->fs;\n  ExpDesc e;\n  BCReg nvars = 0;\n  BCLine line;\n  BCReg base = fs->freereg + 3;\n  BCPos loop, loopend, exprpc = fs->pc;\n  FuncScope bl;\n  int isnext;\n  /* Hidden control variables. */\n  var_new_fixed(ls, nvars++, VARNAME_FOR_GEN);\n  var_new_fixed(ls, nvars++, VARNAME_FOR_STATE);\n  var_new_fixed(ls, nvars++, VARNAME_FOR_CTL);\n  /* Visible variables returned from iterator. */\n  var_new(ls, nvars++, indexname);\n  while (lex_opt(ls, ','))\n    var_new(ls, nvars++, lex_str(ls));\n  lex_check(ls, TK_in);\n  line = ls->linenumber;\n  assign_adjust(ls, 3, expr_list(ls, &e), &e);\n  bcreg_bump(fs, 3);  /* The iterator needs another 3 slots (func + 2 args). */\n  isnext = (nvars <= 5 && predict_next(ls, fs, exprpc));\n  var_add(ls, 3);  /* Hidden control variables. */\n  lex_check(ls, TK_do);\n  loop = bcemit_AJ(fs, isnext ? BC_ISNEXT : BC_JMP, base, NO_JMP);\n  fscope_begin(fs, &bl, 0);  /* Scope for visible variables. */\n  var_add(ls, nvars-3);\n  bcreg_reserve(fs, nvars-3);\n  parse_block(ls);\n  fscope_end(fs);\n  /* Perform loop inversion. Loop control instructions are at the end. */\n  jmp_patchins(fs, loop, fs->pc);\n  bcemit_ABC(fs, isnext ? BC_ITERN : BC_ITERC, base, nvars-3+1, 2+1);\n  loopend = bcemit_AJ(fs, BC_ITERL, base, NO_JMP);\n  fs->bcbase[loopend-1].line = line;  /* Fix line for control ins. */\n  fs->bcbase[loopend].line = line;\n  jmp_patchins(fs, loopend, loop+1);\n}\n\n/* Parse 'for' statement. */\nstatic void parse_for(LexState *ls, BCLine line)\n{\n  FuncState *fs = ls->fs;\n  GCstr *varname;\n  FuncScope bl;\n  fscope_begin(fs, &bl, FSCOPE_LOOP);\n  lj_lex_next(ls);  /* Skip 'for'. */\n  varname = lex_str(ls);  /* Get first variable name. */\n  if (ls->token == '=')\n    parse_for_num(ls, varname, line);\n  else if (ls->token == ',' || ls->token == TK_in)\n    parse_for_iter(ls, varname);\n  else\n    err_syntax(ls, LJ_ERR_XFOR);\n  lex_match(ls, TK_end, TK_for, line);\n  fscope_end(fs);  /* Resolve break list. */\n}\n\n/* Parse condition and 'then' block. */\nstatic BCPos parse_then(LexState *ls)\n{\n  BCPos condexit;\n  lj_lex_next(ls);  /* Skip 'if' or 'elseif'. */\n  condexit = expr_cond(ls);\n  lex_check(ls, TK_then);\n  parse_block(ls);\n  return condexit;\n}\n\n/* Parse 'if' statement. */\nstatic void parse_if(LexState *ls, BCLine line)\n{\n  FuncState *fs = ls->fs;\n  BCPos flist;\n  BCPos escapelist = NO_JMP;\n  flist = parse_then(ls);\n  while (ls->token == TK_elseif) {  /* Parse multiple 'elseif' blocks. */\n    jmp_append(fs, &escapelist, bcemit_jmp(fs));\n    jmp_tohere(fs, flist);\n    flist = parse_then(ls);\n  }\n  if (ls->token == TK_else) {  /* Parse optional 'else' block. */\n    jmp_append(fs, &escapelist, bcemit_jmp(fs));\n    jmp_tohere(fs, flist);\n    lj_lex_next(ls);  /* Skip 'else'. */\n    parse_block(ls);\n  } else {\n    jmp_append(fs, &escapelist, flist);\n  }\n  jmp_tohere(fs, escapelist);\n  lex_match(ls, TK_end, TK_if, line);\n}\n\n/* -- Parse statements ---------------------------------------------------- */\n\n/* Parse a statement. Returns 1 if it must be the last one in a chunk. */\nstatic int parse_stmt(LexState *ls)\n{\n  BCLine line = ls->linenumber;\n  switch (ls->token) {\n  case TK_if:\n    parse_if(ls, line);\n    break;\n  case TK_while:\n    parse_while(ls, line);\n    break;\n  case TK_do:\n    lj_lex_next(ls);\n    parse_block(ls);\n    lex_match(ls, TK_end, TK_do, line);\n    break;\n  case TK_for:\n    parse_for(ls, line);\n    break;\n  case TK_repeat:\n    parse_repeat(ls, line);\n    break;\n  case TK_function:\n    parse_func(ls, line);\n    break;\n  case TK_local:\n    lj_lex_next(ls);\n    parse_local(ls);\n    break;\n  case TK_return:\n    parse_return(ls);\n    return 1;  /* Must be last. */\n  case TK_break:\n    lj_lex_next(ls);\n    parse_break(ls);\n    return !LJ_52;  /* Must be last in Lua 5.1. */\n#if LJ_52\n  case ';':\n    lj_lex_next(ls);\n    break;\n#endif\n  case TK_label:\n    parse_label(ls);\n    break;\n  case TK_goto:\n    if (LJ_52 || lj_lex_lookahead(ls) == TK_name) {\n      lj_lex_next(ls);\n      parse_goto(ls);\n      break;\n    }  /* else: fallthrough */\n  default:\n    parse_call_assign(ls);\n    break;\n  }\n  return 0;\n}\n\n/* A chunk is a list of statements optionally separated by semicolons. */\nstatic void parse_chunk(LexState *ls)\n{\n  int islast = 0;\n  synlevel_begin(ls);\n  while (!islast && !endofblock(ls->token)) {\n    islast = parse_stmt(ls);\n    lex_opt(ls, ';');\n    lua_assert(ls->fs->framesize >= ls->fs->freereg &&\n\t       ls->fs->freereg >= ls->fs->nactvar);\n    ls->fs->freereg = ls->fs->nactvar;  /* Free registers after each stmt. */\n  }\n  synlevel_end(ls);\n}\n\n/* Entry point of bytecode parser. */\nGCproto *lj_parse(LexState *ls)\n{\n  FuncState fs;\n  FuncScope bl;\n  GCproto *pt;\n  lua_State *L = ls->L;\n#ifdef LUAJIT_DISABLE_DEBUGINFO\n  ls->chunkname = lj_str_newlit(L, \"=\");\n#else\n  ls->chunkname = lj_str_newz(L, ls->chunkarg);\n#endif\n  setstrV(L, L->top, ls->chunkname);  /* Anchor chunkname string. */\n  incr_top(L);\n  ls->level = 0;\n  fs_init(ls, &fs);\n  fs.linedefined = 0;\n  fs.numparams = 0;\n  fs.bcbase = NULL;\n  fs.bclim = 0;\n  fs.flags |= PROTO_VARARG;  /* Main chunk is always a vararg func. */\n  fscope_begin(&fs, &bl, 0);\n  bcemit_AD(&fs, BC_FUNCV, 0, 0);  /* Placeholder. */\n  lj_lex_next(ls);  /* Read-ahead first token. */\n  parse_chunk(ls);\n  if (ls->token != TK_eof)\n    err_token(ls, TK_eof);\n  pt = fs_finish(ls, ls->linenumber);\n  L->top--;  /* Drop chunkname. */\n  lua_assert(fs.prev == NULL);\n  lua_assert(ls->fs == NULL);\n  lua_assert(pt->sizeuv == 0);\n  return pt;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_parse.h",
    "content": "/*\n** Lua parser (source code -> bytecode).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_PARSE_H\n#define _LJ_PARSE_H\n\n#include \"lj_obj.h\"\n#include \"lj_lex.h\"\n\nLJ_FUNC GCproto *lj_parse(LexState *ls);\nLJ_FUNC GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t l);\n#if LJ_HASFFI\nLJ_FUNC void lj_parse_keepcdata(LexState *ls, TValue *tv, GCcdata *cd);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_record.c",
    "content": "/*\n** Trace recorder (bytecode -> SSA IR).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_record_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_meta.h\"\n#include \"lj_frame.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#endif\n#include \"lj_bc.h\"\n#include \"lj_ff.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_ircall.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#include \"lj_record.h\"\n#include \"lj_ffrecord.h\"\n#include \"lj_snap.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t\t(&J->cur.ir[(ref)])\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n/* Emit raw IR without passing through optimizations. */\n#define emitir_raw(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J))\n\n/* -- Sanity checks ------------------------------------------------------- */\n\n#ifdef LUA_USE_ASSERT\n/* Sanity check the whole IR -- sloooow. */\nstatic void rec_check_ir(jit_State *J)\n{\n  IRRef i, nins = J->cur.nins, nk = J->cur.nk;\n  lua_assert(nk <= REF_BIAS && nins >= REF_BIAS && nins < 65536);\n  for (i = nins-1; i >= nk; i--) {\n    IRIns *ir = IR(i);\n    uint32_t mode = lj_ir_mode[ir->o];\n    IRRef op1 = ir->op1;\n    IRRef op2 = ir->op2;\n    switch (irm_op1(mode)) {\n    case IRMnone: lua_assert(op1 == 0); break;\n    case IRMref: lua_assert(op1 >= nk);\n      lua_assert(i >= REF_BIAS ? op1 < i : op1 > i); break;\n    case IRMlit: break;\n    case IRMcst: lua_assert(i < REF_BIAS); continue;\n    }\n    switch (irm_op2(mode)) {\n    case IRMnone: lua_assert(op2 == 0); break;\n    case IRMref: lua_assert(op2 >= nk);\n      lua_assert(i >= REF_BIAS ? op2 < i : op2 > i); break;\n    case IRMlit: break;\n    case IRMcst: lua_assert(0); break;\n    }\n    if (ir->prev) {\n      lua_assert(ir->prev >= nk);\n      lua_assert(i >= REF_BIAS ? ir->prev < i : ir->prev > i);\n      lua_assert(ir->o == IR_NOP || IR(ir->prev)->o == ir->o);\n    }\n  }\n}\n\n/* Compare stack slots and frames of the recorder and the VM. */\nstatic void rec_check_slots(jit_State *J)\n{\n  BCReg s, nslots = J->baseslot + J->maxslot;\n  int32_t depth = 0;\n  cTValue *base = J->L->base - J->baseslot;\n  lua_assert(J->baseslot >= 1 && J->baseslot < LJ_MAX_JSLOTS);\n  lua_assert(J->baseslot == 1 || (J->slot[J->baseslot-1] & TREF_FRAME));\n  lua_assert(nslots < LJ_MAX_JSLOTS);\n  for (s = 0; s < nslots; s++) {\n    TRef tr = J->slot[s];\n    if (tr) {\n      cTValue *tv = &base[s];\n      IRRef ref = tref_ref(tr);\n      IRIns *ir;\n      lua_assert(ref >= J->cur.nk && ref < J->cur.nins);\n      ir = IR(ref);\n      lua_assert(irt_t(ir->t) == tref_t(tr));\n      if (s == 0) {\n\tlua_assert(tref_isfunc(tr));\n      } else if ((tr & TREF_FRAME)) {\n\tGCfunc *fn = gco2func(frame_gc(tv));\n\tBCReg delta = (BCReg)(tv - frame_prev(tv));\n\tlua_assert(tref_isfunc(tr));\n\tif (tref_isk(tr)) lua_assert(fn == ir_kfunc(ir));\n\tlua_assert(s > delta ? (J->slot[s-delta] & TREF_FRAME) : (s == delta));\n\tdepth++;\n      } else if ((tr & TREF_CONT)) {\n\tlua_assert(ir_kptr(ir) == gcrefp(tv->gcr, void));\n\tlua_assert((J->slot[s+1] & TREF_FRAME));\n\tdepth++;\n      } else {\n\tif (tvisnumber(tv))\n\t  lua_assert(tref_isnumber(tr));  /* Could be IRT_INT etc., too. */\n\telse\n\t  lua_assert(itype2irt(tv) == tref_type(tr));\n\tif (tref_isk(tr)) {  /* Compare constants. */\n\t  TValue tvk;\n\t  lj_ir_kvalue(J->L, &tvk, ir);\n\t  if (!(tvisnum(&tvk) && tvisnan(&tvk)))\n\t    lua_assert(lj_obj_equal(tv, &tvk));\n\t  else\n\t    lua_assert(tvisnum(tv) && tvisnan(tv));\n\t}\n      }\n    }\n  }\n  lua_assert(J->framedepth == depth);\n}\n#endif\n\n/* -- Type handling and specialization ------------------------------------ */\n\n/* Note: these functions return tagged references (TRef). */\n\n/* Specialize a slot to a specific type. Note: slot can be negative! */\nstatic TRef sloadt(jit_State *J, int32_t slot, IRType t, int mode)\n{\n  /* Caller may set IRT_GUARD in t. */\n  TRef ref = emitir_raw(IRT(IR_SLOAD, t), (int32_t)J->baseslot+slot, mode);\n  J->base[slot] = ref;\n  return ref;\n}\n\n/* Specialize a slot to the runtime type. Note: slot can be negative! */\nstatic TRef sload(jit_State *J, int32_t slot)\n{\n  IRType t = itype2irt(&J->L->base[slot]);\n  TRef ref = emitir_raw(IRTG(IR_SLOAD, t), (int32_t)J->baseslot+slot,\n\t\t\tIRSLOAD_TYPECHECK);\n  if (irtype_ispri(t)) ref = TREF_PRI(t);  /* Canonicalize primitive refs. */\n  J->base[slot] = ref;\n  return ref;\n}\n\n/* Get TRef from slot. Load slot and specialize if not done already. */\n#define getslot(J, s)\t(J->base[(s)] ? J->base[(s)] : sload(J, (int32_t)(s)))\n\n/* Get TRef for current function. */\nstatic TRef getcurrf(jit_State *J)\n{\n  if (J->base[-1])\n    return J->base[-1];\n  lua_assert(J->baseslot == 1);\n  return sloadt(J, -1, IRT_FUNC, IRSLOAD_READONLY);\n}\n\n/* Compare for raw object equality.\n** Returns 0 if the objects are the same.\n** Returns 1 if they are different, but the same type.\n** Returns 2 for two different types.\n** Comparisons between primitives always return 1 -- no caller cares about it.\n*/\nint lj_record_objcmp(jit_State *J, TRef a, TRef b, cTValue *av, cTValue *bv)\n{\n  int diff = !lj_obj_equal(av, bv);\n  if (!tref_isk2(a, b)) {  /* Shortcut, also handles primitives. */\n    IRType ta = tref_isinteger(a) ? IRT_INT : tref_type(a);\n    IRType tb = tref_isinteger(b) ? IRT_INT : tref_type(b);\n    if (ta != tb) {\n      /* Widen mixed number/int comparisons to number/number comparison. */\n      if (ta == IRT_INT && tb == IRT_NUM) {\n\ta = emitir(IRTN(IR_CONV), a, IRCONV_NUM_INT);\n\tta = IRT_NUM;\n      } else if (ta == IRT_NUM && tb == IRT_INT) {\n\tb = emitir(IRTN(IR_CONV), b, IRCONV_NUM_INT);\n      } else {\n\treturn 2;  /* Two different types are never equal. */\n      }\n    }\n    emitir(IRTG(diff ? IR_NE : IR_EQ, ta), a, b);\n  }\n  return diff;\n}\n\n/* Constify a value. Returns 0 for non-representable object types. */\nTRef lj_record_constify(jit_State *J, cTValue *o)\n{\n  if (tvisgcv(o))\n    return lj_ir_kgc(J, gcV(o), itype2irt(o));\n  else if (tvisint(o))\n    return lj_ir_kint(J, intV(o));\n  else if (tvisnum(o))\n    return lj_ir_knumint(J, numV(o));\n  else if (tvisbool(o))\n    return TREF_PRI(itype2irt(o));\n  else\n    return 0;  /* Can't represent lightuserdata (pointless). */\n}\n\n/* -- Record loop ops ----------------------------------------------------- */\n\n/* Loop event. */\ntypedef enum {\n  LOOPEV_LEAVE,\t\t/* Loop is left or not entered. */\n  LOOPEV_ENTERLO,\t/* Loop is entered with a low iteration count left. */\n  LOOPEV_ENTER\t\t/* Loop is entered. */\n} LoopEvent;\n\n/* Canonicalize slots: convert integers to numbers. */\nstatic void canonicalize_slots(jit_State *J)\n{\n  BCReg s;\n  if (LJ_DUALNUM) return;\n  for (s = J->baseslot+J->maxslot-1; s >= 1; s--) {\n    TRef tr = J->slot[s];\n    if (tref_isinteger(tr)) {\n      IRIns *ir = IR(tref_ref(tr));\n      if (!(ir->o == IR_SLOAD && (ir->op2 & IRSLOAD_READONLY)))\n\tJ->slot[s] = emitir(IRTN(IR_CONV), tr, IRCONV_NUM_INT);\n    }\n  }\n}\n\n/* Stop recording. */\nstatic void rec_stop(jit_State *J, TraceLink linktype, TraceNo lnk)\n{\n  lj_trace_end(J);\n  J->cur.linktype = (uint8_t)linktype;\n  J->cur.link = (uint16_t)lnk;\n  /* Looping back at the same stack level? */\n  if (lnk == J->cur.traceno && J->framedepth + J->retdepth == 0) {\n    if ((J->flags & JIT_F_OPT_LOOP))  /* Shall we try to create a loop? */\n      goto nocanon;  /* Do not canonicalize or we lose the narrowing. */\n    if (J->cur.root)  /* Otherwise ensure we always link to the root trace. */\n      J->cur.link = J->cur.root;\n  }\n  canonicalize_slots(J);\nnocanon:\n  /* Note: all loop ops must set J->pc to the following instruction! */\n  lj_snap_add(J);  /* Add loop snapshot. */\n  J->needsnap = 0;\n  J->mergesnap = 1;  /* In case recording continues. */\n}\n\n/* Search bytecode backwards for a int/num constant slot initializer. */\nstatic TRef find_kinit(jit_State *J, const BCIns *endpc, BCReg slot, IRType t)\n{\n  /* This algorithm is rather simplistic and assumes quite a bit about\n  ** how the bytecode is generated. It works fine for FORI initializers,\n  ** but it won't necessarily work in other cases (e.g. iterator arguments).\n  ** It doesn't do anything fancy, either (like backpropagating MOVs).\n  */\n  const BCIns *pc, *startpc = proto_bc(J->pt);\n  for (pc = endpc-1; pc > startpc; pc--) {\n    BCIns ins = *pc;\n    BCOp op = bc_op(ins);\n    /* First try to find the last instruction that stores to this slot. */\n    if (bcmode_a(op) == BCMbase && bc_a(ins) <= slot) {\n      return 0;  /* Multiple results, e.g. from a CALL or KNIL. */\n    } else if (bcmode_a(op) == BCMdst && bc_a(ins) == slot) {\n      if (op == BC_KSHORT || op == BC_KNUM) {  /* Found const. initializer. */\n\t/* Now try to verify there's no forward jump across it. */\n\tconst BCIns *kpc = pc;\n\tfor (; pc > startpc; pc--)\n\t  if (bc_op(*pc) == BC_JMP) {\n\t    const BCIns *target = pc+bc_j(*pc)+1;\n\t    if (target > kpc && target <= endpc)\n\t      return 0;  /* Conditional assignment. */\n\t  }\n\tif (op == BC_KSHORT) {\n\t  int32_t k = (int32_t)(int16_t)bc_d(ins);\n\t  return t == IRT_INT ? lj_ir_kint(J, k) : lj_ir_knum(J, (lua_Number)k);\n\t} else {\n\t  cTValue *tv = proto_knumtv(J->pt, bc_d(ins));\n\t  if (t == IRT_INT) {\n\t    int32_t k = numberVint(tv);\n\t    if (tvisint(tv) || numV(tv) == (lua_Number)k)  /* -0 is ok here. */\n\t      return lj_ir_kint(J, k);\n\t    return 0;  /* Type mismatch. */\n\t  } else {\n\t    return lj_ir_knum(J, numberVnum(tv));\n\t  }\n\t}\n      }\n      return 0;  /* Non-constant initializer. */\n    }\n  }\n  return 0;  /* No assignment to this slot found? */\n}\n\n/* Load and optionally convert a FORI argument from a slot. */\nstatic TRef fori_load(jit_State *J, BCReg slot, IRType t, int mode)\n{\n  int conv = (tvisint(&J->L->base[slot]) != (t==IRT_INT)) ? IRSLOAD_CONVERT : 0;\n  return sloadt(J, (int32_t)slot,\n\t\tt + (((mode & IRSLOAD_TYPECHECK) ||\n\t\t      (conv && t == IRT_INT && !(mode >> 16))) ?\n\t\t     IRT_GUARD : 0),\n\t\tmode + conv);\n}\n\n/* Peek before FORI to find a const initializer. Otherwise load from slot. */\nstatic TRef fori_arg(jit_State *J, const BCIns *fori, BCReg slot,\n\t\t     IRType t, int mode)\n{\n  TRef tr = J->base[slot];\n  if (!tr) {\n    tr = find_kinit(J, fori, slot, t);\n    if (!tr)\n      tr = fori_load(J, slot, t, mode);\n  }\n  return tr;\n}\n\n/* Return the direction of the FOR loop iterator.\n** It's important to exactly reproduce the semantics of the interpreter.\n*/\nstatic int rec_for_direction(cTValue *o)\n{\n  return (tvisint(o) ? intV(o) : (int32_t)o->u32.hi) >= 0;\n}\n\n/* Simulate the runtime behavior of the FOR loop iterator. */\nstatic LoopEvent rec_for_iter(IROp *op, cTValue *o, int isforl)\n{\n  lua_Number stopv = numberVnum(&o[FORL_STOP]);\n  lua_Number idxv = numberVnum(&o[FORL_IDX]);\n  lua_Number stepv = numberVnum(&o[FORL_STEP]);\n  if (isforl)\n    idxv += stepv;\n  if (rec_for_direction(&o[FORL_STEP])) {\n    if (idxv <= stopv) {\n      *op = IR_LE;\n      return idxv + 2*stepv > stopv ? LOOPEV_ENTERLO : LOOPEV_ENTER;\n    }\n    *op = IR_GT; return LOOPEV_LEAVE;\n  } else {\n    if (stopv <= idxv) {\n      *op = IR_GE;\n      return idxv + 2*stepv < stopv ? LOOPEV_ENTERLO : LOOPEV_ENTER;\n    }\n    *op = IR_LT; return LOOPEV_LEAVE;\n  }\n}\n\n/* Record checks for FOR loop overflow and step direction. */\nstatic void rec_for_check(jit_State *J, IRType t, int dir,\n\t\t\t  TRef stop, TRef step, int init)\n{\n  if (!tref_isk(step)) {\n    /* Non-constant step: need a guard for the direction. */\n    TRef zero = (t == IRT_INT) ? lj_ir_kint(J, 0) : lj_ir_knum_zero(J);\n    emitir(IRTG(dir ? IR_GE : IR_LT, t), step, zero);\n    /* Add hoistable overflow checks for a narrowed FORL index. */\n    if (init && t == IRT_INT) {\n      if (tref_isk(stop)) {\n\t/* Constant stop: optimize check away or to a range check for step. */\n\tint32_t k = IR(tref_ref(stop))->i;\n\tif (dir) {\n\t  if (k > 0)\n\t    emitir(IRTGI(IR_LE), step, lj_ir_kint(J, (int32_t)0x7fffffff-k));\n\t} else {\n\t  if (k < 0)\n\t    emitir(IRTGI(IR_GE), step, lj_ir_kint(J, (int32_t)0x80000000-k));\n\t}\n      } else {\n\t/* Stop+step variable: need full overflow check. */\n\tTRef tr = emitir(IRTGI(IR_ADDOV), step, stop);\n\temitir(IRTI(IR_USE), tr, 0);  /* ADDOV is weak. Avoid dead result. */\n      }\n    }\n  } else if (init && t == IRT_INT && !tref_isk(stop)) {\n    /* Constant step: optimize overflow check to a range check for stop. */\n    int32_t k = IR(tref_ref(step))->i;\n    k = (int32_t)(dir ? 0x7fffffff : 0x80000000) - k;\n    emitir(IRTGI(dir ? IR_LE : IR_GE), stop, lj_ir_kint(J, k));\n  }\n}\n\n/* Record a FORL instruction. */\nstatic void rec_for_loop(jit_State *J, const BCIns *fori, ScEvEntry *scev,\n\t\t\t int init)\n{\n  BCReg ra = bc_a(*fori);\n  cTValue *tv = &J->L->base[ra];\n  TRef idx = J->base[ra+FORL_IDX];\n  IRType t = idx ? tref_type(idx) :\n\t     (init || LJ_DUALNUM) ? lj_opt_narrow_forl(J, tv) : IRT_NUM;\n  int mode = IRSLOAD_INHERIT +\n    ((!LJ_DUALNUM || tvisint(tv) == (t == IRT_INT)) ? IRSLOAD_READONLY : 0);\n  TRef stop = fori_arg(J, fori, ra+FORL_STOP, t, mode);\n  TRef step = fori_arg(J, fori, ra+FORL_STEP, t, mode);\n  int tc, dir = rec_for_direction(&tv[FORL_STEP]);\n  lua_assert(bc_op(*fori) == BC_FORI || bc_op(*fori) == BC_JFORI);\n  scev->t.irt = t;\n  scev->dir = dir;\n  scev->stop = tref_ref(stop);\n  scev->step = tref_ref(step);\n  rec_for_check(J, t, dir, stop, step, init);\n  scev->start = tref_ref(find_kinit(J, fori, ra+FORL_IDX, IRT_INT));\n  tc = (LJ_DUALNUM &&\n\t!(scev->start && irref_isk(scev->stop) && irref_isk(scev->step) &&\n\t  tvisint(&tv[FORL_IDX]) == (t == IRT_INT))) ?\n\tIRSLOAD_TYPECHECK : 0;\n  if (tc) {\n    J->base[ra+FORL_STOP] = stop;\n    J->base[ra+FORL_STEP] = step;\n  }\n  if (!idx)\n    idx = fori_load(J, ra+FORL_IDX, t,\n\t\t    IRSLOAD_INHERIT + tc + (J->scev.start << 16));\n  if (!init)\n    J->base[ra+FORL_IDX] = idx = emitir(IRT(IR_ADD, t), idx, step);\n  J->base[ra+FORL_EXT] = idx;\n  scev->idx = tref_ref(idx);\n  J->maxslot = ra+FORL_EXT+1;\n}\n\n/* Record FORL/JFORL or FORI/JFORI. */\nstatic LoopEvent rec_for(jit_State *J, const BCIns *fori, int isforl)\n{\n  BCReg ra = bc_a(*fori);\n  TValue *tv = &J->L->base[ra];\n  TRef *tr = &J->base[ra];\n  IROp op;\n  LoopEvent ev;\n  TRef stop;\n  IRType t;\n  if (isforl) {  /* Handle FORL/JFORL opcodes. */\n    TRef idx = tr[FORL_IDX];\n    if (tref_ref(idx) == J->scev.idx) {\n      t = J->scev.t.irt;\n      stop = J->scev.stop;\n      idx = emitir(IRT(IR_ADD, t), idx, J->scev.step);\n      tr[FORL_EXT] = tr[FORL_IDX] = idx;\n    } else {\n      ScEvEntry scev;\n      rec_for_loop(J, fori, &scev, 0);\n      t = scev.t.irt;\n      stop = scev.stop;\n    }\n  } else {  /* Handle FORI/JFORI opcodes. */\n    BCReg i;\n    lj_meta_for(J->L, tv);\n    t = (LJ_DUALNUM || tref_isint(tr[FORL_IDX])) ? lj_opt_narrow_forl(J, tv) :\n\t\t\t\t\t\t   IRT_NUM;\n    for (i = FORL_IDX; i <= FORL_STEP; i++) {\n      if (!tr[i]) sload(J, ra+i);\n      lua_assert(tref_isnumber_str(tr[i]));\n      if (tref_isstr(tr[i]))\n\ttr[i] = emitir(IRTG(IR_STRTO, IRT_NUM), tr[i], 0);\n      if (t == IRT_INT) {\n\tif (!tref_isinteger(tr[i]))\n\t  tr[i] = emitir(IRTGI(IR_CONV), tr[i], IRCONV_INT_NUM|IRCONV_CHECK);\n      } else {\n\tif (!tref_isnum(tr[i]))\n\t  tr[i] = emitir(IRTN(IR_CONV), tr[i], IRCONV_NUM_INT);\n      }\n    }\n    tr[FORL_EXT] = tr[FORL_IDX];\n    stop = tr[FORL_STOP];\n    rec_for_check(J, t, rec_for_direction(&tv[FORL_STEP]),\n\t\t  stop, tr[FORL_STEP], 1);\n  }\n\n  ev = rec_for_iter(&op, tv, isforl);\n  if (ev == LOOPEV_LEAVE) {\n    J->maxslot = ra+FORL_EXT+1;\n    J->pc = fori+1;\n  } else {\n    J->maxslot = ra;\n    J->pc = fori+bc_j(*fori)+1;\n  }\n  lj_snap_add(J);\n\n  emitir(IRTG(op, t), tr[FORL_IDX], stop);\n\n  if (ev == LOOPEV_LEAVE) {\n    J->maxslot = ra;\n    J->pc = fori+bc_j(*fori)+1;\n  } else {\n    J->maxslot = ra+FORL_EXT+1;\n    J->pc = fori+1;\n  }\n  J->needsnap = 1;\n  return ev;\n}\n\n/* Record ITERL/JITERL. */\nstatic LoopEvent rec_iterl(jit_State *J, const BCIns iterins)\n{\n  BCReg ra = bc_a(iterins);\n  lua_assert(J->base[ra] != 0);\n  if (!tref_isnil(J->base[ra])) {  /* Looping back? */\n    J->base[ra-1] = J->base[ra];  /* Copy result of ITERC to control var. */\n    J->maxslot = ra-1+bc_b(J->pc[-1]);\n    J->pc += bc_j(iterins)+1;\n    return LOOPEV_ENTER;\n  } else {\n    J->maxslot = ra-3;\n    J->pc++;\n    return LOOPEV_LEAVE;\n  }\n}\n\n/* Record LOOP/JLOOP. Now, that was easy. */\nstatic LoopEvent rec_loop(jit_State *J, BCReg ra)\n{\n  if (ra < J->maxslot) J->maxslot = ra;\n  J->pc++;\n  return LOOPEV_ENTER;\n}\n\n/* Check if a loop repeatedly failed to trace because it didn't loop back. */\nstatic int innerloopleft(jit_State *J, const BCIns *pc)\n{\n  ptrdiff_t i;\n  for (i = 0; i < PENALTY_SLOTS; i++)\n    if (mref(J->penalty[i].pc, const BCIns) == pc) {\n      if ((J->penalty[i].reason == LJ_TRERR_LLEAVE ||\n\t   J->penalty[i].reason == LJ_TRERR_LINNER) &&\n\t  J->penalty[i].val >= 2*PENALTY_MIN)\n\treturn 1;\n      break;\n    }\n  return 0;\n}\n\n/* Handle the case when an interpreted loop op is hit. */\nstatic void rec_loop_interp(jit_State *J, const BCIns *pc, LoopEvent ev)\n{\n  if (J->parent == 0) {\n    if (pc == J->startpc && J->framedepth + J->retdepth == 0) {\n      /* Same loop? */\n      if (ev == LOOPEV_LEAVE)  /* Must loop back to form a root trace. */\n\tlj_trace_err(J, LJ_TRERR_LLEAVE);\n      rec_stop(J, LJ_TRLINK_LOOP, J->cur.traceno);  /* Looping root trace. */\n    } else if (ev != LOOPEV_LEAVE) {  /* Entering inner loop? */\n      /* It's usually better to abort here and wait until the inner loop\n      ** is traced. But if the inner loop repeatedly didn't loop back,\n      ** this indicates a low trip count. In this case try unrolling\n      ** an inner loop even in a root trace. But it's better to be a bit\n      ** more conservative here and only do it for very short loops.\n      */\n      if (bc_j(*pc) != -1 && !innerloopleft(J, pc))\n\tlj_trace_err(J, LJ_TRERR_LINNER);  /* Root trace hit an inner loop. */\n      if ((ev != LOOPEV_ENTERLO &&\n\t   J->loopref && J->cur.nins - J->loopref > 24) || --J->loopunroll < 0)\n\tlj_trace_err(J, LJ_TRERR_LUNROLL);  /* Limit loop unrolling. */\n      J->loopref = J->cur.nins;\n    }\n  } else if (ev != LOOPEV_LEAVE) {  /* Side trace enters an inner loop. */\n    J->loopref = J->cur.nins;\n    if (--J->loopunroll < 0)\n      lj_trace_err(J, LJ_TRERR_LUNROLL);  /* Limit loop unrolling. */\n  }  /* Side trace continues across a loop that's left or not entered. */\n}\n\n/* Handle the case when an already compiled loop op is hit. */\nstatic void rec_loop_jit(jit_State *J, TraceNo lnk, LoopEvent ev)\n{\n  if (J->parent == 0) {  /* Root trace hit an inner loop. */\n    /* Better let the inner loop spawn a side trace back here. */\n    lj_trace_err(J, LJ_TRERR_LINNER);\n  } else if (ev != LOOPEV_LEAVE) {  /* Side trace enters a compiled loop. */\n    J->instunroll = 0;  /* Cannot continue across a compiled loop op. */\n    if (J->pc == J->startpc && J->framedepth + J->retdepth == 0)\n      rec_stop(J, LJ_TRLINK_LOOP, J->cur.traceno);  /* Form an extra loop. */\n    else\n      rec_stop(J, LJ_TRLINK_ROOT, lnk);  /* Link to the loop. */\n  }  /* Side trace continues across a loop that's left or not entered. */\n}\n\n/* -- Record calls and returns -------------------------------------------- */\n\n/* Specialize to the runtime value of the called function or its prototype. */\nstatic TRef rec_call_specialize(jit_State *J, GCfunc *fn, TRef tr)\n{\n  TRef kfunc;\n  if (isluafunc(fn)) {\n    GCproto *pt = funcproto(fn);\n    /* Too many closures created? Probably not a monomorphic function. */\n    if (pt->flags >= PROTO_CLC_POLY) {  /* Specialize to prototype instead. */\n      TRef trpt = emitir(IRT(IR_FLOAD, IRT_P32), tr, IRFL_FUNC_PC);\n      emitir(IRTG(IR_EQ, IRT_P32), trpt, lj_ir_kptr(J, proto_bc(pt)));\n      (void)lj_ir_kgc(J, obj2gco(pt), IRT_PROTO);  /* Prevent GC of proto. */\n      return tr;\n    }\n  }\n  /* Otherwise specialize to the function (closure) value itself. */\n  kfunc = lj_ir_kfunc(J, fn);\n  emitir(IRTG(IR_EQ, IRT_FUNC), tr, kfunc);\n  return kfunc;\n}\n\n/* Record call setup. */\nstatic void rec_call_setup(jit_State *J, BCReg func, ptrdiff_t nargs)\n{\n  RecordIndex ix;\n  TValue *functv = &J->L->base[func];\n  TRef *fbase = &J->base[func];\n  ptrdiff_t i;\n  for (i = 0; i <= nargs; i++)\n    (void)getslot(J, func+i);  /* Ensure func and all args have a reference. */\n  if (!tref_isfunc(fbase[0])) {  /* Resolve __call metamethod. */\n    ix.tab = fbase[0];\n    copyTV(J->L, &ix.tabv, functv);\n    if (!lj_record_mm_lookup(J, &ix, MM_call) || !tref_isfunc(ix.mobj))\n      lj_trace_err(J, LJ_TRERR_NOMM);\n    for (i = ++nargs; i > 0; i--)  /* Shift arguments up. */\n      fbase[i] = fbase[i-1];\n    fbase[0] = ix.mobj;  /* Replace function. */\n    functv = &ix.mobjv;\n  }\n  fbase[0] = TREF_FRAME | rec_call_specialize(J, funcV(functv), fbase[0]);\n  J->maxslot = (BCReg)nargs;\n}\n\n/* Record call. */\nvoid lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs)\n{\n  rec_call_setup(J, func, nargs);\n  /* Bump frame. */\n  J->framedepth++;\n  J->base += func+1;\n  J->baseslot += func+1;\n}\n\n/* Record tail call. */\nvoid lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs)\n{\n  rec_call_setup(J, func, nargs);\n  if (frame_isvarg(J->L->base - 1)) {\n    BCReg cbase = (BCReg)frame_delta(J->L->base - 1);\n    if (--J->framedepth < 0)\n      lj_trace_err(J, LJ_TRERR_NYIRETL);\n    J->baseslot -= (BCReg)cbase;\n    J->base -= cbase;\n    func += cbase;\n  }\n  /* Move func + args down. */\n  memmove(&J->base[-1], &J->base[func], sizeof(TRef)*(J->maxslot+1));\n  /* Note: the new TREF_FRAME is now at J->base[-1] (even for slot #0). */\n  /* Tailcalls can form a loop, so count towards the loop unroll limit. */\n  if (++J->tailcalled > J->loopunroll)\n    lj_trace_err(J, LJ_TRERR_LUNROLL);\n}\n\n/* Check unroll limits for down-recursion. */\nstatic int check_downrec_unroll(jit_State *J, GCproto *pt)\n{\n  IRRef ptref;\n  for (ptref = J->chain[IR_KGC]; ptref; ptref = IR(ptref)->prev)\n    if (ir_kgc(IR(ptref)) == obj2gco(pt)) {\n      int count = 0;\n      IRRef ref;\n      for (ref = J->chain[IR_RETF]; ref; ref = IR(ref)->prev)\n\tif (IR(ref)->op1 == ptref)\n\t  count++;\n      if (count) {\n\tif (J->pc == J->startpc) {\n\t  if (count + J->tailcalled > J->param[JIT_P_recunroll])\n\t    return 1;\n\t} else {\n\t  lj_trace_err(J, LJ_TRERR_DOWNREC);\n\t}\n      }\n    }\n  return 0;\n}\n\n/* Record return. */\nvoid lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)\n{\n  TValue *frame = J->L->base - 1;\n  ptrdiff_t i;\n  for (i = 0; i < gotresults; i++)\n    (void)getslot(J, rbase+i);  /* Ensure all results have a reference. */\n  while (frame_ispcall(frame)) {  /* Immediately resolve pcall() returns. */\n    BCReg cbase = (BCReg)frame_delta(frame);\n    if (--J->framedepth < 0)\n      lj_trace_err(J, LJ_TRERR_NYIRETL);\n    lua_assert(J->baseslot > 1);\n    gotresults++;\n    rbase += cbase;\n    J->baseslot -= (BCReg)cbase;\n    J->base -= cbase;\n    J->base[--rbase] = TREF_TRUE;  /* Prepend true to results. */\n    frame = frame_prevd(frame);\n  }\n  /* Return to lower frame via interpreter for unhandled cases. */\n  if (J->framedepth == 0 && J->pt && bc_isret(bc_op(*J->pc)) &&\n       (!frame_islua(frame) ||\n\t(J->parent == 0 && !bc_isret(bc_op(J->cur.startins))))) {\n    /* NYI: specialize to frame type and return directly, not via RET*. */\n    for (i = -1; i < (ptrdiff_t)rbase; i++)\n      J->base[i] = 0;  /* Purge dead slots. */\n    J->maxslot = rbase + (BCReg)gotresults;\n    rec_stop(J, LJ_TRLINK_RETURN, 0);  /* Return to interpreter. */\n    return;\n  }\n  if (frame_isvarg(frame)) {\n    BCReg cbase = (BCReg)frame_delta(frame);\n    if (--J->framedepth < 0)  /* NYI: return of vararg func to lower frame. */\n      lj_trace_err(J, LJ_TRERR_NYIRETL);\n    lua_assert(J->baseslot > 1);\n    rbase += cbase;\n    J->baseslot -= (BCReg)cbase;\n    J->base -= cbase;\n    frame = frame_prevd(frame);\n  }\n  if (frame_islua(frame)) {  /* Return to Lua frame. */\n    BCIns callins = *(frame_pc(frame)-1);\n    ptrdiff_t nresults = bc_b(callins) ? (ptrdiff_t)bc_b(callins)-1 :gotresults;\n    BCReg cbase = bc_a(callins);\n    GCproto *pt = funcproto(frame_func(frame - (cbase+1)));\n    if (J->framedepth == 0 && J->pt && frame == J->L->base - 1) {\n      if (check_downrec_unroll(J, pt)) {\n\tJ->maxslot = (BCReg)(rbase + gotresults);\n\tlj_snap_purge(J);\n\trec_stop(J, LJ_TRLINK_DOWNREC, J->cur.traceno);  /* Down-recursion. */\n\treturn;\n      }\n      lj_snap_add(J);\n    }\n    for (i = 0; i < nresults; i++)  /* Adjust results. */\n      J->base[i-1] = i < gotresults ? J->base[rbase+i] : TREF_NIL;\n    J->maxslot = cbase+(BCReg)nresults;\n    if (J->framedepth > 0) {  /* Return to a frame that is part of the trace. */\n      J->framedepth--;\n      lua_assert(J->baseslot > cbase+1);\n      J->baseslot -= cbase+1;\n      J->base -= cbase+1;\n    } else if (J->parent == 0 && !bc_isret(bc_op(J->cur.startins))) {\n      /* Return to lower frame would leave the loop in a root trace. */\n      lj_trace_err(J, LJ_TRERR_LLEAVE);\n    } else {  /* Return to lower frame. Guard for the target we return to. */\n      TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO);\n      TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame));\n      emitir(IRTG(IR_RETF, IRT_P32), trpt, trpc);\n      J->retdepth++;\n      J->needsnap = 1;\n      lua_assert(J->baseslot == 1);\n      /* Shift result slots up and clear the slots of the new frame below. */\n      memmove(J->base + cbase, J->base-1, sizeof(TRef)*nresults);\n      memset(J->base-1, 0, sizeof(TRef)*(cbase+1));\n    }\n  } else if (frame_iscont(frame)) {  /* Return to continuation frame. */\n    ASMFunction cont = frame_contf(frame);\n    BCReg cbase = (BCReg)frame_delta(frame);\n    if ((J->framedepth -= 2) < 0)\n      lj_trace_err(J, LJ_TRERR_NYIRETL);\n    J->baseslot -= (BCReg)cbase;\n    J->base -= cbase;\n    J->maxslot = cbase-2;\n    if (cont == lj_cont_ra) {\n      /* Copy result to destination slot. */\n      BCReg dst = bc_a(*(frame_contpc(frame)-1));\n      J->base[dst] = gotresults ? J->base[cbase+rbase] : TREF_NIL;\n      if (dst >= J->maxslot) J->maxslot = dst+1;\n    } else if (cont == lj_cont_nop) {\n      /* Nothing to do here. */\n    } else if (cont == lj_cont_cat) {\n      lua_assert(0);\n    } else {\n      /* Result type already specialized. */\n      lua_assert(cont == lj_cont_condf || cont == lj_cont_condt);\n    }\n  } else {\n    lj_trace_err(J, LJ_TRERR_NYIRETL);  /* NYI: handle return to C frame. */\n  }\n  lua_assert(J->baseslot >= 1);\n}\n\n/* -- Metamethod handling ------------------------------------------------- */\n\n/* Prepare to record call to metamethod. */\nstatic BCReg rec_mm_prep(jit_State *J, ASMFunction cont)\n{\n  BCReg s, top = curr_proto(J->L)->framesize;\n  TRef trcont;\n  setcont(&J->L->base[top], cont);\n#if LJ_64\n  trcont = lj_ir_kptr(J, (void *)((int64_t)cont - (int64_t)lj_vm_asm_begin));\n#else\n  trcont = lj_ir_kptr(J, (void *)cont);\n#endif\n  J->base[top] = trcont | TREF_CONT;\n  J->framedepth++;\n  for (s = J->maxslot; s < top; s++)\n    J->base[s] = 0;  /* Clear frame gap to avoid resurrecting previous refs. */\n  return top+1;\n}\n\n/* Record metamethod lookup. */\nint lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)\n{\n  RecordIndex mix;\n  GCtab *mt;\n  if (tref_istab(ix->tab)) {\n    mt = tabref(tabV(&ix->tabv)->metatable);\n    mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_TAB_META);\n  } else if (tref_isudata(ix->tab)) {\n    int udtype = udataV(&ix->tabv)->udtype;\n    mt = tabref(udataV(&ix->tabv)->metatable);\n    /* The metatables of special userdata objects are treated as immutable. */\n    if (udtype != UDTYPE_USERDATA) {\n      cTValue *mo;\n      if (LJ_HASFFI && udtype == UDTYPE_FFI_CLIB) {\n\t/* Specialize to the C library namespace object. */\n\temitir(IRTG(IR_EQ, IRT_P32), ix->tab, lj_ir_kptr(J, udataV(&ix->tabv)));\n      } else {\n\t/* Specialize to the type of userdata. */\n\tTRef tr = emitir(IRT(IR_FLOAD, IRT_U8), ix->tab, IRFL_UDATA_UDTYPE);\n\temitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, udtype));\n      }\n  immutable_mt:\n      mo = lj_tab_getstr(mt, mmname_str(J2G(J), mm));\n      if (!mo || tvisnil(mo))\n\treturn 0;  /* No metamethod. */\n      /* Treat metamethod or index table as immutable, too. */\n      if (!(tvisfunc(mo) || tvistab(mo)))\n\tlj_trace_err(J, LJ_TRERR_BADTYPE);\n      copyTV(J->L, &ix->mobjv, mo);\n      ix->mobj = lj_ir_kgc(J, gcV(mo), tvisfunc(mo) ? IRT_FUNC : IRT_TAB);\n      ix->mtv = mt;\n      ix->mt = TREF_NIL;  /* Dummy value for comparison semantics. */\n      return 1;  /* Got metamethod or index table. */\n    }\n    mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_UDATA_META);\n  } else {\n    /* Specialize to base metatable. Must flush mcode in lua_setmetatable(). */\n    mt = tabref(basemt_obj(J2G(J), &ix->tabv));\n    if (mt == NULL) {\n      ix->mt = TREF_NIL;\n      return 0;  /* No metamethod. */\n    }\n    /* The cdata metatable is treated as immutable. */\n    if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt;\n    ix->mt = mix.tab = lj_ir_ktab(J, mt);\n    goto nocheck;\n  }\n  ix->mt = mt ? mix.tab : TREF_NIL;\n  emitir(IRTG(mt ? IR_NE : IR_EQ, IRT_TAB), mix.tab, lj_ir_knull(J, IRT_TAB));\nnocheck:\n  if (mt) {\n    GCstr *mmstr = mmname_str(J2G(J), mm);\n    cTValue *mo = lj_tab_getstr(mt, mmstr);\n    if (mo && !tvisnil(mo))\n      copyTV(J->L, &ix->mobjv, mo);\n    ix->mtv = mt;\n    settabV(J->L, &mix.tabv, mt);\n    setstrV(J->L, &mix.keyv, mmstr);\n    mix.key = lj_ir_kstr(J, mmstr);\n    mix.val = 0;\n    mix.idxchain = 0;\n    ix->mobj = lj_record_idx(J, &mix);\n    return !tref_isnil(ix->mobj);  /* 1 if metamethod found, 0 if not. */\n  }\n  return 0;  /* No metamethod. */\n}\n\n/* Record call to arithmetic metamethod. */\nstatic TRef rec_mm_arith(jit_State *J, RecordIndex *ix, MMS mm)\n{\n  /* Set up metamethod call first to save ix->tab and ix->tabv. */\n  BCReg func = rec_mm_prep(J, lj_cont_ra);\n  TRef *base = J->base + func;\n  TValue *basev = J->L->base + func;\n  base[1] = ix->tab; base[2] = ix->key;\n  copyTV(J->L, basev+1, &ix->tabv);\n  copyTV(J->L, basev+2, &ix->keyv);\n  if (!lj_record_mm_lookup(J, ix, mm)) {  /* Lookup mm on 1st operand. */\n    if (mm != MM_unm) {\n      ix->tab = ix->key;\n      copyTV(J->L, &ix->tabv, &ix->keyv);\n      if (lj_record_mm_lookup(J, ix, mm))  /* Lookup mm on 2nd operand. */\n\tgoto ok;\n    }\n    lj_trace_err(J, LJ_TRERR_NOMM);\n  }\nok:\n  base[0] = ix->mobj;\n  copyTV(J->L, basev+0, &ix->mobjv);\n  lj_record_call(J, func, 2);\n  return 0;  /* No result yet. */\n}\n\n/* Record call to __len metamethod. */\nstatic TRef rec_mm_len(jit_State *J, TRef tr, TValue *tv)\n{\n  RecordIndex ix;\n  ix.tab = tr;\n  copyTV(J->L, &ix.tabv, tv);\n  if (lj_record_mm_lookup(J, &ix, MM_len)) {\n    BCReg func = rec_mm_prep(J, lj_cont_ra);\n    TRef *base = J->base + func;\n    TValue *basev = J->L->base + func;\n    base[0] = ix.mobj; copyTV(J->L, basev+0, &ix.mobjv);\n    base[1] = tr; copyTV(J->L, basev+1, tv);\n#if LJ_52\n    base[2] = tr; copyTV(J->L, basev+2, tv);\n#else\n    base[2] = TREF_NIL; setnilV(basev+2);\n#endif\n    lj_record_call(J, func, 2);\n  } else {\n    if (LJ_52 && tref_istab(tr))\n      return lj_ir_call(J, IRCALL_lj_tab_len, tr);\n    lj_trace_err(J, LJ_TRERR_NOMM);\n  }\n  return 0;  /* No result yet. */\n}\n\n/* Call a comparison metamethod. */\nstatic void rec_mm_callcomp(jit_State *J, RecordIndex *ix, int op)\n{\n  BCReg func = rec_mm_prep(J, (op&1) ? lj_cont_condf : lj_cont_condt);\n  TRef *base = J->base + func;\n  TValue *tv = J->L->base + func;\n  base[0] = ix->mobj; base[1] = ix->val; base[2] = ix->key;\n  copyTV(J->L, tv+0, &ix->mobjv);\n  copyTV(J->L, tv+1, &ix->valv);\n  copyTV(J->L, tv+2, &ix->keyv);\n  lj_record_call(J, func, 2);\n}\n\n/* Record call to equality comparison metamethod (for tab and udata only). */\nstatic void rec_mm_equal(jit_State *J, RecordIndex *ix, int op)\n{\n  ix->tab = ix->val;\n  copyTV(J->L, &ix->tabv, &ix->valv);\n  if (lj_record_mm_lookup(J, ix, MM_eq)) {  /* Lookup mm on 1st operand. */\n    cTValue *bv;\n    TRef mo1 = ix->mobj;\n    TValue mo1v;\n    copyTV(J->L, &mo1v, &ix->mobjv);\n    /* Avoid the 2nd lookup and the objcmp if the metatables are equal. */\n    bv = &ix->keyv;\n    if (tvistab(bv) && tabref(tabV(bv)->metatable) == ix->mtv) {\n      TRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_TAB_META);\n      emitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt);\n    } else if (tvisudata(bv) && tabref(udataV(bv)->metatable) == ix->mtv) {\n      TRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_UDATA_META);\n      emitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt);\n    } else {  /* Lookup metamethod on 2nd operand and compare both. */\n      ix->tab = ix->key;\n      copyTV(J->L, &ix->tabv, bv);\n      if (!lj_record_mm_lookup(J, ix, MM_eq) ||\n\t  lj_record_objcmp(J, mo1, ix->mobj, &mo1v, &ix->mobjv))\n\treturn;\n    }\n    rec_mm_callcomp(J, ix, op);\n  }\n}\n\n/* Record call to ordered comparison metamethods (for arbitrary objects). */\nstatic void rec_mm_comp(jit_State *J, RecordIndex *ix, int op)\n{\n  ix->tab = ix->val;\n  copyTV(J->L, &ix->tabv, &ix->valv);\n  while (1) {\n    MMS mm = (op & 2) ? MM_le : MM_lt;  /* Try __le + __lt or only __lt. */\n#if LJ_52\n    if (!lj_record_mm_lookup(J, ix, mm)) {  /* Lookup mm on 1st operand. */\n      ix->tab = ix->key;\n      copyTV(J->L, &ix->tabv, &ix->keyv);\n      if (!lj_record_mm_lookup(J, ix, mm))  /* Lookup mm on 2nd operand. */\n\tgoto nomatch;\n    }\n    rec_mm_callcomp(J, ix, op);\n    return;\n#else\n    if (lj_record_mm_lookup(J, ix, mm)) {  /* Lookup mm on 1st operand. */\n      cTValue *bv;\n      TRef mo1 = ix->mobj;\n      TValue mo1v;\n      copyTV(J->L, &mo1v, &ix->mobjv);\n      /* Avoid the 2nd lookup and the objcmp if the metatables are equal. */\n      bv = &ix->keyv;\n      if (tvistab(bv) && tabref(tabV(bv)->metatable) == ix->mtv) {\n\tTRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_TAB_META);\n\temitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt);\n      } else if (tvisudata(bv) && tabref(udataV(bv)->metatable) == ix->mtv) {\n\tTRef mt2 = emitir(IRT(IR_FLOAD, IRT_TAB), ix->key, IRFL_UDATA_META);\n\temitir(IRTG(IR_EQ, IRT_TAB), mt2, ix->mt);\n      } else {  /* Lookup metamethod on 2nd operand and compare both. */\n\tix->tab = ix->key;\n\tcopyTV(J->L, &ix->tabv, bv);\n\tif (!lj_record_mm_lookup(J, ix, mm) ||\n\t    lj_record_objcmp(J, mo1, ix->mobj, &mo1v, &ix->mobjv))\n\t  goto nomatch;\n      }\n      rec_mm_callcomp(J, ix, op);\n      return;\n    }\n#endif\n  nomatch:\n    /* Lookup failed. Retry with  __lt and swapped operands. */\n    if (!(op & 2)) break;  /* Already at __lt. Interpreter will throw. */\n    ix->tab = ix->key; ix->key = ix->val; ix->val = ix->tab;\n    copyTV(J->L, &ix->tabv, &ix->keyv);\n    copyTV(J->L, &ix->keyv, &ix->valv);\n    copyTV(J->L, &ix->valv, &ix->tabv);\n    op ^= 3;\n  }\n}\n\n#if LJ_HASFFI\n/* Setup call to cdata comparison metamethod. */\nstatic void rec_mm_comp_cdata(jit_State *J, RecordIndex *ix, int op, MMS mm)\n{\n  lj_snap_add(J);\n  if (tref_iscdata(ix->val)) {\n    ix->tab = ix->val;\n    copyTV(J->L, &ix->tabv, &ix->valv);\n  } else {\n    lua_assert(tref_iscdata(ix->key));\n    ix->tab = ix->key;\n    copyTV(J->L, &ix->tabv, &ix->keyv);\n  }\n  lj_record_mm_lookup(J, ix, mm);\n  rec_mm_callcomp(J, ix, op);\n}\n#endif\n\n/* -- Indexed access ------------------------------------------------------ */\n\n/* Record bounds-check. */\nstatic void rec_idx_abc(jit_State *J, TRef asizeref, TRef ikey, uint32_t asize)\n{\n  /* Try to emit invariant bounds checks. */\n  if ((J->flags & (JIT_F_OPT_LOOP|JIT_F_OPT_ABC)) ==\n      (JIT_F_OPT_LOOP|JIT_F_OPT_ABC)) {\n    IRRef ref = tref_ref(ikey);\n    IRIns *ir = IR(ref);\n    int32_t ofs = 0;\n    IRRef ofsref = 0;\n    /* Handle constant offsets. */\n    if (ir->o == IR_ADD && irref_isk(ir->op2)) {\n      ofsref = ir->op2;\n      ofs = IR(ofsref)->i;\n      ref = ir->op1;\n      ir = IR(ref);\n    }\n    /* Got scalar evolution analysis results for this reference? */\n    if (ref == J->scev.idx) {\n      int32_t stop;\n      lua_assert(irt_isint(J->scev.t) && ir->o == IR_SLOAD);\n      stop = numberVint(&(J->L->base - J->baseslot)[ir->op1 + FORL_STOP]);\n      /* Runtime value for stop of loop is within bounds? */\n      if ((int64_t)stop + ofs < (int64_t)asize) {\n\t/* Emit invariant bounds check for stop. */\n\temitir(IRTG(IR_ABC, IRT_P32), asizeref, ofs == 0 ? J->scev.stop :\n\t       emitir(IRTI(IR_ADD), J->scev.stop, ofsref));\n\t/* Emit invariant bounds check for start, if not const or negative. */\n\tif (!(J->scev.dir && J->scev.start &&\n\t      (int64_t)IR(J->scev.start)->i + ofs >= 0))\n\t  emitir(IRTG(IR_ABC, IRT_P32), asizeref, ikey);\n\treturn;\n      }\n    }\n  }\n  emitir(IRTGI(IR_ABC), asizeref, ikey);  /* Emit regular bounds check. */\n}\n\n/* Record indexed key lookup. */\nstatic TRef rec_idx_key(jit_State *J, RecordIndex *ix)\n{\n  TRef key;\n  GCtab *t = tabV(&ix->tabv);\n  ix->oldv = lj_tab_get(J->L, t, &ix->keyv);  /* Lookup previous value. */\n\n  /* Integer keys are looked up in the array part first. */\n  key = ix->key;\n  if (tref_isnumber(key)) {\n    int32_t k = numberVint(&ix->keyv);\n    if (!tvisint(&ix->keyv) && numV(&ix->keyv) != (lua_Number)k)\n      k = LJ_MAX_ASIZE;\n    if ((MSize)k < LJ_MAX_ASIZE) {  /* Potential array key? */\n      TRef ikey = lj_opt_narrow_index(J, key);\n      TRef asizeref = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_ASIZE);\n      if ((MSize)k < t->asize) {  /* Currently an array key? */\n\tTRef arrayref;\n\trec_idx_abc(J, asizeref, ikey, t->asize);\n\tarrayref = emitir(IRT(IR_FLOAD, IRT_P32), ix->tab, IRFL_TAB_ARRAY);\n\treturn emitir(IRT(IR_AREF, IRT_P32), arrayref, ikey);\n      } else {  /* Currently not in array (may be an array extension)? */\n\temitir(IRTGI(IR_ULE), asizeref, ikey);  /* Inv. bounds check. */\n\tif (k == 0 && tref_isk(key))\n\t  key = lj_ir_knum_zero(J);  /* Canonicalize 0 or +-0.0 to +0.0. */\n\t/* And continue with the hash lookup. */\n      }\n    } else if (!tref_isk(key)) {\n      /* We can rule out const numbers which failed the integerness test\n      ** above. But all other numbers are potential array keys.\n      */\n      if (t->asize == 0) {  /* True sparse tables have an empty array part. */\n\t/* Guard that the array part stays empty. */\n\tTRef tmp = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_ASIZE);\n\temitir(IRTGI(IR_EQ), tmp, lj_ir_kint(J, 0));\n      } else {\n\tlj_trace_err(J, LJ_TRERR_NYITMIX);\n      }\n    }\n  }\n\n  /* Otherwise the key is located in the hash part. */\n  if (t->hmask == 0) {  /* Shortcut for empty hash part. */\n    /* Guard that the hash part stays empty. */\n    TRef tmp = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_HMASK);\n    emitir(IRTGI(IR_EQ), tmp, lj_ir_kint(J, 0));\n    return lj_ir_kkptr(J, niltvg(J2G(J)));\n  }\n  if (tref_isinteger(key))  /* Hash keys are based on numbers, not ints. */\n    key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT);\n  if (tref_isk(key)) {\n    /* Optimize lookup of constant hash keys. */\n    MSize hslot = (MSize)((char *)ix->oldv - (char *)&noderef(t->node)[0].val);\n    if (t->hmask > 0 && hslot <= t->hmask*(MSize)sizeof(Node) &&\n\thslot <= 65535*(MSize)sizeof(Node)) {\n      TRef node, kslot;\n      TRef hm = emitir(IRTI(IR_FLOAD), ix->tab, IRFL_TAB_HMASK);\n      emitir(IRTGI(IR_EQ), hm, lj_ir_kint(J, (int32_t)t->hmask));\n      node = emitir(IRT(IR_FLOAD, IRT_P32), ix->tab, IRFL_TAB_NODE);\n      kslot = lj_ir_kslot(J, key, hslot / sizeof(Node));\n      return emitir(IRTG(IR_HREFK, IRT_P32), node, kslot);\n    }\n  }\n  /* Fall back to a regular hash lookup. */\n  return emitir(IRT(IR_HREF, IRT_P32), ix->tab, key);\n}\n\n/* Determine whether a key is NOT one of the fast metamethod names. */\nstatic int nommstr(jit_State *J, TRef key)\n{\n  if (tref_isstr(key)) {\n    if (tref_isk(key)) {\n      GCstr *str = ir_kstr(IR(tref_ref(key)));\n      uint32_t mm;\n      for (mm = 0; mm <= MM_FAST; mm++)\n\tif (mmname_str(J2G(J), mm) == str)\n\t  return 0;  /* MUST be one the fast metamethod names. */\n    } else {\n      return 0;  /* Variable string key MAY be a metamethod name. */\n    }\n  }\n  return 1;  /* CANNOT be a metamethod name. */\n}\n\n/* Record indexed load/store. */\nTRef lj_record_idx(jit_State *J, RecordIndex *ix)\n{\n  TRef xref;\n  IROp xrefop, loadop;\n  cTValue *oldv;\n\n  while (!tref_istab(ix->tab)) { /* Handle non-table lookup. */\n    /* Never call raw lj_record_idx() on non-table. */\n    lua_assert(ix->idxchain != 0);\n    if (!lj_record_mm_lookup(J, ix, ix->val ? MM_newindex : MM_index))\n      lj_trace_err(J, LJ_TRERR_NOMM);\n  handlemm:\n    if (tref_isfunc(ix->mobj)) {  /* Handle metamethod call. */\n      BCReg func = rec_mm_prep(J, ix->val ? lj_cont_nop : lj_cont_ra);\n      TRef *base = J->base + func;\n      TValue *tv = J->L->base + func;\n      base[0] = ix->mobj; base[1] = ix->tab; base[2] = ix->key;\n      setfuncV(J->L, tv+0, funcV(&ix->mobjv));\n      copyTV(J->L, tv+1, &ix->tabv);\n      copyTV(J->L, tv+2, &ix->keyv);\n      if (ix->val) {\n\tbase[3] = ix->val;\n\tcopyTV(J->L, tv+3, &ix->valv);\n\tlj_record_call(J, func, 3);  /* mobj(tab, key, val) */\n\treturn 0;\n      } else {\n\tlj_record_call(J, func, 2);  /* res = mobj(tab, key) */\n\treturn 0;  /* No result yet. */\n      }\n    }\n    /* Otherwise retry lookup with metaobject. */\n    ix->tab = ix->mobj;\n    copyTV(J->L, &ix->tabv, &ix->mobjv);\n    if (--ix->idxchain == 0)\n      lj_trace_err(J, LJ_TRERR_IDXLOOP);\n  }\n\n  /* First catch nil and NaN keys for tables. */\n  if (tvisnil(&ix->keyv) || (tvisnum(&ix->keyv) && tvisnan(&ix->keyv))) {\n    if (ix->val)  /* Better fail early. */\n      lj_trace_err(J, LJ_TRERR_STORENN);\n    if (tref_isk(ix->key)) {\n      if (ix->idxchain && lj_record_mm_lookup(J, ix, MM_index))\n\tgoto handlemm;\n      return TREF_NIL;\n    }\n  }\n\n  /* Record the key lookup. */\n  xref = rec_idx_key(J, ix);\n  xrefop = IR(tref_ref(xref))->o;\n  loadop = xrefop == IR_AREF ? IR_ALOAD : IR_HLOAD;\n  /* The lj_meta_tset() inconsistency is gone, but better play safe. */\n  oldv = xrefop == IR_KKPTR ? (cTValue *)ir_kptr(IR(tref_ref(xref))) : ix->oldv;\n\n  if (ix->val == 0) {  /* Indexed load */\n    IRType t = itype2irt(oldv);\n    TRef res;\n    if (oldv == niltvg(J2G(J))) {\n      emitir(IRTG(IR_EQ, IRT_P32), xref, lj_ir_kkptr(J, niltvg(J2G(J))));\n      res = TREF_NIL;\n    } else {\n      res = emitir(IRTG(loadop, t), xref, 0);\n    }\n    if (t == IRT_NIL && ix->idxchain && lj_record_mm_lookup(J, ix, MM_index))\n      goto handlemm;\n    if (irtype_ispri(t)) res = TREF_PRI(t);  /* Canonicalize primitives. */\n    return res;\n  } else {  /* Indexed store. */\n    GCtab *mt = tabref(tabV(&ix->tabv)->metatable);\n    int keybarrier = tref_isgcv(ix->key) && !tref_isnil(ix->val);\n    if (tvisnil(oldv)) {  /* Previous value was nil? */\n      /* Need to duplicate the hasmm check for the early guards. */\n      int hasmm = 0;\n      if (ix->idxchain && mt) {\n\tcTValue *mo = lj_tab_getstr(mt, mmname_str(J2G(J), MM_newindex));\n\thasmm = mo && !tvisnil(mo);\n      }\n      if (hasmm)\n\temitir(IRTG(loadop, IRT_NIL), xref, 0);  /* Guard for nil value. */\n      else if (xrefop == IR_HREF)\n\temitir(IRTG(oldv == niltvg(J2G(J)) ? IR_EQ : IR_NE, IRT_P32),\n\t       xref, lj_ir_kkptr(J, niltvg(J2G(J))));\n      if (ix->idxchain && lj_record_mm_lookup(J, ix, MM_newindex)) {\n\tlua_assert(hasmm);\n\tgoto handlemm;\n      }\n      lua_assert(!hasmm);\n      if (oldv == niltvg(J2G(J))) {  /* Need to insert a new key. */\n\tTRef key = ix->key;\n\tif (tref_isinteger(key))  /* NEWREF needs a TValue as a key. */\n\t  key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT);\n\txref = emitir(IRT(IR_NEWREF, IRT_P32), ix->tab, key);\n\tkeybarrier = 0;  /* NEWREF already takes care of the key barrier. */\n      }\n    } else if (!lj_opt_fwd_wasnonnil(J, loadop, tref_ref(xref))) {\n      /* Cannot derive that the previous value was non-nil, must do checks. */\n      if (xrefop == IR_HREF)  /* Guard against store to niltv. */\n\temitir(IRTG(IR_NE, IRT_P32), xref, lj_ir_kkptr(J, niltvg(J2G(J))));\n      if (ix->idxchain) {  /* Metamethod lookup required? */\n\t/* A check for NULL metatable is cheaper (hoistable) than a load. */\n\tif (!mt) {\n\t  TRef mtref = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_TAB_META);\n\t  emitir(IRTG(IR_EQ, IRT_TAB), mtref, lj_ir_knull(J, IRT_TAB));\n\t} else {\n\t  IRType t = itype2irt(oldv);\n\t  emitir(IRTG(loadop, t), xref, 0);  /* Guard for non-nil value. */\n\t}\n      }\n    } else {\n      keybarrier = 0;  /* Previous non-nil value kept the key alive. */\n    }\n    /* Convert int to number before storing. */\n    if (!LJ_DUALNUM && tref_isinteger(ix->val))\n      ix->val = emitir(IRTN(IR_CONV), ix->val, IRCONV_NUM_INT);\n    emitir(IRT(loadop+IRDELTA_L2S, tref_type(ix->val)), xref, ix->val);\n    if (keybarrier || tref_isgcv(ix->val))\n      emitir(IRT(IR_TBAR, IRT_NIL), ix->tab, 0);\n    /* Invalidate neg. metamethod cache for stores with certain string keys. */\n    if (!nommstr(J, ix->key)) {\n      TRef fref = emitir(IRT(IR_FREF, IRT_P32), ix->tab, IRFL_TAB_NOMM);\n      emitir(IRT(IR_FSTORE, IRT_U8), fref, lj_ir_kint(J, 0));\n    }\n    J->needsnap = 1;\n    return 0;\n  }\n}\n\n/* -- Upvalue access ------------------------------------------------------ */\n\n/* Check whether upvalue is immutable and ok to constify. */\nstatic int rec_upvalue_constify(jit_State *J, GCupval *uvp)\n{\n  if (uvp->immutable) {\n    cTValue *o = uvval(uvp);\n    /* Don't constify objects that may retain large amounts of memory. */\n#if LJ_HASFFI\n    if (tviscdata(o)) {\n      GCcdata *cd = cdataV(o);\n      if (!cdataisv(cd) && !(cd->marked & LJ_GC_CDATA_FIN)) {\n\tCType *ct = ctype_raw(ctype_ctsG(J2G(J)), cd->ctypeid);\n\tif (!ctype_hassize(ct->info) || ct->size <= 16)\n\t  return 1;\n      }\n      return 0;\n    }\n#else\n    UNUSED(J);\n#endif\n    if (!(tvistab(o) || tvisudata(o) || tvisthread(o)))\n      return 1;\n  }\n  return 0;\n}\n\n/* Record upvalue load/store. */\nstatic TRef rec_upvalue(jit_State *J, uint32_t uv, TRef val)\n{\n  GCupval *uvp = &gcref(J->fn->l.uvptr[uv])->uv;\n  TRef fn = getcurrf(J);\n  IRRef uref;\n  int needbarrier = 0;\n  if (rec_upvalue_constify(J, uvp)) {  /* Try to constify immutable upvalue. */\n    TRef tr, kfunc;\n    lua_assert(val == 0);\n    if (!tref_isk(fn)) {  /* Late specialization of current function. */\n      if (J->pt->flags >= PROTO_CLC_POLY)\n\tgoto noconstify;\n      kfunc = lj_ir_kfunc(J, J->fn);\n      emitir(IRTG(IR_EQ, IRT_FUNC), fn, kfunc);\n      J->base[-1] = TREF_FRAME | kfunc;\n      fn = kfunc;\n    }\n    tr = lj_record_constify(J, uvval(uvp));\n    if (tr)\n      return tr;\n  }\nnoconstify:\n  /* Note: this effectively limits LJ_MAX_UPVAL to 127. */\n  uv = (uv << 8) | (hashrot(uvp->dhash, uvp->dhash + HASH_BIAS) & 0xff);\n  if (!uvp->closed) {\n    /* In current stack? */\n    if (uvval(uvp) >= tvref(J->L->stack) &&\n\tuvval(uvp) < tvref(J->L->maxstack)) {\n      int32_t slot = (int32_t)(uvval(uvp) - (J->L->base - J->baseslot));\n      if (slot >= 0) {  /* Aliases an SSA slot? */\n\tslot -= (int32_t)J->baseslot;  /* Note: slot number may be negative! */\n\t/* NYI: add IR to guard that it's still aliasing the same slot. */\n\tif (val == 0) {\n\t  return getslot(J, slot);\n\t} else {\n\t  J->base[slot] = val;\n\t  if (slot >= (int32_t)J->maxslot) J->maxslot = (BCReg)(slot+1);\n\t  return 0;\n\t}\n      }\n    }\n    uref = tref_ref(emitir(IRTG(IR_UREFO, IRT_P32), fn, uv));\n  } else {\n    needbarrier = 1;\n    uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_P32), fn, uv));\n  }\n  if (val == 0) {  /* Upvalue load */\n    IRType t = itype2irt(uvval(uvp));\n    TRef res = emitir(IRTG(IR_ULOAD, t), uref, 0);\n    if (irtype_ispri(t)) res = TREF_PRI(t);  /* Canonicalize primitive refs. */\n    return res;\n  } else {  /* Upvalue store. */\n    /* Convert int to number before storing. */\n    if (!LJ_DUALNUM && tref_isinteger(val))\n      val = emitir(IRTN(IR_CONV), val, IRCONV_NUM_INT);\n    emitir(IRT(IR_USTORE, tref_type(val)), uref, val);\n    if (needbarrier && tref_isgcv(val))\n      emitir(IRT(IR_OBAR, IRT_NIL), uref, val);\n    J->needsnap = 1;\n    return 0;\n  }\n}\n\n/* -- Record calls to Lua functions --------------------------------------- */\n\n/* Check unroll limits for calls. */\nstatic void check_call_unroll(jit_State *J, TraceNo lnk)\n{\n  cTValue *frame = J->L->base - 1;\n  void *pc = mref(frame_func(frame)->l.pc, void);\n  int32_t depth = J->framedepth;\n  int32_t count = 0;\n  if ((J->pt->flags & PROTO_VARARG)) depth--;  /* Vararg frame still missing. */\n  for (; depth > 0; depth--) {  /* Count frames with same prototype. */\n    frame = frame_prev(frame);\n    if (mref(frame_func(frame)->l.pc, void) == pc)\n      count++;\n  }\n  if (J->pc == J->startpc) {\n    if (count + J->tailcalled > J->param[JIT_P_recunroll]) {\n      J->pc++;\n      if (J->framedepth + J->retdepth == 0)\n\trec_stop(J, LJ_TRLINK_TAILREC, J->cur.traceno);  /* Tail-recursion. */\n      else\n\trec_stop(J, LJ_TRLINK_UPREC, J->cur.traceno);  /* Up-recursion. */\n    }\n  } else {\n    if (count > J->param[JIT_P_callunroll]) {\n      if (lnk) {  /* Possible tail- or up-recursion. */\n\tlj_trace_flush(J, lnk);  /* Flush trace that only returns. */\n\t/* Set a small, pseudo-random hotcount for a quick retry of JFUNC*. */\n\thotcount_set(J2GG(J), J->pc+1, LJ_PRNG_BITS(J, 4));\n      }\n      lj_trace_err(J, LJ_TRERR_CUNROLL);\n    }\n  }\n}\n\n/* Record Lua function setup. */\nstatic void rec_func_setup(jit_State *J)\n{\n  GCproto *pt = J->pt;\n  BCReg s, numparams = pt->numparams;\n  if ((pt->flags & PROTO_NOJIT))\n    lj_trace_err(J, LJ_TRERR_CJITOFF);\n  if (J->baseslot + pt->framesize >= LJ_MAX_JSLOTS)\n    lj_trace_err(J, LJ_TRERR_STACKOV);\n  /* Fill up missing parameters with nil. */\n  for (s = J->maxslot; s < numparams; s++)\n    J->base[s] = TREF_NIL;\n  /* The remaining slots should never be read before they are written. */\n  J->maxslot = numparams;\n}\n\n/* Record Lua vararg function setup. */\nstatic void rec_func_vararg(jit_State *J)\n{\n  GCproto *pt = J->pt;\n  BCReg s, fixargs, vframe = J->maxslot+1;\n  lua_assert((pt->flags & PROTO_VARARG));\n  if (J->baseslot + vframe + pt->framesize >= LJ_MAX_JSLOTS)\n    lj_trace_err(J, LJ_TRERR_STACKOV);\n  J->base[vframe-1] = J->base[-1];  /* Copy function up. */\n  /* Copy fixarg slots up and set their original slots to nil. */\n  fixargs = pt->numparams < J->maxslot ? pt->numparams : J->maxslot;\n  for (s = 0; s < fixargs; s++) {\n    J->base[vframe+s] = J->base[s];\n    J->base[s] = TREF_NIL;\n  }\n  J->maxslot = fixargs;\n  J->framedepth++;\n  J->base += vframe;\n  J->baseslot += vframe;\n}\n\n/* Record entry to a Lua function. */\nstatic void rec_func_lua(jit_State *J)\n{\n  rec_func_setup(J);\n  check_call_unroll(J, 0);\n}\n\n/* Record entry to an already compiled function. */\nstatic void rec_func_jit(jit_State *J, TraceNo lnk)\n{\n  GCtrace *T;\n  rec_func_setup(J);\n  T = traceref(J, lnk);\n  if (T->linktype == LJ_TRLINK_RETURN) {  /* Trace returns to interpreter? */\n    check_call_unroll(J, lnk);\n    /* Temporarily unpatch JFUNC* to continue recording across function. */\n    J->patchins = *J->pc;\n    J->patchpc = (BCIns *)J->pc;\n    *J->patchpc = T->startins;\n    return;\n  }\n  J->instunroll = 0;  /* Cannot continue across a compiled function. */\n  if (J->pc == J->startpc && J->framedepth + J->retdepth == 0)\n    rec_stop(J, LJ_TRLINK_TAILREC, J->cur.traceno);  /* Extra tail-recursion. */\n  else\n    rec_stop(J, LJ_TRLINK_ROOT, lnk);  /* Link to the function. */\n}\n\n/* -- Vararg handling ----------------------------------------------------- */\n\n/* Detect y = select(x, ...) idiom. */\nstatic int select_detect(jit_State *J)\n{\n  BCIns ins = J->pc[1];\n  if (bc_op(ins) == BC_CALLM && bc_b(ins) == 2 && bc_c(ins) == 1) {\n    cTValue *func = &J->L->base[bc_a(ins)];\n    if (tvisfunc(func) && funcV(func)->c.ffid == FF_select)\n      return 1;\n  }\n  return 0;\n}\n\n/* Record vararg instruction. */\nstatic void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults)\n{\n  int32_t numparams = J->pt->numparams;\n  ptrdiff_t nvararg = frame_delta(J->L->base-1) - numparams - 1;\n  lua_assert(frame_isvarg(J->L->base-1));\n  if (J->framedepth > 0) {  /* Simple case: varargs defined on-trace. */\n    ptrdiff_t i;\n    if (nvararg < 0) nvararg = 0;\n    if (nresults == -1) {\n      nresults = nvararg;\n      J->maxslot = dst + (BCReg)nvararg;\n    } else if (dst + nresults > J->maxslot) {\n      J->maxslot = dst + (BCReg)nresults;\n    }\n    for (i = 0; i < nresults; i++) {\n      J->base[dst+i] = i < nvararg ? J->base[i - nvararg - 1] : TREF_NIL;\n      lua_assert(J->base[dst+i] != 0);\n    }\n  } else {  /* Unknown number of varargs passed to trace. */\n    TRef fr = emitir(IRTI(IR_SLOAD), 0, IRSLOAD_READONLY|IRSLOAD_FRAME);\n    int32_t frofs = 8*(1+numparams)+FRAME_VARG;\n    if (nresults >= 0) {  /* Known fixed number of results. */\n      ptrdiff_t i;\n      if (nvararg > 0) {\n\tptrdiff_t nload = nvararg >= nresults ? nresults : nvararg;\n\tTRef vbase;\n\tif (nvararg >= nresults)\n\t  emitir(IRTGI(IR_GE), fr, lj_ir_kint(J, frofs+8*(int32_t)nresults));\n\telse\n\t  emitir(IRTGI(IR_EQ), fr, lj_ir_kint(J, frame_ftsz(J->L->base-1)));\n\tvbase = emitir(IRTI(IR_SUB), REF_BASE, fr);\n\tvbase = emitir(IRT(IR_ADD, IRT_P32), vbase, lj_ir_kint(J, frofs-8));\n\tfor (i = 0; i < nload; i++) {\n\t  IRType t = itype2irt(&J->L->base[i-1-nvararg]);\n\t  TRef aref = emitir(IRT(IR_AREF, IRT_P32),\n\t\t\t     vbase, lj_ir_kint(J, (int32_t)i));\n\t  TRef tr = emitir(IRTG(IR_VLOAD, t), aref, 0);\n\t  if (irtype_ispri(t)) tr = TREF_PRI(t);  /* Canonicalize primitives. */\n\t  J->base[dst+i] = tr;\n\t}\n      } else {\n\temitir(IRTGI(IR_LE), fr, lj_ir_kint(J, frofs));\n\tnvararg = 0;\n      }\n      for (i = nvararg; i < nresults; i++)\n\tJ->base[dst+i] = TREF_NIL;\n      if (dst + (BCReg)nresults > J->maxslot)\n\tJ->maxslot = dst + (BCReg)nresults;\n    } else if (select_detect(J)) {  /* y = select(x, ...) */\n      TRef tridx = J->base[dst-1];\n      TRef tr = TREF_NIL;\n      ptrdiff_t idx = lj_ffrecord_select_mode(J, tridx, &J->L->base[dst-1]);\n      if (idx < 0) goto nyivarg;\n      if (idx != 0 && !tref_isinteger(tridx))\n\ttridx = emitir(IRTGI(IR_CONV), tridx, IRCONV_INT_NUM|IRCONV_INDEX);\n      if (idx != 0 && tref_isk(tridx)) {\n\temitir(IRTGI(idx <= nvararg ? IR_GE : IR_LT),\n\t       fr, lj_ir_kint(J, frofs+8*(int32_t)idx));\n\tfrofs -= 8;  /* Bias for 1-based index. */\n      } else if (idx <= nvararg) {  /* Compute size. */\n\tTRef tmp = emitir(IRTI(IR_ADD), fr, lj_ir_kint(J, -frofs));\n\tif (numparams)\n\t  emitir(IRTGI(IR_GE), tmp, lj_ir_kint(J, 0));\n\ttr = emitir(IRTI(IR_BSHR), tmp, lj_ir_kint(J, 3));\n\tif (idx != 0) {\n\t  tridx = emitir(IRTI(IR_ADD), tridx, lj_ir_kint(J, -1));\n\t  rec_idx_abc(J, tr, tridx, (uint32_t)nvararg);\n\t}\n      } else {\n\tTRef tmp = lj_ir_kint(J, frofs);\n\tif (idx != 0) {\n\t  TRef tmp2 = emitir(IRTI(IR_BSHL), tridx, lj_ir_kint(J, 3));\n\t  tmp = emitir(IRTI(IR_ADD), tmp2, tmp);\n\t} else {\n\t  tr = lj_ir_kint(J, 0);\n\t}\n\temitir(IRTGI(IR_LT), fr, tmp);\n      }\n      if (idx != 0 && idx <= nvararg) {\n\tIRType t;\n\tTRef aref, vbase = emitir(IRTI(IR_SUB), REF_BASE, fr);\n\tvbase = emitir(IRT(IR_ADD, IRT_P32), vbase, lj_ir_kint(J, frofs-8));\n\tt = itype2irt(&J->L->base[idx-2-nvararg]);\n\taref = emitir(IRT(IR_AREF, IRT_P32), vbase, tridx);\n\ttr = emitir(IRTG(IR_VLOAD, t), aref, 0);\n\tif (irtype_ispri(t)) tr = TREF_PRI(t);  /* Canonicalize primitives. */\n      }\n      J->base[dst-2] = tr;\n      J->maxslot = dst-1;\n      J->bcskip = 2;  /* Skip CALLM + select. */\n    } else {\n    nyivarg:\n      setintV(&J->errinfo, BC_VARG);\n      lj_trace_err_info(J, LJ_TRERR_NYIBC);\n    }\n  }\n}\n\n/* -- Record allocations -------------------------------------------------- */\n\nstatic TRef rec_tnew(jit_State *J, uint32_t ah)\n{\n  uint32_t asize = ah & 0x7ff;\n  uint32_t hbits = ah >> 11;\n  if (asize == 0x7ff) asize = 0x801;\n  return emitir(IRTG(IR_TNEW, IRT_TAB), asize, hbits);\n}\n\n/* -- Record bytecode ops ------------------------------------------------- */\n\n/* Prepare for comparison. */\nstatic void rec_comp_prep(jit_State *J)\n{\n  /* Prevent merging with snapshot #0 (GC exit) since we fixup the PC. */\n  if (J->cur.nsnap == 1 && J->cur.snap[0].ref == J->cur.nins)\n    emitir_raw(IRT(IR_NOP, IRT_NIL), 0, 0);\n  lj_snap_add(J);\n}\n\n/* Fixup comparison. */\nstatic void rec_comp_fixup(jit_State *J, const BCIns *pc, int cond)\n{\n  BCIns jmpins = pc[1];\n  const BCIns *npc = pc + 2 + (cond ? bc_j(jmpins) : 0);\n  SnapShot *snap = &J->cur.snap[J->cur.nsnap-1];\n  /* Set PC to opposite target to avoid re-recording the comp. in side trace. */\n  J->cur.snapmap[snap->mapofs + snap->nent] = SNAP_MKPC(npc);\n  J->needsnap = 1;\n  if (bc_a(jmpins) < J->maxslot) J->maxslot = bc_a(jmpins);\n  lj_snap_shrink(J);  /* Shrink last snapshot if possible. */\n}\n\n/* Record the next bytecode instruction (_before_ it's executed). */\nvoid lj_record_ins(jit_State *J)\n{\n  cTValue *lbase;\n  RecordIndex ix;\n  const BCIns *pc;\n  BCIns ins;\n  BCOp op;\n  TRef ra, rb, rc;\n\n  /* Perform post-processing action before recording the next instruction. */\n  if (LJ_UNLIKELY(J->postproc != LJ_POST_NONE)) {\n    switch (J->postproc) {\n    case LJ_POST_FIXCOMP:  /* Fixup comparison. */\n      pc = frame_pc(&J2G(J)->tmptv);\n      rec_comp_fixup(J, pc, (!tvistruecond(&J2G(J)->tmptv2) ^ (bc_op(*pc)&1)));\n      /* fallthrough */\n    case LJ_POST_FIXGUARD:  /* Fixup and emit pending guard. */\n    case LJ_POST_FIXGUARDSNAP:  /* Fixup and emit pending guard and snapshot. */\n      if (!tvistruecond(&J2G(J)->tmptv2)) {\n\tJ->fold.ins.o ^= 1;  /* Flip guard to opposite. */\n\tif (J->postproc == LJ_POST_FIXGUARDSNAP) {\n\t  SnapShot *snap = &J->cur.snap[J->cur.nsnap-1];\n\t  J->cur.snapmap[snap->mapofs+snap->nent-1]--;  /* False -> true. */\n\t}\n      }\n      lj_opt_fold(J);  /* Emit pending guard. */\n      /* fallthrough */\n    case LJ_POST_FIXBOOL:\n      if (!tvistruecond(&J2G(J)->tmptv2)) {\n\tBCReg s;\n\tTValue *tv = J->L->base;\n\tfor (s = 0; s < J->maxslot; s++)  /* Fixup stack slot (if any). */\n\t  if (J->base[s] == TREF_TRUE && tvisfalse(&tv[s])) {\n\t    J->base[s] = TREF_FALSE;\n\t    break;\n\t  }\n      }\n      break;\n    case LJ_POST_FIXCONST:\n      {\n\tBCReg s;\n\tTValue *tv = J->L->base;\n\tfor (s = 0; s < J->maxslot; s++)  /* Constify stack slots (if any). */\n\t  if (J->base[s] == TREF_NIL && !tvisnil(&tv[s]))\n\t    J->base[s] = lj_record_constify(J, &tv[s]);\n      }\n      break;\n    case LJ_POST_FFRETRY:  /* Suppress recording of retried fast function. */\n      if (bc_op(*J->pc) >= BC__MAX)\n\treturn;\n      break;\n    default: lua_assert(0); break;\n    }\n    J->postproc = LJ_POST_NONE;\n  }\n\n  /* Need snapshot before recording next bytecode (e.g. after a store). */\n  if (J->needsnap) {\n    J->needsnap = 0;\n    lj_snap_purge(J);\n    lj_snap_add(J);\n    J->mergesnap = 1;\n  }\n\n  /* Skip some bytecodes. */\n  if (LJ_UNLIKELY(J->bcskip > 0)) {\n    J->bcskip--;\n    return;\n  }\n\n  /* Record only closed loops for root traces. */\n  pc = J->pc;\n  if (J->framedepth == 0 &&\n     (MSize)((char *)pc - (char *)J->bc_min) >= J->bc_extent)\n    lj_trace_err(J, LJ_TRERR_LLEAVE);\n\n#ifdef LUA_USE_ASSERT\n  rec_check_slots(J);\n  rec_check_ir(J);\n#endif\n\n  /* Keep a copy of the runtime values of var/num/str operands. */\n#define rav\t(&ix.valv)\n#define rbv\t(&ix.tabv)\n#define rcv\t(&ix.keyv)\n\n  lbase = J->L->base;\n  ins = *pc;\n  op = bc_op(ins);\n  ra = bc_a(ins);\n  ix.val = 0;\n  switch (bcmode_a(op)) {\n  case BCMvar:\n    copyTV(J->L, rav, &lbase[ra]); ix.val = ra = getslot(J, ra); break;\n  default: break;  /* Handled later. */\n  }\n  rb = bc_b(ins);\n  rc = bc_c(ins);\n  switch (bcmode_b(op)) {\n  case BCMnone: rb = 0; rc = bc_d(ins); break;  /* Upgrade rc to 'rd'. */\n  case BCMvar:\n    copyTV(J->L, rbv, &lbase[rb]); ix.tab = rb = getslot(J, rb); break;\n  default: break;  /* Handled later. */\n  }\n  switch (bcmode_c(op)) {\n  case BCMvar:\n    copyTV(J->L, rcv, &lbase[rc]); ix.key = rc = getslot(J, rc); break;\n  case BCMpri: setitype(rcv, ~rc); ix.key = rc = TREF_PRI(IRT_NIL+rc); break;\n  case BCMnum: { cTValue *tv = proto_knumtv(J->pt, rc);\n    copyTV(J->L, rcv, tv); ix.key = rc = tvisint(tv) ? lj_ir_kint(J, intV(tv)) :\n    lj_ir_knumint(J, numV(tv)); } break;\n  case BCMstr: { GCstr *s = gco2str(proto_kgc(J->pt, ~(ptrdiff_t)rc));\n    setstrV(J->L, rcv, s); ix.key = rc = lj_ir_kstr(J, s); } break;\n  default: break;  /* Handled later. */\n  }\n\n  switch (op) {\n\n  /* -- Comparison ops ---------------------------------------------------- */\n\n  case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:\n#if LJ_HASFFI\n    if (tref_iscdata(ra) || tref_iscdata(rc)) {\n      rec_mm_comp_cdata(J, &ix, op, ((int)op & 2) ? MM_le : MM_lt);\n      break;\n    }\n#endif\n    /* Emit nothing for two numeric or string consts. */\n    if (!(tref_isk2(ra,rc) && tref_isnumber_str(ra) && tref_isnumber_str(rc))) {\n      IRType ta = tref_isinteger(ra) ? IRT_INT : tref_type(ra);\n      IRType tc = tref_isinteger(rc) ? IRT_INT : tref_type(rc);\n      int irop;\n      if (ta != tc) {\n\t/* Widen mixed number/int comparisons to number/number comparison. */\n\tif (ta == IRT_INT && tc == IRT_NUM) {\n\t  ra = emitir(IRTN(IR_CONV), ra, IRCONV_NUM_INT);\n\t  ta = IRT_NUM;\n\t} else if (ta == IRT_NUM && tc == IRT_INT) {\n\t  rc = emitir(IRTN(IR_CONV), rc, IRCONV_NUM_INT);\n\t} else if (LJ_52) {\n\t  ta = IRT_NIL;  /* Force metamethod for different types. */\n\t} else if (!((ta == IRT_FALSE || ta == IRT_TRUE) &&\n\t\t     (tc == IRT_FALSE || tc == IRT_TRUE))) {\n\t  break;  /* Interpreter will throw for two different types. */\n\t}\n      }\n      rec_comp_prep(J);\n      irop = (int)op - (int)BC_ISLT + (int)IR_LT;\n      if (ta == IRT_NUM) {\n\tif ((irop & 1)) irop ^= 4;  /* ISGE/ISGT are unordered. */\n\tif (!lj_ir_numcmp(numberVnum(rav), numberVnum(rcv), (IROp)irop))\n\t  irop ^= 5;\n      } else if (ta == IRT_INT) {\n\tif (!lj_ir_numcmp(numberVnum(rav), numberVnum(rcv), (IROp)irop))\n\t  irop ^= 1;\n      } else if (ta == IRT_STR) {\n\tif (!lj_ir_strcmp(strV(rav), strV(rcv), (IROp)irop)) irop ^= 1;\n\tra = lj_ir_call(J, IRCALL_lj_str_cmp, ra, rc);\n\trc = lj_ir_kint(J, 0);\n\tta = IRT_INT;\n      } else {\n\trec_mm_comp(J, &ix, (int)op);\n\tbreak;\n      }\n      emitir(IRTG(irop, ta), ra, rc);\n      rec_comp_fixup(J, J->pc, ((int)op ^ irop) & 1);\n    }\n    break;\n\n  case BC_ISEQV: case BC_ISNEV:\n  case BC_ISEQS: case BC_ISNES:\n  case BC_ISEQN: case BC_ISNEN:\n  case BC_ISEQP: case BC_ISNEP:\n#if LJ_HASFFI\n    if (tref_iscdata(ra) || tref_iscdata(rc)) {\n      rec_mm_comp_cdata(J, &ix, op, MM_eq);\n      break;\n    }\n#endif\n    /* Emit nothing for two non-table, non-udata consts. */\n    if (!(tref_isk2(ra, rc) && !(tref_istab(ra) || tref_isudata(ra)))) {\n      int diff;\n      rec_comp_prep(J);\n      diff = lj_record_objcmp(J, ra, rc, rav, rcv);\n      if (diff == 2 || !(tref_istab(ra) || tref_isudata(ra)))\n\trec_comp_fixup(J, J->pc, ((int)op & 1) == !diff);\n      else if (diff == 1)  /* Only check __eq if different, but same type. */\n\trec_mm_equal(J, &ix, (int)op);\n    }\n    break;\n\n  /* -- Unary test and copy ops ------------------------------------------- */\n\n  case BC_ISTC: case BC_ISFC:\n    if ((op & 1) == tref_istruecond(rc))\n      rc = 0;  /* Don't store if condition is not true. */\n    /* fallthrough */\n  case BC_IST: case BC_ISF:  /* Type specialization suffices. */\n    if (bc_a(pc[1]) < J->maxslot)\n      J->maxslot = bc_a(pc[1]);  /* Shrink used slots. */\n    break;\n\n  /* -- Unary ops --------------------------------------------------------- */\n\n  case BC_NOT:\n    /* Type specialization already forces const result. */\n    rc = tref_istruecond(rc) ? TREF_FALSE : TREF_TRUE;\n    break;\n\n  case BC_LEN:\n    if (tref_isstr(rc))\n      rc = emitir(IRTI(IR_FLOAD), rc, IRFL_STR_LEN);\n    else if (!LJ_52 && tref_istab(rc))\n      rc = lj_ir_call(J, IRCALL_lj_tab_len, rc);\n    else\n      rc = rec_mm_len(J, rc, rcv);\n    break;\n\n  /* -- Arithmetic ops ---------------------------------------------------- */\n\n  case BC_UNM:\n    if (tref_isnumber_str(rc)) {\n      rc = lj_opt_narrow_unm(J, rc, rcv);\n    } else {\n      ix.tab = rc;\n      copyTV(J->L, &ix.tabv, rcv);\n      rc = rec_mm_arith(J, &ix, MM_unm);\n    }\n    break;\n\n  case BC_ADDNV: case BC_SUBNV: case BC_MULNV: case BC_DIVNV: case BC_MODNV:\n    /* Swap rb/rc and rbv/rcv. rav is temp. */\n    ix.tab = rc; ix.key = rc = rb; rb = ix.tab;\n    copyTV(J->L, rav, rbv);\n    copyTV(J->L, rbv, rcv);\n    copyTV(J->L, rcv, rav);\n    if (op == BC_MODNV)\n      goto recmod;\n    /* fallthrough */\n  case BC_ADDVN: case BC_SUBVN: case BC_MULVN: case BC_DIVVN:\n  case BC_ADDVV: case BC_SUBVV: case BC_MULVV: case BC_DIVVV: {\n    MMS mm = bcmode_mm(op);\n    if (tref_isnumber_str(rb) && tref_isnumber_str(rc))\n      rc = lj_opt_narrow_arith(J, rb, rc, rbv, rcv,\n\t\t\t       (int)mm - (int)MM_add + (int)IR_ADD);\n    else\n      rc = rec_mm_arith(J, &ix, mm);\n    break;\n    }\n\n  case BC_MODVN: case BC_MODVV:\n  recmod:\n    if (tref_isnumber_str(rb) && tref_isnumber_str(rc))\n      rc = lj_opt_narrow_mod(J, rb, rc, rcv);\n    else\n      rc = rec_mm_arith(J, &ix, MM_mod);\n    break;\n\n  case BC_POW:\n    if (tref_isnumber_str(rb) && tref_isnumber_str(rc))\n      rc = lj_opt_narrow_pow(J, lj_ir_tonum(J, rb), rc, rcv);\n    else\n      rc = rec_mm_arith(J, &ix, MM_pow);\n    break;\n\n  /* -- Constant and move ops --------------------------------------------- */\n\n  case BC_MOV:\n    /* Clear gap of method call to avoid resurrecting previous refs. */\n    if (ra > J->maxslot) J->base[ra-1] = 0;\n    break;\n  case BC_KSTR: case BC_KNUM: case BC_KPRI:\n    break;\n  case BC_KSHORT:\n    rc = lj_ir_kint(J, (int32_t)(int16_t)rc);\n    break;\n  case BC_KNIL:\n    while (ra <= rc)\n      J->base[ra++] = TREF_NIL;\n    if (rc >= J->maxslot) J->maxslot = rc+1;\n    break;\n#if LJ_HASFFI\n  case BC_KCDATA:\n    rc = lj_ir_kgc(J, proto_kgc(J->pt, ~(ptrdiff_t)rc), IRT_CDATA);\n    break;\n#endif\n\n  /* -- Upvalue and function ops ------------------------------------------ */\n\n  case BC_UGET:\n    rc = rec_upvalue(J, rc, 0);\n    break;\n  case BC_USETV: case BC_USETS: case BC_USETN: case BC_USETP:\n    rec_upvalue(J, ra, rc);\n    break;\n\n  /* -- Table ops --------------------------------------------------------- */\n\n  case BC_GGET: case BC_GSET:\n    settabV(J->L, &ix.tabv, tabref(J->fn->l.env));\n    ix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), getcurrf(J), IRFL_FUNC_ENV);\n    ix.idxchain = LJ_MAX_IDXCHAIN;\n    rc = lj_record_idx(J, &ix);\n    break;\n\n  case BC_TGETB: case BC_TSETB:\n    setintV(&ix.keyv, (int32_t)rc);\n    ix.key = lj_ir_kint(J, (int32_t)rc);\n    /* fallthrough */\n  case BC_TGETV: case BC_TGETS: case BC_TSETV: case BC_TSETS:\n    ix.idxchain = LJ_MAX_IDXCHAIN;\n    rc = lj_record_idx(J, &ix);\n    break;\n\n  case BC_TNEW:\n    rc = rec_tnew(J, rc);\n    break;\n  case BC_TDUP:\n    rc = emitir(IRTG(IR_TDUP, IRT_TAB),\n\t\tlj_ir_ktab(J, gco2tab(proto_kgc(J->pt, ~(ptrdiff_t)rc))), 0);\n    break;\n\n  /* -- Calls and vararg handling ----------------------------------------- */\n\n  case BC_ITERC:\n    J->base[ra] = getslot(J, ra-3);\n    J->base[ra+1] = getslot(J, ra-2);\n    J->base[ra+2] = getslot(J, ra-1);\n    { /* Do the actual copy now because lj_record_call needs the values. */\n      TValue *b = &J->L->base[ra];\n      copyTV(J->L, b, b-3);\n      copyTV(J->L, b+1, b-2);\n      copyTV(J->L, b+2, b-1);\n    }\n    lj_record_call(J, ra, (ptrdiff_t)rc-1);\n    break;\n\n  /* L->top is set to L->base+ra+rc+NARGS-1+1. See lj_dispatch_ins(). */\n  case BC_CALLM:\n    rc = (BCReg)(J->L->top - J->L->base) - ra;\n    /* fallthrough */\n  case BC_CALL:\n    lj_record_call(J, ra, (ptrdiff_t)rc-1);\n    break;\n\n  case BC_CALLMT:\n    rc = (BCReg)(J->L->top - J->L->base) - ra;\n    /* fallthrough */\n  case BC_CALLT:\n    lj_record_tailcall(J, ra, (ptrdiff_t)rc-1);\n    break;\n\n  case BC_VARG:\n    rec_varg(J, ra, (ptrdiff_t)rb-1);\n    break;\n\n  /* -- Returns ----------------------------------------------------------- */\n\n  case BC_RETM:\n    /* L->top is set to L->base+ra+rc+NRESULTS-1, see lj_dispatch_ins(). */\n    rc = (BCReg)(J->L->top - J->L->base) - ra + 1;\n    /* fallthrough */\n  case BC_RET: case BC_RET0: case BC_RET1:\n    lj_record_ret(J, ra, (ptrdiff_t)rc-1);\n    break;\n\n  /* -- Loops and branches ------------------------------------------------ */\n\n  case BC_FORI:\n    if (rec_for(J, pc, 0) != LOOPEV_LEAVE)\n      J->loopref = J->cur.nins;\n    break;\n  case BC_JFORI:\n    lua_assert(bc_op(pc[(ptrdiff_t)rc-BCBIAS_J]) == BC_JFORL);\n    if (rec_for(J, pc, 0) != LOOPEV_LEAVE)  /* Link to existing loop. */\n      rec_stop(J, LJ_TRLINK_ROOT, bc_d(pc[(ptrdiff_t)rc-BCBIAS_J]));\n    /* Continue tracing if the loop is not entered. */\n    break;\n\n  case BC_FORL:\n    rec_loop_interp(J, pc, rec_for(J, pc+((ptrdiff_t)rc-BCBIAS_J), 1));\n    break;\n  case BC_ITERL:\n    rec_loop_interp(J, pc, rec_iterl(J, *pc));\n    break;\n  case BC_LOOP:\n    rec_loop_interp(J, pc, rec_loop(J, ra));\n    break;\n\n  case BC_JFORL:\n    rec_loop_jit(J, rc, rec_for(J, pc+bc_j(traceref(J, rc)->startins), 1));\n    break;\n  case BC_JITERL:\n    rec_loop_jit(J, rc, rec_iterl(J, traceref(J, rc)->startins));\n    break;\n  case BC_JLOOP:\n    rec_loop_jit(J, rc, rec_loop(J, ra));\n    break;\n\n  case BC_IFORL:\n  case BC_IITERL:\n  case BC_ILOOP:\n  case BC_IFUNCF:\n  case BC_IFUNCV:\n    lj_trace_err(J, LJ_TRERR_BLACKL);\n    break;\n\n  case BC_JMP:\n    if (ra < J->maxslot)\n      J->maxslot = ra;  /* Shrink used slots. */\n    break;\n\n  /* -- Function headers -------------------------------------------------- */\n\n  case BC_FUNCF:\n    rec_func_lua(J);\n    break;\n  case BC_JFUNCF:\n    rec_func_jit(J, rc);\n    break;\n\n  case BC_FUNCV:\n    rec_func_vararg(J);\n    rec_func_lua(J);\n    break;\n  case BC_JFUNCV:\n    lua_assert(0);  /* Cannot happen. No hotcall counting for varag funcs. */\n    break;\n\n  case BC_FUNCC:\n  case BC_FUNCCW:\n    lj_ffrecord_func(J);\n    break;\n\n  default:\n    if (op >= BC__MAX) {\n      lj_ffrecord_func(J);\n      break;\n    }\n    /* fallthrough */\n  case BC_ITERN:\n  case BC_ISNEXT:\n  case BC_CAT:\n  case BC_UCLO:\n  case BC_FNEW:\n  case BC_TSETM:\n    setintV(&J->errinfo, (int32_t)op);\n    lj_trace_err_info(J, LJ_TRERR_NYIBC);\n    break;\n  }\n\n  /* rc == 0 if we have no result yet, e.g. pending __index metamethod call. */\n  if (bcmode_a(op) == BCMdst && rc) {\n    J->base[ra] = rc;\n    if (ra >= J->maxslot) J->maxslot = ra+1;\n  }\n\n#undef rav\n#undef rbv\n#undef rcv\n\n  /* Limit the number of recorded IR instructions. */\n  if (J->cur.nins > REF_FIRST+(IRRef)J->param[JIT_P_maxrecord])\n    lj_trace_err(J, LJ_TRERR_TRACEOV);\n}\n\n/* -- Recording setup ----------------------------------------------------- */\n\n/* Setup recording for a root trace started by a hot loop. */\nstatic const BCIns *rec_setup_root(jit_State *J)\n{\n  /* Determine the next PC and the bytecode range for the loop. */\n  const BCIns *pcj, *pc = J->pc;\n  BCIns ins = *pc;\n  BCReg ra = bc_a(ins);\n  switch (bc_op(ins)) {\n  case BC_FORL:\n    J->bc_extent = (MSize)(-bc_j(ins))*sizeof(BCIns);\n    pc += 1+bc_j(ins);\n    J->bc_min = pc;\n    break;\n  case BC_ITERL:\n    lua_assert(bc_op(pc[-1]) == BC_ITERC);\n    J->maxslot = ra + bc_b(pc[-1]) - 1;\n    J->bc_extent = (MSize)(-bc_j(ins))*sizeof(BCIns);\n    pc += 1+bc_j(ins);\n    lua_assert(bc_op(pc[-1]) == BC_JMP);\n    J->bc_min = pc;\n    break;\n  case BC_LOOP:\n    /* Only check BC range for real loops, but not for \"repeat until true\". */\n    pcj = pc + bc_j(ins);\n    ins = *pcj;\n    if (bc_op(ins) == BC_JMP && bc_j(ins) < 0) {\n      J->bc_min = pcj+1 + bc_j(ins);\n      J->bc_extent = (MSize)(-bc_j(ins))*sizeof(BCIns);\n    }\n    J->maxslot = ra;\n    pc++;\n    break;\n  case BC_RET:\n  case BC_RET0:\n  case BC_RET1:\n    /* No bytecode range check for down-recursive root traces. */\n    J->maxslot = ra + bc_d(ins);\n    break;\n  case BC_FUNCF:\n    /* No bytecode range check for root traces started by a hot call. */\n    J->maxslot = J->pt->numparams;\n    pc++;\n    break;\n  default:\n    lua_assert(0);\n    break;\n  }\n  return pc;\n}\n\n/* Setup for recording a new trace. */\nvoid lj_record_setup(jit_State *J)\n{\n  uint32_t i;\n\n  /* Initialize state related to current trace. */\n  memset(J->slot, 0, sizeof(J->slot));\n  memset(J->chain, 0, sizeof(J->chain));\n  memset(J->bpropcache, 0, sizeof(J->bpropcache));\n  J->scev.idx = REF_NIL;\n\n  J->baseslot = 1;  /* Invoking function is at base[-1]. */\n  J->base = J->slot + J->baseslot;\n  J->maxslot = 0;\n  J->framedepth = 0;\n  J->retdepth = 0;\n\n  J->instunroll = J->param[JIT_P_instunroll];\n  J->loopunroll = J->param[JIT_P_loopunroll];\n  J->tailcalled = 0;\n  J->loopref = 0;\n\n  J->bc_min = NULL;  /* Means no limit. */\n  J->bc_extent = ~(MSize)0;\n\n  /* Emit instructions for fixed references. Also triggers initial IR alloc. */\n  emitir_raw(IRT(IR_BASE, IRT_P32), J->parent, J->exitno);\n  for (i = 0; i <= 2; i++) {\n    IRIns *ir = IR(REF_NIL-i);\n    ir->i = 0;\n    ir->t.irt = (uint8_t)(IRT_NIL+i);\n    ir->o = IR_KPRI;\n    ir->prev = 0;\n  }\n  J->cur.nk = REF_TRUE;\n\n  J->startpc = J->pc;\n  setmref(J->cur.startpc, J->pc);\n  if (J->parent) {  /* Side trace. */\n    GCtrace *T = traceref(J, J->parent);\n    TraceNo root = T->root ? T->root : J->parent;\n    J->cur.root = (uint16_t)root;\n    J->cur.startins = BCINS_AD(BC_JMP, 0, 0);\n    /* Check whether we could at least potentially form an extra loop. */\n    if (J->exitno == 0 && T->snap[0].nent == 0) {\n      /* We can narrow a FORL for some side traces, too. */\n      if (J->pc > proto_bc(J->pt) && bc_op(J->pc[-1]) == BC_JFORI &&\n\t  bc_d(J->pc[bc_j(J->pc[-1])-1]) == root) {\n\tlj_snap_add(J);\n\trec_for_loop(J, J->pc-1, &J->scev, 1);\n\tgoto sidecheck;\n      }\n    } else {\n      J->startpc = NULL;  /* Prevent forming an extra loop. */\n    }\n    lj_snap_replay(J, T);\n  sidecheck:\n    if (traceref(J, J->cur.root)->nchild >= J->param[JIT_P_maxside] ||\n\tT->snap[J->exitno].count >= J->param[JIT_P_hotexit] +\n\t\t\t\t    J->param[JIT_P_tryside]) {\n      rec_stop(J, LJ_TRLINK_INTERP, 0);\n    }\n  } else {  /* Root trace. */\n    J->cur.root = 0;\n    J->cur.startins = *J->pc;\n    J->pc = rec_setup_root(J);\n    /* Note: the loop instruction itself is recorded at the end and not\n    ** at the start! So snapshot #0 needs to point to the *next* instruction.\n    */\n    lj_snap_add(J);\n    if (bc_op(J->cur.startins) == BC_FORL)\n      rec_for_loop(J, J->pc-1, &J->scev, 1);\n    if (1 + J->pt->framesize >= LJ_MAX_JSLOTS)\n      lj_trace_err(J, LJ_TRERR_STACKOV);\n  }\n#ifdef LUAJIT_ENABLE_CHECKHOOK\n  /* Regularly check for instruction/line hooks from compiled code and\n  ** exit to the interpreter if the hooks are set.\n  **\n  ** This is a compile-time option and disabled by default, since the\n  ** hook checks may be quite expensive in tight loops.\n  **\n  ** Note this is only useful if hooks are *not* set most of the time.\n  ** Use this only if you want to *asynchronously* interrupt the execution.\n  **\n  ** You can set the instruction hook via lua_sethook() with a count of 1\n  ** from a signal handler or another native thread. Please have a look\n  ** at the first few functions in luajit.c for an example (Ctrl-C handler).\n  */\n  {\n    TRef tr = emitir(IRT(IR_XLOAD, IRT_U8),\n\t\t     lj_ir_kptr(J, &J2G(J)->hookmask), IRXLOAD_VOLATILE);\n    tr = emitir(IRTI(IR_BAND), tr, lj_ir_kint(J, (LUA_MASKLINE|LUA_MASKCOUNT)));\n    emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, 0));\n  }\n#endif\n}\n\n#undef IR\n#undef emitir_raw\n#undef emitir\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_record.h",
    "content": "/*\n** Trace recorder (bytecode -> SSA IR).\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_RECORD_H\n#define _LJ_RECORD_H\n\n#include \"lj_obj.h\"\n#include \"lj_jit.h\"\n\n#if LJ_HASJIT\n/* Context for recording an indexed load/store. */\ntypedef struct RecordIndex {\n  TValue tabv;\t\t/* Runtime value of table (or indexed object). */\n  TValue keyv;\t\t/* Runtime value of key. */\n  TValue valv;\t\t/* Runtime value of stored value. */\n  TValue mobjv;\t\t/* Runtime value of metamethod object. */\n  GCtab *mtv;\t\t/* Runtime value of metatable object. */\n  cTValue *oldv;\t/* Runtime value of previously stored value. */\n  TRef tab;\t\t/* Table (or indexed object) reference. */\n  TRef key;\t\t/* Key reference. */\n  TRef val;\t\t/* Value reference for a store or 0 for a load. */\n  TRef mt;\t\t/* Metatable reference. */\n  TRef mobj;\t\t/* Metamethod object reference. */\n  int idxchain;\t\t/* Index indirections left or 0 for raw lookup. */\n} RecordIndex;\n\nLJ_FUNC int lj_record_objcmp(jit_State *J, TRef a, TRef b,\n\t\t\t     cTValue *av, cTValue *bv);\nLJ_FUNC TRef lj_record_constify(jit_State *J, cTValue *o);\n\nLJ_FUNC void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs);\nLJ_FUNC void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs);\nLJ_FUNC void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults);\n\nLJ_FUNC int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm);\nLJ_FUNC TRef lj_record_idx(jit_State *J, RecordIndex *ix);\n\nLJ_FUNC void lj_record_ins(jit_State *J);\nLJ_FUNC void lj_record_setup(jit_State *J);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_snap.c",
    "content": "/*\n** Snapshot handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_snap_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_gc.h\"\n#include \"lj_tab.h\"\n#include \"lj_state.h\"\n#include \"lj_frame.h\"\n#include \"lj_bc.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n#include \"lj_trace.h\"\n#include \"lj_snap.h\"\n#include \"lj_target.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#include \"lj_cdata.h\"\n#endif\n\n/* Some local macros to save typing. Undef'd at the end. */\n#define IR(ref)\t\t(&J->cur.ir[(ref)])\n\n/* Pass IR on to next optimization in chain (FOLD). */\n#define emitir(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_opt_fold(J))\n\n/* Emit raw IR without passing through optimizations. */\n#define emitir_raw(ot, a, b)\t(lj_ir_set(J, (ot), (a), (b)), lj_ir_emit(J))\n\n/* -- Snapshot buffer allocation ------------------------------------------ */\n\n/* Grow snapshot buffer. */\nvoid lj_snap_grow_buf_(jit_State *J, MSize need)\n{\n  MSize maxsnap = (MSize)J->param[JIT_P_maxsnap];\n  if (need > maxsnap)\n    lj_trace_err(J, LJ_TRERR_SNAPOV);\n  lj_mem_growvec(J->L, J->snapbuf, J->sizesnap, maxsnap, SnapShot);\n  J->cur.snap = J->snapbuf;\n}\n\n/* Grow snapshot map buffer. */\nvoid lj_snap_grow_map_(jit_State *J, MSize need)\n{\n  if (need < 2*J->sizesnapmap)\n    need = 2*J->sizesnapmap;\n  else if (need < 64)\n    need = 64;\n  J->snapmapbuf = (SnapEntry *)lj_mem_realloc(J->L, J->snapmapbuf,\n\t\t    J->sizesnapmap*sizeof(SnapEntry), need*sizeof(SnapEntry));\n  J->cur.snapmap = J->snapmapbuf;\n  J->sizesnapmap = need;\n}\n\n/* -- Snapshot generation ------------------------------------------------- */\n\n/* Add all modified slots to the snapshot. */\nstatic MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots)\n{\n  IRRef retf = J->chain[IR_RETF];  /* Limits SLOAD restore elimination. */\n  BCReg s;\n  MSize n = 0;\n  for (s = 0; s < nslots; s++) {\n    TRef tr = J->slot[s];\n    IRRef ref = tref_ref(tr);\n    if (ref) {\n      SnapEntry sn = SNAP_TR(s, tr);\n      IRIns *ir = IR(ref);\n      if (!(sn & (SNAP_CONT|SNAP_FRAME)) &&\n\t  ir->o == IR_SLOAD && ir->op1 == s && ref > retf) {\n\t/* No need to snapshot unmodified non-inherited slots. */\n\tif (!(ir->op2 & IRSLOAD_INHERIT))\n\t  continue;\n\t/* No need to restore readonly slots and unmodified non-parent slots. */\n\tif (!(LJ_DUALNUM && (ir->op2 & IRSLOAD_CONVERT)) &&\n\t    (ir->op2 & (IRSLOAD_READONLY|IRSLOAD_PARENT)) != IRSLOAD_PARENT)\n\t  sn |= SNAP_NORESTORE;\n      }\n      if (LJ_SOFTFP && irt_isnum(ir->t))\n\tsn |= SNAP_SOFTFPNUM;\n      map[n++] = sn;\n    }\n  }\n  return n;\n}\n\n/* Add frame links at the end of the snapshot. */\nstatic BCReg snapshot_framelinks(jit_State *J, SnapEntry *map)\n{\n  cTValue *frame = J->L->base - 1;\n  cTValue *lim = J->L->base - J->baseslot;\n  cTValue *ftop = frame + funcproto(frame_func(frame))->framesize;\n  MSize f = 0;\n  map[f++] = SNAP_MKPC(J->pc);  /* The current PC is always the first entry. */\n  while (frame > lim) {  /* Backwards traversal of all frames above base. */\n    if (frame_islua(frame)) {\n      map[f++] = SNAP_MKPC(frame_pc(frame));\n      frame = frame_prevl(frame);\n      if (frame + funcproto(frame_func(frame))->framesize > ftop)\n\tftop = frame + funcproto(frame_func(frame))->framesize;\n    } else if (frame_iscont(frame)) {\n      map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));\n      map[f++] = SNAP_MKPC(frame_contpc(frame));\n      frame = frame_prevd(frame);\n    } else {\n      lua_assert(!frame_isc(frame));\n      map[f++] = SNAP_MKFTSZ(frame_ftsz(frame));\n      frame = frame_prevd(frame);\n    }\n  }\n  lua_assert(f == (MSize)(1 + J->framedepth));\n  return (BCReg)(ftop - lim);\n}\n\n/* Take a snapshot of the current stack. */\nstatic void snapshot_stack(jit_State *J, SnapShot *snap, MSize nsnapmap)\n{\n  BCReg nslots = J->baseslot + J->maxslot;\n  MSize nent;\n  SnapEntry *p;\n  /* Conservative estimate. */\n  lj_snap_grow_map(J, nsnapmap + nslots + (MSize)J->framedepth+1);\n  p = &J->cur.snapmap[nsnapmap];\n  nent = snapshot_slots(J, p, nslots);\n  snap->topslot = (uint8_t)snapshot_framelinks(J, p + nent);\n  snap->mapofs = (uint16_t)nsnapmap;\n  snap->ref = (IRRef1)J->cur.nins;\n  snap->nent = (uint8_t)nent;\n  snap->nslots = (uint8_t)nslots;\n  snap->count = 0;\n  J->cur.nsnapmap = (uint16_t)(nsnapmap + nent + 1 + J->framedepth);\n}\n\n/* Add or merge a snapshot. */\nvoid lj_snap_add(jit_State *J)\n{\n  MSize nsnap = J->cur.nsnap;\n  MSize nsnapmap = J->cur.nsnapmap;\n  /* Merge if no ins. inbetween or if requested and no guard inbetween. */\n  if (J->mergesnap ? !irt_isguard(J->guardemit) :\n      (nsnap > 0 && J->cur.snap[nsnap-1].ref == J->cur.nins)) {\n    if (nsnap == 1) {  /* But preserve snap #0 PC. */\n      emitir_raw(IRT(IR_NOP, IRT_NIL), 0, 0);\n      goto nomerge;\n    }\n    nsnapmap = J->cur.snap[--nsnap].mapofs;\n  } else {\n  nomerge:\n    lj_snap_grow_buf(J, nsnap+1);\n    J->cur.nsnap = (uint16_t)(nsnap+1);\n  }\n  J->mergesnap = 0;\n  J->guardemit.irt = 0;\n  snapshot_stack(J, &J->cur.snap[nsnap], nsnapmap);\n}\n\n/* -- Snapshot modification ----------------------------------------------- */\n\n#define SNAP_USEDEF_SLOTS\t(LJ_MAX_JSLOTS+LJ_STACK_EXTRA)\n\n/* Find unused slots with reaching-definitions bytecode data-flow analysis. */\nstatic BCReg snap_usedef(jit_State *J, uint8_t *udf,\n\t\t\t const BCIns *pc, BCReg maxslot)\n{\n  BCReg s;\n  GCobj *o;\n\n  if (maxslot == 0) return 0;\n#ifdef LUAJIT_USE_VALGRIND\n  /* Avoid errors for harmless reads beyond maxslot. */\n  memset(udf, 1, SNAP_USEDEF_SLOTS);\n#else\n  memset(udf, 1, maxslot);\n#endif\n\n  /* Treat open upvalues as used. */\n  o = gcref(J->L->openupval);\n  while (o) {\n    if (uvval(gco2uv(o)) < J->L->base) break;\n    udf[uvval(gco2uv(o)) - J->L->base] = 0;\n    o = gcref(o->gch.nextgc);\n  }\n\n#define USE_SLOT(s)\t\tudf[(s)] &= ~1\n#define DEF_SLOT(s)\t\tudf[(s)] *= 3\n\n  /* Scan through following bytecode and check for uses/defs. */\n  lua_assert(pc >= proto_bc(J->pt) && pc < proto_bc(J->pt) + J->pt->sizebc);\n  for (;;) {\n    BCIns ins = *pc++;\n    BCOp op = bc_op(ins);\n    switch (bcmode_b(op)) {\n    case BCMvar: USE_SLOT(bc_b(ins)); break;\n    default: break;\n    }\n    switch (bcmode_c(op)) {\n    case BCMvar: USE_SLOT(bc_c(ins)); break;\n    case BCMrbase:\n      lua_assert(op == BC_CAT);\n      for (s = bc_b(ins); s <= bc_c(ins); s++) USE_SLOT(s);\n      for (; s < maxslot; s++) DEF_SLOT(s);\n      break;\n    case BCMjump:\n    handle_jump: {\n      BCReg minslot = bc_a(ins);\n      if (op >= BC_FORI && op <= BC_JFORL) minslot += FORL_EXT;\n      else if (op >= BC_ITERL && op <= BC_JITERL) minslot += bc_b(pc[-2])-1;\n      else if (op == BC_UCLO) { pc += bc_j(ins); break; }\n      for (s = minslot; s < maxslot; s++) DEF_SLOT(s);\n      return minslot < maxslot ? minslot : maxslot;\n      }\n    case BCMlit:\n      if (op == BC_JFORL || op == BC_JITERL || op == BC_JLOOP) {\n\tgoto handle_jump;\n      } else if (bc_isret(op)) {\n\tBCReg top = op == BC_RETM ? maxslot : (bc_a(ins) + bc_d(ins)-1);\n\tfor (s = 0; s < bc_a(ins); s++) DEF_SLOT(s);\n\tfor (; s < top; s++) USE_SLOT(s);\n\tfor (; s < maxslot; s++) DEF_SLOT(s);\n\treturn 0;\n      }\n      break;\n    case BCMfunc: return maxslot;  /* NYI: will abort, anyway. */\n    default: break;\n    }\n    switch (bcmode_a(op)) {\n    case BCMvar: USE_SLOT(bc_a(ins)); break;\n    case BCMdst:\n       if (!(op == BC_ISTC || op == BC_ISFC)) DEF_SLOT(bc_a(ins));\n       break;\n    case BCMbase:\n      if (op >= BC_CALLM && op <= BC_VARG) {\n\tBCReg top = (op == BC_CALLM || op == BC_CALLMT || bc_c(ins) == 0) ?\n\t\t    maxslot : (bc_a(ins) + bc_c(ins));\n\ts = bc_a(ins) - ((op == BC_ITERC || op == BC_ITERN) ? 3 : 0);\n\tfor (; s < top; s++) USE_SLOT(s);\n\tfor (; s < maxslot; s++) DEF_SLOT(s);\n\tif (op == BC_CALLT || op == BC_CALLMT) {\n\t  for (s = 0; s < bc_a(ins); s++) DEF_SLOT(s);\n\t  return 0;\n\t}\n      } else if (op == BC_KNIL) {\n\tfor (s = bc_a(ins); s <= bc_d(ins); s++) DEF_SLOT(s);\n      } else if (op == BC_TSETM) {\n\tfor (s = bc_a(ins)-1; s < maxslot; s++) USE_SLOT(s);\n      }\n      break;\n    default: break;\n    }\n    lua_assert(pc >= proto_bc(J->pt) && pc < proto_bc(J->pt) + J->pt->sizebc);\n  }\n\n#undef USE_SLOT\n#undef DEF_SLOT\n\n  return 0;  /* unreachable */\n}\n\n/* Purge dead slots before the next snapshot. */\nvoid lj_snap_purge(jit_State *J)\n{\n  uint8_t udf[SNAP_USEDEF_SLOTS];\n  BCReg maxslot = J->maxslot;\n  BCReg s = snap_usedef(J, udf, J->pc, maxslot);\n  for (; s < maxslot; s++)\n    if (udf[s] != 0)\n      J->base[s] = 0;  /* Purge dead slots. */\n}\n\n/* Shrink last snapshot. */\nvoid lj_snap_shrink(jit_State *J)\n{\n  SnapShot *snap = &J->cur.snap[J->cur.nsnap-1];\n  SnapEntry *map = &J->cur.snapmap[snap->mapofs];\n  MSize n, m, nlim, nent = snap->nent;\n  uint8_t udf[SNAP_USEDEF_SLOTS];\n  BCReg maxslot = J->maxslot;\n  BCReg minslot = snap_usedef(J, udf, snap_pc(map[nent]), maxslot);\n  BCReg baseslot = J->baseslot;\n  maxslot += baseslot;\n  minslot += baseslot;\n  snap->nslots = (uint8_t)maxslot;\n  for (n = m = 0; n < nent; n++) {  /* Remove unused slots from snapshot. */\n    BCReg s = snap_slot(map[n]);\n    if (s < minslot || (s < maxslot && udf[s-baseslot] == 0))\n      map[m++] = map[n];  /* Only copy used slots. */\n  }\n  snap->nent = (uint8_t)m;\n  nlim = J->cur.nsnapmap - snap->mapofs - 1;\n  while (n <= nlim) map[m++] = map[n++];  /* Move PC + frame links down. */\n  J->cur.nsnapmap = (uint16_t)(snap->mapofs + m);  /* Free up space in map. */\n}\n\n/* -- Snapshot access ----------------------------------------------------- */\n\n/* Initialize a Bloom Filter with all renamed refs.\n** There are very few renames (often none), so the filter has\n** very few bits set. This makes it suitable for negative filtering.\n*/\nstatic BloomFilter snap_renamefilter(GCtrace *T, SnapNo lim)\n{\n  BloomFilter rfilt = 0;\n  IRIns *ir;\n  for (ir = &T->ir[T->nins-1]; ir->o == IR_RENAME; ir--)\n    if (ir->op2 <= lim)\n      bloomset(rfilt, ir->op1);\n  return rfilt;\n}\n\n/* Process matching renames to find the original RegSP. */\nstatic RegSP snap_renameref(GCtrace *T, SnapNo lim, IRRef ref, RegSP rs)\n{\n  IRIns *ir;\n  for (ir = &T->ir[T->nins-1]; ir->o == IR_RENAME; ir--)\n    if (ir->op1 == ref && ir->op2 <= lim)\n      rs = ir->prev;\n  return rs;\n}\n\n/* Copy RegSP from parent snapshot to the parent links of the IR. */\nIRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir)\n{\n  SnapShot *snap = &T->snap[snapno];\n  SnapEntry *map = &T->snapmap[snap->mapofs];\n  BloomFilter rfilt = snap_renamefilter(T, snapno);\n  MSize n = 0;\n  IRRef ref = 0;\n  for ( ; ; ir++) {\n    uint32_t rs;\n    if (ir->o == IR_SLOAD) {\n      if (!(ir->op2 & IRSLOAD_PARENT)) break;\n      for ( ; ; n++) {\n\tlua_assert(n < snap->nent);\n\tif (snap_slot(map[n]) == ir->op1) {\n\t  ref = snap_ref(map[n++]);\n\t  break;\n\t}\n      }\n    } else if (LJ_SOFTFP && ir->o == IR_HIOP) {\n      ref++;\n    } else if (ir->o == IR_PVAL) {\n      ref = ir->op1 + REF_BIAS;\n    } else {\n      break;\n    }\n    rs = T->ir[ref].prev;\n    if (bloomtest(rfilt, ref))\n      rs = snap_renameref(T, snapno, ref, rs);\n    ir->prev = (uint16_t)rs;\n    lua_assert(regsp_used(rs));\n  }\n  return ir;\n}\n\n/* -- Snapshot replay ----------------------------------------------------- */\n\n/* Replay constant from parent trace. */\nstatic TRef snap_replay_const(jit_State *J, IRIns *ir)\n{\n  /* Only have to deal with constants that can occur in stack slots. */\n  switch ((IROp)ir->o) {\n  case IR_KPRI: return TREF_PRI(irt_type(ir->t));\n  case IR_KINT: return lj_ir_kint(J, ir->i);\n  case IR_KGC: return lj_ir_kgc(J, ir_kgc(ir), irt_t(ir->t));\n  case IR_KNUM: return lj_ir_k64(J, IR_KNUM, ir_knum(ir));\n  case IR_KINT64: return lj_ir_k64(J, IR_KINT64, ir_kint64(ir));\n  case IR_KPTR: return lj_ir_kptr(J, ir_kptr(ir));  /* Continuation. */\n  default: lua_assert(0); return TREF_NIL; break;\n  }\n}\n\n/* De-duplicate parent reference. */\nstatic TRef snap_dedup(jit_State *J, SnapEntry *map, MSize nmax, IRRef ref)\n{\n  MSize j;\n  for (j = 0; j < nmax; j++)\n    if (snap_ref(map[j]) == ref)\n      return J->slot[snap_slot(map[j])] & ~(SNAP_CONT|SNAP_FRAME);\n  return 0;\n}\n\n/* Emit parent reference with de-duplication. */\nstatic TRef snap_pref(jit_State *J, GCtrace *T, SnapEntry *map, MSize nmax,\n\t\t      BloomFilter seen, IRRef ref)\n{\n  IRIns *ir = &T->ir[ref];\n  TRef tr;\n  if (irref_isk(ref))\n    tr = snap_replay_const(J, ir);\n  else if (!regsp_used(ir->prev))\n    tr = 0;\n  else if (!bloomtest(seen, ref) || (tr = snap_dedup(J, map, nmax, ref)) == 0)\n    tr = emitir(IRT(IR_PVAL, irt_type(ir->t)), ref - REF_BIAS, 0);\n  return tr;\n}\n\n/* Check whether a sunk store corresponds to an allocation. Slow path. */\nstatic int snap_sunk_store2(jit_State *J, IRIns *ira, IRIns *irs)\n{\n  if (irs->o == IR_ASTORE || irs->o == IR_HSTORE ||\n      irs->o == IR_FSTORE || irs->o == IR_XSTORE) {\n    IRIns *irk = IR(irs->op1);\n    if (irk->o == IR_AREF || irk->o == IR_HREFK)\n      irk = IR(irk->op1);\n    return (IR(irk->op1) == ira);\n  }\n  return 0;\n}\n\n/* Check whether a sunk store corresponds to an allocation. Fast path. */\nstatic LJ_AINLINE int snap_sunk_store(jit_State *J, IRIns *ira, IRIns *irs)\n{\n  if (irs->s != 255)\n    return (ira + irs->s == irs);  /* Fast check. */\n  return snap_sunk_store2(J, ira, irs);\n}\n\n/* Replay snapshot state to setup side trace. */\nvoid lj_snap_replay(jit_State *J, GCtrace *T)\n{\n  SnapShot *snap = &T->snap[J->exitno];\n  SnapEntry *map = &T->snapmap[snap->mapofs];\n  MSize n, nent = snap->nent;\n  BloomFilter seen = 0;\n  int pass23 = 0;\n  J->framedepth = 0;\n  /* Emit IR for slots inherited from parent snapshot. */\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    BCReg s = snap_slot(sn);\n    IRRef ref = snap_ref(sn);\n    IRIns *ir = &T->ir[ref];\n    TRef tr;\n    /* The bloom filter avoids O(nent^2) overhead for de-duping slots. */\n    if (bloomtest(seen, ref) && (tr = snap_dedup(J, map, n, ref)) != 0)\n      goto setslot;\n    bloomset(seen, ref);\n    if (irref_isk(ref)) {\n      tr = snap_replay_const(J, ir);\n    } else if (!regsp_used(ir->prev)) {\n      pass23 = 1;\n      lua_assert(s != 0);\n      tr = s;\n    } else {\n      IRType t = irt_type(ir->t);\n      uint32_t mode = IRSLOAD_INHERIT|IRSLOAD_PARENT;\n      if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM)) t = IRT_NUM;\n      if (ir->o == IR_SLOAD) mode |= (ir->op2 & IRSLOAD_READONLY);\n      tr = emitir_raw(IRT(IR_SLOAD, t), s, mode);\n    }\n  setslot:\n    J->slot[s] = tr | (sn&(SNAP_CONT|SNAP_FRAME));  /* Same as TREF_* flags. */\n    J->framedepth += ((sn & (SNAP_CONT|SNAP_FRAME)) && s);\n    if ((sn & SNAP_FRAME))\n      J->baseslot = s+1;\n  }\n  if (pass23) {\n    IRIns *irlast = &T->ir[snap->ref];\n    pass23 = 0;\n    /* Emit dependent PVALs. */\n    for (n = 0; n < nent; n++) {\n      SnapEntry sn = map[n];\n      IRRef refp = snap_ref(sn);\n      IRIns *ir = &T->ir[refp];\n      if (regsp_reg(ir->r) == RID_SUNK) {\n\tif (J->slot[snap_slot(sn)] != snap_slot(sn)) continue;\n\tpass23 = 1;\n\tlua_assert(ir->o == IR_TNEW || ir->o == IR_TDUP ||\n\t\t   ir->o == IR_CNEW || ir->o == IR_CNEWI);\n\tif (ir->op1 >= T->nk) snap_pref(J, T, map, nent, seen, ir->op1);\n\tif (ir->op2 >= T->nk) snap_pref(J, T, map, nent, seen, ir->op2);\n\tif (LJ_HASFFI && ir->o == IR_CNEWI) {\n\t  if (LJ_32 && refp+1 < T->nins && (ir+1)->o == IR_HIOP)\n\t    snap_pref(J, T, map, nent, seen, (ir+1)->op2);\n\t} else {\n\t  IRIns *irs;\n\t  for (irs = ir+1; irs < irlast; irs++)\n\t    if (irs->r == RID_SINK && snap_sunk_store(J, ir, irs)) {\n\t      if (snap_pref(J, T, map, nent, seen, irs->op2) == 0)\n\t\tsnap_pref(J, T, map, nent, seen, T->ir[irs->op2].op1);\n\t      else if ((LJ_SOFTFP || (LJ_32 && LJ_HASFFI)) &&\n\t\t       irs+1 < irlast && (irs+1)->o == IR_HIOP)\n\t\tsnap_pref(J, T, map, nent, seen, (irs+1)->op2);\n\t    }\n\t}\n      } else if (!irref_isk(refp) && !regsp_used(ir->prev)) {\n\tlua_assert(ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT);\n\tJ->slot[snap_slot(sn)] = snap_pref(J, T, map, nent, seen, ir->op1);\n      }\n    }\n    /* Replay sunk instructions. */\n    for (n = 0; pass23 && n < nent; n++) {\n      SnapEntry sn = map[n];\n      IRRef refp = snap_ref(sn);\n      IRIns *ir = &T->ir[refp];\n      if (regsp_reg(ir->r) == RID_SUNK) {\n\tTRef op1, op2;\n\tif (J->slot[snap_slot(sn)] != snap_slot(sn)) {  /* De-dup allocs. */\n\t  J->slot[snap_slot(sn)] = J->slot[J->slot[snap_slot(sn)]];\n\t  continue;\n\t}\n\top1 = ir->op1;\n\tif (op1 >= T->nk) op1 = snap_pref(J, T, map, nent, seen, op1);\n\top2 = ir->op2;\n\tif (op2 >= T->nk) op2 = snap_pref(J, T, map, nent, seen, op2);\n\tif (LJ_HASFFI && ir->o == IR_CNEWI) {\n\t  if (LJ_32 && refp+1 < T->nins && (ir+1)->o == IR_HIOP) {\n\t    lj_needsplit(J);  /* Emit joining HIOP. */\n\t    op2 = emitir_raw(IRT(IR_HIOP, IRT_I64), op2,\n\t\t\t     snap_pref(J, T, map, nent, seen, (ir+1)->op2));\n\t  }\n\t  J->slot[snap_slot(sn)] = emitir(ir->ot, op1, op2);\n\t} else {\n\t  IRIns *irs;\n\t  TRef tr = emitir(ir->ot, op1, op2);\n\t  J->slot[snap_slot(sn)] = tr;\n\t  for (irs = ir+1; irs < irlast; irs++)\n\t    if (irs->r == RID_SINK && snap_sunk_store(J, ir, irs)) {\n\t      IRIns *irr = &T->ir[irs->op1];\n\t      TRef val, key = irr->op2, tmp = tr;\n\t      if (irr->o != IR_FREF) {\n\t\tIRIns *irk = &T->ir[key];\n\t\tif (irr->o == IR_HREFK)\n\t\t  key = lj_ir_kslot(J, snap_replay_const(J, &T->ir[irk->op1]),\n\t\t\t\t    irk->op2);\n\t\telse\n\t\t  key = snap_replay_const(J, irk);\n\t\tif (irr->o == IR_HREFK || irr->o == IR_AREF) {\n\t\t  IRIns *irf = &T->ir[irr->op1];\n\t\t  tmp = emitir(irf->ot, tmp, irf->op2);\n\t\t}\n\t      }\n\t      tmp = emitir(irr->ot, tmp, key);\n\t      val = snap_pref(J, T, map, nent, seen, irs->op2);\n\t      if (val == 0) {\n\t\tIRIns *irc = &T->ir[irs->op2];\n\t\tlua_assert(irc->o == IR_CONV && irc->op2 == IRCONV_NUM_INT);\n\t\tval = snap_pref(J, T, map, nent, seen, irc->op1);\n\t\tval = emitir(IRTN(IR_CONV), val, IRCONV_NUM_INT);\n\t      } else if ((LJ_SOFTFP || (LJ_32 && LJ_HASFFI)) &&\n\t\t\t irs+1 < irlast && (irs+1)->o == IR_HIOP) {\n\t\tIRType t = IRT_I64;\n\t\tif (LJ_SOFTFP && irt_type((irs+1)->t) == IRT_SOFTFP)\n\t\t  t = IRT_NUM;\n\t\tlj_needsplit(J);\n\t\tif (irref_isk(irs->op2) && irref_isk((irs+1)->op2)) {\n\t\t  uint64_t k = (uint32_t)T->ir[irs->op2].i +\n\t\t\t       ((uint64_t)T->ir[(irs+1)->op2].i << 32);\n\t\t  val = lj_ir_k64(J, t == IRT_I64 ? IR_KINT64 : IR_KNUM,\n\t\t\t\t  lj_ir_k64_find(J, k));\n\t\t} else {\n\t\t  val = emitir_raw(IRT(IR_HIOP, t), val,\n\t\t\t  snap_pref(J, T, map, nent, seen, (irs+1)->op2));\n\t\t}\n\t\ttmp = emitir(IRT(irs->o, t), tmp, val);\n\t\tcontinue;\n\t      }\n\t      tmp = emitir(irs->ot, tmp, val);\n\t    }\n\t}\n      }\n    }\n  }\n  J->base = J->slot + J->baseslot;\n  J->maxslot = snap->nslots - J->baseslot;\n  lj_snap_add(J);\n  if (pass23)  /* Need explicit GC step _after_ initial snapshot. */\n    emitir_raw(IRTG(IR_GCSTEP, IRT_NIL), 0, 0);\n}\n\n/* -- Snapshot restore ---------------------------------------------------- */\n\nstatic void snap_unsink(jit_State *J, GCtrace *T, ExitState *ex,\n\t\t\tSnapNo snapno, BloomFilter rfilt,\n\t\t\tIRIns *ir, TValue *o);\n\n/* Restore a value from the trace exit state. */\nstatic void snap_restoreval(jit_State *J, GCtrace *T, ExitState *ex,\n\t\t\t    SnapNo snapno, BloomFilter rfilt,\n\t\t\t    IRRef ref, TValue *o)\n{\n  IRIns *ir = &T->ir[ref];\n  IRType1 t = ir->t;\n  RegSP rs = ir->prev;\n  if (irref_isk(ref)) {  /* Restore constant slot. */\n    lj_ir_kvalue(J->L, o, ir);\n    return;\n  }\n  if (LJ_UNLIKELY(bloomtest(rfilt, ref)))\n    rs = snap_renameref(T, snapno, ref, rs);\n  if (ra_hasspill(regsp_spill(rs))) {  /* Restore from spill slot. */\n    int32_t *sps = &ex->spill[regsp_spill(rs)];\n    if (irt_isinteger(t)) {\n      setintV(o, *sps);\n#if !LJ_SOFTFP\n    } else if (irt_isnum(t)) {\n      o->u64 = *(uint64_t *)sps;\n#endif\n    } else if (LJ_64 && irt_islightud(t)) {\n      /* 64 bit lightuserdata which may escape already has the tag bits. */\n      o->u64 = *(uint64_t *)sps;\n    } else {\n      lua_assert(!irt_ispri(t));  /* PRI refs never have a spill slot. */\n      setgcrefi(o->gcr, *sps);\n      setitype(o, irt_toitype(t));\n    }\n  } else {  /* Restore from register. */\n    Reg r = regsp_reg(rs);\n    if (ra_noreg(r)) {\n      lua_assert(ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT);\n      snap_restoreval(J, T, ex, snapno, rfilt, ir->op1, o);\n      if (LJ_DUALNUM) setnumV(o, (lua_Number)intV(o));\n      return;\n    } else if (irt_isinteger(t)) {\n      setintV(o, (int32_t)ex->gpr[r-RID_MIN_GPR]);\n#if !LJ_SOFTFP\n    } else if (irt_isnum(t)) {\n      setnumV(o, ex->fpr[r-RID_MIN_FPR]);\n#endif\n    } else if (LJ_64 && irt_islightud(t)) {\n      /* 64 bit lightuserdata which may escape already has the tag bits. */\n      o->u64 = ex->gpr[r-RID_MIN_GPR];\n    } else {\n      if (!irt_ispri(t))\n\tsetgcrefi(o->gcr, ex->gpr[r-RID_MIN_GPR]);\n      setitype(o, irt_toitype(t));\n    }\n  }\n}\n\n#if LJ_HASFFI\n/* Restore raw data from the trace exit state. */\nstatic void snap_restoredata(GCtrace *T, ExitState *ex,\n\t\t\t     SnapNo snapno, BloomFilter rfilt,\n\t\t\t     IRRef ref, void *dst, CTSize sz)\n{\n  IRIns *ir = &T->ir[ref];\n  RegSP rs = ir->prev;\n  int32_t *src;\n  uint64_t tmp;\n  if (irref_isk(ref)) {\n    if (ir->o == IR_KNUM || ir->o == IR_KINT64) {\n      src = mref(ir->ptr, int32_t);\n    } else if (sz == 8) {\n      tmp = (uint64_t)(uint32_t)ir->i;\n      src = (int32_t *)&tmp;\n    } else {\n      src = &ir->i;\n    }\n  } else {\n    if (LJ_UNLIKELY(bloomtest(rfilt, ref)))\n      rs = snap_renameref(T, snapno, ref, rs);\n    if (ra_hasspill(regsp_spill(rs))) {\n      src = &ex->spill[regsp_spill(rs)];\n      if (sz == 8 && !irt_is64(ir->t)) {\n\ttmp = (uint64_t)(uint32_t)*src;\n\tsrc = (int32_t *)&tmp;\n      }\n    } else {\n      Reg r = regsp_reg(rs);\n      if (ra_noreg(r)) {\n\t/* Note: this assumes CNEWI is never used for SOFTFP split numbers. */\n\tlua_assert(sz == 8 && ir->o == IR_CONV && ir->op2 == IRCONV_NUM_INT);\n\tsnap_restoredata(T, ex, snapno, rfilt, ir->op1, dst, 4);\n\t*(lua_Number *)dst = (lua_Number)*(int32_t *)dst;\n\treturn;\n      }\n      src = (int32_t *)&ex->gpr[r-RID_MIN_GPR];\n#if !LJ_SOFTFP\n      if (r >= RID_MAX_GPR) {\n\tsrc = (int32_t *)&ex->fpr[r-RID_MIN_FPR];\n#if LJ_TARGET_PPC\n\tif (sz == 4) {  /* PPC FPRs are always doubles. */\n\t  *(float *)dst = (float)*(double *)src;\n\t  return;\n\t}\n#else\n\tif (LJ_BE && sz == 4) src++;\n#endif\n      }\n#endif\n    }\n  }\n  lua_assert(sz == 1 || sz == 2 || sz == 4 || sz == 8);\n  if (sz == 4) *(int32_t *)dst = *src;\n  else if (sz == 8) *(int64_t *)dst = *(int64_t *)src;\n  else if (sz == 1) *(int8_t *)dst = (int8_t)*src;\n  else *(int16_t *)dst = (int16_t)*src;\n}\n#endif\n\n/* Unsink allocation from the trace exit state. Unsink sunk stores. */\nstatic void snap_unsink(jit_State *J, GCtrace *T, ExitState *ex,\n\t\t\tSnapNo snapno, BloomFilter rfilt,\n\t\t\tIRIns *ir, TValue *o)\n{\n  lua_assert(ir->o == IR_TNEW || ir->o == IR_TDUP ||\n\t     ir->o == IR_CNEW || ir->o == IR_CNEWI);\n#if LJ_HASFFI\n  if (ir->o == IR_CNEW || ir->o == IR_CNEWI) {\n    CTState *cts = ctype_ctsG(J2G(J));\n    CTypeID id = (CTypeID)T->ir[ir->op1].i;\n    CTSize sz = lj_ctype_size(cts, id);\n    GCcdata *cd = lj_cdata_new(cts, id, sz);\n    setcdataV(J->L, o, cd);\n    if (ir->o == IR_CNEWI) {\n      uint8_t *p = (uint8_t *)cdataptr(cd);\n      lua_assert(sz == 4 || sz == 8);\n      if (LJ_32 && sz == 8 && ir+1 < T->ir + T->nins && (ir+1)->o == IR_HIOP) {\n\tsnap_restoredata(T, ex, snapno, rfilt, (ir+1)->op2, LJ_LE?p+4:p, 4);\n\tif (LJ_BE) p += 4;\n\tsz = 4;\n      }\n      snap_restoredata(T, ex, snapno, rfilt, ir->op2, p, sz);\n    } else {\n      IRIns *irs, *irlast = &T->ir[T->snap[snapno].ref];\n      for (irs = ir+1; irs < irlast; irs++)\n\tif (irs->r == RID_SINK && snap_sunk_store(J, ir, irs)) {\n\t  IRIns *iro = &T->ir[T->ir[irs->op1].op2];\n\t  uint8_t *p = (uint8_t *)cd;\n\t  CTSize szs;\n\t  lua_assert(irs->o == IR_XSTORE && T->ir[irs->op1].o == IR_ADD);\n\t  lua_assert(iro->o == IR_KINT || iro->o == IR_KINT64);\n\t  if (irt_is64(irs->t)) szs = 8;\n\t  else if (irt_isi8(irs->t) || irt_isu8(irs->t)) szs = 1;\n\t  else if (irt_isi16(irs->t) || irt_isu16(irs->t)) szs = 2;\n\t  else szs = 4;\n\t  if (LJ_64 && iro->o == IR_KINT64)\n\t    p += (int64_t)ir_k64(iro)->u64;\n\t  else\n\t    p += iro->i;\n\t  lua_assert(p >= (uint8_t *)cdataptr(cd) &&\n\t\t     p + szs <= (uint8_t *)cdataptr(cd) + sz);\n\t  if (LJ_32 && irs+1 < T->ir + T->nins && (irs+1)->o == IR_HIOP) {\n\t    lua_assert(szs == 4);\n\t    snap_restoredata(T, ex, snapno, rfilt, (irs+1)->op2, LJ_LE?p+4:p,4);\n\t    if (LJ_BE) p += 4;\n\t  }\n\t  snap_restoredata(T, ex, snapno, rfilt, irs->op2, p, szs);\n\t}\n    }\n  } else\n#endif\n  {\n    IRIns *irs, *irlast;\n    GCtab *t = ir->o == IR_TNEW ? lj_tab_new(J->L, ir->op1, ir->op2) :\n\t\t\t\t  lj_tab_dup(J->L, ir_ktab(&T->ir[ir->op1]));\n    settabV(J->L, o, t);\n    irlast = &T->ir[T->snap[snapno].ref];\n    for (irs = ir+1; irs < irlast; irs++)\n      if (irs->r == RID_SINK && snap_sunk_store(J, ir, irs)) {\n\tIRIns *irk = &T->ir[irs->op1];\n\tTValue tmp, *val;\n\tlua_assert(irs->o == IR_ASTORE || irs->o == IR_HSTORE ||\n\t\t   irs->o == IR_FSTORE);\n\tif (irk->o == IR_FREF) {\n\t  lua_assert(irk->op2 == IRFL_TAB_META);\n\t  snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, &tmp);\n\t  /* NOBARRIER: The table is new (marked white). */\n\t  setgcref(t->metatable, obj2gco(tabV(&tmp)));\n\t} else {\n\t  irk = &T->ir[irk->op2];\n\t  if (irk->o == IR_KSLOT) irk = &T->ir[irk->op1];\n\t  lj_ir_kvalue(J->L, &tmp, irk);\n\t  val = lj_tab_set(J->L, t, &tmp);\n\t  /* NOBARRIER: The table is new (marked white). */\n\t  snap_restoreval(J, T, ex, snapno, rfilt, irs->op2, val);\n\t  if (LJ_SOFTFP && irs+1 < T->ir + T->nins && (irs+1)->o == IR_HIOP) {\n\t    snap_restoreval(J, T, ex, snapno, rfilt, (irs+1)->op2, &tmp);\n\t    val->u32.hi = tmp.u32.lo;\n\t  }\n\t}\n      }\n  }\n}\n\n/* Restore interpreter state from exit state with the help of a snapshot. */\nconst BCIns *lj_snap_restore(jit_State *J, void *exptr)\n{\n  ExitState *ex = (ExitState *)exptr;\n  SnapNo snapno = J->exitno;  /* For now, snapno == exitno. */\n  GCtrace *T = traceref(J, J->parent);\n  SnapShot *snap = &T->snap[snapno];\n  MSize n, nent = snap->nent;\n  SnapEntry *map = &T->snapmap[snap->mapofs];\n  SnapEntry *flinks = &T->snapmap[snap_nextofs(T, snap)-1];\n  int32_t ftsz0;\n  TValue *frame;\n  BloomFilter rfilt = snap_renamefilter(T, snapno);\n  const BCIns *pc = snap_pc(map[nent]);\n  lua_State *L = J->L;\n\n  /* Set interpreter PC to the next PC to get correct error messages. */\n  setcframe_pc(cframe_raw(L->cframe), pc+1);\n\n  /* Make sure the stack is big enough for the slots from the snapshot. */\n  if (LJ_UNLIKELY(L->base + snap->topslot >= tvref(L->maxstack))) {\n    L->top = curr_topL(L);\n    lj_state_growstack(L, snap->topslot - curr_proto(L)->framesize);\n  }\n\n  /* Fill stack slots with data from the registers and spill slots. */\n  frame = L->base-1;\n  ftsz0 = frame_ftsz(frame);  /* Preserve link to previous frame in slot #0. */\n  for (n = 0; n < nent; n++) {\n    SnapEntry sn = map[n];\n    if (!(sn & SNAP_NORESTORE)) {\n      TValue *o = &frame[snap_slot(sn)];\n      IRRef ref = snap_ref(sn);\n      IRIns *ir = &T->ir[ref];\n      if (ir->r == RID_SUNK) {\n\tMSize j;\n\tfor (j = 0; j < n; j++)\n\t  if (snap_ref(map[j]) == ref) {  /* De-duplicate sunk allocations. */\n\t    copyTV(L, o, &frame[snap_slot(map[j])]);\n\t    goto dupslot;\n\t  }\n\tsnap_unsink(J, T, ex, snapno, rfilt, ir, o);\n      dupslot:\n\tcontinue;\n      }\n      snap_restoreval(J, T, ex, snapno, rfilt, ref, o);\n      if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM) && tvisint(o)) {\n\tTValue tmp;\n\tsnap_restoreval(J, T, ex, snapno, rfilt, ref+1, &tmp);\n\to->u32.hi = tmp.u32.lo;\n      } else if ((sn & (SNAP_CONT|SNAP_FRAME))) {\n\t/* Overwrite tag with frame link. */\n\to->fr.tp.ftsz = snap_slot(sn) != 0 ? (int32_t)*flinks-- : ftsz0;\n\tL->base = o+1;\n      }\n    }\n  }\n  lua_assert(map + nent == flinks);\n\n  /* Compute current stack top. */\n  switch (bc_op(*pc)) {\n  case BC_CALLM: case BC_CALLMT: case BC_RETM: case BC_TSETM:\n    L->top = frame + snap->nslots;\n    break;\n  default:\n    L->top = curr_topL(L);\n    break;\n  }\n  return pc;\n}\n\n#undef IR\n#undef emitir_raw\n#undef emitir\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_snap.h",
    "content": "/*\n** Snapshot handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_SNAP_H\n#define _LJ_SNAP_H\n\n#include \"lj_obj.h\"\n#include \"lj_jit.h\"\n\n#if LJ_HASJIT\nLJ_FUNC void lj_snap_add(jit_State *J);\nLJ_FUNC void lj_snap_purge(jit_State *J);\nLJ_FUNC void lj_snap_shrink(jit_State *J);\nLJ_FUNC IRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir);\nLJ_FUNC void lj_snap_replay(jit_State *J, GCtrace *T);\nLJ_FUNC const BCIns *lj_snap_restore(jit_State *J, void *exptr);\nLJ_FUNC void lj_snap_grow_buf_(jit_State *J, MSize need);\nLJ_FUNC void lj_snap_grow_map_(jit_State *J, MSize need);\n\nstatic LJ_AINLINE void lj_snap_grow_buf(jit_State *J, MSize need)\n{\n  if (LJ_UNLIKELY(need > J->sizesnap)) lj_snap_grow_buf_(J, need);\n}\n\nstatic LJ_AINLINE void lj_snap_grow_map(jit_State *J, MSize need)\n{\n  if (LJ_UNLIKELY(need > J->sizesnapmap)) lj_snap_grow_map_(J, need);\n}\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_state.c",
    "content": "/*\n** State and stack handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_state_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_func.h\"\n#include \"lj_meta.h\"\n#include \"lj_state.h\"\n#include \"lj_frame.h\"\n#if LJ_HASFFI\n#include \"lj_ctype.h\"\n#endif\n#include \"lj_trace.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"lj_lex.h\"\n#include \"lj_alloc.h\"\n\n/* -- Stack handling ------------------------------------------------------ */\n\n/* Stack sizes. */\n#define LJ_STACK_MIN\tLUA_MINSTACK\t/* Min. stack size. */\n#define LJ_STACK_MAX\tLUAI_MAXSTACK\t/* Max. stack size. */\n#define LJ_STACK_START\t(2*LJ_STACK_MIN)\t/* Starting stack size. */\n#define LJ_STACK_MAXEX\t(LJ_STACK_MAX + 1 + LJ_STACK_EXTRA)\n\n/* Explanation of LJ_STACK_EXTRA:\n**\n** Calls to metamethods store their arguments beyond the current top\n** without checking for the stack limit. This avoids stack resizes which\n** would invalidate passed TValue pointers. The stack check is performed\n** later by the function header. This can safely resize the stack or raise\n** an error. Thus we need some extra slots beyond the current stack limit.\n**\n** Most metamethods need 4 slots above top (cont, mobj, arg1, arg2) plus\n** one extra slot if mobj is not a function. Only lj_meta_tset needs 5\n** slots above top, but then mobj is always a function. So we can get by\n** with 5 extra slots.\n*/\n\n/* Resize stack slots and adjust pointers in state. */\nstatic void resizestack(lua_State *L, MSize n)\n{\n  TValue *st, *oldst = tvref(L->stack);\n  ptrdiff_t delta;\n  MSize oldsize = L->stacksize;\n  MSize realsize = n + 1 + LJ_STACK_EXTRA;\n  GCobj *up;\n  lua_assert((MSize)(tvref(L->maxstack)-oldst)==L->stacksize-LJ_STACK_EXTRA-1);\n  st = (TValue *)lj_mem_realloc(L, tvref(L->stack),\n\t\t\t\t(MSize)(L->stacksize*sizeof(TValue)),\n\t\t\t\t(MSize)(realsize*sizeof(TValue)));\n  setmref(L->stack, st);\n  delta = (char *)st - (char *)oldst;\n  setmref(L->maxstack, st + n);\n  while (oldsize < realsize)  /* Clear new slots. */\n    setnilV(st + oldsize++);\n  L->stacksize = realsize;\n  L->base = (TValue *)((char *)L->base + delta);\n  L->top = (TValue *)((char *)L->top + delta);\n  for (up = gcref(L->openupval); up != NULL; up = gcnext(up))\n    setmref(gco2uv(up)->v, (TValue *)((char *)uvval(gco2uv(up)) + delta));\n  if (obj2gco(L) == gcref(G(L)->jit_L))\n    setmref(G(L)->jit_base, mref(G(L)->jit_base, char) + delta);\n}\n\n/* Relimit stack after error, in case the limit was overdrawn. */\nvoid lj_state_relimitstack(lua_State *L)\n{\n  if (L->stacksize > LJ_STACK_MAXEX && L->top-tvref(L->stack) < LJ_STACK_MAX-1)\n    resizestack(L, LJ_STACK_MAX);\n}\n\n/* Try to shrink the stack (called from GC). */\nvoid lj_state_shrinkstack(lua_State *L, MSize used)\n{\n  if (L->stacksize > LJ_STACK_MAXEX)\n    return;  /* Avoid stack shrinking while handling stack overflow. */\n  if (4*used < L->stacksize &&\n      2*(LJ_STACK_START+LJ_STACK_EXTRA) < L->stacksize &&\n      obj2gco(L) != gcref(G(L)->jit_L))  /* Don't shrink stack of live trace. */\n    resizestack(L, L->stacksize >> 1);\n}\n\n/* Try to grow stack. */\nvoid LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need)\n{\n  MSize n;\n  if (L->stacksize > LJ_STACK_MAXEX)  /* Overflow while handling overflow? */\n    lj_err_throw(L, LUA_ERRERR);\n  n = L->stacksize + need;\n  if (n > LJ_STACK_MAX) {\n    n += 2*LUA_MINSTACK;\n  } else if (n < 2*L->stacksize) {\n    n = 2*L->stacksize;\n    if (n >= LJ_STACK_MAX)\n      n = LJ_STACK_MAX;\n  }\n  resizestack(L, n);\n  if (L->stacksize > LJ_STACK_MAXEX)\n    lj_err_msg(L, LJ_ERR_STKOV);\n}\n\nvoid LJ_FASTCALL lj_state_growstack1(lua_State *L)\n{\n  lj_state_growstack(L, 1);\n}\n\n/* Allocate basic stack for new state. */\nstatic void stack_init(lua_State *L1, lua_State *L)\n{\n  TValue *stend, *st = lj_mem_newvec(L, LJ_STACK_START+LJ_STACK_EXTRA, TValue);\n  setmref(L1->stack, st);\n  L1->stacksize = LJ_STACK_START + LJ_STACK_EXTRA;\n  stend = st + L1->stacksize;\n  setmref(L1->maxstack, stend - LJ_STACK_EXTRA - 1);\n  L1->base = L1->top = st+1;\n  setthreadV(L1, st, L1);  /* Needed for curr_funcisL() on empty stack. */\n  while (st < stend)  /* Clear new slots. */\n    setnilV(st++);\n}\n\n/* -- State handling ------------------------------------------------------ */\n\n/* Open parts that may cause memory-allocation errors. */\nstatic TValue *cpluaopen(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  global_State *g = G(L);\n  UNUSED(dummy);\n  UNUSED(ud);\n  stack_init(L, L);\n  /* NOBARRIER: State initialization, all objects are white. */\n  setgcref(L->env, obj2gco(lj_tab_new(L, 0, LJ_MIN_GLOBAL)));\n  settabV(L, registry(L), lj_tab_new(L, 0, LJ_MIN_REGISTRY));\n  lj_str_resize(L, LJ_MIN_STRTAB-1);\n  lj_meta_init(L);\n  lj_lex_init(L);\n  fixstring(lj_err_str(L, LJ_ERR_ERRMEM));  /* Preallocate memory error msg. */\n  g->gc.threshold = 4*g->gc.total;\n  lj_trace_initstate(g);\n  return NULL;\n}\n\nstatic void close_state(lua_State *L)\n{\n  global_State *g = G(L);\n  lj_func_closeuv(L, tvref(L->stack));\n  lj_gc_freeall(g);\n  lua_assert(gcref(g->gc.root) == obj2gco(L));\n  lua_assert(g->strnum == 0);\n  lj_trace_freestate(g);\n#if LJ_HASFFI\n  lj_ctype_freestate(g);\n#endif\n  lj_mem_freevec(g, g->strhash, g->strmask+1, GCRef);\n  lj_str_freebuf(g, &g->tmpbuf);\n  lj_mem_freevec(g, tvref(L->stack), L->stacksize, TValue);\n  lua_assert(g->gc.total == sizeof(GG_State));\n#ifndef LUAJIT_USE_SYSMALLOC\n  if (g->allocf == lj_alloc_f)\n    lj_alloc_destroy(g->allocd);\n  else\n#endif\n    g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0);\n}\n\n#if LJ_64\nlua_State *lj_state_newstate(lua_Alloc f, void *ud)\n#else\nLUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)\n#endif\n{\n  GG_State *GG = (GG_State *)f(ud, NULL, 0, sizeof(GG_State));\n  lua_State *L = &GG->L;\n  global_State *g = &GG->g;\n  if (GG == NULL || !checkptr32(GG)) return NULL;\n  memset(GG, 0, sizeof(GG_State));\n  L->gct = ~LJ_TTHREAD;\n  L->marked = LJ_GC_WHITE0 | LJ_GC_FIXED | LJ_GC_SFIXED;  /* Prevent free. */\n  L->dummy_ffid = FF_C;\n  setmref(L->glref, g);\n  g->gc.currentwhite = LJ_GC_WHITE0 | LJ_GC_FIXED;\n  g->strempty.marked = LJ_GC_WHITE0;\n  g->strempty.gct = ~LJ_TSTR;\n  g->allocf = f;\n  g->allocd = ud;\n  setgcref(g->mainthref, obj2gco(L));\n  setgcref(g->uvhead.prev, obj2gco(&g->uvhead));\n  setgcref(g->uvhead.next, obj2gco(&g->uvhead));\n  g->strmask = ~(MSize)0;\n  setnilV(registry(L));\n  setnilV(&g->nilnode.val);\n  setnilV(&g->nilnode.key);\n  setmref(g->nilnode.freetop, &g->nilnode);\n  lj_str_initbuf(&g->tmpbuf);\n  g->gc.state = GCSpause;\n  setgcref(g->gc.root, obj2gco(L));\n  setmref(g->gc.sweep, &g->gc.root);\n  g->gc.total = sizeof(GG_State);\n  g->gc.pause = LUAI_GCPAUSE;\n  g->gc.stepmul = LUAI_GCMUL;\n  lj_dispatch_init((GG_State *)L);\n  L->status = LUA_ERRERR+1;  /* Avoid touching the stack upon memory error. */\n  if (lj_vm_cpcall(L, NULL, NULL, cpluaopen) != 0) {\n    /* Memory allocation error: free partial state. */\n    close_state(L);\n    return NULL;\n  }\n  L->status = 0;\n  return L;\n}\n\nstatic TValue *cpfinalize(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  UNUSED(dummy);\n  UNUSED(ud);\n  lj_gc_finalize_cdata(L);\n  lj_gc_finalize_udata(L);\n  /* Frame pop omitted. */\n  return NULL;\n}\n\nLUA_API void lua_close(lua_State *L)\n{\n  global_State *g = G(L);\n  int i;\n  L = mainthread(g);  /* Only the main thread can be closed. */\n  lj_func_closeuv(L, tvref(L->stack));\n  lj_gc_separateudata(g, 1);  /* Separate udata which have GC metamethods. */\n#if LJ_HASJIT\n  G2J(g)->flags &= ~JIT_F_ON;\n  G2J(g)->state = LJ_TRACE_IDLE;\n  lj_dispatch_update(g);\n#endif\n  for (i = 0;;) {\n    hook_enter(g);\n    L->status = 0;\n    L->cframe = NULL;\n    L->base = L->top = tvref(L->stack) + 1;\n    if (lj_vm_cpcall(L, NULL, NULL, cpfinalize) == 0) {\n      if (++i >= 10) break;\n      lj_gc_separateudata(g, 1);  /* Separate udata again. */\n      if (gcref(g->gc.mmudata) == NULL)  /* Until nothing is left to do. */\n\tbreak;\n    }\n  }\n  close_state(L);\n}\n\nlua_State *lj_state_new(lua_State *L)\n{\n  lua_State *L1 = lj_mem_newobj(L, lua_State);\n  L1->gct = ~LJ_TTHREAD;\n  L1->dummy_ffid = FF_C;\n  L1->status = 0;\n  L1->stacksize = 0;\n  setmref(L1->stack, NULL);\n  L1->cframe = NULL;\n  /* NOBARRIER: The lua_State is new (marked white). */\n  setgcrefnull(L1->openupval);\n  setmrefr(L1->glref, L->glref);\n  setgcrefr(L1->env, L->env);\n  stack_init(L1, L);  /* init stack */\n  lua_assert(iswhite(obj2gco(L1)));\n  return L1;\n}\n\nvoid LJ_FASTCALL lj_state_free(global_State *g, lua_State *L)\n{\n  lua_assert(L != mainthread(g));\n  lj_func_closeuv(L, tvref(L->stack));\n  lua_assert(gcref(L->openupval) == NULL);\n  lj_mem_freevec(g, tvref(L->stack), L->stacksize, TValue);\n  lj_mem_freet(g, L);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_state.h",
    "content": "/*\n** State and stack handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_STATE_H\n#define _LJ_STATE_H\n\n#include \"lj_obj.h\"\n\n#define incr_top(L) \\\n  (++L->top >= tvref(L->maxstack) && (lj_state_growstack1(L), 0))\n\n#define savestack(L, p)\t\t((char *)(p) - mref(L->stack, char))\n#define restorestack(L, n)\t((TValue *)(mref(L->stack, char) + (n)))\n\nLJ_FUNC void lj_state_relimitstack(lua_State *L);\nLJ_FUNC void lj_state_shrinkstack(lua_State *L, MSize used);\nLJ_FUNCA void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need);\nLJ_FUNC void LJ_FASTCALL lj_state_growstack1(lua_State *L);\n\nstatic LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need)\n{\n  if ((mref(L->maxstack, char) - (char *)L->top) <=\n      (ptrdiff_t)need*(ptrdiff_t)sizeof(TValue))\n    lj_state_growstack(L, need);\n}\n\nLJ_FUNC lua_State *lj_state_new(lua_State *L);\nLJ_FUNC void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L);\n#if LJ_64\nLJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_str.c",
    "content": "/*\n** String handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#include <stdio.h>\n\n#define lj_str_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_str.h\"\n#include \"lj_state.h\"\n#include \"lj_char.h\"\n\n/* -- String interning ---------------------------------------------------- */\n\n/* Ordered compare of strings. Assumes string data is 4-byte aligned. */\nint32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b)\n{\n  MSize i, n = a->len > b->len ? b->len : a->len;\n  for (i = 0; i < n; i += 4) {\n    /* Note: innocuous access up to end of string + 3. */\n    uint32_t va = *(const uint32_t *)(strdata(a)+i);\n    uint32_t vb = *(const uint32_t *)(strdata(b)+i);\n    if (va != vb) {\n#if LJ_LE\n      va = lj_bswap(va); vb = lj_bswap(vb);\n#endif\n      i -= n;\n      if ((int32_t)i >= -3) {\n\tva >>= 32+(i<<3); vb >>= 32+(i<<3);\n\tif (va == vb) break;\n      }\n      return va < vb ? -1 : 1;\n    }\n  }\n  return (int32_t)(a->len - b->len);\n}\n\n/* Fast string data comparison. Caveat: unaligned access to 1st string! */\nstatic LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len)\n{\n  MSize i = 0;\n  lua_assert(len > 0);\n  lua_assert((((uintptr_t)a+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4);\n  do {  /* Note: innocuous access up to end of string + 3. */\n    uint32_t v = lj_getu32(a+i) ^ *(const uint32_t *)(b+i);\n    if (v) {\n      i -= len;\n#if LJ_LE\n      return (int32_t)i >= -3 ? (v << (32+(i<<3))) : 1;\n#else\n      return (int32_t)i >= -3 ? (v >> (32+(i<<3))) : 1;\n#endif\n    }\n    i += 4;\n  } while (i < len);\n  return 0;\n}\n\n/* Resize the string hash table (grow and shrink). */\nvoid lj_str_resize(lua_State *L, MSize newmask)\n{\n  global_State *g = G(L);\n  GCRef *newhash;\n  MSize i;\n  if (g->gc.state == GCSsweepstring || newmask >= LJ_MAX_STRTAB-1)\n    return;  /* No resizing during GC traversal or if already too big. */\n  newhash = lj_mem_newvec(L, newmask+1, GCRef);\n  memset(newhash, 0, (newmask+1)*sizeof(GCRef));\n  for (i = g->strmask; i != ~(MSize)0; i--) {  /* Rehash old table. */\n    GCobj *p = gcref(g->strhash[i]);\n    while (p) {  /* Follow each hash chain and reinsert all strings. */\n      MSize h = gco2str(p)->hash & newmask;\n      GCobj *next = gcnext(p);\n      /* NOBARRIER: The string table is a GC root. */\n      setgcrefr(p->gch.nextgc, newhash[h]);\n      setgcref(newhash[h], p);\n      p = next;\n    }\n  }\n  lj_mem_freevec(g, g->strhash, g->strmask+1, GCRef);\n  g->strmask = newmask;\n  g->strhash = newhash;\n}\n\n/* Intern a string and return string object. */\nGCstr *lj_str_new(lua_State *L, const char *str, size_t lenx)\n{\n  global_State *g;\n  GCstr *s;\n  GCobj *o;\n  MSize len = (MSize)lenx;\n  MSize a, b, h = len;\n  if (lenx >= LJ_MAX_STR)\n    lj_err_msg(L, LJ_ERR_STROV);\n  g = G(L);\n  /* Compute string hash. Constants taken from lookup3 hash by Bob Jenkins. */\n  if (len >= 4) {  /* Caveat: unaligned access! */\n    a = lj_getu32(str);\n    h ^= lj_getu32(str+len-4);\n    b = lj_getu32(str+(len>>1)-2);\n    h ^= b; h -= lj_rol(b, 14);\n    b += lj_getu32(str+(len>>2)-1);\n  } else if (len > 0) {\n    a = *(const uint8_t *)str;\n    h ^= *(const uint8_t *)(str+len-1);\n    b = *(const uint8_t *)(str+(len>>1));\n    h ^= b; h -= lj_rol(b, 14);\n  } else {\n    return &g->strempty;\n  }\n  a ^= h; a -= lj_rol(h, 11);\n  b ^= a; b -= lj_rol(a, 25);\n  h ^= b; h -= lj_rol(b, 16);\n  /* Check if the string has already been interned. */\n  o = gcref(g->strhash[h & g->strmask]);\n  if (LJ_LIKELY((((uintptr_t)str+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) {\n    while (o != NULL) {\n      GCstr *sx = gco2str(o);\n      if (sx->len == len && str_fastcmp(str, strdata(sx), len) == 0) {\n\t/* Resurrect if dead. Can only happen with fixstring() (keywords). */\n\tif (isdead(g, o)) flipwhite(o);\n\treturn sx;  /* Return existing string. */\n      }\n      o = gcnext(o);\n    }\n  } else {  /* Slow path: end of string is too close to a page boundary. */\n    while (o != NULL) {\n      GCstr *sx = gco2str(o);\n      if (sx->len == len && memcmp(str, strdata(sx), len) == 0) {\n\t/* Resurrect if dead. Can only happen with fixstring() (keywords). */\n\tif (isdead(g, o)) flipwhite(o);\n\treturn sx;  /* Return existing string. */\n      }\n      o = gcnext(o);\n    }\n  }\n  /* Nope, create a new string. */\n  s = lj_mem_newt(L, sizeof(GCstr)+len+1, GCstr);\n  newwhite(g, s);\n  s->gct = ~LJ_TSTR;\n  s->len = len;\n  s->hash = h;\n  s->reserved = 0;\n  memcpy(strdatawr(s), str, len);\n  strdatawr(s)[len] = '\\0';  /* Zero-terminate string. */\n  /* Add it to string hash table. */\n  h &= g->strmask;\n  s->nextgc = g->strhash[h];\n  /* NOBARRIER: The string table is a GC root. */\n  setgcref(g->strhash[h], obj2gco(s));\n  if (g->strnum++ > g->strmask)  /* Allow a 100% load factor. */\n    lj_str_resize(L, (g->strmask<<1)+1);  /* Grow string table. */\n  return s;  /* Return newly interned string. */\n}\n\nvoid LJ_FASTCALL lj_str_free(global_State *g, GCstr *s)\n{\n  g->strnum--;\n  lj_mem_free(g, s, sizestring(s));\n}\n\n/* -- Type conversions ---------------------------------------------------- */\n\n/* Print number to buffer. Canonicalizes non-finite values. */\nsize_t LJ_FASTCALL lj_str_bufnum(char *s, cTValue *o)\n{\n  if (LJ_LIKELY((o->u32.hi << 1) < 0xffe00000)) {  /* Finite? */\n    lua_Number n = o->n;\n#if __BIONIC__\n    if (tvismzero(o)) { s[0] = '-'; s[1] = '0'; return 2; }\n#endif\n    return (size_t)lua_number2str(s, n);\n  } else if (((o->u32.hi & 0x000fffff) | o->u32.lo) != 0) {\n    s[0] = 'n'; s[1] = 'a'; s[2] = 'n'; return 3;\n  } else if ((o->u32.hi & 0x80000000) == 0) {\n    s[0] = 'i'; s[1] = 'n'; s[2] = 'f'; return 3;\n  } else {\n    s[0] = '-'; s[1] = 'i'; s[2] = 'n'; s[3] = 'f'; return 4;\n  }\n}\n\n/* Print integer to buffer. Returns pointer to start. */\nchar * LJ_FASTCALL lj_str_bufint(char *p, int32_t k)\n{\n  uint32_t u = (uint32_t)(k < 0 ? -k : k);\n  p += 1+10;\n  do { *--p = (char)('0' + u % 10); } while (u /= 10);\n  if (k < 0) *--p = '-';\n  return p;\n}\n\n/* Convert number to string. */\nGCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np)\n{\n  char buf[LJ_STR_NUMBUF];\n  size_t len = lj_str_bufnum(buf, (TValue *)np);\n  return lj_str_new(L, buf, len);\n}\n\n/* Convert integer to string. */\nGCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k)\n{\n  char s[1+10];\n  char *p = lj_str_bufint(s, k);\n  return lj_str_new(L, p, (size_t)(s+sizeof(s)-p));\n}\n\nGCstr * LJ_FASTCALL lj_str_fromnumber(lua_State *L, cTValue *o)\n{\n  return tvisint(o) ? lj_str_fromint(L, intV(o)) : lj_str_fromnum(L, &o->n);\n}\n\n/* -- String formatting --------------------------------------------------- */\n\nstatic void addstr(lua_State *L, SBuf *sb, const char *str, MSize len)\n{\n  char *p;\n  MSize i;\n  if (sb->n + len > sb->sz) {\n    MSize sz = sb->sz * 2;\n    while (sb->n + len > sz) sz = sz * 2;\n    lj_str_resizebuf(L, sb, sz);\n  }\n  p = sb->buf + sb->n;\n  sb->n += len;\n  for (i = 0; i < len; i++) p[i] = str[i];\n}\n\nstatic void addchar(lua_State *L, SBuf *sb, int c)\n{\n  if (sb->n + 1 > sb->sz) {\n    MSize sz = sb->sz * 2;\n    lj_str_resizebuf(L, sb, sz);\n  }\n  sb->buf[sb->n++] = (char)c;\n}\n\n/* Push formatted message as a string object to Lua stack. va_list variant. */\nconst char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp)\n{\n  SBuf *sb = &G(L)->tmpbuf;\n  lj_str_needbuf(L, sb, (MSize)strlen(fmt));\n  lj_str_resetbuf(sb);\n  for (;;) {\n    const char *e = strchr(fmt, '%');\n    if (e == NULL) break;\n    addstr(L, sb, fmt, (MSize)(e-fmt));\n    /* This function only handles %s, %c, %d, %f and %p formats. */\n    switch (e[1]) {\n    case 's': {\n      const char *s = va_arg(argp, char *);\n      if (s == NULL) s = \"(null)\";\n      addstr(L, sb, s, (MSize)strlen(s));\n      break;\n      }\n    case 'c':\n      addchar(L, sb, va_arg(argp, int));\n      break;\n    case 'd': {\n      char buf[LJ_STR_INTBUF];\n      char *p = lj_str_bufint(buf, va_arg(argp, int32_t));\n      addstr(L, sb, p, (MSize)(buf+LJ_STR_INTBUF-p));\n      break;\n      }\n    case 'f': {\n      char buf[LJ_STR_NUMBUF];\n      TValue tv;\n      MSize len;\n      tv.n = (lua_Number)(va_arg(argp, LUAI_UACNUMBER));\n      len = (MSize)lj_str_bufnum(buf, &tv);\n      addstr(L, sb, buf, len);\n      break;\n      }\n    case 'p': {\n#define FMTP_CHARS\t(2*sizeof(ptrdiff_t))\n      char buf[2+FMTP_CHARS];\n      ptrdiff_t p = (ptrdiff_t)(va_arg(argp, void *));\n      ptrdiff_t i, lasti = 2+FMTP_CHARS;\n      if (p == 0) {\n\taddstr(L, sb, \"NULL\", 4);\n\tbreak;\n      }\n#if LJ_64\n      /* Shorten output for 64 bit pointers. */\n      lasti = 2+2*4+((p >> 32) ? 2+2*(lj_fls((uint32_t)(p >> 32))>>3) : 0);\n#endif\n      buf[0] = '0';\n      buf[1] = 'x';\n      for (i = lasti-1; i >= 2; i--, p >>= 4)\n\tbuf[i] = \"0123456789abcdef\"[(p & 15)];\n      addstr(L, sb, buf, (MSize)lasti);\n      break;\n      }\n    case '%':\n      addchar(L, sb, '%');\n      break;\n    default:\n      addchar(L, sb, '%');\n      addchar(L, sb, e[1]);\n      break;\n    }\n    fmt = e+2;\n  }\n  addstr(L, sb, fmt, (MSize)strlen(fmt));\n  setstrV(L, L->top, lj_str_new(L, sb->buf, sb->n));\n  incr_top(L);\n  return strVdata(L->top - 1);\n}\n\n/* Push formatted message as a string object to Lua stack. Vararg variant. */\nconst char *lj_str_pushf(lua_State *L, const char *fmt, ...)\n{\n  const char *msg;\n  va_list argp;\n  va_start(argp, fmt);\n  msg = lj_str_pushvf(L, fmt, argp);\n  va_end(argp);\n  return msg;\n}\n\n/* -- Buffer handling ----------------------------------------------------- */\n\nchar *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz)\n{\n  if (sz > sb->sz) {\n    if (sz < LJ_MIN_SBUF) sz = LJ_MIN_SBUF;\n    lj_str_resizebuf(L, sb, sz);\n  }\n  return sb->buf;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_str.h",
    "content": "/*\n** String handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_STR_H\n#define _LJ_STR_H\n\n#include <stdarg.h>\n\n#include \"lj_obj.h\"\n\n/* String interning. */\nLJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b);\nLJ_FUNC void lj_str_resize(lua_State *L, MSize newmask);\nLJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len);\nLJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s);\n\n#define lj_str_newz(L, s)\t(lj_str_new(L, s, strlen(s)))\n#define lj_str_newlit(L, s)\t(lj_str_new(L, \"\" s, sizeof(s)-1))\n\n/* Type conversions. */\nLJ_FUNC size_t LJ_FASTCALL lj_str_bufnum(char *s, cTValue *o);\nLJ_FUNC char * LJ_FASTCALL lj_str_bufint(char *p, int32_t k);\nLJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np);\nLJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k);\nLJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnumber(lua_State *L, cTValue *o);\n\n#define LJ_STR_INTBUF\t\t(1+10)\n#define LJ_STR_NUMBUF\t\tLUAI_MAXNUMBER2STR\n\n/* String formatting. */\nLJ_FUNC const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp);\nLJ_FUNC const char *lj_str_pushf(lua_State *L, const char *fmt, ...)\n#if defined(__GNUC__)\n  __attribute__ ((format (printf, 2, 3)))\n#endif\n  ;\n\n/* Resizable string buffers. Struct definition in lj_obj.h. */\nLJ_FUNC char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz);\n\n#define lj_str_initbuf(sb)\t((sb)->buf = NULL, (sb)->sz = 0)\n#define lj_str_resetbuf(sb)\t((sb)->n = 0)\n#define lj_str_resizebuf(L, sb, size) \\\n  ((sb)->buf = (char *)lj_mem_realloc(L, (sb)->buf, (sb)->sz, (size)), \\\n   (sb)->sz = (size))\n#define lj_str_freebuf(g, sb)\tlj_mem_free(g, (void *)(sb)->buf, (sb)->sz)\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_strscan.c",
    "content": "/*\n** String scanning.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include <math.h>\n\n#define lj_strscan_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_char.h\"\n#include \"lj_strscan.h\"\n\n/* -- Scanning numbers ---------------------------------------------------- */\n\n/*\n** Rationale for the builtin string to number conversion library:\n**\n** It removes a dependency on libc's strtod(), which is a true portability\n** nightmare. Mainly due to the plethora of supported OS and toolchain\n** combinations. Sadly, the various implementations\n** a) are often buggy, incomplete (no hex floats) and/or imprecise,\n** b) sometimes crash or hang on certain inputs,\n** c) return non-standard NaNs that need to be filtered out, and\n** d) fail if the locale-specific decimal separator is not a dot,\n**    which can only be fixed with atrocious workarounds.\n**\n** Also, most of the strtod() implementations are hopelessly bloated,\n** which is not just an I-cache hog, but a problem for static linkage\n** on embedded systems, too.\n**\n** OTOH the builtin conversion function is very compact. Even though it\n** does a lot more, like parsing long longs, octal or imaginary numbers\n** and returning the result in different formats:\n** a) It needs less than 3 KB (!) of machine code (on x64 with -Os),\n** b) it doesn't perform any dynamic allocation and,\n** c) it needs only around 600 bytes of stack space.\n**\n** The builtin function is faster than strtod() for typical inputs, e.g.\n** \"123\", \"1.5\" or \"1e6\". Arguably, it's slower for very large exponents,\n** which are not very common (this could be fixed, if needed).\n**\n** And most importantly, the builtin function is equally precise on all\n** platforms. It correctly converts and rounds any input to a double.\n** If this is not the case, please send a bug report -- but PLEASE verify\n** that the implementation you're comparing to is not the culprit!\n**\n** The implementation quickly pre-scans the entire string first and\n** handles simple integers on-the-fly. Otherwise, it dispatches to the\n** base-specific parser. Hex and octal is straightforward.\n**\n** Decimal to binary conversion uses a fixed-length circular buffer in\n** base 100. Some simple cases are handled directly. For other cases, the\n** number in the buffer is up-scaled or down-scaled until the integer part\n** is in the proper range. Then the integer part is rounded and converted\n** to a double which is finally rescaled to the result. Denormals need\n** special treatment to prevent incorrect 'double rounding'.\n*/\n\n/* Definitions for circular decimal digit buffer (base 100 = 2 digits/byte). */\n#define STRSCAN_DIG\t1024\n#define STRSCAN_MAXDIG\t800\t\t/* 772 + extra are sufficient. */\n#define STRSCAN_DDIG\t(STRSCAN_DIG/2)\n#define STRSCAN_DMASK\t(STRSCAN_DDIG-1)\n\n/* Helpers for circular buffer. */\n#define DNEXT(a)\t(((a)+1) & STRSCAN_DMASK)\n#define DPREV(a)\t(((a)-1) & STRSCAN_DMASK)\n#define DLEN(lo, hi)\t((int32_t)(((lo)-(hi)) & STRSCAN_DMASK))\n\n#define casecmp(c, k)\t(((c) | 0x20) == k)\n\n/* Final conversion to double. */\nstatic void strscan_double(uint64_t x, TValue *o, int32_t ex2, int32_t neg)\n{\n  double n;\n\n  /* Avoid double rounding for denormals. */\n  if (LJ_UNLIKELY(ex2 <= -1075 && x != 0)) {\n    /* NYI: all of this generates way too much code on 32 bit CPUs. */\n#if defined(__GNUC__) && LJ_64\n    int32_t b = (int32_t)(__builtin_clzll(x)^63);\n#else\n    int32_t b = (x>>32) ? 32+(int32_t)lj_fls((uint32_t)(x>>32)) :\n\t\t\t  (int32_t)lj_fls((uint32_t)x);\n#endif\n    if ((int32_t)b + ex2 <= -1023 && (int32_t)b + ex2 >= -1075) {\n      uint64_t rb = (uint64_t)1 << (-1075-ex2);\n      if ((x & rb) && ((x & (rb+rb+rb-1)))) x += rb+rb;\n      x = (x & ~(rb+rb-1));\n    }\n  }\n\n  /* Convert to double using a signed int64_t conversion, then rescale. */\n  lua_assert((int64_t)x >= 0);\n  n = (double)(int64_t)x;\n  if (neg) n = -n;\n  if (ex2) n = ldexp(n, ex2);\n  o->n = n;\n}\n\n/* Parse hexadecimal number. */\nstatic StrScanFmt strscan_hex(const uint8_t *p, TValue *o,\n\t\t\t      StrScanFmt fmt, uint32_t opt,\n\t\t\t      int32_t ex2, int32_t neg, uint32_t dig)\n{\n  uint64_t x = 0;\n  uint32_t i;\n\n  /* Scan hex digits. */\n  for (i = dig > 16 ? 16 : dig ; i; i--, p++) {\n    uint32_t d = (*p != '.' ? *p : *++p); if (d > '9') d += 9;\n    x = (x << 4) + (d & 15);\n  }\n\n  /* Summarize rounding-effect of excess digits. */\n  for (i = 16; i < dig; i++, p++)\n    x |= ((*p != '.' ? *p : *++p) != '0'), ex2 += 4;\n\n  /* Format-specific handling. */\n  switch (fmt) {\n  case STRSCAN_INT:\n    if (!(opt & STRSCAN_OPT_TONUM) && x < 0x80000000u+neg) {\n      o->i = neg ? -(int32_t)x : (int32_t)x;\n      return STRSCAN_INT;  /* Fast path for 32 bit integers. */\n    }\n    if (!(opt & STRSCAN_OPT_C)) { fmt = STRSCAN_NUM; break; }\n    /* fallthrough */\n  case STRSCAN_U32:\n    if (dig > 8) return STRSCAN_ERROR;\n    o->i = neg ? -(int32_t)x : (int32_t)x;\n    return STRSCAN_U32;\n  case STRSCAN_I64:\n  case STRSCAN_U64:\n    if (dig > 16) return STRSCAN_ERROR;\n    o->u64 = neg ? (uint64_t)-(int64_t)x : x;\n    return fmt;\n  default:\n    break;\n  }\n\n  /* Reduce range then convert to double. */\n  if ((x & U64x(c0000000,0000000))) { x = (x >> 2) | (x & 3); ex2 += 2; }\n  strscan_double(x, o, ex2, neg);\n  return fmt;\n}\n\n/* Parse octal number. */\nstatic StrScanFmt strscan_oct(const uint8_t *p, TValue *o,\n\t\t\t      StrScanFmt fmt, int32_t neg, uint32_t dig)\n{\n  uint64_t x = 0;\n\n  /* Scan octal digits. */\n  if (dig > 22 || (dig == 22 && *p > '1')) return STRSCAN_ERROR;\n  while (dig-- > 0) {\n    if (!(*p >= '0' && *p <= '7')) return STRSCAN_ERROR;\n    x = (x << 3) + (*p++ & 7);\n  }\n\n  /* Format-specific handling. */\n  switch (fmt) {\n  case STRSCAN_INT:\n    if (x >= 0x80000000u+neg) fmt = STRSCAN_U32;\n    /* fallthrough */\n  case STRSCAN_U32:\n    if ((x >> 32)) return STRSCAN_ERROR;\n    o->i = neg ? -(int32_t)x : (int32_t)x;\n    break;\n  default:\n  case STRSCAN_I64:\n  case STRSCAN_U64:\n    o->u64 = neg ? (uint64_t)-(int64_t)x : x;\n    break;\n  }\n  return fmt;\n}\n\n/* Parse decimal number. */\nstatic StrScanFmt strscan_dec(const uint8_t *p, TValue *o,\n\t\t\t      StrScanFmt fmt, uint32_t opt,\n\t\t\t      int32_t ex10, int32_t neg, uint32_t dig)\n{\n  uint8_t xi[STRSCAN_DDIG], *xip = xi;\n\n  if (dig) {\n    uint32_t i = dig;\n    if (i > STRSCAN_MAXDIG) {\n      ex10 -= (int32_t)(i - STRSCAN_MAXDIG);\n      i = STRSCAN_MAXDIG;\n    }\n    /* Scan unaligned leading digit. */\n    if (((ex10^i) & 1))\n      *xip++ = ((*p != '.' ? *p : *++p) & 15), i--, p++;\n    /* Scan aligned double-digits. */\n    for ( ; i > 1; i -= 2) {\n      uint32_t d = 10 * ((*p != '.' ? *p : *++p) & 15); p++;\n      *xip++ = d + ((*p != '.' ? *p : *++p) & 15); p++;\n    }\n    /* Scan and realign trailing digit. */\n    if (i) *xip++ = 10 * ((*p != '.' ? *p : *++p) & 15), ex10--, p++;\n\n    /* Summarize rounding-effect of excess digits. */\n    if (dig > STRSCAN_MAXDIG) {\n      do {\n\tif ((*p != '.' ? *p : *++p) != '0') { xip[-1] |= 1; break; }\n\tp++;\n      } while (--dig > STRSCAN_MAXDIG);\n      dig = STRSCAN_MAXDIG;\n    } else {  /* Simplify exponent. */\n      while (ex10 > 0 && dig <= 18) *xip++ = 0, ex10 -= 2, dig += 2;\n    }\n  } else {  /* Only got zeros. */\n    ex10 = 0;\n    xi[0] = 0;\n  }\n\n  /* Fast path for numbers in integer format (but handles e.g. 1e6, too). */\n  if (dig <= 20 && ex10 == 0) {\n    uint8_t *xis;\n    uint64_t x = xi[0];\n    double n;\n    for (xis = xi+1; xis < xip; xis++) x = x * 100 + *xis;\n    if (!(dig == 20 && (xi[0] > 18 || (int64_t)x >= 0))) {  /* No overflow? */\n      /* Format-specific handling. */\n      switch (fmt) {\n      case STRSCAN_INT:\n\tif (!(opt & STRSCAN_OPT_TONUM) && x < 0x80000000u+neg) {\n\t  o->i = neg ? -(int32_t)x : (int32_t)x;\n\t  return STRSCAN_INT;  /* Fast path for 32 bit integers. */\n\t}\n\tif (!(opt & STRSCAN_OPT_C)) { fmt = STRSCAN_NUM; goto plainnumber; }\n\t/* fallthrough */\n      case STRSCAN_U32:\n\tif ((x >> 32) != 0) return STRSCAN_ERROR;\n\to->i = neg ? -(int32_t)x : (int32_t)x;\n\treturn STRSCAN_U32;\n      case STRSCAN_I64:\n      case STRSCAN_U64:\n\to->u64 = neg ? (uint64_t)-(int64_t)x : x;\n\treturn fmt;\n      default:\n      plainnumber:  /* Fast path for plain numbers < 2^63. */\n\tif ((int64_t)x < 0) break;\n\tn = (double)(int64_t)x;\n\tif (neg) n = -n;\n\to->n = n;\n\treturn fmt;\n      }\n    }\n  }\n\n  /* Slow non-integer path. */\n  if (fmt == STRSCAN_INT) {\n    if ((opt & STRSCAN_OPT_C)) return STRSCAN_ERROR;\n    fmt = STRSCAN_NUM;\n  } else if (fmt > STRSCAN_INT) {\n    return STRSCAN_ERROR;\n  }\n  {\n    uint32_t hi = 0, lo = (uint32_t)(xip-xi);\n    int32_t ex2 = 0, idig = (int32_t)lo + (ex10 >> 1);\n\n    lua_assert(lo > 0 && (ex10 & 1) == 0);\n\n    /* Handle simple overflow/underflow. */\n    if (idig > 310/2) { if (neg) setminfV(o); else setpinfV(o); return fmt; }\n    else if (idig < -326/2) { o->n = neg ? -0.0 : 0.0; return fmt; }\n\n    /* Scale up until we have at least 17 or 18 integer part digits. */\n    while (idig < 9 && idig < DLEN(lo, hi)) {\n      uint32_t i, cy = 0;\n      ex2 -= 6;\n      for (i = DPREV(lo); ; i = DPREV(i)) {\n\tuint32_t d = (xi[i] << 6) + cy;\n\tcy = (((d >> 2) * 5243) >> 17); d = d - cy * 100;  /* Div/mod 100. */\n\txi[i] = (uint8_t)d;\n\tif (i == hi) break;\n\tif (d == 0 && i == DPREV(lo)) lo = i;\n      }\n      if (cy) {\n\tif (xi[DPREV(lo)] == 0) lo = DPREV(lo);\n\telse if (hi == lo) { lo = DPREV(lo); xi[DPREV(lo)] |= xi[lo]; }\n\thi = DPREV(hi); xi[hi] = (uint8_t)cy; idig++;\n      }\n    }\n\n    /* Scale down until no more than 17 or 18 integer part digits remain. */\n    while (idig > 9) {\n      uint32_t i, cy = 0;\n      ex2 += 6;\n      for (i = hi; i != lo; i = DNEXT(i)) {\n\tcy += xi[i];\n\txi[i] = (cy >> 6);\n\tcy = 100 * (cy & 0x3f);\n\tif (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--;\n      }\n      while (cy) {\n\tif (hi == lo) { xi[DPREV(lo)] |= 1; break; }\n\txi[lo] = (cy >> 6); lo = DNEXT(lo);\n\tcy = 100 * (cy & 0x3f);\n      }\n    }\n\n    /* Collect integer part digits and convert to rescaled double. */\n    {\n      uint64_t x = xi[hi];\n      uint32_t i;\n      for (i = DNEXT(hi); --idig > 0 && i != lo; i = DNEXT(i))\n\tx = x * 100 + xi[i];\n      if (i == lo) {\n\twhile (--idig >= 0) x = x * 100;\n      } else {  /* Gather round bit from remaining digits. */\n\tx <<= 1; ex2--;\n\tdo {\n\t  if (xi[i]) { x |= 1; break; }\n\t  i = DNEXT(i);\n\t} while (i != lo);\n      }\n      strscan_double(x, o, ex2, neg);\n    }\n  }\n  return fmt;\n}\n\n/* Scan string containing a number. Returns format. Returns value in o. */\nStrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt)\n{\n  int32_t neg = 0;\n\n  /* Remove leading space, parse sign and non-numbers. */\n  if (LJ_UNLIKELY(!lj_char_isdigit(*p))) {\n    while (lj_char_isspace(*p)) p++;\n    if (*p == '+' || *p == '-') neg = (*p++ == '-');\n    if (LJ_UNLIKELY(*p >= 'A')) {  /* Parse \"inf\", \"infinity\" or \"nan\". */\n      TValue tmp;\n      setnanV(&tmp);\n      if (casecmp(p[0],'i') && casecmp(p[1],'n') && casecmp(p[2],'f')) {\n\tif (neg) setminfV(&tmp); else setpinfV(&tmp);\n\tp += 3;\n\tif (casecmp(p[0],'i') && casecmp(p[1],'n') && casecmp(p[2],'i') &&\n\t    casecmp(p[3],'t') && casecmp(p[4],'y')) p += 5;\n      } else if (casecmp(p[0],'n') && casecmp(p[1],'a') && casecmp(p[2],'n')) {\n\tp += 3;\n      }\n      while (lj_char_isspace(*p)) p++;\n      if (*p) return STRSCAN_ERROR;\n      o->u64 = tmp.u64;\n      return STRSCAN_NUM;\n    }\n  }\n\n  /* Parse regular number. */\n  {\n    StrScanFmt fmt = STRSCAN_INT;\n    int cmask = LJ_CHAR_DIGIT;\n    int base = (opt & STRSCAN_OPT_C) && *p == '0' ? 0 : 10;\n    const uint8_t *sp, *dp = NULL;\n    uint32_t dig = 0, hasdig = 0, x = 0;\n    int32_t ex = 0;\n\n    /* Determine base and skip leading zeros. */\n    if (LJ_UNLIKELY(*p <= '0')) {\n      if (*p == '0' && casecmp(p[1], 'x'))\n\tbase = 16, cmask = LJ_CHAR_XDIGIT, p += 2;\n      for ( ; ; p++) {\n\tif (*p == '0') {\n\t  hasdig = 1;\n\t} else if (*p == '.') {\n\t  if (dp) return STRSCAN_ERROR;\n\t  dp = p;\n\t} else {\n\t  break;\n\t}\n      }\n    }\n\n    /* Preliminary digit and decimal point scan. */\n    for (sp = p; ; p++) {\n      if (LJ_LIKELY(lj_char_isa(*p, cmask))) {\n\tx = x * 10 + (*p & 15);  /* For fast path below. */\n\tdig++;\n      } else if (*p == '.') {\n\tif (dp) return STRSCAN_ERROR;\n\tdp = p;\n      } else {\n\tbreak;\n      }\n    }\n    if (!(hasdig | dig)) return STRSCAN_ERROR;\n\n    /* Handle decimal point. */\n    if (dp) {\n      fmt = STRSCAN_NUM;\n      if (dig) {\n\tex = (int32_t)(dp-(p-1)); dp = p-1;\n\twhile (ex < 0 && *dp-- == '0') ex++, dig--;  /* Skip trailing zeros. */\n\tif (base == 16) ex *= 4;\n      }\n    }\n\n    /* Parse exponent. */\n    if (casecmp(*p, (uint32_t)(base == 16 ? 'p' : 'e'))) {\n      uint32_t xx;\n      int negx = 0;\n      fmt = STRSCAN_NUM; p++;\n      if (*p == '+' || *p == '-') negx = (*p++ == '-');\n      if (!lj_char_isdigit(*p)) return STRSCAN_ERROR;\n      xx = (*p++ & 15);\n      while (lj_char_isdigit(*p)) {\n\tif (xx < 65536) xx = xx * 10 + (*p & 15);\n\tp++;\n      }\n      ex += negx ? -(int32_t)xx : (int32_t)xx;\n    }\n\n    /* Parse suffix. */\n    if (*p) {\n      /* I (IMAG), U (U32), LL (I64), ULL/LLU (U64), L (long), UL/LU (ulong). */\n      /* NYI: f (float). Not needed until cp_number() handles non-integers. */\n      if (casecmp(*p, 'i')) {\n\tif (!(opt & STRSCAN_OPT_IMAG)) return STRSCAN_ERROR;\n\tp++; fmt = STRSCAN_IMAG;\n      } else if (fmt == STRSCAN_INT) {\n\tif (casecmp(*p, 'u')) p++, fmt = STRSCAN_U32;\n\tif (casecmp(*p, 'l')) {\n\t  p++;\n\t  if (casecmp(*p, 'l')) p++, fmt += STRSCAN_I64 - STRSCAN_INT;\n\t  else if (!(opt & STRSCAN_OPT_C)) return STRSCAN_ERROR;\n\t  else if (sizeof(long) == 8) fmt += STRSCAN_I64 - STRSCAN_INT;\n\t}\n\tif (casecmp(*p, 'u') && (fmt == STRSCAN_INT || fmt == STRSCAN_I64))\n\t  p++, fmt += STRSCAN_U32 - STRSCAN_INT;\n\tif ((fmt == STRSCAN_U32 && !(opt & STRSCAN_OPT_C)) ||\n\t    (fmt >= STRSCAN_I64 && !(opt & STRSCAN_OPT_LL)))\n\t  return STRSCAN_ERROR;\n      }\n      while (lj_char_isspace(*p)) p++;\n      if (*p) return STRSCAN_ERROR;\n    }\n\n    /* Fast path for decimal 32 bit integers. */\n    if (fmt == STRSCAN_INT && base == 10 &&\n\t(dig < 10 || (dig == 10 && *sp <= '2' && x < 0x80000000u+neg))) {\n      int32_t y = neg ? -(int32_t)x : (int32_t)x;\n      if ((opt & STRSCAN_OPT_TONUM)) {\n\to->n = (double)y;\n\treturn STRSCAN_NUM;\n      } else {\n\to->i = y;\n\treturn STRSCAN_INT;\n      }\n    }\n\n    /* Dispatch to base-specific parser. */\n    if (base == 0 && !(fmt == STRSCAN_NUM || fmt == STRSCAN_IMAG))\n      return strscan_oct(sp, o, fmt, neg, dig);\n    if (base == 16)\n      fmt = strscan_hex(sp, o, fmt, opt, ex, neg, dig);\n    else\n      fmt = strscan_dec(sp, o, fmt, opt, ex, neg, dig);\n\n    /* Try to convert number to integer, if requested. */\n    if (fmt == STRSCAN_NUM && (opt & STRSCAN_OPT_TOINT)) {\n      double n = o->n;\n      int32_t i = lj_num2int(n);\n      if (n == (lua_Number)i) { o->i = i; return STRSCAN_INT; }\n    }\n    return fmt;\n  }\n}\n\nint LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o)\n{\n  StrScanFmt fmt = lj_strscan_scan((const uint8_t *)strdata(str), o,\n\t\t\t\t   STRSCAN_OPT_TONUM);\n  lua_assert(fmt == STRSCAN_ERROR || fmt == STRSCAN_NUM);\n  return (fmt != STRSCAN_ERROR);\n}\n\n#if LJ_DUALNUM\nint LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o)\n{\n  StrScanFmt fmt = lj_strscan_scan((const uint8_t *)strdata(str), o,\n\t\t\t\t   STRSCAN_OPT_TOINT);\n  lua_assert(fmt == STRSCAN_ERROR || fmt == STRSCAN_NUM || fmt == STRSCAN_INT);\n  if (fmt == STRSCAN_INT) setitype(o, LJ_TISNUM);\n  return (fmt != STRSCAN_ERROR);\n}\n#endif\n\n#undef DNEXT\n#undef DPREV\n#undef DLEN\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_strscan.h",
    "content": "/*\n** String scanning.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_STRSCAN_H\n#define _LJ_STRSCAN_H\n\n#include \"lj_obj.h\"\n\n/* Options for accepted/returned formats. */\n#define STRSCAN_OPT_TOINT\t0x01  /* Convert to int32_t, if possible. */\n#define STRSCAN_OPT_TONUM\t0x02  /* Always convert to double. */\n#define STRSCAN_OPT_IMAG\t0x04\n#define STRSCAN_OPT_LL\t\t0x08\n#define STRSCAN_OPT_C\t\t0x10\n\n/* Returned format. */\ntypedef enum {\n  STRSCAN_ERROR,\n  STRSCAN_NUM, STRSCAN_IMAG,\n  STRSCAN_INT, STRSCAN_U32, STRSCAN_I64, STRSCAN_U64,\n} StrScanFmt;\n\nLJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt);\nLJ_FUNC int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o);\n#if LJ_DUALNUM\nLJ_FUNC int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o);\n#else\n#define lj_strscan_number(s, o)\t\tlj_strscan_num((s), (o))\n#endif\n\n/* Check for number or convert string to number/int in-place (!). */\nstatic LJ_AINLINE int lj_strscan_numberobj(TValue *o)\n{\n  return tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), o));\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_tab.c",
    "content": "/*\n** Table handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#define lj_tab_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_tab.h\"\n\n/* -- Object hashing ------------------------------------------------------ */\n\n/* Hash values are masked with the table hash mask and used as an index. */\nstatic LJ_AINLINE Node *hashmask(const GCtab *t, uint32_t hash)\n{\n  Node *n = noderef(t->node);\n  return &n[hash & t->hmask];\n}\n\n/* String hashes are precomputed when they are interned. */\n#define hashstr(t, s)\t\thashmask(t, (s)->hash)\n\n#define hashlohi(t, lo, hi)\thashmask((t), hashrot((lo), (hi)))\n#define hashnum(t, o)\t\thashlohi((t), (o)->u32.lo, ((o)->u32.hi << 1))\n#define hashptr(t, p)\t\thashlohi((t), u32ptr(p), u32ptr(p) + HASH_BIAS)\n#define hashgcref(t, r)\t\thashlohi((t), gcrefu(r), gcrefu(r) + HASH_BIAS)\n\n/* Hash an arbitrary key and return its anchor position in the hash table. */\nstatic Node *hashkey(const GCtab *t, cTValue *key)\n{\n  lua_assert(!tvisint(key));\n  if (tvisstr(key))\n    return hashstr(t, strV(key));\n  else if (tvisnum(key))\n    return hashnum(t, key);\n  else if (tvisbool(key))\n    return hashmask(t, boolV(key));\n  else\n    return hashgcref(t, key->gcr);\n  /* Only hash 32 bits of lightuserdata on a 64 bit CPU. Good enough? */\n}\n\n/* -- Table creation and destruction -------------------------------------- */\n\n/* Create new hash part for table. */\nstatic LJ_AINLINE void newhpart(lua_State *L, GCtab *t, uint32_t hbits)\n{\n  uint32_t hsize;\n  Node *node;\n  lua_assert(hbits != 0);\n  if (hbits > LJ_MAX_HBITS)\n    lj_err_msg(L, LJ_ERR_TABOV);\n  hsize = 1u << hbits;\n  node = lj_mem_newvec(L, hsize, Node);\n  setmref(node->freetop, &node[hsize]);\n  setmref(t->node, node);\n  t->hmask = hsize-1;\n}\n\n/*\n** Q: Why all of these copies of t->hmask, t->node etc. to local variables?\n** A: Because alias analysis for C is _really_ tough.\n**    Even state-of-the-art C compilers won't produce good code without this.\n*/\n\n/* Clear hash part of table. */\nstatic LJ_AINLINE void clearhpart(GCtab *t)\n{\n  uint32_t i, hmask = t->hmask;\n  Node *node = noderef(t->node);\n  lua_assert(t->hmask != 0);\n  for (i = 0; i <= hmask; i++) {\n    Node *n = &node[i];\n    setmref(n->next, NULL);\n    setnilV(&n->key);\n    setnilV(&n->val);\n  }\n}\n\n/* Clear array part of table. */\nstatic LJ_AINLINE void clearapart(GCtab *t)\n{\n  uint32_t i, asize = t->asize;\n  TValue *array = tvref(t->array);\n  for (i = 0; i < asize; i++)\n    setnilV(&array[i]);\n}\n\n/* Create a new table. Note: the slots are not initialized (yet). */\nstatic GCtab *newtab(lua_State *L, uint32_t asize, uint32_t hbits)\n{\n  GCtab *t;\n  /* First try to colocate the array part. */\n  if (LJ_MAX_COLOSIZE != 0 && asize > 0 && asize <= LJ_MAX_COLOSIZE) {\n    lua_assert((sizeof(GCtab) & 7) == 0);\n    t = (GCtab *)lj_mem_newgco(L, sizetabcolo(asize));\n    t->gct = ~LJ_TTAB;\n    t->nomm = (uint8_t)~0;\n    t->colo = (int8_t)asize;\n    setmref(t->array, (TValue *)((char *)t + sizeof(GCtab)));\n    setgcrefnull(t->metatable);\n    t->asize = asize;\n    t->hmask = 0;\n    setmref(t->node, &G(L)->nilnode);\n  } else {  /* Otherwise separately allocate the array part. */\n    t = lj_mem_newobj(L, GCtab);\n    t->gct = ~LJ_TTAB;\n    t->nomm = (uint8_t)~0;\n    t->colo = 0;\n    setmref(t->array, NULL);\n    setgcrefnull(t->metatable);\n    t->asize = 0;  /* In case the array allocation fails. */\n    t->hmask = 0;\n    setmref(t->node, &G(L)->nilnode);\n    if (asize > 0) {\n      if (asize > LJ_MAX_ASIZE)\n\tlj_err_msg(L, LJ_ERR_TABOV);\n      setmref(t->array, lj_mem_newvec(L, asize, TValue));\n      t->asize = asize;\n    }\n  }\n  if (hbits)\n    newhpart(L, t, hbits);\n  return t;\n}\n\n/* Create a new table.\n**\n** IMPORTANT NOTE: The API differs from lua_createtable()!\n**\n** The array size is non-inclusive. E.g. asize=128 creates array slots\n** for 0..127, but not for 128. If you need slots 1..128, pass asize=129\n** (slot 0 is wasted in this case).\n**\n** The hash size is given in hash bits. hbits=0 means no hash part.\n** hbits=1 creates 2 hash slots, hbits=2 creates 4 hash slots and so on.\n*/\nGCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits)\n{\n  GCtab *t = newtab(L, asize, hbits);\n  clearapart(t);\n  if (t->hmask > 0) clearhpart(t);\n  return t;\n}\n\n#if LJ_HASJIT\nGCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize)\n{\n  GCtab *t = newtab(L, ahsize & 0xffffff, ahsize >> 24);\n  clearapart(t);\n  if (t->hmask > 0) clearhpart(t);\n  return t;\n}\n#endif\n\n/* Duplicate a table. */\nGCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt)\n{\n  GCtab *t;\n  uint32_t asize, hmask;\n  t = newtab(L, kt->asize, kt->hmask > 0 ? lj_fls(kt->hmask)+1 : 0);\n  lua_assert(kt->asize == t->asize && kt->hmask == t->hmask);\n  t->nomm = 0;  /* Keys with metamethod names may be present. */\n  asize = kt->asize;\n  if (asize > 0) {\n    TValue *array = tvref(t->array);\n    TValue *karray = tvref(kt->array);\n    if (asize < 64) {  /* An inlined loop beats memcpy for < 512 bytes. */\n      uint32_t i;\n      for (i = 0; i < asize; i++)\n\tcopyTV(L, &array[i], &karray[i]);\n    } else {\n      memcpy(array, karray, asize*sizeof(TValue));\n    }\n  }\n  hmask = kt->hmask;\n  if (hmask > 0) {\n    uint32_t i;\n    Node *node = noderef(t->node);\n    Node *knode = noderef(kt->node);\n    ptrdiff_t d = (char *)node - (char *)knode;\n    setmref(node->freetop, (Node *)((char *)noderef(knode->freetop) + d));\n    for (i = 0; i <= hmask; i++) {\n      Node *kn = &knode[i];\n      Node *n = &node[i];\n      Node *next = nextnode(kn);\n      /* Don't use copyTV here, since it asserts on a copy of a dead key. */\n      n->val = kn->val; n->key = kn->key;\n      setmref(n->next, next == NULL? next : (Node *)((char *)next + d));\n    }\n  }\n  return t;\n}\n\n/* Free a table. */\nvoid LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t)\n{\n  if (t->hmask > 0)\n    lj_mem_freevec(g, noderef(t->node), t->hmask+1, Node);\n  if (t->asize > 0 && LJ_MAX_COLOSIZE != 0 && t->colo <= 0)\n    lj_mem_freevec(g, tvref(t->array), t->asize, TValue);\n  if (LJ_MAX_COLOSIZE != 0 && t->colo)\n    lj_mem_free(g, t, sizetabcolo((uint32_t)t->colo & 0x7f));\n  else\n    lj_mem_freet(g, t);\n}\n\n/* -- Table resizing ------------------------------------------------------ */\n\n/* Resize a table to fit the new array/hash part sizes. */\nstatic void resizetab(lua_State *L, GCtab *t, uint32_t asize, uint32_t hbits)\n{\n  Node *oldnode = noderef(t->node);\n  uint32_t oldasize = t->asize;\n  uint32_t oldhmask = t->hmask;\n  if (asize > oldasize) {  /* Array part grows? */\n    TValue *array;\n    uint32_t i;\n    if (asize > LJ_MAX_ASIZE)\n      lj_err_msg(L, LJ_ERR_TABOV);\n    if (LJ_MAX_COLOSIZE != 0 && t->colo > 0) {\n      /* A colocated array must be separated and copied. */\n      TValue *oarray = tvref(t->array);\n      array = lj_mem_newvec(L, asize, TValue);\n      t->colo = (int8_t)(t->colo | 0x80);  /* Mark as separated (colo < 0). */\n      for (i = 0; i < oldasize; i++)\n\tcopyTV(L, &array[i], &oarray[i]);\n    } else {\n      array = (TValue *)lj_mem_realloc(L, tvref(t->array),\n\t\t\t  oldasize*sizeof(TValue), asize*sizeof(TValue));\n    }\n    setmref(t->array, array);\n    t->asize = asize;\n    for (i = oldasize; i < asize; i++)  /* Clear newly allocated slots. */\n      setnilV(&array[i]);\n  }\n  /* Create new (empty) hash part. */\n  if (hbits) {\n    newhpart(L, t, hbits);\n    clearhpart(t);\n  } else {\n    global_State *g = G(L);\n    setmref(t->node, &g->nilnode);\n    t->hmask = 0;\n  }\n  if (asize < oldasize) {  /* Array part shrinks? */\n    TValue *array = tvref(t->array);\n    uint32_t i;\n    t->asize = asize;  /* Note: This 'shrinks' even colocated arrays. */\n    for (i = asize; i < oldasize; i++)  /* Reinsert old array values. */\n      if (!tvisnil(&array[i]))\n\tcopyTV(L, lj_tab_setinth(L, t, (int32_t)i), &array[i]);\n    /* Physically shrink only separated arrays. */\n    if (LJ_MAX_COLOSIZE != 0 && t->colo <= 0)\n      setmref(t->array, lj_mem_realloc(L, array,\n\t      oldasize*sizeof(TValue), asize*sizeof(TValue)));\n  }\n  if (oldhmask > 0) {  /* Reinsert pairs from old hash part. */\n    global_State *g;\n    uint32_t i;\n    for (i = 0; i <= oldhmask; i++) {\n      Node *n = &oldnode[i];\n      if (!tvisnil(&n->val))\n\tcopyTV(L, lj_tab_set(L, t, &n->key), &n->val);\n    }\n    g = G(L);\n    lj_mem_freevec(g, oldnode, oldhmask+1, Node);\n  }\n}\n\nstatic uint32_t countint(cTValue *key, uint32_t *bins)\n{\n  lua_assert(!tvisint(key));\n  if (tvisnum(key)) {\n    lua_Number nk = numV(key);\n    int32_t k = lj_num2int(nk);\n    if ((uint32_t)k < LJ_MAX_ASIZE && nk == (lua_Number)k) {\n      bins[(k > 2 ? lj_fls((uint32_t)(k-1)) : 0)]++;\n      return 1;\n    }\n  }\n  return 0;\n}\n\nstatic uint32_t countarray(const GCtab *t, uint32_t *bins)\n{\n  uint32_t na, b, i;\n  if (t->asize == 0) return 0;\n  for (na = i = b = 0; b < LJ_MAX_ABITS; b++) {\n    uint32_t n, top = 2u << b;\n    TValue *array;\n    if (top >= t->asize) {\n      top = t->asize-1;\n      if (i > top)\n\tbreak;\n    }\n    array = tvref(t->array);\n    for (n = 0; i <= top; i++)\n      if (!tvisnil(&array[i]))\n\tn++;\n    bins[b] += n;\n    na += n;\n  }\n  return na;\n}\n\nstatic uint32_t counthash(const GCtab *t, uint32_t *bins, uint32_t *narray)\n{\n  uint32_t total, na, i, hmask = t->hmask;\n  Node *node = noderef(t->node);\n  for (total = na = 0, i = 0; i <= hmask; i++) {\n    Node *n = &node[i];\n    if (!tvisnil(&n->val)) {\n      na += countint(&n->key, bins);\n      total++;\n    }\n  }\n  *narray += na;\n  return total;\n}\n\nstatic uint32_t bestasize(uint32_t bins[], uint32_t *narray)\n{\n  uint32_t b, sum, na = 0, sz = 0, nn = *narray;\n  for (b = 0, sum = 0; 2*nn > (1u<<b) && sum != nn; b++)\n    if (bins[b] > 0 && 2*(sum += bins[b]) > (1u<<b)) {\n      sz = (2u<<b)+1;\n      na = sum;\n    }\n  *narray = sz;\n  return na;\n}\n\nstatic void rehashtab(lua_State *L, GCtab *t, cTValue *ek)\n{\n  uint32_t bins[LJ_MAX_ABITS];\n  uint32_t total, asize, na, i;\n  for (i = 0; i < LJ_MAX_ABITS; i++) bins[i] = 0;\n  asize = countarray(t, bins);\n  total = 1 + asize;\n  total += counthash(t, bins, &asize);\n  asize += countint(ek, bins);\n  na = bestasize(bins, &asize);\n  total -= na;\n  resizetab(L, t, asize, hsize2hbits(total));\n}\n\nvoid lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize)\n{\n  resizetab(L, t, nasize+1, t->hmask > 0 ? lj_fls(t->hmask)+1 : 0);\n}\n\n/* -- Table getters ------------------------------------------------------- */\n\ncTValue * LJ_FASTCALL lj_tab_getinth(GCtab *t, int32_t key)\n{\n  TValue k;\n  Node *n;\n  k.n = (lua_Number)key;\n  n = hashnum(t, &k);\n  do {\n    if (tvisnum(&n->key) && n->key.n == k.n)\n      return &n->val;\n  } while ((n = nextnode(n)));\n  return NULL;\n}\n\ncTValue *lj_tab_getstr(GCtab *t, GCstr *key)\n{\n  Node *n = hashstr(t, key);\n  do {\n    if (tvisstr(&n->key) && strV(&n->key) == key)\n      return &n->val;\n  } while ((n = nextnode(n)));\n  return NULL;\n}\n\ncTValue *lj_tab_get(lua_State *L, GCtab *t, cTValue *key)\n{\n  if (tvisstr(key)) {\n    cTValue *tv = lj_tab_getstr(t, strV(key));\n    if (tv)\n      return tv;\n  } else if (tvisint(key)) {\n    cTValue *tv = lj_tab_getint(t, intV(key));\n    if (tv)\n      return tv;\n  } else if (tvisnum(key)) {\n    lua_Number nk = numV(key);\n    int32_t k = lj_num2int(nk);\n    if (nk == (lua_Number)k) {\n      cTValue *tv = lj_tab_getint(t, k);\n      if (tv)\n\treturn tv;\n    } else {\n      goto genlookup;  /* Else use the generic lookup. */\n    }\n  } else if (!tvisnil(key)) {\n    Node *n;\n  genlookup:\n    n = hashkey(t, key);\n    do {\n      if (lj_obj_equal(&n->key, key))\n\treturn &n->val;\n    } while ((n = nextnode(n)));\n  }\n  return niltv(L);\n}\n\n/* -- Table setters ------------------------------------------------------- */\n\n/* Insert new key. Use Brent's variation to optimize the chain length. */\nTValue *lj_tab_newkey(lua_State *L, GCtab *t, cTValue *key)\n{\n  Node *n = hashkey(t, key);\n  if (!tvisnil(&n->val) || t->hmask == 0) {\n    Node *nodebase = noderef(t->node);\n    Node *collide, *freenode = noderef(nodebase->freetop);\n    lua_assert(freenode >= nodebase && freenode <= nodebase+t->hmask+1);\n    do {\n      if (freenode == nodebase) {  /* No free node found? */\n\trehashtab(L, t, key);  /* Rehash table. */\n\treturn lj_tab_set(L, t, key);  /* Retry key insertion. */\n      }\n    } while (!tvisnil(&(--freenode)->key));\n    setmref(nodebase->freetop, freenode);\n    lua_assert(freenode != &G(L)->nilnode);\n    collide = hashkey(t, &n->key);\n    if (collide != n) {  /* Colliding node not the main node? */\n      while (noderef(collide->next) != n)  /* Find predecessor. */\n\tcollide = nextnode(collide);\n      setmref(collide->next, freenode);  /* Relink chain. */\n      /* Copy colliding node into free node and free main node. */\n      freenode->val = n->val;\n      freenode->key = n->key;\n      freenode->next = n->next;\n      setmref(n->next, NULL);\n      setnilV(&n->val);\n      /* Rechain pseudo-resurrected string keys with colliding hashes. */\n      while (nextnode(freenode)) {\n\tNode *nn = nextnode(freenode);\n\tif (tvisstr(&nn->key) && !tvisnil(&nn->val) &&\n\t    hashstr(t, strV(&nn->key)) == n) {\n\t  freenode->next = nn->next;\n\t  nn->next = n->next;\n\t  setmref(n->next, nn);\n\t} else {\n\t  freenode = nn;\n\t}\n      }\n    } else {  /* Otherwise use free node. */\n      setmrefr(freenode->next, n->next);  /* Insert into chain. */\n      setmref(n->next, freenode);\n      n = freenode;\n    }\n  }\n  n->key.u64 = key->u64;\n  if (LJ_UNLIKELY(tvismzero(&n->key)))\n    n->key.u64 = 0;\n  lj_gc_anybarriert(L, t);\n  lua_assert(tvisnil(&n->val));\n  return &n->val;\n}\n\nTValue *lj_tab_setinth(lua_State *L, GCtab *t, int32_t key)\n{\n  TValue k;\n  Node *n;\n  k.n = (lua_Number)key;\n  n = hashnum(t, &k);\n  do {\n    if (tvisnum(&n->key) && n->key.n == k.n)\n      return &n->val;\n  } while ((n = nextnode(n)));\n  return lj_tab_newkey(L, t, &k);\n}\n\nTValue *lj_tab_setstr(lua_State *L, GCtab *t, GCstr *key)\n{\n  TValue k;\n  Node *n = hashstr(t, key);\n  do {\n    if (tvisstr(&n->key) && strV(&n->key) == key)\n      return &n->val;\n  } while ((n = nextnode(n)));\n  setstrV(L, &k, key);\n  return lj_tab_newkey(L, t, &k);\n}\n\nTValue *lj_tab_set(lua_State *L, GCtab *t, cTValue *key)\n{\n  Node *n;\n  t->nomm = 0;  /* Invalidate negative metamethod cache. */\n  if (tvisstr(key)) {\n    return lj_tab_setstr(L, t, strV(key));\n  } else if (tvisint(key)) {\n    return lj_tab_setint(L, t, intV(key));\n  } else if (tvisnum(key)) {\n    lua_Number nk = numV(key);\n    int32_t k = lj_num2int(nk);\n    if (nk == (lua_Number)k)\n      return lj_tab_setint(L, t, k);\n    if (tvisnan(key))\n      lj_err_msg(L, LJ_ERR_NANIDX);\n    /* Else use the generic lookup. */\n  } else if (tvisnil(key)) {\n    lj_err_msg(L, LJ_ERR_NILIDX);\n  }\n  n = hashkey(t, key);\n  do {\n    if (lj_obj_equal(&n->key, key))\n      return &n->val;\n  } while ((n = nextnode(n)));\n  return lj_tab_newkey(L, t, key);\n}\n\n/* -- Table traversal ----------------------------------------------------- */\n\n/* Get the traversal index of a key. */\nstatic uint32_t keyindex(lua_State *L, GCtab *t, cTValue *key)\n{\n  TValue tmp;\n  if (tvisint(key)) {\n    int32_t k = intV(key);\n    if ((uint32_t)k < t->asize)\n      return (uint32_t)k;  /* Array key indexes: [0..t->asize-1] */\n    setnumV(&tmp, (lua_Number)k);\n    key = &tmp;\n  } else if (tvisnum(key)) {\n    lua_Number nk = numV(key);\n    int32_t k = lj_num2int(nk);\n    if ((uint32_t)k < t->asize && nk == (lua_Number)k)\n      return (uint32_t)k;  /* Array key indexes: [0..t->asize-1] */\n  }\n  if (!tvisnil(key)) {\n    Node *n = hashkey(t, key);\n    do {\n      if (lj_obj_equal(&n->key, key))\n\treturn t->asize + (uint32_t)(n - noderef(t->node));\n\t/* Hash key indexes: [t->asize..t->asize+t->nmask] */\n    } while ((n = nextnode(n)));\n    if (key->u32.hi == 0xfffe7fff)  /* ITERN was despecialized while running. */\n      return key->u32.lo - 1;\n    lj_err_msg(L, LJ_ERR_NEXTIDX);\n    return 0;  /* unreachable */\n  }\n  return ~0u;  /* A nil key starts the traversal. */\n}\n\n/* Advance to the next step in a table traversal. */\nint lj_tab_next(lua_State *L, GCtab *t, TValue *key)\n{\n  uint32_t i = keyindex(L, t, key);  /* Find predecessor key index. */\n  for (i++; i < t->asize; i++)  /* First traverse the array keys. */\n    if (!tvisnil(arrayslot(t, i))) {\n      setintV(key, i);\n      copyTV(L, key+1, arrayslot(t, i));\n      return 1;\n    }\n  for (i -= t->asize; i <= t->hmask; i++) {  /* Then traverse the hash keys. */\n    Node *n = &noderef(t->node)[i];\n    if (!tvisnil(&n->val)) {\n      copyTV(L, key, &n->key);\n      copyTV(L, key+1, &n->val);\n      return 1;\n    }\n  }\n  return 0;  /* End of traversal. */\n}\n\n/* -- Table length calculation -------------------------------------------- */\n\nstatic MSize unbound_search(GCtab *t, MSize j)\n{\n  cTValue *tv;\n  MSize i = j;  /* i is zero or a present index */\n  j++;\n  /* find `i' and `j' such that i is present and j is not */\n  while ((tv = lj_tab_getint(t, (int32_t)j)) && !tvisnil(tv)) {\n    i = j;\n    j *= 2;\n    if (j > (MSize)(INT_MAX-2)) {  /* overflow? */\n      /* table was built with bad purposes: resort to linear search */\n      i = 1;\n      while ((tv = lj_tab_getint(t, (int32_t)i)) && !tvisnil(tv)) i++;\n      return i - 1;\n    }\n  }\n  /* now do a binary search between them */\n  while (j - i > 1) {\n    MSize m = (i+j)/2;\n    cTValue *tvb = lj_tab_getint(t, (int32_t)m);\n    if (tvb && !tvisnil(tvb)) i = m; else j = m;\n  }\n  return i;\n}\n\n/*\n** Try to find a boundary in table `t'. A `boundary' is an integer index\n** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil).\n*/\nMSize LJ_FASTCALL lj_tab_len(GCtab *t)\n{\n  MSize j = (MSize)t->asize;\n  if (j > 1 && tvisnil(arrayslot(t, j-1))) {\n    MSize i = 1;\n    while (j - i > 1) {\n      MSize m = (i+j)/2;\n      if (tvisnil(arrayslot(t, m-1))) j = m; else i = m;\n    }\n    return i-1;\n  }\n  if (j) j--;\n  if (t->hmask <= 0)\n    return j;\n  return unbound_search(t, j);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_tab.h",
    "content": "/*\n** Table handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_TAB_H\n#define _LJ_TAB_H\n\n#include \"lj_obj.h\"\n\n/* Hash constants. Tuned using a brute force search. */\n#define HASH_BIAS\t(-0x04c11db7)\n#define HASH_ROT1\t14\n#define HASH_ROT2\t5\n#define HASH_ROT3\t13\n\n/* Scramble the bits of numbers and pointers. */\nstatic LJ_AINLINE uint32_t hashrot(uint32_t lo, uint32_t hi)\n{\n#if LJ_TARGET_X86ORX64\n  /* Prefer variant that compiles well for a 2-operand CPU. */\n  lo ^= hi; hi = lj_rol(hi, HASH_ROT1);\n  lo -= hi; hi = lj_rol(hi, HASH_ROT2);\n  hi ^= lo; hi -= lj_rol(lo, HASH_ROT3);\n#else\n  lo ^= hi;\n  lo = lo - lj_rol(hi, HASH_ROT1);\n  hi = lo ^ lj_rol(hi, HASH_ROT1 + HASH_ROT2);\n  hi = hi - lj_rol(lo, HASH_ROT3);\n#endif\n  return hi;\n}\n\n#define hsize2hbits(s)\t((s) ? ((s)==1 ? 1 : 1+lj_fls((uint32_t)((s)-1))) : 0)\n\nLJ_FUNCA GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits);\n#if LJ_HASJIT\nLJ_FUNC GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize);\n#endif\nLJ_FUNCA GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt);\nLJ_FUNC void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t);\nLJ_FUNCA void lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize);\n\n/* Caveat: all getters except lj_tab_get() can return NULL! */\n\nLJ_FUNCA cTValue * LJ_FASTCALL lj_tab_getinth(GCtab *t, int32_t key);\nLJ_FUNC cTValue *lj_tab_getstr(GCtab *t, GCstr *key);\nLJ_FUNCA cTValue *lj_tab_get(lua_State *L, GCtab *t, cTValue *key);\n\n/* Caveat: all setters require a write barrier for the stored value. */\n\nLJ_FUNCA TValue *lj_tab_newkey(lua_State *L, GCtab *t, cTValue *key);\nLJ_FUNC TValue *lj_tab_setinth(lua_State *L, GCtab *t, int32_t key);\nLJ_FUNC TValue *lj_tab_setstr(lua_State *L, GCtab *t, GCstr *key);\nLJ_FUNC TValue *lj_tab_set(lua_State *L, GCtab *t, cTValue *key);\n\n#define inarray(t, key)\t\t((MSize)(key) < (MSize)(t)->asize)\n#define arrayslot(t, i)\t\t(&tvref((t)->array)[(i)])\n#define lj_tab_getint(t, key) \\\n  (inarray((t), (key)) ? arrayslot((t), (key)) : lj_tab_getinth((t), (key)))\n#define lj_tab_setint(L, t, key) \\\n  (inarray((t), (key)) ? arrayslot((t), (key)) : lj_tab_setinth(L, (t), (key)))\n\nLJ_FUNCA int lj_tab_next(lua_State *L, GCtab *t, TValue *key);\nLJ_FUNCA MSize LJ_FASTCALL lj_tab_len(GCtab *t);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_target.h",
    "content": "/*\n** Definitions for target CPU.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_TARGET_H\n#define _LJ_TARGET_H\n\n#include \"lj_def.h\"\n#include \"lj_arch.h\"\n\n/* -- Registers and spill slots ------------------------------------------- */\n\n/* Register type (uint8_t in ir->r). */\ntypedef uint32_t Reg;\n\n/* The hi-bit is NOT set for an allocated register. This means the value\n** can be directly used without masking. The hi-bit is set for a register\n** allocation hint or for RID_INIT, RID_SINK or RID_SUNK.\n*/\n#define RID_NONE\t\t0x80\n#define RID_MASK\t\t0x7f\n#define RID_INIT\t\t(RID_NONE|RID_MASK)\n#define RID_SINK\t\t(RID_INIT-1)\n#define RID_SUNK\t\t(RID_INIT-2)\n\n#define ra_noreg(r)\t\t((r) & RID_NONE)\n#define ra_hasreg(r)\t\t(!((r) & RID_NONE))\n\n/* The ra_hashint() macro assumes a previous test for ra_noreg(). */\n#define ra_hashint(r)\t\t((r) < RID_SUNK)\n#define ra_gethint(r)\t\t((Reg)((r) & RID_MASK))\n#define ra_sethint(rr, r)\trr = (uint8_t)((r)|RID_NONE)\n#define ra_samehint(r1, r2)\t(ra_gethint((r1)^(r2)) == 0)\n\n/* Spill slot 0 means no spill slot has been allocated. */\n#define SPS_NONE\t\t0\n\n#define ra_hasspill(s)\t\t((s) != SPS_NONE)\n\n/* Combined register and spill slot (uint16_t in ir->prev). */\ntypedef uint32_t RegSP;\n\n#define REGSP(r, s)\t\t((r) + ((s) << 8))\n#define REGSP_HINT(r)\t\t((r)|RID_NONE)\n#define REGSP_INIT\t\tREGSP(RID_INIT, 0)\n\n#define regsp_reg(rs)\t\t((rs) & 255)\n#define regsp_spill(rs)\t\t((rs) >> 8)\n#define regsp_used(rs) \\\n  (((rs) & ~REGSP(RID_MASK, 0)) != REGSP(RID_NONE, 0))\n\n/* -- Register sets ------------------------------------------------------- */\n\n/* Bitset for registers. 32 registers suffice for most architectures.\n** Note that one set holds bits for both GPRs and FPRs.\n*/\n#if LJ_TARGET_PPC || LJ_TARGET_MIPS\ntypedef uint64_t RegSet;\n#else\ntypedef uint32_t RegSet;\n#endif\n\n#define RID2RSET(r)\t\t(((RegSet)1) << (r))\n#define RSET_EMPTY\t\t((RegSet)0)\n#define RSET_RANGE(lo, hi)\t((RID2RSET((hi)-(lo))-1) << (lo))\n\n#define rset_test(rs, r)\t((int)((rs) >> (r)) & 1)\n#define rset_set(rs, r)\t\t(rs |= RID2RSET(r))\n#define rset_clear(rs, r)\t(rs &= ~RID2RSET(r))\n#define rset_exclude(rs, r)\t(rs & ~RID2RSET(r))\n#if LJ_TARGET_PPC || LJ_TARGET_MIPS\n#define rset_picktop(rs)\t((Reg)(__builtin_clzll(rs)^63))\n#define rset_pickbot(rs)\t((Reg)__builtin_ctzll(rs))\n#else\n#define rset_picktop(rs)\t((Reg)lj_fls(rs))\n#define rset_pickbot(rs)\t((Reg)lj_ffs(rs))\n#endif\n\n/* -- Register allocation cost -------------------------------------------- */\n\n/* The register allocation heuristic keeps track of the cost for allocating\n** a specific register:\n**\n** A free register (obviously) has a cost of 0 and a 1-bit in the free mask.\n**\n** An already allocated register has the (non-zero) IR reference in the lowest\n** bits and the result of a blended cost-model in the higher bits.\n**\n** The allocator first checks the free mask for a hit. Otherwise an (unrolled)\n** linear search for the minimum cost is used. The search doesn't need to\n** keep track of the position of the minimum, which makes it very fast.\n** The lowest bits of the minimum cost show the desired IR reference whose\n** register is the one to evict.\n**\n** Without the cost-model this degenerates to the standard heuristics for\n** (reverse) linear-scan register allocation. Since code generation is done\n** in reverse, a live interval extends from the last use to the first def.\n** For an SSA IR the IR reference is the first (and only) def and thus\n** trivially marks the end of the interval. The LSRA heuristics says to pick\n** the register whose live interval has the furthest extent, i.e. the lowest\n** IR reference in our case.\n**\n** A cost-model should take into account other factors, like spill-cost and\n** restore- or rematerialization-cost, which depend on the kind of instruction.\n** E.g. constants have zero spill costs, variant instructions have higher\n** costs than invariants and PHIs should preferably never be spilled.\n**\n** Here's a first cut at simple, but effective blended cost-model for R-LSRA:\n** - Due to careful design of the IR, constants already have lower IR\n**   references than invariants and invariants have lower IR references\n**   than variants.\n** - The cost in the upper 16 bits is the sum of the IR reference and a\n**   weighted score. The score currently only takes into account whether\n**   the IRT_ISPHI bit is set in the instruction type.\n** - The PHI weight is the minimum distance (in IR instructions) a PHI\n**   reference has to be further apart from a non-PHI reference to be spilled.\n** - It should be a power of two (for speed) and must be between 2 and 32768.\n**   Good values for the PHI weight seem to be between 40 and 150.\n** - Further study is required.\n*/\n#define REGCOST_PHI_WEIGHT\t64\n\n/* Cost for allocating a specific register. */\ntypedef uint32_t RegCost;\n\n/* Note: assumes 16 bit IRRef1. */\n#define REGCOST(cost, ref)\t((RegCost)(ref) + ((RegCost)(cost) << 16))\n#define regcost_ref(rc)\t\t((IRRef1)(rc))\n\n#define REGCOST_T(t) \\\n  ((RegCost)((t)&IRT_ISPHI) * (((RegCost)(REGCOST_PHI_WEIGHT)<<16)/IRT_ISPHI))\n#define REGCOST_REF_T(ref, t)\t(REGCOST((ref), (ref)) + REGCOST_T((t)))\n\n/* -- Target-specific definitions ----------------------------------------- */\n\n#if LJ_TARGET_X86ORX64\n#include \"lj_target_x86.h\"\n#elif LJ_TARGET_ARM\n#include \"lj_target_arm.h\"\n#elif LJ_TARGET_PPC\n#include \"lj_target_ppc.h\"\n#elif LJ_TARGET_MIPS\n#include \"lj_target_mips.h\"\n#else\n#error \"Missing include for target CPU\"\n#endif\n\n#ifdef EXITSTUBS_PER_GROUP\n/* Return the address of an exit stub. */\nstatic LJ_AINLINE char *exitstub_addr_(char **group, uint32_t exitno)\n{\n  lua_assert(group[exitno / EXITSTUBS_PER_GROUP] != NULL);\n  return (char *)group[exitno / EXITSTUBS_PER_GROUP] +\n\t EXITSTUB_SPACING*(exitno % EXITSTUBS_PER_GROUP);\n}\n/* Avoid dependence on lj_jit.h if only including lj_target.h. */\n#define exitstub_addr(J, exitno) \\\n  ((MCode *)exitstub_addr_((char **)((J)->exitstubgroup), (exitno)))\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_target_arm.h",
    "content": "/*\n** Definitions for ARM CPUs.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_TARGET_ARM_H\n#define _LJ_TARGET_ARM_H\n\n/* -- Registers IDs ------------------------------------------------------- */\n\n#define GPRDEF(_) \\\n  _(R0) _(R1) _(R2) _(R3) _(R4) _(R5) _(R6) _(R7) \\\n  _(R8) _(R9) _(R10) _(R11) _(R12) _(SP) _(LR) _(PC)\n#if LJ_SOFTFP\n#define FPRDEF(_)\n#else\n#define FPRDEF(_) \\\n  _(D0) _(D1) _(D2) _(D3) _(D4) _(D5) _(D6) _(D7) \\\n  _(D8) _(D9) _(D10) _(D11) _(D12) _(D13) _(D14) _(D15)\n#endif\n#define VRIDDEF(_)\n\n#define RIDENUM(name)\tRID_##name,\n\nenum {\n  GPRDEF(RIDENUM)\t\t/* General-purpose registers (GPRs). */\n  FPRDEF(RIDENUM)\t\t/* Floating-point registers (FPRs). */\n  RID_MAX,\n  RID_TMP = RID_LR,\n\n  /* Calling conventions. */\n  RID_RET = RID_R0,\n  RID_RETLO = RID_R0,\n  RID_RETHI = RID_R1,\n#if LJ_SOFTFP\n  RID_FPRET = RID_R0,\n#else\n  RID_FPRET = RID_D0,\n#endif\n\n  /* These definitions must match with the *.dasc file(s): */\n  RID_BASE = RID_R9,\t\t/* Interpreter BASE. */\n  RID_LPC = RID_R6,\t\t/* Interpreter PC. */\n  RID_DISPATCH = RID_R7,\t/* Interpreter DISPATCH table. */\n  RID_LREG = RID_R8,\t\t/* Interpreter L. */\n\n  /* Register ranges [min, max) and number of registers. */\n  RID_MIN_GPR = RID_R0,\n  RID_MAX_GPR = RID_PC+1,\n  RID_MIN_FPR = RID_MAX_GPR,\n#if LJ_SOFTFP\n  RID_MAX_FPR = RID_MIN_FPR,\n#else\n  RID_MAX_FPR = RID_D15+1,\n#endif\n  RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR,\n  RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR\n};\n\n#define RID_NUM_KREF\t\tRID_NUM_GPR\n#define RID_MIN_KREF\t\tRID_R0\n\n/* -- Register sets ------------------------------------------------------- */\n\n/* Make use of all registers, except sp, lr and pc. */\n#define RSET_GPR\t\t(RSET_RANGE(RID_MIN_GPR, RID_R12+1))\n#define RSET_GPREVEN \\\n  (RID2RSET(RID_R0)|RID2RSET(RID_R2)|RID2RSET(RID_R4)|RID2RSET(RID_R6)| \\\n   RID2RSET(RID_R8)|RID2RSET(RID_R10))\n#define RSET_GPRODD \\\n  (RID2RSET(RID_R1)|RID2RSET(RID_R3)|RID2RSET(RID_R5)|RID2RSET(RID_R7)| \\\n   RID2RSET(RID_R9)|RID2RSET(RID_R11))\n#if LJ_SOFTFP\n#define RSET_FPR\t\t0\n#else\n#define RSET_FPR\t\t(RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR))\n#endif\n#define RSET_ALL\t\t(RSET_GPR|RSET_FPR)\n#define RSET_INIT\t\tRSET_ALL\n\n/* ABI-specific register sets. lr is an implicit scratch register. */\n#define RSET_SCRATCH_GPR_\t(RSET_RANGE(RID_R0, RID_R3+1)|RID2RSET(RID_R12))\n#ifdef __APPLE__\n#define RSET_SCRATCH_GPR\t(RSET_SCRATCH_GPR_|RID2RSET(RID_R9))\n#else\n#define RSET_SCRATCH_GPR\tRSET_SCRATCH_GPR_\n#endif\n#if LJ_SOFTFP\n#define RSET_SCRATCH_FPR\t0\n#else\n#define RSET_SCRATCH_FPR\t(RSET_RANGE(RID_D0, RID_D7+1))\n#endif\n#define RSET_SCRATCH\t\t(RSET_SCRATCH_GPR|RSET_SCRATCH_FPR)\n#define REGARG_FIRSTGPR\t\tRID_R0\n#define REGARG_LASTGPR\t\tRID_R3\n#define REGARG_NUMGPR\t\t4\n#if LJ_ABI_SOFTFP\n#define REGARG_FIRSTFPR\t\t0\n#define REGARG_LASTFPR\t\t0\n#define REGARG_NUMFPR\t\t0\n#else\n#define REGARG_FIRSTFPR\t\tRID_D0\n#define REGARG_LASTFPR\t\tRID_D7\n#define REGARG_NUMFPR\t\t8\n#endif\n\n/* -- Spill slots --------------------------------------------------------- */\n\n/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs.\n**\n** SPS_FIXED: Available fixed spill slots in interpreter frame.\n** This definition must match with the *.dasc file(s).\n**\n** SPS_FIRST: First spill slot for general use. Reserve min. two 32 bit slots.\n*/\n#define SPS_FIXED\t2\n#define SPS_FIRST\t2\n\n#define SPOFS_TMP\t0\n\n#define sps_scale(slot)\t\t(4 * (int32_t)(slot))\n#define sps_align(slot)\t\t(((slot) - SPS_FIXED + 1) & ~1)\n\n/* -- Exit state ---------------------------------------------------------- */\n\n/* This definition must match with the *.dasc file(s). */\ntypedef struct {\n#if !LJ_SOFTFP\n  lua_Number fpr[RID_NUM_FPR];\t/* Floating-point registers. */\n#endif\n  int32_t gpr[RID_NUM_GPR];\t/* General-purpose registers. */\n  int32_t spill[256];\t\t/* Spill slots. */\n} ExitState;\n\n/* PC after instruction that caused an exit. Used to find the trace number. */\n#define EXITSTATE_PCREG\t\tRID_PC\n/* Highest exit + 1 indicates stack check. */\n#define EXITSTATE_CHECKEXIT\t1\n\n#define EXITSTUB_SPACING        4\n#define EXITSTUBS_PER_GROUP     32\n\n/* -- Instructions -------------------------------------------------------- */\n\n/* Instruction fields. */\n#define ARMF_CC(ai, cc)\t(((ai) ^ ARMI_CCAL) | ((cc) << 28))\n#define ARMF_N(r)\t((r) << 16)\n#define ARMF_D(r)\t((r) << 12)\n#define ARMF_S(r)\t((r) << 8)\n#define ARMF_M(r)\t(r)\n#define ARMF_SH(sh, n)\t(((sh) << 5) | ((n) << 7))\n#define ARMF_RSH(sh, r)\t(0x10 | ((sh) << 5) | ARMF_S(r))\n\ntypedef enum ARMIns {\n  ARMI_CCAL = 0xe0000000,\n  ARMI_S = 0x000100000,\n  ARMI_K12 = 0x02000000,\n  ARMI_KNEG = 0x00200000,\n  ARMI_LS_W = 0x00200000,\n  ARMI_LS_U = 0x00800000,\n  ARMI_LS_P = 0x01000000,\n  ARMI_LS_R = 0x02000000,\n  ARMI_LSX_I = 0x00400000,\n\n  ARMI_AND = 0xe0000000,\n  ARMI_EOR = 0xe0200000,\n  ARMI_SUB = 0xe0400000,\n  ARMI_RSB = 0xe0600000,\n  ARMI_ADD = 0xe0800000,\n  ARMI_ADC = 0xe0a00000,\n  ARMI_SBC = 0xe0c00000,\n  ARMI_RSC = 0xe0e00000,\n  ARMI_TST = 0xe1100000,\n  ARMI_TEQ = 0xe1300000,\n  ARMI_CMP = 0xe1500000,\n  ARMI_CMN = 0xe1700000,\n  ARMI_ORR = 0xe1800000,\n  ARMI_MOV = 0xe1a00000,\n  ARMI_BIC = 0xe1c00000,\n  ARMI_MVN = 0xe1e00000,\n\n  ARMI_NOP = 0xe1a00000,\n\n  ARMI_MUL = 0xe0000090,\n  ARMI_SMULL = 0xe0c00090,\n\n  ARMI_LDR = 0xe4100000,\n  ARMI_LDRB = 0xe4500000,\n  ARMI_LDRH = 0xe01000b0,\n  ARMI_LDRSB = 0xe01000d0,\n  ARMI_LDRSH = 0xe01000f0,\n  ARMI_LDRD = 0xe00000d0,\n  ARMI_STR = 0xe4000000,\n  ARMI_STRB = 0xe4400000,\n  ARMI_STRH = 0xe00000b0,\n  ARMI_STRD = 0xe00000f0,\n  ARMI_PUSH = 0xe92d0000,\n\n  ARMI_B = 0xea000000,\n  ARMI_BL = 0xeb000000,\n  ARMI_BLX = 0xfa000000,\n  ARMI_BLXr = 0xe12fff30,\n\n  /* ARMv6 */\n  ARMI_REV = 0xe6bf0f30,\n  ARMI_SXTB = 0xe6af0070,\n  ARMI_SXTH = 0xe6bf0070,\n  ARMI_UXTB = 0xe6ef0070,\n  ARMI_UXTH = 0xe6ff0070,\n\n  /* ARMv6T2 */\n  ARMI_MOVW = 0xe3000000,\n  ARMI_MOVT = 0xe3400000,\n\n  /* VFP */\n  ARMI_VMOV_D = 0xeeb00b40,\n  ARMI_VMOV_S = 0xeeb00a40,\n  ARMI_VMOVI_D = 0xeeb00b00,\n\n  ARMI_VMOV_R_S = 0xee100a10,\n  ARMI_VMOV_S_R = 0xee000a10,\n  ARMI_VMOV_RR_D = 0xec500b10,\n  ARMI_VMOV_D_RR = 0xec400b10,\n\n  ARMI_VADD_D = 0xee300b00,\n  ARMI_VSUB_D = 0xee300b40,\n  ARMI_VMUL_D = 0xee200b00,\n  ARMI_VMLA_D = 0xee000b00,\n  ARMI_VMLS_D = 0xee000b40,\n  ARMI_VNMLS_D = 0xee100b00,\n  ARMI_VDIV_D = 0xee800b00,\n\n  ARMI_VABS_D = 0xeeb00bc0,\n  ARMI_VNEG_D = 0xeeb10b40,\n  ARMI_VSQRT_D = 0xeeb10bc0,\n\n  ARMI_VCMP_D = 0xeeb40b40,\n  ARMI_VCMPZ_D = 0xeeb50b40,\n\n  ARMI_VMRS = 0xeef1fa10,\n\n  ARMI_VCVT_S32_F32 = 0xeebd0ac0,\n  ARMI_VCVT_S32_F64 = 0xeebd0bc0,\n  ARMI_VCVT_U32_F32 = 0xeebc0ac0,\n  ARMI_VCVT_U32_F64 = 0xeebc0bc0,\n  ARMI_VCVTR_S32_F32 = 0xeebd0a40,\n  ARMI_VCVTR_S32_F64 = 0xeebd0b40,\n  ARMI_VCVTR_U32_F32 = 0xeebc0a40,\n  ARMI_VCVTR_U32_F64 = 0xeebc0b40,\n  ARMI_VCVT_F32_S32 = 0xeeb80ac0,\n  ARMI_VCVT_F64_S32 = 0xeeb80bc0,\n  ARMI_VCVT_F32_U32 = 0xeeb80a40,\n  ARMI_VCVT_F64_U32 = 0xeeb80b40,\n  ARMI_VCVT_F32_F64 = 0xeeb70bc0,\n  ARMI_VCVT_F64_F32 = 0xeeb70ac0,\n\n  ARMI_VLDR_S = 0xed100a00,\n  ARMI_VLDR_D = 0xed100b00,\n  ARMI_VSTR_S = 0xed000a00,\n  ARMI_VSTR_D = 0xed000b00,\n} ARMIns;\n\ntypedef enum ARMShift {\n  ARMSH_LSL, ARMSH_LSR, ARMSH_ASR, ARMSH_ROR\n} ARMShift;\n\n/* ARM condition codes. */\ntypedef enum ARMCC {\n  CC_EQ, CC_NE, CC_CS, CC_CC, CC_MI, CC_PL, CC_VS, CC_VC,\n  CC_HI, CC_LS, CC_GE, CC_LT, CC_GT, CC_LE, CC_AL,\n  CC_HS = CC_CS, CC_LO = CC_CC\n} ARMCC;\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_target_mips.h",
    "content": "/*\n** Definitions for MIPS CPUs.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_TARGET_MIPS_H\n#define _LJ_TARGET_MIPS_H\n\n/* -- Registers IDs ------------------------------------------------------- */\n\n#define GPRDEF(_) \\\n  _(R0) _(R1) _(R2) _(R3) _(R4) _(R5) _(R6) _(R7) \\\n  _(R8) _(R9) _(R10) _(R11) _(R12) _(R13) _(R14) _(R15) \\\n  _(R16) _(R17) _(R18) _(R19) _(R20) _(R21) _(R22) _(R23) \\\n  _(R24) _(R25) _(SYS1) _(SYS2) _(R28) _(SP) _(R30) _(RA)\n#define FPRDEF(_) \\\n  _(F0) _(F1) _(F2) _(F3) _(F4) _(F5) _(F6) _(F7) \\\n  _(F8) _(F9) _(F10) _(F11) _(F12) _(F13) _(F14) _(F15) \\\n  _(F16) _(F17) _(F18) _(F19) _(F20) _(F21) _(F22) _(F23) \\\n  _(F24) _(F25) _(F26) _(F27) _(F28) _(F29) _(F30) _(F31)\n#define VRIDDEF(_)\n\n#define RIDENUM(name)\tRID_##name,\n\nenum {\n  GPRDEF(RIDENUM)\t\t/* General-purpose registers (GPRs). */\n  FPRDEF(RIDENUM)\t\t/* Floating-point registers (FPRs). */\n  RID_MAX,\n  RID_ZERO = RID_R0,\n  RID_TMP = RID_RA,\n\n  /* Calling conventions. */\n  RID_RET = RID_R2,\n#if LJ_LE\n  RID_RETHI = RID_R3,\n  RID_RETLO = RID_R2,\n#else\n  RID_RETHI = RID_R2,\n  RID_RETLO = RID_R3,\n#endif\n  RID_FPRET = RID_F0,\n  RID_CFUNCADDR = RID_R25,\n\n  /* These definitions must match with the *.dasc file(s): */\n  RID_BASE = RID_R16,\t\t/* Interpreter BASE. */\n  RID_LPC = RID_R18,\t\t/* Interpreter PC. */\n  RID_DISPATCH = RID_R19,\t/* Interpreter DISPATCH table. */\n  RID_LREG = RID_R20,\t\t/* Interpreter L. */\n  RID_JGL = RID_R30,\t\t/* On-trace: global_State + 32768. */\n\n  /* Register ranges [min, max) and number of registers. */\n  RID_MIN_GPR = RID_R0,\n  RID_MAX_GPR = RID_RA+1,\n  RID_MIN_FPR = RID_F0,\n  RID_MAX_FPR = RID_F31+1,\n  RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR,\n  RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR\t/* Only even regs are used. */\n};\n\n#define RID_NUM_KREF\t\tRID_NUM_GPR\n#define RID_MIN_KREF\t\tRID_R0\n\n/* -- Register sets ------------------------------------------------------- */\n\n/* Make use of all registers, except ZERO, TMP, SP, SYS1, SYS2 and JGL. */\n#define RSET_FIXED \\\n  (RID2RSET(RID_ZERO)|RID2RSET(RID_TMP)|RID2RSET(RID_SP)|\\\n   RID2RSET(RID_SYS1)|RID2RSET(RID_SYS2)|RID2RSET(RID_JGL))\n#define RSET_GPR\t(RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED)\n#define RSET_FPR \\\n  (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\\\n   RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\\\n   RID2RSET(RID_F16)|RID2RSET(RID_F18)|RID2RSET(RID_F20)|RID2RSET(RID_F22)|\\\n   RID2RSET(RID_F24)|RID2RSET(RID_F26)|RID2RSET(RID_F28)|RID2RSET(RID_F30))\n#define RSET_ALL\t(RSET_GPR|RSET_FPR)\n#define RSET_INIT\tRSET_ALL\n\n#define RSET_SCRATCH_GPR \\\n  (RSET_RANGE(RID_R1, RID_R15+1)|\\\n   RID2RSET(RID_R24)|RID2RSET(RID_R25)|RID2RSET(RID_R28))\n#define RSET_SCRATCH_FPR \\\n  (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\\\n   RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\\\n   RID2RSET(RID_F16)|RID2RSET(RID_F18))\n#define RSET_SCRATCH\t\t(RSET_SCRATCH_GPR|RSET_SCRATCH_FPR)\n#define REGARG_FIRSTGPR\t\tRID_R4\n#define REGARG_LASTGPR\t\tRID_R7\n#define REGARG_NUMGPR\t\t4\n#define REGARG_FIRSTFPR\t\tRID_F12\n#define REGARG_LASTFPR\t\tRID_F14\n#define REGARG_NUMFPR\t\t2\n\n/* -- Spill slots --------------------------------------------------------- */\n\n/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs.\n**\n** SPS_FIXED: Available fixed spill slots in interpreter frame.\n** This definition must match with the *.dasc file(s).\n**\n** SPS_FIRST: First spill slot for general use.\n*/\n#define SPS_FIXED\t5\n#define SPS_FIRST\t4\n\n#define SPOFS_TMP\t0\n\n#define sps_scale(slot)\t\t(4 * (int32_t)(slot))\n#define sps_align(slot)\t\t(((slot) - SPS_FIXED + 1) & ~1)\n\n/* -- Exit state ---------------------------------------------------------- */\n\n/* This definition must match with the *.dasc file(s). */\ntypedef struct {\n  lua_Number fpr[RID_NUM_FPR];\t/* Floating-point registers. */\n  int32_t gpr[RID_NUM_GPR];\t/* General-purpose registers. */\n  int32_t spill[256];\t\t/* Spill slots. */\n} ExitState;\n\n/* Highest exit + 1 indicates stack check. */\n#define EXITSTATE_CHECKEXIT\t1\n\n/* Return the address of a per-trace exit stub. */\nstatic LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p)\n{\n  while (*p == 0x00000000) p++;  /* Skip MIPSI_NOP. */\n  return p;\n}\n/* Avoid dependence on lj_jit.h if only including lj_target.h. */\n#define exitstub_trace_addr(T, exitno) \\\n  exitstub_trace_addr_((MCode *)((char *)(T)->mcode + (T)->szmcode))\n\n/* -- Instructions -------------------------------------------------------- */\n\n/* Instruction fields. */\n#define MIPSF_S(r)\t((r) << 21)\n#define MIPSF_T(r)\t((r) << 16)\n#define MIPSF_D(r)\t((r) << 11)\n#define MIPSF_R(r)\t((r) << 21)\n#define MIPSF_H(r)\t((r) << 16)\n#define MIPSF_G(r)\t((r) << 11)\n#define MIPSF_F(r)\t((r) << 6)\n#define MIPSF_A(n)\t((n) << 6)\n#define MIPSF_M(n)\t((n) << 11)\n\ntypedef enum MIPSIns {\n  /* Integer instructions. */\n  MIPSI_MOVE = 0x00000021,\n  MIPSI_NOP = 0x00000000,\n\n  MIPSI_LI = 0x24000000,\n  MIPSI_LU = 0x34000000,\n  MIPSI_LUI = 0x3c000000,\n\n  MIPSI_ADDIU = 0x24000000,\n  MIPSI_ANDI = 0x30000000,\n  MIPSI_ORI = 0x34000000,\n  MIPSI_XORI = 0x38000000,\n  MIPSI_SLTI = 0x28000000,\n  MIPSI_SLTIU = 0x2c000000,\n\n  MIPSI_ADDU = 0x00000021,\n  MIPSI_SUBU = 0x00000023,\n  MIPSI_MUL = 0x70000002,\n  MIPSI_AND = 0x00000024,\n  MIPSI_OR = 0x00000025,\n  MIPSI_XOR = 0x00000026,\n  MIPSI_NOR = 0x00000027,\n  MIPSI_SLT = 0x0000002a,\n  MIPSI_SLTU = 0x0000002b,\n  MIPSI_MOVZ = 0x0000000a,\n  MIPSI_MOVN = 0x0000000b,\n\n  MIPSI_SLL = 0x00000000,\n  MIPSI_SRL = 0x00000002,\n  MIPSI_SRA = 0x00000003,\n  MIPSI_ROTR = 0x00200002,\t/* MIPS32R2 */\n  MIPSI_SLLV = 0x00000004,\n  MIPSI_SRLV = 0x00000006,\n  MIPSI_SRAV = 0x00000007,\n  MIPSI_ROTRV = 0x00000046,\t/* MIPS32R2 */\n\n  MIPSI_SEB = 0x7c000420,\t/* MIPS32R2 */\n  MIPSI_SEH = 0x7c000620,\t/* MIPS32R2 */\n  MIPSI_WSBH = 0x7c0000a0,\t/* MIPS32R2 */\n\n  MIPSI_B = 0x10000000,\n  MIPSI_J = 0x08000000,\n  MIPSI_JAL = 0x0c000000,\n  MIPSI_JR = 0x00000008,\n  MIPSI_JALR = 0x0000f809,\n\n  MIPSI_BEQ = 0x10000000,\n  MIPSI_BNE = 0x14000000,\n  MIPSI_BLEZ = 0x18000000,\n  MIPSI_BGTZ = 0x1c000000,\n  MIPSI_BLTZ = 0x04000000,\n  MIPSI_BGEZ = 0x04010000,\n\n  /* Load/store instructions. */\n  MIPSI_LW = 0x8c000000,\n  MIPSI_SW = 0xac000000,\n  MIPSI_LB = 0x80000000,\n  MIPSI_SB = 0xa0000000,\n  MIPSI_LH = 0x84000000,\n  MIPSI_SH = 0xa4000000,\n  MIPSI_LBU = 0x90000000,\n  MIPSI_LHU = 0x94000000,\n  MIPSI_LWC1 = 0xc4000000,\n  MIPSI_SWC1 = 0xe4000000,\n  MIPSI_LDC1 = 0xd4000000,\n  MIPSI_SDC1 = 0xf4000000,\n\n  /* FP instructions. */\n  MIPSI_MOV_S = 0x46000006,\n  MIPSI_MOV_D = 0x46200006,\n  MIPSI_MOVT_D = 0x46210011,\n  MIPSI_MOVF_D = 0x46200011,\n\n  MIPSI_ABS_D = 0x46200005,\n  MIPSI_NEG_D = 0x46200007,\n\n  MIPSI_ADD_D = 0x46200000,\n  MIPSI_SUB_D = 0x46200001,\n  MIPSI_MUL_D = 0x46200002,\n  MIPSI_DIV_D = 0x46200003,\n  MIPSI_SQRT_D = 0x46200004,\n\n  MIPSI_ADD_S = 0x46000000,\n  MIPSI_SUB_S = 0x46000001,\n\n  MIPSI_CVT_D_S = 0x46000021,\n  MIPSI_CVT_W_S = 0x46000024,\n  MIPSI_CVT_S_D = 0x46200020,\n  MIPSI_CVT_W_D = 0x46200024,\n  MIPSI_CVT_S_W = 0x46800020,\n  MIPSI_CVT_D_W = 0x46800021,\n\n  MIPSI_TRUNC_W_S = 0x4600000d,\n  MIPSI_TRUNC_W_D = 0x4620000d,\n  MIPSI_FLOOR_W_S = 0x4600000f,\n  MIPSI_FLOOR_W_D = 0x4620000f,\n\n  MIPSI_MFC1 = 0x44000000,\n  MIPSI_MTC1 = 0x44800000,\n\n  MIPSI_BC1F = 0x45000000,\n  MIPSI_BC1T = 0x45010000,\n\n  MIPSI_C_EQ_D = 0x46200032,\n  MIPSI_C_OLT_D = 0x46200034,\n  MIPSI_C_ULT_D = 0x46200035,\n  MIPSI_C_OLE_D = 0x46200036,\n  MIPSI_C_ULE_D = 0x46200037,\n\n} MIPSIns;\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_target_ppc.h",
    "content": "/*\n** Definitions for PPC CPUs.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_TARGET_PPC_H\n#define _LJ_TARGET_PPC_H\n\n/* -- Registers IDs ------------------------------------------------------- */\n\n#define GPRDEF(_) \\\n  _(R0) _(SP) _(SYS1) _(R3) _(R4) _(R5) _(R6) _(R7) \\\n  _(R8) _(R9) _(R10) _(R11) _(R12) _(SYS2) _(R14) _(R15) \\\n  _(R16) _(R17) _(R18) _(R19) _(R20) _(R21) _(R22) _(R23) \\\n  _(R24) _(R25) _(R26) _(R27) _(R28) _(R29) _(R30) _(R31)\n#define FPRDEF(_) \\\n  _(F0) _(F1) _(F2) _(F3) _(F4) _(F5) _(F6) _(F7) \\\n  _(F8) _(F9) _(F10) _(F11) _(F12) _(F13) _(F14) _(F15) \\\n  _(F16) _(F17) _(F18) _(F19) _(F20) _(F21) _(F22) _(F23) \\\n  _(F24) _(F25) _(F26) _(F27) _(F28) _(F29) _(F30) _(F31)\n#define VRIDDEF(_)\n\n#define RIDENUM(name)\tRID_##name,\n\nenum {\n  GPRDEF(RIDENUM)\t\t/* General-purpose registers (GPRs). */\n  FPRDEF(RIDENUM)\t\t/* Floating-point registers (FPRs). */\n  RID_MAX,\n  RID_TMP = RID_R0,\n\n  /* Calling conventions. */\n  RID_RET = RID_R3,\n  RID_RETHI = RID_R3,\n  RID_RETLO = RID_R4,\n  RID_FPRET = RID_F1,\n\n  /* These definitions must match with the *.dasc file(s): */\n  RID_BASE = RID_R14,\t\t/* Interpreter BASE. */\n  RID_LPC = RID_R16,\t\t/* Interpreter PC. */\n  RID_DISPATCH = RID_R17,\t/* Interpreter DISPATCH table. */\n  RID_LREG = RID_R18,\t\t/* Interpreter L. */\n  RID_JGL = RID_R31,\t\t/* On-trace: global_State + 32768. */\n\n  /* Register ranges [min, max) and number of registers. */\n  RID_MIN_GPR = RID_R0,\n  RID_MAX_GPR = RID_R31+1,\n  RID_MIN_FPR = RID_F0,\n  RID_MAX_FPR = RID_F31+1,\n  RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR,\n  RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR\n};\n\n#define RID_NUM_KREF\t\tRID_NUM_GPR\n#define RID_MIN_KREF\t\tRID_R0\n\n/* -- Register sets ------------------------------------------------------- */\n\n/* Make use of all registers, except TMP, SP, SYS1, SYS2 and JGL. */\n#define RSET_FIXED \\\n  (RID2RSET(RID_TMP)|RID2RSET(RID_SP)|RID2RSET(RID_SYS1)|\\\n   RID2RSET(RID_SYS2)|RID2RSET(RID_JGL))\n#define RSET_GPR\t(RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED)\n#define RSET_FPR\tRSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)\n#define RSET_ALL\t(RSET_GPR|RSET_FPR)\n#define RSET_INIT\tRSET_ALL\n\n#define RSET_SCRATCH_GPR\t(RSET_RANGE(RID_R3, RID_R12+1))\n#define RSET_SCRATCH_FPR\t(RSET_RANGE(RID_F0, RID_F13+1))\n#define RSET_SCRATCH\t\t(RSET_SCRATCH_GPR|RSET_SCRATCH_FPR)\n#define REGARG_FIRSTGPR\t\tRID_R3\n#define REGARG_LASTGPR\t\tRID_R10\n#define REGARG_NUMGPR\t\t8\n#define REGARG_FIRSTFPR\t\tRID_F1\n#define REGARG_LASTFPR\t\tRID_F8\n#define REGARG_NUMFPR\t\t8\n\n/* -- Spill slots --------------------------------------------------------- */\n\n/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs.\n**\n** SPS_FIXED: Available fixed spill slots in interpreter frame.\n** This definition must match with the *.dasc file(s).\n**\n** SPS_FIRST: First spill slot for general use.\n** [sp+12] tmplo word \\\n** [sp+ 8] tmphi word / tmp dword, parameter area for callee\n** [sp+ 4] tmpw, LR of callee\n** [sp+ 0] stack chain\n*/\n#define SPS_FIXED\t7\n#define SPS_FIRST\t4\n\n/* Stack offsets for temporary slots. Used for FP<->int conversions etc. */\n#define SPOFS_TMPW\t4\n#define SPOFS_TMP\t8\n#define SPOFS_TMPHI\t8\n#define SPOFS_TMPLO\t12\n\n#define sps_scale(slot)\t\t(4 * (int32_t)(slot))\n#define sps_align(slot)\t\t(((slot) - SPS_FIXED + 3) & ~3)\n\n/* -- Exit state ---------------------------------------------------------- */\n\n/* This definition must match with the *.dasc file(s). */\ntypedef struct {\n  lua_Number fpr[RID_NUM_FPR];\t/* Floating-point registers. */\n  int32_t gpr[RID_NUM_GPR];\t/* General-purpose registers. */\n  int32_t spill[256];\t\t/* Spill slots. */\n} ExitState;\n\n/* Highest exit + 1 indicates stack check. */\n#define EXITSTATE_CHECKEXIT\t1\n\n/* Return the address of a per-trace exit stub. */\nstatic LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno)\n{\n  while (*p == 0x60000000) p++;  /* Skip PPCI_NOP. */\n  return p + 3 + exitno;\n}\n/* Avoid dependence on lj_jit.h if only including lj_target.h. */\n#define exitstub_trace_addr(T, exitno) \\\n  exitstub_trace_addr_((MCode *)((char *)(T)->mcode + (T)->szmcode), (exitno))\n\n/* -- Instructions -------------------------------------------------------- */\n\n/* Instruction fields. */\n#define PPCF_CC(cc)\t((((cc) & 3) << 16) | (((cc) & 4) << 22))\n#define PPCF_T(r)\t((r) << 21)\n#define PPCF_A(r)\t((r) << 16)\n#define PPCF_B(r)\t((r) << 11)\n#define PPCF_C(r)\t((r) << 6)\n#define PPCF_MB(n)\t((n) << 6)\n#define PPCF_ME(n)\t((n) << 1)\n#define PPCF_Y\t\t0x00200000\n#define PPCF_DOT\t0x00000001\n\ntypedef enum PPCIns {\n  /* Integer instructions. */\n  PPCI_MR = 0x7c000378,\n  PPCI_NOP = 0x60000000,\n\n  PPCI_LI = 0x38000000,\n  PPCI_LIS = 0x3c000000,\n\n  PPCI_ADD = 0x7c000214,\n  PPCI_ADDC = 0x7c000014,\n  PPCI_ADDO = 0x7c000614,\n  PPCI_ADDE = 0x7c000114,\n  PPCI_ADDZE = 0x7c000194,\n  PPCI_ADDME = 0x7c0001d4,\n  PPCI_ADDI = 0x38000000,\n  PPCI_ADDIS = 0x3c000000,\n  PPCI_ADDIC = 0x30000000,\n  PPCI_ADDICDOT = 0x34000000,\n\n  PPCI_SUBF = 0x7c000050,\n  PPCI_SUBFC = 0x7c000010,\n  PPCI_SUBFO = 0x7c000450,\n  PPCI_SUBFE = 0x7c000110,\n  PPCI_SUBFZE = 0x7c000190,\n  PPCI_SUBFME = 0x7c0001d0,\n  PPCI_SUBFIC = 0x20000000,\n\n  PPCI_NEG = 0x7c0000d0,\n\n  PPCI_AND = 0x7c000038,\n  PPCI_ANDC = 0x7c000078,\n  PPCI_NAND = 0x7c0003b8,\n  PPCI_ANDIDOT = 0x70000000,\n  PPCI_ANDISDOT = 0x74000000,\n\n  PPCI_OR = 0x7c000378,\n  PPCI_NOR = 0x7c0000f8,\n  PPCI_ORI = 0x60000000,\n  PPCI_ORIS = 0x64000000,\n\n  PPCI_XOR = 0x7c000278,\n  PPCI_EQV = 0x7c000238,\n  PPCI_XORI = 0x68000000,\n  PPCI_XORIS = 0x6c000000,\n\n  PPCI_CMPW = 0x7c000000,\n  PPCI_CMPLW = 0x7c000040,\n  PPCI_CMPWI = 0x2c000000,\n  PPCI_CMPLWI = 0x28000000,\n\n  PPCI_MULLW = 0x7c0001d6,\n  PPCI_MULLI = 0x1c000000,\n  PPCI_MULLWO = 0x7c0005d6,\n\n  PPCI_EXTSB = 0x7c000774,\n  PPCI_EXTSH = 0x7c000734,\n\n  PPCI_SLW = 0x7c000030,\n  PPCI_SRW = 0x7c000430,\n  PPCI_SRAW = 0x7c000630,\n  PPCI_SRAWI = 0x7c000670,\n\n  PPCI_RLWNM = 0x5c000000,\n  PPCI_RLWINM = 0x54000000,\n  PPCI_RLWIMI = 0x50000000,\n\n  PPCI_B = 0x48000000,\n  PPCI_BL = 0x48000001,\n  PPCI_BC = 0x40800000,\n  PPCI_BCL = 0x40800001,\n  PPCI_BCTR = 0x4e800420,\n  PPCI_BCTRL = 0x4e800421,\n\n  PPCI_CRANDC = 0x4c000102,\n  PPCI_CRXOR = 0x4c000182,\n  PPCI_CRAND = 0x4c000202,\n  PPCI_CREQV = 0x4c000242,\n  PPCI_CRORC = 0x4c000342,\n  PPCI_CROR = 0x4c000382,\n\n  PPCI_MFLR = 0x7c0802a6,\n  PPCI_MTCTR = 0x7c0903a6,\n\n  PPCI_MCRXR = 0x7c000400,\n\n  /* Load/store instructions. */\n  PPCI_LWZ = 0x80000000,\n  PPCI_LBZ = 0x88000000,\n  PPCI_STW = 0x90000000,\n  PPCI_STB = 0x98000000,\n  PPCI_LHZ = 0xa0000000,\n  PPCI_LHA = 0xa8000000,\n  PPCI_STH = 0xb0000000,\n\n  PPCI_STWU = 0x94000000,\n\n  PPCI_LFS = 0xc0000000,\n  PPCI_LFD = 0xc8000000,\n  PPCI_STFS = 0xd0000000,\n  PPCI_STFD = 0xd8000000,\n\n  PPCI_LWZX = 0x7c00002e,\n  PPCI_LBZX = 0x7c0000ae,\n  PPCI_STWX = 0x7c00012e,\n  PPCI_STBX = 0x7c0001ae,\n  PPCI_LHZX = 0x7c00022e,\n  PPCI_LHAX = 0x7c0002ae,\n  PPCI_STHX = 0x7c00032e,\n\n  PPCI_LWBRX = 0x7c00042c,\n  PPCI_STWBRX = 0x7c00052c,\n\n  PPCI_LFSX = 0x7c00042e,\n  PPCI_LFDX = 0x7c0004ae,\n  PPCI_STFSX = 0x7c00052e,\n  PPCI_STFDX = 0x7c0005ae,\n\n  /* FP instructions. */\n  PPCI_FMR = 0xfc000090,\n  PPCI_FNEG = 0xfc000050,\n  PPCI_FABS = 0xfc000210,\n\n  PPCI_FRSP = 0xfc000018,\n  PPCI_FCTIWZ = 0xfc00001e,\n\n  PPCI_FADD = 0xfc00002a,\n  PPCI_FSUB = 0xfc000028,\n  PPCI_FMUL = 0xfc000032,\n  PPCI_FDIV = 0xfc000024,\n  PPCI_FSQRT = 0xfc00002c,\n\n  PPCI_FMADD = 0xfc00003a,\n  PPCI_FMSUB = 0xfc000038,\n  PPCI_FNMSUB = 0xfc00003c,\n\n  PPCI_FCMPU = 0xfc000000,\n  PPCI_FSEL = 0xfc00002e,\n} PPCIns;\n\ntypedef enum PPCCC {\n  CC_GE, CC_LE, CC_NE, CC_NS, CC_LT, CC_GT, CC_EQ, CC_SO\n} PPCCC;\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_target_x86.h",
    "content": "/*\n** Definitions for x86 and x64 CPUs.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_TARGET_X86_H\n#define _LJ_TARGET_X86_H\n\n/* -- Registers IDs ------------------------------------------------------- */\n\n#if LJ_64\n#define GPRDEF(_) \\\n  _(EAX) _(ECX) _(EDX) _(EBX) _(ESP) _(EBP) _(ESI) _(EDI) \\\n  _(R8D) _(R9D) _(R10D) _(R11D) _(R12D) _(R13D) _(R14D) _(R15D)\n#define FPRDEF(_) \\\n  _(XMM0) _(XMM1) _(XMM2) _(XMM3) _(XMM4) _(XMM5) _(XMM6) _(XMM7) \\\n  _(XMM8) _(XMM9) _(XMM10) _(XMM11) _(XMM12) _(XMM13) _(XMM14) _(XMM15)\n#else\n#define GPRDEF(_) \\\n  _(EAX) _(ECX) _(EDX) _(EBX) _(ESP) _(EBP) _(ESI) _(EDI)\n#define FPRDEF(_) \\\n  _(XMM0) _(XMM1) _(XMM2) _(XMM3) _(XMM4) _(XMM5) _(XMM6) _(XMM7)\n#endif\n#define VRIDDEF(_) \\\n  _(MRM)\n\n#define RIDENUM(name)\tRID_##name,\n\nenum {\n  GPRDEF(RIDENUM)\t\t/* General-purpose registers (GPRs). */\n  FPRDEF(RIDENUM)\t\t/* Floating-point registers (FPRs). */\n  RID_MAX,\n  RID_MRM = RID_MAX,\t\t/* Pseudo-id for ModRM operand. */\n\n  /* Calling conventions. */\n  RID_RET = RID_EAX,\n#if LJ_64\n  RID_FPRET = RID_XMM0,\n#else\n  RID_RETLO = RID_EAX,\n  RID_RETHI = RID_EDX,\n#endif\n\n  /* These definitions must match with the *.dasc file(s): */\n  RID_BASE = RID_EDX,\t\t/* Interpreter BASE. */\n#if LJ_64 && !LJ_ABI_WIN\n  RID_LPC = RID_EBX,\t\t/* Interpreter PC. */\n  RID_DISPATCH = RID_R14D,\t/* Interpreter DISPATCH table. */\n#else\n  RID_LPC = RID_ESI,\t\t/* Interpreter PC. */\n  RID_DISPATCH = RID_EBX,\t/* Interpreter DISPATCH table. */\n#endif\n\n  /* Register ranges [min, max) and number of registers. */\n  RID_MIN_GPR = RID_EAX,\n  RID_MIN_FPR = RID_XMM0,\n  RID_MAX_GPR = RID_MIN_FPR,\n  RID_MAX_FPR = RID_MAX,\n  RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR,\n  RID_NUM_FPR = RID_MAX_FPR - RID_MIN_FPR,\n};\n\n/* -- Register sets ------------------------------------------------------- */\n\n/* Make use of all registers, except the stack pointer. */\n#define RSET_GPR\t(RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR)-RID2RSET(RID_ESP))\n#define RSET_FPR\t(RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR))\n#define RSET_ALL\t(RSET_GPR|RSET_FPR)\n#define RSET_INIT\tRSET_ALL\n\n#if LJ_64\n/* Note: this requires the use of FORCE_REX! */\n#define RSET_GPR8\tRSET_GPR\n#else\n#define RSET_GPR8\t(RSET_RANGE(RID_EAX, RID_EBX+1))\n#endif\n\n/* ABI-specific register sets. */\n#define RSET_ACD\t(RID2RSET(RID_EAX)|RID2RSET(RID_ECX)|RID2RSET(RID_EDX))\n#if LJ_64\n#if LJ_ABI_WIN\n/* Windows x64 ABI. */\n#define RSET_SCRATCH \\\n  (RSET_ACD|RSET_RANGE(RID_R8D, RID_R11D+1)|RSET_RANGE(RID_XMM0, RID_XMM5+1))\n#define REGARG_GPRS \\\n  (RID_ECX|((RID_EDX|((RID_R8D|(RID_R9D<<5))<<5))<<5))\n#define REGARG_NUMGPR\t4\n#define REGARG_NUMFPR\t4\n#define REGARG_FIRSTFPR\tRID_XMM0\n#define REGARG_LASTFPR\tRID_XMM3\n#define STACKARG_OFS\t(4*8)\n#else\n/* The rest of the civilized x64 world has a common ABI. */\n#define RSET_SCRATCH \\\n  (RSET_ACD|RSET_RANGE(RID_ESI, RID_R11D+1)|RSET_FPR)\n#define REGARG_GPRS \\\n  (RID_EDI|((RID_ESI|((RID_EDX|((RID_ECX|((RID_R8D|(RID_R9D \\\n   <<5))<<5))<<5))<<5))<<5))\n#define REGARG_NUMGPR\t6\n#define REGARG_NUMFPR\t8\n#define REGARG_FIRSTFPR\tRID_XMM0\n#define REGARG_LASTFPR\tRID_XMM7\n#define STACKARG_OFS\t0\n#endif\n#else\n/* Common x86 ABI. */\n#define RSET_SCRATCH\t(RSET_ACD|RSET_FPR)\n#define REGARG_GPRS\t(RID_ECX|(RID_EDX<<5))  /* Fastcall only. */\n#define REGARG_NUMGPR\t2  /* Fastcall only. */\n#define REGARG_NUMFPR\t0\n#define STACKARG_OFS\t0\n#endif\n\n#if LJ_64\n/* Prefer the low 8 regs of each type to reduce REX prefixes. */\n#undef rset_picktop\n#define rset_picktop(rs)\t(lj_fls(lj_bswap(rs)) ^ 0x18)\n#endif\n\n/* -- Spill slots --------------------------------------------------------- */\n\n/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs.\n**\n** SPS_FIXED: Available fixed spill slots in interpreter frame.\n** This definition must match with the *.dasc file(s).\n**\n** SPS_FIRST: First spill slot for general use. Reserve min. two 32 bit slots.\n*/\n#if LJ_64\n#if LJ_ABI_WIN\n#define SPS_FIXED\t(4*2)\n#define SPS_FIRST\t(4*2)\t/* Don't use callee register save area. */\n#else\n#define SPS_FIXED\t4\n#define SPS_FIRST\t2\n#endif\n#else\n#define SPS_FIXED\t6\n#define SPS_FIRST\t2\n#endif\n\n#define SPOFS_TMP\t0\n\n#define sps_scale(slot)\t\t(4 * (int32_t)(slot))\n#define sps_align(slot)\t\t(((slot) - SPS_FIXED + 3) & ~3)\n\n/* -- Exit state ---------------------------------------------------------- */\n\n/* This definition must match with the *.dasc file(s). */\ntypedef struct {\n  lua_Number fpr[RID_NUM_FPR];\t/* Floating-point registers. */\n  intptr_t gpr[RID_NUM_GPR];\t/* General-purpose registers. */\n  int32_t spill[256];\t\t/* Spill slots. */\n} ExitState;\n\n/* Limited by the range of a short fwd jump (127): (2+2)*(32-1)-2 = 122. */\n#define EXITSTUB_SPACING\t(2+2)\n#define EXITSTUBS_PER_GROUP\t32\n\n/* -- x86 ModRM operand encoding ------------------------------------------ */\n\ntypedef enum {\n  XM_OFS0 = 0x00, XM_OFS8 = 0x40, XM_OFS32 = 0x80, XM_REG = 0xc0,\n  XM_SCALE1 = 0x00, XM_SCALE2 = 0x40, XM_SCALE4 = 0x80, XM_SCALE8 = 0xc0,\n  XM_MASK = 0xc0\n} x86Mode;\n\n/* Structure to hold variable ModRM operand. */\ntypedef struct {\n  int32_t ofs;\t\t/* Offset. */\n  uint8_t base;\t\t/* Base register or RID_NONE. */\n  uint8_t idx;\t\t/* Index register or RID_NONE. */\n  uint8_t scale;\t/* Index scale (XM_SCALE1 .. XM_SCALE8). */\n} x86ModRM;\n\n/* -- Opcodes ------------------------------------------------------------- */\n\n/* Macros to construct variable-length x86 opcodes. -(len+1) is in LSB. */\n#define XO_(o)\t\t((uint32_t)(0x0000fe + (0x##o<<24)))\n#define XO_FPU(a,b)\t((uint32_t)(0x00fd + (0x##a<<16)+(0x##b<<24)))\n#define XO_0f(o)\t((uint32_t)(0x0f00fd + (0x##o<<24)))\n#define XO_66(o)\t((uint32_t)(0x6600fd + (0x##o<<24)))\n#define XO_660f(o)\t((uint32_t)(0x0f66fc + (0x##o<<24)))\n#define XO_f20f(o)\t((uint32_t)(0x0ff2fc + (0x##o<<24)))\n#define XO_f30f(o)\t((uint32_t)(0x0ff3fc + (0x##o<<24)))\n\n/* This list of x86 opcodes is not intended to be complete. Opcodes are only\n** included when needed. Take a look at DynASM or jit.dis_x86 to see the\n** whole mess.\n*/\ntypedef enum {\n  /* Fixed length opcodes. XI_* prefix. */\n  XI_NOP =\t0x90,\n  XI_XCHGa =\t0x90,\n  XI_CALL =\t0xe8,\n  XI_JMP =\t0xe9,\n  XI_JMPs =\t0xeb,\n  XI_PUSH =\t0x50, /* Really 50+r. */\n  XI_JCCs =\t0x70, /* Really 7x. */\n  XI_JCCn =\t0x80, /* Really 0f8x. */\n  XI_LEA =\t0x8d,\n  XI_MOVrib =\t0xb0, /* Really b0+r. */\n  XI_MOVri =\t0xb8, /* Really b8+r. */\n  XI_ARITHib =\t0x80,\n  XI_ARITHi =\t0x81,\n  XI_ARITHi8 =\t0x83,\n  XI_PUSHi8 =\t0x6a,\n  XI_TESTb =\t0x84,\n  XI_TEST =\t0x85,\n  XI_MOVmi =\t0xc7,\n  XI_GROUP5 =\t0xff,\n\n  /* Note: little-endian byte-order! */\n  XI_FLDZ =\t0xeed9,\n  XI_FLD1 =\t0xe8d9,\n  XI_FLDLG2 =\t0xecd9,\n  XI_FLDLN2 =\t0xedd9,\n  XI_FDUP =\t0xc0d9,  /* Really fld st0. */\n  XI_FPOP =\t0xd8dd,  /* Really fstp st0. */\n  XI_FPOP1 =\t0xd9dd,  /* Really fstp st1. */\n  XI_FRNDINT =\t0xfcd9,\n  XI_FSIN =\t0xfed9,\n  XI_FCOS =\t0xffd9,\n  XI_FPTAN =\t0xf2d9,\n  XI_FPATAN =\t0xf3d9,\n  XI_FSCALE =\t0xfdd9,\n  XI_FYL2X =\t0xf1d9,\n\n  /* Variable-length opcodes. XO_* prefix. */\n  XO_MOV =\tXO_(8b),\n  XO_MOVto =\tXO_(89),\n  XO_MOVtow =\tXO_66(89),\n  XO_MOVtob =\tXO_(88),\n  XO_MOVmi =\tXO_(c7),\n  XO_MOVmib =\tXO_(c6),\n  XO_LEA =\tXO_(8d),\n  XO_ARITHib =\tXO_(80),\n  XO_ARITHi =\tXO_(81),\n  XO_ARITHi8 =\tXO_(83),\n  XO_ARITHiw8 =\tXO_66(83),\n  XO_SHIFTi =\tXO_(c1),\n  XO_SHIFT1 =\tXO_(d1),\n  XO_SHIFTcl =\tXO_(d3),\n  XO_IMUL =\tXO_0f(af),\n  XO_IMULi =\tXO_(69),\n  XO_IMULi8 =\tXO_(6b),\n  XO_CMP =\tXO_(3b),\n  XO_TESTb =\tXO_(84),\n  XO_TEST =\tXO_(85),\n  XO_GROUP3b =\tXO_(f6),\n  XO_GROUP3 =\tXO_(f7),\n  XO_GROUP5b =\tXO_(fe),\n  XO_GROUP5 =\tXO_(ff),\n  XO_MOVZXb =\tXO_0f(b6),\n  XO_MOVZXw =\tXO_0f(b7),\n  XO_MOVSXb =\tXO_0f(be),\n  XO_MOVSXw =\tXO_0f(bf),\n  XO_MOVSXd =\tXO_(63),\n  XO_BSWAP =\tXO_0f(c8),\n  XO_CMOV =\tXO_0f(40),\n\n  XO_MOVSD =\tXO_f20f(10),\n  XO_MOVSDto =\tXO_f20f(11),\n  XO_MOVSS =\tXO_f30f(10),\n  XO_MOVSSto =\tXO_f30f(11),\n  XO_MOVLPD =\tXO_660f(12),\n  XO_MOVAPS =\tXO_0f(28),\n  XO_XORPS =\tXO_0f(57),\n  XO_ANDPS =\tXO_0f(54),\n  XO_ADDSD =\tXO_f20f(58),\n  XO_SUBSD =\tXO_f20f(5c),\n  XO_MULSD =\tXO_f20f(59),\n  XO_DIVSD =\tXO_f20f(5e),\n  XO_SQRTSD =\tXO_f20f(51),\n  XO_MINSD =\tXO_f20f(5d),\n  XO_MAXSD =\tXO_f20f(5f),\n  XO_ROUNDSD =\t0x0b3a0ffc,  /* Really 66 0f 3a 0b. See asm_fpmath. */\n  XO_UCOMISD =\tXO_660f(2e),\n  XO_CVTSI2SD =\tXO_f20f(2a),\n  XO_CVTSD2SI =\tXO_f20f(2d),\n  XO_CVTTSD2SI=\tXO_f20f(2c),\n  XO_CVTSI2SS =\tXO_f30f(2a),\n  XO_CVTSS2SI =\tXO_f30f(2d),\n  XO_CVTTSS2SI=\tXO_f30f(2c),\n  XO_CVTSS2SD =\tXO_f30f(5a),\n  XO_CVTSD2SS =\tXO_f20f(5a),\n  XO_ADDSS =\tXO_f30f(58),\n  XO_MOVD =\tXO_660f(6e),\n  XO_MOVDto =\tXO_660f(7e),\n\n  XO_FLDd =\tXO_(d9), XOg_FLDd = 0,\n  XO_FLDq =\tXO_(dd), XOg_FLDq = 0,\n  XO_FILDd =\tXO_(db), XOg_FILDd = 0,\n  XO_FILDq =\tXO_(df), XOg_FILDq = 5,\n  XO_FSTPd =\tXO_(d9), XOg_FSTPd = 3,\n  XO_FSTPq =\tXO_(dd), XOg_FSTPq = 3,\n  XO_FISTPq =\tXO_(df), XOg_FISTPq = 7,\n  XO_FISTTPq =\tXO_(dd), XOg_FISTTPq = 1,\n  XO_FADDq =\tXO_(dc), XOg_FADDq = 0,\n  XO_FLDCW =\tXO_(d9), XOg_FLDCW = 5,\n  XO_FNSTCW =\tXO_(d9), XOg_FNSTCW = 7\n} x86Op;\n\n/* x86 opcode groups. */\ntypedef uint32_t x86Group;\n\n#define XG_(i8, i, g)\t((x86Group)(((i8) << 16) + ((i) << 8) + (g)))\n#define XG_ARITHi(g)\tXG_(XI_ARITHi8, XI_ARITHi, g)\n#define XG_TOXOi(xg)\t((x86Op)(0x000000fe + (((xg)<<16) & 0xff000000)))\n#define XG_TOXOi8(xg)\t((x86Op)(0x000000fe + (((xg)<<8) & 0xff000000)))\n\n#define XO_ARITH(a)\t((x86Op)(0x030000fe + ((a)<<27)))\n#define XO_ARITHw(a)\t((x86Op)(0x036600fd + ((a)<<27)))\n\ntypedef enum {\n  XOg_ADD, XOg_OR, XOg_ADC, XOg_SBB, XOg_AND, XOg_SUB, XOg_XOR, XOg_CMP,\n  XOg_X_IMUL\n} x86Arith;\n\ntypedef enum {\n  XOg_ROL, XOg_ROR, XOg_RCL, XOg_RCR, XOg_SHL, XOg_SHR, XOg_SAL, XOg_SAR\n} x86Shift;\n\ntypedef enum {\n  XOg_TEST, XOg_TEST_, XOg_NOT, XOg_NEG, XOg_MUL, XOg_IMUL, XOg_DIV, XOg_IDIV\n} x86Group3;\n\ntypedef enum {\n  XOg_INC, XOg_DEC, XOg_CALL, XOg_CALLfar, XOg_JMP, XOg_JMPfar, XOg_PUSH\n} x86Group5;\n\n/* x86 condition codes. */\ntypedef enum {\n  CC_O, CC_NO, CC_B, CC_NB, CC_E, CC_NE, CC_BE, CC_NBE,\n  CC_S, CC_NS, CC_P, CC_NP, CC_L, CC_NL, CC_LE, CC_NLE,\n  CC_C = CC_B, CC_NAE = CC_C, CC_NC = CC_NB, CC_AE = CC_NB,\n  CC_Z = CC_E, CC_NZ = CC_NE, CC_NA = CC_BE, CC_A = CC_NBE,\n  CC_PE = CC_P, CC_PO = CC_NP, CC_NGE = CC_L, CC_GE = CC_NL,\n  CC_NG = CC_LE, CC_G = CC_NLE\n} x86CC;\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_trace.c",
    "content": "/*\n** Trace management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_trace_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n\n#include \"lj_gc.h\"\n#include \"lj_err.h\"\n#include \"lj_debug.h\"\n#include \"lj_str.h\"\n#include \"lj_frame.h\"\n#include \"lj_state.h\"\n#include \"lj_bc.h\"\n#include \"lj_ir.h\"\n#include \"lj_jit.h\"\n#include \"lj_iropt.h\"\n#include \"lj_mcode.h\"\n#include \"lj_trace.h\"\n#include \"lj_snap.h\"\n#include \"lj_gdbjit.h\"\n#include \"lj_record.h\"\n#include \"lj_asm.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"lj_vmevent.h\"\n#include \"lj_target.h\"\n\n/* -- Error handling ------------------------------------------------------ */\n\n/* Synchronous abort with error message. */\nvoid lj_trace_err(jit_State *J, TraceError e)\n{\n  setnilV(&J->errinfo);  /* No error info. */\n  setintV(J->L->top++, (int32_t)e);\n  lj_err_throw(J->L, LUA_ERRRUN);\n}\n\n/* Synchronous abort with error message and error info. */\nvoid lj_trace_err_info(jit_State *J, TraceError e)\n{\n  setintV(J->L->top++, (int32_t)e);\n  lj_err_throw(J->L, LUA_ERRRUN);\n}\n\n/* -- Trace management ---------------------------------------------------- */\n\n/* The current trace is first assembled in J->cur. The variable length\n** arrays point to shared, growable buffers (J->irbuf etc.). When trace\n** recording ends successfully, the current trace and its data structures\n** are copied to a new (compact) GCtrace object.\n*/\n\n/* Find a free trace number. */\nstatic TraceNo trace_findfree(jit_State *J)\n{\n  MSize osz, lim;\n  if (J->freetrace == 0)\n    J->freetrace = 1;\n  for (; J->freetrace < J->sizetrace; J->freetrace++)\n    if (traceref(J, J->freetrace) == NULL)\n      return J->freetrace++;\n  /* Need to grow trace array. */\n  lim = (MSize)J->param[JIT_P_maxtrace] + 1;\n  if (lim < 2) lim = 2; else if (lim > 65535) lim = 65535;\n  osz = J->sizetrace;\n  if (osz >= lim)\n    return 0;  /* Too many traces. */\n  lj_mem_growvec(J->L, J->trace, J->sizetrace, lim, GCRef);\n  for (; osz < J->sizetrace; osz++)\n    setgcrefnull(J->trace[osz]);\n  return J->freetrace;\n}\n\n#define TRACE_APPENDVEC(field, szfield, tp) \\\n  T->field = (tp *)p; \\\n  memcpy(p, J->cur.field, J->cur.szfield*sizeof(tp)); \\\n  p += J->cur.szfield*sizeof(tp);\n\n#ifdef LUAJIT_USE_PERFTOOLS\n/*\n** Create symbol table of JIT-compiled code. For use with Linux perf tools.\n** Example usage:\n**   perf record -f -e cycles luajit test.lua\n**   perf report -s symbol\n**   rm perf.data /tmp/perf-*.map\n*/\n#include <stdio.h>\n#include <unistd.h>\n\nstatic void perftools_addtrace(GCtrace *T)\n{\n  static FILE *fp;\n  GCproto *pt = &gcref(T->startpt)->pt;\n  const BCIns *startpc = mref(T->startpc, const BCIns);\n  const char *name = proto_chunknamestr(pt);\n  BCLine lineno;\n  if (name[0] == '@' || name[0] == '=')\n    name++;\n  else\n    name = \"(string)\";\n  lua_assert(startpc >= proto_bc(pt) && startpc < proto_bc(pt) + pt->sizebc);\n  lineno = lj_debug_line(pt, proto_bcpos(pt, startpc));\n  if (!fp) {\n    char fname[40];\n    sprintf(fname, \"/tmp/perf-%d.map\", getpid());\n    if (!(fp = fopen(fname, \"w\"))) return;\n    setlinebuf(fp);\n  }\n  fprintf(fp, \"%lx %x TRACE_%d::%s:%u\\n\",\n\t  (long)T->mcode, T->szmcode, T->traceno, name, lineno);\n}\n#endif\n\n/* Save current trace by copying and compacting it. */\nstatic void trace_save(jit_State *J)\n{\n  size_t sztr = ((sizeof(GCtrace)+7)&~7);\n  size_t szins = (J->cur.nins-J->cur.nk)*sizeof(IRIns);\n  size_t sz = sztr + szins +\n\t      J->cur.nsnap*sizeof(SnapShot) +\n\t      J->cur.nsnapmap*sizeof(SnapEntry);\n  GCtrace *T = lj_mem_newt(J->L, (MSize)sz, GCtrace);\n  char *p = (char *)T + sztr;\n  memcpy(T, &J->cur, sizeof(GCtrace));\n  setgcrefr(T->nextgc, J2G(J)->gc.root);\n  setgcrefp(J2G(J)->gc.root, T);\n  newwhite(J2G(J), T);\n  T->gct = ~LJ_TTRACE;\n  T->ir = (IRIns *)p - J->cur.nk;\n  memcpy(p, J->cur.ir+J->cur.nk, szins);\n  p += szins;\n  TRACE_APPENDVEC(snap, nsnap, SnapShot)\n  TRACE_APPENDVEC(snapmap, nsnapmap, SnapEntry)\n  J->cur.traceno = 0;\n  setgcrefp(J->trace[T->traceno], T);\n  lj_gc_barriertrace(J2G(J), T->traceno);\n  lj_gdbjit_addtrace(J, T);\n#ifdef LUAJIT_USE_PERFTOOLS\n  perftools_addtrace(T);\n#endif\n}\n\nvoid LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T)\n{\n  jit_State *J = G2J(g);\n  if (T->traceno) {\n    lj_gdbjit_deltrace(J, T);\n    if (T->traceno < J->freetrace)\n      J->freetrace = T->traceno;\n    setgcrefnull(J->trace[T->traceno]);\n  }\n  lj_mem_free(g, T,\n    ((sizeof(GCtrace)+7)&~7) + (T->nins-T->nk)*sizeof(IRIns) +\n    T->nsnap*sizeof(SnapShot) + T->nsnapmap*sizeof(SnapEntry));\n}\n\n/* Re-enable compiling a prototype by unpatching any modified bytecode. */\nvoid lj_trace_reenableproto(GCproto *pt)\n{\n  if ((pt->flags & PROTO_ILOOP)) {\n    BCIns *bc = proto_bc(pt);\n    BCPos i, sizebc = pt->sizebc;;\n    pt->flags &= ~PROTO_ILOOP;\n    if (bc_op(bc[0]) == BC_IFUNCF)\n      setbc_op(&bc[0], BC_FUNCF);\n    for (i = 1; i < sizebc; i++) {\n      BCOp op = bc_op(bc[i]);\n      if (op == BC_IFORL || op == BC_IITERL || op == BC_ILOOP)\n\tsetbc_op(&bc[i], (int)op+(int)BC_LOOP-(int)BC_ILOOP);\n    }\n  }\n}\n\n/* Unpatch the bytecode modified by a root trace. */\nstatic void trace_unpatch(jit_State *J, GCtrace *T)\n{\n  BCOp op = bc_op(T->startins);\n  BCIns *pc = mref(T->startpc, BCIns);\n  UNUSED(J);\n  if (op == BC_JMP)\n    return;  /* No need to unpatch branches in parent traces (yet). */\n  switch (bc_op(*pc)) {\n  case BC_JFORL:\n    lua_assert(traceref(J, bc_d(*pc)) == T);\n    *pc = T->startins;\n    pc += bc_j(T->startins);\n    lua_assert(bc_op(*pc) == BC_JFORI);\n    setbc_op(pc, BC_FORI);\n    break;\n  case BC_JITERL:\n  case BC_JLOOP:\n    lua_assert(op == BC_ITERL || op == BC_LOOP || bc_isret(op));\n    *pc = T->startins;\n    break;\n  case BC_JMP:\n    lua_assert(op == BC_ITERL);\n    pc += bc_j(*pc)+2;\n    if (bc_op(*pc) == BC_JITERL) {\n      lua_assert(traceref(J, bc_d(*pc)) == T);\n      *pc = T->startins;\n    }\n    break;\n  case BC_JFUNCF:\n    lua_assert(op == BC_FUNCF);\n    *pc = T->startins;\n    break;\n  default:  /* Already unpatched. */\n    break;\n  }\n}\n\n/* Flush a root trace. */\nstatic void trace_flushroot(jit_State *J, GCtrace *T)\n{\n  GCproto *pt = &gcref(T->startpt)->pt;\n  lua_assert(T->root == 0 && pt != NULL);\n  /* First unpatch any modified bytecode. */\n  trace_unpatch(J, T);\n  /* Unlink root trace from chain anchored in prototype. */\n  if (pt->trace == T->traceno) {  /* Trace is first in chain. Easy. */\n    pt->trace = T->nextroot;\n  } else if (pt->trace) {  /* Otherwise search in chain of root traces. */\n    GCtrace *T2 = traceref(J, pt->trace);\n    if (T2) {\n      for (; T2->nextroot; T2 = traceref(J, T2->nextroot))\n\tif (T2->nextroot == T->traceno) {\n\t  T2->nextroot = T->nextroot;  /* Unlink from chain. */\n\t  break;\n\t}\n    }\n  }\n}\n\n/* Flush a trace. Only root traces are considered. */\nvoid lj_trace_flush(jit_State *J, TraceNo traceno)\n{\n  if (traceno > 0 && traceno < J->sizetrace) {\n    GCtrace *T = traceref(J, traceno);\n    if (T && T->root == 0)\n      trace_flushroot(J, T);\n  }\n}\n\n/* Flush all traces associated with a prototype. */\nvoid lj_trace_flushproto(global_State *g, GCproto *pt)\n{\n  while (pt->trace != 0)\n    trace_flushroot(G2J(g), traceref(G2J(g), pt->trace));\n}\n\n/* Flush all traces. */\nint lj_trace_flushall(lua_State *L)\n{\n  jit_State *J = L2J(L);\n  ptrdiff_t i;\n  if ((J2G(J)->hookmask & HOOK_GC))\n    return 1;\n  for (i = (ptrdiff_t)J->sizetrace-1; i > 0; i--) {\n    GCtrace *T = traceref(J, i);\n    if (T) {\n      if (T->root == 0)\n\ttrace_flushroot(J, T);\n      lj_gdbjit_deltrace(J, T);\n      T->traceno = 0;\n      setgcrefnull(J->trace[i]);\n    }\n  }\n  J->cur.traceno = 0;\n  J->freetrace = 0;\n  /* Clear penalty cache. */\n  memset(J->penalty, 0, sizeof(J->penalty));\n  /* Free the whole machine code and invalidate all exit stub groups. */\n  lj_mcode_free(J);\n  memset(J->exitstubgroup, 0, sizeof(J->exitstubgroup));\n  lj_vmevent_send(L, TRACE,\n    setstrV(L, L->top++, lj_str_newlit(L, \"flush\"));\n  );\n  return 0;\n}\n\n/* Initialize JIT compiler state. */\nvoid lj_trace_initstate(global_State *g)\n{\n  jit_State *J = G2J(g);\n  TValue *tv;\n  /* Initialize SIMD constants. */\n  tv = LJ_KSIMD(J, LJ_KSIMD_ABS);\n  tv[0].u64 = U64x(7fffffff,ffffffff);\n  tv[1].u64 = U64x(7fffffff,ffffffff);\n  tv = LJ_KSIMD(J, LJ_KSIMD_NEG);\n  tv[0].u64 = U64x(80000000,00000000);\n  tv[1].u64 = U64x(80000000,00000000);\n}\n\n/* Free everything associated with the JIT compiler state. */\nvoid lj_trace_freestate(global_State *g)\n{\n  jit_State *J = G2J(g);\n#ifdef LUA_USE_ASSERT\n  {  /* This assumes all traces have already been freed. */\n    ptrdiff_t i;\n    for (i = 1; i < (ptrdiff_t)J->sizetrace; i++)\n      lua_assert(i == (ptrdiff_t)J->cur.traceno || traceref(J, i) == NULL);\n  }\n#endif\n  lj_mcode_free(J);\n  lj_ir_k64_freeall(J);\n  lj_mem_freevec(g, J->snapmapbuf, J->sizesnapmap, SnapEntry);\n  lj_mem_freevec(g, J->snapbuf, J->sizesnap, SnapShot);\n  lj_mem_freevec(g, J->irbuf + J->irbotlim, J->irtoplim - J->irbotlim, IRIns);\n  lj_mem_freevec(g, J->trace, J->sizetrace, GCRef);\n}\n\n/* -- Penalties and blacklisting ------------------------------------------ */\n\n/* Blacklist a bytecode instruction. */\nstatic void blacklist_pc(GCproto *pt, BCIns *pc)\n{\n  setbc_op(pc, (int)bc_op(*pc)+(int)BC_ILOOP-(int)BC_LOOP);\n  pt->flags |= PROTO_ILOOP;\n}\n\n/* Penalize a bytecode instruction. */\nstatic void penalty_pc(jit_State *J, GCproto *pt, BCIns *pc, TraceError e)\n{\n  uint32_t i, val = PENALTY_MIN;\n  for (i = 0; i < PENALTY_SLOTS; i++)\n    if (mref(J->penalty[i].pc, const BCIns) == pc) {  /* Cache slot found? */\n      /* First try to bump its hotcount several times. */\n      val = ((uint32_t)J->penalty[i].val << 1) +\n\t    LJ_PRNG_BITS(J, PENALTY_RNDBITS);\n      if (val > PENALTY_MAX) {\n\tblacklist_pc(pt, pc);  /* Blacklist it, if that didn't help. */\n\treturn;\n      }\n      goto setpenalty;\n    }\n  /* Assign a new penalty cache slot. */\n  i = J->penaltyslot;\n  J->penaltyslot = (J->penaltyslot + 1) & (PENALTY_SLOTS-1);\n  setmref(J->penalty[i].pc, pc);\nsetpenalty:\n  J->penalty[i].val = (uint16_t)val;\n  J->penalty[i].reason = e;\n  hotcount_set(J2GG(J), pc+1, val);\n}\n\n/* -- Trace compiler state machine ---------------------------------------- */\n\n/* Start tracing. */\nstatic void trace_start(jit_State *J)\n{\n  lua_State *L;\n  TraceNo traceno;\n\n  if ((J->pt->flags & PROTO_NOJIT)) {  /* JIT disabled for this proto? */\n    if (J->parent == 0) {\n      /* Lazy bytecode patching to disable hotcount events. */\n      lua_assert(bc_op(*J->pc) == BC_FORL || bc_op(*J->pc) == BC_ITERL ||\n\t\t bc_op(*J->pc) == BC_LOOP || bc_op(*J->pc) == BC_FUNCF);\n      setbc_op(J->pc, (int)bc_op(*J->pc)+(int)BC_ILOOP-(int)BC_LOOP);\n      J->pt->flags |= PROTO_ILOOP;\n    }\n    J->state = LJ_TRACE_IDLE;  /* Silently ignored. */\n    return;\n  }\n\n  /* Get a new trace number. */\n  traceno = trace_findfree(J);\n  if (LJ_UNLIKELY(traceno == 0)) {  /* No free trace? */\n    lua_assert((J2G(J)->hookmask & HOOK_GC) == 0);\n    lj_trace_flushall(J->L);\n    J->state = LJ_TRACE_IDLE;  /* Silently ignored. */\n    return;\n  }\n  setgcrefp(J->trace[traceno], &J->cur);\n\n  /* Setup enough of the current trace to be able to send the vmevent. */\n  memset(&J->cur, 0, sizeof(GCtrace));\n  J->cur.traceno = traceno;\n  J->cur.nins = J->cur.nk = REF_BASE;\n  J->cur.ir = J->irbuf;\n  J->cur.snap = J->snapbuf;\n  J->cur.snapmap = J->snapmapbuf;\n  J->mergesnap = 0;\n  J->needsnap = 0;\n  J->bcskip = 0;\n  J->guardemit.irt = 0;\n  J->postproc = LJ_POST_NONE;\n  lj_resetsplit(J);\n  setgcref(J->cur.startpt, obj2gco(J->pt));\n\n  L = J->L;\n  lj_vmevent_send(L, TRACE,\n    setstrV(L, L->top++, lj_str_newlit(L, \"start\"));\n    setintV(L->top++, traceno);\n    setfuncV(L, L->top++, J->fn);\n    setintV(L->top++, proto_bcpos(J->pt, J->pc));\n    if (J->parent) {\n      setintV(L->top++, J->parent);\n      setintV(L->top++, J->exitno);\n    }\n  );\n  lj_record_setup(J);\n}\n\n/* Stop tracing. */\nstatic void trace_stop(jit_State *J)\n{\n  BCIns *pc = mref(J->cur.startpc, BCIns);\n  BCOp op = bc_op(J->cur.startins);\n  GCproto *pt = &gcref(J->cur.startpt)->pt;\n  TraceNo traceno = J->cur.traceno;\n  lua_State *L;\n\n  switch (op) {\n  case BC_FORL:\n    setbc_op(pc+bc_j(J->cur.startins), BC_JFORI);  /* Patch FORI, too. */\n    /* fallthrough */\n  case BC_LOOP:\n  case BC_ITERL:\n  case BC_FUNCF:\n    /* Patch bytecode of starting instruction in root trace. */\n    setbc_op(pc, (int)op+(int)BC_JLOOP-(int)BC_LOOP);\n    setbc_d(pc, traceno);\n  addroot:\n    /* Add to root trace chain in prototype. */\n    J->cur.nextroot = pt->trace;\n    pt->trace = (TraceNo1)traceno;\n    break;\n  case BC_RET:\n  case BC_RET0:\n  case BC_RET1:\n    *pc = BCINS_AD(BC_JLOOP, J->cur.snap[0].nslots, traceno);\n    goto addroot;\n  case BC_JMP:\n    /* Patch exit branch in parent to side trace entry. */\n    lua_assert(J->parent != 0 && J->cur.root != 0);\n    lj_asm_patchexit(J, traceref(J, J->parent), J->exitno, J->cur.mcode);\n    /* Avoid compiling a side trace twice (stack resizing uses parent exit). */\n    traceref(J, J->parent)->snap[J->exitno].count = SNAPCOUNT_DONE;\n    /* Add to side trace chain in root trace. */\n    {\n      GCtrace *root = traceref(J, J->cur.root);\n      root->nchild++;\n      J->cur.nextside = root->nextside;\n      root->nextside = (TraceNo1)traceno;\n    }\n    break;\n  default:\n    lua_assert(0);\n    break;\n  }\n\n  /* Commit new mcode only after all patching is done. */\n  lj_mcode_commit(J, J->cur.mcode);\n  J->postproc = LJ_POST_NONE;\n  trace_save(J);\n\n  L = J->L;\n  lj_vmevent_send(L, TRACE,\n    setstrV(L, L->top++, lj_str_newlit(L, \"stop\"));\n    setintV(L->top++, traceno);\n  );\n}\n\n/* Start a new root trace for down-recursion. */\nstatic int trace_downrec(jit_State *J)\n{\n  /* Restart recording at the return instruction. */\n  lua_assert(J->pt != NULL);\n  lua_assert(bc_isret(bc_op(*J->pc)));\n  if (bc_op(*J->pc) == BC_RETM)\n    return 0;  /* NYI: down-recursion with RETM. */\n  J->parent = 0;\n  J->exitno = 0;\n  J->state = LJ_TRACE_RECORD;\n  trace_start(J);\n  return 1;\n}\n\n/* Abort tracing. */\nstatic int trace_abort(jit_State *J)\n{\n  lua_State *L = J->L;\n  TraceError e = LJ_TRERR_RECERR;\n  TraceNo traceno;\n\n  J->postproc = LJ_POST_NONE;\n  lj_mcode_abort(J);\n  if (tvisnumber(L->top-1))\n    e = (TraceError)numberVint(L->top-1);\n  if (e == LJ_TRERR_MCODELM) {\n    L->top--;  /* Remove error object */\n    J->state = LJ_TRACE_ASM;\n    return 1;  /* Retry ASM with new MCode area. */\n  }\n  /* Penalize or blacklist starting bytecode instruction. */\n  if (J->parent == 0 && !bc_isret(bc_op(J->cur.startins)))\n    penalty_pc(J, &gcref(J->cur.startpt)->pt, mref(J->cur.startpc, BCIns), e);\n\n  /* Is there anything to abort? */\n  traceno = J->cur.traceno;\n  if (traceno) {\n    ptrdiff_t errobj = savestack(L, L->top-1);  /* Stack may be resized. */\n    J->cur.link = 0;\n    J->cur.linktype = LJ_TRLINK_NONE;\n    lj_vmevent_send(L, TRACE,\n      TValue *frame;\n      const BCIns *pc;\n      GCfunc *fn;\n      setstrV(L, L->top++, lj_str_newlit(L, \"abort\"));\n      setintV(L->top++, traceno);\n      /* Find original Lua function call to generate a better error message. */\n      frame = J->L->base-1;\n      pc = J->pc;\n      while (!isluafunc(frame_func(frame))) {\n\tpc = (frame_iscont(frame) ? frame_contpc(frame) : frame_pc(frame)) - 1;\n\tframe = frame_prev(frame);\n      }\n      fn = frame_func(frame);\n      setfuncV(L, L->top++, fn);\n      setintV(L->top++, proto_bcpos(funcproto(fn), pc));\n      copyTV(L, L->top++, restorestack(L, errobj));\n      copyTV(L, L->top++, &J->errinfo);\n    );\n    /* Drop aborted trace after the vmevent (which may still access it). */\n    setgcrefnull(J->trace[traceno]);\n    if (traceno < J->freetrace)\n      J->freetrace = traceno;\n    J->cur.traceno = 0;\n  }\n  L->top--;  /* Remove error object */\n  if (e == LJ_TRERR_DOWNREC)\n    return trace_downrec(J);\n  else if (e == LJ_TRERR_MCODEAL)\n    lj_trace_flushall(L);\n  return 0;\n}\n\n/* Perform pending re-patch of a bytecode instruction. */\nstatic LJ_AINLINE void trace_pendpatch(jit_State *J, int force)\n{\n  if (LJ_UNLIKELY(J->patchpc)) {\n    if (force || J->bcskip == 0) {\n      *J->patchpc = J->patchins;\n      J->patchpc = NULL;\n    } else {\n      J->bcskip = 0;\n    }\n  }\n}\n\n/* State machine for the trace compiler. Protected callback. */\nstatic TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  jit_State *J = (jit_State *)ud;\n  UNUSED(dummy);\n  do {\n  retry:\n    switch (J->state) {\n    case LJ_TRACE_START:\n      J->state = LJ_TRACE_RECORD;  /* trace_start() may change state. */\n      trace_start(J);\n      lj_dispatch_update(J2G(J));\n      break;\n\n    case LJ_TRACE_RECORD:\n      trace_pendpatch(J, 0);\n      setvmstate(J2G(J), RECORD);\n      lj_vmevent_send_(L, RECORD,\n\t/* Save/restore tmptv state for trace recorder. */\n\tTValue savetv = J2G(J)->tmptv;\n\tTValue savetv2 = J2G(J)->tmptv2;\n\tsetintV(L->top++, J->cur.traceno);\n\tsetfuncV(L, L->top++, J->fn);\n\tsetintV(L->top++, J->pt ? (int32_t)proto_bcpos(J->pt, J->pc) : -1);\n\tsetintV(L->top++, J->framedepth);\n      ,\n\tJ2G(J)->tmptv = savetv;\n\tJ2G(J)->tmptv2 = savetv2;\n      );\n      lj_record_ins(J);\n      break;\n\n    case LJ_TRACE_END:\n      trace_pendpatch(J, 1);\n      J->loopref = 0;\n      if ((J->flags & JIT_F_OPT_LOOP) &&\n\t  J->cur.link == J->cur.traceno && J->framedepth + J->retdepth == 0) {\n\tsetvmstate(J2G(J), OPT);\n\tlj_opt_dce(J);\n\tif (lj_opt_loop(J)) {  /* Loop optimization failed? */\n\t  J->cur.link = 0;\n\t  J->cur.linktype = LJ_TRLINK_NONE;\n\t  J->loopref = J->cur.nins;\n\t  J->state = LJ_TRACE_RECORD;  /* Try to continue recording. */\n\t  break;\n\t}\n\tJ->loopref = J->chain[IR_LOOP];  /* Needed by assembler. */\n      }\n      lj_opt_split(J);\n      lj_opt_sink(J);\n      J->state = LJ_TRACE_ASM;\n      break;\n\n    case LJ_TRACE_ASM:\n      setvmstate(J2G(J), ASM);\n      lj_asm_trace(J, &J->cur);\n      trace_stop(J);\n      setvmstate(J2G(J), INTERP);\n      J->state = LJ_TRACE_IDLE;\n      lj_dispatch_update(J2G(J));\n      return NULL;\n\n    default:  /* Trace aborted asynchronously. */\n      setintV(L->top++, (int32_t)LJ_TRERR_RECERR);\n      /* fallthrough */\n    case LJ_TRACE_ERR:\n      trace_pendpatch(J, 1);\n      if (trace_abort(J))\n\tgoto retry;\n      setvmstate(J2G(J), INTERP);\n      J->state = LJ_TRACE_IDLE;\n      lj_dispatch_update(J2G(J));\n      return NULL;\n    }\n  } while (J->state > LJ_TRACE_RECORD);\n  return NULL;\n}\n\n/* -- Event handling ------------------------------------------------------ */\n\n/* A bytecode instruction is about to be executed. Record it. */\nvoid lj_trace_ins(jit_State *J, const BCIns *pc)\n{\n  /* Note: J->L must already be set. pc is the true bytecode PC here. */\n  J->pc = pc;\n  J->fn = curr_func(J->L);\n  J->pt = isluafunc(J->fn) ? funcproto(J->fn) : NULL;\n  while (lj_vm_cpcall(J->L, NULL, (void *)J, trace_state) != 0)\n    J->state = LJ_TRACE_ERR;\n}\n\n/* A hotcount triggered. Start recording a root trace. */\nvoid LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc)\n{\n  /* Note: pc is the interpreter bytecode PC here. It's offset by 1. */\n  ERRNO_SAVE\n  /* Reset hotcount. */\n  hotcount_set(J2GG(J), pc, J->param[JIT_P_hotloop]*HOTCOUNT_LOOP);\n  /* Only start a new trace if not recording or inside __gc call or vmevent. */\n  if (J->state == LJ_TRACE_IDLE &&\n      !(J2G(J)->hookmask & (HOOK_GC|HOOK_VMEVENT))) {\n    J->parent = 0;  /* Root trace. */\n    J->exitno = 0;\n    J->state = LJ_TRACE_START;\n    lj_trace_ins(J, pc-1);\n  }\n  ERRNO_RESTORE\n}\n\n/* Check for a hot side exit. If yes, start recording a side trace. */\nstatic void trace_hotside(jit_State *J, const BCIns *pc)\n{\n  SnapShot *snap = &traceref(J, J->parent)->snap[J->exitno];\n  if (!(J2G(J)->hookmask & (HOOK_GC|HOOK_VMEVENT)) &&\n      snap->count != SNAPCOUNT_DONE &&\n      ++snap->count >= J->param[JIT_P_hotexit]) {\n    lua_assert(J->state == LJ_TRACE_IDLE);\n    /* J->parent is non-zero for a side trace. */\n    J->state = LJ_TRACE_START;\n    lj_trace_ins(J, pc);\n  }\n}\n\n/* Tiny struct to pass data to protected call. */\ntypedef struct ExitDataCP {\n  jit_State *J;\n  void *exptr;\t\t/* Pointer to exit state. */\n  const BCIns *pc;\t/* Restart interpreter at this PC. */\n} ExitDataCP;\n\n/* Need to protect lj_snap_restore because it may throw. */\nstatic TValue *trace_exit_cp(lua_State *L, lua_CFunction dummy, void *ud)\n{\n  ExitDataCP *exd = (ExitDataCP *)ud;\n  cframe_errfunc(L->cframe) = -1;  /* Inherit error function. */\n  exd->pc = lj_snap_restore(exd->J, exd->exptr);\n  UNUSED(dummy);\n  return NULL;\n}\n\n#ifndef LUAJIT_DISABLE_VMEVENT\n/* Push all registers from exit state. */\nstatic void trace_exit_regs(lua_State *L, ExitState *ex)\n{\n  int32_t i;\n  setintV(L->top++, RID_NUM_GPR);\n  setintV(L->top++, RID_NUM_FPR);\n  for (i = 0; i < RID_NUM_GPR; i++) {\n    if (sizeof(ex->gpr[i]) == sizeof(int32_t))\n      setintV(L->top++, (int32_t)ex->gpr[i]);\n    else\n      setnumV(L->top++, (lua_Number)ex->gpr[i]);\n  }\n#if !LJ_SOFTFP\n  for (i = 0; i < RID_NUM_FPR; i++) {\n    setnumV(L->top, ex->fpr[i]);\n    if (LJ_UNLIKELY(tvisnan(L->top)))\n      setnanV(L->top);\n    L->top++;\n  }\n#endif\n}\n#endif\n\n#ifdef EXITSTATE_PCREG\n/* Determine trace number from pc of exit instruction. */\nstatic TraceNo trace_exit_find(jit_State *J, MCode *pc)\n{\n  TraceNo traceno;\n  for (traceno = 1; traceno < J->sizetrace; traceno++) {\n    GCtrace *T = traceref(J, traceno);\n    if (T && pc >= T->mcode && pc < (MCode *)((char *)T->mcode + T->szmcode))\n      return traceno;\n  }\n  lua_assert(0);\n  return 0;\n}\n#endif\n\n/* A trace exited. Restore interpreter state. */\nint LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)\n{\n  ERRNO_SAVE\n  lua_State *L = J->L;\n  ExitState *ex = (ExitState *)exptr;\n  ExitDataCP exd;\n  int errcode;\n  const BCIns *pc;\n  void *cf;\n  GCtrace *T;\n#ifdef EXITSTATE_PCREG\n  J->parent = trace_exit_find(J, (MCode *)(intptr_t)ex->gpr[EXITSTATE_PCREG]);\n#endif\n  T = traceref(J, J->parent); UNUSED(T);\n#ifdef EXITSTATE_CHECKEXIT\n  if (J->exitno == T->nsnap) {  /* Treat stack check like a parent exit. */\n    lua_assert(T->root != 0);\n    J->exitno = T->ir[REF_BASE].op2;\n    J->parent = T->ir[REF_BASE].op1;\n    T = traceref(J, J->parent);\n  }\n#endif\n  lua_assert(T != NULL && J->exitno < T->nsnap);\n  exd.J = J;\n  exd.exptr = exptr;\n  errcode = lj_vm_cpcall(L, NULL, &exd, trace_exit_cp);\n  if (errcode)\n    return -errcode;  /* Return negated error code. */\n\n  lj_vmevent_send(L, TEXIT,\n    lj_state_checkstack(L, 4+RID_NUM_GPR+RID_NUM_FPR+LUA_MINSTACK);\n    setintV(L->top++, J->parent);\n    setintV(L->top++, J->exitno);\n    trace_exit_regs(L, ex);\n  );\n\n  pc = exd.pc;\n  cf = cframe_raw(L->cframe);\n  setcframe_pc(cf, pc);\n  if (G(L)->gc.state == GCSatomic || G(L)->gc.state == GCSfinalize) {\n    if (!(G(L)->hookmask & HOOK_GC))\n      lj_gc_step(L);  /* Exited because of GC: drive GC forward. */\n  } else {\n    trace_hotside(J, pc);\n  }\n  if (bc_op(*pc) == BC_JLOOP) {\n    BCIns *retpc = &traceref(J, bc_d(*pc))->startins;\n    if (bc_isret(bc_op(*retpc))) {\n      if (J->state == LJ_TRACE_RECORD) {\n\tJ->patchins = *pc;\n\tJ->patchpc = (BCIns *)pc;\n\t*J->patchpc = *retpc;\n\tJ->bcskip = 1;\n      } else {\n\tpc = retpc;\n\tsetcframe_pc(cf, pc);\n      }\n    }\n  }\n  /* Return MULTRES or 0. */\n  ERRNO_RESTORE\n  switch (bc_op(*pc)) {\n  case BC_CALLM: case BC_CALLMT:\n    return (int)((BCReg)(L->top - L->base) - bc_a(*pc) - bc_c(*pc));\n  case BC_RETM:\n    return (int)((BCReg)(L->top - L->base) + 1 - bc_a(*pc) - bc_d(*pc));\n  case BC_TSETM:\n    return (int)((BCReg)(L->top - L->base) + 1 - bc_a(*pc));\n  default:\n    if (bc_op(*pc) >= BC_FUNCF)\n      return (int)((BCReg)(L->top - L->base) + 1);\n    return 0;\n  }\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_trace.h",
    "content": "/*\n** Trace management.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_TRACE_H\n#define _LJ_TRACE_H\n\n#include \"lj_obj.h\"\n\n#if LJ_HASJIT\n#include \"lj_jit.h\"\n#include \"lj_dispatch.h\"\n\n/* Trace errors. */\ntypedef enum {\n#define TREDEF(name, msg)\tLJ_TRERR_##name,\n#include \"lj_traceerr.h\"\n  LJ_TRERR__MAX\n} TraceError;\n\nLJ_FUNC_NORET void lj_trace_err(jit_State *J, TraceError e);\nLJ_FUNC_NORET void lj_trace_err_info(jit_State *J, TraceError e);\n\n/* Trace management. */\nLJ_FUNC void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T);\nLJ_FUNC void lj_trace_reenableproto(GCproto *pt);\nLJ_FUNC void lj_trace_flushproto(global_State *g, GCproto *pt);\nLJ_FUNC void lj_trace_flush(jit_State *J, TraceNo traceno);\nLJ_FUNC int lj_trace_flushall(lua_State *L);\nLJ_FUNC void lj_trace_initstate(global_State *g);\nLJ_FUNC void lj_trace_freestate(global_State *g);\n\n/* Event handling. */\nLJ_FUNC void lj_trace_ins(jit_State *J, const BCIns *pc);\nLJ_FUNCA void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc);\nLJ_FUNCA int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr);\n\n/* Signal asynchronous abort of trace or end of trace. */\n#define lj_trace_abort(g)\t(G2J(g)->state &= ~LJ_TRACE_ACTIVE)\n#define lj_trace_end(J)\t\t(J->state = LJ_TRACE_END)\n\n#else\n\n#define lj_trace_flushall(L)\t(UNUSED(L), 0)\n#define lj_trace_initstate(g)\tUNUSED(g)\n#define lj_trace_freestate(g)\tUNUSED(g)\n#define lj_trace_abort(g)\tUNUSED(g)\n#define lj_trace_end(J)\t\tUNUSED(J)\n\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_traceerr.h",
    "content": "/*\n** Trace compiler error messages.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/* This file may be included multiple times with different TREDEF macros. */\n\n/* Recording. */\nTREDEF(RECERR,\t\"error thrown or hook called during recording\")\nTREDEF(TRACEOV,\t\"trace too long\")\nTREDEF(STACKOV,\t\"trace too deep\")\nTREDEF(SNAPOV,\t\"too many snapshots\")\nTREDEF(BLACKL,\t\"blacklisted\")\nTREDEF(NYIBC,\t\"NYI: bytecode %d\")\n\n/* Recording loop ops. */\nTREDEF(LLEAVE,\t\"leaving loop in root trace\")\nTREDEF(LINNER,\t\"inner loop in root trace\")\nTREDEF(LUNROLL,\t\"loop unroll limit reached\")\n\n/* Recording calls/returns. */\nTREDEF(BADTYPE,\t\"bad argument type\")\nTREDEF(CJITOFF,\t\"call to JIT-disabled function\")\nTREDEF(CUNROLL,\t\"call unroll limit reached\")\nTREDEF(DOWNREC,\t\"down-recursion, restarting\")\nTREDEF(NYICF,\t\"NYI: C function %p\")\nTREDEF(NYIFF,\t\"NYI: FastFunc %s\")\nTREDEF(NYIFFU,\t\"NYI: unsupported variant of FastFunc %s\")\nTREDEF(NYIRETL,\t\"NYI: return to lower frame\")\n\n/* Recording indexed load/store. */\nTREDEF(STORENN,\t\"store with nil or NaN key\")\nTREDEF(NOMM,\t\"missing metamethod\")\nTREDEF(IDXLOOP,\t\"looping index lookup\")\nTREDEF(NYITMIX,\t\"NYI: mixed sparse/dense table\")\n\n/* Recording C data operations. */\nTREDEF(NOCACHE,\t\"symbol not in cache\")\nTREDEF(NYICONV,\t\"NYI: unsupported C type conversion\")\nTREDEF(NYICALL,\t\"NYI: unsupported C function type\")\n\n/* Optimizations. */\nTREDEF(GFAIL,\t\"guard would always fail\")\nTREDEF(PHIOV,\t\"too many PHIs\")\nTREDEF(TYPEINS,\t\"persistent type instability\")\n\n/* Assembler. */\nTREDEF(MCODEAL,\t\"failed to allocate mcode memory\")\nTREDEF(MCODEOV,\t\"machine code too long\")\nTREDEF(MCODELM,\t\"hit mcode limit (retrying)\")\nTREDEF(SPILLOV,\t\"too many spill slots\")\nTREDEF(BADRA,\t\"inconsistent register allocation\")\nTREDEF(NYIIR,\t\"NYI: cannot assemble IR instruction %d\")\nTREDEF(NYIPHI,\t\"NYI: PHI shuffling too complex\")\nTREDEF(NYICOAL,\t\"NYI: register coalescing too complex\")\n\n#undef TREDEF\n\n/* Detecting unused error messages:\n   awk -F, '/^TREDEF/ { gsub(/TREDEF./, \"\"); printf \"grep -q LJ_TRERR_%s *.[ch] || echo %s\\n\", $1, $1}' lj_traceerr.h | sh\n*/\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_udata.c",
    "content": "/*\n** Userdata handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_udata_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_gc.h\"\n#include \"lj_udata.h\"\n\nGCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env)\n{\n  GCudata *ud = lj_mem_newt(L, sizeof(GCudata) + sz, GCudata);\n  global_State *g = G(L);\n  newwhite(g, ud);  /* Not finalized. */\n  ud->gct = ~LJ_TUDATA;\n  ud->udtype = UDTYPE_USERDATA;\n  ud->len = sz;\n  /* NOBARRIER: The GCudata is new (marked white). */\n  setgcrefnull(ud->metatable);\n  setgcref(ud->env, obj2gco(env));\n  /* Chain to userdata list (after main thread). */\n  setgcrefr(ud->nextgc, mainthread(g)->nextgc);\n  setgcref(mainthread(g)->nextgc, obj2gco(ud));\n  return ud;\n}\n\nvoid LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud)\n{\n  lj_mem_free(g, ud, sizeudata(ud));\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_udata.h",
    "content": "/*\n** Userdata handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_UDATA_H\n#define _LJ_UDATA_H\n\n#include \"lj_obj.h\"\n\nLJ_FUNC GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env);\nLJ_FUNC void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_vm.h",
    "content": "/*\n** Assembler VM interface definitions.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_VM_H\n#define _LJ_VM_H\n\n#include \"lj_obj.h\"\n\n/* Entry points for ASM parts of VM. */\nLJ_ASMF void lj_vm_call(lua_State *L, TValue *base, int nres1);\nLJ_ASMF int lj_vm_pcall(lua_State *L, TValue *base, int nres1, ptrdiff_t ef);\ntypedef TValue *(*lua_CPFunction)(lua_State *L, lua_CFunction func, void *ud);\nLJ_ASMF int lj_vm_cpcall(lua_State *L, lua_CFunction func, void *ud,\n\t\t\t lua_CPFunction cp);\nLJ_ASMF int lj_vm_resume(lua_State *L, TValue *base, int nres1, ptrdiff_t ef);\nLJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_c(void *cframe, int errcode);\nLJ_ASMF_NORET void LJ_FASTCALL lj_vm_unwind_ff(void *cframe);\nLJ_ASMF void lj_vm_unwind_c_eh(void);\nLJ_ASMF void lj_vm_unwind_ff_eh(void);\n#if LJ_TARGET_X86ORX64\nLJ_ASMF void lj_vm_unwind_rethrow(void);\n#endif\n\n/* Miscellaneous functions. */\n#if LJ_TARGET_X86ORX64\nLJ_ASMF int lj_vm_cpuid(uint32_t f, uint32_t res[4]);\n#endif\n#if LJ_TARGET_PPC\nvoid lj_vm_cachesync(void *start, void *end);\n#endif\nLJ_ASMF double lj_vm_foldarith(double x, double y, int op);\n#if LJ_HASJIT\nLJ_ASMF double lj_vm_foldfpm(double x, int op);\n#endif\n#if !LJ_ARCH_HASFPU\n/* Declared in lj_obj.h: LJ_ASMF int32_t lj_vm_tobit(double x); */\n#endif\n\n/* Dispatch targets for recording and hooks. */\nLJ_ASMF void lj_vm_record(void);\nLJ_ASMF void lj_vm_inshook(void);\nLJ_ASMF void lj_vm_rethook(void);\nLJ_ASMF void lj_vm_callhook(void);\n\n/* Trace exit handling. */\nLJ_ASMF void lj_vm_exit_handler(void);\nLJ_ASMF void lj_vm_exit_interp(void);\n\n/* Internal math helper functions. */\n#if LJ_TARGET_X86ORX64 || LJ_TARGET_PPC\n#define lj_vm_floor\tfloor\n#define lj_vm_ceil\tceil\n#else\nLJ_ASMF double lj_vm_floor(double);\nLJ_ASMF double lj_vm_ceil(double);\n#if LJ_TARGET_ARM\nLJ_ASMF double lj_vm_floor_sf(double);\nLJ_ASMF double lj_vm_ceil_sf(double);\n#endif\n#endif\n#if defined(LUAJIT_NO_LOG2) || LJ_TARGET_X86ORX64\nLJ_ASMF double lj_vm_log2(double);\n#else\n#define lj_vm_log2\tlog2\n#endif\n\n#if LJ_HASJIT\n#if LJ_TARGET_X86ORX64\nLJ_ASMF void lj_vm_floor_sse(void);\nLJ_ASMF void lj_vm_ceil_sse(void);\nLJ_ASMF void lj_vm_trunc_sse(void);\nLJ_ASMF void lj_vm_exp_x87(void);\nLJ_ASMF void lj_vm_exp2_x87(void);\nLJ_ASMF void lj_vm_pow_sse(void);\nLJ_ASMF void lj_vm_powi_sse(void);\n#else\n#if LJ_TARGET_PPC\n#define lj_vm_trunc\ttrunc\n#else\nLJ_ASMF double lj_vm_trunc(double);\n#if LJ_TARGET_ARM\nLJ_ASMF double lj_vm_trunc_sf(double);\n#endif\n#endif\nLJ_ASMF double lj_vm_powi(double, int32_t);\n#ifdef LUAJIT_NO_EXP2\nLJ_ASMF double lj_vm_exp2(double);\n#else\n#define lj_vm_exp2\texp2\n#endif\n#endif\nLJ_ASMF int32_t LJ_FASTCALL lj_vm_modi(int32_t, int32_t);\n#if LJ_HASFFI\nLJ_ASMF int lj_vm_errno(void);\n#endif\n#endif\n\n/* Continuations for metamethods. */\nLJ_ASMF void lj_cont_cat(void);  /* Continue with concatenation. */\nLJ_ASMF void lj_cont_ra(void);  /* Store result in RA from instruction. */\nLJ_ASMF void lj_cont_nop(void);  /* Do nothing, just continue execution. */\nLJ_ASMF void lj_cont_condt(void);  /* Branch if result is true. */\nLJ_ASMF void lj_cont_condf(void);  /* Branch if result is false. */\nLJ_ASMF void lj_cont_hook(void);  /* Continue from hook yield. */\n\nenum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CALLBACK };  /* Special continuations. */\n\n/* Start of the ASM code. */\nLJ_ASMF char lj_vm_asm_begin[];\n\n/* Bytecode offsets are relative to lj_vm_asm_begin. */\n#define makeasmfunc(ofs)\t((ASMFunction)(lj_vm_asm_begin + (ofs)))\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_vmevent.c",
    "content": "/*\n** VM event handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#include <stdio.h>\n\n#define lj_vmevent_c\n#define LUA_CORE\n\n#include \"lj_obj.h\"\n#include \"lj_str.h\"\n#include \"lj_tab.h\"\n#include \"lj_state.h\"\n#include \"lj_dispatch.h\"\n#include \"lj_vm.h\"\n#include \"lj_vmevent.h\"\n\nptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev)\n{\n  global_State *g = G(L);\n  GCstr *s = lj_str_newlit(L, LJ_VMEVENTS_REGKEY);\n  cTValue *tv = lj_tab_getstr(tabV(registry(L)), s);\n  if (tvistab(tv)) {\n    int hash = VMEVENT_HASH(ev);\n    tv = lj_tab_getint(tabV(tv), hash);\n    if (tv && tvisfunc(tv)) {\n      lj_state_checkstack(L, LUA_MINSTACK);\n      setfuncV(L, L->top++, funcV(tv));\n      return savestack(L, L->top);\n    }\n  }\n  g->vmevmask &= ~VMEVENT_MASK(ev);  /* No handler: cache this fact. */\n  return 0;\n}\n\nvoid lj_vmevent_call(lua_State *L, ptrdiff_t argbase)\n{\n  global_State *g = G(L);\n  uint8_t oldmask = g->vmevmask;\n  uint8_t oldh = hook_save(g);\n  int status;\n  g->vmevmask = 0;  /* Disable all events. */\n  hook_vmevent(g);\n  status = lj_vm_pcall(L, restorestack(L, argbase), 0+1, 0);\n  if (LJ_UNLIKELY(status)) {\n    /* Really shouldn't use stderr here, but where else to complain? */\n    L->top--;\n    fputs(\"VM handler failed: \", stderr);\n    fputs(tvisstr(L->top) ? strVdata(L->top) : \"?\", stderr);\n    fputc('\\n', stderr);\n  }\n  hook_restore(g, oldh);\n  if (g->vmevmask != VMEVENT_NOCACHE)\n    g->vmevmask = oldmask;  /* Restore event mask, but not if not modified. */\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_vmevent.h",
    "content": "/*\n** VM event handling.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LJ_VMEVENT_H\n#define _LJ_VMEVENT_H\n\n#include \"lj_obj.h\"\n\n/* Registry key for VM event handler table. */\n#define LJ_VMEVENTS_REGKEY\t\"_VMEVENTS\"\n#define LJ_VMEVENTS_HSIZE\t4\n\n#define VMEVENT_MASK(ev)\t((uint8_t)1 << ((int)(ev) & 7))\n#define VMEVENT_HASH(ev)\t((int)(ev) & ~7)\n#define VMEVENT_HASHIDX(h)\t((int)(h) << 3)\n#define VMEVENT_NOCACHE\t\t255\n\n#define VMEVENT_DEF(name, hash) \\\n  LJ_VMEVENT_##name##_, \\\n  LJ_VMEVENT_##name = ((LJ_VMEVENT_##name##_) & 7)|((hash) << 3)\n\n/* VM event IDs. */\ntypedef enum {\n  VMEVENT_DEF(BC,\t0x00003883),\n  VMEVENT_DEF(TRACE,\t0xb2d91467),\n  VMEVENT_DEF(RECORD,\t0x9284bf4f),\n  VMEVENT_DEF(TEXIT,\t0xb29df2b0),\n  LJ_VMEVENT__MAX\n} VMEvent;\n\n#ifdef LUAJIT_DISABLE_VMEVENT\n#define lj_vmevent_send(L, ev, args)\t\tUNUSED(L)\n#define lj_vmevent_send_(L, ev, args, post)\tUNUSED(L)\n#else\n#define lj_vmevent_send(L, ev, args) \\\n  if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \\\n    ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \\\n    if (argbase) { \\\n      args \\\n      lj_vmevent_call(L, argbase); \\\n    } \\\n  }\n#define lj_vmevent_send_(L, ev, args, post) \\\n  if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \\\n    ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \\\n    if (argbase) { \\\n      args \\\n      lj_vmevent_call(L, argbase); \\\n      post \\\n    } \\\n  }\n\nLJ_FUNC ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev);\nLJ_FUNC void lj_vmevent_call(lua_State *L, ptrdiff_t argbase);\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lj_vmmath.c",
    "content": "/*\n** Math helper functions for assembler VM.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#define lj_vmmath_c\n#define LUA_CORE\n\n#include <errno.h>\n#include <math.h>\n\n#include \"lj_obj.h\"\n#include \"lj_ir.h\"\n#include \"lj_vm.h\"\n\n/* -- Helper functions for generated machine code ------------------------- */\n\n#if LJ_TARGET_X86ORX64\n/* Wrapper functions to avoid linker issues on OSX. */\nLJ_FUNCA double lj_vm_sinh(double x) { return sinh(x); }\nLJ_FUNCA double lj_vm_cosh(double x) { return cosh(x); }\nLJ_FUNCA double lj_vm_tanh(double x) { return tanh(x); }\n#endif\n\n#if !LJ_TARGET_X86ORX64\ndouble lj_vm_foldarith(double x, double y, int op)\n{\n  switch (op) {\n  case IR_ADD - IR_ADD: return x+y; break;\n  case IR_SUB - IR_ADD: return x-y; break;\n  case IR_MUL - IR_ADD: return x*y; break;\n  case IR_DIV - IR_ADD: return x/y; break;\n  case IR_MOD - IR_ADD: return x-lj_vm_floor(x/y)*y; break;\n  case IR_POW - IR_ADD: return pow(x, y); break;\n  case IR_NEG - IR_ADD: return -x; break;\n  case IR_ABS - IR_ADD: return fabs(x); break;\n#if LJ_HASJIT\n  case IR_ATAN2 - IR_ADD: return atan2(x, y); break;\n  case IR_LDEXP - IR_ADD: return ldexp(x, (int)y); break;\n  case IR_MIN - IR_ADD: return x > y ? y : x; break;\n  case IR_MAX - IR_ADD: return x < y ? y : x; break;\n#endif\n  default: return x;\n  }\n}\n#endif\n\n#if LJ_HASJIT\n\n#ifdef LUAJIT_NO_LOG2\ndouble lj_vm_log2(double a)\n{\n  return log(a) * 1.4426950408889634074;\n}\n#endif\n\n#ifdef LUAJIT_NO_EXP2\ndouble lj_vm_exp2(double a)\n{\n  return exp(a * 0.6931471805599453);\n}\n#endif\n\n#if !(LJ_TARGET_ARM || LJ_TARGET_PPC)\nint32_t LJ_FASTCALL lj_vm_modi(int32_t a, int32_t b)\n{\n  uint32_t y, ua, ub;\n  lua_assert(b != 0);  /* This must be checked before using this function. */\n  ua = a < 0 ? (uint32_t)-a : (uint32_t)a;\n  ub = b < 0 ? (uint32_t)-b : (uint32_t)b;\n  y = ua % ub;\n  if (y != 0 && (a^b) < 0) y = y - ub;\n  if (((int32_t)y^b) < 0) y = (uint32_t)-(int32_t)y;\n  return (int32_t)y;\n}\n#endif\n\n#if !LJ_TARGET_X86ORX64\n/* Unsigned x^k. */\nstatic double lj_vm_powui(double x, uint32_t k)\n{\n  double y;\n  lua_assert(k != 0);\n  for (; (k & 1) == 0; k >>= 1) x *= x;\n  y = x;\n  if ((k >>= 1) != 0) {\n    for (;;) {\n      x *= x;\n      if (k == 1) break;\n      if (k & 1) y *= x;\n      k >>= 1;\n    }\n    y *= x;\n  }\n  return y;\n}\n\n/* Signed x^k. */\ndouble lj_vm_powi(double x, int32_t k)\n{\n  if (k > 1)\n    return lj_vm_powui(x, (uint32_t)k);\n  else if (k == 1)\n    return x;\n  else if (k == 0)\n    return 1.0;\n  else\n    return 1.0 / lj_vm_powui(x, (uint32_t)-k);\n}\n\n/* Computes fpm(x) for extended math functions. */\ndouble lj_vm_foldfpm(double x, int fpm)\n{\n  switch (fpm) {\n  case IRFPM_FLOOR: return lj_vm_floor(x);\n  case IRFPM_CEIL: return lj_vm_ceil(x);\n  case IRFPM_TRUNC: return lj_vm_trunc(x);\n  case IRFPM_SQRT: return sqrt(x);\n  case IRFPM_EXP: return exp(x);\n  case IRFPM_EXP2: return lj_vm_exp2(x);\n  case IRFPM_LOG: return log(x);\n  case IRFPM_LOG2: return lj_vm_log2(x);\n  case IRFPM_LOG10: return log10(x);\n  case IRFPM_SIN: return sin(x);\n  case IRFPM_COS: return cos(x);\n  case IRFPM_TAN: return tan(x);\n  default: lua_assert(0);\n  }\n  return 0;\n}\n#endif\n\n#if LJ_HASFFI\nint lj_vm_errno(void)\n{\n  return errno;\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/ljamalg.c",
    "content": "/*\n** LuaJIT core and libraries amalgamation.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n/*\n+--------------------------------------------------------------------------+\n| WARNING: Compiling the amalgamation needs a lot of virtual memory        |\n| (around 200 MB with GCC 4.x)! If you don't have enough physical memory   |\n| your machine will start swapping to disk and the compile will not finish |\n| within a reasonable amount of time.                                      |\n| So either compile on a bigger machine or use the non-amalgamated build.  |\n+--------------------------------------------------------------------------+\n*/\n\n#define ljamalg_c\n#define LUA_CORE\n\n/* To get the mremap prototype. Must be defined before any system includes. */\n#if defined(__linux__) && !defined(_GNU_SOURCE)\n#define _GNU_SOURCE\n#endif\n\n#ifndef WINVER\n#define WINVER 0x0500\n#endif\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\n#include \"lj_gc.c\"\n#include \"lj_err.c\"\n#include \"lj_char.c\"\n#include \"lj_bc.c\"\n#include \"lj_obj.c\"\n#include \"lj_str.c\"\n#include \"lj_tab.c\"\n#include \"lj_func.c\"\n#include \"lj_udata.c\"\n#include \"lj_meta.c\"\n#include \"lj_debug.c\"\n#include \"lj_state.c\"\n#include \"lj_dispatch.c\"\n#include \"lj_vmevent.c\"\n#include \"lj_vmmath.c\"\n#include \"lj_strscan.c\"\n#include \"lj_api.c\"\n#include \"lj_lex.c\"\n#include \"lj_parse.c\"\n#include \"lj_bcread.c\"\n#include \"lj_bcwrite.c\"\n#include \"lj_load.c\"\n#include \"lj_ctype.c\"\n#include \"lj_cdata.c\"\n#include \"lj_cconv.c\"\n#include \"lj_ccall.c\"\n#include \"lj_ccallback.c\"\n#include \"lj_carith.c\"\n#include \"lj_clib.c\"\n#include \"lj_cparse.c\"\n#include \"lj_lib.c\"\n#include \"lj_ir.c\"\n#include \"lj_opt_mem.c\"\n#include \"lj_opt_fold.c\"\n#include \"lj_opt_narrow.c\"\n#include \"lj_opt_dce.c\"\n#include \"lj_opt_loop.c\"\n#include \"lj_opt_split.c\"\n#include \"lj_opt_sink.c\"\n#include \"lj_mcode.c\"\n#include \"lj_snap.c\"\n#include \"lj_record.c\"\n#include \"lj_crecord.c\"\n#include \"lj_ffrecord.c\"\n#include \"lj_asm.c\"\n#include \"lj_trace.c\"\n#include \"lj_gdbjit.c\"\n#include \"lj_alloc.c\"\n\n#include \"lib_aux.c\"\n#include \"lib_base.c\"\n#include \"lib_math.c\"\n#include \"lib_string.c\"\n#include \"lib_table.c\"\n#include \"lib_io.c\"\n#include \"lib_os.c\"\n#include \"lib_package.c\"\n#include \"lib_debug.c\"\n#include \"lib_bit.c\"\n#include \"lib_jit.c\"\n#include \"lib_ffi.c\"\n#include \"lib_init.c\"\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lua.h",
    "content": "/*\n** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $\n** Lua - An Extensible Extension Language\n** Lua.org, PUC-Rio, Brazil (http://www.lua.org)\n** See Copyright Notice at the end of this file\n*/\n\n\n#ifndef lua_h\n#define lua_h\n\n#include <stdarg.h>\n#include <stddef.h>\n\n\n#include \"luaconf.h\"\n\n\n#define LUA_VERSION\t\"Lua 5.1\"\n#define LUA_RELEASE\t\"Lua 5.1.4\"\n#define LUA_VERSION_NUM\t501\n#define LUA_COPYRIGHT\t\"Copyright (C) 1994-2008 Lua.org, PUC-Rio\"\n#define LUA_AUTHORS\t\"R. Ierusalimschy, L. H. de Figueiredo & W. Celes\"\n\n\n/* mark for precompiled code (`<esc>Lua') */\n#define\tLUA_SIGNATURE\t\"\\033Lua\"\n\n/* option for multiple returns in `lua_pcall' and `lua_call' */\n#define LUA_MULTRET\t(-1)\n\n\n/*\n** pseudo-indices\n*/\n#define LUA_REGISTRYINDEX\t(-10000)\n#define LUA_ENVIRONINDEX\t(-10001)\n#define LUA_GLOBALSINDEX\t(-10002)\n#define lua_upvalueindex(i)\t(LUA_GLOBALSINDEX-(i))\n\n\n/* thread status; 0 is OK */\n#define LUA_YIELD\t1\n#define LUA_ERRRUN\t2\n#define LUA_ERRSYNTAX\t3\n#define LUA_ERRMEM\t4\n#define LUA_ERRERR\t5\n\n\ntypedef struct lua_State lua_State;\n\ntypedef int (*lua_CFunction) (lua_State *L);\n\n\n/*\n** functions that read/write blocks when loading/dumping Lua chunks\n*/\ntypedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz);\n\ntypedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud);\n\n\n/*\n** prototype for memory-allocation functions\n*/\ntypedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize);\n\n\n/*\n** basic types\n*/\n#define LUA_TNONE\t\t(-1)\n\n#define LUA_TNIL\t\t0\n#define LUA_TBOOLEAN\t\t1\n#define LUA_TLIGHTUSERDATA\t2\n#define LUA_TNUMBER\t\t3\n#define LUA_TSTRING\t\t4\n#define LUA_TTABLE\t\t5\n#define LUA_TFUNCTION\t\t6\n#define LUA_TUSERDATA\t\t7\n#define LUA_TTHREAD\t\t8\n\n\n\n/* minimum Lua stack available to a C function */\n#define LUA_MINSTACK\t20\n\n\n/*\n** generic extra include file\n*/\n#if defined(LUA_USER_H)\n#include LUA_USER_H\n#endif\n\n\n/* type of numbers in Lua */\ntypedef LUA_NUMBER lua_Number;\n\n\n/* type for integer functions */\ntypedef LUA_INTEGER lua_Integer;\n\n\n\n/*\n** state manipulation\n*/\nLUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud);\nLUA_API void       (lua_close) (lua_State *L);\nLUA_API lua_State *(lua_newthread) (lua_State *L);\n\nLUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf);\n\n\n/*\n** basic stack manipulation\n*/\nLUA_API int   (lua_gettop) (lua_State *L);\nLUA_API void  (lua_settop) (lua_State *L, int idx);\nLUA_API void  (lua_pushvalue) (lua_State *L, int idx);\nLUA_API void  (lua_remove) (lua_State *L, int idx);\nLUA_API void  (lua_insert) (lua_State *L, int idx);\nLUA_API void  (lua_replace) (lua_State *L, int idx);\nLUA_API int   (lua_checkstack) (lua_State *L, int sz);\n\nLUA_API void  (lua_xmove) (lua_State *from, lua_State *to, int n);\n\n\n/*\n** access functions (stack -> C)\n*/\n\nLUA_API int             (lua_isnumber) (lua_State *L, int idx);\nLUA_API int             (lua_isstring) (lua_State *L, int idx);\nLUA_API int             (lua_iscfunction) (lua_State *L, int idx);\nLUA_API int             (lua_isuserdata) (lua_State *L, int idx);\nLUA_API int             (lua_type) (lua_State *L, int idx);\nLUA_API const char     *(lua_typename) (lua_State *L, int tp);\n\nLUA_API int            (lua_equal) (lua_State *L, int idx1, int idx2);\nLUA_API int            (lua_rawequal) (lua_State *L, int idx1, int idx2);\nLUA_API int            (lua_lessthan) (lua_State *L, int idx1, int idx2);\n\nLUA_API lua_Number      (lua_tonumber) (lua_State *L, int idx);\nLUA_API lua_Integer     (lua_tointeger) (lua_State *L, int idx);\nLUA_API int             (lua_toboolean) (lua_State *L, int idx);\nLUA_API const char     *(lua_tolstring) (lua_State *L, int idx, size_t *len);\nLUA_API size_t          (lua_objlen) (lua_State *L, int idx);\nLUA_API lua_CFunction   (lua_tocfunction) (lua_State *L, int idx);\nLUA_API void\t       *(lua_touserdata) (lua_State *L, int idx);\nLUA_API lua_State      *(lua_tothread) (lua_State *L, int idx);\nLUA_API const void     *(lua_topointer) (lua_State *L, int idx);\n\n\n/*\n** push functions (C -> stack)\n*/\nLUA_API void  (lua_pushnil) (lua_State *L);\nLUA_API void  (lua_pushnumber) (lua_State *L, lua_Number n);\nLUA_API void  (lua_pushinteger) (lua_State *L, lua_Integer n);\nLUA_API void  (lua_pushlstring) (lua_State *L, const char *s, size_t l);\nLUA_API void  (lua_pushstring) (lua_State *L, const char *s);\nLUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt,\n                                                      va_list argp);\nLUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...);\nLUA_API void  (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n);\nLUA_API void  (lua_pushboolean) (lua_State *L, int b);\nLUA_API void  (lua_pushlightuserdata) (lua_State *L, void *p);\nLUA_API int   (lua_pushthread) (lua_State *L);\n\n\n/*\n** get functions (Lua -> stack)\n*/\nLUA_API void  (lua_gettable) (lua_State *L, int idx);\nLUA_API void  (lua_getfield) (lua_State *L, int idx, const char *k);\nLUA_API void  (lua_rawget) (lua_State *L, int idx);\nLUA_API void  (lua_rawgeti) (lua_State *L, int idx, int n);\nLUA_API void  (lua_createtable) (lua_State *L, int narr, int nrec);\nLUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);\nLUA_API int   (lua_getmetatable) (lua_State *L, int objindex);\nLUA_API void  (lua_getfenv) (lua_State *L, int idx);\n\n\n/*\n** set functions (stack -> Lua)\n*/\nLUA_API void  (lua_settable) (lua_State *L, int idx);\nLUA_API void  (lua_setfield) (lua_State *L, int idx, const char *k);\nLUA_API void  (lua_rawset) (lua_State *L, int idx);\nLUA_API void  (lua_rawseti) (lua_State *L, int idx, int n);\nLUA_API int   (lua_setmetatable) (lua_State *L, int objindex);\nLUA_API int   (lua_setfenv) (lua_State *L, int idx);\n\n\n/*\n** `load' and `call' functions (load and run Lua code)\n*/\nLUA_API void  (lua_call) (lua_State *L, int nargs, int nresults);\nLUA_API int   (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);\nLUA_API int   (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud);\nLUA_API int   (lua_load) (lua_State *L, lua_Reader reader, void *dt,\n                                        const char *chunkname);\n\nLUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);\n\n\n/*\n** coroutine functions\n*/\nLUA_API int  (lua_yield) (lua_State *L, int nresults);\nLUA_API int  (lua_resume) (lua_State *L, int narg);\nLUA_API int  (lua_status) (lua_State *L);\n\n/*\n** garbage-collection function and options\n*/\n\n#define LUA_GCSTOP\t\t0\n#define LUA_GCRESTART\t\t1\n#define LUA_GCCOLLECT\t\t2\n#define LUA_GCCOUNT\t\t3\n#define LUA_GCCOUNTB\t\t4\n#define LUA_GCSTEP\t\t5\n#define LUA_GCSETPAUSE\t\t6\n#define LUA_GCSETSTEPMUL\t7\n\nLUA_API int (lua_gc) (lua_State *L, int what, int data);\n\n\n/*\n** miscellaneous functions\n*/\n\nLUA_API int   (lua_error) (lua_State *L);\n\nLUA_API int   (lua_next) (lua_State *L, int idx);\n\nLUA_API void  (lua_concat) (lua_State *L, int n);\n\nLUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud);\nLUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);\n\n\n\n/*\n** ===============================================================\n** some useful macros\n** ===============================================================\n*/\n\n#define lua_pop(L,n)\t\tlua_settop(L, -(n)-1)\n\n#define lua_newtable(L)\t\tlua_createtable(L, 0, 0)\n\n#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))\n\n#define lua_pushcfunction(L,f)\tlua_pushcclosure(L, (f), 0)\n\n#define lua_strlen(L,i)\t\tlua_objlen(L, (i))\n\n#define lua_isfunction(L,n)\t(lua_type(L, (n)) == LUA_TFUNCTION)\n#define lua_istable(L,n)\t(lua_type(L, (n)) == LUA_TTABLE)\n#define lua_islightuserdata(L,n)\t(lua_type(L, (n)) == LUA_TLIGHTUSERDATA)\n#define lua_isnil(L,n)\t\t(lua_type(L, (n)) == LUA_TNIL)\n#define lua_isboolean(L,n)\t(lua_type(L, (n)) == LUA_TBOOLEAN)\n#define lua_isthread(L,n)\t(lua_type(L, (n)) == LUA_TTHREAD)\n#define lua_isnone(L,n)\t\t(lua_type(L, (n)) == LUA_TNONE)\n#define lua_isnoneornil(L, n)\t(lua_type(L, (n)) <= 0)\n\n#define lua_pushliteral(L, s)\t\\\n\tlua_pushlstring(L, \"\" s, (sizeof(s)/sizeof(char))-1)\n\n#define lua_setglobal(L,s)\tlua_setfield(L, LUA_GLOBALSINDEX, (s))\n#define lua_getglobal(L,s)\tlua_getfield(L, LUA_GLOBALSINDEX, (s))\n\n#define lua_tostring(L,i)\tlua_tolstring(L, (i), NULL)\n\n\n\n/*\n** compatibility macros and functions\n*/\n\n#define lua_open()\tluaL_newstate()\n\n#define lua_getregistry(L)\tlua_pushvalue(L, LUA_REGISTRYINDEX)\n\n#define lua_getgccount(L)\tlua_gc(L, LUA_GCCOUNT, 0)\n\n#define lua_Chunkreader\t\tlua_Reader\n#define lua_Chunkwriter\t\tlua_Writer\n\n\n/* hack */\nLUA_API void lua_setlevel\t(lua_State *from, lua_State *to);\n\n\n/*\n** {======================================================================\n** Debug API\n** =======================================================================\n*/\n\n\n/*\n** Event codes\n*/\n#define LUA_HOOKCALL\t0\n#define LUA_HOOKRET\t1\n#define LUA_HOOKLINE\t2\n#define LUA_HOOKCOUNT\t3\n#define LUA_HOOKTAILRET 4\n\n\n/*\n** Event masks\n*/\n#define LUA_MASKCALL\t(1 << LUA_HOOKCALL)\n#define LUA_MASKRET\t(1 << LUA_HOOKRET)\n#define LUA_MASKLINE\t(1 << LUA_HOOKLINE)\n#define LUA_MASKCOUNT\t(1 << LUA_HOOKCOUNT)\n\ntypedef struct lua_Debug lua_Debug;  /* activation record */\n\n\n/* Functions to be called by the debuger in specific events */\ntypedef void (*lua_Hook) (lua_State *L, lua_Debug *ar);\n\n\nLUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);\nLUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);\nLUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);\nLUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);\nLUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);\nLUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);\nLUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);\nLUA_API lua_Hook lua_gethook (lua_State *L);\nLUA_API int lua_gethookmask (lua_State *L);\nLUA_API int lua_gethookcount (lua_State *L);\n\n/* From Lua 5.2. */\nLUA_API void *lua_upvalueid (lua_State *L, int idx, int n);\nLUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2);\nLUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt,\n\t\t       const char *chunkname, const char *mode);\n\n\nstruct lua_Debug {\n  int event;\n  const char *name;\t/* (n) */\n  const char *namewhat;\t/* (n) `global', `local', `field', `method' */\n  const char *what;\t/* (S) `Lua', `C', `main', `tail' */\n  const char *source;\t/* (S) */\n  int currentline;\t/* (l) */\n  int nups;\t\t/* (u) number of upvalues */\n  int linedefined;\t/* (S) */\n  int lastlinedefined;\t/* (S) */\n  char short_src[LUA_IDSIZE]; /* (S) */\n  /* private part */\n  int i_ci;  /* active function */\n};\n\n/* }====================================================================== */\n\n\n/******************************************************************************\n* Copyright (C) 1994-2008 Lua.org, PUC-Rio.  All rights reserved.\n*\n* Permission is hereby granted, free of charge, to any person obtaining\n* a copy of this software and associated documentation files (the\n* \"Software\"), to deal in the Software without restriction, including\n* without limitation the rights to use, copy, modify, merge, publish,\n* distribute, sublicense, and/or sell copies of the Software, and to\n* permit persons to whom the Software is furnished to do so, subject to\n* the following conditions:\n*\n* The above copyright notice and this permission notice shall be\n* included in all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n******************************************************************************/\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lua.hpp",
    "content": "// C++ wrapper for LuaJIT header files.\n\nextern \"C\" {\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n#include \"luajit.h\"\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/luaconf.h",
    "content": "/*\n** Configuration header.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef luaconf_h\n#define luaconf_h\n\n#include <limits.h>\n#include <stddef.h>\n\n/* Default path for loading Lua and C modules with require(). */\n#if defined(_WIN32)\n/*\n** In Windows, any exclamation mark ('!') in the path is replaced by the\n** path of the directory of the executable file of the current process.\n*/\n#define LUA_LDIR\t\"!\\\\lua\\\\\"\n#define LUA_CDIR\t\"!\\\\\"\n#define LUA_PATH_DEFAULT \\\n  \".\\\\?.lua;\" LUA_LDIR\"?.lua;\" LUA_LDIR\"?\\\\init.lua;\"\n#define LUA_CPATH_DEFAULT \\\n  \".\\\\?.dll;\" LUA_CDIR\"?.dll;\" LUA_CDIR\"loadall.dll\"\n#else\n/*\n** Note to distribution maintainers: do NOT patch the following line!\n** Please read ../doc/install.html#distro and pass PREFIX=/usr instead.\n*/\n#define LUA_ROOT\t\"/usr/local/\"\n#define LUA_LDIR\tLUA_ROOT \"share/lua/5.1/\"\n#define LUA_CDIR\tLUA_ROOT \"lib/lua/5.1/\"\n#ifdef LUA_XROOT\n#define LUA_JDIR\tLUA_XROOT \"share/luajit-2.0.1/\"\n#define LUA_XPATH \\\n  \";\" LUA_XROOT \"share/lua/5.1/?.lua;\" LUA_XROOT \"share/lua/5.1/?/init.lua\"\n#define LUA_XCPATH\tLUA_XROOT \"lib/lua/5.1/?.so;\"\n#else\n#define LUA_JDIR\tLUA_ROOT \"share/luajit-2.0.1/\"\n#define LUA_XPATH\n#define LUA_XCPATH\n#endif\n#define LUA_PATH_DEFAULT \\\n  \"./?.lua;\" LUA_JDIR\"?.lua;\" LUA_LDIR\"?.lua;\" LUA_LDIR\"?/init.lua\" LUA_XPATH\n#define LUA_CPATH_DEFAULT \\\n  \"./?.so;\" LUA_CDIR\"?.so;\" LUA_XCPATH LUA_CDIR\"loadall.so\"\n#endif\n\n/* Environment variable names for path overrides and initialization code. */\n#define LUA_PATH\t\"LUA_PATH\"\n#define LUA_CPATH\t\"LUA_CPATH\"\n#define LUA_INIT\t\"LUA_INIT\"\n\n/* Special file system characters. */\n#if defined(_WIN32)\n#define LUA_DIRSEP\t\"\\\\\"\n#else\n#define LUA_DIRSEP\t\"/\"\n#endif\n#define LUA_PATHSEP\t\";\"\n#define LUA_PATH_MARK\t\"?\"\n#define LUA_EXECDIR\t\"!\"\n#define LUA_IGMARK\t\"-\"\n#define LUA_PATH_CONFIG \\\n  LUA_DIRSEP \"\\n\" LUA_PATHSEP \"\\n\" LUA_PATH_MARK \"\\n\" \\\n  LUA_EXECDIR \"\\n\" LUA_IGMARK\n\n/* Quoting in error messages. */\n#define LUA_QL(x)\t\"'\" x \"'\"\n#define LUA_QS\t\tLUA_QL(\"%s\")\n\n/* Various tunables. */\n#define LUAI_MAXSTACK\t65500\t/* Max. # of stack slots for a thread (<64K). */\n#define LUAI_MAXCSTACK\t8000\t/* Max. # of stack slots for a C func (<10K). */\n#define LUAI_GCPAUSE\t200\t/* Pause GC until memory is at 200%. */\n#define LUAI_GCMUL\t200\t/* Run GC at 200% of allocation speed. */\n#define LUA_MAXCAPTURES\t32\t/* Max. pattern captures. */\n\n/* Compatibility with older library function names. */\n#define LUA_COMPAT_MOD\t\t/* OLD: math.mod, NEW: math.fmod */\n#define LUA_COMPAT_GFIND\t/* OLD: string.gfind, NEW: string.gmatch */\n\n/* Configuration for the frontend (the luajit executable). */\n#if defined(luajit_c)\n#define LUA_PROGNAME\t\"luajit\"  /* Fallback frontend name. */\n#define LUA_PROMPT\t\"> \"\t/* Interactive prompt. */\n#define LUA_PROMPT2\t\">> \"\t/* Continuation prompt. */\n#define LUA_MAXINPUT\t512\t/* Max. input line length. */\n#endif\n\n/* Note: changing the following defines breaks the Lua 5.1 ABI. */\n#define LUA_INTEGER\tptrdiff_t\n#define LUA_IDSIZE\t60\t/* Size of lua_Debug.short_src. */\n/*\n** Size of lauxlib and io.* on-stack buffers. Weird workaround to avoid using\n** unreasonable amounts of stack space, but still retain ABI compatibility.\n** Blame Lua for depending on BUFSIZ in the ABI, blame **** for wrecking it.\n*/\n#define LUAL_BUFFERSIZE\t(BUFSIZ > 16384 ? 8192 : BUFSIZ)\n\n/* The following defines are here only for compatibility with luaconf.h\n** from the standard Lua distribution. They must not be changed for LuaJIT.\n*/\n#define LUA_NUMBER_DOUBLE\n#define LUA_NUMBER\t\tdouble\n#define LUAI_UACNUMBER\t\tdouble\n#define LUA_NUMBER_SCAN\t\t\"%lf\"\n#define LUA_NUMBER_FMT\t\t\"%.14g\"\n#define lua_number2str(s, n)\tsprintf((s), LUA_NUMBER_FMT, (n))\n#define LUAI_MAXNUMBER2STR\t32\n#define LUA_INTFRMLEN\t\t\"l\"\n#define LUA_INTFRM_T\t\tlong\n\n/* Linkage of public API functions. */\n#if defined(LUA_BUILD_AS_DLL)\n#if defined(LUA_CORE) || defined(LUA_LIB)\n#define LUA_API\t\t__declspec(dllexport)\n#else\n#define LUA_API\t\t__declspec(dllimport)\n#endif\n#else\n#define LUA_API\t\textern\n#endif\n\n#define LUALIB_API\tLUA_API\n\n/* Support for internal assertions. */\n#if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK)\n#include <assert.h>\n#endif\n#ifdef LUA_USE_ASSERT\n#define lua_assert(x)\t\tassert(x)\n#endif\n#ifdef LUA_USE_APICHECK\n#define luai_apicheck(L, o)\t{ (void)L; assert(o); }\n#else\n#define luai_apicheck(L, o)\t{ (void)L; }\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/luajit.c",
    "content": "/*\n** LuaJIT frontend. Runs commands, scripts, read-eval-print (REPL) etc.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n**\n** Major portions taken verbatim or adapted from the Lua interpreter.\n** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define luajit_c\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n#include \"lualib.h\"\n#include \"luajit.h\"\n\n#include \"lj_arch.h\"\n\n#if LJ_TARGET_POSIX\n#include <unistd.h>\n#define lua_stdin_is_tty()\tisatty(0)\n#elif LJ_TARGET_WINDOWS\n#include <io.h>\n#ifdef __BORLANDC__\n#define lua_stdin_is_tty()\tisatty(_fileno(stdin))\n#else\n#define lua_stdin_is_tty()\t_isatty(_fileno(stdin))\n#endif\n#else\n#define lua_stdin_is_tty()\t1\n#endif\n\n#if !LJ_TARGET_CONSOLE\n#include <signal.h>\n#endif\n\nstatic lua_State *globalL = NULL;\nstatic const char *progname = LUA_PROGNAME;\n\n#if !LJ_TARGET_CONSOLE\nstatic void lstop(lua_State *L, lua_Debug *ar)\n{\n  (void)ar;  /* unused arg. */\n  lua_sethook(L, NULL, 0, 0);\n  /* Avoid luaL_error -- a C hook doesn't add an extra frame. */\n  luaL_where(L, 0);\n  lua_pushfstring(L, \"%sinterrupted!\", lua_tostring(L, -1));\n  lua_error(L);\n}\n\nstatic void laction(int i)\n{\n  signal(i, SIG_DFL); /* if another SIGINT happens before lstop,\n\t\t\t terminate process (default action) */\n  lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);\n}\n#endif\n\nstatic void print_usage(void)\n{\n  fprintf(stderr,\n  \"usage: %s [options]... [script [args]...].\\n\"\n  \"Available options are:\\n\"\n  \"  -e chunk  Execute string \" LUA_QL(\"chunk\") \".\\n\"\n  \"  -l name   Require library \" LUA_QL(\"name\") \".\\n\"\n  \"  -b ...    Save or list bytecode.\\n\"\n  \"  -j cmd    Perform LuaJIT control command.\\n\"\n  \"  -O[opt]   Control LuaJIT optimizations.\\n\"\n  \"  -i        Enter interactive mode after executing \" LUA_QL(\"script\") \".\\n\"\n  \"  -v        Show version information.\\n\"\n  \"  -E        Ignore environment variables.\\n\"\n  \"  --        Stop handling options.\\n\"\n  \"  -         Execute stdin and stop handling options.\\n\"\n  ,\n  progname);\n  fflush(stderr);\n}\n\nstatic void l_message(const char *pname, const char *msg)\n{\n  if (pname) fprintf(stderr, \"%s: \", pname);\n  fprintf(stderr, \"%s\\n\", msg);\n  fflush(stderr);\n}\n\nstatic int report(lua_State *L, int status)\n{\n  if (status && !lua_isnil(L, -1)) {\n    const char *msg = lua_tostring(L, -1);\n    if (msg == NULL) msg = \"(error object is not a string)\";\n    l_message(progname, msg);\n    lua_pop(L, 1);\n  }\n  return status;\n}\n\nstatic int traceback(lua_State *L)\n{\n  if (!lua_isstring(L, 1)) { /* Non-string error object? Try metamethod. */\n    if (lua_isnoneornil(L, 1) ||\n\t!luaL_callmeta(L, 1, \"__tostring\") ||\n\t!lua_isstring(L, -1))\n      return 1;  /* Return non-string error object. */\n    lua_remove(L, 1);  /* Replace object by result of __tostring metamethod. */\n  }\n  luaL_traceback(L, L, lua_tostring(L, 1), 1);\n  return 1;\n}\n\nstatic int docall(lua_State *L, int narg, int clear)\n{\n  int status;\n  int base = lua_gettop(L) - narg;  /* function index */\n  lua_pushcfunction(L, traceback);  /* push traceback function */\n  lua_insert(L, base);  /* put it under chunk and args */\n#if !LJ_TARGET_CONSOLE\n  signal(SIGINT, laction);\n#endif\n  status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base);\n#if !LJ_TARGET_CONSOLE\n  signal(SIGINT, SIG_DFL);\n#endif\n  lua_remove(L, base);  /* remove traceback function */\n  /* force a complete garbage collection in case of errors */\n  if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0);\n  return status;\n}\n\nstatic void print_version(void)\n{\n  fputs(LUAJIT_VERSION \" -- \" LUAJIT_COPYRIGHT \". \" LUAJIT_URL \"\\n\", stdout);\n}\n\nstatic void print_jit_status(lua_State *L)\n{\n  int n;\n  const char *s;\n  lua_getfield(L, LUA_REGISTRYINDEX, \"_LOADED\");\n  lua_getfield(L, -1, \"jit\");  /* Get jit.* module table. */\n  lua_remove(L, -2);\n  lua_getfield(L, -1, \"status\");\n  lua_remove(L, -2);\n  n = lua_gettop(L);\n  lua_call(L, 0, LUA_MULTRET);\n  fputs(lua_toboolean(L, n) ? \"JIT: ON\" : \"JIT: OFF\", stdout);\n  for (n++; (s = lua_tostring(L, n)); n++) {\n    putc(' ', stdout);\n    fputs(s, stdout);\n  }\n  putc('\\n', stdout);\n}\n\nstatic int getargs(lua_State *L, char **argv, int n)\n{\n  int narg;\n  int i;\n  int argc = 0;\n  while (argv[argc]) argc++;  /* count total number of arguments */\n  narg = argc - (n + 1);  /* number of arguments to the script */\n  luaL_checkstack(L, narg + 3, \"too many arguments to script\");\n  for (i = n+1; i < argc; i++)\n    lua_pushstring(L, argv[i]);\n  lua_createtable(L, narg, n + 1);\n  for (i = 0; i < argc; i++) {\n    lua_pushstring(L, argv[i]);\n    lua_rawseti(L, -2, i - n);\n  }\n  return narg;\n}\n\nstatic int dofile(lua_State *L, const char *name)\n{\n  int status = luaL_loadfile(L, name) || docall(L, 0, 1);\n  return report(L, status);\n}\n\nstatic int dostring(lua_State *L, const char *s, const char *name)\n{\n  int status = luaL_loadbuffer(L, s, strlen(s), name) || docall(L, 0, 1);\n  return report(L, status);\n}\n\nstatic int dolibrary(lua_State *L, const char *name)\n{\n  lua_getglobal(L, \"require\");\n  lua_pushstring(L, name);\n  return report(L, docall(L, 1, 1));\n}\n\nstatic void write_prompt(lua_State *L, int firstline)\n{\n  const char *p;\n  lua_getfield(L, LUA_GLOBALSINDEX, firstline ? \"_PROMPT\" : \"_PROMPT2\");\n  p = lua_tostring(L, -1);\n  if (p == NULL) p = firstline ? LUA_PROMPT : LUA_PROMPT2;\n  fputs(p, stdout);\n  fflush(stdout);\n  lua_pop(L, 1);  /* remove global */\n}\n\nstatic int incomplete(lua_State *L, int status)\n{\n  if (status == LUA_ERRSYNTAX) {\n    size_t lmsg;\n    const char *msg = lua_tolstring(L, -1, &lmsg);\n    const char *tp = msg + lmsg - (sizeof(LUA_QL(\"<eof>\")) - 1);\n    if (strstr(msg, LUA_QL(\"<eof>\")) == tp) {\n      lua_pop(L, 1);\n      return 1;\n    }\n  }\n  return 0;  /* else... */\n}\n\nstatic int pushline(lua_State *L, int firstline)\n{\n  char buf[LUA_MAXINPUT];\n  write_prompt(L, firstline);\n  if (fgets(buf, LUA_MAXINPUT, stdin)) {\n    size_t len = strlen(buf);\n    if (len > 0 && buf[len-1] == '\\n')\n      buf[len-1] = '\\0';\n    if (firstline && buf[0] == '=')\n      lua_pushfstring(L, \"return %s\", buf+1);\n    else\n      lua_pushstring(L, buf);\n    return 1;\n  }\n  return 0;\n}\n\nstatic int loadline(lua_State *L)\n{\n  int status;\n  lua_settop(L, 0);\n  if (!pushline(L, 1))\n    return -1;  /* no input */\n  for (;;) {  /* repeat until gets a complete line */\n    status = luaL_loadbuffer(L, lua_tostring(L, 1), lua_strlen(L, 1), \"=stdin\");\n    if (!incomplete(L, status)) break;  /* cannot try to add lines? */\n    if (!pushline(L, 0))  /* no more input? */\n      return -1;\n    lua_pushliteral(L, \"\\n\");  /* add a new line... */\n    lua_insert(L, -2);  /* ...between the two lines */\n    lua_concat(L, 3);  /* join them */\n  }\n  lua_remove(L, 1);  /* remove line */\n  return status;\n}\n\nstatic void dotty(lua_State *L)\n{\n  int status;\n  const char *oldprogname = progname;\n  progname = NULL;\n  while ((status = loadline(L)) != -1) {\n    if (status == 0) status = docall(L, 0, 0);\n    report(L, status);\n    if (status == 0 && lua_gettop(L) > 0) {  /* any result to print? */\n      lua_getglobal(L, \"print\");\n      lua_insert(L, 1);\n      if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0)\n\tl_message(progname,\n\t  lua_pushfstring(L, \"error calling \" LUA_QL(\"print\") \" (%s)\",\n\t\t\t      lua_tostring(L, -1)));\n    }\n  }\n  lua_settop(L, 0);  /* clear stack */\n  fputs(\"\\n\", stdout);\n  fflush(stdout);\n  progname = oldprogname;\n}\n\nstatic int handle_script(lua_State *L, char **argv, int n)\n{\n  int status;\n  const char *fname;\n  int narg = getargs(L, argv, n);  /* collect arguments */\n  lua_setglobal(L, \"arg\");\n  fname = argv[n];\n  if (strcmp(fname, \"-\") == 0 && strcmp(argv[n-1], \"--\") != 0)\n    fname = NULL;  /* stdin */\n  status = luaL_loadfile(L, fname);\n  lua_insert(L, -(narg+1));\n  if (status == 0)\n    status = docall(L, narg, 0);\n  else\n    lua_pop(L, narg);\n  return report(L, status);\n}\n\n/* Load add-on module. */\nstatic int loadjitmodule(lua_State *L)\n{\n  lua_getglobal(L, \"require\");\n  lua_pushliteral(L, \"jit.\");\n  lua_pushvalue(L, -3);\n  lua_concat(L, 2);\n  if (lua_pcall(L, 1, 1, 0)) {\n    const char *msg = lua_tostring(L, -1);\n    if (msg && !strncmp(msg, \"module \", 7)) {\n    err:\n      l_message(progname,\n\t\t\"unknown luaJIT command or jit.* modules not installed\");\n      return 1;\n    } else {\n      return report(L, 1);\n    }\n  }\n  lua_getfield(L, -1, \"start\");\n  if (lua_isnil(L, -1)) goto err;\n  lua_remove(L, -2);  /* Drop module table. */\n  return 0;\n}\n\n/* Run command with options. */\nstatic int runcmdopt(lua_State *L, const char *opt)\n{\n  int narg = 0;\n  if (opt && *opt) {\n    for (;;) {  /* Split arguments. */\n      const char *p = strchr(opt, ',');\n      narg++;\n      if (!p) break;\n      if (p == opt)\n\tlua_pushnil(L);\n      else\n\tlua_pushlstring(L, opt, (size_t)(p - opt));\n      opt = p + 1;\n    }\n    if (*opt)\n      lua_pushstring(L, opt);\n    else\n      lua_pushnil(L);\n  }\n  return report(L, lua_pcall(L, narg, 0, 0));\n}\n\n/* JIT engine control command: try jit library first or load add-on module. */\nstatic int dojitcmd(lua_State *L, const char *cmd)\n{\n  const char *opt = strchr(cmd, '=');\n  lua_pushlstring(L, cmd, opt ? (size_t)(opt - cmd) : strlen(cmd));\n  lua_getfield(L, LUA_REGISTRYINDEX, \"_LOADED\");\n  lua_getfield(L, -1, \"jit\");  /* Get jit.* module table. */\n  lua_remove(L, -2);\n  lua_pushvalue(L, -2);\n  lua_gettable(L, -2);  /* Lookup library function. */\n  if (!lua_isfunction(L, -1)) {\n    lua_pop(L, 2);  /* Drop non-function and jit.* table, keep module name. */\n    if (loadjitmodule(L))\n      return 1;\n  } else {\n    lua_remove(L, -2);  /* Drop jit.* table. */\n  }\n  lua_remove(L, -2);  /* Drop module name. */\n  return runcmdopt(L, opt ? opt+1 : opt);\n}\n\n/* Optimization flags. */\nstatic int dojitopt(lua_State *L, const char *opt)\n{\n  lua_getfield(L, LUA_REGISTRYINDEX, \"_LOADED\");\n  lua_getfield(L, -1, \"jit.opt\");  /* Get jit.opt.* module table. */\n  lua_remove(L, -2);\n  lua_getfield(L, -1, \"start\");\n  lua_remove(L, -2);\n  return runcmdopt(L, opt);\n}\n\n/* Save or list bytecode. */\nstatic int dobytecode(lua_State *L, char **argv)\n{\n  int narg = 0;\n  lua_pushliteral(L, \"bcsave\");\n  if (loadjitmodule(L))\n    return 1;\n  if (argv[0][2]) {\n    narg++;\n    argv[0][1] = '-';\n    lua_pushstring(L, argv[0]+1);\n  }\n  for (argv++; *argv != NULL; narg++, argv++)\n    lua_pushstring(L, *argv);\n  return report(L, lua_pcall(L, narg, 0, 0));\n}\n\n/* check that argument has no extra characters at the end */\n#define notail(x)\t{if ((x)[2] != '\\0') return -1;}\n\n#define FLAGS_INTERACTIVE\t1\n#define FLAGS_VERSION\t\t2\n#define FLAGS_EXEC\t\t4\n#define FLAGS_OPTION\t\t8\n#define FLAGS_NOENV\t\t16\n\nstatic int collectargs(char **argv, int *flags)\n{\n  int i;\n  for (i = 1; argv[i] != NULL; i++) {\n    if (argv[i][0] != '-')  /* Not an option? */\n      return i;\n    switch (argv[i][1]) {  /* Check option. */\n    case '-':\n      notail(argv[i]);\n      return (argv[i+1] != NULL ? i+1 : 0);\n    case '\\0':\n      return i;\n    case 'i':\n      notail(argv[i]);\n      *flags |= FLAGS_INTERACTIVE;\n      /* fallthrough */\n    case 'v':\n      notail(argv[i]);\n      *flags |= FLAGS_VERSION;\n      break;\n    case 'e':\n      *flags |= FLAGS_EXEC;\n    case 'j':  /* LuaJIT extension */\n    case 'l':\n      *flags |= FLAGS_OPTION;\n      if (argv[i][2] == '\\0') {\n\ti++;\n\tif (argv[i] == NULL) return -1;\n      }\n      break;\n    case 'O': break;  /* LuaJIT extension */\n    case 'b':  /* LuaJIT extension */\n      if (*flags) return -1;\n      *flags |= FLAGS_EXEC;\n      return 0;\n    case 'E':\n      *flags |= FLAGS_NOENV;\n      break;\n    default: return -1;  /* invalid option */\n    }\n  }\n  return 0;\n}\n\nstatic int runargs(lua_State *L, char **argv, int n)\n{\n  int i;\n  for (i = 1; i < n; i++) {\n    if (argv[i] == NULL) continue;\n    lua_assert(argv[i][0] == '-');\n    switch (argv[i][1]) {  /* option */\n    case 'e': {\n      const char *chunk = argv[i] + 2;\n      if (*chunk == '\\0') chunk = argv[++i];\n      lua_assert(chunk != NULL);\n      if (dostring(L, chunk, \"=(command line)\") != 0)\n\treturn 1;\n      break;\n      }\n    case 'l': {\n      const char *filename = argv[i] + 2;\n      if (*filename == '\\0') filename = argv[++i];\n      lua_assert(filename != NULL);\n      if (dolibrary(L, filename))\n\treturn 1;  /* stop if file fails */\n      break;\n      }\n    case 'j': {  /* LuaJIT extension */\n      const char *cmd = argv[i] + 2;\n      if (*cmd == '\\0') cmd = argv[++i];\n      lua_assert(cmd != NULL);\n      if (dojitcmd(L, cmd))\n\treturn 1;\n      break;\n      }\n    case 'O':  /* LuaJIT extension */\n      if (dojitopt(L, argv[i] + 2))\n\treturn 1;\n      break;\n    case 'b':  /* LuaJIT extension */\n      return dobytecode(L, argv+i);\n    default: break;\n    }\n  }\n  return 0;\n}\n\nstatic int handle_luainit(lua_State *L)\n{\n#if LJ_TARGET_CONSOLE\n  const char *init = NULL;\n#else\n  const char *init = getenv(LUA_INIT);\n#endif\n  if (init == NULL)\n    return 0;  /* status OK */\n  else if (init[0] == '@')\n    return dofile(L, init+1);\n  else\n    return dostring(L, init, \"=\" LUA_INIT);\n}\n\nstruct Smain {\n  char **argv;\n  int argc;\n  int status;\n};\n\nstatic int pmain(lua_State *L)\n{\n  struct Smain *s = (struct Smain *)lua_touserdata(L, 1);\n  char **argv = s->argv;\n  int script;\n  int flags = 0;\n  globalL = L;\n  if (argv[0] && argv[0][0]) progname = argv[0];\n  LUAJIT_VERSION_SYM();  /* linker-enforced version check */\n  script = collectargs(argv, &flags);\n  if (script < 0) {  /* invalid args? */\n    print_usage();\n    s->status = 1;\n    return 0;\n  }\n  if ((flags & FLAGS_NOENV)) {\n    lua_pushboolean(L, 1);\n    lua_setfield(L, LUA_REGISTRYINDEX, \"LUA_NOENV\");\n  }\n  lua_gc(L, LUA_GCSTOP, 0);  /* stop collector during initialization */\n  luaL_openlibs(L);  /* open libraries */\n  lua_gc(L, LUA_GCRESTART, -1);\n  if (!(flags & FLAGS_NOENV)) {\n    s->status = handle_luainit(L);\n    if (s->status != 0) return 0;\n  }\n  if ((flags & FLAGS_VERSION)) print_version();\n  s->status = runargs(L, argv, (script > 0) ? script : s->argc);\n  if (s->status != 0) return 0;\n  if (script) {\n    s->status = handle_script(L, argv, script);\n    if (s->status != 0) return 0;\n  }\n  if ((flags & FLAGS_INTERACTIVE)) {\n    print_jit_status(L);\n    dotty(L);\n  } else if (script == 0 && !(flags & (FLAGS_EXEC|FLAGS_VERSION))) {\n    if (lua_stdin_is_tty()) {\n      print_version();\n      print_jit_status(L);\n      dotty(L);\n    } else {\n      dofile(L, NULL);  /* executes stdin as a file */\n    }\n  }\n  return 0;\n}\n\nint main(int argc, char **argv)\n{\n  int status;\n  struct Smain s;\n  lua_State *L = lua_open();  /* create state */\n  if (L == NULL) {\n    l_message(argv[0], \"cannot create state: not enough memory\");\n    return EXIT_FAILURE;\n  }\n  s.argc = argc;\n  s.argv = argv;\n  status = lua_cpcall(L, pmain, &s);\n  report(L, status);\n  lua_close(L);\n  return (status || s.status) ? EXIT_FAILURE : EXIT_SUCCESS;\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/luajit.h",
    "content": "/*\n** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/\n**\n** Copyright (C) 2005-2013 Mike Pall. All rights reserved.\n**\n** Permission is hereby granted, free of charge, to any person obtaining\n** a copy of this software and associated documentation files (the\n** \"Software\"), to deal in the Software without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Software, and to\n** permit persons to whom the Software is furnished to do so, subject to\n** the following conditions:\n**\n** The above copyright notice and this permission notice shall be\n** included in all copies or substantial portions of the Software.\n**\n** THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n**\n** [ MIT license: http://www.opensource.org/licenses/mit-license.php ]\n*/\n\n#ifndef _LUAJIT_H\n#define _LUAJIT_H\n\n#include \"lua.h\"\n\n#define LUAJIT_VERSION\t\t\"LuaJIT 2.0.1\"\n#define LUAJIT_VERSION_NUM\t20001  /* Version 2.0.1 = 02.00.01. */\n#define LUAJIT_VERSION_SYM\tluaJIT_version_2_0_1\n#define LUAJIT_COPYRIGHT\t\"Copyright (C) 2005-2013 Mike Pall\"\n#define LUAJIT_URL\t\t\"http://luajit.org/\"\n\n/* Modes for luaJIT_setmode. */\n#define LUAJIT_MODE_MASK\t0x00ff\n\nenum {\n  LUAJIT_MODE_ENGINE,\t\t/* Set mode for whole JIT engine. */\n  LUAJIT_MODE_DEBUG,\t\t/* Set debug mode (idx = level). */\n\n  LUAJIT_MODE_FUNC,\t\t/* Change mode for a function. */\n  LUAJIT_MODE_ALLFUNC,\t\t/* Recurse into subroutine protos. */\n  LUAJIT_MODE_ALLSUBFUNC,\t/* Change only the subroutines. */\n\n  LUAJIT_MODE_TRACE,\t\t/* Flush a compiled trace. */\n\n  LUAJIT_MODE_WRAPCFUNC = 0x10,\t/* Set wrapper mode for C function calls. */\n\n  LUAJIT_MODE_MAX\n};\n\n/* Flags or'ed in to the mode. */\n#define LUAJIT_MODE_OFF\t\t0x0000\t/* Turn feature off. */\n#define LUAJIT_MODE_ON\t\t0x0100\t/* Turn feature on. */\n#define LUAJIT_MODE_FLUSH\t0x0200\t/* Flush JIT-compiled code. */\n\n/* LuaJIT public C API. */\n\n/* Control the JIT engine. */\nLUA_API int luaJIT_setmode(lua_State *L, int idx, int mode);\n\n/* Enforce (dynamic) linker error for version mismatches. Call from main. */\nLUA_API void LUAJIT_VERSION_SYM(void);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/lualib.h",
    "content": "/*\n** Standard library header.\n** Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n*/\n\n#ifndef _LUALIB_H\n#define _LUALIB_H\n\n#include \"lua.h\"\n\n#define LUA_FILEHANDLE\t\"FILE*\"\n\n#define LUA_COLIBNAME\t\"coroutine\"\n#define LUA_MATHLIBNAME\t\"math\"\n#define LUA_STRLIBNAME\t\"string\"\n#define LUA_TABLIBNAME\t\"table\"\n#define LUA_IOLIBNAME\t\"io\"\n#define LUA_OSLIBNAME\t\"os\"\n#define LUA_LOADLIBNAME\t\"package\"\n#define LUA_DBLIBNAME\t\"debug\"\n#define LUA_BITLIBNAME\t\"bit\"\n#define LUA_JITLIBNAME\t\"jit\"\n#define LUA_FFILIBNAME\t\"ffi\"\n\nLUALIB_API int luaopen_base(lua_State *L);\nLUALIB_API int luaopen_math(lua_State *L);\nLUALIB_API int luaopen_string(lua_State *L);\nLUALIB_API int luaopen_table(lua_State *L);\nLUALIB_API int luaopen_io(lua_State *L);\nLUALIB_API int luaopen_os(lua_State *L);\nLUALIB_API int luaopen_package(lua_State *L);\nLUALIB_API int luaopen_debug(lua_State *L);\nLUALIB_API int luaopen_bit(lua_State *L);\nLUALIB_API int luaopen_jit(lua_State *L);\nLUALIB_API int luaopen_ffi(lua_State *L);\n\nLUALIB_API void luaL_openlibs(lua_State *L);\n\n#ifndef lua_assert\n#define lua_assert(x)\t((void)0)\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/msvcbuild.bat",
    "content": "@rem Script to build LuaJIT with MSVC.\n@rem Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n@rem\n@rem Either open a \"Visual Studio .NET Command Prompt\"\n@rem (Note that the Express Edition does not contain an x64 compiler)\n@rem -or-\n@rem Open a \"Windows SDK Command Shell\" and set the compiler environment:\n@rem     setenv /release /x86\n@rem   -or-\n@rem     setenv /release /x64\n@rem\n@rem Then cd to this directory and run this script.\n\n@if not defined INCLUDE goto :FAIL\n\n@setlocal\n@set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE\n@set LJLINK=link /nologo\n@set LJMT=mt /nologo\n@set LJLIB=lib /nologo\n@set DASMDIR=..\\dynasm\n@set DASM=%DASMDIR%\\dynasm.lua\n@set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c\n\n%LJCOMPILE% host\\minilua.c\n@if errorlevel 1 goto :BAD\n%LJLINK% /out:minilua.exe minilua.obj\n@if errorlevel 1 goto :BAD\nif exist minilua.exe.manifest^\n  %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe\n\n@set DASMFLAGS=-D WIN -D JIT -D FFI -D P64\n@set LJARCH=x64\n@minilua\n@if errorlevel 8 goto :X64\n@set DASMFLAGS=-D WIN -D JIT -D FFI\n@set LJARCH=x86\n:X64\nminilua %DASM% -LN %DASMFLAGS% -o host\\buildvm_arch.h vm_x86.dasc\n@if errorlevel 1 goto :BAD\n\n%LJCOMPILE% /I \".\" /I %DASMDIR% host\\buildvm*.c\n@if errorlevel 1 goto :BAD\n%LJLINK% /out:buildvm.exe buildvm*.obj\n@if errorlevel 1 goto :BAD\nif exist buildvm.exe.manifest^\n  %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe\n\nbuildvm -m peobj -o lj_vm.obj\n@if errorlevel 1 goto :BAD\nbuildvm -m bcdef -o lj_bcdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m ffdef -o lj_ffdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m libdef -o lj_libdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m recdef -o lj_recdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m vmdef -o jit\\vmdef.lua %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m folddef -o lj_folddef.h lj_opt_fold.c\n@if errorlevel 1 goto :BAD\n\n@if \"%1\" neq \"debug\" goto :NODEBUG\n@shift\n@set LJCOMPILE=%LJCOMPILE% /Zi\n@set LJLINK=%LJLINK% /debug\n:NODEBUG\n@if \"%1\"==\"amalg\" goto :AMALGDLL\n@if \"%1\"==\"static\" goto :STATIC\n%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c\n@if errorlevel 1 goto :BAD\n%LJLINK% /DLL /out:lua51.dll lj_*.obj lib_*.obj\n@if errorlevel 1 goto :BAD\n@goto :MTDLL\n:STATIC\n%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c\n@if errorlevel 1 goto :BAD\n%LJLIB% /OUT:lua51.lib lj_*.obj lib_*.obj\n@if errorlevel 1 goto :BAD\n@goto :MTDLL\n:AMALGDLL\n%LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c\n@if errorlevel 1 goto :BAD\n%LJLINK% /DLL /out:lua51.dll ljamalg.obj lj_vm.obj\n@if errorlevel 1 goto :BAD\n:MTDLL\nif exist lua51.dll.manifest^\n  %LJMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2\n\n%LJCOMPILE% luajit.c\n@if errorlevel 1 goto :BAD\n%LJLINK% /out:luajit.exe luajit.obj lua51.lib\n@if errorlevel 1 goto :BAD\nif exist luajit.exe.manifest^\n  %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe\n\n@del *.obj *.manifest minilua.exe buildvm.exe\n@echo.\n@echo === Successfully built LuaJIT for Windows/%LJARCH% ===\n\n@goto :END\n:BAD\n@echo.\n@echo *******************************************************\n@echo *** Build FAILED -- Please check the error messages ***\n@echo *******************************************************\u0007\n@goto :END\n:FAIL\n@echo You must open a \"Visual Studio .NET Command Prompt\" to run this script\n:END\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/vm_arm.dasc",
    "content": "|// Low-level VM code for ARM CPUs.\n|// Bytecode interpreter, fast functions and helper functions.\n|// Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n|\n|.arch arm\n|.section code_op, code_sub\n|\n|.actionlist build_actionlist\n|.globals GLOB_\n|.globalnames globnames\n|.externnames extnames\n|\n|// Note: The ragged indentation of the instructions is intentional.\n|//       The starting columns indicate data dependencies.\n|\n|//-----------------------------------------------------------------------\n|\n|// Fixed register assignments for the interpreter.\n|\n|// The following must be C callee-save.\n|.define MASKR8,\tr4\t// 255*8 constant for fast bytecode decoding.\n|.define KBASE,\t\tr5\t// Constants of current Lua function.\n|.define PC,\t\tr6\t// Next PC.\n|.define DISPATCH,\tr7\t// Opcode dispatch table.\n|.define LREG,\t\tr8\t// Register holding lua_State (also in SAVE_L).\n|\n|// C callee-save in EABI, but often refetched. Temporary in iOS 3.0+.\n|.define BASE,\t\tr9\t// Base of current Lua stack frame.\n|\n|// The following temporaries are not saved across C calls, except for RA/RC.\n|.define RA,\t\tr10\t// Callee-save.\n|.define RC,\t\tr11\t// Callee-save.\n|.define RB,\t\tr12\n|.define OP,\t\tr12\t// Overlaps RB, must not be lr.\n|.define INS,\t\tlr\n|\n|// Calling conventions. Also used as temporaries.\n|.define CARG1,\t\tr0\n|.define CARG2,\t\tr1\n|.define CARG3,\t\tr2\n|.define CARG4,\t\tr3\n|.define CARG12,\tr0\t// For 1st soft-fp double.\n|.define CARG34,\tr2\t// For 2nd soft-fp double.\n|\n|.define CRET1,\t\tr0\n|.define CRET2,\t\tr1\n|\n|// Stack layout while in interpreter. Must match with lj_frame.h.\n|.define SAVE_R4,\t[sp, #28]\n|.define CFRAME_SPACE,\t#28\n|.define SAVE_ERRF,\t[sp, #24]\n|.define SAVE_NRES,\t[sp, #20]\n|.define SAVE_CFRAME,\t[sp, #16]\n|.define SAVE_L,\t[sp, #12]\n|.define SAVE_PC,\t[sp, #8]\n|.define SAVE_MULTRES,\t[sp, #4]\n|.define ARG5,\t\t[sp]\n|\n|.define TMPDhi,\t[sp, #4]\n|.define TMPDlo,\t[sp]\n|.define TMPD,\t\t[sp]\n|.define TMPDp,\t\tsp\n|\n|.if FPU\n|.macro saveregs\n|  push {r5, r6, r7, r8, r9, r10, r11, lr}\n|  vpush {d8-d15}\n|  sub sp, sp, CFRAME_SPACE+4\n|  str r4, SAVE_R4\n|.endmacro\n|.macro restoreregs_ret\n|  ldr r4, SAVE_R4\n|  add sp, sp, CFRAME_SPACE+4\n|  vpop {d8-d15}\n|  pop {r5, r6, r7, r8, r9, r10, r11, pc}\n|.endmacro\n|.else\n|.macro saveregs\n|  push {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n|  sub sp, sp, CFRAME_SPACE\n|.endmacro\n|.macro restoreregs_ret\n|  add sp, sp, CFRAME_SPACE\n|  pop {r4, r5, r6, r7, r8, r9, r10, r11, pc}\n|.endmacro\n|.endif\n|\n|// Type definitions. Some of these are only used for documentation.\n|.type L,\t\tlua_State,\tLREG\n|.type GL,\t\tglobal_State\n|.type TVALUE,\t\tTValue\n|.type GCOBJ,\t\tGCobj\n|.type STR,\t\tGCstr\n|.type TAB,\t\tGCtab\n|.type LFUNC,\t\tGCfuncL\n|.type CFUNC,\t\tGCfuncC\n|.type PROTO,\t\tGCproto\n|.type UPVAL,\t\tGCupval\n|.type NODE,\t\tNode\n|.type NARGS8,\t\tint\n|.type TRACE,\t\tGCtrace\n|\n|//-----------------------------------------------------------------------\n|\n|// Trap for not-yet-implemented parts.\n|.macro NYI; ud; .endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Access to frame relative to BASE.\n|.define FRAME_FUNC,\t#-8\n|.define FRAME_PC,\t#-4\n|\n|.macro decode_RA8, dst, ins; and dst, MASKR8, ins, lsr #5; .endmacro\n|.macro decode_RB8, dst, ins; and dst, MASKR8, ins, lsr #21; .endmacro\n|.macro decode_RC8, dst, ins; and dst, MASKR8, ins, lsr #13; .endmacro\n|.macro decode_RD, dst, ins; lsr dst, ins, #16; .endmacro\n|.macro decode_OP, dst, ins; and dst, ins, #255; .endmacro\n|\n|// Instruction fetch.\n|.macro ins_NEXT1\n|  ldrb OP, [PC]\n|.endmacro\n|.macro ins_NEXT2\n|   ldr INS, [PC], #4\n|.endmacro\n|// Instruction decode+dispatch.\n|.macro ins_NEXT3\n|  ldr OP, [DISPATCH, OP, lsl #2]\n|   decode_RA8 RA, INS\n|   decode_RD RC, INS\n|  bx OP\n|.endmacro\n|.macro ins_NEXT\n|  ins_NEXT1\n|  ins_NEXT2\n|  ins_NEXT3\n|.endmacro\n|\n|// Instruction footer.\n|.if 1\n|  // Replicated dispatch. Less unpredictable branches, but higher I-Cache use.\n|  .define ins_next, ins_NEXT\n|  .define ins_next_, ins_NEXT\n|  .define ins_next1, ins_NEXT1\n|  .define ins_next2, ins_NEXT2\n|  .define ins_next3, ins_NEXT3\n|.else\n|  // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch.\n|  // Affects only certain kinds of benchmarks (and only with -j off).\n|  .macro ins_next\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next1\n|  .endmacro\n|  .macro ins_next2\n|  .endmacro\n|  .macro ins_next3\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next_\n|  ->ins_next:\n|    ins_NEXT\n|  .endmacro\n|.endif\n|\n|// Avoid register name substitution for field name.\n#define field_pc\tpc\n|\n|// Call decode and dispatch.\n|.macro ins_callt\n|  // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n|  ldr PC, LFUNC:CARG3->field_pc\n|  ldrb OP, [PC]  // STALL: load PC. early PC.\n|   ldr INS, [PC], #4\n|  ldr OP, [DISPATCH, OP, lsl #2]  // STALL: load OP. early OP.\n|   decode_RA8 RA, INS\n|   add RA, RA, BASE\n|  bx OP\n|.endmacro\n|\n|.macro ins_call\n|  // BASE = new base, CARG3 = LFUNC/CFUNC, RC = nargs*8, PC = caller PC\n|  str PC, [BASE, FRAME_PC]\n|  ins_callt  // STALL: locked PC.\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Macros to test operand types.\n|.macro checktp, reg, tp; cmn reg, #-tp; .endmacro\n|.macro checktpeq, reg, tp; cmneq reg, #-tp; .endmacro\n|.macro checktpne, reg, tp; cmnne reg, #-tp; .endmacro\n|.macro checkstr, reg, target; checktp reg, LJ_TSTR; bne target; .endmacro\n|.macro checktab, reg, target; checktp reg, LJ_TTAB; bne target; .endmacro\n|.macro checkfunc, reg, target; checktp reg, LJ_TFUNC; bne target; .endmacro\n|\n|// Assumes DISPATCH is relative to GL.\n#define DISPATCH_GL(field)\t(GG_DISP2G + (int)offsetof(global_State, field))\n#define DISPATCH_J(field)\t(GG_DISP2J + (int)offsetof(jit_State, field))\n|\n#define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))\n|\n|.macro hotcheck, delta\n|  lsr CARG1, PC, #1\n|  and CARG1, CARG1, #126\n|  sub CARG1, CARG1, #-GG_DISP2HOT\n|  ldrh CARG2, [DISPATCH, CARG1]\n|  subs CARG2, CARG2, #delta\n|  strh CARG2, [DISPATCH, CARG1]\n|.endmacro\n|\n|.macro hotloop\n|  hotcheck HOTCOUNT_LOOP\n|  blo ->vm_hotloop\n|.endmacro\n|\n|.macro hotcall\n|  hotcheck HOTCOUNT_CALL\n|  blo ->vm_hotcall\n|.endmacro\n|\n|// Set current VM state.\n|.macro mv_vmstate, reg, st; mvn reg, #LJ_VMST_..st; .endmacro\n|.macro st_vmstate, reg; str reg, [DISPATCH, #DISPATCH_GL(vmstate)]; .endmacro\n|\n|// Move table write barrier back. Overwrites mark and tmp.\n|.macro barrierback, tab, mark, tmp\n|  ldr tmp, [DISPATCH, #DISPATCH_GL(gc.grayagain)]\n|   bic mark, mark, #LJ_GC_BLACK\t\t// black2gray(tab)\n|  str tab, [DISPATCH, #DISPATCH_GL(gc.grayagain)]\n|   strb mark, tab->marked\n|  str tmp, tab->gclist\n|.endmacro\n|\n|.macro .IOS, a, b\n|.if IOS\n|  a, b\n|.endif\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n\n#if !LJ_DUALNUM\n#error \"Only dual-number mode supported for ARM target\"\n#endif\n\n/* Generate subroutines used by opcodes and other parts of the VM. */\n/* The .code_sub section should be last to help static branch prediction. */\nstatic void build_subroutines(BuildCtx *ctx)\n{\n  |.code_sub\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Return handling ----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_returnp:\n  |  // See vm_return. Also: RB = previous base.\n  |  tst PC, #FRAME_P\n  |  beq ->cont_dispatch\n  |\n  |  // Return from pcall or xpcall fast func.\n  |  ldr PC, [RB, FRAME_PC]\t\t// Fetch PC of previous frame.\n  |   mvn CARG2, #~LJ_TTRUE\n  |  mov BASE, RB\n  |  // Prepending may overwrite the pcall frame, so do it at the end.\n  |   str CARG2, [RA, FRAME_PC]\t\t// Prepend true to results.\n  |  sub RA, RA, #8\n  |\n  |->vm_returnc:\n  |  adds RC, RC, #8\t\t\t// RC = (nresults+1)*8.\n  |  mov CRET1, #LUA_YIELD\n  |  beq ->vm_unwind_c_eh\n  |  str RC, SAVE_MULTRES\n  |  ands CARG1, PC, #FRAME_TYPE\n  |  beq ->BC_RET_Z\t\t\t// Handle regular return to Lua.\n  |\n  |->vm_return:\n  |  // BASE = base, RA = resultptr, RC/MULTRES = (nresults+1)*8, PC = return\n  |  // CARG1 = PC & FRAME_TYPE\n  |  bic RB, PC, #FRAME_TYPEP\n  |   cmp CARG1, #FRAME_C\n  |  sub RB, BASE, RB\t\t\t// RB = previous base.\n  |   bne ->vm_returnp\n  |\n  |  str RB, L->base\n  |   ldr KBASE, SAVE_NRES\n  |    mv_vmstate CARG4, C\n  |   sub BASE, BASE, #8\n  |  subs CARG3, RC, #8\n  |   lsl KBASE, KBASE, #3\t\t// KBASE = (nresults_wanted+1)*8\n  |    st_vmstate CARG4\n  |  beq >2\n  |1:\n  |  subs CARG3, CARG3, #8\n  |   ldrd CARG12, [RA], #8\n  |   strd CARG12, [BASE], #8\n  |  bne <1\n  |2:\n  |  cmp KBASE, RC\t\t\t// More/less results wanted?\n  |  bne >6\n  |3:\n  |  str BASE, L->top\t\t\t// Store new top.\n  |\n  |->vm_leave_cp:\n  |  ldr RC, SAVE_CFRAME\t\t// Restore previous C frame.\n  |   mov CRET1, #0\t\t\t// Ok return status for vm_pcall.\n  |  str RC, L->cframe\n  |\n  |->vm_leave_unw:\n  |  restoreregs_ret\n  |\n  |6:\n  |  blt >7\t\t\t\t// Less results wanted?\n  |  // More results wanted. Check stack size and fill up results with nil.\n  |  ldr CARG3, L->maxstack\n  |   mvn CARG2, #~LJ_TNIL\n  |  cmp BASE, CARG3\n  |  bhs >8\n  |   str CARG2, [BASE, #4]\n  |  add RC, RC, #8\n  |  add BASE, BASE, #8\n  |  b <2\n  |\n  |7:  // Less results wanted.\n  |  sub CARG1, RC, KBASE\n  |  cmp KBASE, #0\t\t\t// LUA_MULTRET+1 case?\n  |  subne BASE, BASE, CARG1\t\t// Either keep top or shrink it.\n  |  b <3\n  |\n  |8:  // Corner case: need to grow stack for filling up results.\n  |  // This can happen if:\n  |  // - A C function grows the stack (a lot).\n  |  // - The GC shrinks the stack in between.\n  |  // - A return back from a lua_call() with (high) nresults adjustment.\n  |  str BASE, L->top\t\t\t// Save current top held in BASE (yes).\n  |  mov CARG2, KBASE\n  |  mov CARG1, L\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  ldr BASE, L->top\t\t\t// Need the (realloced) L->top in BASE.\n  |  b <2\n  |\n  |->vm_unwind_c:\t\t\t// Unwind C stack, return from vm_pcall.\n  |  // (void *cframe, int errcode)\n  |  mov sp, CARG1\n  |  mov CRET1, CARG2\n  |->vm_unwind_c_eh:\t\t\t// Landing pad for external unwinder.\n  |  ldr L, SAVE_L\n  |   mv_vmstate CARG4, C\n  |  ldr GL:CARG3, L->glref\n  |   str CARG4, GL:CARG3->vmstate\n  |  b ->vm_leave_unw\n  |\n  |->vm_unwind_ff:\t\t\t// Unwind C stack, return from ff pcall.\n  |  // (void *cframe)\n  |  bic CARG1, CARG1, #~CFRAME_RAWMASK\t// Use two steps: bic sp is deprecated.\n  |  mov sp, CARG1\n  |->vm_unwind_ff_eh:\t\t\t// Landing pad for external unwinder.\n  |  ldr L, SAVE_L\n  |   mov MASKR8, #255\n  |    mov RC, #16\t\t\t// 2 results: false + error message.\n  |   lsl MASKR8, MASKR8, #3\t\t// MASKR8 = 255*8.\n  |  ldr BASE, L->base\n  |   ldr DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |    mvn CARG1, #~LJ_TFALSE\n  |  sub RA, BASE, #8\t\t\t// Results start at BASE-8.\n  |  ldr PC, [BASE, FRAME_PC]\t\t// Fetch PC of previous frame.\n  |   add DISPATCH, DISPATCH, #GG_G2DISP\n  |   mv_vmstate CARG2, INTERP\n  |    str CARG1, [BASE, #-4]\t\t// Prepend false to error message.\n  |   st_vmstate CARG2\n  |  b ->vm_returnc\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Grow stack for calls -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_growstack_c:\t\t\t// Grow stack for C function.\n  |  // CARG1 = L\n  |  mov CARG2, #LUA_MINSTACK\n  |  b >2\n  |\n  |->vm_growstack_l:\t\t\t// Grow stack for Lua function.\n  |  // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC\n  |  add RC, BASE, RC\n  |   sub RA, RA, BASE\n  |    mov CARG1, L\n  |  str BASE, L->base\n  |   add PC, PC, #4\t\t\t// Must point after first instruction.\n  |  str RC, L->top\n  |   lsr CARG3, RA, #3\n  |2:\n  |  // L->base = new base, L->top = top\n  |  str PC, SAVE_PC\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  ldr BASE, L->base\n  |   ldr RC, L->top\n  |  ldr LFUNC:CARG3, [BASE, FRAME_FUNC]\n  |   sub NARGS8:RC, RC, BASE\n  |  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n  |  ins_callt\t\t\t\t// Just retry the call.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Entry points into the assembler VM ---------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_resume:\t\t\t\t// Setup C frame and resume thread.\n  |  // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0)\n  |  saveregs\n  |  mov L, CARG1\n  |    ldr DISPATCH, L:CARG1->glref\t// Setup pointer to dispatch table.\n  |  mov BASE, CARG2\n  |    add DISPATCH, DISPATCH, #GG_G2DISP\n  |   str L, SAVE_L\n  |  mov PC, #FRAME_CP\n  |   str CARG3, SAVE_NRES\n  |    add CARG2, sp, #CFRAME_RESUME\n  |  ldrb CARG1, L->status\n  |   str CARG3, SAVE_ERRF\n  |    str CARG2, L->cframe\n  |   str CARG3, SAVE_CFRAME\n  |  cmp CARG1, #0\n  |   str L, SAVE_PC\t\t\t// Any value outside of bytecode is ok.\n  |  beq >3\n  |\n  |  // Resume after yield (like a return).\n  |  mov RA, BASE\n  |   ldr BASE, L->base\n  |   ldr CARG1, L->top\n  |    mov MASKR8, #255\n  |     strb CARG3, L->status\n  |   sub RC, CARG1, BASE\n  |  ldr PC, [BASE, FRAME_PC]\n  |    lsl MASKR8, MASKR8, #3\t\t// MASKR8 = 255*8.\n  |     mv_vmstate CARG2, INTERP\n  |   add RC, RC, #8\n  |  ands CARG1, PC, #FRAME_TYPE\n  |     st_vmstate CARG2\n  |   str RC, SAVE_MULTRES\n  |  beq ->BC_RET_Z\n  |  b ->vm_return\n  |\n  |->vm_pcall:\t\t\t\t// Setup protected C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef)\n  |  saveregs\n  |  mov PC, #FRAME_CP\n  |  str CARG4, SAVE_ERRF\n  |  b >1\n  |\n  |->vm_call:\t\t\t\t// Setup C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1)\n  |  saveregs\n  |  mov PC, #FRAME_C\n  |\n  |1:  // Entry point for vm_pcall above (PC = ftype).\n  |  ldr RC, L:CARG1->cframe\n  |   str CARG3, SAVE_NRES\n  |    mov L, CARG1\n  |   str CARG1, SAVE_L\n  |    mov BASE, CARG2\n  |  str sp, L->cframe\t\t\t// Add our C frame to cframe chain.\n  |    ldr DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |   str CARG1, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |  str RC, SAVE_CFRAME\n  |    add DISPATCH, DISPATCH, #GG_G2DISP\n  |\n  |3:  // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype).\n  |  ldr RB, L->base\t\t\t// RB = old base (for vmeta_call).\n  |   ldr CARG1, L->top\n  |    mov MASKR8, #255\n  |  add PC, PC, BASE\n  |    lsl MASKR8, MASKR8, #3\t\t// MASKR8 = 255*8.\n  |  sub PC, PC, RB\t\t\t// PC = frame delta + frame type\n  |    mv_vmstate CARG2, INTERP\n  |   sub NARGS8:RC, CARG1, BASE\n  |    st_vmstate CARG2\n  |\n  |->vm_call_dispatch:\n  |  // RB = old base, BASE = new base, RC = nargs*8, PC = caller PC\n  |  ldrd CARG34, [BASE, FRAME_FUNC]\n  |  checkfunc CARG4, ->vmeta_call\n  |\n  |->vm_call_dispatch_f:\n  |  ins_call\n  |  // BASE = new base, CARG3 = func, RC = nargs*8, PC = caller PC\n  |\n  |->vm_cpcall:\t\t\t\t// Setup protected C frame, call C.\n  |  // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp)\n  |  saveregs\n  |  mov L, CARG1\n  |   ldr RA, L:CARG1->stack\n  |  str CARG1, SAVE_L\n  |   ldr RB, L->top\n  |  str CARG1, SAVE_PC\t\t\t// Any value outside of bytecode is ok.\n  |  ldr RC, L->cframe\n  |   sub RA, RA, RB\t\t\t// Compute -savestack(L, L->top).\n  |  str sp, L->cframe\t\t\t// Add our C frame to cframe chain.\n  |  mov RB, #0\n  |   str RA, SAVE_NRES\t\t\t// Neg. delta means cframe w/o frame.\n  |  str RB, SAVE_ERRF\t\t\t// No error function.\n  |  str RC, SAVE_CFRAME\n  |  blx CARG4\t\t\t// (lua_State *L, lua_CFunction func, void *ud)\n  |   ldr DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |  movs BASE, CRET1\n  |    mov PC, #FRAME_CP\n  |   add DISPATCH, DISPATCH, #GG_G2DISP\n  |  bne <3\t\t\t\t// Else continue with the call.\n  |  b ->vm_leave_cp\t\t\t// No base? Just remove C frame.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Metamethod handling ------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |//-- Continuation dispatch ----------------------------------------------\n  |\n  |->cont_dispatch:\n  |  // BASE = meta base, RA = resultptr, RC = (nresults+1)*8\n  |  ldr LFUNC:CARG3, [RB, FRAME_FUNC]\n  |    ldr CARG1, [BASE, #-16]\t\t// Get continuation.\n  |   mov CARG4, BASE\n  |   mov BASE, RB\t\t\t// Restore caller BASE.\n  |.if FFI\n  |    cmp CARG1, #1\n  |.endif\n  |   ldr PC, [CARG4, #-12]\t\t// Restore PC from [cont|PC].\n  |  ldr CARG3, LFUNC:CARG3->field_pc\n  |    mvn INS, #~LJ_TNIL\n  |    add CARG2, RA, RC\n  |    str INS, [CARG2, #-4]\t\t// Ensure one valid arg.\n  |.if FFI\n  |    bls >1\n  |.endif\n  |  ldr KBASE, [CARG3, #PC2PROTO(k)]\n  |  // BASE = base, RA = resultptr, CARG4 = meta base\n  |    bx CARG1\n  |\n  |.if FFI\n  |1:\n  |  beq ->cont_ffi_callback\t\t// cont = 1: return from FFI callback.\n  |  // cont = 0: tailcall from C function.\n  |  ldr CARG3, [BASE, FRAME_FUNC]\n  |   sub CARG4, CARG4, #16\n  |   sub RC, CARG4, BASE\n  |  b ->vm_call_tail\n  |.endif\n  |\n  |->cont_cat:\t\t\t\t// RA = resultptr, CARG4 = meta base\n  |  ldr INS, [PC, #-4]\n  |   sub CARG2, CARG4, #16\n  |   ldrd CARG34, [RA]\n  |     str BASE, L->base\n  |  decode_RB8 RC, INS\n  |   decode_RA8 RA, INS\n  |  add CARG1, BASE, RC\n  |  subs CARG1, CARG2, CARG1\n  |   strdne CARG34, [CARG2]\n  |   movne CARG3, CARG1\n  |  bne ->BC_CAT_Z\n  |   strd CARG34, [BASE, RA]\n  |  b ->cont_nop\n  |\n  |//-- Table indexing metamethods -----------------------------------------\n  |\n  |->vmeta_tgets1:\n  |  add CARG2, BASE, RB\n  |  b >2\n  |\n  |->vmeta_tgets:\n  |  sub CARG2, DISPATCH, #-DISPATCH_GL(tmptv)\n  |   mvn CARG4, #~LJ_TTAB\n  |  str TAB:RB, [CARG2]\n  |   str CARG4, [CARG2, #4]\n  |2:\n  |   mvn CARG4, #~LJ_TSTR\n  |  str STR:RC, TMPDlo\n  |   str CARG4, TMPDhi\n  |  mov CARG3, TMPDp\n  |  b >1\n  |\n  |->vmeta_tgetb:\t\t\t// RC = index\n  |  decode_RB8 RB, INS\n  |   str RC, TMPDlo\n  |   mvn CARG4, #~LJ_TISNUM\n  |  add CARG2, BASE, RB\n  |   str CARG4, TMPDhi\n  |  mov CARG3, TMPDp\n  |  b >1\n  |\n  |->vmeta_tgetv:\n  |  add CARG2, BASE, RB\n  |   add CARG3, BASE, RC\n  |1:\n  |   str BASE, L->base\n  |  mov CARG1, L\n  |   str PC, SAVE_PC\n  |  bl extern lj_meta_tget\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  .IOS ldr BASE, L->base\n  |  cmp CRET1, #0\n  |  beq >3\n  |  ldrd CARG34, [CRET1]\n  |   ins_next1\n  |   ins_next2\n  |  strd CARG34, [BASE, RA]\n  |   ins_next3\n  |\n  |3:  // Call __index metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k\n  |   rsb CARG1, BASE, #FRAME_CONT\n  |  ldr BASE, L->top\n  |    mov NARGS8:RC, #16\t\t// 2 args for func(t, k).\n  |    str PC, [BASE, #-12]\t\t// [cont|PC]\n  |   add PC, CARG1, BASE\n  |  ldr LFUNC:CARG3, [BASE, FRAME_FUNC]  // Guaranteed to be a function here.\n  |  b ->vm_call_dispatch_f\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->vmeta_tsets1:\n  |  add CARG2, BASE, RB\n  |  b >2\n  |\n  |->vmeta_tsets:\n  |  sub CARG2, DISPATCH, #-DISPATCH_GL(tmptv)\n  |   mvn CARG4, #~LJ_TTAB\n  |  str TAB:RB, [CARG2]\n  |   str CARG4, [CARG2, #4]\n  |2:\n  |   mvn CARG4, #~LJ_TSTR\n  |  str STR:RC, TMPDlo\n  |   str CARG4, TMPDhi\n  |  mov CARG3, TMPDp\n  |  b >1\n  |\n  |->vmeta_tsetb:\t\t\t// RC = index\n  |  decode_RB8 RB, INS\n  |   str RC, TMPDlo\n  |   mvn CARG4, #~LJ_TISNUM\n  |  add CARG2, BASE, RB\n  |   str CARG4, TMPDhi\n  |  mov CARG3, TMPDp\n  |  b >1\n  |\n  |->vmeta_tsetv:\n  |  add CARG2, BASE, RB\n  |   add CARG3, BASE, RC\n  |1:\n  |   str BASE, L->base\n  |  mov CARG1, L\n  |   str PC, SAVE_PC\n  |  bl extern lj_meta_tset\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  .IOS ldr BASE, L->base\n  |  cmp CRET1, #0\n  |   ldrd CARG34, [BASE, RA]\n  |  beq >3\n  |   ins_next1\n  |  // NOBARRIER: lj_meta_tset ensures the table is not black.\n  |  strd CARG34, [CRET1]\n  |   ins_next2\n  |   ins_next3\n  |\n  |3:  // Call __newindex metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k/(v)\n  |   rsb CARG1, BASE, #FRAME_CONT\n  |  ldr BASE, L->top\n  |    mov NARGS8:RC, #24\t\t// 3 args for func(t, k, v).\n  |   strd CARG34, [BASE, #16]\t\t// Copy value to third argument.\n  |    str PC, [BASE, #-12]\t\t// [cont|PC]\n  |   add PC, CARG1, BASE\n  |  ldr LFUNC:CARG3, [BASE, FRAME_FUNC]  // Guaranteed to be a function here.\n  |  b ->vm_call_dispatch_f\n  |\n  |//-- Comparison metamethods ---------------------------------------------\n  |\n  |->vmeta_comp:\n  |  mov CARG1, L\n  |   sub PC, PC, #4\n  |  mov CARG2, RA\n  |   str BASE, L->base\n  |  mov CARG3, RC\n  |   str PC, SAVE_PC\n  |  decode_OP CARG4, INS\n  |  bl extern lj_meta_comp  // (lua_State *L, TValue *o1, *o2, int op)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |3:\n  |  .IOS ldr BASE, L->base\n  |  cmp CRET1, #1\n  |  bhi ->vmeta_binop\n  |4:\n  |  ldrh RB, [PC, #2]\n  |   add PC, PC, #4\n  |  add RB, PC, RB, lsl #2\n  |  subhs PC, RB, #0x20000\n  |->cont_nop:\n  |  ins_next\n  |\n  |->cont_ra:\t\t\t\t// RA = resultptr\n  |  ldr INS, [PC, #-4]\n  |   ldrd CARG12, [RA]\n  |  decode_RA8 CARG3, INS\n  |   strd CARG12, [BASE, CARG3]\n  |  b ->cont_nop\n  |\n  |->cont_condt:\t\t\t// RA = resultptr\n  |  ldr CARG2, [RA, #4]\n  |   mvn CARG1, #~LJ_TTRUE\n  |  cmp CARG1, CARG2\t\t\t// Branch if result is true.\n  |  b <4\n  |\n  |->cont_condf:\t\t\t// RA = resultptr\n  |  ldr CARG2, [RA, #4]\n  |  checktp CARG2, LJ_TFALSE\t\t// Branch if result is false.\n  |  b <4\n  |\n  |->vmeta_equal:\n  |  // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV.\n  |  sub PC, PC, #4\n  |   str BASE, L->base\n  |   mov CARG1, L\n  |  str PC, SAVE_PC\n  |  bl extern lj_meta_equal  // (lua_State *L, GCobj *o1, *o2, int ne)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |  b <3\n  |\n  |->vmeta_equal_cd:\n  |.if FFI\n  |  sub PC, PC, #4\n  |   str BASE, L->base\n  |   mov CARG1, L\n  |   mov CARG2, INS\n  |  str PC, SAVE_PC\n  |  bl extern lj_meta_equal_cd\t\t// (lua_State *L, BCIns op)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |  b <3\n  |.endif\n  |\n  |//-- Arithmetic metamethods ---------------------------------------------\n  |\n  |->vmeta_arith_vn:\n  |  decode_RB8 RB, INS\n  |   decode_RC8 RC, INS\n  |  add CARG3, BASE, RB\n  |   add CARG4, KBASE, RC\n  |  b >1\n  |\n  |->vmeta_arith_nv:\n  |  decode_RB8 RB, INS\n  |   decode_RC8 RC, INS\n  |  add CARG4, BASE, RB\n  |   add CARG3, KBASE, RC\n  |  b >1\n  |\n  |->vmeta_unm:\n  |  ldr INS, [PC, #-8]\n  |   sub PC, PC, #4\n  |  add CARG3, BASE, RC\n  |  add CARG4, BASE, RC\n  |  b >1\n  |\n  |->vmeta_arith_vv:\n  |  decode_RB8 RB, INS\n  |   decode_RC8 RC, INS\n  |  add CARG3, BASE, RB\n  |   add CARG4, BASE, RC\n  |1:\n  |  decode_OP OP, INS\n  |   add CARG2, BASE, RA\n  |    str BASE, L->base\n  |   mov CARG1, L\n  |    str PC, SAVE_PC\n  |  str OP, ARG5\n  |  bl extern lj_meta_arith  // (lua_State *L, TValue *ra,*rb,*rc, BCReg op)\n  |  // Returns NULL (finished) or TValue * (metamethod).\n  |  .IOS ldr BASE, L->base\n  |  cmp CRET1, #0\n  |  beq ->cont_nop\n  |\n  |  // Call metamethod for binary op.\n  |->vmeta_binop:\n  |  // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2\n  |  sub CARG2, CRET1, BASE\n  |   str PC, [CRET1, #-12]\t\t// [cont|PC]\n  |  add PC, CARG2, #FRAME_CONT\n  |   mov BASE, CRET1\n  |    mov NARGS8:RC, #16\t\t// 2 args for func(o1, o2).\n  |  b ->vm_call_dispatch\n  |\n  |->vmeta_len:\n  |  add CARG2, BASE, RC\n  |   str BASE, L->base\n  |  mov CARG1, L\n  |   str PC, SAVE_PC\n  |  bl extern lj_meta_len\t\t// (lua_State *L, TValue *o)\n  |  // Returns NULL (retry) or TValue * (metamethod base).\n  |  .IOS ldr BASE, L->base\n#if LJ_52\n  |  cmp CRET1, #0\n  |  bne ->vmeta_binop\t\t\t// Binop call for compatibility.\n  |  ldr TAB:CARG1, [BASE, RC]\n  |  b ->BC_LEN_Z\n#else\n  |  b ->vmeta_binop\t\t\t// Binop call for compatibility.\n#endif\n  |\n  |//-- Call metamethod ----------------------------------------------------\n  |\n  |->vmeta_call:\t\t\t// Resolve and call __call metamethod.\n  |  // RB = old base, BASE = new base, RC = nargs*8\n  |  mov CARG1, L\n  |   str RB, L->base\t\t\t// This is the callers base!\n  |  sub CARG2, BASE, #8\n  |   str PC, SAVE_PC\n  |  add CARG3, BASE, NARGS8:RC\n  |  .IOS mov RA, BASE\n  |  bl extern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |  .IOS mov BASE, RA\n  |  ldr LFUNC:CARG3, [BASE, FRAME_FUNC]  // Guaranteed to be a function here.\n  |   add NARGS8:RC, NARGS8:RC, #8\t// Got one more argument now.\n  |  ins_call\n  |\n  |->vmeta_callt:\t\t\t// Resolve __call for BC_CALLT.\n  |  // BASE = old base, RA = new base, RC = nargs*8\n  |  mov CARG1, L\n  |   str BASE, L->base\n  |  sub CARG2, RA, #8\n  |   str PC, SAVE_PC\n  |  add CARG3, RA, NARGS8:RC\n  |  bl extern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |  .IOS ldr BASE, L->base\n  |  ldr LFUNC:CARG3, [RA, FRAME_FUNC]  // Guaranteed to be a function here.\n  |   ldr PC, [BASE, FRAME_PC]\n  |    add NARGS8:RC, NARGS8:RC, #8\t// Got one more argument now.\n  |  b ->BC_CALLT2_Z\n  |\n  |//-- Argument coercion for 'for' statement ------------------------------\n  |\n  |->vmeta_for:\n  |  mov CARG1, L\n  |   str BASE, L->base\n  |  mov CARG2, RA\n  |   str PC, SAVE_PC\n  |  bl extern lj_meta_for\t// (lua_State *L, TValue *base)\n  |  .IOS ldr BASE, L->base\n  |.if JIT\n  |   ldrb OP, [PC, #-4]\n  |.endif\n  |  ldr INS, [PC, #-4]\n  |.if JIT\n  |   cmp OP, #BC_JFORI\n  |.endif\n  |  decode_RA8 RA, INS\n  |  decode_RD RC, INS\n  |.if JIT\n  |   beq =>BC_JFORI\n  |.endif\n  |  b =>BC_FORI\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Fast functions -----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |.macro .ffunc, name\n  |->ff_ .. name:\n  |.endmacro\n  |\n  |.macro .ffunc_1, name\n  |->ff_ .. name:\n  |  ldrd CARG12, [BASE]\n  |   cmp NARGS8:RC, #8\n  |   blo ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_2, name\n  |->ff_ .. name:\n  |  ldrd CARG12, [BASE]\n  |   ldrd CARG34, [BASE, #8]\n  |    cmp NARGS8:RC, #16\n  |    blo ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_n, name\n  |  .ffunc_1 name\n  |  checktp CARG2, LJ_TISNUM\n  |  bhs ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_nn, name\n  |  .ffunc_2 name\n  |  checktp CARG2, LJ_TISNUM\n  |  cmnlo CARG4, #-LJ_TISNUM\n  |  bhs ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_d, name\n  |  .ffunc name\n  |  ldr CARG2, [BASE, #4]\n  |   cmp NARGS8:RC, #8\n  |  vldr d0, [BASE]\n  |   blo ->fff_fallback\n  |  checktp CARG2, LJ_TISNUM\n  |  bhs ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_dd, name\n  |  .ffunc name\n  |  ldr CARG2, [BASE, #4]\n  |  ldr CARG4, [BASE, #12]\n  |   cmp NARGS8:RC, #16\n  |  vldr d0, [BASE]\n  |  vldr d1, [BASE, #8]\n  |   blo ->fff_fallback\n  |  checktp CARG2, LJ_TISNUM\n  |  cmnlo CARG4, #-LJ_TISNUM\n  |  bhs ->fff_fallback\n  |.endmacro\n  |\n  |// Inlined GC threshold check. Caveat: uses CARG1 and CARG2.\n  |.macro ffgccheck\n  |  ldr CARG1, [DISPATCH, #DISPATCH_GL(gc.total)]\n  |  ldr CARG2, [DISPATCH, #DISPATCH_GL(gc.threshold)]\n  |  cmp CARG1, CARG2\n  |  blge ->fff_gcstep\n  |.endmacro\n  |\n  |//-- Base library: checks -----------------------------------------------\n  |\n  |.ffunc_1 assert\n  |  checktp CARG2, LJ_TTRUE\n  |  bhi ->fff_fallback\n  |   ldr PC, [BASE, FRAME_PC]\n  |  strd CARG12, [BASE, #-8]\n  |  mov RB, BASE\n  |  subs RA, NARGS8:RC, #8\n  |   add RC, NARGS8:RC, #8\t\t// Compute (nresults+1)*8.\n  |  beq ->fff_res\t\t\t// Done if exactly 1 argument.\n  |1:\n  |   ldrd CARG12, [RB, #8]\n  |  subs RA, RA, #8\n  |   strd CARG12, [RB], #8\n  |  bne <1\n  |  b ->fff_res\n  |\n  |.ffunc type\n  |  ldr CARG2, [BASE, #4]\n  |   cmp NARGS8:RC, #8\n  |   blo ->fff_fallback\n  |  checktp CARG2, LJ_TISNUM\n  |  mvnlo CARG2, #~LJ_TISNUM\n  |  rsb CARG4, CARG2, #(int)(offsetof(GCfuncC, upvalue)>>3)-1\n  |  lsl CARG4, CARG4, #3\n  |  ldrd CARG12, [CFUNC:CARG3, CARG4]\n  |  b ->fff_restv\n  |\n  |//-- Base library: getters and setters ---------------------------------\n  |\n  |.ffunc_1 getmetatable\n  |  checktp CARG2, LJ_TTAB\n  |  cmnne CARG2, #-LJ_TUDATA\n  |  bne >6\n  |1:  // Field metatable must be at same offset for GCtab and GCudata!\n  |  ldr TAB:RB, TAB:CARG1->metatable\n  |2:\n  |   mvn CARG2, #~LJ_TNIL\n  |   ldr STR:RC, [DISPATCH, #DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])]\n  |  cmp TAB:RB, #0\n  |  beq ->fff_restv\n  |  ldr CARG3, TAB:RB->hmask\n  |   ldr CARG4, STR:RC->hash\n  |    ldr NODE:INS, TAB:RB->node\n  |  and CARG3, CARG3, CARG4\t\t// idx = str->hash & tab->hmask\n  |  add CARG3, CARG3, CARG3, lsl #1\n  |    add NODE:INS, NODE:INS, CARG3, lsl #3\t// node = tab->node + idx*3*8\n  |3:  // Rearranged logic, because we expect _not_ to find the key.\n  |  ldrd CARG34, NODE:INS->key  // STALL: early NODE:INS.\n  |   ldrd CARG12, NODE:INS->val\n  |    ldr NODE:INS, NODE:INS->next\n  |  checktp CARG4, LJ_TSTR\n  |  cmpeq CARG3, STR:RC\n  |  beq >5\n  |  cmp NODE:INS, #0\n  |  bne <3\n  |4:\n  |  mov CARG1, RB\t\t\t// Use metatable as default result.\n  |  mvn CARG2, #~LJ_TTAB\n  |  b ->fff_restv\n  |5:\n  |  checktp CARG2, LJ_TNIL\n  |  bne ->fff_restv\n  |  b <4\n  |\n  |6:\n  |  checktp CARG2, LJ_TISNUM\n  |  mvnhs CARG2, CARG2\n  |  movlo CARG2, #~LJ_TISNUM\n  |  add CARG4, DISPATCH, CARG2, lsl #2\n  |  ldr TAB:RB, [CARG4, #DISPATCH_GL(gcroot[GCROOT_BASEMT])]\n  |  b <2\n  |\n  |.ffunc_2 setmetatable\n  |  // Fast path: no mt for table yet and not clearing the mt.\n  |  checktp CARG2, LJ_TTAB\n  |   ldreq TAB:RB, TAB:CARG1->metatable\n  |  checktpeq CARG4, LJ_TTAB\n  |    ldrbeq CARG4, TAB:CARG1->marked\n  |   cmpeq TAB:RB, #0\n  |  bne ->fff_fallback\n  |    tst CARG4, #LJ_GC_BLACK\t\t// isblack(table)\n  |     str TAB:CARG3, TAB:CARG1->metatable\n  |    beq ->fff_restv\n  |  barrierback TAB:CARG1, CARG4, CARG3\n  |  b ->fff_restv\n  |\n  |.ffunc rawget\n  |  ldrd CARG34, [BASE]\n  |   cmp NARGS8:RC, #16\n  |   blo ->fff_fallback\n  |   mov CARG2, CARG3\n  |  checktab CARG4, ->fff_fallback\n  |   mov CARG1, L\n  |   add CARG3, BASE, #8\n  |  .IOS mov RA, BASE\n  |  bl extern lj_tab_get  // (lua_State *L, GCtab *t, cTValue *key)\n  |  // Returns cTValue *.\n  |  .IOS mov BASE, RA\n  |  ldrd CARG12, [CRET1]\n  |  b ->fff_restv\n  |\n  |//-- Base library: conversions ------------------------------------------\n  |\n  |.ffunc tonumber\n  |  // Only handles the number case inline (without a base argument).\n  |  ldrd CARG12, [BASE]\n  |   cmp NARGS8:RC, #8\n  |   bne ->fff_fallback\n  |  checktp CARG2, LJ_TISNUM\n  |  bls ->fff_restv\n  |  b ->fff_fallback\n  |\n  |.ffunc_1 tostring\n  |  // Only handles the string or number case inline.\n  |  checktp CARG2, LJ_TSTR\n  |  // A __tostring method in the string base metatable is ignored.\n  |  beq ->fff_restv\n  |  // Handle numbers inline, unless a number base metatable is present.\n  |  ldr CARG4, [DISPATCH, #DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])]\n  |   str BASE, L->base\n  |  checktp CARG2, LJ_TISNUM\n  |  cmpls CARG4, #0\n  |   str PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  bhi ->fff_fallback\n  |  ffgccheck\n  |  mov CARG1, L\n  |  mov CARG2, BASE\n  |  bl extern lj_str_fromnumber\t// (lua_State *L, cTValue *o)\n  |  // Returns GCstr *.\n  |  ldr BASE, L->base\n  |  mvn CARG2, #~LJ_TSTR\n  |  b ->fff_restv\n  |\n  |//-- Base library: iterators -------------------------------------------\n  |\n  |.ffunc_1 next\n  |   mvn CARG4, #~LJ_TNIL\n  |  checktab CARG2, ->fff_fallback\n  |   strd CARG34, [BASE, NARGS8:RC]\t// Set missing 2nd arg to nil.\n  |   ldr PC, [BASE, FRAME_PC]\n  |  mov CARG2, CARG1\n  |    str BASE, L->base\t\t// Add frame since C call can throw.\n  |  mov CARG1, L\n  |    str BASE, L->top\t\t\t// Dummy frame length is ok.\n  |  add CARG3, BASE, #8\n  |   str PC, SAVE_PC\n  |  bl extern lj_tab_next\t// (lua_State *L, GCtab *t, TValue *key)\n  |  // Returns 0 at end of traversal.\n  |  .IOS ldr BASE, L->base\n  |  cmp CRET1, #0\n  |  mvneq CRET2, #~LJ_TNIL\n  |  beq ->fff_restv\t\t\t// End of traversal: return nil.\n  |  ldrd CARG12, [BASE, #8]\t\t// Copy key and value to results.\n  |   ldrd CARG34, [BASE, #16]\n  |    mov RC, #(2+1)*8\n  |  strd CARG12, [BASE, #-8]\n  |   strd CARG34, [BASE]\n  |  b ->fff_res\n  |\n  |.ffunc_1 pairs\n  |  checktab CARG2, ->fff_fallback\n#if LJ_52\n  |  ldr TAB:RB, TAB:CARG1->metatable\n#endif\n  |   ldrd CFUNC:CARG34, CFUNC:CARG3->upvalue[0]\n  |    ldr PC, [BASE, FRAME_PC]\n#if LJ_52\n  |  cmp TAB:RB, #0\n  |  bne ->fff_fallback\n#endif\n  |  mvn CARG2, #~LJ_TNIL\n  |    mov RC, #(3+1)*8\n  |   strd CFUNC:CARG34, [BASE, #-8]\n  |  str CARG2, [BASE, #12]\n  |  b ->fff_res\n  |\n  |.ffunc_2 ipairs_aux\n  |  checktp CARG2, LJ_TTAB\n  |  checktpeq CARG4, LJ_TISNUM\n  |  bne ->fff_fallback\n  |  ldr RB, TAB:CARG1->asize\n  |   ldr RC, TAB:CARG1->array\n  |  add CARG3, CARG3, #1\n  |    ldr PC, [BASE, FRAME_PC]\n  |  cmp CARG3, RB\n  |   add RC, RC, CARG3, lsl #3\n  |  strd CARG34, [BASE, #-8]\n  |   ldrdlo CARG12, [RC]\n  |   mov RC, #(0+1)*8\n  |  bhs >2\t\t\t\t// Not in array part?\n  |1:\n  |   checktp CARG2, LJ_TNIL\n  |   movne RC, #(2+1)*8\n  |   strdne CARG12, [BASE]\n  |  b ->fff_res\n  |2:  // Check for empty hash part first. Otherwise call C function.\n  |  ldr RB, TAB:CARG1->hmask\n  |   mov CARG2, CARG3\n  |  cmp RB, #0\n  |  beq ->fff_res\n  |  .IOS mov RA, BASE\n  |  bl extern lj_tab_getinth\t\t// (GCtab *t, int32_t key)\n  |  // Returns cTValue * or NULL.\n  |  .IOS mov BASE, RA\n  |  cmp CRET1, #0\n  |  beq ->fff_res\n  |  ldrd CARG12, [CRET1]\n  |  b <1\n  |\n  |.ffunc_1 ipairs\n  |  checktab CARG2, ->fff_fallback\n#if LJ_52\n  |  ldr TAB:RB, TAB:CARG1->metatable\n#endif\n  |   ldrd CFUNC:CARG34, CFUNC:CARG3->upvalue[0]\n  |    ldr PC, [BASE, FRAME_PC]\n#if LJ_52\n  |  cmp TAB:RB, #0\n  |  bne ->fff_fallback\n#endif\n  |  mov CARG1, #0\n  |  mvn CARG2, #~LJ_TISNUM\n  |    mov RC, #(3+1)*8\n  |   strd CFUNC:CARG34, [BASE, #-8]\n  |  strd CARG12, [BASE, #8]\n  |  b ->fff_res\n  |\n  |//-- Base library: catch errors ----------------------------------------\n  |\n  |.ffunc pcall\n  |  ldrb RA, [DISPATCH, #DISPATCH_GL(hookmask)]\n  |   cmp NARGS8:RC, #8\n  |   blo ->fff_fallback\n  |  tst RA, #HOOK_ACTIVE\t\t// Remember active hook before pcall.\n  |   mov RB, BASE\n  |   add BASE, BASE, #8\n  |  moveq PC, #8+FRAME_PCALL\n  |  movne PC, #8+FRAME_PCALLH\n  |   sub NARGS8:RC, NARGS8:RC, #8\n  |  b ->vm_call_dispatch\n  |\n  |.ffunc_2 xpcall\n  |  ldrb RA, [DISPATCH, #DISPATCH_GL(hookmask)]\n  |  checkfunc CARG4, ->fff_fallback\t// Traceback must be a function.\n  |   mov RB, BASE\n  |  strd CARG12, [BASE, #8]\t\t// Swap function and traceback.\n  |   strd CARG34, [BASE]\n  |  tst RA, #HOOK_ACTIVE\t\t// Remember active hook before pcall.\n  |   add BASE, BASE, #16\n  |  moveq PC, #16+FRAME_PCALL\n  |  movne PC, #16+FRAME_PCALLH\n  |   sub NARGS8:RC, NARGS8:RC, #16\n  |  b ->vm_call_dispatch\n  |\n  |//-- Coroutine library --------------------------------------------------\n  |\n  |.macro coroutine_resume_wrap, resume\n  |.if resume\n  |.ffunc_1 coroutine_resume\n  |  checktp CARG2, LJ_TTHREAD\n  |  bne ->fff_fallback\n  |.else\n  |.ffunc coroutine_wrap_aux\n  |  ldr L:CARG1, CFUNC:CARG3->upvalue[0].gcr\n  |.endif\n  |   ldr PC, [BASE, FRAME_PC]\n  |     str BASE, L->base\n  |  ldr CARG2, L:CARG1->top\n  |   ldrb RA, L:CARG1->status\n  |    ldr RB, L:CARG1->base\n  |  add CARG3, CARG2, NARGS8:RC\n  |  add CARG4, CARG2, RA\n  |   str PC, SAVE_PC\n  |  cmp CARG4, RB\n  |  beq ->fff_fallback\n  |   ldr CARG4, L:CARG1->maxstack\n  |    ldr RB, L:CARG1->cframe\n  |   cmp RA, #LUA_YIELD\n  |   cmpls CARG3, CARG4\n  |    cmpls RB, #0\n  |    bhi ->fff_fallback\n  |1:\n  |.if resume\n  |  sub CARG3, CARG3, #8\t\t// Keep resumed thread in stack for GC.\n  |  add BASE, BASE, #8\n  |  sub NARGS8:RC, NARGS8:RC, #8\n  |.endif\n  |  str CARG3, L:CARG1->top\n  |  str BASE, L->top\n  |2:  // Move args to coroutine.\n  |   ldrd CARG34, [BASE, RB]\n  |  cmp RB, NARGS8:RC\n  |   strdne CARG34, [CARG2, RB]\n  |  add RB, RB, #8\n  |  bne <2\n  |\n  |  mov CARG3, #0\n  |   mov L:RA, L:CARG1\n  |  mov CARG4, #0\n  |  bl ->vm_resume\t\t\t// (lua_State *L, TValue *base, 0, 0)\n  |  // Returns thread status.\n  |4:\n  |  ldr CARG3, L:RA->base\n  |    mv_vmstate CARG2, INTERP\n  |  ldr CARG4, L:RA->top\n  |    st_vmstate CARG2\n  |   cmp CRET1, #LUA_YIELD\n  |  ldr BASE, L->base\n  |   bhi >8\n  |  subs RC, CARG4, CARG3\n  |   ldr CARG1, L->maxstack\n  |   add CARG2, BASE, RC\n  |  beq >6\t\t\t\t// No results?\n  |  cmp CARG2, CARG1\n  |   mov RB, #0\n  |  bhi >9\t\t\t\t// Need to grow stack?\n  |\n  |  sub CARG4, RC, #8\n  |   str CARG3, L:RA->top\t\t// Clear coroutine stack.\n  |5:  // Move results from coroutine.\n  |   ldrd CARG12, [CARG3, RB]\n  |  cmp RB, CARG4\n  |   strd CARG12, [BASE, RB]\n  |  add RB, RB, #8\n  |  bne <5\n  |6:\n  |.if resume\n  |  mvn CARG3, #~LJ_TTRUE\n  |   add RC, RC, #16\n  |7:\n  |  str CARG3, [BASE, #-4]\t\t// Prepend true/false to results.\n  |   sub RA, BASE, #8\n  |.else\n  |   mov RA, BASE\n  |   add RC, RC, #8\n  |.endif\n  |  ands CARG1, PC, #FRAME_TYPE\n  |   str PC, SAVE_PC\n  |   str RC, SAVE_MULTRES\n  |  beq ->BC_RET_Z\n  |  b ->vm_return\n  |\n  |8:  // Coroutine returned with error (at co->top-1).\n  |.if resume\n  |  ldrd CARG12, [CARG4, #-8]!\n  |   mvn CARG3, #~LJ_TFALSE\n  |    mov RC, #(2+1)*8\n  |  str CARG4, L:RA->top\t\t// Remove error from coroutine stack.\n  |  strd CARG12, [BASE]\t\t// Copy error message.\n  |  b <7\n  |.else\n  |  mov CARG1, L\n  |  mov CARG2, L:RA\n  |  bl extern lj_ffh_coroutine_wrap_err  // (lua_State *L, lua_State *co)\n  |  // Never returns.\n  |.endif\n  |\n  |9:  // Handle stack expansion on return from yield.\n  |  mov CARG1, L\n  |  lsr CARG2, RC, #3\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  mov CRET1, #0\n  |  b <4\n  |.endmacro\n  |\n  |  coroutine_resume_wrap 1\t\t// coroutine.resume\n  |  coroutine_resume_wrap 0\t\t// coroutine.wrap\n  |\n  |.ffunc coroutine_yield\n  |  ldr CARG1, L->cframe\n  |   add CARG2, BASE, NARGS8:RC\n  |   str BASE, L->base\n  |  tst CARG1, #CFRAME_RESUME\n  |   str CARG2, L->top\n  |    mov CRET1, #LUA_YIELD\n  |   mov CARG3, #0\n  |  beq ->fff_fallback\n  |   str CARG3, L->cframe\n  |    strb CRET1, L->status\n  |  b ->vm_leave_unw\n  |\n  |//-- Math library -------------------------------------------------------\n  |\n  |.macro math_round, func\n  |  .ffunc_1 math_ .. func\n  |  checktp CARG2, LJ_TISNUM\n  |  beq ->fff_restv\n  |  bhi ->fff_fallback\n  |  // Round FP value and normalize result.\n  |  lsl CARG3, CARG2, #1\n  |  adds RB, CARG3, #0x00200000\n  |  bpl >2\t\t\t\t// |x| < 1?\n  |  mvn CARG4, #0x3e0\n  |    subs RB, CARG4, RB, asr #21\n  |  lsl CARG4, CARG2, #11\n  |   lsl CARG3, CARG1, #11\n  |  orr CARG4, CARG4, #0x80000000\n  |   rsb INS, RB, #32\n  |  orr CARG4, CARG4, CARG1, lsr #21\n  |    bls >3\t\t\t\t// |x| >= 2^31?\n  |   orr CARG3, CARG3, CARG4, lsl INS\n  |  lsr CARG1, CARG4, RB\n  |.if \"func\" == \"floor\"\n  |   tst CARG3, CARG2, asr #31\n  |   addne CARG1, CARG1, #1\n  |.else\n  |   bics CARG3, CARG3, CARG2, asr #31\n  |   addsne CARG1, CARG1, #1\n  |   ldrdvs CARG12, >9\n  |   bvs ->fff_restv\n  |.endif\n  |    cmp CARG2, #0\n  |    rsblt CARG1, CARG1, #0\n  |1:\n  |   mvn CARG2, #~LJ_TISNUM\n  |  b ->fff_restv\n  |\n  |2:  // |x| < 1\n  |  bcs ->fff_restv\t\t\t// |x| is not finite.\n  |  orr CARG3, CARG3, CARG1\t\t// ztest = abs(hi) | lo\n  |.if \"func\" == \"floor\"\n  |  tst CARG3, CARG2, asr #31\t\t// return (ztest & sign) == 0 ? 0 : -1\n  |  moveq CARG1, #0\n  |  mvnne CARG1, #0\n  |.else\n  |  bics CARG3, CARG3, CARG2, asr #31\t// return (ztest & ~sign) == 0 ? 0 : 1\n  |  moveq CARG1, #0\n  |  movne CARG1, #1\n  |.endif\n  |  mvn CARG2, #~LJ_TISNUM\n  |  b ->fff_restv\n  |\n  |3:  // |x| >= 2^31. Check for x == -(2^31).\n  |  cmpeq CARG4, #0x80000000\n  |.if \"func\" == \"floor\"\n  |  cmpeq CARG3, #0\n  |.endif\n  |  bne >4\n  |  cmp CARG2, #0\n  |  movmi CARG1, #0x80000000\n  |  bmi <1\n  |4:\n  |  bl ->vm_..func.._sf\n  |  b ->fff_restv\n  |.endmacro\n  |\n  |  math_round floor\n  |  math_round ceil\n  |\n  |.align 8\n  |9:\n  |  .long 0x00000000, 0x41e00000\t// 2^31.\n  |\n  |.ffunc_1 math_abs\n  |  checktp CARG2, LJ_TISNUM\n  |  bhi ->fff_fallback\n  |  bicne CARG2, CARG2, #0x80000000\n  |  bne ->fff_restv\n  |  cmp CARG1, #0\n  |  rsbslt CARG1, CARG1, #0\n  |  ldrdvs CARG12, <9\n  |  // Fallthrough.\n  |\n  |->fff_restv:\n  |  // CARG12 = TValue result.\n  |  ldr PC, [BASE, FRAME_PC]\n  |  strd CARG12, [BASE, #-8]\n  |->fff_res1:\n  |  // PC = return.\n  |  mov RC, #(1+1)*8\n  |->fff_res:\n  |  // RC = (nresults+1)*8, PC = return.\n  |  ands CARG1, PC, #FRAME_TYPE\n  |  ldreq INS, [PC, #-4]\n  |   str RC, SAVE_MULTRES\n  |  sub RA, BASE, #8\n  |  bne ->vm_return\n  |  decode_RB8 RB, INS\n  |5:\n  |  cmp RB, RC\t\t\t\t// More results expected?\n  |  bhi >6\n  |  decode_RA8 CARG1, INS\n  |   ins_next1\n  |   ins_next2\n  |  // Adjust BASE. KBASE is assumed to be set for the calling frame.\n  |  sub BASE, RA, CARG1\n  |   ins_next3\n  |\n  |6:  // Fill up results with nil.\n  |  add CARG2, RA, RC\n  |  mvn CARG1, #~LJ_TNIL\n  |   add RC, RC, #8\n  |  str CARG1, [CARG2, #-4]\n  |  b <5\n  |\n  |.macro math_extern, func\n  |.if HFABI\n  |  .ffunc_d math_ .. func\n  |.else\n  |  .ffunc_n math_ .. func\n  |.endif\n  |  .IOS mov RA, BASE\n  |  bl extern func\n  |  .IOS mov BASE, RA\n  |.if HFABI\n  |  b ->fff_resd\n  |.else\n  |  b ->fff_restv\n  |.endif\n  |.endmacro\n  |\n  |.macro math_extern2, func\n  |.if HFABI\n  |  .ffunc_dd math_ .. func\n  |.else\n  |  .ffunc_nn math_ .. func\n  |.endif\n  |  .IOS mov RA, BASE\n  |  bl extern func\n  |  .IOS mov BASE, RA\n  |.if HFABI\n  |  b ->fff_resd\n  |.else\n  |  b ->fff_restv\n  |.endif\n  |.endmacro\n  |\n  |.if FPU\n  |  .ffunc_d math_sqrt\n  |  vsqrt.f64 d0, d0\n  |->fff_resd:\n  |  ldr PC, [BASE, FRAME_PC]\n  |  vstr d0, [BASE, #-8]\n  |  b ->fff_res1\n  |.else\n  |  math_extern sqrt\n  |.endif\n  |\n  |.ffunc math_log\n  |.if HFABI\n  |  ldr CARG2, [BASE, #4]\n  |   cmp NARGS8:RC, #8\t\t\t// Need exactly 1 argument.\n  |  vldr d0, [BASE]\n  |   bne ->fff_fallback\n  |.else\n  |  ldrd CARG12, [BASE]\n  |   cmp NARGS8:RC, #8\t\t\t// Need exactly 1 argument.\n  |   bne ->fff_fallback\n  |.endif\n  |  checktp CARG2, LJ_TISNUM\n  |  bhs ->fff_fallback\n  |  .IOS mov RA, BASE\n  |  bl extern log\n  |  .IOS mov BASE, RA\n  |.if HFABI\n  |  b ->fff_resd\n  |.else\n  |  b ->fff_restv\n  |.endif\n  |\n  |  math_extern log10\n  |  math_extern exp\n  |  math_extern sin\n  |  math_extern cos\n  |  math_extern tan\n  |  math_extern asin\n  |  math_extern acos\n  |  math_extern atan\n  |  math_extern sinh\n  |  math_extern cosh\n  |  math_extern tanh\n  |  math_extern2 pow\n  |  math_extern2 atan2\n  |  math_extern2 fmod\n  |\n  |->ff_math_deg:\n  |.if FPU\n  |  .ffunc_d math_rad\n  |  vldr d1, CFUNC:CARG3->upvalue[0]\n  |  vmul.f64 d0, d0, d1\n  |  b ->fff_resd\n  |.else\n  |  .ffunc_n math_rad\n  |  ldrd CARG34, CFUNC:CARG3->upvalue[0]\n  |  bl extern __aeabi_dmul\n  |  b ->fff_restv\n  |.endif\n  |\n  |.if HFABI\n  |  .ffunc math_ldexp\n  |  ldr CARG4, [BASE, #4]\n  |  ldrd CARG12, [BASE, #8]\n  |   cmp NARGS8:RC, #16\n  |   blo ->fff_fallback\n  |  vldr d0, [BASE]\n  |  checktp CARG4, LJ_TISNUM\n  |  bhs ->fff_fallback\n  |  checktp CARG2, LJ_TISNUM\n  |  bne ->fff_fallback\n  |  .IOS mov RA, BASE\n  |  bl extern ldexp\t\t\t// (double x, int exp)\n  |  .IOS mov BASE, RA\n  |  b ->fff_resd\n  |.else\n  |.ffunc_2 math_ldexp\n  |  checktp CARG2, LJ_TISNUM\n  |  bhs ->fff_fallback\n  |  checktp CARG4, LJ_TISNUM\n  |  bne ->fff_fallback\n  |  .IOS mov RA, BASE\n  |  bl extern ldexp\t\t\t// (double x, int exp)\n  |  .IOS mov BASE, RA\n  |  b ->fff_restv\n  |.endif\n  |\n  |.if HFABI\n  |.ffunc_d math_frexp\n  |  mov CARG1, sp\n  |  .IOS mov RA, BASE\n  |  bl extern frexp\n  |  .IOS mov BASE, RA\n  |   ldr CARG3, [sp]\n  |   mvn CARG4, #~LJ_TISNUM\n  |    ldr PC, [BASE, FRAME_PC]\n  |  vstr d0, [BASE, #-8]\n  |    mov RC, #(2+1)*8\n  |   strd CARG34, [BASE]\n  |  b ->fff_res\n  |.else\n  |.ffunc_n math_frexp\n  |  mov CARG3, sp\n  |  .IOS mov RA, BASE\n  |  bl extern frexp\n  |  .IOS mov BASE, RA\n  |   ldr CARG3, [sp]\n  |   mvn CARG4, #~LJ_TISNUM\n  |    ldr PC, [BASE, FRAME_PC]\n  |  strd CARG12, [BASE, #-8]\n  |    mov RC, #(2+1)*8\n  |   strd CARG34, [BASE]\n  |  b ->fff_res\n  |.endif\n  |\n  |.if HFABI\n  |.ffunc_d math_modf\n  |  sub CARG1, BASE, #8\n  |   ldr PC, [BASE, FRAME_PC]\n  |  .IOS mov RA, BASE\n  |  bl extern modf\n  |  .IOS mov BASE, RA\n  |   mov RC, #(2+1)*8\n  |  vstr d0, [BASE]\n  |  b ->fff_res\n  |.else\n  |.ffunc_n math_modf\n  |  sub CARG3, BASE, #8\n  |   ldr PC, [BASE, FRAME_PC]\n  |  .IOS mov RA, BASE\n  |  bl extern modf\n  |  .IOS mov BASE, RA\n  |   mov RC, #(2+1)*8\n  |  strd CARG12, [BASE]\n  |  b ->fff_res\n  |.endif\n  |\n  |.macro math_minmax, name, cond, fcond\n  |.if FPU\n  |  .ffunc_1 name\n  |   add RB, BASE, RC\n  |  checktp CARG2, LJ_TISNUM\n  |   add RA, BASE, #8\n  |  bne >4\n  |1:  // Handle integers.\n  |  ldrd CARG34, [RA]\n  |   cmp RA, RB\n  |   bhs ->fff_restv\n  |  checktp CARG4, LJ_TISNUM\n  |  bne >3\n  |  cmp CARG1, CARG3\n  |   add RA, RA, #8\n  |  mov..cond CARG1, CARG3\n  |  b <1\n  |3:  // Convert intermediate result to number and continue below.\n  |  vmov s4, CARG1\n  |  bhi ->fff_fallback\n  |  vldr d1, [RA]\n  |  vcvt.f64.s32 d0, s4\n  |  b >6\n  |\n  |4:\n  |  vldr d0, [BASE]\n  |  bhi ->fff_fallback\n  |5:  // Handle numbers.\n  |  ldrd CARG34, [RA]\n  |  vldr d1, [RA]\n  |   cmp RA, RB\n  |   bhs ->fff_resd\n  |  checktp CARG4, LJ_TISNUM\n  |  bhs >7\n  |6:\n  |  vcmp.f64 d0, d1\n  |  vmrs\n  |   add RA, RA, #8\n  |  vmov..fcond.f64 d0, d1\n  |  b <5\n  |7:  // Convert integer to number and continue above.\n  |  vmov s4, CARG3\n  |  bhi ->fff_fallback\n  |  vcvt.f64.s32 d1, s4\n  |  b <6\n  |\n  |.else\n  |\n  |  .ffunc_1 name\n  |  checktp CARG2, LJ_TISNUM\n  |   mov RA, #8\n  |  bne >4\n  |1:  // Handle integers.\n  |  ldrd CARG34, [BASE, RA]\n  |   cmp RA, RC\n  |   bhs ->fff_restv\n  |  checktp CARG4, LJ_TISNUM\n  |  bne >3\n  |  cmp CARG1, CARG3\n  |   add RA, RA, #8\n  |  mov..cond CARG1, CARG3\n  |  b <1\n  |3:  // Convert intermediate result to number and continue below.\n  |  bhi ->fff_fallback\n  |  bl extern __aeabi_i2d\n  |  ldrd CARG34, [BASE, RA]\n  |  b >6\n  |\n  |4:\n  |  bhi ->fff_fallback\n  |5:  // Handle numbers.\n  |  ldrd CARG34, [BASE, RA]\n  |   cmp RA, RC\n  |   bhs ->fff_restv\n  |  checktp CARG4, LJ_TISNUM\n  |  bhs >7\n  |6:\n  |  bl extern __aeabi_cdcmple\n  |   add RA, RA, #8\n  |  mov..fcond CARG1, CARG3\n  |  mov..fcond CARG2, CARG4\n  |  b <5\n  |7:  // Convert integer to number and continue above.\n  |  bhi ->fff_fallback\n  |  strd CARG12, TMPD\n  |  mov CARG1, CARG3\n  |  bl extern __aeabi_i2d\n  |  ldrd CARG34, TMPD\n  |  b <6\n  |.endif\n  |.endmacro\n  |\n  |  math_minmax math_min, gt, hi\n  |  math_minmax math_max, lt, lo\n  |\n  |//-- String library -----------------------------------------------------\n  |\n  |.ffunc_1 string_len\n  |  checkstr CARG2, ->fff_fallback\n  |  ldr CARG1, STR:CARG1->len\n  |  mvn CARG2, #~LJ_TISNUM\n  |  b ->fff_restv\n  |\n  |.ffunc string_byte\t\t\t// Only handle the 1-arg case here.\n  |  ldrd CARG12, [BASE]\n  |    ldr PC, [BASE, FRAME_PC]\n  |   cmp NARGS8:RC, #8\n  |   checktpeq CARG2, LJ_TSTR\t\t// Need exactly 1 argument.\n  |   bne ->fff_fallback\n  |  ldr CARG3, STR:CARG1->len\n  |   ldrb CARG1, STR:CARG1[1]\t\t// Access is always ok (NUL at end).\n  |   mvn CARG2, #~LJ_TISNUM\n  |  cmp CARG3, #0\n  |  moveq RC, #(0+1)*8\n  |  movne RC, #(1+1)*8\n  |   strd CARG12, [BASE, #-8]\n  |  b ->fff_res\n  |\n  |.ffunc string_char\t\t\t// Only handle the 1-arg case here.\n  |  ffgccheck\n  |  ldrd CARG12, [BASE]\n  |    ldr PC, [BASE, FRAME_PC]\n  |   cmp NARGS8:RC, #8\t\t\t// Need exactly 1 argument.\n  |   checktpeq CARG2, LJ_TISNUM\n  |   bicseq CARG4, CARG1, #255\n  |  mov CARG3, #1\n  |   bne ->fff_fallback\n  |  str CARG1, TMPD\n  |  mov CARG2, TMPDp\t\t\t// Points to stack. Little-endian.\n  |->fff_newstr:\n  |  // CARG2 = str, CARG3 = len.\n  |   str BASE, L->base\n  |  mov CARG1, L\n  |   str PC, SAVE_PC\n  |  bl extern lj_str_new\t\t// (lua_State *L, char *str, size_t l)\n  |  // Returns GCstr *.\n  |  ldr BASE, L->base\n  |   mvn CARG2, #~LJ_TSTR\n  |  b ->fff_restv\n  |\n  |.ffunc string_sub\n  |  ffgccheck\n  |  ldrd CARG12, [BASE]\n  |   ldrd CARG34, [BASE, #16]\n  |    cmp NARGS8:RC, #16\n  |     mvn RB, #0\n  |    beq >1\n  |    blo ->fff_fallback\n  |   checktp CARG4, LJ_TISNUM\n  |    mov RB, CARG3\n  |   bne ->fff_fallback\n  |1:\n  |  ldrd CARG34, [BASE, #8]\n  |  checktp CARG2, LJ_TSTR\n  |   ldreq CARG2, STR:CARG1->len\n  |  checktpeq CARG4, LJ_TISNUM\n  |  bne ->fff_fallback\n  |  // CARG1 = str, CARG2 = str->len, CARG3 = start, RB = end\n  |  add CARG4, CARG2, #1\n  |  cmp CARG3, #0\t\t\t// if (start < 0) start += len+1\n  |  addlt CARG3, CARG3, CARG4\n  |  cmp CARG3, #1\t\t\t// if (start < 1) start = 1\n  |  movlt CARG3, #1\n  |  cmp RB, #0\t\t\t\t// if (end < 0) end += len+1\n  |  addlt RB, RB, CARG4\n  |  bic RB, RB, RB, asr #31\t\t// if (end < 0) end = 0\n  |  cmp RB, CARG2\t\t\t// if (end > len) end = len\n  |   add CARG1, STR:CARG1, #sizeof(GCstr)-1\n  |  movgt RB, CARG2\n  |   add CARG2, CARG1, CARG3\n  |  subs CARG3, RB, CARG3\t\t// len = end - start\n  |   add CARG3, CARG3, #1\t\t// len += 1\n  |  bge ->fff_newstr\n  |->fff_emptystr:\n  |  sub STR:CARG1, DISPATCH, #-DISPATCH_GL(strempty)\n  |  mvn CARG2, #~LJ_TSTR\n  |  b ->fff_restv\n  |\n  |.ffunc string_rep\t\t\t// Only handle the 1-char case inline.\n  |  ffgccheck\n  |  ldrd CARG12, [BASE]\n  |   ldrd CARG34, [BASE, #8]\n  |    cmp NARGS8:RC, #16\n  |    bne ->fff_fallback\t\t// Exactly 2 arguments\n  |  checktp CARG2, LJ_TSTR\n  |   checktpeq CARG4, LJ_TISNUM\n  |   bne ->fff_fallback\n  |  subs CARG4, CARG3, #1\n  |   ldr CARG2, STR:CARG1->len\n  |  blt ->fff_emptystr\t\t\t// Count <= 0?\n  |   cmp CARG2, #1\n  |   blo ->fff_emptystr\t\t// Zero-length string?\n  |   bne ->fff_fallback\t\t// Fallback for > 1-char strings.\n  |  ldr RB, [DISPATCH, #DISPATCH_GL(tmpbuf.sz)]\n  |   ldr CARG2, [DISPATCH, #DISPATCH_GL(tmpbuf.buf)]\n  |   ldr CARG1, STR:CARG1[1]\n  |  cmp RB, CARG3\n  |  blo ->fff_fallback\n  |1:  // Fill buffer with char.\n  |   strb CARG1, [CARG2, CARG4]\n  |  subs CARG4, CARG4, #1\n  |  bge <1\n  |  b ->fff_newstr\n  |\n  |.ffunc string_reverse\n  |  ffgccheck\n  |  ldrd CARG12, [BASE]\n  |   cmp NARGS8:RC, #8\n  |   blo ->fff_fallback\n  |  checkstr CARG2, ->fff_fallback\n  |  ldr CARG3, STR:CARG1->len\n  |   ldr RB, [DISPATCH, #DISPATCH_GL(tmpbuf.sz)]\n  |    ldr CARG2, [DISPATCH, #DISPATCH_GL(tmpbuf.buf)]\n  |  mov CARG4, CARG3\n  |  add CARG1, STR:CARG1, #sizeof(GCstr)\n  |   cmp RB, CARG3\n  |   blo ->fff_fallback\n  |1:  // Reverse string copy.\n  |  ldrb RB, [CARG1], #1\n  |   subs CARG4, CARG4, #1\n  |   blt ->fff_newstr\n  |  strb RB, [CARG2, CARG4]\n  |  b <1\n  |\n  |.macro ffstring_case, name, lo\n  |  .ffunc name\n  |  ffgccheck\n  |  ldrd CARG12, [BASE]\n  |   cmp NARGS8:RC, #8\n  |   blo ->fff_fallback\n  |  checkstr CARG2, ->fff_fallback\n  |  ldr CARG3, STR:CARG1->len\n  |   ldr RB, [DISPATCH, #DISPATCH_GL(tmpbuf.sz)]\n  |    ldr CARG2, [DISPATCH, #DISPATCH_GL(tmpbuf.buf)]\n  |  mov CARG4, #0\n  |  add CARG1, STR:CARG1, #sizeof(GCstr)\n  |   cmp RB, CARG3\n  |   blo ->fff_fallback\n  |1:  // ASCII case conversion.\n  |  ldrb RB, [CARG1, CARG4]\n  |   cmp CARG4, CARG3\n  |   bhs ->fff_newstr\n  |  sub RC, RB, #lo\n  |  cmp RC, #26\n  |  eorlo RB, RB, #0x20\n  |  strb RB, [CARG2, CARG4]\n  |   add CARG4, CARG4, #1\n  |  b <1\n  |.endmacro\n  |\n  |ffstring_case string_lower, 65\n  |ffstring_case string_upper, 97\n  |\n  |//-- Table library ------------------------------------------------------\n  |\n  |.ffunc_1 table_getn\n  |  checktab CARG2, ->fff_fallback\n  |  .IOS mov RA, BASE\n  |  bl extern lj_tab_len\t\t// (GCtab *t)\n  |  // Returns uint32_t (but less than 2^31).\n  |  .IOS mov BASE, RA\n  |  mvn CARG2, #~LJ_TISNUM\n  |  b ->fff_restv\n  |\n  |//-- Bit library --------------------------------------------------------\n  |\n  |// FP number to bit conversion for soft-float. Clobbers r0-r3.\n  |->vm_tobit_fb:\n  |  bhi ->fff_fallback\n  |->vm_tobit:\n  |  lsl RB, CARG2, #1\n  |  adds RB, RB, #0x00200000\n  |  movpl CARG1, #0\t\t\t// |x| < 1?\n  |  bxpl lr\n  |  mvn CARG4, #0x3e0\n  |  subs RB, CARG4, RB, asr #21\n  |  bmi >1\t\t\t\t// |x| >= 2^32?\n  |  lsl CARG4, CARG2, #11\n  |  orr CARG4, CARG4, #0x80000000\n  |  orr CARG4, CARG4, CARG1, lsr #21\n  |   cmp CARG2, #0\n  |  lsr CARG1, CARG4, RB\n  |   rsblt CARG1, CARG1, #0\n  |  bx lr\n  |1:\n  |  add RB, RB, #21\n  |  lsr CARG4, CARG1, RB\n  |  rsb RB, RB, #20\n  |  lsl CARG1, CARG2, #12\n  |   cmp CARG2, #0\n  |  orr CARG1, CARG4, CARG1, lsl RB\n  |   rsblt CARG1, CARG1, #0\n  |  bx lr\n  |\n  |.macro .ffunc_bit, name\n  |  .ffunc_1 bit_..name\n  |  checktp CARG2, LJ_TISNUM\n  |  blne ->vm_tobit_fb\n  |.endmacro\n  |\n  |.ffunc_bit tobit\n  |  mvn CARG2, #~LJ_TISNUM\n  |  b ->fff_restv\n  |\n  |.macro .ffunc_bit_op, name, ins\n  |  .ffunc_bit name\n  |  mov CARG3, CARG1\n  |  mov RA, #8\n  |1:\n  |  ldrd CARG12, [BASE, RA]\n  |   cmp RA, NARGS8:RC\n  |    add RA, RA, #8\n  |   bge >2\n  |  checktp CARG2, LJ_TISNUM\n  |  blne ->vm_tobit_fb\n  |  ins CARG3, CARG3, CARG1\n  |  b <1\n  |.endmacro\n  |\n  |.ffunc_bit_op band, and\n  |.ffunc_bit_op bor, orr\n  |.ffunc_bit_op bxor, eor\n  |\n  |2:\n  |  mvn CARG4, #~LJ_TISNUM\n  |   ldr PC, [BASE, FRAME_PC]\n  |  strd CARG34, [BASE, #-8]\n  |  b ->fff_res1\n  |\n  |.ffunc_bit bswap\n  |  eor CARG3, CARG1, CARG1, ror #16\n  |  bic CARG3, CARG3, #0x00ff0000\n  |  ror CARG1, CARG1, #8\n  |   mvn CARG2, #~LJ_TISNUM\n  |  eor CARG1, CARG1, CARG3, lsr #8\n  |  b ->fff_restv\n  |\n  |.ffunc_bit bnot\n  |  mvn CARG1, CARG1\n  |  mvn CARG2, #~LJ_TISNUM\n  |  b ->fff_restv\n  |\n  |.macro .ffunc_bit_sh, name, ins, shmod\n  |  .ffunc bit_..name\n  |  ldrd CARG12, [BASE, #8]\n  |   cmp NARGS8:RC, #16\n  |   blo ->fff_fallback\n  |  checktp CARG2, LJ_TISNUM\n  |  blne ->vm_tobit_fb\n  |.if shmod == 0\n  |  and RA, CARG1, #31\n  |.else\n  |  rsb RA, CARG1, #0\n  |.endif\n  |  ldrd CARG12, [BASE]\n  |  checktp CARG2, LJ_TISNUM\n  |  blne ->vm_tobit_fb\n  |  ins CARG1, CARG1, RA\n  |  mvn CARG2, #~LJ_TISNUM\n  |  b ->fff_restv\n  |.endmacro\n  |\n  |.ffunc_bit_sh lshift, lsl, 0\n  |.ffunc_bit_sh rshift, lsr, 0\n  |.ffunc_bit_sh arshift, asr, 0\n  |.ffunc_bit_sh rol, ror, 1\n  |.ffunc_bit_sh ror, ror, 0\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->fff_fallback:\t\t\t// Call fast function fallback handler.\n  |  // BASE = new base, RC = nargs*8\n  |   ldr CARG3, [BASE, FRAME_FUNC]\n  |  ldr CARG2, L->maxstack\n  |  add CARG1, BASE, NARGS8:RC\n  |    ldr PC, [BASE, FRAME_PC]\t\t// Fallback may overwrite PC.\n  |  str CARG1, L->top\n  |   ldr CARG3, CFUNC:CARG3->f\n  |    str BASE, L->base\n  |  add CARG1, CARG1, #8*LUA_MINSTACK\n  |    str PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  cmp CARG1, CARG2\n  |   mov CARG1, L\n  |  bhi >5\t\t\t\t// Need to grow stack.\n  |   blx CARG3\t\t\t\t// (lua_State *L)\n  |  // Either throws an error, or recovers and returns -1, 0 or nresults+1.\n  |   ldr BASE, L->base\n  |  cmp CRET1, #0\n  |   lsl RC, CRET1, #3\n  |   sub RA, BASE, #8\n  |  bgt ->fff_res\t\t\t// Returned nresults+1?\n  |1:  // Returned 0 or -1: retry fast path.\n  |   ldr CARG1, L->top\n  |    ldr LFUNC:CARG3, [BASE, FRAME_FUNC]\n  |   sub NARGS8:RC, CARG1, BASE\n  |  bne ->vm_call_tail\t\t\t// Returned -1?\n  |  ins_callt\t\t\t\t// Returned 0: retry fast path.\n  |\n  |// Reconstruct previous base for vmeta_call during tailcall.\n  |->vm_call_tail:\n  |  ands CARG1, PC, #FRAME_TYPE\n  |   bic CARG2, PC, #FRAME_TYPEP\n  |  ldreq INS, [PC, #-4]\n  |  andeq CARG2, MASKR8, INS, lsr #5\t// Conditional decode_RA8.\n  |  addeq CARG2, CARG2, #8\n  |  sub RB, BASE, CARG2\n  |  b ->vm_call_dispatch\t\t// Resolve again for tailcall.\n  |\n  |5:  // Grow stack for fallback handler.\n  |  mov CARG2, #LUA_MINSTACK\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  ldr BASE, L->base\n  |  cmp CARG1, CARG1\t\t\t// Set zero-flag to force retry.\n  |  b <1\n  |\n  |->fff_gcstep:\t\t\t// Call GC step function.\n  |  // BASE = new base, RC = nargs*8\n  |  mov RA, lr\n  |   str BASE, L->base\n  |  add CARG2, BASE, NARGS8:RC\n  |   str PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  str CARG2, L->top\n  |  mov CARG1, L\n  |  bl extern lj_gc_step\t\t// (lua_State *L)\n  |   ldr BASE, L->base\n  |  mov lr, RA\t\t\t\t// Help return address predictor.\n  |   ldr CFUNC:CARG3, [BASE, FRAME_FUNC]\n  |  bx lr\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Special dispatch targets -------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_record:\t\t\t\t// Dispatch target for recording phase.\n  |.if JIT\n  |  ldrb CARG1, [DISPATCH, #DISPATCH_GL(hookmask)]\n  |  tst CARG1, #HOOK_VMEVENT\t\t// No recording while in vmevent.\n  |  bne >5\n  |  // Decrement the hookcount for consistency, but always do the call.\n  |   ldr CARG2, [DISPATCH, #DISPATCH_GL(hookcount)]\n  |  tst CARG1, #HOOK_ACTIVE\n  |  bne >1\n  |   sub CARG2, CARG2, #1\n  |  tst CARG1, #LUA_MASKLINE|LUA_MASKCOUNT\n  |   strne CARG2, [DISPATCH, #DISPATCH_GL(hookcount)]\n  |  b >1\n  |.endif\n  |\n  |->vm_rethook:\t\t\t// Dispatch target for return hooks.\n  |  ldrb CARG1, [DISPATCH, #DISPATCH_GL(hookmask)]\n  |  tst CARG1, #HOOK_ACTIVE\t\t// Hook already active?\n  |  beq >1\n  |5:  // Re-dispatch to static ins.\n  |  decode_OP OP, INS\n  |  add OP, DISPATCH, OP, lsl #2\n  |  ldr pc, [OP, #GG_DISP2STATIC]\n  |\n  |->vm_inshook:\t\t\t// Dispatch target for instr/line hooks.\n  |  ldrb CARG1, [DISPATCH, #DISPATCH_GL(hookmask)]\n  |   ldr CARG2, [DISPATCH, #DISPATCH_GL(hookcount)]\n  |  tst CARG1, #HOOK_ACTIVE\t\t// Hook already active?\n  |  bne <5\n  |  tst CARG1, #LUA_MASKLINE|LUA_MASKCOUNT\n  |  beq <5\n  |   subs CARG2, CARG2, #1\n  |   str CARG2, [DISPATCH, #DISPATCH_GL(hookcount)]\n  |   beq >1\n  |  tst CARG1, #LUA_MASKLINE\n  |  beq <5\n  |1:\n  |  mov CARG1, L\n  |   str BASE, L->base\n  |  mov CARG2, PC\n  |  // SAVE_PC must hold the _previous_ PC. The callee updates it with PC.\n  |  bl extern lj_dispatch_ins\t\t// (lua_State *L, const BCIns *pc)\n  |3:\n  |  ldr BASE, L->base\n  |4:  // Re-dispatch to static ins.\n  |  ldrb OP, [PC, #-4]\n  |   ldr INS, [PC, #-4]\n  |  add OP, DISPATCH, OP, lsl #2\n  |  ldr OP, [OP, #GG_DISP2STATIC]\n  |   decode_RA8 RA, INS\n  |   decode_RD RC, INS\n  |  bx OP\n  |\n  |->cont_hook:\t\t\t\t// Continue from hook yield.\n  |  ldr CARG1, [CARG4, #-24]\n  |   add PC, PC, #4\n  |  str CARG1, SAVE_MULTRES\t\t// Restore MULTRES for *M ins.\n  |  b <4\n  |\n  |->vm_hotloop:\t\t\t// Hot loop counter underflow.\n  |.if JIT\n  |  ldr LFUNC:CARG3, [BASE, FRAME_FUNC]  // Same as curr_topL(L).\n  |   sub CARG1, DISPATCH, #-GG_DISP2J\n  |   str PC, SAVE_PC\n  |  ldr CARG3, LFUNC:CARG3->field_pc\n  |   mov CARG2, PC\n  |   str L, [DISPATCH, #DISPATCH_J(L)]\n  |  ldrb CARG3, [CARG3, #PC2PROTO(framesize)]\n  |   str BASE, L->base\n  |  add CARG3, BASE, CARG3, lsl #3\n  |  str CARG3, L->top\n  |  bl extern lj_trace_hot\t\t// (jit_State *J, const BCIns *pc)\n  |  b <3\n  |.endif\n  |\n  |->vm_callhook:\t\t\t// Dispatch target for call hooks.\n  |  mov CARG2, PC\n  |.if JIT\n  |  b >1\n  |.endif\n  |\n  |->vm_hotcall:\t\t\t// Hot call counter underflow.\n  |.if JIT\n  |  orr CARG2, PC, #1\n  |1:\n  |.endif\n  |  add CARG4, BASE, RC\n  |   str PC, SAVE_PC\n  |    mov CARG1, L\n  |   str BASE, L->base\n  |    sub RA, RA, BASE\n  |  str CARG4, L->top\n  |  bl extern lj_dispatch_call\t\t// (lua_State *L, const BCIns *pc)\n  |  // Returns ASMFunction.\n  |  ldr BASE, L->base\n  |   ldr CARG4, L->top\n  |    mov CARG2, #0\n  |  add RA, BASE, RA\n  |   sub NARGS8:RC, CARG4, BASE\n  |    str CARG2, SAVE_PC\t\t// Invalidate for subsequent line hook.\n  |  ldr LFUNC:CARG3, [BASE, FRAME_FUNC]\n  |   ldr INS, [PC, #-4]\n  |  bx CRET1\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Trace exit handler -------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_exit_handler:\n  |.if JIT\n  |  sub sp, sp, #12\n  |  push {r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12}\n  |  ldr CARG1, [sp, #64]\t// Load original value of lr.\n  |   ldr DISPATCH, [lr]\t// Load DISPATCH.\n  |    add CARG3, sp, #64\t// Recompute original value of sp.\n  |   mv_vmstate CARG4, EXIT\n  |    str CARG3, [sp, #52]\t// Store sp in RID_SP\n  |   st_vmstate CARG4\n  |  ldr CARG2, [CARG1, #-4]!\t// Get exit instruction.\n  |   str CARG1, [sp, #56]\t// Store exit pc in RID_LR and RID_PC.\n  |   str CARG1, [sp, #60]\n  |.if FPU\n  |  vpush {d0-d15}\n  |.endif\n  |  lsl CARG2, CARG2, #8\n  |  add CARG1, CARG1, CARG2, asr #6\n  |   ldr CARG2, [lr, #4]\t// Load exit stub group offset.\n  |   sub CARG1, CARG1, lr\n  |  ldr L, [DISPATCH, #DISPATCH_GL(jit_L)]\n  |   add CARG1, CARG2, CARG1, lsr #2\t// Compute exit number.\n  |    ldr BASE, [DISPATCH, #DISPATCH_GL(jit_base)]\n  |   str CARG1, [DISPATCH, #DISPATCH_J(exitno)]\n  |   mov CARG4, #0\n  |  str L, [DISPATCH, #DISPATCH_J(L)]\n  |    str BASE, L->base\n  |   str CARG4, [DISPATCH, #DISPATCH_GL(jit_L)]\n  |  sub CARG1, DISPATCH, #-GG_DISP2J\n  |  mov CARG2, sp\n  |  bl extern lj_trace_exit\t\t// (jit_State *J, ExitState *ex)\n  |  // Returns MULTRES (unscaled) or negated error code.\n  |  ldr CARG2, L->cframe\n  |   ldr BASE, L->base\n  |  bic CARG2, CARG2, #~CFRAME_RAWMASK\t// Use two steps: bic sp is deprecated.\n  |  mov sp, CARG2\n  |   ldr PC, SAVE_PC\t\t\t// Get SAVE_PC.\n  |  str L, SAVE_L\t\t\t// Set SAVE_L (on-trace resume/yield).\n  |  b >1\n  |.endif\n  |->vm_exit_interp:\n  |  // CARG1 = MULTRES or negated error code, BASE, PC and DISPATCH set.\n  |.if JIT\n  |  ldr L, SAVE_L\n  |1:\n  |  cmp CARG1, #0\n  |  blt >3\t\t\t\t// Check for error from exit.\n  |   lsl RC, CARG1, #3\n  |  ldr LFUNC:CARG2, [BASE, FRAME_FUNC]\n  |   str RC, SAVE_MULTRES\n  |   mov CARG3, #0\n  |  ldr CARG2, LFUNC:CARG2->field_pc\n  |   str CARG3, [DISPATCH, #DISPATCH_GL(jit_L)]\n  |    mv_vmstate CARG4, INTERP\n  |  ldr KBASE, [CARG2, #PC2PROTO(k)]\n  |  // Modified copy of ins_next which handles function header dispatch, too.\n  |  ldrb OP, [PC]\n  |     mov MASKR8, #255\n  |   ldr INS, [PC], #4\n  |     lsl MASKR8, MASKR8, #3\t\t// MASKR8 = 255*8.\n  |    st_vmstate CARG4\n  |  cmp OP, #BC_FUNCF\t\t\t// Function header?\n  |  ldr OP, [DISPATCH, OP, lsl #2]\n  |   decode_RA8 RA, INS\n  |   lsrlo RC, INS, #16\t// No: Decode operands A*8 and D.\n  |   subhs RC, RC, #8\n  |   addhs RA, RA, BASE\t// Yes: RA = BASE+framesize*8, RC = nargs*8\n  |  bx OP\n  |\n  |3:  // Rethrow error from the right C frame.\n  |  rsb CARG2, CARG1, #0\n  |  mov CARG1, L\n  |  bl extern lj_err_throw\t\t// (lua_State *L, int errcode)\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Math helper functions ----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// FP value rounding. Called from JIT code.\n  |//\n  |// double lj_vm_floor/ceil/trunc(double x);\n  |.macro vm_round, func, hf\n  |.if hf == 1\n  |  vmov CARG1, CARG2, d0\n  |.endif\n  |  lsl CARG3, CARG2, #1\n  |  adds RB, CARG3, #0x00200000\n  |  bpl >2\t\t\t\t// |x| < 1?\n  |  mvn CARG4, #0x3cc\n  |  subs RB, CARG4, RB, asr #21\t// 2^0: RB = 51, 2^51: RB = 0.\n  |  bxlo lr\t\t\t\t// |x| >= 2^52: done.\n  |  mvn CARG4, #1\n  |   bic CARG3, CARG1, CARG4, lsl RB\t// ztest = lo & ~lomask\n  |  and CARG1, CARG1, CARG4, lsl RB\t// lo &= lomask\n  |  subs RB, RB, #32\n  |   bicpl CARG4, CARG2, CARG4, lsl RB\t// |x| <= 2^20: ztest |= hi & ~himask\n  |   orrpl CARG3, CARG3, CARG4\n  |   mvnpl CARG4, #1\n  |  andpl CARG2, CARG2, CARG4, lsl RB\t// |x| <= 2^20: hi &= himask\n  |.if \"func\" == \"floor\"\n  |   tst CARG3, CARG2, asr #31\t\t// iszero = ((ztest & signmask) == 0)\n  |.else\n  |   bics CARG3, CARG3, CARG2, asr #31\t// iszero = ((ztest & ~signmask) == 0)\n  |.endif\n  |.if hf == 1\n  |  vmoveq d0, CARG1, CARG2\n  |.endif\n  |  bxeq lr\t\t\t\t// iszero: done.\n  |  mvn CARG4, #1\n  |  cmp RB, #0\n  |  lslpl CARG3, CARG4, RB\n  |  mvnmi CARG3, #0\n  |  add RB, RB, #32\n  |  subs CARG1, CARG1, CARG4, lsl RB\t// lo = lo-lomask\n  |  sbc CARG2, CARG2, CARG3\t\t// hi = hi-himask+carry\n  |.if hf == 1\n  |  vmov d0, CARG1, CARG2\n  |.endif\n  |  bx lr\n  |\n  |2:  // |x| < 1:\n  |  bxcs lr\t\t\t\t// |x| is not finite.\n  |  orr CARG3, CARG3, CARG1\t\t// ztest = (2*hi) | lo\n  |.if \"func\" == \"floor\"\n  |  tst CARG3, CARG2, asr #31\t\t// iszero = ((ztest & signmask) == 0)\n  |.else\n  |  bics CARG3, CARG3, CARG2, asr #31\t// iszero = ((ztest & ~signmask) == 0)\n  |.endif\n  |  mov CARG1, #0\t\t\t// lo = 0\n  |  and CARG2, CARG2, #0x80000000\n  |  ldrne CARG4, <9\t\t\t// hi = sign(x) | (iszero ? 0.0 : 1.0)\n  |  orrne CARG2, CARG2, CARG4\n  |.if hf == 1\n  |  vmov d0, CARG1, CARG2\n  |.endif\n  |  bx lr\n  |.endmacro\n  |\n  |9:\n  |  .long 0x3ff00000\t\t\t// hiword(+1.0)\n  |\n  |->vm_floor:\n  |.if HFABI\n  |  vm_round floor, 1\n  |.endif\n  |->vm_floor_sf:\n  |  vm_round floor, 0\n  |\n  |->vm_ceil:\n  |.if HFABI\n  |  vm_round ceil, 1\n  |.endif\n  |->vm_ceil_sf:\n  |  vm_round ceil, 0\n  |\n  |.macro vm_trunc, hf\n  |.if JIT\n  |.if hf == 1\n  |  vmov CARG1, CARG2, d0\n  |.endif\n  |  lsl CARG3, CARG2, #1\n  |  adds RB, CARG3, #0x00200000\n  |  andpl CARG2, CARG2, #0x80000000\t// |x| < 1? hi = sign(x), lo = 0.\n  |  movpl CARG1, #0\n  |.if hf == 1\n  |  vmovpl d0, CARG1, CARG2\n  |.endif\n  |  bxpl lr\n  |  mvn CARG4, #0x3cc\n  |  subs RB, CARG4, RB, asr #21\t// 2^0: RB = 51, 2^51: RB = 0.\n  |  bxlo lr\t\t\t\t// |x| >= 2^52: already done.\n  |  mvn CARG4, #1\n  |  and CARG1, CARG1, CARG4, lsl RB\t// lo &= lomask\n  |  subs RB, RB, #32\n  |  andpl CARG2, CARG2, CARG4, lsl RB\t// |x| <= 2^20: hi &= himask\n  |.if hf == 1\n  |  vmov d0, CARG1, CARG2\n  |.endif\n  |  bx lr\n  |.endif\n  |.endmacro\n  |\n  |->vm_trunc:\n  |.if HFABI\n  |  vm_trunc 1\n  |.endif\n  |->vm_trunc_sf:\n  |  vm_trunc 0\n  |\n  |  // double lj_vm_mod(double dividend, double divisor);\n  |->vm_mod:\n  |.if FPU\n  |  // Special calling convention. Also, RC (r11) is not preserved.\n  |  vdiv.f64 d0, d6, d7\n  |   mov RC, lr\n  |  vmov CARG1, CARG2, d0\n  |  bl ->vm_floor_sf\n  |  vmov d0, CARG1, CARG2\n  |  vmul.f64 d0, d0, d7\n  |   mov lr, RC\n  |  vsub.f64 d6, d6, d0\n  |  bx lr\n  |.else\n  |  push {r0, r1, r2, r3, r4, lr}\n  |  bl extern __aeabi_ddiv\n  |  bl ->vm_floor_sf\n  |  ldrd CARG34, [sp, #8]\n  |  bl extern __aeabi_dmul\n  |  ldrd CARG34, [sp]\n  |  eor CARG2, CARG2, #0x80000000\n  |  bl extern __aeabi_dadd\n  |  add sp, sp, #20\n  |  pop {pc}\n  |.endif\n  |\n  |  // int lj_vm_modi(int dividend, int divisor);\n  |->vm_modi:\n  |  ands RB, CARG1, #0x80000000\n  |  rsbmi CARG1, CARG1, #0\t\t// a = |dividend|\n  |  eor RB, RB, CARG2, asr #1\t\t// Keep signdiff and sign(divisor).\n  |  cmp CARG2, #0\n  |  rsbmi CARG2, CARG2, #0\t\t// b = |divisor|\n  |  subs CARG4, CARG2, #1\n  |  cmpne CARG1, CARG2\n  |  moveq CARG1, #0\t\t\t// if (b == 1 || a == b) a = 0\n  |  tsthi CARG2, CARG4\n  |  andeq CARG1, CARG1, CARG4\t\t// else if ((b & (b-1)) == 0) a &= b-1\n  |  bls >1\n  |  // Use repeated subtraction to get the remainder.\n  |  clz CARG3, CARG1\n  |  clz CARG4, CARG2\n  |  sub CARG4, CARG4, CARG3\n  |  rsbs CARG3, CARG4, #31\t\t// entry = (31-(clz(b)-clz(a)))*8\n  |  addne pc, pc, CARG3, lsl #3\t// Duff's device.\n  |  nop\n  {\n    int i;\n    for (i = 31; i >= 0; i--) {\n      |  cmp CARG1, CARG2, lsl #i\n      |  subhs CARG1, CARG1, CARG2, lsl #i\n    }\n  }\n  |1:\n  |  cmp CARG1, #0\n  |  cmpne RB, #0\n  |  submi CARG1, CARG1, CARG2\t\t// if (y != 0 && signdiff) y = y - b\n  |  eors CARG2, CARG1, RB, lsl #1\n  |  rsbmi CARG1, CARG1, #0\t\t// if (sign(divisor) != sign(y)) y = -y\n  |  bx lr\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Miscellaneous functions --------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |//-----------------------------------------------------------------------\n  |//-- FFI helper functions -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// Handler for callback functions.\n  |// Saveregs already performed. Callback slot number in [sp], g in r12.\n  |->vm_ffi_callback:\n  |.if FFI\n  |.type CTSTATE, CTState, PC\n  |  ldr CTSTATE, GL:r12->ctype_state\n  |   add DISPATCH, r12, #GG_G2DISP\n  |.if FPU\n  |  str r4, SAVE_R4\n  |  add r4, sp, CFRAME_SPACE+4+8*8\n  |  vstmdb r4!, {d8-d15}\n  |.endif\n  |.if HFABI\n  |  add r12, CTSTATE, #offsetof(CTState, cb.fpr[8])\n  |.endif\n  |  strd CARG34, CTSTATE->cb.gpr[2]\n  |  strd CARG12, CTSTATE->cb.gpr[0]\n  |.if HFABI\n  |  vstmdb r12!, {d0-d7}\n  |.endif\n  |  ldr CARG4, [sp]\n  |   add CARG3, sp, #CFRAME_SIZE\n  |    mov CARG1, CTSTATE\n  |  lsr CARG4, CARG4, #3\n  |   str CARG3, CTSTATE->cb.stack\n  |    mov CARG2, sp\n  |  str CARG4, CTSTATE->cb.slot\n  |  str CTSTATE, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |  bl extern lj_ccallback_enter\t// (CTState *cts, void *cf)\n  |  // Returns lua_State *.\n  |  ldr BASE, L:CRET1->base\n  |    mv_vmstate CARG2, INTERP\n  |  ldr RC, L:CRET1->top\n  |    mov MASKR8, #255\n  |   ldr LFUNC:CARG3, [BASE, FRAME_FUNC]\n  |    mov L, CRET1\n  |  sub RC, RC, BASE\n  |    lsl MASKR8, MASKR8, #3\t\t// MASKR8 = 255*8.\n  |    st_vmstate CARG2\n  |  ins_callt\n  |.endif\n  |\n  |->cont_ffi_callback:\t\t\t// Return from FFI callback.\n  |.if FFI\n  |  ldr CTSTATE, [DISPATCH, #DISPATCH_GL(ctype_state)]\n  |   str BASE, L->base\n  |   str CARG4, L->top\n  |  str L, CTSTATE->L\n  |  mov CARG1, CTSTATE\n  |  mov CARG2, RA\n  |  bl extern lj_ccallback_leave\t// (CTState *cts, TValue *o)\n  |  ldrd CARG12, CTSTATE->cb.gpr[0]\n  |.if HFABI\n  |  vldr d0, CTSTATE->cb.fpr[0]\n  |.endif\n  |  b ->vm_leave_unw\n  |.endif\n  |\n  |->vm_ffi_call:\t\t\t// Call C function via FFI.\n  |  // Caveat: needs special frame unwinding, see below.\n  |.if FFI\n  |  .type CCSTATE, CCallState, r4\n  |  push {CCSTATE, r5, r11, lr}\n  |  mov CCSTATE, CARG1\n  |  ldr CARG1, CCSTATE:CARG1->spadj\n  |   ldrb CARG2, CCSTATE->nsp\n  |    add CARG3, CCSTATE, #offsetof(CCallState, stack)\n  |.if HFABI\n  |  add RB, CCSTATE, #offsetof(CCallState, fpr[0])\n  |.endif\n  |  mov r11, sp\n  |  sub sp, sp, CARG1\t\t\t// Readjust stack.\n  |   subs CARG2, CARG2, #1\n  |.if HFABI\n  |  vldm RB, {d0-d7}\n  |.endif\n  |    ldr RB, CCSTATE->func\n  |   bmi >2\n  |1:  // Copy stack slots.\n  |  ldr CARG4, [CARG3, CARG2, lsl #2]\n  |  str CARG4, [sp, CARG2, lsl #2]\n  |  subs CARG2, CARG2, #1\n  |  bpl <1\n  |2:\n  |  ldrd CARG12, CCSTATE->gpr[0]\n  |  ldrd CARG34, CCSTATE->gpr[2]\n  |  blx RB\n  |  mov sp, r11\n  |.if HFABI\n  |  add r12, CCSTATE, #offsetof(CCallState, fpr[4])\n  |.endif\n  |  strd CRET1, CCSTATE->gpr[0]\n  |.if HFABI\n  |  vstmdb r12!, {d0-d3}\n  |.endif\n  |  pop {CCSTATE, r5, r11, pc}\n  |.endif\n  |// Note: vm_ffi_call must be the last function in this object file!\n  |\n  |//-----------------------------------------------------------------------\n}\n\n/* Generate the code for a single instruction. */\nstatic void build_ins(BuildCtx *ctx, BCOp op, int defop)\n{\n  int vk = 0;\n  |=>defop:\n\n  switch (op) {\n\n  /* -- Comparison ops ---------------------------------------------------- */\n\n  /* Remember: all ops branch for a true comparison, fall through otherwise. */\n\n  case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:\n    |  // RA = src1*8, RC = src2, JMP with RC = target\n    |   lsl RC, RC, #3\n    |  ldrd CARG12, [RA, BASE]!\n    |    ldrh RB, [PC, #2]\n    |   ldrd CARG34, [RC, BASE]!\n    |    add PC, PC, #4\n    |    add RB, PC, RB, lsl #2\n    |  checktp CARG2, LJ_TISNUM\n    |  bne >3\n    |  checktp CARG4, LJ_TISNUM\n    |  bne >4\n    |  cmp CARG1, CARG3\n    if (op == BC_ISLT) {\n      |  sublt PC, RB, #0x20000\n    } else if (op == BC_ISGE) {\n      |  subge PC, RB, #0x20000\n    } else if (op == BC_ISLE) {\n      |  suble PC, RB, #0x20000\n    } else {\n      |  subgt PC, RB, #0x20000\n    }\n    |1:\n    |  ins_next\n    |\n    |3: // CARG12 is not an integer.\n    |.if FPU\n    |   vldr d0, [RA]\n    |  bhi ->vmeta_comp\n    |  // d0 is a number.\n    |  checktp CARG4, LJ_TISNUM\n    |   vldr d1, [RC]\n    |  blo >5\n    |  bhi ->vmeta_comp\n    |  // d0 is a number, CARG3 is an integer.\n    |  vmov s4, CARG3\n    |  vcvt.f64.s32 d1, s4\n    |  b >5\n    |4:  // CARG1 is an integer, CARG34 is not an integer.\n    |   vldr d1, [RC]\n    |  bhi ->vmeta_comp\n    |  // CARG1 is an integer, d1 is a number.\n    |  vmov s4, CARG1\n    |  vcvt.f64.s32 d0, s4\n    |5:  // d0 and d1 are numbers.\n    |  vcmp.f64 d0, d1\n    |  vmrs\n    |  // To preserve NaN semantics GE/GT branch on unordered, but LT/LE don't.\n    if (op == BC_ISLT) {\n      |  sublo PC, RB, #0x20000\n    } else if (op == BC_ISGE) {\n      |  subhs PC, RB, #0x20000\n    } else if (op == BC_ISLE) {\n      |  subls PC, RB, #0x20000\n    } else {\n      |  subhi PC, RB, #0x20000\n    }\n    |  b <1\n    |.else\n    |  bhi ->vmeta_comp\n    |  // CARG12 is a number.\n    |  checktp CARG4, LJ_TISNUM\n    |  movlo RA, RB\t\t\t// Save RB.\n    |  blo >5\n    |  bhi ->vmeta_comp\n    |  // CARG12 is a number, CARG3 is an integer.\n    |  mov CARG1, CARG3\n    |  mov RC, RA\n    |  mov RA, RB\t\t\t// Save RB.\n    |  bl extern __aeabi_i2d\n    |  mov CARG3, CARG1\n    |  mov CARG4, CARG2\n    |  ldrd CARG12, [RC]\t\t// Restore first operand.\n    |  b >5\n    |4:  // CARG1 is an integer, CARG34 is not an integer.\n    |  bhi ->vmeta_comp\n    |  // CARG1 is an integer, CARG34 is a number.\n    |  mov RA, RB\t\t\t// Save RB.\n    |  bl extern __aeabi_i2d\n    |  ldrd CARG34, [RC]\t\t// Restore second operand.\n    |5:  // CARG12 and CARG34 are numbers.\n    |  bl extern __aeabi_cdcmple\n    |  // To preserve NaN semantics GE/GT branch on unordered, but LT/LE don't.\n    if (op == BC_ISLT) {\n      |  sublo PC, RA, #0x20000\n    } else if (op == BC_ISGE) {\n      |  subhs PC, RA, #0x20000\n    } else if (op == BC_ISLE) {\n      |  subls PC, RA, #0x20000\n    } else {\n      |  subhi PC, RA, #0x20000\n    }\n    |  b <1\n    |.endif\n    break;\n\n  case BC_ISEQV: case BC_ISNEV:\n    vk = op == BC_ISEQV;\n    |  // RA = src1*8, RC = src2, JMP with RC = target\n    |   lsl RC, RC, #3\n    |  ldrd CARG12, [RA, BASE]!\n    |    ldrh RB, [PC, #2]\n    |   ldrd CARG34, [RC, BASE]!\n    |    add PC, PC, #4\n    |    add RB, PC, RB, lsl #2\n    |  checktp CARG2, LJ_TISNUM\n    |  cmnls CARG4, #-LJ_TISNUM\n    if (vk) {\n      |  bls ->BC_ISEQN_Z\n    } else {\n      |  bls ->BC_ISNEN_Z\n    }\n    |  // Either or both types are not numbers.\n    |.if FFI\n    |  checktp CARG2, LJ_TCDATA\n    |  checktpne CARG4, LJ_TCDATA\n    |  beq ->vmeta_equal_cd\n    |.endif\n    |  cmp CARG2, CARG4\t\t\t// Compare types.\n    |  bne >2\t\t\t\t// Not the same type?\n    |  checktp CARG2, LJ_TISPRI\n    |  bhs >1\t\t\t\t// Same type and primitive type?\n    |\n    |  // Same types and not a primitive type. Compare GCobj or pvalue.\n    |  cmp CARG1, CARG3\n    if (vk) {\n      |  bne >3\t\t\t\t// Different GCobjs or pvalues?\n      |1:  // Branch if same.\n      |  sub PC, RB, #0x20000\n      |2:  // Different.\n      |  ins_next\n      |3:\n      |  checktp CARG2, LJ_TISTABUD\n      |  bhi <2\t\t\t\t// Different objects and not table/ud?\n    } else {\n      |  beq >1\t\t\t\t// Same GCobjs or pvalues?\n      |  checktp CARG2, LJ_TISTABUD\n      |  bhi >2\t\t\t\t// Different objects and not table/ud?\n    }\n    |  // Different tables or userdatas. Need to check __eq metamethod.\n    |  // Field metatable must be at same offset for GCtab and GCudata!\n    |  ldr TAB:RA, TAB:CARG1->metatable\n    |  cmp TAB:RA, #0\n    if (vk) {\n      |  beq <2\t\t\t// No metatable?\n    } else {\n      |  beq >2\t\t\t// No metatable?\n    }\n    |  ldrb RA, TAB:RA->nomm\n    |   mov CARG4, #1-vk\t\t// ne = 0 or 1.\n    |   mov CARG2, CARG1\n    |  tst RA, #1<<MM_eq\n    |  beq ->vmeta_equal\t\t// 'no __eq' flag not set?\n    if (vk) {\n      |  b <2\n    } else {\n      |2:  // Branch if different.\n      |  sub PC, RB, #0x20000\n      |1:  // Same.\n      |  ins_next\n    }\n    break;\n\n  case BC_ISEQS: case BC_ISNES:\n    vk = op == BC_ISEQS;\n    |  // RA = src*8, RC = str_const (~), JMP with RC = target\n    |   mvn RC, RC\n    |  ldrd CARG12, [BASE, RA]\n    |    ldrh RB, [PC, #2]\n    |   ldr STR:CARG3, [KBASE, RC, lsl #2]\n    |    add PC, PC, #4\n    |    add RB, PC, RB, lsl #2\n    |  checktp CARG2, LJ_TSTR\n    |.if FFI\n    |  bne >7\n    |  cmp CARG1, CARG3\n    |.else\n    |  cmpeq CARG1, CARG3\n    |.endif\n    if (vk) {\n      |  subeq PC, RB, #0x20000\n      |1:\n    } else {\n      |1:\n      |  subne PC, RB, #0x20000\n    }\n    |  ins_next\n    |\n    |.if FFI\n    |7:\n    |  checktp CARG2, LJ_TCDATA\n    |  bne <1\n    |  b ->vmeta_equal_cd\n    |.endif\n    break;\n\n  case BC_ISEQN: case BC_ISNEN:\n    vk = op == BC_ISEQN;\n    |  // RA = src*8, RC = num_const (~), JMP with RC = target\n    |   lsl RC, RC, #3\n    |  ldrd CARG12, [RA, BASE]!\n    |    ldrh RB, [PC, #2]\n    |   ldrd CARG34, [RC, KBASE]!\n    |    add PC, PC, #4\n    |    add RB, PC, RB, lsl #2\n    if (vk) {\n      |->BC_ISEQN_Z:\n    } else {\n      |->BC_ISNEN_Z:\n    }\n    |  checktp CARG2, LJ_TISNUM\n    |  bne >3\n    |  checktp CARG4, LJ_TISNUM\n    |  bne >4\n    |  cmp CARG1, CARG3\n    if (vk) {\n      |  subeq PC, RB, #0x20000\n      |1:\n    } else {\n      |1:\n      |  subne PC, RB, #0x20000\n    }\n    |2:\n    |  ins_next\n    |\n    |3:  // CARG12 is not an integer.\n    |.if FFI\n    |  bhi >7\n    |.else\n    if (!vk) {\n      |  subhi PC, RB, #0x20000\n    }\n    |  bhi <2\n    |.endif\n    |.if FPU\n    |  checktp CARG4, LJ_TISNUM\n    |  vmov s4, CARG3\n    |   vldr d0, [RA]\n    |  vldrlo d1, [RC]\n    |  vcvths.f64.s32 d1, s4\n    |  b >5\n    |4:  // CARG1 is an integer, d1 is a number.\n    |  vmov s4, CARG1\n    |   vldr d1, [RC]\n    |  vcvt.f64.s32 d0, s4\n    |5:  // d0 and d1 are numbers.\n    |  vcmp.f64 d0, d1\n    |  vmrs\n    if (vk) {\n      |  subeq PC, RB, #0x20000\n    } else {\n      |  subne PC, RB, #0x20000\n    }\n    |  b <2\n    |.else\n    |  // CARG12 is a number.\n    |  checktp CARG4, LJ_TISNUM\n    |  movlo RA, RB\t\t\t// Save RB.\n    |  blo >5\n    |  // CARG12 is a number, CARG3 is an integer.\n    |  mov CARG1, CARG3\n    |  mov RC, RA\n    |4:  // CARG1 is an integer, CARG34 is a number.\n    |  mov RA, RB\t\t\t// Save RB.\n    |  bl extern __aeabi_i2d\n    |  ldrd CARG34, [RC]\t\t// Restore other operand.\n    |5:  // CARG12 and CARG34 are numbers.\n    |  bl extern __aeabi_cdcmpeq\n    if (vk) {\n      |  subeq PC, RA, #0x20000\n    } else {\n      |  subne PC, RA, #0x20000\n    }\n    |  b <2\n    |.endif\n    |\n    |.if FFI\n    |7:\n    |  checktp CARG2, LJ_TCDATA\n    |  bne <1\n    |  b ->vmeta_equal_cd\n    |.endif\n    break;\n\n  case BC_ISEQP: case BC_ISNEP:\n    vk = op == BC_ISEQP;\n    |  // RA = src*8, RC = primitive_type (~), JMP with RC = target\n    |  ldrd CARG12, [BASE, RA]\n    |   ldrh RB, [PC, #2]\n    |   add PC, PC, #4\n    |  mvn RC, RC\n    |   add RB, PC, RB, lsl #2\n    |.if FFI\n    |  checktp CARG2, LJ_TCDATA\n    |  beq ->vmeta_equal_cd\n    |.endif\n    |  cmp CARG2, RC\n    if (vk) {\n      |  subeq PC, RB, #0x20000\n    } else {\n      |  subne PC, RB, #0x20000\n    }\n    |  ins_next\n    break;\n\n  /* -- Unary test and copy ops ------------------------------------------- */\n\n  case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:\n    |  // RA = dst*8 or unused, RC = src, JMP with RC = target\n    |  add RC, BASE, RC, lsl #3\n    |   ldrh RB, [PC, #2]\n    |  ldrd CARG12, [RC]\n    |   add PC, PC, #4\n    |   add RB, PC, RB, lsl #2\n    |  checktp CARG2, LJ_TTRUE\n    if (op == BC_ISTC || op == BC_IST) {\n      |  subls PC, RB, #0x20000\n      if (op == BC_ISTC) {\n\t|  strdls CARG12, [BASE, RA]\n      }\n    } else {\n      |  subhi PC, RB, #0x20000\n      if (op == BC_ISFC) {\n\t|  strdhi CARG12, [BASE, RA]\n      }\n    }\n    |  ins_next\n    break;\n\n  /* -- Unary ops --------------------------------------------------------- */\n\n  case BC_MOV:\n    |  // RA = dst*8, RC = src\n    |  lsl RC, RC, #3\n    |   ins_next1\n    |  ldrd CARG12, [BASE, RC]\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    break;\n  case BC_NOT:\n    |  // RA = dst*8, RC = src\n    |  add RC, BASE, RC, lsl #3\n    |   ins_next1\n    |  ldr CARG1, [RC, #4]\n    |   add RA, BASE, RA\n    |   ins_next2\n    |  checktp CARG1, LJ_TTRUE\n    |  mvnls CARG2, #~LJ_TFALSE\n    |  mvnhi CARG2, #~LJ_TTRUE\n    |  str CARG2, [RA, #4]\n    |   ins_next3\n    break;\n  case BC_UNM:\n    |  // RA = dst*8, RC = src\n    |  lsl RC, RC, #3\n    |  ldrd CARG12, [BASE, RC]\n    |   ins_next1\n    |   ins_next2\n    |  checktp CARG2, LJ_TISNUM\n    |  bhi ->vmeta_unm\n    |  eorne CARG2, CARG2, #0x80000000\n    |  bne >5\n    |  rsbseq CARG1, CARG1, #0\n    |  ldrdvs CARG12, >9\n    |5:\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    |\n    |.align 8\n    |9:\n    |  .long 0x00000000, 0x41e00000\t// 2^31.\n    break;\n  case BC_LEN:\n    |  // RA = dst*8, RC = src\n    |  lsl RC, RC, #3\n    |  ldrd CARG12, [BASE, RC]\n    |  checkstr CARG2, >2\n    |  ldr CARG1, STR:CARG1->len\n    |1:\n    |  mvn CARG2, #~LJ_TISNUM\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    |2:\n    |  checktab CARG2, ->vmeta_len\n#if LJ_52\n    |  ldr TAB:CARG3, TAB:CARG1->metatable\n    |  cmp TAB:CARG3, #0\n    |  bne >9\n    |3:\n#endif\n    |->BC_LEN_Z:\n    |  .IOS mov RC, BASE\n    |  bl extern lj_tab_len\t\t// (GCtab *t)\n    |  // Returns uint32_t (but less than 2^31).\n    |  .IOS mov BASE, RC\n    |  b <1\n#if LJ_52\n    |9:\n    |  ldrb CARG4, TAB:CARG3->nomm\n    |  tst CARG4, #1<<MM_len\n    |  bne <3\t\t\t\t// 'no __len' flag set: done.\n    |  b ->vmeta_len\n#endif\n    break;\n\n  /* -- Binary ops -------------------------------------------------------- */\n\n    |.macro ins_arithcheck, cond, ncond, target\n    ||if (vk == 1) {\n    |   cmn CARG4, #-LJ_TISNUM\n    |    cmn..cond CARG2, #-LJ_TISNUM\n    ||} else {\n    |   cmn CARG2, #-LJ_TISNUM\n    |    cmn..cond CARG4, #-LJ_TISNUM\n    ||}\n    |  b..ncond target\n    |.endmacro\n    |.macro ins_arithcheck_int, target\n    |  ins_arithcheck eq, ne, target\n    |.endmacro\n    |.macro ins_arithcheck_num, target\n    |  ins_arithcheck lo, hs, target\n    |.endmacro\n    |\n    |.macro ins_arithpre\n    |  decode_RB8 RB, INS\n    |   decode_RC8 RC, INS\n    |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8\n    ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);\n    ||switch (vk) {\n    ||case 0:\n    |   .if FPU\n    |   ldrd CARG12, [RB, BASE]!\n    |    ldrd CARG34, [RC, KBASE]!\n    |   .else\n    |   ldrd CARG12, [BASE, RB]\n    |    ldrd CARG34, [KBASE, RC]\n    |   .endif\n    ||  break;\n    ||case 1:\n    |   .if FPU\n    |   ldrd CARG34, [RB, BASE]!\n    |    ldrd CARG12, [RC, KBASE]!\n    |   .else\n    |   ldrd CARG34, [BASE, RB]\n    |    ldrd CARG12, [KBASE, RC]\n    |   .endif\n    ||  break;\n    ||default:\n    |   .if FPU\n    |   ldrd CARG12, [RB, BASE]!\n    |    ldrd CARG34, [RC, BASE]!\n    |   .else\n    |   ldrd CARG12, [BASE, RB]\n    |    ldrd CARG34, [BASE, RC]\n    |   .endif\n    ||  break;\n    ||}\n    |.endmacro\n    |\n    |.macro ins_arithpre_fpu, reg1, reg2\n    |.if FPU\n    ||if (vk == 1) {\n    |  vldr reg2, [RB]\n    |  vldr reg1, [RC]\n    ||} else {\n    |  vldr reg1, [RB]\n    |  vldr reg2, [RC]\n    ||}\n    |.endif\n    |.endmacro\n    |\n    |.macro ins_arithpost_fpu, reg\n    |   ins_next1\n    |  add RA, BASE, RA\n    |   ins_next2\n    |  vstr reg, [RA]\n    |   ins_next3\n    |.endmacro\n    |\n    |.macro ins_arithfallback, ins\n    ||switch (vk) {\n    ||case 0:\n    |   ins ->vmeta_arith_vn\n    ||  break;\n    ||case 1:\n    |   ins ->vmeta_arith_nv\n    ||  break;\n    ||default:\n    |   ins ->vmeta_arith_vv\n    ||  break;\n    ||}\n    |.endmacro\n    |\n    |.macro ins_arithdn, intins, fpins, fpcall\n    |  ins_arithpre\n    |.if \"intins\" ~= \"vm_modi\" and not FPU\n    |   ins_next1\n    |.endif\n    |  ins_arithcheck_int >5\n    |.if \"intins\" == \"smull\"\n    |  smull CARG1, RC, CARG3, CARG1\n    |  cmp RC, CARG1, asr #31\n    |  ins_arithfallback bne\n    |.elif \"intins\" == \"vm_modi\"\n    |  movs CARG2, CARG3\n    |  ins_arithfallback beq\n    |  bl ->vm_modi\n    |  mvn CARG2, #~LJ_TISNUM\n    |.else\n    |  intins CARG1, CARG1, CARG3\n    |  ins_arithfallback bvs\n    |.endif\n    |4:\n    |.if \"intins\" == \"vm_modi\" or FPU\n    |   ins_next1\n    |.endif\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    |5:  // FP variant.\n    |  ins_arithpre_fpu d6, d7\n    |  ins_arithfallback ins_arithcheck_num\n    |.if FPU\n    |.if \"intins\" == \"vm_modi\"\n    |  bl fpcall\n    |.else\n    |  fpins d6, d6, d7\n    |.endif\n    |  ins_arithpost_fpu d6\n    |.else\n    |  bl fpcall\n    |.if \"intins\" ~= \"vm_modi\"\n    |  ins_next1\n    |.endif\n    |  b <4\n    |.endif\n    |.endmacro\n    |\n    |.macro ins_arithfp, fpins, fpcall\n    |  ins_arithpre\n    |.if \"fpins\" ~= \"extern\" or HFABI\n    |  ins_arithpre_fpu d0, d1\n    |.endif\n    |  ins_arithfallback ins_arithcheck_num\n    |.if \"fpins\" == \"extern\"\n    |  .IOS mov RC, BASE\n    |  bl fpcall\n    |  .IOS mov BASE, RC\n    |.elif FPU\n    |  fpins d0, d0, d1\n    |.else\n    |  bl fpcall\n    |.endif\n    |.if (\"fpins\" ~= \"extern\" or HFABI) and FPU\n    |  ins_arithpost_fpu d0\n    |.else\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    |.endif\n    |.endmacro\n\n  case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:\n    |  ins_arithdn adds, vadd.f64, extern __aeabi_dadd\n    break;\n  case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:\n    |  ins_arithdn subs, vsub.f64, extern __aeabi_dsub\n    break;\n  case BC_MULVN: case BC_MULNV: case BC_MULVV:\n    |  ins_arithdn smull, vmul.f64, extern __aeabi_dmul\n    break;\n  case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:\n    |  ins_arithfp vdiv.f64, extern __aeabi_ddiv\n    break;\n  case BC_MODVN: case BC_MODNV: case BC_MODVV:\n    |  ins_arithdn vm_modi, vm_mod, ->vm_mod\n    break;\n  case BC_POW:\n    |  // NYI: (partial) integer arithmetic.\n    |  ins_arithfp extern, extern pow\n    break;\n\n  case BC_CAT:\n    |  decode_RB8 RC, INS\n    |   decode_RC8 RB, INS\n    |  // RA = dst*8, RC = src_start*8, RB = src_end*8  (note: RB/RC swapped!)\n    |  sub CARG3, RB, RC\n    |   str BASE, L->base\n    |  add CARG2, BASE, RB\n    |->BC_CAT_Z:\n    |  // RA = dst*8, RC = src_start*8, CARG2 = top-1\n    |  mov CARG1, L\n    |   str PC, SAVE_PC\n    |  lsr CARG3, CARG3, #3\n    |  bl extern lj_meta_cat\t\t// (lua_State *L, TValue *top, int left)\n    |  // Returns NULL (finished) or TValue * (metamethod).\n    |  ldr BASE, L->base\n    |  cmp CRET1, #0\n    |  bne ->vmeta_binop\n    |  ldrd CARG34, [BASE, RC]\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG34, [BASE, RA]\t\t// Copy result to RA.\n    |   ins_next3\n    break;\n\n  /* -- Constant ops ------------------------------------------------------ */\n\n  case BC_KSTR:\n    |  // RA = dst*8, RC = str_const (~)\n    |  mvn RC, RC\n    |   ins_next1\n    |  ldr CARG1, [KBASE, RC, lsl #2]\n    |  mvn CARG2, #~LJ_TSTR\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    break;\n  case BC_KCDATA:\n    |.if FFI\n    |  // RA = dst*8, RC = cdata_const (~)\n    |  mvn RC, RC\n    |   ins_next1\n    |  ldr CARG1, [KBASE, RC, lsl #2]\n    |  mvn CARG2, #~LJ_TCDATA\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    |.endif\n    break;\n  case BC_KSHORT:\n    |  // RA = dst*8, (RC = int16_literal)\n    |  mov CARG1, INS, asr #16\t\t\t// Refetch sign-extended reg.\n    |  mvn CARG2, #~LJ_TISNUM\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    break;\n  case BC_KNUM:\n    |  // RA = dst*8, RC = num_const\n    |  lsl RC, RC, #3\n    |   ins_next1\n    |  ldrd CARG12, [KBASE, RC]\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    break;\n  case BC_KPRI:\n    |  // RA = dst*8, RC = primitive_type (~)\n    |  add RA, BASE, RA\n    |  mvn RC, RC\n    |   ins_next1\n    |   ins_next2\n    |  str RC, [RA, #4]\n    |   ins_next3\n    break;\n  case BC_KNIL:\n    |  // RA = base*8, RC = end\n    |  add RA, BASE, RA\n    |   add RC, BASE, RC, lsl #3\n    |  mvn CARG1, #~LJ_TNIL\n    |  str CARG1, [RA, #4]\n    |   add RA, RA, #8\n    |1:\n    |  str CARG1, [RA, #4]\n    |  cmp RA, RC\n    |   add RA, RA, #8\n    |  blt <1\n    |  ins_next_\n    break;\n\n  /* -- Upvalue and function ops ------------------------------------------ */\n\n  case BC_UGET:\n    |  // RA = dst*8, RC = uvnum\n    |  ldr LFUNC:CARG2, [BASE, FRAME_FUNC]\n    |   lsl RC, RC, #2\n    |   add RC, RC, #offsetof(GCfuncL, uvptr)\n    |  ldr UPVAL:CARG2, [LFUNC:CARG2, RC]\n    |  ldr CARG2, UPVAL:CARG2->v\n    |  ldrd CARG34, [CARG2]\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG34, [BASE, RA]\n    |   ins_next3\n    break;\n  case BC_USETV:\n    |  // RA = uvnum*8, RC = src\n    |  ldr LFUNC:CARG2, [BASE, FRAME_FUNC]\n    |   lsr RA, RA, #1\n    |   add RA, RA, #offsetof(GCfuncL, uvptr)\n    |    lsl RC, RC, #3\n    |  ldr UPVAL:CARG2, [LFUNC:CARG2, RA]\n    |    ldrd CARG34, [BASE, RC]\n    |  ldrb RB, UPVAL:CARG2->marked\n    |  ldrb RC, UPVAL:CARG2->closed\n    |    ldr CARG2, UPVAL:CARG2->v\n    |  tst RB, #LJ_GC_BLACK\t\t// isblack(uv)\n    |   add RB, CARG4, #-LJ_TISGCV\n    |  cmpne RC, #0\n    |   strd CARG34, [CARG2]\n    |  bne >2\t\t\t\t// Upvalue is closed and black?\n    |1:\n    |   ins_next\n    |\n    |2:  // Check if new value is collectable.\n    |  cmn RB, #-(LJ_TISNUM - LJ_TISGCV)\n    |   ldrbhi RC, GCOBJ:CARG3->gch.marked\n    |  bls <1\t\t\t\t// tvisgcv(v)\n    |    sub CARG1, DISPATCH, #-GG_DISP2G\n    |   tst RC, #LJ_GC_WHITES\n    |  // Crossed a write barrier. Move the barrier forward.\n    |.if IOS\n    |  beq <1\n    |  mov RC, BASE\n    |  bl extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |  mov BASE, RC\n    |.else\n    |  blne extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |.endif\n    |  b <1\n    break;\n  case BC_USETS:\n    |  // RA = uvnum*8, RC = str_const (~)\n    |  ldr LFUNC:CARG2, [BASE, FRAME_FUNC]\n    |   lsr RA, RA, #1\n    |   add RA, RA, #offsetof(GCfuncL, uvptr)\n    |    mvn RC, RC\n    |  ldr UPVAL:CARG2, [LFUNC:CARG2, RA]\n    |    ldr STR:CARG3, [KBASE, RC, lsl #2]\n    |    mvn CARG4, #~LJ_TSTR\n    |  ldrb RB, UPVAL:CARG2->marked\n    |   ldr CARG2, UPVAL:CARG2->v\n    |     ldrb RC, UPVAL:CARG2->closed\n    |  tst RB, #LJ_GC_BLACK\t\t// isblack(uv)\n    |    ldrb RB, STR:CARG3->marked\n    |   strd CARG34, [CARG2]\n    |  bne >2\n    |1:\n    |   ins_next\n    |\n    |2:  // Check if string is white and ensure upvalue is closed.\n    |  tst RB, #LJ_GC_WHITES\t\t// iswhite(str)\n    |  cmpne RC, #0\n    |   sub CARG1, DISPATCH, #-GG_DISP2G\n    |  // Crossed a write barrier. Move the barrier forward.\n    |.if IOS\n    |  beq <1\n    |  mov RC, BASE\n    |  bl extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |  mov BASE, RC\n    |.else\n    |  blne extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |.endif\n    |  b <1\n    break;\n  case BC_USETN:\n    |  // RA = uvnum*8, RC = num_const\n    |  ldr LFUNC:CARG2, [BASE, FRAME_FUNC]\n    |   lsr RA, RA, #1\n    |   add RA, RA, #offsetof(GCfuncL, uvptr)\n    |    lsl RC, RC, #3\n    |  ldr UPVAL:CARG2, [LFUNC:CARG2, RA]\n    |    ldrd CARG34, [KBASE, RC]\n    |  ldr CARG2, UPVAL:CARG2->v\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG34, [CARG2]\n    |   ins_next3\n    break;\n  case BC_USETP:\n    |  // RA = uvnum*8, RC = primitive_type (~)\n    |  ldr LFUNC:CARG2, [BASE, FRAME_FUNC]\n    |   lsr RA, RA, #1\n    |   add RA, RA, #offsetof(GCfuncL, uvptr)\n    |  ldr UPVAL:CARG2, [LFUNC:CARG2, RA]\n    |   mvn RC, RC\n    |  ldr CARG2, UPVAL:CARG2->v\n    |   ins_next1\n    |   ins_next2\n    |  str RC, [CARG2, #4]\n    |   ins_next3\n    break;\n\n  case BC_UCLO:\n    |  // RA = level*8, RC = target\n    |  ldr CARG3, L->openupval\n    |   add RC, PC, RC, lsl #2\n    |   str BASE, L->base\n    |  cmp CARG3, #0\n    |   sub PC, RC, #0x20000\n    |  beq >1\n    |   mov CARG1, L\n    |   add CARG2, BASE, RA\n    |  bl extern lj_func_closeuv\t// (lua_State *L, TValue *level)\n    |  ldr BASE, L->base\n    |1:\n    |  ins_next\n    break;\n\n  case BC_FNEW:\n    |  // RA = dst*8, RC = proto_const (~) (holding function prototype)\n    |  mvn RC, RC\n    |   str BASE, L->base\n    |  ldr CARG2, [KBASE, RC, lsl #2]\n    |   str PC, SAVE_PC\n    |  ldr CARG3, [BASE, FRAME_FUNC]\n    |   mov CARG1, L\n    |  // (lua_State *L, GCproto *pt, GCfuncL *parent)\n    |  bl extern lj_func_newL_gc\n    |  // Returns GCfuncL *.\n    |  ldr BASE, L->base\n    |  mvn CARG2, #~LJ_TFUNC\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    break;\n\n  /* -- Table ops --------------------------------------------------------- */\n\n  case BC_TNEW:\n  case BC_TDUP:\n    |  // RA = dst*8, RC = (hbits|asize) | tab_const (~)\n    if (op == BC_TDUP) {\n      |  mvn RC, RC\n    }\n    |  ldr CARG3, [DISPATCH, #DISPATCH_GL(gc.total)]\n    |   ldr CARG4, [DISPATCH, #DISPATCH_GL(gc.threshold)]\n    |    str BASE, L->base\n    |    str PC, SAVE_PC\n    |  cmp CARG3, CARG4\n    |   mov CARG1, L\n    |  bhs >5\n    |1:\n    if (op == BC_TNEW) {\n      |  lsl CARG2, RC, #21\n      |   lsr CARG3, RC, #11\n      |  asr RC, CARG2, #21\n      |  lsr CARG2, CARG2, #21\n      |  cmn RC, #1\n      |  addeq CARG2, CARG2, #2\n      |  bl extern lj_tab_new  // (lua_State *L, int32_t asize, uint32_t hbits)\n      |  // Returns GCtab *.\n    } else {\n      |  ldr CARG2, [KBASE, RC, lsl #2]\n      |  bl extern lj_tab_dup  // (lua_State *L, Table *kt)\n      |  // Returns GCtab *.\n    }\n    |  ldr BASE, L->base\n    |  mvn CARG2, #~LJ_TTAB\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG12, [BASE, RA]\n    |   ins_next3\n    |5:\n    |  bl extern lj_gc_step_fixtop  // (lua_State *L)\n    |  mov CARG1, L\n    |  b <1\n    break;\n\n  case BC_GGET:\n    |  // RA = dst*8, RC = str_const (~)\n  case BC_GSET:\n    |  // RA = dst*8, RC = str_const (~)\n    |  ldr LFUNC:CARG2, [BASE, FRAME_FUNC]\n    |   mvn RC, RC\n    |  ldr TAB:CARG1, LFUNC:CARG2->env\n    |   ldr STR:RC, [KBASE, RC, lsl #2]\n    if (op == BC_GGET) {\n      |  b ->BC_TGETS_Z\n    } else {\n      |  b ->BC_TSETS_Z\n    }\n    break;\n\n  case BC_TGETV:\n    |  decode_RB8 RB, INS\n    |   decode_RC8 RC, INS\n    |  // RA = dst*8, RB = table*8, RC = key*8\n    |  ldrd TAB:CARG12, [BASE, RB]\n    |   ldrd CARG34, [BASE, RC]\n    |  checktab CARG2, ->vmeta_tgetv  // STALL: load CARG12.\n    |   checktp CARG4, LJ_TISNUM\t// Integer key?\n    |  ldreq CARG4, TAB:CARG1->array\n    |    ldreq CARG2, TAB:CARG1->asize\n    |   bne >9\n    |\n    |  add CARG4, CARG4, CARG3, lsl #3\n    |    cmp CARG3, CARG2\t\t// In array part?\n    |  ldrdlo CARG34, [CARG4]\n    |    bhs ->vmeta_tgetv\n    |   ins_next1  // Overwrites RB!\n    |  checktp CARG4, LJ_TNIL\n    |  beq >5\n    |1:\n    |   ins_next2\n    |  strd CARG34, [BASE, RA]\n    |   ins_next3\n    |\n    |5:  // Check for __index if table value is nil.\n    |  ldr TAB:CARG2, TAB:CARG1->metatable\n    |  cmp TAB:CARG2, #0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  ldrb CARG2, TAB:CARG2->nomm\n    |  tst CARG2, #1<<MM_index\n    |  bne <1\t\t\t\t// 'no __index' flag set: done.\n    |  decode_RB8 RB, INS\t\t// Restore RB.\n    |  b ->vmeta_tgetv\n    |\n    |9:\n    |  checktp CARG4, LJ_TSTR\t\t// String key?\n    |   moveq STR:RC, CARG3\n    |  beq ->BC_TGETS_Z\n    |  b ->vmeta_tgetv\n    break;\n  case BC_TGETS:\n    |  decode_RB8 RB, INS\n    |   and RC, RC, #255\n    |  // RA = dst*8, RB = table*8, RC = str_const (~)\n    |  ldrd CARG12, [BASE, RB]\n    |   mvn RC, RC\n    |   ldr STR:RC, [KBASE, RC, lsl #2]  // STALL: early RC.\n    |  checktab CARG2, ->vmeta_tgets1\n    |->BC_TGETS_Z:\n    |  // (TAB:RB =) TAB:CARG1 = GCtab *, STR:RC = GCstr *, RA = dst*8\n    |  ldr CARG3, TAB:CARG1->hmask\n    |   ldr CARG4, STR:RC->hash\n    |    ldr NODE:INS, TAB:CARG1->node\n    |     mov TAB:RB, TAB:CARG1\n    |  and CARG3, CARG3, CARG4\t\t\t// idx = str->hash & tab->hmask\n    |  add CARG3, CARG3, CARG3, lsl #1\n    |    add NODE:INS, NODE:INS, CARG3, lsl #3\t// node = tab->node + idx*3*8\n    |1:\n    |  ldrd CARG12, NODE:INS->key  // STALL: early NODE:INS.\n    |   ldrd CARG34, NODE:INS->val\n    |    ldr NODE:INS, NODE:INS->next\n    |  checktp CARG2, LJ_TSTR\n    |  cmpeq CARG1, STR:RC\n    |  bne >4\n    |   checktp CARG4, LJ_TNIL\n    |   beq >5\n    |3:\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG34, [BASE, RA]\n    |   ins_next3\n    |\n    |4:  // Follow hash chain.\n    |  cmp NODE:INS, #0\n    |  bne <1\n    |  // End of hash chain: key not found, nil result.\n    |\n    |5:  // Check for __index if table value is nil.\n    |  ldr TAB:CARG1, TAB:RB->metatable\n    |   mov CARG3, #0  // Optional clear of undef. value (during load stall).\n    |   mvn CARG4, #~LJ_TNIL\n    |  cmp TAB:CARG1, #0\n    |  beq <3\t\t\t\t// No metatable: done.\n    |  ldrb CARG2, TAB:CARG1->nomm\n    |  tst CARG2, #1<<MM_index\n    |  bne <3\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgets\n    break;\n  case BC_TGETB:\n    |  decode_RB8 RB, INS\n    |   and RC, RC, #255\n    |  // RA = dst*8, RB = table*8, RC = index\n    |  ldrd CARG12, [BASE, RB]\n    |  checktab CARG2, ->vmeta_tgetb  // STALL: load CARG12.\n    |   ldr CARG3, TAB:CARG1->asize\n    |  ldr CARG4, TAB:CARG1->array\n    |  lsl CARG2, RC, #3\n    |   cmp RC, CARG3\n    |  ldrdlo CARG34, [CARG4, CARG2]\n    |   bhs ->vmeta_tgetb\n    |   ins_next1  // Overwrites RB!\n    |  checktp CARG4, LJ_TNIL\n    |  beq >5\n    |1:\n    |   ins_next2\n    |  strd CARG34, [BASE, RA]\n    |   ins_next3\n    |\n    |5:  // Check for __index if table value is nil.\n    |  ldr TAB:CARG2, TAB:CARG1->metatable\n    |  cmp TAB:CARG2, #0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  ldrb CARG2, TAB:CARG2->nomm\n    |  tst CARG2, #1<<MM_index\n    |  bne <1\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgetb\n    break;\n\n  case BC_TSETV:\n    |  decode_RB8 RB, INS\n    |   decode_RC8 RC, INS\n    |  // RA = src*8, RB = table*8, RC = key*8\n    |  ldrd TAB:CARG12, [BASE, RB]\n    |   ldrd CARG34, [BASE, RC]\n    |  checktab CARG2, ->vmeta_tsetv  // STALL: load CARG12.\n    |   checktp CARG4, LJ_TISNUM\t// Integer key?\n    |  ldreq CARG2, TAB:CARG1->array\n    |    ldreq CARG4, TAB:CARG1->asize\n    |   bne >9\n    |\n    |  add CARG2, CARG2, CARG3, lsl #3\n    |    cmp CARG3, CARG4\t\t// In array part?\n    |  ldrlo INS, [CARG2, #4]\n    |    bhs ->vmeta_tsetv\n    |   ins_next1  // Overwrites RB!\n    |  checktp INS, LJ_TNIL\n    |  ldrb INS, TAB:CARG1->marked\n    |   ldrd CARG34, [BASE, RA]\n    |  beq >5\n    |1:\n    |  tst INS, #LJ_GC_BLACK\t\t// isblack(table)\n    |   strd CARG34, [CARG2]\n    |  bne >7\n    |2:\n    |   ins_next2\n    |   ins_next3\n    |\n    |5:  // Check for __newindex if previous value is nil.\n    |  ldr TAB:RA, TAB:CARG1->metatable\n    |  cmp TAB:RA, #0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  ldrb RA, TAB:RA->nomm\n    |  tst RA, #1<<MM_newindex\n    |  bne <1\t\t\t\t// 'no __newindex' flag set: done.\n    |  ldr INS, [PC, #-4]\t\t// Restore RA and RB.\n    |  decode_RB8 RB, INS\n    |  decode_RA8 RA, INS\n    |  b ->vmeta_tsetv\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:CARG1, INS, CARG3\n    |  b <2\n    |\n    |9:\n    |  checktp CARG4, LJ_TSTR\t\t// String key?\n    |   moveq STR:RC, CARG3\n    |  beq ->BC_TSETS_Z\n    |  b ->vmeta_tsetv\n    break;\n  case BC_TSETS:\n    |  decode_RB8 RB, INS\n    |   and RC, RC, #255\n    |  // RA = src*8, RB = table*8, RC = str_const (~)\n    |  ldrd CARG12, [BASE, RB]\n    |   mvn RC, RC\n    |   ldr STR:RC, [KBASE, RC, lsl #2]  // STALL: early RC.\n    |  checktab CARG2, ->vmeta_tsets1\n    |->BC_TSETS_Z:\n    |  // (TAB:RB =) TAB:CARG1 = GCtab *, STR:RC = GCstr *, RA = dst*8\n    |  ldr CARG3, TAB:CARG1->hmask\n    |   ldr CARG4, STR:RC->hash\n    |    ldr NODE:INS, TAB:CARG1->node\n    |     mov TAB:RB, TAB:CARG1\n    |  and CARG3, CARG3, CARG4\t\t\t// idx = str->hash & tab->hmask\n    |  add CARG3, CARG3, CARG3, lsl #1\n    |   mov CARG4, #0\n    |    add NODE:INS, NODE:INS, CARG3, lsl #3\t// node = tab->node + idx*3*8\n    |   strb CARG4, TAB:RB->nomm\t\t// Clear metamethod cache.\n    |1:\n    |  ldrd CARG12, NODE:INS->key\n    |   ldr CARG4, NODE:INS->val.it\n    |    ldr NODE:CARG3, NODE:INS->next\n    |  checktp CARG2, LJ_TSTR\n    |  cmpeq CARG1, STR:RC\n    |  bne >5\n    |  ldrb CARG2, TAB:RB->marked\n    |   checktp CARG4, LJ_TNIL\t\t// Key found, but nil value?\n    |    ldrd CARG34, [BASE, RA]\n    |   beq >4\n    |2:\n    |  tst CARG2, #LJ_GC_BLACK\t\t// isblack(table)\n    |    strd CARG34, NODE:INS->val\n    |  bne >7\n    |3:\n    |   ins_next\n    |\n    |4:  // Check for __newindex if previous value is nil.\n    |  ldr TAB:CARG1, TAB:RB->metatable\n    |  cmp TAB:CARG1, #0\n    |  beq <2\t\t\t\t// No metatable: done.\n    |  ldrb CARG1, TAB:CARG1->nomm\n    |  tst CARG1, #1<<MM_newindex\n    |  bne <2\t\t\t\t// 'no __newindex' flag set: done.\n    |  b ->vmeta_tsets\n    |\n    |5:  // Follow hash chain.\n    |  movs NODE:INS, NODE:CARG3\n    |  bne <1\n    |  // End of hash chain: key not found, add a new one.\n    |\n    |  // But check for __newindex first.\n    |  ldr TAB:CARG1, TAB:RB->metatable\n    |   mov CARG3, TMPDp\n    |   str PC, SAVE_PC\n    |  cmp TAB:CARG1, #0\t\t// No metatable: continue.\n    |   str BASE, L->base\n    |  ldrbne CARG2, TAB:CARG1->nomm\n    |   mov CARG1, L\n    |  beq >6\n    |  tst CARG2, #1<<MM_newindex\n    |  beq ->vmeta_tsets\t\t// 'no __newindex' flag NOT set: check.\n    |6:\n    |  mvn CARG4, #~LJ_TSTR\n    |   str STR:RC, TMPDlo\n    |   mov CARG2, TAB:RB\n    |  str CARG4, TMPDhi\n    |  bl extern lj_tab_newkey\t\t// (lua_State *L, GCtab *t, TValue *k)\n    |  // Returns TValue *.\n    |  ldr BASE, L->base\n    |  ldrd CARG34, [BASE, RA]\n    |  strd CARG34, [CRET1]\n    |  b <3\t\t\t\t// No 2nd write barrier needed.\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, CARG2, CARG3\n    |  b <3\n    break;\n  case BC_TSETB:\n    |  decode_RB8 RB, INS\n    |   and RC, RC, #255\n    |  // RA = src*8, RB = table*8, RC = index\n    |  ldrd CARG12, [BASE, RB]\n    |  checktab CARG2, ->vmeta_tsetb  // STALL: load CARG12.\n    |   ldr CARG3, TAB:CARG1->asize\n    |  ldr RB, TAB:CARG1->array\n    |  lsl CARG2, RC, #3\n    |   cmp RC, CARG3\n    |  ldrdlo CARG34, [CARG2, RB]!\n    |   bhs ->vmeta_tsetb\n    |   ins_next1  // Overwrites RB!\n    |  checktp CARG4, LJ_TNIL\n    |  ldrb INS, TAB:CARG1->marked\n    |   ldrd CARG34, [BASE, RA]\n    |  beq >5\n    |1:\n    |  tst INS, #LJ_GC_BLACK\t\t// isblack(table)\n    |    strd CARG34, [CARG2]\n    |  bne >7\n    |2:\n    |   ins_next2\n    |   ins_next3\n    |\n    |5:  // Check for __newindex if previous value is nil.\n    |  ldr TAB:RA, TAB:CARG1->metatable\n    |  cmp TAB:RA, #0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  ldrb RA, TAB:RA->nomm\n    |  tst RA, #1<<MM_newindex\n    |  bne <1\t\t\t\t// 'no __newindex' flag set: done.\n    |  ldr INS, [PC, #-4]\t\t// Restore INS.\n    |  decode_RA8 RA, INS\n    |  b ->vmeta_tsetb\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:CARG1, INS, CARG3\n    |  b <2\n    break;\n\n  case BC_TSETM:\n    |  // RA = base*8 (table at base-1), RC = num_const (start index)\n    |  add RA, BASE, RA\n    |1:\n    |   ldr RB, SAVE_MULTRES\n    |  ldr TAB:CARG2, [RA, #-8]\t\t// Guaranteed to be a table.\n    |  ldr CARG1, [KBASE, RC, lsl #3]\t// Integer constant is in lo-word.\n    |   subs RB, RB, #8\n    |  ldr CARG4, TAB:CARG2->asize\n    |   beq >4\t\t\t\t// Nothing to copy?\n    |  add CARG3, CARG1, RB, lsr #3\n    |  cmp CARG3, CARG4\n    |   ldr CARG4, TAB:CARG2->array\n    |    add RB, RA, RB\n    |  bhi >5\n    |   add INS, CARG4, CARG1, lsl #3\n    |    ldrb CARG1, TAB:CARG2->marked\n    |3:  // Copy result slots to table.\n    |   ldrd CARG34, [RA], #8\n    |   strd CARG34, [INS], #8\n    |  cmp RA, RB\n    |  blo <3\n    |    tst CARG1, #LJ_GC_BLACK\t// isblack(table)\n    |    bne >7\n    |4:\n    |  ins_next\n    |\n    |5:  // Need to resize array part.\n    |   str BASE, L->base\n    |  mov CARG1, L\n    |   str PC, SAVE_PC\n    |  bl extern lj_tab_reasize\t\t// (lua_State *L, GCtab *t, int nasize)\n    |  // Must not reallocate the stack.\n    |  .IOS ldr BASE, L->base\n    |  b <1\n    |\n    |7:  // Possible table write barrier for any value. Skip valiswhite check.\n    |  barrierback TAB:CARG2, CARG1, CARG3\n    |  b <4\n    break;\n\n  /* -- Calls and vararg handling ----------------------------------------- */\n\n  case BC_CALLM:\n    |  // RA = base*8, (RB = nresults+1,) RC = extra_nargs\n    |  ldr CARG1, SAVE_MULTRES\n    |  decode_RC8 NARGS8:RC, INS\n    |  add NARGS8:RC, NARGS8:RC, CARG1\n    |  b ->BC_CALL_Z\n    break;\n  case BC_CALL:\n    |  decode_RC8 NARGS8:RC, INS\n    |  // RA = base*8, (RB = nresults+1,) RC = (nargs+1)*8\n    |->BC_CALL_Z:\n    |  mov RB, BASE\t\t\t// Save old BASE for vmeta_call.\n    |  ldrd CARG34, [BASE, RA]!\n    |   sub NARGS8:RC, NARGS8:RC, #8\n    |   add BASE, BASE, #8\n    |  checkfunc CARG4, ->vmeta_call\n    |  ins_call\n    break;\n\n  case BC_CALLMT:\n    |  // RA = base*8, (RB = 0,) RC = extra_nargs\n    |  ldr CARG1, SAVE_MULTRES\n    |  add NARGS8:RC, CARG1, RC, lsl #3\n    |  b ->BC_CALLT1_Z\n    break;\n  case BC_CALLT:\n    |  lsl NARGS8:RC, RC, #3\n    |  // RA = base*8, (RB = 0,) RC = (nargs+1)*8\n    |->BC_CALLT1_Z:\n    |  ldrd LFUNC:CARG34, [RA, BASE]!\n    |   sub NARGS8:RC, NARGS8:RC, #8\n    |   add RA, RA, #8\n    |  checkfunc CARG4, ->vmeta_callt\n    |  ldr PC, [BASE, FRAME_PC]\n    |->BC_CALLT2_Z:\n    |   mov RB, #0\n    |   ldrb CARG4, LFUNC:CARG3->ffid\n    |  tst PC, #FRAME_TYPE\n    |  bne >7\n    |1:\n    |  str LFUNC:CARG3, [BASE, FRAME_FUNC]  // Copy function down, but keep PC.\n    |  cmp NARGS8:RC, #0\n    |  beq >3\n    |2:\n    |  ldrd CARG12, [RA, RB]\n    |   add INS, RB, #8\n    |   cmp INS, NARGS8:RC\n    |  strd CARG12, [BASE, RB]\n    |    mov RB, INS\n    |   bne <2\n    |3:\n    |  cmp CARG4, #1\t\t\t// (> FF_C) Calling a fast function?\n    |  bhi >5\n    |4:\n    |  ins_callt\n    |\n    |5:  // Tailcall to a fast function with a Lua frame below.\n    |  ldr INS, [PC, #-4]\n    |  decode_RA8 RA, INS\n    |  sub CARG1, BASE, RA\n    |  ldr LFUNC:CARG1, [CARG1, #-16]\n    |  ldr CARG1, LFUNC:CARG1->field_pc\n    |  ldr KBASE, [CARG1, #PC2PROTO(k)]\n    |  b <4\n    |\n    |7:  // Tailcall from a vararg function.\n    |  eor PC, PC, #FRAME_VARG\n    |  tst PC, #FRAME_TYPEP\t\t// Vararg frame below?\n    |  movne CARG4, #0\t\t\t// Clear ffid if no Lua function below.\n    |  bne <1\n    |  sub BASE, BASE, PC\n    |  ldr PC, [BASE, FRAME_PC]\n    |  tst PC, #FRAME_TYPE\n    |  movne CARG4, #0\t\t\t// Clear ffid if no Lua function below.\n    |  b <1\n    break;\n\n  case BC_ITERC:\n    |  // RA = base*8, (RB = nresults+1, RC = nargs+1 (2+1))\n    |  add RA, BASE, RA\n    |   mov RB, BASE\t\t\t// Save old BASE for vmeta_call.\n    |  ldrd CARG34, [RA, #-16]\n    |   ldrd CARG12, [RA, #-8]\n    |    add BASE, RA, #8\n    |  strd CARG34, [RA, #8]\t\t// Copy state.\n    |   strd CARG12, [RA, #16]\t\t// Copy control var.\n    |  // STALL: locked CARG34.\n    |  ldrd LFUNC:CARG34, [RA, #-24]\n    |    mov NARGS8:RC, #16\t\t// Iterators get 2 arguments.\n    |  // STALL: load CARG34.\n    |  strd LFUNC:CARG34, [RA]\t\t// Copy callable.\n    |  checkfunc CARG4, ->vmeta_call\n    |  ins_call\n    break;\n\n  case BC_ITERN:\n    |  // RA = base*8, (RB = nresults+1, RC = nargs+1 (2+1))\n    |.if JIT\n    |  // NYI: add hotloop, record BC_ITERN.\n    |.endif\n    |  add RA, BASE, RA\n    |  ldr TAB:RB, [RA, #-16]\n    |  ldr CARG1, [RA, #-8]\t\t// Get index from control var.\n    |  ldr INS, TAB:RB->asize\n    |   ldr CARG2, TAB:RB->array\n    |    add PC, PC, #4\n    |1:  // Traverse array part.\n    |  subs RC, CARG1, INS\n    |   add CARG3, CARG2, CARG1, lsl #3\n    |  bhs >5\t\t\t\t// Index points after array part?\n    |   ldrd CARG34, [CARG3]\n    |   checktp CARG4, LJ_TNIL\n    |   addeq CARG1, CARG1, #1\t\t// Skip holes in array part.\n    |   beq <1\n    |  ldrh RC, [PC, #-2]\n    |   mvn CARG2, #~LJ_TISNUM\n    |    strd CARG34, [RA, #8]\n    |  add RC, PC, RC, lsl #2\n    |    add RB, CARG1, #1\n    |   strd CARG12, [RA]\n    |  sub PC, RC, #0x20000\n    |    str RB, [RA, #-8]\t\t// Update control var.\n    |3:\n    |  ins_next\n    |\n    |5:  // Traverse hash part.\n    |  ldr CARG4, TAB:RB->hmask\n    |   ldr NODE:RB, TAB:RB->node\n    |6:\n    |   add CARG1, RC, RC, lsl #1\n    |  cmp RC, CARG4\t\t\t// End of iteration? Branch to ITERL+1.\n    |   add NODE:CARG3, NODE:RB, CARG1, lsl #3  // node = tab->node + idx*3*8\n    |  bhi <3\n    |   ldrd CARG12, NODE:CARG3->val\n    |   checktp CARG2, LJ_TNIL\n    |   add RC, RC, #1\n    |   beq <6\t\t\t\t// Skip holes in hash part.\n    |  ldrh RB, [PC, #-2]\n    |   add RC, RC, INS\n    |    ldrd CARG34, NODE:CARG3->key\n    |   str RC, [RA, #-8]\t\t// Update control var.\n    |   strd CARG12, [RA, #8]\n    |  add RC, PC, RB, lsl #2\n    |  sub PC, RC, #0x20000\n    |    strd CARG34, [RA]\n    |  b <3\n    break;\n\n  case BC_ISNEXT:\n    |  // RA = base*8, RC = target (points to ITERN)\n    |  add RA, BASE, RA\n    |     add RC, PC, RC, lsl #2\n    |  ldrd CFUNC:CARG12, [RA, #-24]\n    |   ldr CARG3, [RA, #-12]\n    |    ldr CARG4, [RA, #-4]\n    |  checktp CARG2, LJ_TFUNC\n    |  ldrbeq CARG1, CFUNC:CARG1->ffid\n    |   checktpeq CARG3, LJ_TTAB\n    |    checktpeq CARG4, LJ_TNIL\n    |  cmpeq CARG1, #FF_next_N\n    |     subeq PC, RC, #0x20000\n    |  bne >5\n    |   ins_next1\n    |   ins_next2\n    |  mov CARG1, #0\n    |  mvn CARG2, #0x00018000\n    |  strd CARG1, [RA, #-8]\t\t// Initialize control var.\n    |1:\n    |   ins_next3\n    |5:  // Despecialize bytecode if any of the checks fail.\n    |  mov CARG1, #BC_JMP\n    |   mov OP, #BC_ITERC\n    |  strb CARG1, [PC, #-4]\n    |   sub PC, RC, #0x20000\n    |   strb OP, [PC]\t\t\t// Subsumes ins_next1.\n    |   ins_next2\n    |  b <1\n    break;\n\n  case BC_VARG:\n    |  decode_RB8 RB, INS\n    |   decode_RC8 RC, INS\n    |  // RA = base*8, RB = (nresults+1)*8, RC = numparams*8\n    |  ldr CARG1, [BASE, FRAME_PC]\n    |  add RC, BASE, RC\n    |   add RA, BASE, RA\n    |  add RC, RC, #FRAME_VARG\n    |   add CARG4, RA, RB\n    |  sub CARG3, BASE, #8\t\t// CARG3 = vtop\n    |  sub RC, RC, CARG1\t\t// RC = vbase\n    |  // Note: RC may now be even _above_ BASE if nargs was < numparams.\n    |  cmp RB, #0\n    |   sub CARG1, CARG3, RC\n    |  beq >5\t\t\t\t// Copy all varargs?\n    |   sub CARG4, CARG4, #16\n    |1:  // Copy vararg slots to destination slots.\n    |  cmp RC, CARG3\n    |  ldrdlo CARG12, [RC], #8\n    |  mvnhs CARG2, #~LJ_TNIL\n    |   cmp RA, CARG4\n    |  strd CARG12, [RA], #8\n    |   blo <1\n    |2:\n    |  ins_next\n    |\n    |5:  // Copy all varargs.\n    |  ldr CARG4, L->maxstack\n    |   cmp CARG1, #0\n    |   movle RB, #8\t\t\t// MULTRES = (0+1)*8\n    |   addgt RB, CARG1, #8\n    |  add CARG2, RA, CARG1\n    |   str RB, SAVE_MULTRES\n    |   ble <2\n    |  cmp CARG2, CARG4\n    |  bhi >7\n    |6:\n    |   ldrd CARG12, [RC], #8\n    |   strd CARG12, [RA], #8\n    |  cmp RC, CARG3\n    |  blo <6\n    |  b <2\n    |\n    |7:  // Grow stack for varargs.\n    |  lsr CARG2, CARG1, #3\n    |   str RA, L->top\n    |  mov CARG1, L\n    |   str BASE, L->base\n    |  sub RC, RC, BASE\t\t\t// Need delta, because BASE may change.\n    |   str PC, SAVE_PC\n    |  sub RA, RA, BASE\n    |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n    |  ldr BASE, L->base\n    |  add RA, BASE, RA\n    |  add RC, BASE, RC\n    |  sub CARG3, BASE, #8\n    |  b <6\n    break;\n\n  /* -- Returns ----------------------------------------------------------- */\n\n  case BC_RETM:\n    |  // RA = results*8, RC = extra results\n    |  ldr CARG1, SAVE_MULTRES\n    |   ldr PC, [BASE, FRAME_PC]\n    |    add RA, BASE, RA\n    |  add RC, CARG1, RC, lsl #3\n    |  b ->BC_RETM_Z\n    break;\n\n  case BC_RET:\n    |  // RA = results*8, RC = nresults+1\n    |  ldr PC, [BASE, FRAME_PC]\n    |   lsl RC, RC, #3\n    |    add RA, BASE, RA\n    |->BC_RETM_Z:\n    |   str RC, SAVE_MULTRES\n    |1:\n    |  ands CARG1, PC, #FRAME_TYPE\n    |   eor CARG2, PC, #FRAME_VARG\n    |  bne ->BC_RETV2_Z\n    |\n    |->BC_RET_Z:\n    |  // BASE = base, RA = resultptr, RC = (nresults+1)*8, PC = return\n    |  ldr INS, [PC, #-4]\n    |  subs CARG4, RC, #8\n    |   sub CARG3, BASE, #8\n    |  beq >3\n    |2:\n    |  ldrd CARG12, [RA], #8\n    |   add BASE, BASE, #8\n    |   subs CARG4, CARG4, #8\n    |  strd CARG12, [BASE, #-16]\n    |   bne <2\n    |3:\n    |  decode_RA8 RA, INS\n    |  sub CARG4, CARG3, RA\n    |   decode_RB8 RB, INS\n    |  ldr LFUNC:CARG1, [CARG4, FRAME_FUNC]\n    |5:\n    |  cmp RB, RC\t\t\t// More results expected?\n    |  bhi >6\n    |  mov BASE, CARG4\n    |  ldr CARG2, LFUNC:CARG1->field_pc\n    |   ins_next1\n    |   ins_next2\n    |  ldr KBASE, [CARG2, #PC2PROTO(k)]\n    |   ins_next3\n    |\n    |6:  // Fill up results with nil.\n    |  mvn CARG2, #~LJ_TNIL\n    |  add BASE, BASE, #8\n    |   add RC, RC, #8\n    |  str CARG2, [BASE, #-12]\n    |  b <5\n    |\n    |->BC_RETV1_Z:  // Non-standard return case.\n    |  add RA, BASE, RA\n    |->BC_RETV2_Z:\n    |  tst CARG2, #FRAME_TYPEP\n    |  bne ->vm_return\n    |  // Return from vararg function: relocate BASE down.\n    |  sub BASE, BASE, CARG2\n    |  ldr PC, [BASE, FRAME_PC]\n    |  b <1\n    break;\n\n  case BC_RET0: case BC_RET1:\n    |  // RA = results*8, RC = nresults+1\n    |  ldr PC, [BASE, FRAME_PC]\n    |   lsl RC, RC, #3\n    |   str RC, SAVE_MULTRES\n    |  ands CARG1, PC, #FRAME_TYPE\n    |   eor CARG2, PC, #FRAME_VARG\n    |   ldreq INS, [PC, #-4]\n    |  bne ->BC_RETV1_Z\n    if (op == BC_RET1) {\n      |  ldrd CARG12, [BASE, RA]\n    }\n    |  sub CARG4, BASE, #8\n    |   decode_RA8 RA, INS\n    if (op == BC_RET1) {\n      |  strd CARG12, [CARG4]\n    }\n    |  sub BASE, CARG4, RA\n    |   decode_RB8 RB, INS\n    |  ldr LFUNC:CARG1, [BASE, FRAME_FUNC]\n    |5:\n    |  cmp RB, RC\n    |  bhi >6\n    |  ldr CARG2, LFUNC:CARG1->field_pc\n    |   ins_next1\n    |   ins_next2\n    |  ldr KBASE, [CARG2, #PC2PROTO(k)]\n    |   ins_next3\n    |\n    |6:  // Fill up results with nil.\n    |  sub CARG2, CARG4, #4\n    |  mvn CARG3, #~LJ_TNIL\n    |  str CARG3, [CARG2, RC]\n    |  add RC, RC, #8\n    |  b <5\n    break;\n\n  /* -- Loops and branches ------------------------------------------------ */\n\n  |.define FOR_IDX,  [RA];      .define FOR_TIDX,  [RA, #4]\n  |.define FOR_STOP, [RA, #8];  .define FOR_TSTOP, [RA, #12]\n  |.define FOR_STEP, [RA, #16]; .define FOR_TSTEP, [RA, #20]\n  |.define FOR_EXT,  [RA, #24]; .define FOR_TEXT,  [RA, #28]\n\n  case BC_FORL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IFORL follows.\n    break;\n\n  case BC_JFORI:\n  case BC_JFORL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_FORI:\n  case BC_IFORL:\n    |  // RA = base*8, RC = target (after end of loop or start of loop)\n    vk = (op == BC_IFORL || op == BC_JFORL);\n    |  ldrd CARG12, [RA, BASE]!\n    if (op != BC_JFORL) {\n      |   add RC, PC, RC, lsl #2\n    }\n    if (!vk) {\n      |  ldrd CARG34, FOR_STOP\n      |   checktp CARG2, LJ_TISNUM\n      |  ldr RB, FOR_TSTEP\n      |   bne >5\n      |  checktp CARG4, LJ_TISNUM\n      |   ldr CARG4, FOR_STEP\n      |  checktpeq RB, LJ_TISNUM\n      |  bne ->vmeta_for\n      |  cmp CARG4, #0\n      |  blt >4\n      |  cmp CARG1, CARG3\n    } else {\n      |  ldrd CARG34, FOR_STEP\n      |   checktp CARG2, LJ_TISNUM\n      |   bne >5\n      |  adds CARG1, CARG1, CARG3\n      |   ldr CARG4, FOR_STOP\n      if (op == BC_IFORL) {\n\t|  addvs RC, PC, #0x20000\t\t// Overflow: prevent branch.\n      } else {\n\t|  bvs >2\t\t\t\t// Overflow: do not enter mcode.\n      }\n      |  cmp CARG3, #0\n      |  blt >4\n      |  cmp CARG1, CARG4\n    }\n    |1:\n    if (op == BC_FORI) {\n      |  subgt PC, RC, #0x20000\n    } else if (op == BC_JFORI) {\n      |  sub PC, RC, #0x20000\n      |  ldrhle RC, [PC, #-2]\n    } else if (op == BC_IFORL) {\n      |  suble PC, RC, #0x20000\n    }\n    if (vk) {\n      |  strd CARG12, FOR_IDX\n    }\n    |2:\n    |   ins_next1\n    |   ins_next2\n    |  strd CARG12, FOR_EXT\n    if (op == BC_JFORI || op == BC_JFORL) {\n      |  ble =>BC_JLOOP\n    }\n    |3:\n    |   ins_next3\n    |\n    |4:  // Invert check for negative step.\n    if (!vk) {\n      |  cmp CARG3, CARG1\n    } else {\n      |  cmp CARG4, CARG1\n    }\n    |  b <1\n    |\n    |5:  // FP loop.\n    if (!vk) {\n      |  cmnlo CARG4, #-LJ_TISNUM\n      |  cmnlo RB, #-LJ_TISNUM\n      |  bhs ->vmeta_for\n      |.if FPU\n      |  vldr d0, FOR_IDX\n      |  vldr d1, FOR_STOP\n      |  cmp RB, #0\n      |  vstr d0, FOR_EXT\n      |.else\n      |  cmp RB, #0\n      |   strd CARG12, FOR_EXT\n      |  blt >8\n      |.endif\n    } else {\n      |.if FPU\n      |  vldr d0, FOR_IDX\n      |  vldr d2, FOR_STEP\n      |  vldr d1, FOR_STOP\n      |  cmp CARG4, #0\n      |  vadd.f64 d0, d0, d2\n      |.else\n      |  cmp CARG4, #0\n      |  blt >8\n      |  bl extern __aeabi_dadd\n      |   strd CARG12, FOR_IDX\n      |  ldrd CARG34, FOR_STOP\n      |   strd CARG12, FOR_EXT\n      |.endif\n    }\n    |6:\n    |.if FPU\n    |  vcmpge.f64 d0, d1\n    |  vcmplt.f64 d1, d0\n    |  vmrs\n    |.else\n    |  bl extern __aeabi_cdcmple\n    |.endif\n    if (vk) {\n      |.if FPU\n      |  vstr d0, FOR_IDX\n      |  vstr d0, FOR_EXT\n      |.endif\n    }\n    if (op == BC_FORI) {\n      |  subhi PC, RC, #0x20000\n    } else if (op == BC_JFORI) {\n      |  sub PC, RC, #0x20000\n      |  ldrhls RC, [PC, #-2]\n      |  bls =>BC_JLOOP\n    } else if (op == BC_IFORL) {\n      |  subls PC, RC, #0x20000\n    } else {\n      |  bls =>BC_JLOOP\n    }\n    |  ins_next1\n    |  ins_next2\n    |  b <3\n    |\n    |.if not FPU\n    |8:  // Invert check for negative step.\n    if (vk) {\n      |  bl extern __aeabi_dadd\n      |  strd CARG12, FOR_IDX\n      |  strd CARG12, FOR_EXT\n    }\n    |  mov CARG3, CARG1\n    |  mov CARG4, CARG2\n    |  ldrd CARG12, FOR_STOP\n    |  b <6\n    |.endif\n    break;\n\n  case BC_ITERL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IITERL follows.\n    break;\n\n  case BC_JITERL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IITERL:\n    |  // RA = base*8, RC = target\n    |  ldrd CARG12, [RA, BASE]!\n    if (op == BC_JITERL) {\n      |  cmn CARG2, #-LJ_TNIL\t\t// Stop if iterator returned nil.\n      |  strdne CARG12, [RA, #-8]\n      |  bne =>BC_JLOOP\n    } else {\n      |   add RC, PC, RC, lsl #2\n      |  // STALL: load CARG12.\n      |  cmn CARG2, #-LJ_TNIL\t\t// Stop if iterator returned nil.\n      |  subne PC, RC, #0x20000\t\t// Otherwise save control var + branch.\n      |  strdne CARG12, [RA, #-8]\n    }\n    |  ins_next\n    break;\n\n  case BC_LOOP:\n    |  // RA = base*8, RC = target (loop extent)\n    |  // Note: RA/RC is only used by trace recorder to determine scope/extent\n    |  // This opcode does NOT jump, it's only purpose is to detect a hot loop.\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_ILOOP follows.\n    break;\n\n  case BC_ILOOP:\n    |  // RA = base*8, RC = target (loop extent)\n    |  ins_next\n    break;\n\n  case BC_JLOOP:\n    |.if JIT\n    |  // RA = base (ignored), RC = traceno\n    |  ldr CARG1, [DISPATCH, #DISPATCH_J(trace)]\n    |   mov CARG2, #0  // Traces on ARM don't store the trace number, so use 0.\n    |  ldr TRACE:RC, [CARG1, RC, lsl #2]\n    |   st_vmstate CARG2\n    |  ldr RA, TRACE:RC->mcode\n    |   str BASE, [DISPATCH, #DISPATCH_GL(jit_base)]\n    |   str L, [DISPATCH, #DISPATCH_GL(jit_L)]\n    |  bx RA\n    |.endif\n    break;\n\n  case BC_JMP:\n    |  // RA = base*8 (only used by trace recorder), RC = target\n    |  add RC, PC, RC, lsl #2\n    |  sub PC, RC, #0x20000\n    |  ins_next\n    break;\n\n  /* -- Function headers -------------------------------------------------- */\n\n  case BC_FUNCF:\n    |.if JIT\n    |  hotcall\n    |.endif\n  case BC_FUNCV:  /* NYI: compiled vararg functions. */\n    |  // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow.\n    break;\n\n  case BC_JFUNCF:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IFUNCF:\n    |  // BASE = new base, RA = BASE+framesize*8, CARG3 = LFUNC, RC = nargs*8\n    |  ldr CARG1, L->maxstack\n    |   ldrb CARG2, [PC, #-4+PC2PROTO(numparams)]\n    |    ldr KBASE, [PC, #-4+PC2PROTO(k)]\n    |  cmp RA, CARG1\n    |  bhi ->vm_growstack_l\n    if (op != BC_JFUNCF) {\n      |  ins_next1\n      |  ins_next2\n    }\n    |2:\n    |  cmp NARGS8:RC, CARG2, lsl #3\t// Check for missing parameters.\n    |   mvn CARG4, #~LJ_TNIL\n    |  blo >3\n    if (op == BC_JFUNCF) {\n      |  decode_RD RC, INS\n      |  b =>BC_JLOOP\n    } else {\n      |  ins_next3\n    }\n    |\n    |3:  // Clear missing parameters.\n    |  strd CARG34, [BASE, NARGS8:RC]\n    |  add NARGS8:RC, NARGS8:RC, #8\n    |  b <2\n    break;\n\n  case BC_JFUNCV:\n#if !LJ_HASJIT\n    break;\n#endif\n    |  NYI  // NYI: compiled vararg functions\n    break;  /* NYI: compiled vararg functions. */\n\n  case BC_IFUNCV:\n    |  // BASE = new base, RA = BASE+framesize*8, CARG3 = LFUNC, RC = nargs*8\n    |  ldr CARG1, L->maxstack\n    |   add CARG4, BASE, RC\n    |  add RA, RA, RC\n    |   str LFUNC:CARG3, [CARG4]\t// Store copy of LFUNC.\n    |   add CARG2, RC, #8+FRAME_VARG\n    |    ldr KBASE, [PC, #-4+PC2PROTO(k)]\n    |  cmp RA, CARG1\n    |   str CARG2, [CARG4, #4]\t\t// Store delta + FRAME_VARG.\n    |  bhs ->vm_growstack_l\n    |  ldrb RB, [PC, #-4+PC2PROTO(numparams)]\n    |   mov RA, BASE\n    |   mov RC, CARG4\n    |  cmp RB, #0\n    |   add BASE, CARG4, #8\n    |  beq >3\n    |  mvn CARG3, #~LJ_TNIL\n    |1:\n    |  cmp RA, RC\t\t\t// Less args than parameters?\n    |   ldrdlo CARG12, [RA], #8\n    |   movhs CARG2, CARG3\n    |    strlo CARG3, [RA, #-4]\t\t// Clear old fixarg slot (help the GC).\n    |2:\n    |  subs RB, RB, #1\n    |   strd CARG12, [CARG4, #8]!\n    |  bne <1\n    |3:\n    |  ins_next\n    break;\n\n  case BC_FUNCC:\n  case BC_FUNCCW:\n    |  // BASE = new base, RA = BASE+framesize*8, CARG3 = CFUNC, RC = nargs*8\n    if (op == BC_FUNCC) {\n      |  ldr CARG4, CFUNC:CARG3->f\n    } else {\n      |  ldr CARG4, [DISPATCH, #DISPATCH_GL(wrapf)]\n    }\n    |   add CARG2, RA, NARGS8:RC\n    |   ldr CARG1, L->maxstack\n    |  add RC, BASE, NARGS8:RC\n    |    str BASE, L->base\n    |   cmp CARG2, CARG1\n    |  str RC, L->top\n    if (op == BC_FUNCCW) {\n      |  ldr CARG2, CFUNC:CARG3->f\n    }\n    |    mv_vmstate CARG3, C\n    |  mov CARG1, L\n    |   bhi ->vm_growstack_c\t\t// Need to grow stack.\n    |    st_vmstate CARG3\n    |  blx CARG4\t\t\t// (lua_State *L [, lua_CFunction f])\n    |  // Returns nresults.\n    |  ldr BASE, L->base\n    |    mv_vmstate CARG3, INTERP\n    |   ldr CRET2, L->top\n    |   lsl RC, CRET1, #3\n    |    st_vmstate CARG3\n    |  ldr PC, [BASE, FRAME_PC]\n    |   sub RA, CRET2, RC\t\t// RA = L->top - nresults*8\n    |  b ->vm_returnc\n    break;\n\n  /* ---------------------------------------------------------------------- */\n\n  default:\n    fprintf(stderr, \"Error: undefined opcode BC_%s\\n\", bc_names[op]);\n    exit(2);\n    break;\n  }\n}\n\nstatic int build_backend(BuildCtx *ctx)\n{\n  int op;\n\n  dasm_growpc(Dst, BC__MAX);\n\n  build_subroutines(ctx);\n\n  |.code_op\n  for (op = 0; op < BC__MAX; op++)\n    build_ins(ctx, (BCOp)op, op);\n\n  return BC__MAX;\n}\n\n/* Emit pseudo frame-info for all assembler functions. */\nstatic void emit_asm_debug(BuildCtx *ctx)\n{\n  int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code);\n  int i;\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n    fprintf(ctx->fp, \"\\t.section .debug_frame,\\\"\\\",%%progbits\\n\");\n    fprintf(ctx->fp,\n\t\".Lframe0:\\n\"\n\t\"\\t.long .LECIE0-.LSCIE0\\n\"\n\t\".LSCIE0:\\n\"\n\t\"\\t.long 0xffffffff\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 0xe\\n\"\t\t\t\t/* Return address is in lr. */\n\t\"\\t.byte 0xc\\n\\t.uleb128 0xd\\n\\t.uleb128 0\\n\"\t/* def_cfa sp */\n\t\"\\t.align 2\\n\"\n\t\".LECIE0:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE0:\\n\"\n\t\"\\t.long .LEFDE0-.LASFDE0\\n\"\n\t\".LASFDE0:\\n\"\n\t\"\\t.long .Lframe0\\n\"\n\t\"\\t.long .Lbegin\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x8e\\n\\t.uleb128 1\\n\",\t\t/* offset lr */\n\tfcofs, CFRAME_SIZE);\n    for (i = 11; i >= (LJ_ARCH_HASFPU ? 5 : 4); i--)  /* offset r4-r11 */\n      fprintf(ctx->fp, \"\\t.byte %d\\n\\t.uleb128 %d\\n\", 0x80+i, 2+(11-i));\n#if LJ_ARCH_HASFPU\n    for (i = 15; i >= 8; i--)  /* offset d8-d15 */\n      fprintf(ctx->fp, \"\\t.byte 5\\n\\t.uleb128 %d, %d\\n\",\n\t64+2*i, 10+2*(15-i));\n    fprintf(ctx->fp, \"\\t.byte 0x84\\n\\t.uleb128 %d\\n\", 25);  /* offset r4 */\n#endif\n    fprintf(ctx->fp,\n\t\"\\t.align 2\\n\"\n\t\".LEFDE0:\\n\\n\");\n#if LJ_HASFFI\n    fprintf(ctx->fp,\n\t\".LSFDE1:\\n\"\n\t\"\\t.long .LEFDE1-.LASFDE1\\n\"\n\t\".LASFDE1:\\n\"\n\t\"\\t.long .Lframe0\\n\"\n\t\"\\t.long lj_vm_ffi_call\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 16\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x8e\\n\\t.uleb128 1\\n\"\t\t/* offset lr */\n\t\"\\t.byte 0x8b\\n\\t.uleb128 2\\n\"\t\t/* offset r11 */\n\t\"\\t.byte 0x85\\n\\t.uleb128 3\\n\"\t\t/* offset r5 */\n\t\"\\t.byte 0x84\\n\\t.uleb128 4\\n\"\t\t/* offset r4 */\n\t\"\\t.byte 0xd\\n\\t.uleb128 0xb\\n\"\t\t/* def_cfa_register r11 */\n\t\"\\t.align 2\\n\"\n\t\".LEFDE1:\\n\\n\", (int)ctx->codesz - fcofs);\n#endif\n    break;\n  default:\n    break;\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/vm_mips.dasc",
    "content": "|// Low-level VM code for MIPS CPUs.\n|// Bytecode interpreter, fast functions and helper functions.\n|// Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n|\n|.arch mips\n|.section code_op, code_sub\n|\n|.actionlist build_actionlist\n|.globals GLOB_\n|.globalnames globnames\n|.externnames extnames\n|\n|// Note: The ragged indentation of the instructions is intentional.\n|//       The starting columns indicate data dependencies.\n|\n|//-----------------------------------------------------------------------\n|\n|// Fixed register assignments for the interpreter.\n|// Don't use: r0 = 0, r26/r27 = reserved, r28 = gp, r29 = sp, r31 = ra\n|\n|// The following must be C callee-save (but BASE is often refetched).\n|.define BASE,\t\tr16\t// Base of current Lua stack frame.\n|.define KBASE,\t\tr17\t// Constants of current Lua function.\n|.define PC,\t\tr18\t// Next PC.\n|.define DISPATCH,\tr19\t// Opcode dispatch table.\n|.define LREG,\t\tr20\t// Register holding lua_State (also in SAVE_L).\n|.define MULTRES,\tr21\t// Size of multi-result: (nresults+1)*8.\n|// NYI: r22 currently unused.\n|\n|.define JGL,\t\tr30\t// On-trace: global_State + 32768.\n|\n|// Constants for type-comparisons, stores and conversions. C callee-save.\n|.define TISNIL,\tr30\n|.define TOBIT,\t\tf30\t// 2^52 + 2^51.\n|\n|// The following temporaries are not saved across C calls, except for RA.\n|.define RA,\t\tr23\t// Callee-save.\n|.define RB,\t\tr8\n|.define RC,\t\tr9\n|.define RD,\t\tr10\n|.define INS,\t\tr11\n|\n|.define AT,\t\tr1\t// Assembler temporary.\n|.define TMP0,\t\tr12\n|.define TMP1,\t\tr13\n|.define TMP2,\t\tr14\n|.define TMP3,\t\tr15\n|\n|// Calling conventions.\n|.define CFUNCADDR,\tr25\n|.define CARG1,\t\tr4\n|.define CARG2,\t\tr5\n|.define CARG3,\t\tr6\n|.define CARG4,\t\tr7\n|\n|.define CRET1,\t\tr2\n|.define CRET2,\t\tr3\n|\n|.define FARG1,\t\tf12\n|.define FARG2,\t\tf14\n|\n|.define FRET1,\t\tf0\n|.define FRET2,\t\tf2\n|\n|// Stack layout while in interpreter. Must match with lj_frame.h.\n|.define CFRAME_SPACE,\t112\t// Delta for sp.\n|\n|.define SAVE_ERRF,\t124(sp)\t// 32 bit C frame info.\n|.define SAVE_NRES,\t120(sp)\n|.define SAVE_CFRAME,\t116(sp)\n|.define SAVE_L,\t112(sp)\n|//----- 8 byte aligned, ^^^^ 16 byte register save area, owned by interpreter.\n|.define SAVE_GPR_,\t72\t// .. 72+10*4: 32 bit GPR saves.\n|.define SAVE_FPR_,\t24\t// .. 24+6*8: 64 bit FPR saves.\n|.define SAVE_PC,\t20(sp)\n|.define ARG5,\t\t16(sp)\n|.define CSAVE_4,\t12(sp)\n|.define CSAVE_3,\t8(sp)\n|.define CSAVE_2,\t4(sp)\n|.define CSAVE_1,\t0(sp)\n|//----- 8 byte aligned, ^^^^ 16 byte register save area, owned by callee.\n|\n|.define ARG5_OFS,\t16\n|.define SAVE_MULTRES,\tARG5\n|\n|.macro saveregs\n|  addiu sp, sp, -CFRAME_SPACE\n|  sw ra, SAVE_GPR_+9*4(sp)\n|  sw r30, SAVE_GPR_+8*4(sp)\n|   sdc1 f30, SAVE_FPR_+5*8(sp)\n|  sw r23, SAVE_GPR_+7*4(sp)\n|  sw r22, SAVE_GPR_+6*4(sp)\n|   sdc1 f28, SAVE_FPR_+4*8(sp)\n|  sw r21, SAVE_GPR_+5*4(sp)\n|  sw r20, SAVE_GPR_+4*4(sp)\n|   sdc1 f26, SAVE_FPR_+3*8(sp)\n|  sw r19, SAVE_GPR_+3*4(sp)\n|  sw r18, SAVE_GPR_+2*4(sp)\n|   sdc1 f24, SAVE_FPR_+2*8(sp)\n|  sw r17, SAVE_GPR_+1*4(sp)\n|  sw r16, SAVE_GPR_+0*4(sp)\n|   sdc1 f22, SAVE_FPR_+1*8(sp)\n|   sdc1 f20, SAVE_FPR_+0*8(sp)\n|.endmacro\n|\n|.macro restoreregs_ret\n|  lw ra, SAVE_GPR_+9*4(sp)\n|  lw r30, SAVE_GPR_+8*4(sp)\n|   ldc1 f30, SAVE_FPR_+5*8(sp)\n|  lw r23, SAVE_GPR_+7*4(sp)\n|  lw r22, SAVE_GPR_+6*4(sp)\n|   ldc1 f28, SAVE_FPR_+4*8(sp)\n|  lw r21, SAVE_GPR_+5*4(sp)\n|  lw r20, SAVE_GPR_+4*4(sp)\n|   ldc1 f26, SAVE_FPR_+3*8(sp)\n|  lw r19, SAVE_GPR_+3*4(sp)\n|  lw r18, SAVE_GPR_+2*4(sp)\n|   ldc1 f24, SAVE_FPR_+2*8(sp)\n|  lw r17, SAVE_GPR_+1*4(sp)\n|  lw r16, SAVE_GPR_+0*4(sp)\n|   ldc1 f22, SAVE_FPR_+1*8(sp)\n|   ldc1 f20, SAVE_FPR_+0*8(sp)\n|  jr ra\n|  addiu sp, sp, CFRAME_SPACE\n|.endmacro\n|\n|// Type definitions. Some of these are only used for documentation.\n|.type L,\t\tlua_State,\tLREG\n|.type GL,\t\tglobal_State\n|.type TVALUE,\t\tTValue\n|.type GCOBJ,\t\tGCobj\n|.type STR,\t\tGCstr\n|.type TAB,\t\tGCtab\n|.type LFUNC,\t\tGCfuncL\n|.type CFUNC,\t\tGCfuncC\n|.type PROTO,\t\tGCproto\n|.type UPVAL,\t\tGCupval\n|.type NODE,\t\tNode\n|.type NARGS8,\t\tint\n|.type TRACE,\t\tGCtrace\n|\n|//-----------------------------------------------------------------------\n|\n|// Trap for not-yet-implemented parts.\n|.macro NYI; .long 0xf0f0f0f0; .endmacro\n|\n|// Macros to mark delay slots.\n|.macro ., a; a; .endmacro\n|.macro ., a,b; a,b; .endmacro\n|.macro ., a,b,c; a,b,c; .endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Endian-specific defines.\n|.define FRAME_PC,\tLJ_ENDIAN_SELECT(-4,-8)\n|.define FRAME_FUNC,\tLJ_ENDIAN_SELECT(-8,-4)\n|.define HI,\t\tLJ_ENDIAN_SELECT(4,0)\n|.define LO,\t\tLJ_ENDIAN_SELECT(0,4)\n|.define OFS_RD,\tLJ_ENDIAN_SELECT(2,0)\n|.define OFS_RA,\tLJ_ENDIAN_SELECT(1,2)\n|.define OFS_OP,\tLJ_ENDIAN_SELECT(0,3)\n|\n|// Instruction decode.\n|.macro decode_OP1, dst, ins; andi dst, ins, 0xff; .endmacro\n|.macro decode_OP4a, dst, ins; andi dst, ins, 0xff; .endmacro\n|.macro decode_OP4b, dst; sll dst, dst, 2; .endmacro\n|.macro decode_RC4a, dst, ins; srl dst, ins, 14; .endmacro\n|.macro decode_RC4b, dst; andi dst, dst, 0x3fc; .endmacro\n|.macro decode_RD4b, dst; sll dst, dst, 2; .endmacro\n|.macro decode_RA8a, dst, ins; srl dst, ins, 5; .endmacro\n|.macro decode_RA8b, dst; andi dst, dst, 0x7f8; .endmacro\n|.macro decode_RB8a, dst, ins; srl dst, ins, 21; .endmacro\n|.macro decode_RB8b, dst; andi dst, dst, 0x7f8; .endmacro\n|.macro decode_RD8a, dst, ins; srl dst, ins, 16; .endmacro\n|.macro decode_RD8b, dst; sll dst, dst, 3; .endmacro\n|.macro decode_RDtoRC8, dst, src; andi dst, src, 0x7f8; .endmacro\n|\n|// Instruction fetch.\n|.macro ins_NEXT1\n|  lw INS, 0(PC)\n|   addiu PC, PC, 4\n|.endmacro\n|// Instruction decode+dispatch.\n|.macro ins_NEXT2\n|  decode_OP4a TMP1, INS\n|  decode_OP4b TMP1\n|  addu TMP0, DISPATCH, TMP1\n|   decode_RD8a RD, INS\n|  lw AT, 0(TMP0)\n|   decode_RA8a RA, INS\n|   decode_RD8b RD\n|  jr AT\n|   decode_RA8b RA\n|.endmacro\n|.macro ins_NEXT\n|  ins_NEXT1\n|  ins_NEXT2\n|.endmacro\n|\n|// Instruction footer.\n|.if 1\n|  // Replicated dispatch. Less unpredictable branches, but higher I-Cache use.\n|  .define ins_next, ins_NEXT\n|  .define ins_next_, ins_NEXT\n|  .define ins_next1, ins_NEXT1\n|  .define ins_next2, ins_NEXT2\n|.else\n|  // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch.\n|  // Affects only certain kinds of benchmarks (and only with -j off).\n|  .macro ins_next\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next1\n|  .endmacro\n|  .macro ins_next2\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next_\n|  ->ins_next:\n|    ins_NEXT\n|  .endmacro\n|.endif\n|\n|// Call decode and dispatch.\n|.macro ins_callt\n|  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n|  lw PC, LFUNC:RB->pc\n|  lw INS, 0(PC)\n|   addiu PC, PC, 4\n|  decode_OP4a TMP1, INS\n|   decode_RA8a RA, INS\n|  decode_OP4b TMP1\n|   decode_RA8b RA\n|  addu TMP0, DISPATCH, TMP1\n|  lw TMP0, 0(TMP0)\n|  jr TMP0\n|   addu RA, RA, BASE\n|.endmacro\n|\n|.macro ins_call\n|  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC\n|  sw PC, FRAME_PC(BASE)\n|  ins_callt\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|.macro branch_RD\n|  srl TMP0, RD, 1\n|  lui AT, (-(BCBIAS_J*4 >> 16) & 65535)\n|  addu TMP0, TMP0, AT\n|  addu PC, PC, TMP0\n|.endmacro\n|\n|// Assumes DISPATCH is relative to GL.\n#define DISPATCH_GL(field)\t(GG_DISP2G + (int)offsetof(global_State, field))\n#define DISPATCH_J(field)\t(GG_DISP2J + (int)offsetof(jit_State, field))\n#define GG_DISP2GOT\t\t(GG_OFS(got) - GG_OFS(dispatch))\n#define DISPATCH_GOT(name)\t(GG_DISP2GOT + 4*LJ_GOT_##name)\n|\n#define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))\n|\n|.macro load_got, func\n|  lw CFUNCADDR, DISPATCH_GOT(func)(DISPATCH)\n|.endmacro\n|// Much faster. Sadly, there's no easy way to force the required code layout.\n|// .macro call_intern, func; bal extern func; .endmacro\n|.macro call_intern, func; jalr CFUNCADDR; .endmacro\n|.macro call_extern; jalr CFUNCADDR; .endmacro\n|.macro jmp_extern; jr CFUNCADDR; .endmacro\n|\n|.macro hotcheck, delta, target\n|  srl TMP1, PC, 1\n|  andi TMP1, TMP1, 126\n|  addu TMP1, TMP1, DISPATCH\n|  lhu TMP2, GG_DISP2HOT(TMP1)\n|  addiu TMP2, TMP2, -delta\n|  bltz TMP2, target\n|.  sh TMP2, GG_DISP2HOT(TMP1)\n|.endmacro\n|\n|.macro hotloop\n|  hotcheck HOTCOUNT_LOOP, ->vm_hotloop\n|.endmacro\n|\n|.macro hotcall\n|  hotcheck HOTCOUNT_CALL, ->vm_hotcall\n|.endmacro\n|\n|// Set current VM state. Uses TMP0.\n|.macro li_vmstate, st; li TMP0, ~LJ_VMST_..st; .endmacro\n|.macro st_vmstate; sw TMP0, DISPATCH_GL(vmstate)(DISPATCH); .endmacro\n|\n|// Move table write barrier back. Overwrites mark and tmp.\n|.macro barrierback, tab, mark, tmp, target\n|  lw tmp, DISPATCH_GL(gc.grayagain)(DISPATCH)\n|   andi mark, mark, ~LJ_GC_BLACK & 255\t\t// black2gray(tab)\n|  sw tab, DISPATCH_GL(gc.grayagain)(DISPATCH)\n|   sb mark, tab->marked\n|  b target\n|.  sw tmp, tab->gclist\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n\n/* Generate subroutines used by opcodes and other parts of the VM. */\n/* The .code_sub section should be last to help static branch prediction. */\nstatic void build_subroutines(BuildCtx *ctx)\n{\n  |.code_sub\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Return handling ----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_returnp:\n  |  // See vm_return. Also: TMP2 = previous base.\n  |  andi AT, PC, FRAME_P\n  |  beqz AT, ->cont_dispatch\n  |.  li TMP1, LJ_TTRUE\n  |\n  |  // Return from pcall or xpcall fast func.\n  |  lw PC, FRAME_PC(TMP2)\t\t// Fetch PC of previous frame.\n  |  move BASE, TMP2\t\t\t// Restore caller base.\n  |  // Prepending may overwrite the pcall frame, so do it at the end.\n  |   sw TMP1, FRAME_PC(RA)\t\t// Prepend true to results.\n  |   addiu RA, RA, -8\n  |\n  |->vm_returnc:\n  |   addiu RD, RD, 8\t\t\t// RD = (nresults+1)*8.\n  |  andi TMP0, PC, FRAME_TYPE\n  |   beqz RD, ->vm_unwind_c_eh\n  |.   li CRET1, LUA_YIELD\n  |  beqz TMP0, ->BC_RET_Z\t\t// Handle regular return to Lua.\n  |.  move MULTRES, RD\n  |\n  |->vm_return:\n  |  // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return\n  |  // TMP0 = PC & FRAME_TYPE\n  |   li TMP2, -8\n  |  xori AT, TMP0, FRAME_C\n  |   and TMP2, PC, TMP2\n  |  bnez AT, ->vm_returnp\n  |   subu TMP2, BASE, TMP2\t\t// TMP2 = previous base.\n  |\n  |  addiu TMP1, RD, -8\n  |   sw TMP2, L->base\n  |    li_vmstate C\n  |   lw TMP2, SAVE_NRES\n  |   addiu BASE, BASE, -8\n  |    st_vmstate\n  |  beqz TMP1, >2\n  |.   sll TMP2, TMP2, 3\n  |1:\n  |  addiu TMP1, TMP1, -8\n  |   ldc1 f0, 0(RA)\n  |    addiu RA, RA, 8\n  |   sdc1 f0, 0(BASE)\n  |  bnez TMP1, <1\n  |.  addiu BASE, BASE, 8\n  |\n  |2:\n  |  bne TMP2, RD, >6\n  |3:\n  |.  sw BASE, L->top\t\t\t// Store new top.\n  |\n  |->vm_leave_cp:\n  |  lw TMP0, SAVE_CFRAME\t\t// Restore previous C frame.\n  |   move CRET1, r0\t\t\t// Ok return status for vm_pcall.\n  |  sw TMP0, L->cframe\n  |\n  |->vm_leave_unw:\n  |  restoreregs_ret\n  |\n  |6:\n  |  lw TMP1, L->maxstack\n  |  slt AT, TMP2, RD\n  |  bnez AT, >7\t\t\t// Less results wanted?\n  |  // More results wanted. Check stack size and fill up results with nil.\n  |.  slt AT, BASE, TMP1\n  |  beqz AT, >8\n  |.  nop\n  |  sw TISNIL, HI(BASE)\n  |  addiu RD, RD, 8\n  |  b <2\n  |.  addiu BASE, BASE, 8\n  |\n  |7:  // Less results wanted.\n  |  subu TMP0, RD, TMP2\n  |  subu TMP0, BASE, TMP0\t\t// Either keep top or shrink it.\n  |  b <3\n  |.  movn BASE, TMP0, TMP2\t\t// LUA_MULTRET+1 case?\n  |\n  |8:  // Corner case: need to grow stack for filling up results.\n  |  // This can happen if:\n  |  // - A C function grows the stack (a lot).\n  |  // - The GC shrinks the stack in between.\n  |  // - A return back from a lua_call() with (high) nresults adjustment.\n  |  load_got lj_state_growstack\n  |   move MULTRES, RD\n  |  move CARG2, TMP2\n  |  call_intern lj_state_growstack\t// (lua_State *L, int n)\n  |.  move CARG1, L\n  |    lw TMP2, SAVE_NRES\n  |  lw BASE, L->top\t\t\t// Need the (realloced) L->top in BASE.\n  |   move RD, MULTRES\n  |  b <2\n  |.   sll TMP2, TMP2, 3\n  |\n  |->vm_unwind_c:\t\t\t// Unwind C stack, return from vm_pcall.\n  |  // (void *cframe, int errcode)\n  |  move sp, CARG1\n  |  move CRET1, CARG2\n  |->vm_unwind_c_eh:\t\t\t// Landing pad for external unwinder.\n  |  lw L, SAVE_L\n  |   li TMP0, ~LJ_VMST_C\n  |  lw GL:TMP1, L->glref\n  |  b ->vm_leave_unw\n  |.  sw TMP0, GL:TMP1->vmstate\n  |\n  |->vm_unwind_ff:\t\t\t// Unwind C stack, return from ff pcall.\n  |  // (void *cframe)\n  |  li AT, -4\n  |  and sp, CARG1, AT\n  |->vm_unwind_ff_eh:\t\t\t// Landing pad for external unwinder.\n  |  lw L, SAVE_L\n  |     lui TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |     li TISNIL, LJ_TNIL\n  |  lw BASE, L->base\n  |   lw DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |     mtc1 TMP3, TOBIT\n  |  li TMP1, LJ_TFALSE\n  |    li_vmstate INTERP\n  |  lw PC, FRAME_PC(BASE)\t\t// Fetch PC of previous frame.\n  |     cvt.d.s TOBIT, TOBIT\n  |  addiu RA, BASE, -8\t\t\t// Results start at BASE-8.\n  |   addiu DISPATCH, DISPATCH, GG_G2DISP\n  |  sw TMP1, HI(RA)\t\t\t// Prepend false to error message.\n  |    st_vmstate\n  |  b ->vm_returnc\n  |.  li RD, 16\t\t\t\t// 2 results: false + error message.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Grow stack for calls -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_growstack_c:\t\t\t// Grow stack for C function.\n  |  b >2\n  |.  li CARG2, LUA_MINSTACK\n  |\n  |->vm_growstack_l:\t\t\t// Grow stack for Lua function.\n  |  // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC\n  |  addu RC, BASE, RC\n  |   subu RA, RA, BASE\n  |  sw BASE, L->base\n  |   addiu PC, PC, 4\t\t\t// Must point after first instruction.\n  |  sw RC, L->top\n  |   srl CARG2, RA, 3\n  |2:\n  |  // L->base = new base, L->top = top\n  |  load_got lj_state_growstack\n  |   sw PC, SAVE_PC\n  |  call_intern lj_state_growstack\t// (lua_State *L, int n)\n  |.  move CARG1, L\n  |  lw BASE, L->base\n  |  lw RC, L->top\n  |  lw LFUNC:RB, FRAME_FUNC(BASE)\n  |  subu RC, RC, BASE\n  |  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n  |  ins_callt\t\t\t\t// Just retry the call.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Entry points into the assembler VM ---------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_resume:\t\t\t\t// Setup C frame and resume thread.\n  |  // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0)\n  |  saveregs\n  |  move L, CARG1\n  |    lw DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |  move BASE, CARG2\n  |    lbu TMP1, L->status\n  |   sw L, SAVE_L\n  |  li PC, FRAME_CP\n  |  addiu TMP0, sp, CFRAME_RESUME\n  |    addiu DISPATCH, DISPATCH, GG_G2DISP\n  |   sw r0, SAVE_NRES\n  |   sw r0, SAVE_ERRF\n  |  sw TMP0, L->cframe\n  |   sw r0, SAVE_CFRAME\n  |    beqz TMP1, >3\n  |.  sw CARG1, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |\n  |  // Resume after yield (like a return).\n  |  move RA, BASE\n  |   lw BASE, L->base\n  |   lw TMP1, L->top\n  |  lw PC, FRAME_PC(BASE)\n  |     lui TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |   subu RD, TMP1, BASE\n  |     mtc1 TMP3, TOBIT\n  |    sb r0, L->status\n  |     cvt.d.s TOBIT, TOBIT\n  |    li_vmstate INTERP\n  |   addiu RD, RD, 8\n  |    st_vmstate\n  |   move MULTRES, RD\n  |  andi TMP0, PC, FRAME_TYPE\n  |  beqz TMP0, ->BC_RET_Z\n  |.    li TISNIL, LJ_TNIL\n  |  b ->vm_return\n  |.  nop\n  |\n  |->vm_pcall:\t\t\t\t// Setup protected C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef)\n  |  saveregs\n  |  sw CARG4, SAVE_ERRF\n  |  b >1\n  |.  li PC, FRAME_CP\n  |\n  |->vm_call:\t\t\t\t// Setup C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1)\n  |  saveregs\n  |  li PC, FRAME_C\n  |\n  |1:  // Entry point for vm_pcall above (PC = ftype).\n  |  lw TMP1, L:CARG1->cframe\n  |   sw CARG3, SAVE_NRES\n  |    move L, CARG1\n  |   sw CARG1, SAVE_L\n  |    move BASE, CARG2\n  |  sw sp, L->cframe\t\t\t// Add our C frame to cframe chain.\n  |    lw DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |   sw CARG1, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |  sw TMP1, SAVE_CFRAME\n  |    addiu DISPATCH, DISPATCH, GG_G2DISP\n  |\n  |3:  // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype).\n  |  lw TMP2, L->base\t\t\t// TMP2 = old base (used in vmeta_call).\n  |     lui TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |   lw TMP1, L->top\n  |     mtc1 TMP3, TOBIT\n  |  addu PC, PC, BASE\n  |   subu NARGS8:RC, TMP1, BASE\n  |  subu PC, PC, TMP2\t\t\t// PC = frame delta + frame type\n  |     cvt.d.s TOBIT, TOBIT\n  |    li_vmstate INTERP\n  |     li TISNIL, LJ_TNIL\n  |    st_vmstate\n  |\n  |->vm_call_dispatch:\n  |  // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC\n  |  lw TMP0, FRAME_PC(BASE)\n  |  li AT, LJ_TFUNC\n  |  bne TMP0, AT, ->vmeta_call\n  |.  lw LFUNC:RB, FRAME_FUNC(BASE)\n  |\n  |->vm_call_dispatch_f:\n  |  ins_call\n  |  // BASE = new base, RB = func, RC = nargs*8, PC = caller PC\n  |\n  |->vm_cpcall:\t\t\t\t// Setup protected C frame, call C.\n  |  // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp)\n  |  saveregs\n  |  move L, CARG1\n  |   lw TMP0, L:CARG1->stack\n  |  sw CARG1, SAVE_L\n  |   lw TMP1, L->top\n  |  sw CARG1, SAVE_PC\t\t\t// Any value outside of bytecode is ok.\n  |   subu TMP0, TMP0, TMP1\t\t// Compute -savestack(L, L->top).\n  |    lw TMP1, L->cframe\n  |    sw sp, L->cframe\t\t\t// Add our C frame to cframe chain.\n  |   sw TMP0, SAVE_NRES\t\t// Neg. delta means cframe w/o frame.\n  |  sw r0, SAVE_ERRF\t\t\t// No error function.\n  |  move CFUNCADDR, CARG4\n  |  jalr CARG4\t\t\t// (lua_State *L, lua_CFunction func, void *ud)\n  |.   sw TMP1, SAVE_CFRAME\n  |  move BASE, CRET1\n  |   lw DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |    li PC, FRAME_CP\n  |  bnez CRET1, <3\t\t\t// Else continue with the call.\n  |.  addiu DISPATCH, DISPATCH, GG_G2DISP\n  |  b ->vm_leave_cp\t\t\t// No base? Just remove C frame.\n  |.  nop\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Metamethod handling ------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// The lj_meta_* functions (except for lj_meta_cat) don't reallocate the\n  |// stack, so BASE doesn't need to be reloaded across these calls.\n  |\n  |//-- Continuation dispatch ----------------------------------------------\n  |\n  |->cont_dispatch:\n  |  // BASE = meta base, RA = resultptr, RD = (nresults+1)*8\n  |  lw TMP0, -16+LO(BASE)\t\t// Continuation.\n  |   move RB, BASE\n  |   move BASE, TMP2\t\t\t// Restore caller BASE.\n  |    lw LFUNC:TMP1, FRAME_FUNC(TMP2)\n  |.if FFI\n  |  sltiu AT, TMP0, 2\n  |.endif\n  |     lw PC, -16+HI(RB)\t\t// Restore PC from [cont|PC].\n  |   addu TMP2, RA, RD\n  |    lw TMP1, LFUNC:TMP1->pc\n  |.if FFI\n  |  bnez AT, >1\n  |.endif\n  |.  sw TISNIL, -8+HI(TMP2)\t\t// Ensure one valid arg.\n  |  // BASE = base, RA = resultptr, RB = meta base\n  |  jr TMP0\t\t\t\t// Jump to continuation.\n  |.  lw KBASE, PC2PROTO(k)(TMP1)\n  |\n  |.if FFI\n  |1:\n  |  bnez TMP0, ->cont_ffi_callback\t// cont = 1: return from FFI callback.\n  |  // cont = 0: tailcall from C function.\n  |.  addiu TMP1, RB, -16\n  |  b ->vm_call_tail\n  |.  subu RC, TMP1, BASE\n  |.endif\n  |\n  |->cont_cat:\t\t\t\t// RA = resultptr, RB = meta base\n  |  lw INS, -4(PC)\n  |   addiu CARG2, RB, -16\n  |   ldc1 f0, 0(RA)\n  |  decode_RB8a MULTRES, INS\n  |   decode_RA8a RA, INS\n  |  decode_RB8b MULTRES\n  |   decode_RA8b RA\n  |  addu TMP1, BASE, MULTRES\n  |   sw BASE, L->base\n  |   subu CARG3, CARG2, TMP1\n  |  bne TMP1, CARG2, ->BC_CAT_Z\n  |.  sdc1 f0, 0(CARG2)\n  |  addu RA, BASE, RA\n  |  b ->cont_nop\n  |.  sdc1 f0, 0(RA)\n  |\n  |//-- Table indexing metamethods -----------------------------------------\n  |\n  |->vmeta_tgets1:\n  |  addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)\n  |  li TMP0, LJ_TSTR\n  |  sw STR:RC, LO(CARG3)\n  |  b >1\n  |.  sw TMP0, HI(CARG3)\n  |\n  |->vmeta_tgets:\n  |  addiu CARG2, DISPATCH, DISPATCH_GL(tmptv)\n  |  li TMP0, LJ_TTAB\n  |  sw TAB:RB, LO(CARG2)\n  |   addiu CARG3, DISPATCH, DISPATCH_GL(tmptv2)\n  |  sw TMP0, HI(CARG2)\n  |   li TMP1, LJ_TSTR\n  |   sw STR:RC, LO(CARG3)\n  |  b >1\n  |.  sw TMP1, HI(CARG3)\n  |\n  |->vmeta_tgetb:\t\t\t// TMP0 = index\n  |  mtc1 TMP0, f0\n  |  cvt.d.w f0, f0\n  |  addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)\n  |  sdc1 f0, 0(CARG3)\n  |\n  |->vmeta_tgetv:\n  |1:\n  |  load_got lj_meta_tget\n  |  sw BASE, L->base\n  |  sw PC, SAVE_PC\n  |  call_intern lj_meta_tget\t\t// (lua_State *L, TValue *o, TValue *k)\n  |.  move CARG1, L\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  beqz CRET1, >3\n  |.  addiu TMP1, BASE, -FRAME_CONT\n  |  ldc1 f0, 0(CRET1)\n  |  ins_next1\n  |   sdc1 f0, 0(RA)\n  |  ins_next2\n  |\n  |3:  // Call __index metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k\n  |  lw BASE, L->top\n  |  sw PC, -16+HI(BASE)\t\t// [cont|PC]\n  |   subu PC, BASE, TMP1\n  |  lw LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |  b ->vm_call_dispatch_f\n  |.  li NARGS8:RC, 16\t\t\t// 2 args for func(t, k).\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->vmeta_tsets1:\n  |  addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)\n  |  li TMP0, LJ_TSTR\n  |  sw STR:RC, LO(CARG3)\n  |  b >1\n  |.  sw TMP0, HI(CARG3)\n  |\n  |->vmeta_tsets:\n  |  addiu CARG2, DISPATCH, DISPATCH_GL(tmptv)\n  |  li TMP0, LJ_TTAB\n  |  sw TAB:RB, LO(CARG2)\n  |   addiu CARG3, DISPATCH, DISPATCH_GL(tmptv2)\n  |  sw TMP0, HI(CARG2)\n  |   li TMP1, LJ_TSTR\n  |   sw STR:RC, LO(CARG3)\n  |  b >1\n  |.  sw TMP1, HI(CARG3)\n  |\n  |->vmeta_tsetb:\t\t\t// TMP0 = index\n  |  mtc1 TMP0, f0\n  |  cvt.d.w f0, f0\n  |  addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)\n  |  sdc1 f0, 0(CARG3)\n  |\n  |->vmeta_tsetv:\n  |1:\n  |  load_got lj_meta_tset\n  |  sw BASE, L->base\n  |  sw PC, SAVE_PC\n  |  call_intern lj_meta_tset\t\t// (lua_State *L, TValue *o, TValue *k)\n  |.  move CARG1, L\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  beqz CRET1, >3\n  |.  ldc1 f0, 0(RA)\n  |  // NOBARRIER: lj_meta_tset ensures the table is not black.\n  |  ins_next1\n  |   sdc1 f0, 0(CRET1)\n  |  ins_next2\n  |\n  |3:  // Call __newindex metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k/(v)\n  |  addiu TMP1, BASE, -FRAME_CONT\n  |  lw BASE, L->top\n  |  sw PC, -16+HI(BASE)\t\t// [cont|PC]\n  |   subu PC, BASE, TMP1\n  |  lw LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |  sdc1 f0, 16(BASE)\t\t\t// Copy value to third argument.\n  |  b ->vm_call_dispatch_f\n  |.  li NARGS8:RC, 24\t\t\t// 3 args for func(t, k, v)\n  |\n  |//-- Comparison metamethods ---------------------------------------------\n  |\n  |->vmeta_comp:\n  |  // CARG2, CARG3 are already set by BC_ISLT/BC_ISGE/BC_ISLE/BC_ISGT.\n  |  load_got lj_meta_comp\n  |  addiu PC, PC, -4\n  |  sw BASE, L->base\n  |  sw PC, SAVE_PC\n  |  decode_OP1 CARG4, INS\n  |  call_intern lj_meta_comp\t// (lua_State *L, TValue *o1, *o2, int op)\n  |.  move CARG1, L\n  |  // Returns 0/1 or TValue * (metamethod).\n  |3:\n  |  sltiu AT, CRET1, 2\n  |  beqz AT, ->vmeta_binop\n  |   negu TMP2, CRET1\n  |4:\n  |  lhu RD, OFS_RD(PC)\n  |   addiu PC, PC, 4\n  |   lui TMP1, (-(BCBIAS_J*4 >> 16) & 65535)\n  |  sll RD, RD, 2\n  |  addu RD, RD, TMP1\n  |  and RD, RD, TMP2\n  |  addu PC, PC, RD\n  |->cont_nop:\n  |  ins_next\n  |\n  |->cont_ra:\t\t\t\t// RA = resultptr\n  |  lbu TMP1, -4+OFS_RA(PC)\n  |   ldc1 f0, 0(RA)\n  |  sll TMP1, TMP1, 3\n  |  addu TMP1, BASE, TMP1\n  |  b ->cont_nop\n  |.  sdc1 f0, 0(TMP1)\n  |\n  |->cont_condt:\t\t\t// RA = resultptr\n  |  lw TMP0, HI(RA)\n  |  sltiu AT, TMP0, LJ_TISTRUECOND\n  |  b <4\n  |.  negu TMP2, AT\t\t\t// Branch if result is true.\n  |\n  |->cont_condf:\t\t\t// RA = resultptr\n  |  lw TMP0, HI(RA)\n  |  sltiu AT, TMP0, LJ_TISTRUECOND\n  |  b <4\n  |.  addiu TMP2, AT, -1\t\t// Branch if result is false.\n  |\n  |->vmeta_equal:\n  |  // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV.\n  |  load_got lj_meta_equal\n  |  addiu PC, PC, -4\n  |   sw BASE, L->base\n  |   sw PC, SAVE_PC\n  |  call_intern lj_meta_equal  // (lua_State *L, GCobj *o1, *o2, int ne)\n  |.  move CARG1, L\n  |  // Returns 0/1 or TValue * (metamethod).\n  |  b <3\n  |.  nop\n  |\n  |->vmeta_equal_cd:\n  |.if FFI\n  |  load_got lj_meta_equal_cd\n  |  move CARG2, INS\n  |  addiu PC, PC, -4\n  |   sw BASE, L->base\n  |   sw PC, SAVE_PC\n  |  call_intern lj_meta_equal_cd\t// (lua_State *L, BCIns op)\n  |.  move CARG1, L\n  |  // Returns 0/1 or TValue * (metamethod).\n  |  b <3\n  |.  nop\n  |.endif\n  |\n  |//-- Arithmetic metamethods ---------------------------------------------\n  |\n  |->vmeta_unm:\n  |  move CARG4, CARG3\n  |\n  |->vmeta_arith:\n  |  load_got lj_meta_arith\n  |  decode_OP1 TMP0, INS\n  |   sw BASE, L->base\n  |   sw PC, SAVE_PC\n  |  move CARG2, RA\n  |  sw TMP0, ARG5\n  |  call_intern lj_meta_arith  // (lua_State *L, TValue *ra,*rb,*rc, BCReg op)\n  |.  move CARG1, L\n  |  // Returns NULL (finished) or TValue * (metamethod).\n  |  beqz CRET1, ->cont_nop\n  |.  nop\n  |\n  |  // Call metamethod for binary op.\n  |->vmeta_binop:\n  |  // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2\n  |  subu TMP1, CRET1, BASE\n  |   sw PC, -16+HI(CRET1)\t\t// [cont|PC]\n  |   move TMP2, BASE\n  |  addiu PC, TMP1, FRAME_CONT\n  |   move BASE, CRET1\n  |  b ->vm_call_dispatch\n  |.  li NARGS8:RC, 16\t\t\t// 2 args for func(o1, o2).\n  |\n  |->vmeta_len:\n  |  // CARG2 already set by BC_LEN.\n#if LJ_52\n  |  move MULTRES, CARG1\n#endif\n  |  load_got lj_meta_len\n  |   sw BASE, L->base\n  |   sw PC, SAVE_PC\n  |  call_intern lj_meta_len\t\t// (lua_State *L, TValue *o)\n  |.  move CARG1, L\n  |  // Returns NULL (retry) or TValue * (metamethod base).\n#if LJ_52\n  |  bnez CRET1, ->vmeta_binop\t\t// Binop call for compatibility.\n  |.  nop\n  |  b ->BC_LEN_Z\n  |.  move CARG1, MULTRES\n#else\n  |  b ->vmeta_binop\t\t\t// Binop call for compatibility.\n  |.  nop\n#endif\n  |\n  |//-- Call metamethod ----------------------------------------------------\n  |\n  |->vmeta_call:\t\t\t// Resolve and call __call metamethod.\n  |  // TMP2 = old base, BASE = new base, RC = nargs*8\n  |  load_got lj_meta_call\n  |   sw TMP2, L->base\t\t\t// This is the callers base!\n  |  addiu CARG2, BASE, -8\n  |   sw PC, SAVE_PC\n  |  addu CARG3, BASE, RC\n  |   move MULTRES, NARGS8:RC\n  |  call_intern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |.  move CARG1, L\n  |  lw LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |   addiu NARGS8:RC, MULTRES, 8\t// Got one more argument now.\n  |  ins_call\n  |\n  |->vmeta_callt:\t\t\t// Resolve __call for BC_CALLT.\n  |  // BASE = old base, RA = new base, RC = nargs*8\n  |  load_got lj_meta_call\n  |   sw BASE, L->base\n  |  addiu CARG2, RA, -8\n  |   sw PC, SAVE_PC\n  |  addu CARG3, RA, RC\n  |   move MULTRES, NARGS8:RC\n  |  call_intern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |.  move CARG1, L\n  |  lw TMP1, FRAME_PC(BASE)\n  |   lw LFUNC:RB, FRAME_FUNC(RA)\t// Guaranteed to be a function here.\n  |  b ->BC_CALLT_Z\n  |.  addiu NARGS8:RC, MULTRES, 8\t// Got one more argument now.\n  |\n  |//-- Argument coercion for 'for' statement ------------------------------\n  |\n  |->vmeta_for:\n  |  load_got lj_meta_for\n  |   sw BASE, L->base\n  |  move CARG2, RA\n  |   sw PC, SAVE_PC\n  |  move MULTRES, INS\n  |  call_intern lj_meta_for\t// (lua_State *L, TValue *base)\n  |.  move CARG1, L\n  |.if JIT\n  |  decode_OP1 TMP0, MULTRES\n  |  li AT, BC_JFORI\n  |.endif\n  |  decode_RA8a RA, MULTRES\n  |   decode_RD8a RD, MULTRES\n  |  decode_RA8b RA\n  |.if JIT\n  |  beq TMP0, AT, =>BC_JFORI\n  |.  decode_RD8b RD\n  |  b =>BC_FORI\n  |.  nop\n  |.else\n  |  b =>BC_FORI\n  |.  decode_RD8b RD\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Fast functions -----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |.macro .ffunc, name\n  |->ff_ .. name:\n  |.endmacro\n  |\n  |.macro .ffunc_1, name\n  |->ff_ .. name:\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  lw CARG3, HI(BASE)\n  |    lw CARG1, LO(BASE)\n  |.endmacro\n  |\n  |.macro .ffunc_2, name\n  |->ff_ .. name:\n  |  sltiu AT, NARGS8:RC, 16\n  |   lw CARG3, HI(BASE)\n  |  bnez AT, ->fff_fallback\n  |.   lw CARG4, 8+HI(BASE)\n  |   lw CARG1, LO(BASE)\n  |    lw CARG2, 8+LO(BASE)\n  |.endmacro\n  |\n  |.macro .ffunc_n, name\t// Caveat: has delay slot!\n  |->ff_ .. name:\n  |  lw CARG3, HI(BASE)\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  ldc1 FARG1, 0(BASE)\n  |  sltiu AT, CARG3, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_nn, name\t// Caveat: has delay slot!\n  |->ff_ .. name:\n  |  sltiu AT, NARGS8:RC, 16\n  |   lw CARG3, HI(BASE)\n  |  bnez AT, ->fff_fallback\n  |.  lw CARG4, 8+HI(BASE)\n  |  ldc1 FARG1, 0(BASE)\n  |  ldc1 FARG2, 8(BASE)\n  |  sltiu TMP0, CARG3, LJ_TISNUM\n  |  sltiu TMP1, CARG4, LJ_TISNUM\n  |  and TMP0, TMP0, TMP1\n  |  beqz TMP0, ->fff_fallback\n  |.endmacro\n  |\n  |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1 and has delay slot!\n  |.macro ffgccheck\n  |  lw TMP0, DISPATCH_GL(gc.total)(DISPATCH)\n  |  lw TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)\n  |  subu AT, TMP0, TMP1\n  |  bgezal AT, ->fff_gcstep\n  |.endmacro\n  |\n  |//-- Base library: checks -----------------------------------------------\n  |\n  |.ffunc_1 assert\n  |  sltiu AT, CARG3, LJ_TISTRUECOND\n  |  beqz AT, ->fff_fallback\n  |.  addiu RA, BASE, -8\n  |  lw PC, FRAME_PC(BASE)\n  |  addiu RD, NARGS8:RC, 8\t\t// Compute (nresults+1)*8.\n  |  addu TMP2, RA, NARGS8:RC\n  |   sw CARG3, HI(RA)\n  |  addiu TMP1, BASE, 8\n  |  beq BASE, TMP2, ->fff_res\t\t// Done if exactly 1 argument.\n  |.  sw CARG1, LO(RA)\n  |1:\n  |  ldc1 f0, 0(TMP1)\n  |  sdc1 f0, -8(TMP1)\n  |  bne TMP1, TMP2, <1\n  |.  addiu TMP1, TMP1, 8\n  |  b ->fff_res\n  |.  nop\n  |\n  |.ffunc type\n  |  lw CARG3, HI(BASE)\n  |  li TMP1, LJ_TISNUM\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  sltiu TMP0, CARG3, LJ_TISNUM\n  |  movz TMP1, CARG3, TMP0\n  |  not TMP1, TMP1\n  |  sll TMP1, TMP1, 3\n  |  addu TMP1, CFUNC:RB, TMP1\n  |  b ->fff_resn\n  |.  ldc1 FRET1, CFUNC:TMP1->upvalue\n  |\n  |//-- Base library: getters and setters ---------------------------------\n  |\n  |.ffunc_1 getmetatable\n  |  li AT, LJ_TTAB\n  |  bne CARG3, AT, >6\n  |.  li AT, LJ_TUDATA\n  |1:  // Field metatable must be at same offset for GCtab and GCudata!\n  |  lw TAB:CARG1, TAB:CARG1->metatable\n  |2:\n  |  lw STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH)\n  |  beqz TAB:CARG1, ->fff_restv\n  |.  li CARG3, LJ_TNIL\n  |  lw TMP0, TAB:CARG1->hmask\n  |   li CARG3, LJ_TTAB\t\t\t// Use metatable as default result.\n  |  lw TMP1, STR:RC->hash\n  |  lw NODE:TMP2, TAB:CARG1->node\n  |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n  |  sll TMP0, TMP1, 5\n  |  sll TMP1, TMP1, 3\n  |  subu TMP1, TMP0, TMP1\n  |  addu NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n  |  li AT, LJ_TSTR\n  |3:  // Rearranged logic, because we expect _not_ to find the key.\n  |  lw CARG4, offsetof(Node, key)+HI(NODE:TMP2)\n  |   lw TMP0, offsetof(Node, key)+LO(NODE:TMP2)\n  |    lw NODE:TMP3, NODE:TMP2->next\n  |  bne CARG4, AT, >4\n  |.    lw CARG2, offsetof(Node, val)+HI(NODE:TMP2)\n  |  beq TMP0, STR:RC, >5\n  |.    lw TMP1, offsetof(Node, val)+LO(NODE:TMP2)\n  |4:\n  |  beqz NODE:TMP3, ->fff_restv\t// Not found, keep default result.\n  |.  move NODE:TMP2, NODE:TMP3\n  |  b <3\n  |.  nop\n  |5:\n  |  beq CARG2, TISNIL, ->fff_restv\t// Ditto for nil value.\n  |.  nop\n  |  move CARG3, CARG2\t\t\t// Return value of mt.__metatable.\n  |  b ->fff_restv\n  |.  move CARG1, TMP1\n  |\n  |6:\n  |  beq CARG3, AT, <1\n  |.  sltiu TMP0, CARG3, LJ_TISNUM\n  |  li TMP1, LJ_TISNUM\n  |  movz TMP1, CARG3, TMP0\n  |  not TMP1, TMP1\n  |  sll TMP1, TMP1, 2\n  |  addu TMP1, DISPATCH, TMP1\n  |  b <2\n  |.  lw TAB:CARG1, DISPATCH_GL(gcroot[GCROOT_BASEMT])(TMP1)\n  |\n  |.ffunc_2 setmetatable\n  |  // Fast path: no mt for table yet and not clearing the mt.\n  |  li AT, LJ_TTAB\n  |  bne CARG3, AT, ->fff_fallback\n  |.  addiu CARG4, CARG4, -LJ_TTAB\n  |  lw TAB:TMP1, TAB:CARG1->metatable\n  |   lbu TMP3, TAB:CARG1->marked\n  |  or AT, CARG4, TAB:TMP1\n  |  bnez AT, ->fff_fallback\n  |.  andi AT, TMP3, LJ_GC_BLACK\t// isblack(table)\n  |  beqz AT, ->fff_restv\n  |.  sw TAB:CARG2, TAB:CARG1->metatable\n  |  barrierback TAB:CARG1, TMP3, TMP0, ->fff_restv\n  |\n  |.ffunc rawget\n  |  lw CARG4, HI(BASE)\n  |   sltiu AT, NARGS8:RC, 16\n  |    lw TAB:CARG2, LO(BASE)\n  |  load_got lj_tab_get\n  |  addiu CARG4, CARG4, -LJ_TTAB\n  |  or AT, AT, CARG4\n  |  bnez AT, ->fff_fallback\n  |   addiu CARG3, BASE, 8\n  |  call_intern lj_tab_get\t// (lua_State *L, GCtab *t, cTValue *key)\n  |.  move CARG1, L\n  |  // Returns cTValue *.\n  |  b ->fff_resn\n  |.  ldc1 FRET1, 0(CRET1)\n  |\n  |//-- Base library: conversions ------------------------------------------\n  |\n  |.ffunc tonumber\n  |  // Only handles the number case inline (without a base argument).\n  |  lw CARG1, HI(BASE)\n  |  xori AT, NARGS8:RC, 8\n  |  sltiu CARG1, CARG1, LJ_TISNUM\n  |  movn CARG1, r0, AT\n  |  beqz CARG1, ->fff_fallback\t\t// Exactly one number argument.\n  |.  ldc1 FRET1, 0(BASE)\n  |  b ->fff_resn\n  |.  nop\n  |\n  |.ffunc_1 tostring\n  |  // Only handles the string or number case inline.\n  |  li AT, LJ_TSTR\n  |  // A __tostring method in the string base metatable is ignored.\n  |  beq CARG3, AT, ->fff_restv\t\t\t// String key?\n  |  // Handle numbers inline, unless a number base metatable is present.\n  |.  lw TMP1, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH)\n  |  sltiu TMP0, CARG3, LJ_TISNUM\n  |  sltiu TMP1, TMP1, 1\n  |  and TMP0, TMP0, TMP1\n  |  beqz TMP0, ->fff_fallback\n  |.  sw BASE, L->base\t\t\t// Add frame since C call can throw.\n  |  ffgccheck\n  |.  sw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  load_got lj_str_fromnum\n  |  move CARG1, L\n  |  call_intern lj_str_fromnum\t\t// (lua_State *L, lua_Number *np)\n  |.  move CARG2, BASE\n  |  // Returns GCstr *.\n  |  li CARG3, LJ_TSTR\n  |  b ->fff_restv\n  |.  move CARG1, CRET1\n  |\n  |//-- Base library: iterators -------------------------------------------\n  |\n  |.ffunc next\n  |  lw CARG1, HI(BASE)\n  |   lw TAB:CARG2, LO(BASE)\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  addu TMP2, BASE, NARGS8:RC\n  |  li AT, LJ_TTAB\n  |   sw TISNIL, HI(TMP2)\t\t// Set missing 2nd arg to nil.\n  |  bne CARG1, AT, ->fff_fallback\n  |.  lw PC, FRAME_PC(BASE)\n  |  load_got lj_tab_next\n  |   sw BASE, L->base\t\t\t// Add frame since C call can throw.\n  |   sw BASE, L->top\t\t\t// Dummy frame length is ok.\n  |  addiu CARG3, BASE, 8\n  |   sw PC, SAVE_PC\n  |  call_intern lj_tab_next\t\t// (lua_State *L, GCtab *t, TValue *key)\n  |.  move CARG1, L\n  |  // Returns 0 at end of traversal.\n  |  beqz CRET1, ->fff_restv\t\t// End of traversal: return nil.\n  |.  li CARG3, LJ_TNIL\n  |  ldc1 f0, 8(BASE)\t\t\t// Copy key and value to results.\n  |    addiu RA, BASE, -8\n  |   ldc1 f2, 16(BASE)\n  |    li RD, (2+1)*8\n  |  sdc1 f0, 0(RA)\n  |  b ->fff_res\n  |.  sdc1 f2, 8(RA)\n  |\n  |.ffunc_1 pairs\n  |  li AT, LJ_TTAB\n  |  bne CARG3, AT, ->fff_fallback\n  |.  lw PC, FRAME_PC(BASE)\n#if LJ_52\n  |  lw TAB:TMP2, TAB:CARG1->metatable\n  |   ldc1 f0, CFUNC:RB->upvalue[0]\n  |  bnez TAB:TMP2, ->fff_fallback\n#else\n  |  ldc1 f0, CFUNC:RB->upvalue[0]\n#endif\n  |.  addiu RA, BASE, -8\n  |   sw TISNIL, 8+HI(BASE)\n  |  li RD, (3+1)*8\n  |  b ->fff_res\n  |.  sdc1 f0, 0(RA)\n  |\n  |.ffunc ipairs_aux\n  |  sltiu AT, NARGS8:RC, 16\n  |   lw CARG3, HI(BASE)\n  |    lw TAB:CARG1, LO(BASE)\n  |   lw CARG4, 8+HI(BASE)\n  |  bnez AT, ->fff_fallback\n  |.  ldc1 FARG2, 8(BASE)\n  |   addiu CARG3, CARG3, -LJ_TTAB\n  |  sltiu AT, CARG4, LJ_TISNUM\n  |   li TMP0, 1\n  |  movn AT, r0, CARG3\n  |   mtc1 TMP0, FARG1\n  |  beqz AT, ->fff_fallback\n  |.  lw PC, FRAME_PC(BASE)\n  |   cvt.w.d FRET1, FARG2\n  |  cvt.d.w FARG1, FARG1\n  |   lw TMP0, TAB:CARG1->asize\n  |   lw TMP1, TAB:CARG1->array\n  |  mfc1 TMP2, FRET1\n  |   addiu RA, BASE, -8\n  |  add.d FARG2, FARG2, FARG1\n  |  addiu TMP2, TMP2, 1\n  |  sltu AT, TMP2, TMP0\n  |   sll TMP3, TMP2, 3\n  |   addu TMP3, TMP1, TMP3\n  |  beqz AT, >2\t\t\t// Not in array part?\n  |.  sdc1 FARG2, 0(RA)\n  |  lw TMP2, HI(TMP3)\n  |  ldc1 f0, 0(TMP3)\n  |1:\n  |  beq TMP2, TISNIL, ->fff_res\t// End of iteration, return 0 results.\n  |.  li RD, (0+1)*8\n  |   li RD, (2+1)*8\n  |  b ->fff_res\n  |.  sdc1 f0, 8(RA)\n  |2:  // Check for empty hash part first. Otherwise call C function.\n  |  lw TMP0, TAB:CARG1->hmask\n  |  load_got lj_tab_getinth\n  |  beqz TMP0, ->fff_res\n  |.  li RD, (0+1)*8\n  |  call_intern lj_tab_getinth\t\t// (GCtab *t, int32_t key)\n  |.  move CARG2, TMP2\n  |  // Returns cTValue * or NULL.\n  |  beqz CRET1, ->fff_res\n  |.  li RD, (0+1)*8\n  |  lw TMP2, HI(CRET1)\n  |  b <1\n  |.  ldc1 f0, 0(CRET1)\n  |\n  |.ffunc_1 ipairs\n  |  li AT, LJ_TTAB\n  |  bne CARG3, AT, ->fff_fallback\n  |.  lw PC, FRAME_PC(BASE)\n#if LJ_52\n  |  lw TAB:TMP2, TAB:CARG1->metatable\n  |   ldc1 f0, CFUNC:RB->upvalue[0]\n  |  bnez TAB:TMP2, ->fff_fallback\n#else\n  |  ldc1 f0, CFUNC:RB->upvalue[0]\n#endif\n  |.  addiu RA, BASE, -8\n  |   sw r0, 8+HI(BASE)\n  |   sw r0, 8+LO(BASE)\n  |  li RD, (3+1)*8\n  |  b ->fff_res\n  |.  sdc1 f0, 0(RA)\n  |\n  |//-- Base library: catch errors ----------------------------------------\n  |\n  |.ffunc pcall\n  |  lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  beqz NARGS8:RC, ->fff_fallback\n  |   move TMP2, BASE\n  |   addiu BASE, BASE, 8\n  |  // Remember active hook before pcall.\n  |  srl TMP3, TMP3, HOOK_ACTIVE_SHIFT\n  |  andi TMP3, TMP3, 1\n  |  addiu PC, TMP3, 8+FRAME_PCALL\n  |  b ->vm_call_dispatch\n  |.  addiu NARGS8:RC, NARGS8:RC, -8\n  |\n  |.ffunc xpcall\n  |    sltiu AT, NARGS8:RC, 16\n  |  lw CARG4, 8+HI(BASE)\n  |    bnez AT, ->fff_fallback\n  |.  ldc1 FARG2, 8(BASE)\n  |   ldc1 FARG1, 0(BASE)\n  |    lbu TMP1, DISPATCH_GL(hookmask)(DISPATCH)\n  |  li AT, LJ_TFUNC\n  |   move TMP2, BASE\n  |  bne CARG4, AT, ->fff_fallback  // Traceback must be a function.\n  |   addiu BASE, BASE, 16\n  |  // Remember active hook before pcall.\n  |  srl TMP3, TMP3, HOOK_ACTIVE_SHIFT\n  |   sdc1 FARG2, 0(TMP2)\t\t// Swap function and traceback.\n  |  andi TMP3, TMP3, 1\n  |   sdc1 FARG1, 8(TMP2)\n  |  addiu PC, TMP3, 16+FRAME_PCALL\n  |  b ->vm_call_dispatch\n  |.  addiu NARGS8:RC, NARGS8:RC, -16\n  |\n  |//-- Coroutine library --------------------------------------------------\n  |\n  |.macro coroutine_resume_wrap, resume\n  |.if resume\n  |.ffunc_1 coroutine_resume\n  |  li AT, LJ_TTHREAD\n  |  bne CARG3, AT, ->fff_fallback\n  |.else\n  |.ffunc coroutine_wrap_aux\n  |  lw L:CARG1, CFUNC:RB->upvalue[0].gcr\n  |.endif\n  |  lbu TMP0, L:CARG1->status\n  |   lw TMP1, L:CARG1->cframe\n  |    lw CARG2, L:CARG1->top\n  |    lw TMP2, L:CARG1->base\n  |  addiu TMP3, TMP0, -LUA_YIELD\n  |  bgtz TMP3, ->fff_fallback\t\t// st > LUA_YIELD?\n  |.   xor TMP2, TMP2, CARG2\n  |  bnez TMP1, ->fff_fallback\t\t// cframe != 0?\n  |.  or AT, TMP2, TMP0\n  |  lw TMP0, L:CARG1->maxstack\n  |  beqz AT, ->fff_fallback\t\t// base == top && st == 0?\n  |.  lw PC, FRAME_PC(BASE)\n  |  addu TMP2, CARG2, NARGS8:RC\n  |  sltu AT, TMP0, TMP2\n  |  bnez AT, ->fff_fallback\t\t// Stack overflow?\n  |.  sw PC, SAVE_PC\n  |   sw BASE, L->base\n  |1:\n  |.if resume\n  |  addiu BASE, BASE, 8\t\t// Keep resumed thread in stack for GC.\n  |  addiu NARGS8:RC, NARGS8:RC, -8\n  |  addiu TMP2, TMP2, -8\n  |.endif\n  |  sw TMP2, L:CARG1->top\n  |  addu TMP1, BASE, NARGS8:RC\n  |  move CARG3, CARG2\n  |  sw BASE, L->top\n  |2:  // Move args to coroutine.\n  |   ldc1 f0, 0(BASE)\n  |  sltu AT, BASE, TMP1\n  |  beqz AT, >3\n  |.  addiu BASE, BASE, 8\n  |   sdc1 f0, 0(CARG3)\n  |  b <2\n  |.  addiu CARG3, CARG3, 8\n  |3:\n  |  bal ->vm_resume\t\t\t// (lua_State *L, TValue *base, 0, 0)\n  |.  move L:RA, L:CARG1\n  |  // Returns thread status.\n  |4:\n  |  lw TMP2, L:RA->base\n  |   sltiu AT, CRET1, LUA_YIELD+1\n  |  lw TMP3, L:RA->top\n  |    li_vmstate INTERP\n  |  lw BASE, L->base\n  |    st_vmstate\n  |   beqz AT, >8\n  |. subu RD, TMP3, TMP2\n  |   lw TMP0, L->maxstack\n  |  beqz RD, >6\t\t\t// No results?\n  |.  addu TMP1, BASE, RD\n  |  sltu AT, TMP0, TMP1\n  |  bnez AT, >9\t\t\t// Need to grow stack?\n  |.  addu TMP3, TMP2, RD\n  |  sw TMP2, L:RA->top\t\t\t// Clear coroutine stack.\n  |  move TMP1, BASE\n  |5:  // Move results from coroutine.\n  |   ldc1 f0, 0(TMP2)\n  |  addiu TMP2, TMP2, 8\n  |  sltu AT, TMP2, TMP3\n  |   sdc1 f0, 0(TMP1)\n  |  bnez AT, <5\n  |.  addiu TMP1, TMP1, 8\n  |6:\n  |  andi TMP0, PC, FRAME_TYPE\n  |.if resume\n  |  li TMP1, LJ_TTRUE\n  |   addiu RA, BASE, -8\n  |  sw TMP1, -8+HI(BASE)\t\t// Prepend true to results.\n  |  addiu RD, RD, 16\n  |.else\n  |  move RA, BASE\n  |  addiu RD, RD, 8\n  |.endif\n  |7:\n  |  sw PC, SAVE_PC\n  |  beqz TMP0, ->BC_RET_Z\n  |.  move MULTRES, RD\n  |  b ->vm_return\n  |.  nop\n  |\n  |8:  // Coroutine returned with error (at co->top-1).\n  |.if resume\n  |  addiu TMP3, TMP3, -8\n  |   li TMP1, LJ_TFALSE\n  |  ldc1 f0, 0(TMP3)\n  |   sw TMP3, L:RA->top\t\t// Remove error from coroutine stack.\n  |    li RD, (2+1)*8\n  |   sw TMP1, -8+HI(BASE)\t\t// Prepend false to results.\n  |    addiu RA, BASE, -8\n  |  sdc1 f0, 0(BASE)\t\t\t// Copy error message.\n  |  b <7\n  |.  andi TMP0, PC, FRAME_TYPE\n  |.else\n  |  load_got lj_ffh_coroutine_wrap_err\n  |  move CARG2, L:RA\n  |  call_intern lj_ffh_coroutine_wrap_err  // (lua_State *L, lua_State *co)\n  |.  move CARG1, L\n  |.endif\n  |\n  |9:  // Handle stack expansion on return from yield.\n  |  load_got lj_state_growstack\n  |  srl CARG2, RD, 3\n  |  call_intern lj_state_growstack\t// (lua_State *L, int n)\n  |.  move CARG1, L\n  |  b <4\n  |.  li CRET1, 0\n  |.endmacro\n  |\n  |  coroutine_resume_wrap 1\t\t// coroutine.resume\n  |  coroutine_resume_wrap 0\t\t// coroutine.wrap\n  |\n  |.ffunc coroutine_yield\n  |  lw TMP0, L->cframe\n  |   addu TMP1, BASE, NARGS8:RC\n  |   sw BASE, L->base\n  |  andi TMP0, TMP0, CFRAME_RESUME\n  |   sw TMP1, L->top\n  |  beqz TMP0, ->fff_fallback\n  |.   li CRET1, LUA_YIELD\n  |  sw r0, L->cframe\n  |  b ->vm_leave_unw\n  |.   sb CRET1, L->status\n  |\n  |//-- Math library -------------------------------------------------------\n  |\n  |.ffunc_n math_abs\n  |.  abs.d FRET1, FARG1\n  |->fff_resn:\n  |  lw PC, FRAME_PC(BASE)\n  |  addiu RA, BASE, -8\n  |  b ->fff_res1\n  |.  sdc1 FRET1, -8(BASE)\n  |\n  |->fff_restv:\n  |  // CARG3/CARG1 = TValue result.\n  |  lw PC, FRAME_PC(BASE)\n  |   sw CARG3, -8+HI(BASE)\n  |  addiu RA, BASE, -8\n  |   sw CARG1, -8+LO(BASE)\n  |->fff_res1:\n  |  // RA = results, PC = return.\n  |  li RD, (1+1)*8\n  |->fff_res:\n  |  // RA = results, RD = (nresults+1)*8, PC = return.\n  |  andi TMP0, PC, FRAME_TYPE\n  |  bnez TMP0, ->vm_return\n  |.  move MULTRES, RD\n  |  lw INS, -4(PC)\n  |  decode_RB8a RB, INS\n  |  decode_RB8b RB\n  |5:\n  |  sltu AT, RD, RB\n  |  bnez AT, >6\t\t\t// More results expected?\n  |.  decode_RA8a TMP0, INS\n  |  decode_RA8b TMP0\n  |  ins_next1\n  |  // Adjust BASE. KBASE is assumed to be set for the calling frame.\n  |   subu BASE, RA, TMP0\n  |  ins_next2\n  |\n  |6:  // Fill up results with nil.\n  |  addu TMP1, RA, RD\n  |   addiu RD, RD, 8\n  |  b <5\n  |.  sw TISNIL, -8+HI(TMP1)\n  |\n  |.macro math_extern, func\n  |->ff_math_ .. func:\n  |  lw CARG3, HI(BASE)\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  load_got func\n  |  sltiu AT, CARG3, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.  nop\n  |  call_extern\n  |.  ldc1 FARG1, 0(BASE)\n  |  b ->fff_resn\n  |.  nop\n  |.endmacro\n  |\n  |.macro math_extern2, func\n  |  .ffunc_nn math_ .. func\n  |.  load_got func\n  |  call_extern\n  |.  nop\n  |  b ->fff_resn\n  |.  nop\n  |.endmacro\n  |\n  |.macro math_round, func\n  |  .ffunc_n math_ .. func\n  |.  nop\n  |  bal ->vm_ .. func\n  |.  nop\n  |  b ->fff_resn\n  |.  nop\n  |.endmacro\n  |\n  |  math_round floor\n  |  math_round ceil\n  |\n  |.ffunc math_log\n  |  lw CARG3, HI(BASE)\n  |  li AT, 8\n  |  bne NARGS8:RC, AT, ->fff_fallback\t// Exactly 1 argument.\n  |.  load_got log\n  |  sltiu AT, CARG3, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.  nop\n  |  call_extern\n  |.  ldc1 FARG1, 0(BASE)\n  |  b ->fff_resn\n  |.  nop\n  |\n  |  math_extern log10\n  |  math_extern exp\n  |  math_extern sin\n  |  math_extern cos\n  |  math_extern tan\n  |  math_extern asin\n  |  math_extern acos\n  |  math_extern atan\n  |  math_extern sinh\n  |  math_extern cosh\n  |  math_extern tanh\n  |  math_extern2 pow\n  |  math_extern2 atan2\n  |  math_extern2 fmod\n  |\n  |.ffunc_n math_sqrt\n  |.  sqrt.d FRET1, FARG1\n  |  b ->fff_resn\n  |.  nop\n  |\n  |->ff_math_deg:\n  |.ffunc_n math_rad\n  |.  ldc1 FARG2, CFUNC:RB->upvalue[0]\n  |  b ->fff_resn\n  |.  mul.d FRET1, FARG1, FARG2\n  |\n  |.ffunc_nn math_ldexp\n  |  cvt.w.d FARG2, FARG2\n  |  load_got ldexp\n  |  mfc1 CARG3, FARG2\n  |  call_extern\n  |.  nop\n  |  b ->fff_resn\n  |.  nop\n  |\n  |.ffunc_n math_frexp\n  |  load_got frexp\n  |   lw PC, FRAME_PC(BASE)\n  |  call_extern\n  |.  addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)\n  |   lw TMP1, DISPATCH_GL(tmptv)(DISPATCH)\n  |  addiu RA, BASE, -8\n  |   mtc1 TMP1, FARG2\n  |  sdc1 FRET1, 0(RA)\n  |   cvt.d.w FARG2, FARG2\n  |   sdc1 FARG2, 8(RA)\n  |  b ->fff_res\n  |.  li RD, (2+1)*8\n  |\n  |.ffunc_n math_modf\n  |  load_got modf\n  |   lw PC, FRAME_PC(BASE)\n  |  call_extern\n  |.  addiu CARG3, BASE, -8\n  |  addiu RA, BASE, -8\n  |  sdc1 FRET1, 0(BASE)\n  |  b ->fff_res\n  |.  li RD, (2+1)*8\n  |\n  |.macro math_minmax, name, ismax\n  |->ff_ .. name:\n  |  lw CARG3, HI(BASE)\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  ldc1 FRET1, 0(BASE)\n  |  sltiu AT, CARG3, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.  addu TMP2, BASE, NARGS8:RC\n  |  addiu TMP1, BASE, 8\n  |  beq TMP1, TMP2, ->fff_resn\n  |1:\n  |.  lw CARG3, HI(TMP1)\n  |  ldc1 FARG1, 0(TMP1)\n  |   addiu TMP1, TMP1, 8\n  |  sltiu AT, CARG3, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.if ismax\n  |.  c.olt.d FARG1, FRET1\n  |.else\n  |.  c.olt.d FRET1, FARG1\n  |.endif\n  |  bne TMP1, TMP2, <1\n  |.  movf.d FRET1, FARG1\n  |  b ->fff_resn\n  |.  nop\n  |.endmacro\n  |\n  |  math_minmax math_min, 0\n  |  math_minmax math_max, 1\n  |\n  |//-- String library -----------------------------------------------------\n  |\n  |.ffunc_1 string_len\n  |  li AT, LJ_TSTR\n  |  bne CARG3, AT, ->fff_fallback\n  |.  nop\n  |  b ->fff_resi\n  |.  lw CRET1, STR:CARG1->len\n  |\n  |.ffunc string_byte\t\t\t// Only handle the 1-arg case here.\n  |  lw CARG3, HI(BASE)\n  |   lw STR:CARG1, LO(BASE)\n  |  xori AT, NARGS8:RC, 8\n  |  addiu CARG3, CARG3, -LJ_TSTR\n  |  or AT, AT, CARG3\n  |  bnez AT, ->fff_fallback\t\t// Need exactly 1 string argument.\n  |.  nop\n  |  lw TMP0, STR:CARG1->len\n  |   lbu TMP1, STR:CARG1[1]\t\t// Access is always ok (NUL at end).\n  |    addiu RA, BASE, -8\n  |  sltu RD, r0, TMP0\n  |   mtc1 TMP1, f0\n  |  addiu RD, RD, 1\n  |   cvt.d.w f0, f0\n  |  lw PC, FRAME_PC(BASE)\n  |  sll RD, RD, 3\t\t\t// RD = ((str->len != 0)+1)*8\n  |  b ->fff_res\n  |.  sdc1 f0, 0(RA)\n  |\n  |.ffunc string_char\t\t\t// Only handle the 1-arg case here.\n  |  ffgccheck\n  |  lw CARG3, HI(BASE)\n  |   ldc1 FARG1, 0(BASE)\n  |  li AT, 8\n  |  bne NARGS8:RC, AT, ->fff_fallback\t// Exactly 1 argument.\n  |.  sltiu AT, CARG3, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.  li CARG3, 1\n  |   cvt.w.d FARG1, FARG1\n  |  addiu CARG2, sp, ARG5_OFS\n  |  sltiu AT, TMP0, 256\n  |   mfc1 TMP0, FARG1\n  |  beqz AT, ->fff_fallback\n  |.  sw TMP0, ARG5\n  |->fff_newstr:\n  |  load_got lj_str_new\n  |   sw BASE, L->base\n  |   sw PC, SAVE_PC\n  |  call_intern lj_str_new\t\t// (lua_State *L, char *str, size_t l)\n  |.  move CARG1, L\n  |  // Returns GCstr *.\n  |  lw BASE, L->base\n  |  move CARG1, CRET1\n  |  b ->fff_restv\n  |.  li CARG3, LJ_TSTR\n  |\n  |.ffunc string_sub\n  |  ffgccheck\n  |  addiu AT, NARGS8:RC, -16\n  |   lw CARG3, 16+HI(BASE)\n  |    ldc1 f0, 16(BASE)\n  |   lw TMP0, HI(BASE)\n  |    lw STR:CARG1, LO(BASE)\n  |  bltz AT, ->fff_fallback\n  |   lw CARG2, 8+HI(BASE)\n  |    ldc1 f2, 8(BASE)\n  |  beqz AT, >1\n  |.  li CARG4, -1\n  |   cvt.w.d f0, f0\n  |  sltiu AT, CARG3, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.  mfc1 CARG4, f0\n  |1:\n  |  sltiu AT, CARG2, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |.  li AT, LJ_TSTR\n  |  cvt.w.d f2, f2\n  |  bne TMP0, AT, ->fff_fallback\n  |.  lw CARG2, STR:CARG1->len\n  |  mfc1 CARG3, f2\n  |  // STR:CARG1 = str, CARG2 = str->len, CARG3 = start, CARG4 = end\n  |  slt AT, CARG4, r0\n  |  addiu TMP0, CARG2, 1\n  |  addu TMP1, CARG4, TMP0\n  |   slt TMP3, CARG3, r0\n  |  movn CARG4, TMP1, AT\t\t// if (end < 0) end += len+1\n  |   addu TMP1, CARG3, TMP0\n  |   movn CARG3, TMP1, TMP3\t\t// if (start < 0) start += len+1\n  |   li TMP2, 1\n  |  slt AT, CARG4, r0\n  |   slt TMP3, r0, CARG3\n  |  movn CARG4, r0, AT\t\t\t// if (end < 0) end = 0\n  |   movz CARG3, TMP2, TMP3\t\t// if (start < 1) start = 1\n  |  slt AT, CARG2, CARG4\n  |  movn CARG4, CARG2, AT\t\t// if (end > len) end = len\n  |   addu CARG2, STR:CARG1, CARG3\n  |  subu CARG3, CARG4, CARG3\t\t// len = end - start\n  |   addiu CARG2, CARG2, sizeof(GCstr)-1\n  |  bgez CARG3, ->fff_newstr\n  |.  addiu CARG3, CARG3, 1\t\t// len++\n  |->fff_emptystr:  // Return empty string.\n  |  addiu STR:CARG1, DISPATCH, DISPATCH_GL(strempty)\n  |  b ->fff_restv\n  |.  li CARG3, LJ_TSTR\n  |\n  |.ffunc string_rep\t\t\t// Only handle the 1-char case inline.\n  |  ffgccheck\n  |  lw TMP0, HI(BASE)\n  |   addiu AT, NARGS8:RC, -16\t\t// Exactly 2 arguments.\n  |  lw CARG4, 8+HI(BASE)\n  |   lw STR:CARG1, LO(BASE)\n  |  addiu TMP0, TMP0, -LJ_TSTR\n  |   ldc1 f0, 8(BASE)\n  |  or AT, AT, TMP0\n  |  bnez AT, ->fff_fallback\n  |.  sltiu AT, CARG4, LJ_TISNUM\n  |   cvt.w.d f0, f0\n  |  beqz AT, ->fff_fallback\n  |.  lw TMP0, STR:CARG1->len\n  |   mfc1 CARG3, f0\n  |  lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  li AT, 1\n  |   blez CARG3, ->fff_emptystr\t// Count <= 0?\n  |.   sltu AT, AT, TMP0\n  |  beqz TMP0, ->fff_emptystr\t\t// Zero length string?\n  |.  sltu TMP0, TMP1, CARG3\n  |  or AT, AT, TMP0\n  |   lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |  bnez AT, ->fff_fallback\t\t// Fallback for > 1-char strings.\n  |.  lbu TMP0, STR:CARG1[1]\n  |  addu TMP2, CARG2, CARG3\n  |1:  // Fill buffer with char. Yes, this is suboptimal code (do you care?).\n  |  addiu TMP2, TMP2, -1\n  |  sltu AT, CARG2, TMP2\n  |  bnez AT, <1\n  |.  sb TMP0, 0(TMP2)\n  |  b ->fff_newstr\n  |.  nop\n  |\n  |.ffunc string_reverse\n  |  ffgccheck\n  |  lw CARG3, HI(BASE)\n  |   lw STR:CARG1, LO(BASE)\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  li AT, LJ_TSTR\n  |  bne CARG3, AT, ->fff_fallback\n  |.  lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  lw CARG3, STR:CARG1->len\n  |   addiu CARG1, STR:CARG1, #STR\n  |   lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |  sltu AT, TMP1, CARG3\n  |  bnez AT, ->fff_fallback\n  |.  addu TMP3, CARG1, CARG3\n  |  addu CARG4, CARG2, CARG3\n  |1:  // Reverse string copy.\n  |   lbu TMP1, 0(CARG1)\n  |  sltu AT, CARG1, TMP3\n  |  beqz AT, ->fff_newstr\n  |.  addiu CARG1, CARG1, 1\n  |  addiu CARG4, CARG4, -1\n  |  b <1\n  |   sb TMP1, 0(CARG4)\n  |\n  |.macro ffstring_case, name, lo\n  |  .ffunc name\n  |  ffgccheck\n  |  lw CARG3, HI(BASE)\n  |   lw STR:CARG1, LO(BASE)\n  |  beqz NARGS8:RC, ->fff_fallback\n  |.  li AT, LJ_TSTR\n  |  bne CARG3, AT, ->fff_fallback\n  |.  lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  lw CARG3, STR:CARG1->len\n  |   addiu CARG1, STR:CARG1, #STR\n  |   lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |  sltu AT, TMP1, CARG3\n  |  bnez AT, ->fff_fallback\n  |.  addu TMP3, CARG1, CARG3\n  |  move CARG4, CARG2\n  |1:  // ASCII case conversion.\n  |   lbu TMP1, 0(CARG1)\n  |  sltu AT, CARG1, TMP3\n  |  beqz AT, ->fff_newstr\n  |.  addiu TMP0, TMP1, -lo\n  |   xori TMP2, TMP1, 0x20\n  |   sltiu AT, TMP0, 26\n  |   movn TMP1, TMP2, AT\n  |  addiu CARG1, CARG1, 1\n  |   sb TMP1, 0(CARG4)\n  |  b <1\n  |.  addiu CARG4, CARG4, 1\n  |.endmacro\n  |\n  |ffstring_case string_lower, 65\n  |ffstring_case string_upper, 97\n  |\n  |//-- Table library ------------------------------------------------------\n  |\n  |.ffunc_1 table_getn\n  |  li AT, LJ_TTAB\n  |  bne CARG3, AT, ->fff_fallback\n  |.  load_got lj_tab_len\n  |  call_intern lj_tab_len\t\t// (GCtab *t)\n  |.  nop\n  |  // Returns uint32_t (but less than 2^31).\n  |  b ->fff_resi\n  |.  nop\n  |\n  |//-- Bit library --------------------------------------------------------\n  |\n  |.macro .ffunc_bit, name\n  |  .ffunc_n bit_..name\n  |.  add.d FARG1, FARG1, TOBIT\n  |  mfc1 CRET1, FARG1\n  |.endmacro\n  |\n  |.macro .ffunc_bit_op, name, ins\n  |  .ffunc_bit name\n  |  addiu TMP1, BASE, 8\n  |  addu TMP2, BASE, NARGS8:RC\n  |1:\n  |  lw CARG4, HI(TMP1)\n  |  beq TMP1, TMP2, ->fff_resi\n  |.  ldc1 FARG1, 0(TMP1)\n  |  sltiu AT, CARG4, LJ_TISNUM\n  |  beqz AT, ->fff_fallback\n  |  add.d FARG1, FARG1, TOBIT\n  |  mfc1 CARG2, FARG1\n  |  ins CRET1, CRET1, CARG2\n  |  b <1\n  |.  addiu TMP1, TMP1, 8\n  |.endmacro\n  |\n  |.ffunc_bit_op band, and\n  |.ffunc_bit_op bor, or\n  |.ffunc_bit_op bxor, xor\n  |\n  |.ffunc_bit bswap\n  |  srl TMP0, CRET1, 24\n  |   srl TMP2, CRET1, 8\n  |  sll TMP1, CRET1, 24\n  |   andi TMP2, TMP2, 0xff00\n  |  or TMP0, TMP0, TMP1\n  |   andi CRET1, CRET1, 0xff00\n  |  or TMP0, TMP0, TMP2\n  |   sll CRET1, CRET1, 8\n  |  b ->fff_resi\n  |.  or CRET1, TMP0, CRET1\n  |\n  |.ffunc_bit bnot\n  |  b ->fff_resi\n  |.  not CRET1, CRET1\n  |\n  |.macro .ffunc_bit_sh, name, ins, shmod\n  |  .ffunc_nn bit_..name\n  |.  add.d FARG1, FARG1, TOBIT\n  |  add.d FARG2, FARG2, TOBIT\n  |  mfc1 CARG1, FARG1\n  |  mfc1 CARG2, FARG2\n  |.if shmod == 1\n  |  li AT, 32\n  |  subu TMP0, AT, CARG2\n  |  sllv CARG2, CARG1, CARG2\n  |  srlv CARG1, CARG1, TMP0\n  |.elif shmod == 2\n  |  li AT, 32\n  |  subu TMP0, AT, CARG2\n  |  srlv CARG2, CARG1, CARG2\n  |  sllv CARG1, CARG1, TMP0\n  |.endif\n  |  b ->fff_resi\n  |.  ins CRET1, CARG1, CARG2\n  |.endmacro\n  |\n  |.ffunc_bit_sh lshift, sllv, 0\n  |.ffunc_bit_sh rshift, srlv, 0\n  |.ffunc_bit_sh arshift, srav, 0\n  |// Can't use rotrv, since it's only in MIPS32R2.\n  |.ffunc_bit_sh rol, or, 1\n  |.ffunc_bit_sh ror, or, 2\n  |\n  |.ffunc_bit tobit\n  |->fff_resi:\n  |  mtc1 CRET1, FRET1\n  |  b ->fff_resn\n  |.  cvt.d.w FRET1, FRET1\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->fff_fallback:\t\t\t// Call fast function fallback handler.\n  |  // BASE = new base, RB = CFUNC, RC = nargs*8\n  |  lw TMP3, CFUNC:RB->f\n  |    addu TMP1, BASE, NARGS8:RC\n  |   lw PC, FRAME_PC(BASE)\t\t// Fallback may overwrite PC.\n  |    addiu TMP0, TMP1, 8*LUA_MINSTACK\n  |     lw TMP2, L->maxstack\n  |   sw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  sltu AT, TMP2, TMP0\n  |     sw BASE, L->base\n  |    sw TMP1, L->top\n  |  bnez AT, >5\t\t\t// Need to grow stack.\n  |.  move CFUNCADDR, TMP3\n  |  jalr TMP3\t\t\t\t// (lua_State *L)\n  |.  move CARG1, L\n  |  // Either throws an error, or recovers and returns -1, 0 or nresults+1.\n  |  lw BASE, L->base\n  |   sll RD, CRET1, 3\n  |  bgtz CRET1, ->fff_res\t\t// Returned nresults+1?\n  |.  addiu RA, BASE, -8\n  |1:  // Returned 0 or -1: retry fast path.\n  |  lw TMP0, L->top\n  |   lw LFUNC:RB, FRAME_FUNC(BASE)\n  |  bnez CRET1, ->vm_call_tail\t\t// Returned -1?\n  |.  subu NARGS8:RC, TMP0, BASE\n  |  ins_callt\t\t\t\t// Returned 0: retry fast path.\n  |\n  |// Reconstruct previous base for vmeta_call during tailcall.\n  |->vm_call_tail:\n  |  andi TMP0, PC, FRAME_TYPE\n  |   li AT, -4\n  |  bnez TMP0, >3\n  |.  and TMP1, PC, AT\n  |  lbu TMP1, OFS_RA(PC)\n  |  sll TMP1, TMP1, 3\n  |  addiu TMP1, TMP1, 8\n  |3:\n  |  b ->vm_call_dispatch\t\t// Resolve again for tailcall.\n  |.  subu TMP2, BASE, TMP1\n  |\n  |5:  // Grow stack for fallback handler.\n  |  load_got lj_state_growstack\n  |  li CARG2, LUA_MINSTACK\n  |  call_intern lj_state_growstack\t// (lua_State *L, int n)\n  |.  move CARG1, L\n  |  lw BASE, L->base\n  |  b <1\n  |.  li CRET1, 0\t\t\t// Force retry.\n  |\n  |->fff_gcstep:\t\t\t// Call GC step function.\n  |  // BASE = new base, RC = nargs*8\n  |  move MULTRES, ra\n  |  load_got lj_gc_step\n  |   sw BASE, L->base\n  |  addu TMP0, BASE, NARGS8:RC\n  |   sw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  sw TMP0, L->top\n  |  call_intern lj_gc_step\t\t// (lua_State *L)\n  |.  move CARG1, L\n  |   lw BASE, L->base\n  |  move ra, MULTRES\n  |    lw TMP0, L->top\n  |  lw CFUNC:RB, FRAME_FUNC(BASE)\n  |  jr ra\n  |.  subu NARGS8:RC, TMP0, BASE\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Special dispatch targets -------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_record:\t\t\t\t// Dispatch target for recording phase.\n  |.if JIT\n  |  lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  andi AT, TMP3, HOOK_VMEVENT\t// No recording while in vmevent.\n  |  bnez AT, >5\n  |  // Decrement the hookcount for consistency, but always do the call.\n  |.  lw TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  andi AT, TMP3, HOOK_ACTIVE\n  |  bnez AT, >1\n  |.  addiu TMP2, TMP2, -1\n  |  andi AT, TMP3, LUA_MASKLINE|LUA_MASKCOUNT\n  |  beqz AT, >1\n  |.  nop\n  |  b >1\n  |.  sw TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |.endif\n  |\n  |->vm_rethook:\t\t\t// Dispatch target for return hooks.\n  |  lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  andi AT, TMP3, HOOK_ACTIVE\t\t// Hook already active?\n  |  beqz AT, >1\n  |5:  // Re-dispatch to static ins.\n  |.  lw AT, GG_DISP2STATIC(TMP0)\t// Assumes TMP0 holds DISPATCH+OP*4.\n  |  jr AT\n  |.  nop\n  |\n  |->vm_inshook:\t\t\t// Dispatch target for instr/line hooks.\n  |  lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  lw TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  andi AT, TMP3, HOOK_ACTIVE\t\t// Hook already active?\n  |  bnez AT, <5\n  |.  andi AT, TMP3, LUA_MASKLINE|LUA_MASKCOUNT\n  |  beqz AT, <5\n  |.  addiu TMP2, TMP2, -1\n  |  beqz TMP2, >1\n  |.  sw TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  andi AT, TMP3, LUA_MASKLINE\n  |  beqz AT, <5\n  |1:\n  |.  load_got lj_dispatch_ins\n  |   sw MULTRES, SAVE_MULTRES\n  |  move CARG2, PC\n  |   sw BASE, L->base\n  |  // SAVE_PC must hold the _previous_ PC. The callee updates it with PC.\n  |  call_intern lj_dispatch_ins\t// (lua_State *L, const BCIns *pc)\n  |.  move CARG1, L\n  |3:\n  |  lw BASE, L->base\n  |4:  // Re-dispatch to static ins.\n  |  lw INS, -4(PC)\n  |  decode_OP4a TMP1, INS\n  |  decode_OP4b TMP1\n  |  addu TMP0, DISPATCH, TMP1\n  |   decode_RD8a RD, INS\n  |  lw AT, GG_DISP2STATIC(TMP0)\n  |   decode_RA8a RA, INS\n  |   decode_RD8b RD\n  |  jr AT\n  |   decode_RA8b RA\n  |\n  |->cont_hook:\t\t\t\t// Continue from hook yield.\n  |  addiu PC, PC, 4\n  |  b <4\n  |.  lw MULTRES, -24+LO(RB)\t\t// Restore MULTRES for *M ins.\n  |\n  |->vm_hotloop:\t\t\t// Hot loop counter underflow.\n  |.if JIT\n  |  lw LFUNC:TMP1, FRAME_FUNC(BASE)\n  |   addiu CARG1, DISPATCH, GG_DISP2J\n  |   sw PC, SAVE_PC\n  |  lw TMP1, LFUNC:TMP1->pc\n  |   move CARG2, PC\n  |   sw L, DISPATCH_J(L)(DISPATCH)\n  |  lbu TMP1, PC2PROTO(framesize)(TMP1)\n  |  load_got lj_trace_hot\n  |   sw BASE, L->base\n  |  sll TMP1, TMP1, 3\n  |  addu TMP1, BASE, TMP1\n  |  call_intern lj_trace_hot\t\t// (jit_State *J, const BCIns *pc)\n  |.  sw TMP1, L->top\n  |  b <3\n  |.  nop\n  |.endif\n  |\n  |->vm_callhook:\t\t\t// Dispatch target for call hooks.\n  |.if JIT\n  |  b >1\n  |.endif\n  |.  move CARG2, PC\n  |\n  |->vm_hotcall:\t\t\t// Hot call counter underflow.\n  |.if JIT\n  |  ori CARG2, PC, 1\n  |1:\n  |.endif\n  |  load_got lj_dispatch_call\n  |  addu TMP0, BASE, RC\n  |   sw PC, SAVE_PC\n  |   sw BASE, L->base\n  |  subu RA, RA, BASE\n  |   sw TMP0, L->top\n  |  call_intern lj_dispatch_call\t// (lua_State *L, const BCIns *pc)\n  |.  move CARG1, L\n  |  // Returns ASMFunction.\n  |  lw BASE, L->base\n  |   lw TMP0, L->top\n  |   sw r0, SAVE_PC\t\t\t// Invalidate for subsequent line hook.\n  |  subu NARGS8:RC, TMP0, BASE\n  |  addu RA, BASE, RA\n  |  lw LFUNC:RB, FRAME_FUNC(BASE)\n  |  jr CRET1\n  |.  lw INS, -4(PC)\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Trace exit handler -------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |.macro savex_, a, b\n  |  sdc1 f..a, 16+a*8(sp)\n  |  sw r..a, 16+32*8+a*4(sp)\n  |  sw r..b, 16+32*8+b*4(sp)\n  |.endmacro\n  |\n  |->vm_exit_handler:\n  |.if JIT\n  |  addiu sp, sp, -(16+32*8+32*4)\n  |  savex_ 0, 1\n  |  savex_ 2, 3\n  |  savex_ 4, 5\n  |  savex_ 6, 7\n  |  savex_ 8, 9\n  |  savex_ 10, 11\n  |  savex_ 12, 13\n  |  savex_ 14, 15\n  |  savex_ 16, 17\n  |  savex_ 18, 19\n  |  savex_ 20, 21\n  |  savex_ 22, 23\n  |  savex_ 24, 25\n  |  savex_ 26, 27\n  |  sdc1 f28, 16+28*8(sp)\n  |  sw r28, 16+32*8+28*4(sp)\n  |  sdc1 f30, 16+30*8(sp)\n  |  sw r30, 16+32*8+30*4(sp)\n  |  sw r0, 16+32*8+31*4(sp)\t\t// Clear RID_TMP.\n  |  li_vmstate EXIT\n  |   addiu TMP2, sp, 16+32*8+32*4\t// Recompute original value of sp.\n  |  addiu DISPATCH, JGL, -GG_DISP2G-32768\n  |  lw TMP1, 0(TMP2)\t\t\t// Load exit number.\n  |  st_vmstate\n  |   sw TMP2, 16+32*8+29*4(sp)\t\t// Store sp in RID_SP.\n  |  lw L, DISPATCH_GL(jit_L)(DISPATCH)\n  |  lw BASE, DISPATCH_GL(jit_base)(DISPATCH)\n  |  load_got lj_trace_exit\n  |  sw L, DISPATCH_J(L)(DISPATCH)\n  |  sw ra, DISPATCH_J(parent)(DISPATCH)  // Store trace number.\n  |  sw TMP1, DISPATCH_J(exitno)(DISPATCH)  // Store exit number.\n  |  addiu CARG1, DISPATCH, GG_DISP2J\n  |  sw BASE, L->base\n  |  call_intern lj_trace_exit\t\t// (jit_State *J, ExitState *ex)\n  |.  addiu CARG2, sp, 16\n  |  // Returns MULTRES (unscaled) or negated error code.\n  |  lw TMP1, L->cframe\n  |  li AT, -4\n  |   lw BASE, L->base\n  |  and sp, TMP1, AT\n  |   lw PC, SAVE_PC\t\t\t// Get SAVE_PC.\n  |  b >1\n  |.  sw L, SAVE_L\t\t\t// Set SAVE_L (on-trace resume/yield).\n  |.endif\n  |->vm_exit_interp:\n  |.if JIT\n  |  // CRET1 = MULTRES or negated error code, BASE, PC and JGL set.\n  |  lw L, SAVE_L\n  |  addiu DISPATCH, JGL, -GG_DISP2G-32768\n  |1:\n  |  bltz CRET1, >3\t\t\t// Check for error from exit.\n  |.  lw LFUNC:TMP1, FRAME_FUNC(BASE)\n  |    lui TMP3, 0x59c0\t\t\t// TOBIT = 2^52 + 2^51 (float).\n  |  sll MULTRES, CRET1, 3\n  |    li TISNIL, LJ_TNIL\n  |  sw MULTRES, SAVE_MULTRES\n  |    mtc1 TMP3, TOBIT\n  |  lw TMP1, LFUNC:TMP1->pc\n  |   sw r0, DISPATCH_GL(jit_L)(DISPATCH)\n  |  lw KBASE, PC2PROTO(k)(TMP1)\n  |    cvt.d.s TOBIT, TOBIT\n  |  // Modified copy of ins_next which handles function header dispatch, too.\n  |  lw INS, 0(PC)\n  |   addiu PC, PC, 4\n  |    // Assumes TISNIL == ~LJ_VMST_INTERP == -1\n  |    sw TISNIL, DISPATCH_GL(vmstate)(DISPATCH)\n  |  decode_OP4a TMP1, INS\n  |  decode_OP4b TMP1\n  |    sltiu TMP2, TMP1, BC_FUNCF*4\t// Function header?\n  |  addu TMP0, DISPATCH, TMP1\n  |   decode_RD8a RD, INS\n  |  lw AT, 0(TMP0)\n  |   decode_RA8a RA, INS\n  |    beqz TMP2, >2\n  |.  decode_RA8b RA\n  |  jr AT\n  |.  decode_RD8b RD\n  |2:\n  |  addiu RC, MULTRES, -8\n  |  jr AT\n  |.  add RA, RA, BASE\n  |\n  |3:  // Rethrow error from the right C frame.\n  |  load_got lj_err_throw\n  |  negu CARG2, CRET1\n  |  call_intern lj_err_throw\t\t// (lua_State *L, int errcode)\n  |.  move CARG1, L\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Math helper functions ----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// Modifies AT, TMP0, FRET1, FRET2, f4. Keeps all others incl. FARG1.\n  |.macro vm_round, func\n  |  lui TMP0, 0x4330\t\t\t// Hiword of 2^52 (double).\n  |  mtc1 r0, f4\n  |  mtc1 TMP0, f5\n  |  abs.d FRET2, FARG1\t\t\t// |x|\n  |    mfc1 AT, f13\n  |  c.olt.d 0, FRET2, f4\n  |   add.d FRET1, FRET2, f4\t\t// (|x| + 2^52) - 2^52\n  |  bc1f 0, >1\t\t\t\t// Truncate only if |x| < 2^52.\n  |.  sub.d FRET1, FRET1, f4\n  |    slt AT, AT, r0\n  |.if \"func\" == \"ceil\"\n  |   lui TMP0, 0xbff0\t\t\t// Hiword of -1 (double). Preserves -0.\n  |.else\n  |   lui TMP0, 0x3ff0\t\t\t// Hiword of +1 (double).\n  |.endif\n  |.if \"func\" == \"trunc\"\n  |   mtc1 TMP0, f5\n  |  c.olt.d 0, FRET2, FRET1\t\t// |x| < result?\n  |   sub.d FRET2, FRET1, f4\n  |  movt.d FRET1, FRET2, 0\t\t// If yes, subtract +1.\n  |  neg.d FRET2, FRET1\n  |  jr ra\n  |.  movn.d FRET1, FRET2, AT\t\t// Merge sign bit back in.\n  |.else\n  |  neg.d FRET2, FRET1\n  |   mtc1 TMP0, f5\n  |  movn.d FRET1, FRET2, AT\t\t// Merge sign bit back in.\n  |.if \"func\" == \"ceil\"\n  |  c.olt.d 0, FRET1, FARG1\t\t// x > result?\n  |.else\n  |  c.olt.d 0, FARG1, FRET1\t\t// x < result?\n  |.endif\n  |   sub.d FRET2, FRET1, f4\t\t// If yes, subtract +-1.\n  |  jr ra\n  |.  movt.d FRET1, FRET2, 0\n  |.endif\n  |1:\n  |  jr ra\n  |.  mov.d FRET1, FARG1\n  |.endmacro\n  |\n  |->vm_floor:\n  |  vm_round floor\n  |->vm_ceil:\n  |  vm_round ceil\n  |->vm_trunc:\n  |.if JIT\n  |  vm_round trunc\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Miscellaneous functions --------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |//-----------------------------------------------------------------------\n  |//-- FFI helper functions -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// Handler for callback functions. Callback slot number in r1, g in r2.\n  |->vm_ffi_callback:\n  |.if FFI\n  |.type CTSTATE, CTState, PC\n  |  saveregs\n  |  lw CTSTATE, GL:r2->ctype_state\n  |   addiu DISPATCH, r2, GG_G2DISP\n  |  load_got lj_ccallback_enter\n  |  sw r1, CTSTATE->cb.slot\n  |  sw CARG1, CTSTATE->cb.gpr[0]\n  |  sw CARG2, CTSTATE->cb.gpr[1]\n  |   sdc1 FARG1, CTSTATE->cb.fpr[0]\n  |  sw CARG3, CTSTATE->cb.gpr[2]\n  |  sw CARG4, CTSTATE->cb.gpr[3]\n  |   sdc1 FARG2, CTSTATE->cb.fpr[1]\n  |  addiu TMP0, sp, CFRAME_SPACE+16\n  |  sw TMP0, CTSTATE->cb.stack\n  |  sw r0, SAVE_PC\t\t\t// Any value outside of bytecode is ok.\n  |   move CARG2, sp\n  |  call_intern lj_ccallback_enter\t// (CTState *cts, void *cf)\n  |.  move CARG1, CTSTATE\n  |  // Returns lua_State *.\n  |  lw BASE, L:CRET1->base\n  |  lw RC, L:CRET1->top\n  |   move L, CRET1\n  |     lui TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |  lw LFUNC:RB, FRAME_FUNC(BASE)\n  |     mtc1 TMP3, TOBIT\n  |    li_vmstate INTERP\n  |     li TISNIL, LJ_TNIL\n  |  subu RC, RC, BASE\n  |    st_vmstate\n  |     cvt.d.s TOBIT, TOBIT\n  |  ins_callt\n  |.endif\n  |\n  |->cont_ffi_callback:\t\t\t// Return from FFI callback.\n  |.if FFI\n  |  load_got lj_ccallback_leave\n  |  lw CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH)\n  |   sw BASE, L->base\n  |   sw RB, L->top\n  |  sw L, CTSTATE->L\n  |  move CARG2, RA\n  |  call_intern lj_ccallback_leave\t// (CTState *cts, TValue *o)\n  |.  move CARG1, CTSTATE\n  |  lw CRET1, CTSTATE->cb.gpr[0]\n  |   ldc1 FRET1, CTSTATE->cb.fpr[0]\n  |  lw CRET2, CTSTATE->cb.gpr[1]\n  |  b ->vm_leave_unw\n  |.  ldc1 FRET2, CTSTATE->cb.fpr[1]\n  |.endif\n  |\n  |->vm_ffi_call:\t\t\t// Call C function via FFI.\n  |  // Caveat: needs special frame unwinding, see below.\n  |.if FFI\n  |  .type CCSTATE, CCallState, CARG1\n  |  lw TMP1, CCSTATE->spadj\n  |   lbu CARG2, CCSTATE->nsp\n  |  move TMP2, sp\n  |  subu sp, sp, TMP1\n  |  sw ra, -4(TMP2)\n  |   sll CARG2, CARG2, 2\n  |  sw r16, -8(TMP2)\n  |  sw CCSTATE, -12(TMP2)\n  |  move r16, TMP2\n  |  addiu TMP1, CCSTATE, offsetof(CCallState, stack)\n  |  addiu TMP2, sp, 16\n  |  beqz CARG2, >2\n  |.  addu TMP3, TMP1, CARG2\n  |1:\n  |   lw TMP0, 0(TMP1)\n  |  addiu TMP1, TMP1, 4\n  |  sltu AT, TMP1, TMP3\n  |   sw TMP0, 0(TMP2)\n  |  bnez AT, <1\n  |.  addiu TMP2, TMP2, 4\n  |2:\n  |  lw CFUNCADDR, CCSTATE->func\n  |  lw CARG2, CCSTATE->gpr[1]\n  |  lw CARG3, CCSTATE->gpr[2]\n  |  lw CARG4, CCSTATE->gpr[3]\n  |  ldc1 FARG1, CCSTATE->fpr[0]\n  |  ldc1 FARG2, CCSTATE->fpr[1]\n  |  jalr CFUNCADDR\n  |.  lw CARG1, CCSTATE->gpr[0]\t\t// Do this last, since CCSTATE is CARG1.\n  |  lw CCSTATE:TMP1, -12(r16)\n  |  lw TMP2, -8(r16)\n  |  lw ra, -4(r16)\n  |  sw CRET1, CCSTATE:TMP1->gpr[0]\n  |  sw CRET2, CCSTATE:TMP1->gpr[1]\n  |  sdc1 FRET1, CCSTATE:TMP1->fpr[0]\n  |  sdc1 FRET2, CCSTATE:TMP1->fpr[1]\n  |  move sp, r16\n  |  jr ra\n  |.  move r16, TMP2\n  |.endif\n  |// Note: vm_ffi_call must be the last function in this object file!\n  |\n  |//-----------------------------------------------------------------------\n}\n\n/* Generate the code for a single instruction. */\nstatic void build_ins(BuildCtx *ctx, BCOp op, int defop)\n{\n  int vk = 0;\n  |=>defop:\n\n  switch (op) {\n\n  /* -- Comparison ops ---------------------------------------------------- */\n\n  /* Remember: all ops branch for a true comparison, fall through otherwise. */\n\n  case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:\n    |  // RA = src1*8, RD = src2*8, JMP with RD = target\n    |  addu CARG2, BASE, RA\n    |   addu CARG3, BASE, RD\n    |  lw TMP0, HI(CARG2)\n    |   lw TMP1, HI(CARG3)\n    |   ldc1 f0, 0(CARG2)\n    |   ldc1 f2, 0(CARG3)\n    |  sltiu TMP0, TMP0, LJ_TISNUM\n    |   sltiu TMP1, TMP1, LJ_TISNUM\n    |    lhu TMP2, OFS_RD(PC)\n    |  and TMP0, TMP0, TMP1\n    |    addiu PC, PC, 4\n    |  beqz TMP0, ->vmeta_comp\n    |.   lui TMP1, (-(BCBIAS_J*4 >> 16) & 65535)\n    |    decode_RD4b TMP2\n    |    addu TMP2, TMP2, TMP1\n    if (op == BC_ISLT || op == BC_ISGE) {\n      |  c.olt.d f0, f2\n    } else {\n      |  c.ole.d f0, f2\n    }\n    if (op == BC_ISLT || op == BC_ISLE) {\n      |  movf TMP2, r0\n    } else {\n      |  movt TMP2, r0\n    }\n    |  addu PC, PC, TMP2\n    |1:\n    |  ins_next\n    break;\n\n  case BC_ISEQV: case BC_ISNEV:\n    vk = op == BC_ISEQV;\n    |  // RA = src1*8, RD = src2*8, JMP with RD = target\n    |  addu RA, BASE, RA\n    |   addiu PC, PC, 4\n    |  lw TMP0, HI(RA)\n    |   ldc1 f0, 0(RA)\n    |  addu RD, BASE, RD\n    |    lhu TMP2, -4+OFS_RD(PC)\n    |   lw TMP1, HI(RD)\n    |   ldc1 f2, 0(RD)\n    |    lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n    |  sltiu AT, TMP0, LJ_TISNUM\n    |  sltiu CARG1, TMP1, LJ_TISNUM\n    |    decode_RD4b TMP2\n    |  and AT, AT, CARG1\n    |  beqz AT, >5\n    |.   addu TMP2, TMP2, TMP3\n    |  c.eq.d f0, f2\n    if (vk) {\n      |  movf TMP2, r0\n    } else {\n      |  movt TMP2, r0\n    }\n    |1:\n    |  addu PC, PC, TMP2\n    |  ins_next\n    |5:  // Either or both types are not numbers.\n    |  lw CARG2, LO(RA)\n    |  lw CARG3, LO(RD)\n    |.if FFI\n    |  li TMP3, LJ_TCDATA\n    |  beq TMP0, TMP3, ->vmeta_equal_cd\n    |.endif\n    |.  sltiu AT, TMP0, LJ_TISPRI\t\t// Not a primitive?\n    |.if FFI\n    |  beq TMP1, TMP3, ->vmeta_equal_cd\n    |.endif\n    |.  xor TMP3, CARG2, CARG3\t\t\t// Same tv?\n    |  xor TMP1, TMP1, TMP0\t\t\t// Same type?\n    |  sltiu CARG1, TMP0, LJ_TISTABUD+1\t\t// Table or userdata?\n    |  movz TMP3, r0, AT\t\t\t// Ignore tv if primitive.\n    |  movn CARG1, r0, TMP1\t\t\t// Tab/ud and same type?\n    |  or AT, TMP1, TMP3\t\t\t// Same type && (pri||same tv).\n    |  movz CARG1, r0, AT\n    |  beqz CARG1, <1\t// Done if not tab/ud or not same type or same tv.\n    if (vk) {\n      |.  movn TMP2, r0, AT\n    } else {\n      |.  movz TMP2, r0, AT\n    }\n    |  // Different tables or userdatas. Need to check __eq metamethod.\n    |  // Field metatable must be at same offset for GCtab and GCudata!\n    |  lw TAB:TMP1, TAB:CARG2->metatable\n    |  beqz TAB:TMP1, <1\t\t// No metatable?\n    |.  nop\n    |  lbu TMP1, TAB:TMP1->nomm\n    |  andi TMP1, TMP1, 1<<MM_eq\n    |  bnez TMP1, <1\t\t\t// Or 'no __eq' flag set?\n    |.  nop\n    |  b ->vmeta_equal\t\t\t// Handle __eq metamethod.\n    |.  li CARG4, 1-vk\t\t\t// ne = 0 or 1.\n    break;\n\n  case BC_ISEQS: case BC_ISNES:\n    vk = op == BC_ISEQS;\n    |  // RA = src*8, RD = str_const*8 (~), JMP with RD = target\n    |  addu RA, BASE, RA\n    |   addiu PC, PC, 4\n    |  lw TMP0, HI(RA)\n    |   srl RD, RD, 1\n    |  lw STR:TMP3, LO(RA)\n    |   subu RD, KBASE, RD\n    |    lhu TMP2, -4+OFS_RD(PC)\n    |.if FFI\n    |  li AT, LJ_TCDATA\n    |  beq TMP0, AT, ->vmeta_equal_cd\n    |.endif\n    |.  lw STR:TMP1, -4(RD)\t\t// KBASE-4-str_const*4\n    |  addiu TMP0, TMP0, -LJ_TSTR\n    |   decode_RD4b TMP2\n    |  xor TMP1, STR:TMP1, STR:TMP3\n    |  or TMP0, TMP0, TMP1\n    |   lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n    |   addu TMP2, TMP2, TMP3\n    if (vk) {\n      |  movn TMP2, r0, TMP0\n    } else {\n      |  movz TMP2, r0, TMP0\n    }\n    |  addu PC, PC, TMP2\n    |  ins_next\n    break;\n\n  case BC_ISEQN: case BC_ISNEN:\n    vk = op == BC_ISEQN;\n    |  // RA = src*8, RD = num_const*8, JMP with RD = target\n    |  addu RA, BASE, RA\n    |   addiu PC, PC, 4\n    |  lw TMP0, HI(RA)\n    |   ldc1 f0, 0(RA)\n    |  addu RD, KBASE, RD\n    |    lhu TMP2, -4+OFS_RD(PC)\n    |   ldc1 f2, 0(RD)\n    |    lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n    |  sltiu AT, TMP0, LJ_TISNUM\n    |    decode_RD4b TMP2\n    |.if FFI\n    |  beqz AT, >5\n    |.else\n    |  beqz AT, >1\n    |.endif\n    |.   addu TMP2, TMP2, TMP3\n    |   c.eq.d f0, f2\n    if (vk) {\n      |  movf TMP2, r0\n      |  addu PC, PC, TMP2\n      |1:\n    } else {\n      |  movt TMP2, r0\n      |1:\n      |  addu PC, PC, TMP2\n    }\n    |  ins_next\n    |.if FFI\n    |5:\n    |  li AT, LJ_TCDATA\n    |  beq TMP0, AT, ->vmeta_equal_cd\n    |.  nop\n    |  b <1\n    |.  nop\n    |.endif\n    break;\n\n  case BC_ISEQP: case BC_ISNEP:\n    vk = op == BC_ISEQP;\n    |  // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target\n    |  addu RA, BASE, RA\n    |   srl TMP1, RD, 3\n    |  lw TMP0, HI(RA)\n    |    lhu TMP2, OFS_RD(PC)\n    |   not TMP1, TMP1\n    |    addiu PC, PC, 4\n    |.if FFI\n    |  li AT, LJ_TCDATA\n    |  beq TMP0, AT, ->vmeta_equal_cd\n    |.endif\n    |.  xor TMP0, TMP0, TMP1\n    |  decode_RD4b TMP2\n    |  lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n    |  addu TMP2, TMP2, TMP3\n    if (vk) {\n      |  movn TMP2, r0, TMP0\n    } else {\n      |  movz TMP2, r0, TMP0\n    }\n    |  addu PC, PC, TMP2\n    |  ins_next\n    break;\n\n  /* -- Unary test and copy ops ------------------------------------------- */\n\n  case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:\n    |  // RA = dst*8 or unused, RD = src*8, JMP with RD = target\n    |  addu RD, BASE, RD\n    |   lhu TMP2, OFS_RD(PC)\n    |  lw TMP0, HI(RD)\n    |   addiu PC, PC, 4\n    if (op == BC_IST || op == BC_ISF) {\n      |  sltiu TMP0, TMP0, LJ_TISTRUECOND\n      |   decode_RD4b TMP2\n      |   lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n      |   addu TMP2, TMP2, TMP3\n      if (op == BC_IST) {\n\t|  movz TMP2, r0, TMP0\n      } else {\n\t|  movn TMP2, r0, TMP0\n      }\n      |  addu PC, PC, TMP2\n    } else {\n      |  sltiu TMP0, TMP0, LJ_TISTRUECOND\n      |  ldc1 f0, 0(RD)\n      if (op == BC_ISTC) {\n\t|  beqz TMP0, >1\n      } else {\n\t|  bnez TMP0, >1\n      }\n      |.  addu RA, BASE, RA\n      |   decode_RD4b TMP2\n      |   lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n      |   addu TMP2, TMP2, TMP3\n      |  sdc1 f0, 0(RA)\n      |   addu PC, PC, TMP2\n      |1:\n    }\n    |  ins_next\n    break;\n\n  /* -- Unary ops --------------------------------------------------------- */\n\n  case BC_MOV:\n    |  // RA = dst*8, RD = src*8\n    |  addu RD, BASE, RD\n    |  addu RA, BASE, RA\n    |  ldc1 f0, 0(RD)\n    |  ins_next1\n    |  sdc1 f0, 0(RA)\n    |  ins_next2\n    break;\n  case BC_NOT:\n    |  // RA = dst*8, RD = src*8\n    |  addu RD, BASE, RD\n    |   addu RA, BASE, RA\n    |  lw TMP0, HI(RD)\n    |   li TMP1, LJ_TFALSE\n    |  sltiu TMP0, TMP0, LJ_TISTRUECOND\n    |  addiu TMP1, TMP0, LJ_TTRUE\n    |  ins_next1\n    |  sw TMP1, HI(RA)\n    |  ins_next2\n    break;\n  case BC_UNM:\n    |  // RA = dst*8, RD = src*8\n    |  addu CARG3, BASE, RD\n    |   addu RA, BASE, RA\n    |  lw TMP0, HI(CARG3)\n    |   ldc1 f0, 0(CARG3)\n    |  sltiu AT, TMP0, LJ_TISNUM\n    |  beqz AT, ->vmeta_unm\n    |.  neg.d f0, f0\n    |  ins_next1\n    |   sdc1 f0, 0(RA)\n    |  ins_next2\n    break;\n  case BC_LEN:\n    |  // RA = dst*8, RD = src*8\n    |  addu CARG2, BASE, RD\n    |   addu RA, BASE, RA\n    |  lw TMP0, HI(CARG2)\n    |   lw CARG1, LO(CARG2)\n    |  li AT, LJ_TSTR\n    |  bne TMP0, AT, >2\n    |.  li AT, LJ_TTAB\n    |  lw CRET1, STR:CARG1->len\n    |1:\n    |  mtc1 CRET1, f0\n    |  cvt.d.w f0, f0\n    |  ins_next1\n    |  sdc1 f0, 0(RA)\n    |  ins_next2\n    |2:\n    |  bne TMP0, AT, ->vmeta_len\n    |.  nop\n#if LJ_52\n    |  lw TAB:TMP2, TAB:CARG1->metatable\n    |  bnez TAB:TMP2, >9\n    |.  nop\n    |3:\n#endif\n    |->BC_LEN_Z:\n    |  load_got lj_tab_len\n    |  call_intern lj_tab_len\t\t// (GCtab *t)\n    |.  nop\n    |  // Returns uint32_t (but less than 2^31).\n    |  b <1\n    |.  nop\n#if LJ_52\n    |9:\n    |  lbu TMP0, TAB:TMP2->nomm\n    |  andi TMP0, TMP0, 1<<MM_len\n    |  bnez TMP0, <3\t\t\t// 'no __len' flag set: done.\n    |.  nop\n    |  b ->vmeta_len\n    |.  nop\n#endif\n    break;\n\n  /* -- Binary ops -------------------------------------------------------- */\n\n    |.macro ins_arithpre\n    ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |   decode_RDtoRC8 RC, RD\n    |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8\n    ||switch (vk) {\n    ||case 0:\n    |   addu CARG3, BASE, RB\n    |    addu CARG4, KBASE, RC\n    |   lw TMP1, HI(CARG3)\n    |   ldc1 f20, 0(CARG3)\n    |    ldc1 f22, 0(CARG4)\n    |   sltiu AT, TMP1, LJ_TISNUM\n    ||  break;\n    ||case 1:\n    |   addu CARG4, BASE, RB\n    |    addu CARG3, KBASE, RC\n    |   lw TMP1, HI(CARG4)\n    |   ldc1 f22, 0(CARG4)\n    |    ldc1 f20, 0(CARG3)\n    |   sltiu AT, TMP1, LJ_TISNUM\n    ||  break;\n    ||default:\n    |   addu CARG3, BASE, RB\n    |    addu CARG4, BASE, RC\n    |   lw TMP1, HI(CARG3)\n    |    lw TMP2, HI(CARG4)\n    |   ldc1 f20, 0(CARG3)\n    |    ldc1 f22, 0(CARG4)\n    |   sltiu AT, TMP1, LJ_TISNUM\n    |   sltiu TMP0, TMP2, LJ_TISNUM\n    |   and AT, AT, TMP0\n    ||  break;\n    ||}\n    |  beqz AT, ->vmeta_arith\n    |.  addu RA, BASE, RA\n    |.endmacro\n    |\n    |.macro fpmod, a, b, c\n    |->BC_MODVN_Z:\n    |  bal ->vm_floor\t\t\t// floor(b/c)\n    |.  div.d FARG1, b, c\n    |  mul.d a, FRET1, c\n    |  sub.d a, b, a\t\t\t// b - floor(b/c)*c\n    |.endmacro\n    |\n    |.macro ins_arith, ins\n    |  ins_arithpre\n    |.if \"ins\" == \"fpmod_\"\n    |  b ->BC_MODVN_Z\t\t\t// Avoid 3 copies. It's slow anyway.\n    |.  nop\n    |.else\n    |  ins f0, f20, f22\n    |  ins_next1\n    |  sdc1 f0, 0(RA)\n    |  ins_next2\n    |.endif\n    |.endmacro\n\n  case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:\n    |  ins_arith add.d\n    break;\n  case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:\n    |  ins_arith sub.d\n    break;\n  case BC_MULVN: case BC_MULNV: case BC_MULVV:\n    |  ins_arith mul.d\n    break;\n  case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:\n    |  ins_arith div.d\n    break;\n  case BC_MODVN:\n    |  ins_arith fpmod\n    break;\n  case BC_MODNV: case BC_MODVV:\n    |  ins_arith fpmod_\n    break;\n  case BC_POW:\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |   decode_RDtoRC8 RC, RD\n    |  addu CARG3, BASE, RB\n    |   addu CARG4, BASE, RC\n    |  lw TMP1, HI(CARG3)\n    |   lw TMP2, HI(CARG4)\n    |  ldc1 FARG1, 0(CARG3)\n    |   ldc1 FARG2, 0(CARG4)\n    |  sltiu AT, TMP1, LJ_TISNUM\n    |  sltiu TMP0, TMP2, LJ_TISNUM\n    |  and AT, AT, TMP0\n    |  load_got pow\n    |  beqz AT, ->vmeta_arith\n    |.  addu RA, BASE, RA\n    |  call_extern\n    |.  nop\n    |  ins_next1\n    |  sdc1 FRET1, 0(RA)\n    |  ins_next2\n    break;\n\n  case BC_CAT:\n    |  // RA = dst*8, RB = src_start*8, RC = src_end*8\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |   decode_RDtoRC8 RC, RD\n    |  subu CARG3, RC, RB\n    |   sw BASE, L->base\n    |  addu CARG2, BASE, RC\n    |  move MULTRES, RB\n    |->BC_CAT_Z:\n    |  load_got lj_meta_cat\n    |  srl CARG3, CARG3, 3\n    |   sw PC, SAVE_PC\n    |  call_intern lj_meta_cat\t\t// (lua_State *L, TValue *top, int left)\n    |.  move CARG1, L\n    |  // Returns NULL (finished) or TValue * (metamethod).\n    |  bnez CRET1, ->vmeta_binop\n    |.  lw BASE, L->base\n    |  addu RB, BASE, MULTRES\n    |  ldc1 f0, 0(RB)\n    |   addu RA, BASE, RA\n    |  ins_next1\n    |   sdc1 f0, 0(RA)\t\t\t// Copy result from RB to RA.\n    |  ins_next2\n    break;\n\n  /* -- Constant ops ------------------------------------------------------ */\n\n  case BC_KSTR:\n    |  // RA = dst*8, RD = str_const*8 (~)\n    |  srl TMP1, RD, 1\n    |  subu TMP1, KBASE, TMP1\n    |  ins_next1\n    |  lw TMP0, -4(TMP1)\t\t// KBASE-4-str_const*4\n    |  addu RA, BASE, RA\n    |   li TMP2, LJ_TSTR\n    |  sw TMP0, LO(RA)\n    |   sw TMP2, HI(RA)\n    |  ins_next2\n    break;\n  case BC_KCDATA:\n    |.if FFI\n    |  // RA = dst*8, RD = cdata_const*8 (~)\n    |  srl TMP1, RD, 1\n    |  subu TMP1, KBASE, TMP1\n    |  ins_next1\n    |  lw TMP0, -4(TMP1)\t\t// KBASE-4-cdata_const*4\n    |  addu RA, BASE, RA\n    |   li TMP2, LJ_TCDATA\n    |  sw TMP0, LO(RA)\n    |   sw TMP2, HI(RA)\n    |  ins_next2\n    |.endif\n    break;\n  case BC_KSHORT:\n    |  // RA = dst*8, RD = int16_literal*8\n    |  sra RD, INS, 16\n    |  mtc1 RD, f0\n    |  addu RA, BASE, RA\n    |  cvt.d.w f0, f0\n    |  ins_next1\n    |  sdc1 f0, 0(RA)\n    |  ins_next2\n    break;\n  case BC_KNUM:\n    |  // RA = dst*8, RD = num_const*8\n    |  addu RD, KBASE, RD\n    |   addu RA, BASE, RA\n    |  ldc1 f0, 0(RD)\n    |  ins_next1\n    |   sdc1 f0, 0(RA)\n    |  ins_next2\n    break;\n  case BC_KPRI:\n    |  // RA = dst*8, RD = primitive_type*8 (~)\n    |  srl TMP1, RD, 3\n    |   addu RA, BASE, RA\n    |  not TMP0, TMP1\n    |  ins_next1\n    |   sw TMP0, HI(RA)\n    |  ins_next2\n    break;\n  case BC_KNIL:\n    |  // RA = base*8, RD = end*8\n    |  addu RA, BASE, RA\n    |  sw TISNIL, HI(RA)\n    |   addiu RA, RA, 8\n    |  addu RD, BASE, RD\n    |1:\n    |  sw TISNIL, HI(RA)\n    |  slt AT, RA, RD\n    |  bnez AT, <1\n    |.  addiu RA, RA, 8\n    |  ins_next_\n    break;\n\n  /* -- Upvalue and function ops ------------------------------------------ */\n\n  case BC_UGET:\n    |  // RA = dst*8, RD = uvnum*8\n    |  lw LFUNC:RB, FRAME_FUNC(BASE)\n    |   srl RD, RD, 1\n    |   addu RD, RD, LFUNC:RB\n    |  lw UPVAL:RB, LFUNC:RD->uvptr\n    |  ins_next1\n    |  lw TMP1, UPVAL:RB->v\n    |  ldc1 f0, 0(TMP1)\n    |  addu RA, BASE, RA\n    |  sdc1 f0, 0(RA)\n    |  ins_next2\n    break;\n  case BC_USETV:\n    |  // RA = uvnum*8, RD = src*8\n    |  lw LFUNC:RB, FRAME_FUNC(BASE)\n    |    srl RA, RA, 1\n    |   addu RD, BASE, RD\n    |    addu RA, RA, LFUNC:RB\n    |   ldc1 f0, 0(RD)\n    |  lw UPVAL:RB, LFUNC:RA->uvptr\n    |  lbu TMP3, UPVAL:RB->marked\n    |   lw CARG2, UPVAL:RB->v\n    |  andi TMP3, TMP3, LJ_GC_BLACK\t// isblack(uv)\n    |  lbu TMP0, UPVAL:RB->closed\n    |   lw TMP2, HI(RD)\n    |   sdc1 f0, 0(CARG2)\n    |  li AT, LJ_GC_BLACK|1\n    |  or TMP3, TMP3, TMP0\n    |  beq TMP3, AT, >2\t\t\t// Upvalue is closed and black?\n    |.  addiu TMP2, TMP2, -(LJ_TISNUM+1)\n    |1:\n    |  ins_next\n    |\n    |2:  // Check if new value is collectable.\n    |  sltiu AT, TMP2, LJ_TISGCV - (LJ_TISNUM+1)\n    |  beqz AT, <1\t\t\t// tvisgcv(v)\n    |.  lw TMP1, LO(RD)\n    |  lbu TMP3, GCOBJ:TMP1->gch.marked\n    |  andi TMP3, TMP3, LJ_GC_WHITES\t// iswhite(v)\n    |  beqz TMP3, <1\n    |.  load_got lj_gc_barrieruv\n    |  // Crossed a write barrier. Move the barrier forward.\n    |  call_intern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |.  addiu CARG1, DISPATCH, GG_DISP2G\n    |  b <1\n    |.  nop\n    break;\n  case BC_USETS:\n    |  // RA = uvnum*8, RD = str_const*8 (~)\n    |  lw LFUNC:RB, FRAME_FUNC(BASE)\n    |    srl RA, RA, 1\n    |   srl TMP1, RD, 1\n    |    addu RA, RA, LFUNC:RB\n    |   subu TMP1, KBASE, TMP1\n    |  lw UPVAL:RB, LFUNC:RA->uvptr\n    |   lw STR:TMP1, -4(TMP1)\t\t// KBASE-4-str_const*4\n    |  lbu TMP2, UPVAL:RB->marked\n    |   lw CARG2, UPVAL:RB->v\n    |   lbu TMP3, STR:TMP1->marked\n    |  andi AT, TMP2, LJ_GC_BLACK\t// isblack(uv)\n    |   lbu TMP2, UPVAL:RB->closed\n    |   li TMP0, LJ_TSTR\n    |   sw STR:TMP1, LO(CARG2)\n    |  bnez AT, >2\n    |.  sw TMP0, HI(CARG2)\n    |1:\n    |  ins_next\n    |\n    |2:  // Check if string is white and ensure upvalue is closed.\n    |  beqz TMP2, <1\n    |.  andi AT, TMP3, LJ_GC_WHITES\t// iswhite(str)\n    |  beqz AT, <1\n    |.  load_got lj_gc_barrieruv\n    |  // Crossed a write barrier. Move the barrier forward.\n    |  call_intern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |.  addiu CARG1, DISPATCH, GG_DISP2G\n    |  b <1\n    |.  nop\n    break;\n  case BC_USETN:\n    |  // RA = uvnum*8, RD = num_const*8\n    |  lw LFUNC:RB, FRAME_FUNC(BASE)\n    |   srl RA, RA, 1\n    |    addu RD, KBASE, RD\n    |   addu RA, RA, LFUNC:RB\n    |    ldc1 f0, 0(RD)\n    |  lw UPVAL:RB, LFUNC:RA->uvptr\n    |  ins_next1\n    |  lw TMP1, UPVAL:RB->v\n    |  sdc1 f0, 0(TMP1)\n    |  ins_next2\n    break;\n  case BC_USETP:\n    |  // RA = uvnum*8, RD = primitive_type*8 (~)\n    |  lw LFUNC:RB, FRAME_FUNC(BASE)\n    |   srl RA, RA, 1\n    |    srl TMP0, RD, 3\n    |   addu RA, RA, LFUNC:RB\n    |    not TMP0, TMP0\n    |  lw UPVAL:RB, LFUNC:RA->uvptr\n    |  ins_next1\n    |  lw TMP1, UPVAL:RB->v\n    |  sw TMP0, HI(TMP1)\n    |  ins_next2\n    break;\n\n  case BC_UCLO:\n    |  // RA = level*8, RD = target\n    |  lw TMP2, L->openupval\n    |  branch_RD\t\t\t// Do this first since RD is not saved.\n    |  load_got lj_func_closeuv\n    |   sw BASE, L->base\n    |  beqz TMP2, >1\n    |.  move CARG1, L\n    |  call_intern lj_func_closeuv\t// (lua_State *L, TValue *level)\n    |.  addu CARG2, BASE, RA\n    |  lw BASE, L->base\n    |1:\n    |  ins_next\n    break;\n\n  case BC_FNEW:\n    |  // RA = dst*8, RD = proto_const*8 (~) (holding function prototype)\n    |  srl TMP1, RD, 1\n    |  load_got lj_func_newL_gc\n    |  subu TMP1, KBASE, TMP1\n    |  lw CARG3, FRAME_FUNC(BASE)\n    |  lw CARG2, -4(TMP1)\t\t// KBASE-4-tab_const*4\n    |   sw BASE, L->base\n    |   sw PC, SAVE_PC\n    |  // (lua_State *L, GCproto *pt, GCfuncL *parent)\n    |  call_intern lj_func_newL_gc\n    |.  move CARG1, L\n    |  // Returns GCfuncL *.\n    |  lw BASE, L->base\n    |   li TMP0, LJ_TFUNC\n    |  ins_next1\n    |  addu RA, BASE, RA\n    |  sw TMP0, HI(RA)\n    |  sw LFUNC:CRET1, LO(RA)\n    |  ins_next2\n    break;\n\n  /* -- Table ops --------------------------------------------------------- */\n\n  case BC_TNEW:\n  case BC_TDUP:\n    |  // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~)\n    |  lw TMP0, DISPATCH_GL(gc.total)(DISPATCH)\n    |  lw TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)\n    |   sw BASE, L->base\n    |   sw PC, SAVE_PC\n    |  sltu AT, TMP0, TMP1\n    |  beqz AT, >5\n    |1:\n    if (op == BC_TNEW) {\n      |  load_got lj_tab_new\n      |  srl CARG2, RD, 3\n      |  andi CARG2, CARG2, 0x7ff\n      |  li TMP0, 0x801\n      |  addiu AT, CARG2, -0x7ff\n      |   srl CARG3, RD, 14\n      |  movz CARG2, TMP0, AT\n      |  // (lua_State *L, int32_t asize, uint32_t hbits)\n      |  call_intern lj_tab_new\n      |.  move CARG1, L\n      |  // Returns Table *.\n    } else {\n      |  load_got lj_tab_dup\n      |  srl TMP1, RD, 1\n      |  subu TMP1, KBASE, TMP1\n      |  move CARG1, L\n      |  call_intern lj_tab_dup\t\t// (lua_State *L, Table *kt)\n      |.  lw CARG2, -4(TMP1)\t\t// KBASE-4-str_const*4\n      |  // Returns Table *.\n    }\n    |  lw BASE, L->base\n    |  ins_next1\n    |  addu RA, BASE, RA\n    |   li TMP0, LJ_TTAB\n    |  sw TAB:CRET1, LO(RA)\n    |   sw TMP0, HI(RA)\n    |  ins_next2\n    |5:\n    |  load_got lj_gc_step_fixtop\n    |  move MULTRES, RD\n    |  call_intern lj_gc_step_fixtop\t// (lua_State *L)\n    |.  move CARG1, L\n    |  b <1\n    |.  move RD, MULTRES\n    break;\n\n  case BC_GGET:\n    |  // RA = dst*8, RD = str_const*8 (~)\n  case BC_GSET:\n    |  // RA = src*8, RD = str_const*8 (~)\n    |  lw LFUNC:TMP2, FRAME_FUNC(BASE)\n    |   srl TMP1, RD, 1\n    |   subu TMP1, KBASE, TMP1\n    |  lw TAB:RB, LFUNC:TMP2->env\n    |  lw STR:RC, -4(TMP1)\t\t// KBASE-4-str_const*4\n    if (op == BC_GGET) {\n      |  b ->BC_TGETS_Z\n    } else {\n      |  b ->BC_TSETS_Z\n    }\n    |.  addu RA, BASE, RA\n    break;\n\n  case BC_TGETV:\n    |  // RA = dst*8, RB = table*8, RC = key*8\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |   decode_RDtoRC8 RC, RD\n    |  addu CARG2, BASE, RB\n    |   addu CARG3, BASE, RC\n    |  lw TMP1, HI(CARG2)\n    |   lw TMP2, HI(CARG3)\n    |    lw TAB:RB, LO(CARG2)\n    |  li AT, LJ_TTAB\n    |   ldc1 f0, 0(CARG3)\n    |  bne TMP1, AT, ->vmeta_tgetv\n    |.  addu RA, BASE, RA\n    |  sltiu AT, TMP2, LJ_TISNUM\n    |  beqz AT, >5\n    |.  li AT, LJ_TSTR\n    |\n    |  // Convert number key to integer, check for integerness and range.\n    |  cvt.w.d f2, f0\n    |   lw TMP0, TAB:RB->asize\n    |  mfc1 TMP2, f2\n    |  cvt.d.w f4, f2\n    |   lw TMP1, TAB:RB->array\n    |  c.eq.d f0, f4\n    |  sltu AT, TMP2, TMP0\n    |  movf AT, r0\n    |   sll TMP2, TMP2, 3\n    |  beqz AT, ->vmeta_tgetv\t\t// Integer key and in array part?\n    |.  addu TMP2, TMP1, TMP2\n    |  lw TMP0, HI(TMP2)\n    |  beq TMP0, TISNIL, >2\n    |.  ldc1 f0, 0(TMP2)\n    |1:\n    |  ins_next1\n    |   sdc1 f0, 0(RA)\n    |  ins_next2\n    |\n    |2:  // Check for __index if table value is nil.\n    |  lw TAB:TMP2, TAB:RB->metatable\n    |  beqz TAB:TMP2, <1\t\t// No metatable: done.\n    |.  nop\n    |  lbu TMP0, TAB:TMP2->nomm\n    |  andi TMP0, TMP0, 1<<MM_index\n    |  bnez TMP0, <1\t\t\t// 'no __index' flag set: done.\n    |.  nop\n    |  b ->vmeta_tgetv\n    |.  nop\n    |\n    |5:\n    |  bne TMP2, AT, ->vmeta_tgetv\n    |.  lw STR:RC, LO(CARG3)\n    |  b ->BC_TGETS_Z\t\t\t// String key?\n    |.  nop\n    break;\n  case BC_TGETS:\n    |  // RA = dst*8, RB = table*8, RC = str_const*4 (~)\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |  addu CARG2, BASE, RB\n    |   decode_RC4a RC, INS\n    |  lw TMP0, HI(CARG2)\n    |   decode_RC4b RC\n    |  li AT, LJ_TTAB\n    |   lw TAB:RB, LO(CARG2)\n    |   subu CARG3, KBASE, RC\n    |   lw STR:RC, -4(CARG3)\t\t// KBASE-4-str_const*4\n    |  bne TMP0, AT, ->vmeta_tgets1\n    |.  addu RA, BASE, RA\n    |->BC_TGETS_Z:\n    |  // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8\n    |  lw TMP0, TAB:RB->hmask\n    |  lw TMP1, STR:RC->hash\n    |  lw NODE:TMP2, TAB:RB->node\n    |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n    |  sll TMP0, TMP1, 5\n    |  sll TMP1, TMP1, 3\n    |  subu TMP1, TMP0, TMP1\n    |  addu NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n    |1:\n    |  lw CARG1, offsetof(Node, key)+HI(NODE:TMP2)\n    |   lw TMP0, offsetof(Node, key)+LO(NODE:TMP2)\n    |    lw NODE:TMP1, NODE:TMP2->next\n    |    lw CARG2, offsetof(Node, val)+HI(NODE:TMP2)\n    |  addiu CARG1, CARG1, -LJ_TSTR\n    |   xor TMP0, TMP0, STR:RC\n    |  or AT, CARG1, TMP0\n    |  bnez AT, >4\n    |.  lw TAB:TMP3, TAB:RB->metatable\n    |    beq CARG2, TISNIL, >5\t\t// Key found, but nil value?\n    |.    lw CARG1, offsetof(Node, val)+LO(NODE:TMP2)\n    |3:\n    |  ins_next1\n    |    sw CARG2, HI(RA)\n    |     sw CARG1, LO(RA)\n    |  ins_next2\n    |\n    |4:  // Follow hash chain.\n    |  bnez NODE:TMP1, <1\n    |.  move NODE:TMP2, NODE:TMP1\n    |  // End of hash chain: key not found, nil result.\n    |\n    |5:  // Check for __index if table value is nil.\n    |  beqz TAB:TMP3, <3\t\t// No metatable: done.\n    |.  li CARG2, LJ_TNIL\n    |  lbu TMP0, TAB:TMP3->nomm\n    |  andi TMP0, TMP0, 1<<MM_index\n    |  bnez TMP0, <3\t\t\t// 'no __index' flag set: done.\n    |.  nop\n    |  b ->vmeta_tgets\n    |.  nop\n    break;\n  case BC_TGETB:\n    |  // RA = dst*8, RB = table*8, RC = index*8\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |  addu CARG2, BASE, RB\n    |   decode_RDtoRC8 RC, RD\n    |  lw CARG1, HI(CARG2)\n    |  li AT, LJ_TTAB\n    |   lw TAB:RB, LO(CARG2)\n    |   addu RA, BASE, RA\n    |  bne CARG1, AT, ->vmeta_tgetb\n    |.  srl TMP0, RC, 3\n    |  lw TMP1, TAB:RB->asize\n    |   lw TMP2, TAB:RB->array\n    |  sltu AT, TMP0, TMP1\n    |  beqz AT, ->vmeta_tgetb\n    |.  addu RC, TMP2, RC\n    |  lw TMP1, HI(RC)\n    |  beq TMP1, TISNIL, >5\n    |.  ldc1 f0, 0(RC)\n    |1:\n    |  ins_next1\n    |   sdc1 f0, 0(RA)\n    |  ins_next2\n    |\n    |5:  // Check for __index if table value is nil.\n    |  lw TAB:TMP2, TAB:RB->metatable\n    |  beqz TAB:TMP2, <1\t\t// No metatable: done.\n    |.  nop\n    |  lbu TMP1, TAB:TMP2->nomm\n    |  andi TMP1, TMP1, 1<<MM_index\n    |  bnez TMP1, <1\t\t\t// 'no __index' flag set: done.\n    |.  nop\n    |  b ->vmeta_tgetb\t\t\t// Caveat: preserve TMP0!\n    |.  nop\n    break;\n\n  case BC_TSETV:\n    |  // RA = src*8, RB = table*8, RC = key*8\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |   decode_RDtoRC8 RC, RD\n    |  addu CARG2, BASE, RB\n    |   addu CARG3, BASE, RC\n    |  lw TMP1, HI(CARG2)\n    |   lw TMP2, HI(CARG3)\n    |    lw TAB:RB, LO(CARG2)\n    |  li AT, LJ_TTAB\n    |   ldc1 f0, 0(CARG3)\n    |  bne TMP1, AT, ->vmeta_tsetv\n    |.  addu RA, BASE, RA\n    |  sltiu AT, TMP2, LJ_TISNUM\n    |  beqz AT, >5\n    |.  li AT, LJ_TSTR\n    |\n    |  // Convert number key to integer, check for integerness and range.\n    |  cvt.w.d f2, f0\n    |   lw TMP0, TAB:RB->asize\n    |  mfc1 TMP2, f2\n    |  cvt.d.w f4, f2\n    |   lw TMP1, TAB:RB->array\n    |  c.eq.d f0, f4\n    |  sltu AT, TMP2, TMP0\n    |  movf AT, r0\n    |   sll TMP2, TMP2, 3\n    |  beqz AT, ->vmeta_tsetv\t\t// Integer key and in array part?\n    |.  addu TMP1, TMP1, TMP2\n    |   lbu TMP3, TAB:RB->marked\n    |  lw TMP0, HI(TMP1)\n    |  beq TMP0, TISNIL, >3\n    |.  ldc1 f0, 0(RA)\n    |1:\n    |   andi AT, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |   bnez AT, >7\n    |.  sdc1 f0, 0(TMP1)\n    |2:\n    |  ins_next\n    |\n    |3:  // Check for __newindex if previous value is nil.\n    |  lw TAB:TMP2, TAB:RB->metatable\n    |  beqz TAB:TMP2, <1\t\t// No metatable: done.\n    |.  nop\n    |  lbu TMP2, TAB:TMP2->nomm\n    |  andi TMP2, TMP2, 1<<MM_newindex\n    |  bnez TMP2, <1\t\t\t// 'no __newindex' flag set: done.\n    |.  nop\n    |  b ->vmeta_tsetv\n    |.  nop\n    |\n    |5:\n    |  bne TMP2, AT, ->vmeta_tsetv\n    |.  lw STR:RC, LO(CARG3)\n    |  b ->BC_TSETS_Z\t\t\t// String key?\n    |.  nop\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0, <2\n    break;\n  case BC_TSETS:\n    |  // RA = src*8, RB = table*8, RC = str_const*8 (~)\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |  addu CARG2, BASE, RB\n    |   decode_RC4a RC, INS\n    |  lw TMP0, HI(CARG2)\n    |   decode_RC4b RC\n    |  li AT, LJ_TTAB\n    |   subu CARG3, KBASE, RC\n    |    lw TAB:RB, LO(CARG2)\n    |   lw STR:RC, -4(CARG3)\t\t// KBASE-4-str_const*4\n    |  bne TMP0, AT, ->vmeta_tsets1\n    |.  addu RA, BASE, RA\n    |->BC_TSETS_Z:\n    |  // TAB:RB = GCtab *, STR:RC = GCstr *, RA = BASE+src*8\n    |  lw TMP0, TAB:RB->hmask\n    |  lw TMP1, STR:RC->hash\n    |  lw NODE:TMP2, TAB:RB->node\n    |   sb r0, TAB:RB->nomm\t\t// Clear metamethod cache.\n    |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n    |  sll TMP0, TMP1, 5\n    |  sll TMP1, TMP1, 3\n    |  subu TMP1, TMP0, TMP1\n    |  addu NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n    |   ldc1 f20, 0(RA)\n    |1:\n    |  lw CARG1, offsetof(Node, key)+HI(NODE:TMP2)\n    |   lw TMP0, offsetof(Node, key)+LO(NODE:TMP2)\n    |  li AT, LJ_TSTR\n    |    lw NODE:TMP1, NODE:TMP2->next\n    |  bne CARG1, AT, >5\n    |.   lw CARG2, offsetof(Node, val)+HI(NODE:TMP2)\n    |   bne TMP0, STR:RC, >5\n    |.    lbu TMP3, TAB:RB->marked\n    |    beq CARG2, TISNIL, >4\t\t// Key found, but nil value?\n    |.    lw TAB:TMP0, TAB:RB->metatable\n    |2:\n    |  andi AT, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |  bnez AT, >7\n    |.  sdc1 f20, NODE:TMP2->val\n    |3:\n    |  ins_next\n    |\n    |4:  // Check for __newindex if previous value is nil.\n    |  beqz TAB:TMP0, <2\t\t// No metatable: done.\n    |.  nop\n    |  lbu TMP0, TAB:TMP0->nomm\n    |  andi TMP0, TMP0, 1<<MM_newindex\n    |  bnez TMP0, <2\t\t\t// 'no __newindex' flag set: done.\n    |.  nop\n    |  b ->vmeta_tsets\n    |.  nop\n    |\n    |5:  // Follow hash chain.\n    |  bnez NODE:TMP1, <1\n    |.  move NODE:TMP2, NODE:TMP1\n    |  // End of hash chain: key not found, add a new one\n    |\n    |  // But check for __newindex first.\n    |  lw TAB:TMP2, TAB:RB->metatable\n    |  beqz TAB:TMP2, >6\t\t// No metatable: continue.\n    |.  addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)\n    |  lbu TMP0, TAB:TMP2->nomm\n    |  andi TMP0, TMP0, 1<<MM_newindex\n    |  beqz TMP0, ->vmeta_tsets\t\t// 'no __newindex' flag NOT set: check.\n    |.  li AT, LJ_TSTR\n    |6:\n    |  load_got lj_tab_newkey\n    |  sw STR:RC, LO(CARG3)\n    |  sw AT, HI(CARG3)\n    |   sw BASE, L->base\n    |  move CARG2, TAB:RB\n    |   sw PC, SAVE_PC\n    |  call_intern lj_tab_newkey\t// (lua_State *L, GCtab *t, TValue *k\n    |.  move CARG1, L\n    |  // Returns TValue *.\n    |  lw BASE, L->base\n    |  b <3\t\t\t\t// No 2nd write barrier needed.\n    |.  sdc1 f20, 0(CRET1)\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0, <3\n    break;\n  case BC_TSETB:\n    |  // RA = src*8, RB = table*8, RC = index*8\n    |  decode_RB8a RB, INS\n    |  decode_RB8b RB\n    |  addu CARG2, BASE, RB\n    |   decode_RDtoRC8 RC, RD\n    |  lw CARG1, HI(CARG2)\n    |  li AT, LJ_TTAB\n    |   lw TAB:RB, LO(CARG2)\n    |   addu RA, BASE, RA\n    |  bne CARG1, AT, ->vmeta_tsetb\n    |.  srl TMP0, RC, 3\n    |  lw TMP1, TAB:RB->asize\n    |   lw TMP2, TAB:RB->array\n    |  sltu AT, TMP0, TMP1\n    |  beqz AT, ->vmeta_tsetb\n    |.  addu RC, TMP2, RC\n    |  lw TMP1, HI(RC)\n    |   lbu TMP3, TAB:RB->marked\n    |  beq TMP1, TISNIL, >5\n    |.  ldc1 f0, 0(RA)\n    |1:\n    |  andi AT, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |  bnez AT, >7\n    |.  sdc1 f0, 0(RC)\n    |2:\n    |  ins_next\n    |\n    |5:  // Check for __newindex if previous value is nil.\n    |  lw TAB:TMP2, TAB:RB->metatable\n    |  beqz TAB:TMP2, <1\t\t// No metatable: done.\n    |.  nop\n    |  lbu TMP1, TAB:TMP2->nomm\n    |  andi TMP1, TMP1, 1<<MM_newindex\n    |  bnez TMP1, <1\t\t\t// 'no __newindex' flag set: done.\n    |.  nop\n    |  b ->vmeta_tsetb\t\t\t// Caveat: preserve TMP0!\n    |.  nop\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0, <2\n    break;\n\n  case BC_TSETM:\n    |  // RA = base*8 (table at base-1), RD = num_const*8 (start index)\n    |  addu RA, BASE, RA\n    |1:\n    |   addu TMP3, KBASE, RD\n    |  lw TAB:CARG2, -8+LO(RA)\t\t// Guaranteed to be a table.\n    |    addiu TMP0, MULTRES, -8\n    |   lw TMP3, LO(TMP3)\t\t// Integer constant is in lo-word.\n    |    beqz TMP0, >4\t\t\t// Nothing to copy?\n    |.    srl CARG3, TMP0, 3\n    |  addu CARG3, CARG3, TMP3\n    |  lw TMP2, TAB:CARG2->asize\n    |   sll TMP1, TMP3, 3\n    |    lbu TMP3, TAB:CARG2->marked\n    |   lw CARG1, TAB:CARG2->array\n    |  sltu AT, TMP2, CARG3\n    |  bnez AT, >5\n    |.  addu TMP2, RA, TMP0\n    |   addu TMP1, TMP1, CARG1\n    |  andi TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |3:  // Copy result slots to table.\n    |   ldc1 f0, 0(RA)\n    |    addiu RA, RA, 8\n    |  sltu AT, RA, TMP2\n    |   sdc1 f0, 0(TMP1)\n    |  bnez AT, <3\n    |.   addiu TMP1, TMP1, 8\n    |  bnez TMP0, >7\n    |. nop\n    |4:\n    |  ins_next\n    |\n    |5:  // Need to resize array part.\n    |  load_got lj_tab_reasize\n    |   sw BASE, L->base\n    |   sw PC, SAVE_PC\n    |  move BASE, RD\n    |  call_intern lj_tab_reasize\t// (lua_State *L, GCtab *t, int nasize)\n    |.  move CARG1, L\n    |  // Must not reallocate the stack.\n    |  move RD, BASE\n    |  b <1\n    |.  lw BASE, L->base\t// Reload BASE for lack of a saved register.\n    |\n    |7:  // Possible table write barrier for any value. Skip valiswhite check.\n    |  barrierback TAB:CARG2, TMP3, TMP0, <4\n    break;\n\n  /* -- Calls and vararg handling ----------------------------------------- */\n\n  case BC_CALLM:\n    |  // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8\n    |  decode_RDtoRC8 NARGS8:RC, RD\n    |  b ->BC_CALL_Z\n    |.  addu NARGS8:RC, NARGS8:RC, MULTRES\n    break;\n  case BC_CALL:\n    |  // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8\n    |  decode_RDtoRC8 NARGS8:RC, RD\n    |->BC_CALL_Z:\n    |  move TMP2, BASE\n    |  addu BASE, BASE, RA\n    |   li AT, LJ_TFUNC\n    |  lw TMP0, HI(BASE)\n    |   lw LFUNC:RB, LO(BASE)\n    |   addiu BASE, BASE, 8\n    |  bne TMP0, AT, ->vmeta_call\n    |.  addiu NARGS8:RC, NARGS8:RC, -8\n    |  ins_call\n    break;\n\n  case BC_CALLMT:\n    |  // RA = base*8, (RB = 0,) RC = extra_nargs*8\n    |  addu NARGS8:RD, NARGS8:RD, MULTRES\t// BC_CALLT gets RC from RD.\n    |  // Fall through. Assumes BC_CALLT follows.\n    break;\n  case BC_CALLT:\n    |  // RA = base*8, (RB = 0,) RC = (nargs+1)*8\n    |  addu RA, BASE, RA\n    |   li AT, LJ_TFUNC\n    |  lw TMP0, HI(RA)\n    |   lw LFUNC:RB, LO(RA)\n    |   move NARGS8:RC, RD\n    |    lw TMP1, FRAME_PC(BASE)\n    |   addiu RA, RA, 8\n    |  bne TMP0, AT, ->vmeta_callt\n    |.  addiu NARGS8:RC, NARGS8:RC, -8\n    |->BC_CALLT_Z:\n    |  andi TMP0, TMP1, FRAME_TYPE\t// Caveat: preserve TMP0 until the 'or'.\n    |   lbu TMP3, LFUNC:RB->ffid\n    |  bnez TMP0, >7\n    |.  xori TMP2, TMP1, FRAME_VARG\n    |1:\n    |  sw LFUNC:RB, FRAME_FUNC(BASE)\t// Copy function down, but keep PC.\n    |  sltiu AT, TMP3, 2\t\t// (> FF_C) Calling a fast function?\n    |  move TMP2, BASE\n    |  beqz NARGS8:RC, >3\n    |.  move TMP3, NARGS8:RC\n    |2:\n    |   ldc1 f0, 0(RA)\n    |    addiu RA, RA, 8\n    |  addiu TMP3, TMP3, -8\n    |   sdc1 f0, 0(TMP2)\n    |  bnez TMP3, <2\n    |.   addiu TMP2, TMP2, 8\n    |3:\n    |  or TMP0, TMP0, AT\n    |  beqz TMP0, >5\n    |.  nop\n    |4:\n    |  ins_callt\n    |\n    |5:  // Tailcall to a fast function with a Lua frame below.\n    |  lw INS, -4(TMP1)\n    |  decode_RA8a RA, INS\n    |  decode_RA8b RA\n    |  subu TMP1, BASE, RA\n    |  lw LFUNC:TMP1, -8+FRAME_FUNC(TMP1)\n    |  lw TMP1, LFUNC:TMP1->pc\n    |  b <4\n    |.  lw KBASE, PC2PROTO(k)(TMP1)\t// Need to prepare KBASE.\n    |\n    |7:  // Tailcall from a vararg function.\n    |  andi AT, TMP2, FRAME_TYPEP\n    |  bnez AT, <1\t\t\t// Vararg frame below?\n    |.  subu TMP2, BASE, TMP2\t\t// Relocate BASE down.\n    |  move BASE, TMP2\n    |  lw TMP1, FRAME_PC(TMP2)\n    |  b <1\n    |.  andi TMP0, TMP1, FRAME_TYPE\n    break;\n\n  case BC_ITERC:\n    |  // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 ((2+1)*8))\n    |  move TMP2, BASE\n    |  addu BASE, BASE, RA\n    |   li AT, LJ_TFUNC\n    |  lw TMP1, -24+HI(BASE)\n    |   lw LFUNC:RB, -24+LO(BASE)\n    |    ldc1 f2, -8(BASE)\n    |    ldc1 f0, -16(BASE)\n    |  sw TMP1, HI(BASE)\t\t// Copy callable.\n    |   sw LFUNC:RB, LO(BASE)\n    |    sdc1 f2, 16(BASE)\t\t// Copy control var.\n    |    sdc1 f0, 8(BASE)\t\t// Copy state.\n    |   addiu BASE, BASE, 8\n    |  bne TMP1, AT, ->vmeta_call\n    |.  li NARGS8:RC, 16\t\t// Iterators get 2 arguments.\n    |  ins_call\n    break;\n\n  case BC_ITERN:\n    |  // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8)\n    |.if JIT\n    |  // NYI: add hotloop, record BC_ITERN.\n    |.endif\n    |  addu RA, BASE, RA\n    |  lw TAB:RB, -16+LO(RA)\n    |  lw RC, -8+LO(RA)\t\t\t// Get index from control var.\n    |  lw TMP0, TAB:RB->asize\n    |  lw TMP1, TAB:RB->array\n    |   addiu PC, PC, 4\n    |1:  // Traverse array part.\n    |  sltu AT, RC, TMP0\n    |  beqz AT, >5\t\t\t// Index points after array part?\n    |.  sll TMP3, RC, 3\n    |  addu TMP3, TMP1, TMP3\n    |  lw TMP2, HI(TMP3)\n    |   ldc1 f0, 0(TMP3)\n    |    mtc1 RC, f2\n    |     lhu RD, -4+OFS_RD(PC)\n    |  beq TMP2, TISNIL, <1\t\t// Skip holes in array part.\n    |.  addiu RC, RC, 1\n    |    cvt.d.w f2, f2\n    |     lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n    |   sdc1 f0, 8(RA)\n    |     decode_RD4b RD\n    |     addu RD, RD, TMP3\n    |   sw RC, -8+LO(RA)\t\t// Update control var.\n    |     addu PC, PC, RD\n    |    sdc1 f2, 0(RA)\n    |3:\n    |  ins_next\n    |\n    |5:  // Traverse hash part.\n    |  lw TMP1, TAB:RB->hmask\n    |  subu RC, RC, TMP0\n    |   lw TMP2, TAB:RB->node\n    |6:\n    |  sltu AT, TMP1, RC\t\t// End of iteration? Branch to ITERL+1.\n    |  bnez AT, <3\n    |.  sll TMP3, RC, 5\n    |   sll RB, RC, 3\n    |   subu TMP3, TMP3, RB\n    |  addu NODE:TMP3, TMP3, TMP2\n    |  lw RB, HI(NODE:TMP3)\n    |  ldc1 f0, 0(NODE:TMP3)\n    |     lhu RD, -4+OFS_RD(PC)\n    |  beq RB, TISNIL, <6\t\t// Skip holes in hash part.\n    |.  addiu RC, RC, 1\n    |   ldc1 f2, NODE:TMP3->key\n    |     lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)\n    |  sdc1 f0, 8(RA)\n    |    addu RC, RC, TMP0\n    |     decode_RD4b RD\n    |     addu RD, RD, TMP3\n    |   sdc1 f2, 0(RA)\n    |     addu PC, PC, RD\n    |  b <3\n    |.  sw RC, -8+LO(RA)\t\t// Update control var.\n    break;\n\n  case BC_ISNEXT:\n    |  // RA = base*8, RD = target (points to ITERN)\n    |  addu RA, BASE, RA\n    |  lw TMP0, -24+HI(RA)\n    |  lw CFUNC:TMP1, -24+LO(RA)\n    |   lw TMP2, -16+HI(RA)\n    |    lw TMP3, -8+HI(RA)\n    |  li AT, LJ_TFUNC\n    |  bne TMP0, AT, >5\n    |.  addiu TMP2, TMP2, -LJ_TTAB\n    |  lbu TMP1, CFUNC:TMP1->ffid\n    |  addiu TMP3, TMP3, -LJ_TNIL\n    |   srl TMP0, RD, 1\n    |  or TMP2, TMP2, TMP3\n    |  addiu TMP1, TMP1, -FF_next_N\n    |   addu TMP0, PC, TMP0\n    |  or TMP1, TMP1, TMP2\n    |  bnez TMP1, >5\n    |.  lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535)\n    |  addu PC, TMP0, TMP2\n    |  lui TMP1, 0xfffe\n    |  ori TMP1, TMP1, 0x7fff\n    |  sw r0, -8+LO(RA)\t\t\t// Initialize control var.\n    |  sw TMP1, -8+HI(RA)\n    |1:\n    |  ins_next\n    |5:  // Despecialize bytecode if any of the checks fail.\n    |  li TMP3, BC_JMP\n    |   li TMP1, BC_ITERC\n    |  sb TMP3, -4+OFS_OP(PC)\n    |   addu PC, TMP0, TMP2\n    |  b <1\n    |.  sb TMP1, OFS_OP(PC)\n    break;\n\n  case BC_VARG:\n    |  // RA = base*8, RB = (nresults+1)*8, RC = numparams*8\n    |  lw TMP0, FRAME_PC(BASE)\n    |  decode_RDtoRC8 RC, RD\n    |   decode_RB8a RB, INS\n    |  addu RC, BASE, RC\n    |   decode_RB8b RB\n    |   addu RA, BASE, RA\n    |  addiu RC, RC, FRAME_VARG\n    |   addu TMP2, RA, RB\n    |  addiu TMP3, BASE, -8\t\t// TMP3 = vtop\n    |  subu RC, RC, TMP0\t\t// RC = vbase\n    |  // Note: RC may now be even _above_ BASE if nargs was < numparams.\n    |  beqz RB, >5\t\t\t// Copy all varargs?\n    |.  subu TMP1, TMP3, RC\n    |  addiu TMP2, TMP2, -16\n    |1:  // Copy vararg slots to destination slots.\n    |  lw CARG1, HI(RC)\n    |  sltu AT, RC, TMP3\n    |   lw CARG2, LO(RC)\n    |    addiu RC, RC, 8\n    |  movz CARG1, TISNIL, AT\n    |  sw CARG1, HI(RA)\n    |   sw CARG2, LO(RA)\n    |  sltu AT, RA, TMP2\n    |  bnez AT, <1\n    |.   addiu RA, RA, 8\n    |3:\n    |  ins_next\n    |\n    |5:  // Copy all varargs.\n    |  lw TMP0, L->maxstack\n    |  blez TMP1, <3\t\t\t// No vararg slots?\n    |.  li MULTRES, 8\t\t\t// MULTRES = (0+1)*8\n    |  addu TMP2, RA, TMP1\n    |  sltu AT, TMP0, TMP2\n    |  bnez AT, >7\n    |.  addiu MULTRES, TMP1, 8\n    |6:\n    |  ldc1 f0, 0(RC)\n    |   addiu RC, RC, 8\n    |  sdc1 f0, 0(RA)\n    |  sltu AT, RC, TMP3\n    |  bnez AT, <6\t\t\t// More vararg slots?\n    |.  addiu RA, RA, 8\n    |  b <3\n    |.  nop\n    |\n    |7:  // Grow stack for varargs.\n    |  load_got lj_state_growstack\n    |   sw RA, L->top\n    |  subu RA, RA, BASE\n    |   sw BASE, L->base\n    |  subu BASE, RC, BASE\t\t// Need delta, because BASE may change.\n    |   sw PC, SAVE_PC\n    |  srl CARG2, TMP1, 3\n    |  call_intern lj_state_growstack\t// (lua_State *L, int n)\n    |.  move CARG1, L\n    |  move RC, BASE\n    |  lw BASE, L->base\n    |  addu RA, BASE, RA\n    |  addu RC, BASE, RC\n    |  b <6\n    |.  addiu TMP3, BASE, -8\n    break;\n\n  /* -- Returns ----------------------------------------------------------- */\n\n  case BC_RETM:\n    |  // RA = results*8, RD = extra_nresults*8\n    |  addu RD, RD, MULTRES\t\t// MULTRES >= 8, so RD >= 8.\n    |  // Fall through. Assumes BC_RET follows.\n    break;\n\n  case BC_RET:\n    |  // RA = results*8, RD = (nresults+1)*8\n    |  lw PC, FRAME_PC(BASE)\n    |   addu RA, BASE, RA\n    |    move MULTRES, RD\n    |1:\n    |  andi TMP0, PC, FRAME_TYPE\n    |  bnez TMP0, ->BC_RETV_Z\n    |.  xori TMP1, PC, FRAME_VARG\n    |\n    |->BC_RET_Z:\n    |  // BASE = base, RA = resultptr, RD = (nresults+1)*8, PC = return\n    |   lw INS, -4(PC)\n    |    addiu TMP2, BASE, -8\n    |    addiu RC, RD, -8\n    |  decode_RA8a TMP0, INS\n    |   decode_RB8a RB, INS\n    |  decode_RA8b TMP0\n    |   decode_RB8b RB\n    |   addu TMP3, TMP2, RB\n    |  beqz RC, >3\n    |.  subu BASE, TMP2, TMP0\n    |2:\n    |   ldc1 f0, 0(RA)\n    |    addiu RA, RA, 8\n    |  addiu RC, RC, -8\n    |   sdc1 f0, 0(TMP2)\n    |  bnez RC, <2\n    |.   addiu TMP2, TMP2, 8\n    |3:\n    |  addiu TMP3, TMP3, -8\n    |5:\n    |  sltu AT, TMP2, TMP3\n    |  bnez AT, >6\n    |.  lw LFUNC:TMP1, FRAME_FUNC(BASE)\n    |  ins_next1\n    |  lw TMP1, LFUNC:TMP1->pc\n    |  lw KBASE, PC2PROTO(k)(TMP1)\n    |  ins_next2\n    |\n    |6:  // Fill up results with nil.\n    |  sw TISNIL, HI(TMP2)\n    |  b <5\n    |.  addiu TMP2, TMP2, 8\n    |\n    |->BC_RETV_Z:  // Non-standard return case.\n    |  andi TMP2, TMP1, FRAME_TYPEP\n    |  bnez TMP2, ->vm_return\n    |.  nop\n    |  // Return from vararg function: relocate BASE down.\n    |  subu BASE, BASE, TMP1\n    |  b <1\n    |.  lw PC, FRAME_PC(BASE)\n    break;\n\n  case BC_RET0: case BC_RET1:\n    |  // RA = results*8, RD = (nresults+1)*8\n    |  lw PC, FRAME_PC(BASE)\n    |   addu RA, BASE, RA\n    |    move MULTRES, RD\n    |  andi TMP0, PC, FRAME_TYPE\n    |  bnez TMP0, ->BC_RETV_Z\n    |.  xori TMP1, PC, FRAME_VARG\n    |\n    |  lw INS, -4(PC)\n    |   addiu TMP2, BASE, -8\n    if (op == BC_RET1) {\n      |  ldc1 f0, 0(RA)\n    }\n    |  decode_RB8a RB, INS\n    |   decode_RA8a RA, INS\n    |  decode_RB8b RB\n    |   decode_RA8b RA\n    if (op == BC_RET1) {\n      |  sdc1 f0, 0(TMP2)\n    }\n    |   subu BASE, TMP2, RA\n    |5:\n    |  sltu AT, RD, RB\n    |  bnez AT, >6\n    |.  lw LFUNC:TMP1, FRAME_FUNC(BASE)\n    |  ins_next1\n    |  lw TMP1, LFUNC:TMP1->pc\n    |  lw KBASE, PC2PROTO(k)(TMP1)\n    |  ins_next2\n    |\n    |6:  // Fill up results with nil.\n    |  addiu TMP2, TMP2, 8\n    |  addiu RD, RD, 8\n    |  b <5\n    if (op == BC_RET1) {\n      |.  sw TISNIL, HI(TMP2)\n    } else {\n      |.  sw TISNIL, -8+HI(TMP2)\n    }\n    break;\n\n  /* -- Loops and branches ------------------------------------------------ */\n\n  case BC_FORL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IFORL follows.\n    break;\n\n  case BC_JFORI:\n  case BC_JFORL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_FORI:\n  case BC_IFORL:\n    |  // RA = base*8, RD = target (after end of loop or start of loop)\n    vk = (op == BC_IFORL || op == BC_JFORL);\n    |  addu RA, BASE, RA\n    if (vk) {\n      |  ldc1 f0, FORL_IDX*8(RA)\n      |  ldc1 f4, FORL_STEP*8(RA)\n      |  ldc1 f2, FORL_STOP*8(RA)\n      |   lw TMP3, FORL_STEP*8+HI(RA)\n      |  add.d f0, f0, f4\n      |  sdc1 f0, FORL_IDX*8(RA)\n    } else {\n      |  lw TMP1, FORL_IDX*8+HI(RA)\n      |  lw TMP3, FORL_STEP*8+HI(RA)\n      |  lw TMP2, FORL_STOP*8+HI(RA)\n      |  sltiu TMP1, TMP1, LJ_TISNUM\n      |  sltiu TMP0, TMP3, LJ_TISNUM\n      |  sltiu TMP2, TMP2, LJ_TISNUM\n      |  and TMP1, TMP1, TMP0\n      |  and TMP1, TMP1, TMP2\n      |   ldc1 f0, FORL_IDX*8(RA)\n      |  beqz TMP1, ->vmeta_for\n      |.  ldc1 f2, FORL_STOP*8(RA)\n    }\n    if (op != BC_JFORL) {\n      |  srl RD, RD, 1\n      |  lui TMP0, (-(BCBIAS_J*4 >> 16) & 65535)\n    }\n    |  c.le.d 0, f0, f2\n    |  c.le.d 1, f2, f0\n    |  sdc1 f0, FORL_EXT*8(RA)\n    if (op == BC_JFORI) {\n      |  li TMP1, 1\n      |  li TMP2, 1\n      |   addu TMP0, RD, TMP0\n      |  slt TMP3, TMP3, r0\n      |  movf TMP1, r0, 0\n      |   addu PC, PC, TMP0\n      |  movf TMP2, r0, 1\n      |   lhu RD, -4+OFS_RD(PC)\n      |  movn TMP1, TMP2, TMP3\n      |  bnez TMP1, =>BC_JLOOP\n      |.  decode_RD8b RD\n    } else if (op == BC_JFORL) {\n      |  li TMP1, 1\n      |  li TMP2, 1\n      |  slt TMP3, TMP3, r0\n      |  movf TMP1, r0, 0\n      |  movf TMP2, r0, 1\n      |  movn TMP1, TMP2, TMP3\n      |  bnez TMP1, =>BC_JLOOP\n      |.  nop\n    } else {\n      |  addu TMP1, RD, TMP0\n      |  slt TMP3, TMP3, r0\n      |  move TMP2, TMP1\n      if (op == BC_FORI) {\n\t|  movt TMP1, r0, 0\n\t|  movt TMP2, r0, 1\n      } else {\n\t|  movf TMP1, r0, 0\n\t|  movf TMP2, r0, 1\n      }\n      |  movn TMP1, TMP2, TMP3\n      |  addu PC, PC, TMP1\n    }\n    |  ins_next\n    break;\n\n  case BC_ITERL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IITERL follows.\n    break;\n\n  case BC_JITERL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IITERL:\n    |  // RA = base*8, RD = target\n    |  addu RA, BASE, RA\n    |  lw TMP1, HI(RA)\n    |  beq TMP1, TISNIL, >1\t\t// Stop if iterator returned nil.\n    |.  lw TMP2, LO(RA)\n    if (op == BC_JITERL) {\n      |  sw TMP1, -8+HI(RA)\n      |  b =>BC_JLOOP\n      |.  sw TMP2, -8+LO(RA)\n    } else {\n      |  branch_RD\t\t\t// Otherwise save control var + branch.\n      |  sw TMP1, -8+HI(RA)\n      |   sw TMP2, -8+LO(RA)\n    }\n    |1:\n    |  ins_next\n    break;\n\n  case BC_LOOP:\n    |  // RA = base*8, RD = target (loop extent)\n    |  // Note: RA/RD is only used by trace recorder to determine scope/extent\n    |  // This opcode does NOT jump, it's only purpose is to detect a hot loop.\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_ILOOP follows.\n    break;\n\n  case BC_ILOOP:\n    |  // RA = base*8, RD = target (loop extent)\n    |  ins_next\n    break;\n\n  case BC_JLOOP:\n    |.if JIT\n    |  // RA = base*8 (ignored), RD = traceno*8\n    |  lw TMP1, DISPATCH_J(trace)(DISPATCH)\n    |  srl RD, RD, 1\n    |   li AT, 0\n    |  addu TMP1, TMP1, RD\n    |  // Traces on MIPS don't store the trace number, so use 0.\n    |   sw AT, DISPATCH_GL(vmstate)(DISPATCH)\n    |  lw TRACE:TMP2, 0(TMP1)\n    |   sw BASE, DISPATCH_GL(jit_base)(DISPATCH)\n    |   sw L, DISPATCH_GL(jit_L)(DISPATCH)\n    |  lw TMP2, TRACE:TMP2->mcode\n    |  jr TMP2\n    |.  addiu JGL, DISPATCH, GG_DISP2G+32768\n    |.endif\n    break;\n\n  case BC_JMP:\n    |  // RA = base*8 (only used by trace recorder), RD = target\n    |  branch_RD\n    |  ins_next\n    break;\n\n  /* -- Function headers -------------------------------------------------- */\n\n  case BC_FUNCF:\n    |.if JIT\n    |  hotcall\n    |.endif\n  case BC_FUNCV:  /* NYI: compiled vararg functions. */\n    |  // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow.\n    break;\n\n  case BC_JFUNCF:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IFUNCF:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8\n    |  lw TMP2, L->maxstack\n    |   lbu TMP1, -4+PC2PROTO(numparams)(PC)\n    |    lw KBASE, -4+PC2PROTO(k)(PC)\n    |  sltu AT, TMP2, RA\n    |  bnez AT, ->vm_growstack_l\n    |.  sll TMP1, TMP1, 3\n    if (op != BC_JFUNCF) {\n      |  ins_next1\n    }\n    |2:\n    |  sltu AT, NARGS8:RC, TMP1\t\t// Check for missing parameters.\n    |  bnez AT, >3\n    |.  addu AT, BASE, NARGS8:RC\n    if (op == BC_JFUNCF) {\n      |  decode_RD8a RD, INS\n      |  b =>BC_JLOOP\n      |.  decode_RD8b RD\n    } else {\n      |  ins_next2\n    }\n    |\n    |3:  // Clear missing parameters.\n    |  sw TISNIL, HI(AT)\n    |  b <2\n    |.  addiu NARGS8:RC, NARGS8:RC, 8\n    break;\n\n  case BC_JFUNCV:\n#if !LJ_HASJIT\n    break;\n#endif\n    |  NYI  // NYI: compiled vararg functions\n    break;  /* NYI: compiled vararg functions. */\n\n  case BC_IFUNCV:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8\n    |   addu TMP1, BASE, RC\n    |  lw TMP2, L->maxstack\n    |  addu TMP0, RA, RC\n    |   sw LFUNC:RB, LO(TMP1)\t\t// Store copy of LFUNC.\n    |   addiu TMP3, RC, 8+FRAME_VARG\n    |  sltu AT, TMP0, TMP2\n    |    lw KBASE, -4+PC2PROTO(k)(PC)\n    |  beqz AT, ->vm_growstack_l\n    |.  sw TMP3, HI(TMP1)\t\t// Store delta + FRAME_VARG.\n    |  lbu TMP2, -4+PC2PROTO(numparams)(PC)\n    |   move RA, BASE\n    |   move RC, TMP1\n    |  ins_next1\n    |  beqz TMP2, >3\n    |.  addiu BASE, TMP1, 8\n    |1:\n    |  lw TMP0, HI(RA)\n    |   lw TMP3, LO(RA)\n    |  sltu AT, RA, RC\t\t\t// Less args than parameters?\n    |  move CARG1, TMP0\n    |  movz TMP0, TISNIL, AT\t\t// Clear missing parameters.\n    |  movn CARG1, TISNIL, AT\t\t// Clear old fixarg slot (help the GC).\n    |   sw TMP3, 8+LO(TMP1)\n    |    addiu TMP2, TMP2, -1\n    |  sw TMP0, 8+HI(TMP1)\n    |    addiu TMP1, TMP1, 8\n    |  sw CARG1, HI(RA)\n    |  bnez TMP2, <1\n    |.   addiu RA, RA, 8\n    |3:\n    |  ins_next2\n    break;\n\n  case BC_FUNCC:\n  case BC_FUNCCW:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8\n    if (op == BC_FUNCC) {\n      |  lw CFUNCADDR, CFUNC:RB->f\n    } else {\n      |  lw CFUNCADDR, DISPATCH_GL(wrapf)(DISPATCH)\n    }\n    |  addu TMP1, RA, NARGS8:RC\n    |  lw TMP2, L->maxstack\n    |   addu RC, BASE, NARGS8:RC\n    |  sw BASE, L->base\n    |  sltu AT, TMP2, TMP1\n    |   sw RC, L->top\n    |    li_vmstate C\n    if (op == BC_FUNCCW) {\n      |  lw CARG2, CFUNC:RB->f\n    }\n    |  bnez AT, ->vm_growstack_c\t// Need to grow stack.\n    |.  move CARG1, L\n    |  jalr CFUNCADDR\t\t\t// (lua_State *L [, lua_CFunction f])\n    |.   st_vmstate\n    |  // Returns nresults.\n    |  lw BASE, L->base\n    |   sll RD, CRET1, 3\n    |  lw TMP1, L->top\n    |    li_vmstate INTERP\n    |  lw PC, FRAME_PC(BASE)\t\t// Fetch PC of caller.\n    |   subu RA, TMP1, RD\t\t// RA = L->top - nresults*8\n    |  b ->vm_returnc\n    |.   st_vmstate\n    break;\n\n  /* ---------------------------------------------------------------------- */\n\n  default:\n    fprintf(stderr, \"Error: undefined opcode BC_%s\\n\", bc_names[op]);\n    exit(2);\n    break;\n  }\n}\n\nstatic int build_backend(BuildCtx *ctx)\n{\n  int op;\n\n  dasm_growpc(Dst, BC__MAX);\n\n  build_subroutines(ctx);\n\n  |.code_op\n  for (op = 0; op < BC__MAX; op++)\n    build_ins(ctx, (BCOp)op, op);\n\n  return BC__MAX;\n}\n\n/* Emit pseudo frame-info for all assembler functions. */\nstatic void emit_asm_debug(BuildCtx *ctx)\n{\n  int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code);\n  int i;\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n    fprintf(ctx->fp, \"\\t.section .debug_frame,\\\"\\\",@progbits\\n\");\n    fprintf(ctx->fp,\n\t\".Lframe0:\\n\"\n\t\"\\t.4byte .LECIE0-.LSCIE0\\n\"\n\t\".LSCIE0:\\n\"\n\t\"\\t.4byte 0xffffffff\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 31\\n\"\n\t\"\\t.byte 0xc\\n\\t.uleb128 29\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE0:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE0:\\n\"\n\t\"\\t.4byte .LEFDE0-.LASFDE0\\n\"\n\t\".LASFDE0:\\n\"\n\t\"\\t.4byte .Lframe0\\n\"\n\t\"\\t.4byte .Lbegin\\n\"\n\t\"\\t.4byte %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 0x9f\\n\\t.sleb128 1\\n\"\n\t\"\\t.byte 0x9e\\n\\t.sleb128 2\\n\",\n\tfcofs, CFRAME_SIZE);\n    for (i = 23; i >= 16; i--)\n      fprintf(ctx->fp, \"\\t.byte %d\\n\\t.uleb128 %d\\n\", 0x80+i, 26-i);\n    for (i = 30; i >= 20; i -= 2)\n      fprintf(ctx->fp, \"\\t.byte %d\\n\\t.uleb128 %d\\n\", 0x80+32+i, 42-i);\n    fprintf(ctx->fp,\n\t\"\\t.align 2\\n\"\n\t\".LEFDE0:\\n\\n\");\n#if LJ_HASFFI\n    fprintf(ctx->fp,\n\t\".LSFDE1:\\n\"\n\t\"\\t.4byte .LEFDE1-.LASFDE1\\n\"\n\t\".LASFDE1:\\n\"\n\t\"\\t.4byte .Lframe0\\n\"\n\t\"\\t.4byte lj_vm_ffi_call\\n\"\n\t\"\\t.4byte %d\\n\"\n\t\"\\t.byte 0x9f\\n\\t.uleb128 1\\n\"\n\t\"\\t.byte 0x90\\n\\t.uleb128 2\\n\"\n\t\"\\t.byte 0xd\\n\\t.uleb128 0x10\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LEFDE1:\\n\\n\", (int)ctx->codesz - fcofs);\n#endif\n    fprintf(ctx->fp, \"\\t.section .eh_frame,\\\"aw\\\",@progbits\\n\");\n    fprintf(ctx->fp,\n\t\"\\t.globl lj_err_unwind_dwarf\\n\"\n\t\".Lframe1:\\n\"\n\t\"\\t.4byte .LECIE1-.LSCIE1\\n\"\n\t\".LSCIE1:\\n\"\n\t\"\\t.4byte 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"zPR\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 31\\n\"\n\t\"\\t.uleb128 6\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0\\n\"\n\t\"\\t.4byte lj_err_unwind_dwarf\\n\"\n\t\"\\t.byte 0\\n\"\n\t\"\\t.byte 0xc\\n\\t.uleb128 29\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE1:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE2:\\n\"\n\t\"\\t.4byte .LEFDE2-.LASFDE2\\n\"\n\t\".LASFDE2:\\n\"\n\t\"\\t.4byte .LASFDE2-.Lframe1\\n\"\n\t\"\\t.4byte .Lbegin\\n\"\n\t\"\\t.4byte %d\\n\"\n\t\"\\t.uleb128 0\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 0x9f\\n\\t.sleb128 1\\n\"\n\t\"\\t.byte 0x9e\\n\\t.sleb128 2\\n\",\n\tfcofs, CFRAME_SIZE);\n    for (i = 23; i >= 16; i--)\n      fprintf(ctx->fp, \"\\t.byte %d\\n\\t.uleb128 %d\\n\", 0x80+i, 26-i);\n    for (i = 30; i >= 20; i -= 2)\n      fprintf(ctx->fp, \"\\t.byte %d\\n\\t.uleb128 %d\\n\", 0x80+32+i, 42-i);\n    fprintf(ctx->fp,\n\t\"\\t.align 2\\n\"\n\t\".LEFDE2:\\n\\n\");\n#if LJ_HASFFI\n    fprintf(ctx->fp,\n\t\".Lframe2:\\n\"\n\t\"\\t.4byte .LECIE2-.LSCIE2\\n\"\n\t\".LSCIE2:\\n\"\n\t\"\\t.4byte 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"zR\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 31\\n\"\n\t\"\\t.uleb128 1\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0\\n\"\n\t\"\\t.byte 0xc\\n\\t.uleb128 29\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE2:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE3:\\n\"\n\t\"\\t.4byte .LEFDE3-.LASFDE3\\n\"\n\t\".LASFDE3:\\n\"\n\t\"\\t.4byte .LASFDE3-.Lframe2\\n\"\n\t\"\\t.4byte lj_vm_ffi_call\\n\"\n\t\"\\t.4byte %d\\n\"\n\t\"\\t.uleb128 0\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0x9f\\n\\t.uleb128 1\\n\"\n\t\"\\t.byte 0x90\\n\\t.uleb128 2\\n\"\n\t\"\\t.byte 0xd\\n\\t.uleb128 0x10\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LEFDE3:\\n\\n\", (int)ctx->codesz - fcofs);\n#endif\n    break;\n  default:\n    break;\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/vm_ppc.dasc",
    "content": "|// Low-level VM code for PowerPC CPUs.\n|// Bytecode interpreter, fast functions and helper functions.\n|// Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n|\n|.arch ppc\n|.section code_op, code_sub\n|\n|.actionlist build_actionlist\n|.globals GLOB_\n|.globalnames globnames\n|.externnames extnames\n|\n|// Note: The ragged indentation of the instructions is intentional.\n|//       The starting columns indicate data dependencies.\n|\n|//-----------------------------------------------------------------------\n|\n|// DynASM defines used by the PPC port:\n|//\n|// P64     64 bit pointers (only for GPR64 testing).\n|//         Note: a full PPC64 _LP64 port is not planned.\n|// GPR64   64 bit registers (but possibly 32 bit pointers, e.g. PS3).\n|//         Affects reg saves, stack layout, carry/overflow/dot flags etc.\n|// FRAME32 Use 32 bit frame layout, even with GPR64 (Xbox 360).\n|// TOC     Need table of contents (64 bit or 32 bit variant, e.g. PS3).\n|//         Function pointers are really a struct: code, TOC, env (optional).\n|// TOCENV  Function pointers have an environment pointer, too (not on PS3).\n|// PPE     Power Processor Element of Cell (PS3) or Xenon (Xbox 360).\n|//         Must avoid (slow) micro-coded instructions.\n|\n|.if P64\n|.define TOC, 1\n|.define TOCENV, 1\n|.macro lpx, a, b, c; ldx a, b, c; .endmacro\n|.macro lp, a, b; ld a, b; .endmacro\n|.macro stp, a, b; std a, b; .endmacro\n|.define decode_OPP, decode_OP8\n|.if FFI\n|// Missing: Calling conventions, 64 bit regs, TOC.\n|.error lib_ffi not yet implemented for PPC64\n|.endif\n|.else\n|.macro lpx, a, b, c; lwzx a, b, c; .endmacro\n|.macro lp, a, b; lwz a, b; .endmacro\n|.macro stp, a, b; stw a, b; .endmacro\n|.define decode_OPP, decode_OP4\n|.endif\n|\n|// Convenience macros for TOC handling.\n|.if TOC\n|// Linker needs a TOC patch area for every external call relocation.\n|.macro blex, target; bl extern target; nop; .endmacro\n|.macro .toc, a, b; a, b; .endmacro\n|.if P64\n|.define TOC_OFS,\t 8\n|.define ENV_OFS,\t16\n|.else\n|.define TOC_OFS,\t4\n|.define ENV_OFS,\t8\n|.endif\n|.else  // No TOC.\n|.macro blex, target; bl extern target; .endmacro\n|.macro .toc, a, b; .endmacro\n|.endif\n|.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro\n|\n|.macro .gpr64, a, b; .if GPR64; a, b; .endif; .endmacro\n|\n|.macro andix., y, a, i\n|.if PPE\n|  rlwinm y, a, 0, 31-lj_fls(i), 31-lj_ffs(i)\n|  cmpwi y, 0\n|.else\n|  andi. y, a, i\n|.endif\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Fixed register assignments for the interpreter.\n|// Don't use: r1 = sp, r2 and r13 = reserved (TOC, TLS or SDATA)\n|\n|// The following must be C callee-save (but BASE is often refetched).\n|.define BASE,\t\tr14\t// Base of current Lua stack frame.\n|.define KBASE,\t\tr15\t// Constants of current Lua function.\n|.define PC,\t\tr16\t// Next PC.\n|.define DISPATCH,\tr17\t// Opcode dispatch table.\n|.define LREG,\t\tr18\t// Register holding lua_State (also in SAVE_L).\n|.define MULTRES,\tr19\t// Size of multi-result: (nresults+1)*8.\n|.define JGL,\t\tr31\t// On-trace: global_State + 32768.\n|\n|// Constants for type-comparisons, stores and conversions. C callee-save.\n|.define TISNUM,\tr22\n|.define TISNIL,\tr23\n|.define ZERO,\t\tr24\n|.define TOBIT,\t\tf30\t// 2^52 + 2^51.\n|.define TONUM,\t\tf31\t// 2^52 + 2^51 + 2^31.\n|\n|// The following temporaries are not saved across C calls, except for RA.\n|.define RA,\t\tr20\t// Callee-save.\n|.define RB,\t\tr10\n|.define RC,\t\tr11\n|.define RD,\t\tr12\n|.define INS,\t\tr7\t// Overlaps CARG5.\n|\n|.define TMP0,\t\tr0\n|.define TMP1,\t\tr8\n|.define TMP2,\t\tr9\n|.define TMP3,\t\tr6\t// Overlaps CARG4.\n|\n|// Saved temporaries.\n|.define SAVE0,\t\tr21\n|\n|// Calling conventions.\n|.define CARG1,\t\tr3\n|.define CARG2,\t\tr4\n|.define CARG3,\t\tr5\n|.define CARG4,\t\tr6\t// Overlaps TMP3.\n|.define CARG5,\t\tr7\t// Overlaps INS.\n|\n|.define FARG1,\t\tf1\n|.define FARG2,\t\tf2\n|\n|.define CRET1,\t\tr3\n|.define CRET2,\t\tr4\n|\n|.define TOCREG,\tr2\t// TOC register (only used by C code).\n|.define ENVREG,\tr11\t// Environment pointer (nested C functions).\n|\n|// Stack layout while in interpreter. Must match with lj_frame.h.\n|.if GPR64\n|.if FRAME32\n|\n|//\t\t\t456(sp) // \\ 32/64 bit C frame info\n|.define TONUM_LO,\t452(sp) // |\n|.define TONUM_HI,\t448(sp) // |\n|.define TMPD_LO,\t444(sp) // |\n|.define TMPD_HI,\t440(sp) // |\n|.define SAVE_CR,\t432(sp) // | 64 bit CR save.\n|.define SAVE_ERRF,\t424(sp) //  > Parameter save area.\n|.define SAVE_NRES,\t420(sp) // |\n|.define SAVE_L,\t416(sp) // |\n|.define SAVE_PC,\t412(sp) // |\n|.define SAVE_MULTRES,\t408(sp) // |\n|.define SAVE_CFRAME,\t400(sp) // / 64 bit C frame chain.\n|//\t\t\t392(sp) // Reserved.\n|.define CFRAME_SPACE,\t384     // Delta for sp.\n|// Back chain for sp:\t384(sp) <-- sp entering interpreter\n|.define SAVE_LR,\t376(sp) // 32 bit LR stored in hi-part.\n|.define SAVE_GPR_,\t232     // .. 232+18*8: 64 bit GPR saves.\n|.define SAVE_FPR_,\t88      // .. 88+18*8: 64 bit FPR saves.\n|//\t\t\t80(sp) // Needed for 16 byte stack frame alignment.\n|//\t\t\t16(sp)  // Callee parameter save area (ABI mandated).\n|//\t\t\t8(sp)   // Reserved\n|// Back chain for sp:\t0(sp)   <-- sp while in interpreter\n|// 32 bit sp stored in hi-part of 0(sp).\n|\n|.define TMPD_BLO,\t447(sp)\n|.define TMPD,\t\tTMPD_HI\n|.define TONUM_D,\tTONUM_HI\n|\n|.else\n|\n|//\t\t\t508(sp) // \\ 32 bit C frame info.\n|.define SAVE_ERRF,\t472(sp) // |\n|.define SAVE_NRES,\t468(sp) // |\n|.define SAVE_L,\t464(sp) //  > Parameter save area.\n|.define SAVE_PC,\t460(sp) // |\n|.define SAVE_MULTRES,\t456(sp) // |\n|.define SAVE_CFRAME,\t448(sp) // / 64 bit C frame chain.\n|.define SAVE_LR,\t416(sp)\n|.define CFRAME_SPACE,\t400     // Delta for sp.\n|// Back chain for sp:\t400(sp) <-- sp entering interpreter\n|.define SAVE_FPR_,\t256     // .. 256+18*8: 64 bit FPR saves.\n|.define SAVE_GPR_,\t112     // .. 112+18*8: 64 bit GPR saves.\n|//\t\t\t48(sp)  // Callee parameter save area (ABI mandated).\n|.define SAVE_TOC,\t40(sp)  // TOC save area.\n|.define TMPD_LO,\t36(sp)  // \\ Link editor temp (ABI mandated).\n|.define TMPD_HI,\t32(sp)  // /\n|.define TONUM_LO,\t28(sp)  // \\ Compiler temp (ABI mandated).\n|.define TONUM_HI,\t24(sp)  // /\n|// Next frame lr:\t16(sp)\n|.define SAVE_CR,\t8(sp)  // 64 bit CR save.\n|// Back chain for sp:\t0(sp)\t<-- sp while in interpreter\n|\n|.define TMPD_BLO,\t39(sp)\n|.define TMPD,\t\tTMPD_HI\n|.define TONUM_D,\tTONUM_HI\n|\n|.endif\n|.else\n|\n|.define SAVE_LR,\t276(sp)\n|.define CFRAME_SPACE,\t272     // Delta for sp.\n|// Back chain for sp:\t272(sp) <-- sp entering interpreter\n|.define SAVE_FPR_,\t128     // .. 128+18*8: 64 bit FPR saves.\n|.define SAVE_GPR_,\t56      // .. 56+18*4: 32 bit GPR saves.\n|.define SAVE_CR,\t52(sp)  // 32 bit CR save.\n|.define SAVE_ERRF,\t48(sp)  // 32 bit C frame info.\n|.define SAVE_NRES,\t44(sp)\n|.define SAVE_CFRAME,\t40(sp)\n|.define SAVE_L,\t36(sp)\n|.define SAVE_PC,\t32(sp)\n|.define SAVE_MULTRES,\t28(sp)\n|.define UNUSED1,\t24(sp)\n|.define TMPD_LO,\t20(sp)\n|.define TMPD_HI,\t16(sp)\n|.define TONUM_LO,\t12(sp)\n|.define TONUM_HI,\t8(sp)\n|// Next frame lr:\t4(sp)\n|// Back chain for sp:\t0(sp)\t<-- sp while in interpreter\n|\n|.define TMPD_BLO,\t23(sp)\n|.define TMPD,\t\tTMPD_HI\n|.define TONUM_D,\tTONUM_HI\n|\n|.endif\n|\n|.macro save_, reg\n|.if GPR64\n|  std r..reg, SAVE_GPR_+(reg-14)*8(sp)\n|.else\n|  stw r..reg, SAVE_GPR_+(reg-14)*4(sp)\n|.endif\n|  stfd f..reg, SAVE_FPR_+(reg-14)*8(sp)\n|.endmacro\n|.macro rest_, reg\n|.if GPR64\n|  ld r..reg, SAVE_GPR_+(reg-14)*8(sp)\n|.else\n|  lwz r..reg, SAVE_GPR_+(reg-14)*4(sp)\n|.endif\n|  lfd f..reg, SAVE_FPR_+(reg-14)*8(sp)\n|.endmacro\n|\n|.macro saveregs\n|.if GPR64 and not FRAME32\n|  stdu sp, -CFRAME_SPACE(sp)\n|.else\n|  stwu sp, -CFRAME_SPACE(sp)\n|.endif\n|  save_ 14; save_ 15; save_ 16\n|  mflr r0\n|  save_ 17; save_ 18; save_ 19; save_ 20; save_ 21; save_ 22\n|.if GPR64 and not FRAME32\n|  std r0, SAVE_LR\n|.else\n|  stw r0, SAVE_LR\n|.endif\n|  save_ 23; save_ 24; save_ 25\n|  mfcr r0\n|  save_ 26; save_ 27; save_ 28; save_ 29; save_ 30; save_ 31\n|.if GPR64\n|  std r0, SAVE_CR\n|.else\n|  stw r0, SAVE_CR\n|.endif\n|  .toc std TOCREG, SAVE_TOC\n|.endmacro\n|\n|.macro restoreregs\n|.if GPR64 and not FRAME32\n|  ld r0, SAVE_LR\n|.else\n|  lwz r0, SAVE_LR\n|.endif\n|.if GPR64\n|  ld r12, SAVE_CR\n|.else\n|  lwz r12, SAVE_CR\n|.endif\n|  rest_ 14; rest_ 15; rest_ 16; rest_ 17; rest_ 18; rest_ 19\n|  mtlr r0;\n|.if PPE; mtocrf 0x20, r12; .else; mtcrf 0x38, r12; .endif\n|  rest_ 20; rest_ 21; rest_ 22; rest_ 23; rest_ 24; rest_ 25\n|.if PPE; mtocrf 0x10, r12; .endif\n|  rest_ 26; rest_ 27; rest_ 28; rest_ 29; rest_ 30; rest_ 31\n|.if PPE; mtocrf 0x08, r12; .endif\n|  addi sp, sp, CFRAME_SPACE\n|.endmacro\n|\n|// Type definitions. Some of these are only used for documentation.\n|.type L,\t\tlua_State,\tLREG\n|.type GL,\t\tglobal_State\n|.type TVALUE,\t\tTValue\n|.type GCOBJ,\t\tGCobj\n|.type STR,\t\tGCstr\n|.type TAB,\t\tGCtab\n|.type LFUNC,\t\tGCfuncL\n|.type CFUNC,\t\tGCfuncC\n|.type PROTO,\t\tGCproto\n|.type UPVAL,\t\tGCupval\n|.type NODE,\t\tNode\n|.type NARGS8,\t\tint\n|.type TRACE,\t\tGCtrace\n|\n|//-----------------------------------------------------------------------\n|\n|// These basic macros should really be part of DynASM.\n|.macro srwi, rx, ry, n; rlwinm rx, ry, 32-n, n, 31; .endmacro\n|.macro slwi, rx, ry, n; rlwinm rx, ry, n, 0, 31-n; .endmacro\n|.macro rotlwi, rx, ry, n; rlwinm rx, ry, n, 0, 31; .endmacro\n|.macro rotlw, rx, ry, rn; rlwnm rx, ry, rn, 0, 31; .endmacro\n|.macro subi, rx, ry, i; addi rx, ry, -i; .endmacro\n|\n|// Trap for not-yet-implemented parts.\n|.macro NYI; tw 4, sp, sp; .endmacro\n|\n|// int/FP conversions.\n|.macro tonum_i, freg, reg\n|  xoris reg, reg, 0x8000\n|  stw reg, TONUM_LO\n|  lfd freg, TONUM_D\n|  fsub freg, freg, TONUM\n|.endmacro\n|\n|.macro tonum_u, freg, reg\n|  stw reg, TONUM_LO\n|  lfd freg, TONUM_D\n|  fsub freg, freg, TOBIT\n|.endmacro\n|\n|.macro toint, reg, freg, tmpfreg\n|  fctiwz tmpfreg, freg\n|  stfd tmpfreg, TMPD\n|  lwz reg, TMPD_LO\n|.endmacro\n|\n|.macro toint, reg, freg\n|  toint reg, freg, freg\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Access to frame relative to BASE.\n|.define FRAME_PC,\t-8\n|.define FRAME_FUNC,\t-4\n|\n|// Instruction decode.\n|.macro decode_OP4, dst, ins; rlwinm dst, ins, 2, 22, 29; .endmacro\n|.macro decode_OP8, dst, ins; rlwinm dst, ins, 3, 21, 28; .endmacro\n|.macro decode_RA8, dst, ins; rlwinm dst, ins, 27, 21, 28; .endmacro\n|.macro decode_RB8, dst, ins; rlwinm dst, ins, 11, 21, 28; .endmacro\n|.macro decode_RC8, dst, ins; rlwinm dst, ins, 19, 21, 28; .endmacro\n|.macro decode_RD8, dst, ins; rlwinm dst, ins, 19, 13, 28; .endmacro\n|\n|.macro decode_OP1, dst, ins; rlwinm dst, ins, 0, 24, 31; .endmacro\n|.macro decode_RD4, dst, ins; rlwinm dst, ins, 18, 14, 29; .endmacro\n|\n|// Instruction fetch.\n|.macro ins_NEXT1\n|  lwz INS, 0(PC)\n|   addi PC, PC, 4\n|.endmacro\n|// Instruction decode+dispatch. Note: optimized for e300!\n|.macro ins_NEXT2\n|  decode_OPP TMP1, INS\n|  lpx TMP0, DISPATCH, TMP1\n|  mtctr TMP0\n|   decode_RB8 RB, INS\n|   decode_RD8 RD, INS\n|   decode_RA8 RA, INS\n|   decode_RC8 RC, INS\n|  bctr\n|.endmacro\n|.macro ins_NEXT\n|  ins_NEXT1\n|  ins_NEXT2\n|.endmacro\n|\n|// Instruction footer.\n|.if 1\n|  // Replicated dispatch. Less unpredictable branches, but higher I-Cache use.\n|  .define ins_next, ins_NEXT\n|  .define ins_next_, ins_NEXT\n|  .define ins_next1, ins_NEXT1\n|  .define ins_next2, ins_NEXT2\n|.else\n|  // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch.\n|  // Affects only certain kinds of benchmarks (and only with -j off).\n|  .macro ins_next\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next1\n|  .endmacro\n|  .macro ins_next2\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next_\n|  ->ins_next:\n|    ins_NEXT\n|  .endmacro\n|.endif\n|\n|// Call decode and dispatch.\n|.macro ins_callt\n|  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n|  lwz PC, LFUNC:RB->pc\n|  lwz INS, 0(PC)\n|   addi PC, PC, 4\n|  decode_OPP TMP1, INS\n|   decode_RA8 RA, INS\n|  lpx TMP0, DISPATCH, TMP1\n|   add RA, RA, BASE\n|  mtctr TMP0\n|  bctr\n|.endmacro\n|\n|.macro ins_call\n|  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC\n|  stw PC, FRAME_PC(BASE)\n|  ins_callt\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Macros to test operand types.\n|.macro checknum, reg; cmplw reg, TISNUM; .endmacro\n|.macro checknum, cr, reg; cmplw cr, reg, TISNUM; .endmacro\n|.macro checkstr, reg; cmpwi reg, LJ_TSTR; .endmacro\n|.macro checktab, reg; cmpwi reg, LJ_TTAB; .endmacro\n|.macro checkfunc, reg; cmpwi reg, LJ_TFUNC; .endmacro\n|.macro checknil, reg; cmpwi reg, LJ_TNIL; .endmacro\n|\n|.macro branch_RD\n|  srwi TMP0, RD, 1\n|  addis PC, PC, -(BCBIAS_J*4 >> 16)\n|  add PC, PC, TMP0\n|.endmacro\n|\n|// Assumes DISPATCH is relative to GL.\n#define DISPATCH_GL(field)\t(GG_DISP2G + (int)offsetof(global_State, field))\n#define DISPATCH_J(field)\t(GG_DISP2J + (int)offsetof(jit_State, field))\n|\n#define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))\n|\n|.macro hotcheck, delta, target\n|  rlwinm TMP1, PC, 31, 25, 30\n|  addi TMP1, TMP1, GG_DISP2HOT\n|  lhzx TMP2, DISPATCH, TMP1\n|  addic. TMP2, TMP2, -delta\n|  sthx TMP2, DISPATCH, TMP1\n|  blt target\n|.endmacro\n|\n|.macro hotloop\n|  hotcheck HOTCOUNT_LOOP, ->vm_hotloop\n|.endmacro\n|\n|.macro hotcall\n|  hotcheck HOTCOUNT_CALL, ->vm_hotcall\n|.endmacro\n|\n|// Set current VM state. Uses TMP0.\n|.macro li_vmstate, st; li TMP0, ~LJ_VMST_..st; .endmacro\n|.macro st_vmstate; stw TMP0, DISPATCH_GL(vmstate)(DISPATCH); .endmacro\n|\n|// Move table write barrier back. Overwrites mark and tmp.\n|.macro barrierback, tab, mark, tmp\n|  lwz tmp, DISPATCH_GL(gc.grayagain)(DISPATCH)\n|  // Assumes LJ_GC_BLACK is 0x04.\n|   rlwinm mark, mark, 0, 30, 28\t\t// black2gray(tab)\n|  stw tab, DISPATCH_GL(gc.grayagain)(DISPATCH)\n|   stb mark, tab->marked\n|  stw tmp, tab->gclist\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n\n/* Generate subroutines used by opcodes and other parts of the VM. */\n/* The .code_sub section should be last to help static branch prediction. */\nstatic void build_subroutines(BuildCtx *ctx)\n{\n  |.code_sub\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Return handling ----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_returnp:\n  |  // See vm_return. Also: TMP2 = previous base.\n  |  andix. TMP0, PC, FRAME_P\n  |   li TMP1, LJ_TTRUE\n  |  beq ->cont_dispatch\n  |\n  |  // Return from pcall or xpcall fast func.\n  |  lwz PC, FRAME_PC(TMP2)\t\t// Fetch PC of previous frame.\n  |  mr BASE, TMP2\t\t\t// Restore caller base.\n  |  // Prepending may overwrite the pcall frame, so do it at the end.\n  |   stwu TMP1, FRAME_PC(RA)\t\t// Prepend true to results.\n  |\n  |->vm_returnc:\n  |  addi RD, RD, 8\t\t\t// RD = (nresults+1)*8.\n  |   andix. TMP0, PC, FRAME_TYPE\n  |  cmpwi cr1, RD, 0\n  |  li CRET1, LUA_YIELD\n  |  beq cr1, ->vm_unwind_c_eh\n  |  mr MULTRES, RD\n  |   beq ->BC_RET_Z\t\t\t// Handle regular return to Lua.\n  |\n  |->vm_return:\n  |  // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return\n  |  // TMP0 = PC & FRAME_TYPE\n  |  cmpwi TMP0, FRAME_C\n  |   rlwinm TMP2, PC, 0, 0, 28\n  |    li_vmstate C\n  |   sub TMP2, BASE, TMP2\t\t// TMP2 = previous base.\n  |  bney ->vm_returnp\n  |\n  |  addic. TMP1, RD, -8\n  |   stp TMP2, L->base\n  |   lwz TMP2, SAVE_NRES\n  |    subi BASE, BASE, 8\n  |    st_vmstate\n  |   slwi TMP2, TMP2, 3\n  |  beq >2\n  |1:\n  |  addic. TMP1, TMP1, -8\n  |   lfd f0, 0(RA)\n  |    addi RA, RA, 8\n  |   stfd f0, 0(BASE)\n  |    addi BASE, BASE, 8\n  |  bney <1\n  |\n  |2:\n  |  cmpw TMP2, RD\t\t\t// More/less results wanted?\n  |  bne >6\n  |3:\n  |  stp BASE, L->top\t\t\t// Store new top.\n  |\n  |->vm_leave_cp:\n  |  lp TMP0, SAVE_CFRAME\t\t// Restore previous C frame.\n  |   li CRET1, 0\t\t\t// Ok return status for vm_pcall.\n  |  stp TMP0, L->cframe\n  |\n  |->vm_leave_unw:\n  |  restoreregs\n  |  blr\n  |\n  |6:\n  |  ble >7\t\t\t\t// Less results wanted?\n  |  // More results wanted. Check stack size and fill up results with nil.\n  |  lwz TMP1, L->maxstack\n  |  cmplw BASE, TMP1\n  |  bge >8\n  |  stw TISNIL, 0(BASE)\n  |  addi RD, RD, 8\n  |  addi BASE, BASE, 8\n  |  b <2\n  |\n  |7:  // Less results wanted.\n  |  subfic TMP3, TMP2, 0\t\t// LUA_MULTRET+1 case?\n  |   sub TMP0, RD, TMP2\n  |  subfe TMP1, TMP1, TMP1\t\t// TMP1 = TMP2 == 0 ? 0 : -1\n  |   and TMP0, TMP0, TMP1\n  |  sub BASE, BASE, TMP0\t\t// Either keep top or shrink it.\n  |  b <3\n  |\n  |8:  // Corner case: need to grow stack for filling up results.\n  |  // This can happen if:\n  |  // - A C function grows the stack (a lot).\n  |  // - The GC shrinks the stack in between.\n  |  // - A return back from a lua_call() with (high) nresults adjustment.\n  |  stp BASE, L->top\t\t\t// Save current top held in BASE (yes).\n  |   mr SAVE0, RD\n  |  mr CARG2, TMP2\n  |  mr CARG1, L\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |    lwz TMP2, SAVE_NRES\n  |   mr RD, SAVE0\n  |    slwi TMP2, TMP2, 3\n  |  lp BASE, L->top\t\t\t// Need the (realloced) L->top in BASE.\n  |  b <2\n  |\n  |->vm_unwind_c:\t\t\t// Unwind C stack, return from vm_pcall.\n  |  // (void *cframe, int errcode)\n  |  mr sp, CARG1\n  |  mr CRET1, CARG2\n  |->vm_unwind_c_eh:\t\t\t// Landing pad for external unwinder.\n  |  lwz L, SAVE_L\n  |  .toc ld TOCREG, SAVE_TOC\n  |   li TMP0, ~LJ_VMST_C\n  |  lwz GL:TMP1, L->glref\n  |   stw TMP0, GL:TMP1->vmstate\n  |  b ->vm_leave_unw\n  |\n  |->vm_unwind_ff:\t\t\t// Unwind C stack, return from ff pcall.\n  |  // (void *cframe)\n  |.if GPR64\n  |  rldicr sp, CARG1, 0, 61\n  |.else\n  |  rlwinm sp, CARG1, 0, 0, 29\n  |.endif\n  |->vm_unwind_ff_eh:\t\t\t// Landing pad for external unwinder.\n  |  lwz L, SAVE_L\n  |  .toc ld TOCREG, SAVE_TOC\n  |     li TISNUM, LJ_TISNUM\t\t// Setup type comparison constants.\n  |  lp BASE, L->base\n  |     lus TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |   lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |     li ZERO, 0\n  |     stw TMP3, TMPD\n  |  li TMP1, LJ_TFALSE\n  |     ori TMP3, TMP3, 0x0004\t\t// TONUM = 2^52 + 2^51 + 2^31 (float).\n  |     li TISNIL, LJ_TNIL\n  |    li_vmstate INTERP\n  |     lfs TOBIT, TMPD\n  |  lwz PC, FRAME_PC(BASE)\t\t// Fetch PC of previous frame.\n  |  la RA, -8(BASE)\t\t\t// Results start at BASE-8.\n  |     stw TMP3, TMPD\n  |   addi DISPATCH, DISPATCH, GG_G2DISP\n  |  stw TMP1, 0(RA)\t\t\t// Prepend false to error message.\n  |  li RD, 16\t\t\t\t// 2 results: false + error message.\n  |    st_vmstate\n  |     lfs TONUM, TMPD\n  |  b ->vm_returnc\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Grow stack for calls -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_growstack_c:\t\t\t// Grow stack for C function.\n  |  li CARG2, LUA_MINSTACK\n  |  b >2\n  |\n  |->vm_growstack_l:\t\t\t// Grow stack for Lua function.\n  |  // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC\n  |  add RC, BASE, RC\n  |   sub RA, RA, BASE\n  |  stp BASE, L->base\n  |   addi PC, PC, 4\t\t\t// Must point after first instruction.\n  |  stp RC, L->top\n  |   srwi CARG2, RA, 3\n  |2:\n  |  // L->base = new base, L->top = top\n  |   stw PC, SAVE_PC\n  |  mr CARG1, L\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  lp BASE, L->base\n  |  lp RC, L->top\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |  sub RC, RC, BASE\n  |  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n  |  ins_callt\t\t\t\t// Just retry the call.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Entry points into the assembler VM ---------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_resume:\t\t\t\t// Setup C frame and resume thread.\n  |  // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0)\n  |  saveregs\n  |  mr L, CARG1\n  |    lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |  mr BASE, CARG2\n  |    lbz TMP1, L->status\n  |   stw L, SAVE_L\n  |  li PC, FRAME_CP\n  |  addi TMP0, sp, CFRAME_RESUME\n  |    addi DISPATCH, DISPATCH, GG_G2DISP\n  |   stw CARG3, SAVE_NRES\n  |    cmplwi TMP1, 0\n  |   stw CARG3, SAVE_ERRF\n  |  stp TMP0, L->cframe\n  |   stp CARG3, SAVE_CFRAME\n  |   stw CARG1, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |    beq >3\n  |\n  |  // Resume after yield (like a return).\n  |  mr RA, BASE\n  |   lp BASE, L->base\n  |     li TISNUM, LJ_TISNUM\t\t// Setup type comparison constants.\n  |   lp TMP1, L->top\n  |  lwz PC, FRAME_PC(BASE)\n  |     lus TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |    stb CARG3, L->status\n  |     stw TMP3, TMPD\n  |     ori TMP3, TMP3, 0x0004\t\t// TONUM = 2^52 + 2^51 + 2^31 (float).\n  |     lfs TOBIT, TMPD\n  |   sub RD, TMP1, BASE\n  |     stw TMP3, TMPD\n  |     lus TMP0, 0x4338\t\t// Hiword of 2^52 + 2^51 (double)\n  |   addi RD, RD, 8\n  |     stw TMP0, TONUM_HI\n  |    li_vmstate INTERP\n  |     li ZERO, 0\n  |    st_vmstate\n  |  andix. TMP0, PC, FRAME_TYPE\n  |   mr MULTRES, RD\n  |     lfs TONUM, TMPD\n  |     li TISNIL, LJ_TNIL\n  |  beq ->BC_RET_Z\n  |  b ->vm_return\n  |\n  |->vm_pcall:\t\t\t\t// Setup protected C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef)\n  |  saveregs\n  |  li PC, FRAME_CP\n  |  stw CARG4, SAVE_ERRF\n  |  b >1\n  |\n  |->vm_call:\t\t\t\t// Setup C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1)\n  |  saveregs\n  |  li PC, FRAME_C\n  |\n  |1:  // Entry point for vm_pcall above (PC = ftype).\n  |  lp TMP1, L:CARG1->cframe\n  |   stw CARG3, SAVE_NRES\n  |    mr L, CARG1\n  |   stw CARG1, SAVE_L\n  |    mr BASE, CARG2\n  |  stp sp, L->cframe\t\t\t// Add our C frame to cframe chain.\n  |    lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |   stw CARG1, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |  stp TMP1, SAVE_CFRAME\n  |    addi DISPATCH, DISPATCH, GG_G2DISP\n  |\n  |3:  // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype).\n  |  lp TMP2, L->base\t\t\t// TMP2 = old base (used in vmeta_call).\n  |     li TISNUM, LJ_TISNUM\t\t// Setup type comparison constants.\n  |   lp TMP1, L->top\n  |     lus TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |  add PC, PC, BASE\n  |     stw TMP3, TMPD\n  |     li ZERO, 0\n  |     ori TMP3, TMP3, 0x0004\t\t// TONUM = 2^52 + 2^51 + 2^31 (float).\n  |     lfs TOBIT, TMPD\n  |  sub PC, PC, TMP2\t\t\t// PC = frame delta + frame type\n  |     stw TMP3, TMPD\n  |     lus TMP0, 0x4338\t\t// Hiword of 2^52 + 2^51 (double)\n  |   sub NARGS8:RC, TMP1, BASE\n  |     stw TMP0, TONUM_HI\n  |    li_vmstate INTERP\n  |     lfs TONUM, TMPD\n  |     li TISNIL, LJ_TNIL\n  |    st_vmstate\n  |\n  |->vm_call_dispatch:\n  |  // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC\n  |  lwz TMP0, FRAME_PC(BASE)\n  |   lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |  checkfunc TMP0; bne ->vmeta_call\n  |\n  |->vm_call_dispatch_f:\n  |  ins_call\n  |  // BASE = new base, RB = func, RC = nargs*8, PC = caller PC\n  |\n  |->vm_cpcall:\t\t\t\t// Setup protected C frame, call C.\n  |  // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp)\n  |  saveregs\n  |  mr L, CARG1\n  |   lwz TMP0, L:CARG1->stack\n  |  stw CARG1, SAVE_L\n  |   lp TMP1, L->top\n  |  stw CARG1, SAVE_PC\t\t\t// Any value outside of bytecode is ok.\n  |   sub TMP0, TMP0, TMP1\t\t// Compute -savestack(L, L->top).\n  |    lp TMP1, L->cframe\n  |    stp sp, L->cframe\t\t// Add our C frame to cframe chain.\n  |  .toc lp CARG4, 0(CARG4)\n  |  li TMP2, 0\n  |   stw TMP0, SAVE_NRES\t\t// Neg. delta means cframe w/o frame.\n  |  stw TMP2, SAVE_ERRF\t\t// No error function.\n  |    stp TMP1, SAVE_CFRAME\n  |  mtctr CARG4\n  |  bctrl\t\t\t// (lua_State *L, lua_CFunction func, void *ud)\n  |.if PPE\n  |  mr BASE, CRET1\n  |  cmpwi CRET1, 0\n  |.else\n  |  mr. BASE, CRET1\n  |.endif\n  |   lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |    li PC, FRAME_CP\n  |   addi DISPATCH, DISPATCH, GG_G2DISP\n  |  bne <3\t\t\t\t// Else continue with the call.\n  |  b ->vm_leave_cp\t\t\t// No base? Just remove C frame.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Metamethod handling ------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// The lj_meta_* functions (except for lj_meta_cat) don't reallocate the\n  |// stack, so BASE doesn't need to be reloaded across these calls.\n  |\n  |//-- Continuation dispatch ----------------------------------------------\n  |\n  |->cont_dispatch:\n  |  // BASE = meta base, RA = resultptr, RD = (nresults+1)*8\n  |  lwz TMP0, -12(BASE)\t\t// Continuation.\n  |   mr RB, BASE\n  |   mr BASE, TMP2\t\t\t// Restore caller BASE.\n  |    lwz LFUNC:TMP1, FRAME_FUNC(TMP2)\n  |.if FFI\n  |  cmplwi TMP0, 1\n  |.endif\n  |     lwz PC, -16(RB)\t\t\t// Restore PC from [cont|PC].\n  |   subi TMP2, RD, 8\n  |    lwz TMP1, LFUNC:TMP1->pc\n  |   stwx TISNIL, RA, TMP2\t\t// Ensure one valid arg.\n  |.if FFI\n  |  ble >1\n  |.endif\n  |    lwz KBASE, PC2PROTO(k)(TMP1)\n  |  // BASE = base, RA = resultptr, RB = meta base\n  |  mtctr TMP0\n  |  bctr\t\t\t\t// Jump to continuation.\n  |\n  |.if FFI\n  |1:\n  |  beq ->cont_ffi_callback\t\t// cont = 1: return from FFI callback.\n  |  // cont = 0: tailcall from C function.\n  |  subi TMP1, RB, 16\n  |  sub RC, TMP1, BASE\n  |  b ->vm_call_tail\n  |.endif\n  |\n  |->cont_cat:\t\t\t\t// RA = resultptr, RB = meta base\n  |  lwz INS, -4(PC)\n  |   subi CARG2, RB, 16\n  |  decode_RB8 SAVE0, INS\n  |   lfd f0, 0(RA)\n  |  add TMP1, BASE, SAVE0\n  |   stp BASE, L->base\n  |  cmplw TMP1, CARG2\n  |   sub CARG3, CARG2, TMP1\n  |  decode_RA8 RA, INS\n  |   stfd f0, 0(CARG2)\n  |  bney ->BC_CAT_Z\n  |   stfdx f0, BASE, RA\n  |  b ->cont_nop\n  |\n  |//-- Table indexing metamethods -----------------------------------------\n  |\n  |->vmeta_tgets1:\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |  li TMP0, LJ_TSTR\n  |   decode_RB8 RB, INS\n  |  stw STR:RC, 4(CARG3)\n  |   add CARG2, BASE, RB\n  |  stw TMP0, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tgets:\n  |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)\n  |  li TMP0, LJ_TTAB\n  |  stw TAB:RB, 4(CARG2)\n  |   la CARG3, DISPATCH_GL(tmptv2)(DISPATCH)\n  |  stw TMP0, 0(CARG2)\n  |   li TMP1, LJ_TSTR\n  |   stw STR:RC, 4(CARG3)\n  |   stw TMP1, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tgetb:\t\t\t// TMP0 = index\n  |.if not DUALNUM\n  |  tonum_u f0, TMP0\n  |.endif\n  |   decode_RB8 RB, INS\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |   add CARG2, BASE, RB\n  |.if DUALNUM\n  |  stw TISNUM, 0(CARG3)\n  |  stw TMP0, 4(CARG3)\n  |.else\n  |  stfd f0, 0(CARG3)\n  |.endif\n  |  b >1\n  |\n  |->vmeta_tgetv:\n  |  decode_RB8 RB, INS\n  |   decode_RC8 RC, INS\n  |  add CARG2, BASE, RB\n  |   add CARG3, BASE, RC\n  |1:\n  |  stp BASE, L->base\n  |  mr CARG1, L\n  |  stw PC, SAVE_PC\n  |  bl extern lj_meta_tget\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  cmplwi CRET1, 0\n  |  beq >3\n  |   lfd f0, 0(CRET1)\n  |  ins_next1\n  |   stfdx f0, BASE, RA\n  |  ins_next2\n  |\n  |3:  // Call __index metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k\n  |  subfic TMP1, BASE, FRAME_CONT\n  |  lp BASE, L->top\n  |  stw PC, -16(BASE)\t\t\t// [cont|PC]\n  |   add PC, TMP1, BASE\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |   li NARGS8:RC, 16\t\t\t// 2 args for func(t, k).\n  |  b ->vm_call_dispatch_f\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->vmeta_tsets1:\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |  li TMP0, LJ_TSTR\n  |   decode_RB8 RB, INS\n  |  stw STR:RC, 4(CARG3)\n  |   add CARG2, BASE, RB\n  |  stw TMP0, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tsets:\n  |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)\n  |  li TMP0, LJ_TTAB\n  |  stw TAB:RB, 4(CARG2)\n  |   la CARG3, DISPATCH_GL(tmptv2)(DISPATCH)\n  |  stw TMP0, 0(CARG2)\n  |   li TMP1, LJ_TSTR\n  |   stw STR:RC, 4(CARG3)\n  |   stw TMP1, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tsetb:\t\t\t// TMP0 = index\n  |.if not DUALNUM\n  |  tonum_u f0, TMP0\n  |.endif\n  |   decode_RB8 RB, INS\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |   add CARG2, BASE, RB\n  |.if DUALNUM\n  |  stw TISNUM, 0(CARG3)\n  |  stw TMP0, 4(CARG3)\n  |.else\n  |  stfd f0, 0(CARG3)\n  |.endif\n  |  b >1\n  |\n  |->vmeta_tsetv:\n  |  decode_RB8 RB, INS\n  |   decode_RC8 RC, INS\n  |  add CARG2, BASE, RB\n  |   add CARG3, BASE, RC\n  |1:\n  |  stp BASE, L->base\n  |  mr CARG1, L\n  |  stw PC, SAVE_PC\n  |  bl extern lj_meta_tset\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  cmplwi CRET1, 0\n  |   lfdx f0, BASE, RA\n  |  beq >3\n  |  // NOBARRIER: lj_meta_tset ensures the table is not black.\n  |  ins_next1\n  |   stfd f0, 0(CRET1)\n  |  ins_next2\n  |\n  |3:  // Call __newindex metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k/(v)\n  |  subfic TMP1, BASE, FRAME_CONT\n  |  lp BASE, L->top\n  |  stw PC, -16(BASE)\t\t\t// [cont|PC]\n  |   add PC, TMP1, BASE\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |   li NARGS8:RC, 24\t\t\t// 3 args for func(t, k, v)\n  |  stfd f0, 16(BASE)\t\t\t// Copy value to third argument.\n  |  b ->vm_call_dispatch_f\n  |\n  |//-- Comparison metamethods ---------------------------------------------\n  |\n  |->vmeta_comp:\n  |  mr CARG1, L\n  |   subi PC, PC, 4\n  |.if DUALNUM\n  |  mr CARG2, RA\n  |.else\n  |  add CARG2, BASE, RA\n  |.endif\n  |   stw PC, SAVE_PC\n  |.if DUALNUM\n  |  mr CARG3, RD\n  |.else\n  |  add CARG3, BASE, RD\n  |.endif\n  |   stp BASE, L->base\n  |  decode_OP1 CARG4, INS\n  |  bl extern lj_meta_comp  // (lua_State *L, TValue *o1, *o2, int op)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |3:\n  |  cmplwi CRET1, 1\n  |  bgt ->vmeta_binop\n  |  subfic CRET1, CRET1, 0\n  |4:\n  |  lwz INS, 0(PC)\n  |   addi PC, PC, 4\n  |  decode_RD4 TMP2, INS\n  |  addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n  |  and TMP2, TMP2, CRET1\n  |  add PC, PC, TMP2\n  |->cont_nop:\n  |  ins_next\n  |\n  |->cont_ra:\t\t\t\t// RA = resultptr\n  |  lwz INS, -4(PC)\n  |   lfd f0, 0(RA)\n  |  decode_RA8 TMP1, INS\n  |   stfdx f0, BASE, TMP1\n  |  b ->cont_nop\n  |\n  |->cont_condt:\t\t\t// RA = resultptr\n  |  lwz TMP0, 0(RA)\n  |  .gpr64 extsw TMP0, TMP0\n  |  subfic TMP0, TMP0, LJ_TTRUE\t// Branch if result is true.\n  |  subfe CRET1, CRET1, CRET1\n  |  not CRET1, CRET1\n  |  b <4\n  |\n  |->cont_condf:\t\t\t// RA = resultptr\n  |  lwz TMP0, 0(RA)\n  |  .gpr64 extsw TMP0, TMP0\n  |  subfic TMP0, TMP0, LJ_TTRUE\t// Branch if result is false.\n  |  subfe CRET1, CRET1, CRET1\n  |  b <4\n  |\n  |->vmeta_equal:\n  |  // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV.\n  |  subi PC, PC, 4\n  |   stp BASE, L->base\n  |  mr CARG1, L\n  |   stw PC, SAVE_PC\n  |  bl extern lj_meta_equal  // (lua_State *L, GCobj *o1, *o2, int ne)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |  b <3\n  |\n  |->vmeta_equal_cd:\n  |.if FFI\n  |  mr CARG2, INS\n  |  subi PC, PC, 4\n  |   stp BASE, L->base\n  |  mr CARG1, L\n  |   stw PC, SAVE_PC\n  |  bl extern lj_meta_equal_cd\t\t// (lua_State *L, BCIns op)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |  b <3\n  |.endif\n  |\n  |//-- Arithmetic metamethods ---------------------------------------------\n  |\n  |->vmeta_arith_nv:\n  |  add CARG3, KBASE, RC\n  |  add CARG4, BASE, RB\n  |  b >1\n  |->vmeta_arith_nv2:\n  |.if DUALNUM\n  |  mr CARG3, RC\n  |  mr CARG4, RB\n  |  b >1\n  |.endif\n  |\n  |->vmeta_unm:\n  |  mr CARG3, RD\n  |  mr CARG4, RD\n  |  b >1\n  |\n  |->vmeta_arith_vn:\n  |  add CARG3, BASE, RB\n  |  add CARG4, KBASE, RC\n  |  b >1\n  |\n  |->vmeta_arith_vv:\n  |  add CARG3, BASE, RB\n  |  add CARG4, BASE, RC\n  |.if DUALNUM\n  |  b >1\n  |.endif\n  |->vmeta_arith_vn2:\n  |->vmeta_arith_vv2:\n  |.if DUALNUM\n  |  mr CARG3, RB\n  |  mr CARG4, RC\n  |.endif\n  |1:\n  |  add CARG2, BASE, RA\n  |   stp BASE, L->base\n  |  mr CARG1, L\n  |   stw PC, SAVE_PC\n  |  decode_OP1 CARG5, INS\t\t// Caveat: CARG5 overlaps INS.\n  |  bl extern lj_meta_arith  // (lua_State *L, TValue *ra,*rb,*rc, BCReg op)\n  |  // Returns NULL (finished) or TValue * (metamethod).\n  |  cmplwi CRET1, 0\n  |  beq ->cont_nop\n  |\n  |  // Call metamethod for binary op.\n  |->vmeta_binop:\n  |  // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2\n  |  sub TMP1, CRET1, BASE\n  |   stw PC, -16(CRET1)\t\t// [cont|PC]\n  |   mr TMP2, BASE\n  |  addi PC, TMP1, FRAME_CONT\n  |   mr BASE, CRET1\n  |  li NARGS8:RC, 16\t\t\t// 2 args for func(o1, o2).\n  |  b ->vm_call_dispatch\n  |\n  |->vmeta_len:\n#if LJ_52\n  |  mr SAVE0, CARG1\n#endif\n  |  mr CARG2, RD\n  |   stp BASE, L->base\n  |  mr CARG1, L\n  |   stw PC, SAVE_PC\n  |  bl extern lj_meta_len\t\t// (lua_State *L, TValue *o)\n  |  // Returns NULL (retry) or TValue * (metamethod base).\n#if LJ_52\n  |  cmplwi CRET1, 0\n  |  bne ->vmeta_binop\t\t\t// Binop call for compatibility.\n  |  mr CARG1, SAVE0\n  |  b ->BC_LEN_Z\n#else\n  |  b ->vmeta_binop\t\t\t// Binop call for compatibility.\n#endif\n  |\n  |//-- Call metamethod ----------------------------------------------------\n  |\n  |->vmeta_call:\t\t\t// Resolve and call __call metamethod.\n  |  // TMP2 = old base, BASE = new base, RC = nargs*8\n  |  mr CARG1, L\n  |   stp TMP2, L->base\t\t\t// This is the callers base!\n  |  subi CARG2, BASE, 8\n  |   stw PC, SAVE_PC\n  |  add CARG3, BASE, RC\n  |   mr SAVE0, NARGS8:RC\n  |  bl extern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |   addi NARGS8:RC, SAVE0, 8\t\t// Got one more argument now.\n  |  ins_call\n  |\n  |->vmeta_callt:\t\t\t// Resolve __call for BC_CALLT.\n  |  // BASE = old base, RA = new base, RC = nargs*8\n  |  mr CARG1, L\n  |   stp BASE, L->base\n  |  subi CARG2, RA, 8\n  |   stw PC, SAVE_PC\n  |  add CARG3, RA, RC\n  |   mr SAVE0, NARGS8:RC\n  |  bl extern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |  lwz TMP1, FRAME_PC(BASE)\n  |   addi NARGS8:RC, SAVE0, 8\t\t// Got one more argument now.\n  |   lwz LFUNC:RB, FRAME_FUNC(RA)\t// Guaranteed to be a function here.\n  |  b ->BC_CALLT_Z\n  |\n  |//-- Argument coercion for 'for' statement ------------------------------\n  |\n  |->vmeta_for:\n  |  mr CARG1, L\n  |   stp BASE, L->base\n  |  mr CARG2, RA\n  |   stw PC, SAVE_PC\n  |  mr SAVE0, INS\n  |  bl extern lj_meta_for\t// (lua_State *L, TValue *base)\n  |.if JIT\n  |   decode_OP1 TMP0, SAVE0\n  |.endif\n  |  decode_RA8 RA, SAVE0\n  |.if JIT\n  |   cmpwi TMP0, BC_JFORI\n  |.endif\n  |  decode_RD8 RD, SAVE0\n  |.if JIT\n  |   beqy =>BC_JFORI\n  |.endif\n  |  b =>BC_FORI\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Fast functions -----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |.macro .ffunc, name\n  |->ff_ .. name:\n  |.endmacro\n  |\n  |.macro .ffunc_1, name\n  |->ff_ .. name:\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG3, 0(BASE)\n  |    lwz CARG1, 4(BASE)\n  |  blt ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_2, name\n  |->ff_ .. name:\n  |  cmplwi NARGS8:RC, 16\n  |   lwz CARG3, 0(BASE)\n  |    lwz CARG4, 8(BASE)\n  |   lwz CARG1, 4(BASE)\n  |    lwz CARG2, 12(BASE)\n  |  blt ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_n, name\n  |->ff_ .. name:\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG3, 0(BASE)\n  |    lfd FARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |  checknum CARG3; bge ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_nn, name\n  |->ff_ .. name:\n  |  cmplwi NARGS8:RC, 16\n  |   lwz CARG3, 0(BASE)\n  |    lfd FARG1, 0(BASE)\n  |   lwz CARG4, 8(BASE)\n  |    lfd FARG2, 8(BASE)\n  |  blt ->fff_fallback\n  |  checknum CARG3; bge ->fff_fallback\n  |  checknum CARG4; bge ->fff_fallback\n  |.endmacro\n  |\n  |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1.\n  |.macro ffgccheck\n  |  lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH)\n  |  lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)\n  |  cmplw TMP0, TMP1\n  |  bgel ->fff_gcstep\n  |.endmacro\n  |\n  |//-- Base library: checks -----------------------------------------------\n  |\n  |.ffunc_1 assert\n  |  li TMP1, LJ_TFALSE\n  |   la RA, -8(BASE)\n  |  cmplw cr1, CARG3, TMP1\n  |    lwz PC, FRAME_PC(BASE)\n  |  bge cr1, ->fff_fallback\n  |   stw CARG3, 0(RA)\n  |  addi RD, NARGS8:RC, 8\t\t// Compute (nresults+1)*8.\n  |   stw CARG1, 4(RA)\n  |  beq ->fff_res\t\t\t// Done if exactly 1 argument.\n  |  li TMP1, 8\n  |  subi RC, RC, 8\n  |1:\n  |  cmplw TMP1, RC\n  |   lfdx f0, BASE, TMP1\n  |   stfdx f0, RA, TMP1\n  |    addi TMP1, TMP1, 8\n  |  bney <1\n  |  b ->fff_res\n  |\n  |.ffunc type\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |  .gpr64 extsw CARG1, CARG1\n  |  subfc TMP0, TISNUM, CARG1\n  |  subfe TMP2, CARG1, CARG1\n  |  orc TMP1, TMP2, TMP0\n  |  addi TMP1, TMP1, ~LJ_TISNUM+1\n  |  slwi TMP1, TMP1, 3\n  |   la TMP2, CFUNC:RB->upvalue\n  |  lfdx FARG1, TMP2, TMP1\n  |  b ->fff_resn\n  |\n  |//-- Base library: getters and setters ---------------------------------\n  |\n  |.ffunc_1 getmetatable\n  |  checktab CARG3; bne >6\n  |1:  // Field metatable must be at same offset for GCtab and GCudata!\n  |  lwz TAB:CARG1, TAB:CARG1->metatable\n  |2:\n  |  li CARG3, LJ_TNIL\n  |   cmplwi TAB:CARG1, 0\n  |  lwz STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH)\n  |   beq ->fff_restv\n  |  lwz TMP0, TAB:CARG1->hmask\n  |   li CARG3, LJ_TTAB\t\t\t// Use metatable as default result.\n  |  lwz TMP1, STR:RC->hash\n  |  lwz NODE:TMP2, TAB:CARG1->node\n  |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n  |  slwi TMP0, TMP1, 5\n  |  slwi TMP1, TMP1, 3\n  |  sub TMP1, TMP0, TMP1\n  |  add NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n  |3:  // Rearranged logic, because we expect _not_ to find the key.\n  |  lwz CARG4, NODE:TMP2->key\n  |   lwz TMP0, 4+offsetof(Node, key)(NODE:TMP2)\n  |    lwz CARG2, NODE:TMP2->val\n  |     lwz TMP1, 4+offsetof(Node, val)(NODE:TMP2)\n  |  checkstr CARG4; bne >4\n  |   cmpw TMP0, STR:RC; beq >5\n  |4:\n  |  lwz NODE:TMP2, NODE:TMP2->next\n  |  cmplwi NODE:TMP2, 0\n  |  beq ->fff_restv\t\t\t// Not found, keep default result.\n  |  b <3\n  |5:\n  |  checknil CARG2\n  |  beq ->fff_restv\t\t\t// Ditto for nil value.\n  |  mr CARG3, CARG2\t\t\t// Return value of mt.__metatable.\n  |  mr CARG1, TMP1\n  |  b ->fff_restv\n  |\n  |6:\n  |  cmpwi CARG3, LJ_TUDATA; beq <1\n  |  .gpr64 extsw CARG3, CARG3\n  |  subfc TMP0, TISNUM, CARG3\n  |  subfe TMP2, CARG3, CARG3\n  |  orc TMP1, TMP2, TMP0\n  |  addi TMP1, TMP1, ~LJ_TISNUM+1\n  |  slwi TMP1, TMP1, 2\n  |   la TMP2, DISPATCH_GL(gcroot[GCROOT_BASEMT])(DISPATCH)\n  |  lwzx TAB:CARG1, TMP2, TMP1\n  |  b <2\n  |\n  |.ffunc_2 setmetatable\n  |  // Fast path: no mt for table yet and not clearing the mt.\n  |   checktab CARG3; bne ->fff_fallback\n  |  lwz TAB:TMP1, TAB:CARG1->metatable\n  |   checktab CARG4; bne ->fff_fallback\n  |  cmplwi TAB:TMP1, 0\n  |   lbz TMP3, TAB:CARG1->marked\n  |  bne ->fff_fallback\n  |   andix. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n  |    stw TAB:CARG2, TAB:CARG1->metatable\n  |   beq ->fff_restv\n  |  barrierback TAB:CARG1, TMP3, TMP0\n  |  b ->fff_restv\n  |\n  |.ffunc rawget\n  |  cmplwi NARGS8:RC, 16\n  |   lwz CARG4, 0(BASE)\n  |    lwz TAB:CARG2, 4(BASE)\n  |  blt ->fff_fallback\n  |  checktab CARG4; bne ->fff_fallback\n  |   la CARG3, 8(BASE)\n  |   mr CARG1, L\n  |  bl extern lj_tab_get  // (lua_State *L, GCtab *t, cTValue *key)\n  |  // Returns cTValue *.\n  |  lfd FARG1, 0(CRET1)\n  |  b ->fff_resn\n  |\n  |//-- Base library: conversions ------------------------------------------\n  |\n  |.ffunc tonumber\n  |  // Only handles the number case inline (without a base argument).\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG1, 0(BASE)\n  |    lfd FARG1, 0(BASE)\n  |  bne ->fff_fallback\t\t\t// Exactly one argument.\n  |   checknum CARG1; bgt ->fff_fallback\n  |  b ->fff_resn\n  |\n  |.ffunc_1 tostring\n  |  // Only handles the string or number case inline.\n  |  checkstr CARG3\n  |  // A __tostring method in the string base metatable is ignored.\n  |  beq ->fff_restv\t\t\t// String key?\n  |  // Handle numbers inline, unless a number base metatable is present.\n  |  lwz TMP0, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH)\n  |  checknum CARG3\n  |  cmplwi cr1, TMP0, 0\n  |   stp BASE, L->base\t\t\t// Add frame since C call can throw.\n  |  crorc 4*cr0+eq, 4*cr0+gt, 4*cr1+eq\n  |   stw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  beq ->fff_fallback\n  |  ffgccheck\n  |  mr CARG1, L\n  |  mr CARG2, BASE\n  |.if DUALNUM\n  |  bl extern lj_str_fromnumber\t// (lua_State *L, cTValue *o)\n  |.else\n  |  bl extern lj_str_fromnum\t\t// (lua_State *L, lua_Number *np)\n  |.endif\n  |  // Returns GCstr *.\n  |  li CARG3, LJ_TSTR\n  |  b ->fff_restv\n  |\n  |//-- Base library: iterators -------------------------------------------\n  |\n  |.ffunc next\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG1, 0(BASE)\n  |    lwz TAB:CARG2, 4(BASE)\n  |  blt ->fff_fallback\n  |   stwx TISNIL, BASE, NARGS8:RC\t// Set missing 2nd arg to nil.\n  |  checktab CARG1\n  |   lwz PC, FRAME_PC(BASE)\n  |  bne ->fff_fallback\n  |   stp BASE, L->base\t\t\t// Add frame since C call can throw.\n  |  mr CARG1, L\n  |   stp BASE, L->top\t\t\t// Dummy frame length is ok.\n  |  la CARG3, 8(BASE)\n  |   stw PC, SAVE_PC\n  |  bl extern lj_tab_next\t// (lua_State *L, GCtab *t, TValue *key)\n  |  // Returns 0 at end of traversal.\n  |  cmplwi CRET1, 0\n  |   li CARG3, LJ_TNIL\n  |  beq ->fff_restv\t\t\t// End of traversal: return nil.\n  |  lfd f0, 8(BASE)\t\t\t// Copy key and value to results.\n  |   la RA, -8(BASE)\n  |  lfd f1, 16(BASE)\n  |  stfd f0, 0(RA)\n  |   li RD, (2+1)*8\n  |  stfd f1, 8(RA)\n  |  b ->fff_res\n  |\n  |.ffunc_1 pairs\n  |  checktab CARG3\n  |   lwz PC, FRAME_PC(BASE)\n  |  bne ->fff_fallback\n#if LJ_52\n  |   lwz TAB:TMP2, TAB:CARG1->metatable\n  |  lfd f0, CFUNC:RB->upvalue[0]\n  |   cmplwi TAB:TMP2, 0\n  |  la RA, -8(BASE)\n  |   bne ->fff_fallback\n#else\n  |  lfd f0, CFUNC:RB->upvalue[0]\n  |  la RA, -8(BASE)\n#endif\n  |   stw TISNIL, 8(BASE)\n  |  li RD, (3+1)*8\n  |  stfd f0, 0(RA)\n  |  b ->fff_res\n  |\n  |.ffunc ipairs_aux\n  |  cmplwi NARGS8:RC, 16\n  |   lwz CARG3, 0(BASE)\n  |    lwz TAB:CARG1, 4(BASE)\n  |   lwz CARG4, 8(BASE)\n  |.if DUALNUM\n  |    lwz TMP2, 12(BASE)\n  |.else\n  |    lfd FARG2, 8(BASE)\n  |.endif\n  |  blt ->fff_fallback\n  |  checktab CARG3\n  |  checknum cr1, CARG4\n  |   lwz PC, FRAME_PC(BASE)\n  |.if DUALNUM\n  |  bne ->fff_fallback\n  |  bne cr1, ->fff_fallback\n  |.else\n  |    lus TMP0, 0x3ff0\n  |    stw ZERO, TMPD_LO\n  |  bne ->fff_fallback\n  |    stw TMP0, TMPD_HI\n  |  bge cr1, ->fff_fallback\n  |    lfd FARG1, TMPD\n  |  toint TMP2, FARG2, f0\n  |.endif\n  |   lwz TMP0, TAB:CARG1->asize\n  |   lwz TMP1, TAB:CARG1->array\n  |.if not DUALNUM\n  |  fadd FARG2, FARG2, FARG1\n  |.endif\n  |  addi TMP2, TMP2, 1\n  |   la RA, -8(BASE)\n  |  cmplw TMP0, TMP2\n  |.if DUALNUM\n  |  stw TISNUM, 0(RA)\n  |   slwi TMP3, TMP2, 3\n  |  stw TMP2, 4(RA)\n  |.else\n  |   slwi TMP3, TMP2, 3\n  |  stfd FARG2, 0(RA)\n  |.endif\n  |  ble >2\t\t\t\t// Not in array part?\n  |  lwzx TMP2, TMP1, TMP3\n  |  lfdx f0, TMP1, TMP3\n  |1:\n  |  checknil TMP2\n  |   li RD, (0+1)*8\n  |  beq ->fff_res\t\t\t// End of iteration, return 0 results.\n  |   li RD, (2+1)*8\n  |  stfd f0, 8(RA)\n  |  b ->fff_res\n  |2:  // Check for empty hash part first. Otherwise call C function.\n  |  lwz TMP0, TAB:CARG1->hmask\n  |  cmplwi TMP0, 0\n  |   li RD, (0+1)*8\n  |  beq ->fff_res\n  |   mr CARG2, TMP2\n  |  bl extern lj_tab_getinth\t\t// (GCtab *t, int32_t key)\n  |  // Returns cTValue * or NULL.\n  |  cmplwi CRET1, 0\n  |   li RD, (0+1)*8\n  |  beq ->fff_res\n  |  lwz TMP2, 0(CRET1)\n  |  lfd f0, 0(CRET1)\n  |  b <1\n  |\n  |.ffunc_1 ipairs\n  |  checktab CARG3\n  |   lwz PC, FRAME_PC(BASE)\n  |  bne ->fff_fallback\n#if LJ_52\n  |   lwz TAB:TMP2, TAB:CARG1->metatable\n  |  lfd f0, CFUNC:RB->upvalue[0]\n  |   cmplwi TAB:TMP2, 0\n  |  la RA, -8(BASE)\n  |   bne ->fff_fallback\n#else\n  |  lfd f0, CFUNC:RB->upvalue[0]\n  |  la RA, -8(BASE)\n#endif\n  |.if DUALNUM\n  |  stw TISNUM, 8(BASE)\n  |.else\n  |  stw ZERO, 8(BASE)\n  |.endif\n  |   stw ZERO, 12(BASE)\n  |  li RD, (3+1)*8\n  |  stfd f0, 0(RA)\n  |  b ->fff_res\n  |\n  |//-- Base library: catch errors ----------------------------------------\n  |\n  |.ffunc pcall\n  |  cmplwi NARGS8:RC, 8\n  |   lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  blt ->fff_fallback\n  |   mr TMP2, BASE\n  |   la BASE, 8(BASE)\n  |  // Remember active hook before pcall.\n  |  rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31\n  |   subi NARGS8:RC, NARGS8:RC, 8\n  |  addi PC, TMP3, 8+FRAME_PCALL\n  |  b ->vm_call_dispatch\n  |\n  |.ffunc xpcall\n  |  cmplwi NARGS8:RC, 16\n  |   lwz CARG4, 8(BASE)\n  |    lfd FARG2, 8(BASE)\n  |    lfd FARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |  lbz TMP1, DISPATCH_GL(hookmask)(DISPATCH)\n  |   mr TMP2, BASE\n  |  checkfunc CARG4; bne ->fff_fallback  // Traceback must be a function.\n  |   la BASE, 16(BASE)\n  |  // Remember active hook before pcall.\n  |  rlwinm TMP1, TMP1, 32-HOOK_ACTIVE_SHIFT, 31, 31\n  |    stfd FARG2, 0(TMP2)\t\t// Swap function and traceback.\n  |  subi NARGS8:RC, NARGS8:RC, 16\n  |    stfd FARG1, 8(TMP2)\n  |  addi PC, TMP1, 16+FRAME_PCALL\n  |  b ->vm_call_dispatch\n  |\n  |//-- Coroutine library --------------------------------------------------\n  |\n  |.macro coroutine_resume_wrap, resume\n  |.if resume\n  |.ffunc_1 coroutine_resume\n  |  cmpwi CARG3, LJ_TTHREAD; bne ->fff_fallback\n  |.else\n  |.ffunc coroutine_wrap_aux\n  |  lwz L:CARG1, CFUNC:RB->upvalue[0].gcr\n  |.endif\n  |  lbz TMP0, L:CARG1->status\n  |   lp TMP1, L:CARG1->cframe\n  |    lp CARG2, L:CARG1->top\n  |  cmplwi cr0, TMP0, LUA_YIELD\n  |    lp TMP2, L:CARG1->base\n  |   cmplwi cr1, TMP1, 0\n  |   lwz TMP0, L:CARG1->maxstack\n  |    cmplw cr7, CARG2, TMP2\n  |   lwz PC, FRAME_PC(BASE)\n  |  crorc 4*cr6+lt, 4*cr0+gt, 4*cr1+eq\t\t// st>LUA_YIELD || cframe!=0\n  |   add TMP2, CARG2, NARGS8:RC\n  |  crandc 4*cr6+gt, 4*cr7+eq, 4*cr0+eq\t// base==top && st!=LUA_YIELD\n  |   cmplw cr1, TMP2, TMP0\n  |  cror 4*cr6+lt, 4*cr6+lt, 4*cr6+gt\n  |   stw PC, SAVE_PC\n  |  cror 4*cr6+lt, 4*cr6+lt, 4*cr1+gt\t\t// cond1 || cond2 || stackov\n  |   stp BASE, L->base\n  |  blt cr6, ->fff_fallback\n  |1:\n  |.if resume\n  |  addi BASE, BASE, 8\t\t\t// Keep resumed thread in stack for GC.\n  |  subi NARGS8:RC, NARGS8:RC, 8\n  |  subi TMP2, TMP2, 8\n  |.endif\n  |  stp TMP2, L:CARG1->top\n  |  li TMP1, 0\n  |  stp BASE, L->top\n  |2:  // Move args to coroutine.\n  |  cmpw TMP1, NARGS8:RC\n  |   lfdx f0, BASE, TMP1\n  |  beq >3\n  |   stfdx f0, CARG2, TMP1\n  |  addi TMP1, TMP1, 8\n  |  b <2\n  |3:\n  |  li CARG3, 0\n  |   mr L:SAVE0, L:CARG1\n  |  li CARG4, 0\n  |  bl ->vm_resume\t\t\t// (lua_State *L, TValue *base, 0, 0)\n  |  // Returns thread status.\n  |4:\n  |  lp TMP2, L:SAVE0->base\n  |   cmplwi CRET1, LUA_YIELD\n  |  lp TMP3, L:SAVE0->top\n  |    li_vmstate INTERP\n  |  lp BASE, L->base\n  |    st_vmstate\n  |   bgt >8\n  |  sub RD, TMP3, TMP2\n  |   lwz TMP0, L->maxstack\n  |  cmplwi RD, 0\n  |   add TMP1, BASE, RD\n  |  beq >6\t\t\t\t// No results?\n  |  cmplw TMP1, TMP0\n  |   li TMP1, 0\n  |  bgt >9\t\t\t\t// Need to grow stack?\n  |\n  |  subi TMP3, RD, 8\n  |   stp TMP2, L:SAVE0->top\t\t// Clear coroutine stack.\n  |5:  // Move results from coroutine.\n  |  cmplw TMP1, TMP3\n  |   lfdx f0, TMP2, TMP1\n  |   stfdx f0, BASE, TMP1\n  |    addi TMP1, TMP1, 8\n  |  bne <5\n  |6:\n  |  andix. TMP0, PC, FRAME_TYPE\n  |.if resume\n  |  li TMP1, LJ_TTRUE\n  |   la RA, -8(BASE)\n  |  stw TMP1, -8(BASE)\t\t\t// Prepend true to results.\n  |  addi RD, RD, 16\n  |.else\n  |  mr RA, BASE\n  |  addi RD, RD, 8\n  |.endif\n  |7:\n  |    stw PC, SAVE_PC\n  |   mr MULTRES, RD\n  |  beq ->BC_RET_Z\n  |  b ->vm_return\n  |\n  |8:  // Coroutine returned with error (at co->top-1).\n  |.if resume\n  |  andix. TMP0, PC, FRAME_TYPE\n  |  la TMP3, -8(TMP3)\n  |   li TMP1, LJ_TFALSE\n  |  lfd f0, 0(TMP3)\n  |   stp TMP3, L:SAVE0->top\t\t// Remove error from coroutine stack.\n  |    li RD, (2+1)*8\n  |   stw TMP1, -8(BASE)\t\t// Prepend false to results.\n  |    la RA, -8(BASE)\n  |  stfd f0, 0(BASE)\t\t\t// Copy error message.\n  |  b <7\n  |.else\n  |  mr CARG1, L\n  |  mr CARG2, L:SAVE0\n  |  bl extern lj_ffh_coroutine_wrap_err  // (lua_State *L, lua_State *co)\n  |.endif\n  |\n  |9:  // Handle stack expansion on return from yield.\n  |  mr CARG1, L\n  |  srwi CARG2, RD, 3\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  li CRET1, 0\n  |  b <4\n  |.endmacro\n  |\n  |  coroutine_resume_wrap 1\t\t// coroutine.resume\n  |  coroutine_resume_wrap 0\t\t// coroutine.wrap\n  |\n  |.ffunc coroutine_yield\n  |  lp TMP0, L->cframe\n  |   add TMP1, BASE, NARGS8:RC\n  |   stp BASE, L->base\n  |  andix. TMP0, TMP0, CFRAME_RESUME\n  |   stp TMP1, L->top\n  |    li CRET1, LUA_YIELD\n  |  beq ->fff_fallback\n  |   stp ZERO, L->cframe\n  |    stb CRET1, L->status\n  |  b ->vm_leave_unw\n  |\n  |//-- Math library -------------------------------------------------------\n  |\n  |.ffunc_1 math_abs\n  |  checknum CARG3\n  |.if DUALNUM\n  |  bne >2\n  |  srawi TMP1, CARG1, 31\n  |  xor TMP2, TMP1, CARG1\n  |.if GPR64\n  |  lus TMP0, 0x8000\n  |  sub CARG1, TMP2, TMP1\n  |  cmplw CARG1, TMP0\n  |  beq >1\n  |.else\n  |  sub. CARG1, TMP2, TMP1\n  |  blt >1\n  |.endif\n  |->fff_resi:\n  |  lwz PC, FRAME_PC(BASE)\n  |  la RA, -8(BASE)\n  |  stw TISNUM, -8(BASE)\n  |  stw CRET1, -4(BASE)\n  |  b ->fff_res1\n  |1:\n  |  lus CARG3, 0x41e0\t// 2^31.\n  |  li CARG1, 0\n  |  b ->fff_restv\n  |2:\n  |.endif\n  |  bge ->fff_fallback\n  |  rlwinm CARG3, CARG3, 0, 1, 31\n  |  // Fallthrough.\n  |\n  |->fff_restv:\n  |  // CARG3/CARG1 = TValue result.\n  |  lwz PC, FRAME_PC(BASE)\n  |   stw CARG3, -8(BASE)\n  |  la RA, -8(BASE)\n  |   stw CARG1, -4(BASE)\n  |->fff_res1:\n  |  // RA = results, PC = return.\n  |  li RD, (1+1)*8\n  |->fff_res:\n  |  // RA = results, RD = (nresults+1)*8, PC = return.\n  |  andix. TMP0, PC, FRAME_TYPE\n  |   mr MULTRES, RD\n  |  bney ->vm_return\n  |  lwz INS, -4(PC)\n  |  decode_RB8 RB, INS\n  |5:\n  |  cmplw RB, RD\t\t\t// More results expected?\n  |   decode_RA8 TMP0, INS\n  |  bgt >6\n  |  ins_next1\n  |  // Adjust BASE. KBASE is assumed to be set for the calling frame.\n  |   sub BASE, RA, TMP0\n  |  ins_next2\n  |\n  |6:  // Fill up results with nil.\n  |  subi TMP1, RD, 8\n  |   addi RD, RD, 8\n  |  stwx TISNIL, RA, TMP1\n  |  b <5\n  |\n  |.macro math_extern, func\n  |  .ffunc_n math_ .. func\n  |  blex func\n  |  b ->fff_resn\n  |.endmacro\n  |\n  |.macro math_extern2, func\n  |  .ffunc_nn math_ .. func\n  |  blex func\n  |  b ->fff_resn\n  |.endmacro\n  |\n  |.macro math_round, func\n  |  .ffunc_1 math_ .. func\n  |   checknum CARG3; beqy ->fff_restv\n  |  rlwinm TMP2, CARG3, 12, 21, 31\n  |   bge ->fff_fallback\n  |  addic. TMP2, TMP2, -1023\t\t// exp = exponent(x) - 1023\n  |  cmplwi cr1, TMP2, 31\t\t// 0 <= exp < 31?\n  |   subfic TMP0, TMP2, 31\n  |  blt >3\n  |  slwi TMP1, CARG3, 11\n  |   srwi TMP3, CARG1, 21\n  |  oris TMP1, TMP1, 0x8000\n  |   addi TMP2, TMP2, 1\n  |  or TMP1, TMP1, TMP3\n  |   slwi CARG2, CARG1, 11\n  |  bge cr1, >4\n  |   slw TMP3, TMP1, TMP2\n  |  srw RD, TMP1, TMP0\n  |   or TMP3, TMP3, CARG2\n  |  srawi TMP2, CARG3, 31\n  |.if \"func\" == \"floor\"\n  |  and TMP1, TMP3, TMP2\n  |  addic TMP0, TMP1, -1\n  |  subfe TMP1, TMP0, TMP1\n  |  add CARG1, RD, TMP1\n  |  xor CARG1, CARG1, TMP2\n  |  sub CARG1, CARG1, TMP2\n  |  b ->fff_resi\n  |.else\n  |  andc TMP1, TMP3, TMP2\n  |  addic TMP0, TMP1, -1\n  |  subfe TMP1, TMP0, TMP1\n  |  add CARG1, RD, TMP1\n  |  cmpw CARG1, RD\n  |  xor CARG1, CARG1, TMP2\n  |  sub CARG1, CARG1, TMP2\n  |  bge ->fff_resi\n  |  // Overflow to 2^31.\n  |  lus CARG3, 0x41e0\t\t\t// 2^31.\n  |  li CARG1, 0\n  |  b ->fff_restv\n  |.endif\n  |3:  // |x| < 1\n  |  slwi TMP2, CARG3, 1\n  |   srawi TMP1, CARG3, 31\n  |  or TMP2, CARG1, TMP2\t\t// ztest = (hi+hi) | lo\n  |.if \"func\" == \"floor\"\n  |  and TMP1, TMP2, TMP1\t\t// (ztest & sign) == 0 ? 0 : -1\n  |  subfic TMP2, TMP1, 0\n  |  subfe CARG1, CARG1, CARG1\n  |.else\n  |  andc TMP1, TMP2, TMP1\t\t// (ztest & ~sign) == 0 ? 0 : 1\n  |  addic TMP2, TMP1, -1\n  |  subfe CARG1, TMP2, TMP1\n  |.endif\n  |  b ->fff_resi\n  |4:  // exp >= 31. Check for -(2^31).\n  |  xoris TMP1, TMP1, 0x8000\n  |  srawi TMP2, CARG3, 31\n  |.if \"func\" == \"floor\"\n  |  or TMP1, TMP1, CARG2\n  |.endif\n  |.if PPE\n  |  orc TMP1, TMP1, TMP2\n  |  cmpwi TMP1, 0\n  |.else\n  |  orc. TMP1, TMP1, TMP2\n  |.endif\n  |  crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq\n  |  lus CARG1, 0x8000\t\t\t// -(2^31).\n  |  beqy ->fff_resi\n  |5:\n  |  lfd FARG1, 0(BASE)\n  |  blex func\n  |  b ->fff_resn\n  |.endmacro\n  |\n  |.if DUALNUM\n  |  math_round floor\n  |  math_round ceil\n  |.else\n  |  // NYI: use internal implementation.\n  |  math_extern floor\n  |  math_extern ceil\n  |.endif\n  |\n  |.if SQRT\n  |.ffunc_n math_sqrt\n  |  fsqrt FARG1, FARG1\n  |  b ->fff_resn\n  |.else\n  |  math_extern sqrt\n  |.endif\n  |\n  |.ffunc math_log\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG3, 0(BASE)\n  |    lfd FARG1, 0(BASE)\n  |  bne ->fff_fallback\t\t\t// Need exactly 1 argument.\n  |  checknum CARG3; bge ->fff_fallback\n  |  blex log\n  |  b ->fff_resn\n  |\n  |  math_extern log10\n  |  math_extern exp\n  |  math_extern sin\n  |  math_extern cos\n  |  math_extern tan\n  |  math_extern asin\n  |  math_extern acos\n  |  math_extern atan\n  |  math_extern sinh\n  |  math_extern cosh\n  |  math_extern tanh\n  |  math_extern2 pow\n  |  math_extern2 atan2\n  |  math_extern2 fmod\n  |\n  |->ff_math_deg:\n  |.ffunc_n math_rad\n  |  lfd FARG2, CFUNC:RB->upvalue[0]\n  |  fmul FARG1, FARG1, FARG2\n  |  b ->fff_resn\n  |\n  |.if DUALNUM\n  |.ffunc math_ldexp\n  |  cmplwi NARGS8:RC, 16\n  |   lwz CARG3, 0(BASE)\n  |    lfd FARG1, 0(BASE)\n  |   lwz CARG4, 8(BASE)\n  |.if GPR64\n  |    lwz CARG2, 12(BASE)\n  |.else\n  |    lwz CARG1, 12(BASE)\n  |.endif\n  |  blt ->fff_fallback\n  |  checknum CARG3; bge ->fff_fallback\n  |  checknum CARG4; bne ->fff_fallback\n  |.else\n  |.ffunc_nn math_ldexp\n  |.if GPR64\n  |  toint CARG2, FARG2\n  |.else\n  |  toint CARG1, FARG2\n  |.endif\n  |.endif\n  |  blex ldexp\n  |  b ->fff_resn\n  |\n  |.ffunc_n math_frexp\n  |.if GPR64\n  |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)\n  |.else\n  |  la CARG1, DISPATCH_GL(tmptv)(DISPATCH)\n  |.endif\n  |   lwz PC, FRAME_PC(BASE)\n  |  blex frexp\n  |   lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH)\n  |   la RA, -8(BASE)\n  |.if not DUALNUM\n  |   tonum_i FARG2, TMP1\n  |.endif\n  |  stfd FARG1, 0(RA)\n  |  li RD, (2+1)*8\n  |.if DUALNUM\n  |   stw TISNUM, 8(RA)\n  |   stw TMP1, 12(RA)\n  |.else\n  |   stfd FARG2, 8(RA)\n  |.endif\n  |  b ->fff_res\n  |\n  |.ffunc_n math_modf\n  |.if GPR64\n  |  la CARG2, -8(BASE)\n  |.else\n  |  la CARG1, -8(BASE)\n  |.endif\n  |   lwz PC, FRAME_PC(BASE)\n  |  blex modf\n  |   la RA, -8(BASE)\n  |  stfd FARG1, 0(BASE)\n  |  li RD, (2+1)*8\n  |  b ->fff_res\n  |\n  |.macro math_minmax, name, ismax\n  |.if DUALNUM\n  |  .ffunc_1 name\n  |  checknum CARG3\n  |   addi TMP1, BASE, 8\n  |   add TMP2, BASE, NARGS8:RC\n  |  bne >4\n  |1:  // Handle integers.\n  |  lwz CARG4, 0(TMP1)\n  |   cmplw cr1, TMP1, TMP2\n  |  lwz CARG2, 4(TMP1)\n  |   bge cr1, ->fff_resi\n  |  checknum CARG4\n  |   xoris TMP0, CARG1, 0x8000\n  |   xoris TMP3, CARG2, 0x8000\n  |  bne >3\n  |  subfc TMP3, TMP3, TMP0\n  |  subfe TMP0, TMP0, TMP0\n  |.if ismax\n  |  andc TMP3, TMP3, TMP0\n  |.else\n  |  and TMP3, TMP3, TMP0\n  |.endif\n  |  add CARG1, TMP3, CARG2\n  |.if GPR64\n  |  rldicl CARG1, CARG1, 0, 32\n  |.endif\n  |   addi TMP1, TMP1, 8\n  |  b <1\n  |3:\n  |  bge ->fff_fallback\n  |  // Convert intermediate result to number and continue below.\n  |  tonum_i FARG1, CARG1\n  |  lfd FARG2, 0(TMP1)\n  |  b >6\n  |4:\n  |   lfd FARG1, 0(BASE)\n  |  bge ->fff_fallback\n  |5:  // Handle numbers.\n  |  lwz CARG4, 0(TMP1)\n  |   cmplw cr1, TMP1, TMP2\n  |  lfd FARG2, 0(TMP1)\n  |   bge cr1, ->fff_resn\n  |  checknum CARG4; bge >7\n  |6:\n  |  fsub f0, FARG1, FARG2\n  |   addi TMP1, TMP1, 8\n  |.if ismax\n  |  fsel FARG1, f0, FARG1, FARG2\n  |.else\n  |  fsel FARG1, f0, FARG2, FARG1\n  |.endif\n  |  b <5\n  |7:  // Convert integer to number and continue above.\n  |   lwz CARG2, 4(TMP1)\n  |  bne ->fff_fallback\n  |  tonum_i FARG2, CARG2\n  |  b <6\n  |.else\n  |  .ffunc_n name\n  |  li TMP1, 8\n  |1:\n  |   lwzx CARG2, BASE, TMP1\n  |   lfdx FARG2, BASE, TMP1\n  |  cmplw cr1, TMP1, NARGS8:RC\n  |   checknum CARG2\n  |  bge cr1, ->fff_resn\n  |   bge ->fff_fallback\n  |  fsub f0, FARG1, FARG2\n  |   addi TMP1, TMP1, 8\n  |.if ismax\n  |  fsel FARG1, f0, FARG1, FARG2\n  |.else\n  |  fsel FARG1, f0, FARG2, FARG1\n  |.endif\n  |  b <1\n  |.endif\n  |.endmacro\n  |\n  |  math_minmax math_min, 0\n  |  math_minmax math_max, 1\n  |\n  |//-- String library -----------------------------------------------------\n  |\n  |.ffunc_1 string_len\n  |  checkstr CARG3; bne ->fff_fallback\n  |  lwz CRET1, STR:CARG1->len\n  |  b ->fff_resi\n  |\n  |.ffunc string_byte\t\t\t// Only handle the 1-arg case here.\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG3, 0(BASE)\n  |    lwz STR:CARG1, 4(BASE)\n  |  bne ->fff_fallback\t\t\t// Need exactly 1 argument.\n  |   checkstr CARG3\n  |   bne ->fff_fallback\n  |  lwz TMP0, STR:CARG1->len\n  |.if DUALNUM\n  |   lbz CARG1, STR:CARG1[1]\t\t// Access is always ok (NUL at end).\n  |   li RD, (0+1)*8\n  |   lwz PC, FRAME_PC(BASE)\n  |  cmplwi TMP0, 0\n  |   la RA, -8(BASE)\n  |  beqy ->fff_res\n  |  b ->fff_resi\n  |.else\n  |   lbz TMP1, STR:CARG1[1]\t\t// Access is always ok (NUL at end).\n  |  addic TMP3, TMP0, -1\t\t// RD = ((str->len != 0)+1)*8\n  |  subfe RD, TMP3, TMP0\n  |   stw TMP1, TONUM_LO\t\t// Inlined tonum_u f0, TMP1.\n  |  addi RD, RD, 1\n  |   lfd f0, TONUM_D\n  |  la RA, -8(BASE)\n  |  lwz PC, FRAME_PC(BASE)\n  |   fsub f0, f0, TOBIT\n  |  slwi RD, RD, 3\n  |   stfd f0, 0(RA)\n  |  b ->fff_res\n  |.endif\n  |\n  |.ffunc string_char\t\t\t// Only handle the 1-arg case here.\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG3, 0(BASE)\n  |.if DUALNUM\n  |    lwz TMP0, 4(BASE)\n  |  bne ->fff_fallback\t\t\t// Exactly 1 argument.\n  |  checknum CARG3; bne ->fff_fallback\n  |   la CARG2, 7(BASE)\n  |.else\n  |    lfd FARG1, 0(BASE)\n  |  bne ->fff_fallback\t\t\t// Exactly 1 argument.\n  |  checknum CARG3; bge ->fff_fallback\n  |  toint TMP0, FARG1\n  |   la CARG2, TMPD_BLO\n  |.endif\n  |   li CARG3, 1\n  |  cmplwi TMP0, 255; bgt ->fff_fallback\n  |->fff_newstr:\n  |  mr CARG1, L\n  |  stp BASE, L->base\n  |  stw PC, SAVE_PC\n  |  bl extern lj_str_new\t\t// (lua_State *L, char *str, size_t l)\n  |  // Returns GCstr *.\n  |  lp BASE, L->base\n  |  li CARG3, LJ_TSTR\n  |  b ->fff_restv\n  |\n  |.ffunc string_sub\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 16\n  |   lwz CARG3, 16(BASE)\n  |.if not DUALNUM\n  |    lfd f0, 16(BASE)\n  |.endif\n  |   lwz TMP0, 0(BASE)\n  |    lwz STR:CARG1, 4(BASE)\n  |  blt ->fff_fallback\n  |   lwz CARG2, 8(BASE)\n  |.if DUALNUM\n  |    lwz TMP1, 12(BASE)\n  |.else\n  |    lfd f1, 8(BASE)\n  |.endif\n  |   li TMP2, -1\n  |  beq >1\n  |.if DUALNUM\n  |  checknum CARG3\n  |   lwz TMP2, 20(BASE)\n  |  bne ->fff_fallback\n  |1:\n  |  checknum CARG2; bne ->fff_fallback\n  |.else\n  |  checknum CARG3; bge ->fff_fallback\n  |  toint TMP2, f0\n  |1:\n  |  checknum CARG2; bge ->fff_fallback\n  |.endif\n  |  checkstr TMP0; bne ->fff_fallback\n  |.if not DUALNUM\n  |   toint TMP1, f1\n  |.endif\n  |   lwz TMP0, STR:CARG1->len\n  |  cmplw TMP0, TMP2\t\t\t// len < end? (unsigned compare)\n  |   addi TMP3, TMP2, 1\n  |  blt >5\n  |2:\n  |  cmpwi TMP1, 0\t\t\t// start <= 0?\n  |   add TMP3, TMP1, TMP0\n  |  ble >7\n  |3:\n  |  sub CARG3, TMP2, TMP1\n  |    addi CARG2, STR:CARG1, #STR-1\n  |  srawi TMP0, CARG3, 31\n  |   addi CARG3, CARG3, 1\n  |    add CARG2, CARG2, TMP1\n  |  andc CARG3, CARG3, TMP0\n  |.if GPR64\n  |  rldicl CARG2, CARG2, 0, 32\n  |  rldicl CARG3, CARG3, 0, 32\n  |.endif\n  |  b ->fff_newstr\n  |\n  |5:  // Negative end or overflow.\n  |  cmpw TMP0, TMP2\t\t\t// len >= end? (signed compare)\n  |   add TMP2, TMP0, TMP3\t\t// Negative end: end = end+len+1.\n  |  bge <2\n  |   mr TMP2, TMP0\t\t\t// Overflow: end = len.\n  |  b <2\n  |\n  |7:  // Negative start or underflow.\n  |  .gpr64 extsw TMP1, TMP1\n  |  addic CARG3, TMP1, -1\n  |  subfe CARG3, CARG3, CARG3\n  |   srawi CARG2, TMP3, 31\t\t// Note: modifies carry.\n  |  andc TMP3, TMP3, CARG3\n  |   andc TMP1, TMP3, CARG2\n  |  addi TMP1, TMP1, 1\t\t\t// start = 1 + (start ? start+len : 0)\n  |  b <3\n  |\n  |.ffunc string_rep\t\t\t// Only handle the 1-char case inline.\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 16\n  |   lwz TMP0, 0(BASE)\n  |    lwz STR:CARG1, 4(BASE)\n  |   lwz CARG4, 8(BASE)\n  |.if DUALNUM\n  |    lwz CARG3, 12(BASE)\n  |.else\n  |    lfd FARG2, 8(BASE)\n  |.endif\n  |  bne ->fff_fallback\t\t\t// Exactly 2 arguments.\n  |  checkstr TMP0; bne ->fff_fallback\n  |.if DUALNUM\n  |  checknum CARG4; bne ->fff_fallback\n  |.else\n  |  checknum CARG4; bge ->fff_fallback\n  |    toint CARG3, FARG2\n  |.endif\n  |   lwz TMP0, STR:CARG1->len\n  |  cmpwi CARG3, 0\n  |   lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  ble >2\t\t\t\t// Count <= 0? (or non-int)\n  |   cmplwi TMP0, 1\n  |  subi TMP2, CARG3, 1\n  |   blt >2\t\t\t\t// Zero length string?\n  |  cmplw cr1, TMP1, CARG3\n  |   bne ->fff_fallback\t\t// Fallback for > 1-char strings.\n  |   lbz TMP0, STR:CARG1[1]\n  |   lp CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |  blt cr1, ->fff_fallback\n  |1:  // Fill buffer with char. Yes, this is suboptimal code (do you care?).\n  |  cmplwi TMP2, 0\n  |   stbx TMP0, CARG2, TMP2\n  |   subi TMP2, TMP2, 1\n  |  bne <1\n  |  b ->fff_newstr\n  |2:  // Return empty string.\n  |  la STR:CARG1, DISPATCH_GL(strempty)(DISPATCH)\n  |  li CARG3, LJ_TSTR\n  |  b ->fff_restv\n  |\n  |.ffunc string_reverse\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG3, 0(BASE)\n  |    lwz STR:CARG1, 4(BASE)\n  |  blt ->fff_fallback\n  |  checkstr CARG3\n  |   lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  bne ->fff_fallback\n  |  lwz CARG3, STR:CARG1->len\n  |   la CARG1, #STR(STR:CARG1)\n  |   lp CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |   li TMP2, 0\n  |  cmplw TMP1, CARG3\n  |   subi TMP3, CARG3, 1\n  |  blt ->fff_fallback\n  |1:  // Reverse string copy.\n  |  cmpwi TMP3, 0\n  |   lbzx TMP1, CARG1, TMP2\n  |  blty ->fff_newstr\n  |   stbx TMP1, CARG2, TMP3\n  |  subi TMP3, TMP3, 1\n  |  addi TMP2, TMP2, 1\n  |  b <1\n  |\n  |.macro ffstring_case, name, lo\n  |  .ffunc name\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG3, 0(BASE)\n  |    lwz STR:CARG1, 4(BASE)\n  |  blt ->fff_fallback\n  |  checkstr CARG3\n  |   lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  bne ->fff_fallback\n  |  lwz CARG3, STR:CARG1->len\n  |   la CARG1, #STR(STR:CARG1)\n  |   lp CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |  cmplw TMP1, CARG3\n  |   li TMP2, 0\n  |  blt ->fff_fallback\n  |1:  // ASCII case conversion.\n  |  cmplw TMP2, CARG3\n  |   lbzx TMP1, CARG1, TMP2\n  |  bgey ->fff_newstr\n  |   subi TMP0, TMP1, lo\n  |    xori TMP3, TMP1, 0x20\n  |   addic TMP0, TMP0, -26\n  |   subfe TMP3, TMP3, TMP3\n  |   rlwinm TMP3, TMP3, 0, 26, 26\t// x &= 0x20.\n  |   xor TMP1, TMP1, TMP3\n  |   stbx TMP1, CARG2, TMP2\n  |  addi TMP2, TMP2, 1\n  |  b <1\n  |.endmacro\n  |\n  |ffstring_case string_lower, 65\n  |ffstring_case string_upper, 97\n  |\n  |//-- Table library ------------------------------------------------------\n  |\n  |.ffunc_1 table_getn\n  |  checktab CARG3; bne ->fff_fallback\n  |  bl extern lj_tab_len\t\t// (GCtab *t)\n  |  // Returns uint32_t (but less than 2^31).\n  |  b ->fff_resi\n  |\n  |//-- Bit library --------------------------------------------------------\n  |\n  |.macro .ffunc_bit, name\n  |.if DUALNUM\n  |  .ffunc_1 bit_..name\n  |  checknum CARG3; bnel ->fff_tobit_fb\n  |.else\n  |  .ffunc_n bit_..name\n  |  fadd FARG1, FARG1, TOBIT\n  |  stfd FARG1, TMPD\n  |  lwz CARG1, TMPD_LO\n  |.endif\n  |.endmacro\n  |\n  |.macro .ffunc_bit_op, name, ins\n  |  .ffunc_bit name\n  |  addi TMP1, BASE, 8\n  |  add TMP2, BASE, NARGS8:RC\n  |1:\n  |  lwz CARG4, 0(TMP1)\n  |   cmplw cr1, TMP1, TMP2\n  |.if DUALNUM\n  |  lwz CARG2, 4(TMP1)\n  |.else\n  |  lfd FARG1, 0(TMP1)\n  |.endif\n  |   bgey cr1, ->fff_resi\n  |  checknum CARG4\n  |.if DUALNUM\n  |  bnel ->fff_bitop_fb\n  |.else\n  |  fadd FARG1, FARG1, TOBIT\n  |  bge ->fff_fallback\n  |  stfd FARG1, TMPD\n  |  lwz CARG2, TMPD_LO\n  |.endif\n  |  ins CARG1, CARG1, CARG2\n  |   addi TMP1, TMP1, 8\n  |  b <1\n  |.endmacro\n  |\n  |.ffunc_bit_op band, and\n  |.ffunc_bit_op bor, or\n  |.ffunc_bit_op bxor, xor\n  |\n  |.ffunc_bit bswap\n  |  rotlwi TMP0, CARG1, 8\n  |  rlwimi TMP0, CARG1, 24, 0, 7\n  |  rlwimi TMP0, CARG1, 24, 16, 23\n  |  mr CRET1, TMP0\n  |  b ->fff_resi\n  |\n  |.ffunc_bit bnot\n  |  not CRET1, CARG1\n  |  b ->fff_resi\n  |\n  |.macro .ffunc_bit_sh, name, ins, shmod\n  |.if DUALNUM\n  |  .ffunc_2 bit_..name\n  |  checknum CARG3; bnel ->fff_tobit_fb\n  |  // Note: no inline conversion from number for 2nd argument!\n  |  checknum CARG4; bne ->fff_fallback\n  |.else\n  |  .ffunc_nn bit_..name\n  |  fadd FARG1, FARG1, TOBIT\n  |  fadd FARG2, FARG2, TOBIT\n  |  stfd FARG1, TMPD\n  |  lwz CARG1, TMPD_LO\n  |  stfd FARG2, TMPD\n  |  lwz CARG2, TMPD_LO\n  |.endif\n  |.if shmod == 1\n  |  rlwinm CARG2, CARG2, 0, 27, 31\n  |.elif shmod == 2\n  |  neg CARG2, CARG2\n  |.endif\n  |  ins CRET1, CARG1, CARG2\n  |  b ->fff_resi\n  |.endmacro\n  |\n  |.ffunc_bit_sh lshift, slw, 1\n  |.ffunc_bit_sh rshift, srw, 1\n  |.ffunc_bit_sh arshift, sraw, 1\n  |.ffunc_bit_sh rol, rotlw, 0\n  |.ffunc_bit_sh ror, rotlw, 2\n  |\n  |.ffunc_bit tobit\n  |.if DUALNUM\n  |  b ->fff_resi\n  |.else\n  |->fff_resi:\n  |  tonum_i FARG1, CRET1\n  |.endif\n  |->fff_resn:\n  |  lwz PC, FRAME_PC(BASE)\n  |  la RA, -8(BASE)\n  |  stfd FARG1, -8(BASE)\n  |  b ->fff_res1\n  |\n  |// Fallback FP number to bit conversion.\n  |->fff_tobit_fb:\n  |.if DUALNUM\n  |  lfd FARG1, 0(BASE)\n  |  bgt ->fff_fallback\n  |  fadd FARG1, FARG1, TOBIT\n  |  stfd FARG1, TMPD\n  |  lwz CARG1, TMPD_LO\n  |  blr\n  |.endif\n  |->fff_bitop_fb:\n  |.if DUALNUM\n  |  lfd FARG1, 0(TMP1)\n  |  bgt ->fff_fallback\n  |  fadd FARG1, FARG1, TOBIT\n  |  stfd FARG1, TMPD\n  |  lwz CARG2, TMPD_LO\n  |  blr\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->fff_fallback:\t\t\t// Call fast function fallback handler.\n  |  // BASE = new base, RB = CFUNC, RC = nargs*8\n  |  lp TMP3, CFUNC:RB->f\n  |    add TMP1, BASE, NARGS8:RC\n  |   lwz PC, FRAME_PC(BASE)\t\t// Fallback may overwrite PC.\n  |    addi TMP0, TMP1, 8*LUA_MINSTACK\n  |     lwz TMP2, L->maxstack\n  |   stw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  .toc lp TMP3, 0(TMP3)\n  |  cmplw TMP0, TMP2\n  |     stp BASE, L->base\n  |    stp TMP1, L->top\n  |   mr CARG1, L\n  |  bgt >5\t\t\t\t// Need to grow stack.\n  |  mtctr TMP3\n  |  bctrl\t\t\t\t// (lua_State *L)\n  |  // Either throws an error, or recovers and returns -1, 0 or nresults+1.\n  |  lp BASE, L->base\n  |  cmpwi CRET1, 0\n  |   slwi RD, CRET1, 3\n  |   la RA, -8(BASE)\n  |  bgt ->fff_res\t\t\t// Returned nresults+1?\n  |1:  // Returned 0 or -1: retry fast path.\n  |  lp TMP0, L->top\n  |   lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |  sub NARGS8:RC, TMP0, BASE\n  |  bne ->vm_call_tail\t\t\t// Returned -1?\n  |  ins_callt\t\t\t\t// Returned 0: retry fast path.\n  |\n  |// Reconstruct previous base for vmeta_call during tailcall.\n  |->vm_call_tail:\n  |  andix. TMP0, PC, FRAME_TYPE\n  |   rlwinm TMP1, PC, 0, 0, 28\n  |  bne >3\n  |  lwz INS, -4(PC)\n  |  decode_RA8 TMP1, INS\n  |  addi TMP1, TMP1, 8\n  |3:\n  |  sub TMP2, BASE, TMP1\n  |  b ->vm_call_dispatch\t\t// Resolve again for tailcall.\n  |\n  |5:  // Grow stack for fallback handler.\n  |  li CARG2, LUA_MINSTACK\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  lp BASE, L->base\n  |  cmpw TMP0, TMP0\t\t\t// Set 4*cr0+eq to force retry.\n  |  b <1\n  |\n  |->fff_gcstep:\t\t\t// Call GC step function.\n  |  // BASE = new base, RC = nargs*8\n  |  mflr SAVE0\n  |   stp BASE, L->base\n  |  add TMP0, BASE, NARGS8:RC\n  |   stw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  stp TMP0, L->top\n  |  mr CARG1, L\n  |  bl extern lj_gc_step\t\t// (lua_State *L)\n  |   lp BASE, L->base\n  |  mtlr SAVE0\n  |    lp TMP0, L->top\n  |   sub NARGS8:RC, TMP0, BASE\n  |   lwz CFUNC:RB, FRAME_FUNC(BASE)\n  |  blr\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Special dispatch targets -------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_record:\t\t\t\t// Dispatch target for recording phase.\n  |.if JIT\n  |  lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  andix. TMP0, TMP3, HOOK_VMEVENT\t// No recording while in vmevent.\n  |  bne >5\n  |  // Decrement the hookcount for consistency, but always do the call.\n  |   lwz TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  andix. TMP0, TMP3, HOOK_ACTIVE\n  |  bne >1\n  |   subi TMP2, TMP2, 1\n  |  andi. TMP0, TMP3, LUA_MASKLINE|LUA_MASKCOUNT\n  |  beqy >1\n  |   stw TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  b >1\n  |.endif\n  |\n  |->vm_rethook:\t\t\t// Dispatch target for return hooks.\n  |  lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  andix. TMP0, TMP3, HOOK_ACTIVE\t// Hook already active?\n  |  beq >1\n  |5:  // Re-dispatch to static ins.\n  |  addi TMP1, TMP1, GG_DISP2STATIC\t// Assumes decode_OPP TMP1, INS.\n  |  lpx TMP0, DISPATCH, TMP1\n  |  mtctr TMP0\n  |  bctr\n  |\n  |->vm_inshook:\t\t\t// Dispatch target for instr/line hooks.\n  |  lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  lwz TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  andix. TMP0, TMP3, HOOK_ACTIVE\t// Hook already active?\n  |   rlwinm TMP0, TMP3, 31-LUA_HOOKLINE, 31, 0\n  |  bne <5\n  |\n  |   cmpwi cr1, TMP0, 0\n  |  addic. TMP2, TMP2, -1\n  |   beq cr1, <5\n  |  stw TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  beq >1\n  |   bge cr1, <5\n  |1:\n  |  mr CARG1, L\n  |   stw MULTRES, SAVE_MULTRES\n  |  mr CARG2, PC\n  |   stp BASE, L->base\n  |  // SAVE_PC must hold the _previous_ PC. The callee updates it with PC.\n  |  bl extern lj_dispatch_ins\t\t// (lua_State *L, const BCIns *pc)\n  |3:\n  |  lp BASE, L->base\n  |4:  // Re-dispatch to static ins.\n  |  lwz INS, -4(PC)\n  |  decode_OPP TMP1, INS\n  |   decode_RB8 RB, INS\n  |  addi TMP1, TMP1, GG_DISP2STATIC\n  |   decode_RD8 RD, INS\n  |  lpx TMP0, DISPATCH, TMP1\n  |   decode_RA8 RA, INS\n  |   decode_RC8 RC, INS\n  |  mtctr TMP0\n  |  bctr\n  |\n  |->cont_hook:\t\t\t\t// Continue from hook yield.\n  |  addi PC, PC, 4\n  |  lwz MULTRES, -20(RB)\t\t// Restore MULTRES for *M ins.\n  |  b <4\n  |\n  |->vm_hotloop:\t\t\t// Hot loop counter underflow.\n  |.if JIT\n  |  lwz LFUNC:TMP1, FRAME_FUNC(BASE)\n  |   addi CARG1, DISPATCH, GG_DISP2J\n  |   stw PC, SAVE_PC\n  |  lwz TMP1, LFUNC:TMP1->pc\n  |   mr CARG2, PC\n  |   stw L, DISPATCH_J(L)(DISPATCH)\n  |  lbz TMP1, PC2PROTO(framesize)(TMP1)\n  |   stp BASE, L->base\n  |  slwi TMP1, TMP1, 3\n  |  add TMP1, BASE, TMP1\n  |  stp TMP1, L->top\n  |  bl extern lj_trace_hot\t\t// (jit_State *J, const BCIns *pc)\n  |  b <3\n  |.endif\n  |\n  |->vm_callhook:\t\t\t// Dispatch target for call hooks.\n  |  mr CARG2, PC\n  |.if JIT\n  |  b >1\n  |.endif\n  |\n  |->vm_hotcall:\t\t\t// Hot call counter underflow.\n  |.if JIT\n  |  ori CARG2, PC, 1\n  |1:\n  |.endif\n  |  add TMP0, BASE, RC\n  |   stw PC, SAVE_PC\n  |  mr CARG1, L\n  |   stp BASE, L->base\n  |  sub RA, RA, BASE\n  |   stp TMP0, L->top\n  |  bl extern lj_dispatch_call\t\t// (lua_State *L, const BCIns *pc)\n  |  // Returns ASMFunction.\n  |  lp BASE, L->base\n  |   lp TMP0, L->top\n  |   stw ZERO, SAVE_PC\t\t\t// Invalidate for subsequent line hook.\n  |  sub NARGS8:RC, TMP0, BASE\n  |  add RA, BASE, RA\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |  lwz INS, -4(PC)\n  |  mtctr CRET1\n  |  bctr\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Trace exit handler -------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |.macro savex_, a, b, c, d\n  |  stfd f..a, 16+a*8(sp)\n  |  stfd f..b, 16+b*8(sp)\n  |  stfd f..c, 16+c*8(sp)\n  |  stfd f..d, 16+d*8(sp)\n  |.endmacro\n  |\n  |->vm_exit_handler:\n  |.if JIT\n  |  addi sp, sp, -(16+32*8+32*4)\n  |  stmw r2, 16+32*8+2*4(sp)\n  |    addi DISPATCH, JGL, -GG_DISP2G-32768\n  |    li CARG2, ~LJ_VMST_EXIT\n  |   lwz CARG1, 16+32*8+32*4(sp)\t// Get stack chain.\n  |    stw CARG2, DISPATCH_GL(vmstate)(DISPATCH)\n  |  savex_ 0,1,2,3\n  |   stw CARG1, 0(sp)\t\t\t// Store extended stack chain.\n  |   mcrxr cr0\t\t\t\t// Clear SO flag.\n  |  savex_ 4,5,6,7\n  |   addi CARG2, sp, 16+32*8+32*4\t// Recompute original value of sp.\n  |  savex_ 8,9,10,11\n  |   stw CARG2, 16+32*8+1*4(sp)\t// Store sp in RID_SP.\n  |  savex_ 12,13,14,15\n  |   mflr CARG3\n  |   li TMP1, 0\n  |  savex_ 16,17,18,19\n  |   stw TMP1, 16+32*8+0*4(sp)\t\t// Clear RID_TMP.\n  |  savex_ 20,21,22,23\n  |   lhz CARG4, 2(CARG3)\t\t// Load trace number.\n  |  savex_ 24,25,26,27\n  |  lwz L, DISPATCH_GL(jit_L)(DISPATCH)\n  |  savex_ 28,29,30,31\n  |   sub CARG3, TMP0, CARG3\t\t// Compute exit number.\n  |  lp BASE, DISPATCH_GL(jit_base)(DISPATCH)\n  |   srwi CARG3, CARG3, 2\n  |  stw L, DISPATCH_J(L)(DISPATCH)\n  |   subi CARG3, CARG3, 2\n  |  stw TMP1, DISPATCH_GL(jit_L)(DISPATCH)\n  |   stw CARG4, DISPATCH_J(parent)(DISPATCH)\n  |  stp BASE, L->base\n  |  addi CARG1, DISPATCH, GG_DISP2J\n  |   stw CARG3, DISPATCH_J(exitno)(DISPATCH)\n  |  addi CARG2, sp, 16\n  |  bl extern lj_trace_exit\t\t// (jit_State *J, ExitState *ex)\n  |  // Returns MULTRES (unscaled) or negated error code.\n  |  lp TMP1, L->cframe\n  |  lwz TMP2, 0(sp)\n  |   lp BASE, L->base\n  |.if GPR64\n  |  rldicr sp, TMP1, 0, 61\n  |.else\n  |  rlwinm sp, TMP1, 0, 0, 29\n  |.endif\n  |   lwz PC, SAVE_PC\t\t\t// Get SAVE_PC.\n  |  stw TMP2, 0(sp)\n  |  stw L, SAVE_L\t\t\t// Set SAVE_L (on-trace resume/yield).\n  |  b >1\n  |.endif\n  |->vm_exit_interp:\n  |.if JIT\n  |  // CARG1 = MULTRES or negated error code, BASE, PC and JGL set.\n  |  lwz L, SAVE_L\n  |  addi DISPATCH, JGL, -GG_DISP2G-32768\n  |1:\n  |  cmpwi CARG1, 0\n  |  blt >3\t\t\t\t// Check for error from exit.\n  |  lwz LFUNC:TMP1, FRAME_FUNC(BASE)\n  |   slwi MULTRES, CARG1, 3\n  |    li TMP2, 0\n  |   stw MULTRES, SAVE_MULTRES\n  |  lwz TMP1, LFUNC:TMP1->pc\n  |    stw TMP2, DISPATCH_GL(jit_L)(DISPATCH)\n  |  lwz KBASE, PC2PROTO(k)(TMP1)\n  |  // Setup type comparison constants.\n  |  li TISNUM, LJ_TISNUM\n  |  lus TMP3, 0x59c0\t\t\t// TOBIT = 2^52 + 2^51 (float).\n  |  stw TMP3, TMPD\n  |  li ZERO, 0\n  |  ori TMP3, TMP3, 0x0004\t\t// TONUM = 2^52 + 2^51 + 2^31 (float).\n  |  lfs TOBIT, TMPD\n  |  stw TMP3, TMPD\n  |  lus TMP0, 0x4338\t\t\t// Hiword of 2^52 + 2^51 (double)\n  |    li TISNIL, LJ_TNIL\n  |  stw TMP0, TONUM_HI\n  |  lfs TONUM, TMPD\n  |  // Modified copy of ins_next which handles function header dispatch, too.\n  |  lwz INS, 0(PC)\n  |   addi PC, PC, 4\n  |    // Assumes TISNIL == ~LJ_VMST_INTERP == -1.\n  |    stw TISNIL, DISPATCH_GL(vmstate)(DISPATCH)\n  |  decode_OPP TMP1, INS\n  |   decode_RA8 RA, INS\n  |  lpx TMP0, DISPATCH, TMP1\n  |  mtctr TMP0\n  |  cmplwi TMP1, BC_FUNCF*4\t\t// Function header?\n  |  bge >2\n  |   decode_RB8 RB, INS\n  |   decode_RD8 RD, INS\n  |   decode_RC8 RC, INS\n  |  bctr\n  |2:\n  |   subi RC, MULTRES, 8\n  |   add RA, RA, BASE\n  |  bctr\n  |\n  |3:  // Rethrow error from the right C frame.\n  |  neg CARG2, CARG1\n  |  mr CARG1, L\n  |  bl extern lj_err_throw\t\t// (lua_State *L, int errcode)\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Math helper functions ----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// NYI: Use internal implementations of floor, ceil, trunc.\n  |\n  |->vm_modi:\n  |  divwo. TMP0, CARG1, CARG2\n  |  bso >1\n  |.if GPR64\n  |   xor CARG3, CARG1, CARG2\n  |   cmpwi CARG3, 0\n  |.else\n  |   xor. CARG3, CARG1, CARG2\n  |.endif\n  |  mullw TMP0, TMP0, CARG2\n  |  sub CARG1, CARG1, TMP0\n  |   bgelr\n  |  cmpwi CARG1, 0; beqlr\n  |  add CARG1, CARG1, CARG2\n  |  blr\n  |1:\n  |  cmpwi CARG2, 0\n  |   li CARG1, 0\n  |  beqlr\n  |  mcrxr cr0\t\t\t// Clear SO for -2147483648 % -1 and return 0.\n  |  blr\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Miscellaneous functions --------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// void lj_vm_cachesync(void *start, void *end)\n  |// Flush D-Cache and invalidate I-Cache. Assumes 32 byte cache line size.\n  |// This is a good lower bound, except for very ancient PPC models.\n  |->vm_cachesync:\n  |.if JIT or FFI\n  |  // Compute start of first cache line and number of cache lines.\n  |  rlwinm CARG1, CARG1, 0, 0, 26\n  |  sub CARG2, CARG2, CARG1\n  |  addi CARG2, CARG2, 31\n  |  rlwinm. CARG2, CARG2, 27, 5, 31\n  |  beqlr\n  |  mtctr CARG2\n  |  mr CARG3, CARG1\n  |1:  // Flush D-Cache.\n  |  dcbst r0, CARG1\n  |  addi CARG1, CARG1, 32\n  |  bdnz <1\n  |  sync\n  |  mtctr CARG2\n  |1:  // Invalidate I-Cache.\n  |  icbi r0, CARG3\n  |  addi CARG3, CARG3, 32\n  |  bdnz <1\n  |  isync\n  |  blr\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- FFI helper functions -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// Handler for callback functions. Callback slot number in r11, g in r12.\n  |->vm_ffi_callback:\n  |.if FFI\n  |.type CTSTATE, CTState, PC\n  |  saveregs\n  |  lwz CTSTATE, GL:r12->ctype_state\n  |   addi DISPATCH, r12, GG_G2DISP\n  |  stw r11, CTSTATE->cb.slot\n  |  stw r3, CTSTATE->cb.gpr[0]\n  |   stfd f1, CTSTATE->cb.fpr[0]\n  |  stw r4, CTSTATE->cb.gpr[1]\n  |   stfd f2, CTSTATE->cb.fpr[1]\n  |  stw r5, CTSTATE->cb.gpr[2]\n  |   stfd f3, CTSTATE->cb.fpr[2]\n  |  stw r6, CTSTATE->cb.gpr[3]\n  |   stfd f4, CTSTATE->cb.fpr[3]\n  |  stw r7, CTSTATE->cb.gpr[4]\n  |   stfd f5, CTSTATE->cb.fpr[4]\n  |  stw r8, CTSTATE->cb.gpr[5]\n  |   stfd f6, CTSTATE->cb.fpr[5]\n  |  stw r9, CTSTATE->cb.gpr[6]\n  |   stfd f7, CTSTATE->cb.fpr[6]\n  |  stw r10, CTSTATE->cb.gpr[7]\n  |   stfd f8, CTSTATE->cb.fpr[7]\n  |  addi TMP0, sp, CFRAME_SPACE+8\n  |  stw TMP0, CTSTATE->cb.stack\n  |   mr CARG1, CTSTATE\n  |  stw CTSTATE, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |   mr CARG2, sp\n  |  bl extern lj_ccallback_enter\t// (CTState *cts, void *cf)\n  |  // Returns lua_State *.\n  |  lp BASE, L:CRET1->base\n  |     li TISNUM, LJ_TISNUM\t\t// Setup type comparison constants.\n  |  lp RC, L:CRET1->top\n  |     lus TMP3, 0x59c0\t\t// TOBIT = 2^52 + 2^51 (float).\n  |     li ZERO, 0\n  |   mr L, CRET1\n  |     stw TMP3, TMPD\n  |     lus TMP0, 0x4338\t\t// Hiword of 2^52 + 2^51 (double)\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |     ori TMP3, TMP3, 0x0004\t\t// TONUM = 2^52 + 2^51 + 2^31 (float).\n  |     stw TMP0, TONUM_HI\n  |     li TISNIL, LJ_TNIL\n  |    li_vmstate INTERP\n  |     lfs TOBIT, TMPD\n  |     stw TMP3, TMPD\n  |  sub RC, RC, BASE\n  |    st_vmstate\n  |     lfs TONUM, TMPD\n  |  ins_callt\n  |.endif\n  |\n  |->cont_ffi_callback:\t\t\t// Return from FFI callback.\n  |.if FFI\n  |  lwz CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH)\n  |   stp BASE, L->base\n  |   stp RB, L->top\n  |  stp L, CTSTATE->L\n  |  mr CARG1, CTSTATE\n  |  mr CARG2, RA\n  |  bl extern lj_ccallback_leave\t// (CTState *cts, TValue *o)\n  |  lwz CRET1, CTSTATE->cb.gpr[0]\n  |  lfd FARG1, CTSTATE->cb.fpr[0]\n  |  lwz CRET2, CTSTATE->cb.gpr[1]\n  |  b ->vm_leave_unw\n  |.endif\n  |\n  |->vm_ffi_call:\t\t\t// Call C function via FFI.\n  |  // Caveat: needs special frame unwinding, see below.\n  |.if FFI\n  |  .type CCSTATE, CCallState, CARG1\n  |  lwz TMP1, CCSTATE->spadj\n  |    mflr TMP0\n  |   lbz CARG2, CCSTATE->nsp\n  |   lbz CARG3, CCSTATE->nfpr\n  |  neg TMP1, TMP1\n  |    stw TMP0, 4(sp)\n  |   cmpwi cr1, CARG3, 0\n  |  mr TMP2, sp\n  |   addic. CARG2, CARG2, -1\n  |  stwux sp, sp, TMP1\n  |   crnot 4*cr1+eq, 4*cr1+eq\t\t// For vararg calls.\n  |  stw r14, -4(TMP2)\n  |  stw CCSTATE, -8(TMP2)\n  |  mr r14, TMP2\n  |  la TMP1, CCSTATE->stack\n  |   slwi CARG2, CARG2, 2\n  |   blty >2\n  |  la TMP2, 8(sp)\n  |1:\n  |  lwzx TMP0, TMP1, CARG2\n  |  stwx TMP0, TMP2, CARG2\n  |   addic. CARG2, CARG2, -4\n  |  bge <1\n  |2:\n  |  bney cr1, >3\n  |  lfd f1, CCSTATE->fpr[0]\n  |  lfd f2, CCSTATE->fpr[1]\n  |  lfd f3, CCSTATE->fpr[2]\n  |  lfd f4, CCSTATE->fpr[3]\n  |  lfd f5, CCSTATE->fpr[4]\n  |  lfd f6, CCSTATE->fpr[5]\n  |  lfd f7, CCSTATE->fpr[6]\n  |  lfd f8, CCSTATE->fpr[7]\n  |3:\n  |   lp TMP0, CCSTATE->func\n  |  lwz CARG2, CCSTATE->gpr[1]\n  |  lwz CARG3, CCSTATE->gpr[2]\n  |  lwz CARG4, CCSTATE->gpr[3]\n  |  lwz CARG5, CCSTATE->gpr[4]\n  |   mtctr TMP0\n  |  lwz r8, CCSTATE->gpr[5]\n  |  lwz r9, CCSTATE->gpr[6]\n  |  lwz r10, CCSTATE->gpr[7]\n  |  lwz CARG1, CCSTATE->gpr[0]\t\t// Do this last, since CCSTATE is CARG1.\n  |   bctrl\n  |  lwz CCSTATE:TMP1, -8(r14)\n  |  lwz TMP2, -4(r14)\n  |   lwz TMP0, 4(r14)\n  |  stw CARG1, CCSTATE:TMP1->gpr[0]\n  |  stfd FARG1, CCSTATE:TMP1->fpr[0]\n  |  stw CARG2, CCSTATE:TMP1->gpr[1]\n  |   mtlr TMP0\n  |  stw CARG3, CCSTATE:TMP1->gpr[2]\n  |   mr sp, r14\n  |  stw CARG4, CCSTATE:TMP1->gpr[3]\n  |   mr r14, TMP2\n  |  blr\n  |.endif\n  |// Note: vm_ffi_call must be the last function in this object file!\n  |\n  |//-----------------------------------------------------------------------\n}\n\n/* Generate the code for a single instruction. */\nstatic void build_ins(BuildCtx *ctx, BCOp op, int defop)\n{\n  int vk = 0;\n  |=>defop:\n\n  switch (op) {\n\n  /* -- Comparison ops ---------------------------------------------------- */\n\n  /* Remember: all ops branch for a true comparison, fall through otherwise. */\n\n  case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:\n    |  // RA = src1*8, RD = src2*8, JMP with RD = target\n    |.if DUALNUM\n    |  lwzux TMP0, RA, BASE\n    |    addi PC, PC, 4\n    |   lwz CARG2, 4(RA)\n    |  lwzux TMP1, RD, BASE\n    |    lwz TMP2, -4(PC)\n    |  checknum cr0, TMP0\n    |   lwz CARG3, 4(RD)\n    |    decode_RD4 TMP2, TMP2\n    |  checknum cr1, TMP1\n    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    |  bne cr0, >7\n    |  bne cr1, >8\n    |   cmpw CARG2, CARG3\n    if (op == BC_ISLT) {\n      |  bge >2\n    } else if (op == BC_ISGE) {\n      |  blt >2\n    } else if (op == BC_ISLE) {\n      |  bgt >2\n    } else {\n      |  ble >2\n    }\n    |1:\n    |  add PC, PC, TMP2\n    |2:\n    |  ins_next\n    |\n    |7:  // RA is not an integer.\n    |  bgt cr0, ->vmeta_comp\n    |  // RA is a number.\n    |   lfd f0, 0(RA)\n    |  bgt cr1, ->vmeta_comp\n    |  blt cr1, >4\n    |  // RA is a number, RD is an integer.\n    |  tonum_i f1, CARG3\n    |  b >5\n    |\n    |8: // RA is an integer, RD is not an integer.\n    |  bgt cr1, ->vmeta_comp\n    |  // RA is an integer, RD is a number.\n    |  tonum_i f0, CARG2\n    |4:\n    |  lfd f1, 0(RD)\n    |5:\n    |  fcmpu cr0, f0, f1\n    if (op == BC_ISLT) {\n      |  bge <2\n    } else if (op == BC_ISGE) {\n      |  blt <2\n    } else if (op == BC_ISLE) {\n      |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq\n      |  bge <2\n    } else {\n      |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq\n      |  blt <2\n    }\n    |  b <1\n    |.else\n    |  lwzx TMP0, BASE, RA\n    |    addi PC, PC, 4\n    |   lfdx f0, BASE, RA\n    |  lwzx TMP1, BASE, RD\n    |  checknum cr0, TMP0\n    |    lwz TMP2, -4(PC)\n    |   lfdx f1, BASE, RD\n    |  checknum cr1, TMP1\n    |    decode_RD4 TMP2, TMP2\n    |  bge cr0, ->vmeta_comp\n    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    |  bge cr1, ->vmeta_comp\n    |  fcmpu cr0, f0, f1\n    if (op == BC_ISLT) {\n      |  bge >1\n    } else if (op == BC_ISGE) {\n      |  blt >1\n    } else if (op == BC_ISLE) {\n      |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq\n      |  bge >1\n    } else {\n      |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+eq\n      |  blt >1\n    }\n    |  add PC, PC, TMP2\n    |1:\n    |  ins_next\n    |.endif\n    break;\n\n  case BC_ISEQV: case BC_ISNEV:\n    vk = op == BC_ISEQV;\n    |  // RA = src1*8, RD = src2*8, JMP with RD = target\n    |.if DUALNUM\n    |  lwzux TMP0, RA, BASE\n    |    addi PC, PC, 4\n    |   lwz CARG2, 4(RA)\n    |  lwzux TMP1, RD, BASE\n    |  checknum cr0, TMP0\n    |    lwz TMP2, -4(PC)\n    |  checknum cr1, TMP1\n    |    decode_RD4 TMP2, TMP2\n    |   lwz CARG3, 4(RD)\n    |  cror 4*cr7+gt, 4*cr0+gt, 4*cr1+gt\n    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    if (vk) {\n      |  ble cr7, ->BC_ISEQN_Z\n    } else {\n      |  ble cr7, ->BC_ISNEN_Z\n    }\n    |.else\n    |  lwzux TMP0, RA, BASE\n    |   lwz TMP2, 0(PC)\n    |    lfd f0, 0(RA)\n    |   addi PC, PC, 4\n    |  lwzux TMP1, RD, BASE\n    |  checknum cr0, TMP0\n    |   decode_RD4 TMP2, TMP2\n    |    lfd f1, 0(RD)\n    |  checknum cr1, TMP1\n    |   addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    |  bge cr0, >5\n    |  bge cr1, >5\n    |  fcmpu cr0, f0, f1\n    if (vk) {\n      |  bne >1\n      |  add PC, PC, TMP2\n    } else {\n      |  beq >1\n      |  add PC, PC, TMP2\n    }\n    |1:\n    |  ins_next\n    |.endif\n    |5:  // Either or both types are not numbers.\n    |.if not DUALNUM\n    |    lwz CARG2, 4(RA)\n    |    lwz CARG3, 4(RD)\n    |.endif\n    |.if FFI\n    |  cmpwi cr7, TMP0, LJ_TCDATA\n    |  cmpwi cr5, TMP1, LJ_TCDATA\n    |.endif\n    |   not TMP3, TMP0\n    |  cmplw TMP0, TMP1\n    |   cmplwi cr1, TMP3, ~LJ_TISPRI\t\t// Primitive?\n    |.if FFI\n    |  cror 4*cr7+eq, 4*cr7+eq, 4*cr5+eq\n    |.endif\n    |   cmplwi cr6, TMP3, ~LJ_TISTABUD\t\t// Table or userdata?\n    |.if FFI\n    |  beq cr7, ->vmeta_equal_cd\n    |.endif\n    |    cmplw cr5, CARG2, CARG3\n    |  crandc 4*cr0+gt, 4*cr0+eq, 4*cr1+gt\t// 2: Same type and primitive.\n    |  crorc 4*cr0+lt, 4*cr5+eq, 4*cr0+eq\t// 1: Same tv or different type.\n    |  crand 4*cr0+eq, 4*cr0+eq, 4*cr5+eq\t// 0: Same type and same tv.\n    |   mr SAVE0, PC\n    |  cror 4*cr0+eq, 4*cr0+eq, 4*cr0+gt\t// 0 or 2.\n    |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+gt\t// 1 or 2.\n    if (vk) {\n      |  bne cr0, >6\n      |  add PC, PC, TMP2\n      |6:\n    } else {\n      |  beq cr0, >6\n      |  add PC, PC, TMP2\n      |6:\n    }\n    |.if DUALNUM\n    |  bge cr0, >2\t\t\t// Done if 1 or 2.\n    |1:\n    |  ins_next\n    |2:\n    |.else\n    |  blt cr0, <1\t\t\t// Done if 1 or 2.\n    |.endif\n    |  blt cr6, <1\t\t\t// Done if not tab/ud.\n    |\n    |  // Different tables or userdatas. Need to check __eq metamethod.\n    |  // Field metatable must be at same offset for GCtab and GCudata!\n    |  lwz TAB:TMP2, TAB:CARG2->metatable\n    |   li CARG4, 1-vk\t\t\t// ne = 0 or 1.\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable?\n    |  lbz TMP2, TAB:TMP2->nomm\n    |  andix. TMP2, TMP2, 1<<MM_eq\n    |  bne <1\t\t\t\t// Or 'no __eq' flag set?\n    |  mr PC, SAVE0\t\t\t// Restore old PC.\n    |  b ->vmeta_equal\t\t\t// Handle __eq metamethod.\n    break;\n\n  case BC_ISEQS: case BC_ISNES:\n    vk = op == BC_ISEQS;\n    |  // RA = src*8, RD = str_const*8 (~), JMP with RD = target\n    |  lwzux TMP0, RA, BASE\n    |   srwi RD, RD, 1\n    |  lwz STR:TMP3, 4(RA)\n    |    lwz TMP2, 0(PC)\n    |   subfic RD, RD, -4\n    |    addi PC, PC, 4\n    |.if FFI\n    |  cmpwi TMP0, LJ_TCDATA\n    |.endif\n    |   lwzx STR:TMP1, KBASE, RD\t// KBASE-4-str_const*4\n    |  .gpr64 extsw TMP0, TMP0\n    |  subfic TMP0, TMP0, LJ_TSTR\n    |.if FFI\n    |  beq ->vmeta_equal_cd\n    |.endif\n    |  sub TMP1, STR:TMP1, STR:TMP3\n    |  or TMP0, TMP0, TMP1\n    |    decode_RD4 TMP2, TMP2\n    |  subfic TMP0, TMP0, 0\n    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    |  subfe TMP1, TMP1, TMP1\n    if (vk) {\n      |  andc TMP2, TMP2, TMP1\n    } else {\n      |  and TMP2, TMP2, TMP1\n    }\n    |  add PC, PC, TMP2\n    |  ins_next\n    break;\n\n  case BC_ISEQN: case BC_ISNEN:\n    vk = op == BC_ISEQN;\n    |  // RA = src*8, RD = num_const*8, JMP with RD = target\n    |.if DUALNUM\n    |  lwzux TMP0, RA, BASE\n    |    addi PC, PC, 4\n    |   lwz CARG2, 4(RA)\n    |  lwzux TMP1, RD, KBASE\n    |  checknum cr0, TMP0\n    |    lwz TMP2, -4(PC)\n    |  checknum cr1, TMP1\n    |    decode_RD4 TMP2, TMP2\n    |   lwz CARG3, 4(RD)\n    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    if (vk) {\n      |->BC_ISEQN_Z:\n    } else {\n      |->BC_ISNEN_Z:\n    }\n    |  bne cr0, >7\n    |  bne cr1, >8\n    |   cmpw CARG2, CARG3\n    |4:\n    |.else\n    if (vk) {\n      |->BC_ISEQN_Z:  // Dummy label.\n    } else {\n      |->BC_ISNEN_Z:  // Dummy label.\n    }\n    |  lwzx TMP0, BASE, RA\n    |    addi PC, PC, 4\n    |   lfdx f0, BASE, RA\n    |    lwz TMP2, -4(PC)\n    |  lfdx f1, KBASE, RD\n    |    decode_RD4 TMP2, TMP2\n    |  checknum TMP0\n    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    |  bge >3\n    |  fcmpu cr0, f0, f1\n    |.endif\n    if (vk) {\n      |  bne >1\n      |  add PC, PC, TMP2\n      |1:\n      |.if not FFI\n      |3:\n      |.endif\n    } else {\n      |  beq >2\n      |1:\n      |.if not FFI\n      |3:\n      |.endif\n      |  add PC, PC, TMP2\n      |2:\n    }\n    |  ins_next\n    |.if FFI\n    |3:\n    |  cmpwi TMP0, LJ_TCDATA\n    |  beq ->vmeta_equal_cd\n    |  b <1\n    |.endif\n    |.if DUALNUM\n    |7:  // RA is not an integer.\n    |  bge cr0, <3\n    |  // RA is a number.\n    |   lfd f0, 0(RA)\n    |  blt cr1, >1\n    |  // RA is a number, RD is an integer.\n    |  tonum_i f1, CARG3\n    |  b >2\n    |\n    |8: // RA is an integer, RD is a number.\n    |  tonum_i f0, CARG2\n    |1:\n    |  lfd f1, 0(RD)\n    |2:\n    |  fcmpu cr0, f0, f1\n    |  b <4\n    |.endif\n    break;\n\n  case BC_ISEQP: case BC_ISNEP:\n    vk = op == BC_ISEQP;\n    |  // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target\n    |  lwzx TMP0, BASE, RA\n    |   srwi TMP1, RD, 3\n    |    lwz TMP2, 0(PC)\n    |   not TMP1, TMP1\n    |    addi PC, PC, 4\n    |.if FFI\n    |  cmpwi TMP0, LJ_TCDATA\n    |.endif\n    |  sub TMP0, TMP0, TMP1\n    |.if FFI\n    |  beq ->vmeta_equal_cd\n    |.endif\n    |    decode_RD4 TMP2, TMP2\n    |  .gpr64 extsw TMP0, TMP0\n    |  addic TMP0, TMP0, -1\n    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n    |  subfe TMP1, TMP1, TMP1\n    if (vk) {\n      |  and TMP2, TMP2, TMP1\n    } else {\n      |  andc TMP2, TMP2, TMP1\n    }\n    |  add PC, PC, TMP2\n    |  ins_next\n    break;\n\n  /* -- Unary test and copy ops ------------------------------------------- */\n\n  case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:\n    |  // RA = dst*8 or unused, RD = src*8, JMP with RD = target\n    |  lwzx TMP0, BASE, RD\n    |   lwz INS, 0(PC)\n    |   addi PC, PC, 4\n    if (op == BC_IST || op == BC_ISF) {\n      |  .gpr64 extsw TMP0, TMP0\n      |  subfic TMP0, TMP0, LJ_TTRUE\n      |   decode_RD4 TMP2, INS\n      |  subfe TMP1, TMP1, TMP1\n      |   addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)\n      if (op == BC_IST) {\n\t|  andc TMP2, TMP2, TMP1\n      } else {\n\t|  and TMP2, TMP2, TMP1\n      }\n      |  add PC, PC, TMP2\n    } else {\n      |  li TMP1, LJ_TFALSE\n      |   lfdx f0, BASE, RD\n      |  cmplw TMP0, TMP1\n      if (op == BC_ISTC) {\n\t|  bge >1\n      } else {\n\t|  blt >1\n      }\n      |  addis PC, PC, -(BCBIAS_J*4 >> 16)\n      |  decode_RD4 TMP2, INS\n      |   stfdx f0, BASE, RA\n      |  add PC, PC, TMP2\n      |1:\n    }\n    |  ins_next\n    break;\n\n  /* -- Unary ops --------------------------------------------------------- */\n\n  case BC_MOV:\n    |  // RA = dst*8, RD = src*8\n    |  ins_next1\n    |  lfdx f0, BASE, RD\n    |  stfdx f0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_NOT:\n    |  // RA = dst*8, RD = src*8\n    |  ins_next1\n    |  lwzx TMP0, BASE, RD\n    |  .gpr64 extsw TMP0, TMP0\n    |  subfic TMP1, TMP0, LJ_TTRUE\n    |  adde TMP0, TMP0, TMP1\n    |  stwx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_UNM:\n    |  // RA = dst*8, RD = src*8\n    |  lwzux TMP1, RD, BASE\n    |   lwz TMP0, 4(RD)\n    |  checknum TMP1\n    |.if DUALNUM\n    |  bne >5\n    |.if GPR64\n    |  lus TMP2, 0x8000\n    |  neg TMP0, TMP0\n    |  cmplw TMP0, TMP2\n    |  beq >4\n    |.else\n    |  nego. TMP0, TMP0\n    |  bso >4\n    |1:\n    |.endif\n    |  ins_next1\n    |  stwux TISNUM, RA, BASE\n    |   stw TMP0, 4(RA)\n    |3:\n    |  ins_next2\n    |4:\n    |.if not GPR64\n    |  // Potential overflow.\n    |  mcrxr cr0; bley <1\t\t// Ignore unrelated overflow.\n    |.endif\n    |  lus TMP1, 0x41e0\t\t\t// 2^31.\n    |  li TMP0, 0\n    |  b >7\n    |.endif\n    |5:\n    |  bge ->vmeta_unm\n    |  xoris TMP1, TMP1, 0x8000\n    |7:\n    |  ins_next1\n    |  stwux TMP1, RA, BASE\n    |   stw TMP0, 4(RA)\n    |.if DUALNUM\n    |  b <3\n    |.else\n    |  ins_next2\n    |.endif\n    break;\n  case BC_LEN:\n    |  // RA = dst*8, RD = src*8\n    |  lwzux TMP0, RD, BASE\n    |   lwz CARG1, 4(RD)\n    |  checkstr TMP0; bne >2\n    |  lwz CRET1, STR:CARG1->len\n    |1:\n    |.if DUALNUM\n    |  ins_next1\n    |  stwux TISNUM, RA, BASE\n    |   stw CRET1, 4(RA)\n    |.else\n    |  tonum_u f0, CRET1\t\t// Result is a non-negative integer.\n    |  ins_next1\n    |  stfdx f0, BASE, RA\n    |.endif\n    |  ins_next2\n    |2:\n    |  checktab TMP0; bne ->vmeta_len\n#if LJ_52\n    |  lwz TAB:TMP2, TAB:CARG1->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  bne >9\n    |3:\n#endif\n    |->BC_LEN_Z:\n    |  bl extern lj_tab_len\t\t// (GCtab *t)\n    |  // Returns uint32_t (but less than 2^31).\n    |  b <1\n#if LJ_52\n    |9:\n    |  lbz TMP0, TAB:TMP2->nomm\n    |  andix. TMP0, TMP0, 1<<MM_len\n    |  bne <3\t\t\t\t// 'no __len' flag set: done.\n    |  b ->vmeta_len\n#endif\n    break;\n\n  /* -- Binary ops -------------------------------------------------------- */\n\n    |.macro ins_arithpre\n    |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8\n    ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);\n    ||switch (vk) {\n    ||case 0:\n    |   lwzx TMP1, BASE, RB\n    |   .if DUALNUM\n    |     lwzx TMP2, KBASE, RC\n    |   .endif\n    |    lfdx f14, BASE, RB\n    |    lfdx f15, KBASE, RC\n    |   .if DUALNUM\n    |     checknum cr0, TMP1\n    |     checknum cr1, TMP2\n    |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n    |     bge ->vmeta_arith_vn\n    |   .else\n    |     checknum TMP1; bge ->vmeta_arith_vn\n    |   .endif\n    ||  break;\n    ||case 1:\n    |   lwzx TMP1, BASE, RB\n    |   .if DUALNUM\n    |     lwzx TMP2, KBASE, RC\n    |   .endif\n    |    lfdx f15, BASE, RB\n    |    lfdx f14, KBASE, RC\n    |   .if DUALNUM\n    |     checknum cr0, TMP1\n    |     checknum cr1, TMP2\n    |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n    |     bge ->vmeta_arith_nv\n    |   .else\n    |     checknum TMP1; bge ->vmeta_arith_nv\n    |   .endif\n    ||  break;\n    ||default:\n    |   lwzx TMP1, BASE, RB\n    |   lwzx TMP2, BASE, RC\n    |    lfdx f14, BASE, RB\n    |    lfdx f15, BASE, RC\n    |   checknum cr0, TMP1\n    |   checknum cr1, TMP2\n    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n    |   bge ->vmeta_arith_vv\n    ||  break;\n    ||}\n    |.endmacro\n    |\n    |.macro ins_arithfallback, ins\n    ||switch (vk) {\n    ||case 0:\n    |   ins ->vmeta_arith_vn2\n    ||  break;\n    ||case 1:\n    |   ins ->vmeta_arith_nv2\n    ||  break;\n    ||default:\n    |   ins ->vmeta_arith_vv2\n    ||  break;\n    ||}\n    |.endmacro\n    |\n    |.macro intmod, a, b, c\n    |  bl ->vm_modi\n    |.endmacro\n    |\n    |.macro fpmod, a, b, c\n    |->BC_MODVN_Z:\n    |  fdiv FARG1, b, c\n    |  // NYI: Use internal implementation of floor.\n    |  blex floor\t\t\t// floor(b/c)\n    |  fmul a, FARG1, c\n    |  fsub a, b, a\t\t\t// b - floor(b/c)*c\n    |.endmacro\n    |\n    |.macro ins_arithfp, fpins\n    |  ins_arithpre\n    |.if \"fpins\" == \"fpmod_\"\n    |  b ->BC_MODVN_Z\t\t\t// Avoid 3 copies. It's slow anyway.\n    |.else\n    |  fpins f0, f14, f15\n    |  ins_next1\n    |  stfdx f0, BASE, RA\n    |  ins_next2\n    |.endif\n    |.endmacro\n    |\n    |.macro ins_arithdn, intins, fpins\n    |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8\n    ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);\n    ||switch (vk) {\n    ||case 0:\n    |   lwzux TMP1, RB, BASE\n    |   lwzux TMP2, RC, KBASE\n    |    lwz CARG1, 4(RB)\n    |   checknum cr0, TMP1\n    |    lwz CARG2, 4(RC)\n    ||  break;\n    ||case 1:\n    |   lwzux TMP1, RB, BASE\n    |   lwzux TMP2, RC, KBASE\n    |    lwz CARG2, 4(RB)\n    |   checknum cr0, TMP1\n    |    lwz CARG1, 4(RC)\n    ||  break;\n    ||default:\n    |   lwzux TMP1, RB, BASE\n    |   lwzux TMP2, RC, BASE\n    |    lwz CARG1, 4(RB)\n    |   checknum cr0, TMP1\n    |    lwz CARG2, 4(RC)\n    ||  break;\n    ||}\n    |  checknum cr1, TMP2\n    |  bne >5\n    |  bne cr1, >5\n    |  intins CARG1, CARG1, CARG2\n    |  bso >4\n    |1:\n    |  ins_next1\n    |  stwux TISNUM, RA, BASE\n    |  stw CARG1, 4(RA)\n    |2:\n    |  ins_next2\n    |4:  // Overflow.\n    |  mcrxr cr0; bley <1\t\t// Ignore unrelated overflow.\n    |  ins_arithfallback b\n    |5:  // FP variant.\n    ||if (vk == 1) {\n    |  lfd f15, 0(RB)\n    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n    |  lfd f14, 0(RC)\n    ||} else {\n    |  lfd f14, 0(RB)\n    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n    |  lfd f15, 0(RC)\n    ||}\n    |   ins_arithfallback bge\n    |.if \"fpins\" == \"fpmod_\"\n    |  b ->BC_MODVN_Z\t\t\t// Avoid 3 copies. It's slow anyway.\n    |.else\n    |  fpins f0, f14, f15\n    |  ins_next1\n    |  stfdx f0, BASE, RA\n    |  b <2\n    |.endif\n    |.endmacro\n    |\n    |.macro ins_arith, intins, fpins\n    |.if DUALNUM\n    |  ins_arithdn intins, fpins\n    |.else\n    |  ins_arithfp fpins\n    |.endif\n    |.endmacro\n\n  case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:\n    |.if GPR64\n    |.macro addo32., y, a, b\n    |  // Need to check overflow for (a<<32) + (b<<32).\n    |  rldicr TMP0, a, 32, 31\n    |  rldicr TMP3, b, 32, 31\n    |  addo. TMP0, TMP0, TMP3\n    |  add y, a, b\n    |.endmacro\n    |  ins_arith addo32., fadd\n    |.else\n    |  ins_arith addo., fadd\n    |.endif\n    break;\n  case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:\n    |.if GPR64\n    |.macro subo32., y, a, b\n    |  // Need to check overflow for (a<<32) - (b<<32).\n    |  rldicr TMP0, a, 32, 31\n    |  rldicr TMP3, b, 32, 31\n    |  subo. TMP0, TMP0, TMP3\n    |  sub y, a, b\n    |.endmacro\n    |  ins_arith subo32., fsub\n    |.else\n    |  ins_arith subo., fsub\n    |.endif\n    break;\n  case BC_MULVN: case BC_MULNV: case BC_MULVV:\n    |  ins_arith mullwo., fmul\n    break;\n  case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:\n    |  ins_arithfp fdiv\n    break;\n  case BC_MODVN:\n    |  ins_arith intmod, fpmod\n    break;\n  case BC_MODNV: case BC_MODVV:\n    |  ins_arith intmod, fpmod_\n    break;\n  case BC_POW:\n    |  // NYI: (partial) integer arithmetic.\n    |  lwzx TMP1, BASE, RB\n    |   lfdx FARG1, BASE, RB\n    |  lwzx TMP2, BASE, RC\n    |   lfdx FARG2, BASE, RC\n    |  checknum cr0, TMP1\n    |  checknum cr1, TMP2\n    |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n    |  bge ->vmeta_arith_vv\n    |  blex pow\n    |  ins_next1\n    |  stfdx FARG1, BASE, RA\n    |  ins_next2\n    break;\n\n  case BC_CAT:\n    |  // RA = dst*8, RB = src_start*8, RC = src_end*8\n    |  sub CARG3, RC, RB\n    |   stp BASE, L->base\n    |  add CARG2, BASE, RC\n    |  mr SAVE0, RB\n    |->BC_CAT_Z:\n    |   stw PC, SAVE_PC\n    |  mr CARG1, L\n    |  srwi CARG3, CARG3, 3\n    |  bl extern lj_meta_cat\t\t// (lua_State *L, TValue *top, int left)\n    |  // Returns NULL (finished) or TValue * (metamethod).\n    |  cmplwi CRET1, 0\n    |   lp BASE, L->base\n    |  bne ->vmeta_binop\n    |  ins_next1\n    |  lfdx f0, BASE, SAVE0\t\t// Copy result from RB to RA.\n    |  stfdx f0, BASE, RA\n    |  ins_next2\n    break;\n\n  /* -- Constant ops ------------------------------------------------------ */\n\n  case BC_KSTR:\n    |  // RA = dst*8, RD = str_const*8 (~)\n    |  srwi TMP1, RD, 1\n    |  subfic TMP1, TMP1, -4\n    |  ins_next1\n    |  lwzx TMP0, KBASE, TMP1\t\t// KBASE-4-str_const*4\n    |  li TMP2, LJ_TSTR\n    |  stwux TMP2, RA, BASE\n    |  stw TMP0, 4(RA)\n    |  ins_next2\n    break;\n  case BC_KCDATA:\n    |.if FFI\n    |  // RA = dst*8, RD = cdata_const*8 (~)\n    |  srwi TMP1, RD, 1\n    |  subfic TMP1, TMP1, -4\n    |  ins_next1\n    |  lwzx TMP0, KBASE, TMP1\t\t// KBASE-4-cdata_const*4\n    |  li TMP2, LJ_TCDATA\n    |  stwux TMP2, RA, BASE\n    |  stw TMP0, 4(RA)\n    |  ins_next2\n    |.endif\n    break;\n  case BC_KSHORT:\n    |  // RA = dst*8, RD = int16_literal*8\n    |.if DUALNUM\n    |  slwi RD, RD, 13\n    |  srawi RD, RD, 16\n    |  ins_next1\n    |   stwux TISNUM, RA, BASE\n    |   stw RD, 4(RA)\n    |  ins_next2\n    |.else\n    |  // The soft-float approach is faster.\n    |  slwi RD, RD, 13\n    |  srawi TMP1, RD, 31\n    |  xor TMP2, TMP1, RD\n    |  sub TMP2, TMP2, TMP1\t\t// TMP2 = abs(x)\n    |  cntlzw TMP3, TMP2\n    |  subfic TMP1, TMP3, 0x40d\t\t// TMP1 = exponent-1\n    |   slw TMP2, TMP2, TMP3\t\t// TMP2 = left aligned mantissa\n    |    subfic TMP3, RD, 0\n    |  slwi TMP1, TMP1, 20\n    |   rlwimi RD, TMP2, 21, 1, 31\t// hi = sign(x) | (mantissa>>11)\n    |    subfe TMP0, TMP0, TMP0\n    |   add RD, RD, TMP1\t\t// hi = hi + exponent-1\n    |    and RD, RD, TMP0\t\t// hi = x == 0 ? 0 : hi\n    |  ins_next1\n    |    stwux RD, RA, BASE\n    |    stw ZERO, 4(RA)\n    |  ins_next2\n    |.endif\n    break;\n  case BC_KNUM:\n    |  // RA = dst*8, RD = num_const*8\n    |  ins_next1\n    |  lfdx f0, KBASE, RD\n    |  stfdx f0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_KPRI:\n    |  // RA = dst*8, RD = primitive_type*8 (~)\n    |  srwi TMP1, RD, 3\n    |  not TMP0, TMP1\n    |  ins_next1\n    |  stwx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_KNIL:\n    |  // RA = base*8, RD = end*8\n    |  stwx TISNIL, BASE, RA\n    |   addi RA, RA, 8\n    |1:\n    |  stwx TISNIL, BASE, RA\n    |  cmpw RA, RD\n    |   addi RA, RA, 8\n    |  blt <1\n    |  ins_next_\n    break;\n\n  /* -- Upvalue and function ops ------------------------------------------ */\n\n  case BC_UGET:\n    |  // RA = dst*8, RD = uvnum*8\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi RD, RD, 1\n    |   addi RD, RD, offsetof(GCfuncL, uvptr)\n    |  lwzx UPVAL:RB, LFUNC:RB, RD\n    |  ins_next1\n    |  lwz TMP1, UPVAL:RB->v\n    |  lfd f0, 0(TMP1)\n    |  stfdx f0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_USETV:\n    |  // RA = uvnum*8, RD = src*8\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |    srwi RA, RA, 1\n    |    addi RA, RA, offsetof(GCfuncL, uvptr)\n    |   lfdux f0, RD, BASE\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |  lbz TMP3, UPVAL:RB->marked\n    |   lwz CARG2, UPVAL:RB->v\n    |  andix. TMP3, TMP3, LJ_GC_BLACK\t// isblack(uv)\n    |    lbz TMP0, UPVAL:RB->closed\n    |   lwz TMP2, 0(RD)\n    |   stfd f0, 0(CARG2)\n    |    cmplwi cr1, TMP0, 0\n    |   lwz TMP1, 4(RD)\n    |  cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq\n    |   subi TMP2, TMP2, (LJ_TISNUM+1)\n    |  bne >2\t\t\t\t// Upvalue is closed and black?\n    |1:\n    |  ins_next\n    |\n    |2:  // Check if new value is collectable.\n    |  cmplwi TMP2, LJ_TISGCV - (LJ_TISNUM+1)\n    |  bge <1\t\t\t\t// tvisgcv(v)\n    |  lbz TMP3, GCOBJ:TMP1->gch.marked\n    |  andix. TMP3, TMP3, LJ_GC_WHITES\t// iswhite(v)\n    |   la CARG1, GG_DISP2G(DISPATCH)\n    |  // Crossed a write barrier. Move the barrier forward.\n    |  beq <1\n    |  bl extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |  b <1\n    break;\n  case BC_USETS:\n    |  // RA = uvnum*8, RD = str_const*8 (~)\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi TMP1, RD, 1\n    |    srwi RA, RA, 1\n    |   subfic TMP1, TMP1, -4\n    |    addi RA, RA, offsetof(GCfuncL, uvptr)\n    |   lwzx STR:TMP1, KBASE, TMP1\t// KBASE-4-str_const*4\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |  lbz TMP3, UPVAL:RB->marked\n    |   lwz CARG2, UPVAL:RB->v\n    |  andix. TMP3, TMP3, LJ_GC_BLACK\t// isblack(uv)\n    |   lbz TMP3, STR:TMP1->marked\n    |   lbz TMP2, UPVAL:RB->closed\n    |   li TMP0, LJ_TSTR\n    |   stw STR:TMP1, 4(CARG2)\n    |   stw TMP0, 0(CARG2)\n    |  bne >2\n    |1:\n    |  ins_next\n    |\n    |2:  // Check if string is white and ensure upvalue is closed.\n    |  andix. TMP3, TMP3, LJ_GC_WHITES\t// iswhite(str)\n    |   cmplwi cr1, TMP2, 0\n    |  cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq\n    |   la CARG1, GG_DISP2G(DISPATCH)\n    |  // Crossed a write barrier. Move the barrier forward.\n    |  beq <1\n    |  bl extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |  b <1\n    break;\n  case BC_USETN:\n    |  // RA = uvnum*8, RD = num_const*8\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi RA, RA, 1\n    |   addi RA, RA, offsetof(GCfuncL, uvptr)\n    |    lfdx f0, KBASE, RD\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |  ins_next1\n    |  lwz TMP1, UPVAL:RB->v\n    |  stfd f0, 0(TMP1)\n    |  ins_next2\n    break;\n  case BC_USETP:\n    |  // RA = uvnum*8, RD = primitive_type*8 (~)\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi RA, RA, 1\n    |    srwi TMP0, RD, 3\n    |   addi RA, RA, offsetof(GCfuncL, uvptr)\n    |    not TMP0, TMP0\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |  ins_next1\n    |  lwz TMP1, UPVAL:RB->v\n    |  stw TMP0, 0(TMP1)\n    |  ins_next2\n    break;\n\n  case BC_UCLO:\n    |  // RA = level*8, RD = target\n    |  lwz TMP1, L->openupval\n    |  branch_RD\t\t\t// Do this first since RD is not saved.\n    |   stp BASE, L->base\n    |  cmplwi TMP1, 0\n    |   mr CARG1, L\n    |  beq >1\n    |   add CARG2, BASE, RA\n    |  bl extern lj_func_closeuv\t// (lua_State *L, TValue *level)\n    |  lp BASE, L->base\n    |1:\n    |  ins_next\n    break;\n\n  case BC_FNEW:\n    |  // RA = dst*8, RD = proto_const*8 (~) (holding function prototype)\n    |  srwi TMP1, RD, 1\n    |   stp BASE, L->base\n    |  subfic TMP1, TMP1, -4\n    |   stw PC, SAVE_PC\n    |  lwzx CARG2, KBASE, TMP1\t\t// KBASE-4-tab_const*4\n    |   mr CARG1, L\n    |  lwz CARG3, FRAME_FUNC(BASE)\n    |  // (lua_State *L, GCproto *pt, GCfuncL *parent)\n    |  bl extern lj_func_newL_gc\n    |  // Returns GCfuncL *.\n    |  lp BASE, L->base\n    |   li TMP0, LJ_TFUNC\n    |  stwux TMP0, RA, BASE\n    |  stw LFUNC:CRET1, 4(RA)\n    |  ins_next\n    break;\n\n  /* -- Table ops --------------------------------------------------------- */\n\n  case BC_TNEW:\n  case BC_TDUP:\n    |  // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~)\n    |  lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH)\n    |   mr CARG1, L\n    |  lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)\n    |   stp BASE, L->base\n    |  cmplw TMP0, TMP1\n    |   stw PC, SAVE_PC\n    |  bge >5\n    |1:\n    if (op == BC_TNEW) {\n      |  rlwinm CARG2, RD, 29, 21, 31\n      |  rlwinm CARG3, RD, 18, 27, 31\n      |  cmpwi CARG2, 0x7ff; beq >3\n      |2:\n      |  bl extern lj_tab_new  // (lua_State *L, int32_t asize, uint32_t hbits)\n      |  // Returns Table *.\n    } else {\n      |  srwi TMP1, RD, 1\n      |  subfic TMP1, TMP1, -4\n      |  lwzx CARG2, KBASE, TMP1\t\t// KBASE-4-tab_const*4\n      |  bl extern lj_tab_dup  // (lua_State *L, Table *kt)\n      |  // Returns Table *.\n    }\n    |  lp BASE, L->base\n    |   li TMP0, LJ_TTAB\n    |  stwux TMP0, RA, BASE\n    |  stw TAB:CRET1, 4(RA)\n    |  ins_next\n    if (op == BC_TNEW) {\n      |3:\n      |  li CARG2, 0x801\n      |  b <2\n    }\n    |5:\n    |  mr SAVE0, RD\n    |  bl extern lj_gc_step_fixtop  // (lua_State *L)\n    |  mr RD, SAVE0\n    |  mr CARG1, L\n    |  b <1\n    break;\n\n  case BC_GGET:\n    |  // RA = dst*8, RD = str_const*8 (~)\n  case BC_GSET:\n    |  // RA = src*8, RD = str_const*8 (~)\n    |  lwz LFUNC:TMP2, FRAME_FUNC(BASE)\n    |   srwi TMP1, RD, 1\n    |  lwz TAB:RB, LFUNC:TMP2->env\n    |   subfic TMP1, TMP1, -4\n    |   lwzx STR:RC, KBASE, TMP1\t// KBASE-4-str_const*4\n    if (op == BC_GGET) {\n      |  b ->BC_TGETS_Z\n    } else {\n      |  b ->BC_TSETS_Z\n    }\n    break;\n\n  case BC_TGETV:\n    |  // RA = dst*8, RB = table*8, RC = key*8\n    |  lwzux CARG1, RB, BASE\n    |  lwzux CARG2, RC, BASE\n    |   lwz TAB:RB, 4(RB)\n    |.if DUALNUM\n    |   lwz RC, 4(RC)\n    |.else\n    |   lfd f0, 0(RC)\n    |.endif\n    |  checktab CARG1\n    |   checknum cr1, CARG2\n    |  bne ->vmeta_tgetv\n    |.if DUALNUM\n    |  lwz TMP0, TAB:RB->asize\n    |   bne cr1, >5\n    |   lwz TMP1, TAB:RB->array\n    |  cmplw TMP0, RC\n    |   slwi TMP2, RC, 3\n    |.else\n    |   bge cr1, >5\n    |  // Convert number key to integer, check for integerness and range.\n    |  fctiwz f1, f0\n    |    fadd f2, f0, TOBIT\n    |  stfd f1, TMPD\n    |   lwz TMP0, TAB:RB->asize\n    |    fsub f2, f2, TOBIT\n    |  lwz TMP2, TMPD_LO\n    |   lwz TMP1, TAB:RB->array\n    |    fcmpu cr1, f0, f2\n    |  cmplw cr0, TMP0, TMP2\n    |  crand 4*cr0+gt, 4*cr0+gt, 4*cr1+eq\n    |   slwi TMP2, TMP2, 3\n    |.endif\n    |  ble ->vmeta_tgetv\t\t// Integer key and in array part?\n    |  lwzx TMP0, TMP1, TMP2\n    |   lfdx f14, TMP1, TMP2\n    |  checknil TMP0; beq >2\n    |1:\n    |  ins_next1\n    |   stfdx f14, BASE, RA\n    |  ins_next2\n    |\n    |2:  // Check for __index if table value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP0, TAB:TMP2->nomm\n    |  andix. TMP0, TMP0, 1<<MM_index\n    |  bne <1\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgetv\n    |\n    |5:\n    |  checkstr CARG2; bne ->vmeta_tgetv\n    |.if not DUALNUM\n    |  lwz STR:RC, 4(RC)\n    |.endif\n    |  b ->BC_TGETS_Z\t\t\t// String key?\n    break;\n  case BC_TGETS:\n    |  // RA = dst*8, RB = table*8, RC = str_const*8 (~)\n    |  lwzux CARG1, RB, BASE\n    |   srwi TMP1, RC, 1\n    |    lwz TAB:RB, 4(RB)\n    |   subfic TMP1, TMP1, -4\n    |  checktab CARG1\n    |   lwzx STR:RC, KBASE, TMP1\t// KBASE-4-str_const*4\n    |  bne ->vmeta_tgets1\n    |->BC_TGETS_Z:\n    |  // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8\n    |  lwz TMP0, TAB:RB->hmask\n    |  lwz TMP1, STR:RC->hash\n    |  lwz NODE:TMP2, TAB:RB->node\n    |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n    |  slwi TMP0, TMP1, 5\n    |  slwi TMP1, TMP1, 3\n    |  sub TMP1, TMP0, TMP1\n    |  add NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n    |1:\n    |  lwz CARG1, NODE:TMP2->key\n    |   lwz TMP0, 4+offsetof(Node, key)(NODE:TMP2)\n    |    lwz CARG2, NODE:TMP2->val\n    |     lwz TMP1, 4+offsetof(Node, val)(NODE:TMP2)\n    |  checkstr CARG1; bne >4\n    |   cmpw TMP0, STR:RC; bne >4\n    |    checknil CARG2; beq >5\t\t// Key found, but nil value?\n    |3:\n    |    stwux CARG2, RA, BASE\n    |     stw TMP1, 4(RA)\n    |  ins_next\n    |\n    |4:  // Follow hash chain.\n    |  lwz NODE:TMP2, NODE:TMP2->next\n    |  cmplwi NODE:TMP2, 0\n    |  bne <1\n    |  // End of hash chain: key not found, nil result.\n    |   li CARG2, LJ_TNIL\n    |\n    |5:  // Check for __index if table value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <3\t\t\t\t// No metatable: done.\n    |  lbz TMP0, TAB:TMP2->nomm\n    |  andix. TMP0, TMP0, 1<<MM_index\n    |  bne <3\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgets\n    break;\n  case BC_TGETB:\n    |  // RA = dst*8, RB = table*8, RC = index*8\n    |  lwzux CARG1, RB, BASE\n    |   srwi TMP0, RC, 3\n    |   lwz TAB:RB, 4(RB)\n    |  checktab CARG1; bne ->vmeta_tgetb\n    |  lwz TMP1, TAB:RB->asize\n    |   lwz TMP2, TAB:RB->array\n    |  cmplw TMP0, TMP1; bge ->vmeta_tgetb\n    |  lwzx TMP1, TMP2, RC\n    |   lfdx f0, TMP2, RC\n    |  checknil TMP1; beq >5\n    |1:\n    |  ins_next1\n    |   stfdx f0, BASE, RA\n    |  ins_next2\n    |\n    |5:  // Check for __index if table value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP2, TAB:TMP2->nomm\n    |  andix. TMP2, TMP2, 1<<MM_index\n    |  bne <1\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgetb\t\t\t// Caveat: preserve TMP0!\n    break;\n\n  case BC_TSETV:\n    |  // RA = src*8, RB = table*8, RC = key*8\n    |  lwzux CARG1, RB, BASE\n    |  lwzux CARG2, RC, BASE\n    |   lwz TAB:RB, 4(RB)\n    |.if DUALNUM\n    |   lwz RC, 4(RC)\n    |.else\n    |   lfd f0, 0(RC)\n    |.endif\n    |  checktab CARG1\n    |   checknum cr1, CARG2\n    |  bne ->vmeta_tsetv\n    |.if DUALNUM\n    |  lwz TMP0, TAB:RB->asize\n    |   bne cr1, >5\n    |   lwz TMP1, TAB:RB->array\n    |  cmplw TMP0, RC\n    |   slwi TMP0, RC, 3\n    |.else\n    |   bge cr1, >5\n    |  // Convert number key to integer, check for integerness and range.\n    |  fctiwz f1, f0\n    |    fadd f2, f0, TOBIT\n    |  stfd f1, TMPD\n    |   lwz TMP0, TAB:RB->asize\n    |    fsub f2, f2, TOBIT\n    |  lwz TMP2, TMPD_LO\n    |   lwz TMP1, TAB:RB->array\n    |    fcmpu cr1, f0, f2\n    |  cmplw cr0, TMP0, TMP2\n    |  crand 4*cr0+gt, 4*cr0+gt, 4*cr1+eq\n    |   slwi TMP0, TMP2, 3\n    |.endif\n    |  ble ->vmeta_tsetv\t\t// Integer key and in array part?\n    |   lwzx TMP2, TMP1, TMP0\n    |  lbz TMP3, TAB:RB->marked\n    |    lfdx f14, BASE, RA\n    |   checknil TMP2; beq >3\n    |1:\n    |  andix. TMP2, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |    stfdx f14, TMP1, TMP0\n    |  bne >7\n    |2:\n    |  ins_next\n    |\n    |3:  // Check for __newindex if previous value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP2, TAB:TMP2->nomm\n    |  andix. TMP2, TMP2, 1<<MM_newindex\n    |  bne <1\t\t\t\t// 'no __newindex' flag set: done.\n    |  b ->vmeta_tsetv\n    |\n    |5:\n    |  checkstr CARG2; bne ->vmeta_tsetv\n    |.if not DUALNUM\n    |  lwz STR:RC, 4(RC)\n    |.endif\n    |  b ->BC_TSETS_Z\t\t\t// String key?\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0\n    |  b <2\n    break;\n  case BC_TSETS:\n    |  // RA = src*8, RB = table*8, RC = str_const*8 (~)\n    |  lwzux CARG1, RB, BASE\n    |   srwi TMP1, RC, 1\n    |    lwz TAB:RB, 4(RB)\n    |   subfic TMP1, TMP1, -4\n    |  checktab CARG1\n    |   lwzx STR:RC, KBASE, TMP1\t// KBASE-4-str_const*4\n    |  bne ->vmeta_tsets1\n    |->BC_TSETS_Z:\n    |  // TAB:RB = GCtab *, STR:RC = GCstr *, RA = src*8\n    |  lwz TMP0, TAB:RB->hmask\n    |  lwz TMP1, STR:RC->hash\n    |  lwz NODE:TMP2, TAB:RB->node\n    |    stb ZERO, TAB:RB->nomm\t\t// Clear metamethod cache.\n    |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n    |    lfdx f14, BASE, RA\n    |  slwi TMP0, TMP1, 5\n    |  slwi TMP1, TMP1, 3\n    |  sub TMP1, TMP0, TMP1\n    |    lbz TMP3, TAB:RB->marked\n    |  add NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n    |1:\n    |  lwz CARG1, NODE:TMP2->key\n    |   lwz TMP0, 4+offsetof(Node, key)(NODE:TMP2)\n    |    lwz CARG2, NODE:TMP2->val\n    |     lwz NODE:TMP1, NODE:TMP2->next\n    |  checkstr CARG1; bne >5\n    |   cmpw TMP0, STR:RC; bne >5\n    |    checknil CARG2; beq >4\t\t// Key found, but nil value?\n    |2:\n    |  andix. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |    stfd f14, NODE:TMP2->val\n    |  bne >7\n    |3:\n    |  ins_next\n    |\n    |4:  // Check for __newindex if previous value is nil.\n    |  lwz TAB:TMP1, TAB:RB->metatable\n    |  cmplwi TAB:TMP1, 0\n    |  beq <2\t\t\t\t// No metatable: done.\n    |  lbz TMP0, TAB:TMP1->nomm\n    |  andix. TMP0, TMP0, 1<<MM_newindex\n    |  bne <2\t\t\t\t// 'no __newindex' flag set: done.\n    |  b ->vmeta_tsets\n    |\n    |5:  // Follow hash chain.\n    |  cmplwi NODE:TMP1, 0\n    |   mr NODE:TMP2, NODE:TMP1\n    |  bne <1\n    |  // End of hash chain: key not found, add a new one.\n    |\n    |  // But check for __newindex first.\n    |  lwz TAB:TMP1, TAB:RB->metatable\n    |   la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n    |   stw PC, SAVE_PC\n    |   mr CARG1, L\n    |  cmplwi TAB:TMP1, 0\n    |   stp BASE, L->base\n    |  beq >6\t\t\t\t// No metatable: continue.\n    |  lbz TMP0, TAB:TMP1->nomm\n    |  andix. TMP0, TMP0, 1<<MM_newindex\n    |  beq ->vmeta_tsets\t\t// 'no __newindex' flag NOT set: check.\n    |6:\n    |  li TMP0, LJ_TSTR\n    |   stw STR:RC, 4(CARG3)\n    |   mr CARG2, TAB:RB\n    |  stw TMP0, 0(CARG3)\n    |  bl extern lj_tab_newkey\t\t// (lua_State *L, GCtab *t, TValue *k)\n    |  // Returns TValue *.\n    |  lp BASE, L->base\n    |  stfd f14, 0(CRET1)\n    |  b <3\t\t\t\t// No 2nd write barrier needed.\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0\n    |  b <3\n    break;\n  case BC_TSETB:\n    |  // RA = src*8, RB = table*8, RC = index*8\n    |  lwzux CARG1, RB, BASE\n    |   srwi TMP0, RC, 3\n    |   lwz TAB:RB, 4(RB)\n    |  checktab CARG1; bne ->vmeta_tsetb\n    |  lwz TMP1, TAB:RB->asize\n    |   lwz TMP2, TAB:RB->array\n    |    lbz TMP3, TAB:RB->marked\n    |  cmplw TMP0, TMP1\n    |   lfdx f14, BASE, RA\n    |  bge ->vmeta_tsetb\n    |  lwzx TMP1, TMP2, RC\n    |  checknil TMP1; beq >5\n    |1:\n    |  andix. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |   stfdx f14, TMP2, RC\n    |  bne >7\n    |2:\n    |  ins_next\n    |\n    |5:  // Check for __newindex if previous value is nil.\n    |  lwz TAB:TMP1, TAB:RB->metatable\n    |  cmplwi TAB:TMP1, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP1, TAB:TMP1->nomm\n    |  andix. TMP1, TMP1, 1<<MM_newindex\n    |  bne <1\t\t\t\t// 'no __newindex' flag set: done.\n    |  b ->vmeta_tsetb\t\t\t// Caveat: preserve TMP0!\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0\n    |  b <2\n    break;\n\n  case BC_TSETM:\n    |  // RA = base*8 (table at base-1), RD = num_const*8 (start index)\n    |  add RA, BASE, RA\n    |1:\n    |   add TMP3, KBASE, RD\n    |  lwz TAB:CARG2, -4(RA)\t\t// Guaranteed to be a table.\n    |    addic. TMP0, MULTRES, -8\n    |   lwz TMP3, 4(TMP3)\t\t// Integer constant is in lo-word.\n    |    srwi CARG3, TMP0, 3\n    |    beq >4\t\t\t\t// Nothing to copy?\n    |  add CARG3, CARG3, TMP3\n    |  lwz TMP2, TAB:CARG2->asize\n    |   slwi TMP1, TMP3, 3\n    |    lbz TMP3, TAB:CARG2->marked\n    |  cmplw CARG3, TMP2\n    |   add TMP2, RA, TMP0\n    |   lwz TMP0, TAB:CARG2->array\n    |  bgt >5\n    |   add TMP1, TMP1, TMP0\n    |    andix. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |3:  // Copy result slots to table.\n    |   lfd f0, 0(RA)\n    |  addi RA, RA, 8\n    |  cmpw cr1, RA, TMP2\n    |   stfd f0, 0(TMP1)\n    |    addi TMP1, TMP1, 8\n    |  blt cr1, <3\n    |  bne >7\n    |4:\n    |  ins_next\n    |\n    |5:  // Need to resize array part.\n    |   stp BASE, L->base\n    |  mr CARG1, L\n    |   stw PC, SAVE_PC\n    |  mr SAVE0, RD\n    |  bl extern lj_tab_reasize\t\t// (lua_State *L, GCtab *t, int nasize)\n    |  // Must not reallocate the stack.\n    |  mr RD, SAVE0\n    |  b <1\n    |\n    |7:  // Possible table write barrier for any value. Skip valiswhite check.\n    |  barrierback TAB:CARG2, TMP3, TMP0\n    |  b <4\n    break;\n\n  /* -- Calls and vararg handling ----------------------------------------- */\n\n  case BC_CALLM:\n    |  // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8\n    |  add NARGS8:RC, NARGS8:RC, MULTRES\n    |  // Fall through. Assumes BC_CALL follows.\n    break;\n  case BC_CALL:\n    |  // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8\n    |  mr TMP2, BASE\n    |  lwzux TMP0, BASE, RA\n    |   lwz LFUNC:RB, 4(BASE)\n    |    subi NARGS8:RC, NARGS8:RC, 8\n    |   addi BASE, BASE, 8\n    |  checkfunc TMP0; bne ->vmeta_call\n    |  ins_call\n    break;\n\n  case BC_CALLMT:\n    |  // RA = base*8, (RB = 0,) RC = extra_nargs*8\n    |  add NARGS8:RC, NARGS8:RC, MULTRES\n    |  // Fall through. Assumes BC_CALLT follows.\n    break;\n  case BC_CALLT:\n    |  // RA = base*8, (RB = 0,) RC = (nargs+1)*8\n    |  lwzux TMP0, RA, BASE\n    |   lwz LFUNC:RB, 4(RA)\n    |    subi NARGS8:RC, NARGS8:RC, 8\n    |    lwz TMP1, FRAME_PC(BASE)\n    |  checkfunc TMP0\n    |   addi RA, RA, 8\n    |  bne ->vmeta_callt\n    |->BC_CALLT_Z:\n    |  andix. TMP0, TMP1, FRAME_TYPE\t// Caveat: preserve cr0 until the crand.\n    |   lbz TMP3, LFUNC:RB->ffid\n    |    xori TMP2, TMP1, FRAME_VARG\n    |    cmplwi cr1, NARGS8:RC, 0\n    |  bne >7\n    |1:\n    |  stw LFUNC:RB, FRAME_FUNC(BASE)\t// Copy function down, but keep PC.\n    |  li TMP2, 0\n    |   cmplwi cr7, TMP3, 1\t\t// (> FF_C) Calling a fast function?\n    |    beq cr1, >3\n    |2:\n    |  addi TMP3, TMP2, 8\n    |   lfdx f0, RA, TMP2\n    |  cmplw cr1, TMP3, NARGS8:RC\n    |   stfdx f0, BASE, TMP2\n    |  mr TMP2, TMP3\n    |  bne cr1, <2\n    |3:\n    |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+gt\n    |  beq >5\n    |4:\n    |  ins_callt\n    |\n    |5:  // Tailcall to a fast function with a Lua frame below.\n    |  lwz INS, -4(TMP1)\n    |  decode_RA8 RA, INS\n    |  sub TMP1, BASE, RA\n    |  lwz LFUNC:TMP1, FRAME_FUNC-8(TMP1)\n    |  lwz TMP1, LFUNC:TMP1->pc\n    |  lwz KBASE, PC2PROTO(k)(TMP1)\t// Need to prepare KBASE.\n    |  b <4\n    |\n    |7:  // Tailcall from a vararg function.\n    |  andix. TMP0, TMP2, FRAME_TYPEP\n    |  bne <1\t\t\t\t// Vararg frame below?\n    |  sub BASE, BASE, TMP2\t\t// Relocate BASE down.\n    |  lwz TMP1, FRAME_PC(BASE)\n    |  andix. TMP0, TMP1, FRAME_TYPE\n    |  b <1\n    break;\n\n  case BC_ITERC:\n    |  // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 ((2+1)*8))\n    |  mr TMP2, BASE\n    |  add BASE, BASE, RA\n    |  lwz TMP1, -24(BASE)\n    |   lwz LFUNC:RB, -20(BASE)\n    |    lfd f1, -8(BASE)\n    |    lfd f0, -16(BASE)\n    |  stw TMP1, 0(BASE)\t\t// Copy callable.\n    |   stw LFUNC:RB, 4(BASE)\n    |  checkfunc TMP1\n    |    stfd f1, 16(BASE)\t\t// Copy control var.\n    |     li NARGS8:RC, 16\t\t// Iterators get 2 arguments.\n    |    stfdu f0, 8(BASE)\t\t// Copy state.\n    |  bne ->vmeta_call\n    |  ins_call\n    break;\n\n  case BC_ITERN:\n    |  // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8)\n    |.if JIT\n    |  // NYI: add hotloop, record BC_ITERN.\n    |.endif\n    |  add RA, BASE, RA\n    |  lwz TAB:RB, -12(RA)\n    |  lwz RC, -4(RA)\t\t\t// Get index from control var.\n    |  lwz TMP0, TAB:RB->asize\n    |  lwz TMP1, TAB:RB->array\n    |   addi PC, PC, 4\n    |1:  // Traverse array part.\n    |  cmplw RC, TMP0\n    |   slwi TMP3, RC, 3\n    |  bge >5\t\t\t\t// Index points after array part?\n    |  lwzx TMP2, TMP1, TMP3\n    |   lfdx f0, TMP1, TMP3\n    |  checknil TMP2\n    |     lwz INS, -4(PC)\n    |  beq >4\n    |.if DUALNUM\n    |   stw RC, 4(RA)\n    |   stw TISNUM, 0(RA)\n    |.else\n    |   tonum_u f1, RC\n    |.endif\n    |    addi RC, RC, 1\n    |     addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n    |  stfd f0, 8(RA)\n    |     decode_RD4 TMP1, INS\n    |    stw RC, -4(RA)\t\t\t// Update control var.\n    |     add PC, TMP1, TMP3\n    |.if not DUALNUM\n    |   stfd f1, 0(RA)\n    |.endif\n    |3:\n    |  ins_next\n    |\n    |4:  // Skip holes in array part.\n    |  addi RC, RC, 1\n    |  b <1\n    |\n    |5:  // Traverse hash part.\n    |  lwz TMP1, TAB:RB->hmask\n    |  sub RC, RC, TMP0\n    |   lwz TMP2, TAB:RB->node\n    |6:\n    |  cmplw RC, TMP1\t\t\t// End of iteration? Branch to ITERL+1.\n    |   slwi TMP3, RC, 5\n    |  bgty <3\n    |   slwi RB, RC, 3\n    |   sub TMP3, TMP3, RB\n    |  lwzx RB, TMP2, TMP3\n    |  lfdx f0, TMP2, TMP3\n    |   add NODE:TMP3, TMP2, TMP3\n    |  checknil RB\n    |     lwz INS, -4(PC)\n    |  beq >7\n    |   lfd f1, NODE:TMP3->key\n    |     addis TMP2, PC, -(BCBIAS_J*4 >> 16)\n    |  stfd f0, 8(RA)\n    |    add RC, RC, TMP0\n    |     decode_RD4 TMP1, INS\n    |   stfd f1, 0(RA)\n    |    addi RC, RC, 1\n    |     add PC, TMP1, TMP2\n    |    stw RC, -4(RA)\t\t\t// Update control var.\n    |  b <3\n    |\n    |7:  // Skip holes in hash part.\n    |  addi RC, RC, 1\n    |  b <6\n    break;\n\n  case BC_ISNEXT:\n    |  // RA = base*8, RD = target (points to ITERN)\n    |  add RA, BASE, RA\n    |  lwz TMP0, -24(RA)\n    |  lwz CFUNC:TMP1, -20(RA)\n    |   lwz TMP2, -16(RA)\n    |    lwz TMP3, -8(RA)\n    |   cmpwi cr0, TMP2, LJ_TTAB\n    |  cmpwi cr1, TMP0, LJ_TFUNC\n    |    cmpwi cr6, TMP3, LJ_TNIL\n    |  bne cr1, >5\n    |  lbz TMP1, CFUNC:TMP1->ffid\n    |   crand 4*cr0+eq, 4*cr0+eq, 4*cr6+eq\n    |  cmpwi cr7, TMP1, FF_next_N\n    |    srwi TMP0, RD, 1\n    |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq\n    |    add TMP3, PC, TMP0\n    |  bne cr0, >5\n    |  lus TMP1, 0xfffe\n    |  ori TMP1, TMP1, 0x7fff\n    |  stw ZERO, -4(RA)\t\t\t// Initialize control var.\n    |  stw TMP1, -8(RA)\n    |    addis PC, TMP3, -(BCBIAS_J*4 >> 16)\n    |1:\n    |  ins_next\n    |5:  // Despecialize bytecode if any of the checks fail.\n    |  li TMP0, BC_JMP\n    |   li TMP1, BC_ITERC\n    |  stb TMP0, -1(PC)\n    |    addis PC, TMP3, -(BCBIAS_J*4 >> 16)\n    |   stb TMP1, 3(PC)\n    |  b <1\n    break;\n\n  case BC_VARG:\n    |  // RA = base*8, RB = (nresults+1)*8, RC = numparams*8\n    |  lwz TMP0, FRAME_PC(BASE)\n    |  add RC, BASE, RC\n    |   add RA, BASE, RA\n    |  addi RC, RC, FRAME_VARG\n    |   add TMP2, RA, RB\n    |  subi TMP3, BASE, 8\t\t// TMP3 = vtop\n    |  sub RC, RC, TMP0\t\t\t// RC = vbase\n    |  // Note: RC may now be even _above_ BASE if nargs was < numparams.\n    |  cmplwi cr1, RB, 0\n    |.if PPE\n    |   sub TMP1, TMP3, RC\n    |   cmpwi TMP1, 0\n    |.else\n    |   sub. TMP1, TMP3, RC\n    |.endif\n    |  beq cr1, >5\t\t\t// Copy all varargs?\n    |   subi TMP2, TMP2, 16\n    |   ble >2\t\t\t\t// No vararg slots?\n    |1:  // Copy vararg slots to destination slots.\n    |  lfd f0, 0(RC)\n    |   addi RC, RC, 8\n    |  stfd f0, 0(RA)\n    |  cmplw RA, TMP2\n    |   cmplw cr1, RC, TMP3\n    |  bge >3\t\t\t\t// All destination slots filled?\n    |    addi RA, RA, 8\n    |   blt cr1, <1\t\t\t// More vararg slots?\n    |2:  // Fill up remainder with nil.\n    |  stw TISNIL, 0(RA)\n    |  cmplw RA, TMP2\n    |   addi RA, RA, 8\n    |  blt <2\n    |3:\n    |  ins_next\n    |\n    |5:  // Copy all varargs.\n    |  lwz TMP0, L->maxstack\n    |   li MULTRES, 8\t\t\t// MULTRES = (0+1)*8\n    |  bley <3\t\t\t\t// No vararg slots?\n    |  add TMP2, RA, TMP1\n    |  cmplw TMP2, TMP0\n    |   addi MULTRES, TMP1, 8\n    |  bgt >7\n    |6:\n    |  lfd f0, 0(RC)\n    |   addi RC, RC, 8\n    |  stfd f0, 0(RA)\n    |  cmplw RC, TMP3\n    |   addi RA, RA, 8\n    |  blt <6\t\t\t\t// More vararg slots?\n    |  b <3\n    |\n    |7:  // Grow stack for varargs.\n    |  mr CARG1, L\n    |   stp RA, L->top\n    |  sub SAVE0, RC, BASE\t\t// Need delta, because BASE may change.\n    |   stp BASE, L->base\n    |  sub RA, RA, BASE\n    |   stw PC, SAVE_PC\n    |  srwi CARG2, TMP1, 3\n    |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n    |  lp BASE, L->base\n    |  add RA, BASE, RA\n    |  add RC, BASE, SAVE0\n    |  subi TMP3, BASE, 8\n    |  b <6\n    break;\n\n  /* -- Returns ----------------------------------------------------------- */\n\n  case BC_RETM:\n    |  // RA = results*8, RD = extra_nresults*8\n    |  add RD, RD, MULTRES\t\t// MULTRES >= 8, so RD >= 8.\n    |  // Fall through. Assumes BC_RET follows.\n    break;\n\n  case BC_RET:\n    |  // RA = results*8, RD = (nresults+1)*8\n    |  lwz PC, FRAME_PC(BASE)\n    |   add RA, BASE, RA\n    |    mr MULTRES, RD\n    |1:\n    |  andix. TMP0, PC, FRAME_TYPE\n    |   xori TMP1, PC, FRAME_VARG\n    |  bne ->BC_RETV_Z\n    |\n    |->BC_RET_Z:\n    |  // BASE = base, RA = resultptr, RD = (nresults+1)*8, PC = return\n    |   lwz INS, -4(PC)\n    |  cmpwi RD, 8\n    |   subi TMP2, BASE, 8\n    |   subi RC, RD, 8\n    |   decode_RB8 RB, INS\n    |  beq >3\n    |   li TMP1, 0\n    |2:\n    |  addi TMP3, TMP1, 8\n    |   lfdx f0, RA, TMP1\n    |  cmpw TMP3, RC\n    |   stfdx f0, TMP2, TMP1\n    |  beq >3\n    |  addi TMP1, TMP3, 8\n    |   lfdx f1, RA, TMP3\n    |  cmpw TMP1, RC\n    |   stfdx f1, TMP2, TMP3\n    |  bne <2\n    |3:\n    |5:\n    |  cmplw RB, RD\n    |   decode_RA8 RA, INS\n    |  bgt >6\n    |   sub BASE, TMP2, RA\n    |  lwz LFUNC:TMP1, FRAME_FUNC(BASE)\n    |  ins_next1\n    |  lwz TMP1, LFUNC:TMP1->pc\n    |  lwz KBASE, PC2PROTO(k)(TMP1)\n    |  ins_next2\n    |\n    |6:  // Fill up results with nil.\n    |  subi TMP1, RD, 8\n    |   addi RD, RD, 8\n    |  stwx TISNIL, TMP2, TMP1\n    |  b <5\n    |\n    |->BC_RETV_Z:  // Non-standard return case.\n    |  andix. TMP2, TMP1, FRAME_TYPEP\n    |  bne ->vm_return\n    |  // Return from vararg function: relocate BASE down.\n    |  sub BASE, BASE, TMP1\n    |  lwz PC, FRAME_PC(BASE)\n    |  b <1\n    break;\n\n  case BC_RET0: case BC_RET1:\n    |  // RA = results*8, RD = (nresults+1)*8\n    |  lwz PC, FRAME_PC(BASE)\n    |   add RA, BASE, RA\n    |    mr MULTRES, RD\n    |  andix. TMP0, PC, FRAME_TYPE\n    |   xori TMP1, PC, FRAME_VARG\n    |  bney ->BC_RETV_Z\n    |\n    |  lwz INS, -4(PC)\n    |   subi TMP2, BASE, 8\n    |  decode_RB8 RB, INS\n    if (op == BC_RET1) {\n      |  lfd f0, 0(RA)\n      |  stfd f0, 0(TMP2)\n    }\n    |5:\n    |  cmplw RB, RD\n    |   decode_RA8 RA, INS\n    |  bgt >6\n    |   sub BASE, TMP2, RA\n    |  lwz LFUNC:TMP1, FRAME_FUNC(BASE)\n    |  ins_next1\n    |  lwz TMP1, LFUNC:TMP1->pc\n    |  lwz KBASE, PC2PROTO(k)(TMP1)\n    |  ins_next2\n    |\n    |6:  // Fill up results with nil.\n    |  subi TMP1, RD, 8\n    |   addi RD, RD, 8\n    |  stwx TISNIL, TMP2, TMP1\n    |  b <5\n    break;\n\n  /* -- Loops and branches ------------------------------------------------ */\n\n  case BC_FORL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IFORL follows.\n    break;\n\n  case BC_JFORI:\n  case BC_JFORL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_FORI:\n  case BC_IFORL:\n    |  // RA = base*8, RD = target (after end of loop or start of loop)\n    vk = (op == BC_IFORL || op == BC_JFORL);\n    |.if DUALNUM\n    |  // Integer loop.\n    |  lwzux TMP1, RA, BASE\n    |   lwz CARG1, FORL_IDX*8+4(RA)\n    |  cmplw cr0, TMP1, TISNUM\n    if (vk) {\n      |   lwz CARG3, FORL_STEP*8+4(RA)\n      |  bne >9\n      |.if GPR64\n      |  // Need to check overflow for (a<<32) + (b<<32).\n      |  rldicr TMP0, CARG1, 32, 31\n      |  rldicr TMP2, CARG3, 32, 31\n      |  add CARG1, CARG1, CARG3\n      |  addo. TMP0, TMP0, TMP2\n      |.else\n      |  addo. CARG1, CARG1, CARG3\n      |.endif\n      |    cmpwi cr6, CARG3, 0\n      |   lwz CARG2, FORL_STOP*8+4(RA)\n      |  bso >6\n      |4:\n      |  stw CARG1, FORL_IDX*8+4(RA)\n    } else {\n      |  lwz TMP3, FORL_STEP*8(RA)\n      |   lwz CARG3, FORL_STEP*8+4(RA)\n      |  lwz TMP2, FORL_STOP*8(RA)\n      |   lwz CARG2, FORL_STOP*8+4(RA)\n      |  cmplw cr7, TMP3, TISNUM\n      |  cmplw cr1, TMP2, TISNUM\n      |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq\n      |  crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq\n      |    cmpwi cr6, CARG3, 0\n      |  bne >9\n    }\n    |    blt cr6, >5\n    |  cmpw CARG1, CARG2\n    |1:\n    |   stw TISNUM, FORL_EXT*8(RA)\n    if (op != BC_JFORL) {\n      |  srwi RD, RD, 1\n    }\n    |   stw CARG1, FORL_EXT*8+4(RA)\n    if (op != BC_JFORL) {\n      |  add RD, PC, RD\n    }\n    if (op == BC_FORI) {\n      |  bgt >3  // See FP loop below.\n    } else if (op == BC_JFORI) {\n      |  addis PC, RD, -(BCBIAS_J*4 >> 16)\n      |  bley >7\n    } else if (op == BC_IFORL) {\n      |  bgt >2\n      |  addis PC, RD, -(BCBIAS_J*4 >> 16)\n    } else {\n      |  bley =>BC_JLOOP\n    }\n    |2:\n    |  ins_next\n    |5:  // Invert check for negative step.\n    |  cmpw CARG2, CARG1\n    |  b <1\n    if (vk) {\n      |6:  // Potential overflow.\n      |  mcrxr cr0; bley <4\t\t// Ignore unrelated overflow.\n      |  b <2\n    }\n    |.endif\n    if (vk) {\n      |.if DUALNUM\n      |9:  // FP loop.\n      |  lfd f1, FORL_IDX*8(RA)\n      |.else\n      |  lfdux f1, RA, BASE\n      |.endif\n      |  lfd f3, FORL_STEP*8(RA)\n      |  lfd f2, FORL_STOP*8(RA)\n      |   lwz TMP3, FORL_STEP*8(RA)\n      |  fadd f1, f1, f3\n      |  stfd f1, FORL_IDX*8(RA)\n    } else {\n      |.if DUALNUM\n      |9:  // FP loop.\n      |.else\n      |  lwzux TMP1, RA, BASE\n      |  lwz TMP3, FORL_STEP*8(RA)\n      |  lwz TMP2, FORL_STOP*8(RA)\n      |  cmplw cr0, TMP1, TISNUM\n      |  cmplw cr7, TMP3, TISNUM\n      |  cmplw cr1, TMP2, TISNUM\n      |.endif\n      |   lfd f1, FORL_IDX*8(RA)\n      |  crand 4*cr0+lt, 4*cr0+lt, 4*cr7+lt\n      |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n      |   lfd f2, FORL_STOP*8(RA)\n      |  bge ->vmeta_for\n    }\n    |  cmpwi cr6, TMP3, 0\n    if (op != BC_JFORL) {\n      |  srwi RD, RD, 1\n    }\n    |   stfd f1, FORL_EXT*8(RA)\n    if (op != BC_JFORL) {\n      |  add RD, PC, RD\n    }\n    |  fcmpu cr0, f1, f2\n    if (op == BC_JFORI) {\n      |  addis PC, RD, -(BCBIAS_J*4 >> 16)\n    }\n    |  blt cr6, >5\n    if (op == BC_FORI) {\n      |  bgt >3\n    } else if (op == BC_IFORL) {\n      |.if DUALNUM\n      |  bgty <2\n      |.else\n      |  bgt >2\n      |.endif\n      |1:\n      |  addis PC, RD, -(BCBIAS_J*4 >> 16)\n    } else if (op == BC_JFORI) {\n      |  bley >7\n    } else {\n      |  bley =>BC_JLOOP\n    }\n    |.if DUALNUM\n    |  b <2\n    |.else\n    |2:\n    |  ins_next\n    |.endif\n    |5:  // Negative step.\n    if (op == BC_FORI) {\n      |  bge <2\n      |3:  // Used by integer loop, too.\n      |  addis PC, RD, -(BCBIAS_J*4 >> 16)\n    } else if (op == BC_IFORL) {\n      |  bgey <1\n    } else if (op == BC_JFORI) {\n      |  bgey >7\n    } else {\n      |  bgey =>BC_JLOOP\n    }\n    |  b <2\n    if (op == BC_JFORI) {\n      |7:\n      |  lwz INS, -4(PC)\n      |  decode_RD8 RD, INS\n      |  b =>BC_JLOOP\n    }\n    break;\n\n  case BC_ITERL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IITERL follows.\n    break;\n\n  case BC_JITERL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IITERL:\n    |  // RA = base*8, RD = target\n    |  lwzux TMP1, RA, BASE\n    |   lwz TMP2, 4(RA)\n    |  checknil TMP1; beq >1\t\t// Stop if iterator returned nil.\n    if (op == BC_JITERL) {\n      |  stw TMP1, -8(RA)\n      |   stw TMP2, -4(RA)\n      |  b =>BC_JLOOP\n    } else {\n      |  branch_RD\t\t\t// Otherwise save control var + branch.\n      |  stw TMP1, -8(RA)\n      |   stw TMP2, -4(RA)\n    }\n    |1:\n    |  ins_next\n    break;\n\n  case BC_LOOP:\n    |  // RA = base*8, RD = target (loop extent)\n    |  // Note: RA/RD is only used by trace recorder to determine scope/extent\n    |  // This opcode does NOT jump, it's only purpose is to detect a hot loop.\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_ILOOP follows.\n    break;\n\n  case BC_ILOOP:\n    |  // RA = base*8, RD = target (loop extent)\n    |  ins_next\n    break;\n\n  case BC_JLOOP:\n    |.if JIT\n    |  // RA = base*8 (ignored), RD = traceno*8\n    |  lwz TMP1, DISPATCH_J(trace)(DISPATCH)\n    |  srwi RD, RD, 1\n    |  // Traces on PPC don't store the trace number, so use 0.\n    |   stw ZERO, DISPATCH_GL(vmstate)(DISPATCH)\n    |  lwzx TRACE:TMP2, TMP1, RD\n    |  mcrxr cr0\t\t\t// Clear SO flag.\n    |  lp TMP2, TRACE:TMP2->mcode\n    |   stw BASE, DISPATCH_GL(jit_base)(DISPATCH)\n    |  mtctr TMP2\n    |   stw L, DISPATCH_GL(jit_L)(DISPATCH)\n    |   addi JGL, DISPATCH, GG_DISP2G+32768\n    |  bctr\n    |.endif\n    break;\n\n  case BC_JMP:\n    |  // RA = base*8 (only used by trace recorder), RD = target\n    |  branch_RD\n    |  ins_next\n    break;\n\n  /* -- Function headers -------------------------------------------------- */\n\n  case BC_FUNCF:\n    |.if JIT\n    |  hotcall\n    |.endif\n  case BC_FUNCV:  /* NYI: compiled vararg functions. */\n    |  // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow.\n    break;\n\n  case BC_JFUNCF:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IFUNCF:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8\n    |  lwz TMP2, L->maxstack\n    |   lbz TMP1, -4+PC2PROTO(numparams)(PC)\n    |    lwz KBASE, -4+PC2PROTO(k)(PC)\n    |  cmplw RA, TMP2\n    |   slwi TMP1, TMP1, 3\n    |  bgt ->vm_growstack_l\n    if (op != BC_JFUNCF) {\n      |  ins_next1\n    }\n    |2:\n    |  cmplw NARGS8:RC, TMP1\t\t// Check for missing parameters.\n    |  blt >3\n    if (op == BC_JFUNCF) {\n      |  decode_RD8 RD, INS\n      |  b =>BC_JLOOP\n    } else {\n      |  ins_next2\n    }\n    |\n    |3:  // Clear missing parameters.\n    |  stwx TISNIL, BASE, NARGS8:RC\n    |  addi NARGS8:RC, NARGS8:RC, 8\n    |  b <2\n    break;\n\n  case BC_JFUNCV:\n#if !LJ_HASJIT\n    break;\n#endif\n    |  NYI  // NYI: compiled vararg functions\n    break;  /* NYI: compiled vararg functions. */\n\n  case BC_IFUNCV:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8\n    |  lwz TMP2, L->maxstack\n    |   add TMP1, BASE, RC\n    |  add TMP0, RA, RC\n    |   stw LFUNC:RB, 4(TMP1)\t\t// Store copy of LFUNC.\n    |   addi TMP3, RC, 8+FRAME_VARG\n    |    lwz KBASE, -4+PC2PROTO(k)(PC)\n    |  cmplw TMP0, TMP2\n    |   stw TMP3, 0(TMP1)\t\t// Store delta + FRAME_VARG.\n    |  bge ->vm_growstack_l\n    |  lbz TMP2, -4+PC2PROTO(numparams)(PC)\n    |   mr RA, BASE\n    |   mr RC, TMP1\n    |  ins_next1\n    |  cmpwi TMP2, 0\n    |   addi BASE, TMP1, 8\n    |  beq >3\n    |1:\n    |  cmplw RA, RC\t\t\t// Less args than parameters?\n    |   lwz TMP0, 0(RA)\n    |   lwz TMP3, 4(RA)\n    |  bge >4\n    |    stw TISNIL, 0(RA)\t\t// Clear old fixarg slot (help the GC).\n    |    addi RA, RA, 8\n    |2:\n    |  addic. TMP2, TMP2, -1\n    |   stw TMP0, 8(TMP1)\n    |   stw TMP3, 12(TMP1)\n    |    addi TMP1, TMP1, 8\n    |  bne <1\n    |3:\n    |  ins_next2\n    |\n    |4:  // Clear missing parameters.\n    |  li TMP0, LJ_TNIL\n    |  b <2\n    break;\n\n  case BC_FUNCC:\n  case BC_FUNCCW:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8\n    if (op == BC_FUNCC) {\n      |  lp RD, CFUNC:RB->f\n    } else {\n      |  lp RD, DISPATCH_GL(wrapf)(DISPATCH)\n    }\n    |   add TMP1, RA, NARGS8:RC\n    |   lwz TMP2, L->maxstack\n    |  .toc lp TMP3, 0(RD)\n    |    add RC, BASE, NARGS8:RC\n    |   stp BASE, L->base\n    |   cmplw TMP1, TMP2\n    |    stp RC, L->top\n    |     li_vmstate C\n    |.if TOC\n    |  mtctr TMP3\n    |.else\n    |  mtctr RD\n    |.endif\n    if (op == BC_FUNCCW) {\n      |  lp CARG2, CFUNC:RB->f\n    }\n    |  mr CARG1, L\n    |   bgt ->vm_growstack_c\t\t// Need to grow stack.\n    |  .toc lp TOCREG, TOC_OFS(RD)\n    |  .tocenv lp ENVREG, ENV_OFS(RD)\n    |     st_vmstate\n    |  bctrl\t\t\t\t// (lua_State *L [, lua_CFunction f])\n    |  // Returns nresults.\n    |  lp BASE, L->base\n    |  .toc ld TOCREG, SAVE_TOC\n    |   slwi RD, CRET1, 3\n    |  lp TMP1, L->top\n    |    li_vmstate INTERP\n    |  lwz PC, FRAME_PC(BASE)\t\t// Fetch PC of caller.\n    |   sub RA, TMP1, RD\t\t// RA = L->top - nresults*8\n    |    st_vmstate\n    |  b ->vm_returnc\n    break;\n\n  /* ---------------------------------------------------------------------- */\n\n  default:\n    fprintf(stderr, \"Error: undefined opcode BC_%s\\n\", bc_names[op]);\n    exit(2);\n    break;\n  }\n}\n\nstatic int build_backend(BuildCtx *ctx)\n{\n  int op;\n\n  dasm_growpc(Dst, BC__MAX);\n\n  build_subroutines(ctx);\n\n  |.code_op\n  for (op = 0; op < BC__MAX; op++)\n    build_ins(ctx, (BCOp)op, op);\n\n  return BC__MAX;\n}\n\n/* Emit pseudo frame-info for all assembler functions. */\nstatic void emit_asm_debug(BuildCtx *ctx)\n{\n  int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code);\n  int i;\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n    fprintf(ctx->fp, \"\\t.section .debug_frame,\\\"\\\",@progbits\\n\");\n    fprintf(ctx->fp,\n\t\".Lframe0:\\n\"\n\t\"\\t.long .LECIE0-.LSCIE0\\n\"\n\t\".LSCIE0:\\n\"\n\t\"\\t.long 0xffffffff\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 65\\n\"\n\t\"\\t.byte 0xc\\n\\t.uleb128 1\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE0:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE0:\\n\"\n\t\"\\t.long .LEFDE0-.LASFDE0\\n\"\n\t\".LASFDE0:\\n\"\n\t\"\\t.long .Lframe0\\n\"\n\t\"\\t.long .Lbegin\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 0x11\\n\\t.uleb128 65\\n\\t.sleb128 -1\\n\"\n\t\"\\t.byte 0x5\\n\\t.uleb128 70\\n\\t.uleb128 55\\n\",\n\tfcofs, CFRAME_SIZE);\n    for (i = 14; i <= 31; i++)\n      fprintf(ctx->fp,\n\t\"\\t.byte %d\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte %d\\n\\t.uleb128 %d\\n\",\n\t0x80+i, 37+(31-i), 0x80+32+i, 2+2*(31-i));\n    fprintf(ctx->fp,\n\t\"\\t.align 2\\n\"\n\t\".LEFDE0:\\n\\n\");\n#if LJ_HASFFI\n    fprintf(ctx->fp,\n\t\".LSFDE1:\\n\"\n\t\"\\t.long .LEFDE1-.LASFDE1\\n\"\n\t\".LASFDE1:\\n\"\n\t\"\\t.long .Lframe0\\n\"\n#if LJ_TARGET_PS3\n\t\"\\t.long .lj_vm_ffi_call\\n\"\n#else\n\t\"\\t.long lj_vm_ffi_call\\n\"\n#endif\n\t\"\\t.long %d\\n\"\n\t\"\\t.byte 0x11\\n\\t.uleb128 65\\n\\t.sleb128 -1\\n\"\n\t\"\\t.byte 0x8e\\n\\t.uleb128 2\\n\"\n\t\"\\t.byte 0xd\\n\\t.uleb128 0xe\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LEFDE1:\\n\\n\", (int)ctx->codesz - fcofs);\n#endif\n#if !LJ_NO_UNWIND\n    fprintf(ctx->fp, \"\\t.section .eh_frame,\\\"a\\\",@progbits\\n\");\n    fprintf(ctx->fp,\n\t\".Lframe1:\\n\"\n\t\"\\t.long .LECIE1-.LSCIE1\\n\"\n\t\".LSCIE1:\\n\"\n\t\"\\t.long 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"zPR\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 65\\n\"\n\t\"\\t.uleb128 6\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.long lj_err_unwind_dwarf-.\\n\"\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.byte 0xc\\n\\t.uleb128 1\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE1:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE2:\\n\"\n\t\"\\t.long .LEFDE2-.LASFDE2\\n\"\n\t\".LASFDE2:\\n\"\n\t\"\\t.long .LASFDE2-.Lframe1\\n\"\n\t\"\\t.long .Lbegin-.\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.uleb128 0\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 0x11\\n\\t.uleb128 65\\n\\t.sleb128 -1\\n\"\n\t\"\\t.byte 0x5\\n\\t.uleb128 70\\n\\t.uleb128 55\\n\",\n\tfcofs, CFRAME_SIZE);\n    for (i = 14; i <= 31; i++)\n      fprintf(ctx->fp,\n\t\"\\t.byte %d\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte %d\\n\\t.uleb128 %d\\n\",\n\t0x80+i, 37+(31-i), 0x80+32+i, 2+2*(31-i));\n    fprintf(ctx->fp,\n\t\"\\t.align 2\\n\"\n\t\".LEFDE2:\\n\\n\");\n#if LJ_HASFFI\n    fprintf(ctx->fp,\n\t\".Lframe2:\\n\"\n\t\"\\t.long .LECIE2-.LSCIE2\\n\"\n\t\".LSCIE2:\\n\"\n\t\"\\t.long 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"zR\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 65\\n\"\n\t\"\\t.uleb128 1\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.byte 0xc\\n\\t.uleb128 1\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE2:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE3:\\n\"\n\t\"\\t.long .LEFDE3-.LASFDE3\\n\"\n\t\".LASFDE3:\\n\"\n\t\"\\t.long .LASFDE3-.Lframe2\\n\"\n\t\"\\t.long lj_vm_ffi_call-.\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.uleb128 0\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0x11\\n\\t.uleb128 65\\n\\t.sleb128 -1\\n\"\n\t\"\\t.byte 0x8e\\n\\t.uleb128 2\\n\"\n\t\"\\t.byte 0xd\\n\\t.uleb128 0xe\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LEFDE3:\\n\\n\", (int)ctx->codesz - fcofs);\n#endif\n#endif\n    break;\n  default:\n    break;\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/vm_ppcspe.dasc",
    "content": "|// Low-level VM code for PowerPC/e500 CPUs.\n|// Bytecode interpreter, fast functions and helper functions.\n|// Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n|\n|.arch ppc\n|.section code_op, code_sub\n|\n|.actionlist build_actionlist\n|.globals GLOB_\n|.globalnames globnames\n|.externnames extnames\n|\n|// Note: The ragged indentation of the instructions is intentional.\n|//       The starting columns indicate data dependencies.\n|\n|//-----------------------------------------------------------------------\n|\n|// Fixed register assignments for the interpreter.\n|// Don't use: r1 = sp, r2 and r13 = reserved and/or small data area ptr\n|\n|// The following must be C callee-save (but BASE is often refetched).\n|.define BASE,\t\tr14\t// Base of current Lua stack frame.\n|.define KBASE,\t\tr15\t// Constants of current Lua function.\n|.define PC,\t\tr16\t// Next PC.\n|.define DISPATCH,\tr17\t// Opcode dispatch table.\n|.define LREG,\t\tr18\t// Register holding lua_State (also in SAVE_L).\n|.define MULTRES,\tr19\t// Size of multi-result: (nresults+1)*8.\n|\n|// Constants for vectorized type-comparisons (hi+low GPR). C callee-save.\n|.define TISNUM,\tr22\n|.define TISSTR,\tr23\n|.define TISTAB,\tr24\n|.define TISFUNC,\tr25\n|.define TISNIL,\tr26\n|.define TOBIT,\t\tr27\n|.define ZERO,\t\tTOBIT\t// Zero in lo word.\n|\n|// The following temporaries are not saved across C calls, except for RA.\n|.define RA,\t\tr20\t// Callee-save.\n|.define RB,\t\tr10\n|.define RC,\t\tr11\n|.define RD,\t\tr12\n|.define INS,\t\tr7\t// Overlaps CARG5.\n|\n|.define TMP0,\t\tr0\n|.define TMP1,\t\tr8\n|.define TMP2,\t\tr9\n|.define TMP3,\t\tr6\t// Overlaps CARG4.\n|\n|// Saved temporaries.\n|.define SAVE0,\t\tr21\n|\n|// Calling conventions.\n|.define CARG1,\t\tr3\n|.define CARG2,\t\tr4\n|.define CARG3,\t\tr5\n|.define CARG4,\t\tr6\t// Overlaps TMP3.\n|.define CARG5,\t\tr7\t// Overlaps INS.\n|\n|.define CRET1,\t\tr3\n|.define CRET2,\t\tr4\n|\n|// Stack layout while in interpreter. Must match with lj_frame.h.\n|.define SAVE_LR,\t188(sp)\n|.define CFRAME_SPACE,\t184\t// Delta for sp.\n|// Back chain for sp:\t184(sp)\t<-- sp entering interpreter\n|.define SAVE_r31,\t176(sp)\t// 64 bit register saves.\n|.define SAVE_r30,\t168(sp)\n|.define SAVE_r29,\t160(sp)\n|.define SAVE_r28,\t152(sp)\n|.define SAVE_r27,\t144(sp)\n|.define SAVE_r26,\t136(sp)\n|.define SAVE_r25,\t128(sp)\n|.define SAVE_r24,\t120(sp)\n|.define SAVE_r23,\t112(sp)\n|.define SAVE_r22,\t104(sp)\n|.define SAVE_r21,\t96(sp)\n|.define SAVE_r20,\t88(sp)\n|.define SAVE_r19,\t80(sp)\n|.define SAVE_r18,\t72(sp)\n|.define SAVE_r17,\t64(sp)\n|.define SAVE_r16,\t56(sp)\n|.define SAVE_r15,\t48(sp)\n|.define SAVE_r14,\t40(sp)\n|.define SAVE_CR,\t36(sp)\n|.define UNUSED1,\t32(sp)\n|.define SAVE_ERRF,\t28(sp)\t// 32 bit C frame info.\n|.define SAVE_NRES,\t24(sp)\n|.define SAVE_CFRAME,\t20(sp)\n|.define SAVE_L,\t16(sp)\n|.define SAVE_PC,\t12(sp)\n|.define SAVE_MULTRES,\t8(sp)\n|// Next frame lr:\t4(sp)\n|// Back chain for sp:\t0(sp)\t<-- sp while in interpreter\n|\n|.macro save_, reg; evstdd reg, SAVE_..reg; .endmacro\n|.macro rest_, reg; evldd reg, SAVE_..reg; .endmacro\n|\n|.macro saveregs\n|  stwu sp, -CFRAME_SPACE(sp)\n|  save_ r14; save_ r15; save_ r16; save_ r17; save_ r18; save_ r19\n|  mflr r0; mfcr r12\n|  save_ r20; save_ r21; save_ r22; save_ r23; save_ r24; save_ r25\n|  stw  r0, SAVE_LR; stw r12, SAVE_CR\n|  save_ r26; save_ r27; save_ r28; save_ r29; save_ r30; save_ r31\n|.endmacro\n|\n|.macro restoreregs\n|  lwz r0, SAVE_LR; lwz r12, SAVE_CR\n|  rest_ r14; rest_ r15; rest_ r16; rest_ r17; rest_ r18; rest_ r19\n|  mtlr r0; mtcrf 0x38, r12\n|  rest_ r20; rest_ r21; rest_ r22; rest_ r23; rest_ r24; rest_ r25\n|  rest_ r26; rest_ r27; rest_ r28; rest_ r29; rest_ r30; rest_ r31\n|  addi sp, sp, CFRAME_SPACE\n|.endmacro\n|\n|// Type definitions. Some of these are only used for documentation.\n|.type L,\t\tlua_State,\tLREG\n|.type GL,\t\tglobal_State\n|.type TVALUE,\t\tTValue\n|.type GCOBJ,\t\tGCobj\n|.type STR,\t\tGCstr\n|.type TAB,\t\tGCtab\n|.type LFUNC,\t\tGCfuncL\n|.type CFUNC,\t\tGCfuncC\n|.type PROTO,\t\tGCproto\n|.type UPVAL,\t\tGCupval\n|.type NODE,\t\tNode\n|.type NARGS8,\t\tint\n|.type TRACE,\t\tGCtrace\n|\n|//-----------------------------------------------------------------------\n|\n|// These basic macros should really be part of DynASM.\n|.macro srwi, rx, ry, n; rlwinm rx, ry, 32-n, n, 31; .endmacro\n|.macro slwi, rx, ry, n; rlwinm rx, ry, n, 0, 31-n; .endmacro\n|.macro rotlwi, rx, ry, n; rlwinm rx, ry, n, 0, 31; .endmacro\n|.macro rotlw, rx, ry, rn; rlwnm rx, ry, rn, 0, 31; .endmacro\n|.macro subi, rx, ry, i; addi rx, ry, -i; .endmacro\n|\n|// Trap for not-yet-implemented parts.\n|.macro NYI; tw 4, sp, sp; .endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Access to frame relative to BASE.\n|.define FRAME_PC,\t-8\n|.define FRAME_FUNC,\t-4\n|\n|// Instruction decode.\n|.macro decode_OP4, dst, ins; rlwinm dst, ins, 2, 22, 29; .endmacro\n|.macro decode_RA8, dst, ins; rlwinm dst, ins, 27, 21, 28; .endmacro\n|.macro decode_RB8, dst, ins; rlwinm dst, ins, 11, 21, 28; .endmacro\n|.macro decode_RC8, dst, ins; rlwinm dst, ins, 19, 21, 28; .endmacro\n|.macro decode_RD8, dst, ins; rlwinm dst, ins, 19, 13, 28; .endmacro\n|\n|.macro decode_OP1, dst, ins; rlwinm dst, ins, 0, 24, 31; .endmacro\n|.macro decode_RD4, dst, ins; rlwinm dst, ins, 18, 14, 29; .endmacro\n|\n|// Instruction fetch.\n|.macro ins_NEXT1\n|  lwz INS, 0(PC)\n|   addi PC, PC, 4\n|.endmacro\n|// Instruction decode+dispatch.\n|.macro ins_NEXT2\n|  decode_OP4 TMP1, INS\n|   decode_RB8 RB, INS\n|   decode_RD8 RD, INS\n|  lwzx TMP0, DISPATCH, TMP1\n|   decode_RA8 RA, INS\n|   decode_RC8 RC, INS\n|  mtctr TMP0\n|  bctr\n|.endmacro\n|.macro ins_NEXT\n|  ins_NEXT1\n|  ins_NEXT2\n|.endmacro\n|\n|// Instruction footer.\n|.if 1\n|  // Replicated dispatch. Less unpredictable branches, but higher I-Cache use.\n|  .define ins_next, ins_NEXT\n|  .define ins_next_, ins_NEXT\n|  .define ins_next1, ins_NEXT1\n|  .define ins_next2, ins_NEXT2\n|.else\n|  // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch.\n|  // Affects only certain kinds of benchmarks (and only with -j off).\n|  .macro ins_next\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next1\n|  .endmacro\n|  .macro ins_next2\n|    b ->ins_next\n|  .endmacro\n|  .macro ins_next_\n|  ->ins_next:\n|    ins_NEXT\n|  .endmacro\n|.endif\n|\n|// Call decode and dispatch.\n|.macro ins_callt\n|  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n|  lwz PC, LFUNC:RB->pc\n|  lwz INS, 0(PC)\n|   addi PC, PC, 4\n|  decode_OP4 TMP1, INS\n|   decode_RA8 RA, INS\n|  lwzx TMP0, DISPATCH, TMP1\n|   add RA, RA, BASE\n|  mtctr TMP0\n|  bctr\n|.endmacro\n|\n|.macro ins_call\n|  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC\n|  stw PC, FRAME_PC(BASE)\n|  ins_callt\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Macros to test operand types.\n|.macro checknum, reg; evcmpltu reg, TISNUM; .endmacro\n|.macro checkstr, reg; evcmpeq reg, TISSTR; .endmacro\n|.macro checktab, reg; evcmpeq reg, TISTAB; .endmacro\n|.macro checkfunc, reg; evcmpeq reg, TISFUNC; .endmacro\n|.macro checknil, reg; evcmpeq reg, TISNIL; .endmacro\n|.macro checkok, label; blt label; .endmacro\n|.macro checkfail, label; bge label; .endmacro\n|.macro checkanyfail, label; bns label; .endmacro\n|.macro checkallok, label; bso label; .endmacro\n|\n|.macro branch_RD\n|  srwi TMP0, RD, 1\n|  add PC, PC, TMP0\n|  addis PC, PC, -(BCBIAS_J*4 >> 16)\n|.endmacro\n|\n|// Assumes DISPATCH is relative to GL.\n#define DISPATCH_GL(field)\t(GG_DISP2G + (int)offsetof(global_State, field))\n#define DISPATCH_J(field)\t(GG_DISP2J + (int)offsetof(jit_State, field))\n|\n#define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))\n|\n|.macro hotloop\n|  NYI\n|.endmacro\n|\n|.macro hotcall\n|  NYI\n|.endmacro\n|\n|// Set current VM state. Uses TMP0.\n|.macro li_vmstate, st; li TMP0, ~LJ_VMST_..st; .endmacro\n|.macro st_vmstate; stw TMP0, DISPATCH_GL(vmstate)(DISPATCH); .endmacro\n|\n|// Move table write barrier back. Overwrites mark and tmp.\n|.macro barrierback, tab, mark, tmp\n|  lwz tmp, DISPATCH_GL(gc.grayagain)(DISPATCH)\n|  // Assumes LJ_GC_BLACK is 0x04.\n|   rlwinm mark, mark, 0, 30, 28\t\t// black2gray(tab)\n|  stw tab, DISPATCH_GL(gc.grayagain)(DISPATCH)\n|   stb mark, tab->marked\n|  stw tmp, tab->gclist\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n\n/* Generate subroutines used by opcodes and other parts of the VM. */\n/* The .code_sub section should be last to help static branch prediction. */\nstatic void build_subroutines(BuildCtx *ctx)\n{\n  |.code_sub\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Return handling ----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_returnp:\n  |  // See vm_return. Also: TMP2 = previous base.\n  |  andi. TMP0, PC, FRAME_P\n  |   evsplati TMP1, LJ_TTRUE\n  |  beq ->cont_dispatch\n  |\n  |  // Return from pcall or xpcall fast func.\n  |  lwz PC, FRAME_PC(TMP2)\t\t// Fetch PC of previous frame.\n  |  mr BASE, TMP2\t\t\t// Restore caller base.\n  |  // Prepending may overwrite the pcall frame, so do it at the end.\n  |   stwu TMP1, FRAME_PC(RA)\t\t// Prepend true to results.\n  |\n  |->vm_returnc:\n  |  addi RD, RD, 8\t\t\t// RD = (nresults+1)*8.\n  |   andi. TMP0, PC, FRAME_TYPE\n  |  cmpwi cr1, RD, 0\n  |  li CRET1, LUA_YIELD\n  |  beq cr1, ->vm_unwind_c_eh\n  |  mr MULTRES, RD\n  |   beq ->BC_RET_Z\t\t\t// Handle regular return to Lua.\n  |\n  |->vm_return:\n  |  // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return\n  |  // TMP0 = PC & FRAME_TYPE\n  |  cmpwi TMP0, FRAME_C\n  |   rlwinm TMP2, PC, 0, 0, 28\n  |    li_vmstate C\n  |   sub TMP2, BASE, TMP2\t\t// TMP2 = previous base.\n  |  bne ->vm_returnp\n  |\n  |  addic. TMP1, RD, -8\n  |   stw TMP2, L->base\n  |   lwz TMP2, SAVE_NRES\n  |    subi BASE, BASE, 8\n  |    st_vmstate\n  |   slwi TMP2, TMP2, 3\n  |  beq >2\n  |1:\n  |  addic. TMP1, TMP1, -8\n  |   evldd TMP0, 0(RA)\n  |    addi RA, RA, 8\n  |   evstdd TMP0, 0(BASE)\n  |    addi BASE, BASE, 8\n  |  bne <1\n  |\n  |2:\n  |  cmpw TMP2, RD\t\t\t// More/less results wanted?\n  |  bne >6\n  |3:\n  |  stw BASE, L->top\t\t\t// Store new top.\n  |\n  |->vm_leave_cp:\n  |  lwz TMP0, SAVE_CFRAME\t\t// Restore previous C frame.\n  |   li CRET1, 0\t\t\t// Ok return status for vm_pcall.\n  |  stw TMP0, L->cframe\n  |\n  |->vm_leave_unw:\n  |  restoreregs\n  |  blr\n  |\n  |6:\n  |  ble >7\t\t\t\t// Less results wanted?\n  |  // More results wanted. Check stack size and fill up results with nil.\n  |  lwz TMP1, L->maxstack\n  |  cmplw BASE, TMP1\n  |  bge >8\n  |  evstdd TISNIL, 0(BASE)\n  |  addi RD, RD, 8\n  |  addi BASE, BASE, 8\n  |  b <2\n  |\n  |7:  // Less results wanted.\n  |   sub TMP0, RD, TMP2\n  |  cmpwi TMP2, 0\t\t\t// LUA_MULTRET+1 case?\n  |   sub TMP0, BASE, TMP0\t\t// Subtract the difference.\n  |  iseleq BASE, BASE, TMP0\t\t// Either keep top or shrink it.\n  |  b <3\n  |\n  |8:  // Corner case: need to grow stack for filling up results.\n  |  // This can happen if:\n  |  // - A C function grows the stack (a lot).\n  |  // - The GC shrinks the stack in between.\n  |  // - A return back from a lua_call() with (high) nresults adjustment.\n  |  stw BASE, L->top\t\t\t// Save current top held in BASE (yes).\n  |   mr SAVE0, RD\n  |  mr CARG2, TMP2\n  |  mr CARG1, L\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |    lwz TMP2, SAVE_NRES\n  |   mr RD, SAVE0\n  |    slwi TMP2, TMP2, 3\n  |  lwz BASE, L->top\t\t\t// Need the (realloced) L->top in BASE.\n  |  b <2\n  |\n  |->vm_unwind_c:\t\t\t// Unwind C stack, return from vm_pcall.\n  |  // (void *cframe, int errcode)\n  |  mr sp, CARG1\n  |  mr CRET1, CARG2\n  |->vm_unwind_c_eh:\t\t\t// Landing pad for external unwinder.\n  |  lwz L, SAVE_L\n  |   li TMP0, ~LJ_VMST_C\n  |  lwz GL:TMP1, L->glref\n  |   stw TMP0, GL:TMP1->vmstate\n  |  b ->vm_leave_unw\n  |\n  |->vm_unwind_ff:\t\t\t// Unwind C stack, return from ff pcall.\n  |  // (void *cframe)\n  |  rlwinm sp, CARG1, 0, 0, 29\n  |->vm_unwind_ff_eh:\t\t\t// Landing pad for external unwinder.\n  |  lwz L, SAVE_L\n  |     evsplati TISNUM, LJ_TISNUM+1\t// Setup type comparison constants.\n  |     evsplati TISFUNC, LJ_TFUNC\n  |     lus TOBIT, 0x4338\n  |     evsplati TISTAB, LJ_TTAB\n  |     li TMP0, 0\n  |  lwz BASE, L->base\n  |     evmergelo TOBIT, TOBIT, TMP0\n  |   lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |     evsplati TISSTR, LJ_TSTR\n  |  li TMP1, LJ_TFALSE\n  |     evsplati TISNIL, LJ_TNIL\n  |    li_vmstate INTERP\n  |  lwz PC, FRAME_PC(BASE)\t\t// Fetch PC of previous frame.\n  |  la RA, -8(BASE)\t\t\t// Results start at BASE-8.\n  |   addi DISPATCH, DISPATCH, GG_G2DISP\n  |  stw TMP1, 0(RA)\t\t\t// Prepend false to error message.\n  |  li RD, 16\t\t\t\t// 2 results: false + error message.\n  |    st_vmstate\n  |  b ->vm_returnc\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Grow stack for calls -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_growstack_c:\t\t\t// Grow stack for C function.\n  |  li CARG2, LUA_MINSTACK\n  |  b >2\n  |\n  |->vm_growstack_l:\t\t\t// Grow stack for Lua function.\n  |  // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC\n  |  add RC, BASE, RC\n  |   sub RA, RA, BASE\n  |  stw BASE, L->base\n  |   addi PC, PC, 4\t\t\t// Must point after first instruction.\n  |  stw RC, L->top\n  |   srwi CARG2, RA, 3\n  |2:\n  |  // L->base = new base, L->top = top\n  |   stw PC, SAVE_PC\n  |  mr CARG1, L\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  lwz BASE, L->base\n  |  lwz RC, L->top\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |  sub RC, RC, BASE\n  |  // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC\n  |  ins_callt\t\t\t\t// Just retry the call.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Entry points into the assembler VM ---------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_resume:\t\t\t\t// Setup C frame and resume thread.\n  |  // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0)\n  |  saveregs\n  |  mr L, CARG1\n  |    lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |  mr BASE, CARG2\n  |    lbz TMP1, L->status\n  |   stw L, SAVE_L\n  |  li PC, FRAME_CP\n  |  addi TMP0, sp, CFRAME_RESUME\n  |    addi DISPATCH, DISPATCH, GG_G2DISP\n  |   stw CARG3, SAVE_NRES\n  |    cmplwi TMP1, 0\n  |   stw CARG3, SAVE_ERRF\n  |  stw TMP0, L->cframe\n  |   stw CARG3, SAVE_CFRAME\n  |   stw CARG1, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |    beq >3\n  |\n  |  // Resume after yield (like a return).\n  |  mr RA, BASE\n  |   lwz BASE, L->base\n  |    evsplati TISNUM, LJ_TISNUM+1\t// Setup type comparison constants.\n  |   lwz TMP1, L->top\n  |    evsplati TISFUNC, LJ_TFUNC\n  |    lus TOBIT, 0x4338\n  |    evsplati TISTAB, LJ_TTAB\n  |  lwz PC, FRAME_PC(BASE)\n  |    li TMP2, 0\n  |    evsplati TISSTR, LJ_TSTR\n  |   sub RD, TMP1, BASE\n  |    evmergelo TOBIT, TOBIT, TMP2\n  |    stb CARG3, L->status\n  |  andi. TMP0, PC, FRAME_TYPE\n  |    li_vmstate INTERP\n  |   addi RD, RD, 8\n  |    evsplati TISNIL, LJ_TNIL\n  |   mr MULTRES, RD\n  |    st_vmstate\n  |  beq ->BC_RET_Z\n  |  b ->vm_return\n  |\n  |->vm_pcall:\t\t\t\t// Setup protected C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef)\n  |  saveregs\n  |  li PC, FRAME_CP\n  |  stw CARG4, SAVE_ERRF\n  |  b >1\n  |\n  |->vm_call:\t\t\t\t// Setup C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1)\n  |  saveregs\n  |  li PC, FRAME_C\n  |\n  |1:  // Entry point for vm_pcall above (PC = ftype).\n  |  lwz TMP1, L:CARG1->cframe\n  |   stw CARG3, SAVE_NRES\n  |    mr L, CARG1\n  |   stw CARG1, SAVE_L\n  |    mr BASE, CARG2\n  |  stw sp, L->cframe\t\t\t// Add our C frame to cframe chain.\n  |    lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |   stw CARG1, SAVE_PC\t\t// Any value outside of bytecode is ok.\n  |  stw TMP1, SAVE_CFRAME\n  |    addi DISPATCH, DISPATCH, GG_G2DISP\n  |\n  |3:  // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype).\n  |  lwz TMP2, L->base\t\t\t// TMP2 = old base (used in vmeta_call).\n  |    evsplati TISNUM, LJ_TISNUM+1\t// Setup type comparison constants.\n  |   lwz TMP1, L->top\n  |    evsplati TISFUNC, LJ_TFUNC\n  |  add PC, PC, BASE\n  |    evsplati TISTAB, LJ_TTAB\n  |    lus TOBIT, 0x4338\n  |    li TMP0, 0\n  |  sub PC, PC, TMP2\t\t\t// PC = frame delta + frame type\n  |    evsplati TISSTR, LJ_TSTR\n  |   sub NARGS8:RC, TMP1, BASE\n  |    evmergelo TOBIT, TOBIT, TMP0\n  |    li_vmstate INTERP\n  |    evsplati TISNIL, LJ_TNIL\n  |    st_vmstate\n  |\n  |->vm_call_dispatch:\n  |  // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC\n  |  li TMP0, -8\n  |  evlddx LFUNC:RB, BASE, TMP0\n  |  checkfunc LFUNC:RB\n  |  checkfail ->vmeta_call\n  |\n  |->vm_call_dispatch_f:\n  |  ins_call\n  |  // BASE = new base, RB = func, RC = nargs*8, PC = caller PC\n  |\n  |->vm_cpcall:\t\t\t\t// Setup protected C frame, call C.\n  |  // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp)\n  |  saveregs\n  |  mr L, CARG1\n  |   lwz TMP0, L:CARG1->stack\n  |  stw CARG1, SAVE_L\n  |   lwz TMP1, L->top\n  |  stw CARG1, SAVE_PC\t\t\t// Any value outside of bytecode is ok.\n  |   sub TMP0, TMP0, TMP1\t\t// Compute -savestack(L, L->top).\n  |    lwz TMP1, L->cframe\n  |    stw sp, L->cframe\t\t// Add our C frame to cframe chain.\n  |  li TMP2, 0\n  |   stw TMP0, SAVE_NRES\t\t// Neg. delta means cframe w/o frame.\n  |  stw TMP2, SAVE_ERRF\t\t// No error function.\n  |    stw TMP1, SAVE_CFRAME\n  |  mtctr CARG4\n  |  bctrl\t\t\t// (lua_State *L, lua_CFunction func, void *ud)\n  |  mr. BASE, CRET1\n  |   lwz DISPATCH, L->glref\t\t// Setup pointer to dispatch table.\n  |    li PC, FRAME_CP\n  |   addi DISPATCH, DISPATCH, GG_G2DISP\n  |  bne <3\t\t\t\t// Else continue with the call.\n  |  b ->vm_leave_cp\t\t\t// No base? Just remove C frame.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Metamethod handling ------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// The lj_meta_* functions (except for lj_meta_cat) don't reallocate the\n  |// stack, so BASE doesn't need to be reloaded across these calls.\n  |\n  |//-- Continuation dispatch ----------------------------------------------\n  |\n  |->cont_dispatch:\n  |  // BASE = meta base, RA = resultptr, RD = (nresults+1)*8\n  |  lwz TMP0, -12(BASE)\t\t// Continuation.\n  |   mr RB, BASE\n  |   mr BASE, TMP2\t\t\t// Restore caller BASE.\n  |    lwz LFUNC:TMP1, FRAME_FUNC(TMP2)\n  |  cmplwi TMP0, 0\n  |     lwz PC, -16(RB)\t\t\t// Restore PC from [cont|PC].\n  |  beq >1\n  |   subi TMP2, RD, 8\n  |    lwz TMP1, LFUNC:TMP1->pc\n  |   evstddx TISNIL, RA, TMP2\t\t// Ensure one valid arg.\n  |    lwz KBASE, PC2PROTO(k)(TMP1)\n  |  // BASE = base, RA = resultptr, RB = meta base\n  |  mtctr TMP0\n  |  bctr\t\t\t\t// Jump to continuation.\n  |\n  |1:  // Tail call from C function.\n  |  subi TMP1, RB, 16\n  |  sub RC, TMP1, BASE\n  |  b ->vm_call_tail\n  |\n  |->cont_cat:\t\t\t\t// RA = resultptr, RB = meta base\n  |  lwz INS, -4(PC)\n  |   subi CARG2, RB, 16\n  |  decode_RB8 SAVE0, INS\n  |   evldd TMP0, 0(RA)\n  |  add TMP1, BASE, SAVE0\n  |   stw BASE, L->base\n  |  cmplw TMP1, CARG2\n  |   sub CARG3, CARG2, TMP1\n  |  decode_RA8 RA, INS\n  |   evstdd TMP0, 0(CARG2)\n  |  bne ->BC_CAT_Z\n  |   evstddx TMP0, BASE, RA\n  |  b ->cont_nop\n  |\n  |//-- Table indexing metamethods -----------------------------------------\n  |\n  |->vmeta_tgets1:\n  |  evmergelo STR:RC, TISSTR, STR:RC\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |   decode_RB8 RB, INS\n  |  evstdd STR:RC, 0(CARG3)\n  |   add CARG2, BASE, RB\n  |  b >1\n  |\n  |->vmeta_tgets:\n  |  evmergelo TAB:RB, TISTAB, TAB:RB\n  |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)\n  |   evmergelo STR:RC, TISSTR, STR:RC\n  |  evstdd TAB:RB, 0(CARG2)\n  |   la CARG3, DISPATCH_GL(tmptv2)(DISPATCH)\n  |   evstdd STR:RC, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tgetb:\t\t\t// TMP0 = index\n  |  efdcfsi TMP0, TMP0\n  |   decode_RB8 RB, INS\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |   add CARG2, BASE, RB\n  |  evstdd TMP0, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tgetv:\n  |  decode_RB8 RB, INS\n  |   decode_RC8 RC, INS\n  |  add CARG2, BASE, RB\n  |   add CARG3, BASE, RC\n  |1:\n  |  stw BASE, L->base\n  |  mr CARG1, L\n  |  stw PC, SAVE_PC\n  |  bl extern lj_meta_tget\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  cmplwi CRET1, 0\n  |  beq >3\n  |  evldd TMP0, 0(CRET1)\n  |  evstddx TMP0, BASE, RA\n  |  ins_next\n  |\n  |3:  // Call __index metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k\n  |  subfic TMP1, BASE, FRAME_CONT\n  |  lwz BASE, L->top\n  |  stw PC, -16(BASE)\t\t\t// [cont|PC]\n  |   add PC, TMP1, BASE\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |   li NARGS8:RC, 16\t\t\t// 2 args for func(t, k).\n  |  b ->vm_call_dispatch_f\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->vmeta_tsets1:\n  |  evmergelo STR:RC, TISSTR, STR:RC\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |   decode_RB8 RB, INS\n  |  evstdd STR:RC, 0(CARG3)\n  |   add CARG2, BASE, RB\n  |  b >1\n  |\n  |->vmeta_tsets:\n  |  evmergelo TAB:RB, TISTAB, TAB:RB\n  |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)\n  |   evmergelo STR:RC, TISSTR, STR:RC\n  |  evstdd TAB:RB, 0(CARG2)\n  |   la CARG3, DISPATCH_GL(tmptv2)(DISPATCH)\n  |   evstdd STR:RC, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tsetb:\t\t\t// TMP0 = index\n  |  efdcfsi TMP0, TMP0\n  |   decode_RB8 RB, INS\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |   add CARG2, BASE, RB\n  |  evstdd TMP0, 0(CARG3)\n  |  b >1\n  |\n  |->vmeta_tsetv:\n  |  decode_RB8 RB, INS\n  |   decode_RC8 RC, INS\n  |  add CARG2, BASE, RB\n  |   add CARG3, BASE, RC\n  |1:\n  |  stw BASE, L->base\n  |  mr CARG1, L\n  |  stw PC, SAVE_PC\n  |  bl extern lj_meta_tset\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // Returns TValue * (finished) or NULL (metamethod).\n  |  cmplwi CRET1, 0\n  |   evlddx TMP0, BASE, RA\n  |  beq >3\n  |  // NOBARRIER: lj_meta_tset ensures the table is not black.\n  |   evstdd TMP0, 0(CRET1)\n  |  ins_next\n  |\n  |3:  // Call __newindex metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k/(v)\n  |  subfic TMP1, BASE, FRAME_CONT\n  |  lwz BASE, L->top\n  |  stw PC, -16(BASE)\t\t\t// [cont|PC]\n  |   add PC, TMP1, BASE\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |   li NARGS8:RC, 24\t\t\t// 3 args for func(t, k, v)\n  |  evstdd TMP0, 16(BASE)\t\t// Copy value to third argument.\n  |  b ->vm_call_dispatch_f\n  |\n  |//-- Comparison metamethods ---------------------------------------------\n  |\n  |->vmeta_comp:\n  |  mr CARG1, L\n  |   subi PC, PC, 4\n  |  add CARG2, BASE, RA\n  |   stw PC, SAVE_PC\n  |  add CARG3, BASE, RD\n  |   stw BASE, L->base\n  |  decode_OP1 CARG4, INS\n  |  bl extern lj_meta_comp  // (lua_State *L, TValue *o1, *o2, int op)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |3:\n  |  cmplwi CRET1, 1\n  |  bgt ->vmeta_binop\n  |4:\n  |  lwz INS, 0(PC)\n  |   addi PC, PC, 4\n  |  decode_RD4 TMP2, INS\n  |  addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n  |  add TMP2, TMP2, TMP3\n  |  isellt PC, PC, TMP2\n  |->cont_nop:\n  |  ins_next\n  |\n  |->cont_ra:\t\t\t\t// RA = resultptr\n  |  lwz INS, -4(PC)\n  |   evldd TMP0, 0(RA)\n  |  decode_RA8 TMP1, INS\n  |   evstddx TMP0, BASE, TMP1\n  |  b ->cont_nop\n  |\n  |->cont_condt:\t\t\t// RA = resultptr\n  |  lwz TMP0, 0(RA)\n  |   li TMP1, LJ_TTRUE\n  |  cmplw TMP1, TMP0\t\t\t// Branch if result is true.\n  |  b <4\n  |\n  |->cont_condf:\t\t\t// RA = resultptr\n  |  lwz TMP0, 0(RA)\n  |   li TMP1, LJ_TFALSE\n  |  cmplw TMP0, TMP1\t\t\t// Branch if result is false.\n  |  b <4\n  |\n  |->vmeta_equal:\n  |  // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV.\n  |  subi PC, PC, 4\n  |   stw BASE, L->base\n  |  mr CARG1, L\n  |   stw PC, SAVE_PC\n  |  bl extern lj_meta_equal  // (lua_State *L, GCobj *o1, *o2, int ne)\n  |  // Returns 0/1 or TValue * (metamethod).\n  |  b <3\n  |\n  |//-- Arithmetic metamethods ---------------------------------------------\n  |\n  |->vmeta_arith_vn:\n  |  add CARG3, BASE, RB\n  |  add CARG4, KBASE, RC\n  |  b >1\n  |\n  |->vmeta_arith_nv:\n  |  add CARG3, KBASE, RC\n  |  add CARG4, BASE, RB\n  |  b >1\n  |\n  |->vmeta_unm:\n  |  add CARG3, BASE, RD\n  |  mr CARG4, CARG3\n  |  b >1\n  |\n  |->vmeta_arith_vv:\n  |  add CARG3, BASE, RB\n  |  add CARG4, BASE, RC\n  |1:\n  |  add CARG2, BASE, RA\n  |   stw BASE, L->base\n  |  mr CARG1, L\n  |   stw PC, SAVE_PC\n  |  decode_OP1 CARG5, INS\t\t// Caveat: CARG5 overlaps INS.\n  |  bl extern lj_meta_arith  // (lua_State *L, TValue *ra,*rb,*rc, BCReg op)\n  |  // Returns NULL (finished) or TValue * (metamethod).\n  |  cmplwi CRET1, 0\n  |  beq ->cont_nop\n  |\n  |  // Call metamethod for binary op.\n  |->vmeta_binop:\n  |  // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2\n  |  sub TMP1, CRET1, BASE\n  |   stw PC, -16(CRET1)\t\t// [cont|PC]\n  |   mr TMP2, BASE\n  |  addi PC, TMP1, FRAME_CONT\n  |   mr BASE, CRET1\n  |  li NARGS8:RC, 16\t\t\t// 2 args for func(o1, o2).\n  |  b ->vm_call_dispatch\n  |\n  |->vmeta_len:\n#if LJ_52\n  |  mr SAVE0, CARG1\n#endif\n  |  add CARG2, BASE, RD\n  |   stw BASE, L->base\n  |  mr CARG1, L\n  |   stw PC, SAVE_PC\n  |  bl extern lj_meta_len\t\t// (lua_State *L, TValue *o)\n  |  // Returns NULL (retry) or TValue * (metamethod base).\n#if LJ_52\n  |  cmplwi CRET1, 0\n  |  bne ->vmeta_binop\t\t\t// Binop call for compatibility.\n  |  mr CARG1, SAVE0\n  |  b ->BC_LEN_Z\n#else\n  |  b ->vmeta_binop\t\t\t// Binop call for compatibility.\n#endif\n  |\n  |//-- Call metamethod ----------------------------------------------------\n  |\n  |->vmeta_call:\t\t\t// Resolve and call __call metamethod.\n  |  // TMP2 = old base, BASE = new base, RC = nargs*8\n  |  mr CARG1, L\n  |   stw TMP2, L->base\t\t\t// This is the callers base!\n  |  subi CARG2, BASE, 8\n  |   stw PC, SAVE_PC\n  |  add CARG3, BASE, RC\n  |   mr SAVE0, NARGS8:RC\n  |  bl extern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\t// Guaranteed to be a function here.\n  |   addi NARGS8:RC, SAVE0, 8\t\t// Got one more argument now.\n  |  ins_call\n  |\n  |->vmeta_callt:\t\t\t// Resolve __call for BC_CALLT.\n  |  // BASE = old base, RA = new base, RC = nargs*8\n  |  mr CARG1, L\n  |   stw BASE, L->base\n  |  subi CARG2, RA, 8\n  |   stw PC, SAVE_PC\n  |  add CARG3, RA, RC\n  |   mr SAVE0, NARGS8:RC\n  |  bl extern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |  lwz TMP1, FRAME_PC(BASE)\n  |   addi NARGS8:RC, SAVE0, 8\t\t// Got one more argument now.\n  |   lwz LFUNC:RB, FRAME_FUNC(RA)\t// Guaranteed to be a function here.\n  |  b ->BC_CALLT_Z\n  |\n  |//-- Argument coercion for 'for' statement ------------------------------\n  |\n  |->vmeta_for:\n  |  mr CARG1, L\n  |   stw BASE, L->base\n  |  mr CARG2, RA\n  |   stw PC, SAVE_PC\n  |  mr SAVE0, INS\n  |  bl extern lj_meta_for\t// (lua_State *L, TValue *base)\n  |.if JIT\n  |   decode_OP1 TMP0, SAVE0\n  |.endif\n  |  decode_RA8 RA, SAVE0\n  |.if JIT\n  |   cmpwi TMP0, BC_JFORI\n  |.endif\n  |  decode_RD8 RD, SAVE0\n  |.if JIT\n  |   beq =>BC_JFORI\n  |.endif\n  |  b =>BC_FORI\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Fast functions -----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |.macro .ffunc, name\n  |->ff_ .. name:\n  |.endmacro\n  |\n  |.macro .ffunc_1, name\n  |->ff_ .. name:\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_2, name\n  |->ff_ .. name:\n  |  cmplwi NARGS8:RC, 16\n  |   evldd CARG1, 0(BASE)\n  |   evldd CARG2, 8(BASE)\n  |  blt ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_n, name\n  |  .ffunc_1 name\n  |  checknum CARG1\n  |  checkfail ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_nn, name\n  |  .ffunc_2 name\n  |  evmergehi TMP0, CARG1, CARG2\n  |  checknum TMP0\n  |  checkanyfail ->fff_fallback\n  |.endmacro\n  |\n  |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1.\n  |.macro ffgccheck\n  |  lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH)\n  |  lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)\n  |  cmplw TMP0, TMP1\n  |  bgel ->fff_gcstep\n  |.endmacro\n  |\n  |//-- Base library: checks -----------------------------------------------\n  |\n  |.ffunc assert\n  |  cmplwi NARGS8:RC, 8\n  |   evldd TMP0, 0(BASE)\n  |  blt ->fff_fallback\n  |  evaddw TMP1, TISNIL, TISNIL\t// Synthesize LJ_TFALSE.\n  |  la RA, -8(BASE)\n  |   evcmpltu cr1, TMP0, TMP1\n  |    lwz PC, FRAME_PC(BASE)\n  |  bge cr1, ->fff_fallback\n  |   evstdd TMP0, 0(RA)\n  |  addi RD, NARGS8:RC, 8\t\t// Compute (nresults+1)*8.\n  |   beq ->fff_res\t\t\t// Done if exactly 1 argument.\n  |  li TMP1, 8\n  |  subi RC, RC, 8\n  |1:\n  |  cmplw TMP1, RC\n  |   evlddx TMP0, BASE, TMP1\n  |   evstddx TMP0, RA, TMP1\n  |    addi TMP1, TMP1, 8\n  |  bne <1\n  |  b ->fff_res\n  |\n  |.ffunc type\n  |  cmplwi NARGS8:RC, 8\n  |   lwz CARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |    li TMP2, ~LJ_TNUMX\n  |  cmplw CARG1, TISNUM\n  |  not TMP1, CARG1\n  |  isellt TMP1, TMP2, TMP1\n  |  slwi TMP1, TMP1, 3\n  |   la TMP2, CFUNC:RB->upvalue\n  |  evlddx STR:CRET1, TMP2, TMP1\n  |  b ->fff_restv\n  |\n  |//-- Base library: getters and setters ---------------------------------\n  |\n  |.ffunc_1 getmetatable\n  |  checktab CARG1\n  |   evmergehi TMP1, CARG1, CARG1\n  |  checkfail >6\n  |1:  // Field metatable must be at same offset for GCtab and GCudata!\n  |  lwz TAB:RB, TAB:CARG1->metatable\n  |2:\n  |  evmr CRET1, TISNIL\n  |   cmplwi TAB:RB, 0\n  |  lwz STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH)\n  |   beq ->fff_restv\n  |  lwz TMP0, TAB:RB->hmask\n  |   evmergelo CRET1, TISTAB, TAB:RB\t// Use metatable as default result.\n  |  lwz TMP1, STR:RC->hash\n  |  lwz NODE:TMP2, TAB:RB->node\n  |   evmergelo STR:RC, TISSTR, STR:RC\n  |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n  |  slwi TMP0, TMP1, 5\n  |  slwi TMP1, TMP1, 3\n  |  sub TMP1, TMP0, TMP1\n  |  add NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n  |3:  // Rearranged logic, because we expect _not_ to find the key.\n  |  evldd TMP0, NODE:TMP2->key\n  |   evldd TMP1, NODE:TMP2->val\n  |  evcmpeq TMP0, STR:RC\n  |   lwz NODE:TMP2, NODE:TMP2->next\n  |  checkallok >5\n  |   cmplwi NODE:TMP2, 0\n  |   beq ->fff_restv\t\t\t// Not found, keep default result.\n  |   b <3\n  |5:\n  |  checknil TMP1\n  |  checkok ->fff_restv\t\t// Ditto for nil value.\n  |  evmr CRET1, TMP1\t\t\t// Return value of mt.__metatable.\n  |  b ->fff_restv\n  |\n  |6:\n  |  cmpwi TMP1, LJ_TUDATA\n  |   not TMP1, TMP1\n  |  beq <1\n  |  checknum CARG1\n  |   slwi TMP1, TMP1, 2\n  |   li TMP2, 4*~LJ_TNUMX\n  |  isellt TMP1, TMP2, TMP1\n  |   la TMP2, DISPATCH_GL(gcroot[GCROOT_BASEMT])(DISPATCH)\n  |  lwzx TAB:RB, TMP2, TMP1\n  |  b <2\n  |\n  |.ffunc_2 setmetatable\n  |  // Fast path: no mt for table yet and not clearing the mt.\n  |  evmergehi TMP0, TAB:CARG1, TAB:CARG2\n  |  checktab TMP0\n  |  checkanyfail ->fff_fallback\n  |  lwz TAB:TMP1, TAB:CARG1->metatable\n  |  cmplwi TAB:TMP1, 0\n  |   lbz TMP3, TAB:CARG1->marked\n  |  bne ->fff_fallback\n  |   andi. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n  |    stw TAB:CARG2, TAB:CARG1->metatable\n  |   beq ->fff_restv\n  |  barrierback TAB:CARG1, TMP3, TMP0\n  |  b ->fff_restv\n  |\n  |.ffunc rawget\n  |  cmplwi NARGS8:RC, 16\n  |   evldd CARG2, 0(BASE)\n  |  blt ->fff_fallback\n  |  checktab CARG2\n  |   la CARG3, 8(BASE)\n  |  checkfail ->fff_fallback\n  |   mr CARG1, L\n  |  bl extern lj_tab_get  // (lua_State *L, GCtab *t, cTValue *key)\n  |  // Returns cTValue *.\n  |  evldd CRET1, 0(CRET1)\n  |  b ->fff_restv\n  |\n  |//-- Base library: conversions ------------------------------------------\n  |\n  |.ffunc tonumber\n  |  // Only handles the number case inline (without a base argument).\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG1, 0(BASE)\n  |  bne ->fff_fallback\t\t\t// Exactly one argument.\n  |  checknum CARG1\n  |  checkok ->fff_restv\n  |  b ->fff_fallback\n  |\n  |.ffunc_1 tostring\n  |  // Only handles the string or number case inline.\n  |  checkstr CARG1\n  |  // A __tostring method in the string base metatable is ignored.\n  |  checkok ->fff_restv\t\t// String key?\n  |  // Handle numbers inline, unless a number base metatable is present.\n  |  lwz TMP0, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH)\n  |  checknum CARG1\n  |  cmplwi cr1, TMP0, 0\n  |   stw BASE, L->base\t\t\t// Add frame since C call can throw.\n  |  crand 4*cr0+eq, 4*cr0+lt, 4*cr1+eq\n  |   stw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  bne ->fff_fallback\n  |  ffgccheck\n  |  mr CARG1, L\n  |  mr CARG2, BASE\n  |  bl extern lj_str_fromnum\t\t// (lua_State *L, lua_Number *np)\n  |  // Returns GCstr *.\n  |  evmergelo STR:CRET1, TISSTR, STR:CRET1\n  |  b ->fff_restv\n  |\n  |//-- Base library: iterators -------------------------------------------\n  |\n  |.ffunc next\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG2, 0(BASE)\n  |  blt ->fff_fallback\n  |   evstddx TISNIL, BASE, NARGS8:RC\t// Set missing 2nd arg to nil.\n  |  checktab TAB:CARG2\n  |   lwz PC, FRAME_PC(BASE)\n  |  checkfail ->fff_fallback\n  |   stw BASE, L->base\t\t\t// Add frame since C call can throw.\n  |  mr CARG1, L\n  |   stw BASE, L->top\t\t\t// Dummy frame length is ok.\n  |  la CARG3, 8(BASE)\n  |   stw PC, SAVE_PC\n  |  bl extern lj_tab_next\t// (lua_State *L, GCtab *t, TValue *key)\n  |  // Returns 0 at end of traversal.\n  |  cmplwi CRET1, 0\n  |   evmr CRET1, TISNIL\n  |  beq ->fff_restv\t\t\t// End of traversal: return nil.\n  |  evldd TMP0, 8(BASE)\t\t// Copy key and value to results.\n  |   la RA, -8(BASE)\n  |  evldd TMP1, 16(BASE)\n  |  evstdd TMP0, 0(RA)\n  |   li RD, (2+1)*8\n  |  evstdd TMP1, 8(RA)\n  |  b ->fff_res\n  |\n  |.ffunc_1 pairs\n  |  checktab TAB:CARG1\n  |   lwz PC, FRAME_PC(BASE)\n  |  checkfail ->fff_fallback\n#if LJ_52\n  |   lwz TAB:TMP2, TAB:CARG1->metatable\n  |  evldd CFUNC:TMP0, CFUNC:RB->upvalue[0]\n  |   cmplwi TAB:TMP2, 0\n  |  la RA, -8(BASE)\n  |   bne ->fff_fallback\n#else\n  |  evldd CFUNC:TMP0, CFUNC:RB->upvalue[0]\n  |  la RA, -8(BASE)\n#endif\n  |   evstdd TISNIL, 8(BASE)\n  |  li RD, (3+1)*8\n  |  evstdd CFUNC:TMP0, 0(RA)\n  |  b ->fff_res\n  |\n  |.ffunc_2 ipairs_aux\n  |  checktab TAB:CARG1\n  |   lwz PC, FRAME_PC(BASE)\n  |  checkfail ->fff_fallback\n  |  checknum CARG2\n  |    lus TMP3, 0x3ff0\n  |  checkfail ->fff_fallback\n  |  efdctsi TMP2, CARG2\n  |   lwz TMP0, TAB:CARG1->asize\n  |    evmergelo TMP3, TMP3, ZERO\n  |   lwz TMP1, TAB:CARG1->array\n  |  efdadd CARG2, CARG2, TMP3\n  |  addi TMP2, TMP2, 1\n  |   la RA, -8(BASE)\n  |  cmplw TMP0, TMP2\n  |   slwi TMP3, TMP2, 3\n  |  evstdd CARG2, 0(RA)\n  |  ble >2\t\t\t\t// Not in array part?\n  |  evlddx TMP1, TMP1, TMP3\n  |1:\n  |  checknil TMP1\n  |   li RD, (0+1)*8\n  |  checkok ->fff_res\t\t\t// End of iteration, return 0 results.\n  |   li RD, (2+1)*8\n  |  evstdd TMP1, 8(RA)\n  |  b ->fff_res\n  |2:  // Check for empty hash part first. Otherwise call C function.\n  |  lwz TMP0, TAB:CARG1->hmask\n  |  cmplwi TMP0, 0\n  |   li RD, (0+1)*8\n  |  beq ->fff_res\n  |   mr CARG2, TMP2\n  |  bl extern lj_tab_getinth\t\t// (GCtab *t, int32_t key)\n  |  // Returns cTValue * or NULL.\n  |  cmplwi CRET1, 0\n  |   li RD, (0+1)*8\n  |  beq ->fff_res\n  |  evldd TMP1, 0(CRET1)\n  |  b <1\n  |\n  |.ffunc_1 ipairs\n  |  checktab TAB:CARG1\n  |   lwz PC, FRAME_PC(BASE)\n  |  checkfail ->fff_fallback\n#if LJ_52\n  |   lwz TAB:TMP2, TAB:CARG1->metatable\n  |  evldd CFUNC:TMP0, CFUNC:RB->upvalue[0]\n  |   cmplwi TAB:TMP2, 0\n  |  la RA, -8(BASE)\n  |   bne ->fff_fallback\n#else\n  |  evldd CFUNC:TMP0, CFUNC:RB->upvalue[0]\n  |  la RA, -8(BASE)\n#endif\n  |    evsplati TMP1, 0\n  |  li RD, (3+1)*8\n  |    evstdd TMP1, 8(BASE)\n  |  evstdd CFUNC:TMP0, 0(RA)\n  |  b ->fff_res\n  |\n  |//-- Base library: catch errors ----------------------------------------\n  |\n  |.ffunc pcall\n  |  cmplwi NARGS8:RC, 8\n  |   lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  blt ->fff_fallback\n  |   mr TMP2, BASE\n  |   la BASE, 8(BASE)\n  |  // Remember active hook before pcall.\n  |  rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31\n  |   subi NARGS8:RC, NARGS8:RC, 8\n  |  addi PC, TMP3, 8+FRAME_PCALL\n  |  b ->vm_call_dispatch\n  |\n  |.ffunc_2 xpcall\n  |  lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |   mr TMP2, BASE\n  |  checkfunc CARG2\t\t\t// Traceback must be a function.\n  |  checkfail ->fff_fallback\n  |   la BASE, 16(BASE)\n  |  // Remember active hook before pcall.\n  |  rlwinm TMP3, TMP3, 32-HOOK_ACTIVE_SHIFT, 31, 31\n  |   evstdd CARG2, 0(TMP2)\t\t// Swap function and traceback.\n  |  subi NARGS8:RC, NARGS8:RC, 16\n  |   evstdd CARG1, 8(TMP2)\n  |  addi PC, TMP3, 16+FRAME_PCALL\n  |  b ->vm_call_dispatch\n  |\n  |//-- Coroutine library --------------------------------------------------\n  |\n  |.macro coroutine_resume_wrap, resume\n  |.if resume\n  |.ffunc_1 coroutine_resume\n  |  evmergehi TMP0, L:CARG1, L:CARG1\n  |.else\n  |.ffunc coroutine_wrap_aux\n  |  lwz L:CARG1, CFUNC:RB->upvalue[0].gcr\n  |.endif\n  |.if resume\n  |  cmpwi TMP0, LJ_TTHREAD\n  |  bne ->fff_fallback\n  |.endif\n  |  lbz TMP0, L:CARG1->status\n  |   lwz TMP1, L:CARG1->cframe\n  |    lwz CARG2, L:CARG1->top\n  |  cmplwi cr0, TMP0, LUA_YIELD\n  |    lwz TMP2, L:CARG1->base\n  |   cmplwi cr1, TMP1, 0\n  |   lwz TMP0, L:CARG1->maxstack\n  |    cmplw cr7, CARG2, TMP2\n  |   lwz PC, FRAME_PC(BASE)\n  |  crorc 4*cr6+lt, 4*cr0+gt, 4*cr1+eq\t\t// st>LUA_YIELD || cframe!=0\n  |   add TMP2, CARG2, NARGS8:RC\n  |  crandc 4*cr6+gt, 4*cr7+eq, 4*cr0+eq\t// base==top && st!=LUA_YIELD\n  |   cmplw cr1, TMP2, TMP0\n  |  cror 4*cr6+lt, 4*cr6+lt, 4*cr6+gt\n  |   stw PC, SAVE_PC\n  |  cror 4*cr6+lt, 4*cr6+lt, 4*cr1+gt\t\t// cond1 || cond2 || stackov\n  |   stw BASE, L->base\n  |  blt cr6, ->fff_fallback\n  |1:\n  |.if resume\n  |  addi BASE, BASE, 8\t\t\t// Keep resumed thread in stack for GC.\n  |  subi NARGS8:RC, NARGS8:RC, 8\n  |  subi TMP2, TMP2, 8\n  |.endif\n  |  stw TMP2, L:CARG1->top\n  |  li TMP1, 0\n  |  stw BASE, L->top\n  |2:  // Move args to coroutine.\n  |  cmpw TMP1, NARGS8:RC\n  |   evlddx TMP0, BASE, TMP1\n  |  beq >3\n  |   evstddx TMP0, CARG2, TMP1\n  |  addi TMP1, TMP1, 8\n  |  b <2\n  |3:\n  |  li CARG3, 0\n  |   mr L:SAVE0, L:CARG1\n  |  li CARG4, 0\n  |  bl ->vm_resume\t\t\t// (lua_State *L, TValue *base, 0, 0)\n  |  // Returns thread status.\n  |4:\n  |  lwz TMP2, L:SAVE0->base\n  |   cmplwi CRET1, LUA_YIELD\n  |  lwz TMP3, L:SAVE0->top\n  |    li_vmstate INTERP\n  |  lwz BASE, L->base\n  |    st_vmstate\n  |   bgt >8\n  |  sub RD, TMP3, TMP2\n  |   lwz TMP0, L->maxstack\n  |  cmplwi RD, 0\n  |   add TMP1, BASE, RD\n  |  beq >6\t\t\t\t// No results?\n  |  cmplw TMP1, TMP0\n  |   li TMP1, 0\n  |  bgt >9\t\t\t\t// Need to grow stack?\n  |\n  |  subi TMP3, RD, 8\n  |   stw TMP2, L:SAVE0->top\t\t// Clear coroutine stack.\n  |5:  // Move results from coroutine.\n  |  cmplw TMP1, TMP3\n  |   evlddx TMP0, TMP2, TMP1\n  |   evstddx TMP0, BASE, TMP1\n  |    addi TMP1, TMP1, 8\n  |  bne <5\n  |6:\n  |  andi. TMP0, PC, FRAME_TYPE\n  |.if resume\n  |  li TMP1, LJ_TTRUE\n  |   la RA, -8(BASE)\n  |  stw TMP1, -8(BASE)\t\t\t// Prepend true to results.\n  |  addi RD, RD, 16\n  |.else\n  |  mr RA, BASE\n  |  addi RD, RD, 8\n  |.endif\n  |7:\n  |    stw PC, SAVE_PC\n  |   mr MULTRES, RD\n  |  beq ->BC_RET_Z\n  |  b ->vm_return\n  |\n  |8:  // Coroutine returned with error (at co->top-1).\n  |.if resume\n  |  andi. TMP0, PC, FRAME_TYPE\n  |  la TMP3, -8(TMP3)\n  |   li TMP1, LJ_TFALSE\n  |  evldd TMP0, 0(TMP3)\n  |   stw TMP3, L:SAVE0->top\t\t// Remove error from coroutine stack.\n  |    li RD, (2+1)*8\n  |   stw TMP1, -8(BASE)\t\t// Prepend false to results.\n  |    la RA, -8(BASE)\n  |  evstdd TMP0, 0(BASE)\t\t// Copy error message.\n  |  b <7\n  |.else\n  |  mr CARG1, L\n  |  mr CARG2, L:SAVE0\n  |  bl extern lj_ffh_coroutine_wrap_err  // (lua_State *L, lua_State *co)\n  |.endif\n  |\n  |9:  // Handle stack expansion on return from yield.\n  |  mr CARG1, L\n  |  srwi CARG2, RD, 3\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  li CRET1, 0\n  |  b <4\n  |.endmacro\n  |\n  |  coroutine_resume_wrap 1\t\t// coroutine.resume\n  |  coroutine_resume_wrap 0\t\t// coroutine.wrap\n  |\n  |.ffunc coroutine_yield\n  |  lwz TMP0, L->cframe\n  |   add TMP1, BASE, NARGS8:RC\n  |   stw BASE, L->base\n  |  andi. TMP0, TMP0, CFRAME_RESUME\n  |   stw TMP1, L->top\n  |    li CRET1, LUA_YIELD\n  |  beq ->fff_fallback\n  |   stw ZERO, L->cframe\n  |    stb CRET1, L->status\n  |  b ->vm_leave_unw\n  |\n  |//-- Math library -------------------------------------------------------\n  |\n  |.ffunc_n math_abs\n  |  efdabs CRET1, CARG1\n  |  // Fallthrough.\n  |\n  |->fff_restv:\n  |  // CRET1 = TValue result.\n  |  lwz PC, FRAME_PC(BASE)\n  |   la RA, -8(BASE)\n  |  evstdd CRET1, 0(RA)\n  |->fff_res1:\n  |  // RA = results, PC = return.\n  |  li RD, (1+1)*8\n  |->fff_res:\n  |  // RA = results, RD = (nresults+1)*8, PC = return.\n  |  andi. TMP0, PC, FRAME_TYPE\n  |   mr MULTRES, RD\n  |  bne ->vm_return\n  |  lwz INS, -4(PC)\n  |  decode_RB8 RB, INS\n  |5:\n  |  cmplw RB, RD\t\t\t// More results expected?\n  |   decode_RA8 TMP0, INS\n  |  bgt >6\n  |  ins_next1\n  |  // Adjust BASE. KBASE is assumed to be set for the calling frame.\n  |   sub BASE, RA, TMP0\n  |  ins_next2\n  |\n  |6:  // Fill up results with nil.\n  |  subi TMP1, RD, 8\n  |   addi RD, RD, 8\n  |  evstddx TISNIL, RA, TMP1\n  |  b <5\n  |\n  |.macro math_extern, func\n  |  .ffunc math_ .. func\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG2, 0(BASE)\n  |  blt ->fff_fallback\n  |  checknum CARG2\n  |   evmergehi CARG1, CARG2, CARG2\n  |  checkfail ->fff_fallback\n  |  bl extern func\n  |  evmergelo CRET1, CRET1, CRET2\n  |  b ->fff_restv\n  |.endmacro\n  |\n  |.macro math_extern2, func\n  |  .ffunc math_ .. func\n  |  cmplwi NARGS8:RC, 16\n  |   evldd CARG2, 0(BASE)\n  |   evldd CARG4, 8(BASE)\n  |  blt ->fff_fallback\n  |  evmergehi CARG1, CARG4, CARG2\n  |  checknum CARG1\n  |   evmergehi CARG3, CARG4, CARG4\n  |  checkanyfail ->fff_fallback\n  |  bl extern func\n  |  evmergelo CRET1, CRET1, CRET2\n  |  b ->fff_restv\n  |.endmacro\n  |\n  |.macro math_round, func\n  |  .ffunc math_ .. func\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG2, 0(BASE)\n  |  blt ->fff_fallback\n  |  checknum CARG2\n  |   evmergehi CARG1, CARG2, CARG2\n  |  checkfail ->fff_fallback\n  |   lwz PC, FRAME_PC(BASE)\n  |  bl ->vm_..func.._hilo;\n  |  la RA, -8(BASE)\n  |  evstdd CRET2, 0(RA)\n  |  b ->fff_res1\n  |.endmacro\n  |\n  |  math_round floor\n  |  math_round ceil\n  |\n  |  math_extern sqrt\n  |\n  |.ffunc math_log\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG2, 0(BASE)\n  |  bne ->fff_fallback                 // Need exactly 1 argument.\n  |  checknum CARG2\n  |   evmergehi CARG1, CARG2, CARG2\n  |  checkfail ->fff_fallback\n  |  bl extern log\n  |  evmergelo CRET1, CRET1, CRET2\n  |  b ->fff_restv\n  |\n  |  math_extern log10\n  |  math_extern exp\n  |  math_extern sin\n  |  math_extern cos\n  |  math_extern tan\n  |  math_extern asin\n  |  math_extern acos\n  |  math_extern atan\n  |  math_extern sinh\n  |  math_extern cosh\n  |  math_extern tanh\n  |  math_extern2 pow\n  |  math_extern2 atan2\n  |  math_extern2 fmod\n  |\n  |->ff_math_deg:\n  |.ffunc_n math_rad\n  |  evldd CARG2, CFUNC:RB->upvalue[0]\n  |  efdmul CRET1, CARG1, CARG2\n  |  b ->fff_restv\n  |\n  |.ffunc math_ldexp\n  |  cmplwi NARGS8:RC, 16\n  |   evldd CARG2, 0(BASE)\n  |   evldd CARG4, 8(BASE)\n  |  blt ->fff_fallback\n  |  evmergehi CARG1, CARG4, CARG2\n  |  checknum CARG1\n  |  checkanyfail ->fff_fallback\n  |  efdctsi CARG3, CARG4\n  |  bl extern ldexp\n  |  evmergelo CRET1, CRET1, CRET2\n  |  b ->fff_restv\n  |\n  |.ffunc math_frexp\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG2, 0(BASE)\n  |  blt ->fff_fallback\n  |  checknum CARG2\n  |   evmergehi CARG1, CARG2, CARG2\n  |  checkfail ->fff_fallback\n  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n  |   lwz PC, FRAME_PC(BASE)\n  |  bl extern frexp\n  |   lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH)\n  |  evmergelo CRET1, CRET1, CRET2\n  |   efdcfsi CRET2, TMP1\n  |   la RA, -8(BASE)\n  |  evstdd CRET1, 0(RA)\n  |  li RD, (2+1)*8\n  |   evstdd CRET2, 8(RA)\n  |  b ->fff_res\n  |\n  |.ffunc math_modf\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG2, 0(BASE)\n  |  blt ->fff_fallback\n  |  checknum CARG2\n  |   evmergehi CARG1, CARG2, CARG2\n  |  checkfail ->fff_fallback\n  |  la CARG3, -8(BASE)\n  |   lwz PC, FRAME_PC(BASE)\n  |  bl extern modf\n  |  evmergelo CRET1, CRET1, CRET2\n  |   la RA, -8(BASE)\n  |  evstdd CRET1, 0(BASE)\n  |  li RD, (2+1)*8\n  |  b ->fff_res\n  |\n  |.macro math_minmax, name, cmpop\n  |  .ffunc_1 name\n  |  checknum CARG1\n  |   li TMP1, 8\n  |  checkfail ->fff_fallback\n  |1:\n  |  evlddx CARG2, BASE, TMP1\n  |  cmplw cr1, TMP1, NARGS8:RC\n  |   checknum CARG2\n  |  bge cr1, ->fff_restv\t\t// Ok, since CRET1 = CARG1.\n  |   checkfail ->fff_fallback\n  |  cmpop CARG2, CARG1\n  |   addi TMP1, TMP1, 8\n  |  crmove 4*cr0+lt, 4*cr0+gt\n  |  evsel CARG1, CARG2, CARG1\n  |  b <1\n  |.endmacro\n  |\n  |  math_minmax math_min, efdtstlt\n  |  math_minmax math_max, efdtstgt\n  |\n  |//-- String library -----------------------------------------------------\n  |\n  |.ffunc_1 string_len\n  |  checkstr STR:CARG1\n  |  checkfail ->fff_fallback\n  |  lwz TMP0, STR:CARG1->len\n  |  efdcfsi CRET1, TMP0\n  |  b ->fff_restv\n  |\n  |.ffunc string_byte\t\t\t// Only handle the 1-arg case here.\n  |  cmplwi NARGS8:RC, 8\n  |   evldd STR:CARG1, 0(BASE)\n  |  bne ->fff_fallback\t\t\t// Need exactly 1 argument.\n  |  checkstr STR:CARG1\n  |   la RA, -8(BASE)\n  |  checkfail ->fff_fallback\n  |  lwz TMP0, STR:CARG1->len\n  |   li RD, (0+1)*8\n  |    lbz TMP1, STR:CARG1[1]\t\t// Access is always ok (NUL at end).\n  |   li TMP2, (1+1)*8\n  |  cmplwi TMP0, 0\n  |   lwz PC, FRAME_PC(BASE)\n  |    efdcfsi CRET1, TMP1\n  |  iseleq RD, RD, TMP2\n  |    evstdd CRET1, 0(RA)\n  |  b ->fff_res\n  |\n  |.ffunc string_char\t\t\t// Only handle the 1-arg case here.\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG1, 0(BASE)\n  |  bne ->fff_fallback\t\t\t// Exactly 1 argument.\n  |  checknum CARG1\n  |   la CARG2, DISPATCH_GL(tmptv)(DISPATCH)\n  |  checkfail ->fff_fallback\n  |  efdctsiz TMP0, CARG1\n  |   li CARG3, 1\n  |  cmplwi TMP0, 255\n  |   stb TMP0, 0(CARG2)\n  |  bgt ->fff_fallback\n  |->fff_newstr:\n  |  mr CARG1, L\n  |  stw BASE, L->base\n  |  stw PC, SAVE_PC\n  |  bl extern lj_str_new\t\t// (lua_State *L, char *str, size_t l)\n  |  // Returns GCstr *.\n  |  lwz BASE, L->base\n  |   evmergelo STR:CRET1, TISSTR, STR:CRET1\n  |  b ->fff_restv\n  |\n  |.ffunc string_sub\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 16\n  |   evldd CARG3, 16(BASE)\n  |   evldd STR:CARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |   evldd CARG2, 8(BASE)\n  |   li TMP2, -1\n  |  beq >1\n  |  checknum CARG3\n  |  checkfail ->fff_fallback\n  |  efdctsiz TMP2, CARG3\n  |1:\n  |  checknum CARG2\n  |  checkfail ->fff_fallback\n  |  checkstr STR:CARG1\n  |   efdctsiz TMP1, CARG2\n  |  checkfail ->fff_fallback\n  |   lwz TMP0, STR:CARG1->len\n  |  cmplw TMP0, TMP2\t\t\t// len < end? (unsigned compare)\n  |   add TMP3, TMP2, TMP0\n  |  blt >5\n  |2:\n  |  cmpwi TMP1, 0\t\t\t// start <= 0?\n  |   add TMP3, TMP1, TMP0\n  |  ble >7\n  |3:\n  |  sub. CARG3, TMP2, TMP1\n  |    addi CARG2, STR:CARG1, #STR-1\n  |   addi CARG3, CARG3, 1\n  |    add CARG2, CARG2, TMP1\n  |  isellt CARG3, r0, CARG3\n  |  b ->fff_newstr\n  |\n  |5:  // Negative end or overflow.\n  |  cmpw TMP0, TMP2\n  |   addi TMP3, TMP3, 1\n  |  iselgt TMP2, TMP3, TMP0\t\t// end = end > len ? len : end+len+1\n  |  b <2\n  |\n  |7:  // Negative start or underflow.\n  |   cmpwi cr1, TMP3, 0\n  |  iseleq TMP1, r0, TMP3\n  |   isel TMP1, r0, TMP1, 4*cr1+lt\n  |  addi TMP1, TMP1, 1\t\t\t// start = 1 + (start ? start+len : 0)\n  |  b <3\n  |\n  |.ffunc string_rep\t\t\t// Only handle the 1-char case inline.\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 16\n  |   evldd CARG1, 0(BASE)\n  |   evldd CARG2, 8(BASE)\n  |  bne ->fff_fallback\t\t\t// Exactly 2 arguments.\n  |  checknum CARG2\n  |  checkfail ->fff_fallback\n  |  checkstr STR:CARG1\n  |   efdctsiz CARG3, CARG2\n  |  checkfail ->fff_fallback\n  |   lwz TMP0, STR:CARG1->len\n  |  cmpwi CARG3, 0\n  |   lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  ble >2\t\t\t\t// Count <= 0? (or non-int)\n  |   cmplwi TMP0, 1\n  |  subi TMP2, CARG3, 1\n  |   blt >2\t\t\t\t// Zero length string?\n  |  cmplw cr1, TMP1, CARG3\n  |   bne ->fff_fallback\t\t// Fallback for > 1-char strings.\n  |   lbz TMP0, STR:CARG1[1]\n  |   lwz CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |  blt cr1, ->fff_fallback\n  |1:  // Fill buffer with char. Yes, this is suboptimal code (do you care?).\n  |  cmplwi TMP2, 0\n  |   stbx TMP0, CARG2, TMP2\n  |   subi TMP2, TMP2, 1\n  |  bne <1\n  |  b ->fff_newstr\n  |2:  // Return empty string.\n  |  la STR:CRET1, DISPATCH_GL(strempty)(DISPATCH)\n  |  evmergelo CRET1, TISSTR, STR:CRET1\n  |  b ->fff_restv\n  |\n  |.ffunc string_reverse\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |  checkstr STR:CARG1\n  |   lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  checkfail ->fff_fallback\n  |  lwz CARG3, STR:CARG1->len\n  |   la CARG1, #STR(STR:CARG1)\n  |   lwz CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |   li TMP2, 0\n  |  cmplw TMP1, CARG3\n  |   subi TMP3, CARG3, 1\n  |  blt ->fff_fallback\n  |1:  // Reverse string copy.\n  |  cmpwi TMP3, 0\n  |   lbzx TMP1, CARG1, TMP2\n  |  blt ->fff_newstr\n  |   stbx TMP1, CARG2, TMP3\n  |  subi TMP3, TMP3, 1\n  |  addi TMP2, TMP2, 1\n  |  b <1\n  |\n  |.macro ffstring_case, name, lo\n  |  .ffunc name\n  |  ffgccheck\n  |  cmplwi NARGS8:RC, 8\n  |   evldd CARG1, 0(BASE)\n  |  blt ->fff_fallback\n  |  checkstr STR:CARG1\n  |   lwz TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)\n  |  checkfail ->fff_fallback\n  |  lwz CARG3, STR:CARG1->len\n  |   la CARG1, #STR(STR:CARG1)\n  |   lwz CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)\n  |  cmplw TMP1, CARG3\n  |   li TMP2, 0\n  |  blt ->fff_fallback\n  |1:  // ASCII case conversion.\n  |  cmplw TMP2, CARG3\n  |   lbzx TMP1, CARG1, TMP2\n  |  bge ->fff_newstr\n  |   subi TMP0, TMP1, lo\n  |    xori TMP3, TMP1, 0x20\n  |   cmplwi TMP0, 26\n  |   isellt TMP1, TMP3, TMP1\n  |   stbx TMP1, CARG2, TMP2\n  |  addi TMP2, TMP2, 1\n  |  b <1\n  |.endmacro\n  |\n  |ffstring_case string_lower, 65\n  |ffstring_case string_upper, 97\n  |\n  |//-- Table library ------------------------------------------------------\n  |\n  |.ffunc_1 table_getn\n  |  checktab CARG1\n  |  checkfail ->fff_fallback\n  |  bl extern lj_tab_len\t\t// (GCtab *t)\n  |  // Returns uint32_t (but less than 2^31).\n  |  efdcfsi CRET1, CRET1\n  |  b ->fff_restv\n  |\n  |//-- Bit library --------------------------------------------------------\n  |\n  |.macro .ffunc_bit, name\n  |  .ffunc_n bit_..name\n  |  efdadd CARG1, CARG1, TOBIT\n  |.endmacro\n  |\n  |.ffunc_bit tobit\n  |->fff_resbit:\n  |  efdcfsi CRET1, CARG1\n  |  b ->fff_restv\n  |\n  |.macro .ffunc_bit_op, name, ins\n  |  .ffunc_bit name\n  |   li TMP1, 8\n  |1:\n  |  evlddx CARG2, BASE, TMP1\n  |  cmplw cr1, TMP1, NARGS8:RC\n  |   checknum CARG2\n  |  bge cr1, ->fff_resbit\n  |   checkfail ->fff_fallback\n  |  efdadd CARG2, CARG2, TOBIT\n  |  ins CARG1, CARG1, CARG2\n  |   addi TMP1, TMP1, 8\n  |  b <1\n  |.endmacro\n  |\n  |.ffunc_bit_op band, and\n  |.ffunc_bit_op bor, or\n  |.ffunc_bit_op bxor, xor\n  |\n  |.ffunc_bit bswap\n  |  rotlwi TMP0, CARG1, 8\n  |  rlwimi TMP0, CARG1, 24, 0, 7\n  |  rlwimi TMP0, CARG1, 24, 16, 23\n  |  efdcfsi CRET1, TMP0\n  |  b ->fff_restv\n  |\n  |.ffunc_bit bnot\n  |  not TMP0, CARG1\n  |  efdcfsi CRET1, TMP0\n  |  b ->fff_restv\n  |\n  |.macro .ffunc_bit_sh, name, ins, shmod\n  |  .ffunc_nn bit_..name\n  |  efdadd CARG2, CARG2, TOBIT\n  |   efdadd CARG1, CARG1, TOBIT\n  |.if shmod == 1\n  |  rlwinm CARG2, CARG2, 0, 27, 31\n  |.elif shmod == 2\n  |  neg CARG2, CARG2\n  |.endif\n  |  ins TMP0, CARG1, CARG2\n  |  efdcfsi CRET1, TMP0\n  |  b ->fff_restv\n  |.endmacro\n  |\n  |.ffunc_bit_sh lshift, slw, 1\n  |.ffunc_bit_sh rshift, srw, 1\n  |.ffunc_bit_sh arshift, sraw, 1\n  |.ffunc_bit_sh rol, rotlw, 0\n  |.ffunc_bit_sh ror, rotlw, 2\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->fff_fallback:\t\t\t// Call fast function fallback handler.\n  |  // BASE = new base, RB = CFUNC, RC = nargs*8\n  |  lwz TMP3, CFUNC:RB->f\n  |    add TMP1, BASE, NARGS8:RC\n  |   lwz PC, FRAME_PC(BASE)\t\t// Fallback may overwrite PC.\n  |    addi TMP0, TMP1, 8*LUA_MINSTACK\n  |     lwz TMP2, L->maxstack\n  |   stw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  cmplw TMP0, TMP2\n  |     stw BASE, L->base\n  |    stw TMP1, L->top\n  |   mr CARG1, L\n  |  bgt >5\t\t\t\t// Need to grow stack.\n  |  mtctr TMP3\n  |  bctrl\t\t\t\t// (lua_State *L)\n  |  // Either throws an error, or recovers and returns -1, 0 or nresults+1.\n  |  lwz BASE, L->base\n  |  cmpwi CRET1, 0\n  |   slwi RD, CRET1, 3\n  |   la RA, -8(BASE)\n  |  bgt ->fff_res\t\t\t// Returned nresults+1?\n  |1:  // Returned 0 or -1: retry fast path.\n  |  lwz TMP0, L->top\n  |   lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |  sub NARGS8:RC, TMP0, BASE\n  |  bne ->vm_call_tail\t\t\t// Returned -1?\n  |  ins_callt\t\t\t\t// Returned 0: retry fast path.\n  |\n  |// Reconstruct previous base for vmeta_call during tailcall.\n  |->vm_call_tail:\n  |  andi. TMP0, PC, FRAME_TYPE\n  |   rlwinm TMP1, PC, 0, 0, 28\n  |  bne >3\n  |  lwz INS, -4(PC)\n  |  decode_RA8 TMP1, INS\n  |  addi TMP1, TMP1, 8\n  |3:\n  |  sub TMP2, BASE, TMP1\n  |  b ->vm_call_dispatch\t\t// Resolve again for tailcall.\n  |\n  |5:  // Grow stack for fallback handler.\n  |  li CARG2, LUA_MINSTACK\n  |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n  |  lwz BASE, L->base\n  |  cmpw TMP0, TMP0\t\t\t// Set 4*cr0+eq to force retry.\n  |  b <1\n  |\n  |->fff_gcstep:\t\t\t// Call GC step function.\n  |  // BASE = new base, RC = nargs*8\n  |  mflr SAVE0\n  |   stw BASE, L->base\n  |  add TMP0, BASE, NARGS8:RC\n  |   stw PC, SAVE_PC\t\t\t// Redundant (but a defined value).\n  |  stw TMP0, L->top\n  |  mr CARG1, L\n  |  bl extern lj_gc_step\t\t// (lua_State *L)\n  |   lwz BASE, L->base\n  |  mtlr SAVE0\n  |    lwz TMP0, L->top\n  |   sub NARGS8:RC, TMP0, BASE\n  |   lwz CFUNC:RB, FRAME_FUNC(BASE)\n  |  blr\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Special dispatch targets -------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_record:\t\t\t\t// Dispatch target for recording phase.\n  |.if JIT\n  |  NYI\n  |.endif\n  |\n  |->vm_rethook:\t\t\t// Dispatch target for return hooks.\n  |  lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  andi. TMP0, TMP3, HOOK_ACTIVE\t// Hook already active?\n  |  beq >1\n  |5:  // Re-dispatch to static ins.\n  |  addi TMP1, TMP1, GG_DISP2STATIC\t// Assumes decode_OP4 TMP1, INS.\n  |  lwzx TMP0, DISPATCH, TMP1\n  |  mtctr TMP0\n  |  bctr\n  |\n  |->vm_inshook:\t\t\t// Dispatch target for instr/line hooks.\n  |  lbz TMP3, DISPATCH_GL(hookmask)(DISPATCH)\n  |  lwz TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  andi. TMP0, TMP3, HOOK_ACTIVE\t// Hook already active?\n  |   rlwinm TMP0, TMP3, 31-LUA_HOOKLINE, 31, 0\n  |  bne <5\n  |\n  |   cmpwi cr1, TMP0, 0\n  |  addic. TMP2, TMP2, -1\n  |   beq cr1, <5\n  |  stw TMP2, DISPATCH_GL(hookcount)(DISPATCH)\n  |  beq >1\n  |   bge cr1, <5\n  |1:\n  |  mr CARG1, L\n  |   stw MULTRES, SAVE_MULTRES\n  |  mr CARG2, PC\n  |   stw BASE, L->base\n  |  // SAVE_PC must hold the _previous_ PC. The callee updates it with PC.\n  |  bl extern lj_dispatch_ins\t\t// (lua_State *L, const BCIns *pc)\n  |3:\n  |  lwz BASE, L->base\n  |4:  // Re-dispatch to static ins.\n  |  lwz INS, -4(PC)\n  |  decode_OP4 TMP1, INS\n  |   decode_RB8 RB, INS\n  |  addi TMP1, TMP1, GG_DISP2STATIC\n  |   decode_RD8 RD, INS\n  |  lwzx TMP0, DISPATCH, TMP1\n  |   decode_RA8 RA, INS\n  |   decode_RC8 RC, INS\n  |  mtctr TMP0\n  |  bctr\n  |\n  |->cont_hook:\t\t\t\t// Continue from hook yield.\n  |  addi PC, PC, 4\n  |  lwz MULTRES, -20(RB)\t\t// Restore MULTRES for *M ins.\n  |  b <4\n  |\n  |->vm_hotloop:\t\t\t// Hot loop counter underflow.\n  |.if JIT\n  |  NYI\n  |.endif\n  |\n  |->vm_callhook:\t\t\t// Dispatch target for call hooks.\n  |  mr CARG2, PC\n  |.if JIT\n  |  b >1\n  |.endif\n  |\n  |->vm_hotcall:\t\t\t// Hot call counter underflow.\n  |.if JIT\n  |  ori CARG2, PC, 1\n  |1:\n  |.endif\n  |  add TMP0, BASE, RC\n  |   stw PC, SAVE_PC\n  |  mr CARG1, L\n  |   stw BASE, L->base\n  |  sub RA, RA, BASE\n  |   stw TMP0, L->top\n  |  bl extern lj_dispatch_call\t\t// (lua_State *L, const BCIns *pc)\n  |  // Returns ASMFunction.\n  |  lwz BASE, L->base\n  |   lwz TMP0, L->top\n  |   stw ZERO, SAVE_PC\t\t\t// Invalidate for subsequent line hook.\n  |  sub NARGS8:RC, TMP0, BASE\n  |  add RA, BASE, RA\n  |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n  |  mtctr CRET1\n  |  bctr\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Trace exit handler -------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_exit_handler:\n  |.if JIT\n  |  NYI\n  |.endif\n  |->vm_exit_interp:\n  |.if JIT\n  |  NYI\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Math helper functions ----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// FP value rounding. Called by math.floor/math.ceil fast functions\n  |// and from JIT code.\n  |//\n  |// This can be inlined if the CPU has the frin/friz/frip/frim instructions.\n  |// The alternative hard-float approaches have a deep dependency chain.\n  |// The resulting latency is at least 3x-7x the double-precision FP latency\n  |// (e500v2: 6cy, e600: 5cy, Cell: 10cy) or around 20-70 cycles.\n  |//\n  |// The soft-float approach is tedious, but much faster (e500v2: ~11cy/~6cy).\n  |// However it relies on a fast way to transfer the FP value to GPRs\n  |// (e500v2: 0cy for lo-word, 1cy for hi-word).\n  |//\n  |.macro vm_round, name, mode\n  |  // Used temporaries: TMP0, TMP1, TMP2, TMP3.\n  |->name.._efd:\t\t\t// Input: CARG2, output: CRET2\n  |  evmergehi CARG1, CARG2, CARG2\n  |->name.._hilo:\n  |  // Input: CARG1 (hi), CARG2 (hi, lo), output: CRET2\n  |  rlwinm TMP2, CARG1, 12, 21, 31\n  |  addic. TMP2, TMP2, -1023\t\t// exp = exponent(x) - 1023\n  |   li TMP1, -1\n  |  cmplwi cr1, TMP2, 51\t\t// 0 <= exp <= 51?\n  |   subfic TMP0, TMP2, 52\n  |  bgt cr1, >1\n  |   lus TMP3, 0xfff0\n  |  slw TMP0, TMP1, TMP0\t\t// lomask = -1 << (52-exp)\n  |   sraw TMP1, TMP3, TMP2\t\t// himask = (int32_t)0xfff00000 >> exp\n  |.if mode == 2\t\t// trunc(x):\n  |  evmergelo TMP0, TMP1, TMP0\n  |  evand CRET2, CARG2, TMP0\t\t// hi &= himask, lo &= lomask\n  |.else\n  |  andc TMP2, CARG2, TMP0\n  |   andc TMP3, CARG1, TMP1\n  |  or TMP2, TMP2, TMP3\t\t// ztest = (hi&~himask) | (lo&~lomask)\n  |   srawi TMP3, CARG1, 31\t\t// signmask = (int32_t)hi >> 31\n  |.if mode == 0\t\t// floor(x):\n  |  and. TMP2, TMP2, TMP3\t\t// iszero = ((ztest & signmask) == 0)\n  |.else\t\t\t// ceil(x):\n  |  andc. TMP2, TMP2, TMP3\t\t// iszero = ((ztest & ~signmask) == 0)\n  |.endif\n  |  and CARG2, CARG2, TMP0\t\t// lo &= lomask\n  |  and CARG1, CARG1, TMP1\t\t// hi &= himask\n  |   subc TMP0, CARG2, TMP0\n  |  iseleq TMP0, CARG2, TMP0\t\t// lo = iszero ? lo : lo-lomask\n  |   sube TMP1, CARG1, TMP1\n  |  iseleq TMP1, CARG1, TMP1\t\t// hi = iszero ? hi : hi-himask+carry\n  |  evmergelo CRET2, TMP1, TMP0\n  |.endif\n  |  blr\n  |1:\n  |  bgtlr\t\t\t\t// Already done if >=2^52, +-inf or nan.\n  |.if mode == 2\t\t// trunc(x):\n  |  rlwinm TMP1, CARG1, 0, 0, 0\t// hi = sign(x)\n  |  li TMP0, 0\n  |  evmergelo CRET2, TMP1, TMP0\n  |.else\n  |  rlwinm TMP2, CARG1, 0, 1, 31\n  |  srawi TMP0, CARG1, 31\t\t// signmask = (int32_t)hi >> 31\n  |  or TMP2, TMP2, CARG2\t\t// ztest = abs(hi) | lo\n  |   lus TMP1, 0x3ff0\n  |.if mode == 0\t\t// floor(x):\n  |  and. TMP2, TMP2, TMP0\t\t// iszero = ((ztest & signmask) == 0)\n  |.else\t\t\t// ceil(x):\n  |  andc. TMP2, TMP2, TMP0\t\t// iszero = ((ztest & ~signmask) == 0)\n  |.endif\n  |   li TMP0, 0\n  |  iseleq TMP1, r0, TMP1\n  |  rlwimi CARG1, TMP1, 0, 1, 31\t// hi = sign(x) | (iszero ? 0.0 : 1.0)\n  |  evmergelo CRET2, CARG1, TMP0\n  |.endif\n  |  blr\n  |.endmacro\n  |\n  |->vm_floor:\n  |  mflr CARG3\n  |  evmergelo CARG2, CARG1, CARG2\n  |  bl ->vm_floor_hilo\n  |  mtlr CARG3\n  |  evmergehi CRET1, CRET2, CRET2\n  |  blr\n  |\n  |  vm_round vm_floor, 0\n  |  vm_round vm_ceil,  1\n  |.if JIT\n  |  vm_round vm_trunc, 2\n  |.else\n  |->vm_trunc_efd:\n  |->vm_trunc_hilo:\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Miscellaneous functions --------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |//-----------------------------------------------------------------------\n  |//-- FFI helper functions -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_ffi_call:\n  |.if FFI\n  |  NYI\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n}\n\n/* Generate the code for a single instruction. */\nstatic void build_ins(BuildCtx *ctx, BCOp op, int defop)\n{\n  int vk = 0;\n  |=>defop:\n\n  switch (op) {\n\n  /* -- Comparison ops ---------------------------------------------------- */\n\n  /* Remember: all ops branch for a true comparison, fall through otherwise. */\n\n  case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:\n    |  // RA = src1*8, RD = src2*8, JMP with RD = target\n    |  evlddx TMP0, BASE, RA\n    |   addi PC, PC, 4\n    |  evlddx TMP1, BASE, RD\n    |   addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n    |   lwz TMP2, -4(PC)\n    |  evmergehi RB, TMP0, TMP1\n    |   decode_RD4 TMP2, TMP2\n    |  checknum RB\n    |   add TMP2, TMP2, TMP3\n    |  checkanyfail ->vmeta_comp\n    |  efdcmplt TMP0, TMP1\n    if (op == BC_ISLE || op == BC_ISGT) {\n      |  efdcmpeq cr1, TMP0, TMP1\n      |  cror 4*cr0+gt, 4*cr0+gt, 4*cr1+gt\n    }\n    if (op == BC_ISLT || op == BC_ISLE) {\n      |  iselgt PC, TMP2, PC\n    } else {\n      |  iselgt PC, PC, TMP2\n    }\n    |  ins_next\n    break;\n\n  case BC_ISEQV: case BC_ISNEV:\n    vk = op == BC_ISEQV;\n    |  // RA = src1*8, RD = src2*8, JMP with RD = target\n    |  evlddx CARG2, BASE, RA\n    |   addi PC, PC, 4\n    |  evlddx CARG3, BASE, RD\n    |   addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n    |   lwz TMP2, -4(PC)\n    |  evmergehi RB, CARG2, CARG3\n    |   decode_RD4 TMP2, TMP2\n    |  checknum RB\n    |   add TMP2, TMP2, TMP3\n    |  checkanyfail >5\n    |  efdcmpeq CARG2, CARG3\n    if (vk) {\n      |  iselgt PC, TMP2, PC\n    } else {\n      |  iselgt PC, PC, TMP2\n    }\n    |1:\n    |  ins_next\n    |\n    |5:  // Either or both types are not numbers.\n    |  evcmpeq CARG2, CARG3\n    |   not TMP3, RB\n    |   cmplwi cr1, TMP3, ~LJ_TISPRI\t\t// Primitive?\n    |  crorc 4*cr7+lt, 4*cr0+so, 4*cr0+lt\t// 1: Same tv or different type.\n    |   cmplwi cr6, TMP3, ~LJ_TISTABUD\t\t// Table or userdata?\n    |  crandc 4*cr7+gt, 4*cr0+lt, 4*cr1+gt\t// 2: Same type and primitive.\n    |   mr SAVE0, PC\n    if (vk) {\n      |  isel PC, TMP2, PC, 4*cr7+gt\n    } else {\n      |  isel TMP2, PC, TMP2, 4*cr7+gt\n    }\n    |  cror 4*cr7+lt, 4*cr7+lt, 4*cr7+gt\t// 1 or 2.\n    if (vk) {\n      |  isel PC, TMP2, PC, 4*cr0+so\n    } else {\n      |  isel PC, PC, TMP2, 4*cr0+so\n    }\n    |  blt cr7, <1\t\t\t// Done if 1 or 2.\n    |  blt cr6, <1\t\t\t// Done if not tab/ud.\n    |\n    |  // Different tables or userdatas. Need to check __eq metamethod.\n    |  // Field metatable must be at same offset for GCtab and GCudata!\n    |  lwz TAB:TMP2, TAB:CARG2->metatable\n    |   li CARG4, 1-vk\t\t\t// ne = 0 or 1.\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable?\n    |  lbz TMP2, TAB:TMP2->nomm\n    |  andi. TMP2, TMP2, 1<<MM_eq\n    |  bne <1\t\t\t\t// Or 'no __eq' flag set?\n    |  mr PC, SAVE0\t\t\t// Restore old PC.\n    |  b ->vmeta_equal\t\t\t// Handle __eq metamethod.\n    break;\n\n  case BC_ISEQS: case BC_ISNES:\n    vk = op == BC_ISEQS;\n    |  // RA = src*8, RD = str_const*8 (~), JMP with RD = target\n    |  evlddx TMP0, BASE, RA\n    |   srwi RD, RD, 1\n    |    lwz INS, 0(PC)\n    |   subfic RD, RD, -4\n    |    addi PC, PC, 4\n    |   lwzx STR:TMP1, KBASE, RD\t// KBASE-4-str_const*4\n    |    addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n    |    decode_RD4 TMP2, INS\n    |   evmergelo STR:TMP1, TISSTR, STR:TMP1\n    |    add TMP2, TMP2, TMP3\n    |  evcmpeq TMP0, STR:TMP1\n    if (vk) {\n      |  isel PC, TMP2, PC, 4*cr0+so\n    } else {\n      |  isel PC, PC, TMP2, 4*cr0+so\n    }\n    |  ins_next\n    break;\n\n  case BC_ISEQN: case BC_ISNEN:\n    vk = op == BC_ISEQN;\n    |  // RA = src*8, RD = num_const*8, JMP with RD = target\n    |  evlddx TMP0, BASE, RA\n    |   addi PC, PC, 4\n    |  evlddx TMP1, KBASE, RD\n    |   addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n    |   lwz INS, -4(PC)\n    |  checknum TMP0\n    |  checkfail >5\n    |  efdcmpeq TMP0, TMP1\n    |1:\n    |   decode_RD4 TMP2, INS\n    |   add TMP2, TMP2, TMP3\n    if (vk) {\n      |  iselgt PC, TMP2, PC\n      |5:\n    } else {\n      |  iselgt PC, PC, TMP2\n    }\n    |3:\n    |  ins_next\n    if (!vk) {\n      |5:\n      |  decode_RD4 TMP2, INS\n      |  add PC, TMP2, TMP3\n      |  b <3\n    }\n    break;\n\n  case BC_ISEQP: case BC_ISNEP:\n    vk = op == BC_ISEQP;\n    |  // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target\n    |  lwzx TMP0, BASE, RA\n    |   srwi TMP1, RD, 3\n    |    lwz INS, 0(PC)\n    |    addi PC, PC, 4\n    |   not TMP1, TMP1\n    |    addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n    |  cmplw TMP0, TMP1\n    |    decode_RD4 TMP2, INS\n    |    add TMP2, TMP2, TMP3\n    if (vk) {\n      |  iseleq PC, TMP2, PC\n    } else {\n      |  iseleq PC, PC, TMP2\n    }\n    |  ins_next\n    break;\n\n  /* -- Unary test and copy ops ------------------------------------------- */\n\n  case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:\n    |  // RA = dst*8 or unused, RD = src*8, JMP with RD = target\n    |  evlddx TMP0, BASE, RD\n    |   evaddw TMP1, TISNIL, TISNIL\t// Synthesize LJ_TFALSE.\n    |   lwz INS, 0(PC)\n    |  evcmpltu TMP0, TMP1\n    |   addi PC, PC, 4\n    if (op == BC_IST || op == BC_ISF) {\n      |  addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n      |  decode_RD4 TMP2, INS\n      |  add TMP2, TMP2, TMP3\n      if (op == BC_IST) {\n\t|  isellt PC, TMP2, PC\n      } else {\n\t|  isellt PC, PC, TMP2\n      }\n    } else {\n      if (op == BC_ISTC) {\n\t|  checkfail >1\n      } else {\n\t|  checkok >1\n      }\n      |  addis PC, PC, -(BCBIAS_J*4 >> 16)\n      |  decode_RD4 TMP2, INS\n      |   evstddx TMP0, BASE, RA\n      |  add PC, PC, TMP2\n      |1:\n    }\n    |  ins_next\n    break;\n\n  /* -- Unary ops --------------------------------------------------------- */\n\n  case BC_MOV:\n    |  // RA = dst*8, RD = src*8\n    |  ins_next1\n    |  evlddx TMP0, BASE, RD\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_NOT:\n    |  // RA = dst*8, RD = src*8\n    |  ins_next1\n    |  lwzx TMP0, BASE, RD\n    |  subfic TMP1, TMP0, LJ_TTRUE\n    |  adde TMP0, TMP0, TMP1\n    |  stwx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_UNM:\n    |  // RA = dst*8, RD = src*8\n    |  evlddx TMP0, BASE, RD\n    |  checknum TMP0\n    |  checkfail ->vmeta_unm\n    |  efdneg TMP0, TMP0\n    |  ins_next1\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_LEN:\n    |  // RA = dst*8, RD = src*8\n    |  evlddx CARG1, BASE, RD\n    |  checkstr CARG1\n    |  checkfail >2\n    |  lwz CRET1, STR:CARG1->len\n    |1:\n    |  ins_next1\n    |  efdcfsi TMP0, CRET1\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    |2:\n    |  checktab CARG1\n    |  checkfail ->vmeta_len\n#if LJ_52\n    |  lwz TAB:TMP2, TAB:CARG1->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  bne >9\n    |3:\n#endif\n    |->BC_LEN_Z:\n    |  bl extern lj_tab_len\t\t// (GCtab *t)\n    |  // Returns uint32_t (but less than 2^31).\n    |  b <1\n#if LJ_52\n    |9:\n    |  lbz TMP0, TAB:TMP2->nomm\n    |  andi. TMP0, TMP0, 1<<MM_len\n    |  bne <3\t\t\t\t// 'no __len' flag set: done.\n    |  b ->vmeta_len\n#endif\n    break;\n\n  /* -- Binary ops -------------------------------------------------------- */\n\n    |.macro ins_arithpre, t0, t1\n    |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8\n    ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);\n    ||switch (vk) {\n    ||case 0:\n    |   evlddx t0, BASE, RB\n    |    checknum t0\n    |   evlddx t1, KBASE, RC\n    |    checkfail ->vmeta_arith_vn\n    ||  break;\n    ||case 1:\n    |   evlddx t1, BASE, RB\n    |    checknum t1\n    |   evlddx t0, KBASE, RC\n    |    checkfail ->vmeta_arith_nv\n    ||  break;\n    ||default:\n    |   evlddx t0, BASE, RB\n    |   evlddx t1, BASE, RC\n    |    evmergehi TMP2, t0, t1\n    |    checknum TMP2\n    |    checkanyfail ->vmeta_arith_vv\n    ||  break;\n    ||}\n    |.endmacro\n    |\n    |.macro ins_arith, ins\n    |  ins_arithpre TMP0, TMP1\n    |  ins_next1\n    |  ins TMP0, TMP0, TMP1\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    |.endmacro\n\n  case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:\n    |  ins_arith efdadd\n    break;\n  case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:\n    |  ins_arith efdsub\n    break;\n  case BC_MULVN: case BC_MULNV: case BC_MULVV:\n    |  ins_arith efdmul\n    break;\n  case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:\n    |  ins_arith efddiv\n    break;\n  case BC_MODVN:\n    |  ins_arithpre RD, SAVE0\n    |->BC_MODVN_Z:\n    |  efddiv CARG2, RD, SAVE0\n    |  bl ->vm_floor_efd\t\t// floor(b/c)\n    |  efdmul TMP0, CRET2, SAVE0\n    |  ins_next1\n    |  efdsub TMP0, RD, TMP0\t\t// b - floor(b/c)*c\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_MODNV: case BC_MODVV:\n    |  ins_arithpre RD, SAVE0\n    |  b ->BC_MODVN_Z\t\t\t// Avoid 3 copies. It's slow anyway.\n    break;\n  case BC_POW:\n    |  evlddx CARG2, BASE, RB\n    |  evlddx CARG4, BASE, RC\n    |  evmergehi CARG1, CARG4, CARG2\n    |  checknum CARG1\n    |   evmergehi CARG3, CARG4, CARG4\n    |  checkanyfail ->vmeta_arith_vv\n    |  bl extern pow\n    |  evmergelo CRET2, CRET1, CRET2\n    |  evstddx CRET2, BASE, RA\n    |  ins_next\n    break;\n\n  case BC_CAT:\n    |  // RA = dst*8, RB = src_start*8, RC = src_end*8\n    |  sub CARG3, RC, RB\n    |   stw BASE, L->base\n    |  add CARG2, BASE, RC\n    |  mr SAVE0, RB\n    |->BC_CAT_Z:\n    |   stw PC, SAVE_PC\n    |  mr CARG1, L\n    |  srwi CARG3, CARG3, 3\n    |  bl extern lj_meta_cat\t\t// (lua_State *L, TValue *top, int left)\n    |  // Returns NULL (finished) or TValue * (metamethod).\n    |  cmplwi CRET1, 0\n    |   lwz BASE, L->base\n    |  bne ->vmeta_binop\n    |  evlddx TMP0, BASE, SAVE0\t\t// Copy result from RB to RA.\n    |  evstddx TMP0, BASE, RA\n    |  ins_next\n    break;\n\n  /* -- Constant ops ------------------------------------------------------ */\n\n  case BC_KSTR:\n    |  // RA = dst*8, RD = str_const*8 (~)\n    |  ins_next1\n    |  srwi TMP1, RD, 1\n    |  subfic TMP1, TMP1, -4\n    |  lwzx TMP0, KBASE, TMP1\t\t// KBASE-4-str_const*4\n    |  evmergelo TMP0, TISSTR, TMP0\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_KCDATA:\n    |.if FFI\n    |  // RA = dst*8, RD = cdata_const*8 (~)\n    |  ins_next1\n    |  srwi TMP1, RD, 1\n    |  subfic TMP1, TMP1, -4\n    |  lwzx TMP0, KBASE, TMP1\t\t// KBASE-4-cdata_const*4\n    |  li TMP2, LJ_TCDATA\n    |  evmergelo TMP0, TMP2, TMP0\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    |.endif\n    break;\n  case BC_KSHORT:\n    |  // RA = dst*8, RD = int16_literal*8\n    |  srwi TMP1, RD, 3\n    |  extsh TMP1, TMP1\n    |  ins_next1\n    |  efdcfsi TMP0, TMP1\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_KNUM:\n    |  // RA = dst*8, RD = num_const*8\n    |  evlddx TMP0, KBASE, RD\n    |  ins_next1\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_KPRI:\n    |  // RA = dst*8, RD = primitive_type*8 (~)\n    |  srwi TMP1, RD, 3\n    |  not TMP0, TMP1\n    |  ins_next1\n    |  stwx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_KNIL:\n    |  // RA = base*8, RD = end*8\n    |  evstddx TISNIL, BASE, RA\n    |   addi RA, RA, 8\n    |1:\n    |  evstddx TISNIL, BASE, RA\n    |  cmpw RA, RD\n    |   addi RA, RA, 8\n    |  blt <1\n    |  ins_next_\n    break;\n\n  /* -- Upvalue and function ops ------------------------------------------ */\n\n  case BC_UGET:\n    |  // RA = dst*8, RD = uvnum*8\n    |  ins_next1\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi RD, RD, 1\n    |   addi RD, RD, offsetof(GCfuncL, uvptr)\n    |  lwzx UPVAL:RB, LFUNC:RB, RD\n    |  lwz TMP1, UPVAL:RB->v\n    |  evldd TMP0, 0(TMP1)\n    |  evstddx TMP0, BASE, RA\n    |  ins_next2\n    break;\n  case BC_USETV:\n    |  // RA = uvnum*8, RD = src*8\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |    srwi RA, RA, 1\n    |    addi RA, RA, offsetof(GCfuncL, uvptr)\n    |   evlddx TMP1, BASE, RD\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |  lbz TMP3, UPVAL:RB->marked\n    |   lwz CARG2, UPVAL:RB->v\n    |  andi. TMP3, TMP3, LJ_GC_BLACK\t// isblack(uv)\n    |    lbz TMP0, UPVAL:RB->closed\n    |   evmergehi TMP2, TMP1, TMP1\n    |   evstdd TMP1, 0(CARG2)\n    |    cmplwi cr1, TMP0, 0\n    |  cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq\n    |   subi TMP2, TMP2, (LJ_TISNUM+1)\n    |  bne >2\t\t\t\t// Upvalue is closed and black?\n    |1:\n    |  ins_next\n    |\n    |2:  // Check if new value is collectable.\n    |  cmplwi TMP2, LJ_TISGCV - (LJ_TISNUM+1)\n    |  bge <1\t\t\t\t// tvisgcv(v)\n    |  lbz TMP3, GCOBJ:TMP1->gch.marked\n    |  andi. TMP3, TMP3, LJ_GC_WHITES\t// iswhite(v)\n    |   la CARG1, GG_DISP2G(DISPATCH)\n    |  // Crossed a write barrier. Move the barrier forward.\n    |  beq <1\n    |  bl extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |  b <1\n    break;\n  case BC_USETS:\n    |  // RA = uvnum*8, RD = str_const*8 (~)\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi TMP1, RD, 1\n    |    srwi RA, RA, 1\n    |   subfic TMP1, TMP1, -4\n    |    addi RA, RA, offsetof(GCfuncL, uvptr)\n    |   lwzx STR:TMP1, KBASE, TMP1\t// KBASE-4-str_const*4\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |   evmergelo STR:TMP1, TISSTR, STR:TMP1\n    |  lbz TMP3, UPVAL:RB->marked\n    |   lwz CARG2, UPVAL:RB->v\n    |  andi. TMP3, TMP3, LJ_GC_BLACK\t// isblack(uv)\n    |   lbz TMP3, STR:TMP1->marked\n    |   lbz TMP2, UPVAL:RB->closed\n    |   evstdd STR:TMP1, 0(CARG2)\n    |  bne >2\n    |1:\n    |  ins_next\n    |\n    |2:  // Check if string is white and ensure upvalue is closed.\n    |  andi. TMP3, TMP3, LJ_GC_WHITES\t// iswhite(str)\n    |   cmplwi cr1, TMP2, 0\n    |  cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq\n    |   la CARG1, GG_DISP2G(DISPATCH)\n    |  // Crossed a write barrier. Move the barrier forward.\n    |  beq <1\n    |  bl extern lj_gc_barrieruv\t// (global_State *g, TValue *tv)\n    |  b <1\n    break;\n  case BC_USETN:\n    |  // RA = uvnum*8, RD = num_const*8\n    |  ins_next1\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi RA, RA, 1\n    |   addi RA, RA, offsetof(GCfuncL, uvptr)\n    |    evlddx TMP0, KBASE, RD\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |  lwz TMP1, UPVAL:RB->v\n    |  evstdd TMP0, 0(TMP1)\n    |  ins_next2\n    break;\n  case BC_USETP:\n    |  // RA = uvnum*8, RD = primitive_type*8 (~)\n    |  ins_next1\n    |  lwz LFUNC:RB, FRAME_FUNC(BASE)\n    |   srwi RA, RA, 1\n    |   addi RA, RA, offsetof(GCfuncL, uvptr)\n    |    srwi TMP0, RD, 3\n    |  lwzx UPVAL:RB, LFUNC:RB, RA\n    |    not TMP0, TMP0\n    |  lwz TMP1, UPVAL:RB->v\n    |  stw TMP0, 0(TMP1)\n    |  ins_next2\n    break;\n\n  case BC_UCLO:\n    |  // RA = level*8, RD = target\n    |  lwz TMP1, L->openupval\n    |  branch_RD\t\t\t// Do this first since RD is not saved.\n    |   stw BASE, L->base\n    |  cmplwi TMP1, 0\n    |   mr CARG1, L\n    |  beq >1\n    |   add CARG2, BASE, RA\n    |  bl extern lj_func_closeuv\t// (lua_State *L, TValue *level)\n    |  lwz BASE, L->base\n    |1:\n    |  ins_next\n    break;\n\n  case BC_FNEW:\n    |  // RA = dst*8, RD = proto_const*8 (~) (holding function prototype)\n    |  srwi TMP1, RD, 1\n    |   stw BASE, L->base\n    |  subfic TMP1, TMP1, -4\n    |   stw PC, SAVE_PC\n    |  lwzx CARG2, KBASE, TMP1\t\t// KBASE-4-tab_const*4\n    |   mr CARG1, L\n    |  lwz CARG3, FRAME_FUNC(BASE)\n    |  // (lua_State *L, GCproto *pt, GCfuncL *parent)\n    |  bl extern lj_func_newL_gc\n    |  // Returns GCfuncL *.\n    |  lwz BASE, L->base\n    |  evmergelo LFUNC:CRET1, TISFUNC, LFUNC:CRET1\n    |  evstddx LFUNC:CRET1, BASE, RA\n    |  ins_next\n    break;\n\n  /* -- Table ops --------------------------------------------------------- */\n\n  case BC_TNEW:\n  case BC_TDUP:\n    |  // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~)\n    |  lwz TMP0, DISPATCH_GL(gc.total)(DISPATCH)\n    |   mr CARG1, L\n    |  lwz TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)\n    |   stw BASE, L->base\n    |  cmplw TMP0, TMP1\n    |   stw PC, SAVE_PC\n    |  bge >5\n    |1:\n    if (op == BC_TNEW) {\n      |  rlwinm CARG2, RD, 29, 21, 31\n      |  rlwinm CARG3, RD, 18, 27, 31\n      |  cmpwi CARG2, 0x7ff\n      |   li TMP1, 0x801\n      |  iseleq CARG2, TMP1, CARG2\n      |  bl extern lj_tab_new  // (lua_State *L, int32_t asize, uint32_t hbits)\n      |  // Returns Table *.\n    } else {\n      |  srwi TMP1, RD, 1\n      |  subfic TMP1, TMP1, -4\n      |  lwzx CARG2, KBASE, TMP1\t\t// KBASE-4-tab_const*4\n      |  bl extern lj_tab_dup  // (lua_State *L, Table *kt)\n      |  // Returns Table *.\n    }\n    |  lwz BASE, L->base\n    |  evmergelo TAB:CRET1, TISTAB, TAB:CRET1\n    |  evstddx TAB:CRET1, BASE, RA\n    |  ins_next\n    |5:\n    |  mr SAVE0, RD\n    |  bl extern lj_gc_step_fixtop  // (lua_State *L)\n    |  mr RD, SAVE0\n    |  mr CARG1, L\n    |  b <1\n    break;\n\n  case BC_GGET:\n    |  // RA = dst*8, RD = str_const*8 (~)\n  case BC_GSET:\n    |  // RA = src*8, RD = str_const*8 (~)\n    |  lwz LFUNC:TMP2, FRAME_FUNC(BASE)\n    |   srwi TMP1, RD, 1\n    |  lwz TAB:RB, LFUNC:TMP2->env\n    |   subfic TMP1, TMP1, -4\n    |   lwzx STR:RC, KBASE, TMP1\t// KBASE-4-str_const*4\n    if (op == BC_GGET) {\n      |  b ->BC_TGETS_Z\n    } else {\n      |  b ->BC_TSETS_Z\n    }\n    break;\n\n  case BC_TGETV:\n    |  // RA = dst*8, RB = table*8, RC = key*8\n    |  evlddx TAB:RB, BASE, RB\n    |   evlddx RC, BASE, RC\n    |  checktab TAB:RB\n    |  checkfail ->vmeta_tgetv\n    |  checknum RC\n    |  checkfail >5\n    |  // Convert number key to integer\n    |  efdctsi TMP2, RC\n    |   lwz TMP0, TAB:RB->asize\n    |  efdcfsi TMP1, TMP2\n    |   cmplw cr0, TMP0, TMP2\n    |  efdcmpeq cr1, RC, TMP1\n    |   lwz TMP1, TAB:RB->array\n    |  crand 4*cr0+gt, 4*cr0+gt, 4*cr1+gt\n    |   slwi TMP2, TMP2, 3\n    |  ble ->vmeta_tgetv\t\t// Integer key and in array part?\n    |  evlddx TMP1, TMP1, TMP2\n    |  checknil TMP1\n    |  checkok >2\n    |1:\n    |  evstddx TMP1, BASE, RA\n    |  ins_next\n    |\n    |2:  // Check for __index if table value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP0, TAB:TMP2->nomm\n    |  andi. TMP0, TMP0, 1<<MM_index\n    |  bne <1\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgetv\n    |\n    |5:\n    |  checkstr STR:RC\t\t\t// String key?\n    |  checkok ->BC_TGETS_Z\n    |  b ->vmeta_tgetv\n    break;\n  case BC_TGETS:\n    |  // RA = dst*8, RB = table*8, RC = str_const*8 (~)\n    |  evlddx TAB:RB, BASE, RB\n    |   srwi TMP1, RC, 1\n    |  checktab TAB:RB\n    |   subfic TMP1, TMP1, -4\n    |   lwzx STR:RC, KBASE, TMP1\t// KBASE-4-str_const*4\n    |  checkfail ->vmeta_tgets1\n    |->BC_TGETS_Z:\n    |  // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8\n    |  lwz TMP0, TAB:RB->hmask\n    |  lwz TMP1, STR:RC->hash\n    |  lwz NODE:TMP2, TAB:RB->node\n    |   evmergelo STR:RC, TISSTR, STR:RC\n    |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n    |  slwi TMP0, TMP1, 5\n    |  slwi TMP1, TMP1, 3\n    |  sub TMP1, TMP0, TMP1\n    |  add NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n    |1:\n    |  evldd TMP0, NODE:TMP2->key\n    |   evldd TMP1, NODE:TMP2->val\n    |  evcmpeq TMP0, STR:RC\n    |  checkanyfail >4\n    |   checknil TMP1\n    |   checkok >5\t\t\t// Key found, but nil value?\n    |3:\n    |   evstddx TMP1, BASE, RA\n    |  ins_next\n    |\n    |4:  // Follow hash chain.\n    |  lwz NODE:TMP2, NODE:TMP2->next\n    |  cmplwi NODE:TMP2, 0\n    |  bne <1\n    |  // End of hash chain: key not found, nil result.\n    |   evmr TMP1, TISNIL\n    |\n    |5:  // Check for __index if table value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <3\t\t\t\t// No metatable: done.\n    |  lbz TMP0, TAB:TMP2->nomm\n    |  andi. TMP0, TMP0, 1<<MM_index\n    |  bne <3\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgets\n    break;\n  case BC_TGETB:\n    |  // RA = dst*8, RB = table*8, RC = index*8\n    |  evlddx TAB:RB, BASE, RB\n    |   srwi TMP0, RC, 3\n    |  checktab TAB:RB\n    |  checkfail ->vmeta_tgetb\n    |  lwz TMP1, TAB:RB->asize\n    |   lwz TMP2, TAB:RB->array\n    |  cmplw TMP0, TMP1\n    |  bge ->vmeta_tgetb\n    |  evlddx TMP1, TMP2, RC\n    |  checknil TMP1\n    |  checkok >5\n    |1:\n    |  ins_next1\n    |  evstddx TMP1, BASE, RA\n    |  ins_next2\n    |\n    |5:  // Check for __index if table value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP2, TAB:TMP2->nomm\n    |  andi. TMP2, TMP2, 1<<MM_index\n    |  bne <1\t\t\t\t// 'no __index' flag set: done.\n    |  b ->vmeta_tgetb\t\t\t// Caveat: preserve TMP0!\n    break;\n\n  case BC_TSETV:\n    |  // RA = src*8, RB = table*8, RC = key*8\n    |  evlddx TAB:RB, BASE, RB\n    |   evlddx RC, BASE, RC\n    |  checktab TAB:RB\n    |  checkfail ->vmeta_tsetv\n    |  checknum RC\n    |  checkfail >5\n    |  // Convert number key to integer\n    |  efdctsi TMP2, RC\n    |    evlddx SAVE0, BASE, RA\n    |   lwz TMP0, TAB:RB->asize\n    |  efdcfsi TMP1, TMP2\n    |   cmplw cr0, TMP0, TMP2\n    |  efdcmpeq cr1, RC, TMP1\n    |   lwz TMP1, TAB:RB->array\n    |  crand 4*cr0+gt, 4*cr0+gt, 4*cr1+gt\n    |   slwi TMP0, TMP2, 3\n    |  ble ->vmeta_tsetv\t\t// Integer key and in array part?\n    |   lbz TMP3, TAB:RB->marked\n    |  evlddx TMP2, TMP1, TMP0\n    |  checknil TMP2\n    |  checkok >3\n    |1:\n    |  andi. TMP2, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |   evstddx SAVE0, TMP1, TMP0\n    |  bne >7\n    |2:\n    |  ins_next\n    |\n    |3:  // Check for __newindex if previous value is nil.\n    |  lwz TAB:TMP2, TAB:RB->metatable\n    |  cmplwi TAB:TMP2, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP2, TAB:TMP2->nomm\n    |  andi. TMP2, TMP2, 1<<MM_newindex\n    |  bne <1\t\t\t\t// 'no __newindex' flag set: done.\n    |  b ->vmeta_tsetv\n    |\n    |5:\n    |  checkstr STR:RC\t\t\t// String key?\n    |  checkok ->BC_TSETS_Z\n    |  b ->vmeta_tsetv\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0\n    |  b <2\n    break;\n  case BC_TSETS:\n    |  // RA = src*8, RB = table*8, RC = str_const*8 (~)\n    |  evlddx TAB:RB, BASE, RB\n    |   srwi TMP1, RC, 1\n    |  checktab TAB:RB\n    |   subfic TMP1, TMP1, -4\n    |   lwzx STR:RC, KBASE, TMP1\t// KBASE-4-str_const*4\n    |  checkfail ->vmeta_tsets1\n    |->BC_TSETS_Z:\n    |  // TAB:RB = GCtab *, STR:RC = GCstr *, RA = src*8\n    |  lwz TMP0, TAB:RB->hmask\n    |  lwz TMP1, STR:RC->hash\n    |  lwz NODE:TMP2, TAB:RB->node\n    |   evmergelo STR:RC, TISSTR, STR:RC\n    |    stb ZERO, TAB:RB->nomm\t\t// Clear metamethod cache.\n    |  and TMP1, TMP1, TMP0\t\t// idx = str->hash & tab->hmask\n    |    evlddx SAVE0, BASE, RA\n    |  slwi TMP0, TMP1, 5\n    |  slwi TMP1, TMP1, 3\n    |  sub TMP1, TMP0, TMP1\n    |    lbz TMP3, TAB:RB->marked\n    |  add NODE:TMP2, NODE:TMP2, TMP1\t// node = tab->node + (idx*32-idx*8)\n    |1:\n    |  evldd TMP0, NODE:TMP2->key\n    |   evldd TMP1, NODE:TMP2->val\n    |  evcmpeq TMP0, STR:RC\n    |  checkanyfail >5\n    |   checknil TMP1\n    |   checkok >4\t\t\t// Key found, but nil value?\n    |2:\n    |  andi. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |    evstdd SAVE0, NODE:TMP2->val\n    |  bne >7\n    |3:\n    |  ins_next\n    |\n    |4:  // Check for __newindex if previous value is nil.\n    |  lwz TAB:TMP1, TAB:RB->metatable\n    |  cmplwi TAB:TMP1, 0\n    |  beq <2\t\t\t\t// No metatable: done.\n    |  lbz TMP0, TAB:TMP1->nomm\n    |  andi. TMP0, TMP0, 1<<MM_newindex\n    |  bne <2\t\t\t\t// 'no __newindex' flag set: done.\n    |  b ->vmeta_tsets\n    |\n    |5:  // Follow hash chain.\n    |  lwz NODE:TMP2, NODE:TMP2->next\n    |  cmplwi NODE:TMP2, 0\n    |  bne <1\n    |  // End of hash chain: key not found, add a new one.\n    |\n    |  // But check for __newindex first.\n    |  lwz TAB:TMP1, TAB:RB->metatable\n    |   la CARG3, DISPATCH_GL(tmptv)(DISPATCH)\n    |   stw PC, SAVE_PC\n    |   mr CARG1, L\n    |  cmplwi TAB:TMP1, 0\n    |   stw BASE, L->base\n    |  beq >6\t\t\t\t// No metatable: continue.\n    |  lbz TMP0, TAB:TMP1->nomm\n    |  andi. TMP0, TMP0, 1<<MM_newindex\n    |  beq ->vmeta_tsets\t\t// 'no __newindex' flag NOT set: check.\n    |6:\n    |  mr CARG2, TAB:RB\n    |  evstdd STR:RC, 0(CARG3)\n    |  bl extern lj_tab_newkey\t\t// (lua_State *L, GCtab *t, TValue *k)\n    |  // Returns TValue *.\n    |  lwz BASE, L->base\n    |  evstdd SAVE0, 0(CRET1)\n    |  b <3\t\t\t\t// No 2nd write barrier needed.\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0\n    |  b <3\n    break;\n  case BC_TSETB:\n    |  // RA = src*8, RB = table*8, RC = index*8\n    |  evlddx TAB:RB, BASE, RB\n    |   srwi TMP0, RC, 3\n    |  checktab TAB:RB\n    |  checkfail ->vmeta_tsetb\n    |  lwz TMP1, TAB:RB->asize\n    |   lwz TMP2, TAB:RB->array\n    |    lbz TMP3, TAB:RB->marked\n    |  cmplw TMP0, TMP1\n    |   evlddx SAVE0, BASE, RA\n    |  bge ->vmeta_tsetb\n    |  evlddx TMP1, TMP2, RC\n    |  checknil TMP1\n    |  checkok >5\n    |1:\n    |  andi. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |   evstddx SAVE0, TMP2, RC\n    |  bne >7\n    |2:\n    |  ins_next\n    |\n    |5:  // Check for __newindex if previous value is nil.\n    |  lwz TAB:TMP1, TAB:RB->metatable\n    |  cmplwi TAB:TMP1, 0\n    |  beq <1\t\t\t\t// No metatable: done.\n    |  lbz TMP1, TAB:TMP1->nomm\n    |  andi. TMP1, TMP1, 1<<MM_newindex\n    |  bne <1\t\t\t\t// 'no __newindex' flag set: done.\n    |  b ->vmeta_tsetb\t\t\t// Caveat: preserve TMP0!\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, TMP3, TMP0\n    |  b <2\n    break;\n\n  case BC_TSETM:\n    |  // RA = base*8 (table at base-1), RD = num_const*8 (start index)\n    |  add RA, BASE, RA\n    |1:\n    |   add TMP3, KBASE, RD\n    |  lwz TAB:CARG2, -4(RA)\t\t// Guaranteed to be a table.\n    |    addic. TMP0, MULTRES, -8\n    |   lwz TMP3, 4(TMP3)\t\t// Integer constant is in lo-word.\n    |    srwi CARG3, TMP0, 3\n    |    beq >4\t\t\t\t// Nothing to copy?\n    |  add CARG3, CARG3, TMP3\n    |  lwz TMP2, TAB:CARG2->asize\n    |   slwi TMP1, TMP3, 3\n    |    lbz TMP3, TAB:CARG2->marked\n    |  cmplw CARG3, TMP2\n    |   add TMP2, RA, TMP0\n    |   lwz TMP0, TAB:CARG2->array\n    |  bgt >5\n    |   add TMP1, TMP1, TMP0\n    |    andi. TMP0, TMP3, LJ_GC_BLACK\t// isblack(table)\n    |3:  // Copy result slots to table.\n    |   evldd TMP0, 0(RA)\n    |  addi RA, RA, 8\n    |  cmpw cr1, RA, TMP2\n    |   evstdd TMP0, 0(TMP1)\n    |    addi TMP1, TMP1, 8\n    |  blt cr1, <3\n    |  bne >7\n    |4:\n    |  ins_next\n    |\n    |5:  // Need to resize array part.\n    |   stw BASE, L->base\n    |  mr CARG1, L\n    |   stw PC, SAVE_PC\n    |  mr SAVE0, RD\n    |  bl extern lj_tab_reasize\t\t// (lua_State *L, GCtab *t, int nasize)\n    |  // Must not reallocate the stack.\n    |  mr RD, SAVE0\n    |  b <1\n    |\n    |7:  // Possible table write barrier for any value. Skip valiswhite check.\n    |  barrierback TAB:CARG2, TMP3, TMP0\n    |  b <4\n    break;\n\n  /* -- Calls and vararg handling ----------------------------------------- */\n\n  case BC_CALLM:\n    |  // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8\n    |  add NARGS8:RC, NARGS8:RC, MULTRES\n    |  // Fall through. Assumes BC_CALL follows.\n    break;\n  case BC_CALL:\n    |  // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8\n    |  evlddx LFUNC:RB, BASE, RA\n    |   mr TMP2, BASE\n    |   add BASE, BASE, RA\n    |    subi NARGS8:RC, NARGS8:RC, 8\n    |  checkfunc LFUNC:RB\n    |   addi BASE, BASE, 8\n    |  checkfail ->vmeta_call\n    |  ins_call\n    break;\n\n  case BC_CALLMT:\n    |  // RA = base*8, (RB = 0,) RC = extra_nargs*8\n    |  add NARGS8:RC, NARGS8:RC, MULTRES\n    |  // Fall through. Assumes BC_CALLT follows.\n    break;\n  case BC_CALLT:\n    |  // RA = base*8, (RB = 0,) RC = (nargs+1)*8\n    |  evlddx LFUNC:RB, BASE, RA\n    |   add RA, BASE, RA\n    |    lwz TMP1, FRAME_PC(BASE)\n    |    subi NARGS8:RC, NARGS8:RC, 8\n    |  checkfunc LFUNC:RB\n    |   addi RA, RA, 8\n    |  checkfail ->vmeta_callt\n    |->BC_CALLT_Z:\n    |  andi. TMP0, TMP1, FRAME_TYPE\t// Caveat: preserve cr0 until the crand.\n    |   lbz TMP3, LFUNC:RB->ffid\n    |    xori TMP2, TMP1, FRAME_VARG\n    |    cmplwi cr1, NARGS8:RC, 0\n    |  bne >7\n    |1:\n    |  stw LFUNC:RB, FRAME_FUNC(BASE)\t// Copy function down, but keep PC.\n    |  li TMP2, 0\n    |   cmplwi cr7, TMP3, 1\t\t// (> FF_C) Calling a fast function?\n    |    beq cr1, >3\n    |2:\n    |  addi TMP3, TMP2, 8\n    |   evlddx TMP0, RA, TMP2\n    |  cmplw cr1, TMP3, NARGS8:RC\n    |   evstddx TMP0, BASE, TMP2\n    |  mr TMP2, TMP3\n    |  bne cr1, <2\n    |3:\n    |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+gt\n    |  beq >5\n    |4:\n    |  ins_callt\n    |\n    |5:  // Tailcall to a fast function with a Lua frame below.\n    |  lwz INS, -4(TMP1)\n    |  decode_RA8 RA, INS\n    |  sub TMP1, BASE, RA\n    |  lwz LFUNC:TMP1, FRAME_FUNC-8(TMP1)\n    |  lwz TMP1, LFUNC:TMP1->pc\n    |  lwz KBASE, PC2PROTO(k)(TMP1)\t// Need to prepare KBASE.\n    |  b <4\n    |\n    |7:  // Tailcall from a vararg function.\n    |  andi. TMP0, TMP2, FRAME_TYPEP\n    |  bne <1\t\t\t\t// Vararg frame below?\n    |  sub BASE, BASE, TMP2\t\t// Relocate BASE down.\n    |  lwz TMP1, FRAME_PC(BASE)\n    |  andi. TMP0, TMP1, FRAME_TYPE\n    |  b <1\n    break;\n\n  case BC_ITERC:\n    |  // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 ((2+1)*8))\n    |  subi RA, RA, 24\t\t\t// evldd doesn't support neg. offsets.\n    |   mr TMP2, BASE\n    |  evlddx LFUNC:RB, BASE, RA\n    |   add BASE, BASE, RA\n    |   evldd TMP0, 8(BASE)\n    |    evldd TMP1, 16(BASE)\n    |  evstdd LFUNC:RB, 24(BASE)\t// Copy callable.\n    |  checkfunc LFUNC:RB\n    |   evstdd TMP0, 32(BASE)\t\t// Copy state.\n    |     li NARGS8:RC, 16\t\t// Iterators get 2 arguments.\n    |    evstdd TMP1, 40(BASE)\t\t// Copy control var.\n    |     addi BASE, BASE, 32\n    |  checkfail ->vmeta_call\n    |  ins_call\n    break;\n\n  case BC_ITERN:\n    |  // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8)\n    |.if JIT\n    |  // NYI: add hotloop, record BC_ITERN.\n    |.endif\n    |  add RA, BASE, RA\n    |  lwz TAB:RB, -12(RA)\n    |  lwz RC, -4(RA)\t\t\t// Get index from control var.\n    |  lwz TMP0, TAB:RB->asize\n    |  lwz TMP1, TAB:RB->array\n    |   addi PC, PC, 4\n    |1:  // Traverse array part.\n    |  cmplw RC, TMP0\n    |   slwi TMP3, RC, 3\n    |  bge >5\t\t\t\t// Index points after array part?\n    |  evlddx TMP2, TMP1, TMP3\n    |  checknil TMP2\n    |     lwz INS, -4(PC)\n    |  checkok >4\n    |   efdcfsi TMP0, RC\n    |    addi RC, RC, 1\n    |     addis TMP3, PC, -(BCBIAS_J*4 >> 16)\n    |  evstdd TMP2, 8(RA)\n    |     decode_RD4 TMP1, INS\n    |    stw RC, -4(RA)\t\t\t// Update control var.\n    |     add PC, TMP1, TMP3\n    |   evstdd TMP0, 0(RA)\n    |3:\n    |  ins_next\n    |\n    |4:  // Skip holes in array part.\n    |  addi RC, RC, 1\n    |  b <1\n    |\n    |5:  // Traverse hash part.\n    |  lwz TMP1, TAB:RB->hmask\n    |  sub RC, RC, TMP0\n    |   lwz TMP2, TAB:RB->node\n    |6:\n    |  cmplw RC, TMP1\t\t\t// End of iteration? Branch to ITERL+1.\n    |   slwi TMP3, RC, 5\n    |  bgt <3\n    |   slwi RB, RC, 3\n    |   sub TMP3, TMP3, RB\n    |  evlddx RB, TMP2, TMP3\n    |   add NODE:TMP3, TMP2, TMP3\n    |  checknil RB\n    |     lwz INS, -4(PC)\n    |  checkok >7\n    |   evldd TMP3, NODE:TMP3->key\n    |     addis TMP2, PC, -(BCBIAS_J*4 >> 16)\n    |  evstdd RB, 8(RA)\n    |    add RC, RC, TMP0\n    |     decode_RD4 TMP1, INS\n    |   evstdd TMP3, 0(RA)\n    |    addi RC, RC, 1\n    |     add PC, TMP1, TMP2\n    |    stw RC, -4(RA)\t\t\t// Update control var.\n    |  b <3\n    |\n    |7:  // Skip holes in hash part.\n    |  addi RC, RC, 1\n    |  b <6\n    break;\n\n  case BC_ISNEXT:\n    |  // RA = base*8, RD = target (points to ITERN)\n    |  add RA, BASE, RA\n    |   li TMP2, -24\n    |  evlddx CFUNC:TMP1, RA, TMP2\n    |   lwz TMP2, -16(RA)\n    |    lwz TMP3, -8(RA)\n    |  evmergehi TMP0, CFUNC:TMP1, CFUNC:TMP1\n    |   cmpwi cr0, TMP2, LJ_TTAB\n    |  cmpwi cr1, TMP0, LJ_TFUNC\n    |    cmpwi cr6, TMP3, LJ_TNIL\n    |  bne cr1, >5\n    |  lbz TMP1, CFUNC:TMP1->ffid\n    |   crand 4*cr0+eq, 4*cr0+eq, 4*cr6+eq\n    |  cmpwi cr7, TMP1, FF_next_N\n    |    srwi TMP0, RD, 1\n    |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq\n    |    add TMP3, PC, TMP0\n    |  bne cr0, >5\n    |  lus TMP1, 0xfffe\n    |  ori TMP1, TMP1, 0x7fff\n    |  stw ZERO, -4(RA)\t\t\t// Initialize control var.\n    |  stw TMP1, -8(RA)\n    |    addis PC, TMP3, -(BCBIAS_J*4 >> 16)\n    |1:\n    |  ins_next\n    |5:  // Despecialize bytecode if any of the checks fail.\n    |  li TMP0, BC_JMP\n    |   li TMP1, BC_ITERC\n    |  stb TMP0, -1(PC)\n    |    addis PC, TMP3, -(BCBIAS_J*4 >> 16)\n    |   stb TMP1, 3(PC)\n    |  b <1\n    break;\n\n  case BC_VARG:\n    |  // RA = base*8, RB = (nresults+1)*8, RC = numparams*8\n    |  lwz TMP0, FRAME_PC(BASE)\n    |  add RC, BASE, RC\n    |   add RA, BASE, RA\n    |  addi RC, RC, FRAME_VARG\n    |   add TMP2, RA, RB\n    |  subi TMP3, BASE, 8\t\t// TMP3 = vtop\n    |  sub RC, RC, TMP0\t\t\t// RC = vbase\n    |  // Note: RC may now be even _above_ BASE if nargs was < numparams.\n    |  cmplwi cr1, RB, 0\n    |   sub. TMP1, TMP3, RC\n    |  beq cr1, >5\t\t\t// Copy all varargs?\n    |   subi TMP2, TMP2, 16\n    |   ble >2\t\t\t\t// No vararg slots?\n    |1:  // Copy vararg slots to destination slots.\n    |  evldd TMP0, 0(RC)\n    |   addi RC, RC, 8\n    |  evstdd TMP0, 0(RA)\n    |  cmplw RA, TMP2\n    |   cmplw cr1, RC, TMP3\n    |  bge >3\t\t\t\t// All destination slots filled?\n    |    addi RA, RA, 8\n    |   blt cr1, <1\t\t\t// More vararg slots?\n    |2:  // Fill up remainder with nil.\n    |  evstdd TISNIL, 0(RA)\n    |  cmplw RA, TMP2\n    |   addi RA, RA, 8\n    |  blt <2\n    |3:\n    |  ins_next\n    |\n    |5:  // Copy all varargs.\n    |  lwz TMP0, L->maxstack\n    |   li MULTRES, 8\t\t\t// MULTRES = (0+1)*8\n    |  ble <3\t\t\t\t// No vararg slots?\n    |  add TMP2, RA, TMP1\n    |  cmplw TMP2, TMP0\n    |   addi MULTRES, TMP1, 8\n    |  bgt >7\n    |6:\n    |  evldd TMP0, 0(RC)\n    |   addi RC, RC, 8\n    |  evstdd TMP0, 0(RA)\n    |  cmplw RC, TMP3\n    |   addi RA, RA, 8\n    |  blt <6\t\t\t\t// More vararg slots?\n    |  b <3\n    |\n    |7:  // Grow stack for varargs.\n    |  mr CARG1, L\n    |   stw RA, L->top\n    |  sub SAVE0, RC, BASE\t\t// Need delta, because BASE may change.\n    |   stw BASE, L->base\n    |  sub RA, RA, BASE\n    |   stw PC, SAVE_PC\n    |  srwi CARG2, TMP1, 3\n    |  bl extern lj_state_growstack\t// (lua_State *L, int n)\n    |  lwz BASE, L->base\n    |  add RA, BASE, RA\n    |  add RC, BASE, SAVE0\n    |  subi TMP3, BASE, 8\n    |  b <6\n    break;\n\n  /* -- Returns ----------------------------------------------------------- */\n\n  case BC_RETM:\n    |  // RA = results*8, RD = extra_nresults*8\n    |  add RD, RD, MULTRES\t\t// MULTRES >= 8, so RD >= 8.\n    |  // Fall through. Assumes BC_RET follows.\n    break;\n\n  case BC_RET:\n    |  // RA = results*8, RD = (nresults+1)*8\n    |  lwz PC, FRAME_PC(BASE)\n    |   add RA, BASE, RA\n    |    mr MULTRES, RD\n    |1:\n    |  andi. TMP0, PC, FRAME_TYPE\n    |   xori TMP1, PC, FRAME_VARG\n    |  bne ->BC_RETV_Z\n    |\n    |->BC_RET_Z:\n    |  // BASE = base, RA = resultptr, RD = (nresults+1)*8, PC = return\n    |   lwz INS, -4(PC)\n    |  cmpwi RD, 8\n    |   subi TMP2, BASE, 8\n    |   subi RC, RD, 8\n    |   decode_RB8 RB, INS\n    |  beq >3\n    |   li TMP1, 0\n    |2:\n    |  addi TMP3, TMP1, 8\n    |   evlddx TMP0, RA, TMP1\n    |  cmpw TMP3, RC\n    |   evstddx TMP0, TMP2, TMP1\n    |  beq >3\n    |  addi TMP1, TMP3, 8\n    |   evlddx TMP0, RA, TMP3\n    |  cmpw TMP1, RC\n    |   evstddx TMP0, TMP2, TMP3\n    |  bne <2\n    |3:\n    |5:\n    |  cmplw RB, RD\n    |   decode_RA8 RA, INS\n    |  bgt >6\n    |   sub BASE, TMP2, RA\n    |  lwz LFUNC:TMP1, FRAME_FUNC(BASE)\n    |  ins_next1\n    |  lwz TMP1, LFUNC:TMP1->pc\n    |  lwz KBASE, PC2PROTO(k)(TMP1)\n    |  ins_next2\n    |\n    |6:  // Fill up results with nil.\n    |  subi TMP1, RD, 8\n    |   addi RD, RD, 8\n    |  evstddx TISNIL, TMP2, TMP1\n    |  b <5\n    |\n    |->BC_RETV_Z:  // Non-standard return case.\n    |  andi. TMP2, TMP1, FRAME_TYPEP\n    |  bne ->vm_return\n    |  // Return from vararg function: relocate BASE down.\n    |  sub BASE, BASE, TMP1\n    |  lwz PC, FRAME_PC(BASE)\n    |  b <1\n    break;\n\n  case BC_RET0: case BC_RET1:\n    |  // RA = results*8, RD = (nresults+1)*8\n    |  lwz PC, FRAME_PC(BASE)\n    |   add RA, BASE, RA\n    |    mr MULTRES, RD\n    |  andi. TMP0, PC, FRAME_TYPE\n    |   xori TMP1, PC, FRAME_VARG\n    |  bne ->BC_RETV_Z\n    |\n    |  lwz INS, -4(PC)\n    |   subi TMP2, BASE, 8\n    |  decode_RB8 RB, INS\n    if (op == BC_RET1) {\n      |  evldd TMP0, 0(RA)\n      |  evstdd TMP0, 0(TMP2)\n    }\n    |5:\n    |  cmplw RB, RD\n    |   decode_RA8 RA, INS\n    |  bgt >6\n    |   sub BASE, TMP2, RA\n    |  lwz LFUNC:TMP1, FRAME_FUNC(BASE)\n    |  ins_next1\n    |  lwz TMP1, LFUNC:TMP1->pc\n    |  lwz KBASE, PC2PROTO(k)(TMP1)\n    |  ins_next2\n    |\n    |6:  // Fill up results with nil.\n    |  subi TMP1, RD, 8\n    |   addi RD, RD, 8\n    |  evstddx TISNIL, TMP2, TMP1\n    |  b <5\n    break;\n\n  /* -- Loops and branches ------------------------------------------------ */\n\n  case BC_FORL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IFORL follows.\n    break;\n\n  case BC_JFORI:\n  case BC_JFORL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_FORI:\n  case BC_IFORL:\n    |  // RA = base*8, RD = target (after end of loop or start of loop)\n    vk = (op == BC_IFORL || op == BC_JFORL);\n    |  add RA, BASE, RA\n    |  evldd TMP1, FORL_IDX*8(RA)\n    |  evldd TMP3, FORL_STEP*8(RA)\n    |  evldd TMP2, FORL_STOP*8(RA)\n    if (!vk) {\n      |  evcmpgtu cr0, TMP1, TISNUM\n      |  evcmpgtu cr7, TMP3, TISNUM\n      |  evcmpgtu cr1, TMP2, TISNUM\n      |  cror 4*cr0+lt, 4*cr0+lt, 4*cr7+lt\n      |  cror 4*cr0+lt, 4*cr0+lt, 4*cr1+lt\n      |  blt ->vmeta_for\n    }\n    if (vk) {\n      |  efdadd TMP1, TMP1, TMP3\n      |  evstdd TMP1, FORL_IDX*8(RA)\n    }\n    |   evcmpgts TMP3, TISNIL\n    |  evstdd TMP1, FORL_EXT*8(RA)\n    |   bge >2\n    |  efdcmpgt TMP1, TMP2\n    |1:\n    if (op != BC_JFORL) {\n      |  srwi RD, RD, 1\n      |  add RD, PC, RD\n      if (op == BC_JFORI) {\n\t|  addis PC, RD, -(BCBIAS_J*4 >> 16)\n      } else {\n\t|  addis RD, RD, -(BCBIAS_J*4 >> 16)\n      }\n    }\n    if (op == BC_FORI) {\n      |  iselgt PC, RD, PC\n    } else if (op == BC_IFORL) {\n      |  iselgt PC, PC, RD\n    } else {\n      |  ble =>BC_JLOOP\n    }\n    |  ins_next\n    |2:\n    |  efdcmpgt TMP2, TMP1\n    |  b <1\n    break;\n\n  case BC_ITERL:\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_IITERL follows.\n    break;\n\n  case BC_JITERL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IITERL:\n    |  // RA = base*8, RD = target\n    |  evlddx TMP1, BASE, RA\n    |   subi RA, RA, 8\n    |  checknil TMP1\n    |  checkok >1\t\t\t// Stop if iterator returned nil.\n    if (op == BC_JITERL) {\n      |  NYI\n    } else {\n      |  branch_RD\t\t\t// Otherwise save control var + branch.\n      |  evstddx TMP1, BASE, RA\n    }\n    |1:\n    |  ins_next\n    break;\n\n  case BC_LOOP:\n    |  // RA = base*8, RD = target (loop extent)\n    |  // Note: RA/RD is only used by trace recorder to determine scope/extent\n    |  // This opcode does NOT jump, it's only purpose is to detect a hot loop.\n    |.if JIT\n    |  hotloop\n    |.endif\n    |  // Fall through. Assumes BC_ILOOP follows.\n    break;\n\n  case BC_ILOOP:\n    |  // RA = base*8, RD = target (loop extent)\n    |  ins_next\n    break;\n\n  case BC_JLOOP:\n    |.if JIT\n    |  NYI\n    |.endif\n    break;\n\n  case BC_JMP:\n    |  // RA = base*8 (only used by trace recorder), RD = target\n    |  branch_RD\n    |  ins_next\n    break;\n\n  /* -- Function headers -------------------------------------------------- */\n\n  case BC_FUNCF:\n    |.if JIT\n    |  hotcall\n    |.endif\n  case BC_FUNCV:  /* NYI: compiled vararg functions. */\n    |  // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow.\n    break;\n\n  case BC_JFUNCF:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IFUNCF:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8\n    |  lwz TMP2, L->maxstack\n    |   lbz TMP1, -4+PC2PROTO(numparams)(PC)\n    |    lwz KBASE, -4+PC2PROTO(k)(PC)\n    |  cmplw RA, TMP2\n    |   slwi TMP1, TMP1, 3\n    |  bgt ->vm_growstack_l\n    |  ins_next1\n    |2:\n    |  cmplw NARGS8:RC, TMP1\t\t// Check for missing parameters.\n    |  ble >3\n    if (op == BC_JFUNCF) {\n      |  NYI\n    } else {\n      |  ins_next2\n    }\n    |\n    |3:  // Clear missing parameters.\n    |  evstddx TISNIL, BASE, NARGS8:RC\n    |  addi NARGS8:RC, NARGS8:RC, 8\n    |  b <2\n    break;\n\n  case BC_JFUNCV:\n#if !LJ_HASJIT\n    break;\n#endif\n    |  NYI  // NYI: compiled vararg functions\n    break;  /* NYI: compiled vararg functions. */\n\n  case BC_IFUNCV:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8\n    |  lwz TMP2, L->maxstack\n    |   add TMP1, BASE, RC\n    |  add TMP0, RA, RC\n    |   stw LFUNC:RB, 4(TMP1)\t\t// Store copy of LFUNC.\n    |   addi TMP3, RC, 8+FRAME_VARG\n    |    lwz KBASE, -4+PC2PROTO(k)(PC)\n    |  cmplw TMP0, TMP2\n    |   stw TMP3, 0(TMP1)\t\t// Store delta + FRAME_VARG.\n    |  bge ->vm_growstack_l\n    |  lbz TMP2, -4+PC2PROTO(numparams)(PC)\n    |   mr RA, BASE\n    |   mr RC, TMP1\n    |  ins_next1\n    |  cmpwi TMP2, 0\n    |   addi BASE, TMP1, 8\n    |  beq >3\n    |1:\n    |  cmplw RA, RC\t\t\t// Less args than parameters?\n    |   evldd TMP0, 0(RA)\n    |  bge >4\n    |    evstdd TISNIL, 0(RA)\t\t// Clear old fixarg slot (help the GC).\n    |    addi RA, RA, 8\n    |2:\n    |  addic. TMP2, TMP2, -1\n    |   evstdd TMP0, 8(TMP1)\n    |    addi TMP1, TMP1, 8\n    |  bne <1\n    |3:\n    |  ins_next2\n    |\n    |4:  // Clear missing parameters.\n    |  evmr TMP0, TISNIL\n    |  b <2\n    break;\n\n  case BC_FUNCC:\n  case BC_FUNCCW:\n    |  // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8\n    if (op == BC_FUNCC) {\n      |  lwz TMP3, CFUNC:RB->f\n    } else {\n      |  lwz TMP3, DISPATCH_GL(wrapf)(DISPATCH)\n    }\n    |   add TMP1, RA, NARGS8:RC\n    |   lwz TMP2, L->maxstack\n    |    add RC, BASE, NARGS8:RC\n    |   stw BASE, L->base\n    |   cmplw TMP1, TMP2\n    |    stw RC, L->top\n    |     li_vmstate C\n    |  mtctr TMP3\n    if (op == BC_FUNCCW) {\n      |  lwz CARG2, CFUNC:RB->f\n    }\n    |  mr CARG1, L\n    |   bgt ->vm_growstack_c\t\t// Need to grow stack.\n    |     st_vmstate\n    |  bctrl\t\t\t\t// (lua_State *L [, lua_CFunction f])\n    |  // Returns nresults.\n    |  lwz TMP1, L->top\n    |   slwi RD, CRET1, 3\n    |  lwz BASE, L->base\n    |    li_vmstate INTERP\n    |  lwz PC, FRAME_PC(BASE)\t\t// Fetch PC of caller.\n    |   sub RA, TMP1, RD\t\t// RA = L->top - nresults*8\n    |    st_vmstate\n    |  b ->vm_returnc\n    break;\n\n  /* ---------------------------------------------------------------------- */\n\n  default:\n    fprintf(stderr, \"Error: undefined opcode BC_%s\\n\", bc_names[op]);\n    exit(2);\n    break;\n  }\n}\n\nstatic int build_backend(BuildCtx *ctx)\n{\n  int op;\n\n  dasm_growpc(Dst, BC__MAX);\n\n  build_subroutines(ctx);\n\n  |.code_op\n  for (op = 0; op < BC__MAX; op++)\n    build_ins(ctx, (BCOp)op, op);\n\n  return BC__MAX;\n}\n\n/* Emit pseudo frame-info for all assembler functions. */\nstatic void emit_asm_debug(BuildCtx *ctx)\n{\n  int i;\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n    fprintf(ctx->fp, \"\\t.section .debug_frame,\\\"\\\",@progbits\\n\");\n    fprintf(ctx->fp,\n\t\".Lframe0:\\n\"\n\t\"\\t.long .LECIE0-.LSCIE0\\n\"\n\t\".LSCIE0:\\n\"\n\t\"\\t.long 0xffffffff\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 65\\n\"\n\t\"\\t.byte 0xc\\n\\t.uleb128 1\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE0:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE0:\\n\"\n\t\"\\t.long .LEFDE0-.LASFDE0\\n\"\n\t\".LASFDE0:\\n\"\n\t\"\\t.long .Lframe0\\n\"\n\t\"\\t.long .Lbegin\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 0x11\\n\\t.uleb128 65\\n\\t.sleb128 -1\\n\"\n\t\"\\t.byte 0x5\\n\\t.uleb128 70\\n\\t.sleb128 37\\n\",\n\t(int)ctx->codesz, CFRAME_SIZE);\n    for (i = 14; i <= 31; i++)\n      fprintf(ctx->fp,\n\t\"\\t.byte %d\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 5\\n\\t.uleb128 %d\\n\\t.uleb128 %d\\n\",\n\t0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i));\n    fprintf(ctx->fp,\n\t\"\\t.align 2\\n\"\n\t\".LEFDE0:\\n\\n\");\n    fprintf(ctx->fp, \"\\t.section .eh_frame,\\\"a\\\",@progbits\\n\");\n    fprintf(ctx->fp,\n\t\".Lframe1:\\n\"\n\t\"\\t.long .LECIE1-.LSCIE1\\n\"\n\t\".LSCIE1:\\n\"\n\t\"\\t.long 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"zPR\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -4\\n\"\n\t\"\\t.byte 65\\n\"\n\t\"\\t.uleb128 6\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.long lj_err_unwind_dwarf-.\\n\"\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.byte 0xc\\n\\t.uleb128 1\\n\\t.uleb128 0\\n\"\n\t\"\\t.align 2\\n\"\n\t\".LECIE1:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE1:\\n\"\n\t\"\\t.long .LEFDE1-.LASFDE1\\n\"\n\t\".LASFDE1:\\n\"\n\t\"\\t.long .LASFDE1-.Lframe1\\n\"\n\t\"\\t.long .Lbegin-.\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.uleb128 0\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 0x11\\n\\t.uleb128 65\\n\\t.sleb128 -1\\n\"\n\t\"\\t.byte 0x5\\n\\t.uleb128 70\\n\\t.sleb128 37\\n\",\n\t(int)ctx->codesz, CFRAME_SIZE);\n    for (i = 14; i <= 31; i++)\n      fprintf(ctx->fp,\n\t\"\\t.byte %d\\n\\t.uleb128 %d\\n\"\n\t\"\\t.byte 5\\n\\t.uleb128 %d\\n\\t.uleb128 %d\\n\",\n\t0x80+i, 1+2*(31-i), 1200+i, 2+2*(31-i));\n    fprintf(ctx->fp,\n\t\"\\t.align 2\\n\"\n\t\".LEFDE1:\\n\\n\");\n    break;\n  default:\n    break;\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/vm_x86.dasc",
    "content": "|// Low-level VM code for x86 CPUs.\n|// Bytecode interpreter, fast functions and helper functions.\n|// Copyright (C) 2005-2013 Mike Pall. See Copyright Notice in luajit.h\n|\n|.if P64\n|.arch x64\n|.else\n|.arch x86\n|.endif\n|.section code_op, code_sub\n|\n|.actionlist build_actionlist\n|.globals GLOB_\n|.globalnames globnames\n|.externnames extnames\n|\n|//-----------------------------------------------------------------------\n|\n|.if P64\n|.define X64, 1\n|.define SSE, 1\n|.if WIN\n|.define X64WIN, 1\n|.endif\n|.endif\n|\n|// Fixed register assignments for the interpreter.\n|// This is very fragile and has many dependencies. Caveat emptor.\n|.define BASE,\t\tedx\t\t// Not C callee-save, refetched anyway.\n|.if not X64\n|.define KBASE,\t\tedi\t\t// Must be C callee-save.\n|.define KBASEa,\tKBASE\n|.define PC,\t\tesi\t\t// Must be C callee-save.\n|.define PCa,\t\tPC\n|.define DISPATCH,\tebx\t\t// Must be C callee-save.\n|.elif X64WIN\n|.define KBASE,\t\tedi\t\t// Must be C callee-save.\n|.define KBASEa,\trdi\n|.define PC,\t\tesi\t\t// Must be C callee-save.\n|.define PCa,\t\trsi\n|.define DISPATCH,\tebx\t\t// Must be C callee-save.\n|.else\n|.define KBASE,\t\tr15d\t\t// Must be C callee-save.\n|.define KBASEa,\tr15\n|.define PC,\t\tebx\t\t// Must be C callee-save.\n|.define PCa,\t\trbx\n|.define DISPATCH,\tr14d\t\t// Must be C callee-save.\n|.endif\n|\n|.define RA,\t\tecx\n|.define RAH,\t\tch\n|.define RAL,\t\tcl\n|.define RB,\t\tebp\t\t// Must be ebp (C callee-save).\n|.define RC,\t\teax\t\t// Must be eax.\n|.define RCW,\t\tax\n|.define RCH,\t\tah\n|.define RCL,\t\tal\n|.define OP,\t\tRB\n|.define RD,\t\tRC\n|.define RDW,\t\tRCW\n|.define RDL,\t\tRCL\n|.if X64\n|.define RAa, rcx\n|.define RBa, rbp\n|.define RCa, rax\n|.define RDa, rax\n|.else\n|.define RAa, RA\n|.define RBa, RB\n|.define RCa, RC\n|.define RDa, RD\n|.endif\n|\n|.if not X64\n|.define FCARG1,\tecx\t\t// x86 fastcall arguments.\n|.define FCARG2,\tedx\n|.elif X64WIN\n|.define CARG1,\t\trcx\t\t// x64/WIN64 C call arguments.\n|.define CARG2,\t\trdx\n|.define CARG3,\t\tr8\n|.define CARG4,\t\tr9\n|.define CARG1d,\tecx\n|.define CARG2d,\tedx\n|.define CARG3d,\tr8d\n|.define CARG4d,\tr9d\n|.define FCARG1,\tCARG1d\t\t// Upwards compatible to x86 fastcall.\n|.define FCARG2,\tCARG2d\n|.else\n|.define CARG1,\t\trdi\t\t// x64/POSIX C call arguments.\n|.define CARG2,\t\trsi\n|.define CARG3,\t\trdx\n|.define CARG4,\t\trcx\n|.define CARG5,\t\tr8\n|.define CARG6,\t\tr9\n|.define CARG1d,\tedi\n|.define CARG2d,\tesi\n|.define CARG3d,\tedx\n|.define CARG4d,\tecx\n|.define CARG5d,\tr8d\n|.define CARG6d,\tr9d\n|.define FCARG1,\tCARG1d\t\t// Simulate x86 fastcall.\n|.define FCARG2,\tCARG2d\n|.endif\n|\n|// Type definitions. Some of these are only used for documentation.\n|.type L,\t\tlua_State\n|.type GL,\t\tglobal_State\n|.type TVALUE,\t\tTValue\n|.type GCOBJ,\t\tGCobj\n|.type STR,\t\tGCstr\n|.type TAB,\t\tGCtab\n|.type LFUNC,\t\tGCfuncL\n|.type CFUNC,\t\tGCfuncC\n|.type PROTO,\t\tGCproto\n|.type UPVAL,\t\tGCupval\n|.type NODE,\t\tNode\n|.type NARGS,\t\tint\n|.type TRACE,\t\tGCtrace\n|\n|// Stack layout while in interpreter. Must match with lj_frame.h.\n|//-----------------------------------------------------------------------\n|.if not X64\t\t// x86 stack layout.\n|\n|.define CFRAME_SPACE,\taword*7\t\t\t// Delta for esp (see <--).\n|.macro saveregs_\n|  push edi; push esi; push ebx\n|  sub esp, CFRAME_SPACE\n|.endmacro\n|.macro saveregs\n|  push ebp; saveregs_\n|.endmacro\n|.macro restoreregs\n|  add esp, CFRAME_SPACE\n|  pop ebx; pop esi; pop edi; pop ebp\n|.endmacro\n|\n|.define SAVE_ERRF,\taword [esp+aword*15]\t// vm_pcall/vm_cpcall only.\n|.define SAVE_NRES,\taword [esp+aword*14]\n|.define SAVE_CFRAME,\taword [esp+aword*13]\n|.define SAVE_L,\taword [esp+aword*12]\n|//----- 16 byte aligned, ^^^ arguments from C caller\n|.define SAVE_RET,\taword [esp+aword*11]\t//<-- esp entering interpreter.\n|.define SAVE_R4,\taword [esp+aword*10]\n|.define SAVE_R3,\taword [esp+aword*9]\n|.define SAVE_R2,\taword [esp+aword*8]\n|//----- 16 byte aligned\n|.define SAVE_R1,\taword [esp+aword*7]\t//<-- esp after register saves.\n|.define SAVE_PC,\taword [esp+aword*6]\n|.define TMP2,\t\taword [esp+aword*5]\n|.define TMP1,\t\taword [esp+aword*4]\n|//----- 16 byte aligned\n|.define ARG4,\t\taword [esp+aword*3]\n|.define ARG3,\t\taword [esp+aword*2]\n|.define ARG2,\t\taword [esp+aword*1]\n|.define ARG1,\t\taword [esp]\t\t//<-- esp while in interpreter.\n|//----- 16 byte aligned, ^^^ arguments for C callee\n|\n|// FPARGx overlaps ARGx and ARG(x+1) on x86.\n|.define FPARG3,\tqword [esp+qword*1]\n|.define FPARG1,\tqword [esp]\n|// TMPQ overlaps TMP1/TMP2. ARG5/MULTRES overlap TMP1/TMP2 (and TMPQ).\n|.define TMPQ,\t\tqword [esp+aword*4]\n|.define TMP3,\t\tARG4\n|.define ARG5,\t\tTMP1\n|.define TMPa,\t\tTMP1\n|.define MULTRES,\tTMP2\n|\n|// Arguments for vm_call and vm_pcall.\n|.define INARG_BASE,\tSAVE_CFRAME\t\t// Overwritten by SAVE_CFRAME!\n|\n|// Arguments for vm_cpcall.\n|.define INARG_CP_CALL,\tSAVE_ERRF\n|.define INARG_CP_UD,\tSAVE_NRES\n|.define INARG_CP_FUNC,\tSAVE_CFRAME\n|\n|//-----------------------------------------------------------------------\n|.elif X64WIN\t\t// x64/Windows stack layout\n|\n|.define CFRAME_SPACE,\taword*5\t\t\t// Delta for rsp (see <--).\n|.macro saveregs_\n|  push rdi; push rsi; push rbx\n|  sub rsp, CFRAME_SPACE\n|.endmacro\n|.macro saveregs\n|  push rbp; saveregs_\n|.endmacro\n|.macro restoreregs\n|  add rsp, CFRAME_SPACE\n|  pop rbx; pop rsi; pop rdi; pop rbp\n|.endmacro\n|\n|.define SAVE_CFRAME,\taword [rsp+aword*13]\n|.define SAVE_PC,\tdword [rsp+dword*25]\n|.define SAVE_L,\tdword [rsp+dword*24]\n|.define SAVE_ERRF,\tdword [rsp+dword*23]\n|.define SAVE_NRES,\tdword [rsp+dword*22]\n|.define TMP2,\t\tdword [rsp+dword*21]\n|.define TMP1,\t\tdword [rsp+dword*20]\n|//----- 16 byte aligned, ^^^ 32 byte register save area, owned by interpreter\n|.define SAVE_RET,\taword [rsp+aword*9]\t//<-- rsp entering interpreter.\n|.define SAVE_R4,\taword [rsp+aword*8]\n|.define SAVE_R3,\taword [rsp+aword*7]\n|.define SAVE_R2,\taword [rsp+aword*6]\n|.define SAVE_R1,\taword [rsp+aword*5]\t//<-- rsp after register saves.\n|.define ARG5,\t\taword [rsp+aword*4]\n|.define CSAVE_4,\taword [rsp+aword*3]\n|.define CSAVE_3,\taword [rsp+aword*2]\n|.define CSAVE_2,\taword [rsp+aword*1]\n|.define CSAVE_1,\taword [rsp]\t\t//<-- rsp while in interpreter.\n|//----- 16 byte aligned, ^^^ 32 byte register save area, owned by callee\n|\n|// TMPQ overlaps TMP1/TMP2. MULTRES overlaps TMP2 (and TMPQ).\n|.define TMPQ,\t\tqword [rsp+aword*10]\n|.define MULTRES,\tTMP2\n|.define TMPa,\t\tARG5\n|.define ARG5d,\t\tdword [rsp+aword*4]\n|.define TMP3,\t\tARG5d\n|\n|//-----------------------------------------------------------------------\n|.else\t\t\t// x64/POSIX stack layout\n|\n|.define CFRAME_SPACE,\taword*5\t\t\t// Delta for rsp (see <--).\n|.macro saveregs_\n|  push rbx; push r15; push r14\n|  sub rsp, CFRAME_SPACE\n|.endmacro\n|.macro saveregs\n|  push rbp; saveregs_\n|.endmacro\n|.macro restoreregs\n|  add rsp, CFRAME_SPACE\n|  pop r14; pop r15; pop rbx; pop rbp\n|.endmacro\n|\n|//----- 16 byte aligned,\n|.define SAVE_RET,\taword [rsp+aword*9]\t//<-- rsp entering interpreter.\n|.define SAVE_R4,\taword [rsp+aword*8]\n|.define SAVE_R3,\taword [rsp+aword*7]\n|.define SAVE_R2,\taword [rsp+aword*6]\n|.define SAVE_R1,\taword [rsp+aword*5]\t//<-- rsp after register saves.\n|.define SAVE_CFRAME,\taword [rsp+aword*4]\n|.define SAVE_PC,\tdword [rsp+dword*7]\n|.define SAVE_L,\tdword [rsp+dword*6]\n|.define SAVE_ERRF,\tdword [rsp+dword*5]\n|.define SAVE_NRES,\tdword [rsp+dword*4]\n|.define TMPa,\t\taword [rsp+aword*1]\n|.define TMP2,\t\tdword [rsp+dword*1]\n|.define TMP1,\t\tdword [rsp]\t\t//<-- rsp while in interpreter.\n|//----- 16 byte aligned\n|\n|// TMPQ overlaps TMP1/TMP2. MULTRES overlaps TMP2 (and TMPQ).\n|.define TMPQ,\t\tqword [rsp]\n|.define TMP3,\t\tdword [rsp+aword*1]\n|.define MULTRES,\tTMP2\n|\n|.endif\n|\n|//-----------------------------------------------------------------------\n|\n|// Instruction headers.\n|.macro ins_A; .endmacro\n|.macro ins_AD; .endmacro\n|.macro ins_AJ; .endmacro\n|.macro ins_ABC; movzx RB, RCH; movzx RC, RCL; .endmacro\n|.macro ins_AB_; movzx RB, RCH; .endmacro\n|.macro ins_A_C; movzx RC, RCL; .endmacro\n|.macro ins_AND; not RDa; .endmacro\n|\n|// Instruction decode+dispatch. Carefully tuned (nope, lodsd is not faster).\n|.macro ins_NEXT\n|  mov RC, [PC]\n|  movzx RA, RCH\n|  movzx OP, RCL\n|  add PC, 4\n|  shr RC, 16\n|.if X64\n|  jmp aword [DISPATCH+OP*8]\n|.else\n|  jmp aword [DISPATCH+OP*4]\n|.endif\n|.endmacro\n|\n|// Instruction footer.\n|.if 1\n|  // Replicated dispatch. Less unpredictable branches, but higher I-Cache use.\n|  .define ins_next, ins_NEXT\n|  .define ins_next_, ins_NEXT\n|.else\n|  // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch.\n|  // Affects only certain kinds of benchmarks (and only with -j off).\n|  // Around 10%-30% slower on Core2, a lot more slower on P4.\n|  .macro ins_next\n|    jmp ->ins_next\n|  .endmacro\n|  .macro ins_next_\n|  ->ins_next:\n|    ins_NEXT\n|  .endmacro\n|.endif\n|\n|// Call decode and dispatch.\n|.macro ins_callt\n|  // BASE = new base, RB = LFUNC, RD = nargs+1, [BASE-4] = PC\n|  mov PC, LFUNC:RB->pc\n|  mov RA, [PC]\n|  movzx OP, RAL\n|  movzx RA, RAH\n|  add PC, 4\n|.if X64\n|  jmp aword [DISPATCH+OP*8]\n|.else\n|  jmp aword [DISPATCH+OP*4]\n|.endif\n|.endmacro\n|\n|.macro ins_call\n|  // BASE = new base, RB = LFUNC, RD = nargs+1\n|  mov [BASE-4], PC\n|  ins_callt\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n|\n|// Macros to test operand types.\n|.macro checktp, reg, tp;  cmp dword [BASE+reg*8+4], tp; .endmacro\n|.macro checknum, reg, target; checktp reg, LJ_TISNUM; jae target; .endmacro\n|.macro checkint, reg, target; checktp reg, LJ_TISNUM; jne target; .endmacro\n|.macro checkstr, reg, target; checktp reg, LJ_TSTR; jne target; .endmacro\n|.macro checktab, reg, target; checktp reg, LJ_TTAB; jne target; .endmacro\n|\n|// These operands must be used with movzx.\n|.define PC_OP, byte [PC-4]\n|.define PC_RA, byte [PC-3]\n|.define PC_RB, byte [PC-1]\n|.define PC_RC, byte [PC-2]\n|.define PC_RD, word [PC-2]\n|\n|.macro branchPC, reg\n|  lea PC, [PC+reg*4-BCBIAS_J*4]\n|.endmacro\n|\n|// Assumes DISPATCH is relative to GL.\n#define DISPATCH_GL(field)\t(GG_DISP2G + (int)offsetof(global_State, field))\n#define DISPATCH_J(field)\t(GG_DISP2J + (int)offsetof(jit_State, field))\n|\n#define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))\n|\n|// Decrement hashed hotcount and trigger trace recorder if zero.\n|.macro hotloop, reg\n|  mov reg, PC\n|  shr reg, 1\n|  and reg, HOTCOUNT_PCMASK\n|  sub word [DISPATCH+reg+GG_DISP2HOT], HOTCOUNT_LOOP\n|  jb ->vm_hotloop\n|.endmacro\n|\n|.macro hotcall, reg\n|  mov reg, PC\n|  shr reg, 1\n|  and reg, HOTCOUNT_PCMASK\n|  sub word [DISPATCH+reg+GG_DISP2HOT], HOTCOUNT_CALL\n|  jb ->vm_hotcall\n|.endmacro\n|\n|// Set current VM state.\n|.macro set_vmstate, st\n|  mov dword [DISPATCH+DISPATCH_GL(vmstate)], ~LJ_VMST_..st\n|.endmacro\n|\n|// x87 compares.\n|.macro fcomparepp\t\t\t// Compare and pop st0 >< st1.\n|  fucomip st1\n|  fpop\n|.endmacro\n|\n|.macro fdup; fld st0; .endmacro\n|.macro fpop1; fstp st1; .endmacro\n|\n|// Synthesize SSE FP constants.\n|.macro sseconst_abs, reg, tmp\t\t// Synthesize abs mask.\n|.if X64\n|  mov64 tmp, U64x(7fffffff,ffffffff); movd reg, tmp\n|.else\n|  pxor reg, reg; pcmpeqd reg, reg; psrlq reg, 1\n|.endif\n|.endmacro\n|\n|.macro sseconst_hi, reg, tmp, val\t// Synthesize hi-32 bit const.\n|.if X64\n|  mov64 tmp, U64x(val,00000000); movd reg, tmp\n|.else\n|  mov tmp, 0x .. val; movd reg, tmp; pshufd reg, reg, 0x51\n|.endif\n|.endmacro\n|\n|.macro sseconst_sign, reg, tmp\t\t// Synthesize sign mask.\n|  sseconst_hi reg, tmp, 80000000\n|.endmacro\n|.macro sseconst_1, reg, tmp\t\t// Synthesize 1.0.\n|  sseconst_hi reg, tmp, 3ff00000\n|.endmacro\n|.macro sseconst_m1, reg, tmp\t\t// Synthesize -1.0.\n|  sseconst_hi reg, tmp, bff00000\n|.endmacro\n|.macro sseconst_2p52, reg, tmp\t\t// Synthesize 2^52.\n|  sseconst_hi reg, tmp, 43300000\n|.endmacro\n|.macro sseconst_tobit, reg, tmp\t// Synthesize 2^52 + 2^51.\n|  sseconst_hi reg, tmp, 43380000\n|.endmacro\n|\n|// Move table write barrier back. Overwrites reg.\n|.macro barrierback, tab, reg\n|  and byte tab->marked, (uint8_t)~LJ_GC_BLACK\t// black2gray(tab)\n|  mov reg, [DISPATCH+DISPATCH_GL(gc.grayagain)]\n|  mov [DISPATCH+DISPATCH_GL(gc.grayagain)], tab\n|  mov tab->gclist, reg\n|.endmacro\n|\n|//-----------------------------------------------------------------------\n\n/* Generate subroutines used by opcodes and other parts of the VM. */\n/* The .code_sub section should be last to help static branch prediction. */\nstatic void build_subroutines(BuildCtx *ctx)\n{\n  |.code_sub\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Return handling ----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_returnp:\n  |  test PC, FRAME_P\n  |  jz ->cont_dispatch\n  |\n  |  // Return from pcall or xpcall fast func.\n  |  and PC, -8\n  |  sub BASE, PC\t\t\t// Restore caller base.\n  |  lea RAa, [RA+PC-8]\t\t\t// Rebase RA and prepend one result.\n  |  mov PC, [BASE-4]\t\t\t// Fetch PC of previous frame.\n  |  // Prepending may overwrite the pcall frame, so do it at the end.\n  |  mov dword [BASE+RA+4], LJ_TTRUE\t// Prepend true to results.\n  |\n  |->vm_returnc:\n  |  add RD, 1\t\t\t\t// RD = nresults+1\n  |  jz ->vm_unwind_yield\n  |  mov MULTRES, RD\n  |  test PC, FRAME_TYPE\n  |  jz ->BC_RET_Z\t\t\t// Handle regular return to Lua.\n  |\n  |->vm_return:\n  |  // BASE = base, RA = resultofs, RD = nresults+1 (= MULTRES), PC = return\n  |  xor PC, FRAME_C\n  |  test PC, FRAME_TYPE\n  |  jnz ->vm_returnp\n  |\n  |  // Return to C.\n  |  set_vmstate C\n  |  and PC, -8\n  |  sub PC, BASE\n  |  neg PC\t\t\t\t// Previous base = BASE - delta.\n  |\n  |  sub RD, 1\n  |  jz >2\n  |1:  // Move results down.\n  |.if X64\n  |  mov RBa, [BASE+RA]\n  |  mov [BASE-8], RBa\n  |.else\n  |  mov RB, [BASE+RA]\n  |  mov [BASE-8], RB\n  |  mov RB, [BASE+RA+4]\n  |  mov [BASE-4], RB\n  |.endif\n  |  add BASE, 8\n  |  sub RD, 1\n  |  jnz <1\n  |2:\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, PC\n  |3:\n  |  mov RD, MULTRES\n  |  mov RA, SAVE_NRES\t\t\t// RA = wanted nresults+1\n  |4:\n  |  cmp RA, RD\n  |  jne >6\t\t\t\t// More/less results wanted?\n  |5:\n  |  sub BASE, 8\n  |  mov L:RB->top, BASE\n  |\n  |->vm_leave_cp:\n  |  mov RAa, SAVE_CFRAME\t\t// Restore previous C frame.\n  |  mov L:RB->cframe, RAa\n  |  xor eax, eax\t\t\t// Ok return status for vm_pcall.\n  |\n  |->vm_leave_unw:\n  |  restoreregs\n  |  ret\n  |\n  |6:\n  |  jb >7\t\t\t\t// Less results wanted?\n  |  // More results wanted. Check stack size and fill up results with nil.\n  |  cmp BASE, L:RB->maxstack\n  |  ja >8\n  |  mov dword [BASE-4], LJ_TNIL\n  |  add BASE, 8\n  |  add RD, 1\n  |  jmp <4\n  |\n  |7:  // Less results wanted.\n  |  test RA, RA\n  |  jz <5\t\t\t\t// But check for LUA_MULTRET+1.\n  |  sub RA, RD\t\t\t\t// Negative result!\n  |  lea BASE, [BASE+RA*8]\t\t// Correct top.\n  |  jmp <5\n  |\n  |8:  // Corner case: need to grow stack for filling up results.\n  |  // This can happen if:\n  |  // - A C function grows the stack (a lot).\n  |  // - The GC shrinks the stack in between.\n  |  // - A return back from a lua_call() with (high) nresults adjustment.\n  |  mov L:RB->top, BASE\t\t// Save current top held in BASE (yes).\n  |  mov MULTRES, RD\t\t\t// Need to fill only remainder with nil.\n  |  mov FCARG2, RA\n  |  mov FCARG1, L:RB\n  |  call extern lj_state_growstack@8\t// (lua_State *L, int n)\n  |  mov BASE, L:RB->top\t\t// Need the (realloced) L->top in BASE.\n  |  jmp <3\n  |\n  |->vm_unwind_yield:\n  |  mov al, LUA_YIELD\n  |  jmp ->vm_unwind_c_eh\n  |\n  |->vm_unwind_c@8:\t\t\t// Unwind C stack, return from vm_pcall.\n  |  // (void *cframe, int errcode)\n  |.if X64\n  |  mov eax, CARG2d\t\t\t// Error return status for vm_pcall.\n  |  mov rsp, CARG1\n  |.else\n  |  mov eax, FCARG2\t\t\t// Error return status for vm_pcall.\n  |  mov esp, FCARG1\n  |.endif\n  |->vm_unwind_c_eh:\t\t\t// Landing pad for external unwinder.\n  |  mov L:RB, SAVE_L\n  |  mov GL:RB, L:RB->glref\n  |  mov dword GL:RB->vmstate, ~LJ_VMST_C\n  |  jmp ->vm_leave_unw\n  |\n  |->vm_unwind_rethrow:\n  |.if X64 and not X64WIN\n  |  mov FCARG1, SAVE_L\n  |  mov FCARG2, eax\n  |  restoreregs\n  |  jmp extern lj_err_throw@8\t\t// (lua_State *L, int errcode)\n  |.endif\n  |\n  |->vm_unwind_ff@4:\t\t\t// Unwind C stack, return from ff pcall.\n  |  // (void *cframe)\n  |.if X64\n  |  and CARG1, CFRAME_RAWMASK\n  |  mov rsp, CARG1\n  |.else\n  |  and FCARG1, CFRAME_RAWMASK\n  |  mov esp, FCARG1\n  |.endif\n  |->vm_unwind_ff_eh:\t\t\t// Landing pad for external unwinder.\n  |  mov L:RB, SAVE_L\n  |  mov RAa, -8\t\t\t// Results start at BASE+RA = BASE-8.\n  |  mov RD, 1+1\t\t\t// Really 1+2 results, incr. later.\n  |  mov BASE, L:RB->base\n  |  mov DISPATCH, L:RB->glref\t\t// Setup pointer to dispatch table.\n  |  add DISPATCH, GG_G2DISP\n  |  mov PC, [BASE-4]\t\t\t// Fetch PC of previous frame.\n  |  mov dword [BASE-4], LJ_TFALSE\t// Prepend false to error message.\n  |  set_vmstate INTERP\n  |  jmp ->vm_returnc\t\t\t// Increments RD/MULTRES and returns.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Grow stack for calls -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_growstack_c:\t\t\t// Grow stack for C function.\n  |  mov FCARG2, LUA_MINSTACK\n  |  jmp >2\n  |\n  |->vm_growstack_v:\t\t\t// Grow stack for vararg Lua function.\n  |  sub RD, 8\n  |  jmp >1\n  |\n  |->vm_growstack_f:\t\t\t// Grow stack for fixarg Lua function.\n  |  // BASE = new base, RD = nargs+1, RB = L, PC = first PC\n  |  lea RD, [BASE+NARGS:RD*8-8]\n  |1:\n  |  movzx RA, byte [PC-4+PC2PROTO(framesize)]\n  |  add PC, 4\t\t\t\t// Must point after first instruction.\n  |  mov L:RB->base, BASE\n  |  mov L:RB->top, RD\n  |  mov SAVE_PC, PC\n  |  mov FCARG2, RA\n  |2:\n  |  // RB = L, L->base = new base, L->top = top\n  |  mov FCARG1, L:RB\n  |  call extern lj_state_growstack@8\t// (lua_State *L, int n)\n  |  mov BASE, L:RB->base\n  |  mov RD, L:RB->top\n  |  mov LFUNC:RB, [BASE-8]\n  |  sub RD, BASE\n  |  shr RD, 3\n  |  add NARGS:RD, 1\n  |  // BASE = new base, RB = LFUNC, RD = nargs+1\n  |  ins_callt\t\t\t\t// Just retry the call.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Entry points into the assembler VM ---------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_resume:\t\t\t\t// Setup C frame and resume thread.\n  |  // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0)\n  |  saveregs\n  |.if X64\n  |  mov L:RB, CARG1d\t\t\t// Caveat: CARG1d may be RA.\n  |  mov SAVE_L, CARG1d\n  |  mov RA, CARG2d\n  |.else\n  |  mov L:RB, SAVE_L\n  |  mov RA, INARG_BASE\t\t\t// Caveat: overlaps SAVE_CFRAME!\n  |.endif\n  |  mov PC, FRAME_CP\n  |  xor RD, RD\n  |  lea KBASEa, [esp+CFRAME_RESUME]\n  |  mov DISPATCH, L:RB->glref\t\t// Setup pointer to dispatch table.\n  |  add DISPATCH, GG_G2DISP\n  |  mov L:RB->cframe, KBASEa\n  |  mov SAVE_PC, RD\t\t\t// Any value outside of bytecode is ok.\n  |  mov SAVE_CFRAME, RDa\n  |.if X64\n  |  mov SAVE_NRES, RD\n  |  mov SAVE_ERRF, RD\n  |.endif\n  |  cmp byte L:RB->status, RDL\n  |  je >3\t\t\t\t// Initial resume (like a call).\n  |\n  |  // Resume after yield (like a return).\n  |  set_vmstate INTERP\n  |  mov byte L:RB->status, RDL\n  |  mov BASE, L:RB->base\n  |  mov RD, L:RB->top\n  |  sub RD, RA\n  |  shr RD, 3\n  |  add RD, 1\t\t\t\t// RD = nresults+1\n  |  sub RA, BASE\t\t\t// RA = resultofs\n  |  mov PC, [BASE-4]\n  |  mov MULTRES, RD\n  |  test PC, FRAME_TYPE\n  |  jz ->BC_RET_Z\n  |  jmp ->vm_return\n  |\n  |->vm_pcall:\t\t\t\t// Setup protected C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef)\n  |  saveregs\n  |  mov PC, FRAME_CP\n  |.if X64\n  |  mov SAVE_ERRF, CARG4d\n  |.endif\n  |  jmp >1\n  |\n  |->vm_call:\t\t\t\t// Setup C frame and enter VM.\n  |  // (lua_State *L, TValue *base, int nres1)\n  |  saveregs\n  |  mov PC, FRAME_C\n  |\n  |1:  // Entry point for vm_pcall above (PC = ftype).\n  |.if X64\n  |  mov SAVE_NRES, CARG3d\n  |  mov L:RB, CARG1d\t\t\t// Caveat: CARG1d may be RA.\n  |  mov SAVE_L, CARG1d\n  |  mov RA, CARG2d\n  |.else\n  |  mov L:RB, SAVE_L\n  |  mov RA, INARG_BASE\t\t\t// Caveat: overlaps SAVE_CFRAME!\n  |.endif\n  |\n  |  mov KBASEa, L:RB->cframe\t\t// Add our C frame to cframe chain.\n  |  mov SAVE_CFRAME, KBASEa\n  |  mov SAVE_PC, L:RB\t\t\t// Any value outside of bytecode is ok.\n  |.if X64\n  |  mov L:RB->cframe, rsp\n  |.else\n  |  mov L:RB->cframe, esp\n  |.endif\n  |\n  |2:  // Entry point for vm_cpcall below (RA = base, RB = L, PC = ftype).\n  |  mov DISPATCH, L:RB->glref\t\t// Setup pointer to dispatch table.\n  |  add DISPATCH, GG_G2DISP\n  |\n  |3:  // Entry point for vm_resume above (RA = base, RB = L, PC = ftype).\n  |  set_vmstate INTERP\n  |  mov BASE, L:RB->base\t\t// BASE = old base (used in vmeta_call).\n  |  add PC, RA\n  |  sub PC, BASE\t\t\t// PC = frame delta + frame type\n  |\n  |  mov RD, L:RB->top\n  |  sub RD, RA\n  |  shr NARGS:RD, 3\n  |  add NARGS:RD, 1\t\t\t// RD = nargs+1\n  |\n  |->vm_call_dispatch:\n  |  mov LFUNC:RB, [RA-8]\n  |  cmp dword [RA-4], LJ_TFUNC\n  |  jne ->vmeta_call\t\t\t// Ensure KBASE defined and != BASE.\n  |\n  |->vm_call_dispatch_f:\n  |  mov BASE, RA\n  |  ins_call\n  |  // BASE = new base, RB = func, RD = nargs+1, PC = caller PC\n  |\n  |->vm_cpcall:\t\t\t\t// Setup protected C frame, call C.\n  |  // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp)\n  |  saveregs\n  |.if X64\n  |  mov L:RB, CARG1d\t\t\t// Caveat: CARG1d may be RA.\n  |  mov SAVE_L, CARG1d\n  |.else\n  |  mov L:RB, SAVE_L\n  |  // Caveat: INARG_CP_* and SAVE_CFRAME/SAVE_NRES/SAVE_ERRF overlap!\n  |  mov RC, INARG_CP_UD\t\t// Get args before they are overwritten.\n  |  mov RA, INARG_CP_FUNC\n  |  mov BASE, INARG_CP_CALL\n  |.endif\n  |  mov SAVE_PC, L:RB\t\t\t// Any value outside of bytecode is ok.\n  |\n  |  mov KBASE, L:RB->stack\t\t// Compute -savestack(L, L->top).\n  |  sub KBASE, L:RB->top\n  |  mov SAVE_ERRF, 0\t\t\t// No error function.\n  |  mov SAVE_NRES, KBASE\t\t// Neg. delta means cframe w/o frame.\n  |  // Handler may change cframe_nres(L->cframe) or cframe_errfunc(L->cframe).\n  |\n  |.if X64\n  |  mov KBASEa, L:RB->cframe\t\t// Add our C frame to cframe chain.\n  |  mov SAVE_CFRAME, KBASEa\n  |  mov L:RB->cframe, rsp\n  |\n  |  call CARG4\t\t\t// (lua_State *L, lua_CFunction func, void *ud)\n  |.else\n  |  mov ARG3, RC\t\t\t// Have to copy args downwards.\n  |  mov ARG2, RA\n  |  mov ARG1, L:RB\n  |\n  |  mov KBASE, L:RB->cframe\t\t// Add our C frame to cframe chain.\n  |  mov SAVE_CFRAME, KBASE\n  |  mov L:RB->cframe, esp\n  |\n  |  call BASE\t\t\t// (lua_State *L, lua_CFunction func, void *ud)\n  |.endif\n  |  // TValue * (new base) or NULL returned in eax (RC).\n  |  test RC, RC\n  |  jz ->vm_leave_cp\t\t\t// No base? Just remove C frame.\n  |  mov RA, RC\n  |  mov PC, FRAME_CP\n  |  jmp <2\t\t\t\t// Else continue with the call.\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Metamethod handling ------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |//-- Continuation dispatch ----------------------------------------------\n  |\n  |->cont_dispatch:\n  |  // BASE = meta base, RA = resultofs, RD = nresults+1 (also in MULTRES)\n  |  add RA, BASE\n  |  and PC, -8\n  |  mov RB, BASE\n  |  sub BASE, PC\t\t\t// Restore caller BASE.\n  |  mov dword [RA+RD*8-4], LJ_TNIL\t// Ensure one valid arg.\n  |  mov RC, RA\t\t\t\t// ... in [RC]\n  |  mov PC, [RB-12]\t\t\t// Restore PC from [cont|PC].\n  |.if X64\n  |  movsxd RAa, dword [RB-16]\t\t// May be negative on WIN64 with debug.\n  |.if FFI\n  |  cmp RA, 1\n  |  jbe >1\n  |.endif\n  |  lea KBASEa, qword [=>0]\n  |  add RAa, KBASEa\n  |.else\n  |  mov RA, dword [RB-16]\n  |.if FFI\n  |  cmp RA, 1\n  |  jbe >1\n  |.endif\n  |.endif\n  |  mov LFUNC:KBASE, [BASE-8]\n  |  mov KBASE, LFUNC:KBASE->pc\n  |  mov KBASE, [KBASE+PC2PROTO(k)]\n  |  // BASE = base, RC = result, RB = meta base\n  |  jmp RAa\t\t\t\t// Jump to continuation.\n  |\n  |.if FFI\n  |1:\n  |  je ->cont_ffi_callback\t\t// cont = 1: return from FFI callback.\n  |  // cont = 0: Tail call from C function.\n  |  sub RB, BASE\n  |  shr RB, 3\n  |  lea RD, [RB-1]\n  |  jmp ->vm_call_tail\n  |.endif\n  |\n  |->cont_cat:\t\t\t\t// BASE = base, RC = result, RB = mbase\n  |  movzx RA, PC_RB\n  |  sub RB, 16\n  |  lea RA, [BASE+RA*8]\n  |  sub RA, RB\n  |  je ->cont_ra\n  |  neg RA\n  |  shr RA, 3\n  |.if X64WIN\n  |  mov CARG3d, RA\n  |  mov L:CARG1d, SAVE_L\n  |  mov L:CARG1d->base, BASE\n  |  mov RCa, [RC]\n  |  mov [RB], RCa\n  |  mov CARG2d, RB\n  |.elif X64\n  |  mov L:CARG1d, SAVE_L\n  |  mov L:CARG1d->base, BASE\n  |  mov CARG3d, RA\n  |  mov RAa, [RC]\n  |  mov [RB], RAa\n  |  mov CARG2d, RB\n  |.else\n  |  mov ARG3, RA\n  |  mov RA, [RC+4]\n  |  mov RC, [RC]\n  |  mov [RB+4], RA\n  |  mov [RB], RC\n  |  mov ARG2, RB\n  |.endif\n  |  jmp ->BC_CAT_Z\n  |\n  |//-- Table indexing metamethods -----------------------------------------\n  |\n  |->vmeta_tgets:\n  |  mov TMP1, RC\t\t\t// RC = GCstr *\n  |  mov TMP2, LJ_TSTR\n  |  lea RCa, TMP1\t\t\t// Store temp. TValue in TMP1/TMP2.\n  |  cmp PC_OP, BC_GGET\n  |  jne >1\n  |  lea RA, [DISPATCH+DISPATCH_GL(tmptv)]  // Store fn->l.env in g->tmptv.\n  |  mov [RA], TAB:RB\t\t\t// RB = GCtab *\n  |  mov dword [RA+4], LJ_TTAB\n  |  mov RB, RA\n  |  jmp >2\n  |\n  |->vmeta_tgetb:\n  |  movzx RC, PC_RC\n  |.if DUALNUM\n  |  mov TMP2, LJ_TISNUM\n  |  mov TMP1, RC\n  |.elif SSE\n  |  cvtsi2sd xmm0, RC\n  |  movsd TMPQ, xmm0\n  |.else\n  |  mov ARG4, RC\n  |  fild ARG4\n  |  fstp TMPQ\n  |.endif\n  |  lea RCa, TMPQ\t\t\t// Store temp. TValue in TMPQ.\n  |  jmp >1\n  |\n  |->vmeta_tgetv:\n  |  movzx RC, PC_RC\t\t\t// Reload TValue *k from RC.\n  |  lea RC, [BASE+RC*8]\n  |1:\n  |  movzx RB, PC_RB\t\t\t// Reload TValue *t from RB.\n  |  lea RB, [BASE+RB*8]\n  |2:\n  |.if X64\n  |  mov L:CARG1d, SAVE_L\n  |  mov L:CARG1d->base, BASE\t\t// Caveat: CARG2d/CARG3d may be BASE.\n  |  mov CARG2d, RB\n  |  mov CARG3, RCa\t\t\t// May be 64 bit ptr to stack.\n  |  mov L:RB, L:CARG1d\n  |.else\n  |  mov ARG2, RB\n  |  mov L:RB, SAVE_L\n  |  mov ARG3, RC\n  |  mov ARG1, L:RB\n  |  mov L:RB->base, BASE\n  |.endif\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_tget\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // TValue * (finished) or NULL (metamethod) returned in eax (RC).\n  |  mov BASE, L:RB->base\n  |  test RC, RC\n  |  jz >3\n  |->cont_ra:\t\t\t\t// BASE = base, RC = result\n  |  movzx RA, PC_RA\n  |.if X64\n  |  mov RBa, [RC]\n  |  mov [BASE+RA*8], RBa\n  |.else\n  |  mov RB, [RC+4]\n  |  mov RC, [RC]\n  |  mov [BASE+RA*8+4], RB\n  |  mov [BASE+RA*8], RC\n  |.endif\n  |  ins_next\n  |\n  |3:  // Call __index metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k\n  |  mov RA, L:RB->top\n  |  mov [RA-12], PC\t\t\t// [cont|PC]\n  |  lea PC, [RA+FRAME_CONT]\n  |  sub PC, BASE\n  |  mov LFUNC:RB, [RA-8]\t\t// Guaranteed to be a function here.\n  |  mov NARGS:RD, 2+1\t\t\t// 2 args for func(t, k).\n  |  jmp ->vm_call_dispatch_f\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->vmeta_tsets:\n  |  mov TMP1, RC\t\t\t// RC = GCstr *\n  |  mov TMP2, LJ_TSTR\n  |  lea RCa, TMP1\t\t\t// Store temp. TValue in TMP1/TMP2.\n  |  cmp PC_OP, BC_GSET\n  |  jne >1\n  |  lea RA, [DISPATCH+DISPATCH_GL(tmptv)]  // Store fn->l.env in g->tmptv.\n  |  mov [RA], TAB:RB\t\t\t// RB = GCtab *\n  |  mov dword [RA+4], LJ_TTAB\n  |  mov RB, RA\n  |  jmp >2\n  |\n  |->vmeta_tsetb:\n  |  movzx RC, PC_RC\n  |.if DUALNUM\n  |  mov TMP2, LJ_TISNUM\n  |  mov TMP1, RC\n  |.elif SSE\n  |  cvtsi2sd xmm0, RC\n  |  movsd TMPQ, xmm0\n  |.else\n  |  mov ARG4, RC\n  |  fild ARG4\n  |  fstp TMPQ\n  |.endif\n  |  lea RCa, TMPQ\t\t\t// Store temp. TValue in TMPQ.\n  |  jmp >1\n  |\n  |->vmeta_tsetv:\n  |  movzx RC, PC_RC\t\t\t// Reload TValue *k from RC.\n  |  lea RC, [BASE+RC*8]\n  |1:\n  |  movzx RB, PC_RB\t\t\t// Reload TValue *t from RB.\n  |  lea RB, [BASE+RB*8]\n  |2:\n  |.if X64\n  |  mov L:CARG1d, SAVE_L\n  |  mov L:CARG1d->base, BASE\t\t// Caveat: CARG2d/CARG3d may be BASE.\n  |  mov CARG2d, RB\n  |  mov CARG3, RCa\t\t\t// May be 64 bit ptr to stack.\n  |  mov L:RB, L:CARG1d\n  |.else\n  |  mov ARG2, RB\n  |  mov L:RB, SAVE_L\n  |  mov ARG3, RC\n  |  mov ARG1, L:RB\n  |  mov L:RB->base, BASE\n  |.endif\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_tset\t\t// (lua_State *L, TValue *o, TValue *k)\n  |  // TValue * (finished) or NULL (metamethod) returned in eax (RC).\n  |  mov BASE, L:RB->base\n  |  test RC, RC\n  |  jz >3\n  |  // NOBARRIER: lj_meta_tset ensures the table is not black.\n  |  movzx RA, PC_RA\n  |.if X64\n  |  mov RBa, [BASE+RA*8]\n  |  mov [RC], RBa\n  |.else\n  |  mov RB, [BASE+RA*8+4]\n  |  mov RA, [BASE+RA*8]\n  |  mov [RC+4], RB\n  |  mov [RC], RA\n  |.endif\n  |->cont_nop:\t\t\t\t// BASE = base, (RC = result)\n  |  ins_next\n  |\n  |3:  // Call __newindex metamethod.\n  |  // BASE = base, L->top = new base, stack = cont/func/t/k/(v)\n  |  mov RA, L:RB->top\n  |  mov [RA-12], PC\t\t\t// [cont|PC]\n  |  movzx RC, PC_RA\n  |  // Copy value to third argument.\n  |.if X64\n  |  mov RBa, [BASE+RC*8]\n  |  mov [RA+16], RBa\n  |.else\n  |  mov RB, [BASE+RC*8+4]\n  |  mov RC, [BASE+RC*8]\n  |  mov [RA+20], RB\n  |  mov [RA+16], RC\n  |.endif\n  |  lea PC, [RA+FRAME_CONT]\n  |  sub PC, BASE\n  |  mov LFUNC:RB, [RA-8]\t\t// Guaranteed to be a function here.\n  |  mov NARGS:RD, 3+1\t\t\t// 3 args for func(t, k, v).\n  |  jmp ->vm_call_dispatch_f\n  |\n  |//-- Comparison metamethods ---------------------------------------------\n  |\n  |->vmeta_comp:\n  |.if X64\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\t\t// Caveat: CARG2d/CARG3d == BASE.\n  |.if X64WIN\n  |  lea CARG3d, [BASE+RD*8]\n  |  lea CARG2d, [BASE+RA*8]\n  |.else\n  |  lea CARG2d, [BASE+RA*8]\n  |  lea CARG3d, [BASE+RD*8]\n  |.endif\n  |  mov CARG1d, L:RB\t\t\t// Caveat: CARG1d/CARG4d == RA.\n  |  movzx CARG4d, PC_OP\n  |.else\n  |  movzx RB, PC_OP\n  |  lea RD, [BASE+RD*8]\n  |  lea RA, [BASE+RA*8]\n  |  mov ARG4, RB\n  |  mov L:RB, SAVE_L\n  |  mov ARG3, RD\n  |  mov ARG2, RA\n  |  mov ARG1, L:RB\n  |  mov L:RB->base, BASE\n  |.endif\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_comp\t// (lua_State *L, TValue *o1, *o2, int op)\n  |  // 0/1 or TValue * (metamethod) returned in eax (RC).\n  |3:\n  |  mov BASE, L:RB->base\n  |  cmp RC, 1\n  |  ja ->vmeta_binop\n  |4:\n  |  lea PC, [PC+4]\n  |  jb >6\n  |5:\n  |  movzx RD, PC_RD\n  |  branchPC RD\n  |6:\n  |  ins_next\n  |\n  |->cont_condt:\t\t\t// BASE = base, RC = result\n  |  add PC, 4\n  |  cmp dword [RC+4], LJ_TISTRUECOND\t// Branch if result is true.\n  |  jb <5\n  |  jmp <6\n  |\n  |->cont_condf:\t\t\t// BASE = base, RC = result\n  |  cmp dword [RC+4], LJ_TISTRUECOND\t// Branch if result is false.\n  |  jmp <4\n  |\n  |->vmeta_equal:\n  |  sub PC, 4\n  |.if X64WIN\n  |  mov CARG3d, RD\n  |  mov CARG4d, RB\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\t\t// Caveat: CARG2d == BASE.\n  |  mov CARG2d, RA\n  |  mov CARG1d, L:RB\t\t\t// Caveat: CARG1d == RA.\n  |.elif X64\n  |  mov CARG2d, RA\n  |  mov CARG4d, RB\t\t\t// Caveat: CARG4d == RA.\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\t\t// Caveat: CARG3d == BASE.\n  |  mov CARG3d, RD\n  |  mov CARG1d, L:RB\n  |.else\n  |  mov ARG4, RB\n  |  mov L:RB, SAVE_L\n  |  mov ARG3, RD\n  |  mov ARG2, RA\n  |  mov ARG1, L:RB\n  |  mov L:RB->base, BASE\n  |.endif\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_equal\t// (lua_State *L, GCobj *o1, *o2, int ne)\n  |  // 0/1 or TValue * (metamethod) returned in eax (RC).\n  |  jmp <3\n  |\n  |->vmeta_equal_cd:\n  |.if FFI\n  |  sub PC, 4\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |  mov FCARG1, L:RB\n  |  mov FCARG2, dword [PC-4]\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_equal_cd@8\t// (lua_State *L, BCIns ins)\n  |  // 0/1 or TValue * (metamethod) returned in eax (RC).\n  |  jmp <3\n  |.endif\n  |\n  |//-- Arithmetic metamethods ---------------------------------------------\n  |\n  |->vmeta_arith_vno:\n  |.if DUALNUM\n  |  movzx RB, PC_RB\n  |.endif\n  |->vmeta_arith_vn:\n  |  lea RC, [KBASE+RC*8]\n  |  jmp >1\n  |\n  |->vmeta_arith_nvo:\n  |.if DUALNUM\n  |  movzx RC, PC_RC\n  |.endif\n  |->vmeta_arith_nv:\n  |  lea RC, [KBASE+RC*8]\n  |  lea RB, [BASE+RB*8]\n  |  xchg RB, RC\n  |  jmp >2\n  |\n  |->vmeta_unm:\n  |  lea RC, [BASE+RD*8]\n  |  mov RB, RC\n  |  jmp >2\n  |\n  |->vmeta_arith_vvo:\n  |.if DUALNUM\n  |  movzx RB, PC_RB\n  |.endif\n  |->vmeta_arith_vv:\n  |  lea RC, [BASE+RC*8]\n  |1:\n  |  lea RB, [BASE+RB*8]\n  |2:\n  |  lea RA, [BASE+RA*8]\n  |.if X64WIN\n  |  mov CARG3d, RB\n  |  mov CARG4d, RC\n  |  movzx RC, PC_OP\n  |  mov ARG5d, RC\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\t\t// Caveat: CARG2d == BASE.\n  |  mov CARG2d, RA\n  |  mov CARG1d, L:RB\t\t\t// Caveat: CARG1d == RA.\n  |.elif X64\n  |  movzx CARG5d, PC_OP\n  |  mov CARG2d, RA\n  |  mov CARG4d, RC\t\t\t// Caveat: CARG4d == RA.\n  |  mov L:CARG1d, SAVE_L\n  |  mov L:CARG1d->base, BASE\t\t// Caveat: CARG3d == BASE.\n  |  mov CARG3d, RB\n  |  mov L:RB, L:CARG1d\n  |.else\n  |  mov ARG3, RB\n  |  mov L:RB, SAVE_L\n  |  mov ARG4, RC\n  |  movzx RC, PC_OP\n  |  mov ARG2, RA\n  |  mov ARG5, RC\n  |  mov ARG1, L:RB\n  |  mov L:RB->base, BASE\n  |.endif\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_arith\t// (lua_State *L, TValue *ra,*rb,*rc, BCReg op)\n  |  // NULL (finished) or TValue * (metamethod) returned in eax (RC).\n  |  mov BASE, L:RB->base\n  |  test RC, RC\n  |  jz ->cont_nop\n  |\n  |  // Call metamethod for binary op.\n  |->vmeta_binop:\n  |  // BASE = base, RC = new base, stack = cont/func/o1/o2\n  |  mov RA, RC\n  |  sub RC, BASE\n  |  mov [RA-12], PC\t\t\t// [cont|PC]\n  |  lea PC, [RC+FRAME_CONT]\n  |  mov NARGS:RD, 2+1\t\t\t// 2 args for func(o1, o2).\n  |  jmp ->vm_call_dispatch\n  |\n  |->vmeta_len:\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |  lea FCARG2, [BASE+RD*8]\t\t// Caveat: FCARG2 == BASE\n  |  mov L:FCARG1, L:RB\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_len@8\t\t// (lua_State *L, TValue *o)\n  |  // NULL (retry) or TValue * (metamethod) returned in eax (RC).\n  |  mov BASE, L:RB->base\n#if LJ_52\n  |  test RC, RC\n  |  jne ->vmeta_binop\t\t\t// Binop call for compatibility.\n  |  movzx RD, PC_RD\n  |  mov TAB:FCARG1, [BASE+RD*8]\n  |  jmp ->BC_LEN_Z\n#else\n  |  jmp ->vmeta_binop\t\t\t// Binop call for compatibility.\n#endif\n  |\n  |//-- Call metamethod ----------------------------------------------------\n  |\n  |->vmeta_call_ra:\n  |  lea RA, [BASE+RA*8+8]\n  |->vmeta_call:\t\t\t// Resolve and call __call metamethod.\n  |  // BASE = old base, RA = new base, RC = nargs+1, PC = return\n  |  mov TMP2, RA\t\t\t// Save RA, RC for us.\n  |  mov TMP1, NARGS:RD\n  |  sub RA, 8\n  |.if X64\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\t\t// Caveat: CARG2d/CARG3d may be BASE.\n  |  mov CARG2d, RA\n  |  lea CARG3d, [RA+NARGS:RD*8]\n  |  mov CARG1d, L:RB\t\t\t// Caveat: CARG1d may be RA.\n  |.else\n  |  lea RC, [RA+NARGS:RD*8]\n  |  mov L:RB, SAVE_L\n  |  mov ARG2, RA\n  |  mov ARG3, RC\n  |  mov ARG1, L:RB\n  |  mov L:RB->base, BASE\t\t// This is the callers base!\n  |.endif\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_call\t// (lua_State *L, TValue *func, TValue *top)\n  |  mov BASE, L:RB->base\n  |  mov RA, TMP2\n  |  mov NARGS:RD, TMP1\n  |  mov LFUNC:RB, [RA-8]\n  |  add NARGS:RD, 1\n  |  // This is fragile. L->base must not move, KBASE must always be defined.\n  |  cmp KBASE, BASE\t\t\t// Continue with CALLT if flag set.\n  |  je ->BC_CALLT_Z\n  |  mov BASE, RA\n  |  ins_call\t\t\t\t// Otherwise call resolved metamethod.\n  |\n  |//-- Argument coercion for 'for' statement ------------------------------\n  |\n  |->vmeta_for:\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |  mov FCARG2, RA\t\t\t// Caveat: FCARG2 == BASE\n  |  mov L:FCARG1, L:RB\t\t\t// Caveat: FCARG1 == RA\n  |  mov SAVE_PC, PC\n  |  call extern lj_meta_for@8\t// (lua_State *L, TValue *base)\n  |  mov BASE, L:RB->base\n  |  mov RC, [PC-4]\n  |  movzx RA, RCH\n  |  movzx OP, RCL\n  |  shr RC, 16\n  |.if X64\n  |  jmp aword [DISPATCH+OP*8+GG_DISP2STATIC]\t// Retry FORI or JFORI.\n  |.else\n  |  jmp aword [DISPATCH+OP*4+GG_DISP2STATIC]\t// Retry FORI or JFORI.\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Fast functions -----------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |.macro .ffunc, name\n  |->ff_ .. name:\n  |.endmacro\n  |\n  |.macro .ffunc_1, name\n  |->ff_ .. name:\n  |  cmp NARGS:RD, 1+1;  jb ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_2, name\n  |->ff_ .. name:\n  |  cmp NARGS:RD, 2+1;  jb ->fff_fallback\n  |.endmacro\n  |\n  |.macro .ffunc_n, name\n  |  .ffunc_1 name\n  |  cmp dword [BASE+4], LJ_TISNUM;  jae ->fff_fallback\n  |  fld qword [BASE]\n  |.endmacro\n  |\n  |.macro .ffunc_n, name, op\n  |  .ffunc_1 name\n  |  cmp dword [BASE+4], LJ_TISNUM;  jae ->fff_fallback\n  |  op\n  |  fld qword [BASE]\n  |.endmacro\n  |\n  |.macro .ffunc_nsse, name, op\n  |  .ffunc_1 name\n  |  cmp dword [BASE+4], LJ_TISNUM;  jae ->fff_fallback\n  |  op xmm0, qword [BASE]\n  |.endmacro\n  |\n  |.macro .ffunc_nsse, name\n  |  .ffunc_nsse name, movsd\n  |.endmacro\n  |\n  |.macro .ffunc_nn, name\n  |  .ffunc_2 name\n  |  cmp dword [BASE+4], LJ_TISNUM;  jae ->fff_fallback\n  |  cmp dword [BASE+12], LJ_TISNUM;  jae ->fff_fallback\n  |  fld qword [BASE]\n  |  fld qword [BASE+8]\n  |.endmacro\n  |\n  |.macro .ffunc_nnsse, name\n  |  .ffunc_2 name\n  |  cmp dword [BASE+4], LJ_TISNUM;  jae ->fff_fallback\n  |  cmp dword [BASE+12], LJ_TISNUM;  jae ->fff_fallback\n  |  movsd xmm0, qword [BASE]\n  |  movsd xmm1, qword [BASE+8]\n  |.endmacro\n  |\n  |.macro .ffunc_nnr, name\n  |  .ffunc_2 name\n  |  cmp dword [BASE+4], LJ_TISNUM;  jae ->fff_fallback\n  |  cmp dword [BASE+12], LJ_TISNUM;  jae ->fff_fallback\n  |  fld qword [BASE+8]\n  |  fld qword [BASE]\n  |.endmacro\n  |\n  |// Inlined GC threshold check. Caveat: uses label 1.\n  |.macro ffgccheck\n  |  mov RB, [DISPATCH+DISPATCH_GL(gc.total)]\n  |  cmp RB, [DISPATCH+DISPATCH_GL(gc.threshold)]\n  |  jb >1\n  |  call ->fff_gcstep\n  |1:\n  |.endmacro\n  |\n  |//-- Base library: checks -----------------------------------------------\n  |\n  |.ffunc_1 assert\n  |  mov RB, [BASE+4]\n  |  cmp RB, LJ_TISTRUECOND;  jae ->fff_fallback\n  |  mov PC, [BASE-4]\n  |  mov MULTRES, RD\n  |  mov [BASE-4], RB\n  |  mov RB, [BASE]\n  |  mov [BASE-8], RB\n  |  sub RD, 2\n  |  jz >2\n  |  mov RA, BASE\n  |1:\n  |  add RA, 8\n  |.if X64\n  |  mov RBa, [RA]\n  |  mov [RA-8], RBa\n  |.else\n  |  mov RB, [RA+4]\n  |  mov [RA-4], RB\n  |  mov RB, [RA]\n  |  mov [RA-8], RB\n  |.endif\n  |  sub RD, 1\n  |  jnz <1\n  |2:\n  |  mov RD, MULTRES\n  |  jmp ->fff_res_\n  |\n  |.ffunc_1 type\n  |  mov RB, [BASE+4]\n  |.if X64\n  |  mov RA, RB\n  |  sar RA, 15\n  |  cmp RA, -2\n  |  je >3\n  |.endif\n  |  mov RC, ~LJ_TNUMX\n  |  not RB\n  |  cmp RC, RB\n  |  cmova RC, RB\n  |2:\n  |  mov CFUNC:RB, [BASE-8]\n  |  mov STR:RC, [CFUNC:RB+RC*8+((char *)(&((GCfuncC *)0)->upvalue))]\n  |  mov PC, [BASE-4]\n  |  mov dword [BASE-4], LJ_TSTR\n  |  mov [BASE-8], STR:RC\n  |  jmp ->fff_res1\n  |.if X64\n  |3:\n  |  mov RC, ~LJ_TLIGHTUD\n  |  jmp <2\n  |.endif\n  |\n  |//-- Base library: getters and setters ---------------------------------\n  |\n  |.ffunc_1 getmetatable\n  |  mov RB, [BASE+4]\n  |  mov PC, [BASE-4]\n  |  cmp RB, LJ_TTAB;  jne >6\n  |1:  // Field metatable must be at same offset for GCtab and GCudata!\n  |  mov TAB:RB, [BASE]\n  |  mov TAB:RB, TAB:RB->metatable\n  |2:\n  |  test TAB:RB, TAB:RB\n  |  mov dword [BASE-4], LJ_TNIL\n  |  jz ->fff_res1\n  |  mov STR:RC, [DISPATCH+DISPATCH_GL(gcroot)+4*(GCROOT_MMNAME+MM_metatable)]\n  |  mov dword [BASE-4], LJ_TTAB\t// Store metatable as default result.\n  |  mov [BASE-8], TAB:RB\n  |  mov RA, TAB:RB->hmask\n  |  and RA, STR:RC->hash\n  |  imul RA, #NODE\n  |  add NODE:RA, TAB:RB->node\n  |3:  // Rearranged logic, because we expect _not_ to find the key.\n  |  cmp dword NODE:RA->key.it, LJ_TSTR\n  |  jne >4\n  |  cmp dword NODE:RA->key.gcr, STR:RC\n  |  je >5\n  |4:\n  |  mov NODE:RA, NODE:RA->next\n  |  test NODE:RA, NODE:RA\n  |  jnz <3\n  |  jmp ->fff_res1\t\t\t// Not found, keep default result.\n  |5:\n  |  mov RB, [RA+4]\n  |  cmp RB, LJ_TNIL;  je ->fff_res1\t// Ditto for nil value.\n  |  mov RC, [RA]\n  |  mov [BASE-4], RB\t\t\t// Return value of mt.__metatable.\n  |  mov [BASE-8], RC\n  |  jmp ->fff_res1\n  |\n  |6:\n  |  cmp RB, LJ_TUDATA;  je <1\n  |.if X64\n  |  cmp RB, LJ_TNUMX;  ja >8\n  |  cmp RB, LJ_TISNUM;  jbe >7\n  |  mov RB, LJ_TLIGHTUD\n  |  jmp >8\n  |7:\n  |.else\n  |  cmp RB, LJ_TISNUM;  ja >8\n  |.endif\n  |  mov RB, LJ_TNUMX\n  |8:\n  |  not RB\n  |  mov TAB:RB, [DISPATCH+RB*4+DISPATCH_GL(gcroot[GCROOT_BASEMT])]\n  |  jmp <2\n  |\n  |.ffunc_2 setmetatable\n  |  cmp dword [BASE+4], LJ_TTAB;  jne ->fff_fallback\n  |  // Fast path: no mt for table yet and not clearing the mt.\n  |  mov TAB:RB, [BASE]\n  |  cmp dword TAB:RB->metatable, 0;  jne ->fff_fallback\n  |  cmp dword [BASE+12], LJ_TTAB;  jne ->fff_fallback\n  |  mov TAB:RC, [BASE+8]\n  |  mov TAB:RB->metatable, TAB:RC\n  |  mov PC, [BASE-4]\n  |  mov dword [BASE-4], LJ_TTAB\t\t// Return original table.\n  |  mov [BASE-8], TAB:RB\n  |  test byte TAB:RB->marked, LJ_GC_BLACK\t// isblack(table)\n  |  jz >1\n  |  // Possible write barrier. Table is black, but skip iswhite(mt) check.\n  |  barrierback TAB:RB, RC\n  |1:\n  |  jmp ->fff_res1\n  |\n  |.ffunc_2 rawget\n  |  cmp dword [BASE+4], LJ_TTAB;  jne ->fff_fallback\n  |.if X64WIN\n  |  mov RB, BASE\t\t\t// Save BASE.\n  |  lea CARG3d, [BASE+8]\n  |  mov CARG2d, [BASE]\t\t\t// Caveat: CARG2d == BASE.\n  |  mov CARG1d, SAVE_L\n  |.elif X64\n  |  mov RB, BASE\t\t\t// Save BASE.\n  |  mov CARG2d, [BASE]\n  |  lea CARG3d, [BASE+8]\t\t// Caveat: CARG3d == BASE.\n  |  mov CARG1d, SAVE_L\n  |.else\n  |  mov TAB:RD, [BASE]\n  |  mov L:RB, SAVE_L\n  |  mov ARG2, TAB:RD\n  |  mov ARG1, L:RB\n  |  mov RB, BASE\t\t\t// Save BASE.\n  |  add BASE, 8\n  |  mov ARG3, BASE\n  |.endif\n  |  call extern lj_tab_get\t// (lua_State *L, GCtab *t, cTValue *key)\n  |  // cTValue * returned in eax (RD).\n  |  mov BASE, RB\t\t\t// Restore BASE.\n  |  // Copy table slot.\n  |.if X64\n  |  mov RBa, [RD]\n  |  mov PC, [BASE-4]\n  |  mov [BASE-8], RBa\n  |.else\n  |  mov RB, [RD]\n  |  mov RD, [RD+4]\n  |  mov PC, [BASE-4]\n  |  mov [BASE-8], RB\n  |  mov [BASE-4], RD\n  |.endif\n  |  jmp ->fff_res1\n  |\n  |//-- Base library: conversions ------------------------------------------\n  |\n  |.ffunc tonumber\n  |  // Only handles the number case inline (without a base argument).\n  |  cmp NARGS:RD, 1+1;  jne ->fff_fallback\t// Exactly one argument.\n  |  cmp dword [BASE+4], LJ_TISNUM\n  |.if DUALNUM\n  |  jne >1\n  |  mov RB, dword [BASE]; jmp ->fff_resi\n  |1:\n  |  ja ->fff_fallback\n  |.else\n  |  jae ->fff_fallback\n  |.endif\n  |.if SSE\n  |  movsd xmm0, qword [BASE]; jmp ->fff_resxmm0\n  |.else\n  |  fld qword [BASE]; jmp ->fff_resn\n  |.endif\n  |\n  |.ffunc_1 tostring\n  |  // Only handles the string or number case inline.\n  |  mov PC, [BASE-4]\n  |  cmp dword [BASE+4], LJ_TSTR;  jne >3\n  |  // A __tostring method in the string base metatable is ignored.\n  |  mov STR:RD, [BASE]\n  |2:\n  |  mov dword [BASE-4], LJ_TSTR\n  |  mov [BASE-8], STR:RD\n  |  jmp ->fff_res1\n  |3:  // Handle numbers inline, unless a number base metatable is present.\n  |  cmp dword [BASE+4], LJ_TISNUM;  ja ->fff_fallback\n  |  cmp dword [DISPATCH+DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])], 0\n  |  jne ->fff_fallback\n  |  ffgccheck\t\t\t\t// Caveat: uses label 1.\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\t\t// Add frame since C call can throw.\n  |  mov SAVE_PC, PC\t\t\t// Redundant (but a defined value).\n  |.if X64 and not X64WIN\n  |  mov FCARG2, BASE\t\t\t// Otherwise: FCARG2 == BASE\n  |.endif\n  |  mov L:FCARG1, L:RB\n  |.if DUALNUM\n  |  call extern lj_str_fromnumber@8\t// (lua_State *L, cTValue *o)\n  |.else\n  |  call extern lj_str_fromnum@8\t// (lua_State *L, lua_Number *np)\n  |.endif\n  |  // GCstr returned in eax (RD).\n  |  mov BASE, L:RB->base\n  |  jmp <2\n  |\n  |//-- Base library: iterators -------------------------------------------\n  |\n  |.ffunc_1 next\n  |  je >2\t\t\t\t// Missing 2nd arg?\n  |1:\n  |  cmp dword [BASE+4], LJ_TTAB;  jne ->fff_fallback\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\t\t// Add frame since C call can throw.\n  |  mov L:RB->top, BASE\t\t// Dummy frame length is ok.\n  |  mov PC, [BASE-4]\n  |.if X64WIN\n  |  lea CARG3d, [BASE+8]\n  |  mov CARG2d, [BASE]\t\t\t// Caveat: CARG2d == BASE.\n  |  mov CARG1d, L:RB\n  |.elif X64\n  |  mov CARG2d, [BASE]\n  |  lea CARG3d, [BASE+8]\t\t// Caveat: CARG3d == BASE.\n  |  mov CARG1d, L:RB\n  |.else\n  |  mov TAB:RD, [BASE]\n  |  mov ARG2, TAB:RD\n  |  mov ARG1, L:RB\n  |  add BASE, 8\n  |  mov ARG3, BASE\n  |.endif\n  |  mov SAVE_PC, PC\t\t\t// Needed for ITERN fallback.\n  |  call extern lj_tab_next\t// (lua_State *L, GCtab *t, TValue *key)\n  |  // Flag returned in eax (RD).\n  |  mov BASE, L:RB->base\n  |  test RD, RD;  jz >3\t\t// End of traversal?\n  |  // Copy key and value to results.\n  |.if X64\n  |  mov RBa, [BASE+8]\n  |  mov RDa, [BASE+16]\n  |  mov [BASE-8], RBa\n  |  mov [BASE], RDa\n  |.else\n  |  mov RB, [BASE+8]\n  |  mov RD, [BASE+12]\n  |  mov [BASE-8], RB\n  |  mov [BASE-4], RD\n  |  mov RB, [BASE+16]\n  |  mov RD, [BASE+20]\n  |  mov [BASE], RB\n  |  mov [BASE+4], RD\n  |.endif\n  |->fff_res2:\n  |  mov RD, 1+2\n  |  jmp ->fff_res\n  |2:  // Set missing 2nd arg to nil.\n  |  mov dword [BASE+12], LJ_TNIL\n  |  jmp <1\n  |3:  // End of traversal: return nil.\n  |  mov dword [BASE-4], LJ_TNIL\n  |  jmp ->fff_res1\n  |\n  |.ffunc_1 pairs\n  |  mov TAB:RB, [BASE]\n  |  cmp dword [BASE+4], LJ_TTAB;  jne ->fff_fallback\n#if LJ_52\n  |  cmp dword TAB:RB->metatable, 0; jne ->fff_fallback\n#endif\n  |  mov CFUNC:RB, [BASE-8]\n  |  mov CFUNC:RD, CFUNC:RB->upvalue[0]\n  |  mov PC, [BASE-4]\n  |  mov dword [BASE-4], LJ_TFUNC\n  |  mov [BASE-8], CFUNC:RD\n  |  mov dword [BASE+12], LJ_TNIL\n  |  mov RD, 1+3\n  |  jmp ->fff_res\n  |\n  |.ffunc_1 ipairs_aux\n  |  cmp dword [BASE+4], LJ_TTAB;  jne ->fff_fallback\n  |  cmp dword [BASE+12], LJ_TISNUM\n  |.if DUALNUM\n  |  jne ->fff_fallback\n  |.else\n  |  jae ->fff_fallback\n  |.endif\n  |  mov PC, [BASE-4]\n  |.if DUALNUM\n  |  mov RD, dword [BASE+8]\n  |  add RD, 1\n  |  mov dword [BASE-4], LJ_TISNUM\n  |  mov dword [BASE-8], RD\n  |.elif SSE\n  |  movsd xmm0, qword [BASE+8]\n  |  sseconst_1 xmm1, RBa\n  |  addsd xmm0, xmm1\n  |  cvtsd2si RD, xmm0\n  |  movsd qword [BASE-8], xmm0\n  |.else\n  |  fld qword [BASE+8]\n  |  fld1\n  |  faddp st1\n  |  fist ARG1\n  |  fstp qword [BASE-8]\n  |  mov RD, ARG1\n  |.endif\n  |  mov TAB:RB, [BASE]\n  |  cmp RD, TAB:RB->asize;  jae >2\t// Not in array part?\n  |  shl RD, 3\n  |  add RD, TAB:RB->array\n  |1:\n  |  cmp dword [RD+4], LJ_TNIL;  je ->fff_res0\n  |  // Copy array slot.\n  |.if X64\n  |  mov RBa, [RD]\n  |  mov [BASE], RBa\n  |.else\n  |  mov RB, [RD]\n  |  mov RD, [RD+4]\n  |  mov [BASE], RB\n  |  mov [BASE+4], RD\n  |.endif\n  |  jmp ->fff_res2\n  |2:  // Check for empty hash part first. Otherwise call C function.\n  |  cmp dword TAB:RB->hmask, 0; je ->fff_res0\n  |  mov FCARG1, TAB:RB\n  |  mov RB, BASE\t\t\t// Save BASE.\n  |  mov FCARG2, RD\t\t\t// Caveat: FCARG2 == BASE\n  |  call extern lj_tab_getinth@8\t// (GCtab *t, int32_t key)\n  |  // cTValue * or NULL returned in eax (RD).\n  |  mov BASE, RB\n  |  test RD, RD\n  |  jnz <1\n  |->fff_res0:\n  |  mov RD, 1+0\n  |  jmp ->fff_res\n  |\n  |.ffunc_1 ipairs\n  |  mov TAB:RB, [BASE]\n  |  cmp dword [BASE+4], LJ_TTAB;  jne ->fff_fallback\n#if LJ_52\n  |  cmp dword TAB:RB->metatable, 0; jne ->fff_fallback\n#endif\n  |  mov CFUNC:RB, [BASE-8]\n  |  mov CFUNC:RD, CFUNC:RB->upvalue[0]\n  |  mov PC, [BASE-4]\n  |  mov dword [BASE-4], LJ_TFUNC\n  |  mov [BASE-8], CFUNC:RD\n  |.if DUALNUM\n  |  mov dword [BASE+12], LJ_TISNUM\n  |  mov dword [BASE+8], 0\n  |.elif SSE\n  |  xorps xmm0, xmm0\n  |  movsd qword [BASE+8], xmm0\n  |.else\n  |  fldz\n  |  fstp qword [BASE+8]\n  |.endif\n  |  mov RD, 1+3\n  |  jmp ->fff_res\n  |\n  |//-- Base library: catch errors ----------------------------------------\n  |\n  |.ffunc_1 pcall\n  |  lea RA, [BASE+8]\n  |  sub NARGS:RD, 1\n  |  mov PC, 8+FRAME_PCALL\n  |1:\n  |  movzx RB, byte [DISPATCH+DISPATCH_GL(hookmask)]\n  |  shr RB, HOOK_ACTIVE_SHIFT\n  |  and RB, 1\n  |  add PC, RB\t\t\t\t// Remember active hook before pcall.\n  |  jmp ->vm_call_dispatch\n  |\n  |.ffunc_2 xpcall\n  |  cmp dword [BASE+12], LJ_TFUNC;  jne ->fff_fallback\n  |  mov RB, [BASE+4]\t\t\t// Swap function and traceback.\n  |  mov [BASE+12], RB\n  |  mov dword [BASE+4], LJ_TFUNC\n  |  mov LFUNC:RB, [BASE]\n  |  mov PC, [BASE+8]\n  |  mov [BASE+8], LFUNC:RB\n  |  mov [BASE], PC\n  |  lea RA, [BASE+16]\n  |  sub NARGS:RD, 2\n  |  mov PC, 16+FRAME_PCALL\n  |  jmp <1\n  |\n  |//-- Coroutine library --------------------------------------------------\n  |\n  |.macro coroutine_resume_wrap, resume\n  |.if resume\n  |.ffunc_1 coroutine_resume\n  |  mov L:RB, [BASE]\n  |.else\n  |.ffunc coroutine_wrap_aux\n  |  mov CFUNC:RB, [BASE-8]\n  |  mov L:RB, CFUNC:RB->upvalue[0].gcr\n  |.endif\n  |  mov PC, [BASE-4]\n  |  mov SAVE_PC, PC\n  |.if X64\n  |  mov TMP1, L:RB\n  |.else\n  |  mov ARG1, L:RB\n  |.endif\n  |.if resume\n  |  cmp dword [BASE+4], LJ_TTHREAD;  jne ->fff_fallback\n  |.endif\n  |  cmp aword L:RB->cframe, 0; jne ->fff_fallback\n  |  cmp byte L:RB->status, LUA_YIELD;  ja ->fff_fallback\n  |  mov RA, L:RB->top\n  |  je >1\t\t\t\t// Status != LUA_YIELD (i.e. 0)?\n  |  cmp RA, L:RB->base\t\t\t// Check for presence of initial func.\n  |  je ->fff_fallback\n  |1:\n  |.if resume\n  |  lea PC, [RA+NARGS:RD*8-16]\t\t// Check stack space (-1-thread).\n  |.else\n  |  lea PC, [RA+NARGS:RD*8-8]\t\t// Check stack space (-1).\n  |.endif\n  |  cmp PC, L:RB->maxstack; ja ->fff_fallback\n  |  mov L:RB->top, PC\n  |\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |.if resume\n  |  add BASE, 8\t\t\t// Keep resumed thread in stack for GC.\n  |.endif\n  |  mov L:RB->top, BASE\n  |.if resume\n  |  lea RB, [BASE+NARGS:RD*8-24]\t// RB = end of source for stack move.\n  |.else\n  |  lea RB, [BASE+NARGS:RD*8-16]\t// RB = end of source for stack move.\n  |.endif\n  |  sub RBa, PCa\t\t\t// Relative to PC.\n  |\n  |  cmp PC, RA\n  |  je >3\n  |2:  // Move args to coroutine.\n  |.if X64\n  |  mov RCa, [PC+RB]\n  |  mov [PC-8], RCa\n  |.else\n  |  mov RC, [PC+RB+4]\n  |  mov [PC-4], RC\n  |  mov RC, [PC+RB]\n  |  mov [PC-8], RC\n  |.endif\n  |  sub PC, 8\n  |  cmp PC, RA\n  |  jne <2\n  |3:\n  |.if X64\n  |  mov CARG2d, RA\n  |  mov CARG1d, TMP1\n  |.else\n  |  mov ARG2, RA\n  |  xor RA, RA\n  |  mov ARG4, RA\n  |  mov ARG3, RA\n  |.endif\n  |  call ->vm_resume\t\t\t// (lua_State *L, TValue *base, 0, 0)\n  |  set_vmstate INTERP\n  |\n  |  mov L:RB, SAVE_L\n  |.if X64\n  |  mov L:PC, TMP1\n  |.else\n  |  mov L:PC, ARG1\t\t\t// The callee doesn't modify SAVE_L.\n  |.endif\n  |  mov BASE, L:RB->base\n  |  cmp eax, LUA_YIELD\n  |  ja >8\n  |4:\n  |  mov RA, L:PC->base\n  |  mov KBASE, L:PC->top\n  |  mov L:PC->top, RA\t\t\t// Clear coroutine stack.\n  |  mov PC, KBASE\n  |  sub PC, RA\n  |  je >6\t\t\t\t// No results?\n  |  lea RD, [BASE+PC]\n  |  shr PC, 3\n  |  cmp RD, L:RB->maxstack\n  |  ja >9\t\t\t\t// Need to grow stack?\n  |\n  |  mov RB, BASE\n  |  sub RBa, RAa\n  |5:  // Move results from coroutine.\n  |.if X64\n  |  mov RDa, [RA]\n  |  mov [RA+RB], RDa\n  |.else\n  |  mov RD, [RA]\n  |  mov [RA+RB], RD\n  |  mov RD, [RA+4]\n  |  mov [RA+RB+4], RD\n  |.endif\n  |  add RA, 8\n  |  cmp RA, KBASE\n  |  jne <5\n  |6:\n  |.if resume\n  |  lea RD, [PC+2]\t\t\t// nresults+1 = 1 + true + results.\n  |  mov dword [BASE-4], LJ_TTRUE\t// Prepend true to results.\n  |.else\n  |  lea RD, [PC+1]\t\t\t// nresults+1 = 1 + results.\n  |.endif\n  |7:\n  |  mov PC, SAVE_PC\n  |  mov MULTRES, RD\n  |.if resume\n  |  mov RAa, -8\n  |.else\n  |  xor RA, RA\n  |.endif\n  |  test PC, FRAME_TYPE\n  |  jz ->BC_RET_Z\n  |  jmp ->vm_return\n  |\n  |8:  // Coroutine returned with error (at co->top-1).\n  |.if resume\n  |  mov dword [BASE-4], LJ_TFALSE\t// Prepend false to results.\n  |  mov RA, L:PC->top\n  |  sub RA, 8\n  |  mov L:PC->top, RA\t\t\t// Clear error from coroutine stack.\n  |  // Copy error message.\n  |.if X64\n  |  mov RDa, [RA]\n  |  mov [BASE], RDa\n  |.else\n  |  mov RD, [RA]\n  |  mov [BASE], RD\n  |  mov RD, [RA+4]\n  |  mov [BASE+4], RD\n  |.endif\n  |  mov RD, 1+2\t\t\t// nresults+1 = 1 + false + error.\n  |  jmp <7\n  |.else\n  |  mov FCARG2, L:PC\n  |  mov FCARG1, L:RB\n  |  call extern lj_ffh_coroutine_wrap_err@8  // (lua_State *L, lua_State *co)\n  |  // Error function does not return.\n  |.endif\n  |\n  |9:  // Handle stack expansion on return from yield.\n  |.if X64\n  |  mov L:RA, TMP1\n  |.else\n  |  mov L:RA, ARG1\t\t\t// The callee doesn't modify SAVE_L.\n  |.endif\n  |  mov L:RA->top, KBASE\t\t// Undo coroutine stack clearing.\n  |  mov FCARG2, PC\n  |  mov FCARG1, L:RB\n  |  call extern lj_state_growstack@8\t// (lua_State *L, int n)\n  |.if X64\n  |  mov L:PC, TMP1\n  |.else\n  |  mov L:PC, ARG1\n  |.endif\n  |  mov BASE, L:RB->base\n  |  jmp <4\t\t\t\t// Retry the stack move.\n  |.endmacro\n  |\n  |  coroutine_resume_wrap 1\t\t// coroutine.resume\n  |  coroutine_resume_wrap 0\t\t// coroutine.wrap\n  |\n  |.ffunc coroutine_yield\n  |  mov L:RB, SAVE_L\n  |  test aword L:RB->cframe, CFRAME_RESUME\n  |  jz ->fff_fallback\n  |  mov L:RB->base, BASE\n  |  lea RD, [BASE+NARGS:RD*8-8]\n  |  mov L:RB->top, RD\n  |  xor RD, RD\n  |  mov aword L:RB->cframe, RDa\n  |  mov al, LUA_YIELD\n  |  mov byte L:RB->status, al\n  |  jmp ->vm_leave_unw\n  |\n  |//-- Math library -------------------------------------------------------\n  |\n  |.if not DUALNUM\n  |->fff_resi:  // Dummy.\n  |.endif\n  |\n  |.if SSE\n  |->fff_resn:\n  |  mov PC, [BASE-4]\n  |  fstp qword [BASE-8]\n  |  jmp ->fff_res1\n  |.endif\n  |\n  |  .ffunc_1 math_abs\n  |.if DUALNUM\n  |  cmp dword [BASE+4], LJ_TISNUM; jne >2\n  |  mov RB, dword [BASE]\n  |  cmp RB, 0; jns ->fff_resi\n  |  neg RB; js >1\n  |->fff_resbit:\n  |->fff_resi:\n  |  mov PC, [BASE-4]\n  |  mov dword [BASE-4], LJ_TISNUM\n  |  mov dword [BASE-8], RB\n  |  jmp ->fff_res1\n  |1:\n  |  mov PC, [BASE-4]\n  |  mov dword [BASE-4], 0x41e00000  // 2^31.\n  |  mov dword [BASE-8], 0\n  |  jmp ->fff_res1\n  |2:\n  |  ja ->fff_fallback\n  |.else\n  |  cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback\n  |.endif\n  |\n  |.if SSE\n  |  movsd xmm0, qword [BASE]\n  |  sseconst_abs xmm1, RDa\n  |  andps xmm0, xmm1\n  |->fff_resxmm0:\n  |  mov PC, [BASE-4]\n  |  movsd qword [BASE-8], xmm0\n  |  // fallthrough\n  |.else\n  |  fld qword [BASE]\n  |  fabs\n  |  // fallthrough\n  |->fff_resxmm0:  // Dummy.\n  |->fff_resn:\n  |  mov PC, [BASE-4]\n  |  fstp qword [BASE-8]\n  |.endif\n  |\n  |->fff_res1:\n  |  mov RD, 1+1\n  |->fff_res:\n  |  mov MULTRES, RD\n  |->fff_res_:\n  |  test PC, FRAME_TYPE\n  |  jnz >7\n  |5:\n  |  cmp PC_RB, RDL\t\t\t// More results expected?\n  |  ja >6\n  |  // Adjust BASE. KBASE is assumed to be set for the calling frame.\n  |  movzx RA, PC_RA\n  |  not RAa\t\t\t\t// Note: ~RA = -(RA+1)\n  |  lea BASE, [BASE+RA*8]\t\t// base = base - (RA+1)*8\n  |  ins_next\n  |\n  |6:  // Fill up results with nil.\n  |  mov dword [BASE+RD*8-12], LJ_TNIL\n  |  add RD, 1\n  |  jmp <5\n  |\n  |7:  // Non-standard return case.\n  |  mov RAa, -8\t\t\t// Results start at BASE+RA = BASE-8.\n  |  jmp ->vm_return\n  |\n  |.macro math_round, func\n  |  .ffunc math_ .. func\n  |.if DUALNUM\n  |  cmp dword [BASE+4], LJ_TISNUM; jne >1\n  |  mov RB, dword [BASE]; jmp ->fff_resi\n  |1:\n  |  ja ->fff_fallback\n  |.else\n  |  cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback\n  |.endif\n  |.if SSE\n  |  movsd xmm0, qword [BASE]\n  |  call ->vm_ .. func\n  |  .if DUALNUM\n  |    cvtsd2si RB, xmm0\n  |    cmp RB, 0x80000000\n  |    jne ->fff_resi\n  |    cvtsi2sd xmm1, RB\n  |    ucomisd xmm0, xmm1\n  |    jp ->fff_resxmm0\n  |    je ->fff_resi\n  |  .endif\n  |  jmp ->fff_resxmm0\n  |.else\n  |  fld qword [BASE]\n  |  call ->vm_ .. func\n  |  .if DUALNUM\n  |    fist ARG1\n  |    mov RB, ARG1\n  |    cmp RB, 0x80000000; jne >2\n  |    fdup\n  |    fild ARG1\n  |    fcomparepp\n  |    jp ->fff_resn\n  |    jne ->fff_resn\n  |2:\n  |    fpop\n  |    jmp ->fff_resi\n  | .else\n  |    jmp ->fff_resn\n  | .endif\n  |.endif\n  |.endmacro\n  |\n  |  math_round floor\n  |  math_round ceil\n  |\n  |.if SSE\n  |.ffunc_nsse math_sqrt, sqrtsd; jmp ->fff_resxmm0\n  |.else\n  |.ffunc_n math_sqrt; fsqrt; jmp ->fff_resn\n  |.endif\n  |\n  |.ffunc math_log\n  |  cmp NARGS:RD, 1+1; jne ->fff_fallback\t// Exactly one argument.\n  |  cmp dword [BASE+4], LJ_TISNUM; jae ->fff_fallback\n  |  fldln2; fld qword [BASE]; fyl2x; jmp ->fff_resn\n  |\n  |.ffunc_n math_log10, fldlg2;\tfyl2x;\t\tjmp ->fff_resn\n  |.ffunc_n math_exp;\tcall ->vm_exp_x87;\tjmp ->fff_resn\n  |\n  |.ffunc_n math_sin;\tfsin;\t\t\tjmp ->fff_resn\n  |.ffunc_n math_cos;\tfcos;\t\t\tjmp ->fff_resn\n  |.ffunc_n math_tan;\tfptan; fpop;\t\tjmp ->fff_resn\n  |\n  |.ffunc_n math_asin\n  |  fdup; fmul st0; fld1; fsubrp st1; fsqrt; fpatan\n  |  jmp ->fff_resn\n  |.ffunc_n math_acos\n  |  fdup; fmul st0; fld1; fsubrp st1; fsqrt; fxch; fpatan\n  |  jmp ->fff_resn\n  |.ffunc_n math_atan;\tfld1; fpatan;\t\tjmp ->fff_resn\n  |\n  |.macro math_extern, func\n  |.if SSE\n  |  .ffunc_nsse math_ .. func\n  |  .if not X64\n  |    movsd FPARG1, xmm0\n  |  .endif\n  |.else\n  |  .ffunc_n math_ .. func\n  |  fstp FPARG1\n  |.endif\n  |  mov RB, BASE\n  |  call extern lj_vm_ .. func\n  |  mov BASE, RB\n  |  .if X64\n  |    jmp ->fff_resxmm0\n  |  .else\n  |    jmp ->fff_resn\n  |  .endif\n  |.endmacro\n  |\n  |  math_extern sinh\n  |  math_extern cosh\n  |  math_extern tanh\n  |\n  |->ff_math_deg:\n  |.if SSE\n  |.ffunc_nsse math_rad\n  |  mov CFUNC:RB, [BASE-8]\n  |  mulsd xmm0, qword CFUNC:RB->upvalue[0]\n  |  jmp ->fff_resxmm0\n  |.else\n  |.ffunc_n math_rad\n  |  mov CFUNC:RB, [BASE-8]\n  |  fmul qword CFUNC:RB->upvalue[0]\n  |  jmp ->fff_resn\n  |.endif\n  |\n  |.ffunc_nn math_atan2;\tfpatan;\t\tjmp ->fff_resn\n  |.ffunc_nnr math_ldexp;\tfscale; fpop1;\tjmp ->fff_resn\n  |\n  |.ffunc_1 math_frexp\n  |  mov RB, [BASE+4]\n  |  cmp RB, LJ_TISNUM;  jae ->fff_fallback\n  |  mov PC, [BASE-4]\n  |  mov RC, [BASE]\n  |  mov [BASE-4], RB; mov [BASE-8], RC\n  |  shl RB, 1; cmp RB, 0xffe00000; jae >3\n  |  or RC, RB; jz >3\n  |  mov RC, 1022\n  |  cmp RB, 0x00200000; jb >4\n  |1:\n  |  shr RB, 21; sub RB, RC\t\t// Extract and unbias exponent.\n  |.if SSE\n  |  cvtsi2sd xmm0, RB\n  |.else\n  |  mov TMP1, RB; fild TMP1\n  |.endif\n  |  mov RB, [BASE-4]\n  |  and RB, 0x800fffff\t\t\t// Mask off exponent.\n  |  or RB, 0x3fe00000\t\t\t// Put mantissa in range [0.5,1) or 0.\n  |  mov [BASE-4], RB\n  |2:\n  |.if SSE\n  |  movsd qword [BASE], xmm0\n  |.else\n  |  fstp qword [BASE]\n  |.endif\n  |  mov RD, 1+2\n  |  jmp ->fff_res\n  |3:  // Return +-0, +-Inf, NaN unmodified and an exponent of 0.\n  |.if SSE\n  |  xorps xmm0, xmm0; jmp <2\n  |.else\n  |  fldz; jmp <2\n  |.endif\n  |4:  // Handle denormals by multiplying with 2^54 and adjusting the bias.\n  |.if SSE\n  |  movsd xmm0, qword [BASE]\n  |  sseconst_hi xmm1, RBa, 43500000  // 2^54.\n  |  mulsd xmm0, xmm1\n  |  movsd qword [BASE-8], xmm0\n  |.else\n  |  fld qword [BASE]\n  |  mov TMP1, 0x5a800000; fmul TMP1\t// x = x*2^54\n  |  fstp qword [BASE-8]\n  |.endif\n  |  mov RB, [BASE-4]; mov RC, 1076; shl RB, 1; jmp <1\n  |\n  |.if SSE\n  |.ffunc_nsse math_modf\n  |.else\n  |.ffunc_n math_modf\n  |.endif\n  |  mov RB, [BASE+4]\n  |  mov PC, [BASE-4]\n  |  shl RB, 1; cmp RB, 0xffe00000; je >4\t// +-Inf?\n  |.if SSE\n  |  movaps xmm4, xmm0\n  |  call ->vm_trunc\n  |  subsd xmm4, xmm0\n  |1:\n  |  movsd qword [BASE-8], xmm0\n  |  movsd qword [BASE], xmm4\n  |.else\n  |  fdup\n  |  call ->vm_trunc\n  |  fsub st1, st0\n  |1:\n  |  fstp qword [BASE-8]\n  |  fstp qword [BASE]\n  |.endif\n  |  mov RC, [BASE-4]; mov RB, [BASE+4]\n  |  xor RC, RB; js >3\t\t\t\t// Need to adjust sign?\n  |2:\n  |  mov RD, 1+2\n  |  jmp ->fff_res\n  |3:\n  |  xor RB, 0x80000000; mov [BASE+4], RB\t// Flip sign of fraction.\n  |  jmp <2\n  |4:\n  |.if SSE\n  |  xorps xmm4, xmm4; jmp <1\t\t\t// Return +-Inf and +-0.\n  |.else\n  |  fldz; fxch; jmp <1\t\t\t\t// Return +-Inf and +-0.\n  |.endif\n  |\n  |.ffunc_nnr math_fmod\n  |1: ; fprem; fnstsw ax; sahf; jp <1\n  |  fpop1\n  |  jmp ->fff_resn\n  |\n  |.if SSE\n  |.ffunc_nnsse math_pow;\tcall ->vm_pow;\tjmp ->fff_resxmm0\n  |.else\n  |.ffunc_nn math_pow;\t\tcall ->vm_pow;\tjmp ->fff_resn\n  |.endif\n  |\n  |.macro math_minmax, name, cmovop, fcmovop, sseop\n  |  .ffunc name\n  |  mov RA, 2\n  |  cmp dword [BASE+4], LJ_TISNUM\n  |.if DUALNUM\n  |  jne >4\n  |  mov RB, dword [BASE]\n  |1:  // Handle integers.\n  |  cmp RA, RD; jae ->fff_resi\n  |  cmp dword [BASE+RA*8-4], LJ_TISNUM; jne >3\n  |  cmp RB, dword [BASE+RA*8-8]\n  |  cmovop RB, dword [BASE+RA*8-8]\n  |  add RA, 1\n  |  jmp <1\n  |3:\n  |  ja ->fff_fallback\n  |  // Convert intermediate result to number and continue below.\n  |.if SSE\n  |  cvtsi2sd xmm0, RB\n  |.else\n  |  mov TMP1, RB\n  |  fild TMP1\n  |.endif\n  |  jmp >6\n  |4:\n  |  ja ->fff_fallback\n  |.else\n  |  jae ->fff_fallback\n  |.endif\n  |\n  |.if SSE\n  |  movsd xmm0, qword [BASE]\n  |5:  // Handle numbers or integers.\n  |  cmp RA, RD; jae ->fff_resxmm0\n  |  cmp dword [BASE+RA*8-4], LJ_TISNUM\n  |.if DUALNUM\n  |  jb >6\n  |  ja ->fff_fallback\n  |  cvtsi2sd xmm1, dword [BASE+RA*8-8]\n  |  jmp >7\n  |.else\n  |  jae ->fff_fallback\n  |.endif\n  |6:\n  |  movsd xmm1, qword [BASE+RA*8-8]\n  |7:\n  |  sseop xmm0, xmm1\n  |  add RA, 1\n  |  jmp <5\n  |.else\n  |  fld qword [BASE]\n  |5:  // Handle numbers or integers.\n  |  cmp RA, RD; jae ->fff_resn\n  |  cmp dword [BASE+RA*8-4], LJ_TISNUM\n  |.if DUALNUM\n  |  jb >6\n  |  ja >9\n  |  fild dword [BASE+RA*8-8]\n  |  jmp >7\n  |.else\n  |  jae >9\n  |.endif\n  |6:\n  |  fld qword [BASE+RA*8-8]\n  |7:\n  |  fucomi st1; fcmovop st1; fpop1\n  |  add RA, 1\n  |  jmp <5\n  |.endif\n  |.endmacro\n  |\n  |  math_minmax math_min, cmovg, fcmovnbe, minsd\n  |  math_minmax math_max, cmovl, fcmovbe, maxsd\n  |.if not SSE\n  |9:\n  |  fpop; jmp ->fff_fallback\n  |.endif\n  |\n  |//-- String library -----------------------------------------------------\n  |\n  |.ffunc_1 string_len\n  |  cmp dword [BASE+4], LJ_TSTR;  jne ->fff_fallback\n  |  mov STR:RB, [BASE]\n  |.if DUALNUM\n  |  mov RB, dword STR:RB->len; jmp ->fff_resi\n  |.elif SSE\n  |  cvtsi2sd xmm0, dword STR:RB->len; jmp ->fff_resxmm0\n  |.else\n  |  fild dword STR:RB->len; jmp ->fff_resn\n  |.endif\n  |\n  |.ffunc string_byte\t\t\t// Only handle the 1-arg case here.\n  |  cmp NARGS:RD, 1+1;  jne ->fff_fallback\n  |  cmp dword [BASE+4], LJ_TSTR;  jne ->fff_fallback\n  |  mov STR:RB, [BASE]\n  |  mov PC, [BASE-4]\n  |  cmp dword STR:RB->len, 1\n  |  jb ->fff_res0\t\t\t// Return no results for empty string.\n  |  movzx RB, byte STR:RB[1]\n  |.if DUALNUM\n  |  jmp ->fff_resi\n  |.elif SSE\n  |  cvtsi2sd xmm0, RB; jmp ->fff_resxmm0\n  |.else\n  |  mov TMP1, RB; fild TMP1; jmp ->fff_resn\n  |.endif\n  |\n  |.ffunc string_char\t\t\t// Only handle the 1-arg case here.\n  |  ffgccheck\n  |  cmp NARGS:RD, 1+1;  jne ->fff_fallback\t// *Exactly* 1 arg.\n  |  cmp dword [BASE+4], LJ_TISNUM\n  |.if DUALNUM\n  |  jne ->fff_fallback\n  |  mov RB, dword [BASE]\n  |  cmp RB, 255;  ja ->fff_fallback\n  |  mov TMP2, RB\n  |.elif SSE\n  |  jae ->fff_fallback\n  |  cvttsd2si RB, qword [BASE]\n  |  cmp RB, 255;  ja ->fff_fallback\n  |  mov TMP2, RB\n  |.else\n  |  jae ->fff_fallback\n  |  fld qword [BASE]\n  |  fistp TMP2\n  |  cmp TMP2, 255;  ja ->fff_fallback\n  |.endif\n  |.if X64\n  |  mov TMP3, 1\n  |.else\n  |  mov ARG3, 1\n  |.endif\n  |  lea RDa, TMP2\t\t\t// Points to stack. Little-endian.\n  |->fff_newstr:\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |.if X64\n  |  mov CARG3d, TMP3\t\t\t// Zero-extended to size_t.\n  |  mov CARG2, RDa\t\t\t// May be 64 bit ptr to stack.\n  |  mov CARG1d, L:RB\n  |.else\n  |  mov ARG2, RD\n  |  mov ARG1, L:RB\n  |.endif\n  |  mov SAVE_PC, PC\n  |  call extern lj_str_new\t\t// (lua_State *L, char *str, size_t l)\n  |  // GCstr * returned in eax (RD).\n  |  mov BASE, L:RB->base\n  |  mov PC, [BASE-4]\n  |  mov dword [BASE-4], LJ_TSTR\n  |  mov [BASE-8], STR:RD\n  |  jmp ->fff_res1\n  |\n  |.ffunc string_sub\n  |  ffgccheck\n  |  mov TMP2, -1\n  |  cmp NARGS:RD, 1+2;  jb ->fff_fallback\n  |  jna >1\n  |  cmp dword [BASE+20], LJ_TISNUM\n  |.if DUALNUM\n  |  jne ->fff_fallback\n  |  mov RB, dword [BASE+16]\n  |  mov TMP2, RB\n  |.elif SSE\n  |  jae ->fff_fallback\n  |  cvttsd2si RB, qword [BASE+16]\n  |  mov TMP2, RB\n  |.else\n  |  jae ->fff_fallback\n  |  fld qword [BASE+16]\n  |  fistp TMP2\n  |.endif\n  |1:\n  |  cmp dword [BASE+4], LJ_TSTR;  jne ->fff_fallback\n  |  cmp dword [BASE+12], LJ_TISNUM\n  |.if DUALNUM\n  |  jne ->fff_fallback\n  |.else\n  |  jae ->fff_fallback\n  |.endif\n  |  mov STR:RB, [BASE]\n  |  mov TMP3, STR:RB\n  |  mov RB, STR:RB->len\n  |.if DUALNUM\n  |  mov RA, dword [BASE+8]\n  |.elif SSE\n  |  cvttsd2si RA, qword [BASE+8]\n  |.else\n  |  fld qword [BASE+8]\n  |  fistp ARG3\n  |  mov RA, ARG3\n  |.endif\n  |  mov RC, TMP2\n  |  cmp RB, RC\t\t\t\t// len < end? (unsigned compare)\n  |  jb >5\n  |2:\n  |  test RA, RA\t\t\t// start <= 0?\n  |  jle >7\n  |3:\n  |  mov STR:RB, TMP3\n  |  sub RC, RA\t\t\t\t// start > end?\n  |  jl ->fff_emptystr\n  |  lea RB, [STR:RB+RA+#STR-1]\n  |  add RC, 1\n  |4:\n  |.if X64\n  |  mov TMP3, RC\n  |.else\n  |  mov ARG3, RC\n  |.endif\n  |  mov RD, RB\n  |  jmp ->fff_newstr\n  |\n  |5:  // Negative end or overflow.\n  |  jl >6\n  |  lea RC, [RC+RB+1]\t\t\t// end = end+(len+1)\n  |  jmp <2\n  |6:  // Overflow.\n  |  mov RC, RB\t\t\t\t// end = len\n  |  jmp <2\n  |\n  |7:  // Negative start or underflow.\n  |  je >8\n  |  add RA, RB\t\t\t\t// start = start+(len+1)\n  |  add RA, 1\n  |  jg <3\t\t\t\t// start > 0?\n  |8:  // Underflow.\n  |  mov RA, 1\t\t\t\t// start = 1\n  |  jmp <3\n  |\n  |->fff_emptystr:  // Range underflow.\n  |  xor RC, RC\t\t\t\t// Zero length. Any ptr in RB is ok.\n  |  jmp <4\n  |\n  |.ffunc string_rep\t\t\t// Only handle the 1-char case inline.\n  |  ffgccheck\n  |  cmp NARGS:RD, 2+1; jne ->fff_fallback\t// Exactly 2 arguments.\n  |  cmp dword [BASE+4], LJ_TSTR;  jne ->fff_fallback\n  |  cmp dword [BASE+12], LJ_TISNUM\n  |  mov STR:RB, [BASE]\n  |.if DUALNUM\n  |  jne ->fff_fallback\n  |  mov RC, dword [BASE+8]\n  |.elif SSE\n  |  jae ->fff_fallback\n  |  cvttsd2si RC, qword [BASE+8]\n  |.else\n  |  jae ->fff_fallback\n  |  fld qword [BASE+8]\n  |  fistp TMP2\n  |  mov RC, TMP2\n  |.endif\n  |  test RC, RC\n  |  jle ->fff_emptystr\t\t\t// Count <= 0? (or non-int)\n  |  cmp dword STR:RB->len, 1\n  |  jb ->fff_emptystr\t\t\t// Zero length string?\n  |  jne ->fff_fallback_2\t\t// Fallback for > 1-char strings.\n  |  cmp [DISPATCH+DISPATCH_GL(tmpbuf.sz)], RC;  jb ->fff_fallback_2\n  |  movzx RA, byte STR:RB[1]\n  |  mov RB, [DISPATCH+DISPATCH_GL(tmpbuf.buf)]\n  |.if X64\n  |  mov TMP3, RC\n  |.else\n  |  mov ARG3, RC\n  |.endif\n  |1:  // Fill buffer with char. Yes, this is suboptimal code (do you care?).\n  |  mov [RB], RAL\n  |  add RB, 1\n  |  sub RC, 1\n  |  jnz <1\n  |  mov RD, [DISPATCH+DISPATCH_GL(tmpbuf.buf)]\n  |  jmp ->fff_newstr\n  |\n  |.ffunc_1 string_reverse\n  |  ffgccheck\n  |  cmp dword [BASE+4], LJ_TSTR;  jne ->fff_fallback\n  |  mov STR:RB, [BASE]\n  |  mov RC, STR:RB->len\n  |  test RC, RC\n  |  jz ->fff_emptystr\t\t\t// Zero length string?\n  |  cmp [DISPATCH+DISPATCH_GL(tmpbuf.sz)], RC;  jb ->fff_fallback_1\n  |  add RB, #STR\n  |  mov TMP2, PC\t\t\t// Need another temp register.\n  |.if X64\n  |  mov TMP3, RC\n  |.else\n  |  mov ARG3, RC\n  |.endif\n  |  mov PC, [DISPATCH+DISPATCH_GL(tmpbuf.buf)]\n  |1:\n  |  movzx RA, byte [RB]\n  |  add RB, 1\n  |  sub RC, 1\n  |  mov [PC+RC], RAL\n  |  jnz <1\n  |  mov RD, PC\n  |  mov PC, TMP2\n  |  jmp ->fff_newstr\n  |\n  |.macro ffstring_case, name, lo, hi\n  |  .ffunc_1 name\n  |  ffgccheck\n  |  cmp dword [BASE+4], LJ_TSTR;  jne ->fff_fallback\n  |  mov STR:RB, [BASE]\n  |  mov RC, STR:RB->len\n  |  cmp [DISPATCH+DISPATCH_GL(tmpbuf.sz)], RC;  jb ->fff_fallback_1\n  |  add RB, #STR\n  |  mov TMP2, PC\t\t\t// Need another temp register.\n  |.if X64\n  |  mov TMP3, RC\n  |.else\n  |  mov ARG3, RC\n  |.endif\n  |  mov PC, [DISPATCH+DISPATCH_GL(tmpbuf.buf)]\n  |  jmp >3\n  |1:  // ASCII case conversion. Yes, this is suboptimal code (do you care?).\n  |  movzx RA, byte [RB+RC]\n  |  cmp RA, lo\n  |  jb >2\n  |  cmp RA, hi\n  |  ja >2\n  |  xor RA, 0x20\n  |2:\n  |  mov [PC+RC], RAL\n  |3:\n  |  sub RC, 1\n  |  jns <1\n  |  mov RD, PC\n  |  mov PC, TMP2\n  |  jmp ->fff_newstr\n  |.endmacro\n  |\n  |ffstring_case string_lower, 0x41, 0x5a\n  |ffstring_case string_upper, 0x61, 0x7a\n  |\n  |//-- Table library ------------------------------------------------------\n  |\n  |.ffunc_1 table_getn\n  |  cmp dword [BASE+4], LJ_TTAB;  jne ->fff_fallback\n  |  mov RB, BASE\t\t\t// Save BASE.\n  |  mov TAB:FCARG1, [BASE]\n  |  call extern lj_tab_len@4\t\t// LJ_FASTCALL (GCtab *t)\n  |  // Length of table returned in eax (RD).\n  |  mov BASE, RB\t\t\t// Restore BASE.\n  |.if DUALNUM\n  |  mov RB, RD; jmp ->fff_resi\n  |.elif SSE\n  |  cvtsi2sd xmm0, RD; jmp ->fff_resxmm0\n  |.else\n  |  mov ARG1, RD; fild ARG1; jmp ->fff_resn\n  |.endif\n  |\n  |//-- Bit library --------------------------------------------------------\n  |\n  |.define TOBIT_BIAS, 0x59c00000\t// 2^52 + 2^51 (float, not double!).\n  |\n  |.macro .ffunc_bit, name, kind\n  |  .ffunc_1 name\n  |.if kind == 2\n  |.if SSE\n  |  sseconst_tobit xmm1, RBa\n  |.else\n  |  mov TMP1, TOBIT_BIAS\n  |.endif\n  |.endif\n  |  cmp dword [BASE+4], LJ_TISNUM\n  |.if DUALNUM\n  |  jne >1\n  |  mov RB, dword [BASE]\n  |.if kind > 0\n  |  jmp >2\n  |.else\n  |  jmp ->fff_resbit\n  |.endif\n  |1:\n  |  ja ->fff_fallback\n  |.else\n  |  jae ->fff_fallback\n  |.endif\n  |.if SSE\n  |  movsd xmm0, qword [BASE]\n  |.if kind < 2\n  |  sseconst_tobit xmm1, RBa\n  |.endif\n  |  addsd xmm0, xmm1\n  |  movd RB, xmm0\n  |.else\n  |  fld qword [BASE]\n  |.if kind < 2\n  |  mov TMP1, TOBIT_BIAS\n  |.endif\n  |  fadd TMP1\n  |  fstp FPARG1\n  |.if kind > 0\n  |  mov RB, ARG1\n  |.endif\n  |.endif\n  |2:\n  |.endmacro\n  |\n  |.ffunc_bit bit_tobit, 0\n  |.if DUALNUM or SSE\n  |.if not SSE\n  |  mov RB, ARG1\n  |.endif\n  |  jmp ->fff_resbit\n  |.else\n  |  fild ARG1\n  |  jmp ->fff_resn\n  |.endif\n  |\n  |.macro .ffunc_bit_op, name, ins\n  |  .ffunc_bit name, 2\n  |  mov TMP2, NARGS:RD\t\t\t// Save for fallback.\n  |  lea RD, [BASE+NARGS:RD*8-16]\n  |1:\n  |  cmp RD, BASE\n  |  jbe ->fff_resbit\n  |  cmp dword [RD+4], LJ_TISNUM\n  |.if DUALNUM\n  |  jne >2\n  |  ins RB, dword [RD]\n  |  sub RD, 8\n  |  jmp <1\n  |2:\n  |  ja ->fff_fallback_bit_op\n  |.else\n  |  jae ->fff_fallback_bit_op\n  |.endif\n  |.if SSE\n  |  movsd xmm0, qword [RD]\n  |  addsd xmm0, xmm1\n  |  movd RA, xmm0\n  |  ins RB, RA\n  |.else\n  |  fld qword [RD]\n  |  fadd TMP1\n  |  fstp FPARG1\n  |  ins RB, ARG1\n  |.endif\n  |  sub RD, 8\n  |  jmp <1\n  |.endmacro\n  |\n  |.ffunc_bit_op bit_band, and\n  |.ffunc_bit_op bit_bor, or\n  |.ffunc_bit_op bit_bxor, xor\n  |\n  |.ffunc_bit bit_bswap, 1\n  |  bswap RB\n  |  jmp ->fff_resbit\n  |\n  |.ffunc_bit bit_bnot, 1\n  |  not RB\n  |.if DUALNUM\n  |  jmp ->fff_resbit\n  |.elif SSE\n  |->fff_resbit:\n  |  cvtsi2sd xmm0, RB\n  |  jmp ->fff_resxmm0\n  |.else\n  |->fff_resbit:\n  |  mov ARG1, RB\n  |  fild ARG1\n  |  jmp ->fff_resn\n  |.endif\n  |\n  |->fff_fallback_bit_op:\n  |  mov NARGS:RD, TMP2\t\t\t// Restore for fallback\n  |  jmp ->fff_fallback\n  |\n  |.macro .ffunc_bit_sh, name, ins\n  |.if DUALNUM\n  |  .ffunc_bit name, 1\n  |  // Note: no inline conversion from number for 2nd argument!\n  |  cmp dword [BASE+12], LJ_TISNUM; jne ->fff_fallback\n  |  mov RA, dword [BASE+8]\n  |.elif SSE\n  |  .ffunc_nnsse name\n  |  sseconst_tobit xmm2, RBa\n  |  addsd xmm0, xmm2\n  |  addsd xmm1, xmm2\n  |  movd RB, xmm0\n  |  movd RA, xmm1\n  |.else\n  |  .ffunc_nn name\n  |  mov TMP1, TOBIT_BIAS\n  |  fadd TMP1\n  |  fstp FPARG3\n  |  fadd TMP1\n  |  fstp FPARG1\n  |  mov RA, ARG3\n  |  mov RB, ARG1\n  |.endif\n  |  ins RB, cl\t\t\t\t// Assumes RA is ecx.\n  |  jmp ->fff_resbit\n  |.endmacro\n  |\n  |.ffunc_bit_sh bit_lshift, shl\n  |.ffunc_bit_sh bit_rshift, shr\n  |.ffunc_bit_sh bit_arshift, sar\n  |.ffunc_bit_sh bit_rol, rol\n  |.ffunc_bit_sh bit_ror, ror\n  |\n  |//-----------------------------------------------------------------------\n  |\n  |->fff_fallback_2:\n  |  mov NARGS:RD, 1+2\t\t\t// Other args are ignored, anyway.\n  |  jmp ->fff_fallback\n  |->fff_fallback_1:\n  |  mov NARGS:RD, 1+1\t\t\t// Other args are ignored, anyway.\n  |->fff_fallback:\t\t\t// Call fast function fallback handler.\n  |  // BASE = new base, RD = nargs+1\n  |  mov L:RB, SAVE_L\n  |  mov PC, [BASE-4]\t\t\t// Fallback may overwrite PC.\n  |  mov SAVE_PC, PC\t\t\t// Redundant (but a defined value).\n  |  mov L:RB->base, BASE\n  |  lea RD, [BASE+NARGS:RD*8-8]\n  |  lea RA, [RD+8*LUA_MINSTACK]\t// Ensure enough space for handler.\n  |  mov L:RB->top, RD\n  |  mov CFUNC:RD, [BASE-8]\n  |  cmp RA, L:RB->maxstack\n  |  ja >5\t\t\t\t// Need to grow stack.\n  |.if X64\n  |  mov CARG1d, L:RB\n  |.else\n  |  mov ARG1, L:RB\n  |.endif\n  |  call aword CFUNC:RD->f\t\t// (lua_State *L)\n  |  mov BASE, L:RB->base\n  |  // Either throws an error, or recovers and returns -1, 0 or nresults+1.\n  |  test RD, RD;  jg ->fff_res\t\t// Returned nresults+1?\n  |1:\n  |  mov RA, L:RB->top\n  |  sub RA, BASE\n  |  shr RA, 3\n  |  test RD, RD\n  |  lea NARGS:RD, [RA+1]\n  |  mov LFUNC:RB, [BASE-8]\n  |  jne ->vm_call_tail\t\t\t// Returned -1?\n  |  ins_callt\t\t\t\t// Returned 0: retry fast path.\n  |\n  |// Reconstruct previous base for vmeta_call during tailcall.\n  |->vm_call_tail:\n  |  mov RA, BASE\n  |  test PC, FRAME_TYPE\n  |  jnz >3\n  |  movzx RB, PC_RA\n  |  not RBa\t\t\t\t// Note: ~RB = -(RB+1)\n  |  lea BASE, [BASE+RB*8]\t\t// base = base - (RB+1)*8\n  |  jmp ->vm_call_dispatch\t\t// Resolve again for tailcall.\n  |3:\n  |  mov RB, PC\n  |  and RB, -8\n  |  sub BASE, RB\n  |  jmp ->vm_call_dispatch\t\t// Resolve again for tailcall.\n  |\n  |5:  // Grow stack for fallback handler.\n  |  mov FCARG2, LUA_MINSTACK\n  |  mov FCARG1, L:RB\n  |  call extern lj_state_growstack@8\t// (lua_State *L, int n)\n  |  mov BASE, L:RB->base\n  |  xor RD, RD\t\t\t\t// Simulate a return 0.\n  |  jmp <1\t\t\t\t// Dumb retry (goes through ff first).\n  |\n  |->fff_gcstep:\t\t\t// Call GC step function.\n  |  // BASE = new base, RD = nargs+1\n  |  pop RBa\t\t\t\t// Must keep stack at same level.\n  |  mov TMPa, RBa\t\t\t// Save return address\n  |  mov L:RB, SAVE_L\n  |  mov SAVE_PC, PC\t\t\t// Redundant (but a defined value).\n  |  mov L:RB->base, BASE\n  |  lea RD, [BASE+NARGS:RD*8-8]\n  |  mov FCARG1, L:RB\n  |  mov L:RB->top, RD\n  |  call extern lj_gc_step@4\t\t// (lua_State *L)\n  |  mov BASE, L:RB->base\n  |  mov RD, L:RB->top\n  |  sub RD, BASE\n  |  shr RD, 3\n  |  add NARGS:RD, 1\n  |  mov RBa, TMPa\n  |  push RBa\t\t\t\t// Restore return address.\n  |  ret\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Special dispatch targets -------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->vm_record:\t\t\t\t// Dispatch target for recording phase.\n  |.if JIT\n  |  movzx RD, byte [DISPATCH+DISPATCH_GL(hookmask)]\n  |  test RDL, HOOK_VMEVENT\t\t// No recording while in vmevent.\n  |  jnz >5\n  |  // Decrement the hookcount for consistency, but always do the call.\n  |  test RDL, HOOK_ACTIVE\n  |  jnz >1\n  |  test RDL, LUA_MASKLINE|LUA_MASKCOUNT\n  |  jz >1\n  |  dec dword [DISPATCH+DISPATCH_GL(hookcount)]\n  |  jmp >1\n  |.endif\n  |\n  |->vm_rethook:\t\t\t// Dispatch target for return hooks.\n  |  movzx RD, byte [DISPATCH+DISPATCH_GL(hookmask)]\n  |  test RDL, HOOK_ACTIVE\t\t// Hook already active?\n  |  jnz >5\n  |  jmp >1\n  |\n  |->vm_inshook:\t\t\t// Dispatch target for instr/line hooks.\n  |  movzx RD, byte [DISPATCH+DISPATCH_GL(hookmask)]\n  |  test RDL, HOOK_ACTIVE\t\t// Hook already active?\n  |  jnz >5\n  |\n  |  test RDL, LUA_MASKLINE|LUA_MASKCOUNT\n  |  jz >5\n  |  dec dword [DISPATCH+DISPATCH_GL(hookcount)]\n  |  jz >1\n  |  test RDL, LUA_MASKLINE\n  |  jz >5\n  |1:\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |  mov FCARG2, PC\t\t\t// Caveat: FCARG2 == BASE\n  |  mov FCARG1, L:RB\n  |  // SAVE_PC must hold the _previous_ PC. The callee updates it with PC.\n  |  call extern lj_dispatch_ins@8\t// (lua_State *L, BCIns *pc)\n  |3:\n  |  mov BASE, L:RB->base\n  |4:\n  |  movzx RA, PC_RA\n  |5:\n  |  movzx OP, PC_OP\n  |  movzx RD, PC_RD\n  |.if X64\n  |  jmp aword [DISPATCH+OP*8+GG_DISP2STATIC]\t// Re-dispatch to static ins.\n  |.else\n  |  jmp aword [DISPATCH+OP*4+GG_DISP2STATIC]\t// Re-dispatch to static ins.\n  |.endif\n  |\n  |->cont_hook:\t\t\t\t// Continue from hook yield.\n  |  add PC, 4\n  |  mov RA, [RB-24]\n  |  mov MULTRES, RA\t\t\t// Restore MULTRES for *M ins.\n  |  jmp <4\n  |\n  |->vm_hotloop:\t\t\t// Hot loop counter underflow.\n  |.if JIT\n  |  mov LFUNC:RB, [BASE-8]\t\t// Same as curr_topL(L).\n  |  mov RB, LFUNC:RB->pc\n  |  movzx RD, byte [RB+PC2PROTO(framesize)]\n  |  lea RD, [BASE+RD*8]\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |  mov L:RB->top, RD\n  |  mov FCARG2, PC\n  |  lea FCARG1, [DISPATCH+GG_DISP2J]\n  |  mov aword [DISPATCH+DISPATCH_J(L)], L:RBa\n  |  mov SAVE_PC, PC\n  |  call extern lj_trace_hot@8\t\t// (jit_State *J, const BCIns *pc)\n  |  jmp <3\n  |.endif\n  |\n  |->vm_callhook:\t\t\t// Dispatch target for call hooks.\n  |  mov SAVE_PC, PC\n  |.if JIT\n  |  jmp >1\n  |.endif\n  |\n  |->vm_hotcall:\t\t\t// Hot call counter underflow.\n  |.if JIT\n  |  mov SAVE_PC, PC\n  |  or PC, 1\t\t\t\t// Marker for hot call.\n  |1:\n  |.endif\n  |  lea RD, [BASE+NARGS:RD*8-8]\n  |  mov L:RB, SAVE_L\n  |  mov L:RB->base, BASE\n  |  mov L:RB->top, RD\n  |  mov FCARG2, PC\n  |  mov FCARG1, L:RB\n  |  call extern lj_dispatch_call@8\t// (lua_State *L, const BCIns *pc)\n  |  // ASMFunction returned in eax/rax (RDa).\n  |  mov SAVE_PC, 0\t\t\t// Invalidate for subsequent line hook.\n  |.if JIT\n  |  and PC, -2\n  |.endif\n  |  mov BASE, L:RB->base\n  |  mov RAa, RDa\n  |  mov RD, L:RB->top\n  |  sub RD, BASE\n  |  mov RBa, RAa\n  |  movzx RA, PC_RA\n  |  shr RD, 3\n  |  add NARGS:RD, 1\n  |  jmp RBa\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Trace exit handler -------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// Called from an exit stub with the exit number on the stack.\n  |// The 16 bit exit number is stored with two (sign-extended) push imm8.\n  |->vm_exit_handler:\n  |.if JIT\n  |.if X64\n  |  push r13; push r12\n  |  push r11; push r10; push r9; push r8\n  |  push rdi; push rsi; push rbp; lea rbp, [rsp+88]; push rbp\n  |  push rbx; push rdx; push rcx; push rax\n  |  movzx RC, byte [rbp-8]\t\t// Reconstruct exit number.\n  |  mov RCH, byte [rbp-16]\n  |  mov [rbp-8], r15; mov [rbp-16], r14\n  |.else\n  |  push ebp; lea ebp, [esp+12]; push ebp\n  |  push ebx; push edx; push ecx; push eax\n  |  movzx RC, byte [ebp-4]\t\t// Reconstruct exit number.\n  |  mov RCH, byte [ebp-8]\n  |  mov [ebp-4], edi; mov [ebp-8], esi\n  |.endif\n  |  // Caveat: DISPATCH is ebx.\n  |  mov DISPATCH, [ebp]\n  |  mov RA, [DISPATCH+DISPATCH_GL(vmstate)]\t// Get trace number.\n  |  set_vmstate EXIT\n  |  mov [DISPATCH+DISPATCH_J(exitno)], RC\n  |  mov [DISPATCH+DISPATCH_J(parent)], RA\n  |.if X64\n  |.if X64WIN\n  |  sub rsp, 16*8+4*8\t\t\t// Room for SSE regs + save area.\n  |.else\n  |  sub rsp, 16*8\t\t\t// Room for SSE regs.\n  |.endif\n  |  add rbp, -128\n  |  movsd qword [rbp-8],   xmm15; movsd qword [rbp-16],  xmm14\n  |  movsd qword [rbp-24],  xmm13; movsd qword [rbp-32],  xmm12\n  |  movsd qword [rbp-40],  xmm11; movsd qword [rbp-48],  xmm10\n  |  movsd qword [rbp-56],  xmm9;  movsd qword [rbp-64],  xmm8\n  |  movsd qword [rbp-72],  xmm7;  movsd qword [rbp-80],  xmm6\n  |  movsd qword [rbp-88],  xmm5;  movsd qword [rbp-96],  xmm4\n  |  movsd qword [rbp-104], xmm3;  movsd qword [rbp-112], xmm2\n  |  movsd qword [rbp-120], xmm1;  movsd qword [rbp-128], xmm0\n  |.else\n  |  sub esp, 8*8+16\t\t\t// Room for SSE regs + args.\n  |  movsd qword [ebp-40], xmm7; movsd qword [ebp-48], xmm6\n  |  movsd qword [ebp-56], xmm5; movsd qword [ebp-64], xmm4\n  |  movsd qword [ebp-72], xmm3; movsd qword [ebp-80], xmm2\n  |  movsd qword [ebp-88], xmm1; movsd qword [ebp-96], xmm0\n  |.endif\n  |  // Caveat: RB is ebp.\n  |  mov L:RB, [DISPATCH+DISPATCH_GL(jit_L)]\n  |  mov BASE, [DISPATCH+DISPATCH_GL(jit_base)]\n  |  mov aword [DISPATCH+DISPATCH_J(L)], L:RBa\n  |  mov dword [DISPATCH+DISPATCH_GL(jit_L)], 0\n  |  mov L:RB->base, BASE\n  |.if X64WIN\n  |  lea CARG2, [rsp+4*8]\n  |.elif X64\n  |  mov CARG2, rsp\n  |.else\n  |  lea FCARG2, [esp+16]\n  |.endif\n  |  lea FCARG1, [DISPATCH+GG_DISP2J]\n  |  call extern lj_trace_exit@8\t// (jit_State *J, ExitState *ex)\n  |  // MULTRES or negated error code returned in eax (RD).\n  |  mov RAa, L:RB->cframe\n  |  and RAa, CFRAME_RAWMASK\n  |.if X64WIN\n  |  // Reposition stack later.\n  |.elif X64\n  |  mov rsp, RAa\t\t\t// Reposition stack to C frame.\n  |.else\n  |  mov esp, RAa\t\t\t// Reposition stack to C frame.\n  |.endif\n  |  mov [RAa+CFRAME_OFS_L], L:RB\t// Set SAVE_L (on-trace resume/yield).\n  |  mov BASE, L:RB->base\n  |  mov PC, [RAa+CFRAME_OFS_PC]\t// Get SAVE_PC.\n  |.if X64\n  |  jmp >1\n  |.endif\n  |.endif\n  |->vm_exit_interp:\n  |  // RD = MULTRES or negated error code, BASE, PC and DISPATCH set.\n  |.if JIT\n  |.if X64\n  |  // Restore additional callee-save registers only used in compiled code.\n  |.if X64WIN\n  |  lea RAa, [rsp+9*16+4*8]\n  |1:\n  |  movdqa xmm15, [RAa-9*16]\n  |  movdqa xmm14, [RAa-8*16]\n  |  movdqa xmm13, [RAa-7*16]\n  |  movdqa xmm12, [RAa-6*16]\n  |  movdqa xmm11, [RAa-5*16]\n  |  movdqa xmm10, [RAa-4*16]\n  |  movdqa xmm9, [RAa-3*16]\n  |  movdqa xmm8, [RAa-2*16]\n  |  movdqa xmm7, [RAa-1*16]\n  |  mov rsp, RAa\t\t\t// Reposition stack to C frame.\n  |  movdqa xmm6, [RAa]\n  |  mov r15, CSAVE_3\n  |  mov r14, CSAVE_4\n  |.else\n  |  add rsp, 16\t\t\t// Reposition stack to C frame.\n  |1:\n  |.endif\n  |  mov r13, TMPa\n  |  mov r12, TMPQ\n  |.endif\n  |  test RD, RD; js >3\t\t\t// Check for error from exit.\n  |  mov MULTRES, RD\n  |  mov LFUNC:KBASE, [BASE-8]\n  |  mov KBASE, LFUNC:KBASE->pc\n  |  mov KBASE, [KBASE+PC2PROTO(k)]\n  |  mov dword [DISPATCH+DISPATCH_GL(jit_L)], 0\n  |  set_vmstate INTERP\n  |  // Modified copy of ins_next which handles function header dispatch, too.\n  |  mov RC, [PC]\n  |  movzx RA, RCH\n  |  movzx OP, RCL\n  |  add PC, 4\n  |  shr RC, 16\n  |  cmp OP, BC_FUNCF\t\t\t// Function header?\n  |  jb >2\n  |  mov RC, MULTRES\t\t\t// RC/RD holds nres+1.\n  |2:\n  |.if X64\n  |  jmp aword [DISPATCH+OP*8]\n  |.else\n  |  jmp aword [DISPATCH+OP*4]\n  |.endif\n  |\n  |3:  // Rethrow error from the right C frame.\n  |  neg RD\n  |  mov FCARG1, L:RB\n  |  mov FCARG2, RD\n  |  call extern lj_err_throw@8\t\t// (lua_State *L, int errcode)\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Math helper functions ----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// FP value rounding. Called by math.floor/math.ceil fast functions\n  |// and from JIT code.\n  |\n  |// x87 variant: Arg/ret on x87 stack. No int/xmm registers modified.\n  |.macro vm_round_x87, mode1, mode2\n  |  fnstcw word [esp+4]\t\t// Caveat: overwrites ARG1 and ARG2.\n  |  mov [esp+8], eax\n  |  mov ax, mode1\n  |  or ax, [esp+4]\n  |.if mode2 ~= 0xffff\n  |  and ax, mode2\n  |.endif\n  |  mov [esp+6], ax\n  |  fldcw word [esp+6]\n  |  frndint\n  |  fldcw word [esp+4]\n  |  mov eax, [esp+8]\n  |  ret\n  |.endmacro\n  |\n  |// SSE variant: arg/ret is xmm0. xmm0-xmm3 and RD (eax) modified.\n  |.macro vm_round_sse, mode\n  |  sseconst_abs xmm2, RDa\n  |  sseconst_2p52 xmm3, RDa\n  |  movaps xmm1, xmm0\n  |  andpd xmm1, xmm2\t\t\t// |x|\n  |  ucomisd xmm3, xmm1\t\t\t// No truncation if 2^52 <= |x|.\n  |  jbe >1\n  |  andnpd xmm2, xmm0\t\t\t// Isolate sign bit.\n  |.if mode == 2\t\t// trunc(x)?\n  |  movaps xmm0, xmm1\n  |  addsd xmm1, xmm3\t\t\t// (|x| + 2^52) - 2^52\n  |  subsd xmm1, xmm3\n  |  sseconst_1 xmm3, RDa\n  |  cmpsd xmm0, xmm1, 1\t\t// |x| < result?\n  |  andpd xmm0, xmm3\n  |  subsd xmm1, xmm0\t\t\t// If yes, subtract -1.\n  |  orpd xmm1, xmm2\t\t\t// Merge sign bit back in.\n  |.else\n  |  addsd xmm1, xmm3\t\t\t// (|x| + 2^52) - 2^52\n  |  subsd xmm1, xmm3\n  |  orpd xmm1, xmm2\t\t\t// Merge sign bit back in.\n  |  .if mode == 1\t\t// ceil(x)?\n  |    sseconst_m1 xmm2, RDa\t\t// Must subtract -1 to preserve -0.\n  |    cmpsd xmm0, xmm1, 6\t\t// x > result?\n  |  .else\t\t\t// floor(x)?\n  |    sseconst_1 xmm2, RDa\n  |    cmpsd xmm0, xmm1, 1\t\t// x < result?\n  |  .endif\n  |  andpd xmm0, xmm2\n  |  subsd xmm1, xmm0\t\t\t// If yes, subtract +-1.\n  |.endif\n  |  movaps xmm0, xmm1\n  |1:\n  |  ret\n  |.endmacro\n  |\n  |.macro vm_round, name, ssemode, mode1, mode2\n  |->name:\n  |.if not SSE\n  |  vm_round_x87 mode1, mode2\n  |.endif\n  |->name .. _sse:\n  |  vm_round_sse ssemode\n  |.endmacro\n  |\n  |  vm_round vm_floor, 0, 0x0400, 0xf7ff\n  |  vm_round vm_ceil,  1, 0x0800, 0xfbff\n  |  vm_round vm_trunc, 2, 0x0c00, 0xffff\n  |\n  |// FP modulo x%y. Called by BC_MOD* and vm_arith.\n  |->vm_mod:\n  |.if SSE\n  |// Args in xmm0/xmm1, return value in xmm0.\n  |// Caveat: xmm0-xmm5 and RC (eax) modified!\n  |  movaps xmm5, xmm0\n  |  divsd xmm0, xmm1\n  |  sseconst_abs xmm2, RDa\n  |  sseconst_2p52 xmm3, RDa\n  |  movaps xmm4, xmm0\n  |  andpd xmm4, xmm2\t\t\t// |x/y|\n  |  ucomisd xmm3, xmm4\t\t\t// No truncation if 2^52 <= |x/y|.\n  |  jbe >1\n  |  andnpd xmm2, xmm0\t\t\t// Isolate sign bit.\n  |  addsd xmm4, xmm3\t\t\t// (|x/y| + 2^52) - 2^52\n  |  subsd xmm4, xmm3\n  |  orpd xmm4, xmm2\t\t\t// Merge sign bit back in.\n  |  sseconst_1 xmm2, RDa\n  |  cmpsd xmm0, xmm4, 1\t\t// x/y < result?\n  |  andpd xmm0, xmm2\n  |  subsd xmm4, xmm0\t\t\t// If yes, subtract 1.0.\n  |  movaps xmm0, xmm5\n  |  mulsd xmm1, xmm4\n  |  subsd xmm0, xmm1\n  |  ret\n  |1:\n  |  mulsd xmm1, xmm0\n  |  movaps xmm0, xmm5\n  |  subsd xmm0, xmm1\n  |  ret\n  |.else\n  |// Args/ret on x87 stack (y on top). No xmm registers modified.\n  |// Caveat: needs 3 slots on x87 stack! RC (eax) modified!\n  |  fld st1\n  |  fdiv st1\n  |  fnstcw word [esp+4]\n  |  mov ax, 0x0400\n  |  or ax, [esp+4]\n  |  and ax, 0xf7ff\n  |  mov [esp+6], ax\n  |  fldcw word [esp+6]\n  |  frndint\n  |  fldcw word [esp+4]\n  |  fmulp st1\n  |  fsubp st1\n  |  ret\n  |.endif\n  |\n  |// FP log2(x). Called by math.log(x, base).\n  |->vm_log2:\n  |.if X64WIN\n  |  movsd qword [rsp+8], xmm0\t\t// Use scratch area.\n  |  fld1\n  |  fld qword [rsp+8]\n  |  fyl2x\n  |  fstp qword [rsp+8]\n  |  movsd xmm0, qword [rsp+8]\n  |.elif X64\n  |  movsd qword [rsp-8], xmm0\t\t// Use red zone.\n  |  fld1\n  |  fld qword [rsp-8]\n  |  fyl2x\n  |  fstp qword [rsp-8]\n  |  movsd xmm0, qword [rsp-8]\n  |.else\n  |  fld1\n  |  fld qword [esp+4]\n  |  fyl2x\n  |.endif\n  |  ret\n  |\n  |// FP exponentiation e^x and 2^x. Called by math.exp fast function and\n  |// from JIT code. Arg/ret on x87 stack. No int/xmm regs modified.\n  |// Caveat: needs 3 slots on x87 stack!\n  |->vm_exp_x87:\n  |  fldl2e; fmulp st1\t\t\t\t// e^x ==> 2^(x*log2(e))\n  |->vm_exp2_x87:\n  |  .if X64WIN\n  |    .define expscratch, dword [rsp+8]\t// Use scratch area.\n  |  .elif X64\n  |    .define expscratch, dword [rsp-8]\t// Use red zone.\n  |  .else\n  |    .define expscratch, dword [esp+4]\t// Needs 4 byte scratch area.\n  |  .endif\n  |  fst expscratch\t\t\t\t// Caveat: overwrites ARG1.\n  |  cmp expscratch, 0x7f800000; je >1\t\t// Special case: e^+Inf = +Inf\n  |  cmp expscratch, 0xff800000; je >2\t\t// Special case: e^-Inf = 0\n  |->vm_exp2raw:  // Entry point for vm_pow. Without +-Inf check.\n  |  fdup; frndint; fsub st1, st0; fxch\t\t// Split into frac/int part.\n  |  f2xm1; fld1; faddp st1; fscale; fpop1\t// ==> (2^frac-1 +1) << int\n  |1:\n  |  ret\n  |2:\n  |  fpop; fldz; ret\n  |\n  |// Generic power function x^y. Called by BC_POW, math.pow fast function,\n  |// and vm_arith.\n  |// Args/ret on x87 stack (y on top). RC (eax) modified.\n  |// Caveat: needs 3 slots on x87 stack!\n  |->vm_pow:\n  |.if not SSE\n  |  fist dword [esp+4]\t\t\t// Store/reload int before comparison.\n  |  fild dword [esp+4]\t\t\t// Integral exponent used in vm_powi.\n  |  fucomip st1\n  |  jnz >8\t\t\t\t// Branch for FP exponents.\n  |  jp >9\t\t\t\t// Branch for NaN exponent.\n  |  fpop\t\t\t\t// Pop y and fallthrough to vm_powi.\n  |\n  |// FP/int power function x^i. Arg1/ret on x87 stack.\n  |// Arg2 (int) on C stack. RC (eax) modified.\n  |// Caveat: needs 2 slots on x87 stack!\n  |  mov eax, [esp+4]\n  |  cmp eax, 1; jle >6\t\t\t// i<=1?\n  |  // Now 1 < (unsigned)i <= 0x80000000.\n  |1:  // Handle leading zeros.\n  |  test eax, 1; jnz >2\n  |  fmul st0\n  |  shr eax, 1\n  |  jmp <1\n  |2:\n  |  shr eax, 1; jz >5\n  |  fdup\n  |3:  // Handle trailing bits.\n  |  fmul st0\n  |  shr eax, 1; jz >4\n  |  jnc <3\n  |  fmul st1, st0\n  |  jmp <3\n  |4:\n  |  fmulp st1\n  |5:\n  |  ret\n  |6:\n  |  je <5\t\t\t\t// x^1 ==> x\n  |  jb >7\n  |  fld1; fdivrp st1\n  |  neg eax\n  |  cmp eax, 1; je <5\t\t\t// x^-1 ==> 1/x\n  |  jmp <1\t\t\t\t// x^-i ==> (1/x)^i\n  |7:\n  |  fpop; fld1\t\t\t\t// x^0 ==> 1\n  |  ret\n  |\n  |8:  // FP/FP power function x^y.\n  |  fst dword [esp+4]\n  |  fxch\n  |  fst dword [esp+8]\n  |  mov eax, [esp+4]; shl eax, 1\n  |  cmp eax, 0xff000000; je >2\t\t\t// x^+-Inf?\n  |  mov eax, [esp+8]; shl eax, 1; je >4\t// +-0^y?\n  |  cmp eax, 0xff000000; je >4\t\t\t// +-Inf^y?\n  |  fyl2x\n  |  jmp ->vm_exp2raw\n  |\n  |9:  // Handle x^NaN.\n  |  fld1\n  |  fucomip st2\n  |  je >1\t\t\t\t// 1^NaN ==> 1\n  |  fxch\t\t\t\t// x^NaN ==> NaN\n  |1:\n  |  fpop\n  |  ret\n  |\n  |2:  // Handle x^+-Inf.\n  |  fabs\n  |  fld1\n  |  fucomip st1\n  |  je >3\t\t\t\t\t// +-1^+-Inf ==> 1\n  |  fpop; fabs; fldz; mov eax, 0; setc al\n  |  ror eax, 1; xor eax, [esp+4]; jns >3\t// |x|<>1, x^+-Inf ==> +Inf/0\n  |  fxch\n  |3:\n  |  fpop1; fabs\n  |  ret\n  |\n  |4:  // Handle +-0^y or +-Inf^y.\n  |  cmp dword [esp+4], 0; jge <3\t\t// y >= 0, x^y ==> |x|\n  |  fpop; fpop\n  |  test eax, eax; jz >5\t\t\t// y < 0, +-0^y ==> +Inf\n  |  fldz\t\t\t\t\t// y < 0, +-Inf^y ==> 0\n  |  ret\n  |5:\n  |  mov dword [esp+4], 0x7f800000\t\t// Return +Inf.\n  |  fld dword [esp+4]\n  |  ret\n  |.endif\n  |\n  |// Args in xmm0/xmm1. Ret in xmm0. xmm0-xmm2 and RC (eax) modified.\n  |// Needs 16 byte scratch area for x86. Also called from JIT code.\n  |->vm_pow_sse:\n  |  cvtsd2si eax, xmm1\n  |  cvtsi2sd xmm2, eax\n  |  ucomisd xmm1, xmm2\n  |  jnz >8\t\t\t\t// Branch for FP exponents.\n  |  jp >9\t\t\t\t// Branch for NaN exponent.\n  |  // Fallthrough to vm_powi_sse.\n  |\n  |// Args in xmm0/eax. Ret in xmm0. xmm0-xmm1 and eax modified.\n  |->vm_powi_sse:\n  |  cmp eax, 1; jle >6\t\t\t// i<=1?\n  |  // Now 1 < (unsigned)i <= 0x80000000.\n  |1:  // Handle leading zeros.\n  |  test eax, 1; jnz >2\n  |  mulsd xmm0, xmm0\n  |  shr eax, 1\n  |  jmp <1\n  |2:\n  |  shr eax, 1; jz >5\n  |  movaps xmm1, xmm0\n  |3:  // Handle trailing bits.\n  |  mulsd xmm0, xmm0\n  |  shr eax, 1; jz >4\n  |  jnc <3\n  |  mulsd xmm1, xmm0\n  |  jmp <3\n  |4:\n  |  mulsd xmm0, xmm1\n  |5:\n  |  ret\n  |6:\n  |  je <5\t\t\t\t// x^1 ==> x\n  |  jb >7\t\t\t\t// x^0 ==> 1\n  |  neg eax\n  |  call <1\n  |  sseconst_1 xmm1, RDa\n  |  divsd xmm1, xmm0\n  |  movaps xmm0, xmm1\n  |  ret\n  |7:\n  |  sseconst_1 xmm0, RDa\n  |  ret\n  |\n  |8:  // FP/FP power function x^y.\n  |.if X64\n  |  movd rax, xmm1; shl rax, 1\n  |  rol rax, 12; cmp rax, 0xffe; je >2\t\t// x^+-Inf?\n  |  movd rax, xmm0; shl rax, 1; je >4\t\t// +-0^y?\n  |  rol rax, 12; cmp rax, 0xffe; je >5\t\t// +-Inf^y?\n  |  .if X64WIN\n  |    movsd qword [rsp+16], xmm1\t\t// Use scratch area.\n  |    movsd qword [rsp+8], xmm0\n  |    fld qword [rsp+16]\n  |    fld qword [rsp+8]\n  |  .else\n  |    movsd qword [rsp-16], xmm1\t\t// Use red zone.\n  |    movsd qword [rsp-8], xmm0\n  |    fld qword [rsp-16]\n  |    fld qword [rsp-8]\n  |  .endif\n  |.else\n  |  movsd qword [esp+12], xmm1\t\t\t// Needs 16 byte scratch area.\n  |  movsd qword [esp+4], xmm0\n  |  cmp dword [esp+12], 0; jne >1\n  |  mov eax, [esp+16]; shl eax, 1\n  |  cmp eax, 0xffe00000; je >2\t\t\t// x^+-Inf?\n  |1:\n  |  cmp dword [esp+4], 0; jne >1\n  |  mov eax, [esp+8]; shl eax, 1; je >4\t// +-0^y?\n  |  cmp eax, 0xffe00000; je >5\t\t\t// +-Inf^y?\n  |1:\n  |  fld qword [esp+12]\n  |  fld qword [esp+4]\n  |.endif\n  |  fyl2x\t\t\t\t\t// y*log2(x)\n  |  fdup; frndint; fsub st1, st0; fxch\t\t// Split into frac/int part.\n  |  f2xm1; fld1; faddp st1; fscale; fpop1\t// ==> (2^frac-1 +1) << int\n  |.if X64WIN\n  |  fstp qword [rsp+8]\t\t\t\t// Use scratch area.\n  |  movsd xmm0, qword [rsp+8]\n  |.elif X64\n  |  fstp qword [rsp-8]\t\t\t\t// Use red zone.\n  |  movsd xmm0, qword [rsp-8]\n  |.else\n  |  fstp qword [esp+4]\t\t\t\t// Needs 8 byte scratch area.\n  |  movsd xmm0, qword [esp+4]\n  |.endif\n  |  ret\n  |\n  |9:  // Handle x^NaN.\n  |  sseconst_1 xmm2, RDa\n  |  ucomisd xmm0, xmm2; je >1\t\t\t// 1^NaN ==> 1\n  |  movaps xmm0, xmm1\t\t\t\t// x^NaN ==> NaN\n  |1:\n  |  ret\n  |\n  |2:  // Handle x^+-Inf.\n  |  sseconst_abs xmm2, RDa\n  |  andpd xmm0, xmm2\t\t\t\t// |x|\n  |  sseconst_1 xmm2, RDa\n  |  ucomisd xmm0, xmm2; je <1\t\t\t// +-1^+-Inf ==> 1\n  |  movmskpd eax, xmm1\n  |  xorps xmm0, xmm0\n  |  mov ah, al; setc al; xor al, ah; jne <1\t// |x|<>1, x^+-Inf ==> +Inf/0\n  |3:\n  |  sseconst_hi xmm0, RDa, 7ff00000  // +Inf\n  |  ret\n  |\n  |4:  // Handle +-0^y.\n  |  movmskpd eax, xmm1; test eax, eax; jnz <3\t// y < 0, +-0^y ==> +Inf\n  |  xorps xmm0, xmm0\t\t\t\t// y >= 0, +-0^y ==> 0\n  |  ret\n  |\n  |5:  // Handle +-Inf^y.\n  |  movmskpd eax, xmm1; test eax, eax; jz <3\t// y >= 0, +-Inf^y ==> +Inf\n  |  xorps xmm0, xmm0\t\t\t\t// y < 0, +-Inf^y ==> 0\n  |  ret\n  |\n  |// Callable from C: double lj_vm_foldfpm(double x, int fpm)\n  |// Computes fpm(x) for extended math functions. ORDER FPM.\n  |->vm_foldfpm:\n  |.if JIT\n  |.if X64\n  |  .if X64WIN\n  |    .define fpmop, CARG2d\n  |  .else\n  |    .define fpmop, CARG1d\n  |  .endif\n  |  cmp fpmop, 1; jb ->vm_floor; je ->vm_ceil\n  |  cmp fpmop, 3; jb ->vm_trunc; ja >2\n  |  sqrtsd xmm0, xmm0; ret\n  |2:\n  |  .if X64WIN\n  |    movsd qword [rsp+8], xmm0\t// Use scratch area.\n  |    fld qword [rsp+8]\n  |  .else\n  |    movsd qword [rsp-8], xmm0\t// Use red zone.\n  |    fld qword [rsp-8]\n  |  .endif\n  |  cmp fpmop, 5; ja >2\n  |  .if X64WIN; pop rax; .endif\n  |  je >1\n  |  call ->vm_exp_x87\n  |  .if X64WIN; push rax; .endif\n  |  jmp >7\n  |1:\n  |  call ->vm_exp2_x87\n  |  .if X64WIN; push rax; .endif\n  |  jmp >7\n  |2: ; cmp fpmop, 7; je >1; ja >2\n  |  fldln2; fxch; fyl2x; jmp >7\n  |1: ; fld1; fxch; fyl2x; jmp >7\n  |2: ; cmp fpmop, 9; je >1; ja >2\n  |  fldlg2; fxch; fyl2x; jmp >7\n  |1: ; fsin; jmp >7\n  |2: ; cmp fpmop, 11; je >1; ja >9\n  |   fcos; jmp >7\n  |1: ; fptan; fpop\n  |7:\n  |  .if X64WIN\n  |    fstp qword [rsp+8]\t\t// Use scratch area.\n  |    movsd xmm0, qword [rsp+8]\n  |  .else\n  |    fstp qword [rsp-8]\t\t// Use red zone.\n  |    movsd xmm0, qword [rsp-8]\n  |  .endif\n  |  ret\n  |.else  // x86 calling convention.\n  |  .define fpmop, eax\n  |.if SSE\n  |  mov fpmop, [esp+12]\n  |  movsd xmm0, qword [esp+4]\n  |  cmp fpmop, 1; je >1; ja >2\n  |  call ->vm_floor; jmp >7\n  |1: ; call ->vm_ceil; jmp >7\n  |2: ; cmp fpmop, 3; je >1; ja >2\n  |  call ->vm_trunc; jmp >7\n  |1:\n  |  sqrtsd xmm0, xmm0\n  |7:\n  |  movsd qword [esp+4], xmm0\t// Overwrite callee-owned args.\n  |  fld qword [esp+4]\n  |  ret\n  |2: ; fld qword [esp+4]\n  |  cmp fpmop, 5; jb ->vm_exp_x87; je ->vm_exp2_x87\n  |2: ; cmp fpmop, 7; je >1; ja >2\n  |  fldln2; fxch; fyl2x; ret\n  |1: ; fld1; fxch; fyl2x; ret\n  |2: ; cmp fpmop, 9; je >1; ja >2\n  |  fldlg2; fxch; fyl2x; ret\n  |1: ; fsin; ret\n  |2: ; cmp fpmop, 11; je >1; ja >9\n  |   fcos; ret\n  |1: ; fptan; fpop; ret\n  |.else\n  |  mov fpmop, [esp+12]\n  |  fld qword [esp+4]\n  |  cmp fpmop, 1; jb ->vm_floor; je ->vm_ceil\n  |  cmp fpmop, 3; jb ->vm_trunc; ja >2\n  |  fsqrt; ret\n  |2: ; cmp fpmop, 5; jb ->vm_exp_x87; je ->vm_exp2_x87\n  |  cmp fpmop, 7; je >1; ja >2\n  |  fldln2; fxch; fyl2x; ret\n  |1: ; fld1; fxch; fyl2x; ret\n  |2: ; cmp fpmop, 9; je >1; ja >2\n  |  fldlg2; fxch; fyl2x; ret\n  |1: ; fsin; ret\n  |2: ; cmp fpmop, 11; je >1; ja >9\n  |   fcos; ret\n  |1: ; fptan; fpop; ret\n  |.endif\n  |.endif\n  |9: ; int3\t\t\t\t\t// Bad fpm.\n  |.endif\n  |\n  |// Callable from C: double lj_vm_foldarith(double x, double y, int op)\n  |// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -)\n  |// and basic math functions. ORDER ARITH\n  |->vm_foldarith:\n  |.if X64\n  |\n  |  .if X64WIN\n  |    .define foldop, CARG3d\n  |  .else\n  |    .define foldop, CARG1d\n  |  .endif\n  |  cmp foldop, 1; je >1; ja >2\n  |  addsd xmm0, xmm1; ret\n  |1: ; subsd xmm0, xmm1; ret\n  |2: ; cmp foldop, 3; je >1; ja >2\n  |  mulsd xmm0, xmm1; ret\n  |1: ; divsd xmm0, xmm1; ret\n  |2: ; cmp foldop, 5; jb ->vm_mod; je ->vm_pow\n  |  cmp foldop, 7; je >1; ja >2\n  |  sseconst_sign xmm1, RDa; xorps xmm0, xmm1; ret\n  |1: ; sseconst_abs xmm1, RDa; andps xmm0, xmm1; ret\n  |2: ; cmp foldop, 9; ja >2\n  |.if X64WIN\n  |  movsd qword [rsp+8], xmm0\t// Use scratch area.\n  |  movsd qword [rsp+16], xmm1\n  |  fld qword [rsp+8]\n  |  fld qword [rsp+16]\n  |.else\n  |  movsd qword [rsp-8], xmm0\t// Use red zone.\n  |  movsd qword [rsp-16], xmm1\n  |  fld qword [rsp-8]\n  |  fld qword [rsp-16]\n  |.endif\n  |  je >1\n  |  fpatan\n  |7:\n  |.if X64WIN\n  |  fstp qword [rsp+8]\t\t// Use scratch area.\n  |  movsd xmm0, qword [rsp+8]\n  |.else\n  |  fstp qword [rsp-8]\t\t// Use red zone.\n  |  movsd xmm0, qword [rsp-8]\n  |.endif\n  |  ret\n  |1: ; fxch; fscale; fpop1; jmp <7\n  |2: ; cmp foldop, 11; je >1; ja >9\n  |  minsd xmm0, xmm1; ret\n  |1: ; maxsd xmm0, xmm1; ret\n  |9: ; int3\t\t\t\t// Bad op.\n  |\n  |.elif SSE  // x86 calling convention with SSE ops.\n  |\n  |  .define foldop, eax\n  |  mov foldop, [esp+20]\n  |  movsd xmm0, qword [esp+4]\n  |  movsd xmm1, qword [esp+12]\n  |  cmp foldop, 1; je >1; ja >2\n  |  addsd xmm0, xmm1\n  |7:\n  |  movsd qword [esp+4], xmm0\t// Overwrite callee-owned args.\n  |  fld qword [esp+4]\n  |  ret\n  |1: ; subsd xmm0, xmm1; jmp <7\n  |2: ; cmp foldop, 3; je >1; ja >2\n  |  mulsd xmm0, xmm1; jmp <7\n  |1: ; divsd xmm0, xmm1; jmp <7\n  |2: ; cmp foldop, 5\n  |  je >1; ja >2\n  |  call ->vm_mod; jmp <7\n  |1: ; pop edx; call ->vm_pow; push edx; jmp <7  // Writes to scratch area.\n  |2: ; cmp foldop, 7; je >1; ja >2\n  |  sseconst_sign xmm1, RDa; xorps xmm0, xmm1; jmp <7\n  |1: ; sseconst_abs xmm1, RDa; andps xmm0, xmm1; jmp <7\n  |2: ; cmp foldop, 9; ja >2\n  |  fld qword [esp+4]\t\t// Reload from stack\n  |  fld qword [esp+12]\n  |  je >1\n  |  fpatan; ret\n  |1: ; fxch; fscale; fpop1; ret\n  |2: ; cmp foldop, 11; je >1; ja >9\n  |  minsd xmm0, xmm1; jmp <7\n  |1: ; maxsd xmm0, xmm1; jmp <7\n  |9: ; int3\t\t\t\t// Bad op.\n  |\n  |.else  // x86 calling convention with x87 ops.\n  |\n  |  mov eax, [esp+20]\n  |  fld qword [esp+4]\n  |  fld qword [esp+12]\n  |  cmp eax, 1; je >1; ja >2\n  |  faddp st1; ret\n  |1: ; fsubp st1; ret\n  |2: ; cmp eax, 3; je >1; ja >2\n  |  fmulp st1; ret\n  |1: ; fdivp st1; ret\n  |2: ; cmp eax, 5; jb ->vm_mod; je ->vm_pow\n  |  cmp eax, 7; je >1; ja >2\n  |  fpop; fchs; ret\n  |1: ; fpop; fabs; ret\n  |2: ; cmp eax, 9; je >1; ja >2\n  |  fpatan; ret\n  |1: ; fxch; fscale; fpop1; ret\n  |2: ; cmp eax, 11; je >1; ja >9\n  |  fucomi st1; fcmovnbe st1; fpop1; ret\n  |1: ; fucomi st1; fcmovbe st1; fpop1; ret\n  |9: ; int3\t\t\t\t// Bad op.\n  |\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Miscellaneous functions --------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// int lj_vm_cpuid(uint32_t f, uint32_t res[4])\n  |->vm_cpuid:\n  |.if X64\n  |  mov eax, CARG1d\n  |  .if X64WIN; push rsi; mov rsi, CARG2; .endif\n  |  push rbx\n  |  cpuid\n  |  mov [rsi], eax\n  |  mov [rsi+4], ebx\n  |  mov [rsi+8], ecx\n  |  mov [rsi+12], edx\n  |  pop rbx\n  |  .if X64WIN; pop rsi; .endif\n  |  ret\n  |.else\n  |  pushfd\n  |  pop edx\n  |  mov ecx, edx\n  |  xor edx, 0x00200000\t\t// Toggle ID bit in flags.\n  |  push edx\n  |  popfd\n  |  pushfd\n  |  pop edx\n  |  xor eax, eax\t\t\t// Zero means no features supported.\n  |  cmp ecx, edx\n  |  jz >1\t\t\t\t// No ID toggle means no CPUID support.\n  |  mov eax, [esp+4]\t\t\t// Argument 1 is function number.\n  |  push edi\n  |  push ebx\n  |  cpuid\n  |  mov edi, [esp+16]\t\t\t// Argument 2 is result area.\n  |  mov [edi], eax\n  |  mov [edi+4], ebx\n  |  mov [edi+8], ecx\n  |  mov [edi+12], edx\n  |  pop ebx\n  |  pop edi\n  |1:\n  |  ret\n  |.endif\n  |\n  |//-----------------------------------------------------------------------\n  |//-- Assertions ---------------------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |->assert_bad_for_arg_type:\n#ifdef LUA_USE_ASSERT\n  |  int3\n#endif\n  |  int3\n  |\n  |//-----------------------------------------------------------------------\n  |//-- FFI helper functions -----------------------------------------------\n  |//-----------------------------------------------------------------------\n  |\n  |// Handler for callback functions. Callback slot number in ah/al.\n  |->vm_ffi_callback:\n  |.if FFI\n  |.type CTSTATE, CTState, PC\n  |.if not X64\n  |  sub esp, 16\t\t\t// Leave room for SAVE_ERRF etc.\n  |.endif\n  |  saveregs_\t// ebp/rbp already saved. ebp now holds global_State *.\n  |  lea DISPATCH, [ebp+GG_G2DISP]\n  |  mov CTSTATE, GL:ebp->ctype_state\n  |  movzx eax, ax\n  |  mov CTSTATE->cb.slot, eax\n  |.if X64\n  |  mov CTSTATE->cb.gpr[0], CARG1\n  |  mov CTSTATE->cb.gpr[1], CARG2\n  |  mov CTSTATE->cb.gpr[2], CARG3\n  |  mov CTSTATE->cb.gpr[3], CARG4\n  |  movsd qword CTSTATE->cb.fpr[0], xmm0\n  |  movsd qword CTSTATE->cb.fpr[1], xmm1\n  |  movsd qword CTSTATE->cb.fpr[2], xmm2\n  |  movsd qword CTSTATE->cb.fpr[3], xmm3\n  |.if X64WIN\n  |  lea rax, [rsp+CFRAME_SIZE+4*8]\n  |.else\n  |  lea rax, [rsp+CFRAME_SIZE]\n  |  mov CTSTATE->cb.gpr[4], CARG5\n  |  mov CTSTATE->cb.gpr[5], CARG6\n  |  movsd qword CTSTATE->cb.fpr[4], xmm4\n  |  movsd qword CTSTATE->cb.fpr[5], xmm5\n  |  movsd qword CTSTATE->cb.fpr[6], xmm6\n  |  movsd qword CTSTATE->cb.fpr[7], xmm7\n  |.endif\n  |  mov CTSTATE->cb.stack, rax\n  |  mov CARG2, rsp\n  |.else\n  |  lea eax, [esp+CFRAME_SIZE+16]\n  |  mov CTSTATE->cb.gpr[0], FCARG1\n  |  mov CTSTATE->cb.gpr[1], FCARG2\n  |  mov CTSTATE->cb.stack, eax\n  |  mov FCARG1, [esp+CFRAME_SIZE+12]\t// Move around misplaced retaddr/ebp.\n  |  mov FCARG2, [esp+CFRAME_SIZE+8]\n  |  mov SAVE_RET, FCARG1\n  |  mov SAVE_R4, FCARG2\n  |  mov FCARG2, esp\n  |.endif\n  |  mov SAVE_PC, CTSTATE\t\t// Any value outside of bytecode is ok.\n  |  mov FCARG1, CTSTATE\n  |  call extern lj_ccallback_enter@8\t// (CTState *cts, void *cf)\n  |  // lua_State * returned in eax (RD).\n  |  set_vmstate INTERP\n  |  mov BASE, L:RD->base\n  |  mov RD, L:RD->top\n  |  sub RD, BASE\n  |  mov LFUNC:RB, [BASE-8]\n  |  shr RD, 3\n  |  add RD, 1\n  |  ins_callt\n  |.endif\n  |\n  |->cont_ffi_callback:\t\t\t// Return from FFI callback.\n  |.if FFI\n  |  mov L:RA, SAVE_L\n  |  mov CTSTATE, [DISPATCH+DISPATCH_GL(ctype_state)]\n  |  mov aword CTSTATE->L, L:RAa\n  |  mov L:RA->base, BASE\n  |  mov L:RA->top, RB\n  |  mov FCARG1, CTSTATE\n  |  mov FCARG2, RC\n  |  call extern lj_ccallback_leave@8\t// (CTState *cts, TValue *o)\n  |.if X64\n  |  mov rax, CTSTATE->cb.gpr[0]\n  |  movsd xmm0, qword CTSTATE->cb.fpr[0]\n  |  jmp ->vm_leave_unw\n  |.else\n  |  mov L:RB, SAVE_L\n  |  mov eax, CTSTATE->cb.gpr[0]\n  |  mov edx, CTSTATE->cb.gpr[1]\n  |  cmp dword CTSTATE->cb.gpr[2], 1\n  |  jb >7\n  |  je >6\n  |  fld qword CTSTATE->cb.fpr[0].d\n  |  jmp >7\n  |6:\n  |  fld dword CTSTATE->cb.fpr[0].f\n  |7:\n  |  mov ecx, L:RB->top\n  |  movzx ecx, word [ecx+6]\t\t// Get stack adjustment and copy up.\n  |  mov SAVE_L, ecx\t\t\t// Must be one slot above SAVE_RET\n  |  restoreregs\n  |  pop ecx\t\t\t\t// Move return addr from SAVE_RET.\n  |  add esp, [esp]\t\t\t// Adjust stack.\n  |  add esp, 16\n  |  push ecx\n  |  ret\n  |.endif\n  |.endif\n  |\n  |->vm_ffi_call@4:\t\t\t// Call C function via FFI.\n  |  // Caveat: needs special frame unwinding, see below.\n  |.if FFI\n  |.if X64\n  |  .type CCSTATE, CCallState, rbx\n  |  push rbp; mov rbp, rsp; push rbx; mov CCSTATE, CARG1\n  |.else\n  |  .type CCSTATE, CCallState, ebx\n  |  push ebp; mov ebp, esp; push ebx; mov CCSTATE, FCARG1\n  |.endif\n  |\n  |  // Readjust stack.\n  |.if X64\n  |  mov eax, CCSTATE->spadj\n  |  sub rsp, rax\n  |.else\n  |  sub esp, CCSTATE->spadj\n  |.if WIN\n  |  mov CCSTATE->spadj, esp\n  |.endif\n  |.endif\n  |\n  |  // Copy stack slots.\n  |  movzx ecx, byte CCSTATE->nsp\n  |  sub ecx, 1\n  |  js >2\n  |1:\n  |.if X64\n  |  mov rax, [CCSTATE+rcx*8+offsetof(CCallState, stack)]\n  |  mov [rsp+rcx*8+CCALL_SPS_EXTRA*8], rax\n  |.else\n  |  mov eax, [CCSTATE+ecx*4+offsetof(CCallState, stack)]\n  |  mov [esp+ecx*4], eax\n  |.endif\n  |  sub ecx, 1\n  |  jns <1\n  |2:\n  |\n  |.if X64\n  |  movzx eax, byte CCSTATE->nfpr\n  |  mov CARG1, CCSTATE->gpr[0]\n  |  mov CARG2, CCSTATE->gpr[1]\n  |  mov CARG3, CCSTATE->gpr[2]\n  |  mov CARG4, CCSTATE->gpr[3]\n  |.if not X64WIN\n  |  mov CARG5, CCSTATE->gpr[4]\n  |  mov CARG6, CCSTATE->gpr[5]\n  |.endif\n  |  test eax, eax; jz >5\n  |  movaps xmm0, CCSTATE->fpr[0]\n  |  movaps xmm1, CCSTATE->fpr[1]\n  |  movaps xmm2, CCSTATE->fpr[2]\n  |  movaps xmm3, CCSTATE->fpr[3]\n  |.if not X64WIN\n  |  cmp eax, 4; jbe >5\n  |  movaps xmm4, CCSTATE->fpr[4]\n  |  movaps xmm5, CCSTATE->fpr[5]\n  |  movaps xmm6, CCSTATE->fpr[6]\n  |  movaps xmm7, CCSTATE->fpr[7]\n  |.endif\n  |5:\n  |.else\n  |  mov FCARG1, CCSTATE->gpr[0]\n  |  mov FCARG2, CCSTATE->gpr[1]\n  |.endif\n  |\n  |  call aword CCSTATE->func\n  |\n  |.if X64\n  |  mov CCSTATE->gpr[0], rax\n  |  movaps CCSTATE->fpr[0], xmm0\n  |.if not X64WIN\n  |  mov CCSTATE->gpr[1], rdx\n  |  movaps CCSTATE->fpr[1], xmm1\n  |.endif\n  |.else\n  |  mov CCSTATE->gpr[0], eax\n  |  mov CCSTATE->gpr[1], edx\n  |  cmp byte CCSTATE->resx87, 1\n  |  jb >7\n  |  je >6\n  |  fstp qword CCSTATE->fpr[0].d[0]\n  |  jmp >7\n  |6:\n  |  fstp dword CCSTATE->fpr[0].f[0]\n  |7:\n  |.if WIN\n  |  sub CCSTATE->spadj, esp\n  |.endif\n  |.endif\n  |\n  |.if X64\n  |  mov rbx, [rbp-8]; leave; ret\n  |.else\n  |  mov ebx, [ebp-4]; leave; ret\n  |.endif\n  |.endif\n  |// Note: vm_ffi_call must be the last function in this object file!\n  |\n  |//-----------------------------------------------------------------------\n}\n\n/* Generate the code for a single instruction. */\nstatic void build_ins(BuildCtx *ctx, BCOp op, int defop)\n{\n  int vk = 0;\n  |// Note: aligning all instructions does not pay off.\n  |=>defop:\n\n  switch (op) {\n\n  /* -- Comparison ops ---------------------------------------------------- */\n\n  /* Remember: all ops branch for a true comparison, fall through otherwise. */\n\n  |.macro jmp_comp, lt, ge, le, gt, target\n  ||switch (op) {\n  ||case BC_ISLT:\n  |   lt target\n  ||break;\n  ||case BC_ISGE:\n  |   ge target\n  ||break;\n  ||case BC_ISLE:\n  |   le target\n  ||break;\n  ||case BC_ISGT:\n  |   gt target\n  ||break;\n  ||default: break;  /* Shut up GCC. */\n  ||}\n  |.endmacro\n\n  case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:\n    |  // RA = src1, RD = src2, JMP with RD = target\n    |  ins_AD\n    |.if DUALNUM\n    |  checkint RA, >7\n    |  checkint RD, >8\n    |  mov RB, dword [BASE+RA*8]\n    |  add PC, 4\n    |  cmp RB, dword [BASE+RD*8]\n    |  jmp_comp jge, jl, jg, jle, >9\n    |6:\n    |  movzx RD, PC_RD\n    |  branchPC RD\n    |9:\n    |  ins_next\n    |\n    |7:  // RA is not an integer.\n    |  ja ->vmeta_comp\n    |  // RA is a number.\n    |  cmp dword [BASE+RD*8+4], LJ_TISNUM; jb >1; jne ->vmeta_comp\n    |  // RA is a number, RD is an integer.\n    |.if SSE\n    |  cvtsi2sd xmm0, dword [BASE+RD*8]\n    |  jmp >2\n    |.else\n    |  fld qword [BASE+RA*8]\n    |  fild dword [BASE+RD*8]\n    |  jmp >3\n    |.endif\n    |\n    |8:  // RA is an integer, RD is not an integer.\n    |  ja ->vmeta_comp\n    |  // RA is an integer, RD is a number.\n    |.if SSE\n    |  cvtsi2sd xmm1, dword [BASE+RA*8]\n    |  movsd xmm0, qword [BASE+RD*8]\n    |  add PC, 4\n    |  ucomisd xmm0, xmm1\n    |  jmp_comp jbe, ja, jb, jae, <9\n    |  jmp <6\n    |.else\n    |  fild dword [BASE+RA*8]\n    |  jmp >2\n    |.endif\n    |.else\n    |  checknum RA, ->vmeta_comp\n    |  checknum RD, ->vmeta_comp\n    |.endif\n    |.if SSE\n    |1:\n    |  movsd xmm0, qword [BASE+RD*8]\n    |2:\n    |  add PC, 4\n    |  ucomisd xmm0, qword [BASE+RA*8]\n    |3:\n    |.else\n    |1:\n    |  fld qword [BASE+RA*8]\t\t// Reverse order, i.e like cmp D, A.\n    |2:\n    |  fld qword [BASE+RD*8]\n    |3:\n    |  add PC, 4\n    |  fcomparepp\n    |.endif\n    |  // Unordered: all of ZF CF PF set, ordered: PF clear.\n    |  // To preserve NaN semantics GE/GT branch on unordered, but LT/LE don't.\n    |.if DUALNUM\n    |  jmp_comp jbe, ja, jb, jae, <9\n    |  jmp <6\n    |.else\n    |  jmp_comp jbe, ja, jb, jae, >1\n    |  movzx RD, PC_RD\n    |  branchPC RD\n    |1:\n    |  ins_next\n    |.endif\n    break;\n\n  case BC_ISEQV: case BC_ISNEV:\n    vk = op == BC_ISEQV;\n    |  ins_AD\t// RA = src1, RD = src2, JMP with RD = target\n    |  mov RB, [BASE+RD*8+4]\n    |  add PC, 4\n    |.if DUALNUM\n    |  cmp RB, LJ_TISNUM; jne >7\n    |  checkint RA, >8\n    |  mov RB, dword [BASE+RD*8]\n    |  cmp RB, dword [BASE+RA*8]\n    if (vk) {\n      |  jne >9\n    } else {\n      |  je >9\n    }\n    |  movzx RD, PC_RD\n    |  branchPC RD\n    |9:\n    |  ins_next\n    |\n    |7:  // RD is not an integer.\n    |  ja >5\n    |  // RD is a number.\n    |  cmp dword [BASE+RA*8+4], LJ_TISNUM; jb >1; jne >5\n    |  // RD is a number, RA is an integer.\n    |.if SSE\n    |  cvtsi2sd xmm0, dword [BASE+RA*8]\n    |.else\n    |  fild dword [BASE+RA*8]\n    |.endif\n    |  jmp >2\n    |\n    |8:  // RD is an integer, RA is not an integer.\n    |  ja >5\n    |  // RD is an integer, RA is a number.\n    |.if SSE\n    |  cvtsi2sd xmm0, dword [BASE+RD*8]\n    |  ucomisd xmm0, qword [BASE+RA*8]\n    |.else\n    |  fild dword [BASE+RD*8]\n    |  fld qword [BASE+RA*8]\n    |.endif\n    |  jmp >4\n    |\n    |.else\n    |  cmp RB, LJ_TISNUM; jae >5\n    |  checknum RA, >5\n    |.endif\n    |.if SSE\n    |1:\n    |  movsd xmm0, qword [BASE+RA*8]\n    |2:\n    |  ucomisd xmm0, qword [BASE+RD*8]\n    |4:\n    |.else\n    |1:\n    |  fld qword [BASE+RA*8]\n    |2:\n    |  fld qword [BASE+RD*8]\n    |4:\n    |  fcomparepp\n    |.endif\n  iseqne_fp:\n    if (vk) {\n      |  jp >2\t\t\t\t// Unordered means not equal.\n      |  jne >2\n    } else {\n      |  jp >2\t\t\t\t// Unordered means not equal.\n      |  je >1\n    }\n  iseqne_end:\n    if (vk) {\n      |1:\t\t\t\t// EQ: Branch to the target.\n      |  movzx RD, PC_RD\n      |  branchPC RD\n      |2:\t\t\t\t// NE: Fallthrough to next instruction.\n      |.if not FFI\n      |3:\n      |.endif\n    } else {\n      |.if not FFI\n      |3:\n      |.endif\n      |2:\t\t\t\t// NE: Branch to the target.\n      |  movzx RD, PC_RD\n      |  branchPC RD\n      |1:\t\t\t\t// EQ: Fallthrough to next instruction.\n    }\n    if (LJ_DUALNUM && (op == BC_ISEQV || op == BC_ISNEV ||\n\t\t       op == BC_ISEQN || op == BC_ISNEN)) {\n      |  jmp <9\n    } else {\n      |  ins_next\n    }\n    |\n    if (op == BC_ISEQV || op == BC_ISNEV) {\n      |5:  // Either or both types are not numbers.\n      |.if FFI\n      |  cmp RB, LJ_TCDATA; je ->vmeta_equal_cd\n      |  checktp RA, LJ_TCDATA; je ->vmeta_equal_cd\n      |.endif\n      |  checktp RA, RB\t\t\t// Compare types.\n      |  jne <2\t\t\t\t// Not the same type?\n      |  cmp RB, LJ_TISPRI\n      |  jae <1\t\t\t\t// Same type and primitive type?\n      |\n      |  // Same types and not a primitive type. Compare GCobj or pvalue.\n      |  mov RA, [BASE+RA*8]\n      |  mov RD, [BASE+RD*8]\n      |  cmp RA, RD\n      |  je <1\t\t\t\t// Same GCobjs or pvalues?\n      |  cmp RB, LJ_TISTABUD\n      |  ja <2\t\t\t\t// Different objects and not table/ud?\n      |.if X64\n      |  cmp RB, LJ_TUDATA\t\t// And not 64 bit lightuserdata.\n      |  jb <2\n      |.endif\n      |\n      |  // Different tables or userdatas. Need to check __eq metamethod.\n      |  // Field metatable must be at same offset for GCtab and GCudata!\n      |  mov TAB:RB, TAB:RA->metatable\n      |  test TAB:RB, TAB:RB\n      |  jz <2\t\t\t\t// No metatable?\n      |  test byte TAB:RB->nomm, 1<<MM_eq\n      |  jnz <2\t\t\t\t// Or 'no __eq' flag set?\n      if (vk) {\n\t|  xor RB, RB\t\t\t// ne = 0\n      } else {\n\t|  mov RB, 1\t\t\t// ne = 1\n      }\n      |  jmp ->vmeta_equal\t\t// Handle __eq metamethod.\n    } else {\n      |.if FFI\n      |3:\n      |  cmp RB, LJ_TCDATA\n      if (LJ_DUALNUM && vk) {\n\t|  jne <9\n      } else {\n\t|  jne <2\n      }\n      |  jmp ->vmeta_equal_cd\n      |.endif\n    }\n    break;\n  case BC_ISEQS: case BC_ISNES:\n    vk = op == BC_ISEQS;\n    |  ins_AND\t// RA = src, RD = str const, JMP with RD = target\n    |  mov RB, [BASE+RA*8+4]\n    |  add PC, 4\n    |  cmp RB, LJ_TSTR; jne >3\n    |  mov RA, [BASE+RA*8]\n    |  cmp RA, [KBASE+RD*4]\n  iseqne_test:\n    if (vk) {\n      |  jne >2\n    } else {\n      |  je >1\n    }\n    goto iseqne_end;\n  case BC_ISEQN: case BC_ISNEN:\n    vk = op == BC_ISEQN;\n    |  ins_AD\t// RA = src, RD = num const, JMP with RD = target\n    |  mov RB, [BASE+RA*8+4]\n    |  add PC, 4\n    |.if DUALNUM\n    |  cmp RB, LJ_TISNUM; jne >7\n    |  cmp dword [KBASE+RD*8+4], LJ_TISNUM; jne >8\n    |  mov RB, dword [KBASE+RD*8]\n    |  cmp RB, dword [BASE+RA*8]\n    if (vk) {\n      |  jne >9\n    } else {\n      |  je >9\n    }\n    |  movzx RD, PC_RD\n    |  branchPC RD\n    |9:\n    |  ins_next\n    |\n    |7:  // RA is not an integer.\n    |  ja >3\n    |  // RA is a number.\n    |  cmp dword [KBASE+RD*8+4], LJ_TISNUM; jb >1\n    |  // RA is a number, RD is an integer.\n    |.if SSE\n    |  cvtsi2sd xmm0, dword [KBASE+RD*8]\n    |.else\n    |  fild dword [KBASE+RD*8]\n    |.endif\n    |  jmp >2\n    |\n    |8:  // RA is an integer, RD is a number.\n    |.if SSE\n    |  cvtsi2sd xmm0, dword [BASE+RA*8]\n    |  ucomisd xmm0, qword [KBASE+RD*8]\n    |.else\n    |  fild dword [BASE+RA*8]\n    |  fld qword [KBASE+RD*8]\n    |.endif\n    |  jmp >4\n    |.else\n    |  cmp RB, LJ_TISNUM; jae >3\n    |.endif\n    |.if SSE\n    |1:\n    |  movsd xmm0, qword [KBASE+RD*8]\n    |2:\n    |  ucomisd xmm0, qword [BASE+RA*8]\n    |4:\n    |.else\n    |1:\n    |  fld qword [KBASE+RD*8]\n    |2:\n    |  fld qword [BASE+RA*8]\n    |4:\n    |  fcomparepp\n    |.endif\n    goto iseqne_fp;\n  case BC_ISEQP: case BC_ISNEP:\n    vk = op == BC_ISEQP;\n    |  ins_AND\t// RA = src, RD = primitive type (~), JMP with RD = target\n    |  mov RB, [BASE+RA*8+4]\n    |  add PC, 4\n    |  cmp RB, RD\n    if (!LJ_HASFFI) goto iseqne_test;\n    if (vk) {\n      |  jne >3\n      |  movzx RD, PC_RD\n      |  branchPC RD\n      |2:\n      |  ins_next\n      |3:\n      |  cmp RB, LJ_TCDATA; jne <2\n      |  jmp ->vmeta_equal_cd\n    } else {\n      |  je >2\n      |  cmp RB, LJ_TCDATA; je ->vmeta_equal_cd\n      |  movzx RD, PC_RD\n      |  branchPC RD\n      |2:\n      |  ins_next\n    }\n    break;\n\n  /* -- Unary test and copy ops ------------------------------------------- */\n\n  case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:\n    |  ins_AD\t// RA = dst or unused, RD = src, JMP with RD = target\n    |  mov RB, [BASE+RD*8+4]\n    |  add PC, 4\n    |  cmp RB, LJ_TISTRUECOND\n    if (op == BC_IST || op == BC_ISTC) {\n      |  jae >1\n    } else {\n      |  jb >1\n    }\n    if (op == BC_ISTC || op == BC_ISFC) {\n      |  mov [BASE+RA*8+4], RB\n      |  mov RB, [BASE+RD*8]\n      |  mov [BASE+RA*8], RB\n    }\n    |  movzx RD, PC_RD\n    |  branchPC RD\n    |1:\t\t\t\t\t// Fallthrough to the next instruction.\n    |  ins_next\n    break;\n\n  /* -- Unary ops --------------------------------------------------------- */\n\n  case BC_MOV:\n    |  ins_AD\t// RA = dst, RD = src\n    |.if X64\n    |  mov RBa, [BASE+RD*8]\n    |  mov [BASE+RA*8], RBa\n    |.else\n    |  mov RB, [BASE+RD*8+4]\n    |  mov RD, [BASE+RD*8]\n    |  mov [BASE+RA*8+4], RB\n    |  mov [BASE+RA*8], RD\n    |.endif\n    |  ins_next_\n    break;\n  case BC_NOT:\n    |  ins_AD\t// RA = dst, RD = src\n    |  xor RB, RB\n    |  checktp RD, LJ_TISTRUECOND\n    |  adc RB, LJ_TTRUE\n    |  mov [BASE+RA*8+4], RB\n    |  ins_next\n    break;\n  case BC_UNM:\n    |  ins_AD\t// RA = dst, RD = src\n    |.if DUALNUM\n    |  checkint RD, >5\n    |  mov RB, [BASE+RD*8]\n    |  neg RB\n    |  jo >4\n    |  mov dword [BASE+RA*8+4], LJ_TISNUM\n    |  mov dword [BASE+RA*8], RB\n    |9:\n    |  ins_next\n    |4:\n    |  mov dword [BASE+RA*8+4], 0x41e00000  // 2^31.\n    |  mov dword [BASE+RA*8], 0\n    |  jmp <9\n    |5:\n    |  ja ->vmeta_unm\n    |.else\n    |  checknum RD, ->vmeta_unm\n    |.endif\n    |.if SSE\n    |  movsd xmm0, qword [BASE+RD*8]\n    |  sseconst_sign xmm1, RDa\n    |  xorps xmm0, xmm1\n    |  movsd qword [BASE+RA*8], xmm0\n    |.else\n    |  fld qword [BASE+RD*8]\n    |  fchs\n    |  fstp qword [BASE+RA*8]\n    |.endif\n    |.if DUALNUM\n    |  jmp <9\n    |.else\n    |  ins_next\n    |.endif\n    break;\n  case BC_LEN:\n    |  ins_AD\t// RA = dst, RD = src\n    |  checkstr RD, >2\n    |  mov STR:RD, [BASE+RD*8]\n    |.if DUALNUM\n    |  mov RD, dword STR:RD->len\n    |1:\n    |  mov dword [BASE+RA*8+4], LJ_TISNUM\n    |  mov dword [BASE+RA*8], RD\n    |.elif SSE\n    |  xorps xmm0, xmm0\n    |  cvtsi2sd xmm0, dword STR:RD->len\n    |1:\n    |  movsd qword [BASE+RA*8], xmm0\n    |.else\n    |  fild dword STR:RD->len\n    |1:\n    |  fstp qword [BASE+RA*8]\n    |.endif\n    |  ins_next\n    |2:\n    |  checktab RD, ->vmeta_len\n    |  mov TAB:FCARG1, [BASE+RD*8]\n#if LJ_52\n    |  mov TAB:RB, TAB:FCARG1->metatable\n    |  cmp TAB:RB, 0\n    |  jnz >9\n    |3:\n#endif\n    |->BC_LEN_Z:\n    |  mov RB, BASE\t\t\t// Save BASE.\n    |  call extern lj_tab_len@4\t\t// (GCtab *t)\n    |  // Length of table returned in eax (RD).\n    |.if DUALNUM\n    |  // Nothing to do.\n    |.elif SSE\n    |  cvtsi2sd xmm0, RD\n    |.else\n    |  mov ARG1, RD\n    |  fild ARG1\n    |.endif\n    |  mov BASE, RB\t\t\t// Restore BASE.\n    |  movzx RA, PC_RA\n    |  jmp <1\n#if LJ_52\n    |9:  // Check for __len.\n    |  test byte TAB:RB->nomm, 1<<MM_len\n    |  jnz <3\n    |  jmp ->vmeta_len\t\t\t// 'no __len' flag NOT set: check.\n#endif\n    break;\n\n  /* -- Binary ops -------------------------------------------------------- */\n\n    |.macro ins_arithpre, x87ins, sseins, ssereg\n    |  ins_ABC\n    ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);\n    ||switch (vk) {\n    ||case 0:\n    |   checknum RB, ->vmeta_arith_vn\n    |   .if DUALNUM\n    |     cmp dword [KBASE+RC*8+4], LJ_TISNUM; jae ->vmeta_arith_vn\n    |   .endif\n    |   .if SSE\n    |     movsd xmm0, qword [BASE+RB*8]\n    |     sseins ssereg, qword [KBASE+RC*8]\n    |   .else\n    |     fld qword [BASE+RB*8]\n    |     x87ins qword [KBASE+RC*8]\n    |   .endif\n    ||  break;\n    ||case 1:\n    |   checknum RB, ->vmeta_arith_nv\n    |   .if DUALNUM\n    |     cmp dword [KBASE+RC*8+4], LJ_TISNUM; jae ->vmeta_arith_nv\n    |   .endif\n    |   .if SSE\n    |     movsd xmm0, qword [KBASE+RC*8]\n    |     sseins ssereg, qword [BASE+RB*8]\n    |   .else\n    |     fld qword [KBASE+RC*8]\n    |     x87ins qword [BASE+RB*8]\n    |   .endif\n    ||  break;\n    ||default:\n    |   checknum RB, ->vmeta_arith_vv\n    |   checknum RC, ->vmeta_arith_vv\n    |   .if SSE\n    |     movsd xmm0, qword [BASE+RB*8]\n    |     sseins ssereg, qword [BASE+RC*8]\n    |   .else\n    |     fld qword [BASE+RB*8]\n    |     x87ins qword [BASE+RC*8]\n    |   .endif\n    ||  break;\n    ||}\n    |.endmacro\n    |\n    |.macro ins_arithdn, intins\n    |  ins_ABC\n    ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);\n    ||switch (vk) {\n    ||case 0:\n    |   checkint RB, ->vmeta_arith_vn\n    |   cmp dword [KBASE+RC*8+4], LJ_TISNUM; jne ->vmeta_arith_vn\n    |   mov RB, [BASE+RB*8]\n    |   intins RB, [KBASE+RC*8]; jo ->vmeta_arith_vno\n    ||  break;\n    ||case 1:\n    |   checkint RB, ->vmeta_arith_nv\n    |   cmp dword [KBASE+RC*8+4], LJ_TISNUM; jne ->vmeta_arith_nv\n    |   mov RC, [KBASE+RC*8]\n    |   intins RC, [BASE+RB*8]; jo ->vmeta_arith_nvo\n    ||  break;\n    ||default:\n    |   checkint RB, ->vmeta_arith_vv\n    |   checkint RC, ->vmeta_arith_vv\n    |   mov RB, [BASE+RB*8]\n    |   intins RB, [BASE+RC*8]; jo ->vmeta_arith_vvo\n    ||  break;\n    ||}\n    |  mov dword [BASE+RA*8+4], LJ_TISNUM\n    ||if (vk == 1) {\n    |   mov dword [BASE+RA*8], RC\n    ||} else {\n    |   mov dword [BASE+RA*8], RB\n    ||}\n    |  ins_next\n    |.endmacro\n    |\n    |.macro ins_arithpost\n    |.if SSE\n    |  movsd qword [BASE+RA*8], xmm0\n    |.else\n    |  fstp qword [BASE+RA*8]\n    |.endif\n    |.endmacro\n    |\n    |.macro ins_arith, x87ins, sseins\n    |  ins_arithpre x87ins, sseins, xmm0\n    |  ins_arithpost\n    |  ins_next\n    |.endmacro\n    |\n    |.macro ins_arith, intins, x87ins, sseins\n    |.if DUALNUM\n    |  ins_arithdn intins\n    |.else\n    |  ins_arith, x87ins, sseins\n    |.endif\n    |.endmacro\n\n    |  // RA = dst, RB = src1 or num const, RC = src2 or num const\n  case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:\n    |  ins_arith add, fadd, addsd\n    break;\n  case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:\n    |  ins_arith sub, fsub, subsd\n    break;\n  case BC_MULVN: case BC_MULNV: case BC_MULVV:\n    |  ins_arith imul, fmul, mulsd\n    break;\n  case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:\n    |  ins_arith fdiv, divsd\n    break;\n  case BC_MODVN:\n    |  ins_arithpre fld, movsd, xmm1\n    |->BC_MODVN_Z:\n    |  call ->vm_mod\n    |  ins_arithpost\n    |  ins_next\n    break;\n  case BC_MODNV: case BC_MODVV:\n    |  ins_arithpre fld, movsd, xmm1\n    |  jmp ->BC_MODVN_Z\t\t\t// Avoid 3 copies. It's slow anyway.\n    break;\n  case BC_POW:\n    |  ins_arithpre fld, movsd, xmm1\n    |  call ->vm_pow\n    |  ins_arithpost\n    |  ins_next\n    break;\n\n  case BC_CAT:\n    |  ins_ABC\t// RA = dst, RB = src_start, RC = src_end\n    |.if X64\n    |  mov L:CARG1d, SAVE_L\n    |  mov L:CARG1d->base, BASE\n    |  lea CARG2d, [BASE+RC*8]\n    |  mov CARG3d, RC\n    |  sub CARG3d, RB\n    |->BC_CAT_Z:\n    |  mov L:RB, L:CARG1d\n    |.else\n    |  lea RA, [BASE+RC*8]\n    |  sub RC, RB\n    |  mov ARG2, RA\n    |  mov ARG3, RC\n    |->BC_CAT_Z:\n    |  mov L:RB, SAVE_L\n    |  mov ARG1, L:RB\n    |  mov L:RB->base, BASE\n    |.endif\n    |  mov SAVE_PC, PC\n    |  call extern lj_meta_cat\t\t// (lua_State *L, TValue *top, int left)\n    |  // NULL (finished) or TValue * (metamethod) returned in eax (RC).\n    |  mov BASE, L:RB->base\n    |  test RC, RC\n    |  jnz ->vmeta_binop\n    |  movzx RB, PC_RB\t\t\t// Copy result to Stk[RA] from Stk[RB].\n    |  movzx RA, PC_RA\n    |.if X64\n    |  mov RCa, [BASE+RB*8]\n    |  mov [BASE+RA*8], RCa\n    |.else\n    |  mov RC, [BASE+RB*8+4]\n    |  mov RB, [BASE+RB*8]\n    |  mov [BASE+RA*8+4], RC\n    |  mov [BASE+RA*8], RB\n    |.endif\n    |  ins_next\n    break;\n\n  /* -- Constant ops ------------------------------------------------------ */\n\n  case BC_KSTR:\n    |  ins_AND\t// RA = dst, RD = str const (~)\n    |  mov RD, [KBASE+RD*4]\n    |  mov dword [BASE+RA*8+4], LJ_TSTR\n    |  mov [BASE+RA*8], RD\n    |  ins_next\n    break;\n  case BC_KCDATA:\n    |.if FFI\n    |  ins_AND\t// RA = dst, RD = cdata const (~)\n    |  mov RD, [KBASE+RD*4]\n    |  mov dword [BASE+RA*8+4], LJ_TCDATA\n    |  mov [BASE+RA*8], RD\n    |  ins_next\n    |.endif\n    break;\n  case BC_KSHORT:\n    |  ins_AD\t// RA = dst, RD = signed int16 literal\n    |.if DUALNUM\n    |  movsx RD, RDW\n    |  mov dword [BASE+RA*8+4], LJ_TISNUM\n    |  mov dword [BASE+RA*8], RD\n    |.elif SSE\n    |  movsx RD, RDW\t\t\t// Sign-extend literal.\n    |  cvtsi2sd xmm0, RD\n    |  movsd qword [BASE+RA*8], xmm0\n    |.else\n    |  fild PC_RD\t\t\t// Refetch signed RD from instruction.\n    |  fstp qword [BASE+RA*8]\n    |.endif\n    |  ins_next\n    break;\n  case BC_KNUM:\n    |  ins_AD\t// RA = dst, RD = num const\n    |.if SSE\n    |  movsd xmm0, qword [KBASE+RD*8]\n    |  movsd qword [BASE+RA*8], xmm0\n    |.else\n    |  fld qword [KBASE+RD*8]\n    |  fstp qword [BASE+RA*8]\n    |.endif\n    |  ins_next\n    break;\n  case BC_KPRI:\n    |  ins_AND\t// RA = dst, RD = primitive type (~)\n    |  mov [BASE+RA*8+4], RD\n    |  ins_next\n    break;\n  case BC_KNIL:\n    |  ins_AD\t// RA = dst_start, RD = dst_end\n    |  lea RA, [BASE+RA*8+12]\n    |  lea RD, [BASE+RD*8+4]\n    |  mov RB, LJ_TNIL\n    |  mov [RA-8], RB\t\t\t// Sets minimum 2 slots.\n    |1:\n    |  mov [RA], RB\n    |  add RA, 8\n    |  cmp RA, RD\n    |  jbe <1\n    |  ins_next\n    break;\n\n  /* -- Upvalue and function ops ------------------------------------------ */\n\n  case BC_UGET:\n    |  ins_AD\t// RA = dst, RD = upvalue #\n    |  mov LFUNC:RB, [BASE-8]\n    |  mov UPVAL:RB, [LFUNC:RB+RD*4+offsetof(GCfuncL, uvptr)]\n    |  mov RB, UPVAL:RB->v\n    |.if X64\n    |  mov RDa, [RB]\n    |  mov [BASE+RA*8], RDa\n    |.else\n    |  mov RD, [RB+4]\n    |  mov RB, [RB]\n    |  mov [BASE+RA*8+4], RD\n    |  mov [BASE+RA*8], RB\n    |.endif\n    |  ins_next\n    break;\n  case BC_USETV:\n#define TV2MARKOFS \\\n ((int32_t)offsetof(GCupval, marked)-(int32_t)offsetof(GCupval, tv))\n    |  ins_AD\t// RA = upvalue #, RD = src\n    |  mov LFUNC:RB, [BASE-8]\n    |  mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)]\n    |  cmp byte UPVAL:RB->closed, 0\n    |  mov RB, UPVAL:RB->v\n    |  mov RA, [BASE+RD*8]\n    |  mov RD, [BASE+RD*8+4]\n    |  mov [RB], RA\n    |  mov [RB+4], RD\n    |  jz >1\n    |  // Check barrier for closed upvalue.\n    |  test byte [RB+TV2MARKOFS], LJ_GC_BLACK\t\t// isblack(uv)\n    |  jnz >2\n    |1:\n    |  ins_next\n    |\n    |2:  // Upvalue is black. Check if new value is collectable and white.\n    |  sub RD, LJ_TISGCV\n    |  cmp RD, LJ_TISNUM - LJ_TISGCV\t\t\t// tvisgcv(v)\n    |  jbe <1\n    |  test byte GCOBJ:RA->gch.marked, LJ_GC_WHITES\t// iswhite(v)\n    |  jz <1\n    |  // Crossed a write barrier. Move the barrier forward.\n    |.if X64 and not X64WIN\n    |  mov FCARG2, RB\n    |  mov RB, BASE\t\t\t// Save BASE.\n    |.else\n    |  xchg FCARG2, RB\t\t\t// Save BASE (FCARG2 == BASE).\n    |.endif\n    |  lea GL:FCARG1, [DISPATCH+GG_DISP2G]\n    |  call extern lj_gc_barrieruv@8\t// (global_State *g, TValue *tv)\n    |  mov BASE, RB\t\t\t// Restore BASE.\n    |  jmp <1\n    break;\n#undef TV2MARKOFS\n  case BC_USETS:\n    |  ins_AND\t// RA = upvalue #, RD = str const (~)\n    |  mov LFUNC:RB, [BASE-8]\n    |  mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)]\n    |  mov GCOBJ:RA, [KBASE+RD*4]\n    |  mov RD, UPVAL:RB->v\n    |  mov [RD], GCOBJ:RA\n    |  mov dword [RD+4], LJ_TSTR\n    |  test byte UPVAL:RB->marked, LJ_GC_BLACK\t\t// isblack(uv)\n    |  jnz >2\n    |1:\n    |  ins_next\n    |\n    |2:  // Check if string is white and ensure upvalue is closed.\n    |  test byte GCOBJ:RA->gch.marked, LJ_GC_WHITES\t// iswhite(str)\n    |  jz <1\n    |  cmp byte UPVAL:RB->closed, 0\n    |  jz <1\n    |  // Crossed a write barrier. Move the barrier forward.\n    |  mov RB, BASE\t\t\t// Save BASE (FCARG2 == BASE).\n    |  mov FCARG2, RD\n    |  lea GL:FCARG1, [DISPATCH+GG_DISP2G]\n    |  call extern lj_gc_barrieruv@8\t// (global_State *g, TValue *tv)\n    |  mov BASE, RB\t\t\t// Restore BASE.\n    |  jmp <1\n    break;\n  case BC_USETN:\n    |  ins_AD\t// RA = upvalue #, RD = num const\n    |  mov LFUNC:RB, [BASE-8]\n    |.if SSE\n    |  movsd xmm0, qword [KBASE+RD*8]\n    |.else\n    |  fld qword [KBASE+RD*8]\n    |.endif\n    |  mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)]\n    |  mov RA, UPVAL:RB->v\n    |.if SSE\n    |  movsd qword [RA], xmm0\n    |.else\n    |  fstp qword [RA]\n    |.endif\n    |  ins_next\n    break;\n  case BC_USETP:\n    |  ins_AND\t// RA = upvalue #, RD = primitive type (~)\n    |  mov LFUNC:RB, [BASE-8]\n    |  mov UPVAL:RB, [LFUNC:RB+RA*4+offsetof(GCfuncL, uvptr)]\n    |  mov RA, UPVAL:RB->v\n    |  mov [RA+4], RD\n    |  ins_next\n    break;\n  case BC_UCLO:\n    |  ins_AD\t// RA = level, RD = target\n    |  branchPC RD\t\t\t// Do this first to free RD.\n    |  mov L:RB, SAVE_L\n    |  cmp dword L:RB->openupval, 0\n    |  je >1\n    |  mov L:RB->base, BASE\n    |  lea FCARG2, [BASE+RA*8]\t\t// Caveat: FCARG2 == BASE\n    |  mov L:FCARG1, L:RB\t\t// Caveat: FCARG1 == RA\n    |  call extern lj_func_closeuv@8\t// (lua_State *L, TValue *level)\n    |  mov BASE, L:RB->base\n    |1:\n    |  ins_next\n    break;\n\n  case BC_FNEW:\n    |  ins_AND\t// RA = dst, RD = proto const (~) (holding function prototype)\n    |.if X64\n    |  mov L:RB, SAVE_L\n    |  mov L:RB->base, BASE\t\t// Caveat: CARG2d/CARG3d may be BASE.\n    |  mov CARG3d, [BASE-8]\n    |  mov CARG2d, [KBASE+RD*4]\t\t// Fetch GCproto *.\n    |  mov CARG1d, L:RB\n    |.else\n    |  mov LFUNC:RA, [BASE-8]\n    |  mov PROTO:RD, [KBASE+RD*4]\t// Fetch GCproto *.\n    |  mov L:RB, SAVE_L\n    |  mov ARG3, LFUNC:RA\n    |  mov ARG2, PROTO:RD\n    |  mov ARG1, L:RB\n    |  mov L:RB->base, BASE\n    |.endif\n    |  mov SAVE_PC, PC\n    |  // (lua_State *L, GCproto *pt, GCfuncL *parent)\n    |  call extern lj_func_newL_gc\n    |  // GCfuncL * returned in eax (RC).\n    |  mov BASE, L:RB->base\n    |  movzx RA, PC_RA\n    |  mov [BASE+RA*8], LFUNC:RC\n    |  mov dword [BASE+RA*8+4], LJ_TFUNC\n    |  ins_next\n    break;\n\n  /* -- Table ops --------------------------------------------------------- */\n\n  case BC_TNEW:\n    |  ins_AD\t// RA = dst, RD = hbits|asize\n    |  mov L:RB, SAVE_L\n    |  mov L:RB->base, BASE\n    |  mov RA, [DISPATCH+DISPATCH_GL(gc.total)]\n    |  cmp RA, [DISPATCH+DISPATCH_GL(gc.threshold)]\n    |  mov SAVE_PC, PC\n    |  jae >5\n    |1:\n    |.if X64\n    |  mov CARG3d, RD\n    |  and RD, 0x7ff\n    |  shr CARG3d, 11\n    |.else\n    |  mov RA, RD\n    |  and RD, 0x7ff\n    |  shr RA, 11\n    |  mov ARG3, RA\n    |.endif\n    |  cmp RD, 0x7ff\n    |  je >3\n    |2:\n    |.if X64\n    |  mov L:CARG1d, L:RB\n    |  mov CARG2d, RD\n    |.else\n    |  mov ARG1, L:RB\n    |  mov ARG2, RD\n    |.endif\n    |  call extern lj_tab_new  // (lua_State *L, int32_t asize, uint32_t hbits)\n    |  // Table * returned in eax (RC).\n    |  mov BASE, L:RB->base\n    |  movzx RA, PC_RA\n    |  mov [BASE+RA*8], TAB:RC\n    |  mov dword [BASE+RA*8+4], LJ_TTAB\n    |  ins_next\n    |3:  // Turn 0x7ff into 0x801.\n    |  mov RD, 0x801\n    |  jmp <2\n    |5:\n    |  mov L:FCARG1, L:RB\n    |  call extern lj_gc_step_fixtop@4\t// (lua_State *L)\n    |  movzx RD, PC_RD\n    |  jmp <1\n    break;\n  case BC_TDUP:\n    |  ins_AND\t// RA = dst, RD = table const (~) (holding template table)\n    |  mov L:RB, SAVE_L\n    |  mov RA, [DISPATCH+DISPATCH_GL(gc.total)]\n    |  mov SAVE_PC, PC\n    |  cmp RA, [DISPATCH+DISPATCH_GL(gc.threshold)]\n    |  mov L:RB->base, BASE\n    |  jae >3\n    |2:\n    |  mov TAB:FCARG2, [KBASE+RD*4]\t// Caveat: FCARG2 == BASE\n    |  mov L:FCARG1, L:RB\t\t// Caveat: FCARG1 == RA\n    |  call extern lj_tab_dup@8\t\t// (lua_State *L, Table *kt)\n    |  // Table * returned in eax (RC).\n    |  mov BASE, L:RB->base\n    |  movzx RA, PC_RA\n    |  mov [BASE+RA*8], TAB:RC\n    |  mov dword [BASE+RA*8+4], LJ_TTAB\n    |  ins_next\n    |3:\n    |  mov L:FCARG1, L:RB\n    |  call extern lj_gc_step_fixtop@4\t// (lua_State *L)\n    |  movzx RD, PC_RD\t\t\t// Need to reload RD.\n    |  not RDa\n    |  jmp <2\n    break;\n\n  case BC_GGET:\n    |  ins_AND\t// RA = dst, RD = str const (~)\n    |  mov LFUNC:RB, [BASE-8]\n    |  mov TAB:RB, LFUNC:RB->env\n    |  mov STR:RC, [KBASE+RD*4]\n    |  jmp ->BC_TGETS_Z\n    break;\n  case BC_GSET:\n    |  ins_AND\t// RA = src, RD = str const (~)\n    |  mov LFUNC:RB, [BASE-8]\n    |  mov TAB:RB, LFUNC:RB->env\n    |  mov STR:RC, [KBASE+RD*4]\n    |  jmp ->BC_TSETS_Z\n    break;\n\n  case BC_TGETV:\n    |  ins_ABC\t// RA = dst, RB = table, RC = key\n    |  checktab RB, ->vmeta_tgetv\n    |  mov TAB:RB, [BASE+RB*8]\n    |\n    |  // Integer key?\n    |.if DUALNUM\n    |  checkint RC, >5\n    |  mov RC, dword [BASE+RC*8]\n    |.else\n    |  // Convert number to int and back and compare.\n    |  checknum RC, >5\n    |.if SSE\n    |  movsd xmm0, qword [BASE+RC*8]\n    |  cvtsd2si RC, xmm0\n    |  cvtsi2sd xmm1, RC\n    |  ucomisd xmm0, xmm1\n    |.else\n    |  fld qword [BASE+RC*8]\n    |  fist ARG1\n    |  fild ARG1\n    |  fcomparepp\n    |  mov RC, ARG1\n    |.endif\n    |  jne ->vmeta_tgetv\t\t// Generic numeric key? Use fallback.\n    |.endif\n    |  cmp RC, TAB:RB->asize\t// Takes care of unordered, too.\n    |  jae ->vmeta_tgetv\t\t// Not in array part? Use fallback.\n    |  shl RC, 3\n    |  add RC, TAB:RB->array\n    |  cmp dword [RC+4], LJ_TNIL\t// Avoid overwriting RB in fastpath.\n    |  je >2\n    |  // Get array slot.\n    |.if X64\n    |  mov RBa, [RC]\n    |  mov [BASE+RA*8], RBa\n    |.else\n    |  mov RB, [RC]\n    |  mov RC, [RC+4]\n    |  mov [BASE+RA*8], RB\n    |  mov [BASE+RA*8+4], RC\n    |.endif\n    |1:\n    |  ins_next\n    |\n    |2:  // Check for __index if table value is nil.\n    |  cmp dword TAB:RB->metatable, 0\t// Shouldn't overwrite RA for fastpath.\n    |  jz >3\n    |  mov TAB:RA, TAB:RB->metatable\n    |  test byte TAB:RA->nomm, 1<<MM_index\n    |  jz ->vmeta_tgetv\t\t\t// 'no __index' flag NOT set: check.\n    |  movzx RA, PC_RA\t\t\t// Restore RA.\n    |3:\n    |  mov dword [BASE+RA*8+4], LJ_TNIL\n    |  jmp <1\n    |\n    |5:  // String key?\n    |  checkstr RC, ->vmeta_tgetv\n    |  mov STR:RC, [BASE+RC*8]\n    |  jmp ->BC_TGETS_Z\n    break;\n  case BC_TGETS:\n    |  ins_ABC\t// RA = dst, RB = table, RC = str const (~)\n    |  not RCa\n    |  mov STR:RC, [KBASE+RC*4]\n    |  checktab RB, ->vmeta_tgets\n    |  mov TAB:RB, [BASE+RB*8]\n    |->BC_TGETS_Z:\t// RB = GCtab *, RC = GCstr *, refetches PC_RA.\n    |  mov RA, TAB:RB->hmask\n    |  and RA, STR:RC->hash\n    |  imul RA, #NODE\n    |  add NODE:RA, TAB:RB->node\n    |1:\n    |  cmp dword NODE:RA->key.it, LJ_TSTR\n    |  jne >4\n    |  cmp dword NODE:RA->key.gcr, STR:RC\n    |  jne >4\n    |  // Ok, key found. Assumes: offsetof(Node, val) == 0\n    |  cmp dword [RA+4], LJ_TNIL\t// Avoid overwriting RB in fastpath.\n    |  je >5\t\t\t\t// Key found, but nil value?\n    |  movzx RC, PC_RA\n    |  // Get node value.\n    |.if X64\n    |  mov RBa, [RA]\n    |  mov [BASE+RC*8], RBa\n    |.else\n    |  mov RB, [RA]\n    |  mov RA, [RA+4]\n    |  mov [BASE+RC*8], RB\n    |  mov [BASE+RC*8+4], RA\n    |.endif\n    |2:\n    |  ins_next\n    |\n    |3:\n    |  movzx RC, PC_RA\n    |  mov dword [BASE+RC*8+4], LJ_TNIL\n    |  jmp <2\n    |\n    |4:  // Follow hash chain.\n    |  mov NODE:RA, NODE:RA->next\n    |  test NODE:RA, NODE:RA\n    |  jnz <1\n    |  // End of hash chain: key not found, nil result.\n    |\n    |5:  // Check for __index if table value is nil.\n    |  mov TAB:RA, TAB:RB->metatable\n    |  test TAB:RA, TAB:RA\n    |  jz <3\t\t\t\t// No metatable: done.\n    |  test byte TAB:RA->nomm, 1<<MM_index\n    |  jnz <3\t\t\t\t// 'no __index' flag set: done.\n    |  jmp ->vmeta_tgets\t\t// Caveat: preserve STR:RC.\n    break;\n  case BC_TGETB:\n    |  ins_ABC\t// RA = dst, RB = table, RC = byte literal\n    |  checktab RB, ->vmeta_tgetb\n    |  mov TAB:RB, [BASE+RB*8]\n    |  cmp RC, TAB:RB->asize\n    |  jae ->vmeta_tgetb\n    |  shl RC, 3\n    |  add RC, TAB:RB->array\n    |  cmp dword [RC+4], LJ_TNIL\t// Avoid overwriting RB in fastpath.\n    |  je >2\n    |  // Get array slot.\n    |.if X64\n    |  mov RBa, [RC]\n    |  mov [BASE+RA*8], RBa\n    |.else\n    |  mov RB, [RC]\n    |  mov RC, [RC+4]\n    |  mov [BASE+RA*8], RB\n    |  mov [BASE+RA*8+4], RC\n    |.endif\n    |1:\n    |  ins_next\n    |\n    |2:  // Check for __index if table value is nil.\n    |  cmp dword TAB:RB->metatable, 0\t// Shouldn't overwrite RA for fastpath.\n    |  jz >3\n    |  mov TAB:RA, TAB:RB->metatable\n    |  test byte TAB:RA->nomm, 1<<MM_index\n    |  jz ->vmeta_tgetb\t\t\t// 'no __index' flag NOT set: check.\n    |  movzx RA, PC_RA\t\t\t// Restore RA.\n    |3:\n    |  mov dword [BASE+RA*8+4], LJ_TNIL\n    |  jmp <1\n    break;\n\n  case BC_TSETV:\n    |  ins_ABC\t// RA = src, RB = table, RC = key\n    |  checktab RB, ->vmeta_tsetv\n    |  mov TAB:RB, [BASE+RB*8]\n    |\n    |  // Integer key?\n    |.if DUALNUM\n    |  checkint RC, >5\n    |  mov RC, dword [BASE+RC*8]\n    |.else\n    |  // Convert number to int and back and compare.\n    |  checknum RC, >5\n    |.if SSE\n    |  movsd xmm0, qword [BASE+RC*8]\n    |  cvtsd2si RC, xmm0\n    |  cvtsi2sd xmm1, RC\n    |  ucomisd xmm0, xmm1\n    |.else\n    |  fld qword [BASE+RC*8]\n    |  fist ARG1\n    |  fild ARG1\n    |  fcomparepp\n    |  mov RC, ARG1\n    |.endif\n    |  jne ->vmeta_tsetv\t\t// Generic numeric key? Use fallback.\n    |.endif\n    |  cmp RC, TAB:RB->asize\t\t// Takes care of unordered, too.\n    |  jae ->vmeta_tsetv\n    |  shl RC, 3\n    |  add RC, TAB:RB->array\n    |  cmp dword [RC+4], LJ_TNIL\n    |  je >3\t\t\t\t// Previous value is nil?\n    |1:\n    |  test byte TAB:RB->marked, LJ_GC_BLACK\t// isblack(table)\n    |  jnz >7\n    |2:  // Set array slot.\n    |.if X64\n    |  mov RBa, [BASE+RA*8]\n    |  mov [RC], RBa\n    |.else\n    |  mov RB, [BASE+RA*8+4]\n    |  mov RA, [BASE+RA*8]\n    |  mov [RC+4], RB\n    |  mov [RC], RA\n    |.endif\n    |  ins_next\n    |\n    |3:  // Check for __newindex if previous value is nil.\n    |  cmp dword TAB:RB->metatable, 0\t// Shouldn't overwrite RA for fastpath.\n    |  jz <1\n    |  mov TAB:RA, TAB:RB->metatable\n    |  test byte TAB:RA->nomm, 1<<MM_newindex\n    |  jz ->vmeta_tsetv\t\t\t// 'no __newindex' flag NOT set: check.\n    |  movzx RA, PC_RA\t\t\t// Restore RA.\n    |  jmp <1\n    |\n    |5:  // String key?\n    |  checkstr RC, ->vmeta_tsetv\n    |  mov STR:RC, [BASE+RC*8]\n    |  jmp ->BC_TSETS_Z\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, RA\n    |  movzx RA, PC_RA\t\t\t// Restore RA.\n    |  jmp <2\n    break;\n  case BC_TSETS:\n    |  ins_ABC\t// RA = src, RB = table, RC = str const (~)\n    |  not RCa\n    |  mov STR:RC, [KBASE+RC*4]\n    |  checktab RB, ->vmeta_tsets\n    |  mov TAB:RB, [BASE+RB*8]\n    |->BC_TSETS_Z:\t// RB = GCtab *, RC = GCstr *, refetches PC_RA.\n    |  mov RA, TAB:RB->hmask\n    |  and RA, STR:RC->hash\n    |  imul RA, #NODE\n    |  mov byte TAB:RB->nomm, 0\t\t// Clear metamethod cache.\n    |  add NODE:RA, TAB:RB->node\n    |1:\n    |  cmp dword NODE:RA->key.it, LJ_TSTR\n    |  jne >5\n    |  cmp dword NODE:RA->key.gcr, STR:RC\n    |  jne >5\n    |  // Ok, key found. Assumes: offsetof(Node, val) == 0\n    |  cmp dword [RA+4], LJ_TNIL\n    |  je >4\t\t\t\t// Previous value is nil?\n    |2:\n    |  test byte TAB:RB->marked, LJ_GC_BLACK\t// isblack(table)\n    |  jnz >7\n    |3:  // Set node value.\n    |  movzx RC, PC_RA\n    |.if X64\n    |  mov RBa, [BASE+RC*8]\n    |  mov [RA], RBa\n    |.else\n    |  mov RB, [BASE+RC*8+4]\n    |  mov RC, [BASE+RC*8]\n    |  mov [RA+4], RB\n    |  mov [RA], RC\n    |.endif\n    |  ins_next\n    |\n    |4:  // Check for __newindex if previous value is nil.\n    |  cmp dword TAB:RB->metatable, 0\t// Shouldn't overwrite RA for fastpath.\n    |  jz <2\n    |  mov TMP1, RA\t\t\t// Save RA.\n    |  mov TAB:RA, TAB:RB->metatable\n    |  test byte TAB:RA->nomm, 1<<MM_newindex\n    |  jz ->vmeta_tsets\t\t\t// 'no __newindex' flag NOT set: check.\n    |  mov RA, TMP1\t\t\t// Restore RA.\n    |  jmp <2\n    |\n    |5:  // Follow hash chain.\n    |  mov NODE:RA, NODE:RA->next\n    |  test NODE:RA, NODE:RA\n    |  jnz <1\n    |  // End of hash chain: key not found, add a new one.\n    |\n    |  // But check for __newindex first.\n    |  mov TAB:RA, TAB:RB->metatable\n    |  test TAB:RA, TAB:RA\n    |  jz >6\t\t\t\t// No metatable: continue.\n    |  test byte TAB:RA->nomm, 1<<MM_newindex\n    |  jz ->vmeta_tsets\t\t\t// 'no __newindex' flag NOT set: check.\n    |6:\n    |  mov TMP1, STR:RC\n    |  mov TMP2, LJ_TSTR\n    |  mov TMP3, TAB:RB\t\t\t// Save TAB:RB for us.\n    |.if X64\n    |  mov L:CARG1d, SAVE_L\n    |  mov L:CARG1d->base, BASE\n    |  lea CARG3, TMP1\n    |  mov CARG2d, TAB:RB\n    |  mov L:RB, L:CARG1d\n    |.else\n    |  lea RC, TMP1\t\t\t// Store temp. TValue in TMP1/TMP2.\n    |  mov ARG2, TAB:RB\n    |  mov L:RB, SAVE_L\n    |  mov ARG3, RC\n    |  mov ARG1, L:RB\n    |  mov L:RB->base, BASE\n    |.endif\n    |  mov SAVE_PC, PC\n    |  call extern lj_tab_newkey\t// (lua_State *L, GCtab *t, TValue *k)\n    |  // Handles write barrier for the new key. TValue * returned in eax (RC).\n    |  mov BASE, L:RB->base\n    |  mov TAB:RB, TMP3\t\t\t// Need TAB:RB for barrier.\n    |  mov RA, eax\n    |  jmp <2\t\t\t\t// Must check write barrier for value.\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, RC\t\t// Destroys STR:RC.\n    |  jmp <3\n    break;\n  case BC_TSETB:\n    |  ins_ABC\t// RA = src, RB = table, RC = byte literal\n    |  checktab RB, ->vmeta_tsetb\n    |  mov TAB:RB, [BASE+RB*8]\n    |  cmp RC, TAB:RB->asize\n    |  jae ->vmeta_tsetb\n    |  shl RC, 3\n    |  add RC, TAB:RB->array\n    |  cmp dword [RC+4], LJ_TNIL\n    |  je >3\t\t\t\t// Previous value is nil?\n    |1:\n    |  test byte TAB:RB->marked, LJ_GC_BLACK\t// isblack(table)\n    |  jnz >7\n    |2:\t // Set array slot.\n    |.if X64\n    |  mov RAa, [BASE+RA*8]\n    |  mov [RC], RAa\n    |.else\n    |  mov RB, [BASE+RA*8+4]\n    |  mov RA, [BASE+RA*8]\n    |  mov [RC+4], RB\n    |  mov [RC], RA\n    |.endif\n    |  ins_next\n    |\n    |3:  // Check for __newindex if previous value is nil.\n    |  cmp dword TAB:RB->metatable, 0\t// Shouldn't overwrite RA for fastpath.\n    |  jz <1\n    |  mov TAB:RA, TAB:RB->metatable\n    |  test byte TAB:RA->nomm, 1<<MM_newindex\n    |  jz ->vmeta_tsetb\t\t\t// 'no __newindex' flag NOT set: check.\n    |  movzx RA, PC_RA\t\t\t// Restore RA.\n    |  jmp <1\n    |\n    |7:  // Possible table write barrier for the value. Skip valiswhite check.\n    |  barrierback TAB:RB, RA\n    |  movzx RA, PC_RA\t\t\t// Restore RA.\n    |  jmp <2\n    break;\n\n  case BC_TSETM:\n    |  ins_AD\t// RA = base (table at base-1), RD = num const (start index)\n    |  mov TMP1, KBASE\t\t\t// Need one more free register.\n    |  mov KBASE, dword [KBASE+RD*8]\t// Integer constant is in lo-word.\n    |1:\n    |  lea RA, [BASE+RA*8]\n    |  mov TAB:RB, [RA-8]\t\t// Guaranteed to be a table.\n    |  test byte TAB:RB->marked, LJ_GC_BLACK\t// isblack(table)\n    |  jnz >7\n    |2:\n    |  mov RD, MULTRES\n    |  sub RD, 1\n    |  jz >4\t\t\t\t// Nothing to copy?\n    |  add RD, KBASE\t\t\t// Compute needed size.\n    |  cmp RD, TAB:RB->asize\n    |  ja >5\t\t\t\t// Doesn't fit into array part?\n    |  sub RD, KBASE\n    |  shl KBASE, 3\n    |  add KBASE, TAB:RB->array\n    |3:  // Copy result slots to table.\n    |.if X64\n    |  mov RBa, [RA]\n    |  add RA, 8\n    |  mov [KBASE], RBa\n    |.else\n    |  mov RB, [RA]\n    |  mov [KBASE], RB\n    |  mov RB, [RA+4]\n    |  add RA, 8\n    |  mov [KBASE+4], RB\n    |.endif\n    |  add KBASE, 8\n    |  sub RD, 1\n    |  jnz <3\n    |4:\n    |  mov KBASE, TMP1\n    |  ins_next\n    |\n    |5:  // Need to resize array part.\n    |.if X64\n    |  mov L:CARG1d, SAVE_L\n    |  mov L:CARG1d->base, BASE\t\t// Caveat: CARG2d/CARG3d may be BASE.\n    |  mov CARG2d, TAB:RB\n    |  mov CARG3d, RD\n    |  mov L:RB, L:CARG1d\n    |.else\n    |  mov ARG2, TAB:RB\n    |  mov L:RB, SAVE_L\n    |  mov L:RB->base, BASE\n    |  mov ARG3, RD\n    |  mov ARG1, L:RB\n    |.endif\n    |  mov SAVE_PC, PC\n    |  call extern lj_tab_reasize\t// (lua_State *L, GCtab *t, int nasize)\n    |  mov BASE, L:RB->base\n    |  movzx RA, PC_RA\t\t\t// Restore RA.\n    |  jmp <1\t\t\t\t// Retry.\n    |\n    |7:  // Possible table write barrier for any value. Skip valiswhite check.\n    |  barrierback TAB:RB, RD\n    |  jmp <2\n    break;\n\n  /* -- Calls and vararg handling ----------------------------------------- */\n\n  case BC_CALL: case BC_CALLM:\n    |  ins_A_C\t// RA = base, (RB = nresults+1,) RC = nargs+1 | extra_nargs\n    if (op == BC_CALLM) {\n      |  add NARGS:RD, MULTRES\n    }\n    |  cmp dword [BASE+RA*8+4], LJ_TFUNC\n    |  mov LFUNC:RB, [BASE+RA*8]\n    |  jne ->vmeta_call_ra\n    |  lea BASE, [BASE+RA*8+8]\n    |  ins_call\n    break;\n\n  case BC_CALLMT:\n    |  ins_AD\t// RA = base, RD = extra_nargs\n    |  add NARGS:RD, MULTRES\n    |  // Fall through. Assumes BC_CALLT follows and ins_AD is a no-op.\n    break;\n  case BC_CALLT:\n    |  ins_AD\t// RA = base, RD = nargs+1\n    |  lea RA, [BASE+RA*8+8]\n    |  mov KBASE, BASE\t\t\t// Use KBASE for move + vmeta_call hint.\n    |  mov LFUNC:RB, [RA-8]\n    |  cmp dword [RA-4], LJ_TFUNC\n    |  jne ->vmeta_call\n    |->BC_CALLT_Z:\n    |  mov PC, [BASE-4]\n    |  test PC, FRAME_TYPE\n    |  jnz >7\n    |1:\n    |  mov [BASE-8], LFUNC:RB\t\t// Copy function down, reloaded below.\n    |  mov MULTRES, NARGS:RD\n    |  sub NARGS:RD, 1\n    |  jz >3\n    |2:  // Move args down.\n    |.if X64\n    |  mov RBa, [RA]\n    |  add RA, 8\n    |  mov [KBASE], RBa\n    |.else\n    |  mov RB, [RA]\n    |  mov [KBASE], RB\n    |  mov RB, [RA+4]\n    |  add RA, 8\n    |  mov [KBASE+4], RB\n    |.endif\n    |  add KBASE, 8\n    |  sub NARGS:RD, 1\n    |  jnz <2\n    |\n    |  mov LFUNC:RB, [BASE-8]\n    |3:\n    |  mov NARGS:RD, MULTRES\n    |  cmp byte LFUNC:RB->ffid, 1\t// (> FF_C) Calling a fast function?\n    |  ja >5\n    |4:\n    |  ins_callt\n    |\n    |5:  // Tailcall to a fast function.\n    |  test PC, FRAME_TYPE\t\t// Lua frame below?\n    |  jnz <4\n    |  movzx RA, PC_RA\n    |  not RAa\n    |  lea RA, [BASE+RA*8]\n    |  mov LFUNC:KBASE, [RA-8]\t\t// Need to prepare KBASE.\n    |  mov KBASE, LFUNC:KBASE->pc\n    |  mov KBASE, [KBASE+PC2PROTO(k)]\n    |  jmp <4\n    |\n    |7:  // Tailcall from a vararg function.\n    |  sub PC, FRAME_VARG\n    |  test PC, FRAME_TYPEP\n    |  jnz >8\t\t\t\t// Vararg frame below?\n    |  sub BASE, PC\t\t\t// Need to relocate BASE/KBASE down.\n    |  mov KBASE, BASE\n    |  mov PC, [BASE-4]\n    |  jmp <1\n    |8:\n    |  add PC, FRAME_VARG\n    |  jmp <1\n    break;\n\n  case BC_ITERC:\n    |  ins_A\t// RA = base, (RB = nresults+1,) RC = nargs+1 (2+1)\n    |  lea RA, [BASE+RA*8+8]\t\t// fb = base+1\n    |.if X64\n    |  mov RBa, [RA-24]\t\t\t// Copy state. fb[0] = fb[-3].\n    |  mov RCa, [RA-16]\t\t\t// Copy control var. fb[1] = fb[-2].\n    |  mov [RA], RBa\n    |  mov [RA+8], RCa\n    |.else\n    |  mov RB, [RA-24]\t\t\t// Copy state. fb[0] = fb[-3].\n    |  mov RC, [RA-20]\n    |  mov [RA], RB\n    |  mov [RA+4], RC\n    |  mov RB, [RA-16]\t\t\t// Copy control var. fb[1] = fb[-2].\n    |  mov RC, [RA-12]\n    |  mov [RA+8], RB\n    |  mov [RA+12], RC\n    |.endif\n    |  mov LFUNC:RB, [RA-32]\t\t// Copy callable. fb[-1] = fb[-4]\n    |  mov RC, [RA-28]\n    |  mov [RA-8], LFUNC:RB\n    |  mov [RA-4], RC\n    |  cmp RC, LJ_TFUNC\t\t\t// Handle like a regular 2-arg call.\n    |  mov NARGS:RD, 2+1\n    |  jne ->vmeta_call\n    |  mov BASE, RA\n    |  ins_call\n    break;\n\n  case BC_ITERN:\n    |  ins_A\t// RA = base, (RB = nresults+1, RC = nargs+1 (2+1))\n    |.if JIT\n    |  // NYI: add hotloop, record BC_ITERN.\n    |.endif\n    |  mov TMP1, KBASE\t\t\t// Need two more free registers.\n    |  mov TMP2, DISPATCH\n    |  mov TAB:RB, [BASE+RA*8-16]\n    |  mov RC, [BASE+RA*8-8]\t\t// Get index from control var.\n    |  mov DISPATCH, TAB:RB->asize\n    |  add PC, 4\n    |  mov KBASE, TAB:RB->array\n    |1:  // Traverse array part.\n    |  cmp RC, DISPATCH; jae >5\t\t// Index points after array part?\n    |  cmp dword [KBASE+RC*8+4], LJ_TNIL; je >4\n    |.if DUALNUM\n    |  mov dword [BASE+RA*8+4], LJ_TISNUM\n    |  mov dword [BASE+RA*8], RC\n    |.elif SSE\n    |  cvtsi2sd xmm0, RC\n    |.else\n    |  fild dword [BASE+RA*8-8]\n    |.endif\n    |  // Copy array slot to returned value.\n    |.if X64\n    |  mov RBa, [KBASE+RC*8]\n    |  mov [BASE+RA*8+8], RBa\n    |.else\n    |  mov RB, [KBASE+RC*8+4]\n    |  mov [BASE+RA*8+12], RB\n    |  mov RB, [KBASE+RC*8]\n    |  mov [BASE+RA*8+8], RB\n    |.endif\n    |  add RC, 1\n    |  // Return array index as a numeric key.\n    |.if DUALNUM\n    |  // See above.\n    |.elif SSE\n    |  movsd qword [BASE+RA*8], xmm0\n    |.else\n    |  fstp qword [BASE+RA*8]\n    |.endif\n    |  mov [BASE+RA*8-8], RC\t\t// Update control var.\n    |2:\n    |  movzx RD, PC_RD\t\t\t// Get target from ITERL.\n    |  branchPC RD\n    |3:\n    |  mov DISPATCH, TMP2\n    |  mov KBASE, TMP1\n    |  ins_next\n    |\n    |4:  // Skip holes in array part.\n    |  add RC, 1\n    |.if not (DUALNUM or SSE)\n    |  mov [BASE+RA*8-8], RC\n    |.endif\n    |  jmp <1\n    |\n    |5:  // Traverse hash part.\n    |  sub RC, DISPATCH\n    |6:\n    |  cmp RC, TAB:RB->hmask; ja <3\t// End of iteration? Branch to ITERL+1.\n    |  imul KBASE, RC, #NODE\n    |  add NODE:KBASE, TAB:RB->node\n    |  cmp dword NODE:KBASE->val.it, LJ_TNIL; je >7\n    |  lea DISPATCH, [RC+DISPATCH+1]\n    |  // Copy key and value from hash slot.\n    |.if X64\n    |  mov RBa, NODE:KBASE->key\n    |  mov RCa, NODE:KBASE->val\n    |  mov [BASE+RA*8], RBa\n    |  mov [BASE+RA*8+8], RCa\n    |.else\n    |  mov RB, NODE:KBASE->key.gcr\n    |  mov RC, NODE:KBASE->key.it\n    |  mov [BASE+RA*8], RB\n    |  mov [BASE+RA*8+4], RC\n    |  mov RB, NODE:KBASE->val.gcr\n    |  mov RC, NODE:KBASE->val.it\n    |  mov [BASE+RA*8+8], RB\n    |  mov [BASE+RA*8+12], RC\n    |.endif\n    |  mov [BASE+RA*8-8], DISPATCH\n    |  jmp <2\n    |\n    |7:  // Skip holes in hash part.\n    |  add RC, 1\n    |  jmp <6\n    break;\n\n  case BC_ISNEXT:\n    |  ins_AD\t// RA = base, RD = target (points to ITERN)\n    |  cmp dword [BASE+RA*8-20], LJ_TFUNC; jne >5\n    |  mov CFUNC:RB, [BASE+RA*8-24]\n    |  cmp dword [BASE+RA*8-12], LJ_TTAB; jne >5\n    |  cmp dword [BASE+RA*8-4], LJ_TNIL; jne >5\n    |  cmp byte CFUNC:RB->ffid, FF_next_N; jne >5\n    |  branchPC RD\n    |  mov dword [BASE+RA*8-8], 0\t// Initialize control var.\n    |  mov dword [BASE+RA*8-4], 0xfffe7fff\n    |1:\n    |  ins_next\n    |5:  // Despecialize bytecode if any of the checks fail.\n    |  mov PC_OP, BC_JMP\n    |  branchPC RD\n    |  mov byte [PC], BC_ITERC\n    |  jmp <1\n    break;\n\n  case BC_VARG:\n    |  ins_ABC\t// RA = base, RB = nresults+1, RC = numparams\n    |  mov TMP1, KBASE\t\t\t// Need one more free register.\n    |  lea KBASE, [BASE+RC*8+(8+FRAME_VARG)]\n    |  lea RA, [BASE+RA*8]\n    |  sub KBASE, [BASE-4]\n    |  // Note: KBASE may now be even _above_ BASE if nargs was < numparams.\n    |  test RB, RB\n    |  jz >5\t\t\t\t// Copy all varargs?\n    |  lea RB, [RA+RB*8-8]\n    |  cmp KBASE, BASE\t\t\t// No vararg slots?\n    |  jnb >2\n    |1:  // Copy vararg slots to destination slots.\n    |.if X64\n    |  mov RCa, [KBASE-8]\n    |  add KBASE, 8\n    |  mov [RA], RCa\n    |.else\n    |  mov RC, [KBASE-8]\n    |  mov [RA], RC\n    |  mov RC, [KBASE-4]\n    |  add KBASE, 8\n    |  mov [RA+4], RC\n    |.endif\n    |  add RA, 8\n    |  cmp RA, RB\t\t\t// All destination slots filled?\n    |  jnb >3\n    |  cmp KBASE, BASE\t\t\t// No more vararg slots?\n    |  jb <1\n    |2:  // Fill up remainder with nil.\n    |  mov dword [RA+4], LJ_TNIL\n    |  add RA, 8\n    |  cmp RA, RB\n    |  jb <2\n    |3:\n    |  mov KBASE, TMP1\n    |  ins_next\n    |\n    |5:  // Copy all varargs.\n    |  mov MULTRES, 1\t\t\t// MULTRES = 0+1\n    |  mov RC, BASE\n    |  sub RC, KBASE\n    |  jbe <3\t\t\t\t// No vararg slots?\n    |  mov RB, RC\n    |  shr RB, 3\n    |  add RB, 1\n    |  mov MULTRES, RB\t\t\t// MULTRES = #varargs+1\n    |  mov L:RB, SAVE_L\n    |  add RC, RA\n    |  cmp RC, L:RB->maxstack\n    |  ja >7\t\t\t\t// Need to grow stack?\n    |6:  // Copy all vararg slots.\n    |.if X64\n    |  mov RCa, [KBASE-8]\n    |  add KBASE, 8\n    |  mov [RA], RCa\n    |.else\n    |  mov RC, [KBASE-8]\n    |  mov [RA], RC\n    |  mov RC, [KBASE-4]\n    |  add KBASE, 8\n    |  mov [RA+4], RC\n    |.endif\n    |  add RA, 8\n    |  cmp KBASE, BASE\t\t\t// No more vararg slots?\n    |  jb <6\n    |  jmp <3\n    |\n    |7:  // Grow stack for varargs.\n    |  mov L:RB->base, BASE\n    |  mov L:RB->top, RA\n    |  mov SAVE_PC, PC\n    |  sub KBASE, BASE\t\t\t// Need delta, because BASE may change.\n    |  mov FCARG2, MULTRES\n    |  sub FCARG2, 1\n    |  mov FCARG1, L:RB\n    |  call extern lj_state_growstack@8\t// (lua_State *L, int n)\n    |  mov BASE, L:RB->base\n    |  mov RA, L:RB->top\n    |  add KBASE, BASE\n    |  jmp <6\n    break;\n\n  /* -- Returns ----------------------------------------------------------- */\n\n  case BC_RETM:\n    |  ins_AD\t// RA = results, RD = extra_nresults\n    |  add RD, MULTRES\t\t\t// MULTRES >=1, so RD >=1.\n    |  // Fall through. Assumes BC_RET follows and ins_AD is a no-op.\n    break;\n\n  case BC_RET: case BC_RET0: case BC_RET1:\n    |  ins_AD\t// RA = results, RD = nresults+1\n    if (op != BC_RET0) {\n      |  shl RA, 3\n    }\n    |1:\n    |  mov PC, [BASE-4]\n    |  mov MULTRES, RD\t\t\t// Save nresults+1.\n    |  test PC, FRAME_TYPE\t\t// Check frame type marker.\n    |  jnz >7\t\t\t\t// Not returning to a fixarg Lua func?\n    switch (op) {\n    case BC_RET:\n      |->BC_RET_Z:\n      |  mov KBASE, BASE\t\t// Use KBASE for result move.\n      |  sub RD, 1\n      |  jz >3\n      |2:  // Move results down.\n      |.if X64\n      |  mov RBa, [KBASE+RA]\n      |  mov [KBASE-8], RBa\n      |.else\n      |  mov RB, [KBASE+RA]\n      |  mov [KBASE-8], RB\n      |  mov RB, [KBASE+RA+4]\n      |  mov [KBASE-4], RB\n      |.endif\n      |  add KBASE, 8\n      |  sub RD, 1\n      |  jnz <2\n      |3:\n      |  mov RD, MULTRES\t\t// Note: MULTRES may be >255.\n      |  movzx RB, PC_RB\t\t// So cannot compare with RDL!\n      |5:\n      |  cmp RB, RD\t\t\t// More results expected?\n      |  ja >6\n      break;\n    case BC_RET1:\n      |.if X64\n      |  mov RBa, [BASE+RA]\n      |  mov [BASE-8], RBa\n      |.else\n      |  mov RB, [BASE+RA+4]\n      |  mov [BASE-4], RB\n      |  mov RB, [BASE+RA]\n      |  mov [BASE-8], RB\n      |.endif\n      /* fallthrough */\n    case BC_RET0:\n      |5:\n      |  cmp PC_RB, RDL\t\t\t// More results expected?\n      |  ja >6\n    default:\n      break;\n    }\n    |  movzx RA, PC_RA\n    |  not RAa\t\t\t\t// Note: ~RA = -(RA+1)\n    |  lea BASE, [BASE+RA*8]\t\t// base = base - (RA+1)*8\n    |  mov LFUNC:KBASE, [BASE-8]\n    |  mov KBASE, LFUNC:KBASE->pc\n    |  mov KBASE, [KBASE+PC2PROTO(k)]\n    |  ins_next\n    |\n    |6:  // Fill up results with nil.\n    if (op == BC_RET) {\n      |  mov dword [KBASE-4], LJ_TNIL\t// Note: relies on shifted base.\n      |  add KBASE, 8\n    } else {\n      |  mov dword [BASE+RD*8-12], LJ_TNIL\n    }\n    |  add RD, 1\n    |  jmp <5\n    |\n    |7:  // Non-standard return case.\n    |  lea RB, [PC-FRAME_VARG]\n    |  test RB, FRAME_TYPEP\n    |  jnz ->vm_return\n    |  // Return from vararg function: relocate BASE down and RA up.\n    |  sub BASE, RB\n    if (op != BC_RET0) {\n      |  add RA, RB\n    }\n    |  jmp <1\n    break;\n\n  /* -- Loops and branches ------------------------------------------------ */\n\n  |.define FOR_IDX,  [RA];    .define FOR_TIDX,  dword [RA+4]\n  |.define FOR_STOP, [RA+8];  .define FOR_TSTOP, dword [RA+12]\n  |.define FOR_STEP, [RA+16]; .define FOR_TSTEP, dword [RA+20]\n  |.define FOR_EXT,  [RA+24]; .define FOR_TEXT,  dword [RA+28]\n\n  case BC_FORL:\n    |.if JIT\n    |  hotloop RB\n    |.endif\n    | // Fall through. Assumes BC_IFORL follows and ins_AJ is a no-op.\n    break;\n\n  case BC_JFORI:\n  case BC_JFORL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_FORI:\n  case BC_IFORL:\n    vk = (op == BC_IFORL || op == BC_JFORL);\n    |  ins_AJ\t// RA = base, RD = target (after end of loop or start of loop)\n    |  lea RA, [BASE+RA*8]\n    if (LJ_DUALNUM) {\n      |  cmp FOR_TIDX, LJ_TISNUM; jne >9\n      if (!vk) {\n\t|  cmp FOR_TSTOP, LJ_TISNUM; jne ->vmeta_for\n\t|  cmp FOR_TSTEP, LJ_TISNUM; jne ->vmeta_for\n\t|  mov RB, dword FOR_IDX\n\t|  cmp dword FOR_STEP, 0; jl >5\n      } else {\n#ifdef LUA_USE_ASSERT\n\t|  cmp FOR_TSTOP, LJ_TISNUM; jne ->assert_bad_for_arg_type\n\t|  cmp FOR_TSTEP, LJ_TISNUM; jne ->assert_bad_for_arg_type\n#endif\n\t|  mov RB, dword FOR_STEP\n\t|  test RB, RB; js >5\n\t|  add RB, dword FOR_IDX; jo >1\n\t|  mov dword FOR_IDX, RB\n      }\n      |  cmp RB, dword FOR_STOP\n      |  mov FOR_TEXT, LJ_TISNUM\n      |  mov dword FOR_EXT, RB\n      if (op == BC_FORI) {\n\t|  jle >7\n\t|1:\n\t|6:\n\t|  branchPC RD\n      } else if (op == BC_JFORI) {\n\t|  branchPC RD\n\t|  movzx RD, PC_RD\n\t|  jle =>BC_JLOOP\n\t|1:\n\t|6:\n      } else if (op == BC_IFORL) {\n\t|  jg >7\n\t|6:\n\t|  branchPC RD\n\t|1:\n      } else {\n\t|  jle =>BC_JLOOP\n\t|1:\n\t|6:\n      }\n      |7:\n      |  ins_next\n      |\n      |5:  // Invert check for negative step.\n      if (vk) {\n\t|  add RB, dword FOR_IDX; jo <1\n\t|  mov dword FOR_IDX, RB\n      }\n      |  cmp RB, dword FOR_STOP\n      |  mov FOR_TEXT, LJ_TISNUM\n      |  mov dword FOR_EXT, RB\n      if (op == BC_FORI) {\n\t|  jge <7\n      } else if (op == BC_JFORI) {\n\t|  branchPC RD\n\t|  movzx RD, PC_RD\n\t|  jge =>BC_JLOOP\n      } else if (op == BC_IFORL) {\n\t|  jl <7\n      } else {\n\t|  jge =>BC_JLOOP\n      }\n      |  jmp <6\n      |9:  // Fallback to FP variant.\n    } else if (!vk) {\n      |  cmp FOR_TIDX, LJ_TISNUM\n    }\n    if (!vk) {\n      |  jae ->vmeta_for\n      |  cmp FOR_TSTOP, LJ_TISNUM; jae ->vmeta_for\n    } else {\n#ifdef LUA_USE_ASSERT\n      |  cmp FOR_TSTOP, LJ_TISNUM; jae ->assert_bad_for_arg_type\n      |  cmp FOR_TSTEP, LJ_TISNUM; jae ->assert_bad_for_arg_type\n#endif\n    }\n    |  mov RB, FOR_TSTEP\t\t// Load type/hiword of for step.\n    if (!vk) {\n      |  cmp RB, LJ_TISNUM; jae ->vmeta_for\n    }\n    |.if SSE\n    |  movsd xmm0, qword FOR_IDX\n    |  movsd xmm1, qword FOR_STOP\n    if (vk) {\n      |  addsd xmm0, qword FOR_STEP\n      |  movsd qword FOR_IDX, xmm0\n      |  test RB, RB; js >3\n    } else {\n      |  jl >3\n    }\n    |  ucomisd xmm1, xmm0\n    |1:\n    |  movsd qword FOR_EXT, xmm0\n    |.else\n    |  fld qword FOR_STOP\n    |  fld qword FOR_IDX\n    if (vk) {\n      |  fadd qword FOR_STEP\t\t// nidx = idx + step\n      |  fst qword FOR_IDX\n      |  fst qword FOR_EXT\n      |  test RB, RB; js >1\n    } else {\n      |  fst qword FOR_EXT\n      |  jl >1\n    }\n    |  fxch\t\t\t\t// Swap lim/(n)idx if step non-negative.\n    |1:\n    |  fcomparepp\n    |.endif\n    if (op == BC_FORI) {\n      |.if DUALNUM\n      |  jnb <7\n      |.else\n      |  jnb >2\n      |  branchPC RD\n      |.endif\n    } else if (op == BC_JFORI) {\n      |  branchPC RD\n      |  movzx RD, PC_RD\n      |  jnb =>BC_JLOOP\n    } else if (op == BC_IFORL) {\n      |.if DUALNUM\n      |  jb <7\n      |.else\n      |  jb >2\n      |  branchPC RD\n      |.endif\n    } else {\n      |  jnb =>BC_JLOOP\n    }\n    |.if DUALNUM\n    |  jmp <6\n    |.else\n    |2:\n    |  ins_next\n    |.endif\n    |.if SSE\n    |3:  // Invert comparison if step is negative.\n    |  ucomisd xmm0, xmm1\n    |  jmp <1\n    |.endif\n    break;\n\n  case BC_ITERL:\n    |.if JIT\n    |  hotloop RB\n    |.endif\n    | // Fall through. Assumes BC_IITERL follows and ins_AJ is a no-op.\n    break;\n\n  case BC_JITERL:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IITERL:\n    |  ins_AJ\t// RA = base, RD = target\n    |  lea RA, [BASE+RA*8]\n    |  mov RB, [RA+4]\n    |  cmp RB, LJ_TNIL; je >1\t\t// Stop if iterator returned nil.\n    if (op == BC_JITERL) {\n      |  mov [RA-4], RB\n      |  mov RB, [RA]\n      |  mov [RA-8], RB\n      |  jmp =>BC_JLOOP\n    } else {\n      |  branchPC RD\t\t\t// Otherwise save control var + branch.\n      |  mov RD, [RA]\n      |  mov [RA-4], RB\n      |  mov [RA-8], RD\n    }\n    |1:\n    |  ins_next\n    break;\n\n  case BC_LOOP:\n    |  ins_A\t// RA = base, RD = target (loop extent)\n    |  // Note: RA/RD is only used by trace recorder to determine scope/extent\n    |  // This opcode does NOT jump, it's only purpose is to detect a hot loop.\n  |.if JIT\n    |  hotloop RB\n    |.endif\n    | // Fall through. Assumes BC_ILOOP follows and ins_A is a no-op.\n    break;\n\n  case BC_ILOOP:\n    |  ins_A\t// RA = base, RD = target (loop extent)\n    |  ins_next\n    break;\n\n  case BC_JLOOP:\n    |.if JIT\n    |  ins_AD\t// RA = base (ignored), RD = traceno\n    |  mov RA, [DISPATCH+DISPATCH_J(trace)]\n    |  mov TRACE:RD, [RA+RD*4]\n    |  mov RDa, TRACE:RD->mcode\n    |  mov L:RB, SAVE_L\n    |  mov [DISPATCH+DISPATCH_GL(jit_base)], BASE\n    |  mov [DISPATCH+DISPATCH_GL(jit_L)], L:RB\n    |  // Save additional callee-save registers only used in compiled code.\n    |.if X64WIN\n    |  mov TMPQ, r12\n    |  mov TMPa, r13\n    |  mov CSAVE_4, r14\n    |  mov CSAVE_3, r15\n    |  mov RAa, rsp\n    |  sub rsp, 9*16+4*8\n    |  movdqa [RAa], xmm6\n    |  movdqa [RAa-1*16], xmm7\n    |  movdqa [RAa-2*16], xmm8\n    |  movdqa [RAa-3*16], xmm9\n    |  movdqa [RAa-4*16], xmm10\n    |  movdqa [RAa-5*16], xmm11\n    |  movdqa [RAa-6*16], xmm12\n    |  movdqa [RAa-7*16], xmm13\n    |  movdqa [RAa-8*16], xmm14\n    |  movdqa [RAa-9*16], xmm15\n    |.elif X64\n    |  mov TMPQ, r12\n    |  mov TMPa, r13\n    |  sub rsp, 16\n    |.endif\n    |  jmp RDa\n    |.endif\n    break;\n\n  case BC_JMP:\n    |  ins_AJ\t// RA = unused, RD = target\n    |  branchPC RD\n    |  ins_next\n    break;\n\n  /* -- Function headers -------------------------------------------------- */\n\n   /*\n   ** Reminder: A function may be called with func/args above L->maxstack,\n   ** i.e. occupying EXTRA_STACK slots. And vmeta_call may add one extra slot,\n   ** too. This means all FUNC* ops (including fast functions) must check\n   ** for stack overflow _before_ adding more slots!\n   */\n\n  case BC_FUNCF:\n    |.if JIT\n    |  hotcall RB\n    |.endif\n  case BC_FUNCV:  /* NYI: compiled vararg functions. */\n    | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow and ins_AD is a no-op.\n    break;\n\n  case BC_JFUNCF:\n#if !LJ_HASJIT\n    break;\n#endif\n  case BC_IFUNCF:\n    |  ins_AD  // BASE = new base, RA = framesize, RD = nargs+1\n    |  mov KBASE, [PC-4+PC2PROTO(k)]\n    |  mov L:RB, SAVE_L\n    |  lea RA, [BASE+RA*8]\t\t// Top of frame.\n    |  cmp RA, L:RB->maxstack\n    |  ja ->vm_growstack_f\n    |  movzx RA, byte [PC-4+PC2PROTO(numparams)]\n    |  cmp NARGS:RD, RA\t\t\t// Check for missing parameters.\n    |  jbe >3\n    |2:\n    if (op == BC_JFUNCF) {\n      |  movzx RD, PC_RD\n      |  jmp =>BC_JLOOP\n    } else {\n      |  ins_next\n    }\n    |\n    |3:  // Clear missing parameters.\n    |  mov dword [BASE+NARGS:RD*8-4], LJ_TNIL\n    |  add NARGS:RD, 1\n    |  cmp NARGS:RD, RA\n    |  jbe <3\n    |  jmp <2\n    break;\n\n  case BC_JFUNCV:\n#if !LJ_HASJIT\n    break;\n#endif\n    | int3  // NYI: compiled vararg functions\n    break;  /* NYI: compiled vararg functions. */\n\n  case BC_IFUNCV:\n    |  ins_AD  // BASE = new base, RA = framesize, RD = nargs+1\n    |  lea RB, [NARGS:RD*8+FRAME_VARG]\n    |  lea RD, [BASE+NARGS:RD*8]\n    |  mov LFUNC:KBASE, [BASE-8]\n    |  mov [RD-4], RB\t\t\t// Store delta + FRAME_VARG.\n    |  mov [RD-8], LFUNC:KBASE\t\t// Store copy of LFUNC.\n    |  mov L:RB, SAVE_L\n    |  lea RA, [RD+RA*8]\n    |  cmp RA, L:RB->maxstack\n    |  ja ->vm_growstack_v\t\t// Need to grow stack.\n    |  mov RA, BASE\n    |  mov BASE, RD\n    |  movzx RB, byte [PC-4+PC2PROTO(numparams)]\n    |  test RB, RB\n    |  jz >2\n    |1:  // Copy fixarg slots up to new frame.\n    |  add RA, 8\n    |  cmp RA, BASE\n    |  jnb >3\t\t\t\t// Less args than parameters?\n    |  mov KBASE, [RA-8]\n    |  mov [RD], KBASE\n    |  mov KBASE, [RA-4]\n    |  mov [RD+4], KBASE\n    |  add RD, 8\n    |  mov dword [RA-4], LJ_TNIL\t// Clear old fixarg slot (help the GC).\n    |  sub RB, 1\n    |  jnz <1\n    |2:\n    if (op == BC_JFUNCV) {\n      |  movzx RD, PC_RD\n      |  jmp =>BC_JLOOP\n    } else {\n      |  mov KBASE, [PC-4+PC2PROTO(k)]\n      |  ins_next\n    }\n    |\n    |3:  // Clear missing parameters.\n    |  mov dword [RD+4], LJ_TNIL\n    |  add RD, 8\n    |  sub RB, 1\n    |  jnz <3\n    |  jmp <2\n    break;\n\n  case BC_FUNCC:\n  case BC_FUNCCW:\n    |  ins_AD  // BASE = new base, RA = ins RA|RD (unused), RD = nargs+1\n    |  mov CFUNC:RB, [BASE-8]\n    |  mov KBASEa, CFUNC:RB->f\n    |  mov L:RB, SAVE_L\n    |  lea RD, [BASE+NARGS:RD*8-8]\n    |  mov L:RB->base, BASE\n    |  lea RA, [RD+8*LUA_MINSTACK]\n    |  cmp RA, L:RB->maxstack\n    |  mov L:RB->top, RD\n    if (op == BC_FUNCC) {\n      |.if X64\n      |  mov CARG1d, L:RB\t\t\t// Caveat: CARG1d may be RA.\n      |.else\n      |  mov ARG1, L:RB\n      |.endif\n    } else {\n      |.if X64\n      |  mov CARG2, KBASEa\n      |  mov CARG1d, L:RB\t\t\t// Caveat: CARG1d may be RA.\n      |.else\n      |  mov ARG2, KBASEa\n      |  mov ARG1, L:RB\n      |.endif\n    }\n    |  ja ->vm_growstack_c\t\t// Need to grow stack.\n    |  set_vmstate C\n    if (op == BC_FUNCC) {\n      |  call KBASEa\t\t\t// (lua_State *L)\n    } else {\n      |  // (lua_State *L, lua_CFunction f)\n      |  call aword [DISPATCH+DISPATCH_GL(wrapf)]\n    }\n    |  set_vmstate INTERP\n    |  // nresults returned in eax (RD).\n    |  mov BASE, L:RB->base\n    |  lea RA, [BASE+RD*8]\n    |  neg RA\n    |  add RA, L:RB->top\t\t// RA = (L->top-(L->base+nresults))*8\n    |  mov PC, [BASE-4]\t\t\t// Fetch PC of caller.\n    |  jmp ->vm_returnc\n    break;\n\n  /* ---------------------------------------------------------------------- */\n\n  default:\n    fprintf(stderr, \"Error: undefined opcode BC_%s\\n\", bc_names[op]);\n    exit(2);\n    break;\n  }\n}\n\nstatic int build_backend(BuildCtx *ctx)\n{\n  int op;\n  dasm_growpc(Dst, BC__MAX);\n  build_subroutines(ctx);\n  |.code_op\n  for (op = 0; op < BC__MAX; op++)\n    build_ins(ctx, (BCOp)op, op);\n  return BC__MAX;\n}\n\n/* Emit pseudo frame-info for all assembler functions. */\nstatic void emit_asm_debug(BuildCtx *ctx)\n{\n  int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code);\n#if LJ_64\n#define SZPTR\t\"8\"\n#define BSZPTR\t\"3\"\n#define REG_SP\t\"0x7\"\n#define REG_RA\t\"0x10\"\n#else\n#define SZPTR\t\"4\"\n#define BSZPTR\t\"2\"\n#define REG_SP\t\"0x4\"\n#define REG_RA\t\"0x8\"\n#endif\n  switch (ctx->mode) {\n  case BUILD_elfasm:\n    fprintf(ctx->fp, \"\\t.section .debug_frame,\\\"\\\",@progbits\\n\");\n    fprintf(ctx->fp,\n\t\".Lframe0:\\n\"\n\t\"\\t.long .LECIE0-.LSCIE0\\n\"\n\t\".LSCIE0:\\n\"\n\t\"\\t.long 0xffffffff\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -\" SZPTR \"\\n\"\n\t\"\\t.byte \" REG_RA \"\\n\"\n\t\"\\t.byte 0xc\\n\\t.uleb128 \" REG_SP \"\\n\\t.uleb128 \" SZPTR \"\\n\"\n\t\"\\t.byte 0x80+\" REG_RA \"\\n\\t.uleb128 0x1\\n\"\n\t\"\\t.align \" SZPTR \"\\n\"\n\t\".LECIE0:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE0:\\n\"\n\t\"\\t.long .LEFDE0-.LASFDE0\\n\"\n\t\".LASFDE0:\\n\"\n\t\"\\t.long .Lframe0\\n\"\n#if LJ_64\n\t\"\\t.quad .Lbegin\\n\"\n\t\"\\t.quad %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x86\\n\\t.uleb128 0x2\\n\"\t/* offset rbp */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x3\\n\"\t/* offset rbx */\n\t\"\\t.byte 0x8f\\n\\t.uleb128 0x4\\n\"\t/* offset r15 */\n\t\"\\t.byte 0x8e\\n\\t.uleb128 0x5\\n\"\t/* offset r14 */\n#else\n\t\"\\t.long .Lbegin\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x85\\n\\t.uleb128 0x2\\n\"\t/* offset ebp */\n\t\"\\t.byte 0x87\\n\\t.uleb128 0x3\\n\"\t/* offset edi */\n\t\"\\t.byte 0x86\\n\\t.uleb128 0x4\\n\"\t/* offset esi */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x5\\n\"\t/* offset ebx */\n#endif\n\t\"\\t.align \" SZPTR \"\\n\"\n\t\".LEFDE0:\\n\\n\", fcofs, CFRAME_SIZE);\n#if LJ_HASFFI\n    fprintf(ctx->fp,\n\t\".LSFDE1:\\n\"\n\t\"\\t.long .LEFDE1-.LASFDE1\\n\"\n\t\".LASFDE1:\\n\"\n\t\"\\t.long .Lframe0\\n\"\n#if LJ_64\n\t\"\\t.quad lj_vm_ffi_call\\n\"\n\t\"\\t.quad %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 16\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x86\\n\\t.uleb128 0x2\\n\"\t/* offset rbp */\n\t\"\\t.byte 0xd\\n\\t.uleb128 0x6\\n\"\t\t/* def_cfa_register rbp */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x3\\n\"\t/* offset rbx */\n#else\n\t\"\\t.long lj_vm_ffi_call\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.byte 0xe\\n\\t.uleb128 8\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x85\\n\\t.uleb128 0x2\\n\"\t/* offset ebp */\n\t\"\\t.byte 0xd\\n\\t.uleb128 0x5\\n\"\t\t/* def_cfa_register ebp */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x3\\n\"\t/* offset ebx */\n#endif\n\t\"\\t.align \" SZPTR \"\\n\"\n\t\".LEFDE1:\\n\\n\", (int)ctx->codesz - fcofs);\n#endif\n#if (defined(__sun__) && defined(__svr4__))\n    fprintf(ctx->fp, \"\\t.section .eh_frame,\\\"aw\\\",@progbits\\n\");\n#else\n    fprintf(ctx->fp, \"\\t.section .eh_frame,\\\"a\\\",@progbits\\n\");\n#endif\n    fprintf(ctx->fp,\n\t\".Lframe1:\\n\"\n\t\"\\t.long .LECIE1-.LSCIE1\\n\"\n\t\".LSCIE1:\\n\"\n\t\"\\t.long 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"zPR\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -\" SZPTR \"\\n\"\n\t\"\\t.byte \" REG_RA \"\\n\"\n\t\"\\t.uleb128 6\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.long lj_err_unwind_dwarf-.\\n\"\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.byte 0xc\\n\\t.uleb128 \" REG_SP \"\\n\\t.uleb128 \" SZPTR \"\\n\"\n\t\"\\t.byte 0x80+\" REG_RA \"\\n\\t.uleb128 0x1\\n\"\n\t\"\\t.align \" SZPTR \"\\n\"\n\t\".LECIE1:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE2:\\n\"\n\t\"\\t.long .LEFDE2-.LASFDE2\\n\"\n\t\".LASFDE2:\\n\"\n\t\"\\t.long .LASFDE2-.Lframe1\\n\"\n\t\"\\t.long .Lbegin-.\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.uleb128 0\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0xe\\n\\t.uleb128 %d\\n\"\t\t/* def_cfa_offset */\n#if LJ_64\n\t\"\\t.byte 0x86\\n\\t.uleb128 0x2\\n\"\t/* offset rbp */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x3\\n\"\t/* offset rbx */\n\t\"\\t.byte 0x8f\\n\\t.uleb128 0x4\\n\"\t/* offset r15 */\n\t\"\\t.byte 0x8e\\n\\t.uleb128 0x5\\n\"\t/* offset r14 */\n#else\n\t\"\\t.byte 0x85\\n\\t.uleb128 0x2\\n\"\t/* offset ebp */\n\t\"\\t.byte 0x87\\n\\t.uleb128 0x3\\n\"\t/* offset edi */\n\t\"\\t.byte 0x86\\n\\t.uleb128 0x4\\n\"\t/* offset esi */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x5\\n\"\t/* offset ebx */\n#endif\n\t\"\\t.align \" SZPTR \"\\n\"\n\t\".LEFDE2:\\n\\n\", fcofs, CFRAME_SIZE);\n#if LJ_HASFFI\n    fprintf(ctx->fp,\n\t\".Lframe2:\\n\"\n\t\"\\t.long .LECIE2-.LSCIE2\\n\"\n\t\".LSCIE2:\\n\"\n\t\"\\t.long 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.string \\\"zR\\\"\\n\"\n\t\"\\t.uleb128 0x1\\n\"\n\t\"\\t.sleb128 -\" SZPTR \"\\n\"\n\t\"\\t.byte \" REG_RA \"\\n\"\n\t\"\\t.uleb128 1\\n\"\t\t\t/* augmentation length */\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.byte 0xc\\n\\t.uleb128 \" REG_SP \"\\n\\t.uleb128 \" SZPTR \"\\n\"\n\t\"\\t.byte 0x80+\" REG_RA \"\\n\\t.uleb128 0x1\\n\"\n\t\"\\t.align \" SZPTR \"\\n\"\n\t\".LECIE2:\\n\\n\");\n    fprintf(ctx->fp,\n\t\".LSFDE3:\\n\"\n\t\"\\t.long .LEFDE3-.LASFDE3\\n\"\n\t\".LASFDE3:\\n\"\n\t\"\\t.long .LASFDE3-.Lframe2\\n\"\n\t\"\\t.long lj_vm_ffi_call-.\\n\"\n\t\"\\t.long %d\\n\"\n\t\"\\t.uleb128 0\\n\"\t\t\t/* augmentation length */\n#if LJ_64\n\t\"\\t.byte 0xe\\n\\t.uleb128 16\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x86\\n\\t.uleb128 0x2\\n\"\t/* offset rbp */\n\t\"\\t.byte 0xd\\n\\t.uleb128 0x6\\n\"\t\t/* def_cfa_register rbp */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x3\\n\"\t/* offset rbx */\n#else\n\t\"\\t.byte 0xe\\n\\t.uleb128 8\\n\"\t\t/* def_cfa_offset */\n\t\"\\t.byte 0x85\\n\\t.uleb128 0x2\\n\"\t/* offset ebp */\n\t\"\\t.byte 0xd\\n\\t.uleb128 0x5\\n\"\t\t/* def_cfa_register ebp */\n\t\"\\t.byte 0x83\\n\\t.uleb128 0x3\\n\"\t/* offset ebx */\n#endif\n\t\"\\t.align \" SZPTR \"\\n\"\n\t\".LEFDE3:\\n\\n\", (int)ctx->codesz - fcofs);\n#endif\n    break;\n  /* Mental note: never let Apple design an assembler.\n  ** Or a linker. Or a plastic case. But I digress.\n  */\n  case BUILD_machasm: {\n#if LJ_HASFFI\n    int fcsize = 0;\n#endif\n    int i;\n    fprintf(ctx->fp, \"\\t.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support\\n\");\n    fprintf(ctx->fp,\n\t\"EH_frame1:\\n\"\n\t\"\\t.set L$set$x,LECIEX-LSCIEX\\n\"\n\t\"\\t.long L$set$x\\n\"\n\t\"LSCIEX:\\n\"\n\t\"\\t.long 0\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.ascii \\\"zPR\\\\0\\\"\\n\"\n\t\"\\t.byte 0x1\\n\"\n\t\"\\t.byte 128-\" SZPTR \"\\n\"\n\t\"\\t.byte \" REG_RA \"\\n\"\n\t\"\\t.byte 6\\n\"\t\t\t\t/* augmentation length */\n\t\"\\t.byte 0x9b\\n\"\t\t\t/* indirect|pcrel|sdata4 */\n#if LJ_64\n\t\"\\t.long _lj_err_unwind_dwarf+4@GOTPCREL\\n\"\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.byte 0xc\\n\\t.byte \" REG_SP \"\\n\\t.byte \" SZPTR \"\\n\"\n#else\n\t\"\\t.long L_lj_err_unwind_dwarf$non_lazy_ptr-.\\n\"\n\t\"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t\"\\t.byte 0xc\\n\\t.byte 0x5\\n\\t.byte 0x4\\n\"  /* esp=5 on 32 bit MACH-O. */\n#endif\n\t\"\\t.byte 0x80+\" REG_RA \"\\n\\t.byte 0x1\\n\"\n\t\"\\t.align \" BSZPTR \"\\n\"\n\t\"LECIEX:\\n\\n\");\n    for (i = 0; i < ctx->nsym; i++) {\n      const char *name = ctx->sym[i].name;\n      int32_t size = ctx->sym[i+1].ofs - ctx->sym[i].ofs;\n      if (size == 0) continue;\n#if LJ_HASFFI\n      if (!strcmp(name, \"_lj_vm_ffi_call\")) { fcsize = size; continue; }\n#endif\n      fprintf(ctx->fp,\n\t  \"%s.eh:\\n\"\n\t  \"LSFDE%d:\\n\"\n\t  \"\\t.set L$set$%d,LEFDE%d-LASFDE%d\\n\"\n\t  \"\\t.long L$set$%d\\n\"\n\t  \"LASFDE%d:\\n\"\n\t  \"\\t.long LASFDE%d-EH_frame1\\n\"\n\t  \"\\t.long %s-.\\n\"\n\t  \"\\t.long %d\\n\"\n\t  \"\\t.byte 0\\n\"\t\t\t\t/* augmentation length */\n\t  \"\\t.byte 0xe\\n\\t.byte %d\\n\"\t\t/* def_cfa_offset */\n#if LJ_64\n\t  \"\\t.byte 0x86\\n\\t.byte 0x2\\n\"\t\t/* offset rbp */\n\t  \"\\t.byte 0x83\\n\\t.byte 0x3\\n\"\t\t/* offset rbx */\n\t  \"\\t.byte 0x8f\\n\\t.byte 0x4\\n\"\t\t/* offset r15 */\n\t  \"\\t.byte 0x8e\\n\\t.byte 0x5\\n\"\t\t/* offset r14 */\n#else\n\t  \"\\t.byte 0x84\\n\\t.byte 0x2\\n\"\t\t/* offset ebp (4 for MACH-O)*/\n\t  \"\\t.byte 0x87\\n\\t.byte 0x3\\n\"\t\t/* offset edi */\n\t  \"\\t.byte 0x86\\n\\t.byte 0x4\\n\"\t\t/* offset esi */\n\t  \"\\t.byte 0x83\\n\\t.byte 0x5\\n\"\t\t/* offset ebx */\n#endif\n\t  \"\\t.align \" BSZPTR \"\\n\"\n\t  \"LEFDE%d:\\n\\n\",\n\t  name, i, i, i, i, i, i, i, name, size, CFRAME_SIZE, i);\n    }\n#if LJ_HASFFI\n    if (fcsize) {\n      fprintf(ctx->fp,\n\t  \"EH_frame2:\\n\"\n\t  \"\\t.set L$set$y,LECIEY-LSCIEY\\n\"\n\t  \"\\t.long L$set$y\\n\"\n\t  \"LSCIEY:\\n\"\n\t  \"\\t.long 0\\n\"\n\t  \"\\t.byte 0x1\\n\"\n\t  \"\\t.ascii \\\"zR\\\\0\\\"\\n\"\n\t  \"\\t.byte 0x1\\n\"\n\t  \"\\t.byte 128-\" SZPTR \"\\n\"\n\t  \"\\t.byte \" REG_RA \"\\n\"\n\t  \"\\t.byte 1\\n\"\t\t\t\t/* augmentation length */\n#if LJ_64\n\t  \"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t  \"\\t.byte 0xc\\n\\t.byte \" REG_SP \"\\n\\t.byte \" SZPTR \"\\n\"\n#else\n\t  \"\\t.byte 0x1b\\n\"\t\t\t/* pcrel|sdata4 */\n\t  \"\\t.byte 0xc\\n\\t.byte 0x5\\n\\t.byte 0x4\\n\"  /* esp=5 on 32 bit MACH. */\n#endif\n\t  \"\\t.byte 0x80+\" REG_RA \"\\n\\t.byte 0x1\\n\"\n\t  \"\\t.align \" BSZPTR \"\\n\"\n\t  \"LECIEY:\\n\\n\");\n      fprintf(ctx->fp,\n\t  \"_lj_vm_ffi_call.eh:\\n\"\n\t  \"LSFDEY:\\n\"\n\t  \"\\t.set L$set$yy,LEFDEY-LASFDEY\\n\"\n\t  \"\\t.long L$set$yy\\n\"\n\t  \"LASFDEY:\\n\"\n\t  \"\\t.long LASFDEY-EH_frame2\\n\"\n\t  \"\\t.long _lj_vm_ffi_call-.\\n\"\n\t  \"\\t.long %d\\n\"\n\t  \"\\t.byte 0\\n\"\t\t\t\t/* augmentation length */\n#if LJ_64\n\t  \"\\t.byte 0xe\\n\\t.byte 16\\n\"\t\t/* def_cfa_offset */\n\t  \"\\t.byte 0x86\\n\\t.byte 0x2\\n\"\t\t/* offset rbp */\n\t  \"\\t.byte 0xd\\n\\t.uleb128 0x6\\n\"\t/* def_cfa_register rbp */\n\t  \"\\t.byte 0x83\\n\\t.byte 0x3\\n\"\t\t/* offset rbx */\n#else\n\t  \"\\t.byte 0xe\\n\\t.byte 8\\n\"\t\t/* def_cfa_offset */\n\t  \"\\t.byte 0x84\\n\\t.byte 0x2\\n\"\t\t/* offset ebp (4 for MACH-O)*/\n\t  \"\\t.byte 0xd\\n\\t.uleb128 0x4\\n\"\t/* def_cfa_register ebp */\n\t  \"\\t.byte 0x83\\n\\t.byte 0x3\\n\"\t\t/* offset ebx */\n#endif\n\t  \"\\t.align \" BSZPTR \"\\n\"\n\t  \"LEFDEY:\\n\\n\", fcsize);\n    }\n#endif\n#if LJ_64\n    fprintf(ctx->fp, \"\\t.subsections_via_symbols\\n\");\n#else\n    fprintf(ctx->fp,\n      \"\\t.non_lazy_symbol_pointer\\n\"\n      \"L_lj_err_unwind_dwarf$non_lazy_ptr:\\n\"\n      \".indirect_symbol _lj_err_unwind_dwarf\\n\"\n      \".long 0\\n\");\n#endif\n    }\n    break;\n  default:  /* Difficult for other modes. */\n    break;\n  }\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/src/xedkbuild.bat",
    "content": "@rem Script to build LuaJIT with the Xbox 360 SDK.\n@rem Donated to the public domain.\n@rem\n@rem Open a \"Visual Studio .NET Command Prompt\" (32 bit host compiler)\n@rem Then cd to this directory and run this script.\n\n@if not defined INCLUDE goto :FAIL\n@if not defined XEDK goto :FAIL\n\n@setlocal\n@rem ---- Host compiler ----\n@set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE\n@set LJLINK=link /nologo\n@set LJMT=mt /nologo\n@set DASMDIR=..\\dynasm\n@set DASM=%DASMDIR%\\dynasm.lua\n@set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c\n\n%LJCOMPILE% host\\minilua.c\n@if errorlevel 1 goto :BAD\n%LJLINK% /out:minilua.exe minilua.obj\n@if errorlevel 1 goto :BAD\nif exist minilua.exe.manifest^\n  %LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe\n\n@rem Error out for 64 bit host compiler\n@minilua\n@if errorlevel 8 goto :FAIL\n\n@set DASMFLAGS=-D GPR64 -D FRAME32 -D PPE -D SQRT -D DUALNUM\nminilua %DASM% -LN %DASMFLAGS% -o host\\buildvm_arch.h vm_ppc.dasc\n@if errorlevel 1 goto :BAD\n\n%LJCOMPILE% /I \".\" /I %DASMDIR% /D_XBOX_VER=200 /DLUAJIT_TARGET=LUAJIT_ARCH_PPC  host\\buildvm*.c\n@if errorlevel 1 goto :BAD\n%LJLINK% /out:buildvm.exe buildvm*.obj\n@if errorlevel 1 goto :BAD\nif exist buildvm.exe.manifest^\n  %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe\n\nbuildvm -m peobj -o lj_vm.obj\n@if errorlevel 1 goto :BAD\nbuildvm -m bcdef -o lj_bcdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m ffdef -o lj_ffdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m libdef -o lj_libdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m recdef -o lj_recdef.h %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m vmdef -o jit\\vmdef.lua %ALL_LIB%\n@if errorlevel 1 goto :BAD\nbuildvm -m folddef -o lj_folddef.h lj_opt_fold.c\n@if errorlevel 1 goto :BAD\n\n@rem ---- Cross compiler ----\n@set LJCOMPILE=\"%XEDK%\\bin\\win32\\cl\" /nologo /c /MT /O2 /W3 /GF /Gm- /GR- /GS- /Gy /openmp- /D_CRT_SECURE_NO_DEPRECATE /DNDEBUG /D_XBOX /D_LIB /DLUAJIT_USE_SYSMALLOC\n@set LJLIB=\"%XEDK%\\bin\\win32\\lib\" /nologo\n@set INCLUDE=\"%XEDK%\\include\\xbox\"\n\n@if \"%1\" neq \"debug\" goto :NODEBUG\n@shift\n@set LJCOMPILE=\"%LJCOMPILE%\" /Zi\n:NODEBUG\n@if \"%1\"==\"amalg\" goto :AMALG\n%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c\n@if errorlevel 1 goto :BAD\n%LJLIB% /OUT:luajit20.lib lj_*.obj lib_*.obj\n@if errorlevel 1 goto :BAD\n@goto :NOAMALG\n:AMALG\n%LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c\n@if errorlevel 1 goto :BAD\n%LJLIB% /OUT:luajit20.lib ljamalg.obj lj_vm.obj\n@if errorlevel 1 goto :BAD\n:NOAMALG\n\n@del *.obj *.manifest minilua.exe buildvm.exe\n@echo.\n@echo === Successfully built LuaJIT for Xbox 360 ===\n\n@goto :END\n:BAD\n@echo.\n@echo *******************************************************\n@echo *** Build FAILED -- Please check the error messages ***\n@echo *******************************************************\u0007\n@goto :END\n:FAIL\n@echo To run this script you must open a \"Visual Studio .NET Command Prompt\"\n@echo (32 bit host compiler). The Xbox 360 SDK must be installed, too.\n:END\n"
  },
  {
    "path": "cocos2d/external/lua/luajit/src/v2.0.1_hotfix1.patch",
    "content": "Add missing GC steps for io.* functions.\nMIPS: Fix cache flush/sync for JIT-compiled code jump area.\nARM: Fix cache flush/sync for exit stubs of JIT-compiled code.\nFix MSVC intrinsics for older versions.\nFix memory access check for fast string interning.\n\n--- a/src/lib_io.c\n+++ b/src/lib_io.c\n@@ -17,6 +17,7 @@\n #include \"lualib.h\"\n \n #include \"lj_obj.h\"\n+#include \"lj_gc.h\"\n #include \"lj_err.h\"\n #include \"lj_str.h\"\n #include \"lj_state.h\"\n@@ -152,6 +153,7 @@ static int io_file_readline(lua_State *L, FILE *fp, MSize chop)\n     if (n >= m - 64) m += m;\n   }\n   setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n));\n+  lj_gc_check(L);\n   return (int)ok;\n }\n \n@@ -163,6 +165,7 @@ static void io_file_readall(lua_State *L, FILE *fp)\n     n += (MSize)fread(buf+n, 1, m-n, fp);\n     if (n != m) {\n       setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n));\n+      lj_gc_check(L);\n       return;\n     }\n   }\n@@ -174,6 +177,7 @@ static int io_file_readlen(lua_State *L, FILE *fp, MSize m)\n     char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m);\n     MSize n = (MSize)fread(buf, 1, m, fp);\n     setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n));\n+    lj_gc_check(L);\n     return (n > 0 || m == 0);\n   } else {\n     int c = getc(fp);\n--- a/src/lj_asm_arm.h\n+++ b/src/lj_asm_arm.h\n@@ -91,6 +91,7 @@ static MCode *asm_exitstub_gen(ASMState *as, ExitNo group)\n   *mxp++ = group*EXITSTUBS_PER_GROUP;\n   for (i = 0; i < EXITSTUBS_PER_GROUP; i++)\n     *mxp++ = ARMI_B|((-6-i)&0x00ffffffu);\n+  lj_mcode_sync(as->mcbot, mxp);\n   lj_mcode_commitbot(as->J, mxp);\n   as->mcbot = mxp;\n   as->mclim = as->mcbot + MCLIM_REDZONE;\n--- a/src/lj_asm_mips.h\n+++ b/src/lj_asm_mips.h\n@@ -71,6 +71,7 @@ static void asm_sparejump_setup(ASMState *as)\n     memset(mxp+2, 0, MIPS_SPAREJUMP*8);\n     mxp += MIPS_SPAREJUMP*2;\n     lua_assert(mxp < as->mctop);\n+    lj_mcode_sync(as->mcbot, mxp);\n     lj_mcode_commitbot(as->J, mxp);\n     as->mcbot = mxp;\n     as->mclim = as->mcbot + MCLIM_REDZONE;\n--- a/src/lj_def.h\n+++ b/src/lj_def.h\n@@ -243,17 +243,17 @@ static LJ_AINLINE uint32_t lj_getu32(const void *p)\n #endif\n \n #ifdef _M_PPC\n-#pragma intrinsic(_CountLeadingZeros)\n unsigned int _CountLeadingZeros(long);\n+#pragma intrinsic(_CountLeadingZeros)\n static LJ_AINLINE uint32_t lj_fls(uint32_t x)\n {\n   return _CountLeadingZeros(x) ^ 31;\n }\n #else\n-#pragma intrinsic(_BitScanForward)\n-#pragma intrinsic(_BitScanReverse)\n unsigned char _BitScanForward(uint32_t *, unsigned long);\n unsigned char _BitScanReverse(uint32_t *, unsigned long);\n+#pragma intrinsic(_BitScanForward)\n+#pragma intrinsic(_BitScanReverse)\n \n static LJ_AINLINE uint32_t lj_ffs(uint32_t x)\n {\n--- a/src/lj_str.c\n+++ b/src/lj_str.c\n@@ -48,7 +48,7 @@ static LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len)\n {\n   MSize i = 0;\n   lua_assert(len > 0);\n-  lua_assert((((uintptr_t)a + len) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4);\n+  lua_assert((((uintptr_t)a+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4);\n   do {  /* Note: innocuous access up to end of string + 3. */\n     uint32_t v = lj_getu32(a+i) ^ *(const uint32_t *)(b+i);\n     if (v) {\n@@ -121,7 +121,7 @@ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx)\n   h ^= b; h -= lj_rol(b, 16);\n   /* Check if the string has already been interned. */\n   o = gcref(g->strhash[h & g->strmask]);\n-  if (LJ_LIKELY((((uintptr_t)str + len) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) {\n+  if (LJ_LIKELY((((uintptr_t)str+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) {\n     while (o != NULL) {\n       GCstr *sx = gco2str(o);\n       if (sx->len == len && str_fastcmp(str, strdata(sx), len) == 0) {\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/CMakeLists.txt",
    "content": "set(TOLUA_SRC\n  tolua_event.c\n  tolua_is.c\n  tolua_map.c\n  tolua_push.c\n  tolua_to.c\n)\n\ninclude_directories(\n  ../lua\n)\n\n\nadd_library(tolua STATIC\n  ${TOLUA_SRC}\n)\n\nset_target_properties(tolua\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/tolua++.h",
    "content": "/* tolua\n** Support code for Lua bindings.\n** Written by Waldemar Celes\n** TeCGraf/PUC-Rio\n** Apr 2003\n** $Id: $\n*/\n\n/* This code is free software; you can redistribute it and/or modify it.\n** The software provided hereunder is on an \"as is\" basis, and\n** the author has no obligation to provide maintenance, support, updates,\n** enhancements, or modifications.\n*/\n\n\n#ifndef TOLUA_H\n#define TOLUA_H\n\n#ifndef TOLUA_API\n#define TOLUA_API extern\n#endif\n\n#define TOLUA_VERSION \"tolua++-1.0.93\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define tolua_pushcppstring(x,y)                tolua_pushstring(x,y.c_str())\n#define tolua_iscppstring                       tolua_isstring\n\n#define tolua_iscppstringarray                  tolua_isstringarray\n#define tolua_pushfieldcppstring(L,lo,idx,s)    tolua_pushfieldstring(L, lo, idx, s.c_str())\n\n#ifndef TEMPLATE_BIND\n#define TEMPLATE_BIND(p)\n#endif\n\n#define TOLUA_TEMPLATE_BIND(p)\n\n#define TOLUA_PROTECTED_DESTRUCTOR\n#define TOLUA_PROPERTY_TYPE(p)\n\n#define TOLUA_VALUE_ROOT \"tolua_value_root\"\n\ntypedef int lua_Object;\n\n#include \"lua.h\"\n#include \"lauxlib.h\"\n\nstruct tolua_Error\n{\n    int index;\n    int array;\n    const char* type;\n};\ntypedef struct tolua_Error tolua_Error;\n\n#define TOLUA_NOPEER    LUA_REGISTRYINDEX /* for lua 5.1 */\n\nTOLUA_API const char* tolua_typename (lua_State* L, int lo);\nTOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err);\nTOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err);\nTOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err);\nTOLUA_API int tolua_isvaluenil (lua_State* L, int lo, tolua_Error* err);\nTOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err);\nTOLUA_API int tolua_isnumber (lua_State* L, int lo, int def, tolua_Error* err);\nTOLUA_API int tolua_isstring (lua_State* L, int lo, int def, tolua_Error* err);\nTOLUA_API int tolua_istable (lua_State* L, int lo, int def, tolua_Error* err);\nTOLUA_API int tolua_isusertable (lua_State* L, int lo, const char* type, int def, tolua_Error* err);\nTOLUA_API int tolua_isuserdata (lua_State* L, int lo, int def, tolua_Error* err);\nTOLUA_API int tolua_isusertype (lua_State* L, int lo, const char* type, int def, tolua_Error* err);\nTOLUA_API int tolua_isvaluearray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err);\nTOLUA_API int tolua_isbooleanarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err);\nTOLUA_API int tolua_isnumberarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err);\nTOLUA_API int tolua_isstringarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err);\nTOLUA_API int tolua_istablearray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err);\nTOLUA_API int tolua_isuserdataarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err);\nTOLUA_API int tolua_isusertypearray\n(lua_State* L, int lo, const char* type, int dim, int def, tolua_Error* err);\n\nTOLUA_API void tolua_open (lua_State* L);\n\nTOLUA_API void* tolua_copy (lua_State* L, void* value, unsigned int size);\nTOLUA_API int tolua_register_gc (lua_State* L, int lo);\nTOLUA_API int tolua_default_collect (lua_State* tolua_S);\n\nTOLUA_API void tolua_usertype (lua_State* L, const char* type);\nTOLUA_API void tolua_beginmodule (lua_State* L, const char* name);\nTOLUA_API void tolua_endmodule (lua_State* L);\nTOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar);\nTOLUA_API void tolua_class (lua_State* L, const char* name, const char* base);\nTOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col);\nTOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func);\nTOLUA_API void tolua_constant (lua_State* L, const char* name, lua_Number value);\nTOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set);\nTOLUA_API void tolua_array (lua_State* L,const char* name, lua_CFunction get, lua_CFunction set);\n\n/* TOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, char* type); */\nTOLUA_API void tolua_addbase(lua_State* L, char* name, char* base);\n\nTOLUA_API void tolua_pushvalue (lua_State* L, int lo);\nTOLUA_API void tolua_pushboolean (lua_State* L, int value);\nTOLUA_API void tolua_pushnumber (lua_State* L, lua_Number value);\nTOLUA_API void tolua_pushstring (lua_State* L, const char* value);\nTOLUA_API void tolua_pushuserdata (lua_State* L, void* value);\nTOLUA_API void tolua_pushusertype (lua_State* L, void* value, const char* type);\nTOLUA_API void tolua_pushusertype_and_takeownership(lua_State* L, void* value, const char* type);\nTOLUA_API void tolua_pushfieldvalue (lua_State* L, int lo, int index, int v);\nTOLUA_API void tolua_pushfieldboolean (lua_State* L, int lo, int index, int v);\nTOLUA_API void tolua_pushfieldnumber (lua_State* L, int lo, int index, lua_Number v);\nTOLUA_API void tolua_pushfieldstring (lua_State* L, int lo, int index, const char* v);\nTOLUA_API void tolua_pushfielduserdata (lua_State* L, int lo, int index, void* v);\nTOLUA_API void tolua_pushfieldusertype (lua_State* L, int lo, int index, void* v, const char* type);\nTOLUA_API void tolua_pushfieldusertype_and_takeownership (lua_State* L, int lo, int index, void* v, const char* type);\n    \nTOLUA_API void tolua_pushusertype_and_addtoroot (lua_State* L, void* value, const char* type);\nTOLUA_API void tolua_add_value_to_root (lua_State* L,void* value);\nTOLUA_API void tolua_remove_value_from_root (lua_State* L, void* value);\n\nTOLUA_API lua_Number tolua_tonumber (lua_State* L, int narg, lua_Number def);\nTOLUA_API const char* tolua_tostring (lua_State* L, int narg, const char* def);\nTOLUA_API void* tolua_touserdata (lua_State* L, int narg, void* def);\nTOLUA_API void* tolua_tousertype (lua_State* L, int narg, void* def);\nTOLUA_API int tolua_tovalue (lua_State* L, int narg, int def);\nTOLUA_API int tolua_toboolean (lua_State* L, int narg, int def);\nTOLUA_API lua_Number tolua_tofieldnumber (lua_State* L, int lo, int index, lua_Number def);\nTOLUA_API const char* tolua_tofieldstring (lua_State* L, int lo, int index, const char* def);\nTOLUA_API void* tolua_tofielduserdata (lua_State* L, int lo, int index, void* def);\nTOLUA_API void* tolua_tofieldusertype (lua_State* L, int lo, int index, void* def);\nTOLUA_API int tolua_tofieldvalue (lua_State* L, int lo, int index, int def);\nTOLUA_API int tolua_getfieldboolean (lua_State* L, int lo, int index, int def);\n\nTOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, const char* name);\n\nTOLUA_API int class_gc_event (lua_State* L);\n\n#ifdef __cplusplus\nstatic inline const char* tolua_tocppstring (lua_State* L, int narg, const char* def) {\n\n    const char* s = tolua_tostring(L, narg, def);\n    return s?s:\"\";\n};\n\nstatic inline const char* tolua_tofieldcppstring (lua_State* L, int lo, int index, const char* def) {\n\n    const char* s = tolua_tofieldstring(L, lo, index, def);\n    return s?s:\"\";\n};\n\n#else\n#define tolua_tocppstring tolua_tostring\n#define tolua_tofieldcppstring tolua_tofieldstring\n#endif\n\nTOLUA_API int tolua_fast_isa(lua_State *L, int mt_indexa, int mt_indexb, int super_index);\n\n#ifndef Mtolua_new\n#define Mtolua_new(EXP) new EXP\n#endif\n\n#ifndef Mtolua_delete\n#define Mtolua_delete(EXP) delete EXP\n#endif\n\n#ifndef Mtolua_new_dim\n#define Mtolua_new_dim(EXP, len) new EXP[len]\n#endif\n\n#ifndef Mtolua_delete_dim\n#define Mtolua_delete_dim(EXP) delete [] EXP\n#endif\n\n#ifndef tolua_outside\n#define tolua_outside\n#endif\n\n#ifndef tolua_owned\n#define tolua_owned\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/tolua_event.c",
    "content": "/* tolua: event functions\n** Support code for Lua bindings.\n** Written by Waldemar Celes\n** TeCGraf/PUC-Rio\n** Apr 2003\n** $Id: $\n*/\n\n/* This code is free software; you can redistribute it and/or modify it.\n** The software provided hereunder is on an \"as is\" basis, and\n** the author has no obligation to provide maintenance, support, updates,\n** enhancements, or modifications.\n*/\n\n#include <stdio.h>\n\n#include \"tolua++.h\"\n\n/* Store at ubox\n    * It stores, creating the corresponding table if needed,\n    * the pair key/value in the corresponding ubox table\n*/\nstatic void storeatubox (lua_State* L, int lo)\n{\n#ifdef LUA_VERSION_NUM\n    lua_getfenv(L, lo);\n    if (lua_rawequal(L, -1, TOLUA_NOPEER)) {\n        lua_pop(L, 1);\n        lua_newtable(L);\n        lua_pushvalue(L, -1);\n        lua_setfenv(L, lo);    /* stack: k,v,table  */\n    };\n    lua_insert(L, -3);\n    lua_settable(L, -3); /* on lua 5.1, we trade the \"tolua_peers\" lookup for a settable call */\n    lua_pop(L, 1);\n#else\n    /* stack: key value (to be stored) */\n    lua_pushstring(L,\"tolua_peers\");\n    lua_rawget(L,LUA_REGISTRYINDEX);        /* stack: k v ubox */\n    lua_pushvalue(L,lo);\n    lua_rawget(L,-2);                       /* stack: k v ubox ubox[u] */\n    if (!lua_istable(L,-1))\n    {\n        lua_pop(L,1);                          /* stack: k v ubox */\n        lua_newtable(L);                       /* stack: k v ubox table */\n        lua_pushvalue(L,1);\n        lua_pushvalue(L,-2);                   /* stack: k v ubox table u table */\n        lua_rawset(L,-4);                      /* stack: k v ubox ubox[u]=table */\n    }\n    lua_insert(L,-4);                       /* put table before k */\n    lua_pop(L,1);                           /* pop ubox */\n    lua_rawset(L,-3);                       /* store at table */\n    lua_pop(L,1);                           /* pop ubox[u] */\n#endif\n}\n\n/* Module index function\n*/\nstatic int module_index_event (lua_State* L)\n{\n    lua_pushstring(L,\".get\");\n    lua_rawget(L,-3);\n    if (lua_istable(L,-1))\n    {\n        lua_pushvalue(L,2);  /* key */\n        lua_rawget(L,-2);\n        if (lua_iscfunction(L,-1))\n        {\n            lua_call(L,0,1);\n            return 1;\n        }\n        else if (lua_istable(L,-1))\n            return 1;\n    }\n    /* call old index meta event */\n    if (lua_getmetatable(L,1))\n    {\n        lua_pushstring(L,\"__index\");\n        lua_rawget(L,-2);\n        lua_pushvalue(L,1);\n        lua_pushvalue(L,2);\n        if (lua_isfunction(L,-1))\n        {\n            lua_call(L,2,1);\n            return 1;\n        }\n        else if (lua_istable(L,-1))\n        {\n            lua_gettable(L,-3);\n            return 1;\n        }\n    }\n    lua_pushnil(L);\n    return 1;\n}\n\n/* Module newindex function\n*/\nstatic int module_newindex_event (lua_State* L)\n{\n    lua_pushstring(L,\".set\");\n    lua_rawget(L,-4);\n    if (lua_istable(L,-1))\n    {\n        lua_pushvalue(L,2);  /* key */\n        lua_rawget(L,-2);\n        if (lua_iscfunction(L,-1))\n        {\n            lua_pushvalue(L,1); /* only to be compatible with non-static vars */\n            lua_pushvalue(L,3); /* value */\n            lua_call(L,2,0);\n            return 0;\n        }\n    }\n    /* call old newindex meta event */\n    if (lua_getmetatable(L,1) && lua_getmetatable(L,-1))\n    {\n        lua_pushstring(L,\"__newindex\");\n        lua_rawget(L,-2);\n        if (lua_isfunction(L,-1))\n        {\n            lua_pushvalue(L,1);\n            lua_pushvalue(L,2);\n            lua_pushvalue(L,3);\n            lua_call(L,3,0);\n        }\n    }\n    lua_settop(L,3);\n    lua_rawset(L,-3);\n    return 0;\n}\n\n/* Class index function\n    * If the object is a userdata (ie, an object), it searches the field in\n    * the alternative table stored in the corresponding \"ubox\" table.\n*/\nstatic int class_index_event (lua_State* L)\n{\n    int t = lua_type(L,1);\n    if (t == LUA_TUSERDATA)\n    {\n        /* Access alternative table */\n#ifdef LUA_VERSION_NUM /* new macro on version 5.1 */\n        lua_getfenv(L,1);\n        if (!lua_rawequal(L, -1, TOLUA_NOPEER)) {\n            lua_pushvalue(L, 2); /* key */\n            lua_gettable(L, -2); /* on lua 5.1, we trade the \"tolua_peers\" lookup for a gettable call */\n            if (!lua_isnil(L, -1))\n                return 1;\n        };\n#else\n        lua_pushstring(L,\"tolua_peers\");\n        lua_rawget(L,LUA_REGISTRYINDEX);        /* stack: obj key ubox */\n        lua_pushvalue(L,1);\n        lua_rawget(L,-2);                       /* stack: obj key ubox ubox[u] */\n        if (lua_istable(L,-1))\n        {\n            lua_pushvalue(L,2);  /* key */\n            lua_rawget(L,-2);                      /* stack: obj key ubox ubox[u] value */\n            if (!lua_isnil(L,-1))\n                return 1;\n        }\n#endif\n        lua_settop(L,2);                        /* stack: obj key */\n        /* Try metatables */\n        lua_pushvalue(L,1);                     /* stack: obj key obj */\n        while (lua_getmetatable(L,-1))\n        {   /* stack: obj key obj mt */\n            lua_remove(L,-2);                      /* stack: obj key mt */\n            if (lua_isnumber(L,2))                 /* check if key is a numeric value */\n            {\n                /* try operator[] */\n                lua_pushstring(L,\".geti\");\n                lua_rawget(L,-2);                      /* stack: obj key mt func */\n                if (lua_isfunction(L,-1))\n                {\n                    lua_pushvalue(L,1);\n                    lua_pushvalue(L,2);\n                    lua_call(L,2,1);\n                    return 1;\n                }\n            }\n            else\n            {\n                lua_pushvalue(L,2);                    /* stack: obj key mt key */\n                lua_rawget(L,-2);                      /* stack: obj key mt value */\n                if (!lua_isnil(L,-1))\n                    return 1;\n                else\n                    lua_pop(L,1);\n                /* try C/C++ variable */\n                lua_pushstring(L,\".get\");\n                lua_rawget(L,-2);                      /* stack: obj key mt tget */\n                if (lua_istable(L,-1))\n                {\n                    lua_pushvalue(L,2);\n                    lua_rawget(L,-2);                      /* stack: obj key mt value */\n                    if (lua_iscfunction(L,-1))\n                    {\n                        lua_pushvalue(L,1);\n                        lua_pushvalue(L,2);\n                        lua_call(L,2,1);\n                        return 1;\n                    }\n                    else if (lua_istable(L,-1))\n                    {\n                        /* deal with array: create table to be returned and cache it in ubox */\n                        void* u = *((void**)lua_touserdata(L,1));\n                        lua_newtable(L);                /* stack: obj key mt value table */\n                        lua_pushstring(L,\".self\");\n                        lua_pushlightuserdata(L,u);\n                        lua_rawset(L,-3);               /* store usertype in \".self\" */\n                        lua_insert(L,-2);               /* stack: obj key mt table value */\n                        lua_setmetatable(L,-2);         /* set stored value as metatable */\n                        lua_pushvalue(L,-1);            /* stack: obj key met table table */\n                        lua_pushvalue(L,2);             /* stack: obj key mt table table key */\n                        lua_insert(L,-2);               /*  stack: obj key mt table key table */\n                        storeatubox(L,1);               /* stack: obj key mt table */\n                        return 1;\n                    }\n                }\n            }\n            lua_settop(L,3);\n        }\n        lua_pushnil(L);\n        return 1;\n    }\n    else if (t== LUA_TTABLE)\n    {\n        module_index_event(L);\n        return 1;\n    }\n    lua_pushnil(L);\n    return 1;\n}\n\n/* Newindex function\n    * It first searches for a C/C++ varaible to be set.\n    * Then, it either stores it in the alternative ubox table (in the case it is\n    * an object) or in the own table (that represents the class or module).\n*/\nstatic int class_newindex_event (lua_State* L)\n{\n    int t = lua_type(L,1);\n    if (t == LUA_TUSERDATA)\n    {\n        /* Try accessing a C/C++ variable to be set */\n        lua_getmetatable(L,1);\n        while (lua_istable(L,-1))                /* stack: t k v mt */\n        {\n            if (lua_isnumber(L,2))                 /* check if key is a numeric value */\n            {\n                /* try operator[] */\n                lua_pushstring(L,\".seti\");\n                lua_rawget(L,-2);                      /* stack: obj key mt func */\n                if (lua_isfunction(L,-1))\n                {\n                    lua_pushvalue(L,1);\n                    lua_pushvalue(L,2);\n                    lua_pushvalue(L,3);\n                    lua_call(L,3,0);\n                    return 0;\n                }\n            }\n            else\n            {\n                lua_pushstring(L,\".set\");\n                lua_rawget(L,-2);                      /* stack: t k v mt tset */\n                if (lua_istable(L,-1))\n                {\n                    lua_pushvalue(L,2);\n                    lua_rawget(L,-2);                     /* stack: t k v mt tset func */\n                    if (lua_iscfunction(L,-1))\n                    {\n                        lua_pushvalue(L,1);\n                        lua_pushvalue(L,3);\n                        lua_call(L,2,0);\n                        return 0;\n                    }\n                    lua_pop(L,1);                          /* stack: t k v mt tset */\n                }\n                lua_pop(L,1);                           /* stack: t k v mt */\n                if (!lua_getmetatable(L,-1))            /* stack: t k v mt mt */\n                    lua_pushnil(L);\n                lua_remove(L,-2);                       /* stack: t k v mt */\n            }\n        }\n        lua_settop(L,3);                          /* stack: t k v */\n\n        /* then, store as a new field */\n        storeatubox(L,1);\n    }\n    else if (t== LUA_TTABLE)\n    {\n        module_newindex_event(L);\n    }\n    return 0;\n}\n\nstatic int class_call_event(lua_State* L) {\n\n    if (lua_istable(L, 1)) {\n        lua_pushstring(L, \".call\");\n        lua_rawget(L, 1);\n        if (lua_isfunction(L, -1)) {\n\n            lua_insert(L, 1);\n            lua_call(L, lua_gettop(L)-1, 1);\n\n            return 1;\n        };\n    };\n    tolua_error(L,\"Attempt to call a non-callable object.\",NULL);\n    return 0;\n};\n\nstatic int do_operator (lua_State* L, const char* op)\n{\n    if (lua_isuserdata(L,1))\n    {\n        /* Try metatables */\n        lua_pushvalue(L,1);                     /* stack: op1 op2 */\n        while (lua_getmetatable(L,-1))\n        {   /* stack: op1 op2 op1 mt */\n            lua_remove(L,-2);                      /* stack: op1 op2 mt */\n            lua_pushstring(L,op);                  /* stack: op1 op2 mt key */\n            lua_rawget(L,-2);                      /* stack: obj key mt func */\n            if (lua_isfunction(L,-1))\n            {\n                lua_pushvalue(L,1);\n                lua_pushvalue(L,2);\n                lua_call(L,2,1);\n                return 1;\n            }\n            lua_settop(L,3);\n        }\n    }\n    tolua_error(L,\"Attempt to perform operation on an invalid operand\",NULL);\n    return 0;\n}\n\nstatic int class_add_event (lua_State* L)\n{\n    return do_operator(L,\".add\");\n}\n\nint class_sub_event (lua_State* L)\n{\n    return do_operator(L,\".sub\");\n}\n\nstatic int class_mul_event (lua_State* L)\n{\n    return do_operator(L,\".mul\");\n}\n\nstatic int class_div_event (lua_State* L)\n{\n    return do_operator(L,\".div\");\n}\n\nstatic int class_lt_event (lua_State* L)\n{\n    return do_operator(L,\".lt\");\n}\n\nstatic int class_le_event (lua_State* L)\n{\n    return do_operator(L,\".le\");\n}\n\nstatic int class_eq_event (lua_State* L)\n{\n    /* copying code from do_operator here to return false when no operator is found */\n    if (lua_isuserdata(L,1))\n    {\n        /* Try metatables */\n        lua_pushvalue(L,1);                     /* stack: op1 op2 */\n        while (lua_getmetatable(L,-1))\n        {   /* stack: op1 op2 op1 mt */\n            lua_remove(L,-2);                      /* stack: op1 op2 mt */\n            lua_pushstring(L,\".eq\");                  /* stack: op1 op2 mt key */\n            lua_rawget(L,-2);                      /* stack: obj key mt func */\n            if (lua_isfunction(L,-1))\n            {\n                lua_pushvalue(L,1);\n                lua_pushvalue(L,2);\n                lua_call(L,2,1);\n                return 1;\n            }\n            lua_settop(L,3);\n        }\n    }\n\n    lua_settop(L, 3);\n    lua_pushboolean(L, 0);\n    return 1;\n}\n\n/*\nstatic int class_gc_event (lua_State* L)\n{\n    void* u = *((void**)lua_touserdata(L,1));\n    fprintf(stderr, \"collecting: looking at %p\\n\", u);\n    lua_pushstring(L,\"tolua_gc\");\n    lua_rawget(L,LUA_REGISTRYINDEX);\n    lua_pushlightuserdata(L,u);\n    lua_rawget(L,-2);\n    if (lua_isfunction(L,-1))\n    {\n        lua_pushvalue(L,1);\n        lua_call(L,1,0);\n         lua_pushlightuserdata(L,u);\n        lua_pushnil(L);\n        lua_rawset(L,-3);\n    }\n    lua_pop(L,2);\n    return 0;\n}\n*/\nTOLUA_API int class_gc_event (lua_State* L)\n{\n    void* u = *((void**)lua_touserdata(L,1));\n    int top;\n    /*fprintf(stderr, \"collecting: looking at %p\\n\", u);*/\n    /*\n    lua_pushstring(L,\"tolua_gc\");\n    lua_rawget(L,LUA_REGISTRYINDEX);\n    */\n    lua_pushvalue(L, lua_upvalueindex(1));\n    lua_pushlightuserdata(L,u);\n    lua_rawget(L,-2);            /* stack: gc umt    */\n    lua_getmetatable(L,1);       /* stack: gc umt mt */\n    /*fprintf(stderr, \"checking type\\n\");*/\n    top = lua_gettop(L);\n    if (tolua_fast_isa(L,top,top-1, lua_upvalueindex(2))) /* make sure we collect correct type */\n    {\n        /*fprintf(stderr, \"Found type!\\n\");*/\n        /* get gc function */\n        lua_pushliteral(L,\".collector\");\n        lua_rawget(L,-2);           /* stack: gc umt mt collector */\n        if (lua_isfunction(L,-1)) {\n            /*fprintf(stderr, \"Found .collector!\\n\");*/\n        }\n        else {\n            lua_pop(L,1);\n            /*fprintf(stderr, \"Using default cleanup\\n\");*/\n            lua_pushcfunction(L,tolua_default_collect);\n        }\n\n        lua_pushvalue(L,1);         /* stack: gc umt mt collector u */\n        lua_call(L,1,0);\n\n        lua_pushlightuserdata(L,u); /* stack: gc umt mt u */\n        lua_pushnil(L);             /* stack: gc umt mt u nil */\n        lua_rawset(L,-5);           /* stack: gc umt mt */\n    }\n    lua_pop(L,3);\n    return 0;\n}\n\n\n/* Register module events\n    * It expects the metatable on the top of the stack\n*/\nTOLUA_API void tolua_moduleevents (lua_State* L)\n{\n    lua_pushstring(L,\"__index\");\n    lua_pushcfunction(L,module_index_event);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__newindex\");\n    lua_pushcfunction(L,module_newindex_event);\n    lua_rawset(L,-3);\n}\n\n/* Check if the object on the top has a module metatable\n*/\nTOLUA_API int tolua_ismodulemetatable (lua_State* L)\n{\n    int r = 0;\n    if (lua_getmetatable(L,-1))\n    {\n        lua_pushstring(L,\"__index\");\n        lua_rawget(L,-2);\n        r = (lua_tocfunction(L,-1) == module_index_event);\n        lua_pop(L,2);\n    }\n    return r;\n}\n\n/* Register class events\n    * It expects the metatable on the top of the stack\n*/\nTOLUA_API void tolua_classevents (lua_State* L)\n{\n    lua_pushstring(L,\"__index\");\n    lua_pushcfunction(L,class_index_event);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__newindex\");\n    lua_pushcfunction(L,class_newindex_event);\n    lua_rawset(L,-3);\n\n    lua_pushstring(L,\"__add\");\n    lua_pushcfunction(L,class_add_event);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__sub\");\n    lua_pushcfunction(L,class_sub_event);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__mul\");\n    lua_pushcfunction(L,class_mul_event);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__div\");\n    lua_pushcfunction(L,class_div_event);\n    lua_rawset(L,-3);\n\n    lua_pushstring(L,\"__lt\");\n    lua_pushcfunction(L,class_lt_event);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__le\");\n    lua_pushcfunction(L,class_le_event);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__eq\");\n    lua_pushcfunction(L,class_eq_event);\n    lua_rawset(L,-3);\n\n    lua_pushstring(L,\"__call\");\n    lua_pushcfunction(L,class_call_event);\n    lua_rawset(L,-3);\n\n    lua_pushstring(L,\"__gc\");\n    lua_pushstring(L, \"tolua_gc_event\");\n    lua_rawget(L, LUA_REGISTRYINDEX);\n    /*lua_pushcfunction(L,class_gc_event);*/\n    lua_rawset(L,-3);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/tolua_event.h",
    "content": "/* tolua: event functions\n** Support code for Lua bindings.\n** Written by Waldemar Celes\n** TeCGraf/PUC-Rio\n** Apr 2003\n** $Id: $\n*/\n\n/* This code is free software; you can redistribute it and/or modify it.\n** The software provided hereunder is on an \"as is\" basis, and\n** the author has no obligation to provide maintenance, support, updates,\n** enhancements, or modifications.\n*/\n\n#ifndef TOLUA_EVENT_H\n#define TOLUA_EVENT_H\n\n#include \"tolua++.h\"\n\nTOLUA_API void tolua_moduleevents (lua_State* L);\nTOLUA_API int tolua_ismodulemetatable (lua_State* L);\nTOLUA_API void tolua_classevents (lua_State* L);\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/tolua_is.c",
    "content": "/* tolua: functions to check types.\n** Support code for Lua bindings.\n** Written by Waldemar Celes\n** TeCGraf/PUC-Rio\n** Apr 2003\n** $Id: $\n*/\n\n/* This code is free software; you can redistribute it and/or modify it.\n** The software provided hereunder is on an \"as is\" basis, and\n** the author has no obligation to provide maintenance, support, updates,\n** enhancements, or modifications.\n*/\n\n#include \"tolua++.h\"\n#include \"lauxlib.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n/* a fast check if a is b, without parameter validation\n i.e. if b is equal to a or a superclass of a. */\nTOLUA_API int tolua_fast_isa(lua_State *L, int mt_indexa, int mt_indexb, int super_index)\n{\n    int result;\n    if (lua_rawequal(L,mt_indexa,mt_indexb))\n        result = 1;\n    else\n    {\n        if (super_index) {\n            lua_pushvalue(L, super_index);\n        } else {\n            lua_pushliteral(L,\"tolua_super\");\n            lua_rawget(L,LUA_REGISTRYINDEX);  /* stack: super */\n        };\n        lua_pushvalue(L,mt_indexa);       /* stack: super mta */\n        lua_rawget(L,-2);                 /* stack: super super[mta] */\n        lua_pushvalue(L,mt_indexb);       /* stack: super super[mta] mtb */\n        lua_rawget(L,LUA_REGISTRYINDEX);  /* stack: super super[mta] typenameB */\n        lua_rawget(L,-2);                 /* stack: super super[mta] bool */\n        result = lua_toboolean(L,-1);\n        lua_pop(L,3);\n    }\n    return result;\n}\n\n/* Push and returns the corresponding object typename */\nTOLUA_API const char* tolua_typename (lua_State* L, int lo)\n{\n    int tag = lua_type(L,lo);\n    if (tag == LUA_TNONE)\n        lua_pushstring(L,\"[no object]\");\n    else if (tag != LUA_TUSERDATA && tag != LUA_TTABLE)\n        lua_pushstring(L,lua_typename(L,tag));\n    else if (tag == LUA_TUSERDATA)\n    {\n        if (!lua_getmetatable(L,lo))\n            lua_pushstring(L,lua_typename(L,tag));\n        else\n        {\n            lua_rawget(L,LUA_REGISTRYINDEX);\n            if (!lua_isstring(L,-1))\n            {\n                lua_pop(L,1);\n                lua_pushstring(L,\"[undefined]\");\n            }\n        }\n    }\n    else  /* is table */\n    {\n        lua_pushvalue(L,lo);\n        lua_rawget(L,LUA_REGISTRYINDEX);\n        if (!lua_isstring(L,-1))\n        {\n            lua_pop(L,1);\n            lua_pushstring(L,\"table\");\n        }\n        else\n        {\n            lua_pushstring(L,\"class \");\n            lua_insert(L,-2);\n            lua_concat(L,2);\n        }\n    }\n    return lua_tostring(L,-1);\n}\n\nTOLUA_API void tolua_error (lua_State* L, const char* msg, tolua_Error* err)\n{\n    if (msg[0] == '#')\n    {\n        const char* expected = err->type;\n        const char* provided = tolua_typename(L,err->index);\n        if (msg[1]=='f')\n        {\n            int narg = err->index;\n            if (err->array)\n                luaL_error(L,\"%s\\n     argument #%d is array of '%s'; array of '%s' expected.\\n\",\n                           msg+2,narg,provided,expected);\n            else\n                luaL_error(L,\"%s\\n     argument #%d is '%s'; '%s' expected.\\n\",\n                           msg+2,narg,provided,expected);\n        }\n        else if (msg[1]=='v')\n        {\n            if (err->array)\n                luaL_error(L,\"%s\\n     value is array of '%s'; array of '%s' expected.\\n\",\n                           msg+2,provided,expected);\n            else\n                luaL_error(L,\"%s\\n     value is '%s'; '%s' expected.\\n\",\n                           msg+2,provided,expected);\n        }\n    }\n    else\n        luaL_error(L,msg);\n}\n\n/* the equivalent of lua_is* for usertable */\nstatic  int lua_isusertable (lua_State* L, int lo, const char* type)\n{\n    int r = 0;\n    if (lo < 0) lo = lua_gettop(L)+lo+1;\n    lua_pushvalue(L,lo);\n    lua_rawget(L,LUA_REGISTRYINDEX);  /* get registry[t] */\n    if (lua_isstring(L,-1))\n    {\n        r = strcmp(lua_tostring(L,-1),type)==0;\n        if (!r)\n        {\n            /* try const */\n            lua_pushstring(L,\"const \");\n            lua_insert(L,-2);\n            lua_concat(L,2);\n            r = lua_isstring(L,-1) && strcmp(lua_tostring(L,-1),type)==0;\n        }\n    }\n    lua_pop(L, 1);\n    return r;\n}\n\nint push_table_instance(lua_State* L, int lo) {\n\n    if (lua_istable(L, lo)) {\n\n        lua_pushstring(L, \".c_instance\");\n        lua_gettable(L, lo);\n        if (lua_isuserdata(L, -1)) {\n\n            lua_replace(L, lo);\n            return 1;\n        } else {\n\n            lua_pop(L, 1);\n            return 0;\n        };\n    } else {\n        return 0;\n    };\n\n    return 0;\n};\n\n/* the equivalent of lua_is* for usertype */\nint lua_isusertype (lua_State* L, int lo, const char* type)\n{\n    if (!lua_isuserdata(L,lo)) {\n        if (!push_table_instance(L, lo)) {\n            return 0;\n        };\n    };\n    {\n        /* check if it is of the same type */\n        int r;\n        const char *tn;\n        if (lua_getmetatable(L,lo))        /* if metatable? */\n        {\n            lua_rawget(L,LUA_REGISTRYINDEX);  /* get registry[mt] */\n            tn = lua_tostring(L,-1);\n            r = tn && (strcmp(tn,type) == 0);\n            lua_pop(L, 1);\n            if (r)\n                return 1;\n            else\n            {\n                /* check if it is a specialized class */\n                lua_pushstring(L,\"tolua_super\");\n                lua_rawget(L,LUA_REGISTRYINDEX); /* get super */\n                lua_getmetatable(L,lo);\n                lua_rawget(L,-2);                /* get super[mt] */\n                if (lua_istable(L,-1))\n                {\n                    int b;\n                    lua_pushstring(L,type);\n                    lua_rawget(L,-2);                /* get super[mt][type] */\n                    b = lua_toboolean(L,-1);\n                    lua_pop(L,3);\n                    if (b)\n                        return 1;\n                }\n            }\n        }\n    }\n    return 0;\n}\n\nTOLUA_API int tolua_isnoobj (lua_State* L, int lo, tolua_Error* err)\n{\n    if (lua_gettop(L)<abs(lo))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = \"[no object]\";\n    return 0;\n}\n\nTOLUA_API int tolua_isboolean (lua_State* L, int lo, int def, tolua_Error* err)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return 1;\n    if (lua_isnil(L,lo) || lua_isboolean(L,lo))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = \"boolean\";\n    return 0;\n}\n\nTOLUA_API int tolua_isnumber (lua_State* L, int lo, int def, tolua_Error* err)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return 1;\n    if (lua_isnumber(L,lo))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = \"number\";\n    return 0;\n}\n\nTOLUA_API int tolua_isstring (lua_State* L, int lo, int def, tolua_Error* err)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return 1;\n    if (lua_isnil(L,lo) || lua_isstring(L,lo))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = \"string\";\n    return 0;\n}\n\nTOLUA_API int tolua_istable (lua_State* L, int lo, int def, tolua_Error* err)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return 1;\n    if (lua_istable(L,lo))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = \"table\";\n    return 0;\n}\n\nTOLUA_API int tolua_isusertable (lua_State* L, int lo, const char* type, int def, tolua_Error* err)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return 1;\n    if (lua_isusertable(L,lo,type))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = type;\n    return 0;\n}\n\n\nTOLUA_API int tolua_isuserdata (lua_State* L, int lo, int def, tolua_Error* err)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return 1;\n    if (lua_isnil(L,lo) || lua_isuserdata(L,lo))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = \"userdata\";\n    return 0;\n}\n\nTOLUA_API int tolua_isvaluenil (lua_State* L, int lo, tolua_Error* err) {\n\n    if (lua_gettop(L)<abs(lo))\n        return 0; /* somebody else should chack this */\n    if (!lua_isnil(L, lo))\n        return 0;\n\n    err->index = lo;\n    err->array = 0;\n    err->type = \"value\";\n    return 1;\n};\n\nTOLUA_API int tolua_isvalue (lua_State* L, int lo, int def, tolua_Error* err)\n{\n    if (def || abs(lo)<=lua_gettop(L))  /* any valid index */\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = \"value\";\n    return 0;\n}\n\nTOLUA_API int tolua_isusertype (lua_State* L, int lo, const char* type, int def, tolua_Error* err)\n{\n    if (def && lua_gettop(L)<abs(lo))\n        return 1;\n    if (lua_isnil(L,lo) || lua_isusertype(L,lo,type))\n        return 1;\n    err->index = lo;\n    err->array = 0;\n    err->type = type;\n    return 0;\n}\n\nTOLUA_API int tolua_isvaluearray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err)\n{\n    if (!tolua_istable(L,lo,def,err))\n        return 0;\n    else\n        return 1;\n}\n\nTOLUA_API int tolua_isbooleanarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err)\n{\n    if (!tolua_istable(L,lo,def,err))\n        return 0;\n    else\n    {\n        int i;\n        for (i=1; i<=dim; ++i)\n        {\n            lua_pushnumber(L,i);\n            lua_gettable(L,lo);\n            if (!(lua_isnil(L,-1) || lua_isboolean(L,-1)) &&\n                    !(def && lua_isnil(L,-1))\n               )\n            {\n                err->index = lo;\n                err->array = 1;\n                err->type = \"boolean\";\n                return 0;\n            }\n            lua_pop(L,1);\n        }\n    }\n    return 1;\n}\n\nTOLUA_API int tolua_isnumberarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err)\n{\n    if (!tolua_istable(L,lo,def,err))\n        return 0;\n    else\n    {\n        int i;\n        for (i=1; i<=dim; ++i)\n        {\n            lua_pushnumber(L,i);\n            lua_gettable(L,lo);\n            if (!lua_isnumber(L,-1) &&\n                    !(def && lua_isnil(L,-1))\n               )\n            {\n                err->index = lo;\n                err->array = 1;\n                err->type = \"number\";\n                return 0;\n            }\n            lua_pop(L,1);\n        }\n    }\n    return 1;\n}\n\nTOLUA_API int tolua_isstringarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err)\n{\n    if (!tolua_istable(L,lo,def,err))\n        return 0;\n    else\n    {\n        int i;\n        for (i=1; i<=dim; ++i)\n        {\n            lua_pushnumber(L,i);\n            lua_gettable(L,lo);\n            if (!(lua_isnil(L,-1) || lua_isstring(L,-1)) &&\n                    !(def && lua_isnil(L,-1))\n               )\n            {\n                err->index = lo;\n                err->array = 1;\n                err->type = \"string\";\n                return 0;\n            }\n            lua_pop(L,1);\n        }\n    }\n    return 1;\n}\n\nTOLUA_API int tolua_istablearray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err)\n{\n    if (!tolua_istable(L,lo,def,err))\n        return 0;\n    else\n    {\n        int i;\n        for (i=1; i<=dim; ++i)\n        {\n            lua_pushnumber(L,i);\n            lua_gettable(L,lo);\n            if (! lua_istable(L,-1) &&\n                    !(def && lua_isnil(L,-1))\n               )\n            {\n                err->index = lo;\n                err->array = 1;\n                err->type = \"table\";\n                return 0;\n            }\n            lua_pop(L,1);\n        }\n    }\n    return 1;\n}\n\nTOLUA_API int tolua_isuserdataarray\n(lua_State* L, int lo, int dim, int def, tolua_Error* err)\n{\n    if (!tolua_istable(L,lo,def,err))\n        return 0;\n    else\n    {\n        int i;\n        for (i=1; i<=dim; ++i)\n        {\n            lua_pushnumber(L,i);\n            lua_gettable(L,lo);\n            if (!(lua_isnil(L,-1) || lua_isuserdata(L,-1)) &&\n                    !(def && lua_isnil(L,-1))\n               )\n            {\n                err->index = lo;\n                err->array = 1;\n                err->type = \"userdata\";\n                return 0;\n            }\n            lua_pop(L,1);\n        }\n    }\n    return 1;\n}\n\nTOLUA_API int tolua_isusertypearray\n(lua_State* L, int lo, const char* type, int dim, int def, tolua_Error* err)\n{\n    if (!tolua_istable(L,lo,def,err))\n        return 0;\n    else\n    {\n        int i;\n        for (i=1; i<=dim; ++i)\n        {\n            lua_pushnumber(L,i);\n            lua_gettable(L,lo);\n            if (!(lua_isnil(L,-1) || lua_isuserdata(L,-1)) &&\n                    !(def && lua_isnil(L,-1))\n               )\n            {\n                err->index = lo;\n                err->type = type;\n                err->array = 1;\n                return 0;\n            }\n            lua_pop(L,1);\n        }\n    }\n    return 1;\n}\n\n#if 0\nint tolua_isbooleanfield\n(lua_State* L, int lo, int i, int def, tolua_Error* err)\n{\n    lua_pushnumber(L,i);\n    lua_gettable(L,lo);\n    if (!(lua_isnil(L,-1) || lua_isboolean(L,-1)) &&\n            !(def && lua_isnil(L,-1))\n       )\n    {\n        err->index = lo;\n        err->array = 1;\n        err->type = \"boolean\";\n        return 0;\n    }\n    lua_pop(L,1);\n    return 1;\n}\n\nint tolua_isnumberfield\n(lua_State* L, int lo, int i, int def, tolua_Error* err)\n{\n    lua_pushnumber(L,i);\n    lua_gettable(L,lo);\n    if (!lua_isnumber(L,-1) &&\n            !(def && lua_isnil(L,-1))\n       )\n    {\n        err->index = lo;\n        err->array = 1;\n        err->type = \"number\";\n        return 0;\n    }\n    lua_pop(L,1);\n    return 1;\n}\n\nint tolua_isstringfield\n(lua_State* L, int lo, int i, int def, tolua_Error* err)\n{\n    lua_pushnumber(L,i);\n    lua_gettable(L,lo);\n    if (!(lua_isnil(L,-1) || lua_isstring(L,-1)) &&\n            !(def && lua_isnil(L,-1))\n       )\n    {\n        err->index = lo;\n        err->array = 1;\n        err->type = \"string\";\n        return 0;\n    }\n    lua_pop(L,1);\n    return 1;\n}\n\nint tolua_istablefield\n(lua_State* L, int lo, int i, int def, tolua_Error* err)\n{\n    lua_pushnumber(L,i+1);\n    lua_gettable(L,lo);\n    if (! lua_istable(L,-1) &&\n            !(def && lua_isnil(L,-1))\n       )\n    {\n        err->index = lo;\n        err->array = 1;\n        err->type = \"table\";\n        return 0;\n    }\n    lua_pop(L,1);\n}\n\nint tolua_isusertablefield\n(lua_State* L, int lo, const char* type, int i, int def, tolua_Error* err)\n{\n    lua_pushnumber(L,i);\n    lua_gettable(L,lo);\n    if (! lua_isusertable(L,-1,type) &&\n            !(def && lua_isnil(L,-1))\n       )\n    {\n        err->index = lo;\n        err->array = 1;\n        err->type = type;\n        return 0;\n    }\n    lua_pop(L,1);\n    return 1;\n}\n\nint tolua_isuserdatafield\n(lua_State* L, int lo, int i, int def, tolua_Error* err)\n{\n    lua_pushnumber(L,i);\n    lua_gettable(L,lo);\n    if (!(lua_isnil(L,-1) || lua_isuserdata(L,-1)) &&\n            !(def && lua_isnil(L,-1))\n       )\n    {\n        err->index = lo;\n        err->array = 1;\n        err->type = \"userdata\";\n        return 0;\n    }\n    lua_pop(L,1);\n    return 1;\n}\n\nint tolua_isusertypefield\n(lua_State* L, int lo, const char* type, int i, int def, tolua_Error* err)\n{\n    lua_pushnumber(L,i);\n    lua_gettable(L,lo);\n    if (!(lua_isnil(L,-1) || lua_isusertype(L,-1,type)) &&\n            !(def && lua_isnil(L,-1))\n       )\n    {\n        err->index = lo;\n        err->type = type;\n        err->array = 1;\n        return 0;\n    }\n    lua_pop(L,1);\n    return 1;\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/tolua_map.c",
    "content": "/* tolua: functions to map features\n** Support code for Lua bindings.\n** Written by Waldemar Celes\n** TeCGraf/PUC-Rio\n** Apr 2003\n** $Id: $\n*/\n\n/* This code is free software; you can redistribute it and/or modify it.\n** The software provided hereunder is on an \"as is\" basis, and\n** the author has no obligation to provide maintenance, support, updates,\n** enhancements, or modifications.\n*/\n\n#include \"tolua++.h\"\n#include \"tolua_event.h\"\n#include \"lauxlib.h\"\n\n#include <string.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <math.h>\n\n\n/* Create metatable\n    * Create and register new metatable\n*/\nstatic int tolua_newmetatable (lua_State* L, const char* name)\n{\n    int r = luaL_newmetatable(L,name);\n\n#ifdef LUA_VERSION_NUM /* only lua 5.1 */\n    if (r) {\n        lua_pushvalue(L, -1);\n        lua_pushstring(L, name);\n        lua_settable(L, LUA_REGISTRYINDEX); /* reg[mt] = type_name */\n    };\n#endif\n\n    if (r)\n        tolua_classevents(L); /* set meta events */\n    lua_pop(L,1);\n    return r;\n}\n\n/* Map super classes\n    * It sets 'name' as being also a 'base', mapping all super classes of 'base' in 'name'\n*/\nstatic void mapsuper (lua_State* L, const char* name, const char* base)\n{\n    /* push registry.super */\n    lua_pushstring(L,\"tolua_super\");\n    lua_rawget(L,LUA_REGISTRYINDEX);    /* stack: super */\n    luaL_getmetatable(L,name);          /* stack: super mt */\n    lua_rawget(L,-2);                   /* stack: super table */\n    if (lua_isnil(L,-1))\n    {\n        /* create table */\n        lua_pop(L,1);\n        lua_newtable(L);                    /* stack: super table */\n        luaL_getmetatable(L,name);          /* stack: super table mt */\n        lua_pushvalue(L,-2);                /* stack: super table mt table */\n        lua_rawset(L,-4);                   /* stack: super table */\n    }\n\n    /* set base as super class */\n    lua_pushstring(L,base);\n    lua_pushboolean(L,1);\n    lua_rawset(L,-3);                    /* stack: super table */\n\n    /* set all super class of base as super class of name */\n    luaL_getmetatable(L,base);          /* stack: super table base_mt */\n    lua_rawget(L,-3);                   /* stack: super table base_table */\n    if (lua_istable(L,-1))\n    {\n        /* traverse base table */\n        lua_pushnil(L);  /* first key */\n        while (lua_next(L,-2) != 0)\n        {\n            /* stack: ... base_table key value */\n            lua_pushvalue(L,-2);    /* stack: ... base_table key value key */\n            lua_insert(L,-2);       /* stack: ... base_table key key value */\n            lua_rawset(L,-5);       /* stack: ... base_table key */\n        }\n    }\n    lua_pop(L,3);                       /* stack: <empty> */\n}\n\n/* creates a 'tolua_ubox' table for base clases, and\n// expects the metatable and base metatable on the stack */\nstatic void set_ubox(lua_State* L) {\n\n    /* mt basemt */\n    if (!lua_isnil(L, -1)) {\n        lua_pushstring(L, \"tolua_ubox\");\n        lua_rawget(L,-2);\n    } else {\n        lua_pushnil(L);\n    };\n    /* mt basemt base_ubox */\n    if (!lua_isnil(L,-1)) {\n        lua_pushstring(L, \"tolua_ubox\");\n        lua_insert(L, -2);\n        /* mt basemt key ubox */\n        lua_rawset(L,-4);\n        /* (mt with ubox) basemt */\n    } else {\n        /* mt basemt nil */\n        lua_pop(L, 1);\n        lua_pushstring(L,\"tolua_ubox\");\n        lua_newtable(L);\n        /* make weak value metatable for ubox table to allow userdata to be\n        garbage-collected */\n        lua_newtable(L);\n        lua_pushliteral(L, \"__mode\");\n        lua_pushliteral(L, \"v\");\n        lua_rawset(L, -3);               /* stack: string ubox mt */\n        lua_setmetatable(L, -2);  /* stack:mt basemt string ubox */\n        lua_rawset(L,-4);\n    };\n\n};\n\n/* Map inheritance\n    * It sets 'name' as derived from 'base' by setting 'base' as metatable of 'name'\n*/\nstatic void mapinheritance (lua_State* L, const char* name, const char* base)\n{\n    /* set metatable inheritance */\n    luaL_getmetatable(L,name);\n\n    if (base && *base)\n        luaL_getmetatable(L,base);\n    else {\n\n        if (lua_getmetatable(L, -1)) { /* already has a mt, we don't overwrite it */\n            lua_pop(L, 2);\n            return;\n        };\n        luaL_getmetatable(L,\"tolua_commonclass\");\n    };\n\n    set_ubox(L);\n\n    lua_setmetatable(L,-2);\n    lua_pop(L,1);\n}\n\n/* Object type\n*/\nstatic int tolua_bnd_type (lua_State* L)\n{\n    tolua_typename(L,lua_gettop(L));\n    return 1;\n}\n\n/* Take ownership\n*/\nstatic int tolua_bnd_takeownership (lua_State* L)\n{\n    int success = 0;\n    if (lua_isuserdata(L,1))\n    {\n        if (lua_getmetatable(L,1))        /* if metatable? */\n        {\n            lua_pop(L,1);             /* clear metatable off stack */\n            /* force garbage collection to avoid C to reuse a to-be-collected address */\n#ifdef LUA_VERSION_NUM\n            lua_gc(L, LUA_GCCOLLECT, 0);\n#else\n            lua_setgcthreshold(L,0);\n#endif\n\n            success = tolua_register_gc(L,1);\n        }\n    }\n    lua_pushboolean(L,success!=0);\n    return 1;\n}\n\n/* Release ownership\n*/\nstatic int tolua_bnd_releaseownership (lua_State* L)\n{\n    int done = 0;\n    if (lua_isuserdata(L,1))\n    {\n        void* u = *((void**)lua_touserdata(L,1));\n        /* force garbage collection to avoid releasing a to-be-collected address */\n#ifdef LUA_VERSION_NUM\n        lua_gc(L, LUA_GCCOLLECT, 0);\n#else\n        lua_setgcthreshold(L,0);\n#endif\n        lua_pushstring(L,\"tolua_gc\");\n        lua_rawget(L,LUA_REGISTRYINDEX);\n        lua_pushlightuserdata(L,u);\n        lua_rawget(L,-2);\n        lua_getmetatable(L,1);\n        if (lua_rawequal(L,-1,-2))  /* check that we are releasing the correct type */\n        {\n            lua_pushlightuserdata(L,u);\n            lua_pushnil(L);\n            lua_rawset(L,-5);\n            done = 1;\n        }\n    }\n    lua_pushboolean(L,done!=0);\n    return 1;\n}\n\n/* Type casting\n*/\nint tolua_bnd_cast (lua_State* L)\n{\n\n    /* // old code\n            void* v = tolua_tousertype(L,1,NULL);\n            const char* s = tolua_tostring(L,2,NULL);\n            if (v && s)\n             tolua_pushusertype(L,v,s);\n            else\n             lua_pushnil(L);\n            return 1;\n    */\n\n    void* v;\n    const char* s;\n    if (lua_islightuserdata(L, 1)) {\n        v = tolua_touserdata(L, 1, NULL);\n    } else {\n        v = tolua_tousertype(L, 1, 0);\n    };\n\n    s = tolua_tostring(L,2,NULL);\n    if (v && s)\n        tolua_pushusertype(L,v,s);\n    else\n        lua_pushnil(L);\n    return 1;\n}\n\n/* Test userdata is null\n*/\nstatic int tolua_bnd_isnulluserdata (lua_State* L) {\n    void **ud = (void**)lua_touserdata(L, -1);\n    tolua_pushboolean(L, ud == NULL || *ud == NULL);\n    return 1;\n}\n\n/* Inheritance\n*/\nstatic int tolua_bnd_inherit (lua_State* L) {\n\n    /* stack: lua object, c object */\n    lua_pushstring(L, \".c_instance\");\n    lua_pushvalue(L, -2);\n    lua_rawset(L, -4);\n    /* l_obj[\".c_instance\"] = c_obj */\n\n    return 0;\n};\n\n#ifdef LUA_VERSION_NUM /* lua 5.1 */\nstatic int tolua_bnd_setpeer(lua_State* L) {\n\n    /* stack: userdata, table */\n    if (!lua_isuserdata(L, -2)) {\n        lua_pushstring(L, \"Invalid argument #1 to setpeer: userdata expected.\");\n        lua_error(L);\n    };\n\n    if (lua_isnil(L, -1)) {\n\n        lua_pop(L, 1);\n        lua_pushvalue(L, TOLUA_NOPEER);\n    };\n    lua_setfenv(L, -2);\n\n    return 0;\n};\n\nstatic int tolua_bnd_getpeer(lua_State* L) {\n\n    /* stack: userdata */\n    lua_getfenv(L, -1);\n    if (lua_rawequal(L, -1, TOLUA_NOPEER)) {\n        lua_pop(L, 1);\n        lua_pushnil(L);\n    };\n    return 1;\n};\n#endif\n\n/* static int class_gc_event (lua_State* L); */\n\nTOLUA_API void tolua_open (lua_State* L)\n{\n    int top = lua_gettop(L);\n    lua_pushstring(L,\"tolua_opened\");\n    lua_rawget(L,LUA_REGISTRYINDEX);\n    if (!lua_isboolean(L,-1))\n    {\n        lua_pushstring(L,\"tolua_opened\");\n        lua_pushboolean(L,1);\n        lua_rawset(L,LUA_REGISTRYINDEX);\n        \n        // create value root table\n        lua_pushstring(L, TOLUA_VALUE_ROOT);\n        lua_newtable(L);\n        lua_rawset(L, LUA_REGISTRYINDEX);\n\n#ifndef LUA_VERSION_NUM /* only prior to lua 5.1 */\n        /* create peer object table */\n        lua_pushstring(L, \"tolua_peers\");\n        lua_newtable(L);\n        /* make weak key metatable for peers indexed by userdata object */\n        lua_newtable(L);\n        lua_pushliteral(L, \"__mode\");\n        lua_pushliteral(L, \"k\");\n        lua_rawset(L, -3);                /* stack: string peers mt */\n        lua_setmetatable(L, -2);   /* stack: string peers */\n        lua_rawset(L,LUA_REGISTRYINDEX);\n#endif\n\n        /* create object ptr -> udata mapping table */\n        lua_pushstring(L,\"tolua_ubox\");\n        lua_newtable(L);\n        /* make weak value metatable for ubox table to allow userdata to be\n           garbage-collected */\n        lua_newtable(L);\n        lua_pushliteral(L, \"__mode\");\n        lua_pushliteral(L, \"v\");\n        lua_rawset(L, -3);               /* stack: string ubox mt */\n        lua_setmetatable(L, -2);  /* stack: string ubox */\n        lua_rawset(L,LUA_REGISTRYINDEX);\n        \n//        /* create object ptr -> class type mapping table */\n//        lua_pushstring(L, \"tolua_ptr2type\");\n//        lua_newtable(L);\n//        lua_rawset(L, LUA_REGISTRYINDEX);\n\n        lua_pushstring(L,\"tolua_super\");\n        lua_newtable(L);\n        lua_rawset(L,LUA_REGISTRYINDEX);\n        lua_pushstring(L,\"tolua_gc\");\n        lua_newtable(L);\n        lua_rawset(L,LUA_REGISTRYINDEX);\n\n        /* create gc_event closure */\n        lua_pushstring(L, \"tolua_gc_event\");\n        lua_pushstring(L, \"tolua_gc\");\n        lua_rawget(L, LUA_REGISTRYINDEX);\n        lua_pushstring(L, \"tolua_super\");\n        lua_rawget(L, LUA_REGISTRYINDEX);\n        lua_pushcclosure(L, class_gc_event, 2);\n        lua_rawset(L, LUA_REGISTRYINDEX);\n\n        tolua_newmetatable(L,\"tolua_commonclass\");\n\n        tolua_module(L,NULL,0);\n        tolua_beginmodule(L,NULL);\n        tolua_module(L,\"tolua\",0);\n        tolua_beginmodule(L,\"tolua\");\n        tolua_function(L,\"type\",tolua_bnd_type);\n        tolua_function(L,\"takeownership\",tolua_bnd_takeownership);\n        tolua_function(L,\"releaseownership\",tolua_bnd_releaseownership);\n        tolua_function(L,\"cast\",tolua_bnd_cast);\n        tolua_function(L,\"isnull\",tolua_bnd_isnulluserdata);\n        tolua_function(L,\"inherit\", tolua_bnd_inherit);\n#ifdef LUA_VERSION_NUM /* lua 5.1 */\n        tolua_function(L, \"setpeer\", tolua_bnd_setpeer);\n        tolua_function(L, \"getpeer\", tolua_bnd_getpeer);\n#endif\n\n        tolua_endmodule(L);\n        tolua_endmodule(L);\n    }\n    lua_settop(L,top);\n}\n\n/* Copy a C object\n*/\nTOLUA_API void* tolua_copy (lua_State* L, void* value, unsigned int size)\n{\n    void* clone = (void*)malloc(size);\n    if (clone)\n        memcpy(clone,value,size);\n    else\n        tolua_error(L,\"insuficient memory\",NULL);\n    return clone;\n}\n\n/* Default collect function\n*/\nTOLUA_API int tolua_default_collect (lua_State* tolua_S)\n{\n    void* self = tolua_tousertype(tolua_S,1,0);\n    free(self);\n    return 0;\n}\n\n/* Do clone\n*/\nTOLUA_API int tolua_register_gc (lua_State* L, int lo)\n{\n    int success = 1;\n    void *value = *(void **)lua_touserdata(L,lo);\n    lua_pushstring(L,\"tolua_gc\");\n    lua_rawget(L,LUA_REGISTRYINDEX);\n    lua_pushlightuserdata(L,value);\n    lua_rawget(L,-2);\n    if (!lua_isnil(L,-1)) /* make sure that object is not already owned */\n        success = 0;\n    else\n    {\n        lua_pushlightuserdata(L,value);\n        lua_getmetatable(L,lo);\n        lua_rawset(L,-4);\n    }\n    lua_pop(L,2);\n    return success;\n}\n\n/* Register a usertype\n    * It creates the correspoding metatable in the registry, for both 'type' and 'const type'.\n    * It maps 'const type' as being also a 'type'\n*/\nTOLUA_API void tolua_usertype (lua_State* L, const char* type)\n{\n    char ctype[128] = \"const \";\n    strncat(ctype,type,120);\n\n    /* create both metatables */\n    if (tolua_newmetatable(L,ctype) && tolua_newmetatable(L,type))\n        mapsuper(L,type,ctype);             /* 'type' is also a 'const type' */\n}\n\n\n/* Begin module\n    * It pushes the module (or class) table on the stack\n*/\nTOLUA_API void tolua_beginmodule (lua_State* L, const char* name)\n{\n    if (name)\n    {\n        lua_pushstring(L,name);\n        lua_rawget(L,-2);\n    }\n    else\n        lua_pushvalue(L,LUA_GLOBALSINDEX);\n}\n\n/* End module\n    * It pops the module (or class) from the stack\n*/\nTOLUA_API void tolua_endmodule (lua_State* L)\n{\n    lua_pop(L,1);\n}\n\n/* Map module\n    * It creates a new module\n*/\n#if 1\nTOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar)\n{\n    if (name)\n    {\n        /* tolua module */\n        lua_pushstring(L,name);\n        lua_rawget(L,-2);\n        if (!lua_istable(L,-1))  /* check if module already exists */\n        {\n            lua_pop(L,1);\n            lua_newtable(L);\n            lua_pushstring(L,name);\n            lua_pushvalue(L,-2);\n            lua_rawset(L,-4);       /* assing module into module */\n        }\n    }\n    else\n    {\n        /* global table */\n        lua_pushvalue(L,LUA_GLOBALSINDEX);\n    }\n    if (hasvar)\n    {\n        if (!tolua_ismodulemetatable(L))  /* check if it already has a module metatable */\n        {\n            /* create metatable to get/set C/C++ variable */\n            lua_newtable(L);\n            tolua_moduleevents(L);\n            if (lua_getmetatable(L,-2))\n                lua_setmetatable(L,-2);  /* set old metatable as metatable of metatable */\n            lua_setmetatable(L,-2);\n        }\n    }\n    lua_pop(L,1);               /* pop module */\n}\n#else\nTOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar)\n{\n    if (name)\n    {\n        /* tolua module */\n        lua_pushstring(L,name);\n        lua_newtable(L);\n    }\n    else\n    {\n        /* global table */\n        lua_pushvalue(L,LUA_GLOBALSINDEX);\n    }\n    if (hasvar)\n    {\n        /* create metatable to get/set C/C++ variable */\n        lua_newtable(L);\n        tolua_moduleevents(L);\n        if (lua_getmetatable(L,-2))\n            lua_setmetatable(L,-2);  /* set old metatable as metatable of metatable */\n        lua_setmetatable(L,-2);\n    }\n    if (name)\n        lua_rawset(L,-3);       /* assing module into module */\n    else\n        lua_pop(L,1);           /* pop global table */\n}\n#endif\n\nstatic void push_collector(lua_State* L, const char* type, lua_CFunction col) {\n\n    /* push collector function, but only if it's not NULL, or if there's no\n       collector already */\n    if (!col) return;\n    luaL_getmetatable(L,type);\n    lua_pushstring(L,\".collector\");\n    /*\n    if (!col) {\n        lua_pushvalue(L, -1);\n        lua_rawget(L, -3);\n        if (!lua_isnil(L, -1)) {\n            lua_pop(L, 3);\n            return;\n        };\n        lua_pop(L, 1);\n    };\n    //    */\n    lua_pushcfunction(L,col);\n\n    lua_rawset(L,-3);\n    lua_pop(L, 1);\n};\n\n/* Map C class\n    * It maps a C class, setting the appropriate inheritance and super classes.\n*/\nTOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, const char* base, lua_CFunction col)\n{\n    char cname[128] = \"const \";\n    char cbase[128] = \"const \";\n    strncat(cname,name,120);\n    strncat(cbase,base,120);\n\n    mapinheritance(L,name,base);\n    mapinheritance(L,cname,name);\n\n    mapsuper(L,cname,cbase);\n    mapsuper(L,name,base);\n\n    lua_pushstring(L,lname);\n\n    push_collector(L, name, col);\n    /*\n    luaL_getmetatable(L,name);\n    lua_pushstring(L,\".collector\");\n    lua_pushcfunction(L,col);\n\n    lua_rawset(L,-3);\n    */\n\n    luaL_getmetatable(L,name);\n    lua_rawset(L,-3);              /* assign class metatable to module */\n\n    /* now we also need to store the collector table for the const\n       instances of the class */\n    push_collector(L, cname, col);\n    /*\n    luaL_getmetatable(L,cname);\n    lua_pushstring(L,\".collector\");\n    lua_pushcfunction(L,col);\n    lua_rawset(L,-3);\n    lua_pop(L,1);\n    */\n\n\n}\n\n/* Add base\n    * It adds additional base classes to a class (for multiple inheritance)\n    * (not for now)\n    */\nTOLUA_API void tolua_addbase(lua_State* L, char* name, char* base) {\n\n    char cname[128] = \"const \";\n    char cbase[128] = \"const \";\n    strncat(cname,name,120);\n    strncat(cbase,base,120);\n\n    mapsuper(L,cname,cbase);\n    mapsuper(L,name,base);\n};\n\n\n/* Map function\n    * It assigns a function into the current module (or class)\n*/\nTOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func)\n{\n    lua_pushstring(L,name);\n    lua_pushcfunction(L,func);\n    lua_rawset(L,-3);\n}\n\n/* sets the __call event for the class (expects the class' main table on top) */\n/*    never really worked :(\nTOLUA_API void tolua_set_call_event(lua_State* L, lua_CFunction func, char* type) {\n\n    lua_getmetatable(L, -1);\n    //luaL_getmetatable(L, type);\n    lua_pushstring(L,\"__call\");\n    lua_pushcfunction(L,func);\n    lua_rawset(L,-3);\n    lua_pop(L, 1);\n};\n*/\n\n/* Map constant number\n    * It assigns a constant number into the current module (or class)\n*/\nTOLUA_API void tolua_constant (lua_State* L, const char* name, lua_Number value)\n{\n    lua_pushstring(L,name);\n    tolua_pushnumber(L,value);\n    lua_rawset(L,-3);\n}\n\n\n/* Map variable\n    * It assigns a variable into the current module (or class)\n*/\nTOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)\n{\n    /* get func */\n    lua_pushstring(L,\".get\");\n    lua_rawget(L,-2);\n    if (!lua_istable(L,-1))\n    {\n        /* create .get table, leaving it at the top */\n        lua_pop(L,1);\n        lua_newtable(L);\n        lua_pushstring(L,\".get\");\n        lua_pushvalue(L,-2);\n        lua_rawset(L,-4);\n    }\n    lua_pushstring(L,name);\n    lua_pushcfunction(L,get);\n    lua_rawset(L,-3);                  /* store variable */\n    lua_pop(L,1);                      /* pop .get table */\n\n    /* set func */\n    if (set)\n    {\n        lua_pushstring(L,\".set\");\n        lua_rawget(L,-2);\n        if (!lua_istable(L,-1))\n        {\n            /* create .set table, leaving it at the top */\n            lua_pop(L,1);\n            lua_newtable(L);\n            lua_pushstring(L,\".set\");\n            lua_pushvalue(L,-2);\n            lua_rawset(L,-4);\n        }\n        lua_pushstring(L,name);\n        lua_pushcfunction(L,set);\n        lua_rawset(L,-3);                  /* store variable */\n        lua_pop(L,1);                      /* pop .set table */\n    }\n}\n\n/* Access const array\n    * It reports an error when trying to write into a const array\n*/\nstatic int const_array (lua_State* L)\n{\n    luaL_error(L,\"value of const array cannot be changed\");\n    return 0;\n}\n\n/* Map an array\n    * It assigns an array into the current module (or class)\n*/\nTOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)\n{\n    lua_pushstring(L,\".get\");\n    lua_rawget(L,-2);\n    if (!lua_istable(L,-1))\n    {\n        /* create .get table, leaving it at the top */\n        lua_pop(L,1);\n        lua_newtable(L);\n        lua_pushstring(L,\".get\");\n        lua_pushvalue(L,-2);\n        lua_rawset(L,-4);\n    }\n    lua_pushstring(L,name);\n\n    lua_newtable(L);           /* create array metatable */\n    lua_pushvalue(L,-1);\n    lua_setmetatable(L,-2);    /* set the own table as metatable (for modules) */\n    lua_pushstring(L,\"__index\");\n    lua_pushcfunction(L,get);\n    lua_rawset(L,-3);\n    lua_pushstring(L,\"__newindex\");\n    lua_pushcfunction(L,set?set:const_array);\n    lua_rawset(L,-3);\n\n    lua_rawset(L,-3);                  /* store variable */\n    lua_pop(L,1);                      /* pop .get table */\n}\n\n\nTOLUA_API void tolua_dobuffer(lua_State* L, char* B, unsigned int size, const char* name) {\n\n#ifdef LUA_VERSION_NUM /* lua 5.1 */\n    if (!luaL_loadbuffer(L, B, size, name)) lua_pcall(L, 0, 0, 0);\n#else\n    lua_dobuffer(L, B, size, name);\n#endif\n};\n\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/tolua_push.c",
    "content": "/* tolua: functions to push C values.\n** Support code for Lua bindings.\n** Written by Waldemar Celes\n** TeCGraf/PUC-Rio\n** Apr 2003\n** $Id: $\n*/\n\n/* This code is free software; you can redistribute it and/or modify it.\n** The software provided hereunder is on an \"as is\" basis, and\n** the author has no obligation to provide maintenance, support, updates,\n** enhancements, or modifications.\n*/\n\n#include \"tolua++.h\"\n#include \"lauxlib.h\"\n\n#include <stdlib.h>\n\nvoid tolua_pushusertype_internal (lua_State* L, void* value, const char* type, int addToRoot)\n{\n    if (value == NULL)\n        lua_pushnil(L);\n    else\n    {\n        luaL_getmetatable(L, type);                                 /* stack: mt */\n        if (lua_isnil(L, -1)) { /* NOT FOUND metatable */\n            lua_pop(L, 1);\n            return;\n        }\n        lua_pushstring(L,\"tolua_ubox\");\n        lua_rawget(L,-2);                                           /* stack: mt ubox */\n        if (lua_isnil(L, -1)) {\n            lua_pop(L, 1);\n            lua_pushstring(L, \"tolua_ubox\");\n            lua_rawget(L, LUA_REGISTRYINDEX);\n        };\n        \n        lua_pushlightuserdata(L,value);                             /* stack: mt ubox key<value> */\n        lua_rawget(L,-2);                                           /* stack: mt ubox ubox[value] */\n        \n        if (lua_isnil(L,-1))\n        {\n            lua_pop(L,1);                                           /* stack: mt ubox */\n            lua_pushlightuserdata(L,value);\n            *(void**)lua_newuserdata(L,sizeof(void *)) = value;     /* stack: mt ubox value newud */\n            lua_pushvalue(L,-1);                                    /* stack: mt ubox value newud newud */\n            lua_insert(L,-4);                                       /* stack: mt newud ubox value newud */\n            lua_rawset(L,-3);                  /* ubox[value] = newud, stack: mt newud ubox */\n            lua_pop(L,1);                                           /* stack: mt newud */\n            /*luaL_getmetatable(L,type);*/\n            lua_pushvalue(L, -2);                                   /* stack: mt newud mt */\n            lua_setmetatable(L,-2);                      /* update mt, stack: mt newud */\n            \n#ifdef LUA_VERSION_NUM\n            lua_pushvalue(L, TOLUA_NOPEER);             /* stack: mt newud peer */\n            lua_setfenv(L, -2);                         /* stack: mt newud */\n#endif\n        }\n        else\n        {\n            /* check the need of updating the metatable to a more specialized class */\n            lua_insert(L,-2);                                       /* stack: mt ubox[u] ubox */\n            lua_pop(L,1);                                           /* stack: mt ubox[u] */\n            lua_pushstring(L,\"tolua_super\");\n            lua_rawget(L,LUA_REGISTRYINDEX);                        /* stack: mt ubox[u] super */\n            lua_getmetatable(L,-2);                                 /* stack: mt ubox[u] super mt */\n            lua_rawget(L,-2);                                       /* stack: mt ubox[u] super super[mt] */\n            if (lua_istable(L,-1))\n            {\n                lua_pushstring(L,type);                             /* stack: mt ubox[u] super super[mt] type */\n                lua_rawget(L,-2);                                   /* stack: mt ubox[u] super super[mt] flag */\n                if (lua_toboolean(L,-1) == 1)                       /* if true */\n                {\n                    lua_pop(L,3);                                   /* mt ubox[u]*/\n                    lua_remove(L, -2);\n                    return;\n                }\n            }\n            /* type represents a more specilized type */\n            /*luaL_getmetatable(L,type);             // stack: mt ubox[u] super super[mt] flag mt */\n            lua_pushvalue(L, -5);                    /* stack: mt ubox[u] super super[mt] flag mt */\n            lua_setmetatable(L,-5);                /* stack: mt ubox[u] super super[mt] flag */\n            lua_pop(L,3);                          /* stack: mt ubox[u] */\n        }\n        lua_remove(L, -2);    /* stack: ubox[u]*/\n        \n        if (0 != addToRoot)\n        {\n            lua_pushvalue(L, -1);\n            tolua_add_value_to_root(L, value);\n        }\n    } \n}\n\nTOLUA_API void tolua_pushvalue (lua_State* L, int lo)\n{\n    lua_pushvalue(L,lo);\n}\n\nTOLUA_API void tolua_pushboolean (lua_State* L, int value)\n{\n    lua_pushboolean(L,value);\n}\n\nTOLUA_API void tolua_pushnumber (lua_State* L, lua_Number value)\n{\n    lua_pushnumber(L,value);\n}\n\nTOLUA_API void tolua_pushstring (lua_State* L, const char* value)\n{\n    if (value == NULL)\n        lua_pushnil(L);\n    else\n        lua_pushstring(L,value);\n}\n\nTOLUA_API void tolua_pushuserdata (lua_State* L, void* value)\n{\n    if (value == NULL)\n        lua_pushnil(L);\n    else\n        lua_pushlightuserdata(L,value);\n}\n\nTOLUA_API void tolua_pushusertype (lua_State* L, void* value, const char* type)\n{\n    tolua_pushusertype_internal(L, value, type, 0);\n}\n\nTOLUA_API void tolua_pushusertype_and_addtoroot (lua_State* L, void* value, const char* type)\n{\n    tolua_pushusertype_internal(L, value, type, 1);\n}\n\nTOLUA_API void tolua_pushusertype_and_takeownership (lua_State* L, void* value, const char* type)\n{\n    tolua_pushusertype(L,value,type);\n    tolua_register_gc(L,lua_gettop(L));\n}\n\nTOLUA_API void tolua_add_value_to_root(lua_State* L, void* ptr)\n{\n    \n    lua_pushstring(L, TOLUA_VALUE_ROOT);\n    lua_rawget(L, LUA_REGISTRYINDEX);                               /* stack: value root */\n    lua_insert(L, -2);                                              /* stack: root value */\n    lua_pushlightuserdata(L, ptr);                                  /* stack: root value ptr */\n    lua_insert(L, -2);                                              /* stack: root ptr value */\n    lua_rawset(L, -3);                                              /* root[ptr] = value, stack: root */\n    lua_pop(L, 1);                                                  /* stack: - */\n}\n\n\nTOLUA_API void tolua_remove_value_from_root (lua_State* L, void* ptr)\n{\n    lua_pushstring(L, TOLUA_VALUE_ROOT);\n    lua_rawget(L, LUA_REGISTRYINDEX);                               /* stack: root */\n    lua_pushlightuserdata(L, ptr);                                  /* stack: root ptr */\n    \n    lua_pushnil(L);                                                 /* stack: root ptr nil */\n    lua_rawset(L, -3);                                              /* root[ptr] = nil, stack: root */\n    lua_pop(L, 1);\n}\n\nTOLUA_API void tolua_pushfieldvalue (lua_State* L, int lo, int index, int v)\n{\n    lua_pushnumber(L,index);\n    lua_pushvalue(L,v);\n    lua_settable(L,lo);\n}\n\nTOLUA_API void tolua_pushfieldboolean (lua_State* L, int lo, int index, int v)\n{\n    lua_pushnumber(L,index);\n    lua_pushboolean(L,v);\n    lua_settable(L,lo);\n}\n\n\nTOLUA_API void tolua_pushfieldnumber (lua_State* L, int lo, int index, lua_Number v)\n{\n    lua_pushnumber(L,index);\n    tolua_pushnumber(L,v);\n    lua_settable(L,lo);\n}\n\nTOLUA_API void tolua_pushfieldstring (lua_State* L, int lo, int index, const char* v)\n{\n    lua_pushnumber(L,index);\n    tolua_pushstring(L,v);\n    lua_settable(L,lo);\n}\n\nTOLUA_API void tolua_pushfielduserdata (lua_State* L, int lo, int index, void* v)\n{\n    lua_pushnumber(L,index);\n    tolua_pushuserdata(L,v);\n    lua_settable(L,lo);\n}\n\nTOLUA_API void tolua_pushfieldusertype (lua_State* L, int lo, int index, void* v, const char* type)\n{\n    lua_pushnumber(L,index);\n    tolua_pushusertype(L,v,type);\n    lua_settable(L,lo);\n}\n\nTOLUA_API void tolua_pushfieldusertype_and_takeownership (lua_State* L, int lo, int index, void* v, const char* type)\n{\n    lua_pushnumber(L,index);\n    tolua_pushusertype(L,v,type);\n    tolua_register_gc(L,lua_gettop(L));\n    lua_settable(L,lo);\n}\n\n"
  },
  {
    "path": "cocos2d/external/lua/tolua/tolua_to.c",
    "content": "/* tolua: funcitons to convert to C types\n** Support code for Lua bindings.\n** Written by Waldemar Celes\n** TeCGraf/PUC-Rio\n** Apr 2003\n** $Id: $\n*/\n\n/* This code is free software; you can redistribute it and/or modify it.\n** The software provided hereunder is on an \"as is\" basis, and\n** the author has no obligation to provide maintenance, support, updates,\n** enhancements, or modifications.\n*/\n\n#include \"tolua++.h\"\n\n#include <string.h>\n#include <stdlib.h>\n\nTOLUA_API lua_Number tolua_tonumber (lua_State* L, int narg, lua_Number def)\n{\n    return lua_gettop(L)<abs(narg) ? def : lua_tonumber(L,narg);\n}\n\nTOLUA_API const char* tolua_tostring (lua_State* L, int narg, const char* def)\n{\n    return lua_gettop(L)<abs(narg) ? def : lua_tostring(L,narg);\n}\n\nTOLUA_API void* tolua_touserdata (lua_State* L, int narg, void* def)\n{\n\n    /* return lua_gettop(L)<abs(narg) ? def : lua_touserdata(L,narg); */\n\n    if (lua_gettop(L)<abs(narg)) {\n        return def;\n    };\n\n    if (lua_islightuserdata(L, narg)) {\n\n        return lua_touserdata(L,narg);\n    };\n\n    return tolua_tousertype(L, narg, def);\n}\n\nextern int push_table_instance(lua_State* L, int lo);\n\nTOLUA_API void* tolua_tousertype (lua_State* L, int narg, void* def)\n{\n    if (lua_gettop(L)<abs(narg))\n        return def;\n    else\n    {\n        void* u;\n        if (!lua_isuserdata(L, narg)) {\n            if (!push_table_instance(L, narg)) return NULL;\n        };\n        u = lua_touserdata(L,narg);\n        return (u==NULL) ? NULL : *((void**)u); /* nil represents NULL */\n    }\n}\n\nTOLUA_API int tolua_tovalue (lua_State* L, int narg, int def)\n{\n    return lua_gettop(L)<abs(narg) ? def : narg;\n}\n\nTOLUA_API int tolua_toboolean (lua_State* L, int narg, int def)\n{\n    return lua_gettop(L)<abs(narg) ?  def : lua_toboolean(L,narg);\n}\n\nTOLUA_API lua_Number tolua_tofieldnumber (lua_State* L, int lo, int index, lua_Number def)\n{\n    double v;\n    lua_pushnumber(L,index);\n    lua_gettable(L,lo);\n    v = lua_isnil(L,-1) ? def : lua_tonumber(L,-1);\n    lua_pop(L,1);\n    return v;\n}\n\nTOLUA_API const char* tolua_tofieldstring\n(lua_State* L, int lo, int index, const char* def)\n{\n    const char* v;\n    lua_pushnumber(L,index);\n    lua_gettable(L,lo);\n    v = lua_isnil(L,-1) ? def : lua_tostring(L,-1);\n    lua_pop(L,1);\n    return v;\n}\n\nTOLUA_API void* tolua_tofielduserdata (lua_State* L, int lo, int index, void* def)\n{\n    void* v;\n    lua_pushnumber(L,index);\n    lua_gettable(L,lo);\n    v = lua_isnil(L,-1) ? def : lua_touserdata(L,-1);\n    lua_pop(L,1);\n    return v;\n}\n\nTOLUA_API void* tolua_tofieldusertype (lua_State* L, int lo, int index, void* def)\n{\n    void* v;\n    lua_pushnumber(L,index);\n    lua_gettable(L,lo);\n    v = lua_isnil(L,-1) ? def : (*(void **)(lua_touserdata(L, -1))); /* lua_unboxpointer(L,-1); */\n    lua_pop(L,1);\n    return v;\n}\n\nTOLUA_API int tolua_tofieldvalue (lua_State* L, int lo, int index, int def)\n{\n    int v;\n    lua_pushnumber(L,index);\n    lua_gettable(L,lo);\n    v = lua_isnil(L,-1) ? def : lo;\n    lua_pop(L,1);\n    return v;\n}\n\nTOLUA_API int tolua_getfieldboolean (lua_State* L, int lo, int index, int def)\n{\n    int v;\n    lua_pushnumber(L,index);\n    lua_gettable(L,lo);\n    v = lua_isnil(L,-1) ? 0 : lua_toboolean(L,-1);\n    lua_pop(L,1);\n    return v;\n}\n"
  },
  {
    "path": "cocos2d/external/png/include/android/png.h",
    "content": "\n/* png.h - header file for PNG reference library\n *\n * libpng version 1.6.2 - April 25, 2013\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license (See LICENSE, below)\n *\n * Authors and maintainers:\n *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat\n *   libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger\n *   libpng versions 0.97, January 1998, through 1.6.2 - April 25, 2013: Glenn\n *   See also \"Contributing Authors\", below.\n *\n * Note about libpng version numbers:\n *\n *   Due to various miscommunications, unforeseen code incompatibilities\n *   and occasional factors outside the authors' control, version numbering\n *   on the library has not always been consistent and straightforward.\n *   The following table summarizes matters since version 0.89c, which was\n *   the first widely used release:\n *\n *    source                 png.h  png.h  shared-lib\n *    version                string   int  version\n *    -------                ------ -----  ----------\n *    0.89c \"1.0 beta 3\"     0.89      89  1.0.89\n *    0.90  \"1.0 beta 4\"     0.90      90  0.90  [should have been 2.0.90]\n *    0.95  \"1.0 beta 5\"     0.95      95  0.95  [should have been 2.0.95]\n *    0.96  \"1.0 beta 6\"     0.96      96  0.96  [should have been 2.0.96]\n *    0.97b \"1.00.97 beta 7\" 1.00.97   97  1.0.1 [should have been 2.0.97]\n *    0.97c                  0.97      97  2.0.97\n *    0.98                   0.98      98  2.0.98\n *    0.99                   0.99      98  2.0.99\n *    0.99a-m                0.99      99  2.0.99\n *    1.00                   1.00     100  2.1.0 [100 should be 10000]\n *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]\n *    1.0.1       png.h string is   10001  2.1.0\n *    1.0.1a-e    identical to the  10002  from here on, the shared library\n *    1.0.2       source version)   10002  is 2.V where V is the source code\n *    1.0.2a-b                      10003  version, except as noted.\n *    1.0.3                         10003\n *    1.0.3a-d                      10004\n *    1.0.4                         10004\n *    1.0.4a-f                      10005\n *    1.0.5 (+ 2 patches)           10005\n *    1.0.5a-d                      10006\n *    1.0.5e-r                      10100 (not source compatible)\n *    1.0.5s-v                      10006 (not binary compatible)\n *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)\n *    1.0.6d-f                      10007 (still binary incompatible)\n *    1.0.6g                        10007\n *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)\n *    1.0.6i                        10007  10.6i\n *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)\n *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)\n *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)\n *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)\n *    1.0.7                    1    10007  (still compatible)\n *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4\n *    1.0.8rc1                 1    10008  2.1.0.8rc1\n *    1.0.8                    1    10008  2.1.0.8\n *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6\n *    1.0.9rc1                 1    10009  2.1.0.9rc1\n *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10\n *    1.0.9rc2                 1    10009  2.1.0.9rc2\n *    1.0.9                    1    10009  2.1.0.9\n *    1.0.10beta1              1    10010  2.1.0.10beta1\n *    1.0.10rc1                1    10010  2.1.0.10rc1\n *    1.0.10                   1    10010  2.1.0.10\n *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3\n *    1.0.11rc1                1    10011  2.1.0.11rc1\n *    1.0.11                   1    10011  2.1.0.11\n *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2\n *    1.0.12rc1                2    10012  2.1.0.12rc1\n *    1.0.12                   2    10012  2.1.0.12\n *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)\n *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2\n *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5\n *    1.2.0rc1                 3    10200  3.1.2.0rc1\n *    1.2.0                    3    10200  3.1.2.0\n *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4\n *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2\n *    1.2.1                    3    10201  3.1.2.1\n *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6\n *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1\n *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1\n *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1\n *    1.0.13                  10    10013  10.so.0.1.0.13\n *    1.2.2                   12    10202  12.so.0.1.2.2\n *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6\n *    1.2.3                   12    10203  12.so.0.1.2.3\n *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3\n *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1\n *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1\n *    1.0.14                  10    10014  10.so.0.1.0.14\n *    1.2.4                   13    10204  12.so.0.1.2.4\n *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2\n *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3\n *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3\n *    1.0.15                  10    10015  10.so.0.1.0.15\n *    1.2.5                   13    10205  12.so.0.1.2.5\n *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4\n *    1.0.16                  10    10016  10.so.0.1.0.16\n *    1.2.6                   13    10206  12.so.0.1.2.6\n *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2\n *    1.0.17rc1               10    10017  12.so.0.1.0.17rc1\n *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1\n *    1.0.17                  10    10017  12.so.0.1.0.17\n *    1.2.7                   13    10207  12.so.0.1.2.7\n *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5\n *    1.0.18rc1-5             10    10018  12.so.0.1.0.18rc1-5\n *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5\n *    1.0.18                  10    10018  12.so.0.1.0.18\n *    1.2.8                   13    10208  12.so.0.1.2.8\n *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3\n *    1.2.9beta4-11           13    10209  12.so.0.9[.0]\n *    1.2.9rc1                13    10209  12.so.0.9[.0]\n *    1.2.9                   13    10209  12.so.0.9[.0]\n *    1.2.10beta1-7           13    10210  12.so.0.10[.0]\n *    1.2.10rc1-2             13    10210  12.so.0.10[.0]\n *    1.2.10                  13    10210  12.so.0.10[.0]\n *    1.4.0beta1-5            14    10400  14.so.0.0[.0]\n *    1.2.11beta1-4           13    10211  12.so.0.11[.0]\n *    1.4.0beta7-8            14    10400  14.so.0.0[.0]\n *    1.2.11                  13    10211  12.so.0.11[.0]\n *    1.2.12                  13    10212  12.so.0.12[.0]\n *    1.4.0beta9-14           14    10400  14.so.0.0[.0]\n *    1.2.13                  13    10213  12.so.0.13[.0]\n *    1.4.0beta15-36          14    10400  14.so.0.0[.0]\n *    1.4.0beta37-87          14    10400  14.so.14.0[.0]\n *    1.4.0rc01               14    10400  14.so.14.0[.0]\n *    1.4.0beta88-109         14    10400  14.so.14.0[.0]\n *    1.4.0rc02-08            14    10400  14.so.14.0[.0]\n *    1.4.0                   14    10400  14.so.14.0[.0]\n *    1.4.1beta01-03          14    10401  14.so.14.1[.0]\n *    1.4.1rc01               14    10401  14.so.14.1[.0]\n *    1.4.1beta04-12          14    10401  14.so.14.1[.0]\n *    1.4.1                   14    10401  14.so.14.1[.0]\n *    1.4.2                   14    10402  14.so.14.2[.0]\n *    1.4.3                   14    10403  14.so.14.3[.0]\n *    1.4.4                   14    10404  14.so.14.4[.0]\n *    1.5.0beta01-58          15    10500  15.so.15.0[.0]\n *    1.5.0rc01-07            15    10500  15.so.15.0[.0]\n *    1.5.0                   15    10500  15.so.15.0[.0]\n *    1.5.1beta01-11          15    10501  15.so.15.1[.0]\n *    1.5.1rc01-02            15    10501  15.so.15.1[.0]\n *    1.5.1                   15    10501  15.so.15.1[.0]\n *    1.5.2beta01-03          15    10502  15.so.15.2[.0]\n *    1.5.2rc01-03            15    10502  15.so.15.2[.0]\n *    1.5.2                   15    10502  15.so.15.2[.0]\n *    1.5.3beta01-10          15    10503  15.so.15.3[.0]\n *    1.5.3rc01-02            15    10503  15.so.15.3[.0]\n *    1.5.3beta11             15    10503  15.so.15.3[.0]\n *    1.5.3 [omitted]\n *    1.5.4beta01-08          15    10504  15.so.15.4[.0]\n *    1.5.4rc01               15    10504  15.so.15.4[.0]\n *    1.5.4                   15    10504  15.so.15.4[.0]\n *    1.5.5beta01-08          15    10505  15.so.15.5[.0]\n *    1.5.5rc01               15    10505  15.so.15.5[.0]\n *    1.5.5                   15    10505  15.so.15.5[.0]\n *    1.5.6beta01-07          15    10506  15.so.15.6[.0]\n *    1.5.6rc01-03            15    10506  15.so.15.6[.0]\n *    1.5.6                   15    10506  15.so.15.6[.0]\n *    1.5.7beta01-05          15    10507  15.so.15.7[.0]\n *    1.5.7rc01-03            15    10507  15.so.15.7[.0]\n *    1.5.7                   15    10507  15.so.15.7[.0]\n *    1.6.0beta01-40          16    10600  16.so.16.0[.0]\n *    1.6.0rc01-08            16    10600  16.so.16.0[.0]\n *    1.6.0                   16    10600  16.so.16.0[.0]\n *    1.6.1beta01-09          16    10601  16.so.16.1[.0]\n *    1.6.1rc01               16    10601  16.so.16.1[.0]\n *    1.6.1                   16    10601  16.so.16.1[.0]\n *    1.6.2beta01             16    10602  16.so.16.2[.0]\n *    1.6.2rc01-06            16    10602  16.so.16.2[.0]\n *    1.6.2                   16    10602  16.so.16.2[.0]\n *\n *   Henceforth the source version will match the shared-library major\n *   and minor numbers; the shared-library major version number will be\n *   used for changes in backward compatibility, as it is intended.  The\n *   PNG_LIBPNG_VER macro, which is not used within libpng but is available\n *   for applications, is an unsigned integer of the form xyyzz corresponding\n *   to the source version x.y.z (leading zeros in y and z).  Beta versions\n *   were given the previous public release number plus a letter, until\n *   version 1.0.6j; from then on they were given the upcoming public\n *   release number plus \"betaNN\" or \"rcNN\".\n *\n *   Binary incompatibility exists only when applications make direct access\n *   to the info_ptr or png_ptr members through png.h, and the compiled\n *   application is loaded with a different version of the library.\n *\n *   DLLNUM will change each time there are forward or backward changes\n *   in binary compatibility (e.g., when a new feature is added).\n *\n * See libpng-manual.txt or libpng.3 for more information.  The PNG\n * specification is available as a W3C Recommendation and as an ISO\n * Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/\n */\n\n/*\n * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:\n *\n * If you modify libpng you may insert additional notices immediately following\n * this sentence.\n *\n * This code is released under the libpng license.\n *\n * libpng versions 1.2.6, August 15, 2004, through 1.6.2, April 25, 2013, are\n * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.2.5\n * with the following individual added to the list of Contributing Authors:\n *\n *    Cosmin Truta\n *\n * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are\n * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.0.6\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Simon-Pierre Cadieux\n *    Eric S. Raymond\n *    Gilles Vollant\n *\n * and with the following additions to the disclaimer:\n *\n *    There is no warranty against interference with your enjoyment of the\n *    library or against infringement.  There is no warranty that our\n *    efforts or the library will fulfill any of your particular purposes\n *    or needs.  This library is provided with all faults, and the entire\n *    risk of satisfactory quality, performance, accuracy, and effort is with\n *    the user.\n *\n * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are\n * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-0.96,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Tom Lane\n *    Glenn Randers-Pehrson\n *    Willem van Schaik\n *\n * libpng versions 0.89, June 1996, through 0.96, May 1997, are\n * Copyright (c) 1996, 1997 Andreas Dilger\n * Distributed according to the same disclaimer and license as libpng-0.88,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    John Bowler\n *    Kevin Bracey\n *    Sam Bushell\n *    Magnus Holmgren\n *    Greg Roelofs\n *    Tom Tanner\n *\n * libpng versions 0.5, May 1995, through 0.88, January 1996, are\n * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n *\n * For the purposes of this copyright and license, \"Contributing Authors\"\n * is defined as the following set of individuals:\n *\n *    Andreas Dilger\n *    Dave Martindale\n *    Guy Eric Schalnat\n *    Paul Schmidt\n *    Tim Wegner\n *\n * The PNG Reference Library is supplied \"AS IS\".  The Contributing Authors\n * and Group 42, Inc. disclaim all warranties, expressed or implied,\n * including, without limitation, the warranties of merchantability and of\n * fitness for any purpose.  The Contributing Authors and Group 42, Inc.\n * assume no liability for direct, indirect, incidental, special, exemplary,\n * or consequential damages, which may result from the use of the PNG\n * Reference Library, even if advised of the possibility of such damage.\n *\n * Permission is hereby granted to use, copy, modify, and distribute this\n * source code, or portions hereof, for any purpose, without fee, subject\n * to the following restrictions:\n *\n *   1. The origin of this source code must not be misrepresented.\n *\n *   2. Altered versions must be plainly marked as such and must not\n *      be misrepresented as being the original source.\n *\n *   3. This Copyright notice may not be removed or altered from\n *      any source or altered source distribution.\n *\n * The Contributing Authors and Group 42, Inc. specifically permit, without\n * fee, and encourage the use of this source code as a component to\n * supporting the PNG file format in commercial products.  If you use this\n * source code in a product, acknowledgment is not required but would be\n * appreciated.\n */\n\n/*\n * A \"png_get_copyright\" function is available, for convenient use in \"about\"\n * boxes and the like:\n *\n *     printf(\"%s\", png_get_copyright(NULL));\n *\n * Also, the PNG logo (in PNG format, of course) is supplied in the\n * files \"pngbar.png\" and \"pngbar.jpg (88x31) and \"pngnow.png\" (98x31).\n */\n\n/*\n * Libpng is OSI Certified Open Source Software.  OSI Certified is a\n * certification mark of the Open Source Initiative.\n */\n\n/*\n * The contributing authors would like to thank all those who helped\n * with testing, bug fixes, and patience.  This wouldn't have been\n * possible without all of you.\n *\n * Thanks to Frank J. T. Wojcik for helping with the documentation.\n */\n\n/*\n * Y2K compliance in libpng:\n * =========================\n *\n *    April 25, 2013\n *\n *    Since the PNG Development group is an ad-hoc body, we can't make\n *    an official declaration.\n *\n *    This is your unofficial assurance that libpng from version 0.71 and\n *    upward through 1.6.2 are Y2K compliant.  It is my belief that\n *    earlier versions were also Y2K compliant.\n *\n *    Libpng only has two year fields.  One is a 2-byte unsigned integer\n *    that will hold years up to 65535.  The other, which is deprecated,\n *    holds the date in text format, and will hold years up to 9999.\n *\n *    The integer is\n *        \"png_uint_16 year\" in png_time_struct.\n *\n *    The string is\n *        \"char time_buffer[29]\" in png_struct.  This is no longer used\n *    in libpng-1.6.x and will be removed from libpng-1.7.0.\n *\n *    There are seven time-related functions:\n *        png.c: png_convert_to_rfc_1123_buffer() in png.c\n *          (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and\n *          png_convert_to_rfc_1152() in error prior to libpng-0.98)\n *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c\n *        png_convert_from_time_t() in pngwrite.c\n *        png_get_tIME() in pngget.c\n *        png_handle_tIME() in pngrutil.c, called in pngread.c\n *        png_set_tIME() in pngset.c\n *        png_write_tIME() in pngwutil.c, called in pngwrite.c\n *\n *    All handle dates properly in a Y2K environment.  The\n *    png_convert_from_time_t() function calls gmtime() to convert from system\n *    clock time, which returns (year - 1900), which we properly convert to\n *    the full 4-digit year.  There is a possibility that libpng applications\n *    are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()\n *    function, or that they are incorrectly passing only a 2-digit year\n *    instead of \"year - 1900\" into the png_convert_from_struct_tm() function,\n *    but this is not under our control.  The libpng documentation has always\n *    stated that it works with 4-digit years, and the APIs have been\n *    documented as such.\n *\n *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned\n *    integer to hold the year, and can hold years as large as 65535.\n *\n *    zlib, upon which libpng depends, is also Y2K compliant.  It contains\n *    no date-related code.\n *\n *       Glenn Randers-Pehrson\n *       libpng maintainer\n *       PNG Development Group\n */\n\n#ifndef PNG_H\n#define PNG_H\n\n/* This is not the place to learn how to use libpng. The file libpng-manual.txt\n * describes how to use libpng, and the file example.c summarizes it\n * with some code on which to build.  This file is useful for looking\n * at the actual function definitions and structure components.\n *\n * If you just need to read a PNG file and don't want to read the documentation\n * skip to the end of this file and read the section entitled 'simplified API'.\n */\n\n/* Version information for png.h - this should match the version in png.c */\n#define PNG_LIBPNG_VER_STRING \"1.6.2\"\n#define PNG_HEADER_VERSION_STRING \\\n     \" libpng version 1.6.2 - April 25, 2013\\n\"\n\n#define PNG_LIBPNG_VER_SONUM   16\n#define PNG_LIBPNG_VER_DLLNUM  16\n\n/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */\n#define PNG_LIBPNG_VER_MAJOR   1\n#define PNG_LIBPNG_VER_MINOR   6\n#define PNG_LIBPNG_VER_RELEASE 2\n\n/* This should match the numeric part of the final component of\n * PNG_LIBPNG_VER_STRING, omitting any leading zero:\n */\n\n#define PNG_LIBPNG_VER_BUILD  0\n\n/* Release Status */\n#define PNG_LIBPNG_BUILD_ALPHA    1\n#define PNG_LIBPNG_BUILD_BETA     2\n#define PNG_LIBPNG_BUILD_RC       3\n#define PNG_LIBPNG_BUILD_STABLE   4\n#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7\n\n/* Release-Specific Flags */\n#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with\n                                       PNG_LIBPNG_BUILD_STABLE only */\n#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_SPECIAL */\n#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_PRIVATE */\n\n#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE\n\n/* Careful here.  At one time, Guy wanted to use 082, but that would be octal.\n * We must not include leading zeros.\n * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only\n * version 1.0.0 was mis-numbered 100 instead of 10000).  From\n * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release\n */\n#define PNG_LIBPNG_VER 10602 /* 1.6.2 */\n\n/* Library configuration: these options cannot be changed after\n * the library has been built.\n */\n#ifndef PNGLCONF_H\n    /* If pnglibconf.h is missing, you can\n     * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h\n     */\n#   include \"pnglibconf.h\"\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n   /* Machine specific configuration. */\n#  include \"pngconf.h\"\n#endif\n\n/*\n * Added at libpng-1.2.8\n *\n * Ref MSDN: Private as priority over Special\n * VS_FF_PRIVATEBUILD File *was not* built using standard release\n * procedures. If this value is given, the StringFileInfo block must\n * contain a PrivateBuild string.\n *\n * VS_FF_SPECIALBUILD File *was* built by the original company using\n * standard release procedures but is a variation of the standard\n * file of the same version number. If this value is given, the\n * StringFileInfo block must contain a SpecialBuild string.\n */\n\n#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */\n#  define PNG_LIBPNG_BUILD_TYPE \\\n       (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)\n#else\n#  ifdef PNG_LIBPNG_SPECIALBUILD\n#    define PNG_LIBPNG_BUILD_TYPE \\\n         (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)\n#  else\n#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)\n#  endif\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n\n/* Inhibit C++ name-mangling for libpng functions but not for system calls. */\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/* Version information for C files, stored in png.c.  This had better match\n * the version above.\n */\n#define png_libpng_ver png_get_header_ver(NULL)\n\n/* This file is arranged in several sections:\n *\n * 1. Any configuration options that can be specified by for the application\n *    code when it is built.  (Build time configuration is in pnglibconf.h)\n * 2. Type definitions (base types are defined in pngconf.h), structure\n *    definitions.\n * 3. Exported library functions.\n * 4. Simplified API.\n *\n * The library source code has additional files (principally pngpriv.h) that\n * allow configuration of the library.\n */\n/* Section 1: run time configuration\n * See pnglibconf.h for build time configuration\n *\n * Run time configuration allows the application to choose between\n * implementations of certain arithmetic APIs.  The default is set\n * at build time and recorded in pnglibconf.h, but it is safe to\n * override these (and only these) settings.  Note that this won't\n * change what the library does, only application code, and the\n * settings can (and probably should) be made on a per-file basis\n * by setting the #defines before including png.h\n *\n * Use macros to read integers from PNG data or use the exported\n * functions?\n *   PNG_USE_READ_MACROS: use the macros (see below)  Note that\n *     the macros evaluate their argument multiple times.\n *   PNG_NO_USE_READ_MACROS: call the relevant library function.\n *\n * Use the alternative algorithm for compositing alpha samples that\n * does not use division?\n *   PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division'\n *      algorithm.\n *   PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm.\n *\n * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is\n * false?\n *   PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error\n *      APIs to png_warning.\n * Otherwise the calls are mapped to png_error.\n */\n\n/* Section 2: type definitions, including structures and compile time\n * constants.\n * See pngconf.h for base types that vary by machine/system\n */\n\n/* This triggers a compiler error in png.c, if png.c and png.h\n * do not agree upon the version number.\n */\ntypedef char* png_libpng_version_1_6_2;\n\n/* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.\n *\n * png_struct is the cache of information used while reading or writing a single\n * PNG file.  One of these is always required, although the simplified API\n * (below) hides the creation and destruction of it.\n */\ntypedef struct png_struct_def png_struct;\ntypedef const png_struct * png_const_structp;\ntypedef png_struct * png_structp;\ntypedef png_struct * * png_structpp;\n\n/* png_info contains information read from or to be written to a PNG file.  One\n * or more of these must exist while reading or creating a PNG file.  The\n * information is not used by libpng during read but is used to control what\n * gets written when a PNG file is created.  \"png_get_\" function calls read\n * information during read and \"png_set_\" functions calls write information\n * when creating a PNG.\n * been moved into a separate header file that is not accessible to\n * applications.  Read libpng-manual.txt or libpng.3 for more info.\n */\ntypedef struct png_info_def png_info;\ntypedef png_info * png_infop;\ntypedef const png_info * png_const_infop;\ntypedef png_info * * png_infopp;\n\n/* Types with names ending 'p' are pointer types.  The corresponding types with\n * names ending 'rp' are identical pointer types except that the pointer is\n * marked 'restrict', which means that it is the only pointer to the object\n * passed to the function.  Applications should not use the 'restrict' types;\n * it is always valid to pass 'p' to a pointer with a function argument of the\n * corresponding 'rp' type.  Different compilers have different rules with\n * regard to type matching in the presence of 'restrict'.  For backward\n * compatibility libpng callbacks never have 'restrict' in their parameters and,\n * consequentially, writing portable application code is extremely difficult if\n * an attempt is made to use 'restrict'.\n */\ntypedef png_struct * PNG_RESTRICT png_structrp;\ntypedef const png_struct * PNG_RESTRICT png_const_structrp;\ntypedef png_info * PNG_RESTRICT png_inforp;\ntypedef const png_info * PNG_RESTRICT png_const_inforp;\n\n/* Three color definitions.  The order of the red, green, and blue, (and the\n * exact size) is not important, although the size of the fields need to\n * be png_byte or png_uint_16 (as defined below).\n */\ntypedef struct png_color_struct\n{\n   png_byte red;\n   png_byte green;\n   png_byte blue;\n} png_color;\ntypedef png_color * png_colorp;\ntypedef const png_color * png_const_colorp;\ntypedef png_color * * png_colorpp;\n\ntypedef struct png_color_16_struct\n{\n   png_byte index;    /* used for palette files */\n   png_uint_16 red;   /* for use in red green blue files */\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 gray;  /* for use in grayscale files */\n} png_color_16;\ntypedef png_color_16 * png_color_16p;\ntypedef const png_color_16 * png_const_color_16p;\ntypedef png_color_16 * * png_color_16pp;\n\ntypedef struct png_color_8_struct\n{\n   png_byte red;   /* for use in red green blue files */\n   png_byte green;\n   png_byte blue;\n   png_byte gray;  /* for use in grayscale files */\n   png_byte alpha; /* for alpha channel files */\n} png_color_8;\ntypedef png_color_8 * png_color_8p;\ntypedef const png_color_8 * png_const_color_8p;\ntypedef png_color_8 * * png_color_8pp;\n\n/*\n * The following two structures are used for the in-core representation\n * of sPLT chunks.\n */\ntypedef struct png_sPLT_entry_struct\n{\n   png_uint_16 red;\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 alpha;\n   png_uint_16 frequency;\n} png_sPLT_entry;\ntypedef png_sPLT_entry * png_sPLT_entryp;\ntypedef const png_sPLT_entry * png_const_sPLT_entryp;\ntypedef png_sPLT_entry * * png_sPLT_entrypp;\n\n/*  When the depth of the sPLT palette is 8 bits, the color and alpha samples\n *  occupy the LSB of their respective members, and the MSB of each member\n *  is zero-filled.  The frequency member always occupies the full 16 bits.\n */\n\ntypedef struct png_sPLT_struct\n{\n   png_charp name;           /* palette name */\n   png_byte depth;           /* depth of palette samples */\n   png_sPLT_entryp entries;  /* palette entries */\n   png_int_32 nentries;      /* number of palette entries */\n} png_sPLT_t;\ntypedef png_sPLT_t * png_sPLT_tp;\ntypedef const png_sPLT_t * png_const_sPLT_tp;\ntypedef png_sPLT_t * * png_sPLT_tpp;\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,\n * and whether that contents is compressed or not.  The \"key\" field\n * points to a regular zero-terminated C string.  The \"text\" fields can be a\n * regular C string, an empty string, or a NULL pointer.\n * However, the structure returned by png_get_text() will always contain\n * the \"text\" field as a regular zero-terminated C string (possibly\n * empty), never a NULL pointer, so it can be safely used in printf() and\n * other string-handling functions.  Note that the \"itxt_length\", \"lang\", and\n * \"lang_key\" members of the structure only exist when the library is built\n * with iTXt chunk support.  Prior to libpng-1.4.0 the library was built by\n * default without iTXt support. Also note that when iTXt *is* supported,\n * the \"lang\" and \"lang_key\" fields contain NULL pointers when the\n * \"compression\" field contains * PNG_TEXT_COMPRESSION_NONE or\n * PNG_TEXT_COMPRESSION_zTXt. Note that the \"compression value\" is not the\n * same as what appears in the PNG tEXt/zTXt/iTXt chunk's \"compression flag\"\n * which is always 0 or 1, or its \"compression method\" which is always 0.\n */\ntypedef struct png_text_struct\n{\n   int  compression;       /* compression value:\n                             -1: tEXt, none\n                              0: zTXt, deflate\n                              1: iTXt, none\n                              2: iTXt, deflate  */\n   png_charp key;          /* keyword, 1-79 character description of \"text\" */\n   png_charp text;         /* comment, may be an empty string (ie \"\")\n                              or a NULL pointer */\n   png_size_t text_length; /* length of the text string */\n   png_size_t itxt_length; /* length of the itxt string */\n   png_charp lang;         /* language code, 0-79 characters\n                              or a NULL pointer */\n   png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more\n                              chars or a NULL pointer */\n} png_text;\ntypedef png_text * png_textp;\ntypedef const png_text * png_const_textp;\ntypedef png_text * * png_textpp;\n#endif\n\n/* Supported compression types for text in PNG files (tEXt, and zTXt).\n * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */\n#define PNG_TEXT_COMPRESSION_NONE_WR -3\n#define PNG_TEXT_COMPRESSION_zTXt_WR -2\n#define PNG_TEXT_COMPRESSION_NONE    -1\n#define PNG_TEXT_COMPRESSION_zTXt     0\n#define PNG_ITXT_COMPRESSION_NONE     1\n#define PNG_ITXT_COMPRESSION_zTXt     2\n#define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */\n\n/* png_time is a way to hold the time in an machine independent way.\n * Two conversions are provided, both from time_t and struct tm.  There\n * is no portable way to convert to either of these structures, as far\n * as I know.  If you know of a portable way, send it to me.  As a side\n * note - PNG has always been Year 2000 compliant!\n */\ntypedef struct png_time_struct\n{\n   png_uint_16 year; /* full year, as in, 1995 */\n   png_byte month;   /* month of year, 1 - 12 */\n   png_byte day;     /* day of month, 1 - 31 */\n   png_byte hour;    /* hour of day, 0 - 23 */\n   png_byte minute;  /* minute of hour, 0 - 59 */\n   png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */\n} png_time;\ntypedef png_time * png_timep;\ntypedef const png_time * png_const_timep;\ntypedef png_time * * png_timepp;\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n/* png_unknown_chunk is a structure to hold queued chunks for which there is\n * no specific support.  The idea is that we can use this to queue\n * up private chunks for output even though the library doesn't actually\n * know about their semantics.\n *\n * The data in the structure is set by libpng on read and used on write.\n */\ntypedef struct png_unknown_chunk_t\n{\n    png_byte name[5]; /* Textual chunk name with '\\0' terminator */\n    png_byte *data;   /* Data, should not be modified on read! */\n    png_size_t size;\n\n    /* On write 'location' must be set using the flag values listed below.\n     * Notice that on read it is set by libpng however the values stored have\n     * more bits set than are listed below.  Always treat the value as a\n     * bitmask.  On write set only one bit - setting multiple bits may cause the\n     * chunk to be written in multiple places.\n     */\n    png_byte location; /* mode of operation at read time */\n}\npng_unknown_chunk;\n\ntypedef png_unknown_chunk * png_unknown_chunkp;\ntypedef const png_unknown_chunk * png_const_unknown_chunkp;\ntypedef png_unknown_chunk * * png_unknown_chunkpp;\n#endif\n\n/* Flag values for the unknown chunk location byte. */\n#define PNG_HAVE_IHDR  0x01\n#define PNG_HAVE_PLTE  0x02\n#define PNG_AFTER_IDAT 0x08\n\n/* Maximum positive integer used in PNG is (2^31)-1 */\n#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)\n#define PNG_UINT_32_MAX ((png_uint_32)(-1))\n#define PNG_SIZE_MAX ((png_size_t)(-1))\n\n/* These are constants for fixed point values encoded in the\n * PNG specification manner (x100000)\n */\n#define PNG_FP_1    100000\n#define PNG_FP_HALF  50000\n#define PNG_FP_MAX  ((png_fixed_point)0x7fffffffL)\n#define PNG_FP_MIN  (-PNG_FP_MAX)\n\n/* These describe the color_type field in png_info. */\n/* color type masks */\n#define PNG_COLOR_MASK_PALETTE    1\n#define PNG_COLOR_MASK_COLOR      2\n#define PNG_COLOR_MASK_ALPHA      4\n\n/* color types.  Note that not all combinations are legal */\n#define PNG_COLOR_TYPE_GRAY 0\n#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)\n#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)\n#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)\n#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)\n/* aliases */\n#define PNG_COLOR_TYPE_RGBA  PNG_COLOR_TYPE_RGB_ALPHA\n#define PNG_COLOR_TYPE_GA  PNG_COLOR_TYPE_GRAY_ALPHA\n\n/* This is for compression type. PNG 1.0-1.2 only define the single type. */\n#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */\n#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE\n\n/* This is for filter type. PNG 1.0-1.2 only define the single type. */\n#define PNG_FILTER_TYPE_BASE      0 /* Single row per-byte filtering */\n#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */\n#define PNG_FILTER_TYPE_DEFAULT   PNG_FILTER_TYPE_BASE\n\n/* These are for the interlacing type.  These values should NOT be changed. */\n#define PNG_INTERLACE_NONE        0 /* Non-interlaced image */\n#define PNG_INTERLACE_ADAM7       1 /* Adam7 interlacing */\n#define PNG_INTERLACE_LAST        2 /* Not a valid value */\n\n/* These are for the oFFs chunk.  These values should NOT be changed. */\n#define PNG_OFFSET_PIXEL          0 /* Offset in pixels */\n#define PNG_OFFSET_MICROMETER     1 /* Offset in micrometers (1/10^6 meter) */\n#define PNG_OFFSET_LAST           2 /* Not a valid value */\n\n/* These are for the pCAL chunk.  These values should NOT be changed. */\n#define PNG_EQUATION_LINEAR       0 /* Linear transformation */\n#define PNG_EQUATION_BASE_E       1 /* Exponential base e transform */\n#define PNG_EQUATION_ARBITRARY    2 /* Arbitrary base exponential transform */\n#define PNG_EQUATION_HYPERBOLIC   3 /* Hyperbolic sine transformation */\n#define PNG_EQUATION_LAST         4 /* Not a valid value */\n\n/* These are for the sCAL chunk.  These values should NOT be changed. */\n#define PNG_SCALE_UNKNOWN         0 /* unknown unit (image scale) */\n#define PNG_SCALE_METER           1 /* meters per pixel */\n#define PNG_SCALE_RADIAN          2 /* radians per pixel */\n#define PNG_SCALE_LAST            3 /* Not a valid value */\n\n/* These are for the pHYs chunk.  These values should NOT be changed. */\n#define PNG_RESOLUTION_UNKNOWN    0 /* pixels/unknown unit (aspect ratio) */\n#define PNG_RESOLUTION_METER      1 /* pixels/meter */\n#define PNG_RESOLUTION_LAST       2 /* Not a valid value */\n\n/* These are for the sRGB chunk.  These values should NOT be changed. */\n#define PNG_sRGB_INTENT_PERCEPTUAL 0\n#define PNG_sRGB_INTENT_RELATIVE   1\n#define PNG_sRGB_INTENT_SATURATION 2\n#define PNG_sRGB_INTENT_ABSOLUTE   3\n#define PNG_sRGB_INTENT_LAST       4 /* Not a valid value */\n\n/* This is for text chunks */\n#define PNG_KEYWORD_MAX_LENGTH     79\n\n/* Maximum number of entries in PLTE/sPLT/tRNS arrays */\n#define PNG_MAX_PALETTE_LENGTH    256\n\n/* These determine if an ancillary chunk's data has been successfully read\n * from the PNG header, or if the application has filled in the corresponding\n * data in the info_struct to be written into the output file.  The values\n * of the PNG_INFO_<chunk> defines should NOT be changed.\n */\n#define PNG_INFO_gAMA 0x0001\n#define PNG_INFO_sBIT 0x0002\n#define PNG_INFO_cHRM 0x0004\n#define PNG_INFO_PLTE 0x0008\n#define PNG_INFO_tRNS 0x0010\n#define PNG_INFO_bKGD 0x0020\n#define PNG_INFO_hIST 0x0040\n#define PNG_INFO_pHYs 0x0080\n#define PNG_INFO_oFFs 0x0100\n#define PNG_INFO_tIME 0x0200\n#define PNG_INFO_pCAL 0x0400\n#define PNG_INFO_sRGB 0x0800   /* GR-P, 0.96a */\n#define PNG_INFO_iCCP 0x1000   /* ESR, 1.0.6 */\n#define PNG_INFO_sPLT 0x2000   /* ESR, 1.0.6 */\n#define PNG_INFO_sCAL 0x4000   /* ESR, 1.0.6 */\n#define PNG_INFO_IDAT 0x8000   /* ESR, 1.0.6 */\n\n/* This is used for the transformation routines, as some of them\n * change these values for the row.  It also should enable using\n * the routines for other purposes.\n */\ntypedef struct png_row_info_struct\n{\n   png_uint_32 width;    /* width of row */\n   png_size_t rowbytes;  /* number of bytes in row */\n   png_byte color_type;  /* color type of row */\n   png_byte bit_depth;   /* bit depth of row */\n   png_byte channels;    /* number of channels (1, 2, 3, or 4) */\n   png_byte pixel_depth; /* bits per pixel (depth * channels) */\n} png_row_info;\n\ntypedef png_row_info * png_row_infop;\ntypedef png_row_info * * png_row_infopp;\n\n/* These are the function types for the I/O functions and for the functions\n * that allow the user to override the default I/O functions with his or her\n * own.  The png_error_ptr type should match that of user-supplied warning\n * and error functions, while the png_rw_ptr type should match that of the\n * user read/write data functions.  Note that the 'write' function must not\n * modify the buffer it is passed. The 'read' function, on the other hand, is\n * expected to return the read data in the buffer.\n */\ntypedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));\ntypedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t));\ntypedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));\ntypedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,\n    int));\ntypedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32,\n    int));\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\ntypedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop));\ntypedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop));\n\n/* The following callback receives png_uint_32 row_number, int pass for the\n * png_bytep data of the row.  When transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\ntypedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep,\n    png_uint_32, int));\n#endif\n\n#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \\\n    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)\ntypedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop,\n    png_bytep));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\ntypedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,\n    png_unknown_chunkp));\n#endif\n#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED\n/* not used anywhere */\n/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n/* This must match the function definition in <setjmp.h>, and the application\n * must include this before png.h to obtain the definition of jmp_buf.  The\n * function is required to be PNG_NORETURN, but this is not checked.  If the\n * function does return the application will crash via an abort() or similar\n * system level call.\n *\n * If you get a warning here while building the library you may need to make\n * changes to ensure that pnglibconf.h records the calling convention used by\n * your compiler.  This may be very difficult - try using a different compiler\n * to build the library!\n */\nPNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);\n#endif\n\n/* Transform masks for the high-level interface */\n#define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */\n#define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */\n#define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */\n#define PNG_TRANSFORM_PACKING        0x0004    /* read and write */\n#define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */\n#define PNG_TRANSFORM_EXPAND         0x0010    /* read only */\n#define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */\n#define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */\n#define PNG_TRANSFORM_BGR            0x0080    /* read and write */\n#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */\n#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */\n#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */\n#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* write only */\n/* Added to libpng-1.2.34 */\n#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER\n#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */\n/* Added to libpng-1.4.0 */\n#define PNG_TRANSFORM_GRAY_TO_RGB   0x2000      /* read only */\n/* Added to libpng-1.5.4 */\n#define PNG_TRANSFORM_EXPAND_16     0x4000      /* read only */\n#define PNG_TRANSFORM_SCALE_16      0x8000      /* read only */\n\n/* Flags for MNG supported features */\n#define PNG_FLAG_MNG_EMPTY_PLTE     0x01\n#define PNG_FLAG_MNG_FILTER_64      0x04\n#define PNG_ALL_MNG_FEATURES        0x05\n\n/* NOTE: prior to 1.5 these functions had no 'API' style declaration,\n * this allowed the zlib default functions to be used on Windows\n * platforms.  In 1.5 the zlib default malloc (which just calls malloc and\n * ignores the first argument) should be completely compatible with the\n * following.\n */\ntypedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,\n    png_alloc_size_t));\ntypedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp));\n\n/* Section 3: exported functions\n * Here are the function definitions most commonly used.  This is not\n * the place to find out how to use libpng.  See libpng-manual.txt for the\n * full explanation, see example.c for the summary.  This just provides\n * a simple one line description of the use of each function.\n *\n * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in\n * pngconf.h and in the *.dfn files in the scripts directory.\n *\n *   PNG_EXPORT(ordinal, type, name, (args));\n *\n *       ordinal:    ordinal that is used while building\n *                   *.def files. The ordinal value is only\n *                   relevant when preprocessing png.h with\n *                   the *.dfn files for building symbol table\n *                   entries, and are removed by pngconf.h.\n *       type:       return type of the function\n *       name:       function name\n *       args:       function arguments, with types\n *\n * When we wish to append attributes to a function prototype we use\n * the PNG_EXPORTA() macro instead.\n *\n *   PNG_EXPORTA(ordinal, type, name, (args), attributes);\n *\n *       ordinal, type, name, and args: same as in PNG_EXPORT().\n *       attributes: function attributes\n */\n\n/* Returns the version number of the library */\nPNG_EXPORT(1, png_uint_32, png_access_version_number, (void));\n\n/* Tell lib we have already handled the first <num_bytes> magic bytes.\n * Handling more than 8 bytes from the beginning of the file is an error.\n */\nPNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));\n\n/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a\n * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG\n * signature, and non-zero otherwise.  Having num_to_check == 0 or\n * start > 7 will always fail (ie return non-zero).\n */\nPNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,\n    png_size_t num_to_check));\n\n/* Simple signature checking function.  This is the same as calling\n * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).\n */\n#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))\n\n/* Allocate and initialize png_ptr struct for reading, and any other memory. */\nPNG_EXPORTA(4, png_structp, png_create_read_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr,\n    png_error_ptr error_fn, png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\n/* Allocate and initialize png_ptr struct for writing, and any other memory */\nPNG_EXPORTA(5, png_structp, png_create_write_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\nPNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,\n    (png_const_structrp png_ptr));\n\nPNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,\n    png_size_t size));\n\n/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp\n * match up.\n */\n#ifdef PNG_SETJMP_SUPPORTED\n/* This function returns the jmp_buf built in to *png_ptr.  It must be\n * supplied with an appropriate 'longjmp' function to use on that jmp_buf\n * unless the default error function is overridden in which case NULL is\n * acceptable.  The size of the jmp_buf is checked against the actual size\n * allocated by the library - the call will return NULL on a mismatch\n * indicating an ABI mismatch.\n */\nPNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr,\n    png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));\n#  define png_jmpbuf(png_ptr) \\\n      (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))\n#else\n#  define png_jmpbuf(png_ptr) \\\n      (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)\n#endif\n/* This function should be used by libpng applications in place of\n * longjmp(png_ptr->jmpbuf, val).  If longjmp_fn() has been set, it\n * will use it; otherwise it will call PNG_ABORT().  This function was\n * added in libpng-1.5.0.\n */\nPNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val),\n    PNG_NORETURN);\n\n#ifdef PNG_READ_SUPPORTED\n/* Reset the compression stream */\nPNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED);\n#endif\n\n/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(11, png_structp, png_create_read_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\nPNG_EXPORTA(12, png_structp, png_create_write_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\n#endif\n\n/* Write the PNG file signature. */\nPNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));\n\n/* Write a PNG chunk - size, type, (optional) data, CRC. */\nPNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep\n    chunk_name, png_const_bytep data, png_size_t length));\n\n/* Write the start of a PNG chunk - length and chunk name. */\nPNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,\n    png_const_bytep chunk_name, png_uint_32 length));\n\n/* Write the data of a PNG chunk started with png_write_chunk_start(). */\nPNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,\n    png_const_bytep data, png_size_t length));\n\n/* Finish a chunk started with png_write_chunk_start() (includes CRC). */\nPNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));\n\n/* Allocate and initialize the info structure */\nPNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),\n    PNG_ALLOCATED);\n\n/* DEPRECATED: this function allowed init structures to be created using the\n * default allocation method (typically malloc).  Use is deprecated in 1.6.0 and\n * the API will be removed in the future.\n */\nPNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,\n    png_size_t png_info_struct_size), PNG_DEPRECATED);\n\n/* Writes all the PNG information before the image. */\nPNG_EXPORT(20, void, png_write_info_before_PLTE,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(21, void, png_write_info,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the information before the actual image data. */\nPNG_EXPORT(22, void, png_read_info,\n    (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n#ifdef PNG_TIME_RFC1123_SUPPORTED\n   /* Convert to a US string format: there is no localization support in this\n    * routine.  The original implementation used a 29 character buffer in\n    * png_struct, this will be removed in future versions.\n    */\n#if PNG_LIBPNG_VER < 10700\n/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */\nPNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr,\n    png_const_timep ptime),PNG_DEPRECATED);\n#endif\nPNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29],\n    png_const_timep ptime));\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n/* Convert from a struct tm to png_time */\nPNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,\n    const struct tm * ttime));\n\n/* Convert from time_t to png_time.  Uses gmtime() */\nPNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime));\n#endif /* PNG_CONVERT_tIME_SUPPORTED */\n\n#ifdef PNG_READ_EXPAND_SUPPORTED\n/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */\nPNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr));\nPNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr));\nPNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr));\nPNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_EXPAND_16_SUPPORTED\n/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion\n * of a tRNS chunk if present.\n */\nPNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)\n/* Use blue, green, red order for pixels. */\nPNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED\n/* Expand the grayscale to 24-bit RGB if necessary. */\nPNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED\n/* Reduce RGB to grayscale. */\n#define PNG_ERROR_ACTION_NONE  1\n#define PNG_ERROR_ACTION_WARN  2\n#define PNG_ERROR_ACTION_ERROR 3\n#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/\n\nPNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr,\n    int error_action, double red, double green))\nPNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr,\n    int error_action, png_fixed_point red, png_fixed_point green))\n\nPNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp\n    png_ptr));\n#endif\n\n#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\nPNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,\n    png_colorp palette));\n#endif\n\n#ifdef PNG_READ_ALPHA_MODE_SUPPORTED\n/* How the alpha channel is interpreted - this affects how the color channels of\n * a PNG file are returned when an alpha channel, or tRNS chunk in a palette\n * file, is present.\n *\n * This has no effect on the way pixels are written into a PNG output\n * datastream. The color samples in a PNG datastream are never premultiplied\n * with the alpha samples.\n *\n * The default is to return data according to the PNG specification: the alpha\n * channel is a linear measure of the contribution of the pixel to the\n * corresponding composited pixel.  The gamma encoded color channels must be\n * scaled according to the contribution and to do this it is necessary to undo\n * the encoding, scale the color values, perform the composition and reencode\n * the values.  This is the 'PNG' mode.\n *\n * The alternative is to 'associate' the alpha with the color information by\n * storing color channel values that have been scaled by the alpha.  The\n * advantage is that the color channels can be resampled (the image can be\n * scaled) in this form.  The disadvantage is that normal practice is to store\n * linear, not (gamma) encoded, values and this requires 16-bit channels for\n * still images rather than the 8-bit channels that are just about sufficient if\n * gamma encoding is used.  In addition all non-transparent pixel values,\n * including completely opaque ones, must be gamma encoded to produce the final\n * image.  This is the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' mode (the\n * latter being the two common names for associated alpha color channels.)\n *\n * Since it is not necessary to perform arithmetic on opaque color values so\n * long as they are not to be resampled and are in the final color space it is\n * possible to optimize the handling of alpha by storing the opaque pixels in\n * the PNG format (adjusted for the output color space) while storing partially\n * opaque pixels in the standard, linear, format.  The accuracy required for\n * standard alpha composition is relatively low, because the pixels are\n * isolated, therefore typically the accuracy loss in storing 8-bit linear\n * values is acceptable.  (This is not true if the alpha channel is used to\n * simulate transparency over large areas - use 16 bits or the PNG mode in\n * this case!)  This is the 'OPTIMIZED' mode.  For this mode a pixel is\n * treated as opaque only if the alpha value is equal to the maximum value.\n *\n * The final choice is to gamma encode the alpha channel as well.  This is\n * broken because, in practice, no implementation that uses this choice\n * correctly undoes the encoding before handling alpha composition.  Use this\n * choice only if other serious errors in the software or hardware you use\n * mandate it; the typical serious error is for dark halos to appear around\n * opaque areas of the composited PNG image because of arithmetic overflow.\n *\n * The API function png_set_alpha_mode specifies which of these choices to use\n * with an enumerated 'mode' value and the gamma of the required output:\n */\n#define PNG_ALPHA_PNG           0 /* according to the PNG standard */\n#define PNG_ALPHA_STANDARD      1 /* according to Porter/Duff */\n#define PNG_ALPHA_ASSOCIATED    1 /* as above; this is the normal practice */\n#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */\n#define PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */\n#define PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */\n\nPNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode,\n    double output_gamma))\nPNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,\n    int mode, png_fixed_point output_gamma))\n#endif\n\n#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)\n/* The output_gamma value is a screen gamma in libpng terminology: it expresses\n * how to decode the output values, not how they are encoded.  The values used\n * correspond to the normal numbers used to describe the overall gamma of a\n * computer display system; for example 2.2 for an sRGB conformant system.  The\n * values are scaled by 100000 in the _fixed version of the API (so 220000 for\n * sRGB.)\n *\n * The inverse of the value is always used to provide a default for the PNG file\n * encoding if it has no gAMA chunk and if png_set_gamma() has not been called\n * to override the PNG gamma information.\n *\n * When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode\n * opaque pixels however pixels with lower alpha values are not encoded,\n * regardless of the output gamma setting.\n *\n * When the standard Porter Duff handling is requested with mode 1 the output\n * encoding is set to be linear and the output_gamma value is only relevant\n * as a default for input data that has no gamma information.  The linear output\n * encoding will be overridden if png_set_gamma() is called - the results may be\n * highly unexpected!\n *\n * The following numbers are derived from the sRGB standard and the research\n * behind it.  sRGB is defined to be approximated by a PNG gAMA chunk value of\n * 0.45455 (1/2.2) for PNG.  The value implicitly includes any viewing\n * correction required to take account of any differences in the color\n * environment of the original scene and the intended display environment; the\n * value expresses how to *decode* the image for display, not how the original\n * data was *encoded*.\n *\n * sRGB provides a peg for the PNG standard by defining a viewing environment.\n * sRGB itself, and earlier TV standards, actually use a more complex transform\n * (a linear portion then a gamma 2.4 power law) than PNG can express.  (PNG is\n * limited to simple power laws.)  By saying that an image for direct display on\n * an sRGB conformant system should be stored with a gAMA chunk value of 45455\n * (11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification\n * makes it possible to derive values for other display systems and\n * environments.\n *\n * The Mac value is deduced from the sRGB based on an assumption that the actual\n * extra viewing correction used in early Mac display systems was implemented as\n * a power 1.45 lookup table.\n *\n * Any system where a programmable lookup table is used or where the behavior of\n * the final display device characteristics can be changed requires system\n * specific code to obtain the current characteristic.  However this can be\n * difficult and most PNG gamma correction only requires an approximate value.\n *\n * By default, if png_set_alpha_mode() is not called, libpng assumes that all\n * values are unencoded, linear, values and that the output device also has a\n * linear characteristic.  This is only very rarely correct - it is invariably\n * better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the\n * default if you don't know what the right answer is!\n *\n * The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS\n * 10.6) which used a correction table to implement a somewhat lower gamma on an\n * otherwise sRGB system.\n *\n * Both these values are reserved (not simple gamma values) in order to allow\n * more precise correction internally in the future.\n *\n * NOTE: the following values can be passed to either the fixed or floating\n * point APIs, but the floating point API will also accept floating point\n * values.\n */\n#define PNG_DEFAULT_sRGB -1       /* sRGB gamma and color space */\n#define PNG_GAMMA_MAC_18 -2       /* Old Mac '1.8' gamma and color space */\n#define PNG_GAMMA_sRGB   220000   /* Television standards--matches sRGB gamma */\n#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */\n#endif\n\n/* The following are examples of calls to png_set_alpha_mode to achieve the\n * required overall gamma correction and, where necessary, alpha\n * premultiplication.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n *    This is the default libpng handling of the alpha channel - it is not\n *    pre-multiplied into the color components.  In addition the call states\n *    that the output is for a sRGB system and causes all PNG files without gAMA\n *    chunks to be assumed to be encoded using sRGB.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    In this case the output is assumed to be something like an sRGB conformant\n *    display preceeded by a power-law lookup table of power 1.45.  This is how\n *    early Mac systems behaved.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);\n *    This is the classic Jim Blinn approach and will work in academic\n *    environments where everything is done by the book.  It has the shortcoming\n *    of assuming that input PNG data with no gamma information is linear - this\n *    is unlikely to be correct unless the PNG files where generated locally.\n *    Most of the time the output precision will be so low as to show\n *    significant banding in dark areas of the image.\n *\n * png_set_expand_16(pp);\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB);\n *    This is a somewhat more realistic Jim Blinn inspired approach.  PNG files\n *    are assumed to have the sRGB encoding if not marked with a gamma value and\n *    the output is always 16 bits per component.  This permits accurate scaling\n *    and processing of the data.  If you know that your input PNG files were\n *    generated locally you might need to replace PNG_DEFAULT_sRGB with the\n *    correct value for your system.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB);\n *    If you just need to composite the PNG image onto an existing background\n *    and if you control the code that does this you can use the optimization\n *    setting.  In this case you just copy completely opaque pixels to the\n *    output.  For pixels that are not completely transparent (you just skip\n *    those) you do the composition math using png_composite or png_composite_16\n *    below then encode the resultant 8-bit or 16-bit values to match the output\n *    encoding.\n *\n * Other cases\n *    If neither the PNG nor the standard linear encoding work for you because\n *    of the software or hardware you use then you have a big problem.  The PNG\n *    case will probably result in halos around the image.  The linear encoding\n *    will probably result in a washed out, too bright, image (it's actually too\n *    contrasty.)  Try the ALPHA_OPTIMIZED mode above - this will probably\n *    substantially reduce the halos.  Alternatively try:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB);\n *    This option will also reduce the halos, but there will be slight dark\n *    halos round the opaque parts of the image where the background is light.\n *    In the OPTIMIZED mode the halos will be light halos where the background\n *    is dark.  Take your pick - the halos are unavoidable unless you can get\n *    your hardware/software fixed!  (The OPTIMIZED approach is slightly\n *    faster.)\n *\n * When the default gamma of PNG files doesn't match the output gamma.\n *    If you have PNG files with no gamma information png_set_alpha_mode allows\n *    you to provide a default gamma, but it also sets the ouput gamma to the\n *    matching value.  If you know your PNG files have a gamma that doesn't\n *    match the output you can take advantage of the fact that\n *    png_set_alpha_mode always sets the output gamma but only sets the PNG\n *    default if it is not already set:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    The first call sets both the default and the output gamma values, the\n *    second call overrides the output gamma without changing the default.  This\n *    is easier than achieving the same effect with png_set_gamma.  You must use\n *    PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will\n *    fire if more than one call to png_set_alpha_mode and png_set_background is\n *    made in the same read operation, however multiple calls with PNG_ALPHA_PNG\n *    are ignored.\n */\n\n#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED\nPNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)\nPNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)\nPNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)\n/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler,\n    int flags));\n/* The values of the PNG_FILLER_ defines should NOT be changed */\n#  define PNG_FILLER_BEFORE 0\n#  define PNG_FILLER_AFTER 1\n/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr,\n    png_uint_32 filler, int flags));\n#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */\n\n#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)\n/* Swap bytes in 16-bit depth files. */\nPNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)\n/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */\nPNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \\\n    defined(PNG_WRITE_PACKSWAP_SUPPORTED)\n/* Swap packing order of pixels in bytes. */\nPNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)\n/* Converts files to legal bit depths. */\nPNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p\n    true_bits));\n#endif\n\n#if defined(PNG_READ_INTERLACING_SUPPORTED) || \\\n    defined(PNG_WRITE_INTERLACING_SUPPORTED)\n/* Have the code handle the interlacing.  Returns the number of passes.\n * MUST be called before png_read_update_info or png_start_read_image,\n * otherwise it will not have the desired effect.  Note that it is still\n * necessary to call png_read_row or png_read_rows png_get_image_height\n * times for each pass.\n*/\nPNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)\n/* Invert monochrome files */\nPNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n/* Handle alpha and tRNS by replacing with a background color.  Prior to\n * libpng-1.5.4 this API must not be called before the PNG file header has been\n * read.  Doing so will result in unexpected behavior and possible warnings or\n * errors if the PNG file contains a bKGD chunk.\n */\nPNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, double background_gamma))\nPNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, png_fixed_point background_gamma))\n#endif\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n#  define PNG_BACKGROUND_GAMMA_UNKNOWN 0\n#  define PNG_BACKGROUND_GAMMA_SCREEN  1\n#  define PNG_BACKGROUND_GAMMA_FILE    2\n#  define PNG_BACKGROUND_GAMMA_UNIQUE  3\n#endif\n\n#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED\n/* Scale a 16-bit depth file down to 8-bit, accurately. */\nPNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */\n/* Strip the second byte of information from a 16-bit depth file. */\nPNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_QUANTIZE_SUPPORTED\n/* Turn on quantizing, and reduce the palette to the number of colors\n * available.\n */\nPNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr,\n    png_colorp palette, int num_palette, int maximum_colors,\n    png_const_uint_16p histogram, int full_quantize));\n#endif\n\n#ifdef PNG_READ_GAMMA_SUPPORTED\n/* The threshold on gamma processing is configurable but hard-wired into the\n * library.  The following is the floating point variant.\n */\n#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001)\n\n/* Handle gamma correction. Screen_gamma=(display_exponent).\n * NOTE: this API simply sets the screen and file gamma values. It will\n * therefore override the value for gamma in a PNG file if it is called after\n * the file header has been read - use with care  - call before reading the PNG\n * file for best results!\n *\n * These routines accept the same gamma values as png_set_alpha_mode (described\n * above).  The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either\n * API (floating point or fixed.)  Notice, however, that the 'file_gamma' value\n * is the inverse of a 'screen gamma' value.\n */\nPNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr,\n    double screen_gamma, double override_file_gamma))\nPNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr,\n    png_fixed_point screen_gamma, png_fixed_point override_file_gamma))\n#endif\n\n#ifdef PNG_WRITE_FLUSH_SUPPORTED\n/* Set how many lines between output flushes - 0 for no flushing */\nPNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows));\n/* Flush the current PNG output buffer */\nPNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr));\n#endif\n\n/* Optional update palette with requested transformations */\nPNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr));\n\n/* Optional call to update the users info structure */\nPNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read one or more rows of image data. */\nPNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row,\n    png_bytepp display_row, png_uint_32 num_rows));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read a row of data. */\nPNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row,\n    png_bytep display_row));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the whole image into memory at once. */\nPNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image));\n#endif\n\n/* Write a row of image data */\nPNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr,\n    png_const_bytep row));\n\n/* Write a few rows of image data: (*row) is not written; however, the type\n * is declared as writeable to maintain compatibility with previous versions\n * of libpng and to allow the 'display_row' array from read_rows to be passed\n * unchanged to write_rows.\n */\nPNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row,\n    png_uint_32 num_rows));\n\n/* Write the image data */\nPNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image));\n\n/* Write the end of the PNG file. */\nPNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the end of the PNG file. */\nPNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n/* Free any memory associated with the png_info_struct */\nPNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Set the libpng method of handling chunk CRC errors */\nPNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,\n    int ancil_action));\n\n/* Values for png_set_crc_action() say how to handle CRC errors in\n * ancillary and critical chunks, and whether to use the data contained\n * therein.  Note that it is impossible to \"discard\" data in a critical\n * chunk.  For versions prior to 0.90, the action was always error/quit,\n * whereas in version 0.90 and later, the action for CRC errors in ancillary\n * chunks is warn/discard.  These values should NOT be changed.\n *\n *      value                       action:critical     action:ancillary\n */\n#define PNG_CRC_DEFAULT       0  /* error/quit          warn/discard data */\n#define PNG_CRC_ERROR_QUIT    1  /* error/quit          error/quit        */\n#define PNG_CRC_WARN_DISCARD  2  /* (INVALID)           warn/discard data */\n#define PNG_CRC_WARN_USE      3  /* warn/use data       warn/use data     */\n#define PNG_CRC_QUIET_USE     4  /* quiet/use data      quiet/use data    */\n#define PNG_CRC_NO_CHANGE     5  /* use current value   use current value */\n\n/* These functions give the user control over the scan-line filtering in\n * libpng and the compression methods used by zlib.  These functions are\n * mainly useful for testing, as the defaults should work with most users.\n * Those users who are tight on memory or want faster performance at the\n * expense of compression can modify them.  See the compression library\n * header file (zlib.h) for an explination of the compression functions.\n */\n\n/* Set the filtering method(s) used by libpng.  Currently, the only valid\n * value for \"method\" is 0.\n */\nPNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,\n    int filters));\n\n/* Flags for png_set_filter() to say which filters to use.  The flags\n * are chosen so that they don't conflict with real filter types\n * below, in case they are supplied instead of the #defined constants.\n * These values should NOT be changed.\n */\n#define PNG_NO_FILTERS     0x00\n#define PNG_FILTER_NONE    0x08\n#define PNG_FILTER_SUB     0x10\n#define PNG_FILTER_UP      0x20\n#define PNG_FILTER_AVG     0x40\n#define PNG_FILTER_PAETH   0x80\n#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \\\n                         PNG_FILTER_AVG | PNG_FILTER_PAETH)\n\n/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.\n * These defines should NOT be changed.\n */\n#define PNG_FILTER_VALUE_NONE  0\n#define PNG_FILTER_VALUE_SUB   1\n#define PNG_FILTER_VALUE_UP    2\n#define PNG_FILTER_VALUE_AVG   3\n#define PNG_FILTER_VALUE_PAETH 4\n#define PNG_FILTER_VALUE_LAST  5\n\n#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */\n/* The \"heuristic_method\" is given by one of the PNG_FILTER_HEURISTIC_\n * defines, either the default (minimum-sum-of-absolute-differences), or\n * the experimental method (weighted-minimum-sum-of-absolute-differences).\n *\n * Weights are factors >= 1.0, indicating how important it is to keep the\n * filter type consistent between rows.  Larger numbers mean the current\n * filter is that many times as likely to be the same as the \"num_weights\"\n * previous filters.  This is cumulative for each previous row with a weight.\n * There needs to be \"num_weights\" values in \"filter_weights\", or it can be\n * NULL if the weights aren't being specified.  Weights have no influence on\n * the selection of the first row filter.  Well chosen weights can (in theory)\n * improve the compression for a given image.\n *\n * Costs are factors >= 1.0 indicating the relative decoding costs of a\n * filter type.  Higher costs indicate more decoding expense, and are\n * therefore less likely to be selected over a filter with lower computational\n * costs.  There needs to be a value in \"filter_costs\" for each valid filter\n * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't\n * setting the costs.  Costs try to improve the speed of decompression without\n * unduly increasing the compressed image size.\n *\n * A negative weight or cost indicates the default value is to be used, and\n * values in the range [0.0, 1.0) indicate the value is to remain unchanged.\n * The default values for both weights and costs are currently 1.0, but may\n * change if good general weighting/cost heuristics can be found.  If both\n * the weights and costs are set to 1.0, this degenerates the WEIGHTED method\n * to the UNWEIGHTED method, but with added encoding time/computation.\n */\nPNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr,\n    int heuristic_method, int num_weights, png_const_doublep filter_weights,\n    png_const_doublep filter_costs))\nPNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,\n    (png_structrp png_ptr, int heuristic_method, int num_weights,\n    png_const_fixed_point_p filter_weights,\n    png_const_fixed_point_p filter_costs))\n#endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */\n\n/* Heuristic used for row filter selection.  These defines should NOT be\n * changed.\n */\n#define PNG_FILTER_HEURISTIC_DEFAULT    0  /* Currently \"UNWEIGHTED\" */\n#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1  /* Used by libpng < 0.95 */\n#define PNG_FILTER_HEURISTIC_WEIGHTED   2  /* Experimental feature */\n#define PNG_FILTER_HEURISTIC_LAST       3  /* Not a valid value */\n\n#ifdef PNG_WRITE_SUPPORTED\n/* Set the library compression level.  Currently, valid values range from\n * 0 - 9, corresponding directly to the zlib compression levels 0 - 9\n * (0 - no compression, 9 - \"maximal\" compression).  Note that tests have\n * shown that zlib compression levels 3-6 usually perform as well as level 9\n * for PNG images, and do considerably fewer caclulations.  In the future,\n * these values may not correspond directly to the zlib compression levels.\n */\nPNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr,\n    int window_bits));\n\nPNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr,\n    int method));\n#endif\n\n#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n/* Also set zlib parameters for compressing non-IDAT chunks */\nPNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(225, void, png_set_text_compression_window_bits,\n    (png_structrp png_ptr, int window_bits));\n\nPNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,\n    int method));\n#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */\n\n/* These next functions are called for input/output, memory, and error\n * handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,\n * and call standard C I/O routines such as fread(), fwrite(), and\n * fprintf().  These functions can be made to use other I/O routines\n * at run time for those applications that need to handle I/O in a\n * different manner by calling png_set_???_fn().  See libpng-manual.txt for\n * more information.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n/* Initialize the input/output for the PNG file to the default functions. */\nPNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));\n#endif\n\n/* Replace the (error and abort), and warning functions with user\n * supplied functions.  If no messages are to be printed you must still\n * write and use replacement functions. The replacement error_fn should\n * still do a longjmp to the last setjmp location if you are using this\n * method of error handling.  If error_fn or warning_fn is NULL, the\n * default function will be used.\n */\n\nPNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr,\n    png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));\n\n/* Return the user pointer associated with the error functions */\nPNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr));\n\n/* Replace the default data output functions with a user supplied one(s).\n * If buffered output is not used, then output_flush_fn can be set to NULL.\n * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time\n * output_flush_fn will be ignored (and thus can be NULL).\n * It is probably a mistake to use NULL for output_flush_fn if\n * write_data_fn is not also NULL unless you have built libpng with\n * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's\n * default flush function, which uses the standard *FILE structure, will\n * be used.\n */\nPNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));\n\n/* Replace the default data input function with a user supplied one. */\nPNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr read_data_fn));\n\n/* Return the user pointer associated with the I/O functions */\nPNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr));\n\nPNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr,\n    png_read_status_ptr read_row_fn));\n\nPNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr,\n    png_write_status_ptr write_row_fn));\n\n#ifdef PNG_USER_MEM_SUPPORTED\n/* Replace the default memory allocation functions with user supplied one(s). */\nPNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr,\n    png_malloc_ptr malloc_fn, png_free_ptr free_fn));\n/* Return the user pointer associated with the memory functions */\nPNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr read_user_transform_fn));\n#endif\n\n#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr write_user_transform_fn));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED\nPNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr,\n    png_voidp user_transform_ptr, int user_transform_depth,\n    int user_transform_channels));\n/* Return the user pointer associated with the user transform functions */\nPNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,\n    (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED\n/* Return information about the row currently being processed.  Note that these\n * APIs do not fail but will return unexpected results if called outside a user\n * transform callback.  Also note that when transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\nPNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp));\nPNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));\n#endif\n\n#ifdef PNG_READ_USER_CHUNKS_SUPPORTED\n/* This callback is called only for *unknown* chunks.  If\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known\n * chunks to be treated as unknown, however in this case the callback must do\n * any processing required by the chunk (e.g. by calling the appropriate\n * png_set_ APIs.)\n *\n * There is no write support - on write, by default, all the chunks in the\n * 'unknown' list are written in the specified position.\n *\n * The integer return from the callback function is interpreted thus:\n *\n * negative: An error occured, png_chunk_error will be called.\n *     zero: The chunk was not handled, the chunk will be saved. A critical\n *           chunk will cause an error at this point unless it is to be saved.\n * positive: The chunk was handled, libpng will ignore/discard it.\n *\n * See \"INTERACTION WTIH USER CHUNK CALLBACKS\" below for important notes about\n * how this behavior will change in libpng 1.7\n */\nPNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,\n    png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\nPNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\n/* Sets the function callbacks for the push reader, and a pointer to a\n * user-defined structure available to the callback functions.\n */\nPNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr,\n    png_voidp progressive_ptr, png_progressive_info_ptr info_fn,\n    png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));\n\n/* Returns the user pointer associated with the push read functions */\nPNG_EXPORT(91, png_voidp, png_get_progressive_ptr,\n    (png_const_structrp png_ptr));\n\n/* Function to be called when data becomes available */\nPNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,\n    png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size));\n\n/* A function which may be called *only* within png_process_data to stop the\n * processing of any more data.  The function returns the number of bytes\n * remaining, excluding any that libpng has cached internally.  A subsequent\n * call to png_process_data must supply these bytes again.  If the argument\n * 'save' is set to true the routine will first save all the pending data and\n * will always return 0.\n */\nPNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));\n\n/* A function which may be called *only* outside (after) a call to\n * png_process_data.  It returns the number of bytes of data to skip in the\n * input.  Normally it will return 0, but if it returns a non-zero value the\n * application must skip than number of bytes of input data and pass the\n * following data to the next call to png_process_data.\n */\nPNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));\n\n#ifdef PNG_READ_INTERLACING_SUPPORTED\n/* Function that combines rows.  'new_row' is a flag that should come from\n * the callback and be non-NULL if anything needs to be done; the library\n * stores its own version of the new data internally and ignores the passed\n * in value.\n */\nPNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr,\n    png_bytep old_row, png_const_bytep new_row));\n#endif /* PNG_READ_INTERLACING_SUPPORTED */\n#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */\n\nPNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n/* Added at libpng version 1.4.0 */\nPNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Added at libpng version 1.2.4 */\nPNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Frees a pointer allocated by png_malloc() */\nPNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));\n\n/* Free data that was allocated internally */\nPNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 free_me, int num));\n\n/* Reassign responsibility for freeing existing data, whether allocated\n * by libpng or by the application; this works on the png_info structure passed\n * in, it does not change the state for other png_info structures.\n *\n * It is unlikely that this function works correctly as of 1.6.0 and using it\n * may result either in memory leaks or double free of allocated data.\n */\nPNG_EXPORTA(99, void, png_data_freer, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int freer, png_uint_32 mask), PNG_DEPRECATED);\n\n/* Assignments for png_data_freer */\n#define PNG_DESTROY_WILL_FREE_DATA 1\n#define PNG_SET_WILL_FREE_DATA 1\n#define PNG_USER_WILL_FREE_DATA 2\n/* Flags for png_ptr->free_me and info_ptr->free_me */\n#define PNG_FREE_HIST 0x0008\n#define PNG_FREE_ICCP 0x0010\n#define PNG_FREE_SPLT 0x0020\n#define PNG_FREE_ROWS 0x0040\n#define PNG_FREE_PCAL 0x0080\n#define PNG_FREE_SCAL 0x0100\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#  define PNG_FREE_UNKN 0x0200\n#endif\n/*      PNG_FREE_LIST 0x0400    removed in 1.6.0 because it is ignored */\n#define PNG_FREE_PLTE 0x1000\n#define PNG_FREE_TRNS 0x2000\n#define PNG_FREE_TEXT 0x4000\n#define PNG_FREE_ALL  0x7fff\n#define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */\n\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED);\nPNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr,\n    png_voidp ptr), PNG_DEPRECATED);\n#endif\n\n#ifdef PNG_ERROR_TEXT_SUPPORTED\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n/* The same, but the chunk name is prepended to the error string. */\nPNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n#else\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);\n#endif\n\n#ifdef PNG_WARNINGS_SUPPORTED\n/* Non-fatal error in libpng.  Can continue, but may have a problem. */\nPNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n/* Non-fatal error in libpng, chunk name is prepended to message. */\nPNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\n#ifdef PNG_BENIGN_ERRORS_SUPPORTED\n/* Benign error in libpng.  Can continue, but may have a problem.\n * User can choose whether to handle as a fatal error or as a warning. */\nPNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n#ifdef PNG_READ_SUPPORTED\n/* Same, chunk name is prepended to message (only during read) */\nPNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\nPNG_EXPORT(109, void, png_set_benign_errors,\n    (png_structrp png_ptr, int allowed));\n#else\n#  ifdef PNG_ALLOW_BENIGN_ERRORS\n#    define png_benign_error png_warning\n#    define png_chunk_benign_error png_chunk_warning\n#  else\n#    define png_benign_error png_error\n#    define png_chunk_benign_error png_chunk_error\n#  endif\n#endif\n\n/* The png_set_<chunk> functions are for storing values in the png_info_struct.\n * Similarly, the png_get_<chunk> calls are used to read values from the\n * png_info_struct, either storing the parameters in the passed variables, or\n * setting pointers into the png_info_struct where the data is stored.  The\n * png_get_<chunk> functions return a non-zero value if the data was available\n * in info_ptr, or return zero and do not change any of the parameters if the\n * data was not available.\n *\n * These functions should be used instead of directly accessing png_info\n * to avoid problems with future changes in the size and internal layout of\n * png_info_struct.\n */\n/* Returns \"flag\" if chunk data is valid in info_ptr. */\nPNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 flag));\n\n/* Returns number of bytes needed to hold a transformed row. */\nPNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* Returns row_pointers, which is an array of pointers to scanlines that was\n * returned from png_read_png().\n */\nPNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Set row_pointers, which is an array of pointers to scanlines for use\n * by png_write_png().\n */\nPNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytepp row_pointers));\n#endif\n\n/* Returns number of color channels in image. */\nPNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_EASY_ACCESS_SUPPORTED\n/* Returns image width in pixels. */\nPNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image height in pixels. */\nPNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image bit_depth. */\nPNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image color_type. */\nPNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image filter_type. */\nPNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image interlace_type. */\nPNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image compression_type. */\nPNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image resolution in pixels per meter, from pHYs chunk data. */\nPNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n/* Returns pixel aspect ratio, computed from pHYs chunk data.  */\nPNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\nPNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n\n/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */\nPNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(128, png_int_32, png_get_x_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(129, png_int_32, png_get_y_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n#endif /* PNG_EASY_ACCESS_SUPPORTED */\n\n#ifdef PNG_READ_SUPPORTED\n/* Returns pointer to signature string read from PNG header */\nPNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_16p *background));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_16p background));\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x,\n    double *red_y, double *green_x, double *green_y, double *blue_x,\n    double *blue_y))\nPNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z,\n    double *green_X, double *green_Y, double *green_Z, double *blue_X,\n    double *blue_Y, double *blue_Z))\nPNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_white_x, png_fixed_point *int_white_y,\n    png_fixed_point *int_red_x, png_fixed_point *int_red_y,\n    png_fixed_point *int_green_x, png_fixed_point *int_green_y,\n    png_fixed_point *int_blue_x, png_fixed_point *int_blue_y))\nPNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,\n    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,\n    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,\n    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,\n    png_fixed_point *int_blue_Z))\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr,\n    double white_x, double white_y, double red_x, double red_y, double green_x,\n    double green_y, double blue_x, double blue_y))\nPNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double red_X, double red_Y, double red_Z,\n    double green_X, double green_Y, double green_Z, double blue_X,\n    double blue_Y, double blue_Z))\nPNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_white_x,\n    png_fixed_point int_white_y, png_fixed_point int_red_x,\n    png_fixed_point int_red_y, png_fixed_point int_green_x,\n    png_fixed_point int_green_y, png_fixed_point int_blue_x,\n    png_fixed_point int_blue_y))\nPNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,\n    png_fixed_point int_red_Z, png_fixed_point int_green_X,\n    png_fixed_point int_green_Y, png_fixed_point int_green_Z,\n    png_fixed_point int_blue_X, png_fixed_point int_blue_Y,\n    png_fixed_point int_blue_Z))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *file_gamma))\nPNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_file_gamma))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double file_gamma))\nPNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_file_gamma))\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_16p *hist));\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_uint_16p hist));\n#endif\n\nPNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height,\n    int *bit_depth, int *color_type, int *interlace_method,\n    int *compression_method, int *filter_method));\n\nPNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,\n    int color_type, int interlace_method, int compression_method,\n    int filter_method));\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr,\n   png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,\n   int *unit_type));\n#endif\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y,\n    int unit_type));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charp *purpose, png_int_32 *X0,\n    png_int_32 *X1, int *type, int *nparams, png_charp *units,\n    png_charpp *params));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1,\n    int type, int nparams, png_const_charp units, png_charpp params));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));\n#endif\n\nPNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr,\n   png_inforp info_ptr, png_colorp *palette, int *num_palette));\n\nPNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_colorp palette, int num_palette));\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_8p *sig_bit));\n#endif\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_8p sig_bit));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *file_srgb_intent));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\nPNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charpp name, int *compression_type,\n    png_bytepp profile, png_uint_32 *proflen));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp name, int compression_type,\n    png_const_bytep profile, png_uint_32 proflen));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_sPLT_tpp entries));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_sPLT_tp entries, int nentries));\n#endif\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_get_text also returns the number of text chunks in *num_text */\nPNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_textp *text_ptr, int *num_text));\n#endif\n\n/* Note while png_set_text() will accept a structure whose text,\n * language, and  translated keywords are NULL pointers, the structure\n * returned by png_get_text will always contain regular\n * zero-terminated C strings.  They might be empty strings but\n * they will never be NULL pointers.\n */\n\n#ifdef PNG_TEXT_SUPPORTED\nPNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_textp text_ptr, int num_text));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_timep *mod_time));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_timep mod_time));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans,\n    png_color_16p *trans_color));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans,\n    png_const_color_16p trans_color));\n#endif\n\n#ifdef PNG_sCAL_SUPPORTED\nPNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *unit, double *width, double *height))\n#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \\\n   defined(PNG_FLOATING_POINT_SUPPORTED)\n/* NOTE: this API is currently implemented using floating point arithmetic,\n * consequently it can only be used on systems with floating point support.\n * In any case the range of values supported by png_fixed_point is small and it\n * is highly recommended that png_get_sCAL_s be used instead.\n */\nPNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_fixed_point *width, png_fixed_point *height))\n#endif\nPNG_EXPORT(169, png_uint_32, png_get_sCAL_s,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_charpp swidth, png_charpp sheight));\n\nPNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit, double width, double height))\nPNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr,\n   png_inforp info_ptr, int unit, png_fixed_point width,\n   png_fixed_point height))\nPNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit,\n    png_const_charp swidth, png_const_charp sheight));\n#endif /* PNG_sCAL_SUPPORTED */\n\n#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n/* Provide the default handling for all unknown chunks or, optionally, for\n * specific unknown chunks.\n *\n * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was\n * ignored and the default was used, the per-chunk setting only had an effect on\n * write.  If you wish to have chunk-specific handling on read in code that must\n * work on earlier versions you must use a user chunk callback to specify the\n * desired handling (keep or discard.)\n *\n * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below.  The\n * parameter is interpreted as follows:\n *\n * READ:\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Known chunks: do normal libpng processing, do not keep the chunk (but\n *          see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED)\n *       Unknown chunks: for a specific chunk use the global default, when used\n *          as the default discard the chunk data.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Discard the chunk data.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Keep the chunk data if the chunk is not critical else raise a chunk\n *       error.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Keep the chunk data.\n *\n * If the chunk data is saved it can be retrieved using png_get_unknown_chunks,\n * below.  Notice that specifying \"AS_DEFAULT\" as a global default is equivalent\n * to specifying \"NEVER\", however when \"AS_DEFAULT\" is used for specific chunks\n * it simply resets the behavior to the libpng default.\n *\n * INTERACTION WTIH USER CHUNK CALLBACKS:\n * The per-chunk handling is always used when there is a png_user_chunk_ptr\n * callback and the callback returns 0; the chunk is then always stored *unless*\n * it is critical and the per-chunk setting is other than ALWAYS.  Notice that\n * the global default is *not* used in this case.  (In effect the per-chunk\n * value is incremented to at least IF_SAFE.)\n *\n * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and\n * per-chunk defaults will be honored.  If you want to preserve the current\n * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE\n * as the default - if you don't do this libpng 1.6 will issue a warning.\n *\n * If you want unhandled unknown chunks to be discarded in libpng 1.6 and\n * earlier simply return '1' (handled).\n *\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED:\n *    If this is *not* set known chunks will always be handled by libpng and\n *    will never be stored in the unknown chunk list.  Known chunks listed to\n *    png_set_keep_unknown_chunks will have no effect.  If it is set then known\n *    chunks listed with a keep other than AS_DEFAULT will *never* be processed\n *    by libpng, in addition critical chunks must either be processed by the\n *    callback or saved.\n *\n *    The IHDR and IEND chunks must not be listed.  Because this turns off the\n *    default handling for chunks that would otherwise be recognized the\n *    behavior of libpng transformations may well become incorrect!\n *\n * WRITE:\n *    When writing chunks the options only apply to the chunks specified by\n *    png_set_unknown_chunks (below), libpng will *always* write known chunks\n *    required by png_set_ calls and will always write the core critical chunks\n *    (as required for PLTE).\n *\n *    Each chunk in the png_set_unknown_chunks list is looked up in the\n *    png_set_keep_unknown_chunks list to find the keep setting, this is then\n *    interpreted as follows:\n *\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Write safe-to-copy chunks and write other chunks if the global\n *       default is set to _ALWAYS, otherwise don't write this chunk.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Do not write the chunk.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Write the chunk if it is safe-to-copy, otherwise do not write it.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Write the chunk.\n *\n * Note that the default behavior is effectively the opposite of the read case -\n * in read unknown chunks are not stored by default, in write they are written\n * by default.  Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different\n * - on write the safe-to-copy bit is checked, on read the critical bit is\n * checked and on read if the chunk is critical an error will be raised.\n *\n * num_chunks:\n * ===========\n *    If num_chunks is positive, then the \"keep\" parameter specifies the manner\n *    for handling only those chunks appearing in the chunk_list array,\n *    otherwise the chunk list array is ignored.\n *\n *    If num_chunks is 0 the \"keep\" parameter specifies the default behavior for\n *    unknown chunks, as described above.\n *\n *    If num_chunks is negative, then the \"keep\" parameter specifies the manner\n *    for handling all unknown chunks plus all chunks recognized by libpng\n *    except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to\n *    be processed by libpng.\n */\nPNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,\n    int keep, png_const_bytep chunk_list, int num_chunks));\n\n/* The \"keep\" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned;\n * the result is therefore true (non-zero) if special handling is required,\n * false for the default handling.\n */\nPNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr,\n    png_const_bytep chunk_name));\n#endif\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\nPNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_unknown_chunkp unknowns,\n    int num_unknowns));\n   /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added\n    * unknowns to the location currently stored in the png_struct.  This is\n    * invariably the wrong value on write.  To fix this call the following API\n    * for each chunk in the list with the correct location.  If you know your\n    * code won't be compiled on earlier versions you can rely on\n    * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing\n    * the correct thing.\n    */\n\nPNG_EXPORT(175, void, png_set_unknown_chunk_location,\n    (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));\n\nPNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_unknown_chunkpp entries));\n#endif\n\n/* Png_free_data() will turn off the \"valid\" flag for anything it frees.\n * If you need to turn it off for a chunk that your application has freed,\n * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);\n */\nPNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int mask));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* The \"params\" pointer is currently not used and is for future expansion. */\nPNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\nPNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\n#endif\n\nPNG_EXPORT(180, png_const_charp, png_get_copyright,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(181, png_const_charp, png_get_header_ver,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(182, png_const_charp, png_get_header_version,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(183, png_const_charp, png_get_libpng_ver,\n    (png_const_structrp png_ptr));\n\n#ifdef PNG_MNG_FEATURES_SUPPORTED\nPNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr,\n    png_uint_32 mng_features_permitted));\n#endif\n\n/* For use in png_set_keep_unknown, added to version 1.2.6 */\n#define PNG_HANDLE_CHUNK_AS_DEFAULT   0\n#define PNG_HANDLE_CHUNK_NEVER        1\n#define PNG_HANDLE_CHUNK_IF_SAFE      2\n#define PNG_HANDLE_CHUNK_ALWAYS       3\n#define PNG_HANDLE_CHUNK_LAST         4\n\n/* Strip the prepended error numbers (\"#nnn \") from error and warning\n * messages before passing them to the error or warning handler.\n */\n#ifdef PNG_ERROR_NUMBERS_SUPPORTED\nPNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr,\n    png_uint_32 strip_mode));\n#endif\n\n/* Added in libpng-1.2.6 */\n#ifdef PNG_SET_USER_LIMITS_SUPPORTED\nPNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr,\n    png_uint_32 user_width_max, png_uint_32 user_height_max));\nPNG_EXPORT(187, png_uint_32, png_get_user_width_max,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(188, png_uint_32, png_get_user_height_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.0 */\nPNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr,\n    png_uint_32 user_chunk_cache_max));\nPNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.1 */\nPNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr,\n    png_alloc_size_t user_chunk_cache_max));\nPNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,\n    (png_const_structrp png_ptr));\n#endif\n\n#if defined(PNG_INCH_CONVERSIONS_SUPPORTED)\nPNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_FP_EXPORT(196, float, png_get_x_offset_inches,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\nPNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\n#  ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#  endif /* PNG_pHYs_SUPPORTED */\n#endif  /* PNG_INCH_CONVERSIONS_SUPPORTED */\n\n/* Added in libpng-1.4.0 */\n#ifdef PNG_IO_STATE_SUPPORTED\nPNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr));\n\n/* Removed from libpng 1.6; use png_get_io_chunk_type. */\nPNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr),\n    PNG_DEPRECATED)\n\nPNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,\n    (png_const_structrp png_ptr));\n\n/* The flags returned by png_get_io_state() are the following: */\n#  define PNG_IO_NONE        0x0000   /* no I/O at this moment */\n#  define PNG_IO_READING     0x0001   /* currently reading */\n#  define PNG_IO_WRITING     0x0002   /* currently writing */\n#  define PNG_IO_SIGNATURE   0x0010   /* currently at the file signature */\n#  define PNG_IO_CHUNK_HDR   0x0020   /* currently at the chunk header */\n#  define PNG_IO_CHUNK_DATA  0x0040   /* currently at the chunk data */\n#  define PNG_IO_CHUNK_CRC   0x0080   /* currently at the chunk crc */\n#  define PNG_IO_MASK_OP     0x000f   /* current operation: reading/writing */\n#  define PNG_IO_MASK_LOC    0x00f0   /* current location: sig/hdr/data/crc */\n#endif /* ?PNG_IO_STATE_SUPPORTED */\n\n/* Interlace support.  The following macros are always defined so that if\n * libpng interlace handling is turned off the macros may be used to handle\n * interlaced images within the application.\n */\n#define PNG_INTERLACE_ADAM7_PASSES 7\n\n/* Two macros to return the first row and first column of the original,\n * full, image which appears in a given pass.  'pass' is in the range 0\n * to 6 and the result is in the range 0 to 7.\n */\n#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7)\n#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7)\n\n/* A macro to return the offset between pixels in the output row for a pair of\n * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that\n * follows.  Note that ROW_OFFSET is the offset from one row to the next whereas\n * COL_OFFSET is from one column to the next, within a row.\n */\n#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8)\n#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1))\n\n/* Two macros to help evaluate the number of rows or columns in each\n * pass.  This is expressed as a shift - effectively log2 of the number or\n * rows or columns in each 8x8 tile of the original image.\n */\n#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3)\n#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3)\n\n/* Hence two macros to determine the number of rows or columns in a given\n * pass of an image given its height or width.  In fact these macros may\n * return non-zero even though the sub-image is empty, because the other\n * dimension may be empty for a small image.\n */\n#define PNG_PASS_ROWS(height, pass) (((height)+(((1<<PNG_PASS_ROW_SHIFT(pass))\\\n   -1)-PNG_PASS_START_ROW(pass)))>>PNG_PASS_ROW_SHIFT(pass))\n#define PNG_PASS_COLS(width, pass) (((width)+(((1<<PNG_PASS_COL_SHIFT(pass))\\\n   -1)-PNG_PASS_START_COL(pass)))>>PNG_PASS_COL_SHIFT(pass))\n\n/* For the reader row callbacks (both progressive and sequential) it is\n * necessary to find the row in the output image given a row in an interlaced\n * image, so two more macros:\n */\n#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \\\n   (((y_in)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))\n#define PNG_COL_FROM_PASS_COL(x_in, pass) \\\n   (((x_in)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))\n\n/* Two macros which return a boolean (0 or 1) saying whether the given row\n * or column is in a particular pass.  These use a common utility macro that\n * returns a mask for a given pass - the offset 'off' selects the row or\n * column version.  The mask has the appropriate bit set for each column in\n * the tile.\n */\n#define PNG_PASS_MASK(pass,off) ( \\\n   ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \\\n   ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0))\n\n#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \\\n   ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1)\n#define PNG_COL_IN_INTERLACE_PASS(x, pass) \\\n   ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1)\n\n#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED\n/* With these routines we avoid an integer divide, which will be slower on\n * most machines.  However, it does take more operations than the corresponding\n * divide method, so it may be slower on a few RISC systems.  There are two\n * shifts (by 8 or 16 bits) and an addition, versus a single integer divide.\n *\n * Note that the rounding factors are NOT supposed to be the same!  128 and\n * 32768 are correct for the NODIV code; 127 and 32767 are correct for the\n * standard method.\n *\n * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]\n */\n\n /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */\n\n#  define png_composite(composite, fg, alpha, bg)         \\\n     { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \\\n           * (png_uint_16)(alpha)                         \\\n           + (png_uint_16)(bg)*(png_uint_16)(255          \\\n           - (png_uint_16)(alpha)) + 128);                \\\n       (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }\n\n#  define png_composite_16(composite, fg, alpha, bg)       \\\n     { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg)  \\\n           * (png_uint_32)(alpha)                          \\\n           + (png_uint_32)(bg)*(65535                      \\\n           - (png_uint_32)(alpha)) + 32768);               \\\n       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }\n\n#else  /* Standard method using integer division */\n\n#  define png_composite(composite, fg, alpha, bg)                          \\\n     (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +  \\\n     (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) +       \\\n     127) / 255)\n\n#  define png_composite_16(composite, fg, alpha, bg)                         \\\n     (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \\\n     (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) +         \\\n     32767) / 65535)\n#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */\n\n#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));\nPNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));\nPNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));\n#endif\n\nPNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr,\n    png_const_bytep buf));\n/* No png_get_int_16 -- may be added if there's a real need for it. */\n\n/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i));\n#endif\n#ifdef PNG_SAVE_INT_32_SUPPORTED\nPNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i));\n#endif\n\n/* Place a 16-bit number into a buffer in PNG byte order.\n * The parameter is declared unsigned int, not png_uint_16,\n * just to avoid potential problems on pre-ANSI C compilers.\n */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));\n/* No png_save_int_16 -- may be added if there's a real need for it. */\n#endif\n\n#ifdef PNG_USE_READ_MACROS\n/* Inline macros to do direct reads of bytes from the input buffer.\n * The png_get_int_32() routine assumes we are using two's complement\n * format for negative values, which is almost certainly true.\n */\n#  define PNG_get_uint_32(buf) \\\n     (((png_uint_32)(*(buf)) << 24) + \\\n      ((png_uint_32)(*((buf) + 1)) << 16) + \\\n      ((png_uint_32)(*((buf) + 2)) << 8) + \\\n      ((png_uint_32)(*((buf) + 3))))\n\n   /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the\n    * function) incorrectly returned a value of type png_uint_32.\n    */\n#  define PNG_get_uint_16(buf) \\\n     ((png_uint_16) \\\n      (((unsigned int)(*(buf)) << 8) + \\\n       ((unsigned int)(*((buf) + 1)))))\n\n#  define PNG_get_int_32(buf) \\\n     ((png_int_32)((*(buf) & 0x80) \\\n      ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \\\n      : (png_int_32)png_get_uint_32(buf)))\n\n   /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h,\n    * but defining a macro name prefixed with PNG_PREFIX.\n    */\n#  ifndef PNG_PREFIX\n#     define png_get_uint_32(buf) PNG_get_uint_32(buf)\n#     define png_get_uint_16(buf) PNG_get_uint_16(buf)\n#     define png_get_int_32(buf)  PNG_get_int_32(buf)\n#  endif\n#else\n#  ifdef PNG_PREFIX\n      /* No macros; revert to the (redefined) function */\n#     define PNG_get_uint_32 (png_get_uint_32)\n#     define PNG_get_uint_16 (png_get_uint_16)\n#     define PNG_get_int_32  (png_get_int_32)\n#  endif\n#endif\n\n/*******************************************************************************\n *  SIMPLIFIED API\n *******************************************************************************\n *\n * Please read the documentation in libpng-manual.txt (TODO: write said\n * documentation) if you don't understand what follows.\n *\n * The simplified API hides the details of both libpng and the PNG file format\n * itself.  It allows PNG files to be read into a very limited number of\n * in-memory bitmap formats or to be written from the same formats.  If these\n * formats do not accomodate your needs then you can, and should, use the more\n * sophisticated APIs above - these support a wide variety of in-memory formats\n * and a wide variety of sophisticated transformations to those formats as well\n * as a wide variety of APIs to manipulate ancillary information.\n *\n * To read a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure (see below) on the stack and set the\n *    version field to PNG_IMAGE_VERSION.\n * 2) Call the appropriate png_image_begin_read... function.\n * 3) Set the png_image 'format' member to the required sample format.\n * 4) Allocate a buffer for the image and, if required, the color-map.\n * 5) Call png_image_finish_read to read the image and, if required, the\n *    color-map into your buffers.\n *\n * There are no restrictions on the format of the PNG input itself; all valid\n * color types, bit depths, and interlace methods are acceptable, and the\n * input image is transformed as necessary to the requested in-memory format\n * during the png_image_finish_read() step.  The only caveat is that if you\n * request a color-mapped image from a PNG that is full-color or makes\n * complex use of an alpha channel the transformation is extremely lossy and the\n * result may look terrible.\n *\n * To write a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure on the stack and memset() it to all zero.\n * 2) Initialize the members of the structure that describe the image, setting\n *    the 'format' member to the format of the image samples.\n * 3) Call the appropriate png_image_write... function with a pointer to the\n *    image and, if necessary, the color-map to write the PNG data.\n *\n * png_image is a structure that describes the in-memory format of an image\n * when it is being read or defines the in-memory format of an image that you\n * need to write:\n */\n#define PNG_IMAGE_VERSION 1\n\ntypedef struct png_control *png_controlp;\ntypedef struct\n{\n   png_controlp opaque;    /* Initialize to NULL, free with png_image_free */\n   png_uint_32  version;   /* Set to PNG_IMAGE_VERSION */\n   png_uint_32  width;     /* Image width in pixels (columns) */\n   png_uint_32  height;    /* Image height in pixels (rows) */\n   png_uint_32  format;    /* Image format as defined below */\n   png_uint_32  flags;     /* A bit mask containing informational flags */\n   png_uint_32  colormap_entries;\n                           /* Number of entries in the color-map */\n\n   /* In the event of an error or warning the following field will be set to a\n    * non-zero value and the 'message' field will contain a '\\0' terminated\n    * string with the libpng error or warning message.  If both warnings and\n    * an error were encountered, only the error is recorded.  If there\n    * are multiple warnings, only the first one is recorded.\n    *\n    * The upper 30 bits of this value are reserved, the low two bits contain\n    * a value as follows:\n    */\n#  define PNG_IMAGE_WARNING 1\n#  define PNG_IMAGE_ERROR 2\n   /*\n    * The result is a two bit code such that a value more than 1 indicates\n    * a failure in the API just called:\n    *\n    *    0 - no warning or error\n    *    1 - warning\n    *    2 - error\n    *    3 - error preceded by warning\n    */\n#  define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1)\n\n   png_uint_32  warning_or_error;\n\n   char         message[64];\n} png_image, *png_imagep;\n\n/* The samples of the image have one to four channels whose components have\n * original values in the range 0 to 1.0:\n *\n * 1: A single gray or luminance channel (G).\n * 2: A gray/luminance channel and an alpha channel (GA).\n * 3: Three red, green, blue color channels (RGB).\n * 4: Three color channels and an alpha channel (RGBA).\n *\n * The components are encoded in one of two ways:\n *\n * a) As a small integer, value 0..255, contained in a single byte.  For the\n * alpha channel the original value is simply value/255.  For the color or\n * luminance channels the value is encoded according to the sRGB specification\n * and matches the 8-bit format expected by typical display devices.\n *\n * The color/gray channels are not scaled (pre-multiplied) by the alpha\n * channel and are suitable for passing to color management software.\n *\n * b) As a value in the range 0..65535, contained in a 2-byte integer.  All\n * channels can be converted to the original value by dividing by 65535; all\n * channels are linear.  Color channels use the RGB encoding (RGB end-points) of\n * the sRGB specification.  This encoding is identified by the\n * PNG_FORMAT_FLAG_LINEAR flag below.\n *\n * When the simplified API needs to convert between sRGB and linear colorspaces,\n * the actual sRGB transfer curve defined in the sRGB specification (see the\n * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2\n * approximation used elsewhere in libpng.\n *\n * When an alpha channel is present it is expected to denote pixel coverage\n * of the color or luminance channels and is returned as an associated alpha\n * channel: the color/gray channels are scaled (pre-multiplied) by the alpha\n * value.\n *\n * The samples are either contained directly in the image data, between 1 and 8\n * bytes per pixel according to the encoding, or are held in a color-map indexed\n * by bytes in the image data.  In the case of a color-map the color-map entries\n * are individual samples, encoded as above, and the image data has one byte per\n * pixel to select the relevant sample from the color-map.\n */\n\n/* PNG_FORMAT_*\n *\n * #defines to be used in png_image::format.  Each #define identifies a\n * particular layout of sample data and, if present, alpha values.  There are\n * separate defines for each of the two component encodings.\n *\n * A format is built up using single bit flag values.  All combinations are\n * valid.  Formats can be built up from the flag values or you can use one of\n * the predefined values below.  When testing formats always use the FORMAT_FLAG\n * macros to test for individual features - future versions of the library may\n * add new flags.\n *\n * When reading or writing color-mapped images the format should be set to the\n * format of the entries in the color-map then png_image_{read,write}_colormap\n * called to read or write the color-map and set the format correctly for the\n * image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!\n *\n * NOTE: libpng can be built with particular features disabled, if you see\n * compiler errors because the definition of one of the following flags has been\n * compiled out it is because libpng does not have the required support.  It is\n * possible, however, for the libpng configuration to enable the format on just\n * read or just write; in that case you may see an error at run time.  You can\n * guard against this by checking for the definition of the appropriate\n * \"_SUPPORTED\" macro, one of:\n *\n *    PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED\n */\n#define PNG_FORMAT_FLAG_ALPHA    0x01U /* format with an alpha channel */\n#define PNG_FORMAT_FLAG_COLOR    0x02U /* color format: otherwise grayscale */\n#define PNG_FORMAT_FLAG_LINEAR   0x04U /* 2 byte channels else 1 byte */\n#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */\n\n#ifdef PNG_FORMAT_BGR_SUPPORTED\n#  define PNG_FORMAT_FLAG_BGR    0x10U /* BGR colors, else order is RGB */\n#endif\n\n#ifdef PNG_FORMAT_AFIRST_SUPPORTED\n#  define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */\n#endif\n\n/* Commonly used formats have predefined macros.\n *\n * First the single byte (sRGB) formats:\n */\n#define PNG_FORMAT_GRAY 0\n#define PNG_FORMAT_GA   PNG_FORMAT_FLAG_ALPHA\n#define PNG_FORMAT_AG   (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_RGB  PNG_FORMAT_FLAG_COLOR\n#define PNG_FORMAT_BGR  (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)\n#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)\n\n/* Then the linear 2-byte formats.  When naming these \"Y\" is used to\n * indicate a luminance (gray) channel.\n */\n#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR\n#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)\n#define PNG_FORMAT_LINEAR_RGB_ALPHA \\\n   (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA)\n\n/* With color-mapped formats the image data is one byte for each pixel, the byte\n * is an index into the color-map which is formatted as above.  To obtain a\n * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP\n * to one of the above definitions, or you can use one of the definitions below.\n */\n#define PNG_FORMAT_RGB_COLORMAP  (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGR_COLORMAP  (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP)\n\n/* PNG_IMAGE macros\n *\n * These are convenience macros to derive information from a png_image\n * structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the\n * actual image sample values - either the entries in the color-map or the\n * pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values\n * for the pixels and will always return 1 for color-mapped formats.  The\n * remaining macros return information about the rows in the image and the\n * complete image.\n *\n * NOTE: All the macros that take a png_image::format parameter are compile time\n * constants if the format parameter is, itself, a constant.  Therefore these\n * macros can be used in array declarations and case labels where required.\n * Similarly the macros are also pre-processor constants (sizeof is not used) so\n * they can be used in #if tests.\n *\n * First the information about the samples.\n */\n#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\\\n   (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1)\n   /* Return the total number of channels in a given format: 1..4 */\n\n#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\\\n   ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1)\n   /* Return the size in bytes of a single component of a pixel or color-map\n    * entry (as appropriate) in the image: 1 or 2.\n    */\n\n#define PNG_IMAGE_SAMPLE_SIZE(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt))\n   /* This is the size of the sample data for one sample.  If the image is\n    * color-mapped it is the size of one color-map entry (and image pixels are\n    * one byte in size), otherwise it is the size of one image pixel.\n    */\n\n#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)\n   /* The maximum size of the color-map required by the format expressed in a\n    * count of components.  This can be used to compile-time allocate a\n    * color-map:\n    *\n    * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];\n    *\n    * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];\n    *\n    * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the\n    * information from one of the png_image_begin_read_ APIs and dynamically\n    * allocate the required memory.\n    */\n\n/* Corresponding information about the pixels */\n#define PNG_IMAGE_PIXEL_(test,fmt)\\\n   (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt))\n\n#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt)\n   /* The number of separate channels (components) in a pixel; 1 for a\n    * color-mapped image.\n    */\n\n#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt)\n   /* The size, in bytes, of each component in a pixel; 1 for a color-mapped\n    * image.\n    */\n\n#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt)\n   /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */\n\n/* Information about the whole row, or whole image */\n#define PNG_IMAGE_ROW_STRIDE(image)\\\n   (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width)\n   /* Return the total number of components in a single row of the image; this\n    * is the minimum 'row stride', the minimum count of components between each\n    * row.  For a color-mapped image this is the minimum number of bytes in a\n    * row.\n    */\n\n#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\\\n   (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride))\n   /* Return the size, in bytes, of an image buffer given a png_image and a row\n    * stride - the number of components to leave space for in each row.\n    */\n\n#define PNG_IMAGE_SIZE(image)\\\n   PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image))\n   /* Return the size, in bytes, of the image in memory given just a png_image;\n    * the row stride is the minimum stride required for the image.\n    */\n\n#define PNG_IMAGE_COLORMAP_SIZE(image)\\\n   (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries)\n   /* Return the size, in bytes, of the color-map of this image.  If the image\n    * format is not a color-map format this will return a size sufficient for\n    * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if\n    * you don't want to allocate a color-map in this case.\n    */\n\n/* PNG_IMAGE_FLAG_*\n *\n * Flags containing additional information about the image are held in the\n * 'flags' field of png_image.\n */\n#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01\n   /* This indicates the the RGB values of the in-memory bitmap do not\n    * correspond to the red, green and blue end-points defined by sRGB.\n    */\n\n#define PNG_IMAGE_FLAG_FAST 0x02\n   /* On write emphasise speed over compression; the resultant PNG file will be\n    * larger but will be produced significantly faster, particular for large\n    * images.  Do not use this option for images which will be distributed, only\n    * used it when producing intermediate files that will be read back in\n    * repeatedly.  For a typical 24-bit image the option will double the read\n    * speed at the cost of increasing the image size by 25%, however for many\n    * more compressible images the PNG file can be 10 times larger with only a\n    * slight speed gain.\n    */\n\n#define PNG_IMAGE_FLAG_16BIT_sRGB 0x04\n   /* On read if the image is a 16-bit per component image and there is no gAMA\n    * or sRGB chunk assume that the components are sRGB encoded.  Notice that\n    * images output by the simplified API always have gamma information; setting\n    * this flag only affects the interpretation of 16-bit images from an\n    * external source.  It is recommended that the application expose this flag\n    * to the user; the user can normally easily recognize the difference between\n    * linear and sRGB encoding.  This flag has no effect on write - the data\n    * passed to the write APIs must have the correct encoding (as defined\n    * above.)\n    *\n    * If the flag is not set (the default) input 16-bit per component data is\n    * assumed to be linear.\n    *\n    * NOTE: the flag can only be set after the png_image_begin_read_ call,\n    * because that call initializes the 'flags' field.\n    */\n\n#ifdef PNG_SIMPLIFIED_READ_SUPPORTED\n/* READ APIs\n * ---------\n *\n * The png_image passed to the read APIs must have been initialized by setting\n * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.)\n */\n#ifdef PNG_STDIO_SUPPORTED\nPNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,\n   const char *file_name));\n   /* The named file is opened for read and the image header is filled in\n    * from the PNG header in the file.\n    */\n\nPNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,\n   FILE* file));\n   /* The PNG header is read from the stdio FILE object. */\n#endif /* PNG_STDIO_SUPPORTED */\n\nPNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,\n   png_const_voidp memory, png_size_t size));\n   /* The PNG header is read from the given memory buffer. */\n\nPNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,\n   png_const_colorp background, void *buffer, png_int_32 row_stride,\n   void *colormap));\n   /* Finish reading the image into the supplied buffer and clean up the\n    * png_image structure.\n    *\n    * row_stride is the step, in byte or 2-byte units as appropriate,\n    * between adjacent rows.  A positive stride indicates that the top-most row\n    * is first in the buffer - the normal top-down arrangement.  A negative\n    * stride indicates that the bottom-most row is first in the buffer.\n    *\n    * background need only be supplied if an alpha channel must be removed from\n    * a png_byte format and the removal is to be done by compositing on a solid\n    * color; otherwise it may be NULL and any composition will be done directly\n    * onto the buffer.  The value is an sRGB color to use for the background,\n    * for grayscale output the green channel is used.\n    *\n    * background must be supplied when an alpha channel must be removed from a\n    * single byte color-mapped output format, in other words if:\n    *\n    * 1) The original format from png_image_begin_read_from_* had\n    *    PNG_FORMAT_FLAG_ALPHA set.\n    * 2) The format set by the application does not.\n    * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and\n    *    PNG_FORMAT_FLAG_LINEAR *not* set.\n    *\n    * For linear output removing the alpha channel is always done by compositing\n    * on black and background is ignored.\n    *\n    * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set.  It must\n    * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE.\n    * image->colormap_entries will be updated to the actual number of entries\n    * written to the colormap; this may be less than the original value.\n    */\n\nPNG_EXPORT(238, void, png_image_free, (png_imagep image));\n   /* Free any data allocated by libpng in image->opaque, setting the pointer to\n    * NULL.  May be called at any time after the structure is initialized.\n    */\n#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */\n\n#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED\n/* WRITE APIS\n * ----------\n * For write you must initialize a png_image structure to describe the image to\n * be written.  To do this use memset to set the whole structure to 0 then\n * initialize fields describing your image.\n *\n * version: must be set to PNG_IMAGE_VERSION\n * opaque: must be initialized to NULL\n * width: image width in pixels\n * height: image height in rows\n * format: the format of the data (image and color-map) you wish to write\n * flags: set to 0 unless one of the defined flags applies; set\n *    PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB\n *    values do not correspond to the colors in sRGB.\n * colormap_entries: set to the number of entries in the color-map (0 to 256)\n */\nPNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,\n   const char *file, int convert_to_8bit, const void *buffer,\n   png_int_32 row_stride, const void *colormap));\n   /* Write the image to the named file. */\n\nPNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,\n   int convert_to_8_bit, const void *buffer, png_int_32 row_stride,\n   const void *colormap));\n   /* Write the image to the given (FILE*). */\n\n/* With both write APIs if image is in one of the linear formats with 16-bit\n * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG\n * gamma encoded according to the sRGB specification, otherwise a 16-bit linear\n * encoded PNG file is written.\n *\n * With color-mapped data formats the colormap parameter point to a color-map\n * with at least image->colormap_entries encoded in the specified format.  If\n * the format is linear the written PNG color-map will be converted to sRGB\n * regardless of the convert_to_8_bit flag.\n *\n * With all APIs row_stride is handled as in the read APIs - it is the spacing\n * from one row to the next in component sized units (1 or 2 bytes) and if\n * negative indicates a bottom-up row layout in the buffer.\n *\n * Note that the write API does not support interlacing or sub-8-bit pixels.\n */\n#endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */\n/*******************************************************************************\n *  END OF SIMPLIFIED API\n ******************************************************************************/\n\n#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\nPNG_EXPORT(242, void, png_set_check_for_invalid_index,\n    (png_structrp png_ptr, int allowed));\n#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED\nPNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,\n    png_const_infop info_ptr));\n#  endif\n#endif /* CHECK_FOR_INVALID_INDEX */\n\n/*******************************************************************************\n *  IMPLEMENTATION OPTIONS\n *******************************************************************************\n *\n * Support for arbitrary implementation-specific optimizations.  The API allows\n * particular options to be turned on or off.  'Option' is the number of the\n * option and 'onoff' is 0 (off) or non-0 (on).  The value returned is given\n * by the PNG_OPTION_ defines below.\n *\n * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions,\n *           are detected at run time, however sometimes it may be impossible\n *           to do this in user mode, in which case it is necessary to discover\n *           the capabilities in an OS specific way.  Such capabilities are\n *           listed here when libpng has support for them and must be turned\n *           ON by the application if present.\n *\n * SOFTWARE: sometimes software optimizations actually result in performance\n *           decrease on some architectures or systems, or with some sets of\n *           PNG images.  'Software' options allow such optimizations to be\n *           selected at run time.\n */\n#ifdef PNG_SET_OPTION_SUPPORTED\n#ifdef PNG_ARM_NEON_API_SUPPORTED\n#  define PNG_ARM_NEON   0 /* HARDWARE: ARM Neon SIMD instructions supported */\n#endif\n#define PNG_OPTION_NEXT  2 /* Next option - numbers must be even */\n\n/* Return values: NOTE: there are four values and 'off' is *not* zero */\n#define PNG_OPTION_UNSET   0 /* Unset - defaults to off */\n#define PNG_OPTION_INVALID 1 /* Option number out of range */\n#define PNG_OPTION_OFF     2\n#define PNG_OPTION_ON      3\n\nPNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,\n   int onoff));\n#endif\n\n/*******************************************************************************\n *  END OF HARDWARE OPTIONS\n ******************************************************************************/\n\n/* Maintainer: Put new public prototypes here ^, in libpng.3, and project\n * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt\n */\n\n/* The last ordinal number (this is the *last* one already used; the next\n * one to use is one more than this.)  Maintainer, remember to add an entry to\n * scripts/symbols.def as well.\n */\n#ifdef PNG_EXPORT_LAST_ORDINAL\n  PNG_EXPORT_LAST_ORDINAL(244);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* PNG_VERSION_INFO_ONLY */\n/* Do not put anything past this line */\n#endif /* PNG_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/android/pngconf.h",
    "content": "\n/* pngconf.h - machine configurable file for libpng\n *\n * libpng version 1.6.2 - April 25, 2013\n *\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license.\n * For conditions of distribution and use, see the disclaimer\n * and license in png.h\n *\n */\n\n/* Any machine specific code is near the front of this file, so if you\n * are configuring libpng for a machine, you may want to read the section\n * starting here down to where it starts to typedef png_color, png_text,\n * and png_info.\n */\n\n#ifndef PNGCONF_H\n#define PNGCONF_H\n\n/* To do: Do all of this in scripts/pnglibconf.dfa */\n#ifdef PNG_SAFE_LIMITS_SUPPORTED\n#  ifdef PNG_USER_WIDTH_MAX\n#    undef PNG_USER_WIDTH_MAX\n#    define PNG_USER_WIDTH_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_HEIGHT_MAX\n#    undef PNG_USER_HEIGHT_MAX\n#    define PNG_USER_HEIGHT_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_MALLOC_MAX\n#    undef PNG_USER_CHUNK_MALLOC_MAX\n#    define PNG_USER_CHUNK_MALLOC_MAX 4000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_CACHE_MAX\n#    undef PNG_USER_CHUNK_CACHE_MAX\n#    define PNG_USER_CHUNK_CACHE_MAX 128\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */\n\n/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 (\"ISOC90\") compliant C\n * compiler for correct compilation.  The following header files are required by\n * the standard.  If your compiler doesn't provide these header files, or they\n * do not match the standard, you will need to provide/improve them.\n */\n#include <limits.h>\n#include <stddef.h>\n\n/* Library header files.  These header files are all defined by ISOC90; libpng\n * expects conformant implementations, however, an ISOC90 conformant system need\n * not provide these header files if the functionality cannot be implemented.\n * In this case it will be necessary to disable the relevant parts of libpng in\n * the build of pnglibconf.h.\n *\n * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not\n * include this unnecessary header file.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n   /* Required for the definition of FILE: */\n#  include <stdio.h>\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n   /* Required for the definition of jmp_buf and the declaration of longjmp: */\n#  include <setjmp.h>\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n   /* Required for struct tm: */\n#  include <time.h>\n#endif\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using\n * PNG_NO_CONST; this is no longer supported except for data declarations which\n * apparently still cause problems in 2011 on some compilers.\n */\n#define PNG_CONST const /* backward compatibility only */\n\n/* This controls optimization of the reading of 16 and 32 bit values\n * from PNG files.  It can be set on a per-app-file basis - it\n * just changes whether a macro is used when the function is called.\n * The library builder sets the default; if read functions are not\n * built into the library the macro implementation is forced on.\n */\n#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED\n#  define PNG_USE_READ_MACROS\n#endif\n#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)\n#  if PNG_DEFAULT_READ_MACROS\n#    define PNG_USE_READ_MACROS\n#  endif\n#endif\n\n/* COMPILER SPECIFIC OPTIONS.\n *\n * These options are provided so that a variety of difficult compilers\n * can be used.  Some are fixed at build time (e.g. PNG_API_RULE\n * below) but still have compiler specific implementations, others\n * may be changed on a per-file basis when compiling against libpng.\n */\n\n/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect\n * against legacy (pre ISOC90) compilers that did not understand function\n * prototypes.  It is not required for modern C compilers.\n */\n#ifndef PNGARG\n#  define PNGARG(arglist) arglist\n#endif\n\n/* Function calling conventions.\n * =============================\n * Normally it is not necessary to specify to the compiler how to call\n * a function - it just does it - however on x86 systems derived from\n * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems\n * and some others) there are multiple ways to call a function and the\n * default can be changed on the compiler command line.  For this reason\n * libpng specifies the calling convention of every exported function and\n * every function called via a user supplied function pointer.  This is\n * done in this file by defining the following macros:\n *\n * PNGAPI    Calling convention for exported functions.\n * PNGCBAPI  Calling convention for user provided (callback) functions.\n * PNGCAPI   Calling convention used by the ANSI-C library (required\n *           for longjmp callbacks and sometimes used internally to\n *           specify the calling convention for zlib).\n *\n * These macros should never be overridden.  If it is necessary to\n * change calling convention in a private build this can be done\n * by setting PNG_API_RULE (which defaults to 0) to one of the values\n * below to select the correct 'API' variants.\n *\n * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.\n *                This is correct in every known environment.\n * PNG_API_RULE=1 Use the operating system convention for PNGAPI and\n *                the 'C' calling convention (from PNGCAPI) for\n *                callbacks (PNGCBAPI).  This is no longer required\n *                in any known environment - if it has to be used\n *                please post an explanation of the problem to the\n *                libpng mailing list.\n *\n * These cases only differ if the operating system does not use the C\n * calling convention, at present this just means the above cases\n * (x86 DOS/Windows sytems) and, even then, this does not apply to\n * Cygwin running on those systems.\n *\n * Note that the value must be defined in pnglibconf.h so that what\n * the application uses to call the library matches the conventions\n * set when building the library.\n */\n\n/* Symbol export\n * =============\n * When building a shared library it is almost always necessary to tell\n * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'\n * is used to mark the symbols.  On some systems these symbols can be\n * extracted at link time and need no special processing by the compiler,\n * on other systems the symbols are flagged by the compiler and just\n * the declaration requires a special tag applied (unfortunately) in a\n * compiler dependent way.  Some systems can do either.\n *\n * A small number of older systems also require a symbol from a DLL to\n * be flagged to the program that calls it.  This is a problem because\n * we do not know in the header file included by application code that\n * the symbol will come from a shared library, as opposed to a statically\n * linked one.  For this reason the application must tell us by setting\n * the magic flag PNG_USE_DLL to turn on the special processing before\n * it includes png.h.\n *\n * Four additional macros are used to make this happen:\n *\n * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from\n *            the build or imported if PNG_USE_DLL is set - compiler\n *            and system specific.\n *\n * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to\n *                       'type', compiler specific.\n *\n * PNG_DLL_EXPORT Set to the magic to use during a libpng build to\n *                make a symbol exported from the DLL.  Not used in the\n *                public header files; see pngpriv.h for how it is used\n *                in the libpng build.\n *\n * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come\n *                from a DLL - used to define PNG_IMPEXP when\n *                PNG_USE_DLL is set.\n */\n\n/* System specific discovery.\n * ==========================\n * This code is used at build time to find PNG_IMPEXP, the API settings\n * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL\n * import processing is possible.  On Windows systems it also sets\n * compiler-specific macros to the values required to change the calling\n * conventions of the various functions.\n */\n#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\\\n    defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n  /* Windows system (DOS doesn't support DLLs).  Includes builds under Cygwin or\n   * MinGW on any architecture currently supported by Windows.  Also includes\n   * Watcom builds but these need special treatment because they are not\n   * compatible with GCC or Visual C because of different calling conventions.\n   */\n#  if PNG_API_RULE == 2\n    /* If this line results in an error, either because __watcall is not\n     * understood or because of a redefine just below you cannot use *this*\n     * build of the library with the compiler you are using.  *This* build was\n     * build using Watcom and applications must also be built using Watcom!\n     */\n#    define PNGCAPI __watcall\n#  endif\n\n#  if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))\n#    define PNGCAPI __cdecl\n#    if PNG_API_RULE == 1\n       /* If this line results in an error __stdcall is not understood and\n        * PNG_API_RULE should not have been set to '1'.\n        */\n#      define PNGAPI __stdcall\n#    endif\n#  else\n    /* An older compiler, or one not detected (erroneously) above,\n     * if necessary override on the command line to get the correct\n     * variants for the compiler.\n     */\n#    ifndef PNGCAPI\n#      define PNGCAPI _cdecl\n#    endif\n#    if PNG_API_RULE == 1 && !defined(PNGAPI)\n#      define PNGAPI _stdcall\n#    endif\n#  endif /* compiler/api */\n  /* NOTE: PNGCBAPI always defaults to PNGCAPI. */\n\n#  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)\n#     error \"PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed\"\n#  endif\n\n#  if (defined(_MSC_VER) && _MSC_VER < 800) ||\\\n      (defined(__BORLANDC__) && __BORLANDC__ < 0x500)\n    /* older Borland and MSC\n     * compilers used '__export' and required this to be after\n     * the type.\n     */\n#    ifndef PNG_EXPORT_TYPE\n#      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP\n#    endif\n#    define PNG_DLL_EXPORT __export\n#  else /* newer compiler */\n#    define PNG_DLL_EXPORT __declspec(dllexport)\n#    ifndef PNG_DLL_IMPORT\n#      define PNG_DLL_IMPORT __declspec(dllimport)\n#    endif\n#  endif /* compiler */\n\n#else /* !Windows */\n#  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)\n#    define PNGAPI _System\n#  else /* !Windows/x86 && !OS/2 */\n    /* Use the defaults, or define PNG*API on the command line (but\n     * this will have to be done for every compile!)\n     */\n#  endif /* other system, !OS/2 */\n#endif /* !Windows/x86 */\n\n/* Now do all the defaulting . */\n#ifndef PNGCAPI\n#  define PNGCAPI\n#endif\n#ifndef PNGCBAPI\n#  define PNGCBAPI PNGCAPI\n#endif\n#ifndef PNGAPI\n#  define PNGAPI PNGCAPI\n#endif\n\n/* PNG_IMPEXP may be set on the compilation system command line or (if not set)\n * then in an internal header file when building the library, otherwise (when\n * using the library) it is set here.\n */\n#ifndef PNG_IMPEXP\n#  if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)\n     /* This forces use of a DLL, disallowing static linking */\n#    define PNG_IMPEXP PNG_DLL_IMPORT\n#  endif\n\n#  ifndef PNG_IMPEXP\n#    define PNG_IMPEXP\n#  endif\n#endif\n\n/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat\n * 'attributes' as a storage class - the attributes go at the start of the\n * function definition, and attributes are always appended regardless of the\n * compiler.  This considerably simplifies these macros but may cause problems\n * if any compilers both need function attributes and fail to handle them as\n * a storage class (this is unlikely.)\n */\n#ifndef PNG_FUNCTION\n#  define PNG_FUNCTION(type, name, args, attributes) attributes type name args\n#endif\n\n#ifndef PNG_EXPORT_TYPE\n#  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type\n#endif\n\n   /* The ordinal value is only relevant when preprocessing png.h for symbol\n    * table entries, so we discard it here.  See the .dfn files in the\n    * scripts directory.\n    */\n#ifndef PNG_EXPORTA\n\n#  define PNG_EXPORTA(ordinal, type, name, args, attributes)\\\n      PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \\\n        extern attributes)\n#endif\n\n/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,\n * so make something non-empty to satisfy the requirement:\n */\n#define PNG_EMPTY /*empty list*/\n\n#define PNG_EXPORT(ordinal, type, name, args)\\\n   PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)\n\n/* Use PNG_REMOVED to comment out a removed interface. */\n#ifndef PNG_REMOVED\n#  define PNG_REMOVED(ordinal, type, name, args, attributes)\n#endif\n\n#ifndef PNG_CALLBACK\n#  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)\n#endif\n\n/* Support for compiler specific function attributes.  These are used\n * so that where compiler support is available incorrect use of API\n * functions in png.h will generate compiler warnings.\n *\n * Added at libpng-1.2.41.\n */\n\n#ifndef PNG_NO_PEDANTIC_WARNINGS\n#  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED\n#    define PNG_PEDANTIC_WARNINGS_SUPPORTED\n#  endif\n#endif\n\n#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED\n  /* Support for compiler specific function attributes.  These are used\n   * so that where compiler support is available, incorrect use of API\n   * functions in png.h will generate compiler warnings.  Added at libpng\n   * version 1.2.41.  Disabling these removes the warnings but may also produce\n   * less efficient code.\n   */\n#  if defined(__GNUC__)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT __attribute__((__warn_unused_result__))\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __attribute__((__noreturn__))\n#    endif\n#    if __GNUC__ >= 3\n#      ifndef PNG_ALLOCATED\n#        define PNG_ALLOCATED  __attribute__((__malloc__))\n#      endif\n#      ifndef PNG_DEPRECATED\n#        define PNG_DEPRECATED __attribute__((__deprecated__))\n#      endif\n#      ifndef PNG_PRIVATE\n#        if 0 /* Doesn't work so we use deprecated instead*/\n#          define PNG_PRIVATE \\\n            __attribute__((warning(\"This function is not exported by libpng.\")))\n#        else\n#          define PNG_PRIVATE \\\n            __attribute__((__deprecated__))\n#        endif\n#      endif\n#      if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))\n#        ifndef PNG_RESTRICT\n#          define PNG_RESTRICT __restrict\n#        endif\n#      endif /*  __GNUC__ == 3.0 */\n#    endif /*  __GNUC__ >= 3 */\n\n#  elif defined(_MSC_VER)  && (_MSC_VER >= 1300)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT /* not supported */\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __declspec(noreturn)\n#    endif\n#    ifndef PNG_ALLOCATED\n#      if (_MSC_VER >= 1400)\n#        define PNG_ALLOCATED __declspec(restrict)\n#      endif\n#    endif\n#    ifndef PNG_DEPRECATED\n#      define PNG_DEPRECATED __declspec(deprecated)\n#    endif\n#    ifndef PNG_PRIVATE\n#      define PNG_PRIVATE __declspec(deprecated)\n#    endif\n#    ifndef PNG_RESTRICT\n#      if (_MSC_VER >= 1400)\n#        define PNG_RESTRICT __restrict\n#      endif\n#    endif\n\n#  elif defined(__WATCOMC__)\n#    ifndef PNG_RESTRICT\n#      define PNG_RESTRICT __restrict\n#    endif\n#  endif /* _MSC_VER */\n#endif /* PNG_PEDANTIC_WARNINGS */\n\n#ifndef PNG_DEPRECATED\n#  define PNG_DEPRECATED  /* Use of this function is deprecated */\n#endif\n#ifndef PNG_USE_RESULT\n#  define PNG_USE_RESULT  /* The result of this function must be checked */\n#endif\n#ifndef PNG_NORETURN\n#  define PNG_NORETURN    /* This function does not return */\n#endif\n#ifndef PNG_ALLOCATED\n#  define PNG_ALLOCATED   /* The result of the function is new memory */\n#endif\n#ifndef PNG_PRIVATE\n#  define PNG_PRIVATE     /* This is a private libpng function */\n#endif\n#ifndef PNG_RESTRICT\n#  define PNG_RESTRICT    /* The C99 \"restrict\" feature */\n#endif\n#ifndef PNG_FP_EXPORT     /* A floating point API. */\n#  ifdef PNG_FLOATING_POINT_SUPPORTED\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No floating point APIs */\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n#ifndef PNG_FIXED_EXPORT  /* A fixed point API. */\n#  ifdef PNG_FIXED_POINT_SUPPORTED\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No fixed point APIs */\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE\n/* Some typedefs to get us started.  These should be safe on most of the common\n * platforms.\n *\n * png_uint_32 and png_int_32 may, currently, be larger than required to hold a\n * 32-bit value however this is not normally advisable.\n *\n * png_uint_16 and png_int_16 should always be two bytes in size - this is\n * verified at library build time.\n *\n * png_byte must always be one byte in size.\n *\n * The checks below use constants from limits.h, as defined by the ISOC90\n * standard.\n */\n#if CHAR_BIT == 8 && UCHAR_MAX == 255\n   typedef unsigned char png_byte;\n#else\n#  error \"libpng requires 8 bit bytes\"\n#endif\n\n#if INT_MIN == -32768 && INT_MAX == 32767\n   typedef int png_int_16;\n#elif SHRT_MIN == -32768 && SHRT_MAX == 32767\n   typedef short png_int_16;\n#else\n#  error \"libpng requires a signed 16 bit type\"\n#endif\n\n#if UINT_MAX == 65535\n   typedef unsigned int png_uint_16;\n#elif USHRT_MAX == 65535\n   typedef unsigned short png_uint_16;\n#else\n#  error \"libpng requires an unsigned 16 bit type\"\n#endif\n\n#if INT_MIN < -2147483646 && INT_MAX > 2147483646\n   typedef int png_int_32;\n#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646\n   typedef long int png_int_32;\n#else\n#  error \"libpng requires a signed 32 bit (or more) type\"\n#endif\n\n#if UINT_MAX > 4294967294\n   typedef unsigned int png_uint_32;\n#elif ULONG_MAX > 4294967294\n   typedef unsigned long int png_uint_32;\n#else\n#  error \"libpng requires an unsigned 32 bit (or more) type\"\n#endif\n\n/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,\n * requires an ISOC90 compiler and relies on consistent behavior of sizeof.\n */\ntypedef size_t png_size_t;\ntypedef ptrdiff_t png_ptrdiff_t;\n\n/* libpng needs to know the maximum value of 'size_t' and this controls the\n * definition of png_alloc_size_t, below.  This maximum value of size_t limits\n * but does not control the maximum allocations the library makes - there is\n * direct application control of this through png_set_user_limits().\n */\n#ifndef PNG_SMALL_SIZE_T\n   /* Compiler specific tests for systems where size_t is known to be less than\n    * 32 bits (some of these systems may no longer work because of the lack of\n    * 'far' support; see above.)\n    */\n#  if (defined(__TURBOC__) && !defined(__FLAT__)) ||\\\n   (defined(_MSC_VER) && defined(MAXSEG_64K))\n#     define PNG_SMALL_SIZE_T\n#  endif\n#endif\n\n/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no\n * smaller than png_uint_32.  Casts from png_size_t or png_uint_32 to\n * png_alloc_size_t are not necessary; in fact, it is recommended not to use\n * them at all so that the compiler can complain when something turns out to be\n * problematic.\n *\n * Casts in the other direction (from png_alloc_size_t to png_size_t or\n * png_uint_32) should be explicitly applied; however, we do not expect to\n * encounter practical situations that require such conversions.\n *\n * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than\n * 4294967295 - i.e. less than the maximum value of png_uint_32.\n */\n#ifdef PNG_SMALL_SIZE_T\n   typedef png_uint_32 png_alloc_size_t;\n#else\n   typedef png_size_t png_alloc_size_t;\n#endif\n\n/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler\n * implementations of Intel CPU specific support of user-mode segmented address\n * spaces, where 16-bit pointers address more than 65536 bytes of memory using\n * separate 'segment' registers.  The implementation requires two different\n * types of pointer (only one of which includes the segment value.)\n *\n * If required this support is available in version 1.2 of libpng and may be\n * available in versions through 1.5, although the correctness of the code has\n * not been verified recently.\n */\n\n/* Typedef for floating-point numbers that are converted to fixed-point with a\n * multiple of 100,000, e.g., gamma\n */\ntypedef png_int_32 png_fixed_point;\n\n/* Add typedefs for pointers */\ntypedef void                  * png_voidp;\ntypedef const void            * png_const_voidp;\ntypedef png_byte              * png_bytep;\ntypedef const png_byte        * png_const_bytep;\ntypedef png_uint_32           * png_uint_32p;\ntypedef const png_uint_32     * png_const_uint_32p;\ntypedef png_int_32            * png_int_32p;\ntypedef const png_int_32      * png_const_int_32p;\ntypedef png_uint_16           * png_uint_16p;\ntypedef const png_uint_16     * png_const_uint_16p;\ntypedef png_int_16            * png_int_16p;\ntypedef const png_int_16      * png_const_int_16p;\ntypedef char                  * png_charp;\ntypedef const char            * png_const_charp;\ntypedef png_fixed_point       * png_fixed_point_p;\ntypedef const png_fixed_point * png_const_fixed_point_p;\ntypedef png_size_t            * png_size_tp;\ntypedef const png_size_t      * png_const_size_tp;\n\n#ifdef PNG_STDIO_SUPPORTED\ntypedef FILE            * png_FILE_p;\n#endif\n\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double       * png_doublep;\ntypedef const double * png_const_doublep;\n#endif\n\n/* Pointers to pointers; i.e. arrays */\ntypedef png_byte        * * png_bytepp;\ntypedef png_uint_32     * * png_uint_32pp;\ntypedef png_int_32      * * png_int_32pp;\ntypedef png_uint_16     * * png_uint_16pp;\ntypedef png_int_16      * * png_int_16pp;\ntypedef const char      * * png_const_charpp;\ntypedef char            * * png_charpp;\ntypedef png_fixed_point * * png_fixed_point_pp;\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double          * * png_doublepp;\n#endif\n\n/* Pointers to pointers to pointers; i.e., pointer to array */\ntypedef char            * * * png_charppp;\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n#endif /* PNGCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/android/pnglibconf.h",
    "content": "/* pnglibconf.h - library build configuration */\n\n/* libpng version 1.6.2 - April 25, 2013 */\n\n/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */\n\n/* This code is released under the libpng license. */\n/* For conditions of distribution and use, see the disclaimer */\n/* and license in png.h */\n\n/* pnglibconf.h */\n/* Machine generated file: DO NOT EDIT */\n/* Derived from: scripts/pnglibconf.dfa */\n#ifndef PNGLCONF_H\n#define PNGLCONF_H\n/* options */\n#define PNG_16BIT_SUPPORTED\n#define PNG_ALIGNED_MEMORY_SUPPORTED\n/*#undef PNG_ARM_NEON_API_SUPPORTED*/\n/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/\n/*#undef PNG_ARM_NEON_SUPPORTED*/\n#define PNG_BENIGN_ERRORS_SUPPORTED\n#define PNG_BENIGN_READ_ERRORS_SUPPORTED\n/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/\n#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\n#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_COLORSPACE_SUPPORTED\n#define PNG_CONSOLE_IO_SUPPORTED\n#define PNG_CONVERT_tIME_SUPPORTED\n#define PNG_EASY_ACCESS_SUPPORTED\n/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/\n#define PNG_ERROR_TEXT_SUPPORTED\n#define PNG_FIXED_POINT_SUPPORTED\n#define PNG_FLOATING_ARITHMETIC_SUPPORTED\n#define PNG_FLOATING_POINT_SUPPORTED\n#define PNG_FORMAT_AFIRST_SUPPORTED\n#define PNG_FORMAT_BGR_SUPPORTED\n#define PNG_GAMMA_SUPPORTED\n#define PNG_GET_PALETTE_MAX_SUPPORTED\n#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED\n#define PNG_INCH_CONVERSIONS_SUPPORTED\n#define PNG_INFO_IMAGE_SUPPORTED\n#define PNG_IO_STATE_SUPPORTED\n#define PNG_MNG_FEATURES_SUPPORTED\n#define PNG_POINTER_INDEXING_SUPPORTED\n#define PNG_PROGRESSIVE_READ_SUPPORTED\n#define PNG_READ_16BIT_SUPPORTED\n#define PNG_READ_ALPHA_MODE_SUPPORTED\n#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_READ_BACKGROUND_SUPPORTED\n#define PNG_READ_BGR_SUPPORTED\n#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_READ_COMPOSITE_NODIV_SUPPORTED\n#define PNG_READ_COMPRESSED_TEXT_SUPPORTED\n#define PNG_READ_EXPAND_16_SUPPORTED\n#define PNG_READ_EXPAND_SUPPORTED\n#define PNG_READ_FILLER_SUPPORTED\n#define PNG_READ_GAMMA_SUPPORTED\n#define PNG_READ_GET_PALETTE_MAX_SUPPORTED\n#define PNG_READ_GRAY_TO_RGB_SUPPORTED\n#define PNG_READ_INTERLACING_SUPPORTED\n#define PNG_READ_INT_FUNCTIONS_SUPPORTED\n#define PNG_READ_INVERT_ALPHA_SUPPORTED\n#define PNG_READ_INVERT_SUPPORTED\n#define PNG_READ_OPT_PLTE_SUPPORTED\n#define PNG_READ_PACKSWAP_SUPPORTED\n#define PNG_READ_PACK_SUPPORTED\n#define PNG_READ_QUANTIZE_SUPPORTED\n#define PNG_READ_RGB_TO_GRAY_SUPPORTED\n#define PNG_READ_SCALE_16_TO_8_SUPPORTED\n#define PNG_READ_SHIFT_SUPPORTED\n#define PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_STRIP_ALPHA_SUPPORTED\n#define PNG_READ_SUPPORTED\n#define PNG_READ_SWAP_ALPHA_SUPPORTED\n#define PNG_READ_SWAP_SUPPORTED\n#define PNG_READ_TEXT_SUPPORTED\n#define PNG_READ_TRANSFORMS_SUPPORTED\n#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_READ_USER_CHUNKS_SUPPORTED\n#define PNG_READ_USER_TRANSFORM_SUPPORTED\n#define PNG_READ_bKGD_SUPPORTED\n#define PNG_READ_cHRM_SUPPORTED\n#define PNG_READ_gAMA_SUPPORTED\n#define PNG_READ_hIST_SUPPORTED\n#define PNG_READ_iCCP_SUPPORTED\n#define PNG_READ_iTXt_SUPPORTED\n#define PNG_READ_oFFs_SUPPORTED\n#define PNG_READ_pCAL_SUPPORTED\n#define PNG_READ_pHYs_SUPPORTED\n#define PNG_READ_sBIT_SUPPORTED\n#define PNG_READ_sCAL_SUPPORTED\n#define PNG_READ_sPLT_SUPPORTED\n#define PNG_READ_sRGB_SUPPORTED\n#define PNG_READ_tEXt_SUPPORTED\n#define PNG_READ_tIME_SUPPORTED\n#define PNG_READ_tRNS_SUPPORTED\n#define PNG_READ_zTXt_SUPPORTED\n/*#undef PNG_SAFE_LIMITS_SUPPORTED*/\n#define PNG_SAVE_INT_32_SUPPORTED\n#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SEQUENTIAL_READ_SUPPORTED\n#define PNG_SETJMP_SUPPORTED\n#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED\n#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED\n/*#undef PNG_SET_OPTION_SUPPORTED*/\n#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SET_USER_LIMITS_SUPPORTED\n#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_READ_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_SUPPORTED\n#define PNG_STDIO_SUPPORTED\n#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_TEXT_SUPPORTED\n#define PNG_TIME_RFC1123_SUPPORTED\n#define PNG_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_USER_CHUNKS_SUPPORTED\n#define PNG_USER_LIMITS_SUPPORTED\n#define PNG_USER_MEM_SUPPORTED\n#define PNG_USER_TRANSFORM_INFO_SUPPORTED\n#define PNG_USER_TRANSFORM_PTR_SUPPORTED\n#define PNG_WARNINGS_SUPPORTED\n#define PNG_WRITE_16BIT_SUPPORTED\n#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_WRITE_BGR_SUPPORTED\n#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED\n#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n#define PNG_WRITE_FILLER_SUPPORTED\n#define PNG_WRITE_FILTER_SUPPORTED\n#define PNG_WRITE_FLUSH_SUPPORTED\n#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED\n#define PNG_WRITE_INTERLACING_SUPPORTED\n#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED\n#define PNG_WRITE_INVERT_ALPHA_SUPPORTED\n#define PNG_WRITE_INVERT_SUPPORTED\n#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED\n#define PNG_WRITE_PACKSWAP_SUPPORTED\n#define PNG_WRITE_PACK_SUPPORTED\n#define PNG_WRITE_SHIFT_SUPPORTED\n#define PNG_WRITE_SUPPORTED\n#define PNG_WRITE_SWAP_ALPHA_SUPPORTED\n#define PNG_WRITE_SWAP_SUPPORTED\n#define PNG_WRITE_TEXT_SUPPORTED\n#define PNG_WRITE_TRANSFORMS_SUPPORTED\n#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_WRITE_USER_TRANSFORM_SUPPORTED\n#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED\n#define PNG_WRITE_bKGD_SUPPORTED\n#define PNG_WRITE_cHRM_SUPPORTED\n#define PNG_WRITE_gAMA_SUPPORTED\n#define PNG_WRITE_hIST_SUPPORTED\n#define PNG_WRITE_iCCP_SUPPORTED\n#define PNG_WRITE_iTXt_SUPPORTED\n#define PNG_WRITE_oFFs_SUPPORTED\n#define PNG_WRITE_pCAL_SUPPORTED\n#define PNG_WRITE_pHYs_SUPPORTED\n#define PNG_WRITE_sBIT_SUPPORTED\n#define PNG_WRITE_sCAL_SUPPORTED\n#define PNG_WRITE_sPLT_SUPPORTED\n#define PNG_WRITE_sRGB_SUPPORTED\n#define PNG_WRITE_tEXt_SUPPORTED\n#define PNG_WRITE_tIME_SUPPORTED\n#define PNG_WRITE_tRNS_SUPPORTED\n#define PNG_WRITE_zTXt_SUPPORTED\n#define PNG_bKGD_SUPPORTED\n#define PNG_cHRM_SUPPORTED\n#define PNG_gAMA_SUPPORTED\n#define PNG_hIST_SUPPORTED\n#define PNG_iCCP_SUPPORTED\n#define PNG_iTXt_SUPPORTED\n#define PNG_oFFs_SUPPORTED\n#define PNG_pCAL_SUPPORTED\n#define PNG_pHYs_SUPPORTED\n#define PNG_sBIT_SUPPORTED\n#define PNG_sCAL_SUPPORTED\n#define PNG_sPLT_SUPPORTED\n#define PNG_sRGB_SUPPORTED\n#define PNG_tEXt_SUPPORTED\n#define PNG_tIME_SUPPORTED\n#define PNG_tRNS_SUPPORTED\n#define PNG_zTXt_SUPPORTED\n/* end of options */\n/* settings */\n#define PNG_API_RULE 0\n#define PNG_CALLOC_SUPPORTED\n#define PNG_COST_SHIFT 3\n#define PNG_DEFAULT_READ_MACROS 1\n#define PNG_GAMMA_THRESHOLD_FIXED 5000\n#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE\n#define PNG_INFLATE_BUF_SIZE 1024\n#define PNG_MAX_GAMMA_8 11\n#define PNG_QUANTIZE_BLUE_BITS 5\n#define PNG_QUANTIZE_GREEN_BITS 5\n#define PNG_QUANTIZE_RED_BITS 5\n#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_TEXT_Z_DEFAULT_STRATEGY 0\n#define PNG_WEIGHT_SHIFT 8\n#define PNG_ZBUF_SIZE 8192\n#define PNG_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0\n#define PNG_Z_DEFAULT_STRATEGY 1\n#define PNG_sCAL_PRECISION 5\n#define PNG_sRGB_PROFILE_CHECKS 2\n/* end of settings */\n#endif /* PNGLCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/ios/png.h",
    "content": "\n/* png.h - header file for PNG reference library\n *\n * libpng version 1.6.2 - April 25, 2013\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license (See LICENSE, below)\n *\n * Authors and maintainers:\n *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat\n *   libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger\n *   libpng versions 0.97, January 1998, through 1.6.2 - April 25, 2013: Glenn\n *   See also \"Contributing Authors\", below.\n *\n * Note about libpng version numbers:\n *\n *   Due to various miscommunications, unforeseen code incompatibilities\n *   and occasional factors outside the authors' control, version numbering\n *   on the library has not always been consistent and straightforward.\n *   The following table summarizes matters since version 0.89c, which was\n *   the first widely used release:\n *\n *    source                 png.h  png.h  shared-lib\n *    version                string   int  version\n *    -------                ------ -----  ----------\n *    0.89c \"1.0 beta 3\"     0.89      89  1.0.89\n *    0.90  \"1.0 beta 4\"     0.90      90  0.90  [should have been 2.0.90]\n *    0.95  \"1.0 beta 5\"     0.95      95  0.95  [should have been 2.0.95]\n *    0.96  \"1.0 beta 6\"     0.96      96  0.96  [should have been 2.0.96]\n *    0.97b \"1.00.97 beta 7\" 1.00.97   97  1.0.1 [should have been 2.0.97]\n *    0.97c                  0.97      97  2.0.97\n *    0.98                   0.98      98  2.0.98\n *    0.99                   0.99      98  2.0.99\n *    0.99a-m                0.99      99  2.0.99\n *    1.00                   1.00     100  2.1.0 [100 should be 10000]\n *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]\n *    1.0.1       png.h string is   10001  2.1.0\n *    1.0.1a-e    identical to the  10002  from here on, the shared library\n *    1.0.2       source version)   10002  is 2.V where V is the source code\n *    1.0.2a-b                      10003  version, except as noted.\n *    1.0.3                         10003\n *    1.0.3a-d                      10004\n *    1.0.4                         10004\n *    1.0.4a-f                      10005\n *    1.0.5 (+ 2 patches)           10005\n *    1.0.5a-d                      10006\n *    1.0.5e-r                      10100 (not source compatible)\n *    1.0.5s-v                      10006 (not binary compatible)\n *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)\n *    1.0.6d-f                      10007 (still binary incompatible)\n *    1.0.6g                        10007\n *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)\n *    1.0.6i                        10007  10.6i\n *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)\n *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)\n *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)\n *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)\n *    1.0.7                    1    10007  (still compatible)\n *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4\n *    1.0.8rc1                 1    10008  2.1.0.8rc1\n *    1.0.8                    1    10008  2.1.0.8\n *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6\n *    1.0.9rc1                 1    10009  2.1.0.9rc1\n *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10\n *    1.0.9rc2                 1    10009  2.1.0.9rc2\n *    1.0.9                    1    10009  2.1.0.9\n *    1.0.10beta1              1    10010  2.1.0.10beta1\n *    1.0.10rc1                1    10010  2.1.0.10rc1\n *    1.0.10                   1    10010  2.1.0.10\n *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3\n *    1.0.11rc1                1    10011  2.1.0.11rc1\n *    1.0.11                   1    10011  2.1.0.11\n *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2\n *    1.0.12rc1                2    10012  2.1.0.12rc1\n *    1.0.12                   2    10012  2.1.0.12\n *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)\n *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2\n *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5\n *    1.2.0rc1                 3    10200  3.1.2.0rc1\n *    1.2.0                    3    10200  3.1.2.0\n *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4\n *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2\n *    1.2.1                    3    10201  3.1.2.1\n *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6\n *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1\n *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1\n *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1\n *    1.0.13                  10    10013  10.so.0.1.0.13\n *    1.2.2                   12    10202  12.so.0.1.2.2\n *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6\n *    1.2.3                   12    10203  12.so.0.1.2.3\n *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3\n *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1\n *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1\n *    1.0.14                  10    10014  10.so.0.1.0.14\n *    1.2.4                   13    10204  12.so.0.1.2.4\n *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2\n *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3\n *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3\n *    1.0.15                  10    10015  10.so.0.1.0.15\n *    1.2.5                   13    10205  12.so.0.1.2.5\n *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4\n *    1.0.16                  10    10016  10.so.0.1.0.16\n *    1.2.6                   13    10206  12.so.0.1.2.6\n *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2\n *    1.0.17rc1               10    10017  12.so.0.1.0.17rc1\n *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1\n *    1.0.17                  10    10017  12.so.0.1.0.17\n *    1.2.7                   13    10207  12.so.0.1.2.7\n *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5\n *    1.0.18rc1-5             10    10018  12.so.0.1.0.18rc1-5\n *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5\n *    1.0.18                  10    10018  12.so.0.1.0.18\n *    1.2.8                   13    10208  12.so.0.1.2.8\n *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3\n *    1.2.9beta4-11           13    10209  12.so.0.9[.0]\n *    1.2.9rc1                13    10209  12.so.0.9[.0]\n *    1.2.9                   13    10209  12.so.0.9[.0]\n *    1.2.10beta1-7           13    10210  12.so.0.10[.0]\n *    1.2.10rc1-2             13    10210  12.so.0.10[.0]\n *    1.2.10                  13    10210  12.so.0.10[.0]\n *    1.4.0beta1-5            14    10400  14.so.0.0[.0]\n *    1.2.11beta1-4           13    10211  12.so.0.11[.0]\n *    1.4.0beta7-8            14    10400  14.so.0.0[.0]\n *    1.2.11                  13    10211  12.so.0.11[.0]\n *    1.2.12                  13    10212  12.so.0.12[.0]\n *    1.4.0beta9-14           14    10400  14.so.0.0[.0]\n *    1.2.13                  13    10213  12.so.0.13[.0]\n *    1.4.0beta15-36          14    10400  14.so.0.0[.0]\n *    1.4.0beta37-87          14    10400  14.so.14.0[.0]\n *    1.4.0rc01               14    10400  14.so.14.0[.0]\n *    1.4.0beta88-109         14    10400  14.so.14.0[.0]\n *    1.4.0rc02-08            14    10400  14.so.14.0[.0]\n *    1.4.0                   14    10400  14.so.14.0[.0]\n *    1.4.1beta01-03          14    10401  14.so.14.1[.0]\n *    1.4.1rc01               14    10401  14.so.14.1[.0]\n *    1.4.1beta04-12          14    10401  14.so.14.1[.0]\n *    1.4.1                   14    10401  14.so.14.1[.0]\n *    1.4.2                   14    10402  14.so.14.2[.0]\n *    1.4.3                   14    10403  14.so.14.3[.0]\n *    1.4.4                   14    10404  14.so.14.4[.0]\n *    1.5.0beta01-58          15    10500  15.so.15.0[.0]\n *    1.5.0rc01-07            15    10500  15.so.15.0[.0]\n *    1.5.0                   15    10500  15.so.15.0[.0]\n *    1.5.1beta01-11          15    10501  15.so.15.1[.0]\n *    1.5.1rc01-02            15    10501  15.so.15.1[.0]\n *    1.5.1                   15    10501  15.so.15.1[.0]\n *    1.5.2beta01-03          15    10502  15.so.15.2[.0]\n *    1.5.2rc01-03            15    10502  15.so.15.2[.0]\n *    1.5.2                   15    10502  15.so.15.2[.0]\n *    1.5.3beta01-10          15    10503  15.so.15.3[.0]\n *    1.5.3rc01-02            15    10503  15.so.15.3[.0]\n *    1.5.3beta11             15    10503  15.so.15.3[.0]\n *    1.5.3 [omitted]\n *    1.5.4beta01-08          15    10504  15.so.15.4[.0]\n *    1.5.4rc01               15    10504  15.so.15.4[.0]\n *    1.5.4                   15    10504  15.so.15.4[.0]\n *    1.5.5beta01-08          15    10505  15.so.15.5[.0]\n *    1.5.5rc01               15    10505  15.so.15.5[.0]\n *    1.5.5                   15    10505  15.so.15.5[.0]\n *    1.5.6beta01-07          15    10506  15.so.15.6[.0]\n *    1.5.6rc01-03            15    10506  15.so.15.6[.0]\n *    1.5.6                   15    10506  15.so.15.6[.0]\n *    1.5.7beta01-05          15    10507  15.so.15.7[.0]\n *    1.5.7rc01-03            15    10507  15.so.15.7[.0]\n *    1.5.7                   15    10507  15.so.15.7[.0]\n *    1.6.0beta01-40          16    10600  16.so.16.0[.0]\n *    1.6.0rc01-08            16    10600  16.so.16.0[.0]\n *    1.6.0                   16    10600  16.so.16.0[.0]\n *    1.6.1beta01-09          16    10601  16.so.16.1[.0]\n *    1.6.1rc01               16    10601  16.so.16.1[.0]\n *    1.6.1                   16    10601  16.so.16.1[.0]\n *    1.6.2beta01             16    10602  16.so.16.2[.0]\n *    1.6.2rc01-06            16    10602  16.so.16.2[.0]\n *    1.6.2                   16    10602  16.so.16.2[.0]\n *\n *   Henceforth the source version will match the shared-library major\n *   and minor numbers; the shared-library major version number will be\n *   used for changes in backward compatibility, as it is intended.  The\n *   PNG_LIBPNG_VER macro, which is not used within libpng but is available\n *   for applications, is an unsigned integer of the form xyyzz corresponding\n *   to the source version x.y.z (leading zeros in y and z).  Beta versions\n *   were given the previous public release number plus a letter, until\n *   version 1.0.6j; from then on they were given the upcoming public\n *   release number plus \"betaNN\" or \"rcNN\".\n *\n *   Binary incompatibility exists only when applications make direct access\n *   to the info_ptr or png_ptr members through png.h, and the compiled\n *   application is loaded with a different version of the library.\n *\n *   DLLNUM will change each time there are forward or backward changes\n *   in binary compatibility (e.g., when a new feature is added).\n *\n * See libpng-manual.txt or libpng.3 for more information.  The PNG\n * specification is available as a W3C Recommendation and as an ISO\n * Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/\n */\n\n/*\n * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:\n *\n * If you modify libpng you may insert additional notices immediately following\n * this sentence.\n *\n * This code is released under the libpng license.\n *\n * libpng versions 1.2.6, August 15, 2004, through 1.6.2, April 25, 2013, are\n * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.2.5\n * with the following individual added to the list of Contributing Authors:\n *\n *    Cosmin Truta\n *\n * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are\n * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.0.6\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Simon-Pierre Cadieux\n *    Eric S. Raymond\n *    Gilles Vollant\n *\n * and with the following additions to the disclaimer:\n *\n *    There is no warranty against interference with your enjoyment of the\n *    library or against infringement.  There is no warranty that our\n *    efforts or the library will fulfill any of your particular purposes\n *    or needs.  This library is provided with all faults, and the entire\n *    risk of satisfactory quality, performance, accuracy, and effort is with\n *    the user.\n *\n * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are\n * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-0.96,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Tom Lane\n *    Glenn Randers-Pehrson\n *    Willem van Schaik\n *\n * libpng versions 0.89, June 1996, through 0.96, May 1997, are\n * Copyright (c) 1996, 1997 Andreas Dilger\n * Distributed according to the same disclaimer and license as libpng-0.88,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    John Bowler\n *    Kevin Bracey\n *    Sam Bushell\n *    Magnus Holmgren\n *    Greg Roelofs\n *    Tom Tanner\n *\n * libpng versions 0.5, May 1995, through 0.88, January 1996, are\n * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n *\n * For the purposes of this copyright and license, \"Contributing Authors\"\n * is defined as the following set of individuals:\n *\n *    Andreas Dilger\n *    Dave Martindale\n *    Guy Eric Schalnat\n *    Paul Schmidt\n *    Tim Wegner\n *\n * The PNG Reference Library is supplied \"AS IS\".  The Contributing Authors\n * and Group 42, Inc. disclaim all warranties, expressed or implied,\n * including, without limitation, the warranties of merchantability and of\n * fitness for any purpose.  The Contributing Authors and Group 42, Inc.\n * assume no liability for direct, indirect, incidental, special, exemplary,\n * or consequential damages, which may result from the use of the PNG\n * Reference Library, even if advised of the possibility of such damage.\n *\n * Permission is hereby granted to use, copy, modify, and distribute this\n * source code, or portions hereof, for any purpose, without fee, subject\n * to the following restrictions:\n *\n *   1. The origin of this source code must not be misrepresented.\n *\n *   2. Altered versions must be plainly marked as such and must not\n *      be misrepresented as being the original source.\n *\n *   3. This Copyright notice may not be removed or altered from\n *      any source or altered source distribution.\n *\n * The Contributing Authors and Group 42, Inc. specifically permit, without\n * fee, and encourage the use of this source code as a component to\n * supporting the PNG file format in commercial products.  If you use this\n * source code in a product, acknowledgment is not required but would be\n * appreciated.\n */\n\n/*\n * A \"png_get_copyright\" function is available, for convenient use in \"about\"\n * boxes and the like:\n *\n *     printf(\"%s\", png_get_copyright(NULL));\n *\n * Also, the PNG logo (in PNG format, of course) is supplied in the\n * files \"pngbar.png\" and \"pngbar.jpg (88x31) and \"pngnow.png\" (98x31).\n */\n\n/*\n * Libpng is OSI Certified Open Source Software.  OSI Certified is a\n * certification mark of the Open Source Initiative.\n */\n\n/*\n * The contributing authors would like to thank all those who helped\n * with testing, bug fixes, and patience.  This wouldn't have been\n * possible without all of you.\n *\n * Thanks to Frank J. T. Wojcik for helping with the documentation.\n */\n\n/*\n * Y2K compliance in libpng:\n * =========================\n *\n *    April 25, 2013\n *\n *    Since the PNG Development group is an ad-hoc body, we can't make\n *    an official declaration.\n *\n *    This is your unofficial assurance that libpng from version 0.71 and\n *    upward through 1.6.2 are Y2K compliant.  It is my belief that\n *    earlier versions were also Y2K compliant.\n *\n *    Libpng only has two year fields.  One is a 2-byte unsigned integer\n *    that will hold years up to 65535.  The other, which is deprecated,\n *    holds the date in text format, and will hold years up to 9999.\n *\n *    The integer is\n *        \"png_uint_16 year\" in png_time_struct.\n *\n *    The string is\n *        \"char time_buffer[29]\" in png_struct.  This is no longer used\n *    in libpng-1.6.x and will be removed from libpng-1.7.0.\n *\n *    There are seven time-related functions:\n *        png.c: png_convert_to_rfc_1123_buffer() in png.c\n *          (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and\n *          png_convert_to_rfc_1152() in error prior to libpng-0.98)\n *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c\n *        png_convert_from_time_t() in pngwrite.c\n *        png_get_tIME() in pngget.c\n *        png_handle_tIME() in pngrutil.c, called in pngread.c\n *        png_set_tIME() in pngset.c\n *        png_write_tIME() in pngwutil.c, called in pngwrite.c\n *\n *    All handle dates properly in a Y2K environment.  The\n *    png_convert_from_time_t() function calls gmtime() to convert from system\n *    clock time, which returns (year - 1900), which we properly convert to\n *    the full 4-digit year.  There is a possibility that libpng applications\n *    are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()\n *    function, or that they are incorrectly passing only a 2-digit year\n *    instead of \"year - 1900\" into the png_convert_from_struct_tm() function,\n *    but this is not under our control.  The libpng documentation has always\n *    stated that it works with 4-digit years, and the APIs have been\n *    documented as such.\n *\n *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned\n *    integer to hold the year, and can hold years as large as 65535.\n *\n *    zlib, upon which libpng depends, is also Y2K compliant.  It contains\n *    no date-related code.\n *\n *       Glenn Randers-Pehrson\n *       libpng maintainer\n *       PNG Development Group\n */\n\n#ifndef PNG_H\n#define PNG_H\n\n/* This is not the place to learn how to use libpng. The file libpng-manual.txt\n * describes how to use libpng, and the file example.c summarizes it\n * with some code on which to build.  This file is useful for looking\n * at the actual function definitions and structure components.\n *\n * If you just need to read a PNG file and don't want to read the documentation\n * skip to the end of this file and read the section entitled 'simplified API'.\n */\n\n/* Version information for png.h - this should match the version in png.c */\n#define PNG_LIBPNG_VER_STRING \"1.6.2\"\n#define PNG_HEADER_VERSION_STRING \\\n     \" libpng version 1.6.2 - April 25, 2013\\n\"\n\n#define PNG_LIBPNG_VER_SONUM   16\n#define PNG_LIBPNG_VER_DLLNUM  16\n\n/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */\n#define PNG_LIBPNG_VER_MAJOR   1\n#define PNG_LIBPNG_VER_MINOR   6\n#define PNG_LIBPNG_VER_RELEASE 2\n\n/* This should match the numeric part of the final component of\n * PNG_LIBPNG_VER_STRING, omitting any leading zero:\n */\n\n#define PNG_LIBPNG_VER_BUILD  0\n\n/* Release Status */\n#define PNG_LIBPNG_BUILD_ALPHA    1\n#define PNG_LIBPNG_BUILD_BETA     2\n#define PNG_LIBPNG_BUILD_RC       3\n#define PNG_LIBPNG_BUILD_STABLE   4\n#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7\n\n/* Release-Specific Flags */\n#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with\n                                       PNG_LIBPNG_BUILD_STABLE only */\n#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_SPECIAL */\n#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_PRIVATE */\n\n#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE\n\n/* Careful here.  At one time, Guy wanted to use 082, but that would be octal.\n * We must not include leading zeros.\n * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only\n * version 1.0.0 was mis-numbered 100 instead of 10000).  From\n * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release\n */\n#define PNG_LIBPNG_VER 10602 /* 1.6.2 */\n\n/* Library configuration: these options cannot be changed after\n * the library has been built.\n */\n#ifndef PNGLCONF_H\n    /* If pnglibconf.h is missing, you can\n     * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h\n     */\n#   include \"pnglibconf.h\"\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n   /* Machine specific configuration. */\n#  include \"pngconf.h\"\n#endif\n\n/*\n * Added at libpng-1.2.8\n *\n * Ref MSDN: Private as priority over Special\n * VS_FF_PRIVATEBUILD File *was not* built using standard release\n * procedures. If this value is given, the StringFileInfo block must\n * contain a PrivateBuild string.\n *\n * VS_FF_SPECIALBUILD File *was* built by the original company using\n * standard release procedures but is a variation of the standard\n * file of the same version number. If this value is given, the\n * StringFileInfo block must contain a SpecialBuild string.\n */\n\n#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */\n#  define PNG_LIBPNG_BUILD_TYPE \\\n       (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)\n#else\n#  ifdef PNG_LIBPNG_SPECIALBUILD\n#    define PNG_LIBPNG_BUILD_TYPE \\\n         (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)\n#  else\n#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)\n#  endif\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n\n/* Inhibit C++ name-mangling for libpng functions but not for system calls. */\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/* Version information for C files, stored in png.c.  This had better match\n * the version above.\n */\n#define png_libpng_ver png_get_header_ver(NULL)\n\n/* This file is arranged in several sections:\n *\n * 1. Any configuration options that can be specified by for the application\n *    code when it is built.  (Build time configuration is in pnglibconf.h)\n * 2. Type definitions (base types are defined in pngconf.h), structure\n *    definitions.\n * 3. Exported library functions.\n * 4. Simplified API.\n *\n * The library source code has additional files (principally pngpriv.h) that\n * allow configuration of the library.\n */\n/* Section 1: run time configuration\n * See pnglibconf.h for build time configuration\n *\n * Run time configuration allows the application to choose between\n * implementations of certain arithmetic APIs.  The default is set\n * at build time and recorded in pnglibconf.h, but it is safe to\n * override these (and only these) settings.  Note that this won't\n * change what the library does, only application code, and the\n * settings can (and probably should) be made on a per-file basis\n * by setting the #defines before including png.h\n *\n * Use macros to read integers from PNG data or use the exported\n * functions?\n *   PNG_USE_READ_MACROS: use the macros (see below)  Note that\n *     the macros evaluate their argument multiple times.\n *   PNG_NO_USE_READ_MACROS: call the relevant library function.\n *\n * Use the alternative algorithm for compositing alpha samples that\n * does not use division?\n *   PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division'\n *      algorithm.\n *   PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm.\n *\n * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is\n * false?\n *   PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error\n *      APIs to png_warning.\n * Otherwise the calls are mapped to png_error.\n */\n\n/* Section 2: type definitions, including structures and compile time\n * constants.\n * See pngconf.h for base types that vary by machine/system\n */\n\n/* This triggers a compiler error in png.c, if png.c and png.h\n * do not agree upon the version number.\n */\ntypedef char* png_libpng_version_1_6_2;\n\n/* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.\n *\n * png_struct is the cache of information used while reading or writing a single\n * PNG file.  One of these is always required, although the simplified API\n * (below) hides the creation and destruction of it.\n */\ntypedef struct png_struct_def png_struct;\ntypedef const png_struct * png_const_structp;\ntypedef png_struct * png_structp;\ntypedef png_struct * * png_structpp;\n\n/* png_info contains information read from or to be written to a PNG file.  One\n * or more of these must exist while reading or creating a PNG file.  The\n * information is not used by libpng during read but is used to control what\n * gets written when a PNG file is created.  \"png_get_\" function calls read\n * information during read and \"png_set_\" functions calls write information\n * when creating a PNG.\n * been moved into a separate header file that is not accessible to\n * applications.  Read libpng-manual.txt or libpng.3 for more info.\n */\ntypedef struct png_info_def png_info;\ntypedef png_info * png_infop;\ntypedef const png_info * png_const_infop;\ntypedef png_info * * png_infopp;\n\n/* Types with names ending 'p' are pointer types.  The corresponding types with\n * names ending 'rp' are identical pointer types except that the pointer is\n * marked 'restrict', which means that it is the only pointer to the object\n * passed to the function.  Applications should not use the 'restrict' types;\n * it is always valid to pass 'p' to a pointer with a function argument of the\n * corresponding 'rp' type.  Different compilers have different rules with\n * regard to type matching in the presence of 'restrict'.  For backward\n * compatibility libpng callbacks never have 'restrict' in their parameters and,\n * consequentially, writing portable application code is extremely difficult if\n * an attempt is made to use 'restrict'.\n */\ntypedef png_struct * PNG_RESTRICT png_structrp;\ntypedef const png_struct * PNG_RESTRICT png_const_structrp;\ntypedef png_info * PNG_RESTRICT png_inforp;\ntypedef const png_info * PNG_RESTRICT png_const_inforp;\n\n/* Three color definitions.  The order of the red, green, and blue, (and the\n * exact size) is not important, although the size of the fields need to\n * be png_byte or png_uint_16 (as defined below).\n */\ntypedef struct png_color_struct\n{\n   png_byte red;\n   png_byte green;\n   png_byte blue;\n} png_color;\ntypedef png_color * png_colorp;\ntypedef const png_color * png_const_colorp;\ntypedef png_color * * png_colorpp;\n\ntypedef struct png_color_16_struct\n{\n   png_byte index;    /* used for palette files */\n   png_uint_16 red;   /* for use in red green blue files */\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 gray;  /* for use in grayscale files */\n} png_color_16;\ntypedef png_color_16 * png_color_16p;\ntypedef const png_color_16 * png_const_color_16p;\ntypedef png_color_16 * * png_color_16pp;\n\ntypedef struct png_color_8_struct\n{\n   png_byte red;   /* for use in red green blue files */\n   png_byte green;\n   png_byte blue;\n   png_byte gray;  /* for use in grayscale files */\n   png_byte alpha; /* for alpha channel files */\n} png_color_8;\ntypedef png_color_8 * png_color_8p;\ntypedef const png_color_8 * png_const_color_8p;\ntypedef png_color_8 * * png_color_8pp;\n\n/*\n * The following two structures are used for the in-core representation\n * of sPLT chunks.\n */\ntypedef struct png_sPLT_entry_struct\n{\n   png_uint_16 red;\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 alpha;\n   png_uint_16 frequency;\n} png_sPLT_entry;\ntypedef png_sPLT_entry * png_sPLT_entryp;\ntypedef const png_sPLT_entry * png_const_sPLT_entryp;\ntypedef png_sPLT_entry * * png_sPLT_entrypp;\n\n/*  When the depth of the sPLT palette is 8 bits, the color and alpha samples\n *  occupy the LSB of their respective members, and the MSB of each member\n *  is zero-filled.  The frequency member always occupies the full 16 bits.\n */\n\ntypedef struct png_sPLT_struct\n{\n   png_charp name;           /* palette name */\n   png_byte depth;           /* depth of palette samples */\n   png_sPLT_entryp entries;  /* palette entries */\n   png_int_32 nentries;      /* number of palette entries */\n} png_sPLT_t;\ntypedef png_sPLT_t * png_sPLT_tp;\ntypedef const png_sPLT_t * png_const_sPLT_tp;\ntypedef png_sPLT_t * * png_sPLT_tpp;\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,\n * and whether that contents is compressed or not.  The \"key\" field\n * points to a regular zero-terminated C string.  The \"text\" fields can be a\n * regular C string, an empty string, or a NULL pointer.\n * However, the structure returned by png_get_text() will always contain\n * the \"text\" field as a regular zero-terminated C string (possibly\n * empty), never a NULL pointer, so it can be safely used in printf() and\n * other string-handling functions.  Note that the \"itxt_length\", \"lang\", and\n * \"lang_key\" members of the structure only exist when the library is built\n * with iTXt chunk support.  Prior to libpng-1.4.0 the library was built by\n * default without iTXt support. Also note that when iTXt *is* supported,\n * the \"lang\" and \"lang_key\" fields contain NULL pointers when the\n * \"compression\" field contains * PNG_TEXT_COMPRESSION_NONE or\n * PNG_TEXT_COMPRESSION_zTXt. Note that the \"compression value\" is not the\n * same as what appears in the PNG tEXt/zTXt/iTXt chunk's \"compression flag\"\n * which is always 0 or 1, or its \"compression method\" which is always 0.\n */\ntypedef struct png_text_struct\n{\n   int  compression;       /* compression value:\n                             -1: tEXt, none\n                              0: zTXt, deflate\n                              1: iTXt, none\n                              2: iTXt, deflate  */\n   png_charp key;          /* keyword, 1-79 character description of \"text\" */\n   png_charp text;         /* comment, may be an empty string (ie \"\")\n                              or a NULL pointer */\n   png_size_t text_length; /* length of the text string */\n   png_size_t itxt_length; /* length of the itxt string */\n   png_charp lang;         /* language code, 0-79 characters\n                              or a NULL pointer */\n   png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more\n                              chars or a NULL pointer */\n} png_text;\ntypedef png_text * png_textp;\ntypedef const png_text * png_const_textp;\ntypedef png_text * * png_textpp;\n#endif\n\n/* Supported compression types for text in PNG files (tEXt, and zTXt).\n * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */\n#define PNG_TEXT_COMPRESSION_NONE_WR -3\n#define PNG_TEXT_COMPRESSION_zTXt_WR -2\n#define PNG_TEXT_COMPRESSION_NONE    -1\n#define PNG_TEXT_COMPRESSION_zTXt     0\n#define PNG_ITXT_COMPRESSION_NONE     1\n#define PNG_ITXT_COMPRESSION_zTXt     2\n#define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */\n\n/* png_time is a way to hold the time in an machine independent way.\n * Two conversions are provided, both from time_t and struct tm.  There\n * is no portable way to convert to either of these structures, as far\n * as I know.  If you know of a portable way, send it to me.  As a side\n * note - PNG has always been Year 2000 compliant!\n */\ntypedef struct png_time_struct\n{\n   png_uint_16 year; /* full year, as in, 1995 */\n   png_byte month;   /* month of year, 1 - 12 */\n   png_byte day;     /* day of month, 1 - 31 */\n   png_byte hour;    /* hour of day, 0 - 23 */\n   png_byte minute;  /* minute of hour, 0 - 59 */\n   png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */\n} png_time;\ntypedef png_time * png_timep;\ntypedef const png_time * png_const_timep;\ntypedef png_time * * png_timepp;\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n/* png_unknown_chunk is a structure to hold queued chunks for which there is\n * no specific support.  The idea is that we can use this to queue\n * up private chunks for output even though the library doesn't actually\n * know about their semantics.\n *\n * The data in the structure is set by libpng on read and used on write.\n */\ntypedef struct png_unknown_chunk_t\n{\n    png_byte name[5]; /* Textual chunk name with '\\0' terminator */\n    png_byte *data;   /* Data, should not be modified on read! */\n    png_size_t size;\n\n    /* On write 'location' must be set using the flag values listed below.\n     * Notice that on read it is set by libpng however the values stored have\n     * more bits set than are listed below.  Always treat the value as a\n     * bitmask.  On write set only one bit - setting multiple bits may cause the\n     * chunk to be written in multiple places.\n     */\n    png_byte location; /* mode of operation at read time */\n}\npng_unknown_chunk;\n\ntypedef png_unknown_chunk * png_unknown_chunkp;\ntypedef const png_unknown_chunk * png_const_unknown_chunkp;\ntypedef png_unknown_chunk * * png_unknown_chunkpp;\n#endif\n\n/* Flag values for the unknown chunk location byte. */\n#define PNG_HAVE_IHDR  0x01\n#define PNG_HAVE_PLTE  0x02\n#define PNG_AFTER_IDAT 0x08\n\n/* Maximum positive integer used in PNG is (2^31)-1 */\n#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)\n#define PNG_UINT_32_MAX ((png_uint_32)(-1))\n#define PNG_SIZE_MAX ((png_size_t)(-1))\n\n/* These are constants for fixed point values encoded in the\n * PNG specification manner (x100000)\n */\n#define PNG_FP_1    100000\n#define PNG_FP_HALF  50000\n#define PNG_FP_MAX  ((png_fixed_point)0x7fffffffL)\n#define PNG_FP_MIN  (-PNG_FP_MAX)\n\n/* These describe the color_type field in png_info. */\n/* color type masks */\n#define PNG_COLOR_MASK_PALETTE    1\n#define PNG_COLOR_MASK_COLOR      2\n#define PNG_COLOR_MASK_ALPHA      4\n\n/* color types.  Note that not all combinations are legal */\n#define PNG_COLOR_TYPE_GRAY 0\n#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)\n#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)\n#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)\n#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)\n/* aliases */\n#define PNG_COLOR_TYPE_RGBA  PNG_COLOR_TYPE_RGB_ALPHA\n#define PNG_COLOR_TYPE_GA  PNG_COLOR_TYPE_GRAY_ALPHA\n\n/* This is for compression type. PNG 1.0-1.2 only define the single type. */\n#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */\n#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE\n\n/* This is for filter type. PNG 1.0-1.2 only define the single type. */\n#define PNG_FILTER_TYPE_BASE      0 /* Single row per-byte filtering */\n#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */\n#define PNG_FILTER_TYPE_DEFAULT   PNG_FILTER_TYPE_BASE\n\n/* These are for the interlacing type.  These values should NOT be changed. */\n#define PNG_INTERLACE_NONE        0 /* Non-interlaced image */\n#define PNG_INTERLACE_ADAM7       1 /* Adam7 interlacing */\n#define PNG_INTERLACE_LAST        2 /* Not a valid value */\n\n/* These are for the oFFs chunk.  These values should NOT be changed. */\n#define PNG_OFFSET_PIXEL          0 /* Offset in pixels */\n#define PNG_OFFSET_MICROMETER     1 /* Offset in micrometers (1/10^6 meter) */\n#define PNG_OFFSET_LAST           2 /* Not a valid value */\n\n/* These are for the pCAL chunk.  These values should NOT be changed. */\n#define PNG_EQUATION_LINEAR       0 /* Linear transformation */\n#define PNG_EQUATION_BASE_E       1 /* Exponential base e transform */\n#define PNG_EQUATION_ARBITRARY    2 /* Arbitrary base exponential transform */\n#define PNG_EQUATION_HYPERBOLIC   3 /* Hyperbolic sine transformation */\n#define PNG_EQUATION_LAST         4 /* Not a valid value */\n\n/* These are for the sCAL chunk.  These values should NOT be changed. */\n#define PNG_SCALE_UNKNOWN         0 /* unknown unit (image scale) */\n#define PNG_SCALE_METER           1 /* meters per pixel */\n#define PNG_SCALE_RADIAN          2 /* radians per pixel */\n#define PNG_SCALE_LAST            3 /* Not a valid value */\n\n/* These are for the pHYs chunk.  These values should NOT be changed. */\n#define PNG_RESOLUTION_UNKNOWN    0 /* pixels/unknown unit (aspect ratio) */\n#define PNG_RESOLUTION_METER      1 /* pixels/meter */\n#define PNG_RESOLUTION_LAST       2 /* Not a valid value */\n\n/* These are for the sRGB chunk.  These values should NOT be changed. */\n#define PNG_sRGB_INTENT_PERCEPTUAL 0\n#define PNG_sRGB_INTENT_RELATIVE   1\n#define PNG_sRGB_INTENT_SATURATION 2\n#define PNG_sRGB_INTENT_ABSOLUTE   3\n#define PNG_sRGB_INTENT_LAST       4 /* Not a valid value */\n\n/* This is for text chunks */\n#define PNG_KEYWORD_MAX_LENGTH     79\n\n/* Maximum number of entries in PLTE/sPLT/tRNS arrays */\n#define PNG_MAX_PALETTE_LENGTH    256\n\n/* These determine if an ancillary chunk's data has been successfully read\n * from the PNG header, or if the application has filled in the corresponding\n * data in the info_struct to be written into the output file.  The values\n * of the PNG_INFO_<chunk> defines should NOT be changed.\n */\n#define PNG_INFO_gAMA 0x0001\n#define PNG_INFO_sBIT 0x0002\n#define PNG_INFO_cHRM 0x0004\n#define PNG_INFO_PLTE 0x0008\n#define PNG_INFO_tRNS 0x0010\n#define PNG_INFO_bKGD 0x0020\n#define PNG_INFO_hIST 0x0040\n#define PNG_INFO_pHYs 0x0080\n#define PNG_INFO_oFFs 0x0100\n#define PNG_INFO_tIME 0x0200\n#define PNG_INFO_pCAL 0x0400\n#define PNG_INFO_sRGB 0x0800   /* GR-P, 0.96a */\n#define PNG_INFO_iCCP 0x1000   /* ESR, 1.0.6 */\n#define PNG_INFO_sPLT 0x2000   /* ESR, 1.0.6 */\n#define PNG_INFO_sCAL 0x4000   /* ESR, 1.0.6 */\n#define PNG_INFO_IDAT 0x8000   /* ESR, 1.0.6 */\n\n/* This is used for the transformation routines, as some of them\n * change these values for the row.  It also should enable using\n * the routines for other purposes.\n */\ntypedef struct png_row_info_struct\n{\n   png_uint_32 width;    /* width of row */\n   png_size_t rowbytes;  /* number of bytes in row */\n   png_byte color_type;  /* color type of row */\n   png_byte bit_depth;   /* bit depth of row */\n   png_byte channels;    /* number of channels (1, 2, 3, or 4) */\n   png_byte pixel_depth; /* bits per pixel (depth * channels) */\n} png_row_info;\n\ntypedef png_row_info * png_row_infop;\ntypedef png_row_info * * png_row_infopp;\n\n/* These are the function types for the I/O functions and for the functions\n * that allow the user to override the default I/O functions with his or her\n * own.  The png_error_ptr type should match that of user-supplied warning\n * and error functions, while the png_rw_ptr type should match that of the\n * user read/write data functions.  Note that the 'write' function must not\n * modify the buffer it is passed. The 'read' function, on the other hand, is\n * expected to return the read data in the buffer.\n */\ntypedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));\ntypedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t));\ntypedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));\ntypedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,\n    int));\ntypedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32,\n    int));\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\ntypedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop));\ntypedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop));\n\n/* The following callback receives png_uint_32 row_number, int pass for the\n * png_bytep data of the row.  When transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\ntypedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep,\n    png_uint_32, int));\n#endif\n\n#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \\\n    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)\ntypedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop,\n    png_bytep));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\ntypedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,\n    png_unknown_chunkp));\n#endif\n#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED\n/* not used anywhere */\n/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n/* This must match the function definition in <setjmp.h>, and the application\n * must include this before png.h to obtain the definition of jmp_buf.  The\n * function is required to be PNG_NORETURN, but this is not checked.  If the\n * function does return the application will crash via an abort() or similar\n * system level call.\n *\n * If you get a warning here while building the library you may need to make\n * changes to ensure that pnglibconf.h records the calling convention used by\n * your compiler.  This may be very difficult - try using a different compiler\n * to build the library!\n */\nPNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);\n#endif\n\n/* Transform masks for the high-level interface */\n#define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */\n#define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */\n#define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */\n#define PNG_TRANSFORM_PACKING        0x0004    /* read and write */\n#define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */\n#define PNG_TRANSFORM_EXPAND         0x0010    /* read only */\n#define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */\n#define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */\n#define PNG_TRANSFORM_BGR            0x0080    /* read and write */\n#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */\n#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */\n#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */\n#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* write only */\n/* Added to libpng-1.2.34 */\n#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER\n#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */\n/* Added to libpng-1.4.0 */\n#define PNG_TRANSFORM_GRAY_TO_RGB   0x2000      /* read only */\n/* Added to libpng-1.5.4 */\n#define PNG_TRANSFORM_EXPAND_16     0x4000      /* read only */\n#define PNG_TRANSFORM_SCALE_16      0x8000      /* read only */\n\n/* Flags for MNG supported features */\n#define PNG_FLAG_MNG_EMPTY_PLTE     0x01\n#define PNG_FLAG_MNG_FILTER_64      0x04\n#define PNG_ALL_MNG_FEATURES        0x05\n\n/* NOTE: prior to 1.5 these functions had no 'API' style declaration,\n * this allowed the zlib default functions to be used on Windows\n * platforms.  In 1.5 the zlib default malloc (which just calls malloc and\n * ignores the first argument) should be completely compatible with the\n * following.\n */\ntypedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,\n    png_alloc_size_t));\ntypedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp));\n\n/* Section 3: exported functions\n * Here are the function definitions most commonly used.  This is not\n * the place to find out how to use libpng.  See libpng-manual.txt for the\n * full explanation, see example.c for the summary.  This just provides\n * a simple one line description of the use of each function.\n *\n * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in\n * pngconf.h and in the *.dfn files in the scripts directory.\n *\n *   PNG_EXPORT(ordinal, type, name, (args));\n *\n *       ordinal:    ordinal that is used while building\n *                   *.def files. The ordinal value is only\n *                   relevant when preprocessing png.h with\n *                   the *.dfn files for building symbol table\n *                   entries, and are removed by pngconf.h.\n *       type:       return type of the function\n *       name:       function name\n *       args:       function arguments, with types\n *\n * When we wish to append attributes to a function prototype we use\n * the PNG_EXPORTA() macro instead.\n *\n *   PNG_EXPORTA(ordinal, type, name, (args), attributes);\n *\n *       ordinal, type, name, and args: same as in PNG_EXPORT().\n *       attributes: function attributes\n */\n\n/* Returns the version number of the library */\nPNG_EXPORT(1, png_uint_32, png_access_version_number, (void));\n\n/* Tell lib we have already handled the first <num_bytes> magic bytes.\n * Handling more than 8 bytes from the beginning of the file is an error.\n */\nPNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));\n\n/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a\n * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG\n * signature, and non-zero otherwise.  Having num_to_check == 0 or\n * start > 7 will always fail (ie return non-zero).\n */\nPNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,\n    png_size_t num_to_check));\n\n/* Simple signature checking function.  This is the same as calling\n * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).\n */\n#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))\n\n/* Allocate and initialize png_ptr struct for reading, and any other memory. */\nPNG_EXPORTA(4, png_structp, png_create_read_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr,\n    png_error_ptr error_fn, png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\n/* Allocate and initialize png_ptr struct for writing, and any other memory */\nPNG_EXPORTA(5, png_structp, png_create_write_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\nPNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,\n    (png_const_structrp png_ptr));\n\nPNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,\n    png_size_t size));\n\n/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp\n * match up.\n */\n#ifdef PNG_SETJMP_SUPPORTED\n/* This function returns the jmp_buf built in to *png_ptr.  It must be\n * supplied with an appropriate 'longjmp' function to use on that jmp_buf\n * unless the default error function is overridden in which case NULL is\n * acceptable.  The size of the jmp_buf is checked against the actual size\n * allocated by the library - the call will return NULL on a mismatch\n * indicating an ABI mismatch.\n */\nPNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr,\n    png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));\n#  define png_jmpbuf(png_ptr) \\\n      (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))\n#else\n#  define png_jmpbuf(png_ptr) \\\n      (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)\n#endif\n/* This function should be used by libpng applications in place of\n * longjmp(png_ptr->jmpbuf, val).  If longjmp_fn() has been set, it\n * will use it; otherwise it will call PNG_ABORT().  This function was\n * added in libpng-1.5.0.\n */\nPNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val),\n    PNG_NORETURN);\n\n#ifdef PNG_READ_SUPPORTED\n/* Reset the compression stream */\nPNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED);\n#endif\n\n/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(11, png_structp, png_create_read_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\nPNG_EXPORTA(12, png_structp, png_create_write_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\n#endif\n\n/* Write the PNG file signature. */\nPNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));\n\n/* Write a PNG chunk - size, type, (optional) data, CRC. */\nPNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep\n    chunk_name, png_const_bytep data, png_size_t length));\n\n/* Write the start of a PNG chunk - length and chunk name. */\nPNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,\n    png_const_bytep chunk_name, png_uint_32 length));\n\n/* Write the data of a PNG chunk started with png_write_chunk_start(). */\nPNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,\n    png_const_bytep data, png_size_t length));\n\n/* Finish a chunk started with png_write_chunk_start() (includes CRC). */\nPNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));\n\n/* Allocate and initialize the info structure */\nPNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),\n    PNG_ALLOCATED);\n\n/* DEPRECATED: this function allowed init structures to be created using the\n * default allocation method (typically malloc).  Use is deprecated in 1.6.0 and\n * the API will be removed in the future.\n */\nPNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,\n    png_size_t png_info_struct_size), PNG_DEPRECATED);\n\n/* Writes all the PNG information before the image. */\nPNG_EXPORT(20, void, png_write_info_before_PLTE,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(21, void, png_write_info,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the information before the actual image data. */\nPNG_EXPORT(22, void, png_read_info,\n    (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n#ifdef PNG_TIME_RFC1123_SUPPORTED\n   /* Convert to a US string format: there is no localization support in this\n    * routine.  The original implementation used a 29 character buffer in\n    * png_struct, this will be removed in future versions.\n    */\n#if PNG_LIBPNG_VER < 10700\n/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */\nPNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr,\n    png_const_timep ptime),PNG_DEPRECATED);\n#endif\nPNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29],\n    png_const_timep ptime));\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n/* Convert from a struct tm to png_time */\nPNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,\n    const struct tm * ttime));\n\n/* Convert from time_t to png_time.  Uses gmtime() */\nPNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime));\n#endif /* PNG_CONVERT_tIME_SUPPORTED */\n\n#ifdef PNG_READ_EXPAND_SUPPORTED\n/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */\nPNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr));\nPNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr));\nPNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr));\nPNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_EXPAND_16_SUPPORTED\n/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion\n * of a tRNS chunk if present.\n */\nPNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)\n/* Use blue, green, red order for pixels. */\nPNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED\n/* Expand the grayscale to 24-bit RGB if necessary. */\nPNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED\n/* Reduce RGB to grayscale. */\n#define PNG_ERROR_ACTION_NONE  1\n#define PNG_ERROR_ACTION_WARN  2\n#define PNG_ERROR_ACTION_ERROR 3\n#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/\n\nPNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr,\n    int error_action, double red, double green))\nPNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr,\n    int error_action, png_fixed_point red, png_fixed_point green))\n\nPNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp\n    png_ptr));\n#endif\n\n#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\nPNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,\n    png_colorp palette));\n#endif\n\n#ifdef PNG_READ_ALPHA_MODE_SUPPORTED\n/* How the alpha channel is interpreted - this affects how the color channels of\n * a PNG file are returned when an alpha channel, or tRNS chunk in a palette\n * file, is present.\n *\n * This has no effect on the way pixels are written into a PNG output\n * datastream. The color samples in a PNG datastream are never premultiplied\n * with the alpha samples.\n *\n * The default is to return data according to the PNG specification: the alpha\n * channel is a linear measure of the contribution of the pixel to the\n * corresponding composited pixel.  The gamma encoded color channels must be\n * scaled according to the contribution and to do this it is necessary to undo\n * the encoding, scale the color values, perform the composition and reencode\n * the values.  This is the 'PNG' mode.\n *\n * The alternative is to 'associate' the alpha with the color information by\n * storing color channel values that have been scaled by the alpha.  The\n * advantage is that the color channels can be resampled (the image can be\n * scaled) in this form.  The disadvantage is that normal practice is to store\n * linear, not (gamma) encoded, values and this requires 16-bit channels for\n * still images rather than the 8-bit channels that are just about sufficient if\n * gamma encoding is used.  In addition all non-transparent pixel values,\n * including completely opaque ones, must be gamma encoded to produce the final\n * image.  This is the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' mode (the\n * latter being the two common names for associated alpha color channels.)\n *\n * Since it is not necessary to perform arithmetic on opaque color values so\n * long as they are not to be resampled and are in the final color space it is\n * possible to optimize the handling of alpha by storing the opaque pixels in\n * the PNG format (adjusted for the output color space) while storing partially\n * opaque pixels in the standard, linear, format.  The accuracy required for\n * standard alpha composition is relatively low, because the pixels are\n * isolated, therefore typically the accuracy loss in storing 8-bit linear\n * values is acceptable.  (This is not true if the alpha channel is used to\n * simulate transparency over large areas - use 16 bits or the PNG mode in\n * this case!)  This is the 'OPTIMIZED' mode.  For this mode a pixel is\n * treated as opaque only if the alpha value is equal to the maximum value.\n *\n * The final choice is to gamma encode the alpha channel as well.  This is\n * broken because, in practice, no implementation that uses this choice\n * correctly undoes the encoding before handling alpha composition.  Use this\n * choice only if other serious errors in the software or hardware you use\n * mandate it; the typical serious error is for dark halos to appear around\n * opaque areas of the composited PNG image because of arithmetic overflow.\n *\n * The API function png_set_alpha_mode specifies which of these choices to use\n * with an enumerated 'mode' value and the gamma of the required output:\n */\n#define PNG_ALPHA_PNG           0 /* according to the PNG standard */\n#define PNG_ALPHA_STANDARD      1 /* according to Porter/Duff */\n#define PNG_ALPHA_ASSOCIATED    1 /* as above; this is the normal practice */\n#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */\n#define PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */\n#define PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */\n\nPNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode,\n    double output_gamma))\nPNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,\n    int mode, png_fixed_point output_gamma))\n#endif\n\n#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)\n/* The output_gamma value is a screen gamma in libpng terminology: it expresses\n * how to decode the output values, not how they are encoded.  The values used\n * correspond to the normal numbers used to describe the overall gamma of a\n * computer display system; for example 2.2 for an sRGB conformant system.  The\n * values are scaled by 100000 in the _fixed version of the API (so 220000 for\n * sRGB.)\n *\n * The inverse of the value is always used to provide a default for the PNG file\n * encoding if it has no gAMA chunk and if png_set_gamma() has not been called\n * to override the PNG gamma information.\n *\n * When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode\n * opaque pixels however pixels with lower alpha values are not encoded,\n * regardless of the output gamma setting.\n *\n * When the standard Porter Duff handling is requested with mode 1 the output\n * encoding is set to be linear and the output_gamma value is only relevant\n * as a default for input data that has no gamma information.  The linear output\n * encoding will be overridden if png_set_gamma() is called - the results may be\n * highly unexpected!\n *\n * The following numbers are derived from the sRGB standard and the research\n * behind it.  sRGB is defined to be approximated by a PNG gAMA chunk value of\n * 0.45455 (1/2.2) for PNG.  The value implicitly includes any viewing\n * correction required to take account of any differences in the color\n * environment of the original scene and the intended display environment; the\n * value expresses how to *decode* the image for display, not how the original\n * data was *encoded*.\n *\n * sRGB provides a peg for the PNG standard by defining a viewing environment.\n * sRGB itself, and earlier TV standards, actually use a more complex transform\n * (a linear portion then a gamma 2.4 power law) than PNG can express.  (PNG is\n * limited to simple power laws.)  By saying that an image for direct display on\n * an sRGB conformant system should be stored with a gAMA chunk value of 45455\n * (11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification\n * makes it possible to derive values for other display systems and\n * environments.\n *\n * The Mac value is deduced from the sRGB based on an assumption that the actual\n * extra viewing correction used in early Mac display systems was implemented as\n * a power 1.45 lookup table.\n *\n * Any system where a programmable lookup table is used or where the behavior of\n * the final display device characteristics can be changed requires system\n * specific code to obtain the current characteristic.  However this can be\n * difficult and most PNG gamma correction only requires an approximate value.\n *\n * By default, if png_set_alpha_mode() is not called, libpng assumes that all\n * values are unencoded, linear, values and that the output device also has a\n * linear characteristic.  This is only very rarely correct - it is invariably\n * better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the\n * default if you don't know what the right answer is!\n *\n * The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS\n * 10.6) which used a correction table to implement a somewhat lower gamma on an\n * otherwise sRGB system.\n *\n * Both these values are reserved (not simple gamma values) in order to allow\n * more precise correction internally in the future.\n *\n * NOTE: the following values can be passed to either the fixed or floating\n * point APIs, but the floating point API will also accept floating point\n * values.\n */\n#define PNG_DEFAULT_sRGB -1       /* sRGB gamma and color space */\n#define PNG_GAMMA_MAC_18 -2       /* Old Mac '1.8' gamma and color space */\n#define PNG_GAMMA_sRGB   220000   /* Television standards--matches sRGB gamma */\n#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */\n#endif\n\n/* The following are examples of calls to png_set_alpha_mode to achieve the\n * required overall gamma correction and, where necessary, alpha\n * premultiplication.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n *    This is the default libpng handling of the alpha channel - it is not\n *    pre-multiplied into the color components.  In addition the call states\n *    that the output is for a sRGB system and causes all PNG files without gAMA\n *    chunks to be assumed to be encoded using sRGB.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    In this case the output is assumed to be something like an sRGB conformant\n *    display preceeded by a power-law lookup table of power 1.45.  This is how\n *    early Mac systems behaved.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);\n *    This is the classic Jim Blinn approach and will work in academic\n *    environments where everything is done by the book.  It has the shortcoming\n *    of assuming that input PNG data with no gamma information is linear - this\n *    is unlikely to be correct unless the PNG files where generated locally.\n *    Most of the time the output precision will be so low as to show\n *    significant banding in dark areas of the image.\n *\n * png_set_expand_16(pp);\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB);\n *    This is a somewhat more realistic Jim Blinn inspired approach.  PNG files\n *    are assumed to have the sRGB encoding if not marked with a gamma value and\n *    the output is always 16 bits per component.  This permits accurate scaling\n *    and processing of the data.  If you know that your input PNG files were\n *    generated locally you might need to replace PNG_DEFAULT_sRGB with the\n *    correct value for your system.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB);\n *    If you just need to composite the PNG image onto an existing background\n *    and if you control the code that does this you can use the optimization\n *    setting.  In this case you just copy completely opaque pixels to the\n *    output.  For pixels that are not completely transparent (you just skip\n *    those) you do the composition math using png_composite or png_composite_16\n *    below then encode the resultant 8-bit or 16-bit values to match the output\n *    encoding.\n *\n * Other cases\n *    If neither the PNG nor the standard linear encoding work for you because\n *    of the software or hardware you use then you have a big problem.  The PNG\n *    case will probably result in halos around the image.  The linear encoding\n *    will probably result in a washed out, too bright, image (it's actually too\n *    contrasty.)  Try the ALPHA_OPTIMIZED mode above - this will probably\n *    substantially reduce the halos.  Alternatively try:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB);\n *    This option will also reduce the halos, but there will be slight dark\n *    halos round the opaque parts of the image where the background is light.\n *    In the OPTIMIZED mode the halos will be light halos where the background\n *    is dark.  Take your pick - the halos are unavoidable unless you can get\n *    your hardware/software fixed!  (The OPTIMIZED approach is slightly\n *    faster.)\n *\n * When the default gamma of PNG files doesn't match the output gamma.\n *    If you have PNG files with no gamma information png_set_alpha_mode allows\n *    you to provide a default gamma, but it also sets the ouput gamma to the\n *    matching value.  If you know your PNG files have a gamma that doesn't\n *    match the output you can take advantage of the fact that\n *    png_set_alpha_mode always sets the output gamma but only sets the PNG\n *    default if it is not already set:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    The first call sets both the default and the output gamma values, the\n *    second call overrides the output gamma without changing the default.  This\n *    is easier than achieving the same effect with png_set_gamma.  You must use\n *    PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will\n *    fire if more than one call to png_set_alpha_mode and png_set_background is\n *    made in the same read operation, however multiple calls with PNG_ALPHA_PNG\n *    are ignored.\n */\n\n#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED\nPNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)\nPNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)\nPNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)\n/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler,\n    int flags));\n/* The values of the PNG_FILLER_ defines should NOT be changed */\n#  define PNG_FILLER_BEFORE 0\n#  define PNG_FILLER_AFTER 1\n/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr,\n    png_uint_32 filler, int flags));\n#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */\n\n#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)\n/* Swap bytes in 16-bit depth files. */\nPNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)\n/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */\nPNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \\\n    defined(PNG_WRITE_PACKSWAP_SUPPORTED)\n/* Swap packing order of pixels in bytes. */\nPNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)\n/* Converts files to legal bit depths. */\nPNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p\n    true_bits));\n#endif\n\n#if defined(PNG_READ_INTERLACING_SUPPORTED) || \\\n    defined(PNG_WRITE_INTERLACING_SUPPORTED)\n/* Have the code handle the interlacing.  Returns the number of passes.\n * MUST be called before png_read_update_info or png_start_read_image,\n * otherwise it will not have the desired effect.  Note that it is still\n * necessary to call png_read_row or png_read_rows png_get_image_height\n * times for each pass.\n*/\nPNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)\n/* Invert monochrome files */\nPNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n/* Handle alpha and tRNS by replacing with a background color.  Prior to\n * libpng-1.5.4 this API must not be called before the PNG file header has been\n * read.  Doing so will result in unexpected behavior and possible warnings or\n * errors if the PNG file contains a bKGD chunk.\n */\nPNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, double background_gamma))\nPNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, png_fixed_point background_gamma))\n#endif\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n#  define PNG_BACKGROUND_GAMMA_UNKNOWN 0\n#  define PNG_BACKGROUND_GAMMA_SCREEN  1\n#  define PNG_BACKGROUND_GAMMA_FILE    2\n#  define PNG_BACKGROUND_GAMMA_UNIQUE  3\n#endif\n\n#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED\n/* Scale a 16-bit depth file down to 8-bit, accurately. */\nPNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */\n/* Strip the second byte of information from a 16-bit depth file. */\nPNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_QUANTIZE_SUPPORTED\n/* Turn on quantizing, and reduce the palette to the number of colors\n * available.\n */\nPNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr,\n    png_colorp palette, int num_palette, int maximum_colors,\n    png_const_uint_16p histogram, int full_quantize));\n#endif\n\n#ifdef PNG_READ_GAMMA_SUPPORTED\n/* The threshold on gamma processing is configurable but hard-wired into the\n * library.  The following is the floating point variant.\n */\n#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001)\n\n/* Handle gamma correction. Screen_gamma=(display_exponent).\n * NOTE: this API simply sets the screen and file gamma values. It will\n * therefore override the value for gamma in a PNG file if it is called after\n * the file header has been read - use with care  - call before reading the PNG\n * file for best results!\n *\n * These routines accept the same gamma values as png_set_alpha_mode (described\n * above).  The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either\n * API (floating point or fixed.)  Notice, however, that the 'file_gamma' value\n * is the inverse of a 'screen gamma' value.\n */\nPNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr,\n    double screen_gamma, double override_file_gamma))\nPNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr,\n    png_fixed_point screen_gamma, png_fixed_point override_file_gamma))\n#endif\n\n#ifdef PNG_WRITE_FLUSH_SUPPORTED\n/* Set how many lines between output flushes - 0 for no flushing */\nPNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows));\n/* Flush the current PNG output buffer */\nPNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr));\n#endif\n\n/* Optional update palette with requested transformations */\nPNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr));\n\n/* Optional call to update the users info structure */\nPNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read one or more rows of image data. */\nPNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row,\n    png_bytepp display_row, png_uint_32 num_rows));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read a row of data. */\nPNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row,\n    png_bytep display_row));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the whole image into memory at once. */\nPNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image));\n#endif\n\n/* Write a row of image data */\nPNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr,\n    png_const_bytep row));\n\n/* Write a few rows of image data: (*row) is not written; however, the type\n * is declared as writeable to maintain compatibility with previous versions\n * of libpng and to allow the 'display_row' array from read_rows to be passed\n * unchanged to write_rows.\n */\nPNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row,\n    png_uint_32 num_rows));\n\n/* Write the image data */\nPNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image));\n\n/* Write the end of the PNG file. */\nPNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the end of the PNG file. */\nPNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n/* Free any memory associated with the png_info_struct */\nPNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Set the libpng method of handling chunk CRC errors */\nPNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,\n    int ancil_action));\n\n/* Values for png_set_crc_action() say how to handle CRC errors in\n * ancillary and critical chunks, and whether to use the data contained\n * therein.  Note that it is impossible to \"discard\" data in a critical\n * chunk.  For versions prior to 0.90, the action was always error/quit,\n * whereas in version 0.90 and later, the action for CRC errors in ancillary\n * chunks is warn/discard.  These values should NOT be changed.\n *\n *      value                       action:critical     action:ancillary\n */\n#define PNG_CRC_DEFAULT       0  /* error/quit          warn/discard data */\n#define PNG_CRC_ERROR_QUIT    1  /* error/quit          error/quit        */\n#define PNG_CRC_WARN_DISCARD  2  /* (INVALID)           warn/discard data */\n#define PNG_CRC_WARN_USE      3  /* warn/use data       warn/use data     */\n#define PNG_CRC_QUIET_USE     4  /* quiet/use data      quiet/use data    */\n#define PNG_CRC_NO_CHANGE     5  /* use current value   use current value */\n\n/* These functions give the user control over the scan-line filtering in\n * libpng and the compression methods used by zlib.  These functions are\n * mainly useful for testing, as the defaults should work with most users.\n * Those users who are tight on memory or want faster performance at the\n * expense of compression can modify them.  See the compression library\n * header file (zlib.h) for an explination of the compression functions.\n */\n\n/* Set the filtering method(s) used by libpng.  Currently, the only valid\n * value for \"method\" is 0.\n */\nPNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,\n    int filters));\n\n/* Flags for png_set_filter() to say which filters to use.  The flags\n * are chosen so that they don't conflict with real filter types\n * below, in case they are supplied instead of the #defined constants.\n * These values should NOT be changed.\n */\n#define PNG_NO_FILTERS     0x00\n#define PNG_FILTER_NONE    0x08\n#define PNG_FILTER_SUB     0x10\n#define PNG_FILTER_UP      0x20\n#define PNG_FILTER_AVG     0x40\n#define PNG_FILTER_PAETH   0x80\n#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \\\n                         PNG_FILTER_AVG | PNG_FILTER_PAETH)\n\n/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.\n * These defines should NOT be changed.\n */\n#define PNG_FILTER_VALUE_NONE  0\n#define PNG_FILTER_VALUE_SUB   1\n#define PNG_FILTER_VALUE_UP    2\n#define PNG_FILTER_VALUE_AVG   3\n#define PNG_FILTER_VALUE_PAETH 4\n#define PNG_FILTER_VALUE_LAST  5\n\n#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */\n/* The \"heuristic_method\" is given by one of the PNG_FILTER_HEURISTIC_\n * defines, either the default (minimum-sum-of-absolute-differences), or\n * the experimental method (weighted-minimum-sum-of-absolute-differences).\n *\n * Weights are factors >= 1.0, indicating how important it is to keep the\n * filter type consistent between rows.  Larger numbers mean the current\n * filter is that many times as likely to be the same as the \"num_weights\"\n * previous filters.  This is cumulative for each previous row with a weight.\n * There needs to be \"num_weights\" values in \"filter_weights\", or it can be\n * NULL if the weights aren't being specified.  Weights have no influence on\n * the selection of the first row filter.  Well chosen weights can (in theory)\n * improve the compression for a given image.\n *\n * Costs are factors >= 1.0 indicating the relative decoding costs of a\n * filter type.  Higher costs indicate more decoding expense, and are\n * therefore less likely to be selected over a filter with lower computational\n * costs.  There needs to be a value in \"filter_costs\" for each valid filter\n * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't\n * setting the costs.  Costs try to improve the speed of decompression without\n * unduly increasing the compressed image size.\n *\n * A negative weight or cost indicates the default value is to be used, and\n * values in the range [0.0, 1.0) indicate the value is to remain unchanged.\n * The default values for both weights and costs are currently 1.0, but may\n * change if good general weighting/cost heuristics can be found.  If both\n * the weights and costs are set to 1.0, this degenerates the WEIGHTED method\n * to the UNWEIGHTED method, but with added encoding time/computation.\n */\nPNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr,\n    int heuristic_method, int num_weights, png_const_doublep filter_weights,\n    png_const_doublep filter_costs))\nPNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,\n    (png_structrp png_ptr, int heuristic_method, int num_weights,\n    png_const_fixed_point_p filter_weights,\n    png_const_fixed_point_p filter_costs))\n#endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */\n\n/* Heuristic used for row filter selection.  These defines should NOT be\n * changed.\n */\n#define PNG_FILTER_HEURISTIC_DEFAULT    0  /* Currently \"UNWEIGHTED\" */\n#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1  /* Used by libpng < 0.95 */\n#define PNG_FILTER_HEURISTIC_WEIGHTED   2  /* Experimental feature */\n#define PNG_FILTER_HEURISTIC_LAST       3  /* Not a valid value */\n\n#ifdef PNG_WRITE_SUPPORTED\n/* Set the library compression level.  Currently, valid values range from\n * 0 - 9, corresponding directly to the zlib compression levels 0 - 9\n * (0 - no compression, 9 - \"maximal\" compression).  Note that tests have\n * shown that zlib compression levels 3-6 usually perform as well as level 9\n * for PNG images, and do considerably fewer caclulations.  In the future,\n * these values may not correspond directly to the zlib compression levels.\n */\nPNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr,\n    int window_bits));\n\nPNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr,\n    int method));\n#endif\n\n#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n/* Also set zlib parameters for compressing non-IDAT chunks */\nPNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(225, void, png_set_text_compression_window_bits,\n    (png_structrp png_ptr, int window_bits));\n\nPNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,\n    int method));\n#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */\n\n/* These next functions are called for input/output, memory, and error\n * handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,\n * and call standard C I/O routines such as fread(), fwrite(), and\n * fprintf().  These functions can be made to use other I/O routines\n * at run time for those applications that need to handle I/O in a\n * different manner by calling png_set_???_fn().  See libpng-manual.txt for\n * more information.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n/* Initialize the input/output for the PNG file to the default functions. */\nPNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));\n#endif\n\n/* Replace the (error and abort), and warning functions with user\n * supplied functions.  If no messages are to be printed you must still\n * write and use replacement functions. The replacement error_fn should\n * still do a longjmp to the last setjmp location if you are using this\n * method of error handling.  If error_fn or warning_fn is NULL, the\n * default function will be used.\n */\n\nPNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr,\n    png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));\n\n/* Return the user pointer associated with the error functions */\nPNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr));\n\n/* Replace the default data output functions with a user supplied one(s).\n * If buffered output is not used, then output_flush_fn can be set to NULL.\n * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time\n * output_flush_fn will be ignored (and thus can be NULL).\n * It is probably a mistake to use NULL for output_flush_fn if\n * write_data_fn is not also NULL unless you have built libpng with\n * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's\n * default flush function, which uses the standard *FILE structure, will\n * be used.\n */\nPNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));\n\n/* Replace the default data input function with a user supplied one. */\nPNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr read_data_fn));\n\n/* Return the user pointer associated with the I/O functions */\nPNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr));\n\nPNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr,\n    png_read_status_ptr read_row_fn));\n\nPNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr,\n    png_write_status_ptr write_row_fn));\n\n#ifdef PNG_USER_MEM_SUPPORTED\n/* Replace the default memory allocation functions with user supplied one(s). */\nPNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr,\n    png_malloc_ptr malloc_fn, png_free_ptr free_fn));\n/* Return the user pointer associated with the memory functions */\nPNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr read_user_transform_fn));\n#endif\n\n#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr write_user_transform_fn));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED\nPNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr,\n    png_voidp user_transform_ptr, int user_transform_depth,\n    int user_transform_channels));\n/* Return the user pointer associated with the user transform functions */\nPNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,\n    (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED\n/* Return information about the row currently being processed.  Note that these\n * APIs do not fail but will return unexpected results if called outside a user\n * transform callback.  Also note that when transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\nPNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp));\nPNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));\n#endif\n\n#ifdef PNG_READ_USER_CHUNKS_SUPPORTED\n/* This callback is called only for *unknown* chunks.  If\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known\n * chunks to be treated as unknown, however in this case the callback must do\n * any processing required by the chunk (e.g. by calling the appropriate\n * png_set_ APIs.)\n *\n * There is no write support - on write, by default, all the chunks in the\n * 'unknown' list are written in the specified position.\n *\n * The integer return from the callback function is interpreted thus:\n *\n * negative: An error occured, png_chunk_error will be called.\n *     zero: The chunk was not handled, the chunk will be saved. A critical\n *           chunk will cause an error at this point unless it is to be saved.\n * positive: The chunk was handled, libpng will ignore/discard it.\n *\n * See \"INTERACTION WTIH USER CHUNK CALLBACKS\" below for important notes about\n * how this behavior will change in libpng 1.7\n */\nPNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,\n    png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\nPNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\n/* Sets the function callbacks for the push reader, and a pointer to a\n * user-defined structure available to the callback functions.\n */\nPNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr,\n    png_voidp progressive_ptr, png_progressive_info_ptr info_fn,\n    png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));\n\n/* Returns the user pointer associated with the push read functions */\nPNG_EXPORT(91, png_voidp, png_get_progressive_ptr,\n    (png_const_structrp png_ptr));\n\n/* Function to be called when data becomes available */\nPNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,\n    png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size));\n\n/* A function which may be called *only* within png_process_data to stop the\n * processing of any more data.  The function returns the number of bytes\n * remaining, excluding any that libpng has cached internally.  A subsequent\n * call to png_process_data must supply these bytes again.  If the argument\n * 'save' is set to true the routine will first save all the pending data and\n * will always return 0.\n */\nPNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));\n\n/* A function which may be called *only* outside (after) a call to\n * png_process_data.  It returns the number of bytes of data to skip in the\n * input.  Normally it will return 0, but if it returns a non-zero value the\n * application must skip than number of bytes of input data and pass the\n * following data to the next call to png_process_data.\n */\nPNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));\n\n#ifdef PNG_READ_INTERLACING_SUPPORTED\n/* Function that combines rows.  'new_row' is a flag that should come from\n * the callback and be non-NULL if anything needs to be done; the library\n * stores its own version of the new data internally and ignores the passed\n * in value.\n */\nPNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr,\n    png_bytep old_row, png_const_bytep new_row));\n#endif /* PNG_READ_INTERLACING_SUPPORTED */\n#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */\n\nPNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n/* Added at libpng version 1.4.0 */\nPNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Added at libpng version 1.2.4 */\nPNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Frees a pointer allocated by png_malloc() */\nPNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));\n\n/* Free data that was allocated internally */\nPNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 free_me, int num));\n\n/* Reassign responsibility for freeing existing data, whether allocated\n * by libpng or by the application; this works on the png_info structure passed\n * in, it does not change the state for other png_info structures.\n *\n * It is unlikely that this function works correctly as of 1.6.0 and using it\n * may result either in memory leaks or double free of allocated data.\n */\nPNG_EXPORTA(99, void, png_data_freer, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int freer, png_uint_32 mask), PNG_DEPRECATED);\n\n/* Assignments for png_data_freer */\n#define PNG_DESTROY_WILL_FREE_DATA 1\n#define PNG_SET_WILL_FREE_DATA 1\n#define PNG_USER_WILL_FREE_DATA 2\n/* Flags for png_ptr->free_me and info_ptr->free_me */\n#define PNG_FREE_HIST 0x0008\n#define PNG_FREE_ICCP 0x0010\n#define PNG_FREE_SPLT 0x0020\n#define PNG_FREE_ROWS 0x0040\n#define PNG_FREE_PCAL 0x0080\n#define PNG_FREE_SCAL 0x0100\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#  define PNG_FREE_UNKN 0x0200\n#endif\n/*      PNG_FREE_LIST 0x0400    removed in 1.6.0 because it is ignored */\n#define PNG_FREE_PLTE 0x1000\n#define PNG_FREE_TRNS 0x2000\n#define PNG_FREE_TEXT 0x4000\n#define PNG_FREE_ALL  0x7fff\n#define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */\n\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED);\nPNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr,\n    png_voidp ptr), PNG_DEPRECATED);\n#endif\n\n#ifdef PNG_ERROR_TEXT_SUPPORTED\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n/* The same, but the chunk name is prepended to the error string. */\nPNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n#else\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);\n#endif\n\n#ifdef PNG_WARNINGS_SUPPORTED\n/* Non-fatal error in libpng.  Can continue, but may have a problem. */\nPNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n/* Non-fatal error in libpng, chunk name is prepended to message. */\nPNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\n#ifdef PNG_BENIGN_ERRORS_SUPPORTED\n/* Benign error in libpng.  Can continue, but may have a problem.\n * User can choose whether to handle as a fatal error or as a warning. */\nPNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n#ifdef PNG_READ_SUPPORTED\n/* Same, chunk name is prepended to message (only during read) */\nPNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\nPNG_EXPORT(109, void, png_set_benign_errors,\n    (png_structrp png_ptr, int allowed));\n#else\n#  ifdef PNG_ALLOW_BENIGN_ERRORS\n#    define png_benign_error png_warning\n#    define png_chunk_benign_error png_chunk_warning\n#  else\n#    define png_benign_error png_error\n#    define png_chunk_benign_error png_chunk_error\n#  endif\n#endif\n\n/* The png_set_<chunk> functions are for storing values in the png_info_struct.\n * Similarly, the png_get_<chunk> calls are used to read values from the\n * png_info_struct, either storing the parameters in the passed variables, or\n * setting pointers into the png_info_struct where the data is stored.  The\n * png_get_<chunk> functions return a non-zero value if the data was available\n * in info_ptr, or return zero and do not change any of the parameters if the\n * data was not available.\n *\n * These functions should be used instead of directly accessing png_info\n * to avoid problems with future changes in the size and internal layout of\n * png_info_struct.\n */\n/* Returns \"flag\" if chunk data is valid in info_ptr. */\nPNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 flag));\n\n/* Returns number of bytes needed to hold a transformed row. */\nPNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* Returns row_pointers, which is an array of pointers to scanlines that was\n * returned from png_read_png().\n */\nPNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Set row_pointers, which is an array of pointers to scanlines for use\n * by png_write_png().\n */\nPNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytepp row_pointers));\n#endif\n\n/* Returns number of color channels in image. */\nPNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_EASY_ACCESS_SUPPORTED\n/* Returns image width in pixels. */\nPNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image height in pixels. */\nPNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image bit_depth. */\nPNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image color_type. */\nPNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image filter_type. */\nPNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image interlace_type. */\nPNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image compression_type. */\nPNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image resolution in pixels per meter, from pHYs chunk data. */\nPNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n/* Returns pixel aspect ratio, computed from pHYs chunk data.  */\nPNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\nPNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n\n/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */\nPNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(128, png_int_32, png_get_x_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(129, png_int_32, png_get_y_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n#endif /* PNG_EASY_ACCESS_SUPPORTED */\n\n#ifdef PNG_READ_SUPPORTED\n/* Returns pointer to signature string read from PNG header */\nPNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_16p *background));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_16p background));\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x,\n    double *red_y, double *green_x, double *green_y, double *blue_x,\n    double *blue_y))\nPNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z,\n    double *green_X, double *green_Y, double *green_Z, double *blue_X,\n    double *blue_Y, double *blue_Z))\nPNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_white_x, png_fixed_point *int_white_y,\n    png_fixed_point *int_red_x, png_fixed_point *int_red_y,\n    png_fixed_point *int_green_x, png_fixed_point *int_green_y,\n    png_fixed_point *int_blue_x, png_fixed_point *int_blue_y))\nPNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,\n    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,\n    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,\n    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,\n    png_fixed_point *int_blue_Z))\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr,\n    double white_x, double white_y, double red_x, double red_y, double green_x,\n    double green_y, double blue_x, double blue_y))\nPNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double red_X, double red_Y, double red_Z,\n    double green_X, double green_Y, double green_Z, double blue_X,\n    double blue_Y, double blue_Z))\nPNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_white_x,\n    png_fixed_point int_white_y, png_fixed_point int_red_x,\n    png_fixed_point int_red_y, png_fixed_point int_green_x,\n    png_fixed_point int_green_y, png_fixed_point int_blue_x,\n    png_fixed_point int_blue_y))\nPNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,\n    png_fixed_point int_red_Z, png_fixed_point int_green_X,\n    png_fixed_point int_green_Y, png_fixed_point int_green_Z,\n    png_fixed_point int_blue_X, png_fixed_point int_blue_Y,\n    png_fixed_point int_blue_Z))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *file_gamma))\nPNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_file_gamma))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double file_gamma))\nPNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_file_gamma))\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_16p *hist));\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_uint_16p hist));\n#endif\n\nPNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height,\n    int *bit_depth, int *color_type, int *interlace_method,\n    int *compression_method, int *filter_method));\n\nPNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,\n    int color_type, int interlace_method, int compression_method,\n    int filter_method));\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr,\n   png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,\n   int *unit_type));\n#endif\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y,\n    int unit_type));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charp *purpose, png_int_32 *X0,\n    png_int_32 *X1, int *type, int *nparams, png_charp *units,\n    png_charpp *params));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1,\n    int type, int nparams, png_const_charp units, png_charpp params));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));\n#endif\n\nPNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr,\n   png_inforp info_ptr, png_colorp *palette, int *num_palette));\n\nPNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_colorp palette, int num_palette));\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_8p *sig_bit));\n#endif\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_8p sig_bit));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *file_srgb_intent));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\nPNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charpp name, int *compression_type,\n    png_bytepp profile, png_uint_32 *proflen));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp name, int compression_type,\n    png_const_bytep profile, png_uint_32 proflen));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_sPLT_tpp entries));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_sPLT_tp entries, int nentries));\n#endif\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_get_text also returns the number of text chunks in *num_text */\nPNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_textp *text_ptr, int *num_text));\n#endif\n\n/* Note while png_set_text() will accept a structure whose text,\n * language, and  translated keywords are NULL pointers, the structure\n * returned by png_get_text will always contain regular\n * zero-terminated C strings.  They might be empty strings but\n * they will never be NULL pointers.\n */\n\n#ifdef PNG_TEXT_SUPPORTED\nPNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_textp text_ptr, int num_text));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_timep *mod_time));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_timep mod_time));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans,\n    png_color_16p *trans_color));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans,\n    png_const_color_16p trans_color));\n#endif\n\n#ifdef PNG_sCAL_SUPPORTED\nPNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *unit, double *width, double *height))\n#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \\\n   defined(PNG_FLOATING_POINT_SUPPORTED)\n/* NOTE: this API is currently implemented using floating point arithmetic,\n * consequently it can only be used on systems with floating point support.\n * In any case the range of values supported by png_fixed_point is small and it\n * is highly recommended that png_get_sCAL_s be used instead.\n */\nPNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_fixed_point *width, png_fixed_point *height))\n#endif\nPNG_EXPORT(169, png_uint_32, png_get_sCAL_s,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_charpp swidth, png_charpp sheight));\n\nPNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit, double width, double height))\nPNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr,\n   png_inforp info_ptr, int unit, png_fixed_point width,\n   png_fixed_point height))\nPNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit,\n    png_const_charp swidth, png_const_charp sheight));\n#endif /* PNG_sCAL_SUPPORTED */\n\n#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n/* Provide the default handling for all unknown chunks or, optionally, for\n * specific unknown chunks.\n *\n * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was\n * ignored and the default was used, the per-chunk setting only had an effect on\n * write.  If you wish to have chunk-specific handling on read in code that must\n * work on earlier versions you must use a user chunk callback to specify the\n * desired handling (keep or discard.)\n *\n * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below.  The\n * parameter is interpreted as follows:\n *\n * READ:\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Known chunks: do normal libpng processing, do not keep the chunk (but\n *          see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED)\n *       Unknown chunks: for a specific chunk use the global default, when used\n *          as the default discard the chunk data.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Discard the chunk data.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Keep the chunk data if the chunk is not critical else raise a chunk\n *       error.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Keep the chunk data.\n *\n * If the chunk data is saved it can be retrieved using png_get_unknown_chunks,\n * below.  Notice that specifying \"AS_DEFAULT\" as a global default is equivalent\n * to specifying \"NEVER\", however when \"AS_DEFAULT\" is used for specific chunks\n * it simply resets the behavior to the libpng default.\n *\n * INTERACTION WTIH USER CHUNK CALLBACKS:\n * The per-chunk handling is always used when there is a png_user_chunk_ptr\n * callback and the callback returns 0; the chunk is then always stored *unless*\n * it is critical and the per-chunk setting is other than ALWAYS.  Notice that\n * the global default is *not* used in this case.  (In effect the per-chunk\n * value is incremented to at least IF_SAFE.)\n *\n * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and\n * per-chunk defaults will be honored.  If you want to preserve the current\n * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE\n * as the default - if you don't do this libpng 1.6 will issue a warning.\n *\n * If you want unhandled unknown chunks to be discarded in libpng 1.6 and\n * earlier simply return '1' (handled).\n *\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED:\n *    If this is *not* set known chunks will always be handled by libpng and\n *    will never be stored in the unknown chunk list.  Known chunks listed to\n *    png_set_keep_unknown_chunks will have no effect.  If it is set then known\n *    chunks listed with a keep other than AS_DEFAULT will *never* be processed\n *    by libpng, in addition critical chunks must either be processed by the\n *    callback or saved.\n *\n *    The IHDR and IEND chunks must not be listed.  Because this turns off the\n *    default handling for chunks that would otherwise be recognized the\n *    behavior of libpng transformations may well become incorrect!\n *\n * WRITE:\n *    When writing chunks the options only apply to the chunks specified by\n *    png_set_unknown_chunks (below), libpng will *always* write known chunks\n *    required by png_set_ calls and will always write the core critical chunks\n *    (as required for PLTE).\n *\n *    Each chunk in the png_set_unknown_chunks list is looked up in the\n *    png_set_keep_unknown_chunks list to find the keep setting, this is then\n *    interpreted as follows:\n *\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Write safe-to-copy chunks and write other chunks if the global\n *       default is set to _ALWAYS, otherwise don't write this chunk.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Do not write the chunk.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Write the chunk if it is safe-to-copy, otherwise do not write it.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Write the chunk.\n *\n * Note that the default behavior is effectively the opposite of the read case -\n * in read unknown chunks are not stored by default, in write they are written\n * by default.  Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different\n * - on write the safe-to-copy bit is checked, on read the critical bit is\n * checked and on read if the chunk is critical an error will be raised.\n *\n * num_chunks:\n * ===========\n *    If num_chunks is positive, then the \"keep\" parameter specifies the manner\n *    for handling only those chunks appearing in the chunk_list array,\n *    otherwise the chunk list array is ignored.\n *\n *    If num_chunks is 0 the \"keep\" parameter specifies the default behavior for\n *    unknown chunks, as described above.\n *\n *    If num_chunks is negative, then the \"keep\" parameter specifies the manner\n *    for handling all unknown chunks plus all chunks recognized by libpng\n *    except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to\n *    be processed by libpng.\n */\nPNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,\n    int keep, png_const_bytep chunk_list, int num_chunks));\n\n/* The \"keep\" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned;\n * the result is therefore true (non-zero) if special handling is required,\n * false for the default handling.\n */\nPNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr,\n    png_const_bytep chunk_name));\n#endif\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\nPNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_unknown_chunkp unknowns,\n    int num_unknowns));\n   /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added\n    * unknowns to the location currently stored in the png_struct.  This is\n    * invariably the wrong value on write.  To fix this call the following API\n    * for each chunk in the list with the correct location.  If you know your\n    * code won't be compiled on earlier versions you can rely on\n    * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing\n    * the correct thing.\n    */\n\nPNG_EXPORT(175, void, png_set_unknown_chunk_location,\n    (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));\n\nPNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_unknown_chunkpp entries));\n#endif\n\n/* Png_free_data() will turn off the \"valid\" flag for anything it frees.\n * If you need to turn it off for a chunk that your application has freed,\n * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);\n */\nPNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int mask));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* The \"params\" pointer is currently not used and is for future expansion. */\nPNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\nPNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\n#endif\n\nPNG_EXPORT(180, png_const_charp, png_get_copyright,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(181, png_const_charp, png_get_header_ver,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(182, png_const_charp, png_get_header_version,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(183, png_const_charp, png_get_libpng_ver,\n    (png_const_structrp png_ptr));\n\n#ifdef PNG_MNG_FEATURES_SUPPORTED\nPNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr,\n    png_uint_32 mng_features_permitted));\n#endif\n\n/* For use in png_set_keep_unknown, added to version 1.2.6 */\n#define PNG_HANDLE_CHUNK_AS_DEFAULT   0\n#define PNG_HANDLE_CHUNK_NEVER        1\n#define PNG_HANDLE_CHUNK_IF_SAFE      2\n#define PNG_HANDLE_CHUNK_ALWAYS       3\n#define PNG_HANDLE_CHUNK_LAST         4\n\n/* Strip the prepended error numbers (\"#nnn \") from error and warning\n * messages before passing them to the error or warning handler.\n */\n#ifdef PNG_ERROR_NUMBERS_SUPPORTED\nPNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr,\n    png_uint_32 strip_mode));\n#endif\n\n/* Added in libpng-1.2.6 */\n#ifdef PNG_SET_USER_LIMITS_SUPPORTED\nPNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr,\n    png_uint_32 user_width_max, png_uint_32 user_height_max));\nPNG_EXPORT(187, png_uint_32, png_get_user_width_max,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(188, png_uint_32, png_get_user_height_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.0 */\nPNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr,\n    png_uint_32 user_chunk_cache_max));\nPNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.1 */\nPNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr,\n    png_alloc_size_t user_chunk_cache_max));\nPNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,\n    (png_const_structrp png_ptr));\n#endif\n\n#if defined(PNG_INCH_CONVERSIONS_SUPPORTED)\nPNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_FP_EXPORT(196, float, png_get_x_offset_inches,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\nPNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\n#  ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#  endif /* PNG_pHYs_SUPPORTED */\n#endif  /* PNG_INCH_CONVERSIONS_SUPPORTED */\n\n/* Added in libpng-1.4.0 */\n#ifdef PNG_IO_STATE_SUPPORTED\nPNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr));\n\n/* Removed from libpng 1.6; use png_get_io_chunk_type. */\nPNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr),\n    PNG_DEPRECATED)\n\nPNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,\n    (png_const_structrp png_ptr));\n\n/* The flags returned by png_get_io_state() are the following: */\n#  define PNG_IO_NONE        0x0000   /* no I/O at this moment */\n#  define PNG_IO_READING     0x0001   /* currently reading */\n#  define PNG_IO_WRITING     0x0002   /* currently writing */\n#  define PNG_IO_SIGNATURE   0x0010   /* currently at the file signature */\n#  define PNG_IO_CHUNK_HDR   0x0020   /* currently at the chunk header */\n#  define PNG_IO_CHUNK_DATA  0x0040   /* currently at the chunk data */\n#  define PNG_IO_CHUNK_CRC   0x0080   /* currently at the chunk crc */\n#  define PNG_IO_MASK_OP     0x000f   /* current operation: reading/writing */\n#  define PNG_IO_MASK_LOC    0x00f0   /* current location: sig/hdr/data/crc */\n#endif /* ?PNG_IO_STATE_SUPPORTED */\n\n/* Interlace support.  The following macros are always defined so that if\n * libpng interlace handling is turned off the macros may be used to handle\n * interlaced images within the application.\n */\n#define PNG_INTERLACE_ADAM7_PASSES 7\n\n/* Two macros to return the first row and first column of the original,\n * full, image which appears in a given pass.  'pass' is in the range 0\n * to 6 and the result is in the range 0 to 7.\n */\n#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7)\n#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7)\n\n/* A macro to return the offset between pixels in the output row for a pair of\n * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that\n * follows.  Note that ROW_OFFSET is the offset from one row to the next whereas\n * COL_OFFSET is from one column to the next, within a row.\n */\n#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8)\n#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1))\n\n/* Two macros to help evaluate the number of rows or columns in each\n * pass.  This is expressed as a shift - effectively log2 of the number or\n * rows or columns in each 8x8 tile of the original image.\n */\n#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3)\n#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3)\n\n/* Hence two macros to determine the number of rows or columns in a given\n * pass of an image given its height or width.  In fact these macros may\n * return non-zero even though the sub-image is empty, because the other\n * dimension may be empty for a small image.\n */\n#define PNG_PASS_ROWS(height, pass) (((height)+(((1<<PNG_PASS_ROW_SHIFT(pass))\\\n   -1)-PNG_PASS_START_ROW(pass)))>>PNG_PASS_ROW_SHIFT(pass))\n#define PNG_PASS_COLS(width, pass) (((width)+(((1<<PNG_PASS_COL_SHIFT(pass))\\\n   -1)-PNG_PASS_START_COL(pass)))>>PNG_PASS_COL_SHIFT(pass))\n\n/* For the reader row callbacks (both progressive and sequential) it is\n * necessary to find the row in the output image given a row in an interlaced\n * image, so two more macros:\n */\n#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \\\n   (((y_in)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))\n#define PNG_COL_FROM_PASS_COL(x_in, pass) \\\n   (((x_in)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))\n\n/* Two macros which return a boolean (0 or 1) saying whether the given row\n * or column is in a particular pass.  These use a common utility macro that\n * returns a mask for a given pass - the offset 'off' selects the row or\n * column version.  The mask has the appropriate bit set for each column in\n * the tile.\n */\n#define PNG_PASS_MASK(pass,off) ( \\\n   ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \\\n   ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0))\n\n#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \\\n   ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1)\n#define PNG_COL_IN_INTERLACE_PASS(x, pass) \\\n   ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1)\n\n#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED\n/* With these routines we avoid an integer divide, which will be slower on\n * most machines.  However, it does take more operations than the corresponding\n * divide method, so it may be slower on a few RISC systems.  There are two\n * shifts (by 8 or 16 bits) and an addition, versus a single integer divide.\n *\n * Note that the rounding factors are NOT supposed to be the same!  128 and\n * 32768 are correct for the NODIV code; 127 and 32767 are correct for the\n * standard method.\n *\n * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]\n */\n\n /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */\n\n#  define png_composite(composite, fg, alpha, bg)         \\\n     { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \\\n           * (png_uint_16)(alpha)                         \\\n           + (png_uint_16)(bg)*(png_uint_16)(255          \\\n           - (png_uint_16)(alpha)) + 128);                \\\n       (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }\n\n#  define png_composite_16(composite, fg, alpha, bg)       \\\n     { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg)  \\\n           * (png_uint_32)(alpha)                          \\\n           + (png_uint_32)(bg)*(65535                      \\\n           - (png_uint_32)(alpha)) + 32768);               \\\n       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }\n\n#else  /* Standard method using integer division */\n\n#  define png_composite(composite, fg, alpha, bg)                          \\\n     (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +  \\\n     (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) +       \\\n     127) / 255)\n\n#  define png_composite_16(composite, fg, alpha, bg)                         \\\n     (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \\\n     (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) +         \\\n     32767) / 65535)\n#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */\n\n#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));\nPNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));\nPNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));\n#endif\n\nPNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr,\n    png_const_bytep buf));\n/* No png_get_int_16 -- may be added if there's a real need for it. */\n\n/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i));\n#endif\n#ifdef PNG_SAVE_INT_32_SUPPORTED\nPNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i));\n#endif\n\n/* Place a 16-bit number into a buffer in PNG byte order.\n * The parameter is declared unsigned int, not png_uint_16,\n * just to avoid potential problems on pre-ANSI C compilers.\n */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));\n/* No png_save_int_16 -- may be added if there's a real need for it. */\n#endif\n\n#ifdef PNG_USE_READ_MACROS\n/* Inline macros to do direct reads of bytes from the input buffer.\n * The png_get_int_32() routine assumes we are using two's complement\n * format for negative values, which is almost certainly true.\n */\n#  define PNG_get_uint_32(buf) \\\n     (((png_uint_32)(*(buf)) << 24) + \\\n      ((png_uint_32)(*((buf) + 1)) << 16) + \\\n      ((png_uint_32)(*((buf) + 2)) << 8) + \\\n      ((png_uint_32)(*((buf) + 3))))\n\n   /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the\n    * function) incorrectly returned a value of type png_uint_32.\n    */\n#  define PNG_get_uint_16(buf) \\\n     ((png_uint_16) \\\n      (((unsigned int)(*(buf)) << 8) + \\\n       ((unsigned int)(*((buf) + 1)))))\n\n#  define PNG_get_int_32(buf) \\\n     ((png_int_32)((*(buf) & 0x80) \\\n      ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \\\n      : (png_int_32)png_get_uint_32(buf)))\n\n   /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h,\n    * but defining a macro name prefixed with PNG_PREFIX.\n    */\n#  ifndef PNG_PREFIX\n#     define png_get_uint_32(buf) PNG_get_uint_32(buf)\n#     define png_get_uint_16(buf) PNG_get_uint_16(buf)\n#     define png_get_int_32(buf)  PNG_get_int_32(buf)\n#  endif\n#else\n#  ifdef PNG_PREFIX\n      /* No macros; revert to the (redefined) function */\n#     define PNG_get_uint_32 (png_get_uint_32)\n#     define PNG_get_uint_16 (png_get_uint_16)\n#     define PNG_get_int_32  (png_get_int_32)\n#  endif\n#endif\n\n/*******************************************************************************\n *  SIMPLIFIED API\n *******************************************************************************\n *\n * Please read the documentation in libpng-manual.txt (TODO: write said\n * documentation) if you don't understand what follows.\n *\n * The simplified API hides the details of both libpng and the PNG file format\n * itself.  It allows PNG files to be read into a very limited number of\n * in-memory bitmap formats or to be written from the same formats.  If these\n * formats do not accomodate your needs then you can, and should, use the more\n * sophisticated APIs above - these support a wide variety of in-memory formats\n * and a wide variety of sophisticated transformations to those formats as well\n * as a wide variety of APIs to manipulate ancillary information.\n *\n * To read a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure (see below) on the stack and set the\n *    version field to PNG_IMAGE_VERSION.\n * 2) Call the appropriate png_image_begin_read... function.\n * 3) Set the png_image 'format' member to the required sample format.\n * 4) Allocate a buffer for the image and, if required, the color-map.\n * 5) Call png_image_finish_read to read the image and, if required, the\n *    color-map into your buffers.\n *\n * There are no restrictions on the format of the PNG input itself; all valid\n * color types, bit depths, and interlace methods are acceptable, and the\n * input image is transformed as necessary to the requested in-memory format\n * during the png_image_finish_read() step.  The only caveat is that if you\n * request a color-mapped image from a PNG that is full-color or makes\n * complex use of an alpha channel the transformation is extremely lossy and the\n * result may look terrible.\n *\n * To write a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure on the stack and memset() it to all zero.\n * 2) Initialize the members of the structure that describe the image, setting\n *    the 'format' member to the format of the image samples.\n * 3) Call the appropriate png_image_write... function with a pointer to the\n *    image and, if necessary, the color-map to write the PNG data.\n *\n * png_image is a structure that describes the in-memory format of an image\n * when it is being read or defines the in-memory format of an image that you\n * need to write:\n */\n#define PNG_IMAGE_VERSION 1\n\ntypedef struct png_control *png_controlp;\ntypedef struct\n{\n   png_controlp opaque;    /* Initialize to NULL, free with png_image_free */\n   png_uint_32  version;   /* Set to PNG_IMAGE_VERSION */\n   png_uint_32  width;     /* Image width in pixels (columns) */\n   png_uint_32  height;    /* Image height in pixels (rows) */\n   png_uint_32  format;    /* Image format as defined below */\n   png_uint_32  flags;     /* A bit mask containing informational flags */\n   png_uint_32  colormap_entries;\n                           /* Number of entries in the color-map */\n\n   /* In the event of an error or warning the following field will be set to a\n    * non-zero value and the 'message' field will contain a '\\0' terminated\n    * string with the libpng error or warning message.  If both warnings and\n    * an error were encountered, only the error is recorded.  If there\n    * are multiple warnings, only the first one is recorded.\n    *\n    * The upper 30 bits of this value are reserved, the low two bits contain\n    * a value as follows:\n    */\n#  define PNG_IMAGE_WARNING 1\n#  define PNG_IMAGE_ERROR 2\n   /*\n    * The result is a two bit code such that a value more than 1 indicates\n    * a failure in the API just called:\n    *\n    *    0 - no warning or error\n    *    1 - warning\n    *    2 - error\n    *    3 - error preceded by warning\n    */\n#  define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1)\n\n   png_uint_32  warning_or_error;\n\n   char         message[64];\n} png_image, *png_imagep;\n\n/* The samples of the image have one to four channels whose components have\n * original values in the range 0 to 1.0:\n *\n * 1: A single gray or luminance channel (G).\n * 2: A gray/luminance channel and an alpha channel (GA).\n * 3: Three red, green, blue color channels (RGB).\n * 4: Three color channels and an alpha channel (RGBA).\n *\n * The components are encoded in one of two ways:\n *\n * a) As a small integer, value 0..255, contained in a single byte.  For the\n * alpha channel the original value is simply value/255.  For the color or\n * luminance channels the value is encoded according to the sRGB specification\n * and matches the 8-bit format expected by typical display devices.\n *\n * The color/gray channels are not scaled (pre-multiplied) by the alpha\n * channel and are suitable for passing to color management software.\n *\n * b) As a value in the range 0..65535, contained in a 2-byte integer.  All\n * channels can be converted to the original value by dividing by 65535; all\n * channels are linear.  Color channels use the RGB encoding (RGB end-points) of\n * the sRGB specification.  This encoding is identified by the\n * PNG_FORMAT_FLAG_LINEAR flag below.\n *\n * When the simplified API needs to convert between sRGB and linear colorspaces,\n * the actual sRGB transfer curve defined in the sRGB specification (see the\n * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2\n * approximation used elsewhere in libpng.\n *\n * When an alpha channel is present it is expected to denote pixel coverage\n * of the color or luminance channels and is returned as an associated alpha\n * channel: the color/gray channels are scaled (pre-multiplied) by the alpha\n * value.\n *\n * The samples are either contained directly in the image data, between 1 and 8\n * bytes per pixel according to the encoding, or are held in a color-map indexed\n * by bytes in the image data.  In the case of a color-map the color-map entries\n * are individual samples, encoded as above, and the image data has one byte per\n * pixel to select the relevant sample from the color-map.\n */\n\n/* PNG_FORMAT_*\n *\n * #defines to be used in png_image::format.  Each #define identifies a\n * particular layout of sample data and, if present, alpha values.  There are\n * separate defines for each of the two component encodings.\n *\n * A format is built up using single bit flag values.  All combinations are\n * valid.  Formats can be built up from the flag values or you can use one of\n * the predefined values below.  When testing formats always use the FORMAT_FLAG\n * macros to test for individual features - future versions of the library may\n * add new flags.\n *\n * When reading or writing color-mapped images the format should be set to the\n * format of the entries in the color-map then png_image_{read,write}_colormap\n * called to read or write the color-map and set the format correctly for the\n * image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!\n *\n * NOTE: libpng can be built with particular features disabled, if you see\n * compiler errors because the definition of one of the following flags has been\n * compiled out it is because libpng does not have the required support.  It is\n * possible, however, for the libpng configuration to enable the format on just\n * read or just write; in that case you may see an error at run time.  You can\n * guard against this by checking for the definition of the appropriate\n * \"_SUPPORTED\" macro, one of:\n *\n *    PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED\n */\n#define PNG_FORMAT_FLAG_ALPHA    0x01U /* format with an alpha channel */\n#define PNG_FORMAT_FLAG_COLOR    0x02U /* color format: otherwise grayscale */\n#define PNG_FORMAT_FLAG_LINEAR   0x04U /* 2 byte channels else 1 byte */\n#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */\n\n#ifdef PNG_FORMAT_BGR_SUPPORTED\n#  define PNG_FORMAT_FLAG_BGR    0x10U /* BGR colors, else order is RGB */\n#endif\n\n#ifdef PNG_FORMAT_AFIRST_SUPPORTED\n#  define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */\n#endif\n\n/* Commonly used formats have predefined macros.\n *\n * First the single byte (sRGB) formats:\n */\n#define PNG_FORMAT_GRAY 0\n#define PNG_FORMAT_GA   PNG_FORMAT_FLAG_ALPHA\n#define PNG_FORMAT_AG   (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_RGB  PNG_FORMAT_FLAG_COLOR\n#define PNG_FORMAT_BGR  (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)\n#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)\n\n/* Then the linear 2-byte formats.  When naming these \"Y\" is used to\n * indicate a luminance (gray) channel.\n */\n#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR\n#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)\n#define PNG_FORMAT_LINEAR_RGB_ALPHA \\\n   (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA)\n\n/* With color-mapped formats the image data is one byte for each pixel, the byte\n * is an index into the color-map which is formatted as above.  To obtain a\n * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP\n * to one of the above definitions, or you can use one of the definitions below.\n */\n#define PNG_FORMAT_RGB_COLORMAP  (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGR_COLORMAP  (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP)\n\n/* PNG_IMAGE macros\n *\n * These are convenience macros to derive information from a png_image\n * structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the\n * actual image sample values - either the entries in the color-map or the\n * pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values\n * for the pixels and will always return 1 for color-mapped formats.  The\n * remaining macros return information about the rows in the image and the\n * complete image.\n *\n * NOTE: All the macros that take a png_image::format parameter are compile time\n * constants if the format parameter is, itself, a constant.  Therefore these\n * macros can be used in array declarations and case labels where required.\n * Similarly the macros are also pre-processor constants (sizeof is not used) so\n * they can be used in #if tests.\n *\n * First the information about the samples.\n */\n#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\\\n   (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1)\n   /* Return the total number of channels in a given format: 1..4 */\n\n#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\\\n   ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1)\n   /* Return the size in bytes of a single component of a pixel or color-map\n    * entry (as appropriate) in the image: 1 or 2.\n    */\n\n#define PNG_IMAGE_SAMPLE_SIZE(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt))\n   /* This is the size of the sample data for one sample.  If the image is\n    * color-mapped it is the size of one color-map entry (and image pixels are\n    * one byte in size), otherwise it is the size of one image pixel.\n    */\n\n#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)\n   /* The maximum size of the color-map required by the format expressed in a\n    * count of components.  This can be used to compile-time allocate a\n    * color-map:\n    *\n    * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];\n    *\n    * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];\n    *\n    * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the\n    * information from one of the png_image_begin_read_ APIs and dynamically\n    * allocate the required memory.\n    */\n\n/* Corresponding information about the pixels */\n#define PNG_IMAGE_PIXEL_(test,fmt)\\\n   (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt))\n\n#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt)\n   /* The number of separate channels (components) in a pixel; 1 for a\n    * color-mapped image.\n    */\n\n#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt)\n   /* The size, in bytes, of each component in a pixel; 1 for a color-mapped\n    * image.\n    */\n\n#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt)\n   /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */\n\n/* Information about the whole row, or whole image */\n#define PNG_IMAGE_ROW_STRIDE(image)\\\n   (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width)\n   /* Return the total number of components in a single row of the image; this\n    * is the minimum 'row stride', the minimum count of components between each\n    * row.  For a color-mapped image this is the minimum number of bytes in a\n    * row.\n    */\n\n#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\\\n   (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride))\n   /* Return the size, in bytes, of an image buffer given a png_image and a row\n    * stride - the number of components to leave space for in each row.\n    */\n\n#define PNG_IMAGE_SIZE(image)\\\n   PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image))\n   /* Return the size, in bytes, of the image in memory given just a png_image;\n    * the row stride is the minimum stride required for the image.\n    */\n\n#define PNG_IMAGE_COLORMAP_SIZE(image)\\\n   (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries)\n   /* Return the size, in bytes, of the color-map of this image.  If the image\n    * format is not a color-map format this will return a size sufficient for\n    * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if\n    * you don't want to allocate a color-map in this case.\n    */\n\n/* PNG_IMAGE_FLAG_*\n *\n * Flags containing additional information about the image are held in the\n * 'flags' field of png_image.\n */\n#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01\n   /* This indicates the the RGB values of the in-memory bitmap do not\n    * correspond to the red, green and blue end-points defined by sRGB.\n    */\n\n#define PNG_IMAGE_FLAG_FAST 0x02\n   /* On write emphasise speed over compression; the resultant PNG file will be\n    * larger but will be produced significantly faster, particular for large\n    * images.  Do not use this option for images which will be distributed, only\n    * used it when producing intermediate files that will be read back in\n    * repeatedly.  For a typical 24-bit image the option will double the read\n    * speed at the cost of increasing the image size by 25%, however for many\n    * more compressible images the PNG file can be 10 times larger with only a\n    * slight speed gain.\n    */\n\n#define PNG_IMAGE_FLAG_16BIT_sRGB 0x04\n   /* On read if the image is a 16-bit per component image and there is no gAMA\n    * or sRGB chunk assume that the components are sRGB encoded.  Notice that\n    * images output by the simplified API always have gamma information; setting\n    * this flag only affects the interpretation of 16-bit images from an\n    * external source.  It is recommended that the application expose this flag\n    * to the user; the user can normally easily recognize the difference between\n    * linear and sRGB encoding.  This flag has no effect on write - the data\n    * passed to the write APIs must have the correct encoding (as defined\n    * above.)\n    *\n    * If the flag is not set (the default) input 16-bit per component data is\n    * assumed to be linear.\n    *\n    * NOTE: the flag can only be set after the png_image_begin_read_ call,\n    * because that call initializes the 'flags' field.\n    */\n\n#ifdef PNG_SIMPLIFIED_READ_SUPPORTED\n/* READ APIs\n * ---------\n *\n * The png_image passed to the read APIs must have been initialized by setting\n * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.)\n */\n#ifdef PNG_STDIO_SUPPORTED\nPNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,\n   const char *file_name));\n   /* The named file is opened for read and the image header is filled in\n    * from the PNG header in the file.\n    */\n\nPNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,\n   FILE* file));\n   /* The PNG header is read from the stdio FILE object. */\n#endif /* PNG_STDIO_SUPPORTED */\n\nPNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,\n   png_const_voidp memory, png_size_t size));\n   /* The PNG header is read from the given memory buffer. */\n\nPNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,\n   png_const_colorp background, void *buffer, png_int_32 row_stride,\n   void *colormap));\n   /* Finish reading the image into the supplied buffer and clean up the\n    * png_image structure.\n    *\n    * row_stride is the step, in byte or 2-byte units as appropriate,\n    * between adjacent rows.  A positive stride indicates that the top-most row\n    * is first in the buffer - the normal top-down arrangement.  A negative\n    * stride indicates that the bottom-most row is first in the buffer.\n    *\n    * background need only be supplied if an alpha channel must be removed from\n    * a png_byte format and the removal is to be done by compositing on a solid\n    * color; otherwise it may be NULL and any composition will be done directly\n    * onto the buffer.  The value is an sRGB color to use for the background,\n    * for grayscale output the green channel is used.\n    *\n    * background must be supplied when an alpha channel must be removed from a\n    * single byte color-mapped output format, in other words if:\n    *\n    * 1) The original format from png_image_begin_read_from_* had\n    *    PNG_FORMAT_FLAG_ALPHA set.\n    * 2) The format set by the application does not.\n    * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and\n    *    PNG_FORMAT_FLAG_LINEAR *not* set.\n    *\n    * For linear output removing the alpha channel is always done by compositing\n    * on black and background is ignored.\n    *\n    * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set.  It must\n    * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE.\n    * image->colormap_entries will be updated to the actual number of entries\n    * written to the colormap; this may be less than the original value.\n    */\n\nPNG_EXPORT(238, void, png_image_free, (png_imagep image));\n   /* Free any data allocated by libpng in image->opaque, setting the pointer to\n    * NULL.  May be called at any time after the structure is initialized.\n    */\n#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */\n\n#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED\n/* WRITE APIS\n * ----------\n * For write you must initialize a png_image structure to describe the image to\n * be written.  To do this use memset to set the whole structure to 0 then\n * initialize fields describing your image.\n *\n * version: must be set to PNG_IMAGE_VERSION\n * opaque: must be initialized to NULL\n * width: image width in pixels\n * height: image height in rows\n * format: the format of the data (image and color-map) you wish to write\n * flags: set to 0 unless one of the defined flags applies; set\n *    PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB\n *    values do not correspond to the colors in sRGB.\n * colormap_entries: set to the number of entries in the color-map (0 to 256)\n */\nPNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,\n   const char *file, int convert_to_8bit, const void *buffer,\n   png_int_32 row_stride, const void *colormap));\n   /* Write the image to the named file. */\n\nPNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,\n   int convert_to_8_bit, const void *buffer, png_int_32 row_stride,\n   const void *colormap));\n   /* Write the image to the given (FILE*). */\n\n/* With both write APIs if image is in one of the linear formats with 16-bit\n * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG\n * gamma encoded according to the sRGB specification, otherwise a 16-bit linear\n * encoded PNG file is written.\n *\n * With color-mapped data formats the colormap parameter point to a color-map\n * with at least image->colormap_entries encoded in the specified format.  If\n * the format is linear the written PNG color-map will be converted to sRGB\n * regardless of the convert_to_8_bit flag.\n *\n * With all APIs row_stride is handled as in the read APIs - it is the spacing\n * from one row to the next in component sized units (1 or 2 bytes) and if\n * negative indicates a bottom-up row layout in the buffer.\n *\n * Note that the write API does not support interlacing or sub-8-bit pixels.\n */\n#endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */\n/*******************************************************************************\n *  END OF SIMPLIFIED API\n ******************************************************************************/\n\n#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\nPNG_EXPORT(242, void, png_set_check_for_invalid_index,\n    (png_structrp png_ptr, int allowed));\n#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED\nPNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,\n    png_const_infop info_ptr));\n#  endif\n#endif /* CHECK_FOR_INVALID_INDEX */\n\n/*******************************************************************************\n *  IMPLEMENTATION OPTIONS\n *******************************************************************************\n *\n * Support for arbitrary implementation-specific optimizations.  The API allows\n * particular options to be turned on or off.  'Option' is the number of the\n * option and 'onoff' is 0 (off) or non-0 (on).  The value returned is given\n * by the PNG_OPTION_ defines below.\n *\n * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions,\n *           are detected at run time, however sometimes it may be impossible\n *           to do this in user mode, in which case it is necessary to discover\n *           the capabilities in an OS specific way.  Such capabilities are\n *           listed here when libpng has support for them and must be turned\n *           ON by the application if present.\n *\n * SOFTWARE: sometimes software optimizations actually result in performance\n *           decrease on some architectures or systems, or with some sets of\n *           PNG images.  'Software' options allow such optimizations to be\n *           selected at run time.\n */\n#ifdef PNG_SET_OPTION_SUPPORTED\n#ifdef PNG_ARM_NEON_API_SUPPORTED\n#  define PNG_ARM_NEON   0 /* HARDWARE: ARM Neon SIMD instructions supported */\n#endif\n#define PNG_OPTION_NEXT  2 /* Next option - numbers must be even */\n\n/* Return values: NOTE: there are four values and 'off' is *not* zero */\n#define PNG_OPTION_UNSET   0 /* Unset - defaults to off */\n#define PNG_OPTION_INVALID 1 /* Option number out of range */\n#define PNG_OPTION_OFF     2\n#define PNG_OPTION_ON      3\n\nPNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,\n   int onoff));\n#endif\n\n/*******************************************************************************\n *  END OF HARDWARE OPTIONS\n ******************************************************************************/\n\n/* Maintainer: Put new public prototypes here ^, in libpng.3, and project\n * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt\n */\n\n/* The last ordinal number (this is the *last* one already used; the next\n * one to use is one more than this.)  Maintainer, remember to add an entry to\n * scripts/symbols.def as well.\n */\n#ifdef PNG_EXPORT_LAST_ORDINAL\n  PNG_EXPORT_LAST_ORDINAL(244);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* PNG_VERSION_INFO_ONLY */\n/* Do not put anything past this line */\n#endif /* PNG_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/ios/pngconf.h",
    "content": "\n/* pngconf.h - machine configurable file for libpng\n *\n * libpng version 1.6.2 - April 25, 2013\n *\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license.\n * For conditions of distribution and use, see the disclaimer\n * and license in png.h\n *\n */\n\n/* Any machine specific code is near the front of this file, so if you\n * are configuring libpng for a machine, you may want to read the section\n * starting here down to where it starts to typedef png_color, png_text,\n * and png_info.\n */\n\n#ifndef PNGCONF_H\n#define PNGCONF_H\n\n/* To do: Do all of this in scripts/pnglibconf.dfa */\n#ifdef PNG_SAFE_LIMITS_SUPPORTED\n#  ifdef PNG_USER_WIDTH_MAX\n#    undef PNG_USER_WIDTH_MAX\n#    define PNG_USER_WIDTH_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_HEIGHT_MAX\n#    undef PNG_USER_HEIGHT_MAX\n#    define PNG_USER_HEIGHT_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_MALLOC_MAX\n#    undef PNG_USER_CHUNK_MALLOC_MAX\n#    define PNG_USER_CHUNK_MALLOC_MAX 4000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_CACHE_MAX\n#    undef PNG_USER_CHUNK_CACHE_MAX\n#    define PNG_USER_CHUNK_CACHE_MAX 128\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */\n\n/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 (\"ISOC90\") compliant C\n * compiler for correct compilation.  The following header files are required by\n * the standard.  If your compiler doesn't provide these header files, or they\n * do not match the standard, you will need to provide/improve them.\n */\n#include <limits.h>\n#include <stddef.h>\n\n/* Library header files.  These header files are all defined by ISOC90; libpng\n * expects conformant implementations, however, an ISOC90 conformant system need\n * not provide these header files if the functionality cannot be implemented.\n * In this case it will be necessary to disable the relevant parts of libpng in\n * the build of pnglibconf.h.\n *\n * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not\n * include this unnecessary header file.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n   /* Required for the definition of FILE: */\n#  include <stdio.h>\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n   /* Required for the definition of jmp_buf and the declaration of longjmp: */\n#  include <setjmp.h>\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n   /* Required for struct tm: */\n#  include <time.h>\n#endif\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using\n * PNG_NO_CONST; this is no longer supported except for data declarations which\n * apparently still cause problems in 2011 on some compilers.\n */\n#define PNG_CONST const /* backward compatibility only */\n\n/* This controls optimization of the reading of 16 and 32 bit values\n * from PNG files.  It can be set on a per-app-file basis - it\n * just changes whether a macro is used when the function is called.\n * The library builder sets the default; if read functions are not\n * built into the library the macro implementation is forced on.\n */\n#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED\n#  define PNG_USE_READ_MACROS\n#endif\n#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)\n#  if PNG_DEFAULT_READ_MACROS\n#    define PNG_USE_READ_MACROS\n#  endif\n#endif\n\n/* COMPILER SPECIFIC OPTIONS.\n *\n * These options are provided so that a variety of difficult compilers\n * can be used.  Some are fixed at build time (e.g. PNG_API_RULE\n * below) but still have compiler specific implementations, others\n * may be changed on a per-file basis when compiling against libpng.\n */\n\n/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect\n * against legacy (pre ISOC90) compilers that did not understand function\n * prototypes.  It is not required for modern C compilers.\n */\n#ifndef PNGARG\n#  define PNGARG(arglist) arglist\n#endif\n\n/* Function calling conventions.\n * =============================\n * Normally it is not necessary to specify to the compiler how to call\n * a function - it just does it - however on x86 systems derived from\n * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems\n * and some others) there are multiple ways to call a function and the\n * default can be changed on the compiler command line.  For this reason\n * libpng specifies the calling convention of every exported function and\n * every function called via a user supplied function pointer.  This is\n * done in this file by defining the following macros:\n *\n * PNGAPI    Calling convention for exported functions.\n * PNGCBAPI  Calling convention for user provided (callback) functions.\n * PNGCAPI   Calling convention used by the ANSI-C library (required\n *           for longjmp callbacks and sometimes used internally to\n *           specify the calling convention for zlib).\n *\n * These macros should never be overridden.  If it is necessary to\n * change calling convention in a private build this can be done\n * by setting PNG_API_RULE (which defaults to 0) to one of the values\n * below to select the correct 'API' variants.\n *\n * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.\n *                This is correct in every known environment.\n * PNG_API_RULE=1 Use the operating system convention for PNGAPI and\n *                the 'C' calling convention (from PNGCAPI) for\n *                callbacks (PNGCBAPI).  This is no longer required\n *                in any known environment - if it has to be used\n *                please post an explanation of the problem to the\n *                libpng mailing list.\n *\n * These cases only differ if the operating system does not use the C\n * calling convention, at present this just means the above cases\n * (x86 DOS/Windows sytems) and, even then, this does not apply to\n * Cygwin running on those systems.\n *\n * Note that the value must be defined in pnglibconf.h so that what\n * the application uses to call the library matches the conventions\n * set when building the library.\n */\n\n/* Symbol export\n * =============\n * When building a shared library it is almost always necessary to tell\n * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'\n * is used to mark the symbols.  On some systems these symbols can be\n * extracted at link time and need no special processing by the compiler,\n * on other systems the symbols are flagged by the compiler and just\n * the declaration requires a special tag applied (unfortunately) in a\n * compiler dependent way.  Some systems can do either.\n *\n * A small number of older systems also require a symbol from a DLL to\n * be flagged to the program that calls it.  This is a problem because\n * we do not know in the header file included by application code that\n * the symbol will come from a shared library, as opposed to a statically\n * linked one.  For this reason the application must tell us by setting\n * the magic flag PNG_USE_DLL to turn on the special processing before\n * it includes png.h.\n *\n * Four additional macros are used to make this happen:\n *\n * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from\n *            the build or imported if PNG_USE_DLL is set - compiler\n *            and system specific.\n *\n * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to\n *                       'type', compiler specific.\n *\n * PNG_DLL_EXPORT Set to the magic to use during a libpng build to\n *                make a symbol exported from the DLL.  Not used in the\n *                public header files; see pngpriv.h for how it is used\n *                in the libpng build.\n *\n * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come\n *                from a DLL - used to define PNG_IMPEXP when\n *                PNG_USE_DLL is set.\n */\n\n/* System specific discovery.\n * ==========================\n * This code is used at build time to find PNG_IMPEXP, the API settings\n * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL\n * import processing is possible.  On Windows systems it also sets\n * compiler-specific macros to the values required to change the calling\n * conventions of the various functions.\n */\n#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\\\n    defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n  /* Windows system (DOS doesn't support DLLs).  Includes builds under Cygwin or\n   * MinGW on any architecture currently supported by Windows.  Also includes\n   * Watcom builds but these need special treatment because they are not\n   * compatible with GCC or Visual C because of different calling conventions.\n   */\n#  if PNG_API_RULE == 2\n    /* If this line results in an error, either because __watcall is not\n     * understood or because of a redefine just below you cannot use *this*\n     * build of the library with the compiler you are using.  *This* build was\n     * build using Watcom and applications must also be built using Watcom!\n     */\n#    define PNGCAPI __watcall\n#  endif\n\n#  if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))\n#    define PNGCAPI __cdecl\n#    if PNG_API_RULE == 1\n       /* If this line results in an error __stdcall is not understood and\n        * PNG_API_RULE should not have been set to '1'.\n        */\n#      define PNGAPI __stdcall\n#    endif\n#  else\n    /* An older compiler, or one not detected (erroneously) above,\n     * if necessary override on the command line to get the correct\n     * variants for the compiler.\n     */\n#    ifndef PNGCAPI\n#      define PNGCAPI _cdecl\n#    endif\n#    if PNG_API_RULE == 1 && !defined(PNGAPI)\n#      define PNGAPI _stdcall\n#    endif\n#  endif /* compiler/api */\n  /* NOTE: PNGCBAPI always defaults to PNGCAPI. */\n\n#  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)\n#     error \"PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed\"\n#  endif\n\n#  if (defined(_MSC_VER) && _MSC_VER < 800) ||\\\n      (defined(__BORLANDC__) && __BORLANDC__ < 0x500)\n    /* older Borland and MSC\n     * compilers used '__export' and required this to be after\n     * the type.\n     */\n#    ifndef PNG_EXPORT_TYPE\n#      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP\n#    endif\n#    define PNG_DLL_EXPORT __export\n#  else /* newer compiler */\n#    define PNG_DLL_EXPORT __declspec(dllexport)\n#    ifndef PNG_DLL_IMPORT\n#      define PNG_DLL_IMPORT __declspec(dllimport)\n#    endif\n#  endif /* compiler */\n\n#else /* !Windows */\n#  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)\n#    define PNGAPI _System\n#  else /* !Windows/x86 && !OS/2 */\n    /* Use the defaults, or define PNG*API on the command line (but\n     * this will have to be done for every compile!)\n     */\n#  endif /* other system, !OS/2 */\n#endif /* !Windows/x86 */\n\n/* Now do all the defaulting . */\n#ifndef PNGCAPI\n#  define PNGCAPI\n#endif\n#ifndef PNGCBAPI\n#  define PNGCBAPI PNGCAPI\n#endif\n#ifndef PNGAPI\n#  define PNGAPI PNGCAPI\n#endif\n\n/* PNG_IMPEXP may be set on the compilation system command line or (if not set)\n * then in an internal header file when building the library, otherwise (when\n * using the library) it is set here.\n */\n#ifndef PNG_IMPEXP\n#  if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)\n     /* This forces use of a DLL, disallowing static linking */\n#    define PNG_IMPEXP PNG_DLL_IMPORT\n#  endif\n\n#  ifndef PNG_IMPEXP\n#    define PNG_IMPEXP\n#  endif\n#endif\n\n/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat\n * 'attributes' as a storage class - the attributes go at the start of the\n * function definition, and attributes are always appended regardless of the\n * compiler.  This considerably simplifies these macros but may cause problems\n * if any compilers both need function attributes and fail to handle them as\n * a storage class (this is unlikely.)\n */\n#ifndef PNG_FUNCTION\n#  define PNG_FUNCTION(type, name, args, attributes) attributes type name args\n#endif\n\n#ifndef PNG_EXPORT_TYPE\n#  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type\n#endif\n\n   /* The ordinal value is only relevant when preprocessing png.h for symbol\n    * table entries, so we discard it here.  See the .dfn files in the\n    * scripts directory.\n    */\n#ifndef PNG_EXPORTA\n\n#  define PNG_EXPORTA(ordinal, type, name, args, attributes)\\\n      PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \\\n        extern attributes)\n#endif\n\n/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,\n * so make something non-empty to satisfy the requirement:\n */\n#define PNG_EMPTY /*empty list*/\n\n#define PNG_EXPORT(ordinal, type, name, args)\\\n   PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)\n\n/* Use PNG_REMOVED to comment out a removed interface. */\n#ifndef PNG_REMOVED\n#  define PNG_REMOVED(ordinal, type, name, args, attributes)\n#endif\n\n#ifndef PNG_CALLBACK\n#  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)\n#endif\n\n/* Support for compiler specific function attributes.  These are used\n * so that where compiler support is available incorrect use of API\n * functions in png.h will generate compiler warnings.\n *\n * Added at libpng-1.2.41.\n */\n\n#ifndef PNG_NO_PEDANTIC_WARNINGS\n#  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED\n#    define PNG_PEDANTIC_WARNINGS_SUPPORTED\n#  endif\n#endif\n\n#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED\n  /* Support for compiler specific function attributes.  These are used\n   * so that where compiler support is available, incorrect use of API\n   * functions in png.h will generate compiler warnings.  Added at libpng\n   * version 1.2.41.  Disabling these removes the warnings but may also produce\n   * less efficient code.\n   */\n#  if defined(__GNUC__)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT __attribute__((__warn_unused_result__))\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __attribute__((__noreturn__))\n#    endif\n#    if __GNUC__ >= 3\n#      ifndef PNG_ALLOCATED\n#        define PNG_ALLOCATED  __attribute__((__malloc__))\n#      endif\n#      ifndef PNG_DEPRECATED\n#        define PNG_DEPRECATED __attribute__((__deprecated__))\n#      endif\n#      ifndef PNG_PRIVATE\n#        if 0 /* Doesn't work so we use deprecated instead*/\n#          define PNG_PRIVATE \\\n            __attribute__((warning(\"This function is not exported by libpng.\")))\n#        else\n#          define PNG_PRIVATE \\\n            __attribute__((__deprecated__))\n#        endif\n#      endif\n#      if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))\n#        ifndef PNG_RESTRICT\n#          define PNG_RESTRICT __restrict\n#        endif\n#      endif /*  __GNUC__ == 3.0 */\n#    endif /*  __GNUC__ >= 3 */\n\n#  elif defined(_MSC_VER)  && (_MSC_VER >= 1300)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT /* not supported */\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __declspec(noreturn)\n#    endif\n#    ifndef PNG_ALLOCATED\n#      if (_MSC_VER >= 1400)\n#        define PNG_ALLOCATED __declspec(restrict)\n#      endif\n#    endif\n#    ifndef PNG_DEPRECATED\n#      define PNG_DEPRECATED __declspec(deprecated)\n#    endif\n#    ifndef PNG_PRIVATE\n#      define PNG_PRIVATE __declspec(deprecated)\n#    endif\n#    ifndef PNG_RESTRICT\n#      if (_MSC_VER >= 1400)\n#        define PNG_RESTRICT __restrict\n#      endif\n#    endif\n\n#  elif defined(__WATCOMC__)\n#    ifndef PNG_RESTRICT\n#      define PNG_RESTRICT __restrict\n#    endif\n#  endif /* _MSC_VER */\n#endif /* PNG_PEDANTIC_WARNINGS */\n\n#ifndef PNG_DEPRECATED\n#  define PNG_DEPRECATED  /* Use of this function is deprecated */\n#endif\n#ifndef PNG_USE_RESULT\n#  define PNG_USE_RESULT  /* The result of this function must be checked */\n#endif\n#ifndef PNG_NORETURN\n#  define PNG_NORETURN    /* This function does not return */\n#endif\n#ifndef PNG_ALLOCATED\n#  define PNG_ALLOCATED   /* The result of the function is new memory */\n#endif\n#ifndef PNG_PRIVATE\n#  define PNG_PRIVATE     /* This is a private libpng function */\n#endif\n#ifndef PNG_RESTRICT\n#  define PNG_RESTRICT    /* The C99 \"restrict\" feature */\n#endif\n#ifndef PNG_FP_EXPORT     /* A floating point API. */\n#  ifdef PNG_FLOATING_POINT_SUPPORTED\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No floating point APIs */\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n#ifndef PNG_FIXED_EXPORT  /* A fixed point API. */\n#  ifdef PNG_FIXED_POINT_SUPPORTED\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No fixed point APIs */\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE\n/* Some typedefs to get us started.  These should be safe on most of the common\n * platforms.\n *\n * png_uint_32 and png_int_32 may, currently, be larger than required to hold a\n * 32-bit value however this is not normally advisable.\n *\n * png_uint_16 and png_int_16 should always be two bytes in size - this is\n * verified at library build time.\n *\n * png_byte must always be one byte in size.\n *\n * The checks below use constants from limits.h, as defined by the ISOC90\n * standard.\n */\n#if CHAR_BIT == 8 && UCHAR_MAX == 255\n   typedef unsigned char png_byte;\n#else\n#  error \"libpng requires 8 bit bytes\"\n#endif\n\n#if INT_MIN == -32768 && INT_MAX == 32767\n   typedef int png_int_16;\n#elif SHRT_MIN == -32768 && SHRT_MAX == 32767\n   typedef short png_int_16;\n#else\n#  error \"libpng requires a signed 16 bit type\"\n#endif\n\n#if UINT_MAX == 65535\n   typedef unsigned int png_uint_16;\n#elif USHRT_MAX == 65535\n   typedef unsigned short png_uint_16;\n#else\n#  error \"libpng requires an unsigned 16 bit type\"\n#endif\n\n#if INT_MIN < -2147483646 && INT_MAX > 2147483646\n   typedef int png_int_32;\n#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646\n   typedef long int png_int_32;\n#else\n#  error \"libpng requires a signed 32 bit (or more) type\"\n#endif\n\n#if UINT_MAX > 4294967294\n   typedef unsigned int png_uint_32;\n#elif ULONG_MAX > 4294967294\n   typedef unsigned long int png_uint_32;\n#else\n#  error \"libpng requires an unsigned 32 bit (or more) type\"\n#endif\n\n/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,\n * requires an ISOC90 compiler and relies on consistent behavior of sizeof.\n */\ntypedef size_t png_size_t;\ntypedef ptrdiff_t png_ptrdiff_t;\n\n/* libpng needs to know the maximum value of 'size_t' and this controls the\n * definition of png_alloc_size_t, below.  This maximum value of size_t limits\n * but does not control the maximum allocations the library makes - there is\n * direct application control of this through png_set_user_limits().\n */\n#ifndef PNG_SMALL_SIZE_T\n   /* Compiler specific tests for systems where size_t is known to be less than\n    * 32 bits (some of these systems may no longer work because of the lack of\n    * 'far' support; see above.)\n    */\n#  if (defined(__TURBOC__) && !defined(__FLAT__)) ||\\\n   (defined(_MSC_VER) && defined(MAXSEG_64K))\n#     define PNG_SMALL_SIZE_T\n#  endif\n#endif\n\n/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no\n * smaller than png_uint_32.  Casts from png_size_t or png_uint_32 to\n * png_alloc_size_t are not necessary; in fact, it is recommended not to use\n * them at all so that the compiler can complain when something turns out to be\n * problematic.\n *\n * Casts in the other direction (from png_alloc_size_t to png_size_t or\n * png_uint_32) should be explicitly applied; however, we do not expect to\n * encounter practical situations that require such conversions.\n *\n * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than\n * 4294967295 - i.e. less than the maximum value of png_uint_32.\n */\n#ifdef PNG_SMALL_SIZE_T\n   typedef png_uint_32 png_alloc_size_t;\n#else\n   typedef png_size_t png_alloc_size_t;\n#endif\n\n/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler\n * implementations of Intel CPU specific support of user-mode segmented address\n * spaces, where 16-bit pointers address more than 65536 bytes of memory using\n * separate 'segment' registers.  The implementation requires two different\n * types of pointer (only one of which includes the segment value.)\n *\n * If required this support is available in version 1.2 of libpng and may be\n * available in versions through 1.5, although the correctness of the code has\n * not been verified recently.\n */\n\n/* Typedef for floating-point numbers that are converted to fixed-point with a\n * multiple of 100,000, e.g., gamma\n */\ntypedef png_int_32 png_fixed_point;\n\n/* Add typedefs for pointers */\ntypedef void                  * png_voidp;\ntypedef const void            * png_const_voidp;\ntypedef png_byte              * png_bytep;\ntypedef const png_byte        * png_const_bytep;\ntypedef png_uint_32           * png_uint_32p;\ntypedef const png_uint_32     * png_const_uint_32p;\ntypedef png_int_32            * png_int_32p;\ntypedef const png_int_32      * png_const_int_32p;\ntypedef png_uint_16           * png_uint_16p;\ntypedef const png_uint_16     * png_const_uint_16p;\ntypedef png_int_16            * png_int_16p;\ntypedef const png_int_16      * png_const_int_16p;\ntypedef char                  * png_charp;\ntypedef const char            * png_const_charp;\ntypedef png_fixed_point       * png_fixed_point_p;\ntypedef const png_fixed_point * png_const_fixed_point_p;\ntypedef png_size_t            * png_size_tp;\ntypedef const png_size_t      * png_const_size_tp;\n\n#ifdef PNG_STDIO_SUPPORTED\ntypedef FILE            * png_FILE_p;\n#endif\n\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double       * png_doublep;\ntypedef const double * png_const_doublep;\n#endif\n\n/* Pointers to pointers; i.e. arrays */\ntypedef png_byte        * * png_bytepp;\ntypedef png_uint_32     * * png_uint_32pp;\ntypedef png_int_32      * * png_int_32pp;\ntypedef png_uint_16     * * png_uint_16pp;\ntypedef png_int_16      * * png_int_16pp;\ntypedef const char      * * png_const_charpp;\ntypedef char            * * png_charpp;\ntypedef png_fixed_point * * png_fixed_point_pp;\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double          * * png_doublepp;\n#endif\n\n/* Pointers to pointers to pointers; i.e., pointer to array */\ntypedef char            * * * png_charppp;\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n#endif /* PNGCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/ios/pnglibconf.h",
    "content": "/* pnglibconf.h - library build configuration */\n\n/* libpng version 1.6.2 - April 25, 2013 */\n\n/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */\n\n/* This code is released under the libpng license. */\n/* For conditions of distribution and use, see the disclaimer */\n/* and license in png.h */\n\n/* pnglibconf.h */\n/* Machine generated file: DO NOT EDIT */\n/* Derived from: scripts/pnglibconf.dfa */\n#ifndef PNGLCONF_H\n#define PNGLCONF_H\n/* options */\n#define PNG_16BIT_SUPPORTED\n#define PNG_ALIGNED_MEMORY_SUPPORTED\n/*#undef PNG_ARM_NEON_API_SUPPORTED*/\n/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/\n/*#undef PNG_ARM_NEON_SUPPORTED*/\n#define PNG_BENIGN_ERRORS_SUPPORTED\n#define PNG_BENIGN_READ_ERRORS_SUPPORTED\n/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/\n#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\n#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_COLORSPACE_SUPPORTED\n#define PNG_CONSOLE_IO_SUPPORTED\n#define PNG_CONVERT_tIME_SUPPORTED\n#define PNG_EASY_ACCESS_SUPPORTED\n/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/\n#define PNG_ERROR_TEXT_SUPPORTED\n#define PNG_FIXED_POINT_SUPPORTED\n#define PNG_FLOATING_ARITHMETIC_SUPPORTED\n#define PNG_FLOATING_POINT_SUPPORTED\n#define PNG_FORMAT_AFIRST_SUPPORTED\n#define PNG_FORMAT_BGR_SUPPORTED\n#define PNG_GAMMA_SUPPORTED\n#define PNG_GET_PALETTE_MAX_SUPPORTED\n#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED\n#define PNG_INCH_CONVERSIONS_SUPPORTED\n#define PNG_INFO_IMAGE_SUPPORTED\n#define PNG_IO_STATE_SUPPORTED\n#define PNG_MNG_FEATURES_SUPPORTED\n#define PNG_POINTER_INDEXING_SUPPORTED\n#define PNG_PROGRESSIVE_READ_SUPPORTED\n#define PNG_READ_16BIT_SUPPORTED\n#define PNG_READ_ALPHA_MODE_SUPPORTED\n#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_READ_BACKGROUND_SUPPORTED\n#define PNG_READ_BGR_SUPPORTED\n#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_READ_COMPOSITE_NODIV_SUPPORTED\n#define PNG_READ_COMPRESSED_TEXT_SUPPORTED\n#define PNG_READ_EXPAND_16_SUPPORTED\n#define PNG_READ_EXPAND_SUPPORTED\n#define PNG_READ_FILLER_SUPPORTED\n#define PNG_READ_GAMMA_SUPPORTED\n#define PNG_READ_GET_PALETTE_MAX_SUPPORTED\n#define PNG_READ_GRAY_TO_RGB_SUPPORTED\n#define PNG_READ_INTERLACING_SUPPORTED\n#define PNG_READ_INT_FUNCTIONS_SUPPORTED\n#define PNG_READ_INVERT_ALPHA_SUPPORTED\n#define PNG_READ_INVERT_SUPPORTED\n#define PNG_READ_OPT_PLTE_SUPPORTED\n#define PNG_READ_PACKSWAP_SUPPORTED\n#define PNG_READ_PACK_SUPPORTED\n#define PNG_READ_QUANTIZE_SUPPORTED\n#define PNG_READ_RGB_TO_GRAY_SUPPORTED\n#define PNG_READ_SCALE_16_TO_8_SUPPORTED\n#define PNG_READ_SHIFT_SUPPORTED\n#define PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_STRIP_ALPHA_SUPPORTED\n#define PNG_READ_SUPPORTED\n#define PNG_READ_SWAP_ALPHA_SUPPORTED\n#define PNG_READ_SWAP_SUPPORTED\n#define PNG_READ_TEXT_SUPPORTED\n#define PNG_READ_TRANSFORMS_SUPPORTED\n#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_READ_USER_CHUNKS_SUPPORTED\n#define PNG_READ_USER_TRANSFORM_SUPPORTED\n#define PNG_READ_bKGD_SUPPORTED\n#define PNG_READ_cHRM_SUPPORTED\n#define PNG_READ_gAMA_SUPPORTED\n#define PNG_READ_hIST_SUPPORTED\n#define PNG_READ_iCCP_SUPPORTED\n#define PNG_READ_iTXt_SUPPORTED\n#define PNG_READ_oFFs_SUPPORTED\n#define PNG_READ_pCAL_SUPPORTED\n#define PNG_READ_pHYs_SUPPORTED\n#define PNG_READ_sBIT_SUPPORTED\n#define PNG_READ_sCAL_SUPPORTED\n#define PNG_READ_sPLT_SUPPORTED\n#define PNG_READ_sRGB_SUPPORTED\n#define PNG_READ_tEXt_SUPPORTED\n#define PNG_READ_tIME_SUPPORTED\n#define PNG_READ_tRNS_SUPPORTED\n#define PNG_READ_zTXt_SUPPORTED\n/*#undef PNG_SAFE_LIMITS_SUPPORTED*/\n#define PNG_SAVE_INT_32_SUPPORTED\n#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SEQUENTIAL_READ_SUPPORTED\n#define PNG_SETJMP_SUPPORTED\n#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED\n#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED\n/*#undef PNG_SET_OPTION_SUPPORTED*/\n#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SET_USER_LIMITS_SUPPORTED\n#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_READ_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_SUPPORTED\n#define PNG_STDIO_SUPPORTED\n#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_TEXT_SUPPORTED\n#define PNG_TIME_RFC1123_SUPPORTED\n#define PNG_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_USER_CHUNKS_SUPPORTED\n#define PNG_USER_LIMITS_SUPPORTED\n#define PNG_USER_MEM_SUPPORTED\n#define PNG_USER_TRANSFORM_INFO_SUPPORTED\n#define PNG_USER_TRANSFORM_PTR_SUPPORTED\n#define PNG_WARNINGS_SUPPORTED\n#define PNG_WRITE_16BIT_SUPPORTED\n#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_WRITE_BGR_SUPPORTED\n#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED\n#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n#define PNG_WRITE_FILLER_SUPPORTED\n#define PNG_WRITE_FILTER_SUPPORTED\n#define PNG_WRITE_FLUSH_SUPPORTED\n#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED\n#define PNG_WRITE_INTERLACING_SUPPORTED\n#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED\n#define PNG_WRITE_INVERT_ALPHA_SUPPORTED\n#define PNG_WRITE_INVERT_SUPPORTED\n#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED\n#define PNG_WRITE_PACKSWAP_SUPPORTED\n#define PNG_WRITE_PACK_SUPPORTED\n#define PNG_WRITE_SHIFT_SUPPORTED\n#define PNG_WRITE_SUPPORTED\n#define PNG_WRITE_SWAP_ALPHA_SUPPORTED\n#define PNG_WRITE_SWAP_SUPPORTED\n#define PNG_WRITE_TEXT_SUPPORTED\n#define PNG_WRITE_TRANSFORMS_SUPPORTED\n#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_WRITE_USER_TRANSFORM_SUPPORTED\n#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED\n#define PNG_WRITE_bKGD_SUPPORTED\n#define PNG_WRITE_cHRM_SUPPORTED\n#define PNG_WRITE_gAMA_SUPPORTED\n#define PNG_WRITE_hIST_SUPPORTED\n#define PNG_WRITE_iCCP_SUPPORTED\n#define PNG_WRITE_iTXt_SUPPORTED\n#define PNG_WRITE_oFFs_SUPPORTED\n#define PNG_WRITE_pCAL_SUPPORTED\n#define PNG_WRITE_pHYs_SUPPORTED\n#define PNG_WRITE_sBIT_SUPPORTED\n#define PNG_WRITE_sCAL_SUPPORTED\n#define PNG_WRITE_sPLT_SUPPORTED\n#define PNG_WRITE_sRGB_SUPPORTED\n#define PNG_WRITE_tEXt_SUPPORTED\n#define PNG_WRITE_tIME_SUPPORTED\n#define PNG_WRITE_tRNS_SUPPORTED\n#define PNG_WRITE_zTXt_SUPPORTED\n#define PNG_bKGD_SUPPORTED\n#define PNG_cHRM_SUPPORTED\n#define PNG_gAMA_SUPPORTED\n#define PNG_hIST_SUPPORTED\n#define PNG_iCCP_SUPPORTED\n#define PNG_iTXt_SUPPORTED\n#define PNG_oFFs_SUPPORTED\n#define PNG_pCAL_SUPPORTED\n#define PNG_pHYs_SUPPORTED\n#define PNG_sBIT_SUPPORTED\n#define PNG_sCAL_SUPPORTED\n#define PNG_sPLT_SUPPORTED\n#define PNG_sRGB_SUPPORTED\n#define PNG_tEXt_SUPPORTED\n#define PNG_tIME_SUPPORTED\n#define PNG_tRNS_SUPPORTED\n#define PNG_zTXt_SUPPORTED\n/* end of options */\n/* settings */\n#define PNG_API_RULE 0\n#define PNG_CALLOC_SUPPORTED\n#define PNG_COST_SHIFT 3\n#define PNG_DEFAULT_READ_MACROS 1\n#define PNG_GAMMA_THRESHOLD_FIXED 5000\n#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE\n#define PNG_INFLATE_BUF_SIZE 1024\n#define PNG_MAX_GAMMA_8 11\n#define PNG_QUANTIZE_BLUE_BITS 5\n#define PNG_QUANTIZE_GREEN_BITS 5\n#define PNG_QUANTIZE_RED_BITS 5\n#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_TEXT_Z_DEFAULT_STRATEGY 0\n#define PNG_WEIGHT_SHIFT 8\n#define PNG_ZBUF_SIZE 8192\n#define PNG_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0\n#define PNG_Z_DEFAULT_STRATEGY 1\n#define PNG_sCAL_PRECISION 5\n#define PNG_sRGB_PROFILE_CHECKS 2\n/* end of settings */\n#endif /* PNGLCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/mac/png.h",
    "content": "\n/* png.h - header file for PNG reference library\n *\n * libpng version 1.6.2 - April 25, 2013\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license (See LICENSE, below)\n *\n * Authors and maintainers:\n *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat\n *   libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger\n *   libpng versions 0.97, January 1998, through 1.6.2 - April 25, 2013: Glenn\n *   See also \"Contributing Authors\", below.\n *\n * Note about libpng version numbers:\n *\n *   Due to various miscommunications, unforeseen code incompatibilities\n *   and occasional factors outside the authors' control, version numbering\n *   on the library has not always been consistent and straightforward.\n *   The following table summarizes matters since version 0.89c, which was\n *   the first widely used release:\n *\n *    source                 png.h  png.h  shared-lib\n *    version                string   int  version\n *    -------                ------ -----  ----------\n *    0.89c \"1.0 beta 3\"     0.89      89  1.0.89\n *    0.90  \"1.0 beta 4\"     0.90      90  0.90  [should have been 2.0.90]\n *    0.95  \"1.0 beta 5\"     0.95      95  0.95  [should have been 2.0.95]\n *    0.96  \"1.0 beta 6\"     0.96      96  0.96  [should have been 2.0.96]\n *    0.97b \"1.00.97 beta 7\" 1.00.97   97  1.0.1 [should have been 2.0.97]\n *    0.97c                  0.97      97  2.0.97\n *    0.98                   0.98      98  2.0.98\n *    0.99                   0.99      98  2.0.99\n *    0.99a-m                0.99      99  2.0.99\n *    1.00                   1.00     100  2.1.0 [100 should be 10000]\n *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]\n *    1.0.1       png.h string is   10001  2.1.0\n *    1.0.1a-e    identical to the  10002  from here on, the shared library\n *    1.0.2       source version)   10002  is 2.V where V is the source code\n *    1.0.2a-b                      10003  version, except as noted.\n *    1.0.3                         10003\n *    1.0.3a-d                      10004\n *    1.0.4                         10004\n *    1.0.4a-f                      10005\n *    1.0.5 (+ 2 patches)           10005\n *    1.0.5a-d                      10006\n *    1.0.5e-r                      10100 (not source compatible)\n *    1.0.5s-v                      10006 (not binary compatible)\n *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)\n *    1.0.6d-f                      10007 (still binary incompatible)\n *    1.0.6g                        10007\n *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)\n *    1.0.6i                        10007  10.6i\n *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)\n *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)\n *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)\n *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)\n *    1.0.7                    1    10007  (still compatible)\n *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4\n *    1.0.8rc1                 1    10008  2.1.0.8rc1\n *    1.0.8                    1    10008  2.1.0.8\n *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6\n *    1.0.9rc1                 1    10009  2.1.0.9rc1\n *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10\n *    1.0.9rc2                 1    10009  2.1.0.9rc2\n *    1.0.9                    1    10009  2.1.0.9\n *    1.0.10beta1              1    10010  2.1.0.10beta1\n *    1.0.10rc1                1    10010  2.1.0.10rc1\n *    1.0.10                   1    10010  2.1.0.10\n *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3\n *    1.0.11rc1                1    10011  2.1.0.11rc1\n *    1.0.11                   1    10011  2.1.0.11\n *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2\n *    1.0.12rc1                2    10012  2.1.0.12rc1\n *    1.0.12                   2    10012  2.1.0.12\n *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)\n *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2\n *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5\n *    1.2.0rc1                 3    10200  3.1.2.0rc1\n *    1.2.0                    3    10200  3.1.2.0\n *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4\n *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2\n *    1.2.1                    3    10201  3.1.2.1\n *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6\n *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1\n *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1\n *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1\n *    1.0.13                  10    10013  10.so.0.1.0.13\n *    1.2.2                   12    10202  12.so.0.1.2.2\n *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6\n *    1.2.3                   12    10203  12.so.0.1.2.3\n *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3\n *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1\n *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1\n *    1.0.14                  10    10014  10.so.0.1.0.14\n *    1.2.4                   13    10204  12.so.0.1.2.4\n *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2\n *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3\n *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3\n *    1.0.15                  10    10015  10.so.0.1.0.15\n *    1.2.5                   13    10205  12.so.0.1.2.5\n *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4\n *    1.0.16                  10    10016  10.so.0.1.0.16\n *    1.2.6                   13    10206  12.so.0.1.2.6\n *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2\n *    1.0.17rc1               10    10017  12.so.0.1.0.17rc1\n *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1\n *    1.0.17                  10    10017  12.so.0.1.0.17\n *    1.2.7                   13    10207  12.so.0.1.2.7\n *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5\n *    1.0.18rc1-5             10    10018  12.so.0.1.0.18rc1-5\n *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5\n *    1.0.18                  10    10018  12.so.0.1.0.18\n *    1.2.8                   13    10208  12.so.0.1.2.8\n *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3\n *    1.2.9beta4-11           13    10209  12.so.0.9[.0]\n *    1.2.9rc1                13    10209  12.so.0.9[.0]\n *    1.2.9                   13    10209  12.so.0.9[.0]\n *    1.2.10beta1-7           13    10210  12.so.0.10[.0]\n *    1.2.10rc1-2             13    10210  12.so.0.10[.0]\n *    1.2.10                  13    10210  12.so.0.10[.0]\n *    1.4.0beta1-5            14    10400  14.so.0.0[.0]\n *    1.2.11beta1-4           13    10211  12.so.0.11[.0]\n *    1.4.0beta7-8            14    10400  14.so.0.0[.0]\n *    1.2.11                  13    10211  12.so.0.11[.0]\n *    1.2.12                  13    10212  12.so.0.12[.0]\n *    1.4.0beta9-14           14    10400  14.so.0.0[.0]\n *    1.2.13                  13    10213  12.so.0.13[.0]\n *    1.4.0beta15-36          14    10400  14.so.0.0[.0]\n *    1.4.0beta37-87          14    10400  14.so.14.0[.0]\n *    1.4.0rc01               14    10400  14.so.14.0[.0]\n *    1.4.0beta88-109         14    10400  14.so.14.0[.0]\n *    1.4.0rc02-08            14    10400  14.so.14.0[.0]\n *    1.4.0                   14    10400  14.so.14.0[.0]\n *    1.4.1beta01-03          14    10401  14.so.14.1[.0]\n *    1.4.1rc01               14    10401  14.so.14.1[.0]\n *    1.4.1beta04-12          14    10401  14.so.14.1[.0]\n *    1.4.1                   14    10401  14.so.14.1[.0]\n *    1.4.2                   14    10402  14.so.14.2[.0]\n *    1.4.3                   14    10403  14.so.14.3[.0]\n *    1.4.4                   14    10404  14.so.14.4[.0]\n *    1.5.0beta01-58          15    10500  15.so.15.0[.0]\n *    1.5.0rc01-07            15    10500  15.so.15.0[.0]\n *    1.5.0                   15    10500  15.so.15.0[.0]\n *    1.5.1beta01-11          15    10501  15.so.15.1[.0]\n *    1.5.1rc01-02            15    10501  15.so.15.1[.0]\n *    1.5.1                   15    10501  15.so.15.1[.0]\n *    1.5.2beta01-03          15    10502  15.so.15.2[.0]\n *    1.5.2rc01-03            15    10502  15.so.15.2[.0]\n *    1.5.2                   15    10502  15.so.15.2[.0]\n *    1.5.3beta01-10          15    10503  15.so.15.3[.0]\n *    1.5.3rc01-02            15    10503  15.so.15.3[.0]\n *    1.5.3beta11             15    10503  15.so.15.3[.0]\n *    1.5.3 [omitted]\n *    1.5.4beta01-08          15    10504  15.so.15.4[.0]\n *    1.5.4rc01               15    10504  15.so.15.4[.0]\n *    1.5.4                   15    10504  15.so.15.4[.0]\n *    1.5.5beta01-08          15    10505  15.so.15.5[.0]\n *    1.5.5rc01               15    10505  15.so.15.5[.0]\n *    1.5.5                   15    10505  15.so.15.5[.0]\n *    1.5.6beta01-07          15    10506  15.so.15.6[.0]\n *    1.5.6rc01-03            15    10506  15.so.15.6[.0]\n *    1.5.6                   15    10506  15.so.15.6[.0]\n *    1.5.7beta01-05          15    10507  15.so.15.7[.0]\n *    1.5.7rc01-03            15    10507  15.so.15.7[.0]\n *    1.5.7                   15    10507  15.so.15.7[.0]\n *    1.6.0beta01-40          16    10600  16.so.16.0[.0]\n *    1.6.0rc01-08            16    10600  16.so.16.0[.0]\n *    1.6.0                   16    10600  16.so.16.0[.0]\n *    1.6.1beta01-09          16    10601  16.so.16.1[.0]\n *    1.6.1rc01               16    10601  16.so.16.1[.0]\n *    1.6.1                   16    10601  16.so.16.1[.0]\n *    1.6.2beta01             16    10602  16.so.16.2[.0]\n *    1.6.2rc01-06            16    10602  16.so.16.2[.0]\n *    1.6.2                   16    10602  16.so.16.2[.0]\n *\n *   Henceforth the source version will match the shared-library major\n *   and minor numbers; the shared-library major version number will be\n *   used for changes in backward compatibility, as it is intended.  The\n *   PNG_LIBPNG_VER macro, which is not used within libpng but is available\n *   for applications, is an unsigned integer of the form xyyzz corresponding\n *   to the source version x.y.z (leading zeros in y and z).  Beta versions\n *   were given the previous public release number plus a letter, until\n *   version 1.0.6j; from then on they were given the upcoming public\n *   release number plus \"betaNN\" or \"rcNN\".\n *\n *   Binary incompatibility exists only when applications make direct access\n *   to the info_ptr or png_ptr members through png.h, and the compiled\n *   application is loaded with a different version of the library.\n *\n *   DLLNUM will change each time there are forward or backward changes\n *   in binary compatibility (e.g., when a new feature is added).\n *\n * See libpng-manual.txt or libpng.3 for more information.  The PNG\n * specification is available as a W3C Recommendation and as an ISO\n * Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/\n */\n\n/*\n * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:\n *\n * If you modify libpng you may insert additional notices immediately following\n * this sentence.\n *\n * This code is released under the libpng license.\n *\n * libpng versions 1.2.6, August 15, 2004, through 1.6.2, April 25, 2013, are\n * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.2.5\n * with the following individual added to the list of Contributing Authors:\n *\n *    Cosmin Truta\n *\n * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are\n * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.0.6\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Simon-Pierre Cadieux\n *    Eric S. Raymond\n *    Gilles Vollant\n *\n * and with the following additions to the disclaimer:\n *\n *    There is no warranty against interference with your enjoyment of the\n *    library or against infringement.  There is no warranty that our\n *    efforts or the library will fulfill any of your particular purposes\n *    or needs.  This library is provided with all faults, and the entire\n *    risk of satisfactory quality, performance, accuracy, and effort is with\n *    the user.\n *\n * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are\n * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-0.96,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Tom Lane\n *    Glenn Randers-Pehrson\n *    Willem van Schaik\n *\n * libpng versions 0.89, June 1996, through 0.96, May 1997, are\n * Copyright (c) 1996, 1997 Andreas Dilger\n * Distributed according to the same disclaimer and license as libpng-0.88,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    John Bowler\n *    Kevin Bracey\n *    Sam Bushell\n *    Magnus Holmgren\n *    Greg Roelofs\n *    Tom Tanner\n *\n * libpng versions 0.5, May 1995, through 0.88, January 1996, are\n * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n *\n * For the purposes of this copyright and license, \"Contributing Authors\"\n * is defined as the following set of individuals:\n *\n *    Andreas Dilger\n *    Dave Martindale\n *    Guy Eric Schalnat\n *    Paul Schmidt\n *    Tim Wegner\n *\n * The PNG Reference Library is supplied \"AS IS\".  The Contributing Authors\n * and Group 42, Inc. disclaim all warranties, expressed or implied,\n * including, without limitation, the warranties of merchantability and of\n * fitness for any purpose.  The Contributing Authors and Group 42, Inc.\n * assume no liability for direct, indirect, incidental, special, exemplary,\n * or consequential damages, which may result from the use of the PNG\n * Reference Library, even if advised of the possibility of such damage.\n *\n * Permission is hereby granted to use, copy, modify, and distribute this\n * source code, or portions hereof, for any purpose, without fee, subject\n * to the following restrictions:\n *\n *   1. The origin of this source code must not be misrepresented.\n *\n *   2. Altered versions must be plainly marked as such and must not\n *      be misrepresented as being the original source.\n *\n *   3. This Copyright notice may not be removed or altered from\n *      any source or altered source distribution.\n *\n * The Contributing Authors and Group 42, Inc. specifically permit, without\n * fee, and encourage the use of this source code as a component to\n * supporting the PNG file format in commercial products.  If you use this\n * source code in a product, acknowledgment is not required but would be\n * appreciated.\n */\n\n/*\n * A \"png_get_copyright\" function is available, for convenient use in \"about\"\n * boxes and the like:\n *\n *     printf(\"%s\", png_get_copyright(NULL));\n *\n * Also, the PNG logo (in PNG format, of course) is supplied in the\n * files \"pngbar.png\" and \"pngbar.jpg (88x31) and \"pngnow.png\" (98x31).\n */\n\n/*\n * Libpng is OSI Certified Open Source Software.  OSI Certified is a\n * certification mark of the Open Source Initiative.\n */\n\n/*\n * The contributing authors would like to thank all those who helped\n * with testing, bug fixes, and patience.  This wouldn't have been\n * possible without all of you.\n *\n * Thanks to Frank J. T. Wojcik for helping with the documentation.\n */\n\n/*\n * Y2K compliance in libpng:\n * =========================\n *\n *    April 25, 2013\n *\n *    Since the PNG Development group is an ad-hoc body, we can't make\n *    an official declaration.\n *\n *    This is your unofficial assurance that libpng from version 0.71 and\n *    upward through 1.6.2 are Y2K compliant.  It is my belief that\n *    earlier versions were also Y2K compliant.\n *\n *    Libpng only has two year fields.  One is a 2-byte unsigned integer\n *    that will hold years up to 65535.  The other, which is deprecated,\n *    holds the date in text format, and will hold years up to 9999.\n *\n *    The integer is\n *        \"png_uint_16 year\" in png_time_struct.\n *\n *    The string is\n *        \"char time_buffer[29]\" in png_struct.  This is no longer used\n *    in libpng-1.6.x and will be removed from libpng-1.7.0.\n *\n *    There are seven time-related functions:\n *        png.c: png_convert_to_rfc_1123_buffer() in png.c\n *          (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and\n *          png_convert_to_rfc_1152() in error prior to libpng-0.98)\n *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c\n *        png_convert_from_time_t() in pngwrite.c\n *        png_get_tIME() in pngget.c\n *        png_handle_tIME() in pngrutil.c, called in pngread.c\n *        png_set_tIME() in pngset.c\n *        png_write_tIME() in pngwutil.c, called in pngwrite.c\n *\n *    All handle dates properly in a Y2K environment.  The\n *    png_convert_from_time_t() function calls gmtime() to convert from system\n *    clock time, which returns (year - 1900), which we properly convert to\n *    the full 4-digit year.  There is a possibility that libpng applications\n *    are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()\n *    function, or that they are incorrectly passing only a 2-digit year\n *    instead of \"year - 1900\" into the png_convert_from_struct_tm() function,\n *    but this is not under our control.  The libpng documentation has always\n *    stated that it works with 4-digit years, and the APIs have been\n *    documented as such.\n *\n *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned\n *    integer to hold the year, and can hold years as large as 65535.\n *\n *    zlib, upon which libpng depends, is also Y2K compliant.  It contains\n *    no date-related code.\n *\n *       Glenn Randers-Pehrson\n *       libpng maintainer\n *       PNG Development Group\n */\n\n#ifndef PNG_H\n#define PNG_H\n\n/* This is not the place to learn how to use libpng. The file libpng-manual.txt\n * describes how to use libpng, and the file example.c summarizes it\n * with some code on which to build.  This file is useful for looking\n * at the actual function definitions and structure components.\n *\n * If you just need to read a PNG file and don't want to read the documentation\n * skip to the end of this file and read the section entitled 'simplified API'.\n */\n\n/* Version information for png.h - this should match the version in png.c */\n#define PNG_LIBPNG_VER_STRING \"1.6.2\"\n#define PNG_HEADER_VERSION_STRING \\\n     \" libpng version 1.6.2 - April 25, 2013\\n\"\n\n#define PNG_LIBPNG_VER_SONUM   16\n#define PNG_LIBPNG_VER_DLLNUM  16\n\n/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */\n#define PNG_LIBPNG_VER_MAJOR   1\n#define PNG_LIBPNG_VER_MINOR   6\n#define PNG_LIBPNG_VER_RELEASE 2\n\n/* This should match the numeric part of the final component of\n * PNG_LIBPNG_VER_STRING, omitting any leading zero:\n */\n\n#define PNG_LIBPNG_VER_BUILD  0\n\n/* Release Status */\n#define PNG_LIBPNG_BUILD_ALPHA    1\n#define PNG_LIBPNG_BUILD_BETA     2\n#define PNG_LIBPNG_BUILD_RC       3\n#define PNG_LIBPNG_BUILD_STABLE   4\n#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7\n\n/* Release-Specific Flags */\n#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with\n                                       PNG_LIBPNG_BUILD_STABLE only */\n#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_SPECIAL */\n#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_PRIVATE */\n\n#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE\n\n/* Careful here.  At one time, Guy wanted to use 082, but that would be octal.\n * We must not include leading zeros.\n * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only\n * version 1.0.0 was mis-numbered 100 instead of 10000).  From\n * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release\n */\n#define PNG_LIBPNG_VER 10602 /* 1.6.2 */\n\n/* Library configuration: these options cannot be changed after\n * the library has been built.\n */\n#ifndef PNGLCONF_H\n    /* If pnglibconf.h is missing, you can\n     * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h\n     */\n#   include \"pnglibconf.h\"\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n   /* Machine specific configuration. */\n#  include \"pngconf.h\"\n#endif\n\n/*\n * Added at libpng-1.2.8\n *\n * Ref MSDN: Private as priority over Special\n * VS_FF_PRIVATEBUILD File *was not* built using standard release\n * procedures. If this value is given, the StringFileInfo block must\n * contain a PrivateBuild string.\n *\n * VS_FF_SPECIALBUILD File *was* built by the original company using\n * standard release procedures but is a variation of the standard\n * file of the same version number. If this value is given, the\n * StringFileInfo block must contain a SpecialBuild string.\n */\n\n#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */\n#  define PNG_LIBPNG_BUILD_TYPE \\\n       (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)\n#else\n#  ifdef PNG_LIBPNG_SPECIALBUILD\n#    define PNG_LIBPNG_BUILD_TYPE \\\n         (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)\n#  else\n#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)\n#  endif\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n\n/* Inhibit C++ name-mangling for libpng functions but not for system calls. */\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/* Version information for C files, stored in png.c.  This had better match\n * the version above.\n */\n#define png_libpng_ver png_get_header_ver(NULL)\n\n/* This file is arranged in several sections:\n *\n * 1. Any configuration options that can be specified by for the application\n *    code when it is built.  (Build time configuration is in pnglibconf.h)\n * 2. Type definitions (base types are defined in pngconf.h), structure\n *    definitions.\n * 3. Exported library functions.\n * 4. Simplified API.\n *\n * The library source code has additional files (principally pngpriv.h) that\n * allow configuration of the library.\n */\n/* Section 1: run time configuration\n * See pnglibconf.h for build time configuration\n *\n * Run time configuration allows the application to choose between\n * implementations of certain arithmetic APIs.  The default is set\n * at build time and recorded in pnglibconf.h, but it is safe to\n * override these (and only these) settings.  Note that this won't\n * change what the library does, only application code, and the\n * settings can (and probably should) be made on a per-file basis\n * by setting the #defines before including png.h\n *\n * Use macros to read integers from PNG data or use the exported\n * functions?\n *   PNG_USE_READ_MACROS: use the macros (see below)  Note that\n *     the macros evaluate their argument multiple times.\n *   PNG_NO_USE_READ_MACROS: call the relevant library function.\n *\n * Use the alternative algorithm for compositing alpha samples that\n * does not use division?\n *   PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division'\n *      algorithm.\n *   PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm.\n *\n * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is\n * false?\n *   PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error\n *      APIs to png_warning.\n * Otherwise the calls are mapped to png_error.\n */\n\n/* Section 2: type definitions, including structures and compile time\n * constants.\n * See pngconf.h for base types that vary by machine/system\n */\n\n/* This triggers a compiler error in png.c, if png.c and png.h\n * do not agree upon the version number.\n */\ntypedef char* png_libpng_version_1_6_2;\n\n/* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.\n *\n * png_struct is the cache of information used while reading or writing a single\n * PNG file.  One of these is always required, although the simplified API\n * (below) hides the creation and destruction of it.\n */\ntypedef struct png_struct_def png_struct;\ntypedef const png_struct * png_const_structp;\ntypedef png_struct * png_structp;\ntypedef png_struct * * png_structpp;\n\n/* png_info contains information read from or to be written to a PNG file.  One\n * or more of these must exist while reading or creating a PNG file.  The\n * information is not used by libpng during read but is used to control what\n * gets written when a PNG file is created.  \"png_get_\" function calls read\n * information during read and \"png_set_\" functions calls write information\n * when creating a PNG.\n * been moved into a separate header file that is not accessible to\n * applications.  Read libpng-manual.txt or libpng.3 for more info.\n */\ntypedef struct png_info_def png_info;\ntypedef png_info * png_infop;\ntypedef const png_info * png_const_infop;\ntypedef png_info * * png_infopp;\n\n/* Types with names ending 'p' are pointer types.  The corresponding types with\n * names ending 'rp' are identical pointer types except that the pointer is\n * marked 'restrict', which means that it is the only pointer to the object\n * passed to the function.  Applications should not use the 'restrict' types;\n * it is always valid to pass 'p' to a pointer with a function argument of the\n * corresponding 'rp' type.  Different compilers have different rules with\n * regard to type matching in the presence of 'restrict'.  For backward\n * compatibility libpng callbacks never have 'restrict' in their parameters and,\n * consequentially, writing portable application code is extremely difficult if\n * an attempt is made to use 'restrict'.\n */\ntypedef png_struct * PNG_RESTRICT png_structrp;\ntypedef const png_struct * PNG_RESTRICT png_const_structrp;\ntypedef png_info * PNG_RESTRICT png_inforp;\ntypedef const png_info * PNG_RESTRICT png_const_inforp;\n\n/* Three color definitions.  The order of the red, green, and blue, (and the\n * exact size) is not important, although the size of the fields need to\n * be png_byte or png_uint_16 (as defined below).\n */\ntypedef struct png_color_struct\n{\n   png_byte red;\n   png_byte green;\n   png_byte blue;\n} png_color;\ntypedef png_color * png_colorp;\ntypedef const png_color * png_const_colorp;\ntypedef png_color * * png_colorpp;\n\ntypedef struct png_color_16_struct\n{\n   png_byte index;    /* used for palette files */\n   png_uint_16 red;   /* for use in red green blue files */\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 gray;  /* for use in grayscale files */\n} png_color_16;\ntypedef png_color_16 * png_color_16p;\ntypedef const png_color_16 * png_const_color_16p;\ntypedef png_color_16 * * png_color_16pp;\n\ntypedef struct png_color_8_struct\n{\n   png_byte red;   /* for use in red green blue files */\n   png_byte green;\n   png_byte blue;\n   png_byte gray;  /* for use in grayscale files */\n   png_byte alpha; /* for alpha channel files */\n} png_color_8;\ntypedef png_color_8 * png_color_8p;\ntypedef const png_color_8 * png_const_color_8p;\ntypedef png_color_8 * * png_color_8pp;\n\n/*\n * The following two structures are used for the in-core representation\n * of sPLT chunks.\n */\ntypedef struct png_sPLT_entry_struct\n{\n   png_uint_16 red;\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 alpha;\n   png_uint_16 frequency;\n} png_sPLT_entry;\ntypedef png_sPLT_entry * png_sPLT_entryp;\ntypedef const png_sPLT_entry * png_const_sPLT_entryp;\ntypedef png_sPLT_entry * * png_sPLT_entrypp;\n\n/*  When the depth of the sPLT palette is 8 bits, the color and alpha samples\n *  occupy the LSB of their respective members, and the MSB of each member\n *  is zero-filled.  The frequency member always occupies the full 16 bits.\n */\n\ntypedef struct png_sPLT_struct\n{\n   png_charp name;           /* palette name */\n   png_byte depth;           /* depth of palette samples */\n   png_sPLT_entryp entries;  /* palette entries */\n   png_int_32 nentries;      /* number of palette entries */\n} png_sPLT_t;\ntypedef png_sPLT_t * png_sPLT_tp;\ntypedef const png_sPLT_t * png_const_sPLT_tp;\ntypedef png_sPLT_t * * png_sPLT_tpp;\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,\n * and whether that contents is compressed or not.  The \"key\" field\n * points to a regular zero-terminated C string.  The \"text\" fields can be a\n * regular C string, an empty string, or a NULL pointer.\n * However, the structure returned by png_get_text() will always contain\n * the \"text\" field as a regular zero-terminated C string (possibly\n * empty), never a NULL pointer, so it can be safely used in printf() and\n * other string-handling functions.  Note that the \"itxt_length\", \"lang\", and\n * \"lang_key\" members of the structure only exist when the library is built\n * with iTXt chunk support.  Prior to libpng-1.4.0 the library was built by\n * default without iTXt support. Also note that when iTXt *is* supported,\n * the \"lang\" and \"lang_key\" fields contain NULL pointers when the\n * \"compression\" field contains * PNG_TEXT_COMPRESSION_NONE or\n * PNG_TEXT_COMPRESSION_zTXt. Note that the \"compression value\" is not the\n * same as what appears in the PNG tEXt/zTXt/iTXt chunk's \"compression flag\"\n * which is always 0 or 1, or its \"compression method\" which is always 0.\n */\ntypedef struct png_text_struct\n{\n   int  compression;       /* compression value:\n                             -1: tEXt, none\n                              0: zTXt, deflate\n                              1: iTXt, none\n                              2: iTXt, deflate  */\n   png_charp key;          /* keyword, 1-79 character description of \"text\" */\n   png_charp text;         /* comment, may be an empty string (ie \"\")\n                              or a NULL pointer */\n   png_size_t text_length; /* length of the text string */\n   png_size_t itxt_length; /* length of the itxt string */\n   png_charp lang;         /* language code, 0-79 characters\n                              or a NULL pointer */\n   png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more\n                              chars or a NULL pointer */\n} png_text;\ntypedef png_text * png_textp;\ntypedef const png_text * png_const_textp;\ntypedef png_text * * png_textpp;\n#endif\n\n/* Supported compression types for text in PNG files (tEXt, and zTXt).\n * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */\n#define PNG_TEXT_COMPRESSION_NONE_WR -3\n#define PNG_TEXT_COMPRESSION_zTXt_WR -2\n#define PNG_TEXT_COMPRESSION_NONE    -1\n#define PNG_TEXT_COMPRESSION_zTXt     0\n#define PNG_ITXT_COMPRESSION_NONE     1\n#define PNG_ITXT_COMPRESSION_zTXt     2\n#define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */\n\n/* png_time is a way to hold the time in an machine independent way.\n * Two conversions are provided, both from time_t and struct tm.  There\n * is no portable way to convert to either of these structures, as far\n * as I know.  If you know of a portable way, send it to me.  As a side\n * note - PNG has always been Year 2000 compliant!\n */\ntypedef struct png_time_struct\n{\n   png_uint_16 year; /* full year, as in, 1995 */\n   png_byte month;   /* month of year, 1 - 12 */\n   png_byte day;     /* day of month, 1 - 31 */\n   png_byte hour;    /* hour of day, 0 - 23 */\n   png_byte minute;  /* minute of hour, 0 - 59 */\n   png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */\n} png_time;\ntypedef png_time * png_timep;\ntypedef const png_time * png_const_timep;\ntypedef png_time * * png_timepp;\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n/* png_unknown_chunk is a structure to hold queued chunks for which there is\n * no specific support.  The idea is that we can use this to queue\n * up private chunks for output even though the library doesn't actually\n * know about their semantics.\n *\n * The data in the structure is set by libpng on read and used on write.\n */\ntypedef struct png_unknown_chunk_t\n{\n    png_byte name[5]; /* Textual chunk name with '\\0' terminator */\n    png_byte *data;   /* Data, should not be modified on read! */\n    png_size_t size;\n\n    /* On write 'location' must be set using the flag values listed below.\n     * Notice that on read it is set by libpng however the values stored have\n     * more bits set than are listed below.  Always treat the value as a\n     * bitmask.  On write set only one bit - setting multiple bits may cause the\n     * chunk to be written in multiple places.\n     */\n    png_byte location; /* mode of operation at read time */\n}\npng_unknown_chunk;\n\ntypedef png_unknown_chunk * png_unknown_chunkp;\ntypedef const png_unknown_chunk * png_const_unknown_chunkp;\ntypedef png_unknown_chunk * * png_unknown_chunkpp;\n#endif\n\n/* Flag values for the unknown chunk location byte. */\n#define PNG_HAVE_IHDR  0x01\n#define PNG_HAVE_PLTE  0x02\n#define PNG_AFTER_IDAT 0x08\n\n/* Maximum positive integer used in PNG is (2^31)-1 */\n#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)\n#define PNG_UINT_32_MAX ((png_uint_32)(-1))\n#define PNG_SIZE_MAX ((png_size_t)(-1))\n\n/* These are constants for fixed point values encoded in the\n * PNG specification manner (x100000)\n */\n#define PNG_FP_1    100000\n#define PNG_FP_HALF  50000\n#define PNG_FP_MAX  ((png_fixed_point)0x7fffffffL)\n#define PNG_FP_MIN  (-PNG_FP_MAX)\n\n/* These describe the color_type field in png_info. */\n/* color type masks */\n#define PNG_COLOR_MASK_PALETTE    1\n#define PNG_COLOR_MASK_COLOR      2\n#define PNG_COLOR_MASK_ALPHA      4\n\n/* color types.  Note that not all combinations are legal */\n#define PNG_COLOR_TYPE_GRAY 0\n#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)\n#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)\n#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)\n#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)\n/* aliases */\n#define PNG_COLOR_TYPE_RGBA  PNG_COLOR_TYPE_RGB_ALPHA\n#define PNG_COLOR_TYPE_GA  PNG_COLOR_TYPE_GRAY_ALPHA\n\n/* This is for compression type. PNG 1.0-1.2 only define the single type. */\n#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */\n#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE\n\n/* This is for filter type. PNG 1.0-1.2 only define the single type. */\n#define PNG_FILTER_TYPE_BASE      0 /* Single row per-byte filtering */\n#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */\n#define PNG_FILTER_TYPE_DEFAULT   PNG_FILTER_TYPE_BASE\n\n/* These are for the interlacing type.  These values should NOT be changed. */\n#define PNG_INTERLACE_NONE        0 /* Non-interlaced image */\n#define PNG_INTERLACE_ADAM7       1 /* Adam7 interlacing */\n#define PNG_INTERLACE_LAST        2 /* Not a valid value */\n\n/* These are for the oFFs chunk.  These values should NOT be changed. */\n#define PNG_OFFSET_PIXEL          0 /* Offset in pixels */\n#define PNG_OFFSET_MICROMETER     1 /* Offset in micrometers (1/10^6 meter) */\n#define PNG_OFFSET_LAST           2 /* Not a valid value */\n\n/* These are for the pCAL chunk.  These values should NOT be changed. */\n#define PNG_EQUATION_LINEAR       0 /* Linear transformation */\n#define PNG_EQUATION_BASE_E       1 /* Exponential base e transform */\n#define PNG_EQUATION_ARBITRARY    2 /* Arbitrary base exponential transform */\n#define PNG_EQUATION_HYPERBOLIC   3 /* Hyperbolic sine transformation */\n#define PNG_EQUATION_LAST         4 /* Not a valid value */\n\n/* These are for the sCAL chunk.  These values should NOT be changed. */\n#define PNG_SCALE_UNKNOWN         0 /* unknown unit (image scale) */\n#define PNG_SCALE_METER           1 /* meters per pixel */\n#define PNG_SCALE_RADIAN          2 /* radians per pixel */\n#define PNG_SCALE_LAST            3 /* Not a valid value */\n\n/* These are for the pHYs chunk.  These values should NOT be changed. */\n#define PNG_RESOLUTION_UNKNOWN    0 /* pixels/unknown unit (aspect ratio) */\n#define PNG_RESOLUTION_METER      1 /* pixels/meter */\n#define PNG_RESOLUTION_LAST       2 /* Not a valid value */\n\n/* These are for the sRGB chunk.  These values should NOT be changed. */\n#define PNG_sRGB_INTENT_PERCEPTUAL 0\n#define PNG_sRGB_INTENT_RELATIVE   1\n#define PNG_sRGB_INTENT_SATURATION 2\n#define PNG_sRGB_INTENT_ABSOLUTE   3\n#define PNG_sRGB_INTENT_LAST       4 /* Not a valid value */\n\n/* This is for text chunks */\n#define PNG_KEYWORD_MAX_LENGTH     79\n\n/* Maximum number of entries in PLTE/sPLT/tRNS arrays */\n#define PNG_MAX_PALETTE_LENGTH    256\n\n/* These determine if an ancillary chunk's data has been successfully read\n * from the PNG header, or if the application has filled in the corresponding\n * data in the info_struct to be written into the output file.  The values\n * of the PNG_INFO_<chunk> defines should NOT be changed.\n */\n#define PNG_INFO_gAMA 0x0001\n#define PNG_INFO_sBIT 0x0002\n#define PNG_INFO_cHRM 0x0004\n#define PNG_INFO_PLTE 0x0008\n#define PNG_INFO_tRNS 0x0010\n#define PNG_INFO_bKGD 0x0020\n#define PNG_INFO_hIST 0x0040\n#define PNG_INFO_pHYs 0x0080\n#define PNG_INFO_oFFs 0x0100\n#define PNG_INFO_tIME 0x0200\n#define PNG_INFO_pCAL 0x0400\n#define PNG_INFO_sRGB 0x0800   /* GR-P, 0.96a */\n#define PNG_INFO_iCCP 0x1000   /* ESR, 1.0.6 */\n#define PNG_INFO_sPLT 0x2000   /* ESR, 1.0.6 */\n#define PNG_INFO_sCAL 0x4000   /* ESR, 1.0.6 */\n#define PNG_INFO_IDAT 0x8000   /* ESR, 1.0.6 */\n\n/* This is used for the transformation routines, as some of them\n * change these values for the row.  It also should enable using\n * the routines for other purposes.\n */\ntypedef struct png_row_info_struct\n{\n   png_uint_32 width;    /* width of row */\n   png_size_t rowbytes;  /* number of bytes in row */\n   png_byte color_type;  /* color type of row */\n   png_byte bit_depth;   /* bit depth of row */\n   png_byte channels;    /* number of channels (1, 2, 3, or 4) */\n   png_byte pixel_depth; /* bits per pixel (depth * channels) */\n} png_row_info;\n\ntypedef png_row_info * png_row_infop;\ntypedef png_row_info * * png_row_infopp;\n\n/* These are the function types for the I/O functions and for the functions\n * that allow the user to override the default I/O functions with his or her\n * own.  The png_error_ptr type should match that of user-supplied warning\n * and error functions, while the png_rw_ptr type should match that of the\n * user read/write data functions.  Note that the 'write' function must not\n * modify the buffer it is passed. The 'read' function, on the other hand, is\n * expected to return the read data in the buffer.\n */\ntypedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));\ntypedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t));\ntypedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));\ntypedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,\n    int));\ntypedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32,\n    int));\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\ntypedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop));\ntypedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop));\n\n/* The following callback receives png_uint_32 row_number, int pass for the\n * png_bytep data of the row.  When transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\ntypedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep,\n    png_uint_32, int));\n#endif\n\n#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \\\n    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)\ntypedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop,\n    png_bytep));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\ntypedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,\n    png_unknown_chunkp));\n#endif\n#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED\n/* not used anywhere */\n/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n/* This must match the function definition in <setjmp.h>, and the application\n * must include this before png.h to obtain the definition of jmp_buf.  The\n * function is required to be PNG_NORETURN, but this is not checked.  If the\n * function does return the application will crash via an abort() or similar\n * system level call.\n *\n * If you get a warning here while building the library you may need to make\n * changes to ensure that pnglibconf.h records the calling convention used by\n * your compiler.  This may be very difficult - try using a different compiler\n * to build the library!\n */\nPNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);\n#endif\n\n/* Transform masks for the high-level interface */\n#define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */\n#define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */\n#define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */\n#define PNG_TRANSFORM_PACKING        0x0004    /* read and write */\n#define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */\n#define PNG_TRANSFORM_EXPAND         0x0010    /* read only */\n#define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */\n#define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */\n#define PNG_TRANSFORM_BGR            0x0080    /* read and write */\n#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */\n#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */\n#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */\n#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* write only */\n/* Added to libpng-1.2.34 */\n#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER\n#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */\n/* Added to libpng-1.4.0 */\n#define PNG_TRANSFORM_GRAY_TO_RGB   0x2000      /* read only */\n/* Added to libpng-1.5.4 */\n#define PNG_TRANSFORM_EXPAND_16     0x4000      /* read only */\n#define PNG_TRANSFORM_SCALE_16      0x8000      /* read only */\n\n/* Flags for MNG supported features */\n#define PNG_FLAG_MNG_EMPTY_PLTE     0x01\n#define PNG_FLAG_MNG_FILTER_64      0x04\n#define PNG_ALL_MNG_FEATURES        0x05\n\n/* NOTE: prior to 1.5 these functions had no 'API' style declaration,\n * this allowed the zlib default functions to be used on Windows\n * platforms.  In 1.5 the zlib default malloc (which just calls malloc and\n * ignores the first argument) should be completely compatible with the\n * following.\n */\ntypedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,\n    png_alloc_size_t));\ntypedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp));\n\n/* Section 3: exported functions\n * Here are the function definitions most commonly used.  This is not\n * the place to find out how to use libpng.  See libpng-manual.txt for the\n * full explanation, see example.c for the summary.  This just provides\n * a simple one line description of the use of each function.\n *\n * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in\n * pngconf.h and in the *.dfn files in the scripts directory.\n *\n *   PNG_EXPORT(ordinal, type, name, (args));\n *\n *       ordinal:    ordinal that is used while building\n *                   *.def files. The ordinal value is only\n *                   relevant when preprocessing png.h with\n *                   the *.dfn files for building symbol table\n *                   entries, and are removed by pngconf.h.\n *       type:       return type of the function\n *       name:       function name\n *       args:       function arguments, with types\n *\n * When we wish to append attributes to a function prototype we use\n * the PNG_EXPORTA() macro instead.\n *\n *   PNG_EXPORTA(ordinal, type, name, (args), attributes);\n *\n *       ordinal, type, name, and args: same as in PNG_EXPORT().\n *       attributes: function attributes\n */\n\n/* Returns the version number of the library */\nPNG_EXPORT(1, png_uint_32, png_access_version_number, (void));\n\n/* Tell lib we have already handled the first <num_bytes> magic bytes.\n * Handling more than 8 bytes from the beginning of the file is an error.\n */\nPNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));\n\n/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a\n * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG\n * signature, and non-zero otherwise.  Having num_to_check == 0 or\n * start > 7 will always fail (ie return non-zero).\n */\nPNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,\n    png_size_t num_to_check));\n\n/* Simple signature checking function.  This is the same as calling\n * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).\n */\n#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))\n\n/* Allocate and initialize png_ptr struct for reading, and any other memory. */\nPNG_EXPORTA(4, png_structp, png_create_read_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr,\n    png_error_ptr error_fn, png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\n/* Allocate and initialize png_ptr struct for writing, and any other memory */\nPNG_EXPORTA(5, png_structp, png_create_write_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\nPNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,\n    (png_const_structrp png_ptr));\n\nPNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,\n    png_size_t size));\n\n/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp\n * match up.\n */\n#ifdef PNG_SETJMP_SUPPORTED\n/* This function returns the jmp_buf built in to *png_ptr.  It must be\n * supplied with an appropriate 'longjmp' function to use on that jmp_buf\n * unless the default error function is overridden in which case NULL is\n * acceptable.  The size of the jmp_buf is checked against the actual size\n * allocated by the library - the call will return NULL on a mismatch\n * indicating an ABI mismatch.\n */\nPNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr,\n    png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));\n#  define png_jmpbuf(png_ptr) \\\n      (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))\n#else\n#  define png_jmpbuf(png_ptr) \\\n      (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)\n#endif\n/* This function should be used by libpng applications in place of\n * longjmp(png_ptr->jmpbuf, val).  If longjmp_fn() has been set, it\n * will use it; otherwise it will call PNG_ABORT().  This function was\n * added in libpng-1.5.0.\n */\nPNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val),\n    PNG_NORETURN);\n\n#ifdef PNG_READ_SUPPORTED\n/* Reset the compression stream */\nPNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED);\n#endif\n\n/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(11, png_structp, png_create_read_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\nPNG_EXPORTA(12, png_structp, png_create_write_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\n#endif\n\n/* Write the PNG file signature. */\nPNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));\n\n/* Write a PNG chunk - size, type, (optional) data, CRC. */\nPNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep\n    chunk_name, png_const_bytep data, png_size_t length));\n\n/* Write the start of a PNG chunk - length and chunk name. */\nPNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,\n    png_const_bytep chunk_name, png_uint_32 length));\n\n/* Write the data of a PNG chunk started with png_write_chunk_start(). */\nPNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,\n    png_const_bytep data, png_size_t length));\n\n/* Finish a chunk started with png_write_chunk_start() (includes CRC). */\nPNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));\n\n/* Allocate and initialize the info structure */\nPNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),\n    PNG_ALLOCATED);\n\n/* DEPRECATED: this function allowed init structures to be created using the\n * default allocation method (typically malloc).  Use is deprecated in 1.6.0 and\n * the API will be removed in the future.\n */\nPNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,\n    png_size_t png_info_struct_size), PNG_DEPRECATED);\n\n/* Writes all the PNG information before the image. */\nPNG_EXPORT(20, void, png_write_info_before_PLTE,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(21, void, png_write_info,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the information before the actual image data. */\nPNG_EXPORT(22, void, png_read_info,\n    (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n#ifdef PNG_TIME_RFC1123_SUPPORTED\n   /* Convert to a US string format: there is no localization support in this\n    * routine.  The original implementation used a 29 character buffer in\n    * png_struct, this will be removed in future versions.\n    */\n#if PNG_LIBPNG_VER < 10700\n/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */\nPNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr,\n    png_const_timep ptime),PNG_DEPRECATED);\n#endif\nPNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29],\n    png_const_timep ptime));\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n/* Convert from a struct tm to png_time */\nPNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,\n    const struct tm * ttime));\n\n/* Convert from time_t to png_time.  Uses gmtime() */\nPNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime));\n#endif /* PNG_CONVERT_tIME_SUPPORTED */\n\n#ifdef PNG_READ_EXPAND_SUPPORTED\n/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */\nPNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr));\nPNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr));\nPNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr));\nPNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_EXPAND_16_SUPPORTED\n/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion\n * of a tRNS chunk if present.\n */\nPNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)\n/* Use blue, green, red order for pixels. */\nPNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED\n/* Expand the grayscale to 24-bit RGB if necessary. */\nPNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED\n/* Reduce RGB to grayscale. */\n#define PNG_ERROR_ACTION_NONE  1\n#define PNG_ERROR_ACTION_WARN  2\n#define PNG_ERROR_ACTION_ERROR 3\n#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/\n\nPNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr,\n    int error_action, double red, double green))\nPNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr,\n    int error_action, png_fixed_point red, png_fixed_point green))\n\nPNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp\n    png_ptr));\n#endif\n\n#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\nPNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,\n    png_colorp palette));\n#endif\n\n#ifdef PNG_READ_ALPHA_MODE_SUPPORTED\n/* How the alpha channel is interpreted - this affects how the color channels of\n * a PNG file are returned when an alpha channel, or tRNS chunk in a palette\n * file, is present.\n *\n * This has no effect on the way pixels are written into a PNG output\n * datastream. The color samples in a PNG datastream are never premultiplied\n * with the alpha samples.\n *\n * The default is to return data according to the PNG specification: the alpha\n * channel is a linear measure of the contribution of the pixel to the\n * corresponding composited pixel.  The gamma encoded color channels must be\n * scaled according to the contribution and to do this it is necessary to undo\n * the encoding, scale the color values, perform the composition and reencode\n * the values.  This is the 'PNG' mode.\n *\n * The alternative is to 'associate' the alpha with the color information by\n * storing color channel values that have been scaled by the alpha.  The\n * advantage is that the color channels can be resampled (the image can be\n * scaled) in this form.  The disadvantage is that normal practice is to store\n * linear, not (gamma) encoded, values and this requires 16-bit channels for\n * still images rather than the 8-bit channels that are just about sufficient if\n * gamma encoding is used.  In addition all non-transparent pixel values,\n * including completely opaque ones, must be gamma encoded to produce the final\n * image.  This is the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' mode (the\n * latter being the two common names for associated alpha color channels.)\n *\n * Since it is not necessary to perform arithmetic on opaque color values so\n * long as they are not to be resampled and are in the final color space it is\n * possible to optimize the handling of alpha by storing the opaque pixels in\n * the PNG format (adjusted for the output color space) while storing partially\n * opaque pixels in the standard, linear, format.  The accuracy required for\n * standard alpha composition is relatively low, because the pixels are\n * isolated, therefore typically the accuracy loss in storing 8-bit linear\n * values is acceptable.  (This is not true if the alpha channel is used to\n * simulate transparency over large areas - use 16 bits or the PNG mode in\n * this case!)  This is the 'OPTIMIZED' mode.  For this mode a pixel is\n * treated as opaque only if the alpha value is equal to the maximum value.\n *\n * The final choice is to gamma encode the alpha channel as well.  This is\n * broken because, in practice, no implementation that uses this choice\n * correctly undoes the encoding before handling alpha composition.  Use this\n * choice only if other serious errors in the software or hardware you use\n * mandate it; the typical serious error is for dark halos to appear around\n * opaque areas of the composited PNG image because of arithmetic overflow.\n *\n * The API function png_set_alpha_mode specifies which of these choices to use\n * with an enumerated 'mode' value and the gamma of the required output:\n */\n#define PNG_ALPHA_PNG           0 /* according to the PNG standard */\n#define PNG_ALPHA_STANDARD      1 /* according to Porter/Duff */\n#define PNG_ALPHA_ASSOCIATED    1 /* as above; this is the normal practice */\n#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */\n#define PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */\n#define PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */\n\nPNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode,\n    double output_gamma))\nPNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,\n    int mode, png_fixed_point output_gamma))\n#endif\n\n#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)\n/* The output_gamma value is a screen gamma in libpng terminology: it expresses\n * how to decode the output values, not how they are encoded.  The values used\n * correspond to the normal numbers used to describe the overall gamma of a\n * computer display system; for example 2.2 for an sRGB conformant system.  The\n * values are scaled by 100000 in the _fixed version of the API (so 220000 for\n * sRGB.)\n *\n * The inverse of the value is always used to provide a default for the PNG file\n * encoding if it has no gAMA chunk and if png_set_gamma() has not been called\n * to override the PNG gamma information.\n *\n * When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode\n * opaque pixels however pixels with lower alpha values are not encoded,\n * regardless of the output gamma setting.\n *\n * When the standard Porter Duff handling is requested with mode 1 the output\n * encoding is set to be linear and the output_gamma value is only relevant\n * as a default for input data that has no gamma information.  The linear output\n * encoding will be overridden if png_set_gamma() is called - the results may be\n * highly unexpected!\n *\n * The following numbers are derived from the sRGB standard and the research\n * behind it.  sRGB is defined to be approximated by a PNG gAMA chunk value of\n * 0.45455 (1/2.2) for PNG.  The value implicitly includes any viewing\n * correction required to take account of any differences in the color\n * environment of the original scene and the intended display environment; the\n * value expresses how to *decode* the image for display, not how the original\n * data was *encoded*.\n *\n * sRGB provides a peg for the PNG standard by defining a viewing environment.\n * sRGB itself, and earlier TV standards, actually use a more complex transform\n * (a linear portion then a gamma 2.4 power law) than PNG can express.  (PNG is\n * limited to simple power laws.)  By saying that an image for direct display on\n * an sRGB conformant system should be stored with a gAMA chunk value of 45455\n * (11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification\n * makes it possible to derive values for other display systems and\n * environments.\n *\n * The Mac value is deduced from the sRGB based on an assumption that the actual\n * extra viewing correction used in early Mac display systems was implemented as\n * a power 1.45 lookup table.\n *\n * Any system where a programmable lookup table is used or where the behavior of\n * the final display device characteristics can be changed requires system\n * specific code to obtain the current characteristic.  However this can be\n * difficult and most PNG gamma correction only requires an approximate value.\n *\n * By default, if png_set_alpha_mode() is not called, libpng assumes that all\n * values are unencoded, linear, values and that the output device also has a\n * linear characteristic.  This is only very rarely correct - it is invariably\n * better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the\n * default if you don't know what the right answer is!\n *\n * The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS\n * 10.6) which used a correction table to implement a somewhat lower gamma on an\n * otherwise sRGB system.\n *\n * Both these values are reserved (not simple gamma values) in order to allow\n * more precise correction internally in the future.\n *\n * NOTE: the following values can be passed to either the fixed or floating\n * point APIs, but the floating point API will also accept floating point\n * values.\n */\n#define PNG_DEFAULT_sRGB -1       /* sRGB gamma and color space */\n#define PNG_GAMMA_MAC_18 -2       /* Old Mac '1.8' gamma and color space */\n#define PNG_GAMMA_sRGB   220000   /* Television standards--matches sRGB gamma */\n#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */\n#endif\n\n/* The following are examples of calls to png_set_alpha_mode to achieve the\n * required overall gamma correction and, where necessary, alpha\n * premultiplication.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n *    This is the default libpng handling of the alpha channel - it is not\n *    pre-multiplied into the color components.  In addition the call states\n *    that the output is for a sRGB system and causes all PNG files without gAMA\n *    chunks to be assumed to be encoded using sRGB.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    In this case the output is assumed to be something like an sRGB conformant\n *    display preceeded by a power-law lookup table of power 1.45.  This is how\n *    early Mac systems behaved.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);\n *    This is the classic Jim Blinn approach and will work in academic\n *    environments where everything is done by the book.  It has the shortcoming\n *    of assuming that input PNG data with no gamma information is linear - this\n *    is unlikely to be correct unless the PNG files where generated locally.\n *    Most of the time the output precision will be so low as to show\n *    significant banding in dark areas of the image.\n *\n * png_set_expand_16(pp);\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB);\n *    This is a somewhat more realistic Jim Blinn inspired approach.  PNG files\n *    are assumed to have the sRGB encoding if not marked with a gamma value and\n *    the output is always 16 bits per component.  This permits accurate scaling\n *    and processing of the data.  If you know that your input PNG files were\n *    generated locally you might need to replace PNG_DEFAULT_sRGB with the\n *    correct value for your system.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB);\n *    If you just need to composite the PNG image onto an existing background\n *    and if you control the code that does this you can use the optimization\n *    setting.  In this case you just copy completely opaque pixels to the\n *    output.  For pixels that are not completely transparent (you just skip\n *    those) you do the composition math using png_composite or png_composite_16\n *    below then encode the resultant 8-bit or 16-bit values to match the output\n *    encoding.\n *\n * Other cases\n *    If neither the PNG nor the standard linear encoding work for you because\n *    of the software or hardware you use then you have a big problem.  The PNG\n *    case will probably result in halos around the image.  The linear encoding\n *    will probably result in a washed out, too bright, image (it's actually too\n *    contrasty.)  Try the ALPHA_OPTIMIZED mode above - this will probably\n *    substantially reduce the halos.  Alternatively try:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB);\n *    This option will also reduce the halos, but there will be slight dark\n *    halos round the opaque parts of the image where the background is light.\n *    In the OPTIMIZED mode the halos will be light halos where the background\n *    is dark.  Take your pick - the halos are unavoidable unless you can get\n *    your hardware/software fixed!  (The OPTIMIZED approach is slightly\n *    faster.)\n *\n * When the default gamma of PNG files doesn't match the output gamma.\n *    If you have PNG files with no gamma information png_set_alpha_mode allows\n *    you to provide a default gamma, but it also sets the ouput gamma to the\n *    matching value.  If you know your PNG files have a gamma that doesn't\n *    match the output you can take advantage of the fact that\n *    png_set_alpha_mode always sets the output gamma but only sets the PNG\n *    default if it is not already set:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    The first call sets both the default and the output gamma values, the\n *    second call overrides the output gamma without changing the default.  This\n *    is easier than achieving the same effect with png_set_gamma.  You must use\n *    PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will\n *    fire if more than one call to png_set_alpha_mode and png_set_background is\n *    made in the same read operation, however multiple calls with PNG_ALPHA_PNG\n *    are ignored.\n */\n\n#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED\nPNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)\nPNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)\nPNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)\n/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler,\n    int flags));\n/* The values of the PNG_FILLER_ defines should NOT be changed */\n#  define PNG_FILLER_BEFORE 0\n#  define PNG_FILLER_AFTER 1\n/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr,\n    png_uint_32 filler, int flags));\n#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */\n\n#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)\n/* Swap bytes in 16-bit depth files. */\nPNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)\n/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */\nPNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \\\n    defined(PNG_WRITE_PACKSWAP_SUPPORTED)\n/* Swap packing order of pixels in bytes. */\nPNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)\n/* Converts files to legal bit depths. */\nPNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p\n    true_bits));\n#endif\n\n#if defined(PNG_READ_INTERLACING_SUPPORTED) || \\\n    defined(PNG_WRITE_INTERLACING_SUPPORTED)\n/* Have the code handle the interlacing.  Returns the number of passes.\n * MUST be called before png_read_update_info or png_start_read_image,\n * otherwise it will not have the desired effect.  Note that it is still\n * necessary to call png_read_row or png_read_rows png_get_image_height\n * times for each pass.\n*/\nPNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)\n/* Invert monochrome files */\nPNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n/* Handle alpha and tRNS by replacing with a background color.  Prior to\n * libpng-1.5.4 this API must not be called before the PNG file header has been\n * read.  Doing so will result in unexpected behavior and possible warnings or\n * errors if the PNG file contains a bKGD chunk.\n */\nPNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, double background_gamma))\nPNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, png_fixed_point background_gamma))\n#endif\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n#  define PNG_BACKGROUND_GAMMA_UNKNOWN 0\n#  define PNG_BACKGROUND_GAMMA_SCREEN  1\n#  define PNG_BACKGROUND_GAMMA_FILE    2\n#  define PNG_BACKGROUND_GAMMA_UNIQUE  3\n#endif\n\n#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED\n/* Scale a 16-bit depth file down to 8-bit, accurately. */\nPNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */\n/* Strip the second byte of information from a 16-bit depth file. */\nPNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_QUANTIZE_SUPPORTED\n/* Turn on quantizing, and reduce the palette to the number of colors\n * available.\n */\nPNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr,\n    png_colorp palette, int num_palette, int maximum_colors,\n    png_const_uint_16p histogram, int full_quantize));\n#endif\n\n#ifdef PNG_READ_GAMMA_SUPPORTED\n/* The threshold on gamma processing is configurable but hard-wired into the\n * library.  The following is the floating point variant.\n */\n#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001)\n\n/* Handle gamma correction. Screen_gamma=(display_exponent).\n * NOTE: this API simply sets the screen and file gamma values. It will\n * therefore override the value for gamma in a PNG file if it is called after\n * the file header has been read - use with care  - call before reading the PNG\n * file for best results!\n *\n * These routines accept the same gamma values as png_set_alpha_mode (described\n * above).  The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either\n * API (floating point or fixed.)  Notice, however, that the 'file_gamma' value\n * is the inverse of a 'screen gamma' value.\n */\nPNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr,\n    double screen_gamma, double override_file_gamma))\nPNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr,\n    png_fixed_point screen_gamma, png_fixed_point override_file_gamma))\n#endif\n\n#ifdef PNG_WRITE_FLUSH_SUPPORTED\n/* Set how many lines between output flushes - 0 for no flushing */\nPNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows));\n/* Flush the current PNG output buffer */\nPNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr));\n#endif\n\n/* Optional update palette with requested transformations */\nPNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr));\n\n/* Optional call to update the users info structure */\nPNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read one or more rows of image data. */\nPNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row,\n    png_bytepp display_row, png_uint_32 num_rows));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read a row of data. */\nPNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row,\n    png_bytep display_row));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the whole image into memory at once. */\nPNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image));\n#endif\n\n/* Write a row of image data */\nPNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr,\n    png_const_bytep row));\n\n/* Write a few rows of image data: (*row) is not written; however, the type\n * is declared as writeable to maintain compatibility with previous versions\n * of libpng and to allow the 'display_row' array from read_rows to be passed\n * unchanged to write_rows.\n */\nPNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row,\n    png_uint_32 num_rows));\n\n/* Write the image data */\nPNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image));\n\n/* Write the end of the PNG file. */\nPNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the end of the PNG file. */\nPNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n/* Free any memory associated with the png_info_struct */\nPNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Set the libpng method of handling chunk CRC errors */\nPNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,\n    int ancil_action));\n\n/* Values for png_set_crc_action() say how to handle CRC errors in\n * ancillary and critical chunks, and whether to use the data contained\n * therein.  Note that it is impossible to \"discard\" data in a critical\n * chunk.  For versions prior to 0.90, the action was always error/quit,\n * whereas in version 0.90 and later, the action for CRC errors in ancillary\n * chunks is warn/discard.  These values should NOT be changed.\n *\n *      value                       action:critical     action:ancillary\n */\n#define PNG_CRC_DEFAULT       0  /* error/quit          warn/discard data */\n#define PNG_CRC_ERROR_QUIT    1  /* error/quit          error/quit        */\n#define PNG_CRC_WARN_DISCARD  2  /* (INVALID)           warn/discard data */\n#define PNG_CRC_WARN_USE      3  /* warn/use data       warn/use data     */\n#define PNG_CRC_QUIET_USE     4  /* quiet/use data      quiet/use data    */\n#define PNG_CRC_NO_CHANGE     5  /* use current value   use current value */\n\n/* These functions give the user control over the scan-line filtering in\n * libpng and the compression methods used by zlib.  These functions are\n * mainly useful for testing, as the defaults should work with most users.\n * Those users who are tight on memory or want faster performance at the\n * expense of compression can modify them.  See the compression library\n * header file (zlib.h) for an explination of the compression functions.\n */\n\n/* Set the filtering method(s) used by libpng.  Currently, the only valid\n * value for \"method\" is 0.\n */\nPNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,\n    int filters));\n\n/* Flags for png_set_filter() to say which filters to use.  The flags\n * are chosen so that they don't conflict with real filter types\n * below, in case they are supplied instead of the #defined constants.\n * These values should NOT be changed.\n */\n#define PNG_NO_FILTERS     0x00\n#define PNG_FILTER_NONE    0x08\n#define PNG_FILTER_SUB     0x10\n#define PNG_FILTER_UP      0x20\n#define PNG_FILTER_AVG     0x40\n#define PNG_FILTER_PAETH   0x80\n#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \\\n                         PNG_FILTER_AVG | PNG_FILTER_PAETH)\n\n/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.\n * These defines should NOT be changed.\n */\n#define PNG_FILTER_VALUE_NONE  0\n#define PNG_FILTER_VALUE_SUB   1\n#define PNG_FILTER_VALUE_UP    2\n#define PNG_FILTER_VALUE_AVG   3\n#define PNG_FILTER_VALUE_PAETH 4\n#define PNG_FILTER_VALUE_LAST  5\n\n#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */\n/* The \"heuristic_method\" is given by one of the PNG_FILTER_HEURISTIC_\n * defines, either the default (minimum-sum-of-absolute-differences), or\n * the experimental method (weighted-minimum-sum-of-absolute-differences).\n *\n * Weights are factors >= 1.0, indicating how important it is to keep the\n * filter type consistent between rows.  Larger numbers mean the current\n * filter is that many times as likely to be the same as the \"num_weights\"\n * previous filters.  This is cumulative for each previous row with a weight.\n * There needs to be \"num_weights\" values in \"filter_weights\", or it can be\n * NULL if the weights aren't being specified.  Weights have no influence on\n * the selection of the first row filter.  Well chosen weights can (in theory)\n * improve the compression for a given image.\n *\n * Costs are factors >= 1.0 indicating the relative decoding costs of a\n * filter type.  Higher costs indicate more decoding expense, and are\n * therefore less likely to be selected over a filter with lower computational\n * costs.  There needs to be a value in \"filter_costs\" for each valid filter\n * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't\n * setting the costs.  Costs try to improve the speed of decompression without\n * unduly increasing the compressed image size.\n *\n * A negative weight or cost indicates the default value is to be used, and\n * values in the range [0.0, 1.0) indicate the value is to remain unchanged.\n * The default values for both weights and costs are currently 1.0, but may\n * change if good general weighting/cost heuristics can be found.  If both\n * the weights and costs are set to 1.0, this degenerates the WEIGHTED method\n * to the UNWEIGHTED method, but with added encoding time/computation.\n */\nPNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr,\n    int heuristic_method, int num_weights, png_const_doublep filter_weights,\n    png_const_doublep filter_costs))\nPNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,\n    (png_structrp png_ptr, int heuristic_method, int num_weights,\n    png_const_fixed_point_p filter_weights,\n    png_const_fixed_point_p filter_costs))\n#endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */\n\n/* Heuristic used for row filter selection.  These defines should NOT be\n * changed.\n */\n#define PNG_FILTER_HEURISTIC_DEFAULT    0  /* Currently \"UNWEIGHTED\" */\n#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1  /* Used by libpng < 0.95 */\n#define PNG_FILTER_HEURISTIC_WEIGHTED   2  /* Experimental feature */\n#define PNG_FILTER_HEURISTIC_LAST       3  /* Not a valid value */\n\n#ifdef PNG_WRITE_SUPPORTED\n/* Set the library compression level.  Currently, valid values range from\n * 0 - 9, corresponding directly to the zlib compression levels 0 - 9\n * (0 - no compression, 9 - \"maximal\" compression).  Note that tests have\n * shown that zlib compression levels 3-6 usually perform as well as level 9\n * for PNG images, and do considerably fewer caclulations.  In the future,\n * these values may not correspond directly to the zlib compression levels.\n */\nPNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr,\n    int window_bits));\n\nPNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr,\n    int method));\n#endif\n\n#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n/* Also set zlib parameters for compressing non-IDAT chunks */\nPNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(225, void, png_set_text_compression_window_bits,\n    (png_structrp png_ptr, int window_bits));\n\nPNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,\n    int method));\n#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */\n\n/* These next functions are called for input/output, memory, and error\n * handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,\n * and call standard C I/O routines such as fread(), fwrite(), and\n * fprintf().  These functions can be made to use other I/O routines\n * at run time for those applications that need to handle I/O in a\n * different manner by calling png_set_???_fn().  See libpng-manual.txt for\n * more information.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n/* Initialize the input/output for the PNG file to the default functions. */\nPNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));\n#endif\n\n/* Replace the (error and abort), and warning functions with user\n * supplied functions.  If no messages are to be printed you must still\n * write and use replacement functions. The replacement error_fn should\n * still do a longjmp to the last setjmp location if you are using this\n * method of error handling.  If error_fn or warning_fn is NULL, the\n * default function will be used.\n */\n\nPNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr,\n    png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));\n\n/* Return the user pointer associated with the error functions */\nPNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr));\n\n/* Replace the default data output functions with a user supplied one(s).\n * If buffered output is not used, then output_flush_fn can be set to NULL.\n * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time\n * output_flush_fn will be ignored (and thus can be NULL).\n * It is probably a mistake to use NULL for output_flush_fn if\n * write_data_fn is not also NULL unless you have built libpng with\n * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's\n * default flush function, which uses the standard *FILE structure, will\n * be used.\n */\nPNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));\n\n/* Replace the default data input function with a user supplied one. */\nPNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr read_data_fn));\n\n/* Return the user pointer associated with the I/O functions */\nPNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr));\n\nPNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr,\n    png_read_status_ptr read_row_fn));\n\nPNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr,\n    png_write_status_ptr write_row_fn));\n\n#ifdef PNG_USER_MEM_SUPPORTED\n/* Replace the default memory allocation functions with user supplied one(s). */\nPNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr,\n    png_malloc_ptr malloc_fn, png_free_ptr free_fn));\n/* Return the user pointer associated with the memory functions */\nPNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr read_user_transform_fn));\n#endif\n\n#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr write_user_transform_fn));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED\nPNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr,\n    png_voidp user_transform_ptr, int user_transform_depth,\n    int user_transform_channels));\n/* Return the user pointer associated with the user transform functions */\nPNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,\n    (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED\n/* Return information about the row currently being processed.  Note that these\n * APIs do not fail but will return unexpected results if called outside a user\n * transform callback.  Also note that when transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\nPNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp));\nPNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));\n#endif\n\n#ifdef PNG_READ_USER_CHUNKS_SUPPORTED\n/* This callback is called only for *unknown* chunks.  If\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known\n * chunks to be treated as unknown, however in this case the callback must do\n * any processing required by the chunk (e.g. by calling the appropriate\n * png_set_ APIs.)\n *\n * There is no write support - on write, by default, all the chunks in the\n * 'unknown' list are written in the specified position.\n *\n * The integer return from the callback function is interpreted thus:\n *\n * negative: An error occured, png_chunk_error will be called.\n *     zero: The chunk was not handled, the chunk will be saved. A critical\n *           chunk will cause an error at this point unless it is to be saved.\n * positive: The chunk was handled, libpng will ignore/discard it.\n *\n * See \"INTERACTION WTIH USER CHUNK CALLBACKS\" below for important notes about\n * how this behavior will change in libpng 1.7\n */\nPNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,\n    png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\nPNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\n/* Sets the function callbacks for the push reader, and a pointer to a\n * user-defined structure available to the callback functions.\n */\nPNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr,\n    png_voidp progressive_ptr, png_progressive_info_ptr info_fn,\n    png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));\n\n/* Returns the user pointer associated with the push read functions */\nPNG_EXPORT(91, png_voidp, png_get_progressive_ptr,\n    (png_const_structrp png_ptr));\n\n/* Function to be called when data becomes available */\nPNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,\n    png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size));\n\n/* A function which may be called *only* within png_process_data to stop the\n * processing of any more data.  The function returns the number of bytes\n * remaining, excluding any that libpng has cached internally.  A subsequent\n * call to png_process_data must supply these bytes again.  If the argument\n * 'save' is set to true the routine will first save all the pending data and\n * will always return 0.\n */\nPNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));\n\n/* A function which may be called *only* outside (after) a call to\n * png_process_data.  It returns the number of bytes of data to skip in the\n * input.  Normally it will return 0, but if it returns a non-zero value the\n * application must skip than number of bytes of input data and pass the\n * following data to the next call to png_process_data.\n */\nPNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));\n\n#ifdef PNG_READ_INTERLACING_SUPPORTED\n/* Function that combines rows.  'new_row' is a flag that should come from\n * the callback and be non-NULL if anything needs to be done; the library\n * stores its own version of the new data internally and ignores the passed\n * in value.\n */\nPNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr,\n    png_bytep old_row, png_const_bytep new_row));\n#endif /* PNG_READ_INTERLACING_SUPPORTED */\n#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */\n\nPNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n/* Added at libpng version 1.4.0 */\nPNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Added at libpng version 1.2.4 */\nPNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Frees a pointer allocated by png_malloc() */\nPNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));\n\n/* Free data that was allocated internally */\nPNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 free_me, int num));\n\n/* Reassign responsibility for freeing existing data, whether allocated\n * by libpng or by the application; this works on the png_info structure passed\n * in, it does not change the state for other png_info structures.\n *\n * It is unlikely that this function works correctly as of 1.6.0 and using it\n * may result either in memory leaks or double free of allocated data.\n */\nPNG_EXPORTA(99, void, png_data_freer, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int freer, png_uint_32 mask), PNG_DEPRECATED);\n\n/* Assignments for png_data_freer */\n#define PNG_DESTROY_WILL_FREE_DATA 1\n#define PNG_SET_WILL_FREE_DATA 1\n#define PNG_USER_WILL_FREE_DATA 2\n/* Flags for png_ptr->free_me and info_ptr->free_me */\n#define PNG_FREE_HIST 0x0008\n#define PNG_FREE_ICCP 0x0010\n#define PNG_FREE_SPLT 0x0020\n#define PNG_FREE_ROWS 0x0040\n#define PNG_FREE_PCAL 0x0080\n#define PNG_FREE_SCAL 0x0100\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#  define PNG_FREE_UNKN 0x0200\n#endif\n/*      PNG_FREE_LIST 0x0400    removed in 1.6.0 because it is ignored */\n#define PNG_FREE_PLTE 0x1000\n#define PNG_FREE_TRNS 0x2000\n#define PNG_FREE_TEXT 0x4000\n#define PNG_FREE_ALL  0x7fff\n#define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */\n\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED);\nPNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr,\n    png_voidp ptr), PNG_DEPRECATED);\n#endif\n\n#ifdef PNG_ERROR_TEXT_SUPPORTED\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n/* The same, but the chunk name is prepended to the error string. */\nPNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n#else\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);\n#endif\n\n#ifdef PNG_WARNINGS_SUPPORTED\n/* Non-fatal error in libpng.  Can continue, but may have a problem. */\nPNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n/* Non-fatal error in libpng, chunk name is prepended to message. */\nPNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\n#ifdef PNG_BENIGN_ERRORS_SUPPORTED\n/* Benign error in libpng.  Can continue, but may have a problem.\n * User can choose whether to handle as a fatal error or as a warning. */\nPNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n#ifdef PNG_READ_SUPPORTED\n/* Same, chunk name is prepended to message (only during read) */\nPNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\nPNG_EXPORT(109, void, png_set_benign_errors,\n    (png_structrp png_ptr, int allowed));\n#else\n#  ifdef PNG_ALLOW_BENIGN_ERRORS\n#    define png_benign_error png_warning\n#    define png_chunk_benign_error png_chunk_warning\n#  else\n#    define png_benign_error png_error\n#    define png_chunk_benign_error png_chunk_error\n#  endif\n#endif\n\n/* The png_set_<chunk> functions are for storing values in the png_info_struct.\n * Similarly, the png_get_<chunk> calls are used to read values from the\n * png_info_struct, either storing the parameters in the passed variables, or\n * setting pointers into the png_info_struct where the data is stored.  The\n * png_get_<chunk> functions return a non-zero value if the data was available\n * in info_ptr, or return zero and do not change any of the parameters if the\n * data was not available.\n *\n * These functions should be used instead of directly accessing png_info\n * to avoid problems with future changes in the size and internal layout of\n * png_info_struct.\n */\n/* Returns \"flag\" if chunk data is valid in info_ptr. */\nPNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 flag));\n\n/* Returns number of bytes needed to hold a transformed row. */\nPNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* Returns row_pointers, which is an array of pointers to scanlines that was\n * returned from png_read_png().\n */\nPNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Set row_pointers, which is an array of pointers to scanlines for use\n * by png_write_png().\n */\nPNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytepp row_pointers));\n#endif\n\n/* Returns number of color channels in image. */\nPNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_EASY_ACCESS_SUPPORTED\n/* Returns image width in pixels. */\nPNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image height in pixels. */\nPNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image bit_depth. */\nPNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image color_type. */\nPNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image filter_type. */\nPNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image interlace_type. */\nPNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image compression_type. */\nPNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image resolution in pixels per meter, from pHYs chunk data. */\nPNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n/* Returns pixel aspect ratio, computed from pHYs chunk data.  */\nPNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\nPNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n\n/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */\nPNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(128, png_int_32, png_get_x_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(129, png_int_32, png_get_y_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n#endif /* PNG_EASY_ACCESS_SUPPORTED */\n\n#ifdef PNG_READ_SUPPORTED\n/* Returns pointer to signature string read from PNG header */\nPNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_16p *background));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_16p background));\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x,\n    double *red_y, double *green_x, double *green_y, double *blue_x,\n    double *blue_y))\nPNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z,\n    double *green_X, double *green_Y, double *green_Z, double *blue_X,\n    double *blue_Y, double *blue_Z))\nPNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_white_x, png_fixed_point *int_white_y,\n    png_fixed_point *int_red_x, png_fixed_point *int_red_y,\n    png_fixed_point *int_green_x, png_fixed_point *int_green_y,\n    png_fixed_point *int_blue_x, png_fixed_point *int_blue_y))\nPNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,\n    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,\n    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,\n    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,\n    png_fixed_point *int_blue_Z))\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr,\n    double white_x, double white_y, double red_x, double red_y, double green_x,\n    double green_y, double blue_x, double blue_y))\nPNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double red_X, double red_Y, double red_Z,\n    double green_X, double green_Y, double green_Z, double blue_X,\n    double blue_Y, double blue_Z))\nPNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_white_x,\n    png_fixed_point int_white_y, png_fixed_point int_red_x,\n    png_fixed_point int_red_y, png_fixed_point int_green_x,\n    png_fixed_point int_green_y, png_fixed_point int_blue_x,\n    png_fixed_point int_blue_y))\nPNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,\n    png_fixed_point int_red_Z, png_fixed_point int_green_X,\n    png_fixed_point int_green_Y, png_fixed_point int_green_Z,\n    png_fixed_point int_blue_X, png_fixed_point int_blue_Y,\n    png_fixed_point int_blue_Z))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *file_gamma))\nPNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_file_gamma))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double file_gamma))\nPNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_file_gamma))\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_16p *hist));\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_uint_16p hist));\n#endif\n\nPNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height,\n    int *bit_depth, int *color_type, int *interlace_method,\n    int *compression_method, int *filter_method));\n\nPNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,\n    int color_type, int interlace_method, int compression_method,\n    int filter_method));\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr,\n   png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,\n   int *unit_type));\n#endif\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y,\n    int unit_type));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charp *purpose, png_int_32 *X0,\n    png_int_32 *X1, int *type, int *nparams, png_charp *units,\n    png_charpp *params));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1,\n    int type, int nparams, png_const_charp units, png_charpp params));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));\n#endif\n\nPNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr,\n   png_inforp info_ptr, png_colorp *palette, int *num_palette));\n\nPNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_colorp palette, int num_palette));\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_8p *sig_bit));\n#endif\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_8p sig_bit));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *file_srgb_intent));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\nPNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charpp name, int *compression_type,\n    png_bytepp profile, png_uint_32 *proflen));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp name, int compression_type,\n    png_const_bytep profile, png_uint_32 proflen));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_sPLT_tpp entries));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_sPLT_tp entries, int nentries));\n#endif\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_get_text also returns the number of text chunks in *num_text */\nPNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_textp *text_ptr, int *num_text));\n#endif\n\n/* Note while png_set_text() will accept a structure whose text,\n * language, and  translated keywords are NULL pointers, the structure\n * returned by png_get_text will always contain regular\n * zero-terminated C strings.  They might be empty strings but\n * they will never be NULL pointers.\n */\n\n#ifdef PNG_TEXT_SUPPORTED\nPNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_textp text_ptr, int num_text));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_timep *mod_time));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_timep mod_time));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans,\n    png_color_16p *trans_color));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans,\n    png_const_color_16p trans_color));\n#endif\n\n#ifdef PNG_sCAL_SUPPORTED\nPNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *unit, double *width, double *height))\n#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \\\n   defined(PNG_FLOATING_POINT_SUPPORTED)\n/* NOTE: this API is currently implemented using floating point arithmetic,\n * consequently it can only be used on systems with floating point support.\n * In any case the range of values supported by png_fixed_point is small and it\n * is highly recommended that png_get_sCAL_s be used instead.\n */\nPNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_fixed_point *width, png_fixed_point *height))\n#endif\nPNG_EXPORT(169, png_uint_32, png_get_sCAL_s,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_charpp swidth, png_charpp sheight));\n\nPNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit, double width, double height))\nPNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr,\n   png_inforp info_ptr, int unit, png_fixed_point width,\n   png_fixed_point height))\nPNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit,\n    png_const_charp swidth, png_const_charp sheight));\n#endif /* PNG_sCAL_SUPPORTED */\n\n#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n/* Provide the default handling for all unknown chunks or, optionally, for\n * specific unknown chunks.\n *\n * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was\n * ignored and the default was used, the per-chunk setting only had an effect on\n * write.  If you wish to have chunk-specific handling on read in code that must\n * work on earlier versions you must use a user chunk callback to specify the\n * desired handling (keep or discard.)\n *\n * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below.  The\n * parameter is interpreted as follows:\n *\n * READ:\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Known chunks: do normal libpng processing, do not keep the chunk (but\n *          see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED)\n *       Unknown chunks: for a specific chunk use the global default, when used\n *          as the default discard the chunk data.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Discard the chunk data.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Keep the chunk data if the chunk is not critical else raise a chunk\n *       error.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Keep the chunk data.\n *\n * If the chunk data is saved it can be retrieved using png_get_unknown_chunks,\n * below.  Notice that specifying \"AS_DEFAULT\" as a global default is equivalent\n * to specifying \"NEVER\", however when \"AS_DEFAULT\" is used for specific chunks\n * it simply resets the behavior to the libpng default.\n *\n * INTERACTION WTIH USER CHUNK CALLBACKS:\n * The per-chunk handling is always used when there is a png_user_chunk_ptr\n * callback and the callback returns 0; the chunk is then always stored *unless*\n * it is critical and the per-chunk setting is other than ALWAYS.  Notice that\n * the global default is *not* used in this case.  (In effect the per-chunk\n * value is incremented to at least IF_SAFE.)\n *\n * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and\n * per-chunk defaults will be honored.  If you want to preserve the current\n * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE\n * as the default - if you don't do this libpng 1.6 will issue a warning.\n *\n * If you want unhandled unknown chunks to be discarded in libpng 1.6 and\n * earlier simply return '1' (handled).\n *\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED:\n *    If this is *not* set known chunks will always be handled by libpng and\n *    will never be stored in the unknown chunk list.  Known chunks listed to\n *    png_set_keep_unknown_chunks will have no effect.  If it is set then known\n *    chunks listed with a keep other than AS_DEFAULT will *never* be processed\n *    by libpng, in addition critical chunks must either be processed by the\n *    callback or saved.\n *\n *    The IHDR and IEND chunks must not be listed.  Because this turns off the\n *    default handling for chunks that would otherwise be recognized the\n *    behavior of libpng transformations may well become incorrect!\n *\n * WRITE:\n *    When writing chunks the options only apply to the chunks specified by\n *    png_set_unknown_chunks (below), libpng will *always* write known chunks\n *    required by png_set_ calls and will always write the core critical chunks\n *    (as required for PLTE).\n *\n *    Each chunk in the png_set_unknown_chunks list is looked up in the\n *    png_set_keep_unknown_chunks list to find the keep setting, this is then\n *    interpreted as follows:\n *\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Write safe-to-copy chunks and write other chunks if the global\n *       default is set to _ALWAYS, otherwise don't write this chunk.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Do not write the chunk.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Write the chunk if it is safe-to-copy, otherwise do not write it.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Write the chunk.\n *\n * Note that the default behavior is effectively the opposite of the read case -\n * in read unknown chunks are not stored by default, in write they are written\n * by default.  Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different\n * - on write the safe-to-copy bit is checked, on read the critical bit is\n * checked and on read if the chunk is critical an error will be raised.\n *\n * num_chunks:\n * ===========\n *    If num_chunks is positive, then the \"keep\" parameter specifies the manner\n *    for handling only those chunks appearing in the chunk_list array,\n *    otherwise the chunk list array is ignored.\n *\n *    If num_chunks is 0 the \"keep\" parameter specifies the default behavior for\n *    unknown chunks, as described above.\n *\n *    If num_chunks is negative, then the \"keep\" parameter specifies the manner\n *    for handling all unknown chunks plus all chunks recognized by libpng\n *    except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to\n *    be processed by libpng.\n */\nPNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,\n    int keep, png_const_bytep chunk_list, int num_chunks));\n\n/* The \"keep\" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned;\n * the result is therefore true (non-zero) if special handling is required,\n * false for the default handling.\n */\nPNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr,\n    png_const_bytep chunk_name));\n#endif\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\nPNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_unknown_chunkp unknowns,\n    int num_unknowns));\n   /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added\n    * unknowns to the location currently stored in the png_struct.  This is\n    * invariably the wrong value on write.  To fix this call the following API\n    * for each chunk in the list with the correct location.  If you know your\n    * code won't be compiled on earlier versions you can rely on\n    * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing\n    * the correct thing.\n    */\n\nPNG_EXPORT(175, void, png_set_unknown_chunk_location,\n    (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));\n\nPNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_unknown_chunkpp entries));\n#endif\n\n/* Png_free_data() will turn off the \"valid\" flag for anything it frees.\n * If you need to turn it off for a chunk that your application has freed,\n * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);\n */\nPNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int mask));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* The \"params\" pointer is currently not used and is for future expansion. */\nPNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\nPNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\n#endif\n\nPNG_EXPORT(180, png_const_charp, png_get_copyright,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(181, png_const_charp, png_get_header_ver,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(182, png_const_charp, png_get_header_version,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(183, png_const_charp, png_get_libpng_ver,\n    (png_const_structrp png_ptr));\n\n#ifdef PNG_MNG_FEATURES_SUPPORTED\nPNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr,\n    png_uint_32 mng_features_permitted));\n#endif\n\n/* For use in png_set_keep_unknown, added to version 1.2.6 */\n#define PNG_HANDLE_CHUNK_AS_DEFAULT   0\n#define PNG_HANDLE_CHUNK_NEVER        1\n#define PNG_HANDLE_CHUNK_IF_SAFE      2\n#define PNG_HANDLE_CHUNK_ALWAYS       3\n#define PNG_HANDLE_CHUNK_LAST         4\n\n/* Strip the prepended error numbers (\"#nnn \") from error and warning\n * messages before passing them to the error or warning handler.\n */\n#ifdef PNG_ERROR_NUMBERS_SUPPORTED\nPNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr,\n    png_uint_32 strip_mode));\n#endif\n\n/* Added in libpng-1.2.6 */\n#ifdef PNG_SET_USER_LIMITS_SUPPORTED\nPNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr,\n    png_uint_32 user_width_max, png_uint_32 user_height_max));\nPNG_EXPORT(187, png_uint_32, png_get_user_width_max,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(188, png_uint_32, png_get_user_height_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.0 */\nPNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr,\n    png_uint_32 user_chunk_cache_max));\nPNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.1 */\nPNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr,\n    png_alloc_size_t user_chunk_cache_max));\nPNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,\n    (png_const_structrp png_ptr));\n#endif\n\n#if defined(PNG_INCH_CONVERSIONS_SUPPORTED)\nPNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_FP_EXPORT(196, float, png_get_x_offset_inches,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\nPNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\n#  ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#  endif /* PNG_pHYs_SUPPORTED */\n#endif  /* PNG_INCH_CONVERSIONS_SUPPORTED */\n\n/* Added in libpng-1.4.0 */\n#ifdef PNG_IO_STATE_SUPPORTED\nPNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr));\n\n/* Removed from libpng 1.6; use png_get_io_chunk_type. */\nPNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr),\n    PNG_DEPRECATED)\n\nPNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,\n    (png_const_structrp png_ptr));\n\n/* The flags returned by png_get_io_state() are the following: */\n#  define PNG_IO_NONE        0x0000   /* no I/O at this moment */\n#  define PNG_IO_READING     0x0001   /* currently reading */\n#  define PNG_IO_WRITING     0x0002   /* currently writing */\n#  define PNG_IO_SIGNATURE   0x0010   /* currently at the file signature */\n#  define PNG_IO_CHUNK_HDR   0x0020   /* currently at the chunk header */\n#  define PNG_IO_CHUNK_DATA  0x0040   /* currently at the chunk data */\n#  define PNG_IO_CHUNK_CRC   0x0080   /* currently at the chunk crc */\n#  define PNG_IO_MASK_OP     0x000f   /* current operation: reading/writing */\n#  define PNG_IO_MASK_LOC    0x00f0   /* current location: sig/hdr/data/crc */\n#endif /* ?PNG_IO_STATE_SUPPORTED */\n\n/* Interlace support.  The following macros are always defined so that if\n * libpng interlace handling is turned off the macros may be used to handle\n * interlaced images within the application.\n */\n#define PNG_INTERLACE_ADAM7_PASSES 7\n\n/* Two macros to return the first row and first column of the original,\n * full, image which appears in a given pass.  'pass' is in the range 0\n * to 6 and the result is in the range 0 to 7.\n */\n#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7)\n#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7)\n\n/* A macro to return the offset between pixels in the output row for a pair of\n * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that\n * follows.  Note that ROW_OFFSET is the offset from one row to the next whereas\n * COL_OFFSET is from one column to the next, within a row.\n */\n#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8)\n#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1))\n\n/* Two macros to help evaluate the number of rows or columns in each\n * pass.  This is expressed as a shift - effectively log2 of the number or\n * rows or columns in each 8x8 tile of the original image.\n */\n#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3)\n#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3)\n\n/* Hence two macros to determine the number of rows or columns in a given\n * pass of an image given its height or width.  In fact these macros may\n * return non-zero even though the sub-image is empty, because the other\n * dimension may be empty for a small image.\n */\n#define PNG_PASS_ROWS(height, pass) (((height)+(((1<<PNG_PASS_ROW_SHIFT(pass))\\\n   -1)-PNG_PASS_START_ROW(pass)))>>PNG_PASS_ROW_SHIFT(pass))\n#define PNG_PASS_COLS(width, pass) (((width)+(((1<<PNG_PASS_COL_SHIFT(pass))\\\n   -1)-PNG_PASS_START_COL(pass)))>>PNG_PASS_COL_SHIFT(pass))\n\n/* For the reader row callbacks (both progressive and sequential) it is\n * necessary to find the row in the output image given a row in an interlaced\n * image, so two more macros:\n */\n#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \\\n   (((y_in)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))\n#define PNG_COL_FROM_PASS_COL(x_in, pass) \\\n   (((x_in)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))\n\n/* Two macros which return a boolean (0 or 1) saying whether the given row\n * or column is in a particular pass.  These use a common utility macro that\n * returns a mask for a given pass - the offset 'off' selects the row or\n * column version.  The mask has the appropriate bit set for each column in\n * the tile.\n */\n#define PNG_PASS_MASK(pass,off) ( \\\n   ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \\\n   ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0))\n\n#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \\\n   ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1)\n#define PNG_COL_IN_INTERLACE_PASS(x, pass) \\\n   ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1)\n\n#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED\n/* With these routines we avoid an integer divide, which will be slower on\n * most machines.  However, it does take more operations than the corresponding\n * divide method, so it may be slower on a few RISC systems.  There are two\n * shifts (by 8 or 16 bits) and an addition, versus a single integer divide.\n *\n * Note that the rounding factors are NOT supposed to be the same!  128 and\n * 32768 are correct for the NODIV code; 127 and 32767 are correct for the\n * standard method.\n *\n * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]\n */\n\n /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */\n\n#  define png_composite(composite, fg, alpha, bg)         \\\n     { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \\\n           * (png_uint_16)(alpha)                         \\\n           + (png_uint_16)(bg)*(png_uint_16)(255          \\\n           - (png_uint_16)(alpha)) + 128);                \\\n       (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }\n\n#  define png_composite_16(composite, fg, alpha, bg)       \\\n     { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg)  \\\n           * (png_uint_32)(alpha)                          \\\n           + (png_uint_32)(bg)*(65535                      \\\n           - (png_uint_32)(alpha)) + 32768);               \\\n       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }\n\n#else  /* Standard method using integer division */\n\n#  define png_composite(composite, fg, alpha, bg)                          \\\n     (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +  \\\n     (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) +       \\\n     127) / 255)\n\n#  define png_composite_16(composite, fg, alpha, bg)                         \\\n     (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \\\n     (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) +         \\\n     32767) / 65535)\n#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */\n\n#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));\nPNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));\nPNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));\n#endif\n\nPNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr,\n    png_const_bytep buf));\n/* No png_get_int_16 -- may be added if there's a real need for it. */\n\n/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i));\n#endif\n#ifdef PNG_SAVE_INT_32_SUPPORTED\nPNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i));\n#endif\n\n/* Place a 16-bit number into a buffer in PNG byte order.\n * The parameter is declared unsigned int, not png_uint_16,\n * just to avoid potential problems on pre-ANSI C compilers.\n */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));\n/* No png_save_int_16 -- may be added if there's a real need for it. */\n#endif\n\n#ifdef PNG_USE_READ_MACROS\n/* Inline macros to do direct reads of bytes from the input buffer.\n * The png_get_int_32() routine assumes we are using two's complement\n * format for negative values, which is almost certainly true.\n */\n#  define PNG_get_uint_32(buf) \\\n     (((png_uint_32)(*(buf)) << 24) + \\\n      ((png_uint_32)(*((buf) + 1)) << 16) + \\\n      ((png_uint_32)(*((buf) + 2)) << 8) + \\\n      ((png_uint_32)(*((buf) + 3))))\n\n   /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the\n    * function) incorrectly returned a value of type png_uint_32.\n    */\n#  define PNG_get_uint_16(buf) \\\n     ((png_uint_16) \\\n      (((unsigned int)(*(buf)) << 8) + \\\n       ((unsigned int)(*((buf) + 1)))))\n\n#  define PNG_get_int_32(buf) \\\n     ((png_int_32)((*(buf) & 0x80) \\\n      ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \\\n      : (png_int_32)png_get_uint_32(buf)))\n\n   /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h,\n    * but defining a macro name prefixed with PNG_PREFIX.\n    */\n#  ifndef PNG_PREFIX\n#     define png_get_uint_32(buf) PNG_get_uint_32(buf)\n#     define png_get_uint_16(buf) PNG_get_uint_16(buf)\n#     define png_get_int_32(buf)  PNG_get_int_32(buf)\n#  endif\n#else\n#  ifdef PNG_PREFIX\n      /* No macros; revert to the (redefined) function */\n#     define PNG_get_uint_32 (png_get_uint_32)\n#     define PNG_get_uint_16 (png_get_uint_16)\n#     define PNG_get_int_32  (png_get_int_32)\n#  endif\n#endif\n\n/*******************************************************************************\n *  SIMPLIFIED API\n *******************************************************************************\n *\n * Please read the documentation in libpng-manual.txt (TODO: write said\n * documentation) if you don't understand what follows.\n *\n * The simplified API hides the details of both libpng and the PNG file format\n * itself.  It allows PNG files to be read into a very limited number of\n * in-memory bitmap formats or to be written from the same formats.  If these\n * formats do not accomodate your needs then you can, and should, use the more\n * sophisticated APIs above - these support a wide variety of in-memory formats\n * and a wide variety of sophisticated transformations to those formats as well\n * as a wide variety of APIs to manipulate ancillary information.\n *\n * To read a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure (see below) on the stack and set the\n *    version field to PNG_IMAGE_VERSION.\n * 2) Call the appropriate png_image_begin_read... function.\n * 3) Set the png_image 'format' member to the required sample format.\n * 4) Allocate a buffer for the image and, if required, the color-map.\n * 5) Call png_image_finish_read to read the image and, if required, the\n *    color-map into your buffers.\n *\n * There are no restrictions on the format of the PNG input itself; all valid\n * color types, bit depths, and interlace methods are acceptable, and the\n * input image is transformed as necessary to the requested in-memory format\n * during the png_image_finish_read() step.  The only caveat is that if you\n * request a color-mapped image from a PNG that is full-color or makes\n * complex use of an alpha channel the transformation is extremely lossy and the\n * result may look terrible.\n *\n * To write a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure on the stack and memset() it to all zero.\n * 2) Initialize the members of the structure that describe the image, setting\n *    the 'format' member to the format of the image samples.\n * 3) Call the appropriate png_image_write... function with a pointer to the\n *    image and, if necessary, the color-map to write the PNG data.\n *\n * png_image is a structure that describes the in-memory format of an image\n * when it is being read or defines the in-memory format of an image that you\n * need to write:\n */\n#define PNG_IMAGE_VERSION 1\n\ntypedef struct png_control *png_controlp;\ntypedef struct\n{\n   png_controlp opaque;    /* Initialize to NULL, free with png_image_free */\n   png_uint_32  version;   /* Set to PNG_IMAGE_VERSION */\n   png_uint_32  width;     /* Image width in pixels (columns) */\n   png_uint_32  height;    /* Image height in pixels (rows) */\n   png_uint_32  format;    /* Image format as defined below */\n   png_uint_32  flags;     /* A bit mask containing informational flags */\n   png_uint_32  colormap_entries;\n                           /* Number of entries in the color-map */\n\n   /* In the event of an error or warning the following field will be set to a\n    * non-zero value and the 'message' field will contain a '\\0' terminated\n    * string with the libpng error or warning message.  If both warnings and\n    * an error were encountered, only the error is recorded.  If there\n    * are multiple warnings, only the first one is recorded.\n    *\n    * The upper 30 bits of this value are reserved, the low two bits contain\n    * a value as follows:\n    */\n#  define PNG_IMAGE_WARNING 1\n#  define PNG_IMAGE_ERROR 2\n   /*\n    * The result is a two bit code such that a value more than 1 indicates\n    * a failure in the API just called:\n    *\n    *    0 - no warning or error\n    *    1 - warning\n    *    2 - error\n    *    3 - error preceded by warning\n    */\n#  define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1)\n\n   png_uint_32  warning_or_error;\n\n   char         message[64];\n} png_image, *png_imagep;\n\n/* The samples of the image have one to four channels whose components have\n * original values in the range 0 to 1.0:\n *\n * 1: A single gray or luminance channel (G).\n * 2: A gray/luminance channel and an alpha channel (GA).\n * 3: Three red, green, blue color channels (RGB).\n * 4: Three color channels and an alpha channel (RGBA).\n *\n * The components are encoded in one of two ways:\n *\n * a) As a small integer, value 0..255, contained in a single byte.  For the\n * alpha channel the original value is simply value/255.  For the color or\n * luminance channels the value is encoded according to the sRGB specification\n * and matches the 8-bit format expected by typical display devices.\n *\n * The color/gray channels are not scaled (pre-multiplied) by the alpha\n * channel and are suitable for passing to color management software.\n *\n * b) As a value in the range 0..65535, contained in a 2-byte integer.  All\n * channels can be converted to the original value by dividing by 65535; all\n * channels are linear.  Color channels use the RGB encoding (RGB end-points) of\n * the sRGB specification.  This encoding is identified by the\n * PNG_FORMAT_FLAG_LINEAR flag below.\n *\n * When the simplified API needs to convert between sRGB and linear colorspaces,\n * the actual sRGB transfer curve defined in the sRGB specification (see the\n * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2\n * approximation used elsewhere in libpng.\n *\n * When an alpha channel is present it is expected to denote pixel coverage\n * of the color or luminance channels and is returned as an associated alpha\n * channel: the color/gray channels are scaled (pre-multiplied) by the alpha\n * value.\n *\n * The samples are either contained directly in the image data, between 1 and 8\n * bytes per pixel according to the encoding, or are held in a color-map indexed\n * by bytes in the image data.  In the case of a color-map the color-map entries\n * are individual samples, encoded as above, and the image data has one byte per\n * pixel to select the relevant sample from the color-map.\n */\n\n/* PNG_FORMAT_*\n *\n * #defines to be used in png_image::format.  Each #define identifies a\n * particular layout of sample data and, if present, alpha values.  There are\n * separate defines for each of the two component encodings.\n *\n * A format is built up using single bit flag values.  All combinations are\n * valid.  Formats can be built up from the flag values or you can use one of\n * the predefined values below.  When testing formats always use the FORMAT_FLAG\n * macros to test for individual features - future versions of the library may\n * add new flags.\n *\n * When reading or writing color-mapped images the format should be set to the\n * format of the entries in the color-map then png_image_{read,write}_colormap\n * called to read or write the color-map and set the format correctly for the\n * image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!\n *\n * NOTE: libpng can be built with particular features disabled, if you see\n * compiler errors because the definition of one of the following flags has been\n * compiled out it is because libpng does not have the required support.  It is\n * possible, however, for the libpng configuration to enable the format on just\n * read or just write; in that case you may see an error at run time.  You can\n * guard against this by checking for the definition of the appropriate\n * \"_SUPPORTED\" macro, one of:\n *\n *    PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED\n */\n#define PNG_FORMAT_FLAG_ALPHA    0x01U /* format with an alpha channel */\n#define PNG_FORMAT_FLAG_COLOR    0x02U /* color format: otherwise grayscale */\n#define PNG_FORMAT_FLAG_LINEAR   0x04U /* 2 byte channels else 1 byte */\n#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */\n\n#ifdef PNG_FORMAT_BGR_SUPPORTED\n#  define PNG_FORMAT_FLAG_BGR    0x10U /* BGR colors, else order is RGB */\n#endif\n\n#ifdef PNG_FORMAT_AFIRST_SUPPORTED\n#  define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */\n#endif\n\n/* Commonly used formats have predefined macros.\n *\n * First the single byte (sRGB) formats:\n */\n#define PNG_FORMAT_GRAY 0\n#define PNG_FORMAT_GA   PNG_FORMAT_FLAG_ALPHA\n#define PNG_FORMAT_AG   (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_RGB  PNG_FORMAT_FLAG_COLOR\n#define PNG_FORMAT_BGR  (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)\n#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)\n\n/* Then the linear 2-byte formats.  When naming these \"Y\" is used to\n * indicate a luminance (gray) channel.\n */\n#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR\n#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)\n#define PNG_FORMAT_LINEAR_RGB_ALPHA \\\n   (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA)\n\n/* With color-mapped formats the image data is one byte for each pixel, the byte\n * is an index into the color-map which is formatted as above.  To obtain a\n * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP\n * to one of the above definitions, or you can use one of the definitions below.\n */\n#define PNG_FORMAT_RGB_COLORMAP  (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGR_COLORMAP  (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP)\n\n/* PNG_IMAGE macros\n *\n * These are convenience macros to derive information from a png_image\n * structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the\n * actual image sample values - either the entries in the color-map or the\n * pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values\n * for the pixels and will always return 1 for color-mapped formats.  The\n * remaining macros return information about the rows in the image and the\n * complete image.\n *\n * NOTE: All the macros that take a png_image::format parameter are compile time\n * constants if the format parameter is, itself, a constant.  Therefore these\n * macros can be used in array declarations and case labels where required.\n * Similarly the macros are also pre-processor constants (sizeof is not used) so\n * they can be used in #if tests.\n *\n * First the information about the samples.\n */\n#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\\\n   (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1)\n   /* Return the total number of channels in a given format: 1..4 */\n\n#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\\\n   ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1)\n   /* Return the size in bytes of a single component of a pixel or color-map\n    * entry (as appropriate) in the image: 1 or 2.\n    */\n\n#define PNG_IMAGE_SAMPLE_SIZE(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt))\n   /* This is the size of the sample data for one sample.  If the image is\n    * color-mapped it is the size of one color-map entry (and image pixels are\n    * one byte in size), otherwise it is the size of one image pixel.\n    */\n\n#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)\n   /* The maximum size of the color-map required by the format expressed in a\n    * count of components.  This can be used to compile-time allocate a\n    * color-map:\n    *\n    * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];\n    *\n    * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];\n    *\n    * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the\n    * information from one of the png_image_begin_read_ APIs and dynamically\n    * allocate the required memory.\n    */\n\n/* Corresponding information about the pixels */\n#define PNG_IMAGE_PIXEL_(test,fmt)\\\n   (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt))\n\n#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt)\n   /* The number of separate channels (components) in a pixel; 1 for a\n    * color-mapped image.\n    */\n\n#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt)\n   /* The size, in bytes, of each component in a pixel; 1 for a color-mapped\n    * image.\n    */\n\n#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt)\n   /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */\n\n/* Information about the whole row, or whole image */\n#define PNG_IMAGE_ROW_STRIDE(image)\\\n   (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width)\n   /* Return the total number of components in a single row of the image; this\n    * is the minimum 'row stride', the minimum count of components between each\n    * row.  For a color-mapped image this is the minimum number of bytes in a\n    * row.\n    */\n\n#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\\\n   (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride))\n   /* Return the size, in bytes, of an image buffer given a png_image and a row\n    * stride - the number of components to leave space for in each row.\n    */\n\n#define PNG_IMAGE_SIZE(image)\\\n   PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image))\n   /* Return the size, in bytes, of the image in memory given just a png_image;\n    * the row stride is the minimum stride required for the image.\n    */\n\n#define PNG_IMAGE_COLORMAP_SIZE(image)\\\n   (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries)\n   /* Return the size, in bytes, of the color-map of this image.  If the image\n    * format is not a color-map format this will return a size sufficient for\n    * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if\n    * you don't want to allocate a color-map in this case.\n    */\n\n/* PNG_IMAGE_FLAG_*\n *\n * Flags containing additional information about the image are held in the\n * 'flags' field of png_image.\n */\n#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01\n   /* This indicates the the RGB values of the in-memory bitmap do not\n    * correspond to the red, green and blue end-points defined by sRGB.\n    */\n\n#define PNG_IMAGE_FLAG_FAST 0x02\n   /* On write emphasise speed over compression; the resultant PNG file will be\n    * larger but will be produced significantly faster, particular for large\n    * images.  Do not use this option for images which will be distributed, only\n    * used it when producing intermediate files that will be read back in\n    * repeatedly.  For a typical 24-bit image the option will double the read\n    * speed at the cost of increasing the image size by 25%, however for many\n    * more compressible images the PNG file can be 10 times larger with only a\n    * slight speed gain.\n    */\n\n#define PNG_IMAGE_FLAG_16BIT_sRGB 0x04\n   /* On read if the image is a 16-bit per component image and there is no gAMA\n    * or sRGB chunk assume that the components are sRGB encoded.  Notice that\n    * images output by the simplified API always have gamma information; setting\n    * this flag only affects the interpretation of 16-bit images from an\n    * external source.  It is recommended that the application expose this flag\n    * to the user; the user can normally easily recognize the difference between\n    * linear and sRGB encoding.  This flag has no effect on write - the data\n    * passed to the write APIs must have the correct encoding (as defined\n    * above.)\n    *\n    * If the flag is not set (the default) input 16-bit per component data is\n    * assumed to be linear.\n    *\n    * NOTE: the flag can only be set after the png_image_begin_read_ call,\n    * because that call initializes the 'flags' field.\n    */\n\n#ifdef PNG_SIMPLIFIED_READ_SUPPORTED\n/* READ APIs\n * ---------\n *\n * The png_image passed to the read APIs must have been initialized by setting\n * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.)\n */\n#ifdef PNG_STDIO_SUPPORTED\nPNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,\n   const char *file_name));\n   /* The named file is opened for read and the image header is filled in\n    * from the PNG header in the file.\n    */\n\nPNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,\n   FILE* file));\n   /* The PNG header is read from the stdio FILE object. */\n#endif /* PNG_STDIO_SUPPORTED */\n\nPNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,\n   png_const_voidp memory, png_size_t size));\n   /* The PNG header is read from the given memory buffer. */\n\nPNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,\n   png_const_colorp background, void *buffer, png_int_32 row_stride,\n   void *colormap));\n   /* Finish reading the image into the supplied buffer and clean up the\n    * png_image structure.\n    *\n    * row_stride is the step, in byte or 2-byte units as appropriate,\n    * between adjacent rows.  A positive stride indicates that the top-most row\n    * is first in the buffer - the normal top-down arrangement.  A negative\n    * stride indicates that the bottom-most row is first in the buffer.\n    *\n    * background need only be supplied if an alpha channel must be removed from\n    * a png_byte format and the removal is to be done by compositing on a solid\n    * color; otherwise it may be NULL and any composition will be done directly\n    * onto the buffer.  The value is an sRGB color to use for the background,\n    * for grayscale output the green channel is used.\n    *\n    * background must be supplied when an alpha channel must be removed from a\n    * single byte color-mapped output format, in other words if:\n    *\n    * 1) The original format from png_image_begin_read_from_* had\n    *    PNG_FORMAT_FLAG_ALPHA set.\n    * 2) The format set by the application does not.\n    * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and\n    *    PNG_FORMAT_FLAG_LINEAR *not* set.\n    *\n    * For linear output removing the alpha channel is always done by compositing\n    * on black and background is ignored.\n    *\n    * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set.  It must\n    * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE.\n    * image->colormap_entries will be updated to the actual number of entries\n    * written to the colormap; this may be less than the original value.\n    */\n\nPNG_EXPORT(238, void, png_image_free, (png_imagep image));\n   /* Free any data allocated by libpng in image->opaque, setting the pointer to\n    * NULL.  May be called at any time after the structure is initialized.\n    */\n#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */\n\n#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED\n/* WRITE APIS\n * ----------\n * For write you must initialize a png_image structure to describe the image to\n * be written.  To do this use memset to set the whole structure to 0 then\n * initialize fields describing your image.\n *\n * version: must be set to PNG_IMAGE_VERSION\n * opaque: must be initialized to NULL\n * width: image width in pixels\n * height: image height in rows\n * format: the format of the data (image and color-map) you wish to write\n * flags: set to 0 unless one of the defined flags applies; set\n *    PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB\n *    values do not correspond to the colors in sRGB.\n * colormap_entries: set to the number of entries in the color-map (0 to 256)\n */\nPNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,\n   const char *file, int convert_to_8bit, const void *buffer,\n   png_int_32 row_stride, const void *colormap));\n   /* Write the image to the named file. */\n\nPNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,\n   int convert_to_8_bit, const void *buffer, png_int_32 row_stride,\n   const void *colormap));\n   /* Write the image to the given (FILE*). */\n\n/* With both write APIs if image is in one of the linear formats with 16-bit\n * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG\n * gamma encoded according to the sRGB specification, otherwise a 16-bit linear\n * encoded PNG file is written.\n *\n * With color-mapped data formats the colormap parameter point to a color-map\n * with at least image->colormap_entries encoded in the specified format.  If\n * the format is linear the written PNG color-map will be converted to sRGB\n * regardless of the convert_to_8_bit flag.\n *\n * With all APIs row_stride is handled as in the read APIs - it is the spacing\n * from one row to the next in component sized units (1 or 2 bytes) and if\n * negative indicates a bottom-up row layout in the buffer.\n *\n * Note that the write API does not support interlacing or sub-8-bit pixels.\n */\n#endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */\n/*******************************************************************************\n *  END OF SIMPLIFIED API\n ******************************************************************************/\n\n#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\nPNG_EXPORT(242, void, png_set_check_for_invalid_index,\n    (png_structrp png_ptr, int allowed));\n#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED\nPNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,\n    png_const_infop info_ptr));\n#  endif\n#endif /* CHECK_FOR_INVALID_INDEX */\n\n/*******************************************************************************\n *  IMPLEMENTATION OPTIONS\n *******************************************************************************\n *\n * Support for arbitrary implementation-specific optimizations.  The API allows\n * particular options to be turned on or off.  'Option' is the number of the\n * option and 'onoff' is 0 (off) or non-0 (on).  The value returned is given\n * by the PNG_OPTION_ defines below.\n *\n * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions,\n *           are detected at run time, however sometimes it may be impossible\n *           to do this in user mode, in which case it is necessary to discover\n *           the capabilities in an OS specific way.  Such capabilities are\n *           listed here when libpng has support for them and must be turned\n *           ON by the application if present.\n *\n * SOFTWARE: sometimes software optimizations actually result in performance\n *           decrease on some architectures or systems, or with some sets of\n *           PNG images.  'Software' options allow such optimizations to be\n *           selected at run time.\n */\n#ifdef PNG_SET_OPTION_SUPPORTED\n#ifdef PNG_ARM_NEON_API_SUPPORTED\n#  define PNG_ARM_NEON   0 /* HARDWARE: ARM Neon SIMD instructions supported */\n#endif\n#define PNG_OPTION_NEXT  2 /* Next option - numbers must be even */\n\n/* Return values: NOTE: there are four values and 'off' is *not* zero */\n#define PNG_OPTION_UNSET   0 /* Unset - defaults to off */\n#define PNG_OPTION_INVALID 1 /* Option number out of range */\n#define PNG_OPTION_OFF     2\n#define PNG_OPTION_ON      3\n\nPNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,\n   int onoff));\n#endif\n\n/*******************************************************************************\n *  END OF HARDWARE OPTIONS\n ******************************************************************************/\n\n/* Maintainer: Put new public prototypes here ^, in libpng.3, and project\n * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt\n */\n\n/* The last ordinal number (this is the *last* one already used; the next\n * one to use is one more than this.)  Maintainer, remember to add an entry to\n * scripts/symbols.def as well.\n */\n#ifdef PNG_EXPORT_LAST_ORDINAL\n  PNG_EXPORT_LAST_ORDINAL(244);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* PNG_VERSION_INFO_ONLY */\n/* Do not put anything past this line */\n#endif /* PNG_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/mac/pngconf.h",
    "content": "\n/* pngconf.h - machine configurable file for libpng\n *\n * libpng version 1.6.2 - April 25, 2013\n *\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license.\n * For conditions of distribution and use, see the disclaimer\n * and license in png.h\n *\n */\n\n/* Any machine specific code is near the front of this file, so if you\n * are configuring libpng for a machine, you may want to read the section\n * starting here down to where it starts to typedef png_color, png_text,\n * and png_info.\n */\n\n#ifndef PNGCONF_H\n#define PNGCONF_H\n\n/* To do: Do all of this in scripts/pnglibconf.dfa */\n#ifdef PNG_SAFE_LIMITS_SUPPORTED\n#  ifdef PNG_USER_WIDTH_MAX\n#    undef PNG_USER_WIDTH_MAX\n#    define PNG_USER_WIDTH_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_HEIGHT_MAX\n#    undef PNG_USER_HEIGHT_MAX\n#    define PNG_USER_HEIGHT_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_MALLOC_MAX\n#    undef PNG_USER_CHUNK_MALLOC_MAX\n#    define PNG_USER_CHUNK_MALLOC_MAX 4000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_CACHE_MAX\n#    undef PNG_USER_CHUNK_CACHE_MAX\n#    define PNG_USER_CHUNK_CACHE_MAX 128\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */\n\n/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 (\"ISOC90\") compliant C\n * compiler for correct compilation.  The following header files are required by\n * the standard.  If your compiler doesn't provide these header files, or they\n * do not match the standard, you will need to provide/improve them.\n */\n#include <limits.h>\n#include <stddef.h>\n\n/* Library header files.  These header files are all defined by ISOC90; libpng\n * expects conformant implementations, however, an ISOC90 conformant system need\n * not provide these header files if the functionality cannot be implemented.\n * In this case it will be necessary to disable the relevant parts of libpng in\n * the build of pnglibconf.h.\n *\n * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not\n * include this unnecessary header file.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n   /* Required for the definition of FILE: */\n#  include <stdio.h>\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n   /* Required for the definition of jmp_buf and the declaration of longjmp: */\n#  include <setjmp.h>\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n   /* Required for struct tm: */\n#  include <time.h>\n#endif\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using\n * PNG_NO_CONST; this is no longer supported except for data declarations which\n * apparently still cause problems in 2011 on some compilers.\n */\n#define PNG_CONST const /* backward compatibility only */\n\n/* This controls optimization of the reading of 16 and 32 bit values\n * from PNG files.  It can be set on a per-app-file basis - it\n * just changes whether a macro is used when the function is called.\n * The library builder sets the default; if read functions are not\n * built into the library the macro implementation is forced on.\n */\n#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED\n#  define PNG_USE_READ_MACROS\n#endif\n#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)\n#  if PNG_DEFAULT_READ_MACROS\n#    define PNG_USE_READ_MACROS\n#  endif\n#endif\n\n/* COMPILER SPECIFIC OPTIONS.\n *\n * These options are provided so that a variety of difficult compilers\n * can be used.  Some are fixed at build time (e.g. PNG_API_RULE\n * below) but still have compiler specific implementations, others\n * may be changed on a per-file basis when compiling against libpng.\n */\n\n/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect\n * against legacy (pre ISOC90) compilers that did not understand function\n * prototypes.  It is not required for modern C compilers.\n */\n#ifndef PNGARG\n#  define PNGARG(arglist) arglist\n#endif\n\n/* Function calling conventions.\n * =============================\n * Normally it is not necessary to specify to the compiler how to call\n * a function - it just does it - however on x86 systems derived from\n * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems\n * and some others) there are multiple ways to call a function and the\n * default can be changed on the compiler command line.  For this reason\n * libpng specifies the calling convention of every exported function and\n * every function called via a user supplied function pointer.  This is\n * done in this file by defining the following macros:\n *\n * PNGAPI    Calling convention for exported functions.\n * PNGCBAPI  Calling convention for user provided (callback) functions.\n * PNGCAPI   Calling convention used by the ANSI-C library (required\n *           for longjmp callbacks and sometimes used internally to\n *           specify the calling convention for zlib).\n *\n * These macros should never be overridden.  If it is necessary to\n * change calling convention in a private build this can be done\n * by setting PNG_API_RULE (which defaults to 0) to one of the values\n * below to select the correct 'API' variants.\n *\n * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.\n *                This is correct in every known environment.\n * PNG_API_RULE=1 Use the operating system convention for PNGAPI and\n *                the 'C' calling convention (from PNGCAPI) for\n *                callbacks (PNGCBAPI).  This is no longer required\n *                in any known environment - if it has to be used\n *                please post an explanation of the problem to the\n *                libpng mailing list.\n *\n * These cases only differ if the operating system does not use the C\n * calling convention, at present this just means the above cases\n * (x86 DOS/Windows sytems) and, even then, this does not apply to\n * Cygwin running on those systems.\n *\n * Note that the value must be defined in pnglibconf.h so that what\n * the application uses to call the library matches the conventions\n * set when building the library.\n */\n\n/* Symbol export\n * =============\n * When building a shared library it is almost always necessary to tell\n * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'\n * is used to mark the symbols.  On some systems these symbols can be\n * extracted at link time and need no special processing by the compiler,\n * on other systems the symbols are flagged by the compiler and just\n * the declaration requires a special tag applied (unfortunately) in a\n * compiler dependent way.  Some systems can do either.\n *\n * A small number of older systems also require a symbol from a DLL to\n * be flagged to the program that calls it.  This is a problem because\n * we do not know in the header file included by application code that\n * the symbol will come from a shared library, as opposed to a statically\n * linked one.  For this reason the application must tell us by setting\n * the magic flag PNG_USE_DLL to turn on the special processing before\n * it includes png.h.\n *\n * Four additional macros are used to make this happen:\n *\n * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from\n *            the build or imported if PNG_USE_DLL is set - compiler\n *            and system specific.\n *\n * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to\n *                       'type', compiler specific.\n *\n * PNG_DLL_EXPORT Set to the magic to use during a libpng build to\n *                make a symbol exported from the DLL.  Not used in the\n *                public header files; see pngpriv.h for how it is used\n *                in the libpng build.\n *\n * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come\n *                from a DLL - used to define PNG_IMPEXP when\n *                PNG_USE_DLL is set.\n */\n\n/* System specific discovery.\n * ==========================\n * This code is used at build time to find PNG_IMPEXP, the API settings\n * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL\n * import processing is possible.  On Windows systems it also sets\n * compiler-specific macros to the values required to change the calling\n * conventions of the various functions.\n */\n#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\\\n    defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n  /* Windows system (DOS doesn't support DLLs).  Includes builds under Cygwin or\n   * MinGW on any architecture currently supported by Windows.  Also includes\n   * Watcom builds but these need special treatment because they are not\n   * compatible with GCC or Visual C because of different calling conventions.\n   */\n#  if PNG_API_RULE == 2\n    /* If this line results in an error, either because __watcall is not\n     * understood or because of a redefine just below you cannot use *this*\n     * build of the library with the compiler you are using.  *This* build was\n     * build using Watcom and applications must also be built using Watcom!\n     */\n#    define PNGCAPI __watcall\n#  endif\n\n#  if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))\n#    define PNGCAPI __cdecl\n#    if PNG_API_RULE == 1\n       /* If this line results in an error __stdcall is not understood and\n        * PNG_API_RULE should not have been set to '1'.\n        */\n#      define PNGAPI __stdcall\n#    endif\n#  else\n    /* An older compiler, or one not detected (erroneously) above,\n     * if necessary override on the command line to get the correct\n     * variants for the compiler.\n     */\n#    ifndef PNGCAPI\n#      define PNGCAPI _cdecl\n#    endif\n#    if PNG_API_RULE == 1 && !defined(PNGAPI)\n#      define PNGAPI _stdcall\n#    endif\n#  endif /* compiler/api */\n  /* NOTE: PNGCBAPI always defaults to PNGCAPI. */\n\n#  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)\n#     error \"PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed\"\n#  endif\n\n#  if (defined(_MSC_VER) && _MSC_VER < 800) ||\\\n      (defined(__BORLANDC__) && __BORLANDC__ < 0x500)\n    /* older Borland and MSC\n     * compilers used '__export' and required this to be after\n     * the type.\n     */\n#    ifndef PNG_EXPORT_TYPE\n#      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP\n#    endif\n#    define PNG_DLL_EXPORT __export\n#  else /* newer compiler */\n#    define PNG_DLL_EXPORT __declspec(dllexport)\n#    ifndef PNG_DLL_IMPORT\n#      define PNG_DLL_IMPORT __declspec(dllimport)\n#    endif\n#  endif /* compiler */\n\n#else /* !Windows */\n#  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)\n#    define PNGAPI _System\n#  else /* !Windows/x86 && !OS/2 */\n    /* Use the defaults, or define PNG*API on the command line (but\n     * this will have to be done for every compile!)\n     */\n#  endif /* other system, !OS/2 */\n#endif /* !Windows/x86 */\n\n/* Now do all the defaulting . */\n#ifndef PNGCAPI\n#  define PNGCAPI\n#endif\n#ifndef PNGCBAPI\n#  define PNGCBAPI PNGCAPI\n#endif\n#ifndef PNGAPI\n#  define PNGAPI PNGCAPI\n#endif\n\n/* PNG_IMPEXP may be set on the compilation system command line or (if not set)\n * then in an internal header file when building the library, otherwise (when\n * using the library) it is set here.\n */\n#ifndef PNG_IMPEXP\n#  if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)\n     /* This forces use of a DLL, disallowing static linking */\n#    define PNG_IMPEXP PNG_DLL_IMPORT\n#  endif\n\n#  ifndef PNG_IMPEXP\n#    define PNG_IMPEXP\n#  endif\n#endif\n\n/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat\n * 'attributes' as a storage class - the attributes go at the start of the\n * function definition, and attributes are always appended regardless of the\n * compiler.  This considerably simplifies these macros but may cause problems\n * if any compilers both need function attributes and fail to handle them as\n * a storage class (this is unlikely.)\n */\n#ifndef PNG_FUNCTION\n#  define PNG_FUNCTION(type, name, args, attributes) attributes type name args\n#endif\n\n#ifndef PNG_EXPORT_TYPE\n#  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type\n#endif\n\n   /* The ordinal value is only relevant when preprocessing png.h for symbol\n    * table entries, so we discard it here.  See the .dfn files in the\n    * scripts directory.\n    */\n#ifndef PNG_EXPORTA\n\n#  define PNG_EXPORTA(ordinal, type, name, args, attributes)\\\n      PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \\\n        extern attributes)\n#endif\n\n/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,\n * so make something non-empty to satisfy the requirement:\n */\n#define PNG_EMPTY /*empty list*/\n\n#define PNG_EXPORT(ordinal, type, name, args)\\\n   PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)\n\n/* Use PNG_REMOVED to comment out a removed interface. */\n#ifndef PNG_REMOVED\n#  define PNG_REMOVED(ordinal, type, name, args, attributes)\n#endif\n\n#ifndef PNG_CALLBACK\n#  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)\n#endif\n\n/* Support for compiler specific function attributes.  These are used\n * so that where compiler support is available incorrect use of API\n * functions in png.h will generate compiler warnings.\n *\n * Added at libpng-1.2.41.\n */\n\n#ifndef PNG_NO_PEDANTIC_WARNINGS\n#  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED\n#    define PNG_PEDANTIC_WARNINGS_SUPPORTED\n#  endif\n#endif\n\n#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED\n  /* Support for compiler specific function attributes.  These are used\n   * so that where compiler support is available, incorrect use of API\n   * functions in png.h will generate compiler warnings.  Added at libpng\n   * version 1.2.41.  Disabling these removes the warnings but may also produce\n   * less efficient code.\n   */\n#  if defined(__GNUC__)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT __attribute__((__warn_unused_result__))\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __attribute__((__noreturn__))\n#    endif\n#    if __GNUC__ >= 3\n#      ifndef PNG_ALLOCATED\n#        define PNG_ALLOCATED  __attribute__((__malloc__))\n#      endif\n#      ifndef PNG_DEPRECATED\n#        define PNG_DEPRECATED __attribute__((__deprecated__))\n#      endif\n#      ifndef PNG_PRIVATE\n#        if 0 /* Doesn't work so we use deprecated instead*/\n#          define PNG_PRIVATE \\\n            __attribute__((warning(\"This function is not exported by libpng.\")))\n#        else\n#          define PNG_PRIVATE \\\n            __attribute__((__deprecated__))\n#        endif\n#      endif\n#      if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))\n#        ifndef PNG_RESTRICT\n#          define PNG_RESTRICT __restrict\n#        endif\n#      endif /*  __GNUC__ == 3.0 */\n#    endif /*  __GNUC__ >= 3 */\n\n#  elif defined(_MSC_VER)  && (_MSC_VER >= 1300)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT /* not supported */\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __declspec(noreturn)\n#    endif\n#    ifndef PNG_ALLOCATED\n#      if (_MSC_VER >= 1400)\n#        define PNG_ALLOCATED __declspec(restrict)\n#      endif\n#    endif\n#    ifndef PNG_DEPRECATED\n#      define PNG_DEPRECATED __declspec(deprecated)\n#    endif\n#    ifndef PNG_PRIVATE\n#      define PNG_PRIVATE __declspec(deprecated)\n#    endif\n#    ifndef PNG_RESTRICT\n#      if (_MSC_VER >= 1400)\n#        define PNG_RESTRICT __restrict\n#      endif\n#    endif\n\n#  elif defined(__WATCOMC__)\n#    ifndef PNG_RESTRICT\n#      define PNG_RESTRICT __restrict\n#    endif\n#  endif /* _MSC_VER */\n#endif /* PNG_PEDANTIC_WARNINGS */\n\n#ifndef PNG_DEPRECATED\n#  define PNG_DEPRECATED  /* Use of this function is deprecated */\n#endif\n#ifndef PNG_USE_RESULT\n#  define PNG_USE_RESULT  /* The result of this function must be checked */\n#endif\n#ifndef PNG_NORETURN\n#  define PNG_NORETURN    /* This function does not return */\n#endif\n#ifndef PNG_ALLOCATED\n#  define PNG_ALLOCATED   /* The result of the function is new memory */\n#endif\n#ifndef PNG_PRIVATE\n#  define PNG_PRIVATE     /* This is a private libpng function */\n#endif\n#ifndef PNG_RESTRICT\n#  define PNG_RESTRICT    /* The C99 \"restrict\" feature */\n#endif\n#ifndef PNG_FP_EXPORT     /* A floating point API. */\n#  ifdef PNG_FLOATING_POINT_SUPPORTED\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No floating point APIs */\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n#ifndef PNG_FIXED_EXPORT  /* A fixed point API. */\n#  ifdef PNG_FIXED_POINT_SUPPORTED\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No fixed point APIs */\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE\n/* Some typedefs to get us started.  These should be safe on most of the common\n * platforms.\n *\n * png_uint_32 and png_int_32 may, currently, be larger than required to hold a\n * 32-bit value however this is not normally advisable.\n *\n * png_uint_16 and png_int_16 should always be two bytes in size - this is\n * verified at library build time.\n *\n * png_byte must always be one byte in size.\n *\n * The checks below use constants from limits.h, as defined by the ISOC90\n * standard.\n */\n#if CHAR_BIT == 8 && UCHAR_MAX == 255\n   typedef unsigned char png_byte;\n#else\n#  error \"libpng requires 8 bit bytes\"\n#endif\n\n#if INT_MIN == -32768 && INT_MAX == 32767\n   typedef int png_int_16;\n#elif SHRT_MIN == -32768 && SHRT_MAX == 32767\n   typedef short png_int_16;\n#else\n#  error \"libpng requires a signed 16 bit type\"\n#endif\n\n#if UINT_MAX == 65535\n   typedef unsigned int png_uint_16;\n#elif USHRT_MAX == 65535\n   typedef unsigned short png_uint_16;\n#else\n#  error \"libpng requires an unsigned 16 bit type\"\n#endif\n\n#if INT_MIN < -2147483646 && INT_MAX > 2147483646\n   typedef int png_int_32;\n#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646\n   typedef long int png_int_32;\n#else\n#  error \"libpng requires a signed 32 bit (or more) type\"\n#endif\n\n#if UINT_MAX > 4294967294\n   typedef unsigned int png_uint_32;\n#elif ULONG_MAX > 4294967294\n   typedef unsigned long int png_uint_32;\n#else\n#  error \"libpng requires an unsigned 32 bit (or more) type\"\n#endif\n\n/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,\n * requires an ISOC90 compiler and relies on consistent behavior of sizeof.\n */\ntypedef size_t png_size_t;\ntypedef ptrdiff_t png_ptrdiff_t;\n\n/* libpng needs to know the maximum value of 'size_t' and this controls the\n * definition of png_alloc_size_t, below.  This maximum value of size_t limits\n * but does not control the maximum allocations the library makes - there is\n * direct application control of this through png_set_user_limits().\n */\n#ifndef PNG_SMALL_SIZE_T\n   /* Compiler specific tests for systems where size_t is known to be less than\n    * 32 bits (some of these systems may no longer work because of the lack of\n    * 'far' support; see above.)\n    */\n#  if (defined(__TURBOC__) && !defined(__FLAT__)) ||\\\n   (defined(_MSC_VER) && defined(MAXSEG_64K))\n#     define PNG_SMALL_SIZE_T\n#  endif\n#endif\n\n/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no\n * smaller than png_uint_32.  Casts from png_size_t or png_uint_32 to\n * png_alloc_size_t are not necessary; in fact, it is recommended not to use\n * them at all so that the compiler can complain when something turns out to be\n * problematic.\n *\n * Casts in the other direction (from png_alloc_size_t to png_size_t or\n * png_uint_32) should be explicitly applied; however, we do not expect to\n * encounter practical situations that require such conversions.\n *\n * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than\n * 4294967295 - i.e. less than the maximum value of png_uint_32.\n */\n#ifdef PNG_SMALL_SIZE_T\n   typedef png_uint_32 png_alloc_size_t;\n#else\n   typedef png_size_t png_alloc_size_t;\n#endif\n\n/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler\n * implementations of Intel CPU specific support of user-mode segmented address\n * spaces, where 16-bit pointers address more than 65536 bytes of memory using\n * separate 'segment' registers.  The implementation requires two different\n * types of pointer (only one of which includes the segment value.)\n *\n * If required this support is available in version 1.2 of libpng and may be\n * available in versions through 1.5, although the correctness of the code has\n * not been verified recently.\n */\n\n/* Typedef for floating-point numbers that are converted to fixed-point with a\n * multiple of 100,000, e.g., gamma\n */\ntypedef png_int_32 png_fixed_point;\n\n/* Add typedefs for pointers */\ntypedef void                  * png_voidp;\ntypedef const void            * png_const_voidp;\ntypedef png_byte              * png_bytep;\ntypedef const png_byte        * png_const_bytep;\ntypedef png_uint_32           * png_uint_32p;\ntypedef const png_uint_32     * png_const_uint_32p;\ntypedef png_int_32            * png_int_32p;\ntypedef const png_int_32      * png_const_int_32p;\ntypedef png_uint_16           * png_uint_16p;\ntypedef const png_uint_16     * png_const_uint_16p;\ntypedef png_int_16            * png_int_16p;\ntypedef const png_int_16      * png_const_int_16p;\ntypedef char                  * png_charp;\ntypedef const char            * png_const_charp;\ntypedef png_fixed_point       * png_fixed_point_p;\ntypedef const png_fixed_point * png_const_fixed_point_p;\ntypedef png_size_t            * png_size_tp;\ntypedef const png_size_t      * png_const_size_tp;\n\n#ifdef PNG_STDIO_SUPPORTED\ntypedef FILE            * png_FILE_p;\n#endif\n\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double       * png_doublep;\ntypedef const double * png_const_doublep;\n#endif\n\n/* Pointers to pointers; i.e. arrays */\ntypedef png_byte        * * png_bytepp;\ntypedef png_uint_32     * * png_uint_32pp;\ntypedef png_int_32      * * png_int_32pp;\ntypedef png_uint_16     * * png_uint_16pp;\ntypedef png_int_16      * * png_int_16pp;\ntypedef const char      * * png_const_charpp;\ntypedef char            * * png_charpp;\ntypedef png_fixed_point * * png_fixed_point_pp;\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double          * * png_doublepp;\n#endif\n\n/* Pointers to pointers to pointers; i.e., pointer to array */\ntypedef char            * * * png_charppp;\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n#endif /* PNGCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/mac/pnglibconf.h",
    "content": "/* pnglibconf.h - library build configuration */\n\n/* libpng version 1.6.2 - April 25, 2013 */\n\n/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */\n\n/* This code is released under the libpng license. */\n/* For conditions of distribution and use, see the disclaimer */\n/* and license in png.h */\n\n/* pnglibconf.h */\n/* Machine generated file: DO NOT EDIT */\n/* Derived from: scripts/pnglibconf.dfa */\n#ifndef PNGLCONF_H\n#define PNGLCONF_H\n/* options */\n#define PNG_16BIT_SUPPORTED\n#define PNG_ALIGNED_MEMORY_SUPPORTED\n/*#undef PNG_ARM_NEON_API_SUPPORTED*/\n/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/\n/*#undef PNG_ARM_NEON_SUPPORTED*/\n#define PNG_BENIGN_ERRORS_SUPPORTED\n#define PNG_BENIGN_READ_ERRORS_SUPPORTED\n/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/\n#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\n#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_COLORSPACE_SUPPORTED\n#define PNG_CONSOLE_IO_SUPPORTED\n#define PNG_CONVERT_tIME_SUPPORTED\n#define PNG_EASY_ACCESS_SUPPORTED\n/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/\n#define PNG_ERROR_TEXT_SUPPORTED\n#define PNG_FIXED_POINT_SUPPORTED\n#define PNG_FLOATING_ARITHMETIC_SUPPORTED\n#define PNG_FLOATING_POINT_SUPPORTED\n#define PNG_FORMAT_AFIRST_SUPPORTED\n#define PNG_FORMAT_BGR_SUPPORTED\n#define PNG_GAMMA_SUPPORTED\n#define PNG_GET_PALETTE_MAX_SUPPORTED\n#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED\n#define PNG_INCH_CONVERSIONS_SUPPORTED\n#define PNG_INFO_IMAGE_SUPPORTED\n#define PNG_IO_STATE_SUPPORTED\n#define PNG_MNG_FEATURES_SUPPORTED\n#define PNG_POINTER_INDEXING_SUPPORTED\n#define PNG_PROGRESSIVE_READ_SUPPORTED\n#define PNG_READ_16BIT_SUPPORTED\n#define PNG_READ_ALPHA_MODE_SUPPORTED\n#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_READ_BACKGROUND_SUPPORTED\n#define PNG_READ_BGR_SUPPORTED\n#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_READ_COMPOSITE_NODIV_SUPPORTED\n#define PNG_READ_COMPRESSED_TEXT_SUPPORTED\n#define PNG_READ_EXPAND_16_SUPPORTED\n#define PNG_READ_EXPAND_SUPPORTED\n#define PNG_READ_FILLER_SUPPORTED\n#define PNG_READ_GAMMA_SUPPORTED\n#define PNG_READ_GET_PALETTE_MAX_SUPPORTED\n#define PNG_READ_GRAY_TO_RGB_SUPPORTED\n#define PNG_READ_INTERLACING_SUPPORTED\n#define PNG_READ_INT_FUNCTIONS_SUPPORTED\n#define PNG_READ_INVERT_ALPHA_SUPPORTED\n#define PNG_READ_INVERT_SUPPORTED\n#define PNG_READ_OPT_PLTE_SUPPORTED\n#define PNG_READ_PACKSWAP_SUPPORTED\n#define PNG_READ_PACK_SUPPORTED\n#define PNG_READ_QUANTIZE_SUPPORTED\n#define PNG_READ_RGB_TO_GRAY_SUPPORTED\n#define PNG_READ_SCALE_16_TO_8_SUPPORTED\n#define PNG_READ_SHIFT_SUPPORTED\n#define PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_STRIP_ALPHA_SUPPORTED\n#define PNG_READ_SUPPORTED\n#define PNG_READ_SWAP_ALPHA_SUPPORTED\n#define PNG_READ_SWAP_SUPPORTED\n#define PNG_READ_TEXT_SUPPORTED\n#define PNG_READ_TRANSFORMS_SUPPORTED\n#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_READ_USER_CHUNKS_SUPPORTED\n#define PNG_READ_USER_TRANSFORM_SUPPORTED\n#define PNG_READ_bKGD_SUPPORTED\n#define PNG_READ_cHRM_SUPPORTED\n#define PNG_READ_gAMA_SUPPORTED\n#define PNG_READ_hIST_SUPPORTED\n#define PNG_READ_iCCP_SUPPORTED\n#define PNG_READ_iTXt_SUPPORTED\n#define PNG_READ_oFFs_SUPPORTED\n#define PNG_READ_pCAL_SUPPORTED\n#define PNG_READ_pHYs_SUPPORTED\n#define PNG_READ_sBIT_SUPPORTED\n#define PNG_READ_sCAL_SUPPORTED\n#define PNG_READ_sPLT_SUPPORTED\n#define PNG_READ_sRGB_SUPPORTED\n#define PNG_READ_tEXt_SUPPORTED\n#define PNG_READ_tIME_SUPPORTED\n#define PNG_READ_tRNS_SUPPORTED\n#define PNG_READ_zTXt_SUPPORTED\n/*#undef PNG_SAFE_LIMITS_SUPPORTED*/\n#define PNG_SAVE_INT_32_SUPPORTED\n#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SEQUENTIAL_READ_SUPPORTED\n#define PNG_SETJMP_SUPPORTED\n#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED\n#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED\n/*#undef PNG_SET_OPTION_SUPPORTED*/\n#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SET_USER_LIMITS_SUPPORTED\n#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_READ_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_SUPPORTED\n#define PNG_STDIO_SUPPORTED\n#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_TEXT_SUPPORTED\n#define PNG_TIME_RFC1123_SUPPORTED\n#define PNG_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_USER_CHUNKS_SUPPORTED\n#define PNG_USER_LIMITS_SUPPORTED\n#define PNG_USER_MEM_SUPPORTED\n#define PNG_USER_TRANSFORM_INFO_SUPPORTED\n#define PNG_USER_TRANSFORM_PTR_SUPPORTED\n#define PNG_WARNINGS_SUPPORTED\n#define PNG_WRITE_16BIT_SUPPORTED\n#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_WRITE_BGR_SUPPORTED\n#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED\n#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n#define PNG_WRITE_FILLER_SUPPORTED\n#define PNG_WRITE_FILTER_SUPPORTED\n#define PNG_WRITE_FLUSH_SUPPORTED\n#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED\n#define PNG_WRITE_INTERLACING_SUPPORTED\n#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED\n#define PNG_WRITE_INVERT_ALPHA_SUPPORTED\n#define PNG_WRITE_INVERT_SUPPORTED\n#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED\n#define PNG_WRITE_PACKSWAP_SUPPORTED\n#define PNG_WRITE_PACK_SUPPORTED\n#define PNG_WRITE_SHIFT_SUPPORTED\n#define PNG_WRITE_SUPPORTED\n#define PNG_WRITE_SWAP_ALPHA_SUPPORTED\n#define PNG_WRITE_SWAP_SUPPORTED\n#define PNG_WRITE_TEXT_SUPPORTED\n#define PNG_WRITE_TRANSFORMS_SUPPORTED\n#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_WRITE_USER_TRANSFORM_SUPPORTED\n#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED\n#define PNG_WRITE_bKGD_SUPPORTED\n#define PNG_WRITE_cHRM_SUPPORTED\n#define PNG_WRITE_gAMA_SUPPORTED\n#define PNG_WRITE_hIST_SUPPORTED\n#define PNG_WRITE_iCCP_SUPPORTED\n#define PNG_WRITE_iTXt_SUPPORTED\n#define PNG_WRITE_oFFs_SUPPORTED\n#define PNG_WRITE_pCAL_SUPPORTED\n#define PNG_WRITE_pHYs_SUPPORTED\n#define PNG_WRITE_sBIT_SUPPORTED\n#define PNG_WRITE_sCAL_SUPPORTED\n#define PNG_WRITE_sPLT_SUPPORTED\n#define PNG_WRITE_sRGB_SUPPORTED\n#define PNG_WRITE_tEXt_SUPPORTED\n#define PNG_WRITE_tIME_SUPPORTED\n#define PNG_WRITE_tRNS_SUPPORTED\n#define PNG_WRITE_zTXt_SUPPORTED\n#define PNG_bKGD_SUPPORTED\n#define PNG_cHRM_SUPPORTED\n#define PNG_gAMA_SUPPORTED\n#define PNG_hIST_SUPPORTED\n#define PNG_iCCP_SUPPORTED\n#define PNG_iTXt_SUPPORTED\n#define PNG_oFFs_SUPPORTED\n#define PNG_pCAL_SUPPORTED\n#define PNG_pHYs_SUPPORTED\n#define PNG_sBIT_SUPPORTED\n#define PNG_sCAL_SUPPORTED\n#define PNG_sPLT_SUPPORTED\n#define PNG_sRGB_SUPPORTED\n#define PNG_tEXt_SUPPORTED\n#define PNG_tIME_SUPPORTED\n#define PNG_tRNS_SUPPORTED\n#define PNG_zTXt_SUPPORTED\n/* end of options */\n/* settings */\n#define PNG_API_RULE 0\n#define PNG_CALLOC_SUPPORTED\n#define PNG_COST_SHIFT 3\n#define PNG_DEFAULT_READ_MACROS 1\n#define PNG_GAMMA_THRESHOLD_FIXED 5000\n#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE\n#define PNG_INFLATE_BUF_SIZE 1024\n#define PNG_MAX_GAMMA_8 11\n#define PNG_QUANTIZE_BLUE_BITS 5\n#define PNG_QUANTIZE_GREEN_BITS 5\n#define PNG_QUANTIZE_RED_BITS 5\n#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_TEXT_Z_DEFAULT_STRATEGY 0\n#define PNG_WEIGHT_SHIFT 8\n#define PNG_ZBUF_SIZE 8192\n#define PNG_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0\n#define PNG_Z_DEFAULT_STRATEGY 1\n#define PNG_sCAL_PRECISION 5\n#define PNG_sRGB_PROFILE_CHECKS 2\n/* end of settings */\n#endif /* PNGLCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/win32/png.h",
    "content": "\n/* png.h - header file for PNG reference library\n *\n * libpng version 1.6.2 - April 25, 2013\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license (See LICENSE, below)\n *\n * Authors and maintainers:\n *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat\n *   libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger\n *   libpng versions 0.97, January 1998, through 1.6.2 - April 25, 2013: Glenn\n *   See also \"Contributing Authors\", below.\n *\n * Note about libpng version numbers:\n *\n *   Due to various miscommunications, unforeseen code incompatibilities\n *   and occasional factors outside the authors' control, version numbering\n *   on the library has not always been consistent and straightforward.\n *   The following table summarizes matters since version 0.89c, which was\n *   the first widely used release:\n *\n *    source                 png.h  png.h  shared-lib\n *    version                string   int  version\n *    -------                ------ -----  ----------\n *    0.89c \"1.0 beta 3\"     0.89      89  1.0.89\n *    0.90  \"1.0 beta 4\"     0.90      90  0.90  [should have been 2.0.90]\n *    0.95  \"1.0 beta 5\"     0.95      95  0.95  [should have been 2.0.95]\n *    0.96  \"1.0 beta 6\"     0.96      96  0.96  [should have been 2.0.96]\n *    0.97b \"1.00.97 beta 7\" 1.00.97   97  1.0.1 [should have been 2.0.97]\n *    0.97c                  0.97      97  2.0.97\n *    0.98                   0.98      98  2.0.98\n *    0.99                   0.99      98  2.0.99\n *    0.99a-m                0.99      99  2.0.99\n *    1.00                   1.00     100  2.1.0 [100 should be 10000]\n *    1.0.0      (from here on, the   100  2.1.0 [100 should be 10000]\n *    1.0.1       png.h string is   10001  2.1.0\n *    1.0.1a-e    identical to the  10002  from here on, the shared library\n *    1.0.2       source version)   10002  is 2.V where V is the source code\n *    1.0.2a-b                      10003  version, except as noted.\n *    1.0.3                         10003\n *    1.0.3a-d                      10004\n *    1.0.4                         10004\n *    1.0.4a-f                      10005\n *    1.0.5 (+ 2 patches)           10005\n *    1.0.5a-d                      10006\n *    1.0.5e-r                      10100 (not source compatible)\n *    1.0.5s-v                      10006 (not binary compatible)\n *    1.0.6 (+ 3 patches)           10006 (still binary incompatible)\n *    1.0.6d-f                      10007 (still binary incompatible)\n *    1.0.6g                        10007\n *    1.0.6h                        10007  10.6h (testing xy.z so-numbering)\n *    1.0.6i                        10007  10.6i\n *    1.0.6j                        10007  2.1.0.6j (incompatible with 1.0.0)\n *    1.0.7beta11-14        DLLNUM  10007  2.1.0.7beta11-14 (binary compatible)\n *    1.0.7beta15-18           1    10007  2.1.0.7beta15-18 (binary compatible)\n *    1.0.7rc1-2               1    10007  2.1.0.7rc1-2 (binary compatible)\n *    1.0.7                    1    10007  (still compatible)\n *    1.0.8beta1-4             1    10008  2.1.0.8beta1-4\n *    1.0.8rc1                 1    10008  2.1.0.8rc1\n *    1.0.8                    1    10008  2.1.0.8\n *    1.0.9beta1-6             1    10009  2.1.0.9beta1-6\n *    1.0.9rc1                 1    10009  2.1.0.9rc1\n *    1.0.9beta7-10            1    10009  2.1.0.9beta7-10\n *    1.0.9rc2                 1    10009  2.1.0.9rc2\n *    1.0.9                    1    10009  2.1.0.9\n *    1.0.10beta1              1    10010  2.1.0.10beta1\n *    1.0.10rc1                1    10010  2.1.0.10rc1\n *    1.0.10                   1    10010  2.1.0.10\n *    1.0.11beta1-3            1    10011  2.1.0.11beta1-3\n *    1.0.11rc1                1    10011  2.1.0.11rc1\n *    1.0.11                   1    10011  2.1.0.11\n *    1.0.12beta1-2            2    10012  2.1.0.12beta1-2\n *    1.0.12rc1                2    10012  2.1.0.12rc1\n *    1.0.12                   2    10012  2.1.0.12\n *    1.1.0a-f                 -    10100  2.1.1.0a-f (branch abandoned)\n *    1.2.0beta1-2             2    10200  2.1.2.0beta1-2\n *    1.2.0beta3-5             3    10200  3.1.2.0beta3-5\n *    1.2.0rc1                 3    10200  3.1.2.0rc1\n *    1.2.0                    3    10200  3.1.2.0\n *    1.2.1beta1-4             3    10201  3.1.2.1beta1-4\n *    1.2.1rc1-2               3    10201  3.1.2.1rc1-2\n *    1.2.1                    3    10201  3.1.2.1\n *    1.2.2beta1-6            12    10202  12.so.0.1.2.2beta1-6\n *    1.0.13beta1             10    10013  10.so.0.1.0.13beta1\n *    1.0.13rc1               10    10013  10.so.0.1.0.13rc1\n *    1.2.2rc1                12    10202  12.so.0.1.2.2rc1\n *    1.0.13                  10    10013  10.so.0.1.0.13\n *    1.2.2                   12    10202  12.so.0.1.2.2\n *    1.2.3rc1-6              12    10203  12.so.0.1.2.3rc1-6\n *    1.2.3                   12    10203  12.so.0.1.2.3\n *    1.2.4beta1-3            13    10204  12.so.0.1.2.4beta1-3\n *    1.0.14rc1               13    10014  10.so.0.1.0.14rc1\n *    1.2.4rc1                13    10204  12.so.0.1.2.4rc1\n *    1.0.14                  10    10014  10.so.0.1.0.14\n *    1.2.4                   13    10204  12.so.0.1.2.4\n *    1.2.5beta1-2            13    10205  12.so.0.1.2.5beta1-2\n *    1.0.15rc1-3             10    10015  10.so.0.1.0.15rc1-3\n *    1.2.5rc1-3              13    10205  12.so.0.1.2.5rc1-3\n *    1.0.15                  10    10015  10.so.0.1.0.15\n *    1.2.5                   13    10205  12.so.0.1.2.5\n *    1.2.6beta1-4            13    10206  12.so.0.1.2.6beta1-4\n *    1.0.16                  10    10016  10.so.0.1.0.16\n *    1.2.6                   13    10206  12.so.0.1.2.6\n *    1.2.7beta1-2            13    10207  12.so.0.1.2.7beta1-2\n *    1.0.17rc1               10    10017  12.so.0.1.0.17rc1\n *    1.2.7rc1                13    10207  12.so.0.1.2.7rc1\n *    1.0.17                  10    10017  12.so.0.1.0.17\n *    1.2.7                   13    10207  12.so.0.1.2.7\n *    1.2.8beta1-5            13    10208  12.so.0.1.2.8beta1-5\n *    1.0.18rc1-5             10    10018  12.so.0.1.0.18rc1-5\n *    1.2.8rc1-5              13    10208  12.so.0.1.2.8rc1-5\n *    1.0.18                  10    10018  12.so.0.1.0.18\n *    1.2.8                   13    10208  12.so.0.1.2.8\n *    1.2.9beta1-3            13    10209  12.so.0.1.2.9beta1-3\n *    1.2.9beta4-11           13    10209  12.so.0.9[.0]\n *    1.2.9rc1                13    10209  12.so.0.9[.0]\n *    1.2.9                   13    10209  12.so.0.9[.0]\n *    1.2.10beta1-7           13    10210  12.so.0.10[.0]\n *    1.2.10rc1-2             13    10210  12.so.0.10[.0]\n *    1.2.10                  13    10210  12.so.0.10[.0]\n *    1.4.0beta1-5            14    10400  14.so.0.0[.0]\n *    1.2.11beta1-4           13    10211  12.so.0.11[.0]\n *    1.4.0beta7-8            14    10400  14.so.0.0[.0]\n *    1.2.11                  13    10211  12.so.0.11[.0]\n *    1.2.12                  13    10212  12.so.0.12[.0]\n *    1.4.0beta9-14           14    10400  14.so.0.0[.0]\n *    1.2.13                  13    10213  12.so.0.13[.0]\n *    1.4.0beta15-36          14    10400  14.so.0.0[.0]\n *    1.4.0beta37-87          14    10400  14.so.14.0[.0]\n *    1.4.0rc01               14    10400  14.so.14.0[.0]\n *    1.4.0beta88-109         14    10400  14.so.14.0[.0]\n *    1.4.0rc02-08            14    10400  14.so.14.0[.0]\n *    1.4.0                   14    10400  14.so.14.0[.0]\n *    1.4.1beta01-03          14    10401  14.so.14.1[.0]\n *    1.4.1rc01               14    10401  14.so.14.1[.0]\n *    1.4.1beta04-12          14    10401  14.so.14.1[.0]\n *    1.4.1                   14    10401  14.so.14.1[.0]\n *    1.4.2                   14    10402  14.so.14.2[.0]\n *    1.4.3                   14    10403  14.so.14.3[.0]\n *    1.4.4                   14    10404  14.so.14.4[.0]\n *    1.5.0beta01-58          15    10500  15.so.15.0[.0]\n *    1.5.0rc01-07            15    10500  15.so.15.0[.0]\n *    1.5.0                   15    10500  15.so.15.0[.0]\n *    1.5.1beta01-11          15    10501  15.so.15.1[.0]\n *    1.5.1rc01-02            15    10501  15.so.15.1[.0]\n *    1.5.1                   15    10501  15.so.15.1[.0]\n *    1.5.2beta01-03          15    10502  15.so.15.2[.0]\n *    1.5.2rc01-03            15    10502  15.so.15.2[.0]\n *    1.5.2                   15    10502  15.so.15.2[.0]\n *    1.5.3beta01-10          15    10503  15.so.15.3[.0]\n *    1.5.3rc01-02            15    10503  15.so.15.3[.0]\n *    1.5.3beta11             15    10503  15.so.15.3[.0]\n *    1.5.3 [omitted]\n *    1.5.4beta01-08          15    10504  15.so.15.4[.0]\n *    1.5.4rc01               15    10504  15.so.15.4[.0]\n *    1.5.4                   15    10504  15.so.15.4[.0]\n *    1.5.5beta01-08          15    10505  15.so.15.5[.0]\n *    1.5.5rc01               15    10505  15.so.15.5[.0]\n *    1.5.5                   15    10505  15.so.15.5[.0]\n *    1.5.6beta01-07          15    10506  15.so.15.6[.0]\n *    1.5.6rc01-03            15    10506  15.so.15.6[.0]\n *    1.5.6                   15    10506  15.so.15.6[.0]\n *    1.5.7beta01-05          15    10507  15.so.15.7[.0]\n *    1.5.7rc01-03            15    10507  15.so.15.7[.0]\n *    1.5.7                   15    10507  15.so.15.7[.0]\n *    1.6.0beta01-40          16    10600  16.so.16.0[.0]\n *    1.6.0rc01-08            16    10600  16.so.16.0[.0]\n *    1.6.0                   16    10600  16.so.16.0[.0]\n *    1.6.1beta01-09          16    10601  16.so.16.1[.0]\n *    1.6.1rc01               16    10601  16.so.16.1[.0]\n *    1.6.1                   16    10601  16.so.16.1[.0]\n *    1.6.2beta01             16    10602  16.so.16.2[.0]\n *    1.6.2rc01-06            16    10602  16.so.16.2[.0]\n *    1.6.2                   16    10602  16.so.16.2[.0]\n *\n *   Henceforth the source version will match the shared-library major\n *   and minor numbers; the shared-library major version number will be\n *   used for changes in backward compatibility, as it is intended.  The\n *   PNG_LIBPNG_VER macro, which is not used within libpng but is available\n *   for applications, is an unsigned integer of the form xyyzz corresponding\n *   to the source version x.y.z (leading zeros in y and z).  Beta versions\n *   were given the previous public release number plus a letter, until\n *   version 1.0.6j; from then on they were given the upcoming public\n *   release number plus \"betaNN\" or \"rcNN\".\n *\n *   Binary incompatibility exists only when applications make direct access\n *   to the info_ptr or png_ptr members through png.h, and the compiled\n *   application is loaded with a different version of the library.\n *\n *   DLLNUM will change each time there are forward or backward changes\n *   in binary compatibility (e.g., when a new feature is added).\n *\n * See libpng-manual.txt or libpng.3 for more information.  The PNG\n * specification is available as a W3C Recommendation and as an ISO\n * Specification, <http://www.w3.org/TR/2003/REC-PNG-20031110/\n */\n\n/*\n * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:\n *\n * If you modify libpng you may insert additional notices immediately following\n * this sentence.\n *\n * This code is released under the libpng license.\n *\n * libpng versions 1.2.6, August 15, 2004, through 1.6.2, April 25, 2013, are\n * Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.2.5\n * with the following individual added to the list of Contributing Authors:\n *\n *    Cosmin Truta\n *\n * libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are\n * Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-1.0.6\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Simon-Pierre Cadieux\n *    Eric S. Raymond\n *    Gilles Vollant\n *\n * and with the following additions to the disclaimer:\n *\n *    There is no warranty against interference with your enjoyment of the\n *    library or against infringement.  There is no warranty that our\n *    efforts or the library will fulfill any of your particular purposes\n *    or needs.  This library is provided with all faults, and the entire\n *    risk of satisfactory quality, performance, accuracy, and effort is with\n *    the user.\n *\n * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are\n * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are\n * distributed according to the same disclaimer and license as libpng-0.96,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    Tom Lane\n *    Glenn Randers-Pehrson\n *    Willem van Schaik\n *\n * libpng versions 0.89, June 1996, through 0.96, May 1997, are\n * Copyright (c) 1996, 1997 Andreas Dilger\n * Distributed according to the same disclaimer and license as libpng-0.88,\n * with the following individuals added to the list of Contributing Authors:\n *\n *    John Bowler\n *    Kevin Bracey\n *    Sam Bushell\n *    Magnus Holmgren\n *    Greg Roelofs\n *    Tom Tanner\n *\n * libpng versions 0.5, May 1995, through 0.88, January 1996, are\n * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n *\n * For the purposes of this copyright and license, \"Contributing Authors\"\n * is defined as the following set of individuals:\n *\n *    Andreas Dilger\n *    Dave Martindale\n *    Guy Eric Schalnat\n *    Paul Schmidt\n *    Tim Wegner\n *\n * The PNG Reference Library is supplied \"AS IS\".  The Contributing Authors\n * and Group 42, Inc. disclaim all warranties, expressed or implied,\n * including, without limitation, the warranties of merchantability and of\n * fitness for any purpose.  The Contributing Authors and Group 42, Inc.\n * assume no liability for direct, indirect, incidental, special, exemplary,\n * or consequential damages, which may result from the use of the PNG\n * Reference Library, even if advised of the possibility of such damage.\n *\n * Permission is hereby granted to use, copy, modify, and distribute this\n * source code, or portions hereof, for any purpose, without fee, subject\n * to the following restrictions:\n *\n *   1. The origin of this source code must not be misrepresented.\n *\n *   2. Altered versions must be plainly marked as such and must not\n *      be misrepresented as being the original source.\n *\n *   3. This Copyright notice may not be removed or altered from\n *      any source or altered source distribution.\n *\n * The Contributing Authors and Group 42, Inc. specifically permit, without\n * fee, and encourage the use of this source code as a component to\n * supporting the PNG file format in commercial products.  If you use this\n * source code in a product, acknowledgment is not required but would be\n * appreciated.\n */\n\n/*\n * A \"png_get_copyright\" function is available, for convenient use in \"about\"\n * boxes and the like:\n *\n *     printf(\"%s\", png_get_copyright(NULL));\n *\n * Also, the PNG logo (in PNG format, of course) is supplied in the\n * files \"pngbar.png\" and \"pngbar.jpg (88x31) and \"pngnow.png\" (98x31).\n */\n\n/*\n * Libpng is OSI Certified Open Source Software.  OSI Certified is a\n * certification mark of the Open Source Initiative.\n */\n\n/*\n * The contributing authors would like to thank all those who helped\n * with testing, bug fixes, and patience.  This wouldn't have been\n * possible without all of you.\n *\n * Thanks to Frank J. T. Wojcik for helping with the documentation.\n */\n\n/*\n * Y2K compliance in libpng:\n * =========================\n *\n *    April 25, 2013\n *\n *    Since the PNG Development group is an ad-hoc body, we can't make\n *    an official declaration.\n *\n *    This is your unofficial assurance that libpng from version 0.71 and\n *    upward through 1.6.2 are Y2K compliant.  It is my belief that\n *    earlier versions were also Y2K compliant.\n *\n *    Libpng only has two year fields.  One is a 2-byte unsigned integer\n *    that will hold years up to 65535.  The other, which is deprecated,\n *    holds the date in text format, and will hold years up to 9999.\n *\n *    The integer is\n *        \"png_uint_16 year\" in png_time_struct.\n *\n *    The string is\n *        \"char time_buffer[29]\" in png_struct.  This is no longer used\n *    in libpng-1.6.x and will be removed from libpng-1.7.0.\n *\n *    There are seven time-related functions:\n *        png.c: png_convert_to_rfc_1123_buffer() in png.c\n *          (formerly png_convert_to_rfc_1123() prior to libpng-1.5.x and\n *          png_convert_to_rfc_1152() in error prior to libpng-0.98)\n *        png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c\n *        png_convert_from_time_t() in pngwrite.c\n *        png_get_tIME() in pngget.c\n *        png_handle_tIME() in pngrutil.c, called in pngread.c\n *        png_set_tIME() in pngset.c\n *        png_write_tIME() in pngwutil.c, called in pngwrite.c\n *\n *    All handle dates properly in a Y2K environment.  The\n *    png_convert_from_time_t() function calls gmtime() to convert from system\n *    clock time, which returns (year - 1900), which we properly convert to\n *    the full 4-digit year.  There is a possibility that libpng applications\n *    are not passing 4-digit years into the png_convert_to_rfc_1123_buffer()\n *    function, or that they are incorrectly passing only a 2-digit year\n *    instead of \"year - 1900\" into the png_convert_from_struct_tm() function,\n *    but this is not under our control.  The libpng documentation has always\n *    stated that it works with 4-digit years, and the APIs have been\n *    documented as such.\n *\n *    The tIME chunk itself is also Y2K compliant.  It uses a 2-byte unsigned\n *    integer to hold the year, and can hold years as large as 65535.\n *\n *    zlib, upon which libpng depends, is also Y2K compliant.  It contains\n *    no date-related code.\n *\n *       Glenn Randers-Pehrson\n *       libpng maintainer\n *       PNG Development Group\n */\n\n#ifndef PNG_H\n#define PNG_H\n\n/* This is not the place to learn how to use libpng. The file libpng-manual.txt\n * describes how to use libpng, and the file example.c summarizes it\n * with some code on which to build.  This file is useful for looking\n * at the actual function definitions and structure components.\n *\n * If you just need to read a PNG file and don't want to read the documentation\n * skip to the end of this file and read the section entitled 'simplified API'.\n */\n\n/* Version information for png.h - this should match the version in png.c */\n#define PNG_LIBPNG_VER_STRING \"1.6.2\"\n#define PNG_HEADER_VERSION_STRING \\\n     \" libpng version 1.6.2 - April 25, 2013\\n\"\n\n#define PNG_LIBPNG_VER_SONUM   16\n#define PNG_LIBPNG_VER_DLLNUM  16\n\n/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */\n#define PNG_LIBPNG_VER_MAJOR   1\n#define PNG_LIBPNG_VER_MINOR   6\n#define PNG_LIBPNG_VER_RELEASE 2\n\n/* This should match the numeric part of the final component of\n * PNG_LIBPNG_VER_STRING, omitting any leading zero:\n */\n\n#define PNG_LIBPNG_VER_BUILD  0\n\n/* Release Status */\n#define PNG_LIBPNG_BUILD_ALPHA    1\n#define PNG_LIBPNG_BUILD_BETA     2\n#define PNG_LIBPNG_BUILD_RC       3\n#define PNG_LIBPNG_BUILD_STABLE   4\n#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7\n\n/* Release-Specific Flags */\n#define PNG_LIBPNG_BUILD_PATCH    8 /* Can be OR'ed with\n                                       PNG_LIBPNG_BUILD_STABLE only */\n#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_SPECIAL */\n#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with\n                                       PNG_LIBPNG_BUILD_PRIVATE */\n\n#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE\n\n/* Careful here.  At one time, Guy wanted to use 082, but that would be octal.\n * We must not include leading zeros.\n * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only\n * version 1.0.0 was mis-numbered 100 instead of 10000).  From\n * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release\n */\n#define PNG_LIBPNG_VER 10602 /* 1.6.2 */\n\n/* Library configuration: these options cannot be changed after\n * the library has been built.\n */\n#ifndef PNGLCONF_H\n    /* If pnglibconf.h is missing, you can\n     * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h\n     */\n#   include \"pnglibconf.h\"\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n   /* Machine specific configuration. */\n#  include \"pngconf.h\"\n#endif\n\n/*\n * Added at libpng-1.2.8\n *\n * Ref MSDN: Private as priority over Special\n * VS_FF_PRIVATEBUILD File *was not* built using standard release\n * procedures. If this value is given, the StringFileInfo block must\n * contain a PrivateBuild string.\n *\n * VS_FF_SPECIALBUILD File *was* built by the original company using\n * standard release procedures but is a variation of the standard\n * file of the same version number. If this value is given, the\n * StringFileInfo block must contain a SpecialBuild string.\n */\n\n#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */\n#  define PNG_LIBPNG_BUILD_TYPE \\\n       (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE)\n#else\n#  ifdef PNG_LIBPNG_SPECIALBUILD\n#    define PNG_LIBPNG_BUILD_TYPE \\\n         (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL)\n#  else\n#    define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE)\n#  endif\n#endif\n\n#ifndef PNG_VERSION_INFO_ONLY\n\n/* Inhibit C++ name-mangling for libpng functions but not for system calls. */\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\n/* Version information for C files, stored in png.c.  This had better match\n * the version above.\n */\n#define png_libpng_ver png_get_header_ver(NULL)\n\n/* This file is arranged in several sections:\n *\n * 1. Any configuration options that can be specified by for the application\n *    code when it is built.  (Build time configuration is in pnglibconf.h)\n * 2. Type definitions (base types are defined in pngconf.h), structure\n *    definitions.\n * 3. Exported library functions.\n * 4. Simplified API.\n *\n * The library source code has additional files (principally pngpriv.h) that\n * allow configuration of the library.\n */\n/* Section 1: run time configuration\n * See pnglibconf.h for build time configuration\n *\n * Run time configuration allows the application to choose between\n * implementations of certain arithmetic APIs.  The default is set\n * at build time and recorded in pnglibconf.h, but it is safe to\n * override these (and only these) settings.  Note that this won't\n * change what the library does, only application code, and the\n * settings can (and probably should) be made on a per-file basis\n * by setting the #defines before including png.h\n *\n * Use macros to read integers from PNG data or use the exported\n * functions?\n *   PNG_USE_READ_MACROS: use the macros (see below)  Note that\n *     the macros evaluate their argument multiple times.\n *   PNG_NO_USE_READ_MACROS: call the relevant library function.\n *\n * Use the alternative algorithm for compositing alpha samples that\n * does not use division?\n *   PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division'\n *      algorithm.\n *   PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm.\n *\n * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is\n * false?\n *   PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error\n *      APIs to png_warning.\n * Otherwise the calls are mapped to png_error.\n */\n\n/* Section 2: type definitions, including structures and compile time\n * constants.\n * See pngconf.h for base types that vary by machine/system\n */\n\n/* This triggers a compiler error in png.c, if png.c and png.h\n * do not agree upon the version number.\n */\ntypedef char* png_libpng_version_1_6_2;\n\n/* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.\n *\n * png_struct is the cache of information used while reading or writing a single\n * PNG file.  One of these is always required, although the simplified API\n * (below) hides the creation and destruction of it.\n */\ntypedef struct png_struct_def png_struct;\ntypedef const png_struct * png_const_structp;\ntypedef png_struct * png_structp;\ntypedef png_struct * * png_structpp;\n\n/* png_info contains information read from or to be written to a PNG file.  One\n * or more of these must exist while reading or creating a PNG file.  The\n * information is not used by libpng during read but is used to control what\n * gets written when a PNG file is created.  \"png_get_\" function calls read\n * information during read and \"png_set_\" functions calls write information\n * when creating a PNG.\n * been moved into a separate header file that is not accessible to\n * applications.  Read libpng-manual.txt or libpng.3 for more info.\n */\ntypedef struct png_info_def png_info;\ntypedef png_info * png_infop;\ntypedef const png_info * png_const_infop;\ntypedef png_info * * png_infopp;\n\n/* Types with names ending 'p' are pointer types.  The corresponding types with\n * names ending 'rp' are identical pointer types except that the pointer is\n * marked 'restrict', which means that it is the only pointer to the object\n * passed to the function.  Applications should not use the 'restrict' types;\n * it is always valid to pass 'p' to a pointer with a function argument of the\n * corresponding 'rp' type.  Different compilers have different rules with\n * regard to type matching in the presence of 'restrict'.  For backward\n * compatibility libpng callbacks never have 'restrict' in their parameters and,\n * consequentially, writing portable application code is extremely difficult if\n * an attempt is made to use 'restrict'.\n */\ntypedef png_struct * PNG_RESTRICT png_structrp;\ntypedef const png_struct * PNG_RESTRICT png_const_structrp;\ntypedef png_info * PNG_RESTRICT png_inforp;\ntypedef const png_info * PNG_RESTRICT png_const_inforp;\n\n/* Three color definitions.  The order of the red, green, and blue, (and the\n * exact size) is not important, although the size of the fields need to\n * be png_byte or png_uint_16 (as defined below).\n */\ntypedef struct png_color_struct\n{\n   png_byte red;\n   png_byte green;\n   png_byte blue;\n} png_color;\ntypedef png_color * png_colorp;\ntypedef const png_color * png_const_colorp;\ntypedef png_color * * png_colorpp;\n\ntypedef struct png_color_16_struct\n{\n   png_byte index;    /* used for palette files */\n   png_uint_16 red;   /* for use in red green blue files */\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 gray;  /* for use in grayscale files */\n} png_color_16;\ntypedef png_color_16 * png_color_16p;\ntypedef const png_color_16 * png_const_color_16p;\ntypedef png_color_16 * * png_color_16pp;\n\ntypedef struct png_color_8_struct\n{\n   png_byte red;   /* for use in red green blue files */\n   png_byte green;\n   png_byte blue;\n   png_byte gray;  /* for use in grayscale files */\n   png_byte alpha; /* for alpha channel files */\n} png_color_8;\ntypedef png_color_8 * png_color_8p;\ntypedef const png_color_8 * png_const_color_8p;\ntypedef png_color_8 * * png_color_8pp;\n\n/*\n * The following two structures are used for the in-core representation\n * of sPLT chunks.\n */\ntypedef struct png_sPLT_entry_struct\n{\n   png_uint_16 red;\n   png_uint_16 green;\n   png_uint_16 blue;\n   png_uint_16 alpha;\n   png_uint_16 frequency;\n} png_sPLT_entry;\ntypedef png_sPLT_entry * png_sPLT_entryp;\ntypedef const png_sPLT_entry * png_const_sPLT_entryp;\ntypedef png_sPLT_entry * * png_sPLT_entrypp;\n\n/*  When the depth of the sPLT palette is 8 bits, the color and alpha samples\n *  occupy the LSB of their respective members, and the MSB of each member\n *  is zero-filled.  The frequency member always occupies the full 16 bits.\n */\n\ntypedef struct png_sPLT_struct\n{\n   png_charp name;           /* palette name */\n   png_byte depth;           /* depth of palette samples */\n   png_sPLT_entryp entries;  /* palette entries */\n   png_int_32 nentries;      /* number of palette entries */\n} png_sPLT_t;\ntypedef png_sPLT_t * png_sPLT_tp;\ntypedef const png_sPLT_t * png_const_sPLT_tp;\ntypedef png_sPLT_t * * png_sPLT_tpp;\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file,\n * and whether that contents is compressed or not.  The \"key\" field\n * points to a regular zero-terminated C string.  The \"text\" fields can be a\n * regular C string, an empty string, or a NULL pointer.\n * However, the structure returned by png_get_text() will always contain\n * the \"text\" field as a regular zero-terminated C string (possibly\n * empty), never a NULL pointer, so it can be safely used in printf() and\n * other string-handling functions.  Note that the \"itxt_length\", \"lang\", and\n * \"lang_key\" members of the structure only exist when the library is built\n * with iTXt chunk support.  Prior to libpng-1.4.0 the library was built by\n * default without iTXt support. Also note that when iTXt *is* supported,\n * the \"lang\" and \"lang_key\" fields contain NULL pointers when the\n * \"compression\" field contains * PNG_TEXT_COMPRESSION_NONE or\n * PNG_TEXT_COMPRESSION_zTXt. Note that the \"compression value\" is not the\n * same as what appears in the PNG tEXt/zTXt/iTXt chunk's \"compression flag\"\n * which is always 0 or 1, or its \"compression method\" which is always 0.\n */\ntypedef struct png_text_struct\n{\n   int  compression;       /* compression value:\n                             -1: tEXt, none\n                              0: zTXt, deflate\n                              1: iTXt, none\n                              2: iTXt, deflate  */\n   png_charp key;          /* keyword, 1-79 character description of \"text\" */\n   png_charp text;         /* comment, may be an empty string (ie \"\")\n                              or a NULL pointer */\n   png_size_t text_length; /* length of the text string */\n   png_size_t itxt_length; /* length of the itxt string */\n   png_charp lang;         /* language code, 0-79 characters\n                              or a NULL pointer */\n   png_charp lang_key;     /* keyword translated UTF-8 string, 0 or more\n                              chars or a NULL pointer */\n} png_text;\ntypedef png_text * png_textp;\ntypedef const png_text * png_const_textp;\ntypedef png_text * * png_textpp;\n#endif\n\n/* Supported compression types for text in PNG files (tEXt, and zTXt).\n * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */\n#define PNG_TEXT_COMPRESSION_NONE_WR -3\n#define PNG_TEXT_COMPRESSION_zTXt_WR -2\n#define PNG_TEXT_COMPRESSION_NONE    -1\n#define PNG_TEXT_COMPRESSION_zTXt     0\n#define PNG_ITXT_COMPRESSION_NONE     1\n#define PNG_ITXT_COMPRESSION_zTXt     2\n#define PNG_TEXT_COMPRESSION_LAST     3  /* Not a valid value */\n\n/* png_time is a way to hold the time in an machine independent way.\n * Two conversions are provided, both from time_t and struct tm.  There\n * is no portable way to convert to either of these structures, as far\n * as I know.  If you know of a portable way, send it to me.  As a side\n * note - PNG has always been Year 2000 compliant!\n */\ntypedef struct png_time_struct\n{\n   png_uint_16 year; /* full year, as in, 1995 */\n   png_byte month;   /* month of year, 1 - 12 */\n   png_byte day;     /* day of month, 1 - 31 */\n   png_byte hour;    /* hour of day, 0 - 23 */\n   png_byte minute;  /* minute of hour, 0 - 59 */\n   png_byte second;  /* second of minute, 0 - 60 (for leap seconds) */\n} png_time;\ntypedef png_time * png_timep;\ntypedef const png_time * png_const_timep;\ntypedef png_time * * png_timepp;\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n/* png_unknown_chunk is a structure to hold queued chunks for which there is\n * no specific support.  The idea is that we can use this to queue\n * up private chunks for output even though the library doesn't actually\n * know about their semantics.\n *\n * The data in the structure is set by libpng on read and used on write.\n */\ntypedef struct png_unknown_chunk_t\n{\n    png_byte name[5]; /* Textual chunk name with '\\0' terminator */\n    png_byte *data;   /* Data, should not be modified on read! */\n    png_size_t size;\n\n    /* On write 'location' must be set using the flag values listed below.\n     * Notice that on read it is set by libpng however the values stored have\n     * more bits set than are listed below.  Always treat the value as a\n     * bitmask.  On write set only one bit - setting multiple bits may cause the\n     * chunk to be written in multiple places.\n     */\n    png_byte location; /* mode of operation at read time */\n}\npng_unknown_chunk;\n\ntypedef png_unknown_chunk * png_unknown_chunkp;\ntypedef const png_unknown_chunk * png_const_unknown_chunkp;\ntypedef png_unknown_chunk * * png_unknown_chunkpp;\n#endif\n\n/* Flag values for the unknown chunk location byte. */\n#define PNG_HAVE_IHDR  0x01\n#define PNG_HAVE_PLTE  0x02\n#define PNG_AFTER_IDAT 0x08\n\n/* Maximum positive integer used in PNG is (2^31)-1 */\n#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)\n#define PNG_UINT_32_MAX ((png_uint_32)(-1))\n#define PNG_SIZE_MAX ((png_size_t)(-1))\n\n/* These are constants for fixed point values encoded in the\n * PNG specification manner (x100000)\n */\n#define PNG_FP_1    100000\n#define PNG_FP_HALF  50000\n#define PNG_FP_MAX  ((png_fixed_point)0x7fffffffL)\n#define PNG_FP_MIN  (-PNG_FP_MAX)\n\n/* These describe the color_type field in png_info. */\n/* color type masks */\n#define PNG_COLOR_MASK_PALETTE    1\n#define PNG_COLOR_MASK_COLOR      2\n#define PNG_COLOR_MASK_ALPHA      4\n\n/* color types.  Note that not all combinations are legal */\n#define PNG_COLOR_TYPE_GRAY 0\n#define PNG_COLOR_TYPE_PALETTE  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE)\n#define PNG_COLOR_TYPE_RGB        (PNG_COLOR_MASK_COLOR)\n#define PNG_COLOR_TYPE_RGB_ALPHA  (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA)\n#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA)\n/* aliases */\n#define PNG_COLOR_TYPE_RGBA  PNG_COLOR_TYPE_RGB_ALPHA\n#define PNG_COLOR_TYPE_GA  PNG_COLOR_TYPE_GRAY_ALPHA\n\n/* This is for compression type. PNG 1.0-1.2 only define the single type. */\n#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */\n#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE\n\n/* This is for filter type. PNG 1.0-1.2 only define the single type. */\n#define PNG_FILTER_TYPE_BASE      0 /* Single row per-byte filtering */\n#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */\n#define PNG_FILTER_TYPE_DEFAULT   PNG_FILTER_TYPE_BASE\n\n/* These are for the interlacing type.  These values should NOT be changed. */\n#define PNG_INTERLACE_NONE        0 /* Non-interlaced image */\n#define PNG_INTERLACE_ADAM7       1 /* Adam7 interlacing */\n#define PNG_INTERLACE_LAST        2 /* Not a valid value */\n\n/* These are for the oFFs chunk.  These values should NOT be changed. */\n#define PNG_OFFSET_PIXEL          0 /* Offset in pixels */\n#define PNG_OFFSET_MICROMETER     1 /* Offset in micrometers (1/10^6 meter) */\n#define PNG_OFFSET_LAST           2 /* Not a valid value */\n\n/* These are for the pCAL chunk.  These values should NOT be changed. */\n#define PNG_EQUATION_LINEAR       0 /* Linear transformation */\n#define PNG_EQUATION_BASE_E       1 /* Exponential base e transform */\n#define PNG_EQUATION_ARBITRARY    2 /* Arbitrary base exponential transform */\n#define PNG_EQUATION_HYPERBOLIC   3 /* Hyperbolic sine transformation */\n#define PNG_EQUATION_LAST         4 /* Not a valid value */\n\n/* These are for the sCAL chunk.  These values should NOT be changed. */\n#define PNG_SCALE_UNKNOWN         0 /* unknown unit (image scale) */\n#define PNG_SCALE_METER           1 /* meters per pixel */\n#define PNG_SCALE_RADIAN          2 /* radians per pixel */\n#define PNG_SCALE_LAST            3 /* Not a valid value */\n\n/* These are for the pHYs chunk.  These values should NOT be changed. */\n#define PNG_RESOLUTION_UNKNOWN    0 /* pixels/unknown unit (aspect ratio) */\n#define PNG_RESOLUTION_METER      1 /* pixels/meter */\n#define PNG_RESOLUTION_LAST       2 /* Not a valid value */\n\n/* These are for the sRGB chunk.  These values should NOT be changed. */\n#define PNG_sRGB_INTENT_PERCEPTUAL 0\n#define PNG_sRGB_INTENT_RELATIVE   1\n#define PNG_sRGB_INTENT_SATURATION 2\n#define PNG_sRGB_INTENT_ABSOLUTE   3\n#define PNG_sRGB_INTENT_LAST       4 /* Not a valid value */\n\n/* This is for text chunks */\n#define PNG_KEYWORD_MAX_LENGTH     79\n\n/* Maximum number of entries in PLTE/sPLT/tRNS arrays */\n#define PNG_MAX_PALETTE_LENGTH    256\n\n/* These determine if an ancillary chunk's data has been successfully read\n * from the PNG header, or if the application has filled in the corresponding\n * data in the info_struct to be written into the output file.  The values\n * of the PNG_INFO_<chunk> defines should NOT be changed.\n */\n#define PNG_INFO_gAMA 0x0001\n#define PNG_INFO_sBIT 0x0002\n#define PNG_INFO_cHRM 0x0004\n#define PNG_INFO_PLTE 0x0008\n#define PNG_INFO_tRNS 0x0010\n#define PNG_INFO_bKGD 0x0020\n#define PNG_INFO_hIST 0x0040\n#define PNG_INFO_pHYs 0x0080\n#define PNG_INFO_oFFs 0x0100\n#define PNG_INFO_tIME 0x0200\n#define PNG_INFO_pCAL 0x0400\n#define PNG_INFO_sRGB 0x0800   /* GR-P, 0.96a */\n#define PNG_INFO_iCCP 0x1000   /* ESR, 1.0.6 */\n#define PNG_INFO_sPLT 0x2000   /* ESR, 1.0.6 */\n#define PNG_INFO_sCAL 0x4000   /* ESR, 1.0.6 */\n#define PNG_INFO_IDAT 0x8000   /* ESR, 1.0.6 */\n\n/* This is used for the transformation routines, as some of them\n * change these values for the row.  It also should enable using\n * the routines for other purposes.\n */\ntypedef struct png_row_info_struct\n{\n   png_uint_32 width;    /* width of row */\n   png_size_t rowbytes;  /* number of bytes in row */\n   png_byte color_type;  /* color type of row */\n   png_byte bit_depth;   /* bit depth of row */\n   png_byte channels;    /* number of channels (1, 2, 3, or 4) */\n   png_byte pixel_depth; /* bits per pixel (depth * channels) */\n} png_row_info;\n\ntypedef png_row_info * png_row_infop;\ntypedef png_row_info * * png_row_infopp;\n\n/* These are the function types for the I/O functions and for the functions\n * that allow the user to override the default I/O functions with his or her\n * own.  The png_error_ptr type should match that of user-supplied warning\n * and error functions, while the png_rw_ptr type should match that of the\n * user read/write data functions.  Note that the 'write' function must not\n * modify the buffer it is passed. The 'read' function, on the other hand, is\n * expected to return the read data in the buffer.\n */\ntypedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));\ntypedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t));\ntypedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));\ntypedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,\n    int));\ntypedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32,\n    int));\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\ntypedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop));\ntypedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop));\n\n/* The following callback receives png_uint_32 row_number, int pass for the\n * png_bytep data of the row.  When transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\ntypedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep,\n    png_uint_32, int));\n#endif\n\n#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \\\n    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)\ntypedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop,\n    png_bytep));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\ntypedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,\n    png_unknown_chunkp));\n#endif\n#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED\n/* not used anywhere */\n/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n/* This must match the function definition in <setjmp.h>, and the application\n * must include this before png.h to obtain the definition of jmp_buf.  The\n * function is required to be PNG_NORETURN, but this is not checked.  If the\n * function does return the application will crash via an abort() or similar\n * system level call.\n *\n * If you get a warning here while building the library you may need to make\n * changes to ensure that pnglibconf.h records the calling convention used by\n * your compiler.  This may be very difficult - try using a different compiler\n * to build the library!\n */\nPNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);\n#endif\n\n/* Transform masks for the high-level interface */\n#define PNG_TRANSFORM_IDENTITY       0x0000    /* read and write */\n#define PNG_TRANSFORM_STRIP_16       0x0001    /* read only */\n#define PNG_TRANSFORM_STRIP_ALPHA    0x0002    /* read only */\n#define PNG_TRANSFORM_PACKING        0x0004    /* read and write */\n#define PNG_TRANSFORM_PACKSWAP       0x0008    /* read and write */\n#define PNG_TRANSFORM_EXPAND         0x0010    /* read only */\n#define PNG_TRANSFORM_INVERT_MONO    0x0020    /* read and write */\n#define PNG_TRANSFORM_SHIFT          0x0040    /* read and write */\n#define PNG_TRANSFORM_BGR            0x0080    /* read and write */\n#define PNG_TRANSFORM_SWAP_ALPHA     0x0100    /* read and write */\n#define PNG_TRANSFORM_SWAP_ENDIAN    0x0200    /* read and write */\n#define PNG_TRANSFORM_INVERT_ALPHA   0x0400    /* read and write */\n#define PNG_TRANSFORM_STRIP_FILLER   0x0800    /* write only */\n/* Added to libpng-1.2.34 */\n#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER\n#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */\n/* Added to libpng-1.4.0 */\n#define PNG_TRANSFORM_GRAY_TO_RGB   0x2000      /* read only */\n/* Added to libpng-1.5.4 */\n#define PNG_TRANSFORM_EXPAND_16     0x4000      /* read only */\n#define PNG_TRANSFORM_SCALE_16      0x8000      /* read only */\n\n/* Flags for MNG supported features */\n#define PNG_FLAG_MNG_EMPTY_PLTE     0x01\n#define PNG_FLAG_MNG_FILTER_64      0x04\n#define PNG_ALL_MNG_FEATURES        0x05\n\n/* NOTE: prior to 1.5 these functions had no 'API' style declaration,\n * this allowed the zlib default functions to be used on Windows\n * platforms.  In 1.5 the zlib default malloc (which just calls malloc and\n * ignores the first argument) should be completely compatible with the\n * following.\n */\ntypedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,\n    png_alloc_size_t));\ntypedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp));\n\n/* Section 3: exported functions\n * Here are the function definitions most commonly used.  This is not\n * the place to find out how to use libpng.  See libpng-manual.txt for the\n * full explanation, see example.c for the summary.  This just provides\n * a simple one line description of the use of each function.\n *\n * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in\n * pngconf.h and in the *.dfn files in the scripts directory.\n *\n *   PNG_EXPORT(ordinal, type, name, (args));\n *\n *       ordinal:    ordinal that is used while building\n *                   *.def files. The ordinal value is only\n *                   relevant when preprocessing png.h with\n *                   the *.dfn files for building symbol table\n *                   entries, and are removed by pngconf.h.\n *       type:       return type of the function\n *       name:       function name\n *       args:       function arguments, with types\n *\n * When we wish to append attributes to a function prototype we use\n * the PNG_EXPORTA() macro instead.\n *\n *   PNG_EXPORTA(ordinal, type, name, (args), attributes);\n *\n *       ordinal, type, name, and args: same as in PNG_EXPORT().\n *       attributes: function attributes\n */\n\n/* Returns the version number of the library */\nPNG_EXPORT(1, png_uint_32, png_access_version_number, (void));\n\n/* Tell lib we have already handled the first <num_bytes> magic bytes.\n * Handling more than 8 bytes from the beginning of the file is an error.\n */\nPNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));\n\n/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a\n * PNG file.  Returns zero if the supplied bytes match the 8-byte PNG\n * signature, and non-zero otherwise.  Having num_to_check == 0 or\n * start > 7 will always fail (ie return non-zero).\n */\nPNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start,\n    png_size_t num_to_check));\n\n/* Simple signature checking function.  This is the same as calling\n * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).\n */\n#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))\n\n/* Allocate and initialize png_ptr struct for reading, and any other memory. */\nPNG_EXPORTA(4, png_structp, png_create_read_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr,\n    png_error_ptr error_fn, png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\n/* Allocate and initialize png_ptr struct for writing, and any other memory */\nPNG_EXPORTA(5, png_structp, png_create_write_struct,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn),\n    PNG_ALLOCATED);\n\nPNG_EXPORT(6, png_size_t, png_get_compression_buffer_size,\n    (png_const_structrp png_ptr));\n\nPNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,\n    png_size_t size));\n\n/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp\n * match up.\n */\n#ifdef PNG_SETJMP_SUPPORTED\n/* This function returns the jmp_buf built in to *png_ptr.  It must be\n * supplied with an appropriate 'longjmp' function to use on that jmp_buf\n * unless the default error function is overridden in which case NULL is\n * acceptable.  The size of the jmp_buf is checked against the actual size\n * allocated by the library - the call will return NULL on a mismatch\n * indicating an ABI mismatch.\n */\nPNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr,\n    png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));\n#  define png_jmpbuf(png_ptr) \\\n      (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))\n#else\n#  define png_jmpbuf(png_ptr) \\\n      (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)\n#endif\n/* This function should be used by libpng applications in place of\n * longjmp(png_ptr->jmpbuf, val).  If longjmp_fn() has been set, it\n * will use it; otherwise it will call PNG_ABORT().  This function was\n * added in libpng-1.5.0.\n */\nPNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val),\n    PNG_NORETURN);\n\n#ifdef PNG_READ_SUPPORTED\n/* Reset the compression stream */\nPNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED);\n#endif\n\n/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(11, png_structp, png_create_read_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\nPNG_EXPORTA(12, png_structp, png_create_write_struct_2,\n    (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,\n    png_error_ptr warn_fn,\n    png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),\n    PNG_ALLOCATED);\n#endif\n\n/* Write the PNG file signature. */\nPNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));\n\n/* Write a PNG chunk - size, type, (optional) data, CRC. */\nPNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep\n    chunk_name, png_const_bytep data, png_size_t length));\n\n/* Write the start of a PNG chunk - length and chunk name. */\nPNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,\n    png_const_bytep chunk_name, png_uint_32 length));\n\n/* Write the data of a PNG chunk started with png_write_chunk_start(). */\nPNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,\n    png_const_bytep data, png_size_t length));\n\n/* Finish a chunk started with png_write_chunk_start() (includes CRC). */\nPNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));\n\n/* Allocate and initialize the info structure */\nPNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),\n    PNG_ALLOCATED);\n\n/* DEPRECATED: this function allowed init structures to be created using the\n * default allocation method (typically malloc).  Use is deprecated in 1.6.0 and\n * the API will be removed in the future.\n */\nPNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,\n    png_size_t png_info_struct_size), PNG_DEPRECATED);\n\n/* Writes all the PNG information before the image. */\nPNG_EXPORT(20, void, png_write_info_before_PLTE,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(21, void, png_write_info,\n    (png_structrp png_ptr, png_const_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the information before the actual image data. */\nPNG_EXPORT(22, void, png_read_info,\n    (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n#ifdef PNG_TIME_RFC1123_SUPPORTED\n   /* Convert to a US string format: there is no localization support in this\n    * routine.  The original implementation used a 29 character buffer in\n    * png_struct, this will be removed in future versions.\n    */\n#if PNG_LIBPNG_VER < 10700\n/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */\nPNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr,\n    png_const_timep ptime),PNG_DEPRECATED);\n#endif\nPNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29],\n    png_const_timep ptime));\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n/* Convert from a struct tm to png_time */\nPNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,\n    const struct tm * ttime));\n\n/* Convert from time_t to png_time.  Uses gmtime() */\nPNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime));\n#endif /* PNG_CONVERT_tIME_SUPPORTED */\n\n#ifdef PNG_READ_EXPAND_SUPPORTED\n/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */\nPNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr));\nPNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr));\nPNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr));\nPNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_EXPAND_16_SUPPORTED\n/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion\n * of a tRNS chunk if present.\n */\nPNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)\n/* Use blue, green, red order for pixels. */\nPNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED\n/* Expand the grayscale to 24-bit RGB if necessary. */\nPNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED\n/* Reduce RGB to grayscale. */\n#define PNG_ERROR_ACTION_NONE  1\n#define PNG_ERROR_ACTION_WARN  2\n#define PNG_ERROR_ACTION_ERROR 3\n#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/\n\nPNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr,\n    int error_action, double red, double green))\nPNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr,\n    int error_action, png_fixed_point red, png_fixed_point green))\n\nPNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp\n    png_ptr));\n#endif\n\n#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\nPNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,\n    png_colorp palette));\n#endif\n\n#ifdef PNG_READ_ALPHA_MODE_SUPPORTED\n/* How the alpha channel is interpreted - this affects how the color channels of\n * a PNG file are returned when an alpha channel, or tRNS chunk in a palette\n * file, is present.\n *\n * This has no effect on the way pixels are written into a PNG output\n * datastream. The color samples in a PNG datastream are never premultiplied\n * with the alpha samples.\n *\n * The default is to return data according to the PNG specification: the alpha\n * channel is a linear measure of the contribution of the pixel to the\n * corresponding composited pixel.  The gamma encoded color channels must be\n * scaled according to the contribution and to do this it is necessary to undo\n * the encoding, scale the color values, perform the composition and reencode\n * the values.  This is the 'PNG' mode.\n *\n * The alternative is to 'associate' the alpha with the color information by\n * storing color channel values that have been scaled by the alpha.  The\n * advantage is that the color channels can be resampled (the image can be\n * scaled) in this form.  The disadvantage is that normal practice is to store\n * linear, not (gamma) encoded, values and this requires 16-bit channels for\n * still images rather than the 8-bit channels that are just about sufficient if\n * gamma encoding is used.  In addition all non-transparent pixel values,\n * including completely opaque ones, must be gamma encoded to produce the final\n * image.  This is the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' mode (the\n * latter being the two common names for associated alpha color channels.)\n *\n * Since it is not necessary to perform arithmetic on opaque color values so\n * long as they are not to be resampled and are in the final color space it is\n * possible to optimize the handling of alpha by storing the opaque pixels in\n * the PNG format (adjusted for the output color space) while storing partially\n * opaque pixels in the standard, linear, format.  The accuracy required for\n * standard alpha composition is relatively low, because the pixels are\n * isolated, therefore typically the accuracy loss in storing 8-bit linear\n * values is acceptable.  (This is not true if the alpha channel is used to\n * simulate transparency over large areas - use 16 bits or the PNG mode in\n * this case!)  This is the 'OPTIMIZED' mode.  For this mode a pixel is\n * treated as opaque only if the alpha value is equal to the maximum value.\n *\n * The final choice is to gamma encode the alpha channel as well.  This is\n * broken because, in practice, no implementation that uses this choice\n * correctly undoes the encoding before handling alpha composition.  Use this\n * choice only if other serious errors in the software or hardware you use\n * mandate it; the typical serious error is for dark halos to appear around\n * opaque areas of the composited PNG image because of arithmetic overflow.\n *\n * The API function png_set_alpha_mode specifies which of these choices to use\n * with an enumerated 'mode' value and the gamma of the required output:\n */\n#define PNG_ALPHA_PNG           0 /* according to the PNG standard */\n#define PNG_ALPHA_STANDARD      1 /* according to Porter/Duff */\n#define PNG_ALPHA_ASSOCIATED    1 /* as above; this is the normal practice */\n#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */\n#define PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */\n#define PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */\n\nPNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode,\n    double output_gamma))\nPNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,\n    int mode, png_fixed_point output_gamma))\n#endif\n\n#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)\n/* The output_gamma value is a screen gamma in libpng terminology: it expresses\n * how to decode the output values, not how they are encoded.  The values used\n * correspond to the normal numbers used to describe the overall gamma of a\n * computer display system; for example 2.2 for an sRGB conformant system.  The\n * values are scaled by 100000 in the _fixed version of the API (so 220000 for\n * sRGB.)\n *\n * The inverse of the value is always used to provide a default for the PNG file\n * encoding if it has no gAMA chunk and if png_set_gamma() has not been called\n * to override the PNG gamma information.\n *\n * When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode\n * opaque pixels however pixels with lower alpha values are not encoded,\n * regardless of the output gamma setting.\n *\n * When the standard Porter Duff handling is requested with mode 1 the output\n * encoding is set to be linear and the output_gamma value is only relevant\n * as a default for input data that has no gamma information.  The linear output\n * encoding will be overridden if png_set_gamma() is called - the results may be\n * highly unexpected!\n *\n * The following numbers are derived from the sRGB standard and the research\n * behind it.  sRGB is defined to be approximated by a PNG gAMA chunk value of\n * 0.45455 (1/2.2) for PNG.  The value implicitly includes any viewing\n * correction required to take account of any differences in the color\n * environment of the original scene and the intended display environment; the\n * value expresses how to *decode* the image for display, not how the original\n * data was *encoded*.\n *\n * sRGB provides a peg for the PNG standard by defining a viewing environment.\n * sRGB itself, and earlier TV standards, actually use a more complex transform\n * (a linear portion then a gamma 2.4 power law) than PNG can express.  (PNG is\n * limited to simple power laws.)  By saying that an image for direct display on\n * an sRGB conformant system should be stored with a gAMA chunk value of 45455\n * (11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification\n * makes it possible to derive values for other display systems and\n * environments.\n *\n * The Mac value is deduced from the sRGB based on an assumption that the actual\n * extra viewing correction used in early Mac display systems was implemented as\n * a power 1.45 lookup table.\n *\n * Any system where a programmable lookup table is used or where the behavior of\n * the final display device characteristics can be changed requires system\n * specific code to obtain the current characteristic.  However this can be\n * difficult and most PNG gamma correction only requires an approximate value.\n *\n * By default, if png_set_alpha_mode() is not called, libpng assumes that all\n * values are unencoded, linear, values and that the output device also has a\n * linear characteristic.  This is only very rarely correct - it is invariably\n * better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the\n * default if you don't know what the right answer is!\n *\n * The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS\n * 10.6) which used a correction table to implement a somewhat lower gamma on an\n * otherwise sRGB system.\n *\n * Both these values are reserved (not simple gamma values) in order to allow\n * more precise correction internally in the future.\n *\n * NOTE: the following values can be passed to either the fixed or floating\n * point APIs, but the floating point API will also accept floating point\n * values.\n */\n#define PNG_DEFAULT_sRGB -1       /* sRGB gamma and color space */\n#define PNG_GAMMA_MAC_18 -2       /* Old Mac '1.8' gamma and color space */\n#define PNG_GAMMA_sRGB   220000   /* Television standards--matches sRGB gamma */\n#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */\n#endif\n\n/* The following are examples of calls to png_set_alpha_mode to achieve the\n * required overall gamma correction and, where necessary, alpha\n * premultiplication.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n *    This is the default libpng handling of the alpha channel - it is not\n *    pre-multiplied into the color components.  In addition the call states\n *    that the output is for a sRGB system and causes all PNG files without gAMA\n *    chunks to be assumed to be encoded using sRGB.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    In this case the output is assumed to be something like an sRGB conformant\n *    display preceeded by a power-law lookup table of power 1.45.  This is how\n *    early Mac systems behaved.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR);\n *    This is the classic Jim Blinn approach and will work in academic\n *    environments where everything is done by the book.  It has the shortcoming\n *    of assuming that input PNG data with no gamma information is linear - this\n *    is unlikely to be correct unless the PNG files where generated locally.\n *    Most of the time the output precision will be so low as to show\n *    significant banding in dark areas of the image.\n *\n * png_set_expand_16(pp);\n * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB);\n *    This is a somewhat more realistic Jim Blinn inspired approach.  PNG files\n *    are assumed to have the sRGB encoding if not marked with a gamma value and\n *    the output is always 16 bits per component.  This permits accurate scaling\n *    and processing of the data.  If you know that your input PNG files were\n *    generated locally you might need to replace PNG_DEFAULT_sRGB with the\n *    correct value for your system.\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB);\n *    If you just need to composite the PNG image onto an existing background\n *    and if you control the code that does this you can use the optimization\n *    setting.  In this case you just copy completely opaque pixels to the\n *    output.  For pixels that are not completely transparent (you just skip\n *    those) you do the composition math using png_composite or png_composite_16\n *    below then encode the resultant 8-bit or 16-bit values to match the output\n *    encoding.\n *\n * Other cases\n *    If neither the PNG nor the standard linear encoding work for you because\n *    of the software or hardware you use then you have a big problem.  The PNG\n *    case will probably result in halos around the image.  The linear encoding\n *    will probably result in a washed out, too bright, image (it's actually too\n *    contrasty.)  Try the ALPHA_OPTIMIZED mode above - this will probably\n *    substantially reduce the halos.  Alternatively try:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB);\n *    This option will also reduce the halos, but there will be slight dark\n *    halos round the opaque parts of the image where the background is light.\n *    In the OPTIMIZED mode the halos will be light halos where the background\n *    is dark.  Take your pick - the halos are unavoidable unless you can get\n *    your hardware/software fixed!  (The OPTIMIZED approach is slightly\n *    faster.)\n *\n * When the default gamma of PNG files doesn't match the output gamma.\n *    If you have PNG files with no gamma information png_set_alpha_mode allows\n *    you to provide a default gamma, but it also sets the ouput gamma to the\n *    matching value.  If you know your PNG files have a gamma that doesn't\n *    match the output you can take advantage of the fact that\n *    png_set_alpha_mode always sets the output gamma but only sets the PNG\n *    default if it is not already set:\n *\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);\n * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC);\n *    The first call sets both the default and the output gamma values, the\n *    second call overrides the output gamma without changing the default.  This\n *    is easier than achieving the same effect with png_set_gamma.  You must use\n *    PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will\n *    fire if more than one call to png_set_alpha_mode and png_set_background is\n *    made in the same read operation, however multiple calls with PNG_ALPHA_PNG\n *    are ignored.\n */\n\n#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED\nPNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)\nPNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \\\n    defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)\nPNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)\n/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler,\n    int flags));\n/* The values of the PNG_FILLER_ defines should NOT be changed */\n#  define PNG_FILLER_BEFORE 0\n#  define PNG_FILLER_AFTER 1\n/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */\nPNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr,\n    png_uint_32 filler, int flags));\n#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */\n\n#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)\n/* Swap bytes in 16-bit depth files. */\nPNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)\n/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */\nPNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \\\n    defined(PNG_WRITE_PACKSWAP_SUPPORTED)\n/* Swap packing order of pixels in bytes. */\nPNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)\n/* Converts files to legal bit depths. */\nPNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p\n    true_bits));\n#endif\n\n#if defined(PNG_READ_INTERLACING_SUPPORTED) || \\\n    defined(PNG_WRITE_INTERLACING_SUPPORTED)\n/* Have the code handle the interlacing.  Returns the number of passes.\n * MUST be called before png_read_update_info or png_start_read_image,\n * otherwise it will not have the desired effect.  Note that it is still\n * necessary to call png_read_row or png_read_rows png_get_image_height\n * times for each pass.\n*/\nPNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr));\n#endif\n\n#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)\n/* Invert monochrome files */\nPNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n/* Handle alpha and tRNS by replacing with a background color.  Prior to\n * libpng-1.5.4 this API must not be called before the PNG file header has been\n * read.  Doing so will result in unexpected behavior and possible warnings or\n * errors if the PNG file contains a bKGD chunk.\n */\nPNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, double background_gamma))\nPNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr,\n    png_const_color_16p background_color, int background_gamma_code,\n    int need_expand, png_fixed_point background_gamma))\n#endif\n#ifdef PNG_READ_BACKGROUND_SUPPORTED\n#  define PNG_BACKGROUND_GAMMA_UNKNOWN 0\n#  define PNG_BACKGROUND_GAMMA_SCREEN  1\n#  define PNG_BACKGROUND_GAMMA_FILE    2\n#  define PNG_BACKGROUND_GAMMA_UNIQUE  3\n#endif\n\n#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED\n/* Scale a 16-bit depth file down to 8-bit, accurately. */\nPNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */\n/* Strip the second byte of information from a 16-bit depth file. */\nPNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_QUANTIZE_SUPPORTED\n/* Turn on quantizing, and reduce the palette to the number of colors\n * available.\n */\nPNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr,\n    png_colorp palette, int num_palette, int maximum_colors,\n    png_const_uint_16p histogram, int full_quantize));\n#endif\n\n#ifdef PNG_READ_GAMMA_SUPPORTED\n/* The threshold on gamma processing is configurable but hard-wired into the\n * library.  The following is the floating point variant.\n */\n#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001)\n\n/* Handle gamma correction. Screen_gamma=(display_exponent).\n * NOTE: this API simply sets the screen and file gamma values. It will\n * therefore override the value for gamma in a PNG file if it is called after\n * the file header has been read - use with care  - call before reading the PNG\n * file for best results!\n *\n * These routines accept the same gamma values as png_set_alpha_mode (described\n * above).  The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either\n * API (floating point or fixed.)  Notice, however, that the 'file_gamma' value\n * is the inverse of a 'screen gamma' value.\n */\nPNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr,\n    double screen_gamma, double override_file_gamma))\nPNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr,\n    png_fixed_point screen_gamma, png_fixed_point override_file_gamma))\n#endif\n\n#ifdef PNG_WRITE_FLUSH_SUPPORTED\n/* Set how many lines between output flushes - 0 for no flushing */\nPNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows));\n/* Flush the current PNG output buffer */\nPNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr));\n#endif\n\n/* Optional update palette with requested transformations */\nPNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr));\n\n/* Optional call to update the users info structure */\nPNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read one or more rows of image data. */\nPNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row,\n    png_bytepp display_row, png_uint_32 num_rows));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read a row of data. */\nPNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row,\n    png_bytep display_row));\n#endif\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the whole image into memory at once. */\nPNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image));\n#endif\n\n/* Write a row of image data */\nPNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr,\n    png_const_bytep row));\n\n/* Write a few rows of image data: (*row) is not written; however, the type\n * is declared as writeable to maintain compatibility with previous versions\n * of libpng and to allow the 'display_row' array from read_rows to be passed\n * unchanged to write_rows.\n */\nPNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row,\n    png_uint_32 num_rows));\n\n/* Write the image data */\nPNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image));\n\n/* Write the end of the PNG file. */\nPNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr,\n    png_inforp info_ptr));\n\n#ifdef PNG_SEQUENTIAL_READ_SUPPORTED\n/* Read the end of the PNG file. */\nPNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr));\n#endif\n\n/* Free any memory associated with the png_info_struct */\nPNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));\n\n/* Free any memory associated with the png_struct and the png_info_structs */\nPNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,\n    png_infopp info_ptr_ptr));\n\n/* Set the libpng method of handling chunk CRC errors */\nPNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,\n    int ancil_action));\n\n/* Values for png_set_crc_action() say how to handle CRC errors in\n * ancillary and critical chunks, and whether to use the data contained\n * therein.  Note that it is impossible to \"discard\" data in a critical\n * chunk.  For versions prior to 0.90, the action was always error/quit,\n * whereas in version 0.90 and later, the action for CRC errors in ancillary\n * chunks is warn/discard.  These values should NOT be changed.\n *\n *      value                       action:critical     action:ancillary\n */\n#define PNG_CRC_DEFAULT       0  /* error/quit          warn/discard data */\n#define PNG_CRC_ERROR_QUIT    1  /* error/quit          error/quit        */\n#define PNG_CRC_WARN_DISCARD  2  /* (INVALID)           warn/discard data */\n#define PNG_CRC_WARN_USE      3  /* warn/use data       warn/use data     */\n#define PNG_CRC_QUIET_USE     4  /* quiet/use data      quiet/use data    */\n#define PNG_CRC_NO_CHANGE     5  /* use current value   use current value */\n\n/* These functions give the user control over the scan-line filtering in\n * libpng and the compression methods used by zlib.  These functions are\n * mainly useful for testing, as the defaults should work with most users.\n * Those users who are tight on memory or want faster performance at the\n * expense of compression can modify them.  See the compression library\n * header file (zlib.h) for an explination of the compression functions.\n */\n\n/* Set the filtering method(s) used by libpng.  Currently, the only valid\n * value for \"method\" is 0.\n */\nPNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,\n    int filters));\n\n/* Flags for png_set_filter() to say which filters to use.  The flags\n * are chosen so that they don't conflict with real filter types\n * below, in case they are supplied instead of the #defined constants.\n * These values should NOT be changed.\n */\n#define PNG_NO_FILTERS     0x00\n#define PNG_FILTER_NONE    0x08\n#define PNG_FILTER_SUB     0x10\n#define PNG_FILTER_UP      0x20\n#define PNG_FILTER_AVG     0x40\n#define PNG_FILTER_PAETH   0x80\n#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \\\n                         PNG_FILTER_AVG | PNG_FILTER_PAETH)\n\n/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now.\n * These defines should NOT be changed.\n */\n#define PNG_FILTER_VALUE_NONE  0\n#define PNG_FILTER_VALUE_SUB   1\n#define PNG_FILTER_VALUE_UP    2\n#define PNG_FILTER_VALUE_AVG   3\n#define PNG_FILTER_VALUE_PAETH 4\n#define PNG_FILTER_VALUE_LAST  5\n\n#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */\n/* The \"heuristic_method\" is given by one of the PNG_FILTER_HEURISTIC_\n * defines, either the default (minimum-sum-of-absolute-differences), or\n * the experimental method (weighted-minimum-sum-of-absolute-differences).\n *\n * Weights are factors >= 1.0, indicating how important it is to keep the\n * filter type consistent between rows.  Larger numbers mean the current\n * filter is that many times as likely to be the same as the \"num_weights\"\n * previous filters.  This is cumulative for each previous row with a weight.\n * There needs to be \"num_weights\" values in \"filter_weights\", or it can be\n * NULL if the weights aren't being specified.  Weights have no influence on\n * the selection of the first row filter.  Well chosen weights can (in theory)\n * improve the compression for a given image.\n *\n * Costs are factors >= 1.0 indicating the relative decoding costs of a\n * filter type.  Higher costs indicate more decoding expense, and are\n * therefore less likely to be selected over a filter with lower computational\n * costs.  There needs to be a value in \"filter_costs\" for each valid filter\n * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't\n * setting the costs.  Costs try to improve the speed of decompression without\n * unduly increasing the compressed image size.\n *\n * A negative weight or cost indicates the default value is to be used, and\n * values in the range [0.0, 1.0) indicate the value is to remain unchanged.\n * The default values for both weights and costs are currently 1.0, but may\n * change if good general weighting/cost heuristics can be found.  If both\n * the weights and costs are set to 1.0, this degenerates the WEIGHTED method\n * to the UNWEIGHTED method, but with added encoding time/computation.\n */\nPNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr,\n    int heuristic_method, int num_weights, png_const_doublep filter_weights,\n    png_const_doublep filter_costs))\nPNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,\n    (png_structrp png_ptr, int heuristic_method, int num_weights,\n    png_const_fixed_point_p filter_weights,\n    png_const_fixed_point_p filter_costs))\n#endif /*  PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */\n\n/* Heuristic used for row filter selection.  These defines should NOT be\n * changed.\n */\n#define PNG_FILTER_HEURISTIC_DEFAULT    0  /* Currently \"UNWEIGHTED\" */\n#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1  /* Used by libpng < 0.95 */\n#define PNG_FILTER_HEURISTIC_WEIGHTED   2  /* Experimental feature */\n#define PNG_FILTER_HEURISTIC_LAST       3  /* Not a valid value */\n\n#ifdef PNG_WRITE_SUPPORTED\n/* Set the library compression level.  Currently, valid values range from\n * 0 - 9, corresponding directly to the zlib compression levels 0 - 9\n * (0 - no compression, 9 - \"maximal\" compression).  Note that tests have\n * shown that zlib compression levels 3-6 usually perform as well as level 9\n * for PNG images, and do considerably fewer caclulations.  In the future,\n * these values may not correspond directly to the zlib compression levels.\n */\nPNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr,\n    int window_bits));\n\nPNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr,\n    int method));\n#endif\n\n#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n/* Also set zlib parameters for compressing non-IDAT chunks */\nPNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr,\n    int level));\n\nPNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr,\n    int mem_level));\n\nPNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr,\n    int strategy));\n\n/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a\n * smaller value of window_bits if it can do so safely.\n */\nPNG_EXPORT(225, void, png_set_text_compression_window_bits,\n    (png_structrp png_ptr, int window_bits));\n\nPNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,\n    int method));\n#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */\n\n/* These next functions are called for input/output, memory, and error\n * handling.  They are in the file pngrio.c, pngwio.c, and pngerror.c,\n * and call standard C I/O routines such as fread(), fwrite(), and\n * fprintf().  These functions can be made to use other I/O routines\n * at run time for those applications that need to handle I/O in a\n * different manner by calling png_set_???_fn().  See libpng-manual.txt for\n * more information.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n/* Initialize the input/output for the PNG file to the default functions. */\nPNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));\n#endif\n\n/* Replace the (error and abort), and warning functions with user\n * supplied functions.  If no messages are to be printed you must still\n * write and use replacement functions. The replacement error_fn should\n * still do a longjmp to the last setjmp location if you are using this\n * method of error handling.  If error_fn or warning_fn is NULL, the\n * default function will be used.\n */\n\nPNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr,\n    png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));\n\n/* Return the user pointer associated with the error functions */\nPNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr));\n\n/* Replace the default data output functions with a user supplied one(s).\n * If buffered output is not used, then output_flush_fn can be set to NULL.\n * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time\n * output_flush_fn will be ignored (and thus can be NULL).\n * It is probably a mistake to use NULL for output_flush_fn if\n * write_data_fn is not also NULL unless you have built libpng with\n * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's\n * default flush function, which uses the standard *FILE structure, will\n * be used.\n */\nPNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));\n\n/* Replace the default data input function with a user supplied one. */\nPNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr,\n    png_rw_ptr read_data_fn));\n\n/* Return the user pointer associated with the I/O functions */\nPNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr));\n\nPNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr,\n    png_read_status_ptr read_row_fn));\n\nPNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr,\n    png_write_status_ptr write_row_fn));\n\n#ifdef PNG_USER_MEM_SUPPORTED\n/* Replace the default memory allocation functions with user supplied one(s). */\nPNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr,\n    png_malloc_ptr malloc_fn, png_free_ptr free_fn));\n/* Return the user pointer associated with the memory functions */\nPNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr read_user_transform_fn));\n#endif\n\n#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED\nPNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr,\n    png_user_transform_ptr write_user_transform_fn));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED\nPNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr,\n    png_voidp user_transform_ptr, int user_transform_depth,\n    int user_transform_channels));\n/* Return the user pointer associated with the user transform functions */\nPNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,\n    (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED\n/* Return information about the row currently being processed.  Note that these\n * APIs do not fail but will return unexpected results if called outside a user\n * transform callback.  Also note that when transforming an interlaced image the\n * row number is the row number within the sub-image of the interlace pass, so\n * the value will increase to the height of the sub-image (not the full image)\n * then reset to 0 for the next pass.\n *\n * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to\n * find the output pixel (x,y) given an interlaced sub-image pixel\n * (row,col,pass).  (See below for these macros.)\n */\nPNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp));\nPNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));\n#endif\n\n#ifdef PNG_READ_USER_CHUNKS_SUPPORTED\n/* This callback is called only for *unknown* chunks.  If\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known\n * chunks to be treated as unknown, however in this case the callback must do\n * any processing required by the chunk (e.g. by calling the appropriate\n * png_set_ APIs.)\n *\n * There is no write support - on write, by default, all the chunks in the\n * 'unknown' list are written in the specified position.\n *\n * The integer return from the callback function is interpreted thus:\n *\n * negative: An error occured, png_chunk_error will be called.\n *     zero: The chunk was not handled, the chunk will be saved. A critical\n *           chunk will cause an error at this point unless it is to be saved.\n * positive: The chunk was handled, libpng will ignore/discard it.\n *\n * See \"INTERACTION WTIH USER CHUNK CALLBACKS\" below for important notes about\n * how this behavior will change in libpng 1.7\n */\nPNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,\n    png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));\n#endif\n\n#ifdef PNG_USER_CHUNKS_SUPPORTED\nPNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr));\n#endif\n\n#ifdef PNG_PROGRESSIVE_READ_SUPPORTED\n/* Sets the function callbacks for the push reader, and a pointer to a\n * user-defined structure available to the callback functions.\n */\nPNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr,\n    png_voidp progressive_ptr, png_progressive_info_ptr info_fn,\n    png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));\n\n/* Returns the user pointer associated with the push read functions */\nPNG_EXPORT(91, png_voidp, png_get_progressive_ptr,\n    (png_const_structrp png_ptr));\n\n/* Function to be called when data becomes available */\nPNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,\n    png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size));\n\n/* A function which may be called *only* within png_process_data to stop the\n * processing of any more data.  The function returns the number of bytes\n * remaining, excluding any that libpng has cached internally.  A subsequent\n * call to png_process_data must supply these bytes again.  If the argument\n * 'save' is set to true the routine will first save all the pending data and\n * will always return 0.\n */\nPNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save));\n\n/* A function which may be called *only* outside (after) a call to\n * png_process_data.  It returns the number of bytes of data to skip in the\n * input.  Normally it will return 0, but if it returns a non-zero value the\n * application must skip than number of bytes of input data and pass the\n * following data to the next call to png_process_data.\n */\nPNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));\n\n#ifdef PNG_READ_INTERLACING_SUPPORTED\n/* Function that combines rows.  'new_row' is a flag that should come from\n * the callback and be non-NULL if anything needs to be done; the library\n * stores its own version of the new data internally and ignores the passed\n * in value.\n */\nPNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr,\n    png_bytep old_row, png_const_bytep new_row));\n#endif /* PNG_READ_INTERLACING_SUPPORTED */\n#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */\n\nPNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n/* Added at libpng version 1.4.0 */\nPNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Added at libpng version 1.2.4 */\nPNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED);\n\n/* Frees a pointer allocated by png_malloc() */\nPNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));\n\n/* Free data that was allocated internally */\nPNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 free_me, int num));\n\n/* Reassign responsibility for freeing existing data, whether allocated\n * by libpng or by the application; this works on the png_info structure passed\n * in, it does not change the state for other png_info structures.\n *\n * It is unlikely that this function works correctly as of 1.6.0 and using it\n * may result either in memory leaks or double free of allocated data.\n */\nPNG_EXPORTA(99, void, png_data_freer, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int freer, png_uint_32 mask), PNG_DEPRECATED);\n\n/* Assignments for png_data_freer */\n#define PNG_DESTROY_WILL_FREE_DATA 1\n#define PNG_SET_WILL_FREE_DATA 1\n#define PNG_USER_WILL_FREE_DATA 2\n/* Flags for png_ptr->free_me and info_ptr->free_me */\n#define PNG_FREE_HIST 0x0008\n#define PNG_FREE_ICCP 0x0010\n#define PNG_FREE_SPLT 0x0020\n#define PNG_FREE_ROWS 0x0040\n#define PNG_FREE_PCAL 0x0080\n#define PNG_FREE_SCAL 0x0100\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#  define PNG_FREE_UNKN 0x0200\n#endif\n/*      PNG_FREE_LIST 0x0400    removed in 1.6.0 because it is ignored */\n#define PNG_FREE_PLTE 0x1000\n#define PNG_FREE_TRNS 0x2000\n#define PNG_FREE_TEXT 0x4000\n#define PNG_FREE_ALL  0x7fff\n#define PNG_FREE_MUL  0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */\n\n#ifdef PNG_USER_MEM_SUPPORTED\nPNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr,\n    png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED);\nPNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr,\n    png_voidp ptr), PNG_DEPRECATED);\n#endif\n\n#ifdef PNG_ERROR_TEXT_SUPPORTED\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n/* The same, but the chunk name is prepended to the error string. */\nPNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,\n    png_const_charp error_message), PNG_NORETURN);\n\n#else\n/* Fatal error in PNG image of libpng - can't continue */\nPNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);\n#endif\n\n#ifdef PNG_WARNINGS_SUPPORTED\n/* Non-fatal error in libpng.  Can continue, but may have a problem. */\nPNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n/* Non-fatal error in libpng, chunk name is prepended to message. */\nPNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\n#ifdef PNG_BENIGN_ERRORS_SUPPORTED\n/* Benign error in libpng.  Can continue, but may have a problem.\n * User can choose whether to handle as a fatal error or as a warning. */\nPNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n\n#ifdef PNG_READ_SUPPORTED\n/* Same, chunk name is prepended to message (only during read) */\nPNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr,\n    png_const_charp warning_message));\n#endif\n\nPNG_EXPORT(109, void, png_set_benign_errors,\n    (png_structrp png_ptr, int allowed));\n#else\n#  ifdef PNG_ALLOW_BENIGN_ERRORS\n#    define png_benign_error png_warning\n#    define png_chunk_benign_error png_chunk_warning\n#  else\n#    define png_benign_error png_error\n#    define png_chunk_benign_error png_chunk_error\n#  endif\n#endif\n\n/* The png_set_<chunk> functions are for storing values in the png_info_struct.\n * Similarly, the png_get_<chunk> calls are used to read values from the\n * png_info_struct, either storing the parameters in the passed variables, or\n * setting pointers into the png_info_struct where the data is stored.  The\n * png_get_<chunk> functions return a non-zero value if the data was available\n * in info_ptr, or return zero and do not change any of the parameters if the\n * data was not available.\n *\n * These functions should be used instead of directly accessing png_info\n * to avoid problems with future changes in the size and internal layout of\n * png_info_struct.\n */\n/* Returns \"flag\" if chunk data is valid in info_ptr. */\nPNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 flag));\n\n/* Returns number of bytes needed to hold a transformed row. */\nPNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* Returns row_pointers, which is an array of pointers to scanlines that was\n * returned from png_read_png().\n */\nPNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Set row_pointers, which is an array of pointers to scanlines for use\n * by png_write_png().\n */\nPNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytepp row_pointers));\n#endif\n\n/* Returns number of color channels in image. */\nPNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n#ifdef PNG_EASY_ACCESS_SUPPORTED\n/* Returns image width in pixels. */\nPNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image height in pixels. */\nPNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image bit_depth. */\nPNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image color_type. */\nPNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image filter_type. */\nPNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image interlace_type. */\nPNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image compression_type. */\nPNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n\n/* Returns image resolution in pixels per meter, from pHYs chunk data. */\nPNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n/* Returns pixel aspect ratio, computed from pHYs chunk data.  */\nPNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\nPNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n\n/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */\nPNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(128, png_int_32, png_get_x_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\nPNG_EXPORT(129, png_int_32, png_get_y_offset_microns,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\n#endif /* PNG_EASY_ACCESS_SUPPORTED */\n\n#ifdef PNG_READ_SUPPORTED\n/* Returns pointer to signature string read from PNG header */\nPNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_16p *background));\n#endif\n\n#ifdef PNG_bKGD_SUPPORTED\nPNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_16p background));\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x,\n    double *red_y, double *green_x, double *green_y, double *blue_x,\n    double *blue_y))\nPNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z,\n    double *green_X, double *green_Y, double *green_Z, double *blue_X,\n    double *blue_Y, double *blue_Z))\nPNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_white_x, png_fixed_point *int_white_y,\n    png_fixed_point *int_red_x, png_fixed_point *int_red_y,\n    png_fixed_point *int_green_x, png_fixed_point *int_green_y,\n    png_fixed_point *int_blue_x, png_fixed_point *int_blue_y))\nPNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_red_X, png_fixed_point *int_red_Y,\n    png_fixed_point *int_red_Z, png_fixed_point *int_green_X,\n    png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,\n    png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,\n    png_fixed_point *int_blue_Z))\n#endif\n\n#ifdef PNG_cHRM_SUPPORTED\nPNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr,\n    double white_x, double white_y, double red_x, double red_y, double green_x,\n    double green_y, double blue_x, double blue_y))\nPNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double red_X, double red_Y, double red_Z,\n    double green_X, double green_Y, double green_Z, double blue_X,\n    double blue_Y, double blue_Z))\nPNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_white_x,\n    png_fixed_point int_white_y, png_fixed_point int_red_x,\n    png_fixed_point int_red_y, png_fixed_point int_green_x,\n    png_fixed_point int_green_y, png_fixed_point int_blue_x,\n    png_fixed_point int_blue_y))\nPNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,\n    png_fixed_point int_red_Z, png_fixed_point int_green_X,\n    png_fixed_point int_green_Y, png_fixed_point int_green_Z,\n    png_fixed_point int_blue_X, png_fixed_point int_blue_Y,\n    png_fixed_point int_blue_Z))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, double *file_gamma))\nPNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr,\n    png_fixed_point *int_file_gamma))\n#endif\n\n#ifdef PNG_gAMA_SUPPORTED\nPNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr,\n    png_inforp info_ptr, double file_gamma))\nPNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_fixed_point int_file_gamma))\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_16p *hist));\n#endif\n\n#ifdef PNG_hIST_SUPPORTED\nPNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_uint_16p hist));\n#endif\n\nPNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height,\n    int *bit_depth, int *color_type, int *interlace_method,\n    int *compression_method, int *filter_method));\n\nPNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,\n    int color_type, int interlace_method, int compression_method,\n    int filter_method));\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr,\n   png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,\n   int *unit_type));\n#endif\n\n#ifdef PNG_oFFs_SUPPORTED\nPNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y,\n    int unit_type));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charp *purpose, png_int_32 *X0,\n    png_int_32 *X1, int *type, int *nparams, png_charp *units,\n    png_charpp *params));\n#endif\n\n#ifdef PNG_pCAL_SUPPORTED\nPNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1,\n    int type, int nparams, png_const_charp units, png_charpp params));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#endif\n\n#ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));\n#endif\n\nPNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr,\n   png_inforp info_ptr, png_colorp *palette, int *num_palette));\n\nPNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_colorp palette, int num_palette));\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_color_8p *sig_bit));\n#endif\n\n#ifdef PNG_sBIT_SUPPORTED\nPNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_color_8p sig_bit));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *file_srgb_intent));\n#endif\n\n#ifdef PNG_sRGB_SUPPORTED\nPNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\nPNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int srgb_intent));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_charpp name, int *compression_type,\n    png_bytepp profile, png_uint_32 *proflen));\n#endif\n\n#ifdef PNG_iCCP_SUPPORTED\nPNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_charp name, int compression_type,\n    png_const_bytep profile, png_uint_32 proflen));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_sPLT_tpp entries));\n#endif\n\n#ifdef PNG_sPLT_SUPPORTED\nPNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_sPLT_tp entries, int nentries));\n#endif\n\n#ifdef PNG_TEXT_SUPPORTED\n/* png_get_text also returns the number of text chunks in *num_text */\nPNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_textp *text_ptr, int *num_text));\n#endif\n\n/* Note while png_set_text() will accept a structure whose text,\n * language, and  translated keywords are NULL pointers, the structure\n * returned by png_get_text will always contain regular\n * zero-terminated C strings.  They might be empty strings but\n * they will never be NULL pointers.\n */\n\n#ifdef PNG_TEXT_SUPPORTED\nPNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_textp text_ptr, int num_text));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_timep *mod_time));\n#endif\n\n#ifdef PNG_tIME_SUPPORTED\nPNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_timep mod_time));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans,\n    png_color_16p *trans_color));\n#endif\n\n#ifdef PNG_tRNS_SUPPORTED\nPNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr,\n    png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans,\n    png_const_color_16p trans_color));\n#endif\n\n#ifdef PNG_sCAL_SUPPORTED\nPNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, int *unit, double *width, double *height))\n#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \\\n   defined(PNG_FLOATING_POINT_SUPPORTED)\n/* NOTE: this API is currently implemented using floating point arithmetic,\n * consequently it can only be used on systems with floating point support.\n * In any case the range of values supported by png_fixed_point is small and it\n * is highly recommended that png_get_sCAL_s be used instead.\n */\nPNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_fixed_point *width, png_fixed_point *height))\n#endif\nPNG_EXPORT(169, png_uint_32, png_get_sCAL_s,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,\n    png_charpp swidth, png_charpp sheight));\n\nPNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit, double width, double height))\nPNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr,\n   png_inforp info_ptr, int unit, png_fixed_point width,\n   png_fixed_point height))\nPNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int unit,\n    png_const_charp swidth, png_const_charp sheight));\n#endif /* PNG_sCAL_SUPPORTED */\n\n#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n/* Provide the default handling for all unknown chunks or, optionally, for\n * specific unknown chunks.\n *\n * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was\n * ignored and the default was used, the per-chunk setting only had an effect on\n * write.  If you wish to have chunk-specific handling on read in code that must\n * work on earlier versions you must use a user chunk callback to specify the\n * desired handling (keep or discard.)\n *\n * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below.  The\n * parameter is interpreted as follows:\n *\n * READ:\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Known chunks: do normal libpng processing, do not keep the chunk (but\n *          see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED)\n *       Unknown chunks: for a specific chunk use the global default, when used\n *          as the default discard the chunk data.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Discard the chunk data.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Keep the chunk data if the chunk is not critical else raise a chunk\n *       error.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Keep the chunk data.\n *\n * If the chunk data is saved it can be retrieved using png_get_unknown_chunks,\n * below.  Notice that specifying \"AS_DEFAULT\" as a global default is equivalent\n * to specifying \"NEVER\", however when \"AS_DEFAULT\" is used for specific chunks\n * it simply resets the behavior to the libpng default.\n *\n * INTERACTION WTIH USER CHUNK CALLBACKS:\n * The per-chunk handling is always used when there is a png_user_chunk_ptr\n * callback and the callback returns 0; the chunk is then always stored *unless*\n * it is critical and the per-chunk setting is other than ALWAYS.  Notice that\n * the global default is *not* used in this case.  (In effect the per-chunk\n * value is incremented to at least IF_SAFE.)\n *\n * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and\n * per-chunk defaults will be honored.  If you want to preserve the current\n * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE\n * as the default - if you don't do this libpng 1.6 will issue a warning.\n *\n * If you want unhandled unknown chunks to be discarded in libpng 1.6 and\n * earlier simply return '1' (handled).\n *\n * PNG_HANDLE_AS_UNKNOWN_SUPPORTED:\n *    If this is *not* set known chunks will always be handled by libpng and\n *    will never be stored in the unknown chunk list.  Known chunks listed to\n *    png_set_keep_unknown_chunks will have no effect.  If it is set then known\n *    chunks listed with a keep other than AS_DEFAULT will *never* be processed\n *    by libpng, in addition critical chunks must either be processed by the\n *    callback or saved.\n *\n *    The IHDR and IEND chunks must not be listed.  Because this turns off the\n *    default handling for chunks that would otherwise be recognized the\n *    behavior of libpng transformations may well become incorrect!\n *\n * WRITE:\n *    When writing chunks the options only apply to the chunks specified by\n *    png_set_unknown_chunks (below), libpng will *always* write known chunks\n *    required by png_set_ calls and will always write the core critical chunks\n *    (as required for PLTE).\n *\n *    Each chunk in the png_set_unknown_chunks list is looked up in the\n *    png_set_keep_unknown_chunks list to find the keep setting, this is then\n *    interpreted as follows:\n *\n *    PNG_HANDLE_CHUNK_AS_DEFAULT:\n *       Write safe-to-copy chunks and write other chunks if the global\n *       default is set to _ALWAYS, otherwise don't write this chunk.\n *    PNG_HANDLE_CHUNK_NEVER:\n *       Do not write the chunk.\n *    PNG_HANDLE_CHUNK_IF_SAFE:\n *       Write the chunk if it is safe-to-copy, otherwise do not write it.\n *    PNG_HANDLE_CHUNK_ALWAYS:\n *       Write the chunk.\n *\n * Note that the default behavior is effectively the opposite of the read case -\n * in read unknown chunks are not stored by default, in write they are written\n * by default.  Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different\n * - on write the safe-to-copy bit is checked, on read the critical bit is\n * checked and on read if the chunk is critical an error will be raised.\n *\n * num_chunks:\n * ===========\n *    If num_chunks is positive, then the \"keep\" parameter specifies the manner\n *    for handling only those chunks appearing in the chunk_list array,\n *    otherwise the chunk list array is ignored.\n *\n *    If num_chunks is 0 the \"keep\" parameter specifies the default behavior for\n *    unknown chunks, as described above.\n *\n *    If num_chunks is negative, then the \"keep\" parameter specifies the manner\n *    for handling all unknown chunks plus all chunks recognized by libpng\n *    except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to\n *    be processed by libpng.\n */\nPNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,\n    int keep, png_const_bytep chunk_list, int num_chunks));\n\n/* The \"keep\" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned;\n * the result is therefore true (non-zero) if special handling is required,\n * false for the default handling.\n */\nPNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr,\n    png_const_bytep chunk_name));\n#endif\n\n#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\nPNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_const_unknown_chunkp unknowns,\n    int num_unknowns));\n   /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added\n    * unknowns to the location currently stored in the png_struct.  This is\n    * invariably the wrong value on write.  To fix this call the following API\n    * for each chunk in the list with the correct location.  If you know your\n    * code won't be compiled on earlier versions you can rely on\n    * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing\n    * the correct thing.\n    */\n\nPNG_EXPORT(175, void, png_set_unknown_chunk_location,\n    (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));\n\nPNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,\n    png_inforp info_ptr, png_unknown_chunkpp entries));\n#endif\n\n/* Png_free_data() will turn off the \"valid\" flag for anything it frees.\n * If you need to turn it off for a chunk that your application has freed,\n * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);\n */\nPNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,\n    png_inforp info_ptr, int mask));\n\n#ifdef PNG_INFO_IMAGE_SUPPORTED\n/* The \"params\" pointer is currently not used and is for future expansion. */\nPNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\nPNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr,\n    int transforms, png_voidp params));\n#endif\n\nPNG_EXPORT(180, png_const_charp, png_get_copyright,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(181, png_const_charp, png_get_header_ver,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(182, png_const_charp, png_get_header_version,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(183, png_const_charp, png_get_libpng_ver,\n    (png_const_structrp png_ptr));\n\n#ifdef PNG_MNG_FEATURES_SUPPORTED\nPNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr,\n    png_uint_32 mng_features_permitted));\n#endif\n\n/* For use in png_set_keep_unknown, added to version 1.2.6 */\n#define PNG_HANDLE_CHUNK_AS_DEFAULT   0\n#define PNG_HANDLE_CHUNK_NEVER        1\n#define PNG_HANDLE_CHUNK_IF_SAFE      2\n#define PNG_HANDLE_CHUNK_ALWAYS       3\n#define PNG_HANDLE_CHUNK_LAST         4\n\n/* Strip the prepended error numbers (\"#nnn \") from error and warning\n * messages before passing them to the error or warning handler.\n */\n#ifdef PNG_ERROR_NUMBERS_SUPPORTED\nPNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr,\n    png_uint_32 strip_mode));\n#endif\n\n/* Added in libpng-1.2.6 */\n#ifdef PNG_SET_USER_LIMITS_SUPPORTED\nPNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr,\n    png_uint_32 user_width_max, png_uint_32 user_height_max));\nPNG_EXPORT(187, png_uint_32, png_get_user_width_max,\n    (png_const_structrp png_ptr));\nPNG_EXPORT(188, png_uint_32, png_get_user_height_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.0 */\nPNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr,\n    png_uint_32 user_chunk_cache_max));\nPNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,\n    (png_const_structrp png_ptr));\n/* Added in libpng-1.4.1 */\nPNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr,\n    png_alloc_size_t user_chunk_cache_max));\nPNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,\n    (png_const_structrp png_ptr));\n#endif\n\n#if defined(PNG_INCH_CONVERSIONS_SUPPORTED)\nPNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr));\n\nPNG_FP_EXPORT(196, float, png_get_x_offset_inches,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\nPNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr))\n#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */\nPNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,\n    (png_const_structrp png_ptr, png_const_inforp info_ptr))\n#endif\n\n#  ifdef PNG_pHYs_SUPPORTED\nPNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr,\n    png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,\n    int *unit_type));\n#  endif /* PNG_pHYs_SUPPORTED */\n#endif  /* PNG_INCH_CONVERSIONS_SUPPORTED */\n\n/* Added in libpng-1.4.0 */\n#ifdef PNG_IO_STATE_SUPPORTED\nPNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr));\n\n/* Removed from libpng 1.6; use png_get_io_chunk_type. */\nPNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr),\n    PNG_DEPRECATED)\n\nPNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,\n    (png_const_structrp png_ptr));\n\n/* The flags returned by png_get_io_state() are the following: */\n#  define PNG_IO_NONE        0x0000   /* no I/O at this moment */\n#  define PNG_IO_READING     0x0001   /* currently reading */\n#  define PNG_IO_WRITING     0x0002   /* currently writing */\n#  define PNG_IO_SIGNATURE   0x0010   /* currently at the file signature */\n#  define PNG_IO_CHUNK_HDR   0x0020   /* currently at the chunk header */\n#  define PNG_IO_CHUNK_DATA  0x0040   /* currently at the chunk data */\n#  define PNG_IO_CHUNK_CRC   0x0080   /* currently at the chunk crc */\n#  define PNG_IO_MASK_OP     0x000f   /* current operation: reading/writing */\n#  define PNG_IO_MASK_LOC    0x00f0   /* current location: sig/hdr/data/crc */\n#endif /* ?PNG_IO_STATE_SUPPORTED */\n\n/* Interlace support.  The following macros are always defined so that if\n * libpng interlace handling is turned off the macros may be used to handle\n * interlaced images within the application.\n */\n#define PNG_INTERLACE_ADAM7_PASSES 7\n\n/* Two macros to return the first row and first column of the original,\n * full, image which appears in a given pass.  'pass' is in the range 0\n * to 6 and the result is in the range 0 to 7.\n */\n#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7)\n#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7)\n\n/* A macro to return the offset between pixels in the output row for a pair of\n * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that\n * follows.  Note that ROW_OFFSET is the offset from one row to the next whereas\n * COL_OFFSET is from one column to the next, within a row.\n */\n#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8)\n#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1))\n\n/* Two macros to help evaluate the number of rows or columns in each\n * pass.  This is expressed as a shift - effectively log2 of the number or\n * rows or columns in each 8x8 tile of the original image.\n */\n#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3)\n#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3)\n\n/* Hence two macros to determine the number of rows or columns in a given\n * pass of an image given its height or width.  In fact these macros may\n * return non-zero even though the sub-image is empty, because the other\n * dimension may be empty for a small image.\n */\n#define PNG_PASS_ROWS(height, pass) (((height)+(((1<<PNG_PASS_ROW_SHIFT(pass))\\\n   -1)-PNG_PASS_START_ROW(pass)))>>PNG_PASS_ROW_SHIFT(pass))\n#define PNG_PASS_COLS(width, pass) (((width)+(((1<<PNG_PASS_COL_SHIFT(pass))\\\n   -1)-PNG_PASS_START_COL(pass)))>>PNG_PASS_COL_SHIFT(pass))\n\n/* For the reader row callbacks (both progressive and sequential) it is\n * necessary to find the row in the output image given a row in an interlaced\n * image, so two more macros:\n */\n#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \\\n   (((y_in)<<PNG_PASS_ROW_SHIFT(pass))+PNG_PASS_START_ROW(pass))\n#define PNG_COL_FROM_PASS_COL(x_in, pass) \\\n   (((x_in)<<PNG_PASS_COL_SHIFT(pass))+PNG_PASS_START_COL(pass))\n\n/* Two macros which return a boolean (0 or 1) saying whether the given row\n * or column is in a particular pass.  These use a common utility macro that\n * returns a mask for a given pass - the offset 'off' selects the row or\n * column version.  The mask has the appropriate bit set for each column in\n * the tile.\n */\n#define PNG_PASS_MASK(pass,off) ( \\\n   ((0x110145AF>>(((7-(off))-(pass))<<2)) & 0xF) | \\\n   ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0))\n\n#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \\\n   ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1)\n#define PNG_COL_IN_INTERLACE_PASS(x, pass) \\\n   ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1)\n\n#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED\n/* With these routines we avoid an integer divide, which will be slower on\n * most machines.  However, it does take more operations than the corresponding\n * divide method, so it may be slower on a few RISC systems.  There are two\n * shifts (by 8 or 16 bits) and an addition, versus a single integer divide.\n *\n * Note that the rounding factors are NOT supposed to be the same!  128 and\n * 32768 are correct for the NODIV code; 127 and 32767 are correct for the\n * standard method.\n *\n * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ]\n */\n\n /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */\n\n#  define png_composite(composite, fg, alpha, bg)         \\\n     { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \\\n           * (png_uint_16)(alpha)                         \\\n           + (png_uint_16)(bg)*(png_uint_16)(255          \\\n           - (png_uint_16)(alpha)) + 128);                \\\n       (composite) = (png_byte)((temp + (temp >> 8)) >> 8); }\n\n#  define png_composite_16(composite, fg, alpha, bg)       \\\n     { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg)  \\\n           * (png_uint_32)(alpha)                          \\\n           + (png_uint_32)(bg)*(65535                      \\\n           - (png_uint_32)(alpha)) + 32768);               \\\n       (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }\n\n#else  /* Standard method using integer division */\n\n#  define png_composite(composite, fg, alpha, bg)                          \\\n     (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) +  \\\n     (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) +       \\\n     127) / 255)\n\n#  define png_composite_16(composite, fg, alpha, bg)                         \\\n     (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \\\n     (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) +         \\\n     32767) / 65535)\n#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */\n\n#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));\nPNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));\nPNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));\n#endif\n\nPNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr,\n    png_const_bytep buf));\n/* No png_get_int_16 -- may be added if there's a real need for it. */\n\n/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i));\n#endif\n#ifdef PNG_SAVE_INT_32_SUPPORTED\nPNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i));\n#endif\n\n/* Place a 16-bit number into a buffer in PNG byte order.\n * The parameter is declared unsigned int, not png_uint_16,\n * just to avoid potential problems on pre-ANSI C compilers.\n */\n#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED\nPNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));\n/* No png_save_int_16 -- may be added if there's a real need for it. */\n#endif\n\n#ifdef PNG_USE_READ_MACROS\n/* Inline macros to do direct reads of bytes from the input buffer.\n * The png_get_int_32() routine assumes we are using two's complement\n * format for negative values, which is almost certainly true.\n */\n#  define PNG_get_uint_32(buf) \\\n     (((png_uint_32)(*(buf)) << 24) + \\\n      ((png_uint_32)(*((buf) + 1)) << 16) + \\\n      ((png_uint_32)(*((buf) + 2)) << 8) + \\\n      ((png_uint_32)(*((buf) + 3))))\n\n   /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the\n    * function) incorrectly returned a value of type png_uint_32.\n    */\n#  define PNG_get_uint_16(buf) \\\n     ((png_uint_16) \\\n      (((unsigned int)(*(buf)) << 8) + \\\n       ((unsigned int)(*((buf) + 1)))))\n\n#  define PNG_get_int_32(buf) \\\n     ((png_int_32)((*(buf) & 0x80) \\\n      ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \\\n      : (png_int_32)png_get_uint_32(buf)))\n\n   /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h,\n    * but defining a macro name prefixed with PNG_PREFIX.\n    */\n#  ifndef PNG_PREFIX\n#     define png_get_uint_32(buf) PNG_get_uint_32(buf)\n#     define png_get_uint_16(buf) PNG_get_uint_16(buf)\n#     define png_get_int_32(buf)  PNG_get_int_32(buf)\n#  endif\n#else\n#  ifdef PNG_PREFIX\n      /* No macros; revert to the (redefined) function */\n#     define PNG_get_uint_32 (png_get_uint_32)\n#     define PNG_get_uint_16 (png_get_uint_16)\n#     define PNG_get_int_32  (png_get_int_32)\n#  endif\n#endif\n\n/*******************************************************************************\n *  SIMPLIFIED API\n *******************************************************************************\n *\n * Please read the documentation in libpng-manual.txt (TODO: write said\n * documentation) if you don't understand what follows.\n *\n * The simplified API hides the details of both libpng and the PNG file format\n * itself.  It allows PNG files to be read into a very limited number of\n * in-memory bitmap formats or to be written from the same formats.  If these\n * formats do not accomodate your needs then you can, and should, use the more\n * sophisticated APIs above - these support a wide variety of in-memory formats\n * and a wide variety of sophisticated transformations to those formats as well\n * as a wide variety of APIs to manipulate ancillary information.\n *\n * To read a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure (see below) on the stack and set the\n *    version field to PNG_IMAGE_VERSION.\n * 2) Call the appropriate png_image_begin_read... function.\n * 3) Set the png_image 'format' member to the required sample format.\n * 4) Allocate a buffer for the image and, if required, the color-map.\n * 5) Call png_image_finish_read to read the image and, if required, the\n *    color-map into your buffers.\n *\n * There are no restrictions on the format of the PNG input itself; all valid\n * color types, bit depths, and interlace methods are acceptable, and the\n * input image is transformed as necessary to the requested in-memory format\n * during the png_image_finish_read() step.  The only caveat is that if you\n * request a color-mapped image from a PNG that is full-color or makes\n * complex use of an alpha channel the transformation is extremely lossy and the\n * result may look terrible.\n *\n * To write a PNG file using the simplified API:\n *\n * 1) Declare a 'png_image' structure on the stack and memset() it to all zero.\n * 2) Initialize the members of the structure that describe the image, setting\n *    the 'format' member to the format of the image samples.\n * 3) Call the appropriate png_image_write... function with a pointer to the\n *    image and, if necessary, the color-map to write the PNG data.\n *\n * png_image is a structure that describes the in-memory format of an image\n * when it is being read or defines the in-memory format of an image that you\n * need to write:\n */\n#define PNG_IMAGE_VERSION 1\n\ntypedef struct png_control *png_controlp;\ntypedef struct\n{\n   png_controlp opaque;    /* Initialize to NULL, free with png_image_free */\n   png_uint_32  version;   /* Set to PNG_IMAGE_VERSION */\n   png_uint_32  width;     /* Image width in pixels (columns) */\n   png_uint_32  height;    /* Image height in pixels (rows) */\n   png_uint_32  format;    /* Image format as defined below */\n   png_uint_32  flags;     /* A bit mask containing informational flags */\n   png_uint_32  colormap_entries;\n                           /* Number of entries in the color-map */\n\n   /* In the event of an error or warning the following field will be set to a\n    * non-zero value and the 'message' field will contain a '\\0' terminated\n    * string with the libpng error or warning message.  If both warnings and\n    * an error were encountered, only the error is recorded.  If there\n    * are multiple warnings, only the first one is recorded.\n    *\n    * The upper 30 bits of this value are reserved, the low two bits contain\n    * a value as follows:\n    */\n#  define PNG_IMAGE_WARNING 1\n#  define PNG_IMAGE_ERROR 2\n   /*\n    * The result is a two bit code such that a value more than 1 indicates\n    * a failure in the API just called:\n    *\n    *    0 - no warning or error\n    *    1 - warning\n    *    2 - error\n    *    3 - error preceded by warning\n    */\n#  define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1)\n\n   png_uint_32  warning_or_error;\n\n   char         message[64];\n} png_image, *png_imagep;\n\n/* The samples of the image have one to four channels whose components have\n * original values in the range 0 to 1.0:\n *\n * 1: A single gray or luminance channel (G).\n * 2: A gray/luminance channel and an alpha channel (GA).\n * 3: Three red, green, blue color channels (RGB).\n * 4: Three color channels and an alpha channel (RGBA).\n *\n * The components are encoded in one of two ways:\n *\n * a) As a small integer, value 0..255, contained in a single byte.  For the\n * alpha channel the original value is simply value/255.  For the color or\n * luminance channels the value is encoded according to the sRGB specification\n * and matches the 8-bit format expected by typical display devices.\n *\n * The color/gray channels are not scaled (pre-multiplied) by the alpha\n * channel and are suitable for passing to color management software.\n *\n * b) As a value in the range 0..65535, contained in a 2-byte integer.  All\n * channels can be converted to the original value by dividing by 65535; all\n * channels are linear.  Color channels use the RGB encoding (RGB end-points) of\n * the sRGB specification.  This encoding is identified by the\n * PNG_FORMAT_FLAG_LINEAR flag below.\n *\n * When the simplified API needs to convert between sRGB and linear colorspaces,\n * the actual sRGB transfer curve defined in the sRGB specification (see the\n * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2\n * approximation used elsewhere in libpng.\n *\n * When an alpha channel is present it is expected to denote pixel coverage\n * of the color or luminance channels and is returned as an associated alpha\n * channel: the color/gray channels are scaled (pre-multiplied) by the alpha\n * value.\n *\n * The samples are either contained directly in the image data, between 1 and 8\n * bytes per pixel according to the encoding, or are held in a color-map indexed\n * by bytes in the image data.  In the case of a color-map the color-map entries\n * are individual samples, encoded as above, and the image data has one byte per\n * pixel to select the relevant sample from the color-map.\n */\n\n/* PNG_FORMAT_*\n *\n * #defines to be used in png_image::format.  Each #define identifies a\n * particular layout of sample data and, if present, alpha values.  There are\n * separate defines for each of the two component encodings.\n *\n * A format is built up using single bit flag values.  All combinations are\n * valid.  Formats can be built up from the flag values or you can use one of\n * the predefined values below.  When testing formats always use the FORMAT_FLAG\n * macros to test for individual features - future versions of the library may\n * add new flags.\n *\n * When reading or writing color-mapped images the format should be set to the\n * format of the entries in the color-map then png_image_{read,write}_colormap\n * called to read or write the color-map and set the format correctly for the\n * image data.  Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly!\n *\n * NOTE: libpng can be built with particular features disabled, if you see\n * compiler errors because the definition of one of the following flags has been\n * compiled out it is because libpng does not have the required support.  It is\n * possible, however, for the libpng configuration to enable the format on just\n * read or just write; in that case you may see an error at run time.  You can\n * guard against this by checking for the definition of the appropriate\n * \"_SUPPORTED\" macro, one of:\n *\n *    PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED\n */\n#define PNG_FORMAT_FLAG_ALPHA    0x01U /* format with an alpha channel */\n#define PNG_FORMAT_FLAG_COLOR    0x02U /* color format: otherwise grayscale */\n#define PNG_FORMAT_FLAG_LINEAR   0x04U /* 2 byte channels else 1 byte */\n#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */\n\n#ifdef PNG_FORMAT_BGR_SUPPORTED\n#  define PNG_FORMAT_FLAG_BGR    0x10U /* BGR colors, else order is RGB */\n#endif\n\n#ifdef PNG_FORMAT_AFIRST_SUPPORTED\n#  define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */\n#endif\n\n/* Commonly used formats have predefined macros.\n *\n * First the single byte (sRGB) formats:\n */\n#define PNG_FORMAT_GRAY 0\n#define PNG_FORMAT_GA   PNG_FORMAT_FLAG_ALPHA\n#define PNG_FORMAT_AG   (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_RGB  PNG_FORMAT_FLAG_COLOR\n#define PNG_FORMAT_BGR  (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR)\n#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST)\n#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST)\n\n/* Then the linear 2-byte formats.  When naming these \"Y\" is used to\n * indicate a luminance (gray) channel.\n */\n#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR\n#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA)\n#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR)\n#define PNG_FORMAT_LINEAR_RGB_ALPHA \\\n   (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA)\n\n/* With color-mapped formats the image data is one byte for each pixel, the byte\n * is an index into the color-map which is formatted as above.  To obtain a\n * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP\n * to one of the above definitions, or you can use one of the definitions below.\n */\n#define PNG_FORMAT_RGB_COLORMAP  (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGR_COLORMAP  (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP)\n#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP)\n\n/* PNG_IMAGE macros\n *\n * These are convenience macros to derive information from a png_image\n * structure.  The PNG_IMAGE_SAMPLE_ macros return values appropriate to the\n * actual image sample values - either the entries in the color-map or the\n * pixels in the image.  The PNG_IMAGE_PIXEL_ macros return corresponding values\n * for the pixels and will always return 1 for color-mapped formats.  The\n * remaining macros return information about the rows in the image and the\n * complete image.\n *\n * NOTE: All the macros that take a png_image::format parameter are compile time\n * constants if the format parameter is, itself, a constant.  Therefore these\n * macros can be used in array declarations and case labels where required.\n * Similarly the macros are also pre-processor constants (sizeof is not used) so\n * they can be used in #if tests.\n *\n * First the information about the samples.\n */\n#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\\\n   (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1)\n   /* Return the total number of channels in a given format: 1..4 */\n\n#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\\\n   ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1)\n   /* Return the size in bytes of a single component of a pixel or color-map\n    * entry (as appropriate) in the image: 1 or 2.\n    */\n\n#define PNG_IMAGE_SAMPLE_SIZE(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt))\n   /* This is the size of the sample data for one sample.  If the image is\n    * color-mapped it is the size of one color-map entry (and image pixels are\n    * one byte in size), otherwise it is the size of one image pixel.\n    */\n\n#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\\\n   (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)\n   /* The maximum size of the color-map required by the format expressed in a\n    * count of components.  This can be used to compile-time allocate a\n    * color-map:\n    *\n    * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];\n    *\n    * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];\n    *\n    * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the\n    * information from one of the png_image_begin_read_ APIs and dynamically\n    * allocate the required memory.\n    */\n\n/* Corresponding information about the pixels */\n#define PNG_IMAGE_PIXEL_(test,fmt)\\\n   (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt))\n\n#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt)\n   /* The number of separate channels (components) in a pixel; 1 for a\n    * color-mapped image.\n    */\n\n#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\\\n   PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt)\n   /* The size, in bytes, of each component in a pixel; 1 for a color-mapped\n    * image.\n    */\n\n#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt)\n   /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */\n\n/* Information about the whole row, or whole image */\n#define PNG_IMAGE_ROW_STRIDE(image)\\\n   (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width)\n   /* Return the total number of components in a single row of the image; this\n    * is the minimum 'row stride', the minimum count of components between each\n    * row.  For a color-mapped image this is the minimum number of bytes in a\n    * row.\n    */\n\n#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\\\n   (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride))\n   /* Return the size, in bytes, of an image buffer given a png_image and a row\n    * stride - the number of components to leave space for in each row.\n    */\n\n#define PNG_IMAGE_SIZE(image)\\\n   PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image))\n   /* Return the size, in bytes, of the image in memory given just a png_image;\n    * the row stride is the minimum stride required for the image.\n    */\n\n#define PNG_IMAGE_COLORMAP_SIZE(image)\\\n   (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries)\n   /* Return the size, in bytes, of the color-map of this image.  If the image\n    * format is not a color-map format this will return a size sufficient for\n    * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if\n    * you don't want to allocate a color-map in this case.\n    */\n\n/* PNG_IMAGE_FLAG_*\n *\n * Flags containing additional information about the image are held in the\n * 'flags' field of png_image.\n */\n#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01\n   /* This indicates the the RGB values of the in-memory bitmap do not\n    * correspond to the red, green and blue end-points defined by sRGB.\n    */\n\n#define PNG_IMAGE_FLAG_FAST 0x02\n   /* On write emphasise speed over compression; the resultant PNG file will be\n    * larger but will be produced significantly faster, particular for large\n    * images.  Do not use this option for images which will be distributed, only\n    * used it when producing intermediate files that will be read back in\n    * repeatedly.  For a typical 24-bit image the option will double the read\n    * speed at the cost of increasing the image size by 25%, however for many\n    * more compressible images the PNG file can be 10 times larger with only a\n    * slight speed gain.\n    */\n\n#define PNG_IMAGE_FLAG_16BIT_sRGB 0x04\n   /* On read if the image is a 16-bit per component image and there is no gAMA\n    * or sRGB chunk assume that the components are sRGB encoded.  Notice that\n    * images output by the simplified API always have gamma information; setting\n    * this flag only affects the interpretation of 16-bit images from an\n    * external source.  It is recommended that the application expose this flag\n    * to the user; the user can normally easily recognize the difference between\n    * linear and sRGB encoding.  This flag has no effect on write - the data\n    * passed to the write APIs must have the correct encoding (as defined\n    * above.)\n    *\n    * If the flag is not set (the default) input 16-bit per component data is\n    * assumed to be linear.\n    *\n    * NOTE: the flag can only be set after the png_image_begin_read_ call,\n    * because that call initializes the 'flags' field.\n    */\n\n#ifdef PNG_SIMPLIFIED_READ_SUPPORTED\n/* READ APIs\n * ---------\n *\n * The png_image passed to the read APIs must have been initialized by setting\n * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.)\n */\n#ifdef PNG_STDIO_SUPPORTED\nPNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,\n   const char *file_name));\n   /* The named file is opened for read and the image header is filled in\n    * from the PNG header in the file.\n    */\n\nPNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,\n   FILE* file));\n   /* The PNG header is read from the stdio FILE object. */\n#endif /* PNG_STDIO_SUPPORTED */\n\nPNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,\n   png_const_voidp memory, png_size_t size));\n   /* The PNG header is read from the given memory buffer. */\n\nPNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,\n   png_const_colorp background, void *buffer, png_int_32 row_stride,\n   void *colormap));\n   /* Finish reading the image into the supplied buffer and clean up the\n    * png_image structure.\n    *\n    * row_stride is the step, in byte or 2-byte units as appropriate,\n    * between adjacent rows.  A positive stride indicates that the top-most row\n    * is first in the buffer - the normal top-down arrangement.  A negative\n    * stride indicates that the bottom-most row is first in the buffer.\n    *\n    * background need only be supplied if an alpha channel must be removed from\n    * a png_byte format and the removal is to be done by compositing on a solid\n    * color; otherwise it may be NULL and any composition will be done directly\n    * onto the buffer.  The value is an sRGB color to use for the background,\n    * for grayscale output the green channel is used.\n    *\n    * background must be supplied when an alpha channel must be removed from a\n    * single byte color-mapped output format, in other words if:\n    *\n    * 1) The original format from png_image_begin_read_from_* had\n    *    PNG_FORMAT_FLAG_ALPHA set.\n    * 2) The format set by the application does not.\n    * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and\n    *    PNG_FORMAT_FLAG_LINEAR *not* set.\n    *\n    * For linear output removing the alpha channel is always done by compositing\n    * on black and background is ignored.\n    *\n    * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set.  It must\n    * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE.\n    * image->colormap_entries will be updated to the actual number of entries\n    * written to the colormap; this may be less than the original value.\n    */\n\nPNG_EXPORT(238, void, png_image_free, (png_imagep image));\n   /* Free any data allocated by libpng in image->opaque, setting the pointer to\n    * NULL.  May be called at any time after the structure is initialized.\n    */\n#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */\n\n#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED\n/* WRITE APIS\n * ----------\n * For write you must initialize a png_image structure to describe the image to\n * be written.  To do this use memset to set the whole structure to 0 then\n * initialize fields describing your image.\n *\n * version: must be set to PNG_IMAGE_VERSION\n * opaque: must be initialized to NULL\n * width: image width in pixels\n * height: image height in rows\n * format: the format of the data (image and color-map) you wish to write\n * flags: set to 0 unless one of the defined flags applies; set\n *    PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB\n *    values do not correspond to the colors in sRGB.\n * colormap_entries: set to the number of entries in the color-map (0 to 256)\n */\nPNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,\n   const char *file, int convert_to_8bit, const void *buffer,\n   png_int_32 row_stride, const void *colormap));\n   /* Write the image to the named file. */\n\nPNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,\n   int convert_to_8_bit, const void *buffer, png_int_32 row_stride,\n   const void *colormap));\n   /* Write the image to the given (FILE*). */\n\n/* With both write APIs if image is in one of the linear formats with 16-bit\n * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG\n * gamma encoded according to the sRGB specification, otherwise a 16-bit linear\n * encoded PNG file is written.\n *\n * With color-mapped data formats the colormap parameter point to a color-map\n * with at least image->colormap_entries encoded in the specified format.  If\n * the format is linear the written PNG color-map will be converted to sRGB\n * regardless of the convert_to_8_bit flag.\n *\n * With all APIs row_stride is handled as in the read APIs - it is the spacing\n * from one row to the next in component sized units (1 or 2 bytes) and if\n * negative indicates a bottom-up row layout in the buffer.\n *\n * Note that the write API does not support interlacing or sub-8-bit pixels.\n */\n#endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */\n/*******************************************************************************\n *  END OF SIMPLIFIED API\n ******************************************************************************/\n\n#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\nPNG_EXPORT(242, void, png_set_check_for_invalid_index,\n    (png_structrp png_ptr, int allowed));\n#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED\nPNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,\n    png_const_infop info_ptr));\n#  endif\n#endif /* CHECK_FOR_INVALID_INDEX */\n\n/*******************************************************************************\n *  IMPLEMENTATION OPTIONS\n *******************************************************************************\n *\n * Support for arbitrary implementation-specific optimizations.  The API allows\n * particular options to be turned on or off.  'Option' is the number of the\n * option and 'onoff' is 0 (off) or non-0 (on).  The value returned is given\n * by the PNG_OPTION_ defines below.\n *\n * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions,\n *           are detected at run time, however sometimes it may be impossible\n *           to do this in user mode, in which case it is necessary to discover\n *           the capabilities in an OS specific way.  Such capabilities are\n *           listed here when libpng has support for them and must be turned\n *           ON by the application if present.\n *\n * SOFTWARE: sometimes software optimizations actually result in performance\n *           decrease on some architectures or systems, or with some sets of\n *           PNG images.  'Software' options allow such optimizations to be\n *           selected at run time.\n */\n#ifdef PNG_SET_OPTION_SUPPORTED\n#ifdef PNG_ARM_NEON_API_SUPPORTED\n#  define PNG_ARM_NEON   0 /* HARDWARE: ARM Neon SIMD instructions supported */\n#endif\n#define PNG_OPTION_NEXT  2 /* Next option - numbers must be even */\n\n/* Return values: NOTE: there are four values and 'off' is *not* zero */\n#define PNG_OPTION_UNSET   0 /* Unset - defaults to off */\n#define PNG_OPTION_INVALID 1 /* Option number out of range */\n#define PNG_OPTION_OFF     2\n#define PNG_OPTION_ON      3\n\nPNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,\n   int onoff));\n#endif\n\n/*******************************************************************************\n *  END OF HARDWARE OPTIONS\n ******************************************************************************/\n\n/* Maintainer: Put new public prototypes here ^, in libpng.3, and project\n * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt\n */\n\n/* The last ordinal number (this is the *last* one already used; the next\n * one to use is one more than this.)  Maintainer, remember to add an entry to\n * scripts/symbols.def as well.\n */\n#ifdef PNG_EXPORT_LAST_ORDINAL\n  PNG_EXPORT_LAST_ORDINAL(244);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* PNG_VERSION_INFO_ONLY */\n/* Do not put anything past this line */\n#endif /* PNG_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/win32/pngconf.h",
    "content": "\n/* pngconf.h - machine configurable file for libpng\n *\n * libpng version 1.6.2 - April 25, 2013\n *\n * Copyright (c) 1998-2013 Glenn Randers-Pehrson\n * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)\n * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)\n *\n * This code is released under the libpng license.\n * For conditions of distribution and use, see the disclaimer\n * and license in png.h\n *\n */\n\n/* Any machine specific code is near the front of this file, so if you\n * are configuring libpng for a machine, you may want to read the section\n * starting here down to where it starts to typedef png_color, png_text,\n * and png_info.\n */\n\n#ifndef PNGCONF_H\n#define PNGCONF_H\n\n/* To do: Do all of this in scripts/pnglibconf.dfa */\n#ifdef PNG_SAFE_LIMITS_SUPPORTED\n#  ifdef PNG_USER_WIDTH_MAX\n#    undef PNG_USER_WIDTH_MAX\n#    define PNG_USER_WIDTH_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_HEIGHT_MAX\n#    undef PNG_USER_HEIGHT_MAX\n#    define PNG_USER_HEIGHT_MAX 1000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_MALLOC_MAX\n#    undef PNG_USER_CHUNK_MALLOC_MAX\n#    define PNG_USER_CHUNK_MALLOC_MAX 4000000L\n#  endif\n#  ifdef PNG_USER_CHUNK_CACHE_MAX\n#    undef PNG_USER_CHUNK_CACHE_MAX\n#    define PNG_USER_CHUNK_CACHE_MAX 128\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */\n\n/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 (\"ISOC90\") compliant C\n * compiler for correct compilation.  The following header files are required by\n * the standard.  If your compiler doesn't provide these header files, or they\n * do not match the standard, you will need to provide/improve them.\n */\n#include <limits.h>\n#include <stddef.h>\n\n/* Library header files.  These header files are all defined by ISOC90; libpng\n * expects conformant implementations, however, an ISOC90 conformant system need\n * not provide these header files if the functionality cannot be implemented.\n * In this case it will be necessary to disable the relevant parts of libpng in\n * the build of pnglibconf.h.\n *\n * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not\n * include this unnecessary header file.\n */\n\n#ifdef PNG_STDIO_SUPPORTED\n   /* Required for the definition of FILE: */\n#  include <stdio.h>\n#endif\n\n#ifdef PNG_SETJMP_SUPPORTED\n   /* Required for the definition of jmp_buf and the declaration of longjmp: */\n#  include <setjmp.h>\n#endif\n\n#ifdef PNG_CONVERT_tIME_SUPPORTED\n   /* Required for struct tm: */\n#  include <time.h>\n#endif\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n/* Prior to 1.6.0 it was possible to turn off 'const' in declarations using\n * PNG_NO_CONST; this is no longer supported except for data declarations which\n * apparently still cause problems in 2011 on some compilers.\n */\n#define PNG_CONST const /* backward compatibility only */\n\n/* This controls optimization of the reading of 16 and 32 bit values\n * from PNG files.  It can be set on a per-app-file basis - it\n * just changes whether a macro is used when the function is called.\n * The library builder sets the default; if read functions are not\n * built into the library the macro implementation is forced on.\n */\n#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED\n#  define PNG_USE_READ_MACROS\n#endif\n#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)\n#  if PNG_DEFAULT_READ_MACROS\n#    define PNG_USE_READ_MACROS\n#  endif\n#endif\n\n/* COMPILER SPECIFIC OPTIONS.\n *\n * These options are provided so that a variety of difficult compilers\n * can be used.  Some are fixed at build time (e.g. PNG_API_RULE\n * below) but still have compiler specific implementations, others\n * may be changed on a per-file basis when compiling against libpng.\n */\n\n/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect\n * against legacy (pre ISOC90) compilers that did not understand function\n * prototypes.  It is not required for modern C compilers.\n */\n#ifndef PNGARG\n#  define PNGARG(arglist) arglist\n#endif\n\n/* Function calling conventions.\n * =============================\n * Normally it is not necessary to specify to the compiler how to call\n * a function - it just does it - however on x86 systems derived from\n * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems\n * and some others) there are multiple ways to call a function and the\n * default can be changed on the compiler command line.  For this reason\n * libpng specifies the calling convention of every exported function and\n * every function called via a user supplied function pointer.  This is\n * done in this file by defining the following macros:\n *\n * PNGAPI    Calling convention for exported functions.\n * PNGCBAPI  Calling convention for user provided (callback) functions.\n * PNGCAPI   Calling convention used by the ANSI-C library (required\n *           for longjmp callbacks and sometimes used internally to\n *           specify the calling convention for zlib).\n *\n * These macros should never be overridden.  If it is necessary to\n * change calling convention in a private build this can be done\n * by setting PNG_API_RULE (which defaults to 0) to one of the values\n * below to select the correct 'API' variants.\n *\n * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout.\n *                This is correct in every known environment.\n * PNG_API_RULE=1 Use the operating system convention for PNGAPI and\n *                the 'C' calling convention (from PNGCAPI) for\n *                callbacks (PNGCBAPI).  This is no longer required\n *                in any known environment - if it has to be used\n *                please post an explanation of the problem to the\n *                libpng mailing list.\n *\n * These cases only differ if the operating system does not use the C\n * calling convention, at present this just means the above cases\n * (x86 DOS/Windows sytems) and, even then, this does not apply to\n * Cygwin running on those systems.\n *\n * Note that the value must be defined in pnglibconf.h so that what\n * the application uses to call the library matches the conventions\n * set when building the library.\n */\n\n/* Symbol export\n * =============\n * When building a shared library it is almost always necessary to tell\n * the compiler which symbols to export.  The png.h macro 'PNG_EXPORT'\n * is used to mark the symbols.  On some systems these symbols can be\n * extracted at link time and need no special processing by the compiler,\n * on other systems the symbols are flagged by the compiler and just\n * the declaration requires a special tag applied (unfortunately) in a\n * compiler dependent way.  Some systems can do either.\n *\n * A small number of older systems also require a symbol from a DLL to\n * be flagged to the program that calls it.  This is a problem because\n * we do not know in the header file included by application code that\n * the symbol will come from a shared library, as opposed to a statically\n * linked one.  For this reason the application must tell us by setting\n * the magic flag PNG_USE_DLL to turn on the special processing before\n * it includes png.h.\n *\n * Four additional macros are used to make this happen:\n *\n * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from\n *            the build or imported if PNG_USE_DLL is set - compiler\n *            and system specific.\n *\n * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to\n *                       'type', compiler specific.\n *\n * PNG_DLL_EXPORT Set to the magic to use during a libpng build to\n *                make a symbol exported from the DLL.  Not used in the\n *                public header files; see pngpriv.h for how it is used\n *                in the libpng build.\n *\n * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come\n *                from a DLL - used to define PNG_IMPEXP when\n *                PNG_USE_DLL is set.\n */\n\n/* System specific discovery.\n * ==========================\n * This code is used at build time to find PNG_IMPEXP, the API settings\n * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL\n * import processing is possible.  On Windows systems it also sets\n * compiler-specific macros to the values required to change the calling\n * conventions of the various functions.\n */\n#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\\\n    defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)\n  /* Windows system (DOS doesn't support DLLs).  Includes builds under Cygwin or\n   * MinGW on any architecture currently supported by Windows.  Also includes\n   * Watcom builds but these need special treatment because they are not\n   * compatible with GCC or Visual C because of different calling conventions.\n   */\n#  if PNG_API_RULE == 2\n    /* If this line results in an error, either because __watcall is not\n     * understood or because of a redefine just below you cannot use *this*\n     * build of the library with the compiler you are using.  *This* build was\n     * build using Watcom and applications must also be built using Watcom!\n     */\n#    define PNGCAPI __watcall\n#  endif\n\n#  if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800))\n#    define PNGCAPI __cdecl\n#    if PNG_API_RULE == 1\n       /* If this line results in an error __stdcall is not understood and\n        * PNG_API_RULE should not have been set to '1'.\n        */\n#      define PNGAPI __stdcall\n#    endif\n#  else\n    /* An older compiler, or one not detected (erroneously) above,\n     * if necessary override on the command line to get the correct\n     * variants for the compiler.\n     */\n#    ifndef PNGCAPI\n#      define PNGCAPI _cdecl\n#    endif\n#    if PNG_API_RULE == 1 && !defined(PNGAPI)\n#      define PNGAPI _stdcall\n#    endif\n#  endif /* compiler/api */\n  /* NOTE: PNGCBAPI always defaults to PNGCAPI. */\n\n#  if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)\n#     error \"PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed\"\n#  endif\n\n#  if (defined(_MSC_VER) && _MSC_VER < 800) ||\\\n      (defined(__BORLANDC__) && __BORLANDC__ < 0x500)\n    /* older Borland and MSC\n     * compilers used '__export' and required this to be after\n     * the type.\n     */\n#    ifndef PNG_EXPORT_TYPE\n#      define PNG_EXPORT_TYPE(type) type PNG_IMPEXP\n#    endif\n#    define PNG_DLL_EXPORT __export\n#  else /* newer compiler */\n#    define PNG_DLL_EXPORT __declspec(dllexport)\n#    ifndef PNG_DLL_IMPORT\n#      define PNG_DLL_IMPORT __declspec(dllimport)\n#    endif\n#  endif /* compiler */\n\n#else /* !Windows */\n#  if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)\n#    define PNGAPI _System\n#  else /* !Windows/x86 && !OS/2 */\n    /* Use the defaults, or define PNG*API on the command line (but\n     * this will have to be done for every compile!)\n     */\n#  endif /* other system, !OS/2 */\n#endif /* !Windows/x86 */\n\n/* Now do all the defaulting . */\n#ifndef PNGCAPI\n#  define PNGCAPI\n#endif\n#ifndef PNGCBAPI\n#  define PNGCBAPI PNGCAPI\n#endif\n#ifndef PNGAPI\n#  define PNGAPI PNGCAPI\n#endif\n\n/* PNG_IMPEXP may be set on the compilation system command line or (if not set)\n * then in an internal header file when building the library, otherwise (when\n * using the library) it is set here.\n */\n#ifndef PNG_IMPEXP\n#  if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT)\n     /* This forces use of a DLL, disallowing static linking */\n#    define PNG_IMPEXP PNG_DLL_IMPORT\n#  endif\n\n#  ifndef PNG_IMPEXP\n#    define PNG_IMPEXP\n#  endif\n#endif\n\n/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat\n * 'attributes' as a storage class - the attributes go at the start of the\n * function definition, and attributes are always appended regardless of the\n * compiler.  This considerably simplifies these macros but may cause problems\n * if any compilers both need function attributes and fail to handle them as\n * a storage class (this is unlikely.)\n */\n#ifndef PNG_FUNCTION\n#  define PNG_FUNCTION(type, name, args, attributes) attributes type name args\n#endif\n\n#ifndef PNG_EXPORT_TYPE\n#  define PNG_EXPORT_TYPE(type) PNG_IMPEXP type\n#endif\n\n   /* The ordinal value is only relevant when preprocessing png.h for symbol\n    * table entries, so we discard it here.  See the .dfn files in the\n    * scripts directory.\n    */\n#ifndef PNG_EXPORTA\n\n#  define PNG_EXPORTA(ordinal, type, name, args, attributes)\\\n      PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \\\n        extern attributes)\n#endif\n\n/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,\n * so make something non-empty to satisfy the requirement:\n */\n#define PNG_EMPTY /*empty list*/\n\n#define PNG_EXPORT(ordinal, type, name, args)\\\n   PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)\n\n/* Use PNG_REMOVED to comment out a removed interface. */\n#ifndef PNG_REMOVED\n#  define PNG_REMOVED(ordinal, type, name, args, attributes)\n#endif\n\n#ifndef PNG_CALLBACK\n#  define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)\n#endif\n\n/* Support for compiler specific function attributes.  These are used\n * so that where compiler support is available incorrect use of API\n * functions in png.h will generate compiler warnings.\n *\n * Added at libpng-1.2.41.\n */\n\n#ifndef PNG_NO_PEDANTIC_WARNINGS\n#  ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED\n#    define PNG_PEDANTIC_WARNINGS_SUPPORTED\n#  endif\n#endif\n\n#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED\n  /* Support for compiler specific function attributes.  These are used\n   * so that where compiler support is available, incorrect use of API\n   * functions in png.h will generate compiler warnings.  Added at libpng\n   * version 1.2.41.  Disabling these removes the warnings but may also produce\n   * less efficient code.\n   */\n#  if defined(__GNUC__)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT __attribute__((__warn_unused_result__))\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __attribute__((__noreturn__))\n#    endif\n#    if __GNUC__ >= 3\n#      ifndef PNG_ALLOCATED\n#        define PNG_ALLOCATED  __attribute__((__malloc__))\n#      endif\n#      ifndef PNG_DEPRECATED\n#        define PNG_DEPRECATED __attribute__((__deprecated__))\n#      endif\n#      ifndef PNG_PRIVATE\n#        if 0 /* Doesn't work so we use deprecated instead*/\n#          define PNG_PRIVATE \\\n            __attribute__((warning(\"This function is not exported by libpng.\")))\n#        else\n#          define PNG_PRIVATE \\\n            __attribute__((__deprecated__))\n#        endif\n#      endif\n#      if ((__GNUC__ != 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1))\n#        ifndef PNG_RESTRICT\n#          define PNG_RESTRICT __restrict\n#        endif\n#      endif /*  __GNUC__ == 3.0 */\n#    endif /*  __GNUC__ >= 3 */\n\n#  elif defined(_MSC_VER)  && (_MSC_VER >= 1300)\n#    ifndef PNG_USE_RESULT\n#      define PNG_USE_RESULT /* not supported */\n#    endif\n#    ifndef PNG_NORETURN\n#      define PNG_NORETURN   __declspec(noreturn)\n#    endif\n#    ifndef PNG_ALLOCATED\n#      if (_MSC_VER >= 1400)\n#        define PNG_ALLOCATED __declspec(restrict)\n#      endif\n#    endif\n#    ifndef PNG_DEPRECATED\n#      define PNG_DEPRECATED __declspec(deprecated)\n#    endif\n#    ifndef PNG_PRIVATE\n#      define PNG_PRIVATE __declspec(deprecated)\n#    endif\n#    ifndef PNG_RESTRICT\n#      if (_MSC_VER >= 1400)\n#        define PNG_RESTRICT __restrict\n#      endif\n#    endif\n\n#  elif defined(__WATCOMC__)\n#    ifndef PNG_RESTRICT\n#      define PNG_RESTRICT __restrict\n#    endif\n#  endif /* _MSC_VER */\n#endif /* PNG_PEDANTIC_WARNINGS */\n\n#ifndef PNG_DEPRECATED\n#  define PNG_DEPRECATED  /* Use of this function is deprecated */\n#endif\n#ifndef PNG_USE_RESULT\n#  define PNG_USE_RESULT  /* The result of this function must be checked */\n#endif\n#ifndef PNG_NORETURN\n#  define PNG_NORETURN    /* This function does not return */\n#endif\n#ifndef PNG_ALLOCATED\n#  define PNG_ALLOCATED   /* The result of the function is new memory */\n#endif\n#ifndef PNG_PRIVATE\n#  define PNG_PRIVATE     /* This is a private libpng function */\n#endif\n#ifndef PNG_RESTRICT\n#  define PNG_RESTRICT    /* The C99 \"restrict\" feature */\n#endif\n#ifndef PNG_FP_EXPORT     /* A floating point API. */\n#  ifdef PNG_FLOATING_POINT_SUPPORTED\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No floating point APIs */\n#     define PNG_FP_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n#ifndef PNG_FIXED_EXPORT  /* A fixed point API. */\n#  ifdef PNG_FIXED_POINT_SUPPORTED\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\\\n         PNG_EXPORT(ordinal, type, name, args);\n#  else                   /* No fixed point APIs */\n#     define PNG_FIXED_EXPORT(ordinal, type, name, args)\n#  endif\n#endif\n\n#ifndef PNG_BUILDING_SYMBOL_TABLE\n/* Some typedefs to get us started.  These should be safe on most of the common\n * platforms.\n *\n * png_uint_32 and png_int_32 may, currently, be larger than required to hold a\n * 32-bit value however this is not normally advisable.\n *\n * png_uint_16 and png_int_16 should always be two bytes in size - this is\n * verified at library build time.\n *\n * png_byte must always be one byte in size.\n *\n * The checks below use constants from limits.h, as defined by the ISOC90\n * standard.\n */\n#if CHAR_BIT == 8 && UCHAR_MAX == 255\n   typedef unsigned char png_byte;\n#else\n#  error \"libpng requires 8 bit bytes\"\n#endif\n\n#if INT_MIN == -32768 && INT_MAX == 32767\n   typedef int png_int_16;\n#elif SHRT_MIN == -32768 && SHRT_MAX == 32767\n   typedef short png_int_16;\n#else\n#  error \"libpng requires a signed 16 bit type\"\n#endif\n\n#if UINT_MAX == 65535\n   typedef unsigned int png_uint_16;\n#elif USHRT_MAX == 65535\n   typedef unsigned short png_uint_16;\n#else\n#  error \"libpng requires an unsigned 16 bit type\"\n#endif\n\n#if INT_MIN < -2147483646 && INT_MAX > 2147483646\n   typedef int png_int_32;\n#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646\n   typedef long int png_int_32;\n#else\n#  error \"libpng requires a signed 32 bit (or more) type\"\n#endif\n\n#if UINT_MAX > 4294967294\n   typedef unsigned int png_uint_32;\n#elif ULONG_MAX > 4294967294\n   typedef unsigned long int png_uint_32;\n#else\n#  error \"libpng requires an unsigned 32 bit (or more) type\"\n#endif\n\n/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,\n * requires an ISOC90 compiler and relies on consistent behavior of sizeof.\n */\ntypedef size_t png_size_t;\ntypedef ptrdiff_t png_ptrdiff_t;\n\n/* libpng needs to know the maximum value of 'size_t' and this controls the\n * definition of png_alloc_size_t, below.  This maximum value of size_t limits\n * but does not control the maximum allocations the library makes - there is\n * direct application control of this through png_set_user_limits().\n */\n#ifndef PNG_SMALL_SIZE_T\n   /* Compiler specific tests for systems where size_t is known to be less than\n    * 32 bits (some of these systems may no longer work because of the lack of\n    * 'far' support; see above.)\n    */\n#  if (defined(__TURBOC__) && !defined(__FLAT__)) ||\\\n   (defined(_MSC_VER) && defined(MAXSEG_64K))\n#     define PNG_SMALL_SIZE_T\n#  endif\n#endif\n\n/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no\n * smaller than png_uint_32.  Casts from png_size_t or png_uint_32 to\n * png_alloc_size_t are not necessary; in fact, it is recommended not to use\n * them at all so that the compiler can complain when something turns out to be\n * problematic.\n *\n * Casts in the other direction (from png_alloc_size_t to png_size_t or\n * png_uint_32) should be explicitly applied; however, we do not expect to\n * encounter practical situations that require such conversions.\n *\n * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than\n * 4294967295 - i.e. less than the maximum value of png_uint_32.\n */\n#ifdef PNG_SMALL_SIZE_T\n   typedef png_uint_32 png_alloc_size_t;\n#else\n   typedef png_size_t png_alloc_size_t;\n#endif\n\n/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler\n * implementations of Intel CPU specific support of user-mode segmented address\n * spaces, where 16-bit pointers address more than 65536 bytes of memory using\n * separate 'segment' registers.  The implementation requires two different\n * types of pointer (only one of which includes the segment value.)\n *\n * If required this support is available in version 1.2 of libpng and may be\n * available in versions through 1.5, although the correctness of the code has\n * not been verified recently.\n */\n\n/* Typedef for floating-point numbers that are converted to fixed-point with a\n * multiple of 100,000, e.g., gamma\n */\ntypedef png_int_32 png_fixed_point;\n\n/* Add typedefs for pointers */\ntypedef void                  * png_voidp;\ntypedef const void            * png_const_voidp;\ntypedef png_byte              * png_bytep;\ntypedef const png_byte        * png_const_bytep;\ntypedef png_uint_32           * png_uint_32p;\ntypedef const png_uint_32     * png_const_uint_32p;\ntypedef png_int_32            * png_int_32p;\ntypedef const png_int_32      * png_const_int_32p;\ntypedef png_uint_16           * png_uint_16p;\ntypedef const png_uint_16     * png_const_uint_16p;\ntypedef png_int_16            * png_int_16p;\ntypedef const png_int_16      * png_const_int_16p;\ntypedef char                  * png_charp;\ntypedef const char            * png_const_charp;\ntypedef png_fixed_point       * png_fixed_point_p;\ntypedef const png_fixed_point * png_const_fixed_point_p;\ntypedef png_size_t            * png_size_tp;\ntypedef const png_size_t      * png_const_size_tp;\n\n#ifdef PNG_STDIO_SUPPORTED\ntypedef FILE            * png_FILE_p;\n#endif\n\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double       * png_doublep;\ntypedef const double * png_const_doublep;\n#endif\n\n/* Pointers to pointers; i.e. arrays */\ntypedef png_byte        * * png_bytepp;\ntypedef png_uint_32     * * png_uint_32pp;\ntypedef png_int_32      * * png_int_32pp;\ntypedef png_uint_16     * * png_uint_16pp;\ntypedef png_int_16      * * png_int_16pp;\ntypedef const char      * * png_const_charpp;\ntypedef char            * * png_charpp;\ntypedef png_fixed_point * * png_fixed_point_pp;\n#ifdef PNG_FLOATING_POINT_SUPPORTED\ntypedef double          * * png_doublepp;\n#endif\n\n/* Pointers to pointers to pointers; i.e., pointer to array */\ntypedef char            * * * png_charppp;\n\n#endif /* PNG_BUILDING_SYMBOL_TABLE */\n\n#endif /* PNGCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/include/win32/pnglibconf.h",
    "content": "/* libpng 1.6.2 STANDARD API DEFINITION */\n\n/* pnglibconf.h - library build configuration */\n\n/* Libpng version 1.6.2 - April 25, 2013 */\n\n/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */\n\n/* This code is released under the libpng license. */\n/* For conditions of distribution and use, see the disclaimer */\n/* and license in png.h */\n\n/* pnglibconf.h */\n/* Machine generated file: DO NOT EDIT */\n/* Derived from: scripts/pnglibconf.dfa */\n#ifndef PNGLCONF_H\n#define PNGLCONF_H\n/* options */\n#define PNG_16BIT_SUPPORTED\n#define PNG_ALIGNED_MEMORY_SUPPORTED\n/*#undef PNG_ARM_NEON_API_SUPPORTED*/\n/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/\n/*#undef PNG_ARM_NEON_SUPPORTED*/\n#define PNG_BENIGN_ERRORS_SUPPORTED\n#define PNG_BENIGN_READ_ERRORS_SUPPORTED\n/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/\n#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED\n#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_COLORSPACE_SUPPORTED\n#define PNG_CONSOLE_IO_SUPPORTED\n#define PNG_CONVERT_tIME_SUPPORTED\n#define PNG_EASY_ACCESS_SUPPORTED\n/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/\n#define PNG_ERROR_TEXT_SUPPORTED\n#define PNG_FIXED_POINT_SUPPORTED\n#define PNG_FLOATING_ARITHMETIC_SUPPORTED\n#define PNG_FLOATING_POINT_SUPPORTED\n#define PNG_FORMAT_AFIRST_SUPPORTED\n#define PNG_FORMAT_BGR_SUPPORTED\n#define PNG_GAMMA_SUPPORTED\n#define PNG_GET_PALETTE_MAX_SUPPORTED\n#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED\n#define PNG_INCH_CONVERSIONS_SUPPORTED\n#define PNG_INFO_IMAGE_SUPPORTED\n#define PNG_IO_STATE_SUPPORTED\n#define PNG_MNG_FEATURES_SUPPORTED\n#define PNG_POINTER_INDEXING_SUPPORTED\n#define PNG_PROGRESSIVE_READ_SUPPORTED\n#define PNG_READ_16BIT_SUPPORTED\n#define PNG_READ_ALPHA_MODE_SUPPORTED\n#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_READ_BACKGROUND_SUPPORTED\n#define PNG_READ_BGR_SUPPORTED\n#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_READ_COMPOSITE_NODIV_SUPPORTED\n#define PNG_READ_COMPRESSED_TEXT_SUPPORTED\n#define PNG_READ_EXPAND_16_SUPPORTED\n#define PNG_READ_EXPAND_SUPPORTED\n#define PNG_READ_FILLER_SUPPORTED\n#define PNG_READ_GAMMA_SUPPORTED\n#define PNG_READ_GET_PALETTE_MAX_SUPPORTED\n#define PNG_READ_GRAY_TO_RGB_SUPPORTED\n#define PNG_READ_INTERLACING_SUPPORTED\n#define PNG_READ_INT_FUNCTIONS_SUPPORTED\n#define PNG_READ_INVERT_ALPHA_SUPPORTED\n#define PNG_READ_INVERT_SUPPORTED\n#define PNG_READ_OPT_PLTE_SUPPORTED\n#define PNG_READ_PACKSWAP_SUPPORTED\n#define PNG_READ_PACK_SUPPORTED\n#define PNG_READ_QUANTIZE_SUPPORTED\n#define PNG_READ_RGB_TO_GRAY_SUPPORTED\n#define PNG_READ_SCALE_16_TO_8_SUPPORTED\n#define PNG_READ_SHIFT_SUPPORTED\n#define PNG_READ_STRIP_16_TO_8_SUPPORTED\n#define PNG_READ_STRIP_ALPHA_SUPPORTED\n#define PNG_READ_SUPPORTED\n#define PNG_READ_SWAP_ALPHA_SUPPORTED\n#define PNG_READ_SWAP_SUPPORTED\n#define PNG_READ_TEXT_SUPPORTED\n#define PNG_READ_TRANSFORMS_SUPPORTED\n#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_READ_USER_CHUNKS_SUPPORTED\n#define PNG_READ_USER_TRANSFORM_SUPPORTED\n#define PNG_READ_bKGD_SUPPORTED\n#define PNG_READ_cHRM_SUPPORTED\n#define PNG_READ_gAMA_SUPPORTED\n#define PNG_READ_hIST_SUPPORTED\n#define PNG_READ_iCCP_SUPPORTED\n#define PNG_READ_iTXt_SUPPORTED\n#define PNG_READ_oFFs_SUPPORTED\n#define PNG_READ_pCAL_SUPPORTED\n#define PNG_READ_pHYs_SUPPORTED\n#define PNG_READ_sBIT_SUPPORTED\n#define PNG_READ_sCAL_SUPPORTED\n#define PNG_READ_sPLT_SUPPORTED\n#define PNG_READ_sRGB_SUPPORTED\n#define PNG_READ_tEXt_SUPPORTED\n#define PNG_READ_tIME_SUPPORTED\n#define PNG_READ_tRNS_SUPPORTED\n#define PNG_READ_zTXt_SUPPORTED\n/*#undef PNG_SAFE_LIMITS_SUPPORTED*/\n#define PNG_SAVE_INT_32_SUPPORTED\n#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SEQUENTIAL_READ_SUPPORTED\n#define PNG_SETJMP_SUPPORTED\n#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED\n#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED\n/*#undef PNG_SET_OPTION_SUPPORTED*/\n#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_SET_USER_LIMITS_SUPPORTED\n#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_READ_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED\n#define PNG_SIMPLIFIED_WRITE_SUPPORTED\n#define PNG_STDIO_SUPPORTED\n#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_TEXT_SUPPORTED\n#define PNG_TIME_RFC1123_SUPPORTED\n#define PNG_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_USER_CHUNKS_SUPPORTED\n#define PNG_USER_LIMITS_SUPPORTED\n#define PNG_USER_MEM_SUPPORTED\n#define PNG_USER_TRANSFORM_INFO_SUPPORTED\n#define PNG_USER_TRANSFORM_PTR_SUPPORTED\n#define PNG_WARNINGS_SUPPORTED\n#define PNG_WRITE_16BIT_SUPPORTED\n#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED\n#define PNG_WRITE_BGR_SUPPORTED\n#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED\n#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED\n#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED\n#define PNG_WRITE_FILLER_SUPPORTED\n#define PNG_WRITE_FILTER_SUPPORTED\n#define PNG_WRITE_FLUSH_SUPPORTED\n#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED\n#define PNG_WRITE_INTERLACING_SUPPORTED\n#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED\n#define PNG_WRITE_INVERT_ALPHA_SUPPORTED\n#define PNG_WRITE_INVERT_SUPPORTED\n#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED\n#define PNG_WRITE_PACKSWAP_SUPPORTED\n#define PNG_WRITE_PACK_SUPPORTED\n#define PNG_WRITE_SHIFT_SUPPORTED\n#define PNG_WRITE_SUPPORTED\n#define PNG_WRITE_SWAP_ALPHA_SUPPORTED\n#define PNG_WRITE_SWAP_SUPPORTED\n#define PNG_WRITE_TEXT_SUPPORTED\n#define PNG_WRITE_TRANSFORMS_SUPPORTED\n#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED\n#define PNG_WRITE_USER_TRANSFORM_SUPPORTED\n#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED\n#define PNG_WRITE_bKGD_SUPPORTED\n#define PNG_WRITE_cHRM_SUPPORTED\n#define PNG_WRITE_gAMA_SUPPORTED\n#define PNG_WRITE_hIST_SUPPORTED\n#define PNG_WRITE_iCCP_SUPPORTED\n#define PNG_WRITE_iTXt_SUPPORTED\n#define PNG_WRITE_oFFs_SUPPORTED\n#define PNG_WRITE_pCAL_SUPPORTED\n#define PNG_WRITE_pHYs_SUPPORTED\n#define PNG_WRITE_sBIT_SUPPORTED\n#define PNG_WRITE_sCAL_SUPPORTED\n#define PNG_WRITE_sPLT_SUPPORTED\n#define PNG_WRITE_sRGB_SUPPORTED\n#define PNG_WRITE_tEXt_SUPPORTED\n#define PNG_WRITE_tIME_SUPPORTED\n#define PNG_WRITE_tRNS_SUPPORTED\n#define PNG_WRITE_zTXt_SUPPORTED\n#define PNG_bKGD_SUPPORTED\n#define PNG_cHRM_SUPPORTED\n#define PNG_gAMA_SUPPORTED\n#define PNG_hIST_SUPPORTED\n#define PNG_iCCP_SUPPORTED\n#define PNG_iTXt_SUPPORTED\n#define PNG_oFFs_SUPPORTED\n#define PNG_pCAL_SUPPORTED\n#define PNG_pHYs_SUPPORTED\n#define PNG_sBIT_SUPPORTED\n#define PNG_sCAL_SUPPORTED\n#define PNG_sPLT_SUPPORTED\n#define PNG_sRGB_SUPPORTED\n#define PNG_tEXt_SUPPORTED\n#define PNG_tIME_SUPPORTED\n#define PNG_tRNS_SUPPORTED\n#define PNG_zTXt_SUPPORTED\n/* end of options */\n/* settings */\n#define PNG_API_RULE 0\n#define PNG_CALLOC_SUPPORTED\n#define PNG_COST_SHIFT 3\n#define PNG_DEFAULT_READ_MACROS 1\n#define PNG_GAMMA_THRESHOLD_FIXED 5000\n#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE\n#define PNG_INFLATE_BUF_SIZE 1024\n#define PNG_MAX_GAMMA_8 11\n#define PNG_QUANTIZE_BLUE_BITS 5\n#define PNG_QUANTIZE_GREEN_BITS 5\n#define PNG_QUANTIZE_RED_BITS 5\n#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_TEXT_Z_DEFAULT_STRATEGY 0\n#define PNG_WEIGHT_SHIFT 8\n#define PNG_ZBUF_SIZE 8192\n#define PNG_Z_DEFAULT_COMPRESSION (-1)\n#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0\n#define PNG_Z_DEFAULT_STRATEGY 1\n#define PNG_sCAL_PRECISION 5\n#define PNG_sRGB_PROFILE_CHECKS 2\n/* end of settings */\n#endif /* PNGLCONF_H */\n"
  },
  {
    "path": "cocos2d/external/png/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE := cocos_png_static\nLOCAL_MODULE_FILENAME := png\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libpng.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/Anchor.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Anchor implementation. */\n\n#ifndef js_Anchor_h\n#define js_Anchor_h\n\n#include \"mozilla/Attributes.h\"\n\nclass JSFunction;\nclass JSObject;\nclass JSScript;\nclass JSString;\n\nnamespace JS { class Value; }\n\nnamespace JS {\n\n/*\n * Protecting non-Value, non-JSObject *, non-JSString * values from collection\n *\n * Most of the time, the garbage collector's conservative stack scanner works\n * behind the scenes, finding all live values and protecting them from being\n * collected. However, when JSAPI client code obtains a pointer to data the\n * scanner does not know about, owned by an object the scanner does know about,\n * Care Must Be Taken.\n *\n * The scanner recognizes only a select set of types: pointers to JSObjects and\n * similar things (JSFunctions, and so on), pointers to JSStrings, and Values.\n * So while the scanner finds all live |JSString| pointers, it does not notice\n * |jschar| pointers.\n *\n * So suppose we have:\n *\n *   void f(JSString *str) {\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * After the call to |JS_GetStringCharsZ|, there are no further uses of\n * |str|, which means that the compiler is within its rights to not store\n * it anywhere. But because the stack scanner will not notice |ch|, there\n * is no longer any live value in this frame that would keep the string\n * alive. If |str| is the last reference to that |JSString|, and the\n * collector runs while we are using |ch|, the string's array of |jschar|s\n * may be freed out from under us.\n *\n * Note that there is only an issue when 1) we extract a thing X the scanner\n * doesn't recognize from 2) a thing Y the scanner does recognize, and 3) if Y\n * gets garbage-collected, then X gets freed. If we have code like this:\n *\n *   void g(JSObject *obj) {\n *     JS::Value x;\n *     JS_GetProperty(obj, \"x\", &x);\n *     ... do stuff with x ...\n *   }\n *\n * there's no problem, because the value we've extracted, x, is a Value, a\n * type that the conservative scanner recognizes.\n *\n * Conservative GC frees us from the obligation to explicitly root the types it\n * knows about, but when we work with derived values like |ch|, we must root\n * their owners, as the derived value alone won't keep them alive.\n *\n * A JS::Anchor is a kind of GC root that allows us to keep the owners of\n * derived values like |ch| alive throughout the Anchor's lifetime. We could\n * fix the above code as follows:\n *\n *   void f(JSString *str) {\n *     JS::Anchor<JSString *> a_str(str);\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * This simply ensures that |str| will be live until |a_str| goes out of scope.\n * As long as we don't retain a pointer to the string's characters for longer\n * than that, we have avoided all garbage collection hazards.\n */\ntemplate<typename T> class AnchorPermitted;\ntemplate<> class AnchorPermitted<JSObject *> { };\ntemplate<> class AnchorPermitted<const JSObject *> { };\ntemplate<> class AnchorPermitted<JSFunction *> { };\ntemplate<> class AnchorPermitted<const JSFunction *> { };\ntemplate<> class AnchorPermitted<JSString *> { };\ntemplate<> class AnchorPermitted<const JSString *> { };\ntemplate<> class AnchorPermitted<Value> { };\ntemplate<> class AnchorPermitted<const JSScript *> { };\ntemplate<> class AnchorPermitted<JSScript *> { };\n\ntemplate<typename T>\nclass Anchor : AnchorPermitted<T>\n{\n  public:\n    Anchor() { }\n    explicit Anchor(T t) { hold = t; }\n    inline ~Anchor();\n    T &get() { return hold; }\n    const T &get() const { return hold; }\n    void set(const T &t) { hold = t; }\n    void operator=(const T &t) { hold = t; }\n    void clear() { hold = 0; }\n\n  private:\n    T hold;\n    Anchor(const Anchor &other) MOZ_DELETE;\n    void operator=(const Anchor &other) MOZ_DELETE;\n};\n\ntemplate<typename T>\ninline Anchor<T>::~Anchor()\n{\n#ifdef __GNUC__\n    /*\n     * No code is generated for this. But because this is marked 'volatile', G++ will\n     * assume it has important side-effects, and won't delete it. (G++ never looks at\n     * the actual text and notices it's empty.) And because we have passed |hold| to\n     * it, GCC will keep |hold| alive until this point.\n     *\n     * The \"memory\" clobber operand ensures that G++ will not move prior memory\n     * accesses after the asm --- it's a barrier. Unfortunately, it also means that\n     * G++ will assume that all memory has changed after the asm, as it would for a\n     * call to an unknown function. I don't know of a way to avoid that consequence.\n     */\n    asm volatile(\"\":: \"g\" (hold) : \"memory\");\n#else\n    /*\n     * An adequate portable substitute, for non-structure types.\n     *\n     * The compiler promises that, by the end of an expression statement, the\n     * last-stored value to a volatile object is the same as it would be in an\n     * unoptimized, direct implementation (the \"abstract machine\" whose behavior the\n     * language spec describes). However, the compiler is still free to reorder\n     * non-volatile accesses across this store --- which is what we must prevent. So\n     * assigning the held value to a volatile variable, as we do here, is not enough.\n     *\n     * In our case, however, garbage collection only occurs at function calls, so it\n     * is sufficient to ensure that the destructor's store isn't moved earlier across\n     * any function calls that could collect. It is hard to imagine the compiler\n     * analyzing the program so thoroughly that it could prove that such motion was\n     * safe. In practice, compilers treat calls to the collector as opaque operations\n     * --- in particular, as operations which could access volatile variables, across\n     * which this destructor must not be moved.\n     *\n     * (\"Objection, your honor!  *Alleged* killer whale!\")\n     *\n     * The disadvantage of this approach is that it does generate code for the store.\n     * We do need to use Anchors in some cases where cycles are tight.\n     *\n     * Note that there is a Anchor<Value>::~Anchor() specialization in Value.h.\n     */\n    volatile T sink;\n    sink = hold;\n#endif  /* defined(__GNUC__) */\n}\n\n} // namespace JS\n\n#endif /* js_Anchor_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/CallArgs.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Helper classes encapsulating access to the callee, |this| value, arguments,\n * and argument count for a function call.\n *\n * The intent of JS::CallArgs and JS::CallReceiver is that they be used to\n * encapsulate access to the un-abstracted |unsigned argc, Value *vp| arguments\n * to a function.  It's possible (albeit deprecated) to manually index into\n * |vp| to access the callee, |this|, and arguments of a function, and to set\n * its return value.  It's also possible to use the supported API of JS_CALLEE,\n * JS_THIS, JS_ARGV, JS_RVAL and JS_SET_RVAL to the same ends.  But neither API\n * has the error-handling or moving-GC correctness of CallArgs or CallReceiver.\n * New code should use CallArgs and CallReceiver instead whenever possible.\n *\n * The eventual plan is to change JSNative to take |const CallArgs&| directly,\n * for automatic assertion of correct use and to make calling functions more\n * efficient.  Embedders should start internally switching away from using\n * |argc| and |vp| directly, except to create a |CallArgs|.  Then, when an\n * eventual release making that change occurs, porting efforts will require\n * changing methods' signatures but won't require invasive changes to the\n * methods' implementations, potentially under time pressure.\n */\n\n#ifndef js_CallArgs_h\n#define js_CallArgs_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"jstypes.h\"\n\n#include \"js/RootingAPI.h\"\n#include \"js/Value.h\"\n\nstruct JSContext;\nclass JSObject;\n\n/* Typedef for native functions called by the JS VM. */\ntypedef JSBool\n(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);\n\n/* Typedef for native functions that may be called in parallel. */\ntypedef js::ParallelResult\n(* JSParallelNative)(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Typedef for native functions that may be called either in parallel or\n * sequential execution.\n */\ntypedef JSBool\n(* JSThreadSafeNative)(js::ThreadSafeContext *cx, unsigned argc, JS::Value *vp);\n\n/*\n * Convenience wrappers for passing in ThreadSafeNative to places that expect\n * a JSNative or a JSParallelNative.\n */\ntemplate <JSThreadSafeNative threadSafeNative>\ninline JSBool\nJSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp);\n\ntemplate <JSThreadSafeNative threadSafeNative>\ninline js::ParallelResult\nJSParallelNativeThreadSafeWrapper(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Compute |this| for the |vp| inside a JSNative, either boxing primitives or\n * replacing with the global object as necessary.\n *\n * This method will go away at some point: instead use |args.thisv()|.  If the\n * value is an object, no further work is required.  If that value is |null| or\n * |undefined|, use |JS_GetGlobalForObject| to compute the global object.  If\n * the value is some other primitive, use |JS_ValueToObject| to box it.\n */\nextern JS_PUBLIC_API(JS::Value)\nJS_ComputeThis(JSContext *cx, JS::Value *vp);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\n/*\n * JS::CallReceiver encapsulates access to the callee, |this|, and eventual\n * return value for a function call.  The principal way to create a\n * CallReceiver is using JS::CallReceiverFromVp:\n *\n *   static JSBool\n *   FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallReceiver rec = JS::CallReceiverFromVp(vp);\n *\n *       // Access to the callee must occur before accessing/setting\n *       // the return value.\n *       JSObject &callee = rec.callee();\n *       rec.rval().set(JS::ObjectValue(callee));\n *\n *       // callee() and calleev() will now assert.\n *\n *       // It's always fine to access thisv().\n *       HandleValue thisv = rec.thisv();\n *       rec.rval().set(thisv);\n *\n *       // As the return value was last set to |this|, returns |this|.\n *       return true;\n *   }\n *\n * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't\n * part of the CallReceiver interface.  We will likely add them at some point.\n * Until then, you should probably continue using |vp| directly for these two\n * cases.\n *\n * CallReceiver is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\n\nnamespace detail {\n\n#ifdef DEBUG\nextern JS_PUBLIC_API(void)\nCheckIsValidConstructible(Value v);\n#endif\n\nenum UsedRval { IncludeUsedRval, NoUsedRval };\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS UsedRvalBase;\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<IncludeUsedRval>\n{\n  protected:\n    mutable bool usedRval_;\n    void setUsedRval() const { usedRval_ = true; }\n    void clearUsedRval() const { usedRval_ = false; }\n};\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>\n{\n  protected:\n    void setUsedRval() const {}\n    void clearUsedRval() const {}\n};\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<\n#ifdef DEBUG\n        WantUsedRval\n#else\n        NoUsedRval\n#endif\n    >\n{\n  protected:\n    Value *argv_;\n\n  public:\n    /*\n     * Returns the function being called, as an object.  Must not be called\n     * after rval() has been used!\n     */\n    JSObject &callee() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return argv_[-2].toObject();\n    }\n\n    /*\n     * Returns the function being called, as a value.  Must not be called after\n     * rval() has been used!\n     */\n    HandleValue calleev() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return HandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n    /*\n     * Returns the |this| value passed to the function.  This method must not\n     * be called when the function is being called as a constructor via |new|.\n     * The value may or may not be an object: it is the individual function's\n     * responsibility to box the value if needed.\n     */\n    HandleValue thisv() const {\n        // Some internal code uses thisv() in constructing cases, so don't do\n        // this yet.\n        // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING));\n        return HandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n\n    Value computeThis(JSContext *cx) const {\n        if (thisv().isObject())\n            return thisv();\n\n        return JS_ComputeThis(cx, base());\n    }\n\n    bool isConstructing() const {\n#ifdef DEBUG\n        if (this->usedRval_)\n            CheckIsValidConstructible(calleev());\n#endif\n        return argv_[-1].isMagic();\n    }\n\n    /*\n     * Returns the currently-set return value.  The initial contents of this\n     * value are unspecified.  Once this method has been called, callee() and\n     * calleev() can no longer be used.  (If you're compiling against a debug\n     * build of SpiderMonkey, these methods will assert to aid debugging.)\n     *\n     * If the method you're implementing succeeds by returning true, you *must*\n     * set this.  (SpiderMonkey doesn't currently assert this, but it will do\n     * so eventually.)  You don't need to use or change this if your method\n     * fails.\n     */\n    MutableHandleValue rval() const {\n        this->setUsedRval();\n        return MutableHandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n  public:\n    // These methods are only intended for internal use.  Embedders shouldn't\n    // use them!\n\n    Value *base() const { return argv_ - 2; }\n\n    Value *spAfterCall() const {\n        this->setUsedRval();\n        return argv_ - 1;\n    }\n\n  public:\n    // These methods are publicly exposed, but they are *not* to be used when\n    // implementing a JSNative method and encapsulating access to |vp| within\n    // it.  You probably don't want to use these!\n\n    void setCallee(Value aCalleev) const {\n        this->clearUsedRval();\n        argv_[-2] = aCalleev;\n    }\n\n    void setThis(Value aThisv) const {\n        argv_[-1] = aThisv;\n    }\n\n    MutableHandleValue mutableThisv() const {\n        return MutableHandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallReceiver : public detail::CallReceiverBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallReceiver CallReceiverFromVp(Value *vp);\n    friend CallReceiver CallReceiverFromArgv(Value *argv);\n};\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromArgv(Value *argv)\n{\n    CallReceiver receiver;\n    receiver.clearUsedRval();\n    receiver.argv_ = argv;\n    return receiver;\n}\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromVp(Value *vp)\n{\n    return CallReceiverFromArgv(vp + 2);\n}\n\n/*\n * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to\n * the function call's arguments.  The principal way to create a CallArgs is\n * like so, using JS::CallArgsFromVp:\n *\n *   static JSBool\n *   FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *\n *       // Guard against no arguments or a non-numeric arg0.\n *       if (args.length() == 0 || !args[0].isNumber()) {\n *           args.rval().setInt32(0);\n *           return true;\n *       }\n *\n *       args.rval().set(JS::NumberValue(args.length() * args[0].toNumber()));\n *       return true;\n *   }\n *\n * CallArgs is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\nnamespace detail {\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallArgsBase :\n        public mozilla::Conditional<WantUsedRval == detail::IncludeUsedRval,\n                                    CallReceiver,\n                                    CallReceiverBase<NoUsedRval> >::Type\n{\n  protected:\n    unsigned argc_;\n\n  public:\n    /* Returns the number of arguments. */\n    unsigned length() const { return argc_; }\n\n    /* Returns the i-th zero-indexed argument. */\n    MutableHandleValue operator[](unsigned i) const {\n        MOZ_ASSERT(i < argc_);\n        return MutableHandleValue::fromMarkedLocation(&this->argv_[i]);\n    }\n\n    /*\n     * Returns the i-th zero-indexed argument, or |undefined| if there's no\n     * such argument.\n     */\n    HandleValue get(unsigned i) const {\n        return i < length()\n               ? HandleValue::fromMarkedLocation(&this->argv_[i])\n               : UndefinedHandleValue;\n    }\n\n    /*\n     * Returns true if the i-th zero-indexed argument is present and is not\n     * |undefined|.\n     */\n    bool hasDefined(unsigned i) const {\n        return i < argc_ && !this->argv_[i].isUndefined();\n    }\n\n  public:\n    // These methods are publicly exposed, but we're less sure of the interface\n    // here than we'd like (because they're hackish and drop assertions).  Try\n    // to avoid using these if you can.\n\n    Value *array() const { return this->argv_; }\n    Value *end() const { return this->argv_ + argc_; }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);\n    friend CallArgs CallArgsFromSp(unsigned argc, Value *sp);\n\n    static CallArgs create(unsigned argc, Value *argv) {\n        CallArgs args;\n        args.clearUsedRval();\n        args.argv_ = argv;\n        args.argc_ = argc;\n        return args;\n    }\n\n};\n\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromVp(unsigned argc, Value *vp)\n{\n    return CallArgs::create(argc, vp + 2);\n}\n\n// This method is only intended for internal use in SpiderMonkey.  We may\n// eventually move it to an internal header.  Embedders should use\n// JS::CallArgsFromVp!\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromSp(unsigned argc, Value *sp)\n{\n    return CallArgs::create(argc, sp - argc);\n}\n\n} // namespace JS\n\n/*\n * Macros to hide interpreter stack layout details from a JSNative using its\n * JS::Value *vp parameter.  DO NOT USE THESE!  Instead use JS::CallArgs and\n * friends, above.  These macros will be removed when we change JSNative to\n * take a const JS::CallArgs&.\n */\n\n#define JS_CALLEE(cx,vp)        ((vp)[0])\n#define JS_THIS_OBJECT(cx,vp)   (JSVAL_TO_OBJECT(JS_THIS(cx,vp)))\n#define JS_ARGV(cx,vp)          ((vp) + 2)\n#define JS_RVAL(cx,vp)          (*(vp))\n#define JS_SET_RVAL(cx,vp,v)    (*(vp) = (v))\n\n/*\n * Note: if this method returns null, an error has occurred and must be\n * propagated or caught.\n */\nMOZ_ALWAYS_INLINE JS::Value\nJS_THIS(JSContext *cx, JS::Value *vp)\n{\n    return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1];\n}\n\n/*\n * |this| is passed to functions in ES5 without change.  Functions themselves\n * do any post-processing they desire to box |this|, compute the global object,\n * &c.  This macro retrieves a function's unboxed |this| value.\n *\n * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT,\n * or vice versa.  Either use the provided this value with this macro, or\n * compute the boxed |this| value using those.  JS_THIS_VALUE must not be used\n * if the function is being called as a constructor.\n *\n * But: DO NOT USE THIS!  Instead use JS::CallArgs::thisv(), above.\n *\n */\n#define JS_THIS_VALUE(cx,vp)    ((vp)[1])\n\n#endif /* js_CallArgs_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/CharacterEncoding.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_CharacterEncoding_h\n#define js_CharacterEncoding_h\n\n#include \"mozilla/Range.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\nnamespace JS {\n\n/*\n * By default, all C/C++ 1-byte-per-character strings passed into the JSAPI\n * are treated as ISO/IEC 8859-1, also known as Latin-1. That is, each\n * byte is treated as a 2-byte character, and there is no way to pass in a\n * string containing characters beyond U+00FF.\n */\nclass Latin1Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    Latin1Chars() : Base() {}\n    Latin1Chars(char *aBytes, size_t aLength) : Base(reinterpret_cast<unsigned char *>(aBytes), aLength) {}\n    Latin1Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * A Latin1Chars, but with \\0 termination for C compatibility.\n */\nclass Latin1CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    Latin1CharsZ() : Base(NULL, 0) {}\n\n    Latin1CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    Latin1CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\nclass UTF8Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    UTF8Chars() : Base() {}\n    UTF8Chars(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {}\n    UTF8Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * SpiderMonkey also deals directly with UTF-8 encoded text in some places.\n */\nclass UTF8CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    UTF8CharsZ() : Base(NULL, 0) {}\n\n    UTF8CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    UTF8CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\n/*\n * SpiderMonkey uses a 2-byte character representation: it is a\n * 2-byte-at-a-time view of a UTF-16 byte stream. This is similar to UCS-2,\n * but unlike UCS-2, we do not strip UTF-16 extension bytes. This allows a\n * sufficiently dedicated JavaScript program to be fully unicode-aware by\n * manually interpreting UTF-16 extension characters embedded in the JS\n * string.\n */\nclass TwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    TwoByteChars() : Base() {}\n    TwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    TwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A non-convertible variant of TwoByteChars that does not refer to characters\n * inlined inside a JSShortString or a JSInlineString. StableTwoByteChars are\n * thus safe to hold across a GC.\n */\nclass StableTwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    StableTwoByteChars() : Base() {}\n    StableTwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    StableTwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A TwoByteChars, but \\0 terminated for compatibility with JSFlatString.\n */\nclass TwoByteCharsZ : public mozilla::RangedPtr<jschar>\n{\n    typedef mozilla::RangedPtr<jschar> Base;\n\n  public:\n    TwoByteCharsZ() : Base(NULL, 0) {}\n\n    TwoByteCharsZ(jschar *chars, size_t length)\n      : Base(chars, length)\n    {\n        JS_ASSERT(chars[length] == '\\0');\n    }\n};\n\n/*\n * Convert a 2-byte character sequence to \"ISO-Latin-1\". This works by\n * truncating each 2-byte pair in the sequence to a 1-byte pair. If the source\n * contains any UTF-16 extension characters, then this may give invalid Latin1\n * output. The returned string is zero terminated. The returned string or the\n * returned string's |start()| must be freed with JS_free or js_free,\n * respectively. If allocation fails, an OOM error will be set and the method\n * will return a NULL chars (which can be tested for with the ! operator).\n * This method cannot trigger GC.\n */\nextern Latin1CharsZ\nLossyTwoByteCharsToNewLatin1CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nextern UTF8CharsZ\nTwoByteCharsToNewUTF8CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nuint32_t\nUtf8ToOneUcs4Char(const uint8_t *utf8Buffer, int utf8Length);\n\n/*\n * Inflate bytes in UTF-8 encoding to jschars.\n * - On error, returns an empty TwoByteCharsZ.\n * - On success, returns a malloc'd TwoByteCharsZ, and updates |outlen| to hold\n *   its length;  the length value excludes the trailing null.\n */\nextern TwoByteCharsZ\nUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n/*\n * The same as UTF8CharsToNewTwoByteCharsZ(), except that any malformed UTF-8 characters\n * will be replaced by \\uFFFD. No exception will be thrown for malformed UTF-8\n * input.\n */\nextern TwoByteCharsZ\nLossyUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n} // namespace JS\n\ninline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); }\ninline void JS_free(JS::UTF8CharsZ &ptr) { js_free((void*)ptr.get()); }\n\n#endif /* js_CharacterEncoding_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/Date.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Date_h\n#define js_Date_h\n\n#include \"jstypes.h\"\n\nnamespace JS {\n\n// Year is a year, month is 0-11, day is 1-based.  The return value is\n// a number of milliseconds since the epoch.  Can return NaN.\nJS_PUBLIC_API(double)\nMakeDate(double year, unsigned month, unsigned day);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// year.  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nYearFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// month (0-11).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nMonthFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// day (1-based).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nDayFromTime(double time);\n\n} // namespace JS\n\n#endif /* js_Date_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/GCAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_GCAPI_h\n#define js_GCAPI_h\n\n#include \"js/HeapAPI.h\"\n\nnamespace JS {\n\n#define GCREASONS(D)                            \\\n    /* Reasons internal to the JS engine */     \\\n    D(API)                                      \\\n    D(MAYBEGC)                                  \\\n    D(LAST_CONTEXT)                             \\\n    D(DESTROY_CONTEXT)                          \\\n    D(LAST_DITCH)                               \\\n    D(TOO_MUCH_MALLOC)                          \\\n    D(ALLOC_TRIGGER)                            \\\n    D(DEBUG_GC)                                 \\\n    D(DEBUG_MODE_GC)                            \\\n    D(TRANSPLANT)                               \\\n    D(RESET)                                    \\\n    D(OUT_OF_NURSERY)                           \\\n    D(EVICT_NURSERY)                            \\\n    D(FULL_STORE_BUFFER)                        \\\n                                                \\\n    /* These are reserved for future use. */    \\\n    D(RESERVED0)                                \\\n    D(RESERVED1)                                \\\n    D(RESERVED2)                                \\\n    D(RESERVED3)                                \\\n    D(RESERVED4)                                \\\n    D(RESERVED5)                                \\\n    D(RESERVED6)                                \\\n    D(RESERVED7)                                \\\n    D(RESERVED8)                                \\\n    D(RESERVED9)                                \\\n    D(RESERVED10)                               \\\n    D(RESERVED11)                               \\\n    D(RESERVED12)                               \\\n    D(RESERVED13)                               \\\n    D(RESERVED14)                               \\\n    D(RESERVED15)                               \\\n    D(RESERVED16)                               \\\n    D(RESERVED17)                               \\\n    D(RESERVED18)                               \\\n    D(RESERVED19)                               \\\n                                                \\\n    /* Reasons from Firefox */                  \\\n    D(DOM_WINDOW_UTILS)                         \\\n    D(COMPONENT_UTILS)                          \\\n    D(MEM_PRESSURE)                             \\\n    D(CC_WAITING)                               \\\n    D(CC_FORCED)                                \\\n    D(LOAD_END)                                 \\\n    D(POST_COMPARTMENT)                         \\\n    D(PAGE_HIDE)                                \\\n    D(NSJSCONTEXT_DESTROY)                      \\\n    D(SET_NEW_DOCUMENT)                         \\\n    D(SET_DOC_SHELL)                            \\\n    D(DOM_UTILS)                                \\\n    D(DOM_IPC)                                  \\\n    D(DOM_WORKER)                               \\\n    D(INTER_SLICE_GC)                           \\\n    D(REFRESH_FRAME)                            \\\n    D(FULL_GC_TIMER)                            \\\n    D(SHUTDOWN_CC)                              \\\n    D(FINISH_LARGE_EVALUTE)\n\nnamespace gcreason {\n\n/* GCReasons will end up looking like JSGC_MAYBEGC */\nenum Reason {\n#define MAKE_REASON(name) name,\n    GCREASONS(MAKE_REASON)\n#undef MAKE_REASON\n    NO_REASON,\n    NUM_REASONS,\n\n    /*\n     * For telemetry, we want to keep a fixed max bucket size over time so we\n     * don't have to switch histograms. 100 is conservative; as of this writing\n     * there are 26. But the cost of extra buckets seems to be low while the\n     * cost of switching histograms is high.\n     */\n    NUM_TELEMETRY_REASONS = 100\n};\n\n} /* namespace gcreason */\n\nextern JS_FRIEND_API(void)\nPrepareZoneForGC(Zone *zone);\n\nextern JS_FRIEND_API(void)\nPrepareForFullGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nPrepareForIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsGCScheduled(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nSkipZoneForGC(Zone *zone);\n\n/*\n * When triggering a GC using one of the functions below, it is first necessary\n * to select the compartments to be collected. To do this, you can call\n * PrepareZoneForGC on each compartment, or you can call PrepareForFullGC\n * to select all compartments. Failing to select any compartment is an error.\n */\n\nextern JS_FRIEND_API(void)\nGCForReason(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkingGC(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkGCBuffers(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nIncrementalGC(JSRuntime *rt, gcreason::Reason reason, int64_t millis = 0);\n\nextern JS_FRIEND_API(void)\nFinishIncrementalGC(JSRuntime *rt, gcreason::Reason reason);\n\nenum GCProgress {\n    /*\n     * During non-incremental GC, the GC is bracketed by JSGC_CYCLE_BEGIN/END\n     * callbacks. During an incremental GC, the sequence of callbacks is as\n     * follows:\n     *   JSGC_CYCLE_BEGIN, JSGC_SLICE_END  (first slice)\n     *   JSGC_SLICE_BEGIN, JSGC_SLICE_END  (second slice)\n     *   ...\n     *   JSGC_SLICE_BEGIN, JSGC_CYCLE_END  (last slice)\n     */\n\n    GC_CYCLE_BEGIN,\n    GC_SLICE_BEGIN,\n    GC_SLICE_END,\n    GC_CYCLE_END\n};\n\nstruct JS_FRIEND_API(GCDescription) {\n    bool isCompartment_;\n\n    GCDescription(bool isCompartment)\n      : isCompartment_(isCompartment) {}\n\n    jschar *formatMessage(JSRuntime *rt) const;\n    jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;\n};\n\ntypedef void\n(* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);\n\nextern JS_FRIEND_API(GCSliceCallback)\nSetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback);\n\n/*\n * Signals a good place to do an incremental slice, because the browser is\n * drawing a frame.\n */\nextern JS_FRIEND_API(void)\nNotifyDidPaint(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalGCEnabled(JSRuntime *rt);\n\nJS_FRIEND_API(bool)\nIsIncrementalGCInProgress(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nEnableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSContext *cx);\n\nextern JS_FRIEND_API(void)\nIncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind);\n\nextern JS_FRIEND_API(void)\nIncrementalValueBarrier(const Value &v);\n\nextern JS_FRIEND_API(void)\nIncrementalObjectBarrier(JSObject *obj);\n\nextern JS_FRIEND_API(void)\nPokeGC(JSRuntime *rt);\n\n/* Was the most recent GC run incrementally? */\nextern JS_FRIEND_API(bool)\nWasIncrementalGC(JSRuntime *rt);\n\nclass ObjectPtr\n{\n    Heap<JSObject *> value;\n\n  public:\n    ObjectPtr() : value(NULL) {}\n\n    ObjectPtr(JSObject *obj) : value(obj) {}\n\n    /* Always call finalize before the destructor. */\n    ~ObjectPtr() { JS_ASSERT(!value); }\n\n    void finalize(JSRuntime *rt) {\n        if (IsIncrementalBarrierNeeded(rt))\n            IncrementalObjectBarrier(value);\n        value = NULL;\n    }\n\n    void init(JSObject *obj) { value = obj; }\n\n    JSObject *get() const { return value; }\n\n    void writeBarrierPre(JSRuntime *rt) {\n        IncrementalObjectBarrier(value);\n    }\n\n    bool isAboutToBeFinalized() {\n        return JS_IsAboutToBeFinalized(&value);\n    }\n\n    ObjectPtr &operator=(JSObject *obj) {\n        IncrementalObjectBarrier(value);\n        value = obj;\n        return *this;\n    }\n\n    void trace(JSTracer *trc, const char *name) {\n        JS_CallHeapObjectTracer(trc, &value, name);\n    }\n\n    JSObject &operator*() const { return *value; }\n    JSObject *operator->() const { return value; }\n    operator JSObject *() const { return value; }\n};\n\n/*\n * Unsets the gray bit for anything reachable from |thing|. |kind| should not be\n * JSTRACE_SHAPE. |thing| should be non-null.\n */\nextern JS_FRIEND_API(void)\nUnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);\n\n/*\n * This should be called when an object that is marked gray is exposed to the JS\n * engine (by handing it to running JS code or writing it into live JS\n * data). During incremental GC, since the gray bits haven't been computed yet,\n * we conservatively mark the object black.\n */\nstatic JS_ALWAYS_INLINE void\nExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)\n{\n    JS_ASSERT(kind != JSTRACE_SHAPE);\n\n    shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);\n#ifdef JSGC_GENERATIONAL\n    /*\n     * GC things residing in the nursery cannot be gray: they have no mark bits.\n     * All live objects in the nursery are moved to tenured at the beginning of\n     * each GC slice, so the gray marker never sees nursery things.\n     */\n    if (uintptr_t(thing) >= rt->gcNurseryStart_ && uintptr_t(thing) < rt->gcNurseryEnd_)\n        return;\n#endif\n    if (IsIncrementalBarrierNeededOnGCThing(rt, thing, kind))\n        IncrementalReferenceBarrier(thing, kind);\n    else if (GCThingIsMarkedGray(thing))\n        UnmarkGrayGCThingRecursively(thing, kind);\n}\n\nstatic JS_ALWAYS_INLINE void\nExposeValueToActiveJS(const Value &v)\n{\n    if (v.isMarkable())\n        ExposeGCThingToActiveJS(v.toGCThing(), v.gcKind());\n}\n\n} /* namespace JS */\n\n#endif /* js_GCAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/HashTable.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HashTable_h\n#define js_HashTable_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/PodOperations.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js/Utility.h\"\n\nnamespace js {\n\nclass TempAllocPolicy;\ntemplate <class> struct DefaultHasher;\ntemplate <class, class> class HashMapEntry;\nnamespace detail {\n    template <class T> class HashTableEntry;\n    template <class T, class HashPolicy, class AllocPolicy> class HashTable;\n}\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based map from keys to\n// values. In particular, HashMap calls constructors and destructors of all\n// objects added so non-PODs may be used safely.\n//\n// Key/Value requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members\n//   called by HashMap must not call back into the same HashMap object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class Key,\n          class Value,\n          class HashPolicy = DefaultHasher<Key>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashMap\n{\n    typedef HashMapEntry<Key, Value> TableEntry;\n\n    struct MapHashPolicy : HashPolicy\n    {\n        typedef Key KeyType;\n        static const Key &getKey(TableEntry &e) { return e.key; }\n        static void setKey(TableEntry &e, Key &k) { const_cast<Key &>(e.key) = k; }\n    };\n\n    typedef detail::HashTable<TableEntry, MapHashPolicy, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef TableEntry Entry;\n\n    // HashMap construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashMap and check the return value.\n    HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   if (HM::Ptr p = h.lookup(3)) {\n    //     const HM::Entry &e = *p; // p acts like a pointer to Entry\n    //     assert(p->key == 3);     // Entry contains the key\n    //     char val = p->value;     // and value\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above (with T = Entry).\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Like lookup, but does not assert if two threads call lookup at the same\n    // time. Only use this method when none of the threads will modify the map.\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const { return impl.readonlyThreadsafeLookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of Key |k| (where |HashPolicy::match(k,l) == true|) using\n    // |add(p,k,v)|. After |add(p,k,v)|, |p| points to the new Entry. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   HM::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3, 'a'))\n    //       return false;\n    //   }\n    //   const HM::Entry &e = *p;   // p acts like a pointer to Entry\n    //   assert(p->key == 3);       // Entry contains the key\n    //   char val = p->value;       // and value\n    //\n    // Also see the definition of AddPtr in HashTable above (with T = Entry).\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HM::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 'a'))\n    //        return false;\n    //    }\n    //    const HM::Entry &e = *p;\n    //    assert(p->key == 3);\n    //    char val = p->value;\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return impl.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        Entry e(k, Value());\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.relookupOrAdd(p, k, mozilla::Move(e));\n    }\n\n    // |all()| returns a Range containing |count()| elements. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   for (HM::Range r = h.all(); !r.empty(); r.popFront())\n    //     char c = r.front().value;\n    //\n    // Also see the definition of Range in HashTable above (with T = Entry).\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM s;\n    //   for (HM::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front().value == 'l')\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above (with T = Entry).\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all entries without triggering destructors. This method is unsafe.\n    void clearWithoutCallingDestructors()             { impl.clearWithoutCallingDestructors(); }\n\n    // Remove all the entries and release all internal buffers. The map must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashMap.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashMap operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        AddPtr p = lookupForAdd(k);\n        if (p) {\n            p->value = v;\n            return true;\n        }\n        return add(p, k, v);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.putNew(k, mozilla::Move(e));\n    }\n\n    // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom.\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        AddPtr p = lookupForAdd(k);\n        if (p)\n            return p;\n        (void)add(p, k, defaultValue);  // p is left false-y on oom.\n        return p;\n    }\n\n    // Remove if present.\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const Key &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashMap is movable\n    HashMap(mozilla::MoveRef<HashMap> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashMap> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashMap is not copyable or assignable\n    HashMap(const HashMap &hm) MOZ_DELETE;\n    HashMap &operator=(const HashMap &hm) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based set of values. In\n// particular, HashSet calls constructors and destructors of all objects added\n// so non-PODs may be used safely.\n//\n// T requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashSet is not reentrant: T/HashPolicy/AllocPolicy members called by\n//   HashSet must not call back into the same HashSet object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class T,\n          class HashPolicy = DefaultHasher<T>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashSet\n{\n    struct SetOps : HashPolicy\n    {\n        typedef T KeyType;\n        static const KeyType &getKey(const T &t) { return t; }\n        static void setKey(T &t, KeyType &k) { t = k; }\n    };\n\n    typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef T Entry;\n\n    // HashSet construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashSet and check the return value.\n    HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   if (HS::Ptr p = h.lookup(3)) {\n    //     assert(*p == 3);   // p acts like a pointer to int\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above.\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of T value |t| (where |HashPolicy::match(t,l) == true|) using\n    // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   HS::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3))\n    //       return false;\n    //   }\n    //   assert(*p == 3);   // p acts like a pointer to int\n    //\n    // Also see the definition of AddPtr in HashTable above.\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HS::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 3))\n    //        return false;\n    //    }\n    //    assert(*p == 3);\n    //\n    // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the\n    // entry |t|, where the caller ensures match(l,t).\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const        { return impl.lookupForAdd(l); }\n\n    bool add(AddPtr &p, const T &t)                   { return impl.add(p, t); }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return impl.relookupOrAdd(p, l, t);\n    }\n\n    // |all()| returns a Range containing |count()| elements:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   for (HS::Range r = h.all(); !r.empty(); r.popFront())\n    //     int i = r.front();\n    //\n    // Also see the definition of Range in HashTable above.\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS s;\n    //   for (HS::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front() == 42)\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above.\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all the entries and release all internal buffers. The set must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashSet.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashSet operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    bool put(const T &t) {\n        AddPtr p = lookupForAdd(t);\n        return p ? true : add(p, t);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    bool putNew(const T &t) {\n        return impl.putNew(t, t);\n    }\n\n    bool putNew(const Lookup &l, const T &t) {\n        return impl.putNew(l, t);\n    }\n\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const T &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashSet is movable\n    HashSet(mozilla::MoveRef<HashSet> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashSet> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashSet is not copyable or assignable\n    HashSet(const HashSet &hs) MOZ_DELETE;\n    HashSet &operator=(const HashSet &hs) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// Hash Policy\n//\n// A hash policy P for a hash table with key-type Key must provide:\n//  - a type |P::Lookup| to use to lookup table entries;\n//  - a static member function |P::hash| with signature\n//\n//      static js::HashNumber hash(Lookup)\n//\n//    to use to hash the lookup type; and\n//  - a static member function |P::match| with signature\n//\n//      static bool match(Key, Lookup)\n//\n//    to use to test equality of key and lookup values.\n//\n// Normally, Lookup = Key. In general, though, different values and types of\n// values can be used to lookup and store. If a Lookup value |l| is != to the\n// added Key value |k|, the user must ensure that |P::match(k,l)|. E.g.:\n//\n//   js::HashSet<Key, P>::AddPtr p = h.lookup(l);\n//   if (!p) {\n//     assert(P::match(k, l));  // must hold\n//     h.add(p, k);\n//   }\n\n// Pointer hashing policy that strips the lowest zeroBits when calculating the\n// hash to improve key distribution.\ntemplate <typename Key, size_t zeroBits>\nstruct PointerHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        size_t word = reinterpret_cast<size_t>(l) >> zeroBits;\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n#if JS_BYTES_PER_WORD == 4\n        return HashNumber(word);\n#else\n        JS_STATIC_ASSERT(sizeof word == 8);\n        return HashNumber((word >> 32) ^ word);\n#endif\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(k));\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        return k == l;\n    }\n};\n\n// Default hash policy: just use the 'lookup' value. This of course only\n// works if the lookup value is integral. HashTable applies ScrambleHashCode to\n// the result of the 'hash' which means that it is 'ok' if the lookup value is\n// not well distributed over the HashNumber domain.\ntemplate <class Key>\nstruct DefaultHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        // Hash if can implicitly cast to hash number type.\n        return l;\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        // Use builtin or overloaded operator==.\n        return k == l;\n    }\n};\n\n// Specialize hashing policy for pointer types. It assumes that the type is\n// at least word-aligned. For types with smaller size use PointerHasher.\ntemplate <class T>\nstruct DefaultHasher<T *> : PointerHasher<T *, mozilla::tl::FloorLog2<sizeof(void *)>::value>\n{};\n\n// For doubles, we can xor the two uint32s.\ntemplate <>\nstruct DefaultHasher<double>\n{\n    typedef double Lookup;\n    static HashNumber hash(double d) {\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n        uint64_t u = mozilla::BitwiseCast<uint64_t>(d);\n        return HashNumber(u ^ (u >> 32));\n    }\n    static bool match(double lhs, double rhs) {\n        return mozilla::BitwiseCast<uint64_t>(lhs) == mozilla::BitwiseCast<uint64_t>(rhs);\n    }\n};\n\n/*****************************************************************************/\n\n// Both HashMap and HashSet are implemented by a single HashTable that is even\n// more heavily parameterized than the other two. This leaves HashTable gnarly\n// and extremely coupled to HashMap and HashSet; thus code should not use\n// HashTable directly.\n\ntemplate <class Key, class Value>\nclass HashMapEntry\n{\n    template <class, class, class> friend class detail::HashTable;\n    template <class> friend class detail::HashTableEntry;\n\n    HashMapEntry(const HashMapEntry &) MOZ_DELETE;\n    void operator=(const HashMapEntry &) MOZ_DELETE;\n\n  public:\n    template<typename KeyInput, typename ValueInput>\n    HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {}\n\n    HashMapEntry(mozilla::MoveRef<HashMapEntry> rhs)\n      : key(mozilla::Move(rhs->key)), value(mozilla::Move(rhs->value)) { }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n\n    const Key key;\n    Value value;\n};\n\n} // namespace js\n\nnamespace mozilla {\n\ntemplate <typename T>\nstruct IsPod<js::detail::HashTableEntry<T> > : IsPod<T> {};\n\ntemplate <typename K, typename V>\nstruct IsPod<js::HashMapEntry<K, V> >\n  : IntegralConstant<bool, IsPod<K>::value && IsPod<V>::value>\n{};\n\n} // namespace mozilla\n\nnamespace js {\n\nnamespace detail {\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable;\n\ntemplate <class T>\nclass HashTableEntry\n{\n    template <class, class, class> friend class HashTable;\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n\n    HashNumber keyHash;\n    mozilla::AlignedStorage2<NonConstT> mem;\n\n    static const HashNumber sFreeKey = 0;\n    static const HashNumber sRemovedKey = 1;\n    static const HashNumber sCollisionBit = 1;\n\n    // Assumed by calloc in createTable.\n    JS_STATIC_ASSERT(sFreeKey == 0);\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return hash > sRemovedKey;\n    }\n\n    HashTableEntry(const HashTableEntry &) MOZ_DELETE;\n    void operator=(const HashTableEntry &) MOZ_DELETE;\n    ~HashTableEntry() MOZ_DELETE;\n\n  public:\n    // NB: HashTableEntry is treated as a POD: no constructor or destructor calls.\n\n    void destroyIfLive() {\n        if (isLive())\n            mem.addr()->~T();\n    }\n\n    void destroy() {\n        JS_ASSERT(isLive());\n        mem.addr()->~T();\n    }\n\n    void swap(HashTableEntry *other) {\n        mozilla::Swap(keyHash, other->keyHash);\n        mozilla::Swap(mem, other->mem);\n    }\n\n    T &get() { JS_ASSERT(isLive()); return *mem.addr(); }\n\n    bool isFree() const    { return keyHash == sFreeKey; }\n    void clearLive()       { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }\n    void clear()           { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }\n    bool isRemoved() const { return keyHash == sRemovedKey; }\n    void removeLive()      { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }\n    bool isLive() const    { return isLiveHash(keyHash); }\n    void setCollision()               { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }\n    void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }\n    void unsetCollision()             { keyHash &= ~sCollisionBit; }\n    bool hasCollision() const         { return keyHash & sCollisionBit; }\n    bool matchHash(HashNumber hn)     { return (keyHash & ~sCollisionBit) == hn; }\n    HashNumber getKeyHash() const     { return keyHash & ~sCollisionBit; }\n\n    template <class U>\n    void setLive(HashNumber hn, const U &u)\n    {\n        JS_ASSERT(!isLive());\n        keyHash = hn;\n        new(mem.addr()) T(u);\n        JS_ASSERT(isLive());\n    }\n};\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable : private AllocPolicy\n{\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n    typedef typename HashPolicy::KeyType Key;\n    typedef typename HashPolicy::Lookup Lookup;\n\n  public:\n    typedef HashTableEntry<T> Entry;\n\n    // A nullable pointer to a hash table element. A Ptr |p| can be tested\n    // either explicitly |if (p.found()) p->...| or using boolean conversion\n    // |if (p) p->...|. Ptr objects must not be used after any mutating hash\n    // table operations unless |generation()| is tested.\n    class Ptr\n    {\n        friend class HashTable;\n        typedef void (Ptr::* ConvertibleToBool)();\n        void nonNull() {}\n\n        Entry *entry_;\n\n      protected:\n        Ptr(Entry &entry) : entry_(&entry) {}\n\n      public:\n        // Leaves Ptr uninitialized.\n        Ptr() {\n#ifdef DEBUG\n            entry_ = (Entry *)0xbad;\n#endif\n        }\n\n        bool found() const                    { return entry_->isLive(); }\n        operator ConvertibleToBool() const    { return found() ? &Ptr::nonNull : 0; }\n        bool operator==(const Ptr &rhs) const { JS_ASSERT(found() && rhs.found()); return entry_ == rhs.entry_; }\n        bool operator!=(const Ptr &rhs) const { return !(*this == rhs); }\n\n        T &operator*() const                  { return entry_->get(); }\n        T *operator->() const                 { return &entry_->get(); }\n    };\n\n    // A Ptr that can be used to add a key after a failed lookup.\n    class AddPtr : public Ptr\n    {\n        friend class HashTable;\n        HashNumber keyHash;\n        mozilla::DebugOnly<uint64_t> mutationCount;\n\n        AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}\n      public:\n        // Leaves AddPtr uninitialized.\n        AddPtr() {}\n    };\n\n    // A collection of hash table entries. The collection is enumerated by\n    // calling |front()| followed by |popFront()| as long as |!empty()|. As\n    // with Ptr/AddPtr, Range objects must not be used after any mutating hash\n    // table operation unless the |generation()| is tested.\n    class Range\n    {\n      protected:\n        friend class HashTable;\n\n        Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) {\n            while (cur < end && !cur->isLive())\n                ++cur;\n        }\n\n        Entry *cur, *end;\n        mozilla::DebugOnly<bool> validEntry;\n\n      public:\n        Range() : cur(NULL), end(NULL), validEntry(false) {}\n\n        bool empty() const {\n            return cur == end;\n        }\n\n        T &front() const {\n            JS_ASSERT(validEntry);\n            JS_ASSERT(!empty());\n            return cur->get();\n        }\n\n        void popFront() {\n            JS_ASSERT(!empty());\n            while (++cur < end && !cur->isLive())\n                continue;\n            validEntry = true;\n        }\n    };\n\n    // A Range whose lifetime delimits a mutating enumeration of a hash table.\n    // Since rehashing when elements were removed during enumeration would be\n    // bad, it is postponed until the Enum is destructed.  Since the Enum's\n    // destructor touches the hash table, the user must ensure that the hash\n    // table is still alive when the destructor runs.\n    class Enum : public Range\n    {\n        friend class HashTable;\n\n        HashTable &table;\n        bool rekeyed;\n        bool removed;\n\n        /* Not copyable. */\n        Enum(const Enum &);\n        void operator=(const Enum &);\n\n      public:\n        template<class Map> explicit\n        Enum(Map &map) : Range(map.all()), table(map.impl), rekeyed(false), removed(false) {}\n\n        // Removes the |front()| element from the table, leaving |front()|\n        // invalid until the next call to |popFront()|. For example:\n        //\n        //   HashSet<int> s;\n        //   for (HashSet<int>::Enum e(s); !e.empty(); e.popFront())\n        //     if (e.front() == 42)\n        //       e.removeFront();\n        void removeFront() {\n            table.remove(*this->cur);\n            removed = true;\n            this->validEntry = false;\n        }\n\n        // Removes the |front()| element and re-inserts it into the table with\n        // a new key at the new Lookup position.  |front()| is invalid after\n        // this operation until the next call to |popFront()|.\n        void rekeyFront(const Lookup &l, const Key &k) {\n            table.rekey(*this->cur, l, k);\n            rekeyed = true;\n            this->validEntry = false;\n        }\n\n        void rekeyFront(const Key &k) {\n            rekeyFront(k, k);\n        }\n\n        // Potentially rehashes the table.\n        ~Enum() {\n            if (rekeyed) {\n                table.gen++;\n                table.checkOverRemoved();\n            }\n\n            if (removed)\n                table.compactIfUnderloaded();\n        }\n    };\n\n    // HashTable is movable\n    HashTable(mozilla::MoveRef<HashTable> rhs)\n      : AllocPolicy(*rhs)\n    {\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n    void operator=(mozilla::MoveRef<HashTable> rhs) {\n        if (table)\n            destroyTable(*this, table, capacity());\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n\n  private:\n    // HashTable is not copyable or assignable\n    HashTable(const HashTable &) MOZ_DELETE;\n    void operator=(const HashTable &) MOZ_DELETE;\n\n  private:\n    uint32_t    hashShift;      // multiplicative hash shift\n    uint32_t    entryCount;     // number of entries in table\n    uint32_t    gen;            // entry storage generation number\n    uint32_t    removedCount;   // removed entry sentinels in table\n    Entry       *table;         // entry storage\n\n    void setTableSizeLog2(unsigned sizeLog2)\n    {\n        hashShift = sHashBits - sizeLog2;\n    }\n\n#ifdef DEBUG\n    mutable struct Stats\n    {\n        uint32_t        searches;       // total number of table searches\n        uint32_t        steps;          // hash chain links traversed\n        uint32_t        hits;           // searches that found key\n        uint32_t        misses;         // searches that didn't find key\n        uint32_t        addOverRemoved; // adds that recycled a removed entry\n        uint32_t        removes;        // calls to remove\n        uint32_t        removeFrees;    // calls to remove that freed the entry\n        uint32_t        grows;          // table expansions\n        uint32_t        shrinks;        // table contractions\n        uint32_t        compresses;     // table compressions\n        uint32_t        rehashes;       // tombstone decontaminations\n    } stats;\n#   define METER(x) x\n#else\n#   define METER(x)\n#endif\n\n    friend class mozilla::ReentrancyGuard;\n    mutable mozilla::DebugOnly<bool> entered;\n    mozilla::DebugOnly<uint64_t>     mutationCount;\n\n    // The default initial capacity is 32 (enough to hold 16 elements), but it\n    // can be as low as 4.\n    static const unsigned sMinCapacityLog2 = 2;\n    static const unsigned sMinCapacity  = 1 << sMinCapacityLog2;\n    static const unsigned sMaxInit      = JS_BIT(23);\n    static const unsigned sMaxCapacity  = JS_BIT(24);\n    static const unsigned sHashBits     = mozilla::tl::BitSize<HashNumber>::value;\n    static const uint8_t  sMinAlphaFrac = 64;  // (0x100 * .25)\n    static const uint8_t  sMaxAlphaFrac = 192; // (0x100 * .75)\n    static const uint8_t  sInvMaxAlpha  = 171; // (ceil(0x100 / .75) >> 1)\n    static const HashNumber sFreeKey = Entry::sFreeKey;\n    static const HashNumber sRemovedKey = Entry::sRemovedKey;\n    static const HashNumber sCollisionBit = Entry::sCollisionBit;\n\n    static void staticAsserts()\n    {\n        // Rely on compiler \"constant overflow warnings\".\n        JS_STATIC_ASSERT(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity);\n        JS_STATIC_ASSERT((sMaxCapacity * sInvMaxAlpha) <= UINT32_MAX);\n        JS_STATIC_ASSERT((sMaxCapacity * sizeof(Entry)) <= UINT32_MAX);\n    }\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return Entry::isLiveHash(hash);\n    }\n\n    static HashNumber prepareHash(const Lookup& l)\n    {\n        HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l));\n\n        // Avoid reserved hash codes.\n        if (!isLiveHash(keyHash))\n            keyHash -= (sRemovedKey + 1);\n        return keyHash & ~sCollisionBit;\n    }\n\n    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)\n    {\n        // See JS_STATIC_ASSERT(sFreeKey == 0) in HashTableEntry.\n        return (Entry *)alloc.calloc_(capacity * sizeof(Entry));\n    }\n\n    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)\n    {\n        for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)\n            e->destroyIfLive();\n        alloc.free_(oldTable);\n    }\n\n  public:\n    HashTable(AllocPolicy ap)\n      : AllocPolicy(ap),\n        hashShift(sHashBits),\n        entryCount(0),\n        gen(0),\n        removedCount(0),\n        table(NULL),\n        entered(false),\n        mutationCount(0)\n    {}\n\n    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)\n    {\n        JS_ASSERT(!initialized());\n\n        // Correct for sMaxAlphaFrac such that the table will not resize\n        // when adding 'length' entries.\n        if (length > sMaxInit) {\n            this->reportAllocOverflow();\n            return false;\n        }\n        uint32_t newCapacity = (length * sInvMaxAlpha) >> 7;\n\n        if (newCapacity < sMinCapacity)\n            newCapacity = sMinCapacity;\n\n        // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034).\n        uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2;\n        while (roundUp < newCapacity) {\n            roundUp <<= 1;\n            ++roundUpLog2;\n        }\n\n        newCapacity = roundUp;\n        JS_ASSERT(newCapacity <= sMaxCapacity);\n\n        table = createTable(*this, newCapacity);\n        if (!table)\n            return false;\n\n        setTableSizeLog2(roundUpLog2);\n        METER(memset(&stats, 0, sizeof(stats)));\n        return true;\n    }\n\n    bool initialized() const\n    {\n        return !!table;\n    }\n\n    ~HashTable()\n    {\n        if (table)\n            destroyTable(*this, table, capacity());\n    }\n\n  private:\n    HashNumber hash1(HashNumber hash0) const\n    {\n        return hash0 >> hashShift;\n    }\n\n    struct DoubleHash\n    {\n        HashNumber h2;\n        HashNumber sizeMask;\n    };\n\n    DoubleHash hash2(HashNumber curKeyHash) const\n    {\n        unsigned sizeLog2 = sHashBits - hashShift;\n        DoubleHash dh = {\n            ((curKeyHash << sizeLog2) >> hashShift) | 1,\n            (HashNumber(1) << sizeLog2) - 1\n        };\n        return dh;\n    }\n\n    static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh)\n    {\n        return (h1 - dh.h2) & dh.sizeMask;\n    }\n\n    bool overloaded()\n    {\n        return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);\n    }\n\n    // Would the table be underloaded if it had the given capacity and entryCount?\n    static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount)\n    {\n        return capacity > sMinCapacity && entryCount <= ((sMinAlphaFrac * capacity) >> 8);\n    }\n\n    bool underloaded()\n    {\n        return wouldBeUnderloaded(capacity(), entryCount);\n    }\n\n    static bool match(Entry &e, const Lookup &l)\n    {\n        return HashPolicy::match(HashPolicy::getKey(e.get()), l);\n    }\n\n    Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const\n    {\n        JS_ASSERT(isLiveHash(keyHash));\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (entry->isFree()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Hit: return entry.\n        if (entry->matchHash(keyHash) && match(*entry, l)) {\n            METER(stats.hits++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        // Save the first removed entry pointer so we can recycle later.\n        Entry *firstRemoved = NULL;\n\n        while(true) {\n            if (JS_UNLIKELY(entry->isRemoved())) {\n                if (!firstRemoved)\n                    firstRemoved = entry;\n            } else {\n                entry->setCollision(collisionBit);\n            }\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (entry->isFree()) {\n                METER(stats.misses++);\n                return firstRemoved ? *firstRemoved : *entry;\n            }\n\n            if (entry->matchHash(keyHash) && match(*entry, l)) {\n                METER(stats.hits++);\n                return *entry;\n            }\n        }\n    }\n\n    // This is a copy of lookup hardcoded to the assumptions:\n    //   1. the lookup is a lookupForAdd\n    //   2. the key, whose |keyHash| has been passed is not in the table,\n    //   3. no entries have been removed from the table.\n    // This specialized search avoids the need for recovering lookup values\n    // from entries, which allows more flexible Lookup/Key types.\n    Entry &findFreeEntry(HashNumber keyHash)\n    {\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // We assume 'keyHash' has already been distributed.\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (!entry->isLive()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        while(true) {\n            JS_ASSERT(!entry->isRemoved());\n            entry->setCollision();\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (!entry->isLive()) {\n                METER(stats.misses++);\n                return *entry;\n            }\n        }\n    }\n\n    enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed };\n\n    RebuildStatus changeTableSize(int deltaLog2)\n    {\n        // Look, but don't touch, until we succeed in getting new entry store.\n        Entry *oldTable = table;\n        uint32_t oldCap = capacity();\n        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;\n        uint32_t newCapacity = JS_BIT(newLog2);\n        if (newCapacity > sMaxCapacity) {\n            this->reportAllocOverflow();\n            return RehashFailed;\n        }\n\n        Entry *newTable = createTable(*this, newCapacity);\n        if (!newTable)\n            return RehashFailed;\n\n        // We can't fail from here on, so update table parameters.\n        setTableSizeLog2(newLog2);\n        removedCount = 0;\n        gen++;\n        table = newTable;\n\n        // Copy only live entries, leaving removed ones behind.\n        for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {\n            if (src->isLive()) {\n                HashNumber hn = src->getKeyHash();\n                findFreeEntry(hn).setLive(hn, mozilla::Move(src->get()));\n                src->destroy();\n            }\n        }\n\n        // All entries have been destroyed, no need to destroyTable.\n        this->free_(oldTable);\n        return Rehashed;\n    }\n\n    RebuildStatus checkOverloaded()\n    {\n        if (!overloaded())\n            return NotOverloaded;\n\n        // Compress if a quarter or more of all entries are removed.\n        int deltaLog2;\n        if (removedCount >= (capacity() >> 2)) {\n            METER(stats.compresses++);\n            deltaLog2 = 0;\n        } else {\n            METER(stats.grows++);\n            deltaLog2 = 1;\n        }\n\n        return changeTableSize(deltaLog2);\n    }\n\n    // Infallibly rehash the table if we are overloaded with removals.\n    void checkOverRemoved()\n    {\n        if (overloaded()) {\n            if (checkOverloaded() == RehashFailed)\n                rehashTableInPlace();\n        }\n    }\n\n    void remove(Entry &e)\n    {\n        JS_ASSERT(table);\n        METER(stats.removes++);\n\n        if (e.hasCollision()) {\n            e.removeLive();\n            removedCount++;\n        } else {\n            METER(stats.removeFrees++);\n            e.clearLive();\n        }\n        entryCount--;\n        mutationCount++;\n    }\n\n    void checkUnderloaded()\n    {\n        if (underloaded()) {\n            METER(stats.shrinks++);\n            (void) changeTableSize(-1);\n        }\n    }\n\n    // Resize the table down to the largest capacity which doesn't underload the\n    // table.  Since we call checkUnderloaded() on every remove, you only need\n    // to call this after a bulk removal of items done without calling remove().\n    void compactIfUnderloaded()\n    {\n        int32_t resizeLog2 = 0;\n        uint32_t newCapacity = capacity();\n        while (wouldBeUnderloaded(newCapacity, entryCount)) {\n            newCapacity = newCapacity >> 1;\n            resizeLog2--;\n        }\n\n        if (resizeLog2 != 0) {\n            changeTableSize(resizeLog2);\n        }\n    }\n\n    // This is identical to changeTableSize(currentSize), but without requiring\n    // a second table.  We do this by recycling the collision bits to tell us if\n    // the element is already inserted or still waiting to be inserted.  Since\n    // already-inserted elements win any conflicts, we get the same table as we\n    // would have gotten through random insertion order.\n    void rehashTableInPlace()\n    {\n        METER(stats.rehashes++);\n        removedCount = 0;\n        for (size_t i = 0; i < capacity(); ++i)\n            table[i].unsetCollision();\n\n        for (size_t i = 0; i < capacity();) {\n            Entry *src = &table[i];\n\n            if (!src->isLive() || src->hasCollision()) {\n                ++i;\n                continue;\n            }\n\n            HashNumber keyHash = src->getKeyHash();\n            HashNumber h1 = hash1(keyHash);\n            DoubleHash dh = hash2(keyHash);\n            Entry *tgt = &table[h1];\n            while (true) {\n                if (!tgt->hasCollision()) {\n                    src->swap(tgt);\n                    tgt->setCollision();\n                    break;\n                }\n\n                h1 = applyDoubleHash(h1, dh);\n                tgt = &table[h1];\n            }\n        }\n\n        // TODO: this algorithm leaves collision bits on *all* elements, even if\n        // they are on no collision path. We have the option of setting the\n        // collision bits correctly on a subsequent pass or skipping the rehash\n        // unless we are totally filled with tombstones: benchmark to find out\n        // which approach is best.\n    }\n\n  public:\n    void clear()\n    {\n        if (mozilla::IsPod<Entry>::value) {\n            memset(table, 0, sizeof(*table) * capacity());\n        } else {\n            uint32_t tableCapacity = capacity();\n            for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)\n                e->clear();\n        }\n        removedCount = 0;\n        entryCount = 0;\n        mutationCount++;\n    }\n\n    void finish()\n    {\n        JS_ASSERT(!entered);\n\n        if (!table)\n            return;\n\n        destroyTable(*this, table, capacity());\n        table = NULL;\n        gen++;\n        entryCount = 0;\n        removedCount = 0;\n        mutationCount++;\n    }\n\n    Range all() const\n    {\n        JS_ASSERT(table);\n        return Range(table, table + capacity());\n    }\n\n    bool empty() const\n    {\n        JS_ASSERT(table);\n        return !entryCount;\n    }\n\n    uint32_t count() const\n    {\n        JS_ASSERT(table);\n        return entryCount;\n    }\n\n    uint32_t capacity() const\n    {\n        JS_ASSERT(table);\n        return JS_BIT(sHashBits - hashShift);\n    }\n\n    uint32_t generation() const\n    {\n        JS_ASSERT(table);\n        return gen;\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(table);\n    }\n\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    Ptr lookup(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const\n    {\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    AddPtr lookupForAdd(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        Entry &entry = lookup(l, keyHash, sCollisionBit);\n        AddPtr p(entry, keyHash);\n        p.mutationCount = mutationCount;\n        return p;\n    }\n\n    template <class U>\n    bool add(AddPtr &p, const U &rhs)\n    {\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(mutationCount == p.mutationCount);\n        JS_ASSERT(table);\n        JS_ASSERT(!p.found());\n        JS_ASSERT(!(p.keyHash & sCollisionBit));\n\n        // Changing an entry from removed to live does not affect whether we\n        // are overloaded and can be handled separately.\n        if (p.entry_->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            p.keyHash |= sCollisionBit;\n        } else {\n            // Preserve the validity of |p.entry_|.\n            RebuildStatus status = checkOverloaded();\n            if (status == RehashFailed)\n                return false;\n            if (status == Rehashed)\n                p.entry_ = &findFreeEntry(p.keyHash);\n        }\n\n        p.entry_->setLive(p.keyHash, rhs);\n        entryCount++;\n        mutationCount++;\n        return true;\n    }\n\n    template <class U>\n    void putNewInfallible(const Lookup &l, const U &u)\n    {\n        JS_ASSERT(table);\n\n        HashNumber keyHash = prepareHash(l);\n        Entry *entry = &findFreeEntry(keyHash);\n\n        if (entry->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            keyHash |= sCollisionBit;\n        }\n\n        entry->setLive(keyHash, u);\n        entryCount++;\n        mutationCount++;\n    }\n\n    template <class U>\n    bool putNew(const Lookup &l, const U &u)\n    {\n        if (checkOverloaded() == RehashFailed)\n            return false;\n\n        putNewInfallible(l, u);\n        return true;\n    }\n\n    template <class U>\n    bool relookupOrAdd(AddPtr& p, const Lookup &l, const U &u)\n    {\n        p.mutationCount = mutationCount;\n        {\n            mozilla::ReentrancyGuard g(*this);\n            p.entry_ = &lookup(l, p.keyHash, sCollisionBit);\n        }\n        return p.found() || add(p, u);\n    }\n\n    void remove(Ptr p)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        remove(*p.entry_);\n        checkUnderloaded();\n    }\n\n    void rekey(Ptr p, const Lookup &l, const Key &k)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));\n        HashPolicy::setKey(t, const_cast<Key &>(k));\n        remove(*p.entry_);\n        putNewInfallible(l, mozilla::Move(t));\n    }\n\n#undef METER\n};\n\n}  // namespace detail\n}  // namespace js\n\n#endif  /* js_HashTable_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/HeapAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HeapAPI_h\n#define js_HeapAPI_h\n\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n\n/* These values are private to the JS engine. */\nnamespace js {\nnamespace gc {\n\nconst size_t ArenaShift = 12;\nconst size_t ArenaSize = size_t(1) << ArenaShift;\nconst size_t ArenaMask = ArenaSize - 1;\n\nconst size_t ChunkShift = 20;\nconst size_t ChunkSize = size_t(1) << ChunkShift;\nconst size_t ChunkMask = ChunkSize - 1;\n\nconst size_t CellShift = 3;\nconst size_t CellSize = size_t(1) << CellShift;\nconst size_t CellMask = CellSize - 1;\n\n/* These are magic constants derived from actual offsets in gc/Heap.h. */\nconst size_t ChunkMarkBitmapOffset = 1032368;\nconst size_t ChunkMarkBitmapBits = 129024;\nconst size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);\n\n/*\n * Live objects are marked black. How many other additional colors are available\n * depends on the size of the GCThing. Objects marked gray are eligible for\n * cycle collection.\n */\nstatic const uint32_t BLACK = 0;\nstatic const uint32_t GRAY = 1;\n\n} /* namespace gc */\n} /* namespace js */\n\nnamespace JS {\nstruct Zone;\n} /* namespace JS */\n\nnamespace JS {\nnamespace shadow {\n\nstruct ArenaHeader\n{\n    JS::Zone *zone;\n};\n\nstruct Zone\n{\n    bool needsBarrier_;\n\n    Zone() : needsBarrier_(false) {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\nnamespace gc {\n\nstatic JS_ALWAYS_INLINE uintptr_t *\nGetGCThingMarkBitmap(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkMarkBitmapOffset;\n    return reinterpret_cast<uintptr_t *>(addr);\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::Runtime *\nGetGCThingRuntime(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkRuntimeOffset;\n    return *reinterpret_cast<JS::shadow::Runtime **>(addr);\n}\n\nstatic JS_ALWAYS_INLINE void\nGetGCThingMarkWordAndMask(const void *thing, uint32_t color,\n                          uintptr_t **wordp, uintptr_t *maskp)\n{\n    uintptr_t addr = uintptr_t(thing);\n    size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;\n    JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);\n    uintptr_t *bitmap = GetGCThingMarkBitmap(thing);\n    *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD);\n    *wordp = &bitmap[bit / JS_BITS_PER_WORD];\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::ArenaHeader *\nGetGCThingArena(void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ArenaMask;\n    return reinterpret_cast<JS::shadow::ArenaHeader *>(addr);\n}\n\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\nstatic JS_ALWAYS_INLINE Zone *\nGetGCThingZone(void *thing)\n{\n    JS_ASSERT(thing);\n    return js::gc::GetGCThingArena(thing)->zone;\n}\n\nstatic JS_ALWAYS_INLINE Zone *\nGetObjectZone(JSObject *obj)\n{\n    return GetGCThingZone(obj);\n}\n\nstatic JS_ALWAYS_INLINE bool\nGCThingIsMarkedGray(void *thing)\n{\n    uintptr_t *word, mask;\n    js::gc::GetGCThingMarkWordAndMask(thing, js::gc::GRAY, &word, &mask);\n    return *word & mask;\n}\n\nstatic JS_ALWAYS_INLINE bool\nIsIncrementalBarrierNeededOnGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind)\n{\n    if (!rt->needsBarrier_)\n        return false;\n    JS::Zone *zone = GetGCThingZone(thing);\n    return reinterpret_cast<shadow::Zone *>(zone)->needsBarrier_;\n}\n\n} /* namespace JS */\n\n#endif /* js_HeapAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/LegacyIntTypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This section typedefs the old 'native' types to the new <stdint.h> types.\n * These redefinitions are provided solely to allow JSAPI users to more easily\n * transition to <stdint.h> types.  They are not to be used in the JSAPI, and\n * new JSAPI user code should not use them.  This mapping file may eventually\n * be removed from SpiderMonkey, so don't depend on it in the long run.\n */\n\n/*\n * BEWARE: Comity with other implementers of these types is not guaranteed.\n *         Indeed, if you use this header and third-party code defining these\n *         types, *expect* to encounter either compile errors or link errors,\n *         depending how these types are used and on the order of inclusion.\n *         It is safest to use only the <stdint.h> types.\n */\n#ifndef js_LegacyIntTypes_h\n#define js_LegacyIntTypes_h\n\n#include <stdint.h>\n\n#include \"js-config.h\"\n\ntypedef uint8_t uint8;\ntypedef uint16_t uint16;\ntypedef uint32_t uint32;\ntypedef uint64_t uint64;\n\n/*\n * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very\n * common header file) defines the types int8, int16, int32, and int64.\n * So we don't define these four types here to avoid conflicts in case\n * the code also includes sys/types.h.\n */\n#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)\n#include <sys/inttypes.h>\n#else\ntypedef int8_t int8;\ntypedef int16_t int16;\ntypedef int32_t int32;\ntypedef int64_t int64;\n#endif /* AIX && HAVE_SYS_INTTYPES_H */\n\ntypedef uint8_t JSUint8;\ntypedef uint16_t JSUint16;\ntypedef uint32_t JSUint32;\ntypedef uint64_t JSUint64;\n\ntypedef int8_t JSInt8;\ntypedef int16_t JSInt16;\ntypedef int32_t JSInt32;\ntypedef int64_t JSInt64;\n\n#endif /* js_LegacyIntTypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/MemoryMetrics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_MemoryMetrics_h\n#define js_MemoryMetrics_h\n\n// These declarations are not within jsapi.h because they are highly likely to\n// change in the future. Depend on them at your own risk.\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include <string.h>\n\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n#include \"js/Vector.h\"\n\nclass nsISupports;      // This is needed for ObjectPrivateVisitor.\n\nnamespace js {\n\n// In memory reporting, we have concept of \"sundries\", line items which are too\n// small to be worth reporting individually.  Under some circumstances, a memory\n// reporter gets tossed into the sundries bucket if it's smaller than\n// MemoryReportingSundriesThreshold() bytes.\n//\n// We need to define this value here, rather than in the code which actually\n// generates the memory reports, because HugeStringInfo uses this value.\nJS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();\n\n} // namespace js\n\nnamespace JS {\n\n// Data for tracking memory usage of things hanging off objects.\nstruct ObjectsExtraSizes\n{\n    size_t slots;\n    size_t elementsNonAsmJS;\n    size_t elementsAsmJSHeap;\n    size_t elementsAsmJSNonHeap;\n    size_t argumentsData;\n    size_t regExpStatics;\n    size_t propertyIteratorData;\n    size_t ctypesData;\n    size_t private_;    // The '_' suffix is required because |private| is a keyword.\n                        // Note that this field is measured separately from the others.\n\n    ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); }\n\n    void add(ObjectsExtraSizes &sizes) {\n        this->slots                += sizes.slots;\n        this->elementsNonAsmJS     += sizes.elementsNonAsmJS;\n        this->elementsAsmJSHeap    += sizes.elementsAsmJSHeap;\n        this->elementsAsmJSNonHeap += sizes.elementsAsmJSNonHeap;\n        this->argumentsData        += sizes.argumentsData;\n        this->regExpStatics        += sizes.regExpStatics;\n        this->propertyIteratorData += sizes.propertyIteratorData;\n        this->ctypesData           += sizes.ctypesData;\n        this->private_             += sizes.private_;\n    }\n};\n\n// Data for tracking analysis/inference memory usage.\nstruct TypeInferenceSizes\n{\n    size_t typeScripts;\n    size_t typeResults;\n    size_t analysisPool;\n    size_t pendingArrays;\n    size_t allocationSiteTables;\n    size_t arrayTypeTables;\n    size_t objectTypeTables;\n\n    TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); }\n\n    void add(TypeInferenceSizes &sizes) {\n        this->typeScripts          += sizes.typeScripts;\n        this->typeResults          += sizes.typeResults;\n        this->analysisPool         += sizes.analysisPool;\n        this->pendingArrays        += sizes.pendingArrays;\n        this->allocationSiteTables += sizes.allocationSiteTables;\n        this->arrayTypeTables      += sizes.arrayTypeTables;\n        this->objectTypeTables     += sizes.objectTypeTables;\n    }\n};\n\n// Data for tracking JIT-code memory usage.\nstruct CodeSizes\n{\n    size_t ion;\n    size_t asmJS;\n    size_t baseline;\n    size_t regexp;\n    size_t other;\n    size_t unused;\n\n    CodeSizes() { memset(this, 0, sizeof(CodeSizes)); }\n};\n\n// Holds data about a huge string (one which uses more HugeStringInfo::MinSize\n// bytes of memory), so we can report it individually.\nstruct HugeStringInfo\n{\n    HugeStringInfo() : length(0), size(0) { memset(&buffer, 0, sizeof(buffer)); }\n\n    // A string needs to take up this many bytes of storage before we consider\n    // it to be \"huge\".\n    static size_t MinSize() {\n        return js::MemoryReportingSundriesThreshold();\n    }\n\n    // A string's size in memory is not necessarily equal to twice its length\n    // because the allocator and the JS engine both may round up.\n    size_t length;\n    size_t size;\n\n    // We record the first 32 chars of the escaped string here.  (We escape the\n    // string so we can use a char[] instead of a jschar[] here.\n    char buffer[32];\n};\n\n// These measurements relate directly to the JSRuntime, and not to\n// compartments within it.\nstruct RuntimeSizes\n{\n    RuntimeSizes() { memset(this, 0, sizeof(RuntimeSizes)); }\n\n    size_t object;\n    size_t atomsTable;\n    size_t contexts;\n    size_t dtoa;\n    size_t temporary;\n    size_t regexpData;\n    size_t interpreterStack;\n    size_t gcMarker;\n    size_t mathCache;\n    size_t scriptData;\n    size_t scriptSources;\n\n    CodeSizes code;\n};\n\nstruct ZoneStats\n{\n    ZoneStats()\n      : extra(NULL),\n        gcHeapArenaAdmin(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapStringsNormal(0),\n        gcHeapStringsShort(0),\n        gcHeapLazyScripts(0),\n        gcHeapTypeObjects(0),\n        gcHeapIonCodes(0),\n        stringCharsNonHuge(0),\n        lazyScripts(0),\n        typeObjects(0),\n        typePool(0),\n        hugeStrings()\n    {}\n\n    ZoneStats(const ZoneStats &other)\n      : extra(other.extra),\n        gcHeapArenaAdmin(other.gcHeapArenaAdmin),\n        gcHeapUnusedGcThings(other.gcHeapUnusedGcThings),\n        gcHeapStringsNormal(other.gcHeapStringsNormal),\n        gcHeapStringsShort(other.gcHeapStringsShort),\n        gcHeapLazyScripts(other.gcHeapLazyScripts),\n        gcHeapTypeObjects(other.gcHeapTypeObjects),\n        gcHeapIonCodes(other.gcHeapIonCodes),\n        stringCharsNonHuge(other.stringCharsNonHuge),\n        lazyScripts(other.lazyScripts),\n        typeObjects(other.typeObjects),\n        typePool(other.typePool),\n        hugeStrings()\n    {\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // Add other's numbers to this object's numbers.\n    void add(ZoneStats &other) {\n        #define ADD(x)  this->x += other.x\n\n        ADD(gcHeapArenaAdmin);\n        ADD(gcHeapUnusedGcThings);\n\n        ADD(gcHeapStringsNormal);\n        ADD(gcHeapStringsShort);\n        ADD(gcHeapLazyScripts);\n        ADD(gcHeapTypeObjects);\n        ADD(gcHeapIonCodes);\n\n        ADD(stringCharsNonHuge);\n        ADD(lazyScripts);\n        ADD(typeObjects);\n        ADD(typePool);\n\n        #undef ADD\n\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    size_t gcHeapArenaAdmin;\n    size_t gcHeapUnusedGcThings;\n\n    size_t gcHeapStringsNormal;\n    size_t gcHeapStringsShort;\n\n    size_t gcHeapLazyScripts;\n    size_t gcHeapTypeObjects;\n    size_t gcHeapIonCodes;\n\n    size_t stringCharsNonHuge;\n    size_t lazyScripts;\n    size_t typeObjects;\n    size_t typePool;\n\n    js::Vector<HugeStringInfo, 0, js::SystemAllocPolicy> hugeStrings;\n\n    // The size of all the live things in the GC heap that don't belong to any\n    // compartment.\n    size_t GCHeapThingsSize();\n};\n\nstruct CompartmentStats\n{\n    CompartmentStats()\n      : extra(NULL),\n        gcHeapObjectsOrdinary(0),\n        gcHeapObjectsFunction(0),\n        gcHeapObjectsDenseArray(0),\n        gcHeapObjectsSlowArray(0),\n        gcHeapObjectsCrossCompartmentWrapper(0),\n        gcHeapShapesTreeGlobalParented(0),\n        gcHeapShapesTreeNonGlobalParented(0),\n        gcHeapShapesDict(0),\n        gcHeapShapesBase(0),\n        gcHeapScripts(0),\n        objectsExtra(),\n        shapesExtraTreeTables(0),\n        shapesExtraDictTables(0),\n        shapesExtraTreeShapeKids(0),\n        shapesCompartmentTables(0),\n        scriptData(0),\n        baselineData(0),\n        baselineStubsFallback(0),\n        baselineStubsOptimized(0),\n        ionData(0),\n        compartmentObject(0),\n        crossCompartmentWrappersTable(0),\n        regexpCompartment(0),\n        debuggeesSet(0),\n        typeInference()\n    {}\n\n    CompartmentStats(const CompartmentStats &other)\n      : extra(other.extra),\n        gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary),\n        gcHeapObjectsFunction(other.gcHeapObjectsFunction),\n        gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray),\n        gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray),\n        gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper),\n        gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented),\n        gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented),\n        gcHeapShapesDict(other.gcHeapShapesDict),\n        gcHeapShapesBase(other.gcHeapShapesBase),\n        gcHeapScripts(other.gcHeapScripts),\n        objectsExtra(other.objectsExtra),\n        shapesExtraTreeTables(other.shapesExtraTreeTables),\n        shapesExtraDictTables(other.shapesExtraDictTables),\n        shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids),\n        shapesCompartmentTables(other.shapesCompartmentTables),\n        scriptData(other.scriptData),\n        baselineData(other.baselineData),\n        baselineStubsFallback(other.baselineStubsFallback),\n        baselineStubsOptimized(other.baselineStubsOptimized),\n        ionData(other.ionData),\n        compartmentObject(other.compartmentObject),\n        crossCompartmentWrappersTable(other.crossCompartmentWrappersTable),\n        regexpCompartment(other.regexpCompartment),\n        debuggeesSet(other.debuggeesSet),\n        typeInference(other.typeInference)\n    {\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    // If you add a new number, remember to update the constructors, add(), and\n    // maybe gcHeapThingsSize()!\n    size_t gcHeapObjectsOrdinary;\n    size_t gcHeapObjectsFunction;\n    size_t gcHeapObjectsDenseArray;\n    size_t gcHeapObjectsSlowArray;\n    size_t gcHeapObjectsCrossCompartmentWrapper;\n    size_t gcHeapShapesTreeGlobalParented;\n    size_t gcHeapShapesTreeNonGlobalParented;\n    size_t gcHeapShapesDict;\n    size_t gcHeapShapesBase;\n    size_t gcHeapScripts;\n    ObjectsExtraSizes objectsExtra;\n\n    size_t shapesExtraTreeTables;\n    size_t shapesExtraDictTables;\n    size_t shapesExtraTreeShapeKids;\n    size_t shapesCompartmentTables;\n    size_t scriptData;\n    size_t baselineData;\n    size_t baselineStubsFallback;\n    size_t baselineStubsOptimized;\n    size_t ionData;\n    size_t compartmentObject;\n    size_t crossCompartmentWrappersTable;\n    size_t regexpCompartment;\n    size_t debuggeesSet;\n\n    TypeInferenceSizes typeInference;\n\n    // Add cStats's numbers to this object's numbers.\n    void add(CompartmentStats &cStats) {\n        #define ADD(x)  this->x += cStats.x\n\n        ADD(gcHeapObjectsOrdinary);\n        ADD(gcHeapObjectsFunction);\n        ADD(gcHeapObjectsDenseArray);\n        ADD(gcHeapObjectsSlowArray);\n        ADD(gcHeapObjectsCrossCompartmentWrapper);\n        ADD(gcHeapShapesTreeGlobalParented);\n        ADD(gcHeapShapesTreeNonGlobalParented);\n        ADD(gcHeapShapesDict);\n        ADD(gcHeapShapesBase);\n        ADD(gcHeapScripts);\n        objectsExtra.add(cStats.objectsExtra);\n\n        ADD(shapesExtraTreeTables);\n        ADD(shapesExtraDictTables);\n        ADD(shapesExtraTreeShapeKids);\n        ADD(shapesCompartmentTables);\n        ADD(scriptData);\n        ADD(baselineData);\n        ADD(baselineStubsFallback);\n        ADD(baselineStubsOptimized);\n        ADD(ionData);\n        ADD(compartmentObject);\n        ADD(crossCompartmentWrappersTable);\n        ADD(regexpCompartment);\n        ADD(debuggeesSet);\n\n        #undef ADD\n\n        typeInference.add(cStats.typeInference);\n    }\n\n    // The size of all the live things in the GC heap.\n    size_t GCHeapThingsSize();\n};\n\nstruct RuntimeStats\n{\n    RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)\n      : runtime(),\n        gcHeapChunkTotal(0),\n        gcHeapDecommittedArenas(0),\n        gcHeapUnusedChunks(0),\n        gcHeapUnusedArenas(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapChunkAdmin(0),\n        gcHeapGcThings(0),\n        cTotals(),\n        zTotals(),\n        compartmentStatsVector(),\n        zoneStatsVector(),\n        currZoneStats(NULL),\n        mallocSizeOf_(mallocSizeOf)\n    {}\n\n    RuntimeSizes runtime;\n\n    // If you add a new number, remember to update the constructor!\n\n    // Here's a useful breakdown of the GC heap.\n    //\n    // - rtStats.gcHeapChunkTotal\n    //   - decommitted bytes\n    //     - rtStats.gcHeapDecommittedArenas (decommitted arenas in non-empty chunks)\n    //   - unused bytes\n    //     - rtStats.gcHeapUnusedChunks (empty chunks)\n    //     - rtStats.gcHeapUnusedArenas (empty arenas within non-empty chunks)\n    //     - rtStats.total.gcHeapUnusedGcThings (empty GC thing slots within non-empty arenas)\n    //   - used bytes\n    //     - rtStats.gcHeapChunkAdmin\n    //     - rtStats.total.gcHeapArenaAdmin\n    //     - rtStats.gcHeapGcThings (in-use GC things)\n    //\n    // It's possible that some arenas in empty chunks may be decommitted, but\n    // we don't count those under rtStats.gcHeapDecommittedArenas because (a)\n    // it's rare, and (b) this means that rtStats.gcHeapUnusedChunks is a\n    // multiple of the chunk size, which is good.\n\n    size_t gcHeapChunkTotal;\n    size_t gcHeapDecommittedArenas;\n    size_t gcHeapUnusedChunks;\n    size_t gcHeapUnusedArenas;\n    size_t gcHeapUnusedGcThings;\n    size_t gcHeapChunkAdmin;\n    size_t gcHeapGcThings;\n\n    // The sum of all compartment's measurements.\n    CompartmentStats cTotals;\n    ZoneStats zTotals;\n\n    js::Vector<CompartmentStats, 0, js::SystemAllocPolicy> compartmentStatsVector;\n    js::Vector<ZoneStats, 0, js::SystemAllocPolicy> zoneStatsVector;\n\n    ZoneStats *currZoneStats;\n\n    mozilla::MallocSizeOf mallocSizeOf_;\n\n    virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;\n    virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;\n};\n\nclass ObjectPrivateVisitor\n{\n  public:\n    // Within CollectRuntimeStats, this method is called for each JS object\n    // that has an nsISupports pointer.\n    virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0;\n\n    // A callback that gets a JSObject's nsISupports pointer, if it has one.\n    // Note: this function does *not* addref |iface|.\n    typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface);\n    GetISupportsFun getISupports_;\n\n    ObjectPrivateVisitor(GetISupportsFun getISupports)\n      : getISupports_(getISupports)\n    {}\n};\n\nextern JS_PUBLIC_API(bool)\nCollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv);\n\nextern JS_PUBLIC_API(size_t)\nSystemCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nUserCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nPeakSizeOfTemporary(const JSRuntime *rt);\n\n} // namespace JS\n\n#endif /* js_MemoryMetrics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/PropertyKey.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::PropertyKey implementation. */\n\n#ifndef js_PropertyKey_h\n#define js_PropertyKey_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"js/Value.h\"\n\nstruct JSContext;\n\nnamespace JS {\n\nclass PropertyKey;\n\nnamespace detail {\n\nextern JS_PUBLIC_API(bool)\nToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n} // namespace detail\n\n/*\n * A PropertyKey is a key used to access some property on an object.  It is a\n * natural way to represent a property accessed using a JavaScript value.\n *\n * PropertyKey can represent indexes, named properties, and ES6 symbols.  The\n * latter aren't implemented in SpiderMonkey yet, but PropertyKey carves out\n * space for them.\n */\nclass PropertyKey\n{\n    Value v;\n    friend JS_PUBLIC_API(bool) detail::ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n  public:\n    explicit PropertyKey(uint32_t index) : v(PrivateUint32Value(index)) {}\n\n    /*\n     * An index is a string property name whose characters exactly spell out an\n     * unsigned 32-bit integer in decimal: \"0\", \"1\", \"2\", ...., \"4294967294\",\n     * \"4294967295\".\n     */\n    bool isIndex(uint32_t *index) {\n        // The implementation here assumes that private uint32_t are stored\n        // using the int32_t representation.  This is purely an implementation\n        // detail: embedders must not rely upon this!\n        if (!v.isInt32())\n            return false;\n        *index = v.toPrivateUint32();\n        return true;\n    }\n\n    /*\n     * A name is a string property name which is *not* an index.  Note that by\n     * the ECMAScript language grammar, any dotted property access |obj.prop|\n     * will access a named property.\n     */\n    bool isName(JSString **str) {\n        uint32_t dummy;\n        if (isIndex(&dummy))\n            return false;\n        *str = v.toString();\n        return true;\n    }\n\n    /*\n     * A symbol is a property name that's a Symbol, a particular kind of object\n     * in ES6.  It is the only kind of property name that's not a string.\n     *\n     * SpiderMonkey doesn't yet implement symbols, but we're carving out API\n     * space for them in advance.\n     */\n    bool isSymbol() {\n        return false;\n    }\n};\n\ninline bool\nToPropertyKey(JSContext *cx, HandleValue v, PropertyKey *key)\n{\n    if (v.isInt32() && v.toInt32() >= 0) {\n        *key = PropertyKey(uint32_t(v.toInt32()));\n        return true;\n    }\n\n    return detail::ToPropertyKeySlow(cx, v, key);\n}\n\n} // namespace JS\n\n#endif /* js_PropertyKey_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/RequiredDefines.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Various #defines required to build SpiderMonkey.  Embedders should add this\n * file to the start of the command line via -include or a similar mechanism,\n * or SpiderMonkey public headers may not work correctly.\n */\n\n#ifndef js_RequiredDefines_h\n#define js_RequiredDefines_h\n\n/*\n * The c99 defining the limit macros (UINT32_MAX for example), says:\n * C++ implementations should define these macros only when __STDC_LIMIT_MACROS\n * is defined before <stdint.h> is included.\n */\n#define __STDC_LIMIT_MACROS\n\n#endif /* js_RequiredDefines_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/RootingAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_RootingAPI_h\n#define js_RootingAPI_h\n\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\n/*\n * Moving GC Stack Rooting\n *\n * A moving GC may change the physical location of GC allocated things, even\n * when they are rooted, updating all pointers to the thing to refer to its new\n * location. The GC must therefore know about all live pointers to a thing,\n * not just one of them, in order to behave correctly.\n *\n * The |Rooted| and |Handle| classes below are used to root stack locations\n * whose value may be held live across a call that can trigger GC. For a\n * code fragment such as:\n *\n * JSObject *obj = NewObject(cx);\n * DoSomething(cx);\n * ... = obj->lastProperty();\n *\n * If |DoSomething()| can trigger a GC, the stack location of |obj| must be\n * rooted to ensure that the GC does not move the JSObject referred to by\n * |obj| without updating |obj|'s location itself. This rooting must happen\n * regardless of whether there are other roots which ensure that the object\n * itself will not be collected.\n *\n * If |DoSomething()| cannot trigger a GC, and the same holds for all other\n * calls made between |obj|'s definitions and its last uses, then no rooting\n * is required.\n *\n * SpiderMonkey can trigger a GC at almost any time and in ways that are not\n * always clear. For example, the following innocuous-looking actions can\n * cause a GC: allocation of any new GC thing; JSObject::hasProperty;\n * JS_ReportError and friends; and ToNumber, among many others. The following\n * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_,\n * rt->malloc_, and friends and JS_ReportOutOfMemory.\n *\n * The following family of three classes will exactly root a stack location.\n * Incorrect usage of these classes will result in a compile error in almost\n * all cases. Therefore, it is very hard to be incorrectly rooted if you use\n * these classes exclusively. These classes are all templated on the type T of\n * the value being rooted.\n *\n * - Rooted<T> declares a variable of type T, whose value is always rooted.\n *   Rooted<T> may be automatically coerced to a Handle<T>, below. Rooted<T>\n *   should be used whenever a local variable's value may be held live across a\n *   call which can trigger a GC.\n *\n * - Handle<T> is a const reference to a Rooted<T>. Functions which take GC\n *   things or values as arguments and need to root those arguments should\n *   generally use handles for those arguments and avoid any explicit rooting.\n *   This has two benefits. First, when several such functions call each other\n *   then redundant rooting of multiple copies of the GC thing can be avoided.\n *   Second, if the caller does not pass a rooted value a compile error will be\n *   generated, which is quicker and easier to fix than when relying on a\n *   separate rooting analysis.\n *\n * - MutableHandle<T> is a non-const reference to Rooted<T>. It is used in the\n *   same way as Handle<T> and includes a |set(const T &v)| method to allow\n *   updating the value of the referenced Rooted<T>. A MutableHandle<T> can be\n *   created from a Rooted<T> by using |Rooted<T>::operator&()|.\n *\n * In some cases the small performance overhead of exact rooting (measured to\n * be a few nanoseconds on desktop) is too much. In these cases, try the\n * following:\n *\n * - Move all Rooted<T> above inner loops: this allows you to re-use the root\n *   on each iteration of the loop.\n *\n * - Pass Handle<T> through your hot call stack to avoid re-rooting costs at\n *   every invocation.\n *\n * The following diagram explains the list of supported, implicit type\n * conversions between classes of this family:\n *\n *  Rooted<T> ----> Handle<T>\n *     |               ^\n *     |               |\n *     |               |\n *     +---> MutableHandle<T>\n *     (via &)\n *\n * All of these types have an implicit conversion to raw pointers.\n */\n\nnamespace js {\n\nclass Module;\nclass ScriptSourceObject;\n\ntemplate <typename T>\nstruct GCMethods {};\n\ntemplate <typename T>\nclass RootedBase {};\n\ntemplate <typename T>\nclass HandleBase {};\n\ntemplate <typename T>\nclass MutableHandleBase {};\n\ntemplate <typename T>\nclass HeapBase {};\n\n/*\n * js::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for js::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(js::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n *\n * This is the SpiderMonkey internal variant. js::NullPtr should be used in\n * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API\n * symbols.\n */\nstruct NullPtr\n{\n    static void * const constNullValue;\n};\n\nnamespace gc {\nstruct Cell;\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> class Rooted;\n\ntemplate <typename T> class Handle;\ntemplate <typename T> class MutableHandle;\n\n/* This is exposing internal state of the GC for inlining purposes. */\nJS_FRIEND_API(bool) isGCEnabled();\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\nextern void\nCheckStackRoots(JSContext *cx);\n#endif\n\n/*\n * JS::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for JS::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(JS::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n */\nstruct JS_PUBLIC_API(NullPtr)\n{\n    static void * const constNullValue;\n};\n\n/*\n * The Heap<T> class is a C/C++ heap-stored reference to a JS GC thing.  All\n * members of heap classes that refer to GC thing should use Heap<T> (or\n * possibly TenuredHeap<T>, described below).\n *\n * Heap<T> wraps the complex mechanisms required to ensure GC safety for the\n * contained reference into a C++ class that behaves similarly to a normal\n * pointer.\n *\n * GC references stored on the C/C++ stack must use Rooted/Handle/MutableHandle\n * instead.\n *\n * Requirements for type T:\n *  - Must be one of: Value, jsid, JSObject*, JSString*, JSScript*\n */\ntemplate <typename T>\nclass Heap : public js::HeapBase<T>\n{\n  public:\n    Heap() {\n        static_assert(sizeof(T) == sizeof(Heap<T>),\n                      \"Heap<T> must be binary compatible with T.\");\n        init(js::GCMethods<T>::initial());\n    }\n    explicit Heap(T p) { init(p); }\n    explicit Heap(const Heap<T> &p) { init(p.ptr); }\n\n    ~Heap() {\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            relocate();\n    }\n\n    bool operator==(const Heap<T> &other) { return ptr == other.ptr; }\n    bool operator!=(const Heap<T> &other) { return ptr != other.ptr; }\n\n    bool operator==(const T &other) const { return ptr == other; }\n    bool operator!=(const T &other) const { return ptr != other; }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    const T *address() const { return &ptr; }\n    const T &get() const { return ptr; }\n\n    T *unsafeGet() { return &ptr; }\n\n    Heap<T> &operator=(T p) {\n        set(p);\n        return *this;\n    }\n\n    void set(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (js::GCMethods<T>::needsPostBarrier(newPtr)) {\n            ptr = newPtr;\n            post();\n        } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {\n            relocate();  /* Called before overwriting ptr. */\n            ptr = newPtr;\n        } else {\n            ptr = newPtr;\n        }\n    }\n\n  private:\n    void init(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        ptr = newPtr;\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            post();\n    }\n\n    void post() {\n#ifdef JSGC_GENERATIONAL\n        JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));\n        js::GCMethods<T>::postBarrier(&ptr);\n#endif\n    }\n\n    void relocate() {\n#ifdef JSGC_GENERATIONAL\n        js::GCMethods<T>::relocate(&ptr);\n#endif\n    }\n\n    T ptr;\n};\n\n#ifdef DEBUG\n/*\n * For generational GC, assert that an object is in the tenured generation as\n * opposed to being in the nursery.\n */\nextern JS_FRIEND_API(void)\nAssertGCThingMustBeTenured(JSObject* obj);\n#else\ninline void\nAssertGCThingMustBeTenured(JSObject *obj) {}\n#endif\n\n/*\n * The TenuredHeap<T> class is similar to the Heap<T> class above in that it\n * encapsulates the GC concerns of an on-heap reference to a JS object. However,\n * it has two important differences:\n *\n *  1) Pointers which are statically known to only reference \"tenured\" objects\n *     can avoid the extra overhead of SpiderMonkey's write barriers.\n *\n *  2) Objects in the \"tenured\" heap have stronger alignment restrictions than\n *     those in the \"nursery\", so it is possible to store flags in the lower\n *     bits of pointers known to be tenured. TenuredHeap wraps a normal tagged\n *     pointer with a nice API for accessing the flag bits and adds various\n *     assertions to ensure that it is not mis-used.\n *\n * GC things are said to be \"tenured\" when they are located in the long-lived\n * heap: e.g. they have gained tenure as an object by surviving past at least\n * one GC. For performance, SpiderMonkey allocates some things which are known\n * to normally be long lived directly into the tenured generation; for example,\n * global objects. Additionally, SpiderMonkey does not visit individual objects\n * when deleting non-tenured objects, so object with finalizers are also always\n * tenured; for instance, this includes most DOM objects.\n *\n * The considerations to keep in mind when using a TenuredHeap<T> vs a normal\n * Heap<T> are:\n *\n *  - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing.\n *  - It is however valid for a Heap<T> to refer to a tenured thing.\n *  - It is not possible to store flag bits in a Heap<T>.\n */\ntemplate <typename T>\nclass TenuredHeap : public js::HeapBase<T>\n{\n  public:\n    TenuredHeap() : bits(0) {\n        static_assert(sizeof(T) == sizeof(TenuredHeap<T>),\n                      \"TenuredHeap<T> must be binary compatible with T.\");\n    }\n    explicit TenuredHeap(T p) : bits(0) { setPtr(p); }\n    explicit TenuredHeap(const TenuredHeap<T> &p) : bits(0) { setPtr(p.ptr); }\n\n    bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }\n    bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }\n\n    void setPtr(T newPtr) {\n        JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (newPtr)\n            AssertGCThingMustBeTenured(newPtr);\n        bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);\n    }\n\n    void setFlags(uintptr_t flagsToSet) {\n        JS_ASSERT((flagsToSet & ~flagsMask) == 0);\n        bits |= flagsToSet;\n    }\n\n    void unsetFlags(uintptr_t flagsToUnset) {\n        JS_ASSERT((flagsToUnset & ~flagsMask) == 0);\n        bits &= ~flagsToUnset;\n    }\n\n    bool hasFlag(uintptr_t flag) const {\n        JS_ASSERT((flag & ~flagsMask) == 0);\n        return (bits & flag) != 0;\n    }\n\n    T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }\n    uintptr_t getFlags() const { return bits & flagsMask; }\n\n    operator T() const { return getPtr(); }\n    T operator->() const { return getPtr(); }\n\n    TenuredHeap<T> &operator=(T p) {\n        setPtr(p);\n        return *this;\n    }\n\n    /*\n     * Set the pointer to a value which will cause a crash if it is\n     * dereferenced.\n     */\n    void setToCrashOnTouch() {\n        bits = (bits & flagsMask) | crashOnTouchPointer;\n    }\n\n    bool isSetToCrashOnTouch() {\n        return (bits & ~flagsMask) == crashOnTouchPointer;\n    }\n\n  private:\n    enum {\n        maskBits = 3,\n        flagsMask = (1 << maskBits) - 1,\n        crashOnTouchPointer = 1 << maskBits\n    };\n\n    uintptr_t bits;\n};\n\n/*\n * Reference to a T that has been rooted elsewhere. This is most useful\n * as a parameter type, which guarantees that the T lvalue is properly\n * rooted. See \"Move GC Stack Rooting\" above.\n *\n * If you want to add additional methods to Handle for a specific\n * specialization, define a HandleBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>\n{\n    friend class MutableHandle<T>;\n\n  public:\n    /* Creates a handle from a handle of a type convertible to T. */\n    template <typename S>\n    Handle(Handle<S> handle,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)\n    {\n        static_assert(sizeof(Handle<T>) == sizeof(T *),\n                      \"Handle must be binary compatible with T*.\");\n        ptr = reinterpret_cast<const T *>(handle.address());\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(js::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"js::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&js::NullPtr::constNullValue);\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(JS::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"JS::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&JS::NullPtr::constNullValue);\n    }\n\n    Handle(MutableHandle<T> handle) {\n        ptr = handle.address();\n    }\n\n    /*\n     * Take care when calling this method!\n     *\n     * This creates a Handle from the raw location of a T.\n     *\n     * It should be called only if the following conditions hold:\n     *\n     *  1) the location of the T is guaranteed to be marked (for some reason\n     *     other than being a Rooted), e.g., if it is guaranteed to be reachable\n     *     from an implicit root.\n     *\n     *  2) the contents of the location are immutable, or at least cannot change\n     *     for the lifetime of the handle, as its users may not expect its value\n     *     to change underneath them.\n     */\n    static Handle fromMarkedLocation(const T *p) {\n        Handle h;\n        h.ptr = p;\n        return h;\n    }\n\n    /*\n     * Construct a handle from an explicitly rooted location. This is the\n     * normal way to create a handle, and normally happens implicitly.\n     */\n    template <typename S>\n    inline\n    Handle(const Rooted<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    /* Construct a read only handle from a mutable handle. */\n    template <typename S>\n    inline\n    Handle(MutableHandle<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    const T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a Handle<T> to something that\n     * takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n    bool operator!=(const T &other) const { return *ptr != other; }\n    bool operator==(const T &other) const { return *ptr == other; }\n\n  private:\n    Handle() {}\n\n    const T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\ntypedef Handle<JSObject*>                   HandleObject;\ntypedef Handle<js::Module*>                 HandleModule;\ntypedef Handle<js::ScriptSourceObject *>    HandleScriptSource;\ntypedef Handle<JSFunction*>                 HandleFunction;\ntypedef Handle<JSScript*>                   HandleScript;\ntypedef Handle<JSString*>                   HandleString;\ntypedef Handle<jsid>                        HandleId;\ntypedef Handle<Value>                       HandleValue;\n\n/*\n * Similar to a handle, but the underlying storage can be changed. This is\n * useful for outparams.\n *\n * If you want to add additional methods to MutableHandle for a specific\n * specialization, define a MutableHandleBase<T> specialization containing\n * them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    inline MutableHandle(Rooted<T> *root);\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    /*\n     * This may be called only if the location of the T is guaranteed\n     * to be marked (for some reason other than being a Rooted),\n     * e.g., if it is guaranteed to be reachable from an implicit root.\n     *\n     * Create a MutableHandle from a raw location of a T.\n     */\n    static MutableHandle fromMarkedLocation(T *p) {\n        MutableHandle h;\n        h.ptr = p;\n        return h;\n    }\n\n    T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a MutableHandle<T> to something that takes\n     * a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    MutableHandle() {}\n\n    T *ptr;\n\n    template <typename S> void operator=(S v) MOZ_DELETE;\n    void operator=(MutableHandle other) MOZ_DELETE;\n};\n\ntypedef MutableHandle<JSObject*>   MutableHandleObject;\ntypedef MutableHandle<JSFunction*> MutableHandleFunction;\ntypedef MutableHandle<JSScript*>   MutableHandleScript;\ntypedef MutableHandle<JSString*>   MutableHandleString;\ntypedef MutableHandle<jsid>        MutableHandleId;\ntypedef MutableHandle<Value>       MutableHandleValue;\n\n#ifdef JSGC_GENERATIONAL\nJS_PUBLIC_API(void) HeapCellPostBarrier(js::gc::Cell **cellp);\nJS_PUBLIC_API(void) HeapCellRelocate(js::gc::Cell **cellp);\n#endif\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * InternalHandle is a handle to an internal pointer into a gcthing. Use\n * InternalHandle when you have a pointer to a direct field of a gcthing, or\n * when you need a parameter type for something that *may* be a pointer to a\n * direct field of a gcthing.\n */\ntemplate <typename T>\nclass InternalHandle {};\n\ntemplate <typename T>\nclass InternalHandle<T*>\n{\n    void * const *holder;\n    size_t offset;\n\n  public:\n    /*\n     * Create an InternalHandle using a Handle to the gcthing containing the\n     * field in question, and a pointer to the field.\n     */\n    template<typename H>\n    InternalHandle(const JS::Handle<H> &handle, T *field)\n      : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get()))\n    {}\n\n    /*\n     * Create an InternalHandle to a field within a Rooted<>.\n     */\n    template<typename R>\n    InternalHandle(const JS::Rooted<R> &root, T *field)\n      : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get()))\n    {}\n\n    T *get() const { return reinterpret_cast<T*>(uintptr_t(*holder) + offset); }\n\n    const T &operator*() const { return *get(); }\n    T *operator->() const { return get(); }\n\n    static InternalHandle<T*> fromMarkedLocation(T *fieldPtr) {\n        return InternalHandle(fieldPtr);\n    }\n\n  private:\n    /*\n     * Create an InternalHandle to something that is not a pointer to a\n     * gcthing, and so does not need to be rooted in the first place. Use these\n     * InternalHandles to pass pointers into functions that also need to accept\n     * regular InternalHandles to gcthing fields.\n     *\n     * Make this private to prevent accidental misuse; this is only for\n     * fromMarkedLocation().\n     */\n    InternalHandle(T *field)\n      : holder(reinterpret_cast<void * const *>(&js::NullPtr::constNullValue)),\n        offset(uintptr_t(field))\n    {}\n};\n\n/*\n * By default, pointers should use the inheritance hierarchy to find their\n * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that\n * Rooted<T> may be used without the class definition being available.\n */\ntemplate <typename T>\nstruct RootKind<T *>\n{\n    static ThingRootKind rootKind() { return T::rootKind(); }\n};\n\ntemplate <typename T>\nstruct GCMethods<T *>\n{\n    static T *initial() { return NULL; }\n    static ThingRootKind kind() { return RootKind<T *>::rootKind(); }\n    static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }\n    static bool needsPostBarrier(T *v) { return v; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(T **vp) {\n        JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n    static void relocate(T **vp) {\n        JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n#endif\n};\n\n// XXX: Needed for cocos2d JS Bindings\n//#if defined(DEBUG)\n/* This helper allows us to assert that Rooted<T> is scoped within a request. */\nextern JS_PUBLIC_API(bool)\nIsInRequest(JSContext *cx);\n//#endif\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Local variable of type T whose value is always rooted. This is typically\n * used for local variables, or for non-rooted values being passed to a\n * function that requires a handle, e.g. Foo(Root<T>(cx, x)).\n *\n * If you want to add additional methods to Rooted for a specific\n * specialization, define a RootedBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS Rooted : public js::RootedBase<T>\n{\n    /* Note: CX is a subclass of either ContextFriendFields or PerThreadDataFriendFields. */\n    template <typename CX>\n    void init(CX *cx) {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        js::ThingRootKind kind = js::GCMethods<T>::kind();\n        this->stack = &cx->thingGCRooters[kind];\n        this->prev = *stack;\n        *stack = reinterpret_cast<Rooted<void*>*>(this);\n\n        JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));\n#endif\n    }\n\n  public:\n    Rooted(JSContext *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(JSContext *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(js::ContextFriendFields *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::ContextFriendFields *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(JSRuntime *rt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    Rooted(JSRuntime *rt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    ~Rooted() {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));\n        *stack = prev;\n#endif\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<T> *previous() { return prev; }\n#endif\n\n    /*\n     * Important: Return a reference here so passing a Rooted<T> to\n     * something that takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    T &operator=(const Rooted &value) {\n        ptr = value;\n        return ptr;\n    }\n\n    void set(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<void*> **stack, *prev;\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /* Has the rooting analysis ever scanned this Rooted's stack location? */\n    friend void JS::CheckStackRoots(JSContext*);\n#endif\n\n#ifdef JSGC_ROOT_ANALYSIS\n    bool scanned;\n#endif\n\n    /*\n     * |ptr| must be the last field in Rooted because the analysis treats all\n     * Rooted as Rooted<void*> during the analysis. See bug 829372.\n     */\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    Rooted(const Rooted &) MOZ_DELETE;\n};\n\n#if !(defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING))\n// Defined in vm/String.h.\ntemplate <>\nclass Rooted<JSStableString *>;\n#endif\n\ntypedef Rooted<JSObject*>                   RootedObject;\ntypedef Rooted<js::Module*>                 RootedModule;\ntypedef Rooted<js::ScriptSourceObject *>    RootedScriptSource;\ntypedef Rooted<JSFunction*>                 RootedFunction;\ntypedef Rooted<JSScript*>                   RootedScript;\ntypedef Rooted<JSString*>                   RootedString;\ntypedef Rooted<jsid>                        RootedId;\ntypedef Rooted<JS::Value>                   RootedValue;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Mark a stack location as a root for the rooting analysis, without actually\n * rooting it in release builds. This should only be used for stack locations\n * of GC things that cannot be relocated by a garbage collection, and that\n * are definitely reachable via another path.\n */\nclass SkipRoot\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n\n    SkipRoot **stack, *prev;\n    const uint8_t *start;\n    const uint8_t *end;\n\n    template <typename CX, typename T>\n    void init(CX *cx, const T *ptr, size_t count) {\n        SkipRoot **head = &cx->skipGCRooters;\n        this->stack = head;\n        this->prev = *stack;\n        *stack = this;\n        this->start = (const uint8_t *) ptr;\n        this->end = this->start + (sizeof(T) * count);\n    }\n\n  public:\n    ~SkipRoot() {\n        JS_ASSERT(*stack == this);\n        *stack = prev;\n    }\n\n    SkipRoot *previous() { return prev; }\n\n    bool contains(const uint8_t *v, size_t len) {\n        return v >= start && v + len <= end;\n    }\n\n#else /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {}\n\n  public:\n\n#endif /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    SkipRoot(JSContext *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(ContextFriendFields::get(cx), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(ContextFriendFields *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(cx, ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(PerThreadData *pt, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(PerThreadDataFriendFields::get(pt), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Interface substitute for Rooted<T> which does not root the variable's memory. */\ntemplate <typename T>\nclass FakeRooted : public RootedBase<T>\n{\n  public:\n    template <typename CX>\n    FakeRooted(CX *cx\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename CX>\n    FakeRooted(CX *cx, T initial\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    FakeRooted(const FakeRooted &) MOZ_DELETE;\n};\n\n/* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */\ntemplate <typename T>\nclass FakeMutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    FakeMutableHandle(T *t) {\n        ptr = t;\n    }\n\n    FakeMutableHandle(FakeRooted<T> *root) {\n        ptr = root->address();\n    }\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    T *address() const { return ptr; }\n    T get() const { return *ptr; }\n\n    operator T() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    FakeMutableHandle() {}\n\n    T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\n/*\n * Types for a variable that either should or shouldn't be rooted, depending on\n * the template parameter Rooted. Used for implementing functions that can\n * operate on either rooted or unrooted data.\n *\n * The toHandle() and toMutableHandle() functions are for calling functions\n * which require handle types and are only called in the CanGC case. These\n * allow the calling code to type check.\n */\nenum AllowGC {\n    NoGC = 0,\n    CanGC = 1\n};\ntemplate <typename T, AllowGC allowGC>\nclass MaybeRooted\n{\n};\n\ntemplate <typename T> class MaybeRooted<T, CanGC>\n{\n  public:\n    typedef JS::Handle<T> HandleType;\n    typedef JS::Rooted<T> RootType;\n    typedef JS::MutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        return v;\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        return v;\n    }\n};\n\ntemplate <typename T> class MaybeRooted<T, NoGC>\n{\n  public:\n    typedef T HandleType;\n    typedef FakeRooted<T> RootType;\n    typedef FakeMutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n};\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(const Rooted<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(MutableHandle<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T>\ninline\nMutableHandle<T>::MutableHandle(Rooted<T> *root)\n{\n    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),\n                  \"MutableHandle must be binary compatible with T*.\");\n    ptr = root->address();\n}\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Hook for dynamic root analysis. Checks the native stack and poisons\n * references to GC things which have not been rooted.\n */\ninline void MaybeCheckStackRoots(JSContext *cx)\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    JS::CheckStackRoots(cx);\n#endif\n}\n\n/* Base class for automatic read-only object rooting during compilation. */\nclass CompilerRootNode\n{\n  protected:\n    CompilerRootNode(js::gc::Cell *ptr) : next(NULL), ptr_(ptr) {}\n\n  public:\n    void **address() { return (void **)&ptr_; }\n\n  public:\n    CompilerRootNode *next;\n\n  protected:\n    js::gc::Cell *ptr_;\n};\n\n}  /* namespace js */\n\n#endif  /* js_RootingAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/Utility.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Utility_h\n#define js_Utility_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/Scoped.h\"\n#include \"mozilla/TemplateLib.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef JS_OOM_DO_BACKTRACES\n#include <stdio.h>\n#include <execinfo.h>\n#endif\n\n#include \"jstypes.h\"\n\n/* The public JS engine namespace. */\nnamespace JS {}\n\n/* The mozilla-shared reusable template/utility namespace. */\nnamespace mozilla {}\n\n/* The private JS engine namespace. */\nnamespace js {}\n\n/*\n * Pattern used to overwrite freed memory. If you are accessing an object with\n * this pattern, you probably have a dangling pointer.\n */\n#define JS_FREE_PATTERN 0xDA\n\n#define JS_ASSERT(expr)           MOZ_ASSERT(expr)\n#define JS_ASSERT_IF(cond, expr)  MOZ_ASSERT_IF(cond, expr)\n#define JS_ALWAYS_TRUE(expr)      MOZ_ALWAYS_TRUE(expr)\n#define JS_ALWAYS_FALSE(expr)     MOZ_ALWAYS_FALSE(expr)\n\n#ifdef DEBUG\n# ifdef JS_THREADSAFE\n#  define JS_THREADSAFE_ASSERT(expr) JS_ASSERT(expr)\n# else\n#  define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n# endif\n#else\n# define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n#endif\n\n#if defined(DEBUG)\n# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)\n#elif defined(JS_CRASH_DIAGNOSTICS)\n# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)\n#else\n# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)\n#endif\n\n#define JS_STATIC_ASSERT(cond)           static_assert(cond, \"JS_STATIC_ASSERT\")\n#define JS_STATIC_ASSERT_IF(cond, expr)  MOZ_STATIC_ASSERT_IF(cond, expr, \"JS_STATIC_ASSERT_IF\")\n\nextern MOZ_NORETURN JS_PUBLIC_API(void)\nJS_Assert(const char *s, const char *file, int ln);\n\n/*\n * Abort the process in a non-graceful manner. This will cause a core file,\n * call to the debugger or other moral equivalent as well as causing the\n * entire process to stop.\n */\nextern JS_PUBLIC_API(void) JS_Abort(void);\n\n/*\n * Custom allocator support for SpiderMonkey\n */\n#if defined JS_USE_CUSTOM_ALLOCATOR\n# include \"jscustomallocator.h\"\n#else\n# ifdef DEBUG\n/*\n * In order to test OOM conditions, when the testing function\n * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th\n * allocation from now.\n */\nextern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtins/TestingFunctions.cpp */\nextern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */\n\n#ifdef JS_OOM_DO_BACKTRACES\n#define JS_OOM_BACKTRACE_SIZE 32\nstatic JS_ALWAYS_INLINE void\nPrintBacktrace()\n{\n    void* OOM_trace[JS_OOM_BACKTRACE_SIZE];\n    char** OOM_traceSymbols = NULL;\n    int32_t OOM_traceSize = 0;\n    int32_t OOM_traceIdx = 0;\n    OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE);\n    OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize);\n\n    if (!OOM_traceSymbols)\n        return;\n\n    for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) {\n        fprintf(stderr, \"#%d %s\\n\", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]);\n    }\n\n    free(OOM_traceSymbols);\n}\n\n#define JS_OOM_EMIT_BACKTRACE() \\\n    do {\\\n        fprintf(stderr, \"Forcing artificial memory allocation function failure:\\n\");\\\n\tPrintBacktrace();\\\n    } while (0)\n# else\n#  define JS_OOM_EMIT_BACKTRACE() do {} while(0)\n#endif /* JS_OOM_DO_BACKTRACES */\n\n#  define JS_OOM_POSSIBLY_FAIL() \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            js_ReportOutOfMemory(cx);\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n# else\n#  define JS_OOM_POSSIBLY_FAIL() do {} while(0)\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)\n# endif /* DEBUG */\n\nstatic JS_INLINE void* js_malloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return malloc(bytes);\n}\n\nstatic JS_INLINE void* js_calloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(bytes, 1);\n}\n\nstatic JS_INLINE void* js_calloc(size_t nmemb, size_t size)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(nmemb, size);\n}\n\nstatic JS_INLINE void* js_realloc(void* p, size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return realloc(p, bytes);\n}\n\nstatic JS_INLINE void js_free(void* p)\n{\n    free(p);\n}\n#endif/* JS_USE_CUSTOM_ALLOCATOR */\n\n/*\n * JS_ROTATE_LEFT32\n *\n * There is no rotate operation in the C Language so the construct (a << 4) |\n * (a >> 28) is used instead. Most compilers convert this to a rotate\n * instruction but some versions of MSVC don't without a little help.  To get\n * MSVC to generate a rotate instruction, we have to use the _rotl intrinsic\n * and use a pragma to make _rotl inline.\n *\n * MSVC in VS2005 will do an inline rotate instruction on the above construct.\n */\n#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \\\n    defined(_M_X64))\n#include <stdlib.h>\n#pragma intrinsic(_rotl)\n#define JS_ROTATE_LEFT32(a, bits) _rotl(a, bits)\n#else\n#define JS_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))\n#endif\n\n#include <new>\n\n/*\n * Low-level memory management in SpiderMonkey:\n *\n *  ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these\n *     to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's\n *     these symbols.\n *\n *  ** Do not use the builtin C++ operator new and delete: these throw on\n *     error and we cannot override them not to.\n *\n * Allocation:\n *\n * - If the lifetime of the allocation is tied to the lifetime of a GC-thing\n *   (that is, finalizing the GC-thing will free the allocation), call one of\n *   the following functions:\n *\n *     JSContext::{malloc_,realloc_,calloc_,new_}\n *     JSRuntime::{malloc_,realloc_,calloc_,new_}\n *\n *   These functions accumulate the number of bytes allocated which is used as\n *   part of the GC-triggering heuristic.\n *\n *   The difference between the JSContext and JSRuntime versions is that the\n *   cx version reports an out-of-memory error on OOM. (This follows from the\n *   general SpiderMonkey idiom that a JSContext-taking function reports its\n *   own errors.)\n *\n * - Otherwise, use js_malloc/js_realloc/js_calloc/js_free/js_new\n *\n * Deallocation:\n *\n * - Ordinarily, use js_free/js_delete.\n *\n * - For deallocations during GC finalization, use one of the following\n *   operations on the FreeOp provided to the finalizer:\n *\n *     FreeOp::{free_,delete_}\n *\n *   The advantage of these operations is that the memory is batched and freed\n *   on another thread.\n */\n\n#define JS_NEW_BODY(allocator, t, parms)                                       \\\n    void *memory = allocator(sizeof(t));                                       \\\n    return memory ? new(memory) t parms : NULL;\n\n/*\n * Given a class which should provide 'new' methods, add\n * JS_DECLARE_NEW_METHODS (see JSContext for a usage example). This\n * adds news with up to 12 parameters. Add more versions of new below if\n * you need more than 12 parameters.\n *\n * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,\n * or the build will break.\n */\n#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\\\n    template <class T>\\\n    QUALIFIERS T *NEWNAME() {\\\n        JS_NEW_BODY(ALLOCATOR, T, ())\\\n    }\\\n\\\n    template <class T, class P1>\\\n    QUALIFIERS T *NEWNAME(P1 p1) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1))\\\n    }\\\n\\\n    template <class T, class P1, class P2>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\\\n    }\\\n\nJS_DECLARE_NEW_METHODS(js_new, js_malloc, static JS_ALWAYS_INLINE)\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE void\njs_delete(T *p)\n{\n    if (p) {\n        p->~T();\n        js_free(p);\n    }\n}\n\ntemplate<class T>\nstatic JS_ALWAYS_INLINE void\njs_delete_poison(T *p)\n{\n    if (p) {\n        p->~T();\n        memset(p, 0x3B, sizeof(T));\n        js_free(p);\n    }\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc()\n{\n    return (T *)js_malloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc()\n{\n    return (T *)js_calloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_malloc(numElems * sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_calloc(numElems * sizeof(T));\n}\n\nnamespace js {\n\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return NULL; }\n    static void release(T* ptr) { js_free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits)\n\ntemplate <typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { js_delete(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits)\n\ntemplate <typename T>\nstruct ScopedReleasePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { if (ptr) ptr->release(); }\n};\nSCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits)\n\n} /* namespace js */\n\nnamespace js {\n\n/* Integral types for all hash functions. */\ntypedef uint32_t HashNumber;\nconst unsigned HashNumberSizeBits = 32;\n\nnamespace detail {\n\n/*\n * Given a raw hash code, h, return a number that can be used to select a hash\n * bucket.\n *\n * This function aims to produce as uniform an output distribution as possible,\n * especially in the most significant (leftmost) bits, even though the input\n * distribution may be highly nonrandom, given the constraints that this must\n * be deterministic and quick to compute.\n *\n * Since the leftmost bits of the result are best, the hash bucket index is\n * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent\n * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask.\n *\n * FIXME: OrderedHashTable uses a bit-mask; see bug 775896.\n */\ninline HashNumber\nScrambleHashCode(HashNumber h)\n{\n    /*\n     * Simply returning h would not cause any hash tables to produce wrong\n     * answers. But it can produce pathologically bad performance: The caller\n     * right-shifts the result, keeping only the highest bits. The high bits of\n     * hash codes are very often completely entropy-free. (So are the lowest\n     * bits.)\n     *\n     * So we use Fibonacci hashing, as described in Knuth, The Art of Computer\n     * Programming, 6.4. This mixes all the bits of the input hash code h.\n     * \n     * The value of goldenRatio is taken from the hex\n     * expansion of the golden ratio, which starts 1.9E3779B9....\n     * This value is especially good if values with consecutive hash codes\n     * are stored in a hash table; see Knuth for details.\n     */\n    static const HashNumber goldenRatio = 0x9E3779B9U;\n    return h * goldenRatio;\n}\n\n} /* namespace detail */\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Methods for poisoning GC heap pointer words and checking for poisoned words.\n * These are in this file for use in Value methods and so forth.\n *\n * If the moving GC hazard analysis is in use and detects a non-rooted stack\n * pointer to a GC thing, one byte of that pointer is poisoned to refer to an\n * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the\n * pointer is overwritten, to reduce the likelihood of accidentally changing\n * a live integer value.\n */\n\ninline void PoisonPtr(void *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint8_t *ptr = (uint8_t *) v + 3;\n    *ptr = JS_FREE_PATTERN;\n#endif\n}\n\ntemplate <typename T>\ninline bool IsPoisonedPtr(T *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint32_t mask = uintptr_t(v) & 0xff000000;\n    return mask == uint32_t(JS_FREE_PATTERN << 24);\n#else\n    return false;\n#endif\n}\n\n}\n\n/* sixgill annotation defines */\n#ifndef HAVE_STATIC_ANNOTATIONS\n# define HAVE_STATIC_ANNOTATIONS\n# ifdef XGILL_PLUGIN\n#  define STATIC_PRECONDITION(COND)         __attribute__((precondition(#COND)))\n#  define STATIC_PRECONDITION_ASSUME(COND)  __attribute__((precondition_assume(#COND)))\n#  define STATIC_POSTCONDITION(COND)        __attribute__((postcondition(#COND)))\n#  define STATIC_POSTCONDITION_ASSUME(COND) __attribute__((postcondition_assume(#COND)))\n#  define STATIC_INVARIANT(COND)            __attribute__((invariant(#COND)))\n#  define STATIC_INVARIANT_ASSUME(COND)     __attribute__((invariant_assume(#COND)))\n#  define STATIC_PASTE2(X,Y) X ## Y\n#  define STATIC_PASTE1(X,Y) STATIC_PASTE2(X,Y)\n#  define STATIC_ASSERT(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assert_static(#COND), unused))    \\\n    int STATIC_PASTE1(assert_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSUME(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assume_static(#COND), unused))    \\\n    int STATIC_PASTE1(assume_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)                       \\\n  JS_BEGIN_MACRO                                            \\\n    __attribute__((assert_static_runtime(#COND), unused))   \\\n    int STATIC_PASTE1(assert_static_runtime_, __COUNTER__); \\\n  JS_END_MACRO\n# else /* XGILL_PLUGIN */\n#  define STATIC_PRECONDITION(COND)          /* nothing */\n#  define STATIC_PRECONDITION_ASSUME(COND)   /* nothing */\n#  define STATIC_POSTCONDITION(COND)         /* nothing */\n#  define STATIC_POSTCONDITION_ASSUME(COND)  /* nothing */\n#  define STATIC_INVARIANT(COND)             /* nothing */\n#  define STATIC_INVARIANT_ASSUME(COND)      /* nothing */\n#  define STATIC_ASSERT(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSUME(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)  JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n# endif /* XGILL_PLUGIN */\n# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())\n#endif /* HAVE_STATIC_ANNOTATIONS */\n\n#endif /* js_Utility_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/Value.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Value implementation. */\n\n#ifndef js_Value_h\n#define js_Value_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/Likely.h\"\n\n#include <limits> /* for std::numeric_limits */\n\n#include \"js/Anchor.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n\nnamespace JS { class Value; }\n\n/* JS::Value can store a full int32_t. */\n#define JSVAL_INT_BITS          32\n#define JSVAL_INT_MIN           ((int32_t)0x80000000)\n#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)\n\n/*\n * Try to get jsvals 64-bit aligned. We could almost assert that all values are\n * aligned, but MSVC and GCC occasionally break alignment.\n */\n#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__)\n# define JSVAL_ALIGNMENT        __attribute__((aligned (8)))\n#elif defined(_MSC_VER)\n  /*\n   * Structs can be aligned with MSVC, but not if they are used as parameters,\n   * so we just don't try to align.\n   */\n# define JSVAL_ALIGNMENT\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n# define JSVAL_ALIGNMENT\n#elif defined(__HP_cc) || defined(__HP_aCC)\n# define JSVAL_ALIGNMENT\n#endif\n\n#if JS_BITS_PER_WORD == 64\n# define JSVAL_TAG_SHIFT 47\n#endif\n\n/*\n * We try to use enums so that printing a jsval_layout in the debugger shows\n * nice symbolic type tags, however we can only do this when we can force the\n * underlying type of the enum to be the desired size.\n */\n#if !defined(__SUNPRO_CC) && !defined(__xlC__)\n\n#if defined(_MSC_VER)\n# define JS_ENUM_HEADER(id, type)              enum id : type\n# define JS_ENUM_FOOTER(id)\n#else\n# define JS_ENUM_HEADER(id, type)              enum id\n# define JS_ENUM_FOOTER(id)                    __attribute__((packed))\n#endif\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueType, uint8_t)\n{\n    JSVAL_TYPE_DOUBLE              = 0x00,\n    JSVAL_TYPE_INT32               = 0x01,\n    JSVAL_TYPE_UNDEFINED           = 0x02,\n    JSVAL_TYPE_BOOLEAN             = 0x03,\n    JSVAL_TYPE_MAGIC               = 0x04,\n    JSVAL_TYPE_STRING              = 0x05,\n    JSVAL_TYPE_NULL                = 0x06,\n    JSVAL_TYPE_OBJECT              = 0x07,\n\n    /* These never appear in a jsval; they are only provided as an out-of-band value. */\n    JSVAL_TYPE_UNKNOWN             = 0x20,\n    JSVAL_TYPE_MISSING             = 0x21\n} JS_ENUM_FOOTER(JSValueType);\n\nJS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n\n#if JS_BITS_PER_WORD == 32\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_CLEAR                = 0xFFFFFF80,\n    JSVAL_TAG_INT32                = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n\n#elif JS_BITS_PER_WORD == 64\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_MAX_DOUBLE           = 0x1FFF0,\n    JSVAL_TAG_INT32                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32_t));\n\nJS_ENUM_HEADER(JSValueShiftedTag, uint64_t)\n{\n    JSVAL_SHIFTED_TAG_MAX_DOUBLE   = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),\n    JSVAL_SHIFTED_TAG_INT32        = (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_UNDEFINED    = (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_STRING       = (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_BOOLEAN      = (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_MAGIC        = (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_NULL         = (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_OBJECT       = (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n} JS_ENUM_FOOTER(JSValueShiftedTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t));\n\n#endif\n\n#else  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\ntypedef uint8_t JSValueType;\n#define JSVAL_TYPE_DOUBLE            ((uint8_t)0x00)\n#define JSVAL_TYPE_INT32             ((uint8_t)0x01)\n#define JSVAL_TYPE_UNDEFINED         ((uint8_t)0x02)\n#define JSVAL_TYPE_BOOLEAN           ((uint8_t)0x03)\n#define JSVAL_TYPE_MAGIC             ((uint8_t)0x04)\n#define JSVAL_TYPE_STRING            ((uint8_t)0x05)\n#define JSVAL_TYPE_NULL              ((uint8_t)0x06)\n#define JSVAL_TYPE_OBJECT            ((uint8_t)0x07)\n#define JSVAL_TYPE_UNKNOWN           ((uint8_t)0x20)\n\n#if JS_BITS_PER_WORD == 32\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_CLEAR              ((uint32_t)(0xFFFFFF80))\n#define JSVAL_TAG_INT32              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32))\n#define JSVAL_TAG_UNDEFINED          ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED))\n#define JSVAL_TAG_STRING             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING))\n#define JSVAL_TAG_BOOLEAN            ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN))\n#define JSVAL_TAG_MAGIC              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC))\n#define JSVAL_TAG_NULL               ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL))\n#define JSVAL_TAG_OBJECT             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT))\n\n#elif JS_BITS_PER_WORD == 64\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_MAX_DOUBLE         ((uint32_t)(0x1FFF0))\n#define JSVAL_TAG_INT32              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32)\n#define JSVAL_TAG_UNDEFINED          (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED)\n#define JSVAL_TAG_STRING             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING)\n#define JSVAL_TAG_BOOLEAN            (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN)\n#define JSVAL_TAG_MAGIC              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC)\n#define JSVAL_TAG_NULL               (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL)\n#define JSVAL_TAG_OBJECT             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT)\n\ntypedef uint64_t JSValueShiftedTag;\n#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF)\n#define JSVAL_SHIFTED_TAG_INT32      (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_UNDEFINED  (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_STRING     (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_BOOLEAN    (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_MAGIC      (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_NULL       (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_OBJECT     (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n\n#endif  /* JS_BITS_PER_WORD */\n#endif  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\n#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET        JSVAL_TYPE_NULL\n#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET          JSVAL_TYPE_OBJECT\n#define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET             JSVAL_TYPE_INT32\n#define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET        JSVAL_TYPE_MAGIC\n\n#if JS_BITS_PER_WORD == 32\n\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_CLEAR | (type)))\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#elif JS_BITS_PER_WORD == 64\n\n#define JSVAL_PAYLOAD_MASK           0x00007FFFFFFFFFFFLL\n#define JSVAL_TAG_MASK               0xFFFF800000000000LL\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))\n#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET  JSVAL_SHIFTED_TAG_NULL\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET    JSVAL_SHIFTED_TAG_OBJECT\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET       JSVAL_SHIFTED_TAG_UNDEFINED\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET      JSVAL_SHIFTED_TAG_STRING\n\n#endif /* JS_BITS_PER_WORD */\n\ntypedef enum JSWhyMagic\n{\n    JS_ELEMENTS_HOLE,            /* a hole in a native object's elements */\n    JS_NATIVE_ENUMERATE,         /* indicates that a custom enumerate hook forwarded\n                                  * to JS_EnumerateState, which really means the object can be\n                                  * enumerated like a native object. */\n    JS_NO_ITER_VALUE,            /* there is not a pending iterator value */\n    JS_GENERATOR_CLOSING,        /* exception value thrown when closing a generator */\n    JS_NO_CONSTANT,              /* compiler sentinel value */\n    JS_THIS_POISON,              /* used in debug builds to catch tracing errors */\n    JS_ARG_POISON,               /* used in debug builds to catch tracing errors */\n    JS_SERIALIZE_NO_NODE,        /* an empty subnode in the AST serializer */\n    JS_LAZY_ARGUMENTS,           /* lazy arguments value on the stack */\n    JS_OPTIMIZED_ARGUMENTS,      /* optimized-away 'arguments' value */\n    JS_IS_CONSTRUCTING,          /* magic value passed to natives to indicate construction */\n    JS_OVERWRITTEN_CALLEE,       /* arguments.callee has been overwritten */\n    JS_FORWARD_TO_CALL_OBJECT,   /* args object element stored in call object */\n    JS_BLOCK_NEEDS_CLONE,        /* value of static block object slot */\n    JS_HASH_KEY_EMPTY,           /* see class js::HashableValue */\n    JS_ION_ERROR,                /* error while running Ion code */\n    JS_ION_BAILOUT,              /* status code to signal EnterIon will OSR into Interpret */\n    JS_GENERIC_MAGIC             /* for local use */\n} JSWhyMagic;\n\n#if defined(IS_LITTLE_ENDIAN)\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n        JSValueTag tag;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n#if !defined(_WIN64)\n    /* MSVC does not pack these correctly :-( */\n    struct {\n        uint64_t           payload47 : 47;\n        JSValueTag         tag : 17;\n    } debugView;\n#endif\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif  /* JS_BITS_PER_WORD */\n#else   /* defined(IS_LITTLE_ENDIAN) */\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag tag;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag         tag : 17;\n        uint64_t           payload47 : 47;\n    } debugView;\n    struct {\n        uint32_t           padding;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif /* JS_BITS_PER_WORD */\n#endif  /* defined(IS_LITTLE_ENDIAN) */\n\nJS_STATIC_ASSERT(sizeof(jsval_layout) == 8);\n\n#if JS_BITS_PER_WORD == 32\n\n/*\n * N.B. GCC, in some but not all cases, chooses to emit signed comparison of\n * JSValueTag even though its underlying type has been forced to be uint32_t.\n * Thus, all comparisons should explicitly cast operands to uint32_t.\n */\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint32_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return l.s.payload.i32;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_INT32;\n    l.s.payload.i32 = i;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    JSValueTag tag = l.s.tag;\n    MOZ_ASSERT(tag != JSVAL_TAG_CLEAR);\n    return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    MOZ_ASSERT(str);\n    l.s.tag = JSVAL_TAG_STRING;\n    l.s.payload.str = str;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return l.s.payload.str;\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.payload.boo;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.s.tag = JSVAL_TAG_BOOLEAN;\n    l.s.payload.boo = b;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT);\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.payload.obj;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    MOZ_ASSERT(obj);\n    l.s.tag = JSVAL_TAG_OBJECT;\n    l.s.payload.obj = obj;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_NULL;\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    MOZ_ASSERT(((uint32_t)ptr & 1) == 0);\n    l.s.tag = (JSValueTag)0;\n    l.s.payload.ptr = ptr;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    /* gcc sometimes generates signed < without explicit casts. */\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_MAGIC;\n    l.s.payload.why = why;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag;\n    return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n    uint32_t type = l.s.tag & 0xF;\n    MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n    return (JSValueType)type;\n}\n\n#elif JS_BITS_PER_WORD == 64\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint64_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE);\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return (int32_t)l.asBits;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i32)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    uint64_t strBits = (uint64_t)str;\n    MOZ_ASSERT(str);\n    MOZ_ASSERT((strBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = strBits | JSVAL_SHIFTED_TAG_STRING;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK);\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (JSBool)l.asBits;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT);\n    return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT);\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (JSObject *)ptrBits;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    uint64_t objBits = (uint64_t)obj;\n    MOZ_ASSERT(obj);\n    MOZ_ASSERT((objBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = objBits | JSVAL_SHIFTED_TAG_OBJECT;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_NULL;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (void *)ptrBits;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l);\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l));\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    uint64_t ptrBits = (uint64_t)ptr;\n    MOZ_ASSERT((ptrBits & 1) == 0);\n    l.asBits = ptrBits >> 1;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0);\n    return (void *)(l.asBits << 1);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)why) | JSVAL_SHIFTED_TAG_MAGIC;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    uint64_t lbits = lhs.asBits, rbits = rhs.asBits;\n    return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) ||\n           (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n   uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF;\n   MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n   return (JSValueType)type;\n}\n\n#endif  /* JS_BITS_PER_WORD */\n\nstatic inline jsval_layout JSVAL_TO_IMPL(JS::Value v);\nstatic inline JS::Value IMPL_TO_JSVAL(jsval_layout l);\n\nnamespace JS {\n\n/**\n * Returns a generic quiet NaN value, with all payload bits set to zero.\n *\n * Among other properties, this NaN's bit pattern conforms to JS::Value's\n * bit pattern restrictions.\n */\nstatic MOZ_ALWAYS_INLINE double\nGenericNaN()\n{\n    return mozilla::SpecificNaN(0, 0x8000000000000ULL);\n}\n\nstatic inline double\nCanonicalizeNaN(double d)\n{\n    if (MOZ_UNLIKELY(mozilla::IsNaN(d)))\n        return GenericNaN();\n    return d;\n}\n\n/*\n * JS::Value is the interface for a single JavaScript Engine value.  A few\n * general notes on JS::Value:\n *\n * - JS::Value has setX() and isX() members for X in\n *\n *     { Int32, Double, String, Boolean, Undefined, Null, Object, Magic }\n *\n *   JS::Value also contains toX() for each of the non-singleton types.\n *\n * - Magic is a singleton type whose payload contains a JSWhyMagic \"reason\" for\n *   the magic value. By providing JSWhyMagic values when creating and checking\n *   for magic values, it is possible to assert, at runtime, that only magic\n *   values with the expected reason flow through a particular value. For\n *   example, if cx->exception has a magic value, the reason must be\n *   JS_GENERATOR_CLOSING.\n *\n * - The JS::Value operations are preferred.  The JSVAL_* operations remain for\n *   compatibility; they may be removed at some point.  These operations mostly\n *   provide similar functionality.  But there are a few key differences.  One\n *   is that JS::Value gives null a separate type. Thus\n *\n *           JSVAL_IS_OBJECT(v) === v.isObjectOrNull()\n *       !JSVAL_IS_PRIMITIVE(v) === v.isObject()\n *\n *   Also, to help prevent mistakenly boxing a nullable JSObject* as an object,\n *   Value::setObject takes a JSObject&. (Conversely, Value::asObject returns a\n *   JSObject&.)  A convenience member Value::setObjectOrNull is provided.\n *\n * - JSVAL_VOID is the same as the singleton value of the Undefined type.\n *\n * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on\n *   32-bit user code should avoid copying jsval/JS::Value as much as possible,\n *   preferring to pass by const Value &.\n */\nclass Value\n{\n  public:\n    /*\n     * N.B. the default constructor leaves Value unitialized. Adding a default\n     * constructor prevents Value from being stored in a union.\n     */\n\n    /*** Mutators ***/\n\n    void setNull() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;\n    }\n\n    void setUndefined() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;\n    }\n\n    void setInt32(int32_t i) {\n        data = INT32_TO_JSVAL_IMPL(i);\n    }\n\n    int32_t &getInt32Ref() {\n        MOZ_ASSERT(isInt32());\n        return data.s.payload.i32;\n    }\n\n    void setDouble(double d) {\n        data = DOUBLE_TO_JSVAL_IMPL(d);\n    }\n\n    double &getDoubleRef() {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    void setString(JSString *str) {\n        MOZ_ASSERT(!IsPoisonedPtr(str));\n        data = STRING_TO_JSVAL_IMPL(str);\n    }\n\n    void setString(const JS::Anchor<JSString *> &str) {\n        setString(str.get());\n    }\n\n    void setObject(JSObject &obj) {\n        MOZ_ASSERT(!IsPoisonedPtr(&obj));\n        data = OBJECT_TO_JSVAL_IMPL(&obj);\n    }\n\n    void setBoolean(bool b) {\n        data = BOOLEAN_TO_JSVAL_IMPL(b);\n    }\n\n    void setMagic(JSWhyMagic why) {\n        data = MAGIC_TO_JSVAL_IMPL(why);\n    }\n\n    bool setNumber(uint32_t ui) {\n        if (ui > JSVAL_INT_MAX) {\n            setDouble((double)ui);\n            return false;\n        } else {\n            setInt32((int32_t)ui);\n            return true;\n        }\n    }\n\n    bool setNumber(double d) {\n        int32_t i;\n        if (mozilla::DoubleIsInt32(d, &i)) {\n            setInt32(i);\n            return true;\n        }\n\n        setDouble(d);\n        return false;\n    }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n\n    void swap(Value &rhs) {\n        uint64_t tmp = rhs.data.asBits;\n        rhs.data.asBits = data.asBits;\n        data.asBits = tmp;\n    }\n\n    /*** Value type queries ***/\n\n    bool isUndefined() const {\n        return JSVAL_IS_UNDEFINED_IMPL(data);\n    }\n\n    bool isNull() const {\n        return JSVAL_IS_NULL_IMPL(data);\n    }\n\n    bool isNullOrUndefined() const {\n        return isNull() || isUndefined();\n    }\n\n    bool isInt32() const {\n        return JSVAL_IS_INT32_IMPL(data);\n    }\n\n    bool isInt32(int32_t i32) const {\n        return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);\n    }\n\n    bool isDouble() const {\n        return JSVAL_IS_DOUBLE_IMPL(data);\n    }\n\n    bool isNumber() const {\n        return JSVAL_IS_NUMBER_IMPL(data);\n    }\n\n    bool isString() const {\n        return JSVAL_IS_STRING_IMPL(data);\n    }\n\n    bool isObject() const {\n        return JSVAL_IS_OBJECT_IMPL(data);\n    }\n\n    bool isPrimitive() const {\n        return JSVAL_IS_PRIMITIVE_IMPL(data);\n    }\n\n    bool isObjectOrNull() const {\n        return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);\n    }\n\n    bool isGCThing() const {\n        return JSVAL_IS_GCTHING_IMPL(data);\n    }\n\n    bool isBoolean() const {\n        return JSVAL_IS_BOOLEAN_IMPL(data);\n    }\n\n    bool isTrue() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, true);\n    }\n\n    bool isFalse() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, false);\n    }\n\n    bool isMagic() const {\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMagic(JSWhyMagic why) const {\n        MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMarkable() const {\n        return JSVAL_IS_TRACEABLE_IMPL(data);\n    }\n\n    JSGCTraceKind gcKind() const {\n        MOZ_ASSERT(isMarkable());\n        return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));\n    }\n\n    JSWhyMagic whyMagic() const {\n        MOZ_ASSERT(isMagic());\n        return data.s.payload.why;\n    }\n\n    /*** Comparison ***/\n\n    bool operator==(const Value &rhs) const {\n        return data.asBits == rhs.data.asBits;\n    }\n\n    bool operator!=(const Value &rhs) const {\n        return data.asBits != rhs.data.asBits;\n    }\n\n    friend inline bool SameType(const Value &lhs, const Value &rhs);\n\n    /*** Extract the value's typed payload ***/\n\n    int32_t toInt32() const {\n        MOZ_ASSERT(isInt32());\n        return JSVAL_TO_INT32_IMPL(data);\n    }\n\n    double toDouble() const {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    double toNumber() const {\n        MOZ_ASSERT(isNumber());\n        return isDouble() ? toDouble() : double(toInt32());\n    }\n\n    JSString *toString() const {\n        MOZ_ASSERT(isString());\n        return JSVAL_TO_STRING_IMPL(data);\n    }\n\n    JSObject &toObject() const {\n        MOZ_ASSERT(isObject());\n        return *JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    JSObject *toObjectOrNull() const {\n        MOZ_ASSERT(isObjectOrNull());\n        return JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    void *toGCThing() const {\n        MOZ_ASSERT(isGCThing());\n        return JSVAL_TO_GCTHING_IMPL(data);\n    }\n\n    bool toBoolean() const {\n        MOZ_ASSERT(isBoolean());\n        return JSVAL_TO_BOOLEAN_IMPL(data);\n    }\n\n    uint32_t payloadAsRawUint32() const {\n        MOZ_ASSERT(!isDouble());\n        return data.s.payload.u32;\n    }\n\n    uint64_t asRawBits() const {\n        return data.asBits;\n    }\n\n    JSValueType extractNonDoubleType() const {\n        return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data);\n    }\n\n    /*\n     * Private API\n     *\n     * Private setters/getters allow the caller to read/write arbitrary types\n     * that fit in the 64-bit payload. It is the caller's responsibility, after\n     * storing to a value with setPrivateX to read only using getPrivateX.\n     * Privates values are given a type which ensures they are not marked.\n     */\n\n    void setPrivate(void *ptr) {\n        data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);\n    }\n\n    void *toPrivate() const {\n        MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));\n        return JSVAL_TO_PRIVATE_PTR_IMPL(data);\n    }\n\n    void setPrivateUint32(uint32_t ui) {\n        MOZ_ASSERT(uint32_t(int32_t(ui)) == ui);\n        setInt32(int32_t(ui));\n    }\n\n    uint32_t toPrivateUint32() const {\n        return uint32_t(toInt32());\n    }\n\n    /*\n     * An unmarked value is just a void* cast as a Value. Thus, the Value is\n     * not safe for GC and must not be marked. This API avoids raw casts\n     * and the ensuing strict-aliasing warnings.\n     */\n\n    void setUnmarkedPtr(void *ptr) {\n        data.asPtr = ptr;\n    }\n\n    void *toUnmarkedPtr() const {\n        return data.asPtr;\n    }\n\n    const size_t *payloadWord() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.word;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asWord;\n#endif\n    }\n\n    const uintptr_t *payloadUIntPtr() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.uintptr;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asUIntPtr;\n#endif\n    }\n\n#if !defined(_MSC_VER) && !defined(__sparc)\n  // Value must be POD so that MSVC will pass it by value and not in memory\n  // (bug 689101); the same is true for SPARC as well (bug 737344).  More\n  // precisely, we don't want Value return values compiled as out params.\n  private:\n#endif\n\n    jsval_layout data;\n\n  private:\n    void staticAssertions() {\n        JS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n        JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n        JS_STATIC_ASSERT(sizeof(JSBool) == 4);\n        JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4);\n        JS_STATIC_ASSERT(sizeof(Value) == 8);\n    }\n\n    friend jsval_layout (::JSVAL_TO_IMPL)(Value);\n    friend Value (::IMPL_TO_JSVAL)(jsval_layout l);\n};\n\ninline bool\nIsPoisonedValue(const Value &v)\n{\n    if (v.isString())\n        return IsPoisonedPtr(v.toString());\n    if (v.isObject())\n        return IsPoisonedPtr(&v.toObject());\n    return false;\n}\n\n/************************************************************************/\n\nstatic inline Value\nNullValue()\n{\n    Value v;\n    v.setNull();\n    return v;\n}\n\nstatic inline Value\nUndefinedValue()\n{\n    Value v;\n    v.setUndefined();\n    return v;\n}\n\nstatic inline Value\nInt32Value(int32_t i32)\n{\n    Value v;\n    v.setInt32(i32);\n    return v;\n}\n\nstatic inline Value\nDoubleValue(double dbl)\n{\n    Value v;\n    v.setDouble(dbl);\n    return v;\n}\n\nstatic inline Value\nStringValue(JSString *str)\n{\n    Value v;\n    v.setString(str);\n    return v;\n}\n\nstatic inline Value\nBooleanValue(bool boo)\n{\n    Value v;\n    v.setBoolean(boo);\n    return v;\n}\n\nstatic inline Value\nObjectValue(JSObject &obj)\n{\n    Value v;\n    v.setObject(obj);\n    return v;\n}\n\nstatic inline Value\nObjectValueCrashOnTouch()\n{\n    Value v;\n    v.setObject(*reinterpret_cast<JSObject *>(0x42));\n    return v;\n}\n\nstatic inline Value\nMagicValue(JSWhyMagic why)\n{\n    Value v;\n    v.setMagic(why);\n    return v;\n}\n\nstatic inline Value\nNumberValue(float f)\n{\n    Value v;\n    v.setNumber(f);\n    return v;\n}\n\nstatic inline Value\nNumberValue(double dbl)\n{\n    Value v;\n    v.setNumber(dbl);\n    return v;\n}\n\nstatic inline Value\nNumberValue(int8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int32_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint32_t i)\n{\n    Value v;\n    v.setNumber(i);\n    return v;\n}\n\nnamespace detail {\n\ntemplate <bool Signed>\nclass MakeNumberValue\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (JSVAL_INT_MIN <= t && t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\ntemplate <>\nclass MakeNumberValue<false>\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\n} // namespace detail\n\ntemplate <typename T>\nstatic inline Value\nNumberValue(const T t)\n{\n    MOZ_ASSERT(T(double(t)) == t, \"value creation would be lossy\");\n    return detail::MakeNumberValue<std::numeric_limits<T>::is_signed>::create(t);\n}\n\nstatic inline Value\nObjectOrNullValue(JSObject *obj)\n{\n    Value v;\n    v.setObjectOrNull(obj);\n    return v;\n}\n\nstatic inline Value\nPrivateValue(void *ptr)\n{\n    Value v;\n    v.setPrivate(ptr);\n    return v;\n}\n\nstatic inline Value\nPrivateUint32Value(uint32_t ui)\n{\n    Value v;\n    v.setPrivateUint32(ui);\n    return v;\n}\n\ninline bool\nSameType(const Value &lhs, const Value &rhs)\n{\n    return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);\n}\n\n} // namespace JS\n\n/************************************************************************/\n\n#ifdef JSGC_GENERATIONAL\nnamespace JS {\nJS_PUBLIC_API(void) HeapValuePostBarrier(Value *valuep);\nJS_PUBLIC_API(void) HeapValueRelocate(Value *valuep);\n}\n#endif\n\nnamespace js {\n\ntemplate <> struct GCMethods<const JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n};\n\ntemplate <> struct GCMethods<JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n    static bool needsPostBarrier(const JS::Value &v) { return v.isMarkable(); }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }\n    static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }\n#endif\n};\n\ntemplate <class Outer> class UnbarrieredMutableValueOperations;\ntemplate <class Outer> class MutableValueOperations;\n\n/*\n * A class designed for CRTP use in implementing the non-mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * ValueOperations<Outer> with a visible extract() method returning the\n * const Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass ValueOperations\n{\n    friend class UnbarrieredMutableValueOperations<Outer>;\n    friend class MutableValueOperations<Outer>;\n\n    const JS::Value * value() const { return static_cast<const Outer*>(this)->extract(); }\n\n  public:\n    bool isUndefined() const { return value()->isUndefined(); }\n    bool isNull() const { return value()->isNull(); }\n    bool isBoolean() const { return value()->isBoolean(); }\n    bool isTrue() const { return value()->isTrue(); }\n    bool isFalse() const { return value()->isFalse(); }\n    bool isNumber() const { return value()->isNumber(); }\n    bool isInt32() const { return value()->isInt32(); }\n    bool isDouble() const { return value()->isDouble(); }\n    bool isString() const { return value()->isString(); }\n    bool isObject() const { return value()->isObject(); }\n    bool isMagic() const { return value()->isMagic(); }\n    bool isMagic(JSWhyMagic why) const { return value()->isMagic(why); }\n    bool isMarkable() const { return value()->isMarkable(); }\n    bool isPrimitive() const { return value()->isPrimitive(); }\n    bool isGCThing() const { return value()->isGCThing(); }\n\n    bool isNullOrUndefined() const { return value()->isNullOrUndefined(); }\n    bool isObjectOrNull() const { return value()->isObjectOrNull(); }\n\n    bool toBoolean() const { return value()->toBoolean(); }\n    double toNumber() const { return value()->toNumber(); }\n    int32_t toInt32() const { return value()->toInt32(); }\n    double toDouble() const { return value()->toDouble(); }\n    JSString *toString() const { return value()->toString(); }\n    JSObject &toObject() const { return value()->toObject(); }\n    JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); }\n    void *toGCThing() const { return value()->toGCThing(); }\n\n    JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); }\n    uint32_t toPrivateUint32() const { return value()->toPrivateUint32(); }\n\n    JSWhyMagic whyMagic() const { return value()->whyMagic(); }\n};\n\n/*\n * A class designed for CRTP use in implementing the mutating parts of the Value\n * interface in Value-like classes that don't need post barriers.  Outer must be\n * a class inheriting UnbarrieredMutableValueOperations<Outer> with visible\n * extractMutable() and extract() methods returning the const Value* and Value*\n * abstracted by Outer.\n */\ntemplate <class Outer>\nclass UnbarrieredMutableValueOperations : public ValueOperations<Outer>\n{\n    friend class MutableValueOperations<Outer>;\n    JS::Value * value() { return static_cast<Outer*>(this)->extractMutable(); }\n\n  public:\n    void setNull() { value()->setNull(); }\n    void setUndefined() { value()->setUndefined(); }\n    void setInt32(int32_t i) { value()->setInt32(i); }\n    void setDouble(double d) { value()->setDouble(d); }\n    void setBoolean(bool b) { value()->setBoolean(b); }\n    void setMagic(JSWhyMagic why) { value()->setMagic(why); }\n    bool setNumber(uint32_t ui) { return value()->setNumber(ui); }\n    bool setNumber(double d) { return value()->setNumber(d); }\n};\n\n/*\n * A class designed for CRTP use in implementing all the mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * MutableValueOperations<Outer> with visible extractMutable() and extract()\n * methods returning the const Value* and Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass MutableValueOperations : public UnbarrieredMutableValueOperations<Outer>\n{\n  public:\n    void setString(JSString *str) { this->value()->setString(str); }\n    void setString(const JS::Anchor<JSString *> &str) { this->value()->setString(str); }\n    void setObject(JSObject &obj) { this->value()->setObject(obj); }\n    void setObjectOrNull(JSObject *arg) { this->value()->setObjectOrNull(arg); }\n};\n\n/*\n * Augment the generic Heap<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass HeapBase<JS::Value> : public UnbarrieredMutableValueOperations<JS::Heap<JS::Value> >\n{\n    typedef JS::Heap<JS::Value> Outer;\n\n    friend class ValueOperations<Outer>;\n    friend class UnbarrieredMutableValueOperations<Outer>;\n\n    const JS::Value * extract() const { return static_cast<const Outer*>(this)->address(); }\n    JS::Value * extractMutable() { return static_cast<Outer*>(this)->unsafeGet(); }\n\n    /*\n     * Setters that potentially change the value to a GC thing from a non-GC\n     * thing must call JS::Heap::set() to trigger the post barrier.\n     *\n     * Changing from a GC thing to a non-GC thing value will leave the heap\n     * value in the store buffer, but it will be ingored so this is not a\n     * problem.\n     */\n    void setBarriered(const JS::Value &v) {\n        static_cast<JS::Heap<JS::Value> *>(this)->set(v);\n    }\n\n  public:\n    void setString(JSString *str) { setBarriered(JS::StringValue(str)); }\n    void setString(const JS::Anchor<JSString *> &str) { setBarriered(JS::StringValue(str.get())); }\n    void setObject(JSObject &obj) { setBarriered(JS::ObjectValue(obj)); }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n};\n\n/*\n * Augment the generic Handle<T> interface when T = Value with type-querying\n * and value-extracting operations.\n */\ntemplate <>\nclass HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> >\n{\n    friend class ValueOperations<JS::Handle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Handle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic MutableHandle<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass MutableHandleBase<JS::Value> : public MutableValueOperations<JS::MutableHandle<JS::Value> >\n{\n    friend class ValueOperations<JS::MutableHandle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::MutableHandle<JS::Value> >;\n    friend class MutableValueOperations<JS::MutableHandle<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic Rooted<T> interface when T = Value with type-querying,\n * value-extracting, and mutating operations.\n */\ntemplate <>\nclass RootedBase<JS::Value> : public MutableValueOperations<JS::Rooted<JS::Value> >\n{\n    friend class ValueOperations<JS::Rooted<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Rooted<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::Rooted<JS::Value> >;\n    friend class MutableValueOperations<JS::Rooted<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::Rooted<JS::Value>*>(this)->address();\n    }\n};\n\n} // namespace js\n\ninline jsval_layout\nJSVAL_TO_IMPL(JS::Value v)\n{\n    return v.data;\n}\n\ninline JS::Value\nIMPL_TO_JSVAL(jsval_layout l)\n{\n    JS::Value v;\n    v.data = l;\n    return v;\n}\n\nnamespace JS {\n\n#ifndef __GNUC__\n/*\n * The default assignment operator for |struct C| has the signature:\n *\n *   C& C::operator=(const C&)\n *\n * And in particular requires implicit conversion of |this| to type |C| for the\n * return value. But |volatile C| cannot thus be converted to |C|, so just\n * doing |sink = hold| as in the non-specialized version would fail to compile.\n * Do the assignment on asBits instead, since I don't think we want to give\n * jsval_layout an assignment operator returning |volatile jsval_layout|.\n */\ntemplate<>\ninline Anchor<Value>::~Anchor()\n{\n    volatile uint64_t bits;\n    bits = JSVAL_TO_IMPL(hold).asBits;\n}\n#endif\n\n#ifdef DEBUG\nnamespace detail {\n\nstruct ValueAlignmentTester { char c; JS::Value v; };\nstatic_assert(sizeof(ValueAlignmentTester) == 16,\n              \"JS::Value must be 16-byte-aligned\");\n\nstruct LayoutAlignmentTester { char c; jsval_layout l; };\nstatic_assert(sizeof(LayoutAlignmentTester) == 16,\n              \"jsval_layout must be 16-byte-aligned\");\n\n} // namespace detail\n#endif /* DEBUG */\n\n} // namespace JS\n\n/*\n * JS::Value and jsval are the same type; jsval is the old name, kept around\n * for backwards compatibility along with all the JSVAL_* operations below.\n * jsval_layout is an implementation detail and should not be used externally.\n */\ntypedef JS::Value jsval;\n\nstatic_assert(sizeof(jsval_layout) == sizeof(JS::Value),\n              \"jsval_layout and JS::Value must have identical layouts\");\n\n/************************************************************************/\n\nstatic inline JSBool\nJSVAL_IS_NULL(jsval v)\n{\n    return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_VOID(jsval v)\n{\n    return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_INT(jsval v)\n{\n    return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline int32_t\nJSVAL_TO_INT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_INT(v));\n    return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nINT_TO_JSVAL(int32_t i)\n{\n    return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE(jsval v)\n{\n    return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline double\nJSVAL_TO_DOUBLE(jsval v)\n{\n    jsval_layout l;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    l = JSVAL_TO_IMPL(v);\n    return l.asDouble;\n}\n\nstatic inline jsval\nDOUBLE_TO_JSVAL(double d)\n{\n    /*\n     * This is a manually inlined version of:\n     *    d = JS_CANONICALIZE_NAN(d);\n     *    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));\n     * because GCC from XCode 3.1.4 miscompiles the above code.\n     */\n    jsval_layout l;\n    if (MOZ_UNLIKELY(d != d))\n        l.asBits = 0x7FF8000000000000LL;\n    else\n        l.asDouble = d;\n    return IMPL_TO_JSVAL(l);\n}\n\nstatic inline jsval\nUINT_TO_JSVAL(uint32_t i)\n{\n    if (i <= JSVAL_INT_MAX)\n        return INT_TO_JSVAL((int32_t)i);\n    return DOUBLE_TO_JSVAL((double)i);\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER(jsval v)\n{\n    return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING(jsval v)\n{\n    return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_STRING(v));\n    return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nSTRING_TO_JSVAL(JSString *str)\n{\n    return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str));\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v)));\n    return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nOBJECT_TO_JSVAL(JSObject *obj)\n{\n    if (obj)\n        return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj));\n    return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0));\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN(jsval v)\n{\n    return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_BOOLEAN(v));\n    return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nBOOLEAN_TO_JSVAL(JSBool b)\n{\n    return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE(jsval v)\n{\n    return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING(jsval v)\n{\n    return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_GCTHING(v));\n    return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/* To be GC-safe, privates are tagged as doubles. */\n\nstatic inline jsval\nPRIVATE_TO_JSVAL(void *ptr)\n{\n    return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));\n}\n\n#endif /* js_Value_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Vector_h\n#define js_Vector_h\n\n#include \"mozilla/Vector.h\"\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace js {\n\nclass TempAllocPolicy;\n\n// If we had C++11 template aliases, we could just use this:\n//\n//   template <typename T,\n//             size_t MinInlineCapacity = 0,\n//             class AllocPolicy = TempAllocPolicy>\n//   using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;\n//\n// ...and get rid of all the CRTP madness in mozilla::Vector(Base).  But we\n// can't because compiler support's not up to snuff.  (Template aliases are in\n// gcc 4.7 and clang 3.0 and are expected to be in MSVC 2013.)  Instead, have a\n// completely separate class inheriting from mozilla::Vector, and throw CRTP at\n// the problem til things work.\n//\n// This workaround presents a couple issues.  First, because js::Vector is a\n// distinct type from mozilla::Vector, overload resolution, method calls, etc.\n// are affected.  *Hopefully* this won't be too bad in practice.  (A bunch of\n// places had to be fixed when mozilla::Vector was introduced, but it wasn't a\n// crazy number.)  Second, mozilla::Vector's interface has to be made subclass-\n// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one\n// should use.  :-)  Third, we have to redefine the constructors and the non-\n// inherited operators.  Blech.  Happily there aren't too many of these, so it\n// isn't the end of the world.\n\ntemplate <typename T,\n          size_t MinInlineCapacity = 0,\n          class AllocPolicy = TempAllocPolicy>\nclass Vector\n  : public mozilla::VectorBase<T,\n                               MinInlineCapacity,\n                               AllocPolicy,\n                               Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector &operator=(mozilla::MoveRef<Vector> vec) {\n        return Base::operator=(vec);\n    }\n};\n\n} // namespace js\n\n#endif /* js_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js-config.h",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sw=4 et tw=78:\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_config_h___\n#define js_config_h___\n\n/* Definitions set at build time that affect SpiderMonkey's public API.\n   This header file is generated by the SpiderMonkey configure script,\n   and installed along with jsapi.h.  */\n\n/* Define to 1 if SpiderMonkey should support multi-threaded clients.  */\n/* #undef JS_THREADSAFE */\n\n/* Define to 1 if SpiderMonkey should include ctypes support.  */\n/* #undef JS_HAS_CTYPES */\n\n/* Define to 1 if SpiderMonkey should support the ability to perform\n   entirely too much GC.  */\n/* #undef JS_GC_ZEAL */\n\n/* Define to 1 if the <endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n#define JS_HAVE_ENDIAN_H 1\n\n/* Define to 1 if the <machine/endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n#define JS_HAVE_MACHINE_ENDIAN_H 1\n\n/* Define to 1 if the <sys/isa_defs.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_SYS_ISA_DEFS_H */\n\n/* The configure script defines these if it doesn't #define\n   JS_HAVE_STDINT_H.  */\n#define JS_BYTES_PER_WORD 4\n\n/* MOZILLA JSAPI version number components */\n#define MOZJS_MAJOR_VERSION 25\n#define MOZJS_MINOR_VERSION 0\n\n#endif /* js_config_h___ */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/js.msg",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This is the JavaScript error message file.\n *\n * The format for each JS error message is:\n *\n * MSG_DEF(<SYMBOLIC_NAME>, <ERROR_NUMBER>, <ARGUMENT_COUNT>, <EXCEPTION_NAME>,\n *         <FORMAT_STRING>)\n *\n * where ;\n * <SYMBOLIC_NAME> is a legal C identifer that will be used in the\n * JS engine source.\n *\n * <ERROR_NUMBER> is an unique integral value identifying this error.\n *\n * <ARGUMENT_COUNT> is an integer literal specifying the total number of\n * replaceable arguments in the following format string.\n *\n * <EXCEPTION_NAME> is an exception index from the enum in jsexn.c;\n * JSEXN_NONE for none.  The given exception index will be raised by the\n * engine when the corresponding error occurs.\n *\n * <FORMAT_STRING> is a string literal, optionally containing sequences\n * {X} where X  is an integer representing the argument number that will\n * be replaced with a string value when the error is reported.\n *\n * e.g.\n *\n * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 73, JSEXN_NONE, 2,\n *         \"{0} is not a member of the {1} family\")\n *\n * can be used:\n *\n * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, \"Rhino\", \"Monkey\");\n *\n * to report:\n *\n * \"Rhino is not a member of the Monkey family\"\n *\n * When removing MSG_DEFs, convert them to JSMSG_UNUSED<n> placeholders:\n *\n *    MSG_DEF(JSMSG_UNUSED7,                  7, 0, JSEXN_NONE, \"\")\n *\n * Before adding a new MSG_DEF at the end, look for existing JSMSG_UNUSED<n>\n * free index placeholders in the middle of the list.\n */\n\nMSG_DEF(JSMSG_NOT_AN_ERROR,             0, 0, JSEXN_NONE, \"<Error #0 is reserved>\")\nMSG_DEF(JSMSG_NOT_DEFINED,              1, 1, JSEXN_REFERENCEERR, \"{0} is not defined\")\nMSG_DEF(JSMSG_INACTIVE,                 2, 0, JSEXN_INTERNALERR, \"nothing active on context\")\nMSG_DEF(JSMSG_MORE_ARGS_NEEDED,         3, 3, JSEXN_TYPEERR, \"{0} requires more than {1} argument{2}\")\nMSG_DEF(JSMSG_BAD_CHAR,                 4, 1, JSEXN_INTERNALERR, \"invalid format character {0}\")\nMSG_DEF(JSMSG_BAD_TYPE,                 5, 1, JSEXN_TYPEERR, \"unknown type {0}\")\nMSG_DEF(JSMSG_ALLOC_OVERFLOW,           6, 0, JSEXN_INTERNALERR, \"allocation size overflow\")\nMSG_DEF(JSMSG_MISSING_HEXDIGITS,        7, 0, JSEXN_SYNTAXERR, \"missing hexadecimal digits after '0x'\")\nMSG_DEF(JSMSG_INCOMPATIBLE_PROTO,       8, 3, JSEXN_TYPEERR, \"{0}.prototype.{1} called on incompatible {2}\")\nMSG_DEF(JSMSG_NO_CONSTRUCTOR,           9, 1, JSEXN_TYPEERR, \"{0} has no constructor\")\nMSG_DEF(JSMSG_CANT_ALIAS,              10, 3, JSEXN_TYPEERR, \"can't alias {0} to {1} in class {2}\")\nMSG_DEF(JSMSG_NOT_SCRIPTED_FUNCTION,   11, 1, JSEXN_TYPEERR, \"{0} is not a scripted function\")\nMSG_DEF(JSMSG_BAD_SORT_ARG,            12, 0, JSEXN_TYPEERR, \"invalid Array.prototype.sort argument\")\nMSG_DEF(JSMSG_BAD_ATOMIC_NUMBER,       13, 1, JSEXN_INTERNALERR, \"internal error: no index for atom {0}\")\nMSG_DEF(JSMSG_TOO_MANY_LITERALS,       14, 0, JSEXN_INTERNALERR, \"too many literals\")\nMSG_DEF(JSMSG_CANT_WATCH,              15, 1, JSEXN_TYPEERR, \"can't watch non-native objects of class {0}\")\nMSG_DEF(JSMSG_STACK_UNDERFLOW,         16, 2, JSEXN_INTERNALERR, \"internal error compiling {0}: stack underflow at pc {1}\")\nMSG_DEF(JSMSG_NEED_DIET,               17, 1, JSEXN_INTERNALERR, \"{0} too large\")\nMSG_DEF(JSMSG_TOO_MANY_LOCAL_ROOTS,    18, 0, JSEXN_ERR, \"out of local root space\")\nMSG_DEF(JSMSG_READ_ONLY,               19, 1, JSEXN_TYPEERR, \"{0} is read-only\")\nMSG_DEF(JSMSG_BAD_FORMAL,              20, 0, JSEXN_SYNTAXERR, \"malformed formal parameter\")\nMSG_DEF(JSMSG_CANT_DELETE,             21, 1, JSEXN_TYPEERR, \"property {0} is non-configurable and can't be deleted\")\nMSG_DEF(JSMSG_NOT_FUNCTION,            22, 1, JSEXN_TYPEERR, \"{0} is not a function\")\nMSG_DEF(JSMSG_NOT_CONSTRUCTOR,         23, 1, JSEXN_TYPEERR, \"{0} is not a constructor\")\nMSG_DEF(JSMSG_INVALID_DATE,            24, 0, JSEXN_RANGEERR, \"invalid date\")\nMSG_DEF(JSMSG_TOO_DEEP,                25, 1, JSEXN_INTERNALERR, \"{0} nested too deeply\")\nMSG_DEF(JSMSG_OVER_RECURSED,           26, 0, JSEXN_INTERNALERR, \"too much recursion\")\nMSG_DEF(JSMSG_IN_NOT_OBJECT,           27, 1, JSEXN_TYPEERR, \"invalid 'in' operand {0}\")\nMSG_DEF(JSMSG_BAD_NEW_RESULT,          28, 1, JSEXN_TYPEERR, \"invalid new expression result {0}\")\nMSG_DEF(JSMSG_OBJECT_ACCESS_DENIED,    29, 0, JSEXN_ERR, \"Permission denied to access object\")\nMSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED,  30, 1, JSEXN_ERR, \"Permission denied to access property '{0}'\")\nMSG_DEF(JSMSG_BAD_INSTANCEOF_RHS,      31, 1, JSEXN_TYPEERR, \"invalid 'instanceof' operand {0}\")\nMSG_DEF(JSMSG_BAD_BYTECODE,            32, 1, JSEXN_INTERNALERR, \"unimplemented JavaScript bytecode {0}\")\nMSG_DEF(JSMSG_BAD_RADIX,               33, 0, JSEXN_RANGEERR, \"radix must be an integer at least 2 and no greater than 36\")\nMSG_DEF(JSMSG_PAREN_BEFORE_LET,        34, 0, JSEXN_SYNTAXERR, \"missing ( before let head\")\nMSG_DEF(JSMSG_CANT_CONVERT,            35, 1, JSEXN_ERR, \"can't convert {0} to an integer\")\nMSG_DEF(JSMSG_CYCLIC_VALUE,            36, 1, JSEXN_TYPEERR, \"cyclic {0} value\")\nMSG_DEF(JSMSG_COMPILE_EXECED_SCRIPT,   37, 0, JSEXN_TYPEERR, \"can't compile over a script that is currently executing\")\nMSG_DEF(JSMSG_CANT_CONVERT_TO,         38, 2, JSEXN_TYPEERR, \"can't convert {0} to {1}\")\nMSG_DEF(JSMSG_NO_PROPERTIES,           39, 1, JSEXN_TYPEERR, \"{0} has no properties\")\nMSG_DEF(JSMSG_CANT_FIND_CLASS,         40, 1, JSEXN_TYPEERR, \"can't find class id {0}\")\nMSG_DEF(JSMSG_DEAD_OBJECT,             41, 0, JSEXN_TYPEERR, \"can't access dead object\")\nMSG_DEF(JSMSG_BYTECODE_TOO_BIG,        42, 2, JSEXN_INTERNALERR, \"bytecode {0} too large (limit {1})\")\nMSG_DEF(JSMSG_UNKNOWN_FORMAT,          43, 1, JSEXN_INTERNALERR, \"unknown bytecode format {0}\")\nMSG_DEF(JSMSG_TOO_MANY_CON_ARGS,       44, 0, JSEXN_SYNTAXERR, \"too many constructor arguments\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_ARGS,       45, 0, JSEXN_SYNTAXERR, \"too many function arguments\")\nMSG_DEF(JSMSG_BAD_QUANTIFIER,          46, 0, JSEXN_SYNTAXERR, \"invalid quantifier\")\nMSG_DEF(JSMSG_MIN_TOO_BIG,             47, 1, JSEXN_SYNTAXERR, \"overlarge minimum {0}\")\nMSG_DEF(JSMSG_MAX_TOO_BIG,             48, 1, JSEXN_SYNTAXERR, \"overlarge maximum {0}\")\nMSG_DEF(JSMSG_OUT_OF_ORDER,            49, 1, JSEXN_SYNTAXERR, \"maximum {0} less than minimum\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_DECL,       50, 0, JSEXN_SYNTAXERR, \"missing = in destructuring declaration\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASS,        51, 0, JSEXN_REFERENCEERR, \"invalid destructuring assignment operator\")\nMSG_DEF(JSMSG_PAREN_AFTER_LET,         52, 0, JSEXN_SYNTAXERR, \"missing ) after let head\")\nMSG_DEF(JSMSG_CURLY_AFTER_LET,         53, 0, JSEXN_SYNTAXERR, \"missing } after let block\")\nMSG_DEF(JSMSG_MISSING_PAREN,           54, 0, JSEXN_SYNTAXERR, \"unterminated parenthetical\")\nMSG_DEF(JSMSG_UNTERM_CLASS,            55, 1, JSEXN_SYNTAXERR, \"unterminated character class {0}\")\nMSG_DEF(JSMSG_TRAILING_SLASH,          56, 0, JSEXN_SYNTAXERR, \"trailing \\\\ in regular expression\")\nMSG_DEF(JSMSG_BAD_CLASS_RANGE,         57, 0, JSEXN_SYNTAXERR, \"invalid range in character class\")\nMSG_DEF(JSMSG_BAD_REGEXP_FLAG,         58, 1, JSEXN_SYNTAXERR, \"invalid regular expression flag {0}\")\nMSG_DEF(JSMSG_NO_INPUT,                59, 5, JSEXN_SYNTAXERR, \"no input for /{0}/{1}{2}{3}{4}\")\nMSG_DEF(JSMSG_CANT_OPEN,               60, 2, JSEXN_ERR, \"can't open {0}: {1}\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_APPLY_ARGS, 61, 0, JSEXN_RANGEERR, \"arguments array passed to Function.prototype.apply is too large\")\nMSG_DEF(JSMSG_UNMATCHED_RIGHT_PAREN,   62, 0, JSEXN_SYNTAXERR, \"unmatched ) in regular expression\")\nMSG_DEF(JSMSG_TOO_BIG_TO_ENCODE,       63, 0, JSEXN_INTERNALERR, \"data are to big to encode\")\nMSG_DEF(JSMSG_ARG_INDEX_OUT_OF_RANGE,  64, 1, JSEXN_RANGEERR, \"argument {0} accesses an index that is out of range\")\nMSG_DEF(JSMSG_SPREAD_TOO_LARGE,        65, 0, JSEXN_RANGEERR, \"array too large due to spread operand(s)\")\nMSG_DEF(JSMSG_SOURCE_TOO_LONG,         66, 0, JSEXN_RANGEERR, \"source is too long\")\nMSG_DEF(JSMSG_BAD_WEAKMAP_KEY,         67, 0, JSEXN_TYPEERR, \"cannot use the given object as a weak map key\")\nMSG_DEF(JSMSG_BAD_SCRIPT_MAGIC,        68, 0, JSEXN_INTERNALERR, \"bad script XDR magic number\")\nMSG_DEF(JSMSG_PAREN_BEFORE_FORMAL,     69, 0, JSEXN_SYNTAXERR, \"missing ( before formal parameters\")\nMSG_DEF(JSMSG_MISSING_FORMAL,          70, 0, JSEXN_SYNTAXERR, \"missing formal parameter\")\nMSG_DEF(JSMSG_PAREN_AFTER_FORMAL,      71, 0, JSEXN_SYNTAXERR, \"missing ) after formal parameters\")\nMSG_DEF(JSMSG_CURLY_BEFORE_BODY,       72, 0, JSEXN_SYNTAXERR, \"missing { before function body\")\nMSG_DEF(JSMSG_CURLY_AFTER_BODY,        73, 0, JSEXN_SYNTAXERR, \"missing } after function body\")\nMSG_DEF(JSMSG_PAREN_BEFORE_COND,       74, 0, JSEXN_SYNTAXERR, \"missing ( before condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_COND,        75, 0, JSEXN_SYNTAXERR, \"missing ) after condition\")\nMSG_DEF(JSMSG_BAD_DUP_ARGS,            76, 0, JSEXN_SYNTAXERR, \"duplicate argument names not allowed in this context\")\nMSG_DEF(JSMSG_NAME_AFTER_DOT,          77, 0, JSEXN_SYNTAXERR, \"missing name after . operator\")\nMSG_DEF(JSMSG_BRACKET_IN_INDEX,        78, 0, JSEXN_SYNTAXERR, \"missing ] in index expression\")\nMSG_DEF(JSMSG_ACCESSOR_DEF_DENIED,     79, 1, JSEXN_ERR, \"Permission denied to define accessor property '{0}'\")\nMSG_DEF(JSMSG_PAREN_BEFORE_SWITCH,     80, 0, JSEXN_SYNTAXERR, \"missing ( before switch expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_SWITCH,      81, 0, JSEXN_SYNTAXERR, \"missing ) after switch expression\")\nMSG_DEF(JSMSG_CURLY_BEFORE_SWITCH,     82, 0, JSEXN_SYNTAXERR, \"missing { before switch body\")\nMSG_DEF(JSMSG_COLON_AFTER_CASE,        83, 0, JSEXN_SYNTAXERR, \"missing : after case label\")\nMSG_DEF(JSMSG_WHILE_AFTER_DO,          84, 0, JSEXN_SYNTAXERR, \"missing while after do-loop body\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR,         85, 0, JSEXN_SYNTAXERR, \"missing ( after for\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT,     86, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop initializer\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_COND,     87, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR_CTRL,    88, 0, JSEXN_SYNTAXERR, \"missing ) after for-loop control\")\nMSG_DEF(JSMSG_CURLY_BEFORE_TRY,        89, 0, JSEXN_SYNTAXERR, \"missing { before try block\")\nMSG_DEF(JSMSG_CURLY_AFTER_TRY,         90, 0, JSEXN_SYNTAXERR, \"missing } after try block\")\nMSG_DEF(JSMSG_PAREN_BEFORE_CATCH,      91, 0, JSEXN_SYNTAXERR, \"missing ( before catch\")\nMSG_DEF(JSMSG_CATCH_IDENTIFIER,        92, 0, JSEXN_SYNTAXERR, \"missing identifier in catch\")\nMSG_DEF(JSMSG_PAREN_AFTER_CATCH,       93, 0, JSEXN_SYNTAXERR, \"missing ) after catch\")\nMSG_DEF(JSMSG_CURLY_BEFORE_CATCH,      94, 0, JSEXN_SYNTAXERR, \"missing { before catch block\")\nMSG_DEF(JSMSG_CURLY_AFTER_CATCH,       95, 0, JSEXN_SYNTAXERR, \"missing } after catch block\")\nMSG_DEF(JSMSG_CURLY_BEFORE_FINALLY,    96, 0, JSEXN_SYNTAXERR, \"missing { before finally block\")\nMSG_DEF(JSMSG_CURLY_AFTER_FINALLY,     97, 0, JSEXN_SYNTAXERR, \"missing } after finally block\")\nMSG_DEF(JSMSG_CATCH_OR_FINALLY,        98, 0, JSEXN_SYNTAXERR, \"missing catch or finally after try\")\nMSG_DEF(JSMSG_PAREN_BEFORE_WITH,       99, 0, JSEXN_SYNTAXERR, \"missing ( before with-statement object\")\nMSG_DEF(JSMSG_PAREN_AFTER_WITH,       100, 0, JSEXN_SYNTAXERR, \"missing ) after with-statement object\")\nMSG_DEF(JSMSG_CURLY_IN_COMPOUND,      101, 0, JSEXN_SYNTAXERR, \"missing } in compound statement\")\nMSG_DEF(JSMSG_NO_VARIABLE_NAME,       102, 0, JSEXN_SYNTAXERR, \"missing variable name\")\nMSG_DEF(JSMSG_COLON_IN_COND,          103, 0, JSEXN_SYNTAXERR, \"missing : in conditional expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_ARGS,       104, 0, JSEXN_SYNTAXERR, \"missing ) after argument list\")\nMSG_DEF(JSMSG_BRACKET_AFTER_LIST,     105, 0, JSEXN_SYNTAXERR, \"missing ] after element list\")\nMSG_DEF(JSMSG_COLON_AFTER_ID,         106, 0, JSEXN_SYNTAXERR, \"missing : after property id\")\nMSG_DEF(JSMSG_CURLY_AFTER_LIST,       107, 0, JSEXN_SYNTAXERR, \"missing } after property list\")\nMSG_DEF(JSMSG_PAREN_IN_PAREN,         108, 0, JSEXN_SYNTAXERR, \"missing ) in parenthetical\")\nMSG_DEF(JSMSG_SEMI_BEFORE_STMNT,      109, 0, JSEXN_SYNTAXERR, \"missing ; before statement\")\nMSG_DEF(JSMSG_NO_RETURN_VALUE,        110, 1, JSEXN_TYPEERR, \"function {0} does not always return a value\")\nMSG_DEF(JSMSG_DUPLICATE_FORMAL,       111, 1, JSEXN_SYNTAXERR, \"duplicate formal argument {0}\")\nMSG_DEF(JSMSG_EQUAL_AS_ASSIGN,        112, 0, JSEXN_SYNTAXERR, \"test for equality (==) mistyped as assignment (=)?\")\nMSG_DEF(JSMSG_OPTIMIZED_CLOSURE_LEAK, 113, 0, JSEXN_INTERNALERR, \"can't access optimized closure\")\nMSG_DEF(JSMSG_TOO_MANY_DEFAULTS,      114, 0, JSEXN_SYNTAXERR, \"more than one switch default\")\nMSG_DEF(JSMSG_TOO_MANY_CASES,         115, 0, JSEXN_INTERNALERR, \"too many switch cases\")\nMSG_DEF(JSMSG_BAD_SWITCH,             116, 0, JSEXN_SYNTAXERR, \"invalid switch statement\")\nMSG_DEF(JSMSG_BAD_FOR_LEFTSIDE,       117, 0, JSEXN_SYNTAXERR, \"invalid for/in left-hand side\")\nMSG_DEF(JSMSG_CATCH_AFTER_GENERAL,    118, 0, JSEXN_SYNTAXERR, \"catch after unconditional catch\")\nMSG_DEF(JSMSG_CATCH_WITHOUT_TRY,      119, 0, JSEXN_SYNTAXERR, \"catch without try\")\nMSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,    120, 0, JSEXN_SYNTAXERR, \"finally without try\")\nMSG_DEF(JSMSG_LABEL_NOT_FOUND,        121, 0, JSEXN_SYNTAXERR, \"label not found\")\nMSG_DEF(JSMSG_TOUGH_BREAK,            122, 0, JSEXN_SYNTAXERR, \"unlabeled break must be inside loop or switch\")\nMSG_DEF(JSMSG_BAD_CONTINUE,           123, 0, JSEXN_SYNTAXERR, \"continue must be inside loop\")\nMSG_DEF(JSMSG_BAD_RETURN_OR_YIELD,    124, 1, JSEXN_SYNTAXERR, \"{0} not in function\")\nMSG_DEF(JSMSG_BAD_LABEL,              125, 0, JSEXN_SYNTAXERR, \"invalid label\")\nMSG_DEF(JSMSG_DUPLICATE_LABEL,        126, 0, JSEXN_SYNTAXERR, \"duplicate label\")\nMSG_DEF(JSMSG_VAR_HIDES_ARG,          127, 1, JSEXN_TYPEERR, \"variable {0} redeclares argument\")\nMSG_DEF(JSMSG_BAD_VAR_INIT,           128, 0, JSEXN_SYNTAXERR, \"invalid variable initialization\")\nMSG_DEF(JSMSG_BAD_LEFTSIDE_OF_ASS,    129, 0, JSEXN_REFERENCEERR, \"invalid assignment left-hand side\")\nMSG_DEF(JSMSG_BAD_OPERAND,            130, 1, JSEXN_SYNTAXERR, \"invalid {0} operand\")\nMSG_DEF(JSMSG_BAD_PROP_ID,            131, 0, JSEXN_SYNTAXERR, \"invalid property id\")\nMSG_DEF(JSMSG_RESERVED_ID,            132, 1, JSEXN_SYNTAXERR, \"{0} is a reserved identifier\")\nMSG_DEF(JSMSG_SYNTAX_ERROR,           133, 0, JSEXN_SYNTAXERR, \"syntax error\")\nMSG_DEF(JSMSG_MISSING_BINARY_DIGITS,  134, 0, JSEXN_SYNTAXERR, \"missing binary digits after '0b'\")\nMSG_DEF(JSMSG_BAD_PROTOTYPE,          135, 1, JSEXN_TYPEERR,   \"'prototype' property of {0} is not an object\")\nMSG_DEF(JSMSG_MISSING_EXPONENT,       136, 0, JSEXN_SYNTAXERR, \"missing exponent\")\nMSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, \"out of memory\")\nMSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, \"unterminated string literal\")\nMSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, \"too many parentheses in regular expression\")\nMSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, \"unterminated comment\")\nMSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, \"unterminated regular expression literal\")\nMSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, \"bad cloned function scope chain\")\nMSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, \"missing octal digits after '0o'\")\nMSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, \"illegal character\")\nMSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, \"{0} is not a legal ECMA-262 octal constant\")\nMSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, \"repeat count must be less than infinity and not overflow maximum string size\")\nMSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, \"uncaught exception: {0}\")\nMSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, \"non-octal digit in an escape sequence that doesn't match a back-reference\")\nMSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, \"back-reference exceeds number of capturing parentheses\")\nMSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, \"precision {0} out of range\")\nMSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, \"invalid {0} usage\")\nMSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, \"invalid array length\")\nMSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, \"can't describe non-native properties of class {0}\")\nMSG_DEF(JSMSG_BAD_APPLY_ARGS,         154, 1, JSEXN_TYPEERR, \"second argument to Function.prototype.{0} must be an array\")\nMSG_DEF(JSMSG_REDECLARED_VAR,         155, 2, JSEXN_TYPEERR, \"redeclaration of {0} {1}\")\nMSG_DEF(JSMSG_UNDECLARED_VAR,         156, 1, JSEXN_REFERENCEERR, \"assignment to undeclared variable {0}\")\nMSG_DEF(JSMSG_ANON_NO_RETURN_VALUE,   157, 0, JSEXN_TYPEERR, \"anonymous function does not always return a value\")\nMSG_DEF(JSMSG_DEPRECATED_USAGE,       158, 1, JSEXN_REFERENCEERR, \"deprecated {0} usage\")\nMSG_DEF(JSMSG_BAD_URI,                159, 0, JSEXN_URIERR, \"malformed URI sequence\")\nMSG_DEF(JSMSG_GETTER_ONLY,            160, 0, JSEXN_TYPEERR, \"setting a property that has only a getter\")\nMSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,   161, 0, JSEXN_SYNTAXERR, \"identifier starts immediately after numeric literal\")\nMSG_DEF(JSMSG_UNDEFINED_PROP,         162, 1, JSEXN_REFERENCEERR, \"reference to undefined property {0}\")\nMSG_DEF(JSMSG_USELESS_EXPR,           163, 0, JSEXN_TYPEERR, \"useless expression\")\nMSG_DEF(JSMSG_REDECLARED_PARAM,       164, 1, JSEXN_TYPEERR, \"redeclaration of formal parameter {0}\")\nMSG_DEF(JSMSG_NEWREGEXP_FLAGGED,      165, 0, JSEXN_TYPEERR, \"can't supply flags when constructing one RegExp from another\")\nMSG_DEF(JSMSG_RESERVED_SLOT_RANGE,    166, 0, JSEXN_RANGEERR, \"reserved slot index out of range\")\nMSG_DEF(JSMSG_CANT_DECODE_PRINCIPALS, 167, 0, JSEXN_INTERNALERR, \"can't decode JSPrincipals\")\nMSG_DEF(JSMSG_CANT_SEAL_OBJECT,       168, 1, JSEXN_ERR, \"can't seal {0} objects\")\nMSG_DEF(JSMSG_TOO_MANY_CATCH_VARS,    169, 0, JSEXN_SYNTAXERR, \"too many catch variables\")\nMSG_DEF(JSMSG_NEGATIVE_REPETITION_COUNT, 170, 0, JSEXN_RANGEERR, \"repeat count must be non-negative\")\nMSG_DEF(JSMSG_UNUSED171,              171, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED172,              172, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED173,              173, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED174,              174, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_NESTING_GENERATOR,      175, 0, JSEXN_TYPEERR, \"already executing generator\")\nMSG_DEF(JSMSG_UNUSED176,              176, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED177,              177, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED178,              178, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED179,              179, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED180,              180, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED181,              181, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SEND,     182, 1, JSEXN_TYPEERR, \"attempt to send {0} to newborn generator\")\nMSG_DEF(JSMSG_UNUSED183,              183, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED184,              184, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE, 185, 0, JSEXN_TYPEERR, \"proxy can't report an extensible object as non-extensible\")\nMSG_DEF(JSMSG_UNUSED186,              186, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED187,              187, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INCOMPATIBLE_METHOD,    188, 3, JSEXN_TYPEERR, \"{0} {1} called on incompatible {2}\")\nMSG_DEF(JSMSG_UNUSED189,              189, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED190,              190, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED191,              191, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED192,              192, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_FOR_EACH_LOOP,      193, 0, JSEXN_SYNTAXERR, \"invalid for each loop\")\nMSG_DEF(JSMSG_UNUSED194,              194, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED195,              195, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED196,              196, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INTERNAL_INTL_ERROR,    197, 0, JSEXN_ERR, \"internal error while computing Intl data\")\nMSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR,   198, 0, JSEXN_ERR, \"internal error getting the default locale\")\nMSG_DEF(JSMSG_TOO_MANY_LOCALS,        199, 0, JSEXN_SYNTAXERR, \"too many local variables\")\nMSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG,     200, 0, JSEXN_INTERNALERR, \"array initialiser too large\")\nMSG_DEF(JSMSG_REGEXP_TOO_COMPLEX,     201, 0, JSEXN_INTERNALERR, \"regular expression too complex\")\nMSG_DEF(JSMSG_BUFFER_TOO_SMALL,       202, 0, JSEXN_INTERNALERR, \"buffer too small\")\nMSG_DEF(JSMSG_BAD_SURROGATE_CHAR,     203, 1, JSEXN_TYPEERR, \"bad surrogate character {0}\")\nMSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE,    204, 1, JSEXN_TYPEERR, \"UTF-8 character {0} too large\")\nMSG_DEF(JSMSG_MALFORMED_UTF8_CHAR,    205, 1, JSEXN_TYPEERR, \"malformed UTF-8 character sequence at offset {0}\")\nMSG_DEF(JSMSG_USER_DEFINED_ERROR,     206, 0, JSEXN_ERR, \"JS_ReportError was called\")\nMSG_DEF(JSMSG_WRONG_CONSTRUCTOR,      207, 1, JSEXN_TYPEERR, \"wrong constructor called for {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_RETURN,   208, 1, JSEXN_TYPEERR, \"generator function {0} returns a value\")\nMSG_DEF(JSMSG_BAD_ANON_GENERATOR_RETURN, 209, 0, JSEXN_TYPEERR, \"anonymous generator function returns a value\")\nMSG_DEF(JSMSG_NAME_AFTER_FOR_PAREN,   210, 0, JSEXN_SYNTAXERR, \"missing name after for (\")\nMSG_DEF(JSMSG_IN_AFTER_FOR_NAME,      211, 0, JSEXN_SYNTAXERR, \"missing 'in' or 'of' after for\")\nMSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE,  212, 2, JSEXN_TYPEERR,\"trap {1} for {0} returned a primitive value\")\nMSG_DEF(JSMSG_UNUSED213,              213, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_YIELD,    214, 1, JSEXN_TYPEERR, \"yield from closing generator {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SYNTAX,   215, 1, JSEXN_SYNTAXERR, \"{0} expression must be parenthesized\")\nMSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE,    216, 0, JSEXN_SYNTAXERR, \"invalid array comprehension left-hand side\")\nMSG_DEF(JSMSG_UNUSED217,              217, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE,     218, 0, JSEXN_TYPEERR, \"reduce of empty array with no initial value\")\nMSG_DEF(JSMSG_UNUSED219,              219, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_DELETE_OPERAND,     220, 0, JSEXN_REFERENCEERR, \"invalid delete operand\")\nMSG_DEF(JSMSG_BAD_INCOP_OPERAND,      221, 0, JSEXN_REFERENCEERR, \"invalid increment/decrement operand\")\nMSG_DEF(JSMSG_UNEXPECTED_TYPE,        222, 2, JSEXN_TYPEERR, \"{0} is {1}\")\nMSG_DEF(JSMSG_LET_DECL_NOT_IN_BLOCK,  223, 0, JSEXN_SYNTAXERR, \"let declaration not directly within block\")\nMSG_DEF(JSMSG_BAD_OBJECT_INIT,        224, 0, JSEXN_SYNTAXERR, \"invalid object initializer\")\nMSG_DEF(JSMSG_CANT_SET_ARRAY_ATTRS,   225, 0, JSEXN_INTERNALERR, \"can't set attributes on indexed array properties\")\nMSG_DEF(JSMSG_EVAL_ARITY,             226, 0, JSEXN_TYPEERR, \"eval accepts only one parameter\")\nMSG_DEF(JSMSG_MISSING_FUN_ARG,        227, 2, JSEXN_TYPEERR, \"missing argument {0} when calling function {1}\")\nMSG_DEF(JSMSG_JSON_BAD_PARSE,         228, 1, JSEXN_SYNTAXERR, \"JSON.parse: {0}\")\nMSG_DEF(JSMSG_JSON_BAD_STRINGIFY,     229, 0, JSEXN_ERR, \"JSON.stringify\")\nMSG_DEF(JSMSG_NOT_CALLABLE_OR_UNDEFINED, 230, 0, JSEXN_TYPEERR, \"value is not a function or undefined\")\nMSG_DEF(JSMSG_NOT_NONNULL_OBJECT,     231, 0, JSEXN_TYPEERR, \"value is not a non-null object\")\nMSG_DEF(JSMSG_DEPRECATED_OCTAL,       232, 0, JSEXN_SYNTAXERR, \"octal literals and octal escape sequences are deprecated\")\nMSG_DEF(JSMSG_STRICT_CODE_WITH,       233, 0, JSEXN_SYNTAXERR, \"strict mode code may not contain 'with' statements\")\nMSG_DEF(JSMSG_DUPLICATE_PROPERTY,     234, 1, JSEXN_SYNTAXERR, \"property name {0} appears more than once in object literal\")\nMSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 235, 0, JSEXN_SYNTAXERR, \"applying the 'delete' operator to an unqualified name is deprecated\")\nMSG_DEF(JSMSG_BAD_STRICT_ASSIGN,      236, 1, JSEXN_SYNTAXERR, \"can't assign to {0} in strict mode\")\nMSG_DEF(JSMSG_BAD_BINDING,            237, 1, JSEXN_SYNTAXERR, \"redefining {0} is deprecated\")\nMSG_DEF(JSMSG_INVALID_DESCRIPTOR,     238, 0, JSEXN_TYPEERR, \"property descriptors must not specify a value or be writable when a getter or setter has been specified\")\nMSG_DEF(JSMSG_OBJECT_NOT_EXTENSIBLE,  239, 1, JSEXN_TYPEERR, \"{0} is not extensible\")\nMSG_DEF(JSMSG_CANT_REDEFINE_PROP,     240, 1, JSEXN_TYPEERR, \"can't redefine non-configurable property '{0}'\")\nMSG_DEF(JSMSG_CANT_APPEND_TO_ARRAY,   241, 0, JSEXN_TYPEERR, \"can't add elements past the end of an array if its length property is unwritable\")\nMSG_DEF(JSMSG_CANT_REDEFINE_ARRAY_LENGTH,242, 0, JSEXN_TYPEERR, \"can't redefine array length\")\nMSG_DEF(JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH,243, 0, JSEXN_TYPEERR, \"can't define array index property past the end of an array with non-writable length\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_INDEX,  244, 0, JSEXN_ERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG, 245, 1, JSEXN_ERR, \"argument {0} must be >= 0\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS,   246, 0, JSEXN_ERR, \"invalid arguments\")\nMSG_DEF(JSMSG_CSP_BLOCKED_FUNCTION,   247, 0, JSEXN_ERR, \"call to Function() blocked by CSP\")\nMSG_DEF(JSMSG_BAD_GET_SET_FIELD,      248, 1, JSEXN_TYPEERR, \"property descriptor's {0} field is neither undefined nor a function\")\nMSG_DEF(JSMSG_BAD_PROXY_FIX,          249, 0, JSEXN_TYPEERR, \"proxy was fixed while executing the handler\")\nMSG_DEF(JSMSG_INVALID_EVAL_SCOPE_ARG, 250, 0, JSEXN_EVALERR, \"invalid eval scope argument\")\nMSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS,    251, 3, JSEXN_SYNTAXERR, \"{0} functions must have {1} argument{2}\")\nMSG_DEF(JSMSG_THROW_TYPE_ERROR,       252, 0, JSEXN_TYPEERR, \"'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them\")\nMSG_DEF(JSMSG_BAD_TOISOSTRING_PROP,   253, 0, JSEXN_TYPEERR, \"toISOString property is not callable\")\nMSG_DEF(JSMSG_BAD_PARSE_NODE,         254, 0, JSEXN_INTERNALERR, \"bad parse node\")\nMSG_DEF(JSMSG_NOT_EXPECTED_TYPE,      255, 3, JSEXN_TYPEERR, \"{0}: expected {1}, got {2}\")\nMSG_DEF(JSMSG_CALLER_IS_STRICT,       256, 0, JSEXN_TYPEERR, \"access to strict mode caller function is censored\")\nMSG_DEF(JSMSG_NEED_DEBUG_MODE,        257, 0, JSEXN_ERR, \"function can be called only in debug mode\")\nMSG_DEF(JSMSG_STRICT_CODE_LET_EXPR_STMT, 258, 0, JSEXN_ERR, \"strict mode code may not contain unparenthesized let expression statements\")\nMSG_DEF(JSMSG_CANT_CHANGE_EXTENSIBILITY, 259, 0, JSEXN_TYPEERR, \"can't change object's extensibility\")\nMSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA, 260, 1, JSEXN_INTERNALERR, \"bad serialized structured data ({0})\")\nMSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE,    261, 0, JSEXN_TYPEERR, \"unsupported type for structured data\")\nMSG_DEF(JSMSG_SC_RECURSION,           262, 0, JSEXN_INTERNALERR, \"recursive object\")\nMSG_DEF(JSMSG_DEBUG_CANT_DEBUG_GLOBAL, 263, 0, JSEXN_ERR, \"passing non-debuggable global to addDebuggee\")\nMSG_DEF(JSMSG_BAD_CLONE_VERSION,      264, 0, JSEXN_ERR, \"unsupported structured clone version\")\nMSG_DEF(JSMSG_CANT_CLONE_OBJECT,      265, 0, JSEXN_TYPEERR, \"can't clone object\")\nMSG_DEF(JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED, 266, 0, JSEXN_TYPEERR, \"resumption values are disallowed in this hook\")\nMSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, \"in strict mode code, functions may be declared only at top level or immediately within another function\")\nMSG_DEF(JSMSG_INVALID_FOR_IN_INIT,    268, 0, JSEXN_SYNTAXERR, \"for-in loop let declaration may not have an initializer\")\nMSG_DEF(JSMSG_CLEARED_SCOPE,          269, 0, JSEXN_TYPEERR, \"attempt to run compile-and-go script on a cleared scope\")\nMSG_DEF(JSMSG_MALFORMED_ESCAPE,       270, 1, JSEXN_SYNTAXERR, \"malformed {0} character escape sequence\")\nMSG_DEF(JSMSG_BAD_GENEXP_BODY,        271, 1, JSEXN_SYNTAXERR, \"illegal use of {0} in generator expression\")\nMSG_DEF(JSMSG_YIELD_WITHOUT_OPERAND,  272, 0, JSEXN_SYNTAXERR, \"yield without a value is deprecated, and illegal in ES6 (use 'yield undefined' instead)\")\nMSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT,  273, 0, JSEXN_SYNTAXERR, \"function statement requires a name\")\nMSG_DEF(JSMSG_CCW_REQUIRED,           274, 1, JSEXN_TYPEERR, \"{0}: argument must be an object from a different compartment\")\nMSG_DEF(JSMSG_DEBUG_BAD_RESUMPTION,   275, 0, JSEXN_TYPEERR, \"debugger resumption value must be undefined, {throw: val}, {return: val}, or null\")\nMSG_DEF(JSMSG_ASSIGN_FUNCTION_OR_NULL, 276, 1, JSEXN_TYPEERR, \"value assigned to {0} must be a function or null\")\nMSG_DEF(JSMSG_DEBUG_NOT_LIVE,         277, 1, JSEXN_ERR, \"{0} is not live\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_WRONG_OWNER, 278, 0, JSEXN_TYPEERR, \"Debugger.Object belongs to a different Debugger\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_PROTO,     279, 0, JSEXN_TYPEERR, \"Debugger.Object.prototype is not a valid Debugger.Object\")\nMSG_DEF(JSMSG_DEBUG_LOOP,             280, 0, JSEXN_TYPEERR, \"cannot debug an object in same compartment as debugger or a compartment that is already debugging the debugger\")\nMSG_DEF(JSMSG_DEBUG_NOT_IDLE,         281, 0, JSEXN_ERR, \"can't start debugging: a debuggee script is on the stack\")\nMSG_DEF(JSMSG_DEBUG_BAD_OFFSET,       282, 0, JSEXN_TYPEERR, \"invalid script offset\")\nMSG_DEF(JSMSG_DEBUG_BAD_LINE,         283, 0, JSEXN_TYPEERR, \"invalid line number\")\nMSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING,    284, 0, JSEXN_ERR, \"can't set breakpoint: script global is not a debuggee\")\nMSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, \"{0}: descriptor .{1} property is an object in a different compartment than the target object\")\nMSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, \"stack frame is not running JavaScript code\")\nMSG_DEF(JSMSG_CANT_WATCH_PROP,        287, 0, JSEXN_TYPEERR, \"properties whose names are objects can't be watched\")\nMSG_DEF(JSMSG_CSP_BLOCKED_EVAL,       288, 0, JSEXN_ERR, \"call to eval() blocked by CSP\")\nMSG_DEF(JSMSG_DEBUG_NO_SCOPE_OBJECT,  289, 0, JSEXN_TYPEERR, \"declarative Environments don't have binding objects\")\nMSG_DEF(JSMSG_EMPTY_CONSEQUENT,       290, 0, JSEXN_SYNTAXERR, \"mistyped ; after conditional?\")\nMSG_DEF(JSMSG_NOT_ITERABLE,           291, 1, JSEXN_TYPEERR, \"{0} is not iterable\")\nMSG_DEF(JSMSG_QUERY_LINE_WITHOUT_URL, 292, 0, JSEXN_TYPEERR, \"findScripts query object has 'line' property, but no 'url' property\")\nMSG_DEF(JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL, 293, 0, JSEXN_TYPEERR, \"findScripts query object has 'innermost' property without both 'url' and 'line' properties\")\nMSG_DEF(JSMSG_DEBUG_VARIABLE_NOT_FOUND, 294, 0, JSEXN_TYPEERR, \"variable not found in environment\")\nMSG_DEF(JSMSG_PARAMETER_AFTER_REST,   295, 0, JSEXN_SYNTAXERR, \"parameter after rest parameter\")\nMSG_DEF(JSMSG_NO_REST_NAME,           296, 0, JSEXN_SYNTAXERR, \"no parameter name after ...\")\nMSG_DEF(JSMSG_ARGUMENTS_AND_REST,     297, 0, JSEXN_SYNTAXERR, \"'arguments' object may not be used in conjunction with a rest parameter\")\nMSG_DEF(JSMSG_FUNCTION_ARGUMENTS_AND_REST, 298, 0, JSEXN_ERR, \"the 'arguments' property of a function with a rest parameter may not be used\")\nMSG_DEF(JSMSG_REST_WITH_DEFAULT,      299, 0, JSEXN_SYNTAXERR, \"rest parameter may not have a default\")\nMSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, \"parameter(s) with default followed by parameter without default\")\nMSG_DEF(JSMSG_YIELD_IN_DEFAULT,       301, 0, JSEXN_SYNTAXERR, \"yield in default expression\")\nMSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED,  302, 1, JSEXN_REFERENCEERR, \"no intrinsic function {0}\")\nMSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP,  303, 1, JSEXN_ERR,      \"{0} is being assigned a source map, yet already has one\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG,      304, 1, JSEXN_RANGEERR, \"invalid ParallelArray{0} argument\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, \"argument must be divisible by outermost dimension\")\nMSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, \"cannot reduce ParallelArray object whose outermost dimension is empty\")\nMSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, \"cannot flatten 1-dimensional ParallelArray object\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, \"no conflict resolution function provided\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, \"index in scatter vector out of bounds\")\nMSG_DEF(JSMSG_CANT_REPORT_NC_AS_NE,   310, 0, JSEXN_TYPEERR, \"proxy can't report a non-configurable own property as non-existent\")\nMSG_DEF(JSMSG_CANT_REPORT_E_AS_NE,    311, 0, JSEXN_TYPEERR, \"proxy can't report an existing own property as non-existent on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_NEW,        312, 0, JSEXN_TYPEERR, \"proxy can't report a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_INVALID,    313, 0, JSEXN_TYPEERR, \"proxy can't report an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_REPORT_NE_AS_NC,   314, 0, JSEXN_TYPEERR, \"proxy can't report a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_CANT_DEFINE_NEW,        315, 0, JSEXN_TYPEERR, \"proxy can't define a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_DEFINE_INVALID,    316, 0, JSEXN_TYPEERR, \"proxy can't define an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_DEFINE_NE_AS_NC,   317, 0, JSEXN_TYPEERR, \"proxy can't define a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_INVALID_TRAP_RESULT,    318, 2, JSEXN_TYPEERR, \"trap {1} for {0} returned an invalid result\")\nMSG_DEF(JSMSG_CANT_SKIP_NC,           319, 0, JSEXN_TYPEERR, \"proxy can't skip a non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_SAME_VALUE, 320, 0, JSEXN_TYPEERR, \"proxy must report the same value for a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_UNDEFINED,  321, 0, JSEXN_TYPEERR, \"proxy must report undefined for a non-configurable accessor property without a getter\")\nMSG_DEF(JSMSG_CANT_SET_NW_NC,         322, 0, JSEXN_TYPEERR, \"proxy can't successfully set a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_CANT_SET_WO_SETTER,     323, 0, JSEXN_TYPEERR, \"proxy can't succesfully set an accessor property without a setter\")\nMSG_DEF(JSMSG_DEBUG_BAD_REFERENT,     324, 2, JSEXN_TYPEERR, \"{0} does not refer to {1}\")\nMSG_DEF(JSMSG_DEBUG_WRAPPER_IN_WAY,   325, 2, JSEXN_TYPEERR, \"{0} is a wrapper around {1}, but a direct reference is required\")\nMSG_DEF(JSMSG_UNWRAP_DENIED,          326, 0, JSEXN_ERR, \"permission denied to unwrap object\")\nMSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 327, 3, JSEXN_TYPEERR, \"Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}\")\nMSG_DEF(JSMSG_INVALID_LOCALES_ELEMENT,328, 0, JSEXN_TYPEERR, \"invalid element in locales argument\")\nMSG_DEF(JSMSG_INVALID_LANGUAGE_TAG,   329, 1, JSEXN_RANGEERR, \"invalid language tag: {0}\")\nMSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, \"invalid locale matcher in supportedLocalesOf(): {0}\")\nMSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, \"invalid value {1} for option {0}\")\nMSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, \"invalid digits value: {0}\")\nMSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, \"can't initialize object twice as an object of an Intl constructor\")\nMSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, \"invalid currency code in NumberFormat(): {0}\")\nMSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, \"undefined currency in NumberFormat() with currency style\")\nMSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, \"invalid time zone in DateTimeFormat(): {0}\")\nMSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, \"date value is not finite in DateTimeFormat.format()\")\nMSG_DEF(JSMSG_MODULE_STATEMENT,       338, 0, JSEXN_SYNTAXERR, \"module declarations may only appear at the top level of a program or module body\")\nMSG_DEF(JSMSG_CURLY_BEFORE_MODULE,    339, 0, JSEXN_SYNTAXERR, \"missing { before module body\")\nMSG_DEF(JSMSG_CURLY_AFTER_MODULE,     340, 0, JSEXN_SYNTAXERR, \"missing } after module body\")\nMSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 341, 0, JSEXN_SYNTAXERR, \"\\\"use asm\\\" is only meaningful in the Directive Prologue of a function body\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_FAIL,      342, 1, JSEXN_TYPEERR, \"asm.js type error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_LINK_FAIL,      343, 1, JSEXN_TYPEERR, \"asm.js link error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_OK,        344, 1, JSEXN_ERR,     \"successfully compiled asm.js code ({0})\")\nMSG_DEF(JSMSG_BAD_ARROW_ARGS,         345, 0, JSEXN_SYNTAXERR, \"invalid arrow-function arguments (parentheses around the arrow-function may help)\")\nMSG_DEF(JSMSG_YIELD_IN_ARROW,         346, 0, JSEXN_SYNTAXERR, \"arrow function may not contain yield\")\nMSG_DEF(JSMSG_WRONG_VALUE,            347, 2, JSEXN_ERR, \"expected {0} but found {1}\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, \"target for index {0} is not an integer\")\nMSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME,349, 0, JSEXN_TYPEERR, \"self-hosted code may not contain unbound name lookups\")\nMSG_DEF(JSMSG_DEPRECATED_SOURCE_MAP,  350, 0, JSEXN_SYNTAXERR, \"Using //@ to indicate source map URL pragmas is deprecated. Use //# instead\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASSIGN,    351, 1, JSEXN_SYNTAXERR, \"can't assign to {0} using destructuring assignment\")\nMSG_DEF(JSMSG_BINARYDATA_ARRAYTYPE_BAD_ARGS, 352, 0, JSEXN_ERR, \"Invalid arguments\")\nMSG_DEF(JSMSG_BINARYDATA_BINARYARRAY_BAD_INDEX, 353, 0, JSEXN_RANGEERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_ARGS, 354, 0, JSEXN_RANGEERR, \"invalid field descriptor\")\nMSG_DEF(JSMSG_BINARYDATA_NOT_BINARYSTRUCT,   355, 1, JSEXN_TYPEERR, \"{0} is not a BinaryStruct\")\nMSG_DEF(JSMSG_BINARYDATA_SUBARRAY_INTEGER_ARG, 356, 1, JSEXN_ERR, \"argument {0} must be an integer\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_EMPTY_DESCRIPTOR, 357, 0, JSEXN_ERR, \"field descriptor cannot be empty\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_FIELD, 358, 1, JSEXN_ERR, \"field {0} is not a valid BinaryData Type descriptor\")\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsalloc.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS allocation policies. */\n\n#ifndef jsalloc_h\n#define jsalloc_h\n\n#include \"mozilla/AllocPolicy.h\"\n\n#include \"js/Utility.h\"\n\nstruct JSContext;\n\nnamespace js {\n\nclass ContextFriendFields;\n\n/* Policy for using system memory functions and doing no error reporting. */\nclass SystemAllocPolicy\n{\n  public:\n    void *malloc_(size_t bytes) { return js_malloc(bytes); }\n    void *calloc_(size_t bytes) { return js_calloc(bytes); }\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }\n    void free_(void *p) { js_free(p); }\n    void reportAllocOverflow() const {}\n};\n\n/*\n * Allocation policy that calls the system memory functions and reports errors\n * to the context. Since the JSContext given on construction is stored for\n * the lifetime of the container, this policy may only be used for containers\n * whose lifetime is a shorter than the given JSContext.\n *\n * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,\n * not the system ones.\n */\nclass TempAllocPolicy\n{\n    ContextFriendFields *const cx_;\n\n    /*\n     * Non-inline helper to call JSRuntime::onOutOfMemory with minimal\n     * code bloat.\n     */\n    JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);\n\n  public:\n    TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(\n    TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}\n\n    void *malloc_(size_t bytes) {\n        void *p = js_malloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *calloc_(size_t bytes) {\n        void *p = js_calloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) {\n        void *p2 = js_realloc(p, bytes);\n        if (JS_UNLIKELY(!p2))\n            p2 = onOutOfMemory(p2, bytes);\n        return p2;\n    }\n\n    void free_(void *p) {\n        js_free(p);\n    }\n\n    JS_FRIEND_API(void) reportAllocOverflow() const;\n};\n\n} /* namespace js */\n\n#endif /* jsalloc_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JavaScript API. */\n\n#ifndef jsapi_h\n#define jsapi_h\n\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/RangedPtr.h\"\n#include \"mozilla/ThreadLocal.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"js-config.h\"\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n#include \"js/CharacterEncoding.h\"\n#include \"js/HashTable.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n#include \"js/Value.h\"\n#include \"js/Vector.h\"\n\n/************************************************************************/\n\nnamespace JS {\n\ntypedef mozilla::RangedPtr<const jschar> CharPtr;\n\nclass StableCharPtr : public CharPtr {\n  public:\n    StableCharPtr(const StableCharPtr &s) : CharPtr(s) {}\n    StableCharPtr(const mozilla::RangedPtr<const jschar> &s) : CharPtr(s) {}\n    StableCharPtr(const jschar *s, size_t len) : CharPtr(s, len) {}\n    StableCharPtr(const jschar *pos, const jschar *start, size_t len)\n      : CharPtr(pos, start, len)\n    {}\n};\n\n#if defined JS_THREADSAFE && defined DEBUG\n\nclass JS_PUBLIC_API(AutoCheckRequestDepth)\n{\n    JSContext *cx;\n  public:\n    AutoCheckRequestDepth(JSContext *cx);\n    AutoCheckRequestDepth(js::ContextFriendFields *cx);\n    ~AutoCheckRequestDepth();\n};\n\n# define CHECK_REQUEST(cx) \\\n    JS::AutoCheckRequestDepth _autoCheckRequestDepth(cx)\n\n#else\n\n# define CHECK_REQUEST(cx) \\\n    ((void) 0)\n\n#endif /* JS_THREADSAFE && DEBUG */\n\n#ifdef DEBUG\n/*\n * Assert that we're not doing GC on cx, that we're in a request as\n * needed, and that the compartments for cx and v are correct.\n * Also check that GC would be safe at this point.\n */\nJS_PUBLIC_API(void)\nAssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v);\n#else\ninline void AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v) {\n    /* Do nothing */\n}\n#endif /* DEBUG */\n\nclass JS_PUBLIC_API(AutoGCRooter) {\n  public:\n    AutoGCRooter(JSContext *cx, ptrdiff_t tag);\n    AutoGCRooter(js::ContextFriendFields *cx, ptrdiff_t tag);\n\n    ~AutoGCRooter() {\n        JS_ASSERT(this == *stackTop);\n        *stackTop = down;\n    }\n\n    /* Implemented in gc/RootMarking.cpp. */\n    inline void trace(JSTracer *trc);\n    static void traceAll(JSTracer *trc);\n    static void traceAllWrappers(JSTracer *trc);\n\n  protected:\n    AutoGCRooter * const down;\n\n    /*\n     * Discriminates actual subclass of this being used.  If non-negative, the\n     * subclass roots an array of values of the length stored in this field.\n     * If negative, meaning is indicated by the corresponding value in the enum\n     * below.  Any other negative value indicates some deeper problem such as\n     * memory corruption.\n     */\n    ptrdiff_t tag_;\n\n    enum {\n        VALARRAY =     -2, /* js::AutoValueArray */\n        PARSER =       -3, /* js::frontend::Parser */\n        SHAPEVECTOR =  -4, /* js::AutoShapeVector */\n        IDARRAY =      -6, /* js::AutoIdArray */\n        DESCRIPTORS =  -7, /* js::AutoPropDescArrayRooter */\n        ID =           -9, /* js::AutoIdRooter */\n        VALVECTOR =   -10, /* js::AutoValueVector */\n        DESCRIPTOR =  -11, /* js::AutoPropertyDescriptorRooter */\n        STRING =      -12, /* js::AutoStringRooter */\n        IDVECTOR =    -13, /* js::AutoIdVector */\n        OBJVECTOR =   -14, /* js::AutoObjectVector */\n        STRINGVECTOR =-15, /* js::AutoStringVector */\n        SCRIPTVECTOR =-16, /* js::AutoScriptVector */\n        NAMEVECTOR =  -17, /* js::AutoNameVector */\n        HASHABLEVALUE=-18, /* js::HashableValue */\n        IONMASM =     -19, /* js::jit::MacroAssembler */\n        IONALLOC =    -20, /* js::jit::AutoTempAllocatorRooter */\n        WRAPVECTOR =  -21, /* js::AutoWrapperVector */\n        WRAPPER =     -22, /* js::AutoWrapperRooter */\n        OBJOBJHASHMAP=-23, /* js::AutoObjectObjectHashMap */\n        OBJU32HASHMAP=-24, /* js::AutoObjectUnsigned32HashMap */\n        OBJHASHSET =  -25, /* js::AutoObjectHashSet */\n        JSONPARSER =  -26, /* js::JSONParser */\n        CUSTOM =      -27, /* js::CustomAutoRooter */\n        FUNVECTOR =   -28  /* js::AutoFunctionVector */\n    };\n\n  private:\n    AutoGCRooter ** const stackTop;\n\n    /* No copy or assignment semantics. */\n    AutoGCRooter(AutoGCRooter &ida) MOZ_DELETE;\n    void operator=(AutoGCRooter &ida) MOZ_DELETE;\n};\n\nclass AutoStringRooter : private AutoGCRooter {\n  public:\n    AutoStringRooter(JSContext *cx, JSString *str = NULL\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, STRING), str_(str)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    void setString(JSString *str) {\n        str_ = str;\n    }\n\n    JSString * string() const {\n        return str_;\n    }\n\n    JSString ** addr() {\n        return &str_;\n    }\n\n    JSString * const * addr() const {\n        return &str_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    JSString *str_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoArrayRooter : private AutoGCRooter {\n  public:\n    AutoArrayRooter(JSContext *cx, size_t len, Value *vec\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, len), array(vec), skip(cx, array, len)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeLength(size_t newLength) {\n        tag_ = ptrdiff_t(newLength);\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeArray(Value *newArray, size_t newLength) {\n        changeLength(newLength);\n        array = newArray;\n    }\n\n    Value *array;\n\n    MutableHandleValue handleAt(size_t i)\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return MutableHandleValue::fromMarkedLocation(&array[i]);\n    }\n    HandleValue handleAt(size_t i) const\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return HandleValue::fromMarkedLocation(&array[i]);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    js::SkipRoot skip;\n};\n\ntemplate<class T>\nclass AutoVectorRooter : protected AutoGCRooter\n{\n  public:\n    explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoVectorRooter(js::ContextFriendFields *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef T ElementType;\n\n    size_t length() const { return vector.length(); }\n    bool empty() const { return vector.empty(); }\n\n    bool append(const T &v) { return vector.append(v); }\n    bool appendAll(const AutoVectorRooter<T> &other) {\n        return vector.appendAll(other.vector);\n    }\n\n    bool insert(T *p, const T &val) { return vector.insert(p, val); }\n\n    /* For use when space has already been reserved. */\n    void infallibleAppend(const T &v) { vector.infallibleAppend(v); }\n\n    void popBack() { vector.popBack(); }\n    T popCopy() { return vector.popCopy(); }\n\n    bool growBy(size_t inc) {\n        size_t oldLength = vector.length();\n        if (!vector.growByUninitialized(inc))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    bool resize(size_t newLength) {\n        size_t oldLength = vector.length();\n        if (newLength <= oldLength) {\n            vector.shrinkBy(oldLength - newLength);\n            return true;\n        }\n        if (!vector.growByUninitialized(newLength - oldLength))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    void clear() { vector.clear(); }\n\n    bool reserve(size_t newLength) {\n        return vector.reserve(newLength);\n    }\n\n    T &operator[](size_t i) { return vector[i]; }\n    const T &operator[](size_t i) const { return vector[i]; }\n\n    JS::MutableHandle<T> handleAt(size_t i) { return JS::MutableHandle<T>::fromMarkedLocation(&vector[i]); }\n    JS::Handle<T> handleAt(size_t i) const { return JS::Handle<T>::fromMarkedLocation(&vector[i]); }\n\n    const T *begin() const { return vector.begin(); }\n    T *begin() { return vector.begin(); }\n\n    const T *end() const { return vector.end(); }\n    T *end() { return vector.end(); }\n\n    const T &back() const { return vector.back(); }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    void makeRangeGCSafe(size_t oldLength) {\n        T *t = vector.begin() + oldLength;\n        for (size_t i = oldLength; i < vector.length(); ++i, ++t)\n            memset(t, 0, sizeof(T));\n    }\n\n    typedef js::Vector<T, 8> VectorImpl;\n    VectorImpl vector;\n\n    /* Prevent overwriting of inline elements in vector. */\n    js::SkipRoot vectorRoot;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class Key, class Value>\nclass AutoHashMapRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashMap<Key, Value> HashMapImpl;\n\n  public:\n    explicit AutoHashMapRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), map(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n    typedef typename HashMapImpl::Lookup Lookup;\n    typedef typename HashMapImpl::Ptr Ptr;\n    typedef typename HashMapImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return map.init(len);\n    }\n    bool initialized() const {\n        return map.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return map.lookup(l);\n    }\n    void remove(Ptr p) {\n        map.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return map.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.add(p, k, v);\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        return map.add(p, k);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.relookupOrAdd(p, k, v);\n    }\n\n    typedef typename HashMapImpl::Range Range;\n    Range all() const {\n        return map.all();\n    }\n\n    typedef typename HashMapImpl::Enum Enum;\n\n    void clear() {\n        map.clear();\n    }\n\n    void finish() {\n        map.finish();\n    }\n\n    bool empty() const {\n        return map.empty();\n    }\n\n    uint32_t count() const {\n        return map.count();\n    }\n\n    size_t capacity() const {\n        return map.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return map.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return map.has(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        return map.put(k, v);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        return map.putNew(k, v);\n    }\n\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        return map.lookupWithDefault(k, defaultValue);\n    }\n\n    void remove(const Lookup &l) {\n        map.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashMapRooter(const AutoHashMapRooter &hmr) MOZ_DELETE;\n    AutoHashMapRooter &operator=(const AutoHashMapRooter &hmr) MOZ_DELETE;\n\n    HashMapImpl map;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class T>\nclass AutoHashSetRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashSet<T> HashSetImpl;\n\n  public:\n    explicit AutoHashSetRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), set(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef typename HashSetImpl::Lookup Lookup;\n    typedef typename HashSetImpl::Ptr Ptr;\n    typedef typename HashSetImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return set.init(len);\n    }\n    bool initialized() const {\n        return set.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return set.lookup(l);\n    }\n    void remove(Ptr p) {\n        set.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return set.lookupForAdd(l);\n    }\n\n    bool add(AddPtr &p, const T &t) {\n        return set.add(p, t);\n    }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return set.relookupOrAdd(p, l, t);\n    }\n\n    typedef typename HashSetImpl::Range Range;\n    Range all() const {\n        return set.all();\n    }\n\n    typedef typename HashSetImpl::Enum Enum;\n\n    void clear() {\n        set.clear();\n    }\n\n    void finish() {\n        set.finish();\n    }\n\n    bool empty() const {\n        return set.empty();\n    }\n\n    uint32_t count() const {\n        return set.count();\n    }\n\n    size_t capacity() const {\n        return set.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return set.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return set.has(l);\n    }\n\n    bool put(const T &t) {\n        return set.put(t);\n    }\n\n    bool putNew(const T &t) {\n        return set.putNew(t);\n    }\n\n    void remove(const Lookup &l) {\n        set.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashSetRooter(const AutoHashSetRooter &hmr) MOZ_DELETE;\n    AutoHashSetRooter &operator=(const AutoHashSetRooter &hmr) MOZ_DELETE;\n\n    HashSetImpl set;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoValueVector : public AutoVectorRooter<Value>\n{\n  public:\n    explicit AutoValueVector(JSContext *cx\n                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<Value>(cx, VALVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoIdVector : public AutoVectorRooter<jsid>\n{\n  public:\n    explicit AutoIdVector(JSContext *cx\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<jsid>(cx, IDVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoObjectVector : public AutoVectorRooter<JSObject *>\n{\n  public:\n    explicit AutoObjectVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoFunctionVector : public AutoVectorRooter<JSFunction *>\n{\n  public:\n    explicit AutoFunctionVector(JSContext *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoFunctionVector(js::ContextFriendFields *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoScriptVector : public AutoVectorRooter<JSScript *>\n{\n  public:\n    explicit AutoScriptVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * Cutsom rooting behavior for internal and external clients.\n */\nclass JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter\n{\n  public:\n    template <typename CX>\n    explicit CustomAutoRooter(CX *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, CUSTOM)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  protected:\n    /* Supplied by derived class to trace roots. */\n    virtual void trace(JSTracer *trc) = 0;\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Returns true if |v| is considered an acceptable this-value. */\ntypedef bool (*IsAcceptableThis)(const Value &v);\n\n/*\n * Implements the guts of a method; guaranteed to be provided an acceptable\n * this-value, as determined by a corresponding IsAcceptableThis method.\n */\ntypedef bool (*NativeImpl)(JSContext *cx, CallArgs args);\n\nnamespace detail {\n\n/* DON'T CALL THIS DIRECTLY.  It's for use only by CallNonGenericMethod! */\nextern JS_PUBLIC_API(bool)\nCallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n\n} /* namespace detail */\n\n/*\n * Methods usually act upon |this| objects only from a single global object and\n * compartment.  Sometimes, however, a method must act upon |this| values from\n * multiple global objects or compartments.  In such cases the |this| value a\n * method might see will be wrapped, such that various access to the object --\n * to its class, its private data, its reserved slots, and so on -- will not\n * work properly without entering that object's compartment.  This method\n * implements a solution to this problem.\n *\n * To implement a method that accepts |this| values from multiple compartments,\n * define two functions.  The first function matches the IsAcceptableThis type\n * and indicates whether the provided value is an acceptable |this| for the\n * method; it must be a pure function only of its argument.\n *\n *   static JSClass AnswerClass = { ... };\n *\n *   static bool\n *   IsAnswerObject(const Value &v)\n *   {\n *       if (!v.isObject())\n *           return false;\n *       return JS_GetClass(&v.toObject()) == &AnswerClass;\n *   }\n *\n * The second function implements the NativeImpl signature and defines the\n * behavior of the method when it is provided an acceptable |this| value.\n * Aside from some typing niceties -- see the CallArgs interface for details --\n * its interface is the same as that of JSNative.\n *\n *   static bool\n *   answer_getAnswer_impl(JSContext *cx, JS::CallArgs args)\n *   {\n *       args.rval().setInt32(42);\n *       return true;\n *   }\n *\n * The implementation function is guaranteed to be called *only* with a |this|\n * value which is considered acceptable.\n *\n * Now to implement the actual method, write a JSNative that calls the method\n * declared below, passing the appropriate template and runtime arguments.\n *\n *   static JSBool\n *   answer_getAnswer(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *       return JS::CallNonGenericMethod<IsAnswerObject, answer_getAnswer_impl>(cx, args);\n *   }\n *\n * Note that, because they are used as template arguments, the predicate\n * and implementation functions must have external linkage. (This is\n * unfortunate, but GCC wasn't inlining things as one would hope when we\n * passed them as function arguments.)\n *\n * JS::CallNonGenericMethod will test whether |args.thisv()| is acceptable.  If\n * it is, it will call the provided implementation function, which will return\n * a value and indicate success.  If it is not, it will attempt to unwrap\n * |this| and call the implementation function on the unwrapped |this|.  If\n * that succeeds, all well and good.  If it doesn't succeed, a TypeError will\n * be thrown.\n *\n * Note: JS::CallNonGenericMethod will only work correctly if it's called in\n *       tail position in a JSNative.  Do not call it from any other place.\n */\ntemplate<IsAcceptableThis Test, NativeImpl Impl>\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\n}  /* namespace JS */\n\n/************************************************************************/\n\n/* JSClass operation signatures. */\n\n/*\n * Add or get a property named by id in obj.  Note the jsid id type -- id may\n * be a string (Unicode property identifier) or an int (element index).  The\n * *vp out parameter, on success, is the new property value after the action.\n */\ntypedef JSBool\n(* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Set a property named by id in obj, treating the assignment as strict\n * mode code if strict is true. Note the jsid id type -- id may be a string\n * (Unicode property identifier) or an int (element index). The *vp out\n * parameter, on success, is the new property value after the\n * set.\n */\ntypedef JSBool\n(* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Delete a property named by id in obj.\n *\n * If an error occurred, return false as per normal JSAPI error practice.\n *\n * If no error occurred, but the deletion attempt wasn't allowed (perhaps\n * because the property was non-configurable), set *succeeded to false and\n * return true.  This will cause |delete obj[id]| to evaluate to false in\n * non-strict mode code, and to throw a TypeError in strict mode code.\n *\n * If no error occurred and the deletion wasn't disallowed (this is *not* the\n * same as saying that a deletion actually occurred -- deleting a non-existent\n * property, or an inherited property, is allowed -- it's just pointless),\n * set *succeeded to true and return true.\n */\ntypedef JSBool\n(* JSDeletePropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);\n\n/*\n * This function type is used for callbacks that enumerate the properties of\n * a JSObject.  The behavior depends on the value of enum_op:\n *\n *  JSENUMERATE_INIT\n *    A new, opaque iterator state should be allocated and stored in *statep.\n *    (You can use PRIVATE_TO_JSVAL() to tag the pointer to be stored).\n *\n *    The number of properties that will be enumerated should be returned as\n *    an integer jsval in *idp, if idp is non-null, and provided the number of\n *    enumerable properties is known.  If idp is non-null and the number of\n *    enumerable properties can't be computed in advance, *idp should be set\n *    to JSVAL_ZERO.\n *\n *  JSENUMERATE_INIT_ALL\n *    Used identically to JSENUMERATE_INIT, but exposes all properties of the\n *    object regardless of enumerability.\n *\n *  JSENUMERATE_NEXT\n *    A previously allocated opaque iterator state is passed in via statep.\n *    Return the next jsid in the iteration using *idp.  The opaque iterator\n *    state pointed at by statep is destroyed and *statep is set to JSVAL_NULL\n *    if there are no properties left to enumerate.\n *\n *  JSENUMERATE_DESTROY\n *    Destroy the opaque iterator state previously allocated in *statep by a\n *    call to this function when enum_op was JSENUMERATE_INIT or\n *    JSENUMERATE_INIT_ALL.\n *\n * The return value is used to indicate success, with a value of JS_FALSE\n * indicating failure.\n */\ntypedef JSBool\n(* JSNewEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,\n                     JS::MutableHandle<JS::Value> statep, JS::MutableHandleId idp);\n\n/*\n * The old-style JSClass.enumerate op should define all lazy properties not\n * yet reflected in obj.\n */\ntypedef JSBool\n(* JSEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/*\n * Resolve a lazy property named by id in obj by defining it directly in obj.\n * Lazy properties are those reflected from some peer native property space\n * (e.g., the DOM attributes for a given node reflected as obj) on demand.\n *\n * JS looks for a property in an object, and if not found, tries to resolve\n * the given id.  If resolve succeeds, the engine looks again in case resolve\n * defined obj[id].  If no such property exists directly in obj, the process\n * is repeated with obj's prototype, etc.\n *\n * NB: JSNewResolveOp provides a cheaper way to resolve lazy properties.\n */\ntypedef JSBool\n(* JSResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\n/*\n * Like JSResolveOp, but flags provide contextual information as follows:\n *\n *  JSRESOLVE_ASSIGNING   obj[id] is on the left-hand side of an assignment\n *\n * The *objp out parameter, on success, should be null to indicate that id\n * was not resolved; and non-null, referring to obj or one of its prototypes,\n * if id was resolved.  The hook may assume *objp is null on entry.\n *\n * This hook instead of JSResolveOp is called via the JSClass.resolve member\n * if JSCLASS_NEW_RESOLVE is set in JSClass.flags.\n */\ntypedef JSBool\n(* JSNewResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,\n                   JS::MutableHandleObject objp);\n\n/*\n * Convert obj to the given type, returning true with the resulting value in\n * *vp on success, and returning false on error or exception.\n */\ntypedef JSBool\n(* JSConvertOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n                JS::MutableHandle<JS::Value> vp);\n\ntypedef struct JSFreeOp JSFreeOp;\n\nstruct JSFreeOp {\n  private:\n    JSRuntime   *runtime_;\n\n  protected:\n    JSFreeOp(JSRuntime *rt)\n      : runtime_(rt) { }\n\n  public:\n    JSRuntime *runtime() const {\n        return runtime_;\n    }\n};\n\n/*\n * Finalize obj, which the garbage collector has determined to be unreachable\n * from other live objects or from GC roots.  Obviously, finalizers must never\n * store a reference to obj.\n */\ntypedef void\n(* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);\n\n/*\n * Finalizes external strings created by JS_NewExternalString.\n */\ntypedef struct JSStringFinalizer JSStringFinalizer;\n\nstruct JSStringFinalizer {\n    void (*finalize)(const JSStringFinalizer *fin, jschar *chars);\n};\n\n/*\n * JSClass.checkAccess type: check whether obj[id] may be accessed per mode,\n * returning false on error/exception, true on success with obj[id]'s last-got\n * value in *vp, and its attributes in *attrsp.  As for JSPropertyOp above, id\n * is either a string or an int jsval.\n */\ntypedef JSBool\n(* JSCheckAccessOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                    JSAccessMode mode, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Check whether v is an instance of obj.  Return false on error or exception,\n * true on success with JS_TRUE in *bp if v is an instance of obj, JS_FALSE in\n * *bp otherwise.\n */\ntypedef JSBool\n(* JSHasInstanceOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,\n                    JSBool *bp);\n\n/*\n * Function type for trace operation of the class called to enumerate all\n * traceable things reachable from obj's private data structure. For each such\n * thing, a trace implementation must call one of the JS_Call*Tracer variants\n * on the thing.\n *\n * JSTraceOp implementation can assume that no other threads mutates object\n * state. It must not change state of the object or corresponding native\n * structures. The only exception for this rule is the case when the embedding\n * needs a tight integration with GC. In that case the embedding can check if\n * the traversal is a part of the marking phase through calling\n * JS_IsGCMarkingTracer and apply a special code like emptying caches or\n * marking its native structures.\n */\ntypedef void\n(* JSTraceOp)(JSTracer *trc, JSObject *obj);\n\n/*\n * Callback that JSTraceOp implementation can provide to return a string\n * describing the reference traced with JS_CallTracer.\n */\ntypedef void\n(* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);\n\ntypedef JSObject *\n(* JSWeakmapKeyDelegateOp)(JSObject *obj);\n\n/* Callbacks and their arguments. */\n\ntypedef enum JSContextOp {\n    JSCONTEXT_NEW,\n    JSCONTEXT_DESTROY\n} JSContextOp;\n\n/*\n * The possible values for contextOp when the runtime calls the callback are:\n *   JSCONTEXT_NEW      JS_NewContext successfully created a new JSContext\n *                      instance. The callback can initialize the instance as\n *                      required. If the callback returns false, the instance\n *                      will be destroyed and JS_NewContext returns null. In\n *                      this case the callback is not called again.\n *   JSCONTEXT_DESTROY  One of JS_DestroyContext* methods is called. The\n *                      callback may perform its own cleanup and must always\n *                      return true.\n *   Any other value    For future compatibility the callback must do nothing\n *                      and return true in this case.\n */\ntypedef JSBool\n(* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data);\n\ntypedef enum JSGCStatus {\n    JSGC_BEGIN,\n    JSGC_END\n} JSGCStatus;\n\ntypedef void\n(* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data);\n\ntypedef enum JSFinalizeStatus {\n    /*\n     * Called when preparing to sweep a group of compartments, before anything\n     * has been swept.  The collector will not yield to the mutator before\n     * calling the callback with JSFINALIZE_GROUP_END status.\n     */\n    JSFINALIZE_GROUP_START,\n\n    /*\n     * Called when preparing to sweep a group of compartments. Weak references\n     * to unmarked things have been removed and things that are not swept\n     * incrementally have been finalized at this point.  The collector may yield\n     * to the mutator after this point.\n     */\n    JSFINALIZE_GROUP_END,\n\n    /*\n     * Called at the end of collection when everything has been swept.\n     */\n    JSFINALIZE_COLLECTION_END\n} JSFinalizeStatus;\n\ntypedef void\n(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment);\n\n/*\n * Generic trace operation that calls JS_CallTracer on each traceable thing\n * stored in data.\n */\ntypedef void\n(* JSTraceDataOp)(JSTracer *trc, void *data);\n\ntypedef JSBool\n(* JSOperationCallback)(JSContext *cx);\n\ntypedef void\n(* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);\n\n#ifdef MOZ_TRACE_JSCALLS\ntypedef void\n(* JSFunctionCallback)(const JSFunction *fun,\n                       const JSScript *scr,\n                       const JSContext *cx,\n                       int entering);\n#endif\n\n/*\n * Possible exception types. These types are part of a JSErrorFormatString\n * structure. They define which error to throw in case of a runtime error.\n * JSEXN_NONE marks an unthrowable error.\n */\ntypedef enum JSExnType {\n    JSEXN_NONE = -1,\n      JSEXN_ERR,\n        JSEXN_INTERNALERR,\n        JSEXN_EVALERR,\n        JSEXN_RANGEERR,\n        JSEXN_REFERENCEERR,\n        JSEXN_SYNTAXERR,\n        JSEXN_TYPEERR,\n        JSEXN_URIERR,\n        JSEXN_LIMIT\n} JSExnType;\n\ntypedef struct JSErrorFormatString {\n    /* The error format string in ASCII. */\n    const char *format;\n\n    /* The number of arguments to expand in the formatted error message. */\n    uint16_t argCount;\n\n    /* One of the JSExnType constants above. */\n    int16_t exnType;\n} JSErrorFormatString;\n\ntypedef const JSErrorFormatString *\n(* JSErrorCallback)(void *userRef, const char *locale,\n                    const unsigned errorNumber);\n\ntypedef JSBool\n(* JSLocaleToUpperCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToLowerCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleCompare)(JSContext *cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,\n                    JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandle<JS::Value> rval);\n\n/*\n * Security protocol types.\n */\n\ntypedef void\n(* JSDestroyPrincipalsOp)(JSPrincipals *principals);\n\n/*\n * Used to check if a CSP instance wants to disable eval() and friends.\n * See js_CheckCSPPermitsJSAction() in jsobj.\n */\ntypedef JSBool\n(* JSCSPEvalChecker)(JSContext *cx);\n\n/*\n * Callback used to ask the embedding for the cross compartment wrapper handler\n * that implements the desired prolicy for this kind of object in the\n * destination compartment. |obj| is the object to be wrapped. If |existing| is\n * non-NULL, it will point to an existing wrapper object that should be re-used\n * if possible. |existing| is guaranteed to be a cross-compartment wrapper with\n * a lazily-defined prototype and the correct global. It is guaranteed not to\n * wrap a function.\n */\ntypedef JSObject *\n(* JSWrapObjectCallback)(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj,\n                         JS::HandleObject proto, JS::HandleObject parent,\n                         unsigned flags);\n\n/*\n * Callback used by the wrap hook to ask the embedding to prepare an object\n * for wrapping in a context. This might include unwrapping other wrappers\n * or even finding a more suitable object for the new compartment.\n */\ntypedef JSObject *\n(* JSPreWrapCallback)(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj,\n                      unsigned flags);\n\n/*\n * Callback used when wrapping determines that the underlying object is already\n * in the compartment for which it is being wrapped. This allows consumers to\n * maintain same-compartment wrapping invariants.\n *\n * |obj| is guaranteed to be same-compartment as |cx|, but it may (or may not)\n * be a security or cross-compartment wrapper. This is an unfortunate contract,\n * but is important for to avoid unnecessarily recomputing every cross-\n * compartment wrapper that gets passed to wrap.\n */\ntypedef JSObject *\n(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JS::HandleObject obj);\n\ntypedef void\n(* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);\n\ntypedef void\n(* JSCompartmentNameCallback)(JSRuntime *rt, JSCompartment *compartment,\n                              char *buf, size_t bufsize);\n\n/*\n * Read structured data from the reader r. This hook is used to read a value\n * previously serialized by a call to the WriteStructuredCloneOp hook.\n *\n * tag and data are the pair of uint32_t values from the header. The callback\n * may use the JS_Read* APIs to read any other relevant parts of the object\n * from the reader r. closure is any value passed to the JS_ReadStructuredClone\n * function. Return the new object on success, NULL on error/exception.\n */\ntypedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,\n                                           uint32_t tag, uint32_t data, void *closure);\n\n/*\n * Structured data serialization hook. The engine can write primitive values,\n * Objects, Arrays, Dates, RegExps, TypedArrays, and ArrayBuffers. Any other\n * type of object requires application support. This callback must first use\n * the JS_WriteUint32Pair API to write an object header, passing a value\n * greater than JS_SCTAG_USER to the tag parameter. Then it can use the\n * JS_Write* APIs to write any other relevant parts of the value v to the\n * writer w. closure is any value passed to the JS_WriteStructuredCLone function.\n *\n * Return true on success, false on error/exception.\n */\ntypedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,\n                                         JS::Handle<JSObject*> obj, void *closure);\n\n/*\n * This is called when JS_WriteStructuredClone is given an invalid transferable.\n * To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException\n * with error set to one of the JS_SCERR_* values.\n */\ntypedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);\n\n/************************************************************************/\n\n/*\n * JS constants. For efficiency, prefer predicates (e.g. v.isNull()) and\n * constructing values from scratch (e.g. Int32Value(0)).  These constants are\n * stored in memory and initialized at startup, so testing against them and\n * using them requires memory loads and will be correspondingly slow.\n */\nextern JS_PUBLIC_DATA(const jsval) JSVAL_NULL;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ZERO;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ONE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_FALSE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_TRUE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_VOID;\n\nstatic JS_ALWAYS_INLINE jsval\nJS_NumberValue(double d)\n{\n    int32_t i;\n    d = JS::CanonicalizeNaN(d);\n    if (mozilla::DoubleIsInt32(d, &i))\n        return INT_TO_JSVAL(i);\n    return DOUBLE_TO_JSVAL(d);\n}\n\n/************************************************************************/\n\n/*\n * A jsid is an identifier for a property or method of an object which is\n * either a 31-bit signed integer, interned string or object.  Also, there is\n * an additional jsid value, JSID_VOID, which does not occur in JS scripts but\n * may be used to indicate the absence of a valid jsid.\n *\n * A jsid is not implicitly convertible to or from a jsval; JS_ValueToId or\n * JS_IdToValue must be used instead.\n */\n\n#define JSID_TYPE_STRING                 0x0\n#define JSID_TYPE_INT                    0x1\n#define JSID_TYPE_VOID                   0x2\n#define JSID_TYPE_OBJECT                 0x4\n#define JSID_TYPE_MASK                   0x7\n\n/*\n * Avoid using canonical 'id' for jsid parameters since this is a magic word in\n * Objective-C++ which, apparently, wants to be able to #include jsapi.h.\n */\n#define id iden\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_STRING(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJSID_TO_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSString *)JSID_BITS(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ZERO(jsid id)\n{\n    return JSID_BITS(id) == 0;\n}\n\nJS_PUBLIC_API(JSBool)\nJS_StringHasBeenInterned(JSContext *cx, JSString *str);\n\n/*\n * Only JSStrings that have been interned via the JSAPI can be turned into\n * jsids by API clients.\n *\n * N.B. if a jsid is backed by a string which has not been interned, that\n * string must be appropriately rooted to avoid being collected by the GC.\n */\nJS_PUBLIC_API(jsid)\nINTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_INT(jsid id)\n{\n    return !!(JSID_BITS(id) & JSID_TYPE_INT);\n}\n\nstatic JS_ALWAYS_INLINE int32_t\nJSID_TO_INT(jsid id)\n{\n    JS_ASSERT(JSID_IS_INT(id));\n    return ((uint32_t)JSID_BITS(id)) >> 1;\n}\n\n#define JSID_INT_MIN  0\n#define JSID_INT_MAX  INT32_MAX\n\nstatic JS_ALWAYS_INLINE JSBool\nINT_FITS_IN_JSID(int32_t i)\n{\n    return i >= 0;\n}\n\nstatic JS_ALWAYS_INLINE jsid\nINT_TO_JSID(int32_t i)\n{\n    jsid id;\n    JS_ASSERT(INT_FITS_IN_JSID(i));\n    JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_OBJECT(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT &&\n           (size_t)JSID_BITS(id) != JSID_TYPE_OBJECT;\n}\n\nstatic JS_ALWAYS_INLINE JSObject *\nJSID_TO_OBJECT(jsid id)\n{\n    JS_ASSERT(JSID_IS_OBJECT(id));\n    return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\nstatic JS_ALWAYS_INLINE jsid\nOBJECT_TO_JSID(JSObject *obj)\n{\n    jsid id;\n    JS_ASSERT(obj != NULL);\n    JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);\n    JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_GCTHING(jsid id)\n{\n    return JSID_IS_STRING(id) || JSID_IS_OBJECT(id);\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSID_TO_GCTHING(jsid id)\n{\n    return (void *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\n/*\n * A void jsid is not a valid id and only arises as an exceptional API return\n * value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into\n * JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in\n * hooks receiving a jsid except when explicitly noted in the API contract.\n */\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_VOID(const jsid id)\n{\n    JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,\n                 JSID_BITS(id) == JSID_TYPE_VOID);\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_EMPTY(const jsid id)\n{\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);\n}\n\n#undef id\n\n#ifdef JS_USE_JSID_STRUCT_TYPES\nextern JS_PUBLIC_DATA(const jsid) JSID_VOID;\nextern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;\n#else\n# define JSID_VOID ((jsid)JSID_TYPE_VOID)\n# define JSID_EMPTY ((jsid)JSID_TYPE_OBJECT)\n#endif\n\n/*\n * Returns true iff the given jsval is immune to GC and can be used across\n * multiple JSRuntimes without requiring any conversion API.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_UNIVERSAL(jsval v)\n{\n    return !JSVAL_IS_GCTHING(v);\n}\n\nnamespace JS {\n\nclass AutoIdRooter : private AutoGCRooter\n{\n  public:\n    explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, ID), id_(aId)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    jsid id() {\n        return id_;\n    }\n\n    jsid * addr() {\n        return &id_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    jsid id_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n} /* namespace JS */\n\n/************************************************************************/\n\n/* Property attributes, set in JSPropertySpec and passed to API functions. */\n#define JSPROP_ENUMERATE        0x01    /* property is visible to for/in loop */\n#define JSPROP_READONLY         0x02    /* not settable: assignment is no-op.\n                                           This flag is only valid when neither\n                                           JSPROP_GETTER nor JSPROP_SETTER is\n                                           set. */\n#define JSPROP_PERMANENT        0x04    /* property cannot be deleted */\n#define JSPROP_NATIVE_ACCESSORS 0x08    /* set in JSPropertyDescriptor.flags\n                                           if getters/setters are JSNatives */\n#define JSPROP_GETTER           0x10    /* property holds getter function */\n#define JSPROP_SETTER           0x20    /* property holds setter function */\n#define JSPROP_SHARED           0x40    /* don't allocate a value slot for this\n                                           property; don't copy the property on\n                                           set of the same-named property in an\n                                           object that delegates to a prototype\n                                           containing this property */\n#define JSPROP_INDEX            0x80    /* name is actually (int) index */\n#define JSPROP_SHORTID         0x100    /* set in JS_DefineProperty attrs\n                                           if getters/setters use a shortid */\n\n#define JSFUN_STUB_GSOPS       0x200    /* use JS_PropertyStub getter/setter\n                                           instead of defaulting to class gsops\n                                           for property holding function */\n\n#define JSFUN_CONSTRUCTOR      0x400    /* native that can be called as a ctor */\n\n\n/*\n * Specify a generic native prototype methods, i.e., methods of a class\n * prototype that are exposed as static methods taking an extra leading\n * argument: the generic |this| parameter.\n *\n * If you set this flag in a JSFunctionSpec struct's flags initializer, then\n * that struct must live at least as long as the native static method object\n * created due to this flag by JS_DefineFunctions or JS_InitClass.  Typically\n * JSFunctionSpec structs are allocated in static arrays.\n */\n#define JSFUN_GENERIC_NATIVE   0x800\n\n#define JSFUN_FLAGS_MASK       0xe00    /* | of all the JSFUN_* flags */\n\n/*\n * The first call to JS_CallOnce by any thread in a process will call 'func'.\n * Later calls to JS_CallOnce with the same JSCallOnceType object will be\n * suppressed.\n *\n * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce\n * to invoke its JSInitCallback.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CallOnce(JSCallOnceType *once, JSInitCallback func);\n\n/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */\nextern JS_PUBLIC_API(int64_t)\nJS_Now(void);\n\n/* Don't want to export data, so provide accessors for non-inline jsvals. */\nextern JS_PUBLIC_API(jsval)\nJS_GetNaNValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetNegativeInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetPositiveInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetEmptyStringValue(JSContext *cx);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetEmptyString(JSRuntime *rt);\n\n/*\n * Format is a string of the following characters (spaces are insignificant),\n * specifying the tabulated type conversions:\n *\n *   b      JSBool          Boolean\n *   c      uint16_t/jschar ECMA uint16_t, Unicode char\n *   i      int32_t         ECMA int32_t\n *   u      uint32_t        ECMA uint32_t\n *   j      int32_t         Rounded int32_t (coordinate)\n *   d      double          IEEE double\n *   I      double          Integral IEEE double\n *   S      JSString *      Unicode string, accessed by a JSString pointer\n *   W      jschar *        Unicode character vector, 0-terminated (W for wide)\n *   o      JSObject *      Object reference\n *   f      JSFunction *    Function private\n *   v      jsval           Argument value (no conversion)\n *   *      N/A             Skip this argument (no vararg)\n *   /      N/A             End of required arguments\n *\n * The variable argument list after format must consist of &b, &c, &s, e.g.,\n * where those variables have the types given above.  For the pointer types\n * char *, JSString *, and JSObject *, the pointed-at memory returned belongs\n * to the JS runtime, not to the calling native code.  The runtime promises\n * to keep this memory valid so long as argv refers to allocated stack space\n * (so long as the native function is active).\n *\n * Fewer arguments than format specifies may be passed only if there is a /\n * in format after the last required argument specifier and argc is at least\n * the number of required arguments.  More arguments than format specifies\n * may be passed without error; it is up to the caller to deal with trailing\n * unconverted arguments.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format,\n                    ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv,\n                      const char *format, va_list ap);\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToObject(JSContext *cx, jsval v, JSObject **objp);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToFunction(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToConstructor(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToString(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToSource(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToNumber(JSContext *cx, jsval v, double *dp);\n\nnamespace js {\n/*\n * DO NOT CALL THIS.  Use JS::ToNumber\n */\nextern JS_PUBLIC_API(bool)\nToNumberSlow(JSContext *cx, JS::Value v, double *dp);\n\n/*\n * DO NOT CALL THIS. Use JS::ToBoolean\n */\nextern JS_PUBLIC_API(bool)\nToBooleanSlow(const JS::Value &v);\n} /* namespace js */\n\nnamespace JS {\n\n/* ES5 9.3 ToNumber. */\nJS_ALWAYS_INLINE bool\nToNumber(JSContext *cx, HandleValue v, double *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    {\n        js::SkipRoot root(cx, &v);\n        js::MaybeCheckStackRoots(cx);\n    }\n\n    if (v.isNumber()) {\n        *out = v.toNumber();\n        return true;\n    }\n    return js::ToNumberSlow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToBoolean(const Value &v)\n{\n    if (v.isBoolean())\n        return v.toBoolean();\n    if (v.isInt32())\n        return v.toInt32() != 0;\n    if (v.isNullOrUndefined())\n        return false;\n    if (v.isDouble()) {\n        double d = v.toDouble();\n        return !mozilla::IsNaN(d) && d != 0;\n    }\n\n    /* The slow path handles strings and objects. */\n    return js::ToBooleanSlow(v);\n}\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_DoubleIsInt32(double d, int32_t *ip);\n\nextern JS_PUBLIC_API(int32_t)\nJS_DoubleToInt32(double d);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_DoubleToUint32(double d);\n\n/*\n * Convert a value to a number, then to an int32_t, according to the ECMA rules\n * for ToInt32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * Convert a value to a number, then to an int64_t, according to the WebIDL\n * rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt64(JSContext *cx, jsval v, int64_t *ip);\n\n/*\n * Convert a value to a number, then to an uint64_t, according to the WebIDL\n * rules for ToUint64: http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint64(JSContext *cx, jsval v, uint64_t *ip);\n\nnamespace js {\n/* DO NOT CALL THIS.  Use JS::ToInt16. */\nextern JS_PUBLIC_API(bool)\nToUint16Slow(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToInt32. */\nextern JS_PUBLIC_API(bool)\nToInt32Slow(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToUint32. */\nextern JS_PUBLIC_API(bool)\nToUint32Slow(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToInt64. */\nextern JS_PUBLIC_API(bool)\nToInt64Slow(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToUint64. */\nextern JS_PUBLIC_API(bool)\nToUint64Slow(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out);\n} /* namespace js */\n\nnamespace JS {\n\nJS_ALWAYS_INLINE bool\nToUint16(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint16_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint16Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt32(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = v.toInt32();\n        return true;\n    }\n    return js::ToInt32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint32(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint32_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt64(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = int64_t(v.toInt32());\n        return true;\n    }\n\n    return js::ToInt64Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint64(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        /* Account for sign extension of negatives into the longer 64bit space. */\n        *out = uint64_t(int64_t(v.toInt32()));\n        return true;\n    }\n\n    return js::ToUint64Slow(cx, v, out);\n}\n\n\n} /* namespace JS */\n\n/*\n * Convert a value to a number, then to a uint32_t, according to the ECMA rules\n * for ToUint32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);\n\n/*\n * Convert a value to a number, then to an int32_t if it fits by rounding to\n * nearest; but failing with an error report if the double is out of range\n * or unordered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * ECMA ToUint16, for mapping a jsval to a Unicode point.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(JSType)\nJS_TypeOfValue(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTypeName(JSContext *cx, JSType type);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same);\n\n/* True iff fun is the global eval function. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinEvalFunction(JSFunction *fun);\n\n/* True iff fun is the Function constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinFunctionConstructor(JSFunction *fun);\n\n/************************************************************************/\n\n/*\n * Initialization, locking, contexts, and memory allocation.\n *\n * It is important that the first runtime and first context be created in a\n * single-threaded fashion, otherwise the behavior of the library is undefined.\n * See: http://developer.mozilla.org/en/docs/Category:JSAPI_Reference\n */\n\ntypedef enum JSUseHelperThreads\n{\n    JS_NO_HELPER_THREADS,\n    JS_USE_HELPER_THREADS\n} JSUseHelperThreads;\n\n/**\n * Initialize SpiderMonkey, returning true only if initialization succeeded.\n * Once this method has succeeded, it is safe to call JS_NewRuntime and other\n * JSAPI methods.\n *\n * This method must be called before any other JSAPI method is used on any\n * thread.  Once it has been used, it is safe to call any JSAPI method, and it\n * remains safe to do so until JS_ShutDown is correctly called.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_Init(void);\n\n/**\n * Destroy free-standing resources allocated by SpiderMonkey, not associated\n * with any runtime, context, or other structure.\n *\n * This method should be called after all other JSAPI data has been properly\n * cleaned up: every new runtime must have been destroyed, every new context\n * must have been destroyed, and so on.  Calling this method before all other\n * resources have been destroyed has undefined behavior.\n *\n * Failure to call this method, at present, has no adverse effects other than\n * leaking memory.  This may not always be the case; it's recommended that all\n * embedders call this method when all other JSAPI operations have completed.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(void)\nJS_ShutDown(void);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_NewRuntime(uint32_t maxbytes, JSUseHelperThreads useHelperThreads);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyRuntime(JSRuntime *rt);\n\n// These are equivalent to ICU's |UMemAllocFn|, |UMemReallocFn|, and\n// |UMemFreeFn| types.  The first argument (called |context| in the ICU docs)\n// will always be NULL, and should be ignored.\ntypedef void *(*JS_ICUAllocFn)(const void *, size_t size);\ntypedef void *(*JS_ICUReallocFn)(const void *, void *p, size_t size);\ntypedef void (*JS_ICUFreeFn)(const void *, void *p);\n\n// This function can be used to track memory used by ICU.\n// Do not use it unless you know what you are doing!\nextern JS_PUBLIC_API(bool)\nJS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn, JS_ICUReallocFn reallocFn, JS_ICUFreeFn freeFn);\n\nJS_PUBLIC_API(void *)\nJS_GetRuntimePrivate(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nJS_PUBLIC_API(void)\nJS_SetRuntimePrivate(JSRuntime *rt, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_BeginRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_EndRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsInRequest(JSRuntime *rt);\n\nnamespace JS {\n\ninline bool\nIsPoisonedId(jsid iden)\n{\n    if (JSID_IS_STRING(iden))\n        return JS::IsPoisonedPtr(JSID_TO_STRING(iden));\n    if (JSID_IS_OBJECT(iden))\n        return JS::IsPoisonedPtr(JSID_TO_OBJECT(iden));\n    return false;\n}\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <> struct GCMethods<jsid>\n{\n    static jsid initial() { return JSID_VOID; }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(jsid id) { return JS::IsPoisonedId(id); }\n    static bool needsPostBarrier(jsid id) { return false; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(jsid *idp) {}\n    static void relocate(jsid *idp) {}\n#endif\n};\n\n} /* namespace js */\n\nclass JSAutoRequest\n{\n  public:\n    JSAutoRequest(JSContext *cx\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mContext(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_BeginRequest(mContext);\n    }\n    ~JSAutoRequest() {\n        JS_EndRequest(mContext);\n    }\n\n  protected:\n    JSContext *mContext;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n#if 0\n  private:\n    static void *operator new(size_t) CPP_THROW_NEW { return 0; };\n    static void operator delete(void *, size_t) { };\n#endif\n};\n\nclass JSAutoCheckRequest\n{\n  public:\n    JSAutoCheckRequest(JSContext *cx\n                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n#if defined JS_THREADSAFE && defined DEBUG\n        mContext = cx;\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));\n#endif\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoCheckRequest() {\n#if defined JS_THREADSAFE && defined DEBUG\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(mContext)));\n#endif\n    }\n\n\n  private:\n#if defined JS_THREADSAFE && defined DEBUG\n    JSContext *mContext;\n#endif\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback, void *data);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_NewContext(JSRuntime *rt, size_t stackChunkSize);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContext(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContextNoGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void *)\nJS_GetContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetSecondContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetSecondContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_ContextIterator(JSRuntime *rt, JSContext **iterp);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetVersion(JSContext *cx);\n\n// Mutate the version on the compartment. This is generally discouraged, but\n// necessary to support the version mutation in the js and xpc shell command\n// set.\n//\n// It would be nice to put this in jsfriendapi, but the linkage requirements\n// of the shells make that impossible.\nJS_PUBLIC_API(void)\nJS_SetVersionForCompartment(JSCompartment *compartment, JSVersion version);\n\nextern JS_PUBLIC_API(const char *)\nJS_VersionToString(JSVersion version);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_StringToVersion(const char *string);\n\n/*\n * JS options are orthogonal to version, and may be freely composed with one\n * another as well as with version.\n *\n * JSOPTION_VAROBJFIX is recommended -- see the comments associated with the\n * prototypes for JS_ExecuteScript, JS_EvaluateScript, etc.\n */\n#define JSOPTION_EXTRA_WARNINGS JS_BIT(0)       /* warn on dubious practices */\n#define JSOPTION_WERROR         JS_BIT(1)       /* convert warning to error */\n#define JSOPTION_VAROBJFIX      JS_BIT(2)       /* make JS_EvaluateScript use\n                                                   the last object on its 'obj'\n                                                   param's scope chain as the\n                                                   ECMA 'variables object' */\n#define JSOPTION_PRIVATE_IS_NSISUPPORTS \\\n                                JS_BIT(3)       /* context private data points\n                                                   to an nsISupports subclass */\n#define JSOPTION_COMPILE_N_GO   JS_BIT(4)       /* caller of JS_Compile*Script\n                                                   promises to execute compiled\n                                                   script once only; enables\n                                                   compile-time scope chain\n                                                   resolution of consts. */\n\n/* JS_BIT(5) is currently unused. */\n\n/* JS_BIT(6) is currently unused. */\n\n/* JS_BIT(7) is currently unused. */\n\n#define JSOPTION_DONT_REPORT_UNCAUGHT                                   \\\n                                JS_BIT(8)       /* When returning from the\n                                                   outermost API call, prevent\n                                                   uncaught exceptions from\n                                                   being converted to error\n                                                   reports */\n\n/* JS_BIT(9) is currently unused. */\n\n/* JS_BIT(10) is currently unused. */\n\n/* JS_BIT(11) is currently unused. */\n\n#define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12)      /* A promise to the compiler\n                                                   that a null rval out-param\n                                                   will be passed to each call\n                                                   to JS_ExecuteScript. */\n#define JSOPTION_UNROOTED_GLOBAL JS_BIT(13)     /* The GC will not root the\n                                                   contexts' default compartment\n                                                   object, leaving that up to the\n                                                   embedding. */\n\n#define JSOPTION_BASELINE       JS_BIT(14)      /* Baseline compiler. */\n\n#define JSOPTION_TYPE_INFERENCE JS_BIT(16)      /* Perform type inference. */\n#define JSOPTION_STRICT_MODE    JS_BIT(17)      /* Provides a way to force\n                                                   strict mode for all code\n                                                   without requiring\n                                                   \"use strict\" annotations. */\n\n#define JSOPTION_ION            JS_BIT(18)      /* IonMonkey */\n\n#define JSOPTION_ASMJS          JS_BIT(19)      /* optimizingasm.js compiler */\n\n#define JSOPTION_MASK           JS_BITMASK(20)\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetOptions(JSContext *cx);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_SetOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_ToggleOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(void)\nJS_SetJitHardening(JSRuntime *rt, JSBool enabled);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetImplementationVersion(void);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentNameCallback(JSRuntime *rt, JSCompartmentNameCallback callback);\n\nextern JS_PUBLIC_API(JSWrapObjectCallback)\nJS_SetWrapObjectCallbacks(JSRuntime *rt,\n                          JSWrapObjectCallback callback,\n                          JSSameCompartmentWrapObjectCallback sccallback,\n                          JSPreWrapCallback precallback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentPrivate(JSCompartment *compartment, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetCompartmentPrivate(JSCompartment *compartment);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapObject(JSContext *cx, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapValue(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapId(JSContext *cx, jsid *idp);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_TransplantObject(JSContext *cx, JS::HandleObject origobj, JS::HandleObject target);\n\nextern JS_FRIEND_API(JSObject *)\njs_TransplantObjectWithWrapper(JSContext *cx,\n                               JS::HandleObject origobj,\n                               JS::HandleObject origwrapper,\n                               JS::HandleObject targetobj,\n                               JS::HandleObject targetwrapper);\n\nextern JS_PUBLIC_API(JSBool)\nJS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob);\n\n/*\n * At any time, a JSContext has a current (possibly-NULL) compartment.\n * Compartments are described in:\n *\n *   developer.mozilla.org/en-US/docs/SpiderMonkey/SpiderMonkey_compartments\n *\n * The current compartment of a context may be changed. The preferred way to do\n * this is with JSAutoCompartment:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in some compartment 'c'\n *     {\n *       JSAutoCompartment ac(cx, obj);  // constructor enters\n *       // in the compartment of 'obj'\n *     }                                 // destructor leaves\n *     // back in compartment 'c'\n *   }\n *\n * For more complicated uses that don't neatly fit in a C++ stack frame, the\n * compartment can entered and left using separate function calls:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in 'oldCompartment'\n *     JSCompartment *oldCompartment = JS_EnterCompartment(cx, obj);\n *     // in the compartment of 'obj'\n *     JS_LeaveCompartment(cx, oldCompartment);\n *     // back in 'oldCompartment'\n *   }\n *\n * Note: these calls must still execute in a LIFO manner w.r.t all other\n * enter/leave calls on the context. Furthermore, only the return value of a\n * JS_EnterCompartment call may be passed as the 'oldCompartment' argument of\n * the corresponding JS_LeaveCompartment call.\n */\n\nclass JS_PUBLIC_API(JSAutoCompartment)\n{\n    JSContext *cx_;\n    JSCompartment *oldCompartment_;\n  public:\n    JSAutoCompartment(JSContext *cx, JSObject *target);\n    JSAutoCompartment(JSContext *cx, JSScript *target);\n    ~JSAutoCompartment();\n};\n\n/* NB: This API is infallible; a NULL return value does not indicate error. */\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartment(JSContext *cx, JSObject *target);\n\nextern JS_PUBLIC_API(void)\nJS_LeaveCompartment(JSContext *cx, JSCompartment *oldCompartment);\n\ntypedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);\n\n/*\n * This function calls |compartmentCallback| on every compartment.  Beware that\n * there is no guarantee that the compartment will survive after the callback\n * returns.\n */\nextern JS_PUBLIC_API(void)\nJS_IterateCompartments(JSRuntime *rt, void *data,\n                       JSIterateCompartmentCallback compartmentCallback);\n\n/*\n * Initialize standard JS class constructors, prototypes, and any top-level\n * functions and constants associated with the standard classes (e.g. isNaN\n * for Number).\n *\n * NB: This sets cx's global object to obj if it was null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitStandardClasses(JSContext *cx, JSObject *obj);\n\n/*\n * Resolve id, which must contain either a string or an int, to a standard\n * class name in obj if possible, defining the class's constructor and/or\n * prototype and storing true in *resolved.  If id does not name a standard\n * class or a top-level property induced by initializing a standard class,\n * store false in *resolved and just return true.  Return false on error,\n * as usual for JSBool result-typed API entry points.\n *\n * This API can be called directly from a global object class's resolve op,\n * to define standard classes lazily.  The class's enumerate op should call\n * JS_EnumerateStandardClasses(cx, obj), to define eagerly during for..in\n * loops any classes not yet resolved lazily.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStandardClass(JSContext *cx, JS::HandleObject obj, JS::HandleId id,\n                        JSBool *resolved);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStandardClasses(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSProtoKey)\nJS_IdentifyClassPrototype(JSContext *cx, JSObject *obj);\n\n/*\n * Returns the original value of |Function.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Object.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetObjectPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Array.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetArrayPrototype(JSContext *cx, JSObject *forObj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGlobalObject(JSObject *obj);\n\n/*\n * May return NULL, if |c| never had a global (e.g. the atoms compartment), or\n * if |c|'s global has been collected.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForCompartmentOrNull(JSContext *cx, JSCompartment *c);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(JSObject *)\nCurrentGlobalOrNull(JSContext *cx);\n\n}\n\n/*\n * This method returns the global corresponding to the most recent scripted\n * frame, which may not match the cx's current compartment. This is extremely\n * dangerous, because it can bypass compartment security invariants in subtle\n * ways. To use it safely, the caller must perform a subsequent security\n * check. There is currently only one consumer of this function in Gecko, and\n * it should probably stay that way. If you'd like to use it, please consult\n * the XPConnect module owner first.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetScriptedGlobal(JSContext *cx);\n\n/*\n * Initialize the 'Reflect' object on a global object.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_InitReflect(JSContext *cx, JSObject *global);\n\n#ifdef JS_HAS_CTYPES\n/*\n * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'\n * object will be sealed.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitCTypesClass(JSContext *cx, JSObject *global);\n\n/*\n * Convert a unicode string 'source' of length 'slen' to the platform native\n * charset, returning a null-terminated string allocated with JS_malloc. On\n * failure, this function should report an error.\n */\ntypedef char *\n(* JSCTypesUnicodeToNativeFun)(JSContext *cx, const jschar *source, size_t slen);\n\n/*\n * Set of function pointers that ctypes can use for various internal functions.\n * See JS_SetCTypesCallbacks below. Providing NULL for a function is safe,\n * and will result in the applicable ctypes functionality not being available.\n */\nstruct JSCTypesCallbacks {\n    JSCTypesUnicodeToNativeFun unicodeToNative;\n};\n\ntypedef struct JSCTypesCallbacks JSCTypesCallbacks;\n\n/*\n * Set the callbacks on the provided 'ctypesObj' object. 'callbacks' should be a\n * pointer to static data that exists for the lifetime of 'ctypesObj', but it\n * may safely be altered after calling this function and without having\n * to call this function again.\n */\nextern JS_PUBLIC_API(void)\nJS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);\n#endif\n\ntypedef JSBool\n(* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);\n\n/*\n * Enumerate memory regions that contain diagnostic information\n * intended to be included in crash report minidumps.\n */\nextern JS_PUBLIC_API(void)\nJS_EnumerateDiagnosticMemoryRegions(JSEnumerateDiagnosticMemoryCallback callback);\n\nextern JS_PUBLIC_API(void *)\nJS_malloc(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(void *)\nJS_realloc(JSContext *cx, void *p, size_t nbytes);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization.\n * cx may be NULL.\n */\nextern JS_PUBLIC_API(void)\nJS_free(JSContext *cx, void *p);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization as specified by the given JSFreeOp instance.\n */\nextern JS_PUBLIC_API(void)\nJS_freeop(JSFreeOp *fop, void *p);\n\nextern JS_PUBLIC_API(JSFreeOp *)\nJS_GetDefaultFreeOp(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_updateMallocCounter(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSContext *cx, const char *s);\n\n/* Duplicate a string.  Does not report an error on failure. */\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSRuntime *rt, const char *s);\n\n\n/*\n * A GC root is a pointer to a jsval, JSObject * or JSString * that itself\n * points into the GC heap. JS_AddValueRoot takes a pointer to a jsval and\n * JS_AddGCThingRoot takes a pointer to a JSObject * or JString *.\n *\n * Note that, since JS_Add*Root stores the address of a variable (of type\n * jsval, JSString *, or JSObject *), that variable must live until\n * JS_Remove*Root is called to remove that variable. For example, after:\n *\n *   void some_function() {\n *     jsval v;\n *     JS_AddNamedValueRoot(cx, &v, \"name\");\n *\n * the caller must perform\n *\n *     JS_RemoveValueRoot(cx, &v);\n *\n * before some_function() returns.\n *\n * Also, use JS_AddNamed*Root(cx, &structPtr->memberObj, \"structPtr->memberObj\")\n * in preference to JS_Add*Root(cx, &structPtr->memberObj), in order to identify\n * roots by their source callsites.  This way, you can find the callsite while\n * debugging if you should fail to do JS_Remove*Root(cx, &structPtr->memberObj)\n * before freeing structPtr's memory.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddObjectRoot(JSContext *cx, JSObject **rp);\n\n#ifdef NAME_ALL_GC_ROOTS\n#define JS_DEFINE_TO_TOKEN(def) #def\n#define JS_DEFINE_TO_STRING(def) JS_DEFINE_TO_TOKEN(def)\n#define JS_AddValueRoot(cx,vp) JS_AddNamedValueRoot((cx), (vp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddStringRoot(cx,rp) JS_AddNamedStringRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddObjectRoot(cx,rp) JS_AddNamedObjectRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRoot(JSContext *cx, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRoot(JSContext *cx, JSScript **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRootRT(JSRuntime *rt, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRootRT(JSRuntime *rt, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);\n\n/* TODO: remove these APIs */\n\nextern JS_FRIEND_API(void)\njs_RemoveRoot(JSRuntime *rt, void *rp);\n\n/*\n * C-compatible version of the Anchor class. It should be called after the last\n * use of the variable it protects.\n */\nextern JS_NEVER_INLINE JS_PUBLIC_API(void)\nJS_AnchorPtr(void *p);\n\n/*\n * Register externally maintained GC roots.\n *\n * traceOp: the trace operation. For each root the implementation should call\n *          JS_CallTracer whenever the root contains a traceable thing.\n * data:    the data argument to pass to each invocation of traceOp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/* Undo a call to JS_AddExtraGCRootsTracer. */\nextern JS_PUBLIC_API(void)\nJS_RemoveExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/*\n * JS_CallTracer API and related macros for implementors of JSTraceOp, to\n * enumerate all references to traceable things reachable via a property or\n * other strong ref identified for debugging purposes by name or index or\n * a naming callback.\n *\n * See the JSTraceOp typedef.\n */\n\n/*\n * Use the following macros to check if a particular jsval is a traceable\n * thing and to extract the thing and its kind to pass to JS_CallTracer.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_TRACEABLE(jsval v)\n{\n    return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSVAL_TO_TRACEABLE(jsval v)\n{\n    return JSVAL_TO_GCTHING(v);\n}\n\nstatic JS_ALWAYS_INLINE JSGCTraceKind\nJSVAL_TRACE_KIND(jsval v)\n{\n    JS_ASSERT(JSVAL_IS_GCTHING(v));\n    return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/*\n * Tracer callback, called for each traceable thing directly referenced by a\n * particular object or runtime structure. It is the callback responsibility\n * to ensure the traversal of the full object graph via calling eventually\n * JS_TraceChildren on the passed thing. In this case the callback must be\n * prepared to deal with cycles in the traversal graph.\n *\n * kind argument is one of JSTRACE_OBJECT, JSTRACE_STRING or a tag denoting\n * internal implementation-specific traversal kind. In the latter case the only\n * operations on thing that the callback can do is to call JS_TraceChildren or\n * JS_GetTraceThingInfo.\n *\n * If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all\n * of its mappings.  This should be used in cases where the tracer\n * wants to use the existing liveness of entries.\n */\ntypedef void\n(* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);\n\nenum WeakMapTraceKind {\n    DoNotTraceWeakMaps = 0,\n    TraceWeakMapValues = 1,\n    TraceWeakMapKeysValues = 2\n};\n\nstruct JSTracer {\n    JSRuntime           *runtime;\n    JSTraceCallback     callback;\n    JSTraceNamePrinter  debugPrinter;\n    const void          *debugPrintArg;\n    size_t              debugPrintIndex;\n    WeakMapTraceKind    eagerlyTraceWeakMaps;\n#ifdef JS_GC_ZEAL\n    void                *realLocation;\n#endif\n};\n\n/*\n * Set debugging information about a reference to a traceable thing to prepare\n * for the following call to JS_CallTracer.\n *\n * When printer is null, arg must be const char * or char * C string naming\n * the reference and index must be either (size_t)-1 indicating that the name\n * alone describes the reference or it must be an index into some array vector\n * that stores the reference.\n *\n * When printer callback is not null, the arg and index arguments are\n * available to the callback as debugPrintArg and debugPrintIndex fields\n * of JSTracer.\n *\n * The storage for name or callback's arguments needs to live only until\n * the following call to JS_CallTracer returns.\n */\n# define JS_SET_TRACING_DETAILS(trc, printer, arg, index)                     \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->debugPrinter = (printer);                                      \\\n        (trc)->debugPrintArg = (arg);                                         \\\n        (trc)->debugPrintIndex = (index);                                     \\\n    JS_END_MACRO\n\n/*\n * Sets the real location for a marked reference, when passing the address\n * directly is not feasable.\n *\n * FIXME: This is currently overcomplicated by our need to nest calls for Values\n * stored as keys in hash tables, but will get simplified once we can rekey\n * in-place.\n */\n#ifdef JS_GC_ZEAL\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n        if (!(trc)->realLocation || !(location))                              \\\n            (trc)->realLocation = (location);                                 \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->realLocation = NULL;                                           \\\n    JS_END_MACRO\n#else\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n#endif\n\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string\n * and index.\n */\n# define JS_SET_TRACING_INDEX(trc, name, index)                               \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, index)\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string.\n */\n# define JS_SET_TRACING_NAME(trc, name)                                       \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, (size_t)-1)\n\n/*\n * The JS_Call*Tracer family of functions traces the given GC thing reference.\n * This performs the tracing action configured on the given JSTracer:\n * typically calling the JSTracer::callback or marking the thing as live.\n *\n * The argument to JS_Call*Tracer is an in-out param: when the function\n * returns, the garbage collector might have moved the GC thing. In this case,\n * the reference passed to JS_Call*Tracer will be updated to the object's new\n * location. Callers of this method are responsible for updating any state\n * that is dependent on the object's address. For example, if the object's\n * address is used as a key in a hashtable, then the object must be removed\n * and re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(void)\nJS_CallValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);\n\ntemplate <typename HashSetEnum>\ninline void\nJS_CallHashSetObjectTracer(JSTracer *trc, HashSetEnum &e, JSObject *const &key, const char *name)\n{\n    JSObject *updated = key;\n    JS_SET_TRACING_LOCATION(trc, reinterpret_cast<void *>(&const_cast<JSObject *&>(key)));\n    JS_CallObjectTracer(trc, &updated, name);\n    if (updated != key)\n        e.rekeyFront(key, updated);\n}\n\n/*\n * Trace an object that is known to always be tenured.  No post barriers are\n * required in this case.\n */\nextern JS_PUBLIC_API(void)\nJS_CallTenuredObjectTracer(JSTracer *trc, JS::TenuredHeap<JSObject *> *objp, const char *name);\n\n/*\n * API for JSTraceCallback implementations.\n */\nextern JS_PUBLIC_API(void)\nJS_TracerInit(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);\n\nextern JS_PUBLIC_API(void)\nJS_TraceRuntime(JSTracer *trc);\n\nextern JS_PUBLIC_API(void)\nJS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc,\n                     void *thing, JSGCTraceKind kind, JSBool includeDetails);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize);\n\n#ifdef DEBUG\n\n/*\n * DEBUG-only method to dump the object graph of heap-allocated things.\n *\n * fp:              file for the dump output.\n * start:           when non-null, dump only things reachable from start\n *                  thing. Otherwise dump all things reachable from the\n *                  runtime roots.\n * startKind:       trace kind of start if start is not null. Must be\n *                  JSTRACE_OBJECT when start is null.\n * thingToFind:     dump only paths in the object graph leading to thingToFind\n *                  when non-null.\n * maxDepth:        the upper bound on the number of edges to descend from the\n *                  graph roots.\n * thingToIgnore:   thing to ignore during the graph traversal when non-null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind,\n            void *thingToFind, size_t maxDepth, void *thingToIgnore);\n\n#endif\n\n/*\n * Garbage collector API.\n */\nextern JS_PUBLIC_API(void)\nJS_GC(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_MaybeGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCCallback(JSRuntime *rt, JSGCCallback cb, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGCMarkingTracer(JSTracer *trc);\n\n/*\n * JS_IsAboutToBeFinalized checks if the given object is going to be finalized\n * at the end of the current GC. When called outside of the context of a GC,\n * this function will return false. Typically this function is used on weak\n * references, where the reference should be nulled out or destroyed if the\n * given object is about to be finalized.\n *\n * The argument to JS_IsAboutToBeFinalized is an in-out param: when the\n * function returns false, the object being referenced is still alive, but the\n * garbage collector might have moved it. In this case, the reference passed\n * to JS_IsAboutToBeFinalized will be updated to the object's new location.\n * Callers of this method are responsible for updating any state that is\n * dependent on the object's address. For example, if the object's address is\n * used as a key in a hashtable, then the object must be removed and\n * re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalized(JS::Heap<JSObject *> *objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalizedUnbarriered(JSObject **objp);\n\ntypedef enum JSGCParamKey {\n    /* Maximum nominal heap before last ditch GC. */\n    JSGC_MAX_BYTES          = 0,\n\n    /* Number of JS_malloc bytes before last ditch GC. */\n    JSGC_MAX_MALLOC_BYTES   = 1,\n\n    /* Amount of bytes allocated by the GC. */\n    JSGC_BYTES = 3,\n\n    /* Number of times when GC was invoked. */\n    JSGC_NUMBER = 4,\n\n    /* Max size of the code cache in bytes. */\n    JSGC_MAX_CODE_CACHE_BYTES = 5,\n\n    /* Select GC mode. */\n    JSGC_MODE = 6,\n\n    /* Number of cached empty GC chunks. */\n    JSGC_UNUSED_CHUNKS = 7,\n\n    /* Total number of allocated GC chunks. */\n    JSGC_TOTAL_CHUNKS = 8,\n\n    /* Max milliseconds to spend in an incremental GC slice. */\n    JSGC_SLICE_TIME_BUDGET = 9,\n\n    /* Maximum size the GC mark stack can grow to. */\n    JSGC_MARK_STACK_LIMIT = 10,\n\n    /*\n     * GCs less than this far apart in time will be considered 'high-frequency GCs'.\n     * See setGCLastBytes in jsgc.cpp.\n     */\n    JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11,\n\n    /* Start of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_LOW_LIMIT = 12,\n\n    /* End of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_HIGH_LIMIT = 13,\n\n    /* Upper bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX = 14,\n\n    /* Lower bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN = 15,\n\n    /* Heap growth for low frequency GCs. */\n    JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16,\n\n    /*\n     * If false, the heap growth factor is fixed at 3. If true, it is determined\n     * based on whether GCs are high- or low- frequency.\n     */\n    JSGC_DYNAMIC_HEAP_GROWTH = 17,\n\n    /* If true, high-frequency GCs will use a longer mark slice. */\n    JSGC_DYNAMIC_MARK_SLICE = 18,\n\n    /* Number of megabytes of analysis data to allocate before purging. */\n    JSGC_ANALYSIS_PURGE_TRIGGER = 19,\n\n    /* Lower limit after which we limit the heap growth. */\n    JSGC_ALLOCATION_THRESHOLD = 20,\n\n    /*\n     * We decommit memory lazily. If more than this number of megabytes is\n     * available to be decommitted, then JS_MaybeGC will trigger a shrinking GC\n     * to decommit it.\n     */\n    JSGC_DECOMMIT_THRESHOLD = 21\n} JSGCParamKey;\n\ntypedef enum JSGCMode {\n    /* Perform only global GCs. */\n    JSGC_MODE_GLOBAL = 0,\n\n    /* Perform per-compartment GCs until too much garbage has accumulated. */\n    JSGC_MODE_COMPARTMENT = 1,\n\n    /*\n     * Collect in short time slices rather than all at once. Implies\n     * JSGC_MODE_COMPARTMENT.\n     */\n    JSGC_MODE_INCREMENTAL = 2\n} JSGCMode;\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);\n\n/*\n * Create a new JSString whose chars member refers to external memory, i.e.,\n * memory requiring application-specific finalization.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewExternalString(JSContext *cx, const jschar *chars, size_t length,\n                     const JSStringFinalizer *fin);\n\n/*\n * Return whether 'str' was created with JS_NewExternalString or\n * JS_NewExternalStringWithClosure.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExternalString(JSString *str);\n\n/*\n * Return the 'closure' arg passed to JS_NewExternalStringWithClosure or NULL\n * if the external string was created via JS_NewExternalString.\n */\nextern JS_PUBLIC_API(const JSStringFinalizer *)\nJS_GetExternalStringFinalizer(JSString *str);\n\n/*\n * Set the size of the native stack that should not be exceed. To disable\n * stack size checking pass 0.\n */\nextern JS_PUBLIC_API(void)\nJS_SetNativeStackQuota(JSRuntime *cx, size_t stackSize);\n\n/************************************************************************/\n\n/*\n * Classes, objects, and properties.\n */\ntypedef void (*JSClassInternal)();\n\nstruct JSClass {\n    const char          *name;\n    uint32_t            flags;\n\n    /* Mandatory function pointer members. */\n    JSPropertyOp        addProperty;\n    JSDeletePropertyOp  delProperty;\n    JSPropertyOp        getProperty;\n    JSStrictPropertyOp  setProperty;\n    JSEnumerateOp       enumerate;\n    JSResolveOp         resolve;\n    JSConvertOp         convert;\n\n    /* Optional members (may be null). */\n    JSFinalizeOp        finalize;\n    JSCheckAccessOp     checkAccess;\n    JSNative            call;\n    JSHasInstanceOp     hasInstance;\n    JSNative            construct;\n    JSTraceOp           trace;\n\n    void                *reserved[40];\n};\n\n#define JSCLASS_HAS_PRIVATE             (1<<0)  /* objects have private slot */\n#define JSCLASS_NEW_ENUMERATE           (1<<1)  /* has JSNewEnumerateOp hook */\n#define JSCLASS_NEW_RESOLVE             (1<<2)  /* has JSNewResolveOp hook */\n#define JSCLASS_PRIVATE_IS_NSISUPPORTS  (1<<3)  /* private is (nsISupports *) */\n#define JSCLASS_IS_DOMJSCLASS           (1<<4)  /* objects are DOM */\n#define JSCLASS_IMPLEMENTS_BARRIERS     (1<<5)  /* Correctly implements GC read\n                                                   and write barriers */\n#define JSCLASS_EMULATES_UNDEFINED      (1<<6)  /* objects of this class act\n                                                   like the value undefined,\n                                                   in some contexts */\n#define JSCLASS_USERBIT1                (1<<7)  /* Reserved for embeddings. */\n\n/*\n * To reserve slots fetched and stored via JS_Get/SetReservedSlot, bitwise-or\n * JSCLASS_HAS_RESERVED_SLOTS(n) into the initializer for JSClass.flags, where\n * n is a constant in [1, 255].  Reserved slots are indexed from 0 to n-1.\n */\n#define JSCLASS_RESERVED_SLOTS_SHIFT    8       /* room for 8 flags below */\n#define JSCLASS_RESERVED_SLOTS_WIDTH    8       /* and 16 above this field */\n#define JSCLASS_RESERVED_SLOTS_MASK     JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)\n#define JSCLASS_HAS_RESERVED_SLOTS(n)   (((n) & JSCLASS_RESERVED_SLOTS_MASK)  \\\n                                         << JSCLASS_RESERVED_SLOTS_SHIFT)\n#define JSCLASS_RESERVED_SLOTS(clasp)   (((clasp)->flags                      \\\n                                          >> JSCLASS_RESERVED_SLOTS_SHIFT)    \\\n                                         & JSCLASS_RESERVED_SLOTS_MASK)\n\n#define JSCLASS_HIGH_FLAGS_SHIFT        (JSCLASS_RESERVED_SLOTS_SHIFT +       \\\n                                         JSCLASS_RESERVED_SLOTS_WIDTH)\n\n#define JSCLASS_IS_ANONYMOUS            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))\n#define JSCLASS_IS_GLOBAL               (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))\n#define JSCLASS_INTERNAL_FLAG2          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))\n#define JSCLASS_INTERNAL_FLAG3          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))\n\n/* Indicate whether the proto or ctor should be frozen. */\n#define JSCLASS_FREEZE_PROTO            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))\n#define JSCLASS_FREEZE_CTOR             (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))\n\n/* Reserved for embeddings. */\n#define JSCLASS_USERBIT2                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))\n#define JSCLASS_USERBIT3                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))\n\n#define JSCLASS_BACKGROUND_FINALIZE     (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))\n\n/*\n * Bits 26 through 31 are reserved for the CACHED_PROTO_KEY mechanism, see\n * below.\n */\n\n/* Global flags. */\n#define JSGLOBAL_FLAGS_CLEARED          0x1\n\n/*\n * ECMA-262 requires that most constructors used internally create objects\n * with \"the original Foo.prototype value\" as their [[Prototype]] (__proto__)\n * member initial value.  The \"original ... value\" verbiage is there because\n * in ECMA-262, global properties naming class objects are read/write and\n * deleteable, for the most part.\n *\n * Implementing this efficiently requires that global objects have classes\n * with the following flags. Failure to use JSCLASS_GLOBAL_FLAGS was\n * prevously allowed, but is now an ES5 violation and thus unsupported.\n */\n#define JSCLASS_GLOBAL_SLOT_COUNT      (JSProto_LIMIT * 3 + 25)\n#define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n)                                    \\\n    (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))\n#define JSCLASS_GLOBAL_FLAGS                                                  \\\n    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)\n#define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp)                              \\\n  (((clasp)->flags & JSCLASS_IS_GLOBAL)                                       \\\n   && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)\n\n/* Fast access to the original value of each standard class's prototype. */\n#define JSCLASS_CACHED_PROTO_SHIFT      (JSCLASS_HIGH_FLAGS_SHIFT + 10)\n#define JSCLASS_CACHED_PROTO_WIDTH      6\n#define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)\n#define JSCLASS_HAS_CACHED_PROTO(key)   (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)\n#define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey)                         \\\n                                         (((clasp)->flags                     \\\n                                           >> JSCLASS_CACHED_PROTO_SHIFT)     \\\n                                          & JSCLASS_CACHED_PROTO_MASK))\n\n/* Initializer for unused members of statically initialized JSClass structs. */\n#define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n#define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS\n\nextern JS_PUBLIC_API(int)\nJS_IdArrayLength(JSContext *cx, JSIdArray *ida);\n\nextern JS_PUBLIC_API(jsid)\nJS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyIdArray(JSContext *cx, JSIdArray *ida);\n\nnamespace JS {\n\nclass AutoIdArray : private AutoGCRooter\n{\n  public:\n    AutoIdArray(JSContext *cx, JSIdArray *ida\n                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, IDARRAY), context(cx), idArray(ida)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~AutoIdArray() {\n        if (idArray)\n            JS_DestroyIdArray(context, idArray);\n    }\n    bool operator!() {\n        return !idArray;\n    }\n    jsid operator[](size_t i) const {\n        JS_ASSERT(idArray);\n        JS_ASSERT(i < length());\n        return JS_IdArrayGet(context, idArray, i);\n    }\n    size_t length() const {\n        return JS_IdArrayLength(context, idArray);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n    JSIdArray *steal() {\n        JSIdArray *copy = idArray;\n        idArray = NULL;\n        return copy;\n    }\n\n  protected:\n    inline void trace(JSTracer *trc);\n\n  private:\n    JSContext *context;\n    JSIdArray *idArray;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* No copy or assignment semantics. */\n    AutoIdArray(AutoIdArray &ida) MOZ_DELETE;\n    void operator=(AutoIdArray &ida) MOZ_DELETE;\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToId(JSContext *cx, jsval v, jsid *idp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IdToValue(JSContext *cx, jsid id, jsval *vp);\n\n/*\n * JSNewResolveOp flag bits.\n */\n#define JSRESOLVE_ASSIGNING     0x01    /* resolve on the left of assignment */\n\n/*\n * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on\n * the specified object, computing a primitive default value for the object.\n * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On\n * success the resulting value is stored in *vp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictPropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                      JSBool *succeeded);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStub(JSContext *cx, JS::Handle<JSObject*> obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertStub(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n               JS::MutableHandle<JS::Value> vp);\n\nstruct JSConstDoubleSpec {\n    double          dval;\n    const char      *name;\n    uint8_t         flags;\n    uint8_t         spare[3];\n};\n\ntypedef struct JSJitInfo JSJitInfo;\n\n/*\n * Wrappers to replace {Strict,}PropertyOp for JSPropertySpecs. This will allow\n * us to pass one JSJitInfo per function with the property spec, without\n * additional field overhead.\n */\ntypedef struct JSStrictPropertyOpWrapper {\n    JSStrictPropertyOp  op;\n    const JSJitInfo     *info;\n} JSStrictPropertyOpWrapper;\n\ntypedef struct JSPropertyOpWrapper {\n    JSPropertyOp        op;\n    const JSJitInfo     *info;\n} JSPropertyOpWrapper;\n\n/*\n * Wrapper to do as above, but for JSNatives for JSFunctionSpecs.\n */\ntypedef struct JSNativeWrapper {\n    JSNative        op;\n    const JSJitInfo *info;\n} JSNativeWrapper;\n\n/*\n * Macro static initializers which make it easy to pass no JSJitInfo as part of a\n * JSPropertySpec or JSFunctionSpec.\n */\n#define JSOP_WRAPPER(op) {op, NULL}\n#define JSOP_NULLWRAPPER JSOP_WRAPPER(NULL)\n\n/*\n * To define an array element rather than a named property member, cast the\n * element's index to (const char *) and initialize name with it, and set the\n * JSPROP_INDEX bit in flags.\n */\nstruct JSPropertySpec {\n    const char                  *name;\n    int8_t                      tinyid;\n    uint8_t                     flags;\n    JSPropertyOpWrapper         getter;\n    JSStrictPropertyOpWrapper   setter;\n};\n\nnamespace JS {\nnamespace detail {\n\n/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_NATIVE_TO only. */\ninline int CheckIsNative(JSNative native);\n\n} // namespace detail\n} // namespace JS\n\n#define JS_CAST_NATIVE_TO(v, To) \\\n  (static_cast<void>(sizeof(JS::detail::CheckIsNative(v))), \\\n   reinterpret_cast<To>(v))\n\n/*\n * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function\n * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be\n * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform\n * type-safe casts.\n */\n#define JS_PSG(name, getter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_NULLWRAPPER}\n#define JS_PSGS(name, getter, setter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(setter, JSStrictPropertyOp))}\n#define JS_PS_END {0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\n/*\n * To define a native function, set call to a JSNativeWrapper. To define a\n * self-hosted function, set selfHostedName to the name of a function\n * compiled during JSRuntime::initSelfHosting.\n */\nstruct JSFunctionSpec {\n    const char      *name;\n    JSNativeWrapper call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *selfHostedName;\n};\n\n/*\n * Terminating sentinel initializer to put at the end of a JSFunctionSpec array\n * that's passed to JS_DefineFunctions or JS_InitClass.\n */\n#define JS_FS_END JS_FS(NULL,NULL,0,0)\n\n/*\n * Initializer macros for a JSFunctionSpec array element. JS_FN (whose name\n * pays homage to the old JSNative/JSFastNative split) simply adds the flag\n * JSFUN_STUB_GSOPS. JS_FNINFO allows the simple adding of JSJitInfos.\n */\n#define JS_FS(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, flags}\n#define JS_FN(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, (flags) | JSFUN_STUB_GSOPS}\n#define JS_FNINFO(name,call,info,nargs,flags)                                 \\\n    {name,{call,info},nargs,flags}\n\nextern JS_PUBLIC_API(JSObject *)\nJS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n             JSClass *clasp, JSNative constructor, unsigned nargs,\n             const JSPropertySpec *ps, const JSFunctionSpec *fs,\n             const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\n/*\n * Set up ctor.prototype = proto and proto.constructor = ctor with the\n * right property flags.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);\n\nextern JS_PUBLIC_API(JSClass *)\nJS_GetClass(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(void *)\nJS_GetPrivate(JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_SetPrivate(JSObject *obj, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp,\n                      jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> protop);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<JSObject*> proto);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParent(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetConstructor(JSContext *cx, JSObject *proto);\n\n/*\n * Get a unique identifier for obj, good for the lifetime of obj (even if it\n * is moved by a copying GC).  Return false on failure (likely out of memory),\n * and true with *idp containing the unique id on success.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);\n\nnamespace JS {\n\nenum {\n    FreshZone,\n    SystemZone,\n    SpecificZones\n};\n\ntypedef uintptr_t ZoneSpecifier;\n\ninline ZoneSpecifier\nSameZoneAs(JSObject *obj)\n{\n    JS_ASSERT(uintptr_t(obj) > SpecificZones);\n    return ZoneSpecifier(obj);\n}\n\nstruct JS_PUBLIC_API(CompartmentOptions) {\n    ZoneSpecifier zoneSpec;\n    JSVersion version;\n    bool invisibleToDebugger;\n\n    explicit CompartmentOptions() : zoneSpec(JS::FreshZone)\n                                  , version(JSVERSION_UNKNOWN)\n                                  , invisibleToDebugger(false)\n    {}\n\n    CompartmentOptions &setZone(ZoneSpecifier spec) { zoneSpec = spec; return *this; }\n    CompartmentOptions &setVersion(JSVersion version_) {\n        JS_ASSERT(version_ != JSVERSION_UNKNOWN);\n        version = version_;\n        return *this;\n    }\n\n    // Certain scopes (i.e. XBL compilation scopes) are implementation details\n    // of the embedding, and references to them should never leak out to script.\n    // This flag causes the this compartment to skip firing onNewGlobalObject\n    // and makes addDebuggee a no-op for this global.\n    CompartmentOptions &setInvisibleToDebugger(bool invisible) {\n        invisibleToDebugger = invisible;\n        return *this;\n    }\n};\n\n// During global creation, we fire notifications to callbacks registered\n// via the Debugger API. These callbacks are arbitrary script, and can touch\n// the global in arbitrary ways. When that happens, the global should not be\n// in a half-baked state. But this creates a problem for consumers that need\n// to set slots on the global to put it in a consistent state.\n//\n// This API provides a way for consumers to set slots atomically (immediately\n// after the global is created), before any debugger hooks are fired. It's\n// unfortunately on the clunky side, but that's the way the cookie crumbles.\n//\n// If callers have no additional state on the global to set up, they may pass\n// |FireOnNewGlobalHook| to JS_NewGlobalObject, which causes that function to\n// fire the hook as its final act before returning. Otherwise, callers should\n// pass |DontFireOnNewGlobalHook|, which means that they are responsible for\n// invoking JS_FireOnNewGlobalObject upon successfully creating the global. If\n// an error occurs and the operation aborts, callers should skip firing the\n// hook. But otherwise, callers must take care to fire the hook exactly once\n// before compiling any script in the global's scope (we have assertions in\n// place to enforce this). This lets us be sure that debugger clients never miss\n// breakpoints.\nenum OnNewGlobalHookOption {\n    FireOnNewGlobalHook,\n    DontFireOnNewGlobalHook\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals,\n                   JS::OnNewGlobalHookOption hookOption,\n                   const JS::CompartmentOptions &options = JS::CompartmentOptions());\n\nextern JS_PUBLIC_API(void)\nJS_FireOnNewGlobalObject(JSContext *cx, JS::HandleObject global);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\n/* Queries the [[Extensible]] property of the object. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExtensible(JSContext *cx, JS::HandleObject obj, JSBool *extensible);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNative(JSObject *obj);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetObjectRuntime(JSObject *obj);\n\n/*\n * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default\n * proto if proto's actual parameter value is null.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,\n                           JSObject *parent);\n\n/*\n * Freeze obj, and all objects it refers to, recursively. This will not recurse\n * through non-extensible objects, on the assumption that those are already\n * deep-frozen.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DeepFreezeObject(JSContext *cx, JSObject *obj);\n\n/*\n * Freezes an object; see ES5's Object.freeze(obj) method.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_FreezeObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PreventExtensions(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_New(JSContext *cx, JSObject *ctor, unsigned argc, jsval *argv);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp,\n                JSObject *proto, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineConstDoubles(JSContext *cx, JSObject *obj, const JSConstDoubleSpec *cds);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,\n                  JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,\n                      JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                   const char *name,\n                                   unsigned *attrsp, JSBool *foundp,\n                                   JSPropertyOp *getterp,\n                                   JSStrictPropertyOp *setterp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,\n                                       jsid id,\n                                       unsigned *attrsp, JSBool *foundp,\n                                       JSPropertyOp *getterp,\n                                       JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned attrs, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,\n                            int8_t tinyid, jsval value,\n                            JSPropertyOp getter, JSStrictPropertyOp setter,\n                            unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,\n                         JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id,\n                             JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name,\n                           unsigned flags, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,\n                               unsigned flags, JSObject **objp, JS::MutableHandle<JS::Value> vp);\n\nstruct JSPropertyDescriptor {\n    JSObject           *obj;\n    unsigned           attrs;\n    unsigned           shortid;\n    JSPropertyOp       getter;\n    JSStrictPropertyOp setter;\n    JS::Value          value;\n\n    JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL),\n                             setter(NULL), value(JSVAL_VOID)\n    {}\n\n    void trace(JSTracer *trc);\n};\n\nnamespace JS {\n\ntemplate <typename Outer>\nclass PropertyDescriptorOperations\n{\n    const JSPropertyDescriptor * desc() const { return static_cast<const Outer*>(this)->extract(); }\n    JSPropertyDescriptor * desc() { return static_cast<Outer*>(this)->extract(); }\n\n  public:\n    bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; }\n    bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; }\n    bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; }\n    bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; }\n    bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; }\n    bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; }\n    bool isShared() const { return desc()->attrs & JSPROP_SHARED; }\n    bool isIndex() const { return desc()->attrs & JSPROP_INDEX; }\n    bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; }\n    bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; }\n\n    JS::MutableHandleObject object() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); }\n    unsigned attributes() const { return desc()->attrs; }\n    unsigned shortid() const {\n        MOZ_ASSERT(hasShortId());\n        return desc()->shortid;\n    }\n    JSPropertyOp getter() const { return desc()->getter; }\n    JSStrictPropertyOp setter() const { return desc()->setter; }\n    JS::HandleObject getterObject() const {\n        MOZ_ASSERT(hasGetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->getter));\n    }\n    JS::HandleObject setterObject() const {\n        MOZ_ASSERT(hasSetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->setter));\n    }\n    JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); }\n\n    void setAttributes(unsigned attrs) { desc()->attrs = attrs; }\n    void setShortId(unsigned id) { desc()->shortid = id; }\n    void setGetter(JSPropertyOp op) { desc()->getter = op; }\n    void setSetter(JSStrictPropertyOp op) { desc()->setter = op; }\n    void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast<JSPropertyOp>(obj); }\n    void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast<JSStrictPropertyOp>(obj); }\n};\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <>\nstruct GCMethods<JSPropertyDescriptor> {\n    static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); }\n    static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; }\n    static bool poisoned(const JSPropertyDescriptor &desc) {\n        return (desc.obj && JS::IsPoisonedPtr(desc.obj)) ||\n               (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) ||\n               (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) ||\n               (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing()));\n    }\n};\n\ntemplate <>\nclass RootedBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\ntemplate <>\nclass HandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Handle<JSPropertyDescriptor>*>(this)->address();\n    }\n  public:\n    JS::HandleValue value() const { return JS::HandleValue::fromMarkedLocation(&extract()->value); }\n    JS::HandleObject obj() const { return JS::HandleObject::fromMarkedLocation(&extract()->obj); }\n};\n\ntemplate <>\nclass MutableHandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\n} /* namespace js */\n\n/*\n * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on\n * an object on the prototype chain (returned in objp). If data->obj is null,\n * then this property was not found on the prototype chain.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags,\n                             JSPropertyDescriptor *desc);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def,\n                          JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf,\n                        JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name,\n                   JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, jsval value,\n                    JSPropertyOp getter, JSStrictPropertyOp setter,\n                    unsigned attrs);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                     const jschar *name, size_t namelen,\n                                     unsigned *attrsp, JSBool *foundp,\n                                     JSPropertyOp *getterp,\n                                     JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned attrs, JSBool *foundp);\n\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,\n                              const jschar *name, size_t namelen,\n                              int8_t tinyid, jsval value,\n                              JSPropertyOp getter, JSStrictPropertyOp setter,\n                              unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,\n                           size_t namelen, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JSBool *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen,\n                    JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteUCProperty2(JSContext *cx, JSObject *obj,\n                     const jschar *name, size_t namelen,\n                     JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayObject(JSContext *cx, int length, jsval *vector);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsArrayObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,\n                 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp);\n\n/*\n * Get the property with name given by |index|, if it has one.  If\n * not, |*present| will be set to false and the value of |vp| must not\n * be relied on.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp, JSBool* present);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);\n\n/*\n * Remove all configurable properties from the given (non-global) object and\n * assign undefined to all writable data properties.\n */\nJS_PUBLIC_API(void)\nJS_ClearNonGlobalObject(JSContext *cx, JSObject *objArg);\n\n/*\n * Assign 'undefined' to all of the object's non-reserved slots. Note: this is\n * done for all slots, regardless of the associated property descriptor.\n */\nJS_PUBLIC_API(void)\nJS_SetAllNonReservedSlotsToUndefined(JSContext *cx, JSObject *objArg);\n\n/*\n * Create a new array buffer with the given contents, which must have been\n * returned by JS_AllocateArrayBufferContents or JS_StealArrayBufferContents.\n * The new array buffer takes ownership. After calling this function, do not\n * free |contents| or use |contents| from another thread.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayBufferWithContents(JSContext *cx, void *contents);\n\n/*\n * Steal the contents of the given array buffer. The array buffer has its\n * length set to 0 and its contents array cleared. The caller takes ownership\n * of |*contents| and must free it or transfer ownership via\n * JS_NewArrayBufferWithContents when done using it.\n * To free |*contents|, call free().\n * A pointer to the buffer's data is returned in |*data|. This pointer can\n * be used until |*contents| is freed or has its ownership transferred.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents,\n                            uint8_t **data);\n\n/*\n * Allocate memory that may be eventually passed to\n * JS_NewArrayBufferWithContents. |nbytes| is the number of payload bytes\n * required. The pointer to pass to JS_NewArrayBufferWithContents is returned\n * in |contents|. The pointer to the |nbytes| of usable memory is returned in\n * |data|. (*|contents| will contain a header before |data|.) The only legal\n * operations on *|contents| is to free it, or pass it to\n * JS_NewArrayBufferWithContents or JS_ReallocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\n/*\n * Reallocate memory allocated by JS_AllocateArrayBufferContents, growing or shrinking it\n * as appropriate.  The new data pointer will be returned in data.  If *contents is NULL,\n * behaves like JS_AllocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\nextern JS_PUBLIC_API(JSIdArray *)\nJS_Enumerate(JSContext *cx, JSObject *obj);\n\n/*\n * Create an object to iterate over enumerable properties of obj, in arbitrary\n * property definition order.  NB: This differs from longstanding for..in loop\n * order, which uses order of property definition in obj.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewPropertyIterator(JSContext *cx, JSObject *obj);\n\n/*\n * Return true on success with *idp containing the id of the next enumerable\n * property to visit using iterobj, or JSID_IS_VOID if there is no such property\n * left to visit.  Return false on error.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);\n\n/*\n * A JSNative that creates and returns a new iterator that iterates over the\n * elements of |this|, up to |this.length|, in index order. This can be used to\n * make any array-like object iterable. Just give the object an obj.iterator()\n * method using this JSNative as the implementation.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,\n               jsval *vp, unsigned *attrsp);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetReservedSlot(JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(void)\nJS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v);\n\n/************************************************************************/\n\n/*\n * Security protocol.\n */\nstruct JSPrincipals {\n    /* Don't call \"destroy\"; use reference counting macros below. */\n    int refcount;\n\n#ifdef DEBUG\n    /* A helper to facilitate principals debugging. */\n    uint32_t    debugToken;\n#endif\n\n    void setDebugToken(uint32_t token) {\n# ifdef DEBUG\n        debugToken = token;\n# endif\n    }\n\n    /*\n     * This is not defined by the JS engine but should be provided by the\n     * embedding.\n     */\n    JS_PUBLIC_API(void) dump();\n};\n\nextern JS_PUBLIC_API(void)\nJS_HoldPrincipals(JSPrincipals *principals);\n\nextern JS_PUBLIC_API(void)\nJS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);\n\nstruct JSSecurityCallbacks {\n    JSCheckAccessOp            checkObjectAccess;\n    JSCSPEvalChecker           contentSecurityPolicyAllows;\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetSecurityCallbacks(JSRuntime *rt, const JSSecurityCallbacks *callbacks);\n\nextern JS_PUBLIC_API(const JSSecurityCallbacks *)\nJS_GetSecurityCallbacks(JSRuntime *rt);\n\n/*\n * Code running with \"trusted\" principals will be given a deeper stack\n * allocation than ordinary scripts. This allows trusted script to run after\n * untrusted script has exhausted the stack. This function sets the\n * runtime-wide trusted principal.\n *\n * This principals is not held (via JS_HoldPrincipals/JS_DropPrincipals) since\n * there is no available JSContext. Instead, the caller must ensure that the\n * given principals stays valid for as long as 'rt' may point to it. If the\n * principals would be destroyed before 'rt', JS_SetTrustedPrincipals must be\n * called again, passing NULL for 'prin'.\n */\nextern JS_PUBLIC_API(void)\nJS_SetTrustedPrincipals(JSRuntime *rt, JSPrincipals *prin);\n\n/*\n * Initialize the callback that is called to destroy JSPrincipals instance\n * when its reference counter drops to zero. The initialization can be done\n * only once per JS runtime.\n */\nextern JS_PUBLIC_API(void)\nJS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPrincipals);\n\n/************************************************************************/\n\n/*\n * Functions and scripts.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n               JSObject *parent, const char *name);\n\n/*\n * Create the function with the name given by the id. JSID_IS_STRING(id) must\n * be true.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                   JSObject *parent, jsid id);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionObject(JSFunction *fun);\n\n/*\n * Return the function's identifier as a JSString, or null if fun is unnamed.\n * The returned string lives as long as fun, so you don't need to root a saved\n * reference to it if fun is well-connected or rooted, and provided you bound\n * the use of the saved reference by fun's lifetime.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionId(JSFunction *fun);\n\n/*\n * Return a function's display name. This is the defined name if one was given\n * where the function was defined, or it could be an inferred name by the JS\n * engine in the case that the function was defined to be anonymous. This can\n * still return NULL if a useful display name could not be inferred. The same\n * restrictions on rooting as those in JS_GetFunctionId apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionDisplayId(JSFunction *fun);\n\n/*\n * Return the arity (length) of fun.\n */\nextern JS_PUBLIC_API(uint16_t)\nJS_GetFunctionArity(JSFunction *fun);\n\n/*\n * Infallible predicate to test whether obj is a function object (faster than\n * comparing obj's class name to \"Function\", but equivalent unless someone has\n * overwritten the \"Function\" identifier with a different constructor and then\n * created instances using that constructor that might be passed in as obj).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsFunction(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsCallable(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNativeFunction(JSObject *funobj, JSNative call);\n\n/* Return whether the given function is a valid constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsConstructor(JSFunction *fun);\n\n/*\n * Bind the given callable to use the given object as \"this\".\n *\n * If |callable| is not callable, will throw and return NULL.\n */\nextern JS_PUBLIC_API(JSObject*)\nJS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                  unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineUCFunction(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, JSNative call,\n                    unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,\n                      unsigned nargs, unsigned attrs);\n\n/*\n * Clone a top-level function into a new scope. This function will dynamically\n * fail if funobj was lexically nested inside some other function.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);\n\n/*\n * Given a buffer, return JS_FALSE if the buffer might become a valid\n * javascript statement with the addition of more lines.  Otherwise return\n * JS_TRUE.  The intent is to support interactive compilation - accumulate\n * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to\n * the compiler.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScript(JSContext *cx, JSObject *obj,\n                 const char *ascii, size_t length,\n                 const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,\n                              JSPrincipals *principals,\n                              const char *ascii, size_t length,\n                              const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScript(JSContext *cx, JSObject *obj,\n                   const jschar *chars, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals,\n                                const jschar *chars, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalFromScript(JSScript *script);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,\n                   unsigned nargs, const char **argnames,\n                   const char *bytes, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals, const char *name,\n                                unsigned nargs, const char **argnames,\n                                const char *bytes, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileUCFunction(JSContext *cx, JSObject *obj, const char *name,\n                     unsigned nargs, const char **argnames,\n                     const jschar *chars, size_t length,\n                     const char *filename, unsigned lineno);\n\nnamespace JS {\n\n/* Options for JavaScript compilation. */\nclass JS_PUBLIC_API(CompileOptions)\n{\n    JSPrincipals *principals_;\n    JSPrincipals *originPrincipals_;\n\n  public:\n    JSPrincipals *principals() const { return principals_; }\n    JSPrincipals *originPrincipals() const;\n\n    JSVersion version;\n    bool versionSet;\n    bool utf8;\n    const char *filename;\n    unsigned lineno;\n    unsigned column;\n    HandleObject element;\n    bool compileAndGo;\n    bool forEval;\n    bool noScriptRval;\n    bool selfHostingMode;\n    bool canLazilyParse;\n    bool strictOption;\n    bool extraWarningsOption;\n    bool werrorOption;\n    bool asmJSOption;\n    enum SourcePolicy {\n        NO_SOURCE,\n        LAZY_SOURCE,\n        SAVE_SOURCE\n    } sourcePolicy;\n\n    explicit CompileOptions(JSContext *cx, JSVersion version = JSVERSION_UNKNOWN);\n    CompileOptions &setPrincipals(JSPrincipals *p) { principals_ = p; return *this; }\n    CompileOptions &setOriginPrincipals(JSPrincipals *p) { originPrincipals_ = p; return *this; }\n    CompileOptions &setVersion(JSVersion v) { version = v; versionSet = true; return *this; }\n    CompileOptions &setUTF8(bool u) { utf8 = u; return *this; }\n    CompileOptions &setFileAndLine(const char *f, unsigned l) {\n        filename = f; lineno = l; return *this;\n    }\n    CompileOptions &setColumn(unsigned c) { column = c; return *this; }\n    CompileOptions &setElement(HandleObject e) { element = e; return *this; }\n    CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }\n    CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }\n    CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }\n    CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }\n    CompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }\n    CompileOptions &setSourcePolicy(SourcePolicy sp) { sourcePolicy = sp; return *this; }\n};\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, FILE *file);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, const char *filename);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const jschar *chars, size_t length);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * API extension: OR this into indent to avoid pretty-printing the decompiled\n * source resulting from JS_DecompileFunction{,Body}.\n */\n#define JS_DONT_PRETTY_PRINT    ((unsigned)0x8000)\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);\n\n/*\n * NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj\n * parameter as the initial scope chain header, the 'this' keyword value, and\n * the variables object (ECMA parlance for where 'var' and 'function' bind\n * names) of the execution context for script.\n *\n * Using obj as the variables object is problematic if obj's parent (which is\n * the scope chain link; see JS_SetParent and JS_NewObject) is not null: in\n * this case, variables created by 'var x = 0', e.g., go in obj, but variables\n * created by assignment to an unbound id, 'x = 0', go in the last object on\n * the scope chain linked by parent.\n *\n * ECMA calls that last scoping object the \"global object\", but note that many\n * embeddings have several such objects.  ECMA requires that \"global code\" be\n * executed with the variables object equal to this global object.  But these\n * JS API entry points provide freedom to execute code against a \"sub-global\",\n * i.e., a parented or scoped object, in which case the variables object will\n * differ from the last object on the scope chain, resulting in confusing and\n * non-ECMA explicit vs. implicit variable creation.\n *\n * Caveat embedders: unless you already depend on this buggy variables object\n * binding behavior, you should call JS_SetOptions(cx, JSOPTION_VAROBJFIX) or\n * JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_VAROBJFIX) -- the latter if\n * someone may have set other options on cx already -- for each context in the\n * application, if you pass parented objects as the obj parameter, or may ever\n * pass such objects in the future.\n *\n * Why a runtime option?  The alternative is to add six or so new API entry\n * points with signatures matching the following six, and that doesn't seem\n * worth the code bloat cost.  Such new entry points would probably have less\n * obvious names, too, so would not tend to be used.  The JS_SetOption call,\n * OTOH, can be more easily hacked into existing code that does not depend on\n * the bug; such code can continue to use the familiar JS_EvaluateScript,\n * etc., entry points.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,\n                        JSVersion version);\n\n/*\n * Execute either the function-defining prolog of a script, or the script's\n * main body, but not both.\n */\ntypedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart;\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScript(JSContext *cx, JSObject *obj,\n                  const char *bytes, unsigned length,\n                  const char *filename, unsigned lineno,\n                  jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,\n                               JSPrincipals *principals,\n                               const char *bytes, unsigned length,\n                               const char *filename, unsigned lineno,\n                               jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                      JSPrincipals *principals,\n                                      const char *bytes, unsigned length,\n                                      const char *filename, unsigned lineno,\n                                      jsval *rval, JSVersion version);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScript(JSContext *cx, JSObject *obj,\n                    const jschar *chars, unsigned length,\n                    const char *filename, unsigned lineno,\n                    jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                 JSPrincipals *principals,\n                                 const jschar *chars, unsigned length,\n                                 const char *filename, unsigned lineno,\n                                 jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                        JSPrincipals *principals,\n                                        const jschar *chars, unsigned length,\n                                        const char *filename, unsigned lineno,\n                                        jsval *rval, JSVersion version);\n\n/*\n * JSAPI clients may optionally specify the 'originPrincipals' of a script.\n * A script's originPrincipals may be retrieved through the debug API (via\n * JS_GetScriptOriginPrincipals) and the originPrincipals are transitively\n * assigned to any nested scripts (including scripts dynamically created via\n * eval and the Function constructor). If originPrincipals is null, then the\n * value of principals is used as origin principals for the script.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,\n                                              JSPrincipals *principals,\n                                              JSPrincipals *originPrincipals,\n                                              const jschar *chars, unsigned length,\n                                              const char *filename, unsigned lineno,\n                                              jsval *rval, JSVersion version);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const jschar *chars, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *bytes, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *filename, jsval *rval);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc,\n                jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc,\n                    jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc,\n                     jsval *argv, jsval *rval);\n\nnamespace JS {\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, JSFunction *fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunction(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, const char *name, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionName(cx, thisObj, name, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, jsval fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionValue(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nextern JS_PUBLIC_API(bool)\nCall(JSContext *cx, jsval thisv, jsval fun, unsigned argc, jsval *argv, MutableHandle<Value> rval);\n\nstatic inline bool\nCall(JSContext *cx, jsval thisv, JSObject *funObj, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return Call(cx, thisv, OBJECT_TO_JSVAL(funObj), argc, argv, rval);\n}\n\n} /* namespace JS */\n\n/*\n * These functions allow setting an operation callback that will be called\n * from the JS thread some time after any thread triggered the callback using\n * JS_TriggerOperationCallback(rt).\n *\n * To schedule the GC and for other activities the engine internally triggers\n * operation callbacks. The embedding should thus not rely on callbacks being\n * triggered through the external API only.\n *\n * Important note: Additional callbacks can occur inside the callback handler\n * if it re-enters the JS engine. The embedding must ensure that the callback\n * is disconnected before attempting such re-entry.\n */\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_SetOperationCallback(JSContext *cx, JSOperationCallback callback);\n\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_GetOperationCallback(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_TriggerOperationCallback(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsRunning(JSContext *cx);\n\n/*\n * Saving and restoring frame chains.\n *\n * These two functions are used to set aside cx's call stack while that stack\n * is inactive. After a call to JS_SaveFrameChain, it looks as if there is no\n * code running on cx. Before calling JS_RestoreFrameChain, cx's call stack\n * must be balanced and all nested calls to JS_SaveFrameChain must have had\n * matching JS_RestoreFrameChain calls.\n *\n * JS_SaveFrameChain deals with cx not having any code running on it.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SaveFrameChain(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreFrameChain(JSContext *cx);\n\n#ifdef MOZ_TRACE_JSCALLS\n/*\n * The callback is expected to be quick and noninvasive. It should not\n * trigger interrupts, turn on debugging, or produce uncaught JS\n * exceptions. The state of the stack and registers in the context\n * cannot be relied upon, since this callback may be invoked directly\n * from either JIT. The 'entering' field means we are entering a\n * function if it is positive, leaving a function if it is zero or\n * negative.\n */\nextern JS_PUBLIC_API(void)\nJS_SetFunctionCallback(JSContext *cx, JSFunctionCallback fcb);\n\nextern JS_PUBLIC_API(JSFunctionCallback)\nJS_GetFunctionCallback(JSContext *cx);\n#endif /* MOZ_TRACE_JSCALLS */\n\n/************************************************************************/\n\n/*\n * Strings.\n *\n * NB: JS_NewUCString takes ownership of bytes on success, avoiding a copy;\n * but on error (signified by null return), it leaves chars owned by the\n * caller. So the caller must free bytes in the error case, if it has no use\n * for them. In contrast, all the JS_New*StringCopy* functions do not take\n * ownership of the character memory passed to them -- they copy it.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyN(JSContext *cx, const char *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyZ(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternJSString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternStringN(JSContext *cx, const char *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternString(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCString(JSContext *cx, jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyN(JSContext *cx, const jschar *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyZ(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCString(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FileEscapedString(FILE *fp, JSString *str, char quote);\n\n/*\n * Extracting string characters and length.\n *\n * While getting the length of a string is infallible, getting the chars can\n * fail. As indicated by the lack of a JSContext parameter, there are two\n * special cases where getting the chars is infallible:\n *\n * The first case is interned strings, i.e., strings from JS_InternString or\n * JSID_TO_STRING(id), using JS_GetInternedStringChars*.\n *\n * The second case is \"flat\" strings that have been explicitly prepared in a\n * fallible context by JS_FlattenString. To catch errors, a separate opaque\n * JSFlatString type is returned by JS_FlattenString and expected by\n * JS_GetFlatStringChars. Note, though, that this is purely a syntactic\n * distinction: the input and output of JS_FlattenString are the same actual\n * GC-thing so only one needs to be rooted. If a JSString is known to be flat,\n * JS_ASSERT_STRING_IS_FLAT can be used to make a debug-checked cast. Example:\n *\n *   // in a fallible context\n *   JSFlatString *fstr = JS_FlattenString(cx, str);\n *   if (!fstr)\n *     return JS_FALSE;\n *   JS_ASSERT(fstr == JS_ASSERT_STRING_IS_FLAT(str));\n *\n *   // in an infallible context, for the same 'str'\n *   const jschar *chars = JS_GetFlatStringChars(fstr)\n *   JS_ASSERT(chars);\n *\n * The CharsZ APIs guarantee that the returned array has a null character at\n * chars[length]. This can require additional copying so clients should prefer\n * APIs without CharsZ if possible. The infallible functions also return\n * null-terminated arrays. (There is no additional cost or non-Z alternative\n * for the infallible functions, so 'Z' is left out of the identifier.)\n */\n\nextern JS_PUBLIC_API(size_t)\nJS_GetStringLength(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringChars(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringCharsAndLength(JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZ(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(JSFlatString *)\nJS_FlattenString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetFlatStringChars(JSFlatString *str);\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJSID_TO_FLAT_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSFlatString *)(JSID_BITS(id));\n}\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJS_ASSERT_STRING_IS_FLAT(JSString *str)\n{\n    JS_ASSERT(JS_GetFlatStringChars((JSFlatString *)str));\n    return (JSFlatString *)str;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJS_FORGET_STRING_FLATNESS(JSFlatString *fstr)\n{\n    return (JSString *)fstr;\n}\n\n/*\n * Additional APIs that avoid fallibility when given a flat string.\n */\n\nextern JS_PUBLIC_API(JSBool)\nJS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedFlatString(char *buffer, size_t size, JSFlatString *str, char quote);\n\n/*\n * This function is now obsolete and behaves the same as JS_NewUCString.  Use\n * JS_NewUCString instead.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewGrowableString(JSContext *cx, jschar *chars, size_t length);\n\n/*\n * Create a dependent string, i.e., a string that owns no character storage,\n * but that refers to a slice of another string's chars.  Dependent strings\n * are mutable by definition, so the thread safety comments above apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewDependentString(JSContext *cx, JSString *str, size_t start,\n                      size_t length);\n\n/*\n * Concatenate two strings, possibly resulting in a rope.\n * See above for thread safety comments.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_ConcatStrings(JSContext *cx, JSString *left, JSString *right);\n\n/*\n * For JS_DecodeBytes, set *dstlenp to the size of the destination buffer before\n * the call; on return, *dstlenp contains the number of jschars actually stored.\n * To determine the necessary destination buffer size, make a sizing call that\n * passes NULL for dst.\n *\n * On errors, the functions report the error. In that case, *dstlenp contains\n * the number of characters or bytes transferred so far.  If cx is NULL, no\n * error is reported on failure, and the functions simply return JS_FALSE.\n *\n * NB: This function does not store an additional zero byte or jschar after the\n * transcoded string.\n */\nJS_PUBLIC_API(JSBool)\nJS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst,\n               size_t *dstlenp);\n\n/*\n * A variation on JS_EncodeCharacters where a null terminated string is\n * returned that you are expected to call JS_free on when done.\n */\nJS_PUBLIC_API(char *)\nJS_EncodeString(JSContext *cx, JSString *str);\n\n/*\n * Same behavior as JS_EncodeString(), but encode into UTF-8 string\n */\nJS_PUBLIC_API(char *)\nJS_EncodeStringToUTF8(JSContext *cx, JSString *str);\n\n/*\n * Get number of bytes in the string encoding (without accounting for a\n * terminating zero bytes. The function returns (size_t) -1 if the string\n * can not be encoded into bytes and reports an error using cx accordingly.\n */\nJS_PUBLIC_API(size_t)\nJS_GetStringEncodingLength(JSContext *cx, JSString *str);\n\n/*\n * Encode string into a buffer. The function does not stores an additional\n * zero byte. The function returns (size_t) -1 if the string can not be\n * encoded into bytes with no error reported. Otherwise it returns the number\n * of bytes that are necessary to encode the string. If that exceeds the\n * length parameter, the string will be cut and only length bytes will be\n * written into the buffer.\n */\nJS_PUBLIC_API(size_t)\nJS_EncodeStringToBuffer(JSContext *cx, JSString *str, char *buffer, size_t length);\n\nclass JSAutoByteString\n{\n  public:\n    JSAutoByteString(JSContext *cx, JSString *str\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mBytes(JS_EncodeString(cx, str))\n    {\n        JS_ASSERT(cx);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    JSAutoByteString(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : mBytes(NULL)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoByteString() {\n        js_free(mBytes);\n    }\n\n    /* Take ownership of the given byte array. */\n    void initBytes(char *bytes) {\n        JS_ASSERT(!mBytes);\n        mBytes = bytes;\n    }\n\n    char *encodeLatin1(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeString(cx, str);\n        return mBytes;\n    }\n\n    char *encodeLatin1(js::ContextFriendFields *cx, JSString *str);\n\n    char *encodeUtf8(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeStringToUTF8(cx, str);\n        return mBytes;\n    }\n\n    void clear() {\n        js_free(mBytes);\n        mBytes = NULL;\n    }\n\n    char *ptr() const {\n        return mBytes;\n    }\n\n    bool operator!() const {\n        return !mBytes;\n    }\n\n    size_t length() const {\n        if (!mBytes)\n            return 0;\n        return strlen(mBytes);\n    }\n\n  private:\n    char        *mBytes;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* Copy and assignment are not supported. */\n    JSAutoByteString(const JSAutoByteString &another);\n    JSAutoByteString &operator=(const JSAutoByteString &another);\n};\n\n/************************************************************************/\n/*\n * JSON functions\n */\ntypedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);\n\n/*\n * JSON.stringify as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,\n             JSONWriteCallback callback, void *data);\n\n/*\n * JSON.parse as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle<JS::Value> vp);\n\nJS_PUBLIC_API(JSBool)\nJS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,\n                        jsval *vp);\n\n/************************************************************************/\n\n/* API for the HTML5 internal structured cloning algorithm. */\n\n/* The maximum supported structured-clone serialization format version. */\n#define JS_STRUCTURED_CLONE_VERSION 2\n\nstruct JSStructuredCloneCallbacks {\n    ReadStructuredCloneOp read;\n    WriteStructuredCloneOp write;\n    StructuredCloneErrorOp reportError;\n};\n\n/* Note: if the *data contains transferable objects, it can be read\n * only once */\nJS_PUBLIC_API(JSBool)\nJS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes,\n                       uint32_t version, jsval *vp,\n                       const JSStructuredCloneCallbacks *optionalCallbacks,\n                       void *closure);\n\n/* Note: On success, the caller is responsible for calling\n * JS_ClearStructuredClone(*datap, nbytesp). */\nJS_PUBLIC_API(JSBool)\nJS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,\n                        const JSStructuredCloneCallbacks *optionalCallbacks,\n                        void *closure, jsval transferable);\n\nJS_PUBLIC_API(JSBool)\nJS_ClearStructuredClone(const uint64_t *data, size_t nbytes);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes,\n                                   JSBool *hasTransferable);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredClone(JSContext *cx, jsval v, jsval *vp,\n                   const JSStructuredCloneCallbacks *optionalCallbacks,\n                   void *closure);\n\n/* RAII sugar for JS_WriteStructuredClone. */\nclass JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {\n    uint64_t *data_;\n    size_t nbytes_;\n    uint32_t version_;\n\n  public:\n    JSAutoStructuredCloneBuffer()\n        : data_(NULL), nbytes_(0), version_(JS_STRUCTURED_CLONE_VERSION) {}\n\n    ~JSAutoStructuredCloneBuffer() { clear(); }\n\n    uint64_t *data() const { return data_; }\n    size_t nbytes() const { return nbytes_; }\n\n    void clear();\n\n    /* Copy some memory. It will be automatically freed by the destructor. */\n    bool copy(const uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Adopt some memory. It will be automatically freed by the destructor.\n     * data must have been allocated by the JS engine (e.g., extracted via\n     * JSAutoStructuredCloneBuffer::steal).\n     */\n    void adopt(uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Remove the buffer so that it will not be automatically freed.\n     * After this, the caller is responsible for feeding the memory back to\n     * JSAutoStructuredCloneBuffer::adopt.\n     */\n    void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=NULL);\n\n    bool read(JSContext *cx, jsval *vp,\n              const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n              void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               jsval transferable,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    /**\n     * Swap ownership with another JSAutoStructuredCloneBuffer.\n     */\n    void swap(JSAutoStructuredCloneBuffer &other);\n\n  private:\n    /* Copy and assignment are not supported. */\n    JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other);\n    JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other);\n};\n\n/* API for implementing custom serialization behavior (for ImageData, File, etc.) */\n\n/* The range of tag values the application may use for its own custom object types. */\n#define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)\n#define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)\n\n#define JS_SCERR_RECURSION 0\n#define JS_SCERR_TRANSFERABLE 1\n\nJS_PUBLIC_API(void)\nJS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);\n\n/************************************************************************/\n\n/*\n * The default locale for the ECMAScript Internationalization API\n * (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).\n * Note that the Internationalization API encourages clients to\n * specify their own locales.\n * The locale string remains owned by the caller.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetDefaultLocale(JSRuntime *rt, const char *locale);\n\n/*\n * Reset the default locale to OS defaults.\n */\nextern JS_PUBLIC_API(void)\nJS_ResetDefaultLocale(JSRuntime *rt);\n\n/*\n * Locale specific string conversion and error message callbacks.\n */\nstruct JSLocaleCallbacks {\n    JSLocaleToUpperCase     localeToUpperCase;\n    JSLocaleToLowerCase     localeToLowerCase;\n    JSLocaleCompare         localeCompare; // not used #if ENABLE_INTL_API\n    JSLocaleToUnicode       localeToUnicode;\n    JSErrorCallback         localeGetErrorMessage;\n};\n\n/*\n * Establish locale callbacks. The pointer must persist as long as the\n * JSRuntime.  Passing NULL restores the default behaviour.\n */\nextern JS_PUBLIC_API(void)\nJS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks);\n\n/*\n * Return the address of the current locale callbacks struct, which may\n * be NULL.\n */\nextern JS_PUBLIC_API(JSLocaleCallbacks *)\nJS_GetLocaleCallbacks(JSRuntime *rt);\n\n/************************************************************************/\n\n/*\n * Error reporting.\n */\n\n/*\n * Report an exception represented by the sprintf-like conversion of format\n * and its arguments.  This exception message string is passed to a pre-set\n * JSErrorReporter function (set by JS_SetErrorReporter).\n */\nextern JS_PUBLIC_API(void)\nJS_ReportError(JSContext *cx, const char *format, ...);\n\n/*\n * Use an errorNumber to retrieve the format string, args are char *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,\n                       void *userRef, const unsigned errorNumber, va_list ap);\n#endif\n\n/*\n * Use an errorNumber to retrieve the format string, args are jschar *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUC(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback,\n                            void *userRef, const unsigned errorNumber,\n                            const jschar **args);\n\n/*\n * As above, but report a warning instead (JSREPORT_IS_WARNING(report.flags)).\n * Return true if there was no error trying to issue the warning, and if the\n * warning was not converted into an error due to the JSOPTION_WERROR option\n * being set, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReportWarning(JSContext *cx, const char *format, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags,\n                             JSErrorCallback errorCallback, void *userRef,\n                             const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags,\n                               JSErrorCallback errorCallback, void *userRef,\n                               const unsigned errorNumber, ...);\n\n/*\n * Complain when out of memory.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportOutOfMemory(JSContext *cx);\n\n/*\n * Complain when an allocation size overflows the maximum supported limit.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportAllocationOverflow(JSContext *cx);\n\nstruct JSErrorReport {\n    const char      *filename;      /* source file name, URL, etc., or null */\n    JSPrincipals    *originPrincipals; /* see 'originPrincipals' comment above */\n    unsigned        lineno;         /* source line number */\n    const char      *linebuf;       /* offending source line without final \\n */\n    const char      *tokenptr;      /* pointer to error token in linebuf */\n    const jschar    *uclinebuf;     /* unicode (original) line buffer */\n    const jschar    *uctokenptr;    /* unicode (original) token pointer */\n    unsigned        flags;          /* error/warning, etc. */\n    unsigned        errorNumber;    /* the error number, e.g. see js.msg */\n    const jschar    *ucmessage;     /* the (default) error message */\n    const jschar    **messageArgs;  /* arguments for the error message */\n    int16_t         exnType;        /* One of the JSExnType constants */\n    unsigned        column;         /* zero-based column index in line */\n};\n\n/*\n * JSErrorReport flag values.  These may be freely composed.\n */\n#define JSREPORT_ERROR      0x0     /* pseudo-flag for default case */\n#define JSREPORT_WARNING    0x1     /* reported via JS_ReportWarning */\n#define JSREPORT_EXCEPTION  0x2     /* exception was thrown */\n#define JSREPORT_STRICT     0x4     /* error or warning due to strict option */\n\n/*\n * This condition is an error in strict mode code, a warning if\n * JS_HAS_STRICT_OPTION(cx), and otherwise should not be reported at\n * all.  We check the strictness of the context's top frame's script;\n * where that isn't appropriate, the caller should do the right checks\n * itself instead of using this flag.\n */\n#define JSREPORT_STRICT_MODE_ERROR 0x8\n\n/*\n * If JSREPORT_EXCEPTION is set, then a JavaScript-catchable exception\n * has been thrown for this runtime error, and the host should ignore it.\n * Exception-aware hosts should also check for JS_IsExceptionPending if\n * JS_ExecuteScript returns failure, and signal or propagate the exception, as\n * appropriate.\n */\n#define JSREPORT_IS_WARNING(flags)      (((flags) & JSREPORT_WARNING) != 0)\n#define JSREPORT_IS_EXCEPTION(flags)    (((flags) & JSREPORT_EXCEPTION) != 0)\n#define JSREPORT_IS_STRICT(flags)       (((flags) & JSREPORT_STRICT) != 0)\n#define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) &                      \\\n                                              JSREPORT_STRICT_MODE_ERROR) != 0)\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_GetErrorReporter(JSContext *cx);\n\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_SetErrorReporter(JSContext *cx, JSErrorReporter er);\n\n/************************************************************************/\n\n/*\n * Dates.\n */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObjectMsec(JSContext *cx, double msec);\n\n/*\n * Infallible predicate to test whether obj is a date object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsDate(JSContext *cx, JSObject *obj);\n\n/*\n * Clears the cache of calculated local time from each Date object.\n * Call to propagate a system timezone change.\n */\nextern JS_PUBLIC_API(void)\nJS_ClearDateCaches(JSContext *cx);\n\n/************************************************************************/\n\n/*\n * Regular Expressions.\n */\n#define JSREG_FOLD      0x01    /* fold uppercase to lowercase */\n#define JSREG_GLOB      0x02    /* global exec, creates array of matches */\n#define JSREG_MULTILINE 0x04    /* treat ^ and $ as begin and end of line */\n#define JSREG_STICKY    0x08    /* only match starting at lastIndex */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObject(JSContext *cx, JSObject *obj, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(void)\nJS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRegExpStatics(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length,\n                 size_t *indexp, JSBool test, jsval *rval);\n\n/* RegExp interface for clients without a global object. */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length,\n                          size_t *indexp, JSBool test, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsRegExp(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetRegExpFlags(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetRegExpSource(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsExceptionPending(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPendingException(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_SetPendingException(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(void)\nJS_ClearPendingException(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportPendingException(JSContext *cx);\n\n/*\n * Save the current exception state.  This takes a snapshot of cx's current\n * exception state without making any change to that state.\n *\n * The returned state pointer MUST be passed later to JS_RestoreExceptionState\n * (to restore that saved state, overriding any more recent state) or else to\n * JS_DropExceptionState (to free the state struct in case it is not correct\n * or desirable to restore it).  Both Restore and Drop free the state struct,\n * so callers must stop using the pointer returned from Save after calling the\n * Release or Drop API.\n */\nextern JS_PUBLIC_API(JSExceptionState *)\nJS_SaveExceptionState(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreExceptionState(JSContext *cx, JSExceptionState *state);\n\nextern JS_PUBLIC_API(void)\nJS_DropExceptionState(JSContext *cx, JSExceptionState *state);\n\n/*\n * If the given value is an exception object that originated from an error,\n * the exception will contain an error report struct, and this API will return\n * the address of that struct.  Otherwise, it returns NULL.  The lifetime of\n * the error report struct that might be returned is the same as the lifetime\n * of the exception object.\n */\nextern JS_PUBLIC_API(JSErrorReport *)\nJS_ErrorFromException(JSContext *cx, jsval v);\n\n/*\n * Given a reported error's message and JSErrorReport struct pointer, throw\n * the corresponding exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowReportedError(JSContext *cx, const char *message,\n                      JSErrorReport *reportp);\n\n/*\n * Throws a StopIteration exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowStopIteration(JSContext *cx);\n\nextern JS_PUBLIC_API(intptr_t)\nJS_GetCurrentThread();\n\n/*\n * A JS runtime always has an \"owner thread\". The owner thread is set when the\n * runtime is created (to the current thread) and practically all entry points\n * into the JS engine check that a runtime (or anything contained in the\n * runtime: context, compartment, object, etc) is only touched by its owner\n * thread. Embeddings may check this invariant outside the JS engine by calling\n * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for\n * non-debug builds).\n *\n * It is possible to \"move\" a runtime between threads. This is accomplished by\n * calling JS_ClearRuntimeThread on a runtime's owner thread and then calling\n * JS_SetRuntimeThread on the new owner thread. The runtime must not be\n * accessed between JS_ClearRuntimeThread and JS_SetRuntimeThread. Also, the\n * caller is responsible for synchronizing the calls to Set/Clear.\n */\n\nextern JS_PUBLIC_API(void)\nJS_AbortIfWrongThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRuntimeThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeThread(JSRuntime *rt);\n\nclass JSAutoSetRuntimeThread\n{\n    JSRuntime *runtime_;\n\n  public:\n    JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime_(runtime) {\n        JS_SetRuntimeThread(runtime_);\n    }\n\n    ~JSAutoSetRuntimeThread() {\n        JS_ClearRuntimeThread(runtime_);\n    }\n};\n\n/************************************************************************/\n\n/*\n * JS_IsConstructing must be called from within a native given the\n * native's original cx and vp arguments. If JS_IsConstructing is true,\n * JS_THIS must not be used; the constructor should construct and return a\n * new object. Otherwise, the native is called as an ordinary function and\n * JS_THIS may be used.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJS_IsConstructing(JSContext *cx, const jsval *vp)\n{\n#ifdef DEBUG\n    JSObject *callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n    if (JS_ObjectIsFunction(cx, callee)) {\n        JSFunction *fun = JS_ValueToFunction(cx, JS_CALLEE(cx, vp));\n        JS_ASSERT(JS_IsConstructor(fun));\n    } else {\n        JS_ASSERT(JS_GetClass(callee)->construct != NULL);\n    }\n#else\n    (void)cx;\n#endif\n\n    return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));\n}\n\n/*\n * A constructor can request that the JS engine create a default new 'this'\n * object of the given class, using the callee to determine parentage and\n * [[Prototype]].\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp);\n\n/************************************************************************/\n\n#ifdef JS_GC_ZEAL\n#define JS_DEFAULT_ZEAL_FREQ 100\n\nextern JS_PUBLIC_API(void)\nJS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency);\n\nextern JS_PUBLIC_API(void)\nJS_ScheduleGC(JSContext *cx, uint32_t count);\n#endif\n\nextern JS_PUBLIC_API(void)\nJS_SetParallelCompilationEnabled(JSContext *cx, bool enabled);\n\ntypedef enum JSCompilerOption {\n    JSCOMPILER_BASELINE_USECOUNT_TRIGGER,\n    JSCOMPILER_ION_USECOUNT_TRIGGER,\n    JSCOMPILER_PJS_ENABLE\n} JSCompilerOption;\n\nextern JS_PUBLIC_API(void)\nJS_SetGlobalCompilerOption(JSContext *cx, JSCompilerOption opt, uint32_t value);\n\n/*\n * Convert a uint32_t index into a jsid.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IndexToId(JSContext *cx, uint32_t index, jsid *id);\n\n/*\n * Convert chars into a jsid.\n *\n * |chars| may not be an index.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp);\n\n/*\n *  Test if the given string is a valid ECMAScript identifier\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);\n\n/*\n * Return the current script and line number of the most currently running\n * frame. Returns true if a scripted frame was found, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno);\n\n\n/*\n * Encode/Decode interpreted scripts and functions to/from memory.\n */\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeScript(JSContext *cx, JSScript *script, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeInterpretedFunction(JSContext *cx, JSObject *funobj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_DecodeScript(JSContext *cx, const void *data, uint32_t length,\n                JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,\n                             JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\nextern JS_PUBLIC_DATA(const HandleId) JSID_VOIDHANDLE;\nextern JS_PUBLIC_DATA(const HandleId) JSID_EMPTYHANDLE;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Import some JS:: names into the js namespace so we can make unqualified\n * references to them.\n */\n\nusing JS::Value;\nusing JS::IsPoisonedValue;\nusing JS::NullValue;\nusing JS::UndefinedValue;\nusing JS::Int32Value;\nusing JS::DoubleValue;\nusing JS::StringValue;\nusing JS::BooleanValue;\nusing JS::ObjectValue;\nusing JS::MagicValue;\nusing JS::NumberValue;\nusing JS::ObjectOrNullValue;\nusing JS::PrivateValue;\nusing JS::PrivateUint32Value;\n\nusing JS::IsPoisonedPtr;\nusing JS::IsPoisonedId;\n\nusing JS::StableCharPtr;\nusing JS::TwoByteChars;\nusing JS::Latin1CharsZ;\n\nusing JS::AutoIdVector;\nusing JS::AutoValueVector;\nusing JS::AutoObjectVector;\nusing JS::AutoFunctionVector;\nusing JS::AutoScriptVector;\nusing JS::AutoIdArray;\n\nusing JS::AutoGCRooter;\nusing JS::AutoArrayRooter;\nusing JS::AutoVectorRooter;\nusing JS::AutoHashMapRooter;\nusing JS::AutoHashSetRooter;\n\nusing JS::CallArgs;\nusing JS::IsAcceptableThis;\nusing JS::NativeImpl;\nusing JS::CallReceiver;\nusing JS::CompileOptions;\nusing JS::CallNonGenericMethod;\n\nusing JS::Rooted;\nusing JS::RootedObject;\nusing JS::RootedModule;\nusing JS::RootedFunction;\nusing JS::RootedScript;\nusing JS::RootedString;\nusing JS::RootedId;\nusing JS::RootedValue;\n\nusing JS::Handle;\nusing JS::HandleObject;\nusing JS::HandleModule;\nusing JS::HandleFunction;\nusing JS::HandleScript;\nusing JS::HandleString;\nusing JS::HandleId;\nusing JS::HandleValue;\n\nusing JS::MutableHandle;\nusing JS::MutableHandleObject;\nusing JS::MutableHandleFunction;\nusing JS::MutableHandleScript;\nusing JS::MutableHandleString;\nusing JS::MutableHandleId;\nusing JS::MutableHandleValue;\n\nusing JS::Zone;\n\n} /* namespace js */\n\n#endif /* jsapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsclass.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclass_h\n#define jsclass_h\n/*\n * A JSClass acts as a vtable for JS objects that allows JSAPI clients to\n * control various aspects of the behavior of an object like property lookup.\n * js::Class is an engine-private extension that allows more control over\n * object behavior and, e.g., allows custom slow layout.\n */\n\n#include \"jsapi.h\"\n#include \"jsprvtd.h\"\n\nnamespace js {\n\nclass PropertyName;\nclass SpecialId;\nclass PropertyId;\n\n// This is equal to JSFunction::class_.  Use it in places where you don't want\n// to #include jsfun.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionClassPtr;\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid);\n\n/*\n * We partition the ways to refer to a property into three: by an index\n * (uint32_t); by a string whose characters do not represent an index\n * (PropertyName, see vm/String.h); and by various special values.\n *\n * Special values are encoded using SpecialId, which is layout-compatible but\n * non-interconvertible with jsid.  A SpecialId is used for JSID_VOID, which\n * does not occur in JS scripts but may be used to indicate the absence of a\n * valid identifier.  In the future, a SpecialId may also be an object used by\n * Harmony-proposed private names.\n */\nclass SpecialId\n{\n    uintptr_t bits_;\n\n    /* Needs access to raw bits. */\n    friend JS_ALWAYS_INLINE jsid SPECIALID_TO_JSID(const SpecialId &sid);\n    friend class PropertyId;\n\n    static const uintptr_t TYPE_VOID = JSID_TYPE_VOID;\n    static const uintptr_t TYPE_OBJECT = JSID_TYPE_OBJECT;\n    static const uintptr_t TYPE_MASK = JSID_TYPE_MASK;\n\n    SpecialId(uintptr_t bits) : bits_(bits) { }\n\n  public:\n    SpecialId() : bits_(TYPE_VOID) { }\n\n    /* Object-valued */\n\n    SpecialId(JSObject &obj)\n      : bits_(uintptr_t(&obj) | TYPE_OBJECT)\n    {\n        JS_ASSERT(&obj != NULL);\n        JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);\n    }\n\n    bool isObject() const {\n        return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT;\n    }\n\n    JSObject *toObject() const {\n        JS_ASSERT(isObject());\n        return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);\n    }\n\n    /* Empty */\n\n    static SpecialId empty() {\n        SpecialId sid(TYPE_OBJECT);\n        JS_ASSERT(sid.isEmpty());\n        return sid;\n    }\n\n    bool isEmpty() const {\n        return bits_ == TYPE_OBJECT;\n    }\n\n    /* Void */\n\n    static SpecialId voidId() {\n        SpecialId sid(TYPE_VOID);\n        JS_ASSERT(sid.isVoid());\n        return sid;\n    }\n\n    bool isVoid() const {\n        return bits_ == TYPE_VOID;\n    }\n};\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid)\n{\n    jsid id;\n    JSID_BITS(id) = sid.bits_;\n    JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());\n    JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));\n    JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE bool\nJSID_IS_SPECIAL(jsid id)\n{\n    return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id);\n}\n\nstatic JS_ALWAYS_INLINE SpecialId\nJSID_TO_SPECIALID(jsid id)\n{\n    JS_ASSERT(JSID_IS_SPECIAL(id));\n    if (JSID_IS_OBJECT(id))\n        return SpecialId(*JSID_TO_OBJECT(id));\n    if (JSID_IS_EMPTY(id))\n        return SpecialId::empty();\n    JS_ASSERT(JSID_IS_VOID(id));\n    return SpecialId::voidId();\n}\n\ntypedef JS::Handle<SpecialId> HandleSpecialId;\n\n/* js::Class operation signatures. */\n\ntypedef JSBool\n(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name,\n                 MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value,\n                 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);\ntypedef JSBool\n(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present);\ntypedef JSBool\n(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);\ntypedef JSBool\n(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);\ntypedef JSBool\n(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);\ntypedef JSBool\n(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);\ntypedef JSBool\n(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);\ntypedef JSBool\n(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded);\ntypedef JSBool\n(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded);\ntypedef JSBool\n(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded);\n\n\ntypedef JSObject *\n(* ObjectOp)(JSContext *cx, HandleObject obj);\ntypedef void\n(* FinalizeOp)(FreeOp *fop, JSObject *obj);\n\n#define JS_CLASS_MEMBERS                                                      \\\n    const char          *name;                                                \\\n    uint32_t            flags;                                                \\\n                                                                              \\\n    /* Mandatory function pointer members. */                                 \\\n    JSPropertyOp        addProperty;                                          \\\n    JSDeletePropertyOp  delProperty;                                          \\\n    JSPropertyOp        getProperty;                                          \\\n    JSStrictPropertyOp  setProperty;                                          \\\n    JSEnumerateOp       enumerate;                                            \\\n    JSResolveOp         resolve;                                              \\\n    JSConvertOp         convert;                                              \\\n                                                                              \\\n    /* Optional members (may be null). */                                     \\\n    FinalizeOp          finalize;                                             \\\n    JSCheckAccessOp     checkAccess;                                          \\\n    JSNative            call;                                                 \\\n    JSHasInstanceOp     hasInstance;                                          \\\n    JSNative            construct;                                            \\\n    JSTraceOp           trace\n\n/*\n * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much\n * we have to pad js::Class to match the size of JSClass.\n */\nstruct ClassSizeMeasurement\n{\n    JS_CLASS_MEMBERS;\n};\n\nstruct ClassExtension\n{\n    JSObjectOp          outerObject;\n    JSObjectOp          innerObject;\n    JSIteratorOp        iteratorObject;\n\n    /*\n     * isWrappedNative is true only if the class is an XPCWrappedNative.\n     * WeakMaps use this to override the wrapper disposal optimization.\n     */\n    bool                isWrappedNative;\n\n    /*\n     * If an object is used as a key in a weakmap, it may be desirable for the\n     * garbage collector to keep that object around longer than it otherwise\n     * would. A common case is when the key is a wrapper around an object in\n     * another compartment, and we want to avoid collecting the wrapper (and\n     * removing the weakmap entry) as long as the wrapped object is alive. In\n     * that case, the wrapped object is returned by the wrapper's\n     * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap\n     * key, it will not be collected (and remain in the weakmap) until the\n     * wrapped object is collected.\n     */\n    JSWeakmapKeyDelegateOp weakmapKeyDelegateOp;\n};\n\n#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,false,NULL}\n\nstruct ObjectOps\n{\n    LookupGenericOp     lookupGeneric;\n    LookupPropOp        lookupProperty;\n    LookupElementOp     lookupElement;\n    LookupSpecialOp     lookupSpecial;\n    DefineGenericOp     defineGeneric;\n    DefinePropOp        defineProperty;\n    DefineElementOp     defineElement;\n    DefineSpecialOp     defineSpecial;\n    GenericIdOp         getGeneric;\n    PropertyIdOp        getProperty;\n    ElementIdOp         getElement;\n    ElementIfPresentOp  getElementIfPresent; /* can be null */\n    SpecialIdOp         getSpecial;\n    StrictGenericIdOp   setGeneric;\n    StrictPropertyIdOp  setProperty;\n    StrictElementIdOp   setElement;\n    StrictSpecialIdOp   setSpecial;\n    GenericAttributesOp getGenericAttributes;\n    PropertyAttributesOp getPropertyAttributes;\n    ElementAttributesOp getElementAttributes;\n    SpecialAttributesOp getSpecialAttributes;\n    GenericAttributesOp setGenericAttributes;\n    PropertyAttributesOp setPropertyAttributes;\n    ElementAttributesOp setElementAttributes;\n    SpecialAttributesOp setSpecialAttributes;\n    DeletePropertyOp    deleteProperty;\n    DeleteElementOp     deleteElement;\n    DeleteSpecialOp     deleteSpecial;\n\n    JSNewEnumerateOp    enumerate;\n    ObjectOp            thisObject;\n};\n\n#define JS_NULL_OBJECT_OPS                                                    \\\n    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \\\n     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,        \\\n     NULL,NULL,NULL}\n\nstruct Class\n{\n    JS_CLASS_MEMBERS;\n    ClassExtension      ext;\n    ObjectOps           ops;\n    uint8_t             pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -\n                            sizeof(ClassExtension) - sizeof(ObjectOps)];\n\n    /* Class is not native and its map is not a scope. */\n    static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;\n\n    bool isNative() const {\n        return !(flags & NON_NATIVE);\n    }\n\n    bool hasPrivate() const {\n        return !!(flags & JSCLASS_HAS_PRIVATE);\n    }\n\n    bool emulatesUndefined() const {\n        return flags & JSCLASS_EMULATES_UNDEFINED;\n    }\n\n    bool isCallable() const {\n        return this == js::FunctionClassPtr || call;\n    }\n\n    static size_t offsetOfFlags() { return offsetof(Class, flags); }\n};\n\nJS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));\nJS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));\nJS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));\nJS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));\nJS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));\nJS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));\nJS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));\nJS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));\nJS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));\nJS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));\nJS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));\nJS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));\n\nstatic JS_ALWAYS_INLINE JSClass *\nJsvalify(Class *c)\n{\n    return (JSClass *)c;\n}\nstatic JS_ALWAYS_INLINE const JSClass *\nJsvalify(const Class *c)\n{\n    return (const JSClass *)c;\n}\n\nstatic JS_ALWAYS_INLINE Class *\nValueify(JSClass *c)\n{\n    return (Class *)c;\n}\nstatic JS_ALWAYS_INLINE const Class *\nValueify(const JSClass *c)\n{\n    return (const Class *)c;\n}\n\n/*\n * Enumeration describing possible values of the [[Class]] internal property\n * value of objects.\n */\nenum ESClassValue {\n    ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean,\n    ESClass_RegExp, ESClass_ArrayBuffer, ESClass_Date\n};\n\n/*\n * Return whether the given object has the given [[Class]] internal property\n * value. Beware, this query says nothing about the js::Class of the JSObject\n * so the caller must not assume anything about obj's representation (e.g., obj\n * may be a proxy).\n */\ninline bool\nObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx);\n\n/* Just a helper that checks v.isObject before calling ObjectClassIs. */\ninline bool\nIsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx);\n\ninline bool\nIsPoisonedSpecialId(js::SpecialId iden)\n{\n    if (iden.isObject())\n        return IsPoisonedPtr(iden.toObject());\n    return false;\n}\n\ntemplate <> struct GCMethods<SpecialId>\n{\n    static SpecialId initial() { return SpecialId(); }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(SpecialId id) { return IsPoisonedSpecialId(id); }\n};\n\n}  /* namespace js */\n\n#endif  /* jsclass_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsclist.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclist_h\n#define jsclist_h\n\n#include \"jstypes.h\"\n\n/*\n** Circular linked list\n*/\ntypedef struct JSCListStr {\n    struct JSCListStr *next;\n    struct JSCListStr *prev;\n} JSCList;\n\n/*\n** Insert element \"_e\" into the list, before \"_l\".\n*/\n#define JS_INSERT_BEFORE(_e,_l)  \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l);       \\\n        (_e)->prev = (_l)->prev; \\\n        (_l)->prev->next = (_e); \\\n        (_l)->prev = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Insert element \"_e\" into the list, after \"_l\".\n*/\n#define JS_INSERT_AFTER(_e,_l)   \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l)->next; \\\n        (_e)->prev = (_l);       \\\n        (_l)->next->prev = (_e); \\\n        (_l)->next = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Return the element following element \"_e\"\n*/\n#define JS_NEXT_LINK(_e)         \\\n        ((_e)->next)\n/*\n** Return the element preceding element \"_e\"\n*/\n#define JS_PREV_LINK(_e)         \\\n        ((_e)->prev)\n\n/*\n** Append an element \"_e\" to the end of the list \"_l\"\n*/\n#define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l)\n\n/*\n** Insert an element \"_e\" at the head of the list \"_l\"\n*/\n#define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l)\n\n/* Return the head/tail of the list */\n#define JS_LIST_HEAD(_l) (_l)->next\n#define JS_LIST_TAIL(_l) (_l)->prev\n\n/*\n** Remove the element \"_e\" from it's circular list.\n*/\n#define JS_REMOVE_LINK(_e)             \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n    JS_END_MACRO\n\n/*\n** Remove the element \"_e\" from it's circular list. Also initializes the\n** linkage.\n*/\n#define JS_REMOVE_AND_INIT_LINK(_e)    \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n        (_e)->next = (_e);             \\\n        (_e)->prev = (_e);             \\\n    JS_END_MACRO\n\n/*\n** Return non-zero if the given circular list \"_l\" is empty, zero if the\n** circular list is not empty\n*/\n#define JS_CLIST_IS_EMPTY(_l) \\\n    ((_l)->next == (_l))\n\n/*\n** Initialize a circular list\n*/\n#define JS_INIT_CLIST(_l)  \\\n    JS_BEGIN_MACRO         \\\n        (_l)->next = (_l); \\\n        (_l)->prev = (_l); \\\n    JS_END_MACRO\n\n#define JS_INIT_STATIC_CLIST(_l) \\\n    {(_l), (_l)}\n\n#endif /* jsclist_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jscpucfg.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jscpucfg_h\n#define jscpucfg_h\n\n#define JS_HAVE_LONG_LONG\n\n#if defined(_WIN64)\n\n# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n#  define JS_BYTES_PER_WORD   8\n#  define JS_BITS_PER_WORD_LOG2   6\n# else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n#  error \"CPU type is unknown\"\n# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n\n#elif defined(_WIN32) || defined(XP_OS2)\n\n# ifdef __WATCOMC__\n#  define HAVE_VA_LIST_AS_ARRAY 1\n# endif\n\n# define IS_LITTLE_ENDIAN 1\n# undef  IS_BIG_ENDIAN\n# define JS_BYTES_PER_WORD   4\n# define JS_BITS_PER_WORD_LOG2   5\n\n#elif defined(__APPLE__)\n# if __LITTLE_ENDIAN__\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n# elif __BIG_ENDIAN__\n#  undef  IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# endif\n\n#elif defined(JS_HAVE_ENDIAN_H)\n# include <endian.h>\n\n# if defined(__BYTE_ORDER)\n#  if __BYTE_ORDER == __LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif __BYTE_ORDER == __BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(__BYTE_ORDER) */\n#  error \"endian.h does not define __BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n/* BSDs */\n#elif defined(JS_HAVE_MACHINE_ENDIAN_H)\n# include <sys/types.h>\n# include <machine/endian.h>\n\n# if defined(_BYTE_ORDER)\n#  if _BYTE_ORDER == _LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif _BYTE_ORDER == _BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(_BYTE_ORDER) */\n#  error \"machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n#elif defined(JS_HAVE_SYS_ISA_DEFS_H)\n# include <sys/isa_defs.h>\n\n# if defined(_BIG_ENDIAN)\n#  undef IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# elif defined(_LITTLE_ENDIAN)\n#  define IS_LITTLE_ENDIAN 1\n#  undef IS_BIG_ENDIAN\n# else /* !defined(_LITTLE_ENDIAN) */\n#  error \"sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness.\"\n# endif\n# if !defined(JS_STACK_GROWTH_DIRECTION)\n#  if defined(_STACK_GROWS_UPWARD)\n#   define JS_STACK_GROWTH_DIRECTION (1)\n#  elif defined(_STACK_GROWS_DOWNWARD)\n#   define JS_STACK_GROWTH_DIRECTION (-1)\n#  endif\n# endif\n\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(_BIG_ENDIAN)\n/* IA64 running HP-UX will have _BIG_ENDIAN defined.\n * IA64 running Linux will have endian.h and be handled above.\n */\n# undef IS_LITTLE_ENDIAN\n# define IS_BIG_ENDIAN 1\n\n#else /* !defined(__sparc) && !defined(__sparc__) && ... */\n# error \"Cannot determine endianness of your platform. Please add support to jscpucfg.h.\"\n#endif\n\n#ifndef JS_STACK_GROWTH_DIRECTION\n# ifdef __hppa\n#  define JS_STACK_GROWTH_DIRECTION (1)\n# else\n#  define JS_STACK_GROWTH_DIRECTION (-1)\n# endif\n#endif\n\n#endif /* jscpucfg_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsdbgapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsdbgapi_h\n#define jsdbgapi_h\n/*\n * JS debugger API.\n */\n\n#include \"jsprvtd.h\"\n\nnamespace JS {\n\nstruct FrameDescription\n{\n    JSScript *script;\n    unsigned lineno;\n    JSFunction *fun;\n};\n\nstruct StackDescription\n{\n    unsigned nframes;\n    FrameDescription *frames;\n};\n\nextern JS_PUBLIC_API(StackDescription *)\nDescribeStack(JSContext *cx, unsigned maxFrames);\n\nextern JS_PUBLIC_API(void)\nFreeStackDescription(JSContext *cx, StackDescription *desc);\n\nextern JS_PUBLIC_API(char *)\nFormatStackDump(JSContext *cx, char *buf,\n                    JSBool showArgs, JSBool showLocals,\n                    JSBool showThisProps);\n\n}\n\n# ifdef DEBUG\nJS_FRIEND_API(void) js_DumpValue(const js::Value &val);\nJS_FRIEND_API(void) js_DumpId(jsid id);\nJS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);\n# endif\n\nJS_FRIEND_API(void)\njs_DumpBacktrace(JSContext *cx);\n\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * Currently, we only support runtime-wide debugging. In the future, we should\n * be able to support compartment-wide debugging.\n */\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);\n\n/*\n * Debug mode is a compartment-wide mode that enables a debugger to attach\n * to and interact with running methodjit-ed frames. In particular, it causes\n * every function to be compiled as if an eval was present (so eval-in-frame)\n * can work, and it ensures that functions can be re-JITed for other debug\n * features. In general, it is not safe to interact with frames that were live\n * before debug mode was enabled. For this reason, it is also not safe to\n * enable debug mode while frames are live.\n */\n\n/* Get current state of debugging mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_GetDebugMode(JSContext *cx);\n\n/*\n * Turn on/off debugging mode for all compartments. This returns false if any code\n * from any of the runtime's compartments is running or on the stack.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a single compartment. This should only be\n * used when no code from this compartment is running or on the stack in any\n * thread.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a context's compartment.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugMode(JSContext *cx, JSBool debug);\n\n/* Turn on single step mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);\n\n/* The closure argument will be marked. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n           JSTrapHandler handler, jsval closure);\n\nextern JS_PUBLIC_API(void)\nJS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n             JSTrapHandler *handlerp, jsval *closurep);\n\nextern JS_PUBLIC_API(void)\nJS_ClearScriptTraps(JSRuntime *rt, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_ClearAllTrapsForCompartment(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                 JSWatchPointHandler handler, JSObject *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                   JSWatchPointHandler *handlerp, JSObject **closurep);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearAllWatchPoints(JSContext *cx);\n\n/************************************************************************/\n\n// Raw JSScript* because this needs to be callable from a signal handler.\nextern JS_PUBLIC_API(unsigned)\nJS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_EndPC(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetLinePCs(JSContext *cx, JSScript *script,\n              unsigned startLine, unsigned maxLines,\n              unsigned* count, unsigned** lines, jsbytecode*** pcs);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);\n\n/*\n * N.B. The mark is in the context temp pool and thus the caller must take care\n * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other\n * call that may use the temp pool.\n */\nextern JS_PUBLIC_API(uintptr_t *)\nJS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);\n\nextern JS_PUBLIC_API(JSAtom *)\nJS_LocalNameToAtom(uintptr_t w);\n\nextern JS_PUBLIC_API(JSString *)\nJS_AtomKey(JSAtom *atom);\n\nextern JS_PUBLIC_API(void)\nJS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_GetFunctionScript(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSNative)\nJS_GetFunctionNative(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptPrincipals(JSScript *script);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptOriginPrincipals(JSScript *script);\n\nJS_PUBLIC_API(JSFunction *)\nJS_GetScriptFunction(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\n/*\n * This is almost JS_GetClass(obj)->name except that certain debug-only\n * proxies are made transparent. In particular, this function turns the class\n * of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject)\n * from \"Proxy\" to \"Call\", \"Block\", \"With\" etc.\n */\nextern JS_PUBLIC_API(const char *)\nJS_GetDebugClassName(JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const char *)\nJS_GetScriptFilename(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetScriptSourceMap(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptLineExtent(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetScriptVersion(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(bool)\nJS_GetScriptIsSelfHosted(JSScript *script);\n\n/************************************************************************/\n\n/*\n * Hook setters for script creation and destruction, see jsprvtd.h for the\n * typedefs.  These macros provide binary compatibility and newer, shorter\n * synonyms.\n */\n#define JS_SetNewScriptHook     JS_SetNewScriptHookProc\n#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc\n\nextern JS_PUBLIC_API(void)\nJS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,\n                        void *callerdata);\n\n/************************************************************************/\n\ntypedef struct JSPropertyDesc {\n    jsval           id;         /* primary id, atomized string, or int */\n    jsval           value;      /* property value */\n    uint8_t         flags;      /* flags, see below */\n    uint8_t         spare;      /* unused */\n    jsval           alias;      /* alias id if JSPD_ALIAS flag */\n} JSPropertyDesc;\n\n#define JSPD_ENUMERATE  0x01    /* visible to for/in loop */\n#define JSPD_READONLY   0x02    /* assignment is error */\n#define JSPD_PERMANENT  0x04    /* property cannot be deleted */\n#define JSPD_ALIAS      0x08    /* property has an alias id */\n#define JSPD_EXCEPTION  0x40    /* exception occurred fetching the property, */\n                                /* value is exception */\n#define JSPD_ERROR      0x80    /* native getter returned JS_FALSE without */\n                                /* throwing an exception */\n\ntypedef struct JSPropertyDescArray {\n    uint32_t        length;     /* number of elements in array */\n    JSPropertyDesc  *array;     /* alloc'd by Get, freed by Put */\n} JSPropertyDescArray;\n\ntypedef struct JSScopeProperty JSScopeProperty;\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);\n\nextern JS_PUBLIC_API(void)\nJS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);\n\n/************************************************************************/\n\n/*\n * JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a\n * StackFrame or baseline JIT frame.\n */\nclass JS_PUBLIC_API(JSAbstractFramePtr)\n{\n    uintptr_t ptr_;\n\n  protected:\n    JSAbstractFramePtr()\n      : ptr_(0)\n    { }\n\n  public:\n    explicit JSAbstractFramePtr(void *raw);\n\n    uintptr_t raw() const { return ptr_; }\n\n    operator bool() const { return !!ptr_; }\n\n    JSObject *scopeChain(JSContext *cx);\n    JSObject *callObject(JSContext *cx);\n\n    JSFunction *maybeFun();\n    JSScript *script();\n\n    bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv);\n\n    bool isDebuggerFrame();\n\n    bool evaluateInStackFrame(JSContext *cx,\n                              const char *bytes, unsigned length,\n                              const char *filename, unsigned lineno,\n                              JS::MutableHandleValue rval);\n\n    bool evaluateUCInStackFrame(JSContext *cx,\n                                const jschar *chars, unsigned length,\n                                const char *filename, unsigned lineno,\n                                JS::MutableHandleValue rval);\n};\n\nclass JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr\n{\n  public:\n    JSNullFramePtr()\n      : JSAbstractFramePtr()\n    {}\n};\n\n/*\n * This class does not work when IonMonkey is active. It's only used by jsd,\n * which can only be used when IonMonkey is disabled.\n *\n * To find the calling script and line number, use JS_DescribeSciptedCaller.\n * To summarize the call stack, use JS::DescribeStack.\n */\nclass JS_PUBLIC_API(JSBrokenFrameIterator)\n{\n    void *data_;\n\n  public:\n    JSBrokenFrameIterator(JSContext *cx);\n    ~JSBrokenFrameIterator();\n\n    bool done() const;\n    JSBrokenFrameIterator& operator++();\n\n    JSAbstractFramePtr abstractFramePtr() const;\n    jsbytecode *pc() const;\n\n    bool isConstructing() const;\n};\n\n/*\n * This hook captures high level script execution and function calls (JS or\n * native).  It is used by JS_SetExecuteHook to hook top level scripts and by\n * JS_SetCallHook to hook function calls.  It will get called twice per script\n * or function call: just before execution begins and just after it finishes.\n * In both cases the 'current' frame is that of the executing code.\n *\n * The 'before' param is JS_TRUE for the hook invocation before the execution\n * and JS_FALSE for the invocation after the code has run.\n *\n * The 'ok' param is significant only on the post execution invocation to\n * signify whether or not the code completed 'normally'.\n *\n * The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook\n * for the 'before'invocation, but is whatever value is returned from that\n * invocation for the 'after' invocation. Thus, the hook implementor *could*\n * allocate a structure in the 'before' invocation and return a pointer to that\n * structure. The pointer would then be handed to the hook for the 'after'\n * invocation. Alternately, the 'before' could just return the same value as\n * in 'closure' to cause the 'after' invocation to be called with the same\n * 'closure' value as the 'before'.\n *\n * Returning NULL in the 'before' hook will cause the 'after' hook *not* to\n * be called.\n */\ntypedef void *\n(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,\n                      JSBool before, JSBool *ok, void *closure);\n\ntypedef JSBool\n(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,\n                     void *closure);\n\ntypedef struct JSDebugHooks {\n    JSInterruptHook     interruptHook;\n    void                *interruptHookData;\n    JSNewScriptHook     newScriptHook;\n    void                *newScriptHookData;\n    JSDestroyScriptHook destroyScriptHook;\n    void                *destroyScriptHookData;\n    JSDebuggerHandler   debuggerHandler;\n    void                *debuggerHandlerData;\n    JSSourceHandler     sourceHandler;\n    void                *sourceHandlerData;\n    JSInterpreterHook   executeHook;\n    void                *executeHookData;\n    JSInterpreterHook   callHook;\n    void                *callHookData;\n    JSThrowHook         throwHook;\n    void                *throwHookData;\n    JSDebugErrorHook    debugErrorHook;\n    void                *debugErrorHookData;\n} JSDebugHooks;\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const JSDebugHooks *)\nJS_GetGlobalDebugHooks(JSRuntime *rt);\n\n/**\n * Add various profiling-related functions as properties of the given object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);\n\n/* Defined in vm/Debugger.cpp. */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineDebuggerObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_DumpBytecode(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentBytecode(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DumpPCCounts(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentPCCounts(JSContext *cx);\n\n/* Call the context debug handler on the topmost scripted frame. */\nextern JS_FRIEND_API(JSBool)\njs_CallContextDebugHandler(JSContext *cx);\n\n#endif /* jsdbgapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsfriendapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsfriendapi_h\n#define jsfriendapi_h\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include \"jsclass.h\"\n#include \"jsprvtd.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n\n/*\n * This macro checks if the stack pointer has exceeded a given limit. If\n * |tolerance| is non-zero, it returns true only if the stack pointer has\n * exceeded the limit by more than |tolerance| bytes.\n */\n#if JS_STACK_GROWTH_DIRECTION > 0\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) < (limit)+(tolerance))\n#else\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) > (limit)-(tolerance))\n#endif\n\n#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)\n\nnamespace JS {\ntemplate <class T>\nclass Heap;\n} /* namespace JS */\n\nextern JS_FRIEND_API(void)\nJS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\nextern JS_FRIEND_API(JSString *)\nJS_GetAnonymousString(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nJS_FindCompilationScope(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSFunction *)\nJS_GetObjectFunction(JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(uint32_t)\nJS_ObjectCountDynamicSlots(JS::HandleObject obj);\n\nextern JS_FRIEND_API(size_t)\nJS_SetProtoCalled(JSContext *cx);\n\nextern JS_FRIEND_API(size_t)\nJS_GetCustomIteratorCount(JSContext *cx);\n\nextern JS_FRIEND_API(JSBool)\nJS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret);\n\n/*\n * Determine whether the given object is backed by a DeadObjectProxy.\n *\n * Such objects hold no other objects (they have no outgoing reference edges)\n * and will throw if you touch them (e.g. by reading/writing a property).\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsDeadWrapper(JSObject *obj);\n\n/*\n * Used by the cycle collector to trace through the shape and all\n * shapes it reaches, marking all non-shape children found in the\n * process. Uses bounded stack space.\n */\nextern JS_FRIEND_API(void)\nJS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape);\n\nenum {\n    JS_TELEMETRY_GC_REASON,\n    JS_TELEMETRY_GC_IS_COMPARTMENTAL,\n    JS_TELEMETRY_GC_MS,\n    JS_TELEMETRY_GC_MAX_PAUSE_MS,\n    JS_TELEMETRY_GC_MARK_MS,\n    JS_TELEMETRY_GC_SWEEP_MS,\n    JS_TELEMETRY_GC_MARK_ROOTS_MS,\n    JS_TELEMETRY_GC_MARK_GRAY_MS,\n    JS_TELEMETRY_GC_SLICE_MS,\n    JS_TELEMETRY_GC_MMU_50,\n    JS_TELEMETRY_GC_RESET,\n    JS_TELEMETRY_GC_INCREMENTAL_DISABLED,\n    JS_TELEMETRY_GC_NON_INCREMENTAL,\n    JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS,\n    JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS\n};\n\ntypedef void\n(* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample);\n\nextern JS_FRIEND_API(void)\nJS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback);\n\nextern JS_FRIEND_API(JSPrincipals *)\nJS_GetCompartmentPrincipals(JSCompartment *compartment);\n\nextern JS_FRIEND_API(void)\nJS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);\n\n/* Safe to call with input obj == NULL. Returns non-NULL iff obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToInnerObject(JSContext *cx, JSObject *obj);\n\n/* Requires obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToOuterObject(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSObject *)\nJS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(JSString *)\nJS_BasicObjectToString(JSContext *cx, JS::HandleObject obj);\n\nextern JS_FRIEND_API(JSBool)\njs_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,\n                          JS::MutableHandleValue vp);\n\nJS_FRIEND_API(void)\njs_ReportOverRecursed(JSContext *maybecx);\n\nJS_FRIEND_API(bool)\njs_ObjectClassIs(JSContext *cx, JS::HandleObject obj, js::ESClassValue classValue);\n\nJS_FRIEND_API(const char *)\njs_ObjectClassName(JSContext *cx, JS::HandleObject obj);\n\nJS_FRIEND_API(bool)\njs_AddObjectRoot(JSRuntime *rt, JSObject **objp);\n\nJS_FRIEND_API(void)\njs_RemoveObjectRoot(JSRuntime *rt, JSObject **objp);\n\n#ifdef DEBUG\n\n/*\n * Routines to print out values during debugging.  These are FRIEND_API to help\n * the debugger find them and to support temporarily hacking js_Dump* calls\n * into other code.\n */\n\nextern JS_FRIEND_API(void)\njs_DumpString(JSString *str);\n\nextern JS_FRIEND_API(void)\njs_DumpAtom(JSAtom *atom);\n\nextern JS_FRIEND_API(void)\njs_DumpObject(JSObject *obj);\n\nextern JS_FRIEND_API(void)\njs_DumpChars(const jschar *s, size_t n);\n#endif\n\nextern JS_FRIEND_API(bool)\nJS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);\n\nextern JS_FRIEND_API(JSBool)\nJS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,\n                  js::MutableHandleValue statep, js::MutableHandleId idp);\n\nstruct JSFunctionSpecWithHelp {\n    const char      *name;\n    JSNative        call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *usage;\n    const char      *help;\n};\n\n#define JS_FN_HELP(name,call,nargs,flags,usage,help)                          \\\n    {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}\n#define JS_FS_HELP_END                                                        \\\n    {NULL, NULL, 0, 0, NULL, NULL}\n\nextern JS_FRIEND_API(bool)\nJS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);\n\ntypedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,\n                               jschar **src, uint32_t *length);\n\nextern JS_FRIEND_API(void)\nJS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);\n\nnamespace js {\n\ninline JSRuntime *\nGetRuntime(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->runtime_;\n}\n\ninline JSCompartment *\nGetContextCompartment(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->compartment_;\n}\n\ninline JS::Zone *\nGetContextZone(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->zone_;\n}\n\nextern JS_FRIEND_API(JS::Zone *)\nGetCompartmentZone(JSCompartment *comp);\n\ntypedef bool\n(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);\n\n /*\n  * Dump the complete object graph of heap-allocated things.\n  * fp is the file for the dump output.\n  */\nextern JS_FRIEND_API(void)\nDumpHeapComplete(JSRuntime *rt, FILE *fp);\n\n#ifdef OLD_GETTER_SETTER_METHODS\nJS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);\nJS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);\n#endif\n\nextern JS_FRIEND_API(bool)\nIsSystemCompartment(JSCompartment *comp);\n\nextern JS_FRIEND_API(bool)\nIsSystemZone(JS::Zone *zone);\n\nextern JS_FRIEND_API(bool)\nIsAtomsCompartment(JSCompartment *comp);\n\n/*\n * Check whether it is OK to assign an undeclared variable with the name\n * |propname| at the current location in script.  It is not an error if there is\n * no current script location, or if that location is not an assignment to an\n * undeclared variable.  Reports an error if one needs to be reported (and,\n * particularly, always reports when it returns false).\n */\nextern JS_FRIEND_API(bool)\nReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname);\n\n/*\n * Returns whether we're in a non-strict property set (in that we're in a\n * non-strict script and the bytecode we're on is a property set).  The return\n * value does NOT indicate any sort of exception was thrown: it's just a\n * boolean.\n */\nextern JS_FRIEND_API(bool)\nIsInNonStrictPropertySet(JSContext *cx);\n\nstruct WeakMapTracer;\n\n/*\n * Weak map tracer callback, called once for every binding of every\n * weak map that was live at the time of the last garbage collection.\n *\n * m will be NULL if the weak map is not contained in a JS Object.\n */\ntypedef void\n(* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m,\n                         void *k, JSGCTraceKind kkind,\n                         void *v, JSGCTraceKind vkind);\n\nstruct WeakMapTracer {\n    JSRuntime            *runtime;\n    WeakMapTraceCallback callback;\n\n    WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb)\n        : runtime(rt), callback(cb) {}\n};\n\nextern JS_FRIEND_API(void)\nTraceWeakMaps(WeakMapTracer *trc);\n\nextern JS_FRIEND_API(bool)\nAreGCGrayBitsValid(JSRuntime *rt);\n\ntypedef void\n(*GCThingCallback)(void *closure, void *gcthing);\n\nextern JS_FRIEND_API(void)\nVisitGrayWrapperTargets(JS::Zone *zone, GCThingCallback callback, void *closure);\n\nextern JS_FRIEND_API(JSObject *)\nGetWeakmapKeyDelegate(JSObject *key);\n\nJS_FRIEND_API(JSGCTraceKind)\nGCThingTraceKind(void *thing);\n\n/*\n * Invoke cellCallback on every gray JS_OBJECT in the given zone.\n */\nextern JS_FRIEND_API(void)\nIterateGrayObjects(JS::Zone *zone, GCThingCallback cellCallback, void *data);\n\n#ifdef JS_HAS_CTYPES\nextern JS_FRIEND_API(size_t)\nSizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj);\n#endif\n\nextern JS_FRIEND_API(JSCompartment *)\nGetAnyCompartmentInZone(JS::Zone *zone);\n\n/*\n * Shadow declarations of JS internal structures, for access by inline access\n * functions below. Do not use these structures in any other way. When adding\n * new fields for access by inline methods, make sure to add static asserts to\n * the original header file to ensure that offsets are consistent.\n */\nnamespace shadow {\n\nstruct TypeObject {\n    Class       *clasp;\n    JSObject    *proto;\n};\n\nstruct BaseShape {\n    js::Class *clasp;\n    JSObject *parent;\n    JSObject *_1;\n    JSCompartment *compartment;\n};\n\nclass Shape {\npublic:\n    shadow::BaseShape *base;\n    jsid              _1;\n    uint32_t          slotInfo;\n\n    static const uint32_t FIXED_SLOTS_SHIFT = 27;\n};\n\nstruct Object {\n    shadow::Shape      *shape;\n    shadow::TypeObject *type;\n    js::Value          *slots;\n    js::Value          *_1;\n\n    size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }\n    Value *fixedSlots() const {\n        return (Value *)(uintptr_t(this) + sizeof(shadow::Object));\n    }\n\n    js::Value &slotRef(size_t slot) const {\n        size_t nfixed = numFixedSlots();\n        if (slot < nfixed)\n            return fixedSlots()[slot];\n        return slots[slot - nfixed];\n    }\n};\n\nstruct Function {\n    Object base;\n    uint16_t nargs;\n    uint16_t flags;\n    /* Used only for natives */\n    Native native;\n    const JSJitInfo *jitinfo;\n    void *_1;\n};\n\nstruct Atom {\n    static const size_t LENGTH_SHIFT = 4;\n    size_t lengthAndFlags;\n    const jschar *chars;\n};\n\n} /* namespace shadow */\n\n// These are equal to |&{Function,Object,OuterWindow}ProxyObject::class_|.  Use\n// them in places where you don't want to #include vm/ProxyObject.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) ObjectProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) OuterWindowProxyClassPtr;\n\n// This is equal to |&JSObject::class_|.  Use it in places where you don't want\n// to #include jsobj.h.\nextern JS_FRIEND_DATA(js::Class* const) ObjectClassPtr;\n\ninline js::Class *\nGetObjectClass(JSObject *obj)\n{\n    return reinterpret_cast<const shadow::Object*>(obj)->type->clasp;\n}\n\ninline JSClass *\nGetObjectJSClass(JSObject *obj)\n{\n    return js::Jsvalify(GetObjectClass(obj));\n}\n\ninline bool\nIsInnerObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.outerObject;\n}\n\ninline bool\nIsOuterObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.innerObject;\n}\n\nJS_FRIEND_API(bool)\nIsFunctionObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsScopeObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsCallObject(JSObject *obj);\n\ninline JSObject *\nGetObjectParent(JSObject *obj)\n{\n    JS_ASSERT(!IsScopeObject(obj));\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->parent;\n}\n\nstatic JS_ALWAYS_INLINE JSCompartment *\nGetObjectCompartment(JSObject *obj)\n{\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->compartment;\n}\n\nJS_FRIEND_API(JSObject *)\nGetObjectParentMaybeScope(JSObject *obj);\n\nJS_FRIEND_API(JSObject *)\nGetGlobalForObjectCrossCompartment(JSObject *obj);\n\n// For legacy consumers only. This whole concept is going away soon.\nJS_FRIEND_API(JSObject *)\nDefaultObjectForContextOrNull(JSContext *cx);\n\nJS_FRIEND_API(void)\nSetDefaultObjectForContext(JSContext *cx, JSObject *obj);\n\nJS_FRIEND_API(void)\nNotifyAnimationActivity(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsOriginalScriptFunction(JSFunction *fun);\n\n/*\n * Return the outermost enclosing function (script) of the scripted caller.\n * This function returns NULL in several cases:\n *  - no script is running on the context\n *  - the caller is in global or eval code\n * In particular, this function will \"stop\" its outermost search at eval() and\n * thus it will really return the outermost enclosing function *since the\n * innermost eval*.\n */\nJS_FRIEND_API(JSScript *)\nGetOutermostEnclosingFunctionOfScriptedCaller(JSContext *cx);\n\nJS_FRIEND_API(JSFunction *)\nDefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                           unsigned nargs, unsigned attrs);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                        JSObject *parent, const char *name);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,\n                            JSObject *parent, jsid id);\n\nJS_FRIEND_API(JSObject *)\nInitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n                      JSClass *clasp, JSNative constructor, unsigned nargs,\n                      const JSPropertySpec *ps, const JSFunctionSpec *fs,\n                      const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\nJS_FRIEND_API(const Value &)\nGetFunctionNativeReserved(JSObject *fun, size_t which);\n\nJS_FRIEND_API(void)\nSetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val);\n\ninline bool\nGetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)\n{\n    js::Class *clasp = GetObjectClass(obj);\n    if (clasp == js::ObjectProxyClassPtr ||\n        clasp == js::OuterWindowProxyClassPtr ||\n        clasp == js::FunctionProxyClassPtr)\n    {\n        return JS_GetPrototype(cx, obj, proto);\n    }\n\n    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);\n    return true;\n}\n\ninline void *\nGetObjectPrivate(JSObject *obj)\n{\n    const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);\n    void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);\n    return *addr;\n}\n\n/*\n * Get a slot that is both reserved for object's clasp *and* is fixed (fits\n * within the maximum capacity for the object's fixed slots).\n */\ninline const Value &\nGetReservedSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\nJS_FRIEND_API(void)\nSetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);\n\ninline void\nSetReservedSlot(JSObject *obj, size_t slot, const Value &value)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);\n    if (sobj->slotRef(slot).isMarkable()\n#ifdef JSGC_GENERATIONAL\n        || value.isMarkable()\n#endif\n       )\n    {\n        SetReservedSlotWithBarrier(obj, slot, value);\n    } else {\n        sobj->slotRef(slot) = value;\n    }\n}\n\nJS_FRIEND_API(uint32_t)\nGetObjectSlotSpan(JSObject *obj);\n\ninline const Value &\nGetObjectSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < GetObjectSlotSpan(obj));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\ninline const jschar *\nGetAtomChars(JSAtom *atom)\n{\n    return reinterpret_cast<shadow::Atom *>(atom)->chars;\n}\n\ninline size_t\nGetAtomLength(JSAtom *atom)\n{\n    using shadow::Atom;\n    return reinterpret_cast<Atom*>(atom)->lengthAndFlags >> Atom::LENGTH_SHIFT;\n}\n\ninline JSLinearString *\nAtomToLinearString(JSAtom *atom)\n{\n    return reinterpret_cast<JSLinearString *>(atom);\n}\n\nstatic inline js::PropertyOp\nCastAsJSPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object);\n}\n\nstatic inline js::StrictPropertyOp\nCastAsJSStrictPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object);\n}\n\nJS_FRIEND_API(bool)\nGetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);\n\nJS_FRIEND_API(bool)\nAppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others);\n\nJS_FRIEND_API(bool)\nGetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);\n\nJS_FRIEND_API(bool)\nStringIsArrayIndex(JSLinearString *str, uint32_t *indexp);\n\nJS_FRIEND_API(void)\nSetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);\n\nJS_FRIEND_API(bool)\nIsObjectInContextCompartment(JSObject *obj, const JSContext *cx);\n\n/*\n * NB: these flag bits are encoded into the bytecode stream in the immediate\n * operand of JSOP_ITER, so don't change them without advancing vm/Xdr.h's\n * XDR_BYTECODE_VERSION.\n */\n#define JSITER_ENUMERATE  0x1   /* for-in compatible hidden default iterator */\n#define JSITER_FOREACH    0x2   /* return [key, value] pair rather than key */\n#define JSITER_KEYVALUE   0x4   /* destructuring for-in wants [key, value] */\n#define JSITER_OWNONLY    0x8   /* iterate over obj's own properties only */\n#define JSITER_HIDDEN     0x10  /* also enumerate non-enumerable properties */\n#define JSITER_FOR_OF     0x20  /* harmony for-of loop */\n\ninline uintptr_t\nGetNativeStackLimit(const JSRuntime *rt)\n{\n    return PerThreadDataFriendFields::getMainThread(rt)->nativeStackLimit;\n}\n\ninline uintptr_t\nGetNativeStackLimit(JSContext *cx)\n{\n    return GetNativeStackLimit(GetRuntime(cx));\n}\n\n/*\n * These macros report a stack overflow and run |onerror| if we are close to\n * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a little\n * extra space so that we can ensure that crucial code is able to run.\n */\n\n#define JS_CHECK_RECURSION(cx, onerror)                              \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), &stackDummy_)) {  \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, sp, onerror)                 \\\n    JS_BEGIN_MACRO                                                              \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), sp)) {            \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_CHROME_RECURSION(cx, onerror)                                  \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE_WITH_TOLERANCE(js::GetNativeStackLimit(cx),    \\\n                                                &stackDummy_,                   \\\n                                                1024 * sizeof(size_t)))         \\\n        {                                                                       \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\nJS_FRIEND_API(void)\nStartPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nStopPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nPurgePCCounts(JSContext *cx);\n\nJS_FRIEND_API(size_t)\nGetPCCountScriptCount(JSContext *cx);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptSummary(JSContext *cx, size_t script);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptContents(JSContext *cx, size_t script);\n\n/*\n * A call stack can be specified to the JS engine such that all JS entry/exits\n * to functions push/pop an entry to/from the specified stack.\n *\n * For more detailed information, see vm/SPSProfiler.h\n */\nclass ProfileEntry\n{\n    /*\n     * All fields are marked volatile to prevent the compiler from re-ordering\n     * instructions. Namely this sequence:\n     *\n     *    entry[size] = ...;\n     *    size++;\n     *\n     * If the size modification were somehow reordered before the stores, then\n     * if a sample were taken it would be examining bogus information.\n     *\n     * A ProfileEntry represents both a C++ profile entry and a JS one. Both use\n     * the string as a description, but JS uses the sp as NULL to indicate that\n     * it is a JS entry. The script_ is then only ever examined for a JS entry,\n     * and the idx is used by both, but with different meanings.\n     */\n    const char * volatile string; // Descriptive string of this entry\n    void * volatile sp;           // Relevant stack pointer for the entry\n    JSScript * volatile script_;  // if js(), non-null script which is running\n    int32_t volatile idx;         // if js(), idx of pc, otherwise line number\n\n  public:\n    /*\n     * All of these methods are marked with the 'volatile' keyword because SPS's\n     * representation of the stack is stored such that all ProfileEntry\n     * instances are volatile. These methods would not be available unless they\n     * were marked as volatile as well\n     */\n\n    bool js() volatile {\n        JS_ASSERT_IF(sp == NULL, script_ != NULL);\n        return sp == NULL;\n    }\n\n    uint32_t line() volatile { JS_ASSERT(!js()); return idx; }\n    JSScript *script() volatile { JS_ASSERT(js()); return script_; }\n    void *stackAddress() volatile { return sp; }\n    const char *label() volatile { return string; }\n\n    void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }\n    void setLabel(const char *aString) volatile { string = aString; }\n    void setStackAddress(void *aSp) volatile { sp = aSp; }\n    void setScript(JSScript *aScript) volatile { script_ = aScript; }\n\n    /* we can't know the layout of JSScript, so look in vm/SPSProfiler.cpp */\n    JS_FRIEND_API(jsbytecode *) pc() volatile;\n    JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile;\n\n    static size_t offsetOfString() { return offsetof(ProfileEntry, string); }\n    static size_t offsetOfStackAddress() { return offsetof(ProfileEntry, sp); }\n    static size_t offsetOfPCIdx() { return offsetof(ProfileEntry, idx); }\n    static size_t offsetOfScript() { return offsetof(ProfileEntry, script_); }\n\n    /*\n     * The index used in the entry can either be a line number or the offset of\n     * a pc into a script's code. To signify a NULL pc, use a -1 index. This is\n     * checked against in pc() and setPC() to set/get the right pc.\n     */\n    static const int32_t NullPCIndex = -1;\n};\n\nJS_FRIEND_API(void)\nSetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,\n                         uint32_t max);\n\nJS_FRIEND_API(void)\nEnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);\n\nJS_FRIEND_API(jsbytecode*)\nProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);\n\n#ifdef JS_THREADSAFE\nJS_FRIEND_API(bool)\nContextHasOutstandingRequests(const JSContext *cx);\n#endif\n\nJS_FRIEND_API(bool)\nHasUnrootedGlobal(const JSContext *cx);\n\ntypedef void\n(* ActivityCallback)(void *arg, JSBool active);\n\n/*\n * Sets a callback that is run whenever the runtime goes idle - the\n * last active request ceases - and begins activity - when it was\n * idle and a request begins.\n */\nJS_FRIEND_API(void)\nSetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg);\n\nextern JS_FRIEND_API(const JSStructuredCloneCallbacks *)\nGetContextStructuredCloneCallbacks(JSContext *cx);\n\nextern JS_FRIEND_API(bool)\nCanCallContextDebugHandler(JSContext *cx);\n\nextern JS_FRIEND_API(JSTrapStatus)\nCallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);\n\nextern JS_FRIEND_API(bool)\nIsContextRunningJS(JSContext *cx);\n\ntypedef void\n(* AnalysisPurgeCallback)(JSRuntime *rt, JS::Handle<JSFlatString*> desc);\n\nextern JS_FRIEND_API(AnalysisPurgeCallback)\nSetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback);\n\ntypedef JSBool\n(* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID,\n                                 uint32_t depth);\nstruct JSDOMCallbacks {\n    DOMInstanceClassMatchesProto instanceClassMatchesProto;\n};\ntypedef struct JSDOMCallbacks DOMCallbacks;\n\nextern JS_FRIEND_API(void)\nSetDOMCallbacks(JSRuntime *rt, const DOMCallbacks *callbacks);\n\nextern JS_FRIEND_API(const DOMCallbacks *)\nGetDOMCallbacks(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nGetTestingFunctions(JSContext *cx);\n\n/*\n * Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not\n * available and the compiler does not know that FreeOp inherits from\n * JSFreeOp.\n */\ninline JSFreeOp *\nCastToJSFreeOp(FreeOp *fop)\n{\n    return reinterpret_cast<JSFreeOp *>(fop);\n}\n\n/* Implemented in jsexn.cpp. */\n\n/*\n * Get an error type name from a JSExnType constant.\n * Returns NULL for invalid arguments and JSEXN_INTERNALERR\n */\nextern JS_FRIEND_API(const jschar*)\nGetErrorTypeName(JSContext* cx, int16_t exnType);\n\n#ifdef DEBUG\nextern JS_FRIEND_API(unsigned)\nGetEnterCompartmentDepth(JSContext* cx);\n#endif\n\n/* Implemented in jswrapper.cpp. */\ntypedef enum NukeReferencesToWindow {\n    NukeWindowReferences,\n    DontNukeWindowReferences\n} NukeReferencesToWindow;\n\n/*\n * These filters are designed to be ephemeral stack classes, and thus don't\n * do any rooting or holding of their members.\n */\nstruct CompartmentFilter {\n    virtual bool match(JSCompartment *c) const = 0;\n};\n\nstruct AllCompartments : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const { return true; }\n};\n\nstruct ContentCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return !IsSystemCompartment(c);\n    }\n};\n\nstruct ChromeCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return IsSystemCompartment(c);\n    }\n};\n\nstruct SingleCompartment : public CompartmentFilter {\n    JSCompartment *ours;\n    SingleCompartment(JSCompartment *c) : ours(c) {}\n    virtual bool match(JSCompartment *c) const { return c == ours; }\n};\n\nstruct CompartmentsWithPrincipals : public CompartmentFilter {\n    JSPrincipals *principals;\n    CompartmentsWithPrincipals(JSPrincipals *p) : principals(p) {}\n    virtual bool match(JSCompartment *c) const {\n        return JS_GetCompartmentPrincipals(c) == principals;\n    }\n};\n\nextern JS_FRIEND_API(JSBool)\nNukeCrossCompartmentWrappers(JSContext* cx,\n                             const CompartmentFilter& sourceFilter,\n                             const CompartmentFilter& targetFilter,\n                             NukeReferencesToWindow nukeReferencesToWindow);\n\n/* Specify information about DOMProxy proxies in the DOM, for use by ICs. */\n\n/*\n * The DOMProxyShadowsCheck function will be called to check if the property for\n * id should be gotten from the prototype, or if there is an own property that\n * shadows it.\n * If DoesntShadow is returned then the slot at listBaseExpandoSlot should\n * either be undefined or point to an expando object that would contain the own\n * property.\n * If DoesntShadowUnique is returned then the slot at listBaseExpandoSlot should\n * contain a private pointer to a ExpandoAndGeneration, which contains a\n * JS::Value that should either be undefined or point to an expando object, and\n * a uint32 value. If that value changes then the IC for getting a property will\n * be invalidated.\n */\n\nstruct ExpandoAndGeneration {\n  ExpandoAndGeneration()\n    : expando(UndefinedValue()),\n      generation(0)\n  {}\n\n  void Unlink()\n  {\n      ++generation;\n      expando.setUndefined();\n  }\n\n  JS::Heap<JS::Value> expando;\n  uint32_t generation;\n};\n\ntypedef enum DOMProxyShadowsResult {\n  ShadowCheckFailed,\n  Shadows,\n  DoesntShadow,\n  DoesntShadowUnique\n} DOMProxyShadowsResult;\ntypedef DOMProxyShadowsResult\n(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);\nJS_FRIEND_API(void)\nSetDOMProxyInformation(void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,\n                       DOMProxyShadowsCheck domProxyShadowsCheck);\n\nvoid *GetDOMProxyHandlerFamily();\nuint32_t GetDOMProxyExpandoSlot();\nDOMProxyShadowsCheck GetDOMProxyShadowsCheck();\n\n} /* namespace js */\n\n/* Implemented in jsdate.cpp. */\n\n/*\n * Detect whether the internal date value is NaN.  (Because failure is\n * out-of-band for js_DateGet*)\n */\nextern JS_FRIEND_API(JSBool)\njs_DateIsValid(JSObject* obj);\n\nextern JS_FRIEND_API(double)\njs_DateGetMsecSinceEpoch(JSObject *obj);\n\n/* Implemented in jscntxt.cpp. */\n\n/*\n * Report an exception, which is currently realized as a printf-style format\n * string and its arguments.\n */\ntypedef enum JSErrNum {\n#define MSG_DEF(name, number, count, exception, format) \\\n    name = number,\n#include \"js.msg\"\n#undef MSG_DEF\n    JSErr_Limit\n} JSErrNum;\n\nextern JS_FRIEND_API(const JSErrorFormatString *)\njs_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);\n\n/* Implemented in jsclone.cpp. */\n\nextern JS_FRIEND_API(uint64_t)\njs_GetSCOffset(JSStructuredCloneWriter* writer);\n\n/* Typed Array functions, implemented in jstypedarray.cpp */\n\nnamespace js {\nnamespace ArrayBufferView {\n\nenum ViewType {\n    TYPE_INT8 = 0,\n    TYPE_UINT8,\n    TYPE_INT16,\n    TYPE_UINT16,\n    TYPE_INT32,\n    TYPE_UINT32,\n    TYPE_FLOAT32,\n    TYPE_FLOAT64,\n\n    /*\n     * Special type that is a uint8_t, but assignments are clamped to [0, 256).\n     * Treat the raw data type as a uint8_t.\n     */\n    TYPE_UINT8_CLAMPED,\n\n    /*\n     * Type returned for a DataView. Note that there is no single element type\n     * in this case.\n     */\n    TYPE_DATAVIEW,\n\n    TYPE_MAX\n};\n\n} /* namespace ArrayBufferView */\n\n/*\n * A helper for building up an ArrayBuffer object's data\n * before creating the ArrayBuffer itself.  Will do doubling\n * based reallocation, up to an optional maximum growth given.\n *\n * When all the data has been appended, call getArrayBuffer,\n * passing in the JSContext* for which the ArrayBuffer object\n * is to be created.  This also implicitly resets the builder,\n * or it can be reset explicitly at any point by calling reset().\n */\nclass ArrayBufferBuilder\n{\n    void *rawcontents_;\n    uint8_t *dataptr_;\n    uint32_t capacity_;\n    uint32_t length_;\n  public:\n    ArrayBufferBuilder()\n        : rawcontents_(NULL),\n          dataptr_(NULL),\n          capacity_(0),\n          length_(0)\n    {\n    }\n\n    ~ArrayBufferBuilder() {\n        reset();\n    }\n\n    void reset() {\n        if (rawcontents_)\n            JS_free(NULL, rawcontents_);\n        rawcontents_ = dataptr_ = NULL;\n        capacity_ = length_ = 0;\n    }\n\n    // will truncate if newcap is < length()\n    bool setCapacity(uint32_t newcap) {\n        if (!JS_ReallocateArrayBufferContents(NULL, newcap, &rawcontents_, &dataptr_))\n            return false;\n\n        capacity_ = newcap;\n        if (length_ > newcap)\n            length_ = newcap;\n\n        return true;\n    }\n\n    // Append datalen bytes from data to the current buffer.  If we\n    // need to grow the buffer, grow by doubling the size up to a\n    // maximum of maxgrowth (if given).  If datalen is greater than\n    // what the new capacity would end up as, then grow by datalen.\n    //\n    // The data parameter must not overlap with anything beyond the\n    // builder's current valid contents [0..length)\n    bool append(const uint8_t *newdata, uint32_t datalen, uint32_t maxgrowth = 0) {\n        if (length_ + datalen > capacity_) {\n            uint32_t newcap;\n            // double while under maxgrowth or if not specified\n            if (!maxgrowth || capacity_ < maxgrowth)\n                newcap = capacity_ * 2;\n            else\n                newcap = capacity_ + maxgrowth;\n\n            // but make sure there's always enough to satisfy our request\n            if (newcap < length_ + datalen)\n                newcap = length_ + datalen;\n\n            // did we overflow?\n            if (newcap < capacity_)\n                return false;\n\n            if (!setCapacity(newcap))\n                return false;\n        }\n\n        // assert that the region isn't overlapping so we can memcpy;\n        JS_ASSERT(!areOverlappingRegions(newdata, datalen, dataptr_ + length_, datalen));\n\n        memcpy(dataptr_ + length_, newdata, datalen);\n        length_ += datalen;\n\n        return true;\n    }\n\n    uint8_t *data() {\n        return dataptr_;\n    }\n\n    uint32_t length() {\n        return length_;\n    }\n\n    uint32_t capacity() {\n        return capacity_;\n    }\n\n    JSObject* getArrayBuffer(JSContext *cx) {\n        // we need to check for length_ == 0, because nothing may have been\n        // added\n        if (capacity_ > length_ || length_ == 0) {\n            if (!setCapacity(length_))\n                return NULL;\n        }\n\n        JSObject* obj = JS_NewArrayBufferWithContents(cx, rawcontents_);\n        if (!obj)\n            return NULL;\n\n        rawcontents_ = dataptr_ = NULL;\n        length_ = capacity_ = 0;\n\n        return obj;\n    }\n\nprotected:\n\n    static bool areOverlappingRegions(const uint8_t *start1, uint32_t length1,\n                                      const uint8_t *start2, uint32_t length2)\n    {\n        const uint8_t *end1 = start1 + length1;\n        const uint8_t *end2 = start2 + length2;\n\n        const uint8_t *max_start = start1 > start2 ? start1 : start2;\n        const uint8_t *min_end   = end1 < end2 ? end1 : end2;\n\n        return max_start < min_end;\n    }\n};\n\n} /* namespace js */\n\ntypedef js::ArrayBufferView::ViewType JSArrayBufferViewType;\n\n/*\n * Create a new typed array with nelements elements.\n *\n * These functions (except the WithBuffer variants) fill in the array with zeros.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64Array(JSContext *cx, uint32_t nelements);\n\n/*\n * Create a new typed array and copy in values from the given object. The\n * object is used as if it were an array; that is, the new array (if\n * successfully created) will have length given by array.length, and its\n * elements will be those specified by array[0], array[1], and so on, after\n * conversion to the typed array element type.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array);\n\n/*\n * Create a new typed array using the given ArrayBuffer for storage.  The\n * length value is optional; if -1 is passed, enough elements to use up the\n * remainder of the byte array is used as the default value.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                          uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                                  uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\n\n/*\n * Create a new ArrayBuffer with the given byte length.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);\n\n/*\n * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return\n * false if a security wrapper is encountered that denies the unwrapping. If\n * this test or one of the JS_Is*Array tests succeeds, then it is safe to call\n * the various accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsTypedArrayObject(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test or one of the more specific tests succeeds, then it\n * is safe to call the various ArrayBufferView accessor JSAPI calls defined\n * below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * Test for specific typed array types (ArrayBufferView subtypes)\n */\n\nextern JS_FRIEND_API(JSBool)\nJS_IsInt8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8ClampedArray(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat64Array(JSObject *obj);\n\n/*\n * Unwrap Typed arrays all at once. Return NULL without throwing if the object\n * cannot be viewed as the correct typed array, or the typed array object on\n * success, filling both outparameters.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt8Array(JSObject *obj, uint32_t *length, int8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8Array(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8ClampedArray(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt16Array(JSObject *obj, uint32_t *length, int16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint16Array(JSObject *obj, uint32_t *length, uint16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt32Array(JSObject *obj, uint32_t *length, int32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint32Array(JSObject *obj, uint32_t *length, uint32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat32Array(JSObject *obj, uint32_t *length, float **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat64Array(JSObject *obj, uint32_t *length, double **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBufferView(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBuffer(JSObject *obj, uint32_t *length, uint8_t **data);\n\n/*\n * Get the type of elements in a typed array, or TYPE_DATAVIEW if a DataView.\n *\n * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is an ArrayBufferView or a\n * wrapper of an ArrayBufferView, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(JSArrayBufferViewType)\nJS_GetArrayBufferViewType(JSObject *obj);\n\n/*\n * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test succeeds, then it is safe to call the various\n * accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferObject(JSObject *obj);\n\n/*\n * Return the available byte length of an array buffer.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferByteLength(JSObject *obj);\n\n/*\n * Return a pointer to an array buffer's data. The buffer is still owned by the\n * array buffer object, and should not be modified on another thread. The\n * returned pointer is stable across GCs.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint8_t *)\nJS_GetArrayBufferData(JSObject *obj);\n\n/*\n * Return the number of elements in a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayLength(JSObject *obj);\n\n/*\n * Return the byte offset from the start of an array buffer to the start of a\n * typed array view.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteLength(JSObject *obj);\n\n/*\n * Check whether obj supports JS_ArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * More generic name for JS_GetTypedArrayByteLength to cover DataViews as well\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the start of the data referenced by a typed array. The\n * data is still owned by the typed array, and should not be modified on\n * another thread.\n *\n * |obj| must have passed a JS_Is*Array test, or somehow be known that it would\n * pass such a test: it is a typed array or a wrapper of a typed array, and the\n * unwrapping will succeed.\n */\n\nextern JS_FRIEND_API(int8_t *)\nJS_GetInt8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ClampedArrayData(JSObject *obj);\nextern JS_FRIEND_API(int16_t *)\nJS_GetInt16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint16_t *)\nJS_GetUint16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(int32_t *)\nJS_GetInt32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint32_t *)\nJS_GetUint32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(float *)\nJS_GetFloat32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(double *)\nJS_GetFloat64ArrayData(JSObject *obj);\n\n/*\n * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific\n * versions when possible.\n */\nextern JS_FRIEND_API(void *)\nJS_GetArrayBufferViewData(JSObject *obj);\n\n/*\n * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been\n * neutered, this will still return the neutered buffer. |obj| must be an\n * object that would return true for JS_IsArrayBufferViewObject().\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetArrayBufferViewBuffer(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetDataView* APIs.\n */\nJS_FRIEND_API(JSBool)\nJS_IsDataViewObject(JSObject *obj);\n\n/*\n * Return the byte offset of a data view into its array buffer. |obj| must be a\n * DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a data view.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the beginning of the data referenced by a DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(void *)\nJS_GetDataViewData(JSObject *obj);\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitGetterOp.\n */\nclass JSJitGetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitGetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args.rval())\n    {}\n\n    explicit JSJitGetterCallArgs(JS::Rooted<JS::Value>* rooted)\n      : JS::MutableHandleValue(rooted)\n    {}\n\n    JS::MutableHandleValue rval() {\n        return *this;\n    }\n};\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitSetterOp.\n */\nclass JSJitSetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitSetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args[0])\n    {}\n\n    JS::MutableHandleValue operator[](unsigned i) {\n        MOZ_ASSERT(i == 0);\n        return *this;\n    }\n\n    unsigned length() const { return 1; }\n\n    // Add get() or maybe hasDefined() as needed\n};\n\nstruct JSJitMethodCallArgsTraits;\n\n/*\n * A class, expected to be passed by reference, which represents the CallArgs\n * for a JSJitMethodOp.\n */\nclass JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUsedRval>\n{\n  private:\n    typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;\n    friend struct JSJitMethodCallArgsTraits;\n\n  public:\n    explicit JSJitMethodCallArgs(const JS::CallArgs& args) {\n        argv_ = args.array();\n        argc_ = args.length();\n    }\n\n    JS::MutableHandleValue rval() const {\n        return Base::rval();\n    }\n\n    unsigned length() const { return Base::length(); }\n\n    JS::MutableHandleValue operator[](unsigned i) const {\n        return Base::operator[](i);\n    }\n\n    bool hasDefined(unsigned i) const {\n        return Base::hasDefined(i);\n    }\n\n    // Add get() as needed\n};\n\nstruct JSJitMethodCallArgsTraits\n{\n    static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);\n    static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);\n};\n\n/*\n * This struct contains metadata passed from the DOM to the JS Engine for JIT\n * optimizations on DOM property accessors. Eventually, this should be made\n * available to general JSAPI users, but we are not currently ready to do so.\n */\ntypedef bool\n(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitGetterCallArgs args);\ntypedef bool\n(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitSetterCallArgs args);\ntypedef bool\n(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, const JSJitMethodCallArgs& args);\n\nstruct JSJitInfo {\n    enum OpType {\n        Getter,\n        Setter,\n        Method,\n        OpType_None\n    };\n\n    union {\n        JSJitGetterOp getter;\n        JSJitSetterOp setter;\n        JSJitMethodOp method;\n    };\n    uint32_t protoID;\n    uint32_t depth;\n    OpType type;\n    bool isInfallible;      /* Is op fallible? False in setters. */\n    bool isConstant;        /* Getting a construction-time constant? */\n    bool isPure;            /* As long as no non-pure DOM things happen, will\n                               keep returning the same value for the given\n                               \"this\" object\" */\n    JSValueType returnType; /* The return type tag.  Might be JSVAL_TYPE_UNKNOWN */\n\n    /* An alternative native that's safe to call in parallel mode. */\n    JSParallelNative parallelNative;\n};\n\n#define JS_JITINFO_NATIVE_PARALLEL(op)                                         \\\n    {{NULL},0,0,JSJitInfo::OpType_None,false,false,false,JSVAL_TYPE_MISSING,op}\n\nstatic JS_ALWAYS_INLINE const JSJitInfo *\nFUNCTION_VALUE_TO_JITINFO(const JS::Value& v)\n{\n    JS_ASSERT(js::GetObjectClass(&v.toObject()) == js::FunctionClassPtr);\n    return reinterpret_cast<js::shadow::Function *>(&v.toObject())->jitinfo;\n}\n\n/* Statically asserted in jsfun.h. */\nstatic const unsigned JS_FUNCTION_INTERPRETED_BIT = 0x1;\n\nstatic JS_ALWAYS_INLINE void\nSET_JITINFO(JSFunction * func, const JSJitInfo *info)\n{\n    js::shadow::Function *fun = reinterpret_cast<js::shadow::Function *>(func);\n    JS_ASSERT(!(fun->flags & JS_FUNCTION_INTERPRETED_BIT));\n    fun->jitinfo = info;\n}\n\n/*\n * Engine-internal extensions of jsid.  This code is here only until we\n * eliminate Gecko's dependencies on it!\n */\n\nstatic JS_ALWAYS_INLINE jsid\nJSID_FROM_BITS(size_t bits)\n{\n    jsid id;\n    JSID_BITS(id) = bits;\n    return id;\n}\n\n/*\n * Must not be used on atoms that are representable as integer jsids.\n * Prefer NameToId or AtomToId over this function:\n *\n * A PropertyName is an atom that does not contain an integer in the range\n * [0, UINT32_MAX]. However, jsid can only hold an integer in the range\n * [0, JSID_INT_MAX] (where JSID_INT_MAX == 2^31-1).  Thus, for the range of\n * integers (JSID_INT_MAX, UINT32_MAX], to represent as a jsid 'id', it must be\n * the case JSID_IS_ATOM(id) and !JSID_TO_ATOM(id)->isPropertyName().  In most\n * cases when creating a jsid, code does not have to care about this corner\n * case because:\n *\n * - When given an arbitrary JSAtom*, AtomToId must be used, which checks for\n *   integer atoms representable as integer jsids, and does this conversion.\n *\n * - When given a PropertyName*, NameToId can be used which which does not need\n *   to do any dynamic checks.\n *\n * Thus, it is only the rare third case which needs this function, which\n * handles any JSAtom* that is known not to be representable with an int jsid.\n */\nstatic JS_ALWAYS_INLINE jsid\nNON_INTEGER_ATOM_TO_JSID(JSAtom *atom)\n{\n    JS_ASSERT(((size_t)atom & 0x7) == 0);\n    jsid id = JSID_FROM_BITS((size_t)atom);\n    JS_ASSERT(id == INTERNED_STRING_TO_JSID(NULL, (JSString*)atom));\n    return id;\n}\n\n/* All strings stored in jsids are atomized, but are not necessarily property names. */\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id)\n{\n    return JSID_IS_STRING(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id, JSAtom *atom)\n{\n    return id == JSID_FROM_BITS((size_t)atom);\n}\n\nstatic JS_ALWAYS_INLINE JSAtom *\nJSID_TO_ATOM(jsid id)\n{\n    return (JSAtom *)JSID_TO_STRING(id);\n}\n\nJS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD);\n\nnamespace js {\n\nstatic JS_ALWAYS_INLINE Value\nIdToValue(jsid id)\n{\n    if (JSID_IS_STRING(id))\n        return StringValue(JSID_TO_STRING(id));\n    if (JS_LIKELY(JSID_IS_INT(id)))\n        return Int32Value(JSID_TO_INT(id));\n    if (JS_LIKELY(JSID_IS_OBJECT(id)))\n        return ObjectValue(*JSID_TO_OBJECT(id));\n    JS_ASSERT(JSID_IS_VOID(id));\n    return UndefinedValue();\n}\n\nstatic JS_ALWAYS_INLINE jsval\nIdToJsval(jsid id)\n{\n    return IdToValue(id);\n}\n\nextern JS_FRIEND_API(bool)\nIsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method);\n\nextern JS_FRIEND_API(bool)\nIsTypedArrayThisCheck(JS::IsAcceptableThis test);\n\nenum CTypesActivityType {\n    CTYPES_CALL_BEGIN,\n    CTYPES_CALL_END,\n    CTYPES_CALLBACK_BEGIN,\n    CTYPES_CALLBACK_END\n};\n\ntypedef void\n(* CTypesActivityCallback)(JSContext *cx, CTypesActivityType type);\n\n/*\n * Sets a callback that is run whenever js-ctypes is about to be used when\n * calling into C.\n */\nJS_FRIEND_API(void)\nSetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);\n\nclass JS_FRIEND_API(AutoCTypesActivityCallback) {\n  private:\n    JSContext *cx;\n    CTypesActivityCallback callback;\n    CTypesActivityType endType;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n  public:\n    AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,\n                               CTypesActivityType endType\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM);\n    ~AutoCTypesActivityCallback() {\n        DoEndCallback();\n    }\n    void DoEndCallback() {\n        if (callback) {\n            callback(cx, endType);\n            callback = NULL;\n        }\n    }\n};\n\n#ifdef DEBUG\nextern JS_FRIEND_API(void)\nassertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);\n#else\ninline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {};\n#endif\n\ntypedef bool\n(* ObjectMetadataCallback)(JSContext *cx, JSObject **pmetadata);\n\n/*\n * Specify a callback to invoke when creating each JS object in the current\n * compartment, which may return a metadata object to associate with the\n * object. Objects with different metadata have different shape hierarchies,\n * so for efficiency, objects should generally try to share metadata objects.\n */\nJS_FRIEND_API(void)\nSetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback);\n\n/* Manipulate the metadata associated with an object. */\n\nJS_FRIEND_API(bool)\nSetObjectMetadata(JSContext *cx, JS::HandleObject obj, JS::HandleObject metadata);\n\nJS_FRIEND_API(JSObject *)\nGetObjectMetadata(JSObject *obj);\n\n/* ES5 8.12.8. */\nextern JS_FRIEND_API(JSBool)\nDefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp);\n\n/*\n * Helper function. To approximate a call to the [[DefineOwnProperty]] internal\n * method described in ES5, first call this, then call JS_DefinePropertyById.\n *\n * JS_DefinePropertyById by itself does not enforce the invariants on\n * non-configurable properties when obj->isNative(). This function performs the\n * relevant checks (specified in ES5 8.12.9 [[DefineOwnProperty]] steps 1-11),\n * but only if obj is native.\n *\n * The reason for the messiness here is that ES5 uses [[DefineOwnProperty]] as\n * a sort of extension point, but there is no hook in js::Class,\n * js::ProxyHandler, or the JSAPI with precisely the right semantics for it.\n */\nextern JS_FRIEND_API(bool)\nCheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSBool)\njs_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,\n                     const js::PropertyDescriptor& descriptor, JSBool *bp);\n\nextern JS_FRIEND_API(JSBool)\njs_ReportIsNotFunction(JSContext *cx, const JS::Value& v);\n\n#ifdef JSGC_GENERATIONAL\nextern JS_FRIEND_API(void)\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data);\n\nextern JS_FRIEND_API(void)\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data);\n#else\ninline void\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data) {}\n\ninline void\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data) {}\n#endif /* JSGC_GENERATIONAL */\n\n#endif /* jsfriendapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jslock.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jslock_h\n#define jslock_h\n\n#ifdef JS_THREADSAFE\n\n# include \"jsapi.h\"\n# include \"pratom.h\"\n# include \"prcvar.h\"\n# include \"prinit.h\"\n# include \"prlock.h\"\n# include \"prthread.h\"\n\n# define JS_ATOMIC_INCREMENT(p)      PR_ATOMIC_INCREMENT((int32_t *)(p))\n# define JS_ATOMIC_DECREMENT(p)      PR_ATOMIC_DECREMENT((int32_t *)(p))\n# define JS_ATOMIC_ADD(p,v)          PR_ATOMIC_ADD((int32_t *)(p), (int32_t)(v))\n# define JS_ATOMIC_SET(p,v)          PR_ATOMIC_SET((int32_t *)(p), (int32_t)(v))\n\nnamespace js {\n    // Defined in jsgc.cpp.\n    unsigned GetCPUCount();\n}\n\n#else  /* JS_THREADSAFE */\n\ntypedef struct PRThread PRThread;\ntypedef struct PRCondVar PRCondVar;\ntypedef struct PRLock PRLock;\n\n# define JS_ATOMIC_INCREMENT(p)      (++*(p))\n# define JS_ATOMIC_DECREMENT(p)      (--*(p))\n# define JS_ATOMIC_ADD(p,v)          (*(p) += (v))\n# define JS_ATOMIC_SET(p,v)          (*(p) = (v))\n\n#endif /* JS_THREADSAFE */\n\n#endif /* jslock_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsperf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef perf_jsperf_h\n#define perf_jsperf_h\n\n#include \"jsapi.h\"\n\nnamespace JS {\n\n/*\n * JS::PerfMeasurement is a generic way to access detailed performance\n * measurement APIs provided by your operating system.  The details of\n * exactly how this works and what can be measured are highly\n * system-specific, but this interface is (one hopes) implementable\n * on top of all of them.\n *\n * To use this API, create a PerfMeasurement object, passing its\n * constructor a bitmask indicating which events you are interested\n * in.  Thereafter, Start() zeroes all counters and starts timing;\n * Stop() stops timing again; and the counters for the events you\n * requested are available as data values after calling Stop().  The\n * object may be reused for many measurements.\n */\nclass JS_FRIEND_API(PerfMeasurement)\n{\n  protected:\n    // Implementation-specific data, if any.\n    void* impl;\n\n  public:\n    /*\n     * Events that may be measured.  Taken directly from the list of\n     * \"generalized hardware performance event types\" in the Linux\n     * perf_event API, plus some of the \"software events\".\n     */\n    enum EventMask {\n        CPU_CYCLES          = 0x00000001,\n        INSTRUCTIONS        = 0x00000002,\n        CACHE_REFERENCES    = 0x00000004,\n        CACHE_MISSES        = 0x00000008,\n        BRANCH_INSTRUCTIONS = 0x00000010,\n        BRANCH_MISSES       = 0x00000020,\n        BUS_CYCLES          = 0x00000040,\n        PAGE_FAULTS         = 0x00000080,\n        MAJOR_PAGE_FAULTS   = 0x00000100,\n        CONTEXT_SWITCHES    = 0x00000200,\n        CPU_MIGRATIONS      = 0x00000400,\n\n        ALL                 = 0x000007ff,\n        NUM_MEASURABLE_EVENTS  = 11\n    };\n\n    /*\n     * Bitmask of events that will be measured when this object is\n     * active (between Start() and Stop()).  This may differ from the\n     * bitmask passed to the constructor if the platform does not\n     * support measuring all of the requested events.\n     */\n    const EventMask eventsMeasured;\n\n    /*\n     * Counters for each measurable event.\n     * Immediately after one of these objects is created, all of the\n     * counters for enabled events will be zero, and all of the\n     * counters for disabled events will be uint64_t(-1).\n     */\n    uint64_t cpu_cycles;\n    uint64_t instructions;\n    uint64_t cache_references;\n    uint64_t cache_misses;\n    uint64_t branch_instructions;\n    uint64_t branch_misses;\n    uint64_t bus_cycles;\n    uint64_t page_faults;\n    uint64_t major_page_faults;\n    uint64_t context_switches;\n    uint64_t cpu_migrations;\n\n    /*\n     * Prepare to measure the indicated set of events.  If not all of\n     * the requested events can be measured on the current platform,\n     * then the eventsMeasured bitmask will only include the subset of\n     * |toMeasure| corresponding to the events that can be measured.\n     */\n    PerfMeasurement(EventMask toMeasure);\n\n    /* Done with this set of measurements, tear down OS-level state. */\n    ~PerfMeasurement();\n\n    /* Start a measurement cycle. */\n    void start();\n\n    /*\n     * End a measurement cycle, and for each enabled counter, add the\n     * number of measured events of that type to the appropriate\n     * visible variable.\n     */\n    void stop();\n\n    /* Reset all enabled counters to zero. */\n    void reset();\n\n    /*\n     * True if this platform supports measuring _something_, i.e. it's\n     * not using the stub implementation.\n     */\n    static bool canMeasureSomething();\n};\n\n/* Inject a Javascript wrapper around the above C++ class into the\n * Javascript object passed as an argument (this will normally be a\n * global object).  The JS-visible API is identical to the C++ API.\n */\nextern JS_FRIEND_API(JSObject*)\n    RegisterPerfMeasurement(JSContext *cx, JSObject *global);\n\n/*\n * Given a jsval which contains an instance of the aforementioned\n * wrapper class, extract the C++ object.  Returns NULL if the\n * jsval is not an instance of the wrapper.\n */\nextern JS_FRIEND_API(PerfMeasurement*)\n    ExtractPerfMeasurement(jsval wrapper);\n\n} // namespace JS\n\n#endif /* perf_jsperf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsprf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprf_h\n#define jsprf_h\n\n/*\n** API for PR printf like routines. Supports the following formats\n**      %d - decimal\n**      %u - unsigned decimal\n**      %x - unsigned hex\n**      %X - unsigned uppercase hex\n**      %o - unsigned octal\n**      %hd, %hu, %hx, %hX, %ho - 16-bit versions of above\n**      %ld, %lu, %lx, %lX, %lo - 32-bit versions of above\n**      %lld, %llu, %llx, %llX, %llo - 64 bit versions of above\n**      %s - ascii string\n**      %hs - ucs2 string\n**      %c - character\n**      %p - pointer (deals with machine dependent pointer size)\n**      %f - float\n**      %g - float\n*/\n\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"jstypes.h\"\n\n/*\n** sprintf into a fixed size buffer. Guarantees that a NUL is at the end\n** of the buffer. Returns the length of the written output, NOT including\n** the NUL, or (uint32_t)-1 if an error occurs.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);\n\n/*\n** sprintf into a malloc'd buffer. Return a pointer to the malloc'd\n** buffer on success, NULL on failure. Call \"JS_smprintf_free\" to release\n** the memory returned.\n*/\nextern JS_PUBLIC_API(char*) JS_smprintf(const char *fmt, ...);\n\n/*\n** Free the memory allocated, for the caller, by JS_smprintf\n*/\nextern JS_PUBLIC_API(void) JS_smprintf_free(char *mem);\n\n/*\n** \"append\" sprintf into a malloc'd buffer. \"last\" is the last value of\n** the malloc'd buffer. sprintf will append data to the end of last,\n** growing it as necessary using realloc. If last is NULL, JS_sprintf_append\n** will allocate the initial string. The return value is the new value of\n** last for subsequent calls, or NULL if there is a malloc failure.\n*/\nextern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...);\n\n/*\n** sprintf into a function. The function \"f\" is called with a string to\n** place into the output. \"arg\" is an opaque pointer used by the stuff\n** function to hold any state needed to do the storage of the output\n** data. The return value is a count of the number of characters fed to\n** the stuff function, or (uint32_t)-1 if an error occurs.\n*/\ntypedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);\n\nextern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);\n\n/*\n** va_list forms of the above.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsmprintf(const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsprintf_append(char *last, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(uint32_t) JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap);\n\n#endif /* jsprf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsprototypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A higher-order macro for enumerating all JSProtoKey values. */\n\n#ifndef jsprototypes_h\n#define jsprototypes_h\n\n#include \"jsversion.h\"\n\n/*\n * Enumerator codes in the second column must not change -- they are part of\n * the JS XDR API.  Also note the symbols in the third column are extern \"C\";\n * clients should use extern \"C\" {} as appropriate when using this macro.\n */\n\n#define JS_FOR_EACH_PROTOTYPE(macro) \\\n    macro(Null,                   0,     js_InitNullClass) \\\n    macro(Object,                 1,     js_InitObjectClass) \\\n    macro(Function,               2,     js_InitFunctionClass) \\\n    macro(Array,                  3,     js_InitArrayClass) \\\n    macro(Boolean,                4,     js_InitBooleanClass) \\\n    macro(JSON,                   5,     js_InitJSONClass) \\\n    macro(Date,                   6,     js_InitDateClass) \\\n    macro(Math,                   7,     js_InitMathClass) \\\n    macro(Number,                 8,     js_InitNumberClass) \\\n    macro(String,                 9,     js_InitStringClass) \\\n    macro(RegExp,                10,     js_InitRegExpClass) \\\n    macro(Error,                 11,     js_InitExceptionClasses) \\\n    macro(InternalError,         12,     js_InitExceptionClasses) \\\n    macro(EvalError,             13,     js_InitExceptionClasses) \\\n    macro(RangeError,            14,     js_InitExceptionClasses) \\\n    macro(ReferenceError,        15,     js_InitExceptionClasses) \\\n    macro(SyntaxError,           16,     js_InitExceptionClasses) \\\n    macro(TypeError,             17,     js_InitExceptionClasses) \\\n    macro(URIError,              18,     js_InitExceptionClasses) \\\n    macro(Iterator,              19,     js_InitIteratorClasses) \\\n    macro(StopIteration,         20,     js_InitIteratorClasses) \\\n    macro(ArrayBuffer,           21,     js_InitTypedArrayClasses) \\\n    macro(Int8Array,             22,     js_InitTypedArrayClasses) \\\n    macro(Uint8Array,            23,     js_InitTypedArrayClasses) \\\n    macro(Int16Array,            24,     js_InitTypedArrayClasses) \\\n    macro(Uint16Array,           25,     js_InitTypedArrayClasses) \\\n    macro(Int32Array,            26,     js_InitTypedArrayClasses) \\\n    macro(Uint32Array,           27,     js_InitTypedArrayClasses) \\\n    macro(Float32Array,          28,     js_InitTypedArrayClasses) \\\n    macro(Float64Array,          29,     js_InitTypedArrayClasses) \\\n    macro(Uint8ClampedArray,     30,     js_InitTypedArrayClasses) \\\n    macro(Proxy,                 31,     js_InitProxyClass) \\\n    macro(WeakMap,               32,     js_InitWeakMapClass) \\\n    macro(Map,                   33,     js_InitMapClass) \\\n    macro(Set,                   34,     js_InitSetClass) \\\n    macro(DataView,              35,     js_InitTypedArrayClasses) \\\n    macro(ParallelArray,         36,     js_InitParallelArrayClass) \\\n    macro(Intl,                  37,     js_InitIntlClass) \\\n    macro(Type,                  38,     js_InitBinaryDataClasses) \\\n    macro(Data,                  39,     js_InitBinaryDataClasses) \\\n    macro(uint8,                 40,     js_InitBinaryDataClasses) \\\n    macro(uint16,                41,     js_InitBinaryDataClasses) \\\n    macro(uint32,                42,     js_InitBinaryDataClasses) \\\n    macro(uint64,                43,     js_InitBinaryDataClasses) \\\n    macro(int8,                  44,     js_InitBinaryDataClasses) \\\n    macro(int16,                 45,     js_InitBinaryDataClasses) \\\n    macro(int32,                 46,     js_InitBinaryDataClasses) \\\n    macro(int64,                 47,     js_InitBinaryDataClasses) \\\n    macro(float32,               48,     js_InitBinaryDataClasses) \\\n    macro(float64,               49,     js_InitBinaryDataClasses) \\\n    macro(ArrayType,             50,     js_InitBinaryDataClasses) \\\n    macro(StructType,            51,     js_InitBinaryDataClasses) \\\n    macro(ArrayTypeObject,       52,     js_InitBinaryDataClasses) \\\n\n#endif /* jsprototypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsproxy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsproxy_h\n#define jsproxy_h\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nnamespace js {\n\nclass JS_FRIEND_API(Wrapper);\n\n/*\n * A proxy is a JSObject that implements generic behavior by providing custom\n * implementations for each object trap. The implementation for each trap is\n * provided by a C++ object stored on the proxy, known as its handler.\n *\n * A major use case for proxies is to forward each trap to another object,\n * known as its target. The target can be an arbitrary C++ object. Not every\n * proxy has the notion of a target, however.\n *\n * Proxy traps are grouped into fundamental and derived traps. Every proxy has\n * to at least provide implementations for the fundamental traps, but the\n * derived traps can be implemented in terms of the fundamental ones\n * BaseProxyHandler provides implementations of the derived traps in terms of\n * the (pure virtual) fundamental traps.\n *\n * To minimize code duplication, a set of abstract proxy handler classes is\n * provided, from which other handlers may inherit. These abstract classes\n * are organized in the following hierarchy:\n *\n * BaseProxyHandler\n * |\n * DirectProxyHandler\n * |\n * Wrapper\n */\n\n/*\n * BaseProxyHandler is the most generic kind of proxy handler. It does not make\n * any assumptions about the target. Consequently, it does not provide any\n * default implementation for the fundamental traps. It does, however, implement\n * the derived traps in terms of the fundamental ones. This allows consumers of\n * this class to define any custom behavior they want.\n */\nclass JS_FRIEND_API(BaseProxyHandler)\n{\n    void *mFamily;\n    bool mHasPrototype;\n    bool mHasPolicy;\n  protected:\n    // Subclasses may set this in their constructor.\n    void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }\n    void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; }\n\n  public:\n    explicit BaseProxyHandler(void *family);\n    virtual ~BaseProxyHandler();\n\n    bool hasPrototype() {\n        return mHasPrototype;\n    }\n\n    bool hasPolicy() {\n        return mHasPolicy;\n    }\n\n    inline void *family() {\n        return mFamily;\n    }\n\n    virtual bool isOuterWindow() {\n        return false;\n    }\n\n    virtual bool finalizeInBackground(Value priv) {\n        /*\n         * Called on creation of a proxy to determine whether its finalize\n         * method can be finalized on the background thread.\n         */\n        return true;\n    }\n\n    /* Policy enforcement traps.\n     *\n     * enter() allows the policy to specify whether the caller may perform |act|\n     * on the proxy's |id| property. In the case when |act| is CALL, |id| is\n     * generally JSID_VOID.\n     *\n     * The |act| parameter to enter() specifies the action being performed.\n     * If |bp| is false, the trap suggests that the caller throw (though it\n     * may still decide to squelch the error).\n     */\n    enum Action {\n        GET,\n        SET,\n        CALL\n    };\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,\n                       bool *bp);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) = 0;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) = 0;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) = 0;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) = 0;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp);\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp);\n    virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) = 0;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    virtual const char *className(JSContext *cx, HandleObject proxy);\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    virtual void finalize(JSFreeOp *fop, JSObject *proxy);\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp, bool *present);\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    /* See comment for weakmapKeyDelegateOp in jsclass.h. */\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/*\n * DirectProxyHandler includes a notion of a target object. All traps are\n * reimplemented such that they forward their behavior to the target. This\n * allows consumers of this class to forward to another object as transparently\n * and efficiently as possible.\n */\nclass JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler\n{\n  public:\n    explicit DirectProxyHandler(void *family);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,\n                         bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy,\n                           AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id,\n                     bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id,\n                        bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject proxy,\n                      AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy,\n                                 RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */\nclass Proxy\n{\n  public:\n    /* ES5 Harmony fundamental proxy traps. */\n    static bool preventExtensions(JSContext *cx, HandleObject proxy);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                      PropertyDescriptor *desc, unsigned flags);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                      MutableHandleValue vp);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                         PropertyDescriptor *desc, unsigned flags);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                         MutableHandleValue vp);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v);\n    static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n\n    /* ES5 Harmony derived proxy traps. */\n    static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    MutableHandleValue vp);\n    static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                                    uint32_t index, MutableHandleValue vp, bool *present);\n    static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    bool strict, MutableHandleValue vp);\n    static bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    static bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible);\n    static bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    static bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    static const char *className(JSContext *cx, HandleObject proxy);\n    static JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    static bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    static bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    static bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static JSObject * const LazyProto;\n};\n\ninline bool IsObjectProxyClass(const Class *clasp)\n{\n    return clasp == js::ObjectProxyClassPtr || clasp == js::OuterWindowProxyClassPtr;\n}\n\ninline bool IsFunctionProxyClass(const Class *clasp)\n{\n    return clasp == js::FunctionProxyClassPtr;\n}\n\ninline bool IsProxyClass(const Class *clasp)\n{\n    return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp);\n}\n\ninline bool IsObjectProxy(JSObject *obj)\n{\n    return IsObjectProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsFunctionProxy(JSObject *obj)\n{\n    return IsFunctionProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsProxy(JSObject *obj)\n{\n    return IsProxyClass(GetObjectClass(obj));\n}\n\n/*\n * These are part of the API.\n *\n * NOTE: PROXY_PRIVATE_SLOT is 0 because that way slot 0 is usable by API\n * clients for both proxy and non-proxy objects.  So an API client that only\n * needs to store one slot's worth of data doesn't need to branch on what sort\n * of object it has.\n */\nconst uint32_t PROXY_PRIVATE_SLOT = 0;\nconst uint32_t PROXY_HANDLER_SLOT = 1;\nconst uint32_t PROXY_EXTRA_SLOT   = 2;\n\ninline BaseProxyHandler *\nGetProxyHandler(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return (BaseProxyHandler *) GetReservedSlot(obj, PROXY_HANDLER_SLOT).toPrivate();\n}\n\ninline const Value &\nGetProxyPrivate(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_PRIVATE_SLOT);\n}\n\ninline JSObject *\nGetProxyTargetObject(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetProxyPrivate(obj).toObjectOrNull();\n}\n\ninline const Value &\nGetProxyExtra(JSObject *obj, size_t n)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_EXTRA_SLOT + n);\n}\n\ninline void\nSetProxyHandler(JSObject *obj, BaseProxyHandler *handler)\n{\n    JS_ASSERT(IsProxy(obj));\n    SetReservedSlot(obj, PROXY_HANDLER_SLOT, PrivateValue(handler));\n}\n\ninline void\nSetProxyExtra(JSObject *obj, size_t n, const Value &extra)\n{\n    JS_ASSERT(IsProxy(obj));\n    JS_ASSERT(n <= 1);\n    SetReservedSlot(obj, PROXY_EXTRA_SLOT + n, extra);\n}\n\nenum ProxyCallable {\n    ProxyNotCallable = false,\n    ProxyIsCallable = true\n};\n\nJS_FRIEND_API(JSObject *)\nNewProxyObject(JSContext *cx, BaseProxyHandler *handler, HandleValue priv,\n               JSObject *proto, JSObject *parent, ProxyCallable callable = ProxyNotCallable);\n\nJSObject *\nRenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv);\n\nclass JS_FRIEND_API(AutoEnterPolicy)\n{\n  public:\n    typedef BaseProxyHandler::Action Action;\n    AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler,\n                    HandleObject wrapper, HandleId id, Action act, bool mayThrow)\n#ifdef DEBUG\n        : context(NULL)\n#endif\n    {\n        allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv)\n                                     : true;\n        recordEnter(cx, wrapper, id);\n        // We want to throw an exception if all of the following are true:\n        // * The policy disallowed access.\n        // * The policy set rv to false, indicating that we should throw.\n        // * The caller did not instruct us to ignore exceptions.\n        // * The policy did not throw itself.\n        if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx))\n            reportError(cx, id);\n    }\n\n    virtual ~AutoEnterPolicy() { recordLeave(); }\n    inline bool allowed() { return allow; }\n    inline bool returnValue() { JS_ASSERT(!allowed()); return rv; }\n\n  protected:\n    // no-op constructor for subclass\n    AutoEnterPolicy()\n#ifdef DEBUG\n        : context(NULL)\n#endif\n        {};\n    void reportError(JSContext *cx, jsid id);\n    bool allow;\n    bool rv;\n\n#ifdef DEBUG\n    JSContext *context;\n    mozilla::Maybe<HandleObject> enteredProxy;\n    mozilla::Maybe<HandleId> enteredId;\n    // NB: We explicitly don't track the entered action here, because sometimes\n    // SET traps do an implicit GET during their implementation, leading to\n    // spurious assertions.\n    AutoEnterPolicy *prev;\n    void recordEnter(JSContext *cx, HandleObject proxy, HandleId id);\n    void recordLeave();\n\n    friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id);\n#else\n    inline void recordEnter(JSContext *cx, JSObject *proxy, jsid id) {}\n    inline void recordLeave() {}\n#endif\n\n};\n\n#ifdef DEBUG\nclass JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {\npublic:\n    AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id)\n    {\n        allow = true;\n        recordEnter(cx, proxy, id);\n    }\n};\n#else\nclass JS_FRIEND_API(AutoWaivePolicy) {\n    public: AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) {};\n};\n#endif\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSObject *)\njs_InitProxyClass(JSContext *cx, JS::HandleObject obj);\n\n#endif /* jsproxy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsprvtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprvtd_h\n#define jsprvtd_h\n/*\n * JS private typename definitions.\n *\n * This header is included only in other .h files, for convenience and for\n * simplicity of type naming.  The alternative for structures is to use tags,\n * which are named the same as their typedef names (legal in C/C++, and less\n * noisy than suffixing the typedef name with \"Struct\" or \"Str\").  Instead,\n * all .h files that include this file may use the same typedef name, whether\n * declaring a pointer to struct type, or defining a member of struct type.\n *\n * A few fundamental scalar types are defined here too.  Neither the scalar\n * nor the struct typedefs should change much, therefore the nearly-global\n * make dependency induced by this file should not prove painful.\n */\n\n#include \"jsapi.h\"\n#include \"jsutil.h\"\n\n#include \"js/HashTable.h\"\n#include \"js/Vector.h\"\n\n/*\n * Convenience constants.\n */\n#define JS_BITS_PER_UINT32_LOG2 5\n#define JS_BITS_PER_UINT32      32\n\n/* The alignment required of objects stored in GC arenas. */\nstatic const unsigned JS_GCTHING_ALIGN = 8;\nstatic const unsigned JS_GCTHING_ZEROBITS = 3;\n\n/* Scalar typedefs. */\ntypedef uint8_t     jsbytecode;\ntypedef uint8_t     jssrcnote;\ntypedef uintptr_t   jsatomid;\n\n/* Struct typedefs. */\ntypedef struct JSGCThing            JSGCThing;\ntypedef struct JSGenerator          JSGenerator;\ntypedef struct JSNativeEnumerator   JSNativeEnumerator;\ntypedef struct JSTryNote            JSTryNote;\n\n/* Friend \"Advanced API\" typedefs. */\ntypedef struct JSAtomState          JSAtomState;\ntypedef struct JSCodeSpec           JSCodeSpec;\ntypedef struct JSPrinter            JSPrinter;\ntypedef struct JSStackHeader        JSStackHeader;\ntypedef struct JSSubString          JSSubString;\ntypedef struct JSSpecializedNative  JSSpecializedNative;\n\n/* String typedefs. */\nclass JSDependentString;\nclass JSExtensibleString;\nclass JSExternalString;\nclass JSLinearString;\nclass JSRope;\nclass JSAtom;\nclass JSWrapper;\n\nnamespace js {\n\nstruct ArgumentsData;\nstruct Class;\n\nclass AutoNameVector;\nclass RegExpGuard;\nclass RegExpObject;\nclass RegExpObjectBuilder;\nclass RegExpShared;\nclass RegExpStatics;\nclass MatchPairs;\nclass PropertyName;\nclass LazyScript;\n\nenum RegExpFlag\n{\n    IgnoreCaseFlag  = 0x01,\n    GlobalFlag      = 0x02,\n    MultilineFlag   = 0x04,\n    StickyFlag      = 0x08,\n\n    NoFlags         = 0x00,\n    AllFlags        = 0x0f\n};\n\nclass StringBuffer;\n\nclass FrameRegs;\nclass StackFrame;\nclass ScriptFrameIter;\n\nclass Proxy;\nclass JS_FRIEND_API(AutoEnterPolicy);\nclass JS_FRIEND_API(BaseProxyHandler);\nclass JS_FRIEND_API(Wrapper);\nclass JS_FRIEND_API(CrossCompartmentWrapper);\n\nclass TempAllocPolicy;\nclass RuntimeAllocPolicy;\n\nclass GlobalObject;\n\ntemplate <typename K,\n          typename V,\n          size_t InlineElems>\nclass InlineMap;\n\nclass LifoAlloc;\n\nclass Shape;\n\nclass Breakpoint;\nclass BreakpointSite;\nclass Debugger;\nclass WatchpointMap;\n\n/*\n * Env is the type of what ES5 calls \"lexical environments\" (runtime\n * activations of lexical scopes). This is currently just JSObject, and is\n * implemented by Call, Block, With, and DeclEnv objects, among others--but\n * environments and objects are really two different concepts.\n */\ntypedef JSObject Env;\n\ntypedef JSNative             Native;\ntypedef JSParallelNative     ParallelNative;\ntypedef JSThreadSafeNative   ThreadSafeNative;\ntypedef JSPropertyOp         PropertyOp;\ntypedef JSStrictPropertyOp   StrictPropertyOp;\ntypedef JSPropertyDescriptor PropertyDescriptor;\n\nstruct SourceCompressionToken;\n\nnamespace frontend {\n\nstruct BytecodeEmitter;\nstruct Definition;\nclass FullParseHandler;\nclass FunctionBox;\nclass ObjectBox;\nstruct Token;\nstruct TokenPos;\nclass TokenStream;\nclass ParseMapPool;\nclass ParseNode;\n\ntemplate <typename ParseHandler>\nclass Parser;\n\n} /* namespace frontend */\n\nnamespace analyze {\n\nstruct LifetimeVariable;\nclass LoopAnalysis;\nclass ScriptAnalysis;\nclass SlotValue;\nclass SSAValue;\nclass SSAUseChain;\n\n} /* namespace analyze */\n\nnamespace types {\n\nclass TypeSet;\nstruct TypeCallsite;\nstruct TypeObject;\nstruct TypeCompartment;\n\n} /* namespace types */\n\ntypedef JS::Handle<Shape*>             HandleShape;\ntypedef JS::Handle<types::TypeObject*> HandleTypeObject;\ntypedef JS::Handle<JSAtom*>            HandleAtom;\ntypedef JS::Handle<PropertyName*>      HandlePropertyName;\n\ntypedef JS::MutableHandle<Shape*>      MutableHandleShape;\ntypedef JS::MutableHandle<JSAtom*>     MutableHandleAtom;\n\ntypedef JS::Rooted<Shape*>             RootedShape;\ntypedef JS::Rooted<types::TypeObject*> RootedTypeObject;\ntypedef JS::Rooted<JSAtom*>            RootedAtom;\ntypedef JS::Rooted<PropertyName*>      RootedPropertyName;\n\nenum XDRMode {\n    XDR_ENCODE,\n    XDR_DECODE\n};\n\ntemplate <XDRMode mode>\nclass XDRState;\n\nclass FreeOp;\n\nstruct IdValuePair\n{\n    jsid id;\n    Value value;\n\n    IdValuePair() {}\n    IdValuePair(jsid idArg)\n      : id(idArg), value(UndefinedValue())\n    {}\n};\n\n} /* namespace js */\n\nnamespace JSC {\n\nclass ExecutableAllocator;\n\n} /* namespace JSC */\n\nnamespace WTF {\n\nclass BumpPointerAllocator;\n\n} /* namespace WTF */\n\n/* \"Friend\" types used by jscntxt.h and jsdbgapi.h. */\ntypedef enum JSTrapStatus {\n    JSTRAP_ERROR,\n    JSTRAP_CONTINUE,\n    JSTRAP_RETURN,\n    JSTRAP_THROW,\n    JSTRAP_LIMIT\n} JSTrapStatus;\n\ntypedef JSTrapStatus\n(* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                  jsval closure);\n\ntypedef JSTrapStatus\n(* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                    void *closure);\n\ntypedef JSTrapStatus\n(* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                      void *closure);\n\ntypedef JSTrapStatus\n(* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                void *closure);\n\ntypedef JSBool\n(* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old,\n                        jsval *newp, void *closure);\n\n/* called just after script creation */\ntypedef void\n(* JSNewScriptHook)(JSContext  *cx,\n                    const char *filename,  /* URL of script */\n                    unsigned   lineno,     /* first line */\n                    JSScript   *script,\n                    JSFunction *fun,\n                    void       *callerdata);\n\n/* called just before script destruction */\ntypedef void\n(* JSDestroyScriptHook)(JSFreeOp *fop,\n                        JSScript *script,\n                        void     *callerdata);\n\ntypedef void\n(* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str,\n                    size_t length, void **listenerTSData, void *closure);\n\n/* js::ObjectOps function pointer typedefs. */\n\n/*\n * A generic type for functions mapping an object to another object, or null\n * if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSObjectOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/* Signature for class initialization ops. */\ntypedef JSObject *\n(* JSClassInitializerOp)(JSContext *cx, JS::HandleObject obj);\n\n/*\n * Hook that creates an iterator object for a given object. Returns the\n * iterator object or null if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, JSBool keysonly);\n\n\n#endif /* jsprvtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jspubtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jspubtd_h\n#define jspubtd_h\n\n/*\n * JS public API typedefs.\n */\n\n#include \"mozilla/PodOperations.h\"\n\n#include \"jsprototypes.h\"\n#include \"jstypes.h\"\n\n#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || defined(DEBUG)\n# define JSGC_TRACK_EXACT_ROOTS\n#endif\n\nnamespace JS {\n\n/*\n * Allow headers to reference JS::Value without #including the whole jsapi.h.\n * Unfortunately, typedefs (hence jsval) cannot be declared.\n */\nclass Value;\n\ntemplate <typename T>\nclass Rooted;\n\nclass JS_PUBLIC_API(AutoGCRooter);\n\nstruct Zone;\n\n} /* namespace JS */\n\n/*\n * In release builds, jsid is defined to be an integral type. This\n * prevents many bugs from being caught at compile time. E.g.:\n *\n *  jsid id = ...\n *  if (id == JS_TRUE)  // error\n *    ...\n *\n *  size_t n = id;      // error\n *\n * To catch more errors, jsid is given a struct type in C++ debug builds.\n * Struct assignment and (in C++) operator== allow correct code to be mostly\n * oblivious to the change. This feature can be explicitly disabled in debug\n * builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES.\n */\n// Needed for cocos2d-js\n#define JS_NO_JSVAL_JSID_STRUCT_TYPES\n# if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)\n#  define JS_USE_JSID_STRUCT_TYPES\n# endif\n\n# ifdef JS_USE_JSID_STRUCT_TYPES\nstruct jsid\n{\n    size_t asBits;\n    bool operator==(jsid rhs) const { return asBits == rhs.asBits; }\n    bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }\n};\n#  define JSID_BITS(id) (id.asBits)\n# else  /* defined(JS_USE_JSID_STRUCT_TYPES) */\ntypedef ptrdiff_t jsid;\n#  define JSID_BITS(id) (id)\n# endif  /* defined(JS_USE_JSID_STRUCT_TYPES) */\n\n#ifdef WIN32\ntypedef wchar_t   jschar;\n#else\ntypedef uint16_t  jschar;\n#endif\n\n/*\n * Run-time version enumeration.  For compile-time version checking, please use\n * the JS_HAS_* macros in jsversion.h, or use MOZJS_MAJOR_VERSION,\n * MOZJS_MINOR_VERSION, MOZJS_PATCH_VERSION, and MOZJS_ALPHA definitions.\n */\ntypedef enum JSVersion {\n    JSVERSION_ECMA_3  = 148,\n    JSVERSION_1_6     = 160,\n    JSVERSION_1_7     = 170,\n    JSVERSION_1_8     = 180,\n    JSVERSION_ECMA_5  = 185,\n    JSVERSION_DEFAULT = 0,\n    JSVERSION_UNKNOWN = -1,\n    JSVERSION_LATEST  = JSVERSION_ECMA_5\n} JSVersion;\n\n/* Result of typeof operator enumeration. */\ntypedef enum JSType {\n    JSTYPE_VOID,                /* undefined */\n    JSTYPE_OBJECT,              /* object */\n    JSTYPE_FUNCTION,            /* function */\n    JSTYPE_STRING,              /* string */\n    JSTYPE_NUMBER,              /* number */\n    JSTYPE_BOOLEAN,             /* boolean */\n    JSTYPE_NULL,                /* null */\n    JSTYPE_LIMIT\n} JSType;\n\n/* Dense index into cached prototypes and class atoms for standard objects. */\ntypedef enum JSProtoKey {\n#define PROTOKEY_AND_INITIALIZER(name,code,init) JSProto_##name = code,\n    JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)\n#undef JS_PROTO\n    JSProto_LIMIT\n} JSProtoKey;\n\n/* js_CheckAccess mode enumeration. */\ntypedef enum JSAccessMode {\n    JSACC_PROTO  = 0,           /* XXXbe redundant w.r.t. id */\n\n                                /*\n                                 * enum value #1 formerly called JSACC_PARENT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n                                /*\n                                 * enum value #2 formerly called JSACC_IMPORT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n    JSACC_WATCH  = 3,           /* a watchpoint on object foo for id 'bar' */\n    JSACC_READ   = 4,           /* a \"get\" of foo.bar */\n    JSACC_WRITE  = 8,           /* a \"set\" of foo.bar = baz */\n    JSACC_LIMIT\n} JSAccessMode;\n\n#define JSACC_TYPEMASK          (JSACC_WRITE - 1)\n\n/*\n * This enum type is used to control the behavior of a JSObject property\n * iterator function that has type JSNewEnumerate.\n */\ntypedef enum JSIterateOp {\n    /* Create new iterator state over enumerable properties. */\n    JSENUMERATE_INIT,\n\n    /* Create new iterator state over all properties. */\n    JSENUMERATE_INIT_ALL,\n\n    /* Iterate once. */\n    JSENUMERATE_NEXT,\n\n    /* Destroy iterator state. */\n    JSENUMERATE_DESTROY\n} JSIterateOp;\n\n/* See JSVAL_TRACE_KIND and JSTraceCallback in jsapi.h. */\ntypedef enum {\n    JSTRACE_OBJECT,\n    JSTRACE_STRING,\n    JSTRACE_SCRIPT,\n\n    /*\n     * Trace kinds internal to the engine. The embedding can only see them if\n     * it implements JSTraceCallback.\n     */\n    JSTRACE_LAZY_SCRIPT,\n    JSTRACE_IONCODE,\n    JSTRACE_SHAPE,\n    JSTRACE_BASE_SHAPE,\n    JSTRACE_TYPE_OBJECT,\n    JSTRACE_LAST = JSTRACE_TYPE_OBJECT\n} JSGCTraceKind;\n\n/* Struct typedefs and class forward declarations. */\ntypedef struct JSClass                      JSClass;\ntypedef struct JSCompartment                JSCompartment;\ntypedef struct JSConstDoubleSpec            JSConstDoubleSpec;\ntypedef struct JSContext                    JSContext;\ntypedef struct JSCrossCompartmentCall       JSCrossCompartmentCall;\ntypedef struct JSErrorReport                JSErrorReport;\ntypedef struct JSExceptionState             JSExceptionState;\ntypedef struct JSFunctionSpec               JSFunctionSpec;\ntypedef struct JSIdArray                    JSIdArray;\ntypedef struct JSLocaleCallbacks            JSLocaleCallbacks;\ntypedef struct JSObjectMap                  JSObjectMap;\ntypedef struct JSPrincipals                 JSPrincipals;\ntypedef struct JSPropertyDescriptor         JSPropertyDescriptor;\ntypedef struct JSPropertyName               JSPropertyName;\ntypedef struct JSPropertySpec               JSPropertySpec;\ntypedef struct JSRuntime                    JSRuntime;\ntypedef struct JSSecurityCallbacks          JSSecurityCallbacks;\ntypedef struct JSStructuredCloneCallbacks   JSStructuredCloneCallbacks;\ntypedef struct JSStructuredCloneReader      JSStructuredCloneReader;\ntypedef struct JSStructuredCloneWriter      JSStructuredCloneWriter;\ntypedef struct JSTracer                     JSTracer;\n\nclass                                       JSFlatString;\nclass                                       JSFunction;\nclass                                       JSObject;\nclass                                       JSScript;\nclass                                       JSStableString;  // long story\nclass                                       JSString;\n\n#ifdef JS_THREADSAFE\ntypedef struct PRCallOnceType    JSCallOnceType;\n#else\ntypedef JSBool                   JSCallOnceType;\n#endif\ntypedef JSBool                 (*JSInitCallback)(void);\n\nnamespace JS {\nnamespace shadow {\n\nstruct Runtime\n{\n    /* Restrict zone access during Minor GC. */\n    bool needsBarrier_;\n\n#ifdef JSGC_GENERATIONAL\n    /* Allow inlining of Nursery::isInside. */\n    uintptr_t gcNurseryStart_;\n    uintptr_t gcNurseryEnd_;\n#endif\n\n    Runtime()\n      : needsBarrier_(false)\n#ifdef JSGC_GENERATIONAL\n      , gcNurseryStart_(0)\n      , gcNurseryEnd_(0)\n#endif\n    {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Parallel operations in general can have one of three states. They may\n * succeed, fail, or \"bail\", where bail indicates that the code encountered an\n * unexpected condition and should be re-run sequentially. Different\n * subcategories of the \"bail\" state are encoded as variants of TP_RETRY_*.\n */\nenum ParallelResult { TP_SUCCESS, TP_RETRY_SEQUENTIALLY, TP_RETRY_AFTER_GC, TP_FATAL };\n\nstruct ThreadSafeContext;\nstruct ForkJoinSlice;\nclass ExclusiveContext;\n\nclass Allocator;\n\nclass SkipRoot;\n\nenum ThingRootKind\n{\n    THING_ROOT_OBJECT,\n    THING_ROOT_SHAPE,\n    THING_ROOT_BASE_SHAPE,\n    THING_ROOT_TYPE_OBJECT,\n    THING_ROOT_STRING,\n    THING_ROOT_ION_CODE,\n    THING_ROOT_SCRIPT,\n    THING_ROOT_ID,\n    THING_ROOT_PROPERTY_ID,\n    THING_ROOT_VALUE,\n    THING_ROOT_TYPE,\n    THING_ROOT_BINDINGS,\n    THING_ROOT_PROPERTY_DESCRIPTOR,\n    THING_ROOT_LIMIT\n};\n\ntemplate <typename T>\nstruct RootKind;\n\n/*\n * Specifically mark the ThingRootKind of externally visible types, so that\n * JSAPI users may use JSRooted... types without having the class definition\n * available.\n */\ntemplate<typename T, ThingRootKind Kind>\nstruct SpecificRootKind\n{\n    static ThingRootKind rootKind() { return Kind; }\n};\n\ntemplate <> struct RootKind<JSObject *> : SpecificRootKind<JSObject *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSFlatString *> : SpecificRootKind<JSFlatString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSFunction *> : SpecificRootKind<JSFunction *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSString *> : SpecificRootKind<JSString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSScript *> : SpecificRootKind<JSScript *, THING_ROOT_SCRIPT> {};\ntemplate <> struct RootKind<jsid> : SpecificRootKind<jsid, THING_ROOT_ID> {};\ntemplate <> struct RootKind<JS::Value> : SpecificRootKind<JS::Value, THING_ROOT_VALUE> {};\n\nstruct ContextFriendFields\n{\n  protected:\n    JSRuntime *const     runtime_;\n\n    /* The current compartment. */\n    JSCompartment       *compartment_;\n\n    /* The current zone. */\n    JS::Zone            *zone_;\n\n  public:\n    explicit ContextFriendFields(JSRuntime *rt)\n      : runtime_(rt), compartment_(NULL), zone_(NULL), autoGCRooters(NULL)\n    {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        mozilla::PodArrayZero(thingGCRooters);\n#endif\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n        skipGCRooters = NULL;\n#endif\n    }\n\n    static const ContextFriendFields *get(const JSContext *cx) {\n        return reinterpret_cast<const ContextFriendFields *>(cx);\n    }\n\n    static ContextFriendFields *get(JSContext *cx) {\n        return reinterpret_cast<ContextFriendFields *>(cx);\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Stack of thread-stack-allocated GC roots. */\n    JS::AutoGCRooter   *autoGCRooters;\n\n    friend JSRuntime *GetRuntime(const JSContext *cx);\n    friend JSCompartment *GetContextCompartment(const JSContext *cx);\n    friend JS::Zone *GetContextZone(const JSContext *cx);\n};\n\nclass PerThreadData;\n\nstruct PerThreadDataFriendFields\n{\n  private:\n    // Note: this type only exists to permit us to derive the offset of\n    // the perThread data within the real JSRuntime* type in a portable\n    // way.\n    struct RuntimeDummy : JS::shadow::Runtime\n    {\n        struct PerThreadDummy {\n            void *field1;\n            uintptr_t field2;\n#ifdef DEBUG\n            uint64_t field3;\n#endif\n        } mainThread;\n    };\n\n  public:\n\n    PerThreadDataFriendFields();\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Limit pointer for checking native stack consumption. */\n    uintptr_t nativeStackLimit;\n\n    static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);\n\n    static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) {\n        return reinterpret_cast<PerThreadDataFriendFields *>(pt);\n    }\n\n    static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<PerThreadDataFriendFields *>(\n            reinterpret_cast<char*>(rt) + RuntimeMainThreadOffset);\n    }\n\n    static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<const PerThreadDataFriendFields *>(\n            reinterpret_cast<const char*>(rt) + RuntimeMainThreadOffset);\n    }\n};\n\n} /* namespace js */\n\n#endif /* jspubtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jstypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n** File:                jstypes.h\n** Description: Definitions of NSPR's basic types\n**\n** Prototypes and macros used to make up for deficiencies in ANSI environments\n** that we have found.\n**\n** Since we do not wrap <stdlib.h> and all the other standard headers, authors\n** of portable code will not know in general that they need these definitions.\n** Instead of requiring these authors to find the dependent uses in their code\n** and take the following steps only in those C files, we take steps once here\n** for all C files.\n**/\n\n#ifndef jstypes_h\n#define jstypes_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js-config.h\"\n\n/***********************************************************************\n** MACROS:      JS_EXTERN_API\n**              JS_EXPORT_API\n** DESCRIPTION:\n**      These are only for externally visible routines and globals.  For\n**      internal routines, just use \"extern\" for type checking and that\n**      will not export internal cross-file or forward-declared symbols.\n**      Define a macro for declaring procedures return types. We use this to\n**      deal with windoze specific type hackery for DLL definitions. Use\n**      JS_EXTERN_API when the prototype for the method is declared. Use\n**      JS_EXPORT_API for the implementation of the method.\n**\n** Example:\n**   in dowhim.h\n**     JS_EXTERN_API( void ) DoWhatIMean( void );\n**   in dowhim.c\n**     JS_EXPORT_API( void ) DoWhatIMean( void ) { return; }\n**\n**\n***********************************************************************/\n\n#define JS_EXTERN_API(type)  extern MOZ_EXPORT type\n#define JS_EXPORT_API(type)  MOZ_EXPORT type\n#define JS_EXPORT_DATA(type) MOZ_EXPORT type\n#define JS_IMPORT_API(type)  MOZ_IMPORT_API type\n#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type\n\n/*\n * The linkage of JS API functions differs depending on whether the file is\n * used within the JS library or not. Any source file within the JS\n * interpreter should define EXPORT_JS_API whereas any client of the library\n * should not. STATIC_JS_API is used to build JS as a static library.\n */\n#if defined(STATIC_JS_API)\n#  define JS_PUBLIC_API(t)   t\n#  define JS_PUBLIC_DATA(t)  t\n#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)\n#  define JS_PUBLIC_API(t)   MOZ_EXPORT t\n#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t\n#else\n#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t\n#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t\n#endif\n\n#define JS_FRIEND_API(t)    JS_PUBLIC_API(t)\n#define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)\n\n#if defined(_MSC_VER) && defined(_M_IX86)\n#define JS_FASTCALL __fastcall\n#elif defined(__GNUC__) && defined(__i386__)\n#define JS_FASTCALL __attribute__((fastcall))\n#else\n#define JS_FASTCALL\n#define JS_NO_FASTCALL\n#endif\n\n#ifndef JS_INLINE\n#define JS_INLINE MOZ_INLINE\n#endif\n\n#ifndef JS_ALWAYS_INLINE\n#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE\n#endif\n\n#ifndef JS_NEVER_INLINE\n#define JS_NEVER_INLINE MOZ_NEVER_INLINE\n#endif\n\n#ifndef JS_WARN_UNUSED_RESULT\n# if defined __GNUC__\n#  define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n# else\n#  define JS_WARN_UNUSED_RESULT\n# endif\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_MACRO\n**              JS_END_MACRO\n** DESCRIPTION:\n**      Macro body brackets so that macros with compound statement definitions\n**      behave syntactically more like functions when called.\n***********************************************************************/\n#define JS_BEGIN_MACRO  do {\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n# define JS_END_MACRO                                                         \\\n    } __pragma(warning(push)) __pragma(warning(disable:4127))                 \\\n    while (0) __pragma(warning(pop))\n#else\n# define JS_END_MACRO   } while (0)\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_EXTERN_C\n**              JS_END_EXTERN_C\n** DESCRIPTION:\n**      Macro shorthands for conditional C++ extern block delimiters.\n***********************************************************************/\n#define JS_BEGIN_EXTERN_C      MOZ_BEGIN_EXTERN_C\n#define JS_END_EXTERN_C        MOZ_END_EXTERN_C\n\n/***********************************************************************\n** MACROS:      JS_BIT\n**              JS_BITMASK\n** DESCRIPTION:\n** Bit masking macros.  XXX n must be <= 31 to be portable\n***********************************************************************/\n#define JS_BIT(n)       ((uint32_t)1 << (n))\n#define JS_BITMASK(n)   (JS_BIT(n) - 1)\n\n/***********************************************************************\n** MACROS:      JS_HOWMANY\n**              JS_ROUNDUP\n**              JS_MIN\n**              JS_MAX\n** DESCRIPTION:\n**      Commonly used macros for operations on compatible types.\n***********************************************************************/\n#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))\n#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))\n\n#include \"jscpucfg.h\"\n\n/*\n * Define JS_64BIT iff we are building in an environment with 64-bit\n * addresses.\n */\n#ifdef _MSC_VER\n# if defined(_M_X64) || defined(_M_AMD64)\n#  define JS_64BIT\n# endif\n#elif defined(__GNUC__)\n/* Additional GCC defines are when running on Solaris, AIX, and HPUX */\n# if defined(__x86_64__) || defined(__sparcv9) || \\\n        defined(__64BIT__) || defined(__LP64__)\n#  define JS_64BIT\n# endif\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */\n# if defined(__x86_64) || defined(__sparcv9)\n#  define JS_64BIT\n# endif\n#elif defined(__xlc__) || defined(__xlC__)        /* IBM XL C/C++ */\n# if defined(__64BIT__)\n#  define JS_64BIT\n# endif\n#elif defined(__HP_cc) || defined(__HP_aCC)       /* HP-UX cc/aCC */\n# if defined(__LP64__)\n#  define JS_64BIT\n# endif\n#else\n# error \"Implement me\"\n#endif\n\n\n/************************************************************************\n** TYPES:       JSBool\n** DESCRIPTION:\n**  Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE\n**      for clarity of target type in assignments and actual arguments. Use\n**      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans\n**      just as you would C int-valued conditions.\n************************************************************************/\ntypedef int JSBool;\n#define JS_TRUE (int)1\n#define JS_FALSE (int)0\n\n/***********************************************************************\n** MACROS:      JS_LIKELY\n**              JS_UNLIKELY\n** DESCRIPTION:\n**      These macros allow you to give a hint to the compiler about branch\n**      probability so that it can better optimize.  Use them like this:\n**\n**      if (JS_LIKELY(v == 1)) {\n**          ... expected code path ...\n**      }\n**\n**      if (JS_UNLIKELY(v == 0)) {\n**          ... non-expected code path ...\n**      }\n**\n***********************************************************************/\n#ifdef __GNUC__\n\n# define JS_LIKELY(x)   (__builtin_expect((x), 1))\n# define JS_UNLIKELY(x) (__builtin_expect((x), 0))\n\n#else\n\n# define JS_LIKELY(x)   (x)\n# define JS_UNLIKELY(x) (x)\n\n#endif\n\n/***********************************************************************\n** MACROS:      JS_ARRAY_LENGTH\n**              JS_ARRAY_END\n** DESCRIPTION:\n**      Macros to get the number of elements and the pointer to one past the\n**      last element of a C array. Use them like this:\n**\n**      jschar buf[10], *s;\n**      JSString *str;\n**      ...\n**      for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;\n**      ...\n**      str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));\n**      ...\n**\n***********************************************************************/\n\n#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])\n#define JS_ARRAY_END(array)    ((array) + JS_ARRAY_LENGTH(array))\n\n#define JS_BITS_PER_BYTE 8\n#define JS_BITS_PER_BYTE_LOG2 3\n\n#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)\n\n/***********************************************************************\n** MACROS:      JS_FUNC_TO_DATA_PTR\n**              JS_DATA_TO_FUNC_PTR\n** DESCRIPTION:\n**      Macros to convert between function and data pointers assuming that\n**      they have the same size. Use them like this:\n**\n**      JSPropertyOp nativeGetter;\n**      JSObject *scriptedGetter;\n**      ...\n**      scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter);\n**      ...\n**      nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter);\n**\n***********************************************************************/\n\n#ifdef __GNUC__\n# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (size_t) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (size_t) (ptr))\n#else\n/* Use an extra (void *) cast for MSVC. */\n# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))\n#endif\n\n#ifdef __GNUC__\n# define JS_EXTENSION __extension__\n# define JS_EXTENSION_(s) __extension__ ({ s; })\n#else\n# define JS_EXTENSION\n# define JS_EXTENSION_(s) s\n#endif\n\n#endif /* jstypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsutil.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * PR assertion checker.\n */\n\n#ifndef jsutil_h\n#define jsutil_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/GuardObjects.h\"\n\n#ifdef USE_ZLIB\n#include <zlib.h>\n#endif\n\n#include \"js/Utility.h\"\n\n/* Forward declarations. */\nstruct JSContext;\n\nstatic JS_ALWAYS_INLINE void *\njs_memcpy(void *dst_, const void *src_, size_t len)\n{\n    char *dst = (char *) dst_;\n    const char *src = (const char *) src_;\n    JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len);\n    JS_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len);\n\n    return memcpy(dst, src, len);\n}\n\nnamespace js {\n\ntemplate <class T>\nstruct AlignmentTestStruct\n{\n    char c;\n    T t;\n};\n\n/* This macro determines the alignment requirements of a type. */\n#define JS_ALIGNMENT_OF(t_) \\\n  (sizeof(js::AlignmentTestStruct<t_>) - sizeof(t_))\n\ntemplate <class T>\nclass AlignedPtrAndFlag\n{\n    uintptr_t bits;\n\n  public:\n    AlignedPtrAndFlag(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(aFlag);\n    }\n\n    T *ptr() const {\n        return (T *)(bits & ~uintptr_t(1));\n    }\n\n    bool flag() const {\n        return (bits & 1) != 0;\n    }\n\n    void setPtr(T *t) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(flag());\n    }\n\n    void setFlag() {\n        bits |= 1;\n    }\n\n    void unsetFlag() {\n        bits &= ~uintptr_t(1);\n    }\n\n    void set(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | aFlag;\n    }\n};\n\ntemplate <class T>\nstatic inline void\nReverse(T *beg, T *end)\n{\n    while (beg != end) {\n        if (--end == beg)\n            return;\n        T tmp = *beg;\n        *beg = *end;\n        *end = tmp;\n        ++beg;\n    }\n}\n\ntemplate <class T>\nstatic inline T *\nFind(T *beg, T *end, const T &v)\n{\n    for (T *p = beg; p != end; ++p) {\n        if (*p == v)\n            return p;\n    }\n    return end;\n}\n\ntemplate <class Container>\nstatic inline typename Container::ElementType *\nFind(Container &c, const typename Container::ElementType &v)\n{\n    return Find(c.begin(), c.end(), v);\n}\n\ntemplate <typename InputIterT, typename CallableT>\nvoid\nForEach(InputIterT begin, InputIterT end, CallableT f)\n{\n    for (; begin != end; ++begin)\n        f(*begin);\n}\n\ntemplate <class T>\nstatic inline T\nMin(T t1, T t2)\n{\n    return t1 < t2 ? t1 : t2;\n}\n\ntemplate <class T>\nstatic inline T\nMax(T t1, T t2)\n{\n    return t1 > t2 ? t1 : t2;\n}\n\n/* Allows a const variable to be initialized after its declaration. */\ntemplate <class T>\nstatic T&\nInitConst(const T &t)\n{\n    return const_cast<T &>(t);\n}\n\ntemplate <class T, class U>\nJS_ALWAYS_INLINE T &\nImplicitCast(U &u)\n{\n    T &t = u;\n    return t;\n}\n\ntemplate<typename T>\nclass AutoScopedAssign\n{\n  public:\n    AutoScopedAssign(T *addr, const T &value\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : addr_(addr), old(*addr_)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        *addr_ = value;\n    }\n\n    ~AutoScopedAssign() { *addr_ = old; }\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n    T *addr_;\n    T old;\n};\n\ntemplate <typename T>\nstatic inline bool\nIsPowerOfTwo(T t)\n{\n    return t && !(t & (t - 1));\n}\n\ntemplate <typename T, typename U>\nstatic inline U\nComputeByteAlignment(T bytes, U alignment)\n{\n    JS_ASSERT(IsPowerOfTwo(alignment));\n    return (alignment - (bytes % alignment)) % alignment;\n}\n\ntemplate <typename T, typename U>\nstatic inline T\nAlignBytes(T bytes, U alignment)\n{\n    return bytes + ComputeByteAlignment(bytes, alignment);\n}\n\nJS_ALWAYS_INLINE static size_t\nUnsignedPtrDiff(const void *bigger, const void *smaller)\n{\n    return size_t(bigger) - size_t(smaller);\n}\n\n/*****************************************************************************/\n\n/* A bit array is an array of bits represented by an array of words (size_t). */\n\nstatic inline unsigned\nNumWordsForBitArrayOfLength(size_t length)\n{\n    return (length + (JS_BITS_PER_WORD - 1)) / JS_BITS_PER_WORD;\n}\n\nstatic inline unsigned\nBitArrayIndexToWordIndex(size_t length, size_t bitIndex)\n{\n    unsigned wordIndex = bitIndex / JS_BITS_PER_WORD;\n    JS_ASSERT(wordIndex < length);\n    return wordIndex;\n}\n\nstatic inline size_t\nBitArrayIndexToWordMask(size_t i)\n{\n    return size_t(1) << (i % JS_BITS_PER_WORD);\n}\n\nstatic inline bool\nIsBitArrayElementSet(size_t *array, size_t length, size_t i)\n{\n    return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i);\n}\n\nstatic inline bool\nIsAnyBitArrayElementSet(size_t *array, size_t length)\n{\n    unsigned numWords = NumWordsForBitArrayOfLength(length);\n    for (unsigned i = 0; i < numWords; ++i) {\n        if (array[i])\n            return true;\n    }\n    return false;\n}\n\nstatic inline void\nSetBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearAllBitArrayElements(size_t *array, size_t length)\n{\n    for (unsigned i = 0; i < length; ++i)\n        array[i] = 0;\n}\n\n#ifdef USE_ZLIB\nclass Compressor\n{\n    /* Number of bytes we should hand to zlib each compressMore() call. */\n    static const size_t CHUNKSIZE = 2048;\n    z_stream zs;\n    const unsigned char *inp;\n    size_t inplen;\n    size_t outbytes;\n\n  public:\n    enum Status {\n        MOREOUTPUT,\n        DONE,\n        CONTINUE,\n        OOM\n    };\n\n    Compressor(const unsigned char *inp, size_t inplen);\n    ~Compressor();\n    bool init();\n    void setOutput(unsigned char *out, size_t outlen);\n    size_t outWritten() const { return outbytes; }\n    /* Compress some of the input. Return true if it should be called again. */\n    Status compressMore();\n};\n\n/*\n * Decompress a string. The caller must know the length of the output and\n * allocate |out| to a string of that length.\n */\nbool DecompressString(const unsigned char *inp, size_t inplen,\n                      unsigned char *out, size_t outlen);\n#endif\n\n}  /* namespace js */\n\n/* Crash diagnostics */\n#ifdef DEBUG\n# define JS_CRASH_DIAGNOSTICS 1\n#endif\n#ifdef JS_CRASH_DIAGNOSTICS\n# define JS_POISON(p, val, size) memset((p), (val), (size))\n#else\n# define JS_POISON(p, val, size) ((void) 0)\n#endif\n\n/* Basic stats */\n#ifdef DEBUG\n# define JS_BASIC_STATS 1\n#endif\n#ifdef JS_BASIC_STATS\n# include <stdio.h>\ntypedef struct JSBasicStats {\n    uint32_t    num;\n    uint32_t    max;\n    double      sum;\n    double      sqsum;\n    uint32_t    logscale;           /* logarithmic scale: 0 (linear), 2, 10 */\n    uint32_t    hist[11];\n} JSBasicStats;\n# define JS_INIT_STATIC_BASIC_STATS  {0,0,0,0,0,{0,0,0,0,0,0,0,0,0,0,0}}\n# define JS_BASIC_STATS_INIT(bs)     memset((bs), 0, sizeof(JSBasicStats))\n# define JS_BASIC_STATS_ACCUM(bs,val)                                         \\\n    JS_BasicStatsAccum(bs, val)\n# define JS_MeanAndStdDevBS(bs,sigma)                                         \\\n    JS_MeanAndStdDev((bs)->num, (bs)->sum, (bs)->sqsum, sigma)\nextern void\nJS_BasicStatsAccum(JSBasicStats *bs, uint32_t val);\nextern double\nJS_MeanAndStdDev(uint32_t num, double sum, double sqsum, double *sigma);\nextern void\nJS_DumpBasicStats(JSBasicStats *bs, const char *title, FILE *fp);\nextern void\nJS_DumpHistogram(JSBasicStats *bs, FILE *fp);\n#else\n# define JS_BASIC_STATS_ACCUM(bs,val)\n#endif\n\n/* A jsbitmap_t is a long integer that can be used for bitmaps. */\ntypedef size_t jsbitmap;\n#define JS_TEST_BIT(_map,_bit)  ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &      \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_SET_BIT(_map,_bit)   ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |=     \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &=     \\\n                                 ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n\n/* Wrapper for various macros to stop warnings coming from their expansions. */\n#if defined(__clang__)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"clang diagnostic push\")                                      \\\n        /* If these _Pragmas cause warnings for you, try disabling ccache. */ \\\n        _Pragma(\"clang diagnostic ignored \\\"-Wunused-value\\\"\")                \\\n        { expr; }                                                             \\\n        _Pragma(\"clang diagnostic pop\")                                       \\\n    JS_END_MACRO\n#elif MOZ_IS_GCC\n\n#if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"GCC diagnostic push\")                                        \\\n        _Pragma(\"GCC diagnostic ignored \\\"-Wunused-but-set-variable\\\"\")       \\\n        expr;                                                                 \\\n        _Pragma(\"GCC diagnostic pop\")                                         \\\n    JS_END_MACRO\n#endif\n#endif\n\n#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        expr;                                                                 \\\n    JS_END_MACRO\n#endif\n\n#endif /* jsutil_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jsversion.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsversion_h\n#define jsversion_h\n\n/*\n * Deprecated JS_VERSION handler.\n */\n#ifdef JS_VERSION\n# if JS_VERSION == 185\n#  warning \"JS_VERSION defined but unsupported (legacy)\"\n# elif JS_VERSION < 185\n#  error \"Unsupported JS_VERSION\"\n# else\n#  error \"Unknown JS_VERSION\"\n# endif\n#endif\n\n/*\n * JS Capability Macros.\n */\n#define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */\n#define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */\n#define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */\n#define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */\n#define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */\n#define JS_HAS_UNEVAL           1       /* has uneval() top-level function */\n#define JS_HAS_CONST            1       /* has JS2 const as alternative var */\n#define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */\n#define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */\n#define JS_HAS_FOR_EACH_IN      1       /* has for each (lhs in iterable) */\n#define JS_HAS_GENERATORS       1       /* has yield in generator function */\n#define JS_HAS_BLOCK_SCOPE      1       /* has block scope via let/arraycomp */\n#define JS_HAS_DESTRUCTURING    2       /* has [a,b] = ... or {p:a,q:b} = ... */\n#define JS_HAS_GENERATOR_EXPRS  1       /* has (expr for (lhs in iterable)) */\n#define JS_HAS_EXPR_CLOSURES    1       /* has function (formals) listexpr */\n\n/* Support for JS_NewGlobalObject. */\n#define JS_HAS_NEW_GLOBAL_OBJECT        1\n\n/* Support for JS_MakeSystemObject. */\n#define JS_HAS_MAKE_SYSTEM_OBJECT       1\n\n/* Feature-test macro for evolving destructuring support. */\n#define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)\n\n/*\n * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support;\n * support likely to be made opt-in at some future time.\n */\n#define OLD_GETTER_SETTER_METHODS       1\n\n/* A kill-switch for bug 586842.  Embedders shouldn't touch this! */\n#define USE_NEW_OBJECT_REPRESENTATION 0\n\n#if USE_NEW_OBJECT_REPRESENTATION\n#  define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0)\n#else\n#  define NEW_OBJECT_REPRESENTATION_ONLY() \\\n     MOZ_ASSUME_UNREACHABLE(\"don't call this!  to be used in the new object representation\")\n#endif\n\n#endif /* jsversion_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/jswrapper.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jswrapper_h\n#define jswrapper_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"jsapi.h\"\n#include \"jsproxy.h\"\n\nnamespace js {\n\nclass DummyFrameGuard;\n\n/*\n * A wrapper is a proxy with a target object to which it generally forwards\n * operations, but may restrict access to certain operations or instrument\n * the trap operations in various ways. A wrapper is distinct from a Direct Proxy\n * Handler in the sense that it can be \"unwrapped\" in C++, exposing the underlying\n * object (Direct Proxy Handlers have an underlying target object, but don't\n * expect to expose this object via any kind of unwrapping operation). Callers\n * should be careful to avoid unwrapping security wrappers in the wrong context.\n */\nclass JS_FRIEND_API(Wrapper) : public DirectProxyHandler\n{\n    unsigned mFlags;\n    bool mSafeToUnwrap;\n\n  public:\n    using BaseProxyHandler::Action;\n\n    enum Flags {\n        CROSS_COMPARTMENT = 1 << 0,\n        LAST_USED_FLAG = CROSS_COMPARTMENT\n    };\n\n    /*\n     * Wrappers can explicitly specify that they are unsafe to unwrap from a\n     * security perspective (as is the case for SecurityWrappers). If a wrapper\n     * is not safe to unwrap, operations requiring full access to the underlying\n     * object (via CheckedUnwrap) will throw. Otherwise, they will succeed.\n     */\n    void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; }\n    bool isSafeToUnwrap() { return mSafeToUnwrap; }\n\n    static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto,\n                         JSObject *parent, Wrapper *handler);\n\n    static JSObject *Renew(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *handler);\n\n    static Wrapper *wrapperHandler(JSObject *wrapper);\n\n    static JSObject *wrappedObject(JSObject *wrapper);\n\n    unsigned flags() const {\n        return mFlags;\n    }\n\n    explicit Wrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~Wrapper();\n\n    static Wrapper singleton;\n    static Wrapper singletonWithPrototype;\n};\n\n/* Base class for all cross compartment wrapper handlers. */\nclass JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper\n{\n  public:\n    CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~CrossCompartmentWrapper();\n\n    virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE;\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived wrapper traps. */\n    virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject wrapper, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject wrapper,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static CrossCompartmentWrapper singleton;\n    static CrossCompartmentWrapper singletonWithPrototype;\n};\n\n/*\n * Base class for security wrappers. A security wrapper is potentially hiding\n * all or part of some wrapped object thus SecurityWrapper defaults to denying\n * access to the wrappee. This is the opposite of Wrapper which tries to be\n * completely transparent.\n *\n * NB: Currently, only a few ProxyHandler operations are overridden to deny\n * access, relying on derived SecurityWrapper to block access when necessary.\n */\ntemplate <class Base>\nclass JS_FRIEND_API(SecurityWrapper) : public Base\n{\n  public:\n    SecurityWrapper(unsigned flags);\n\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act,\n                       bool *bp) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n\n    /*\n     * Allow our subclasses to select the superclass behavior they want without\n     * needing to specify an exact superclass.\n     */\n    typedef Base Permissive;\n    typedef SecurityWrapper<Base> Restrictive;\n};\n\ntypedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;\ntypedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;\n\nclass JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler\n{\n  public:\n    static int sDeadObjectFamily;\n\n    explicit DeadObjectProxy();\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp,\n                                     bool *present) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy,\n                                MutableHandleObject protop) MOZ_OVERRIDE;\n\n    static DeadObjectProxy singleton;\n};\n\nextern JSObject *\nTransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj,\n                         HandleObject wrappedProto, HandleObject parent,\n                         unsigned flags);\n\n// Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by\n// jsfriendapi users.\nextern JS_FRIEND_DATA(int) sWrapperFamily;\n\ninline bool\nIsWrapper(JSObject *obj)\n{\n    return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily;\n}\n\n// Given a JSObject, returns that object stripped of wrappers. If\n// stopAtOuter is true, then this returns the outer window if it was\n// previously wrapped. Otherwise, this returns the first object for\n// which JSObject::isWrapper returns false.\nJS_FRIEND_API(JSObject *)\nUncheckedUnwrap(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = NULL);\n\n// Given a JSObject, returns that object stripped of wrappers. At each stage,\n// the security wrapper has the opportunity to veto the unwrap. Since checked\n// code should never be unwrapping outer window wrappers, we always stop at\n// outer windows.\nJS_FRIEND_API(JSObject *)\nCheckedUnwrap(JSObject *obj, bool stopAtOuter = true);\n\n// Unwrap only the outermost security wrapper, with the same semantics as\n// above. This is the checked version of Wrapper::wrappedObject.\nJS_FRIEND_API(JSObject *)\nUnwrapOneChecked(JSObject *obj, bool stopAtOuter = true);\n\nJS_FRIEND_API(bool)\nIsCrossCompartmentWrapper(JSObject *obj);\n\nbool\nIsDeadProxyObject(JSObject *obj);\n\nJSObject *\nNewDeadProxyObject(JSContext *cx, JSObject *parent);\n\nvoid\nNukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper);\n\nbool\nRemapWrapper(JSContext *cx, JSObject *wobj, JSObject *newTarget);\n\nJS_FRIEND_API(bool)\nRemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget,\n                          JSObject *newTarget);\n\n// API to recompute all cross-compartment wrappers whose source and target\n// match the given filters.\nJS_FRIEND_API(bool)\nRecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,\n                  const CompartmentFilter &targetFilter);\n\n/*\n * This auto class should be used around any code, such as brain transplants,\n * that may touch dead zones. Brain transplants can cause problems\n * because they operate on all compartments, whether live or dead. A brain\n * transplant can cause a formerly dead object to be \"reanimated\" by causing a\n * read or write barrier to be invoked on it during the transplant. In this way,\n * a zone becomes a zombie, kept alive by repeatedly consuming\n * (transplanted) brains.\n *\n * To work around this issue, we observe when mark bits are set on objects in\n * dead zones. If this happens during a brain transplant, we do a full,\n * non-incremental GC at the end of the brain transplant. This will clean up any\n * objects that were improperly marked.\n */\nstruct JS_FRIEND_API(AutoMaybeTouchDeadZones)\n{\n    // The version that takes an object just uses it for its runtime.\n    AutoMaybeTouchDeadZones(JSContext *cx);\n    AutoMaybeTouchDeadZones(JSObject *obj);\n    ~AutoMaybeTouchDeadZones();\n\n  private:\n    JSRuntime *runtime;\n    unsigned markCount;\n    bool inIncremental;\n    bool manipulatingDeadZones;\n};\n\n} /* namespace js */\n\n#endif /* jswrapper_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/AllocPolicy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * An allocation policy concept, usable for structures and algorithms to\n * control how memory is allocated and how failures are handled.\n */\n\n#ifndef mozilla_AllocPolicy_h\n#define mozilla_AllocPolicy_h\n\n#include <stddef.h>\n#include <stdlib.h>\n\nnamespace mozilla {\n\n/*\n * Allocation policies are used to implement the standard allocation behaviors\n * in a customizable way.  Additionally, custom behaviors may be added to these\n * behaviors, such as additionally reporting an error through an out-of-band\n * mechanism when OOM occurs.  The concept modeled here is as follows:\n *\n *  - public copy constructor, assignment, destructor\n *  - void* malloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* calloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* realloc_(void*, size_t, size_t)\n *      Responsible for OOM reporting when null is returned.  The *used* bytes\n *      of the previous buffer is passed in (rather than the old allocation\n *      size), in addition to the *new* allocation size requested.\n *  - void free_(void*)\n *  - void reportAllocOverflow() const\n *      Called on allocation overflow (that is, an allocation implicitly tried\n *      to allocate more than the available memory space -- think allocating an\n *      array of large-size objects, where N * size overflows) before null is\n *      returned.\n *\n * mfbt provides (and typically uses by default) only MallocAllocPolicy, which\n * does nothing more than delegate to the malloc/alloc/free functions.\n */\n\n/*\n * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no\n * extra behaviors.\n */\nclass MallocAllocPolicy\n{\n  public:\n    void* malloc_(size_t bytes) { return malloc(bytes); }\n    void* calloc_(size_t bytes) { return calloc(bytes, 1); }\n    void* realloc_(void* p, size_t oldBytes, size_t bytes) { return realloc(p, bytes); }\n    void free_(void* p) { free(p); }\n    void reportAllocOverflow() const {}\n};\n\n\n} // namespace mozilla\n\n#endif /* mozilla_AllocPolicy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Array.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A compile-time constant-length array with bounds-checking assertions. */\n\n#ifndef mozilla_Array_h\n#define mozilla_Array_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\ntemplate<typename T, size_t Length>\nclass Array\n{\n    T arr[Length];\n\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n};\n\ntemplate<typename T>\nclass Array<T, 0>\n{\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_Array_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Assertions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of runtime and static assertion macros for C and C++. */\n\n#ifndef mozilla_Assertions_h\n#define mozilla_Assertions_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Likely.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef WIN32\n   /*\n    * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which\n    * further depends on <windef.h>.  We hardcode these few definitions manually\n    * because those headers clutter the global namespace with a significant\n    * number of undesired macros and symbols.\n    */\n#  ifdef __cplusplus\n   extern \"C\" {\n#  endif\n   __declspec(dllimport) int __stdcall\n   TerminateProcess(void* hProcess, unsigned int uExitCode);\n   __declspec(dllimport) void* __stdcall GetCurrentProcess(void);\n#  ifdef __cplusplus\n   }\n#  endif\n#else\n#  include <signal.h>\n#endif\n#ifdef ANDROID\n#  include <android/log.h>\n#endif\n\n/*\n * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.\n * In C++11, static_assert is provided by the compiler to the same effect.\n * This can be useful when you make certain assumptions about what must hold for\n * optimal, or even correct, behavior.  For example, you might assert that the\n * size of a struct is a multiple of the target architecture's word size:\n *\n *   struct S { ... };\n *   // C\n *   MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,\n *                     \"S should be a multiple of word size for efficiency\");\n *   // C++11\n *   static_assert(sizeof(S) % sizeof(size_t) == 0,\n *                 \"S should be a multiple of word size for efficiency\");\n *\n * This macro can be used in any location where both an extern declaration and a\n * typedef could be used.\n */\n#ifndef __cplusplus\n   /*\n    * Some of the definitions below create an otherwise-unused typedef.  This\n    * triggers compiler warnings with some versions of gcc, so mark the typedefs\n    * as permissibly-unused to disable the warnings.\n    */\n#  if defined(__GNUC__)\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))\n#  else\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */\n#  endif\n#  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y\n#  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)\n#  if defined(__SUNPRO_CC)\n     /*\n      * The Sun Studio C++ compiler is buggy when declaring, inside a function,\n      * another extern'd function with an array argument whose length contains a\n      * sizeof, triggering the error message \"sizeof expression not accepted as\n      * size of array parameter\".  This bug (6688515, not public yet) would hit\n      * defining moz_static_assert as a function, so we always define an extern\n      * array for Sun Studio.\n      *\n      * We include the line number in the symbol name in a best-effort attempt\n      * to avoid conflicts (see below).\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond) ? 1 : -1]\n#  elif defined(__COUNTER__)\n     /*\n      * If there was no preferred alternative, use a compiler-agnostic version.\n      *\n      * Note that the non-__COUNTER__ version has a bug in C++: it can't be used\n      * in both |extern \"C\"| and normal C++ in the same translation unit.  (Alas\n      * |extern \"C\"| isn't allowed in a function.)  The only affected compiler\n      * we really care about is gcc 4.2.  For that compiler and others like it,\n      * we include the line number in the function name to do the best we can to\n      * avoid conflicts.  These should be rare: a conflict would require use of\n      * MOZ_STATIC_ASSERT on the same line in separate files in the same\n      * translation unit, *and* the uses would have to be in code with\n      * different linkage, *and* the first observed use must be in C++-linkage\n      * code.\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  else\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  endif\n\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)\n#else\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Prints |s| as an assertion failure (using file and ln as the location of the\n * assertion) to the standard debug-output channel.\n *\n * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This\n * method is primarily for internal use in this header, and only secondarily\n * for use in implementing release-build assertions.\n */\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportAssertionFailure(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n  __android_log_print(ANDROID_LOG_FATAL, \"MOZ_Assert\",\n                      \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportCrash(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n    __android_log_print(ANDROID_LOG_FATAL, \"MOZ_CRASH\",\n                        \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\n/**\n * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH().  You should\n * call MOZ_CRASH instead.\n */\n#if defined(_MSC_VER)\n   /*\n    * On MSVC use the __debugbreak compiler intrinsic, which produces an inline\n    * (not nested in a system function) breakpoint.  This distinctively invokes\n    * Breakpad without requiring system library symbols on all stack-processing\n    * machines, as a nested breakpoint would require.\n    *\n    * We use TerminateProcess with the exit code aborting would generate\n    * because we don't want to invoke atexit handlers, destructors, library\n    * unload handlers, and so on when our process might be in a compromised\n    * state.\n    *\n    * We don't use abort() because it'd cause Windows to annoyingly pop up the\n    * process error dialog multiple times.  See bug 345118 and bug 426163.\n    *\n    * We follow TerminateProcess() with a call to MOZ_NoReturn() so that the\n    * compiler doesn't hassle us to provide a return statement after a\n    * MOZ_REALLY_CRASH() call.\n    *\n    * (Technically these are Windows requirements, not MSVC requirements.  But\n    * practically you need MSVC for debugging, and we only ship builds created\n    * by MSVC, so doing it this way reduces complexity.)\n    */\n\n__declspec(noreturn) __inline void MOZ_NoReturn() {}\n\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         ::TerminateProcess(::GetCurrentProcess(), 3); \\\n         ::MOZ_NoReturn(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         TerminateProcess(GetCurrentProcess(), 3); \\\n         MOZ_NoReturn(); \\\n       } while (0)\n#  endif\n#else\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         ::abort(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         abort(); \\\n       } while (0)\n#  endif\n#endif\n\n/*\n * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a\n * Breakpad-compatible way, in both debug and release builds.\n *\n * MOZ_CRASH is a good solution for \"handling\" failure cases when you're\n * unwilling or unable to handle them more cleanly -- for OOM, for likely memory\n * corruption, and so on.  It's also a good solution if you need safe behavior\n * in release builds as well as debug builds.  But if the failure is one that\n * should be debugged and fixed, MOZ_ASSERT is generally preferable.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining why we're crashing.  This argument is intended for use with\n * MOZ_CRASH() calls whose rationale is non-obvious; don't use it if it's\n * obvious why we're crashing.\n *\n * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an\n * explanation-string, we print the string to stderr.  Otherwise, we don't\n * print anything; this is because we want MOZ_CRASH to be 100% safe in release\n * builds, and it's hard to print to stderr safely when memory might have been\n * corrupted.\n */\n#ifndef DEBUG\n#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()\n#else\n#  define MOZ_CRASH(...) \\\n     do { \\\n       MOZ_ReportCrash(\"\" __VA_ARGS__, __FILE__, __LINE__); \\\n       MOZ_REALLY_CRASH(); \\\n     } while(0)\n#endif\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n/*\n * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in\n * debug builds.  If it is, execution continues.  Otherwise, an error message\n * including the expression and the explanation-string (if provided) is printed,\n * an attempt is made to invoke any existing debugger, and execution halts.\n * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition\n * which can correctly be falsy.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining the assertion.  It is intended for use with assertions whose\n * correctness or rationale is non-obvious, and for assertions where the \"real\"\n * condition being tested is best described prosaically.  Don't provide an\n * explanation if it's not actually helpful.\n *\n *   // No explanation needed: pointer arguments often must not be NULL.\n *   MOZ_ASSERT(arg);\n *\n *   // An explanation can be helpful to explain exactly how we know an\n *   // assertion is valid.\n *   MOZ_ASSERT(state == WAITING_FOR_RESPONSE,\n *              \"given that <thingA> and <thingB>, we must have...\");\n *\n *   // Or it might disambiguate multiple identical (save for their location)\n *   // assertions of the same expression.\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this Boolean object\");\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this String object\");\n *\n * MOZ_ASSERT has no effect in non-debug builds.  It is designed to catch bugs\n * *only* during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n   /* First the single-argument form. */\n#  define MOZ_ASSERT_HELPER1(expr) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* Now the two-argument form. */\n#  define MOZ_ASSERT_HELPER2(expr, explain) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr \" (\" explain \")\", __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* And now, helper macrology up the wazoo. */\n   /*\n    * Count the number of arguments passed to MOZ_ASSERT, very carefully\n    * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a\n    * single token in argument lists.  See these URLs for details:\n    *\n    *   http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement\n    *   http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644\n    */\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL2(_1, _2, count, ...) \\\n     count\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL(args) \\\n\t MOZ_COUNT_ASSERT_ARGS_IMPL2 args\n#  define MOZ_COUNT_ASSERT_ARGS(...) \\\n     MOZ_COUNT_ASSERT_ARGS_IMPL((__VA_ARGS__, 2, 1, 0))\n   /* Pick the right helper macro to invoke. */\n#  define MOZ_ASSERT_CHOOSE_HELPER2(count) MOZ_ASSERT_HELPER##count\n#  define MOZ_ASSERT_CHOOSE_HELPER1(count) MOZ_ASSERT_CHOOSE_HELPER2(count)\n#  define MOZ_ASSERT_CHOOSE_HELPER(count) MOZ_ASSERT_CHOOSE_HELPER1(count)\n   /* The actual macro. */\n#  define MOZ_ASSERT_GLUE(x, y) x y\n#  define MOZ_ASSERT(...) \\\n     MOZ_ASSERT_GLUE(MOZ_ASSERT_CHOOSE_HELPER(MOZ_COUNT_ASSERT_ARGS(__VA_ARGS__)), \\\n                     (__VA_ARGS__))\n#else\n#  define MOZ_ASSERT(...) do { } while(0)\n#endif /* DEBUG */\n\n/*\n * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is\n * true.\n *\n *   MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));\n *\n * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds.  It is\n * designed to catch bugs during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n#  define MOZ_ASSERT_IF(cond, expr) \\\n     do { \\\n       if (cond) \\\n         MOZ_ASSERT(expr); \\\n     } while (0)\n#else\n#  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that it is\n * undefined behavior for execution to reach this point.  No guarantees are made\n * about what will happen if this is reached at runtime.  Most code should\n * probably use the higher level MOZ_ASSUME_UNREACHABLE, which uses this when\n * appropriate.\n */\n#if defined(__clang__)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#elif defined(__GNUC__)\n   /*\n    * __builtin_unreachable() was implemented in gcc 4.5.  If we don't have\n    * that, call a noreturn function; abort() will do nicely.  Qualify the call\n    * in C++ in case there's another abort() visible in local scope.\n    */\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0)\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#  else\n#    ifdef __cplusplus\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#    else\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __assume(0)\n#else\n#  ifdef __cplusplus\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#  else\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#  endif\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE([reason]) tells the compiler that it can assume that\n * the macro call cannot be reached during execution.  This lets the compiler\n * generate better-optimized code under some circumstances, at the expense of\n * the program's behavior being undefined if control reaches the\n * MOZ_ASSUME_UNREACHABLE.\n *\n * In Gecko, you probably should not use this macro outside of performance- or\n * size-critical code, because it's unsafe.  If you don't care about code size\n * or performance, you should probably use MOZ_ASSERT or MOZ_CRASH.\n *\n * SpiderMonkey is a different beast, and there it's acceptable to use\n * MOZ_ASSUME_UNREACHABLE more widely.\n *\n * Note that MOZ_ASSUME_UNREACHABLE is noreturn, so it's valid not to return a\n * value following a MOZ_ASSUME_UNREACHABLE call.\n *\n * Example usage:\n *\n *   enum ValueType {\n *     VALUE_STRING,\n *     VALUE_INT,\n *     VALUE_FLOAT\n *   };\n *\n *   int ptrToInt(ValueType type, void* value) {\n *   {\n *     // We know for sure that type is either INT or FLOAT, and we want this\n *     // code to run as quickly as possible.\n *     switch (type) {\n *     case VALUE_INT:\n *       return *(int*) value;\n *     case VALUE_FLOAT:\n *       return (int) *(float*) value;\n *     default:\n *       MOZ_ASSUME_UNREACHABLE(\"can only handle VALUE_INT and VALUE_FLOAT\");\n *     }\n *   }\n */\n#if defined(DEBUG)\n#  define MOZ_ASSUME_UNREACHABLE(...) \\\n     do { \\\n       MOZ_ASSERT(false, \"MOZ_ASSUME_UNREACHABLE(\" __VA_ARGS__ \")\"); \\\n       MOZ_ASSUME_UNREACHABLE_MARKER(); \\\n     } while (0)\n#else\n#  define MOZ_ASSUME_UNREACHABLE(reason)  MOZ_ASSUME_UNREACHABLE_MARKER()\n#endif\n\n/*\n * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided\n * expression, in debug builds and in release builds both.  Then, in debug\n * builds only, the value of the expression is asserted either true or false\n * using MOZ_ASSERT.\n */\n#ifdef DEBUG\n#  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))\n#  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))\n#else\n#  define MOZ_ALWAYS_TRUE(expr)      ((void)(expr))\n#  define MOZ_ALWAYS_FALSE(expr)     ((void)(expr))\n#endif\n\n#endif /* mozilla_Assertions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Atomics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements (almost always) lock-free atomic operations. The operations here\n * are a subset of that which can be found in C++11's <atomic> header, with a\n * different API to enforce consistent memory ordering constraints.\n *\n * Anyone caught using |volatile| for inter-thread memory safety needs to be\n * sent a copy of this header and the C++11 standard.\n */\n\n#ifndef mozilla_Atomics_h\n#define mozilla_Atomics_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n\n/*\n * Our minimum deployment target on clang/OS X is OS X 10.6, whose SDK\n * does not have <atomic>.  So be sure to check for <atomic> support\n * along with C++0x support.\n */\n#if defined(__clang__)\n   /*\n    * clang doesn't like libstdc++'s version of <atomic> before GCC 4.7,\n    * due to the loose typing of the __sync_* family of functions done by\n    * GCC.  We do not have a particularly good way to detect this sort of\n    * case at this point, so just assume that if we're on a Linux system,\n    * we can't use the system's <atomic>.\n    *\n    * OpenBSD uses an old libstdc++ 4.2.1 and thus doesnt have <atomic>.\n    */\n#  if !defined(__linux__) && !defined(__OpenBSD__) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \\\n      __has_include(<atomic>)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n/*\n * Android uses a different C++ standard library that does not provide\n * support for <atomic>.\n *\n * GCC 4.5.x and 4.6.x's unspecialized std::atomic template doesn't include\n * inline definitions for the functions declared therein.  This oversight\n * leads to linking errors when using atomic enums.  We therefore require\n * GCC 4.7 or higher.\n */\n#elif defined(__GNUC__) && !defined(__ANDROID__)\n#  include \"mozilla/Compiler.h\"\n#  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \\\n      MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n#elif defined(_MSC_VER) && _MSC_VER >= 1700\n#  define MOZ_HAVE_CXX11_ATOMICS\n#endif\n\nnamespace mozilla {\n\n/**\n * An enum of memory ordering possibilities for atomics.\n *\n * Memory ordering is the observable state of distinct values in memory.\n * (It's a separate concept from atomicity, which concerns whether an\n * operation can ever be observed in an intermediate state.  Don't\n * conflate the two!)  Given a sequence of operations in source code on\n * memory, it is *not* always the case that, at all times and on all\n * cores, those operations will appear to have occurred in that exact\n * sequence.  First, the compiler might reorder that sequence, if it\n * thinks another ordering will be more efficient.  Second, the CPU may\n * not expose so consistent a view of memory.  CPUs will often perform\n * their own instruction reordering, above and beyond that performed by\n * the compiler.  And each core has its own memory caches, and accesses\n * (reads and writes both) to \"memory\" may only resolve to out-of-date\n * cache entries -- not to the \"most recently\" performed operation in\n * some global sense.  Any access to a value that may be used by\n * multiple threads, potentially across multiple cores, must therefore\n * have a memory ordering imposed on it, for all code on all\n * threads/cores to have a sufficiently coherent worldview.\n *\n * http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync and\n * http://en.cppreference.com/w/cpp/atomic/memory_order go into more\n * detail on all this, including examples of how each mode works.\n *\n * Note that for simplicity and practicality, not all of the modes in\n * C++11 are supported.  The missing C++11 modes are either subsumed by\n * the modes we provide below, or not relevant for the CPUs we support\n * in Gecko.  These three modes are confusing enough as it is!\n */\nenum MemoryOrdering {\n  /*\n   * Relaxed ordering is the simplest memory ordering: none at all.\n   * When the result of a write is observed, nothing may be inferred\n   * about other memory.  Writes ostensibly performed \"before\" on the\n   * writing thread may not yet be visible.  Writes performed \"after\" on\n   * the writing thread may already be visible, if the compiler or CPU\n   * reordered them.  (The latter can happen if reads and/or writes get\n   * held up in per-processor caches.)  Relaxed ordering means\n   * operations can always use cached values (as long as the actual\n   * updates to atomic values actually occur, correctly, eventually), so\n   * it's usually the fastest sort of atomic access.  For this reason,\n   * *it's also the most dangerous kind of access*.\n   *\n   * Relaxed ordering is good for things like process-wide statistics\n   * counters that don't need to be consistent with anything else, so\n   * long as updates themselves are atomic.  (And so long as any\n   * observations of that value can tolerate being out-of-date -- if you\n   * need some sort of up-to-date value, you need some sort of other\n   * synchronizing operation.)  It's *not* good for locks, mutexes,\n   * reference counts, etc. that mediate access to other memory, or must\n   * be observably consistent with other memory.\n   *\n   * x86 architectures don't take advantage of the optimization\n   * opportunities that relaxed ordering permits.  Thus it's possible\n   * that using relaxed ordering will \"work\" on x86 but fail elsewhere\n   * (ARM, say, which *does* implement non-sequentially-consistent\n   * relaxed ordering semantics).  Be extra-careful using relaxed\n   * ordering if you can't easily test non-x86 architectures!\n   */\n  Relaxed,\n  /*\n   * When an atomic value is updated with ReleaseAcquire ordering, and\n   * that new value is observed with ReleaseAcquire ordering, prior\n   * writes (atomic or not) are also observable.  What ReleaseAcquire\n   * *doesn't* give you is any observable ordering guarantees for\n   * ReleaseAcquire-ordered operations on different objects.  For\n   * example, if there are two cores that each perform ReleaseAcquire\n   * operations on separate objects, each core may or may not observe\n   * the operations made by the other core.  The only way the cores can\n   * be synchronized with ReleaseAcquire is if they both\n   * ReleaseAcquire-access the same object.  This implies that you can't\n   * necessarily describe some global total ordering of ReleaseAcquire\n   * operations.\n   *\n   * ReleaseAcquire ordering is good for (as the name implies) atomic\n   * operations on values controlling ownership of things: reference\n   * counts, mutexes, and the like.  However, if you are thinking about\n   * using these to implement your own locks or mutexes, you should take\n   * a good, hard look at actual lock or mutex primitives first.\n   */\n  ReleaseAcquire,\n  /*\n   * When an atomic value is updated with SequentiallyConsistent\n   * ordering, all writes observable when the update is observed, just\n   * as with ReleaseAcquire ordering.  But, furthermore, a global total\n   * ordering of SequentiallyConsistent operations *can* be described.\n   * For example, if two cores perform SequentiallyConsistent operations\n   * on separate objects, one core will observably perform its update\n   * (and all previous operations will have completed), then the other\n   * core will observably perform its update (and all previous\n   * operations will have completed).  (Although those previous\n   * operations aren't themselves ordered -- they could be intermixed,\n   * or ordered if they occur on atomic values with ordering\n   * requirements.)  SequentiallyConsistent is the *simplest and safest*\n   * ordering of atomic operations -- it's always as if one operation\n   * happens, then another, then another, in some order -- and every\n   * core observes updates to happen in that single order.  Because it\n   * has the most synchronization requirements, operations ordered this\n   * way also tend to be slowest.\n   *\n   * SequentiallyConsistent ordering can be desirable when multiple\n   * threads observe objects, and they all have to agree on the\n   * observable order of changes to them.  People expect\n   * SequentiallyConsistent ordering, even if they shouldn't, when\n   * writing code, atomic or otherwise.  SequentiallyConsistent is also\n   * the ordering of choice when designing lockless data structures.  If\n   * you don't know what order to use, use this one.\n   */\n  SequentiallyConsistent,\n};\n\n} // namespace mozilla\n\n// Build up the underlying intrinsics.\n#ifdef MOZ_HAVE_CXX11_ATOMICS\n\n#  include <atomic>\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * We provide CompareExchangeFailureOrder to work around a bug in some\n * versions of GCC's <atomic> header.  See bug 898491.\n */\ntemplate<MemoryOrdering Order> struct AtomicOrderConstraints;\n\ntemplate<>\nstruct AtomicOrderConstraints<Relaxed>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;\n    static const std::memory_order LoadOrder = std::memory_order_relaxed;\n    static const std::memory_order StoreOrder = std::memory_order_relaxed;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_relaxed;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<ReleaseAcquire>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;\n    static const std::memory_order LoadOrder = std::memory_order_acquire;\n    static const std::memory_order StoreOrder = std::memory_order_release;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_acquire;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<SequentiallyConsistent>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;\n    static const std::memory_order LoadOrder = std::memory_order_seq_cst;\n    static const std::memory_order StoreOrder = std::memory_order_seq_cst;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_seq_cst;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicBase\n{\n    typedef std::atomic<T> ValueType;\n    typedef AtomicOrderConstraints<Order> OrderedOp;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T load(const typename Base::ValueType& ptr) {\n      return ptr.load(Base::OrderedOp::LoadOrder);\n    }\n    static void store(typename Base::ValueType& ptr, T val) {\n      ptr.store(val, Base::OrderedOp::StoreOrder);\n    }\n    static T exchange(typename Base::ValueType& ptr, T val) {\n      return ptr.exchange(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static bool compareExchange(typename Base::ValueType& ptr, T oldVal, T newVal) {\n      return ptr.compare_exchange_strong(oldVal, newVal,\n                                         Base::OrderedOp::AtomicRMWOrder,\n                                         Base::OrderedOp::CompareExchangeFailureOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T add(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_add(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T sub(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_sub(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>\n{\n    typedef IntrinsicBase<T*, Order> Base;\n    static T* add(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_add(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T* sub(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_sub(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n  private:\n    /*\n     * GCC 4.6's <atomic> header has a bug where adding X to an\n     * atomic<T*> is not the same as adding X to a T*.  Hence the need\n     * for this function to provide the correct addend.\n     */\n    static ptrdiff_t fixupAddend(ptrdiff_t val) {\n#if defined(__clang__) || defined(_MSC_VER)\n      return val;\n#elif defined(__GNUC__) && MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) && \\\n      !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n      return val * sizeof(T);\n#else\n      return val;\n#endif\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T inc(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::add(ptr, 1);\n    }\n    static T dec(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::sub(ptr, 1);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T or_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_or(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T xor_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_xor(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T and_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_and(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order>\n  : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(__GNUC__)\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The __sync_* family of intrinsics is documented here:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Atomic-Builtins.html\n *\n * While these intrinsics are deprecated in favor of the newer __atomic_*\n * family of intrincs:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/_005f_005fatomic-Builtins.html\n *\n * any GCC version that supports the __atomic_* intrinsics will also support\n * the <atomic> header and so will be handled above.  We provide a version of\n * atomics using the __sync_* intrinsics to support older versions of GCC.\n *\n * All __sync_* intrinsics that we use below act as full memory barriers, for\n * both compiler and hardware reordering, except for __sync_lock_test_and_set,\n * which is a only an acquire barrier.  When we call __sync_lock_test_and_set,\n * we add a barrier above it as appropriate.\n */\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * Some processors (in particular, x86) don't require quite so many calls to\n * __sync_sychronize as our specializations of Barrier produce.  If\n * performance turns out to be an issue, defining these specializations\n * on a per-processor basis would be a good first tuning step.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { __sync_synchronize(); }\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() { __sync_synchronize(); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps\n{\n    static T load(const T& ptr) {\n      Barrier<Order>::beforeLoad();\n      T val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(T& ptr, T val) {\n      Barrier<Order>::beforeStore();\n      ptr = val;\n      Barrier<Order>::afterStore();\n    }\n    static T exchange(T& ptr, T val) {\n      // __sync_lock_test_and_set is only an acquire barrier; loads and stores\n      // can't be moved up from after to before it, but they can be moved down\n      // from before to after it.  We may want a stricter ordering, so we need\n      // an explicit barrier.\n\n      Barrier<Order>::beforeStore();\n      return __sync_lock_test_and_set(&ptr, val);\n    }\n    static bool compareExchange(T& ptr, T oldVal, T newVal) {\n      return __sync_bool_compare_and_swap(&ptr, oldVal, newVal);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub\n{\n    typedef T ValueType;\n    static T add(T& ptr, T val) {\n      return __sync_fetch_and_add(&ptr, val);\n    }\n    static T sub(T& ptr, T val) {\n      return __sync_fetch_and_sub(&ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*>\n{\n    typedef T* ValueType;\n    /*\n     * The reinterpret_casts are needed so that\n     * __sync_fetch_and_{add,sub} will properly type-check.\n     *\n     * Also, these functions do not provide standard semantics for\n     * pointer types, so we need to adjust the addend.\n     */\n    static ValueType add(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_add(&ptr, amount);\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_sub(&ptr, amount);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static T inc(T& ptr) { return IntrinsicAddSub<T>::add(ptr, 1); }\n    static T dec(T& ptr) { return IntrinsicAddSub<T>::sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static T or_(T& ptr, T val) {\n      return __sync_fetch_and_or(&ptr, val);\n    }\n    static T xor_(T& ptr, T val) {\n      return __sync_fetch_and_xor(&ptr, val);\n    }\n    static T and_(T& ptr, T val) {\n      return __sync_fetch_and_and(&ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(_MSC_VER)\n\n/*\n * Windows comes with a full complement of atomic operations.\n * Unfortunately, most of those aren't available for Windows XP (even if\n * the compiler supports intrinsics for them), which is the oldest\n * version of Windows we support.  Therefore, we only provide operations\n * on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows\n * versions, we support 64-bit datatypes as well.\n *\n * To avoid namespace pollution issues, we declare whatever functions we\n * need ourselves.\n */\n\nextern \"C\" {\nlong __cdecl _InterlockedExchangeAdd(long volatile* dst, long value);\nlong __cdecl _InterlockedOr(long volatile* dst, long value);\nlong __cdecl _InterlockedXor(long volatile* dst, long value);\nlong __cdecl _InterlockedAnd(long volatile* dst, long value);\nlong __cdecl _InterlockedExchange(long volatile *dst, long value);\nlong __cdecl _InterlockedCompareExchange(long volatile *dst, long newVal, long oldVal);\n}\n\n#  pragma intrinsic(_InterlockedExchangeAdd)\n#  pragma intrinsic(_InterlockedOr)\n#  pragma intrinsic(_InterlockedXor)\n#  pragma intrinsic(_InterlockedAnd)\n#  pragma intrinsic(_InterlockedExchange)\n#  pragma intrinsic(_InterlockedCompareExchange)\n\nnamespace mozilla {\nnamespace detail {\n\n#  if !defined(_M_IX86) && !defined(_M_X64)\n     /*\n      * The implementations below are optimized for x86ish systems.  You\n      * will have to modify them if you are porting to Windows on a\n      * different architecture.\n      */\n#    error \"Unknown CPU type\"\n#  endif\n\n/*\n * The PrimitiveIntrinsics template should define |Type|, the datatype of size\n * DataSize upon which we operate, and the following eight functions.\n *\n * static Type add(Type* ptr, Type val);\n * static Type sub(Type* ptr, Type val);\n * static Type or_(Type* ptr, Type val);\n * static Type xor_(Type* ptr, Type val);\n * static Type and_(Type* ptr, Type val);\n *\n *   These functions perform the obvious operation on the value contained in\n *   |*ptr| combined with |val| and return the value previously stored in\n *   |*ptr|.\n *\n * static void store(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and must provide a full\n *   memory fence after the store to prevent compiler and hardware instruction\n *   reordering.  It should also act as a compiler barrier to prevent reads and\n *   writes from moving to after the store.\n *\n * static Type exchange(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and returns the previous\n *   contents of *ptr;\n *\n * static bool compareExchange(Type* ptr, Type oldVal, Type newVal);\n *\n *   This function atomically performs the following operation:\n *\n *     if (*ptr == oldVal) {\n *       *ptr = newVal;\n *       return true;\n *     } else {\n *       return false;\n *     }\n *\n */\ntemplate<size_t DataSize> struct PrimitiveIntrinsics;\n\ntemplate<>\nstruct PrimitiveIntrinsics<4>\n{\n    typedef long Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * _InterlockedExchangeSubtract isn't available before Windows 7,\n       * and we must support Windows XP.\n       */\n      return _InterlockedExchangeAdd(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  if defined(_M_X64)\n\nextern \"C\" {\nlong long __cdecl _InterlockedExchangeAdd64(long long volatile* dst,\n                                            long long value);\nlong long __cdecl _InterlockedOr64(long long volatile* dst,\n                                   long long value);\nlong long __cdecl _InterlockedXor64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedAnd64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedExchange64(long long volatile* dst,\n                                         long long value);\nlong long __cdecl _InterlockedCompareExchange64(long long volatile* dst,\n                                                long long newVal,\n                                                long long oldVal);\n}\n\n#    pragma intrinsic(_InterlockedExchangeAdd64)\n#    pragma intrinsic(_InterlockedOr64)\n#    pragma intrinsic(_InterlockedXor64)\n#    pragma intrinsic(_InterlockedAnd64)\n#    pragma intrinsic(_InterlockedExchange64)\n#    pragma intrinsic(_InterlockedCompareExchange64)\n\ntemplate <>\nstruct PrimitiveIntrinsics<8>\n{\n    typedef __int64 Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd64(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * There is no _InterlockedExchangeSubtract64.\n       */\n      return _InterlockedExchangeAdd64(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr64(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor64(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd64(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange64(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange64(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange64(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  endif\n\nextern \"C\" { void _ReadWriteBarrier(); }\n\n#  pragma intrinsic(_ReadWriteBarrier)\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * We do not provide an afterStore method in Barrier, as Relaxed and\n * ReleaseAcquire orderings do not require one, and the required barrier\n * for SequentiallyConsistent is handled by PrimitiveIntrinsics.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { _ReadWriteBarrier(); }\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper\n{\n  static PrimType toPrimType(T val) { return static_cast<PrimType>(val); }\n  static T fromPrimType(PrimType val) { return static_cast<T>(val); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper<PrimType, T*>\n{\n  static PrimType toPrimType(T* val) { return reinterpret_cast<PrimType>(val); }\n  static T* fromPrimType(PrimType val) { return reinterpret_cast<T*>(val); }\n};\n\ntemplate<typename T>\nstruct IntrinsicBase\n{\n    typedef T ValueType;\n    typedef PrimitiveIntrinsics<sizeof(T)> Primitives;\n    typedef typename Primitives::Type PrimType;\n    static_assert(sizeof(PrimType) == sizeof(T),\n                  \"Selection of PrimitiveIntrinsics was wrong\");\n    typedef CastHelper<PrimType, T> Cast;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T>\n{\n    static ValueType load(const ValueType& ptr) {\n      Barrier<Order>::beforeLoad();\n      ValueType val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(ValueType& ptr, ValueType val) {\n      // For SequentiallyConsistent, Primitives::store() will generate the\n      // proper memory fence.  Everything else just needs a barrier before\n      // the store.\n      if (Order == SequentiallyConsistent) {\n        Primitives::store(reinterpret_cast<PrimType*>(&ptr),\n                          Cast::toPrimType(val));\n      } else {\n        Barrier<Order>::beforeStore();\n        ptr = val;\n      }\n    }\n    static ValueType exchange(ValueType& ptr, ValueType val) {\n      PrimType oldval =\n        Primitives::exchange(reinterpret_cast<PrimType*>(&ptr),\n                             Cast::toPrimType(val));\n      return Cast::fromPrimType(oldval);\n    }\n    static bool compareExchange(ValueType& ptr, ValueType oldVal, ValueType newVal) {\n      return Primitives::compareExchange(reinterpret_cast<PrimType*>(&ptr),\n                                         Cast::toPrimType(oldVal),\n                                         Cast::toPrimType(newVal));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicApplyHelper : public IntrinsicBase<T>\n{\n    typedef PrimType (*BinaryOp)(PrimType*, PrimType);\n    typedef PrimType (*UnaryOp)(PrimType*);\n\n    static ValueType applyBinaryFunction(BinaryOp op, ValueType& ptr,\n                                         ValueType val) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      PrimType primTypeVal = Cast::toPrimType(val);\n      return Cast::fromPrimType(op(primTypePtr, primTypeVal));\n    }\n\n    static ValueType applyUnaryFunction(UnaryOp op, ValueType& ptr) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      return Cast::fromPrimType(op(primTypePtr));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub : public IntrinsicApplyHelper<T>\n{\n    static ValueType add(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::add, ptr, val);\n    }\n    static ValueType sub(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::sub, ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*> : public IntrinsicApplyHelper<T*>\n{\n    static ValueType add(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::add, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::sub, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static ValueType inc(ValueType& ptr) { return add(ptr, 1); }\n    static ValueType dec(ValueType& ptr) { return sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static ValueType or_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::or_, ptr, val);\n    }\n    static ValueType xor_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::xor_, ptr, val);\n    }\n    static ValueType and_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::and_, ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#else\n# error \"Atomic compiler intrinsics are not supported on your platform\"\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBase\n{\n    // We only support 32-bit types on 32-bit Windows, which constrains our\n    // implementation elsewhere.  But we support pointer-sized types everywhere.\n    static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),\n                  \"mozilla/Atomics.h only supports 32-bit and pointer-sized types\");\n\n  protected:\n    typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;\n    typename Intrinsics::ValueType mValue;\n\n  public:\n    AtomicBase() : mValue() {}\n    AtomicBase(T aInit) { Intrinsics::store(mValue, aInit); }\n\n    operator T() const { return Intrinsics::load(mValue); }\n\n    T operator=(T aValue) {\n      Intrinsics::store(mValue, aValue);\n      return aValue;\n    }\n\n    /**\n     * Performs an atomic swap operation.  aValue is stored and the previous\n     * value of this variable is returned.\n     */\n    T exchange(T aValue) {\n      return Intrinsics::exchange(mValue, aValue);\n    }\n\n    /**\n     * Performs an atomic compare-and-swap operation and returns true if it\n     * succeeded. This is equivalent to atomically doing\n     *\n     *   if (mValue == aOldValue) {\n     *     mValue = aNewValue;\n     *     return true;\n     *   } else {\n     *     return false;\n     *   }\n     */\n    bool compareExchange(T aOldValue, T aNewValue) {\n      return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);\n    }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBaseIncDec : public AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    AtomicBaseIncDec() : Base() {}\n    AtomicBaseIncDec(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }\n    T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }\n    T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }\n    T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\n} // namespace detail\n\n/**\n * A wrapper for a type that enforces that all memory accesses are atomic.\n *\n * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in\n * its place.  Implementations for integral and pointer types are provided\n * below.\n *\n * Atomic accesses are sequentially consistent by default.  You should\n * use the default unless you are tall enough to ride the\n * memory-ordering roller coaster (if you're not sure, you aren't) and\n * you have a compelling reason to do otherwise.\n *\n * There is one exception to the case of atomic memory accesses: providing an\n * initial value of the atomic value is not guaranteed to be atomic.  This is a\n * deliberate design choice that enables static atomic variables to be declared\n * without introducing extra static constructors.\n */\ntemplate<typename T,\n         MemoryOrdering Order = SequentiallyConsistent,\n         typename Enable = void>\nclass Atomic;\n\n/**\n * Atomic<T> implementation for integral types.\n *\n * In addition to atomic store and load operations, compound assignment and\n * increment/decrement operators are implemented which perform the\n * corresponding read-modify-write operation atomically.  Finally, an atomic\n * swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsIntegral<T>::value>::Type>\n  : public detail::AtomicBaseIncDec<T, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator+=(T delta) { return Base::Intrinsics::add(Base::mValue, delta) + delta; }\n    T operator-=(T delta) { return Base::Intrinsics::sub(Base::mValue, delta) - delta; }\n    T operator|=(T val) { return Base::Intrinsics::or_(Base::mValue, val) | val; }\n    T operator^=(T val) { return Base::Intrinsics::xor_(Base::mValue, val) ^ val; }\n    T operator&=(T val) { return Base::Intrinsics::and_(Base::mValue, val) & val; }\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for pointer types.\n *\n * An atomic compare-and-swap primitive for pointer variables is provided, as\n * are atomic increment and decement operators.  Also provided are the compound\n * assignment operators for addition and subtraction. Atomic swap (via\n * exchange()) is included as well.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T*, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T* aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T* operator+=(ptrdiff_t delta) {\n      return Base::Intrinsics::add(Base::mValue, delta) + delta;\n    }\n    T* operator-=(ptrdiff_t delta) {\n      return Base::Intrinsics::sub(Base::mValue, delta) - delta;\n    }\n\n  private:\n    Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for enum types.\n *\n * The atomic store and load operations and the atomic swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>\n  : public detail::AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Atomics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Attributes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of various class and method modifier attributes. */\n\n#ifndef mozilla_Attributes_h\n#define mozilla_Attributes_h\n\n#include \"mozilla/Compiler.h\"\n\n/*\n * MOZ_INLINE is a macro which expands to tell the compiler that the method\n * decorated with it should be inlined.  This macro is usable from C and C++\n * code, even though C89 does not support the |inline| keyword.  The compiler\n * may ignore this directive if it chooses.\n */\n#if defined(__cplusplus)\n#  define MOZ_INLINE            inline\n#elif defined(_MSC_VER)\n#  define MOZ_INLINE            __inline\n#elif defined(__GNUC__)\n#  define MOZ_INLINE            __inline__\n#else\n#  define MOZ_INLINE            inline\n#endif\n\n/*\n * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must be inlined, even if the compiler thinks\n * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:\n * compilers are not guaranteed to respect it (although they're much more likely\n * to do so).\n *\n * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the\n * compiler to inline even in DEBUG builds. It should be used very rarely.\n */\n#if defined(_MSC_VER)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __forceinline\n#elif defined(__GNUC__)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     MOZ_INLINE\n#endif\n\n#if defined(DEBUG)\n#  define MOZ_ALWAYS_INLINE     MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG\n#endif\n\n/*\n * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality\n * without warnings (functionality used by the macros below).  These modes are\n * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more\n * standardly, by checking whether __cplusplus has a C++11 or greater value.\n * Current versions of g++ do not correctly set __cplusplus, so we check both\n * for forward compatibility.\n */\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_constexpr)\n#    define MOZ_HAVE_CXX11_CONSTEXPR\n#  endif\n#  if __has_extension(cxx_deleted_functions)\n#    define MOZ_HAVE_CXX11_DELETE\n#  endif\n#  if __has_extension(cxx_override_control)\n#    define MOZ_HAVE_CXX11_OVERRIDE\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  endif\n#  if __has_attribute(noinline)\n#    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))\n#  endif\n#  if __has_attribute(noreturn)\n#    define MOZ_HAVE_NORETURN            __attribute__((noreturn))\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_OVERRIDE\n#      define MOZ_HAVE_CXX11_FINAL       final\n#    endif\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_CONSTEXPR\n#    endif\n#    define MOZ_HAVE_CXX11_DELETE\n#  else\n     /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_FINAL       __final\n#    endif\n#  endif\n#  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))\n#  define MOZ_HAVE_NORETURN              __attribute__((noreturn))\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  else\n     /* MSVC <= 10 used to spell \"final\" as \"sealed\". */\n#    define MOZ_HAVE_CXX11_FINAL         sealed\n#  endif\n#  define MOZ_HAVE_CXX11_OVERRIDE\n#  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)\n#  define MOZ_HAVE_NORETURN              __declspec(noreturn)\n#endif\n\n/*\n * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a\n * function at compile time. A constexpr function cannot examine any values\n * except its arguments and can have no side effects except its return value.\n * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's\n * value may be computed at compile time.  It should be prefered to just\n * marking variables as MOZ_CONSTEXPR because if the compiler does not support\n * constexpr it will fall back to making the variable const, and some compilers\n * do not accept variables being marked both const and constexpr.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_CONSTEXPR         constexpr\n#  define MOZ_CONSTEXPR_VAR     constexpr\n#else\n#  define MOZ_CONSTEXPR         /* no support */\n#  define MOZ_CONSTEXPR_VAR     const\n#endif\n\n/*\n * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must never be inlined, even if the compiler would\n * otherwise choose to inline the method.  Compilers aren't absolutely\n * guaranteed to support this, but most do.\n */\n#if defined(MOZ_HAVE_NEVER_INLINE)\n#  define MOZ_NEVER_INLINE      MOZ_HAVE_NEVER_INLINE\n#else\n#  define MOZ_NEVER_INLINE      /* no support */\n#endif\n\n/*\n * MOZ_NORETURN, specified at the start of a function declaration, indicates\n * that the given function does not return.  (The function definition does not\n * need to be annotated.)\n *\n *   MOZ_NORETURN void abort(const char* msg);\n *\n * This modifier permits the compiler to optimize code assuming a call to such a\n * function will never return.  It also enables the compiler to avoid spurious\n * warnings about not initializing variables, or about any other seemingly-dodgy\n * operations performed after the function returns.\n *\n * This modifier does not affect the corresponding function's linking behavior.\n */\n#if defined(MOZ_HAVE_NORETURN)\n#  define MOZ_NORETURN          MOZ_HAVE_NORETURN\n#else\n#  define MOZ_NORETURN          /* no support */\n#endif\n\n/*\n * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time\n * instrumentation shipped with Clang) to not instrument the annotated function.\n * Furthermore, it will prevent the compiler from inlining the function because\n * inlining currently breaks the blacklisting mechanism of AddressSanitizer.\n */\n#if defined(MOZ_ASAN)\n#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis))\n# else\n#  define MOZ_ASAN_BLACKLIST\n#endif\n\n\n#ifdef __cplusplus\n\n/*\n * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-\n * method declaration, attempts to delete that method from the corresponding\n * class.  An attempt to use the method will always produce an error *at compile\n * time* (instead of sometimes as late as link time) when this macro can be\n * implemented.  For example, you can use MOZ_DELETE to produce classes with no\n * implicit copy constructor or assignment operator:\n *\n *   struct NonCopyable\n *   {\n *     private:\n *       NonCopyable(const NonCopyable& other) MOZ_DELETE;\n *       void operator=(const NonCopyable& other) MOZ_DELETE;\n *   };\n *\n * If MOZ_DELETE can't be implemented for the current compiler, use of the\n * annotated method will still cause an error, but the error might occur at link\n * time in some cases rather than at compile time.\n *\n * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a\n * backstop, method declarations using MOZ_DELETE should be private.\n */\n#if defined(MOZ_HAVE_CXX11_DELETE)\n#  define MOZ_DELETE            = delete\n#else\n#  define MOZ_DELETE            /* no support */\n#endif\n\n/*\n * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class\n * overrides a member function of a base class, rather than potentially being a\n * new member function.  MOZ_OVERRIDE should be placed immediately before the\n * ';' terminating the member function's declaration, or before '= 0;' if the\n * member function is pure.  If the member function is defined in the class\n * definition, it should appear before the opening brace of the function body.\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() = 0;\n *   };\n *   class Derived1 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE;\n *   };\n *   class Derived2 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE = 0;\n *   };\n *   class Derived3 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE { }\n *   };\n *\n * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that\n * the function marked with it override a member function of a base class: it\n * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect\n * semantics and merely documents the override relationship to the reader (but\n * of course must still be used correctly to not break C++11 compilers).\n */\n#if defined(MOZ_HAVE_CXX11_OVERRIDE)\n#  define MOZ_OVERRIDE          override\n#else\n#  define MOZ_OVERRIDE          /* no support */\n#endif\n\n/*\n * MOZ_FINAL indicates that some functionality cannot be overridden through\n * inheritance.  It can be used to annotate either classes/structs or virtual\n * member functions.\n *\n * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after\n * the name of the class, before the list of classes from which it derives (if\n * any) and before its opening brace.  MOZ_FINAL must not be used to annotate\n * unnamed classes or structs.  (With some compilers, and with C++11 proper, the\n * underlying expansion is ambiguous with specifying a class name.)\n *\n *   class Base MOZ_FINAL\n *   {\n *     public:\n *       Base();\n *       ~Base();\n *       virtual void f() { }\n *   };\n *   // This will be an error in some compilers:\n *   class Derived : public Base\n *   {\n *     public:\n *       ~Derived() { }\n *   };\n *\n * One particularly common reason to specify MOZ_FINAL upon a class is to tell\n * the compiler that it's not dangerous for it to have a non-virtual destructor\n * yet have one or more virtual functions, silencing the warning it might emit\n * in this case.  Suppose Base above weren't annotated with MOZ_FINAL.  Because\n * ~Base() is non-virtual, an attempt to delete a Derived* through a Base*\n * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen.\n * (Formally C++ says behavior is undefined, but compilers will likely just call\n * ~Base() and not ~Derived().)  Specifying MOZ_FINAL tells the compiler that\n * it's safe for the destructor to be non-virtual.\n *\n * In compilers implementing final controls, it is an error to inherit from a\n * class annotated with MOZ_FINAL.  In other compilers it serves only as\n * documentation.\n *\n * To annotate a virtual member function with MOZ_FINAL, place MOZ_FINAL\n * immediately before the ';' terminating the member function's declaration, or\n * before '= 0;' if the member function is pure.  If the member function is\n * defined in the class definition, it should appear before the opening brace of\n * the function body.  (This placement is identical to that for MOZ_OVERRIDE.\n * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE'\n * for consistency.)\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() MOZ_FINAL;\n *   };\n *   class Derived\n *   {\n *     public:\n *       // This will be an error in some compilers:\n *       virtual void f();\n *   };\n *\n * In compilers implementing final controls, it is an error for a derived class\n * to override a method annotated with MOZ_FINAL.  In other compilers it serves\n * only as documentation.\n */\n#if defined(MOZ_HAVE_CXX11_FINAL)\n#  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL\n#else\n#  define MOZ_FINAL             /* no support */\n#endif\n\n/**\n * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's\n * return value is not used by the caller.\n *\n * Place this attribute at the very beginning of a function definition. For\n * example, write\n *\n *   MOZ_WARN_UNUSED_RESULT int foo();\n *\n * or\n *\n *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }\n */\n#if defined(__GNUC__) || defined(__clang__)\n#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))\n#else\n#  define MOZ_WARN_UNUSED_RESULT\n#endif\n\n/*\n * The following macros are attributes that support the static analysis plugin\n * included with Mozilla, and will be implemented (when such support is enabled)\n * as C++11 attributes. Since such attributes are legal pretty much everywhere\n * and have subtly different semantics depending on their placement, the\n * following is a guide on where to place the attributes.\n *\n * Attributes that apply to a struct or class precede the name of the class:\n * (Note that this is different from the placement of MOZ_FINAL for classes!)\n *\n *   class MOZ_CLASS_ATTRIBUTE SomeClass {};\n *\n * Attributes that apply to functions follow the parentheses and const\n * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body:\n *\n *   void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE;\n *   void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {}\n *   void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0;\n *   void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE;\n *\n * Attributes that apply to variables or parameters follow the variable's name:\n *\n *   int variable MOZ_VARIABLE_ATTRIBUTE;\n *\n * Attributes that apply to types follow the type name:\n *\n *   typedef int MOZ_TYPE_ATTRIBUTE MagicInt;\n *   int MOZ_TYPE_ATTRIBUTE someVariable;\n *   int * MOZ_TYPE_ATTRIBUTE magicPtrInt;\n *   int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt;\n *\n * Attributes that apply to statements precede the statement:\n *\n *   MOZ_IF_ATTRIBUTE if (x == 0)\n *   MOZ_DO_ATTRIBUTE do { } while(0);\n *\n * Attributes that apply to labels precede the label:\n *\n *   MOZ_LABEL_ATTRIBUTE target:\n *     goto target;\n *   MOZ_CASE_ATTRIBUTE case 5:\n *   MOZ_DEFAULT_ATTRIBUTE default:\n *\n * The static analyses that are performed by the plugin are as follows:\n *\n * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate\n *   subclasses must provide an exact override of this method; if a subclass\n *   does not override this method, the compiler will emit an error. This\n *   attribute is not limited to virtual methods, so if it is applied to a\n *   nonvirtual method and the subclass does not provide an equivalent\n *   definition, the compiler will emit an error.\n * MOZ_STACK_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack, so it is a compile-time error to use it, or\n *   an array of such objects, as a global or static variable, or as the type of\n *   a new expression (unless placement new is being used). If a member of\n *   another class uses this class, or if another class inherits from this\n *   class, then it is considered to be a stack class as well, although this\n *   attribute need not be provided in such cases.\n * MOZ_NONHEAP_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack or in static storage, so it is a compile-time\n *   error to use it, or an array of such objects, as the type of a new\n *   expression (unless placement new is being used). If a member of another\n *   class uses this class, or if another class inherits from this class, then\n *   it is considered to be a non-heap class as well, although this attribute\n *   need not be provided in such cases.\n */\n#ifdef MOZ_CLANG_PLUGIN\n# define MOZ_MUST_OVERRIDE __attribute__((annotate(\"moz_must_override\")))\n# define MOZ_STACK_CLASS __attribute__((annotate(\"moz_stack_class\")))\n# define MOZ_NONHEAP_CLASS __attribute__((annotate(\"moz_nonheap_class\")))\n#else\n# define MOZ_MUST_OVERRIDE /* nothing */\n# define MOZ_STACK_CLASS /* nothing */\n# define MOZ_NONHEAP_CLASS /* nothing */\n#endif /* MOZ_CLANG_PLUGIN */\n\n/*\n * MOZ_THIS_IN_INITIALIZER_LIST is used to avoid a warning when we know that\n * it's safe to use 'this' in an initializer list.\n */\n#ifdef _MSC_VER\n#  define MOZ_THIS_IN_INITIALIZER_LIST() \\\n     __pragma(warning(push)) \\\n     __pragma(warning(disable:4355)) \\\n     this \\\n     __pragma(warning(pop))\n#else\n#  define MOZ_THIS_IN_INITIALIZER_LIST() this\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_Attributes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/BloomFilter.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A counting Bloom filter implementation.  This allows consumers to\n * do fast probabilistic \"is item X in set Y?\" testing which will\n * never answer \"no\" when the correct answer is \"yes\" (but might\n * incorrectly answer \"yes\" when the correct answer is \"no\").\n */\n\n#ifndef mozilla_BloomFilter_h\n#define mozilla_BloomFilter_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Likely.h\"\n#include \"mozilla/Util.h\"\n\n#include <stdint.h>\n#include <string.h>\n\nnamespace mozilla {\n\n/*\n * This class implements a counting Bloom filter as described at\n * <http://en.wikipedia.org/wiki/Bloom_filter#Counting_filters>, with\n * 8-bit counters.  This allows quick probabilistic answers to the\n * question \"is object X in set Y?\" where the contents of Y might not\n * be time-invariant.  The probabilistic nature of the test means that\n * sometimes the answer will be \"yes\" when it should be \"no\".  If the\n * answer is \"no\", then X is guaranteed not to be in Y.\n *\n * The filter is parametrized on KeySize, which is the size of the key\n * generated by each of hash functions used by the filter, in bits,\n * and the type of object T being added and removed.  T must implement\n * a |uint32_t hash() const| method which returns a uint32_t hash key\n * that will be used to generate the two separate hash functions for\n * the Bloom filter.  This hash key MUST be well-distributed for good\n * results!  KeySize is not allowed to be larger than 16.\n *\n * The filter uses exactly 2**KeySize bytes of memory.  From now on we\n * will refer to the memory used by the filter as M.\n *\n * The expected rate of incorrect \"yes\" answers depends on M and on\n * the number N of objects in set Y.  As long as N is small compared\n * to M, the rate of such answers is expected to be approximately\n * 4*(N/M)**2 for this filter.  In practice, if Y has a few hundred\n * elements then using a KeySize of 12 gives a reasonably low\n * incorrect answer rate.  A KeySize of 12 has the additional benefit\n * of using exactly one page for the filter in typical hardware\n * configurations.\n */\n\ntemplate<unsigned KeySize, class T>\nclass BloomFilter\n{\n    /*\n     * A counting Bloom filter with 8-bit counters.  For now we assume\n     * that having two hash functions is enough, but we may revisit that\n     * decision later.\n     *\n     * The filter uses an array with 2**KeySize entries.\n     *\n     * Assuming a well-distributed hash function, a Bloom filter with\n     * array size M containing N elements and\n     * using k hash function has expected false positive rate exactly\n     *\n     * $  (1 - (1 - 1/M)^{kN})^k  $\n     *\n     * because each array slot has a\n     *\n     * $  (1 - 1/M)^{kN}  $\n     *\n     * chance of being 0, and the expected false positive rate is the\n     * probability that all of the k hash functions will hit a nonzero\n     * slot.\n     *\n     * For reasonable assumptions (M large, kN large, which should both\n     * hold if we're worried about false positives) about M and kN this\n     * becomes approximately\n     *\n     * $$  (1 - \\exp(-kN/M))^k   $$\n     *\n     * For our special case of k == 2, that's $(1 - \\exp(-2N/M))^2$,\n     * or in other words\n     *\n     * $$    N/M = -0.5 * \\ln(1 - \\sqrt(r))   $$\n     *\n     * where r is the false positive rate.  This can be used to compute\n     * the desired KeySize for a given load N and false positive rate r.\n     *\n     * If N/M is assumed small, then the false positive rate can\n     * further be approximated as 4*N^2/M^2.  So increasing KeySize by\n     * 1, which doubles M, reduces the false positive rate by about a\n     * factor of 4, and a false positive rate of 1% corresponds to\n     * about M/N == 20.\n     *\n     * What this means in practice is that for a few hundred keys using a\n     * KeySize of 12 gives false positive rates on the order of 0.25-4%.\n     *\n     * Similarly, using a KeySize of 10 would lead to a 4% false\n     * positive rate for N == 100 and to quite bad false positive\n     * rates for larger N.\n     */\n  public:\n    BloomFilter() {\n        static_assert(KeySize <= keyShift, \"KeySize too big\");\n\n        // Should we have a custom operator new using calloc instead and\n        // require that we're allocated via the operator?\n        clear();\n    }\n\n    /*\n     * Clear the filter.  This should be done before reusing it, because\n     * just removing all items doesn't clear counters that hit the upper\n     * bound.\n     */\n    void clear();\n\n    /*\n     * Add an item to the filter.\n     */\n    void add(const T* t);\n\n    /*\n     * Remove an item from the filter.\n     */\n    void remove(const T* t);\n\n    /*\n     * Check whether the filter might contain an item.  This can\n     * sometimes return true even if the item is not in the filter,\n     * but will never return false for items that are actually in the\n     * filter.\n     */\n    bool mightContain(const T* t) const;\n\n    /*\n     * Methods for add/remove/contain when we already have a hash computed\n     */\n    void add(uint32_t hash);\n    void remove(uint32_t hash);\n    bool mightContain(uint32_t hash) const;\n\n  private:\n    static const size_t arraySize = (1 << KeySize);\n    static const uint32_t keyMask = (1 << KeySize) - 1;\n    static const uint32_t keyShift = 16;\n\n    static uint32_t hash1(uint32_t hash) { return hash & keyMask; }\n    static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; }\n\n    uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; }\n    uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; }\n    const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; }\n    const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; }\n\n    static bool full(const uint8_t& slot) { return slot == UINT8_MAX; }\n\n    uint8_t counters[arraySize];\n};\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::clear()\n{\n  memset(counters, 0, arraySize);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::add(uint32_t hash)\n{\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    ++slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    ++slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::add(const T* t)\n{\n  uint32_t hash = t->hash();\n  return add(hash);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::remove(uint32_t hash)\n{\n  // If the slots are full, we don't know whether we bumped them to be\n  // there when we added or not, so just leave them full.\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    --slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    --slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::remove(const T* t)\n{\n  uint32_t hash = t->hash();\n  remove(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(uint32_t hash) const\n{\n  // Check that all the slots for this hash contain something\n  return firstSlot(hash) && secondSlot(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(const T* t) const\n{\n  uint32_t hash = t->hash();\n  return mightContain(hash);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_BloomFilter_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Casting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cast operations to supplement the built-in casting operations. */\n\n#ifndef mozilla_Casting_h\n#define mozilla_Casting_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <limits.h>\n\nnamespace mozilla {\n\n/**\n * Return a value of type |To|, containing the underlying bit pattern of |from|.\n *\n * |To| and |From| must be types of the same size; be careful of cross-platform\n * size differences, or this might fail to compile on some but not all\n * platforms.\n */\ntemplate<typename To, typename From>\ninline To\nBitwiseCast(const From from)\n{\n  static_assert(sizeof(From) == sizeof(To),\n                \"To and From must have the same size\");\n  union {\n    From from;\n    To to;\n  } u;\n  u.from = from;\n  return u.to;\n}\n\nnamespace detail {\n\nenum ToSignedness { ToIsSigned, ToIsUnsigned };\nenum FromSignedness { FromIsSigned, FromIsUnsigned };\n\ntemplate<typename From,\n         typename To,\n         FromSignedness = IsSigned<From>::value ? FromIsSigned : FromIsUnsigned,\n         ToSignedness = IsSigned<To>::value ? ToIsSigned : ToIsUnsigned>\nstruct BoundsCheckImpl;\n\n// Implicit conversions on operands to binary operations make this all a bit\n// hard to verify.  Attempt to ease the pain below by *only* comparing values\n// that are obviously the same type (and will undergo no further conversions),\n// even when it's not strictly necessary, for explicitness.\n\nenum UUComparison { FromIsBigger, FromIsNotBigger };\n\n// Unsigned-to-unsigned range check\n\ntemplate<typename From, typename To,\n         UUComparison = (sizeof(From) > sizeof(To)) ? FromIsBigger : FromIsNotBigger>\nstruct UnsignedUnsignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return from <= From(To(-1));\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsNotBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedUnsignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-unsigned range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (from < 0)\n        return false;\n      if (sizeof(To) >= sizeof(From))\n        return true;\n      return from <= From(To(-1));\n    }\n};\n\n// Unsigned-to-signed range check\n\nenum USComparison { FromIsSmaller, FromIsNotSmaller };\n\ntemplate<typename From, typename To,\n         USComparison = (sizeof(From) < sizeof(To)) ? FromIsSmaller : FromIsNotSmaller>\nstruct UnsignedSignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsNotSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      return from <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedSignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-signed range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (sizeof(From) <= sizeof(To))\n        return true;\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      const To MinValue = -MaxValue - To(1);\n      return From(MinValue) <= from &&\n             From(from) <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To,\n         bool TypesAreIntegral = IsIntegral<From>::value && IsIntegral<To>::value>\nclass BoundsChecker;\n\ntemplate<typename From>\nclass BoundsChecker<From, From, true>\n{\n  public:\n    static bool checkBounds(const From from) { return true; }\n};\n\ntemplate<typename From, typename To>\nclass BoundsChecker<From, To, true>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return BoundsCheckImpl<From, To>::checkBounds(from);\n    }\n};\n\ntemplate<typename From, typename To>\ninline bool\nIsInBounds(const From from)\n{\n  return BoundsChecker<From, To>::checkBounds(from);\n}\n\n} // namespace detail\n\n/**\n * Cast a value of integral type |From| to a value of integral type |To|,\n * asserting that the cast will be a safe cast per C++ (that is, that |to| is in\n * the range of values permitted for the type |From|).\n */\ntemplate<typename To, typename From>\ninline To\nSafeCast(const From from)\n{\n  MOZ_ASSERT((detail::IsInBounds<From, To>(from)));\n  return static_cast<To>(from);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Casting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Char16.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implements a UTF-16 character type. */\n\n#ifndef mozilla_Char16_h\n#define mozilla_Char16_h\n\n#include \"mozilla/Assertions.h\"\n\n/*\n * C11 and C++11 introduce a char16_t type and support for UTF-16 string and\n * character literals. C++11's char16_t is a distinct builtin type. C11's\n * char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit\n * code unit of a Unicode code point, not a \"character\".\n *\n * For now, Char16.h only supports C++ because we don't want mix different C\n * and C++ definitions of char16_t in the same code base.\n */\n\n#ifdef _MSC_VER\n   /*\n    * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h\n    * typedefs char16_t as an unsigned short. We would like to alias char16_t\n    * to Windows's 16-bit wchar_t so we can declare UTF-16 literals as constant\n    * expressions (and pass char16_t pointers to Windows APIs). We #define our\n    * char16_t as a macro to override yval.h's typedef of the same name.\n    */\n#  define MOZ_UTF16_HELPER(s) L##s\n#  include <yvals.h>\n#  define char16_t wchar_t\n#elif defined(__cplusplus) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))\n   /* C++11 has a builtin char16_t type. */\n#  define MOZ_UTF16_HELPER(s) u##s\n#else\n#  error \"Char16.h requires C++11 (or something like it) for UTF-16 support.\"\n#endif\n\n/*\n * Macro arguments used in concatenation or stringification won't be expanded.\n * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to\n * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper\n * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro\n * argument to expand. See \"3.10.6 Separate Expansion of Macro Arguments\" of the\n * CPP manual for a more accurate and precise explanation.\n */\n#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)\n\nstatic_assert(sizeof(char16_t) == 2, \"Is char16_t type 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16('A')) == 2, \"Is char literal 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16(\"\")[0]) == 2, \"Is string char 16 bits?\");\n\n#endif /* mozilla_Char16_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/CheckedInt.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Provides checked integers, detecting integer overflow and divide-by-0. */\n\n#ifndef mozilla_CheckedInt_h\n#define mozilla_CheckedInt_h\n\n// Enable relying of Mozilla's MFBT for possibly-available C++11 features\n#define MOZ_CHECKEDINT_USE_MFBT\n\n#include <stdint.h>\n\n#ifdef MOZ_CHECKEDINT_USE_MFBT\n#  include \"mozilla/Assertions.h\"\n#else\n#  include <cassert>\n#  define MOZ_ASSERT(cond, reason) assert((cond) && reason)\n#  define MOZ_DELETE\n#endif\n\n#include <climits>\n#include <cstddef>\n\nnamespace mozilla {\n\ntemplate<typename T> class CheckedInt;\n\nnamespace detail {\n\n/*\n * Step 1: manually record supported types\n *\n * What's nontrivial here is that there are different families of integer\n * types: basic integer types and stdint types. It is merrily undefined which\n * types from one family may be just typedefs for a type from another family.\n *\n * For example, on GCC 4.6, aside from the basic integer types, the only other\n * type that isn't just a typedef for some of them, is int8_t.\n */\n\nstruct UnsupportedType {};\n\ntemplate<typename IntegerType>\nstruct IsSupportedPass2\n{\n    static const bool value = false;\n};\n\ntemplate<typename IntegerType>\nstruct IsSupported\n{\n    static const bool value = IsSupportedPass2<IntegerType>::value;\n};\n\ntemplate<>\nstruct IsSupported<int8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int64_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint64_t>\n{ static const bool value = true; };\n\n\ntemplate<>\nstruct IsSupportedPass2<char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<signed char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long long>\n{ static const bool value = true; };\n\n/*\n * Step 2: some integer-traits kind of stuff.\n */\n\ntemplate<size_t Size, bool Signedness>\nstruct StdintTypeForSizeAndSignedness\n{};\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, true>\n{ typedef int8_t   Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, false>\n{ typedef uint8_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, true>\n{ typedef int16_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, false>\n{ typedef uint16_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, true>\n{ typedef int32_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, false>\n{ typedef uint32_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, true>\n{ typedef int64_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, false>\n{ typedef uint64_t Type; };\n\ntemplate<typename IntegerType>\nstruct UnsignedType\n{\n    typedef typename StdintTypeForSizeAndSignedness<sizeof(IntegerType),\n                                                    false>::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct IsSigned\n{\n    static const bool value = IntegerType(-1) <= IntegerType(0);\n};\n\ntemplate<typename IntegerType, size_t Size = sizeof(IntegerType)>\nstruct TwiceBiggerType\n{\n    typedef typename StdintTypeForSizeAndSignedness<\n                       sizeof(IntegerType) * 2,\n                       IsSigned<IntegerType>::value\n                     >::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct TwiceBiggerType<IntegerType, 8>\n{\n    typedef UnsupportedType Type;\n};\n\ntemplate<typename IntegerType>\nstruct PositionOfSignBit\n{\n    static const size_t value = CHAR_BIT * sizeof(IntegerType) - 1;\n};\n\ntemplate<typename IntegerType>\nstruct MinValue\n{\n  private:\n    typedef typename UnsignedType<IntegerType>::Type UnsignedIntegerType;\n    static const size_t PosOfSignBit = PositionOfSignBit<IntegerType>::value;\n\n  public:\n    // Bitwise ops may return a larger type, that's why we cast explicitly.\n    // In C++, left bit shifts on signed values is undefined by the standard\n    // unless the shifted value is representable.\n    // Notice that signed-to-unsigned conversions are always well-defined in\n    // the standard as the value congruent to 2**n, as expected. By contrast,\n    // unsigned-to-signed is only well-defined if the value is representable.\n    static const IntegerType value =\n        IsSigned<IntegerType>::value\n        ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit)\n        : IntegerType(0);\n};\n\ntemplate<typename IntegerType>\nstruct MaxValue\n{\n    // Tricksy, but covered by the unit test.\n    // Relies heavily on the type of MinValue<IntegerType>::value\n    // being IntegerType.\n    static const IntegerType value = ~MinValue<IntegerType>::value;\n};\n\n/*\n * Step 3: Implement the actual validity checks.\n *\n * Ideas taken from IntegerLib, code different.\n */\n\ntemplate<typename T>\ninline bool\nHasSignBit(T x)\n{\n  // In C++, right bit shifts on negative values is undefined by the standard.\n  // Notice that signed-to-unsigned conversions are always well-defined in the\n  // standard, as the value congruent modulo 2**n as expected. By contrast,\n  // unsigned-to-signed is only well-defined if the value is representable.\n  return bool(typename UnsignedType<T>::Type(x)\n                >> PositionOfSignBit<T>::value);\n}\n\n// Bitwise ops may return a larger type, so it's good to use this inline\n// helper guaranteeing that the result is really of type T.\ntemplate<typename T>\ninline T\nBinaryComplement(T x)\n{\n  return ~x;\n}\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value>\nstruct DoesRangeContainRange\n{\n};\n\ntemplate<typename T, typename U, bool Signedness>\nstruct DoesRangeContainRange<T, U, Signedness, Signedness>\n{\n    static const bool value = sizeof(T) >= sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, true, false>\n{\n    static const bool value = sizeof(T) > sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, false, true>\n{\n    static const bool value = false;\n};\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value,\n         bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>\nstruct IsInRangeImpl {};\n\ntemplate<typename T, typename U, bool IsTSigned, bool IsUSigned>\nstruct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>\n{\n    static bool run(U)\n    {\n       return true;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, true, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value && x >= MinValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, false, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, false, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) > sizeof(U) || x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, true, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) >= sizeof(U)\n             ? x >= 0\n             : x >= 0 && x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\ninline bool\nIsInRange(U x)\n{\n  return IsInRangeImpl<T, U>::run(x);\n}\n\ntemplate<typename T>\ninline bool\nIsAddValid(T x, T y)\n{\n  // Addition is valid if the sign of x+y is equal to either that of x or that\n  // of y. Since the value of x+y is undefined if we have a signed type, we\n  // compute it using the unsigned type of the same size.\n  // Beware! These bitwise operations can return a larger integer type,\n  // if T was a small type like int8_t, so we explicitly cast to T.\n\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux + uy;\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y))))\n         : BinaryComplement(x) >= y;\n}\n\ntemplate<typename T>\ninline bool\nIsSubValid(T x, T y)\n{\n  // Subtraction is valid if either x and y have same sign, or x-y and x have\n  // same sign. Since the value of x-y is undefined if we have a signed type,\n  // we compute it using the unsigned type of the same size.\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux - uy;\n\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y))))\n         : x >= y;\n}\n\ntemplate<typename T,\n         bool IsTSigned = IsSigned<T>::value,\n         bool TwiceBiggerTypeIsSupported =\n           IsSupported<typename TwiceBiggerType<T>::Type>::value>\nstruct IsMulValidImpl {};\n\ntemplate<typename T, bool IsTSigned>\nstruct IsMulValidImpl<T, IsTSigned, true>\n{\n    static bool run(T x, T y)\n    {\n      typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;\n      TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y);\n      return IsInRange<T>(product);\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, true, false>\n{\n    static bool run(T x, T y)\n    {\n      const T max = MaxValue<T>::value;\n      const T min = MinValue<T>::value;\n\n      if (x == 0 || y == 0)\n        return true;\n\n      if (x > 0) {\n        return y > 0\n               ? x <= max / y\n               : y >= min / x;\n      }\n\n      // If we reach this point, we know that x < 0.\n      return y > 0\n             ? x >= min / y\n             : y >= max / x;\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, false, false>\n{\n    static bool run(T x, T y)\n    {\n      return y == 0 ||  x <= MaxValue<T>::value / y;\n    }\n};\n\ntemplate<typename T>\ninline bool\nIsMulValid(T x, T y)\n{\n  return IsMulValidImpl<T>::run(x, y);\n}\n\ntemplate<typename T>\ninline bool\nIsDivValid(T x, T y)\n{\n  // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max.\n  return y != 0 &&\n         !(IsSigned<T>::value && x == MinValue<T>::value && y == T(-1));\n}\n\ntemplate<typename T, bool IsTSigned = IsSigned<T>::value>\nstruct IsModValidImpl;\n\ntemplate<typename T>\ninline bool\nIsModValid(T x, T y)\n{\n  return IsModValidImpl<T>::run(x, y);\n}\n\n/*\n * Mod is pretty simple.\n * For now, let's just use the ANSI C definition:\n * If x or y are negative, the results are implementation defined.\n *   Consider these invalid.\n * Undefined for y=0.\n * The result will never exceed either x or y.\n *\n * Checking that x>=0 is a warning when T is unsigned.\n */\n\ntemplate<typename T>\nstruct IsModValidImpl<T, false> {\n  static inline bool run(T x, T y) {\n    return y >= 1;\n  }\n};\n\ntemplate<typename T>\nstruct IsModValidImpl<T, true> {\n  static inline bool run(T x, T y) {\n    if (x < 0)\n      return false;\n\n    return y >= 1;\n  }\n};\n\ntemplate<typename T, bool IsSigned = IsSigned<T>::value>\nstruct NegateImpl;\n\ntemplate<typename T>\nstruct NegateImpl<T, false>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Handle negation separately for signed/unsigned, for simpler code and to\n      // avoid an MSVC warning negating an unsigned value.\n      return CheckedInt<T>(0, val.isValid() && val.mValue == 0);\n    }\n};\n\ntemplate<typename T>\nstruct NegateImpl<T, true>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Watch out for the min-value, which (with twos-complement) can't be\n      // negated as -min-value is then (max-value + 1).\n      if (!val.isValid() || val.mValue == MinValue<T>::value)\n        return CheckedInt<T>(val.mValue, false);\n      return CheckedInt<T>(-val.mValue, true);\n    }\n};\n\n} // namespace detail\n\n\n/*\n * Step 4: Now define the CheckedInt class.\n */\n\n/**\n * @class CheckedInt\n * @brief Integer wrapper class checking for integer overflow and other errors\n * @param T the integer type to wrap. Can be any type among the following:\n *            - any basic integer type such as |int|\n *            - any stdint type such as |int8_t|\n *\n * This class implements guarded integer arithmetic. Do a computation, check\n * that isValid() returns true, you then have a guarantee that no problem, such\n * as integer overflow, happened during this computation, and you can call\n * value() to get the plain integer value.\n *\n * The arithmetic operators in this class are guaranteed not to raise a signal\n * (e.g. in case of a division by zero).\n *\n * For example, suppose that you want to implement a function that computes\n * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by\n * zero or integer overflow). You could code it as follows:\n   @code\n   bool computeXPlusYOverZ(int x, int y, int z, int *result)\n   {\n       CheckedInt<int> checkedResult = (CheckedInt<int>(x) + y) / z;\n       if (checkedResult.isValid()) {\n           *result = checkedResult.value();\n           return true;\n       } else {\n           return false;\n       }\n   }\n   @endcode\n *\n * Implicit conversion from plain integers to checked integers is allowed. The\n * plain integer is checked to be in range before being casted to the\n * destination type. This means that the following lines all compile, and the\n * resulting CheckedInts are correctly detected as valid or invalid:\n * @code\n   // 1 is of type int, is found to be in range for uint8_t, x is valid\n   CheckedInt<uint8_t> x(1);\n   // -1 is of type int, is found not to be in range for uint8_t, x is invalid\n   CheckedInt<uint8_t> x(-1);\n   // -1 is of type int, is found to be in range for int8_t, x is valid\n   CheckedInt<int8_t> x(-1);\n   // 1000 is of type int16_t, is found not to be in range for int8_t,\n   // x is invalid\n   CheckedInt<int8_t> x(int16_t(1000));\n   // 3123456789 is of type uint32_t, is found not to be in range for int32_t,\n   // x is invalid\n   CheckedInt<int32_t> x(uint32_t(3123456789));\n * @endcode\n * Implicit conversion from\n * checked integers to plain integers is not allowed. As shown in the\n * above example, to get the value of a checked integer as a normal integer,\n * call value().\n *\n * Arithmetic operations between checked and plain integers is allowed; the\n * result type is the type of the checked integer.\n *\n * Checked integers of different types cannot be used in the same arithmetic\n * expression.\n *\n * There are convenience typedefs for all stdint types, of the following form\n * (these are just 2 examples):\n   @code\n   typedef CheckedInt<int32_t> CheckedInt32;\n   typedef CheckedInt<uint16_t> CheckedUint16;\n   @endcode\n */\ntemplate<typename T>\nclass CheckedInt\n{\n  protected:\n    T mValue;\n    bool mIsValid;\n\n    template<typename U>\n    CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid)\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    friend struct detail::NegateImpl<T>;\n\n  public:\n    /**\n     * Constructs a checked integer with given @a value. The checked integer is\n     * initialized as valid or invalid depending on whether the @a value\n     * is in range.\n     *\n     * This constructor is not explicit. Instead, the type of its argument is a\n     * separate template parameter, ensuring that no conversion is performed\n     * before this constructor is actually called. As explained in the above\n     * documentation for class CheckedInt, this constructor checks that its\n     * argument is valid.\n     */\n    template<typename U>\n    CheckedInt(U value)\n      : mValue(T(value)),\n        mIsValid(detail::IsInRange<T>(value))\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    template<typename U>\n    friend class CheckedInt;\n\n    template<typename U>\n    CheckedInt<U> toChecked() const\n    {\n      CheckedInt<U> ret(mValue);\n      ret.mIsValid = ret.mIsValid && mIsValid;\n      return ret;\n    }\n\n    /** Constructs a valid checked integer with initial value 0 */\n    CheckedInt() : mValue(0), mIsValid(true)\n    {\n      static_assert(detail::IsSupported<T>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    /** @returns the actual value */\n    T value() const\n    {\n      MOZ_ASSERT(mIsValid, \"Invalid checked integer (division by zero or integer overflow)\");\n      return mValue;\n    }\n\n    /**\n     * @returns true if the checked integer is valid, i.e. is not the result\n     * of an invalid operation or of an operation involving an invalid checked\n     * integer\n     */\n    bool isValid() const\n    {\n      return mIsValid;\n    }\n\n    template<typename U>\n    friend CheckedInt<U> operator +(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator +=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator -(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator -=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator *(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator *=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator /(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator /=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator %(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator %=(U rhs);\n\n    CheckedInt operator -() const\n    {\n      return detail::NegateImpl<T>::negate(*this);\n    }\n\n    /**\n     * @returns true if the left and right hand sides are valid\n     * and have the same value.\n     *\n     * Note that these semantics are the reason why we don't offer\n     * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)\n     * but that would mean that whenever a or b is invalid, a!=b\n     * is always true, which would be very confusing.\n     *\n     * For similar reasons, operators <, >, <=, >= would be very tricky to\n     * specify, so we just avoid offering them.\n     *\n     * Notice that these == semantics are made more reasonable by these facts:\n     *  1. a==b implies equality at the raw data level\n     *     (the converse is false, as a==b is never true among invalids)\n     *  2. This is similar to the behavior of IEEE floats, where a==b\n     *     means that a and b have the same value *and* neither is NaN.\n     */\n    bool operator ==(const CheckedInt& other) const\n    {\n      return mIsValid && other.mIsValid && mValue == other.mValue;\n    }\n\n    /** prefix ++ */\n    CheckedInt& operator++()\n    {\n      *this += 1;\n      return *this;\n    }\n\n    /** postfix ++ */\n    CheckedInt operator++(int)\n    {\n      CheckedInt tmp = *this;\n      *this += 1;\n      return tmp;\n    }\n\n    /** prefix -- */\n    CheckedInt& operator--()\n    {\n      *this -= 1;\n      return *this;\n    }\n\n    /** postfix -- */\n    CheckedInt operator--(int)\n    {\n      CheckedInt tmp = *this;\n      *this -= 1;\n      return tmp;\n    }\n\n  private:\n    /**\n     * The !=, <, <=, >, >= operators are disabled:\n     * see the comment on operator==.\n     */\n    template<typename U>\n    bool operator !=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >=(U other) const MOZ_DELETE;\n};\n\n#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                \\\ntemplate<typename T>                                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs,            \\\n                                 const CheckedInt<T> &rhs)            \\\n{                                                                     \\\n  if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue))               \\\n    return CheckedInt<T>(0, false);                                   \\\n                                                                      \\\n  return CheckedInt<T>(lhs.mValue OP rhs.mValue,                      \\\n                       lhs.mIsValid && rhs.mIsValid);                 \\\n}\n\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)\n\n#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR\n\n// Implement castToCheckedInt<T>(x), making sure that\n//  - it allows x to be either a CheckedInt<T> or any integer type\n//    that can be casted to T\n//  - if x is already a CheckedInt<T>, we just return a reference to it,\n//    instead of copying it (optimization)\n\nnamespace detail {\n\ntemplate<typename T, typename U>\nstruct CastToCheckedIntImpl\n{\n    typedef CheckedInt<T> ReturnType;\n    static CheckedInt<T> run(U u) { return u; }\n};\n\ntemplate<typename T>\nstruct CastToCheckedIntImpl<T, CheckedInt<T> >\n{\n    typedef const CheckedInt<T>& ReturnType;\n    static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }\n};\n\n} // namespace detail\n\ntemplate<typename T, typename U>\ninline typename detail::CastToCheckedIntImpl<T, U>::ReturnType\ncastToCheckedInt(U u)\n{\n  static_assert(detail::IsSupported<T>::value &&\n                detail::IsSupported<U>::value,\n                \"This type is not supported by CheckedInt\");\n  return detail::CastToCheckedIntImpl<T, U>::run(u);\n}\n\n#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)  \\\ntemplate<typename T>                                              \\\ntemplate<typename U>                                              \\\nCheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U rhs)         \\\n{                                                                 \\\n  *this = *this OP castToCheckedInt<T>(rhs);                      \\\n  return *this;                                                   \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs, U rhs) \\\n{                                                                 \\\n  return lhs OP castToCheckedInt<T>(rhs);                         \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(U lhs, const CheckedInt<T> &rhs) \\\n{                                                                 \\\n  return castToCheckedInt<T>(lhs) OP rhs;                         \\\n}\n\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)\n\n#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(const CheckedInt<T> &lhs, U rhs)\n{\n  return lhs == castToCheckedInt<T>(rhs);\n}\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(U  lhs, const CheckedInt<T> &rhs)\n{\n  return castToCheckedInt<T>(lhs) == rhs;\n}\n\n// Convenience typedefs.\ntypedef CheckedInt<int8_t>   CheckedInt8;\ntypedef CheckedInt<uint8_t>  CheckedUint8;\ntypedef CheckedInt<int16_t>  CheckedInt16;\ntypedef CheckedInt<uint16_t> CheckedUint16;\ntypedef CheckedInt<int32_t>  CheckedInt32;\ntypedef CheckedInt<uint32_t> CheckedUint32;\ntypedef CheckedInt<int64_t>  CheckedInt64;\ntypedef CheckedInt<uint64_t> CheckedUint64;\n\n} // namespace mozilla\n\n#endif /* mozilla_CheckedInt_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Compiler.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various compiler checks. */\n\n#ifndef mozilla_Compiler_h\n#define mozilla_Compiler_h\n\n#if !defined(__clang__) && defined(__GNUC__)\n\n#define MOZ_IS_GCC 1\n   /*\n    * This macro should simplify gcc version checking. For example, to check\n    * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`.\n    */\n#  define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel)          \\\n     ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \\\n      >= ((major) * 10000 + (minor) * 100 + (patchlevel)))\n#if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0)\n#  error \"mfbt (and Gecko) require at least gcc 4.4 to build.\"\n#endif\n\n#else\n\n#define MOZ_IS_GCC 0\n\n#endif\n\n#endif /* mozilla_Compiler_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Constants.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt math constants. */\n\n#ifndef mozilla_Constants_h\n#define mozilla_Constants_h\n\n#ifndef M_PI\n#  define M_PI 3.14159265358979323846\n#endif\n\n#endif /* mozilla_Constants_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/DebugOnly.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides DebugOnly, a type for variables used only in debug builds (i.e. by\n * assertions).\n */\n\n#ifndef mozilla_DebugOnly_h\n#define mozilla_DebugOnly_h\n\nnamespace mozilla {\n\n/**\n * DebugOnly contains a value of type T, but only in debug builds.  In release\n * builds, it does not contain a value.  This helper is intended to be used with\n * MOZ_ASSERT()-style macros, allowing one to write:\n *\n *   DebugOnly<bool> check = func();\n *   MOZ_ASSERT(check);\n *\n * more concisely than declaring |check| conditional on #ifdef DEBUG, but also\n * without allocating storage space for |check| in release builds.\n *\n * DebugOnly instances can only be coerced to T in debug builds.  In release\n * builds they don't have a value, so type coercion is not well defined.\n */\ntemplate<typename T>\nclass DebugOnly\n{\n  public:\n#ifdef DEBUG\n    T value;\n\n    DebugOnly() { }\n    DebugOnly(const T& other) : value(other) { }\n    DebugOnly(const DebugOnly& other) : value(other.value) { }\n    DebugOnly& operator=(const T& rhs) {\n      value = rhs;\n      return *this;\n    }\n    void operator++(int) {\n      value++;\n    }\n    void operator--(int) {\n      value--;\n    }\n\n    T* operator&() { return &value; }\n\n    operator T&() { return value; }\n    operator const T&() const { return value; }\n\n    T& operator->() { return value; }\n\n#else\n    DebugOnly() { }\n    DebugOnly(const T&) { }\n    DebugOnly(const DebugOnly&) { }\n    DebugOnly& operator=(const T&) { return *this; }\n    void operator++(int) { }\n    void operator--(int) { }\n#endif\n\n    /*\n     * DebugOnly must always have a destructor or else it will\n     * generate \"unused variable\" warnings, exactly what it's intended\n     * to avoid!\n     */\n    ~DebugOnly() {}\n};\n\n}\n\n#endif /* mozilla_DebugOnly_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Decimal.h",
    "content": "/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * Imported from:\n * http://src.chromium.org/viewvc/blink/trunk/Source/core/platform/Decimal.h\n * Check hg log for the svn rev of the last update from Blink core.\n */\n\n#ifndef Decimal_h\n#define Decimal_h\n\n#include \"mozilla/Assertions.h\"\n#include <stdint.h>\n#include \"mozilla/Types.h\"\n\n#include <string>\n\n#ifndef ASSERT\n#define DEFINED_ASSERT_FOR_DECIMAL_H 1\n#define ASSERT MOZ_ASSERT\n#endif\n\n// To use WTF_MAKE_FAST_ALLOCATED we'd need:\n// http://src.chromium.org/viewvc/blink/trunk/Source/wtf/FastMalloc.h\n// Since we don't allocate Decimal objects, no need.\n#define WTF_MAKE_FAST_ALLOCATED \\\n  void ignore_this_dummy_method() MOZ_DELETE\n\nnamespace WebCore {\n\nnamespace DecimalPrivate {\nclass SpecialValueHandler;\n}\n\n// This class represents decimal base floating point number.\n//\n// FIXME: Once all C++ compiler support decimal type, we should replace this\n// class to compiler supported one. See below URI for current status of decimal\n// type for C++: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1977.html\nclass Decimal {\n    WTF_MAKE_FAST_ALLOCATED;\npublic:\n    enum Sign {\n        Positive,\n        Negative,\n    };\n\n    // You should not use EncodedData other than unit testing.\n    class EncodedData {\n        // For accessing FormatClass.\n        friend class Decimal;\n        friend class DecimalPrivate::SpecialValueHandler;\n    public:\n        EncodedData(Sign, int exponent, uint64_t coefficient);\n\n        bool operator==(const EncodedData&) const;\n        bool operator!=(const EncodedData& another) const { return !operator==(another); }\n\n        uint64_t coefficient() const { return m_coefficient; }\n        int countDigits() const;\n        int exponent() const { return m_exponent; }\n        bool isFinite() const { return !isSpecial(); }\n        bool isInfinity() const { return m_formatClass == ClassInfinity; }\n        bool isNaN() const { return m_formatClass == ClassNaN; }\n        bool isSpecial() const { return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; }\n        bool isZero() const { return m_formatClass == ClassZero; }\n        Sign sign() const { return m_sign; }\n        void setSign(Sign sign) { m_sign = sign; }\n\n    private:\n        enum FormatClass {\n            ClassInfinity,\n            ClassNormal,\n            ClassNaN,\n            ClassZero,\n        };\n\n        EncodedData(Sign, FormatClass);\n        FormatClass formatClass() const { return m_formatClass; }\n\n        uint64_t m_coefficient;\n        int16_t m_exponent;\n        FormatClass m_formatClass;\n        Sign m_sign;\n    };\n\n    MFBT_API Decimal(int32_t = 0);\n    MFBT_API Decimal(Sign, int exponent, uint64_t coefficient);\n    MFBT_API Decimal(const Decimal&);\n\n    MFBT_API Decimal& operator=(const Decimal&);\n    MFBT_API Decimal& operator+=(const Decimal&);\n    MFBT_API Decimal& operator-=(const Decimal&);\n    MFBT_API Decimal& operator*=(const Decimal&);\n    MFBT_API Decimal& operator/=(const Decimal&);\n\n    MFBT_API Decimal operator-() const;\n\n    MFBT_API bool operator==(const Decimal&) const;\n    MFBT_API bool operator!=(const Decimal&) const;\n    MFBT_API bool operator<(const Decimal&) const;\n    MFBT_API bool operator<=(const Decimal&) const;\n    MFBT_API bool operator>(const Decimal&) const;\n    MFBT_API bool operator>=(const Decimal&) const;\n\n    MFBT_API Decimal operator+(const Decimal&) const;\n    MFBT_API Decimal operator-(const Decimal&) const;\n    MFBT_API Decimal operator*(const Decimal&) const;\n    MFBT_API Decimal operator/(const Decimal&) const;\n\n    int exponent() const\n    {\n        ASSERT(isFinite());\n        return m_data.exponent();\n    }\n\n    bool isFinite() const { return m_data.isFinite(); }\n    bool isInfinity() const { return m_data.isInfinity(); }\n    bool isNaN() const { return m_data.isNaN(); }\n    bool isNegative() const { return sign() == Negative; }\n    bool isPositive() const { return sign() == Positive; }\n    bool isSpecial() const { return m_data.isSpecial(); }\n    bool isZero() const { return m_data.isZero(); }\n\n    MFBT_API Decimal abs() const;\n    MFBT_API Decimal ceiling() const;\n    MFBT_API Decimal floor() const;\n    MFBT_API Decimal remainder(const Decimal&) const;\n    MFBT_API Decimal round() const;\n\n    MFBT_API double toDouble() const;\n    // Note: toString method supports infinity and nan but fromString not.\n    MFBT_API std::string toString() const;\n    MFBT_API bool toString(char* strBuf, size_t bufLength) const;\n\n    static MFBT_API Decimal fromDouble(double);\n    // fromString supports following syntax EBNF:\n    //  number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?\n    //          | sign? '.' digit+ (exponent-marker sign? digit+)?\n    //  sign ::= '+' | '-'\n    //  exponent-marker ::= 'e' | 'E'\n    //  digit ::= '0' | '1' | ... | '9'\n    // Note: fromString doesn't support \"infinity\" and \"nan\".\n    static MFBT_API Decimal fromString(const std::string& aValue);\n    static MFBT_API Decimal infinity(Sign);\n    static MFBT_API Decimal nan();\n    static MFBT_API Decimal zero(Sign);\n\n    // You should not use below methods. We expose them for unit testing.\n    MFBT_API explicit Decimal(const EncodedData&);\n    const EncodedData& value() const { return m_data; }\n\nprivate:\n    struct AlignedOperands {\n        uint64_t lhsCoefficient;\n        uint64_t rhsCoefficient;\n        int exponent;\n    };\n\n    MFBT_API Decimal(double);\n    MFBT_API Decimal compareTo(const Decimal&) const;\n\n    static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);\n    static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; }\n\n    Sign sign() const { return m_data.sign(); }\n\n    EncodedData m_data;\n};\n\n} // namespace WebCore\n\nnamespace mozilla {\n  typedef WebCore::Decimal Decimal;\n}\n\n#undef WTF_MAKE_FAST_ALLOCATED\n\n#ifdef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef ASSERT\n#endif\n\n#endif // Decimal_h\n\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Endian.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Functions for reading and writing integers in various endiannesses. */\n\n/*\n * The classes LittleEndian and BigEndian expose static methods for\n * reading and writing 16-, 32-, and 64-bit signed and unsigned integers\n * in their respective endianness.  The naming scheme is:\n *\n * {Little,Big}Endian::{read,write}{Uint,Int}<bitsize>\n *\n * For instance, LittleEndian::readInt32 will read a 32-bit signed\n * integer from memory in little endian format.  Similarly,\n * BigEndian::writeUint16 will write a 16-bit unsigned integer to memory\n * in big-endian format.\n *\n * The class NativeEndian exposes methods for conversion of existing\n * data to and from the native endianness.  These methods are intended\n * for cases where data needs to be transferred, serialized, etc.\n * swap{To,From}{Little,Big}Endian byteswap a single value if necessary.\n * Bulk conversion functions are also provided which optimize the\n * no-conversion-needed case:\n *\n * - copyAndSwap{To,From}{Little,Big}Endian;\n * - swap{To,From}{Little,Big}EndianInPlace.\n *\n * The *From* variants are intended to be used for reading data and the\n * *To* variants for writing data.\n *\n * Methods on NativeEndian work with integer data of any type.\n * Floating-point data is not supported.\n *\n * For clarity in networking code, \"Network\" may be used as a synonym\n * for \"Big\" in any of the above methods or class names.\n *\n * As an example, reading a file format header whose fields are stored\n * in big-endian format might look like:\n *\n * class ExampleHeader\n * {\n *   private:\n *     uint32_t magic;\n *     uint32_t length;\n *     uint32_t totalRecords;\n *     uint64_t checksum;\n *\n *   public:\n *     ExampleHeader(const void* data) {\n *       const uint8_t* ptr = static_cast<const uint8_t*>(data);\n *       magic = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       length = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       totalRecords = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       checksum = BigEndian::readUint64(ptr);\n *     }\n *     ...\n * };\n */\n\n#ifndef mozilla_Endian_h\n#define mozilla_Endian_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n#include <string.h>\n\n#if defined(_MSC_VER) && _MSC_VER >= 1300\n#  include <stdlib.h>\n#  pragma intrinsic(_byteswap_ushort)\n#  pragma intrinsic(_byteswap_ulong)\n#  pragma intrinsic(_byteswap_uint64)\n#endif\n\n#if defined(_WIN64)\n#  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(_WIN32)\n#  if defined(_M_IX86)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(__APPLE__)\n#  if __LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  endif\n#elif defined(__GNUC__) && \\\n      defined(__BYTE_ORDER__) && \\\n      defined(__ORDER_LITTLE_ENDIAN__) && \\\n      defined(__ORDER_BIG_ENDIAN__)\n   /*\n    * Some versions of GCC provide architecture-independent macros for\n    * this.  Yes, there are more than two values for __BYTE_ORDER__.\n    */\n#  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  else\n#    error \"Can't handle mixed-endian architectures\"\n#  endif\n/*\n * We can't include useful headers like <endian.h> or <sys/isa_defs.h>\n * here because they're not present on all platforms.  Instead we have\n * this big conditional that ideally will catch all the interesting\n * cases.\n */\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(__ARMEB__) || \\\n      defined(__s390__) || \\\n      (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \\\n      (defined(__ia64) && defined(__BIG_ENDIAN__))\n#  define MOZ_BIG_ENDIAN 1\n#elif defined(__i386) || defined(__i386__) || \\\n      defined(__x86_64) || defined(__x86_64__) || \\\n      defined(_MIPSEL) || defined(__ARMEL__) || \\\n      defined(__alpha__) || \\\n      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \\\n      (defined(__ia64) && !defined(__BIG_ENDIAN__))\n#  define MOZ_LITTLE_ENDIAN 1\n#endif\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_LITTLE_ENDIAN 0\n#elif MOZ_LITTLE_ENDIAN\n#  define MOZ_BIG_ENDIAN 0\n#else\n#  error \"Cannot determine endianness\"\n#endif\n\n#if defined(__clang__)\n#  if __has_builtin(__builtin_bswap16)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(__GNUC__)\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(_MSC_VER)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n/*\n * We need wrappers here because free functions with default template\n * arguments and/or partial specialization of function templates are not\n * supported by all the compilers we use.\n */\ntemplate<typename T, size_t Size = sizeof(T)>\nstruct Swapper;\n\ntemplate<typename T>\nstruct Swapper<T, 2>\n{\n  static T swap(T value)\n  {\n#if defined(MOZ_HAVE_BUILTIN_BYTESWAP16)\n    return MOZ_HAVE_BUILTIN_BYTESWAP16(value);\n#else\n    return T(((value & 0x00ff) << 8) | ((value & 0xff00) >> 8));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 4>\n{\n  static T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap32(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_ulong(value));\n#else\n    return T(((value & 0x000000ffU) << 24) |\n             ((value & 0x0000ff00U) << 8) |\n             ((value & 0x00ff0000U) >> 8) |\n             ((value & 0xff000000U) >> 24));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 8>\n{\n  static inline T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap64(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_uint64(value));\n#else\n    return T(((value & 0x00000000000000ffULL) << 56) |\n             ((value & 0x000000000000ff00ULL) << 40) |\n             ((value & 0x0000000000ff0000ULL) << 24) |\n             ((value & 0x00000000ff000000ULL) << 8) |\n             ((value & 0x000000ff00000000ULL) >> 8) |\n             ((value & 0x0000ff0000000000ULL) >> 24) |\n             ((value & 0x00ff000000000000ULL) >> 40) |\n             ((value & 0xff00000000000000ULL) >> 56));\n#endif\n  }\n};\n\nenum Endianness { Little, Big };\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_NATIVE_ENDIANNESS detail::Big\n#else\n#  define MOZ_NATIVE_ENDIANNESS detail::Little\n#endif\n\nclass EndianUtils\n{\n    /**\n     * Assert that the memory regions [dest, dest+count) and [src, src+count]\n     * do not overlap.  count is given in bytes.\n     */\n    static void assertNoOverlap(const void* dest, const void* src, size_t count)\n    {\n      DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(dest);\n      DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(src);\n      MOZ_ASSERT((byteDestPtr < byteSrcPtr &&\n                  byteDestPtr + count <= byteSrcPtr) ||\n                 (byteSrcPtr < byteDestPtr &&\n                  byteSrcPtr + count <= byteDestPtr));\n    }\n\n    template<typename T>\n    static void assertAligned(T* ptr)\n    {\n      MOZ_ASSERT((uintptr_t(ptr) % sizeof(T)) == 0, \"Unaligned pointer!\");\n    }\n\n  protected:\n    /**\n     * Return |value| converted from SourceEndian encoding to DestEndian\n     * encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline T maybeSwap(T value)\n    {\n      if (SourceEndian == DestEndian)\n        return value;\n\n      return Swapper<T>::swap(value);\n    }\n\n    /**\n     * Convert |count| elements at |ptr| from SourceEndian encoding to\n     * DestEndian encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline void maybeSwapInPlace(T* ptr, size_t count)\n    {\n      assertAligned(ptr);\n\n      if (SourceEndian == DestEndian)\n        return;\n\n      for (size_t i = 0; i < count; i++)\n        ptr[i] = Swapper<T>::swap(ptr[i]);\n    }\n\n    /**\n     * Write |count| elements to the unaligned address |dest| in DestEndian\n     * format, using elements found at |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapTo(void* dest, const T* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(src);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      uint8_t* byteDestPtr = static_cast<uint8_t*>(dest);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        u.val = maybeSwap<SourceEndian, DestEndian>(src[i]);\n        memcpy(byteDestPtr, u.buffer, sizeof(T));\n        byteDestPtr += sizeof(T);\n      }\n    }\n\n    /**\n     * Write |count| elements to |dest| in DestEndian format, using elements\n     * found at the unaligned address |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapFrom(T* dest, const void* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(dest);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      const uint8_t* byteSrcPtr = static_cast<const uint8_t*>(src);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        memcpy(u.buffer, byteSrcPtr, sizeof(T));\n        dest[i] = maybeSwap<SourceEndian, DestEndian>(u.val);\n        byteSrcPtr += sizeof(T);\n      }\n    }\n};\n\ntemplate<Endianness ThisEndian>\nclass Endian : private EndianUtils\n{\n  protected:\n    /** Read a uint16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* p) {\n      return read<uint16_t>(p);\n    }\n\n    /** Read a uint32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read a uint64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* p) {\n      return read<uint64_t>(p);\n    }\n\n    /** Read an int16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* p) {\n      return read<int16_t>(p);\n    }\n\n    /** Read an int32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read an int64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* p) {\n      return read<int64_t>(p);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint16(void* p, uint16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint32(void* p, uint32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint64(void* p, uint64_t val) {\n      write(p, val);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt16(void* p, int16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt32(void* p, int32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt64(void* p, int64_t val) {\n      write(p, val);\n    }\n\n    /*\n     * Converts a value of type T to little-endian format.\n     *\n     * This function is intended for cases where you have data in your\n     * native-endian format and you need it to appear in little-endian\n     * format for transmission.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T value) {\n      return maybeSwap<ThisEndian, Little>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToLittleEndian(void* dest, const T* src,\n                                          size_t count) {\n      copyAndSwapTo<ThisEndian, Little>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Little>(p, count);\n    }\n\n    /*\n     * Converts a value of type T to big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T value) {\n      return maybeSwap<ThisEndian, Big>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToBigEndian(void* dest, const T* src, size_t count) {\n      copyAndSwapTo<ThisEndian, Big>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Big>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T value) {\n      return swapToBigEndian(value);\n    }\n    template<typename T>\n    static void\n    copyAndSwapToNetworkOrder(void* dest, const T* src, size_t count) {\n      copyAndSwapToBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void\n    swapToNetworkOrderInPlace(T* p, size_t count) {\n      swapToBigEndianInPlace(p, count);\n    }\n\n    /*\n     * Converts a value of type T from little-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T value) {\n      return maybeSwap<Little, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromLittleEndian(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFrom<Little, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Little, ThisEndian>(p, count);\n    }\n\n    /*\n     * Converts a value of type T from big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T value) {\n      return maybeSwap<Big, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromBigEndian(T* dest, const void* src,\n                                         size_t count) {\n      copyAndSwapFrom<Big, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Big, ThisEndian>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T value) {\n      return swapFromBigEndian(value);\n    }\n    template<typename T>\n    static void copyAndSwapFromNetworkOrder(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFromBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void swapFromNetworkOrderInPlace(T* p, size_t count) {\n      swapFromBigEndianInPlace(p, count);\n    }\n\n  private:\n    /**\n     * Read a value of type T, encoded in endianness ThisEndian from |p|.\n     * Return that value encoded in native endianness.\n     */\n    template<typename T>\n    static T read(const void* p) {\n      union {\n        T val;\n        uint8_t buffer[sizeof(T)];\n      } u;\n      memcpy(u.buffer, p, sizeof(T));\n      return maybeSwap<ThisEndian, MOZ_NATIVE_ENDIANNESS>(u.val);\n    }\n\n    /**\n     * Write a value of type T, in native endianness, to |p|, in ThisEndian\n     * endianness.\n     */\n    template<typename T>\n    static void write(void* p, T value) {\n      T tmp = maybeSwap<MOZ_NATIVE_ENDIANNESS, ThisEndian>(value);\n      memcpy(p, &tmp, sizeof(T));\n    }\n\n    Endian() MOZ_DELETE;\n    Endian(const Endian& other) MOZ_DELETE;\n    void operator=(const Endian& other) MOZ_DELETE;\n};\n\ntemplate<Endianness ThisEndian>\nclass EndianReadWrite : public Endian<ThisEndian>\n{\n  private:\n    typedef Endian<ThisEndian> super;\n\n  public:\n    using super::readUint16;\n    using super::readUint32;\n    using super::readUint64;\n    using super::readInt16;\n    using super::readInt32;\n    using super::readInt64;\n    using super::writeUint16;\n    using super::writeUint32;\n    using super::writeUint64;\n    using super::writeInt16;\n    using super::writeInt32;\n    using super::writeInt64;\n};\n\n} /* namespace detail */\n\nclass LittleEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Little>\n{};\n\nclass BigEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Big>\n{};\n\ntypedef BigEndian NetworkEndian;\n\nclass NativeEndian MOZ_FINAL : public detail::Endian<MOZ_NATIVE_ENDIANNESS>\n{\n  private:\n    typedef detail::Endian<MOZ_NATIVE_ENDIANNESS> super;\n\n  public:\n    /*\n     * These functions are intended for cases where you have data in your\n     * native-endian format and you need the data to appear in the appropriate\n     * endianness for transmission, serialization, etc.\n     */\n    using super::swapToLittleEndian;\n    using super::copyAndSwapToLittleEndian;\n    using super::swapToLittleEndianInPlace;\n    using super::swapToBigEndian;\n    using super::copyAndSwapToBigEndian;\n    using super::swapToBigEndianInPlace;\n    using super::swapToNetworkOrder;\n    using super::copyAndSwapToNetworkOrder;\n    using super::swapToNetworkOrderInPlace;\n\n    /*\n     * These functions are intended for cases where you have data in the\n     * given endianness (e.g. reading from disk or a file-format) and you\n     * need the data to appear in native-endian format for processing.\n     */\n    using super::swapFromLittleEndian;\n    using super::copyAndSwapFromLittleEndian;\n    using super::swapFromLittleEndianInPlace;\n    using super::swapFromBigEndian;\n    using super::copyAndSwapFromBigEndian;\n    using super::swapFromBigEndianInPlace;\n    using super::swapFromNetworkOrder;\n    using super::copyAndSwapFromNetworkOrder;\n    using super::swapFromNetworkOrderInPlace;\n};\n\n#undef MOZ_NATIVE_ENDIANNESS\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Endian_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/EnumSet.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A set abstraction for enumeration values. */\n\n#ifndef mozilla_EnumSet_h\n#define mozilla_EnumSet_h\n\n#include \"mozilla/Assertions.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * EnumSet<T> is a set of values defined by an enumeration. It is implemented\n * using a 32 bit mask for each value so it will only work for enums with an int\n * representation less than 32. It works both for enum and enum class types.\n */\ntemplate<typename T>\nclass EnumSet\n{\n  public:\n    EnumSet()\n      : mBitField(0)\n    { }\n\n    EnumSet(T aEnum)\n      : mBitField(aEnum)\n    { }\n\n    EnumSet(T aEnum1, T aEnum2)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2) |\n                  bitFor(aEnum3))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3, T aEnum4)\n     : mBitField(bitFor(aEnum1) |\n                 bitFor(aEnum2) |\n                 bitFor(aEnum3) |\n                 bitFor(aEnum4))\n    { }\n\n    EnumSet(const EnumSet& aEnumSet)\n     : mBitField(aEnumSet.mBitField)\n    { }\n\n    /**\n     * Add an element\n     */\n    void operator+=(T aEnum) {\n      mBitField |= bitFor(aEnum);\n    }\n\n    /**\n     * Add an element\n     */\n    EnumSet<T> operator+(T aEnum) const {\n      EnumSet<T> result(*this);\n      result += aEnum;\n      return result;\n    }\n\n    /**\n     * Union\n     */\n    void operator+=(const EnumSet<T> aEnumSet) {\n      mBitField |= aEnumSet.mBitField;\n    }\n\n    /**\n     * Union\n     */\n    EnumSet<T> operator+(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result += aEnumSet;\n      return result;\n    }\n\n    /**\n     * Remove an element\n     */\n    void operator-=(T aEnum) {\n      mBitField &= ~(bitFor(aEnum));\n    }\n\n    /**\n     * Remove an element\n     */\n    EnumSet<T> operator-(T aEnum) const {\n      EnumSet<T> result(*this);\n      result -= aEnum;\n      return result;\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    void operator-=(const EnumSet<T> aEnumSet) {\n      mBitField &= ~(aEnumSet.mBitField);\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    EnumSet<T> operator-(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result -= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Intersection\n     */\n    void operator&=(const EnumSet<T> aEnumSet) {\n      mBitField &= aEnumSet.mBitField;\n    }\n\n    /**\n     * Intersection\n     */\n    EnumSet<T> operator&(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result &= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Equality\n     */\n\n    bool operator==(const EnumSet<T> aEnumSet) const {\n      return mBitField == aEnumSet.mBitField;\n    }\n\n    /**\n     * Test is an element is contained in the set\n     */\n    bool contains(T aEnum) const {\n      return mBitField & bitFor(aEnum);\n    }\n\n    /**\n     * Return the number of elements in the set\n     */\n\n    uint8_t size() {\n      uint8_t count = 0;\n      for (uint32_t bitField = mBitField; bitField; bitField >>= 1) {\n        if (bitField & 1)\n          count++;\n      }\n      return count;\n    }\n\n  private:\n    static uint32_t bitFor(T aEnum) {\n      uint32_t bitNumber(aEnum);\n      MOZ_ASSERT(bitNumber < 32);\n      return 1U << bitNumber;\n    }\n\n    uint32_t mBitField;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_EnumSet_h_*/\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/FloatingPoint.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various predicates and operations on IEEE-754 floating point types. */\n\n#ifndef mozilla_FloatingPoint_h\n#define mozilla_FloatingPoint_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/*\n * It's reasonable to ask why we have this header at all.  Don't isnan,\n * copysign, the built-in comparison operators, and the like solve these\n * problems?  Unfortunately, they don't.  We've found that various compilers\n * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile\n * the standard methods in various situations, so we can't use them.  Some of\n * these compilers even have problems compiling seemingly reasonable bitwise\n * algorithms!  But with some care we've found algorithms that seem to not\n * trigger those compiler bugs.\n *\n * For the aforementioned reasons, be very wary of making changes to any of\n * these algorithms.  If you must make changes, keep a careful eye out for\n * compiler bustage, particularly PGO-specific bustage.\n */\n\n/*\n * These implementations all assume |double| is a 64-bit double format number\n * type, compatible with the IEEE-754 standard.  C/C++ don't require this to be\n * the case.  But we required this in implementations of these algorithms that\n * preceded this header, so we shouldn't break anything if we continue doing so.\n */\nstatic_assert(sizeof(double) == sizeof(uint64_t), \"double must be 64 bits\");\n\nconst unsigned DoubleExponentBias = 1023;\nconst unsigned DoubleExponentShift = 52;\n\nconst uint64_t DoubleSignBit         = 0x8000000000000000ULL;\nconst uint64_t DoubleExponentBits    = 0x7ff0000000000000ULL;\nconst uint64_t DoubleSignificandBits = 0x000fffffffffffffULL;\n\nstatic_assert((DoubleSignBit & DoubleExponentBits) == 0,\n              \"sign bit doesn't overlap exponent bits\");\nstatic_assert((DoubleSignBit & DoubleSignificandBits) == 0,\n              \"sign bit doesn't overlap significand bits\");\nstatic_assert((DoubleExponentBits & DoubleSignificandBits) == 0,\n              \"exponent bits don't overlap significand bits\");\n\nstatic_assert((DoubleSignBit | DoubleExponentBits | DoubleSignificandBits) ==\n              ~uint64_t(0),\n              \"all bits accounted for\");\n\n/** Determines whether a double is NaN. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNaN(double d)\n{\n  /*\n   * A double is NaN if all exponent bits are 1 and the significand contains at\n   * least one non-zero bit.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) == DoubleExponentBits &&\n         (bits & DoubleSignificandBits) != 0;\n}\n\n/** Determines whether a double is +Infinity or -Infinity. */\nstatic MOZ_ALWAYS_INLINE bool\nIsInfinite(double d)\n{\n  /* Infinities have all exponent bits set to 1 and an all-0 significand. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & ~DoubleSignBit) == DoubleExponentBits;\n}\n\n/** Determines whether a double is not NaN or infinite. */\nstatic MOZ_ALWAYS_INLINE bool\nIsFinite(double d)\n{\n  /*\n   * NaN and Infinities are the only non-finite doubles, and both have all\n   * exponent bits set to 1.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) != DoubleExponentBits;\n}\n\n/**\n * Determines whether a double is negative.  It is an error to call this method\n * on a double which is NaN.\n */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegative(double d)\n{\n  MOZ_ASSERT(!IsNaN(d), \"NaN does not have a sign\");\n\n  /* The sign bit is set if the double is negative. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleSignBit) != 0;\n}\n\n/** Determines whether a double represents -0. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegativeZero(double d)\n{\n  /* Only the sign bit is set if the double is -0. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return bits == DoubleSignBit;\n}\n\n/** Returns the exponent portion of the double. */\nstatic MOZ_ALWAYS_INLINE int_fast16_t\nExponentComponent(double d)\n{\n  /*\n   * The exponent component of a double is an unsigned number, biased from its\n   * actual value.  Subtract the bias to retrieve the actual exponent.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return int_fast16_t((bits & DoubleExponentBits) >> DoubleExponentShift) -\n         int_fast16_t(DoubleExponentBias);\n}\n\n/** Returns +Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nPositiveInfinity()\n{\n  /*\n   * Positive infinity has all exponent bits set, sign bit set to 0, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleExponentBits);\n}\n\n/** Returns -Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nNegativeInfinity()\n{\n  /*\n   * Negative infinity has all exponent bits set, sign bit set to 1, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleSignBit | DoubleExponentBits);\n}\n\n/** Constructs a NaN value with the specified sign bit and significand bits. */\nstatic MOZ_ALWAYS_INLINE double\nSpecificNaN(int signbit, uint64_t significand)\n{\n  MOZ_ASSERT(signbit == 0 || signbit == 1);\n  MOZ_ASSERT((significand & ~DoubleSignificandBits) == 0);\n  MOZ_ASSERT(significand & DoubleSignificandBits);\n\n  double d = BitwiseCast<double>((signbit ? DoubleSignBit : 0) |\n                                 DoubleExponentBits |\n                                 significand);\n  MOZ_ASSERT(IsNaN(d));\n  return d;\n}\n\n/** Computes the smallest non-zero positive double value. */\nstatic MOZ_ALWAYS_INLINE double\nMinDoubleValue()\n{\n  return BitwiseCast<double>(uint64_t(1));\n}\n\nstatic MOZ_ALWAYS_INLINE bool\nDoubleIsInt32(double d, int32_t* i)\n{\n  /*\n   * XXX Casting a double that doesn't truncate to int32_t, to int32_t, induces\n   *     undefined behavior.  We should definitely fix this (bug 744965), but as\n   *     apparently it \"works\" in practice, it's not a pressing concern now.\n   */\n  return !IsNegativeZero(d) && d == (*i = int32_t(d));\n}\n\n/**\n * Computes a NaN value.  Do not use this method if you depend upon a particular\n * NaN value being returned.\n */\nstatic MOZ_ALWAYS_INLINE double\nUnspecifiedNaN()\n{\n  return SpecificNaN(0, 0xfffffffffffffULL);\n}\n\n/**\n * Compare two doubles for equality, *without* equating -0 to +0, and equating\n * any NaN value to any other NaN value.  (The normal equality operators equate\n * -0 with +0, and they equate NaN to no other value.)\n */\nstatic inline bool\nDoublesAreIdentical(double d1, double d2)\n{\n  if (IsNaN(d1))\n    return IsNaN(d2);\n  return BitwiseCast<uint64_t>(d1) == BitwiseCast<uint64_t>(d2);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_FloatingPoint_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/GuardObjects.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementation of macros to ensure correct use of RAII Auto* objects. */\n\n#ifndef mozilla_GuardObjects_h\n#define mozilla_GuardObjects_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\n#ifdef DEBUG\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The following classes are designed to cause assertions to detect\n * inadvertent use of guard objects as temporaries. In other words,\n * when we have a guard object whose only purpose is its constructor and\n * destructor (and is never otherwise referenced), the intended use\n * might be:\n *\n *   AutoRestore savePainting(mIsPainting);\n *\n * but is is easy to accidentally write:\n *\n *   AutoRestore(mIsPainting);\n *\n * which compiles just fine, but runs the destructor well before the\n * intended time.\n *\n * They work by adding (#ifdef DEBUG) an additional parameter to the\n * guard object's constructor, with a default value, so that users of\n * the guard object's API do not need to do anything. The default value\n * of this parameter is a temporary object. C++ (ISO/IEC 14882:1998),\n * section 12.2 [class.temporary], clauses 4 and 5 seem to assume a\n * guarantee that temporaries are destroyed in the reverse of their\n * construction order, but I actually can't find a statement that that\n * is true in the general case (beyond the two specific cases mentioned\n * there). However, it seems to be true.\n *\n * These classes are intended to be used only via the macros immediately\n * below them:\n *\n *   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member\n *     variable, and should be put where a declaration of a private\n *     member variable would be placed.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the\n *     parameters to each constructor of the guard object; it declares\n *     (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM\n *     variant for constructors that take no other parameters.)\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in\n *     the implementation of such constructors when they are not inline.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in\n *     the implementation of such constructors to pass the parameter to\n *     a base class that also uses these macros\n *   MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each\n *     constructor. It uses the parameter declared by\n *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.\n *\n * For more details, and examples of using these macros, see\n * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla\n */\nclass MOZ_EXPORT GuardObjectNotifier\n{\n  private:\n    bool* statementDone;\n\n  public:\n    GuardObjectNotifier() : statementDone(nullptr) { }\n\n    ~GuardObjectNotifier() {\n      *statementDone = true;\n    }\n\n    void setStatementDone(bool* statementIsDone) {\n      statementDone = statementIsDone;\n    }\n};\n\nclass MOZ_EXPORT GuardObjectNotificationReceiver\n{\n  private:\n    bool statementDone;\n\n  public:\n    GuardObjectNotificationReceiver() : statementDone(false) { }\n\n    ~GuardObjectNotificationReceiver() {\n      /*\n       * Assert that the guard object was not used as a temporary.  (Note that\n       * this assert might also fire if init is not called because the guard\n       * object's implementation is not using the above macros correctly.)\n       */\n      MOZ_ASSERT(statementDone);\n    }\n\n    void init(const GuardObjectNotifier& constNotifier) {\n      /*\n       * constNotifier is passed as a const reference so that we can pass a\n       * temporary, but we really intend it as non-const.\n       */\n      GuardObjectNotifier& notifier = const_cast<GuardObjectNotifier&>(constNotifier);\n      notifier.setStatementDone(&statementDone);\n    }\n};\n\n} /* namespace detail */\n} /* namespace mozilla */\n\n#endif /* DEBUG */\n\n#ifdef DEBUG\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \\\n     mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary;\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \\\n     const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \\\n     const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \\\n     , _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \\\n       _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT \\\n     do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0)\n#else\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_GuardObjects_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/HashFunctions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Utilities for hashing. */\n\n/*\n * This file exports functions for hashing data down to a 32-bit value,\n * including:\n *\n *  - HashString    Hash a char* or uint16_t/wchar_t* of known or unknown\n *                  length.\n *\n *  - HashBytes     Hash a byte array of known length.\n *\n *  - HashGeneric   Hash one or more values.  Currently, we support uint32_t,\n *                  types which can be implicitly cast to uint32_t, data\n *                  pointers, and function pointers.\n *\n *  - AddToHash     Add one or more values to the given hash.  This supports the\n *                  same list of types as HashGeneric.\n *\n *\n * You can chain these functions together to hash complex objects.  For example:\n *\n *  class ComplexObject\n *  {\n *      char* str;\n *      uint32_t uint1, uint2;\n *      void (*callbackFn)();\n *\n *    public:\n *      uint32_t hash() {\n *        uint32_t hash = HashString(str);\n *        hash = AddToHash(hash, uint1, uint2);\n *        return AddToHash(hash, callbackFn);\n *      }\n *  };\n *\n * If you want to hash an nsAString or nsACString, use the HashString functions\n * in nsHashKeys.h.\n */\n\n#ifndef mozilla_HashFunctions_h\n#define mozilla_HashFunctions_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\n#ifdef __cplusplus\nnamespace mozilla {\n\n/**\n * The golden ratio as a 32-bit fixed-point value.\n */\nstatic const uint32_t GoldenRatioU32 = 0x9E3779B9U;\n\ninline uint32_t\nRotateBitsLeft32(uint32_t value, uint8_t bits)\n{\n  MOZ_ASSERT(bits < 32);\n  return (value << bits) | (value >> (32 - bits));\n}\n\nnamespace detail {\n\ninline uint32_t\nAddU32ToHash(uint32_t hash, uint32_t value)\n{\n  /*\n   * This is the meat of all our hash routines.  This hash function is not\n   * particularly sophisticated, but it seems to work well for our mostly\n   * plain-text inputs.  Implementation notes follow.\n   *\n   * Our use of the golden ratio here is arbitrary; we could pick almost any\n   * number which:\n   *\n   *  * is odd (because otherwise, all our hash values will be even)\n   *\n   *  * has a reasonably-even mix of 1's and 0's (consider the extreme case\n   *    where we multiply by 0x3 or 0xeffffff -- this will not produce good\n   *    mixing across all bits of the hash).\n   *\n   * The rotation length of 5 is also arbitrary, although an odd number is again\n   * preferable so our hash explores the whole universe of possible rotations.\n   *\n   * Finally, we multiply by the golden ratio *after* xor'ing, not before.\n   * Otherwise, if |hash| is 0 (as it often is for the beginning of a message),\n   * the expression\n   *\n   *   (GoldenRatioU32 * RotateBitsLeft(hash, 5)) |xor| value\n   *\n   * evaluates to |value|.\n   *\n   * (Number-theoretic aside: Because any odd number |m| is relatively prime to\n   * our modulus (2^32), the list\n   *\n   *    [x * m (mod 2^32) for 0 <= x < 2^32]\n   *\n   * has no duplicate elements.  This means that multiplying by |m| does not\n   * cause us to skip any possible hash values.\n   *\n   * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the\n   * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely\n   * multiply our hash value by |m| a few times without negating the\n   * multiplicative effect.  Our golden ratio constant has order 2^29, which is\n   * more than enough for our purposes.)\n   */\n  return GoldenRatioU32 * (RotateBitsLeft32(hash, 5) ^ value);\n}\n\n/**\n * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter.\n */\ntemplate<size_t PtrSize>\ninline uint32_t\nAddUintptrToHash(uint32_t hash, uintptr_t value);\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<4>(uint32_t hash, uintptr_t value)\n{\n  return AddU32ToHash(hash, static_cast<uint32_t>(value));\n}\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<8>(uint32_t hash, uintptr_t value)\n{\n  /*\n   * The static cast to uint64_t below is necessary because this function\n   * sometimes gets compiled on 32-bit platforms (yes, even though it's a\n   * template and we never call this particular override in a 32-bit build).  If\n   * we do value >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t\n   * right 32 bits, and the compiler throws an error.\n   */\n  uint32_t v1 = static_cast<uint32_t>(value);\n  uint32_t v2 = static_cast<uint32_t>(static_cast<uint64_t>(value) >> 32);\n  return AddU32ToHash(AddU32ToHash(hash, v1), v2);\n}\n\n} /* namespace detail */\n\n/**\n * AddToHash takes a hash and some values and returns a new hash based on the\n * inputs.\n *\n * Currently, we support hashing uint32_t's, values which we can implicitly\n * convert to uint32_t, data pointers, and function pointers.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A a)\n{\n  /*\n   * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,\n   * we'll error out.\n   */\n  return detail::AddU32ToHash(hash, a);\n}\n\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A* a)\n{\n  /*\n   * You might think this function should just take a void*.  But then we'd only\n   * catch data pointers and couldn't handle function pointers.\n   */\n\n  static_assert(sizeof(a) == sizeof(uintptr_t),\n                \"Strange pointer!\");\n\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, uintptr_t(a));\n}\n\ntemplate<>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, uintptr_t a)\n{\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b)\n{\n  return AddToHash(AddToHash(hash, a), b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c)\n{\n  return AddToHash(AddToHash(hash, a, b), c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d)\n{\n  return AddToHash(AddToHash(hash, a, b, c), d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d, E e)\n{\n  return AddToHash(AddToHash(hash, a, b, c, d), e);\n}\n\n/**\n * The HashGeneric class of functions let you hash one or more values.\n *\n * If you want to hash together two values x and y, calling HashGeneric(x, y) is\n * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes\n * that x has already been hashed.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a)\n{\n  return AddToHash(0, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b)\n{\n  return AddToHash(0, a, b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c)\n{\n  return AddToHash(0, a, b, c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d)\n{\n  return AddToHash(0, a, b, c, d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d, E e)\n{\n  return AddToHash(0, a, b, c, d, e);\n}\n\nnamespace detail {\n\ntemplate<typename T>\nuint32_t\nHashUntilZero(const T* str)\n{\n  uint32_t hash = 0;\n  for (T c; (c = *str); str++)\n    hash = AddToHash(hash, c);\n  return hash;\n}\n\ntemplate<typename T>\nuint32_t\nHashKnownLength(const T* str, size_t length)\n{\n  uint32_t hash = 0;\n  for (size_t i = 0; i < length; i++)\n    hash = AddToHash(hash, str[i]);\n  return hash;\n}\n\n} /* namespace detail */\n\n/**\n * The HashString overloads below do just what you'd expect.\n *\n * If you have the string's length, you might as well call the overload which\n * includes the length.  It may be marginally faster.\n */\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\n/*\n * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's\n * the same width!\n */\n#ifdef WIN32\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n#endif\n\n/**\n * Hash some number of bytes.\n *\n * This hash walks word-by-word, rather than byte-by-byte, so you won't get the\n * same result out of HashBytes as you would out of HashString.\n */\nMOZ_WARN_UNUSED_RESULT\nextern MFBT_API uint32_t\nHashBytes(const void* bytes, size_t length);\n\n} /* namespace mozilla */\n#endif /* __cplusplus */\n\n#endif /* mozilla_HashFunctions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Likely.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a\n * boolean predicate should be branch-predicted.\n */\n\n#ifndef mozilla_Likely_h\n#define mozilla_Likely_h\n\n#if defined(__clang__) || defined(__GNUC__)\n#  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))\n#  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))\n#else\n#  define MOZ_LIKELY(x)   (!!(x))\n#  define MOZ_UNLIKELY(x) (!!(x))\n#endif\n\n#endif /* mozilla_Likely_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/LinkedList.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type-safe doubly-linked list class. */\n\n/*\n * The classes LinkedList<T> and LinkedListElement<T> together form a\n * convenient, type-safe doubly-linked list implementation.\n *\n * The class T which will be inserted into the linked list must inherit from\n * LinkedListElement<T>.  A given object may be in only one linked list at a\n * time.\n *\n * A LinkedListElement automatically removes itself from the list upon\n * destruction, and a LinkedList will fatally assert in debug builds if it's\n * non-empty when it's destructed.\n *\n * For example, you might use LinkedList in a simple observer list class as\n * follows.\n *\n *   class Observer : public LinkedListElement<Observer>\n *   {\n *     public:\n *       void observe(char* topic) { ... }\n *   };\n *\n *   class ObserverContainer\n *   {\n *     private:\n *       LinkedList<Observer> list;\n *\n *     public:\n *       void addObserver(Observer* observer) {\n *         // Will assert if |observer| is part of another list.\n *         list.insertBack(observer);\n *       }\n *\n *       void removeObserver(Observer* observer) {\n *         // Will assert if |observer| is not part of some list.\n *         observer.remove();\n *         // Or, will assert if |observer| is not part of |list| specifically.\n *         // observer.removeFrom(list);\n *       }\n *\n *       void notifyObservers(char* topic) {\n *         for (Observer* o = list.getFirst(); o != nullptr; o = o->getNext())\n *           o->observe(topic);\n *       }\n *   };\n *\n */\n\n#ifndef mozilla_LinkedList_h\n#define mozilla_LinkedList_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\ntemplate<typename T>\nclass LinkedList;\n\ntemplate<typename T>\nclass LinkedListElement\n{\n    /*\n     * It's convenient that we return nullptr when getNext() or getPrevious()\n     * hits the end of the list, but doing so costs an extra word of storage in\n     * each linked list node (to keep track of whether |this| is the sentinel\n     * node) and a branch on this value in getNext/getPrevious.\n     *\n     * We could get rid of the extra word of storage by shoving the \"is\n     * sentinel\" bit into one of the pointers, although this would, of course,\n     * have performance implications of its own.\n     *\n     * But the goal here isn't to win an award for the fastest or slimmest\n     * linked list; rather, we want a *convenient* linked list.  So we won't\n     * waste time guessing which micro-optimization strategy is best.\n     *\n     *\n     * Speaking of unnecessary work, it's worth addressing here why we wrote\n     * mozilla::LinkedList in the first place, instead of using stl::list.\n     *\n     * The key difference between mozilla::LinkedList and stl::list is that\n     * mozilla::LinkedList stores the prev/next pointers in the object itself,\n     * while stl::list stores the prev/next pointers in a list element which\n     * itself points to the object being stored.\n     *\n     * mozilla::LinkedList's approach makes it harder to store an object in more\n     * than one list.  But the upside is that you can call next() / prev() /\n     * remove() directly on the object.  With stl::list, you'd need to store a\n     * pointer to its iterator in the object in order to accomplish this.  Not\n     * only would this waste space, but you'd have to remember to update that\n     * pointer every time you added or removed the object from a list.\n     *\n     * In-place, constant-time removal is a killer feature of doubly-linked\n     * lists, and supporting this painlessly was a key design criterion.\n     */\n\n  private:\n    LinkedListElement* next;\n    LinkedListElement* prev;\n    const bool isSentinel;\n\n  public:\n    LinkedListElement()\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(false)\n    { }\n\n    ~LinkedListElement() {\n      if (!isSentinel && isInList())\n        remove();\n    }\n\n    /*\n     * Get the next element in the list, or nullptr if this is the last element\n     * in the list.\n     */\n    T* getNext() {\n      return next->asT();\n    }\n    const T* getNext() const {\n      return next->asT();\n    }\n\n    /*\n     * Get the previous element in the list, or nullptr if this is the first\n     * element in the list.\n     */\n    T* getPrevious() {\n      return prev->asT();\n    }\n    const T* getPrevious() const {\n      return prev->asT();\n    }\n\n    /*\n     * Insert elem after this element in the list.  |this| must be part of a\n     * linked list when you call setNext(); otherwise, this method will assert.\n     */\n    void setNext(T* elem) {\n        MOZ_ASSERT(isInList());\n        setNextUnsafe(elem);\n    }\n\n    /*\n     * Insert elem before this element in the list.  |this| must be part of a\n     * linked list when you call setPrevious(); otherwise, this method will\n     * assert.\n     */\n    void setPrevious(T* elem) {\n      MOZ_ASSERT(isInList());\n      setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Remove this element from the list which contains it.  If this element is\n     * not currently part of a linked list, this method asserts.\n     */\n    void remove() {\n      MOZ_ASSERT(isInList());\n\n      prev->next = next;\n      next->prev = prev;\n      next = this;\n      prev = this;\n    }\n\n    /*\n     * Identical to remove(), but also asserts in debug builds that this element\n     * is in list.\n     */\n    void removeFrom(const LinkedList<T>& list) {\n      list.assertContains(asT());\n      remove();\n    }\n\n    /*\n     * Return true if |this| part is of a linked list, and false otherwise.\n     */\n    bool isInList() const {\n      MOZ_ASSERT((next == this) == (prev == this));\n      return next != this;\n    }\n\n  private:\n    friend class LinkedList<T>;\n\n    enum NodeKind {\n      NODE_KIND_NORMAL,\n      NODE_KIND_SENTINEL\n    };\n\n    LinkedListElement(NodeKind nodeKind)\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(nodeKind == NODE_KIND_SENTINEL)\n    { }\n\n    /*\n     * Return |this| cast to T* if we're a normal node, or return nullptr if\n     * we're a sentinel node.\n     */\n    T* asT() {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<T*>(this);\n    }\n    const T* asT() const {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<const T*>(this);\n    }\n\n    /*\n     * Insert elem after this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertFront().\n     */\n    void setNextUnsafe(T* elem) {\n      LinkedListElement *listElem = static_cast<LinkedListElement*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this->next;\n      listElem->prev = this;\n      this->next->prev = listElem;\n      this->next = listElem;\n    }\n\n    /*\n     * Insert elem before this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertBack().\n     */\n    void setPreviousUnsafe(T* elem) {\n      LinkedListElement<T>* listElem = static_cast<LinkedListElement<T>*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this;\n      listElem->prev = this->prev;\n      this->prev->next = listElem;\n      this->prev = listElem;\n    }\n\n  private:\n    LinkedListElement& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedListElement(const LinkedList<T>& other) MOZ_DELETE;\n};\n\ntemplate<typename T>\nclass LinkedList\n{\n  private:\n    LinkedListElement<T> sentinel;\n\n  public:\n    LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }\n\n    ~LinkedList() {\n      MOZ_ASSERT(isEmpty());\n    }\n\n    /*\n     * Add elem to the front of the list.\n     */\n    void insertFront(T* elem) {\n      /* Bypass setNext()'s this->isInList() assertion. */\n      sentinel.setNextUnsafe(elem);\n    }\n\n    /*\n     * Add elem to the back of the list.\n     */\n    void insertBack(T* elem) {\n      sentinel.setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Get the first element of the list, or nullptr if the list is empty.\n     */\n    T* getFirst() {\n      return sentinel.getNext();\n    }\n    const T* getFirst() const {\n      return sentinel.getNext();\n    }\n\n    /*\n     * Get the last element of the list, or nullptr if the list is empty.\n     */\n    T* getLast() {\n      return sentinel.getPrevious();\n    }\n    const T* getLast() const {\n      return sentinel.getPrevious();\n    }\n\n    /*\n     * Get and remove the first element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popFirst() {\n      T* ret = sentinel.getNext();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Get and remove the last element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popLast() {\n      T* ret = sentinel.getPrevious();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Return true if the list is empty, or false otherwise.\n     */\n    bool isEmpty() const {\n      return !sentinel.isInList();\n    }\n\n    /*\n     * Remove all the elements from the list.\n     *\n     * This runs in time linear to the list's length, because we have to mark\n     * each element as not in the list.\n     */\n    void clear() {\n      while (popFirst())\n        continue;\n    }\n\n    /*\n     * In a debug build, make sure that the list is sane (no cycles, consistent\n     * next/prev pointers, only one sentinel).  Has no effect in release builds.\n     */\n    void debugAssertIsSane() const {\n#ifdef DEBUG\n      const LinkedListElement<T>* slow;\n      const LinkedListElement<T>* fast1;\n      const LinkedListElement<T>* fast2;\n\n      /*\n       * Check for cycles in the forward singly-linked list using the\n       * tortoise/hare algorithm.\n       */\n      for (slow = sentinel.next,\n           fast1 = sentinel.next->next,\n           fast2 = sentinel.next->next->next;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->next, fast1 = fast2->next, fast2 = fast1->next)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /* Check for cycles in the backward singly-linked list. */\n      for (slow = sentinel.prev,\n           fast1 = sentinel.prev->prev,\n           fast2 = sentinel.prev->prev->prev;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /*\n       * Check that |sentinel| is the only node in the list with\n       * isSentinel == true.\n       */\n      for (const LinkedListElement<T>* elem = sentinel.next;\n           elem != sentinel;\n           elem = elem->next)\n      {\n        MOZ_ASSERT(!elem->isSentinel);\n      }\n\n      /* Check that the next/prev pointers match up. */\n      const LinkedListElement<T>* prev = sentinel;\n      const LinkedListElement<T>* cur = sentinel.next;\n      do {\n          MOZ_ASSERT(cur->prev == prev);\n          MOZ_ASSERT(prev->next == cur);\n\n          prev = cur;\n          cur = cur->next;\n      } while (cur != sentinel);\n#endif /* ifdef DEBUG */\n    }\n\n  private:\n    friend class LinkedListElement<T>;\n\n    void assertContains(const T* t) const {\n#ifdef DEBUG\n      for (const T* elem = getFirst();\n           elem;\n           elem = elem->getNext())\n      {\n        if (elem == t)\n          return;\n      }\n      MOZ_CRASH(\"element wasn't found in this list!\");\n#endif\n    }\n\n    LinkedList& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedList(const LinkedList<T>& other) MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_LinkedList_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/MathAlgorithms.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt maths algorithms. */\n\n#ifndef mozilla_MathAlgorithms_h\n#define mozilla_MathAlgorithms_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <cmath>\n#include <limits.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n// Greatest Common Divisor\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidGCD(IntegerType a, IntegerType b)\n{\n  // Euclid's algorithm; O(N) in the worst case.  (There are better\n  // ways, but we don't need them for the current use of this algo.)\n  MOZ_ASSERT(a > 0);\n  MOZ_ASSERT(b > 0);\n\n  while (a != b) {\n    if (a > b) {\n      a = a - b;\n    } else {\n      b = b - a;\n    }\n  }\n\n  return a;\n}\n\n// Least Common Multiple\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidLCM(IntegerType a, IntegerType b)\n{\n  // Divide first to reduce overflow risk.\n  return (a / EuclidGCD(a, b)) * b;\n}\n\nnamespace detail {\n\ntemplate<typename T>\nstruct AllowDeprecatedAbsFixed : FalseType {};\n\ntemplate<> struct AllowDeprecatedAbsFixed<int32_t> : TrueType {};\ntemplate<> struct AllowDeprecatedAbsFixed<int64_t> : TrueType {};\n\ntemplate<typename T>\nstruct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};\n\ntemplate<> struct AllowDeprecatedAbs<int> : TrueType {};\ntemplate<> struct AllowDeprecatedAbs<long> : TrueType {};\n\n} // namespace detail\n\n// DO NOT USE DeprecatedAbs.  It exists only until its callers can be converted\n// to Abs below, and it will be removed when all callers have been changed.\ntemplate<typename T>\ninline typename mozilla::EnableIf<detail::AllowDeprecatedAbs<T>::value, T>::Type\nDeprecatedAbs(const T t)\n{\n  // The absolute value of the smallest possible value of a signed-integer type\n  // won't fit in that type (on twos-complement systems -- and we're blithely\n  // assuming we're on such systems, for the non-<stdint.h> types listed above),\n  // so assert that the input isn't that value.\n  //\n  // This is the case if: the value is non-negative; or if adding one (giving a\n  // value in the range [-maxvalue, 0]), then negating (giving a value in the\n  // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement,\n  // (minvalue + 1) == -maxvalue).\n  MOZ_ASSERT(t >= 0 ||\n             -(t + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1),\n             \"You can't negate the smallest possible negative integer!\");\n  return t >= 0 ? t : -t;\n}\n\nnamespace detail {\n\n// For now mozilla::Abs only takes intN_T, the signed natural types, and\n// float/double/long double.  Feel free to add overloads for other standard,\n// signed types if you need them.\n\ntemplate<typename T>\nstruct AbsReturnTypeFixed;\n\ntemplate<> struct AbsReturnTypeFixed<int8_t> { typedef uint8_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int16_t> { typedef uint16_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int32_t> { typedef uint32_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int64_t> { typedef uint64_t Type; };\n\ntemplate<typename T>\nstruct AbsReturnType : AbsReturnTypeFixed<T> {};\n\ntemplate<> struct AbsReturnType<char> : EnableIf<char(-1) < char(0), unsigned char> {};\ntemplate<> struct AbsReturnType<signed char> { typedef unsigned char Type; };\ntemplate<> struct AbsReturnType<short> { typedef unsigned short Type; };\ntemplate<> struct AbsReturnType<int> { typedef unsigned int Type; };\ntemplate<> struct AbsReturnType<long> { typedef unsigned long Type; };\ntemplate<> struct AbsReturnType<long long> { typedef unsigned long long Type; };\ntemplate<> struct AbsReturnType<float> { typedef float Type; };\ntemplate<> struct AbsReturnType<double> { typedef double Type; };\ntemplate<> struct AbsReturnType<long double> { typedef long double Type; };\n\n} // namespace detail\n\ntemplate<typename T>\ninline typename detail::AbsReturnType<T>::Type\nAbs(const T t)\n{\n  typedef typename detail::AbsReturnType<T>::Type ReturnType;\n  return t >= 0 ? ReturnType(t) : ~ReturnType(t) + 1;\n}\n\ntemplate<>\ninline float\nAbs<float>(const float f)\n{\n  return std::fabs(f);\n}\n\ntemplate<>\ninline double\nAbs<double>(const double d)\n{\n  return std::fabs(d);\n}\n\ntemplate<>\ninline long double\nAbs<long double>(const long double d)\n{\n  return std::fabs(d);\n}\n\n} // namespace mozilla\n\n#if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))\n#  define MOZ_BITSCAN_WINDOWS\n\n  extern \"C\" {\n    unsigned char _BitScanForward(unsigned long* Index, unsigned long mask);\n    unsigned char _BitScanReverse(unsigned long* Index, unsigned long mask);\n#  pragma intrinsic(_BitScanForward, _BitScanReverse)\n\n#  if defined(_M_AMD64) || defined(_M_X64)\n#    define MOZ_BITSCAN_WINDOWS64\n    unsigned char _BitScanForward64(unsigned long* index, unsigned __int64 mask);\n    unsigned char _BitScanReverse64(unsigned long* index, unsigned __int64 mask);\n#   pragma intrinsic(_BitScanForward64, _BitScanReverse64)\n#  endif\n  } // extern \"C\"\n\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n#if defined(MOZ_BITSCAN_WINDOWS)\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanReverse(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(31 - index);\n  }\n\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanForward(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(index);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanReverse64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(63 - index);\n#  else\n    uint32_t hi = uint32_t(u >> 32);\n    if (hi != 0)\n      return CountLeadingZeroes32(hi);\n    return 32 + CountLeadingZeroes32(uint32_t(u));\n#  endif\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanForward64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(index);\n#  else\n    uint32_t lo = uint32_t(u);\n    if (lo != 0)\n      return CountTrailingZeroes32(lo);\n    return 32 + CountTrailingZeroes32(uint32_t(u >> 32));\n#  endif\n  }\n\n#  ifdef MOZ_HAVE_BITSCAN64\n#    undef MOZ_HAVE_BITSCAN64\n#  endif\n\n#elif defined(__clang__) || defined(__GNUC__)\n\n#  if defined(__clang__)\n#    if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz)\n#      error \"A clang providing __builtin_c[lt]z is required to build\"\n#    endif\n#  else\n     // gcc has had __builtin_clz and friends since 3.4: no need to check.\n#  endif\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    return __builtin_clz(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    return __builtin_ctz(u);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n    return __builtin_clzll(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n    return __builtin_ctzll(u);\n  }\n\n#else\n#  error \"Implement these!\"\n  inline uint_fast8_t CountLeadingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountLeadingZeroes64(uint64_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes64(uint64_t u) MOZ_DELETE;\n#endif\n\n} // namespace detail\n\n/**\n * Compute the number of high-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the highest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountLeadingZeroes32(0xF0FF1000) is 0;\n * CountLeadingZeroes32(0x7F8F0001) is 1;\n * CountLeadingZeroes32(0x3FFF0100) is 2;\n * CountLeadingZeroes32(0x1FF50010) is 3; and so on.\n */\ninline uint_fast8_t\nCountLeadingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes32(u);\n}\n\n/**\n * Compute the number of low-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the lowest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountTrailingZeroes32(0x0100FFFF) is 0;\n * CountTrailingZeroes32(0x7000FFFE) is 1;\n * CountTrailingZeroes32(0x0080FFFC) is 2;\n * CountTrailingZeroes32(0x0080FFF8) is 3; and so on.\n */\ninline uint_fast8_t\nCountTrailingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes32(u);\n}\n\n/** Analogous to CountLeadingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountLeadingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes64(u);\n}\n\n/** Analogous to CountTrailingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountTrailingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes64(u);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass CeilingLog2;\n\ntemplate<typename T>\nclass CeilingLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 32 - CountLeadingZeroes32(t - 1);\n    }\n};\n\ntemplate<typename T>\nclass CeilingLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 64 - CountLeadingZeroes64(t - 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the least power of 2 greater than or equal to |t|.\n *\n * CeilingLog2(0..1) is 0;\n * CeilingLog2(2) is 1;\n * CeilingLog2(3..4) is 2;\n * CeilingLog2(5..8) is 3;\n * CeilingLog2(9..16) is 4; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nCeilingLog2(const T t)\n{\n  return detail::CeilingLog2<T>::compute(t);\n}\n\n/** A CeilingLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nCeilingLog2Size(size_t n)\n{\n  return CeilingLog2(n);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass FloorLog2;\n\ntemplate<typename T>\nclass FloorLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 31 - CountLeadingZeroes32(t | 1);\n    }\n};\n\ntemplate<typename T>\nclass FloorLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 63 - CountLeadingZeroes64(t | 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the greatest power of 2 less than or equal to |t|.\n *\n * FloorLog2(0..1) is 0;\n * FloorLog2(2..3) is 1;\n * FloorLog2(4..7) is 2;\n * FloorLog2(8..15) is 3; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nFloorLog2(const T t)\n{\n  return detail::FloorLog2<T>::compute(t);\n}\n\n/** A FloorLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nFloorLog2Size(size_t n)\n{\n  return FloorLog2(n);\n}\n\n/*\n * Compute the smallest power of 2 greater than or equal to |x|.  |x| must not\n * be so great that the computed value would overflow |size_t|.\n */\ninline size_t\nRoundUpPow2(size_t x)\n{\n  MOZ_ASSERT(x <= (size_t(1) << (sizeof(size_t) * CHAR_BIT - 1)),\n             \"can't round up -- will overflow!\");\n  return size_t(1) << CeilingLog2(x);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_MathAlgorithms_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/MemoryChecking.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides a common interface to the ASan (AddressSanitizer) and Valgrind \n * functions used to mark memory in certain ways. In detail, the following\n * three macros are provided:\n *\n *   MOZ_MAKE_MEM_NOACCESS  - Mark memory as unsafe to access (e.g. freed)\n *   MOZ_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined\n *   MOZ_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined\n *\n * With Valgrind in use, these directly map to the three respective Valgrind\n * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory,\n * while the UNDEFINED/DEFINED macros unpoison memory.\n *\n * With no memory checker available, all macros expand to the empty statement.\n */\n\n#ifndef mozilla_MemoryChecking_h\n#define mozilla_MemoryChecking_h\n\n#if defined(MOZ_VALGRIND)\n#include \"valgrind/memcheck.h\"\n#endif\n\n#if defined(MOZ_ASAN) || defined(MOZ_VALGRIND)\n#define MOZ_HAVE_MEM_CHECKS 1\n#endif\n\n#if defined(MOZ_ASAN)\n#include <stddef.h>\n\nextern \"C\" {\n  /* These definitions are usually provided through the \n   * sanitizer/asan_interface.h header installed by ASan.\n   */\n  void __asan_poison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n  void __asan_unpoison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  __asan_poison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n}\n#elif defined(MOZ_VALGRIND)\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  VALGRIND_MAKE_MEM_NOACCESS((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_UNDEFINED((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_DEFINED((addr), (size))\n#else\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_DEFINED(addr, size) do {} while(0)\n\n#endif\n\n#endif /* mozilla_MemoryChecking_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/MemoryReporting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Memory reporting infrastructure. */\n\n#ifndef mozilla_MemoryReporting_h\n#define mozilla_MemoryReporting_h\n\n#include <stddef.h>\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This is for functions that are like malloc_usable_size.  Such functions are\n * used for measuring the size of data structures.\n */\ntypedef size_t (*MallocSizeOf)(const void* p);\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\ntypedef size_t (*MozMallocSizeOf)(const void* p);\n\n#endif /* mozilla_MemoryReporting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Move.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* C++11-style, but C++98-usable, \"move references\" implementation. */\n\n#ifndef mozilla_Move_h\n#define mozilla_Move_h\n\nnamespace mozilla {\n\n/*\n * \"Move\" References\n *\n * Some types can be copied much more efficiently if we know the original's\n * value need not be preserved --- that is, if we are doing a \"move\", not a\n * \"copy\". For example, if we have:\n *\n *   Vector<T> u;\n *   Vector<T> v(u);\n *\n * the constructor for v must apply a copy constructor to each element of u ---\n * taking time linear in the length of u. However, if we know we will not need u\n * any more once v has been initialized, then we could initialize v very\n * efficiently simply by stealing u's dynamically allocated buffer and giving it\n * to v --- a constant-time operation, regardless of the size of u.\n *\n * Moves often appear in container implementations. For example, when we append\n * to a vector, we may need to resize its buffer. This entails moving each of\n * its extant elements from the old, smaller buffer to the new, larger buffer.\n * But once the elements have been migrated, we're just going to throw away the\n * old buffer; we don't care if they still have their values. So if the vector's\n * element type can implement \"move\" more efficiently than \"copy\", the vector\n * resizing should by all means use a \"move\" operation. Hash tables also need to\n * be resized.\n *\n * The details of the optimization, and whether it's worth applying, vary from\n * one type to the next. And while some constructor calls are moves, many really\n * are copies, and can't be optimized this way. So we need:\n *\n * 1) a way for a particular invocation of a copy constructor to say that it's\n *    really a move, and that the value of the original isn't important\n *    afterwards (although it must still be safe to destroy); and\n *\n * 2) a way for a type (like Vector) to announce that it can be moved more\n *    efficiently than it can be copied, and provide an implementation of that\n *    move operation.\n *\n * The Move(T&) function takes a reference to a T, and returns a MoveRef<T>\n * referring to the same value; that's 1). A MoveRef<T> is simply a reference\n * to a T, annotated to say that a copy constructor applied to it may move that\n * T, instead of copying it. Finally, a constructor that accepts an MoveRef<T>\n * should perform a more efficient move, instead of a copy, providing 2).\n *\n * So, where we might define a copy constructor for a class C like this:\n *\n *   C(const C& rhs) { ... copy rhs to this ... }\n *\n * we would declare a move constructor like this:\n *\n *   C(MoveRef<C> rhs) { ... move rhs to this ... }\n *\n * And where we might perform a copy like this:\n *\n *   C c2(c1);\n *\n * we would perform a move like this:\n *\n *   C c2(Move(c1))\n *\n * Note that MoveRef<T> implicitly converts to T&, so you can pass a MoveRef<T>\n * to an ordinary copy constructor for a type that doesn't support a special\n * move constructor, and you'll just get a copy.  This means that templates can\n * use Move whenever they know they won't use the original value any more, even\n * if they're not sure whether the type at hand has a specialized move\n * constructor.  If it doesn't, the MoveRef<T> will just convert to a T&, and\n * the ordinary copy constructor will apply.\n *\n * A class with a move constructor can also provide a move assignment operator,\n * which runs this's destructor, and then applies the move constructor to\n * *this's memory. A typical definition:\n *\n *   C& operator=(MoveRef<C> rhs) {\n *     this->~C();\n *     new(this) C(rhs);\n *     return *this;\n *   }\n *\n * With that in place, one can write move assignments like this:\n *\n *   c2 = Move(c1);\n *\n * This destroys c1, moves c1's value to c2, and leaves c1 in an undefined but\n * destructible state.\n *\n * This header file defines MoveRef and Move in the mozilla namespace.  It's up\n * to individual containers to annotate moves as such, by calling Move; and it's\n * up to individual types to define move constructors.\n *\n * One hint: if you're writing a move constructor where the type has members\n * that should be moved themselves, it's much nicer to write this:\n *\n *   C(MoveRef<C> c) : x(Move(c->x)), y(Move(c->y)) { }\n *\n * than the equivalent:\n *\n *   C(MoveRef<C> c) { new(&x) X(Move(c->x)); new(&y) Y(Move(c->y)); }\n *\n * especially since GNU C++ fails to notice that this does indeed initialize x\n * and y, which may matter if they're const.\n */\ntemplate<typename T>\nclass MoveRef\n{\n    T* pointer;\n\n  public:\n    explicit MoveRef(T& t) : pointer(&t) { }\n    T& operator*() const { return *pointer; }\n    T* operator->() const { return pointer; }\n    operator T& () const { return *pointer; }\n};\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(T& t)\n{\n  return MoveRef<T>(t);\n}\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(const T& t)\n{\n  // With some versions of gcc, for a class C, there's an (incorrect) ambiguity\n  // between the C(const C&) constructor and the default C(C&&) C++11 move\n  // constructor, when the constructor is called with a const C& argument.\n  //\n  // This ambiguity manifests with the Move implementation above when Move is\n  // passed const U& for some class U.  Calling Move(const U&) returns a\n  // MoveRef<const U&>, which is then commonly passed to the U constructor,\n  // triggering an implicit conversion to const U&.  gcc doesn't know whether to\n  // call U(const U&) or U(U&&), so it wrongly reports a compile error.\n  //\n  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50442 has since been fixed, so\n  // this is no longer an issue for up-to-date compilers.  But there's no harm\n  // in keeping it around for older compilers, so we might as well.  See also\n  // bug 686280.\n  return MoveRef<T>(const_cast<T&>(t));\n}\n\n/** Swap |t| and |u| using move-construction if possible. */\ntemplate<typename T>\ninline void\nSwap(T& t, T& u)\n{\n  T tmp(Move(t));\n  t = Move(u);\n  u = Move(tmp);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Move_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/NullPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a workaround for compilers which do not support the C++11 nullptr\n * constant.\n */\n\n#ifndef mozilla_NullPtr_h\n#define mozilla_NullPtr_h\n\n#include \"mozilla/Compiler.h\"\n\n#if defined(__clang__)\n#  ifndef __has_extension\n#    define __has_extension __has_feature\n#  endif\n#  if __has_extension(cxx_nullptr)\n#    define MOZ_HAVE_CXX11_NULLPTR\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_NULLPTR\n#    endif\n#  endif\n#elif _MSC_VER >= 1600\n# define MOZ_HAVE_CXX11_NULLPTR\n#endif\n\n/**\n * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal\n * with the correct size to match the size of a pointer on a given platform.\n */\n\n#ifndef MOZ_HAVE_CXX11_NULLPTR\n#  if defined(__GNUC__)\n#    define nullptr __null\n#  elif defined(_WIN64)\n#    define nullptr 0LL\n#  else\n#    define nullptr 0L\n#  endif\n#endif\n\n#endif /* mozilla_NullPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/PodOperations.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Operations for zeroing POD types, arrays, and so on.\n *\n * These operations are preferable to memset, memcmp, and the like because they\n * don't require remembering to multiply by sizeof(T), array lengths, and so on\n * everywhere.\n */\n\n#ifndef mozilla_PodOperations_h\n#define mozilla_PodOperations_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include <string.h>\n\nnamespace mozilla {\n\n/** Set the contents of |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t)\n{\n  memset(t, 0, sizeof(T));\n}\n\n/** Set the contents of |nelem| elements starting at |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t, size_t nelem)\n{\n  /*\n   * This function is often called with 'nelem' small; we use an inline loop\n   * instead of calling 'memset' with a non-constant length.  The compiler\n   * should inline the memset call with constant size, though.\n   */\n  for (T* end = t + nelem; t < end; t++)\n    memset(t, 0, sizeof(T));\n}\n\n/*\n * Arrays implicitly convert to pointers to their first element, which is\n * dangerous when combined with the above PodZero definitions.  Adding an\n * overload for arrays is ambiguous, so we need another identifier.  The\n * ambiguous overload is left to catch mistaken uses of PodZero; if you get a\n * compile error involving PodZero and array types, use PodArrayZero instead.\n */\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N]) MOZ_DELETE;\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N], size_t nelem) MOZ_DELETE;\n\n/** Set the contents of the array |t| to zero. */\ntemplate <class T, size_t N>\nstatic void\nPodArrayZero(T (&t)[N])\n{\n  memset(t, 0, N * sizeof(T));\n}\n\n/**\n * Assign |*src| to |*dst|.  The locations must not be the same and must not\n * overlap.\n */\ntemplate<typename T>\nstatic void\nPodAssign(T* dst, const T* src)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= 1);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= 1);\n  memcpy(reinterpret_cast<char*>(dst), reinterpret_cast<const char*>(src), sizeof(T));\n}\n\n/**\n * Copy |nelem| T elements from |src| to |dst|.  The two memory ranges must not\n * overlap!\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(T* dst, const T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= nelem);\n\n  if (nelem < 128) {\n    /*\n     * Avoid using operator= in this loop, as it may have been\n     * intentionally deleted by the POD type.\n     */\n    for (const T* srcend = src + nelem; src < srcend; src++, dst++)\n      PodAssign(dst, src);\n  } else {\n    memcpy(dst, src, nelem * sizeof(T));\n  }\n}\n\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(volatile T* dst, const volatile T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst,\n                PointerRangeSize(src, static_cast<const volatile T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src,\n                PointerRangeSize(static_cast<const volatile T*>(dst), src) >= nelem);\n\n  /*\n   * Volatile |dst| requires extra work, because it's undefined behavior to\n   * modify volatile objects using the mem* functions.  Just write out the\n   * loops manually, using operator= rather than memcpy for the same reason,\n   * and let the compiler optimize to the extent it can.\n   */\n  for (const volatile T* srcend = src + nelem; src < srcend; src++, dst++)\n    *dst = *src;\n}\n\n/*\n * Copy the contents of the array |src| into the array |dst|, both of size N.\n * The arrays must not overlap!\n */\ntemplate <class T, size_t N>\nstatic void\nPodArrayCopy(T (&dst)[N], const T (&src)[N])\n{\n  PodCopy(dst, src, N);\n}\n\n/**\n * Determine whether the |len| elements at |one| are memory-identical to the\n * |len| elements at |two|.\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static bool\nPodEqual(const T* one, const T* two, size_t len)\n{\n  if (len < 128) {\n    const T* p1end = one + len;\n    const T* p1 = one;\n    const T* p2 = two;\n    for (; p1 < p1end; p1++, p2++) {\n      if (*p1 != *p2)\n        return false;\n    }\n    return true;\n  }\n\n  return !memcmp(one, two, len * sizeof(T));\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_PodOperations_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Poison.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A poison value that can be used to fill a memory space with\n * an address that leads to a safe crash when dereferenced.\n */\n\n#ifndef mozilla_Poison_h\n#define mozilla_Poison_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\nMOZ_BEGIN_EXTERN_C\n\nextern MFBT_DATA uintptr_t gMozillaPoisonValue;\n\n/**\n * @return the poison value.\n */\ninline uintptr_t mozPoisonValue()\n{\n  return gMozillaPoisonValue;\n}\n\n/**\n * Overwrite the memory block of aSize bytes at aPtr with the poison value.\n * aPtr MUST be aligned at a sizeof(uintptr_t) boundary.\n * Only an even number of sizeof(uintptr_t) bytes are overwritten, the last\n * few bytes (if any) is not overwritten.\n */\ninline void mozWritePoison(void* aPtr, size_t aSize)\n{\n  const uintptr_t POISON = mozPoisonValue();\n  char* p = (char*)aPtr;\n  char* limit = p + aSize;\n  MOZ_ASSERT((uintptr_t)aPtr % sizeof(uintptr_t) == 0, \"bad alignment\");\n  MOZ_ASSERT(aSize >= sizeof(uintptr_t), \"poisoning this object has no effect\");\n  for (; p < limit; p += sizeof(uintptr_t)) {\n    *((uintptr_t*)p) = POISON;\n  }\n}\n\n/**\n * Initialize the poison value.\n * This should only be called once.\n */\nextern MFBT_API void mozPoisonValueInit();\n\n/* Values annotated by CrashReporter */\nextern MFBT_DATA uintptr_t gMozillaPoisonBase;\nextern MFBT_DATA uintptr_t gMozillaPoisonSize;\n\nMOZ_END_EXTERN_C\n\n#endif /* mozilla_Poison_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Range.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef mozilla_Range_h\n#define mozilla_Range_h\n\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RangedPtr.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\n// Range<T> is a tuple containing a pointer and a length.\ntemplate <typename T>\nclass Range\n{\n    RangedPtr<T> mStart;\n    RangedPtr<T> mEnd;\n\n    typedef void (Range::* ConvertibleToBool)();\n    void nonNull() {}\n\n  public:\n    Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {}\n    Range(T* p, size_t len)\n      : mStart(p, p, p + len),\n        mEnd(p + len, p, p + len)\n    {}\n\n    RangedPtr<T> start() const { return mStart; }\n    RangedPtr<T> end() const { return mEnd; }\n    size_t length() const { return mEnd - mStart; }\n\n    T& operator[](size_t offset) {\n      return mStart[offset];\n    }\n\n    const T& operator[](size_t offset) const {\n      return mStart[offset];\n    }\n\n    operator ConvertibleToBool() const { return mStart ? &Range::nonNull : 0; }\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Range_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/RangedPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a smart pointer asserted to remain within a range specified at\n * construction.\n */\n\n#ifndef mozilla_RangedPtr_h\n#define mozilla_RangedPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Util.h\"\n\nnamespace mozilla {\n\n/*\n * RangedPtr is a smart pointer restricted to an address range specified at\n * creation.  The pointer (and any smart pointers derived from it) must remain\n * within the range [start, end] (inclusive of end to facilitate use as\n * sentinels).  Dereferencing or indexing into the pointer (or pointers derived\n * from it) must remain within the range [start, end).  All the standard pointer\n * operators are defined on it; in debug builds these operations assert that the\n * range specified at construction is respected.\n *\n * In theory passing a smart pointer instance as an argument can be slightly\n * slower than passing a T* (due to ABI requirements for passing structs versus\n * passing pointers), if the method being called isn't inlined.  If you are in\n * extremely performance-critical code, you may want to be careful using this\n * smart pointer as an argument type.\n *\n * RangedPtr<T> intentionally does not implicitly convert to T*.  Use get() to\n * explicitly convert to T*.  Keep in mind that the raw pointer of course won't\n * implement bounds checking in debug builds.\n */\ntemplate<typename T>\nclass RangedPtr\n{\n    T* ptr;\n\n#ifdef DEBUG\n    T* const rangeStart;\n    T* const rangeEnd;\n#endif\n\n    typedef void (RangedPtr::* ConvertibleToBool)();\n    void nonNull() {}\n\n    void checkSanity() {\n      MOZ_ASSERT(rangeStart <= ptr);\n      MOZ_ASSERT(ptr <= rangeEnd);\n    }\n\n    /* Creates a new pointer for |p|, restricted to this pointer's range. */\n    RangedPtr<T> create(T *p) const {\n#ifdef DEBUG\n      return RangedPtr<T>(p, rangeStart, rangeEnd);\n#else\n      return RangedPtr<T>(p, nullptr, size_t(0));\n#endif\n    }\n\n    uintptr_t asUintptr() const { return uintptr_t(ptr); }\n\n  public:\n    RangedPtr(T* p, T* start, T* end)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(end)\n#endif\n    {\n      MOZ_ASSERT(rangeStart <= rangeEnd);\n      checkSanity();\n    }\n    RangedPtr(T* p, T* start, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(start + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(p, p, length). */\n    RangedPtr(T* p, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(p), rangeEnd(p + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(arr, arr, N). */\n    template<size_t N>\n    RangedPtr(T (&arr)[N])\n      : ptr(arr)\n#ifdef DEBUG\n      , rangeStart(arr), rangeEnd(arr + N)\n#endif\n    {\n      checkSanity();\n    }\n\n    T* get() const {\n      return ptr;\n    }\n\n    operator ConvertibleToBool() const { return ptr ? &RangedPtr::nonNull : 0; }\n\n    /*\n     * You can only assign one RangedPtr into another if the two pointers have\n     * the same valid range:\n     *\n     *   char arr1[] = \"hi\";\n     *   char arr2[] = \"bye\";\n     *   RangedPtr<char> p1(arr1, 2);\n     *   p1 = RangedPtr<char>(arr1 + 1, arr1, arr1 + 2); // works\n     *   p1 = RangedPtr<char>(arr2, 3);                  // asserts\n     */\n    RangedPtr<T>& operator=(const RangedPtr<T>& other) {\n      MOZ_ASSERT(rangeStart == other.rangeStart);\n      MOZ_ASSERT(rangeEnd == other.rangeEnd);\n      ptr = other.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T> operator+(size_t inc) {\n      MOZ_ASSERT(inc <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() + inc * sizeof(T) >= asUintptr());\n      return create(ptr + inc);\n    }\n\n    RangedPtr<T> operator-(size_t dec) {\n      MOZ_ASSERT(dec <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() - dec * sizeof(T) <= asUintptr());\n      return create(ptr - dec);\n    }\n\n    /*\n     * You can assign a raw pointer into a RangedPtr if the raw pointer is\n     * within the range specified at creation.\n     */\n    template <typename U>\n    RangedPtr<T>& operator=(U* p) {\n      *this = create(p);\n      return *this;\n    }\n\n    template <typename U>\n    RangedPtr<T>& operator=(const RangedPtr<U>& p) {\n      MOZ_ASSERT(rangeStart <= p.ptr);\n      MOZ_ASSERT(p.ptr <= rangeEnd);\n      ptr = p.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T>& operator++() {\n      return (*this += 1);\n    }\n\n    RangedPtr<T> operator++(int) {\n      RangedPtr<T> rcp = *this;\n      ++*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator--() {\n      return (*this -= 1);\n    }\n\n    RangedPtr<T> operator--(int) {\n      RangedPtr<T> rcp = *this;\n      --*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator+=(size_t inc) {\n      *this = *this + inc;\n      return *this;\n    }\n\n    RangedPtr<T>& operator-=(size_t dec) {\n      *this = *this - dec;\n      return *this;\n    }\n\n    T& operator[](int index) const {\n      MOZ_ASSERT(size_t(index > 0 ? index : -index) <= size_t(-1) / sizeof(T));\n      return *create(ptr + index);\n    }\n\n    T& operator*() const {\n      return *ptr;\n    }\n\n    template <typename U>\n    bool operator==(const RangedPtr<U>& other) const {\n      return ptr == other.ptr;\n    }\n    template <typename U>\n    bool operator!=(const RangedPtr<U>& other) const {\n      return !(*this == other);\n    }\n\n    template<typename U>\n    bool operator==(const U* u) const {\n      return ptr == u;\n    }\n    template<typename U>\n    bool operator!=(const U* u) const {\n      return !(*this == u);\n    }\n\n    template <typename U>\n    bool operator<(const RangedPtr<U>& other) const {\n      return ptr < other.ptr;\n    }\n    template <typename U>\n    bool operator<=(const RangedPtr<U>& other) const {\n      return ptr <= other.ptr;\n    }\n\n    template <typename U>\n    bool operator>(const RangedPtr<U>& other) const {\n      return ptr > other.ptr;\n    }\n    template <typename U>\n    bool operator>=(const RangedPtr<U>& other) const {\n      return ptr >= other.ptr;\n    }\n\n    size_t operator-(const RangedPtr<T>& other) const {\n      MOZ_ASSERT(ptr >= other.ptr);\n      return PointerRangeSize(other.ptr, ptr);\n    }\n\n  private:\n    RangedPtr() MOZ_DELETE;\n    T* operator&() MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_RangedPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/ReentrancyGuard.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Small helper class for asserting uses of a class are non-reentrant. */\n\n#ifndef mozilla_ReentrancyGuard_h\n#define mozilla_ReentrancyGuard_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n\nnamespace mozilla {\n\n/* Useful for implementing containers that assert non-reentrancy */\nclass ReentrancyGuard\n{\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#ifdef DEBUG\n    bool& entered;\n#endif\n\n  public:\n    template<class T>\n#ifdef DEBUG\n    ReentrancyGuard(T& obj\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : entered(obj.entered)\n#else\n    ReentrancyGuard(T&\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n#endif\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n#ifdef DEBUG\n      MOZ_ASSERT(!entered);\n      entered = true;\n#endif\n    }\n    ~ReentrancyGuard()\n    {\n#ifdef DEBUG\n      entered = false;\n#endif\n    }\n\n  private:\n    ReentrancyGuard(const ReentrancyGuard&) MOZ_DELETE;\n    void operator=(const ReentrancyGuard&) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_ReentrancyGuard_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/RefPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Helpers for defining and using refcounted objects. */\n\n#ifndef mozilla_RefPtr_h\n#define mozilla_RefPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate<typename T> class RefCounted;\ntemplate<typename T> class RefPtr;\ntemplate<typename T> class TemporaryRef;\ntemplate<typename T> class OutParamRef;\ntemplate<typename T> OutParamRef<T> byRef(RefPtr<T>&);\n\n/**\n * RefCounted<T> is a sort of a \"mixin\" for a class T.  RefCounted\n * manages, well, refcounting for T, and because RefCounted is\n * parameterized on T, RefCounted<T> can call T's destructor directly.\n * This means T doesn't need to have a virtual dtor and so doesn't\n * need a vtable.\n *\n * RefCounted<T> is created with refcount == 0.  Newly-allocated\n * RefCounted<T> must immediately be assigned to a RefPtr to make the\n * refcount > 0.  It's an error to allocate and free a bare\n * RefCounted<T>, i.e. outside of the RefPtr machinery.  Attempts to\n * do so will abort DEBUG builds.\n *\n * Live RefCounted<T> have refcount > 0.  The lifetime (refcounts) of\n * live RefCounted<T> are controlled by RefPtr<T> and\n * RefPtr<super/subclass of T>.  Upon a transition from refcounted==1\n * to 0, the RefCounted<T> \"dies\" and is destroyed.  The \"destroyed\"\n * state is represented in DEBUG builds by refcount==0xffffdead.  This\n * state distinguishes use-before-ref (refcount==0) from\n * use-after-destroy (refcount==0xffffdead).\n */\nnamespace detail {\n#ifdef DEBUG\nstatic const int DEAD = 0xffffdead;\n#endif\n\n// This is used WeakPtr.h as well as this file.\nenum RefCountAtomicity\n{\n  AtomicRefCount,\n  NonAtomicRefCount\n};\n\ntemplate<typename T, RefCountAtomicity Atomicity>\nclass RefCounted\n{\n    friend class RefPtr<T>;\n\n  protected:\n    RefCounted() : refCnt(0) { }\n    ~RefCounted() {\n      MOZ_ASSERT(refCnt == detail::DEAD);\n    }\n\n  public:\n    // Compatibility with nsRefPtr.\n    void AddRef() {\n      MOZ_ASSERT(refCnt >= 0);\n      ++refCnt;\n    }\n\n    void Release() {\n      MOZ_ASSERT(refCnt > 0);\n      if (0 == --refCnt) {\n#ifdef DEBUG\n        refCnt = detail::DEAD;\n#endif\n        delete static_cast<T*>(this);\n      }\n    }\n\n    // Compatibility with wtf::RefPtr.\n    void ref() { AddRef(); }\n    void deref() { Release(); }\n    int refCount() const { return refCnt; }\n    bool hasOneRef() const {\n      MOZ_ASSERT(refCnt > 0);\n      return refCnt == 1;\n    }\n\n  private:\n    typename Conditional<Atomicity == AtomicRefCount, Atomic<int>, int>::Type refCnt;\n};\n\n}\n\ntemplate<typename T>\nclass RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>\n{\n  public:\n    ~RefCounted() {\n      static_assert(IsBaseOf<RefCounted, T>::value,\n                    \"T must derive from RefCounted<T>\");\n    }\n};\n\n/**\n * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated\n * reference counter.\n */\ntemplate<typename T>\nclass AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>\n{\n  public:\n    ~AtomicRefCounted() {\n      static_assert(IsBaseOf<AtomicRefCounted, T>::value,\n                    \"T must derive from AtomicRefCounted<T>\");\n    }\n};\n\n/**\n * RefPtr points to a refcounted thing that has AddRef and Release\n * methods to increase/decrease the refcount, respectively.  After a\n * RefPtr<T> is assigned a T*, the T* can be used through the RefPtr\n * as if it were a T*.\n *\n * A RefPtr can forget its underlying T*, which results in the T*\n * being wrapped in a temporary object until the T* is either\n * re-adopted from or released by the temporary.\n */\ntemplate<typename T>\nclass RefPtr\n{\n    // To allow them to use unref()\n    friend class TemporaryRef<T>;\n    friend class OutParamRef<T>;\n\n    struct DontRef {};\n\n  public:\n    RefPtr() : ptr(0) { }\n    RefPtr(const RefPtr& o) : ptr(ref(o.ptr)) {}\n    RefPtr(const TemporaryRef<T>& o) : ptr(o.drop()) {}\n    RefPtr(T* t) : ptr(ref(t)) {}\n\n    template<typename U>\n    RefPtr(const RefPtr<U>& o) : ptr(ref(o.get())) {}\n\n    ~RefPtr() { unref(ptr); }\n\n    RefPtr& operator=(const RefPtr& o) {\n      assign(ref(o.ptr));\n      return *this;\n    }\n    RefPtr& operator=(const TemporaryRef<T>& o) {\n      assign(o.drop());\n      return *this;\n    }\n    RefPtr& operator=(T* t) {\n      assign(ref(t));\n      return *this;\n    }\n\n    template<typename U>\n    RefPtr& operator=(const RefPtr<U>& o) {\n      assign(ref(o.get()));\n      return *this;\n    }\n\n    TemporaryRef<T> forget() {\n      T* tmp = ptr;\n      ptr = 0;\n      return TemporaryRef<T>(tmp, DontRef());\n    }\n\n    T* get() const { return ptr; }\n    operator T*() const { return ptr; }\n    T* operator->() const { return ptr; }\n    T& operator*() const { return *ptr; }\n    template<typename U>\n    operator TemporaryRef<U>() { return TemporaryRef<U>(ptr); }\n\n  private:\n    void assign(T* t) {\n      unref(ptr);\n      ptr = t;\n    }\n\n    T* ptr;\n\n    static MOZ_ALWAYS_INLINE T* ref(T* t) {\n      if (t)\n        t->AddRef();\n      return t;\n    }\n\n    static MOZ_ALWAYS_INLINE void unref(T* t) {\n      if (t)\n        t->Release();\n    }\n};\n\n/**\n * TemporaryRef<T> represents an object that holds a temporary\n * reference to a T.  TemporaryRef objects can't be manually ref'd or\n * unref'd (being temporaries, not lvalues), so can only relinquish\n * references to other objects, or unref on destruction.\n */\ntemplate<typename T>\nclass TemporaryRef\n{\n    // To allow it to construct TemporaryRef from a bare T*\n    friend class RefPtr<T>;\n\n    typedef typename RefPtr<T>::DontRef DontRef;\n\n  public:\n    TemporaryRef(T* t) : ptr(RefPtr<T>::ref(t)) {}\n    TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {}\n\n    template<typename U>\n    TemporaryRef(const TemporaryRef<U>& o) : ptr(o.drop()) {}\n\n    ~TemporaryRef() { RefPtr<T>::unref(ptr); }\n\n    T* drop() const {\n      T* tmp = ptr;\n      ptr = 0;\n      return tmp;\n    }\n\n  private:\n    TemporaryRef(T* t, const DontRef&) : ptr(t) {}\n\n    mutable T* ptr;\n\n    TemporaryRef() MOZ_DELETE;\n    void operator=(const TemporaryRef&) MOZ_DELETE;\n};\n\n/**\n * OutParamRef is a wrapper that tracks a refcounted pointer passed as\n * an outparam argument to a function.  OutParamRef implements COM T**\n * outparam semantics: this requires the callee to AddRef() the T*\n * returned through the T** outparam on behalf of the caller.  This\n * means the caller (through OutParamRef) must Release() the old\n * object contained in the tracked RefPtr.  It's OK if the callee\n * returns the same T* passed to it through the T** outparam, as long\n * as the callee obeys the COM discipline.\n *\n * Prefer returning TemporaryRef<T> from functions over creating T**\n * outparams and passing OutParamRef<T> to T**.  Prefer RefPtr<T>*\n * outparams over T** outparams.\n */\ntemplate<typename T>\nclass OutParamRef\n{\n    friend OutParamRef byRef<T>(RefPtr<T>&);\n\n  public:\n    ~OutParamRef() {\n      RefPtr<T>::unref(refPtr.ptr);\n      refPtr.ptr = tmp;\n    }\n\n    operator T**() { return &tmp; }\n\n  private:\n    OutParamRef(RefPtr<T>& p) : refPtr(p), tmp(p.get()) {}\n\n    RefPtr<T>& refPtr;\n    T* tmp;\n\n    OutParamRef() MOZ_DELETE;\n    OutParamRef& operator=(const OutParamRef&) MOZ_DELETE;\n};\n\n/**\n * byRef cooperates with OutParamRef to implement COM outparam semantics.\n */\ntemplate<typename T>\nOutParamRef<T>\nbyRef(RefPtr<T>& ptr)\n{\n  return OutParamRef<T>(ptr);\n}\n\n} // namespace mozilla\n\n#if 0\n\n// Command line that builds these tests\n//\n//   cp RefPtr.h test.cc && g++ -g -Wall -pedantic -DDEBUG -o test test.cc && ./test\n\nusing namespace mozilla;\n\nstruct Foo : public RefCounted<Foo>\n{\n  Foo() : dead(false) { }\n  ~Foo() {\n    MOZ_ASSERT(!dead);\n    dead = true;\n    numDestroyed++;\n  }\n\n  bool dead;\n  static int numDestroyed;\n};\nint Foo::numDestroyed;\n\nstruct Bar : public Foo { };\n\nTemporaryRef<Foo>\nNewFoo()\n{\n  return RefPtr<Foo>(new Foo());\n}\n\nTemporaryRef<Foo>\nNewBar()\n{\n  return new Bar();\n}\n\nvoid\nGetNewFoo(Foo** f)\n{\n  *f = new Bar();\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetPassedFoo(Foo** f)\n{\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetNewFoo(RefPtr<Foo>* f)\n{\n  *f = new Bar();\n}\n\nvoid\nGetPassedFoo(RefPtr<Foo>* f)\n{}\n\nTemporaryRef<Foo>\nGetNullFoo()\n{\n  return 0;\n}\n\nint\nmain(int argc, char** argv)\n{\n  // This should blow up\n//    Foo* f = new Foo(); delete f;\n\n  MOZ_ASSERT(0 == Foo::numDestroyed);\n  {\n    RefPtr<Foo> f = new Foo();\n    MOZ_ASSERT(f->refCount() == 1);\n  }\n  MOZ_ASSERT(1 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = NewFoo();\n    RefPtr<Foo> f2(NewFoo());\n    MOZ_ASSERT(1 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(3 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> b = NewBar();\n    MOZ_ASSERT(3 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(4 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1;\n    {\n      f1 = new Foo();\n      RefPtr<Foo> f2(f1);\n      RefPtr<Foo> f3 = f2;\n      MOZ_ASSERT(4 == Foo::numDestroyed);\n    }\n    MOZ_ASSERT(4 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(5 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    f.forget();\n    MOZ_ASSERT(6 == Foo::numDestroyed);\n  }\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(byRef(f));\n    MOZ_ASSERT(7 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(8 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(byRef(f));\n    MOZ_ASSERT(8 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(9 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(&f);\n    MOZ_ASSERT(10 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(11 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(&f);\n    MOZ_ASSERT(11 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(12 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = new Bar();\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = GetNullFoo();\n    MOZ_ASSERT(13 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  return 0;\n}\n\n#endif\n\n#endif /* mozilla_RefPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/SHA1.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Simple class for computing SHA1. */\n\n#ifndef mozilla_SHA1_h\n#define mozilla_SHA1_h\n\n#include \"mozilla/Types.h\"\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * This class computes the SHA1 hash of a byte sequence, or of the concatenation\n * of multiple sequences.  For example, computing the SHA1 of two sequences of\n * bytes could be done as follows:\n *\n *   void SHA1(const uint8_t* buf1, uint32_t size1,\n *             const uint8_t* buf2, uint32_t size2,\n *             SHA1Sum::Hash& hash)\n *   {\n *     SHA1Sum s;\n *     s.update(buf1, size1);\n *     s.update(buf2, size2);\n *     s.finish(hash);\n *   }\n *\n * The finish method may only be called once and cannot be followed by calls\n * to update.\n */\nclass SHA1Sum\n{\n    union {\n        uint32_t w[16]; /* input buffer */\n        uint8_t b[64];\n    } u;\n    uint64_t size; /* count of hashed bytes. */\n    unsigned H[22]; /* 5 state variables, 16 tmp values, 1 extra */\n    bool mDone;\n\n  public:\n    MFBT_API SHA1Sum();\n\n    static const size_t HashSize = 20;\n    typedef uint8_t Hash[HashSize];\n\n    /* Add len bytes of dataIn to the data sequence being hashed. */\n    MFBT_API void update(const void* dataIn, uint32_t len);\n\n    /* Compute the final hash of all data into hashOut. */\n    MFBT_API void finish(SHA1Sum::Hash& hashOut);\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_SHA1_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Scoped.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A number of structures to simplify scope-based RAII management. */\n\n#ifndef mozilla_Scoped_h\n#define mozilla_Scoped_h\n\n/*\n * Resource Acquisition Is Initialization is a programming idiom used\n * to write robust code that is able to deallocate resources properly,\n * even in presence of execution errors or exceptions that need to be\n * propagated.  The Scoped* classes defined in this header perform the\n * deallocation of the resource they hold once program execution\n * reaches the end of the scope for which they have been defined.\n *\n * This header provides the following RAII classes:\n *\n * - |ScopedFreePtr| - a container for a pointer, that automatically calls\n *   |free()| at the end of the scope;\n * - |ScopedDeletePtr| - a container for a pointer, that automatically calls\n *   |delete| at the end of the scope;\n * - |ScopedDeleteArray| - a container for a pointer to an array, that\n *   automatically calls |delete[]| at the end of the scope.\n *\n * The general scenario for each of the RAII classes is the following:\n *\n * ScopedClass foo(create_value());\n * // ... In this scope, |foo| is defined. Use |foo.get()| or |foo.rwget()|\n *        to access the value.\n * // ... In case of |return| or |throw|, |foo| is deallocated automatically.\n * // ... If |foo| needs to be returned or stored, use |foo.forget()|\n *\n * Note that the RAII classes defined in this header do _not_ perform any form\n * of reference-counting or garbage-collection. These classes have exactly two\n * behaviors:\n *\n * - if |forget()| has not been called, the resource is always deallocated at\n *   the end of the scope;\n * - if |forget()| has been called, any control on the resource is unbound\n *   and the resource is not deallocated by the class.\n *\n * Extension:\n *\n * In addition, this header provides class |Scoped| and macros |SCOPED_TEMPLATE|\n * and |MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE|  to simplify the definition\n * of RAII classes for other scenarios. These macros have been used to\n * automatically close file descriptors/file handles when reaching the end of\n * the scope, graphics contexts, etc.\n */\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n/*\n * Scoped is a helper to create RAII wrappers\n * Type argument |Traits| is expected to have the following structure:\n *\n *   struct Traits {\n *     // Define the type of the value stored in the wrapper\n *     typedef value_type type;\n *     // Returns the value corresponding to the uninitialized or freed state\n *     const static type empty();\n *     // Release resources corresponding to the wrapped value\n *     // This function is responsible for not releasing an |empty| value\n *     const static void release(type);\n *   }\n */\ntemplate<typename Traits>\nclass Scoped\n{\n  public:\n    typedef typename Traits::type Resource;\n\n    explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : value(Traits::empty())\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    explicit Scoped(const Resource& v\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : value(v)\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~Scoped() {\n      Traits::release(value);\n    }\n\n    // Constant getter\n    operator const Resource&() const { return value; }\n    const Resource& operator->() const { return value; }\n    const Resource& get() const { return value; }\n    // Non-constant getter.\n    Resource& rwget() { return value; }\n\n    /*\n     * Forget the resource.\n     *\n     * Once |forget| has been called, the |Scoped| is neutralized, i.e. it will\n     * have no effect at destruction (unless it is reset to another resource by\n     * |operator=|).\n     *\n     * @return The original resource.\n     */\n    Resource forget() {\n      Resource tmp = value;\n      value = Traits::empty();\n      return tmp;\n    }\n\n    /*\n     * Perform immediate clean-up of this |Scoped|.\n     *\n     * If this |Scoped| is currently empty, this method has no effect.\n     */\n    void dispose() {\n      Traits::release(value);\n      value = Traits::empty();\n    }\n\n    bool operator==(const Resource& other) const {\n      return value == other;\n    }\n\n    /*\n     * Replace the resource with another resource.\n     *\n     * Calling |operator=| has the side-effect of triggering clean-up. If you do\n     * not want to trigger clean-up, you should first invoke |forget|.\n     *\n     * @return this\n     */\n    Scoped<Traits>& operator=(const Resource& other) {\n      return reset(other);\n    }\n    Scoped<Traits>& reset(const Resource& other) {\n      Traits::release(value);\n      value = other;\n      return *this;\n    }\n\n  private:\n    explicit Scoped(const Scoped<Traits>& value) MOZ_DELETE;\n    Scoped<Traits>& operator=(const Scoped<Traits>& value) MOZ_DELETE;\n\n  private:\n    Resource value;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * SCOPED_TEMPLATE defines a templated class derived from Scoped\n * This allows to implement templates such as ScopedFreePtr.\n *\n * @param name The name of the class to define.\n * @param Traits A struct implementing clean-up. See the implementations\n * for more details.\n */\n#define SCOPED_TEMPLATE(name, Traits)                          \\\ntemplate<typename Type>                                        \\\nstruct name : public mozilla::Scoped<Traits<Type> >            \\\n{                                                              \\\n    typedef mozilla::Scoped<Traits<Type> > Super;              \\\n    typedef typename Super::Resource Resource;                 \\\n    name& operator=(Resource ptr) {                            \\\n      Super::operator=(ptr);                                   \\\n      return *this;                                            \\\n    }                                                          \\\n    explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)        \\\n      : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)  \\\n    {}                                                         \\\n    explicit name(Resource ptr                                 \\\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)             \\\n      : Super(ptr MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)   \\\n    {}                                                         \\\n  private:                                                     \\\n    explicit name(name& source) MOZ_DELETE;                    \\\n    name& operator=(name& source) MOZ_DELETE;                  \\\n};\n\n/*\n * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d.\n *\n *   struct S { ... };\n *   ScopedFreePtr<S> foo = malloc(sizeof(S));\n *   ScopedFreePtr<char> bar = strdup(str);\n */\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return nullptr; }\n    static void release(T* ptr) { free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)\n\n/*\n * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.\n *\n *   struct S { ... };\n *   ScopedDeletePtr<S> foo = new S();\n */\ntemplate<typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)\n\n/*\n * ScopedDeleteArray is a RAII wrapper for pointers that need to be delete[]ed.\n *\n *   struct S { ... };\n *   ScopedDeleteArray<S> foo = new S[42];\n */\ntemplate<typename T>\nstruct ScopedDeleteArrayTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete [] ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeleteArray, ScopedDeleteArrayTraits)\n\n/*\n * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped\n * pointers for types with custom deleters; just overload\n * TypeSpecificDelete(T*) in the same namespace as T to call the deleter for\n * type T.\n *\n * @param name The name of the class to define.\n * @param Type A struct implementing clean-up. See the implementations\n * for more details.\n * *param Deleter The function that is used to delete/destroy/free a\n *        non-null value of Type*.\n *\n * Example:\n *\n *   MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \\\n *                                             PR_Close)\n *   ...\n *   {\n *       ScopedPRFileDesc file(PR_OpenFile(...));\n *       ...\n *   } // file is closed with PR_Close here\n */\n#define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \\\ntemplate <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \\\ntypedef ::mozilla::TypeSpecificScopedPointer<Type> name;\n\ntemplate <typename T> void TypeSpecificDelete(T * value);\n\ntemplate <typename T>\nstruct TypeSpecificScopedPointerTraits\n{\n    typedef T* type;\n    const static type empty() { return nullptr; }\n    const static void release(type value)\n    {\n      if (value)\n        TypeSpecificDelete(value);\n    }\n};\n\nSCOPED_TEMPLATE(TypeSpecificScopedPointer, TypeSpecificScopedPointerTraits)\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Scoped_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/SplayTree.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/**\n * A sorted tree with optimal access times, where recently-accessed elements\n * are faster to access again.\n */\n\n#ifndef mozilla_SplayTree_h\n#define mozilla_SplayTree_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\ntemplate<class T, class C>\nclass SplayTree;\n\ntemplate<typename T>\nclass SplayTreeNode\n{\n  public:\n    template<class A, class B>\n    friend class SplayTree;\n\n    SplayTreeNode()\n      : left(nullptr), right(nullptr), parent(nullptr)\n    {}\n\n  private:\n    T* left;\n    T* right;\n    T* parent;\n};\n\n\n/**\n * Class which represents a splay tree.\n * Splay trees are balanced binary search trees for which search, insert and\n * remove are all amortized O(log n), but where accessing a node makes it\n * faster to access that node in the future.\n *\n * T indicates the type of tree elements, Comparator must have a static\n * compare(const T&, const T&) method ordering the elements. The compare\n * method must be free from side effects.\n */\ntemplate<typename T, class Comparator>\nclass SplayTree\n{\n    T* root;\n    T* freeList;\n\n  public:\n    SplayTree()\n      : root(nullptr), freeList(nullptr)\n    {}\n\n    bool empty() const {\n      return !root;\n    }\n\n    bool contains(const T& v)\n    {\n      if (empty())\n        return false;\n\n      T* last = lookup(v);\n      splay(last);\n      checkCoherency(root, nullptr);\n      return Comparator::compare(v, *last) == 0;\n    }\n\n    bool insert(T* v)\n    {\n      MOZ_ASSERT(!contains(*v), \"Duplicate elements are not allowed.\");\n\n      if (!root) {\n        root = v;\n        return true;\n      }\n      T* last = lookup(*v);\n      int cmp = Comparator::compare(*v, *last);\n\n      T** parentPointer = (cmp < 0) ? &last->left : &last->right;\n      MOZ_ASSERT(!*parentPointer);\n      *parentPointer = v;\n      v->parent = last;\n\n      splay(v);\n      checkCoherency(root, nullptr);\n      return true;\n    }\n\n    T* remove(const T& v)\n    {\n      T* last = lookup(v);\n      MOZ_ASSERT(last, \"This tree must contain the element being removed.\");\n      MOZ_ASSERT(Comparator::compare(v, *last) == 0);\n\n      // Splay the tree so that the item to remove is the root.\n      splay(last);\n      MOZ_ASSERT(last == root);\n\n      // Find another node which can be swapped in for the root: either the\n      // rightmost child of the root's left, or the leftmost child of the\n      // root's right.\n      T* swap;\n      T* swapChild;\n      if (root->left) {\n        swap = root->left;\n        while (swap->right)\n          swap = swap->right;\n        swapChild = swap->left;\n      } else if (root->right) {\n        swap = root->right;\n        while (swap->left)\n          swap = swap->left;\n        swapChild = swap->right;\n      } else {\n        T* result = root;\n        root = nullptr;\n        return result;\n      }\n\n      // The selected node has at most one child, in swapChild. Detach it\n      // from the subtree by replacing it with that child.\n      if (swap == swap->parent->left)\n        swap->parent->left = swapChild;\n      else\n        swap->parent->right = swapChild;\n      if (swapChild)\n        swapChild->parent = swap->parent;\n\n      // Make the selected node the new root.\n      root = swap;\n      root->parent = nullptr;\n      root->left = last->left;\n      root->right = last->right;\n      if (root->left) {\n        root->left->parent = root;\n      }\n      if (root->right) {\n        root->right->parent = root;\n      }\n\n      checkCoherency(root, nullptr);\n      return last;\n    }\n\n    T* removeMin()\n    {\n      MOZ_ASSERT(root, \"No min to remove!\");\n\n      T* min = root;\n      while (min->left)\n        min = min->left;\n      return remove(*min);\n    }\n\n  private:\n    /**\n     * Returns the node in this comparing equal to |v|, or a node just greater or\n     * just less than |v| if there is no such node.\n     */\n    T* lookup(const T& v)\n    {\n      MOZ_ASSERT(!empty());\n\n      T* node = root;\n      T* parent;\n      do {\n        parent = node;\n        int c = Comparator::compare(v, *node);\n        if (c == 0)\n          return node;\n        else if (c < 0)\n          node = node->left;\n        else\n          node = node->right;\n      } while (node);\n      return parent;\n    }\n\n    /**\n     * Rotate the tree until |node| is at the root of the tree. Performing\n     * the rotations in this fashion preserves the amortized balancing of\n     * the tree.\n     */\n    void splay(T* node)\n    {\n      MOZ_ASSERT(node);\n\n      while (node != root) {\n        T* parent = node->parent;\n        if (parent == root) {\n          // Zig rotation.\n          rotate(node);\n          MOZ_ASSERT(node == root);\n          return;\n        }\n        T* grandparent = parent->parent;\n        if ((parent->left == node) == (grandparent->left == parent)) {\n          // Zig-zig rotation.\n          rotate(parent);\n          rotate(node);\n        } else {\n          // Zig-zag rotation.\n          rotate(node);\n          rotate(node);\n        }\n      }\n    }\n\n    void rotate(T* node)\n    {\n      // Rearrange nodes so that node becomes the parent of its current\n      // parent, while preserving the sortedness of the tree.\n      T* parent = node->parent;\n      if (parent->left == node) {\n        //     x          y\n        //   y  c  ==>  a  x\n        //  a b           b c\n        parent->left = node->right;\n        if (node->right)\n          node->right->parent = parent;\n        node->right = parent;\n      } else {\n        MOZ_ASSERT(parent->right == node);\n        //   x             y\n        //  a  y   ==>   x  c\n        //    b c       a b\n        parent->right = node->left;\n        if (node->left)\n          node->left->parent = parent;\n        node->left = parent;\n      }\n      node->parent = parent->parent;\n      parent->parent = node;\n      if (T* grandparent = node->parent) {\n        if (grandparent->left == parent)\n          grandparent->left = node;\n        else\n          grandparent->right = node;\n      } else {\n        root = node;\n      }\n    }\n\n    T* checkCoherency(T* node, T* minimum)\n    {\n#ifdef DEBUG\n      MOZ_ASSERT_IF(root, !root->parent);\n      if (!node) {\n        MOZ_ASSERT(!root);\n        return nullptr;\n      }\n      MOZ_ASSERT_IF(!node->parent, node == root);\n      MOZ_ASSERT_IF(minimum, Comparator::compare(*minimum, *node) < 0);\n      if (node->left) {\n        MOZ_ASSERT(node->left->parent == node);\n        T* leftMaximum = checkCoherency(node->left, minimum);\n        MOZ_ASSERT(Comparator::compare(*leftMaximum, *node) < 0);\n      }\n      if (node->right) {\n        MOZ_ASSERT(node->right->parent == node);\n        return checkCoherency(node->right, node);\n      }\n      return node;\n#else\n      return nullptr;\n#endif\n    }\n\n    SplayTree(const SplayTree&) MOZ_DELETE;\n    void operator=(const SplayTree&) MOZ_DELETE;\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_SplayTree_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/TemplateLib.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Reusable template meta-functions on types and compile-time values.  Meta-\n * functions are placed inside the 'tl' namespace to avoid conflict with non-\n * meta functions of the same name (e.g., mozilla::tl::FloorLog2 vs.\n * mozilla::FloorLog2).\n *\n * When constexpr support becomes universal, we should probably use that instead\n * of some of these templates, for simplicity.\n */\n\n#ifndef mozilla_TemplateLib_h\n#define mozilla_TemplateLib_h\n\n#include <limits.h>\n#include <stddef.h>\n\nnamespace mozilla {\n\nnamespace tl {\n\n/** Compute min/max. */\ntemplate<size_t I, size_t J>\nstruct Min\n{\n    static const size_t value = I < J ? I : J;\n};\ntemplate<size_t I, size_t J>\nstruct Max\n{\n    static const size_t value = I > J ? I : J;\n};\n\n/** Compute floor(log2(i)). */\ntemplate<size_t I>\nstruct FloorLog2\n{\n    static const size_t value = 1 + FloorLog2<I / 2>::value;\n};\ntemplate<> struct FloorLog2<0> { /* Error */ };\ntemplate<> struct FloorLog2<1> { static const size_t value = 0; };\n\n/** Compute ceiling(log2(i)). */\ntemplate<size_t I>\nstruct CeilingLog2\n{\n    static const size_t value = FloorLog2<2 * I - 1>::value;\n};\n\n/** Round up to the nearest power of 2. */\ntemplate<size_t I>\nstruct RoundUpPow2\n{\n    static const size_t value = size_t(1) << CeilingLog2<I>::value;\n};\ntemplate<>\nstruct RoundUpPow2<0>\n{\n    static const size_t value = 1;\n};\n\n/** Compute the number of bits in the given unsigned type. */\ntemplate<typename T>\nstruct BitSize\n{\n    static const size_t value = sizeof(T) * CHAR_BIT;\n};\n\n/**\n * Produce an N-bit mask, where N <= BitSize<size_t>::value.  Handle the\n * language-undefined edge case when N = BitSize<size_t>::value.\n */\ntemplate<size_t N>\nstruct NBitMask\n{\n    // Assert the precondition.  On success this evaluates to 0.  Otherwise it\n    // triggers divide-by-zero at compile time: a guaranteed compile error in\n    // C++11, and usually one in C++98.  Add this value to |value| to assure\n    // its computation.\n    static const size_t checkPrecondition = 0 / size_t(N < BitSize<size_t>::value);\n    static const size_t value = (size_t(1) << N) - 1 + checkPrecondition;\n};\ntemplate<>\nstruct NBitMask<BitSize<size_t>::value>\n{\n    static const size_t value = size_t(-1);\n};\n\n/**\n * For the unsigned integral type size_t, compute a mask M for N such that\n * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t)\n */\ntemplate<size_t N>\nstruct MulOverflowMask\n{\n    static const size_t value =\n      ~NBitMask<BitSize<size_t>::value - CeilingLog2<N>::value>::value;\n};\ntemplate<> struct MulOverflowMask<0> { /* Error */ };\ntemplate<> struct MulOverflowMask<1> { static const size_t value = 0; };\n\n} // namespace tl\n\n} // namespace mozilla\n\n#endif /* mozilla_TemplateLib_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/ThreadLocal.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cross-platform lightweight thread local data wrappers. */\n\n#ifndef mozilla_ThreadLocal_h\n#define mozilla_ThreadLocal_h\n\n#if defined(XP_WIN)\n// This file will get included in any file that wants to add a profiler mark.\n// In order to not bring <windows.h> together we could include windef.h and\n// winbase.h which are sufficient to get the prototypes for the Tls* functions.\n// # include <windef.h>\n// # include <winbase.h>\n// Unfortunately, even including these headers causes us to add a bunch of ugly\n// stuff to our namespace e.g #define CreateEvent CreateEventW\nextern \"C\" {\n__declspec(dllimport) void* __stdcall TlsGetValue(unsigned long);\n__declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void*);\n__declspec(dllimport) unsigned long __stdcall TlsAlloc();\n}\n#else\n#  include <pthread.h>\n#  include <signal.h>\n#endif\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n// sig_safe_t denotes an atomic type which can be read or stored in a single\n// instruction.  This means that data of this type is safe to be manipulated\n// from a signal handler, or other similar asynchronous execution contexts.\n#if defined(XP_WIN)\ntypedef unsigned long sig_safe_t;\n#else\ntypedef sig_atomic_t sig_safe_t;\n#endif\n\n/*\n * Thread Local Storage helpers.\n *\n * Usage:\n *\n * Only static-storage-duration (e.g. global variables, or static class members)\n * objects of this class should be instantiated. This class relies on\n * zero-initialization, which is implicit for static-storage-duration objects.\n * It doesn't have a custom default constructor, to avoid static initializers.\n *\n * API usage:\n *\n * // Create a TLS item\n * mozilla::ThreadLocal<int> tlsKey;\n * if (!tlsKey.init()) {\n *   // deal with the error\n * }\n *\n * // Set the TLS value\n * tlsKey.set(123);\n *\n * // Get the TLS value\n * int value = tlsKey.get();\n */\ntemplate<typename T>\nclass ThreadLocal\n{\n#if defined(XP_WIN)\n    typedef unsigned long key_t;\n#else\n    typedef pthread_key_t key_t;\n#endif\n\n    union Helper {\n      void* ptr;\n      T value;\n    };\n\n  public:\n    MOZ_WARN_UNUSED_RESULT inline bool init();\n\n    inline T get() const;\n\n    inline void set(const T value);\n\n    bool initialized() const {\n      return inited;\n    }\n\n  private:\n    key_t key;\n    bool inited;\n};\n\ntemplate<typename T>\ninline bool\nThreadLocal<T>::init()\n{\n  static_assert(sizeof(T) <= sizeof(void*),\n                \"mozilla::ThreadLocal can't be used for types larger than \"\n                \"a pointer\");\n  MOZ_ASSERT(!initialized());\n#ifdef XP_WIN\n  key = TlsAlloc();\n  inited = key != 0xFFFFFFFFUL; // TLS_OUT_OF_INDEXES\n#else\n  inited = !pthread_key_create(&key, nullptr);\n#endif\n  return inited;\n}\n\ntemplate<typename T>\ninline T\nThreadLocal<T>::get() const\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n#ifdef XP_WIN\n  h.ptr = TlsGetValue(key);\n#else\n  h.ptr = pthread_getspecific(key);\n#endif\n  return h.value;\n}\n\ntemplate<typename T>\ninline void\nThreadLocal<T>::set(const T value)\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n  h.value = value;\n  bool succeeded;\n#ifdef XP_WIN\n  succeeded = TlsSetValue(key, h.ptr);\n#else\n  succeeded = !pthread_setspecific(key, h.ptr);\n#endif\n  if (!succeeded)\n    MOZ_CRASH();\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_ThreadLocal_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/TypeTraits.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Template-based metaprogramming and type-testing facilities. */\n\n#ifndef mozilla_TypeTraits_h\n#define mozilla_TypeTraits_h\n\n/*\n * These traits are approximate copies of the traits and semantics from C++11's\n * <type_traits> header.  Don't add traits not in that header!  When all\n * platforms provide that header, we can convert all users and remove this one.\n */\n\n#include <wchar.h>\n\nnamespace mozilla {\n\n/* Forward declarations. */\n\ntemplate<typename> struct RemoveCV;\n\n/* 20.9.3 Helper classes [meta.help] */\n\n/**\n * Helper class used as a base for various type traits, exposed publicly\n * because <type_traits> exposes it as well.\n */\ntemplate<typename T, T Value>\nstruct IntegralConstant\n{\n    static const T value = Value;\n    typedef T ValueType;\n    typedef IntegralConstant<T, Value> Type;\n};\n\n/** Convenient aliases. */\ntypedef IntegralConstant<bool, true> TrueType;\ntypedef IntegralConstant<bool, false> FalseType;\n\n/* 20.9.4 Unary type traits [meta.unary] */\n\n/* 20.9.4.1 Primary type categories [meta.unary.cat] */\n\nnamespace detail {\n\ntemplate <typename T>\nstruct IsIntegralHelper : FalseType {};\n\ntemplate<> struct IsIntegralHelper<char>               : TrueType {};\ntemplate<> struct IsIntegralHelper<signed char>        : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned char>      : TrueType {};\ntemplate<> struct IsIntegralHelper<short>              : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned short>     : TrueType {};\ntemplate<> struct IsIntegralHelper<int>                : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned int>       : TrueType {};\ntemplate<> struct IsIntegralHelper<long>               : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long>      : TrueType {};\ntemplate<> struct IsIntegralHelper<long long>          : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long long> : TrueType {};\ntemplate<> struct IsIntegralHelper<bool>               : TrueType {};\ntemplate<> struct IsIntegralHelper<wchar_t>            : TrueType {};\n\n} /* namespace detail */\n\n/**\n * IsIntegral determines whether a type is an integral type.\n *\n * mozilla::IsIntegral<int>::value is true;\n * mozilla::IsIntegral<unsigned short>::value is true;\n * mozilla::IsIntegral<const long>::value is true;\n * mozilla::IsIntegral<int*>::value is false;\n * mozilla::IsIntegral<double>::value is false;\n *\n * Note that the behavior of IsIntegral on char16_t and char32_t is\n * unspecified.\n */\ntemplate<typename T>\nstruct IsIntegral : detail::IsIntegralHelper<typename RemoveCV<T>::Type>\n{};\n\ntemplate<typename T, typename U>\nstruct IsSame;\n\nnamespace detail {\n\ntemplate<typename T>\nstruct IsFloatingPointHelper\n  : IntegralConstant<bool,\n                     IsSame<T, float>::value ||\n                     IsSame<T, double>::value ||\n                     IsSame<T, long double>::value>\n{};\n\n} // namespace detail\n\n/**\n * IsFloatingPoint determines whether a type is a floating point type (float,\n * double, long double).\n *\n * mozilla::IsFloatingPoint<int>::value is false;\n * mozilla::IsFloatingPoint<const float>::value is true;\n * mozilla::IsFloatingPoint<long double>::value is true;\n * mozilla::IsFloatingPoint<double*>::value is false.\n */\ntemplate<typename T>\nstruct IsFloatingPoint\n  : detail::IsFloatingPointHelper<typename RemoveCV<T>::Type>\n{};\n\n/**\n * IsPointer determines whether a type is a pointer type (but not a pointer-to-\n * member type).\n *\n * mozilla::IsPointer<struct S*>::value is true;\n * mozilla::IsPointer<int**>::value is true;\n * mozilla::IsPointer<void (*)(void)>::value is true;\n * mozilla::IsPointer<int>::value is false;\n * mozilla::IsPointer<struct S>::value is false.\n */\ntemplate<typename T>\nstruct IsPointer : FalseType {};\n\ntemplate<typename T>\nstruct IsPointer<T*> : TrueType {};\n\nnamespace detail {\n\n// __is_enum is a supported extension across all of our supported compilers.\ntemplate<typename T>\nstruct IsEnumHelper\n  : IntegralConstant<bool, __is_enum(T)>\n{};\n\n} // namespace detail\n\n/**\n * IsEnum determines whether a type is an enum type.\n *\n * mozilla::IsEnum<enum S>::value is true;\n * mozilla::IsEnum<enum S*>::value is false;\n * mozilla::IsEnum<int>::value is false;\n */\ntemplate<typename T>\nstruct IsEnum\n  : detail::IsEnumHelper<typename RemoveCV<T>::Type>\n{};\n\n/* 20.9.4.2 Composite type traits [meta.unary.comp] */\n\n/**\n * IsArithmetic determines whether a type is arithmetic.  A type is arithmetic\n * iff it is an integral type or a floating point type.\n *\n * mozilla::IsArithmetic<int>::value is true;\n * mozilla::IsArithmetic<double>::value is true;\n * mozilla::IsArithmetic<long double*>::value is false.\n */\ntemplate<typename T>\nstruct IsArithmetic\n  : IntegralConstant<bool, IsIntegral<T>::value || IsFloatingPoint<T>::value>\n{};\n\n/* 20.9.4.3 Type properties [meta.unary.prop] */\n\n/**\n * IsConst determines whether a type is const or not.\n *\n * mozilla::IsConst<int>::value is false;\n * mozilla::IsConst<void* const>::value is true;\n * mozilla::IsConst<const char*>::value is false.\n */\ntemplate<typename T>\nstruct IsConst : FalseType {};\n\ntemplate<typename T>\nstruct IsConst<const T> : TrueType {};\n\n/**\n * IsVolatile determines whether a type is volatile or not.\n *\n * mozilla::IsVolatile<int>::value is false;\n * mozilla::IsVolatile<void* volatile>::value is true;\n * mozilla::IsVolatile<volatile char*>::value is false.\n */\ntemplate<typename T>\nstruct IsVolatile : FalseType {};\n\ntemplate<typename T>\nstruct IsVolatile<volatile T> : TrueType {};\n\n/**\n * Traits class for identifying POD types.  Until C++11 there's no automatic\n * way to detect PODs, so for the moment this is done manually.  Users may\n * define specializations of this class that inherit from mozilla::TrueType and\n * mozilla::FalseType (or equivalently mozilla::IntegralConstant<bool, true or\n * false>, or conveniently from mozilla::IsPod for composite types) as needed to\n * ensure correct IsPod behavior.\n */\ntemplate<typename T>\nstruct IsPod : public FalseType {};\n\ntemplate<> struct IsPod<char>               : TrueType {};\ntemplate<> struct IsPod<signed char>        : TrueType {};\ntemplate<> struct IsPod<unsigned char>      : TrueType {};\ntemplate<> struct IsPod<short>              : TrueType {};\ntemplate<> struct IsPod<unsigned short>     : TrueType {};\ntemplate<> struct IsPod<int>                : TrueType {};\ntemplate<> struct IsPod<unsigned int>       : TrueType {};\ntemplate<> struct IsPod<long>               : TrueType {};\ntemplate<> struct IsPod<unsigned long>      : TrueType {};\ntemplate<> struct IsPod<long long>          : TrueType {};\ntemplate<> struct IsPod<unsigned long long> : TrueType {};\ntemplate<> struct IsPod<bool>               : TrueType {};\ntemplate<> struct IsPod<float>              : TrueType {};\ntemplate<> struct IsPod<double>             : TrueType {};\ntemplate<> struct IsPod<wchar_t>            : TrueType {};\ntemplate<typename T> struct IsPod<T*>       : TrueType {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsSignedHelper;\n\ntemplate<typename T>\nstruct IsSignedHelper<T, true> : TrueType {};\n\ntemplate<typename T>\nstruct IsSignedHelper<T, false>\n  : IntegralConstant<bool, IsArithmetic<T>::value && T(-1) < T(1)>\n{};\n\n} // namespace detail\n\n/**\n * IsSigned determines whether a type is a signed arithmetic type.  |char| is\n * considered a signed type if it has the same representation as |signed char|.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsSigned<int>::value is true;\n * mozilla::IsSigned<const unsigned int>::value is false;\n * mozilla::IsSigned<unsigned char>::value is false;\n * mozilla::IsSigned<float>::value is true.\n */\ntemplate<typename T>\nstruct IsSigned : detail::IsSignedHelper<T> {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsUnsignedHelper;\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, true> : FalseType {};\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, false>\n  : IntegralConstant<bool,\n                     IsArithmetic<T>::value &&\n                     (IsSame<typename RemoveCV<T>::Type, bool>::value ||\n                      T(1) < T(-1))>\n{};\n\n} // namespace detail\n\n/**\n * IsUnsigned determines whether a type is an unsigned arithmetic type.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsUnsigned<int>::value is false;\n * mozilla::IsUnsigned<const unsigned int>::value is true;\n * mozilla::IsUnsigned<unsigned char>::value is true;\n * mozilla::IsUnsigned<float>::value is false.\n */\ntemplate<typename T>\nstruct IsUnsigned : detail::IsUnsignedHelper<T> {};\n\n/* 20.9.5 Type property queries [meta.unary.prop.query] */\n\n/* 20.9.6 Relationships between types [meta.rel] */\n\n/**\n * IsSame tests whether two types are the same type.\n *\n * mozilla::IsSame<int, int>::value is true;\n * mozilla::IsSame<int*, int*>::value is true;\n * mozilla::IsSame<int, unsigned int>::value is false;\n * mozilla::IsSame<void, void>::value is true;\n * mozilla::IsSame<const int, int>::value is false;\n * mozilla::IsSame<struct S, struct S>::value is true.\n */\ntemplate<typename T, typename U>\nstruct IsSame : FalseType {};\n\ntemplate<typename T>\nstruct IsSame<T, T> : TrueType {};\n\nnamespace detail {\n\n// The trickery used to implement IsBaseOf here makes it possible to use it for\n// the cases of private and multiple inheritance.  This code was inspired by the\n// sample code here:\n//\n// http://stackoverflow.com/questions/2910979/how-is-base-of-works\ntemplate<class Base, class Derived>\nstruct BaseOfHelper\n{\n  public:\n    operator Base*() const;\n    operator Derived*();\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base, const Derived>\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base&, Derived&> : FalseType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, Type> : TrueType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, const Type> : TrueType {};\n\n} /* namespace detail */\n\n/*\n * IsBaseOf allows to know whether a given class is derived from another.\n *\n * Consider the following class definitions:\n *\n *   class A {};\n *   class B : public A {};\n *   class C {};\n *\n * mozilla::IsBaseOf<A, B>::value is true;\n * mozilla::IsBaseOf<A, C>::value is false;\n */\ntemplate<class Base, class Derived>\nstruct IsBaseOf\n  : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>\n{};\n\nnamespace detail {\n\ntemplate<typename From, typename To>\nstruct ConvertibleTester\n{\n  private:\n    static From create();\n\n    template<typename From1, typename To1>\n    static char test(To to);\n\n    template<typename From1, typename To1>\n    static int test(...);\n\n  public:\n    static const bool value =\n      sizeof(test<From, To>(create())) == sizeof(char);\n};\n\n} // namespace detail\n\n/**\n * IsConvertible determines whether a value of type From will implicitly convert\n * to a value of type To.  For example:\n *\n *   struct A {};\n *   struct B : public A {};\n *   struct C {};\n *\n * mozilla::IsConvertible<A, A>::value is true;\n * mozilla::IsConvertible<A*, A*>::value is true;\n * mozilla::IsConvertible<B, A>::value is true;\n * mozilla::IsConvertible<B*, A*>::value is true;\n * mozilla::IsConvertible<C, A>::value is false;\n * mozilla::IsConvertible<A, C>::value is false;\n * mozilla::IsConvertible<A*, C*>::value is false;\n * mozilla::IsConvertible<C*, A*>::value is false.\n *\n * For obscure reasons, you can't use IsConvertible when the types being tested\n * are related through private inheritance, and you'll get a compile error if\n * you try.  Just don't do it!\n */\ntemplate<typename From, typename To>\nstruct IsConvertible\n  : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>\n{};\n\n/* 20.9.7 Transformations between types [meta.trans] */\n\n/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */\n\n/**\n * RemoveConst removes top-level const qualifications on a type.\n *\n * mozilla::RemoveConst<int>::Type is int;\n * mozilla::RemoveConst<const int>::Type is int;\n * mozilla::RemoveConst<const int*>::Type is const int*;\n * mozilla::RemoveConst<int* const>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveConst\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveConst<const T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveVolatile removes top-level volatile qualifications on a type.\n *\n * mozilla::RemoveVolatile<int>::Type is int;\n * mozilla::RemoveVolatile<volatile int>::Type is int;\n * mozilla::RemoveVolatile<volatile int*>::Type is volatile int*;\n * mozilla::RemoveVolatile<int* volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveVolatile\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveVolatile<volatile T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveCV removes top-level const and volatile qualifications on a type.\n *\n * mozilla::RemoveCV<int>::Type is int;\n * mozilla::RemoveCV<const int>::Type is int;\n * mozilla::RemoveCV<volatile int>::Type is int;\n * mozilla::RemoveCV<int* const volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveCV\n{\n    typedef typename RemoveConst<typename RemoveVolatile<T>::Type>::Type Type;\n};\n\n/* 20.9.7.2 Reference modifications [meta.trans.ref] */\n\n/* 20.9.7.3 Sign modifications [meta.trans.sign] */\n\ntemplate<bool B, typename T = void>\nstruct EnableIf;\n\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional;\n\nnamespace detail {\n\ntemplate<bool MakeConst, typename T>\nstruct WithC : Conditional<MakeConst, const T, T>\n{};\n\ntemplate<bool MakeVolatile, typename T>\nstruct WithV : Conditional<MakeVolatile, volatile T, T>\n{};\n\n\ntemplate<bool MakeConst, bool MakeVolatile, typename T>\nstruct WithCV : WithC<MakeConst, typename WithV<MakeVolatile, T>::Type>\n{};\n\ntemplate<typename T>\nstruct CorrespondingSigned;\n\ntemplate<>\nstruct CorrespondingSigned<char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned short> { typedef short Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned int> { typedef int Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long> { typedef long Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long long> { typedef long long Type; };\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsSignedIntegerType = IsSigned<CVRemoved>::value &&\n                                    !IsSame<char, CVRemoved>::value>\nstruct MakeSigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingSigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeSigned produces the corresponding signed integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already a signed integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an unsigned integer type, the signed variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the integral type of the same size as T, with the lowest rank,\n * with T's const/volatile qualifiers, is produced.  (This basically only acts\n * to produce signed char when T = char.)\n *\n * mozilla::MakeSigned<unsigned long>::Type is signed long;\n * mozilla::MakeSigned<volatile int>::Type is volatile int;\n * mozilla::MakeSigned<const unsigned short>::Type is const signed short;\n * mozilla::MakeSigned<const char>::Type is const signed char;\n * mozilla::MakeSigned<bool> is an error;\n * mozilla::MakeSigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeSigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeSigned<T>\n            >::Type\n{};\n\nnamespace detail {\n\ntemplate<typename T>\nstruct CorrespondingUnsigned;\n\ntemplate<>\nstruct CorrespondingUnsigned<char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<signed char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<short> { typedef unsigned short Type; };\ntemplate<>\nstruct CorrespondingUnsigned<int> { typedef unsigned int Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long> { typedef unsigned long Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long long> { typedef unsigned long long Type; };\n\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsUnsignedIntegerType = IsUnsigned<CVRemoved>::value &&\n                                      !IsSame<char, CVRemoved>::value>\nstruct MakeUnsigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingUnsigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeUnsigned produces the corresponding unsigned integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already an unsigned integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an signed integer type, the unsigned variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the unsigned integral type of the same size as T, with the lowest\n * rank, with T's const/volatile qualifiers, is produced.  (This basically only\n * acts to produce unsigned char when T = char.)\n *\n * mozilla::MakeUnsigned<signed long>::Type is unsigned long;\n * mozilla::MakeUnsigned<volatile unsigned int>::Type is volatile unsigned int;\n * mozilla::MakeUnsigned<const signed short>::Type is const unsigned short;\n * mozilla::MakeUnsigned<const char>::Type is const unsigned char;\n * mozilla::MakeUnsigned<bool> is an error;\n * mozilla::MakeUnsigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeUnsigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeUnsigned<T>\n            >::Type\n{};\n\n/* 20.9.7.4 Array modifications [meta.trans.arr] */\n\n/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */\n\n/* 20.9.7.6 Other transformations [meta.trans.other] */\n\n/**\n * EnableIf is a struct containing a typedef of T if and only if B is true.\n *\n * mozilla::EnableIf<true, int>::Type is int;\n * mozilla::EnableIf<false, int>::Type is a compile-time error.\n *\n * Use this template to implement SFINAE-style (Substitution Failure Is not An\n * Error) requirements.  For example, you might use it to impose a restriction\n * on a template parameter:\n *\n *   template<typename T>\n *   class PodVector // vector optimized to store POD (memcpy-able) types\n *   {\n *      EnableIf<IsPod<T>::value, T>::Type* vector;\n *      size_t length;\n *      ...\n *   };\n */\ntemplate<bool B, typename T>\nstruct EnableIf\n{};\n\ntemplate<typename T>\nstruct EnableIf<true, T>\n{\n    typedef T Type;\n};\n\n/**\n * Conditional selects a class between two, depending on a given boolean value.\n *\n * mozilla::Conditional<true, A, B>::Type is A;\n * mozilla::Conditional<false, A, B>::Type is B;\n */\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional\n{\n    typedef A Type;\n};\n\ntemplate<class A, class B>\nstruct Conditional<false, A, B>\n{\n    typedef B Type;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_TypeTraits_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/TypedEnum.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Macros to emulate C++11 typed enums and enum classes. */\n\n#ifndef mozilla_TypedEnum_h\n#define mozilla_TypedEnum_h\n\n#include \"mozilla/Attributes.h\"\n\n#if defined(__cplusplus)\n\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_strong_enums)\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)\n#      define MOZ_HAVE_CXX11_ENUM_TYPE\n#      define MOZ_HAVE_CXX11_STRONG_ENUMS\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1400\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#  endif\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#endif\n\n/**\n * MOZ_ENUM_TYPE specifies the underlying numeric type for an enum.  It's\n * specified by placing MOZ_ENUM_TYPE(type) immediately after the enum name in\n * its declaration, and before the opening curly brace, like\n *\n *   enum MyEnum MOZ_ENUM_TYPE(uint16_t)\n *   {\n *     A,\n *     B = 7,\n *     C\n *   };\n *\n * In supporting compilers, the macro will expand to \": uint16_t\".  The\n * compiler will allocate exactly two bytes for MyEnum and will require all\n * enumerators to have values between 0 and 65535.  (Thus specifying \"B =\n * 100000\" instead of \"B = 7\" would fail to compile.)  In old compilers the\n * macro expands to the empty string, and the underlying type is generally\n * undefined.\n */\n#ifdef MOZ_HAVE_CXX11_ENUM_TYPE\n#  define MOZ_ENUM_TYPE(type)   : type\n#else\n#  define MOZ_ENUM_TYPE(type)   /* no support */\n#endif\n\n/**\n * MOZ_BEGIN_ENUM_CLASS and MOZ_END_ENUM_CLASS provide access to the\n * strongly-typed enumeration feature of C++11 (\"enum class\").  If supported\n * by the compiler, an enum defined using these macros will not be implicitly\n * converted to any other type, and its enumerators will be scoped using the\n * enumeration name.  Place MOZ_BEGIN_ENUM_CLASS(EnumName, type) in place of\n * \"enum EnumName {\", and MOZ_END_ENUM_CLASS(EnumName) in place of the closing\n * \"};\".  For example,\n *\n *   MOZ_BEGIN_ENUM_CLASS(Enum, int32_t)\n *     A,\n *     B = 6\n *   MOZ_END_ENUM_CLASS(Enum)\n *\n * This will make \"Enum::A\" and \"Enum::B\" appear in the global scope, but \"A\"\n * and \"B\" will not.  In compilers that support C++11 strongly-typed\n * enumerations, implicit conversions of Enum values to numeric types will\n * fail.  In other compilers, Enum itself will actually be defined as a class,\n * and some implicit conversions will fail while others will succeed.\n *\n * The type argument specifies the underlying type for the enum where\n * supported, as with MOZ_ENUM_TYPE().  For simplicity, it is currently\n * mandatory.  As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do\n * not support it.\n *\n * MOZ_{BEGIN,END}_ENUM_CLASS doesn't work for defining enum classes nested\n * inside classes.  To define an enum class nested inside another class, use\n * MOZ_{BEGIN,END}_NESTED_ENUM_CLASS, and place a MOZ_FINISH_NESTED_ENUM_CLASS\n * in namespace scope to handle bits that can only be implemented with\n * namespace-scoped code.  For example:\n *\n *   class FooBar {\n *\n *     MOZ_BEGIN_NESTED_ENUM_CLASS(Enum, int32_t)\n *       A,\n *       B = 6\n *     MOZ_END_NESTED_ENUM_CLASS(Enum)\n *\n *   };\n *\n *   MOZ_FINISH_NESTED_ENUM_CLASS(FooBar::Enum)\n */\n#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS)\n  /*\n   * All compilers that support strong enums also support an explicit\n   * underlying type, so no extra check is needed.\n   */\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     enum class Name : type {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) /* nothing */\n#else\n   /**\n    * We need Name to both name a type, and scope the provided enumerator\n    * names.  Namespaces and classes both provide scoping, but namespaces\n    * aren't types, so we need to use a class that wraps the enum values.  We\n    * have an implicit conversion from the inner enum type to the class, so\n    * statements like\n    *\n    *   Enum x = Enum::A;\n    *\n    * will still work.  We need to define an implicit conversion from the class\n    * to the inner enum as well, so that (for instance) switch statements will\n    * work.  This means that the class can be implicitly converted to a numeric\n    * value as well via the enum type, since C++ allows an implicit\n    * user-defined conversion followed by a standard conversion to still be\n    * implicit.\n    *\n    * We have an explicit constructor from int defined, so that casts like\n    * (Enum)7 will still work.  We also have a zero-argument constructor with\n    * no arguments, so declaration without initialization (like \"Enum foo;\")\n    * will work.\n    *\n    * Additionally, we'll delete as many operators as possible for the inner\n    * enum type, so statements like this will still fail:\n    *\n    *   f(5 + Enum::B); // deleted operator+\n    *\n    * But we can't prevent things like this, because C++ doesn't allow\n    * overriding conversions or assignment operators for enums:\n    *\n    *   int x = Enum::A;\n    *   int f()\n    *   {\n    *     return Enum::A;\n    *   }\n    */\\\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     class Name \\\n     { \\\n       public: \\\n         enum Enum MOZ_ENUM_TYPE(type) \\\n         {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n         }; \\\n         Name() {} \\\n         Name(Enum aEnum) : mEnum(aEnum) {} \\\n         explicit Name(int num) : mEnum((Enum)num) {} \\\n         operator Enum() const { return mEnum; } \\\n       private: \\\n         Enum mEnum; \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) \\\n     inline int operator+(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator-(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator*(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator*(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator/(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator/(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator%(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator%(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator++(Name::Enum&) MOZ_DELETE; \\\n     inline int operator++(Name::Enum&, int) MOZ_DELETE; \\\n     inline int& operator--(Name::Enum&) MOZ_DELETE; \\\n     inline int operator--(Name::Enum&, int) MOZ_DELETE; \\\n     inline bool operator==(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator==(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator!=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!(const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline bool operator||(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator||(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline int operator~(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator|(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator|(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator^(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator^(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator<<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator<<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator>>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator>>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int& operator+=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator-=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator*=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator/=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator%=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator&=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator|=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator^=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator<<=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator>>=(int&, const Name::Enum&) MOZ_DELETE;\n#endif\n#  define MOZ_BEGIN_ENUM_CLASS(Name, type) MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type)\n#  define MOZ_END_ENUM_CLASS(Name) \\\n     MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     MOZ_FINISH_NESTED_ENUM_CLASS(Name)\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_TypedEnum_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Types.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt foundational types and macros. */\n\n#ifndef mozilla_Types_h\n#define mozilla_Types_h\n\n/*\n * This header must be valid C and C++, includable by code embedding either\n * SpiderMonkey or Gecko.\n */\n\n/* Expose all <stdint.h> types and size_t. */\n#include <stddef.h>\n#include <stdint.h>\n\n/* Implement compiler and linker macros needed for APIs. */\n\n/*\n * MOZ_EXPORT is used to declare and define a symbol or type which is externally\n * visible to users of the current library.  It encapsulates various decorations\n * needed to properly export the method's symbol.\n *\n *   api.h:\n *     extern MOZ_EXPORT int MeaningOfLife(void);\n *     extern MOZ_EXPORT int LuggageCombination;\n *\n *   api.c:\n *     int MeaningOfLife(void) { return 42; }\n *     int LuggageCombination = 12345;\n *\n * If you are merely sharing a method across files, just use plain |extern|.\n * These macros are designed for use by library interfaces -- not for normal\n * methods or data used cross-file.\n */\n#if defined(WIN32) || defined(XP_OS2)\n#  define MOZ_EXPORT   __declspec(dllexport)\n#else /* Unix */\n#  ifdef HAVE_VISIBILITY_ATTRIBUTE\n#    define MOZ_EXPORT       __attribute__((visibility(\"default\")))\n#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n#    define MOZ_EXPORT      __global\n#  else\n#    define MOZ_EXPORT /* nothing */\n#  endif\n#endif\n\n\n/*\n * Whereas implementers use MOZ_EXPORT to declare and define library symbols,\n * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the\n * implementer of the library will expose an API macro which expands to either\n * the export or import version of the macro, depending upon the compilation\n * mode.\n */\n#ifdef _WIN32\n#  if defined(__MWERKS__)\n#    define MOZ_IMPORT_API /* nothing */\n#  else\n#    define MOZ_IMPORT_API __declspec(dllimport)\n#  endif\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_API  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_API MOZ_EXPORT\n#endif\n\n#if defined(_WIN32) && !defined(__MWERKS__)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_DATA  MOZ_EXPORT\n#endif\n\n/*\n * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose\n * export mfbt declarations when building mfbt, and they expose import mfbt\n * declarations when using mfbt.\n */\n#if defined(IMPL_MFBT)\n#  define MFBT_API     MOZ_EXPORT\n#  define MFBT_DATA    MOZ_EXPORT\n#else\n  /*\n   * On linux mozglue is linked in the program and we link libxul.so with\n   * -z,defs. Normally that causes the linker to reject undefined references in\n   * libxul.so, but as a loophole it allows undefined references to weak\n   * symbols. We add the weak attribute to the import version of the MFBT API\n   * macros to exploit this.\n   */\n#  if defined(MOZ_GLUE_IN_PROGRAM)\n#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API\n#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA\n#  else\n#    define MFBT_API   MOZ_IMPORT_API\n#    define MFBT_DATA  MOZ_IMPORT_DATA\n#  endif\n#endif\n\n/*\n * C symbols in C++ code must be declared immediately within |extern \"C\"|\n * blocks.  However, in C code, they need not be declared specially.  This\n * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C\n * macros, so that the user need not know whether he is being used in C or C++\n * code.\n *\n *   MOZ_BEGIN_EXTERN_C\n *\n *   extern MOZ_EXPORT int MostRandomNumber(void);\n *   ...other declarations...\n *\n *   MOZ_END_EXTERN_C\n *\n * This said, it is preferable to just use |extern \"C\"| in C++ header files for\n * its greater clarity.\n */\n#ifdef __cplusplus\n#  define MOZ_BEGIN_EXTERN_C    extern \"C\" {\n#  define MOZ_END_EXTERN_C      }\n#else\n#  define MOZ_BEGIN_EXTERN_C\n#  define MOZ_END_EXTERN_C\n#endif\n\n/*\n * GCC's typeof is available when decltype is not.\n */\n#if defined(__GNUC__) && defined(__cplusplus) && \\\n  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L\n#  define decltype __typeof__\n#endif\n\n#endif /* mozilla_Types_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Util.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Miscellaneous uncategorized functionality.  Please add new functionality to\n * new headers, or to other appropriate existing headers, not here.\n */\n\n#ifndef mozilla_Util_h\n#define mozilla_Util_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many \n * bytes of alignment a given type needs.\n */\ntemplate<class T>\nclass AlignmentFinder\n{\n    struct Aligner\n    {\n        char c;\n        T t;\n    };\n\n  public:\n    static const size_t alignment = sizeof(Aligner) - sizeof(T);\n};\n\n#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment\n\n/*\n * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.\n *\n * For instance,\n *\n *   MOZ_ALIGNED_DECL(char arr[2], 8);\n *\n * will declare a two-character array |arr| aligned to 8 bytes.\n */\n\n#if defined(__GNUC__)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     _type __attribute__((aligned(_align)))\n#elif defined(_MSC_VER)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     __declspec(align(_align)) _type\n#else\n#  warning \"We don't know how to align variables on this compiler.\"\n#  define MOZ_ALIGNED_DECL(_type, _align) _type\n#endif\n\n/*\n * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N\n * bytes.\n *\n * We support 1, 2, 4, 8, and 16-bit alignment.\n */\ntemplate<size_t align>\nstruct AlignedElem;\n\n/*\n * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where\n * foo is a template parameter.\n */\n\ntemplate<>\nstruct AlignedElem<1>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 1);\n};\n\ntemplate<>\nstruct AlignedElem<2>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 2);\n};\n\ntemplate<>\nstruct AlignedElem<4>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 4);\n};\n\ntemplate<>\nstruct AlignedElem<8>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 8);\n};\n\ntemplate<>\nstruct AlignedElem<16>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 16);\n};\n\n/*\n * This utility pales in comparison to Boost's aligned_storage. The utility\n * simply assumes that uint64_t is enough alignment for anyone. This may need\n * to be extended one day...\n *\n * As an important side effect, pulling the storage into this template is\n * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving\n * false negatives when we cast from the char buffer to whatever type we've\n * constructed using the bytes.\n */\ntemplate<size_t nbytes>\nstruct AlignedStorage\n{\n    union U {\n      char bytes[nbytes];\n      uint64_t _;\n    } u;\n\n    const void* addr() const { return u.bytes; }\n    void* addr() { return u.bytes; }\n};\n\ntemplate<class T>\nstruct AlignedStorage2\n{\n    union U {\n      char bytes[sizeof(T)];\n      uint64_t _;\n    } u;\n\n    const T* addr() const { return reinterpret_cast<const T*>(u.bytes); }\n    T* addr() { return static_cast<T*>(static_cast<void*>(u.bytes)); }\n};\n\n/*\n * Small utility for lazily constructing objects without using dynamic storage.\n * When a Maybe<T> is constructed, it is |empty()|, i.e., no value of T has\n * been constructed and no T destructor will be called when the Maybe<T> is\n * destroyed. Upon calling |construct|, a T object will be constructed with the\n * given arguments and that object will be destroyed when the owning Maybe<T>\n * is destroyed.\n *\n * N.B. GCC seems to miss some optimizations with Maybe and may generate extra\n * branches/loads/stores. Use with caution on hot paths.\n */\ntemplate<class T>\nclass Maybe\n{\n    AlignedStorage2<T> storage;\n    bool constructed;\n\n    T& asT() { return *storage.addr(); }\n\n  public:\n    Maybe() { constructed = false; }\n    ~Maybe() { if (constructed) asT().~T(); }\n\n    bool empty() const { return !constructed; }\n\n    void construct() {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T();\n      constructed = true;\n    }\n\n    template<class T1>\n    void construct(const T1& t1) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1);\n      constructed = true;\n    }\n\n    template<class T1, class T2>\n    void construct(const T1& t1, const T2& t2) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3>\n    void construct(const T1& t1, const T2& t2, const T3& t3) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9, class T10>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);\n      constructed = true;\n    }\n\n    T* addr() {\n      MOZ_ASSERT(constructed);\n      return &asT();\n    }\n\n    T& ref() {\n      MOZ_ASSERT(constructed);\n      return asT();\n    }\n\n    const T& ref() const {\n      MOZ_ASSERT(constructed);\n      return const_cast<Maybe*>(this)->asT();\n    }\n\n    void destroy() {\n      ref().~T();\n      constructed = false;\n    }\n\n    void destroyIfConstructed() {\n      if (!empty())\n        destroy();\n    }\n\n  private:\n    Maybe(const Maybe& other) MOZ_DELETE;\n    const Maybe& operator=(const Maybe& other) MOZ_DELETE;\n};\n\n/*\n * Safely subtract two pointers when it is known that end >= begin.  This avoids\n * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB\n * set, the unsigned subtraction followed by right shift will produce -1, or\n * size_t(-1), instead of the real difference.\n */\ntemplate<class T>\nMOZ_ALWAYS_INLINE size_t\nPointerRangeSize(T* begin, T* end)\n{\n  MOZ_ASSERT(end >= begin);\n  return (size_t(end) - size_t(begin)) / sizeof(T);\n}\n\n/*\n * Compute the length of an array with constant length.  (Use of this method\n * with a non-array pointer will not compile.)\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR size_t\nArrayLength(T (&arr)[N])\n{\n  return N;\n}\n\n/*\n * Compute the address one past the last element of a constant-length array.\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR T*\nArrayEnd(T (&arr)[N])\n{\n  return arr + ArrayLength(arr);\n}\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n/*\n * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files\n * that can't use C++ template functions and for static_assert() calls that\n * can't call ArrayLength() when it is not a C++11 constexpr function.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_ARRAY_LENGTH(array)   mozilla::ArrayLength(array)\n#else\n#  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))\n#endif\n\n#endif /* mozilla_Util_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type/length-parametrized vector class. */\n\n#ifndef mozilla_Vector_h\n#define mozilla_Vector_h\n\n#include \"mozilla/AllocPolicy.h\"\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/MathAlgorithms.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include <new> // for placement new\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace mozilla {\n\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase;\n\nnamespace detail {\n\n/*\n * Check that the given capacity wastes the minimal amount of space if\n * allocated on the heap.  This means that cap*sizeof(T) is as close to a\n * power-of-two as possible.  growStorageBy() is responsible for ensuring\n * this.\n */\ntemplate<typename T>\nstatic bool CapacityHasExcessSpace(size_t cap)\n{\n  size_t size = cap * sizeof(T);\n  return RoundUpPow2(size) - size >= sizeof(T);\n}\n\n/*\n * This template class provides a default implementation for vector operations\n * when the element type is not known to be a POD, as judged by IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector, bool IsPod>\nstruct VectorImpl\n{\n    /* Destroys constructed objects in the range [begin, end). */\n    static inline void destroy(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        p->~T();\n    }\n\n    /* Constructs objects in the uninitialized range [begin, end). */\n    static inline void initialize(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(*p);\n    }\n\n    /*\n     * Move-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(Move(*p));\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range [dst, dst+n) from the\n     * same object u.\n     */\n    template<typename U>\n    static inline void copyConstructN(T* dst, size_t n, const U& u) {\n      for (T* end = dst + n; dst < end; ++dst)\n        new(dst) T(u);\n    }\n\n    /*\n     * Grows the given buffer to have capacity newCap, preserving the objects\n     * constructed in the range [begin, end) and updating v. Assumes that (1)\n     * newCap has not overflowed, and (2) multiplying newCap by sizeof(T) will\n     * not overflow.\n     */\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      T* newbuf = reinterpret_cast<T*>(v.malloc_(newCap * sizeof(T)));\n      if (!newbuf)\n        return false;\n      T* dst = newbuf;\n      T* src = v.beginNoCheck();\n      for (; src < v.endNoCheck(); ++dst, ++src)\n        new(dst) T(Move(*src));\n      VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck());\n      v.free_(v.mBegin);\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n/*\n * This partial template specialization provides a default implementation for\n * vector operations when the element type is known to be a POD, as judged by\n * IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector>\nstruct VectorImpl<T, N, AP, ThisVector, true>\n{\n    static inline void destroy(T*, T*) {}\n\n    static inline void initialize(T* begin, T* end) {\n      /*\n       * You would think that memset would be a big win (or even break even)\n       * when we know T is a POD. But currently it's not. This is probably\n       * because |append| tends to be given small ranges and memset requires\n       * a function call that doesn't get inlined.\n       *\n       * memset(begin, 0, sizeof(T) * (end-begin));\n       */\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      /*\n       * See above memset comment. Also, notice that copyConstruct is\n       * currently templated (T != U), so memcpy won't work without\n       * requiring T == U.\n       *\n       * memcpy(dst, srcbeg, sizeof(T) * (srcend - srcbeg));\n       */\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        *dst = *p;\n    }\n\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      copyConstruct(dst, srcbeg, srcend);\n    }\n\n    static inline void copyConstructN(T* dst, size_t n, const T& t) {\n      for (T* end = dst + n; dst < end; ++dst)\n        *dst = t;\n    }\n\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      size_t oldSize = sizeof(T) * v.mCapacity;\n      size_t newSize = sizeof(T) * newCap;\n      T* newbuf = reinterpret_cast<T*>(v.realloc_(v.mBegin, oldSize, newSize));\n      if (!newbuf)\n        return false;\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n} // namespace detail\n\n/*\n * A CRTP base class for vector-like classes.  Unless you really really want\n * your own vector class -- and you almost certainly don't -- you should use\n * mozilla::Vector instead!\n *\n * See mozilla::Vector for interface requirements.\n */\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase : private AllocPolicy\n{\n    /* utilities */\n\n    static const bool sElemIsPod = IsPod<T>::value;\n    typedef detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod> Impl;\n    friend struct detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod>;\n\n    bool growStorageBy(size_t incr);\n    bool convertToHeapStorage(size_t newCap);\n\n    /* magic constants */\n\n    static const int sMaxInlineBytes = 1024;\n\n    /* compute constants */\n\n    /*\n     * Consider element size to be 1 for buffer sizing if there are 0 inline\n     * elements.  This allows us to compile when the definition of the element\n     * type is not visible here.\n     *\n     * Explicit specialization is only allowed at namespace scope, so in order\n     * to keep everything here, we use a dummy template parameter with partial\n     * specialization.\n     */\n    template<int M, int Dummy>\n    struct ElemSize\n    {\n        static const size_t value = sizeof(T);\n    };\n    template<int Dummy>\n    struct ElemSize<0, Dummy>\n    {\n        static const size_t value = 1;\n    };\n\n    static const size_t sInlineCapacity =\n      tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::value>::value;\n\n    /* Calculate inline buffer size; avoid 0-sized array. */\n    static const size_t sInlineBytes =\n      tl::Max<1, sInlineCapacity * ElemSize<N, 0>::value>::value;\n\n    /* member data */\n\n    /*\n     * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,\n     * mBegin + mLength) hold valid constructed T objects. The range [mBegin +\n     * mLength, mBegin + mCapacity) holds uninitialized memory. The range\n     * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory\n     * previously allocated by a call to reserve().\n     */\n    T* mBegin;\n\n    /* Number of elements in the vector. */\n    size_t mLength;\n\n    /* Max number of elements storable in the vector without resizing. */\n    size_t mCapacity;\n\n#ifdef DEBUG\n    /* Max elements of reserved or used space in this vector. */\n    size_t mReserved;\n#endif\n\n    /* Memory used for inline storage. */\n    AlignedStorage<sInlineBytes> storage;\n\n#ifdef DEBUG\n    friend class ReentrancyGuard;\n    bool entered;\n#endif\n\n    /* private accessors */\n\n    bool usingInlineStorage() const {\n      return mBegin == const_cast<VectorBase*>(this)->inlineStorage();\n    }\n\n    T* inlineStorage() {\n      return static_cast<T*>(storage.addr());\n    }\n\n    T* beginNoCheck() const {\n      return mBegin;\n    }\n\n    T* endNoCheck() {\n      return mBegin + mLength;\n    }\n\n    const T* endNoCheck() const {\n      return mBegin + mLength;\n    }\n\n#ifdef DEBUG\n    size_t reserved() const {\n      MOZ_ASSERT(mReserved <= mCapacity);\n      MOZ_ASSERT(mLength <= mReserved);\n      return mReserved;\n    }\n#endif\n\n    /* Append operations guaranteed to succeed due to pre-reserved space. */\n    template<typename U> void internalAppend(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    void internalAppendAll(const VectorBase<U, O, BP, UV>& u);\n    void internalAppendN(const T& t, size_t n);\n    template<typename U> void internalAppend(const U* begin, size_t length);\n\n  public:\n    static const size_t sMaxInlineStorage = N;\n\n    typedef T ElementType;\n\n    VectorBase(AllocPolicy = AllocPolicy());\n    VectorBase(MoveRef<ThisVector>); /* Move constructor. */\n    ThisVector& operator=(MoveRef<ThisVector>); /* Move assignment. */\n    ~VectorBase();\n\n    /* accessors */\n\n    const AllocPolicy& allocPolicy() const {\n      return *this;\n    }\n\n    AllocPolicy& allocPolicy() {\n      return *this;\n    }\n\n    enum { InlineLength = N };\n\n    size_t length() const {\n      return mLength;\n    }\n\n    bool empty() const {\n      return mLength == 0;\n    }\n\n    size_t capacity() const {\n      return mCapacity;\n    }\n\n    T* begin() {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    const T* begin() const {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    T* end() {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    const T* end() const {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    T& operator[](size_t i) {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    T& back() {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    const T& back() const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    class Range\n    {\n        friend class VectorBase;\n        T* cur_;\n        T* end_;\n        Range(T* cur, T* end) : cur_(cur), end_(end) {}\n\n      public:\n        Range() {}\n        bool empty() const { return cur_ == end_; }\n        size_t remain() const { return end_ - cur_; }\n        T& front() const { return *cur_; }\n        void popFront() { MOZ_ASSERT(!empty()); ++cur_; }\n        T popCopyFront() { MOZ_ASSERT(!empty()); return *cur_++; }\n    };\n\n    Range all() {\n      return Range(begin(), end());\n    }\n\n    /* mutators */\n\n    /**\n     * Given that the vector is empty and has no inline storage, grow to\n     * |capacity|.\n     */\n    bool initCapacity(size_t request);\n\n    /**\n     * If reserve(length() + N) succeeds, the N next appends are guaranteed to\n     * succeed.\n     */\n    bool reserve(size_t request);\n\n    /**\n     * Destroy elements in the range [end() - incr, end()). Does not deallocate\n     * or unreserve storage for those elements.\n     */\n    void shrinkBy(size_t incr);\n\n    /** Grow the vector by incr elements. */\n    bool growBy(size_t incr);\n\n    /** Call shrinkBy or growBy based on whether newSize > length(). */\n    bool resize(size_t newLength);\n\n    /**\n     * Increase the length of the vector, but don't initialize the new elements\n     * -- leave them as uninitialized memory.\n     */\n    bool growByUninitialized(size_t incr);\n    bool resizeUninitialized(size_t newLength);\n\n    /** Shorthand for shrinkBy(length()). */\n    void clear();\n\n    /** Clears and releases any heap-allocated storage. */\n    void clearAndFree();\n\n    /**\n     * If true, appending |needed| elements won't reallocate elements storage.\n     * This *doesn't* mean that infallibleAppend may be used!  You still must\n     * reserve the extra space, even if this method indicates that appends won't\n     * need to reallocate elements storage.\n     */\n    bool canAppendWithoutRealloc(size_t needed) const;\n\n    /**\n     * Potentially fallible append operations.\n     *\n     * The function templates that take an unspecified type U require a const T&\n     * or a MoveRef<T>.  The MoveRef<T> variants move their operands into the\n     * vector, instead of copying them.  If they fail, the operand is left\n     * unmoved.\n     */\n    template<typename U> bool append(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    bool appendAll(const VectorBase<U, O, BP, UV>& u);\n    bool appendN(const T& t, size_t n);\n    template<typename U> bool append(const U* begin, const U* end);\n    template<typename U> bool append(const U* begin, size_t length);\n\n    /*\n     * Guaranteed-infallible append operations for use upon vectors whose\n     * memory has been pre-reserved.  Don't use this if you haven't reserved the\n     * memory!\n     */\n    template<typename U> void infallibleAppend(const U& u) {\n      internalAppend(u);\n    }\n    void infallibleAppendN(const T& t, size_t n) {\n      internalAppendN(t, n);\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) {\n      internalAppend(aBegin, PointerRangeSize(aBegin, aEnd));\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, size_t aLength) {\n      internalAppend(aBegin, aLength);\n    }\n\n    void popBack();\n\n    T popCopy();\n\n    /**\n     * Transfers ownership of the internal buffer used by this vector to the\n     * caller.  (It's the caller's responsibility to properly deallocate this\n     * buffer, in accordance with this vector's AllocPolicy.)  After this call,\n     * the vector is empty.  Since the returned buffer may need to be allocated\n     * (if the elements are currently stored in-place), the call can fail,\n     * returning nullptr.\n     *\n     * N.B. Although a T*, only the range [0, length()) is constructed.\n     */\n    T* extractRawBuffer();\n\n    /**\n     * Transfer ownership of an array of objects into the vector.  The caller\n     * must have allocated the array in accordance with this vector's\n     * AllocPolicy.\n     *\n     * N.B. This call assumes that there are no uninitialized elements in the\n     *      passed array.\n     */\n    void replaceRawBuffer(T* p, size_t length);\n\n    /**\n     * Places |val| at position |p|, shifting existing elements from |p| onward\n     * one position higher.  On success, |p| should not be reused because it'll\n     * be a dangling pointer if reallocation of the vector storage occurred; the\n     * return value should be used instead.  On failure, nullptr is returned.\n     *\n     * Example usage:\n     *\n     *   if (!(p = vec.insert(p, val)))\n     *     <handle failure>\n     *   <keep working with p>\n     *\n     * This is inherently a linear-time operation.  Be careful!\n     */\n    T* insert(T* p, const T& val);\n\n    /**\n     * Removes the element |t|, which must fall in the bounds [begin, end),\n     * shifting existing elements from |t + 1| onward one position lower.\n     */\n    void erase(T* t);\n\n    /**\n     * Measure the size of the vector's heap-allocated storage.\n     */\n    size_t sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const;\n\n    /**\n     * Like sizeOfExcludingThis, but also measures the size of the vector\n     * object (which must be heap-allocated) itself.\n     */\n    size_t sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const;\n\n    void swap(ThisVector& other);\n\n  private:\n    VectorBase(const ThisVector&) MOZ_DELETE;\n    void operator=(const ThisVector&) MOZ_DELETE;\n};\n\n/* This does the re-entrancy check plus several other sanity checks. */\n#define MOZ_REENTRANCY_GUARD_ET_AL \\\n  ReentrancyGuard g(*this); \\\n  MOZ_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); \\\n  MOZ_ASSERT(reserved() <= mCapacity); \\\n  MOZ_ASSERT(mLength <= reserved()); \\\n  MOZ_ASSERT(mLength <= mCapacity)\n\n/* Vector Implementation */\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::VectorBase(AP ap)\n  : AP(ap),\n    mBegin(static_cast<T*>(storage.addr())),\n    mLength(0),\n    mCapacity(sInlineCapacity)\n#ifdef DEBUG\n  , mReserved(sInlineCapacity),\n    entered(false)\n#endif\n{}\n\n/* Move constructor. */\ntemplate<typename T, size_t N, class AllocPolicy, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AllocPolicy, TV>::VectorBase(MoveRef<TV> rhs)\n  : AllocPolicy(rhs)\n#ifdef DEBUG\n    , entered(false)\n#endif\n{\n  mLength = rhs->mLength;\n  mCapacity = rhs->mCapacity;\n#ifdef DEBUG\n  mReserved = rhs->mReserved;\n#endif\n\n  if (rhs->usingInlineStorage()) {\n    /* We can't move the buffer over in this case, so copy elements. */\n    mBegin = static_cast<T*>(storage.addr());\n    Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck());\n    /*\n     * Leave rhs's mLength, mBegin, mCapacity, and mReserved as they are.\n     * The elements in its in-line storage still need to be destroyed.\n     */\n  } else {\n    /*\n     * Take src's buffer, and turn src into an empty vector using\n     * in-line storage.\n     */\n    mBegin = rhs->mBegin;\n    rhs->mBegin = static_cast<T*>(rhs->storage.addr());\n    rhs->mCapacity = sInlineCapacity;\n    rhs->mLength = 0;\n#ifdef DEBUG\n    rhs->mReserved = sInlineCapacity;\n#endif\n  }\n}\n\n/* Move assignment. */\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nTV&\nVectorBase<T, N, AP, TV>::operator=(MoveRef<TV> rhs)\n{\n  TV* tv = static_cast<TV*>(this);\n  tv->~TV();\n  new(tv) TV(rhs);\n  return *tv;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::~VectorBase()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n}\n\n/*\n * This function will create a new heap buffer with capacity newCap,\n * move all elements in the inline buffer to this new buffer,\n * and fail on OOM.\n */\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::convertToHeapStorage(size_t newCap)\n{\n  MOZ_ASSERT(usingInlineStorage());\n\n  /* Allocate buffer. */\n  MOZ_ASSERT(!detail::CapacityHasExcessSpace<T>(newCap));\n  T* newBuf = reinterpret_cast<T*>(this->malloc_(newCap * sizeof(T)));\n  if (!newBuf)\n    return false;\n\n  /* Copy inline elements into heap buffer. */\n  Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());\n  Impl::destroy(beginNoCheck(), endNoCheck());\n\n  /* Switch in heap buffer. */\n  mBegin = newBuf;\n  /* mLength is unchanged. */\n  mCapacity = newCap;\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_NEVER_INLINE bool\nVectorBase<T, N, AP, TV>::growStorageBy(size_t incr)\n{\n  MOZ_ASSERT(mLength + incr > mCapacity);\n  MOZ_ASSERT_IF(!usingInlineStorage(),\n                !detail::CapacityHasExcessSpace<T>(mCapacity));\n\n  /*\n   * When choosing a new capacity, its size should is as close to 2**N bytes\n   * as possible.  2**N-sized requests are best because they are unlikely to\n   * be rounded up by the allocator.  Asking for a 2**N number of elements\n   * isn't as good, because if sizeof(T) is not a power-of-two that would\n   * result in a non-2**N request size.\n   */\n\n  size_t newCap;\n\n  if (incr == 1) {\n    if (usingInlineStorage()) {\n      /* This case occurs in ~70--80% of the calls to this function. */\n      size_t newSize =\n        tl::RoundUpPow2<(sInlineCapacity + 1) * sizeof(T)>::value;\n      newCap = newSize / sizeof(T);\n      goto convert;\n    }\n\n    if (mLength == 0) {\n      /* This case occurs in ~0--10% of the calls to this function. */\n      newCap = 1;\n      goto grow;\n    }\n\n    /* This case occurs in ~15--20% of the calls to this function. */\n\n    /*\n     * Will mLength * 4 *sizeof(T) overflow?  This condition limits a vector\n     * to 1GB of memory on a 32-bit system, which is a reasonable limit.  It\n     * also ensures that\n     *\n     *   static_cast<char*>(end()) - static_cast<char*>(begin())\n     *\n     * doesn't overflow ptrdiff_t (see bug 510319).\n     */\n    if (mLength & tl::MulOverflowMask<4 * sizeof(T)>::value) {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    /*\n     * If we reach here, the existing capacity will have a size that is already\n     * as close to 2^N as sizeof(T) will allow.  Just double the capacity, and\n     * then there might be space for one more element.\n     */\n    newCap = mLength * 2;\n    if (detail::CapacityHasExcessSpace<T>(newCap))\n      newCap += 1;\n  } else {\n    /* This case occurs in ~2% of the calls to this function. */\n    size_t newMinCap = mLength + incr;\n\n    /* Did mLength + incr overflow?  Will newCap * sizeof(T) overflow? */\n    if (newMinCap < mLength ||\n        newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::value)\n    {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    size_t newMinSize = newMinCap * sizeof(T);\n    size_t newSize = RoundUpPow2(newMinSize);\n    newCap = newSize / sizeof(T);\n  }\n\n  if (usingInlineStorage()) {\n  convert:\n    return convertToHeapStorage(newCap);\n  }\n\ngrow:\n  return Impl::growTo(*this, newCap);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::initCapacity(size_t request)\n{\n  MOZ_ASSERT(empty());\n  MOZ_ASSERT(usingInlineStorage());\n  if (request == 0)\n    return true;\n  T* newbuf = reinterpret_cast<T*>(this->malloc_(request * sizeof(T)));\n  if (!newbuf)\n    return false;\n  mBegin = newbuf;\n  mCapacity = request;\n#ifdef DEBUG\n  mReserved = request;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::reserve(size_t request)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (request > mCapacity && !growStorageBy(request - mLength))\n    return false;\n\n#ifdef DEBUG\n  if (request > mReserved)\n    mReserved = request;\n  MOZ_ASSERT(mLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::shrinkBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(incr <= mLength);\n  Impl::destroy(endNoCheck() - incr, endNoCheck());\n  mLength -= incr;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  T* newend = endNoCheck() + incr;\n  Impl::initialize(endNoCheck(), newend);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growByUninitialized(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::resize(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growBy(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::resizeUninitialized(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growByUninitialized(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clear()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  mLength = 0;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clearAndFree()\n{\n  clear();\n\n  if (usingInlineStorage())\n    return;\n\n  this->free_(beginNoCheck());\n  mBegin = static_cast<T*>(storage.addr());\n  mCapacity = sInlineCapacity;\n#ifdef DEBUG\n  mReserved = sInlineCapacity;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::canAppendWithoutRealloc(size_t needed) const\n{\n  return mLength + needed <= mCapacity;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  internalAppend(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U& u)\n{\n  MOZ_ASSERT(mLength + 1 <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  new(endNoCheck()) T(u);\n  ++mLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendN(const T& t, size_t needed)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppendN(t, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendN(const T& t, size_t needed)\n{\n  MOZ_ASSERT(mLength + needed <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstructN(endNoCheck(), needed, t);\n  mLength += needed;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::insert(T* p, const T& val)\n{\n  MOZ_ASSERT(begin() <= p);\n  MOZ_ASSERT(p <= end());\n  size_t pos = p - begin();\n  MOZ_ASSERT(pos <= mLength);\n  size_t oldLength = mLength;\n  if (pos == oldLength) {\n    if (!append(val))\n      return nullptr;\n  } else {\n    T oldBack = back();\n    if (!append(oldBack)) /* Dup the last element. */\n      return nullptr;\n    for (size_t i = oldLength; i > pos; --i)\n      (*this)[i] = (*this)[i - 1];\n    (*this)[pos] = val;\n  }\n  return begin() + pos;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::erase(T* it)\n{\n  MOZ_ASSERT(begin() <= it);\n  MOZ_ASSERT(it < end());\n  while (it + 1 < end()) {\n    *it = *(it + 1);\n    ++it;\n  }\n  popBack();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U* insBegin, const U* insEnd)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  size_t needed = PointerRangeSize(insBegin, insEnd);\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppend(insBegin, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U* insBegin, size_t insLength)\n{\n  MOZ_ASSERT(mLength + insLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstruct(endNoCheck(), insBegin, insBegin + insLength);\n  mLength += insLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U& u)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength == mCapacity && !growStorageBy(1))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + 1 > mReserved)\n    mReserved = mLength + 1;\n#endif\n  internalAppend(u);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  return append(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<class U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U *insBegin, size_t insLength)\n{\n  return append(insBegin, insBegin + insLength);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::popBack()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(!empty());\n  --mLength;\n  endNoCheck()->~T();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE T\nVectorBase<T, N, AP, TV>::popCopy()\n{\n  T ret = back();\n  popBack();\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::extractRawBuffer()\n{\n  T* ret;\n  if (usingInlineStorage()) {\n    ret = reinterpret_cast<T*>(this->malloc_(mLength * sizeof(T)));\n    if (!ret)\n      return nullptr;\n    Impl::copyConstruct(ret, beginNoCheck(), endNoCheck());\n    Impl::destroy(beginNoCheck(), endNoCheck());\n    /* mBegin, mCapacity are unchanged. */\n    mLength = 0;\n  } else {\n    ret = mBegin;\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = 0;\n    mCapacity = sInlineCapacity;\n#ifdef DEBUG\n    mReserved = sInlineCapacity;\n#endif\n  }\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::replaceRawBuffer(T* p, size_t aLength)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n\n  /* Destroy what we have. */\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n\n  /* Take in the new buffer. */\n  if (aLength <= sInlineCapacity) {\n    /*\n     * We convert to inline storage if possible, even though p might\n     * otherwise be acceptable.  Maybe this behaviour should be\n     * specifiable with an argument to this function.\n     */\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = aLength;\n    mCapacity = sInlineCapacity;\n    Impl::moveConstruct(mBegin, p, p + aLength);\n    Impl::destroy(p, p + aLength);\n    this->free_(p);\n  } else {\n    mBegin = p;\n    mLength = aLength;\n    mCapacity = aLength;\n  }\n#ifdef DEBUG\n  mReserved = aLength;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::swap(TV& other)\n{\n  static_assert(N == 0,\n                \"still need to implement this for N != 0\");\n\n  // This only works when inline storage is always empty.\n  if (!usingInlineStorage() && other.usingInlineStorage()) {\n    other.mBegin = mBegin;\n    mBegin = inlineStorage();\n  } else if (usingInlineStorage() && !other.usingInlineStorage()) {\n    mBegin = other.mBegin;\n    other.mBegin = other.inlineStorage();\n  } else if (!usingInlineStorage() && !other.usingInlineStorage()) {\n    Swap(mBegin, other.mBegin);\n  } else {\n    // This case is a no-op, since we'd set both to use their inline storage.\n  }\n\n  Swap(mLength, other.mLength);\n  Swap(mCapacity, other.mCapacity);\n#ifdef DEBUG\n  Swap(mReserved, other.mReserved);\n#endif\n}\n\n/*\n * STL-like container providing a short-lived, dynamic buffer.  Vector calls the\n * constructors/destructors of all elements stored in its internal buffer, so\n * non-PODs may be safely used.  Additionally, Vector will store the first N\n * elements in-place before resorting to dynamic allocation.\n *\n * T requirements:\n *  - default and copy constructible, assignable, destructible\n *  - operations do not throw\n * N requirements:\n *  - any value, however, N is clamped to min/max values\n * AllocPolicy:\n *  - see \"Allocation policies\" in AllocPolicy.h (defaults to\n *    mozilla::MallocAllocPolicy)\n *\n * Vector is not reentrant: T member functions called during Vector member\n * functions must not call back into the same object!\n */\ntemplate<typename T,\n         size_t MinInlineCapacity = 0,\n         class AllocPolicy = MallocAllocPolicy>\nclass Vector\n  : public VectorBase<T,\n                      MinInlineCapacity,\n                      AllocPolicy,\n                      Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector& operator=(mozilla::MoveRef<Vector> vec) {\n      return Base::operator=(vec);\n    }\n};\n\n} // namespace mozilla\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif /* mozilla_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/android/mozilla/WeakPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Weak pointer functionality, implemented as a mixin for use with any class. */\n\n/**\n * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting\n * its lifetime. It works by creating a single shared reference counted object\n * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo'\n * clear the pointer in the WeakReference without having to know about all of\n * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime\n * of 'Foo'.\n *\n * AtomicSupportsWeakPtr can be used for a variant with an atomically updated\n * reference counter.\n *\n * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional\n * dereference, and an additional heap allocated pointer sized object shared\n * between all of the WeakPtrs.\n *\n * Example of usage:\n *\n *   // To have a class C support weak pointers, inherit from SupportsWeakPtr<C>.\n *   class C : public SupportsWeakPtr<C>\n *   {\n *    public:\n *      int num;\n *      void act();\n *   };\n *\n *   C* ptr =  new C();\n *\n *   // Get weak pointers to ptr. The first time asWeakPtr is called\n *   // a reference counted WeakReference object is created that\n *   // can live beyond the lifetime of 'ptr'. The WeakReference\n *   // object will be notified of 'ptr's destruction.\n *   WeakPtr<C> weak = ptr->asWeakPtr();\n *   WeakPtr<C> other = ptr->asWeakPtr();\n *\n *   // Test a weak pointer for validity before using it.\n *   if (weak) {\n *     weak->num = 17;\n *     weak->act();\n *   }\n *\n *   // Destroying the underlying object clears weak pointers to it.\n *   delete ptr;\n *\n *   MOZ_ASSERT(!weak, \"Deleting |ptr| clears weak pointers to it.\");\n *   MOZ_ASSERT(!other, \"Deleting |ptr| clears all weak pointers to it.\");\n *\n * WeakPtr is typesafe and may be used with any class. It is not required that\n * the class be reference-counted or allocated in any particular way.\n *\n * The API was loosely inspired by Chromium's weak_ptr.h:\n * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h\n */\n\n#ifndef mozilla_WeakPtr_h\n#define mozilla_WeakPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RefPtr.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate <typename T, class WeakReference> class WeakPtrBase;\ntemplate <typename T, class WeakReference> class SupportsWeakPtrBase;\n\nnamespace detail {\n\n// This can live beyond the lifetime of the class derived from SupportsWeakPtrBase.\ntemplate<class T, RefCountAtomicity Atomicity>\nclass WeakReference : public RefCounted<WeakReference<T, Atomicity>, Atomicity>\n{\n  public:\n    explicit WeakReference(T* p) : ptr(p) {}\n    T* get() const {\n      return ptr;\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n    void detach() {\n      ptr = nullptr;\n    }\n    T* ptr;\n};\n\n} // namespace detail\n\ntemplate <typename T, class WeakReference>\nclass SupportsWeakPtrBase\n{\n  public:\n    WeakPtrBase<T, WeakReference> asWeakPtr() {\n      if (!weakRef)\n        weakRef = new WeakReference(static_cast<T*>(this));\n      return WeakPtrBase<T, WeakReference>(weakRef);\n    }\n\n  protected:\n    ~SupportsWeakPtrBase() {\n      static_assert(IsBaseOf<SupportsWeakPtrBase<T, WeakReference>, T>::value,\n                    \"T must derive from SupportsWeakPtrBase<T, WeakReference>\");\n      if (weakRef)\n        weakRef->detach();\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n\n    RefPtr<WeakReference> weakRef;\n};\n\ntemplate <typename T>\nclass SupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::NonAtomicRefCount> >\n{\n};\n\ntemplate <typename T>\nclass AtomicSupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::AtomicRefCount> >\n{\n};\n\nnamespace detail {\n\ntemplate <typename T>\nstruct WeakReferenceCount\n{\n  static const RefCountAtomicity atomicity =\n    IsBaseOf<AtomicSupportsWeakPtr<T>, T>::value\n    ? AtomicRefCount\n    : NonAtomicRefCount;\n};\n\n}\n\ntemplate <typename T, class WeakReference>\nclass WeakPtrBase\n{\n  public:\n    WeakPtrBase(const WeakPtrBase<T, WeakReference>& o) : ref(o.ref) {}\n    // Ensure that ref is dereferenceable in the uninitialized state\n    WeakPtrBase() : ref(new WeakReference(nullptr)) {}\n\n    operator T*() const {\n      return ref->get();\n    }\n    T& operator*() const {\n      return *ref->get();\n    }\n\n    T* operator->() const {\n      return ref->get();\n    }\n\n    T* get() const {\n      return ref->get();\n    }\n\n  private:\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n\n    explicit WeakPtrBase(const RefPtr<WeakReference> &o) : ref(o) {}\n\n    RefPtr<WeakReference> ref;\n};\n\ntemplate <typename T>\nclass WeakPtr : public WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> >\n{\n    typedef WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> > Base;\n  public:\n    WeakPtr(const WeakPtr<T>& o) : Base(o) {}\n    WeakPtr(const Base& o) : Base(o) {}\n    WeakPtr() {}\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_WeakPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/Anchor.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Anchor implementation. */\n\n#ifndef js_Anchor_h\n#define js_Anchor_h\n\n#include \"mozilla/Attributes.h\"\n\nclass JSFunction;\nclass JSObject;\nclass JSScript;\nclass JSString;\n\nnamespace JS { class Value; }\n\nnamespace JS {\n\n/*\n * Protecting non-Value, non-JSObject *, non-JSString * values from collection\n *\n * Most of the time, the garbage collector's conservative stack scanner works\n * behind the scenes, finding all live values and protecting them from being\n * collected. However, when JSAPI client code obtains a pointer to data the\n * scanner does not know about, owned by an object the scanner does know about,\n * Care Must Be Taken.\n *\n * The scanner recognizes only a select set of types: pointers to JSObjects and\n * similar things (JSFunctions, and so on), pointers to JSStrings, and Values.\n * So while the scanner finds all live |JSString| pointers, it does not notice\n * |jschar| pointers.\n *\n * So suppose we have:\n *\n *   void f(JSString *str) {\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * After the call to |JS_GetStringCharsZ|, there are no further uses of\n * |str|, which means that the compiler is within its rights to not store\n * it anywhere. But because the stack scanner will not notice |ch|, there\n * is no longer any live value in this frame that would keep the string\n * alive. If |str| is the last reference to that |JSString|, and the\n * collector runs while we are using |ch|, the string's array of |jschar|s\n * may be freed out from under us.\n *\n * Note that there is only an issue when 1) we extract a thing X the scanner\n * doesn't recognize from 2) a thing Y the scanner does recognize, and 3) if Y\n * gets garbage-collected, then X gets freed. If we have code like this:\n *\n *   void g(JSObject *obj) {\n *     JS::Value x;\n *     JS_GetProperty(obj, \"x\", &x);\n *     ... do stuff with x ...\n *   }\n *\n * there's no problem, because the value we've extracted, x, is a Value, a\n * type that the conservative scanner recognizes.\n *\n * Conservative GC frees us from the obligation to explicitly root the types it\n * knows about, but when we work with derived values like |ch|, we must root\n * their owners, as the derived value alone won't keep them alive.\n *\n * A JS::Anchor is a kind of GC root that allows us to keep the owners of\n * derived values like |ch| alive throughout the Anchor's lifetime. We could\n * fix the above code as follows:\n *\n *   void f(JSString *str) {\n *     JS::Anchor<JSString *> a_str(str);\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * This simply ensures that |str| will be live until |a_str| goes out of scope.\n * As long as we don't retain a pointer to the string's characters for longer\n * than that, we have avoided all garbage collection hazards.\n */\ntemplate<typename T> class AnchorPermitted;\ntemplate<> class AnchorPermitted<JSObject *> { };\ntemplate<> class AnchorPermitted<const JSObject *> { };\ntemplate<> class AnchorPermitted<JSFunction *> { };\ntemplate<> class AnchorPermitted<const JSFunction *> { };\ntemplate<> class AnchorPermitted<JSString *> { };\ntemplate<> class AnchorPermitted<const JSString *> { };\ntemplate<> class AnchorPermitted<Value> { };\ntemplate<> class AnchorPermitted<const JSScript *> { };\ntemplate<> class AnchorPermitted<JSScript *> { };\n\ntemplate<typename T>\nclass Anchor : AnchorPermitted<T>\n{\n  public:\n    Anchor() { }\n    explicit Anchor(T t) { hold = t; }\n    inline ~Anchor();\n    T &get() { return hold; }\n    const T &get() const { return hold; }\n    void set(const T &t) { hold = t; }\n    void operator=(const T &t) { hold = t; }\n    void clear() { hold = 0; }\n\n  private:\n    T hold;\n    Anchor(const Anchor &other) MOZ_DELETE;\n    void operator=(const Anchor &other) MOZ_DELETE;\n};\n\ntemplate<typename T>\ninline Anchor<T>::~Anchor()\n{\n#ifdef __GNUC__\n    /*\n     * No code is generated for this. But because this is marked 'volatile', G++ will\n     * assume it has important side-effects, and won't delete it. (G++ never looks at\n     * the actual text and notices it's empty.) And because we have passed |hold| to\n     * it, GCC will keep |hold| alive until this point.\n     *\n     * The \"memory\" clobber operand ensures that G++ will not move prior memory\n     * accesses after the asm --- it's a barrier. Unfortunately, it also means that\n     * G++ will assume that all memory has changed after the asm, as it would for a\n     * call to an unknown function. I don't know of a way to avoid that consequence.\n     */\n    asm volatile(\"\":: \"g\" (hold) : \"memory\");\n#else\n    /*\n     * An adequate portable substitute, for non-structure types.\n     *\n     * The compiler promises that, by the end of an expression statement, the\n     * last-stored value to a volatile object is the same as it would be in an\n     * unoptimized, direct implementation (the \"abstract machine\" whose behavior the\n     * language spec describes). However, the compiler is still free to reorder\n     * non-volatile accesses across this store --- which is what we must prevent. So\n     * assigning the held value to a volatile variable, as we do here, is not enough.\n     *\n     * In our case, however, garbage collection only occurs at function calls, so it\n     * is sufficient to ensure that the destructor's store isn't moved earlier across\n     * any function calls that could collect. It is hard to imagine the compiler\n     * analyzing the program so thoroughly that it could prove that such motion was\n     * safe. In practice, compilers treat calls to the collector as opaque operations\n     * --- in particular, as operations which could access volatile variables, across\n     * which this destructor must not be moved.\n     *\n     * (\"Objection, your honor!  *Alleged* killer whale!\")\n     *\n     * The disadvantage of this approach is that it does generate code for the store.\n     * We do need to use Anchors in some cases where cycles are tight.\n     *\n     * Note that there is a Anchor<Value>::~Anchor() specialization in Value.h.\n     */\n    volatile T sink;\n    sink = hold;\n#endif  /* defined(__GNUC__) */\n}\n\n} // namespace JS\n\n#endif /* js_Anchor_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/CallArgs.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Helper classes encapsulating access to the callee, |this| value, arguments,\n * and argument count for a function call.\n *\n * The intent of JS::CallArgs and JS::CallReceiver is that they be used to\n * encapsulate access to the un-abstracted |unsigned argc, Value *vp| arguments\n * to a function.  It's possible (albeit deprecated) to manually index into\n * |vp| to access the callee, |this|, and arguments of a function, and to set\n * its return value.  It's also possible to use the supported API of JS_CALLEE,\n * JS_THIS, JS_ARGV, JS_RVAL and JS_SET_RVAL to the same ends.  But neither API\n * has the error-handling or moving-GC correctness of CallArgs or CallReceiver.\n * New code should use CallArgs and CallReceiver instead whenever possible.\n *\n * The eventual plan is to change JSNative to take |const CallArgs&| directly,\n * for automatic assertion of correct use and to make calling functions more\n * efficient.  Embedders should start internally switching away from using\n * |argc| and |vp| directly, except to create a |CallArgs|.  Then, when an\n * eventual release making that change occurs, porting efforts will require\n * changing methods' signatures but won't require invasive changes to the\n * methods' implementations, potentially under time pressure.\n */\n\n#ifndef js_CallArgs_h\n#define js_CallArgs_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"jstypes.h\"\n\n#include \"js/RootingAPI.h\"\n#include \"js/Value.h\"\n\nstruct JSContext;\nclass JSObject;\n\n/* Typedef for native functions called by the JS VM. */\ntypedef JSBool\n(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);\n\n/* Typedef for native functions that may be called in parallel. */\ntypedef js::ParallelResult\n(* JSParallelNative)(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Typedef for native functions that may be called either in parallel or\n * sequential execution.\n */\ntypedef JSBool\n(* JSThreadSafeNative)(js::ThreadSafeContext *cx, unsigned argc, JS::Value *vp);\n\n/*\n * Convenience wrappers for passing in ThreadSafeNative to places that expect\n * a JSNative or a JSParallelNative.\n */\ntemplate <JSThreadSafeNative threadSafeNative>\ninline JSBool\nJSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp);\n\ntemplate <JSThreadSafeNative threadSafeNative>\ninline js::ParallelResult\nJSParallelNativeThreadSafeWrapper(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Compute |this| for the |vp| inside a JSNative, either boxing primitives or\n * replacing with the global object as necessary.\n *\n * This method will go away at some point: instead use |args.thisv()|.  If the\n * value is an object, no further work is required.  If that value is |null| or\n * |undefined|, use |JS_GetGlobalForObject| to compute the global object.  If\n * the value is some other primitive, use |JS_ValueToObject| to box it.\n */\nextern JS_PUBLIC_API(JS::Value)\nJS_ComputeThis(JSContext *cx, JS::Value *vp);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\n/*\n * JS::CallReceiver encapsulates access to the callee, |this|, and eventual\n * return value for a function call.  The principal way to create a\n * CallReceiver is using JS::CallReceiverFromVp:\n *\n *   static JSBool\n *   FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallReceiver rec = JS::CallReceiverFromVp(vp);\n *\n *       // Access to the callee must occur before accessing/setting\n *       // the return value.\n *       JSObject &callee = rec.callee();\n *       rec.rval().set(JS::ObjectValue(callee));\n *\n *       // callee() and calleev() will now assert.\n *\n *       // It's always fine to access thisv().\n *       HandleValue thisv = rec.thisv();\n *       rec.rval().set(thisv);\n *\n *       // As the return value was last set to |this|, returns |this|.\n *       return true;\n *   }\n *\n * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't\n * part of the CallReceiver interface.  We will likely add them at some point.\n * Until then, you should probably continue using |vp| directly for these two\n * cases.\n *\n * CallReceiver is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\n\nnamespace detail {\n\n#ifdef DEBUG\nextern JS_PUBLIC_API(void)\nCheckIsValidConstructible(Value v);\n#endif\n\nenum UsedRval { IncludeUsedRval, NoUsedRval };\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS UsedRvalBase;\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<IncludeUsedRval>\n{\n  protected:\n    mutable bool usedRval_;\n    void setUsedRval() const { usedRval_ = true; }\n    void clearUsedRval() const { usedRval_ = false; }\n};\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>\n{\n  protected:\n    void setUsedRval() const {}\n    void clearUsedRval() const {}\n};\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<\n#ifdef DEBUG\n        WantUsedRval\n#else\n        NoUsedRval\n#endif\n    >\n{\n  protected:\n    Value *argv_;\n\n  public:\n    /*\n     * Returns the function being called, as an object.  Must not be called\n     * after rval() has been used!\n     */\n    JSObject &callee() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return argv_[-2].toObject();\n    }\n\n    /*\n     * Returns the function being called, as a value.  Must not be called after\n     * rval() has been used!\n     */\n    HandleValue calleev() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return HandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n    /*\n     * Returns the |this| value passed to the function.  This method must not\n     * be called when the function is being called as a constructor via |new|.\n     * The value may or may not be an object: it is the individual function's\n     * responsibility to box the value if needed.\n     */\n    HandleValue thisv() const {\n        // Some internal code uses thisv() in constructing cases, so don't do\n        // this yet.\n        // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING));\n        return HandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n\n    Value computeThis(JSContext *cx) const {\n        if (thisv().isObject())\n            return thisv();\n\n        return JS_ComputeThis(cx, base());\n    }\n\n    bool isConstructing() const {\n#ifdef DEBUG\n        if (this->usedRval_)\n            CheckIsValidConstructible(calleev());\n#endif\n        return argv_[-1].isMagic();\n    }\n\n    /*\n     * Returns the currently-set return value.  The initial contents of this\n     * value are unspecified.  Once this method has been called, callee() and\n     * calleev() can no longer be used.  (If you're compiling against a debug\n     * build of SpiderMonkey, these methods will assert to aid debugging.)\n     *\n     * If the method you're implementing succeeds by returning true, you *must*\n     * set this.  (SpiderMonkey doesn't currently assert this, but it will do\n     * so eventually.)  You don't need to use or change this if your method\n     * fails.\n     */\n    MutableHandleValue rval() const {\n        this->setUsedRval();\n        return MutableHandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n  public:\n    // These methods are only intended for internal use.  Embedders shouldn't\n    // use them!\n\n    Value *base() const { return argv_ - 2; }\n\n    Value *spAfterCall() const {\n        this->setUsedRval();\n        return argv_ - 1;\n    }\n\n  public:\n    // These methods are publicly exposed, but they are *not* to be used when\n    // implementing a JSNative method and encapsulating access to |vp| within\n    // it.  You probably don't want to use these!\n\n    void setCallee(Value aCalleev) const {\n        this->clearUsedRval();\n        argv_[-2] = aCalleev;\n    }\n\n    void setThis(Value aThisv) const {\n        argv_[-1] = aThisv;\n    }\n\n    MutableHandleValue mutableThisv() const {\n        return MutableHandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallReceiver : public detail::CallReceiverBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallReceiver CallReceiverFromVp(Value *vp);\n    friend CallReceiver CallReceiverFromArgv(Value *argv);\n};\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromArgv(Value *argv)\n{\n    CallReceiver receiver;\n    receiver.clearUsedRval();\n    receiver.argv_ = argv;\n    return receiver;\n}\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromVp(Value *vp)\n{\n    return CallReceiverFromArgv(vp + 2);\n}\n\n/*\n * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to\n * the function call's arguments.  The principal way to create a CallArgs is\n * like so, using JS::CallArgsFromVp:\n *\n *   static JSBool\n *   FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *\n *       // Guard against no arguments or a non-numeric arg0.\n *       if (args.length() == 0 || !args[0].isNumber()) {\n *           args.rval().setInt32(0);\n *           return true;\n *       }\n *\n *       args.rval().set(JS::NumberValue(args.length() * args[0].toNumber()));\n *       return true;\n *   }\n *\n * CallArgs is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\nnamespace detail {\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallArgsBase :\n        public mozilla::Conditional<WantUsedRval == detail::IncludeUsedRval,\n                                    CallReceiver,\n                                    CallReceiverBase<NoUsedRval> >::Type\n{\n  protected:\n    unsigned argc_;\n\n  public:\n    /* Returns the number of arguments. */\n    unsigned length() const { return argc_; }\n\n    /* Returns the i-th zero-indexed argument. */\n    MutableHandleValue operator[](unsigned i) const {\n        MOZ_ASSERT(i < argc_);\n        return MutableHandleValue::fromMarkedLocation(&this->argv_[i]);\n    }\n\n    /*\n     * Returns the i-th zero-indexed argument, or |undefined| if there's no\n     * such argument.\n     */\n    HandleValue get(unsigned i) const {\n        return i < length()\n               ? HandleValue::fromMarkedLocation(&this->argv_[i])\n               : UndefinedHandleValue;\n    }\n\n    /*\n     * Returns true if the i-th zero-indexed argument is present and is not\n     * |undefined|.\n     */\n    bool hasDefined(unsigned i) const {\n        return i < argc_ && !this->argv_[i].isUndefined();\n    }\n\n  public:\n    // These methods are publicly exposed, but we're less sure of the interface\n    // here than we'd like (because they're hackish and drop assertions).  Try\n    // to avoid using these if you can.\n\n    Value *array() const { return this->argv_; }\n    Value *end() const { return this->argv_ + argc_; }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);\n    friend CallArgs CallArgsFromSp(unsigned argc, Value *sp);\n\n    static CallArgs create(unsigned argc, Value *argv) {\n        CallArgs args;\n        args.clearUsedRval();\n        args.argv_ = argv;\n        args.argc_ = argc;\n        return args;\n    }\n\n};\n\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromVp(unsigned argc, Value *vp)\n{\n    return CallArgs::create(argc, vp + 2);\n}\n\n// This method is only intended for internal use in SpiderMonkey.  We may\n// eventually move it to an internal header.  Embedders should use\n// JS::CallArgsFromVp!\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromSp(unsigned argc, Value *sp)\n{\n    return CallArgs::create(argc, sp - argc);\n}\n\n} // namespace JS\n\n/*\n * Macros to hide interpreter stack layout details from a JSNative using its\n * JS::Value *vp parameter.  DO NOT USE THESE!  Instead use JS::CallArgs and\n * friends, above.  These macros will be removed when we change JSNative to\n * take a const JS::CallArgs&.\n */\n\n#define JS_CALLEE(cx,vp)        ((vp)[0])\n#define JS_THIS_OBJECT(cx,vp)   (JSVAL_TO_OBJECT(JS_THIS(cx,vp)))\n#define JS_ARGV(cx,vp)          ((vp) + 2)\n#define JS_RVAL(cx,vp)          (*(vp))\n#define JS_SET_RVAL(cx,vp,v)    (*(vp) = (v))\n\n/*\n * Note: if this method returns null, an error has occurred and must be\n * propagated or caught.\n */\nMOZ_ALWAYS_INLINE JS::Value\nJS_THIS(JSContext *cx, JS::Value *vp)\n{\n    return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1];\n}\n\n/*\n * |this| is passed to functions in ES5 without change.  Functions themselves\n * do any post-processing they desire to box |this|, compute the global object,\n * &c.  This macro retrieves a function's unboxed |this| value.\n *\n * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT,\n * or vice versa.  Either use the provided this value with this macro, or\n * compute the boxed |this| value using those.  JS_THIS_VALUE must not be used\n * if the function is being called as a constructor.\n *\n * But: DO NOT USE THIS!  Instead use JS::CallArgs::thisv(), above.\n *\n */\n#define JS_THIS_VALUE(cx,vp)    ((vp)[1])\n\n#endif /* js_CallArgs_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/CharacterEncoding.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_CharacterEncoding_h\n#define js_CharacterEncoding_h\n\n#include \"mozilla/Range.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\nnamespace JS {\n\n/*\n * By default, all C/C++ 1-byte-per-character strings passed into the JSAPI\n * are treated as ISO/IEC 8859-1, also known as Latin-1. That is, each\n * byte is treated as a 2-byte character, and there is no way to pass in a\n * string containing characters beyond U+00FF.\n */\nclass Latin1Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    Latin1Chars() : Base() {}\n    Latin1Chars(char *aBytes, size_t aLength) : Base(reinterpret_cast<unsigned char *>(aBytes), aLength) {}\n    Latin1Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * A Latin1Chars, but with \\0 termination for C compatibility.\n */\nclass Latin1CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    Latin1CharsZ() : Base(NULL, 0) {}\n\n    Latin1CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    Latin1CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\nclass UTF8Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    UTF8Chars() : Base() {}\n    UTF8Chars(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {}\n    UTF8Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * SpiderMonkey also deals directly with UTF-8 encoded text in some places.\n */\nclass UTF8CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    UTF8CharsZ() : Base(NULL, 0) {}\n\n    UTF8CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    UTF8CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\n/*\n * SpiderMonkey uses a 2-byte character representation: it is a\n * 2-byte-at-a-time view of a UTF-16 byte stream. This is similar to UCS-2,\n * but unlike UCS-2, we do not strip UTF-16 extension bytes. This allows a\n * sufficiently dedicated JavaScript program to be fully unicode-aware by\n * manually interpreting UTF-16 extension characters embedded in the JS\n * string.\n */\nclass TwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    TwoByteChars() : Base() {}\n    TwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    TwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A non-convertible variant of TwoByteChars that does not refer to characters\n * inlined inside a JSShortString or a JSInlineString. StableTwoByteChars are\n * thus safe to hold across a GC.\n */\nclass StableTwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    StableTwoByteChars() : Base() {}\n    StableTwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    StableTwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A TwoByteChars, but \\0 terminated for compatibility with JSFlatString.\n */\nclass TwoByteCharsZ : public mozilla::RangedPtr<jschar>\n{\n    typedef mozilla::RangedPtr<jschar> Base;\n\n  public:\n    TwoByteCharsZ() : Base(NULL, 0) {}\n\n    TwoByteCharsZ(jschar *chars, size_t length)\n      : Base(chars, length)\n    {\n        JS_ASSERT(chars[length] == '\\0');\n    }\n};\n\n/*\n * Convert a 2-byte character sequence to \"ISO-Latin-1\". This works by\n * truncating each 2-byte pair in the sequence to a 1-byte pair. If the source\n * contains any UTF-16 extension characters, then this may give invalid Latin1\n * output. The returned string is zero terminated. The returned string or the\n * returned string's |start()| must be freed with JS_free or js_free,\n * respectively. If allocation fails, an OOM error will be set and the method\n * will return a NULL chars (which can be tested for with the ! operator).\n * This method cannot trigger GC.\n */\nextern Latin1CharsZ\nLossyTwoByteCharsToNewLatin1CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nextern UTF8CharsZ\nTwoByteCharsToNewUTF8CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nuint32_t\nUtf8ToOneUcs4Char(const uint8_t *utf8Buffer, int utf8Length);\n\n/*\n * Inflate bytes in UTF-8 encoding to jschars.\n * - On error, returns an empty TwoByteCharsZ.\n * - On success, returns a malloc'd TwoByteCharsZ, and updates |outlen| to hold\n *   its length;  the length value excludes the trailing null.\n */\nextern TwoByteCharsZ\nUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n/*\n * The same as UTF8CharsToNewTwoByteCharsZ(), except that any malformed UTF-8 characters\n * will be replaced by \\uFFFD. No exception will be thrown for malformed UTF-8\n * input.\n */\nextern TwoByteCharsZ\nLossyUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n} // namespace JS\n\ninline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); }\ninline void JS_free(JS::UTF8CharsZ &ptr) { js_free((void*)ptr.get()); }\n\n#endif /* js_CharacterEncoding_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/Date.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Date_h\n#define js_Date_h\n\n#include \"jstypes.h\"\n\nnamespace JS {\n\n// Year is a year, month is 0-11, day is 1-based.  The return value is\n// a number of milliseconds since the epoch.  Can return NaN.\nJS_PUBLIC_API(double)\nMakeDate(double year, unsigned month, unsigned day);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// year.  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nYearFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// month (0-11).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nMonthFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// day (1-based).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nDayFromTime(double time);\n\n} // namespace JS\n\n#endif /* js_Date_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/GCAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_GCAPI_h\n#define js_GCAPI_h\n\n#include \"js/HeapAPI.h\"\n\nnamespace JS {\n\n#define GCREASONS(D)                            \\\n    /* Reasons internal to the JS engine */     \\\n    D(API)                                      \\\n    D(MAYBEGC)                                  \\\n    D(LAST_CONTEXT)                             \\\n    D(DESTROY_CONTEXT)                          \\\n    D(LAST_DITCH)                               \\\n    D(TOO_MUCH_MALLOC)                          \\\n    D(ALLOC_TRIGGER)                            \\\n    D(DEBUG_GC)                                 \\\n    D(DEBUG_MODE_GC)                            \\\n    D(TRANSPLANT)                               \\\n    D(RESET)                                    \\\n    D(OUT_OF_NURSERY)                           \\\n    D(EVICT_NURSERY)                            \\\n    D(FULL_STORE_BUFFER)                        \\\n                                                \\\n    /* These are reserved for future use. */    \\\n    D(RESERVED0)                                \\\n    D(RESERVED1)                                \\\n    D(RESERVED2)                                \\\n    D(RESERVED3)                                \\\n    D(RESERVED4)                                \\\n    D(RESERVED5)                                \\\n    D(RESERVED6)                                \\\n    D(RESERVED7)                                \\\n    D(RESERVED8)                                \\\n    D(RESERVED9)                                \\\n    D(RESERVED10)                               \\\n    D(RESERVED11)                               \\\n    D(RESERVED12)                               \\\n    D(RESERVED13)                               \\\n    D(RESERVED14)                               \\\n    D(RESERVED15)                               \\\n    D(RESERVED16)                               \\\n    D(RESERVED17)                               \\\n    D(RESERVED18)                               \\\n    D(RESERVED19)                               \\\n                                                \\\n    /* Reasons from Firefox */                  \\\n    D(DOM_WINDOW_UTILS)                         \\\n    D(COMPONENT_UTILS)                          \\\n    D(MEM_PRESSURE)                             \\\n    D(CC_WAITING)                               \\\n    D(CC_FORCED)                                \\\n    D(LOAD_END)                                 \\\n    D(POST_COMPARTMENT)                         \\\n    D(PAGE_HIDE)                                \\\n    D(NSJSCONTEXT_DESTROY)                      \\\n    D(SET_NEW_DOCUMENT)                         \\\n    D(SET_DOC_SHELL)                            \\\n    D(DOM_UTILS)                                \\\n    D(DOM_IPC)                                  \\\n    D(DOM_WORKER)                               \\\n    D(INTER_SLICE_GC)                           \\\n    D(REFRESH_FRAME)                            \\\n    D(FULL_GC_TIMER)                            \\\n    D(SHUTDOWN_CC)                              \\\n    D(FINISH_LARGE_EVALUTE)\n\nnamespace gcreason {\n\n/* GCReasons will end up looking like JSGC_MAYBEGC */\nenum Reason {\n#define MAKE_REASON(name) name,\n    GCREASONS(MAKE_REASON)\n#undef MAKE_REASON\n    NO_REASON,\n    NUM_REASONS,\n\n    /*\n     * For telemetry, we want to keep a fixed max bucket size over time so we\n     * don't have to switch histograms. 100 is conservative; as of this writing\n     * there are 26. But the cost of extra buckets seems to be low while the\n     * cost of switching histograms is high.\n     */\n    NUM_TELEMETRY_REASONS = 100\n};\n\n} /* namespace gcreason */\n\nextern JS_FRIEND_API(void)\nPrepareZoneForGC(Zone *zone);\n\nextern JS_FRIEND_API(void)\nPrepareForFullGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nPrepareForIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsGCScheduled(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nSkipZoneForGC(Zone *zone);\n\n/*\n * When triggering a GC using one of the functions below, it is first necessary\n * to select the compartments to be collected. To do this, you can call\n * PrepareZoneForGC on each compartment, or you can call PrepareForFullGC\n * to select all compartments. Failing to select any compartment is an error.\n */\n\nextern JS_FRIEND_API(void)\nGCForReason(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkingGC(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkGCBuffers(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nIncrementalGC(JSRuntime *rt, gcreason::Reason reason, int64_t millis = 0);\n\nextern JS_FRIEND_API(void)\nFinishIncrementalGC(JSRuntime *rt, gcreason::Reason reason);\n\nenum GCProgress {\n    /*\n     * During non-incremental GC, the GC is bracketed by JSGC_CYCLE_BEGIN/END\n     * callbacks. During an incremental GC, the sequence of callbacks is as\n     * follows:\n     *   JSGC_CYCLE_BEGIN, JSGC_SLICE_END  (first slice)\n     *   JSGC_SLICE_BEGIN, JSGC_SLICE_END  (second slice)\n     *   ...\n     *   JSGC_SLICE_BEGIN, JSGC_CYCLE_END  (last slice)\n     */\n\n    GC_CYCLE_BEGIN,\n    GC_SLICE_BEGIN,\n    GC_SLICE_END,\n    GC_CYCLE_END\n};\n\nstruct JS_FRIEND_API(GCDescription) {\n    bool isCompartment_;\n\n    GCDescription(bool isCompartment)\n      : isCompartment_(isCompartment) {}\n\n    jschar *formatMessage(JSRuntime *rt) const;\n    jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;\n};\n\ntypedef void\n(* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);\n\nextern JS_FRIEND_API(GCSliceCallback)\nSetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback);\n\n/*\n * Signals a good place to do an incremental slice, because the browser is\n * drawing a frame.\n */\nextern JS_FRIEND_API(void)\nNotifyDidPaint(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalGCEnabled(JSRuntime *rt);\n\nJS_FRIEND_API(bool)\nIsIncrementalGCInProgress(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nEnableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSContext *cx);\n\nextern JS_FRIEND_API(void)\nIncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind);\n\nextern JS_FRIEND_API(void)\nIncrementalValueBarrier(const Value &v);\n\nextern JS_FRIEND_API(void)\nIncrementalObjectBarrier(JSObject *obj);\n\nextern JS_FRIEND_API(void)\nPokeGC(JSRuntime *rt);\n\n/* Was the most recent GC run incrementally? */\nextern JS_FRIEND_API(bool)\nWasIncrementalGC(JSRuntime *rt);\n\nclass ObjectPtr\n{\n    Heap<JSObject *> value;\n\n  public:\n    ObjectPtr() : value(NULL) {}\n\n    ObjectPtr(JSObject *obj) : value(obj) {}\n\n    /* Always call finalize before the destructor. */\n    ~ObjectPtr() { JS_ASSERT(!value); }\n\n    void finalize(JSRuntime *rt) {\n        if (IsIncrementalBarrierNeeded(rt))\n            IncrementalObjectBarrier(value);\n        value = NULL;\n    }\n\n    void init(JSObject *obj) { value = obj; }\n\n    JSObject *get() const { return value; }\n\n    void writeBarrierPre(JSRuntime *rt) {\n        IncrementalObjectBarrier(value);\n    }\n\n    bool isAboutToBeFinalized() {\n        return JS_IsAboutToBeFinalized(&value);\n    }\n\n    ObjectPtr &operator=(JSObject *obj) {\n        IncrementalObjectBarrier(value);\n        value = obj;\n        return *this;\n    }\n\n    void trace(JSTracer *trc, const char *name) {\n        JS_CallHeapObjectTracer(trc, &value, name);\n    }\n\n    JSObject &operator*() const { return *value; }\n    JSObject *operator->() const { return value; }\n    operator JSObject *() const { return value; }\n};\n\n/*\n * Unsets the gray bit for anything reachable from |thing|. |kind| should not be\n * JSTRACE_SHAPE. |thing| should be non-null.\n */\nextern JS_FRIEND_API(void)\nUnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);\n\n/*\n * This should be called when an object that is marked gray is exposed to the JS\n * engine (by handing it to running JS code or writing it into live JS\n * data). During incremental GC, since the gray bits haven't been computed yet,\n * we conservatively mark the object black.\n */\nstatic JS_ALWAYS_INLINE void\nExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)\n{\n    JS_ASSERT(kind != JSTRACE_SHAPE);\n\n    shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);\n#ifdef JSGC_GENERATIONAL\n    /*\n     * GC things residing in the nursery cannot be gray: they have no mark bits.\n     * All live objects in the nursery are moved to tenured at the beginning of\n     * each GC slice, so the gray marker never sees nursery things.\n     */\n    if (uintptr_t(thing) >= rt->gcNurseryStart_ && uintptr_t(thing) < rt->gcNurseryEnd_)\n        return;\n#endif\n    if (IsIncrementalBarrierNeededOnGCThing(rt, thing, kind))\n        IncrementalReferenceBarrier(thing, kind);\n    else if (GCThingIsMarkedGray(thing))\n        UnmarkGrayGCThingRecursively(thing, kind);\n}\n\nstatic JS_ALWAYS_INLINE void\nExposeValueToActiveJS(const Value &v)\n{\n    if (v.isMarkable())\n        ExposeGCThingToActiveJS(v.toGCThing(), v.gcKind());\n}\n\n} /* namespace JS */\n\n#endif /* js_GCAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/HashTable.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HashTable_h\n#define js_HashTable_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/PodOperations.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js/Utility.h\"\n\nnamespace js {\n\nclass TempAllocPolicy;\ntemplate <class> struct DefaultHasher;\ntemplate <class, class> class HashMapEntry;\nnamespace detail {\n    template <class T> class HashTableEntry;\n    template <class T, class HashPolicy, class AllocPolicy> class HashTable;\n}\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based map from keys to\n// values. In particular, HashMap calls constructors and destructors of all\n// objects added so non-PODs may be used safely.\n//\n// Key/Value requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members\n//   called by HashMap must not call back into the same HashMap object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class Key,\n          class Value,\n          class HashPolicy = DefaultHasher<Key>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashMap\n{\n    typedef HashMapEntry<Key, Value> TableEntry;\n\n    struct MapHashPolicy : HashPolicy\n    {\n        typedef Key KeyType;\n        static const Key &getKey(TableEntry &e) { return e.key; }\n        static void setKey(TableEntry &e, Key &k) { const_cast<Key &>(e.key) = k; }\n    };\n\n    typedef detail::HashTable<TableEntry, MapHashPolicy, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef TableEntry Entry;\n\n    // HashMap construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashMap and check the return value.\n    HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   if (HM::Ptr p = h.lookup(3)) {\n    //     const HM::Entry &e = *p; // p acts like a pointer to Entry\n    //     assert(p->key == 3);     // Entry contains the key\n    //     char val = p->value;     // and value\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above (with T = Entry).\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Like lookup, but does not assert if two threads call lookup at the same\n    // time. Only use this method when none of the threads will modify the map.\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const { return impl.readonlyThreadsafeLookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of Key |k| (where |HashPolicy::match(k,l) == true|) using\n    // |add(p,k,v)|. After |add(p,k,v)|, |p| points to the new Entry. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   HM::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3, 'a'))\n    //       return false;\n    //   }\n    //   const HM::Entry &e = *p;   // p acts like a pointer to Entry\n    //   assert(p->key == 3);       // Entry contains the key\n    //   char val = p->value;       // and value\n    //\n    // Also see the definition of AddPtr in HashTable above (with T = Entry).\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HM::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 'a'))\n    //        return false;\n    //    }\n    //    const HM::Entry &e = *p;\n    //    assert(p->key == 3);\n    //    char val = p->value;\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return impl.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        Entry e(k, Value());\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.relookupOrAdd(p, k, mozilla::Move(e));\n    }\n\n    // |all()| returns a Range containing |count()| elements. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   for (HM::Range r = h.all(); !r.empty(); r.popFront())\n    //     char c = r.front().value;\n    //\n    // Also see the definition of Range in HashTable above (with T = Entry).\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM s;\n    //   for (HM::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front().value == 'l')\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above (with T = Entry).\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all entries without triggering destructors. This method is unsafe.\n    void clearWithoutCallingDestructors()             { impl.clearWithoutCallingDestructors(); }\n\n    // Remove all the entries and release all internal buffers. The map must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashMap.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashMap operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        AddPtr p = lookupForAdd(k);\n        if (p) {\n            p->value = v;\n            return true;\n        }\n        return add(p, k, v);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.putNew(k, mozilla::Move(e));\n    }\n\n    // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom.\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        AddPtr p = lookupForAdd(k);\n        if (p)\n            return p;\n        (void)add(p, k, defaultValue);  // p is left false-y on oom.\n        return p;\n    }\n\n    // Remove if present.\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const Key &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashMap is movable\n    HashMap(mozilla::MoveRef<HashMap> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashMap> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashMap is not copyable or assignable\n    HashMap(const HashMap &hm) MOZ_DELETE;\n    HashMap &operator=(const HashMap &hm) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based set of values. In\n// particular, HashSet calls constructors and destructors of all objects added\n// so non-PODs may be used safely.\n//\n// T requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashSet is not reentrant: T/HashPolicy/AllocPolicy members called by\n//   HashSet must not call back into the same HashSet object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class T,\n          class HashPolicy = DefaultHasher<T>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashSet\n{\n    struct SetOps : HashPolicy\n    {\n        typedef T KeyType;\n        static const KeyType &getKey(const T &t) { return t; }\n        static void setKey(T &t, KeyType &k) { t = k; }\n    };\n\n    typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef T Entry;\n\n    // HashSet construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashSet and check the return value.\n    HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   if (HS::Ptr p = h.lookup(3)) {\n    //     assert(*p == 3);   // p acts like a pointer to int\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above.\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of T value |t| (where |HashPolicy::match(t,l) == true|) using\n    // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   HS::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3))\n    //       return false;\n    //   }\n    //   assert(*p == 3);   // p acts like a pointer to int\n    //\n    // Also see the definition of AddPtr in HashTable above.\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HS::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 3))\n    //        return false;\n    //    }\n    //    assert(*p == 3);\n    //\n    // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the\n    // entry |t|, where the caller ensures match(l,t).\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const        { return impl.lookupForAdd(l); }\n\n    bool add(AddPtr &p, const T &t)                   { return impl.add(p, t); }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return impl.relookupOrAdd(p, l, t);\n    }\n\n    // |all()| returns a Range containing |count()| elements:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   for (HS::Range r = h.all(); !r.empty(); r.popFront())\n    //     int i = r.front();\n    //\n    // Also see the definition of Range in HashTable above.\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS s;\n    //   for (HS::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front() == 42)\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above.\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all the entries and release all internal buffers. The set must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashSet.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashSet operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    bool put(const T &t) {\n        AddPtr p = lookupForAdd(t);\n        return p ? true : add(p, t);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    bool putNew(const T &t) {\n        return impl.putNew(t, t);\n    }\n\n    bool putNew(const Lookup &l, const T &t) {\n        return impl.putNew(l, t);\n    }\n\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const T &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashSet is movable\n    HashSet(mozilla::MoveRef<HashSet> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashSet> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashSet is not copyable or assignable\n    HashSet(const HashSet &hs) MOZ_DELETE;\n    HashSet &operator=(const HashSet &hs) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// Hash Policy\n//\n// A hash policy P for a hash table with key-type Key must provide:\n//  - a type |P::Lookup| to use to lookup table entries;\n//  - a static member function |P::hash| with signature\n//\n//      static js::HashNumber hash(Lookup)\n//\n//    to use to hash the lookup type; and\n//  - a static member function |P::match| with signature\n//\n//      static bool match(Key, Lookup)\n//\n//    to use to test equality of key and lookup values.\n//\n// Normally, Lookup = Key. In general, though, different values and types of\n// values can be used to lookup and store. If a Lookup value |l| is != to the\n// added Key value |k|, the user must ensure that |P::match(k,l)|. E.g.:\n//\n//   js::HashSet<Key, P>::AddPtr p = h.lookup(l);\n//   if (!p) {\n//     assert(P::match(k, l));  // must hold\n//     h.add(p, k);\n//   }\n\n// Pointer hashing policy that strips the lowest zeroBits when calculating the\n// hash to improve key distribution.\ntemplate <typename Key, size_t zeroBits>\nstruct PointerHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        size_t word = reinterpret_cast<size_t>(l) >> zeroBits;\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n#if JS_BYTES_PER_WORD == 4\n        return HashNumber(word);\n#else\n        JS_STATIC_ASSERT(sizeof word == 8);\n        return HashNumber((word >> 32) ^ word);\n#endif\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(k));\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        return k == l;\n    }\n};\n\n// Default hash policy: just use the 'lookup' value. This of course only\n// works if the lookup value is integral. HashTable applies ScrambleHashCode to\n// the result of the 'hash' which means that it is 'ok' if the lookup value is\n// not well distributed over the HashNumber domain.\ntemplate <class Key>\nstruct DefaultHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        // Hash if can implicitly cast to hash number type.\n        return l;\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        // Use builtin or overloaded operator==.\n        return k == l;\n    }\n};\n\n// Specialize hashing policy for pointer types. It assumes that the type is\n// at least word-aligned. For types with smaller size use PointerHasher.\ntemplate <class T>\nstruct DefaultHasher<T *> : PointerHasher<T *, mozilla::tl::FloorLog2<sizeof(void *)>::value>\n{};\n\n// For doubles, we can xor the two uint32s.\ntemplate <>\nstruct DefaultHasher<double>\n{\n    typedef double Lookup;\n    static HashNumber hash(double d) {\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n        uint64_t u = mozilla::BitwiseCast<uint64_t>(d);\n        return HashNumber(u ^ (u >> 32));\n    }\n    static bool match(double lhs, double rhs) {\n        return mozilla::BitwiseCast<uint64_t>(lhs) == mozilla::BitwiseCast<uint64_t>(rhs);\n    }\n};\n\n/*****************************************************************************/\n\n// Both HashMap and HashSet are implemented by a single HashTable that is even\n// more heavily parameterized than the other two. This leaves HashTable gnarly\n// and extremely coupled to HashMap and HashSet; thus code should not use\n// HashTable directly.\n\ntemplate <class Key, class Value>\nclass HashMapEntry\n{\n    template <class, class, class> friend class detail::HashTable;\n    template <class> friend class detail::HashTableEntry;\n\n    HashMapEntry(const HashMapEntry &) MOZ_DELETE;\n    void operator=(const HashMapEntry &) MOZ_DELETE;\n\n  public:\n    template<typename KeyInput, typename ValueInput>\n    HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {}\n\n    HashMapEntry(mozilla::MoveRef<HashMapEntry> rhs)\n      : key(mozilla::Move(rhs->key)), value(mozilla::Move(rhs->value)) { }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n\n    const Key key;\n    Value value;\n};\n\n} // namespace js\n\nnamespace mozilla {\n\ntemplate <typename T>\nstruct IsPod<js::detail::HashTableEntry<T> > : IsPod<T> {};\n\ntemplate <typename K, typename V>\nstruct IsPod<js::HashMapEntry<K, V> >\n  : IntegralConstant<bool, IsPod<K>::value && IsPod<V>::value>\n{};\n\n} // namespace mozilla\n\nnamespace js {\n\nnamespace detail {\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable;\n\ntemplate <class T>\nclass HashTableEntry\n{\n    template <class, class, class> friend class HashTable;\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n\n    HashNumber keyHash;\n    mozilla::AlignedStorage2<NonConstT> mem;\n\n    static const HashNumber sFreeKey = 0;\n    static const HashNumber sRemovedKey = 1;\n    static const HashNumber sCollisionBit = 1;\n\n    // Assumed by calloc in createTable.\n    JS_STATIC_ASSERT(sFreeKey == 0);\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return hash > sRemovedKey;\n    }\n\n    HashTableEntry(const HashTableEntry &) MOZ_DELETE;\n    void operator=(const HashTableEntry &) MOZ_DELETE;\n    ~HashTableEntry() MOZ_DELETE;\n\n  public:\n    // NB: HashTableEntry is treated as a POD: no constructor or destructor calls.\n\n    void destroyIfLive() {\n        if (isLive())\n            mem.addr()->~T();\n    }\n\n    void destroy() {\n        JS_ASSERT(isLive());\n        mem.addr()->~T();\n    }\n\n    void swap(HashTableEntry *other) {\n        mozilla::Swap(keyHash, other->keyHash);\n        mozilla::Swap(mem, other->mem);\n    }\n\n    T &get() { JS_ASSERT(isLive()); return *mem.addr(); }\n\n    bool isFree() const    { return keyHash == sFreeKey; }\n    void clearLive()       { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }\n    void clear()           { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }\n    bool isRemoved() const { return keyHash == sRemovedKey; }\n    void removeLive()      { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }\n    bool isLive() const    { return isLiveHash(keyHash); }\n    void setCollision()               { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }\n    void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }\n    void unsetCollision()             { keyHash &= ~sCollisionBit; }\n    bool hasCollision() const         { return keyHash & sCollisionBit; }\n    bool matchHash(HashNumber hn)     { return (keyHash & ~sCollisionBit) == hn; }\n    HashNumber getKeyHash() const     { return keyHash & ~sCollisionBit; }\n\n    template <class U>\n    void setLive(HashNumber hn, const U &u)\n    {\n        JS_ASSERT(!isLive());\n        keyHash = hn;\n        new(mem.addr()) T(u);\n        JS_ASSERT(isLive());\n    }\n};\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable : private AllocPolicy\n{\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n    typedef typename HashPolicy::KeyType Key;\n    typedef typename HashPolicy::Lookup Lookup;\n\n  public:\n    typedef HashTableEntry<T> Entry;\n\n    // A nullable pointer to a hash table element. A Ptr |p| can be tested\n    // either explicitly |if (p.found()) p->...| or using boolean conversion\n    // |if (p) p->...|. Ptr objects must not be used after any mutating hash\n    // table operations unless |generation()| is tested.\n    class Ptr\n    {\n        friend class HashTable;\n        typedef void (Ptr::* ConvertibleToBool)();\n        void nonNull() {}\n\n        Entry *entry_;\n\n      protected:\n        Ptr(Entry &entry) : entry_(&entry) {}\n\n      public:\n        // Leaves Ptr uninitialized.\n        Ptr() {\n#ifdef DEBUG\n            entry_ = (Entry *)0xbad;\n#endif\n        }\n\n        bool found() const                    { return entry_->isLive(); }\n        operator ConvertibleToBool() const    { return found() ? &Ptr::nonNull : 0; }\n        bool operator==(const Ptr &rhs) const { JS_ASSERT(found() && rhs.found()); return entry_ == rhs.entry_; }\n        bool operator!=(const Ptr &rhs) const { return !(*this == rhs); }\n\n        T &operator*() const                  { return entry_->get(); }\n        T *operator->() const                 { return &entry_->get(); }\n    };\n\n    // A Ptr that can be used to add a key after a failed lookup.\n    class AddPtr : public Ptr\n    {\n        friend class HashTable;\n        HashNumber keyHash;\n        mozilla::DebugOnly<uint64_t> mutationCount;\n\n        AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}\n      public:\n        // Leaves AddPtr uninitialized.\n        AddPtr() {}\n    };\n\n    // A collection of hash table entries. The collection is enumerated by\n    // calling |front()| followed by |popFront()| as long as |!empty()|. As\n    // with Ptr/AddPtr, Range objects must not be used after any mutating hash\n    // table operation unless the |generation()| is tested.\n    class Range\n    {\n      protected:\n        friend class HashTable;\n\n        Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) {\n            while (cur < end && !cur->isLive())\n                ++cur;\n        }\n\n        Entry *cur, *end;\n        mozilla::DebugOnly<bool> validEntry;\n\n      public:\n        Range() : cur(NULL), end(NULL), validEntry(false) {}\n\n        bool empty() const {\n            return cur == end;\n        }\n\n        T &front() const {\n            JS_ASSERT(validEntry);\n            JS_ASSERT(!empty());\n            return cur->get();\n        }\n\n        void popFront() {\n            JS_ASSERT(!empty());\n            while (++cur < end && !cur->isLive())\n                continue;\n            validEntry = true;\n        }\n    };\n\n    // A Range whose lifetime delimits a mutating enumeration of a hash table.\n    // Since rehashing when elements were removed during enumeration would be\n    // bad, it is postponed until the Enum is destructed.  Since the Enum's\n    // destructor touches the hash table, the user must ensure that the hash\n    // table is still alive when the destructor runs.\n    class Enum : public Range\n    {\n        friend class HashTable;\n\n        HashTable &table;\n        bool rekeyed;\n        bool removed;\n\n        /* Not copyable. */\n        Enum(const Enum &);\n        void operator=(const Enum &);\n\n      public:\n        template<class Map> explicit\n        Enum(Map &map) : Range(map.all()), table(map.impl), rekeyed(false), removed(false) {}\n\n        // Removes the |front()| element from the table, leaving |front()|\n        // invalid until the next call to |popFront()|. For example:\n        //\n        //   HashSet<int> s;\n        //   for (HashSet<int>::Enum e(s); !e.empty(); e.popFront())\n        //     if (e.front() == 42)\n        //       e.removeFront();\n        void removeFront() {\n            table.remove(*this->cur);\n            removed = true;\n            this->validEntry = false;\n        }\n\n        // Removes the |front()| element and re-inserts it into the table with\n        // a new key at the new Lookup position.  |front()| is invalid after\n        // this operation until the next call to |popFront()|.\n        void rekeyFront(const Lookup &l, const Key &k) {\n            table.rekey(*this->cur, l, k);\n            rekeyed = true;\n            this->validEntry = false;\n        }\n\n        void rekeyFront(const Key &k) {\n            rekeyFront(k, k);\n        }\n\n        // Potentially rehashes the table.\n        ~Enum() {\n            if (rekeyed) {\n                table.gen++;\n                table.checkOverRemoved();\n            }\n\n            if (removed)\n                table.compactIfUnderloaded();\n        }\n    };\n\n    // HashTable is movable\n    HashTable(mozilla::MoveRef<HashTable> rhs)\n      : AllocPolicy(*rhs)\n    {\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n    void operator=(mozilla::MoveRef<HashTable> rhs) {\n        if (table)\n            destroyTable(*this, table, capacity());\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n\n  private:\n    // HashTable is not copyable or assignable\n    HashTable(const HashTable &) MOZ_DELETE;\n    void operator=(const HashTable &) MOZ_DELETE;\n\n  private:\n    uint32_t    hashShift;      // multiplicative hash shift\n    uint32_t    entryCount;     // number of entries in table\n    uint32_t    gen;            // entry storage generation number\n    uint32_t    removedCount;   // removed entry sentinels in table\n    Entry       *table;         // entry storage\n\n    void setTableSizeLog2(unsigned sizeLog2)\n    {\n        hashShift = sHashBits - sizeLog2;\n    }\n\n#ifdef DEBUG\n    mutable struct Stats\n    {\n        uint32_t        searches;       // total number of table searches\n        uint32_t        steps;          // hash chain links traversed\n        uint32_t        hits;           // searches that found key\n        uint32_t        misses;         // searches that didn't find key\n        uint32_t        addOverRemoved; // adds that recycled a removed entry\n        uint32_t        removes;        // calls to remove\n        uint32_t        removeFrees;    // calls to remove that freed the entry\n        uint32_t        grows;          // table expansions\n        uint32_t        shrinks;        // table contractions\n        uint32_t        compresses;     // table compressions\n        uint32_t        rehashes;       // tombstone decontaminations\n    } stats;\n#   define METER(x) x\n#else\n#   define METER(x)\n#endif\n\n    friend class mozilla::ReentrancyGuard;\n    mutable mozilla::DebugOnly<bool> entered;\n    mozilla::DebugOnly<uint64_t>     mutationCount;\n\n    // The default initial capacity is 32 (enough to hold 16 elements), but it\n    // can be as low as 4.\n    static const unsigned sMinCapacityLog2 = 2;\n    static const unsigned sMinCapacity  = 1 << sMinCapacityLog2;\n    static const unsigned sMaxInit      = JS_BIT(23);\n    static const unsigned sMaxCapacity  = JS_BIT(24);\n    static const unsigned sHashBits     = mozilla::tl::BitSize<HashNumber>::value;\n    static const uint8_t  sMinAlphaFrac = 64;  // (0x100 * .25)\n    static const uint8_t  sMaxAlphaFrac = 192; // (0x100 * .75)\n    static const uint8_t  sInvMaxAlpha  = 171; // (ceil(0x100 / .75) >> 1)\n    static const HashNumber sFreeKey = Entry::sFreeKey;\n    static const HashNumber sRemovedKey = Entry::sRemovedKey;\n    static const HashNumber sCollisionBit = Entry::sCollisionBit;\n\n    static void staticAsserts()\n    {\n        // Rely on compiler \"constant overflow warnings\".\n        JS_STATIC_ASSERT(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity);\n        JS_STATIC_ASSERT((sMaxCapacity * sInvMaxAlpha) <= UINT32_MAX);\n        JS_STATIC_ASSERT((sMaxCapacity * sizeof(Entry)) <= UINT32_MAX);\n    }\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return Entry::isLiveHash(hash);\n    }\n\n    static HashNumber prepareHash(const Lookup& l)\n    {\n        HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l));\n\n        // Avoid reserved hash codes.\n        if (!isLiveHash(keyHash))\n            keyHash -= (sRemovedKey + 1);\n        return keyHash & ~sCollisionBit;\n    }\n\n    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)\n    {\n        // See JS_STATIC_ASSERT(sFreeKey == 0) in HashTableEntry.\n        return (Entry *)alloc.calloc_(capacity * sizeof(Entry));\n    }\n\n    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)\n    {\n        for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)\n            e->destroyIfLive();\n        alloc.free_(oldTable);\n    }\n\n  public:\n    HashTable(AllocPolicy ap)\n      : AllocPolicy(ap),\n        hashShift(sHashBits),\n        entryCount(0),\n        gen(0),\n        removedCount(0),\n        table(NULL),\n        entered(false),\n        mutationCount(0)\n    {}\n\n    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)\n    {\n        JS_ASSERT(!initialized());\n\n        // Correct for sMaxAlphaFrac such that the table will not resize\n        // when adding 'length' entries.\n        if (length > sMaxInit) {\n            this->reportAllocOverflow();\n            return false;\n        }\n        uint32_t newCapacity = (length * sInvMaxAlpha) >> 7;\n\n        if (newCapacity < sMinCapacity)\n            newCapacity = sMinCapacity;\n\n        // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034).\n        uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2;\n        while (roundUp < newCapacity) {\n            roundUp <<= 1;\n            ++roundUpLog2;\n        }\n\n        newCapacity = roundUp;\n        JS_ASSERT(newCapacity <= sMaxCapacity);\n\n        table = createTable(*this, newCapacity);\n        if (!table)\n            return false;\n\n        setTableSizeLog2(roundUpLog2);\n        METER(memset(&stats, 0, sizeof(stats)));\n        return true;\n    }\n\n    bool initialized() const\n    {\n        return !!table;\n    }\n\n    ~HashTable()\n    {\n        if (table)\n            destroyTable(*this, table, capacity());\n    }\n\n  private:\n    HashNumber hash1(HashNumber hash0) const\n    {\n        return hash0 >> hashShift;\n    }\n\n    struct DoubleHash\n    {\n        HashNumber h2;\n        HashNumber sizeMask;\n    };\n\n    DoubleHash hash2(HashNumber curKeyHash) const\n    {\n        unsigned sizeLog2 = sHashBits - hashShift;\n        DoubleHash dh = {\n            ((curKeyHash << sizeLog2) >> hashShift) | 1,\n            (HashNumber(1) << sizeLog2) - 1\n        };\n        return dh;\n    }\n\n    static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh)\n    {\n        return (h1 - dh.h2) & dh.sizeMask;\n    }\n\n    bool overloaded()\n    {\n        return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);\n    }\n\n    // Would the table be underloaded if it had the given capacity and entryCount?\n    static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount)\n    {\n        return capacity > sMinCapacity && entryCount <= ((sMinAlphaFrac * capacity) >> 8);\n    }\n\n    bool underloaded()\n    {\n        return wouldBeUnderloaded(capacity(), entryCount);\n    }\n\n    static bool match(Entry &e, const Lookup &l)\n    {\n        return HashPolicy::match(HashPolicy::getKey(e.get()), l);\n    }\n\n    Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const\n    {\n        JS_ASSERT(isLiveHash(keyHash));\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (entry->isFree()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Hit: return entry.\n        if (entry->matchHash(keyHash) && match(*entry, l)) {\n            METER(stats.hits++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        // Save the first removed entry pointer so we can recycle later.\n        Entry *firstRemoved = NULL;\n\n        while(true) {\n            if (JS_UNLIKELY(entry->isRemoved())) {\n                if (!firstRemoved)\n                    firstRemoved = entry;\n            } else {\n                entry->setCollision(collisionBit);\n            }\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (entry->isFree()) {\n                METER(stats.misses++);\n                return firstRemoved ? *firstRemoved : *entry;\n            }\n\n            if (entry->matchHash(keyHash) && match(*entry, l)) {\n                METER(stats.hits++);\n                return *entry;\n            }\n        }\n    }\n\n    // This is a copy of lookup hardcoded to the assumptions:\n    //   1. the lookup is a lookupForAdd\n    //   2. the key, whose |keyHash| has been passed is not in the table,\n    //   3. no entries have been removed from the table.\n    // This specialized search avoids the need for recovering lookup values\n    // from entries, which allows more flexible Lookup/Key types.\n    Entry &findFreeEntry(HashNumber keyHash)\n    {\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // We assume 'keyHash' has already been distributed.\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (!entry->isLive()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        while(true) {\n            JS_ASSERT(!entry->isRemoved());\n            entry->setCollision();\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (!entry->isLive()) {\n                METER(stats.misses++);\n                return *entry;\n            }\n        }\n    }\n\n    enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed };\n\n    RebuildStatus changeTableSize(int deltaLog2)\n    {\n        // Look, but don't touch, until we succeed in getting new entry store.\n        Entry *oldTable = table;\n        uint32_t oldCap = capacity();\n        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;\n        uint32_t newCapacity = JS_BIT(newLog2);\n        if (newCapacity > sMaxCapacity) {\n            this->reportAllocOverflow();\n            return RehashFailed;\n        }\n\n        Entry *newTable = createTable(*this, newCapacity);\n        if (!newTable)\n            return RehashFailed;\n\n        // We can't fail from here on, so update table parameters.\n        setTableSizeLog2(newLog2);\n        removedCount = 0;\n        gen++;\n        table = newTable;\n\n        // Copy only live entries, leaving removed ones behind.\n        for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {\n            if (src->isLive()) {\n                HashNumber hn = src->getKeyHash();\n                findFreeEntry(hn).setLive(hn, mozilla::Move(src->get()));\n                src->destroy();\n            }\n        }\n\n        // All entries have been destroyed, no need to destroyTable.\n        this->free_(oldTable);\n        return Rehashed;\n    }\n\n    RebuildStatus checkOverloaded()\n    {\n        if (!overloaded())\n            return NotOverloaded;\n\n        // Compress if a quarter or more of all entries are removed.\n        int deltaLog2;\n        if (removedCount >= (capacity() >> 2)) {\n            METER(stats.compresses++);\n            deltaLog2 = 0;\n        } else {\n            METER(stats.grows++);\n            deltaLog2 = 1;\n        }\n\n        return changeTableSize(deltaLog2);\n    }\n\n    // Infallibly rehash the table if we are overloaded with removals.\n    void checkOverRemoved()\n    {\n        if (overloaded()) {\n            if (checkOverloaded() == RehashFailed)\n                rehashTableInPlace();\n        }\n    }\n\n    void remove(Entry &e)\n    {\n        JS_ASSERT(table);\n        METER(stats.removes++);\n\n        if (e.hasCollision()) {\n            e.removeLive();\n            removedCount++;\n        } else {\n            METER(stats.removeFrees++);\n            e.clearLive();\n        }\n        entryCount--;\n        mutationCount++;\n    }\n\n    void checkUnderloaded()\n    {\n        if (underloaded()) {\n            METER(stats.shrinks++);\n            (void) changeTableSize(-1);\n        }\n    }\n\n    // Resize the table down to the largest capacity which doesn't underload the\n    // table.  Since we call checkUnderloaded() on every remove, you only need\n    // to call this after a bulk removal of items done without calling remove().\n    void compactIfUnderloaded()\n    {\n        int32_t resizeLog2 = 0;\n        uint32_t newCapacity = capacity();\n        while (wouldBeUnderloaded(newCapacity, entryCount)) {\n            newCapacity = newCapacity >> 1;\n            resizeLog2--;\n        }\n\n        if (resizeLog2 != 0) {\n            changeTableSize(resizeLog2);\n        }\n    }\n\n    // This is identical to changeTableSize(currentSize), but without requiring\n    // a second table.  We do this by recycling the collision bits to tell us if\n    // the element is already inserted or still waiting to be inserted.  Since\n    // already-inserted elements win any conflicts, we get the same table as we\n    // would have gotten through random insertion order.\n    void rehashTableInPlace()\n    {\n        METER(stats.rehashes++);\n        removedCount = 0;\n        for (size_t i = 0; i < capacity(); ++i)\n            table[i].unsetCollision();\n\n        for (size_t i = 0; i < capacity();) {\n            Entry *src = &table[i];\n\n            if (!src->isLive() || src->hasCollision()) {\n                ++i;\n                continue;\n            }\n\n            HashNumber keyHash = src->getKeyHash();\n            HashNumber h1 = hash1(keyHash);\n            DoubleHash dh = hash2(keyHash);\n            Entry *tgt = &table[h1];\n            while (true) {\n                if (!tgt->hasCollision()) {\n                    src->swap(tgt);\n                    tgt->setCollision();\n                    break;\n                }\n\n                h1 = applyDoubleHash(h1, dh);\n                tgt = &table[h1];\n            }\n        }\n\n        // TODO: this algorithm leaves collision bits on *all* elements, even if\n        // they are on no collision path. We have the option of setting the\n        // collision bits correctly on a subsequent pass or skipping the rehash\n        // unless we are totally filled with tombstones: benchmark to find out\n        // which approach is best.\n    }\n\n  public:\n    void clear()\n    {\n        if (mozilla::IsPod<Entry>::value) {\n            memset(table, 0, sizeof(*table) * capacity());\n        } else {\n            uint32_t tableCapacity = capacity();\n            for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)\n                e->clear();\n        }\n        removedCount = 0;\n        entryCount = 0;\n        mutationCount++;\n    }\n\n    void finish()\n    {\n        JS_ASSERT(!entered);\n\n        if (!table)\n            return;\n\n        destroyTable(*this, table, capacity());\n        table = NULL;\n        gen++;\n        entryCount = 0;\n        removedCount = 0;\n        mutationCount++;\n    }\n\n    Range all() const\n    {\n        JS_ASSERT(table);\n        return Range(table, table + capacity());\n    }\n\n    bool empty() const\n    {\n        JS_ASSERT(table);\n        return !entryCount;\n    }\n\n    uint32_t count() const\n    {\n        JS_ASSERT(table);\n        return entryCount;\n    }\n\n    uint32_t capacity() const\n    {\n        JS_ASSERT(table);\n        return JS_BIT(sHashBits - hashShift);\n    }\n\n    uint32_t generation() const\n    {\n        JS_ASSERT(table);\n        return gen;\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(table);\n    }\n\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    Ptr lookup(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const\n    {\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    AddPtr lookupForAdd(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        Entry &entry = lookup(l, keyHash, sCollisionBit);\n        AddPtr p(entry, keyHash);\n        p.mutationCount = mutationCount;\n        return p;\n    }\n\n    template <class U>\n    bool add(AddPtr &p, const U &rhs)\n    {\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(mutationCount == p.mutationCount);\n        JS_ASSERT(table);\n        JS_ASSERT(!p.found());\n        JS_ASSERT(!(p.keyHash & sCollisionBit));\n\n        // Changing an entry from removed to live does not affect whether we\n        // are overloaded and can be handled separately.\n        if (p.entry_->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            p.keyHash |= sCollisionBit;\n        } else {\n            // Preserve the validity of |p.entry_|.\n            RebuildStatus status = checkOverloaded();\n            if (status == RehashFailed)\n                return false;\n            if (status == Rehashed)\n                p.entry_ = &findFreeEntry(p.keyHash);\n        }\n\n        p.entry_->setLive(p.keyHash, rhs);\n        entryCount++;\n        mutationCount++;\n        return true;\n    }\n\n    template <class U>\n    void putNewInfallible(const Lookup &l, const U &u)\n    {\n        JS_ASSERT(table);\n\n        HashNumber keyHash = prepareHash(l);\n        Entry *entry = &findFreeEntry(keyHash);\n\n        if (entry->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            keyHash |= sCollisionBit;\n        }\n\n        entry->setLive(keyHash, u);\n        entryCount++;\n        mutationCount++;\n    }\n\n    template <class U>\n    bool putNew(const Lookup &l, const U &u)\n    {\n        if (checkOverloaded() == RehashFailed)\n            return false;\n\n        putNewInfallible(l, u);\n        return true;\n    }\n\n    template <class U>\n    bool relookupOrAdd(AddPtr& p, const Lookup &l, const U &u)\n    {\n        p.mutationCount = mutationCount;\n        {\n            mozilla::ReentrancyGuard g(*this);\n            p.entry_ = &lookup(l, p.keyHash, sCollisionBit);\n        }\n        return p.found() || add(p, u);\n    }\n\n    void remove(Ptr p)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        remove(*p.entry_);\n        checkUnderloaded();\n    }\n\n    void rekey(Ptr p, const Lookup &l, const Key &k)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));\n        HashPolicy::setKey(t, const_cast<Key &>(k));\n        remove(*p.entry_);\n        putNewInfallible(l, mozilla::Move(t));\n    }\n\n#undef METER\n};\n\n}  // namespace detail\n}  // namespace js\n\n#endif  /* js_HashTable_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/HeapAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HeapAPI_h\n#define js_HeapAPI_h\n\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n\n/* These values are private to the JS engine. */\nnamespace js {\nnamespace gc {\n\nconst size_t ArenaShift = 12;\nconst size_t ArenaSize = size_t(1) << ArenaShift;\nconst size_t ArenaMask = ArenaSize - 1;\n\nconst size_t ChunkShift = 20;\nconst size_t ChunkSize = size_t(1) << ChunkShift;\nconst size_t ChunkMask = ChunkSize - 1;\n\nconst size_t CellShift = 3;\nconst size_t CellSize = size_t(1) << CellShift;\nconst size_t CellMask = CellSize - 1;\n\n/* These are magic constants derived from actual offsets in gc/Heap.h. */\nconst size_t ChunkMarkBitmapOffset = 1032368;\nconst size_t ChunkMarkBitmapBits = 129024;\nconst size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);\n\n/*\n * Live objects are marked black. How many other additional colors are available\n * depends on the size of the GCThing. Objects marked gray are eligible for\n * cycle collection.\n */\nstatic const uint32_t BLACK = 0;\nstatic const uint32_t GRAY = 1;\n\n} /* namespace gc */\n} /* namespace js */\n\nnamespace JS {\nstruct Zone;\n} /* namespace JS */\n\nnamespace JS {\nnamespace shadow {\n\nstruct ArenaHeader\n{\n    JS::Zone *zone;\n};\n\nstruct Zone\n{\n    bool needsBarrier_;\n\n    Zone() : needsBarrier_(false) {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\nnamespace gc {\n\nstatic JS_ALWAYS_INLINE uintptr_t *\nGetGCThingMarkBitmap(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkMarkBitmapOffset;\n    return reinterpret_cast<uintptr_t *>(addr);\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::Runtime *\nGetGCThingRuntime(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkRuntimeOffset;\n    return *reinterpret_cast<JS::shadow::Runtime **>(addr);\n}\n\nstatic JS_ALWAYS_INLINE void\nGetGCThingMarkWordAndMask(const void *thing, uint32_t color,\n                          uintptr_t **wordp, uintptr_t *maskp)\n{\n    uintptr_t addr = uintptr_t(thing);\n    size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;\n    JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);\n    uintptr_t *bitmap = GetGCThingMarkBitmap(thing);\n    *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD);\n    *wordp = &bitmap[bit / JS_BITS_PER_WORD];\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::ArenaHeader *\nGetGCThingArena(void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ArenaMask;\n    return reinterpret_cast<JS::shadow::ArenaHeader *>(addr);\n}\n\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\nstatic JS_ALWAYS_INLINE Zone *\nGetGCThingZone(void *thing)\n{\n    JS_ASSERT(thing);\n    return js::gc::GetGCThingArena(thing)->zone;\n}\n\nstatic JS_ALWAYS_INLINE Zone *\nGetObjectZone(JSObject *obj)\n{\n    return GetGCThingZone(obj);\n}\n\nstatic JS_ALWAYS_INLINE bool\nGCThingIsMarkedGray(void *thing)\n{\n    uintptr_t *word, mask;\n    js::gc::GetGCThingMarkWordAndMask(thing, js::gc::GRAY, &word, &mask);\n    return *word & mask;\n}\n\nstatic JS_ALWAYS_INLINE bool\nIsIncrementalBarrierNeededOnGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind)\n{\n    if (!rt->needsBarrier_)\n        return false;\n    JS::Zone *zone = GetGCThingZone(thing);\n    return reinterpret_cast<shadow::Zone *>(zone)->needsBarrier_;\n}\n\n} /* namespace JS */\n\n#endif /* js_HeapAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/LegacyIntTypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This section typedefs the old 'native' types to the new <stdint.h> types.\n * These redefinitions are provided solely to allow JSAPI users to more easily\n * transition to <stdint.h> types.  They are not to be used in the JSAPI, and\n * new JSAPI user code should not use them.  This mapping file may eventually\n * be removed from SpiderMonkey, so don't depend on it in the long run.\n */\n\n/*\n * BEWARE: Comity with other implementers of these types is not guaranteed.\n *         Indeed, if you use this header and third-party code defining these\n *         types, *expect* to encounter either compile errors or link errors,\n *         depending how these types are used and on the order of inclusion.\n *         It is safest to use only the <stdint.h> types.\n */\n#ifndef js_LegacyIntTypes_h\n#define js_LegacyIntTypes_h\n\n#include <stdint.h>\n\n#include \"js-config.h\"\n\ntypedef uint8_t uint8;\ntypedef uint16_t uint16;\ntypedef uint32_t uint32;\ntypedef uint64_t uint64;\n\n/*\n * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very\n * common header file) defines the types int8, int16, int32, and int64.\n * So we don't define these four types here to avoid conflicts in case\n * the code also includes sys/types.h.\n */\n#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)\n#include <sys/inttypes.h>\n#else\ntypedef int8_t int8;\ntypedef int16_t int16;\ntypedef int32_t int32;\ntypedef int64_t int64;\n#endif /* AIX && HAVE_SYS_INTTYPES_H */\n\ntypedef uint8_t JSUint8;\ntypedef uint16_t JSUint16;\ntypedef uint32_t JSUint32;\ntypedef uint64_t JSUint64;\n\ntypedef int8_t JSInt8;\ntypedef int16_t JSInt16;\ntypedef int32_t JSInt32;\ntypedef int64_t JSInt64;\n\n#endif /* js_LegacyIntTypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/MemoryMetrics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_MemoryMetrics_h\n#define js_MemoryMetrics_h\n\n// These declarations are not within jsapi.h because they are highly likely to\n// change in the future. Depend on them at your own risk.\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include <string.h>\n\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n#include \"js/Vector.h\"\n\nclass nsISupports;      // This is needed for ObjectPrivateVisitor.\n\nnamespace js {\n\n// In memory reporting, we have concept of \"sundries\", line items which are too\n// small to be worth reporting individually.  Under some circumstances, a memory\n// reporter gets tossed into the sundries bucket if it's smaller than\n// MemoryReportingSundriesThreshold() bytes.\n//\n// We need to define this value here, rather than in the code which actually\n// generates the memory reports, because HugeStringInfo uses this value.\nJS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();\n\n} // namespace js\n\nnamespace JS {\n\n// Data for tracking memory usage of things hanging off objects.\nstruct ObjectsExtraSizes\n{\n    size_t slots;\n    size_t elementsNonAsmJS;\n    size_t elementsAsmJSHeap;\n    size_t elementsAsmJSNonHeap;\n    size_t argumentsData;\n    size_t regExpStatics;\n    size_t propertyIteratorData;\n    size_t ctypesData;\n    size_t private_;    // The '_' suffix is required because |private| is a keyword.\n                        // Note that this field is measured separately from the others.\n\n    ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); }\n\n    void add(ObjectsExtraSizes &sizes) {\n        this->slots                += sizes.slots;\n        this->elementsNonAsmJS     += sizes.elementsNonAsmJS;\n        this->elementsAsmJSHeap    += sizes.elementsAsmJSHeap;\n        this->elementsAsmJSNonHeap += sizes.elementsAsmJSNonHeap;\n        this->argumentsData        += sizes.argumentsData;\n        this->regExpStatics        += sizes.regExpStatics;\n        this->propertyIteratorData += sizes.propertyIteratorData;\n        this->ctypesData           += sizes.ctypesData;\n        this->private_             += sizes.private_;\n    }\n};\n\n// Data for tracking analysis/inference memory usage.\nstruct TypeInferenceSizes\n{\n    size_t typeScripts;\n    size_t typeResults;\n    size_t analysisPool;\n    size_t pendingArrays;\n    size_t allocationSiteTables;\n    size_t arrayTypeTables;\n    size_t objectTypeTables;\n\n    TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); }\n\n    void add(TypeInferenceSizes &sizes) {\n        this->typeScripts          += sizes.typeScripts;\n        this->typeResults          += sizes.typeResults;\n        this->analysisPool         += sizes.analysisPool;\n        this->pendingArrays        += sizes.pendingArrays;\n        this->allocationSiteTables += sizes.allocationSiteTables;\n        this->arrayTypeTables      += sizes.arrayTypeTables;\n        this->objectTypeTables     += sizes.objectTypeTables;\n    }\n};\n\n// Data for tracking JIT-code memory usage.\nstruct CodeSizes\n{\n    size_t ion;\n    size_t asmJS;\n    size_t baseline;\n    size_t regexp;\n    size_t other;\n    size_t unused;\n\n    CodeSizes() { memset(this, 0, sizeof(CodeSizes)); }\n};\n\n// Holds data about a huge string (one which uses more HugeStringInfo::MinSize\n// bytes of memory), so we can report it individually.\nstruct HugeStringInfo\n{\n    HugeStringInfo() : length(0), size(0) { memset(&buffer, 0, sizeof(buffer)); }\n\n    // A string needs to take up this many bytes of storage before we consider\n    // it to be \"huge\".\n    static size_t MinSize() {\n        return js::MemoryReportingSundriesThreshold();\n    }\n\n    // A string's size in memory is not necessarily equal to twice its length\n    // because the allocator and the JS engine both may round up.\n    size_t length;\n    size_t size;\n\n    // We record the first 32 chars of the escaped string here.  (We escape the\n    // string so we can use a char[] instead of a jschar[] here.\n    char buffer[32];\n};\n\n// These measurements relate directly to the JSRuntime, and not to\n// compartments within it.\nstruct RuntimeSizes\n{\n    RuntimeSizes() { memset(this, 0, sizeof(RuntimeSizes)); }\n\n    size_t object;\n    size_t atomsTable;\n    size_t contexts;\n    size_t dtoa;\n    size_t temporary;\n    size_t regexpData;\n    size_t interpreterStack;\n    size_t gcMarker;\n    size_t mathCache;\n    size_t scriptData;\n    size_t scriptSources;\n\n    CodeSizes code;\n};\n\nstruct ZoneStats\n{\n    ZoneStats()\n      : extra(NULL),\n        gcHeapArenaAdmin(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapStringsNormal(0),\n        gcHeapStringsShort(0),\n        gcHeapLazyScripts(0),\n        gcHeapTypeObjects(0),\n        gcHeapIonCodes(0),\n        stringCharsNonHuge(0),\n        lazyScripts(0),\n        typeObjects(0),\n        typePool(0),\n        hugeStrings()\n    {}\n\n    ZoneStats(const ZoneStats &other)\n      : extra(other.extra),\n        gcHeapArenaAdmin(other.gcHeapArenaAdmin),\n        gcHeapUnusedGcThings(other.gcHeapUnusedGcThings),\n        gcHeapStringsNormal(other.gcHeapStringsNormal),\n        gcHeapStringsShort(other.gcHeapStringsShort),\n        gcHeapLazyScripts(other.gcHeapLazyScripts),\n        gcHeapTypeObjects(other.gcHeapTypeObjects),\n        gcHeapIonCodes(other.gcHeapIonCodes),\n        stringCharsNonHuge(other.stringCharsNonHuge),\n        lazyScripts(other.lazyScripts),\n        typeObjects(other.typeObjects),\n        typePool(other.typePool),\n        hugeStrings()\n    {\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // Add other's numbers to this object's numbers.\n    void add(ZoneStats &other) {\n        #define ADD(x)  this->x += other.x\n\n        ADD(gcHeapArenaAdmin);\n        ADD(gcHeapUnusedGcThings);\n\n        ADD(gcHeapStringsNormal);\n        ADD(gcHeapStringsShort);\n        ADD(gcHeapLazyScripts);\n        ADD(gcHeapTypeObjects);\n        ADD(gcHeapIonCodes);\n\n        ADD(stringCharsNonHuge);\n        ADD(lazyScripts);\n        ADD(typeObjects);\n        ADD(typePool);\n\n        #undef ADD\n\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    size_t gcHeapArenaAdmin;\n    size_t gcHeapUnusedGcThings;\n\n    size_t gcHeapStringsNormal;\n    size_t gcHeapStringsShort;\n\n    size_t gcHeapLazyScripts;\n    size_t gcHeapTypeObjects;\n    size_t gcHeapIonCodes;\n\n    size_t stringCharsNonHuge;\n    size_t lazyScripts;\n    size_t typeObjects;\n    size_t typePool;\n\n    js::Vector<HugeStringInfo, 0, js::SystemAllocPolicy> hugeStrings;\n\n    // The size of all the live things in the GC heap that don't belong to any\n    // compartment.\n    size_t GCHeapThingsSize();\n};\n\nstruct CompartmentStats\n{\n    CompartmentStats()\n      : extra(NULL),\n        gcHeapObjectsOrdinary(0),\n        gcHeapObjectsFunction(0),\n        gcHeapObjectsDenseArray(0),\n        gcHeapObjectsSlowArray(0),\n        gcHeapObjectsCrossCompartmentWrapper(0),\n        gcHeapShapesTreeGlobalParented(0),\n        gcHeapShapesTreeNonGlobalParented(0),\n        gcHeapShapesDict(0),\n        gcHeapShapesBase(0),\n        gcHeapScripts(0),\n        objectsExtra(),\n        shapesExtraTreeTables(0),\n        shapesExtraDictTables(0),\n        shapesExtraTreeShapeKids(0),\n        shapesCompartmentTables(0),\n        scriptData(0),\n        baselineData(0),\n        baselineStubsFallback(0),\n        baselineStubsOptimized(0),\n        ionData(0),\n        compartmentObject(0),\n        crossCompartmentWrappersTable(0),\n        regexpCompartment(0),\n        debuggeesSet(0),\n        typeInference()\n    {}\n\n    CompartmentStats(const CompartmentStats &other)\n      : extra(other.extra),\n        gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary),\n        gcHeapObjectsFunction(other.gcHeapObjectsFunction),\n        gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray),\n        gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray),\n        gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper),\n        gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented),\n        gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented),\n        gcHeapShapesDict(other.gcHeapShapesDict),\n        gcHeapShapesBase(other.gcHeapShapesBase),\n        gcHeapScripts(other.gcHeapScripts),\n        objectsExtra(other.objectsExtra),\n        shapesExtraTreeTables(other.shapesExtraTreeTables),\n        shapesExtraDictTables(other.shapesExtraDictTables),\n        shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids),\n        shapesCompartmentTables(other.shapesCompartmentTables),\n        scriptData(other.scriptData),\n        baselineData(other.baselineData),\n        baselineStubsFallback(other.baselineStubsFallback),\n        baselineStubsOptimized(other.baselineStubsOptimized),\n        ionData(other.ionData),\n        compartmentObject(other.compartmentObject),\n        crossCompartmentWrappersTable(other.crossCompartmentWrappersTable),\n        regexpCompartment(other.regexpCompartment),\n        debuggeesSet(other.debuggeesSet),\n        typeInference(other.typeInference)\n    {\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    // If you add a new number, remember to update the constructors, add(), and\n    // maybe gcHeapThingsSize()!\n    size_t gcHeapObjectsOrdinary;\n    size_t gcHeapObjectsFunction;\n    size_t gcHeapObjectsDenseArray;\n    size_t gcHeapObjectsSlowArray;\n    size_t gcHeapObjectsCrossCompartmentWrapper;\n    size_t gcHeapShapesTreeGlobalParented;\n    size_t gcHeapShapesTreeNonGlobalParented;\n    size_t gcHeapShapesDict;\n    size_t gcHeapShapesBase;\n    size_t gcHeapScripts;\n    ObjectsExtraSizes objectsExtra;\n\n    size_t shapesExtraTreeTables;\n    size_t shapesExtraDictTables;\n    size_t shapesExtraTreeShapeKids;\n    size_t shapesCompartmentTables;\n    size_t scriptData;\n    size_t baselineData;\n    size_t baselineStubsFallback;\n    size_t baselineStubsOptimized;\n    size_t ionData;\n    size_t compartmentObject;\n    size_t crossCompartmentWrappersTable;\n    size_t regexpCompartment;\n    size_t debuggeesSet;\n\n    TypeInferenceSizes typeInference;\n\n    // Add cStats's numbers to this object's numbers.\n    void add(CompartmentStats &cStats) {\n        #define ADD(x)  this->x += cStats.x\n\n        ADD(gcHeapObjectsOrdinary);\n        ADD(gcHeapObjectsFunction);\n        ADD(gcHeapObjectsDenseArray);\n        ADD(gcHeapObjectsSlowArray);\n        ADD(gcHeapObjectsCrossCompartmentWrapper);\n        ADD(gcHeapShapesTreeGlobalParented);\n        ADD(gcHeapShapesTreeNonGlobalParented);\n        ADD(gcHeapShapesDict);\n        ADD(gcHeapShapesBase);\n        ADD(gcHeapScripts);\n        objectsExtra.add(cStats.objectsExtra);\n\n        ADD(shapesExtraTreeTables);\n        ADD(shapesExtraDictTables);\n        ADD(shapesExtraTreeShapeKids);\n        ADD(shapesCompartmentTables);\n        ADD(scriptData);\n        ADD(baselineData);\n        ADD(baselineStubsFallback);\n        ADD(baselineStubsOptimized);\n        ADD(ionData);\n        ADD(compartmentObject);\n        ADD(crossCompartmentWrappersTable);\n        ADD(regexpCompartment);\n        ADD(debuggeesSet);\n\n        #undef ADD\n\n        typeInference.add(cStats.typeInference);\n    }\n\n    // The size of all the live things in the GC heap.\n    size_t GCHeapThingsSize();\n};\n\nstruct RuntimeStats\n{\n    RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)\n      : runtime(),\n        gcHeapChunkTotal(0),\n        gcHeapDecommittedArenas(0),\n        gcHeapUnusedChunks(0),\n        gcHeapUnusedArenas(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapChunkAdmin(0),\n        gcHeapGcThings(0),\n        cTotals(),\n        zTotals(),\n        compartmentStatsVector(),\n        zoneStatsVector(),\n        currZoneStats(NULL),\n        mallocSizeOf_(mallocSizeOf)\n    {}\n\n    RuntimeSizes runtime;\n\n    // If you add a new number, remember to update the constructor!\n\n    // Here's a useful breakdown of the GC heap.\n    //\n    // - rtStats.gcHeapChunkTotal\n    //   - decommitted bytes\n    //     - rtStats.gcHeapDecommittedArenas (decommitted arenas in non-empty chunks)\n    //   - unused bytes\n    //     - rtStats.gcHeapUnusedChunks (empty chunks)\n    //     - rtStats.gcHeapUnusedArenas (empty arenas within non-empty chunks)\n    //     - rtStats.total.gcHeapUnusedGcThings (empty GC thing slots within non-empty arenas)\n    //   - used bytes\n    //     - rtStats.gcHeapChunkAdmin\n    //     - rtStats.total.gcHeapArenaAdmin\n    //     - rtStats.gcHeapGcThings (in-use GC things)\n    //\n    // It's possible that some arenas in empty chunks may be decommitted, but\n    // we don't count those under rtStats.gcHeapDecommittedArenas because (a)\n    // it's rare, and (b) this means that rtStats.gcHeapUnusedChunks is a\n    // multiple of the chunk size, which is good.\n\n    size_t gcHeapChunkTotal;\n    size_t gcHeapDecommittedArenas;\n    size_t gcHeapUnusedChunks;\n    size_t gcHeapUnusedArenas;\n    size_t gcHeapUnusedGcThings;\n    size_t gcHeapChunkAdmin;\n    size_t gcHeapGcThings;\n\n    // The sum of all compartment's measurements.\n    CompartmentStats cTotals;\n    ZoneStats zTotals;\n\n    js::Vector<CompartmentStats, 0, js::SystemAllocPolicy> compartmentStatsVector;\n    js::Vector<ZoneStats, 0, js::SystemAllocPolicy> zoneStatsVector;\n\n    ZoneStats *currZoneStats;\n\n    mozilla::MallocSizeOf mallocSizeOf_;\n\n    virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;\n    virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;\n};\n\nclass ObjectPrivateVisitor\n{\n  public:\n    // Within CollectRuntimeStats, this method is called for each JS object\n    // that has an nsISupports pointer.\n    virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0;\n\n    // A callback that gets a JSObject's nsISupports pointer, if it has one.\n    // Note: this function does *not* addref |iface|.\n    typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface);\n    GetISupportsFun getISupports_;\n\n    ObjectPrivateVisitor(GetISupportsFun getISupports)\n      : getISupports_(getISupports)\n    {}\n};\n\nextern JS_PUBLIC_API(bool)\nCollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv);\n\nextern JS_PUBLIC_API(size_t)\nSystemCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nUserCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nPeakSizeOfTemporary(const JSRuntime *rt);\n\n} // namespace JS\n\n#endif /* js_MemoryMetrics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/PropertyKey.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::PropertyKey implementation. */\n\n#ifndef js_PropertyKey_h\n#define js_PropertyKey_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"js/Value.h\"\n\nstruct JSContext;\n\nnamespace JS {\n\nclass PropertyKey;\n\nnamespace detail {\n\nextern JS_PUBLIC_API(bool)\nToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n} // namespace detail\n\n/*\n * A PropertyKey is a key used to access some property on an object.  It is a\n * natural way to represent a property accessed using a JavaScript value.\n *\n * PropertyKey can represent indexes, named properties, and ES6 symbols.  The\n * latter aren't implemented in SpiderMonkey yet, but PropertyKey carves out\n * space for them.\n */\nclass PropertyKey\n{\n    Value v;\n    friend JS_PUBLIC_API(bool) detail::ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n  public:\n    explicit PropertyKey(uint32_t index) : v(PrivateUint32Value(index)) {}\n\n    /*\n     * An index is a string property name whose characters exactly spell out an\n     * unsigned 32-bit integer in decimal: \"0\", \"1\", \"2\", ...., \"4294967294\",\n     * \"4294967295\".\n     */\n    bool isIndex(uint32_t *index) {\n        // The implementation here assumes that private uint32_t are stored\n        // using the int32_t representation.  This is purely an implementation\n        // detail: embedders must not rely upon this!\n        if (!v.isInt32())\n            return false;\n        *index = v.toPrivateUint32();\n        return true;\n    }\n\n    /*\n     * A name is a string property name which is *not* an index.  Note that by\n     * the ECMAScript language grammar, any dotted property access |obj.prop|\n     * will access a named property.\n     */\n    bool isName(JSString **str) {\n        uint32_t dummy;\n        if (isIndex(&dummy))\n            return false;\n        *str = v.toString();\n        return true;\n    }\n\n    /*\n     * A symbol is a property name that's a Symbol, a particular kind of object\n     * in ES6.  It is the only kind of property name that's not a string.\n     *\n     * SpiderMonkey doesn't yet implement symbols, but we're carving out API\n     * space for them in advance.\n     */\n    bool isSymbol() {\n        return false;\n    }\n};\n\ninline bool\nToPropertyKey(JSContext *cx, HandleValue v, PropertyKey *key)\n{\n    if (v.isInt32() && v.toInt32() >= 0) {\n        *key = PropertyKey(uint32_t(v.toInt32()));\n        return true;\n    }\n\n    return detail::ToPropertyKeySlow(cx, v, key);\n}\n\n} // namespace JS\n\n#endif /* js_PropertyKey_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/RequiredDefines.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Various #defines required to build SpiderMonkey.  Embedders should add this\n * file to the start of the command line via -include or a similar mechanism,\n * or SpiderMonkey public headers may not work correctly.\n */\n\n#ifndef js_RequiredDefines_h\n#define js_RequiredDefines_h\n\n/*\n * The c99 defining the limit macros (UINT32_MAX for example), says:\n * C++ implementations should define these macros only when __STDC_LIMIT_MACROS\n * is defined before <stdint.h> is included.\n */\n#define __STDC_LIMIT_MACROS\n\n#endif /* js_RequiredDefines_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/RootingAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_RootingAPI_h\n#define js_RootingAPI_h\n\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\n/*\n * Moving GC Stack Rooting\n *\n * A moving GC may change the physical location of GC allocated things, even\n * when they are rooted, updating all pointers to the thing to refer to its new\n * location. The GC must therefore know about all live pointers to a thing,\n * not just one of them, in order to behave correctly.\n *\n * The |Rooted| and |Handle| classes below are used to root stack locations\n * whose value may be held live across a call that can trigger GC. For a\n * code fragment such as:\n *\n * JSObject *obj = NewObject(cx);\n * DoSomething(cx);\n * ... = obj->lastProperty();\n *\n * If |DoSomething()| can trigger a GC, the stack location of |obj| must be\n * rooted to ensure that the GC does not move the JSObject referred to by\n * |obj| without updating |obj|'s location itself. This rooting must happen\n * regardless of whether there are other roots which ensure that the object\n * itself will not be collected.\n *\n * If |DoSomething()| cannot trigger a GC, and the same holds for all other\n * calls made between |obj|'s definitions and its last uses, then no rooting\n * is required.\n *\n * SpiderMonkey can trigger a GC at almost any time and in ways that are not\n * always clear. For example, the following innocuous-looking actions can\n * cause a GC: allocation of any new GC thing; JSObject::hasProperty;\n * JS_ReportError and friends; and ToNumber, among many others. The following\n * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_,\n * rt->malloc_, and friends and JS_ReportOutOfMemory.\n *\n * The following family of three classes will exactly root a stack location.\n * Incorrect usage of these classes will result in a compile error in almost\n * all cases. Therefore, it is very hard to be incorrectly rooted if you use\n * these classes exclusively. These classes are all templated on the type T of\n * the value being rooted.\n *\n * - Rooted<T> declares a variable of type T, whose value is always rooted.\n *   Rooted<T> may be automatically coerced to a Handle<T>, below. Rooted<T>\n *   should be used whenever a local variable's value may be held live across a\n *   call which can trigger a GC.\n *\n * - Handle<T> is a const reference to a Rooted<T>. Functions which take GC\n *   things or values as arguments and need to root those arguments should\n *   generally use handles for those arguments and avoid any explicit rooting.\n *   This has two benefits. First, when several such functions call each other\n *   then redundant rooting of multiple copies of the GC thing can be avoided.\n *   Second, if the caller does not pass a rooted value a compile error will be\n *   generated, which is quicker and easier to fix than when relying on a\n *   separate rooting analysis.\n *\n * - MutableHandle<T> is a non-const reference to Rooted<T>. It is used in the\n *   same way as Handle<T> and includes a |set(const T &v)| method to allow\n *   updating the value of the referenced Rooted<T>. A MutableHandle<T> can be\n *   created from a Rooted<T> by using |Rooted<T>::operator&()|.\n *\n * In some cases the small performance overhead of exact rooting (measured to\n * be a few nanoseconds on desktop) is too much. In these cases, try the\n * following:\n *\n * - Move all Rooted<T> above inner loops: this allows you to re-use the root\n *   on each iteration of the loop.\n *\n * - Pass Handle<T> through your hot call stack to avoid re-rooting costs at\n *   every invocation.\n *\n * The following diagram explains the list of supported, implicit type\n * conversions between classes of this family:\n *\n *  Rooted<T> ----> Handle<T>\n *     |               ^\n *     |               |\n *     |               |\n *     +---> MutableHandle<T>\n *     (via &)\n *\n * All of these types have an implicit conversion to raw pointers.\n */\n\nnamespace js {\n\nclass Module;\nclass ScriptSourceObject;\n\ntemplate <typename T>\nstruct GCMethods {};\n\ntemplate <typename T>\nclass RootedBase {};\n\ntemplate <typename T>\nclass HandleBase {};\n\ntemplate <typename T>\nclass MutableHandleBase {};\n\ntemplate <typename T>\nclass HeapBase {};\n\n/*\n * js::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for js::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(js::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n *\n * This is the SpiderMonkey internal variant. js::NullPtr should be used in\n * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API\n * symbols.\n */\nstruct NullPtr\n{\n    static void * const constNullValue;\n};\n\nnamespace gc {\nstruct Cell;\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> class Rooted;\n\ntemplate <typename T> class Handle;\ntemplate <typename T> class MutableHandle;\n\n/* This is exposing internal state of the GC for inlining purposes. */\nJS_FRIEND_API(bool) isGCEnabled();\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\nextern void\nCheckStackRoots(JSContext *cx);\n#endif\n\n/*\n * JS::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for JS::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(JS::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n */\nstruct JS_PUBLIC_API(NullPtr)\n{\n    static void * const constNullValue;\n};\n\n/*\n * The Heap<T> class is a C/C++ heap-stored reference to a JS GC thing.  All\n * members of heap classes that refer to GC thing should use Heap<T> (or\n * possibly TenuredHeap<T>, described below).\n *\n * Heap<T> wraps the complex mechanisms required to ensure GC safety for the\n * contained reference into a C++ class that behaves similarly to a normal\n * pointer.\n *\n * GC references stored on the C/C++ stack must use Rooted/Handle/MutableHandle\n * instead.\n *\n * Requirements for type T:\n *  - Must be one of: Value, jsid, JSObject*, JSString*, JSScript*\n */\ntemplate <typename T>\nclass Heap : public js::HeapBase<T>\n{\n  public:\n    Heap() {\n        static_assert(sizeof(T) == sizeof(Heap<T>),\n                      \"Heap<T> must be binary compatible with T.\");\n        init(js::GCMethods<T>::initial());\n    }\n    explicit Heap(T p) { init(p); }\n    explicit Heap(const Heap<T> &p) { init(p.ptr); }\n\n    ~Heap() {\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            relocate();\n    }\n\n    bool operator==(const Heap<T> &other) { return ptr == other.ptr; }\n    bool operator!=(const Heap<T> &other) { return ptr != other.ptr; }\n\n    bool operator==(const T &other) const { return ptr == other; }\n    bool operator!=(const T &other) const { return ptr != other; }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    const T *address() const { return &ptr; }\n    const T &get() const { return ptr; }\n\n    T *unsafeGet() { return &ptr; }\n\n    Heap<T> &operator=(T p) {\n        set(p);\n        return *this;\n    }\n\n    void set(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (js::GCMethods<T>::needsPostBarrier(newPtr)) {\n            ptr = newPtr;\n            post();\n        } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {\n            relocate();  /* Called before overwriting ptr. */\n            ptr = newPtr;\n        } else {\n            ptr = newPtr;\n        }\n    }\n\n  private:\n    void init(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        ptr = newPtr;\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            post();\n    }\n\n    void post() {\n#ifdef JSGC_GENERATIONAL\n        JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));\n        js::GCMethods<T>::postBarrier(&ptr);\n#endif\n    }\n\n    void relocate() {\n#ifdef JSGC_GENERATIONAL\n        js::GCMethods<T>::relocate(&ptr);\n#endif\n    }\n\n    T ptr;\n};\n\n#ifdef DEBUG\n/*\n * For generational GC, assert that an object is in the tenured generation as\n * opposed to being in the nursery.\n */\nextern JS_FRIEND_API(void)\nAssertGCThingMustBeTenured(JSObject* obj);\n#else\ninline void\nAssertGCThingMustBeTenured(JSObject *obj) {}\n#endif\n\n/*\n * The TenuredHeap<T> class is similar to the Heap<T> class above in that it\n * encapsulates the GC concerns of an on-heap reference to a JS object. However,\n * it has two important differences:\n *\n *  1) Pointers which are statically known to only reference \"tenured\" objects\n *     can avoid the extra overhead of SpiderMonkey's write barriers.\n *\n *  2) Objects in the \"tenured\" heap have stronger alignment restrictions than\n *     those in the \"nursery\", so it is possible to store flags in the lower\n *     bits of pointers known to be tenured. TenuredHeap wraps a normal tagged\n *     pointer with a nice API for accessing the flag bits and adds various\n *     assertions to ensure that it is not mis-used.\n *\n * GC things are said to be \"tenured\" when they are located in the long-lived\n * heap: e.g. they have gained tenure as an object by surviving past at least\n * one GC. For performance, SpiderMonkey allocates some things which are known\n * to normally be long lived directly into the tenured generation; for example,\n * global objects. Additionally, SpiderMonkey does not visit individual objects\n * when deleting non-tenured objects, so object with finalizers are also always\n * tenured; for instance, this includes most DOM objects.\n *\n * The considerations to keep in mind when using a TenuredHeap<T> vs a normal\n * Heap<T> are:\n *\n *  - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing.\n *  - It is however valid for a Heap<T> to refer to a tenured thing.\n *  - It is not possible to store flag bits in a Heap<T>.\n */\ntemplate <typename T>\nclass TenuredHeap : public js::HeapBase<T>\n{\n  public:\n    TenuredHeap() : bits(0) {\n        static_assert(sizeof(T) == sizeof(TenuredHeap<T>),\n                      \"TenuredHeap<T> must be binary compatible with T.\");\n    }\n    explicit TenuredHeap(T p) : bits(0) { setPtr(p); }\n    explicit TenuredHeap(const TenuredHeap<T> &p) : bits(0) { setPtr(p.ptr); }\n\n    bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }\n    bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }\n\n    void setPtr(T newPtr) {\n        JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (newPtr)\n            AssertGCThingMustBeTenured(newPtr);\n        bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);\n    }\n\n    void setFlags(uintptr_t flagsToSet) {\n        JS_ASSERT((flagsToSet & ~flagsMask) == 0);\n        bits |= flagsToSet;\n    }\n\n    void unsetFlags(uintptr_t flagsToUnset) {\n        JS_ASSERT((flagsToUnset & ~flagsMask) == 0);\n        bits &= ~flagsToUnset;\n    }\n\n    bool hasFlag(uintptr_t flag) const {\n        JS_ASSERT((flag & ~flagsMask) == 0);\n        return (bits & flag) != 0;\n    }\n\n    T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }\n    uintptr_t getFlags() const { return bits & flagsMask; }\n\n    operator T() const { return getPtr(); }\n    T operator->() const { return getPtr(); }\n\n    TenuredHeap<T> &operator=(T p) {\n        setPtr(p);\n        return *this;\n    }\n\n    /*\n     * Set the pointer to a value which will cause a crash if it is\n     * dereferenced.\n     */\n    void setToCrashOnTouch() {\n        bits = (bits & flagsMask) | crashOnTouchPointer;\n    }\n\n    bool isSetToCrashOnTouch() {\n        return (bits & ~flagsMask) == crashOnTouchPointer;\n    }\n\n  private:\n    enum {\n        maskBits = 3,\n        flagsMask = (1 << maskBits) - 1,\n        crashOnTouchPointer = 1 << maskBits\n    };\n\n    uintptr_t bits;\n};\n\n/*\n * Reference to a T that has been rooted elsewhere. This is most useful\n * as a parameter type, which guarantees that the T lvalue is properly\n * rooted. See \"Move GC Stack Rooting\" above.\n *\n * If you want to add additional methods to Handle for a specific\n * specialization, define a HandleBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>\n{\n    friend class MutableHandle<T>;\n\n  public:\n    /* Creates a handle from a handle of a type convertible to T. */\n    template <typename S>\n    Handle(Handle<S> handle,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)\n    {\n        static_assert(sizeof(Handle<T>) == sizeof(T *),\n                      \"Handle must be binary compatible with T*.\");\n        ptr = reinterpret_cast<const T *>(handle.address());\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(js::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"js::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&js::NullPtr::constNullValue);\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(JS::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"JS::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&JS::NullPtr::constNullValue);\n    }\n\n    Handle(MutableHandle<T> handle) {\n        ptr = handle.address();\n    }\n\n    /*\n     * Take care when calling this method!\n     *\n     * This creates a Handle from the raw location of a T.\n     *\n     * It should be called only if the following conditions hold:\n     *\n     *  1) the location of the T is guaranteed to be marked (for some reason\n     *     other than being a Rooted), e.g., if it is guaranteed to be reachable\n     *     from an implicit root.\n     *\n     *  2) the contents of the location are immutable, or at least cannot change\n     *     for the lifetime of the handle, as its users may not expect its value\n     *     to change underneath them.\n     */\n    static Handle fromMarkedLocation(const T *p) {\n        Handle h;\n        h.ptr = p;\n        return h;\n    }\n\n    /*\n     * Construct a handle from an explicitly rooted location. This is the\n     * normal way to create a handle, and normally happens implicitly.\n     */\n    template <typename S>\n    inline\n    Handle(const Rooted<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    /* Construct a read only handle from a mutable handle. */\n    template <typename S>\n    inline\n    Handle(MutableHandle<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    const T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a Handle<T> to something that\n     * takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n    bool operator!=(const T &other) const { return *ptr != other; }\n    bool operator==(const T &other) const { return *ptr == other; }\n\n  private:\n    Handle() {}\n\n    const T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\ntypedef Handle<JSObject*>                   HandleObject;\ntypedef Handle<js::Module*>                 HandleModule;\ntypedef Handle<js::ScriptSourceObject *>    HandleScriptSource;\ntypedef Handle<JSFunction*>                 HandleFunction;\ntypedef Handle<JSScript*>                   HandleScript;\ntypedef Handle<JSString*>                   HandleString;\ntypedef Handle<jsid>                        HandleId;\ntypedef Handle<Value>                       HandleValue;\n\n/*\n * Similar to a handle, but the underlying storage can be changed. This is\n * useful for outparams.\n *\n * If you want to add additional methods to MutableHandle for a specific\n * specialization, define a MutableHandleBase<T> specialization containing\n * them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    inline MutableHandle(Rooted<T> *root);\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    /*\n     * This may be called only if the location of the T is guaranteed\n     * to be marked (for some reason other than being a Rooted),\n     * e.g., if it is guaranteed to be reachable from an implicit root.\n     *\n     * Create a MutableHandle from a raw location of a T.\n     */\n    static MutableHandle fromMarkedLocation(T *p) {\n        MutableHandle h;\n        h.ptr = p;\n        return h;\n    }\n\n    T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a MutableHandle<T> to something that takes\n     * a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    MutableHandle() {}\n\n    T *ptr;\n\n    template <typename S> void operator=(S v) MOZ_DELETE;\n    void operator=(MutableHandle other) MOZ_DELETE;\n};\n\ntypedef MutableHandle<JSObject*>   MutableHandleObject;\ntypedef MutableHandle<JSFunction*> MutableHandleFunction;\ntypedef MutableHandle<JSScript*>   MutableHandleScript;\ntypedef MutableHandle<JSString*>   MutableHandleString;\ntypedef MutableHandle<jsid>        MutableHandleId;\ntypedef MutableHandle<Value>       MutableHandleValue;\n\n#ifdef JSGC_GENERATIONAL\nJS_PUBLIC_API(void) HeapCellPostBarrier(js::gc::Cell **cellp);\nJS_PUBLIC_API(void) HeapCellRelocate(js::gc::Cell **cellp);\n#endif\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * InternalHandle is a handle to an internal pointer into a gcthing. Use\n * InternalHandle when you have a pointer to a direct field of a gcthing, or\n * when you need a parameter type for something that *may* be a pointer to a\n * direct field of a gcthing.\n */\ntemplate <typename T>\nclass InternalHandle {};\n\ntemplate <typename T>\nclass InternalHandle<T*>\n{\n    void * const *holder;\n    size_t offset;\n\n  public:\n    /*\n     * Create an InternalHandle using a Handle to the gcthing containing the\n     * field in question, and a pointer to the field.\n     */\n    template<typename H>\n    InternalHandle(const JS::Handle<H> &handle, T *field)\n      : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get()))\n    {}\n\n    /*\n     * Create an InternalHandle to a field within a Rooted<>.\n     */\n    template<typename R>\n    InternalHandle(const JS::Rooted<R> &root, T *field)\n      : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get()))\n    {}\n\n    T *get() const { return reinterpret_cast<T*>(uintptr_t(*holder) + offset); }\n\n    const T &operator*() const { return *get(); }\n    T *operator->() const { return get(); }\n\n    static InternalHandle<T*> fromMarkedLocation(T *fieldPtr) {\n        return InternalHandle(fieldPtr);\n    }\n\n  private:\n    /*\n     * Create an InternalHandle to something that is not a pointer to a\n     * gcthing, and so does not need to be rooted in the first place. Use these\n     * InternalHandles to pass pointers into functions that also need to accept\n     * regular InternalHandles to gcthing fields.\n     *\n     * Make this private to prevent accidental misuse; this is only for\n     * fromMarkedLocation().\n     */\n    InternalHandle(T *field)\n      : holder(reinterpret_cast<void * const *>(&js::NullPtr::constNullValue)),\n        offset(uintptr_t(field))\n    {}\n};\n\n/*\n * By default, pointers should use the inheritance hierarchy to find their\n * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that\n * Rooted<T> may be used without the class definition being available.\n */\ntemplate <typename T>\nstruct RootKind<T *>\n{\n    static ThingRootKind rootKind() { return T::rootKind(); }\n};\n\ntemplate <typename T>\nstruct GCMethods<T *>\n{\n    static T *initial() { return NULL; }\n    static ThingRootKind kind() { return RootKind<T *>::rootKind(); }\n    static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }\n    static bool needsPostBarrier(T *v) { return v; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(T **vp) {\n        JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n    static void relocate(T **vp) {\n        JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n#endif\n};\n\n// XXX: Needed for cocos2d JS Bindings\n//#if defined(DEBUG)\n/* This helper allows us to assert that Rooted<T> is scoped within a request. */\nextern JS_PUBLIC_API(bool)\nIsInRequest(JSContext *cx);\n//#endif\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Local variable of type T whose value is always rooted. This is typically\n * used for local variables, or for non-rooted values being passed to a\n * function that requires a handle, e.g. Foo(Root<T>(cx, x)).\n *\n * If you want to add additional methods to Rooted for a specific\n * specialization, define a RootedBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS Rooted : public js::RootedBase<T>\n{\n    /* Note: CX is a subclass of either ContextFriendFields or PerThreadDataFriendFields. */\n    template <typename CX>\n    void init(CX *cx) {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        js::ThingRootKind kind = js::GCMethods<T>::kind();\n        this->stack = &cx->thingGCRooters[kind];\n        this->prev = *stack;\n        *stack = reinterpret_cast<Rooted<void*>*>(this);\n\n        JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));\n#endif\n    }\n\n  public:\n    Rooted(JSContext *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(JSContext *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(js::ContextFriendFields *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::ContextFriendFields *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(JSRuntime *rt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    Rooted(JSRuntime *rt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    ~Rooted() {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));\n        *stack = prev;\n#endif\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<T> *previous() { return prev; }\n#endif\n\n    /*\n     * Important: Return a reference here so passing a Rooted<T> to\n     * something that takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    T &operator=(const Rooted &value) {\n        ptr = value;\n        return ptr;\n    }\n\n    void set(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<void*> **stack, *prev;\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /* Has the rooting analysis ever scanned this Rooted's stack location? */\n    friend void JS::CheckStackRoots(JSContext*);\n#endif\n\n#ifdef JSGC_ROOT_ANALYSIS\n    bool scanned;\n#endif\n\n    /*\n     * |ptr| must be the last field in Rooted because the analysis treats all\n     * Rooted as Rooted<void*> during the analysis. See bug 829372.\n     */\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    Rooted(const Rooted &) MOZ_DELETE;\n};\n\n#if !(defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING))\n// Defined in vm/String.h.\ntemplate <>\nclass Rooted<JSStableString *>;\n#endif\n\ntypedef Rooted<JSObject*>                   RootedObject;\ntypedef Rooted<js::Module*>                 RootedModule;\ntypedef Rooted<js::ScriptSourceObject *>    RootedScriptSource;\ntypedef Rooted<JSFunction*>                 RootedFunction;\ntypedef Rooted<JSScript*>                   RootedScript;\ntypedef Rooted<JSString*>                   RootedString;\ntypedef Rooted<jsid>                        RootedId;\ntypedef Rooted<JS::Value>                   RootedValue;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Mark a stack location as a root for the rooting analysis, without actually\n * rooting it in release builds. This should only be used for stack locations\n * of GC things that cannot be relocated by a garbage collection, and that\n * are definitely reachable via another path.\n */\nclass SkipRoot\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n\n    SkipRoot **stack, *prev;\n    const uint8_t *start;\n    const uint8_t *end;\n\n    template <typename CX, typename T>\n    void init(CX *cx, const T *ptr, size_t count) {\n        SkipRoot **head = &cx->skipGCRooters;\n        this->stack = head;\n        this->prev = *stack;\n        *stack = this;\n        this->start = (const uint8_t *) ptr;\n        this->end = this->start + (sizeof(T) * count);\n    }\n\n  public:\n    ~SkipRoot() {\n        JS_ASSERT(*stack == this);\n        *stack = prev;\n    }\n\n    SkipRoot *previous() { return prev; }\n\n    bool contains(const uint8_t *v, size_t len) {\n        return v >= start && v + len <= end;\n    }\n\n#else /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {}\n\n  public:\n\n#endif /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    SkipRoot(JSContext *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(ContextFriendFields::get(cx), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(ContextFriendFields *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(cx, ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(PerThreadData *pt, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(PerThreadDataFriendFields::get(pt), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Interface substitute for Rooted<T> which does not root the variable's memory. */\ntemplate <typename T>\nclass FakeRooted : public RootedBase<T>\n{\n  public:\n    template <typename CX>\n    FakeRooted(CX *cx\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename CX>\n    FakeRooted(CX *cx, T initial\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    FakeRooted(const FakeRooted &) MOZ_DELETE;\n};\n\n/* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */\ntemplate <typename T>\nclass FakeMutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    FakeMutableHandle(T *t) {\n        ptr = t;\n    }\n\n    FakeMutableHandle(FakeRooted<T> *root) {\n        ptr = root->address();\n    }\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    T *address() const { return ptr; }\n    T get() const { return *ptr; }\n\n    operator T() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    FakeMutableHandle() {}\n\n    T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\n/*\n * Types for a variable that either should or shouldn't be rooted, depending on\n * the template parameter Rooted. Used for implementing functions that can\n * operate on either rooted or unrooted data.\n *\n * The toHandle() and toMutableHandle() functions are for calling functions\n * which require handle types and are only called in the CanGC case. These\n * allow the calling code to type check.\n */\nenum AllowGC {\n    NoGC = 0,\n    CanGC = 1\n};\ntemplate <typename T, AllowGC allowGC>\nclass MaybeRooted\n{\n};\n\ntemplate <typename T> class MaybeRooted<T, CanGC>\n{\n  public:\n    typedef JS::Handle<T> HandleType;\n    typedef JS::Rooted<T> RootType;\n    typedef JS::MutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        return v;\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        return v;\n    }\n};\n\ntemplate <typename T> class MaybeRooted<T, NoGC>\n{\n  public:\n    typedef T HandleType;\n    typedef FakeRooted<T> RootType;\n    typedef FakeMutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n};\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(const Rooted<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(MutableHandle<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T>\ninline\nMutableHandle<T>::MutableHandle(Rooted<T> *root)\n{\n    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),\n                  \"MutableHandle must be binary compatible with T*.\");\n    ptr = root->address();\n}\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Hook for dynamic root analysis. Checks the native stack and poisons\n * references to GC things which have not been rooted.\n */\ninline void MaybeCheckStackRoots(JSContext *cx)\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    JS::CheckStackRoots(cx);\n#endif\n}\n\n/* Base class for automatic read-only object rooting during compilation. */\nclass CompilerRootNode\n{\n  protected:\n    CompilerRootNode(js::gc::Cell *ptr) : next(NULL), ptr_(ptr) {}\n\n  public:\n    void **address() { return (void **)&ptr_; }\n\n  public:\n    CompilerRootNode *next;\n\n  protected:\n    js::gc::Cell *ptr_;\n};\n\n}  /* namespace js */\n\n#endif  /* js_RootingAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/Utility.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Utility_h\n#define js_Utility_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/Scoped.h\"\n#include \"mozilla/TemplateLib.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef JS_OOM_DO_BACKTRACES\n#include <stdio.h>\n#include <execinfo.h>\n#endif\n\n#include \"jstypes.h\"\n\n/* The public JS engine namespace. */\nnamespace JS {}\n\n/* The mozilla-shared reusable template/utility namespace. */\nnamespace mozilla {}\n\n/* The private JS engine namespace. */\nnamespace js {}\n\n/*\n * Pattern used to overwrite freed memory. If you are accessing an object with\n * this pattern, you probably have a dangling pointer.\n */\n#define JS_FREE_PATTERN 0xDA\n\n#define JS_ASSERT(expr)           MOZ_ASSERT(expr)\n#define JS_ASSERT_IF(cond, expr)  MOZ_ASSERT_IF(cond, expr)\n#define JS_ALWAYS_TRUE(expr)      MOZ_ALWAYS_TRUE(expr)\n#define JS_ALWAYS_FALSE(expr)     MOZ_ALWAYS_FALSE(expr)\n\n#ifdef DEBUG\n# ifdef JS_THREADSAFE\n#  define JS_THREADSAFE_ASSERT(expr) JS_ASSERT(expr)\n# else\n#  define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n# endif\n#else\n# define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n#endif\n\n#if defined(DEBUG)\n# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)\n#elif defined(JS_CRASH_DIAGNOSTICS)\n# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)\n#else\n# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)\n#endif\n\n#define JS_STATIC_ASSERT(cond)           static_assert(cond, \"JS_STATIC_ASSERT\")\n#define JS_STATIC_ASSERT_IF(cond, expr)  MOZ_STATIC_ASSERT_IF(cond, expr, \"JS_STATIC_ASSERT_IF\")\n\nextern MOZ_NORETURN JS_PUBLIC_API(void)\nJS_Assert(const char *s, const char *file, int ln);\n\n/*\n * Abort the process in a non-graceful manner. This will cause a core file,\n * call to the debugger or other moral equivalent as well as causing the\n * entire process to stop.\n */\nextern JS_PUBLIC_API(void) JS_Abort(void);\n\n/*\n * Custom allocator support for SpiderMonkey\n */\n#if defined JS_USE_CUSTOM_ALLOCATOR\n# include \"jscustomallocator.h\"\n#else\n# ifdef DEBUG\n/*\n * In order to test OOM conditions, when the testing function\n * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th\n * allocation from now.\n */\nextern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtins/TestingFunctions.cpp */\nextern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */\n\n#ifdef JS_OOM_DO_BACKTRACES\n#define JS_OOM_BACKTRACE_SIZE 32\nstatic JS_ALWAYS_INLINE void\nPrintBacktrace()\n{\n    void* OOM_trace[JS_OOM_BACKTRACE_SIZE];\n    char** OOM_traceSymbols = NULL;\n    int32_t OOM_traceSize = 0;\n    int32_t OOM_traceIdx = 0;\n    OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE);\n    OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize);\n\n    if (!OOM_traceSymbols)\n        return;\n\n    for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) {\n        fprintf(stderr, \"#%d %s\\n\", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]);\n    }\n\n    free(OOM_traceSymbols);\n}\n\n#define JS_OOM_EMIT_BACKTRACE() \\\n    do {\\\n        fprintf(stderr, \"Forcing artificial memory allocation function failure:\\n\");\\\n\tPrintBacktrace();\\\n    } while (0)\n# else\n#  define JS_OOM_EMIT_BACKTRACE() do {} while(0)\n#endif /* JS_OOM_DO_BACKTRACES */\n\n#  define JS_OOM_POSSIBLY_FAIL() \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            js_ReportOutOfMemory(cx);\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n# else\n#  define JS_OOM_POSSIBLY_FAIL() do {} while(0)\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)\n# endif /* DEBUG */\n\nstatic JS_INLINE void* js_malloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return malloc(bytes);\n}\n\nstatic JS_INLINE void* js_calloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(bytes, 1);\n}\n\nstatic JS_INLINE void* js_calloc(size_t nmemb, size_t size)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(nmemb, size);\n}\n\nstatic JS_INLINE void* js_realloc(void* p, size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return realloc(p, bytes);\n}\n\nstatic JS_INLINE void js_free(void* p)\n{\n    free(p);\n}\n#endif/* JS_USE_CUSTOM_ALLOCATOR */\n\n/*\n * JS_ROTATE_LEFT32\n *\n * There is no rotate operation in the C Language so the construct (a << 4) |\n * (a >> 28) is used instead. Most compilers convert this to a rotate\n * instruction but some versions of MSVC don't without a little help.  To get\n * MSVC to generate a rotate instruction, we have to use the _rotl intrinsic\n * and use a pragma to make _rotl inline.\n *\n * MSVC in VS2005 will do an inline rotate instruction on the above construct.\n */\n#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \\\n    defined(_M_X64))\n#include <stdlib.h>\n#pragma intrinsic(_rotl)\n#define JS_ROTATE_LEFT32(a, bits) _rotl(a, bits)\n#else\n#define JS_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))\n#endif\n\n#include <new>\n\n/*\n * Low-level memory management in SpiderMonkey:\n *\n *  ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these\n *     to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's\n *     these symbols.\n *\n *  ** Do not use the builtin C++ operator new and delete: these throw on\n *     error and we cannot override them not to.\n *\n * Allocation:\n *\n * - If the lifetime of the allocation is tied to the lifetime of a GC-thing\n *   (that is, finalizing the GC-thing will free the allocation), call one of\n *   the following functions:\n *\n *     JSContext::{malloc_,realloc_,calloc_,new_}\n *     JSRuntime::{malloc_,realloc_,calloc_,new_}\n *\n *   These functions accumulate the number of bytes allocated which is used as\n *   part of the GC-triggering heuristic.\n *\n *   The difference between the JSContext and JSRuntime versions is that the\n *   cx version reports an out-of-memory error on OOM. (This follows from the\n *   general SpiderMonkey idiom that a JSContext-taking function reports its\n *   own errors.)\n *\n * - Otherwise, use js_malloc/js_realloc/js_calloc/js_free/js_new\n *\n * Deallocation:\n *\n * - Ordinarily, use js_free/js_delete.\n *\n * - For deallocations during GC finalization, use one of the following\n *   operations on the FreeOp provided to the finalizer:\n *\n *     FreeOp::{free_,delete_}\n *\n *   The advantage of these operations is that the memory is batched and freed\n *   on another thread.\n */\n\n#define JS_NEW_BODY(allocator, t, parms)                                       \\\n    void *memory = allocator(sizeof(t));                                       \\\n    return memory ? new(memory) t parms : NULL;\n\n/*\n * Given a class which should provide 'new' methods, add\n * JS_DECLARE_NEW_METHODS (see JSContext for a usage example). This\n * adds news with up to 12 parameters. Add more versions of new below if\n * you need more than 12 parameters.\n *\n * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,\n * or the build will break.\n */\n#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\\\n    template <class T>\\\n    QUALIFIERS T *NEWNAME() {\\\n        JS_NEW_BODY(ALLOCATOR, T, ())\\\n    }\\\n\\\n    template <class T, class P1>\\\n    QUALIFIERS T *NEWNAME(P1 p1) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1))\\\n    }\\\n\\\n    template <class T, class P1, class P2>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\\\n    }\\\n\nJS_DECLARE_NEW_METHODS(js_new, js_malloc, static JS_ALWAYS_INLINE)\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE void\njs_delete(T *p)\n{\n    if (p) {\n        p->~T();\n        js_free(p);\n    }\n}\n\ntemplate<class T>\nstatic JS_ALWAYS_INLINE void\njs_delete_poison(T *p)\n{\n    if (p) {\n        p->~T();\n        memset(p, 0x3B, sizeof(T));\n        js_free(p);\n    }\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc()\n{\n    return (T *)js_malloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc()\n{\n    return (T *)js_calloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_malloc(numElems * sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_calloc(numElems * sizeof(T));\n}\n\nnamespace js {\n\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return NULL; }\n    static void release(T* ptr) { js_free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits)\n\ntemplate <typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { js_delete(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits)\n\ntemplate <typename T>\nstruct ScopedReleasePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { if (ptr) ptr->release(); }\n};\nSCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits)\n\n} /* namespace js */\n\nnamespace js {\n\n/* Integral types for all hash functions. */\ntypedef uint32_t HashNumber;\nconst unsigned HashNumberSizeBits = 32;\n\nnamespace detail {\n\n/*\n * Given a raw hash code, h, return a number that can be used to select a hash\n * bucket.\n *\n * This function aims to produce as uniform an output distribution as possible,\n * especially in the most significant (leftmost) bits, even though the input\n * distribution may be highly nonrandom, given the constraints that this must\n * be deterministic and quick to compute.\n *\n * Since the leftmost bits of the result are best, the hash bucket index is\n * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent\n * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask.\n *\n * FIXME: OrderedHashTable uses a bit-mask; see bug 775896.\n */\ninline HashNumber\nScrambleHashCode(HashNumber h)\n{\n    /*\n     * Simply returning h would not cause any hash tables to produce wrong\n     * answers. But it can produce pathologically bad performance: The caller\n     * right-shifts the result, keeping only the highest bits. The high bits of\n     * hash codes are very often completely entropy-free. (So are the lowest\n     * bits.)\n     *\n     * So we use Fibonacci hashing, as described in Knuth, The Art of Computer\n     * Programming, 6.4. This mixes all the bits of the input hash code h.\n     * \n     * The value of goldenRatio is taken from the hex\n     * expansion of the golden ratio, which starts 1.9E3779B9....\n     * This value is especially good if values with consecutive hash codes\n     * are stored in a hash table; see Knuth for details.\n     */\n    static const HashNumber goldenRatio = 0x9E3779B9U;\n    return h * goldenRatio;\n}\n\n} /* namespace detail */\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Methods for poisoning GC heap pointer words and checking for poisoned words.\n * These are in this file for use in Value methods and so forth.\n *\n * If the moving GC hazard analysis is in use and detects a non-rooted stack\n * pointer to a GC thing, one byte of that pointer is poisoned to refer to an\n * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the\n * pointer is overwritten, to reduce the likelihood of accidentally changing\n * a live integer value.\n */\n\ninline void PoisonPtr(void *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint8_t *ptr = (uint8_t *) v + 3;\n    *ptr = JS_FREE_PATTERN;\n#endif\n}\n\ntemplate <typename T>\ninline bool IsPoisonedPtr(T *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint32_t mask = uintptr_t(v) & 0xff000000;\n    return mask == uint32_t(JS_FREE_PATTERN << 24);\n#else\n    return false;\n#endif\n}\n\n}\n\n/* sixgill annotation defines */\n#ifndef HAVE_STATIC_ANNOTATIONS\n# define HAVE_STATIC_ANNOTATIONS\n# ifdef XGILL_PLUGIN\n#  define STATIC_PRECONDITION(COND)         __attribute__((precondition(#COND)))\n#  define STATIC_PRECONDITION_ASSUME(COND)  __attribute__((precondition_assume(#COND)))\n#  define STATIC_POSTCONDITION(COND)        __attribute__((postcondition(#COND)))\n#  define STATIC_POSTCONDITION_ASSUME(COND) __attribute__((postcondition_assume(#COND)))\n#  define STATIC_INVARIANT(COND)            __attribute__((invariant(#COND)))\n#  define STATIC_INVARIANT_ASSUME(COND)     __attribute__((invariant_assume(#COND)))\n#  define STATIC_PASTE2(X,Y) X ## Y\n#  define STATIC_PASTE1(X,Y) STATIC_PASTE2(X,Y)\n#  define STATIC_ASSERT(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assert_static(#COND), unused))    \\\n    int STATIC_PASTE1(assert_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSUME(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assume_static(#COND), unused))    \\\n    int STATIC_PASTE1(assume_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)                       \\\n  JS_BEGIN_MACRO                                            \\\n    __attribute__((assert_static_runtime(#COND), unused))   \\\n    int STATIC_PASTE1(assert_static_runtime_, __COUNTER__); \\\n  JS_END_MACRO\n# else /* XGILL_PLUGIN */\n#  define STATIC_PRECONDITION(COND)          /* nothing */\n#  define STATIC_PRECONDITION_ASSUME(COND)   /* nothing */\n#  define STATIC_POSTCONDITION(COND)         /* nothing */\n#  define STATIC_POSTCONDITION_ASSUME(COND)  /* nothing */\n#  define STATIC_INVARIANT(COND)             /* nothing */\n#  define STATIC_INVARIANT_ASSUME(COND)      /* nothing */\n#  define STATIC_ASSERT(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSUME(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)  JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n# endif /* XGILL_PLUGIN */\n# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())\n#endif /* HAVE_STATIC_ANNOTATIONS */\n\n#endif /* js_Utility_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/Value.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Value implementation. */\n\n#ifndef js_Value_h\n#define js_Value_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/Likely.h\"\n\n#include <limits> /* for std::numeric_limits */\n\n#include \"js/Anchor.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n\nnamespace JS { class Value; }\n\n/* JS::Value can store a full int32_t. */\n#define JSVAL_INT_BITS          32\n#define JSVAL_INT_MIN           ((int32_t)0x80000000)\n#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)\n\n/*\n * Try to get jsvals 64-bit aligned. We could almost assert that all values are\n * aligned, but MSVC and GCC occasionally break alignment.\n */\n#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__)\n# define JSVAL_ALIGNMENT        __attribute__((aligned (8)))\n#elif defined(_MSC_VER)\n  /*\n   * Structs can be aligned with MSVC, but not if they are used as parameters,\n   * so we just don't try to align.\n   */\n# define JSVAL_ALIGNMENT\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n# define JSVAL_ALIGNMENT\n#elif defined(__HP_cc) || defined(__HP_aCC)\n# define JSVAL_ALIGNMENT\n#endif\n\n#if JS_BITS_PER_WORD == 64\n# define JSVAL_TAG_SHIFT 47\n#endif\n\n/*\n * We try to use enums so that printing a jsval_layout in the debugger shows\n * nice symbolic type tags, however we can only do this when we can force the\n * underlying type of the enum to be the desired size.\n */\n#if !defined(__SUNPRO_CC) && !defined(__xlC__)\n\n#if defined(_MSC_VER)\n# define JS_ENUM_HEADER(id, type)              enum id : type\n# define JS_ENUM_FOOTER(id)\n#else\n# define JS_ENUM_HEADER(id, type)              enum id\n# define JS_ENUM_FOOTER(id)                    __attribute__((packed))\n#endif\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueType, uint8_t)\n{\n    JSVAL_TYPE_DOUBLE              = 0x00,\n    JSVAL_TYPE_INT32               = 0x01,\n    JSVAL_TYPE_UNDEFINED           = 0x02,\n    JSVAL_TYPE_BOOLEAN             = 0x03,\n    JSVAL_TYPE_MAGIC               = 0x04,\n    JSVAL_TYPE_STRING              = 0x05,\n    JSVAL_TYPE_NULL                = 0x06,\n    JSVAL_TYPE_OBJECT              = 0x07,\n\n    /* These never appear in a jsval; they are only provided as an out-of-band value. */\n    JSVAL_TYPE_UNKNOWN             = 0x20,\n    JSVAL_TYPE_MISSING             = 0x21\n} JS_ENUM_FOOTER(JSValueType);\n\nJS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n\n#if JS_BITS_PER_WORD == 32\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_CLEAR                = 0xFFFFFF80,\n    JSVAL_TAG_INT32                = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n\n#elif JS_BITS_PER_WORD == 64\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_MAX_DOUBLE           = 0x1FFF0,\n    JSVAL_TAG_INT32                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32_t));\n\nJS_ENUM_HEADER(JSValueShiftedTag, uint64_t)\n{\n    JSVAL_SHIFTED_TAG_MAX_DOUBLE   = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),\n    JSVAL_SHIFTED_TAG_INT32        = (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_UNDEFINED    = (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_STRING       = (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_BOOLEAN      = (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_MAGIC        = (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_NULL         = (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_OBJECT       = (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n} JS_ENUM_FOOTER(JSValueShiftedTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t));\n\n#endif\n\n#else  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\ntypedef uint8_t JSValueType;\n#define JSVAL_TYPE_DOUBLE            ((uint8_t)0x00)\n#define JSVAL_TYPE_INT32             ((uint8_t)0x01)\n#define JSVAL_TYPE_UNDEFINED         ((uint8_t)0x02)\n#define JSVAL_TYPE_BOOLEAN           ((uint8_t)0x03)\n#define JSVAL_TYPE_MAGIC             ((uint8_t)0x04)\n#define JSVAL_TYPE_STRING            ((uint8_t)0x05)\n#define JSVAL_TYPE_NULL              ((uint8_t)0x06)\n#define JSVAL_TYPE_OBJECT            ((uint8_t)0x07)\n#define JSVAL_TYPE_UNKNOWN           ((uint8_t)0x20)\n\n#if JS_BITS_PER_WORD == 32\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_CLEAR              ((uint32_t)(0xFFFFFF80))\n#define JSVAL_TAG_INT32              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32))\n#define JSVAL_TAG_UNDEFINED          ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED))\n#define JSVAL_TAG_STRING             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING))\n#define JSVAL_TAG_BOOLEAN            ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN))\n#define JSVAL_TAG_MAGIC              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC))\n#define JSVAL_TAG_NULL               ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL))\n#define JSVAL_TAG_OBJECT             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT))\n\n#elif JS_BITS_PER_WORD == 64\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_MAX_DOUBLE         ((uint32_t)(0x1FFF0))\n#define JSVAL_TAG_INT32              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32)\n#define JSVAL_TAG_UNDEFINED          (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED)\n#define JSVAL_TAG_STRING             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING)\n#define JSVAL_TAG_BOOLEAN            (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN)\n#define JSVAL_TAG_MAGIC              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC)\n#define JSVAL_TAG_NULL               (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL)\n#define JSVAL_TAG_OBJECT             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT)\n\ntypedef uint64_t JSValueShiftedTag;\n#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF)\n#define JSVAL_SHIFTED_TAG_INT32      (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_UNDEFINED  (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_STRING     (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_BOOLEAN    (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_MAGIC      (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_NULL       (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_OBJECT     (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n\n#endif  /* JS_BITS_PER_WORD */\n#endif  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\n#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET        JSVAL_TYPE_NULL\n#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET          JSVAL_TYPE_OBJECT\n#define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET             JSVAL_TYPE_INT32\n#define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET        JSVAL_TYPE_MAGIC\n\n#if JS_BITS_PER_WORD == 32\n\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_CLEAR | (type)))\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#elif JS_BITS_PER_WORD == 64\n\n#define JSVAL_PAYLOAD_MASK           0x00007FFFFFFFFFFFLL\n#define JSVAL_TAG_MASK               0xFFFF800000000000LL\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))\n#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET  JSVAL_SHIFTED_TAG_NULL\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET    JSVAL_SHIFTED_TAG_OBJECT\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET       JSVAL_SHIFTED_TAG_UNDEFINED\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET      JSVAL_SHIFTED_TAG_STRING\n\n#endif /* JS_BITS_PER_WORD */\n\ntypedef enum JSWhyMagic\n{\n    JS_ELEMENTS_HOLE,            /* a hole in a native object's elements */\n    JS_NATIVE_ENUMERATE,         /* indicates that a custom enumerate hook forwarded\n                                  * to JS_EnumerateState, which really means the object can be\n                                  * enumerated like a native object. */\n    JS_NO_ITER_VALUE,            /* there is not a pending iterator value */\n    JS_GENERATOR_CLOSING,        /* exception value thrown when closing a generator */\n    JS_NO_CONSTANT,              /* compiler sentinel value */\n    JS_THIS_POISON,              /* used in debug builds to catch tracing errors */\n    JS_ARG_POISON,               /* used in debug builds to catch tracing errors */\n    JS_SERIALIZE_NO_NODE,        /* an empty subnode in the AST serializer */\n    JS_LAZY_ARGUMENTS,           /* lazy arguments value on the stack */\n    JS_OPTIMIZED_ARGUMENTS,      /* optimized-away 'arguments' value */\n    JS_IS_CONSTRUCTING,          /* magic value passed to natives to indicate construction */\n    JS_OVERWRITTEN_CALLEE,       /* arguments.callee has been overwritten */\n    JS_FORWARD_TO_CALL_OBJECT,   /* args object element stored in call object */\n    JS_BLOCK_NEEDS_CLONE,        /* value of static block object slot */\n    JS_HASH_KEY_EMPTY,           /* see class js::HashableValue */\n    JS_ION_ERROR,                /* error while running Ion code */\n    JS_ION_BAILOUT,              /* status code to signal EnterIon will OSR into Interpret */\n    JS_GENERIC_MAGIC             /* for local use */\n} JSWhyMagic;\n\n#if defined(IS_LITTLE_ENDIAN)\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n        JSValueTag tag;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n#if !defined(_WIN64)\n    /* MSVC does not pack these correctly :-( */\n    struct {\n        uint64_t           payload47 : 47;\n        JSValueTag         tag : 17;\n    } debugView;\n#endif\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif  /* JS_BITS_PER_WORD */\n#else   /* defined(IS_LITTLE_ENDIAN) */\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag tag;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag         tag : 17;\n        uint64_t           payload47 : 47;\n    } debugView;\n    struct {\n        uint32_t           padding;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif /* JS_BITS_PER_WORD */\n#endif  /* defined(IS_LITTLE_ENDIAN) */\n\nJS_STATIC_ASSERT(sizeof(jsval_layout) == 8);\n\n#if JS_BITS_PER_WORD == 32\n\n/*\n * N.B. GCC, in some but not all cases, chooses to emit signed comparison of\n * JSValueTag even though its underlying type has been forced to be uint32_t.\n * Thus, all comparisons should explicitly cast operands to uint32_t.\n */\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint32_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return l.s.payload.i32;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_INT32;\n    l.s.payload.i32 = i;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    JSValueTag tag = l.s.tag;\n    MOZ_ASSERT(tag != JSVAL_TAG_CLEAR);\n    return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    MOZ_ASSERT(str);\n    l.s.tag = JSVAL_TAG_STRING;\n    l.s.payload.str = str;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return l.s.payload.str;\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.payload.boo;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.s.tag = JSVAL_TAG_BOOLEAN;\n    l.s.payload.boo = b;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT);\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.payload.obj;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    MOZ_ASSERT(obj);\n    l.s.tag = JSVAL_TAG_OBJECT;\n    l.s.payload.obj = obj;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_NULL;\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    MOZ_ASSERT(((uint32_t)ptr & 1) == 0);\n    l.s.tag = (JSValueTag)0;\n    l.s.payload.ptr = ptr;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    /* gcc sometimes generates signed < without explicit casts. */\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_MAGIC;\n    l.s.payload.why = why;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag;\n    return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n    uint32_t type = l.s.tag & 0xF;\n    MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n    return (JSValueType)type;\n}\n\n#elif JS_BITS_PER_WORD == 64\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint64_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE);\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return (int32_t)l.asBits;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i32)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    uint64_t strBits = (uint64_t)str;\n    MOZ_ASSERT(str);\n    MOZ_ASSERT((strBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = strBits | JSVAL_SHIFTED_TAG_STRING;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK);\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (JSBool)l.asBits;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT);\n    return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT);\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (JSObject *)ptrBits;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    uint64_t objBits = (uint64_t)obj;\n    MOZ_ASSERT(obj);\n    MOZ_ASSERT((objBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = objBits | JSVAL_SHIFTED_TAG_OBJECT;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_NULL;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (void *)ptrBits;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l);\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l));\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    uint64_t ptrBits = (uint64_t)ptr;\n    MOZ_ASSERT((ptrBits & 1) == 0);\n    l.asBits = ptrBits >> 1;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0);\n    return (void *)(l.asBits << 1);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)why) | JSVAL_SHIFTED_TAG_MAGIC;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    uint64_t lbits = lhs.asBits, rbits = rhs.asBits;\n    return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) ||\n           (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n   uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF;\n   MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n   return (JSValueType)type;\n}\n\n#endif  /* JS_BITS_PER_WORD */\n\nstatic inline jsval_layout JSVAL_TO_IMPL(JS::Value v);\nstatic inline JS::Value IMPL_TO_JSVAL(jsval_layout l);\n\nnamespace JS {\n\n/**\n * Returns a generic quiet NaN value, with all payload bits set to zero.\n *\n * Among other properties, this NaN's bit pattern conforms to JS::Value's\n * bit pattern restrictions.\n */\nstatic MOZ_ALWAYS_INLINE double\nGenericNaN()\n{\n    return mozilla::SpecificNaN(0, 0x8000000000000ULL);\n}\n\nstatic inline double\nCanonicalizeNaN(double d)\n{\n    if (MOZ_UNLIKELY(mozilla::IsNaN(d)))\n        return GenericNaN();\n    return d;\n}\n\n/*\n * JS::Value is the interface for a single JavaScript Engine value.  A few\n * general notes on JS::Value:\n *\n * - JS::Value has setX() and isX() members for X in\n *\n *     { Int32, Double, String, Boolean, Undefined, Null, Object, Magic }\n *\n *   JS::Value also contains toX() for each of the non-singleton types.\n *\n * - Magic is a singleton type whose payload contains a JSWhyMagic \"reason\" for\n *   the magic value. By providing JSWhyMagic values when creating and checking\n *   for magic values, it is possible to assert, at runtime, that only magic\n *   values with the expected reason flow through a particular value. For\n *   example, if cx->exception has a magic value, the reason must be\n *   JS_GENERATOR_CLOSING.\n *\n * - The JS::Value operations are preferred.  The JSVAL_* operations remain for\n *   compatibility; they may be removed at some point.  These operations mostly\n *   provide similar functionality.  But there are a few key differences.  One\n *   is that JS::Value gives null a separate type. Thus\n *\n *           JSVAL_IS_OBJECT(v) === v.isObjectOrNull()\n *       !JSVAL_IS_PRIMITIVE(v) === v.isObject()\n *\n *   Also, to help prevent mistakenly boxing a nullable JSObject* as an object,\n *   Value::setObject takes a JSObject&. (Conversely, Value::asObject returns a\n *   JSObject&.)  A convenience member Value::setObjectOrNull is provided.\n *\n * - JSVAL_VOID is the same as the singleton value of the Undefined type.\n *\n * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on\n *   32-bit user code should avoid copying jsval/JS::Value as much as possible,\n *   preferring to pass by const Value &.\n */\nclass Value\n{\n  public:\n    /*\n     * N.B. the default constructor leaves Value unitialized. Adding a default\n     * constructor prevents Value from being stored in a union.\n     */\n\n    /*** Mutators ***/\n\n    void setNull() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;\n    }\n\n    void setUndefined() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;\n    }\n\n    void setInt32(int32_t i) {\n        data = INT32_TO_JSVAL_IMPL(i);\n    }\n\n    int32_t &getInt32Ref() {\n        MOZ_ASSERT(isInt32());\n        return data.s.payload.i32;\n    }\n\n    void setDouble(double d) {\n        data = DOUBLE_TO_JSVAL_IMPL(d);\n    }\n\n    double &getDoubleRef() {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    void setString(JSString *str) {\n        MOZ_ASSERT(!IsPoisonedPtr(str));\n        data = STRING_TO_JSVAL_IMPL(str);\n    }\n\n    void setString(const JS::Anchor<JSString *> &str) {\n        setString(str.get());\n    }\n\n    void setObject(JSObject &obj) {\n        MOZ_ASSERT(!IsPoisonedPtr(&obj));\n        data = OBJECT_TO_JSVAL_IMPL(&obj);\n    }\n\n    void setBoolean(bool b) {\n        data = BOOLEAN_TO_JSVAL_IMPL(b);\n    }\n\n    void setMagic(JSWhyMagic why) {\n        data = MAGIC_TO_JSVAL_IMPL(why);\n    }\n\n    bool setNumber(uint32_t ui) {\n        if (ui > JSVAL_INT_MAX) {\n            setDouble((double)ui);\n            return false;\n        } else {\n            setInt32((int32_t)ui);\n            return true;\n        }\n    }\n\n    bool setNumber(double d) {\n        int32_t i;\n        if (mozilla::DoubleIsInt32(d, &i)) {\n            setInt32(i);\n            return true;\n        }\n\n        setDouble(d);\n        return false;\n    }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n\n    void swap(Value &rhs) {\n        uint64_t tmp = rhs.data.asBits;\n        rhs.data.asBits = data.asBits;\n        data.asBits = tmp;\n    }\n\n    /*** Value type queries ***/\n\n    bool isUndefined() const {\n        return JSVAL_IS_UNDEFINED_IMPL(data);\n    }\n\n    bool isNull() const {\n        return JSVAL_IS_NULL_IMPL(data);\n    }\n\n    bool isNullOrUndefined() const {\n        return isNull() || isUndefined();\n    }\n\n    bool isInt32() const {\n        return JSVAL_IS_INT32_IMPL(data);\n    }\n\n    bool isInt32(int32_t i32) const {\n        return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);\n    }\n\n    bool isDouble() const {\n        return JSVAL_IS_DOUBLE_IMPL(data);\n    }\n\n    bool isNumber() const {\n        return JSVAL_IS_NUMBER_IMPL(data);\n    }\n\n    bool isString() const {\n        return JSVAL_IS_STRING_IMPL(data);\n    }\n\n    bool isObject() const {\n        return JSVAL_IS_OBJECT_IMPL(data);\n    }\n\n    bool isPrimitive() const {\n        return JSVAL_IS_PRIMITIVE_IMPL(data);\n    }\n\n    bool isObjectOrNull() const {\n        return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);\n    }\n\n    bool isGCThing() const {\n        return JSVAL_IS_GCTHING_IMPL(data);\n    }\n\n    bool isBoolean() const {\n        return JSVAL_IS_BOOLEAN_IMPL(data);\n    }\n\n    bool isTrue() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, true);\n    }\n\n    bool isFalse() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, false);\n    }\n\n    bool isMagic() const {\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMagic(JSWhyMagic why) const {\n        MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMarkable() const {\n        return JSVAL_IS_TRACEABLE_IMPL(data);\n    }\n\n    JSGCTraceKind gcKind() const {\n        MOZ_ASSERT(isMarkable());\n        return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));\n    }\n\n    JSWhyMagic whyMagic() const {\n        MOZ_ASSERT(isMagic());\n        return data.s.payload.why;\n    }\n\n    /*** Comparison ***/\n\n    bool operator==(const Value &rhs) const {\n        return data.asBits == rhs.data.asBits;\n    }\n\n    bool operator!=(const Value &rhs) const {\n        return data.asBits != rhs.data.asBits;\n    }\n\n    friend inline bool SameType(const Value &lhs, const Value &rhs);\n\n    /*** Extract the value's typed payload ***/\n\n    int32_t toInt32() const {\n        MOZ_ASSERT(isInt32());\n        return JSVAL_TO_INT32_IMPL(data);\n    }\n\n    double toDouble() const {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    double toNumber() const {\n        MOZ_ASSERT(isNumber());\n        return isDouble() ? toDouble() : double(toInt32());\n    }\n\n    JSString *toString() const {\n        MOZ_ASSERT(isString());\n        return JSVAL_TO_STRING_IMPL(data);\n    }\n\n    JSObject &toObject() const {\n        MOZ_ASSERT(isObject());\n        return *JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    JSObject *toObjectOrNull() const {\n        MOZ_ASSERT(isObjectOrNull());\n        return JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    void *toGCThing() const {\n        MOZ_ASSERT(isGCThing());\n        return JSVAL_TO_GCTHING_IMPL(data);\n    }\n\n    bool toBoolean() const {\n        MOZ_ASSERT(isBoolean());\n        return JSVAL_TO_BOOLEAN_IMPL(data);\n    }\n\n    uint32_t payloadAsRawUint32() const {\n        MOZ_ASSERT(!isDouble());\n        return data.s.payload.u32;\n    }\n\n    uint64_t asRawBits() const {\n        return data.asBits;\n    }\n\n    JSValueType extractNonDoubleType() const {\n        return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data);\n    }\n\n    /*\n     * Private API\n     *\n     * Private setters/getters allow the caller to read/write arbitrary types\n     * that fit in the 64-bit payload. It is the caller's responsibility, after\n     * storing to a value with setPrivateX to read only using getPrivateX.\n     * Privates values are given a type which ensures they are not marked.\n     */\n\n    void setPrivate(void *ptr) {\n        data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);\n    }\n\n    void *toPrivate() const {\n        MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));\n        return JSVAL_TO_PRIVATE_PTR_IMPL(data);\n    }\n\n    void setPrivateUint32(uint32_t ui) {\n        MOZ_ASSERT(uint32_t(int32_t(ui)) == ui);\n        setInt32(int32_t(ui));\n    }\n\n    uint32_t toPrivateUint32() const {\n        return uint32_t(toInt32());\n    }\n\n    /*\n     * An unmarked value is just a void* cast as a Value. Thus, the Value is\n     * not safe for GC and must not be marked. This API avoids raw casts\n     * and the ensuing strict-aliasing warnings.\n     */\n\n    void setUnmarkedPtr(void *ptr) {\n        data.asPtr = ptr;\n    }\n\n    void *toUnmarkedPtr() const {\n        return data.asPtr;\n    }\n\n    const size_t *payloadWord() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.word;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asWord;\n#endif\n    }\n\n    const uintptr_t *payloadUIntPtr() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.uintptr;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asUIntPtr;\n#endif\n    }\n\n#if !defined(_MSC_VER) && !defined(__sparc)\n  // Value must be POD so that MSVC will pass it by value and not in memory\n  // (bug 689101); the same is true for SPARC as well (bug 737344).  More\n  // precisely, we don't want Value return values compiled as out params.\n  private:\n#endif\n\n    jsval_layout data;\n\n  private:\n    void staticAssertions() {\n        JS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n        JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n        JS_STATIC_ASSERT(sizeof(JSBool) == 4);\n        JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4);\n        JS_STATIC_ASSERT(sizeof(Value) == 8);\n    }\n\n    friend jsval_layout (::JSVAL_TO_IMPL)(Value);\n    friend Value (::IMPL_TO_JSVAL)(jsval_layout l);\n};\n\ninline bool\nIsPoisonedValue(const Value &v)\n{\n    if (v.isString())\n        return IsPoisonedPtr(v.toString());\n    if (v.isObject())\n        return IsPoisonedPtr(&v.toObject());\n    return false;\n}\n\n/************************************************************************/\n\nstatic inline Value\nNullValue()\n{\n    Value v;\n    v.setNull();\n    return v;\n}\n\nstatic inline Value\nUndefinedValue()\n{\n    Value v;\n    v.setUndefined();\n    return v;\n}\n\nstatic inline Value\nInt32Value(int32_t i32)\n{\n    Value v;\n    v.setInt32(i32);\n    return v;\n}\n\nstatic inline Value\nDoubleValue(double dbl)\n{\n    Value v;\n    v.setDouble(dbl);\n    return v;\n}\n\nstatic inline Value\nStringValue(JSString *str)\n{\n    Value v;\n    v.setString(str);\n    return v;\n}\n\nstatic inline Value\nBooleanValue(bool boo)\n{\n    Value v;\n    v.setBoolean(boo);\n    return v;\n}\n\nstatic inline Value\nObjectValue(JSObject &obj)\n{\n    Value v;\n    v.setObject(obj);\n    return v;\n}\n\nstatic inline Value\nObjectValueCrashOnTouch()\n{\n    Value v;\n    v.setObject(*reinterpret_cast<JSObject *>(0x42));\n    return v;\n}\n\nstatic inline Value\nMagicValue(JSWhyMagic why)\n{\n    Value v;\n    v.setMagic(why);\n    return v;\n}\n\nstatic inline Value\nNumberValue(float f)\n{\n    Value v;\n    v.setNumber(f);\n    return v;\n}\n\nstatic inline Value\nNumberValue(double dbl)\n{\n    Value v;\n    v.setNumber(dbl);\n    return v;\n}\n\nstatic inline Value\nNumberValue(int8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int32_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint32_t i)\n{\n    Value v;\n    v.setNumber(i);\n    return v;\n}\n\nnamespace detail {\n\ntemplate <bool Signed>\nclass MakeNumberValue\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (JSVAL_INT_MIN <= t && t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\ntemplate <>\nclass MakeNumberValue<false>\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\n} // namespace detail\n\ntemplate <typename T>\nstatic inline Value\nNumberValue(const T t)\n{\n    MOZ_ASSERT(T(double(t)) == t, \"value creation would be lossy\");\n    return detail::MakeNumberValue<std::numeric_limits<T>::is_signed>::create(t);\n}\n\nstatic inline Value\nObjectOrNullValue(JSObject *obj)\n{\n    Value v;\n    v.setObjectOrNull(obj);\n    return v;\n}\n\nstatic inline Value\nPrivateValue(void *ptr)\n{\n    Value v;\n    v.setPrivate(ptr);\n    return v;\n}\n\nstatic inline Value\nPrivateUint32Value(uint32_t ui)\n{\n    Value v;\n    v.setPrivateUint32(ui);\n    return v;\n}\n\ninline bool\nSameType(const Value &lhs, const Value &rhs)\n{\n    return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);\n}\n\n} // namespace JS\n\n/************************************************************************/\n\n#ifdef JSGC_GENERATIONAL\nnamespace JS {\nJS_PUBLIC_API(void) HeapValuePostBarrier(Value *valuep);\nJS_PUBLIC_API(void) HeapValueRelocate(Value *valuep);\n}\n#endif\n\nnamespace js {\n\ntemplate <> struct GCMethods<const JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n};\n\ntemplate <> struct GCMethods<JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n    static bool needsPostBarrier(const JS::Value &v) { return v.isMarkable(); }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }\n    static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }\n#endif\n};\n\ntemplate <class Outer> class UnbarrieredMutableValueOperations;\ntemplate <class Outer> class MutableValueOperations;\n\n/*\n * A class designed for CRTP use in implementing the non-mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * ValueOperations<Outer> with a visible extract() method returning the\n * const Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass ValueOperations\n{\n    friend class UnbarrieredMutableValueOperations<Outer>;\n    friend class MutableValueOperations<Outer>;\n\n    const JS::Value * value() const { return static_cast<const Outer*>(this)->extract(); }\n\n  public:\n    bool isUndefined() const { return value()->isUndefined(); }\n    bool isNull() const { return value()->isNull(); }\n    bool isBoolean() const { return value()->isBoolean(); }\n    bool isTrue() const { return value()->isTrue(); }\n    bool isFalse() const { return value()->isFalse(); }\n    bool isNumber() const { return value()->isNumber(); }\n    bool isInt32() const { return value()->isInt32(); }\n    bool isDouble() const { return value()->isDouble(); }\n    bool isString() const { return value()->isString(); }\n    bool isObject() const { return value()->isObject(); }\n    bool isMagic() const { return value()->isMagic(); }\n    bool isMagic(JSWhyMagic why) const { return value()->isMagic(why); }\n    bool isMarkable() const { return value()->isMarkable(); }\n    bool isPrimitive() const { return value()->isPrimitive(); }\n    bool isGCThing() const { return value()->isGCThing(); }\n\n    bool isNullOrUndefined() const { return value()->isNullOrUndefined(); }\n    bool isObjectOrNull() const { return value()->isObjectOrNull(); }\n\n    bool toBoolean() const { return value()->toBoolean(); }\n    double toNumber() const { return value()->toNumber(); }\n    int32_t toInt32() const { return value()->toInt32(); }\n    double toDouble() const { return value()->toDouble(); }\n    JSString *toString() const { return value()->toString(); }\n    JSObject &toObject() const { return value()->toObject(); }\n    JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); }\n    void *toGCThing() const { return value()->toGCThing(); }\n\n    JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); }\n    uint32_t toPrivateUint32() const { return value()->toPrivateUint32(); }\n\n    JSWhyMagic whyMagic() const { return value()->whyMagic(); }\n};\n\n/*\n * A class designed for CRTP use in implementing the mutating parts of the Value\n * interface in Value-like classes that don't need post barriers.  Outer must be\n * a class inheriting UnbarrieredMutableValueOperations<Outer> with visible\n * extractMutable() and extract() methods returning the const Value* and Value*\n * abstracted by Outer.\n */\ntemplate <class Outer>\nclass UnbarrieredMutableValueOperations : public ValueOperations<Outer>\n{\n    friend class MutableValueOperations<Outer>;\n    JS::Value * value() { return static_cast<Outer*>(this)->extractMutable(); }\n\n  public:\n    void setNull() { value()->setNull(); }\n    void setUndefined() { value()->setUndefined(); }\n    void setInt32(int32_t i) { value()->setInt32(i); }\n    void setDouble(double d) { value()->setDouble(d); }\n    void setBoolean(bool b) { value()->setBoolean(b); }\n    void setMagic(JSWhyMagic why) { value()->setMagic(why); }\n    bool setNumber(uint32_t ui) { return value()->setNumber(ui); }\n    bool setNumber(double d) { return value()->setNumber(d); }\n};\n\n/*\n * A class designed for CRTP use in implementing all the mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * MutableValueOperations<Outer> with visible extractMutable() and extract()\n * methods returning the const Value* and Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass MutableValueOperations : public UnbarrieredMutableValueOperations<Outer>\n{\n  public:\n    void setString(JSString *str) { this->value()->setString(str); }\n    void setString(const JS::Anchor<JSString *> &str) { this->value()->setString(str); }\n    void setObject(JSObject &obj) { this->value()->setObject(obj); }\n    void setObjectOrNull(JSObject *arg) { this->value()->setObjectOrNull(arg); }\n};\n\n/*\n * Augment the generic Heap<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass HeapBase<JS::Value> : public UnbarrieredMutableValueOperations<JS::Heap<JS::Value> >\n{\n    typedef JS::Heap<JS::Value> Outer;\n\n    friend class ValueOperations<Outer>;\n    friend class UnbarrieredMutableValueOperations<Outer>;\n\n    const JS::Value * extract() const { return static_cast<const Outer*>(this)->address(); }\n    JS::Value * extractMutable() { return static_cast<Outer*>(this)->unsafeGet(); }\n\n    /*\n     * Setters that potentially change the value to a GC thing from a non-GC\n     * thing must call JS::Heap::set() to trigger the post barrier.\n     *\n     * Changing from a GC thing to a non-GC thing value will leave the heap\n     * value in the store buffer, but it will be ingored so this is not a\n     * problem.\n     */\n    void setBarriered(const JS::Value &v) {\n        static_cast<JS::Heap<JS::Value> *>(this)->set(v);\n    }\n\n  public:\n    void setString(JSString *str) { setBarriered(JS::StringValue(str)); }\n    void setString(const JS::Anchor<JSString *> &str) { setBarriered(JS::StringValue(str.get())); }\n    void setObject(JSObject &obj) { setBarriered(JS::ObjectValue(obj)); }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n};\n\n/*\n * Augment the generic Handle<T> interface when T = Value with type-querying\n * and value-extracting operations.\n */\ntemplate <>\nclass HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> >\n{\n    friend class ValueOperations<JS::Handle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Handle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic MutableHandle<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass MutableHandleBase<JS::Value> : public MutableValueOperations<JS::MutableHandle<JS::Value> >\n{\n    friend class ValueOperations<JS::MutableHandle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::MutableHandle<JS::Value> >;\n    friend class MutableValueOperations<JS::MutableHandle<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic Rooted<T> interface when T = Value with type-querying,\n * value-extracting, and mutating operations.\n */\ntemplate <>\nclass RootedBase<JS::Value> : public MutableValueOperations<JS::Rooted<JS::Value> >\n{\n    friend class ValueOperations<JS::Rooted<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Rooted<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::Rooted<JS::Value> >;\n    friend class MutableValueOperations<JS::Rooted<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::Rooted<JS::Value>*>(this)->address();\n    }\n};\n\n} // namespace js\n\ninline jsval_layout\nJSVAL_TO_IMPL(JS::Value v)\n{\n    return v.data;\n}\n\ninline JS::Value\nIMPL_TO_JSVAL(jsval_layout l)\n{\n    JS::Value v;\n    v.data = l;\n    return v;\n}\n\nnamespace JS {\n\n#ifndef __GNUC__\n/*\n * The default assignment operator for |struct C| has the signature:\n *\n *   C& C::operator=(const C&)\n *\n * And in particular requires implicit conversion of |this| to type |C| for the\n * return value. But |volatile C| cannot thus be converted to |C|, so just\n * doing |sink = hold| as in the non-specialized version would fail to compile.\n * Do the assignment on asBits instead, since I don't think we want to give\n * jsval_layout an assignment operator returning |volatile jsval_layout|.\n */\ntemplate<>\ninline Anchor<Value>::~Anchor()\n{\n    volatile uint64_t bits;\n    bits = JSVAL_TO_IMPL(hold).asBits;\n}\n#endif\n\n#ifdef DEBUG\nnamespace detail {\n\nstruct ValueAlignmentTester { char c; JS::Value v; };\nstatic_assert(sizeof(ValueAlignmentTester) == 16,\n              \"JS::Value must be 16-byte-aligned\");\n\nstruct LayoutAlignmentTester { char c; jsval_layout l; };\nstatic_assert(sizeof(LayoutAlignmentTester) == 16,\n              \"jsval_layout must be 16-byte-aligned\");\n\n} // namespace detail\n#endif /* DEBUG */\n\n} // namespace JS\n\n/*\n * JS::Value and jsval are the same type; jsval is the old name, kept around\n * for backwards compatibility along with all the JSVAL_* operations below.\n * jsval_layout is an implementation detail and should not be used externally.\n */\ntypedef JS::Value jsval;\n\nstatic_assert(sizeof(jsval_layout) == sizeof(JS::Value),\n              \"jsval_layout and JS::Value must have identical layouts\");\n\n/************************************************************************/\n\nstatic inline JSBool\nJSVAL_IS_NULL(jsval v)\n{\n    return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_VOID(jsval v)\n{\n    return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_INT(jsval v)\n{\n    return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline int32_t\nJSVAL_TO_INT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_INT(v));\n    return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nINT_TO_JSVAL(int32_t i)\n{\n    return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE(jsval v)\n{\n    return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline double\nJSVAL_TO_DOUBLE(jsval v)\n{\n    jsval_layout l;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    l = JSVAL_TO_IMPL(v);\n    return l.asDouble;\n}\n\nstatic inline jsval\nDOUBLE_TO_JSVAL(double d)\n{\n    /*\n     * This is a manually inlined version of:\n     *    d = JS_CANONICALIZE_NAN(d);\n     *    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));\n     * because GCC from XCode 3.1.4 miscompiles the above code.\n     */\n    jsval_layout l;\n    if (MOZ_UNLIKELY(d != d))\n        l.asBits = 0x7FF8000000000000LL;\n    else\n        l.asDouble = d;\n    return IMPL_TO_JSVAL(l);\n}\n\nstatic inline jsval\nUINT_TO_JSVAL(uint32_t i)\n{\n    if (i <= JSVAL_INT_MAX)\n        return INT_TO_JSVAL((int32_t)i);\n    return DOUBLE_TO_JSVAL((double)i);\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER(jsval v)\n{\n    return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING(jsval v)\n{\n    return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_STRING(v));\n    return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nSTRING_TO_JSVAL(JSString *str)\n{\n    return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str));\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v)));\n    return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nOBJECT_TO_JSVAL(JSObject *obj)\n{\n    if (obj)\n        return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj));\n    return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0));\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN(jsval v)\n{\n    return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_BOOLEAN(v));\n    return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nBOOLEAN_TO_JSVAL(JSBool b)\n{\n    return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE(jsval v)\n{\n    return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING(jsval v)\n{\n    return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_GCTHING(v));\n    return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/* To be GC-safe, privates are tagged as doubles. */\n\nstatic inline jsval\nPRIVATE_TO_JSVAL(void *ptr)\n{\n    return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));\n}\n\n#endif /* js_Value_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Vector_h\n#define js_Vector_h\n\n#include \"mozilla/Vector.h\"\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace js {\n\nclass TempAllocPolicy;\n\n// If we had C++11 template aliases, we could just use this:\n//\n//   template <typename T,\n//             size_t MinInlineCapacity = 0,\n//             class AllocPolicy = TempAllocPolicy>\n//   using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;\n//\n// ...and get rid of all the CRTP madness in mozilla::Vector(Base).  But we\n// can't because compiler support's not up to snuff.  (Template aliases are in\n// gcc 4.7 and clang 3.0 and are expected to be in MSVC 2013.)  Instead, have a\n// completely separate class inheriting from mozilla::Vector, and throw CRTP at\n// the problem til things work.\n//\n// This workaround presents a couple issues.  First, because js::Vector is a\n// distinct type from mozilla::Vector, overload resolution, method calls, etc.\n// are affected.  *Hopefully* this won't be too bad in practice.  (A bunch of\n// places had to be fixed when mozilla::Vector was introduced, but it wasn't a\n// crazy number.)  Second, mozilla::Vector's interface has to be made subclass-\n// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one\n// should use.  :-)  Third, we have to redefine the constructors and the non-\n// inherited operators.  Blech.  Happily there aren't too many of these, so it\n// isn't the end of the world.\n\ntemplate <typename T,\n          size_t MinInlineCapacity = 0,\n          class AllocPolicy = TempAllocPolicy>\nclass Vector\n  : public mozilla::VectorBase<T,\n                               MinInlineCapacity,\n                               AllocPolicy,\n                               Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector &operator=(mozilla::MoveRef<Vector> vec) {\n        return Base::operator=(vec);\n    }\n};\n\n} // namespace js\n\n#endif /* js_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js-config.h",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sw=4 et tw=78:\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_config_h___\n#define js_config_h___\n\n/* Definitions set at build time that affect SpiderMonkey's public API.\n   This header file is generated by the SpiderMonkey configure script,\n   and installed along with jsapi.h.  */\n\n/* Define to 1 if SpiderMonkey should support multi-threaded clients.  */\n/* #undef JS_THREADSAFE */\n\n/* Define to 1 if SpiderMonkey should include ctypes support.  */\n/* #undef JS_HAS_CTYPES */\n\n/* Define to 1 if SpiderMonkey should support the ability to perform\n   entirely too much GC.  */\n/* #undef JS_GC_ZEAL */\n\n/* Define to 1 if the <endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n#define JS_HAVE_ENDIAN_H 1\n\n/* Define to 1 if the <machine/endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n#define JS_HAVE_MACHINE_ENDIAN_H 1\n\n/* Define to 1 if the <sys/isa_defs.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_SYS_ISA_DEFS_H */\n\n/* The configure script defines these if it doesn't #define\n   JS_HAVE_STDINT_H.  */\n#define JS_BYTES_PER_WORD 4\n\n/* MOZILLA JSAPI version number components */\n#define MOZJS_MAJOR_VERSION 25\n#define MOZJS_MINOR_VERSION 0\n\n#endif /* js_config_h___ */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/js.msg",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This is the JavaScript error message file.\n *\n * The format for each JS error message is:\n *\n * MSG_DEF(<SYMBOLIC_NAME>, <ERROR_NUMBER>, <ARGUMENT_COUNT>, <EXCEPTION_NAME>,\n *         <FORMAT_STRING>)\n *\n * where ;\n * <SYMBOLIC_NAME> is a legal C identifer that will be used in the\n * JS engine source.\n *\n * <ERROR_NUMBER> is an unique integral value identifying this error.\n *\n * <ARGUMENT_COUNT> is an integer literal specifying the total number of\n * replaceable arguments in the following format string.\n *\n * <EXCEPTION_NAME> is an exception index from the enum in jsexn.c;\n * JSEXN_NONE for none.  The given exception index will be raised by the\n * engine when the corresponding error occurs.\n *\n * <FORMAT_STRING> is a string literal, optionally containing sequences\n * {X} where X  is an integer representing the argument number that will\n * be replaced with a string value when the error is reported.\n *\n * e.g.\n *\n * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 73, JSEXN_NONE, 2,\n *         \"{0} is not a member of the {1} family\")\n *\n * can be used:\n *\n * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, \"Rhino\", \"Monkey\");\n *\n * to report:\n *\n * \"Rhino is not a member of the Monkey family\"\n *\n * When removing MSG_DEFs, convert them to JSMSG_UNUSED<n> placeholders:\n *\n *    MSG_DEF(JSMSG_UNUSED7,                  7, 0, JSEXN_NONE, \"\")\n *\n * Before adding a new MSG_DEF at the end, look for existing JSMSG_UNUSED<n>\n * free index placeholders in the middle of the list.\n */\n\nMSG_DEF(JSMSG_NOT_AN_ERROR,             0, 0, JSEXN_NONE, \"<Error #0 is reserved>\")\nMSG_DEF(JSMSG_NOT_DEFINED,              1, 1, JSEXN_REFERENCEERR, \"{0} is not defined\")\nMSG_DEF(JSMSG_INACTIVE,                 2, 0, JSEXN_INTERNALERR, \"nothing active on context\")\nMSG_DEF(JSMSG_MORE_ARGS_NEEDED,         3, 3, JSEXN_TYPEERR, \"{0} requires more than {1} argument{2}\")\nMSG_DEF(JSMSG_BAD_CHAR,                 4, 1, JSEXN_INTERNALERR, \"invalid format character {0}\")\nMSG_DEF(JSMSG_BAD_TYPE,                 5, 1, JSEXN_TYPEERR, \"unknown type {0}\")\nMSG_DEF(JSMSG_ALLOC_OVERFLOW,           6, 0, JSEXN_INTERNALERR, \"allocation size overflow\")\nMSG_DEF(JSMSG_MISSING_HEXDIGITS,        7, 0, JSEXN_SYNTAXERR, \"missing hexadecimal digits after '0x'\")\nMSG_DEF(JSMSG_INCOMPATIBLE_PROTO,       8, 3, JSEXN_TYPEERR, \"{0}.prototype.{1} called on incompatible {2}\")\nMSG_DEF(JSMSG_NO_CONSTRUCTOR,           9, 1, JSEXN_TYPEERR, \"{0} has no constructor\")\nMSG_DEF(JSMSG_CANT_ALIAS,              10, 3, JSEXN_TYPEERR, \"can't alias {0} to {1} in class {2}\")\nMSG_DEF(JSMSG_NOT_SCRIPTED_FUNCTION,   11, 1, JSEXN_TYPEERR, \"{0} is not a scripted function\")\nMSG_DEF(JSMSG_BAD_SORT_ARG,            12, 0, JSEXN_TYPEERR, \"invalid Array.prototype.sort argument\")\nMSG_DEF(JSMSG_BAD_ATOMIC_NUMBER,       13, 1, JSEXN_INTERNALERR, \"internal error: no index for atom {0}\")\nMSG_DEF(JSMSG_TOO_MANY_LITERALS,       14, 0, JSEXN_INTERNALERR, \"too many literals\")\nMSG_DEF(JSMSG_CANT_WATCH,              15, 1, JSEXN_TYPEERR, \"can't watch non-native objects of class {0}\")\nMSG_DEF(JSMSG_STACK_UNDERFLOW,         16, 2, JSEXN_INTERNALERR, \"internal error compiling {0}: stack underflow at pc {1}\")\nMSG_DEF(JSMSG_NEED_DIET,               17, 1, JSEXN_INTERNALERR, \"{0} too large\")\nMSG_DEF(JSMSG_TOO_MANY_LOCAL_ROOTS,    18, 0, JSEXN_ERR, \"out of local root space\")\nMSG_DEF(JSMSG_READ_ONLY,               19, 1, JSEXN_TYPEERR, \"{0} is read-only\")\nMSG_DEF(JSMSG_BAD_FORMAL,              20, 0, JSEXN_SYNTAXERR, \"malformed formal parameter\")\nMSG_DEF(JSMSG_CANT_DELETE,             21, 1, JSEXN_TYPEERR, \"property {0} is non-configurable and can't be deleted\")\nMSG_DEF(JSMSG_NOT_FUNCTION,            22, 1, JSEXN_TYPEERR, \"{0} is not a function\")\nMSG_DEF(JSMSG_NOT_CONSTRUCTOR,         23, 1, JSEXN_TYPEERR, \"{0} is not a constructor\")\nMSG_DEF(JSMSG_INVALID_DATE,            24, 0, JSEXN_RANGEERR, \"invalid date\")\nMSG_DEF(JSMSG_TOO_DEEP,                25, 1, JSEXN_INTERNALERR, \"{0} nested too deeply\")\nMSG_DEF(JSMSG_OVER_RECURSED,           26, 0, JSEXN_INTERNALERR, \"too much recursion\")\nMSG_DEF(JSMSG_IN_NOT_OBJECT,           27, 1, JSEXN_TYPEERR, \"invalid 'in' operand {0}\")\nMSG_DEF(JSMSG_BAD_NEW_RESULT,          28, 1, JSEXN_TYPEERR, \"invalid new expression result {0}\")\nMSG_DEF(JSMSG_OBJECT_ACCESS_DENIED,    29, 0, JSEXN_ERR, \"Permission denied to access object\")\nMSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED,  30, 1, JSEXN_ERR, \"Permission denied to access property '{0}'\")\nMSG_DEF(JSMSG_BAD_INSTANCEOF_RHS,      31, 1, JSEXN_TYPEERR, \"invalid 'instanceof' operand {0}\")\nMSG_DEF(JSMSG_BAD_BYTECODE,            32, 1, JSEXN_INTERNALERR, \"unimplemented JavaScript bytecode {0}\")\nMSG_DEF(JSMSG_BAD_RADIX,               33, 0, JSEXN_RANGEERR, \"radix must be an integer at least 2 and no greater than 36\")\nMSG_DEF(JSMSG_PAREN_BEFORE_LET,        34, 0, JSEXN_SYNTAXERR, \"missing ( before let head\")\nMSG_DEF(JSMSG_CANT_CONVERT,            35, 1, JSEXN_ERR, \"can't convert {0} to an integer\")\nMSG_DEF(JSMSG_CYCLIC_VALUE,            36, 1, JSEXN_TYPEERR, \"cyclic {0} value\")\nMSG_DEF(JSMSG_COMPILE_EXECED_SCRIPT,   37, 0, JSEXN_TYPEERR, \"can't compile over a script that is currently executing\")\nMSG_DEF(JSMSG_CANT_CONVERT_TO,         38, 2, JSEXN_TYPEERR, \"can't convert {0} to {1}\")\nMSG_DEF(JSMSG_NO_PROPERTIES,           39, 1, JSEXN_TYPEERR, \"{0} has no properties\")\nMSG_DEF(JSMSG_CANT_FIND_CLASS,         40, 1, JSEXN_TYPEERR, \"can't find class id {0}\")\nMSG_DEF(JSMSG_DEAD_OBJECT,             41, 0, JSEXN_TYPEERR, \"can't access dead object\")\nMSG_DEF(JSMSG_BYTECODE_TOO_BIG,        42, 2, JSEXN_INTERNALERR, \"bytecode {0} too large (limit {1})\")\nMSG_DEF(JSMSG_UNKNOWN_FORMAT,          43, 1, JSEXN_INTERNALERR, \"unknown bytecode format {0}\")\nMSG_DEF(JSMSG_TOO_MANY_CON_ARGS,       44, 0, JSEXN_SYNTAXERR, \"too many constructor arguments\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_ARGS,       45, 0, JSEXN_SYNTAXERR, \"too many function arguments\")\nMSG_DEF(JSMSG_BAD_QUANTIFIER,          46, 0, JSEXN_SYNTAXERR, \"invalid quantifier\")\nMSG_DEF(JSMSG_MIN_TOO_BIG,             47, 1, JSEXN_SYNTAXERR, \"overlarge minimum {0}\")\nMSG_DEF(JSMSG_MAX_TOO_BIG,             48, 1, JSEXN_SYNTAXERR, \"overlarge maximum {0}\")\nMSG_DEF(JSMSG_OUT_OF_ORDER,            49, 1, JSEXN_SYNTAXERR, \"maximum {0} less than minimum\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_DECL,       50, 0, JSEXN_SYNTAXERR, \"missing = in destructuring declaration\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASS,        51, 0, JSEXN_REFERENCEERR, \"invalid destructuring assignment operator\")\nMSG_DEF(JSMSG_PAREN_AFTER_LET,         52, 0, JSEXN_SYNTAXERR, \"missing ) after let head\")\nMSG_DEF(JSMSG_CURLY_AFTER_LET,         53, 0, JSEXN_SYNTAXERR, \"missing } after let block\")\nMSG_DEF(JSMSG_MISSING_PAREN,           54, 0, JSEXN_SYNTAXERR, \"unterminated parenthetical\")\nMSG_DEF(JSMSG_UNTERM_CLASS,            55, 1, JSEXN_SYNTAXERR, \"unterminated character class {0}\")\nMSG_DEF(JSMSG_TRAILING_SLASH,          56, 0, JSEXN_SYNTAXERR, \"trailing \\\\ in regular expression\")\nMSG_DEF(JSMSG_BAD_CLASS_RANGE,         57, 0, JSEXN_SYNTAXERR, \"invalid range in character class\")\nMSG_DEF(JSMSG_BAD_REGEXP_FLAG,         58, 1, JSEXN_SYNTAXERR, \"invalid regular expression flag {0}\")\nMSG_DEF(JSMSG_NO_INPUT,                59, 5, JSEXN_SYNTAXERR, \"no input for /{0}/{1}{2}{3}{4}\")\nMSG_DEF(JSMSG_CANT_OPEN,               60, 2, JSEXN_ERR, \"can't open {0}: {1}\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_APPLY_ARGS, 61, 0, JSEXN_RANGEERR, \"arguments array passed to Function.prototype.apply is too large\")\nMSG_DEF(JSMSG_UNMATCHED_RIGHT_PAREN,   62, 0, JSEXN_SYNTAXERR, \"unmatched ) in regular expression\")\nMSG_DEF(JSMSG_TOO_BIG_TO_ENCODE,       63, 0, JSEXN_INTERNALERR, \"data are to big to encode\")\nMSG_DEF(JSMSG_ARG_INDEX_OUT_OF_RANGE,  64, 1, JSEXN_RANGEERR, \"argument {0} accesses an index that is out of range\")\nMSG_DEF(JSMSG_SPREAD_TOO_LARGE,        65, 0, JSEXN_RANGEERR, \"array too large due to spread operand(s)\")\nMSG_DEF(JSMSG_SOURCE_TOO_LONG,         66, 0, JSEXN_RANGEERR, \"source is too long\")\nMSG_DEF(JSMSG_BAD_WEAKMAP_KEY,         67, 0, JSEXN_TYPEERR, \"cannot use the given object as a weak map key\")\nMSG_DEF(JSMSG_BAD_SCRIPT_MAGIC,        68, 0, JSEXN_INTERNALERR, \"bad script XDR magic number\")\nMSG_DEF(JSMSG_PAREN_BEFORE_FORMAL,     69, 0, JSEXN_SYNTAXERR, \"missing ( before formal parameters\")\nMSG_DEF(JSMSG_MISSING_FORMAL,          70, 0, JSEXN_SYNTAXERR, \"missing formal parameter\")\nMSG_DEF(JSMSG_PAREN_AFTER_FORMAL,      71, 0, JSEXN_SYNTAXERR, \"missing ) after formal parameters\")\nMSG_DEF(JSMSG_CURLY_BEFORE_BODY,       72, 0, JSEXN_SYNTAXERR, \"missing { before function body\")\nMSG_DEF(JSMSG_CURLY_AFTER_BODY,        73, 0, JSEXN_SYNTAXERR, \"missing } after function body\")\nMSG_DEF(JSMSG_PAREN_BEFORE_COND,       74, 0, JSEXN_SYNTAXERR, \"missing ( before condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_COND,        75, 0, JSEXN_SYNTAXERR, \"missing ) after condition\")\nMSG_DEF(JSMSG_BAD_DUP_ARGS,            76, 0, JSEXN_SYNTAXERR, \"duplicate argument names not allowed in this context\")\nMSG_DEF(JSMSG_NAME_AFTER_DOT,          77, 0, JSEXN_SYNTAXERR, \"missing name after . operator\")\nMSG_DEF(JSMSG_BRACKET_IN_INDEX,        78, 0, JSEXN_SYNTAXERR, \"missing ] in index expression\")\nMSG_DEF(JSMSG_ACCESSOR_DEF_DENIED,     79, 1, JSEXN_ERR, \"Permission denied to define accessor property '{0}'\")\nMSG_DEF(JSMSG_PAREN_BEFORE_SWITCH,     80, 0, JSEXN_SYNTAXERR, \"missing ( before switch expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_SWITCH,      81, 0, JSEXN_SYNTAXERR, \"missing ) after switch expression\")\nMSG_DEF(JSMSG_CURLY_BEFORE_SWITCH,     82, 0, JSEXN_SYNTAXERR, \"missing { before switch body\")\nMSG_DEF(JSMSG_COLON_AFTER_CASE,        83, 0, JSEXN_SYNTAXERR, \"missing : after case label\")\nMSG_DEF(JSMSG_WHILE_AFTER_DO,          84, 0, JSEXN_SYNTAXERR, \"missing while after do-loop body\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR,         85, 0, JSEXN_SYNTAXERR, \"missing ( after for\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT,     86, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop initializer\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_COND,     87, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR_CTRL,    88, 0, JSEXN_SYNTAXERR, \"missing ) after for-loop control\")\nMSG_DEF(JSMSG_CURLY_BEFORE_TRY,        89, 0, JSEXN_SYNTAXERR, \"missing { before try block\")\nMSG_DEF(JSMSG_CURLY_AFTER_TRY,         90, 0, JSEXN_SYNTAXERR, \"missing } after try block\")\nMSG_DEF(JSMSG_PAREN_BEFORE_CATCH,      91, 0, JSEXN_SYNTAXERR, \"missing ( before catch\")\nMSG_DEF(JSMSG_CATCH_IDENTIFIER,        92, 0, JSEXN_SYNTAXERR, \"missing identifier in catch\")\nMSG_DEF(JSMSG_PAREN_AFTER_CATCH,       93, 0, JSEXN_SYNTAXERR, \"missing ) after catch\")\nMSG_DEF(JSMSG_CURLY_BEFORE_CATCH,      94, 0, JSEXN_SYNTAXERR, \"missing { before catch block\")\nMSG_DEF(JSMSG_CURLY_AFTER_CATCH,       95, 0, JSEXN_SYNTAXERR, \"missing } after catch block\")\nMSG_DEF(JSMSG_CURLY_BEFORE_FINALLY,    96, 0, JSEXN_SYNTAXERR, \"missing { before finally block\")\nMSG_DEF(JSMSG_CURLY_AFTER_FINALLY,     97, 0, JSEXN_SYNTAXERR, \"missing } after finally block\")\nMSG_DEF(JSMSG_CATCH_OR_FINALLY,        98, 0, JSEXN_SYNTAXERR, \"missing catch or finally after try\")\nMSG_DEF(JSMSG_PAREN_BEFORE_WITH,       99, 0, JSEXN_SYNTAXERR, \"missing ( before with-statement object\")\nMSG_DEF(JSMSG_PAREN_AFTER_WITH,       100, 0, JSEXN_SYNTAXERR, \"missing ) after with-statement object\")\nMSG_DEF(JSMSG_CURLY_IN_COMPOUND,      101, 0, JSEXN_SYNTAXERR, \"missing } in compound statement\")\nMSG_DEF(JSMSG_NO_VARIABLE_NAME,       102, 0, JSEXN_SYNTAXERR, \"missing variable name\")\nMSG_DEF(JSMSG_COLON_IN_COND,          103, 0, JSEXN_SYNTAXERR, \"missing : in conditional expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_ARGS,       104, 0, JSEXN_SYNTAXERR, \"missing ) after argument list\")\nMSG_DEF(JSMSG_BRACKET_AFTER_LIST,     105, 0, JSEXN_SYNTAXERR, \"missing ] after element list\")\nMSG_DEF(JSMSG_COLON_AFTER_ID,         106, 0, JSEXN_SYNTAXERR, \"missing : after property id\")\nMSG_DEF(JSMSG_CURLY_AFTER_LIST,       107, 0, JSEXN_SYNTAXERR, \"missing } after property list\")\nMSG_DEF(JSMSG_PAREN_IN_PAREN,         108, 0, JSEXN_SYNTAXERR, \"missing ) in parenthetical\")\nMSG_DEF(JSMSG_SEMI_BEFORE_STMNT,      109, 0, JSEXN_SYNTAXERR, \"missing ; before statement\")\nMSG_DEF(JSMSG_NO_RETURN_VALUE,        110, 1, JSEXN_TYPEERR, \"function {0} does not always return a value\")\nMSG_DEF(JSMSG_DUPLICATE_FORMAL,       111, 1, JSEXN_SYNTAXERR, \"duplicate formal argument {0}\")\nMSG_DEF(JSMSG_EQUAL_AS_ASSIGN,        112, 0, JSEXN_SYNTAXERR, \"test for equality (==) mistyped as assignment (=)?\")\nMSG_DEF(JSMSG_OPTIMIZED_CLOSURE_LEAK, 113, 0, JSEXN_INTERNALERR, \"can't access optimized closure\")\nMSG_DEF(JSMSG_TOO_MANY_DEFAULTS,      114, 0, JSEXN_SYNTAXERR, \"more than one switch default\")\nMSG_DEF(JSMSG_TOO_MANY_CASES,         115, 0, JSEXN_INTERNALERR, \"too many switch cases\")\nMSG_DEF(JSMSG_BAD_SWITCH,             116, 0, JSEXN_SYNTAXERR, \"invalid switch statement\")\nMSG_DEF(JSMSG_BAD_FOR_LEFTSIDE,       117, 0, JSEXN_SYNTAXERR, \"invalid for/in left-hand side\")\nMSG_DEF(JSMSG_CATCH_AFTER_GENERAL,    118, 0, JSEXN_SYNTAXERR, \"catch after unconditional catch\")\nMSG_DEF(JSMSG_CATCH_WITHOUT_TRY,      119, 0, JSEXN_SYNTAXERR, \"catch without try\")\nMSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,    120, 0, JSEXN_SYNTAXERR, \"finally without try\")\nMSG_DEF(JSMSG_LABEL_NOT_FOUND,        121, 0, JSEXN_SYNTAXERR, \"label not found\")\nMSG_DEF(JSMSG_TOUGH_BREAK,            122, 0, JSEXN_SYNTAXERR, \"unlabeled break must be inside loop or switch\")\nMSG_DEF(JSMSG_BAD_CONTINUE,           123, 0, JSEXN_SYNTAXERR, \"continue must be inside loop\")\nMSG_DEF(JSMSG_BAD_RETURN_OR_YIELD,    124, 1, JSEXN_SYNTAXERR, \"{0} not in function\")\nMSG_DEF(JSMSG_BAD_LABEL,              125, 0, JSEXN_SYNTAXERR, \"invalid label\")\nMSG_DEF(JSMSG_DUPLICATE_LABEL,        126, 0, JSEXN_SYNTAXERR, \"duplicate label\")\nMSG_DEF(JSMSG_VAR_HIDES_ARG,          127, 1, JSEXN_TYPEERR, \"variable {0} redeclares argument\")\nMSG_DEF(JSMSG_BAD_VAR_INIT,           128, 0, JSEXN_SYNTAXERR, \"invalid variable initialization\")\nMSG_DEF(JSMSG_BAD_LEFTSIDE_OF_ASS,    129, 0, JSEXN_REFERENCEERR, \"invalid assignment left-hand side\")\nMSG_DEF(JSMSG_BAD_OPERAND,            130, 1, JSEXN_SYNTAXERR, \"invalid {0} operand\")\nMSG_DEF(JSMSG_BAD_PROP_ID,            131, 0, JSEXN_SYNTAXERR, \"invalid property id\")\nMSG_DEF(JSMSG_RESERVED_ID,            132, 1, JSEXN_SYNTAXERR, \"{0} is a reserved identifier\")\nMSG_DEF(JSMSG_SYNTAX_ERROR,           133, 0, JSEXN_SYNTAXERR, \"syntax error\")\nMSG_DEF(JSMSG_MISSING_BINARY_DIGITS,  134, 0, JSEXN_SYNTAXERR, \"missing binary digits after '0b'\")\nMSG_DEF(JSMSG_BAD_PROTOTYPE,          135, 1, JSEXN_TYPEERR,   \"'prototype' property of {0} is not an object\")\nMSG_DEF(JSMSG_MISSING_EXPONENT,       136, 0, JSEXN_SYNTAXERR, \"missing exponent\")\nMSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, \"out of memory\")\nMSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, \"unterminated string literal\")\nMSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, \"too many parentheses in regular expression\")\nMSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, \"unterminated comment\")\nMSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, \"unterminated regular expression literal\")\nMSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, \"bad cloned function scope chain\")\nMSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, \"missing octal digits after '0o'\")\nMSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, \"illegal character\")\nMSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, \"{0} is not a legal ECMA-262 octal constant\")\nMSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, \"repeat count must be less than infinity and not overflow maximum string size\")\nMSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, \"uncaught exception: {0}\")\nMSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, \"non-octal digit in an escape sequence that doesn't match a back-reference\")\nMSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, \"back-reference exceeds number of capturing parentheses\")\nMSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, \"precision {0} out of range\")\nMSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, \"invalid {0} usage\")\nMSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, \"invalid array length\")\nMSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, \"can't describe non-native properties of class {0}\")\nMSG_DEF(JSMSG_BAD_APPLY_ARGS,         154, 1, JSEXN_TYPEERR, \"second argument to Function.prototype.{0} must be an array\")\nMSG_DEF(JSMSG_REDECLARED_VAR,         155, 2, JSEXN_TYPEERR, \"redeclaration of {0} {1}\")\nMSG_DEF(JSMSG_UNDECLARED_VAR,         156, 1, JSEXN_REFERENCEERR, \"assignment to undeclared variable {0}\")\nMSG_DEF(JSMSG_ANON_NO_RETURN_VALUE,   157, 0, JSEXN_TYPEERR, \"anonymous function does not always return a value\")\nMSG_DEF(JSMSG_DEPRECATED_USAGE,       158, 1, JSEXN_REFERENCEERR, \"deprecated {0} usage\")\nMSG_DEF(JSMSG_BAD_URI,                159, 0, JSEXN_URIERR, \"malformed URI sequence\")\nMSG_DEF(JSMSG_GETTER_ONLY,            160, 0, JSEXN_TYPEERR, \"setting a property that has only a getter\")\nMSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,   161, 0, JSEXN_SYNTAXERR, \"identifier starts immediately after numeric literal\")\nMSG_DEF(JSMSG_UNDEFINED_PROP,         162, 1, JSEXN_REFERENCEERR, \"reference to undefined property {0}\")\nMSG_DEF(JSMSG_USELESS_EXPR,           163, 0, JSEXN_TYPEERR, \"useless expression\")\nMSG_DEF(JSMSG_REDECLARED_PARAM,       164, 1, JSEXN_TYPEERR, \"redeclaration of formal parameter {0}\")\nMSG_DEF(JSMSG_NEWREGEXP_FLAGGED,      165, 0, JSEXN_TYPEERR, \"can't supply flags when constructing one RegExp from another\")\nMSG_DEF(JSMSG_RESERVED_SLOT_RANGE,    166, 0, JSEXN_RANGEERR, \"reserved slot index out of range\")\nMSG_DEF(JSMSG_CANT_DECODE_PRINCIPALS, 167, 0, JSEXN_INTERNALERR, \"can't decode JSPrincipals\")\nMSG_DEF(JSMSG_CANT_SEAL_OBJECT,       168, 1, JSEXN_ERR, \"can't seal {0} objects\")\nMSG_DEF(JSMSG_TOO_MANY_CATCH_VARS,    169, 0, JSEXN_SYNTAXERR, \"too many catch variables\")\nMSG_DEF(JSMSG_NEGATIVE_REPETITION_COUNT, 170, 0, JSEXN_RANGEERR, \"repeat count must be non-negative\")\nMSG_DEF(JSMSG_UNUSED171,              171, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED172,              172, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED173,              173, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED174,              174, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_NESTING_GENERATOR,      175, 0, JSEXN_TYPEERR, \"already executing generator\")\nMSG_DEF(JSMSG_UNUSED176,              176, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED177,              177, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED178,              178, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED179,              179, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED180,              180, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED181,              181, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SEND,     182, 1, JSEXN_TYPEERR, \"attempt to send {0} to newborn generator\")\nMSG_DEF(JSMSG_UNUSED183,              183, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED184,              184, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE, 185, 0, JSEXN_TYPEERR, \"proxy can't report an extensible object as non-extensible\")\nMSG_DEF(JSMSG_UNUSED186,              186, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED187,              187, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INCOMPATIBLE_METHOD,    188, 3, JSEXN_TYPEERR, \"{0} {1} called on incompatible {2}\")\nMSG_DEF(JSMSG_UNUSED189,              189, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED190,              190, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED191,              191, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED192,              192, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_FOR_EACH_LOOP,      193, 0, JSEXN_SYNTAXERR, \"invalid for each loop\")\nMSG_DEF(JSMSG_UNUSED194,              194, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED195,              195, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED196,              196, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INTERNAL_INTL_ERROR,    197, 0, JSEXN_ERR, \"internal error while computing Intl data\")\nMSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR,   198, 0, JSEXN_ERR, \"internal error getting the default locale\")\nMSG_DEF(JSMSG_TOO_MANY_LOCALS,        199, 0, JSEXN_SYNTAXERR, \"too many local variables\")\nMSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG,     200, 0, JSEXN_INTERNALERR, \"array initialiser too large\")\nMSG_DEF(JSMSG_REGEXP_TOO_COMPLEX,     201, 0, JSEXN_INTERNALERR, \"regular expression too complex\")\nMSG_DEF(JSMSG_BUFFER_TOO_SMALL,       202, 0, JSEXN_INTERNALERR, \"buffer too small\")\nMSG_DEF(JSMSG_BAD_SURROGATE_CHAR,     203, 1, JSEXN_TYPEERR, \"bad surrogate character {0}\")\nMSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE,    204, 1, JSEXN_TYPEERR, \"UTF-8 character {0} too large\")\nMSG_DEF(JSMSG_MALFORMED_UTF8_CHAR,    205, 1, JSEXN_TYPEERR, \"malformed UTF-8 character sequence at offset {0}\")\nMSG_DEF(JSMSG_USER_DEFINED_ERROR,     206, 0, JSEXN_ERR, \"JS_ReportError was called\")\nMSG_DEF(JSMSG_WRONG_CONSTRUCTOR,      207, 1, JSEXN_TYPEERR, \"wrong constructor called for {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_RETURN,   208, 1, JSEXN_TYPEERR, \"generator function {0} returns a value\")\nMSG_DEF(JSMSG_BAD_ANON_GENERATOR_RETURN, 209, 0, JSEXN_TYPEERR, \"anonymous generator function returns a value\")\nMSG_DEF(JSMSG_NAME_AFTER_FOR_PAREN,   210, 0, JSEXN_SYNTAXERR, \"missing name after for (\")\nMSG_DEF(JSMSG_IN_AFTER_FOR_NAME,      211, 0, JSEXN_SYNTAXERR, \"missing 'in' or 'of' after for\")\nMSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE,  212, 2, JSEXN_TYPEERR,\"trap {1} for {0} returned a primitive value\")\nMSG_DEF(JSMSG_UNUSED213,              213, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_YIELD,    214, 1, JSEXN_TYPEERR, \"yield from closing generator {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SYNTAX,   215, 1, JSEXN_SYNTAXERR, \"{0} expression must be parenthesized\")\nMSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE,    216, 0, JSEXN_SYNTAXERR, \"invalid array comprehension left-hand side\")\nMSG_DEF(JSMSG_UNUSED217,              217, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE,     218, 0, JSEXN_TYPEERR, \"reduce of empty array with no initial value\")\nMSG_DEF(JSMSG_UNUSED219,              219, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_DELETE_OPERAND,     220, 0, JSEXN_REFERENCEERR, \"invalid delete operand\")\nMSG_DEF(JSMSG_BAD_INCOP_OPERAND,      221, 0, JSEXN_REFERENCEERR, \"invalid increment/decrement operand\")\nMSG_DEF(JSMSG_UNEXPECTED_TYPE,        222, 2, JSEXN_TYPEERR, \"{0} is {1}\")\nMSG_DEF(JSMSG_LET_DECL_NOT_IN_BLOCK,  223, 0, JSEXN_SYNTAXERR, \"let declaration not directly within block\")\nMSG_DEF(JSMSG_BAD_OBJECT_INIT,        224, 0, JSEXN_SYNTAXERR, \"invalid object initializer\")\nMSG_DEF(JSMSG_CANT_SET_ARRAY_ATTRS,   225, 0, JSEXN_INTERNALERR, \"can't set attributes on indexed array properties\")\nMSG_DEF(JSMSG_EVAL_ARITY,             226, 0, JSEXN_TYPEERR, \"eval accepts only one parameter\")\nMSG_DEF(JSMSG_MISSING_FUN_ARG,        227, 2, JSEXN_TYPEERR, \"missing argument {0} when calling function {1}\")\nMSG_DEF(JSMSG_JSON_BAD_PARSE,         228, 1, JSEXN_SYNTAXERR, \"JSON.parse: {0}\")\nMSG_DEF(JSMSG_JSON_BAD_STRINGIFY,     229, 0, JSEXN_ERR, \"JSON.stringify\")\nMSG_DEF(JSMSG_NOT_CALLABLE_OR_UNDEFINED, 230, 0, JSEXN_TYPEERR, \"value is not a function or undefined\")\nMSG_DEF(JSMSG_NOT_NONNULL_OBJECT,     231, 0, JSEXN_TYPEERR, \"value is not a non-null object\")\nMSG_DEF(JSMSG_DEPRECATED_OCTAL,       232, 0, JSEXN_SYNTAXERR, \"octal literals and octal escape sequences are deprecated\")\nMSG_DEF(JSMSG_STRICT_CODE_WITH,       233, 0, JSEXN_SYNTAXERR, \"strict mode code may not contain 'with' statements\")\nMSG_DEF(JSMSG_DUPLICATE_PROPERTY,     234, 1, JSEXN_SYNTAXERR, \"property name {0} appears more than once in object literal\")\nMSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 235, 0, JSEXN_SYNTAXERR, \"applying the 'delete' operator to an unqualified name is deprecated\")\nMSG_DEF(JSMSG_BAD_STRICT_ASSIGN,      236, 1, JSEXN_SYNTAXERR, \"can't assign to {0} in strict mode\")\nMSG_DEF(JSMSG_BAD_BINDING,            237, 1, JSEXN_SYNTAXERR, \"redefining {0} is deprecated\")\nMSG_DEF(JSMSG_INVALID_DESCRIPTOR,     238, 0, JSEXN_TYPEERR, \"property descriptors must not specify a value or be writable when a getter or setter has been specified\")\nMSG_DEF(JSMSG_OBJECT_NOT_EXTENSIBLE,  239, 1, JSEXN_TYPEERR, \"{0} is not extensible\")\nMSG_DEF(JSMSG_CANT_REDEFINE_PROP,     240, 1, JSEXN_TYPEERR, \"can't redefine non-configurable property '{0}'\")\nMSG_DEF(JSMSG_CANT_APPEND_TO_ARRAY,   241, 0, JSEXN_TYPEERR, \"can't add elements past the end of an array if its length property is unwritable\")\nMSG_DEF(JSMSG_CANT_REDEFINE_ARRAY_LENGTH,242, 0, JSEXN_TYPEERR, \"can't redefine array length\")\nMSG_DEF(JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH,243, 0, JSEXN_TYPEERR, \"can't define array index property past the end of an array with non-writable length\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_INDEX,  244, 0, JSEXN_ERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG, 245, 1, JSEXN_ERR, \"argument {0} must be >= 0\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS,   246, 0, JSEXN_ERR, \"invalid arguments\")\nMSG_DEF(JSMSG_CSP_BLOCKED_FUNCTION,   247, 0, JSEXN_ERR, \"call to Function() blocked by CSP\")\nMSG_DEF(JSMSG_BAD_GET_SET_FIELD,      248, 1, JSEXN_TYPEERR, \"property descriptor's {0} field is neither undefined nor a function\")\nMSG_DEF(JSMSG_BAD_PROXY_FIX,          249, 0, JSEXN_TYPEERR, \"proxy was fixed while executing the handler\")\nMSG_DEF(JSMSG_INVALID_EVAL_SCOPE_ARG, 250, 0, JSEXN_EVALERR, \"invalid eval scope argument\")\nMSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS,    251, 3, JSEXN_SYNTAXERR, \"{0} functions must have {1} argument{2}\")\nMSG_DEF(JSMSG_THROW_TYPE_ERROR,       252, 0, JSEXN_TYPEERR, \"'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them\")\nMSG_DEF(JSMSG_BAD_TOISOSTRING_PROP,   253, 0, JSEXN_TYPEERR, \"toISOString property is not callable\")\nMSG_DEF(JSMSG_BAD_PARSE_NODE,         254, 0, JSEXN_INTERNALERR, \"bad parse node\")\nMSG_DEF(JSMSG_NOT_EXPECTED_TYPE,      255, 3, JSEXN_TYPEERR, \"{0}: expected {1}, got {2}\")\nMSG_DEF(JSMSG_CALLER_IS_STRICT,       256, 0, JSEXN_TYPEERR, \"access to strict mode caller function is censored\")\nMSG_DEF(JSMSG_NEED_DEBUG_MODE,        257, 0, JSEXN_ERR, \"function can be called only in debug mode\")\nMSG_DEF(JSMSG_STRICT_CODE_LET_EXPR_STMT, 258, 0, JSEXN_ERR, \"strict mode code may not contain unparenthesized let expression statements\")\nMSG_DEF(JSMSG_CANT_CHANGE_EXTENSIBILITY, 259, 0, JSEXN_TYPEERR, \"can't change object's extensibility\")\nMSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA, 260, 1, JSEXN_INTERNALERR, \"bad serialized structured data ({0})\")\nMSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE,    261, 0, JSEXN_TYPEERR, \"unsupported type for structured data\")\nMSG_DEF(JSMSG_SC_RECURSION,           262, 0, JSEXN_INTERNALERR, \"recursive object\")\nMSG_DEF(JSMSG_DEBUG_CANT_DEBUG_GLOBAL, 263, 0, JSEXN_ERR, \"passing non-debuggable global to addDebuggee\")\nMSG_DEF(JSMSG_BAD_CLONE_VERSION,      264, 0, JSEXN_ERR, \"unsupported structured clone version\")\nMSG_DEF(JSMSG_CANT_CLONE_OBJECT,      265, 0, JSEXN_TYPEERR, \"can't clone object\")\nMSG_DEF(JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED, 266, 0, JSEXN_TYPEERR, \"resumption values are disallowed in this hook\")\nMSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, \"in strict mode code, functions may be declared only at top level or immediately within another function\")\nMSG_DEF(JSMSG_INVALID_FOR_IN_INIT,    268, 0, JSEXN_SYNTAXERR, \"for-in loop let declaration may not have an initializer\")\nMSG_DEF(JSMSG_CLEARED_SCOPE,          269, 0, JSEXN_TYPEERR, \"attempt to run compile-and-go script on a cleared scope\")\nMSG_DEF(JSMSG_MALFORMED_ESCAPE,       270, 1, JSEXN_SYNTAXERR, \"malformed {0} character escape sequence\")\nMSG_DEF(JSMSG_BAD_GENEXP_BODY,        271, 1, JSEXN_SYNTAXERR, \"illegal use of {0} in generator expression\")\nMSG_DEF(JSMSG_YIELD_WITHOUT_OPERAND,  272, 0, JSEXN_SYNTAXERR, \"yield without a value is deprecated, and illegal in ES6 (use 'yield undefined' instead)\")\nMSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT,  273, 0, JSEXN_SYNTAXERR, \"function statement requires a name\")\nMSG_DEF(JSMSG_CCW_REQUIRED,           274, 1, JSEXN_TYPEERR, \"{0}: argument must be an object from a different compartment\")\nMSG_DEF(JSMSG_DEBUG_BAD_RESUMPTION,   275, 0, JSEXN_TYPEERR, \"debugger resumption value must be undefined, {throw: val}, {return: val}, or null\")\nMSG_DEF(JSMSG_ASSIGN_FUNCTION_OR_NULL, 276, 1, JSEXN_TYPEERR, \"value assigned to {0} must be a function or null\")\nMSG_DEF(JSMSG_DEBUG_NOT_LIVE,         277, 1, JSEXN_ERR, \"{0} is not live\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_WRONG_OWNER, 278, 0, JSEXN_TYPEERR, \"Debugger.Object belongs to a different Debugger\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_PROTO,     279, 0, JSEXN_TYPEERR, \"Debugger.Object.prototype is not a valid Debugger.Object\")\nMSG_DEF(JSMSG_DEBUG_LOOP,             280, 0, JSEXN_TYPEERR, \"cannot debug an object in same compartment as debugger or a compartment that is already debugging the debugger\")\nMSG_DEF(JSMSG_DEBUG_NOT_IDLE,         281, 0, JSEXN_ERR, \"can't start debugging: a debuggee script is on the stack\")\nMSG_DEF(JSMSG_DEBUG_BAD_OFFSET,       282, 0, JSEXN_TYPEERR, \"invalid script offset\")\nMSG_DEF(JSMSG_DEBUG_BAD_LINE,         283, 0, JSEXN_TYPEERR, \"invalid line number\")\nMSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING,    284, 0, JSEXN_ERR, \"can't set breakpoint: script global is not a debuggee\")\nMSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, \"{0}: descriptor .{1} property is an object in a different compartment than the target object\")\nMSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, \"stack frame is not running JavaScript code\")\nMSG_DEF(JSMSG_CANT_WATCH_PROP,        287, 0, JSEXN_TYPEERR, \"properties whose names are objects can't be watched\")\nMSG_DEF(JSMSG_CSP_BLOCKED_EVAL,       288, 0, JSEXN_ERR, \"call to eval() blocked by CSP\")\nMSG_DEF(JSMSG_DEBUG_NO_SCOPE_OBJECT,  289, 0, JSEXN_TYPEERR, \"declarative Environments don't have binding objects\")\nMSG_DEF(JSMSG_EMPTY_CONSEQUENT,       290, 0, JSEXN_SYNTAXERR, \"mistyped ; after conditional?\")\nMSG_DEF(JSMSG_NOT_ITERABLE,           291, 1, JSEXN_TYPEERR, \"{0} is not iterable\")\nMSG_DEF(JSMSG_QUERY_LINE_WITHOUT_URL, 292, 0, JSEXN_TYPEERR, \"findScripts query object has 'line' property, but no 'url' property\")\nMSG_DEF(JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL, 293, 0, JSEXN_TYPEERR, \"findScripts query object has 'innermost' property without both 'url' and 'line' properties\")\nMSG_DEF(JSMSG_DEBUG_VARIABLE_NOT_FOUND, 294, 0, JSEXN_TYPEERR, \"variable not found in environment\")\nMSG_DEF(JSMSG_PARAMETER_AFTER_REST,   295, 0, JSEXN_SYNTAXERR, \"parameter after rest parameter\")\nMSG_DEF(JSMSG_NO_REST_NAME,           296, 0, JSEXN_SYNTAXERR, \"no parameter name after ...\")\nMSG_DEF(JSMSG_ARGUMENTS_AND_REST,     297, 0, JSEXN_SYNTAXERR, \"'arguments' object may not be used in conjunction with a rest parameter\")\nMSG_DEF(JSMSG_FUNCTION_ARGUMENTS_AND_REST, 298, 0, JSEXN_ERR, \"the 'arguments' property of a function with a rest parameter may not be used\")\nMSG_DEF(JSMSG_REST_WITH_DEFAULT,      299, 0, JSEXN_SYNTAXERR, \"rest parameter may not have a default\")\nMSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, \"parameter(s) with default followed by parameter without default\")\nMSG_DEF(JSMSG_YIELD_IN_DEFAULT,       301, 0, JSEXN_SYNTAXERR, \"yield in default expression\")\nMSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED,  302, 1, JSEXN_REFERENCEERR, \"no intrinsic function {0}\")\nMSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP,  303, 1, JSEXN_ERR,      \"{0} is being assigned a source map, yet already has one\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG,      304, 1, JSEXN_RANGEERR, \"invalid ParallelArray{0} argument\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, \"argument must be divisible by outermost dimension\")\nMSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, \"cannot reduce ParallelArray object whose outermost dimension is empty\")\nMSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, \"cannot flatten 1-dimensional ParallelArray object\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, \"no conflict resolution function provided\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, \"index in scatter vector out of bounds\")\nMSG_DEF(JSMSG_CANT_REPORT_NC_AS_NE,   310, 0, JSEXN_TYPEERR, \"proxy can't report a non-configurable own property as non-existent\")\nMSG_DEF(JSMSG_CANT_REPORT_E_AS_NE,    311, 0, JSEXN_TYPEERR, \"proxy can't report an existing own property as non-existent on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_NEW,        312, 0, JSEXN_TYPEERR, \"proxy can't report a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_INVALID,    313, 0, JSEXN_TYPEERR, \"proxy can't report an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_REPORT_NE_AS_NC,   314, 0, JSEXN_TYPEERR, \"proxy can't report a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_CANT_DEFINE_NEW,        315, 0, JSEXN_TYPEERR, \"proxy can't define a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_DEFINE_INVALID,    316, 0, JSEXN_TYPEERR, \"proxy can't define an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_DEFINE_NE_AS_NC,   317, 0, JSEXN_TYPEERR, \"proxy can't define a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_INVALID_TRAP_RESULT,    318, 2, JSEXN_TYPEERR, \"trap {1} for {0} returned an invalid result\")\nMSG_DEF(JSMSG_CANT_SKIP_NC,           319, 0, JSEXN_TYPEERR, \"proxy can't skip a non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_SAME_VALUE, 320, 0, JSEXN_TYPEERR, \"proxy must report the same value for a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_UNDEFINED,  321, 0, JSEXN_TYPEERR, \"proxy must report undefined for a non-configurable accessor property without a getter\")\nMSG_DEF(JSMSG_CANT_SET_NW_NC,         322, 0, JSEXN_TYPEERR, \"proxy can't successfully set a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_CANT_SET_WO_SETTER,     323, 0, JSEXN_TYPEERR, \"proxy can't succesfully set an accessor property without a setter\")\nMSG_DEF(JSMSG_DEBUG_BAD_REFERENT,     324, 2, JSEXN_TYPEERR, \"{0} does not refer to {1}\")\nMSG_DEF(JSMSG_DEBUG_WRAPPER_IN_WAY,   325, 2, JSEXN_TYPEERR, \"{0} is a wrapper around {1}, but a direct reference is required\")\nMSG_DEF(JSMSG_UNWRAP_DENIED,          326, 0, JSEXN_ERR, \"permission denied to unwrap object\")\nMSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 327, 3, JSEXN_TYPEERR, \"Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}\")\nMSG_DEF(JSMSG_INVALID_LOCALES_ELEMENT,328, 0, JSEXN_TYPEERR, \"invalid element in locales argument\")\nMSG_DEF(JSMSG_INVALID_LANGUAGE_TAG,   329, 1, JSEXN_RANGEERR, \"invalid language tag: {0}\")\nMSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, \"invalid locale matcher in supportedLocalesOf(): {0}\")\nMSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, \"invalid value {1} for option {0}\")\nMSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, \"invalid digits value: {0}\")\nMSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, \"can't initialize object twice as an object of an Intl constructor\")\nMSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, \"invalid currency code in NumberFormat(): {0}\")\nMSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, \"undefined currency in NumberFormat() with currency style\")\nMSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, \"invalid time zone in DateTimeFormat(): {0}\")\nMSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, \"date value is not finite in DateTimeFormat.format()\")\nMSG_DEF(JSMSG_MODULE_STATEMENT,       338, 0, JSEXN_SYNTAXERR, \"module declarations may only appear at the top level of a program or module body\")\nMSG_DEF(JSMSG_CURLY_BEFORE_MODULE,    339, 0, JSEXN_SYNTAXERR, \"missing { before module body\")\nMSG_DEF(JSMSG_CURLY_AFTER_MODULE,     340, 0, JSEXN_SYNTAXERR, \"missing } after module body\")\nMSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 341, 0, JSEXN_SYNTAXERR, \"\\\"use asm\\\" is only meaningful in the Directive Prologue of a function body\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_FAIL,      342, 1, JSEXN_TYPEERR, \"asm.js type error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_LINK_FAIL,      343, 1, JSEXN_TYPEERR, \"asm.js link error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_OK,        344, 1, JSEXN_ERR,     \"successfully compiled asm.js code ({0})\")\nMSG_DEF(JSMSG_BAD_ARROW_ARGS,         345, 0, JSEXN_SYNTAXERR, \"invalid arrow-function arguments (parentheses around the arrow-function may help)\")\nMSG_DEF(JSMSG_YIELD_IN_ARROW,         346, 0, JSEXN_SYNTAXERR, \"arrow function may not contain yield\")\nMSG_DEF(JSMSG_WRONG_VALUE,            347, 2, JSEXN_ERR, \"expected {0} but found {1}\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, \"target for index {0} is not an integer\")\nMSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME,349, 0, JSEXN_TYPEERR, \"self-hosted code may not contain unbound name lookups\")\nMSG_DEF(JSMSG_DEPRECATED_SOURCE_MAP,  350, 0, JSEXN_SYNTAXERR, \"Using //@ to indicate source map URL pragmas is deprecated. Use //# instead\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASSIGN,    351, 1, JSEXN_SYNTAXERR, \"can't assign to {0} using destructuring assignment\")\nMSG_DEF(JSMSG_BINARYDATA_ARRAYTYPE_BAD_ARGS, 352, 0, JSEXN_ERR, \"Invalid arguments\")\nMSG_DEF(JSMSG_BINARYDATA_BINARYARRAY_BAD_INDEX, 353, 0, JSEXN_RANGEERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_ARGS, 354, 0, JSEXN_RANGEERR, \"invalid field descriptor\")\nMSG_DEF(JSMSG_BINARYDATA_NOT_BINARYSTRUCT,   355, 1, JSEXN_TYPEERR, \"{0} is not a BinaryStruct\")\nMSG_DEF(JSMSG_BINARYDATA_SUBARRAY_INTEGER_ARG, 356, 1, JSEXN_ERR, \"argument {0} must be an integer\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_EMPTY_DESCRIPTOR, 357, 0, JSEXN_ERR, \"field descriptor cannot be empty\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_FIELD, 358, 1, JSEXN_ERR, \"field {0} is not a valid BinaryData Type descriptor\")\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsalloc.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS allocation policies. */\n\n#ifndef jsalloc_h\n#define jsalloc_h\n\n#include \"mozilla/AllocPolicy.h\"\n\n#include \"js/Utility.h\"\n\nstruct JSContext;\n\nnamespace js {\n\nclass ContextFriendFields;\n\n/* Policy for using system memory functions and doing no error reporting. */\nclass SystemAllocPolicy\n{\n  public:\n    void *malloc_(size_t bytes) { return js_malloc(bytes); }\n    void *calloc_(size_t bytes) { return js_calloc(bytes); }\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }\n    void free_(void *p) { js_free(p); }\n    void reportAllocOverflow() const {}\n};\n\n/*\n * Allocation policy that calls the system memory functions and reports errors\n * to the context. Since the JSContext given on construction is stored for\n * the lifetime of the container, this policy may only be used for containers\n * whose lifetime is a shorter than the given JSContext.\n *\n * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,\n * not the system ones.\n */\nclass TempAllocPolicy\n{\n    ContextFriendFields *const cx_;\n\n    /*\n     * Non-inline helper to call JSRuntime::onOutOfMemory with minimal\n     * code bloat.\n     */\n    JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);\n\n  public:\n    TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(\n    TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}\n\n    void *malloc_(size_t bytes) {\n        void *p = js_malloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *calloc_(size_t bytes) {\n        void *p = js_calloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) {\n        void *p2 = js_realloc(p, bytes);\n        if (JS_UNLIKELY(!p2))\n            p2 = onOutOfMemory(p2, bytes);\n        return p2;\n    }\n\n    void free_(void *p) {\n        js_free(p);\n    }\n\n    JS_FRIEND_API(void) reportAllocOverflow() const;\n};\n\n} /* namespace js */\n\n#endif /* jsalloc_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JavaScript API. */\n\n#ifndef jsapi_h\n#define jsapi_h\n\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/RangedPtr.h\"\n#include \"mozilla/ThreadLocal.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"js-config.h\"\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n#include \"js/CharacterEncoding.h\"\n#include \"js/HashTable.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n#include \"js/Value.h\"\n#include \"js/Vector.h\"\n\n/************************************************************************/\n\nnamespace JS {\n\ntypedef mozilla::RangedPtr<const jschar> CharPtr;\n\nclass StableCharPtr : public CharPtr {\n  public:\n    StableCharPtr(const StableCharPtr &s) : CharPtr(s) {}\n    StableCharPtr(const mozilla::RangedPtr<const jschar> &s) : CharPtr(s) {}\n    StableCharPtr(const jschar *s, size_t len) : CharPtr(s, len) {}\n    StableCharPtr(const jschar *pos, const jschar *start, size_t len)\n      : CharPtr(pos, start, len)\n    {}\n};\n\n#if defined JS_THREADSAFE && defined DEBUG\n\nclass JS_PUBLIC_API(AutoCheckRequestDepth)\n{\n    JSContext *cx;\n  public:\n    AutoCheckRequestDepth(JSContext *cx);\n    AutoCheckRequestDepth(js::ContextFriendFields *cx);\n    ~AutoCheckRequestDepth();\n};\n\n# define CHECK_REQUEST(cx) \\\n    JS::AutoCheckRequestDepth _autoCheckRequestDepth(cx)\n\n#else\n\n# define CHECK_REQUEST(cx) \\\n    ((void) 0)\n\n#endif /* JS_THREADSAFE && DEBUG */\n\n#ifdef DEBUG\n/*\n * Assert that we're not doing GC on cx, that we're in a request as\n * needed, and that the compartments for cx and v are correct.\n * Also check that GC would be safe at this point.\n */\nJS_PUBLIC_API(void)\nAssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v);\n#else\ninline void AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v) {\n    /* Do nothing */\n}\n#endif /* DEBUG */\n\nclass JS_PUBLIC_API(AutoGCRooter) {\n  public:\n    AutoGCRooter(JSContext *cx, ptrdiff_t tag);\n    AutoGCRooter(js::ContextFriendFields *cx, ptrdiff_t tag);\n\n    ~AutoGCRooter() {\n        JS_ASSERT(this == *stackTop);\n        *stackTop = down;\n    }\n\n    /* Implemented in gc/RootMarking.cpp. */\n    inline void trace(JSTracer *trc);\n    static void traceAll(JSTracer *trc);\n    static void traceAllWrappers(JSTracer *trc);\n\n  protected:\n    AutoGCRooter * const down;\n\n    /*\n     * Discriminates actual subclass of this being used.  If non-negative, the\n     * subclass roots an array of values of the length stored in this field.\n     * If negative, meaning is indicated by the corresponding value in the enum\n     * below.  Any other negative value indicates some deeper problem such as\n     * memory corruption.\n     */\n    ptrdiff_t tag_;\n\n    enum {\n        VALARRAY =     -2, /* js::AutoValueArray */\n        PARSER =       -3, /* js::frontend::Parser */\n        SHAPEVECTOR =  -4, /* js::AutoShapeVector */\n        IDARRAY =      -6, /* js::AutoIdArray */\n        DESCRIPTORS =  -7, /* js::AutoPropDescArrayRooter */\n        ID =           -9, /* js::AutoIdRooter */\n        VALVECTOR =   -10, /* js::AutoValueVector */\n        DESCRIPTOR =  -11, /* js::AutoPropertyDescriptorRooter */\n        STRING =      -12, /* js::AutoStringRooter */\n        IDVECTOR =    -13, /* js::AutoIdVector */\n        OBJVECTOR =   -14, /* js::AutoObjectVector */\n        STRINGVECTOR =-15, /* js::AutoStringVector */\n        SCRIPTVECTOR =-16, /* js::AutoScriptVector */\n        NAMEVECTOR =  -17, /* js::AutoNameVector */\n        HASHABLEVALUE=-18, /* js::HashableValue */\n        IONMASM =     -19, /* js::jit::MacroAssembler */\n        IONALLOC =    -20, /* js::jit::AutoTempAllocatorRooter */\n        WRAPVECTOR =  -21, /* js::AutoWrapperVector */\n        WRAPPER =     -22, /* js::AutoWrapperRooter */\n        OBJOBJHASHMAP=-23, /* js::AutoObjectObjectHashMap */\n        OBJU32HASHMAP=-24, /* js::AutoObjectUnsigned32HashMap */\n        OBJHASHSET =  -25, /* js::AutoObjectHashSet */\n        JSONPARSER =  -26, /* js::JSONParser */\n        CUSTOM =      -27, /* js::CustomAutoRooter */\n        FUNVECTOR =   -28  /* js::AutoFunctionVector */\n    };\n\n  private:\n    AutoGCRooter ** const stackTop;\n\n    /* No copy or assignment semantics. */\n    AutoGCRooter(AutoGCRooter &ida) MOZ_DELETE;\n    void operator=(AutoGCRooter &ida) MOZ_DELETE;\n};\n\nclass AutoStringRooter : private AutoGCRooter {\n  public:\n    AutoStringRooter(JSContext *cx, JSString *str = NULL\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, STRING), str_(str)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    void setString(JSString *str) {\n        str_ = str;\n    }\n\n    JSString * string() const {\n        return str_;\n    }\n\n    JSString ** addr() {\n        return &str_;\n    }\n\n    JSString * const * addr() const {\n        return &str_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    JSString *str_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoArrayRooter : private AutoGCRooter {\n  public:\n    AutoArrayRooter(JSContext *cx, size_t len, Value *vec\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, len), array(vec), skip(cx, array, len)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeLength(size_t newLength) {\n        tag_ = ptrdiff_t(newLength);\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeArray(Value *newArray, size_t newLength) {\n        changeLength(newLength);\n        array = newArray;\n    }\n\n    Value *array;\n\n    MutableHandleValue handleAt(size_t i)\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return MutableHandleValue::fromMarkedLocation(&array[i]);\n    }\n    HandleValue handleAt(size_t i) const\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return HandleValue::fromMarkedLocation(&array[i]);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    js::SkipRoot skip;\n};\n\ntemplate<class T>\nclass AutoVectorRooter : protected AutoGCRooter\n{\n  public:\n    explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoVectorRooter(js::ContextFriendFields *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef T ElementType;\n\n    size_t length() const { return vector.length(); }\n    bool empty() const { return vector.empty(); }\n\n    bool append(const T &v) { return vector.append(v); }\n    bool appendAll(const AutoVectorRooter<T> &other) {\n        return vector.appendAll(other.vector);\n    }\n\n    bool insert(T *p, const T &val) { return vector.insert(p, val); }\n\n    /* For use when space has already been reserved. */\n    void infallibleAppend(const T &v) { vector.infallibleAppend(v); }\n\n    void popBack() { vector.popBack(); }\n    T popCopy() { return vector.popCopy(); }\n\n    bool growBy(size_t inc) {\n        size_t oldLength = vector.length();\n        if (!vector.growByUninitialized(inc))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    bool resize(size_t newLength) {\n        size_t oldLength = vector.length();\n        if (newLength <= oldLength) {\n            vector.shrinkBy(oldLength - newLength);\n            return true;\n        }\n        if (!vector.growByUninitialized(newLength - oldLength))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    void clear() { vector.clear(); }\n\n    bool reserve(size_t newLength) {\n        return vector.reserve(newLength);\n    }\n\n    T &operator[](size_t i) { return vector[i]; }\n    const T &operator[](size_t i) const { return vector[i]; }\n\n    JS::MutableHandle<T> handleAt(size_t i) { return JS::MutableHandle<T>::fromMarkedLocation(&vector[i]); }\n    JS::Handle<T> handleAt(size_t i) const { return JS::Handle<T>::fromMarkedLocation(&vector[i]); }\n\n    const T *begin() const { return vector.begin(); }\n    T *begin() { return vector.begin(); }\n\n    const T *end() const { return vector.end(); }\n    T *end() { return vector.end(); }\n\n    const T &back() const { return vector.back(); }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    void makeRangeGCSafe(size_t oldLength) {\n        T *t = vector.begin() + oldLength;\n        for (size_t i = oldLength; i < vector.length(); ++i, ++t)\n            memset(t, 0, sizeof(T));\n    }\n\n    typedef js::Vector<T, 8> VectorImpl;\n    VectorImpl vector;\n\n    /* Prevent overwriting of inline elements in vector. */\n    js::SkipRoot vectorRoot;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class Key, class Value>\nclass AutoHashMapRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashMap<Key, Value> HashMapImpl;\n\n  public:\n    explicit AutoHashMapRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), map(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n    typedef typename HashMapImpl::Lookup Lookup;\n    typedef typename HashMapImpl::Ptr Ptr;\n    typedef typename HashMapImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return map.init(len);\n    }\n    bool initialized() const {\n        return map.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return map.lookup(l);\n    }\n    void remove(Ptr p) {\n        map.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return map.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.add(p, k, v);\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        return map.add(p, k);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.relookupOrAdd(p, k, v);\n    }\n\n    typedef typename HashMapImpl::Range Range;\n    Range all() const {\n        return map.all();\n    }\n\n    typedef typename HashMapImpl::Enum Enum;\n\n    void clear() {\n        map.clear();\n    }\n\n    void finish() {\n        map.finish();\n    }\n\n    bool empty() const {\n        return map.empty();\n    }\n\n    uint32_t count() const {\n        return map.count();\n    }\n\n    size_t capacity() const {\n        return map.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return map.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return map.has(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        return map.put(k, v);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        return map.putNew(k, v);\n    }\n\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        return map.lookupWithDefault(k, defaultValue);\n    }\n\n    void remove(const Lookup &l) {\n        map.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashMapRooter(const AutoHashMapRooter &hmr) MOZ_DELETE;\n    AutoHashMapRooter &operator=(const AutoHashMapRooter &hmr) MOZ_DELETE;\n\n    HashMapImpl map;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class T>\nclass AutoHashSetRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashSet<T> HashSetImpl;\n\n  public:\n    explicit AutoHashSetRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), set(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef typename HashSetImpl::Lookup Lookup;\n    typedef typename HashSetImpl::Ptr Ptr;\n    typedef typename HashSetImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return set.init(len);\n    }\n    bool initialized() const {\n        return set.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return set.lookup(l);\n    }\n    void remove(Ptr p) {\n        set.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return set.lookupForAdd(l);\n    }\n\n    bool add(AddPtr &p, const T &t) {\n        return set.add(p, t);\n    }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return set.relookupOrAdd(p, l, t);\n    }\n\n    typedef typename HashSetImpl::Range Range;\n    Range all() const {\n        return set.all();\n    }\n\n    typedef typename HashSetImpl::Enum Enum;\n\n    void clear() {\n        set.clear();\n    }\n\n    void finish() {\n        set.finish();\n    }\n\n    bool empty() const {\n        return set.empty();\n    }\n\n    uint32_t count() const {\n        return set.count();\n    }\n\n    size_t capacity() const {\n        return set.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return set.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return set.has(l);\n    }\n\n    bool put(const T &t) {\n        return set.put(t);\n    }\n\n    bool putNew(const T &t) {\n        return set.putNew(t);\n    }\n\n    void remove(const Lookup &l) {\n        set.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashSetRooter(const AutoHashSetRooter &hmr) MOZ_DELETE;\n    AutoHashSetRooter &operator=(const AutoHashSetRooter &hmr) MOZ_DELETE;\n\n    HashSetImpl set;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoValueVector : public AutoVectorRooter<Value>\n{\n  public:\n    explicit AutoValueVector(JSContext *cx\n                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<Value>(cx, VALVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoIdVector : public AutoVectorRooter<jsid>\n{\n  public:\n    explicit AutoIdVector(JSContext *cx\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<jsid>(cx, IDVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoObjectVector : public AutoVectorRooter<JSObject *>\n{\n  public:\n    explicit AutoObjectVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoFunctionVector : public AutoVectorRooter<JSFunction *>\n{\n  public:\n    explicit AutoFunctionVector(JSContext *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoFunctionVector(js::ContextFriendFields *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoScriptVector : public AutoVectorRooter<JSScript *>\n{\n  public:\n    explicit AutoScriptVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * Cutsom rooting behavior for internal and external clients.\n */\nclass JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter\n{\n  public:\n    template <typename CX>\n    explicit CustomAutoRooter(CX *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, CUSTOM)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  protected:\n    /* Supplied by derived class to trace roots. */\n    virtual void trace(JSTracer *trc) = 0;\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Returns true if |v| is considered an acceptable this-value. */\ntypedef bool (*IsAcceptableThis)(const Value &v);\n\n/*\n * Implements the guts of a method; guaranteed to be provided an acceptable\n * this-value, as determined by a corresponding IsAcceptableThis method.\n */\ntypedef bool (*NativeImpl)(JSContext *cx, CallArgs args);\n\nnamespace detail {\n\n/* DON'T CALL THIS DIRECTLY.  It's for use only by CallNonGenericMethod! */\nextern JS_PUBLIC_API(bool)\nCallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n\n} /* namespace detail */\n\n/*\n * Methods usually act upon |this| objects only from a single global object and\n * compartment.  Sometimes, however, a method must act upon |this| values from\n * multiple global objects or compartments.  In such cases the |this| value a\n * method might see will be wrapped, such that various access to the object --\n * to its class, its private data, its reserved slots, and so on -- will not\n * work properly without entering that object's compartment.  This method\n * implements a solution to this problem.\n *\n * To implement a method that accepts |this| values from multiple compartments,\n * define two functions.  The first function matches the IsAcceptableThis type\n * and indicates whether the provided value is an acceptable |this| for the\n * method; it must be a pure function only of its argument.\n *\n *   static JSClass AnswerClass = { ... };\n *\n *   static bool\n *   IsAnswerObject(const Value &v)\n *   {\n *       if (!v.isObject())\n *           return false;\n *       return JS_GetClass(&v.toObject()) == &AnswerClass;\n *   }\n *\n * The second function implements the NativeImpl signature and defines the\n * behavior of the method when it is provided an acceptable |this| value.\n * Aside from some typing niceties -- see the CallArgs interface for details --\n * its interface is the same as that of JSNative.\n *\n *   static bool\n *   answer_getAnswer_impl(JSContext *cx, JS::CallArgs args)\n *   {\n *       args.rval().setInt32(42);\n *       return true;\n *   }\n *\n * The implementation function is guaranteed to be called *only* with a |this|\n * value which is considered acceptable.\n *\n * Now to implement the actual method, write a JSNative that calls the method\n * declared below, passing the appropriate template and runtime arguments.\n *\n *   static JSBool\n *   answer_getAnswer(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *       return JS::CallNonGenericMethod<IsAnswerObject, answer_getAnswer_impl>(cx, args);\n *   }\n *\n * Note that, because they are used as template arguments, the predicate\n * and implementation functions must have external linkage. (This is\n * unfortunate, but GCC wasn't inlining things as one would hope when we\n * passed them as function arguments.)\n *\n * JS::CallNonGenericMethod will test whether |args.thisv()| is acceptable.  If\n * it is, it will call the provided implementation function, which will return\n * a value and indicate success.  If it is not, it will attempt to unwrap\n * |this| and call the implementation function on the unwrapped |this|.  If\n * that succeeds, all well and good.  If it doesn't succeed, a TypeError will\n * be thrown.\n *\n * Note: JS::CallNonGenericMethod will only work correctly if it's called in\n *       tail position in a JSNative.  Do not call it from any other place.\n */\ntemplate<IsAcceptableThis Test, NativeImpl Impl>\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\n}  /* namespace JS */\n\n/************************************************************************/\n\n/* JSClass operation signatures. */\n\n/*\n * Add or get a property named by id in obj.  Note the jsid id type -- id may\n * be a string (Unicode property identifier) or an int (element index).  The\n * *vp out parameter, on success, is the new property value after the action.\n */\ntypedef JSBool\n(* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Set a property named by id in obj, treating the assignment as strict\n * mode code if strict is true. Note the jsid id type -- id may be a string\n * (Unicode property identifier) or an int (element index). The *vp out\n * parameter, on success, is the new property value after the\n * set.\n */\ntypedef JSBool\n(* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Delete a property named by id in obj.\n *\n * If an error occurred, return false as per normal JSAPI error practice.\n *\n * If no error occurred, but the deletion attempt wasn't allowed (perhaps\n * because the property was non-configurable), set *succeeded to false and\n * return true.  This will cause |delete obj[id]| to evaluate to false in\n * non-strict mode code, and to throw a TypeError in strict mode code.\n *\n * If no error occurred and the deletion wasn't disallowed (this is *not* the\n * same as saying that a deletion actually occurred -- deleting a non-existent\n * property, or an inherited property, is allowed -- it's just pointless),\n * set *succeeded to true and return true.\n */\ntypedef JSBool\n(* JSDeletePropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);\n\n/*\n * This function type is used for callbacks that enumerate the properties of\n * a JSObject.  The behavior depends on the value of enum_op:\n *\n *  JSENUMERATE_INIT\n *    A new, opaque iterator state should be allocated and stored in *statep.\n *    (You can use PRIVATE_TO_JSVAL() to tag the pointer to be stored).\n *\n *    The number of properties that will be enumerated should be returned as\n *    an integer jsval in *idp, if idp is non-null, and provided the number of\n *    enumerable properties is known.  If idp is non-null and the number of\n *    enumerable properties can't be computed in advance, *idp should be set\n *    to JSVAL_ZERO.\n *\n *  JSENUMERATE_INIT_ALL\n *    Used identically to JSENUMERATE_INIT, but exposes all properties of the\n *    object regardless of enumerability.\n *\n *  JSENUMERATE_NEXT\n *    A previously allocated opaque iterator state is passed in via statep.\n *    Return the next jsid in the iteration using *idp.  The opaque iterator\n *    state pointed at by statep is destroyed and *statep is set to JSVAL_NULL\n *    if there are no properties left to enumerate.\n *\n *  JSENUMERATE_DESTROY\n *    Destroy the opaque iterator state previously allocated in *statep by a\n *    call to this function when enum_op was JSENUMERATE_INIT or\n *    JSENUMERATE_INIT_ALL.\n *\n * The return value is used to indicate success, with a value of JS_FALSE\n * indicating failure.\n */\ntypedef JSBool\n(* JSNewEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,\n                     JS::MutableHandle<JS::Value> statep, JS::MutableHandleId idp);\n\n/*\n * The old-style JSClass.enumerate op should define all lazy properties not\n * yet reflected in obj.\n */\ntypedef JSBool\n(* JSEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/*\n * Resolve a lazy property named by id in obj by defining it directly in obj.\n * Lazy properties are those reflected from some peer native property space\n * (e.g., the DOM attributes for a given node reflected as obj) on demand.\n *\n * JS looks for a property in an object, and if not found, tries to resolve\n * the given id.  If resolve succeeds, the engine looks again in case resolve\n * defined obj[id].  If no such property exists directly in obj, the process\n * is repeated with obj's prototype, etc.\n *\n * NB: JSNewResolveOp provides a cheaper way to resolve lazy properties.\n */\ntypedef JSBool\n(* JSResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\n/*\n * Like JSResolveOp, but flags provide contextual information as follows:\n *\n *  JSRESOLVE_ASSIGNING   obj[id] is on the left-hand side of an assignment\n *\n * The *objp out parameter, on success, should be null to indicate that id\n * was not resolved; and non-null, referring to obj or one of its prototypes,\n * if id was resolved.  The hook may assume *objp is null on entry.\n *\n * This hook instead of JSResolveOp is called via the JSClass.resolve member\n * if JSCLASS_NEW_RESOLVE is set in JSClass.flags.\n */\ntypedef JSBool\n(* JSNewResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,\n                   JS::MutableHandleObject objp);\n\n/*\n * Convert obj to the given type, returning true with the resulting value in\n * *vp on success, and returning false on error or exception.\n */\ntypedef JSBool\n(* JSConvertOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n                JS::MutableHandle<JS::Value> vp);\n\ntypedef struct JSFreeOp JSFreeOp;\n\nstruct JSFreeOp {\n  private:\n    JSRuntime   *runtime_;\n\n  protected:\n    JSFreeOp(JSRuntime *rt)\n      : runtime_(rt) { }\n\n  public:\n    JSRuntime *runtime() const {\n        return runtime_;\n    }\n};\n\n/*\n * Finalize obj, which the garbage collector has determined to be unreachable\n * from other live objects or from GC roots.  Obviously, finalizers must never\n * store a reference to obj.\n */\ntypedef void\n(* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);\n\n/*\n * Finalizes external strings created by JS_NewExternalString.\n */\ntypedef struct JSStringFinalizer JSStringFinalizer;\n\nstruct JSStringFinalizer {\n    void (*finalize)(const JSStringFinalizer *fin, jschar *chars);\n};\n\n/*\n * JSClass.checkAccess type: check whether obj[id] may be accessed per mode,\n * returning false on error/exception, true on success with obj[id]'s last-got\n * value in *vp, and its attributes in *attrsp.  As for JSPropertyOp above, id\n * is either a string or an int jsval.\n */\ntypedef JSBool\n(* JSCheckAccessOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                    JSAccessMode mode, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Check whether v is an instance of obj.  Return false on error or exception,\n * true on success with JS_TRUE in *bp if v is an instance of obj, JS_FALSE in\n * *bp otherwise.\n */\ntypedef JSBool\n(* JSHasInstanceOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,\n                    JSBool *bp);\n\n/*\n * Function type for trace operation of the class called to enumerate all\n * traceable things reachable from obj's private data structure. For each such\n * thing, a trace implementation must call one of the JS_Call*Tracer variants\n * on the thing.\n *\n * JSTraceOp implementation can assume that no other threads mutates object\n * state. It must not change state of the object or corresponding native\n * structures. The only exception for this rule is the case when the embedding\n * needs a tight integration with GC. In that case the embedding can check if\n * the traversal is a part of the marking phase through calling\n * JS_IsGCMarkingTracer and apply a special code like emptying caches or\n * marking its native structures.\n */\ntypedef void\n(* JSTraceOp)(JSTracer *trc, JSObject *obj);\n\n/*\n * Callback that JSTraceOp implementation can provide to return a string\n * describing the reference traced with JS_CallTracer.\n */\ntypedef void\n(* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);\n\ntypedef JSObject *\n(* JSWeakmapKeyDelegateOp)(JSObject *obj);\n\n/* Callbacks and their arguments. */\n\ntypedef enum JSContextOp {\n    JSCONTEXT_NEW,\n    JSCONTEXT_DESTROY\n} JSContextOp;\n\n/*\n * The possible values for contextOp when the runtime calls the callback are:\n *   JSCONTEXT_NEW      JS_NewContext successfully created a new JSContext\n *                      instance. The callback can initialize the instance as\n *                      required. If the callback returns false, the instance\n *                      will be destroyed and JS_NewContext returns null. In\n *                      this case the callback is not called again.\n *   JSCONTEXT_DESTROY  One of JS_DestroyContext* methods is called. The\n *                      callback may perform its own cleanup and must always\n *                      return true.\n *   Any other value    For future compatibility the callback must do nothing\n *                      and return true in this case.\n */\ntypedef JSBool\n(* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data);\n\ntypedef enum JSGCStatus {\n    JSGC_BEGIN,\n    JSGC_END\n} JSGCStatus;\n\ntypedef void\n(* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data);\n\ntypedef enum JSFinalizeStatus {\n    /*\n     * Called when preparing to sweep a group of compartments, before anything\n     * has been swept.  The collector will not yield to the mutator before\n     * calling the callback with JSFINALIZE_GROUP_END status.\n     */\n    JSFINALIZE_GROUP_START,\n\n    /*\n     * Called when preparing to sweep a group of compartments. Weak references\n     * to unmarked things have been removed and things that are not swept\n     * incrementally have been finalized at this point.  The collector may yield\n     * to the mutator after this point.\n     */\n    JSFINALIZE_GROUP_END,\n\n    /*\n     * Called at the end of collection when everything has been swept.\n     */\n    JSFINALIZE_COLLECTION_END\n} JSFinalizeStatus;\n\ntypedef void\n(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment);\n\n/*\n * Generic trace operation that calls JS_CallTracer on each traceable thing\n * stored in data.\n */\ntypedef void\n(* JSTraceDataOp)(JSTracer *trc, void *data);\n\ntypedef JSBool\n(* JSOperationCallback)(JSContext *cx);\n\ntypedef void\n(* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);\n\n#ifdef MOZ_TRACE_JSCALLS\ntypedef void\n(* JSFunctionCallback)(const JSFunction *fun,\n                       const JSScript *scr,\n                       const JSContext *cx,\n                       int entering);\n#endif\n\n/*\n * Possible exception types. These types are part of a JSErrorFormatString\n * structure. They define which error to throw in case of a runtime error.\n * JSEXN_NONE marks an unthrowable error.\n */\ntypedef enum JSExnType {\n    JSEXN_NONE = -1,\n      JSEXN_ERR,\n        JSEXN_INTERNALERR,\n        JSEXN_EVALERR,\n        JSEXN_RANGEERR,\n        JSEXN_REFERENCEERR,\n        JSEXN_SYNTAXERR,\n        JSEXN_TYPEERR,\n        JSEXN_URIERR,\n        JSEXN_LIMIT\n} JSExnType;\n\ntypedef struct JSErrorFormatString {\n    /* The error format string in ASCII. */\n    const char *format;\n\n    /* The number of arguments to expand in the formatted error message. */\n    uint16_t argCount;\n\n    /* One of the JSExnType constants above. */\n    int16_t exnType;\n} JSErrorFormatString;\n\ntypedef const JSErrorFormatString *\n(* JSErrorCallback)(void *userRef, const char *locale,\n                    const unsigned errorNumber);\n\ntypedef JSBool\n(* JSLocaleToUpperCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToLowerCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleCompare)(JSContext *cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,\n                    JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandle<JS::Value> rval);\n\n/*\n * Security protocol types.\n */\n\ntypedef void\n(* JSDestroyPrincipalsOp)(JSPrincipals *principals);\n\n/*\n * Used to check if a CSP instance wants to disable eval() and friends.\n * See js_CheckCSPPermitsJSAction() in jsobj.\n */\ntypedef JSBool\n(* JSCSPEvalChecker)(JSContext *cx);\n\n/*\n * Callback used to ask the embedding for the cross compartment wrapper handler\n * that implements the desired prolicy for this kind of object in the\n * destination compartment. |obj| is the object to be wrapped. If |existing| is\n * non-NULL, it will point to an existing wrapper object that should be re-used\n * if possible. |existing| is guaranteed to be a cross-compartment wrapper with\n * a lazily-defined prototype and the correct global. It is guaranteed not to\n * wrap a function.\n */\ntypedef JSObject *\n(* JSWrapObjectCallback)(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj,\n                         JS::HandleObject proto, JS::HandleObject parent,\n                         unsigned flags);\n\n/*\n * Callback used by the wrap hook to ask the embedding to prepare an object\n * for wrapping in a context. This might include unwrapping other wrappers\n * or even finding a more suitable object for the new compartment.\n */\ntypedef JSObject *\n(* JSPreWrapCallback)(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj,\n                      unsigned flags);\n\n/*\n * Callback used when wrapping determines that the underlying object is already\n * in the compartment for which it is being wrapped. This allows consumers to\n * maintain same-compartment wrapping invariants.\n *\n * |obj| is guaranteed to be same-compartment as |cx|, but it may (or may not)\n * be a security or cross-compartment wrapper. This is an unfortunate contract,\n * but is important for to avoid unnecessarily recomputing every cross-\n * compartment wrapper that gets passed to wrap.\n */\ntypedef JSObject *\n(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JS::HandleObject obj);\n\ntypedef void\n(* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);\n\ntypedef void\n(* JSCompartmentNameCallback)(JSRuntime *rt, JSCompartment *compartment,\n                              char *buf, size_t bufsize);\n\n/*\n * Read structured data from the reader r. This hook is used to read a value\n * previously serialized by a call to the WriteStructuredCloneOp hook.\n *\n * tag and data are the pair of uint32_t values from the header. The callback\n * may use the JS_Read* APIs to read any other relevant parts of the object\n * from the reader r. closure is any value passed to the JS_ReadStructuredClone\n * function. Return the new object on success, NULL on error/exception.\n */\ntypedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,\n                                           uint32_t tag, uint32_t data, void *closure);\n\n/*\n * Structured data serialization hook. The engine can write primitive values,\n * Objects, Arrays, Dates, RegExps, TypedArrays, and ArrayBuffers. Any other\n * type of object requires application support. This callback must first use\n * the JS_WriteUint32Pair API to write an object header, passing a value\n * greater than JS_SCTAG_USER to the tag parameter. Then it can use the\n * JS_Write* APIs to write any other relevant parts of the value v to the\n * writer w. closure is any value passed to the JS_WriteStructuredCLone function.\n *\n * Return true on success, false on error/exception.\n */\ntypedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,\n                                         JS::Handle<JSObject*> obj, void *closure);\n\n/*\n * This is called when JS_WriteStructuredClone is given an invalid transferable.\n * To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException\n * with error set to one of the JS_SCERR_* values.\n */\ntypedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);\n\n/************************************************************************/\n\n/*\n * JS constants. For efficiency, prefer predicates (e.g. v.isNull()) and\n * constructing values from scratch (e.g. Int32Value(0)).  These constants are\n * stored in memory and initialized at startup, so testing against them and\n * using them requires memory loads and will be correspondingly slow.\n */\nextern JS_PUBLIC_DATA(const jsval) JSVAL_NULL;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ZERO;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ONE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_FALSE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_TRUE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_VOID;\n\nstatic JS_ALWAYS_INLINE jsval\nJS_NumberValue(double d)\n{\n    int32_t i;\n    d = JS::CanonicalizeNaN(d);\n    if (mozilla::DoubleIsInt32(d, &i))\n        return INT_TO_JSVAL(i);\n    return DOUBLE_TO_JSVAL(d);\n}\n\n/************************************************************************/\n\n/*\n * A jsid is an identifier for a property or method of an object which is\n * either a 31-bit signed integer, interned string or object.  Also, there is\n * an additional jsid value, JSID_VOID, which does not occur in JS scripts but\n * may be used to indicate the absence of a valid jsid.\n *\n * A jsid is not implicitly convertible to or from a jsval; JS_ValueToId or\n * JS_IdToValue must be used instead.\n */\n\n#define JSID_TYPE_STRING                 0x0\n#define JSID_TYPE_INT                    0x1\n#define JSID_TYPE_VOID                   0x2\n#define JSID_TYPE_OBJECT                 0x4\n#define JSID_TYPE_MASK                   0x7\n\n/*\n * Avoid using canonical 'id' for jsid parameters since this is a magic word in\n * Objective-C++ which, apparently, wants to be able to #include jsapi.h.\n */\n#define id iden\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_STRING(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJSID_TO_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSString *)JSID_BITS(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ZERO(jsid id)\n{\n    return JSID_BITS(id) == 0;\n}\n\nJS_PUBLIC_API(JSBool)\nJS_StringHasBeenInterned(JSContext *cx, JSString *str);\n\n/*\n * Only JSStrings that have been interned via the JSAPI can be turned into\n * jsids by API clients.\n *\n * N.B. if a jsid is backed by a string which has not been interned, that\n * string must be appropriately rooted to avoid being collected by the GC.\n */\nJS_PUBLIC_API(jsid)\nINTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_INT(jsid id)\n{\n    return !!(JSID_BITS(id) & JSID_TYPE_INT);\n}\n\nstatic JS_ALWAYS_INLINE int32_t\nJSID_TO_INT(jsid id)\n{\n    JS_ASSERT(JSID_IS_INT(id));\n    return ((uint32_t)JSID_BITS(id)) >> 1;\n}\n\n#define JSID_INT_MIN  0\n#define JSID_INT_MAX  INT32_MAX\n\nstatic JS_ALWAYS_INLINE JSBool\nINT_FITS_IN_JSID(int32_t i)\n{\n    return i >= 0;\n}\n\nstatic JS_ALWAYS_INLINE jsid\nINT_TO_JSID(int32_t i)\n{\n    jsid id;\n    JS_ASSERT(INT_FITS_IN_JSID(i));\n    JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_OBJECT(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT &&\n           (size_t)JSID_BITS(id) != JSID_TYPE_OBJECT;\n}\n\nstatic JS_ALWAYS_INLINE JSObject *\nJSID_TO_OBJECT(jsid id)\n{\n    JS_ASSERT(JSID_IS_OBJECT(id));\n    return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\nstatic JS_ALWAYS_INLINE jsid\nOBJECT_TO_JSID(JSObject *obj)\n{\n    jsid id;\n    JS_ASSERT(obj != NULL);\n    JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);\n    JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_GCTHING(jsid id)\n{\n    return JSID_IS_STRING(id) || JSID_IS_OBJECT(id);\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSID_TO_GCTHING(jsid id)\n{\n    return (void *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\n/*\n * A void jsid is not a valid id and only arises as an exceptional API return\n * value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into\n * JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in\n * hooks receiving a jsid except when explicitly noted in the API contract.\n */\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_VOID(const jsid id)\n{\n    JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,\n                 JSID_BITS(id) == JSID_TYPE_VOID);\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_EMPTY(const jsid id)\n{\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);\n}\n\n#undef id\n\n#ifdef JS_USE_JSID_STRUCT_TYPES\nextern JS_PUBLIC_DATA(const jsid) JSID_VOID;\nextern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;\n#else\n# define JSID_VOID ((jsid)JSID_TYPE_VOID)\n# define JSID_EMPTY ((jsid)JSID_TYPE_OBJECT)\n#endif\n\n/*\n * Returns true iff the given jsval is immune to GC and can be used across\n * multiple JSRuntimes without requiring any conversion API.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_UNIVERSAL(jsval v)\n{\n    return !JSVAL_IS_GCTHING(v);\n}\n\nnamespace JS {\n\nclass AutoIdRooter : private AutoGCRooter\n{\n  public:\n    explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, ID), id_(aId)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    jsid id() {\n        return id_;\n    }\n\n    jsid * addr() {\n        return &id_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    jsid id_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n} /* namespace JS */\n\n/************************************************************************/\n\n/* Property attributes, set in JSPropertySpec and passed to API functions. */\n#define JSPROP_ENUMERATE        0x01    /* property is visible to for/in loop */\n#define JSPROP_READONLY         0x02    /* not settable: assignment is no-op.\n                                           This flag is only valid when neither\n                                           JSPROP_GETTER nor JSPROP_SETTER is\n                                           set. */\n#define JSPROP_PERMANENT        0x04    /* property cannot be deleted */\n#define JSPROP_NATIVE_ACCESSORS 0x08    /* set in JSPropertyDescriptor.flags\n                                           if getters/setters are JSNatives */\n#define JSPROP_GETTER           0x10    /* property holds getter function */\n#define JSPROP_SETTER           0x20    /* property holds setter function */\n#define JSPROP_SHARED           0x40    /* don't allocate a value slot for this\n                                           property; don't copy the property on\n                                           set of the same-named property in an\n                                           object that delegates to a prototype\n                                           containing this property */\n#define JSPROP_INDEX            0x80    /* name is actually (int) index */\n#define JSPROP_SHORTID         0x100    /* set in JS_DefineProperty attrs\n                                           if getters/setters use a shortid */\n\n#define JSFUN_STUB_GSOPS       0x200    /* use JS_PropertyStub getter/setter\n                                           instead of defaulting to class gsops\n                                           for property holding function */\n\n#define JSFUN_CONSTRUCTOR      0x400    /* native that can be called as a ctor */\n\n\n/*\n * Specify a generic native prototype methods, i.e., methods of a class\n * prototype that are exposed as static methods taking an extra leading\n * argument: the generic |this| parameter.\n *\n * If you set this flag in a JSFunctionSpec struct's flags initializer, then\n * that struct must live at least as long as the native static method object\n * created due to this flag by JS_DefineFunctions or JS_InitClass.  Typically\n * JSFunctionSpec structs are allocated in static arrays.\n */\n#define JSFUN_GENERIC_NATIVE   0x800\n\n#define JSFUN_FLAGS_MASK       0xe00    /* | of all the JSFUN_* flags */\n\n/*\n * The first call to JS_CallOnce by any thread in a process will call 'func'.\n * Later calls to JS_CallOnce with the same JSCallOnceType object will be\n * suppressed.\n *\n * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce\n * to invoke its JSInitCallback.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CallOnce(JSCallOnceType *once, JSInitCallback func);\n\n/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */\nextern JS_PUBLIC_API(int64_t)\nJS_Now(void);\n\n/* Don't want to export data, so provide accessors for non-inline jsvals. */\nextern JS_PUBLIC_API(jsval)\nJS_GetNaNValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetNegativeInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetPositiveInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetEmptyStringValue(JSContext *cx);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetEmptyString(JSRuntime *rt);\n\n/*\n * Format is a string of the following characters (spaces are insignificant),\n * specifying the tabulated type conversions:\n *\n *   b      JSBool          Boolean\n *   c      uint16_t/jschar ECMA uint16_t, Unicode char\n *   i      int32_t         ECMA int32_t\n *   u      uint32_t        ECMA uint32_t\n *   j      int32_t         Rounded int32_t (coordinate)\n *   d      double          IEEE double\n *   I      double          Integral IEEE double\n *   S      JSString *      Unicode string, accessed by a JSString pointer\n *   W      jschar *        Unicode character vector, 0-terminated (W for wide)\n *   o      JSObject *      Object reference\n *   f      JSFunction *    Function private\n *   v      jsval           Argument value (no conversion)\n *   *      N/A             Skip this argument (no vararg)\n *   /      N/A             End of required arguments\n *\n * The variable argument list after format must consist of &b, &c, &s, e.g.,\n * where those variables have the types given above.  For the pointer types\n * char *, JSString *, and JSObject *, the pointed-at memory returned belongs\n * to the JS runtime, not to the calling native code.  The runtime promises\n * to keep this memory valid so long as argv refers to allocated stack space\n * (so long as the native function is active).\n *\n * Fewer arguments than format specifies may be passed only if there is a /\n * in format after the last required argument specifier and argc is at least\n * the number of required arguments.  More arguments than format specifies\n * may be passed without error; it is up to the caller to deal with trailing\n * unconverted arguments.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format,\n                    ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv,\n                      const char *format, va_list ap);\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToObject(JSContext *cx, jsval v, JSObject **objp);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToFunction(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToConstructor(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToString(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToSource(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToNumber(JSContext *cx, jsval v, double *dp);\n\nnamespace js {\n/*\n * DO NOT CALL THIS.  Use JS::ToNumber\n */\nextern JS_PUBLIC_API(bool)\nToNumberSlow(JSContext *cx, JS::Value v, double *dp);\n\n/*\n * DO NOT CALL THIS. Use JS::ToBoolean\n */\nextern JS_PUBLIC_API(bool)\nToBooleanSlow(const JS::Value &v);\n} /* namespace js */\n\nnamespace JS {\n\n/* ES5 9.3 ToNumber. */\nJS_ALWAYS_INLINE bool\nToNumber(JSContext *cx, HandleValue v, double *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    {\n        js::SkipRoot root(cx, &v);\n        js::MaybeCheckStackRoots(cx);\n    }\n\n    if (v.isNumber()) {\n        *out = v.toNumber();\n        return true;\n    }\n    return js::ToNumberSlow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToBoolean(const Value &v)\n{\n    if (v.isBoolean())\n        return v.toBoolean();\n    if (v.isInt32())\n        return v.toInt32() != 0;\n    if (v.isNullOrUndefined())\n        return false;\n    if (v.isDouble()) {\n        double d = v.toDouble();\n        return !mozilla::IsNaN(d) && d != 0;\n    }\n\n    /* The slow path handles strings and objects. */\n    return js::ToBooleanSlow(v);\n}\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_DoubleIsInt32(double d, int32_t *ip);\n\nextern JS_PUBLIC_API(int32_t)\nJS_DoubleToInt32(double d);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_DoubleToUint32(double d);\n\n/*\n * Convert a value to a number, then to an int32_t, according to the ECMA rules\n * for ToInt32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * Convert a value to a number, then to an int64_t, according to the WebIDL\n * rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt64(JSContext *cx, jsval v, int64_t *ip);\n\n/*\n * Convert a value to a number, then to an uint64_t, according to the WebIDL\n * rules for ToUint64: http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint64(JSContext *cx, jsval v, uint64_t *ip);\n\nnamespace js {\n/* DO NOT CALL THIS.  Use JS::ToInt16. */\nextern JS_PUBLIC_API(bool)\nToUint16Slow(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToInt32. */\nextern JS_PUBLIC_API(bool)\nToInt32Slow(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToUint32. */\nextern JS_PUBLIC_API(bool)\nToUint32Slow(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToInt64. */\nextern JS_PUBLIC_API(bool)\nToInt64Slow(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToUint64. */\nextern JS_PUBLIC_API(bool)\nToUint64Slow(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out);\n} /* namespace js */\n\nnamespace JS {\n\nJS_ALWAYS_INLINE bool\nToUint16(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint16_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint16Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt32(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = v.toInt32();\n        return true;\n    }\n    return js::ToInt32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint32(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint32_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt64(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = int64_t(v.toInt32());\n        return true;\n    }\n\n    return js::ToInt64Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint64(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        /* Account for sign extension of negatives into the longer 64bit space. */\n        *out = uint64_t(int64_t(v.toInt32()));\n        return true;\n    }\n\n    return js::ToUint64Slow(cx, v, out);\n}\n\n\n} /* namespace JS */\n\n/*\n * Convert a value to a number, then to a uint32_t, according to the ECMA rules\n * for ToUint32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);\n\n/*\n * Convert a value to a number, then to an int32_t if it fits by rounding to\n * nearest; but failing with an error report if the double is out of range\n * or unordered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * ECMA ToUint16, for mapping a jsval to a Unicode point.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(JSType)\nJS_TypeOfValue(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTypeName(JSContext *cx, JSType type);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same);\n\n/* True iff fun is the global eval function. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinEvalFunction(JSFunction *fun);\n\n/* True iff fun is the Function constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinFunctionConstructor(JSFunction *fun);\n\n/************************************************************************/\n\n/*\n * Initialization, locking, contexts, and memory allocation.\n *\n * It is important that the first runtime and first context be created in a\n * single-threaded fashion, otherwise the behavior of the library is undefined.\n * See: http://developer.mozilla.org/en/docs/Category:JSAPI_Reference\n */\n\ntypedef enum JSUseHelperThreads\n{\n    JS_NO_HELPER_THREADS,\n    JS_USE_HELPER_THREADS\n} JSUseHelperThreads;\n\n/**\n * Initialize SpiderMonkey, returning true only if initialization succeeded.\n * Once this method has succeeded, it is safe to call JS_NewRuntime and other\n * JSAPI methods.\n *\n * This method must be called before any other JSAPI method is used on any\n * thread.  Once it has been used, it is safe to call any JSAPI method, and it\n * remains safe to do so until JS_ShutDown is correctly called.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_Init(void);\n\n/**\n * Destroy free-standing resources allocated by SpiderMonkey, not associated\n * with any runtime, context, or other structure.\n *\n * This method should be called after all other JSAPI data has been properly\n * cleaned up: every new runtime must have been destroyed, every new context\n * must have been destroyed, and so on.  Calling this method before all other\n * resources have been destroyed has undefined behavior.\n *\n * Failure to call this method, at present, has no adverse effects other than\n * leaking memory.  This may not always be the case; it's recommended that all\n * embedders call this method when all other JSAPI operations have completed.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(void)\nJS_ShutDown(void);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_NewRuntime(uint32_t maxbytes, JSUseHelperThreads useHelperThreads);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyRuntime(JSRuntime *rt);\n\n// These are equivalent to ICU's |UMemAllocFn|, |UMemReallocFn|, and\n// |UMemFreeFn| types.  The first argument (called |context| in the ICU docs)\n// will always be NULL, and should be ignored.\ntypedef void *(*JS_ICUAllocFn)(const void *, size_t size);\ntypedef void *(*JS_ICUReallocFn)(const void *, void *p, size_t size);\ntypedef void (*JS_ICUFreeFn)(const void *, void *p);\n\n// This function can be used to track memory used by ICU.\n// Do not use it unless you know what you are doing!\nextern JS_PUBLIC_API(bool)\nJS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn, JS_ICUReallocFn reallocFn, JS_ICUFreeFn freeFn);\n\nJS_PUBLIC_API(void *)\nJS_GetRuntimePrivate(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nJS_PUBLIC_API(void)\nJS_SetRuntimePrivate(JSRuntime *rt, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_BeginRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_EndRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsInRequest(JSRuntime *rt);\n\nnamespace JS {\n\ninline bool\nIsPoisonedId(jsid iden)\n{\n    if (JSID_IS_STRING(iden))\n        return JS::IsPoisonedPtr(JSID_TO_STRING(iden));\n    if (JSID_IS_OBJECT(iden))\n        return JS::IsPoisonedPtr(JSID_TO_OBJECT(iden));\n    return false;\n}\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <> struct GCMethods<jsid>\n{\n    static jsid initial() { return JSID_VOID; }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(jsid id) { return JS::IsPoisonedId(id); }\n    static bool needsPostBarrier(jsid id) { return false; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(jsid *idp) {}\n    static void relocate(jsid *idp) {}\n#endif\n};\n\n} /* namespace js */\n\nclass JSAutoRequest\n{\n  public:\n    JSAutoRequest(JSContext *cx\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mContext(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_BeginRequest(mContext);\n    }\n    ~JSAutoRequest() {\n        JS_EndRequest(mContext);\n    }\n\n  protected:\n    JSContext *mContext;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n#if 0\n  private:\n    static void *operator new(size_t) CPP_THROW_NEW { return 0; };\n    static void operator delete(void *, size_t) { };\n#endif\n};\n\nclass JSAutoCheckRequest\n{\n  public:\n    JSAutoCheckRequest(JSContext *cx\n                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n#if defined JS_THREADSAFE && defined DEBUG\n        mContext = cx;\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));\n#endif\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoCheckRequest() {\n#if defined JS_THREADSAFE && defined DEBUG\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(mContext)));\n#endif\n    }\n\n\n  private:\n#if defined JS_THREADSAFE && defined DEBUG\n    JSContext *mContext;\n#endif\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback, void *data);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_NewContext(JSRuntime *rt, size_t stackChunkSize);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContext(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContextNoGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void *)\nJS_GetContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetSecondContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetSecondContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_ContextIterator(JSRuntime *rt, JSContext **iterp);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetVersion(JSContext *cx);\n\n// Mutate the version on the compartment. This is generally discouraged, but\n// necessary to support the version mutation in the js and xpc shell command\n// set.\n//\n// It would be nice to put this in jsfriendapi, but the linkage requirements\n// of the shells make that impossible.\nJS_PUBLIC_API(void)\nJS_SetVersionForCompartment(JSCompartment *compartment, JSVersion version);\n\nextern JS_PUBLIC_API(const char *)\nJS_VersionToString(JSVersion version);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_StringToVersion(const char *string);\n\n/*\n * JS options are orthogonal to version, and may be freely composed with one\n * another as well as with version.\n *\n * JSOPTION_VAROBJFIX is recommended -- see the comments associated with the\n * prototypes for JS_ExecuteScript, JS_EvaluateScript, etc.\n */\n#define JSOPTION_EXTRA_WARNINGS JS_BIT(0)       /* warn on dubious practices */\n#define JSOPTION_WERROR         JS_BIT(1)       /* convert warning to error */\n#define JSOPTION_VAROBJFIX      JS_BIT(2)       /* make JS_EvaluateScript use\n                                                   the last object on its 'obj'\n                                                   param's scope chain as the\n                                                   ECMA 'variables object' */\n#define JSOPTION_PRIVATE_IS_NSISUPPORTS \\\n                                JS_BIT(3)       /* context private data points\n                                                   to an nsISupports subclass */\n#define JSOPTION_COMPILE_N_GO   JS_BIT(4)       /* caller of JS_Compile*Script\n                                                   promises to execute compiled\n                                                   script once only; enables\n                                                   compile-time scope chain\n                                                   resolution of consts. */\n\n/* JS_BIT(5) is currently unused. */\n\n/* JS_BIT(6) is currently unused. */\n\n/* JS_BIT(7) is currently unused. */\n\n#define JSOPTION_DONT_REPORT_UNCAUGHT                                   \\\n                                JS_BIT(8)       /* When returning from the\n                                                   outermost API call, prevent\n                                                   uncaught exceptions from\n                                                   being converted to error\n                                                   reports */\n\n/* JS_BIT(9) is currently unused. */\n\n/* JS_BIT(10) is currently unused. */\n\n/* JS_BIT(11) is currently unused. */\n\n#define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12)      /* A promise to the compiler\n                                                   that a null rval out-param\n                                                   will be passed to each call\n                                                   to JS_ExecuteScript. */\n#define JSOPTION_UNROOTED_GLOBAL JS_BIT(13)     /* The GC will not root the\n                                                   contexts' default compartment\n                                                   object, leaving that up to the\n                                                   embedding. */\n\n#define JSOPTION_BASELINE       JS_BIT(14)      /* Baseline compiler. */\n\n#define JSOPTION_TYPE_INFERENCE JS_BIT(16)      /* Perform type inference. */\n#define JSOPTION_STRICT_MODE    JS_BIT(17)      /* Provides a way to force\n                                                   strict mode for all code\n                                                   without requiring\n                                                   \"use strict\" annotations. */\n\n#define JSOPTION_ION            JS_BIT(18)      /* IonMonkey */\n\n#define JSOPTION_ASMJS          JS_BIT(19)      /* optimizingasm.js compiler */\n\n#define JSOPTION_MASK           JS_BITMASK(20)\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetOptions(JSContext *cx);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_SetOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_ToggleOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(void)\nJS_SetJitHardening(JSRuntime *rt, JSBool enabled);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetImplementationVersion(void);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentNameCallback(JSRuntime *rt, JSCompartmentNameCallback callback);\n\nextern JS_PUBLIC_API(JSWrapObjectCallback)\nJS_SetWrapObjectCallbacks(JSRuntime *rt,\n                          JSWrapObjectCallback callback,\n                          JSSameCompartmentWrapObjectCallback sccallback,\n                          JSPreWrapCallback precallback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentPrivate(JSCompartment *compartment, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetCompartmentPrivate(JSCompartment *compartment);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapObject(JSContext *cx, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapValue(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapId(JSContext *cx, jsid *idp);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_TransplantObject(JSContext *cx, JS::HandleObject origobj, JS::HandleObject target);\n\nextern JS_FRIEND_API(JSObject *)\njs_TransplantObjectWithWrapper(JSContext *cx,\n                               JS::HandleObject origobj,\n                               JS::HandleObject origwrapper,\n                               JS::HandleObject targetobj,\n                               JS::HandleObject targetwrapper);\n\nextern JS_PUBLIC_API(JSBool)\nJS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob);\n\n/*\n * At any time, a JSContext has a current (possibly-NULL) compartment.\n * Compartments are described in:\n *\n *   developer.mozilla.org/en-US/docs/SpiderMonkey/SpiderMonkey_compartments\n *\n * The current compartment of a context may be changed. The preferred way to do\n * this is with JSAutoCompartment:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in some compartment 'c'\n *     {\n *       JSAutoCompartment ac(cx, obj);  // constructor enters\n *       // in the compartment of 'obj'\n *     }                                 // destructor leaves\n *     // back in compartment 'c'\n *   }\n *\n * For more complicated uses that don't neatly fit in a C++ stack frame, the\n * compartment can entered and left using separate function calls:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in 'oldCompartment'\n *     JSCompartment *oldCompartment = JS_EnterCompartment(cx, obj);\n *     // in the compartment of 'obj'\n *     JS_LeaveCompartment(cx, oldCompartment);\n *     // back in 'oldCompartment'\n *   }\n *\n * Note: these calls must still execute in a LIFO manner w.r.t all other\n * enter/leave calls on the context. Furthermore, only the return value of a\n * JS_EnterCompartment call may be passed as the 'oldCompartment' argument of\n * the corresponding JS_LeaveCompartment call.\n */\n\nclass JS_PUBLIC_API(JSAutoCompartment)\n{\n    JSContext *cx_;\n    JSCompartment *oldCompartment_;\n  public:\n    JSAutoCompartment(JSContext *cx, JSObject *target);\n    JSAutoCompartment(JSContext *cx, JSScript *target);\n    ~JSAutoCompartment();\n};\n\n/* NB: This API is infallible; a NULL return value does not indicate error. */\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartment(JSContext *cx, JSObject *target);\n\nextern JS_PUBLIC_API(void)\nJS_LeaveCompartment(JSContext *cx, JSCompartment *oldCompartment);\n\ntypedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);\n\n/*\n * This function calls |compartmentCallback| on every compartment.  Beware that\n * there is no guarantee that the compartment will survive after the callback\n * returns.\n */\nextern JS_PUBLIC_API(void)\nJS_IterateCompartments(JSRuntime *rt, void *data,\n                       JSIterateCompartmentCallback compartmentCallback);\n\n/*\n * Initialize standard JS class constructors, prototypes, and any top-level\n * functions and constants associated with the standard classes (e.g. isNaN\n * for Number).\n *\n * NB: This sets cx's global object to obj if it was null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitStandardClasses(JSContext *cx, JSObject *obj);\n\n/*\n * Resolve id, which must contain either a string or an int, to a standard\n * class name in obj if possible, defining the class's constructor and/or\n * prototype and storing true in *resolved.  If id does not name a standard\n * class or a top-level property induced by initializing a standard class,\n * store false in *resolved and just return true.  Return false on error,\n * as usual for JSBool result-typed API entry points.\n *\n * This API can be called directly from a global object class's resolve op,\n * to define standard classes lazily.  The class's enumerate op should call\n * JS_EnumerateStandardClasses(cx, obj), to define eagerly during for..in\n * loops any classes not yet resolved lazily.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStandardClass(JSContext *cx, JS::HandleObject obj, JS::HandleId id,\n                        JSBool *resolved);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStandardClasses(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSProtoKey)\nJS_IdentifyClassPrototype(JSContext *cx, JSObject *obj);\n\n/*\n * Returns the original value of |Function.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Object.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetObjectPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Array.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetArrayPrototype(JSContext *cx, JSObject *forObj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGlobalObject(JSObject *obj);\n\n/*\n * May return NULL, if |c| never had a global (e.g. the atoms compartment), or\n * if |c|'s global has been collected.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForCompartmentOrNull(JSContext *cx, JSCompartment *c);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(JSObject *)\nCurrentGlobalOrNull(JSContext *cx);\n\n}\n\n/*\n * This method returns the global corresponding to the most recent scripted\n * frame, which may not match the cx's current compartment. This is extremely\n * dangerous, because it can bypass compartment security invariants in subtle\n * ways. To use it safely, the caller must perform a subsequent security\n * check. There is currently only one consumer of this function in Gecko, and\n * it should probably stay that way. If you'd like to use it, please consult\n * the XPConnect module owner first.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetScriptedGlobal(JSContext *cx);\n\n/*\n * Initialize the 'Reflect' object on a global object.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_InitReflect(JSContext *cx, JSObject *global);\n\n#ifdef JS_HAS_CTYPES\n/*\n * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'\n * object will be sealed.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitCTypesClass(JSContext *cx, JSObject *global);\n\n/*\n * Convert a unicode string 'source' of length 'slen' to the platform native\n * charset, returning a null-terminated string allocated with JS_malloc. On\n * failure, this function should report an error.\n */\ntypedef char *\n(* JSCTypesUnicodeToNativeFun)(JSContext *cx, const jschar *source, size_t slen);\n\n/*\n * Set of function pointers that ctypes can use for various internal functions.\n * See JS_SetCTypesCallbacks below. Providing NULL for a function is safe,\n * and will result in the applicable ctypes functionality not being available.\n */\nstruct JSCTypesCallbacks {\n    JSCTypesUnicodeToNativeFun unicodeToNative;\n};\n\ntypedef struct JSCTypesCallbacks JSCTypesCallbacks;\n\n/*\n * Set the callbacks on the provided 'ctypesObj' object. 'callbacks' should be a\n * pointer to static data that exists for the lifetime of 'ctypesObj', but it\n * may safely be altered after calling this function and without having\n * to call this function again.\n */\nextern JS_PUBLIC_API(void)\nJS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);\n#endif\n\ntypedef JSBool\n(* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);\n\n/*\n * Enumerate memory regions that contain diagnostic information\n * intended to be included in crash report minidumps.\n */\nextern JS_PUBLIC_API(void)\nJS_EnumerateDiagnosticMemoryRegions(JSEnumerateDiagnosticMemoryCallback callback);\n\nextern JS_PUBLIC_API(void *)\nJS_malloc(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(void *)\nJS_realloc(JSContext *cx, void *p, size_t nbytes);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization.\n * cx may be NULL.\n */\nextern JS_PUBLIC_API(void)\nJS_free(JSContext *cx, void *p);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization as specified by the given JSFreeOp instance.\n */\nextern JS_PUBLIC_API(void)\nJS_freeop(JSFreeOp *fop, void *p);\n\nextern JS_PUBLIC_API(JSFreeOp *)\nJS_GetDefaultFreeOp(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_updateMallocCounter(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSContext *cx, const char *s);\n\n/* Duplicate a string.  Does not report an error on failure. */\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSRuntime *rt, const char *s);\n\n\n/*\n * A GC root is a pointer to a jsval, JSObject * or JSString * that itself\n * points into the GC heap. JS_AddValueRoot takes a pointer to a jsval and\n * JS_AddGCThingRoot takes a pointer to a JSObject * or JString *.\n *\n * Note that, since JS_Add*Root stores the address of a variable (of type\n * jsval, JSString *, or JSObject *), that variable must live until\n * JS_Remove*Root is called to remove that variable. For example, after:\n *\n *   void some_function() {\n *     jsval v;\n *     JS_AddNamedValueRoot(cx, &v, \"name\");\n *\n * the caller must perform\n *\n *     JS_RemoveValueRoot(cx, &v);\n *\n * before some_function() returns.\n *\n * Also, use JS_AddNamed*Root(cx, &structPtr->memberObj, \"structPtr->memberObj\")\n * in preference to JS_Add*Root(cx, &structPtr->memberObj), in order to identify\n * roots by their source callsites.  This way, you can find the callsite while\n * debugging if you should fail to do JS_Remove*Root(cx, &structPtr->memberObj)\n * before freeing structPtr's memory.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddObjectRoot(JSContext *cx, JSObject **rp);\n\n#ifdef NAME_ALL_GC_ROOTS\n#define JS_DEFINE_TO_TOKEN(def) #def\n#define JS_DEFINE_TO_STRING(def) JS_DEFINE_TO_TOKEN(def)\n#define JS_AddValueRoot(cx,vp) JS_AddNamedValueRoot((cx), (vp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddStringRoot(cx,rp) JS_AddNamedStringRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddObjectRoot(cx,rp) JS_AddNamedObjectRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRoot(JSContext *cx, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRoot(JSContext *cx, JSScript **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRootRT(JSRuntime *rt, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRootRT(JSRuntime *rt, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);\n\n/* TODO: remove these APIs */\n\nextern JS_FRIEND_API(void)\njs_RemoveRoot(JSRuntime *rt, void *rp);\n\n/*\n * C-compatible version of the Anchor class. It should be called after the last\n * use of the variable it protects.\n */\nextern JS_NEVER_INLINE JS_PUBLIC_API(void)\nJS_AnchorPtr(void *p);\n\n/*\n * Register externally maintained GC roots.\n *\n * traceOp: the trace operation. For each root the implementation should call\n *          JS_CallTracer whenever the root contains a traceable thing.\n * data:    the data argument to pass to each invocation of traceOp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/* Undo a call to JS_AddExtraGCRootsTracer. */\nextern JS_PUBLIC_API(void)\nJS_RemoveExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/*\n * JS_CallTracer API and related macros for implementors of JSTraceOp, to\n * enumerate all references to traceable things reachable via a property or\n * other strong ref identified for debugging purposes by name or index or\n * a naming callback.\n *\n * See the JSTraceOp typedef.\n */\n\n/*\n * Use the following macros to check if a particular jsval is a traceable\n * thing and to extract the thing and its kind to pass to JS_CallTracer.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_TRACEABLE(jsval v)\n{\n    return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSVAL_TO_TRACEABLE(jsval v)\n{\n    return JSVAL_TO_GCTHING(v);\n}\n\nstatic JS_ALWAYS_INLINE JSGCTraceKind\nJSVAL_TRACE_KIND(jsval v)\n{\n    JS_ASSERT(JSVAL_IS_GCTHING(v));\n    return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/*\n * Tracer callback, called for each traceable thing directly referenced by a\n * particular object or runtime structure. It is the callback responsibility\n * to ensure the traversal of the full object graph via calling eventually\n * JS_TraceChildren on the passed thing. In this case the callback must be\n * prepared to deal with cycles in the traversal graph.\n *\n * kind argument is one of JSTRACE_OBJECT, JSTRACE_STRING or a tag denoting\n * internal implementation-specific traversal kind. In the latter case the only\n * operations on thing that the callback can do is to call JS_TraceChildren or\n * JS_GetTraceThingInfo.\n *\n * If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all\n * of its mappings.  This should be used in cases where the tracer\n * wants to use the existing liveness of entries.\n */\ntypedef void\n(* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);\n\nenum WeakMapTraceKind {\n    DoNotTraceWeakMaps = 0,\n    TraceWeakMapValues = 1,\n    TraceWeakMapKeysValues = 2\n};\n\nstruct JSTracer {\n    JSRuntime           *runtime;\n    JSTraceCallback     callback;\n    JSTraceNamePrinter  debugPrinter;\n    const void          *debugPrintArg;\n    size_t              debugPrintIndex;\n    WeakMapTraceKind    eagerlyTraceWeakMaps;\n#ifdef JS_GC_ZEAL\n    void                *realLocation;\n#endif\n};\n\n/*\n * Set debugging information about a reference to a traceable thing to prepare\n * for the following call to JS_CallTracer.\n *\n * When printer is null, arg must be const char * or char * C string naming\n * the reference and index must be either (size_t)-1 indicating that the name\n * alone describes the reference or it must be an index into some array vector\n * that stores the reference.\n *\n * When printer callback is not null, the arg and index arguments are\n * available to the callback as debugPrintArg and debugPrintIndex fields\n * of JSTracer.\n *\n * The storage for name or callback's arguments needs to live only until\n * the following call to JS_CallTracer returns.\n */\n# define JS_SET_TRACING_DETAILS(trc, printer, arg, index)                     \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->debugPrinter = (printer);                                      \\\n        (trc)->debugPrintArg = (arg);                                         \\\n        (trc)->debugPrintIndex = (index);                                     \\\n    JS_END_MACRO\n\n/*\n * Sets the real location for a marked reference, when passing the address\n * directly is not feasable.\n *\n * FIXME: This is currently overcomplicated by our need to nest calls for Values\n * stored as keys in hash tables, but will get simplified once we can rekey\n * in-place.\n */\n#ifdef JS_GC_ZEAL\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n        if (!(trc)->realLocation || !(location))                              \\\n            (trc)->realLocation = (location);                                 \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->realLocation = NULL;                                           \\\n    JS_END_MACRO\n#else\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n#endif\n\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string\n * and index.\n */\n# define JS_SET_TRACING_INDEX(trc, name, index)                               \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, index)\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string.\n */\n# define JS_SET_TRACING_NAME(trc, name)                                       \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, (size_t)-1)\n\n/*\n * The JS_Call*Tracer family of functions traces the given GC thing reference.\n * This performs the tracing action configured on the given JSTracer:\n * typically calling the JSTracer::callback or marking the thing as live.\n *\n * The argument to JS_Call*Tracer is an in-out param: when the function\n * returns, the garbage collector might have moved the GC thing. In this case,\n * the reference passed to JS_Call*Tracer will be updated to the object's new\n * location. Callers of this method are responsible for updating any state\n * that is dependent on the object's address. For example, if the object's\n * address is used as a key in a hashtable, then the object must be removed\n * and re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(void)\nJS_CallValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);\n\ntemplate <typename HashSetEnum>\ninline void\nJS_CallHashSetObjectTracer(JSTracer *trc, HashSetEnum &e, JSObject *const &key, const char *name)\n{\n    JSObject *updated = key;\n    JS_SET_TRACING_LOCATION(trc, reinterpret_cast<void *>(&const_cast<JSObject *&>(key)));\n    JS_CallObjectTracer(trc, &updated, name);\n    if (updated != key)\n        e.rekeyFront(key, updated);\n}\n\n/*\n * Trace an object that is known to always be tenured.  No post barriers are\n * required in this case.\n */\nextern JS_PUBLIC_API(void)\nJS_CallTenuredObjectTracer(JSTracer *trc, JS::TenuredHeap<JSObject *> *objp, const char *name);\n\n/*\n * API for JSTraceCallback implementations.\n */\nextern JS_PUBLIC_API(void)\nJS_TracerInit(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);\n\nextern JS_PUBLIC_API(void)\nJS_TraceRuntime(JSTracer *trc);\n\nextern JS_PUBLIC_API(void)\nJS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc,\n                     void *thing, JSGCTraceKind kind, JSBool includeDetails);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize);\n\n#ifdef DEBUG\n\n/*\n * DEBUG-only method to dump the object graph of heap-allocated things.\n *\n * fp:              file for the dump output.\n * start:           when non-null, dump only things reachable from start\n *                  thing. Otherwise dump all things reachable from the\n *                  runtime roots.\n * startKind:       trace kind of start if start is not null. Must be\n *                  JSTRACE_OBJECT when start is null.\n * thingToFind:     dump only paths in the object graph leading to thingToFind\n *                  when non-null.\n * maxDepth:        the upper bound on the number of edges to descend from the\n *                  graph roots.\n * thingToIgnore:   thing to ignore during the graph traversal when non-null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind,\n            void *thingToFind, size_t maxDepth, void *thingToIgnore);\n\n#endif\n\n/*\n * Garbage collector API.\n */\nextern JS_PUBLIC_API(void)\nJS_GC(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_MaybeGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCCallback(JSRuntime *rt, JSGCCallback cb, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGCMarkingTracer(JSTracer *trc);\n\n/*\n * JS_IsAboutToBeFinalized checks if the given object is going to be finalized\n * at the end of the current GC. When called outside of the context of a GC,\n * this function will return false. Typically this function is used on weak\n * references, where the reference should be nulled out or destroyed if the\n * given object is about to be finalized.\n *\n * The argument to JS_IsAboutToBeFinalized is an in-out param: when the\n * function returns false, the object being referenced is still alive, but the\n * garbage collector might have moved it. In this case, the reference passed\n * to JS_IsAboutToBeFinalized will be updated to the object's new location.\n * Callers of this method are responsible for updating any state that is\n * dependent on the object's address. For example, if the object's address is\n * used as a key in a hashtable, then the object must be removed and\n * re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalized(JS::Heap<JSObject *> *objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalizedUnbarriered(JSObject **objp);\n\ntypedef enum JSGCParamKey {\n    /* Maximum nominal heap before last ditch GC. */\n    JSGC_MAX_BYTES          = 0,\n\n    /* Number of JS_malloc bytes before last ditch GC. */\n    JSGC_MAX_MALLOC_BYTES   = 1,\n\n    /* Amount of bytes allocated by the GC. */\n    JSGC_BYTES = 3,\n\n    /* Number of times when GC was invoked. */\n    JSGC_NUMBER = 4,\n\n    /* Max size of the code cache in bytes. */\n    JSGC_MAX_CODE_CACHE_BYTES = 5,\n\n    /* Select GC mode. */\n    JSGC_MODE = 6,\n\n    /* Number of cached empty GC chunks. */\n    JSGC_UNUSED_CHUNKS = 7,\n\n    /* Total number of allocated GC chunks. */\n    JSGC_TOTAL_CHUNKS = 8,\n\n    /* Max milliseconds to spend in an incremental GC slice. */\n    JSGC_SLICE_TIME_BUDGET = 9,\n\n    /* Maximum size the GC mark stack can grow to. */\n    JSGC_MARK_STACK_LIMIT = 10,\n\n    /*\n     * GCs less than this far apart in time will be considered 'high-frequency GCs'.\n     * See setGCLastBytes in jsgc.cpp.\n     */\n    JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11,\n\n    /* Start of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_LOW_LIMIT = 12,\n\n    /* End of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_HIGH_LIMIT = 13,\n\n    /* Upper bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX = 14,\n\n    /* Lower bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN = 15,\n\n    /* Heap growth for low frequency GCs. */\n    JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16,\n\n    /*\n     * If false, the heap growth factor is fixed at 3. If true, it is determined\n     * based on whether GCs are high- or low- frequency.\n     */\n    JSGC_DYNAMIC_HEAP_GROWTH = 17,\n\n    /* If true, high-frequency GCs will use a longer mark slice. */\n    JSGC_DYNAMIC_MARK_SLICE = 18,\n\n    /* Number of megabytes of analysis data to allocate before purging. */\n    JSGC_ANALYSIS_PURGE_TRIGGER = 19,\n\n    /* Lower limit after which we limit the heap growth. */\n    JSGC_ALLOCATION_THRESHOLD = 20,\n\n    /*\n     * We decommit memory lazily. If more than this number of megabytes is\n     * available to be decommitted, then JS_MaybeGC will trigger a shrinking GC\n     * to decommit it.\n     */\n    JSGC_DECOMMIT_THRESHOLD = 21\n} JSGCParamKey;\n\ntypedef enum JSGCMode {\n    /* Perform only global GCs. */\n    JSGC_MODE_GLOBAL = 0,\n\n    /* Perform per-compartment GCs until too much garbage has accumulated. */\n    JSGC_MODE_COMPARTMENT = 1,\n\n    /*\n     * Collect in short time slices rather than all at once. Implies\n     * JSGC_MODE_COMPARTMENT.\n     */\n    JSGC_MODE_INCREMENTAL = 2\n} JSGCMode;\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);\n\n/*\n * Create a new JSString whose chars member refers to external memory, i.e.,\n * memory requiring application-specific finalization.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewExternalString(JSContext *cx, const jschar *chars, size_t length,\n                     const JSStringFinalizer *fin);\n\n/*\n * Return whether 'str' was created with JS_NewExternalString or\n * JS_NewExternalStringWithClosure.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExternalString(JSString *str);\n\n/*\n * Return the 'closure' arg passed to JS_NewExternalStringWithClosure or NULL\n * if the external string was created via JS_NewExternalString.\n */\nextern JS_PUBLIC_API(const JSStringFinalizer *)\nJS_GetExternalStringFinalizer(JSString *str);\n\n/*\n * Set the size of the native stack that should not be exceed. To disable\n * stack size checking pass 0.\n */\nextern JS_PUBLIC_API(void)\nJS_SetNativeStackQuota(JSRuntime *cx, size_t stackSize);\n\n/************************************************************************/\n\n/*\n * Classes, objects, and properties.\n */\ntypedef void (*JSClassInternal)();\n\nstruct JSClass {\n    const char          *name;\n    uint32_t            flags;\n\n    /* Mandatory function pointer members. */\n    JSPropertyOp        addProperty;\n    JSDeletePropertyOp  delProperty;\n    JSPropertyOp        getProperty;\n    JSStrictPropertyOp  setProperty;\n    JSEnumerateOp       enumerate;\n    JSResolveOp         resolve;\n    JSConvertOp         convert;\n\n    /* Optional members (may be null). */\n    JSFinalizeOp        finalize;\n    JSCheckAccessOp     checkAccess;\n    JSNative            call;\n    JSHasInstanceOp     hasInstance;\n    JSNative            construct;\n    JSTraceOp           trace;\n\n    void                *reserved[40];\n};\n\n#define JSCLASS_HAS_PRIVATE             (1<<0)  /* objects have private slot */\n#define JSCLASS_NEW_ENUMERATE           (1<<1)  /* has JSNewEnumerateOp hook */\n#define JSCLASS_NEW_RESOLVE             (1<<2)  /* has JSNewResolveOp hook */\n#define JSCLASS_PRIVATE_IS_NSISUPPORTS  (1<<3)  /* private is (nsISupports *) */\n#define JSCLASS_IS_DOMJSCLASS           (1<<4)  /* objects are DOM */\n#define JSCLASS_IMPLEMENTS_BARRIERS     (1<<5)  /* Correctly implements GC read\n                                                   and write barriers */\n#define JSCLASS_EMULATES_UNDEFINED      (1<<6)  /* objects of this class act\n                                                   like the value undefined,\n                                                   in some contexts */\n#define JSCLASS_USERBIT1                (1<<7)  /* Reserved for embeddings. */\n\n/*\n * To reserve slots fetched and stored via JS_Get/SetReservedSlot, bitwise-or\n * JSCLASS_HAS_RESERVED_SLOTS(n) into the initializer for JSClass.flags, where\n * n is a constant in [1, 255].  Reserved slots are indexed from 0 to n-1.\n */\n#define JSCLASS_RESERVED_SLOTS_SHIFT    8       /* room for 8 flags below */\n#define JSCLASS_RESERVED_SLOTS_WIDTH    8       /* and 16 above this field */\n#define JSCLASS_RESERVED_SLOTS_MASK     JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)\n#define JSCLASS_HAS_RESERVED_SLOTS(n)   (((n) & JSCLASS_RESERVED_SLOTS_MASK)  \\\n                                         << JSCLASS_RESERVED_SLOTS_SHIFT)\n#define JSCLASS_RESERVED_SLOTS(clasp)   (((clasp)->flags                      \\\n                                          >> JSCLASS_RESERVED_SLOTS_SHIFT)    \\\n                                         & JSCLASS_RESERVED_SLOTS_MASK)\n\n#define JSCLASS_HIGH_FLAGS_SHIFT        (JSCLASS_RESERVED_SLOTS_SHIFT +       \\\n                                         JSCLASS_RESERVED_SLOTS_WIDTH)\n\n#define JSCLASS_IS_ANONYMOUS            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))\n#define JSCLASS_IS_GLOBAL               (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))\n#define JSCLASS_INTERNAL_FLAG2          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))\n#define JSCLASS_INTERNAL_FLAG3          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))\n\n/* Indicate whether the proto or ctor should be frozen. */\n#define JSCLASS_FREEZE_PROTO            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))\n#define JSCLASS_FREEZE_CTOR             (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))\n\n/* Reserved for embeddings. */\n#define JSCLASS_USERBIT2                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))\n#define JSCLASS_USERBIT3                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))\n\n#define JSCLASS_BACKGROUND_FINALIZE     (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))\n\n/*\n * Bits 26 through 31 are reserved for the CACHED_PROTO_KEY mechanism, see\n * below.\n */\n\n/* Global flags. */\n#define JSGLOBAL_FLAGS_CLEARED          0x1\n\n/*\n * ECMA-262 requires that most constructors used internally create objects\n * with \"the original Foo.prototype value\" as their [[Prototype]] (__proto__)\n * member initial value.  The \"original ... value\" verbiage is there because\n * in ECMA-262, global properties naming class objects are read/write and\n * deleteable, for the most part.\n *\n * Implementing this efficiently requires that global objects have classes\n * with the following flags. Failure to use JSCLASS_GLOBAL_FLAGS was\n * prevously allowed, but is now an ES5 violation and thus unsupported.\n */\n#define JSCLASS_GLOBAL_SLOT_COUNT      (JSProto_LIMIT * 3 + 25)\n#define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n)                                    \\\n    (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))\n#define JSCLASS_GLOBAL_FLAGS                                                  \\\n    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)\n#define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp)                              \\\n  (((clasp)->flags & JSCLASS_IS_GLOBAL)                                       \\\n   && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)\n\n/* Fast access to the original value of each standard class's prototype. */\n#define JSCLASS_CACHED_PROTO_SHIFT      (JSCLASS_HIGH_FLAGS_SHIFT + 10)\n#define JSCLASS_CACHED_PROTO_WIDTH      6\n#define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)\n#define JSCLASS_HAS_CACHED_PROTO(key)   (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)\n#define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey)                         \\\n                                         (((clasp)->flags                     \\\n                                           >> JSCLASS_CACHED_PROTO_SHIFT)     \\\n                                          & JSCLASS_CACHED_PROTO_MASK))\n\n/* Initializer for unused members of statically initialized JSClass structs. */\n#define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n#define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS\n\nextern JS_PUBLIC_API(int)\nJS_IdArrayLength(JSContext *cx, JSIdArray *ida);\n\nextern JS_PUBLIC_API(jsid)\nJS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyIdArray(JSContext *cx, JSIdArray *ida);\n\nnamespace JS {\n\nclass AutoIdArray : private AutoGCRooter\n{\n  public:\n    AutoIdArray(JSContext *cx, JSIdArray *ida\n                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, IDARRAY), context(cx), idArray(ida)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~AutoIdArray() {\n        if (idArray)\n            JS_DestroyIdArray(context, idArray);\n    }\n    bool operator!() {\n        return !idArray;\n    }\n    jsid operator[](size_t i) const {\n        JS_ASSERT(idArray);\n        JS_ASSERT(i < length());\n        return JS_IdArrayGet(context, idArray, i);\n    }\n    size_t length() const {\n        return JS_IdArrayLength(context, idArray);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n    JSIdArray *steal() {\n        JSIdArray *copy = idArray;\n        idArray = NULL;\n        return copy;\n    }\n\n  protected:\n    inline void trace(JSTracer *trc);\n\n  private:\n    JSContext *context;\n    JSIdArray *idArray;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* No copy or assignment semantics. */\n    AutoIdArray(AutoIdArray &ida) MOZ_DELETE;\n    void operator=(AutoIdArray &ida) MOZ_DELETE;\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToId(JSContext *cx, jsval v, jsid *idp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IdToValue(JSContext *cx, jsid id, jsval *vp);\n\n/*\n * JSNewResolveOp flag bits.\n */\n#define JSRESOLVE_ASSIGNING     0x01    /* resolve on the left of assignment */\n\n/*\n * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on\n * the specified object, computing a primitive default value for the object.\n * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On\n * success the resulting value is stored in *vp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictPropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                      JSBool *succeeded);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStub(JSContext *cx, JS::Handle<JSObject*> obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertStub(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n               JS::MutableHandle<JS::Value> vp);\n\nstruct JSConstDoubleSpec {\n    double          dval;\n    const char      *name;\n    uint8_t         flags;\n    uint8_t         spare[3];\n};\n\ntypedef struct JSJitInfo JSJitInfo;\n\n/*\n * Wrappers to replace {Strict,}PropertyOp for JSPropertySpecs. This will allow\n * us to pass one JSJitInfo per function with the property spec, without\n * additional field overhead.\n */\ntypedef struct JSStrictPropertyOpWrapper {\n    JSStrictPropertyOp  op;\n    const JSJitInfo     *info;\n} JSStrictPropertyOpWrapper;\n\ntypedef struct JSPropertyOpWrapper {\n    JSPropertyOp        op;\n    const JSJitInfo     *info;\n} JSPropertyOpWrapper;\n\n/*\n * Wrapper to do as above, but for JSNatives for JSFunctionSpecs.\n */\ntypedef struct JSNativeWrapper {\n    JSNative        op;\n    const JSJitInfo *info;\n} JSNativeWrapper;\n\n/*\n * Macro static initializers which make it easy to pass no JSJitInfo as part of a\n * JSPropertySpec or JSFunctionSpec.\n */\n#define JSOP_WRAPPER(op) {op, NULL}\n#define JSOP_NULLWRAPPER JSOP_WRAPPER(NULL)\n\n/*\n * To define an array element rather than a named property member, cast the\n * element's index to (const char *) and initialize name with it, and set the\n * JSPROP_INDEX bit in flags.\n */\nstruct JSPropertySpec {\n    const char                  *name;\n    int8_t                      tinyid;\n    uint8_t                     flags;\n    JSPropertyOpWrapper         getter;\n    JSStrictPropertyOpWrapper   setter;\n};\n\nnamespace JS {\nnamespace detail {\n\n/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_NATIVE_TO only. */\ninline int CheckIsNative(JSNative native);\n\n} // namespace detail\n} // namespace JS\n\n#define JS_CAST_NATIVE_TO(v, To) \\\n  (static_cast<void>(sizeof(JS::detail::CheckIsNative(v))), \\\n   reinterpret_cast<To>(v))\n\n/*\n * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function\n * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be\n * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform\n * type-safe casts.\n */\n#define JS_PSG(name, getter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_NULLWRAPPER}\n#define JS_PSGS(name, getter, setter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(setter, JSStrictPropertyOp))}\n#define JS_PS_END {0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\n/*\n * To define a native function, set call to a JSNativeWrapper. To define a\n * self-hosted function, set selfHostedName to the name of a function\n * compiled during JSRuntime::initSelfHosting.\n */\nstruct JSFunctionSpec {\n    const char      *name;\n    JSNativeWrapper call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *selfHostedName;\n};\n\n/*\n * Terminating sentinel initializer to put at the end of a JSFunctionSpec array\n * that's passed to JS_DefineFunctions or JS_InitClass.\n */\n#define JS_FS_END JS_FS(NULL,NULL,0,0)\n\n/*\n * Initializer macros for a JSFunctionSpec array element. JS_FN (whose name\n * pays homage to the old JSNative/JSFastNative split) simply adds the flag\n * JSFUN_STUB_GSOPS. JS_FNINFO allows the simple adding of JSJitInfos.\n */\n#define JS_FS(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, flags}\n#define JS_FN(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, (flags) | JSFUN_STUB_GSOPS}\n#define JS_FNINFO(name,call,info,nargs,flags)                                 \\\n    {name,{call,info},nargs,flags}\n\nextern JS_PUBLIC_API(JSObject *)\nJS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n             JSClass *clasp, JSNative constructor, unsigned nargs,\n             const JSPropertySpec *ps, const JSFunctionSpec *fs,\n             const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\n/*\n * Set up ctor.prototype = proto and proto.constructor = ctor with the\n * right property flags.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);\n\nextern JS_PUBLIC_API(JSClass *)\nJS_GetClass(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(void *)\nJS_GetPrivate(JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_SetPrivate(JSObject *obj, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp,\n                      jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> protop);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<JSObject*> proto);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParent(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetConstructor(JSContext *cx, JSObject *proto);\n\n/*\n * Get a unique identifier for obj, good for the lifetime of obj (even if it\n * is moved by a copying GC).  Return false on failure (likely out of memory),\n * and true with *idp containing the unique id on success.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);\n\nnamespace JS {\n\nenum {\n    FreshZone,\n    SystemZone,\n    SpecificZones\n};\n\ntypedef uintptr_t ZoneSpecifier;\n\ninline ZoneSpecifier\nSameZoneAs(JSObject *obj)\n{\n    JS_ASSERT(uintptr_t(obj) > SpecificZones);\n    return ZoneSpecifier(obj);\n}\n\nstruct JS_PUBLIC_API(CompartmentOptions) {\n    ZoneSpecifier zoneSpec;\n    JSVersion version;\n    bool invisibleToDebugger;\n\n    explicit CompartmentOptions() : zoneSpec(JS::FreshZone)\n                                  , version(JSVERSION_UNKNOWN)\n                                  , invisibleToDebugger(false)\n    {}\n\n    CompartmentOptions &setZone(ZoneSpecifier spec) { zoneSpec = spec; return *this; }\n    CompartmentOptions &setVersion(JSVersion version_) {\n        JS_ASSERT(version_ != JSVERSION_UNKNOWN);\n        version = version_;\n        return *this;\n    }\n\n    // Certain scopes (i.e. XBL compilation scopes) are implementation details\n    // of the embedding, and references to them should never leak out to script.\n    // This flag causes the this compartment to skip firing onNewGlobalObject\n    // and makes addDebuggee a no-op for this global.\n    CompartmentOptions &setInvisibleToDebugger(bool invisible) {\n        invisibleToDebugger = invisible;\n        return *this;\n    }\n};\n\n// During global creation, we fire notifications to callbacks registered\n// via the Debugger API. These callbacks are arbitrary script, and can touch\n// the global in arbitrary ways. When that happens, the global should not be\n// in a half-baked state. But this creates a problem for consumers that need\n// to set slots on the global to put it in a consistent state.\n//\n// This API provides a way for consumers to set slots atomically (immediately\n// after the global is created), before any debugger hooks are fired. It's\n// unfortunately on the clunky side, but that's the way the cookie crumbles.\n//\n// If callers have no additional state on the global to set up, they may pass\n// |FireOnNewGlobalHook| to JS_NewGlobalObject, which causes that function to\n// fire the hook as its final act before returning. Otherwise, callers should\n// pass |DontFireOnNewGlobalHook|, which means that they are responsible for\n// invoking JS_FireOnNewGlobalObject upon successfully creating the global. If\n// an error occurs and the operation aborts, callers should skip firing the\n// hook. But otherwise, callers must take care to fire the hook exactly once\n// before compiling any script in the global's scope (we have assertions in\n// place to enforce this). This lets us be sure that debugger clients never miss\n// breakpoints.\nenum OnNewGlobalHookOption {\n    FireOnNewGlobalHook,\n    DontFireOnNewGlobalHook\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals,\n                   JS::OnNewGlobalHookOption hookOption,\n                   const JS::CompartmentOptions &options = JS::CompartmentOptions());\n\nextern JS_PUBLIC_API(void)\nJS_FireOnNewGlobalObject(JSContext *cx, JS::HandleObject global);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\n/* Queries the [[Extensible]] property of the object. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExtensible(JSContext *cx, JS::HandleObject obj, JSBool *extensible);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNative(JSObject *obj);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetObjectRuntime(JSObject *obj);\n\n/*\n * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default\n * proto if proto's actual parameter value is null.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,\n                           JSObject *parent);\n\n/*\n * Freeze obj, and all objects it refers to, recursively. This will not recurse\n * through non-extensible objects, on the assumption that those are already\n * deep-frozen.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DeepFreezeObject(JSContext *cx, JSObject *obj);\n\n/*\n * Freezes an object; see ES5's Object.freeze(obj) method.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_FreezeObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PreventExtensions(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_New(JSContext *cx, JSObject *ctor, unsigned argc, jsval *argv);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp,\n                JSObject *proto, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineConstDoubles(JSContext *cx, JSObject *obj, const JSConstDoubleSpec *cds);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,\n                  JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,\n                      JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                   const char *name,\n                                   unsigned *attrsp, JSBool *foundp,\n                                   JSPropertyOp *getterp,\n                                   JSStrictPropertyOp *setterp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,\n                                       jsid id,\n                                       unsigned *attrsp, JSBool *foundp,\n                                       JSPropertyOp *getterp,\n                                       JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned attrs, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,\n                            int8_t tinyid, jsval value,\n                            JSPropertyOp getter, JSStrictPropertyOp setter,\n                            unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,\n                         JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id,\n                             JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name,\n                           unsigned flags, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,\n                               unsigned flags, JSObject **objp, JS::MutableHandle<JS::Value> vp);\n\nstruct JSPropertyDescriptor {\n    JSObject           *obj;\n    unsigned           attrs;\n    unsigned           shortid;\n    JSPropertyOp       getter;\n    JSStrictPropertyOp setter;\n    JS::Value          value;\n\n    JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL),\n                             setter(NULL), value(JSVAL_VOID)\n    {}\n\n    void trace(JSTracer *trc);\n};\n\nnamespace JS {\n\ntemplate <typename Outer>\nclass PropertyDescriptorOperations\n{\n    const JSPropertyDescriptor * desc() const { return static_cast<const Outer*>(this)->extract(); }\n    JSPropertyDescriptor * desc() { return static_cast<Outer*>(this)->extract(); }\n\n  public:\n    bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; }\n    bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; }\n    bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; }\n    bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; }\n    bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; }\n    bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; }\n    bool isShared() const { return desc()->attrs & JSPROP_SHARED; }\n    bool isIndex() const { return desc()->attrs & JSPROP_INDEX; }\n    bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; }\n    bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; }\n\n    JS::MutableHandleObject object() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); }\n    unsigned attributes() const { return desc()->attrs; }\n    unsigned shortid() const {\n        MOZ_ASSERT(hasShortId());\n        return desc()->shortid;\n    }\n    JSPropertyOp getter() const { return desc()->getter; }\n    JSStrictPropertyOp setter() const { return desc()->setter; }\n    JS::HandleObject getterObject() const {\n        MOZ_ASSERT(hasGetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->getter));\n    }\n    JS::HandleObject setterObject() const {\n        MOZ_ASSERT(hasSetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->setter));\n    }\n    JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); }\n\n    void setAttributes(unsigned attrs) { desc()->attrs = attrs; }\n    void setShortId(unsigned id) { desc()->shortid = id; }\n    void setGetter(JSPropertyOp op) { desc()->getter = op; }\n    void setSetter(JSStrictPropertyOp op) { desc()->setter = op; }\n    void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast<JSPropertyOp>(obj); }\n    void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast<JSStrictPropertyOp>(obj); }\n};\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <>\nstruct GCMethods<JSPropertyDescriptor> {\n    static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); }\n    static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; }\n    static bool poisoned(const JSPropertyDescriptor &desc) {\n        return (desc.obj && JS::IsPoisonedPtr(desc.obj)) ||\n               (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) ||\n               (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) ||\n               (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing()));\n    }\n};\n\ntemplate <>\nclass RootedBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\ntemplate <>\nclass HandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Handle<JSPropertyDescriptor>*>(this)->address();\n    }\n  public:\n    JS::HandleValue value() const { return JS::HandleValue::fromMarkedLocation(&extract()->value); }\n    JS::HandleObject obj() const { return JS::HandleObject::fromMarkedLocation(&extract()->obj); }\n};\n\ntemplate <>\nclass MutableHandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\n} /* namespace js */\n\n/*\n * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on\n * an object on the prototype chain (returned in objp). If data->obj is null,\n * then this property was not found on the prototype chain.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags,\n                             JSPropertyDescriptor *desc);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def,\n                          JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf,\n                        JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name,\n                   JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, jsval value,\n                    JSPropertyOp getter, JSStrictPropertyOp setter,\n                    unsigned attrs);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                     const jschar *name, size_t namelen,\n                                     unsigned *attrsp, JSBool *foundp,\n                                     JSPropertyOp *getterp,\n                                     JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned attrs, JSBool *foundp);\n\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,\n                              const jschar *name, size_t namelen,\n                              int8_t tinyid, jsval value,\n                              JSPropertyOp getter, JSStrictPropertyOp setter,\n                              unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,\n                           size_t namelen, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JSBool *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen,\n                    JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteUCProperty2(JSContext *cx, JSObject *obj,\n                     const jschar *name, size_t namelen,\n                     JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayObject(JSContext *cx, int length, jsval *vector);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsArrayObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,\n                 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp);\n\n/*\n * Get the property with name given by |index|, if it has one.  If\n * not, |*present| will be set to false and the value of |vp| must not\n * be relied on.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp, JSBool* present);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);\n\n/*\n * Remove all configurable properties from the given (non-global) object and\n * assign undefined to all writable data properties.\n */\nJS_PUBLIC_API(void)\nJS_ClearNonGlobalObject(JSContext *cx, JSObject *objArg);\n\n/*\n * Assign 'undefined' to all of the object's non-reserved slots. Note: this is\n * done for all slots, regardless of the associated property descriptor.\n */\nJS_PUBLIC_API(void)\nJS_SetAllNonReservedSlotsToUndefined(JSContext *cx, JSObject *objArg);\n\n/*\n * Create a new array buffer with the given contents, which must have been\n * returned by JS_AllocateArrayBufferContents or JS_StealArrayBufferContents.\n * The new array buffer takes ownership. After calling this function, do not\n * free |contents| or use |contents| from another thread.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayBufferWithContents(JSContext *cx, void *contents);\n\n/*\n * Steal the contents of the given array buffer. The array buffer has its\n * length set to 0 and its contents array cleared. The caller takes ownership\n * of |*contents| and must free it or transfer ownership via\n * JS_NewArrayBufferWithContents when done using it.\n * To free |*contents|, call free().\n * A pointer to the buffer's data is returned in |*data|. This pointer can\n * be used until |*contents| is freed or has its ownership transferred.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents,\n                            uint8_t **data);\n\n/*\n * Allocate memory that may be eventually passed to\n * JS_NewArrayBufferWithContents. |nbytes| is the number of payload bytes\n * required. The pointer to pass to JS_NewArrayBufferWithContents is returned\n * in |contents|. The pointer to the |nbytes| of usable memory is returned in\n * |data|. (*|contents| will contain a header before |data|.) The only legal\n * operations on *|contents| is to free it, or pass it to\n * JS_NewArrayBufferWithContents or JS_ReallocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\n/*\n * Reallocate memory allocated by JS_AllocateArrayBufferContents, growing or shrinking it\n * as appropriate.  The new data pointer will be returned in data.  If *contents is NULL,\n * behaves like JS_AllocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\nextern JS_PUBLIC_API(JSIdArray *)\nJS_Enumerate(JSContext *cx, JSObject *obj);\n\n/*\n * Create an object to iterate over enumerable properties of obj, in arbitrary\n * property definition order.  NB: This differs from longstanding for..in loop\n * order, which uses order of property definition in obj.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewPropertyIterator(JSContext *cx, JSObject *obj);\n\n/*\n * Return true on success with *idp containing the id of the next enumerable\n * property to visit using iterobj, or JSID_IS_VOID if there is no such property\n * left to visit.  Return false on error.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);\n\n/*\n * A JSNative that creates and returns a new iterator that iterates over the\n * elements of |this|, up to |this.length|, in index order. This can be used to\n * make any array-like object iterable. Just give the object an obj.iterator()\n * method using this JSNative as the implementation.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,\n               jsval *vp, unsigned *attrsp);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetReservedSlot(JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(void)\nJS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v);\n\n/************************************************************************/\n\n/*\n * Security protocol.\n */\nstruct JSPrincipals {\n    /* Don't call \"destroy\"; use reference counting macros below. */\n    int refcount;\n\n#ifdef DEBUG\n    /* A helper to facilitate principals debugging. */\n    uint32_t    debugToken;\n#endif\n\n    void setDebugToken(uint32_t token) {\n# ifdef DEBUG\n        debugToken = token;\n# endif\n    }\n\n    /*\n     * This is not defined by the JS engine but should be provided by the\n     * embedding.\n     */\n    JS_PUBLIC_API(void) dump();\n};\n\nextern JS_PUBLIC_API(void)\nJS_HoldPrincipals(JSPrincipals *principals);\n\nextern JS_PUBLIC_API(void)\nJS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);\n\nstruct JSSecurityCallbacks {\n    JSCheckAccessOp            checkObjectAccess;\n    JSCSPEvalChecker           contentSecurityPolicyAllows;\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetSecurityCallbacks(JSRuntime *rt, const JSSecurityCallbacks *callbacks);\n\nextern JS_PUBLIC_API(const JSSecurityCallbacks *)\nJS_GetSecurityCallbacks(JSRuntime *rt);\n\n/*\n * Code running with \"trusted\" principals will be given a deeper stack\n * allocation than ordinary scripts. This allows trusted script to run after\n * untrusted script has exhausted the stack. This function sets the\n * runtime-wide trusted principal.\n *\n * This principals is not held (via JS_HoldPrincipals/JS_DropPrincipals) since\n * there is no available JSContext. Instead, the caller must ensure that the\n * given principals stays valid for as long as 'rt' may point to it. If the\n * principals would be destroyed before 'rt', JS_SetTrustedPrincipals must be\n * called again, passing NULL for 'prin'.\n */\nextern JS_PUBLIC_API(void)\nJS_SetTrustedPrincipals(JSRuntime *rt, JSPrincipals *prin);\n\n/*\n * Initialize the callback that is called to destroy JSPrincipals instance\n * when its reference counter drops to zero. The initialization can be done\n * only once per JS runtime.\n */\nextern JS_PUBLIC_API(void)\nJS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPrincipals);\n\n/************************************************************************/\n\n/*\n * Functions and scripts.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n               JSObject *parent, const char *name);\n\n/*\n * Create the function with the name given by the id. JSID_IS_STRING(id) must\n * be true.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                   JSObject *parent, jsid id);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionObject(JSFunction *fun);\n\n/*\n * Return the function's identifier as a JSString, or null if fun is unnamed.\n * The returned string lives as long as fun, so you don't need to root a saved\n * reference to it if fun is well-connected or rooted, and provided you bound\n * the use of the saved reference by fun's lifetime.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionId(JSFunction *fun);\n\n/*\n * Return a function's display name. This is the defined name if one was given\n * where the function was defined, or it could be an inferred name by the JS\n * engine in the case that the function was defined to be anonymous. This can\n * still return NULL if a useful display name could not be inferred. The same\n * restrictions on rooting as those in JS_GetFunctionId apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionDisplayId(JSFunction *fun);\n\n/*\n * Return the arity (length) of fun.\n */\nextern JS_PUBLIC_API(uint16_t)\nJS_GetFunctionArity(JSFunction *fun);\n\n/*\n * Infallible predicate to test whether obj is a function object (faster than\n * comparing obj's class name to \"Function\", but equivalent unless someone has\n * overwritten the \"Function\" identifier with a different constructor and then\n * created instances using that constructor that might be passed in as obj).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsFunction(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsCallable(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNativeFunction(JSObject *funobj, JSNative call);\n\n/* Return whether the given function is a valid constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsConstructor(JSFunction *fun);\n\n/*\n * Bind the given callable to use the given object as \"this\".\n *\n * If |callable| is not callable, will throw and return NULL.\n */\nextern JS_PUBLIC_API(JSObject*)\nJS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                  unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineUCFunction(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, JSNative call,\n                    unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,\n                      unsigned nargs, unsigned attrs);\n\n/*\n * Clone a top-level function into a new scope. This function will dynamically\n * fail if funobj was lexically nested inside some other function.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);\n\n/*\n * Given a buffer, return JS_FALSE if the buffer might become a valid\n * javascript statement with the addition of more lines.  Otherwise return\n * JS_TRUE.  The intent is to support interactive compilation - accumulate\n * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to\n * the compiler.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScript(JSContext *cx, JSObject *obj,\n                 const char *ascii, size_t length,\n                 const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,\n                              JSPrincipals *principals,\n                              const char *ascii, size_t length,\n                              const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScript(JSContext *cx, JSObject *obj,\n                   const jschar *chars, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals,\n                                const jschar *chars, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalFromScript(JSScript *script);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,\n                   unsigned nargs, const char **argnames,\n                   const char *bytes, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals, const char *name,\n                                unsigned nargs, const char **argnames,\n                                const char *bytes, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileUCFunction(JSContext *cx, JSObject *obj, const char *name,\n                     unsigned nargs, const char **argnames,\n                     const jschar *chars, size_t length,\n                     const char *filename, unsigned lineno);\n\nnamespace JS {\n\n/* Options for JavaScript compilation. */\nclass JS_PUBLIC_API(CompileOptions)\n{\n    JSPrincipals *principals_;\n    JSPrincipals *originPrincipals_;\n\n  public:\n    JSPrincipals *principals() const { return principals_; }\n    JSPrincipals *originPrincipals() const;\n\n    JSVersion version;\n    bool versionSet;\n    bool utf8;\n    const char *filename;\n    unsigned lineno;\n    unsigned column;\n    HandleObject element;\n    bool compileAndGo;\n    bool forEval;\n    bool noScriptRval;\n    bool selfHostingMode;\n    bool canLazilyParse;\n    bool strictOption;\n    bool extraWarningsOption;\n    bool werrorOption;\n    bool asmJSOption;\n    enum SourcePolicy {\n        NO_SOURCE,\n        LAZY_SOURCE,\n        SAVE_SOURCE\n    } sourcePolicy;\n\n    explicit CompileOptions(JSContext *cx, JSVersion version = JSVERSION_UNKNOWN);\n    CompileOptions &setPrincipals(JSPrincipals *p) { principals_ = p; return *this; }\n    CompileOptions &setOriginPrincipals(JSPrincipals *p) { originPrincipals_ = p; return *this; }\n    CompileOptions &setVersion(JSVersion v) { version = v; versionSet = true; return *this; }\n    CompileOptions &setUTF8(bool u) { utf8 = u; return *this; }\n    CompileOptions &setFileAndLine(const char *f, unsigned l) {\n        filename = f; lineno = l; return *this;\n    }\n    CompileOptions &setColumn(unsigned c) { column = c; return *this; }\n    CompileOptions &setElement(HandleObject e) { element = e; return *this; }\n    CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }\n    CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }\n    CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }\n    CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }\n    CompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }\n    CompileOptions &setSourcePolicy(SourcePolicy sp) { sourcePolicy = sp; return *this; }\n};\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, FILE *file);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, const char *filename);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const jschar *chars, size_t length);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * API extension: OR this into indent to avoid pretty-printing the decompiled\n * source resulting from JS_DecompileFunction{,Body}.\n */\n#define JS_DONT_PRETTY_PRINT    ((unsigned)0x8000)\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);\n\n/*\n * NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj\n * parameter as the initial scope chain header, the 'this' keyword value, and\n * the variables object (ECMA parlance for where 'var' and 'function' bind\n * names) of the execution context for script.\n *\n * Using obj as the variables object is problematic if obj's parent (which is\n * the scope chain link; see JS_SetParent and JS_NewObject) is not null: in\n * this case, variables created by 'var x = 0', e.g., go in obj, but variables\n * created by assignment to an unbound id, 'x = 0', go in the last object on\n * the scope chain linked by parent.\n *\n * ECMA calls that last scoping object the \"global object\", but note that many\n * embeddings have several such objects.  ECMA requires that \"global code\" be\n * executed with the variables object equal to this global object.  But these\n * JS API entry points provide freedom to execute code against a \"sub-global\",\n * i.e., a parented or scoped object, in which case the variables object will\n * differ from the last object on the scope chain, resulting in confusing and\n * non-ECMA explicit vs. implicit variable creation.\n *\n * Caveat embedders: unless you already depend on this buggy variables object\n * binding behavior, you should call JS_SetOptions(cx, JSOPTION_VAROBJFIX) or\n * JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_VAROBJFIX) -- the latter if\n * someone may have set other options on cx already -- for each context in the\n * application, if you pass parented objects as the obj parameter, or may ever\n * pass such objects in the future.\n *\n * Why a runtime option?  The alternative is to add six or so new API entry\n * points with signatures matching the following six, and that doesn't seem\n * worth the code bloat cost.  Such new entry points would probably have less\n * obvious names, too, so would not tend to be used.  The JS_SetOption call,\n * OTOH, can be more easily hacked into existing code that does not depend on\n * the bug; such code can continue to use the familiar JS_EvaluateScript,\n * etc., entry points.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,\n                        JSVersion version);\n\n/*\n * Execute either the function-defining prolog of a script, or the script's\n * main body, but not both.\n */\ntypedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart;\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScript(JSContext *cx, JSObject *obj,\n                  const char *bytes, unsigned length,\n                  const char *filename, unsigned lineno,\n                  jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,\n                               JSPrincipals *principals,\n                               const char *bytes, unsigned length,\n                               const char *filename, unsigned lineno,\n                               jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                      JSPrincipals *principals,\n                                      const char *bytes, unsigned length,\n                                      const char *filename, unsigned lineno,\n                                      jsval *rval, JSVersion version);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScript(JSContext *cx, JSObject *obj,\n                    const jschar *chars, unsigned length,\n                    const char *filename, unsigned lineno,\n                    jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                 JSPrincipals *principals,\n                                 const jschar *chars, unsigned length,\n                                 const char *filename, unsigned lineno,\n                                 jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                        JSPrincipals *principals,\n                                        const jschar *chars, unsigned length,\n                                        const char *filename, unsigned lineno,\n                                        jsval *rval, JSVersion version);\n\n/*\n * JSAPI clients may optionally specify the 'originPrincipals' of a script.\n * A script's originPrincipals may be retrieved through the debug API (via\n * JS_GetScriptOriginPrincipals) and the originPrincipals are transitively\n * assigned to any nested scripts (including scripts dynamically created via\n * eval and the Function constructor). If originPrincipals is null, then the\n * value of principals is used as origin principals for the script.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,\n                                              JSPrincipals *principals,\n                                              JSPrincipals *originPrincipals,\n                                              const jschar *chars, unsigned length,\n                                              const char *filename, unsigned lineno,\n                                              jsval *rval, JSVersion version);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const jschar *chars, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *bytes, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *filename, jsval *rval);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc,\n                jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc,\n                    jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc,\n                     jsval *argv, jsval *rval);\n\nnamespace JS {\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, JSFunction *fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunction(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, const char *name, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionName(cx, thisObj, name, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, jsval fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionValue(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nextern JS_PUBLIC_API(bool)\nCall(JSContext *cx, jsval thisv, jsval fun, unsigned argc, jsval *argv, MutableHandle<Value> rval);\n\nstatic inline bool\nCall(JSContext *cx, jsval thisv, JSObject *funObj, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return Call(cx, thisv, OBJECT_TO_JSVAL(funObj), argc, argv, rval);\n}\n\n} /* namespace JS */\n\n/*\n * These functions allow setting an operation callback that will be called\n * from the JS thread some time after any thread triggered the callback using\n * JS_TriggerOperationCallback(rt).\n *\n * To schedule the GC and for other activities the engine internally triggers\n * operation callbacks. The embedding should thus not rely on callbacks being\n * triggered through the external API only.\n *\n * Important note: Additional callbacks can occur inside the callback handler\n * if it re-enters the JS engine. The embedding must ensure that the callback\n * is disconnected before attempting such re-entry.\n */\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_SetOperationCallback(JSContext *cx, JSOperationCallback callback);\n\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_GetOperationCallback(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_TriggerOperationCallback(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsRunning(JSContext *cx);\n\n/*\n * Saving and restoring frame chains.\n *\n * These two functions are used to set aside cx's call stack while that stack\n * is inactive. After a call to JS_SaveFrameChain, it looks as if there is no\n * code running on cx. Before calling JS_RestoreFrameChain, cx's call stack\n * must be balanced and all nested calls to JS_SaveFrameChain must have had\n * matching JS_RestoreFrameChain calls.\n *\n * JS_SaveFrameChain deals with cx not having any code running on it.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SaveFrameChain(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreFrameChain(JSContext *cx);\n\n#ifdef MOZ_TRACE_JSCALLS\n/*\n * The callback is expected to be quick and noninvasive. It should not\n * trigger interrupts, turn on debugging, or produce uncaught JS\n * exceptions. The state of the stack and registers in the context\n * cannot be relied upon, since this callback may be invoked directly\n * from either JIT. The 'entering' field means we are entering a\n * function if it is positive, leaving a function if it is zero or\n * negative.\n */\nextern JS_PUBLIC_API(void)\nJS_SetFunctionCallback(JSContext *cx, JSFunctionCallback fcb);\n\nextern JS_PUBLIC_API(JSFunctionCallback)\nJS_GetFunctionCallback(JSContext *cx);\n#endif /* MOZ_TRACE_JSCALLS */\n\n/************************************************************************/\n\n/*\n * Strings.\n *\n * NB: JS_NewUCString takes ownership of bytes on success, avoiding a copy;\n * but on error (signified by null return), it leaves chars owned by the\n * caller. So the caller must free bytes in the error case, if it has no use\n * for them. In contrast, all the JS_New*StringCopy* functions do not take\n * ownership of the character memory passed to them -- they copy it.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyN(JSContext *cx, const char *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyZ(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternJSString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternStringN(JSContext *cx, const char *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternString(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCString(JSContext *cx, jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyN(JSContext *cx, const jschar *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyZ(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCString(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FileEscapedString(FILE *fp, JSString *str, char quote);\n\n/*\n * Extracting string characters and length.\n *\n * While getting the length of a string is infallible, getting the chars can\n * fail. As indicated by the lack of a JSContext parameter, there are two\n * special cases where getting the chars is infallible:\n *\n * The first case is interned strings, i.e., strings from JS_InternString or\n * JSID_TO_STRING(id), using JS_GetInternedStringChars*.\n *\n * The second case is \"flat\" strings that have been explicitly prepared in a\n * fallible context by JS_FlattenString. To catch errors, a separate opaque\n * JSFlatString type is returned by JS_FlattenString and expected by\n * JS_GetFlatStringChars. Note, though, that this is purely a syntactic\n * distinction: the input and output of JS_FlattenString are the same actual\n * GC-thing so only one needs to be rooted. If a JSString is known to be flat,\n * JS_ASSERT_STRING_IS_FLAT can be used to make a debug-checked cast. Example:\n *\n *   // in a fallible context\n *   JSFlatString *fstr = JS_FlattenString(cx, str);\n *   if (!fstr)\n *     return JS_FALSE;\n *   JS_ASSERT(fstr == JS_ASSERT_STRING_IS_FLAT(str));\n *\n *   // in an infallible context, for the same 'str'\n *   const jschar *chars = JS_GetFlatStringChars(fstr)\n *   JS_ASSERT(chars);\n *\n * The CharsZ APIs guarantee that the returned array has a null character at\n * chars[length]. This can require additional copying so clients should prefer\n * APIs without CharsZ if possible. The infallible functions also return\n * null-terminated arrays. (There is no additional cost or non-Z alternative\n * for the infallible functions, so 'Z' is left out of the identifier.)\n */\n\nextern JS_PUBLIC_API(size_t)\nJS_GetStringLength(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringChars(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringCharsAndLength(JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZ(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(JSFlatString *)\nJS_FlattenString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetFlatStringChars(JSFlatString *str);\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJSID_TO_FLAT_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSFlatString *)(JSID_BITS(id));\n}\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJS_ASSERT_STRING_IS_FLAT(JSString *str)\n{\n    JS_ASSERT(JS_GetFlatStringChars((JSFlatString *)str));\n    return (JSFlatString *)str;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJS_FORGET_STRING_FLATNESS(JSFlatString *fstr)\n{\n    return (JSString *)fstr;\n}\n\n/*\n * Additional APIs that avoid fallibility when given a flat string.\n */\n\nextern JS_PUBLIC_API(JSBool)\nJS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedFlatString(char *buffer, size_t size, JSFlatString *str, char quote);\n\n/*\n * This function is now obsolete and behaves the same as JS_NewUCString.  Use\n * JS_NewUCString instead.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewGrowableString(JSContext *cx, jschar *chars, size_t length);\n\n/*\n * Create a dependent string, i.e., a string that owns no character storage,\n * but that refers to a slice of another string's chars.  Dependent strings\n * are mutable by definition, so the thread safety comments above apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewDependentString(JSContext *cx, JSString *str, size_t start,\n                      size_t length);\n\n/*\n * Concatenate two strings, possibly resulting in a rope.\n * See above for thread safety comments.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_ConcatStrings(JSContext *cx, JSString *left, JSString *right);\n\n/*\n * For JS_DecodeBytes, set *dstlenp to the size of the destination buffer before\n * the call; on return, *dstlenp contains the number of jschars actually stored.\n * To determine the necessary destination buffer size, make a sizing call that\n * passes NULL for dst.\n *\n * On errors, the functions report the error. In that case, *dstlenp contains\n * the number of characters or bytes transferred so far.  If cx is NULL, no\n * error is reported on failure, and the functions simply return JS_FALSE.\n *\n * NB: This function does not store an additional zero byte or jschar after the\n * transcoded string.\n */\nJS_PUBLIC_API(JSBool)\nJS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst,\n               size_t *dstlenp);\n\n/*\n * A variation on JS_EncodeCharacters where a null terminated string is\n * returned that you are expected to call JS_free on when done.\n */\nJS_PUBLIC_API(char *)\nJS_EncodeString(JSContext *cx, JSString *str);\n\n/*\n * Same behavior as JS_EncodeString(), but encode into UTF-8 string\n */\nJS_PUBLIC_API(char *)\nJS_EncodeStringToUTF8(JSContext *cx, JSString *str);\n\n/*\n * Get number of bytes in the string encoding (without accounting for a\n * terminating zero bytes. The function returns (size_t) -1 if the string\n * can not be encoded into bytes and reports an error using cx accordingly.\n */\nJS_PUBLIC_API(size_t)\nJS_GetStringEncodingLength(JSContext *cx, JSString *str);\n\n/*\n * Encode string into a buffer. The function does not stores an additional\n * zero byte. The function returns (size_t) -1 if the string can not be\n * encoded into bytes with no error reported. Otherwise it returns the number\n * of bytes that are necessary to encode the string. If that exceeds the\n * length parameter, the string will be cut and only length bytes will be\n * written into the buffer.\n */\nJS_PUBLIC_API(size_t)\nJS_EncodeStringToBuffer(JSContext *cx, JSString *str, char *buffer, size_t length);\n\nclass JSAutoByteString\n{\n  public:\n    JSAutoByteString(JSContext *cx, JSString *str\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mBytes(JS_EncodeString(cx, str))\n    {\n        JS_ASSERT(cx);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    JSAutoByteString(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : mBytes(NULL)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoByteString() {\n        js_free(mBytes);\n    }\n\n    /* Take ownership of the given byte array. */\n    void initBytes(char *bytes) {\n        JS_ASSERT(!mBytes);\n        mBytes = bytes;\n    }\n\n    char *encodeLatin1(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeString(cx, str);\n        return mBytes;\n    }\n\n    char *encodeLatin1(js::ContextFriendFields *cx, JSString *str);\n\n    char *encodeUtf8(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeStringToUTF8(cx, str);\n        return mBytes;\n    }\n\n    void clear() {\n        js_free(mBytes);\n        mBytes = NULL;\n    }\n\n    char *ptr() const {\n        return mBytes;\n    }\n\n    bool operator!() const {\n        return !mBytes;\n    }\n\n    size_t length() const {\n        if (!mBytes)\n            return 0;\n        return strlen(mBytes);\n    }\n\n  private:\n    char        *mBytes;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* Copy and assignment are not supported. */\n    JSAutoByteString(const JSAutoByteString &another);\n    JSAutoByteString &operator=(const JSAutoByteString &another);\n};\n\n/************************************************************************/\n/*\n * JSON functions\n */\ntypedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);\n\n/*\n * JSON.stringify as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,\n             JSONWriteCallback callback, void *data);\n\n/*\n * JSON.parse as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle<JS::Value> vp);\n\nJS_PUBLIC_API(JSBool)\nJS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,\n                        jsval *vp);\n\n/************************************************************************/\n\n/* API for the HTML5 internal structured cloning algorithm. */\n\n/* The maximum supported structured-clone serialization format version. */\n#define JS_STRUCTURED_CLONE_VERSION 2\n\nstruct JSStructuredCloneCallbacks {\n    ReadStructuredCloneOp read;\n    WriteStructuredCloneOp write;\n    StructuredCloneErrorOp reportError;\n};\n\n/* Note: if the *data contains transferable objects, it can be read\n * only once */\nJS_PUBLIC_API(JSBool)\nJS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes,\n                       uint32_t version, jsval *vp,\n                       const JSStructuredCloneCallbacks *optionalCallbacks,\n                       void *closure);\n\n/* Note: On success, the caller is responsible for calling\n * JS_ClearStructuredClone(*datap, nbytesp). */\nJS_PUBLIC_API(JSBool)\nJS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,\n                        const JSStructuredCloneCallbacks *optionalCallbacks,\n                        void *closure, jsval transferable);\n\nJS_PUBLIC_API(JSBool)\nJS_ClearStructuredClone(const uint64_t *data, size_t nbytes);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes,\n                                   JSBool *hasTransferable);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredClone(JSContext *cx, jsval v, jsval *vp,\n                   const JSStructuredCloneCallbacks *optionalCallbacks,\n                   void *closure);\n\n/* RAII sugar for JS_WriteStructuredClone. */\nclass JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {\n    uint64_t *data_;\n    size_t nbytes_;\n    uint32_t version_;\n\n  public:\n    JSAutoStructuredCloneBuffer()\n        : data_(NULL), nbytes_(0), version_(JS_STRUCTURED_CLONE_VERSION) {}\n\n    ~JSAutoStructuredCloneBuffer() { clear(); }\n\n    uint64_t *data() const { return data_; }\n    size_t nbytes() const { return nbytes_; }\n\n    void clear();\n\n    /* Copy some memory. It will be automatically freed by the destructor. */\n    bool copy(const uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Adopt some memory. It will be automatically freed by the destructor.\n     * data must have been allocated by the JS engine (e.g., extracted via\n     * JSAutoStructuredCloneBuffer::steal).\n     */\n    void adopt(uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Remove the buffer so that it will not be automatically freed.\n     * After this, the caller is responsible for feeding the memory back to\n     * JSAutoStructuredCloneBuffer::adopt.\n     */\n    void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=NULL);\n\n    bool read(JSContext *cx, jsval *vp,\n              const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n              void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               jsval transferable,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    /**\n     * Swap ownership with another JSAutoStructuredCloneBuffer.\n     */\n    void swap(JSAutoStructuredCloneBuffer &other);\n\n  private:\n    /* Copy and assignment are not supported. */\n    JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other);\n    JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other);\n};\n\n/* API for implementing custom serialization behavior (for ImageData, File, etc.) */\n\n/* The range of tag values the application may use for its own custom object types. */\n#define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)\n#define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)\n\n#define JS_SCERR_RECURSION 0\n#define JS_SCERR_TRANSFERABLE 1\n\nJS_PUBLIC_API(void)\nJS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);\n\n/************************************************************************/\n\n/*\n * The default locale for the ECMAScript Internationalization API\n * (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).\n * Note that the Internationalization API encourages clients to\n * specify their own locales.\n * The locale string remains owned by the caller.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetDefaultLocale(JSRuntime *rt, const char *locale);\n\n/*\n * Reset the default locale to OS defaults.\n */\nextern JS_PUBLIC_API(void)\nJS_ResetDefaultLocale(JSRuntime *rt);\n\n/*\n * Locale specific string conversion and error message callbacks.\n */\nstruct JSLocaleCallbacks {\n    JSLocaleToUpperCase     localeToUpperCase;\n    JSLocaleToLowerCase     localeToLowerCase;\n    JSLocaleCompare         localeCompare; // not used #if ENABLE_INTL_API\n    JSLocaleToUnicode       localeToUnicode;\n    JSErrorCallback         localeGetErrorMessage;\n};\n\n/*\n * Establish locale callbacks. The pointer must persist as long as the\n * JSRuntime.  Passing NULL restores the default behaviour.\n */\nextern JS_PUBLIC_API(void)\nJS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks);\n\n/*\n * Return the address of the current locale callbacks struct, which may\n * be NULL.\n */\nextern JS_PUBLIC_API(JSLocaleCallbacks *)\nJS_GetLocaleCallbacks(JSRuntime *rt);\n\n/************************************************************************/\n\n/*\n * Error reporting.\n */\n\n/*\n * Report an exception represented by the sprintf-like conversion of format\n * and its arguments.  This exception message string is passed to a pre-set\n * JSErrorReporter function (set by JS_SetErrorReporter).\n */\nextern JS_PUBLIC_API(void)\nJS_ReportError(JSContext *cx, const char *format, ...);\n\n/*\n * Use an errorNumber to retrieve the format string, args are char *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,\n                       void *userRef, const unsigned errorNumber, va_list ap);\n#endif\n\n/*\n * Use an errorNumber to retrieve the format string, args are jschar *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUC(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback,\n                            void *userRef, const unsigned errorNumber,\n                            const jschar **args);\n\n/*\n * As above, but report a warning instead (JSREPORT_IS_WARNING(report.flags)).\n * Return true if there was no error trying to issue the warning, and if the\n * warning was not converted into an error due to the JSOPTION_WERROR option\n * being set, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReportWarning(JSContext *cx, const char *format, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags,\n                             JSErrorCallback errorCallback, void *userRef,\n                             const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags,\n                               JSErrorCallback errorCallback, void *userRef,\n                               const unsigned errorNumber, ...);\n\n/*\n * Complain when out of memory.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportOutOfMemory(JSContext *cx);\n\n/*\n * Complain when an allocation size overflows the maximum supported limit.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportAllocationOverflow(JSContext *cx);\n\nstruct JSErrorReport {\n    const char      *filename;      /* source file name, URL, etc., or null */\n    JSPrincipals    *originPrincipals; /* see 'originPrincipals' comment above */\n    unsigned        lineno;         /* source line number */\n    const char      *linebuf;       /* offending source line without final \\n */\n    const char      *tokenptr;      /* pointer to error token in linebuf */\n    const jschar    *uclinebuf;     /* unicode (original) line buffer */\n    const jschar    *uctokenptr;    /* unicode (original) token pointer */\n    unsigned        flags;          /* error/warning, etc. */\n    unsigned        errorNumber;    /* the error number, e.g. see js.msg */\n    const jschar    *ucmessage;     /* the (default) error message */\n    const jschar    **messageArgs;  /* arguments for the error message */\n    int16_t         exnType;        /* One of the JSExnType constants */\n    unsigned        column;         /* zero-based column index in line */\n};\n\n/*\n * JSErrorReport flag values.  These may be freely composed.\n */\n#define JSREPORT_ERROR      0x0     /* pseudo-flag for default case */\n#define JSREPORT_WARNING    0x1     /* reported via JS_ReportWarning */\n#define JSREPORT_EXCEPTION  0x2     /* exception was thrown */\n#define JSREPORT_STRICT     0x4     /* error or warning due to strict option */\n\n/*\n * This condition is an error in strict mode code, a warning if\n * JS_HAS_STRICT_OPTION(cx), and otherwise should not be reported at\n * all.  We check the strictness of the context's top frame's script;\n * where that isn't appropriate, the caller should do the right checks\n * itself instead of using this flag.\n */\n#define JSREPORT_STRICT_MODE_ERROR 0x8\n\n/*\n * If JSREPORT_EXCEPTION is set, then a JavaScript-catchable exception\n * has been thrown for this runtime error, and the host should ignore it.\n * Exception-aware hosts should also check for JS_IsExceptionPending if\n * JS_ExecuteScript returns failure, and signal or propagate the exception, as\n * appropriate.\n */\n#define JSREPORT_IS_WARNING(flags)      (((flags) & JSREPORT_WARNING) != 0)\n#define JSREPORT_IS_EXCEPTION(flags)    (((flags) & JSREPORT_EXCEPTION) != 0)\n#define JSREPORT_IS_STRICT(flags)       (((flags) & JSREPORT_STRICT) != 0)\n#define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) &                      \\\n                                              JSREPORT_STRICT_MODE_ERROR) != 0)\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_GetErrorReporter(JSContext *cx);\n\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_SetErrorReporter(JSContext *cx, JSErrorReporter er);\n\n/************************************************************************/\n\n/*\n * Dates.\n */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObjectMsec(JSContext *cx, double msec);\n\n/*\n * Infallible predicate to test whether obj is a date object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsDate(JSContext *cx, JSObject *obj);\n\n/*\n * Clears the cache of calculated local time from each Date object.\n * Call to propagate a system timezone change.\n */\nextern JS_PUBLIC_API(void)\nJS_ClearDateCaches(JSContext *cx);\n\n/************************************************************************/\n\n/*\n * Regular Expressions.\n */\n#define JSREG_FOLD      0x01    /* fold uppercase to lowercase */\n#define JSREG_GLOB      0x02    /* global exec, creates array of matches */\n#define JSREG_MULTILINE 0x04    /* treat ^ and $ as begin and end of line */\n#define JSREG_STICKY    0x08    /* only match starting at lastIndex */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObject(JSContext *cx, JSObject *obj, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(void)\nJS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRegExpStatics(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length,\n                 size_t *indexp, JSBool test, jsval *rval);\n\n/* RegExp interface for clients without a global object. */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length,\n                          size_t *indexp, JSBool test, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsRegExp(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetRegExpFlags(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetRegExpSource(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsExceptionPending(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPendingException(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_SetPendingException(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(void)\nJS_ClearPendingException(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportPendingException(JSContext *cx);\n\n/*\n * Save the current exception state.  This takes a snapshot of cx's current\n * exception state without making any change to that state.\n *\n * The returned state pointer MUST be passed later to JS_RestoreExceptionState\n * (to restore that saved state, overriding any more recent state) or else to\n * JS_DropExceptionState (to free the state struct in case it is not correct\n * or desirable to restore it).  Both Restore and Drop free the state struct,\n * so callers must stop using the pointer returned from Save after calling the\n * Release or Drop API.\n */\nextern JS_PUBLIC_API(JSExceptionState *)\nJS_SaveExceptionState(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreExceptionState(JSContext *cx, JSExceptionState *state);\n\nextern JS_PUBLIC_API(void)\nJS_DropExceptionState(JSContext *cx, JSExceptionState *state);\n\n/*\n * If the given value is an exception object that originated from an error,\n * the exception will contain an error report struct, and this API will return\n * the address of that struct.  Otherwise, it returns NULL.  The lifetime of\n * the error report struct that might be returned is the same as the lifetime\n * of the exception object.\n */\nextern JS_PUBLIC_API(JSErrorReport *)\nJS_ErrorFromException(JSContext *cx, jsval v);\n\n/*\n * Given a reported error's message and JSErrorReport struct pointer, throw\n * the corresponding exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowReportedError(JSContext *cx, const char *message,\n                      JSErrorReport *reportp);\n\n/*\n * Throws a StopIteration exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowStopIteration(JSContext *cx);\n\nextern JS_PUBLIC_API(intptr_t)\nJS_GetCurrentThread();\n\n/*\n * A JS runtime always has an \"owner thread\". The owner thread is set when the\n * runtime is created (to the current thread) and practically all entry points\n * into the JS engine check that a runtime (or anything contained in the\n * runtime: context, compartment, object, etc) is only touched by its owner\n * thread. Embeddings may check this invariant outside the JS engine by calling\n * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for\n * non-debug builds).\n *\n * It is possible to \"move\" a runtime between threads. This is accomplished by\n * calling JS_ClearRuntimeThread on a runtime's owner thread and then calling\n * JS_SetRuntimeThread on the new owner thread. The runtime must not be\n * accessed between JS_ClearRuntimeThread and JS_SetRuntimeThread. Also, the\n * caller is responsible for synchronizing the calls to Set/Clear.\n */\n\nextern JS_PUBLIC_API(void)\nJS_AbortIfWrongThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRuntimeThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeThread(JSRuntime *rt);\n\nclass JSAutoSetRuntimeThread\n{\n    JSRuntime *runtime_;\n\n  public:\n    JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime_(runtime) {\n        JS_SetRuntimeThread(runtime_);\n    }\n\n    ~JSAutoSetRuntimeThread() {\n        JS_ClearRuntimeThread(runtime_);\n    }\n};\n\n/************************************************************************/\n\n/*\n * JS_IsConstructing must be called from within a native given the\n * native's original cx and vp arguments. If JS_IsConstructing is true,\n * JS_THIS must not be used; the constructor should construct and return a\n * new object. Otherwise, the native is called as an ordinary function and\n * JS_THIS may be used.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJS_IsConstructing(JSContext *cx, const jsval *vp)\n{\n#ifdef DEBUG\n    JSObject *callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n    if (JS_ObjectIsFunction(cx, callee)) {\n        JSFunction *fun = JS_ValueToFunction(cx, JS_CALLEE(cx, vp));\n        JS_ASSERT(JS_IsConstructor(fun));\n    } else {\n        JS_ASSERT(JS_GetClass(callee)->construct != NULL);\n    }\n#else\n    (void)cx;\n#endif\n\n    return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));\n}\n\n/*\n * A constructor can request that the JS engine create a default new 'this'\n * object of the given class, using the callee to determine parentage and\n * [[Prototype]].\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp);\n\n/************************************************************************/\n\n#ifdef JS_GC_ZEAL\n#define JS_DEFAULT_ZEAL_FREQ 100\n\nextern JS_PUBLIC_API(void)\nJS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency);\n\nextern JS_PUBLIC_API(void)\nJS_ScheduleGC(JSContext *cx, uint32_t count);\n#endif\n\nextern JS_PUBLIC_API(void)\nJS_SetParallelCompilationEnabled(JSContext *cx, bool enabled);\n\ntypedef enum JSCompilerOption {\n    JSCOMPILER_BASELINE_USECOUNT_TRIGGER,\n    JSCOMPILER_ION_USECOUNT_TRIGGER,\n    JSCOMPILER_PJS_ENABLE\n} JSCompilerOption;\n\nextern JS_PUBLIC_API(void)\nJS_SetGlobalCompilerOption(JSContext *cx, JSCompilerOption opt, uint32_t value);\n\n/*\n * Convert a uint32_t index into a jsid.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IndexToId(JSContext *cx, uint32_t index, jsid *id);\n\n/*\n * Convert chars into a jsid.\n *\n * |chars| may not be an index.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp);\n\n/*\n *  Test if the given string is a valid ECMAScript identifier\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);\n\n/*\n * Return the current script and line number of the most currently running\n * frame. Returns true if a scripted frame was found, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno);\n\n\n/*\n * Encode/Decode interpreted scripts and functions to/from memory.\n */\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeScript(JSContext *cx, JSScript *script, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeInterpretedFunction(JSContext *cx, JSObject *funobj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_DecodeScript(JSContext *cx, const void *data, uint32_t length,\n                JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,\n                             JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\nextern JS_PUBLIC_DATA(const HandleId) JSID_VOIDHANDLE;\nextern JS_PUBLIC_DATA(const HandleId) JSID_EMPTYHANDLE;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Import some JS:: names into the js namespace so we can make unqualified\n * references to them.\n */\n\nusing JS::Value;\nusing JS::IsPoisonedValue;\nusing JS::NullValue;\nusing JS::UndefinedValue;\nusing JS::Int32Value;\nusing JS::DoubleValue;\nusing JS::StringValue;\nusing JS::BooleanValue;\nusing JS::ObjectValue;\nusing JS::MagicValue;\nusing JS::NumberValue;\nusing JS::ObjectOrNullValue;\nusing JS::PrivateValue;\nusing JS::PrivateUint32Value;\n\nusing JS::IsPoisonedPtr;\nusing JS::IsPoisonedId;\n\nusing JS::StableCharPtr;\nusing JS::TwoByteChars;\nusing JS::Latin1CharsZ;\n\nusing JS::AutoIdVector;\nusing JS::AutoValueVector;\nusing JS::AutoObjectVector;\nusing JS::AutoFunctionVector;\nusing JS::AutoScriptVector;\nusing JS::AutoIdArray;\n\nusing JS::AutoGCRooter;\nusing JS::AutoArrayRooter;\nusing JS::AutoVectorRooter;\nusing JS::AutoHashMapRooter;\nusing JS::AutoHashSetRooter;\n\nusing JS::CallArgs;\nusing JS::IsAcceptableThis;\nusing JS::NativeImpl;\nusing JS::CallReceiver;\nusing JS::CompileOptions;\nusing JS::CallNonGenericMethod;\n\nusing JS::Rooted;\nusing JS::RootedObject;\nusing JS::RootedModule;\nusing JS::RootedFunction;\nusing JS::RootedScript;\nusing JS::RootedString;\nusing JS::RootedId;\nusing JS::RootedValue;\n\nusing JS::Handle;\nusing JS::HandleObject;\nusing JS::HandleModule;\nusing JS::HandleFunction;\nusing JS::HandleScript;\nusing JS::HandleString;\nusing JS::HandleId;\nusing JS::HandleValue;\n\nusing JS::MutableHandle;\nusing JS::MutableHandleObject;\nusing JS::MutableHandleFunction;\nusing JS::MutableHandleScript;\nusing JS::MutableHandleString;\nusing JS::MutableHandleId;\nusing JS::MutableHandleValue;\n\nusing JS::Zone;\n\n} /* namespace js */\n\n#endif /* jsapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsclass.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclass_h\n#define jsclass_h\n/*\n * A JSClass acts as a vtable for JS objects that allows JSAPI clients to\n * control various aspects of the behavior of an object like property lookup.\n * js::Class is an engine-private extension that allows more control over\n * object behavior and, e.g., allows custom slow layout.\n */\n\n#include \"jsapi.h\"\n#include \"jsprvtd.h\"\n\nnamespace js {\n\nclass PropertyName;\nclass SpecialId;\nclass PropertyId;\n\n// This is equal to JSFunction::class_.  Use it in places where you don't want\n// to #include jsfun.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionClassPtr;\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid);\n\n/*\n * We partition the ways to refer to a property into three: by an index\n * (uint32_t); by a string whose characters do not represent an index\n * (PropertyName, see vm/String.h); and by various special values.\n *\n * Special values are encoded using SpecialId, which is layout-compatible but\n * non-interconvertible with jsid.  A SpecialId is used for JSID_VOID, which\n * does not occur in JS scripts but may be used to indicate the absence of a\n * valid identifier.  In the future, a SpecialId may also be an object used by\n * Harmony-proposed private names.\n */\nclass SpecialId\n{\n    uintptr_t bits_;\n\n    /* Needs access to raw bits. */\n    friend JS_ALWAYS_INLINE jsid SPECIALID_TO_JSID(const SpecialId &sid);\n    friend class PropertyId;\n\n    static const uintptr_t TYPE_VOID = JSID_TYPE_VOID;\n    static const uintptr_t TYPE_OBJECT = JSID_TYPE_OBJECT;\n    static const uintptr_t TYPE_MASK = JSID_TYPE_MASK;\n\n    SpecialId(uintptr_t bits) : bits_(bits) { }\n\n  public:\n    SpecialId() : bits_(TYPE_VOID) { }\n\n    /* Object-valued */\n\n    SpecialId(JSObject &obj)\n      : bits_(uintptr_t(&obj) | TYPE_OBJECT)\n    {\n        JS_ASSERT(&obj != NULL);\n        JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);\n    }\n\n    bool isObject() const {\n        return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT;\n    }\n\n    JSObject *toObject() const {\n        JS_ASSERT(isObject());\n        return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);\n    }\n\n    /* Empty */\n\n    static SpecialId empty() {\n        SpecialId sid(TYPE_OBJECT);\n        JS_ASSERT(sid.isEmpty());\n        return sid;\n    }\n\n    bool isEmpty() const {\n        return bits_ == TYPE_OBJECT;\n    }\n\n    /* Void */\n\n    static SpecialId voidId() {\n        SpecialId sid(TYPE_VOID);\n        JS_ASSERT(sid.isVoid());\n        return sid;\n    }\n\n    bool isVoid() const {\n        return bits_ == TYPE_VOID;\n    }\n};\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid)\n{\n    jsid id;\n    JSID_BITS(id) = sid.bits_;\n    JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());\n    JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));\n    JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE bool\nJSID_IS_SPECIAL(jsid id)\n{\n    return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id);\n}\n\nstatic JS_ALWAYS_INLINE SpecialId\nJSID_TO_SPECIALID(jsid id)\n{\n    JS_ASSERT(JSID_IS_SPECIAL(id));\n    if (JSID_IS_OBJECT(id))\n        return SpecialId(*JSID_TO_OBJECT(id));\n    if (JSID_IS_EMPTY(id))\n        return SpecialId::empty();\n    JS_ASSERT(JSID_IS_VOID(id));\n    return SpecialId::voidId();\n}\n\ntypedef JS::Handle<SpecialId> HandleSpecialId;\n\n/* js::Class operation signatures. */\n\ntypedef JSBool\n(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name,\n                 MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value,\n                 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);\ntypedef JSBool\n(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present);\ntypedef JSBool\n(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);\ntypedef JSBool\n(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);\ntypedef JSBool\n(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);\ntypedef JSBool\n(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);\ntypedef JSBool\n(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);\ntypedef JSBool\n(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded);\ntypedef JSBool\n(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded);\ntypedef JSBool\n(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded);\n\n\ntypedef JSObject *\n(* ObjectOp)(JSContext *cx, HandleObject obj);\ntypedef void\n(* FinalizeOp)(FreeOp *fop, JSObject *obj);\n\n#define JS_CLASS_MEMBERS                                                      \\\n    const char          *name;                                                \\\n    uint32_t            flags;                                                \\\n                                                                              \\\n    /* Mandatory function pointer members. */                                 \\\n    JSPropertyOp        addProperty;                                          \\\n    JSDeletePropertyOp  delProperty;                                          \\\n    JSPropertyOp        getProperty;                                          \\\n    JSStrictPropertyOp  setProperty;                                          \\\n    JSEnumerateOp       enumerate;                                            \\\n    JSResolveOp         resolve;                                              \\\n    JSConvertOp         convert;                                              \\\n                                                                              \\\n    /* Optional members (may be null). */                                     \\\n    FinalizeOp          finalize;                                             \\\n    JSCheckAccessOp     checkAccess;                                          \\\n    JSNative            call;                                                 \\\n    JSHasInstanceOp     hasInstance;                                          \\\n    JSNative            construct;                                            \\\n    JSTraceOp           trace\n\n/*\n * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much\n * we have to pad js::Class to match the size of JSClass.\n */\nstruct ClassSizeMeasurement\n{\n    JS_CLASS_MEMBERS;\n};\n\nstruct ClassExtension\n{\n    JSObjectOp          outerObject;\n    JSObjectOp          innerObject;\n    JSIteratorOp        iteratorObject;\n\n    /*\n     * isWrappedNative is true only if the class is an XPCWrappedNative.\n     * WeakMaps use this to override the wrapper disposal optimization.\n     */\n    bool                isWrappedNative;\n\n    /*\n     * If an object is used as a key in a weakmap, it may be desirable for the\n     * garbage collector to keep that object around longer than it otherwise\n     * would. A common case is when the key is a wrapper around an object in\n     * another compartment, and we want to avoid collecting the wrapper (and\n     * removing the weakmap entry) as long as the wrapped object is alive. In\n     * that case, the wrapped object is returned by the wrapper's\n     * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap\n     * key, it will not be collected (and remain in the weakmap) until the\n     * wrapped object is collected.\n     */\n    JSWeakmapKeyDelegateOp weakmapKeyDelegateOp;\n};\n\n#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,false,NULL}\n\nstruct ObjectOps\n{\n    LookupGenericOp     lookupGeneric;\n    LookupPropOp        lookupProperty;\n    LookupElementOp     lookupElement;\n    LookupSpecialOp     lookupSpecial;\n    DefineGenericOp     defineGeneric;\n    DefinePropOp        defineProperty;\n    DefineElementOp     defineElement;\n    DefineSpecialOp     defineSpecial;\n    GenericIdOp         getGeneric;\n    PropertyIdOp        getProperty;\n    ElementIdOp         getElement;\n    ElementIfPresentOp  getElementIfPresent; /* can be null */\n    SpecialIdOp         getSpecial;\n    StrictGenericIdOp   setGeneric;\n    StrictPropertyIdOp  setProperty;\n    StrictElementIdOp   setElement;\n    StrictSpecialIdOp   setSpecial;\n    GenericAttributesOp getGenericAttributes;\n    PropertyAttributesOp getPropertyAttributes;\n    ElementAttributesOp getElementAttributes;\n    SpecialAttributesOp getSpecialAttributes;\n    GenericAttributesOp setGenericAttributes;\n    PropertyAttributesOp setPropertyAttributes;\n    ElementAttributesOp setElementAttributes;\n    SpecialAttributesOp setSpecialAttributes;\n    DeletePropertyOp    deleteProperty;\n    DeleteElementOp     deleteElement;\n    DeleteSpecialOp     deleteSpecial;\n\n    JSNewEnumerateOp    enumerate;\n    ObjectOp            thisObject;\n};\n\n#define JS_NULL_OBJECT_OPS                                                    \\\n    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \\\n     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,        \\\n     NULL,NULL,NULL}\n\nstruct Class\n{\n    JS_CLASS_MEMBERS;\n    ClassExtension      ext;\n    ObjectOps           ops;\n    uint8_t             pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -\n                            sizeof(ClassExtension) - sizeof(ObjectOps)];\n\n    /* Class is not native and its map is not a scope. */\n    static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;\n\n    bool isNative() const {\n        return !(flags & NON_NATIVE);\n    }\n\n    bool hasPrivate() const {\n        return !!(flags & JSCLASS_HAS_PRIVATE);\n    }\n\n    bool emulatesUndefined() const {\n        return flags & JSCLASS_EMULATES_UNDEFINED;\n    }\n\n    bool isCallable() const {\n        return this == js::FunctionClassPtr || call;\n    }\n\n    static size_t offsetOfFlags() { return offsetof(Class, flags); }\n};\n\nJS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));\nJS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));\nJS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));\nJS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));\nJS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));\nJS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));\nJS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));\nJS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));\nJS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));\nJS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));\nJS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));\nJS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));\n\nstatic JS_ALWAYS_INLINE JSClass *\nJsvalify(Class *c)\n{\n    return (JSClass *)c;\n}\nstatic JS_ALWAYS_INLINE const JSClass *\nJsvalify(const Class *c)\n{\n    return (const JSClass *)c;\n}\n\nstatic JS_ALWAYS_INLINE Class *\nValueify(JSClass *c)\n{\n    return (Class *)c;\n}\nstatic JS_ALWAYS_INLINE const Class *\nValueify(const JSClass *c)\n{\n    return (const Class *)c;\n}\n\n/*\n * Enumeration describing possible values of the [[Class]] internal property\n * value of objects.\n */\nenum ESClassValue {\n    ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean,\n    ESClass_RegExp, ESClass_ArrayBuffer, ESClass_Date\n};\n\n/*\n * Return whether the given object has the given [[Class]] internal property\n * value. Beware, this query says nothing about the js::Class of the JSObject\n * so the caller must not assume anything about obj's representation (e.g., obj\n * may be a proxy).\n */\ninline bool\nObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx);\n\n/* Just a helper that checks v.isObject before calling ObjectClassIs. */\ninline bool\nIsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx);\n\ninline bool\nIsPoisonedSpecialId(js::SpecialId iden)\n{\n    if (iden.isObject())\n        return IsPoisonedPtr(iden.toObject());\n    return false;\n}\n\ntemplate <> struct GCMethods<SpecialId>\n{\n    static SpecialId initial() { return SpecialId(); }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(SpecialId id) { return IsPoisonedSpecialId(id); }\n};\n\n}  /* namespace js */\n\n#endif  /* jsclass_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsclist.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclist_h\n#define jsclist_h\n\n#include \"jstypes.h\"\n\n/*\n** Circular linked list\n*/\ntypedef struct JSCListStr {\n    struct JSCListStr *next;\n    struct JSCListStr *prev;\n} JSCList;\n\n/*\n** Insert element \"_e\" into the list, before \"_l\".\n*/\n#define JS_INSERT_BEFORE(_e,_l)  \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l);       \\\n        (_e)->prev = (_l)->prev; \\\n        (_l)->prev->next = (_e); \\\n        (_l)->prev = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Insert element \"_e\" into the list, after \"_l\".\n*/\n#define JS_INSERT_AFTER(_e,_l)   \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l)->next; \\\n        (_e)->prev = (_l);       \\\n        (_l)->next->prev = (_e); \\\n        (_l)->next = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Return the element following element \"_e\"\n*/\n#define JS_NEXT_LINK(_e)         \\\n        ((_e)->next)\n/*\n** Return the element preceding element \"_e\"\n*/\n#define JS_PREV_LINK(_e)         \\\n        ((_e)->prev)\n\n/*\n** Append an element \"_e\" to the end of the list \"_l\"\n*/\n#define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l)\n\n/*\n** Insert an element \"_e\" at the head of the list \"_l\"\n*/\n#define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l)\n\n/* Return the head/tail of the list */\n#define JS_LIST_HEAD(_l) (_l)->next\n#define JS_LIST_TAIL(_l) (_l)->prev\n\n/*\n** Remove the element \"_e\" from it's circular list.\n*/\n#define JS_REMOVE_LINK(_e)             \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n    JS_END_MACRO\n\n/*\n** Remove the element \"_e\" from it's circular list. Also initializes the\n** linkage.\n*/\n#define JS_REMOVE_AND_INIT_LINK(_e)    \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n        (_e)->next = (_e);             \\\n        (_e)->prev = (_e);             \\\n    JS_END_MACRO\n\n/*\n** Return non-zero if the given circular list \"_l\" is empty, zero if the\n** circular list is not empty\n*/\n#define JS_CLIST_IS_EMPTY(_l) \\\n    ((_l)->next == (_l))\n\n/*\n** Initialize a circular list\n*/\n#define JS_INIT_CLIST(_l)  \\\n    JS_BEGIN_MACRO         \\\n        (_l)->next = (_l); \\\n        (_l)->prev = (_l); \\\n    JS_END_MACRO\n\n#define JS_INIT_STATIC_CLIST(_l) \\\n    {(_l), (_l)}\n\n#endif /* jsclist_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jscpucfg.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jscpucfg_h\n#define jscpucfg_h\n\n#define JS_HAVE_LONG_LONG\n\n#if defined(_WIN64)\n\n# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n#  define JS_BYTES_PER_WORD   8\n#  define JS_BITS_PER_WORD_LOG2   6\n# else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n#  error \"CPU type is unknown\"\n# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n\n#elif defined(_WIN32) || defined(XP_OS2)\n\n# ifdef __WATCOMC__\n#  define HAVE_VA_LIST_AS_ARRAY 1\n# endif\n\n# define IS_LITTLE_ENDIAN 1\n# undef  IS_BIG_ENDIAN\n# define JS_BYTES_PER_WORD   4\n# define JS_BITS_PER_WORD_LOG2   5\n\n#elif defined(__APPLE__)\n# if __LITTLE_ENDIAN__\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n# elif __BIG_ENDIAN__\n#  undef  IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# endif\n\n#elif defined(JS_HAVE_ENDIAN_H)\n# include <endian.h>\n\n# if defined(__BYTE_ORDER)\n#  if __BYTE_ORDER == __LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif __BYTE_ORDER == __BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(__BYTE_ORDER) */\n#  error \"endian.h does not define __BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n/* BSDs */\n#elif defined(JS_HAVE_MACHINE_ENDIAN_H)\n# include <sys/types.h>\n# include <machine/endian.h>\n\n# if defined(_BYTE_ORDER)\n#  if _BYTE_ORDER == _LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif _BYTE_ORDER == _BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(_BYTE_ORDER) */\n#  error \"machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n#elif defined(JS_HAVE_SYS_ISA_DEFS_H)\n# include <sys/isa_defs.h>\n\n# if defined(_BIG_ENDIAN)\n#  undef IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# elif defined(_LITTLE_ENDIAN)\n#  define IS_LITTLE_ENDIAN 1\n#  undef IS_BIG_ENDIAN\n# else /* !defined(_LITTLE_ENDIAN) */\n#  error \"sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness.\"\n# endif\n# if !defined(JS_STACK_GROWTH_DIRECTION)\n#  if defined(_STACK_GROWS_UPWARD)\n#   define JS_STACK_GROWTH_DIRECTION (1)\n#  elif defined(_STACK_GROWS_DOWNWARD)\n#   define JS_STACK_GROWTH_DIRECTION (-1)\n#  endif\n# endif\n\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(_BIG_ENDIAN)\n/* IA64 running HP-UX will have _BIG_ENDIAN defined.\n * IA64 running Linux will have endian.h and be handled above.\n */\n# undef IS_LITTLE_ENDIAN\n# define IS_BIG_ENDIAN 1\n\n#else /* !defined(__sparc) && !defined(__sparc__) && ... */\n# error \"Cannot determine endianness of your platform. Please add support to jscpucfg.h.\"\n#endif\n\n#ifndef JS_STACK_GROWTH_DIRECTION\n# ifdef __hppa\n#  define JS_STACK_GROWTH_DIRECTION (1)\n# else\n#  define JS_STACK_GROWTH_DIRECTION (-1)\n# endif\n#endif\n\n#endif /* jscpucfg_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsdbgapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsdbgapi_h\n#define jsdbgapi_h\n/*\n * JS debugger API.\n */\n\n#include \"jsprvtd.h\"\n\nnamespace JS {\n\nstruct FrameDescription\n{\n    JSScript *script;\n    unsigned lineno;\n    JSFunction *fun;\n};\n\nstruct StackDescription\n{\n    unsigned nframes;\n    FrameDescription *frames;\n};\n\nextern JS_PUBLIC_API(StackDescription *)\nDescribeStack(JSContext *cx, unsigned maxFrames);\n\nextern JS_PUBLIC_API(void)\nFreeStackDescription(JSContext *cx, StackDescription *desc);\n\nextern JS_PUBLIC_API(char *)\nFormatStackDump(JSContext *cx, char *buf,\n                    JSBool showArgs, JSBool showLocals,\n                    JSBool showThisProps);\n\n}\n\n# ifdef DEBUG\nJS_FRIEND_API(void) js_DumpValue(const js::Value &val);\nJS_FRIEND_API(void) js_DumpId(jsid id);\nJS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);\n# endif\n\nJS_FRIEND_API(void)\njs_DumpBacktrace(JSContext *cx);\n\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * Currently, we only support runtime-wide debugging. In the future, we should\n * be able to support compartment-wide debugging.\n */\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);\n\n/*\n * Debug mode is a compartment-wide mode that enables a debugger to attach\n * to and interact with running methodjit-ed frames. In particular, it causes\n * every function to be compiled as if an eval was present (so eval-in-frame)\n * can work, and it ensures that functions can be re-JITed for other debug\n * features. In general, it is not safe to interact with frames that were live\n * before debug mode was enabled. For this reason, it is also not safe to\n * enable debug mode while frames are live.\n */\n\n/* Get current state of debugging mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_GetDebugMode(JSContext *cx);\n\n/*\n * Turn on/off debugging mode for all compartments. This returns false if any code\n * from any of the runtime's compartments is running or on the stack.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a single compartment. This should only be\n * used when no code from this compartment is running or on the stack in any\n * thread.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a context's compartment.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugMode(JSContext *cx, JSBool debug);\n\n/* Turn on single step mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);\n\n/* The closure argument will be marked. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n           JSTrapHandler handler, jsval closure);\n\nextern JS_PUBLIC_API(void)\nJS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n             JSTrapHandler *handlerp, jsval *closurep);\n\nextern JS_PUBLIC_API(void)\nJS_ClearScriptTraps(JSRuntime *rt, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_ClearAllTrapsForCompartment(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                 JSWatchPointHandler handler, JSObject *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                   JSWatchPointHandler *handlerp, JSObject **closurep);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearAllWatchPoints(JSContext *cx);\n\n/************************************************************************/\n\n// Raw JSScript* because this needs to be callable from a signal handler.\nextern JS_PUBLIC_API(unsigned)\nJS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_EndPC(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetLinePCs(JSContext *cx, JSScript *script,\n              unsigned startLine, unsigned maxLines,\n              unsigned* count, unsigned** lines, jsbytecode*** pcs);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);\n\n/*\n * N.B. The mark is in the context temp pool and thus the caller must take care\n * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other\n * call that may use the temp pool.\n */\nextern JS_PUBLIC_API(uintptr_t *)\nJS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);\n\nextern JS_PUBLIC_API(JSAtom *)\nJS_LocalNameToAtom(uintptr_t w);\n\nextern JS_PUBLIC_API(JSString *)\nJS_AtomKey(JSAtom *atom);\n\nextern JS_PUBLIC_API(void)\nJS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_GetFunctionScript(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSNative)\nJS_GetFunctionNative(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptPrincipals(JSScript *script);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptOriginPrincipals(JSScript *script);\n\nJS_PUBLIC_API(JSFunction *)\nJS_GetScriptFunction(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\n/*\n * This is almost JS_GetClass(obj)->name except that certain debug-only\n * proxies are made transparent. In particular, this function turns the class\n * of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject)\n * from \"Proxy\" to \"Call\", \"Block\", \"With\" etc.\n */\nextern JS_PUBLIC_API(const char *)\nJS_GetDebugClassName(JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const char *)\nJS_GetScriptFilename(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetScriptSourceMap(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptLineExtent(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetScriptVersion(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(bool)\nJS_GetScriptIsSelfHosted(JSScript *script);\n\n/************************************************************************/\n\n/*\n * Hook setters for script creation and destruction, see jsprvtd.h for the\n * typedefs.  These macros provide binary compatibility and newer, shorter\n * synonyms.\n */\n#define JS_SetNewScriptHook     JS_SetNewScriptHookProc\n#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc\n\nextern JS_PUBLIC_API(void)\nJS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,\n                        void *callerdata);\n\n/************************************************************************/\n\ntypedef struct JSPropertyDesc {\n    jsval           id;         /* primary id, atomized string, or int */\n    jsval           value;      /* property value */\n    uint8_t         flags;      /* flags, see below */\n    uint8_t         spare;      /* unused */\n    jsval           alias;      /* alias id if JSPD_ALIAS flag */\n} JSPropertyDesc;\n\n#define JSPD_ENUMERATE  0x01    /* visible to for/in loop */\n#define JSPD_READONLY   0x02    /* assignment is error */\n#define JSPD_PERMANENT  0x04    /* property cannot be deleted */\n#define JSPD_ALIAS      0x08    /* property has an alias id */\n#define JSPD_EXCEPTION  0x40    /* exception occurred fetching the property, */\n                                /* value is exception */\n#define JSPD_ERROR      0x80    /* native getter returned JS_FALSE without */\n                                /* throwing an exception */\n\ntypedef struct JSPropertyDescArray {\n    uint32_t        length;     /* number of elements in array */\n    JSPropertyDesc  *array;     /* alloc'd by Get, freed by Put */\n} JSPropertyDescArray;\n\ntypedef struct JSScopeProperty JSScopeProperty;\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);\n\nextern JS_PUBLIC_API(void)\nJS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);\n\n/************************************************************************/\n\n/*\n * JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a\n * StackFrame or baseline JIT frame.\n */\nclass JS_PUBLIC_API(JSAbstractFramePtr)\n{\n    uintptr_t ptr_;\n\n  protected:\n    JSAbstractFramePtr()\n      : ptr_(0)\n    { }\n\n  public:\n    explicit JSAbstractFramePtr(void *raw);\n\n    uintptr_t raw() const { return ptr_; }\n\n    operator bool() const { return !!ptr_; }\n\n    JSObject *scopeChain(JSContext *cx);\n    JSObject *callObject(JSContext *cx);\n\n    JSFunction *maybeFun();\n    JSScript *script();\n\n    bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv);\n\n    bool isDebuggerFrame();\n\n    bool evaluateInStackFrame(JSContext *cx,\n                              const char *bytes, unsigned length,\n                              const char *filename, unsigned lineno,\n                              JS::MutableHandleValue rval);\n\n    bool evaluateUCInStackFrame(JSContext *cx,\n                                const jschar *chars, unsigned length,\n                                const char *filename, unsigned lineno,\n                                JS::MutableHandleValue rval);\n};\n\nclass JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr\n{\n  public:\n    JSNullFramePtr()\n      : JSAbstractFramePtr()\n    {}\n};\n\n/*\n * This class does not work when IonMonkey is active. It's only used by jsd,\n * which can only be used when IonMonkey is disabled.\n *\n * To find the calling script and line number, use JS_DescribeSciptedCaller.\n * To summarize the call stack, use JS::DescribeStack.\n */\nclass JS_PUBLIC_API(JSBrokenFrameIterator)\n{\n    void *data_;\n\n  public:\n    JSBrokenFrameIterator(JSContext *cx);\n    ~JSBrokenFrameIterator();\n\n    bool done() const;\n    JSBrokenFrameIterator& operator++();\n\n    JSAbstractFramePtr abstractFramePtr() const;\n    jsbytecode *pc() const;\n\n    bool isConstructing() const;\n};\n\n/*\n * This hook captures high level script execution and function calls (JS or\n * native).  It is used by JS_SetExecuteHook to hook top level scripts and by\n * JS_SetCallHook to hook function calls.  It will get called twice per script\n * or function call: just before execution begins and just after it finishes.\n * In both cases the 'current' frame is that of the executing code.\n *\n * The 'before' param is JS_TRUE for the hook invocation before the execution\n * and JS_FALSE for the invocation after the code has run.\n *\n * The 'ok' param is significant only on the post execution invocation to\n * signify whether or not the code completed 'normally'.\n *\n * The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook\n * for the 'before'invocation, but is whatever value is returned from that\n * invocation for the 'after' invocation. Thus, the hook implementor *could*\n * allocate a structure in the 'before' invocation and return a pointer to that\n * structure. The pointer would then be handed to the hook for the 'after'\n * invocation. Alternately, the 'before' could just return the same value as\n * in 'closure' to cause the 'after' invocation to be called with the same\n * 'closure' value as the 'before'.\n *\n * Returning NULL in the 'before' hook will cause the 'after' hook *not* to\n * be called.\n */\ntypedef void *\n(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,\n                      JSBool before, JSBool *ok, void *closure);\n\ntypedef JSBool\n(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,\n                     void *closure);\n\ntypedef struct JSDebugHooks {\n    JSInterruptHook     interruptHook;\n    void                *interruptHookData;\n    JSNewScriptHook     newScriptHook;\n    void                *newScriptHookData;\n    JSDestroyScriptHook destroyScriptHook;\n    void                *destroyScriptHookData;\n    JSDebuggerHandler   debuggerHandler;\n    void                *debuggerHandlerData;\n    JSSourceHandler     sourceHandler;\n    void                *sourceHandlerData;\n    JSInterpreterHook   executeHook;\n    void                *executeHookData;\n    JSInterpreterHook   callHook;\n    void                *callHookData;\n    JSThrowHook         throwHook;\n    void                *throwHookData;\n    JSDebugErrorHook    debugErrorHook;\n    void                *debugErrorHookData;\n} JSDebugHooks;\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const JSDebugHooks *)\nJS_GetGlobalDebugHooks(JSRuntime *rt);\n\n/**\n * Add various profiling-related functions as properties of the given object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);\n\n/* Defined in vm/Debugger.cpp. */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineDebuggerObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_DumpBytecode(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentBytecode(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DumpPCCounts(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentPCCounts(JSContext *cx);\n\n/* Call the context debug handler on the topmost scripted frame. */\nextern JS_FRIEND_API(JSBool)\njs_CallContextDebugHandler(JSContext *cx);\n\n#endif /* jsdbgapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsfriendapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsfriendapi_h\n#define jsfriendapi_h\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include \"jsclass.h\"\n#include \"jsprvtd.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n\n/*\n * This macro checks if the stack pointer has exceeded a given limit. If\n * |tolerance| is non-zero, it returns true only if the stack pointer has\n * exceeded the limit by more than |tolerance| bytes.\n */\n#if JS_STACK_GROWTH_DIRECTION > 0\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) < (limit)+(tolerance))\n#else\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) > (limit)-(tolerance))\n#endif\n\n#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)\n\nnamespace JS {\ntemplate <class T>\nclass Heap;\n} /* namespace JS */\n\nextern JS_FRIEND_API(void)\nJS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\nextern JS_FRIEND_API(JSString *)\nJS_GetAnonymousString(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nJS_FindCompilationScope(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSFunction *)\nJS_GetObjectFunction(JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(uint32_t)\nJS_ObjectCountDynamicSlots(JS::HandleObject obj);\n\nextern JS_FRIEND_API(size_t)\nJS_SetProtoCalled(JSContext *cx);\n\nextern JS_FRIEND_API(size_t)\nJS_GetCustomIteratorCount(JSContext *cx);\n\nextern JS_FRIEND_API(JSBool)\nJS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret);\n\n/*\n * Determine whether the given object is backed by a DeadObjectProxy.\n *\n * Such objects hold no other objects (they have no outgoing reference edges)\n * and will throw if you touch them (e.g. by reading/writing a property).\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsDeadWrapper(JSObject *obj);\n\n/*\n * Used by the cycle collector to trace through the shape and all\n * shapes it reaches, marking all non-shape children found in the\n * process. Uses bounded stack space.\n */\nextern JS_FRIEND_API(void)\nJS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape);\n\nenum {\n    JS_TELEMETRY_GC_REASON,\n    JS_TELEMETRY_GC_IS_COMPARTMENTAL,\n    JS_TELEMETRY_GC_MS,\n    JS_TELEMETRY_GC_MAX_PAUSE_MS,\n    JS_TELEMETRY_GC_MARK_MS,\n    JS_TELEMETRY_GC_SWEEP_MS,\n    JS_TELEMETRY_GC_MARK_ROOTS_MS,\n    JS_TELEMETRY_GC_MARK_GRAY_MS,\n    JS_TELEMETRY_GC_SLICE_MS,\n    JS_TELEMETRY_GC_MMU_50,\n    JS_TELEMETRY_GC_RESET,\n    JS_TELEMETRY_GC_INCREMENTAL_DISABLED,\n    JS_TELEMETRY_GC_NON_INCREMENTAL,\n    JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS,\n    JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS\n};\n\ntypedef void\n(* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample);\n\nextern JS_FRIEND_API(void)\nJS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback);\n\nextern JS_FRIEND_API(JSPrincipals *)\nJS_GetCompartmentPrincipals(JSCompartment *compartment);\n\nextern JS_FRIEND_API(void)\nJS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);\n\n/* Safe to call with input obj == NULL. Returns non-NULL iff obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToInnerObject(JSContext *cx, JSObject *obj);\n\n/* Requires obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToOuterObject(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSObject *)\nJS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(JSString *)\nJS_BasicObjectToString(JSContext *cx, JS::HandleObject obj);\n\nextern JS_FRIEND_API(JSBool)\njs_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,\n                          JS::MutableHandleValue vp);\n\nJS_FRIEND_API(void)\njs_ReportOverRecursed(JSContext *maybecx);\n\nJS_FRIEND_API(bool)\njs_ObjectClassIs(JSContext *cx, JS::HandleObject obj, js::ESClassValue classValue);\n\nJS_FRIEND_API(const char *)\njs_ObjectClassName(JSContext *cx, JS::HandleObject obj);\n\nJS_FRIEND_API(bool)\njs_AddObjectRoot(JSRuntime *rt, JSObject **objp);\n\nJS_FRIEND_API(void)\njs_RemoveObjectRoot(JSRuntime *rt, JSObject **objp);\n\n#ifdef DEBUG\n\n/*\n * Routines to print out values during debugging.  These are FRIEND_API to help\n * the debugger find them and to support temporarily hacking js_Dump* calls\n * into other code.\n */\n\nextern JS_FRIEND_API(void)\njs_DumpString(JSString *str);\n\nextern JS_FRIEND_API(void)\njs_DumpAtom(JSAtom *atom);\n\nextern JS_FRIEND_API(void)\njs_DumpObject(JSObject *obj);\n\nextern JS_FRIEND_API(void)\njs_DumpChars(const jschar *s, size_t n);\n#endif\n\nextern JS_FRIEND_API(bool)\nJS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);\n\nextern JS_FRIEND_API(JSBool)\nJS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,\n                  js::MutableHandleValue statep, js::MutableHandleId idp);\n\nstruct JSFunctionSpecWithHelp {\n    const char      *name;\n    JSNative        call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *usage;\n    const char      *help;\n};\n\n#define JS_FN_HELP(name,call,nargs,flags,usage,help)                          \\\n    {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}\n#define JS_FS_HELP_END                                                        \\\n    {NULL, NULL, 0, 0, NULL, NULL}\n\nextern JS_FRIEND_API(bool)\nJS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);\n\ntypedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,\n                               jschar **src, uint32_t *length);\n\nextern JS_FRIEND_API(void)\nJS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);\n\nnamespace js {\n\ninline JSRuntime *\nGetRuntime(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->runtime_;\n}\n\ninline JSCompartment *\nGetContextCompartment(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->compartment_;\n}\n\ninline JS::Zone *\nGetContextZone(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->zone_;\n}\n\nextern JS_FRIEND_API(JS::Zone *)\nGetCompartmentZone(JSCompartment *comp);\n\ntypedef bool\n(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);\n\n /*\n  * Dump the complete object graph of heap-allocated things.\n  * fp is the file for the dump output.\n  */\nextern JS_FRIEND_API(void)\nDumpHeapComplete(JSRuntime *rt, FILE *fp);\n\n#ifdef OLD_GETTER_SETTER_METHODS\nJS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);\nJS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);\n#endif\n\nextern JS_FRIEND_API(bool)\nIsSystemCompartment(JSCompartment *comp);\n\nextern JS_FRIEND_API(bool)\nIsSystemZone(JS::Zone *zone);\n\nextern JS_FRIEND_API(bool)\nIsAtomsCompartment(JSCompartment *comp);\n\n/*\n * Check whether it is OK to assign an undeclared variable with the name\n * |propname| at the current location in script.  It is not an error if there is\n * no current script location, or if that location is not an assignment to an\n * undeclared variable.  Reports an error if one needs to be reported (and,\n * particularly, always reports when it returns false).\n */\nextern JS_FRIEND_API(bool)\nReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname);\n\n/*\n * Returns whether we're in a non-strict property set (in that we're in a\n * non-strict script and the bytecode we're on is a property set).  The return\n * value does NOT indicate any sort of exception was thrown: it's just a\n * boolean.\n */\nextern JS_FRIEND_API(bool)\nIsInNonStrictPropertySet(JSContext *cx);\n\nstruct WeakMapTracer;\n\n/*\n * Weak map tracer callback, called once for every binding of every\n * weak map that was live at the time of the last garbage collection.\n *\n * m will be NULL if the weak map is not contained in a JS Object.\n */\ntypedef void\n(* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m,\n                         void *k, JSGCTraceKind kkind,\n                         void *v, JSGCTraceKind vkind);\n\nstruct WeakMapTracer {\n    JSRuntime            *runtime;\n    WeakMapTraceCallback callback;\n\n    WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb)\n        : runtime(rt), callback(cb) {}\n};\n\nextern JS_FRIEND_API(void)\nTraceWeakMaps(WeakMapTracer *trc);\n\nextern JS_FRIEND_API(bool)\nAreGCGrayBitsValid(JSRuntime *rt);\n\ntypedef void\n(*GCThingCallback)(void *closure, void *gcthing);\n\nextern JS_FRIEND_API(void)\nVisitGrayWrapperTargets(JS::Zone *zone, GCThingCallback callback, void *closure);\n\nextern JS_FRIEND_API(JSObject *)\nGetWeakmapKeyDelegate(JSObject *key);\n\nJS_FRIEND_API(JSGCTraceKind)\nGCThingTraceKind(void *thing);\n\n/*\n * Invoke cellCallback on every gray JS_OBJECT in the given zone.\n */\nextern JS_FRIEND_API(void)\nIterateGrayObjects(JS::Zone *zone, GCThingCallback cellCallback, void *data);\n\n#ifdef JS_HAS_CTYPES\nextern JS_FRIEND_API(size_t)\nSizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj);\n#endif\n\nextern JS_FRIEND_API(JSCompartment *)\nGetAnyCompartmentInZone(JS::Zone *zone);\n\n/*\n * Shadow declarations of JS internal structures, for access by inline access\n * functions below. Do not use these structures in any other way. When adding\n * new fields for access by inline methods, make sure to add static asserts to\n * the original header file to ensure that offsets are consistent.\n */\nnamespace shadow {\n\nstruct TypeObject {\n    Class       *clasp;\n    JSObject    *proto;\n};\n\nstruct BaseShape {\n    js::Class *clasp;\n    JSObject *parent;\n    JSObject *_1;\n    JSCompartment *compartment;\n};\n\nclass Shape {\npublic:\n    shadow::BaseShape *base;\n    jsid              _1;\n    uint32_t          slotInfo;\n\n    static const uint32_t FIXED_SLOTS_SHIFT = 27;\n};\n\nstruct Object {\n    shadow::Shape      *shape;\n    shadow::TypeObject *type;\n    js::Value          *slots;\n    js::Value          *_1;\n\n    size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }\n    Value *fixedSlots() const {\n        return (Value *)(uintptr_t(this) + sizeof(shadow::Object));\n    }\n\n    js::Value &slotRef(size_t slot) const {\n        size_t nfixed = numFixedSlots();\n        if (slot < nfixed)\n            return fixedSlots()[slot];\n        return slots[slot - nfixed];\n    }\n};\n\nstruct Function {\n    Object base;\n    uint16_t nargs;\n    uint16_t flags;\n    /* Used only for natives */\n    Native native;\n    const JSJitInfo *jitinfo;\n    void *_1;\n};\n\nstruct Atom {\n    static const size_t LENGTH_SHIFT = 4;\n    size_t lengthAndFlags;\n    const jschar *chars;\n};\n\n} /* namespace shadow */\n\n// These are equal to |&{Function,Object,OuterWindow}ProxyObject::class_|.  Use\n// them in places where you don't want to #include vm/ProxyObject.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) ObjectProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) OuterWindowProxyClassPtr;\n\n// This is equal to |&JSObject::class_|.  Use it in places where you don't want\n// to #include jsobj.h.\nextern JS_FRIEND_DATA(js::Class* const) ObjectClassPtr;\n\ninline js::Class *\nGetObjectClass(JSObject *obj)\n{\n    return reinterpret_cast<const shadow::Object*>(obj)->type->clasp;\n}\n\ninline JSClass *\nGetObjectJSClass(JSObject *obj)\n{\n    return js::Jsvalify(GetObjectClass(obj));\n}\n\ninline bool\nIsInnerObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.outerObject;\n}\n\ninline bool\nIsOuterObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.innerObject;\n}\n\nJS_FRIEND_API(bool)\nIsFunctionObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsScopeObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsCallObject(JSObject *obj);\n\ninline JSObject *\nGetObjectParent(JSObject *obj)\n{\n    JS_ASSERT(!IsScopeObject(obj));\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->parent;\n}\n\nstatic JS_ALWAYS_INLINE JSCompartment *\nGetObjectCompartment(JSObject *obj)\n{\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->compartment;\n}\n\nJS_FRIEND_API(JSObject *)\nGetObjectParentMaybeScope(JSObject *obj);\n\nJS_FRIEND_API(JSObject *)\nGetGlobalForObjectCrossCompartment(JSObject *obj);\n\n// For legacy consumers only. This whole concept is going away soon.\nJS_FRIEND_API(JSObject *)\nDefaultObjectForContextOrNull(JSContext *cx);\n\nJS_FRIEND_API(void)\nSetDefaultObjectForContext(JSContext *cx, JSObject *obj);\n\nJS_FRIEND_API(void)\nNotifyAnimationActivity(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsOriginalScriptFunction(JSFunction *fun);\n\n/*\n * Return the outermost enclosing function (script) of the scripted caller.\n * This function returns NULL in several cases:\n *  - no script is running on the context\n *  - the caller is in global or eval code\n * In particular, this function will \"stop\" its outermost search at eval() and\n * thus it will really return the outermost enclosing function *since the\n * innermost eval*.\n */\nJS_FRIEND_API(JSScript *)\nGetOutermostEnclosingFunctionOfScriptedCaller(JSContext *cx);\n\nJS_FRIEND_API(JSFunction *)\nDefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                           unsigned nargs, unsigned attrs);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                        JSObject *parent, const char *name);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,\n                            JSObject *parent, jsid id);\n\nJS_FRIEND_API(JSObject *)\nInitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n                      JSClass *clasp, JSNative constructor, unsigned nargs,\n                      const JSPropertySpec *ps, const JSFunctionSpec *fs,\n                      const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\nJS_FRIEND_API(const Value &)\nGetFunctionNativeReserved(JSObject *fun, size_t which);\n\nJS_FRIEND_API(void)\nSetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val);\n\ninline bool\nGetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)\n{\n    js::Class *clasp = GetObjectClass(obj);\n    if (clasp == js::ObjectProxyClassPtr ||\n        clasp == js::OuterWindowProxyClassPtr ||\n        clasp == js::FunctionProxyClassPtr)\n    {\n        return JS_GetPrototype(cx, obj, proto);\n    }\n\n    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);\n    return true;\n}\n\ninline void *\nGetObjectPrivate(JSObject *obj)\n{\n    const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);\n    void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);\n    return *addr;\n}\n\n/*\n * Get a slot that is both reserved for object's clasp *and* is fixed (fits\n * within the maximum capacity for the object's fixed slots).\n */\ninline const Value &\nGetReservedSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\nJS_FRIEND_API(void)\nSetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);\n\ninline void\nSetReservedSlot(JSObject *obj, size_t slot, const Value &value)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);\n    if (sobj->slotRef(slot).isMarkable()\n#ifdef JSGC_GENERATIONAL\n        || value.isMarkable()\n#endif\n       )\n    {\n        SetReservedSlotWithBarrier(obj, slot, value);\n    } else {\n        sobj->slotRef(slot) = value;\n    }\n}\n\nJS_FRIEND_API(uint32_t)\nGetObjectSlotSpan(JSObject *obj);\n\ninline const Value &\nGetObjectSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < GetObjectSlotSpan(obj));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\ninline const jschar *\nGetAtomChars(JSAtom *atom)\n{\n    return reinterpret_cast<shadow::Atom *>(atom)->chars;\n}\n\ninline size_t\nGetAtomLength(JSAtom *atom)\n{\n    using shadow::Atom;\n    return reinterpret_cast<Atom*>(atom)->lengthAndFlags >> Atom::LENGTH_SHIFT;\n}\n\ninline JSLinearString *\nAtomToLinearString(JSAtom *atom)\n{\n    return reinterpret_cast<JSLinearString *>(atom);\n}\n\nstatic inline js::PropertyOp\nCastAsJSPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object);\n}\n\nstatic inline js::StrictPropertyOp\nCastAsJSStrictPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object);\n}\n\nJS_FRIEND_API(bool)\nGetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);\n\nJS_FRIEND_API(bool)\nAppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others);\n\nJS_FRIEND_API(bool)\nGetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);\n\nJS_FRIEND_API(bool)\nStringIsArrayIndex(JSLinearString *str, uint32_t *indexp);\n\nJS_FRIEND_API(void)\nSetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);\n\nJS_FRIEND_API(bool)\nIsObjectInContextCompartment(JSObject *obj, const JSContext *cx);\n\n/*\n * NB: these flag bits are encoded into the bytecode stream in the immediate\n * operand of JSOP_ITER, so don't change them without advancing vm/Xdr.h's\n * XDR_BYTECODE_VERSION.\n */\n#define JSITER_ENUMERATE  0x1   /* for-in compatible hidden default iterator */\n#define JSITER_FOREACH    0x2   /* return [key, value] pair rather than key */\n#define JSITER_KEYVALUE   0x4   /* destructuring for-in wants [key, value] */\n#define JSITER_OWNONLY    0x8   /* iterate over obj's own properties only */\n#define JSITER_HIDDEN     0x10  /* also enumerate non-enumerable properties */\n#define JSITER_FOR_OF     0x20  /* harmony for-of loop */\n\ninline uintptr_t\nGetNativeStackLimit(const JSRuntime *rt)\n{\n    return PerThreadDataFriendFields::getMainThread(rt)->nativeStackLimit;\n}\n\ninline uintptr_t\nGetNativeStackLimit(JSContext *cx)\n{\n    return GetNativeStackLimit(GetRuntime(cx));\n}\n\n/*\n * These macros report a stack overflow and run |onerror| if we are close to\n * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a little\n * extra space so that we can ensure that crucial code is able to run.\n */\n\n#define JS_CHECK_RECURSION(cx, onerror)                              \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), &stackDummy_)) {  \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, sp, onerror)                 \\\n    JS_BEGIN_MACRO                                                              \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), sp)) {            \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_CHROME_RECURSION(cx, onerror)                                  \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE_WITH_TOLERANCE(js::GetNativeStackLimit(cx),    \\\n                                                &stackDummy_,                   \\\n                                                1024 * sizeof(size_t)))         \\\n        {                                                                       \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\nJS_FRIEND_API(void)\nStartPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nStopPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nPurgePCCounts(JSContext *cx);\n\nJS_FRIEND_API(size_t)\nGetPCCountScriptCount(JSContext *cx);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptSummary(JSContext *cx, size_t script);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptContents(JSContext *cx, size_t script);\n\n/*\n * A call stack can be specified to the JS engine such that all JS entry/exits\n * to functions push/pop an entry to/from the specified stack.\n *\n * For more detailed information, see vm/SPSProfiler.h\n */\nclass ProfileEntry\n{\n    /*\n     * All fields are marked volatile to prevent the compiler from re-ordering\n     * instructions. Namely this sequence:\n     *\n     *    entry[size] = ...;\n     *    size++;\n     *\n     * If the size modification were somehow reordered before the stores, then\n     * if a sample were taken it would be examining bogus information.\n     *\n     * A ProfileEntry represents both a C++ profile entry and a JS one. Both use\n     * the string as a description, but JS uses the sp as NULL to indicate that\n     * it is a JS entry. The script_ is then only ever examined for a JS entry,\n     * and the idx is used by both, but with different meanings.\n     */\n    const char * volatile string; // Descriptive string of this entry\n    void * volatile sp;           // Relevant stack pointer for the entry\n    JSScript * volatile script_;  // if js(), non-null script which is running\n    int32_t volatile idx;         // if js(), idx of pc, otherwise line number\n\n  public:\n    /*\n     * All of these methods are marked with the 'volatile' keyword because SPS's\n     * representation of the stack is stored such that all ProfileEntry\n     * instances are volatile. These methods would not be available unless they\n     * were marked as volatile as well\n     */\n\n    bool js() volatile {\n        JS_ASSERT_IF(sp == NULL, script_ != NULL);\n        return sp == NULL;\n    }\n\n    uint32_t line() volatile { JS_ASSERT(!js()); return idx; }\n    JSScript *script() volatile { JS_ASSERT(js()); return script_; }\n    void *stackAddress() volatile { return sp; }\n    const char *label() volatile { return string; }\n\n    void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }\n    void setLabel(const char *aString) volatile { string = aString; }\n    void setStackAddress(void *aSp) volatile { sp = aSp; }\n    void setScript(JSScript *aScript) volatile { script_ = aScript; }\n\n    /* we can't know the layout of JSScript, so look in vm/SPSProfiler.cpp */\n    JS_FRIEND_API(jsbytecode *) pc() volatile;\n    JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile;\n\n    static size_t offsetOfString() { return offsetof(ProfileEntry, string); }\n    static size_t offsetOfStackAddress() { return offsetof(ProfileEntry, sp); }\n    static size_t offsetOfPCIdx() { return offsetof(ProfileEntry, idx); }\n    static size_t offsetOfScript() { return offsetof(ProfileEntry, script_); }\n\n    /*\n     * The index used in the entry can either be a line number or the offset of\n     * a pc into a script's code. To signify a NULL pc, use a -1 index. This is\n     * checked against in pc() and setPC() to set/get the right pc.\n     */\n    static const int32_t NullPCIndex = -1;\n};\n\nJS_FRIEND_API(void)\nSetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,\n                         uint32_t max);\n\nJS_FRIEND_API(void)\nEnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);\n\nJS_FRIEND_API(jsbytecode*)\nProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);\n\n#ifdef JS_THREADSAFE\nJS_FRIEND_API(bool)\nContextHasOutstandingRequests(const JSContext *cx);\n#endif\n\nJS_FRIEND_API(bool)\nHasUnrootedGlobal(const JSContext *cx);\n\ntypedef void\n(* ActivityCallback)(void *arg, JSBool active);\n\n/*\n * Sets a callback that is run whenever the runtime goes idle - the\n * last active request ceases - and begins activity - when it was\n * idle and a request begins.\n */\nJS_FRIEND_API(void)\nSetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg);\n\nextern JS_FRIEND_API(const JSStructuredCloneCallbacks *)\nGetContextStructuredCloneCallbacks(JSContext *cx);\n\nextern JS_FRIEND_API(bool)\nCanCallContextDebugHandler(JSContext *cx);\n\nextern JS_FRIEND_API(JSTrapStatus)\nCallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);\n\nextern JS_FRIEND_API(bool)\nIsContextRunningJS(JSContext *cx);\n\ntypedef void\n(* AnalysisPurgeCallback)(JSRuntime *rt, JS::Handle<JSFlatString*> desc);\n\nextern JS_FRIEND_API(AnalysisPurgeCallback)\nSetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback);\n\ntypedef JSBool\n(* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID,\n                                 uint32_t depth);\nstruct JSDOMCallbacks {\n    DOMInstanceClassMatchesProto instanceClassMatchesProto;\n};\ntypedef struct JSDOMCallbacks DOMCallbacks;\n\nextern JS_FRIEND_API(void)\nSetDOMCallbacks(JSRuntime *rt, const DOMCallbacks *callbacks);\n\nextern JS_FRIEND_API(const DOMCallbacks *)\nGetDOMCallbacks(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nGetTestingFunctions(JSContext *cx);\n\n/*\n * Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not\n * available and the compiler does not know that FreeOp inherits from\n * JSFreeOp.\n */\ninline JSFreeOp *\nCastToJSFreeOp(FreeOp *fop)\n{\n    return reinterpret_cast<JSFreeOp *>(fop);\n}\n\n/* Implemented in jsexn.cpp. */\n\n/*\n * Get an error type name from a JSExnType constant.\n * Returns NULL for invalid arguments and JSEXN_INTERNALERR\n */\nextern JS_FRIEND_API(const jschar*)\nGetErrorTypeName(JSContext* cx, int16_t exnType);\n\n#ifdef DEBUG\nextern JS_FRIEND_API(unsigned)\nGetEnterCompartmentDepth(JSContext* cx);\n#endif\n\n/* Implemented in jswrapper.cpp. */\ntypedef enum NukeReferencesToWindow {\n    NukeWindowReferences,\n    DontNukeWindowReferences\n} NukeReferencesToWindow;\n\n/*\n * These filters are designed to be ephemeral stack classes, and thus don't\n * do any rooting or holding of their members.\n */\nstruct CompartmentFilter {\n    virtual bool match(JSCompartment *c) const = 0;\n};\n\nstruct AllCompartments : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const { return true; }\n};\n\nstruct ContentCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return !IsSystemCompartment(c);\n    }\n};\n\nstruct ChromeCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return IsSystemCompartment(c);\n    }\n};\n\nstruct SingleCompartment : public CompartmentFilter {\n    JSCompartment *ours;\n    SingleCompartment(JSCompartment *c) : ours(c) {}\n    virtual bool match(JSCompartment *c) const { return c == ours; }\n};\n\nstruct CompartmentsWithPrincipals : public CompartmentFilter {\n    JSPrincipals *principals;\n    CompartmentsWithPrincipals(JSPrincipals *p) : principals(p) {}\n    virtual bool match(JSCompartment *c) const {\n        return JS_GetCompartmentPrincipals(c) == principals;\n    }\n};\n\nextern JS_FRIEND_API(JSBool)\nNukeCrossCompartmentWrappers(JSContext* cx,\n                             const CompartmentFilter& sourceFilter,\n                             const CompartmentFilter& targetFilter,\n                             NukeReferencesToWindow nukeReferencesToWindow);\n\n/* Specify information about DOMProxy proxies in the DOM, for use by ICs. */\n\n/*\n * The DOMProxyShadowsCheck function will be called to check if the property for\n * id should be gotten from the prototype, or if there is an own property that\n * shadows it.\n * If DoesntShadow is returned then the slot at listBaseExpandoSlot should\n * either be undefined or point to an expando object that would contain the own\n * property.\n * If DoesntShadowUnique is returned then the slot at listBaseExpandoSlot should\n * contain a private pointer to a ExpandoAndGeneration, which contains a\n * JS::Value that should either be undefined or point to an expando object, and\n * a uint32 value. If that value changes then the IC for getting a property will\n * be invalidated.\n */\n\nstruct ExpandoAndGeneration {\n  ExpandoAndGeneration()\n    : expando(UndefinedValue()),\n      generation(0)\n  {}\n\n  void Unlink()\n  {\n      ++generation;\n      expando.setUndefined();\n  }\n\n  JS::Heap<JS::Value> expando;\n  uint32_t generation;\n};\n\ntypedef enum DOMProxyShadowsResult {\n  ShadowCheckFailed,\n  Shadows,\n  DoesntShadow,\n  DoesntShadowUnique\n} DOMProxyShadowsResult;\ntypedef DOMProxyShadowsResult\n(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);\nJS_FRIEND_API(void)\nSetDOMProxyInformation(void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,\n                       DOMProxyShadowsCheck domProxyShadowsCheck);\n\nvoid *GetDOMProxyHandlerFamily();\nuint32_t GetDOMProxyExpandoSlot();\nDOMProxyShadowsCheck GetDOMProxyShadowsCheck();\n\n} /* namespace js */\n\n/* Implemented in jsdate.cpp. */\n\n/*\n * Detect whether the internal date value is NaN.  (Because failure is\n * out-of-band for js_DateGet*)\n */\nextern JS_FRIEND_API(JSBool)\njs_DateIsValid(JSObject* obj);\n\nextern JS_FRIEND_API(double)\njs_DateGetMsecSinceEpoch(JSObject *obj);\n\n/* Implemented in jscntxt.cpp. */\n\n/*\n * Report an exception, which is currently realized as a printf-style format\n * string and its arguments.\n */\ntypedef enum JSErrNum {\n#define MSG_DEF(name, number, count, exception, format) \\\n    name = number,\n#include \"js.msg\"\n#undef MSG_DEF\n    JSErr_Limit\n} JSErrNum;\n\nextern JS_FRIEND_API(const JSErrorFormatString *)\njs_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);\n\n/* Implemented in jsclone.cpp. */\n\nextern JS_FRIEND_API(uint64_t)\njs_GetSCOffset(JSStructuredCloneWriter* writer);\n\n/* Typed Array functions, implemented in jstypedarray.cpp */\n\nnamespace js {\nnamespace ArrayBufferView {\n\nenum ViewType {\n    TYPE_INT8 = 0,\n    TYPE_UINT8,\n    TYPE_INT16,\n    TYPE_UINT16,\n    TYPE_INT32,\n    TYPE_UINT32,\n    TYPE_FLOAT32,\n    TYPE_FLOAT64,\n\n    /*\n     * Special type that is a uint8_t, but assignments are clamped to [0, 256).\n     * Treat the raw data type as a uint8_t.\n     */\n    TYPE_UINT8_CLAMPED,\n\n    /*\n     * Type returned for a DataView. Note that there is no single element type\n     * in this case.\n     */\n    TYPE_DATAVIEW,\n\n    TYPE_MAX\n};\n\n} /* namespace ArrayBufferView */\n\n/*\n * A helper for building up an ArrayBuffer object's data\n * before creating the ArrayBuffer itself.  Will do doubling\n * based reallocation, up to an optional maximum growth given.\n *\n * When all the data has been appended, call getArrayBuffer,\n * passing in the JSContext* for which the ArrayBuffer object\n * is to be created.  This also implicitly resets the builder,\n * or it can be reset explicitly at any point by calling reset().\n */\nclass ArrayBufferBuilder\n{\n    void *rawcontents_;\n    uint8_t *dataptr_;\n    uint32_t capacity_;\n    uint32_t length_;\n  public:\n    ArrayBufferBuilder()\n        : rawcontents_(NULL),\n          dataptr_(NULL),\n          capacity_(0),\n          length_(0)\n    {\n    }\n\n    ~ArrayBufferBuilder() {\n        reset();\n    }\n\n    void reset() {\n        if (rawcontents_)\n            JS_free(NULL, rawcontents_);\n        rawcontents_ = dataptr_ = NULL;\n        capacity_ = length_ = 0;\n    }\n\n    // will truncate if newcap is < length()\n    bool setCapacity(uint32_t newcap) {\n        if (!JS_ReallocateArrayBufferContents(NULL, newcap, &rawcontents_, &dataptr_))\n            return false;\n\n        capacity_ = newcap;\n        if (length_ > newcap)\n            length_ = newcap;\n\n        return true;\n    }\n\n    // Append datalen bytes from data to the current buffer.  If we\n    // need to grow the buffer, grow by doubling the size up to a\n    // maximum of maxgrowth (if given).  If datalen is greater than\n    // what the new capacity would end up as, then grow by datalen.\n    //\n    // The data parameter must not overlap with anything beyond the\n    // builder's current valid contents [0..length)\n    bool append(const uint8_t *newdata, uint32_t datalen, uint32_t maxgrowth = 0) {\n        if (length_ + datalen > capacity_) {\n            uint32_t newcap;\n            // double while under maxgrowth or if not specified\n            if (!maxgrowth || capacity_ < maxgrowth)\n                newcap = capacity_ * 2;\n            else\n                newcap = capacity_ + maxgrowth;\n\n            // but make sure there's always enough to satisfy our request\n            if (newcap < length_ + datalen)\n                newcap = length_ + datalen;\n\n            // did we overflow?\n            if (newcap < capacity_)\n                return false;\n\n            if (!setCapacity(newcap))\n                return false;\n        }\n\n        // assert that the region isn't overlapping so we can memcpy;\n        JS_ASSERT(!areOverlappingRegions(newdata, datalen, dataptr_ + length_, datalen));\n\n        memcpy(dataptr_ + length_, newdata, datalen);\n        length_ += datalen;\n\n        return true;\n    }\n\n    uint8_t *data() {\n        return dataptr_;\n    }\n\n    uint32_t length() {\n        return length_;\n    }\n\n    uint32_t capacity() {\n        return capacity_;\n    }\n\n    JSObject* getArrayBuffer(JSContext *cx) {\n        // we need to check for length_ == 0, because nothing may have been\n        // added\n        if (capacity_ > length_ || length_ == 0) {\n            if (!setCapacity(length_))\n                return NULL;\n        }\n\n        JSObject* obj = JS_NewArrayBufferWithContents(cx, rawcontents_);\n        if (!obj)\n            return NULL;\n\n        rawcontents_ = dataptr_ = NULL;\n        length_ = capacity_ = 0;\n\n        return obj;\n    }\n\nprotected:\n\n    static bool areOverlappingRegions(const uint8_t *start1, uint32_t length1,\n                                      const uint8_t *start2, uint32_t length2)\n    {\n        const uint8_t *end1 = start1 + length1;\n        const uint8_t *end2 = start2 + length2;\n\n        const uint8_t *max_start = start1 > start2 ? start1 : start2;\n        const uint8_t *min_end   = end1 < end2 ? end1 : end2;\n\n        return max_start < min_end;\n    }\n};\n\n} /* namespace js */\n\ntypedef js::ArrayBufferView::ViewType JSArrayBufferViewType;\n\n/*\n * Create a new typed array with nelements elements.\n *\n * These functions (except the WithBuffer variants) fill in the array with zeros.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64Array(JSContext *cx, uint32_t nelements);\n\n/*\n * Create a new typed array and copy in values from the given object. The\n * object is used as if it were an array; that is, the new array (if\n * successfully created) will have length given by array.length, and its\n * elements will be those specified by array[0], array[1], and so on, after\n * conversion to the typed array element type.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array);\n\n/*\n * Create a new typed array using the given ArrayBuffer for storage.  The\n * length value is optional; if -1 is passed, enough elements to use up the\n * remainder of the byte array is used as the default value.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                          uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                                  uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\n\n/*\n * Create a new ArrayBuffer with the given byte length.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);\n\n/*\n * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return\n * false if a security wrapper is encountered that denies the unwrapping. If\n * this test or one of the JS_Is*Array tests succeeds, then it is safe to call\n * the various accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsTypedArrayObject(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test or one of the more specific tests succeeds, then it\n * is safe to call the various ArrayBufferView accessor JSAPI calls defined\n * below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * Test for specific typed array types (ArrayBufferView subtypes)\n */\n\nextern JS_FRIEND_API(JSBool)\nJS_IsInt8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8ClampedArray(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat64Array(JSObject *obj);\n\n/*\n * Unwrap Typed arrays all at once. Return NULL without throwing if the object\n * cannot be viewed as the correct typed array, or the typed array object on\n * success, filling both outparameters.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt8Array(JSObject *obj, uint32_t *length, int8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8Array(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8ClampedArray(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt16Array(JSObject *obj, uint32_t *length, int16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint16Array(JSObject *obj, uint32_t *length, uint16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt32Array(JSObject *obj, uint32_t *length, int32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint32Array(JSObject *obj, uint32_t *length, uint32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat32Array(JSObject *obj, uint32_t *length, float **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat64Array(JSObject *obj, uint32_t *length, double **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBufferView(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBuffer(JSObject *obj, uint32_t *length, uint8_t **data);\n\n/*\n * Get the type of elements in a typed array, or TYPE_DATAVIEW if a DataView.\n *\n * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is an ArrayBufferView or a\n * wrapper of an ArrayBufferView, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(JSArrayBufferViewType)\nJS_GetArrayBufferViewType(JSObject *obj);\n\n/*\n * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test succeeds, then it is safe to call the various\n * accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferObject(JSObject *obj);\n\n/*\n * Return the available byte length of an array buffer.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferByteLength(JSObject *obj);\n\n/*\n * Return a pointer to an array buffer's data. The buffer is still owned by the\n * array buffer object, and should not be modified on another thread. The\n * returned pointer is stable across GCs.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint8_t *)\nJS_GetArrayBufferData(JSObject *obj);\n\n/*\n * Return the number of elements in a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayLength(JSObject *obj);\n\n/*\n * Return the byte offset from the start of an array buffer to the start of a\n * typed array view.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteLength(JSObject *obj);\n\n/*\n * Check whether obj supports JS_ArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * More generic name for JS_GetTypedArrayByteLength to cover DataViews as well\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the start of the data referenced by a typed array. The\n * data is still owned by the typed array, and should not be modified on\n * another thread.\n *\n * |obj| must have passed a JS_Is*Array test, or somehow be known that it would\n * pass such a test: it is a typed array or a wrapper of a typed array, and the\n * unwrapping will succeed.\n */\n\nextern JS_FRIEND_API(int8_t *)\nJS_GetInt8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ClampedArrayData(JSObject *obj);\nextern JS_FRIEND_API(int16_t *)\nJS_GetInt16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint16_t *)\nJS_GetUint16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(int32_t *)\nJS_GetInt32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint32_t *)\nJS_GetUint32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(float *)\nJS_GetFloat32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(double *)\nJS_GetFloat64ArrayData(JSObject *obj);\n\n/*\n * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific\n * versions when possible.\n */\nextern JS_FRIEND_API(void *)\nJS_GetArrayBufferViewData(JSObject *obj);\n\n/*\n * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been\n * neutered, this will still return the neutered buffer. |obj| must be an\n * object that would return true for JS_IsArrayBufferViewObject().\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetArrayBufferViewBuffer(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetDataView* APIs.\n */\nJS_FRIEND_API(JSBool)\nJS_IsDataViewObject(JSObject *obj);\n\n/*\n * Return the byte offset of a data view into its array buffer. |obj| must be a\n * DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a data view.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the beginning of the data referenced by a DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(void *)\nJS_GetDataViewData(JSObject *obj);\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitGetterOp.\n */\nclass JSJitGetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitGetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args.rval())\n    {}\n\n    explicit JSJitGetterCallArgs(JS::Rooted<JS::Value>* rooted)\n      : JS::MutableHandleValue(rooted)\n    {}\n\n    JS::MutableHandleValue rval() {\n        return *this;\n    }\n};\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitSetterOp.\n */\nclass JSJitSetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitSetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args[0])\n    {}\n\n    JS::MutableHandleValue operator[](unsigned i) {\n        MOZ_ASSERT(i == 0);\n        return *this;\n    }\n\n    unsigned length() const { return 1; }\n\n    // Add get() or maybe hasDefined() as needed\n};\n\nstruct JSJitMethodCallArgsTraits;\n\n/*\n * A class, expected to be passed by reference, which represents the CallArgs\n * for a JSJitMethodOp.\n */\nclass JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUsedRval>\n{\n  private:\n    typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;\n    friend struct JSJitMethodCallArgsTraits;\n\n  public:\n    explicit JSJitMethodCallArgs(const JS::CallArgs& args) {\n        argv_ = args.array();\n        argc_ = args.length();\n    }\n\n    JS::MutableHandleValue rval() const {\n        return Base::rval();\n    }\n\n    unsigned length() const { return Base::length(); }\n\n    JS::MutableHandleValue operator[](unsigned i) const {\n        return Base::operator[](i);\n    }\n\n    bool hasDefined(unsigned i) const {\n        return Base::hasDefined(i);\n    }\n\n    // Add get() as needed\n};\n\nstruct JSJitMethodCallArgsTraits\n{\n    static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);\n    static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);\n};\n\n/*\n * This struct contains metadata passed from the DOM to the JS Engine for JIT\n * optimizations on DOM property accessors. Eventually, this should be made\n * available to general JSAPI users, but we are not currently ready to do so.\n */\ntypedef bool\n(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitGetterCallArgs args);\ntypedef bool\n(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitSetterCallArgs args);\ntypedef bool\n(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, const JSJitMethodCallArgs& args);\n\nstruct JSJitInfo {\n    enum OpType {\n        Getter,\n        Setter,\n        Method,\n        OpType_None\n    };\n\n    union {\n        JSJitGetterOp getter;\n        JSJitSetterOp setter;\n        JSJitMethodOp method;\n    };\n    uint32_t protoID;\n    uint32_t depth;\n    OpType type;\n    bool isInfallible;      /* Is op fallible? False in setters. */\n    bool isConstant;        /* Getting a construction-time constant? */\n    bool isPure;            /* As long as no non-pure DOM things happen, will\n                               keep returning the same value for the given\n                               \"this\" object\" */\n    JSValueType returnType; /* The return type tag.  Might be JSVAL_TYPE_UNKNOWN */\n\n    /* An alternative native that's safe to call in parallel mode. */\n    JSParallelNative parallelNative;\n};\n\n#define JS_JITINFO_NATIVE_PARALLEL(op)                                         \\\n    {{NULL},0,0,JSJitInfo::OpType_None,false,false,false,JSVAL_TYPE_MISSING,op}\n\nstatic JS_ALWAYS_INLINE const JSJitInfo *\nFUNCTION_VALUE_TO_JITINFO(const JS::Value& v)\n{\n    JS_ASSERT(js::GetObjectClass(&v.toObject()) == js::FunctionClassPtr);\n    return reinterpret_cast<js::shadow::Function *>(&v.toObject())->jitinfo;\n}\n\n/* Statically asserted in jsfun.h. */\nstatic const unsigned JS_FUNCTION_INTERPRETED_BIT = 0x1;\n\nstatic JS_ALWAYS_INLINE void\nSET_JITINFO(JSFunction * func, const JSJitInfo *info)\n{\n    js::shadow::Function *fun = reinterpret_cast<js::shadow::Function *>(func);\n    JS_ASSERT(!(fun->flags & JS_FUNCTION_INTERPRETED_BIT));\n    fun->jitinfo = info;\n}\n\n/*\n * Engine-internal extensions of jsid.  This code is here only until we\n * eliminate Gecko's dependencies on it!\n */\n\nstatic JS_ALWAYS_INLINE jsid\nJSID_FROM_BITS(size_t bits)\n{\n    jsid id;\n    JSID_BITS(id) = bits;\n    return id;\n}\n\n/*\n * Must not be used on atoms that are representable as integer jsids.\n * Prefer NameToId or AtomToId over this function:\n *\n * A PropertyName is an atom that does not contain an integer in the range\n * [0, UINT32_MAX]. However, jsid can only hold an integer in the range\n * [0, JSID_INT_MAX] (where JSID_INT_MAX == 2^31-1).  Thus, for the range of\n * integers (JSID_INT_MAX, UINT32_MAX], to represent as a jsid 'id', it must be\n * the case JSID_IS_ATOM(id) and !JSID_TO_ATOM(id)->isPropertyName().  In most\n * cases when creating a jsid, code does not have to care about this corner\n * case because:\n *\n * - When given an arbitrary JSAtom*, AtomToId must be used, which checks for\n *   integer atoms representable as integer jsids, and does this conversion.\n *\n * - When given a PropertyName*, NameToId can be used which which does not need\n *   to do any dynamic checks.\n *\n * Thus, it is only the rare third case which needs this function, which\n * handles any JSAtom* that is known not to be representable with an int jsid.\n */\nstatic JS_ALWAYS_INLINE jsid\nNON_INTEGER_ATOM_TO_JSID(JSAtom *atom)\n{\n    JS_ASSERT(((size_t)atom & 0x7) == 0);\n    jsid id = JSID_FROM_BITS((size_t)atom);\n    JS_ASSERT(id == INTERNED_STRING_TO_JSID(NULL, (JSString*)atom));\n    return id;\n}\n\n/* All strings stored in jsids are atomized, but are not necessarily property names. */\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id)\n{\n    return JSID_IS_STRING(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id, JSAtom *atom)\n{\n    return id == JSID_FROM_BITS((size_t)atom);\n}\n\nstatic JS_ALWAYS_INLINE JSAtom *\nJSID_TO_ATOM(jsid id)\n{\n    return (JSAtom *)JSID_TO_STRING(id);\n}\n\nJS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD);\n\nnamespace js {\n\nstatic JS_ALWAYS_INLINE Value\nIdToValue(jsid id)\n{\n    if (JSID_IS_STRING(id))\n        return StringValue(JSID_TO_STRING(id));\n    if (JS_LIKELY(JSID_IS_INT(id)))\n        return Int32Value(JSID_TO_INT(id));\n    if (JS_LIKELY(JSID_IS_OBJECT(id)))\n        return ObjectValue(*JSID_TO_OBJECT(id));\n    JS_ASSERT(JSID_IS_VOID(id));\n    return UndefinedValue();\n}\n\nstatic JS_ALWAYS_INLINE jsval\nIdToJsval(jsid id)\n{\n    return IdToValue(id);\n}\n\nextern JS_FRIEND_API(bool)\nIsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method);\n\nextern JS_FRIEND_API(bool)\nIsTypedArrayThisCheck(JS::IsAcceptableThis test);\n\nenum CTypesActivityType {\n    CTYPES_CALL_BEGIN,\n    CTYPES_CALL_END,\n    CTYPES_CALLBACK_BEGIN,\n    CTYPES_CALLBACK_END\n};\n\ntypedef void\n(* CTypesActivityCallback)(JSContext *cx, CTypesActivityType type);\n\n/*\n * Sets a callback that is run whenever js-ctypes is about to be used when\n * calling into C.\n */\nJS_FRIEND_API(void)\nSetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);\n\nclass JS_FRIEND_API(AutoCTypesActivityCallback) {\n  private:\n    JSContext *cx;\n    CTypesActivityCallback callback;\n    CTypesActivityType endType;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n  public:\n    AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,\n                               CTypesActivityType endType\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM);\n    ~AutoCTypesActivityCallback() {\n        DoEndCallback();\n    }\n    void DoEndCallback() {\n        if (callback) {\n            callback(cx, endType);\n            callback = NULL;\n        }\n    }\n};\n\n#ifdef DEBUG\nextern JS_FRIEND_API(void)\nassertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);\n#else\ninline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {};\n#endif\n\ntypedef bool\n(* ObjectMetadataCallback)(JSContext *cx, JSObject **pmetadata);\n\n/*\n * Specify a callback to invoke when creating each JS object in the current\n * compartment, which may return a metadata object to associate with the\n * object. Objects with different metadata have different shape hierarchies,\n * so for efficiency, objects should generally try to share metadata objects.\n */\nJS_FRIEND_API(void)\nSetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback);\n\n/* Manipulate the metadata associated with an object. */\n\nJS_FRIEND_API(bool)\nSetObjectMetadata(JSContext *cx, JS::HandleObject obj, JS::HandleObject metadata);\n\nJS_FRIEND_API(JSObject *)\nGetObjectMetadata(JSObject *obj);\n\n/* ES5 8.12.8. */\nextern JS_FRIEND_API(JSBool)\nDefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp);\n\n/*\n * Helper function. To approximate a call to the [[DefineOwnProperty]] internal\n * method described in ES5, first call this, then call JS_DefinePropertyById.\n *\n * JS_DefinePropertyById by itself does not enforce the invariants on\n * non-configurable properties when obj->isNative(). This function performs the\n * relevant checks (specified in ES5 8.12.9 [[DefineOwnProperty]] steps 1-11),\n * but only if obj is native.\n *\n * The reason for the messiness here is that ES5 uses [[DefineOwnProperty]] as\n * a sort of extension point, but there is no hook in js::Class,\n * js::ProxyHandler, or the JSAPI with precisely the right semantics for it.\n */\nextern JS_FRIEND_API(bool)\nCheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSBool)\njs_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,\n                     const js::PropertyDescriptor& descriptor, JSBool *bp);\n\nextern JS_FRIEND_API(JSBool)\njs_ReportIsNotFunction(JSContext *cx, const JS::Value& v);\n\n#ifdef JSGC_GENERATIONAL\nextern JS_FRIEND_API(void)\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data);\n\nextern JS_FRIEND_API(void)\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data);\n#else\ninline void\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data) {}\n\ninline void\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data) {}\n#endif /* JSGC_GENERATIONAL */\n\n#endif /* jsfriendapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jslock.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jslock_h\n#define jslock_h\n\n#ifdef JS_THREADSAFE\n\n# include \"jsapi.h\"\n# include \"pratom.h\"\n# include \"prcvar.h\"\n# include \"prinit.h\"\n# include \"prlock.h\"\n# include \"prthread.h\"\n\n# define JS_ATOMIC_INCREMENT(p)      PR_ATOMIC_INCREMENT((int32_t *)(p))\n# define JS_ATOMIC_DECREMENT(p)      PR_ATOMIC_DECREMENT((int32_t *)(p))\n# define JS_ATOMIC_ADD(p,v)          PR_ATOMIC_ADD((int32_t *)(p), (int32_t)(v))\n# define JS_ATOMIC_SET(p,v)          PR_ATOMIC_SET((int32_t *)(p), (int32_t)(v))\n\nnamespace js {\n    // Defined in jsgc.cpp.\n    unsigned GetCPUCount();\n}\n\n#else  /* JS_THREADSAFE */\n\ntypedef struct PRThread PRThread;\ntypedef struct PRCondVar PRCondVar;\ntypedef struct PRLock PRLock;\n\n# define JS_ATOMIC_INCREMENT(p)      (++*(p))\n# define JS_ATOMIC_DECREMENT(p)      (--*(p))\n# define JS_ATOMIC_ADD(p,v)          (*(p) += (v))\n# define JS_ATOMIC_SET(p,v)          (*(p) = (v))\n\n#endif /* JS_THREADSAFE */\n\n#endif /* jslock_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsperf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef perf_jsperf_h\n#define perf_jsperf_h\n\n#include \"jsapi.h\"\n\nnamespace JS {\n\n/*\n * JS::PerfMeasurement is a generic way to access detailed performance\n * measurement APIs provided by your operating system.  The details of\n * exactly how this works and what can be measured are highly\n * system-specific, but this interface is (one hopes) implementable\n * on top of all of them.\n *\n * To use this API, create a PerfMeasurement object, passing its\n * constructor a bitmask indicating which events you are interested\n * in.  Thereafter, Start() zeroes all counters and starts timing;\n * Stop() stops timing again; and the counters for the events you\n * requested are available as data values after calling Stop().  The\n * object may be reused for many measurements.\n */\nclass JS_FRIEND_API(PerfMeasurement)\n{\n  protected:\n    // Implementation-specific data, if any.\n    void* impl;\n\n  public:\n    /*\n     * Events that may be measured.  Taken directly from the list of\n     * \"generalized hardware performance event types\" in the Linux\n     * perf_event API, plus some of the \"software events\".\n     */\n    enum EventMask {\n        CPU_CYCLES          = 0x00000001,\n        INSTRUCTIONS        = 0x00000002,\n        CACHE_REFERENCES    = 0x00000004,\n        CACHE_MISSES        = 0x00000008,\n        BRANCH_INSTRUCTIONS = 0x00000010,\n        BRANCH_MISSES       = 0x00000020,\n        BUS_CYCLES          = 0x00000040,\n        PAGE_FAULTS         = 0x00000080,\n        MAJOR_PAGE_FAULTS   = 0x00000100,\n        CONTEXT_SWITCHES    = 0x00000200,\n        CPU_MIGRATIONS      = 0x00000400,\n\n        ALL                 = 0x000007ff,\n        NUM_MEASURABLE_EVENTS  = 11\n    };\n\n    /*\n     * Bitmask of events that will be measured when this object is\n     * active (between Start() and Stop()).  This may differ from the\n     * bitmask passed to the constructor if the platform does not\n     * support measuring all of the requested events.\n     */\n    const EventMask eventsMeasured;\n\n    /*\n     * Counters for each measurable event.\n     * Immediately after one of these objects is created, all of the\n     * counters for enabled events will be zero, and all of the\n     * counters for disabled events will be uint64_t(-1).\n     */\n    uint64_t cpu_cycles;\n    uint64_t instructions;\n    uint64_t cache_references;\n    uint64_t cache_misses;\n    uint64_t branch_instructions;\n    uint64_t branch_misses;\n    uint64_t bus_cycles;\n    uint64_t page_faults;\n    uint64_t major_page_faults;\n    uint64_t context_switches;\n    uint64_t cpu_migrations;\n\n    /*\n     * Prepare to measure the indicated set of events.  If not all of\n     * the requested events can be measured on the current platform,\n     * then the eventsMeasured bitmask will only include the subset of\n     * |toMeasure| corresponding to the events that can be measured.\n     */\n    PerfMeasurement(EventMask toMeasure);\n\n    /* Done with this set of measurements, tear down OS-level state. */\n    ~PerfMeasurement();\n\n    /* Start a measurement cycle. */\n    void start();\n\n    /*\n     * End a measurement cycle, and for each enabled counter, add the\n     * number of measured events of that type to the appropriate\n     * visible variable.\n     */\n    void stop();\n\n    /* Reset all enabled counters to zero. */\n    void reset();\n\n    /*\n     * True if this platform supports measuring _something_, i.e. it's\n     * not using the stub implementation.\n     */\n    static bool canMeasureSomething();\n};\n\n/* Inject a Javascript wrapper around the above C++ class into the\n * Javascript object passed as an argument (this will normally be a\n * global object).  The JS-visible API is identical to the C++ API.\n */\nextern JS_FRIEND_API(JSObject*)\n    RegisterPerfMeasurement(JSContext *cx, JSObject *global);\n\n/*\n * Given a jsval which contains an instance of the aforementioned\n * wrapper class, extract the C++ object.  Returns NULL if the\n * jsval is not an instance of the wrapper.\n */\nextern JS_FRIEND_API(PerfMeasurement*)\n    ExtractPerfMeasurement(jsval wrapper);\n\n} // namespace JS\n\n#endif /* perf_jsperf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsprf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprf_h\n#define jsprf_h\n\n/*\n** API for PR printf like routines. Supports the following formats\n**      %d - decimal\n**      %u - unsigned decimal\n**      %x - unsigned hex\n**      %X - unsigned uppercase hex\n**      %o - unsigned octal\n**      %hd, %hu, %hx, %hX, %ho - 16-bit versions of above\n**      %ld, %lu, %lx, %lX, %lo - 32-bit versions of above\n**      %lld, %llu, %llx, %llX, %llo - 64 bit versions of above\n**      %s - ascii string\n**      %hs - ucs2 string\n**      %c - character\n**      %p - pointer (deals with machine dependent pointer size)\n**      %f - float\n**      %g - float\n*/\n\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"jstypes.h\"\n\n/*\n** sprintf into a fixed size buffer. Guarantees that a NUL is at the end\n** of the buffer. Returns the length of the written output, NOT including\n** the NUL, or (uint32_t)-1 if an error occurs.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);\n\n/*\n** sprintf into a malloc'd buffer. Return a pointer to the malloc'd\n** buffer on success, NULL on failure. Call \"JS_smprintf_free\" to release\n** the memory returned.\n*/\nextern JS_PUBLIC_API(char*) JS_smprintf(const char *fmt, ...);\n\n/*\n** Free the memory allocated, for the caller, by JS_smprintf\n*/\nextern JS_PUBLIC_API(void) JS_smprintf_free(char *mem);\n\n/*\n** \"append\" sprintf into a malloc'd buffer. \"last\" is the last value of\n** the malloc'd buffer. sprintf will append data to the end of last,\n** growing it as necessary using realloc. If last is NULL, JS_sprintf_append\n** will allocate the initial string. The return value is the new value of\n** last for subsequent calls, or NULL if there is a malloc failure.\n*/\nextern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...);\n\n/*\n** sprintf into a function. The function \"f\" is called with a string to\n** place into the output. \"arg\" is an opaque pointer used by the stuff\n** function to hold any state needed to do the storage of the output\n** data. The return value is a count of the number of characters fed to\n** the stuff function, or (uint32_t)-1 if an error occurs.\n*/\ntypedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);\n\nextern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);\n\n/*\n** va_list forms of the above.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsmprintf(const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsprintf_append(char *last, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(uint32_t) JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap);\n\n#endif /* jsprf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsprototypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A higher-order macro for enumerating all JSProtoKey values. */\n\n#ifndef jsprototypes_h\n#define jsprototypes_h\n\n#include \"jsversion.h\"\n\n/*\n * Enumerator codes in the second column must not change -- they are part of\n * the JS XDR API.  Also note the symbols in the third column are extern \"C\";\n * clients should use extern \"C\" {} as appropriate when using this macro.\n */\n\n#define JS_FOR_EACH_PROTOTYPE(macro) \\\n    macro(Null,                   0,     js_InitNullClass) \\\n    macro(Object,                 1,     js_InitObjectClass) \\\n    macro(Function,               2,     js_InitFunctionClass) \\\n    macro(Array,                  3,     js_InitArrayClass) \\\n    macro(Boolean,                4,     js_InitBooleanClass) \\\n    macro(JSON,                   5,     js_InitJSONClass) \\\n    macro(Date,                   6,     js_InitDateClass) \\\n    macro(Math,                   7,     js_InitMathClass) \\\n    macro(Number,                 8,     js_InitNumberClass) \\\n    macro(String,                 9,     js_InitStringClass) \\\n    macro(RegExp,                10,     js_InitRegExpClass) \\\n    macro(Error,                 11,     js_InitExceptionClasses) \\\n    macro(InternalError,         12,     js_InitExceptionClasses) \\\n    macro(EvalError,             13,     js_InitExceptionClasses) \\\n    macro(RangeError,            14,     js_InitExceptionClasses) \\\n    macro(ReferenceError,        15,     js_InitExceptionClasses) \\\n    macro(SyntaxError,           16,     js_InitExceptionClasses) \\\n    macro(TypeError,             17,     js_InitExceptionClasses) \\\n    macro(URIError,              18,     js_InitExceptionClasses) \\\n    macro(Iterator,              19,     js_InitIteratorClasses) \\\n    macro(StopIteration,         20,     js_InitIteratorClasses) \\\n    macro(ArrayBuffer,           21,     js_InitTypedArrayClasses) \\\n    macro(Int8Array,             22,     js_InitTypedArrayClasses) \\\n    macro(Uint8Array,            23,     js_InitTypedArrayClasses) \\\n    macro(Int16Array,            24,     js_InitTypedArrayClasses) \\\n    macro(Uint16Array,           25,     js_InitTypedArrayClasses) \\\n    macro(Int32Array,            26,     js_InitTypedArrayClasses) \\\n    macro(Uint32Array,           27,     js_InitTypedArrayClasses) \\\n    macro(Float32Array,          28,     js_InitTypedArrayClasses) \\\n    macro(Float64Array,          29,     js_InitTypedArrayClasses) \\\n    macro(Uint8ClampedArray,     30,     js_InitTypedArrayClasses) \\\n    macro(Proxy,                 31,     js_InitProxyClass) \\\n    macro(WeakMap,               32,     js_InitWeakMapClass) \\\n    macro(Map,                   33,     js_InitMapClass) \\\n    macro(Set,                   34,     js_InitSetClass) \\\n    macro(DataView,              35,     js_InitTypedArrayClasses) \\\n    macro(ParallelArray,         36,     js_InitParallelArrayClass) \\\n    macro(Intl,                  37,     js_InitIntlClass) \\\n    macro(Type,                  38,     js_InitBinaryDataClasses) \\\n    macro(Data,                  39,     js_InitBinaryDataClasses) \\\n    macro(uint8,                 40,     js_InitBinaryDataClasses) \\\n    macro(uint16,                41,     js_InitBinaryDataClasses) \\\n    macro(uint32,                42,     js_InitBinaryDataClasses) \\\n    macro(uint64,                43,     js_InitBinaryDataClasses) \\\n    macro(int8,                  44,     js_InitBinaryDataClasses) \\\n    macro(int16,                 45,     js_InitBinaryDataClasses) \\\n    macro(int32,                 46,     js_InitBinaryDataClasses) \\\n    macro(int64,                 47,     js_InitBinaryDataClasses) \\\n    macro(float32,               48,     js_InitBinaryDataClasses) \\\n    macro(float64,               49,     js_InitBinaryDataClasses) \\\n    macro(ArrayType,             50,     js_InitBinaryDataClasses) \\\n    macro(StructType,            51,     js_InitBinaryDataClasses) \\\n    macro(ArrayTypeObject,       52,     js_InitBinaryDataClasses) \\\n\n#endif /* jsprototypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsproxy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsproxy_h\n#define jsproxy_h\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nnamespace js {\n\nclass JS_FRIEND_API(Wrapper);\n\n/*\n * A proxy is a JSObject that implements generic behavior by providing custom\n * implementations for each object trap. The implementation for each trap is\n * provided by a C++ object stored on the proxy, known as its handler.\n *\n * A major use case for proxies is to forward each trap to another object,\n * known as its target. The target can be an arbitrary C++ object. Not every\n * proxy has the notion of a target, however.\n *\n * Proxy traps are grouped into fundamental and derived traps. Every proxy has\n * to at least provide implementations for the fundamental traps, but the\n * derived traps can be implemented in terms of the fundamental ones\n * BaseProxyHandler provides implementations of the derived traps in terms of\n * the (pure virtual) fundamental traps.\n *\n * To minimize code duplication, a set of abstract proxy handler classes is\n * provided, from which other handlers may inherit. These abstract classes\n * are organized in the following hierarchy:\n *\n * BaseProxyHandler\n * |\n * DirectProxyHandler\n * |\n * Wrapper\n */\n\n/*\n * BaseProxyHandler is the most generic kind of proxy handler. It does not make\n * any assumptions about the target. Consequently, it does not provide any\n * default implementation for the fundamental traps. It does, however, implement\n * the derived traps in terms of the fundamental ones. This allows consumers of\n * this class to define any custom behavior they want.\n */\nclass JS_FRIEND_API(BaseProxyHandler)\n{\n    void *mFamily;\n    bool mHasPrototype;\n    bool mHasPolicy;\n  protected:\n    // Subclasses may set this in their constructor.\n    void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }\n    void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; }\n\n  public:\n    explicit BaseProxyHandler(void *family);\n    virtual ~BaseProxyHandler();\n\n    bool hasPrototype() {\n        return mHasPrototype;\n    }\n\n    bool hasPolicy() {\n        return mHasPolicy;\n    }\n\n    inline void *family() {\n        return mFamily;\n    }\n\n    virtual bool isOuterWindow() {\n        return false;\n    }\n\n    virtual bool finalizeInBackground(Value priv) {\n        /*\n         * Called on creation of a proxy to determine whether its finalize\n         * method can be finalized on the background thread.\n         */\n        return true;\n    }\n\n    /* Policy enforcement traps.\n     *\n     * enter() allows the policy to specify whether the caller may perform |act|\n     * on the proxy's |id| property. In the case when |act| is CALL, |id| is\n     * generally JSID_VOID.\n     *\n     * The |act| parameter to enter() specifies the action being performed.\n     * If |bp| is false, the trap suggests that the caller throw (though it\n     * may still decide to squelch the error).\n     */\n    enum Action {\n        GET,\n        SET,\n        CALL\n    };\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,\n                       bool *bp);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) = 0;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) = 0;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) = 0;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) = 0;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp);\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp);\n    virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) = 0;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    virtual const char *className(JSContext *cx, HandleObject proxy);\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    virtual void finalize(JSFreeOp *fop, JSObject *proxy);\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp, bool *present);\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    /* See comment for weakmapKeyDelegateOp in jsclass.h. */\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/*\n * DirectProxyHandler includes a notion of a target object. All traps are\n * reimplemented such that they forward their behavior to the target. This\n * allows consumers of this class to forward to another object as transparently\n * and efficiently as possible.\n */\nclass JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler\n{\n  public:\n    explicit DirectProxyHandler(void *family);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,\n                         bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy,\n                           AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id,\n                     bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id,\n                        bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject proxy,\n                      AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy,\n                                 RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */\nclass Proxy\n{\n  public:\n    /* ES5 Harmony fundamental proxy traps. */\n    static bool preventExtensions(JSContext *cx, HandleObject proxy);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                      PropertyDescriptor *desc, unsigned flags);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                      MutableHandleValue vp);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                         PropertyDescriptor *desc, unsigned flags);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                         MutableHandleValue vp);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v);\n    static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n\n    /* ES5 Harmony derived proxy traps. */\n    static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    MutableHandleValue vp);\n    static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                                    uint32_t index, MutableHandleValue vp, bool *present);\n    static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    bool strict, MutableHandleValue vp);\n    static bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    static bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible);\n    static bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    static bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    static const char *className(JSContext *cx, HandleObject proxy);\n    static JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    static bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    static bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    static bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static JSObject * const LazyProto;\n};\n\ninline bool IsObjectProxyClass(const Class *clasp)\n{\n    return clasp == js::ObjectProxyClassPtr || clasp == js::OuterWindowProxyClassPtr;\n}\n\ninline bool IsFunctionProxyClass(const Class *clasp)\n{\n    return clasp == js::FunctionProxyClassPtr;\n}\n\ninline bool IsProxyClass(const Class *clasp)\n{\n    return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp);\n}\n\ninline bool IsObjectProxy(JSObject *obj)\n{\n    return IsObjectProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsFunctionProxy(JSObject *obj)\n{\n    return IsFunctionProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsProxy(JSObject *obj)\n{\n    return IsProxyClass(GetObjectClass(obj));\n}\n\n/*\n * These are part of the API.\n *\n * NOTE: PROXY_PRIVATE_SLOT is 0 because that way slot 0 is usable by API\n * clients for both proxy and non-proxy objects.  So an API client that only\n * needs to store one slot's worth of data doesn't need to branch on what sort\n * of object it has.\n */\nconst uint32_t PROXY_PRIVATE_SLOT = 0;\nconst uint32_t PROXY_HANDLER_SLOT = 1;\nconst uint32_t PROXY_EXTRA_SLOT   = 2;\n\ninline BaseProxyHandler *\nGetProxyHandler(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return (BaseProxyHandler *) GetReservedSlot(obj, PROXY_HANDLER_SLOT).toPrivate();\n}\n\ninline const Value &\nGetProxyPrivate(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_PRIVATE_SLOT);\n}\n\ninline JSObject *\nGetProxyTargetObject(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetProxyPrivate(obj).toObjectOrNull();\n}\n\ninline const Value &\nGetProxyExtra(JSObject *obj, size_t n)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_EXTRA_SLOT + n);\n}\n\ninline void\nSetProxyHandler(JSObject *obj, BaseProxyHandler *handler)\n{\n    JS_ASSERT(IsProxy(obj));\n    SetReservedSlot(obj, PROXY_HANDLER_SLOT, PrivateValue(handler));\n}\n\ninline void\nSetProxyExtra(JSObject *obj, size_t n, const Value &extra)\n{\n    JS_ASSERT(IsProxy(obj));\n    JS_ASSERT(n <= 1);\n    SetReservedSlot(obj, PROXY_EXTRA_SLOT + n, extra);\n}\n\nenum ProxyCallable {\n    ProxyNotCallable = false,\n    ProxyIsCallable = true\n};\n\nJS_FRIEND_API(JSObject *)\nNewProxyObject(JSContext *cx, BaseProxyHandler *handler, HandleValue priv,\n               JSObject *proto, JSObject *parent, ProxyCallable callable = ProxyNotCallable);\n\nJSObject *\nRenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv);\n\nclass JS_FRIEND_API(AutoEnterPolicy)\n{\n  public:\n    typedef BaseProxyHandler::Action Action;\n    AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler,\n                    HandleObject wrapper, HandleId id, Action act, bool mayThrow)\n#ifdef DEBUG\n        : context(NULL)\n#endif\n    {\n        allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv)\n                                     : true;\n        recordEnter(cx, wrapper, id);\n        // We want to throw an exception if all of the following are true:\n        // * The policy disallowed access.\n        // * The policy set rv to false, indicating that we should throw.\n        // * The caller did not instruct us to ignore exceptions.\n        // * The policy did not throw itself.\n        if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx))\n            reportError(cx, id);\n    }\n\n    virtual ~AutoEnterPolicy() { recordLeave(); }\n    inline bool allowed() { return allow; }\n    inline bool returnValue() { JS_ASSERT(!allowed()); return rv; }\n\n  protected:\n    // no-op constructor for subclass\n    AutoEnterPolicy()\n#ifdef DEBUG\n        : context(NULL)\n#endif\n        {};\n    void reportError(JSContext *cx, jsid id);\n    bool allow;\n    bool rv;\n\n#ifdef DEBUG\n    JSContext *context;\n    mozilla::Maybe<HandleObject> enteredProxy;\n    mozilla::Maybe<HandleId> enteredId;\n    // NB: We explicitly don't track the entered action here, because sometimes\n    // SET traps do an implicit GET during their implementation, leading to\n    // spurious assertions.\n    AutoEnterPolicy *prev;\n    void recordEnter(JSContext *cx, HandleObject proxy, HandleId id);\n    void recordLeave();\n\n    friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id);\n#else\n    inline void recordEnter(JSContext *cx, JSObject *proxy, jsid id) {}\n    inline void recordLeave() {}\n#endif\n\n};\n\n#ifdef DEBUG\nclass JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {\npublic:\n    AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id)\n    {\n        allow = true;\n        recordEnter(cx, proxy, id);\n    }\n};\n#else\nclass JS_FRIEND_API(AutoWaivePolicy) {\n    public: AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) {};\n};\n#endif\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSObject *)\njs_InitProxyClass(JSContext *cx, JS::HandleObject obj);\n\n#endif /* jsproxy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsprvtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprvtd_h\n#define jsprvtd_h\n/*\n * JS private typename definitions.\n *\n * This header is included only in other .h files, for convenience and for\n * simplicity of type naming.  The alternative for structures is to use tags,\n * which are named the same as their typedef names (legal in C/C++, and less\n * noisy than suffixing the typedef name with \"Struct\" or \"Str\").  Instead,\n * all .h files that include this file may use the same typedef name, whether\n * declaring a pointer to struct type, or defining a member of struct type.\n *\n * A few fundamental scalar types are defined here too.  Neither the scalar\n * nor the struct typedefs should change much, therefore the nearly-global\n * make dependency induced by this file should not prove painful.\n */\n\n#include \"jsapi.h\"\n#include \"jsutil.h\"\n\n#include \"js/HashTable.h\"\n#include \"js/Vector.h\"\n\n/*\n * Convenience constants.\n */\n#define JS_BITS_PER_UINT32_LOG2 5\n#define JS_BITS_PER_UINT32      32\n\n/* The alignment required of objects stored in GC arenas. */\nstatic const unsigned JS_GCTHING_ALIGN = 8;\nstatic const unsigned JS_GCTHING_ZEROBITS = 3;\n\n/* Scalar typedefs. */\ntypedef uint8_t     jsbytecode;\ntypedef uint8_t     jssrcnote;\ntypedef uintptr_t   jsatomid;\n\n/* Struct typedefs. */\ntypedef struct JSGCThing            JSGCThing;\ntypedef struct JSGenerator          JSGenerator;\ntypedef struct JSNativeEnumerator   JSNativeEnumerator;\ntypedef struct JSTryNote            JSTryNote;\n\n/* Friend \"Advanced API\" typedefs. */\ntypedef struct JSAtomState          JSAtomState;\ntypedef struct JSCodeSpec           JSCodeSpec;\ntypedef struct JSPrinter            JSPrinter;\ntypedef struct JSStackHeader        JSStackHeader;\ntypedef struct JSSubString          JSSubString;\ntypedef struct JSSpecializedNative  JSSpecializedNative;\n\n/* String typedefs. */\nclass JSDependentString;\nclass JSExtensibleString;\nclass JSExternalString;\nclass JSLinearString;\nclass JSRope;\nclass JSAtom;\nclass JSWrapper;\n\nnamespace js {\n\nstruct ArgumentsData;\nstruct Class;\n\nclass AutoNameVector;\nclass RegExpGuard;\nclass RegExpObject;\nclass RegExpObjectBuilder;\nclass RegExpShared;\nclass RegExpStatics;\nclass MatchPairs;\nclass PropertyName;\nclass LazyScript;\n\nenum RegExpFlag\n{\n    IgnoreCaseFlag  = 0x01,\n    GlobalFlag      = 0x02,\n    MultilineFlag   = 0x04,\n    StickyFlag      = 0x08,\n\n    NoFlags         = 0x00,\n    AllFlags        = 0x0f\n};\n\nclass StringBuffer;\n\nclass FrameRegs;\nclass StackFrame;\nclass ScriptFrameIter;\n\nclass Proxy;\nclass JS_FRIEND_API(AutoEnterPolicy);\nclass JS_FRIEND_API(BaseProxyHandler);\nclass JS_FRIEND_API(Wrapper);\nclass JS_FRIEND_API(CrossCompartmentWrapper);\n\nclass TempAllocPolicy;\nclass RuntimeAllocPolicy;\n\nclass GlobalObject;\n\ntemplate <typename K,\n          typename V,\n          size_t InlineElems>\nclass InlineMap;\n\nclass LifoAlloc;\n\nclass Shape;\n\nclass Breakpoint;\nclass BreakpointSite;\nclass Debugger;\nclass WatchpointMap;\n\n/*\n * Env is the type of what ES5 calls \"lexical environments\" (runtime\n * activations of lexical scopes). This is currently just JSObject, and is\n * implemented by Call, Block, With, and DeclEnv objects, among others--but\n * environments and objects are really two different concepts.\n */\ntypedef JSObject Env;\n\ntypedef JSNative             Native;\ntypedef JSParallelNative     ParallelNative;\ntypedef JSThreadSafeNative   ThreadSafeNative;\ntypedef JSPropertyOp         PropertyOp;\ntypedef JSStrictPropertyOp   StrictPropertyOp;\ntypedef JSPropertyDescriptor PropertyDescriptor;\n\nstruct SourceCompressionToken;\n\nnamespace frontend {\n\nstruct BytecodeEmitter;\nstruct Definition;\nclass FullParseHandler;\nclass FunctionBox;\nclass ObjectBox;\nstruct Token;\nstruct TokenPos;\nclass TokenStream;\nclass ParseMapPool;\nclass ParseNode;\n\ntemplate <typename ParseHandler>\nclass Parser;\n\n} /* namespace frontend */\n\nnamespace analyze {\n\nstruct LifetimeVariable;\nclass LoopAnalysis;\nclass ScriptAnalysis;\nclass SlotValue;\nclass SSAValue;\nclass SSAUseChain;\n\n} /* namespace analyze */\n\nnamespace types {\n\nclass TypeSet;\nstruct TypeCallsite;\nstruct TypeObject;\nstruct TypeCompartment;\n\n} /* namespace types */\n\ntypedef JS::Handle<Shape*>             HandleShape;\ntypedef JS::Handle<types::TypeObject*> HandleTypeObject;\ntypedef JS::Handle<JSAtom*>            HandleAtom;\ntypedef JS::Handle<PropertyName*>      HandlePropertyName;\n\ntypedef JS::MutableHandle<Shape*>      MutableHandleShape;\ntypedef JS::MutableHandle<JSAtom*>     MutableHandleAtom;\n\ntypedef JS::Rooted<Shape*>             RootedShape;\ntypedef JS::Rooted<types::TypeObject*> RootedTypeObject;\ntypedef JS::Rooted<JSAtom*>            RootedAtom;\ntypedef JS::Rooted<PropertyName*>      RootedPropertyName;\n\nenum XDRMode {\n    XDR_ENCODE,\n    XDR_DECODE\n};\n\ntemplate <XDRMode mode>\nclass XDRState;\n\nclass FreeOp;\n\nstruct IdValuePair\n{\n    jsid id;\n    Value value;\n\n    IdValuePair() {}\n    IdValuePair(jsid idArg)\n      : id(idArg), value(UndefinedValue())\n    {}\n};\n\n} /* namespace js */\n\nnamespace JSC {\n\nclass ExecutableAllocator;\n\n} /* namespace JSC */\n\nnamespace WTF {\n\nclass BumpPointerAllocator;\n\n} /* namespace WTF */\n\n/* \"Friend\" types used by jscntxt.h and jsdbgapi.h. */\ntypedef enum JSTrapStatus {\n    JSTRAP_ERROR,\n    JSTRAP_CONTINUE,\n    JSTRAP_RETURN,\n    JSTRAP_THROW,\n    JSTRAP_LIMIT\n} JSTrapStatus;\n\ntypedef JSTrapStatus\n(* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                  jsval closure);\n\ntypedef JSTrapStatus\n(* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                    void *closure);\n\ntypedef JSTrapStatus\n(* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                      void *closure);\n\ntypedef JSTrapStatus\n(* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                void *closure);\n\ntypedef JSBool\n(* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old,\n                        jsval *newp, void *closure);\n\n/* called just after script creation */\ntypedef void\n(* JSNewScriptHook)(JSContext  *cx,\n                    const char *filename,  /* URL of script */\n                    unsigned   lineno,     /* first line */\n                    JSScript   *script,\n                    JSFunction *fun,\n                    void       *callerdata);\n\n/* called just before script destruction */\ntypedef void\n(* JSDestroyScriptHook)(JSFreeOp *fop,\n                        JSScript *script,\n                        void     *callerdata);\n\ntypedef void\n(* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str,\n                    size_t length, void **listenerTSData, void *closure);\n\n/* js::ObjectOps function pointer typedefs. */\n\n/*\n * A generic type for functions mapping an object to another object, or null\n * if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSObjectOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/* Signature for class initialization ops. */\ntypedef JSObject *\n(* JSClassInitializerOp)(JSContext *cx, JS::HandleObject obj);\n\n/*\n * Hook that creates an iterator object for a given object. Returns the\n * iterator object or null if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, JSBool keysonly);\n\n\n#endif /* jsprvtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jspubtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jspubtd_h\n#define jspubtd_h\n\n/*\n * JS public API typedefs.\n */\n\n#include \"mozilla/PodOperations.h\"\n\n#include \"jsprototypes.h\"\n#include \"jstypes.h\"\n\n#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || defined(DEBUG)\n# define JSGC_TRACK_EXACT_ROOTS\n#endif\n\nnamespace JS {\n\n/*\n * Allow headers to reference JS::Value without #including the whole jsapi.h.\n * Unfortunately, typedefs (hence jsval) cannot be declared.\n */\nclass Value;\n\ntemplate <typename T>\nclass Rooted;\n\nclass JS_PUBLIC_API(AutoGCRooter);\n\nstruct Zone;\n\n} /* namespace JS */\n\n/*\n * In release builds, jsid is defined to be an integral type. This\n * prevents many bugs from being caught at compile time. E.g.:\n *\n *  jsid id = ...\n *  if (id == JS_TRUE)  // error\n *    ...\n *\n *  size_t n = id;      // error\n *\n * To catch more errors, jsid is given a struct type in C++ debug builds.\n * Struct assignment and (in C++) operator== allow correct code to be mostly\n * oblivious to the change. This feature can be explicitly disabled in debug\n * builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES.\n */\n// Needed for cocos2d-js\n#define JS_NO_JSVAL_JSID_STRUCT_TYPES\n# if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)\n#  define JS_USE_JSID_STRUCT_TYPES\n# endif\n\n# ifdef JS_USE_JSID_STRUCT_TYPES\nstruct jsid\n{\n    size_t asBits;\n    bool operator==(jsid rhs) const { return asBits == rhs.asBits; }\n    bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }\n};\n#  define JSID_BITS(id) (id.asBits)\n# else  /* defined(JS_USE_JSID_STRUCT_TYPES) */\ntypedef ptrdiff_t jsid;\n#  define JSID_BITS(id) (id)\n# endif  /* defined(JS_USE_JSID_STRUCT_TYPES) */\n\n#ifdef WIN32\ntypedef wchar_t   jschar;\n#else\ntypedef uint16_t  jschar;\n#endif\n\n/*\n * Run-time version enumeration.  For compile-time version checking, please use\n * the JS_HAS_* macros in jsversion.h, or use MOZJS_MAJOR_VERSION,\n * MOZJS_MINOR_VERSION, MOZJS_PATCH_VERSION, and MOZJS_ALPHA definitions.\n */\ntypedef enum JSVersion {\n    JSVERSION_ECMA_3  = 148,\n    JSVERSION_1_6     = 160,\n    JSVERSION_1_7     = 170,\n    JSVERSION_1_8     = 180,\n    JSVERSION_ECMA_5  = 185,\n    JSVERSION_DEFAULT = 0,\n    JSVERSION_UNKNOWN = -1,\n    JSVERSION_LATEST  = JSVERSION_ECMA_5\n} JSVersion;\n\n/* Result of typeof operator enumeration. */\ntypedef enum JSType {\n    JSTYPE_VOID,                /* undefined */\n    JSTYPE_OBJECT,              /* object */\n    JSTYPE_FUNCTION,            /* function */\n    JSTYPE_STRING,              /* string */\n    JSTYPE_NUMBER,              /* number */\n    JSTYPE_BOOLEAN,             /* boolean */\n    JSTYPE_NULL,                /* null */\n    JSTYPE_LIMIT\n} JSType;\n\n/* Dense index into cached prototypes and class atoms for standard objects. */\ntypedef enum JSProtoKey {\n#define PROTOKEY_AND_INITIALIZER(name,code,init) JSProto_##name = code,\n    JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)\n#undef JS_PROTO\n    JSProto_LIMIT\n} JSProtoKey;\n\n/* js_CheckAccess mode enumeration. */\ntypedef enum JSAccessMode {\n    JSACC_PROTO  = 0,           /* XXXbe redundant w.r.t. id */\n\n                                /*\n                                 * enum value #1 formerly called JSACC_PARENT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n                                /*\n                                 * enum value #2 formerly called JSACC_IMPORT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n    JSACC_WATCH  = 3,           /* a watchpoint on object foo for id 'bar' */\n    JSACC_READ   = 4,           /* a \"get\" of foo.bar */\n    JSACC_WRITE  = 8,           /* a \"set\" of foo.bar = baz */\n    JSACC_LIMIT\n} JSAccessMode;\n\n#define JSACC_TYPEMASK          (JSACC_WRITE - 1)\n\n/*\n * This enum type is used to control the behavior of a JSObject property\n * iterator function that has type JSNewEnumerate.\n */\ntypedef enum JSIterateOp {\n    /* Create new iterator state over enumerable properties. */\n    JSENUMERATE_INIT,\n\n    /* Create new iterator state over all properties. */\n    JSENUMERATE_INIT_ALL,\n\n    /* Iterate once. */\n    JSENUMERATE_NEXT,\n\n    /* Destroy iterator state. */\n    JSENUMERATE_DESTROY\n} JSIterateOp;\n\n/* See JSVAL_TRACE_KIND and JSTraceCallback in jsapi.h. */\ntypedef enum {\n    JSTRACE_OBJECT,\n    JSTRACE_STRING,\n    JSTRACE_SCRIPT,\n\n    /*\n     * Trace kinds internal to the engine. The embedding can only see them if\n     * it implements JSTraceCallback.\n     */\n    JSTRACE_LAZY_SCRIPT,\n    JSTRACE_IONCODE,\n    JSTRACE_SHAPE,\n    JSTRACE_BASE_SHAPE,\n    JSTRACE_TYPE_OBJECT,\n    JSTRACE_LAST = JSTRACE_TYPE_OBJECT\n} JSGCTraceKind;\n\n/* Struct typedefs and class forward declarations. */\ntypedef struct JSClass                      JSClass;\ntypedef struct JSCompartment                JSCompartment;\ntypedef struct JSConstDoubleSpec            JSConstDoubleSpec;\ntypedef struct JSContext                    JSContext;\ntypedef struct JSCrossCompartmentCall       JSCrossCompartmentCall;\ntypedef struct JSErrorReport                JSErrorReport;\ntypedef struct JSExceptionState             JSExceptionState;\ntypedef struct JSFunctionSpec               JSFunctionSpec;\ntypedef struct JSIdArray                    JSIdArray;\ntypedef struct JSLocaleCallbacks            JSLocaleCallbacks;\ntypedef struct JSObjectMap                  JSObjectMap;\ntypedef struct JSPrincipals                 JSPrincipals;\ntypedef struct JSPropertyDescriptor         JSPropertyDescriptor;\ntypedef struct JSPropertyName               JSPropertyName;\ntypedef struct JSPropertySpec               JSPropertySpec;\ntypedef struct JSRuntime                    JSRuntime;\ntypedef struct JSSecurityCallbacks          JSSecurityCallbacks;\ntypedef struct JSStructuredCloneCallbacks   JSStructuredCloneCallbacks;\ntypedef struct JSStructuredCloneReader      JSStructuredCloneReader;\ntypedef struct JSStructuredCloneWriter      JSStructuredCloneWriter;\ntypedef struct JSTracer                     JSTracer;\n\nclass                                       JSFlatString;\nclass                                       JSFunction;\nclass                                       JSObject;\nclass                                       JSScript;\nclass                                       JSStableString;  // long story\nclass                                       JSString;\n\n#ifdef JS_THREADSAFE\ntypedef struct PRCallOnceType    JSCallOnceType;\n#else\ntypedef JSBool                   JSCallOnceType;\n#endif\ntypedef JSBool                 (*JSInitCallback)(void);\n\nnamespace JS {\nnamespace shadow {\n\nstruct Runtime\n{\n    /* Restrict zone access during Minor GC. */\n    bool needsBarrier_;\n\n#ifdef JSGC_GENERATIONAL\n    /* Allow inlining of Nursery::isInside. */\n    uintptr_t gcNurseryStart_;\n    uintptr_t gcNurseryEnd_;\n#endif\n\n    Runtime()\n      : needsBarrier_(false)\n#ifdef JSGC_GENERATIONAL\n      , gcNurseryStart_(0)\n      , gcNurseryEnd_(0)\n#endif\n    {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Parallel operations in general can have one of three states. They may\n * succeed, fail, or \"bail\", where bail indicates that the code encountered an\n * unexpected condition and should be re-run sequentially. Different\n * subcategories of the \"bail\" state are encoded as variants of TP_RETRY_*.\n */\nenum ParallelResult { TP_SUCCESS, TP_RETRY_SEQUENTIALLY, TP_RETRY_AFTER_GC, TP_FATAL };\n\nstruct ThreadSafeContext;\nstruct ForkJoinSlice;\nclass ExclusiveContext;\n\nclass Allocator;\n\nclass SkipRoot;\n\nenum ThingRootKind\n{\n    THING_ROOT_OBJECT,\n    THING_ROOT_SHAPE,\n    THING_ROOT_BASE_SHAPE,\n    THING_ROOT_TYPE_OBJECT,\n    THING_ROOT_STRING,\n    THING_ROOT_ION_CODE,\n    THING_ROOT_SCRIPT,\n    THING_ROOT_ID,\n    THING_ROOT_PROPERTY_ID,\n    THING_ROOT_VALUE,\n    THING_ROOT_TYPE,\n    THING_ROOT_BINDINGS,\n    THING_ROOT_PROPERTY_DESCRIPTOR,\n    THING_ROOT_LIMIT\n};\n\ntemplate <typename T>\nstruct RootKind;\n\n/*\n * Specifically mark the ThingRootKind of externally visible types, so that\n * JSAPI users may use JSRooted... types without having the class definition\n * available.\n */\ntemplate<typename T, ThingRootKind Kind>\nstruct SpecificRootKind\n{\n    static ThingRootKind rootKind() { return Kind; }\n};\n\ntemplate <> struct RootKind<JSObject *> : SpecificRootKind<JSObject *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSFlatString *> : SpecificRootKind<JSFlatString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSFunction *> : SpecificRootKind<JSFunction *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSString *> : SpecificRootKind<JSString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSScript *> : SpecificRootKind<JSScript *, THING_ROOT_SCRIPT> {};\ntemplate <> struct RootKind<jsid> : SpecificRootKind<jsid, THING_ROOT_ID> {};\ntemplate <> struct RootKind<JS::Value> : SpecificRootKind<JS::Value, THING_ROOT_VALUE> {};\n\nstruct ContextFriendFields\n{\n  protected:\n    JSRuntime *const     runtime_;\n\n    /* The current compartment. */\n    JSCompartment       *compartment_;\n\n    /* The current zone. */\n    JS::Zone            *zone_;\n\n  public:\n    explicit ContextFriendFields(JSRuntime *rt)\n      : runtime_(rt), compartment_(NULL), zone_(NULL), autoGCRooters(NULL)\n    {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        mozilla::PodArrayZero(thingGCRooters);\n#endif\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n        skipGCRooters = NULL;\n#endif\n    }\n\n    static const ContextFriendFields *get(const JSContext *cx) {\n        return reinterpret_cast<const ContextFriendFields *>(cx);\n    }\n\n    static ContextFriendFields *get(JSContext *cx) {\n        return reinterpret_cast<ContextFriendFields *>(cx);\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Stack of thread-stack-allocated GC roots. */\n    JS::AutoGCRooter   *autoGCRooters;\n\n    friend JSRuntime *GetRuntime(const JSContext *cx);\n    friend JSCompartment *GetContextCompartment(const JSContext *cx);\n    friend JS::Zone *GetContextZone(const JSContext *cx);\n};\n\nclass PerThreadData;\n\nstruct PerThreadDataFriendFields\n{\n  private:\n    // Note: this type only exists to permit us to derive the offset of\n    // the perThread data within the real JSRuntime* type in a portable\n    // way.\n    struct RuntimeDummy : JS::shadow::Runtime\n    {\n        struct PerThreadDummy {\n            void *field1;\n            uintptr_t field2;\n#ifdef DEBUG\n            uint64_t field3;\n#endif\n        } mainThread;\n    };\n\n  public:\n\n    PerThreadDataFriendFields();\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Limit pointer for checking native stack consumption. */\n    uintptr_t nativeStackLimit;\n\n    static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);\n\n    static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) {\n        return reinterpret_cast<PerThreadDataFriendFields *>(pt);\n    }\n\n    static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<PerThreadDataFriendFields *>(\n            reinterpret_cast<char*>(rt) + RuntimeMainThreadOffset);\n    }\n\n    static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<const PerThreadDataFriendFields *>(\n            reinterpret_cast<const char*>(rt) + RuntimeMainThreadOffset);\n    }\n};\n\n} /* namespace js */\n\n#endif /* jspubtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jstypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n** File:                jstypes.h\n** Description: Definitions of NSPR's basic types\n**\n** Prototypes and macros used to make up for deficiencies in ANSI environments\n** that we have found.\n**\n** Since we do not wrap <stdlib.h> and all the other standard headers, authors\n** of portable code will not know in general that they need these definitions.\n** Instead of requiring these authors to find the dependent uses in their code\n** and take the following steps only in those C files, we take steps once here\n** for all C files.\n**/\n\n#ifndef jstypes_h\n#define jstypes_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js-config.h\"\n\n/***********************************************************************\n** MACROS:      JS_EXTERN_API\n**              JS_EXPORT_API\n** DESCRIPTION:\n**      These are only for externally visible routines and globals.  For\n**      internal routines, just use \"extern\" for type checking and that\n**      will not export internal cross-file or forward-declared symbols.\n**      Define a macro for declaring procedures return types. We use this to\n**      deal with windoze specific type hackery for DLL definitions. Use\n**      JS_EXTERN_API when the prototype for the method is declared. Use\n**      JS_EXPORT_API for the implementation of the method.\n**\n** Example:\n**   in dowhim.h\n**     JS_EXTERN_API( void ) DoWhatIMean( void );\n**   in dowhim.c\n**     JS_EXPORT_API( void ) DoWhatIMean( void ) { return; }\n**\n**\n***********************************************************************/\n\n#define JS_EXTERN_API(type)  extern MOZ_EXPORT type\n#define JS_EXPORT_API(type)  MOZ_EXPORT type\n#define JS_EXPORT_DATA(type) MOZ_EXPORT type\n#define JS_IMPORT_API(type)  MOZ_IMPORT_API type\n#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type\n\n/*\n * The linkage of JS API functions differs depending on whether the file is\n * used within the JS library or not. Any source file within the JS\n * interpreter should define EXPORT_JS_API whereas any client of the library\n * should not. STATIC_JS_API is used to build JS as a static library.\n */\n#if defined(STATIC_JS_API)\n#  define JS_PUBLIC_API(t)   t\n#  define JS_PUBLIC_DATA(t)  t\n#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)\n#  define JS_PUBLIC_API(t)   MOZ_EXPORT t\n#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t\n#else\n#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t\n#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t\n#endif\n\n#define JS_FRIEND_API(t)    JS_PUBLIC_API(t)\n#define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)\n\n#if defined(_MSC_VER) && defined(_M_IX86)\n#define JS_FASTCALL __fastcall\n#elif defined(__GNUC__) && defined(__i386__)\n#define JS_FASTCALL __attribute__((fastcall))\n#else\n#define JS_FASTCALL\n#define JS_NO_FASTCALL\n#endif\n\n#ifndef JS_INLINE\n#define JS_INLINE MOZ_INLINE\n#endif\n\n#ifndef JS_ALWAYS_INLINE\n#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE\n#endif\n\n#ifndef JS_NEVER_INLINE\n#define JS_NEVER_INLINE MOZ_NEVER_INLINE\n#endif\n\n#ifndef JS_WARN_UNUSED_RESULT\n# if defined __GNUC__\n#  define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n# else\n#  define JS_WARN_UNUSED_RESULT\n# endif\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_MACRO\n**              JS_END_MACRO\n** DESCRIPTION:\n**      Macro body brackets so that macros with compound statement definitions\n**      behave syntactically more like functions when called.\n***********************************************************************/\n#define JS_BEGIN_MACRO  do {\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n# define JS_END_MACRO                                                         \\\n    } __pragma(warning(push)) __pragma(warning(disable:4127))                 \\\n    while (0) __pragma(warning(pop))\n#else\n# define JS_END_MACRO   } while (0)\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_EXTERN_C\n**              JS_END_EXTERN_C\n** DESCRIPTION:\n**      Macro shorthands for conditional C++ extern block delimiters.\n***********************************************************************/\n#define JS_BEGIN_EXTERN_C      MOZ_BEGIN_EXTERN_C\n#define JS_END_EXTERN_C        MOZ_END_EXTERN_C\n\n/***********************************************************************\n** MACROS:      JS_BIT\n**              JS_BITMASK\n** DESCRIPTION:\n** Bit masking macros.  XXX n must be <= 31 to be portable\n***********************************************************************/\n#define JS_BIT(n)       ((uint32_t)1 << (n))\n#define JS_BITMASK(n)   (JS_BIT(n) - 1)\n\n/***********************************************************************\n** MACROS:      JS_HOWMANY\n**              JS_ROUNDUP\n**              JS_MIN\n**              JS_MAX\n** DESCRIPTION:\n**      Commonly used macros for operations on compatible types.\n***********************************************************************/\n#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))\n#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))\n\n#include \"jscpucfg.h\"\n\n/*\n * Define JS_64BIT iff we are building in an environment with 64-bit\n * addresses.\n */\n#ifdef _MSC_VER\n# if defined(_M_X64) || defined(_M_AMD64)\n#  define JS_64BIT\n# endif\n#elif defined(__GNUC__)\n/* Additional GCC defines are when running on Solaris, AIX, and HPUX */\n# if defined(__x86_64__) || defined(__sparcv9) || \\\n        defined(__64BIT__) || defined(__LP64__)\n#  define JS_64BIT\n# endif\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */\n# if defined(__x86_64) || defined(__sparcv9)\n#  define JS_64BIT\n# endif\n#elif defined(__xlc__) || defined(__xlC__)        /* IBM XL C/C++ */\n# if defined(__64BIT__)\n#  define JS_64BIT\n# endif\n#elif defined(__HP_cc) || defined(__HP_aCC)       /* HP-UX cc/aCC */\n# if defined(__LP64__)\n#  define JS_64BIT\n# endif\n#else\n# error \"Implement me\"\n#endif\n\n\n/************************************************************************\n** TYPES:       JSBool\n** DESCRIPTION:\n**  Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE\n**      for clarity of target type in assignments and actual arguments. Use\n**      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans\n**      just as you would C int-valued conditions.\n************************************************************************/\ntypedef int JSBool;\n#define JS_TRUE (int)1\n#define JS_FALSE (int)0\n\n/***********************************************************************\n** MACROS:      JS_LIKELY\n**              JS_UNLIKELY\n** DESCRIPTION:\n**      These macros allow you to give a hint to the compiler about branch\n**      probability so that it can better optimize.  Use them like this:\n**\n**      if (JS_LIKELY(v == 1)) {\n**          ... expected code path ...\n**      }\n**\n**      if (JS_UNLIKELY(v == 0)) {\n**          ... non-expected code path ...\n**      }\n**\n***********************************************************************/\n#ifdef __GNUC__\n\n# define JS_LIKELY(x)   (__builtin_expect((x), 1))\n# define JS_UNLIKELY(x) (__builtin_expect((x), 0))\n\n#else\n\n# define JS_LIKELY(x)   (x)\n# define JS_UNLIKELY(x) (x)\n\n#endif\n\n/***********************************************************************\n** MACROS:      JS_ARRAY_LENGTH\n**              JS_ARRAY_END\n** DESCRIPTION:\n**      Macros to get the number of elements and the pointer to one past the\n**      last element of a C array. Use them like this:\n**\n**      jschar buf[10], *s;\n**      JSString *str;\n**      ...\n**      for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;\n**      ...\n**      str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));\n**      ...\n**\n***********************************************************************/\n\n#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])\n#define JS_ARRAY_END(array)    ((array) + JS_ARRAY_LENGTH(array))\n\n#define JS_BITS_PER_BYTE 8\n#define JS_BITS_PER_BYTE_LOG2 3\n\n#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)\n\n/***********************************************************************\n** MACROS:      JS_FUNC_TO_DATA_PTR\n**              JS_DATA_TO_FUNC_PTR\n** DESCRIPTION:\n**      Macros to convert between function and data pointers assuming that\n**      they have the same size. Use them like this:\n**\n**      JSPropertyOp nativeGetter;\n**      JSObject *scriptedGetter;\n**      ...\n**      scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter);\n**      ...\n**      nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter);\n**\n***********************************************************************/\n\n#ifdef __GNUC__\n# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (size_t) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (size_t) (ptr))\n#else\n/* Use an extra (void *) cast for MSVC. */\n# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))\n#endif\n\n#ifdef __GNUC__\n# define JS_EXTENSION __extension__\n# define JS_EXTENSION_(s) __extension__ ({ s; })\n#else\n# define JS_EXTENSION\n# define JS_EXTENSION_(s) s\n#endif\n\n#endif /* jstypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsutil.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * PR assertion checker.\n */\n\n#ifndef jsutil_h\n#define jsutil_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/GuardObjects.h\"\n\n#ifdef USE_ZLIB\n#include <zlib.h>\n#endif\n\n#include \"js/Utility.h\"\n\n/* Forward declarations. */\nstruct JSContext;\n\nstatic JS_ALWAYS_INLINE void *\njs_memcpy(void *dst_, const void *src_, size_t len)\n{\n    char *dst = (char *) dst_;\n    const char *src = (const char *) src_;\n    JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len);\n    JS_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len);\n\n    return memcpy(dst, src, len);\n}\n\nnamespace js {\n\ntemplate <class T>\nstruct AlignmentTestStruct\n{\n    char c;\n    T t;\n};\n\n/* This macro determines the alignment requirements of a type. */\n#define JS_ALIGNMENT_OF(t_) \\\n  (sizeof(js::AlignmentTestStruct<t_>) - sizeof(t_))\n\ntemplate <class T>\nclass AlignedPtrAndFlag\n{\n    uintptr_t bits;\n\n  public:\n    AlignedPtrAndFlag(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(aFlag);\n    }\n\n    T *ptr() const {\n        return (T *)(bits & ~uintptr_t(1));\n    }\n\n    bool flag() const {\n        return (bits & 1) != 0;\n    }\n\n    void setPtr(T *t) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(flag());\n    }\n\n    void setFlag() {\n        bits |= 1;\n    }\n\n    void unsetFlag() {\n        bits &= ~uintptr_t(1);\n    }\n\n    void set(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | aFlag;\n    }\n};\n\ntemplate <class T>\nstatic inline void\nReverse(T *beg, T *end)\n{\n    while (beg != end) {\n        if (--end == beg)\n            return;\n        T tmp = *beg;\n        *beg = *end;\n        *end = tmp;\n        ++beg;\n    }\n}\n\ntemplate <class T>\nstatic inline T *\nFind(T *beg, T *end, const T &v)\n{\n    for (T *p = beg; p != end; ++p) {\n        if (*p == v)\n            return p;\n    }\n    return end;\n}\n\ntemplate <class Container>\nstatic inline typename Container::ElementType *\nFind(Container &c, const typename Container::ElementType &v)\n{\n    return Find(c.begin(), c.end(), v);\n}\n\ntemplate <typename InputIterT, typename CallableT>\nvoid\nForEach(InputIterT begin, InputIterT end, CallableT f)\n{\n    for (; begin != end; ++begin)\n        f(*begin);\n}\n\ntemplate <class T>\nstatic inline T\nMin(T t1, T t2)\n{\n    return t1 < t2 ? t1 : t2;\n}\n\ntemplate <class T>\nstatic inline T\nMax(T t1, T t2)\n{\n    return t1 > t2 ? t1 : t2;\n}\n\n/* Allows a const variable to be initialized after its declaration. */\ntemplate <class T>\nstatic T&\nInitConst(const T &t)\n{\n    return const_cast<T &>(t);\n}\n\ntemplate <class T, class U>\nJS_ALWAYS_INLINE T &\nImplicitCast(U &u)\n{\n    T &t = u;\n    return t;\n}\n\ntemplate<typename T>\nclass AutoScopedAssign\n{\n  public:\n    AutoScopedAssign(T *addr, const T &value\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : addr_(addr), old(*addr_)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        *addr_ = value;\n    }\n\n    ~AutoScopedAssign() { *addr_ = old; }\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n    T *addr_;\n    T old;\n};\n\ntemplate <typename T>\nstatic inline bool\nIsPowerOfTwo(T t)\n{\n    return t && !(t & (t - 1));\n}\n\ntemplate <typename T, typename U>\nstatic inline U\nComputeByteAlignment(T bytes, U alignment)\n{\n    JS_ASSERT(IsPowerOfTwo(alignment));\n    return (alignment - (bytes % alignment)) % alignment;\n}\n\ntemplate <typename T, typename U>\nstatic inline T\nAlignBytes(T bytes, U alignment)\n{\n    return bytes + ComputeByteAlignment(bytes, alignment);\n}\n\nJS_ALWAYS_INLINE static size_t\nUnsignedPtrDiff(const void *bigger, const void *smaller)\n{\n    return size_t(bigger) - size_t(smaller);\n}\n\n/*****************************************************************************/\n\n/* A bit array is an array of bits represented by an array of words (size_t). */\n\nstatic inline unsigned\nNumWordsForBitArrayOfLength(size_t length)\n{\n    return (length + (JS_BITS_PER_WORD - 1)) / JS_BITS_PER_WORD;\n}\n\nstatic inline unsigned\nBitArrayIndexToWordIndex(size_t length, size_t bitIndex)\n{\n    unsigned wordIndex = bitIndex / JS_BITS_PER_WORD;\n    JS_ASSERT(wordIndex < length);\n    return wordIndex;\n}\n\nstatic inline size_t\nBitArrayIndexToWordMask(size_t i)\n{\n    return size_t(1) << (i % JS_BITS_PER_WORD);\n}\n\nstatic inline bool\nIsBitArrayElementSet(size_t *array, size_t length, size_t i)\n{\n    return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i);\n}\n\nstatic inline bool\nIsAnyBitArrayElementSet(size_t *array, size_t length)\n{\n    unsigned numWords = NumWordsForBitArrayOfLength(length);\n    for (unsigned i = 0; i < numWords; ++i) {\n        if (array[i])\n            return true;\n    }\n    return false;\n}\n\nstatic inline void\nSetBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearAllBitArrayElements(size_t *array, size_t length)\n{\n    for (unsigned i = 0; i < length; ++i)\n        array[i] = 0;\n}\n\n#ifdef USE_ZLIB\nclass Compressor\n{\n    /* Number of bytes we should hand to zlib each compressMore() call. */\n    static const size_t CHUNKSIZE = 2048;\n    z_stream zs;\n    const unsigned char *inp;\n    size_t inplen;\n    size_t outbytes;\n\n  public:\n    enum Status {\n        MOREOUTPUT,\n        DONE,\n        CONTINUE,\n        OOM\n    };\n\n    Compressor(const unsigned char *inp, size_t inplen);\n    ~Compressor();\n    bool init();\n    void setOutput(unsigned char *out, size_t outlen);\n    size_t outWritten() const { return outbytes; }\n    /* Compress some of the input. Return true if it should be called again. */\n    Status compressMore();\n};\n\n/*\n * Decompress a string. The caller must know the length of the output and\n * allocate |out| to a string of that length.\n */\nbool DecompressString(const unsigned char *inp, size_t inplen,\n                      unsigned char *out, size_t outlen);\n#endif\n\n}  /* namespace js */\n\n/* Crash diagnostics */\n#ifdef DEBUG\n# define JS_CRASH_DIAGNOSTICS 1\n#endif\n#ifdef JS_CRASH_DIAGNOSTICS\n# define JS_POISON(p, val, size) memset((p), (val), (size))\n#else\n# define JS_POISON(p, val, size) ((void) 0)\n#endif\n\n/* Basic stats */\n#ifdef DEBUG\n# define JS_BASIC_STATS 1\n#endif\n#ifdef JS_BASIC_STATS\n# include <stdio.h>\ntypedef struct JSBasicStats {\n    uint32_t    num;\n    uint32_t    max;\n    double      sum;\n    double      sqsum;\n    uint32_t    logscale;           /* logarithmic scale: 0 (linear), 2, 10 */\n    uint32_t    hist[11];\n} JSBasicStats;\n# define JS_INIT_STATIC_BASIC_STATS  {0,0,0,0,0,{0,0,0,0,0,0,0,0,0,0,0}}\n# define JS_BASIC_STATS_INIT(bs)     memset((bs), 0, sizeof(JSBasicStats))\n# define JS_BASIC_STATS_ACCUM(bs,val)                                         \\\n    JS_BasicStatsAccum(bs, val)\n# define JS_MeanAndStdDevBS(bs,sigma)                                         \\\n    JS_MeanAndStdDev((bs)->num, (bs)->sum, (bs)->sqsum, sigma)\nextern void\nJS_BasicStatsAccum(JSBasicStats *bs, uint32_t val);\nextern double\nJS_MeanAndStdDev(uint32_t num, double sum, double sqsum, double *sigma);\nextern void\nJS_DumpBasicStats(JSBasicStats *bs, const char *title, FILE *fp);\nextern void\nJS_DumpHistogram(JSBasicStats *bs, FILE *fp);\n#else\n# define JS_BASIC_STATS_ACCUM(bs,val)\n#endif\n\n/* A jsbitmap_t is a long integer that can be used for bitmaps. */\ntypedef size_t jsbitmap;\n#define JS_TEST_BIT(_map,_bit)  ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &      \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_SET_BIT(_map,_bit)   ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |=     \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &=     \\\n                                 ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n\n/* Wrapper for various macros to stop warnings coming from their expansions. */\n#if defined(__clang__)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"clang diagnostic push\")                                      \\\n        /* If these _Pragmas cause warnings for you, try disabling ccache. */ \\\n        _Pragma(\"clang diagnostic ignored \\\"-Wunused-value\\\"\")                \\\n        { expr; }                                                             \\\n        _Pragma(\"clang diagnostic pop\")                                       \\\n    JS_END_MACRO\n#elif MOZ_IS_GCC\n\n#if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"GCC diagnostic push\")                                        \\\n        _Pragma(\"GCC diagnostic ignored \\\"-Wunused-but-set-variable\\\"\")       \\\n        expr;                                                                 \\\n        _Pragma(\"GCC diagnostic pop\")                                         \\\n    JS_END_MACRO\n#endif\n#endif\n\n#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        expr;                                                                 \\\n    JS_END_MACRO\n#endif\n\n#endif /* jsutil_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jsversion.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsversion_h\n#define jsversion_h\n\n/*\n * Deprecated JS_VERSION handler.\n */\n#ifdef JS_VERSION\n# if JS_VERSION == 185\n#  warning \"JS_VERSION defined but unsupported (legacy)\"\n# elif JS_VERSION < 185\n#  error \"Unsupported JS_VERSION\"\n# else\n#  error \"Unknown JS_VERSION\"\n# endif\n#endif\n\n/*\n * JS Capability Macros.\n */\n#define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */\n#define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */\n#define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */\n#define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */\n#define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */\n#define JS_HAS_UNEVAL           1       /* has uneval() top-level function */\n#define JS_HAS_CONST            1       /* has JS2 const as alternative var */\n#define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */\n#define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */\n#define JS_HAS_FOR_EACH_IN      1       /* has for each (lhs in iterable) */\n#define JS_HAS_GENERATORS       1       /* has yield in generator function */\n#define JS_HAS_BLOCK_SCOPE      1       /* has block scope via let/arraycomp */\n#define JS_HAS_DESTRUCTURING    2       /* has [a,b] = ... or {p:a,q:b} = ... */\n#define JS_HAS_GENERATOR_EXPRS  1       /* has (expr for (lhs in iterable)) */\n#define JS_HAS_EXPR_CLOSURES    1       /* has function (formals) listexpr */\n\n/* Support for JS_NewGlobalObject. */\n#define JS_HAS_NEW_GLOBAL_OBJECT        1\n\n/* Support for JS_MakeSystemObject. */\n#define JS_HAS_MAKE_SYSTEM_OBJECT       1\n\n/* Feature-test macro for evolving destructuring support. */\n#define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)\n\n/*\n * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support;\n * support likely to be made opt-in at some future time.\n */\n#define OLD_GETTER_SETTER_METHODS       1\n\n/* A kill-switch for bug 586842.  Embedders shouldn't touch this! */\n#define USE_NEW_OBJECT_REPRESENTATION 0\n\n#if USE_NEW_OBJECT_REPRESENTATION\n#  define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0)\n#else\n#  define NEW_OBJECT_REPRESENTATION_ONLY() \\\n     MOZ_ASSUME_UNREACHABLE(\"don't call this!  to be used in the new object representation\")\n#endif\n\n#endif /* jsversion_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/jswrapper.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jswrapper_h\n#define jswrapper_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"jsapi.h\"\n#include \"jsproxy.h\"\n\nnamespace js {\n\nclass DummyFrameGuard;\n\n/*\n * A wrapper is a proxy with a target object to which it generally forwards\n * operations, but may restrict access to certain operations or instrument\n * the trap operations in various ways. A wrapper is distinct from a Direct Proxy\n * Handler in the sense that it can be \"unwrapped\" in C++, exposing the underlying\n * object (Direct Proxy Handlers have an underlying target object, but don't\n * expect to expose this object via any kind of unwrapping operation). Callers\n * should be careful to avoid unwrapping security wrappers in the wrong context.\n */\nclass JS_FRIEND_API(Wrapper) : public DirectProxyHandler\n{\n    unsigned mFlags;\n    bool mSafeToUnwrap;\n\n  public:\n    using BaseProxyHandler::Action;\n\n    enum Flags {\n        CROSS_COMPARTMENT = 1 << 0,\n        LAST_USED_FLAG = CROSS_COMPARTMENT\n    };\n\n    /*\n     * Wrappers can explicitly specify that they are unsafe to unwrap from a\n     * security perspective (as is the case for SecurityWrappers). If a wrapper\n     * is not safe to unwrap, operations requiring full access to the underlying\n     * object (via CheckedUnwrap) will throw. Otherwise, they will succeed.\n     */\n    void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; }\n    bool isSafeToUnwrap() { return mSafeToUnwrap; }\n\n    static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto,\n                         JSObject *parent, Wrapper *handler);\n\n    static JSObject *Renew(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *handler);\n\n    static Wrapper *wrapperHandler(JSObject *wrapper);\n\n    static JSObject *wrappedObject(JSObject *wrapper);\n\n    unsigned flags() const {\n        return mFlags;\n    }\n\n    explicit Wrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~Wrapper();\n\n    static Wrapper singleton;\n    static Wrapper singletonWithPrototype;\n};\n\n/* Base class for all cross compartment wrapper handlers. */\nclass JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper\n{\n  public:\n    CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~CrossCompartmentWrapper();\n\n    virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE;\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived wrapper traps. */\n    virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject wrapper, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject wrapper,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static CrossCompartmentWrapper singleton;\n    static CrossCompartmentWrapper singletonWithPrototype;\n};\n\n/*\n * Base class for security wrappers. A security wrapper is potentially hiding\n * all or part of some wrapped object thus SecurityWrapper defaults to denying\n * access to the wrappee. This is the opposite of Wrapper which tries to be\n * completely transparent.\n *\n * NB: Currently, only a few ProxyHandler operations are overridden to deny\n * access, relying on derived SecurityWrapper to block access when necessary.\n */\ntemplate <class Base>\nclass JS_FRIEND_API(SecurityWrapper) : public Base\n{\n  public:\n    SecurityWrapper(unsigned flags);\n\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act,\n                       bool *bp) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n\n    /*\n     * Allow our subclasses to select the superclass behavior they want without\n     * needing to specify an exact superclass.\n     */\n    typedef Base Permissive;\n    typedef SecurityWrapper<Base> Restrictive;\n};\n\ntypedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;\ntypedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;\n\nclass JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler\n{\n  public:\n    static int sDeadObjectFamily;\n\n    explicit DeadObjectProxy();\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp,\n                                     bool *present) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy,\n                                MutableHandleObject protop) MOZ_OVERRIDE;\n\n    static DeadObjectProxy singleton;\n};\n\nextern JSObject *\nTransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj,\n                         HandleObject wrappedProto, HandleObject parent,\n                         unsigned flags);\n\n// Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by\n// jsfriendapi users.\nextern JS_FRIEND_DATA(int) sWrapperFamily;\n\ninline bool\nIsWrapper(JSObject *obj)\n{\n    return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily;\n}\n\n// Given a JSObject, returns that object stripped of wrappers. If\n// stopAtOuter is true, then this returns the outer window if it was\n// previously wrapped. Otherwise, this returns the first object for\n// which JSObject::isWrapper returns false.\nJS_FRIEND_API(JSObject *)\nUncheckedUnwrap(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = NULL);\n\n// Given a JSObject, returns that object stripped of wrappers. At each stage,\n// the security wrapper has the opportunity to veto the unwrap. Since checked\n// code should never be unwrapping outer window wrappers, we always stop at\n// outer windows.\nJS_FRIEND_API(JSObject *)\nCheckedUnwrap(JSObject *obj, bool stopAtOuter = true);\n\n// Unwrap only the outermost security wrapper, with the same semantics as\n// above. This is the checked version of Wrapper::wrappedObject.\nJS_FRIEND_API(JSObject *)\nUnwrapOneChecked(JSObject *obj, bool stopAtOuter = true);\n\nJS_FRIEND_API(bool)\nIsCrossCompartmentWrapper(JSObject *obj);\n\nbool\nIsDeadProxyObject(JSObject *obj);\n\nJSObject *\nNewDeadProxyObject(JSContext *cx, JSObject *parent);\n\nvoid\nNukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper);\n\nbool\nRemapWrapper(JSContext *cx, JSObject *wobj, JSObject *newTarget);\n\nJS_FRIEND_API(bool)\nRemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget,\n                          JSObject *newTarget);\n\n// API to recompute all cross-compartment wrappers whose source and target\n// match the given filters.\nJS_FRIEND_API(bool)\nRecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,\n                  const CompartmentFilter &targetFilter);\n\n/*\n * This auto class should be used around any code, such as brain transplants,\n * that may touch dead zones. Brain transplants can cause problems\n * because they operate on all compartments, whether live or dead. A brain\n * transplant can cause a formerly dead object to be \"reanimated\" by causing a\n * read or write barrier to be invoked on it during the transplant. In this way,\n * a zone becomes a zombie, kept alive by repeatedly consuming\n * (transplanted) brains.\n *\n * To work around this issue, we observe when mark bits are set on objects in\n * dead zones. If this happens during a brain transplant, we do a full,\n * non-incremental GC at the end of the brain transplant. This will clean up any\n * objects that were improperly marked.\n */\nstruct JS_FRIEND_API(AutoMaybeTouchDeadZones)\n{\n    // The version that takes an object just uses it for its runtime.\n    AutoMaybeTouchDeadZones(JSContext *cx);\n    AutoMaybeTouchDeadZones(JSObject *obj);\n    ~AutoMaybeTouchDeadZones();\n\n  private:\n    JSRuntime *runtime;\n    unsigned markCount;\n    bool inIncremental;\n    bool manipulatingDeadZones;\n};\n\n} /* namespace js */\n\n#endif /* jswrapper_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/AllocPolicy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * An allocation policy concept, usable for structures and algorithms to\n * control how memory is allocated and how failures are handled.\n */\n\n#ifndef mozilla_AllocPolicy_h\n#define mozilla_AllocPolicy_h\n\n#include <stddef.h>\n#include <stdlib.h>\n\nnamespace mozilla {\n\n/*\n * Allocation policies are used to implement the standard allocation behaviors\n * in a customizable way.  Additionally, custom behaviors may be added to these\n * behaviors, such as additionally reporting an error through an out-of-band\n * mechanism when OOM occurs.  The concept modeled here is as follows:\n *\n *  - public copy constructor, assignment, destructor\n *  - void* malloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* calloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* realloc_(void*, size_t, size_t)\n *      Responsible for OOM reporting when null is returned.  The *used* bytes\n *      of the previous buffer is passed in (rather than the old allocation\n *      size), in addition to the *new* allocation size requested.\n *  - void free_(void*)\n *  - void reportAllocOverflow() const\n *      Called on allocation overflow (that is, an allocation implicitly tried\n *      to allocate more than the available memory space -- think allocating an\n *      array of large-size objects, where N * size overflows) before null is\n *      returned.\n *\n * mfbt provides (and typically uses by default) only MallocAllocPolicy, which\n * does nothing more than delegate to the malloc/alloc/free functions.\n */\n\n/*\n * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no\n * extra behaviors.\n */\nclass MallocAllocPolicy\n{\n  public:\n    void* malloc_(size_t bytes) { return malloc(bytes); }\n    void* calloc_(size_t bytes) { return calloc(bytes, 1); }\n    void* realloc_(void* p, size_t oldBytes, size_t bytes) { return realloc(p, bytes); }\n    void free_(void* p) { free(p); }\n    void reportAllocOverflow() const {}\n};\n\n\n} // namespace mozilla\n\n#endif /* mozilla_AllocPolicy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Array.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A compile-time constant-length array with bounds-checking assertions. */\n\n#ifndef mozilla_Array_h\n#define mozilla_Array_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\ntemplate<typename T, size_t Length>\nclass Array\n{\n    T arr[Length];\n\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n};\n\ntemplate<typename T>\nclass Array<T, 0>\n{\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_Array_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Assertions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of runtime and static assertion macros for C and C++. */\n\n#ifndef mozilla_Assertions_h\n#define mozilla_Assertions_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Likely.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef WIN32\n   /*\n    * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which\n    * further depends on <windef.h>.  We hardcode these few definitions manually\n    * because those headers clutter the global namespace with a significant\n    * number of undesired macros and symbols.\n    */\n#  ifdef __cplusplus\n   extern \"C\" {\n#  endif\n   __declspec(dllimport) int __stdcall\n   TerminateProcess(void* hProcess, unsigned int uExitCode);\n   __declspec(dllimport) void* __stdcall GetCurrentProcess(void);\n#  ifdef __cplusplus\n   }\n#  endif\n#else\n#  include <signal.h>\n#endif\n#ifdef ANDROID\n#  include <android/log.h>\n#endif\n\n/*\n * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.\n * In C++11, static_assert is provided by the compiler to the same effect.\n * This can be useful when you make certain assumptions about what must hold for\n * optimal, or even correct, behavior.  For example, you might assert that the\n * size of a struct is a multiple of the target architecture's word size:\n *\n *   struct S { ... };\n *   // C\n *   MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,\n *                     \"S should be a multiple of word size for efficiency\");\n *   // C++11\n *   static_assert(sizeof(S) % sizeof(size_t) == 0,\n *                 \"S should be a multiple of word size for efficiency\");\n *\n * This macro can be used in any location where both an extern declaration and a\n * typedef could be used.\n */\n#ifndef __cplusplus\n   /*\n    * Some of the definitions below create an otherwise-unused typedef.  This\n    * triggers compiler warnings with some versions of gcc, so mark the typedefs\n    * as permissibly-unused to disable the warnings.\n    */\n#  if defined(__GNUC__)\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))\n#  else\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */\n#  endif\n#  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y\n#  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)\n#  if defined(__SUNPRO_CC)\n     /*\n      * The Sun Studio C++ compiler is buggy when declaring, inside a function,\n      * another extern'd function with an array argument whose length contains a\n      * sizeof, triggering the error message \"sizeof expression not accepted as\n      * size of array parameter\".  This bug (6688515, not public yet) would hit\n      * defining moz_static_assert as a function, so we always define an extern\n      * array for Sun Studio.\n      *\n      * We include the line number in the symbol name in a best-effort attempt\n      * to avoid conflicts (see below).\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond) ? 1 : -1]\n#  elif defined(__COUNTER__)\n     /*\n      * If there was no preferred alternative, use a compiler-agnostic version.\n      *\n      * Note that the non-__COUNTER__ version has a bug in C++: it can't be used\n      * in both |extern \"C\"| and normal C++ in the same translation unit.  (Alas\n      * |extern \"C\"| isn't allowed in a function.)  The only affected compiler\n      * we really care about is gcc 4.2.  For that compiler and others like it,\n      * we include the line number in the function name to do the best we can to\n      * avoid conflicts.  These should be rare: a conflict would require use of\n      * MOZ_STATIC_ASSERT on the same line in separate files in the same\n      * translation unit, *and* the uses would have to be in code with\n      * different linkage, *and* the first observed use must be in C++-linkage\n      * code.\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  else\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  endif\n\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)\n#else\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Prints |s| as an assertion failure (using file and ln as the location of the\n * assertion) to the standard debug-output channel.\n *\n * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This\n * method is primarily for internal use in this header, and only secondarily\n * for use in implementing release-build assertions.\n */\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportAssertionFailure(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n  __android_log_print(ANDROID_LOG_FATAL, \"MOZ_Assert\",\n                      \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportCrash(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n    __android_log_print(ANDROID_LOG_FATAL, \"MOZ_CRASH\",\n                        \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\n/**\n * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH().  You should\n * call MOZ_CRASH instead.\n */\n#if defined(_MSC_VER)\n   /*\n    * On MSVC use the __debugbreak compiler intrinsic, which produces an inline\n    * (not nested in a system function) breakpoint.  This distinctively invokes\n    * Breakpad without requiring system library symbols on all stack-processing\n    * machines, as a nested breakpoint would require.\n    *\n    * We use TerminateProcess with the exit code aborting would generate\n    * because we don't want to invoke atexit handlers, destructors, library\n    * unload handlers, and so on when our process might be in a compromised\n    * state.\n    *\n    * We don't use abort() because it'd cause Windows to annoyingly pop up the\n    * process error dialog multiple times.  See bug 345118 and bug 426163.\n    *\n    * We follow TerminateProcess() with a call to MOZ_NoReturn() so that the\n    * compiler doesn't hassle us to provide a return statement after a\n    * MOZ_REALLY_CRASH() call.\n    *\n    * (Technically these are Windows requirements, not MSVC requirements.  But\n    * practically you need MSVC for debugging, and we only ship builds created\n    * by MSVC, so doing it this way reduces complexity.)\n    */\n\n__declspec(noreturn) __inline void MOZ_NoReturn() {}\n\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         ::TerminateProcess(::GetCurrentProcess(), 3); \\\n         ::MOZ_NoReturn(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         TerminateProcess(GetCurrentProcess(), 3); \\\n         MOZ_NoReturn(); \\\n       } while (0)\n#  endif\n#else\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         ::abort(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         abort(); \\\n       } while (0)\n#  endif\n#endif\n\n/*\n * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a\n * Breakpad-compatible way, in both debug and release builds.\n *\n * MOZ_CRASH is a good solution for \"handling\" failure cases when you're\n * unwilling or unable to handle them more cleanly -- for OOM, for likely memory\n * corruption, and so on.  It's also a good solution if you need safe behavior\n * in release builds as well as debug builds.  But if the failure is one that\n * should be debugged and fixed, MOZ_ASSERT is generally preferable.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining why we're crashing.  This argument is intended for use with\n * MOZ_CRASH() calls whose rationale is non-obvious; don't use it if it's\n * obvious why we're crashing.\n *\n * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an\n * explanation-string, we print the string to stderr.  Otherwise, we don't\n * print anything; this is because we want MOZ_CRASH to be 100% safe in release\n * builds, and it's hard to print to stderr safely when memory might have been\n * corrupted.\n */\n#ifndef DEBUG\n#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()\n#else\n#  define MOZ_CRASH(...) \\\n     do { \\\n       MOZ_ReportCrash(\"\" __VA_ARGS__, __FILE__, __LINE__); \\\n       MOZ_REALLY_CRASH(); \\\n     } while(0)\n#endif\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n/*\n * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in\n * debug builds.  If it is, execution continues.  Otherwise, an error message\n * including the expression and the explanation-string (if provided) is printed,\n * an attempt is made to invoke any existing debugger, and execution halts.\n * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition\n * which can correctly be falsy.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining the assertion.  It is intended for use with assertions whose\n * correctness or rationale is non-obvious, and for assertions where the \"real\"\n * condition being tested is best described prosaically.  Don't provide an\n * explanation if it's not actually helpful.\n *\n *   // No explanation needed: pointer arguments often must not be NULL.\n *   MOZ_ASSERT(arg);\n *\n *   // An explanation can be helpful to explain exactly how we know an\n *   // assertion is valid.\n *   MOZ_ASSERT(state == WAITING_FOR_RESPONSE,\n *              \"given that <thingA> and <thingB>, we must have...\");\n *\n *   // Or it might disambiguate multiple identical (save for their location)\n *   // assertions of the same expression.\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this Boolean object\");\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this String object\");\n *\n * MOZ_ASSERT has no effect in non-debug builds.  It is designed to catch bugs\n * *only* during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n   /* First the single-argument form. */\n#  define MOZ_ASSERT_HELPER1(expr) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* Now the two-argument form. */\n#  define MOZ_ASSERT_HELPER2(expr, explain) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr \" (\" explain \")\", __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* And now, helper macrology up the wazoo. */\n   /*\n    * Count the number of arguments passed to MOZ_ASSERT, very carefully\n    * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a\n    * single token in argument lists.  See these URLs for details:\n    *\n    *   http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement\n    *   http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644\n    */\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL2(_1, _2, count, ...) \\\n     count\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL(args) \\\n\t MOZ_COUNT_ASSERT_ARGS_IMPL2 args\n#  define MOZ_COUNT_ASSERT_ARGS(...) \\\n     MOZ_COUNT_ASSERT_ARGS_IMPL((__VA_ARGS__, 2, 1, 0))\n   /* Pick the right helper macro to invoke. */\n#  define MOZ_ASSERT_CHOOSE_HELPER2(count) MOZ_ASSERT_HELPER##count\n#  define MOZ_ASSERT_CHOOSE_HELPER1(count) MOZ_ASSERT_CHOOSE_HELPER2(count)\n#  define MOZ_ASSERT_CHOOSE_HELPER(count) MOZ_ASSERT_CHOOSE_HELPER1(count)\n   /* The actual macro. */\n#  define MOZ_ASSERT_GLUE(x, y) x y\n#  define MOZ_ASSERT(...) \\\n     MOZ_ASSERT_GLUE(MOZ_ASSERT_CHOOSE_HELPER(MOZ_COUNT_ASSERT_ARGS(__VA_ARGS__)), \\\n                     (__VA_ARGS__))\n#else\n#  define MOZ_ASSERT(...) do { } while(0)\n#endif /* DEBUG */\n\n/*\n * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is\n * true.\n *\n *   MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));\n *\n * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds.  It is\n * designed to catch bugs during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n#  define MOZ_ASSERT_IF(cond, expr) \\\n     do { \\\n       if (cond) \\\n         MOZ_ASSERT(expr); \\\n     } while (0)\n#else\n#  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that it is\n * undefined behavior for execution to reach this point.  No guarantees are made\n * about what will happen if this is reached at runtime.  Most code should\n * probably use the higher level MOZ_ASSUME_UNREACHABLE, which uses this when\n * appropriate.\n */\n#if defined(__clang__)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#elif defined(__GNUC__)\n   /*\n    * __builtin_unreachable() was implemented in gcc 4.5.  If we don't have\n    * that, call a noreturn function; abort() will do nicely.  Qualify the call\n    * in C++ in case there's another abort() visible in local scope.\n    */\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0)\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#  else\n#    ifdef __cplusplus\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#    else\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __assume(0)\n#else\n#  ifdef __cplusplus\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#  else\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#  endif\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE([reason]) tells the compiler that it can assume that\n * the macro call cannot be reached during execution.  This lets the compiler\n * generate better-optimized code under some circumstances, at the expense of\n * the program's behavior being undefined if control reaches the\n * MOZ_ASSUME_UNREACHABLE.\n *\n * In Gecko, you probably should not use this macro outside of performance- or\n * size-critical code, because it's unsafe.  If you don't care about code size\n * or performance, you should probably use MOZ_ASSERT or MOZ_CRASH.\n *\n * SpiderMonkey is a different beast, and there it's acceptable to use\n * MOZ_ASSUME_UNREACHABLE more widely.\n *\n * Note that MOZ_ASSUME_UNREACHABLE is noreturn, so it's valid not to return a\n * value following a MOZ_ASSUME_UNREACHABLE call.\n *\n * Example usage:\n *\n *   enum ValueType {\n *     VALUE_STRING,\n *     VALUE_INT,\n *     VALUE_FLOAT\n *   };\n *\n *   int ptrToInt(ValueType type, void* value) {\n *   {\n *     // We know for sure that type is either INT or FLOAT, and we want this\n *     // code to run as quickly as possible.\n *     switch (type) {\n *     case VALUE_INT:\n *       return *(int*) value;\n *     case VALUE_FLOAT:\n *       return (int) *(float*) value;\n *     default:\n *       MOZ_ASSUME_UNREACHABLE(\"can only handle VALUE_INT and VALUE_FLOAT\");\n *     }\n *   }\n */\n#if defined(DEBUG)\n#  define MOZ_ASSUME_UNREACHABLE(...) \\\n     do { \\\n       MOZ_ASSERT(false, \"MOZ_ASSUME_UNREACHABLE(\" __VA_ARGS__ \")\"); \\\n       MOZ_ASSUME_UNREACHABLE_MARKER(); \\\n     } while (0)\n#else\n#  define MOZ_ASSUME_UNREACHABLE(reason)  MOZ_ASSUME_UNREACHABLE_MARKER()\n#endif\n\n/*\n * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided\n * expression, in debug builds and in release builds both.  Then, in debug\n * builds only, the value of the expression is asserted either true or false\n * using MOZ_ASSERT.\n */\n#ifdef DEBUG\n#  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))\n#  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))\n#else\n#  define MOZ_ALWAYS_TRUE(expr)      ((void)(expr))\n#  define MOZ_ALWAYS_FALSE(expr)     ((void)(expr))\n#endif\n\n#endif /* mozilla_Assertions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Atomics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements (almost always) lock-free atomic operations. The operations here\n * are a subset of that which can be found in C++11's <atomic> header, with a\n * different API to enforce consistent memory ordering constraints.\n *\n * Anyone caught using |volatile| for inter-thread memory safety needs to be\n * sent a copy of this header and the C++11 standard.\n */\n\n#ifndef mozilla_Atomics_h\n#define mozilla_Atomics_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n\n/*\n * Our minimum deployment target on clang/OS X is OS X 10.6, whose SDK\n * does not have <atomic>.  So be sure to check for <atomic> support\n * along with C++0x support.\n */\n#if defined(__clang__)\n   /*\n    * clang doesn't like libstdc++'s version of <atomic> before GCC 4.7,\n    * due to the loose typing of the __sync_* family of functions done by\n    * GCC.  We do not have a particularly good way to detect this sort of\n    * case at this point, so just assume that if we're on a Linux system,\n    * we can't use the system's <atomic>.\n    *\n    * OpenBSD uses an old libstdc++ 4.2.1 and thus doesnt have <atomic>.\n    */\n#  if !defined(__linux__) && !defined(__OpenBSD__) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \\\n      __has_include(<atomic>)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n/*\n * Android uses a different C++ standard library that does not provide\n * support for <atomic>.\n *\n * GCC 4.5.x and 4.6.x's unspecialized std::atomic template doesn't include\n * inline definitions for the functions declared therein.  This oversight\n * leads to linking errors when using atomic enums.  We therefore require\n * GCC 4.7 or higher.\n */\n#elif defined(__GNUC__) && !defined(__ANDROID__)\n#  include \"mozilla/Compiler.h\"\n#  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \\\n      MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n#elif defined(_MSC_VER) && _MSC_VER >= 1700\n#  define MOZ_HAVE_CXX11_ATOMICS\n#endif\n\nnamespace mozilla {\n\n/**\n * An enum of memory ordering possibilities for atomics.\n *\n * Memory ordering is the observable state of distinct values in memory.\n * (It's a separate concept from atomicity, which concerns whether an\n * operation can ever be observed in an intermediate state.  Don't\n * conflate the two!)  Given a sequence of operations in source code on\n * memory, it is *not* always the case that, at all times and on all\n * cores, those operations will appear to have occurred in that exact\n * sequence.  First, the compiler might reorder that sequence, if it\n * thinks another ordering will be more efficient.  Second, the CPU may\n * not expose so consistent a view of memory.  CPUs will often perform\n * their own instruction reordering, above and beyond that performed by\n * the compiler.  And each core has its own memory caches, and accesses\n * (reads and writes both) to \"memory\" may only resolve to out-of-date\n * cache entries -- not to the \"most recently\" performed operation in\n * some global sense.  Any access to a value that may be used by\n * multiple threads, potentially across multiple cores, must therefore\n * have a memory ordering imposed on it, for all code on all\n * threads/cores to have a sufficiently coherent worldview.\n *\n * http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync and\n * http://en.cppreference.com/w/cpp/atomic/memory_order go into more\n * detail on all this, including examples of how each mode works.\n *\n * Note that for simplicity and practicality, not all of the modes in\n * C++11 are supported.  The missing C++11 modes are either subsumed by\n * the modes we provide below, or not relevant for the CPUs we support\n * in Gecko.  These three modes are confusing enough as it is!\n */\nenum MemoryOrdering {\n  /*\n   * Relaxed ordering is the simplest memory ordering: none at all.\n   * When the result of a write is observed, nothing may be inferred\n   * about other memory.  Writes ostensibly performed \"before\" on the\n   * writing thread may not yet be visible.  Writes performed \"after\" on\n   * the writing thread may already be visible, if the compiler or CPU\n   * reordered them.  (The latter can happen if reads and/or writes get\n   * held up in per-processor caches.)  Relaxed ordering means\n   * operations can always use cached values (as long as the actual\n   * updates to atomic values actually occur, correctly, eventually), so\n   * it's usually the fastest sort of atomic access.  For this reason,\n   * *it's also the most dangerous kind of access*.\n   *\n   * Relaxed ordering is good for things like process-wide statistics\n   * counters that don't need to be consistent with anything else, so\n   * long as updates themselves are atomic.  (And so long as any\n   * observations of that value can tolerate being out-of-date -- if you\n   * need some sort of up-to-date value, you need some sort of other\n   * synchronizing operation.)  It's *not* good for locks, mutexes,\n   * reference counts, etc. that mediate access to other memory, or must\n   * be observably consistent with other memory.\n   *\n   * x86 architectures don't take advantage of the optimization\n   * opportunities that relaxed ordering permits.  Thus it's possible\n   * that using relaxed ordering will \"work\" on x86 but fail elsewhere\n   * (ARM, say, which *does* implement non-sequentially-consistent\n   * relaxed ordering semantics).  Be extra-careful using relaxed\n   * ordering if you can't easily test non-x86 architectures!\n   */\n  Relaxed,\n  /*\n   * When an atomic value is updated with ReleaseAcquire ordering, and\n   * that new value is observed with ReleaseAcquire ordering, prior\n   * writes (atomic or not) are also observable.  What ReleaseAcquire\n   * *doesn't* give you is any observable ordering guarantees for\n   * ReleaseAcquire-ordered operations on different objects.  For\n   * example, if there are two cores that each perform ReleaseAcquire\n   * operations on separate objects, each core may or may not observe\n   * the operations made by the other core.  The only way the cores can\n   * be synchronized with ReleaseAcquire is if they both\n   * ReleaseAcquire-access the same object.  This implies that you can't\n   * necessarily describe some global total ordering of ReleaseAcquire\n   * operations.\n   *\n   * ReleaseAcquire ordering is good for (as the name implies) atomic\n   * operations on values controlling ownership of things: reference\n   * counts, mutexes, and the like.  However, if you are thinking about\n   * using these to implement your own locks or mutexes, you should take\n   * a good, hard look at actual lock or mutex primitives first.\n   */\n  ReleaseAcquire,\n  /*\n   * When an atomic value is updated with SequentiallyConsistent\n   * ordering, all writes observable when the update is observed, just\n   * as with ReleaseAcquire ordering.  But, furthermore, a global total\n   * ordering of SequentiallyConsistent operations *can* be described.\n   * For example, if two cores perform SequentiallyConsistent operations\n   * on separate objects, one core will observably perform its update\n   * (and all previous operations will have completed), then the other\n   * core will observably perform its update (and all previous\n   * operations will have completed).  (Although those previous\n   * operations aren't themselves ordered -- they could be intermixed,\n   * or ordered if they occur on atomic values with ordering\n   * requirements.)  SequentiallyConsistent is the *simplest and safest*\n   * ordering of atomic operations -- it's always as if one operation\n   * happens, then another, then another, in some order -- and every\n   * core observes updates to happen in that single order.  Because it\n   * has the most synchronization requirements, operations ordered this\n   * way also tend to be slowest.\n   *\n   * SequentiallyConsistent ordering can be desirable when multiple\n   * threads observe objects, and they all have to agree on the\n   * observable order of changes to them.  People expect\n   * SequentiallyConsistent ordering, even if they shouldn't, when\n   * writing code, atomic or otherwise.  SequentiallyConsistent is also\n   * the ordering of choice when designing lockless data structures.  If\n   * you don't know what order to use, use this one.\n   */\n  SequentiallyConsistent,\n};\n\n} // namespace mozilla\n\n// Build up the underlying intrinsics.\n#ifdef MOZ_HAVE_CXX11_ATOMICS\n\n#  include <atomic>\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * We provide CompareExchangeFailureOrder to work around a bug in some\n * versions of GCC's <atomic> header.  See bug 898491.\n */\ntemplate<MemoryOrdering Order> struct AtomicOrderConstraints;\n\ntemplate<>\nstruct AtomicOrderConstraints<Relaxed>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;\n    static const std::memory_order LoadOrder = std::memory_order_relaxed;\n    static const std::memory_order StoreOrder = std::memory_order_relaxed;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_relaxed;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<ReleaseAcquire>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;\n    static const std::memory_order LoadOrder = std::memory_order_acquire;\n    static const std::memory_order StoreOrder = std::memory_order_release;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_acquire;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<SequentiallyConsistent>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;\n    static const std::memory_order LoadOrder = std::memory_order_seq_cst;\n    static const std::memory_order StoreOrder = std::memory_order_seq_cst;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_seq_cst;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicBase\n{\n    typedef std::atomic<T> ValueType;\n    typedef AtomicOrderConstraints<Order> OrderedOp;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T load(const typename Base::ValueType& ptr) {\n      return ptr.load(Base::OrderedOp::LoadOrder);\n    }\n    static void store(typename Base::ValueType& ptr, T val) {\n      ptr.store(val, Base::OrderedOp::StoreOrder);\n    }\n    static T exchange(typename Base::ValueType& ptr, T val) {\n      return ptr.exchange(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static bool compareExchange(typename Base::ValueType& ptr, T oldVal, T newVal) {\n      return ptr.compare_exchange_strong(oldVal, newVal,\n                                         Base::OrderedOp::AtomicRMWOrder,\n                                         Base::OrderedOp::CompareExchangeFailureOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T add(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_add(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T sub(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_sub(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>\n{\n    typedef IntrinsicBase<T*, Order> Base;\n    static T* add(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_add(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T* sub(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_sub(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n  private:\n    /*\n     * GCC 4.6's <atomic> header has a bug where adding X to an\n     * atomic<T*> is not the same as adding X to a T*.  Hence the need\n     * for this function to provide the correct addend.\n     */\n    static ptrdiff_t fixupAddend(ptrdiff_t val) {\n#if defined(__clang__) || defined(_MSC_VER)\n      return val;\n#elif defined(__GNUC__) && MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) && \\\n      !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n      return val * sizeof(T);\n#else\n      return val;\n#endif\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T inc(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::add(ptr, 1);\n    }\n    static T dec(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::sub(ptr, 1);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T or_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_or(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T xor_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_xor(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T and_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_and(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order>\n  : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(__GNUC__)\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The __sync_* family of intrinsics is documented here:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Atomic-Builtins.html\n *\n * While these intrinsics are deprecated in favor of the newer __atomic_*\n * family of intrincs:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/_005f_005fatomic-Builtins.html\n *\n * any GCC version that supports the __atomic_* intrinsics will also support\n * the <atomic> header and so will be handled above.  We provide a version of\n * atomics using the __sync_* intrinsics to support older versions of GCC.\n *\n * All __sync_* intrinsics that we use below act as full memory barriers, for\n * both compiler and hardware reordering, except for __sync_lock_test_and_set,\n * which is a only an acquire barrier.  When we call __sync_lock_test_and_set,\n * we add a barrier above it as appropriate.\n */\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * Some processors (in particular, x86) don't require quite so many calls to\n * __sync_sychronize as our specializations of Barrier produce.  If\n * performance turns out to be an issue, defining these specializations\n * on a per-processor basis would be a good first tuning step.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { __sync_synchronize(); }\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() { __sync_synchronize(); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps\n{\n    static T load(const T& ptr) {\n      Barrier<Order>::beforeLoad();\n      T val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(T& ptr, T val) {\n      Barrier<Order>::beforeStore();\n      ptr = val;\n      Barrier<Order>::afterStore();\n    }\n    static T exchange(T& ptr, T val) {\n      // __sync_lock_test_and_set is only an acquire barrier; loads and stores\n      // can't be moved up from after to before it, but they can be moved down\n      // from before to after it.  We may want a stricter ordering, so we need\n      // an explicit barrier.\n\n      Barrier<Order>::beforeStore();\n      return __sync_lock_test_and_set(&ptr, val);\n    }\n    static bool compareExchange(T& ptr, T oldVal, T newVal) {\n      return __sync_bool_compare_and_swap(&ptr, oldVal, newVal);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub\n{\n    typedef T ValueType;\n    static T add(T& ptr, T val) {\n      return __sync_fetch_and_add(&ptr, val);\n    }\n    static T sub(T& ptr, T val) {\n      return __sync_fetch_and_sub(&ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*>\n{\n    typedef T* ValueType;\n    /*\n     * The reinterpret_casts are needed so that\n     * __sync_fetch_and_{add,sub} will properly type-check.\n     *\n     * Also, these functions do not provide standard semantics for\n     * pointer types, so we need to adjust the addend.\n     */\n    static ValueType add(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_add(&ptr, amount);\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_sub(&ptr, amount);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static T inc(T& ptr) { return IntrinsicAddSub<T>::add(ptr, 1); }\n    static T dec(T& ptr) { return IntrinsicAddSub<T>::sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static T or_(T& ptr, T val) {\n      return __sync_fetch_and_or(&ptr, val);\n    }\n    static T xor_(T& ptr, T val) {\n      return __sync_fetch_and_xor(&ptr, val);\n    }\n    static T and_(T& ptr, T val) {\n      return __sync_fetch_and_and(&ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(_MSC_VER)\n\n/*\n * Windows comes with a full complement of atomic operations.\n * Unfortunately, most of those aren't available for Windows XP (even if\n * the compiler supports intrinsics for them), which is the oldest\n * version of Windows we support.  Therefore, we only provide operations\n * on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows\n * versions, we support 64-bit datatypes as well.\n *\n * To avoid namespace pollution issues, we declare whatever functions we\n * need ourselves.\n */\n\nextern \"C\" {\nlong __cdecl _InterlockedExchangeAdd(long volatile* dst, long value);\nlong __cdecl _InterlockedOr(long volatile* dst, long value);\nlong __cdecl _InterlockedXor(long volatile* dst, long value);\nlong __cdecl _InterlockedAnd(long volatile* dst, long value);\nlong __cdecl _InterlockedExchange(long volatile *dst, long value);\nlong __cdecl _InterlockedCompareExchange(long volatile *dst, long newVal, long oldVal);\n}\n\n#  pragma intrinsic(_InterlockedExchangeAdd)\n#  pragma intrinsic(_InterlockedOr)\n#  pragma intrinsic(_InterlockedXor)\n#  pragma intrinsic(_InterlockedAnd)\n#  pragma intrinsic(_InterlockedExchange)\n#  pragma intrinsic(_InterlockedCompareExchange)\n\nnamespace mozilla {\nnamespace detail {\n\n#  if !defined(_M_IX86) && !defined(_M_X64)\n     /*\n      * The implementations below are optimized for x86ish systems.  You\n      * will have to modify them if you are porting to Windows on a\n      * different architecture.\n      */\n#    error \"Unknown CPU type\"\n#  endif\n\n/*\n * The PrimitiveIntrinsics template should define |Type|, the datatype of size\n * DataSize upon which we operate, and the following eight functions.\n *\n * static Type add(Type* ptr, Type val);\n * static Type sub(Type* ptr, Type val);\n * static Type or_(Type* ptr, Type val);\n * static Type xor_(Type* ptr, Type val);\n * static Type and_(Type* ptr, Type val);\n *\n *   These functions perform the obvious operation on the value contained in\n *   |*ptr| combined with |val| and return the value previously stored in\n *   |*ptr|.\n *\n * static void store(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and must provide a full\n *   memory fence after the store to prevent compiler and hardware instruction\n *   reordering.  It should also act as a compiler barrier to prevent reads and\n *   writes from moving to after the store.\n *\n * static Type exchange(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and returns the previous\n *   contents of *ptr;\n *\n * static bool compareExchange(Type* ptr, Type oldVal, Type newVal);\n *\n *   This function atomically performs the following operation:\n *\n *     if (*ptr == oldVal) {\n *       *ptr = newVal;\n *       return true;\n *     } else {\n *       return false;\n *     }\n *\n */\ntemplate<size_t DataSize> struct PrimitiveIntrinsics;\n\ntemplate<>\nstruct PrimitiveIntrinsics<4>\n{\n    typedef long Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * _InterlockedExchangeSubtract isn't available before Windows 7,\n       * and we must support Windows XP.\n       */\n      return _InterlockedExchangeAdd(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  if defined(_M_X64)\n\nextern \"C\" {\nlong long __cdecl _InterlockedExchangeAdd64(long long volatile* dst,\n                                            long long value);\nlong long __cdecl _InterlockedOr64(long long volatile* dst,\n                                   long long value);\nlong long __cdecl _InterlockedXor64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedAnd64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedExchange64(long long volatile* dst,\n                                         long long value);\nlong long __cdecl _InterlockedCompareExchange64(long long volatile* dst,\n                                                long long newVal,\n                                                long long oldVal);\n}\n\n#    pragma intrinsic(_InterlockedExchangeAdd64)\n#    pragma intrinsic(_InterlockedOr64)\n#    pragma intrinsic(_InterlockedXor64)\n#    pragma intrinsic(_InterlockedAnd64)\n#    pragma intrinsic(_InterlockedExchange64)\n#    pragma intrinsic(_InterlockedCompareExchange64)\n\ntemplate <>\nstruct PrimitiveIntrinsics<8>\n{\n    typedef __int64 Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd64(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * There is no _InterlockedExchangeSubtract64.\n       */\n      return _InterlockedExchangeAdd64(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr64(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor64(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd64(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange64(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange64(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange64(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  endif\n\nextern \"C\" { void _ReadWriteBarrier(); }\n\n#  pragma intrinsic(_ReadWriteBarrier)\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * We do not provide an afterStore method in Barrier, as Relaxed and\n * ReleaseAcquire orderings do not require one, and the required barrier\n * for SequentiallyConsistent is handled by PrimitiveIntrinsics.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { _ReadWriteBarrier(); }\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper\n{\n  static PrimType toPrimType(T val) { return static_cast<PrimType>(val); }\n  static T fromPrimType(PrimType val) { return static_cast<T>(val); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper<PrimType, T*>\n{\n  static PrimType toPrimType(T* val) { return reinterpret_cast<PrimType>(val); }\n  static T* fromPrimType(PrimType val) { return reinterpret_cast<T*>(val); }\n};\n\ntemplate<typename T>\nstruct IntrinsicBase\n{\n    typedef T ValueType;\n    typedef PrimitiveIntrinsics<sizeof(T)> Primitives;\n    typedef typename Primitives::Type PrimType;\n    static_assert(sizeof(PrimType) == sizeof(T),\n                  \"Selection of PrimitiveIntrinsics was wrong\");\n    typedef CastHelper<PrimType, T> Cast;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T>\n{\n    static ValueType load(const ValueType& ptr) {\n      Barrier<Order>::beforeLoad();\n      ValueType val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(ValueType& ptr, ValueType val) {\n      // For SequentiallyConsistent, Primitives::store() will generate the\n      // proper memory fence.  Everything else just needs a barrier before\n      // the store.\n      if (Order == SequentiallyConsistent) {\n        Primitives::store(reinterpret_cast<PrimType*>(&ptr),\n                          Cast::toPrimType(val));\n      } else {\n        Barrier<Order>::beforeStore();\n        ptr = val;\n      }\n    }\n    static ValueType exchange(ValueType& ptr, ValueType val) {\n      PrimType oldval =\n        Primitives::exchange(reinterpret_cast<PrimType*>(&ptr),\n                             Cast::toPrimType(val));\n      return Cast::fromPrimType(oldval);\n    }\n    static bool compareExchange(ValueType& ptr, ValueType oldVal, ValueType newVal) {\n      return Primitives::compareExchange(reinterpret_cast<PrimType*>(&ptr),\n                                         Cast::toPrimType(oldVal),\n                                         Cast::toPrimType(newVal));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicApplyHelper : public IntrinsicBase<T>\n{\n    typedef PrimType (*BinaryOp)(PrimType*, PrimType);\n    typedef PrimType (*UnaryOp)(PrimType*);\n\n    static ValueType applyBinaryFunction(BinaryOp op, ValueType& ptr,\n                                         ValueType val) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      PrimType primTypeVal = Cast::toPrimType(val);\n      return Cast::fromPrimType(op(primTypePtr, primTypeVal));\n    }\n\n    static ValueType applyUnaryFunction(UnaryOp op, ValueType& ptr) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      return Cast::fromPrimType(op(primTypePtr));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub : public IntrinsicApplyHelper<T>\n{\n    static ValueType add(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::add, ptr, val);\n    }\n    static ValueType sub(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::sub, ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*> : public IntrinsicApplyHelper<T*>\n{\n    static ValueType add(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::add, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::sub, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static ValueType inc(ValueType& ptr) { return add(ptr, 1); }\n    static ValueType dec(ValueType& ptr) { return sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static ValueType or_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::or_, ptr, val);\n    }\n    static ValueType xor_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::xor_, ptr, val);\n    }\n    static ValueType and_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::and_, ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#else\n# error \"Atomic compiler intrinsics are not supported on your platform\"\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBase\n{\n    // We only support 32-bit types on 32-bit Windows, which constrains our\n    // implementation elsewhere.  But we support pointer-sized types everywhere.\n    static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),\n                  \"mozilla/Atomics.h only supports 32-bit and pointer-sized types\");\n\n  protected:\n    typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;\n    typename Intrinsics::ValueType mValue;\n\n  public:\n    AtomicBase() : mValue() {}\n    AtomicBase(T aInit) { Intrinsics::store(mValue, aInit); }\n\n    operator T() const { return Intrinsics::load(mValue); }\n\n    T operator=(T aValue) {\n      Intrinsics::store(mValue, aValue);\n      return aValue;\n    }\n\n    /**\n     * Performs an atomic swap operation.  aValue is stored and the previous\n     * value of this variable is returned.\n     */\n    T exchange(T aValue) {\n      return Intrinsics::exchange(mValue, aValue);\n    }\n\n    /**\n     * Performs an atomic compare-and-swap operation and returns true if it\n     * succeeded. This is equivalent to atomically doing\n     *\n     *   if (mValue == aOldValue) {\n     *     mValue = aNewValue;\n     *     return true;\n     *   } else {\n     *     return false;\n     *   }\n     */\n    bool compareExchange(T aOldValue, T aNewValue) {\n      return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);\n    }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBaseIncDec : public AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    AtomicBaseIncDec() : Base() {}\n    AtomicBaseIncDec(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }\n    T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }\n    T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }\n    T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\n} // namespace detail\n\n/**\n * A wrapper for a type that enforces that all memory accesses are atomic.\n *\n * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in\n * its place.  Implementations for integral and pointer types are provided\n * below.\n *\n * Atomic accesses are sequentially consistent by default.  You should\n * use the default unless you are tall enough to ride the\n * memory-ordering roller coaster (if you're not sure, you aren't) and\n * you have a compelling reason to do otherwise.\n *\n * There is one exception to the case of atomic memory accesses: providing an\n * initial value of the atomic value is not guaranteed to be atomic.  This is a\n * deliberate design choice that enables static atomic variables to be declared\n * without introducing extra static constructors.\n */\ntemplate<typename T,\n         MemoryOrdering Order = SequentiallyConsistent,\n         typename Enable = void>\nclass Atomic;\n\n/**\n * Atomic<T> implementation for integral types.\n *\n * In addition to atomic store and load operations, compound assignment and\n * increment/decrement operators are implemented which perform the\n * corresponding read-modify-write operation atomically.  Finally, an atomic\n * swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsIntegral<T>::value>::Type>\n  : public detail::AtomicBaseIncDec<T, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator+=(T delta) { return Base::Intrinsics::add(Base::mValue, delta) + delta; }\n    T operator-=(T delta) { return Base::Intrinsics::sub(Base::mValue, delta) - delta; }\n    T operator|=(T val) { return Base::Intrinsics::or_(Base::mValue, val) | val; }\n    T operator^=(T val) { return Base::Intrinsics::xor_(Base::mValue, val) ^ val; }\n    T operator&=(T val) { return Base::Intrinsics::and_(Base::mValue, val) & val; }\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for pointer types.\n *\n * An atomic compare-and-swap primitive for pointer variables is provided, as\n * are atomic increment and decement operators.  Also provided are the compound\n * assignment operators for addition and subtraction. Atomic swap (via\n * exchange()) is included as well.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T*, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T* aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T* operator+=(ptrdiff_t delta) {\n      return Base::Intrinsics::add(Base::mValue, delta) + delta;\n    }\n    T* operator-=(ptrdiff_t delta) {\n      return Base::Intrinsics::sub(Base::mValue, delta) - delta;\n    }\n\n  private:\n    Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for enum types.\n *\n * The atomic store and load operations and the atomic swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>\n  : public detail::AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Atomics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Attributes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of various class and method modifier attributes. */\n\n#ifndef mozilla_Attributes_h\n#define mozilla_Attributes_h\n\n#include \"mozilla/Compiler.h\"\n\n/*\n * MOZ_INLINE is a macro which expands to tell the compiler that the method\n * decorated with it should be inlined.  This macro is usable from C and C++\n * code, even though C89 does not support the |inline| keyword.  The compiler\n * may ignore this directive if it chooses.\n */\n#if defined(__cplusplus)\n#  define MOZ_INLINE            inline\n#elif defined(_MSC_VER)\n#  define MOZ_INLINE            __inline\n#elif defined(__GNUC__)\n#  define MOZ_INLINE            __inline__\n#else\n#  define MOZ_INLINE            inline\n#endif\n\n/*\n * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must be inlined, even if the compiler thinks\n * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:\n * compilers are not guaranteed to respect it (although they're much more likely\n * to do so).\n *\n * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the\n * compiler to inline even in DEBUG builds. It should be used very rarely.\n */\n#if defined(_MSC_VER)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __forceinline\n#elif defined(__GNUC__)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     MOZ_INLINE\n#endif\n\n#if defined(DEBUG)\n#  define MOZ_ALWAYS_INLINE     MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG\n#endif\n\n/*\n * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality\n * without warnings (functionality used by the macros below).  These modes are\n * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more\n * standardly, by checking whether __cplusplus has a C++11 or greater value.\n * Current versions of g++ do not correctly set __cplusplus, so we check both\n * for forward compatibility.\n */\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_constexpr)\n#    define MOZ_HAVE_CXX11_CONSTEXPR\n#  endif\n#  if __has_extension(cxx_deleted_functions)\n#    define MOZ_HAVE_CXX11_DELETE\n#  endif\n#  if __has_extension(cxx_override_control)\n#    define MOZ_HAVE_CXX11_OVERRIDE\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  endif\n#  if __has_attribute(noinline)\n#    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))\n#  endif\n#  if __has_attribute(noreturn)\n#    define MOZ_HAVE_NORETURN            __attribute__((noreturn))\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_OVERRIDE\n#      define MOZ_HAVE_CXX11_FINAL       final\n#    endif\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_CONSTEXPR\n#    endif\n#    define MOZ_HAVE_CXX11_DELETE\n#  else\n     /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_FINAL       __final\n#    endif\n#  endif\n#  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))\n#  define MOZ_HAVE_NORETURN              __attribute__((noreturn))\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  else\n     /* MSVC <= 10 used to spell \"final\" as \"sealed\". */\n#    define MOZ_HAVE_CXX11_FINAL         sealed\n#  endif\n#  define MOZ_HAVE_CXX11_OVERRIDE\n#  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)\n#  define MOZ_HAVE_NORETURN              __declspec(noreturn)\n#endif\n\n/*\n * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a\n * function at compile time. A constexpr function cannot examine any values\n * except its arguments and can have no side effects except its return value.\n * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's\n * value may be computed at compile time.  It should be prefered to just\n * marking variables as MOZ_CONSTEXPR because if the compiler does not support\n * constexpr it will fall back to making the variable const, and some compilers\n * do not accept variables being marked both const and constexpr.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_CONSTEXPR         constexpr\n#  define MOZ_CONSTEXPR_VAR     constexpr\n#else\n#  define MOZ_CONSTEXPR         /* no support */\n#  define MOZ_CONSTEXPR_VAR     const\n#endif\n\n/*\n * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must never be inlined, even if the compiler would\n * otherwise choose to inline the method.  Compilers aren't absolutely\n * guaranteed to support this, but most do.\n */\n#if defined(MOZ_HAVE_NEVER_INLINE)\n#  define MOZ_NEVER_INLINE      MOZ_HAVE_NEVER_INLINE\n#else\n#  define MOZ_NEVER_INLINE      /* no support */\n#endif\n\n/*\n * MOZ_NORETURN, specified at the start of a function declaration, indicates\n * that the given function does not return.  (The function definition does not\n * need to be annotated.)\n *\n *   MOZ_NORETURN void abort(const char* msg);\n *\n * This modifier permits the compiler to optimize code assuming a call to such a\n * function will never return.  It also enables the compiler to avoid spurious\n * warnings about not initializing variables, or about any other seemingly-dodgy\n * operations performed after the function returns.\n *\n * This modifier does not affect the corresponding function's linking behavior.\n */\n#if defined(MOZ_HAVE_NORETURN)\n#  define MOZ_NORETURN          MOZ_HAVE_NORETURN\n#else\n#  define MOZ_NORETURN          /* no support */\n#endif\n\n/*\n * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time\n * instrumentation shipped with Clang) to not instrument the annotated function.\n * Furthermore, it will prevent the compiler from inlining the function because\n * inlining currently breaks the blacklisting mechanism of AddressSanitizer.\n */\n#if defined(MOZ_ASAN)\n#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis))\n# else\n#  define MOZ_ASAN_BLACKLIST\n#endif\n\n\n#ifdef __cplusplus\n\n/*\n * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-\n * method declaration, attempts to delete that method from the corresponding\n * class.  An attempt to use the method will always produce an error *at compile\n * time* (instead of sometimes as late as link time) when this macro can be\n * implemented.  For example, you can use MOZ_DELETE to produce classes with no\n * implicit copy constructor or assignment operator:\n *\n *   struct NonCopyable\n *   {\n *     private:\n *       NonCopyable(const NonCopyable& other) MOZ_DELETE;\n *       void operator=(const NonCopyable& other) MOZ_DELETE;\n *   };\n *\n * If MOZ_DELETE can't be implemented for the current compiler, use of the\n * annotated method will still cause an error, but the error might occur at link\n * time in some cases rather than at compile time.\n *\n * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a\n * backstop, method declarations using MOZ_DELETE should be private.\n */\n#if defined(MOZ_HAVE_CXX11_DELETE)\n#  define MOZ_DELETE            = delete\n#else\n#  define MOZ_DELETE            /* no support */\n#endif\n\n/*\n * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class\n * overrides a member function of a base class, rather than potentially being a\n * new member function.  MOZ_OVERRIDE should be placed immediately before the\n * ';' terminating the member function's declaration, or before '= 0;' if the\n * member function is pure.  If the member function is defined in the class\n * definition, it should appear before the opening brace of the function body.\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() = 0;\n *   };\n *   class Derived1 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE;\n *   };\n *   class Derived2 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE = 0;\n *   };\n *   class Derived3 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE { }\n *   };\n *\n * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that\n * the function marked with it override a member function of a base class: it\n * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect\n * semantics and merely documents the override relationship to the reader (but\n * of course must still be used correctly to not break C++11 compilers).\n */\n#if defined(MOZ_HAVE_CXX11_OVERRIDE)\n#  define MOZ_OVERRIDE          override\n#else\n#  define MOZ_OVERRIDE          /* no support */\n#endif\n\n/*\n * MOZ_FINAL indicates that some functionality cannot be overridden through\n * inheritance.  It can be used to annotate either classes/structs or virtual\n * member functions.\n *\n * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after\n * the name of the class, before the list of classes from which it derives (if\n * any) and before its opening brace.  MOZ_FINAL must not be used to annotate\n * unnamed classes or structs.  (With some compilers, and with C++11 proper, the\n * underlying expansion is ambiguous with specifying a class name.)\n *\n *   class Base MOZ_FINAL\n *   {\n *     public:\n *       Base();\n *       ~Base();\n *       virtual void f() { }\n *   };\n *   // This will be an error in some compilers:\n *   class Derived : public Base\n *   {\n *     public:\n *       ~Derived() { }\n *   };\n *\n * One particularly common reason to specify MOZ_FINAL upon a class is to tell\n * the compiler that it's not dangerous for it to have a non-virtual destructor\n * yet have one or more virtual functions, silencing the warning it might emit\n * in this case.  Suppose Base above weren't annotated with MOZ_FINAL.  Because\n * ~Base() is non-virtual, an attempt to delete a Derived* through a Base*\n * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen.\n * (Formally C++ says behavior is undefined, but compilers will likely just call\n * ~Base() and not ~Derived().)  Specifying MOZ_FINAL tells the compiler that\n * it's safe for the destructor to be non-virtual.\n *\n * In compilers implementing final controls, it is an error to inherit from a\n * class annotated with MOZ_FINAL.  In other compilers it serves only as\n * documentation.\n *\n * To annotate a virtual member function with MOZ_FINAL, place MOZ_FINAL\n * immediately before the ';' terminating the member function's declaration, or\n * before '= 0;' if the member function is pure.  If the member function is\n * defined in the class definition, it should appear before the opening brace of\n * the function body.  (This placement is identical to that for MOZ_OVERRIDE.\n * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE'\n * for consistency.)\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() MOZ_FINAL;\n *   };\n *   class Derived\n *   {\n *     public:\n *       // This will be an error in some compilers:\n *       virtual void f();\n *   };\n *\n * In compilers implementing final controls, it is an error for a derived class\n * to override a method annotated with MOZ_FINAL.  In other compilers it serves\n * only as documentation.\n */\n#if defined(MOZ_HAVE_CXX11_FINAL)\n#  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL\n#else\n#  define MOZ_FINAL             /* no support */\n#endif\n\n/**\n * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's\n * return value is not used by the caller.\n *\n * Place this attribute at the very beginning of a function definition. For\n * example, write\n *\n *   MOZ_WARN_UNUSED_RESULT int foo();\n *\n * or\n *\n *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }\n */\n#if defined(__GNUC__) || defined(__clang__)\n#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))\n#else\n#  define MOZ_WARN_UNUSED_RESULT\n#endif\n\n/*\n * The following macros are attributes that support the static analysis plugin\n * included with Mozilla, and will be implemented (when such support is enabled)\n * as C++11 attributes. Since such attributes are legal pretty much everywhere\n * and have subtly different semantics depending on their placement, the\n * following is a guide on where to place the attributes.\n *\n * Attributes that apply to a struct or class precede the name of the class:\n * (Note that this is different from the placement of MOZ_FINAL for classes!)\n *\n *   class MOZ_CLASS_ATTRIBUTE SomeClass {};\n *\n * Attributes that apply to functions follow the parentheses and const\n * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body:\n *\n *   void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE;\n *   void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {}\n *   void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0;\n *   void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE;\n *\n * Attributes that apply to variables or parameters follow the variable's name:\n *\n *   int variable MOZ_VARIABLE_ATTRIBUTE;\n *\n * Attributes that apply to types follow the type name:\n *\n *   typedef int MOZ_TYPE_ATTRIBUTE MagicInt;\n *   int MOZ_TYPE_ATTRIBUTE someVariable;\n *   int * MOZ_TYPE_ATTRIBUTE magicPtrInt;\n *   int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt;\n *\n * Attributes that apply to statements precede the statement:\n *\n *   MOZ_IF_ATTRIBUTE if (x == 0)\n *   MOZ_DO_ATTRIBUTE do { } while(0);\n *\n * Attributes that apply to labels precede the label:\n *\n *   MOZ_LABEL_ATTRIBUTE target:\n *     goto target;\n *   MOZ_CASE_ATTRIBUTE case 5:\n *   MOZ_DEFAULT_ATTRIBUTE default:\n *\n * The static analyses that are performed by the plugin are as follows:\n *\n * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate\n *   subclasses must provide an exact override of this method; if a subclass\n *   does not override this method, the compiler will emit an error. This\n *   attribute is not limited to virtual methods, so if it is applied to a\n *   nonvirtual method and the subclass does not provide an equivalent\n *   definition, the compiler will emit an error.\n * MOZ_STACK_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack, so it is a compile-time error to use it, or\n *   an array of such objects, as a global or static variable, or as the type of\n *   a new expression (unless placement new is being used). If a member of\n *   another class uses this class, or if another class inherits from this\n *   class, then it is considered to be a stack class as well, although this\n *   attribute need not be provided in such cases.\n * MOZ_NONHEAP_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack or in static storage, so it is a compile-time\n *   error to use it, or an array of such objects, as the type of a new\n *   expression (unless placement new is being used). If a member of another\n *   class uses this class, or if another class inherits from this class, then\n *   it is considered to be a non-heap class as well, although this attribute\n *   need not be provided in such cases.\n */\n#ifdef MOZ_CLANG_PLUGIN\n# define MOZ_MUST_OVERRIDE __attribute__((annotate(\"moz_must_override\")))\n# define MOZ_STACK_CLASS __attribute__((annotate(\"moz_stack_class\")))\n# define MOZ_NONHEAP_CLASS __attribute__((annotate(\"moz_nonheap_class\")))\n#else\n# define MOZ_MUST_OVERRIDE /* nothing */\n# define MOZ_STACK_CLASS /* nothing */\n# define MOZ_NONHEAP_CLASS /* nothing */\n#endif /* MOZ_CLANG_PLUGIN */\n\n/*\n * MOZ_THIS_IN_INITIALIZER_LIST is used to avoid a warning when we know that\n * it's safe to use 'this' in an initializer list.\n */\n#ifdef _MSC_VER\n#  define MOZ_THIS_IN_INITIALIZER_LIST() \\\n     __pragma(warning(push)) \\\n     __pragma(warning(disable:4355)) \\\n     this \\\n     __pragma(warning(pop))\n#else\n#  define MOZ_THIS_IN_INITIALIZER_LIST() this\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_Attributes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/BloomFilter.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A counting Bloom filter implementation.  This allows consumers to\n * do fast probabilistic \"is item X in set Y?\" testing which will\n * never answer \"no\" when the correct answer is \"yes\" (but might\n * incorrectly answer \"yes\" when the correct answer is \"no\").\n */\n\n#ifndef mozilla_BloomFilter_h\n#define mozilla_BloomFilter_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Likely.h\"\n#include \"mozilla/Util.h\"\n\n#include <stdint.h>\n#include <string.h>\n\nnamespace mozilla {\n\n/*\n * This class implements a counting Bloom filter as described at\n * <http://en.wikipedia.org/wiki/Bloom_filter#Counting_filters>, with\n * 8-bit counters.  This allows quick probabilistic answers to the\n * question \"is object X in set Y?\" where the contents of Y might not\n * be time-invariant.  The probabilistic nature of the test means that\n * sometimes the answer will be \"yes\" when it should be \"no\".  If the\n * answer is \"no\", then X is guaranteed not to be in Y.\n *\n * The filter is parametrized on KeySize, which is the size of the key\n * generated by each of hash functions used by the filter, in bits,\n * and the type of object T being added and removed.  T must implement\n * a |uint32_t hash() const| method which returns a uint32_t hash key\n * that will be used to generate the two separate hash functions for\n * the Bloom filter.  This hash key MUST be well-distributed for good\n * results!  KeySize is not allowed to be larger than 16.\n *\n * The filter uses exactly 2**KeySize bytes of memory.  From now on we\n * will refer to the memory used by the filter as M.\n *\n * The expected rate of incorrect \"yes\" answers depends on M and on\n * the number N of objects in set Y.  As long as N is small compared\n * to M, the rate of such answers is expected to be approximately\n * 4*(N/M)**2 for this filter.  In practice, if Y has a few hundred\n * elements then using a KeySize of 12 gives a reasonably low\n * incorrect answer rate.  A KeySize of 12 has the additional benefit\n * of using exactly one page for the filter in typical hardware\n * configurations.\n */\n\ntemplate<unsigned KeySize, class T>\nclass BloomFilter\n{\n    /*\n     * A counting Bloom filter with 8-bit counters.  For now we assume\n     * that having two hash functions is enough, but we may revisit that\n     * decision later.\n     *\n     * The filter uses an array with 2**KeySize entries.\n     *\n     * Assuming a well-distributed hash function, a Bloom filter with\n     * array size M containing N elements and\n     * using k hash function has expected false positive rate exactly\n     *\n     * $  (1 - (1 - 1/M)^{kN})^k  $\n     *\n     * because each array slot has a\n     *\n     * $  (1 - 1/M)^{kN}  $\n     *\n     * chance of being 0, and the expected false positive rate is the\n     * probability that all of the k hash functions will hit a nonzero\n     * slot.\n     *\n     * For reasonable assumptions (M large, kN large, which should both\n     * hold if we're worried about false positives) about M and kN this\n     * becomes approximately\n     *\n     * $$  (1 - \\exp(-kN/M))^k   $$\n     *\n     * For our special case of k == 2, that's $(1 - \\exp(-2N/M))^2$,\n     * or in other words\n     *\n     * $$    N/M = -0.5 * \\ln(1 - \\sqrt(r))   $$\n     *\n     * where r is the false positive rate.  This can be used to compute\n     * the desired KeySize for a given load N and false positive rate r.\n     *\n     * If N/M is assumed small, then the false positive rate can\n     * further be approximated as 4*N^2/M^2.  So increasing KeySize by\n     * 1, which doubles M, reduces the false positive rate by about a\n     * factor of 4, and a false positive rate of 1% corresponds to\n     * about M/N == 20.\n     *\n     * What this means in practice is that for a few hundred keys using a\n     * KeySize of 12 gives false positive rates on the order of 0.25-4%.\n     *\n     * Similarly, using a KeySize of 10 would lead to a 4% false\n     * positive rate for N == 100 and to quite bad false positive\n     * rates for larger N.\n     */\n  public:\n    BloomFilter() {\n        static_assert(KeySize <= keyShift, \"KeySize too big\");\n\n        // Should we have a custom operator new using calloc instead and\n        // require that we're allocated via the operator?\n        clear();\n    }\n\n    /*\n     * Clear the filter.  This should be done before reusing it, because\n     * just removing all items doesn't clear counters that hit the upper\n     * bound.\n     */\n    void clear();\n\n    /*\n     * Add an item to the filter.\n     */\n    void add(const T* t);\n\n    /*\n     * Remove an item from the filter.\n     */\n    void remove(const T* t);\n\n    /*\n     * Check whether the filter might contain an item.  This can\n     * sometimes return true even if the item is not in the filter,\n     * but will never return false for items that are actually in the\n     * filter.\n     */\n    bool mightContain(const T* t) const;\n\n    /*\n     * Methods for add/remove/contain when we already have a hash computed\n     */\n    void add(uint32_t hash);\n    void remove(uint32_t hash);\n    bool mightContain(uint32_t hash) const;\n\n  private:\n    static const size_t arraySize = (1 << KeySize);\n    static const uint32_t keyMask = (1 << KeySize) - 1;\n    static const uint32_t keyShift = 16;\n\n    static uint32_t hash1(uint32_t hash) { return hash & keyMask; }\n    static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; }\n\n    uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; }\n    uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; }\n    const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; }\n    const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; }\n\n    static bool full(const uint8_t& slot) { return slot == UINT8_MAX; }\n\n    uint8_t counters[arraySize];\n};\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::clear()\n{\n  memset(counters, 0, arraySize);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::add(uint32_t hash)\n{\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    ++slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    ++slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::add(const T* t)\n{\n  uint32_t hash = t->hash();\n  return add(hash);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::remove(uint32_t hash)\n{\n  // If the slots are full, we don't know whether we bumped them to be\n  // there when we added or not, so just leave them full.\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    --slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    --slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::remove(const T* t)\n{\n  uint32_t hash = t->hash();\n  remove(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(uint32_t hash) const\n{\n  // Check that all the slots for this hash contain something\n  return firstSlot(hash) && secondSlot(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(const T* t) const\n{\n  uint32_t hash = t->hash();\n  return mightContain(hash);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_BloomFilter_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Casting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cast operations to supplement the built-in casting operations. */\n\n#ifndef mozilla_Casting_h\n#define mozilla_Casting_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <limits.h>\n\nnamespace mozilla {\n\n/**\n * Return a value of type |To|, containing the underlying bit pattern of |from|.\n *\n * |To| and |From| must be types of the same size; be careful of cross-platform\n * size differences, or this might fail to compile on some but not all\n * platforms.\n */\ntemplate<typename To, typename From>\ninline To\nBitwiseCast(const From from)\n{\n  static_assert(sizeof(From) == sizeof(To),\n                \"To and From must have the same size\");\n  union {\n    From from;\n    To to;\n  } u;\n  u.from = from;\n  return u.to;\n}\n\nnamespace detail {\n\nenum ToSignedness { ToIsSigned, ToIsUnsigned };\nenum FromSignedness { FromIsSigned, FromIsUnsigned };\n\ntemplate<typename From,\n         typename To,\n         FromSignedness = IsSigned<From>::value ? FromIsSigned : FromIsUnsigned,\n         ToSignedness = IsSigned<To>::value ? ToIsSigned : ToIsUnsigned>\nstruct BoundsCheckImpl;\n\n// Implicit conversions on operands to binary operations make this all a bit\n// hard to verify.  Attempt to ease the pain below by *only* comparing values\n// that are obviously the same type (and will undergo no further conversions),\n// even when it's not strictly necessary, for explicitness.\n\nenum UUComparison { FromIsBigger, FromIsNotBigger };\n\n// Unsigned-to-unsigned range check\n\ntemplate<typename From, typename To,\n         UUComparison = (sizeof(From) > sizeof(To)) ? FromIsBigger : FromIsNotBigger>\nstruct UnsignedUnsignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return from <= From(To(-1));\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsNotBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedUnsignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-unsigned range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (from < 0)\n        return false;\n      if (sizeof(To) >= sizeof(From))\n        return true;\n      return from <= From(To(-1));\n    }\n};\n\n// Unsigned-to-signed range check\n\nenum USComparison { FromIsSmaller, FromIsNotSmaller };\n\ntemplate<typename From, typename To,\n         USComparison = (sizeof(From) < sizeof(To)) ? FromIsSmaller : FromIsNotSmaller>\nstruct UnsignedSignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsNotSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      return from <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedSignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-signed range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (sizeof(From) <= sizeof(To))\n        return true;\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      const To MinValue = -MaxValue - To(1);\n      return From(MinValue) <= from &&\n             From(from) <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To,\n         bool TypesAreIntegral = IsIntegral<From>::value && IsIntegral<To>::value>\nclass BoundsChecker;\n\ntemplate<typename From>\nclass BoundsChecker<From, From, true>\n{\n  public:\n    static bool checkBounds(const From from) { return true; }\n};\n\ntemplate<typename From, typename To>\nclass BoundsChecker<From, To, true>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return BoundsCheckImpl<From, To>::checkBounds(from);\n    }\n};\n\ntemplate<typename From, typename To>\ninline bool\nIsInBounds(const From from)\n{\n  return BoundsChecker<From, To>::checkBounds(from);\n}\n\n} // namespace detail\n\n/**\n * Cast a value of integral type |From| to a value of integral type |To|,\n * asserting that the cast will be a safe cast per C++ (that is, that |to| is in\n * the range of values permitted for the type |From|).\n */\ntemplate<typename To, typename From>\ninline To\nSafeCast(const From from)\n{\n  MOZ_ASSERT((detail::IsInBounds<From, To>(from)));\n  return static_cast<To>(from);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Casting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Char16.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implements a UTF-16 character type. */\n\n#ifndef mozilla_Char16_h\n#define mozilla_Char16_h\n\n#include \"mozilla/Assertions.h\"\n\n/*\n * C11 and C++11 introduce a char16_t type and support for UTF-16 string and\n * character literals. C++11's char16_t is a distinct builtin type. C11's\n * char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit\n * code unit of a Unicode code point, not a \"character\".\n *\n * For now, Char16.h only supports C++ because we don't want mix different C\n * and C++ definitions of char16_t in the same code base.\n */\n\n#ifdef _MSC_VER\n   /*\n    * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h\n    * typedefs char16_t as an unsigned short. We would like to alias char16_t\n    * to Windows's 16-bit wchar_t so we can declare UTF-16 literals as constant\n    * expressions (and pass char16_t pointers to Windows APIs). We #define our\n    * char16_t as a macro to override yval.h's typedef of the same name.\n    */\n#  define MOZ_UTF16_HELPER(s) L##s\n#  include <yvals.h>\n#  define char16_t wchar_t\n#elif defined(__cplusplus) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))\n   /* C++11 has a builtin char16_t type. */\n#  define MOZ_UTF16_HELPER(s) u##s\n#else\n#  error \"Char16.h requires C++11 (or something like it) for UTF-16 support.\"\n#endif\n\n/*\n * Macro arguments used in concatenation or stringification won't be expanded.\n * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to\n * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper\n * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro\n * argument to expand. See \"3.10.6 Separate Expansion of Macro Arguments\" of the\n * CPP manual for a more accurate and precise explanation.\n */\n#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)\n\nstatic_assert(sizeof(char16_t) == 2, \"Is char16_t type 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16('A')) == 2, \"Is char literal 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16(\"\")[0]) == 2, \"Is string char 16 bits?\");\n\n#endif /* mozilla_Char16_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/CheckedInt.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Provides checked integers, detecting integer overflow and divide-by-0. */\n\n#ifndef mozilla_CheckedInt_h\n#define mozilla_CheckedInt_h\n\n// Enable relying of Mozilla's MFBT for possibly-available C++11 features\n#define MOZ_CHECKEDINT_USE_MFBT\n\n#include <stdint.h>\n\n#ifdef MOZ_CHECKEDINT_USE_MFBT\n#  include \"mozilla/Assertions.h\"\n#else\n#  include <cassert>\n#  define MOZ_ASSERT(cond, reason) assert((cond) && reason)\n#  define MOZ_DELETE\n#endif\n\n#include <climits>\n#include <cstddef>\n\nnamespace mozilla {\n\ntemplate<typename T> class CheckedInt;\n\nnamespace detail {\n\n/*\n * Step 1: manually record supported types\n *\n * What's nontrivial here is that there are different families of integer\n * types: basic integer types and stdint types. It is merrily undefined which\n * types from one family may be just typedefs for a type from another family.\n *\n * For example, on GCC 4.6, aside from the basic integer types, the only other\n * type that isn't just a typedef for some of them, is int8_t.\n */\n\nstruct UnsupportedType {};\n\ntemplate<typename IntegerType>\nstruct IsSupportedPass2\n{\n    static const bool value = false;\n};\n\ntemplate<typename IntegerType>\nstruct IsSupported\n{\n    static const bool value = IsSupportedPass2<IntegerType>::value;\n};\n\ntemplate<>\nstruct IsSupported<int8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int64_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint64_t>\n{ static const bool value = true; };\n\n\ntemplate<>\nstruct IsSupportedPass2<char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<signed char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long long>\n{ static const bool value = true; };\n\n/*\n * Step 2: some integer-traits kind of stuff.\n */\n\ntemplate<size_t Size, bool Signedness>\nstruct StdintTypeForSizeAndSignedness\n{};\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, true>\n{ typedef int8_t   Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, false>\n{ typedef uint8_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, true>\n{ typedef int16_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, false>\n{ typedef uint16_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, true>\n{ typedef int32_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, false>\n{ typedef uint32_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, true>\n{ typedef int64_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, false>\n{ typedef uint64_t Type; };\n\ntemplate<typename IntegerType>\nstruct UnsignedType\n{\n    typedef typename StdintTypeForSizeAndSignedness<sizeof(IntegerType),\n                                                    false>::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct IsSigned\n{\n    static const bool value = IntegerType(-1) <= IntegerType(0);\n};\n\ntemplate<typename IntegerType, size_t Size = sizeof(IntegerType)>\nstruct TwiceBiggerType\n{\n    typedef typename StdintTypeForSizeAndSignedness<\n                       sizeof(IntegerType) * 2,\n                       IsSigned<IntegerType>::value\n                     >::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct TwiceBiggerType<IntegerType, 8>\n{\n    typedef UnsupportedType Type;\n};\n\ntemplate<typename IntegerType>\nstruct PositionOfSignBit\n{\n    static const size_t value = CHAR_BIT * sizeof(IntegerType) - 1;\n};\n\ntemplate<typename IntegerType>\nstruct MinValue\n{\n  private:\n    typedef typename UnsignedType<IntegerType>::Type UnsignedIntegerType;\n    static const size_t PosOfSignBit = PositionOfSignBit<IntegerType>::value;\n\n  public:\n    // Bitwise ops may return a larger type, that's why we cast explicitly.\n    // In C++, left bit shifts on signed values is undefined by the standard\n    // unless the shifted value is representable.\n    // Notice that signed-to-unsigned conversions are always well-defined in\n    // the standard as the value congruent to 2**n, as expected. By contrast,\n    // unsigned-to-signed is only well-defined if the value is representable.\n    static const IntegerType value =\n        IsSigned<IntegerType>::value\n        ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit)\n        : IntegerType(0);\n};\n\ntemplate<typename IntegerType>\nstruct MaxValue\n{\n    // Tricksy, but covered by the unit test.\n    // Relies heavily on the type of MinValue<IntegerType>::value\n    // being IntegerType.\n    static const IntegerType value = ~MinValue<IntegerType>::value;\n};\n\n/*\n * Step 3: Implement the actual validity checks.\n *\n * Ideas taken from IntegerLib, code different.\n */\n\ntemplate<typename T>\ninline bool\nHasSignBit(T x)\n{\n  // In C++, right bit shifts on negative values is undefined by the standard.\n  // Notice that signed-to-unsigned conversions are always well-defined in the\n  // standard, as the value congruent modulo 2**n as expected. By contrast,\n  // unsigned-to-signed is only well-defined if the value is representable.\n  return bool(typename UnsignedType<T>::Type(x)\n                >> PositionOfSignBit<T>::value);\n}\n\n// Bitwise ops may return a larger type, so it's good to use this inline\n// helper guaranteeing that the result is really of type T.\ntemplate<typename T>\ninline T\nBinaryComplement(T x)\n{\n  return ~x;\n}\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value>\nstruct DoesRangeContainRange\n{\n};\n\ntemplate<typename T, typename U, bool Signedness>\nstruct DoesRangeContainRange<T, U, Signedness, Signedness>\n{\n    static const bool value = sizeof(T) >= sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, true, false>\n{\n    static const bool value = sizeof(T) > sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, false, true>\n{\n    static const bool value = false;\n};\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value,\n         bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>\nstruct IsInRangeImpl {};\n\ntemplate<typename T, typename U, bool IsTSigned, bool IsUSigned>\nstruct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>\n{\n    static bool run(U)\n    {\n       return true;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, true, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value && x >= MinValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, false, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, false, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) > sizeof(U) || x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, true, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) >= sizeof(U)\n             ? x >= 0\n             : x >= 0 && x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\ninline bool\nIsInRange(U x)\n{\n  return IsInRangeImpl<T, U>::run(x);\n}\n\ntemplate<typename T>\ninline bool\nIsAddValid(T x, T y)\n{\n  // Addition is valid if the sign of x+y is equal to either that of x or that\n  // of y. Since the value of x+y is undefined if we have a signed type, we\n  // compute it using the unsigned type of the same size.\n  // Beware! These bitwise operations can return a larger integer type,\n  // if T was a small type like int8_t, so we explicitly cast to T.\n\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux + uy;\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y))))\n         : BinaryComplement(x) >= y;\n}\n\ntemplate<typename T>\ninline bool\nIsSubValid(T x, T y)\n{\n  // Subtraction is valid if either x and y have same sign, or x-y and x have\n  // same sign. Since the value of x-y is undefined if we have a signed type,\n  // we compute it using the unsigned type of the same size.\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux - uy;\n\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y))))\n         : x >= y;\n}\n\ntemplate<typename T,\n         bool IsTSigned = IsSigned<T>::value,\n         bool TwiceBiggerTypeIsSupported =\n           IsSupported<typename TwiceBiggerType<T>::Type>::value>\nstruct IsMulValidImpl {};\n\ntemplate<typename T, bool IsTSigned>\nstruct IsMulValidImpl<T, IsTSigned, true>\n{\n    static bool run(T x, T y)\n    {\n      typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;\n      TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y);\n      return IsInRange<T>(product);\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, true, false>\n{\n    static bool run(T x, T y)\n    {\n      const T max = MaxValue<T>::value;\n      const T min = MinValue<T>::value;\n\n      if (x == 0 || y == 0)\n        return true;\n\n      if (x > 0) {\n        return y > 0\n               ? x <= max / y\n               : y >= min / x;\n      }\n\n      // If we reach this point, we know that x < 0.\n      return y > 0\n             ? x >= min / y\n             : y >= max / x;\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, false, false>\n{\n    static bool run(T x, T y)\n    {\n      return y == 0 ||  x <= MaxValue<T>::value / y;\n    }\n};\n\ntemplate<typename T>\ninline bool\nIsMulValid(T x, T y)\n{\n  return IsMulValidImpl<T>::run(x, y);\n}\n\ntemplate<typename T>\ninline bool\nIsDivValid(T x, T y)\n{\n  // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max.\n  return y != 0 &&\n         !(IsSigned<T>::value && x == MinValue<T>::value && y == T(-1));\n}\n\ntemplate<typename T, bool IsTSigned = IsSigned<T>::value>\nstruct IsModValidImpl;\n\ntemplate<typename T>\ninline bool\nIsModValid(T x, T y)\n{\n  return IsModValidImpl<T>::run(x, y);\n}\n\n/*\n * Mod is pretty simple.\n * For now, let's just use the ANSI C definition:\n * If x or y are negative, the results are implementation defined.\n *   Consider these invalid.\n * Undefined for y=0.\n * The result will never exceed either x or y.\n *\n * Checking that x>=0 is a warning when T is unsigned.\n */\n\ntemplate<typename T>\nstruct IsModValidImpl<T, false> {\n  static inline bool run(T x, T y) {\n    return y >= 1;\n  }\n};\n\ntemplate<typename T>\nstruct IsModValidImpl<T, true> {\n  static inline bool run(T x, T y) {\n    if (x < 0)\n      return false;\n\n    return y >= 1;\n  }\n};\n\ntemplate<typename T, bool IsSigned = IsSigned<T>::value>\nstruct NegateImpl;\n\ntemplate<typename T>\nstruct NegateImpl<T, false>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Handle negation separately for signed/unsigned, for simpler code and to\n      // avoid an MSVC warning negating an unsigned value.\n      return CheckedInt<T>(0, val.isValid() && val.mValue == 0);\n    }\n};\n\ntemplate<typename T>\nstruct NegateImpl<T, true>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Watch out for the min-value, which (with twos-complement) can't be\n      // negated as -min-value is then (max-value + 1).\n      if (!val.isValid() || val.mValue == MinValue<T>::value)\n        return CheckedInt<T>(val.mValue, false);\n      return CheckedInt<T>(-val.mValue, true);\n    }\n};\n\n} // namespace detail\n\n\n/*\n * Step 4: Now define the CheckedInt class.\n */\n\n/**\n * @class CheckedInt\n * @brief Integer wrapper class checking for integer overflow and other errors\n * @param T the integer type to wrap. Can be any type among the following:\n *            - any basic integer type such as |int|\n *            - any stdint type such as |int8_t|\n *\n * This class implements guarded integer arithmetic. Do a computation, check\n * that isValid() returns true, you then have a guarantee that no problem, such\n * as integer overflow, happened during this computation, and you can call\n * value() to get the plain integer value.\n *\n * The arithmetic operators in this class are guaranteed not to raise a signal\n * (e.g. in case of a division by zero).\n *\n * For example, suppose that you want to implement a function that computes\n * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by\n * zero or integer overflow). You could code it as follows:\n   @code\n   bool computeXPlusYOverZ(int x, int y, int z, int *result)\n   {\n       CheckedInt<int> checkedResult = (CheckedInt<int>(x) + y) / z;\n       if (checkedResult.isValid()) {\n           *result = checkedResult.value();\n           return true;\n       } else {\n           return false;\n       }\n   }\n   @endcode\n *\n * Implicit conversion from plain integers to checked integers is allowed. The\n * plain integer is checked to be in range before being casted to the\n * destination type. This means that the following lines all compile, and the\n * resulting CheckedInts are correctly detected as valid or invalid:\n * @code\n   // 1 is of type int, is found to be in range for uint8_t, x is valid\n   CheckedInt<uint8_t> x(1);\n   // -1 is of type int, is found not to be in range for uint8_t, x is invalid\n   CheckedInt<uint8_t> x(-1);\n   // -1 is of type int, is found to be in range for int8_t, x is valid\n   CheckedInt<int8_t> x(-1);\n   // 1000 is of type int16_t, is found not to be in range for int8_t,\n   // x is invalid\n   CheckedInt<int8_t> x(int16_t(1000));\n   // 3123456789 is of type uint32_t, is found not to be in range for int32_t,\n   // x is invalid\n   CheckedInt<int32_t> x(uint32_t(3123456789));\n * @endcode\n * Implicit conversion from\n * checked integers to plain integers is not allowed. As shown in the\n * above example, to get the value of a checked integer as a normal integer,\n * call value().\n *\n * Arithmetic operations between checked and plain integers is allowed; the\n * result type is the type of the checked integer.\n *\n * Checked integers of different types cannot be used in the same arithmetic\n * expression.\n *\n * There are convenience typedefs for all stdint types, of the following form\n * (these are just 2 examples):\n   @code\n   typedef CheckedInt<int32_t> CheckedInt32;\n   typedef CheckedInt<uint16_t> CheckedUint16;\n   @endcode\n */\ntemplate<typename T>\nclass CheckedInt\n{\n  protected:\n    T mValue;\n    bool mIsValid;\n\n    template<typename U>\n    CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid)\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    friend struct detail::NegateImpl<T>;\n\n  public:\n    /**\n     * Constructs a checked integer with given @a value. The checked integer is\n     * initialized as valid or invalid depending on whether the @a value\n     * is in range.\n     *\n     * This constructor is not explicit. Instead, the type of its argument is a\n     * separate template parameter, ensuring that no conversion is performed\n     * before this constructor is actually called. As explained in the above\n     * documentation for class CheckedInt, this constructor checks that its\n     * argument is valid.\n     */\n    template<typename U>\n    CheckedInt(U value)\n      : mValue(T(value)),\n        mIsValid(detail::IsInRange<T>(value))\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    template<typename U>\n    friend class CheckedInt;\n\n    template<typename U>\n    CheckedInt<U> toChecked() const\n    {\n      CheckedInt<U> ret(mValue);\n      ret.mIsValid = ret.mIsValid && mIsValid;\n      return ret;\n    }\n\n    /** Constructs a valid checked integer with initial value 0 */\n    CheckedInt() : mValue(0), mIsValid(true)\n    {\n      static_assert(detail::IsSupported<T>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    /** @returns the actual value */\n    T value() const\n    {\n      MOZ_ASSERT(mIsValid, \"Invalid checked integer (division by zero or integer overflow)\");\n      return mValue;\n    }\n\n    /**\n     * @returns true if the checked integer is valid, i.e. is not the result\n     * of an invalid operation or of an operation involving an invalid checked\n     * integer\n     */\n    bool isValid() const\n    {\n      return mIsValid;\n    }\n\n    template<typename U>\n    friend CheckedInt<U> operator +(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator +=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator -(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator -=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator *(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator *=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator /(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator /=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator %(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator %=(U rhs);\n\n    CheckedInt operator -() const\n    {\n      return detail::NegateImpl<T>::negate(*this);\n    }\n\n    /**\n     * @returns true if the left and right hand sides are valid\n     * and have the same value.\n     *\n     * Note that these semantics are the reason why we don't offer\n     * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)\n     * but that would mean that whenever a or b is invalid, a!=b\n     * is always true, which would be very confusing.\n     *\n     * For similar reasons, operators <, >, <=, >= would be very tricky to\n     * specify, so we just avoid offering them.\n     *\n     * Notice that these == semantics are made more reasonable by these facts:\n     *  1. a==b implies equality at the raw data level\n     *     (the converse is false, as a==b is never true among invalids)\n     *  2. This is similar to the behavior of IEEE floats, where a==b\n     *     means that a and b have the same value *and* neither is NaN.\n     */\n    bool operator ==(const CheckedInt& other) const\n    {\n      return mIsValid && other.mIsValid && mValue == other.mValue;\n    }\n\n    /** prefix ++ */\n    CheckedInt& operator++()\n    {\n      *this += 1;\n      return *this;\n    }\n\n    /** postfix ++ */\n    CheckedInt operator++(int)\n    {\n      CheckedInt tmp = *this;\n      *this += 1;\n      return tmp;\n    }\n\n    /** prefix -- */\n    CheckedInt& operator--()\n    {\n      *this -= 1;\n      return *this;\n    }\n\n    /** postfix -- */\n    CheckedInt operator--(int)\n    {\n      CheckedInt tmp = *this;\n      *this -= 1;\n      return tmp;\n    }\n\n  private:\n    /**\n     * The !=, <, <=, >, >= operators are disabled:\n     * see the comment on operator==.\n     */\n    template<typename U>\n    bool operator !=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >=(U other) const MOZ_DELETE;\n};\n\n#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                \\\ntemplate<typename T>                                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs,            \\\n                                 const CheckedInt<T> &rhs)            \\\n{                                                                     \\\n  if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue))               \\\n    return CheckedInt<T>(0, false);                                   \\\n                                                                      \\\n  return CheckedInt<T>(lhs.mValue OP rhs.mValue,                      \\\n                       lhs.mIsValid && rhs.mIsValid);                 \\\n}\n\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)\n\n#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR\n\n// Implement castToCheckedInt<T>(x), making sure that\n//  - it allows x to be either a CheckedInt<T> or any integer type\n//    that can be casted to T\n//  - if x is already a CheckedInt<T>, we just return a reference to it,\n//    instead of copying it (optimization)\n\nnamespace detail {\n\ntemplate<typename T, typename U>\nstruct CastToCheckedIntImpl\n{\n    typedef CheckedInt<T> ReturnType;\n    static CheckedInt<T> run(U u) { return u; }\n};\n\ntemplate<typename T>\nstruct CastToCheckedIntImpl<T, CheckedInt<T> >\n{\n    typedef const CheckedInt<T>& ReturnType;\n    static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }\n};\n\n} // namespace detail\n\ntemplate<typename T, typename U>\ninline typename detail::CastToCheckedIntImpl<T, U>::ReturnType\ncastToCheckedInt(U u)\n{\n  static_assert(detail::IsSupported<T>::value &&\n                detail::IsSupported<U>::value,\n                \"This type is not supported by CheckedInt\");\n  return detail::CastToCheckedIntImpl<T, U>::run(u);\n}\n\n#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)  \\\ntemplate<typename T>                                              \\\ntemplate<typename U>                                              \\\nCheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U rhs)         \\\n{                                                                 \\\n  *this = *this OP castToCheckedInt<T>(rhs);                      \\\n  return *this;                                                   \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs, U rhs) \\\n{                                                                 \\\n  return lhs OP castToCheckedInt<T>(rhs);                         \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(U lhs, const CheckedInt<T> &rhs) \\\n{                                                                 \\\n  return castToCheckedInt<T>(lhs) OP rhs;                         \\\n}\n\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)\n\n#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(const CheckedInt<T> &lhs, U rhs)\n{\n  return lhs == castToCheckedInt<T>(rhs);\n}\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(U  lhs, const CheckedInt<T> &rhs)\n{\n  return castToCheckedInt<T>(lhs) == rhs;\n}\n\n// Convenience typedefs.\ntypedef CheckedInt<int8_t>   CheckedInt8;\ntypedef CheckedInt<uint8_t>  CheckedUint8;\ntypedef CheckedInt<int16_t>  CheckedInt16;\ntypedef CheckedInt<uint16_t> CheckedUint16;\ntypedef CheckedInt<int32_t>  CheckedInt32;\ntypedef CheckedInt<uint32_t> CheckedUint32;\ntypedef CheckedInt<int64_t>  CheckedInt64;\ntypedef CheckedInt<uint64_t> CheckedUint64;\n\n} // namespace mozilla\n\n#endif /* mozilla_CheckedInt_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Compiler.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various compiler checks. */\n\n#ifndef mozilla_Compiler_h\n#define mozilla_Compiler_h\n\n#if !defined(__clang__) && defined(__GNUC__)\n\n#define MOZ_IS_GCC 1\n   /*\n    * This macro should simplify gcc version checking. For example, to check\n    * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`.\n    */\n#  define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel)          \\\n     ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \\\n      >= ((major) * 10000 + (minor) * 100 + (patchlevel)))\n#if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0)\n#  error \"mfbt (and Gecko) require at least gcc 4.4 to build.\"\n#endif\n\n#else\n\n#define MOZ_IS_GCC 0\n\n#endif\n\n#endif /* mozilla_Compiler_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Constants.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt math constants. */\n\n#ifndef mozilla_Constants_h\n#define mozilla_Constants_h\n\n#ifndef M_PI\n#  define M_PI 3.14159265358979323846\n#endif\n\n#endif /* mozilla_Constants_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/DebugOnly.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides DebugOnly, a type for variables used only in debug builds (i.e. by\n * assertions).\n */\n\n#ifndef mozilla_DebugOnly_h\n#define mozilla_DebugOnly_h\n\nnamespace mozilla {\n\n/**\n * DebugOnly contains a value of type T, but only in debug builds.  In release\n * builds, it does not contain a value.  This helper is intended to be used with\n * MOZ_ASSERT()-style macros, allowing one to write:\n *\n *   DebugOnly<bool> check = func();\n *   MOZ_ASSERT(check);\n *\n * more concisely than declaring |check| conditional on #ifdef DEBUG, but also\n * without allocating storage space for |check| in release builds.\n *\n * DebugOnly instances can only be coerced to T in debug builds.  In release\n * builds they don't have a value, so type coercion is not well defined.\n */\ntemplate<typename T>\nclass DebugOnly\n{\n  public:\n#ifdef DEBUG\n    T value;\n\n    DebugOnly() { }\n    DebugOnly(const T& other) : value(other) { }\n    DebugOnly(const DebugOnly& other) : value(other.value) { }\n    DebugOnly& operator=(const T& rhs) {\n      value = rhs;\n      return *this;\n    }\n    void operator++(int) {\n      value++;\n    }\n    void operator--(int) {\n      value--;\n    }\n\n    T* operator&() { return &value; }\n\n    operator T&() { return value; }\n    operator const T&() const { return value; }\n\n    T& operator->() { return value; }\n\n#else\n    DebugOnly() { }\n    DebugOnly(const T&) { }\n    DebugOnly(const DebugOnly&) { }\n    DebugOnly& operator=(const T&) { return *this; }\n    void operator++(int) { }\n    void operator--(int) { }\n#endif\n\n    /*\n     * DebugOnly must always have a destructor or else it will\n     * generate \"unused variable\" warnings, exactly what it's intended\n     * to avoid!\n     */\n    ~DebugOnly() {}\n};\n\n}\n\n#endif /* mozilla_DebugOnly_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Decimal.h",
    "content": "/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * Imported from:\n * http://src.chromium.org/viewvc/blink/trunk/Source/core/platform/Decimal.h\n * Check hg log for the svn rev of the last update from Blink core.\n */\n\n#ifndef Decimal_h\n#define Decimal_h\n\n#include \"mozilla/Assertions.h\"\n#include <stdint.h>\n#include \"mozilla/Types.h\"\n\n#include <string>\n\n#ifndef ASSERT\n#define DEFINED_ASSERT_FOR_DECIMAL_H 1\n#define ASSERT MOZ_ASSERT\n#endif\n\n// To use WTF_MAKE_FAST_ALLOCATED we'd need:\n// http://src.chromium.org/viewvc/blink/trunk/Source/wtf/FastMalloc.h\n// Since we don't allocate Decimal objects, no need.\n#define WTF_MAKE_FAST_ALLOCATED \\\n  void ignore_this_dummy_method() MOZ_DELETE\n\nnamespace WebCore {\n\nnamespace DecimalPrivate {\nclass SpecialValueHandler;\n}\n\n// This class represents decimal base floating point number.\n//\n// FIXME: Once all C++ compiler support decimal type, we should replace this\n// class to compiler supported one. See below URI for current status of decimal\n// type for C++: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1977.html\nclass Decimal {\n    WTF_MAKE_FAST_ALLOCATED;\npublic:\n    enum Sign {\n        Positive,\n        Negative,\n    };\n\n    // You should not use EncodedData other than unit testing.\n    class EncodedData {\n        // For accessing FormatClass.\n        friend class Decimal;\n        friend class DecimalPrivate::SpecialValueHandler;\n    public:\n        EncodedData(Sign, int exponent, uint64_t coefficient);\n\n        bool operator==(const EncodedData&) const;\n        bool operator!=(const EncodedData& another) const { return !operator==(another); }\n\n        uint64_t coefficient() const { return m_coefficient; }\n        int countDigits() const;\n        int exponent() const { return m_exponent; }\n        bool isFinite() const { return !isSpecial(); }\n        bool isInfinity() const { return m_formatClass == ClassInfinity; }\n        bool isNaN() const { return m_formatClass == ClassNaN; }\n        bool isSpecial() const { return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; }\n        bool isZero() const { return m_formatClass == ClassZero; }\n        Sign sign() const { return m_sign; }\n        void setSign(Sign sign) { m_sign = sign; }\n\n    private:\n        enum FormatClass {\n            ClassInfinity,\n            ClassNormal,\n            ClassNaN,\n            ClassZero,\n        };\n\n        EncodedData(Sign, FormatClass);\n        FormatClass formatClass() const { return m_formatClass; }\n\n        uint64_t m_coefficient;\n        int16_t m_exponent;\n        FormatClass m_formatClass;\n        Sign m_sign;\n    };\n\n    MFBT_API Decimal(int32_t = 0);\n    MFBT_API Decimal(Sign, int exponent, uint64_t coefficient);\n    MFBT_API Decimal(const Decimal&);\n\n    MFBT_API Decimal& operator=(const Decimal&);\n    MFBT_API Decimal& operator+=(const Decimal&);\n    MFBT_API Decimal& operator-=(const Decimal&);\n    MFBT_API Decimal& operator*=(const Decimal&);\n    MFBT_API Decimal& operator/=(const Decimal&);\n\n    MFBT_API Decimal operator-() const;\n\n    MFBT_API bool operator==(const Decimal&) const;\n    MFBT_API bool operator!=(const Decimal&) const;\n    MFBT_API bool operator<(const Decimal&) const;\n    MFBT_API bool operator<=(const Decimal&) const;\n    MFBT_API bool operator>(const Decimal&) const;\n    MFBT_API bool operator>=(const Decimal&) const;\n\n    MFBT_API Decimal operator+(const Decimal&) const;\n    MFBT_API Decimal operator-(const Decimal&) const;\n    MFBT_API Decimal operator*(const Decimal&) const;\n    MFBT_API Decimal operator/(const Decimal&) const;\n\n    int exponent() const\n    {\n        ASSERT(isFinite());\n        return m_data.exponent();\n    }\n\n    bool isFinite() const { return m_data.isFinite(); }\n    bool isInfinity() const { return m_data.isInfinity(); }\n    bool isNaN() const { return m_data.isNaN(); }\n    bool isNegative() const { return sign() == Negative; }\n    bool isPositive() const { return sign() == Positive; }\n    bool isSpecial() const { return m_data.isSpecial(); }\n    bool isZero() const { return m_data.isZero(); }\n\n    MFBT_API Decimal abs() const;\n    MFBT_API Decimal ceiling() const;\n    MFBT_API Decimal floor() const;\n    MFBT_API Decimal remainder(const Decimal&) const;\n    MFBT_API Decimal round() const;\n\n    MFBT_API double toDouble() const;\n    // Note: toString method supports infinity and nan but fromString not.\n    MFBT_API std::string toString() const;\n    MFBT_API bool toString(char* strBuf, size_t bufLength) const;\n\n    static MFBT_API Decimal fromDouble(double);\n    // fromString supports following syntax EBNF:\n    //  number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?\n    //          | sign? '.' digit+ (exponent-marker sign? digit+)?\n    //  sign ::= '+' | '-'\n    //  exponent-marker ::= 'e' | 'E'\n    //  digit ::= '0' | '1' | ... | '9'\n    // Note: fromString doesn't support \"infinity\" and \"nan\".\n    static MFBT_API Decimal fromString(const std::string& aValue);\n    static MFBT_API Decimal infinity(Sign);\n    static MFBT_API Decimal nan();\n    static MFBT_API Decimal zero(Sign);\n\n    // You should not use below methods. We expose them for unit testing.\n    MFBT_API explicit Decimal(const EncodedData&);\n    const EncodedData& value() const { return m_data; }\n\nprivate:\n    struct AlignedOperands {\n        uint64_t lhsCoefficient;\n        uint64_t rhsCoefficient;\n        int exponent;\n    };\n\n    MFBT_API Decimal(double);\n    MFBT_API Decimal compareTo(const Decimal&) const;\n\n    static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);\n    static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; }\n\n    Sign sign() const { return m_data.sign(); }\n\n    EncodedData m_data;\n};\n\n} // namespace WebCore\n\nnamespace mozilla {\n  typedef WebCore::Decimal Decimal;\n}\n\n#undef WTF_MAKE_FAST_ALLOCATED\n\n#ifdef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef ASSERT\n#endif\n\n#endif // Decimal_h\n\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Endian.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Functions for reading and writing integers in various endiannesses. */\n\n/*\n * The classes LittleEndian and BigEndian expose static methods for\n * reading and writing 16-, 32-, and 64-bit signed and unsigned integers\n * in their respective endianness.  The naming scheme is:\n *\n * {Little,Big}Endian::{read,write}{Uint,Int}<bitsize>\n *\n * For instance, LittleEndian::readInt32 will read a 32-bit signed\n * integer from memory in little endian format.  Similarly,\n * BigEndian::writeUint16 will write a 16-bit unsigned integer to memory\n * in big-endian format.\n *\n * The class NativeEndian exposes methods for conversion of existing\n * data to and from the native endianness.  These methods are intended\n * for cases where data needs to be transferred, serialized, etc.\n * swap{To,From}{Little,Big}Endian byteswap a single value if necessary.\n * Bulk conversion functions are also provided which optimize the\n * no-conversion-needed case:\n *\n * - copyAndSwap{To,From}{Little,Big}Endian;\n * - swap{To,From}{Little,Big}EndianInPlace.\n *\n * The *From* variants are intended to be used for reading data and the\n * *To* variants for writing data.\n *\n * Methods on NativeEndian work with integer data of any type.\n * Floating-point data is not supported.\n *\n * For clarity in networking code, \"Network\" may be used as a synonym\n * for \"Big\" in any of the above methods or class names.\n *\n * As an example, reading a file format header whose fields are stored\n * in big-endian format might look like:\n *\n * class ExampleHeader\n * {\n *   private:\n *     uint32_t magic;\n *     uint32_t length;\n *     uint32_t totalRecords;\n *     uint64_t checksum;\n *\n *   public:\n *     ExampleHeader(const void* data) {\n *       const uint8_t* ptr = static_cast<const uint8_t*>(data);\n *       magic = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       length = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       totalRecords = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       checksum = BigEndian::readUint64(ptr);\n *     }\n *     ...\n * };\n */\n\n#ifndef mozilla_Endian_h\n#define mozilla_Endian_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n#include <string.h>\n\n#if defined(_MSC_VER) && _MSC_VER >= 1300\n#  include <stdlib.h>\n#  pragma intrinsic(_byteswap_ushort)\n#  pragma intrinsic(_byteswap_ulong)\n#  pragma intrinsic(_byteswap_uint64)\n#endif\n\n#if defined(_WIN64)\n#  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(_WIN32)\n#  if defined(_M_IX86)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(__APPLE__)\n#  if __LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  endif\n#elif defined(__GNUC__) && \\\n      defined(__BYTE_ORDER__) && \\\n      defined(__ORDER_LITTLE_ENDIAN__) && \\\n      defined(__ORDER_BIG_ENDIAN__)\n   /*\n    * Some versions of GCC provide architecture-independent macros for\n    * this.  Yes, there are more than two values for __BYTE_ORDER__.\n    */\n#  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  else\n#    error \"Can't handle mixed-endian architectures\"\n#  endif\n/*\n * We can't include useful headers like <endian.h> or <sys/isa_defs.h>\n * here because they're not present on all platforms.  Instead we have\n * this big conditional that ideally will catch all the interesting\n * cases.\n */\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(__ARMEB__) || \\\n      defined(__s390__) || \\\n      (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \\\n      (defined(__ia64) && defined(__BIG_ENDIAN__))\n#  define MOZ_BIG_ENDIAN 1\n#elif defined(__i386) || defined(__i386__) || \\\n      defined(__x86_64) || defined(__x86_64__) || \\\n      defined(_MIPSEL) || defined(__ARMEL__) || \\\n      defined(__alpha__) || \\\n      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \\\n      (defined(__ia64) && !defined(__BIG_ENDIAN__))\n#  define MOZ_LITTLE_ENDIAN 1\n#endif\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_LITTLE_ENDIAN 0\n#elif MOZ_LITTLE_ENDIAN\n#  define MOZ_BIG_ENDIAN 0\n#else\n#  error \"Cannot determine endianness\"\n#endif\n\n#if defined(__clang__)\n#  if __has_builtin(__builtin_bswap16)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(__GNUC__)\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(_MSC_VER)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n/*\n * We need wrappers here because free functions with default template\n * arguments and/or partial specialization of function templates are not\n * supported by all the compilers we use.\n */\ntemplate<typename T, size_t Size = sizeof(T)>\nstruct Swapper;\n\ntemplate<typename T>\nstruct Swapper<T, 2>\n{\n  static T swap(T value)\n  {\n#if defined(MOZ_HAVE_BUILTIN_BYTESWAP16)\n    return MOZ_HAVE_BUILTIN_BYTESWAP16(value);\n#else\n    return T(((value & 0x00ff) << 8) | ((value & 0xff00) >> 8));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 4>\n{\n  static T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap32(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_ulong(value));\n#else\n    return T(((value & 0x000000ffU) << 24) |\n             ((value & 0x0000ff00U) << 8) |\n             ((value & 0x00ff0000U) >> 8) |\n             ((value & 0xff000000U) >> 24));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 8>\n{\n  static inline T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap64(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_uint64(value));\n#else\n    return T(((value & 0x00000000000000ffULL) << 56) |\n             ((value & 0x000000000000ff00ULL) << 40) |\n             ((value & 0x0000000000ff0000ULL) << 24) |\n             ((value & 0x00000000ff000000ULL) << 8) |\n             ((value & 0x000000ff00000000ULL) >> 8) |\n             ((value & 0x0000ff0000000000ULL) >> 24) |\n             ((value & 0x00ff000000000000ULL) >> 40) |\n             ((value & 0xff00000000000000ULL) >> 56));\n#endif\n  }\n};\n\nenum Endianness { Little, Big };\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_NATIVE_ENDIANNESS detail::Big\n#else\n#  define MOZ_NATIVE_ENDIANNESS detail::Little\n#endif\n\nclass EndianUtils\n{\n    /**\n     * Assert that the memory regions [dest, dest+count) and [src, src+count]\n     * do not overlap.  count is given in bytes.\n     */\n    static void assertNoOverlap(const void* dest, const void* src, size_t count)\n    {\n      DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(dest);\n      DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(src);\n      MOZ_ASSERT((byteDestPtr < byteSrcPtr &&\n                  byteDestPtr + count <= byteSrcPtr) ||\n                 (byteSrcPtr < byteDestPtr &&\n                  byteSrcPtr + count <= byteDestPtr));\n    }\n\n    template<typename T>\n    static void assertAligned(T* ptr)\n    {\n      MOZ_ASSERT((uintptr_t(ptr) % sizeof(T)) == 0, \"Unaligned pointer!\");\n    }\n\n  protected:\n    /**\n     * Return |value| converted from SourceEndian encoding to DestEndian\n     * encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline T maybeSwap(T value)\n    {\n      if (SourceEndian == DestEndian)\n        return value;\n\n      return Swapper<T>::swap(value);\n    }\n\n    /**\n     * Convert |count| elements at |ptr| from SourceEndian encoding to\n     * DestEndian encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline void maybeSwapInPlace(T* ptr, size_t count)\n    {\n      assertAligned(ptr);\n\n      if (SourceEndian == DestEndian)\n        return;\n\n      for (size_t i = 0; i < count; i++)\n        ptr[i] = Swapper<T>::swap(ptr[i]);\n    }\n\n    /**\n     * Write |count| elements to the unaligned address |dest| in DestEndian\n     * format, using elements found at |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapTo(void* dest, const T* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(src);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      uint8_t* byteDestPtr = static_cast<uint8_t*>(dest);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        u.val = maybeSwap<SourceEndian, DestEndian>(src[i]);\n        memcpy(byteDestPtr, u.buffer, sizeof(T));\n        byteDestPtr += sizeof(T);\n      }\n    }\n\n    /**\n     * Write |count| elements to |dest| in DestEndian format, using elements\n     * found at the unaligned address |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapFrom(T* dest, const void* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(dest);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      const uint8_t* byteSrcPtr = static_cast<const uint8_t*>(src);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        memcpy(u.buffer, byteSrcPtr, sizeof(T));\n        dest[i] = maybeSwap<SourceEndian, DestEndian>(u.val);\n        byteSrcPtr += sizeof(T);\n      }\n    }\n};\n\ntemplate<Endianness ThisEndian>\nclass Endian : private EndianUtils\n{\n  protected:\n    /** Read a uint16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* p) {\n      return read<uint16_t>(p);\n    }\n\n    /** Read a uint32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read a uint64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* p) {\n      return read<uint64_t>(p);\n    }\n\n    /** Read an int16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* p) {\n      return read<int16_t>(p);\n    }\n\n    /** Read an int32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read an int64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* p) {\n      return read<int64_t>(p);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint16(void* p, uint16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint32(void* p, uint32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint64(void* p, uint64_t val) {\n      write(p, val);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt16(void* p, int16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt32(void* p, int32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt64(void* p, int64_t val) {\n      write(p, val);\n    }\n\n    /*\n     * Converts a value of type T to little-endian format.\n     *\n     * This function is intended for cases where you have data in your\n     * native-endian format and you need it to appear in little-endian\n     * format for transmission.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T value) {\n      return maybeSwap<ThisEndian, Little>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToLittleEndian(void* dest, const T* src,\n                                          size_t count) {\n      copyAndSwapTo<ThisEndian, Little>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Little>(p, count);\n    }\n\n    /*\n     * Converts a value of type T to big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T value) {\n      return maybeSwap<ThisEndian, Big>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToBigEndian(void* dest, const T* src, size_t count) {\n      copyAndSwapTo<ThisEndian, Big>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Big>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T value) {\n      return swapToBigEndian(value);\n    }\n    template<typename T>\n    static void\n    copyAndSwapToNetworkOrder(void* dest, const T* src, size_t count) {\n      copyAndSwapToBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void\n    swapToNetworkOrderInPlace(T* p, size_t count) {\n      swapToBigEndianInPlace(p, count);\n    }\n\n    /*\n     * Converts a value of type T from little-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T value) {\n      return maybeSwap<Little, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromLittleEndian(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFrom<Little, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Little, ThisEndian>(p, count);\n    }\n\n    /*\n     * Converts a value of type T from big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T value) {\n      return maybeSwap<Big, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromBigEndian(T* dest, const void* src,\n                                         size_t count) {\n      copyAndSwapFrom<Big, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Big, ThisEndian>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T value) {\n      return swapFromBigEndian(value);\n    }\n    template<typename T>\n    static void copyAndSwapFromNetworkOrder(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFromBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void swapFromNetworkOrderInPlace(T* p, size_t count) {\n      swapFromBigEndianInPlace(p, count);\n    }\n\n  private:\n    /**\n     * Read a value of type T, encoded in endianness ThisEndian from |p|.\n     * Return that value encoded in native endianness.\n     */\n    template<typename T>\n    static T read(const void* p) {\n      union {\n        T val;\n        uint8_t buffer[sizeof(T)];\n      } u;\n      memcpy(u.buffer, p, sizeof(T));\n      return maybeSwap<ThisEndian, MOZ_NATIVE_ENDIANNESS>(u.val);\n    }\n\n    /**\n     * Write a value of type T, in native endianness, to |p|, in ThisEndian\n     * endianness.\n     */\n    template<typename T>\n    static void write(void* p, T value) {\n      T tmp = maybeSwap<MOZ_NATIVE_ENDIANNESS, ThisEndian>(value);\n      memcpy(p, &tmp, sizeof(T));\n    }\n\n    Endian() MOZ_DELETE;\n    Endian(const Endian& other) MOZ_DELETE;\n    void operator=(const Endian& other) MOZ_DELETE;\n};\n\ntemplate<Endianness ThisEndian>\nclass EndianReadWrite : public Endian<ThisEndian>\n{\n  private:\n    typedef Endian<ThisEndian> super;\n\n  public:\n    using super::readUint16;\n    using super::readUint32;\n    using super::readUint64;\n    using super::readInt16;\n    using super::readInt32;\n    using super::readInt64;\n    using super::writeUint16;\n    using super::writeUint32;\n    using super::writeUint64;\n    using super::writeInt16;\n    using super::writeInt32;\n    using super::writeInt64;\n};\n\n} /* namespace detail */\n\nclass LittleEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Little>\n{};\n\nclass BigEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Big>\n{};\n\ntypedef BigEndian NetworkEndian;\n\nclass NativeEndian MOZ_FINAL : public detail::Endian<MOZ_NATIVE_ENDIANNESS>\n{\n  private:\n    typedef detail::Endian<MOZ_NATIVE_ENDIANNESS> super;\n\n  public:\n    /*\n     * These functions are intended for cases where you have data in your\n     * native-endian format and you need the data to appear in the appropriate\n     * endianness for transmission, serialization, etc.\n     */\n    using super::swapToLittleEndian;\n    using super::copyAndSwapToLittleEndian;\n    using super::swapToLittleEndianInPlace;\n    using super::swapToBigEndian;\n    using super::copyAndSwapToBigEndian;\n    using super::swapToBigEndianInPlace;\n    using super::swapToNetworkOrder;\n    using super::copyAndSwapToNetworkOrder;\n    using super::swapToNetworkOrderInPlace;\n\n    /*\n     * These functions are intended for cases where you have data in the\n     * given endianness (e.g. reading from disk or a file-format) and you\n     * need the data to appear in native-endian format for processing.\n     */\n    using super::swapFromLittleEndian;\n    using super::copyAndSwapFromLittleEndian;\n    using super::swapFromLittleEndianInPlace;\n    using super::swapFromBigEndian;\n    using super::copyAndSwapFromBigEndian;\n    using super::swapFromBigEndianInPlace;\n    using super::swapFromNetworkOrder;\n    using super::copyAndSwapFromNetworkOrder;\n    using super::swapFromNetworkOrderInPlace;\n};\n\n#undef MOZ_NATIVE_ENDIANNESS\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Endian_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/EnumSet.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A set abstraction for enumeration values. */\n\n#ifndef mozilla_EnumSet_h\n#define mozilla_EnumSet_h\n\n#include \"mozilla/Assertions.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * EnumSet<T> is a set of values defined by an enumeration. It is implemented\n * using a 32 bit mask for each value so it will only work for enums with an int\n * representation less than 32. It works both for enum and enum class types.\n */\ntemplate<typename T>\nclass EnumSet\n{\n  public:\n    EnumSet()\n      : mBitField(0)\n    { }\n\n    EnumSet(T aEnum)\n      : mBitField(aEnum)\n    { }\n\n    EnumSet(T aEnum1, T aEnum2)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2) |\n                  bitFor(aEnum3))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3, T aEnum4)\n     : mBitField(bitFor(aEnum1) |\n                 bitFor(aEnum2) |\n                 bitFor(aEnum3) |\n                 bitFor(aEnum4))\n    { }\n\n    EnumSet(const EnumSet& aEnumSet)\n     : mBitField(aEnumSet.mBitField)\n    { }\n\n    /**\n     * Add an element\n     */\n    void operator+=(T aEnum) {\n      mBitField |= bitFor(aEnum);\n    }\n\n    /**\n     * Add an element\n     */\n    EnumSet<T> operator+(T aEnum) const {\n      EnumSet<T> result(*this);\n      result += aEnum;\n      return result;\n    }\n\n    /**\n     * Union\n     */\n    void operator+=(const EnumSet<T> aEnumSet) {\n      mBitField |= aEnumSet.mBitField;\n    }\n\n    /**\n     * Union\n     */\n    EnumSet<T> operator+(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result += aEnumSet;\n      return result;\n    }\n\n    /**\n     * Remove an element\n     */\n    void operator-=(T aEnum) {\n      mBitField &= ~(bitFor(aEnum));\n    }\n\n    /**\n     * Remove an element\n     */\n    EnumSet<T> operator-(T aEnum) const {\n      EnumSet<T> result(*this);\n      result -= aEnum;\n      return result;\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    void operator-=(const EnumSet<T> aEnumSet) {\n      mBitField &= ~(aEnumSet.mBitField);\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    EnumSet<T> operator-(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result -= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Intersection\n     */\n    void operator&=(const EnumSet<T> aEnumSet) {\n      mBitField &= aEnumSet.mBitField;\n    }\n\n    /**\n     * Intersection\n     */\n    EnumSet<T> operator&(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result &= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Equality\n     */\n\n    bool operator==(const EnumSet<T> aEnumSet) const {\n      return mBitField == aEnumSet.mBitField;\n    }\n\n    /**\n     * Test is an element is contained in the set\n     */\n    bool contains(T aEnum) const {\n      return mBitField & bitFor(aEnum);\n    }\n\n    /**\n     * Return the number of elements in the set\n     */\n\n    uint8_t size() {\n      uint8_t count = 0;\n      for (uint32_t bitField = mBitField; bitField; bitField >>= 1) {\n        if (bitField & 1)\n          count++;\n      }\n      return count;\n    }\n\n  private:\n    static uint32_t bitFor(T aEnum) {\n      uint32_t bitNumber(aEnum);\n      MOZ_ASSERT(bitNumber < 32);\n      return 1U << bitNumber;\n    }\n\n    uint32_t mBitField;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_EnumSet_h_*/\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/FloatingPoint.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various predicates and operations on IEEE-754 floating point types. */\n\n#ifndef mozilla_FloatingPoint_h\n#define mozilla_FloatingPoint_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/*\n * It's reasonable to ask why we have this header at all.  Don't isnan,\n * copysign, the built-in comparison operators, and the like solve these\n * problems?  Unfortunately, they don't.  We've found that various compilers\n * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile\n * the standard methods in various situations, so we can't use them.  Some of\n * these compilers even have problems compiling seemingly reasonable bitwise\n * algorithms!  But with some care we've found algorithms that seem to not\n * trigger those compiler bugs.\n *\n * For the aforementioned reasons, be very wary of making changes to any of\n * these algorithms.  If you must make changes, keep a careful eye out for\n * compiler bustage, particularly PGO-specific bustage.\n */\n\n/*\n * These implementations all assume |double| is a 64-bit double format number\n * type, compatible with the IEEE-754 standard.  C/C++ don't require this to be\n * the case.  But we required this in implementations of these algorithms that\n * preceded this header, so we shouldn't break anything if we continue doing so.\n */\nstatic_assert(sizeof(double) == sizeof(uint64_t), \"double must be 64 bits\");\n\nconst unsigned DoubleExponentBias = 1023;\nconst unsigned DoubleExponentShift = 52;\n\nconst uint64_t DoubleSignBit         = 0x8000000000000000ULL;\nconst uint64_t DoubleExponentBits    = 0x7ff0000000000000ULL;\nconst uint64_t DoubleSignificandBits = 0x000fffffffffffffULL;\n\nstatic_assert((DoubleSignBit & DoubleExponentBits) == 0,\n              \"sign bit doesn't overlap exponent bits\");\nstatic_assert((DoubleSignBit & DoubleSignificandBits) == 0,\n              \"sign bit doesn't overlap significand bits\");\nstatic_assert((DoubleExponentBits & DoubleSignificandBits) == 0,\n              \"exponent bits don't overlap significand bits\");\n\nstatic_assert((DoubleSignBit | DoubleExponentBits | DoubleSignificandBits) ==\n              ~uint64_t(0),\n              \"all bits accounted for\");\n\n/** Determines whether a double is NaN. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNaN(double d)\n{\n  /*\n   * A double is NaN if all exponent bits are 1 and the significand contains at\n   * least one non-zero bit.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) == DoubleExponentBits &&\n         (bits & DoubleSignificandBits) != 0;\n}\n\n/** Determines whether a double is +Infinity or -Infinity. */\nstatic MOZ_ALWAYS_INLINE bool\nIsInfinite(double d)\n{\n  /* Infinities have all exponent bits set to 1 and an all-0 significand. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & ~DoubleSignBit) == DoubleExponentBits;\n}\n\n/** Determines whether a double is not NaN or infinite. */\nstatic MOZ_ALWAYS_INLINE bool\nIsFinite(double d)\n{\n  /*\n   * NaN and Infinities are the only non-finite doubles, and both have all\n   * exponent bits set to 1.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) != DoubleExponentBits;\n}\n\n/**\n * Determines whether a double is negative.  It is an error to call this method\n * on a double which is NaN.\n */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegative(double d)\n{\n  MOZ_ASSERT(!IsNaN(d), \"NaN does not have a sign\");\n\n  /* The sign bit is set if the double is negative. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleSignBit) != 0;\n}\n\n/** Determines whether a double represents -0. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegativeZero(double d)\n{\n  /* Only the sign bit is set if the double is -0. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return bits == DoubleSignBit;\n}\n\n/** Returns the exponent portion of the double. */\nstatic MOZ_ALWAYS_INLINE int_fast16_t\nExponentComponent(double d)\n{\n  /*\n   * The exponent component of a double is an unsigned number, biased from its\n   * actual value.  Subtract the bias to retrieve the actual exponent.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return int_fast16_t((bits & DoubleExponentBits) >> DoubleExponentShift) -\n         int_fast16_t(DoubleExponentBias);\n}\n\n/** Returns +Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nPositiveInfinity()\n{\n  /*\n   * Positive infinity has all exponent bits set, sign bit set to 0, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleExponentBits);\n}\n\n/** Returns -Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nNegativeInfinity()\n{\n  /*\n   * Negative infinity has all exponent bits set, sign bit set to 1, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleSignBit | DoubleExponentBits);\n}\n\n/** Constructs a NaN value with the specified sign bit and significand bits. */\nstatic MOZ_ALWAYS_INLINE double\nSpecificNaN(int signbit, uint64_t significand)\n{\n  MOZ_ASSERT(signbit == 0 || signbit == 1);\n  MOZ_ASSERT((significand & ~DoubleSignificandBits) == 0);\n  MOZ_ASSERT(significand & DoubleSignificandBits);\n\n  double d = BitwiseCast<double>((signbit ? DoubleSignBit : 0) |\n                                 DoubleExponentBits |\n                                 significand);\n  MOZ_ASSERT(IsNaN(d));\n  return d;\n}\n\n/** Computes the smallest non-zero positive double value. */\nstatic MOZ_ALWAYS_INLINE double\nMinDoubleValue()\n{\n  return BitwiseCast<double>(uint64_t(1));\n}\n\nstatic MOZ_ALWAYS_INLINE bool\nDoubleIsInt32(double d, int32_t* i)\n{\n  /*\n   * XXX Casting a double that doesn't truncate to int32_t, to int32_t, induces\n   *     undefined behavior.  We should definitely fix this (bug 744965), but as\n   *     apparently it \"works\" in practice, it's not a pressing concern now.\n   */\n  return !IsNegativeZero(d) && d == (*i = int32_t(d));\n}\n\n/**\n * Computes a NaN value.  Do not use this method if you depend upon a particular\n * NaN value being returned.\n */\nstatic MOZ_ALWAYS_INLINE double\nUnspecifiedNaN()\n{\n  return SpecificNaN(0, 0xfffffffffffffULL);\n}\n\n/**\n * Compare two doubles for equality, *without* equating -0 to +0, and equating\n * any NaN value to any other NaN value.  (The normal equality operators equate\n * -0 with +0, and they equate NaN to no other value.)\n */\nstatic inline bool\nDoublesAreIdentical(double d1, double d2)\n{\n  if (IsNaN(d1))\n    return IsNaN(d2);\n  return BitwiseCast<uint64_t>(d1) == BitwiseCast<uint64_t>(d2);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_FloatingPoint_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/GuardObjects.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementation of macros to ensure correct use of RAII Auto* objects. */\n\n#ifndef mozilla_GuardObjects_h\n#define mozilla_GuardObjects_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\n#ifdef DEBUG\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The following classes are designed to cause assertions to detect\n * inadvertent use of guard objects as temporaries. In other words,\n * when we have a guard object whose only purpose is its constructor and\n * destructor (and is never otherwise referenced), the intended use\n * might be:\n *\n *   AutoRestore savePainting(mIsPainting);\n *\n * but is is easy to accidentally write:\n *\n *   AutoRestore(mIsPainting);\n *\n * which compiles just fine, but runs the destructor well before the\n * intended time.\n *\n * They work by adding (#ifdef DEBUG) an additional parameter to the\n * guard object's constructor, with a default value, so that users of\n * the guard object's API do not need to do anything. The default value\n * of this parameter is a temporary object. C++ (ISO/IEC 14882:1998),\n * section 12.2 [class.temporary], clauses 4 and 5 seem to assume a\n * guarantee that temporaries are destroyed in the reverse of their\n * construction order, but I actually can't find a statement that that\n * is true in the general case (beyond the two specific cases mentioned\n * there). However, it seems to be true.\n *\n * These classes are intended to be used only via the macros immediately\n * below them:\n *\n *   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member\n *     variable, and should be put where a declaration of a private\n *     member variable would be placed.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the\n *     parameters to each constructor of the guard object; it declares\n *     (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM\n *     variant for constructors that take no other parameters.)\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in\n *     the implementation of such constructors when they are not inline.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in\n *     the implementation of such constructors to pass the parameter to\n *     a base class that also uses these macros\n *   MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each\n *     constructor. It uses the parameter declared by\n *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.\n *\n * For more details, and examples of using these macros, see\n * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla\n */\nclass MOZ_EXPORT GuardObjectNotifier\n{\n  private:\n    bool* statementDone;\n\n  public:\n    GuardObjectNotifier() : statementDone(nullptr) { }\n\n    ~GuardObjectNotifier() {\n      *statementDone = true;\n    }\n\n    void setStatementDone(bool* statementIsDone) {\n      statementDone = statementIsDone;\n    }\n};\n\nclass MOZ_EXPORT GuardObjectNotificationReceiver\n{\n  private:\n    bool statementDone;\n\n  public:\n    GuardObjectNotificationReceiver() : statementDone(false) { }\n\n    ~GuardObjectNotificationReceiver() {\n      /*\n       * Assert that the guard object was not used as a temporary.  (Note that\n       * this assert might also fire if init is not called because the guard\n       * object's implementation is not using the above macros correctly.)\n       */\n      MOZ_ASSERT(statementDone);\n    }\n\n    void init(const GuardObjectNotifier& constNotifier) {\n      /*\n       * constNotifier is passed as a const reference so that we can pass a\n       * temporary, but we really intend it as non-const.\n       */\n      GuardObjectNotifier& notifier = const_cast<GuardObjectNotifier&>(constNotifier);\n      notifier.setStatementDone(&statementDone);\n    }\n};\n\n} /* namespace detail */\n} /* namespace mozilla */\n\n#endif /* DEBUG */\n\n#ifdef DEBUG\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \\\n     mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary;\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \\\n     const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \\\n     const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \\\n     , _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \\\n       _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT \\\n     do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0)\n#else\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_GuardObjects_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/HashFunctions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Utilities for hashing. */\n\n/*\n * This file exports functions for hashing data down to a 32-bit value,\n * including:\n *\n *  - HashString    Hash a char* or uint16_t/wchar_t* of known or unknown\n *                  length.\n *\n *  - HashBytes     Hash a byte array of known length.\n *\n *  - HashGeneric   Hash one or more values.  Currently, we support uint32_t,\n *                  types which can be implicitly cast to uint32_t, data\n *                  pointers, and function pointers.\n *\n *  - AddToHash     Add one or more values to the given hash.  This supports the\n *                  same list of types as HashGeneric.\n *\n *\n * You can chain these functions together to hash complex objects.  For example:\n *\n *  class ComplexObject\n *  {\n *      char* str;\n *      uint32_t uint1, uint2;\n *      void (*callbackFn)();\n *\n *    public:\n *      uint32_t hash() {\n *        uint32_t hash = HashString(str);\n *        hash = AddToHash(hash, uint1, uint2);\n *        return AddToHash(hash, callbackFn);\n *      }\n *  };\n *\n * If you want to hash an nsAString or nsACString, use the HashString functions\n * in nsHashKeys.h.\n */\n\n#ifndef mozilla_HashFunctions_h\n#define mozilla_HashFunctions_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\n#ifdef __cplusplus\nnamespace mozilla {\n\n/**\n * The golden ratio as a 32-bit fixed-point value.\n */\nstatic const uint32_t GoldenRatioU32 = 0x9E3779B9U;\n\ninline uint32_t\nRotateBitsLeft32(uint32_t value, uint8_t bits)\n{\n  MOZ_ASSERT(bits < 32);\n  return (value << bits) | (value >> (32 - bits));\n}\n\nnamespace detail {\n\ninline uint32_t\nAddU32ToHash(uint32_t hash, uint32_t value)\n{\n  /*\n   * This is the meat of all our hash routines.  This hash function is not\n   * particularly sophisticated, but it seems to work well for our mostly\n   * plain-text inputs.  Implementation notes follow.\n   *\n   * Our use of the golden ratio here is arbitrary; we could pick almost any\n   * number which:\n   *\n   *  * is odd (because otherwise, all our hash values will be even)\n   *\n   *  * has a reasonably-even mix of 1's and 0's (consider the extreme case\n   *    where we multiply by 0x3 or 0xeffffff -- this will not produce good\n   *    mixing across all bits of the hash).\n   *\n   * The rotation length of 5 is also arbitrary, although an odd number is again\n   * preferable so our hash explores the whole universe of possible rotations.\n   *\n   * Finally, we multiply by the golden ratio *after* xor'ing, not before.\n   * Otherwise, if |hash| is 0 (as it often is for the beginning of a message),\n   * the expression\n   *\n   *   (GoldenRatioU32 * RotateBitsLeft(hash, 5)) |xor| value\n   *\n   * evaluates to |value|.\n   *\n   * (Number-theoretic aside: Because any odd number |m| is relatively prime to\n   * our modulus (2^32), the list\n   *\n   *    [x * m (mod 2^32) for 0 <= x < 2^32]\n   *\n   * has no duplicate elements.  This means that multiplying by |m| does not\n   * cause us to skip any possible hash values.\n   *\n   * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the\n   * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely\n   * multiply our hash value by |m| a few times without negating the\n   * multiplicative effect.  Our golden ratio constant has order 2^29, which is\n   * more than enough for our purposes.)\n   */\n  return GoldenRatioU32 * (RotateBitsLeft32(hash, 5) ^ value);\n}\n\n/**\n * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter.\n */\ntemplate<size_t PtrSize>\ninline uint32_t\nAddUintptrToHash(uint32_t hash, uintptr_t value);\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<4>(uint32_t hash, uintptr_t value)\n{\n  return AddU32ToHash(hash, static_cast<uint32_t>(value));\n}\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<8>(uint32_t hash, uintptr_t value)\n{\n  /*\n   * The static cast to uint64_t below is necessary because this function\n   * sometimes gets compiled on 32-bit platforms (yes, even though it's a\n   * template and we never call this particular override in a 32-bit build).  If\n   * we do value >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t\n   * right 32 bits, and the compiler throws an error.\n   */\n  uint32_t v1 = static_cast<uint32_t>(value);\n  uint32_t v2 = static_cast<uint32_t>(static_cast<uint64_t>(value) >> 32);\n  return AddU32ToHash(AddU32ToHash(hash, v1), v2);\n}\n\n} /* namespace detail */\n\n/**\n * AddToHash takes a hash and some values and returns a new hash based on the\n * inputs.\n *\n * Currently, we support hashing uint32_t's, values which we can implicitly\n * convert to uint32_t, data pointers, and function pointers.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A a)\n{\n  /*\n   * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,\n   * we'll error out.\n   */\n  return detail::AddU32ToHash(hash, a);\n}\n\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A* a)\n{\n  /*\n   * You might think this function should just take a void*.  But then we'd only\n   * catch data pointers and couldn't handle function pointers.\n   */\n\n  static_assert(sizeof(a) == sizeof(uintptr_t),\n                \"Strange pointer!\");\n\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, uintptr_t(a));\n}\n\ntemplate<>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, uintptr_t a)\n{\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b)\n{\n  return AddToHash(AddToHash(hash, a), b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c)\n{\n  return AddToHash(AddToHash(hash, a, b), c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d)\n{\n  return AddToHash(AddToHash(hash, a, b, c), d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d, E e)\n{\n  return AddToHash(AddToHash(hash, a, b, c, d), e);\n}\n\n/**\n * The HashGeneric class of functions let you hash one or more values.\n *\n * If you want to hash together two values x and y, calling HashGeneric(x, y) is\n * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes\n * that x has already been hashed.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a)\n{\n  return AddToHash(0, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b)\n{\n  return AddToHash(0, a, b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c)\n{\n  return AddToHash(0, a, b, c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d)\n{\n  return AddToHash(0, a, b, c, d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d, E e)\n{\n  return AddToHash(0, a, b, c, d, e);\n}\n\nnamespace detail {\n\ntemplate<typename T>\nuint32_t\nHashUntilZero(const T* str)\n{\n  uint32_t hash = 0;\n  for (T c; (c = *str); str++)\n    hash = AddToHash(hash, c);\n  return hash;\n}\n\ntemplate<typename T>\nuint32_t\nHashKnownLength(const T* str, size_t length)\n{\n  uint32_t hash = 0;\n  for (size_t i = 0; i < length; i++)\n    hash = AddToHash(hash, str[i]);\n  return hash;\n}\n\n} /* namespace detail */\n\n/**\n * The HashString overloads below do just what you'd expect.\n *\n * If you have the string's length, you might as well call the overload which\n * includes the length.  It may be marginally faster.\n */\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\n/*\n * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's\n * the same width!\n */\n#ifdef WIN32\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n#endif\n\n/**\n * Hash some number of bytes.\n *\n * This hash walks word-by-word, rather than byte-by-byte, so you won't get the\n * same result out of HashBytes as you would out of HashString.\n */\nMOZ_WARN_UNUSED_RESULT\nextern MFBT_API uint32_t\nHashBytes(const void* bytes, size_t length);\n\n} /* namespace mozilla */\n#endif /* __cplusplus */\n\n#endif /* mozilla_HashFunctions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Likely.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a\n * boolean predicate should be branch-predicted.\n */\n\n#ifndef mozilla_Likely_h\n#define mozilla_Likely_h\n\n#if defined(__clang__) || defined(__GNUC__)\n#  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))\n#  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))\n#else\n#  define MOZ_LIKELY(x)   (!!(x))\n#  define MOZ_UNLIKELY(x) (!!(x))\n#endif\n\n#endif /* mozilla_Likely_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/LinkedList.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type-safe doubly-linked list class. */\n\n/*\n * The classes LinkedList<T> and LinkedListElement<T> together form a\n * convenient, type-safe doubly-linked list implementation.\n *\n * The class T which will be inserted into the linked list must inherit from\n * LinkedListElement<T>.  A given object may be in only one linked list at a\n * time.\n *\n * A LinkedListElement automatically removes itself from the list upon\n * destruction, and a LinkedList will fatally assert in debug builds if it's\n * non-empty when it's destructed.\n *\n * For example, you might use LinkedList in a simple observer list class as\n * follows.\n *\n *   class Observer : public LinkedListElement<Observer>\n *   {\n *     public:\n *       void observe(char* topic) { ... }\n *   };\n *\n *   class ObserverContainer\n *   {\n *     private:\n *       LinkedList<Observer> list;\n *\n *     public:\n *       void addObserver(Observer* observer) {\n *         // Will assert if |observer| is part of another list.\n *         list.insertBack(observer);\n *       }\n *\n *       void removeObserver(Observer* observer) {\n *         // Will assert if |observer| is not part of some list.\n *         observer.remove();\n *         // Or, will assert if |observer| is not part of |list| specifically.\n *         // observer.removeFrom(list);\n *       }\n *\n *       void notifyObservers(char* topic) {\n *         for (Observer* o = list.getFirst(); o != nullptr; o = o->getNext())\n *           o->observe(topic);\n *       }\n *   };\n *\n */\n\n#ifndef mozilla_LinkedList_h\n#define mozilla_LinkedList_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\ntemplate<typename T>\nclass LinkedList;\n\ntemplate<typename T>\nclass LinkedListElement\n{\n    /*\n     * It's convenient that we return nullptr when getNext() or getPrevious()\n     * hits the end of the list, but doing so costs an extra word of storage in\n     * each linked list node (to keep track of whether |this| is the sentinel\n     * node) and a branch on this value in getNext/getPrevious.\n     *\n     * We could get rid of the extra word of storage by shoving the \"is\n     * sentinel\" bit into one of the pointers, although this would, of course,\n     * have performance implications of its own.\n     *\n     * But the goal here isn't to win an award for the fastest or slimmest\n     * linked list; rather, we want a *convenient* linked list.  So we won't\n     * waste time guessing which micro-optimization strategy is best.\n     *\n     *\n     * Speaking of unnecessary work, it's worth addressing here why we wrote\n     * mozilla::LinkedList in the first place, instead of using stl::list.\n     *\n     * The key difference between mozilla::LinkedList and stl::list is that\n     * mozilla::LinkedList stores the prev/next pointers in the object itself,\n     * while stl::list stores the prev/next pointers in a list element which\n     * itself points to the object being stored.\n     *\n     * mozilla::LinkedList's approach makes it harder to store an object in more\n     * than one list.  But the upside is that you can call next() / prev() /\n     * remove() directly on the object.  With stl::list, you'd need to store a\n     * pointer to its iterator in the object in order to accomplish this.  Not\n     * only would this waste space, but you'd have to remember to update that\n     * pointer every time you added or removed the object from a list.\n     *\n     * In-place, constant-time removal is a killer feature of doubly-linked\n     * lists, and supporting this painlessly was a key design criterion.\n     */\n\n  private:\n    LinkedListElement* next;\n    LinkedListElement* prev;\n    const bool isSentinel;\n\n  public:\n    LinkedListElement()\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(false)\n    { }\n\n    ~LinkedListElement() {\n      if (!isSentinel && isInList())\n        remove();\n    }\n\n    /*\n     * Get the next element in the list, or nullptr if this is the last element\n     * in the list.\n     */\n    T* getNext() {\n      return next->asT();\n    }\n    const T* getNext() const {\n      return next->asT();\n    }\n\n    /*\n     * Get the previous element in the list, or nullptr if this is the first\n     * element in the list.\n     */\n    T* getPrevious() {\n      return prev->asT();\n    }\n    const T* getPrevious() const {\n      return prev->asT();\n    }\n\n    /*\n     * Insert elem after this element in the list.  |this| must be part of a\n     * linked list when you call setNext(); otherwise, this method will assert.\n     */\n    void setNext(T* elem) {\n        MOZ_ASSERT(isInList());\n        setNextUnsafe(elem);\n    }\n\n    /*\n     * Insert elem before this element in the list.  |this| must be part of a\n     * linked list when you call setPrevious(); otherwise, this method will\n     * assert.\n     */\n    void setPrevious(T* elem) {\n      MOZ_ASSERT(isInList());\n      setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Remove this element from the list which contains it.  If this element is\n     * not currently part of a linked list, this method asserts.\n     */\n    void remove() {\n      MOZ_ASSERT(isInList());\n\n      prev->next = next;\n      next->prev = prev;\n      next = this;\n      prev = this;\n    }\n\n    /*\n     * Identical to remove(), but also asserts in debug builds that this element\n     * is in list.\n     */\n    void removeFrom(const LinkedList<T>& list) {\n      list.assertContains(asT());\n      remove();\n    }\n\n    /*\n     * Return true if |this| part is of a linked list, and false otherwise.\n     */\n    bool isInList() const {\n      MOZ_ASSERT((next == this) == (prev == this));\n      return next != this;\n    }\n\n  private:\n    friend class LinkedList<T>;\n\n    enum NodeKind {\n      NODE_KIND_NORMAL,\n      NODE_KIND_SENTINEL\n    };\n\n    LinkedListElement(NodeKind nodeKind)\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(nodeKind == NODE_KIND_SENTINEL)\n    { }\n\n    /*\n     * Return |this| cast to T* if we're a normal node, or return nullptr if\n     * we're a sentinel node.\n     */\n    T* asT() {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<T*>(this);\n    }\n    const T* asT() const {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<const T*>(this);\n    }\n\n    /*\n     * Insert elem after this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertFront().\n     */\n    void setNextUnsafe(T* elem) {\n      LinkedListElement *listElem = static_cast<LinkedListElement*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this->next;\n      listElem->prev = this;\n      this->next->prev = listElem;\n      this->next = listElem;\n    }\n\n    /*\n     * Insert elem before this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertBack().\n     */\n    void setPreviousUnsafe(T* elem) {\n      LinkedListElement<T>* listElem = static_cast<LinkedListElement<T>*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this;\n      listElem->prev = this->prev;\n      this->prev->next = listElem;\n      this->prev = listElem;\n    }\n\n  private:\n    LinkedListElement& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedListElement(const LinkedList<T>& other) MOZ_DELETE;\n};\n\ntemplate<typename T>\nclass LinkedList\n{\n  private:\n    LinkedListElement<T> sentinel;\n\n  public:\n    LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }\n\n    ~LinkedList() {\n      MOZ_ASSERT(isEmpty());\n    }\n\n    /*\n     * Add elem to the front of the list.\n     */\n    void insertFront(T* elem) {\n      /* Bypass setNext()'s this->isInList() assertion. */\n      sentinel.setNextUnsafe(elem);\n    }\n\n    /*\n     * Add elem to the back of the list.\n     */\n    void insertBack(T* elem) {\n      sentinel.setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Get the first element of the list, or nullptr if the list is empty.\n     */\n    T* getFirst() {\n      return sentinel.getNext();\n    }\n    const T* getFirst() const {\n      return sentinel.getNext();\n    }\n\n    /*\n     * Get the last element of the list, or nullptr if the list is empty.\n     */\n    T* getLast() {\n      return sentinel.getPrevious();\n    }\n    const T* getLast() const {\n      return sentinel.getPrevious();\n    }\n\n    /*\n     * Get and remove the first element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popFirst() {\n      T* ret = sentinel.getNext();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Get and remove the last element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popLast() {\n      T* ret = sentinel.getPrevious();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Return true if the list is empty, or false otherwise.\n     */\n    bool isEmpty() const {\n      return !sentinel.isInList();\n    }\n\n    /*\n     * Remove all the elements from the list.\n     *\n     * This runs in time linear to the list's length, because we have to mark\n     * each element as not in the list.\n     */\n    void clear() {\n      while (popFirst())\n        continue;\n    }\n\n    /*\n     * In a debug build, make sure that the list is sane (no cycles, consistent\n     * next/prev pointers, only one sentinel).  Has no effect in release builds.\n     */\n    void debugAssertIsSane() const {\n#ifdef DEBUG\n      const LinkedListElement<T>* slow;\n      const LinkedListElement<T>* fast1;\n      const LinkedListElement<T>* fast2;\n\n      /*\n       * Check for cycles in the forward singly-linked list using the\n       * tortoise/hare algorithm.\n       */\n      for (slow = sentinel.next,\n           fast1 = sentinel.next->next,\n           fast2 = sentinel.next->next->next;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->next, fast1 = fast2->next, fast2 = fast1->next)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /* Check for cycles in the backward singly-linked list. */\n      for (slow = sentinel.prev,\n           fast1 = sentinel.prev->prev,\n           fast2 = sentinel.prev->prev->prev;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /*\n       * Check that |sentinel| is the only node in the list with\n       * isSentinel == true.\n       */\n      for (const LinkedListElement<T>* elem = sentinel.next;\n           elem != sentinel;\n           elem = elem->next)\n      {\n        MOZ_ASSERT(!elem->isSentinel);\n      }\n\n      /* Check that the next/prev pointers match up. */\n      const LinkedListElement<T>* prev = sentinel;\n      const LinkedListElement<T>* cur = sentinel.next;\n      do {\n          MOZ_ASSERT(cur->prev == prev);\n          MOZ_ASSERT(prev->next == cur);\n\n          prev = cur;\n          cur = cur->next;\n      } while (cur != sentinel);\n#endif /* ifdef DEBUG */\n    }\n\n  private:\n    friend class LinkedListElement<T>;\n\n    void assertContains(const T* t) const {\n#ifdef DEBUG\n      for (const T* elem = getFirst();\n           elem;\n           elem = elem->getNext())\n      {\n        if (elem == t)\n          return;\n      }\n      MOZ_CRASH(\"element wasn't found in this list!\");\n#endif\n    }\n\n    LinkedList& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedList(const LinkedList<T>& other) MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_LinkedList_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/MathAlgorithms.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt maths algorithms. */\n\n#ifndef mozilla_MathAlgorithms_h\n#define mozilla_MathAlgorithms_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <cmath>\n#include <limits.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n// Greatest Common Divisor\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidGCD(IntegerType a, IntegerType b)\n{\n  // Euclid's algorithm; O(N) in the worst case.  (There are better\n  // ways, but we don't need them for the current use of this algo.)\n  MOZ_ASSERT(a > 0);\n  MOZ_ASSERT(b > 0);\n\n  while (a != b) {\n    if (a > b) {\n      a = a - b;\n    } else {\n      b = b - a;\n    }\n  }\n\n  return a;\n}\n\n// Least Common Multiple\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidLCM(IntegerType a, IntegerType b)\n{\n  // Divide first to reduce overflow risk.\n  return (a / EuclidGCD(a, b)) * b;\n}\n\nnamespace detail {\n\ntemplate<typename T>\nstruct AllowDeprecatedAbsFixed : FalseType {};\n\ntemplate<> struct AllowDeprecatedAbsFixed<int32_t> : TrueType {};\ntemplate<> struct AllowDeprecatedAbsFixed<int64_t> : TrueType {};\n\ntemplate<typename T>\nstruct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};\n\ntemplate<> struct AllowDeprecatedAbs<int> : TrueType {};\ntemplate<> struct AllowDeprecatedAbs<long> : TrueType {};\n\n} // namespace detail\n\n// DO NOT USE DeprecatedAbs.  It exists only until its callers can be converted\n// to Abs below, and it will be removed when all callers have been changed.\ntemplate<typename T>\ninline typename mozilla::EnableIf<detail::AllowDeprecatedAbs<T>::value, T>::Type\nDeprecatedAbs(const T t)\n{\n  // The absolute value of the smallest possible value of a signed-integer type\n  // won't fit in that type (on twos-complement systems -- and we're blithely\n  // assuming we're on such systems, for the non-<stdint.h> types listed above),\n  // so assert that the input isn't that value.\n  //\n  // This is the case if: the value is non-negative; or if adding one (giving a\n  // value in the range [-maxvalue, 0]), then negating (giving a value in the\n  // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement,\n  // (minvalue + 1) == -maxvalue).\n  MOZ_ASSERT(t >= 0 ||\n             -(t + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1),\n             \"You can't negate the smallest possible negative integer!\");\n  return t >= 0 ? t : -t;\n}\n\nnamespace detail {\n\n// For now mozilla::Abs only takes intN_T, the signed natural types, and\n// float/double/long double.  Feel free to add overloads for other standard,\n// signed types if you need them.\n\ntemplate<typename T>\nstruct AbsReturnTypeFixed;\n\ntemplate<> struct AbsReturnTypeFixed<int8_t> { typedef uint8_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int16_t> { typedef uint16_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int32_t> { typedef uint32_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int64_t> { typedef uint64_t Type; };\n\ntemplate<typename T>\nstruct AbsReturnType : AbsReturnTypeFixed<T> {};\n\ntemplate<> struct AbsReturnType<char> : EnableIf<char(-1) < char(0), unsigned char> {};\ntemplate<> struct AbsReturnType<signed char> { typedef unsigned char Type; };\ntemplate<> struct AbsReturnType<short> { typedef unsigned short Type; };\ntemplate<> struct AbsReturnType<int> { typedef unsigned int Type; };\ntemplate<> struct AbsReturnType<long> { typedef unsigned long Type; };\ntemplate<> struct AbsReturnType<long long> { typedef unsigned long long Type; };\ntemplate<> struct AbsReturnType<float> { typedef float Type; };\ntemplate<> struct AbsReturnType<double> { typedef double Type; };\ntemplate<> struct AbsReturnType<long double> { typedef long double Type; };\n\n} // namespace detail\n\ntemplate<typename T>\ninline typename detail::AbsReturnType<T>::Type\nAbs(const T t)\n{\n  typedef typename detail::AbsReturnType<T>::Type ReturnType;\n  return t >= 0 ? ReturnType(t) : ~ReturnType(t) + 1;\n}\n\ntemplate<>\ninline float\nAbs<float>(const float f)\n{\n  return std::fabs(f);\n}\n\ntemplate<>\ninline double\nAbs<double>(const double d)\n{\n  return std::fabs(d);\n}\n\ntemplate<>\ninline long double\nAbs<long double>(const long double d)\n{\n  return std::fabs(d);\n}\n\n} // namespace mozilla\n\n#if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))\n#  define MOZ_BITSCAN_WINDOWS\n\n  extern \"C\" {\n    unsigned char _BitScanForward(unsigned long* Index, unsigned long mask);\n    unsigned char _BitScanReverse(unsigned long* Index, unsigned long mask);\n#  pragma intrinsic(_BitScanForward, _BitScanReverse)\n\n#  if defined(_M_AMD64) || defined(_M_X64)\n#    define MOZ_BITSCAN_WINDOWS64\n    unsigned char _BitScanForward64(unsigned long* index, unsigned __int64 mask);\n    unsigned char _BitScanReverse64(unsigned long* index, unsigned __int64 mask);\n#   pragma intrinsic(_BitScanForward64, _BitScanReverse64)\n#  endif\n  } // extern \"C\"\n\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n#if defined(MOZ_BITSCAN_WINDOWS)\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanReverse(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(31 - index);\n  }\n\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanForward(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(index);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanReverse64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(63 - index);\n#  else\n    uint32_t hi = uint32_t(u >> 32);\n    if (hi != 0)\n      return CountLeadingZeroes32(hi);\n    return 32 + CountLeadingZeroes32(uint32_t(u));\n#  endif\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanForward64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(index);\n#  else\n    uint32_t lo = uint32_t(u);\n    if (lo != 0)\n      return CountTrailingZeroes32(lo);\n    return 32 + CountTrailingZeroes32(uint32_t(u >> 32));\n#  endif\n  }\n\n#  ifdef MOZ_HAVE_BITSCAN64\n#    undef MOZ_HAVE_BITSCAN64\n#  endif\n\n#elif defined(__clang__) || defined(__GNUC__)\n\n#  if defined(__clang__)\n#    if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz)\n#      error \"A clang providing __builtin_c[lt]z is required to build\"\n#    endif\n#  else\n     // gcc has had __builtin_clz and friends since 3.4: no need to check.\n#  endif\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    return __builtin_clz(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    return __builtin_ctz(u);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n    return __builtin_clzll(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n    return __builtin_ctzll(u);\n  }\n\n#else\n#  error \"Implement these!\"\n  inline uint_fast8_t CountLeadingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountLeadingZeroes64(uint64_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes64(uint64_t u) MOZ_DELETE;\n#endif\n\n} // namespace detail\n\n/**\n * Compute the number of high-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the highest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountLeadingZeroes32(0xF0FF1000) is 0;\n * CountLeadingZeroes32(0x7F8F0001) is 1;\n * CountLeadingZeroes32(0x3FFF0100) is 2;\n * CountLeadingZeroes32(0x1FF50010) is 3; and so on.\n */\ninline uint_fast8_t\nCountLeadingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes32(u);\n}\n\n/**\n * Compute the number of low-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the lowest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountTrailingZeroes32(0x0100FFFF) is 0;\n * CountTrailingZeroes32(0x7000FFFE) is 1;\n * CountTrailingZeroes32(0x0080FFFC) is 2;\n * CountTrailingZeroes32(0x0080FFF8) is 3; and so on.\n */\ninline uint_fast8_t\nCountTrailingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes32(u);\n}\n\n/** Analogous to CountLeadingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountLeadingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes64(u);\n}\n\n/** Analogous to CountTrailingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountTrailingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes64(u);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass CeilingLog2;\n\ntemplate<typename T>\nclass CeilingLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 32 - CountLeadingZeroes32(t - 1);\n    }\n};\n\ntemplate<typename T>\nclass CeilingLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 64 - CountLeadingZeroes64(t - 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the least power of 2 greater than or equal to |t|.\n *\n * CeilingLog2(0..1) is 0;\n * CeilingLog2(2) is 1;\n * CeilingLog2(3..4) is 2;\n * CeilingLog2(5..8) is 3;\n * CeilingLog2(9..16) is 4; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nCeilingLog2(const T t)\n{\n  return detail::CeilingLog2<T>::compute(t);\n}\n\n/** A CeilingLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nCeilingLog2Size(size_t n)\n{\n  return CeilingLog2(n);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass FloorLog2;\n\ntemplate<typename T>\nclass FloorLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 31 - CountLeadingZeroes32(t | 1);\n    }\n};\n\ntemplate<typename T>\nclass FloorLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 63 - CountLeadingZeroes64(t | 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the greatest power of 2 less than or equal to |t|.\n *\n * FloorLog2(0..1) is 0;\n * FloorLog2(2..3) is 1;\n * FloorLog2(4..7) is 2;\n * FloorLog2(8..15) is 3; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nFloorLog2(const T t)\n{\n  return detail::FloorLog2<T>::compute(t);\n}\n\n/** A FloorLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nFloorLog2Size(size_t n)\n{\n  return FloorLog2(n);\n}\n\n/*\n * Compute the smallest power of 2 greater than or equal to |x|.  |x| must not\n * be so great that the computed value would overflow |size_t|.\n */\ninline size_t\nRoundUpPow2(size_t x)\n{\n  MOZ_ASSERT(x <= (size_t(1) << (sizeof(size_t) * CHAR_BIT - 1)),\n             \"can't round up -- will overflow!\");\n  return size_t(1) << CeilingLog2(x);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_MathAlgorithms_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/MemoryChecking.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides a common interface to the ASan (AddressSanitizer) and Valgrind \n * functions used to mark memory in certain ways. In detail, the following\n * three macros are provided:\n *\n *   MOZ_MAKE_MEM_NOACCESS  - Mark memory as unsafe to access (e.g. freed)\n *   MOZ_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined\n *   MOZ_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined\n *\n * With Valgrind in use, these directly map to the three respective Valgrind\n * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory,\n * while the UNDEFINED/DEFINED macros unpoison memory.\n *\n * With no memory checker available, all macros expand to the empty statement.\n */\n\n#ifndef mozilla_MemoryChecking_h\n#define mozilla_MemoryChecking_h\n\n#if defined(MOZ_VALGRIND)\n#include \"valgrind/memcheck.h\"\n#endif\n\n#if defined(MOZ_ASAN) || defined(MOZ_VALGRIND)\n#define MOZ_HAVE_MEM_CHECKS 1\n#endif\n\n#if defined(MOZ_ASAN)\n#include <stddef.h>\n\nextern \"C\" {\n  /* These definitions are usually provided through the \n   * sanitizer/asan_interface.h header installed by ASan.\n   */\n  void __asan_poison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n  void __asan_unpoison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  __asan_poison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n}\n#elif defined(MOZ_VALGRIND)\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  VALGRIND_MAKE_MEM_NOACCESS((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_UNDEFINED((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_DEFINED((addr), (size))\n#else\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_DEFINED(addr, size) do {} while(0)\n\n#endif\n\n#endif /* mozilla_MemoryChecking_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/MemoryReporting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Memory reporting infrastructure. */\n\n#ifndef mozilla_MemoryReporting_h\n#define mozilla_MemoryReporting_h\n\n#include <stddef.h>\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This is for functions that are like malloc_usable_size.  Such functions are\n * used for measuring the size of data structures.\n */\ntypedef size_t (*MallocSizeOf)(const void* p);\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\ntypedef size_t (*MozMallocSizeOf)(const void* p);\n\n#endif /* mozilla_MemoryReporting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Move.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* C++11-style, but C++98-usable, \"move references\" implementation. */\n\n#ifndef mozilla_Move_h\n#define mozilla_Move_h\n\nnamespace mozilla {\n\n/*\n * \"Move\" References\n *\n * Some types can be copied much more efficiently if we know the original's\n * value need not be preserved --- that is, if we are doing a \"move\", not a\n * \"copy\". For example, if we have:\n *\n *   Vector<T> u;\n *   Vector<T> v(u);\n *\n * the constructor for v must apply a copy constructor to each element of u ---\n * taking time linear in the length of u. However, if we know we will not need u\n * any more once v has been initialized, then we could initialize v very\n * efficiently simply by stealing u's dynamically allocated buffer and giving it\n * to v --- a constant-time operation, regardless of the size of u.\n *\n * Moves often appear in container implementations. For example, when we append\n * to a vector, we may need to resize its buffer. This entails moving each of\n * its extant elements from the old, smaller buffer to the new, larger buffer.\n * But once the elements have been migrated, we're just going to throw away the\n * old buffer; we don't care if they still have their values. So if the vector's\n * element type can implement \"move\" more efficiently than \"copy\", the vector\n * resizing should by all means use a \"move\" operation. Hash tables also need to\n * be resized.\n *\n * The details of the optimization, and whether it's worth applying, vary from\n * one type to the next. And while some constructor calls are moves, many really\n * are copies, and can't be optimized this way. So we need:\n *\n * 1) a way for a particular invocation of a copy constructor to say that it's\n *    really a move, and that the value of the original isn't important\n *    afterwards (although it must still be safe to destroy); and\n *\n * 2) a way for a type (like Vector) to announce that it can be moved more\n *    efficiently than it can be copied, and provide an implementation of that\n *    move operation.\n *\n * The Move(T&) function takes a reference to a T, and returns a MoveRef<T>\n * referring to the same value; that's 1). A MoveRef<T> is simply a reference\n * to a T, annotated to say that a copy constructor applied to it may move that\n * T, instead of copying it. Finally, a constructor that accepts an MoveRef<T>\n * should perform a more efficient move, instead of a copy, providing 2).\n *\n * So, where we might define a copy constructor for a class C like this:\n *\n *   C(const C& rhs) { ... copy rhs to this ... }\n *\n * we would declare a move constructor like this:\n *\n *   C(MoveRef<C> rhs) { ... move rhs to this ... }\n *\n * And where we might perform a copy like this:\n *\n *   C c2(c1);\n *\n * we would perform a move like this:\n *\n *   C c2(Move(c1))\n *\n * Note that MoveRef<T> implicitly converts to T&, so you can pass a MoveRef<T>\n * to an ordinary copy constructor for a type that doesn't support a special\n * move constructor, and you'll just get a copy.  This means that templates can\n * use Move whenever they know they won't use the original value any more, even\n * if they're not sure whether the type at hand has a specialized move\n * constructor.  If it doesn't, the MoveRef<T> will just convert to a T&, and\n * the ordinary copy constructor will apply.\n *\n * A class with a move constructor can also provide a move assignment operator,\n * which runs this's destructor, and then applies the move constructor to\n * *this's memory. A typical definition:\n *\n *   C& operator=(MoveRef<C> rhs) {\n *     this->~C();\n *     new(this) C(rhs);\n *     return *this;\n *   }\n *\n * With that in place, one can write move assignments like this:\n *\n *   c2 = Move(c1);\n *\n * This destroys c1, moves c1's value to c2, and leaves c1 in an undefined but\n * destructible state.\n *\n * This header file defines MoveRef and Move in the mozilla namespace.  It's up\n * to individual containers to annotate moves as such, by calling Move; and it's\n * up to individual types to define move constructors.\n *\n * One hint: if you're writing a move constructor where the type has members\n * that should be moved themselves, it's much nicer to write this:\n *\n *   C(MoveRef<C> c) : x(Move(c->x)), y(Move(c->y)) { }\n *\n * than the equivalent:\n *\n *   C(MoveRef<C> c) { new(&x) X(Move(c->x)); new(&y) Y(Move(c->y)); }\n *\n * especially since GNU C++ fails to notice that this does indeed initialize x\n * and y, which may matter if they're const.\n */\ntemplate<typename T>\nclass MoveRef\n{\n    T* pointer;\n\n  public:\n    explicit MoveRef(T& t) : pointer(&t) { }\n    T& operator*() const { return *pointer; }\n    T* operator->() const { return pointer; }\n    operator T& () const { return *pointer; }\n};\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(T& t)\n{\n  return MoveRef<T>(t);\n}\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(const T& t)\n{\n  // With some versions of gcc, for a class C, there's an (incorrect) ambiguity\n  // between the C(const C&) constructor and the default C(C&&) C++11 move\n  // constructor, when the constructor is called with a const C& argument.\n  //\n  // This ambiguity manifests with the Move implementation above when Move is\n  // passed const U& for some class U.  Calling Move(const U&) returns a\n  // MoveRef<const U&>, which is then commonly passed to the U constructor,\n  // triggering an implicit conversion to const U&.  gcc doesn't know whether to\n  // call U(const U&) or U(U&&), so it wrongly reports a compile error.\n  //\n  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50442 has since been fixed, so\n  // this is no longer an issue for up-to-date compilers.  But there's no harm\n  // in keeping it around for older compilers, so we might as well.  See also\n  // bug 686280.\n  return MoveRef<T>(const_cast<T&>(t));\n}\n\n/** Swap |t| and |u| using move-construction if possible. */\ntemplate<typename T>\ninline void\nSwap(T& t, T& u)\n{\n  T tmp(Move(t));\n  t = Move(u);\n  u = Move(tmp);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Move_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/NullPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a workaround for compilers which do not support the C++11 nullptr\n * constant.\n */\n\n#ifndef mozilla_NullPtr_h\n#define mozilla_NullPtr_h\n\n#include \"mozilla/Compiler.h\"\n\n#if defined(__clang__)\n#  ifndef __has_extension\n#    define __has_extension __has_feature\n#  endif\n#  if __has_extension(cxx_nullptr)\n#    define MOZ_HAVE_CXX11_NULLPTR\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_NULLPTR\n#    endif\n#  endif\n#elif _MSC_VER >= 1600\n# define MOZ_HAVE_CXX11_NULLPTR\n#endif\n\n/**\n * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal\n * with the correct size to match the size of a pointer on a given platform.\n */\n\n#ifndef MOZ_HAVE_CXX11_NULLPTR\n#  if defined(__GNUC__)\n#    define nullptr __null\n#  elif defined(_WIN64)\n#    define nullptr 0LL\n#  else\n#    define nullptr 0L\n#  endif\n#endif\n\n#endif /* mozilla_NullPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/PodOperations.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Operations for zeroing POD types, arrays, and so on.\n *\n * These operations are preferable to memset, memcmp, and the like because they\n * don't require remembering to multiply by sizeof(T), array lengths, and so on\n * everywhere.\n */\n\n#ifndef mozilla_PodOperations_h\n#define mozilla_PodOperations_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include <string.h>\n\nnamespace mozilla {\n\n/** Set the contents of |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t)\n{\n  memset(t, 0, sizeof(T));\n}\n\n/** Set the contents of |nelem| elements starting at |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t, size_t nelem)\n{\n  /*\n   * This function is often called with 'nelem' small; we use an inline loop\n   * instead of calling 'memset' with a non-constant length.  The compiler\n   * should inline the memset call with constant size, though.\n   */\n  for (T* end = t + nelem; t < end; t++)\n    memset(t, 0, sizeof(T));\n}\n\n/*\n * Arrays implicitly convert to pointers to their first element, which is\n * dangerous when combined with the above PodZero definitions.  Adding an\n * overload for arrays is ambiguous, so we need another identifier.  The\n * ambiguous overload is left to catch mistaken uses of PodZero; if you get a\n * compile error involving PodZero and array types, use PodArrayZero instead.\n */\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N]) MOZ_DELETE;\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N], size_t nelem) MOZ_DELETE;\n\n/** Set the contents of the array |t| to zero. */\ntemplate <class T, size_t N>\nstatic void\nPodArrayZero(T (&t)[N])\n{\n  memset(t, 0, N * sizeof(T));\n}\n\n/**\n * Assign |*src| to |*dst|.  The locations must not be the same and must not\n * overlap.\n */\ntemplate<typename T>\nstatic void\nPodAssign(T* dst, const T* src)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= 1);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= 1);\n  memcpy(reinterpret_cast<char*>(dst), reinterpret_cast<const char*>(src), sizeof(T));\n}\n\n/**\n * Copy |nelem| T elements from |src| to |dst|.  The two memory ranges must not\n * overlap!\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(T* dst, const T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= nelem);\n\n  if (nelem < 128) {\n    /*\n     * Avoid using operator= in this loop, as it may have been\n     * intentionally deleted by the POD type.\n     */\n    for (const T* srcend = src + nelem; src < srcend; src++, dst++)\n      PodAssign(dst, src);\n  } else {\n    memcpy(dst, src, nelem * sizeof(T));\n  }\n}\n\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(volatile T* dst, const volatile T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst,\n                PointerRangeSize(src, static_cast<const volatile T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src,\n                PointerRangeSize(static_cast<const volatile T*>(dst), src) >= nelem);\n\n  /*\n   * Volatile |dst| requires extra work, because it's undefined behavior to\n   * modify volatile objects using the mem* functions.  Just write out the\n   * loops manually, using operator= rather than memcpy for the same reason,\n   * and let the compiler optimize to the extent it can.\n   */\n  for (const volatile T* srcend = src + nelem; src < srcend; src++, dst++)\n    *dst = *src;\n}\n\n/*\n * Copy the contents of the array |src| into the array |dst|, both of size N.\n * The arrays must not overlap!\n */\ntemplate <class T, size_t N>\nstatic void\nPodArrayCopy(T (&dst)[N], const T (&src)[N])\n{\n  PodCopy(dst, src, N);\n}\n\n/**\n * Determine whether the |len| elements at |one| are memory-identical to the\n * |len| elements at |two|.\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static bool\nPodEqual(const T* one, const T* two, size_t len)\n{\n  if (len < 128) {\n    const T* p1end = one + len;\n    const T* p1 = one;\n    const T* p2 = two;\n    for (; p1 < p1end; p1++, p2++) {\n      if (*p1 != *p2)\n        return false;\n    }\n    return true;\n  }\n\n  return !memcmp(one, two, len * sizeof(T));\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_PodOperations_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Poison.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A poison value that can be used to fill a memory space with\n * an address that leads to a safe crash when dereferenced.\n */\n\n#ifndef mozilla_Poison_h\n#define mozilla_Poison_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\nMOZ_BEGIN_EXTERN_C\n\nextern MFBT_DATA uintptr_t gMozillaPoisonValue;\n\n/**\n * @return the poison value.\n */\ninline uintptr_t mozPoisonValue()\n{\n  return gMozillaPoisonValue;\n}\n\n/**\n * Overwrite the memory block of aSize bytes at aPtr with the poison value.\n * aPtr MUST be aligned at a sizeof(uintptr_t) boundary.\n * Only an even number of sizeof(uintptr_t) bytes are overwritten, the last\n * few bytes (if any) is not overwritten.\n */\ninline void mozWritePoison(void* aPtr, size_t aSize)\n{\n  const uintptr_t POISON = mozPoisonValue();\n  char* p = (char*)aPtr;\n  char* limit = p + aSize;\n  MOZ_ASSERT((uintptr_t)aPtr % sizeof(uintptr_t) == 0, \"bad alignment\");\n  MOZ_ASSERT(aSize >= sizeof(uintptr_t), \"poisoning this object has no effect\");\n  for (; p < limit; p += sizeof(uintptr_t)) {\n    *((uintptr_t*)p) = POISON;\n  }\n}\n\n/**\n * Initialize the poison value.\n * This should only be called once.\n */\nextern MFBT_API void mozPoisonValueInit();\n\n/* Values annotated by CrashReporter */\nextern MFBT_DATA uintptr_t gMozillaPoisonBase;\nextern MFBT_DATA uintptr_t gMozillaPoisonSize;\n\nMOZ_END_EXTERN_C\n\n#endif /* mozilla_Poison_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Range.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef mozilla_Range_h\n#define mozilla_Range_h\n\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RangedPtr.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\n// Range<T> is a tuple containing a pointer and a length.\ntemplate <typename T>\nclass Range\n{\n    RangedPtr<T> mStart;\n    RangedPtr<T> mEnd;\n\n    typedef void (Range::* ConvertibleToBool)();\n    void nonNull() {}\n\n  public:\n    Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {}\n    Range(T* p, size_t len)\n      : mStart(p, p, p + len),\n        mEnd(p + len, p, p + len)\n    {}\n\n    RangedPtr<T> start() const { return mStart; }\n    RangedPtr<T> end() const { return mEnd; }\n    size_t length() const { return mEnd - mStart; }\n\n    T& operator[](size_t offset) {\n      return mStart[offset];\n    }\n\n    const T& operator[](size_t offset) const {\n      return mStart[offset];\n    }\n\n    operator ConvertibleToBool() const { return mStart ? &Range::nonNull : 0; }\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Range_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/RangedPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a smart pointer asserted to remain within a range specified at\n * construction.\n */\n\n#ifndef mozilla_RangedPtr_h\n#define mozilla_RangedPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Util.h\"\n\nnamespace mozilla {\n\n/*\n * RangedPtr is a smart pointer restricted to an address range specified at\n * creation.  The pointer (and any smart pointers derived from it) must remain\n * within the range [start, end] (inclusive of end to facilitate use as\n * sentinels).  Dereferencing or indexing into the pointer (or pointers derived\n * from it) must remain within the range [start, end).  All the standard pointer\n * operators are defined on it; in debug builds these operations assert that the\n * range specified at construction is respected.\n *\n * In theory passing a smart pointer instance as an argument can be slightly\n * slower than passing a T* (due to ABI requirements for passing structs versus\n * passing pointers), if the method being called isn't inlined.  If you are in\n * extremely performance-critical code, you may want to be careful using this\n * smart pointer as an argument type.\n *\n * RangedPtr<T> intentionally does not implicitly convert to T*.  Use get() to\n * explicitly convert to T*.  Keep in mind that the raw pointer of course won't\n * implement bounds checking in debug builds.\n */\ntemplate<typename T>\nclass RangedPtr\n{\n    T* ptr;\n\n#ifdef DEBUG\n    T* const rangeStart;\n    T* const rangeEnd;\n#endif\n\n    typedef void (RangedPtr::* ConvertibleToBool)();\n    void nonNull() {}\n\n    void checkSanity() {\n      MOZ_ASSERT(rangeStart <= ptr);\n      MOZ_ASSERT(ptr <= rangeEnd);\n    }\n\n    /* Creates a new pointer for |p|, restricted to this pointer's range. */\n    RangedPtr<T> create(T *p) const {\n#ifdef DEBUG\n      return RangedPtr<T>(p, rangeStart, rangeEnd);\n#else\n      return RangedPtr<T>(p, nullptr, size_t(0));\n#endif\n    }\n\n    uintptr_t asUintptr() const { return uintptr_t(ptr); }\n\n  public:\n    RangedPtr(T* p, T* start, T* end)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(end)\n#endif\n    {\n      MOZ_ASSERT(rangeStart <= rangeEnd);\n      checkSanity();\n    }\n    RangedPtr(T* p, T* start, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(start + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(p, p, length). */\n    RangedPtr(T* p, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(p), rangeEnd(p + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(arr, arr, N). */\n    template<size_t N>\n    RangedPtr(T (&arr)[N])\n      : ptr(arr)\n#ifdef DEBUG\n      , rangeStart(arr), rangeEnd(arr + N)\n#endif\n    {\n      checkSanity();\n    }\n\n    T* get() const {\n      return ptr;\n    }\n\n    operator ConvertibleToBool() const { return ptr ? &RangedPtr::nonNull : 0; }\n\n    /*\n     * You can only assign one RangedPtr into another if the two pointers have\n     * the same valid range:\n     *\n     *   char arr1[] = \"hi\";\n     *   char arr2[] = \"bye\";\n     *   RangedPtr<char> p1(arr1, 2);\n     *   p1 = RangedPtr<char>(arr1 + 1, arr1, arr1 + 2); // works\n     *   p1 = RangedPtr<char>(arr2, 3);                  // asserts\n     */\n    RangedPtr<T>& operator=(const RangedPtr<T>& other) {\n      MOZ_ASSERT(rangeStart == other.rangeStart);\n      MOZ_ASSERT(rangeEnd == other.rangeEnd);\n      ptr = other.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T> operator+(size_t inc) {\n      MOZ_ASSERT(inc <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() + inc * sizeof(T) >= asUintptr());\n      return create(ptr + inc);\n    }\n\n    RangedPtr<T> operator-(size_t dec) {\n      MOZ_ASSERT(dec <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() - dec * sizeof(T) <= asUintptr());\n      return create(ptr - dec);\n    }\n\n    /*\n     * You can assign a raw pointer into a RangedPtr if the raw pointer is\n     * within the range specified at creation.\n     */\n    template <typename U>\n    RangedPtr<T>& operator=(U* p) {\n      *this = create(p);\n      return *this;\n    }\n\n    template <typename U>\n    RangedPtr<T>& operator=(const RangedPtr<U>& p) {\n      MOZ_ASSERT(rangeStart <= p.ptr);\n      MOZ_ASSERT(p.ptr <= rangeEnd);\n      ptr = p.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T>& operator++() {\n      return (*this += 1);\n    }\n\n    RangedPtr<T> operator++(int) {\n      RangedPtr<T> rcp = *this;\n      ++*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator--() {\n      return (*this -= 1);\n    }\n\n    RangedPtr<T> operator--(int) {\n      RangedPtr<T> rcp = *this;\n      --*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator+=(size_t inc) {\n      *this = *this + inc;\n      return *this;\n    }\n\n    RangedPtr<T>& operator-=(size_t dec) {\n      *this = *this - dec;\n      return *this;\n    }\n\n    T& operator[](int index) const {\n      MOZ_ASSERT(size_t(index > 0 ? index : -index) <= size_t(-1) / sizeof(T));\n      return *create(ptr + index);\n    }\n\n    T& operator*() const {\n      return *ptr;\n    }\n\n    template <typename U>\n    bool operator==(const RangedPtr<U>& other) const {\n      return ptr == other.ptr;\n    }\n    template <typename U>\n    bool operator!=(const RangedPtr<U>& other) const {\n      return !(*this == other);\n    }\n\n    template<typename U>\n    bool operator==(const U* u) const {\n      return ptr == u;\n    }\n    template<typename U>\n    bool operator!=(const U* u) const {\n      return !(*this == u);\n    }\n\n    template <typename U>\n    bool operator<(const RangedPtr<U>& other) const {\n      return ptr < other.ptr;\n    }\n    template <typename U>\n    bool operator<=(const RangedPtr<U>& other) const {\n      return ptr <= other.ptr;\n    }\n\n    template <typename U>\n    bool operator>(const RangedPtr<U>& other) const {\n      return ptr > other.ptr;\n    }\n    template <typename U>\n    bool operator>=(const RangedPtr<U>& other) const {\n      return ptr >= other.ptr;\n    }\n\n    size_t operator-(const RangedPtr<T>& other) const {\n      MOZ_ASSERT(ptr >= other.ptr);\n      return PointerRangeSize(other.ptr, ptr);\n    }\n\n  private:\n    RangedPtr() MOZ_DELETE;\n    T* operator&() MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_RangedPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/ReentrancyGuard.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Small helper class for asserting uses of a class are non-reentrant. */\n\n#ifndef mozilla_ReentrancyGuard_h\n#define mozilla_ReentrancyGuard_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n\nnamespace mozilla {\n\n/* Useful for implementing containers that assert non-reentrancy */\nclass ReentrancyGuard\n{\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#ifdef DEBUG\n    bool& entered;\n#endif\n\n  public:\n    template<class T>\n#ifdef DEBUG\n    ReentrancyGuard(T& obj\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : entered(obj.entered)\n#else\n    ReentrancyGuard(T&\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n#endif\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n#ifdef DEBUG\n      MOZ_ASSERT(!entered);\n      entered = true;\n#endif\n    }\n    ~ReentrancyGuard()\n    {\n#ifdef DEBUG\n      entered = false;\n#endif\n    }\n\n  private:\n    ReentrancyGuard(const ReentrancyGuard&) MOZ_DELETE;\n    void operator=(const ReentrancyGuard&) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_ReentrancyGuard_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/RefPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Helpers for defining and using refcounted objects. */\n\n#ifndef mozilla_RefPtr_h\n#define mozilla_RefPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate<typename T> class RefCounted;\ntemplate<typename T> class RefPtr;\ntemplate<typename T> class TemporaryRef;\ntemplate<typename T> class OutParamRef;\ntemplate<typename T> OutParamRef<T> byRef(RefPtr<T>&);\n\n/**\n * RefCounted<T> is a sort of a \"mixin\" for a class T.  RefCounted\n * manages, well, refcounting for T, and because RefCounted is\n * parameterized on T, RefCounted<T> can call T's destructor directly.\n * This means T doesn't need to have a virtual dtor and so doesn't\n * need a vtable.\n *\n * RefCounted<T> is created with refcount == 0.  Newly-allocated\n * RefCounted<T> must immediately be assigned to a RefPtr to make the\n * refcount > 0.  It's an error to allocate and free a bare\n * RefCounted<T>, i.e. outside of the RefPtr machinery.  Attempts to\n * do so will abort DEBUG builds.\n *\n * Live RefCounted<T> have refcount > 0.  The lifetime (refcounts) of\n * live RefCounted<T> are controlled by RefPtr<T> and\n * RefPtr<super/subclass of T>.  Upon a transition from refcounted==1\n * to 0, the RefCounted<T> \"dies\" and is destroyed.  The \"destroyed\"\n * state is represented in DEBUG builds by refcount==0xffffdead.  This\n * state distinguishes use-before-ref (refcount==0) from\n * use-after-destroy (refcount==0xffffdead).\n */\nnamespace detail {\n#ifdef DEBUG\nstatic const int DEAD = 0xffffdead;\n#endif\n\n// This is used WeakPtr.h as well as this file.\nenum RefCountAtomicity\n{\n  AtomicRefCount,\n  NonAtomicRefCount\n};\n\ntemplate<typename T, RefCountAtomicity Atomicity>\nclass RefCounted\n{\n    friend class RefPtr<T>;\n\n  protected:\n    RefCounted() : refCnt(0) { }\n    ~RefCounted() {\n      MOZ_ASSERT(refCnt == detail::DEAD);\n    }\n\n  public:\n    // Compatibility with nsRefPtr.\n    void AddRef() {\n      MOZ_ASSERT(refCnt >= 0);\n      ++refCnt;\n    }\n\n    void Release() {\n      MOZ_ASSERT(refCnt > 0);\n      if (0 == --refCnt) {\n#ifdef DEBUG\n        refCnt = detail::DEAD;\n#endif\n        delete static_cast<T*>(this);\n      }\n    }\n\n    // Compatibility with wtf::RefPtr.\n    void ref() { AddRef(); }\n    void deref() { Release(); }\n    int refCount() const { return refCnt; }\n    bool hasOneRef() const {\n      MOZ_ASSERT(refCnt > 0);\n      return refCnt == 1;\n    }\n\n  private:\n    typename Conditional<Atomicity == AtomicRefCount, Atomic<int>, int>::Type refCnt;\n};\n\n}\n\ntemplate<typename T>\nclass RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>\n{\n  public:\n    ~RefCounted() {\n      static_assert(IsBaseOf<RefCounted, T>::value,\n                    \"T must derive from RefCounted<T>\");\n    }\n};\n\n/**\n * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated\n * reference counter.\n */\ntemplate<typename T>\nclass AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>\n{\n  public:\n    ~AtomicRefCounted() {\n      static_assert(IsBaseOf<AtomicRefCounted, T>::value,\n                    \"T must derive from AtomicRefCounted<T>\");\n    }\n};\n\n/**\n * RefPtr points to a refcounted thing that has AddRef and Release\n * methods to increase/decrease the refcount, respectively.  After a\n * RefPtr<T> is assigned a T*, the T* can be used through the RefPtr\n * as if it were a T*.\n *\n * A RefPtr can forget its underlying T*, which results in the T*\n * being wrapped in a temporary object until the T* is either\n * re-adopted from or released by the temporary.\n */\ntemplate<typename T>\nclass RefPtr\n{\n    // To allow them to use unref()\n    friend class TemporaryRef<T>;\n    friend class OutParamRef<T>;\n\n    struct DontRef {};\n\n  public:\n    RefPtr() : ptr(0) { }\n    RefPtr(const RefPtr& o) : ptr(ref(o.ptr)) {}\n    RefPtr(const TemporaryRef<T>& o) : ptr(o.drop()) {}\n    RefPtr(T* t) : ptr(ref(t)) {}\n\n    template<typename U>\n    RefPtr(const RefPtr<U>& o) : ptr(ref(o.get())) {}\n\n    ~RefPtr() { unref(ptr); }\n\n    RefPtr& operator=(const RefPtr& o) {\n      assign(ref(o.ptr));\n      return *this;\n    }\n    RefPtr& operator=(const TemporaryRef<T>& o) {\n      assign(o.drop());\n      return *this;\n    }\n    RefPtr& operator=(T* t) {\n      assign(ref(t));\n      return *this;\n    }\n\n    template<typename U>\n    RefPtr& operator=(const RefPtr<U>& o) {\n      assign(ref(o.get()));\n      return *this;\n    }\n\n    TemporaryRef<T> forget() {\n      T* tmp = ptr;\n      ptr = 0;\n      return TemporaryRef<T>(tmp, DontRef());\n    }\n\n    T* get() const { return ptr; }\n    operator T*() const { return ptr; }\n    T* operator->() const { return ptr; }\n    T& operator*() const { return *ptr; }\n    template<typename U>\n    operator TemporaryRef<U>() { return TemporaryRef<U>(ptr); }\n\n  private:\n    void assign(T* t) {\n      unref(ptr);\n      ptr = t;\n    }\n\n    T* ptr;\n\n    static MOZ_ALWAYS_INLINE T* ref(T* t) {\n      if (t)\n        t->AddRef();\n      return t;\n    }\n\n    static MOZ_ALWAYS_INLINE void unref(T* t) {\n      if (t)\n        t->Release();\n    }\n};\n\n/**\n * TemporaryRef<T> represents an object that holds a temporary\n * reference to a T.  TemporaryRef objects can't be manually ref'd or\n * unref'd (being temporaries, not lvalues), so can only relinquish\n * references to other objects, or unref on destruction.\n */\ntemplate<typename T>\nclass TemporaryRef\n{\n    // To allow it to construct TemporaryRef from a bare T*\n    friend class RefPtr<T>;\n\n    typedef typename RefPtr<T>::DontRef DontRef;\n\n  public:\n    TemporaryRef(T* t) : ptr(RefPtr<T>::ref(t)) {}\n    TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {}\n\n    template<typename U>\n    TemporaryRef(const TemporaryRef<U>& o) : ptr(o.drop()) {}\n\n    ~TemporaryRef() { RefPtr<T>::unref(ptr); }\n\n    T* drop() const {\n      T* tmp = ptr;\n      ptr = 0;\n      return tmp;\n    }\n\n  private:\n    TemporaryRef(T* t, const DontRef&) : ptr(t) {}\n\n    mutable T* ptr;\n\n    TemporaryRef() MOZ_DELETE;\n    void operator=(const TemporaryRef&) MOZ_DELETE;\n};\n\n/**\n * OutParamRef is a wrapper that tracks a refcounted pointer passed as\n * an outparam argument to a function.  OutParamRef implements COM T**\n * outparam semantics: this requires the callee to AddRef() the T*\n * returned through the T** outparam on behalf of the caller.  This\n * means the caller (through OutParamRef) must Release() the old\n * object contained in the tracked RefPtr.  It's OK if the callee\n * returns the same T* passed to it through the T** outparam, as long\n * as the callee obeys the COM discipline.\n *\n * Prefer returning TemporaryRef<T> from functions over creating T**\n * outparams and passing OutParamRef<T> to T**.  Prefer RefPtr<T>*\n * outparams over T** outparams.\n */\ntemplate<typename T>\nclass OutParamRef\n{\n    friend OutParamRef byRef<T>(RefPtr<T>&);\n\n  public:\n    ~OutParamRef() {\n      RefPtr<T>::unref(refPtr.ptr);\n      refPtr.ptr = tmp;\n    }\n\n    operator T**() { return &tmp; }\n\n  private:\n    OutParamRef(RefPtr<T>& p) : refPtr(p), tmp(p.get()) {}\n\n    RefPtr<T>& refPtr;\n    T* tmp;\n\n    OutParamRef() MOZ_DELETE;\n    OutParamRef& operator=(const OutParamRef&) MOZ_DELETE;\n};\n\n/**\n * byRef cooperates with OutParamRef to implement COM outparam semantics.\n */\ntemplate<typename T>\nOutParamRef<T>\nbyRef(RefPtr<T>& ptr)\n{\n  return OutParamRef<T>(ptr);\n}\n\n} // namespace mozilla\n\n#if 0\n\n// Command line that builds these tests\n//\n//   cp RefPtr.h test.cc && g++ -g -Wall -pedantic -DDEBUG -o test test.cc && ./test\n\nusing namespace mozilla;\n\nstruct Foo : public RefCounted<Foo>\n{\n  Foo() : dead(false) { }\n  ~Foo() {\n    MOZ_ASSERT(!dead);\n    dead = true;\n    numDestroyed++;\n  }\n\n  bool dead;\n  static int numDestroyed;\n};\nint Foo::numDestroyed;\n\nstruct Bar : public Foo { };\n\nTemporaryRef<Foo>\nNewFoo()\n{\n  return RefPtr<Foo>(new Foo());\n}\n\nTemporaryRef<Foo>\nNewBar()\n{\n  return new Bar();\n}\n\nvoid\nGetNewFoo(Foo** f)\n{\n  *f = new Bar();\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetPassedFoo(Foo** f)\n{\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetNewFoo(RefPtr<Foo>* f)\n{\n  *f = new Bar();\n}\n\nvoid\nGetPassedFoo(RefPtr<Foo>* f)\n{}\n\nTemporaryRef<Foo>\nGetNullFoo()\n{\n  return 0;\n}\n\nint\nmain(int argc, char** argv)\n{\n  // This should blow up\n//    Foo* f = new Foo(); delete f;\n\n  MOZ_ASSERT(0 == Foo::numDestroyed);\n  {\n    RefPtr<Foo> f = new Foo();\n    MOZ_ASSERT(f->refCount() == 1);\n  }\n  MOZ_ASSERT(1 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = NewFoo();\n    RefPtr<Foo> f2(NewFoo());\n    MOZ_ASSERT(1 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(3 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> b = NewBar();\n    MOZ_ASSERT(3 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(4 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1;\n    {\n      f1 = new Foo();\n      RefPtr<Foo> f2(f1);\n      RefPtr<Foo> f3 = f2;\n      MOZ_ASSERT(4 == Foo::numDestroyed);\n    }\n    MOZ_ASSERT(4 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(5 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    f.forget();\n    MOZ_ASSERT(6 == Foo::numDestroyed);\n  }\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(byRef(f));\n    MOZ_ASSERT(7 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(8 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(byRef(f));\n    MOZ_ASSERT(8 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(9 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(&f);\n    MOZ_ASSERT(10 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(11 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(&f);\n    MOZ_ASSERT(11 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(12 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = new Bar();\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = GetNullFoo();\n    MOZ_ASSERT(13 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  return 0;\n}\n\n#endif\n\n#endif /* mozilla_RefPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/SHA1.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Simple class for computing SHA1. */\n\n#ifndef mozilla_SHA1_h\n#define mozilla_SHA1_h\n\n#include \"mozilla/Types.h\"\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * This class computes the SHA1 hash of a byte sequence, or of the concatenation\n * of multiple sequences.  For example, computing the SHA1 of two sequences of\n * bytes could be done as follows:\n *\n *   void SHA1(const uint8_t* buf1, uint32_t size1,\n *             const uint8_t* buf2, uint32_t size2,\n *             SHA1Sum::Hash& hash)\n *   {\n *     SHA1Sum s;\n *     s.update(buf1, size1);\n *     s.update(buf2, size2);\n *     s.finish(hash);\n *   }\n *\n * The finish method may only be called once and cannot be followed by calls\n * to update.\n */\nclass SHA1Sum\n{\n    union {\n        uint32_t w[16]; /* input buffer */\n        uint8_t b[64];\n    } u;\n    uint64_t size; /* count of hashed bytes. */\n    unsigned H[22]; /* 5 state variables, 16 tmp values, 1 extra */\n    bool mDone;\n\n  public:\n    MFBT_API SHA1Sum();\n\n    static const size_t HashSize = 20;\n    typedef uint8_t Hash[HashSize];\n\n    /* Add len bytes of dataIn to the data sequence being hashed. */\n    MFBT_API void update(const void* dataIn, uint32_t len);\n\n    /* Compute the final hash of all data into hashOut. */\n    MFBT_API void finish(SHA1Sum::Hash& hashOut);\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_SHA1_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Scoped.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A number of structures to simplify scope-based RAII management. */\n\n#ifndef mozilla_Scoped_h\n#define mozilla_Scoped_h\n\n/*\n * Resource Acquisition Is Initialization is a programming idiom used\n * to write robust code that is able to deallocate resources properly,\n * even in presence of execution errors or exceptions that need to be\n * propagated.  The Scoped* classes defined in this header perform the\n * deallocation of the resource they hold once program execution\n * reaches the end of the scope for which they have been defined.\n *\n * This header provides the following RAII classes:\n *\n * - |ScopedFreePtr| - a container for a pointer, that automatically calls\n *   |free()| at the end of the scope;\n * - |ScopedDeletePtr| - a container for a pointer, that automatically calls\n *   |delete| at the end of the scope;\n * - |ScopedDeleteArray| - a container for a pointer to an array, that\n *   automatically calls |delete[]| at the end of the scope.\n *\n * The general scenario for each of the RAII classes is the following:\n *\n * ScopedClass foo(create_value());\n * // ... In this scope, |foo| is defined. Use |foo.get()| or |foo.rwget()|\n *        to access the value.\n * // ... In case of |return| or |throw|, |foo| is deallocated automatically.\n * // ... If |foo| needs to be returned or stored, use |foo.forget()|\n *\n * Note that the RAII classes defined in this header do _not_ perform any form\n * of reference-counting or garbage-collection. These classes have exactly two\n * behaviors:\n *\n * - if |forget()| has not been called, the resource is always deallocated at\n *   the end of the scope;\n * - if |forget()| has been called, any control on the resource is unbound\n *   and the resource is not deallocated by the class.\n *\n * Extension:\n *\n * In addition, this header provides class |Scoped| and macros |SCOPED_TEMPLATE|\n * and |MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE|  to simplify the definition\n * of RAII classes for other scenarios. These macros have been used to\n * automatically close file descriptors/file handles when reaching the end of\n * the scope, graphics contexts, etc.\n */\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n/*\n * Scoped is a helper to create RAII wrappers\n * Type argument |Traits| is expected to have the following structure:\n *\n *   struct Traits {\n *     // Define the type of the value stored in the wrapper\n *     typedef value_type type;\n *     // Returns the value corresponding to the uninitialized or freed state\n *     const static type empty();\n *     // Release resources corresponding to the wrapped value\n *     // This function is responsible for not releasing an |empty| value\n *     const static void release(type);\n *   }\n */\ntemplate<typename Traits>\nclass Scoped\n{\n  public:\n    typedef typename Traits::type Resource;\n\n    explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : value(Traits::empty())\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    explicit Scoped(const Resource& v\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : value(v)\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~Scoped() {\n      Traits::release(value);\n    }\n\n    // Constant getter\n    operator const Resource&() const { return value; }\n    const Resource& operator->() const { return value; }\n    const Resource& get() const { return value; }\n    // Non-constant getter.\n    Resource& rwget() { return value; }\n\n    /*\n     * Forget the resource.\n     *\n     * Once |forget| has been called, the |Scoped| is neutralized, i.e. it will\n     * have no effect at destruction (unless it is reset to another resource by\n     * |operator=|).\n     *\n     * @return The original resource.\n     */\n    Resource forget() {\n      Resource tmp = value;\n      value = Traits::empty();\n      return tmp;\n    }\n\n    /*\n     * Perform immediate clean-up of this |Scoped|.\n     *\n     * If this |Scoped| is currently empty, this method has no effect.\n     */\n    void dispose() {\n      Traits::release(value);\n      value = Traits::empty();\n    }\n\n    bool operator==(const Resource& other) const {\n      return value == other;\n    }\n\n    /*\n     * Replace the resource with another resource.\n     *\n     * Calling |operator=| has the side-effect of triggering clean-up. If you do\n     * not want to trigger clean-up, you should first invoke |forget|.\n     *\n     * @return this\n     */\n    Scoped<Traits>& operator=(const Resource& other) {\n      return reset(other);\n    }\n    Scoped<Traits>& reset(const Resource& other) {\n      Traits::release(value);\n      value = other;\n      return *this;\n    }\n\n  private:\n    explicit Scoped(const Scoped<Traits>& value) MOZ_DELETE;\n    Scoped<Traits>& operator=(const Scoped<Traits>& value) MOZ_DELETE;\n\n  private:\n    Resource value;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * SCOPED_TEMPLATE defines a templated class derived from Scoped\n * This allows to implement templates such as ScopedFreePtr.\n *\n * @param name The name of the class to define.\n * @param Traits A struct implementing clean-up. See the implementations\n * for more details.\n */\n#define SCOPED_TEMPLATE(name, Traits)                          \\\ntemplate<typename Type>                                        \\\nstruct name : public mozilla::Scoped<Traits<Type> >            \\\n{                                                              \\\n    typedef mozilla::Scoped<Traits<Type> > Super;              \\\n    typedef typename Super::Resource Resource;                 \\\n    name& operator=(Resource ptr) {                            \\\n      Super::operator=(ptr);                                   \\\n      return *this;                                            \\\n    }                                                          \\\n    explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)        \\\n      : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)  \\\n    {}                                                         \\\n    explicit name(Resource ptr                                 \\\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)             \\\n      : Super(ptr MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)   \\\n    {}                                                         \\\n  private:                                                     \\\n    explicit name(name& source) MOZ_DELETE;                    \\\n    name& operator=(name& source) MOZ_DELETE;                  \\\n};\n\n/*\n * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d.\n *\n *   struct S { ... };\n *   ScopedFreePtr<S> foo = malloc(sizeof(S));\n *   ScopedFreePtr<char> bar = strdup(str);\n */\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return nullptr; }\n    static void release(T* ptr) { free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)\n\n/*\n * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.\n *\n *   struct S { ... };\n *   ScopedDeletePtr<S> foo = new S();\n */\ntemplate<typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)\n\n/*\n * ScopedDeleteArray is a RAII wrapper for pointers that need to be delete[]ed.\n *\n *   struct S { ... };\n *   ScopedDeleteArray<S> foo = new S[42];\n */\ntemplate<typename T>\nstruct ScopedDeleteArrayTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete [] ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeleteArray, ScopedDeleteArrayTraits)\n\n/*\n * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped\n * pointers for types with custom deleters; just overload\n * TypeSpecificDelete(T*) in the same namespace as T to call the deleter for\n * type T.\n *\n * @param name The name of the class to define.\n * @param Type A struct implementing clean-up. See the implementations\n * for more details.\n * *param Deleter The function that is used to delete/destroy/free a\n *        non-null value of Type*.\n *\n * Example:\n *\n *   MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \\\n *                                             PR_Close)\n *   ...\n *   {\n *       ScopedPRFileDesc file(PR_OpenFile(...));\n *       ...\n *   } // file is closed with PR_Close here\n */\n#define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \\\ntemplate <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \\\ntypedef ::mozilla::TypeSpecificScopedPointer<Type> name;\n\ntemplate <typename T> void TypeSpecificDelete(T * value);\n\ntemplate <typename T>\nstruct TypeSpecificScopedPointerTraits\n{\n    typedef T* type;\n    const static type empty() { return nullptr; }\n    const static void release(type value)\n    {\n      if (value)\n        TypeSpecificDelete(value);\n    }\n};\n\nSCOPED_TEMPLATE(TypeSpecificScopedPointer, TypeSpecificScopedPointerTraits)\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Scoped_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/SplayTree.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/**\n * A sorted tree with optimal access times, where recently-accessed elements\n * are faster to access again.\n */\n\n#ifndef mozilla_SplayTree_h\n#define mozilla_SplayTree_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\ntemplate<class T, class C>\nclass SplayTree;\n\ntemplate<typename T>\nclass SplayTreeNode\n{\n  public:\n    template<class A, class B>\n    friend class SplayTree;\n\n    SplayTreeNode()\n      : left(nullptr), right(nullptr), parent(nullptr)\n    {}\n\n  private:\n    T* left;\n    T* right;\n    T* parent;\n};\n\n\n/**\n * Class which represents a splay tree.\n * Splay trees are balanced binary search trees for which search, insert and\n * remove are all amortized O(log n), but where accessing a node makes it\n * faster to access that node in the future.\n *\n * T indicates the type of tree elements, Comparator must have a static\n * compare(const T&, const T&) method ordering the elements. The compare\n * method must be free from side effects.\n */\ntemplate<typename T, class Comparator>\nclass SplayTree\n{\n    T* root;\n    T* freeList;\n\n  public:\n    SplayTree()\n      : root(nullptr), freeList(nullptr)\n    {}\n\n    bool empty() const {\n      return !root;\n    }\n\n    bool contains(const T& v)\n    {\n      if (empty())\n        return false;\n\n      T* last = lookup(v);\n      splay(last);\n      checkCoherency(root, nullptr);\n      return Comparator::compare(v, *last) == 0;\n    }\n\n    bool insert(T* v)\n    {\n      MOZ_ASSERT(!contains(*v), \"Duplicate elements are not allowed.\");\n\n      if (!root) {\n        root = v;\n        return true;\n      }\n      T* last = lookup(*v);\n      int cmp = Comparator::compare(*v, *last);\n\n      T** parentPointer = (cmp < 0) ? &last->left : &last->right;\n      MOZ_ASSERT(!*parentPointer);\n      *parentPointer = v;\n      v->parent = last;\n\n      splay(v);\n      checkCoherency(root, nullptr);\n      return true;\n    }\n\n    T* remove(const T& v)\n    {\n      T* last = lookup(v);\n      MOZ_ASSERT(last, \"This tree must contain the element being removed.\");\n      MOZ_ASSERT(Comparator::compare(v, *last) == 0);\n\n      // Splay the tree so that the item to remove is the root.\n      splay(last);\n      MOZ_ASSERT(last == root);\n\n      // Find another node which can be swapped in for the root: either the\n      // rightmost child of the root's left, or the leftmost child of the\n      // root's right.\n      T* swap;\n      T* swapChild;\n      if (root->left) {\n        swap = root->left;\n        while (swap->right)\n          swap = swap->right;\n        swapChild = swap->left;\n      } else if (root->right) {\n        swap = root->right;\n        while (swap->left)\n          swap = swap->left;\n        swapChild = swap->right;\n      } else {\n        T* result = root;\n        root = nullptr;\n        return result;\n      }\n\n      // The selected node has at most one child, in swapChild. Detach it\n      // from the subtree by replacing it with that child.\n      if (swap == swap->parent->left)\n        swap->parent->left = swapChild;\n      else\n        swap->parent->right = swapChild;\n      if (swapChild)\n        swapChild->parent = swap->parent;\n\n      // Make the selected node the new root.\n      root = swap;\n      root->parent = nullptr;\n      root->left = last->left;\n      root->right = last->right;\n      if (root->left) {\n        root->left->parent = root;\n      }\n      if (root->right) {\n        root->right->parent = root;\n      }\n\n      checkCoherency(root, nullptr);\n      return last;\n    }\n\n    T* removeMin()\n    {\n      MOZ_ASSERT(root, \"No min to remove!\");\n\n      T* min = root;\n      while (min->left)\n        min = min->left;\n      return remove(*min);\n    }\n\n  private:\n    /**\n     * Returns the node in this comparing equal to |v|, or a node just greater or\n     * just less than |v| if there is no such node.\n     */\n    T* lookup(const T& v)\n    {\n      MOZ_ASSERT(!empty());\n\n      T* node = root;\n      T* parent;\n      do {\n        parent = node;\n        int c = Comparator::compare(v, *node);\n        if (c == 0)\n          return node;\n        else if (c < 0)\n          node = node->left;\n        else\n          node = node->right;\n      } while (node);\n      return parent;\n    }\n\n    /**\n     * Rotate the tree until |node| is at the root of the tree. Performing\n     * the rotations in this fashion preserves the amortized balancing of\n     * the tree.\n     */\n    void splay(T* node)\n    {\n      MOZ_ASSERT(node);\n\n      while (node != root) {\n        T* parent = node->parent;\n        if (parent == root) {\n          // Zig rotation.\n          rotate(node);\n          MOZ_ASSERT(node == root);\n          return;\n        }\n        T* grandparent = parent->parent;\n        if ((parent->left == node) == (grandparent->left == parent)) {\n          // Zig-zig rotation.\n          rotate(parent);\n          rotate(node);\n        } else {\n          // Zig-zag rotation.\n          rotate(node);\n          rotate(node);\n        }\n      }\n    }\n\n    void rotate(T* node)\n    {\n      // Rearrange nodes so that node becomes the parent of its current\n      // parent, while preserving the sortedness of the tree.\n      T* parent = node->parent;\n      if (parent->left == node) {\n        //     x          y\n        //   y  c  ==>  a  x\n        //  a b           b c\n        parent->left = node->right;\n        if (node->right)\n          node->right->parent = parent;\n        node->right = parent;\n      } else {\n        MOZ_ASSERT(parent->right == node);\n        //   x             y\n        //  a  y   ==>   x  c\n        //    b c       a b\n        parent->right = node->left;\n        if (node->left)\n          node->left->parent = parent;\n        node->left = parent;\n      }\n      node->parent = parent->parent;\n      parent->parent = node;\n      if (T* grandparent = node->parent) {\n        if (grandparent->left == parent)\n          grandparent->left = node;\n        else\n          grandparent->right = node;\n      } else {\n        root = node;\n      }\n    }\n\n    T* checkCoherency(T* node, T* minimum)\n    {\n#ifdef DEBUG\n      MOZ_ASSERT_IF(root, !root->parent);\n      if (!node) {\n        MOZ_ASSERT(!root);\n        return nullptr;\n      }\n      MOZ_ASSERT_IF(!node->parent, node == root);\n      MOZ_ASSERT_IF(minimum, Comparator::compare(*minimum, *node) < 0);\n      if (node->left) {\n        MOZ_ASSERT(node->left->parent == node);\n        T* leftMaximum = checkCoherency(node->left, minimum);\n        MOZ_ASSERT(Comparator::compare(*leftMaximum, *node) < 0);\n      }\n      if (node->right) {\n        MOZ_ASSERT(node->right->parent == node);\n        return checkCoherency(node->right, node);\n      }\n      return node;\n#else\n      return nullptr;\n#endif\n    }\n\n    SplayTree(const SplayTree&) MOZ_DELETE;\n    void operator=(const SplayTree&) MOZ_DELETE;\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_SplayTree_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/TemplateLib.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Reusable template meta-functions on types and compile-time values.  Meta-\n * functions are placed inside the 'tl' namespace to avoid conflict with non-\n * meta functions of the same name (e.g., mozilla::tl::FloorLog2 vs.\n * mozilla::FloorLog2).\n *\n * When constexpr support becomes universal, we should probably use that instead\n * of some of these templates, for simplicity.\n */\n\n#ifndef mozilla_TemplateLib_h\n#define mozilla_TemplateLib_h\n\n#include <limits.h>\n#include <stddef.h>\n\nnamespace mozilla {\n\nnamespace tl {\n\n/** Compute min/max. */\ntemplate<size_t I, size_t J>\nstruct Min\n{\n    static const size_t value = I < J ? I : J;\n};\ntemplate<size_t I, size_t J>\nstruct Max\n{\n    static const size_t value = I > J ? I : J;\n};\n\n/** Compute floor(log2(i)). */\ntemplate<size_t I>\nstruct FloorLog2\n{\n    static const size_t value = 1 + FloorLog2<I / 2>::value;\n};\ntemplate<> struct FloorLog2<0> { /* Error */ };\ntemplate<> struct FloorLog2<1> { static const size_t value = 0; };\n\n/** Compute ceiling(log2(i)). */\ntemplate<size_t I>\nstruct CeilingLog2\n{\n    static const size_t value = FloorLog2<2 * I - 1>::value;\n};\n\n/** Round up to the nearest power of 2. */\ntemplate<size_t I>\nstruct RoundUpPow2\n{\n    static const size_t value = size_t(1) << CeilingLog2<I>::value;\n};\ntemplate<>\nstruct RoundUpPow2<0>\n{\n    static const size_t value = 1;\n};\n\n/** Compute the number of bits in the given unsigned type. */\ntemplate<typename T>\nstruct BitSize\n{\n    static const size_t value = sizeof(T) * CHAR_BIT;\n};\n\n/**\n * Produce an N-bit mask, where N <= BitSize<size_t>::value.  Handle the\n * language-undefined edge case when N = BitSize<size_t>::value.\n */\ntemplate<size_t N>\nstruct NBitMask\n{\n    // Assert the precondition.  On success this evaluates to 0.  Otherwise it\n    // triggers divide-by-zero at compile time: a guaranteed compile error in\n    // C++11, and usually one in C++98.  Add this value to |value| to assure\n    // its computation.\n    static const size_t checkPrecondition = 0 / size_t(N < BitSize<size_t>::value);\n    static const size_t value = (size_t(1) << N) - 1 + checkPrecondition;\n};\ntemplate<>\nstruct NBitMask<BitSize<size_t>::value>\n{\n    static const size_t value = size_t(-1);\n};\n\n/**\n * For the unsigned integral type size_t, compute a mask M for N such that\n * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t)\n */\ntemplate<size_t N>\nstruct MulOverflowMask\n{\n    static const size_t value =\n      ~NBitMask<BitSize<size_t>::value - CeilingLog2<N>::value>::value;\n};\ntemplate<> struct MulOverflowMask<0> { /* Error */ };\ntemplate<> struct MulOverflowMask<1> { static const size_t value = 0; };\n\n} // namespace tl\n\n} // namespace mozilla\n\n#endif /* mozilla_TemplateLib_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/ThreadLocal.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cross-platform lightweight thread local data wrappers. */\n\n#ifndef mozilla_ThreadLocal_h\n#define mozilla_ThreadLocal_h\n\n#if defined(XP_WIN)\n// This file will get included in any file that wants to add a profiler mark.\n// In order to not bring <windows.h> together we could include windef.h and\n// winbase.h which are sufficient to get the prototypes for the Tls* functions.\n// # include <windef.h>\n// # include <winbase.h>\n// Unfortunately, even including these headers causes us to add a bunch of ugly\n// stuff to our namespace e.g #define CreateEvent CreateEventW\nextern \"C\" {\n__declspec(dllimport) void* __stdcall TlsGetValue(unsigned long);\n__declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void*);\n__declspec(dllimport) unsigned long __stdcall TlsAlloc();\n}\n#else\n#  include <pthread.h>\n#  include <signal.h>\n#endif\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n// sig_safe_t denotes an atomic type which can be read or stored in a single\n// instruction.  This means that data of this type is safe to be manipulated\n// from a signal handler, or other similar asynchronous execution contexts.\n#if defined(XP_WIN)\ntypedef unsigned long sig_safe_t;\n#else\ntypedef sig_atomic_t sig_safe_t;\n#endif\n\n/*\n * Thread Local Storage helpers.\n *\n * Usage:\n *\n * Only static-storage-duration (e.g. global variables, or static class members)\n * objects of this class should be instantiated. This class relies on\n * zero-initialization, which is implicit for static-storage-duration objects.\n * It doesn't have a custom default constructor, to avoid static initializers.\n *\n * API usage:\n *\n * // Create a TLS item\n * mozilla::ThreadLocal<int> tlsKey;\n * if (!tlsKey.init()) {\n *   // deal with the error\n * }\n *\n * // Set the TLS value\n * tlsKey.set(123);\n *\n * // Get the TLS value\n * int value = tlsKey.get();\n */\ntemplate<typename T>\nclass ThreadLocal\n{\n#if defined(XP_WIN)\n    typedef unsigned long key_t;\n#else\n    typedef pthread_key_t key_t;\n#endif\n\n    union Helper {\n      void* ptr;\n      T value;\n    };\n\n  public:\n    MOZ_WARN_UNUSED_RESULT inline bool init();\n\n    inline T get() const;\n\n    inline void set(const T value);\n\n    bool initialized() const {\n      return inited;\n    }\n\n  private:\n    key_t key;\n    bool inited;\n};\n\ntemplate<typename T>\ninline bool\nThreadLocal<T>::init()\n{\n  static_assert(sizeof(T) <= sizeof(void*),\n                \"mozilla::ThreadLocal can't be used for types larger than \"\n                \"a pointer\");\n  MOZ_ASSERT(!initialized());\n#ifdef XP_WIN\n  key = TlsAlloc();\n  inited = key != 0xFFFFFFFFUL; // TLS_OUT_OF_INDEXES\n#else\n  inited = !pthread_key_create(&key, nullptr);\n#endif\n  return inited;\n}\n\ntemplate<typename T>\ninline T\nThreadLocal<T>::get() const\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n#ifdef XP_WIN\n  h.ptr = TlsGetValue(key);\n#else\n  h.ptr = pthread_getspecific(key);\n#endif\n  return h.value;\n}\n\ntemplate<typename T>\ninline void\nThreadLocal<T>::set(const T value)\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n  h.value = value;\n  bool succeeded;\n#ifdef XP_WIN\n  succeeded = TlsSetValue(key, h.ptr);\n#else\n  succeeded = !pthread_setspecific(key, h.ptr);\n#endif\n  if (!succeeded)\n    MOZ_CRASH();\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_ThreadLocal_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/TypeTraits.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Template-based metaprogramming and type-testing facilities. */\n\n#ifndef mozilla_TypeTraits_h\n#define mozilla_TypeTraits_h\n\n/*\n * These traits are approximate copies of the traits and semantics from C++11's\n * <type_traits> header.  Don't add traits not in that header!  When all\n * platforms provide that header, we can convert all users and remove this one.\n */\n\n#include <wchar.h>\n\nnamespace mozilla {\n\n/* Forward declarations. */\n\ntemplate<typename> struct RemoveCV;\n\n/* 20.9.3 Helper classes [meta.help] */\n\n/**\n * Helper class used as a base for various type traits, exposed publicly\n * because <type_traits> exposes it as well.\n */\ntemplate<typename T, T Value>\nstruct IntegralConstant\n{\n    static const T value = Value;\n    typedef T ValueType;\n    typedef IntegralConstant<T, Value> Type;\n};\n\n/** Convenient aliases. */\ntypedef IntegralConstant<bool, true> TrueType;\ntypedef IntegralConstant<bool, false> FalseType;\n\n/* 20.9.4 Unary type traits [meta.unary] */\n\n/* 20.9.4.1 Primary type categories [meta.unary.cat] */\n\nnamespace detail {\n\ntemplate <typename T>\nstruct IsIntegralHelper : FalseType {};\n\ntemplate<> struct IsIntegralHelper<char>               : TrueType {};\ntemplate<> struct IsIntegralHelper<signed char>        : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned char>      : TrueType {};\ntemplate<> struct IsIntegralHelper<short>              : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned short>     : TrueType {};\ntemplate<> struct IsIntegralHelper<int>                : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned int>       : TrueType {};\ntemplate<> struct IsIntegralHelper<long>               : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long>      : TrueType {};\ntemplate<> struct IsIntegralHelper<long long>          : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long long> : TrueType {};\ntemplate<> struct IsIntegralHelper<bool>               : TrueType {};\ntemplate<> struct IsIntegralHelper<wchar_t>            : TrueType {};\n\n} /* namespace detail */\n\n/**\n * IsIntegral determines whether a type is an integral type.\n *\n * mozilla::IsIntegral<int>::value is true;\n * mozilla::IsIntegral<unsigned short>::value is true;\n * mozilla::IsIntegral<const long>::value is true;\n * mozilla::IsIntegral<int*>::value is false;\n * mozilla::IsIntegral<double>::value is false;\n *\n * Note that the behavior of IsIntegral on char16_t and char32_t is\n * unspecified.\n */\ntemplate<typename T>\nstruct IsIntegral : detail::IsIntegralHelper<typename RemoveCV<T>::Type>\n{};\n\ntemplate<typename T, typename U>\nstruct IsSame;\n\nnamespace detail {\n\ntemplate<typename T>\nstruct IsFloatingPointHelper\n  : IntegralConstant<bool,\n                     IsSame<T, float>::value ||\n                     IsSame<T, double>::value ||\n                     IsSame<T, long double>::value>\n{};\n\n} // namespace detail\n\n/**\n * IsFloatingPoint determines whether a type is a floating point type (float,\n * double, long double).\n *\n * mozilla::IsFloatingPoint<int>::value is false;\n * mozilla::IsFloatingPoint<const float>::value is true;\n * mozilla::IsFloatingPoint<long double>::value is true;\n * mozilla::IsFloatingPoint<double*>::value is false.\n */\ntemplate<typename T>\nstruct IsFloatingPoint\n  : detail::IsFloatingPointHelper<typename RemoveCV<T>::Type>\n{};\n\n/**\n * IsPointer determines whether a type is a pointer type (but not a pointer-to-\n * member type).\n *\n * mozilla::IsPointer<struct S*>::value is true;\n * mozilla::IsPointer<int**>::value is true;\n * mozilla::IsPointer<void (*)(void)>::value is true;\n * mozilla::IsPointer<int>::value is false;\n * mozilla::IsPointer<struct S>::value is false.\n */\ntemplate<typename T>\nstruct IsPointer : FalseType {};\n\ntemplate<typename T>\nstruct IsPointer<T*> : TrueType {};\n\nnamespace detail {\n\n// __is_enum is a supported extension across all of our supported compilers.\ntemplate<typename T>\nstruct IsEnumHelper\n  : IntegralConstant<bool, __is_enum(T)>\n{};\n\n} // namespace detail\n\n/**\n * IsEnum determines whether a type is an enum type.\n *\n * mozilla::IsEnum<enum S>::value is true;\n * mozilla::IsEnum<enum S*>::value is false;\n * mozilla::IsEnum<int>::value is false;\n */\ntemplate<typename T>\nstruct IsEnum\n  : detail::IsEnumHelper<typename RemoveCV<T>::Type>\n{};\n\n/* 20.9.4.2 Composite type traits [meta.unary.comp] */\n\n/**\n * IsArithmetic determines whether a type is arithmetic.  A type is arithmetic\n * iff it is an integral type or a floating point type.\n *\n * mozilla::IsArithmetic<int>::value is true;\n * mozilla::IsArithmetic<double>::value is true;\n * mozilla::IsArithmetic<long double*>::value is false.\n */\ntemplate<typename T>\nstruct IsArithmetic\n  : IntegralConstant<bool, IsIntegral<T>::value || IsFloatingPoint<T>::value>\n{};\n\n/* 20.9.4.3 Type properties [meta.unary.prop] */\n\n/**\n * IsConst determines whether a type is const or not.\n *\n * mozilla::IsConst<int>::value is false;\n * mozilla::IsConst<void* const>::value is true;\n * mozilla::IsConst<const char*>::value is false.\n */\ntemplate<typename T>\nstruct IsConst : FalseType {};\n\ntemplate<typename T>\nstruct IsConst<const T> : TrueType {};\n\n/**\n * IsVolatile determines whether a type is volatile or not.\n *\n * mozilla::IsVolatile<int>::value is false;\n * mozilla::IsVolatile<void* volatile>::value is true;\n * mozilla::IsVolatile<volatile char*>::value is false.\n */\ntemplate<typename T>\nstruct IsVolatile : FalseType {};\n\ntemplate<typename T>\nstruct IsVolatile<volatile T> : TrueType {};\n\n/**\n * Traits class for identifying POD types.  Until C++11 there's no automatic\n * way to detect PODs, so for the moment this is done manually.  Users may\n * define specializations of this class that inherit from mozilla::TrueType and\n * mozilla::FalseType (or equivalently mozilla::IntegralConstant<bool, true or\n * false>, or conveniently from mozilla::IsPod for composite types) as needed to\n * ensure correct IsPod behavior.\n */\ntemplate<typename T>\nstruct IsPod : public FalseType {};\n\ntemplate<> struct IsPod<char>               : TrueType {};\ntemplate<> struct IsPod<signed char>        : TrueType {};\ntemplate<> struct IsPod<unsigned char>      : TrueType {};\ntemplate<> struct IsPod<short>              : TrueType {};\ntemplate<> struct IsPod<unsigned short>     : TrueType {};\ntemplate<> struct IsPod<int>                : TrueType {};\ntemplate<> struct IsPod<unsigned int>       : TrueType {};\ntemplate<> struct IsPod<long>               : TrueType {};\ntemplate<> struct IsPod<unsigned long>      : TrueType {};\ntemplate<> struct IsPod<long long>          : TrueType {};\ntemplate<> struct IsPod<unsigned long long> : TrueType {};\ntemplate<> struct IsPod<bool>               : TrueType {};\ntemplate<> struct IsPod<float>              : TrueType {};\ntemplate<> struct IsPod<double>             : TrueType {};\ntemplate<> struct IsPod<wchar_t>            : TrueType {};\ntemplate<typename T> struct IsPod<T*>       : TrueType {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsSignedHelper;\n\ntemplate<typename T>\nstruct IsSignedHelper<T, true> : TrueType {};\n\ntemplate<typename T>\nstruct IsSignedHelper<T, false>\n  : IntegralConstant<bool, IsArithmetic<T>::value && T(-1) < T(1)>\n{};\n\n} // namespace detail\n\n/**\n * IsSigned determines whether a type is a signed arithmetic type.  |char| is\n * considered a signed type if it has the same representation as |signed char|.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsSigned<int>::value is true;\n * mozilla::IsSigned<const unsigned int>::value is false;\n * mozilla::IsSigned<unsigned char>::value is false;\n * mozilla::IsSigned<float>::value is true.\n */\ntemplate<typename T>\nstruct IsSigned : detail::IsSignedHelper<T> {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsUnsignedHelper;\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, true> : FalseType {};\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, false>\n  : IntegralConstant<bool,\n                     IsArithmetic<T>::value &&\n                     (IsSame<typename RemoveCV<T>::Type, bool>::value ||\n                      T(1) < T(-1))>\n{};\n\n} // namespace detail\n\n/**\n * IsUnsigned determines whether a type is an unsigned arithmetic type.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsUnsigned<int>::value is false;\n * mozilla::IsUnsigned<const unsigned int>::value is true;\n * mozilla::IsUnsigned<unsigned char>::value is true;\n * mozilla::IsUnsigned<float>::value is false.\n */\ntemplate<typename T>\nstruct IsUnsigned : detail::IsUnsignedHelper<T> {};\n\n/* 20.9.5 Type property queries [meta.unary.prop.query] */\n\n/* 20.9.6 Relationships between types [meta.rel] */\n\n/**\n * IsSame tests whether two types are the same type.\n *\n * mozilla::IsSame<int, int>::value is true;\n * mozilla::IsSame<int*, int*>::value is true;\n * mozilla::IsSame<int, unsigned int>::value is false;\n * mozilla::IsSame<void, void>::value is true;\n * mozilla::IsSame<const int, int>::value is false;\n * mozilla::IsSame<struct S, struct S>::value is true.\n */\ntemplate<typename T, typename U>\nstruct IsSame : FalseType {};\n\ntemplate<typename T>\nstruct IsSame<T, T> : TrueType {};\n\nnamespace detail {\n\n// The trickery used to implement IsBaseOf here makes it possible to use it for\n// the cases of private and multiple inheritance.  This code was inspired by the\n// sample code here:\n//\n// http://stackoverflow.com/questions/2910979/how-is-base-of-works\ntemplate<class Base, class Derived>\nstruct BaseOfHelper\n{\n  public:\n    operator Base*() const;\n    operator Derived*();\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base, const Derived>\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base&, Derived&> : FalseType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, Type> : TrueType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, const Type> : TrueType {};\n\n} /* namespace detail */\n\n/*\n * IsBaseOf allows to know whether a given class is derived from another.\n *\n * Consider the following class definitions:\n *\n *   class A {};\n *   class B : public A {};\n *   class C {};\n *\n * mozilla::IsBaseOf<A, B>::value is true;\n * mozilla::IsBaseOf<A, C>::value is false;\n */\ntemplate<class Base, class Derived>\nstruct IsBaseOf\n  : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>\n{};\n\nnamespace detail {\n\ntemplate<typename From, typename To>\nstruct ConvertibleTester\n{\n  private:\n    static From create();\n\n    template<typename From1, typename To1>\n    static char test(To to);\n\n    template<typename From1, typename To1>\n    static int test(...);\n\n  public:\n    static const bool value =\n      sizeof(test<From, To>(create())) == sizeof(char);\n};\n\n} // namespace detail\n\n/**\n * IsConvertible determines whether a value of type From will implicitly convert\n * to a value of type To.  For example:\n *\n *   struct A {};\n *   struct B : public A {};\n *   struct C {};\n *\n * mozilla::IsConvertible<A, A>::value is true;\n * mozilla::IsConvertible<A*, A*>::value is true;\n * mozilla::IsConvertible<B, A>::value is true;\n * mozilla::IsConvertible<B*, A*>::value is true;\n * mozilla::IsConvertible<C, A>::value is false;\n * mozilla::IsConvertible<A, C>::value is false;\n * mozilla::IsConvertible<A*, C*>::value is false;\n * mozilla::IsConvertible<C*, A*>::value is false.\n *\n * For obscure reasons, you can't use IsConvertible when the types being tested\n * are related through private inheritance, and you'll get a compile error if\n * you try.  Just don't do it!\n */\ntemplate<typename From, typename To>\nstruct IsConvertible\n  : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>\n{};\n\n/* 20.9.7 Transformations between types [meta.trans] */\n\n/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */\n\n/**\n * RemoveConst removes top-level const qualifications on a type.\n *\n * mozilla::RemoveConst<int>::Type is int;\n * mozilla::RemoveConst<const int>::Type is int;\n * mozilla::RemoveConst<const int*>::Type is const int*;\n * mozilla::RemoveConst<int* const>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveConst\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveConst<const T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveVolatile removes top-level volatile qualifications on a type.\n *\n * mozilla::RemoveVolatile<int>::Type is int;\n * mozilla::RemoveVolatile<volatile int>::Type is int;\n * mozilla::RemoveVolatile<volatile int*>::Type is volatile int*;\n * mozilla::RemoveVolatile<int* volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveVolatile\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveVolatile<volatile T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveCV removes top-level const and volatile qualifications on a type.\n *\n * mozilla::RemoveCV<int>::Type is int;\n * mozilla::RemoveCV<const int>::Type is int;\n * mozilla::RemoveCV<volatile int>::Type is int;\n * mozilla::RemoveCV<int* const volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveCV\n{\n    typedef typename RemoveConst<typename RemoveVolatile<T>::Type>::Type Type;\n};\n\n/* 20.9.7.2 Reference modifications [meta.trans.ref] */\n\n/* 20.9.7.3 Sign modifications [meta.trans.sign] */\n\ntemplate<bool B, typename T = void>\nstruct EnableIf;\n\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional;\n\nnamespace detail {\n\ntemplate<bool MakeConst, typename T>\nstruct WithC : Conditional<MakeConst, const T, T>\n{};\n\ntemplate<bool MakeVolatile, typename T>\nstruct WithV : Conditional<MakeVolatile, volatile T, T>\n{};\n\n\ntemplate<bool MakeConst, bool MakeVolatile, typename T>\nstruct WithCV : WithC<MakeConst, typename WithV<MakeVolatile, T>::Type>\n{};\n\ntemplate<typename T>\nstruct CorrespondingSigned;\n\ntemplate<>\nstruct CorrespondingSigned<char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned short> { typedef short Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned int> { typedef int Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long> { typedef long Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long long> { typedef long long Type; };\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsSignedIntegerType = IsSigned<CVRemoved>::value &&\n                                    !IsSame<char, CVRemoved>::value>\nstruct MakeSigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingSigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeSigned produces the corresponding signed integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already a signed integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an unsigned integer type, the signed variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the integral type of the same size as T, with the lowest rank,\n * with T's const/volatile qualifiers, is produced.  (This basically only acts\n * to produce signed char when T = char.)\n *\n * mozilla::MakeSigned<unsigned long>::Type is signed long;\n * mozilla::MakeSigned<volatile int>::Type is volatile int;\n * mozilla::MakeSigned<const unsigned short>::Type is const signed short;\n * mozilla::MakeSigned<const char>::Type is const signed char;\n * mozilla::MakeSigned<bool> is an error;\n * mozilla::MakeSigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeSigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeSigned<T>\n            >::Type\n{};\n\nnamespace detail {\n\ntemplate<typename T>\nstruct CorrespondingUnsigned;\n\ntemplate<>\nstruct CorrespondingUnsigned<char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<signed char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<short> { typedef unsigned short Type; };\ntemplate<>\nstruct CorrespondingUnsigned<int> { typedef unsigned int Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long> { typedef unsigned long Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long long> { typedef unsigned long long Type; };\n\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsUnsignedIntegerType = IsUnsigned<CVRemoved>::value &&\n                                      !IsSame<char, CVRemoved>::value>\nstruct MakeUnsigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingUnsigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeUnsigned produces the corresponding unsigned integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already an unsigned integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an signed integer type, the unsigned variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the unsigned integral type of the same size as T, with the lowest\n * rank, with T's const/volatile qualifiers, is produced.  (This basically only\n * acts to produce unsigned char when T = char.)\n *\n * mozilla::MakeUnsigned<signed long>::Type is unsigned long;\n * mozilla::MakeUnsigned<volatile unsigned int>::Type is volatile unsigned int;\n * mozilla::MakeUnsigned<const signed short>::Type is const unsigned short;\n * mozilla::MakeUnsigned<const char>::Type is const unsigned char;\n * mozilla::MakeUnsigned<bool> is an error;\n * mozilla::MakeUnsigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeUnsigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeUnsigned<T>\n            >::Type\n{};\n\n/* 20.9.7.4 Array modifications [meta.trans.arr] */\n\n/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */\n\n/* 20.9.7.6 Other transformations [meta.trans.other] */\n\n/**\n * EnableIf is a struct containing a typedef of T if and only if B is true.\n *\n * mozilla::EnableIf<true, int>::Type is int;\n * mozilla::EnableIf<false, int>::Type is a compile-time error.\n *\n * Use this template to implement SFINAE-style (Substitution Failure Is not An\n * Error) requirements.  For example, you might use it to impose a restriction\n * on a template parameter:\n *\n *   template<typename T>\n *   class PodVector // vector optimized to store POD (memcpy-able) types\n *   {\n *      EnableIf<IsPod<T>::value, T>::Type* vector;\n *      size_t length;\n *      ...\n *   };\n */\ntemplate<bool B, typename T>\nstruct EnableIf\n{};\n\ntemplate<typename T>\nstruct EnableIf<true, T>\n{\n    typedef T Type;\n};\n\n/**\n * Conditional selects a class between two, depending on a given boolean value.\n *\n * mozilla::Conditional<true, A, B>::Type is A;\n * mozilla::Conditional<false, A, B>::Type is B;\n */\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional\n{\n    typedef A Type;\n};\n\ntemplate<class A, class B>\nstruct Conditional<false, A, B>\n{\n    typedef B Type;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_TypeTraits_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/TypedEnum.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Macros to emulate C++11 typed enums and enum classes. */\n\n#ifndef mozilla_TypedEnum_h\n#define mozilla_TypedEnum_h\n\n#include \"mozilla/Attributes.h\"\n\n#if defined(__cplusplus)\n\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_strong_enums)\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)\n#      define MOZ_HAVE_CXX11_ENUM_TYPE\n#      define MOZ_HAVE_CXX11_STRONG_ENUMS\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1400\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#  endif\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#endif\n\n/**\n * MOZ_ENUM_TYPE specifies the underlying numeric type for an enum.  It's\n * specified by placing MOZ_ENUM_TYPE(type) immediately after the enum name in\n * its declaration, and before the opening curly brace, like\n *\n *   enum MyEnum MOZ_ENUM_TYPE(uint16_t)\n *   {\n *     A,\n *     B = 7,\n *     C\n *   };\n *\n * In supporting compilers, the macro will expand to \": uint16_t\".  The\n * compiler will allocate exactly two bytes for MyEnum and will require all\n * enumerators to have values between 0 and 65535.  (Thus specifying \"B =\n * 100000\" instead of \"B = 7\" would fail to compile.)  In old compilers the\n * macro expands to the empty string, and the underlying type is generally\n * undefined.\n */\n#ifdef MOZ_HAVE_CXX11_ENUM_TYPE\n#  define MOZ_ENUM_TYPE(type)   : type\n#else\n#  define MOZ_ENUM_TYPE(type)   /* no support */\n#endif\n\n/**\n * MOZ_BEGIN_ENUM_CLASS and MOZ_END_ENUM_CLASS provide access to the\n * strongly-typed enumeration feature of C++11 (\"enum class\").  If supported\n * by the compiler, an enum defined using these macros will not be implicitly\n * converted to any other type, and its enumerators will be scoped using the\n * enumeration name.  Place MOZ_BEGIN_ENUM_CLASS(EnumName, type) in place of\n * \"enum EnumName {\", and MOZ_END_ENUM_CLASS(EnumName) in place of the closing\n * \"};\".  For example,\n *\n *   MOZ_BEGIN_ENUM_CLASS(Enum, int32_t)\n *     A,\n *     B = 6\n *   MOZ_END_ENUM_CLASS(Enum)\n *\n * This will make \"Enum::A\" and \"Enum::B\" appear in the global scope, but \"A\"\n * and \"B\" will not.  In compilers that support C++11 strongly-typed\n * enumerations, implicit conversions of Enum values to numeric types will\n * fail.  In other compilers, Enum itself will actually be defined as a class,\n * and some implicit conversions will fail while others will succeed.\n *\n * The type argument specifies the underlying type for the enum where\n * supported, as with MOZ_ENUM_TYPE().  For simplicity, it is currently\n * mandatory.  As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do\n * not support it.\n *\n * MOZ_{BEGIN,END}_ENUM_CLASS doesn't work for defining enum classes nested\n * inside classes.  To define an enum class nested inside another class, use\n * MOZ_{BEGIN,END}_NESTED_ENUM_CLASS, and place a MOZ_FINISH_NESTED_ENUM_CLASS\n * in namespace scope to handle bits that can only be implemented with\n * namespace-scoped code.  For example:\n *\n *   class FooBar {\n *\n *     MOZ_BEGIN_NESTED_ENUM_CLASS(Enum, int32_t)\n *       A,\n *       B = 6\n *     MOZ_END_NESTED_ENUM_CLASS(Enum)\n *\n *   };\n *\n *   MOZ_FINISH_NESTED_ENUM_CLASS(FooBar::Enum)\n */\n#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS)\n  /*\n   * All compilers that support strong enums also support an explicit\n   * underlying type, so no extra check is needed.\n   */\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     enum class Name : type {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) /* nothing */\n#else\n   /**\n    * We need Name to both name a type, and scope the provided enumerator\n    * names.  Namespaces and classes both provide scoping, but namespaces\n    * aren't types, so we need to use a class that wraps the enum values.  We\n    * have an implicit conversion from the inner enum type to the class, so\n    * statements like\n    *\n    *   Enum x = Enum::A;\n    *\n    * will still work.  We need to define an implicit conversion from the class\n    * to the inner enum as well, so that (for instance) switch statements will\n    * work.  This means that the class can be implicitly converted to a numeric\n    * value as well via the enum type, since C++ allows an implicit\n    * user-defined conversion followed by a standard conversion to still be\n    * implicit.\n    *\n    * We have an explicit constructor from int defined, so that casts like\n    * (Enum)7 will still work.  We also have a zero-argument constructor with\n    * no arguments, so declaration without initialization (like \"Enum foo;\")\n    * will work.\n    *\n    * Additionally, we'll delete as many operators as possible for the inner\n    * enum type, so statements like this will still fail:\n    *\n    *   f(5 + Enum::B); // deleted operator+\n    *\n    * But we can't prevent things like this, because C++ doesn't allow\n    * overriding conversions or assignment operators for enums:\n    *\n    *   int x = Enum::A;\n    *   int f()\n    *   {\n    *     return Enum::A;\n    *   }\n    */\\\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     class Name \\\n     { \\\n       public: \\\n         enum Enum MOZ_ENUM_TYPE(type) \\\n         {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n         }; \\\n         Name() {} \\\n         Name(Enum aEnum) : mEnum(aEnum) {} \\\n         explicit Name(int num) : mEnum((Enum)num) {} \\\n         operator Enum() const { return mEnum; } \\\n       private: \\\n         Enum mEnum; \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) \\\n     inline int operator+(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator-(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator*(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator*(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator/(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator/(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator%(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator%(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator++(Name::Enum&) MOZ_DELETE; \\\n     inline int operator++(Name::Enum&, int) MOZ_DELETE; \\\n     inline int& operator--(Name::Enum&) MOZ_DELETE; \\\n     inline int operator--(Name::Enum&, int) MOZ_DELETE; \\\n     inline bool operator==(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator==(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator!=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!(const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline bool operator||(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator||(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline int operator~(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator|(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator|(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator^(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator^(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator<<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator<<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator>>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator>>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int& operator+=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator-=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator*=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator/=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator%=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator&=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator|=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator^=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator<<=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator>>=(int&, const Name::Enum&) MOZ_DELETE;\n#endif\n#  define MOZ_BEGIN_ENUM_CLASS(Name, type) MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type)\n#  define MOZ_END_ENUM_CLASS(Name) \\\n     MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     MOZ_FINISH_NESTED_ENUM_CLASS(Name)\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_TypedEnum_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Types.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt foundational types and macros. */\n\n#ifndef mozilla_Types_h\n#define mozilla_Types_h\n\n/*\n * This header must be valid C and C++, includable by code embedding either\n * SpiderMonkey or Gecko.\n */\n\n/* Expose all <stdint.h> types and size_t. */\n#include <stddef.h>\n#include <stdint.h>\n\n/* Implement compiler and linker macros needed for APIs. */\n\n/*\n * MOZ_EXPORT is used to declare and define a symbol or type which is externally\n * visible to users of the current library.  It encapsulates various decorations\n * needed to properly export the method's symbol.\n *\n *   api.h:\n *     extern MOZ_EXPORT int MeaningOfLife(void);\n *     extern MOZ_EXPORT int LuggageCombination;\n *\n *   api.c:\n *     int MeaningOfLife(void) { return 42; }\n *     int LuggageCombination = 12345;\n *\n * If you are merely sharing a method across files, just use plain |extern|.\n * These macros are designed for use by library interfaces -- not for normal\n * methods or data used cross-file.\n */\n#if defined(WIN32) || defined(XP_OS2)\n#  define MOZ_EXPORT   __declspec(dllexport)\n#else /* Unix */\n#  ifdef HAVE_VISIBILITY_ATTRIBUTE\n#    define MOZ_EXPORT       __attribute__((visibility(\"default\")))\n#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n#    define MOZ_EXPORT      __global\n#  else\n#    define MOZ_EXPORT /* nothing */\n#  endif\n#endif\n\n\n/*\n * Whereas implementers use MOZ_EXPORT to declare and define library symbols,\n * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the\n * implementer of the library will expose an API macro which expands to either\n * the export or import version of the macro, depending upon the compilation\n * mode.\n */\n#ifdef _WIN32\n#  if defined(__MWERKS__)\n#    define MOZ_IMPORT_API /* nothing */\n#  else\n#    define MOZ_IMPORT_API __declspec(dllimport)\n#  endif\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_API  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_API MOZ_EXPORT\n#endif\n\n#if defined(_WIN32) && !defined(__MWERKS__)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_DATA  MOZ_EXPORT\n#endif\n\n/*\n * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose\n * export mfbt declarations when building mfbt, and they expose import mfbt\n * declarations when using mfbt.\n */\n#if defined(IMPL_MFBT)\n#  define MFBT_API     MOZ_EXPORT\n#  define MFBT_DATA    MOZ_EXPORT\n#else\n  /*\n   * On linux mozglue is linked in the program and we link libxul.so with\n   * -z,defs. Normally that causes the linker to reject undefined references in\n   * libxul.so, but as a loophole it allows undefined references to weak\n   * symbols. We add the weak attribute to the import version of the MFBT API\n   * macros to exploit this.\n   */\n#  if defined(MOZ_GLUE_IN_PROGRAM)\n#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API\n#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA\n#  else\n#    define MFBT_API   MOZ_IMPORT_API\n#    define MFBT_DATA  MOZ_IMPORT_DATA\n#  endif\n#endif\n\n/*\n * C symbols in C++ code must be declared immediately within |extern \"C\"|\n * blocks.  However, in C code, they need not be declared specially.  This\n * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C\n * macros, so that the user need not know whether he is being used in C or C++\n * code.\n *\n *   MOZ_BEGIN_EXTERN_C\n *\n *   extern MOZ_EXPORT int MostRandomNumber(void);\n *   ...other declarations...\n *\n *   MOZ_END_EXTERN_C\n *\n * This said, it is preferable to just use |extern \"C\"| in C++ header files for\n * its greater clarity.\n */\n#ifdef __cplusplus\n#  define MOZ_BEGIN_EXTERN_C    extern \"C\" {\n#  define MOZ_END_EXTERN_C      }\n#else\n#  define MOZ_BEGIN_EXTERN_C\n#  define MOZ_END_EXTERN_C\n#endif\n\n/*\n * GCC's typeof is available when decltype is not.\n */\n#if defined(__GNUC__) && defined(__cplusplus) && \\\n  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L\n#  define decltype __typeof__\n#endif\n\n#endif /* mozilla_Types_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Util.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Miscellaneous uncategorized functionality.  Please add new functionality to\n * new headers, or to other appropriate existing headers, not here.\n */\n\n#ifndef mozilla_Util_h\n#define mozilla_Util_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many \n * bytes of alignment a given type needs.\n */\ntemplate<class T>\nclass AlignmentFinder\n{\n    struct Aligner\n    {\n        char c;\n        T t;\n    };\n\n  public:\n    static const size_t alignment = sizeof(Aligner) - sizeof(T);\n};\n\n#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment\n\n/*\n * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.\n *\n * For instance,\n *\n *   MOZ_ALIGNED_DECL(char arr[2], 8);\n *\n * will declare a two-character array |arr| aligned to 8 bytes.\n */\n\n#if defined(__GNUC__)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     _type __attribute__((aligned(_align)))\n#elif defined(_MSC_VER)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     __declspec(align(_align)) _type\n#else\n#  warning \"We don't know how to align variables on this compiler.\"\n#  define MOZ_ALIGNED_DECL(_type, _align) _type\n#endif\n\n/*\n * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N\n * bytes.\n *\n * We support 1, 2, 4, 8, and 16-bit alignment.\n */\ntemplate<size_t align>\nstruct AlignedElem;\n\n/*\n * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where\n * foo is a template parameter.\n */\n\ntemplate<>\nstruct AlignedElem<1>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 1);\n};\n\ntemplate<>\nstruct AlignedElem<2>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 2);\n};\n\ntemplate<>\nstruct AlignedElem<4>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 4);\n};\n\ntemplate<>\nstruct AlignedElem<8>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 8);\n};\n\ntemplate<>\nstruct AlignedElem<16>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 16);\n};\n\n/*\n * This utility pales in comparison to Boost's aligned_storage. The utility\n * simply assumes that uint64_t is enough alignment for anyone. This may need\n * to be extended one day...\n *\n * As an important side effect, pulling the storage into this template is\n * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving\n * false negatives when we cast from the char buffer to whatever type we've\n * constructed using the bytes.\n */\ntemplate<size_t nbytes>\nstruct AlignedStorage\n{\n    union U {\n      char bytes[nbytes];\n      uint64_t _;\n    } u;\n\n    const void* addr() const { return u.bytes; }\n    void* addr() { return u.bytes; }\n};\n\ntemplate<class T>\nstruct AlignedStorage2\n{\n    union U {\n      char bytes[sizeof(T)];\n      uint64_t _;\n    } u;\n\n    const T* addr() const { return reinterpret_cast<const T*>(u.bytes); }\n    T* addr() { return static_cast<T*>(static_cast<void*>(u.bytes)); }\n};\n\n/*\n * Small utility for lazily constructing objects without using dynamic storage.\n * When a Maybe<T> is constructed, it is |empty()|, i.e., no value of T has\n * been constructed and no T destructor will be called when the Maybe<T> is\n * destroyed. Upon calling |construct|, a T object will be constructed with the\n * given arguments and that object will be destroyed when the owning Maybe<T>\n * is destroyed.\n *\n * N.B. GCC seems to miss some optimizations with Maybe and may generate extra\n * branches/loads/stores. Use with caution on hot paths.\n */\ntemplate<class T>\nclass Maybe\n{\n    AlignedStorage2<T> storage;\n    bool constructed;\n\n    T& asT() { return *storage.addr(); }\n\n  public:\n    Maybe() { constructed = false; }\n    ~Maybe() { if (constructed) asT().~T(); }\n\n    bool empty() const { return !constructed; }\n\n    void construct() {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T();\n      constructed = true;\n    }\n\n    template<class T1>\n    void construct(const T1& t1) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1);\n      constructed = true;\n    }\n\n    template<class T1, class T2>\n    void construct(const T1& t1, const T2& t2) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3>\n    void construct(const T1& t1, const T2& t2, const T3& t3) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9, class T10>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);\n      constructed = true;\n    }\n\n    T* addr() {\n      MOZ_ASSERT(constructed);\n      return &asT();\n    }\n\n    T& ref() {\n      MOZ_ASSERT(constructed);\n      return asT();\n    }\n\n    const T& ref() const {\n      MOZ_ASSERT(constructed);\n      return const_cast<Maybe*>(this)->asT();\n    }\n\n    void destroy() {\n      ref().~T();\n      constructed = false;\n    }\n\n    void destroyIfConstructed() {\n      if (!empty())\n        destroy();\n    }\n\n  private:\n    Maybe(const Maybe& other) MOZ_DELETE;\n    const Maybe& operator=(const Maybe& other) MOZ_DELETE;\n};\n\n/*\n * Safely subtract two pointers when it is known that end >= begin.  This avoids\n * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB\n * set, the unsigned subtraction followed by right shift will produce -1, or\n * size_t(-1), instead of the real difference.\n */\ntemplate<class T>\nMOZ_ALWAYS_INLINE size_t\nPointerRangeSize(T* begin, T* end)\n{\n  MOZ_ASSERT(end >= begin);\n  return (size_t(end) - size_t(begin)) / sizeof(T);\n}\n\n/*\n * Compute the length of an array with constant length.  (Use of this method\n * with a non-array pointer will not compile.)\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR size_t\nArrayLength(T (&arr)[N])\n{\n  return N;\n}\n\n/*\n * Compute the address one past the last element of a constant-length array.\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR T*\nArrayEnd(T (&arr)[N])\n{\n  return arr + ArrayLength(arr);\n}\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n/*\n * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files\n * that can't use C++ template functions and for static_assert() calls that\n * can't call ArrayLength() when it is not a C++11 constexpr function.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_ARRAY_LENGTH(array)   mozilla::ArrayLength(array)\n#else\n#  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))\n#endif\n\n#endif /* mozilla_Util_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type/length-parametrized vector class. */\n\n#ifndef mozilla_Vector_h\n#define mozilla_Vector_h\n\n#include \"mozilla/AllocPolicy.h\"\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/MathAlgorithms.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include <new> // for placement new\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace mozilla {\n\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase;\n\nnamespace detail {\n\n/*\n * Check that the given capacity wastes the minimal amount of space if\n * allocated on the heap.  This means that cap*sizeof(T) is as close to a\n * power-of-two as possible.  growStorageBy() is responsible for ensuring\n * this.\n */\ntemplate<typename T>\nstatic bool CapacityHasExcessSpace(size_t cap)\n{\n  size_t size = cap * sizeof(T);\n  return RoundUpPow2(size) - size >= sizeof(T);\n}\n\n/*\n * This template class provides a default implementation for vector operations\n * when the element type is not known to be a POD, as judged by IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector, bool IsPod>\nstruct VectorImpl\n{\n    /* Destroys constructed objects in the range [begin, end). */\n    static inline void destroy(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        p->~T();\n    }\n\n    /* Constructs objects in the uninitialized range [begin, end). */\n    static inline void initialize(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(*p);\n    }\n\n    /*\n     * Move-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(Move(*p));\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range [dst, dst+n) from the\n     * same object u.\n     */\n    template<typename U>\n    static inline void copyConstructN(T* dst, size_t n, const U& u) {\n      for (T* end = dst + n; dst < end; ++dst)\n        new(dst) T(u);\n    }\n\n    /*\n     * Grows the given buffer to have capacity newCap, preserving the objects\n     * constructed in the range [begin, end) and updating v. Assumes that (1)\n     * newCap has not overflowed, and (2) multiplying newCap by sizeof(T) will\n     * not overflow.\n     */\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      T* newbuf = reinterpret_cast<T*>(v.malloc_(newCap * sizeof(T)));\n      if (!newbuf)\n        return false;\n      T* dst = newbuf;\n      T* src = v.beginNoCheck();\n      for (; src < v.endNoCheck(); ++dst, ++src)\n        new(dst) T(Move(*src));\n      VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck());\n      v.free_(v.mBegin);\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n/*\n * This partial template specialization provides a default implementation for\n * vector operations when the element type is known to be a POD, as judged by\n * IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector>\nstruct VectorImpl<T, N, AP, ThisVector, true>\n{\n    static inline void destroy(T*, T*) {}\n\n    static inline void initialize(T* begin, T* end) {\n      /*\n       * You would think that memset would be a big win (or even break even)\n       * when we know T is a POD. But currently it's not. This is probably\n       * because |append| tends to be given small ranges and memset requires\n       * a function call that doesn't get inlined.\n       *\n       * memset(begin, 0, sizeof(T) * (end-begin));\n       */\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      /*\n       * See above memset comment. Also, notice that copyConstruct is\n       * currently templated (T != U), so memcpy won't work without\n       * requiring T == U.\n       *\n       * memcpy(dst, srcbeg, sizeof(T) * (srcend - srcbeg));\n       */\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        *dst = *p;\n    }\n\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      copyConstruct(dst, srcbeg, srcend);\n    }\n\n    static inline void copyConstructN(T* dst, size_t n, const T& t) {\n      for (T* end = dst + n; dst < end; ++dst)\n        *dst = t;\n    }\n\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      size_t oldSize = sizeof(T) * v.mCapacity;\n      size_t newSize = sizeof(T) * newCap;\n      T* newbuf = reinterpret_cast<T*>(v.realloc_(v.mBegin, oldSize, newSize));\n      if (!newbuf)\n        return false;\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n} // namespace detail\n\n/*\n * A CRTP base class for vector-like classes.  Unless you really really want\n * your own vector class -- and you almost certainly don't -- you should use\n * mozilla::Vector instead!\n *\n * See mozilla::Vector for interface requirements.\n */\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase : private AllocPolicy\n{\n    /* utilities */\n\n    static const bool sElemIsPod = IsPod<T>::value;\n    typedef detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod> Impl;\n    friend struct detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod>;\n\n    bool growStorageBy(size_t incr);\n    bool convertToHeapStorage(size_t newCap);\n\n    /* magic constants */\n\n    static const int sMaxInlineBytes = 1024;\n\n    /* compute constants */\n\n    /*\n     * Consider element size to be 1 for buffer sizing if there are 0 inline\n     * elements.  This allows us to compile when the definition of the element\n     * type is not visible here.\n     *\n     * Explicit specialization is only allowed at namespace scope, so in order\n     * to keep everything here, we use a dummy template parameter with partial\n     * specialization.\n     */\n    template<int M, int Dummy>\n    struct ElemSize\n    {\n        static const size_t value = sizeof(T);\n    };\n    template<int Dummy>\n    struct ElemSize<0, Dummy>\n    {\n        static const size_t value = 1;\n    };\n\n    static const size_t sInlineCapacity =\n      tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::value>::value;\n\n    /* Calculate inline buffer size; avoid 0-sized array. */\n    static const size_t sInlineBytes =\n      tl::Max<1, sInlineCapacity * ElemSize<N, 0>::value>::value;\n\n    /* member data */\n\n    /*\n     * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,\n     * mBegin + mLength) hold valid constructed T objects. The range [mBegin +\n     * mLength, mBegin + mCapacity) holds uninitialized memory. The range\n     * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory\n     * previously allocated by a call to reserve().\n     */\n    T* mBegin;\n\n    /* Number of elements in the vector. */\n    size_t mLength;\n\n    /* Max number of elements storable in the vector without resizing. */\n    size_t mCapacity;\n\n#ifdef DEBUG\n    /* Max elements of reserved or used space in this vector. */\n    size_t mReserved;\n#endif\n\n    /* Memory used for inline storage. */\n    AlignedStorage<sInlineBytes> storage;\n\n#ifdef DEBUG\n    friend class ReentrancyGuard;\n    bool entered;\n#endif\n\n    /* private accessors */\n\n    bool usingInlineStorage() const {\n      return mBegin == const_cast<VectorBase*>(this)->inlineStorage();\n    }\n\n    T* inlineStorage() {\n      return static_cast<T*>(storage.addr());\n    }\n\n    T* beginNoCheck() const {\n      return mBegin;\n    }\n\n    T* endNoCheck() {\n      return mBegin + mLength;\n    }\n\n    const T* endNoCheck() const {\n      return mBegin + mLength;\n    }\n\n#ifdef DEBUG\n    size_t reserved() const {\n      MOZ_ASSERT(mReserved <= mCapacity);\n      MOZ_ASSERT(mLength <= mReserved);\n      return mReserved;\n    }\n#endif\n\n    /* Append operations guaranteed to succeed due to pre-reserved space. */\n    template<typename U> void internalAppend(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    void internalAppendAll(const VectorBase<U, O, BP, UV>& u);\n    void internalAppendN(const T& t, size_t n);\n    template<typename U> void internalAppend(const U* begin, size_t length);\n\n  public:\n    static const size_t sMaxInlineStorage = N;\n\n    typedef T ElementType;\n\n    VectorBase(AllocPolicy = AllocPolicy());\n    VectorBase(MoveRef<ThisVector>); /* Move constructor. */\n    ThisVector& operator=(MoveRef<ThisVector>); /* Move assignment. */\n    ~VectorBase();\n\n    /* accessors */\n\n    const AllocPolicy& allocPolicy() const {\n      return *this;\n    }\n\n    AllocPolicy& allocPolicy() {\n      return *this;\n    }\n\n    enum { InlineLength = N };\n\n    size_t length() const {\n      return mLength;\n    }\n\n    bool empty() const {\n      return mLength == 0;\n    }\n\n    size_t capacity() const {\n      return mCapacity;\n    }\n\n    T* begin() {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    const T* begin() const {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    T* end() {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    const T* end() const {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    T& operator[](size_t i) {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    T& back() {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    const T& back() const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    class Range\n    {\n        friend class VectorBase;\n        T* cur_;\n        T* end_;\n        Range(T* cur, T* end) : cur_(cur), end_(end) {}\n\n      public:\n        Range() {}\n        bool empty() const { return cur_ == end_; }\n        size_t remain() const { return end_ - cur_; }\n        T& front() const { return *cur_; }\n        void popFront() { MOZ_ASSERT(!empty()); ++cur_; }\n        T popCopyFront() { MOZ_ASSERT(!empty()); return *cur_++; }\n    };\n\n    Range all() {\n      return Range(begin(), end());\n    }\n\n    /* mutators */\n\n    /**\n     * Given that the vector is empty and has no inline storage, grow to\n     * |capacity|.\n     */\n    bool initCapacity(size_t request);\n\n    /**\n     * If reserve(length() + N) succeeds, the N next appends are guaranteed to\n     * succeed.\n     */\n    bool reserve(size_t request);\n\n    /**\n     * Destroy elements in the range [end() - incr, end()). Does not deallocate\n     * or unreserve storage for those elements.\n     */\n    void shrinkBy(size_t incr);\n\n    /** Grow the vector by incr elements. */\n    bool growBy(size_t incr);\n\n    /** Call shrinkBy or growBy based on whether newSize > length(). */\n    bool resize(size_t newLength);\n\n    /**\n     * Increase the length of the vector, but don't initialize the new elements\n     * -- leave them as uninitialized memory.\n     */\n    bool growByUninitialized(size_t incr);\n    bool resizeUninitialized(size_t newLength);\n\n    /** Shorthand for shrinkBy(length()). */\n    void clear();\n\n    /** Clears and releases any heap-allocated storage. */\n    void clearAndFree();\n\n    /**\n     * If true, appending |needed| elements won't reallocate elements storage.\n     * This *doesn't* mean that infallibleAppend may be used!  You still must\n     * reserve the extra space, even if this method indicates that appends won't\n     * need to reallocate elements storage.\n     */\n    bool canAppendWithoutRealloc(size_t needed) const;\n\n    /**\n     * Potentially fallible append operations.\n     *\n     * The function templates that take an unspecified type U require a const T&\n     * or a MoveRef<T>.  The MoveRef<T> variants move their operands into the\n     * vector, instead of copying them.  If they fail, the operand is left\n     * unmoved.\n     */\n    template<typename U> bool append(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    bool appendAll(const VectorBase<U, O, BP, UV>& u);\n    bool appendN(const T& t, size_t n);\n    template<typename U> bool append(const U* begin, const U* end);\n    template<typename U> bool append(const U* begin, size_t length);\n\n    /*\n     * Guaranteed-infallible append operations for use upon vectors whose\n     * memory has been pre-reserved.  Don't use this if you haven't reserved the\n     * memory!\n     */\n    template<typename U> void infallibleAppend(const U& u) {\n      internalAppend(u);\n    }\n    void infallibleAppendN(const T& t, size_t n) {\n      internalAppendN(t, n);\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) {\n      internalAppend(aBegin, PointerRangeSize(aBegin, aEnd));\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, size_t aLength) {\n      internalAppend(aBegin, aLength);\n    }\n\n    void popBack();\n\n    T popCopy();\n\n    /**\n     * Transfers ownership of the internal buffer used by this vector to the\n     * caller.  (It's the caller's responsibility to properly deallocate this\n     * buffer, in accordance with this vector's AllocPolicy.)  After this call,\n     * the vector is empty.  Since the returned buffer may need to be allocated\n     * (if the elements are currently stored in-place), the call can fail,\n     * returning nullptr.\n     *\n     * N.B. Although a T*, only the range [0, length()) is constructed.\n     */\n    T* extractRawBuffer();\n\n    /**\n     * Transfer ownership of an array of objects into the vector.  The caller\n     * must have allocated the array in accordance with this vector's\n     * AllocPolicy.\n     *\n     * N.B. This call assumes that there are no uninitialized elements in the\n     *      passed array.\n     */\n    void replaceRawBuffer(T* p, size_t length);\n\n    /**\n     * Places |val| at position |p|, shifting existing elements from |p| onward\n     * one position higher.  On success, |p| should not be reused because it'll\n     * be a dangling pointer if reallocation of the vector storage occurred; the\n     * return value should be used instead.  On failure, nullptr is returned.\n     *\n     * Example usage:\n     *\n     *   if (!(p = vec.insert(p, val)))\n     *     <handle failure>\n     *   <keep working with p>\n     *\n     * This is inherently a linear-time operation.  Be careful!\n     */\n    T* insert(T* p, const T& val);\n\n    /**\n     * Removes the element |t|, which must fall in the bounds [begin, end),\n     * shifting existing elements from |t + 1| onward one position lower.\n     */\n    void erase(T* t);\n\n    /**\n     * Measure the size of the vector's heap-allocated storage.\n     */\n    size_t sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const;\n\n    /**\n     * Like sizeOfExcludingThis, but also measures the size of the vector\n     * object (which must be heap-allocated) itself.\n     */\n    size_t sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const;\n\n    void swap(ThisVector& other);\n\n  private:\n    VectorBase(const ThisVector&) MOZ_DELETE;\n    void operator=(const ThisVector&) MOZ_DELETE;\n};\n\n/* This does the re-entrancy check plus several other sanity checks. */\n#define MOZ_REENTRANCY_GUARD_ET_AL \\\n  ReentrancyGuard g(*this); \\\n  MOZ_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); \\\n  MOZ_ASSERT(reserved() <= mCapacity); \\\n  MOZ_ASSERT(mLength <= reserved()); \\\n  MOZ_ASSERT(mLength <= mCapacity)\n\n/* Vector Implementation */\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::VectorBase(AP ap)\n  : AP(ap),\n    mBegin(static_cast<T*>(storage.addr())),\n    mLength(0),\n    mCapacity(sInlineCapacity)\n#ifdef DEBUG\n  , mReserved(sInlineCapacity),\n    entered(false)\n#endif\n{}\n\n/* Move constructor. */\ntemplate<typename T, size_t N, class AllocPolicy, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AllocPolicy, TV>::VectorBase(MoveRef<TV> rhs)\n  : AllocPolicy(rhs)\n#ifdef DEBUG\n    , entered(false)\n#endif\n{\n  mLength = rhs->mLength;\n  mCapacity = rhs->mCapacity;\n#ifdef DEBUG\n  mReserved = rhs->mReserved;\n#endif\n\n  if (rhs->usingInlineStorage()) {\n    /* We can't move the buffer over in this case, so copy elements. */\n    mBegin = static_cast<T*>(storage.addr());\n    Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck());\n    /*\n     * Leave rhs's mLength, mBegin, mCapacity, and mReserved as they are.\n     * The elements in its in-line storage still need to be destroyed.\n     */\n  } else {\n    /*\n     * Take src's buffer, and turn src into an empty vector using\n     * in-line storage.\n     */\n    mBegin = rhs->mBegin;\n    rhs->mBegin = static_cast<T*>(rhs->storage.addr());\n    rhs->mCapacity = sInlineCapacity;\n    rhs->mLength = 0;\n#ifdef DEBUG\n    rhs->mReserved = sInlineCapacity;\n#endif\n  }\n}\n\n/* Move assignment. */\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nTV&\nVectorBase<T, N, AP, TV>::operator=(MoveRef<TV> rhs)\n{\n  TV* tv = static_cast<TV*>(this);\n  tv->~TV();\n  new(tv) TV(rhs);\n  return *tv;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::~VectorBase()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n}\n\n/*\n * This function will create a new heap buffer with capacity newCap,\n * move all elements in the inline buffer to this new buffer,\n * and fail on OOM.\n */\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::convertToHeapStorage(size_t newCap)\n{\n  MOZ_ASSERT(usingInlineStorage());\n\n  /* Allocate buffer. */\n  MOZ_ASSERT(!detail::CapacityHasExcessSpace<T>(newCap));\n  T* newBuf = reinterpret_cast<T*>(this->malloc_(newCap * sizeof(T)));\n  if (!newBuf)\n    return false;\n\n  /* Copy inline elements into heap buffer. */\n  Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());\n  Impl::destroy(beginNoCheck(), endNoCheck());\n\n  /* Switch in heap buffer. */\n  mBegin = newBuf;\n  /* mLength is unchanged. */\n  mCapacity = newCap;\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_NEVER_INLINE bool\nVectorBase<T, N, AP, TV>::growStorageBy(size_t incr)\n{\n  MOZ_ASSERT(mLength + incr > mCapacity);\n  MOZ_ASSERT_IF(!usingInlineStorage(),\n                !detail::CapacityHasExcessSpace<T>(mCapacity));\n\n  /*\n   * When choosing a new capacity, its size should is as close to 2**N bytes\n   * as possible.  2**N-sized requests are best because they are unlikely to\n   * be rounded up by the allocator.  Asking for a 2**N number of elements\n   * isn't as good, because if sizeof(T) is not a power-of-two that would\n   * result in a non-2**N request size.\n   */\n\n  size_t newCap;\n\n  if (incr == 1) {\n    if (usingInlineStorage()) {\n      /* This case occurs in ~70--80% of the calls to this function. */\n      size_t newSize =\n        tl::RoundUpPow2<(sInlineCapacity + 1) * sizeof(T)>::value;\n      newCap = newSize / sizeof(T);\n      goto convert;\n    }\n\n    if (mLength == 0) {\n      /* This case occurs in ~0--10% of the calls to this function. */\n      newCap = 1;\n      goto grow;\n    }\n\n    /* This case occurs in ~15--20% of the calls to this function. */\n\n    /*\n     * Will mLength * 4 *sizeof(T) overflow?  This condition limits a vector\n     * to 1GB of memory on a 32-bit system, which is a reasonable limit.  It\n     * also ensures that\n     *\n     *   static_cast<char*>(end()) - static_cast<char*>(begin())\n     *\n     * doesn't overflow ptrdiff_t (see bug 510319).\n     */\n    if (mLength & tl::MulOverflowMask<4 * sizeof(T)>::value) {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    /*\n     * If we reach here, the existing capacity will have a size that is already\n     * as close to 2^N as sizeof(T) will allow.  Just double the capacity, and\n     * then there might be space for one more element.\n     */\n    newCap = mLength * 2;\n    if (detail::CapacityHasExcessSpace<T>(newCap))\n      newCap += 1;\n  } else {\n    /* This case occurs in ~2% of the calls to this function. */\n    size_t newMinCap = mLength + incr;\n\n    /* Did mLength + incr overflow?  Will newCap * sizeof(T) overflow? */\n    if (newMinCap < mLength ||\n        newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::value)\n    {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    size_t newMinSize = newMinCap * sizeof(T);\n    size_t newSize = RoundUpPow2(newMinSize);\n    newCap = newSize / sizeof(T);\n  }\n\n  if (usingInlineStorage()) {\n  convert:\n    return convertToHeapStorage(newCap);\n  }\n\ngrow:\n  return Impl::growTo(*this, newCap);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::initCapacity(size_t request)\n{\n  MOZ_ASSERT(empty());\n  MOZ_ASSERT(usingInlineStorage());\n  if (request == 0)\n    return true;\n  T* newbuf = reinterpret_cast<T*>(this->malloc_(request * sizeof(T)));\n  if (!newbuf)\n    return false;\n  mBegin = newbuf;\n  mCapacity = request;\n#ifdef DEBUG\n  mReserved = request;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::reserve(size_t request)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (request > mCapacity && !growStorageBy(request - mLength))\n    return false;\n\n#ifdef DEBUG\n  if (request > mReserved)\n    mReserved = request;\n  MOZ_ASSERT(mLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::shrinkBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(incr <= mLength);\n  Impl::destroy(endNoCheck() - incr, endNoCheck());\n  mLength -= incr;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  T* newend = endNoCheck() + incr;\n  Impl::initialize(endNoCheck(), newend);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growByUninitialized(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::resize(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growBy(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::resizeUninitialized(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growByUninitialized(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clear()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  mLength = 0;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clearAndFree()\n{\n  clear();\n\n  if (usingInlineStorage())\n    return;\n\n  this->free_(beginNoCheck());\n  mBegin = static_cast<T*>(storage.addr());\n  mCapacity = sInlineCapacity;\n#ifdef DEBUG\n  mReserved = sInlineCapacity;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::canAppendWithoutRealloc(size_t needed) const\n{\n  return mLength + needed <= mCapacity;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  internalAppend(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U& u)\n{\n  MOZ_ASSERT(mLength + 1 <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  new(endNoCheck()) T(u);\n  ++mLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendN(const T& t, size_t needed)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppendN(t, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendN(const T& t, size_t needed)\n{\n  MOZ_ASSERT(mLength + needed <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstructN(endNoCheck(), needed, t);\n  mLength += needed;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::insert(T* p, const T& val)\n{\n  MOZ_ASSERT(begin() <= p);\n  MOZ_ASSERT(p <= end());\n  size_t pos = p - begin();\n  MOZ_ASSERT(pos <= mLength);\n  size_t oldLength = mLength;\n  if (pos == oldLength) {\n    if (!append(val))\n      return nullptr;\n  } else {\n    T oldBack = back();\n    if (!append(oldBack)) /* Dup the last element. */\n      return nullptr;\n    for (size_t i = oldLength; i > pos; --i)\n      (*this)[i] = (*this)[i - 1];\n    (*this)[pos] = val;\n  }\n  return begin() + pos;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::erase(T* it)\n{\n  MOZ_ASSERT(begin() <= it);\n  MOZ_ASSERT(it < end());\n  while (it + 1 < end()) {\n    *it = *(it + 1);\n    ++it;\n  }\n  popBack();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U* insBegin, const U* insEnd)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  size_t needed = PointerRangeSize(insBegin, insEnd);\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppend(insBegin, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U* insBegin, size_t insLength)\n{\n  MOZ_ASSERT(mLength + insLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstruct(endNoCheck(), insBegin, insBegin + insLength);\n  mLength += insLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U& u)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength == mCapacity && !growStorageBy(1))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + 1 > mReserved)\n    mReserved = mLength + 1;\n#endif\n  internalAppend(u);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  return append(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<class U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U *insBegin, size_t insLength)\n{\n  return append(insBegin, insBegin + insLength);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::popBack()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(!empty());\n  --mLength;\n  endNoCheck()->~T();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE T\nVectorBase<T, N, AP, TV>::popCopy()\n{\n  T ret = back();\n  popBack();\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::extractRawBuffer()\n{\n  T* ret;\n  if (usingInlineStorage()) {\n    ret = reinterpret_cast<T*>(this->malloc_(mLength * sizeof(T)));\n    if (!ret)\n      return nullptr;\n    Impl::copyConstruct(ret, beginNoCheck(), endNoCheck());\n    Impl::destroy(beginNoCheck(), endNoCheck());\n    /* mBegin, mCapacity are unchanged. */\n    mLength = 0;\n  } else {\n    ret = mBegin;\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = 0;\n    mCapacity = sInlineCapacity;\n#ifdef DEBUG\n    mReserved = sInlineCapacity;\n#endif\n  }\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::replaceRawBuffer(T* p, size_t aLength)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n\n  /* Destroy what we have. */\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n\n  /* Take in the new buffer. */\n  if (aLength <= sInlineCapacity) {\n    /*\n     * We convert to inline storage if possible, even though p might\n     * otherwise be acceptable.  Maybe this behaviour should be\n     * specifiable with an argument to this function.\n     */\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = aLength;\n    mCapacity = sInlineCapacity;\n    Impl::moveConstruct(mBegin, p, p + aLength);\n    Impl::destroy(p, p + aLength);\n    this->free_(p);\n  } else {\n    mBegin = p;\n    mLength = aLength;\n    mCapacity = aLength;\n  }\n#ifdef DEBUG\n  mReserved = aLength;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::swap(TV& other)\n{\n  static_assert(N == 0,\n                \"still need to implement this for N != 0\");\n\n  // This only works when inline storage is always empty.\n  if (!usingInlineStorage() && other.usingInlineStorage()) {\n    other.mBegin = mBegin;\n    mBegin = inlineStorage();\n  } else if (usingInlineStorage() && !other.usingInlineStorage()) {\n    mBegin = other.mBegin;\n    other.mBegin = other.inlineStorage();\n  } else if (!usingInlineStorage() && !other.usingInlineStorage()) {\n    Swap(mBegin, other.mBegin);\n  } else {\n    // This case is a no-op, since we'd set both to use their inline storage.\n  }\n\n  Swap(mLength, other.mLength);\n  Swap(mCapacity, other.mCapacity);\n#ifdef DEBUG\n  Swap(mReserved, other.mReserved);\n#endif\n}\n\n/*\n * STL-like container providing a short-lived, dynamic buffer.  Vector calls the\n * constructors/destructors of all elements stored in its internal buffer, so\n * non-PODs may be safely used.  Additionally, Vector will store the first N\n * elements in-place before resorting to dynamic allocation.\n *\n * T requirements:\n *  - default and copy constructible, assignable, destructible\n *  - operations do not throw\n * N requirements:\n *  - any value, however, N is clamped to min/max values\n * AllocPolicy:\n *  - see \"Allocation policies\" in AllocPolicy.h (defaults to\n *    mozilla::MallocAllocPolicy)\n *\n * Vector is not reentrant: T member functions called during Vector member\n * functions must not call back into the same object!\n */\ntemplate<typename T,\n         size_t MinInlineCapacity = 0,\n         class AllocPolicy = MallocAllocPolicy>\nclass Vector\n  : public VectorBase<T,\n                      MinInlineCapacity,\n                      AllocPolicy,\n                      Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector& operator=(mozilla::MoveRef<Vector> vec) {\n      return Base::operator=(vec);\n    }\n};\n\n} // namespace mozilla\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif /* mozilla_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/ios/mozilla/WeakPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Weak pointer functionality, implemented as a mixin for use with any class. */\n\n/**\n * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting\n * its lifetime. It works by creating a single shared reference counted object\n * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo'\n * clear the pointer in the WeakReference without having to know about all of\n * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime\n * of 'Foo'.\n *\n * AtomicSupportsWeakPtr can be used for a variant with an atomically updated\n * reference counter.\n *\n * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional\n * dereference, and an additional heap allocated pointer sized object shared\n * between all of the WeakPtrs.\n *\n * Example of usage:\n *\n *   // To have a class C support weak pointers, inherit from SupportsWeakPtr<C>.\n *   class C : public SupportsWeakPtr<C>\n *   {\n *    public:\n *      int num;\n *      void act();\n *   };\n *\n *   C* ptr =  new C();\n *\n *   // Get weak pointers to ptr. The first time asWeakPtr is called\n *   // a reference counted WeakReference object is created that\n *   // can live beyond the lifetime of 'ptr'. The WeakReference\n *   // object will be notified of 'ptr's destruction.\n *   WeakPtr<C> weak = ptr->asWeakPtr();\n *   WeakPtr<C> other = ptr->asWeakPtr();\n *\n *   // Test a weak pointer for validity before using it.\n *   if (weak) {\n *     weak->num = 17;\n *     weak->act();\n *   }\n *\n *   // Destroying the underlying object clears weak pointers to it.\n *   delete ptr;\n *\n *   MOZ_ASSERT(!weak, \"Deleting |ptr| clears weak pointers to it.\");\n *   MOZ_ASSERT(!other, \"Deleting |ptr| clears all weak pointers to it.\");\n *\n * WeakPtr is typesafe and may be used with any class. It is not required that\n * the class be reference-counted or allocated in any particular way.\n *\n * The API was loosely inspired by Chromium's weak_ptr.h:\n * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h\n */\n\n#ifndef mozilla_WeakPtr_h\n#define mozilla_WeakPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RefPtr.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate <typename T, class WeakReference> class WeakPtrBase;\ntemplate <typename T, class WeakReference> class SupportsWeakPtrBase;\n\nnamespace detail {\n\n// This can live beyond the lifetime of the class derived from SupportsWeakPtrBase.\ntemplate<class T, RefCountAtomicity Atomicity>\nclass WeakReference : public RefCounted<WeakReference<T, Atomicity>, Atomicity>\n{\n  public:\n    explicit WeakReference(T* p) : ptr(p) {}\n    T* get() const {\n      return ptr;\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n    void detach() {\n      ptr = nullptr;\n    }\n    T* ptr;\n};\n\n} // namespace detail\n\ntemplate <typename T, class WeakReference>\nclass SupportsWeakPtrBase\n{\n  public:\n    WeakPtrBase<T, WeakReference> asWeakPtr() {\n      if (!weakRef)\n        weakRef = new WeakReference(static_cast<T*>(this));\n      return WeakPtrBase<T, WeakReference>(weakRef);\n    }\n\n  protected:\n    ~SupportsWeakPtrBase() {\n      static_assert(IsBaseOf<SupportsWeakPtrBase<T, WeakReference>, T>::value,\n                    \"T must derive from SupportsWeakPtrBase<T, WeakReference>\");\n      if (weakRef)\n        weakRef->detach();\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n\n    RefPtr<WeakReference> weakRef;\n};\n\ntemplate <typename T>\nclass SupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::NonAtomicRefCount> >\n{\n};\n\ntemplate <typename T>\nclass AtomicSupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::AtomicRefCount> >\n{\n};\n\nnamespace detail {\n\ntemplate <typename T>\nstruct WeakReferenceCount\n{\n  static const RefCountAtomicity atomicity =\n    IsBaseOf<AtomicSupportsWeakPtr<T>, T>::value\n    ? AtomicRefCount\n    : NonAtomicRefCount;\n};\n\n}\n\ntemplate <typename T, class WeakReference>\nclass WeakPtrBase\n{\n  public:\n    WeakPtrBase(const WeakPtrBase<T, WeakReference>& o) : ref(o.ref) {}\n    // Ensure that ref is dereferenceable in the uninitialized state\n    WeakPtrBase() : ref(new WeakReference(nullptr)) {}\n\n    operator T*() const {\n      return ref->get();\n    }\n    T& operator*() const {\n      return *ref->get();\n    }\n\n    T* operator->() const {\n      return ref->get();\n    }\n\n    T* get() const {\n      return ref->get();\n    }\n\n  private:\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n\n    explicit WeakPtrBase(const RefPtr<WeakReference> &o) : ref(o) {}\n\n    RefPtr<WeakReference> ref;\n};\n\ntemplate <typename T>\nclass WeakPtr : public WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> >\n{\n    typedef WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> > Base;\n  public:\n    WeakPtr(const WeakPtr<T>& o) : Base(o) {}\n    WeakPtr(const Base& o) : Base(o) {}\n    WeakPtr() {}\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_WeakPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/Anchor.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Anchor implementation. */\n\n#ifndef js_Anchor_h\n#define js_Anchor_h\n\n#include \"mozilla/Attributes.h\"\n\nclass JSFunction;\nclass JSObject;\nclass JSScript;\nclass JSString;\n\nnamespace JS { class Value; }\n\nnamespace JS {\n\n/*\n * Protecting non-Value, non-JSObject *, non-JSString * values from collection\n *\n * Most of the time, the garbage collector's conservative stack scanner works\n * behind the scenes, finding all live values and protecting them from being\n * collected. However, when JSAPI client code obtains a pointer to data the\n * scanner does not know about, owned by an object the scanner does know about,\n * Care Must Be Taken.\n *\n * The scanner recognizes only a select set of types: pointers to JSObjects and\n * similar things (JSFunctions, and so on), pointers to JSStrings, and Values.\n * So while the scanner finds all live |JSString| pointers, it does not notice\n * |jschar| pointers.\n *\n * So suppose we have:\n *\n *   void f(JSString *str) {\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * After the call to |JS_GetStringCharsZ|, there are no further uses of\n * |str|, which means that the compiler is within its rights to not store\n * it anywhere. But because the stack scanner will not notice |ch|, there\n * is no longer any live value in this frame that would keep the string\n * alive. If |str| is the last reference to that |JSString|, and the\n * collector runs while we are using |ch|, the string's array of |jschar|s\n * may be freed out from under us.\n *\n * Note that there is only an issue when 1) we extract a thing X the scanner\n * doesn't recognize from 2) a thing Y the scanner does recognize, and 3) if Y\n * gets garbage-collected, then X gets freed. If we have code like this:\n *\n *   void g(JSObject *obj) {\n *     JS::Value x;\n *     JS_GetProperty(obj, \"x\", &x);\n *     ... do stuff with x ...\n *   }\n *\n * there's no problem, because the value we've extracted, x, is a Value, a\n * type that the conservative scanner recognizes.\n *\n * Conservative GC frees us from the obligation to explicitly root the types it\n * knows about, but when we work with derived values like |ch|, we must root\n * their owners, as the derived value alone won't keep them alive.\n *\n * A JS::Anchor is a kind of GC root that allows us to keep the owners of\n * derived values like |ch| alive throughout the Anchor's lifetime. We could\n * fix the above code as follows:\n *\n *   void f(JSString *str) {\n *     JS::Anchor<JSString *> a_str(str);\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * This simply ensures that |str| will be live until |a_str| goes out of scope.\n * As long as we don't retain a pointer to the string's characters for longer\n * than that, we have avoided all garbage collection hazards.\n */\ntemplate<typename T> class AnchorPermitted;\ntemplate<> class AnchorPermitted<JSObject *> { };\ntemplate<> class AnchorPermitted<const JSObject *> { };\ntemplate<> class AnchorPermitted<JSFunction *> { };\ntemplate<> class AnchorPermitted<const JSFunction *> { };\ntemplate<> class AnchorPermitted<JSString *> { };\ntemplate<> class AnchorPermitted<const JSString *> { };\ntemplate<> class AnchorPermitted<Value> { };\ntemplate<> class AnchorPermitted<const JSScript *> { };\ntemplate<> class AnchorPermitted<JSScript *> { };\n\ntemplate<typename T>\nclass Anchor : AnchorPermitted<T>\n{\n  public:\n    Anchor() { }\n    explicit Anchor(T t) { hold = t; }\n    inline ~Anchor();\n    T &get() { return hold; }\n    const T &get() const { return hold; }\n    void set(const T &t) { hold = t; }\n    void operator=(const T &t) { hold = t; }\n    void clear() { hold = 0; }\n\n  private:\n    T hold;\n    Anchor(const Anchor &other) MOZ_DELETE;\n    void operator=(const Anchor &other) MOZ_DELETE;\n};\n\ntemplate<typename T>\ninline Anchor<T>::~Anchor()\n{\n#ifdef __GNUC__\n    /*\n     * No code is generated for this. But because this is marked 'volatile', G++ will\n     * assume it has important side-effects, and won't delete it. (G++ never looks at\n     * the actual text and notices it's empty.) And because we have passed |hold| to\n     * it, GCC will keep |hold| alive until this point.\n     *\n     * The \"memory\" clobber operand ensures that G++ will not move prior memory\n     * accesses after the asm --- it's a barrier. Unfortunately, it also means that\n     * G++ will assume that all memory has changed after the asm, as it would for a\n     * call to an unknown function. I don't know of a way to avoid that consequence.\n     */\n    asm volatile(\"\":: \"g\" (hold) : \"memory\");\n#else\n    /*\n     * An adequate portable substitute, for non-structure types.\n     *\n     * The compiler promises that, by the end of an expression statement, the\n     * last-stored value to a volatile object is the same as it would be in an\n     * unoptimized, direct implementation (the \"abstract machine\" whose behavior the\n     * language spec describes). However, the compiler is still free to reorder\n     * non-volatile accesses across this store --- which is what we must prevent. So\n     * assigning the held value to a volatile variable, as we do here, is not enough.\n     *\n     * In our case, however, garbage collection only occurs at function calls, so it\n     * is sufficient to ensure that the destructor's store isn't moved earlier across\n     * any function calls that could collect. It is hard to imagine the compiler\n     * analyzing the program so thoroughly that it could prove that such motion was\n     * safe. In practice, compilers treat calls to the collector as opaque operations\n     * --- in particular, as operations which could access volatile variables, across\n     * which this destructor must not be moved.\n     *\n     * (\"Objection, your honor!  *Alleged* killer whale!\")\n     *\n     * The disadvantage of this approach is that it does generate code for the store.\n     * We do need to use Anchors in some cases where cycles are tight.\n     *\n     * Note that there is a Anchor<Value>::~Anchor() specialization in Value.h.\n     */\n    volatile T sink;\n    sink = hold;\n#endif  /* defined(__GNUC__) */\n}\n\n} // namespace JS\n\n#endif /* js_Anchor_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/CallArgs.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Helper classes encapsulating access to the callee, |this| value, arguments,\n * and argument count for a function call.\n *\n * The intent of JS::CallArgs and JS::CallReceiver is that they be used to\n * encapsulate access to the un-abstracted |unsigned argc, Value *vp| arguments\n * to a function.  It's possible (albeit deprecated) to manually index into\n * |vp| to access the callee, |this|, and arguments of a function, and to set\n * its return value.  It's also possible to use the supported API of JS_CALLEE,\n * JS_THIS, JS_ARGV, JS_RVAL and JS_SET_RVAL to the same ends.  But neither API\n * has the error-handling or moving-GC correctness of CallArgs or CallReceiver.\n * New code should use CallArgs and CallReceiver instead whenever possible.\n *\n * The eventual plan is to change JSNative to take |const CallArgs&| directly,\n * for automatic assertion of correct use and to make calling functions more\n * efficient.  Embedders should start internally switching away from using\n * |argc| and |vp| directly, except to create a |CallArgs|.  Then, when an\n * eventual release making that change occurs, porting efforts will require\n * changing methods' signatures but won't require invasive changes to the\n * methods' implementations, potentially under time pressure.\n */\n\n#ifndef js_CallArgs_h\n#define js_CallArgs_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"jstypes.h\"\n\n#include \"js/RootingAPI.h\"\n#include \"js/Value.h\"\n\nstruct JSContext;\nclass JSObject;\n\n/* Typedef for native functions called by the JS VM. */\ntypedef JSBool\n(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);\n\n/* Typedef for native functions that may be called in parallel. */\ntypedef js::ParallelResult\n(* JSParallelNative)(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Typedef for native functions that may be called either in parallel or\n * sequential execution.\n */\ntypedef JSBool\n(* JSThreadSafeNative)(js::ThreadSafeContext *cx, unsigned argc, JS::Value *vp);\n\n/*\n * Convenience wrappers for passing in ThreadSafeNative to places that expect\n * a JSNative or a JSParallelNative.\n */\ntemplate <JSThreadSafeNative threadSafeNative>\ninline JSBool\nJSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp);\n\ntemplate <JSThreadSafeNative threadSafeNative>\ninline js::ParallelResult\nJSParallelNativeThreadSafeWrapper(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Compute |this| for the |vp| inside a JSNative, either boxing primitives or\n * replacing with the global object as necessary.\n *\n * This method will go away at some point: instead use |args.thisv()|.  If the\n * value is an object, no further work is required.  If that value is |null| or\n * |undefined|, use |JS_GetGlobalForObject| to compute the global object.  If\n * the value is some other primitive, use |JS_ValueToObject| to box it.\n */\nextern JS_PUBLIC_API(JS::Value)\nJS_ComputeThis(JSContext *cx, JS::Value *vp);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\n/*\n * JS::CallReceiver encapsulates access to the callee, |this|, and eventual\n * return value for a function call.  The principal way to create a\n * CallReceiver is using JS::CallReceiverFromVp:\n *\n *   static JSBool\n *   FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallReceiver rec = JS::CallReceiverFromVp(vp);\n *\n *       // Access to the callee must occur before accessing/setting\n *       // the return value.\n *       JSObject &callee = rec.callee();\n *       rec.rval().set(JS::ObjectValue(callee));\n *\n *       // callee() and calleev() will now assert.\n *\n *       // It's always fine to access thisv().\n *       HandleValue thisv = rec.thisv();\n *       rec.rval().set(thisv);\n *\n *       // As the return value was last set to |this|, returns |this|.\n *       return true;\n *   }\n *\n * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't\n * part of the CallReceiver interface.  We will likely add them at some point.\n * Until then, you should probably continue using |vp| directly for these two\n * cases.\n *\n * CallReceiver is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\n\nnamespace detail {\n\n#ifdef DEBUG\nextern JS_PUBLIC_API(void)\nCheckIsValidConstructible(Value v);\n#endif\n\nenum UsedRval { IncludeUsedRval, NoUsedRval };\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS UsedRvalBase;\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<IncludeUsedRval>\n{\n  protected:\n    mutable bool usedRval_;\n    void setUsedRval() const { usedRval_ = true; }\n    void clearUsedRval() const { usedRval_ = false; }\n};\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>\n{\n  protected:\n    void setUsedRval() const {}\n    void clearUsedRval() const {}\n};\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<\n#ifdef DEBUG\n        WantUsedRval\n#else\n        NoUsedRval\n#endif\n    >\n{\n  protected:\n    Value *argv_;\n\n  public:\n    /*\n     * Returns the function being called, as an object.  Must not be called\n     * after rval() has been used!\n     */\n    JSObject &callee() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return argv_[-2].toObject();\n    }\n\n    /*\n     * Returns the function being called, as a value.  Must not be called after\n     * rval() has been used!\n     */\n    HandleValue calleev() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return HandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n    /*\n     * Returns the |this| value passed to the function.  This method must not\n     * be called when the function is being called as a constructor via |new|.\n     * The value may or may not be an object: it is the individual function's\n     * responsibility to box the value if needed.\n     */\n    HandleValue thisv() const {\n        // Some internal code uses thisv() in constructing cases, so don't do\n        // this yet.\n        // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING));\n        return HandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n\n    Value computeThis(JSContext *cx) const {\n        if (thisv().isObject())\n            return thisv();\n\n        return JS_ComputeThis(cx, base());\n    }\n\n    bool isConstructing() const {\n#ifdef DEBUG\n        if (this->usedRval_)\n            CheckIsValidConstructible(calleev());\n#endif\n        return argv_[-1].isMagic();\n    }\n\n    /*\n     * Returns the currently-set return value.  The initial contents of this\n     * value are unspecified.  Once this method has been called, callee() and\n     * calleev() can no longer be used.  (If you're compiling against a debug\n     * build of SpiderMonkey, these methods will assert to aid debugging.)\n     *\n     * If the method you're implementing succeeds by returning true, you *must*\n     * set this.  (SpiderMonkey doesn't currently assert this, but it will do\n     * so eventually.)  You don't need to use or change this if your method\n     * fails.\n     */\n    MutableHandleValue rval() const {\n        this->setUsedRval();\n        return MutableHandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n  public:\n    // These methods are only intended for internal use.  Embedders shouldn't\n    // use them!\n\n    Value *base() const { return argv_ - 2; }\n\n    Value *spAfterCall() const {\n        this->setUsedRval();\n        return argv_ - 1;\n    }\n\n  public:\n    // These methods are publicly exposed, but they are *not* to be used when\n    // implementing a JSNative method and encapsulating access to |vp| within\n    // it.  You probably don't want to use these!\n\n    void setCallee(Value aCalleev) const {\n        this->clearUsedRval();\n        argv_[-2] = aCalleev;\n    }\n\n    void setThis(Value aThisv) const {\n        argv_[-1] = aThisv;\n    }\n\n    MutableHandleValue mutableThisv() const {\n        return MutableHandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallReceiver : public detail::CallReceiverBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallReceiver CallReceiverFromVp(Value *vp);\n    friend CallReceiver CallReceiverFromArgv(Value *argv);\n};\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromArgv(Value *argv)\n{\n    CallReceiver receiver;\n    receiver.clearUsedRval();\n    receiver.argv_ = argv;\n    return receiver;\n}\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromVp(Value *vp)\n{\n    return CallReceiverFromArgv(vp + 2);\n}\n\n/*\n * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to\n * the function call's arguments.  The principal way to create a CallArgs is\n * like so, using JS::CallArgsFromVp:\n *\n *   static JSBool\n *   FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *\n *       // Guard against no arguments or a non-numeric arg0.\n *       if (args.length() == 0 || !args[0].isNumber()) {\n *           args.rval().setInt32(0);\n *           return true;\n *       }\n *\n *       args.rval().set(JS::NumberValue(args.length() * args[0].toNumber()));\n *       return true;\n *   }\n *\n * CallArgs is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\nnamespace detail {\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallArgsBase :\n        public mozilla::Conditional<WantUsedRval == detail::IncludeUsedRval,\n                                    CallReceiver,\n                                    CallReceiverBase<NoUsedRval> >::Type\n{\n  protected:\n    unsigned argc_;\n\n  public:\n    /* Returns the number of arguments. */\n    unsigned length() const { return argc_; }\n\n    /* Returns the i-th zero-indexed argument. */\n    MutableHandleValue operator[](unsigned i) const {\n        MOZ_ASSERT(i < argc_);\n        return MutableHandleValue::fromMarkedLocation(&this->argv_[i]);\n    }\n\n    /*\n     * Returns the i-th zero-indexed argument, or |undefined| if there's no\n     * such argument.\n     */\n    HandleValue get(unsigned i) const {\n        return i < length()\n               ? HandleValue::fromMarkedLocation(&this->argv_[i])\n               : UndefinedHandleValue;\n    }\n\n    /*\n     * Returns true if the i-th zero-indexed argument is present and is not\n     * |undefined|.\n     */\n    bool hasDefined(unsigned i) const {\n        return i < argc_ && !this->argv_[i].isUndefined();\n    }\n\n  public:\n    // These methods are publicly exposed, but we're less sure of the interface\n    // here than we'd like (because they're hackish and drop assertions).  Try\n    // to avoid using these if you can.\n\n    Value *array() const { return this->argv_; }\n    Value *end() const { return this->argv_ + argc_; }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);\n    friend CallArgs CallArgsFromSp(unsigned argc, Value *sp);\n\n    static CallArgs create(unsigned argc, Value *argv) {\n        CallArgs args;\n        args.clearUsedRval();\n        args.argv_ = argv;\n        args.argc_ = argc;\n        return args;\n    }\n\n};\n\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromVp(unsigned argc, Value *vp)\n{\n    return CallArgs::create(argc, vp + 2);\n}\n\n// This method is only intended for internal use in SpiderMonkey.  We may\n// eventually move it to an internal header.  Embedders should use\n// JS::CallArgsFromVp!\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromSp(unsigned argc, Value *sp)\n{\n    return CallArgs::create(argc, sp - argc);\n}\n\n} // namespace JS\n\n/*\n * Macros to hide interpreter stack layout details from a JSNative using its\n * JS::Value *vp parameter.  DO NOT USE THESE!  Instead use JS::CallArgs and\n * friends, above.  These macros will be removed when we change JSNative to\n * take a const JS::CallArgs&.\n */\n\n#define JS_CALLEE(cx,vp)        ((vp)[0])\n#define JS_THIS_OBJECT(cx,vp)   (JSVAL_TO_OBJECT(JS_THIS(cx,vp)))\n#define JS_ARGV(cx,vp)          ((vp) + 2)\n#define JS_RVAL(cx,vp)          (*(vp))\n#define JS_SET_RVAL(cx,vp,v)    (*(vp) = (v))\n\n/*\n * Note: if this method returns null, an error has occurred and must be\n * propagated or caught.\n */\nMOZ_ALWAYS_INLINE JS::Value\nJS_THIS(JSContext *cx, JS::Value *vp)\n{\n    return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1];\n}\n\n/*\n * |this| is passed to functions in ES5 without change.  Functions themselves\n * do any post-processing they desire to box |this|, compute the global object,\n * &c.  This macro retrieves a function's unboxed |this| value.\n *\n * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT,\n * or vice versa.  Either use the provided this value with this macro, or\n * compute the boxed |this| value using those.  JS_THIS_VALUE must not be used\n * if the function is being called as a constructor.\n *\n * But: DO NOT USE THIS!  Instead use JS::CallArgs::thisv(), above.\n *\n */\n#define JS_THIS_VALUE(cx,vp)    ((vp)[1])\n\n#endif /* js_CallArgs_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/CharacterEncoding.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_CharacterEncoding_h\n#define js_CharacterEncoding_h\n\n#include \"mozilla/Range.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\nnamespace JS {\n\n/*\n * By default, all C/C++ 1-byte-per-character strings passed into the JSAPI\n * are treated as ISO/IEC 8859-1, also known as Latin-1. That is, each\n * byte is treated as a 2-byte character, and there is no way to pass in a\n * string containing characters beyond U+00FF.\n */\nclass Latin1Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    Latin1Chars() : Base() {}\n    Latin1Chars(char *aBytes, size_t aLength) : Base(reinterpret_cast<unsigned char *>(aBytes), aLength) {}\n    Latin1Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * A Latin1Chars, but with \\0 termination for C compatibility.\n */\nclass Latin1CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    Latin1CharsZ() : Base(NULL, 0) {}\n\n    Latin1CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    Latin1CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\nclass UTF8Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    UTF8Chars() : Base() {}\n    UTF8Chars(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {}\n    UTF8Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * SpiderMonkey also deals directly with UTF-8 encoded text in some places.\n */\nclass UTF8CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    UTF8CharsZ() : Base(NULL, 0) {}\n\n    UTF8CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    UTF8CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\n/*\n * SpiderMonkey uses a 2-byte character representation: it is a\n * 2-byte-at-a-time view of a UTF-16 byte stream. This is similar to UCS-2,\n * but unlike UCS-2, we do not strip UTF-16 extension bytes. This allows a\n * sufficiently dedicated JavaScript program to be fully unicode-aware by\n * manually interpreting UTF-16 extension characters embedded in the JS\n * string.\n */\nclass TwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    TwoByteChars() : Base() {}\n    TwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    TwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A non-convertible variant of TwoByteChars that does not refer to characters\n * inlined inside a JSShortString or a JSInlineString. StableTwoByteChars are\n * thus safe to hold across a GC.\n */\nclass StableTwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    StableTwoByteChars() : Base() {}\n    StableTwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    StableTwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A TwoByteChars, but \\0 terminated for compatibility with JSFlatString.\n */\nclass TwoByteCharsZ : public mozilla::RangedPtr<jschar>\n{\n    typedef mozilla::RangedPtr<jschar> Base;\n\n  public:\n    TwoByteCharsZ() : Base(NULL, 0) {}\n\n    TwoByteCharsZ(jschar *chars, size_t length)\n      : Base(chars, length)\n    {\n        JS_ASSERT(chars[length] == '\\0');\n    }\n};\n\n/*\n * Convert a 2-byte character sequence to \"ISO-Latin-1\". This works by\n * truncating each 2-byte pair in the sequence to a 1-byte pair. If the source\n * contains any UTF-16 extension characters, then this may give invalid Latin1\n * output. The returned string is zero terminated. The returned string or the\n * returned string's |start()| must be freed with JS_free or js_free,\n * respectively. If allocation fails, an OOM error will be set and the method\n * will return a NULL chars (which can be tested for with the ! operator).\n * This method cannot trigger GC.\n */\nextern Latin1CharsZ\nLossyTwoByteCharsToNewLatin1CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nextern UTF8CharsZ\nTwoByteCharsToNewUTF8CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nuint32_t\nUtf8ToOneUcs4Char(const uint8_t *utf8Buffer, int utf8Length);\n\n/*\n * Inflate bytes in UTF-8 encoding to jschars.\n * - On error, returns an empty TwoByteCharsZ.\n * - On success, returns a malloc'd TwoByteCharsZ, and updates |outlen| to hold\n *   its length;  the length value excludes the trailing null.\n */\nextern TwoByteCharsZ\nUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n/*\n * The same as UTF8CharsToNewTwoByteCharsZ(), except that any malformed UTF-8 characters\n * will be replaced by \\uFFFD. No exception will be thrown for malformed UTF-8\n * input.\n */\nextern TwoByteCharsZ\nLossyUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n} // namespace JS\n\ninline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); }\ninline void JS_free(JS::UTF8CharsZ &ptr) { js_free((void*)ptr.get()); }\n\n#endif /* js_CharacterEncoding_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/Date.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Date_h\n#define js_Date_h\n\n#include \"jstypes.h\"\n\nnamespace JS {\n\n// Year is a year, month is 0-11, day is 1-based.  The return value is\n// a number of milliseconds since the epoch.  Can return NaN.\nJS_PUBLIC_API(double)\nMakeDate(double year, unsigned month, unsigned day);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// year.  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nYearFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// month (0-11).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nMonthFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// day (1-based).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nDayFromTime(double time);\n\n} // namespace JS\n\n#endif /* js_Date_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/GCAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_GCAPI_h\n#define js_GCAPI_h\n\n#include \"js/HeapAPI.h\"\n\nnamespace JS {\n\n#define GCREASONS(D)                            \\\n    /* Reasons internal to the JS engine */     \\\n    D(API)                                      \\\n    D(MAYBEGC)                                  \\\n    D(LAST_CONTEXT)                             \\\n    D(DESTROY_CONTEXT)                          \\\n    D(LAST_DITCH)                               \\\n    D(TOO_MUCH_MALLOC)                          \\\n    D(ALLOC_TRIGGER)                            \\\n    D(DEBUG_GC)                                 \\\n    D(DEBUG_MODE_GC)                            \\\n    D(TRANSPLANT)                               \\\n    D(RESET)                                    \\\n    D(OUT_OF_NURSERY)                           \\\n    D(EVICT_NURSERY)                            \\\n    D(FULL_STORE_BUFFER)                        \\\n                                                \\\n    /* These are reserved for future use. */    \\\n    D(RESERVED0)                                \\\n    D(RESERVED1)                                \\\n    D(RESERVED2)                                \\\n    D(RESERVED3)                                \\\n    D(RESERVED4)                                \\\n    D(RESERVED5)                                \\\n    D(RESERVED6)                                \\\n    D(RESERVED7)                                \\\n    D(RESERVED8)                                \\\n    D(RESERVED9)                                \\\n    D(RESERVED10)                               \\\n    D(RESERVED11)                               \\\n    D(RESERVED12)                               \\\n    D(RESERVED13)                               \\\n    D(RESERVED14)                               \\\n    D(RESERVED15)                               \\\n    D(RESERVED16)                               \\\n    D(RESERVED17)                               \\\n    D(RESERVED18)                               \\\n    D(RESERVED19)                               \\\n                                                \\\n    /* Reasons from Firefox */                  \\\n    D(DOM_WINDOW_UTILS)                         \\\n    D(COMPONENT_UTILS)                          \\\n    D(MEM_PRESSURE)                             \\\n    D(CC_WAITING)                               \\\n    D(CC_FORCED)                                \\\n    D(LOAD_END)                                 \\\n    D(POST_COMPARTMENT)                         \\\n    D(PAGE_HIDE)                                \\\n    D(NSJSCONTEXT_DESTROY)                      \\\n    D(SET_NEW_DOCUMENT)                         \\\n    D(SET_DOC_SHELL)                            \\\n    D(DOM_UTILS)                                \\\n    D(DOM_IPC)                                  \\\n    D(DOM_WORKER)                               \\\n    D(INTER_SLICE_GC)                           \\\n    D(REFRESH_FRAME)                            \\\n    D(FULL_GC_TIMER)                            \\\n    D(SHUTDOWN_CC)                              \\\n    D(FINISH_LARGE_EVALUTE)\n\nnamespace gcreason {\n\n/* GCReasons will end up looking like JSGC_MAYBEGC */\nenum Reason {\n#define MAKE_REASON(name) name,\n    GCREASONS(MAKE_REASON)\n#undef MAKE_REASON\n    NO_REASON,\n    NUM_REASONS,\n\n    /*\n     * For telemetry, we want to keep a fixed max bucket size over time so we\n     * don't have to switch histograms. 100 is conservative; as of this writing\n     * there are 26. But the cost of extra buckets seems to be low while the\n     * cost of switching histograms is high.\n     */\n    NUM_TELEMETRY_REASONS = 100\n};\n\n} /* namespace gcreason */\n\nextern JS_FRIEND_API(void)\nPrepareZoneForGC(Zone *zone);\n\nextern JS_FRIEND_API(void)\nPrepareForFullGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nPrepareForIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsGCScheduled(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nSkipZoneForGC(Zone *zone);\n\n/*\n * When triggering a GC using one of the functions below, it is first necessary\n * to select the compartments to be collected. To do this, you can call\n * PrepareZoneForGC on each compartment, or you can call PrepareForFullGC\n * to select all compartments. Failing to select any compartment is an error.\n */\n\nextern JS_FRIEND_API(void)\nGCForReason(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkingGC(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkGCBuffers(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nIncrementalGC(JSRuntime *rt, gcreason::Reason reason, int64_t millis = 0);\n\nextern JS_FRIEND_API(void)\nFinishIncrementalGC(JSRuntime *rt, gcreason::Reason reason);\n\nenum GCProgress {\n    /*\n     * During non-incremental GC, the GC is bracketed by JSGC_CYCLE_BEGIN/END\n     * callbacks. During an incremental GC, the sequence of callbacks is as\n     * follows:\n     *   JSGC_CYCLE_BEGIN, JSGC_SLICE_END  (first slice)\n     *   JSGC_SLICE_BEGIN, JSGC_SLICE_END  (second slice)\n     *   ...\n     *   JSGC_SLICE_BEGIN, JSGC_CYCLE_END  (last slice)\n     */\n\n    GC_CYCLE_BEGIN,\n    GC_SLICE_BEGIN,\n    GC_SLICE_END,\n    GC_CYCLE_END\n};\n\nstruct JS_FRIEND_API(GCDescription) {\n    bool isCompartment_;\n\n    GCDescription(bool isCompartment)\n      : isCompartment_(isCompartment) {}\n\n    jschar *formatMessage(JSRuntime *rt) const;\n    jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;\n};\n\ntypedef void\n(* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);\n\nextern JS_FRIEND_API(GCSliceCallback)\nSetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback);\n\n/*\n * Signals a good place to do an incremental slice, because the browser is\n * drawing a frame.\n */\nextern JS_FRIEND_API(void)\nNotifyDidPaint(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalGCEnabled(JSRuntime *rt);\n\nJS_FRIEND_API(bool)\nIsIncrementalGCInProgress(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nEnableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSContext *cx);\n\nextern JS_FRIEND_API(void)\nIncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind);\n\nextern JS_FRIEND_API(void)\nIncrementalValueBarrier(const Value &v);\n\nextern JS_FRIEND_API(void)\nIncrementalObjectBarrier(JSObject *obj);\n\nextern JS_FRIEND_API(void)\nPokeGC(JSRuntime *rt);\n\n/* Was the most recent GC run incrementally? */\nextern JS_FRIEND_API(bool)\nWasIncrementalGC(JSRuntime *rt);\n\nclass ObjectPtr\n{\n    Heap<JSObject *> value;\n\n  public:\n    ObjectPtr() : value(NULL) {}\n\n    ObjectPtr(JSObject *obj) : value(obj) {}\n\n    /* Always call finalize before the destructor. */\n    ~ObjectPtr() { JS_ASSERT(!value); }\n\n    void finalize(JSRuntime *rt) {\n        if (IsIncrementalBarrierNeeded(rt))\n            IncrementalObjectBarrier(value);\n        value = NULL;\n    }\n\n    void init(JSObject *obj) { value = obj; }\n\n    JSObject *get() const { return value; }\n\n    void writeBarrierPre(JSRuntime *rt) {\n        IncrementalObjectBarrier(value);\n    }\n\n    bool isAboutToBeFinalized() {\n        return JS_IsAboutToBeFinalized(&value);\n    }\n\n    ObjectPtr &operator=(JSObject *obj) {\n        IncrementalObjectBarrier(value);\n        value = obj;\n        return *this;\n    }\n\n    void trace(JSTracer *trc, const char *name) {\n        JS_CallHeapObjectTracer(trc, &value, name);\n    }\n\n    JSObject &operator*() const { return *value; }\n    JSObject *operator->() const { return value; }\n    operator JSObject *() const { return value; }\n};\n\n/*\n * Unsets the gray bit for anything reachable from |thing|. |kind| should not be\n * JSTRACE_SHAPE. |thing| should be non-null.\n */\nextern JS_FRIEND_API(void)\nUnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);\n\n/*\n * This should be called when an object that is marked gray is exposed to the JS\n * engine (by handing it to running JS code or writing it into live JS\n * data). During incremental GC, since the gray bits haven't been computed yet,\n * we conservatively mark the object black.\n */\nstatic JS_ALWAYS_INLINE void\nExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)\n{\n    JS_ASSERT(kind != JSTRACE_SHAPE);\n\n    shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);\n#ifdef JSGC_GENERATIONAL\n    /*\n     * GC things residing in the nursery cannot be gray: they have no mark bits.\n     * All live objects in the nursery are moved to tenured at the beginning of\n     * each GC slice, so the gray marker never sees nursery things.\n     */\n    if (uintptr_t(thing) >= rt->gcNurseryStart_ && uintptr_t(thing) < rt->gcNurseryEnd_)\n        return;\n#endif\n    if (IsIncrementalBarrierNeededOnGCThing(rt, thing, kind))\n        IncrementalReferenceBarrier(thing, kind);\n    else if (GCThingIsMarkedGray(thing))\n        UnmarkGrayGCThingRecursively(thing, kind);\n}\n\nstatic JS_ALWAYS_INLINE void\nExposeValueToActiveJS(const Value &v)\n{\n    if (v.isMarkable())\n        ExposeGCThingToActiveJS(v.toGCThing(), v.gcKind());\n}\n\n} /* namespace JS */\n\n#endif /* js_GCAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/HashTable.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HashTable_h\n#define js_HashTable_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/PodOperations.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js/Utility.h\"\n\nnamespace js {\n\nclass TempAllocPolicy;\ntemplate <class> struct DefaultHasher;\ntemplate <class, class> class HashMapEntry;\nnamespace detail {\n    template <class T> class HashTableEntry;\n    template <class T, class HashPolicy, class AllocPolicy> class HashTable;\n}\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based map from keys to\n// values. In particular, HashMap calls constructors and destructors of all\n// objects added so non-PODs may be used safely.\n//\n// Key/Value requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members\n//   called by HashMap must not call back into the same HashMap object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class Key,\n          class Value,\n          class HashPolicy = DefaultHasher<Key>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashMap\n{\n    typedef HashMapEntry<Key, Value> TableEntry;\n\n    struct MapHashPolicy : HashPolicy\n    {\n        typedef Key KeyType;\n        static const Key &getKey(TableEntry &e) { return e.key; }\n        static void setKey(TableEntry &e, Key &k) { const_cast<Key &>(e.key) = k; }\n    };\n\n    typedef detail::HashTable<TableEntry, MapHashPolicy, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef TableEntry Entry;\n\n    // HashMap construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashMap and check the return value.\n    HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   if (HM::Ptr p = h.lookup(3)) {\n    //     const HM::Entry &e = *p; // p acts like a pointer to Entry\n    //     assert(p->key == 3);     // Entry contains the key\n    //     char val = p->value;     // and value\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above (with T = Entry).\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Like lookup, but does not assert if two threads call lookup at the same\n    // time. Only use this method when none of the threads will modify the map.\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const { return impl.readonlyThreadsafeLookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of Key |k| (where |HashPolicy::match(k,l) == true|) using\n    // |add(p,k,v)|. After |add(p,k,v)|, |p| points to the new Entry. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   HM::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3, 'a'))\n    //       return false;\n    //   }\n    //   const HM::Entry &e = *p;   // p acts like a pointer to Entry\n    //   assert(p->key == 3);       // Entry contains the key\n    //   char val = p->value;       // and value\n    //\n    // Also see the definition of AddPtr in HashTable above (with T = Entry).\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HM::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 'a'))\n    //        return false;\n    //    }\n    //    const HM::Entry &e = *p;\n    //    assert(p->key == 3);\n    //    char val = p->value;\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return impl.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        Entry e(k, Value());\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.relookupOrAdd(p, k, mozilla::Move(e));\n    }\n\n    // |all()| returns a Range containing |count()| elements. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   for (HM::Range r = h.all(); !r.empty(); r.popFront())\n    //     char c = r.front().value;\n    //\n    // Also see the definition of Range in HashTable above (with T = Entry).\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM s;\n    //   for (HM::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front().value == 'l')\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above (with T = Entry).\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all entries without triggering destructors. This method is unsafe.\n    void clearWithoutCallingDestructors()             { impl.clearWithoutCallingDestructors(); }\n\n    // Remove all the entries and release all internal buffers. The map must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashMap.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashMap operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        AddPtr p = lookupForAdd(k);\n        if (p) {\n            p->value = v;\n            return true;\n        }\n        return add(p, k, v);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.putNew(k, mozilla::Move(e));\n    }\n\n    // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom.\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        AddPtr p = lookupForAdd(k);\n        if (p)\n            return p;\n        (void)add(p, k, defaultValue);  // p is left false-y on oom.\n        return p;\n    }\n\n    // Remove if present.\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const Key &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashMap is movable\n    HashMap(mozilla::MoveRef<HashMap> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashMap> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashMap is not copyable or assignable\n    HashMap(const HashMap &hm) MOZ_DELETE;\n    HashMap &operator=(const HashMap &hm) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based set of values. In\n// particular, HashSet calls constructors and destructors of all objects added\n// so non-PODs may be used safely.\n//\n// T requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashSet is not reentrant: T/HashPolicy/AllocPolicy members called by\n//   HashSet must not call back into the same HashSet object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class T,\n          class HashPolicy = DefaultHasher<T>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashSet\n{\n    struct SetOps : HashPolicy\n    {\n        typedef T KeyType;\n        static const KeyType &getKey(const T &t) { return t; }\n        static void setKey(T &t, KeyType &k) { t = k; }\n    };\n\n    typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef T Entry;\n\n    // HashSet construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashSet and check the return value.\n    HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   if (HS::Ptr p = h.lookup(3)) {\n    //     assert(*p == 3);   // p acts like a pointer to int\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above.\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of T value |t| (where |HashPolicy::match(t,l) == true|) using\n    // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   HS::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3))\n    //       return false;\n    //   }\n    //   assert(*p == 3);   // p acts like a pointer to int\n    //\n    // Also see the definition of AddPtr in HashTable above.\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HS::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 3))\n    //        return false;\n    //    }\n    //    assert(*p == 3);\n    //\n    // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the\n    // entry |t|, where the caller ensures match(l,t).\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const        { return impl.lookupForAdd(l); }\n\n    bool add(AddPtr &p, const T &t)                   { return impl.add(p, t); }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return impl.relookupOrAdd(p, l, t);\n    }\n\n    // |all()| returns a Range containing |count()| elements:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   for (HS::Range r = h.all(); !r.empty(); r.popFront())\n    //     int i = r.front();\n    //\n    // Also see the definition of Range in HashTable above.\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS s;\n    //   for (HS::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front() == 42)\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above.\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all the entries and release all internal buffers. The set must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashSet.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashSet operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    bool put(const T &t) {\n        AddPtr p = lookupForAdd(t);\n        return p ? true : add(p, t);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    bool putNew(const T &t) {\n        return impl.putNew(t, t);\n    }\n\n    bool putNew(const Lookup &l, const T &t) {\n        return impl.putNew(l, t);\n    }\n\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const T &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashSet is movable\n    HashSet(mozilla::MoveRef<HashSet> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashSet> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashSet is not copyable or assignable\n    HashSet(const HashSet &hs) MOZ_DELETE;\n    HashSet &operator=(const HashSet &hs) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// Hash Policy\n//\n// A hash policy P for a hash table with key-type Key must provide:\n//  - a type |P::Lookup| to use to lookup table entries;\n//  - a static member function |P::hash| with signature\n//\n//      static js::HashNumber hash(Lookup)\n//\n//    to use to hash the lookup type; and\n//  - a static member function |P::match| with signature\n//\n//      static bool match(Key, Lookup)\n//\n//    to use to test equality of key and lookup values.\n//\n// Normally, Lookup = Key. In general, though, different values and types of\n// values can be used to lookup and store. If a Lookup value |l| is != to the\n// added Key value |k|, the user must ensure that |P::match(k,l)|. E.g.:\n//\n//   js::HashSet<Key, P>::AddPtr p = h.lookup(l);\n//   if (!p) {\n//     assert(P::match(k, l));  // must hold\n//     h.add(p, k);\n//   }\n\n// Pointer hashing policy that strips the lowest zeroBits when calculating the\n// hash to improve key distribution.\ntemplate <typename Key, size_t zeroBits>\nstruct PointerHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        size_t word = reinterpret_cast<size_t>(l) >> zeroBits;\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n#if JS_BYTES_PER_WORD == 4\n        return HashNumber(word);\n#else\n        JS_STATIC_ASSERT(sizeof word == 8);\n        return HashNumber((word >> 32) ^ word);\n#endif\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(k));\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        return k == l;\n    }\n};\n\n// Default hash policy: just use the 'lookup' value. This of course only\n// works if the lookup value is integral. HashTable applies ScrambleHashCode to\n// the result of the 'hash' which means that it is 'ok' if the lookup value is\n// not well distributed over the HashNumber domain.\ntemplate <class Key>\nstruct DefaultHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        // Hash if can implicitly cast to hash number type.\n        return l;\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        // Use builtin or overloaded operator==.\n        return k == l;\n    }\n};\n\n// Specialize hashing policy for pointer types. It assumes that the type is\n// at least word-aligned. For types with smaller size use PointerHasher.\ntemplate <class T>\nstruct DefaultHasher<T *> : PointerHasher<T *, mozilla::tl::FloorLog2<sizeof(void *)>::value>\n{};\n\n// For doubles, we can xor the two uint32s.\ntemplate <>\nstruct DefaultHasher<double>\n{\n    typedef double Lookup;\n    static HashNumber hash(double d) {\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n        uint64_t u = mozilla::BitwiseCast<uint64_t>(d);\n        return HashNumber(u ^ (u >> 32));\n    }\n    static bool match(double lhs, double rhs) {\n        return mozilla::BitwiseCast<uint64_t>(lhs) == mozilla::BitwiseCast<uint64_t>(rhs);\n    }\n};\n\n/*****************************************************************************/\n\n// Both HashMap and HashSet are implemented by a single HashTable that is even\n// more heavily parameterized than the other two. This leaves HashTable gnarly\n// and extremely coupled to HashMap and HashSet; thus code should not use\n// HashTable directly.\n\ntemplate <class Key, class Value>\nclass HashMapEntry\n{\n    template <class, class, class> friend class detail::HashTable;\n    template <class> friend class detail::HashTableEntry;\n\n    HashMapEntry(const HashMapEntry &) MOZ_DELETE;\n    void operator=(const HashMapEntry &) MOZ_DELETE;\n\n  public:\n    template<typename KeyInput, typename ValueInput>\n    HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {}\n\n    HashMapEntry(mozilla::MoveRef<HashMapEntry> rhs)\n      : key(mozilla::Move(rhs->key)), value(mozilla::Move(rhs->value)) { }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n\n    const Key key;\n    Value value;\n};\n\n} // namespace js\n\nnamespace mozilla {\n\ntemplate <typename T>\nstruct IsPod<js::detail::HashTableEntry<T> > : IsPod<T> {};\n\ntemplate <typename K, typename V>\nstruct IsPod<js::HashMapEntry<K, V> >\n  : IntegralConstant<bool, IsPod<K>::value && IsPod<V>::value>\n{};\n\n} // namespace mozilla\n\nnamespace js {\n\nnamespace detail {\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable;\n\ntemplate <class T>\nclass HashTableEntry\n{\n    template <class, class, class> friend class HashTable;\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n\n    HashNumber keyHash;\n    mozilla::AlignedStorage2<NonConstT> mem;\n\n    static const HashNumber sFreeKey = 0;\n    static const HashNumber sRemovedKey = 1;\n    static const HashNumber sCollisionBit = 1;\n\n    // Assumed by calloc in createTable.\n    JS_STATIC_ASSERT(sFreeKey == 0);\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return hash > sRemovedKey;\n    }\n\n    HashTableEntry(const HashTableEntry &) MOZ_DELETE;\n    void operator=(const HashTableEntry &) MOZ_DELETE;\n    ~HashTableEntry() MOZ_DELETE;\n\n  public:\n    // NB: HashTableEntry is treated as a POD: no constructor or destructor calls.\n\n    void destroyIfLive() {\n        if (isLive())\n            mem.addr()->~T();\n    }\n\n    void destroy() {\n        JS_ASSERT(isLive());\n        mem.addr()->~T();\n    }\n\n    void swap(HashTableEntry *other) {\n        mozilla::Swap(keyHash, other->keyHash);\n        mozilla::Swap(mem, other->mem);\n    }\n\n    T &get() { JS_ASSERT(isLive()); return *mem.addr(); }\n\n    bool isFree() const    { return keyHash == sFreeKey; }\n    void clearLive()       { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }\n    void clear()           { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }\n    bool isRemoved() const { return keyHash == sRemovedKey; }\n    void removeLive()      { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }\n    bool isLive() const    { return isLiveHash(keyHash); }\n    void setCollision()               { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }\n    void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }\n    void unsetCollision()             { keyHash &= ~sCollisionBit; }\n    bool hasCollision() const         { return keyHash & sCollisionBit; }\n    bool matchHash(HashNumber hn)     { return (keyHash & ~sCollisionBit) == hn; }\n    HashNumber getKeyHash() const     { return keyHash & ~sCollisionBit; }\n\n    template <class U>\n    void setLive(HashNumber hn, const U &u)\n    {\n        JS_ASSERT(!isLive());\n        keyHash = hn;\n        new(mem.addr()) T(u);\n        JS_ASSERT(isLive());\n    }\n};\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable : private AllocPolicy\n{\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n    typedef typename HashPolicy::KeyType Key;\n    typedef typename HashPolicy::Lookup Lookup;\n\n  public:\n    typedef HashTableEntry<T> Entry;\n\n    // A nullable pointer to a hash table element. A Ptr |p| can be tested\n    // either explicitly |if (p.found()) p->...| or using boolean conversion\n    // |if (p) p->...|. Ptr objects must not be used after any mutating hash\n    // table operations unless |generation()| is tested.\n    class Ptr\n    {\n        friend class HashTable;\n        typedef void (Ptr::* ConvertibleToBool)();\n        void nonNull() {}\n\n        Entry *entry_;\n\n      protected:\n        Ptr(Entry &entry) : entry_(&entry) {}\n\n      public:\n        // Leaves Ptr uninitialized.\n        Ptr() {\n#ifdef DEBUG\n            entry_ = (Entry *)0xbad;\n#endif\n        }\n\n        bool found() const                    { return entry_->isLive(); }\n        operator ConvertibleToBool() const    { return found() ? &Ptr::nonNull : 0; }\n        bool operator==(const Ptr &rhs) const { JS_ASSERT(found() && rhs.found()); return entry_ == rhs.entry_; }\n        bool operator!=(const Ptr &rhs) const { return !(*this == rhs); }\n\n        T &operator*() const                  { return entry_->get(); }\n        T *operator->() const                 { return &entry_->get(); }\n    };\n\n    // A Ptr that can be used to add a key after a failed lookup.\n    class AddPtr : public Ptr\n    {\n        friend class HashTable;\n        HashNumber keyHash;\n        mozilla::DebugOnly<uint64_t> mutationCount;\n\n        AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}\n      public:\n        // Leaves AddPtr uninitialized.\n        AddPtr() {}\n    };\n\n    // A collection of hash table entries. The collection is enumerated by\n    // calling |front()| followed by |popFront()| as long as |!empty()|. As\n    // with Ptr/AddPtr, Range objects must not be used after any mutating hash\n    // table operation unless the |generation()| is tested.\n    class Range\n    {\n      protected:\n        friend class HashTable;\n\n        Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) {\n            while (cur < end && !cur->isLive())\n                ++cur;\n        }\n\n        Entry *cur, *end;\n        mozilla::DebugOnly<bool> validEntry;\n\n      public:\n        Range() : cur(NULL), end(NULL), validEntry(false) {}\n\n        bool empty() const {\n            return cur == end;\n        }\n\n        T &front() const {\n            JS_ASSERT(validEntry);\n            JS_ASSERT(!empty());\n            return cur->get();\n        }\n\n        void popFront() {\n            JS_ASSERT(!empty());\n            while (++cur < end && !cur->isLive())\n                continue;\n            validEntry = true;\n        }\n    };\n\n    // A Range whose lifetime delimits a mutating enumeration of a hash table.\n    // Since rehashing when elements were removed during enumeration would be\n    // bad, it is postponed until the Enum is destructed.  Since the Enum's\n    // destructor touches the hash table, the user must ensure that the hash\n    // table is still alive when the destructor runs.\n    class Enum : public Range\n    {\n        friend class HashTable;\n\n        HashTable &table;\n        bool rekeyed;\n        bool removed;\n\n        /* Not copyable. */\n        Enum(const Enum &);\n        void operator=(const Enum &);\n\n      public:\n        template<class Map> explicit\n        Enum(Map &map) : Range(map.all()), table(map.impl), rekeyed(false), removed(false) {}\n\n        // Removes the |front()| element from the table, leaving |front()|\n        // invalid until the next call to |popFront()|. For example:\n        //\n        //   HashSet<int> s;\n        //   for (HashSet<int>::Enum e(s); !e.empty(); e.popFront())\n        //     if (e.front() == 42)\n        //       e.removeFront();\n        void removeFront() {\n            table.remove(*this->cur);\n            removed = true;\n            this->validEntry = false;\n        }\n\n        // Removes the |front()| element and re-inserts it into the table with\n        // a new key at the new Lookup position.  |front()| is invalid after\n        // this operation until the next call to |popFront()|.\n        void rekeyFront(const Lookup &l, const Key &k) {\n            table.rekey(*this->cur, l, k);\n            rekeyed = true;\n            this->validEntry = false;\n        }\n\n        void rekeyFront(const Key &k) {\n            rekeyFront(k, k);\n        }\n\n        // Potentially rehashes the table.\n        ~Enum() {\n            if (rekeyed) {\n                table.gen++;\n                table.checkOverRemoved();\n            }\n\n            if (removed)\n                table.compactIfUnderloaded();\n        }\n    };\n\n    // HashTable is movable\n    HashTable(mozilla::MoveRef<HashTable> rhs)\n      : AllocPolicy(*rhs)\n    {\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n    void operator=(mozilla::MoveRef<HashTable> rhs) {\n        if (table)\n            destroyTable(*this, table, capacity());\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n\n  private:\n    // HashTable is not copyable or assignable\n    HashTable(const HashTable &) MOZ_DELETE;\n    void operator=(const HashTable &) MOZ_DELETE;\n\n  private:\n    uint32_t    hashShift;      // multiplicative hash shift\n    uint32_t    entryCount;     // number of entries in table\n    uint32_t    gen;            // entry storage generation number\n    uint32_t    removedCount;   // removed entry sentinels in table\n    Entry       *table;         // entry storage\n\n    void setTableSizeLog2(unsigned sizeLog2)\n    {\n        hashShift = sHashBits - sizeLog2;\n    }\n\n#ifdef DEBUG\n    mutable struct Stats\n    {\n        uint32_t        searches;       // total number of table searches\n        uint32_t        steps;          // hash chain links traversed\n        uint32_t        hits;           // searches that found key\n        uint32_t        misses;         // searches that didn't find key\n        uint32_t        addOverRemoved; // adds that recycled a removed entry\n        uint32_t        removes;        // calls to remove\n        uint32_t        removeFrees;    // calls to remove that freed the entry\n        uint32_t        grows;          // table expansions\n        uint32_t        shrinks;        // table contractions\n        uint32_t        compresses;     // table compressions\n        uint32_t        rehashes;       // tombstone decontaminations\n    } stats;\n#   define METER(x) x\n#else\n#   define METER(x)\n#endif\n\n    friend class mozilla::ReentrancyGuard;\n    mutable mozilla::DebugOnly<bool> entered;\n    mozilla::DebugOnly<uint64_t>     mutationCount;\n\n    // The default initial capacity is 32 (enough to hold 16 elements), but it\n    // can be as low as 4.\n    static const unsigned sMinCapacityLog2 = 2;\n    static const unsigned sMinCapacity  = 1 << sMinCapacityLog2;\n    static const unsigned sMaxInit      = JS_BIT(23);\n    static const unsigned sMaxCapacity  = JS_BIT(24);\n    static const unsigned sHashBits     = mozilla::tl::BitSize<HashNumber>::value;\n    static const uint8_t  sMinAlphaFrac = 64;  // (0x100 * .25)\n    static const uint8_t  sMaxAlphaFrac = 192; // (0x100 * .75)\n    static const uint8_t  sInvMaxAlpha  = 171; // (ceil(0x100 / .75) >> 1)\n    static const HashNumber sFreeKey = Entry::sFreeKey;\n    static const HashNumber sRemovedKey = Entry::sRemovedKey;\n    static const HashNumber sCollisionBit = Entry::sCollisionBit;\n\n    static void staticAsserts()\n    {\n        // Rely on compiler \"constant overflow warnings\".\n        JS_STATIC_ASSERT(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity);\n        JS_STATIC_ASSERT((sMaxCapacity * sInvMaxAlpha) <= UINT32_MAX);\n        JS_STATIC_ASSERT((sMaxCapacity * sizeof(Entry)) <= UINT32_MAX);\n    }\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return Entry::isLiveHash(hash);\n    }\n\n    static HashNumber prepareHash(const Lookup& l)\n    {\n        HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l));\n\n        // Avoid reserved hash codes.\n        if (!isLiveHash(keyHash))\n            keyHash -= (sRemovedKey + 1);\n        return keyHash & ~sCollisionBit;\n    }\n\n    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)\n    {\n        // See JS_STATIC_ASSERT(sFreeKey == 0) in HashTableEntry.\n        return (Entry *)alloc.calloc_(capacity * sizeof(Entry));\n    }\n\n    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)\n    {\n        for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)\n            e->destroyIfLive();\n        alloc.free_(oldTable);\n    }\n\n  public:\n    HashTable(AllocPolicy ap)\n      : AllocPolicy(ap),\n        hashShift(sHashBits),\n        entryCount(0),\n        gen(0),\n        removedCount(0),\n        table(NULL),\n        entered(false),\n        mutationCount(0)\n    {}\n\n    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)\n    {\n        JS_ASSERT(!initialized());\n\n        // Correct for sMaxAlphaFrac such that the table will not resize\n        // when adding 'length' entries.\n        if (length > sMaxInit) {\n            this->reportAllocOverflow();\n            return false;\n        }\n        uint32_t newCapacity = (length * sInvMaxAlpha) >> 7;\n\n        if (newCapacity < sMinCapacity)\n            newCapacity = sMinCapacity;\n\n        // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034).\n        uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2;\n        while (roundUp < newCapacity) {\n            roundUp <<= 1;\n            ++roundUpLog2;\n        }\n\n        newCapacity = roundUp;\n        JS_ASSERT(newCapacity <= sMaxCapacity);\n\n        table = createTable(*this, newCapacity);\n        if (!table)\n            return false;\n\n        setTableSizeLog2(roundUpLog2);\n        METER(memset(&stats, 0, sizeof(stats)));\n        return true;\n    }\n\n    bool initialized() const\n    {\n        return !!table;\n    }\n\n    ~HashTable()\n    {\n        if (table)\n            destroyTable(*this, table, capacity());\n    }\n\n  private:\n    HashNumber hash1(HashNumber hash0) const\n    {\n        return hash0 >> hashShift;\n    }\n\n    struct DoubleHash\n    {\n        HashNumber h2;\n        HashNumber sizeMask;\n    };\n\n    DoubleHash hash2(HashNumber curKeyHash) const\n    {\n        unsigned sizeLog2 = sHashBits - hashShift;\n        DoubleHash dh = {\n            ((curKeyHash << sizeLog2) >> hashShift) | 1,\n            (HashNumber(1) << sizeLog2) - 1\n        };\n        return dh;\n    }\n\n    static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh)\n    {\n        return (h1 - dh.h2) & dh.sizeMask;\n    }\n\n    bool overloaded()\n    {\n        return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);\n    }\n\n    // Would the table be underloaded if it had the given capacity and entryCount?\n    static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount)\n    {\n        return capacity > sMinCapacity && entryCount <= ((sMinAlphaFrac * capacity) >> 8);\n    }\n\n    bool underloaded()\n    {\n        return wouldBeUnderloaded(capacity(), entryCount);\n    }\n\n    static bool match(Entry &e, const Lookup &l)\n    {\n        return HashPolicy::match(HashPolicy::getKey(e.get()), l);\n    }\n\n    Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const\n    {\n        JS_ASSERT(isLiveHash(keyHash));\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (entry->isFree()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Hit: return entry.\n        if (entry->matchHash(keyHash) && match(*entry, l)) {\n            METER(stats.hits++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        // Save the first removed entry pointer so we can recycle later.\n        Entry *firstRemoved = NULL;\n\n        while(true) {\n            if (JS_UNLIKELY(entry->isRemoved())) {\n                if (!firstRemoved)\n                    firstRemoved = entry;\n            } else {\n                entry->setCollision(collisionBit);\n            }\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (entry->isFree()) {\n                METER(stats.misses++);\n                return firstRemoved ? *firstRemoved : *entry;\n            }\n\n            if (entry->matchHash(keyHash) && match(*entry, l)) {\n                METER(stats.hits++);\n                return *entry;\n            }\n        }\n    }\n\n    // This is a copy of lookup hardcoded to the assumptions:\n    //   1. the lookup is a lookupForAdd\n    //   2. the key, whose |keyHash| has been passed is not in the table,\n    //   3. no entries have been removed from the table.\n    // This specialized search avoids the need for recovering lookup values\n    // from entries, which allows more flexible Lookup/Key types.\n    Entry &findFreeEntry(HashNumber keyHash)\n    {\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // We assume 'keyHash' has already been distributed.\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (!entry->isLive()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        while(true) {\n            JS_ASSERT(!entry->isRemoved());\n            entry->setCollision();\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (!entry->isLive()) {\n                METER(stats.misses++);\n                return *entry;\n            }\n        }\n    }\n\n    enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed };\n\n    RebuildStatus changeTableSize(int deltaLog2)\n    {\n        // Look, but don't touch, until we succeed in getting new entry store.\n        Entry *oldTable = table;\n        uint32_t oldCap = capacity();\n        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;\n        uint32_t newCapacity = JS_BIT(newLog2);\n        if (newCapacity > sMaxCapacity) {\n            this->reportAllocOverflow();\n            return RehashFailed;\n        }\n\n        Entry *newTable = createTable(*this, newCapacity);\n        if (!newTable)\n            return RehashFailed;\n\n        // We can't fail from here on, so update table parameters.\n        setTableSizeLog2(newLog2);\n        removedCount = 0;\n        gen++;\n        table = newTable;\n\n        // Copy only live entries, leaving removed ones behind.\n        for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {\n            if (src->isLive()) {\n                HashNumber hn = src->getKeyHash();\n                findFreeEntry(hn).setLive(hn, mozilla::Move(src->get()));\n                src->destroy();\n            }\n        }\n\n        // All entries have been destroyed, no need to destroyTable.\n        this->free_(oldTable);\n        return Rehashed;\n    }\n\n    RebuildStatus checkOverloaded()\n    {\n        if (!overloaded())\n            return NotOverloaded;\n\n        // Compress if a quarter or more of all entries are removed.\n        int deltaLog2;\n        if (removedCount >= (capacity() >> 2)) {\n            METER(stats.compresses++);\n            deltaLog2 = 0;\n        } else {\n            METER(stats.grows++);\n            deltaLog2 = 1;\n        }\n\n        return changeTableSize(deltaLog2);\n    }\n\n    // Infallibly rehash the table if we are overloaded with removals.\n    void checkOverRemoved()\n    {\n        if (overloaded()) {\n            if (checkOverloaded() == RehashFailed)\n                rehashTableInPlace();\n        }\n    }\n\n    void remove(Entry &e)\n    {\n        JS_ASSERT(table);\n        METER(stats.removes++);\n\n        if (e.hasCollision()) {\n            e.removeLive();\n            removedCount++;\n        } else {\n            METER(stats.removeFrees++);\n            e.clearLive();\n        }\n        entryCount--;\n        mutationCount++;\n    }\n\n    void checkUnderloaded()\n    {\n        if (underloaded()) {\n            METER(stats.shrinks++);\n            (void) changeTableSize(-1);\n        }\n    }\n\n    // Resize the table down to the largest capacity which doesn't underload the\n    // table.  Since we call checkUnderloaded() on every remove, you only need\n    // to call this after a bulk removal of items done without calling remove().\n    void compactIfUnderloaded()\n    {\n        int32_t resizeLog2 = 0;\n        uint32_t newCapacity = capacity();\n        while (wouldBeUnderloaded(newCapacity, entryCount)) {\n            newCapacity = newCapacity >> 1;\n            resizeLog2--;\n        }\n\n        if (resizeLog2 != 0) {\n            changeTableSize(resizeLog2);\n        }\n    }\n\n    // This is identical to changeTableSize(currentSize), but without requiring\n    // a second table.  We do this by recycling the collision bits to tell us if\n    // the element is already inserted or still waiting to be inserted.  Since\n    // already-inserted elements win any conflicts, we get the same table as we\n    // would have gotten through random insertion order.\n    void rehashTableInPlace()\n    {\n        METER(stats.rehashes++);\n        removedCount = 0;\n        for (size_t i = 0; i < capacity(); ++i)\n            table[i].unsetCollision();\n\n        for (size_t i = 0; i < capacity();) {\n            Entry *src = &table[i];\n\n            if (!src->isLive() || src->hasCollision()) {\n                ++i;\n                continue;\n            }\n\n            HashNumber keyHash = src->getKeyHash();\n            HashNumber h1 = hash1(keyHash);\n            DoubleHash dh = hash2(keyHash);\n            Entry *tgt = &table[h1];\n            while (true) {\n                if (!tgt->hasCollision()) {\n                    src->swap(tgt);\n                    tgt->setCollision();\n                    break;\n                }\n\n                h1 = applyDoubleHash(h1, dh);\n                tgt = &table[h1];\n            }\n        }\n\n        // TODO: this algorithm leaves collision bits on *all* elements, even if\n        // they are on no collision path. We have the option of setting the\n        // collision bits correctly on a subsequent pass or skipping the rehash\n        // unless we are totally filled with tombstones: benchmark to find out\n        // which approach is best.\n    }\n\n  public:\n    void clear()\n    {\n        if (mozilla::IsPod<Entry>::value) {\n            memset(table, 0, sizeof(*table) * capacity());\n        } else {\n            uint32_t tableCapacity = capacity();\n            for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)\n                e->clear();\n        }\n        removedCount = 0;\n        entryCount = 0;\n        mutationCount++;\n    }\n\n    void finish()\n    {\n        JS_ASSERT(!entered);\n\n        if (!table)\n            return;\n\n        destroyTable(*this, table, capacity());\n        table = NULL;\n        gen++;\n        entryCount = 0;\n        removedCount = 0;\n        mutationCount++;\n    }\n\n    Range all() const\n    {\n        JS_ASSERT(table);\n        return Range(table, table + capacity());\n    }\n\n    bool empty() const\n    {\n        JS_ASSERT(table);\n        return !entryCount;\n    }\n\n    uint32_t count() const\n    {\n        JS_ASSERT(table);\n        return entryCount;\n    }\n\n    uint32_t capacity() const\n    {\n        JS_ASSERT(table);\n        return JS_BIT(sHashBits - hashShift);\n    }\n\n    uint32_t generation() const\n    {\n        JS_ASSERT(table);\n        return gen;\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(table);\n    }\n\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    Ptr lookup(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const\n    {\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    AddPtr lookupForAdd(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        Entry &entry = lookup(l, keyHash, sCollisionBit);\n        AddPtr p(entry, keyHash);\n        p.mutationCount = mutationCount;\n        return p;\n    }\n\n    template <class U>\n    bool add(AddPtr &p, const U &rhs)\n    {\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(mutationCount == p.mutationCount);\n        JS_ASSERT(table);\n        JS_ASSERT(!p.found());\n        JS_ASSERT(!(p.keyHash & sCollisionBit));\n\n        // Changing an entry from removed to live does not affect whether we\n        // are overloaded and can be handled separately.\n        if (p.entry_->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            p.keyHash |= sCollisionBit;\n        } else {\n            // Preserve the validity of |p.entry_|.\n            RebuildStatus status = checkOverloaded();\n            if (status == RehashFailed)\n                return false;\n            if (status == Rehashed)\n                p.entry_ = &findFreeEntry(p.keyHash);\n        }\n\n        p.entry_->setLive(p.keyHash, rhs);\n        entryCount++;\n        mutationCount++;\n        return true;\n    }\n\n    template <class U>\n    void putNewInfallible(const Lookup &l, const U &u)\n    {\n        JS_ASSERT(table);\n\n        HashNumber keyHash = prepareHash(l);\n        Entry *entry = &findFreeEntry(keyHash);\n\n        if (entry->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            keyHash |= sCollisionBit;\n        }\n\n        entry->setLive(keyHash, u);\n        entryCount++;\n        mutationCount++;\n    }\n\n    template <class U>\n    bool putNew(const Lookup &l, const U &u)\n    {\n        if (checkOverloaded() == RehashFailed)\n            return false;\n\n        putNewInfallible(l, u);\n        return true;\n    }\n\n    template <class U>\n    bool relookupOrAdd(AddPtr& p, const Lookup &l, const U &u)\n    {\n        p.mutationCount = mutationCount;\n        {\n            mozilla::ReentrancyGuard g(*this);\n            p.entry_ = &lookup(l, p.keyHash, sCollisionBit);\n        }\n        return p.found() || add(p, u);\n    }\n\n    void remove(Ptr p)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        remove(*p.entry_);\n        checkUnderloaded();\n    }\n\n    void rekey(Ptr p, const Lookup &l, const Key &k)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));\n        HashPolicy::setKey(t, const_cast<Key &>(k));\n        remove(*p.entry_);\n        putNewInfallible(l, mozilla::Move(t));\n    }\n\n#undef METER\n};\n\n}  // namespace detail\n}  // namespace js\n\n#endif  /* js_HashTable_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/HeapAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HeapAPI_h\n#define js_HeapAPI_h\n\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n\n/* These values are private to the JS engine. */\nnamespace js {\nnamespace gc {\n\nconst size_t ArenaShift = 12;\nconst size_t ArenaSize = size_t(1) << ArenaShift;\nconst size_t ArenaMask = ArenaSize - 1;\n\nconst size_t ChunkShift = 20;\nconst size_t ChunkSize = size_t(1) << ChunkShift;\nconst size_t ChunkMask = ChunkSize - 1;\n\nconst size_t CellShift = 3;\nconst size_t CellSize = size_t(1) << CellShift;\nconst size_t CellMask = CellSize - 1;\n\n/* These are magic constants derived from actual offsets in gc/Heap.h. */\nconst size_t ChunkMarkBitmapOffset = 1032368;\nconst size_t ChunkMarkBitmapBits = 129024;\nconst size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);\n\n/*\n * Live objects are marked black. How many other additional colors are available\n * depends on the size of the GCThing. Objects marked gray are eligible for\n * cycle collection.\n */\nstatic const uint32_t BLACK = 0;\nstatic const uint32_t GRAY = 1;\n\n} /* namespace gc */\n} /* namespace js */\n\nnamespace JS {\nstruct Zone;\n} /* namespace JS */\n\nnamespace JS {\nnamespace shadow {\n\nstruct ArenaHeader\n{\n    JS::Zone *zone;\n};\n\nstruct Zone\n{\n    bool needsBarrier_;\n\n    Zone() : needsBarrier_(false) {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\nnamespace gc {\n\nstatic JS_ALWAYS_INLINE uintptr_t *\nGetGCThingMarkBitmap(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkMarkBitmapOffset;\n    return reinterpret_cast<uintptr_t *>(addr);\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::Runtime *\nGetGCThingRuntime(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkRuntimeOffset;\n    return *reinterpret_cast<JS::shadow::Runtime **>(addr);\n}\n\nstatic JS_ALWAYS_INLINE void\nGetGCThingMarkWordAndMask(const void *thing, uint32_t color,\n                          uintptr_t **wordp, uintptr_t *maskp)\n{\n    uintptr_t addr = uintptr_t(thing);\n    size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;\n    JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);\n    uintptr_t *bitmap = GetGCThingMarkBitmap(thing);\n    *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD);\n    *wordp = &bitmap[bit / JS_BITS_PER_WORD];\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::ArenaHeader *\nGetGCThingArena(void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ArenaMask;\n    return reinterpret_cast<JS::shadow::ArenaHeader *>(addr);\n}\n\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\nstatic JS_ALWAYS_INLINE Zone *\nGetGCThingZone(void *thing)\n{\n    JS_ASSERT(thing);\n    return js::gc::GetGCThingArena(thing)->zone;\n}\n\nstatic JS_ALWAYS_INLINE Zone *\nGetObjectZone(JSObject *obj)\n{\n    return GetGCThingZone(obj);\n}\n\nstatic JS_ALWAYS_INLINE bool\nGCThingIsMarkedGray(void *thing)\n{\n    uintptr_t *word, mask;\n    js::gc::GetGCThingMarkWordAndMask(thing, js::gc::GRAY, &word, &mask);\n    return *word & mask;\n}\n\nstatic JS_ALWAYS_INLINE bool\nIsIncrementalBarrierNeededOnGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind)\n{\n    if (!rt->needsBarrier_)\n        return false;\n    JS::Zone *zone = GetGCThingZone(thing);\n    return reinterpret_cast<shadow::Zone *>(zone)->needsBarrier_;\n}\n\n} /* namespace JS */\n\n#endif /* js_HeapAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/LegacyIntTypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This section typedefs the old 'native' types to the new <stdint.h> types.\n * These redefinitions are provided solely to allow JSAPI users to more easily\n * transition to <stdint.h> types.  They are not to be used in the JSAPI, and\n * new JSAPI user code should not use them.  This mapping file may eventually\n * be removed from SpiderMonkey, so don't depend on it in the long run.\n */\n\n/*\n * BEWARE: Comity with other implementers of these types is not guaranteed.\n *         Indeed, if you use this header and third-party code defining these\n *         types, *expect* to encounter either compile errors or link errors,\n *         depending how these types are used and on the order of inclusion.\n *         It is safest to use only the <stdint.h> types.\n */\n#ifndef js_LegacyIntTypes_h\n#define js_LegacyIntTypes_h\n\n#include <stdint.h>\n\n#include \"js-config.h\"\n\ntypedef uint8_t uint8;\ntypedef uint16_t uint16;\ntypedef uint32_t uint32;\ntypedef uint64_t uint64;\n\n/*\n * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very\n * common header file) defines the types int8, int16, int32, and int64.\n * So we don't define these four types here to avoid conflicts in case\n * the code also includes sys/types.h.\n */\n#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)\n#include <sys/inttypes.h>\n#else\ntypedef int8_t int8;\ntypedef int16_t int16;\ntypedef int32_t int32;\ntypedef int64_t int64;\n#endif /* AIX && HAVE_SYS_INTTYPES_H */\n\ntypedef uint8_t JSUint8;\ntypedef uint16_t JSUint16;\ntypedef uint32_t JSUint32;\ntypedef uint64_t JSUint64;\n\ntypedef int8_t JSInt8;\ntypedef int16_t JSInt16;\ntypedef int32_t JSInt32;\ntypedef int64_t JSInt64;\n\n#endif /* js_LegacyIntTypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/MemoryMetrics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_MemoryMetrics_h\n#define js_MemoryMetrics_h\n\n// These declarations are not within jsapi.h because they are highly likely to\n// change in the future. Depend on them at your own risk.\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include <string.h>\n\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n#include \"js/Vector.h\"\n\nclass nsISupports;      // This is needed for ObjectPrivateVisitor.\n\nnamespace js {\n\n// In memory reporting, we have concept of \"sundries\", line items which are too\n// small to be worth reporting individually.  Under some circumstances, a memory\n// reporter gets tossed into the sundries bucket if it's smaller than\n// MemoryReportingSundriesThreshold() bytes.\n//\n// We need to define this value here, rather than in the code which actually\n// generates the memory reports, because HugeStringInfo uses this value.\nJS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();\n\n} // namespace js\n\nnamespace JS {\n\n// Data for tracking memory usage of things hanging off objects.\nstruct ObjectsExtraSizes\n{\n    size_t slots;\n    size_t elementsNonAsmJS;\n    size_t elementsAsmJSHeap;\n    size_t elementsAsmJSNonHeap;\n    size_t argumentsData;\n    size_t regExpStatics;\n    size_t propertyIteratorData;\n    size_t ctypesData;\n    size_t private_;    // The '_' suffix is required because |private| is a keyword.\n                        // Note that this field is measured separately from the others.\n\n    ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); }\n\n    void add(ObjectsExtraSizes &sizes) {\n        this->slots                += sizes.slots;\n        this->elementsNonAsmJS     += sizes.elementsNonAsmJS;\n        this->elementsAsmJSHeap    += sizes.elementsAsmJSHeap;\n        this->elementsAsmJSNonHeap += sizes.elementsAsmJSNonHeap;\n        this->argumentsData        += sizes.argumentsData;\n        this->regExpStatics        += sizes.regExpStatics;\n        this->propertyIteratorData += sizes.propertyIteratorData;\n        this->ctypesData           += sizes.ctypesData;\n        this->private_             += sizes.private_;\n    }\n};\n\n// Data for tracking analysis/inference memory usage.\nstruct TypeInferenceSizes\n{\n    size_t typeScripts;\n    size_t typeResults;\n    size_t analysisPool;\n    size_t pendingArrays;\n    size_t allocationSiteTables;\n    size_t arrayTypeTables;\n    size_t objectTypeTables;\n\n    TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); }\n\n    void add(TypeInferenceSizes &sizes) {\n        this->typeScripts          += sizes.typeScripts;\n        this->typeResults          += sizes.typeResults;\n        this->analysisPool         += sizes.analysisPool;\n        this->pendingArrays        += sizes.pendingArrays;\n        this->allocationSiteTables += sizes.allocationSiteTables;\n        this->arrayTypeTables      += sizes.arrayTypeTables;\n        this->objectTypeTables     += sizes.objectTypeTables;\n    }\n};\n\n// Data for tracking JIT-code memory usage.\nstruct CodeSizes\n{\n    size_t ion;\n    size_t asmJS;\n    size_t baseline;\n    size_t regexp;\n    size_t other;\n    size_t unused;\n\n    CodeSizes() { memset(this, 0, sizeof(CodeSizes)); }\n};\n\n// Holds data about a huge string (one which uses more HugeStringInfo::MinSize\n// bytes of memory), so we can report it individually.\nstruct HugeStringInfo\n{\n    HugeStringInfo() : length(0), size(0) { memset(&buffer, 0, sizeof(buffer)); }\n\n    // A string needs to take up this many bytes of storage before we consider\n    // it to be \"huge\".\n    static size_t MinSize() {\n        return js::MemoryReportingSundriesThreshold();\n    }\n\n    // A string's size in memory is not necessarily equal to twice its length\n    // because the allocator and the JS engine both may round up.\n    size_t length;\n    size_t size;\n\n    // We record the first 32 chars of the escaped string here.  (We escape the\n    // string so we can use a char[] instead of a jschar[] here.\n    char buffer[32];\n};\n\n// These measurements relate directly to the JSRuntime, and not to\n// compartments within it.\nstruct RuntimeSizes\n{\n    RuntimeSizes() { memset(this, 0, sizeof(RuntimeSizes)); }\n\n    size_t object;\n    size_t atomsTable;\n    size_t contexts;\n    size_t dtoa;\n    size_t temporary;\n    size_t regexpData;\n    size_t interpreterStack;\n    size_t gcMarker;\n    size_t mathCache;\n    size_t scriptData;\n    size_t scriptSources;\n\n    CodeSizes code;\n};\n\nstruct ZoneStats\n{\n    ZoneStats()\n      : extra(NULL),\n        gcHeapArenaAdmin(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapStringsNormal(0),\n        gcHeapStringsShort(0),\n        gcHeapLazyScripts(0),\n        gcHeapTypeObjects(0),\n        gcHeapIonCodes(0),\n        stringCharsNonHuge(0),\n        lazyScripts(0),\n        typeObjects(0),\n        typePool(0),\n        hugeStrings()\n    {}\n\n    ZoneStats(const ZoneStats &other)\n      : extra(other.extra),\n        gcHeapArenaAdmin(other.gcHeapArenaAdmin),\n        gcHeapUnusedGcThings(other.gcHeapUnusedGcThings),\n        gcHeapStringsNormal(other.gcHeapStringsNormal),\n        gcHeapStringsShort(other.gcHeapStringsShort),\n        gcHeapLazyScripts(other.gcHeapLazyScripts),\n        gcHeapTypeObjects(other.gcHeapTypeObjects),\n        gcHeapIonCodes(other.gcHeapIonCodes),\n        stringCharsNonHuge(other.stringCharsNonHuge),\n        lazyScripts(other.lazyScripts),\n        typeObjects(other.typeObjects),\n        typePool(other.typePool),\n        hugeStrings()\n    {\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // Add other's numbers to this object's numbers.\n    void add(ZoneStats &other) {\n        #define ADD(x)  this->x += other.x\n\n        ADD(gcHeapArenaAdmin);\n        ADD(gcHeapUnusedGcThings);\n\n        ADD(gcHeapStringsNormal);\n        ADD(gcHeapStringsShort);\n        ADD(gcHeapLazyScripts);\n        ADD(gcHeapTypeObjects);\n        ADD(gcHeapIonCodes);\n\n        ADD(stringCharsNonHuge);\n        ADD(lazyScripts);\n        ADD(typeObjects);\n        ADD(typePool);\n\n        #undef ADD\n\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    size_t gcHeapArenaAdmin;\n    size_t gcHeapUnusedGcThings;\n\n    size_t gcHeapStringsNormal;\n    size_t gcHeapStringsShort;\n\n    size_t gcHeapLazyScripts;\n    size_t gcHeapTypeObjects;\n    size_t gcHeapIonCodes;\n\n    size_t stringCharsNonHuge;\n    size_t lazyScripts;\n    size_t typeObjects;\n    size_t typePool;\n\n    js::Vector<HugeStringInfo, 0, js::SystemAllocPolicy> hugeStrings;\n\n    // The size of all the live things in the GC heap that don't belong to any\n    // compartment.\n    size_t GCHeapThingsSize();\n};\n\nstruct CompartmentStats\n{\n    CompartmentStats()\n      : extra(NULL),\n        gcHeapObjectsOrdinary(0),\n        gcHeapObjectsFunction(0),\n        gcHeapObjectsDenseArray(0),\n        gcHeapObjectsSlowArray(0),\n        gcHeapObjectsCrossCompartmentWrapper(0),\n        gcHeapShapesTreeGlobalParented(0),\n        gcHeapShapesTreeNonGlobalParented(0),\n        gcHeapShapesDict(0),\n        gcHeapShapesBase(0),\n        gcHeapScripts(0),\n        objectsExtra(),\n        shapesExtraTreeTables(0),\n        shapesExtraDictTables(0),\n        shapesExtraTreeShapeKids(0),\n        shapesCompartmentTables(0),\n        scriptData(0),\n        baselineData(0),\n        baselineStubsFallback(0),\n        baselineStubsOptimized(0),\n        ionData(0),\n        compartmentObject(0),\n        crossCompartmentWrappersTable(0),\n        regexpCompartment(0),\n        debuggeesSet(0),\n        typeInference()\n    {}\n\n    CompartmentStats(const CompartmentStats &other)\n      : extra(other.extra),\n        gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary),\n        gcHeapObjectsFunction(other.gcHeapObjectsFunction),\n        gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray),\n        gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray),\n        gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper),\n        gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented),\n        gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented),\n        gcHeapShapesDict(other.gcHeapShapesDict),\n        gcHeapShapesBase(other.gcHeapShapesBase),\n        gcHeapScripts(other.gcHeapScripts),\n        objectsExtra(other.objectsExtra),\n        shapesExtraTreeTables(other.shapesExtraTreeTables),\n        shapesExtraDictTables(other.shapesExtraDictTables),\n        shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids),\n        shapesCompartmentTables(other.shapesCompartmentTables),\n        scriptData(other.scriptData),\n        baselineData(other.baselineData),\n        baselineStubsFallback(other.baselineStubsFallback),\n        baselineStubsOptimized(other.baselineStubsOptimized),\n        ionData(other.ionData),\n        compartmentObject(other.compartmentObject),\n        crossCompartmentWrappersTable(other.crossCompartmentWrappersTable),\n        regexpCompartment(other.regexpCompartment),\n        debuggeesSet(other.debuggeesSet),\n        typeInference(other.typeInference)\n    {\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    // If you add a new number, remember to update the constructors, add(), and\n    // maybe gcHeapThingsSize()!\n    size_t gcHeapObjectsOrdinary;\n    size_t gcHeapObjectsFunction;\n    size_t gcHeapObjectsDenseArray;\n    size_t gcHeapObjectsSlowArray;\n    size_t gcHeapObjectsCrossCompartmentWrapper;\n    size_t gcHeapShapesTreeGlobalParented;\n    size_t gcHeapShapesTreeNonGlobalParented;\n    size_t gcHeapShapesDict;\n    size_t gcHeapShapesBase;\n    size_t gcHeapScripts;\n    ObjectsExtraSizes objectsExtra;\n\n    size_t shapesExtraTreeTables;\n    size_t shapesExtraDictTables;\n    size_t shapesExtraTreeShapeKids;\n    size_t shapesCompartmentTables;\n    size_t scriptData;\n    size_t baselineData;\n    size_t baselineStubsFallback;\n    size_t baselineStubsOptimized;\n    size_t ionData;\n    size_t compartmentObject;\n    size_t crossCompartmentWrappersTable;\n    size_t regexpCompartment;\n    size_t debuggeesSet;\n\n    TypeInferenceSizes typeInference;\n\n    // Add cStats's numbers to this object's numbers.\n    void add(CompartmentStats &cStats) {\n        #define ADD(x)  this->x += cStats.x\n\n        ADD(gcHeapObjectsOrdinary);\n        ADD(gcHeapObjectsFunction);\n        ADD(gcHeapObjectsDenseArray);\n        ADD(gcHeapObjectsSlowArray);\n        ADD(gcHeapObjectsCrossCompartmentWrapper);\n        ADD(gcHeapShapesTreeGlobalParented);\n        ADD(gcHeapShapesTreeNonGlobalParented);\n        ADD(gcHeapShapesDict);\n        ADD(gcHeapShapesBase);\n        ADD(gcHeapScripts);\n        objectsExtra.add(cStats.objectsExtra);\n\n        ADD(shapesExtraTreeTables);\n        ADD(shapesExtraDictTables);\n        ADD(shapesExtraTreeShapeKids);\n        ADD(shapesCompartmentTables);\n        ADD(scriptData);\n        ADD(baselineData);\n        ADD(baselineStubsFallback);\n        ADD(baselineStubsOptimized);\n        ADD(ionData);\n        ADD(compartmentObject);\n        ADD(crossCompartmentWrappersTable);\n        ADD(regexpCompartment);\n        ADD(debuggeesSet);\n\n        #undef ADD\n\n        typeInference.add(cStats.typeInference);\n    }\n\n    // The size of all the live things in the GC heap.\n    size_t GCHeapThingsSize();\n};\n\nstruct RuntimeStats\n{\n    RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)\n      : runtime(),\n        gcHeapChunkTotal(0),\n        gcHeapDecommittedArenas(0),\n        gcHeapUnusedChunks(0),\n        gcHeapUnusedArenas(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapChunkAdmin(0),\n        gcHeapGcThings(0),\n        cTotals(),\n        zTotals(),\n        compartmentStatsVector(),\n        zoneStatsVector(),\n        currZoneStats(NULL),\n        mallocSizeOf_(mallocSizeOf)\n    {}\n\n    RuntimeSizes runtime;\n\n    // If you add a new number, remember to update the constructor!\n\n    // Here's a useful breakdown of the GC heap.\n    //\n    // - rtStats.gcHeapChunkTotal\n    //   - decommitted bytes\n    //     - rtStats.gcHeapDecommittedArenas (decommitted arenas in non-empty chunks)\n    //   - unused bytes\n    //     - rtStats.gcHeapUnusedChunks (empty chunks)\n    //     - rtStats.gcHeapUnusedArenas (empty arenas within non-empty chunks)\n    //     - rtStats.total.gcHeapUnusedGcThings (empty GC thing slots within non-empty arenas)\n    //   - used bytes\n    //     - rtStats.gcHeapChunkAdmin\n    //     - rtStats.total.gcHeapArenaAdmin\n    //     - rtStats.gcHeapGcThings (in-use GC things)\n    //\n    // It's possible that some arenas in empty chunks may be decommitted, but\n    // we don't count those under rtStats.gcHeapDecommittedArenas because (a)\n    // it's rare, and (b) this means that rtStats.gcHeapUnusedChunks is a\n    // multiple of the chunk size, which is good.\n\n    size_t gcHeapChunkTotal;\n    size_t gcHeapDecommittedArenas;\n    size_t gcHeapUnusedChunks;\n    size_t gcHeapUnusedArenas;\n    size_t gcHeapUnusedGcThings;\n    size_t gcHeapChunkAdmin;\n    size_t gcHeapGcThings;\n\n    // The sum of all compartment's measurements.\n    CompartmentStats cTotals;\n    ZoneStats zTotals;\n\n    js::Vector<CompartmentStats, 0, js::SystemAllocPolicy> compartmentStatsVector;\n    js::Vector<ZoneStats, 0, js::SystemAllocPolicy> zoneStatsVector;\n\n    ZoneStats *currZoneStats;\n\n    mozilla::MallocSizeOf mallocSizeOf_;\n\n    virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;\n    virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;\n};\n\nclass ObjectPrivateVisitor\n{\n  public:\n    // Within CollectRuntimeStats, this method is called for each JS object\n    // that has an nsISupports pointer.\n    virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0;\n\n    // A callback that gets a JSObject's nsISupports pointer, if it has one.\n    // Note: this function does *not* addref |iface|.\n    typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface);\n    GetISupportsFun getISupports_;\n\n    ObjectPrivateVisitor(GetISupportsFun getISupports)\n      : getISupports_(getISupports)\n    {}\n};\n\nextern JS_PUBLIC_API(bool)\nCollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv);\n\nextern JS_PUBLIC_API(size_t)\nSystemCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nUserCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nPeakSizeOfTemporary(const JSRuntime *rt);\n\n} // namespace JS\n\n#endif /* js_MemoryMetrics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/PropertyKey.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::PropertyKey implementation. */\n\n#ifndef js_PropertyKey_h\n#define js_PropertyKey_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"js/Value.h\"\n\nstruct JSContext;\n\nnamespace JS {\n\nclass PropertyKey;\n\nnamespace detail {\n\nextern JS_PUBLIC_API(bool)\nToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n} // namespace detail\n\n/*\n * A PropertyKey is a key used to access some property on an object.  It is a\n * natural way to represent a property accessed using a JavaScript value.\n *\n * PropertyKey can represent indexes, named properties, and ES6 symbols.  The\n * latter aren't implemented in SpiderMonkey yet, but PropertyKey carves out\n * space for them.\n */\nclass PropertyKey\n{\n    Value v;\n    friend JS_PUBLIC_API(bool) detail::ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n  public:\n    explicit PropertyKey(uint32_t index) : v(PrivateUint32Value(index)) {}\n\n    /*\n     * An index is a string property name whose characters exactly spell out an\n     * unsigned 32-bit integer in decimal: \"0\", \"1\", \"2\", ...., \"4294967294\",\n     * \"4294967295\".\n     */\n    bool isIndex(uint32_t *index) {\n        // The implementation here assumes that private uint32_t are stored\n        // using the int32_t representation.  This is purely an implementation\n        // detail: embedders must not rely upon this!\n        if (!v.isInt32())\n            return false;\n        *index = v.toPrivateUint32();\n        return true;\n    }\n\n    /*\n     * A name is a string property name which is *not* an index.  Note that by\n     * the ECMAScript language grammar, any dotted property access |obj.prop|\n     * will access a named property.\n     */\n    bool isName(JSString **str) {\n        uint32_t dummy;\n        if (isIndex(&dummy))\n            return false;\n        *str = v.toString();\n        return true;\n    }\n\n    /*\n     * A symbol is a property name that's a Symbol, a particular kind of object\n     * in ES6.  It is the only kind of property name that's not a string.\n     *\n     * SpiderMonkey doesn't yet implement symbols, but we're carving out API\n     * space for them in advance.\n     */\n    bool isSymbol() {\n        return false;\n    }\n};\n\ninline bool\nToPropertyKey(JSContext *cx, HandleValue v, PropertyKey *key)\n{\n    if (v.isInt32() && v.toInt32() >= 0) {\n        *key = PropertyKey(uint32_t(v.toInt32()));\n        return true;\n    }\n\n    return detail::ToPropertyKeySlow(cx, v, key);\n}\n\n} // namespace JS\n\n#endif /* js_PropertyKey_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/RequiredDefines.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Various #defines required to build SpiderMonkey.  Embedders should add this\n * file to the start of the command line via -include or a similar mechanism,\n * or SpiderMonkey public headers may not work correctly.\n */\n\n#ifndef js_RequiredDefines_h\n#define js_RequiredDefines_h\n\n/*\n * The c99 defining the limit macros (UINT32_MAX for example), says:\n * C++ implementations should define these macros only when __STDC_LIMIT_MACROS\n * is defined before <stdint.h> is included.\n */\n#define __STDC_LIMIT_MACROS\n\n#endif /* js_RequiredDefines_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/RootingAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_RootingAPI_h\n#define js_RootingAPI_h\n\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\n/*\n * Moving GC Stack Rooting\n *\n * A moving GC may change the physical location of GC allocated things, even\n * when they are rooted, updating all pointers to the thing to refer to its new\n * location. The GC must therefore know about all live pointers to a thing,\n * not just one of them, in order to behave correctly.\n *\n * The |Rooted| and |Handle| classes below are used to root stack locations\n * whose value may be held live across a call that can trigger GC. For a\n * code fragment such as:\n *\n * JSObject *obj = NewObject(cx);\n * DoSomething(cx);\n * ... = obj->lastProperty();\n *\n * If |DoSomething()| can trigger a GC, the stack location of |obj| must be\n * rooted to ensure that the GC does not move the JSObject referred to by\n * |obj| without updating |obj|'s location itself. This rooting must happen\n * regardless of whether there are other roots which ensure that the object\n * itself will not be collected.\n *\n * If |DoSomething()| cannot trigger a GC, and the same holds for all other\n * calls made between |obj|'s definitions and its last uses, then no rooting\n * is required.\n *\n * SpiderMonkey can trigger a GC at almost any time and in ways that are not\n * always clear. For example, the following innocuous-looking actions can\n * cause a GC: allocation of any new GC thing; JSObject::hasProperty;\n * JS_ReportError and friends; and ToNumber, among many others. The following\n * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_,\n * rt->malloc_, and friends and JS_ReportOutOfMemory.\n *\n * The following family of three classes will exactly root a stack location.\n * Incorrect usage of these classes will result in a compile error in almost\n * all cases. Therefore, it is very hard to be incorrectly rooted if you use\n * these classes exclusively. These classes are all templated on the type T of\n * the value being rooted.\n *\n * - Rooted<T> declares a variable of type T, whose value is always rooted.\n *   Rooted<T> may be automatically coerced to a Handle<T>, below. Rooted<T>\n *   should be used whenever a local variable's value may be held live across a\n *   call which can trigger a GC.\n *\n * - Handle<T> is a const reference to a Rooted<T>. Functions which take GC\n *   things or values as arguments and need to root those arguments should\n *   generally use handles for those arguments and avoid any explicit rooting.\n *   This has two benefits. First, when several such functions call each other\n *   then redundant rooting of multiple copies of the GC thing can be avoided.\n *   Second, if the caller does not pass a rooted value a compile error will be\n *   generated, which is quicker and easier to fix than when relying on a\n *   separate rooting analysis.\n *\n * - MutableHandle<T> is a non-const reference to Rooted<T>. It is used in the\n *   same way as Handle<T> and includes a |set(const T &v)| method to allow\n *   updating the value of the referenced Rooted<T>. A MutableHandle<T> can be\n *   created from a Rooted<T> by using |Rooted<T>::operator&()|.\n *\n * In some cases the small performance overhead of exact rooting (measured to\n * be a few nanoseconds on desktop) is too much. In these cases, try the\n * following:\n *\n * - Move all Rooted<T> above inner loops: this allows you to re-use the root\n *   on each iteration of the loop.\n *\n * - Pass Handle<T> through your hot call stack to avoid re-rooting costs at\n *   every invocation.\n *\n * The following diagram explains the list of supported, implicit type\n * conversions between classes of this family:\n *\n *  Rooted<T> ----> Handle<T>\n *     |               ^\n *     |               |\n *     |               |\n *     +---> MutableHandle<T>\n *     (via &)\n *\n * All of these types have an implicit conversion to raw pointers.\n */\n\nnamespace js {\n\nclass Module;\nclass ScriptSourceObject;\n\ntemplate <typename T>\nstruct GCMethods {};\n\ntemplate <typename T>\nclass RootedBase {};\n\ntemplate <typename T>\nclass HandleBase {};\n\ntemplate <typename T>\nclass MutableHandleBase {};\n\ntemplate <typename T>\nclass HeapBase {};\n\n/*\n * js::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for js::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(js::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n *\n * This is the SpiderMonkey internal variant. js::NullPtr should be used in\n * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API\n * symbols.\n */\nstruct NullPtr\n{\n    static void * const constNullValue;\n};\n\nnamespace gc {\nstruct Cell;\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> class Rooted;\n\ntemplate <typename T> class Handle;\ntemplate <typename T> class MutableHandle;\n\n/* This is exposing internal state of the GC for inlining purposes. */\nJS_FRIEND_API(bool) isGCEnabled();\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\nextern void\nCheckStackRoots(JSContext *cx);\n#endif\n\n/*\n * JS::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for JS::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(JS::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n */\nstruct JS_PUBLIC_API(NullPtr)\n{\n    static void * const constNullValue;\n};\n\n/*\n * The Heap<T> class is a C/C++ heap-stored reference to a JS GC thing.  All\n * members of heap classes that refer to GC thing should use Heap<T> (or\n * possibly TenuredHeap<T>, described below).\n *\n * Heap<T> wraps the complex mechanisms required to ensure GC safety for the\n * contained reference into a C++ class that behaves similarly to a normal\n * pointer.\n *\n * GC references stored on the C/C++ stack must use Rooted/Handle/MutableHandle\n * instead.\n *\n * Requirements for type T:\n *  - Must be one of: Value, jsid, JSObject*, JSString*, JSScript*\n */\ntemplate <typename T>\nclass Heap : public js::HeapBase<T>\n{\n  public:\n    Heap() {\n        static_assert(sizeof(T) == sizeof(Heap<T>),\n                      \"Heap<T> must be binary compatible with T.\");\n        init(js::GCMethods<T>::initial());\n    }\n    explicit Heap(T p) { init(p); }\n    explicit Heap(const Heap<T> &p) { init(p.ptr); }\n\n    ~Heap() {\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            relocate();\n    }\n\n    bool operator==(const Heap<T> &other) { return ptr == other.ptr; }\n    bool operator!=(const Heap<T> &other) { return ptr != other.ptr; }\n\n    bool operator==(const T &other) const { return ptr == other; }\n    bool operator!=(const T &other) const { return ptr != other; }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    const T *address() const { return &ptr; }\n    const T &get() const { return ptr; }\n\n    T *unsafeGet() { return &ptr; }\n\n    Heap<T> &operator=(T p) {\n        set(p);\n        return *this;\n    }\n\n    void set(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (js::GCMethods<T>::needsPostBarrier(newPtr)) {\n            ptr = newPtr;\n            post();\n        } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {\n            relocate();  /* Called before overwriting ptr. */\n            ptr = newPtr;\n        } else {\n            ptr = newPtr;\n        }\n    }\n\n  private:\n    void init(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        ptr = newPtr;\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            post();\n    }\n\n    void post() {\n#ifdef JSGC_GENERATIONAL\n        JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));\n        js::GCMethods<T>::postBarrier(&ptr);\n#endif\n    }\n\n    void relocate() {\n#ifdef JSGC_GENERATIONAL\n        js::GCMethods<T>::relocate(&ptr);\n#endif\n    }\n\n    T ptr;\n};\n\n#ifdef DEBUG\n/*\n * For generational GC, assert that an object is in the tenured generation as\n * opposed to being in the nursery.\n */\nextern JS_FRIEND_API(void)\nAssertGCThingMustBeTenured(JSObject* obj);\n#else\ninline void\nAssertGCThingMustBeTenured(JSObject *obj) {}\n#endif\n\n/*\n * The TenuredHeap<T> class is similar to the Heap<T> class above in that it\n * encapsulates the GC concerns of an on-heap reference to a JS object. However,\n * it has two important differences:\n *\n *  1) Pointers which are statically known to only reference \"tenured\" objects\n *     can avoid the extra overhead of SpiderMonkey's write barriers.\n *\n *  2) Objects in the \"tenured\" heap have stronger alignment restrictions than\n *     those in the \"nursery\", so it is possible to store flags in the lower\n *     bits of pointers known to be tenured. TenuredHeap wraps a normal tagged\n *     pointer with a nice API for accessing the flag bits and adds various\n *     assertions to ensure that it is not mis-used.\n *\n * GC things are said to be \"tenured\" when they are located in the long-lived\n * heap: e.g. they have gained tenure as an object by surviving past at least\n * one GC. For performance, SpiderMonkey allocates some things which are known\n * to normally be long lived directly into the tenured generation; for example,\n * global objects. Additionally, SpiderMonkey does not visit individual objects\n * when deleting non-tenured objects, so object with finalizers are also always\n * tenured; for instance, this includes most DOM objects.\n *\n * The considerations to keep in mind when using a TenuredHeap<T> vs a normal\n * Heap<T> are:\n *\n *  - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing.\n *  - It is however valid for a Heap<T> to refer to a tenured thing.\n *  - It is not possible to store flag bits in a Heap<T>.\n */\ntemplate <typename T>\nclass TenuredHeap : public js::HeapBase<T>\n{\n  public:\n    TenuredHeap() : bits(0) {\n        static_assert(sizeof(T) == sizeof(TenuredHeap<T>),\n                      \"TenuredHeap<T> must be binary compatible with T.\");\n    }\n    explicit TenuredHeap(T p) : bits(0) { setPtr(p); }\n    explicit TenuredHeap(const TenuredHeap<T> &p) : bits(0) { setPtr(p.ptr); }\n\n    bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }\n    bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }\n\n    void setPtr(T newPtr) {\n        JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (newPtr)\n            AssertGCThingMustBeTenured(newPtr);\n        bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);\n    }\n\n    void setFlags(uintptr_t flagsToSet) {\n        JS_ASSERT((flagsToSet & ~flagsMask) == 0);\n        bits |= flagsToSet;\n    }\n\n    void unsetFlags(uintptr_t flagsToUnset) {\n        JS_ASSERT((flagsToUnset & ~flagsMask) == 0);\n        bits &= ~flagsToUnset;\n    }\n\n    bool hasFlag(uintptr_t flag) const {\n        JS_ASSERT((flag & ~flagsMask) == 0);\n        return (bits & flag) != 0;\n    }\n\n    T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }\n    uintptr_t getFlags() const { return bits & flagsMask; }\n\n    operator T() const { return getPtr(); }\n    T operator->() const { return getPtr(); }\n\n    TenuredHeap<T> &operator=(T p) {\n        setPtr(p);\n        return *this;\n    }\n\n    /*\n     * Set the pointer to a value which will cause a crash if it is\n     * dereferenced.\n     */\n    void setToCrashOnTouch() {\n        bits = (bits & flagsMask) | crashOnTouchPointer;\n    }\n\n    bool isSetToCrashOnTouch() {\n        return (bits & ~flagsMask) == crashOnTouchPointer;\n    }\n\n  private:\n    enum {\n        maskBits = 3,\n        flagsMask = (1 << maskBits) - 1,\n        crashOnTouchPointer = 1 << maskBits\n    };\n\n    uintptr_t bits;\n};\n\n/*\n * Reference to a T that has been rooted elsewhere. This is most useful\n * as a parameter type, which guarantees that the T lvalue is properly\n * rooted. See \"Move GC Stack Rooting\" above.\n *\n * If you want to add additional methods to Handle for a specific\n * specialization, define a HandleBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>\n{\n    friend class MutableHandle<T>;\n\n  public:\n    /* Creates a handle from a handle of a type convertible to T. */\n    template <typename S>\n    Handle(Handle<S> handle,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)\n    {\n        static_assert(sizeof(Handle<T>) == sizeof(T *),\n                      \"Handle must be binary compatible with T*.\");\n        ptr = reinterpret_cast<const T *>(handle.address());\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(js::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"js::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&js::NullPtr::constNullValue);\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(JS::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"JS::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&JS::NullPtr::constNullValue);\n    }\n\n    Handle(MutableHandle<T> handle) {\n        ptr = handle.address();\n    }\n\n    /*\n     * Take care when calling this method!\n     *\n     * This creates a Handle from the raw location of a T.\n     *\n     * It should be called only if the following conditions hold:\n     *\n     *  1) the location of the T is guaranteed to be marked (for some reason\n     *     other than being a Rooted), e.g., if it is guaranteed to be reachable\n     *     from an implicit root.\n     *\n     *  2) the contents of the location are immutable, or at least cannot change\n     *     for the lifetime of the handle, as its users may not expect its value\n     *     to change underneath them.\n     */\n    static Handle fromMarkedLocation(const T *p) {\n        Handle h;\n        h.ptr = p;\n        return h;\n    }\n\n    /*\n     * Construct a handle from an explicitly rooted location. This is the\n     * normal way to create a handle, and normally happens implicitly.\n     */\n    template <typename S>\n    inline\n    Handle(const Rooted<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    /* Construct a read only handle from a mutable handle. */\n    template <typename S>\n    inline\n    Handle(MutableHandle<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    const T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a Handle<T> to something that\n     * takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n    bool operator!=(const T &other) const { return *ptr != other; }\n    bool operator==(const T &other) const { return *ptr == other; }\n\n  private:\n    Handle() {}\n\n    const T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\ntypedef Handle<JSObject*>                   HandleObject;\ntypedef Handle<js::Module*>                 HandleModule;\ntypedef Handle<js::ScriptSourceObject *>    HandleScriptSource;\ntypedef Handle<JSFunction*>                 HandleFunction;\ntypedef Handle<JSScript*>                   HandleScript;\ntypedef Handle<JSString*>                   HandleString;\ntypedef Handle<jsid>                        HandleId;\ntypedef Handle<Value>                       HandleValue;\n\n/*\n * Similar to a handle, but the underlying storage can be changed. This is\n * useful for outparams.\n *\n * If you want to add additional methods to MutableHandle for a specific\n * specialization, define a MutableHandleBase<T> specialization containing\n * them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    inline MutableHandle(Rooted<T> *root);\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    /*\n     * This may be called only if the location of the T is guaranteed\n     * to be marked (for some reason other than being a Rooted),\n     * e.g., if it is guaranteed to be reachable from an implicit root.\n     *\n     * Create a MutableHandle from a raw location of a T.\n     */\n    static MutableHandle fromMarkedLocation(T *p) {\n        MutableHandle h;\n        h.ptr = p;\n        return h;\n    }\n\n    T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a MutableHandle<T> to something that takes\n     * a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    MutableHandle() {}\n\n    T *ptr;\n\n    template <typename S> void operator=(S v) MOZ_DELETE;\n    void operator=(MutableHandle other) MOZ_DELETE;\n};\n\ntypedef MutableHandle<JSObject*>   MutableHandleObject;\ntypedef MutableHandle<JSFunction*> MutableHandleFunction;\ntypedef MutableHandle<JSScript*>   MutableHandleScript;\ntypedef MutableHandle<JSString*>   MutableHandleString;\ntypedef MutableHandle<jsid>        MutableHandleId;\ntypedef MutableHandle<Value>       MutableHandleValue;\n\n#ifdef JSGC_GENERATIONAL\nJS_PUBLIC_API(void) HeapCellPostBarrier(js::gc::Cell **cellp);\nJS_PUBLIC_API(void) HeapCellRelocate(js::gc::Cell **cellp);\n#endif\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * InternalHandle is a handle to an internal pointer into a gcthing. Use\n * InternalHandle when you have a pointer to a direct field of a gcthing, or\n * when you need a parameter type for something that *may* be a pointer to a\n * direct field of a gcthing.\n */\ntemplate <typename T>\nclass InternalHandle {};\n\ntemplate <typename T>\nclass InternalHandle<T*>\n{\n    void * const *holder;\n    size_t offset;\n\n  public:\n    /*\n     * Create an InternalHandle using a Handle to the gcthing containing the\n     * field in question, and a pointer to the field.\n     */\n    template<typename H>\n    InternalHandle(const JS::Handle<H> &handle, T *field)\n      : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get()))\n    {}\n\n    /*\n     * Create an InternalHandle to a field within a Rooted<>.\n     */\n    template<typename R>\n    InternalHandle(const JS::Rooted<R> &root, T *field)\n      : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get()))\n    {}\n\n    T *get() const { return reinterpret_cast<T*>(uintptr_t(*holder) + offset); }\n\n    const T &operator*() const { return *get(); }\n    T *operator->() const { return get(); }\n\n    static InternalHandle<T*> fromMarkedLocation(T *fieldPtr) {\n        return InternalHandle(fieldPtr);\n    }\n\n  private:\n    /*\n     * Create an InternalHandle to something that is not a pointer to a\n     * gcthing, and so does not need to be rooted in the first place. Use these\n     * InternalHandles to pass pointers into functions that also need to accept\n     * regular InternalHandles to gcthing fields.\n     *\n     * Make this private to prevent accidental misuse; this is only for\n     * fromMarkedLocation().\n     */\n    InternalHandle(T *field)\n      : holder(reinterpret_cast<void * const *>(&js::NullPtr::constNullValue)),\n        offset(uintptr_t(field))\n    {}\n};\n\n/*\n * By default, pointers should use the inheritance hierarchy to find their\n * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that\n * Rooted<T> may be used without the class definition being available.\n */\ntemplate <typename T>\nstruct RootKind<T *>\n{\n    static ThingRootKind rootKind() { return T::rootKind(); }\n};\n\ntemplate <typename T>\nstruct GCMethods<T *>\n{\n    static T *initial() { return NULL; }\n    static ThingRootKind kind() { return RootKind<T *>::rootKind(); }\n    static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }\n    static bool needsPostBarrier(T *v) { return v; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(T **vp) {\n        JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n    static void relocate(T **vp) {\n        JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n#endif\n};\n\n// XXX: Needed for cocos2d JS Bindings\n//#if defined(DEBUG)\n/* This helper allows us to assert that Rooted<T> is scoped within a request. */\nextern JS_PUBLIC_API(bool)\nIsInRequest(JSContext *cx);\n//#endif\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Local variable of type T whose value is always rooted. This is typically\n * used for local variables, or for non-rooted values being passed to a\n * function that requires a handle, e.g. Foo(Root<T>(cx, x)).\n *\n * If you want to add additional methods to Rooted for a specific\n * specialization, define a RootedBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS Rooted : public js::RootedBase<T>\n{\n    /* Note: CX is a subclass of either ContextFriendFields or PerThreadDataFriendFields. */\n    template <typename CX>\n    void init(CX *cx) {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        js::ThingRootKind kind = js::GCMethods<T>::kind();\n        this->stack = &cx->thingGCRooters[kind];\n        this->prev = *stack;\n        *stack = reinterpret_cast<Rooted<void*>*>(this);\n\n        JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));\n#endif\n    }\n\n  public:\n    Rooted(JSContext *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(JSContext *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(js::ContextFriendFields *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::ContextFriendFields *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(JSRuntime *rt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    Rooted(JSRuntime *rt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    ~Rooted() {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));\n        *stack = prev;\n#endif\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<T> *previous() { return prev; }\n#endif\n\n    /*\n     * Important: Return a reference here so passing a Rooted<T> to\n     * something that takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    T &operator=(const Rooted &value) {\n        ptr = value;\n        return ptr;\n    }\n\n    void set(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<void*> **stack, *prev;\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /* Has the rooting analysis ever scanned this Rooted's stack location? */\n    friend void JS::CheckStackRoots(JSContext*);\n#endif\n\n#ifdef JSGC_ROOT_ANALYSIS\n    bool scanned;\n#endif\n\n    /*\n     * |ptr| must be the last field in Rooted because the analysis treats all\n     * Rooted as Rooted<void*> during the analysis. See bug 829372.\n     */\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    Rooted(const Rooted &) MOZ_DELETE;\n};\n\n#if !(defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING))\n// Defined in vm/String.h.\ntemplate <>\nclass Rooted<JSStableString *>;\n#endif\n\ntypedef Rooted<JSObject*>                   RootedObject;\ntypedef Rooted<js::Module*>                 RootedModule;\ntypedef Rooted<js::ScriptSourceObject *>    RootedScriptSource;\ntypedef Rooted<JSFunction*>                 RootedFunction;\ntypedef Rooted<JSScript*>                   RootedScript;\ntypedef Rooted<JSString*>                   RootedString;\ntypedef Rooted<jsid>                        RootedId;\ntypedef Rooted<JS::Value>                   RootedValue;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Mark a stack location as a root for the rooting analysis, without actually\n * rooting it in release builds. This should only be used for stack locations\n * of GC things that cannot be relocated by a garbage collection, and that\n * are definitely reachable via another path.\n */\nclass SkipRoot\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n\n    SkipRoot **stack, *prev;\n    const uint8_t *start;\n    const uint8_t *end;\n\n    template <typename CX, typename T>\n    void init(CX *cx, const T *ptr, size_t count) {\n        SkipRoot **head = &cx->skipGCRooters;\n        this->stack = head;\n        this->prev = *stack;\n        *stack = this;\n        this->start = (const uint8_t *) ptr;\n        this->end = this->start + (sizeof(T) * count);\n    }\n\n  public:\n    ~SkipRoot() {\n        JS_ASSERT(*stack == this);\n        *stack = prev;\n    }\n\n    SkipRoot *previous() { return prev; }\n\n    bool contains(const uint8_t *v, size_t len) {\n        return v >= start && v + len <= end;\n    }\n\n#else /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {}\n\n  public:\n\n#endif /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    SkipRoot(JSContext *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(ContextFriendFields::get(cx), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(ContextFriendFields *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(cx, ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(PerThreadData *pt, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(PerThreadDataFriendFields::get(pt), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Interface substitute for Rooted<T> which does not root the variable's memory. */\ntemplate <typename T>\nclass FakeRooted : public RootedBase<T>\n{\n  public:\n    template <typename CX>\n    FakeRooted(CX *cx\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename CX>\n    FakeRooted(CX *cx, T initial\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    FakeRooted(const FakeRooted &) MOZ_DELETE;\n};\n\n/* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */\ntemplate <typename T>\nclass FakeMutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    FakeMutableHandle(T *t) {\n        ptr = t;\n    }\n\n    FakeMutableHandle(FakeRooted<T> *root) {\n        ptr = root->address();\n    }\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    T *address() const { return ptr; }\n    T get() const { return *ptr; }\n\n    operator T() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    FakeMutableHandle() {}\n\n    T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\n/*\n * Types for a variable that either should or shouldn't be rooted, depending on\n * the template parameter Rooted. Used for implementing functions that can\n * operate on either rooted or unrooted data.\n *\n * The toHandle() and toMutableHandle() functions are for calling functions\n * which require handle types and are only called in the CanGC case. These\n * allow the calling code to type check.\n */\nenum AllowGC {\n    NoGC = 0,\n    CanGC = 1\n};\ntemplate <typename T, AllowGC allowGC>\nclass MaybeRooted\n{\n};\n\ntemplate <typename T> class MaybeRooted<T, CanGC>\n{\n  public:\n    typedef JS::Handle<T> HandleType;\n    typedef JS::Rooted<T> RootType;\n    typedef JS::MutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        return v;\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        return v;\n    }\n};\n\ntemplate <typename T> class MaybeRooted<T, NoGC>\n{\n  public:\n    typedef T HandleType;\n    typedef FakeRooted<T> RootType;\n    typedef FakeMutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n};\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(const Rooted<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(MutableHandle<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T>\ninline\nMutableHandle<T>::MutableHandle(Rooted<T> *root)\n{\n    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),\n                  \"MutableHandle must be binary compatible with T*.\");\n    ptr = root->address();\n}\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Hook for dynamic root analysis. Checks the native stack and poisons\n * references to GC things which have not been rooted.\n */\ninline void MaybeCheckStackRoots(JSContext *cx)\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    JS::CheckStackRoots(cx);\n#endif\n}\n\n/* Base class for automatic read-only object rooting during compilation. */\nclass CompilerRootNode\n{\n  protected:\n    CompilerRootNode(js::gc::Cell *ptr) : next(NULL), ptr_(ptr) {}\n\n  public:\n    void **address() { return (void **)&ptr_; }\n\n  public:\n    CompilerRootNode *next;\n\n  protected:\n    js::gc::Cell *ptr_;\n};\n\n}  /* namespace js */\n\n#endif  /* js_RootingAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/Utility.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Utility_h\n#define js_Utility_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/Scoped.h\"\n#include \"mozilla/TemplateLib.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef JS_OOM_DO_BACKTRACES\n#include <stdio.h>\n#include <execinfo.h>\n#endif\n\n#include \"jstypes.h\"\n\n/* The public JS engine namespace. */\nnamespace JS {}\n\n/* The mozilla-shared reusable template/utility namespace. */\nnamespace mozilla {}\n\n/* The private JS engine namespace. */\nnamespace js {}\n\n/*\n * Pattern used to overwrite freed memory. If you are accessing an object with\n * this pattern, you probably have a dangling pointer.\n */\n#define JS_FREE_PATTERN 0xDA\n\n#define JS_ASSERT(expr)           MOZ_ASSERT(expr)\n#define JS_ASSERT_IF(cond, expr)  MOZ_ASSERT_IF(cond, expr)\n#define JS_ALWAYS_TRUE(expr)      MOZ_ALWAYS_TRUE(expr)\n#define JS_ALWAYS_FALSE(expr)     MOZ_ALWAYS_FALSE(expr)\n\n#ifdef DEBUG\n# ifdef JS_THREADSAFE\n#  define JS_THREADSAFE_ASSERT(expr) JS_ASSERT(expr)\n# else\n#  define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n# endif\n#else\n# define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n#endif\n\n#if defined(DEBUG)\n# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)\n#elif defined(JS_CRASH_DIAGNOSTICS)\n# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)\n#else\n# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)\n#endif\n\n#define JS_STATIC_ASSERT(cond)           static_assert(cond, \"JS_STATIC_ASSERT\")\n#define JS_STATIC_ASSERT_IF(cond, expr)  MOZ_STATIC_ASSERT_IF(cond, expr, \"JS_STATIC_ASSERT_IF\")\n\nextern MOZ_NORETURN JS_PUBLIC_API(void)\nJS_Assert(const char *s, const char *file, int ln);\n\n/*\n * Abort the process in a non-graceful manner. This will cause a core file,\n * call to the debugger or other moral equivalent as well as causing the\n * entire process to stop.\n */\nextern JS_PUBLIC_API(void) JS_Abort(void);\n\n/*\n * Custom allocator support for SpiderMonkey\n */\n#if defined JS_USE_CUSTOM_ALLOCATOR\n# include \"jscustomallocator.h\"\n#else\n# ifdef DEBUG\n/*\n * In order to test OOM conditions, when the testing function\n * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th\n * allocation from now.\n */\nextern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtins/TestingFunctions.cpp */\nextern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */\n\n#ifdef JS_OOM_DO_BACKTRACES\n#define JS_OOM_BACKTRACE_SIZE 32\nstatic JS_ALWAYS_INLINE void\nPrintBacktrace()\n{\n    void* OOM_trace[JS_OOM_BACKTRACE_SIZE];\n    char** OOM_traceSymbols = NULL;\n    int32_t OOM_traceSize = 0;\n    int32_t OOM_traceIdx = 0;\n    OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE);\n    OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize);\n\n    if (!OOM_traceSymbols)\n        return;\n\n    for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) {\n        fprintf(stderr, \"#%d %s\\n\", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]);\n    }\n\n    free(OOM_traceSymbols);\n}\n\n#define JS_OOM_EMIT_BACKTRACE() \\\n    do {\\\n        fprintf(stderr, \"Forcing artificial memory allocation function failure:\\n\");\\\n\tPrintBacktrace();\\\n    } while (0)\n# else\n#  define JS_OOM_EMIT_BACKTRACE() do {} while(0)\n#endif /* JS_OOM_DO_BACKTRACES */\n\n#  define JS_OOM_POSSIBLY_FAIL() \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            js_ReportOutOfMemory(cx);\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n# else\n#  define JS_OOM_POSSIBLY_FAIL() do {} while(0)\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)\n# endif /* DEBUG */\n\nstatic JS_INLINE void* js_malloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return malloc(bytes);\n}\n\nstatic JS_INLINE void* js_calloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(bytes, 1);\n}\n\nstatic JS_INLINE void* js_calloc(size_t nmemb, size_t size)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(nmemb, size);\n}\n\nstatic JS_INLINE void* js_realloc(void* p, size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return realloc(p, bytes);\n}\n\nstatic JS_INLINE void js_free(void* p)\n{\n    free(p);\n}\n#endif/* JS_USE_CUSTOM_ALLOCATOR */\n\n/*\n * JS_ROTATE_LEFT32\n *\n * There is no rotate operation in the C Language so the construct (a << 4) |\n * (a >> 28) is used instead. Most compilers convert this to a rotate\n * instruction but some versions of MSVC don't without a little help.  To get\n * MSVC to generate a rotate instruction, we have to use the _rotl intrinsic\n * and use a pragma to make _rotl inline.\n *\n * MSVC in VS2005 will do an inline rotate instruction on the above construct.\n */\n#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \\\n    defined(_M_X64))\n#include <stdlib.h>\n#pragma intrinsic(_rotl)\n#define JS_ROTATE_LEFT32(a, bits) _rotl(a, bits)\n#else\n#define JS_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))\n#endif\n\n#include <new>\n\n/*\n * Low-level memory management in SpiderMonkey:\n *\n *  ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these\n *     to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's\n *     these symbols.\n *\n *  ** Do not use the builtin C++ operator new and delete: these throw on\n *     error and we cannot override them not to.\n *\n * Allocation:\n *\n * - If the lifetime of the allocation is tied to the lifetime of a GC-thing\n *   (that is, finalizing the GC-thing will free the allocation), call one of\n *   the following functions:\n *\n *     JSContext::{malloc_,realloc_,calloc_,new_}\n *     JSRuntime::{malloc_,realloc_,calloc_,new_}\n *\n *   These functions accumulate the number of bytes allocated which is used as\n *   part of the GC-triggering heuristic.\n *\n *   The difference between the JSContext and JSRuntime versions is that the\n *   cx version reports an out-of-memory error on OOM. (This follows from the\n *   general SpiderMonkey idiom that a JSContext-taking function reports its\n *   own errors.)\n *\n * - Otherwise, use js_malloc/js_realloc/js_calloc/js_free/js_new\n *\n * Deallocation:\n *\n * - Ordinarily, use js_free/js_delete.\n *\n * - For deallocations during GC finalization, use one of the following\n *   operations on the FreeOp provided to the finalizer:\n *\n *     FreeOp::{free_,delete_}\n *\n *   The advantage of these operations is that the memory is batched and freed\n *   on another thread.\n */\n\n#define JS_NEW_BODY(allocator, t, parms)                                       \\\n    void *memory = allocator(sizeof(t));                                       \\\n    return memory ? new(memory) t parms : NULL;\n\n/*\n * Given a class which should provide 'new' methods, add\n * JS_DECLARE_NEW_METHODS (see JSContext for a usage example). This\n * adds news with up to 12 parameters. Add more versions of new below if\n * you need more than 12 parameters.\n *\n * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,\n * or the build will break.\n */\n#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\\\n    template <class T>\\\n    QUALIFIERS T *NEWNAME() {\\\n        JS_NEW_BODY(ALLOCATOR, T, ())\\\n    }\\\n\\\n    template <class T, class P1>\\\n    QUALIFIERS T *NEWNAME(P1 p1) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1))\\\n    }\\\n\\\n    template <class T, class P1, class P2>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\\\n    }\\\n\nJS_DECLARE_NEW_METHODS(js_new, js_malloc, static JS_ALWAYS_INLINE)\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE void\njs_delete(T *p)\n{\n    if (p) {\n        p->~T();\n        js_free(p);\n    }\n}\n\ntemplate<class T>\nstatic JS_ALWAYS_INLINE void\njs_delete_poison(T *p)\n{\n    if (p) {\n        p->~T();\n        memset(p, 0x3B, sizeof(T));\n        js_free(p);\n    }\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc()\n{\n    return (T *)js_malloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc()\n{\n    return (T *)js_calloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_malloc(numElems * sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_calloc(numElems * sizeof(T));\n}\n\nnamespace js {\n\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return NULL; }\n    static void release(T* ptr) { js_free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits)\n\ntemplate <typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { js_delete(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits)\n\ntemplate <typename T>\nstruct ScopedReleasePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { if (ptr) ptr->release(); }\n};\nSCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits)\n\n} /* namespace js */\n\nnamespace js {\n\n/* Integral types for all hash functions. */\ntypedef uint32_t HashNumber;\nconst unsigned HashNumberSizeBits = 32;\n\nnamespace detail {\n\n/*\n * Given a raw hash code, h, return a number that can be used to select a hash\n * bucket.\n *\n * This function aims to produce as uniform an output distribution as possible,\n * especially in the most significant (leftmost) bits, even though the input\n * distribution may be highly nonrandom, given the constraints that this must\n * be deterministic and quick to compute.\n *\n * Since the leftmost bits of the result are best, the hash bucket index is\n * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent\n * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask.\n *\n * FIXME: OrderedHashTable uses a bit-mask; see bug 775896.\n */\ninline HashNumber\nScrambleHashCode(HashNumber h)\n{\n    /*\n     * Simply returning h would not cause any hash tables to produce wrong\n     * answers. But it can produce pathologically bad performance: The caller\n     * right-shifts the result, keeping only the highest bits. The high bits of\n     * hash codes are very often completely entropy-free. (So are the lowest\n     * bits.)\n     *\n     * So we use Fibonacci hashing, as described in Knuth, The Art of Computer\n     * Programming, 6.4. This mixes all the bits of the input hash code h.\n     * \n     * The value of goldenRatio is taken from the hex\n     * expansion of the golden ratio, which starts 1.9E3779B9....\n     * This value is especially good if values with consecutive hash codes\n     * are stored in a hash table; see Knuth for details.\n     */\n    static const HashNumber goldenRatio = 0x9E3779B9U;\n    return h * goldenRatio;\n}\n\n} /* namespace detail */\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Methods for poisoning GC heap pointer words and checking for poisoned words.\n * These are in this file for use in Value methods and so forth.\n *\n * If the moving GC hazard analysis is in use and detects a non-rooted stack\n * pointer to a GC thing, one byte of that pointer is poisoned to refer to an\n * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the\n * pointer is overwritten, to reduce the likelihood of accidentally changing\n * a live integer value.\n */\n\ninline void PoisonPtr(void *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint8_t *ptr = (uint8_t *) v + 3;\n    *ptr = JS_FREE_PATTERN;\n#endif\n}\n\ntemplate <typename T>\ninline bool IsPoisonedPtr(T *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint32_t mask = uintptr_t(v) & 0xff000000;\n    return mask == uint32_t(JS_FREE_PATTERN << 24);\n#else\n    return false;\n#endif\n}\n\n}\n\n/* sixgill annotation defines */\n#ifndef HAVE_STATIC_ANNOTATIONS\n# define HAVE_STATIC_ANNOTATIONS\n# ifdef XGILL_PLUGIN\n#  define STATIC_PRECONDITION(COND)         __attribute__((precondition(#COND)))\n#  define STATIC_PRECONDITION_ASSUME(COND)  __attribute__((precondition_assume(#COND)))\n#  define STATIC_POSTCONDITION(COND)        __attribute__((postcondition(#COND)))\n#  define STATIC_POSTCONDITION_ASSUME(COND) __attribute__((postcondition_assume(#COND)))\n#  define STATIC_INVARIANT(COND)            __attribute__((invariant(#COND)))\n#  define STATIC_INVARIANT_ASSUME(COND)     __attribute__((invariant_assume(#COND)))\n#  define STATIC_PASTE2(X,Y) X ## Y\n#  define STATIC_PASTE1(X,Y) STATIC_PASTE2(X,Y)\n#  define STATIC_ASSERT(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assert_static(#COND), unused))    \\\n    int STATIC_PASTE1(assert_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSUME(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assume_static(#COND), unused))    \\\n    int STATIC_PASTE1(assume_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)                       \\\n  JS_BEGIN_MACRO                                            \\\n    __attribute__((assert_static_runtime(#COND), unused))   \\\n    int STATIC_PASTE1(assert_static_runtime_, __COUNTER__); \\\n  JS_END_MACRO\n# else /* XGILL_PLUGIN */\n#  define STATIC_PRECONDITION(COND)          /* nothing */\n#  define STATIC_PRECONDITION_ASSUME(COND)   /* nothing */\n#  define STATIC_POSTCONDITION(COND)         /* nothing */\n#  define STATIC_POSTCONDITION_ASSUME(COND)  /* nothing */\n#  define STATIC_INVARIANT(COND)             /* nothing */\n#  define STATIC_INVARIANT_ASSUME(COND)      /* nothing */\n#  define STATIC_ASSERT(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSUME(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)  JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n# endif /* XGILL_PLUGIN */\n# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())\n#endif /* HAVE_STATIC_ANNOTATIONS */\n\n#endif /* js_Utility_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/Value.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Value implementation. */\n\n#ifndef js_Value_h\n#define js_Value_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/Likely.h\"\n\n#include <limits> /* for std::numeric_limits */\n\n#include \"js/Anchor.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n\nnamespace JS { class Value; }\n\n/* JS::Value can store a full int32_t. */\n#define JSVAL_INT_BITS          32\n#define JSVAL_INT_MIN           ((int32_t)0x80000000)\n#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)\n\n/*\n * Try to get jsvals 64-bit aligned. We could almost assert that all values are\n * aligned, but MSVC and GCC occasionally break alignment.\n */\n#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__)\n# define JSVAL_ALIGNMENT        __attribute__((aligned (8)))\n#elif defined(_MSC_VER)\n  /*\n   * Structs can be aligned with MSVC, but not if they are used as parameters,\n   * so we just don't try to align.\n   */\n# define JSVAL_ALIGNMENT\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n# define JSVAL_ALIGNMENT\n#elif defined(__HP_cc) || defined(__HP_aCC)\n# define JSVAL_ALIGNMENT\n#endif\n\n#if JS_BITS_PER_WORD == 64\n# define JSVAL_TAG_SHIFT 47\n#endif\n\n/*\n * We try to use enums so that printing a jsval_layout in the debugger shows\n * nice symbolic type tags, however we can only do this when we can force the\n * underlying type of the enum to be the desired size.\n */\n#if !defined(__SUNPRO_CC) && !defined(__xlC__)\n\n#if defined(_MSC_VER)\n# define JS_ENUM_HEADER(id, type)              enum id : type\n# define JS_ENUM_FOOTER(id)\n#else\n# define JS_ENUM_HEADER(id, type)              enum id\n# define JS_ENUM_FOOTER(id)                    __attribute__((packed))\n#endif\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueType, uint8_t)\n{\n    JSVAL_TYPE_DOUBLE              = 0x00,\n    JSVAL_TYPE_INT32               = 0x01,\n    JSVAL_TYPE_UNDEFINED           = 0x02,\n    JSVAL_TYPE_BOOLEAN             = 0x03,\n    JSVAL_TYPE_MAGIC               = 0x04,\n    JSVAL_TYPE_STRING              = 0x05,\n    JSVAL_TYPE_NULL                = 0x06,\n    JSVAL_TYPE_OBJECT              = 0x07,\n\n    /* These never appear in a jsval; they are only provided as an out-of-band value. */\n    JSVAL_TYPE_UNKNOWN             = 0x20,\n    JSVAL_TYPE_MISSING             = 0x21\n} JS_ENUM_FOOTER(JSValueType);\n\nJS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n\n#if JS_BITS_PER_WORD == 32\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_CLEAR                = 0xFFFFFF80,\n    JSVAL_TAG_INT32                = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n\n#elif JS_BITS_PER_WORD == 64\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_MAX_DOUBLE           = 0x1FFF0,\n    JSVAL_TAG_INT32                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32_t));\n\nJS_ENUM_HEADER(JSValueShiftedTag, uint64_t)\n{\n    JSVAL_SHIFTED_TAG_MAX_DOUBLE   = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),\n    JSVAL_SHIFTED_TAG_INT32        = (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_UNDEFINED    = (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_STRING       = (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_BOOLEAN      = (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_MAGIC        = (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_NULL         = (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_OBJECT       = (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n} JS_ENUM_FOOTER(JSValueShiftedTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t));\n\n#endif\n\n#else  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\ntypedef uint8_t JSValueType;\n#define JSVAL_TYPE_DOUBLE            ((uint8_t)0x00)\n#define JSVAL_TYPE_INT32             ((uint8_t)0x01)\n#define JSVAL_TYPE_UNDEFINED         ((uint8_t)0x02)\n#define JSVAL_TYPE_BOOLEAN           ((uint8_t)0x03)\n#define JSVAL_TYPE_MAGIC             ((uint8_t)0x04)\n#define JSVAL_TYPE_STRING            ((uint8_t)0x05)\n#define JSVAL_TYPE_NULL              ((uint8_t)0x06)\n#define JSVAL_TYPE_OBJECT            ((uint8_t)0x07)\n#define JSVAL_TYPE_UNKNOWN           ((uint8_t)0x20)\n\n#if JS_BITS_PER_WORD == 32\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_CLEAR              ((uint32_t)(0xFFFFFF80))\n#define JSVAL_TAG_INT32              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32))\n#define JSVAL_TAG_UNDEFINED          ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED))\n#define JSVAL_TAG_STRING             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING))\n#define JSVAL_TAG_BOOLEAN            ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN))\n#define JSVAL_TAG_MAGIC              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC))\n#define JSVAL_TAG_NULL               ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL))\n#define JSVAL_TAG_OBJECT             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT))\n\n#elif JS_BITS_PER_WORD == 64\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_MAX_DOUBLE         ((uint32_t)(0x1FFF0))\n#define JSVAL_TAG_INT32              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32)\n#define JSVAL_TAG_UNDEFINED          (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED)\n#define JSVAL_TAG_STRING             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING)\n#define JSVAL_TAG_BOOLEAN            (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN)\n#define JSVAL_TAG_MAGIC              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC)\n#define JSVAL_TAG_NULL               (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL)\n#define JSVAL_TAG_OBJECT             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT)\n\ntypedef uint64_t JSValueShiftedTag;\n#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF)\n#define JSVAL_SHIFTED_TAG_INT32      (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_UNDEFINED  (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_STRING     (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_BOOLEAN    (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_MAGIC      (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_NULL       (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_OBJECT     (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n\n#endif  /* JS_BITS_PER_WORD */\n#endif  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\n#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET        JSVAL_TYPE_NULL\n#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET          JSVAL_TYPE_OBJECT\n#define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET             JSVAL_TYPE_INT32\n#define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET        JSVAL_TYPE_MAGIC\n\n#if JS_BITS_PER_WORD == 32\n\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_CLEAR | (type)))\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#elif JS_BITS_PER_WORD == 64\n\n#define JSVAL_PAYLOAD_MASK           0x00007FFFFFFFFFFFLL\n#define JSVAL_TAG_MASK               0xFFFF800000000000LL\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))\n#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET  JSVAL_SHIFTED_TAG_NULL\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET    JSVAL_SHIFTED_TAG_OBJECT\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET       JSVAL_SHIFTED_TAG_UNDEFINED\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET      JSVAL_SHIFTED_TAG_STRING\n\n#endif /* JS_BITS_PER_WORD */\n\ntypedef enum JSWhyMagic\n{\n    JS_ELEMENTS_HOLE,            /* a hole in a native object's elements */\n    JS_NATIVE_ENUMERATE,         /* indicates that a custom enumerate hook forwarded\n                                  * to JS_EnumerateState, which really means the object can be\n                                  * enumerated like a native object. */\n    JS_NO_ITER_VALUE,            /* there is not a pending iterator value */\n    JS_GENERATOR_CLOSING,        /* exception value thrown when closing a generator */\n    JS_NO_CONSTANT,              /* compiler sentinel value */\n    JS_THIS_POISON,              /* used in debug builds to catch tracing errors */\n    JS_ARG_POISON,               /* used in debug builds to catch tracing errors */\n    JS_SERIALIZE_NO_NODE,        /* an empty subnode in the AST serializer */\n    JS_LAZY_ARGUMENTS,           /* lazy arguments value on the stack */\n    JS_OPTIMIZED_ARGUMENTS,      /* optimized-away 'arguments' value */\n    JS_IS_CONSTRUCTING,          /* magic value passed to natives to indicate construction */\n    JS_OVERWRITTEN_CALLEE,       /* arguments.callee has been overwritten */\n    JS_FORWARD_TO_CALL_OBJECT,   /* args object element stored in call object */\n    JS_BLOCK_NEEDS_CLONE,        /* value of static block object slot */\n    JS_HASH_KEY_EMPTY,           /* see class js::HashableValue */\n    JS_ION_ERROR,                /* error while running Ion code */\n    JS_ION_BAILOUT,              /* status code to signal EnterIon will OSR into Interpret */\n    JS_GENERIC_MAGIC             /* for local use */\n} JSWhyMagic;\n\n#if defined(IS_LITTLE_ENDIAN)\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n        JSValueTag tag;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n#if !defined(_WIN64)\n    /* MSVC does not pack these correctly :-( */\n    struct {\n        uint64_t           payload47 : 47;\n        JSValueTag         tag : 17;\n    } debugView;\n#endif\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif  /* JS_BITS_PER_WORD */\n#else   /* defined(IS_LITTLE_ENDIAN) */\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag tag;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag         tag : 17;\n        uint64_t           payload47 : 47;\n    } debugView;\n    struct {\n        uint32_t           padding;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif /* JS_BITS_PER_WORD */\n#endif  /* defined(IS_LITTLE_ENDIAN) */\n\nJS_STATIC_ASSERT(sizeof(jsval_layout) == 8);\n\n#if JS_BITS_PER_WORD == 32\n\n/*\n * N.B. GCC, in some but not all cases, chooses to emit signed comparison of\n * JSValueTag even though its underlying type has been forced to be uint32_t.\n * Thus, all comparisons should explicitly cast operands to uint32_t.\n */\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint32_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return l.s.payload.i32;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_INT32;\n    l.s.payload.i32 = i;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    JSValueTag tag = l.s.tag;\n    MOZ_ASSERT(tag != JSVAL_TAG_CLEAR);\n    return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    MOZ_ASSERT(str);\n    l.s.tag = JSVAL_TAG_STRING;\n    l.s.payload.str = str;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return l.s.payload.str;\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.payload.boo;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.s.tag = JSVAL_TAG_BOOLEAN;\n    l.s.payload.boo = b;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT);\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.payload.obj;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    MOZ_ASSERT(obj);\n    l.s.tag = JSVAL_TAG_OBJECT;\n    l.s.payload.obj = obj;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_NULL;\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    MOZ_ASSERT(((uint32_t)ptr & 1) == 0);\n    l.s.tag = (JSValueTag)0;\n    l.s.payload.ptr = ptr;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    /* gcc sometimes generates signed < without explicit casts. */\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_MAGIC;\n    l.s.payload.why = why;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag;\n    return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n    uint32_t type = l.s.tag & 0xF;\n    MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n    return (JSValueType)type;\n}\n\n#elif JS_BITS_PER_WORD == 64\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint64_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE);\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return (int32_t)l.asBits;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i32)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    uint64_t strBits = (uint64_t)str;\n    MOZ_ASSERT(str);\n    MOZ_ASSERT((strBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = strBits | JSVAL_SHIFTED_TAG_STRING;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK);\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (JSBool)l.asBits;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT);\n    return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT);\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (JSObject *)ptrBits;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    uint64_t objBits = (uint64_t)obj;\n    MOZ_ASSERT(obj);\n    MOZ_ASSERT((objBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = objBits | JSVAL_SHIFTED_TAG_OBJECT;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_NULL;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (void *)ptrBits;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l);\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l));\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    uint64_t ptrBits = (uint64_t)ptr;\n    MOZ_ASSERT((ptrBits & 1) == 0);\n    l.asBits = ptrBits >> 1;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0);\n    return (void *)(l.asBits << 1);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)why) | JSVAL_SHIFTED_TAG_MAGIC;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    uint64_t lbits = lhs.asBits, rbits = rhs.asBits;\n    return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) ||\n           (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n   uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF;\n   MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n   return (JSValueType)type;\n}\n\n#endif  /* JS_BITS_PER_WORD */\n\nstatic inline jsval_layout JSVAL_TO_IMPL(JS::Value v);\nstatic inline JS::Value IMPL_TO_JSVAL(jsval_layout l);\n\nnamespace JS {\n\n/**\n * Returns a generic quiet NaN value, with all payload bits set to zero.\n *\n * Among other properties, this NaN's bit pattern conforms to JS::Value's\n * bit pattern restrictions.\n */\nstatic MOZ_ALWAYS_INLINE double\nGenericNaN()\n{\n    return mozilla::SpecificNaN(0, 0x8000000000000ULL);\n}\n\nstatic inline double\nCanonicalizeNaN(double d)\n{\n    if (MOZ_UNLIKELY(mozilla::IsNaN(d)))\n        return GenericNaN();\n    return d;\n}\n\n/*\n * JS::Value is the interface for a single JavaScript Engine value.  A few\n * general notes on JS::Value:\n *\n * - JS::Value has setX() and isX() members for X in\n *\n *     { Int32, Double, String, Boolean, Undefined, Null, Object, Magic }\n *\n *   JS::Value also contains toX() for each of the non-singleton types.\n *\n * - Magic is a singleton type whose payload contains a JSWhyMagic \"reason\" for\n *   the magic value. By providing JSWhyMagic values when creating and checking\n *   for magic values, it is possible to assert, at runtime, that only magic\n *   values with the expected reason flow through a particular value. For\n *   example, if cx->exception has a magic value, the reason must be\n *   JS_GENERATOR_CLOSING.\n *\n * - The JS::Value operations are preferred.  The JSVAL_* operations remain for\n *   compatibility; they may be removed at some point.  These operations mostly\n *   provide similar functionality.  But there are a few key differences.  One\n *   is that JS::Value gives null a separate type. Thus\n *\n *           JSVAL_IS_OBJECT(v) === v.isObjectOrNull()\n *       !JSVAL_IS_PRIMITIVE(v) === v.isObject()\n *\n *   Also, to help prevent mistakenly boxing a nullable JSObject* as an object,\n *   Value::setObject takes a JSObject&. (Conversely, Value::asObject returns a\n *   JSObject&.)  A convenience member Value::setObjectOrNull is provided.\n *\n * - JSVAL_VOID is the same as the singleton value of the Undefined type.\n *\n * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on\n *   32-bit user code should avoid copying jsval/JS::Value as much as possible,\n *   preferring to pass by const Value &.\n */\nclass Value\n{\n  public:\n    /*\n     * N.B. the default constructor leaves Value unitialized. Adding a default\n     * constructor prevents Value from being stored in a union.\n     */\n\n    /*** Mutators ***/\n\n    void setNull() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;\n    }\n\n    void setUndefined() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;\n    }\n\n    void setInt32(int32_t i) {\n        data = INT32_TO_JSVAL_IMPL(i);\n    }\n\n    int32_t &getInt32Ref() {\n        MOZ_ASSERT(isInt32());\n        return data.s.payload.i32;\n    }\n\n    void setDouble(double d) {\n        data = DOUBLE_TO_JSVAL_IMPL(d);\n    }\n\n    double &getDoubleRef() {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    void setString(JSString *str) {\n        MOZ_ASSERT(!IsPoisonedPtr(str));\n        data = STRING_TO_JSVAL_IMPL(str);\n    }\n\n    void setString(const JS::Anchor<JSString *> &str) {\n        setString(str.get());\n    }\n\n    void setObject(JSObject &obj) {\n        MOZ_ASSERT(!IsPoisonedPtr(&obj));\n        data = OBJECT_TO_JSVAL_IMPL(&obj);\n    }\n\n    void setBoolean(bool b) {\n        data = BOOLEAN_TO_JSVAL_IMPL(b);\n    }\n\n    void setMagic(JSWhyMagic why) {\n        data = MAGIC_TO_JSVAL_IMPL(why);\n    }\n\n    bool setNumber(uint32_t ui) {\n        if (ui > JSVAL_INT_MAX) {\n            setDouble((double)ui);\n            return false;\n        } else {\n            setInt32((int32_t)ui);\n            return true;\n        }\n    }\n\n    bool setNumber(double d) {\n        int32_t i;\n        if (mozilla::DoubleIsInt32(d, &i)) {\n            setInt32(i);\n            return true;\n        }\n\n        setDouble(d);\n        return false;\n    }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n\n    void swap(Value &rhs) {\n        uint64_t tmp = rhs.data.asBits;\n        rhs.data.asBits = data.asBits;\n        data.asBits = tmp;\n    }\n\n    /*** Value type queries ***/\n\n    bool isUndefined() const {\n        return JSVAL_IS_UNDEFINED_IMPL(data);\n    }\n\n    bool isNull() const {\n        return JSVAL_IS_NULL_IMPL(data);\n    }\n\n    bool isNullOrUndefined() const {\n        return isNull() || isUndefined();\n    }\n\n    bool isInt32() const {\n        return JSVAL_IS_INT32_IMPL(data);\n    }\n\n    bool isInt32(int32_t i32) const {\n        return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);\n    }\n\n    bool isDouble() const {\n        return JSVAL_IS_DOUBLE_IMPL(data);\n    }\n\n    bool isNumber() const {\n        return JSVAL_IS_NUMBER_IMPL(data);\n    }\n\n    bool isString() const {\n        return JSVAL_IS_STRING_IMPL(data);\n    }\n\n    bool isObject() const {\n        return JSVAL_IS_OBJECT_IMPL(data);\n    }\n\n    bool isPrimitive() const {\n        return JSVAL_IS_PRIMITIVE_IMPL(data);\n    }\n\n    bool isObjectOrNull() const {\n        return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);\n    }\n\n    bool isGCThing() const {\n        return JSVAL_IS_GCTHING_IMPL(data);\n    }\n\n    bool isBoolean() const {\n        return JSVAL_IS_BOOLEAN_IMPL(data);\n    }\n\n    bool isTrue() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, true);\n    }\n\n    bool isFalse() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, false);\n    }\n\n    bool isMagic() const {\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMagic(JSWhyMagic why) const {\n        MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMarkable() const {\n        return JSVAL_IS_TRACEABLE_IMPL(data);\n    }\n\n    JSGCTraceKind gcKind() const {\n        MOZ_ASSERT(isMarkable());\n        return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));\n    }\n\n    JSWhyMagic whyMagic() const {\n        MOZ_ASSERT(isMagic());\n        return data.s.payload.why;\n    }\n\n    /*** Comparison ***/\n\n    bool operator==(const Value &rhs) const {\n        return data.asBits == rhs.data.asBits;\n    }\n\n    bool operator!=(const Value &rhs) const {\n        return data.asBits != rhs.data.asBits;\n    }\n\n    friend inline bool SameType(const Value &lhs, const Value &rhs);\n\n    /*** Extract the value's typed payload ***/\n\n    int32_t toInt32() const {\n        MOZ_ASSERT(isInt32());\n        return JSVAL_TO_INT32_IMPL(data);\n    }\n\n    double toDouble() const {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    double toNumber() const {\n        MOZ_ASSERT(isNumber());\n        return isDouble() ? toDouble() : double(toInt32());\n    }\n\n    JSString *toString() const {\n        MOZ_ASSERT(isString());\n        return JSVAL_TO_STRING_IMPL(data);\n    }\n\n    JSObject &toObject() const {\n        MOZ_ASSERT(isObject());\n        return *JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    JSObject *toObjectOrNull() const {\n        MOZ_ASSERT(isObjectOrNull());\n        return JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    void *toGCThing() const {\n        MOZ_ASSERT(isGCThing());\n        return JSVAL_TO_GCTHING_IMPL(data);\n    }\n\n    bool toBoolean() const {\n        MOZ_ASSERT(isBoolean());\n        return JSVAL_TO_BOOLEAN_IMPL(data);\n    }\n\n    uint32_t payloadAsRawUint32() const {\n        MOZ_ASSERT(!isDouble());\n        return data.s.payload.u32;\n    }\n\n    uint64_t asRawBits() const {\n        return data.asBits;\n    }\n\n    JSValueType extractNonDoubleType() const {\n        return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data);\n    }\n\n    /*\n     * Private API\n     *\n     * Private setters/getters allow the caller to read/write arbitrary types\n     * that fit in the 64-bit payload. It is the caller's responsibility, after\n     * storing to a value with setPrivateX to read only using getPrivateX.\n     * Privates values are given a type which ensures they are not marked.\n     */\n\n    void setPrivate(void *ptr) {\n        data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);\n    }\n\n    void *toPrivate() const {\n        MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));\n        return JSVAL_TO_PRIVATE_PTR_IMPL(data);\n    }\n\n    void setPrivateUint32(uint32_t ui) {\n        MOZ_ASSERT(uint32_t(int32_t(ui)) == ui);\n        setInt32(int32_t(ui));\n    }\n\n    uint32_t toPrivateUint32() const {\n        return uint32_t(toInt32());\n    }\n\n    /*\n     * An unmarked value is just a void* cast as a Value. Thus, the Value is\n     * not safe for GC and must not be marked. This API avoids raw casts\n     * and the ensuing strict-aliasing warnings.\n     */\n\n    void setUnmarkedPtr(void *ptr) {\n        data.asPtr = ptr;\n    }\n\n    void *toUnmarkedPtr() const {\n        return data.asPtr;\n    }\n\n    const size_t *payloadWord() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.word;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asWord;\n#endif\n    }\n\n    const uintptr_t *payloadUIntPtr() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.uintptr;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asUIntPtr;\n#endif\n    }\n\n#if !defined(_MSC_VER) && !defined(__sparc)\n  // Value must be POD so that MSVC will pass it by value and not in memory\n  // (bug 689101); the same is true for SPARC as well (bug 737344).  More\n  // precisely, we don't want Value return values compiled as out params.\n  private:\n#endif\n\n    jsval_layout data;\n\n  private:\n    void staticAssertions() {\n        JS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n        JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n        JS_STATIC_ASSERT(sizeof(JSBool) == 4);\n        JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4);\n        JS_STATIC_ASSERT(sizeof(Value) == 8);\n    }\n\n    friend jsval_layout (::JSVAL_TO_IMPL)(Value);\n    friend Value (::IMPL_TO_JSVAL)(jsval_layout l);\n};\n\ninline bool\nIsPoisonedValue(const Value &v)\n{\n    if (v.isString())\n        return IsPoisonedPtr(v.toString());\n    if (v.isObject())\n        return IsPoisonedPtr(&v.toObject());\n    return false;\n}\n\n/************************************************************************/\n\nstatic inline Value\nNullValue()\n{\n    Value v;\n    v.setNull();\n    return v;\n}\n\nstatic inline Value\nUndefinedValue()\n{\n    Value v;\n    v.setUndefined();\n    return v;\n}\n\nstatic inline Value\nInt32Value(int32_t i32)\n{\n    Value v;\n    v.setInt32(i32);\n    return v;\n}\n\nstatic inline Value\nDoubleValue(double dbl)\n{\n    Value v;\n    v.setDouble(dbl);\n    return v;\n}\n\nstatic inline Value\nStringValue(JSString *str)\n{\n    Value v;\n    v.setString(str);\n    return v;\n}\n\nstatic inline Value\nBooleanValue(bool boo)\n{\n    Value v;\n    v.setBoolean(boo);\n    return v;\n}\n\nstatic inline Value\nObjectValue(JSObject &obj)\n{\n    Value v;\n    v.setObject(obj);\n    return v;\n}\n\nstatic inline Value\nObjectValueCrashOnTouch()\n{\n    Value v;\n    v.setObject(*reinterpret_cast<JSObject *>(0x42));\n    return v;\n}\n\nstatic inline Value\nMagicValue(JSWhyMagic why)\n{\n    Value v;\n    v.setMagic(why);\n    return v;\n}\n\nstatic inline Value\nNumberValue(float f)\n{\n    Value v;\n    v.setNumber(f);\n    return v;\n}\n\nstatic inline Value\nNumberValue(double dbl)\n{\n    Value v;\n    v.setNumber(dbl);\n    return v;\n}\n\nstatic inline Value\nNumberValue(int8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int32_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint32_t i)\n{\n    Value v;\n    v.setNumber(i);\n    return v;\n}\n\nnamespace detail {\n\ntemplate <bool Signed>\nclass MakeNumberValue\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (JSVAL_INT_MIN <= t && t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\ntemplate <>\nclass MakeNumberValue<false>\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\n} // namespace detail\n\ntemplate <typename T>\nstatic inline Value\nNumberValue(const T t)\n{\n    MOZ_ASSERT(T(double(t)) == t, \"value creation would be lossy\");\n    return detail::MakeNumberValue<std::numeric_limits<T>::is_signed>::create(t);\n}\n\nstatic inline Value\nObjectOrNullValue(JSObject *obj)\n{\n    Value v;\n    v.setObjectOrNull(obj);\n    return v;\n}\n\nstatic inline Value\nPrivateValue(void *ptr)\n{\n    Value v;\n    v.setPrivate(ptr);\n    return v;\n}\n\nstatic inline Value\nPrivateUint32Value(uint32_t ui)\n{\n    Value v;\n    v.setPrivateUint32(ui);\n    return v;\n}\n\ninline bool\nSameType(const Value &lhs, const Value &rhs)\n{\n    return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);\n}\n\n} // namespace JS\n\n/************************************************************************/\n\n#ifdef JSGC_GENERATIONAL\nnamespace JS {\nJS_PUBLIC_API(void) HeapValuePostBarrier(Value *valuep);\nJS_PUBLIC_API(void) HeapValueRelocate(Value *valuep);\n}\n#endif\n\nnamespace js {\n\ntemplate <> struct GCMethods<const JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n};\n\ntemplate <> struct GCMethods<JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n    static bool needsPostBarrier(const JS::Value &v) { return v.isMarkable(); }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }\n    static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }\n#endif\n};\n\ntemplate <class Outer> class UnbarrieredMutableValueOperations;\ntemplate <class Outer> class MutableValueOperations;\n\n/*\n * A class designed for CRTP use in implementing the non-mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * ValueOperations<Outer> with a visible extract() method returning the\n * const Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass ValueOperations\n{\n    friend class UnbarrieredMutableValueOperations<Outer>;\n    friend class MutableValueOperations<Outer>;\n\n    const JS::Value * value() const { return static_cast<const Outer*>(this)->extract(); }\n\n  public:\n    bool isUndefined() const { return value()->isUndefined(); }\n    bool isNull() const { return value()->isNull(); }\n    bool isBoolean() const { return value()->isBoolean(); }\n    bool isTrue() const { return value()->isTrue(); }\n    bool isFalse() const { return value()->isFalse(); }\n    bool isNumber() const { return value()->isNumber(); }\n    bool isInt32() const { return value()->isInt32(); }\n    bool isDouble() const { return value()->isDouble(); }\n    bool isString() const { return value()->isString(); }\n    bool isObject() const { return value()->isObject(); }\n    bool isMagic() const { return value()->isMagic(); }\n    bool isMagic(JSWhyMagic why) const { return value()->isMagic(why); }\n    bool isMarkable() const { return value()->isMarkable(); }\n    bool isPrimitive() const { return value()->isPrimitive(); }\n    bool isGCThing() const { return value()->isGCThing(); }\n\n    bool isNullOrUndefined() const { return value()->isNullOrUndefined(); }\n    bool isObjectOrNull() const { return value()->isObjectOrNull(); }\n\n    bool toBoolean() const { return value()->toBoolean(); }\n    double toNumber() const { return value()->toNumber(); }\n    int32_t toInt32() const { return value()->toInt32(); }\n    double toDouble() const { return value()->toDouble(); }\n    JSString *toString() const { return value()->toString(); }\n    JSObject &toObject() const { return value()->toObject(); }\n    JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); }\n    void *toGCThing() const { return value()->toGCThing(); }\n\n    JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); }\n    uint32_t toPrivateUint32() const { return value()->toPrivateUint32(); }\n\n    JSWhyMagic whyMagic() const { return value()->whyMagic(); }\n};\n\n/*\n * A class designed for CRTP use in implementing the mutating parts of the Value\n * interface in Value-like classes that don't need post barriers.  Outer must be\n * a class inheriting UnbarrieredMutableValueOperations<Outer> with visible\n * extractMutable() and extract() methods returning the const Value* and Value*\n * abstracted by Outer.\n */\ntemplate <class Outer>\nclass UnbarrieredMutableValueOperations : public ValueOperations<Outer>\n{\n    friend class MutableValueOperations<Outer>;\n    JS::Value * value() { return static_cast<Outer*>(this)->extractMutable(); }\n\n  public:\n    void setNull() { value()->setNull(); }\n    void setUndefined() { value()->setUndefined(); }\n    void setInt32(int32_t i) { value()->setInt32(i); }\n    void setDouble(double d) { value()->setDouble(d); }\n    void setBoolean(bool b) { value()->setBoolean(b); }\n    void setMagic(JSWhyMagic why) { value()->setMagic(why); }\n    bool setNumber(uint32_t ui) { return value()->setNumber(ui); }\n    bool setNumber(double d) { return value()->setNumber(d); }\n};\n\n/*\n * A class designed for CRTP use in implementing all the mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * MutableValueOperations<Outer> with visible extractMutable() and extract()\n * methods returning the const Value* and Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass MutableValueOperations : public UnbarrieredMutableValueOperations<Outer>\n{\n  public:\n    void setString(JSString *str) { this->value()->setString(str); }\n    void setString(const JS::Anchor<JSString *> &str) { this->value()->setString(str); }\n    void setObject(JSObject &obj) { this->value()->setObject(obj); }\n    void setObjectOrNull(JSObject *arg) { this->value()->setObjectOrNull(arg); }\n};\n\n/*\n * Augment the generic Heap<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass HeapBase<JS::Value> : public UnbarrieredMutableValueOperations<JS::Heap<JS::Value> >\n{\n    typedef JS::Heap<JS::Value> Outer;\n\n    friend class ValueOperations<Outer>;\n    friend class UnbarrieredMutableValueOperations<Outer>;\n\n    const JS::Value * extract() const { return static_cast<const Outer*>(this)->address(); }\n    JS::Value * extractMutable() { return static_cast<Outer*>(this)->unsafeGet(); }\n\n    /*\n     * Setters that potentially change the value to a GC thing from a non-GC\n     * thing must call JS::Heap::set() to trigger the post barrier.\n     *\n     * Changing from a GC thing to a non-GC thing value will leave the heap\n     * value in the store buffer, but it will be ingored so this is not a\n     * problem.\n     */\n    void setBarriered(const JS::Value &v) {\n        static_cast<JS::Heap<JS::Value> *>(this)->set(v);\n    }\n\n  public:\n    void setString(JSString *str) { setBarriered(JS::StringValue(str)); }\n    void setString(const JS::Anchor<JSString *> &str) { setBarriered(JS::StringValue(str.get())); }\n    void setObject(JSObject &obj) { setBarriered(JS::ObjectValue(obj)); }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n};\n\n/*\n * Augment the generic Handle<T> interface when T = Value with type-querying\n * and value-extracting operations.\n */\ntemplate <>\nclass HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> >\n{\n    friend class ValueOperations<JS::Handle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Handle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic MutableHandle<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass MutableHandleBase<JS::Value> : public MutableValueOperations<JS::MutableHandle<JS::Value> >\n{\n    friend class ValueOperations<JS::MutableHandle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::MutableHandle<JS::Value> >;\n    friend class MutableValueOperations<JS::MutableHandle<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic Rooted<T> interface when T = Value with type-querying,\n * value-extracting, and mutating operations.\n */\ntemplate <>\nclass RootedBase<JS::Value> : public MutableValueOperations<JS::Rooted<JS::Value> >\n{\n    friend class ValueOperations<JS::Rooted<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Rooted<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::Rooted<JS::Value> >;\n    friend class MutableValueOperations<JS::Rooted<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::Rooted<JS::Value>*>(this)->address();\n    }\n};\n\n} // namespace js\n\ninline jsval_layout\nJSVAL_TO_IMPL(JS::Value v)\n{\n    return v.data;\n}\n\ninline JS::Value\nIMPL_TO_JSVAL(jsval_layout l)\n{\n    JS::Value v;\n    v.data = l;\n    return v;\n}\n\nnamespace JS {\n\n#ifndef __GNUC__\n/*\n * The default assignment operator for |struct C| has the signature:\n *\n *   C& C::operator=(const C&)\n *\n * And in particular requires implicit conversion of |this| to type |C| for the\n * return value. But |volatile C| cannot thus be converted to |C|, so just\n * doing |sink = hold| as in the non-specialized version would fail to compile.\n * Do the assignment on asBits instead, since I don't think we want to give\n * jsval_layout an assignment operator returning |volatile jsval_layout|.\n */\ntemplate<>\ninline Anchor<Value>::~Anchor()\n{\n    volatile uint64_t bits;\n    bits = JSVAL_TO_IMPL(hold).asBits;\n}\n#endif\n\n#ifdef DEBUG\nnamespace detail {\n\nstruct ValueAlignmentTester { char c; JS::Value v; };\nstatic_assert(sizeof(ValueAlignmentTester) == 16,\n              \"JS::Value must be 16-byte-aligned\");\n\nstruct LayoutAlignmentTester { char c; jsval_layout l; };\nstatic_assert(sizeof(LayoutAlignmentTester) == 16,\n              \"jsval_layout must be 16-byte-aligned\");\n\n} // namespace detail\n#endif /* DEBUG */\n\n} // namespace JS\n\n/*\n * JS::Value and jsval are the same type; jsval is the old name, kept around\n * for backwards compatibility along with all the JSVAL_* operations below.\n * jsval_layout is an implementation detail and should not be used externally.\n */\ntypedef JS::Value jsval;\n\nstatic_assert(sizeof(jsval_layout) == sizeof(JS::Value),\n              \"jsval_layout and JS::Value must have identical layouts\");\n\n/************************************************************************/\n\nstatic inline JSBool\nJSVAL_IS_NULL(jsval v)\n{\n    return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_VOID(jsval v)\n{\n    return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_INT(jsval v)\n{\n    return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline int32_t\nJSVAL_TO_INT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_INT(v));\n    return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nINT_TO_JSVAL(int32_t i)\n{\n    return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE(jsval v)\n{\n    return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline double\nJSVAL_TO_DOUBLE(jsval v)\n{\n    jsval_layout l;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    l = JSVAL_TO_IMPL(v);\n    return l.asDouble;\n}\n\nstatic inline jsval\nDOUBLE_TO_JSVAL(double d)\n{\n    /*\n     * This is a manually inlined version of:\n     *    d = JS_CANONICALIZE_NAN(d);\n     *    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));\n     * because GCC from XCode 3.1.4 miscompiles the above code.\n     */\n    jsval_layout l;\n    if (MOZ_UNLIKELY(d != d))\n        l.asBits = 0x7FF8000000000000LL;\n    else\n        l.asDouble = d;\n    return IMPL_TO_JSVAL(l);\n}\n\nstatic inline jsval\nUINT_TO_JSVAL(uint32_t i)\n{\n    if (i <= JSVAL_INT_MAX)\n        return INT_TO_JSVAL((int32_t)i);\n    return DOUBLE_TO_JSVAL((double)i);\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER(jsval v)\n{\n    return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING(jsval v)\n{\n    return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_STRING(v));\n    return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nSTRING_TO_JSVAL(JSString *str)\n{\n    return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str));\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v)));\n    return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nOBJECT_TO_JSVAL(JSObject *obj)\n{\n    if (obj)\n        return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj));\n    return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0));\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN(jsval v)\n{\n    return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_BOOLEAN(v));\n    return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nBOOLEAN_TO_JSVAL(JSBool b)\n{\n    return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE(jsval v)\n{\n    return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING(jsval v)\n{\n    return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_GCTHING(v));\n    return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/* To be GC-safe, privates are tagged as doubles. */\n\nstatic inline jsval\nPRIVATE_TO_JSVAL(void *ptr)\n{\n    return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));\n}\n\n#endif /* js_Value_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Vector_h\n#define js_Vector_h\n\n#include \"mozilla/Vector.h\"\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace js {\n\nclass TempAllocPolicy;\n\n// If we had C++11 template aliases, we could just use this:\n//\n//   template <typename T,\n//             size_t MinInlineCapacity = 0,\n//             class AllocPolicy = TempAllocPolicy>\n//   using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;\n//\n// ...and get rid of all the CRTP madness in mozilla::Vector(Base).  But we\n// can't because compiler support's not up to snuff.  (Template aliases are in\n// gcc 4.7 and clang 3.0 and are expected to be in MSVC 2013.)  Instead, have a\n// completely separate class inheriting from mozilla::Vector, and throw CRTP at\n// the problem til things work.\n//\n// This workaround presents a couple issues.  First, because js::Vector is a\n// distinct type from mozilla::Vector, overload resolution, method calls, etc.\n// are affected.  *Hopefully* this won't be too bad in practice.  (A bunch of\n// places had to be fixed when mozilla::Vector was introduced, but it wasn't a\n// crazy number.)  Second, mozilla::Vector's interface has to be made subclass-\n// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one\n// should use.  :-)  Third, we have to redefine the constructors and the non-\n// inherited operators.  Blech.  Happily there aren't too many of these, so it\n// isn't the end of the world.\n\ntemplate <typename T,\n          size_t MinInlineCapacity = 0,\n          class AllocPolicy = TempAllocPolicy>\nclass Vector\n  : public mozilla::VectorBase<T,\n                               MinInlineCapacity,\n                               AllocPolicy,\n                               Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector &operator=(mozilla::MoveRef<Vector> vec) {\n        return Base::operator=(vec);\n    }\n};\n\n} // namespace js\n\n#endif /* js_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js-config.h",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sw=4 et tw=78:\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_config_h___\n#define js_config_h___\n\n/* Definitions set at build time that affect SpiderMonkey's public API.\n   This header file is generated by the SpiderMonkey configure script,\n   and installed along with jsapi.h.  */\n\n/* Define to 1 if SpiderMonkey should support multi-threaded clients.  */\n/* #undef JS_THREADSAFE */\n\n/* Define to 1 if SpiderMonkey should include ctypes support.  */\n/* #undef JS_HAS_CTYPES */\n\n/* Define to 1 if SpiderMonkey should support the ability to perform\n   entirely too much GC.  */\n/* #undef JS_GC_ZEAL */\n\n/* Define to 1 if the <endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_ENDIAN_H */\n\n/* Define to 1 if the <machine/endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n#define JS_HAVE_MACHINE_ENDIAN_H 1\n\n/* Define to 1 if the <sys/isa_defs.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_SYS_ISA_DEFS_H */\n\n/* The configure script defines these if it doesn't #define\n   JS_HAVE_STDINT_H.  */\n#define JS_BYTES_PER_WORD 8\n\n/* MOZILLA JSAPI version number components */\n#define MOZJS_MAJOR_VERSION 25\n#define MOZJS_MINOR_VERSION 0\n\n#endif /* js_config_h___ */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/js.msg",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This is the JavaScript error message file.\n *\n * The format for each JS error message is:\n *\n * MSG_DEF(<SYMBOLIC_NAME>, <ERROR_NUMBER>, <ARGUMENT_COUNT>, <EXCEPTION_NAME>,\n *         <FORMAT_STRING>)\n *\n * where ;\n * <SYMBOLIC_NAME> is a legal C identifer that will be used in the\n * JS engine source.\n *\n * <ERROR_NUMBER> is an unique integral value identifying this error.\n *\n * <ARGUMENT_COUNT> is an integer literal specifying the total number of\n * replaceable arguments in the following format string.\n *\n * <EXCEPTION_NAME> is an exception index from the enum in jsexn.c;\n * JSEXN_NONE for none.  The given exception index will be raised by the\n * engine when the corresponding error occurs.\n *\n * <FORMAT_STRING> is a string literal, optionally containing sequences\n * {X} where X  is an integer representing the argument number that will\n * be replaced with a string value when the error is reported.\n *\n * e.g.\n *\n * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 73, JSEXN_NONE, 2,\n *         \"{0} is not a member of the {1} family\")\n *\n * can be used:\n *\n * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, \"Rhino\", \"Monkey\");\n *\n * to report:\n *\n * \"Rhino is not a member of the Monkey family\"\n *\n * When removing MSG_DEFs, convert them to JSMSG_UNUSED<n> placeholders:\n *\n *    MSG_DEF(JSMSG_UNUSED7,                  7, 0, JSEXN_NONE, \"\")\n *\n * Before adding a new MSG_DEF at the end, look for existing JSMSG_UNUSED<n>\n * free index placeholders in the middle of the list.\n */\n\nMSG_DEF(JSMSG_NOT_AN_ERROR,             0, 0, JSEXN_NONE, \"<Error #0 is reserved>\")\nMSG_DEF(JSMSG_NOT_DEFINED,              1, 1, JSEXN_REFERENCEERR, \"{0} is not defined\")\nMSG_DEF(JSMSG_INACTIVE,                 2, 0, JSEXN_INTERNALERR, \"nothing active on context\")\nMSG_DEF(JSMSG_MORE_ARGS_NEEDED,         3, 3, JSEXN_TYPEERR, \"{0} requires more than {1} argument{2}\")\nMSG_DEF(JSMSG_BAD_CHAR,                 4, 1, JSEXN_INTERNALERR, \"invalid format character {0}\")\nMSG_DEF(JSMSG_BAD_TYPE,                 5, 1, JSEXN_TYPEERR, \"unknown type {0}\")\nMSG_DEF(JSMSG_ALLOC_OVERFLOW,           6, 0, JSEXN_INTERNALERR, \"allocation size overflow\")\nMSG_DEF(JSMSG_MISSING_HEXDIGITS,        7, 0, JSEXN_SYNTAXERR, \"missing hexadecimal digits after '0x'\")\nMSG_DEF(JSMSG_INCOMPATIBLE_PROTO,       8, 3, JSEXN_TYPEERR, \"{0}.prototype.{1} called on incompatible {2}\")\nMSG_DEF(JSMSG_NO_CONSTRUCTOR,           9, 1, JSEXN_TYPEERR, \"{0} has no constructor\")\nMSG_DEF(JSMSG_CANT_ALIAS,              10, 3, JSEXN_TYPEERR, \"can't alias {0} to {1} in class {2}\")\nMSG_DEF(JSMSG_NOT_SCRIPTED_FUNCTION,   11, 1, JSEXN_TYPEERR, \"{0} is not a scripted function\")\nMSG_DEF(JSMSG_BAD_SORT_ARG,            12, 0, JSEXN_TYPEERR, \"invalid Array.prototype.sort argument\")\nMSG_DEF(JSMSG_BAD_ATOMIC_NUMBER,       13, 1, JSEXN_INTERNALERR, \"internal error: no index for atom {0}\")\nMSG_DEF(JSMSG_TOO_MANY_LITERALS,       14, 0, JSEXN_INTERNALERR, \"too many literals\")\nMSG_DEF(JSMSG_CANT_WATCH,              15, 1, JSEXN_TYPEERR, \"can't watch non-native objects of class {0}\")\nMSG_DEF(JSMSG_STACK_UNDERFLOW,         16, 2, JSEXN_INTERNALERR, \"internal error compiling {0}: stack underflow at pc {1}\")\nMSG_DEF(JSMSG_NEED_DIET,               17, 1, JSEXN_INTERNALERR, \"{0} too large\")\nMSG_DEF(JSMSG_TOO_MANY_LOCAL_ROOTS,    18, 0, JSEXN_ERR, \"out of local root space\")\nMSG_DEF(JSMSG_READ_ONLY,               19, 1, JSEXN_TYPEERR, \"{0} is read-only\")\nMSG_DEF(JSMSG_BAD_FORMAL,              20, 0, JSEXN_SYNTAXERR, \"malformed formal parameter\")\nMSG_DEF(JSMSG_CANT_DELETE,             21, 1, JSEXN_TYPEERR, \"property {0} is non-configurable and can't be deleted\")\nMSG_DEF(JSMSG_NOT_FUNCTION,            22, 1, JSEXN_TYPEERR, \"{0} is not a function\")\nMSG_DEF(JSMSG_NOT_CONSTRUCTOR,         23, 1, JSEXN_TYPEERR, \"{0} is not a constructor\")\nMSG_DEF(JSMSG_INVALID_DATE,            24, 0, JSEXN_RANGEERR, \"invalid date\")\nMSG_DEF(JSMSG_TOO_DEEP,                25, 1, JSEXN_INTERNALERR, \"{0} nested too deeply\")\nMSG_DEF(JSMSG_OVER_RECURSED,           26, 0, JSEXN_INTERNALERR, \"too much recursion\")\nMSG_DEF(JSMSG_IN_NOT_OBJECT,           27, 1, JSEXN_TYPEERR, \"invalid 'in' operand {0}\")\nMSG_DEF(JSMSG_BAD_NEW_RESULT,          28, 1, JSEXN_TYPEERR, \"invalid new expression result {0}\")\nMSG_DEF(JSMSG_OBJECT_ACCESS_DENIED,    29, 0, JSEXN_ERR, \"Permission denied to access object\")\nMSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED,  30, 1, JSEXN_ERR, \"Permission denied to access property '{0}'\")\nMSG_DEF(JSMSG_BAD_INSTANCEOF_RHS,      31, 1, JSEXN_TYPEERR, \"invalid 'instanceof' operand {0}\")\nMSG_DEF(JSMSG_BAD_BYTECODE,            32, 1, JSEXN_INTERNALERR, \"unimplemented JavaScript bytecode {0}\")\nMSG_DEF(JSMSG_BAD_RADIX,               33, 0, JSEXN_RANGEERR, \"radix must be an integer at least 2 and no greater than 36\")\nMSG_DEF(JSMSG_PAREN_BEFORE_LET,        34, 0, JSEXN_SYNTAXERR, \"missing ( before let head\")\nMSG_DEF(JSMSG_CANT_CONVERT,            35, 1, JSEXN_ERR, \"can't convert {0} to an integer\")\nMSG_DEF(JSMSG_CYCLIC_VALUE,            36, 1, JSEXN_TYPEERR, \"cyclic {0} value\")\nMSG_DEF(JSMSG_COMPILE_EXECED_SCRIPT,   37, 0, JSEXN_TYPEERR, \"can't compile over a script that is currently executing\")\nMSG_DEF(JSMSG_CANT_CONVERT_TO,         38, 2, JSEXN_TYPEERR, \"can't convert {0} to {1}\")\nMSG_DEF(JSMSG_NO_PROPERTIES,           39, 1, JSEXN_TYPEERR, \"{0} has no properties\")\nMSG_DEF(JSMSG_CANT_FIND_CLASS,         40, 1, JSEXN_TYPEERR, \"can't find class id {0}\")\nMSG_DEF(JSMSG_DEAD_OBJECT,             41, 0, JSEXN_TYPEERR, \"can't access dead object\")\nMSG_DEF(JSMSG_BYTECODE_TOO_BIG,        42, 2, JSEXN_INTERNALERR, \"bytecode {0} too large (limit {1})\")\nMSG_DEF(JSMSG_UNKNOWN_FORMAT,          43, 1, JSEXN_INTERNALERR, \"unknown bytecode format {0}\")\nMSG_DEF(JSMSG_TOO_MANY_CON_ARGS,       44, 0, JSEXN_SYNTAXERR, \"too many constructor arguments\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_ARGS,       45, 0, JSEXN_SYNTAXERR, \"too many function arguments\")\nMSG_DEF(JSMSG_BAD_QUANTIFIER,          46, 0, JSEXN_SYNTAXERR, \"invalid quantifier\")\nMSG_DEF(JSMSG_MIN_TOO_BIG,             47, 1, JSEXN_SYNTAXERR, \"overlarge minimum {0}\")\nMSG_DEF(JSMSG_MAX_TOO_BIG,             48, 1, JSEXN_SYNTAXERR, \"overlarge maximum {0}\")\nMSG_DEF(JSMSG_OUT_OF_ORDER,            49, 1, JSEXN_SYNTAXERR, \"maximum {0} less than minimum\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_DECL,       50, 0, JSEXN_SYNTAXERR, \"missing = in destructuring declaration\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASS,        51, 0, JSEXN_REFERENCEERR, \"invalid destructuring assignment operator\")\nMSG_DEF(JSMSG_PAREN_AFTER_LET,         52, 0, JSEXN_SYNTAXERR, \"missing ) after let head\")\nMSG_DEF(JSMSG_CURLY_AFTER_LET,         53, 0, JSEXN_SYNTAXERR, \"missing } after let block\")\nMSG_DEF(JSMSG_MISSING_PAREN,           54, 0, JSEXN_SYNTAXERR, \"unterminated parenthetical\")\nMSG_DEF(JSMSG_UNTERM_CLASS,            55, 1, JSEXN_SYNTAXERR, \"unterminated character class {0}\")\nMSG_DEF(JSMSG_TRAILING_SLASH,          56, 0, JSEXN_SYNTAXERR, \"trailing \\\\ in regular expression\")\nMSG_DEF(JSMSG_BAD_CLASS_RANGE,         57, 0, JSEXN_SYNTAXERR, \"invalid range in character class\")\nMSG_DEF(JSMSG_BAD_REGEXP_FLAG,         58, 1, JSEXN_SYNTAXERR, \"invalid regular expression flag {0}\")\nMSG_DEF(JSMSG_NO_INPUT,                59, 5, JSEXN_SYNTAXERR, \"no input for /{0}/{1}{2}{3}{4}\")\nMSG_DEF(JSMSG_CANT_OPEN,               60, 2, JSEXN_ERR, \"can't open {0}: {1}\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_APPLY_ARGS, 61, 0, JSEXN_RANGEERR, \"arguments array passed to Function.prototype.apply is too large\")\nMSG_DEF(JSMSG_UNMATCHED_RIGHT_PAREN,   62, 0, JSEXN_SYNTAXERR, \"unmatched ) in regular expression\")\nMSG_DEF(JSMSG_TOO_BIG_TO_ENCODE,       63, 0, JSEXN_INTERNALERR, \"data are to big to encode\")\nMSG_DEF(JSMSG_ARG_INDEX_OUT_OF_RANGE,  64, 1, JSEXN_RANGEERR, \"argument {0} accesses an index that is out of range\")\nMSG_DEF(JSMSG_SPREAD_TOO_LARGE,        65, 0, JSEXN_RANGEERR, \"array too large due to spread operand(s)\")\nMSG_DEF(JSMSG_SOURCE_TOO_LONG,         66, 0, JSEXN_RANGEERR, \"source is too long\")\nMSG_DEF(JSMSG_BAD_WEAKMAP_KEY,         67, 0, JSEXN_TYPEERR, \"cannot use the given object as a weak map key\")\nMSG_DEF(JSMSG_BAD_SCRIPT_MAGIC,        68, 0, JSEXN_INTERNALERR, \"bad script XDR magic number\")\nMSG_DEF(JSMSG_PAREN_BEFORE_FORMAL,     69, 0, JSEXN_SYNTAXERR, \"missing ( before formal parameters\")\nMSG_DEF(JSMSG_MISSING_FORMAL,          70, 0, JSEXN_SYNTAXERR, \"missing formal parameter\")\nMSG_DEF(JSMSG_PAREN_AFTER_FORMAL,      71, 0, JSEXN_SYNTAXERR, \"missing ) after formal parameters\")\nMSG_DEF(JSMSG_CURLY_BEFORE_BODY,       72, 0, JSEXN_SYNTAXERR, \"missing { before function body\")\nMSG_DEF(JSMSG_CURLY_AFTER_BODY,        73, 0, JSEXN_SYNTAXERR, \"missing } after function body\")\nMSG_DEF(JSMSG_PAREN_BEFORE_COND,       74, 0, JSEXN_SYNTAXERR, \"missing ( before condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_COND,        75, 0, JSEXN_SYNTAXERR, \"missing ) after condition\")\nMSG_DEF(JSMSG_BAD_DUP_ARGS,            76, 0, JSEXN_SYNTAXERR, \"duplicate argument names not allowed in this context\")\nMSG_DEF(JSMSG_NAME_AFTER_DOT,          77, 0, JSEXN_SYNTAXERR, \"missing name after . operator\")\nMSG_DEF(JSMSG_BRACKET_IN_INDEX,        78, 0, JSEXN_SYNTAXERR, \"missing ] in index expression\")\nMSG_DEF(JSMSG_ACCESSOR_DEF_DENIED,     79, 1, JSEXN_ERR, \"Permission denied to define accessor property '{0}'\")\nMSG_DEF(JSMSG_PAREN_BEFORE_SWITCH,     80, 0, JSEXN_SYNTAXERR, \"missing ( before switch expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_SWITCH,      81, 0, JSEXN_SYNTAXERR, \"missing ) after switch expression\")\nMSG_DEF(JSMSG_CURLY_BEFORE_SWITCH,     82, 0, JSEXN_SYNTAXERR, \"missing { before switch body\")\nMSG_DEF(JSMSG_COLON_AFTER_CASE,        83, 0, JSEXN_SYNTAXERR, \"missing : after case label\")\nMSG_DEF(JSMSG_WHILE_AFTER_DO,          84, 0, JSEXN_SYNTAXERR, \"missing while after do-loop body\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR,         85, 0, JSEXN_SYNTAXERR, \"missing ( after for\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT,     86, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop initializer\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_COND,     87, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR_CTRL,    88, 0, JSEXN_SYNTAXERR, \"missing ) after for-loop control\")\nMSG_DEF(JSMSG_CURLY_BEFORE_TRY,        89, 0, JSEXN_SYNTAXERR, \"missing { before try block\")\nMSG_DEF(JSMSG_CURLY_AFTER_TRY,         90, 0, JSEXN_SYNTAXERR, \"missing } after try block\")\nMSG_DEF(JSMSG_PAREN_BEFORE_CATCH,      91, 0, JSEXN_SYNTAXERR, \"missing ( before catch\")\nMSG_DEF(JSMSG_CATCH_IDENTIFIER,        92, 0, JSEXN_SYNTAXERR, \"missing identifier in catch\")\nMSG_DEF(JSMSG_PAREN_AFTER_CATCH,       93, 0, JSEXN_SYNTAXERR, \"missing ) after catch\")\nMSG_DEF(JSMSG_CURLY_BEFORE_CATCH,      94, 0, JSEXN_SYNTAXERR, \"missing { before catch block\")\nMSG_DEF(JSMSG_CURLY_AFTER_CATCH,       95, 0, JSEXN_SYNTAXERR, \"missing } after catch block\")\nMSG_DEF(JSMSG_CURLY_BEFORE_FINALLY,    96, 0, JSEXN_SYNTAXERR, \"missing { before finally block\")\nMSG_DEF(JSMSG_CURLY_AFTER_FINALLY,     97, 0, JSEXN_SYNTAXERR, \"missing } after finally block\")\nMSG_DEF(JSMSG_CATCH_OR_FINALLY,        98, 0, JSEXN_SYNTAXERR, \"missing catch or finally after try\")\nMSG_DEF(JSMSG_PAREN_BEFORE_WITH,       99, 0, JSEXN_SYNTAXERR, \"missing ( before with-statement object\")\nMSG_DEF(JSMSG_PAREN_AFTER_WITH,       100, 0, JSEXN_SYNTAXERR, \"missing ) after with-statement object\")\nMSG_DEF(JSMSG_CURLY_IN_COMPOUND,      101, 0, JSEXN_SYNTAXERR, \"missing } in compound statement\")\nMSG_DEF(JSMSG_NO_VARIABLE_NAME,       102, 0, JSEXN_SYNTAXERR, \"missing variable name\")\nMSG_DEF(JSMSG_COLON_IN_COND,          103, 0, JSEXN_SYNTAXERR, \"missing : in conditional expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_ARGS,       104, 0, JSEXN_SYNTAXERR, \"missing ) after argument list\")\nMSG_DEF(JSMSG_BRACKET_AFTER_LIST,     105, 0, JSEXN_SYNTAXERR, \"missing ] after element list\")\nMSG_DEF(JSMSG_COLON_AFTER_ID,         106, 0, JSEXN_SYNTAXERR, \"missing : after property id\")\nMSG_DEF(JSMSG_CURLY_AFTER_LIST,       107, 0, JSEXN_SYNTAXERR, \"missing } after property list\")\nMSG_DEF(JSMSG_PAREN_IN_PAREN,         108, 0, JSEXN_SYNTAXERR, \"missing ) in parenthetical\")\nMSG_DEF(JSMSG_SEMI_BEFORE_STMNT,      109, 0, JSEXN_SYNTAXERR, \"missing ; before statement\")\nMSG_DEF(JSMSG_NO_RETURN_VALUE,        110, 1, JSEXN_TYPEERR, \"function {0} does not always return a value\")\nMSG_DEF(JSMSG_DUPLICATE_FORMAL,       111, 1, JSEXN_SYNTAXERR, \"duplicate formal argument {0}\")\nMSG_DEF(JSMSG_EQUAL_AS_ASSIGN,        112, 0, JSEXN_SYNTAXERR, \"test for equality (==) mistyped as assignment (=)?\")\nMSG_DEF(JSMSG_OPTIMIZED_CLOSURE_LEAK, 113, 0, JSEXN_INTERNALERR, \"can't access optimized closure\")\nMSG_DEF(JSMSG_TOO_MANY_DEFAULTS,      114, 0, JSEXN_SYNTAXERR, \"more than one switch default\")\nMSG_DEF(JSMSG_TOO_MANY_CASES,         115, 0, JSEXN_INTERNALERR, \"too many switch cases\")\nMSG_DEF(JSMSG_BAD_SWITCH,             116, 0, JSEXN_SYNTAXERR, \"invalid switch statement\")\nMSG_DEF(JSMSG_BAD_FOR_LEFTSIDE,       117, 0, JSEXN_SYNTAXERR, \"invalid for/in left-hand side\")\nMSG_DEF(JSMSG_CATCH_AFTER_GENERAL,    118, 0, JSEXN_SYNTAXERR, \"catch after unconditional catch\")\nMSG_DEF(JSMSG_CATCH_WITHOUT_TRY,      119, 0, JSEXN_SYNTAXERR, \"catch without try\")\nMSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,    120, 0, JSEXN_SYNTAXERR, \"finally without try\")\nMSG_DEF(JSMSG_LABEL_NOT_FOUND,        121, 0, JSEXN_SYNTAXERR, \"label not found\")\nMSG_DEF(JSMSG_TOUGH_BREAK,            122, 0, JSEXN_SYNTAXERR, \"unlabeled break must be inside loop or switch\")\nMSG_DEF(JSMSG_BAD_CONTINUE,           123, 0, JSEXN_SYNTAXERR, \"continue must be inside loop\")\nMSG_DEF(JSMSG_BAD_RETURN_OR_YIELD,    124, 1, JSEXN_SYNTAXERR, \"{0} not in function\")\nMSG_DEF(JSMSG_BAD_LABEL,              125, 0, JSEXN_SYNTAXERR, \"invalid label\")\nMSG_DEF(JSMSG_DUPLICATE_LABEL,        126, 0, JSEXN_SYNTAXERR, \"duplicate label\")\nMSG_DEF(JSMSG_VAR_HIDES_ARG,          127, 1, JSEXN_TYPEERR, \"variable {0} redeclares argument\")\nMSG_DEF(JSMSG_BAD_VAR_INIT,           128, 0, JSEXN_SYNTAXERR, \"invalid variable initialization\")\nMSG_DEF(JSMSG_BAD_LEFTSIDE_OF_ASS,    129, 0, JSEXN_REFERENCEERR, \"invalid assignment left-hand side\")\nMSG_DEF(JSMSG_BAD_OPERAND,            130, 1, JSEXN_SYNTAXERR, \"invalid {0} operand\")\nMSG_DEF(JSMSG_BAD_PROP_ID,            131, 0, JSEXN_SYNTAXERR, \"invalid property id\")\nMSG_DEF(JSMSG_RESERVED_ID,            132, 1, JSEXN_SYNTAXERR, \"{0} is a reserved identifier\")\nMSG_DEF(JSMSG_SYNTAX_ERROR,           133, 0, JSEXN_SYNTAXERR, \"syntax error\")\nMSG_DEF(JSMSG_MISSING_BINARY_DIGITS,  134, 0, JSEXN_SYNTAXERR, \"missing binary digits after '0b'\")\nMSG_DEF(JSMSG_BAD_PROTOTYPE,          135, 1, JSEXN_TYPEERR,   \"'prototype' property of {0} is not an object\")\nMSG_DEF(JSMSG_MISSING_EXPONENT,       136, 0, JSEXN_SYNTAXERR, \"missing exponent\")\nMSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, \"out of memory\")\nMSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, \"unterminated string literal\")\nMSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, \"too many parentheses in regular expression\")\nMSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, \"unterminated comment\")\nMSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, \"unterminated regular expression literal\")\nMSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, \"bad cloned function scope chain\")\nMSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, \"missing octal digits after '0o'\")\nMSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, \"illegal character\")\nMSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, \"{0} is not a legal ECMA-262 octal constant\")\nMSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, \"repeat count must be less than infinity and not overflow maximum string size\")\nMSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, \"uncaught exception: {0}\")\nMSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, \"non-octal digit in an escape sequence that doesn't match a back-reference\")\nMSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, \"back-reference exceeds number of capturing parentheses\")\nMSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, \"precision {0} out of range\")\nMSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, \"invalid {0} usage\")\nMSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, \"invalid array length\")\nMSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, \"can't describe non-native properties of class {0}\")\nMSG_DEF(JSMSG_BAD_APPLY_ARGS,         154, 1, JSEXN_TYPEERR, \"second argument to Function.prototype.{0} must be an array\")\nMSG_DEF(JSMSG_REDECLARED_VAR,         155, 2, JSEXN_TYPEERR, \"redeclaration of {0} {1}\")\nMSG_DEF(JSMSG_UNDECLARED_VAR,         156, 1, JSEXN_REFERENCEERR, \"assignment to undeclared variable {0}\")\nMSG_DEF(JSMSG_ANON_NO_RETURN_VALUE,   157, 0, JSEXN_TYPEERR, \"anonymous function does not always return a value\")\nMSG_DEF(JSMSG_DEPRECATED_USAGE,       158, 1, JSEXN_REFERENCEERR, \"deprecated {0} usage\")\nMSG_DEF(JSMSG_BAD_URI,                159, 0, JSEXN_URIERR, \"malformed URI sequence\")\nMSG_DEF(JSMSG_GETTER_ONLY,            160, 0, JSEXN_TYPEERR, \"setting a property that has only a getter\")\nMSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,   161, 0, JSEXN_SYNTAXERR, \"identifier starts immediately after numeric literal\")\nMSG_DEF(JSMSG_UNDEFINED_PROP,         162, 1, JSEXN_REFERENCEERR, \"reference to undefined property {0}\")\nMSG_DEF(JSMSG_USELESS_EXPR,           163, 0, JSEXN_TYPEERR, \"useless expression\")\nMSG_DEF(JSMSG_REDECLARED_PARAM,       164, 1, JSEXN_TYPEERR, \"redeclaration of formal parameter {0}\")\nMSG_DEF(JSMSG_NEWREGEXP_FLAGGED,      165, 0, JSEXN_TYPEERR, \"can't supply flags when constructing one RegExp from another\")\nMSG_DEF(JSMSG_RESERVED_SLOT_RANGE,    166, 0, JSEXN_RANGEERR, \"reserved slot index out of range\")\nMSG_DEF(JSMSG_CANT_DECODE_PRINCIPALS, 167, 0, JSEXN_INTERNALERR, \"can't decode JSPrincipals\")\nMSG_DEF(JSMSG_CANT_SEAL_OBJECT,       168, 1, JSEXN_ERR, \"can't seal {0} objects\")\nMSG_DEF(JSMSG_TOO_MANY_CATCH_VARS,    169, 0, JSEXN_SYNTAXERR, \"too many catch variables\")\nMSG_DEF(JSMSG_NEGATIVE_REPETITION_COUNT, 170, 0, JSEXN_RANGEERR, \"repeat count must be non-negative\")\nMSG_DEF(JSMSG_UNUSED171,              171, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED172,              172, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED173,              173, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED174,              174, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_NESTING_GENERATOR,      175, 0, JSEXN_TYPEERR, \"already executing generator\")\nMSG_DEF(JSMSG_UNUSED176,              176, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED177,              177, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED178,              178, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED179,              179, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED180,              180, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED181,              181, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SEND,     182, 1, JSEXN_TYPEERR, \"attempt to send {0} to newborn generator\")\nMSG_DEF(JSMSG_UNUSED183,              183, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED184,              184, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE, 185, 0, JSEXN_TYPEERR, \"proxy can't report an extensible object as non-extensible\")\nMSG_DEF(JSMSG_UNUSED186,              186, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED187,              187, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INCOMPATIBLE_METHOD,    188, 3, JSEXN_TYPEERR, \"{0} {1} called on incompatible {2}\")\nMSG_DEF(JSMSG_UNUSED189,              189, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED190,              190, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED191,              191, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED192,              192, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_FOR_EACH_LOOP,      193, 0, JSEXN_SYNTAXERR, \"invalid for each loop\")\nMSG_DEF(JSMSG_UNUSED194,              194, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED195,              195, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED196,              196, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INTERNAL_INTL_ERROR,    197, 0, JSEXN_ERR, \"internal error while computing Intl data\")\nMSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR,   198, 0, JSEXN_ERR, \"internal error getting the default locale\")\nMSG_DEF(JSMSG_TOO_MANY_LOCALS,        199, 0, JSEXN_SYNTAXERR, \"too many local variables\")\nMSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG,     200, 0, JSEXN_INTERNALERR, \"array initialiser too large\")\nMSG_DEF(JSMSG_REGEXP_TOO_COMPLEX,     201, 0, JSEXN_INTERNALERR, \"regular expression too complex\")\nMSG_DEF(JSMSG_BUFFER_TOO_SMALL,       202, 0, JSEXN_INTERNALERR, \"buffer too small\")\nMSG_DEF(JSMSG_BAD_SURROGATE_CHAR,     203, 1, JSEXN_TYPEERR, \"bad surrogate character {0}\")\nMSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE,    204, 1, JSEXN_TYPEERR, \"UTF-8 character {0} too large\")\nMSG_DEF(JSMSG_MALFORMED_UTF8_CHAR,    205, 1, JSEXN_TYPEERR, \"malformed UTF-8 character sequence at offset {0}\")\nMSG_DEF(JSMSG_USER_DEFINED_ERROR,     206, 0, JSEXN_ERR, \"JS_ReportError was called\")\nMSG_DEF(JSMSG_WRONG_CONSTRUCTOR,      207, 1, JSEXN_TYPEERR, \"wrong constructor called for {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_RETURN,   208, 1, JSEXN_TYPEERR, \"generator function {0} returns a value\")\nMSG_DEF(JSMSG_BAD_ANON_GENERATOR_RETURN, 209, 0, JSEXN_TYPEERR, \"anonymous generator function returns a value\")\nMSG_DEF(JSMSG_NAME_AFTER_FOR_PAREN,   210, 0, JSEXN_SYNTAXERR, \"missing name after for (\")\nMSG_DEF(JSMSG_IN_AFTER_FOR_NAME,      211, 0, JSEXN_SYNTAXERR, \"missing 'in' or 'of' after for\")\nMSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE,  212, 2, JSEXN_TYPEERR,\"trap {1} for {0} returned a primitive value\")\nMSG_DEF(JSMSG_UNUSED213,              213, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_YIELD,    214, 1, JSEXN_TYPEERR, \"yield from closing generator {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SYNTAX,   215, 1, JSEXN_SYNTAXERR, \"{0} expression must be parenthesized\")\nMSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE,    216, 0, JSEXN_SYNTAXERR, \"invalid array comprehension left-hand side\")\nMSG_DEF(JSMSG_UNUSED217,              217, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE,     218, 0, JSEXN_TYPEERR, \"reduce of empty array with no initial value\")\nMSG_DEF(JSMSG_UNUSED219,              219, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_DELETE_OPERAND,     220, 0, JSEXN_REFERENCEERR, \"invalid delete operand\")\nMSG_DEF(JSMSG_BAD_INCOP_OPERAND,      221, 0, JSEXN_REFERENCEERR, \"invalid increment/decrement operand\")\nMSG_DEF(JSMSG_UNEXPECTED_TYPE,        222, 2, JSEXN_TYPEERR, \"{0} is {1}\")\nMSG_DEF(JSMSG_LET_DECL_NOT_IN_BLOCK,  223, 0, JSEXN_SYNTAXERR, \"let declaration not directly within block\")\nMSG_DEF(JSMSG_BAD_OBJECT_INIT,        224, 0, JSEXN_SYNTAXERR, \"invalid object initializer\")\nMSG_DEF(JSMSG_CANT_SET_ARRAY_ATTRS,   225, 0, JSEXN_INTERNALERR, \"can't set attributes on indexed array properties\")\nMSG_DEF(JSMSG_EVAL_ARITY,             226, 0, JSEXN_TYPEERR, \"eval accepts only one parameter\")\nMSG_DEF(JSMSG_MISSING_FUN_ARG,        227, 2, JSEXN_TYPEERR, \"missing argument {0} when calling function {1}\")\nMSG_DEF(JSMSG_JSON_BAD_PARSE,         228, 1, JSEXN_SYNTAXERR, \"JSON.parse: {0}\")\nMSG_DEF(JSMSG_JSON_BAD_STRINGIFY,     229, 0, JSEXN_ERR, \"JSON.stringify\")\nMSG_DEF(JSMSG_NOT_CALLABLE_OR_UNDEFINED, 230, 0, JSEXN_TYPEERR, \"value is not a function or undefined\")\nMSG_DEF(JSMSG_NOT_NONNULL_OBJECT,     231, 0, JSEXN_TYPEERR, \"value is not a non-null object\")\nMSG_DEF(JSMSG_DEPRECATED_OCTAL,       232, 0, JSEXN_SYNTAXERR, \"octal literals and octal escape sequences are deprecated\")\nMSG_DEF(JSMSG_STRICT_CODE_WITH,       233, 0, JSEXN_SYNTAXERR, \"strict mode code may not contain 'with' statements\")\nMSG_DEF(JSMSG_DUPLICATE_PROPERTY,     234, 1, JSEXN_SYNTAXERR, \"property name {0} appears more than once in object literal\")\nMSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 235, 0, JSEXN_SYNTAXERR, \"applying the 'delete' operator to an unqualified name is deprecated\")\nMSG_DEF(JSMSG_BAD_STRICT_ASSIGN,      236, 1, JSEXN_SYNTAXERR, \"can't assign to {0} in strict mode\")\nMSG_DEF(JSMSG_BAD_BINDING,            237, 1, JSEXN_SYNTAXERR, \"redefining {0} is deprecated\")\nMSG_DEF(JSMSG_INVALID_DESCRIPTOR,     238, 0, JSEXN_TYPEERR, \"property descriptors must not specify a value or be writable when a getter or setter has been specified\")\nMSG_DEF(JSMSG_OBJECT_NOT_EXTENSIBLE,  239, 1, JSEXN_TYPEERR, \"{0} is not extensible\")\nMSG_DEF(JSMSG_CANT_REDEFINE_PROP,     240, 1, JSEXN_TYPEERR, \"can't redefine non-configurable property '{0}'\")\nMSG_DEF(JSMSG_CANT_APPEND_TO_ARRAY,   241, 0, JSEXN_TYPEERR, \"can't add elements past the end of an array if its length property is unwritable\")\nMSG_DEF(JSMSG_CANT_REDEFINE_ARRAY_LENGTH,242, 0, JSEXN_TYPEERR, \"can't redefine array length\")\nMSG_DEF(JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH,243, 0, JSEXN_TYPEERR, \"can't define array index property past the end of an array with non-writable length\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_INDEX,  244, 0, JSEXN_ERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG, 245, 1, JSEXN_ERR, \"argument {0} must be >= 0\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS,   246, 0, JSEXN_ERR, \"invalid arguments\")\nMSG_DEF(JSMSG_CSP_BLOCKED_FUNCTION,   247, 0, JSEXN_ERR, \"call to Function() blocked by CSP\")\nMSG_DEF(JSMSG_BAD_GET_SET_FIELD,      248, 1, JSEXN_TYPEERR, \"property descriptor's {0} field is neither undefined nor a function\")\nMSG_DEF(JSMSG_BAD_PROXY_FIX,          249, 0, JSEXN_TYPEERR, \"proxy was fixed while executing the handler\")\nMSG_DEF(JSMSG_INVALID_EVAL_SCOPE_ARG, 250, 0, JSEXN_EVALERR, \"invalid eval scope argument\")\nMSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS,    251, 3, JSEXN_SYNTAXERR, \"{0} functions must have {1} argument{2}\")\nMSG_DEF(JSMSG_THROW_TYPE_ERROR,       252, 0, JSEXN_TYPEERR, \"'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them\")\nMSG_DEF(JSMSG_BAD_TOISOSTRING_PROP,   253, 0, JSEXN_TYPEERR, \"toISOString property is not callable\")\nMSG_DEF(JSMSG_BAD_PARSE_NODE,         254, 0, JSEXN_INTERNALERR, \"bad parse node\")\nMSG_DEF(JSMSG_NOT_EXPECTED_TYPE,      255, 3, JSEXN_TYPEERR, \"{0}: expected {1}, got {2}\")\nMSG_DEF(JSMSG_CALLER_IS_STRICT,       256, 0, JSEXN_TYPEERR, \"access to strict mode caller function is censored\")\nMSG_DEF(JSMSG_NEED_DEBUG_MODE,        257, 0, JSEXN_ERR, \"function can be called only in debug mode\")\nMSG_DEF(JSMSG_STRICT_CODE_LET_EXPR_STMT, 258, 0, JSEXN_ERR, \"strict mode code may not contain unparenthesized let expression statements\")\nMSG_DEF(JSMSG_CANT_CHANGE_EXTENSIBILITY, 259, 0, JSEXN_TYPEERR, \"can't change object's extensibility\")\nMSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA, 260, 1, JSEXN_INTERNALERR, \"bad serialized structured data ({0})\")\nMSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE,    261, 0, JSEXN_TYPEERR, \"unsupported type for structured data\")\nMSG_DEF(JSMSG_SC_RECURSION,           262, 0, JSEXN_INTERNALERR, \"recursive object\")\nMSG_DEF(JSMSG_DEBUG_CANT_DEBUG_GLOBAL, 263, 0, JSEXN_ERR, \"passing non-debuggable global to addDebuggee\")\nMSG_DEF(JSMSG_BAD_CLONE_VERSION,      264, 0, JSEXN_ERR, \"unsupported structured clone version\")\nMSG_DEF(JSMSG_CANT_CLONE_OBJECT,      265, 0, JSEXN_TYPEERR, \"can't clone object\")\nMSG_DEF(JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED, 266, 0, JSEXN_TYPEERR, \"resumption values are disallowed in this hook\")\nMSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, \"in strict mode code, functions may be declared only at top level or immediately within another function\")\nMSG_DEF(JSMSG_INVALID_FOR_IN_INIT,    268, 0, JSEXN_SYNTAXERR, \"for-in loop let declaration may not have an initializer\")\nMSG_DEF(JSMSG_CLEARED_SCOPE,          269, 0, JSEXN_TYPEERR, \"attempt to run compile-and-go script on a cleared scope\")\nMSG_DEF(JSMSG_MALFORMED_ESCAPE,       270, 1, JSEXN_SYNTAXERR, \"malformed {0} character escape sequence\")\nMSG_DEF(JSMSG_BAD_GENEXP_BODY,        271, 1, JSEXN_SYNTAXERR, \"illegal use of {0} in generator expression\")\nMSG_DEF(JSMSG_YIELD_WITHOUT_OPERAND,  272, 0, JSEXN_SYNTAXERR, \"yield without a value is deprecated, and illegal in ES6 (use 'yield undefined' instead)\")\nMSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT,  273, 0, JSEXN_SYNTAXERR, \"function statement requires a name\")\nMSG_DEF(JSMSG_CCW_REQUIRED,           274, 1, JSEXN_TYPEERR, \"{0}: argument must be an object from a different compartment\")\nMSG_DEF(JSMSG_DEBUG_BAD_RESUMPTION,   275, 0, JSEXN_TYPEERR, \"debugger resumption value must be undefined, {throw: val}, {return: val}, or null\")\nMSG_DEF(JSMSG_ASSIGN_FUNCTION_OR_NULL, 276, 1, JSEXN_TYPEERR, \"value assigned to {0} must be a function or null\")\nMSG_DEF(JSMSG_DEBUG_NOT_LIVE,         277, 1, JSEXN_ERR, \"{0} is not live\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_WRONG_OWNER, 278, 0, JSEXN_TYPEERR, \"Debugger.Object belongs to a different Debugger\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_PROTO,     279, 0, JSEXN_TYPEERR, \"Debugger.Object.prototype is not a valid Debugger.Object\")\nMSG_DEF(JSMSG_DEBUG_LOOP,             280, 0, JSEXN_TYPEERR, \"cannot debug an object in same compartment as debugger or a compartment that is already debugging the debugger\")\nMSG_DEF(JSMSG_DEBUG_NOT_IDLE,         281, 0, JSEXN_ERR, \"can't start debugging: a debuggee script is on the stack\")\nMSG_DEF(JSMSG_DEBUG_BAD_OFFSET,       282, 0, JSEXN_TYPEERR, \"invalid script offset\")\nMSG_DEF(JSMSG_DEBUG_BAD_LINE,         283, 0, JSEXN_TYPEERR, \"invalid line number\")\nMSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING,    284, 0, JSEXN_ERR, \"can't set breakpoint: script global is not a debuggee\")\nMSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, \"{0}: descriptor .{1} property is an object in a different compartment than the target object\")\nMSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, \"stack frame is not running JavaScript code\")\nMSG_DEF(JSMSG_CANT_WATCH_PROP,        287, 0, JSEXN_TYPEERR, \"properties whose names are objects can't be watched\")\nMSG_DEF(JSMSG_CSP_BLOCKED_EVAL,       288, 0, JSEXN_ERR, \"call to eval() blocked by CSP\")\nMSG_DEF(JSMSG_DEBUG_NO_SCOPE_OBJECT,  289, 0, JSEXN_TYPEERR, \"declarative Environments don't have binding objects\")\nMSG_DEF(JSMSG_EMPTY_CONSEQUENT,       290, 0, JSEXN_SYNTAXERR, \"mistyped ; after conditional?\")\nMSG_DEF(JSMSG_NOT_ITERABLE,           291, 1, JSEXN_TYPEERR, \"{0} is not iterable\")\nMSG_DEF(JSMSG_QUERY_LINE_WITHOUT_URL, 292, 0, JSEXN_TYPEERR, \"findScripts query object has 'line' property, but no 'url' property\")\nMSG_DEF(JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL, 293, 0, JSEXN_TYPEERR, \"findScripts query object has 'innermost' property without both 'url' and 'line' properties\")\nMSG_DEF(JSMSG_DEBUG_VARIABLE_NOT_FOUND, 294, 0, JSEXN_TYPEERR, \"variable not found in environment\")\nMSG_DEF(JSMSG_PARAMETER_AFTER_REST,   295, 0, JSEXN_SYNTAXERR, \"parameter after rest parameter\")\nMSG_DEF(JSMSG_NO_REST_NAME,           296, 0, JSEXN_SYNTAXERR, \"no parameter name after ...\")\nMSG_DEF(JSMSG_ARGUMENTS_AND_REST,     297, 0, JSEXN_SYNTAXERR, \"'arguments' object may not be used in conjunction with a rest parameter\")\nMSG_DEF(JSMSG_FUNCTION_ARGUMENTS_AND_REST, 298, 0, JSEXN_ERR, \"the 'arguments' property of a function with a rest parameter may not be used\")\nMSG_DEF(JSMSG_REST_WITH_DEFAULT,      299, 0, JSEXN_SYNTAXERR, \"rest parameter may not have a default\")\nMSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, \"parameter(s) with default followed by parameter without default\")\nMSG_DEF(JSMSG_YIELD_IN_DEFAULT,       301, 0, JSEXN_SYNTAXERR, \"yield in default expression\")\nMSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED,  302, 1, JSEXN_REFERENCEERR, \"no intrinsic function {0}\")\nMSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP,  303, 1, JSEXN_ERR,      \"{0} is being assigned a source map, yet already has one\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG,      304, 1, JSEXN_RANGEERR, \"invalid ParallelArray{0} argument\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, \"argument must be divisible by outermost dimension\")\nMSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, \"cannot reduce ParallelArray object whose outermost dimension is empty\")\nMSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, \"cannot flatten 1-dimensional ParallelArray object\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, \"no conflict resolution function provided\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, \"index in scatter vector out of bounds\")\nMSG_DEF(JSMSG_CANT_REPORT_NC_AS_NE,   310, 0, JSEXN_TYPEERR, \"proxy can't report a non-configurable own property as non-existent\")\nMSG_DEF(JSMSG_CANT_REPORT_E_AS_NE,    311, 0, JSEXN_TYPEERR, \"proxy can't report an existing own property as non-existent on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_NEW,        312, 0, JSEXN_TYPEERR, \"proxy can't report a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_INVALID,    313, 0, JSEXN_TYPEERR, \"proxy can't report an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_REPORT_NE_AS_NC,   314, 0, JSEXN_TYPEERR, \"proxy can't report a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_CANT_DEFINE_NEW,        315, 0, JSEXN_TYPEERR, \"proxy can't define a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_DEFINE_INVALID,    316, 0, JSEXN_TYPEERR, \"proxy can't define an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_DEFINE_NE_AS_NC,   317, 0, JSEXN_TYPEERR, \"proxy can't define a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_INVALID_TRAP_RESULT,    318, 2, JSEXN_TYPEERR, \"trap {1} for {0} returned an invalid result\")\nMSG_DEF(JSMSG_CANT_SKIP_NC,           319, 0, JSEXN_TYPEERR, \"proxy can't skip a non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_SAME_VALUE, 320, 0, JSEXN_TYPEERR, \"proxy must report the same value for a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_UNDEFINED,  321, 0, JSEXN_TYPEERR, \"proxy must report undefined for a non-configurable accessor property without a getter\")\nMSG_DEF(JSMSG_CANT_SET_NW_NC,         322, 0, JSEXN_TYPEERR, \"proxy can't successfully set a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_CANT_SET_WO_SETTER,     323, 0, JSEXN_TYPEERR, \"proxy can't succesfully set an accessor property without a setter\")\nMSG_DEF(JSMSG_DEBUG_BAD_REFERENT,     324, 2, JSEXN_TYPEERR, \"{0} does not refer to {1}\")\nMSG_DEF(JSMSG_DEBUG_WRAPPER_IN_WAY,   325, 2, JSEXN_TYPEERR, \"{0} is a wrapper around {1}, but a direct reference is required\")\nMSG_DEF(JSMSG_UNWRAP_DENIED,          326, 0, JSEXN_ERR, \"permission denied to unwrap object\")\nMSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 327, 3, JSEXN_TYPEERR, \"Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}\")\nMSG_DEF(JSMSG_INVALID_LOCALES_ELEMENT,328, 0, JSEXN_TYPEERR, \"invalid element in locales argument\")\nMSG_DEF(JSMSG_INVALID_LANGUAGE_TAG,   329, 1, JSEXN_RANGEERR, \"invalid language tag: {0}\")\nMSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, \"invalid locale matcher in supportedLocalesOf(): {0}\")\nMSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, \"invalid value {1} for option {0}\")\nMSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, \"invalid digits value: {0}\")\nMSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, \"can't initialize object twice as an object of an Intl constructor\")\nMSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, \"invalid currency code in NumberFormat(): {0}\")\nMSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, \"undefined currency in NumberFormat() with currency style\")\nMSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, \"invalid time zone in DateTimeFormat(): {0}\")\nMSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, \"date value is not finite in DateTimeFormat.format()\")\nMSG_DEF(JSMSG_MODULE_STATEMENT,       338, 0, JSEXN_SYNTAXERR, \"module declarations may only appear at the top level of a program or module body\")\nMSG_DEF(JSMSG_CURLY_BEFORE_MODULE,    339, 0, JSEXN_SYNTAXERR, \"missing { before module body\")\nMSG_DEF(JSMSG_CURLY_AFTER_MODULE,     340, 0, JSEXN_SYNTAXERR, \"missing } after module body\")\nMSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 341, 0, JSEXN_SYNTAXERR, \"\\\"use asm\\\" is only meaningful in the Directive Prologue of a function body\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_FAIL,      342, 1, JSEXN_TYPEERR, \"asm.js type error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_LINK_FAIL,      343, 1, JSEXN_TYPEERR, \"asm.js link error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_OK,        344, 1, JSEXN_ERR,     \"successfully compiled asm.js code ({0})\")\nMSG_DEF(JSMSG_BAD_ARROW_ARGS,         345, 0, JSEXN_SYNTAXERR, \"invalid arrow-function arguments (parentheses around the arrow-function may help)\")\nMSG_DEF(JSMSG_YIELD_IN_ARROW,         346, 0, JSEXN_SYNTAXERR, \"arrow function may not contain yield\")\nMSG_DEF(JSMSG_WRONG_VALUE,            347, 2, JSEXN_ERR, \"expected {0} but found {1}\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, \"target for index {0} is not an integer\")\nMSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME,349, 0, JSEXN_TYPEERR, \"self-hosted code may not contain unbound name lookups\")\nMSG_DEF(JSMSG_DEPRECATED_SOURCE_MAP,  350, 0, JSEXN_SYNTAXERR, \"Using //@ to indicate source map URL pragmas is deprecated. Use //# instead\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASSIGN,    351, 1, JSEXN_SYNTAXERR, \"can't assign to {0} using destructuring assignment\")\nMSG_DEF(JSMSG_BINARYDATA_ARRAYTYPE_BAD_ARGS, 352, 0, JSEXN_ERR, \"Invalid arguments\")\nMSG_DEF(JSMSG_BINARYDATA_BINARYARRAY_BAD_INDEX, 353, 0, JSEXN_RANGEERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_ARGS, 354, 0, JSEXN_RANGEERR, \"invalid field descriptor\")\nMSG_DEF(JSMSG_BINARYDATA_NOT_BINARYSTRUCT,   355, 1, JSEXN_TYPEERR, \"{0} is not a BinaryStruct\")\nMSG_DEF(JSMSG_BINARYDATA_SUBARRAY_INTEGER_ARG, 356, 1, JSEXN_ERR, \"argument {0} must be an integer\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_EMPTY_DESCRIPTOR, 357, 0, JSEXN_ERR, \"field descriptor cannot be empty\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_FIELD, 358, 1, JSEXN_ERR, \"field {0} is not a valid BinaryData Type descriptor\")\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsalloc.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS allocation policies. */\n\n#ifndef jsalloc_h\n#define jsalloc_h\n\n#include \"mozilla/AllocPolicy.h\"\n\n#include \"js/Utility.h\"\n\nstruct JSContext;\n\nnamespace js {\n\nclass ContextFriendFields;\n\n/* Policy for using system memory functions and doing no error reporting. */\nclass SystemAllocPolicy\n{\n  public:\n    void *malloc_(size_t bytes) { return js_malloc(bytes); }\n    void *calloc_(size_t bytes) { return js_calloc(bytes); }\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }\n    void free_(void *p) { js_free(p); }\n    void reportAllocOverflow() const {}\n};\n\n/*\n * Allocation policy that calls the system memory functions and reports errors\n * to the context. Since the JSContext given on construction is stored for\n * the lifetime of the container, this policy may only be used for containers\n * whose lifetime is a shorter than the given JSContext.\n *\n * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,\n * not the system ones.\n */\nclass TempAllocPolicy\n{\n    ContextFriendFields *const cx_;\n\n    /*\n     * Non-inline helper to call JSRuntime::onOutOfMemory with minimal\n     * code bloat.\n     */\n    JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);\n\n  public:\n    TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(\n    TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}\n\n    void *malloc_(size_t bytes) {\n        void *p = js_malloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *calloc_(size_t bytes) {\n        void *p = js_calloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) {\n        void *p2 = js_realloc(p, bytes);\n        if (JS_UNLIKELY(!p2))\n            p2 = onOutOfMemory(p2, bytes);\n        return p2;\n    }\n\n    void free_(void *p) {\n        js_free(p);\n    }\n\n    JS_FRIEND_API(void) reportAllocOverflow() const;\n};\n\n} /* namespace js */\n\n#endif /* jsalloc_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JavaScript API. */\n\n#ifndef jsapi_h\n#define jsapi_h\n\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/RangedPtr.h\"\n#include \"mozilla/ThreadLocal.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"js-config.h\"\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n#include \"js/CharacterEncoding.h\"\n#include \"js/HashTable.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n#include \"js/Value.h\"\n#include \"js/Vector.h\"\n\n/************************************************************************/\n\nnamespace JS {\n\ntypedef mozilla::RangedPtr<const jschar> CharPtr;\n\nclass StableCharPtr : public CharPtr {\n  public:\n    StableCharPtr(const StableCharPtr &s) : CharPtr(s) {}\n    StableCharPtr(const mozilla::RangedPtr<const jschar> &s) : CharPtr(s) {}\n    StableCharPtr(const jschar *s, size_t len) : CharPtr(s, len) {}\n    StableCharPtr(const jschar *pos, const jschar *start, size_t len)\n      : CharPtr(pos, start, len)\n    {}\n};\n\n#if defined JS_THREADSAFE && defined DEBUG\n\nclass JS_PUBLIC_API(AutoCheckRequestDepth)\n{\n    JSContext *cx;\n  public:\n    AutoCheckRequestDepth(JSContext *cx);\n    AutoCheckRequestDepth(js::ContextFriendFields *cx);\n    ~AutoCheckRequestDepth();\n};\n\n# define CHECK_REQUEST(cx) \\\n    JS::AutoCheckRequestDepth _autoCheckRequestDepth(cx)\n\n#else\n\n# define CHECK_REQUEST(cx) \\\n    ((void) 0)\n\n#endif /* JS_THREADSAFE && DEBUG */\n\n#ifdef DEBUG\n/*\n * Assert that we're not doing GC on cx, that we're in a request as\n * needed, and that the compartments for cx and v are correct.\n * Also check that GC would be safe at this point.\n */\nJS_PUBLIC_API(void)\nAssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v);\n#else\ninline void AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v) {\n    /* Do nothing */\n}\n#endif /* DEBUG */\n\nclass JS_PUBLIC_API(AutoGCRooter) {\n  public:\n    AutoGCRooter(JSContext *cx, ptrdiff_t tag);\n    AutoGCRooter(js::ContextFriendFields *cx, ptrdiff_t tag);\n\n    ~AutoGCRooter() {\n        JS_ASSERT(this == *stackTop);\n        *stackTop = down;\n    }\n\n    /* Implemented in gc/RootMarking.cpp. */\n    inline void trace(JSTracer *trc);\n    static void traceAll(JSTracer *trc);\n    static void traceAllWrappers(JSTracer *trc);\n\n  protected:\n    AutoGCRooter * const down;\n\n    /*\n     * Discriminates actual subclass of this being used.  If non-negative, the\n     * subclass roots an array of values of the length stored in this field.\n     * If negative, meaning is indicated by the corresponding value in the enum\n     * below.  Any other negative value indicates some deeper problem such as\n     * memory corruption.\n     */\n    ptrdiff_t tag_;\n\n    enum {\n        VALARRAY =     -2, /* js::AutoValueArray */\n        PARSER =       -3, /* js::frontend::Parser */\n        SHAPEVECTOR =  -4, /* js::AutoShapeVector */\n        IDARRAY =      -6, /* js::AutoIdArray */\n        DESCRIPTORS =  -7, /* js::AutoPropDescArrayRooter */\n        ID =           -9, /* js::AutoIdRooter */\n        VALVECTOR =   -10, /* js::AutoValueVector */\n        DESCRIPTOR =  -11, /* js::AutoPropertyDescriptorRooter */\n        STRING =      -12, /* js::AutoStringRooter */\n        IDVECTOR =    -13, /* js::AutoIdVector */\n        OBJVECTOR =   -14, /* js::AutoObjectVector */\n        STRINGVECTOR =-15, /* js::AutoStringVector */\n        SCRIPTVECTOR =-16, /* js::AutoScriptVector */\n        NAMEVECTOR =  -17, /* js::AutoNameVector */\n        HASHABLEVALUE=-18, /* js::HashableValue */\n        IONMASM =     -19, /* js::jit::MacroAssembler */\n        IONALLOC =    -20, /* js::jit::AutoTempAllocatorRooter */\n        WRAPVECTOR =  -21, /* js::AutoWrapperVector */\n        WRAPPER =     -22, /* js::AutoWrapperRooter */\n        OBJOBJHASHMAP=-23, /* js::AutoObjectObjectHashMap */\n        OBJU32HASHMAP=-24, /* js::AutoObjectUnsigned32HashMap */\n        OBJHASHSET =  -25, /* js::AutoObjectHashSet */\n        JSONPARSER =  -26, /* js::JSONParser */\n        CUSTOM =      -27, /* js::CustomAutoRooter */\n        FUNVECTOR =   -28  /* js::AutoFunctionVector */\n    };\n\n  private:\n    AutoGCRooter ** const stackTop;\n\n    /* No copy or assignment semantics. */\n    AutoGCRooter(AutoGCRooter &ida) MOZ_DELETE;\n    void operator=(AutoGCRooter &ida) MOZ_DELETE;\n};\n\nclass AutoStringRooter : private AutoGCRooter {\n  public:\n    AutoStringRooter(JSContext *cx, JSString *str = NULL\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, STRING), str_(str)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    void setString(JSString *str) {\n        str_ = str;\n    }\n\n    JSString * string() const {\n        return str_;\n    }\n\n    JSString ** addr() {\n        return &str_;\n    }\n\n    JSString * const * addr() const {\n        return &str_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    JSString *str_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoArrayRooter : private AutoGCRooter {\n  public:\n    AutoArrayRooter(JSContext *cx, size_t len, Value *vec\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, len), array(vec), skip(cx, array, len)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeLength(size_t newLength) {\n        tag_ = ptrdiff_t(newLength);\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeArray(Value *newArray, size_t newLength) {\n        changeLength(newLength);\n        array = newArray;\n    }\n\n    Value *array;\n\n    MutableHandleValue handleAt(size_t i)\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return MutableHandleValue::fromMarkedLocation(&array[i]);\n    }\n    HandleValue handleAt(size_t i) const\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return HandleValue::fromMarkedLocation(&array[i]);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    js::SkipRoot skip;\n};\n\ntemplate<class T>\nclass AutoVectorRooter : protected AutoGCRooter\n{\n  public:\n    explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoVectorRooter(js::ContextFriendFields *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef T ElementType;\n\n    size_t length() const { return vector.length(); }\n    bool empty() const { return vector.empty(); }\n\n    bool append(const T &v) { return vector.append(v); }\n    bool appendAll(const AutoVectorRooter<T> &other) {\n        return vector.appendAll(other.vector);\n    }\n\n    bool insert(T *p, const T &val) { return vector.insert(p, val); }\n\n    /* For use when space has already been reserved. */\n    void infallibleAppend(const T &v) { vector.infallibleAppend(v); }\n\n    void popBack() { vector.popBack(); }\n    T popCopy() { return vector.popCopy(); }\n\n    bool growBy(size_t inc) {\n        size_t oldLength = vector.length();\n        if (!vector.growByUninitialized(inc))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    bool resize(size_t newLength) {\n        size_t oldLength = vector.length();\n        if (newLength <= oldLength) {\n            vector.shrinkBy(oldLength - newLength);\n            return true;\n        }\n        if (!vector.growByUninitialized(newLength - oldLength))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    void clear() { vector.clear(); }\n\n    bool reserve(size_t newLength) {\n        return vector.reserve(newLength);\n    }\n\n    T &operator[](size_t i) { return vector[i]; }\n    const T &operator[](size_t i) const { return vector[i]; }\n\n    JS::MutableHandle<T> handleAt(size_t i) { return JS::MutableHandle<T>::fromMarkedLocation(&vector[i]); }\n    JS::Handle<T> handleAt(size_t i) const { return JS::Handle<T>::fromMarkedLocation(&vector[i]); }\n\n    const T *begin() const { return vector.begin(); }\n    T *begin() { return vector.begin(); }\n\n    const T *end() const { return vector.end(); }\n    T *end() { return vector.end(); }\n\n    const T &back() const { return vector.back(); }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    void makeRangeGCSafe(size_t oldLength) {\n        T *t = vector.begin() + oldLength;\n        for (size_t i = oldLength; i < vector.length(); ++i, ++t)\n            memset(t, 0, sizeof(T));\n    }\n\n    typedef js::Vector<T, 8> VectorImpl;\n    VectorImpl vector;\n\n    /* Prevent overwriting of inline elements in vector. */\n    js::SkipRoot vectorRoot;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class Key, class Value>\nclass AutoHashMapRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashMap<Key, Value> HashMapImpl;\n\n  public:\n    explicit AutoHashMapRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), map(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n    typedef typename HashMapImpl::Lookup Lookup;\n    typedef typename HashMapImpl::Ptr Ptr;\n    typedef typename HashMapImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return map.init(len);\n    }\n    bool initialized() const {\n        return map.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return map.lookup(l);\n    }\n    void remove(Ptr p) {\n        map.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return map.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.add(p, k, v);\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        return map.add(p, k);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.relookupOrAdd(p, k, v);\n    }\n\n    typedef typename HashMapImpl::Range Range;\n    Range all() const {\n        return map.all();\n    }\n\n    typedef typename HashMapImpl::Enum Enum;\n\n    void clear() {\n        map.clear();\n    }\n\n    void finish() {\n        map.finish();\n    }\n\n    bool empty() const {\n        return map.empty();\n    }\n\n    uint32_t count() const {\n        return map.count();\n    }\n\n    size_t capacity() const {\n        return map.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return map.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return map.has(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        return map.put(k, v);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        return map.putNew(k, v);\n    }\n\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        return map.lookupWithDefault(k, defaultValue);\n    }\n\n    void remove(const Lookup &l) {\n        map.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashMapRooter(const AutoHashMapRooter &hmr) MOZ_DELETE;\n    AutoHashMapRooter &operator=(const AutoHashMapRooter &hmr) MOZ_DELETE;\n\n    HashMapImpl map;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class T>\nclass AutoHashSetRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashSet<T> HashSetImpl;\n\n  public:\n    explicit AutoHashSetRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), set(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef typename HashSetImpl::Lookup Lookup;\n    typedef typename HashSetImpl::Ptr Ptr;\n    typedef typename HashSetImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return set.init(len);\n    }\n    bool initialized() const {\n        return set.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return set.lookup(l);\n    }\n    void remove(Ptr p) {\n        set.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return set.lookupForAdd(l);\n    }\n\n    bool add(AddPtr &p, const T &t) {\n        return set.add(p, t);\n    }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return set.relookupOrAdd(p, l, t);\n    }\n\n    typedef typename HashSetImpl::Range Range;\n    Range all() const {\n        return set.all();\n    }\n\n    typedef typename HashSetImpl::Enum Enum;\n\n    void clear() {\n        set.clear();\n    }\n\n    void finish() {\n        set.finish();\n    }\n\n    bool empty() const {\n        return set.empty();\n    }\n\n    uint32_t count() const {\n        return set.count();\n    }\n\n    size_t capacity() const {\n        return set.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return set.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return set.has(l);\n    }\n\n    bool put(const T &t) {\n        return set.put(t);\n    }\n\n    bool putNew(const T &t) {\n        return set.putNew(t);\n    }\n\n    void remove(const Lookup &l) {\n        set.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashSetRooter(const AutoHashSetRooter &hmr) MOZ_DELETE;\n    AutoHashSetRooter &operator=(const AutoHashSetRooter &hmr) MOZ_DELETE;\n\n    HashSetImpl set;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoValueVector : public AutoVectorRooter<Value>\n{\n  public:\n    explicit AutoValueVector(JSContext *cx\n                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<Value>(cx, VALVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoIdVector : public AutoVectorRooter<jsid>\n{\n  public:\n    explicit AutoIdVector(JSContext *cx\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<jsid>(cx, IDVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoObjectVector : public AutoVectorRooter<JSObject *>\n{\n  public:\n    explicit AutoObjectVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoFunctionVector : public AutoVectorRooter<JSFunction *>\n{\n  public:\n    explicit AutoFunctionVector(JSContext *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoFunctionVector(js::ContextFriendFields *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoScriptVector : public AutoVectorRooter<JSScript *>\n{\n  public:\n    explicit AutoScriptVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * Cutsom rooting behavior for internal and external clients.\n */\nclass JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter\n{\n  public:\n    template <typename CX>\n    explicit CustomAutoRooter(CX *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, CUSTOM)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  protected:\n    /* Supplied by derived class to trace roots. */\n    virtual void trace(JSTracer *trc) = 0;\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Returns true if |v| is considered an acceptable this-value. */\ntypedef bool (*IsAcceptableThis)(const Value &v);\n\n/*\n * Implements the guts of a method; guaranteed to be provided an acceptable\n * this-value, as determined by a corresponding IsAcceptableThis method.\n */\ntypedef bool (*NativeImpl)(JSContext *cx, CallArgs args);\n\nnamespace detail {\n\n/* DON'T CALL THIS DIRECTLY.  It's for use only by CallNonGenericMethod! */\nextern JS_PUBLIC_API(bool)\nCallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n\n} /* namespace detail */\n\n/*\n * Methods usually act upon |this| objects only from a single global object and\n * compartment.  Sometimes, however, a method must act upon |this| values from\n * multiple global objects or compartments.  In such cases the |this| value a\n * method might see will be wrapped, such that various access to the object --\n * to its class, its private data, its reserved slots, and so on -- will not\n * work properly without entering that object's compartment.  This method\n * implements a solution to this problem.\n *\n * To implement a method that accepts |this| values from multiple compartments,\n * define two functions.  The first function matches the IsAcceptableThis type\n * and indicates whether the provided value is an acceptable |this| for the\n * method; it must be a pure function only of its argument.\n *\n *   static JSClass AnswerClass = { ... };\n *\n *   static bool\n *   IsAnswerObject(const Value &v)\n *   {\n *       if (!v.isObject())\n *           return false;\n *       return JS_GetClass(&v.toObject()) == &AnswerClass;\n *   }\n *\n * The second function implements the NativeImpl signature and defines the\n * behavior of the method when it is provided an acceptable |this| value.\n * Aside from some typing niceties -- see the CallArgs interface for details --\n * its interface is the same as that of JSNative.\n *\n *   static bool\n *   answer_getAnswer_impl(JSContext *cx, JS::CallArgs args)\n *   {\n *       args.rval().setInt32(42);\n *       return true;\n *   }\n *\n * The implementation function is guaranteed to be called *only* with a |this|\n * value which is considered acceptable.\n *\n * Now to implement the actual method, write a JSNative that calls the method\n * declared below, passing the appropriate template and runtime arguments.\n *\n *   static JSBool\n *   answer_getAnswer(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *       return JS::CallNonGenericMethod<IsAnswerObject, answer_getAnswer_impl>(cx, args);\n *   }\n *\n * Note that, because they are used as template arguments, the predicate\n * and implementation functions must have external linkage. (This is\n * unfortunate, but GCC wasn't inlining things as one would hope when we\n * passed them as function arguments.)\n *\n * JS::CallNonGenericMethod will test whether |args.thisv()| is acceptable.  If\n * it is, it will call the provided implementation function, which will return\n * a value and indicate success.  If it is not, it will attempt to unwrap\n * |this| and call the implementation function on the unwrapped |this|.  If\n * that succeeds, all well and good.  If it doesn't succeed, a TypeError will\n * be thrown.\n *\n * Note: JS::CallNonGenericMethod will only work correctly if it's called in\n *       tail position in a JSNative.  Do not call it from any other place.\n */\ntemplate<IsAcceptableThis Test, NativeImpl Impl>\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\n}  /* namespace JS */\n\n/************************************************************************/\n\n/* JSClass operation signatures. */\n\n/*\n * Add or get a property named by id in obj.  Note the jsid id type -- id may\n * be a string (Unicode property identifier) or an int (element index).  The\n * *vp out parameter, on success, is the new property value after the action.\n */\ntypedef JSBool\n(* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Set a property named by id in obj, treating the assignment as strict\n * mode code if strict is true. Note the jsid id type -- id may be a string\n * (Unicode property identifier) or an int (element index). The *vp out\n * parameter, on success, is the new property value after the\n * set.\n */\ntypedef JSBool\n(* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Delete a property named by id in obj.\n *\n * If an error occurred, return false as per normal JSAPI error practice.\n *\n * If no error occurred, but the deletion attempt wasn't allowed (perhaps\n * because the property was non-configurable), set *succeeded to false and\n * return true.  This will cause |delete obj[id]| to evaluate to false in\n * non-strict mode code, and to throw a TypeError in strict mode code.\n *\n * If no error occurred and the deletion wasn't disallowed (this is *not* the\n * same as saying that a deletion actually occurred -- deleting a non-existent\n * property, or an inherited property, is allowed -- it's just pointless),\n * set *succeeded to true and return true.\n */\ntypedef JSBool\n(* JSDeletePropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);\n\n/*\n * This function type is used for callbacks that enumerate the properties of\n * a JSObject.  The behavior depends on the value of enum_op:\n *\n *  JSENUMERATE_INIT\n *    A new, opaque iterator state should be allocated and stored in *statep.\n *    (You can use PRIVATE_TO_JSVAL() to tag the pointer to be stored).\n *\n *    The number of properties that will be enumerated should be returned as\n *    an integer jsval in *idp, if idp is non-null, and provided the number of\n *    enumerable properties is known.  If idp is non-null and the number of\n *    enumerable properties can't be computed in advance, *idp should be set\n *    to JSVAL_ZERO.\n *\n *  JSENUMERATE_INIT_ALL\n *    Used identically to JSENUMERATE_INIT, but exposes all properties of the\n *    object regardless of enumerability.\n *\n *  JSENUMERATE_NEXT\n *    A previously allocated opaque iterator state is passed in via statep.\n *    Return the next jsid in the iteration using *idp.  The opaque iterator\n *    state pointed at by statep is destroyed and *statep is set to JSVAL_NULL\n *    if there are no properties left to enumerate.\n *\n *  JSENUMERATE_DESTROY\n *    Destroy the opaque iterator state previously allocated in *statep by a\n *    call to this function when enum_op was JSENUMERATE_INIT or\n *    JSENUMERATE_INIT_ALL.\n *\n * The return value is used to indicate success, with a value of JS_FALSE\n * indicating failure.\n */\ntypedef JSBool\n(* JSNewEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,\n                     JS::MutableHandle<JS::Value> statep, JS::MutableHandleId idp);\n\n/*\n * The old-style JSClass.enumerate op should define all lazy properties not\n * yet reflected in obj.\n */\ntypedef JSBool\n(* JSEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/*\n * Resolve a lazy property named by id in obj by defining it directly in obj.\n * Lazy properties are those reflected from some peer native property space\n * (e.g., the DOM attributes for a given node reflected as obj) on demand.\n *\n * JS looks for a property in an object, and if not found, tries to resolve\n * the given id.  If resolve succeeds, the engine looks again in case resolve\n * defined obj[id].  If no such property exists directly in obj, the process\n * is repeated with obj's prototype, etc.\n *\n * NB: JSNewResolveOp provides a cheaper way to resolve lazy properties.\n */\ntypedef JSBool\n(* JSResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\n/*\n * Like JSResolveOp, but flags provide contextual information as follows:\n *\n *  JSRESOLVE_ASSIGNING   obj[id] is on the left-hand side of an assignment\n *\n * The *objp out parameter, on success, should be null to indicate that id\n * was not resolved; and non-null, referring to obj or one of its prototypes,\n * if id was resolved.  The hook may assume *objp is null on entry.\n *\n * This hook instead of JSResolveOp is called via the JSClass.resolve member\n * if JSCLASS_NEW_RESOLVE is set in JSClass.flags.\n */\ntypedef JSBool\n(* JSNewResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,\n                   JS::MutableHandleObject objp);\n\n/*\n * Convert obj to the given type, returning true with the resulting value in\n * *vp on success, and returning false on error or exception.\n */\ntypedef JSBool\n(* JSConvertOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n                JS::MutableHandle<JS::Value> vp);\n\ntypedef struct JSFreeOp JSFreeOp;\n\nstruct JSFreeOp {\n  private:\n    JSRuntime   *runtime_;\n\n  protected:\n    JSFreeOp(JSRuntime *rt)\n      : runtime_(rt) { }\n\n  public:\n    JSRuntime *runtime() const {\n        return runtime_;\n    }\n};\n\n/*\n * Finalize obj, which the garbage collector has determined to be unreachable\n * from other live objects or from GC roots.  Obviously, finalizers must never\n * store a reference to obj.\n */\ntypedef void\n(* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);\n\n/*\n * Finalizes external strings created by JS_NewExternalString.\n */\ntypedef struct JSStringFinalizer JSStringFinalizer;\n\nstruct JSStringFinalizer {\n    void (*finalize)(const JSStringFinalizer *fin, jschar *chars);\n};\n\n/*\n * JSClass.checkAccess type: check whether obj[id] may be accessed per mode,\n * returning false on error/exception, true on success with obj[id]'s last-got\n * value in *vp, and its attributes in *attrsp.  As for JSPropertyOp above, id\n * is either a string or an int jsval.\n */\ntypedef JSBool\n(* JSCheckAccessOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                    JSAccessMode mode, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Check whether v is an instance of obj.  Return false on error or exception,\n * true on success with JS_TRUE in *bp if v is an instance of obj, JS_FALSE in\n * *bp otherwise.\n */\ntypedef JSBool\n(* JSHasInstanceOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,\n                    JSBool *bp);\n\n/*\n * Function type for trace operation of the class called to enumerate all\n * traceable things reachable from obj's private data structure. For each such\n * thing, a trace implementation must call one of the JS_Call*Tracer variants\n * on the thing.\n *\n * JSTraceOp implementation can assume that no other threads mutates object\n * state. It must not change state of the object or corresponding native\n * structures. The only exception for this rule is the case when the embedding\n * needs a tight integration with GC. In that case the embedding can check if\n * the traversal is a part of the marking phase through calling\n * JS_IsGCMarkingTracer and apply a special code like emptying caches or\n * marking its native structures.\n */\ntypedef void\n(* JSTraceOp)(JSTracer *trc, JSObject *obj);\n\n/*\n * Callback that JSTraceOp implementation can provide to return a string\n * describing the reference traced with JS_CallTracer.\n */\ntypedef void\n(* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);\n\ntypedef JSObject *\n(* JSWeakmapKeyDelegateOp)(JSObject *obj);\n\n/* Callbacks and their arguments. */\n\ntypedef enum JSContextOp {\n    JSCONTEXT_NEW,\n    JSCONTEXT_DESTROY\n} JSContextOp;\n\n/*\n * The possible values for contextOp when the runtime calls the callback are:\n *   JSCONTEXT_NEW      JS_NewContext successfully created a new JSContext\n *                      instance. The callback can initialize the instance as\n *                      required. If the callback returns false, the instance\n *                      will be destroyed and JS_NewContext returns null. In\n *                      this case the callback is not called again.\n *   JSCONTEXT_DESTROY  One of JS_DestroyContext* methods is called. The\n *                      callback may perform its own cleanup and must always\n *                      return true.\n *   Any other value    For future compatibility the callback must do nothing\n *                      and return true in this case.\n */\ntypedef JSBool\n(* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data);\n\ntypedef enum JSGCStatus {\n    JSGC_BEGIN,\n    JSGC_END\n} JSGCStatus;\n\ntypedef void\n(* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data);\n\ntypedef enum JSFinalizeStatus {\n    /*\n     * Called when preparing to sweep a group of compartments, before anything\n     * has been swept.  The collector will not yield to the mutator before\n     * calling the callback with JSFINALIZE_GROUP_END status.\n     */\n    JSFINALIZE_GROUP_START,\n\n    /*\n     * Called when preparing to sweep a group of compartments. Weak references\n     * to unmarked things have been removed and things that are not swept\n     * incrementally have been finalized at this point.  The collector may yield\n     * to the mutator after this point.\n     */\n    JSFINALIZE_GROUP_END,\n\n    /*\n     * Called at the end of collection when everything has been swept.\n     */\n    JSFINALIZE_COLLECTION_END\n} JSFinalizeStatus;\n\ntypedef void\n(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment);\n\n/*\n * Generic trace operation that calls JS_CallTracer on each traceable thing\n * stored in data.\n */\ntypedef void\n(* JSTraceDataOp)(JSTracer *trc, void *data);\n\ntypedef JSBool\n(* JSOperationCallback)(JSContext *cx);\n\ntypedef void\n(* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);\n\n#ifdef MOZ_TRACE_JSCALLS\ntypedef void\n(* JSFunctionCallback)(const JSFunction *fun,\n                       const JSScript *scr,\n                       const JSContext *cx,\n                       int entering);\n#endif\n\n/*\n * Possible exception types. These types are part of a JSErrorFormatString\n * structure. They define which error to throw in case of a runtime error.\n * JSEXN_NONE marks an unthrowable error.\n */\ntypedef enum JSExnType {\n    JSEXN_NONE = -1,\n      JSEXN_ERR,\n        JSEXN_INTERNALERR,\n        JSEXN_EVALERR,\n        JSEXN_RANGEERR,\n        JSEXN_REFERENCEERR,\n        JSEXN_SYNTAXERR,\n        JSEXN_TYPEERR,\n        JSEXN_URIERR,\n        JSEXN_LIMIT\n} JSExnType;\n\ntypedef struct JSErrorFormatString {\n    /* The error format string in ASCII. */\n    const char *format;\n\n    /* The number of arguments to expand in the formatted error message. */\n    uint16_t argCount;\n\n    /* One of the JSExnType constants above. */\n    int16_t exnType;\n} JSErrorFormatString;\n\ntypedef const JSErrorFormatString *\n(* JSErrorCallback)(void *userRef, const char *locale,\n                    const unsigned errorNumber);\n\ntypedef JSBool\n(* JSLocaleToUpperCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToLowerCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleCompare)(JSContext *cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,\n                    JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandle<JS::Value> rval);\n\n/*\n * Security protocol types.\n */\n\ntypedef void\n(* JSDestroyPrincipalsOp)(JSPrincipals *principals);\n\n/*\n * Used to check if a CSP instance wants to disable eval() and friends.\n * See js_CheckCSPPermitsJSAction() in jsobj.\n */\ntypedef JSBool\n(* JSCSPEvalChecker)(JSContext *cx);\n\n/*\n * Callback used to ask the embedding for the cross compartment wrapper handler\n * that implements the desired prolicy for this kind of object in the\n * destination compartment. |obj| is the object to be wrapped. If |existing| is\n * non-NULL, it will point to an existing wrapper object that should be re-used\n * if possible. |existing| is guaranteed to be a cross-compartment wrapper with\n * a lazily-defined prototype and the correct global. It is guaranteed not to\n * wrap a function.\n */\ntypedef JSObject *\n(* JSWrapObjectCallback)(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj,\n                         JS::HandleObject proto, JS::HandleObject parent,\n                         unsigned flags);\n\n/*\n * Callback used by the wrap hook to ask the embedding to prepare an object\n * for wrapping in a context. This might include unwrapping other wrappers\n * or even finding a more suitable object for the new compartment.\n */\ntypedef JSObject *\n(* JSPreWrapCallback)(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj,\n                      unsigned flags);\n\n/*\n * Callback used when wrapping determines that the underlying object is already\n * in the compartment for which it is being wrapped. This allows consumers to\n * maintain same-compartment wrapping invariants.\n *\n * |obj| is guaranteed to be same-compartment as |cx|, but it may (or may not)\n * be a security or cross-compartment wrapper. This is an unfortunate contract,\n * but is important for to avoid unnecessarily recomputing every cross-\n * compartment wrapper that gets passed to wrap.\n */\ntypedef JSObject *\n(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JS::HandleObject obj);\n\ntypedef void\n(* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);\n\ntypedef void\n(* JSCompartmentNameCallback)(JSRuntime *rt, JSCompartment *compartment,\n                              char *buf, size_t bufsize);\n\n/*\n * Read structured data from the reader r. This hook is used to read a value\n * previously serialized by a call to the WriteStructuredCloneOp hook.\n *\n * tag and data are the pair of uint32_t values from the header. The callback\n * may use the JS_Read* APIs to read any other relevant parts of the object\n * from the reader r. closure is any value passed to the JS_ReadStructuredClone\n * function. Return the new object on success, NULL on error/exception.\n */\ntypedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,\n                                           uint32_t tag, uint32_t data, void *closure);\n\n/*\n * Structured data serialization hook. The engine can write primitive values,\n * Objects, Arrays, Dates, RegExps, TypedArrays, and ArrayBuffers. Any other\n * type of object requires application support. This callback must first use\n * the JS_WriteUint32Pair API to write an object header, passing a value\n * greater than JS_SCTAG_USER to the tag parameter. Then it can use the\n * JS_Write* APIs to write any other relevant parts of the value v to the\n * writer w. closure is any value passed to the JS_WriteStructuredCLone function.\n *\n * Return true on success, false on error/exception.\n */\ntypedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,\n                                         JS::Handle<JSObject*> obj, void *closure);\n\n/*\n * This is called when JS_WriteStructuredClone is given an invalid transferable.\n * To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException\n * with error set to one of the JS_SCERR_* values.\n */\ntypedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);\n\n/************************************************************************/\n\n/*\n * JS constants. For efficiency, prefer predicates (e.g. v.isNull()) and\n * constructing values from scratch (e.g. Int32Value(0)).  These constants are\n * stored in memory and initialized at startup, so testing against them and\n * using them requires memory loads and will be correspondingly slow.\n */\nextern JS_PUBLIC_DATA(const jsval) JSVAL_NULL;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ZERO;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ONE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_FALSE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_TRUE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_VOID;\n\nstatic JS_ALWAYS_INLINE jsval\nJS_NumberValue(double d)\n{\n    int32_t i;\n    d = JS::CanonicalizeNaN(d);\n    if (mozilla::DoubleIsInt32(d, &i))\n        return INT_TO_JSVAL(i);\n    return DOUBLE_TO_JSVAL(d);\n}\n\n/************************************************************************/\n\n/*\n * A jsid is an identifier for a property or method of an object which is\n * either a 31-bit signed integer, interned string or object.  Also, there is\n * an additional jsid value, JSID_VOID, which does not occur in JS scripts but\n * may be used to indicate the absence of a valid jsid.\n *\n * A jsid is not implicitly convertible to or from a jsval; JS_ValueToId or\n * JS_IdToValue must be used instead.\n */\n\n#define JSID_TYPE_STRING                 0x0\n#define JSID_TYPE_INT                    0x1\n#define JSID_TYPE_VOID                   0x2\n#define JSID_TYPE_OBJECT                 0x4\n#define JSID_TYPE_MASK                   0x7\n\n/*\n * Avoid using canonical 'id' for jsid parameters since this is a magic word in\n * Objective-C++ which, apparently, wants to be able to #include jsapi.h.\n */\n#define id iden\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_STRING(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJSID_TO_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSString *)JSID_BITS(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ZERO(jsid id)\n{\n    return JSID_BITS(id) == 0;\n}\n\nJS_PUBLIC_API(JSBool)\nJS_StringHasBeenInterned(JSContext *cx, JSString *str);\n\n/*\n * Only JSStrings that have been interned via the JSAPI can be turned into\n * jsids by API clients.\n *\n * N.B. if a jsid is backed by a string which has not been interned, that\n * string must be appropriately rooted to avoid being collected by the GC.\n */\nJS_PUBLIC_API(jsid)\nINTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_INT(jsid id)\n{\n    return !!(JSID_BITS(id) & JSID_TYPE_INT);\n}\n\nstatic JS_ALWAYS_INLINE int32_t\nJSID_TO_INT(jsid id)\n{\n    JS_ASSERT(JSID_IS_INT(id));\n    return ((uint32_t)JSID_BITS(id)) >> 1;\n}\n\n#define JSID_INT_MIN  0\n#define JSID_INT_MAX  INT32_MAX\n\nstatic JS_ALWAYS_INLINE JSBool\nINT_FITS_IN_JSID(int32_t i)\n{\n    return i >= 0;\n}\n\nstatic JS_ALWAYS_INLINE jsid\nINT_TO_JSID(int32_t i)\n{\n    jsid id;\n    JS_ASSERT(INT_FITS_IN_JSID(i));\n    JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_OBJECT(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT &&\n           (size_t)JSID_BITS(id) != JSID_TYPE_OBJECT;\n}\n\nstatic JS_ALWAYS_INLINE JSObject *\nJSID_TO_OBJECT(jsid id)\n{\n    JS_ASSERT(JSID_IS_OBJECT(id));\n    return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\nstatic JS_ALWAYS_INLINE jsid\nOBJECT_TO_JSID(JSObject *obj)\n{\n    jsid id;\n    JS_ASSERT(obj != NULL);\n    JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);\n    JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_GCTHING(jsid id)\n{\n    return JSID_IS_STRING(id) || JSID_IS_OBJECT(id);\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSID_TO_GCTHING(jsid id)\n{\n    return (void *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\n/*\n * A void jsid is not a valid id and only arises as an exceptional API return\n * value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into\n * JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in\n * hooks receiving a jsid except when explicitly noted in the API contract.\n */\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_VOID(const jsid id)\n{\n    JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,\n                 JSID_BITS(id) == JSID_TYPE_VOID);\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_EMPTY(const jsid id)\n{\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);\n}\n\n#undef id\n\n#ifdef JS_USE_JSID_STRUCT_TYPES\nextern JS_PUBLIC_DATA(const jsid) JSID_VOID;\nextern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;\n#else\n# define JSID_VOID ((jsid)JSID_TYPE_VOID)\n# define JSID_EMPTY ((jsid)JSID_TYPE_OBJECT)\n#endif\n\n/*\n * Returns true iff the given jsval is immune to GC and can be used across\n * multiple JSRuntimes without requiring any conversion API.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_UNIVERSAL(jsval v)\n{\n    return !JSVAL_IS_GCTHING(v);\n}\n\nnamespace JS {\n\nclass AutoIdRooter : private AutoGCRooter\n{\n  public:\n    explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, ID), id_(aId)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    jsid id() {\n        return id_;\n    }\n\n    jsid * addr() {\n        return &id_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    jsid id_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n} /* namespace JS */\n\n/************************************************************************/\n\n/* Property attributes, set in JSPropertySpec and passed to API functions. */\n#define JSPROP_ENUMERATE        0x01    /* property is visible to for/in loop */\n#define JSPROP_READONLY         0x02    /* not settable: assignment is no-op.\n                                           This flag is only valid when neither\n                                           JSPROP_GETTER nor JSPROP_SETTER is\n                                           set. */\n#define JSPROP_PERMANENT        0x04    /* property cannot be deleted */\n#define JSPROP_NATIVE_ACCESSORS 0x08    /* set in JSPropertyDescriptor.flags\n                                           if getters/setters are JSNatives */\n#define JSPROP_GETTER           0x10    /* property holds getter function */\n#define JSPROP_SETTER           0x20    /* property holds setter function */\n#define JSPROP_SHARED           0x40    /* don't allocate a value slot for this\n                                           property; don't copy the property on\n                                           set of the same-named property in an\n                                           object that delegates to a prototype\n                                           containing this property */\n#define JSPROP_INDEX            0x80    /* name is actually (int) index */\n#define JSPROP_SHORTID         0x100    /* set in JS_DefineProperty attrs\n                                           if getters/setters use a shortid */\n\n#define JSFUN_STUB_GSOPS       0x200    /* use JS_PropertyStub getter/setter\n                                           instead of defaulting to class gsops\n                                           for property holding function */\n\n#define JSFUN_CONSTRUCTOR      0x400    /* native that can be called as a ctor */\n\n\n/*\n * Specify a generic native prototype methods, i.e., methods of a class\n * prototype that are exposed as static methods taking an extra leading\n * argument: the generic |this| parameter.\n *\n * If you set this flag in a JSFunctionSpec struct's flags initializer, then\n * that struct must live at least as long as the native static method object\n * created due to this flag by JS_DefineFunctions or JS_InitClass.  Typically\n * JSFunctionSpec structs are allocated in static arrays.\n */\n#define JSFUN_GENERIC_NATIVE   0x800\n\n#define JSFUN_FLAGS_MASK       0xe00    /* | of all the JSFUN_* flags */\n\n/*\n * The first call to JS_CallOnce by any thread in a process will call 'func'.\n * Later calls to JS_CallOnce with the same JSCallOnceType object will be\n * suppressed.\n *\n * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce\n * to invoke its JSInitCallback.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CallOnce(JSCallOnceType *once, JSInitCallback func);\n\n/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */\nextern JS_PUBLIC_API(int64_t)\nJS_Now(void);\n\n/* Don't want to export data, so provide accessors for non-inline jsvals. */\nextern JS_PUBLIC_API(jsval)\nJS_GetNaNValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetNegativeInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetPositiveInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetEmptyStringValue(JSContext *cx);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetEmptyString(JSRuntime *rt);\n\n/*\n * Format is a string of the following characters (spaces are insignificant),\n * specifying the tabulated type conversions:\n *\n *   b      JSBool          Boolean\n *   c      uint16_t/jschar ECMA uint16_t, Unicode char\n *   i      int32_t         ECMA int32_t\n *   u      uint32_t        ECMA uint32_t\n *   j      int32_t         Rounded int32_t (coordinate)\n *   d      double          IEEE double\n *   I      double          Integral IEEE double\n *   S      JSString *      Unicode string, accessed by a JSString pointer\n *   W      jschar *        Unicode character vector, 0-terminated (W for wide)\n *   o      JSObject *      Object reference\n *   f      JSFunction *    Function private\n *   v      jsval           Argument value (no conversion)\n *   *      N/A             Skip this argument (no vararg)\n *   /      N/A             End of required arguments\n *\n * The variable argument list after format must consist of &b, &c, &s, e.g.,\n * where those variables have the types given above.  For the pointer types\n * char *, JSString *, and JSObject *, the pointed-at memory returned belongs\n * to the JS runtime, not to the calling native code.  The runtime promises\n * to keep this memory valid so long as argv refers to allocated stack space\n * (so long as the native function is active).\n *\n * Fewer arguments than format specifies may be passed only if there is a /\n * in format after the last required argument specifier and argc is at least\n * the number of required arguments.  More arguments than format specifies\n * may be passed without error; it is up to the caller to deal with trailing\n * unconverted arguments.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format,\n                    ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv,\n                      const char *format, va_list ap);\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToObject(JSContext *cx, jsval v, JSObject **objp);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToFunction(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToConstructor(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToString(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToSource(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToNumber(JSContext *cx, jsval v, double *dp);\n\nnamespace js {\n/*\n * DO NOT CALL THIS.  Use JS::ToNumber\n */\nextern JS_PUBLIC_API(bool)\nToNumberSlow(JSContext *cx, JS::Value v, double *dp);\n\n/*\n * DO NOT CALL THIS. Use JS::ToBoolean\n */\nextern JS_PUBLIC_API(bool)\nToBooleanSlow(const JS::Value &v);\n} /* namespace js */\n\nnamespace JS {\n\n/* ES5 9.3 ToNumber. */\nJS_ALWAYS_INLINE bool\nToNumber(JSContext *cx, HandleValue v, double *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    {\n        js::SkipRoot root(cx, &v);\n        js::MaybeCheckStackRoots(cx);\n    }\n\n    if (v.isNumber()) {\n        *out = v.toNumber();\n        return true;\n    }\n    return js::ToNumberSlow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToBoolean(const Value &v)\n{\n    if (v.isBoolean())\n        return v.toBoolean();\n    if (v.isInt32())\n        return v.toInt32() != 0;\n    if (v.isNullOrUndefined())\n        return false;\n    if (v.isDouble()) {\n        double d = v.toDouble();\n        return !mozilla::IsNaN(d) && d != 0;\n    }\n\n    /* The slow path handles strings and objects. */\n    return js::ToBooleanSlow(v);\n}\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_DoubleIsInt32(double d, int32_t *ip);\n\nextern JS_PUBLIC_API(int32_t)\nJS_DoubleToInt32(double d);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_DoubleToUint32(double d);\n\n/*\n * Convert a value to a number, then to an int32_t, according to the ECMA rules\n * for ToInt32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * Convert a value to a number, then to an int64_t, according to the WebIDL\n * rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt64(JSContext *cx, jsval v, int64_t *ip);\n\n/*\n * Convert a value to a number, then to an uint64_t, according to the WebIDL\n * rules for ToUint64: http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint64(JSContext *cx, jsval v, uint64_t *ip);\n\nnamespace js {\n/* DO NOT CALL THIS.  Use JS::ToInt16. */\nextern JS_PUBLIC_API(bool)\nToUint16Slow(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToInt32. */\nextern JS_PUBLIC_API(bool)\nToInt32Slow(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToUint32. */\nextern JS_PUBLIC_API(bool)\nToUint32Slow(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToInt64. */\nextern JS_PUBLIC_API(bool)\nToInt64Slow(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToUint64. */\nextern JS_PUBLIC_API(bool)\nToUint64Slow(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out);\n} /* namespace js */\n\nnamespace JS {\n\nJS_ALWAYS_INLINE bool\nToUint16(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint16_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint16Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt32(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = v.toInt32();\n        return true;\n    }\n    return js::ToInt32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint32(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint32_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt64(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = int64_t(v.toInt32());\n        return true;\n    }\n\n    return js::ToInt64Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint64(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        /* Account for sign extension of negatives into the longer 64bit space. */\n        *out = uint64_t(int64_t(v.toInt32()));\n        return true;\n    }\n\n    return js::ToUint64Slow(cx, v, out);\n}\n\n\n} /* namespace JS */\n\n/*\n * Convert a value to a number, then to a uint32_t, according to the ECMA rules\n * for ToUint32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);\n\n/*\n * Convert a value to a number, then to an int32_t if it fits by rounding to\n * nearest; but failing with an error report if the double is out of range\n * or unordered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * ECMA ToUint16, for mapping a jsval to a Unicode point.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(JSType)\nJS_TypeOfValue(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTypeName(JSContext *cx, JSType type);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same);\n\n/* True iff fun is the global eval function. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinEvalFunction(JSFunction *fun);\n\n/* True iff fun is the Function constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinFunctionConstructor(JSFunction *fun);\n\n/************************************************************************/\n\n/*\n * Initialization, locking, contexts, and memory allocation.\n *\n * It is important that the first runtime and first context be created in a\n * single-threaded fashion, otherwise the behavior of the library is undefined.\n * See: http://developer.mozilla.org/en/docs/Category:JSAPI_Reference\n */\n\ntypedef enum JSUseHelperThreads\n{\n    JS_NO_HELPER_THREADS,\n    JS_USE_HELPER_THREADS\n} JSUseHelperThreads;\n\n/**\n * Initialize SpiderMonkey, returning true only if initialization succeeded.\n * Once this method has succeeded, it is safe to call JS_NewRuntime and other\n * JSAPI methods.\n *\n * This method must be called before any other JSAPI method is used on any\n * thread.  Once it has been used, it is safe to call any JSAPI method, and it\n * remains safe to do so until JS_ShutDown is correctly called.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_Init(void);\n\n/**\n * Destroy free-standing resources allocated by SpiderMonkey, not associated\n * with any runtime, context, or other structure.\n *\n * This method should be called after all other JSAPI data has been properly\n * cleaned up: every new runtime must have been destroyed, every new context\n * must have been destroyed, and so on.  Calling this method before all other\n * resources have been destroyed has undefined behavior.\n *\n * Failure to call this method, at present, has no adverse effects other than\n * leaking memory.  This may not always be the case; it's recommended that all\n * embedders call this method when all other JSAPI operations have completed.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(void)\nJS_ShutDown(void);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_NewRuntime(uint32_t maxbytes, JSUseHelperThreads useHelperThreads);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyRuntime(JSRuntime *rt);\n\n// These are equivalent to ICU's |UMemAllocFn|, |UMemReallocFn|, and\n// |UMemFreeFn| types.  The first argument (called |context| in the ICU docs)\n// will always be NULL, and should be ignored.\ntypedef void *(*JS_ICUAllocFn)(const void *, size_t size);\ntypedef void *(*JS_ICUReallocFn)(const void *, void *p, size_t size);\ntypedef void (*JS_ICUFreeFn)(const void *, void *p);\n\n// This function can be used to track memory used by ICU.\n// Do not use it unless you know what you are doing!\nextern JS_PUBLIC_API(bool)\nJS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn, JS_ICUReallocFn reallocFn, JS_ICUFreeFn freeFn);\n\nJS_PUBLIC_API(void *)\nJS_GetRuntimePrivate(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nJS_PUBLIC_API(void)\nJS_SetRuntimePrivate(JSRuntime *rt, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_BeginRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_EndRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsInRequest(JSRuntime *rt);\n\nnamespace JS {\n\ninline bool\nIsPoisonedId(jsid iden)\n{\n    if (JSID_IS_STRING(iden))\n        return JS::IsPoisonedPtr(JSID_TO_STRING(iden));\n    if (JSID_IS_OBJECT(iden))\n        return JS::IsPoisonedPtr(JSID_TO_OBJECT(iden));\n    return false;\n}\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <> struct GCMethods<jsid>\n{\n    static jsid initial() { return JSID_VOID; }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(jsid id) { return JS::IsPoisonedId(id); }\n    static bool needsPostBarrier(jsid id) { return false; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(jsid *idp) {}\n    static void relocate(jsid *idp) {}\n#endif\n};\n\n} /* namespace js */\n\nclass JSAutoRequest\n{\n  public:\n    JSAutoRequest(JSContext *cx\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mContext(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_BeginRequest(mContext);\n    }\n    ~JSAutoRequest() {\n        JS_EndRequest(mContext);\n    }\n\n  protected:\n    JSContext *mContext;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n#if 0\n  private:\n    static void *operator new(size_t) CPP_THROW_NEW { return 0; };\n    static void operator delete(void *, size_t) { };\n#endif\n};\n\nclass JSAutoCheckRequest\n{\n  public:\n    JSAutoCheckRequest(JSContext *cx\n                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n#if defined JS_THREADSAFE && defined DEBUG\n        mContext = cx;\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));\n#endif\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoCheckRequest() {\n#if defined JS_THREADSAFE && defined DEBUG\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(mContext)));\n#endif\n    }\n\n\n  private:\n#if defined JS_THREADSAFE && defined DEBUG\n    JSContext *mContext;\n#endif\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback, void *data);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_NewContext(JSRuntime *rt, size_t stackChunkSize);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContext(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContextNoGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void *)\nJS_GetContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetSecondContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetSecondContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_ContextIterator(JSRuntime *rt, JSContext **iterp);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetVersion(JSContext *cx);\n\n// Mutate the version on the compartment. This is generally discouraged, but\n// necessary to support the version mutation in the js and xpc shell command\n// set.\n//\n// It would be nice to put this in jsfriendapi, but the linkage requirements\n// of the shells make that impossible.\nJS_PUBLIC_API(void)\nJS_SetVersionForCompartment(JSCompartment *compartment, JSVersion version);\n\nextern JS_PUBLIC_API(const char *)\nJS_VersionToString(JSVersion version);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_StringToVersion(const char *string);\n\n/*\n * JS options are orthogonal to version, and may be freely composed with one\n * another as well as with version.\n *\n * JSOPTION_VAROBJFIX is recommended -- see the comments associated with the\n * prototypes for JS_ExecuteScript, JS_EvaluateScript, etc.\n */\n#define JSOPTION_EXTRA_WARNINGS JS_BIT(0)       /* warn on dubious practices */\n#define JSOPTION_WERROR         JS_BIT(1)       /* convert warning to error */\n#define JSOPTION_VAROBJFIX      JS_BIT(2)       /* make JS_EvaluateScript use\n                                                   the last object on its 'obj'\n                                                   param's scope chain as the\n                                                   ECMA 'variables object' */\n#define JSOPTION_PRIVATE_IS_NSISUPPORTS \\\n                                JS_BIT(3)       /* context private data points\n                                                   to an nsISupports subclass */\n#define JSOPTION_COMPILE_N_GO   JS_BIT(4)       /* caller of JS_Compile*Script\n                                                   promises to execute compiled\n                                                   script once only; enables\n                                                   compile-time scope chain\n                                                   resolution of consts. */\n\n/* JS_BIT(5) is currently unused. */\n\n/* JS_BIT(6) is currently unused. */\n\n/* JS_BIT(7) is currently unused. */\n\n#define JSOPTION_DONT_REPORT_UNCAUGHT                                   \\\n                                JS_BIT(8)       /* When returning from the\n                                                   outermost API call, prevent\n                                                   uncaught exceptions from\n                                                   being converted to error\n                                                   reports */\n\n/* JS_BIT(9) is currently unused. */\n\n/* JS_BIT(10) is currently unused. */\n\n/* JS_BIT(11) is currently unused. */\n\n#define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12)      /* A promise to the compiler\n                                                   that a null rval out-param\n                                                   will be passed to each call\n                                                   to JS_ExecuteScript. */\n#define JSOPTION_UNROOTED_GLOBAL JS_BIT(13)     /* The GC will not root the\n                                                   contexts' default compartment\n                                                   object, leaving that up to the\n                                                   embedding. */\n\n#define JSOPTION_BASELINE       JS_BIT(14)      /* Baseline compiler. */\n\n#define JSOPTION_TYPE_INFERENCE JS_BIT(16)      /* Perform type inference. */\n#define JSOPTION_STRICT_MODE    JS_BIT(17)      /* Provides a way to force\n                                                   strict mode for all code\n                                                   without requiring\n                                                   \"use strict\" annotations. */\n\n#define JSOPTION_ION            JS_BIT(18)      /* IonMonkey */\n\n#define JSOPTION_ASMJS          JS_BIT(19)      /* optimizingasm.js compiler */\n\n#define JSOPTION_MASK           JS_BITMASK(20)\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetOptions(JSContext *cx);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_SetOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_ToggleOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(void)\nJS_SetJitHardening(JSRuntime *rt, JSBool enabled);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetImplementationVersion(void);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentNameCallback(JSRuntime *rt, JSCompartmentNameCallback callback);\n\nextern JS_PUBLIC_API(JSWrapObjectCallback)\nJS_SetWrapObjectCallbacks(JSRuntime *rt,\n                          JSWrapObjectCallback callback,\n                          JSSameCompartmentWrapObjectCallback sccallback,\n                          JSPreWrapCallback precallback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentPrivate(JSCompartment *compartment, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetCompartmentPrivate(JSCompartment *compartment);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapObject(JSContext *cx, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapValue(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapId(JSContext *cx, jsid *idp);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_TransplantObject(JSContext *cx, JS::HandleObject origobj, JS::HandleObject target);\n\nextern JS_FRIEND_API(JSObject *)\njs_TransplantObjectWithWrapper(JSContext *cx,\n                               JS::HandleObject origobj,\n                               JS::HandleObject origwrapper,\n                               JS::HandleObject targetobj,\n                               JS::HandleObject targetwrapper);\n\nextern JS_PUBLIC_API(JSBool)\nJS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob);\n\n/*\n * At any time, a JSContext has a current (possibly-NULL) compartment.\n * Compartments are described in:\n *\n *   developer.mozilla.org/en-US/docs/SpiderMonkey/SpiderMonkey_compartments\n *\n * The current compartment of a context may be changed. The preferred way to do\n * this is with JSAutoCompartment:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in some compartment 'c'\n *     {\n *       JSAutoCompartment ac(cx, obj);  // constructor enters\n *       // in the compartment of 'obj'\n *     }                                 // destructor leaves\n *     // back in compartment 'c'\n *   }\n *\n * For more complicated uses that don't neatly fit in a C++ stack frame, the\n * compartment can entered and left using separate function calls:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in 'oldCompartment'\n *     JSCompartment *oldCompartment = JS_EnterCompartment(cx, obj);\n *     // in the compartment of 'obj'\n *     JS_LeaveCompartment(cx, oldCompartment);\n *     // back in 'oldCompartment'\n *   }\n *\n * Note: these calls must still execute in a LIFO manner w.r.t all other\n * enter/leave calls on the context. Furthermore, only the return value of a\n * JS_EnterCompartment call may be passed as the 'oldCompartment' argument of\n * the corresponding JS_LeaveCompartment call.\n */\n\nclass JS_PUBLIC_API(JSAutoCompartment)\n{\n    JSContext *cx_;\n    JSCompartment *oldCompartment_;\n  public:\n    JSAutoCompartment(JSContext *cx, JSObject *target);\n    JSAutoCompartment(JSContext *cx, JSScript *target);\n    ~JSAutoCompartment();\n};\n\n/* NB: This API is infallible; a NULL return value does not indicate error. */\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartment(JSContext *cx, JSObject *target);\n\nextern JS_PUBLIC_API(void)\nJS_LeaveCompartment(JSContext *cx, JSCompartment *oldCompartment);\n\ntypedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);\n\n/*\n * This function calls |compartmentCallback| on every compartment.  Beware that\n * there is no guarantee that the compartment will survive after the callback\n * returns.\n */\nextern JS_PUBLIC_API(void)\nJS_IterateCompartments(JSRuntime *rt, void *data,\n                       JSIterateCompartmentCallback compartmentCallback);\n\n/*\n * Initialize standard JS class constructors, prototypes, and any top-level\n * functions and constants associated with the standard classes (e.g. isNaN\n * for Number).\n *\n * NB: This sets cx's global object to obj if it was null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitStandardClasses(JSContext *cx, JSObject *obj);\n\n/*\n * Resolve id, which must contain either a string or an int, to a standard\n * class name in obj if possible, defining the class's constructor and/or\n * prototype and storing true in *resolved.  If id does not name a standard\n * class or a top-level property induced by initializing a standard class,\n * store false in *resolved and just return true.  Return false on error,\n * as usual for JSBool result-typed API entry points.\n *\n * This API can be called directly from a global object class's resolve op,\n * to define standard classes lazily.  The class's enumerate op should call\n * JS_EnumerateStandardClasses(cx, obj), to define eagerly during for..in\n * loops any classes not yet resolved lazily.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStandardClass(JSContext *cx, JS::HandleObject obj, JS::HandleId id,\n                        JSBool *resolved);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStandardClasses(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSProtoKey)\nJS_IdentifyClassPrototype(JSContext *cx, JSObject *obj);\n\n/*\n * Returns the original value of |Function.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Object.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetObjectPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Array.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetArrayPrototype(JSContext *cx, JSObject *forObj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGlobalObject(JSObject *obj);\n\n/*\n * May return NULL, if |c| never had a global (e.g. the atoms compartment), or\n * if |c|'s global has been collected.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForCompartmentOrNull(JSContext *cx, JSCompartment *c);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(JSObject *)\nCurrentGlobalOrNull(JSContext *cx);\n\n}\n\n/*\n * This method returns the global corresponding to the most recent scripted\n * frame, which may not match the cx's current compartment. This is extremely\n * dangerous, because it can bypass compartment security invariants in subtle\n * ways. To use it safely, the caller must perform a subsequent security\n * check. There is currently only one consumer of this function in Gecko, and\n * it should probably stay that way. If you'd like to use it, please consult\n * the XPConnect module owner first.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetScriptedGlobal(JSContext *cx);\n\n/*\n * Initialize the 'Reflect' object on a global object.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_InitReflect(JSContext *cx, JSObject *global);\n\n#ifdef JS_HAS_CTYPES\n/*\n * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'\n * object will be sealed.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitCTypesClass(JSContext *cx, JSObject *global);\n\n/*\n * Convert a unicode string 'source' of length 'slen' to the platform native\n * charset, returning a null-terminated string allocated with JS_malloc. On\n * failure, this function should report an error.\n */\ntypedef char *\n(* JSCTypesUnicodeToNativeFun)(JSContext *cx, const jschar *source, size_t slen);\n\n/*\n * Set of function pointers that ctypes can use for various internal functions.\n * See JS_SetCTypesCallbacks below. Providing NULL for a function is safe,\n * and will result in the applicable ctypes functionality not being available.\n */\nstruct JSCTypesCallbacks {\n    JSCTypesUnicodeToNativeFun unicodeToNative;\n};\n\ntypedef struct JSCTypesCallbacks JSCTypesCallbacks;\n\n/*\n * Set the callbacks on the provided 'ctypesObj' object. 'callbacks' should be a\n * pointer to static data that exists for the lifetime of 'ctypesObj', but it\n * may safely be altered after calling this function and without having\n * to call this function again.\n */\nextern JS_PUBLIC_API(void)\nJS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);\n#endif\n\ntypedef JSBool\n(* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);\n\n/*\n * Enumerate memory regions that contain diagnostic information\n * intended to be included in crash report minidumps.\n */\nextern JS_PUBLIC_API(void)\nJS_EnumerateDiagnosticMemoryRegions(JSEnumerateDiagnosticMemoryCallback callback);\n\nextern JS_PUBLIC_API(void *)\nJS_malloc(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(void *)\nJS_realloc(JSContext *cx, void *p, size_t nbytes);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization.\n * cx may be NULL.\n */\nextern JS_PUBLIC_API(void)\nJS_free(JSContext *cx, void *p);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization as specified by the given JSFreeOp instance.\n */\nextern JS_PUBLIC_API(void)\nJS_freeop(JSFreeOp *fop, void *p);\n\nextern JS_PUBLIC_API(JSFreeOp *)\nJS_GetDefaultFreeOp(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_updateMallocCounter(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSContext *cx, const char *s);\n\n/* Duplicate a string.  Does not report an error on failure. */\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSRuntime *rt, const char *s);\n\n\n/*\n * A GC root is a pointer to a jsval, JSObject * or JSString * that itself\n * points into the GC heap. JS_AddValueRoot takes a pointer to a jsval and\n * JS_AddGCThingRoot takes a pointer to a JSObject * or JString *.\n *\n * Note that, since JS_Add*Root stores the address of a variable (of type\n * jsval, JSString *, or JSObject *), that variable must live until\n * JS_Remove*Root is called to remove that variable. For example, after:\n *\n *   void some_function() {\n *     jsval v;\n *     JS_AddNamedValueRoot(cx, &v, \"name\");\n *\n * the caller must perform\n *\n *     JS_RemoveValueRoot(cx, &v);\n *\n * before some_function() returns.\n *\n * Also, use JS_AddNamed*Root(cx, &structPtr->memberObj, \"structPtr->memberObj\")\n * in preference to JS_Add*Root(cx, &structPtr->memberObj), in order to identify\n * roots by their source callsites.  This way, you can find the callsite while\n * debugging if you should fail to do JS_Remove*Root(cx, &structPtr->memberObj)\n * before freeing structPtr's memory.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddObjectRoot(JSContext *cx, JSObject **rp);\n\n#ifdef NAME_ALL_GC_ROOTS\n#define JS_DEFINE_TO_TOKEN(def) #def\n#define JS_DEFINE_TO_STRING(def) JS_DEFINE_TO_TOKEN(def)\n#define JS_AddValueRoot(cx,vp) JS_AddNamedValueRoot((cx), (vp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddStringRoot(cx,rp) JS_AddNamedStringRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddObjectRoot(cx,rp) JS_AddNamedObjectRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRoot(JSContext *cx, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRoot(JSContext *cx, JSScript **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRootRT(JSRuntime *rt, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRootRT(JSRuntime *rt, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);\n\n/* TODO: remove these APIs */\n\nextern JS_FRIEND_API(void)\njs_RemoveRoot(JSRuntime *rt, void *rp);\n\n/*\n * C-compatible version of the Anchor class. It should be called after the last\n * use of the variable it protects.\n */\nextern JS_NEVER_INLINE JS_PUBLIC_API(void)\nJS_AnchorPtr(void *p);\n\n/*\n * Register externally maintained GC roots.\n *\n * traceOp: the trace operation. For each root the implementation should call\n *          JS_CallTracer whenever the root contains a traceable thing.\n * data:    the data argument to pass to each invocation of traceOp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/* Undo a call to JS_AddExtraGCRootsTracer. */\nextern JS_PUBLIC_API(void)\nJS_RemoveExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/*\n * JS_CallTracer API and related macros for implementors of JSTraceOp, to\n * enumerate all references to traceable things reachable via a property or\n * other strong ref identified for debugging purposes by name or index or\n * a naming callback.\n *\n * See the JSTraceOp typedef.\n */\n\n/*\n * Use the following macros to check if a particular jsval is a traceable\n * thing and to extract the thing and its kind to pass to JS_CallTracer.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_TRACEABLE(jsval v)\n{\n    return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSVAL_TO_TRACEABLE(jsval v)\n{\n    return JSVAL_TO_GCTHING(v);\n}\n\nstatic JS_ALWAYS_INLINE JSGCTraceKind\nJSVAL_TRACE_KIND(jsval v)\n{\n    JS_ASSERT(JSVAL_IS_GCTHING(v));\n    return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/*\n * Tracer callback, called for each traceable thing directly referenced by a\n * particular object or runtime structure. It is the callback responsibility\n * to ensure the traversal of the full object graph via calling eventually\n * JS_TraceChildren on the passed thing. In this case the callback must be\n * prepared to deal with cycles in the traversal graph.\n *\n * kind argument is one of JSTRACE_OBJECT, JSTRACE_STRING or a tag denoting\n * internal implementation-specific traversal kind. In the latter case the only\n * operations on thing that the callback can do is to call JS_TraceChildren or\n * JS_GetTraceThingInfo.\n *\n * If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all\n * of its mappings.  This should be used in cases where the tracer\n * wants to use the existing liveness of entries.\n */\ntypedef void\n(* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);\n\nenum WeakMapTraceKind {\n    DoNotTraceWeakMaps = 0,\n    TraceWeakMapValues = 1,\n    TraceWeakMapKeysValues = 2\n};\n\nstruct JSTracer {\n    JSRuntime           *runtime;\n    JSTraceCallback     callback;\n    JSTraceNamePrinter  debugPrinter;\n    const void          *debugPrintArg;\n    size_t              debugPrintIndex;\n    WeakMapTraceKind    eagerlyTraceWeakMaps;\n#ifdef JS_GC_ZEAL\n    void                *realLocation;\n#endif\n};\n\n/*\n * Set debugging information about a reference to a traceable thing to prepare\n * for the following call to JS_CallTracer.\n *\n * When printer is null, arg must be const char * or char * C string naming\n * the reference and index must be either (size_t)-1 indicating that the name\n * alone describes the reference or it must be an index into some array vector\n * that stores the reference.\n *\n * When printer callback is not null, the arg and index arguments are\n * available to the callback as debugPrintArg and debugPrintIndex fields\n * of JSTracer.\n *\n * The storage for name or callback's arguments needs to live only until\n * the following call to JS_CallTracer returns.\n */\n# define JS_SET_TRACING_DETAILS(trc, printer, arg, index)                     \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->debugPrinter = (printer);                                      \\\n        (trc)->debugPrintArg = (arg);                                         \\\n        (trc)->debugPrintIndex = (index);                                     \\\n    JS_END_MACRO\n\n/*\n * Sets the real location for a marked reference, when passing the address\n * directly is not feasable.\n *\n * FIXME: This is currently overcomplicated by our need to nest calls for Values\n * stored as keys in hash tables, but will get simplified once we can rekey\n * in-place.\n */\n#ifdef JS_GC_ZEAL\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n        if (!(trc)->realLocation || !(location))                              \\\n            (trc)->realLocation = (location);                                 \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->realLocation = NULL;                                           \\\n    JS_END_MACRO\n#else\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n#endif\n\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string\n * and index.\n */\n# define JS_SET_TRACING_INDEX(trc, name, index)                               \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, index)\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string.\n */\n# define JS_SET_TRACING_NAME(trc, name)                                       \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, (size_t)-1)\n\n/*\n * The JS_Call*Tracer family of functions traces the given GC thing reference.\n * This performs the tracing action configured on the given JSTracer:\n * typically calling the JSTracer::callback or marking the thing as live.\n *\n * The argument to JS_Call*Tracer is an in-out param: when the function\n * returns, the garbage collector might have moved the GC thing. In this case,\n * the reference passed to JS_Call*Tracer will be updated to the object's new\n * location. Callers of this method are responsible for updating any state\n * that is dependent on the object's address. For example, if the object's\n * address is used as a key in a hashtable, then the object must be removed\n * and re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(void)\nJS_CallValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);\n\ntemplate <typename HashSetEnum>\ninline void\nJS_CallHashSetObjectTracer(JSTracer *trc, HashSetEnum &e, JSObject *const &key, const char *name)\n{\n    JSObject *updated = key;\n    JS_SET_TRACING_LOCATION(trc, reinterpret_cast<void *>(&const_cast<JSObject *&>(key)));\n    JS_CallObjectTracer(trc, &updated, name);\n    if (updated != key)\n        e.rekeyFront(key, updated);\n}\n\n/*\n * Trace an object that is known to always be tenured.  No post barriers are\n * required in this case.\n */\nextern JS_PUBLIC_API(void)\nJS_CallTenuredObjectTracer(JSTracer *trc, JS::TenuredHeap<JSObject *> *objp, const char *name);\n\n/*\n * API for JSTraceCallback implementations.\n */\nextern JS_PUBLIC_API(void)\nJS_TracerInit(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);\n\nextern JS_PUBLIC_API(void)\nJS_TraceRuntime(JSTracer *trc);\n\nextern JS_PUBLIC_API(void)\nJS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc,\n                     void *thing, JSGCTraceKind kind, JSBool includeDetails);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize);\n\n#ifdef DEBUG\n\n/*\n * DEBUG-only method to dump the object graph of heap-allocated things.\n *\n * fp:              file for the dump output.\n * start:           when non-null, dump only things reachable from start\n *                  thing. Otherwise dump all things reachable from the\n *                  runtime roots.\n * startKind:       trace kind of start if start is not null. Must be\n *                  JSTRACE_OBJECT when start is null.\n * thingToFind:     dump only paths in the object graph leading to thingToFind\n *                  when non-null.\n * maxDepth:        the upper bound on the number of edges to descend from the\n *                  graph roots.\n * thingToIgnore:   thing to ignore during the graph traversal when non-null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind,\n            void *thingToFind, size_t maxDepth, void *thingToIgnore);\n\n#endif\n\n/*\n * Garbage collector API.\n */\nextern JS_PUBLIC_API(void)\nJS_GC(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_MaybeGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCCallback(JSRuntime *rt, JSGCCallback cb, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGCMarkingTracer(JSTracer *trc);\n\n/*\n * JS_IsAboutToBeFinalized checks if the given object is going to be finalized\n * at the end of the current GC. When called outside of the context of a GC,\n * this function will return false. Typically this function is used on weak\n * references, where the reference should be nulled out or destroyed if the\n * given object is about to be finalized.\n *\n * The argument to JS_IsAboutToBeFinalized is an in-out param: when the\n * function returns false, the object being referenced is still alive, but the\n * garbage collector might have moved it. In this case, the reference passed\n * to JS_IsAboutToBeFinalized will be updated to the object's new location.\n * Callers of this method are responsible for updating any state that is\n * dependent on the object's address. For example, if the object's address is\n * used as a key in a hashtable, then the object must be removed and\n * re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalized(JS::Heap<JSObject *> *objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalizedUnbarriered(JSObject **objp);\n\ntypedef enum JSGCParamKey {\n    /* Maximum nominal heap before last ditch GC. */\n    JSGC_MAX_BYTES          = 0,\n\n    /* Number of JS_malloc bytes before last ditch GC. */\n    JSGC_MAX_MALLOC_BYTES   = 1,\n\n    /* Amount of bytes allocated by the GC. */\n    JSGC_BYTES = 3,\n\n    /* Number of times when GC was invoked. */\n    JSGC_NUMBER = 4,\n\n    /* Max size of the code cache in bytes. */\n    JSGC_MAX_CODE_CACHE_BYTES = 5,\n\n    /* Select GC mode. */\n    JSGC_MODE = 6,\n\n    /* Number of cached empty GC chunks. */\n    JSGC_UNUSED_CHUNKS = 7,\n\n    /* Total number of allocated GC chunks. */\n    JSGC_TOTAL_CHUNKS = 8,\n\n    /* Max milliseconds to spend in an incremental GC slice. */\n    JSGC_SLICE_TIME_BUDGET = 9,\n\n    /* Maximum size the GC mark stack can grow to. */\n    JSGC_MARK_STACK_LIMIT = 10,\n\n    /*\n     * GCs less than this far apart in time will be considered 'high-frequency GCs'.\n     * See setGCLastBytes in jsgc.cpp.\n     */\n    JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11,\n\n    /* Start of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_LOW_LIMIT = 12,\n\n    /* End of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_HIGH_LIMIT = 13,\n\n    /* Upper bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX = 14,\n\n    /* Lower bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN = 15,\n\n    /* Heap growth for low frequency GCs. */\n    JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16,\n\n    /*\n     * If false, the heap growth factor is fixed at 3. If true, it is determined\n     * based on whether GCs are high- or low- frequency.\n     */\n    JSGC_DYNAMIC_HEAP_GROWTH = 17,\n\n    /* If true, high-frequency GCs will use a longer mark slice. */\n    JSGC_DYNAMIC_MARK_SLICE = 18,\n\n    /* Number of megabytes of analysis data to allocate before purging. */\n    JSGC_ANALYSIS_PURGE_TRIGGER = 19,\n\n    /* Lower limit after which we limit the heap growth. */\n    JSGC_ALLOCATION_THRESHOLD = 20,\n\n    /*\n     * We decommit memory lazily. If more than this number of megabytes is\n     * available to be decommitted, then JS_MaybeGC will trigger a shrinking GC\n     * to decommit it.\n     */\n    JSGC_DECOMMIT_THRESHOLD = 21\n} JSGCParamKey;\n\ntypedef enum JSGCMode {\n    /* Perform only global GCs. */\n    JSGC_MODE_GLOBAL = 0,\n\n    /* Perform per-compartment GCs until too much garbage has accumulated. */\n    JSGC_MODE_COMPARTMENT = 1,\n\n    /*\n     * Collect in short time slices rather than all at once. Implies\n     * JSGC_MODE_COMPARTMENT.\n     */\n    JSGC_MODE_INCREMENTAL = 2\n} JSGCMode;\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);\n\n/*\n * Create a new JSString whose chars member refers to external memory, i.e.,\n * memory requiring application-specific finalization.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewExternalString(JSContext *cx, const jschar *chars, size_t length,\n                     const JSStringFinalizer *fin);\n\n/*\n * Return whether 'str' was created with JS_NewExternalString or\n * JS_NewExternalStringWithClosure.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExternalString(JSString *str);\n\n/*\n * Return the 'closure' arg passed to JS_NewExternalStringWithClosure or NULL\n * if the external string was created via JS_NewExternalString.\n */\nextern JS_PUBLIC_API(const JSStringFinalizer *)\nJS_GetExternalStringFinalizer(JSString *str);\n\n/*\n * Set the size of the native stack that should not be exceed. To disable\n * stack size checking pass 0.\n */\nextern JS_PUBLIC_API(void)\nJS_SetNativeStackQuota(JSRuntime *cx, size_t stackSize);\n\n/************************************************************************/\n\n/*\n * Classes, objects, and properties.\n */\ntypedef void (*JSClassInternal)();\n\nstruct JSClass {\n    const char          *name;\n    uint32_t            flags;\n\n    /* Mandatory function pointer members. */\n    JSPropertyOp        addProperty;\n    JSDeletePropertyOp  delProperty;\n    JSPropertyOp        getProperty;\n    JSStrictPropertyOp  setProperty;\n    JSEnumerateOp       enumerate;\n    JSResolveOp         resolve;\n    JSConvertOp         convert;\n\n    /* Optional members (may be null). */\n    JSFinalizeOp        finalize;\n    JSCheckAccessOp     checkAccess;\n    JSNative            call;\n    JSHasInstanceOp     hasInstance;\n    JSNative            construct;\n    JSTraceOp           trace;\n\n    void                *reserved[40];\n};\n\n#define JSCLASS_HAS_PRIVATE             (1<<0)  /* objects have private slot */\n#define JSCLASS_NEW_ENUMERATE           (1<<1)  /* has JSNewEnumerateOp hook */\n#define JSCLASS_NEW_RESOLVE             (1<<2)  /* has JSNewResolveOp hook */\n#define JSCLASS_PRIVATE_IS_NSISUPPORTS  (1<<3)  /* private is (nsISupports *) */\n#define JSCLASS_IS_DOMJSCLASS           (1<<4)  /* objects are DOM */\n#define JSCLASS_IMPLEMENTS_BARRIERS     (1<<5)  /* Correctly implements GC read\n                                                   and write barriers */\n#define JSCLASS_EMULATES_UNDEFINED      (1<<6)  /* objects of this class act\n                                                   like the value undefined,\n                                                   in some contexts */\n#define JSCLASS_USERBIT1                (1<<7)  /* Reserved for embeddings. */\n\n/*\n * To reserve slots fetched and stored via JS_Get/SetReservedSlot, bitwise-or\n * JSCLASS_HAS_RESERVED_SLOTS(n) into the initializer for JSClass.flags, where\n * n is a constant in [1, 255].  Reserved slots are indexed from 0 to n-1.\n */\n#define JSCLASS_RESERVED_SLOTS_SHIFT    8       /* room for 8 flags below */\n#define JSCLASS_RESERVED_SLOTS_WIDTH    8       /* and 16 above this field */\n#define JSCLASS_RESERVED_SLOTS_MASK     JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)\n#define JSCLASS_HAS_RESERVED_SLOTS(n)   (((n) & JSCLASS_RESERVED_SLOTS_MASK)  \\\n                                         << JSCLASS_RESERVED_SLOTS_SHIFT)\n#define JSCLASS_RESERVED_SLOTS(clasp)   (((clasp)->flags                      \\\n                                          >> JSCLASS_RESERVED_SLOTS_SHIFT)    \\\n                                         & JSCLASS_RESERVED_SLOTS_MASK)\n\n#define JSCLASS_HIGH_FLAGS_SHIFT        (JSCLASS_RESERVED_SLOTS_SHIFT +       \\\n                                         JSCLASS_RESERVED_SLOTS_WIDTH)\n\n#define JSCLASS_IS_ANONYMOUS            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))\n#define JSCLASS_IS_GLOBAL               (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))\n#define JSCLASS_INTERNAL_FLAG2          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))\n#define JSCLASS_INTERNAL_FLAG3          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))\n\n/* Indicate whether the proto or ctor should be frozen. */\n#define JSCLASS_FREEZE_PROTO            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))\n#define JSCLASS_FREEZE_CTOR             (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))\n\n/* Reserved for embeddings. */\n#define JSCLASS_USERBIT2                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))\n#define JSCLASS_USERBIT3                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))\n\n#define JSCLASS_BACKGROUND_FINALIZE     (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))\n\n/*\n * Bits 26 through 31 are reserved for the CACHED_PROTO_KEY mechanism, see\n * below.\n */\n\n/* Global flags. */\n#define JSGLOBAL_FLAGS_CLEARED          0x1\n\n/*\n * ECMA-262 requires that most constructors used internally create objects\n * with \"the original Foo.prototype value\" as their [[Prototype]] (__proto__)\n * member initial value.  The \"original ... value\" verbiage is there because\n * in ECMA-262, global properties naming class objects are read/write and\n * deleteable, for the most part.\n *\n * Implementing this efficiently requires that global objects have classes\n * with the following flags. Failure to use JSCLASS_GLOBAL_FLAGS was\n * prevously allowed, but is now an ES5 violation and thus unsupported.\n */\n#define JSCLASS_GLOBAL_SLOT_COUNT      (JSProto_LIMIT * 3 + 25)\n#define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n)                                    \\\n    (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))\n#define JSCLASS_GLOBAL_FLAGS                                                  \\\n    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)\n#define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp)                              \\\n  (((clasp)->flags & JSCLASS_IS_GLOBAL)                                       \\\n   && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)\n\n/* Fast access to the original value of each standard class's prototype. */\n#define JSCLASS_CACHED_PROTO_SHIFT      (JSCLASS_HIGH_FLAGS_SHIFT + 10)\n#define JSCLASS_CACHED_PROTO_WIDTH      6\n#define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)\n#define JSCLASS_HAS_CACHED_PROTO(key)   (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)\n#define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey)                         \\\n                                         (((clasp)->flags                     \\\n                                           >> JSCLASS_CACHED_PROTO_SHIFT)     \\\n                                          & JSCLASS_CACHED_PROTO_MASK))\n\n/* Initializer for unused members of statically initialized JSClass structs. */\n#define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n#define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS\n\nextern JS_PUBLIC_API(int)\nJS_IdArrayLength(JSContext *cx, JSIdArray *ida);\n\nextern JS_PUBLIC_API(jsid)\nJS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyIdArray(JSContext *cx, JSIdArray *ida);\n\nnamespace JS {\n\nclass AutoIdArray : private AutoGCRooter\n{\n  public:\n    AutoIdArray(JSContext *cx, JSIdArray *ida\n                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, IDARRAY), context(cx), idArray(ida)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~AutoIdArray() {\n        if (idArray)\n            JS_DestroyIdArray(context, idArray);\n    }\n    bool operator!() {\n        return !idArray;\n    }\n    jsid operator[](size_t i) const {\n        JS_ASSERT(idArray);\n        JS_ASSERT(i < length());\n        return JS_IdArrayGet(context, idArray, i);\n    }\n    size_t length() const {\n        return JS_IdArrayLength(context, idArray);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n    JSIdArray *steal() {\n        JSIdArray *copy = idArray;\n        idArray = NULL;\n        return copy;\n    }\n\n  protected:\n    inline void trace(JSTracer *trc);\n\n  private:\n    JSContext *context;\n    JSIdArray *idArray;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* No copy or assignment semantics. */\n    AutoIdArray(AutoIdArray &ida) MOZ_DELETE;\n    void operator=(AutoIdArray &ida) MOZ_DELETE;\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToId(JSContext *cx, jsval v, jsid *idp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IdToValue(JSContext *cx, jsid id, jsval *vp);\n\n/*\n * JSNewResolveOp flag bits.\n */\n#define JSRESOLVE_ASSIGNING     0x01    /* resolve on the left of assignment */\n\n/*\n * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on\n * the specified object, computing a primitive default value for the object.\n * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On\n * success the resulting value is stored in *vp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictPropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                      JSBool *succeeded);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStub(JSContext *cx, JS::Handle<JSObject*> obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertStub(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n               JS::MutableHandle<JS::Value> vp);\n\nstruct JSConstDoubleSpec {\n    double          dval;\n    const char      *name;\n    uint8_t         flags;\n    uint8_t         spare[3];\n};\n\ntypedef struct JSJitInfo JSJitInfo;\n\n/*\n * Wrappers to replace {Strict,}PropertyOp for JSPropertySpecs. This will allow\n * us to pass one JSJitInfo per function with the property spec, without\n * additional field overhead.\n */\ntypedef struct JSStrictPropertyOpWrapper {\n    JSStrictPropertyOp  op;\n    const JSJitInfo     *info;\n} JSStrictPropertyOpWrapper;\n\ntypedef struct JSPropertyOpWrapper {\n    JSPropertyOp        op;\n    const JSJitInfo     *info;\n} JSPropertyOpWrapper;\n\n/*\n * Wrapper to do as above, but for JSNatives for JSFunctionSpecs.\n */\ntypedef struct JSNativeWrapper {\n    JSNative        op;\n    const JSJitInfo *info;\n} JSNativeWrapper;\n\n/*\n * Macro static initializers which make it easy to pass no JSJitInfo as part of a\n * JSPropertySpec or JSFunctionSpec.\n */\n#define JSOP_WRAPPER(op) {op, NULL}\n#define JSOP_NULLWRAPPER JSOP_WRAPPER(NULL)\n\n/*\n * To define an array element rather than a named property member, cast the\n * element's index to (const char *) and initialize name with it, and set the\n * JSPROP_INDEX bit in flags.\n */\nstruct JSPropertySpec {\n    const char                  *name;\n    int8_t                      tinyid;\n    uint8_t                     flags;\n    JSPropertyOpWrapper         getter;\n    JSStrictPropertyOpWrapper   setter;\n};\n\nnamespace JS {\nnamespace detail {\n\n/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_NATIVE_TO only. */\ninline int CheckIsNative(JSNative native);\n\n} // namespace detail\n} // namespace JS\n\n#define JS_CAST_NATIVE_TO(v, To) \\\n  (static_cast<void>(sizeof(JS::detail::CheckIsNative(v))), \\\n   reinterpret_cast<To>(v))\n\n/*\n * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function\n * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be\n * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform\n * type-safe casts.\n */\n#define JS_PSG(name, getter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_NULLWRAPPER}\n#define JS_PSGS(name, getter, setter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(setter, JSStrictPropertyOp))}\n#define JS_PS_END {0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\n/*\n * To define a native function, set call to a JSNativeWrapper. To define a\n * self-hosted function, set selfHostedName to the name of a function\n * compiled during JSRuntime::initSelfHosting.\n */\nstruct JSFunctionSpec {\n    const char      *name;\n    JSNativeWrapper call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *selfHostedName;\n};\n\n/*\n * Terminating sentinel initializer to put at the end of a JSFunctionSpec array\n * that's passed to JS_DefineFunctions or JS_InitClass.\n */\n#define JS_FS_END JS_FS(NULL,NULL,0,0)\n\n/*\n * Initializer macros for a JSFunctionSpec array element. JS_FN (whose name\n * pays homage to the old JSNative/JSFastNative split) simply adds the flag\n * JSFUN_STUB_GSOPS. JS_FNINFO allows the simple adding of JSJitInfos.\n */\n#define JS_FS(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, flags}\n#define JS_FN(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, (flags) | JSFUN_STUB_GSOPS}\n#define JS_FNINFO(name,call,info,nargs,flags)                                 \\\n    {name,{call,info},nargs,flags}\n\nextern JS_PUBLIC_API(JSObject *)\nJS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n             JSClass *clasp, JSNative constructor, unsigned nargs,\n             const JSPropertySpec *ps, const JSFunctionSpec *fs,\n             const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\n/*\n * Set up ctor.prototype = proto and proto.constructor = ctor with the\n * right property flags.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);\n\nextern JS_PUBLIC_API(JSClass *)\nJS_GetClass(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(void *)\nJS_GetPrivate(JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_SetPrivate(JSObject *obj, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp,\n                      jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> protop);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<JSObject*> proto);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParent(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetConstructor(JSContext *cx, JSObject *proto);\n\n/*\n * Get a unique identifier for obj, good for the lifetime of obj (even if it\n * is moved by a copying GC).  Return false on failure (likely out of memory),\n * and true with *idp containing the unique id on success.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);\n\nnamespace JS {\n\nenum {\n    FreshZone,\n    SystemZone,\n    SpecificZones\n};\n\ntypedef uintptr_t ZoneSpecifier;\n\ninline ZoneSpecifier\nSameZoneAs(JSObject *obj)\n{\n    JS_ASSERT(uintptr_t(obj) > SpecificZones);\n    return ZoneSpecifier(obj);\n}\n\nstruct JS_PUBLIC_API(CompartmentOptions) {\n    ZoneSpecifier zoneSpec;\n    JSVersion version;\n    bool invisibleToDebugger;\n\n    explicit CompartmentOptions() : zoneSpec(JS::FreshZone)\n                                  , version(JSVERSION_UNKNOWN)\n                                  , invisibleToDebugger(false)\n    {}\n\n    CompartmentOptions &setZone(ZoneSpecifier spec) { zoneSpec = spec; return *this; }\n    CompartmentOptions &setVersion(JSVersion version_) {\n        JS_ASSERT(version_ != JSVERSION_UNKNOWN);\n        version = version_;\n        return *this;\n    }\n\n    // Certain scopes (i.e. XBL compilation scopes) are implementation details\n    // of the embedding, and references to them should never leak out to script.\n    // This flag causes the this compartment to skip firing onNewGlobalObject\n    // and makes addDebuggee a no-op for this global.\n    CompartmentOptions &setInvisibleToDebugger(bool invisible) {\n        invisibleToDebugger = invisible;\n        return *this;\n    }\n};\n\n// During global creation, we fire notifications to callbacks registered\n// via the Debugger API. These callbacks are arbitrary script, and can touch\n// the global in arbitrary ways. When that happens, the global should not be\n// in a half-baked state. But this creates a problem for consumers that need\n// to set slots on the global to put it in a consistent state.\n//\n// This API provides a way for consumers to set slots atomically (immediately\n// after the global is created), before any debugger hooks are fired. It's\n// unfortunately on the clunky side, but that's the way the cookie crumbles.\n//\n// If callers have no additional state on the global to set up, they may pass\n// |FireOnNewGlobalHook| to JS_NewGlobalObject, which causes that function to\n// fire the hook as its final act before returning. Otherwise, callers should\n// pass |DontFireOnNewGlobalHook|, which means that they are responsible for\n// invoking JS_FireOnNewGlobalObject upon successfully creating the global. If\n// an error occurs and the operation aborts, callers should skip firing the\n// hook. But otherwise, callers must take care to fire the hook exactly once\n// before compiling any script in the global's scope (we have assertions in\n// place to enforce this). This lets us be sure that debugger clients never miss\n// breakpoints.\nenum OnNewGlobalHookOption {\n    FireOnNewGlobalHook,\n    DontFireOnNewGlobalHook\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals,\n                   JS::OnNewGlobalHookOption hookOption,\n                   const JS::CompartmentOptions &options = JS::CompartmentOptions());\n\nextern JS_PUBLIC_API(void)\nJS_FireOnNewGlobalObject(JSContext *cx, JS::HandleObject global);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\n/* Queries the [[Extensible]] property of the object. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExtensible(JSContext *cx, JS::HandleObject obj, JSBool *extensible);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNative(JSObject *obj);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetObjectRuntime(JSObject *obj);\n\n/*\n * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default\n * proto if proto's actual parameter value is null.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,\n                           JSObject *parent);\n\n/*\n * Freeze obj, and all objects it refers to, recursively. This will not recurse\n * through non-extensible objects, on the assumption that those are already\n * deep-frozen.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DeepFreezeObject(JSContext *cx, JSObject *obj);\n\n/*\n * Freezes an object; see ES5's Object.freeze(obj) method.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_FreezeObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PreventExtensions(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_New(JSContext *cx, JSObject *ctor, unsigned argc, jsval *argv);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp,\n                JSObject *proto, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineConstDoubles(JSContext *cx, JSObject *obj, const JSConstDoubleSpec *cds);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,\n                  JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,\n                      JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                   const char *name,\n                                   unsigned *attrsp, JSBool *foundp,\n                                   JSPropertyOp *getterp,\n                                   JSStrictPropertyOp *setterp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,\n                                       jsid id,\n                                       unsigned *attrsp, JSBool *foundp,\n                                       JSPropertyOp *getterp,\n                                       JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned attrs, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,\n                            int8_t tinyid, jsval value,\n                            JSPropertyOp getter, JSStrictPropertyOp setter,\n                            unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,\n                         JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id,\n                             JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name,\n                           unsigned flags, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,\n                               unsigned flags, JSObject **objp, JS::MutableHandle<JS::Value> vp);\n\nstruct JSPropertyDescriptor {\n    JSObject           *obj;\n    unsigned           attrs;\n    unsigned           shortid;\n    JSPropertyOp       getter;\n    JSStrictPropertyOp setter;\n    JS::Value          value;\n\n    JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL),\n                             setter(NULL), value(JSVAL_VOID)\n    {}\n\n    void trace(JSTracer *trc);\n};\n\nnamespace JS {\n\ntemplate <typename Outer>\nclass PropertyDescriptorOperations\n{\n    const JSPropertyDescriptor * desc() const { return static_cast<const Outer*>(this)->extract(); }\n    JSPropertyDescriptor * desc() { return static_cast<Outer*>(this)->extract(); }\n\n  public:\n    bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; }\n    bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; }\n    bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; }\n    bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; }\n    bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; }\n    bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; }\n    bool isShared() const { return desc()->attrs & JSPROP_SHARED; }\n    bool isIndex() const { return desc()->attrs & JSPROP_INDEX; }\n    bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; }\n    bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; }\n\n    JS::MutableHandleObject object() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); }\n    unsigned attributes() const { return desc()->attrs; }\n    unsigned shortid() const {\n        MOZ_ASSERT(hasShortId());\n        return desc()->shortid;\n    }\n    JSPropertyOp getter() const { return desc()->getter; }\n    JSStrictPropertyOp setter() const { return desc()->setter; }\n    JS::HandleObject getterObject() const {\n        MOZ_ASSERT(hasGetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->getter));\n    }\n    JS::HandleObject setterObject() const {\n        MOZ_ASSERT(hasSetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->setter));\n    }\n    JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); }\n\n    void setAttributes(unsigned attrs) { desc()->attrs = attrs; }\n    void setShortId(unsigned id) { desc()->shortid = id; }\n    void setGetter(JSPropertyOp op) { desc()->getter = op; }\n    void setSetter(JSStrictPropertyOp op) { desc()->setter = op; }\n    void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast<JSPropertyOp>(obj); }\n    void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast<JSStrictPropertyOp>(obj); }\n};\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <>\nstruct GCMethods<JSPropertyDescriptor> {\n    static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); }\n    static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; }\n    static bool poisoned(const JSPropertyDescriptor &desc) {\n        return (desc.obj && JS::IsPoisonedPtr(desc.obj)) ||\n               (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) ||\n               (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) ||\n               (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing()));\n    }\n};\n\ntemplate <>\nclass RootedBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\ntemplate <>\nclass HandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Handle<JSPropertyDescriptor>*>(this)->address();\n    }\n  public:\n    JS::HandleValue value() const { return JS::HandleValue::fromMarkedLocation(&extract()->value); }\n    JS::HandleObject obj() const { return JS::HandleObject::fromMarkedLocation(&extract()->obj); }\n};\n\ntemplate <>\nclass MutableHandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\n} /* namespace js */\n\n/*\n * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on\n * an object on the prototype chain (returned in objp). If data->obj is null,\n * then this property was not found on the prototype chain.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags,\n                             JSPropertyDescriptor *desc);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def,\n                          JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf,\n                        JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name,\n                   JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, jsval value,\n                    JSPropertyOp getter, JSStrictPropertyOp setter,\n                    unsigned attrs);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                     const jschar *name, size_t namelen,\n                                     unsigned *attrsp, JSBool *foundp,\n                                     JSPropertyOp *getterp,\n                                     JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned attrs, JSBool *foundp);\n\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,\n                              const jschar *name, size_t namelen,\n                              int8_t tinyid, jsval value,\n                              JSPropertyOp getter, JSStrictPropertyOp setter,\n                              unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,\n                           size_t namelen, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JSBool *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen,\n                    JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteUCProperty2(JSContext *cx, JSObject *obj,\n                     const jschar *name, size_t namelen,\n                     JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayObject(JSContext *cx, int length, jsval *vector);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsArrayObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,\n                 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp);\n\n/*\n * Get the property with name given by |index|, if it has one.  If\n * not, |*present| will be set to false and the value of |vp| must not\n * be relied on.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp, JSBool* present);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);\n\n/*\n * Remove all configurable properties from the given (non-global) object and\n * assign undefined to all writable data properties.\n */\nJS_PUBLIC_API(void)\nJS_ClearNonGlobalObject(JSContext *cx, JSObject *objArg);\n\n/*\n * Assign 'undefined' to all of the object's non-reserved slots. Note: this is\n * done for all slots, regardless of the associated property descriptor.\n */\nJS_PUBLIC_API(void)\nJS_SetAllNonReservedSlotsToUndefined(JSContext *cx, JSObject *objArg);\n\n/*\n * Create a new array buffer with the given contents, which must have been\n * returned by JS_AllocateArrayBufferContents or JS_StealArrayBufferContents.\n * The new array buffer takes ownership. After calling this function, do not\n * free |contents| or use |contents| from another thread.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayBufferWithContents(JSContext *cx, void *contents);\n\n/*\n * Steal the contents of the given array buffer. The array buffer has its\n * length set to 0 and its contents array cleared. The caller takes ownership\n * of |*contents| and must free it or transfer ownership via\n * JS_NewArrayBufferWithContents when done using it.\n * To free |*contents|, call free().\n * A pointer to the buffer's data is returned in |*data|. This pointer can\n * be used until |*contents| is freed or has its ownership transferred.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents,\n                            uint8_t **data);\n\n/*\n * Allocate memory that may be eventually passed to\n * JS_NewArrayBufferWithContents. |nbytes| is the number of payload bytes\n * required. The pointer to pass to JS_NewArrayBufferWithContents is returned\n * in |contents|. The pointer to the |nbytes| of usable memory is returned in\n * |data|. (*|contents| will contain a header before |data|.) The only legal\n * operations on *|contents| is to free it, or pass it to\n * JS_NewArrayBufferWithContents or JS_ReallocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\n/*\n * Reallocate memory allocated by JS_AllocateArrayBufferContents, growing or shrinking it\n * as appropriate.  The new data pointer will be returned in data.  If *contents is NULL,\n * behaves like JS_AllocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\nextern JS_PUBLIC_API(JSIdArray *)\nJS_Enumerate(JSContext *cx, JSObject *obj);\n\n/*\n * Create an object to iterate over enumerable properties of obj, in arbitrary\n * property definition order.  NB: This differs from longstanding for..in loop\n * order, which uses order of property definition in obj.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewPropertyIterator(JSContext *cx, JSObject *obj);\n\n/*\n * Return true on success with *idp containing the id of the next enumerable\n * property to visit using iterobj, or JSID_IS_VOID if there is no such property\n * left to visit.  Return false on error.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);\n\n/*\n * A JSNative that creates and returns a new iterator that iterates over the\n * elements of |this|, up to |this.length|, in index order. This can be used to\n * make any array-like object iterable. Just give the object an obj.iterator()\n * method using this JSNative as the implementation.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,\n               jsval *vp, unsigned *attrsp);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetReservedSlot(JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(void)\nJS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v);\n\n/************************************************************************/\n\n/*\n * Security protocol.\n */\nstruct JSPrincipals {\n    /* Don't call \"destroy\"; use reference counting macros below. */\n    int refcount;\n\n#ifdef DEBUG\n    /* A helper to facilitate principals debugging. */\n    uint32_t    debugToken;\n#endif\n\n    void setDebugToken(uint32_t token) {\n# ifdef DEBUG\n        debugToken = token;\n# endif\n    }\n\n    /*\n     * This is not defined by the JS engine but should be provided by the\n     * embedding.\n     */\n    JS_PUBLIC_API(void) dump();\n};\n\nextern JS_PUBLIC_API(void)\nJS_HoldPrincipals(JSPrincipals *principals);\n\nextern JS_PUBLIC_API(void)\nJS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);\n\nstruct JSSecurityCallbacks {\n    JSCheckAccessOp            checkObjectAccess;\n    JSCSPEvalChecker           contentSecurityPolicyAllows;\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetSecurityCallbacks(JSRuntime *rt, const JSSecurityCallbacks *callbacks);\n\nextern JS_PUBLIC_API(const JSSecurityCallbacks *)\nJS_GetSecurityCallbacks(JSRuntime *rt);\n\n/*\n * Code running with \"trusted\" principals will be given a deeper stack\n * allocation than ordinary scripts. This allows trusted script to run after\n * untrusted script has exhausted the stack. This function sets the\n * runtime-wide trusted principal.\n *\n * This principals is not held (via JS_HoldPrincipals/JS_DropPrincipals) since\n * there is no available JSContext. Instead, the caller must ensure that the\n * given principals stays valid for as long as 'rt' may point to it. If the\n * principals would be destroyed before 'rt', JS_SetTrustedPrincipals must be\n * called again, passing NULL for 'prin'.\n */\nextern JS_PUBLIC_API(void)\nJS_SetTrustedPrincipals(JSRuntime *rt, JSPrincipals *prin);\n\n/*\n * Initialize the callback that is called to destroy JSPrincipals instance\n * when its reference counter drops to zero. The initialization can be done\n * only once per JS runtime.\n */\nextern JS_PUBLIC_API(void)\nJS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPrincipals);\n\n/************************************************************************/\n\n/*\n * Functions and scripts.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n               JSObject *parent, const char *name);\n\n/*\n * Create the function with the name given by the id. JSID_IS_STRING(id) must\n * be true.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                   JSObject *parent, jsid id);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionObject(JSFunction *fun);\n\n/*\n * Return the function's identifier as a JSString, or null if fun is unnamed.\n * The returned string lives as long as fun, so you don't need to root a saved\n * reference to it if fun is well-connected or rooted, and provided you bound\n * the use of the saved reference by fun's lifetime.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionId(JSFunction *fun);\n\n/*\n * Return a function's display name. This is the defined name if one was given\n * where the function was defined, or it could be an inferred name by the JS\n * engine in the case that the function was defined to be anonymous. This can\n * still return NULL if a useful display name could not be inferred. The same\n * restrictions on rooting as those in JS_GetFunctionId apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionDisplayId(JSFunction *fun);\n\n/*\n * Return the arity (length) of fun.\n */\nextern JS_PUBLIC_API(uint16_t)\nJS_GetFunctionArity(JSFunction *fun);\n\n/*\n * Infallible predicate to test whether obj is a function object (faster than\n * comparing obj's class name to \"Function\", but equivalent unless someone has\n * overwritten the \"Function\" identifier with a different constructor and then\n * created instances using that constructor that might be passed in as obj).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsFunction(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsCallable(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNativeFunction(JSObject *funobj, JSNative call);\n\n/* Return whether the given function is a valid constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsConstructor(JSFunction *fun);\n\n/*\n * Bind the given callable to use the given object as \"this\".\n *\n * If |callable| is not callable, will throw and return NULL.\n */\nextern JS_PUBLIC_API(JSObject*)\nJS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                  unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineUCFunction(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, JSNative call,\n                    unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,\n                      unsigned nargs, unsigned attrs);\n\n/*\n * Clone a top-level function into a new scope. This function will dynamically\n * fail if funobj was lexically nested inside some other function.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);\n\n/*\n * Given a buffer, return JS_FALSE if the buffer might become a valid\n * javascript statement with the addition of more lines.  Otherwise return\n * JS_TRUE.  The intent is to support interactive compilation - accumulate\n * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to\n * the compiler.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScript(JSContext *cx, JSObject *obj,\n                 const char *ascii, size_t length,\n                 const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,\n                              JSPrincipals *principals,\n                              const char *ascii, size_t length,\n                              const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScript(JSContext *cx, JSObject *obj,\n                   const jschar *chars, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals,\n                                const jschar *chars, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalFromScript(JSScript *script);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,\n                   unsigned nargs, const char **argnames,\n                   const char *bytes, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals, const char *name,\n                                unsigned nargs, const char **argnames,\n                                const char *bytes, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileUCFunction(JSContext *cx, JSObject *obj, const char *name,\n                     unsigned nargs, const char **argnames,\n                     const jschar *chars, size_t length,\n                     const char *filename, unsigned lineno);\n\nnamespace JS {\n\n/* Options for JavaScript compilation. */\nclass JS_PUBLIC_API(CompileOptions)\n{\n    JSPrincipals *principals_;\n    JSPrincipals *originPrincipals_;\n\n  public:\n    JSPrincipals *principals() const { return principals_; }\n    JSPrincipals *originPrincipals() const;\n\n    JSVersion version;\n    bool versionSet;\n    bool utf8;\n    const char *filename;\n    unsigned lineno;\n    unsigned column;\n    HandleObject element;\n    bool compileAndGo;\n    bool forEval;\n    bool noScriptRval;\n    bool selfHostingMode;\n    bool canLazilyParse;\n    bool strictOption;\n    bool extraWarningsOption;\n    bool werrorOption;\n    bool asmJSOption;\n    enum SourcePolicy {\n        NO_SOURCE,\n        LAZY_SOURCE,\n        SAVE_SOURCE\n    } sourcePolicy;\n\n    explicit CompileOptions(JSContext *cx, JSVersion version = JSVERSION_UNKNOWN);\n    CompileOptions &setPrincipals(JSPrincipals *p) { principals_ = p; return *this; }\n    CompileOptions &setOriginPrincipals(JSPrincipals *p) { originPrincipals_ = p; return *this; }\n    CompileOptions &setVersion(JSVersion v) { version = v; versionSet = true; return *this; }\n    CompileOptions &setUTF8(bool u) { utf8 = u; return *this; }\n    CompileOptions &setFileAndLine(const char *f, unsigned l) {\n        filename = f; lineno = l; return *this;\n    }\n    CompileOptions &setColumn(unsigned c) { column = c; return *this; }\n    CompileOptions &setElement(HandleObject e) { element = e; return *this; }\n    CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }\n    CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }\n    CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }\n    CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }\n    CompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }\n    CompileOptions &setSourcePolicy(SourcePolicy sp) { sourcePolicy = sp; return *this; }\n};\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, FILE *file);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, const char *filename);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const jschar *chars, size_t length);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * API extension: OR this into indent to avoid pretty-printing the decompiled\n * source resulting from JS_DecompileFunction{,Body}.\n */\n#define JS_DONT_PRETTY_PRINT    ((unsigned)0x8000)\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);\n\n/*\n * NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj\n * parameter as the initial scope chain header, the 'this' keyword value, and\n * the variables object (ECMA parlance for where 'var' and 'function' bind\n * names) of the execution context for script.\n *\n * Using obj as the variables object is problematic if obj's parent (which is\n * the scope chain link; see JS_SetParent and JS_NewObject) is not null: in\n * this case, variables created by 'var x = 0', e.g., go in obj, but variables\n * created by assignment to an unbound id, 'x = 0', go in the last object on\n * the scope chain linked by parent.\n *\n * ECMA calls that last scoping object the \"global object\", but note that many\n * embeddings have several such objects.  ECMA requires that \"global code\" be\n * executed with the variables object equal to this global object.  But these\n * JS API entry points provide freedom to execute code against a \"sub-global\",\n * i.e., a parented or scoped object, in which case the variables object will\n * differ from the last object on the scope chain, resulting in confusing and\n * non-ECMA explicit vs. implicit variable creation.\n *\n * Caveat embedders: unless you already depend on this buggy variables object\n * binding behavior, you should call JS_SetOptions(cx, JSOPTION_VAROBJFIX) or\n * JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_VAROBJFIX) -- the latter if\n * someone may have set other options on cx already -- for each context in the\n * application, if you pass parented objects as the obj parameter, or may ever\n * pass such objects in the future.\n *\n * Why a runtime option?  The alternative is to add six or so new API entry\n * points with signatures matching the following six, and that doesn't seem\n * worth the code bloat cost.  Such new entry points would probably have less\n * obvious names, too, so would not tend to be used.  The JS_SetOption call,\n * OTOH, can be more easily hacked into existing code that does not depend on\n * the bug; such code can continue to use the familiar JS_EvaluateScript,\n * etc., entry points.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,\n                        JSVersion version);\n\n/*\n * Execute either the function-defining prolog of a script, or the script's\n * main body, but not both.\n */\ntypedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart;\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScript(JSContext *cx, JSObject *obj,\n                  const char *bytes, unsigned length,\n                  const char *filename, unsigned lineno,\n                  jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,\n                               JSPrincipals *principals,\n                               const char *bytes, unsigned length,\n                               const char *filename, unsigned lineno,\n                               jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                      JSPrincipals *principals,\n                                      const char *bytes, unsigned length,\n                                      const char *filename, unsigned lineno,\n                                      jsval *rval, JSVersion version);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScript(JSContext *cx, JSObject *obj,\n                    const jschar *chars, unsigned length,\n                    const char *filename, unsigned lineno,\n                    jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                 JSPrincipals *principals,\n                                 const jschar *chars, unsigned length,\n                                 const char *filename, unsigned lineno,\n                                 jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                        JSPrincipals *principals,\n                                        const jschar *chars, unsigned length,\n                                        const char *filename, unsigned lineno,\n                                        jsval *rval, JSVersion version);\n\n/*\n * JSAPI clients may optionally specify the 'originPrincipals' of a script.\n * A script's originPrincipals may be retrieved through the debug API (via\n * JS_GetScriptOriginPrincipals) and the originPrincipals are transitively\n * assigned to any nested scripts (including scripts dynamically created via\n * eval and the Function constructor). If originPrincipals is null, then the\n * value of principals is used as origin principals for the script.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,\n                                              JSPrincipals *principals,\n                                              JSPrincipals *originPrincipals,\n                                              const jschar *chars, unsigned length,\n                                              const char *filename, unsigned lineno,\n                                              jsval *rval, JSVersion version);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const jschar *chars, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *bytes, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *filename, jsval *rval);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc,\n                jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc,\n                    jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc,\n                     jsval *argv, jsval *rval);\n\nnamespace JS {\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, JSFunction *fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunction(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, const char *name, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionName(cx, thisObj, name, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, jsval fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionValue(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nextern JS_PUBLIC_API(bool)\nCall(JSContext *cx, jsval thisv, jsval fun, unsigned argc, jsval *argv, MutableHandle<Value> rval);\n\nstatic inline bool\nCall(JSContext *cx, jsval thisv, JSObject *funObj, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return Call(cx, thisv, OBJECT_TO_JSVAL(funObj), argc, argv, rval);\n}\n\n} /* namespace JS */\n\n/*\n * These functions allow setting an operation callback that will be called\n * from the JS thread some time after any thread triggered the callback using\n * JS_TriggerOperationCallback(rt).\n *\n * To schedule the GC and for other activities the engine internally triggers\n * operation callbacks. The embedding should thus not rely on callbacks being\n * triggered through the external API only.\n *\n * Important note: Additional callbacks can occur inside the callback handler\n * if it re-enters the JS engine. The embedding must ensure that the callback\n * is disconnected before attempting such re-entry.\n */\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_SetOperationCallback(JSContext *cx, JSOperationCallback callback);\n\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_GetOperationCallback(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_TriggerOperationCallback(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsRunning(JSContext *cx);\n\n/*\n * Saving and restoring frame chains.\n *\n * These two functions are used to set aside cx's call stack while that stack\n * is inactive. After a call to JS_SaveFrameChain, it looks as if there is no\n * code running on cx. Before calling JS_RestoreFrameChain, cx's call stack\n * must be balanced and all nested calls to JS_SaveFrameChain must have had\n * matching JS_RestoreFrameChain calls.\n *\n * JS_SaveFrameChain deals with cx not having any code running on it.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SaveFrameChain(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreFrameChain(JSContext *cx);\n\n#ifdef MOZ_TRACE_JSCALLS\n/*\n * The callback is expected to be quick and noninvasive. It should not\n * trigger interrupts, turn on debugging, or produce uncaught JS\n * exceptions. The state of the stack and registers in the context\n * cannot be relied upon, since this callback may be invoked directly\n * from either JIT. The 'entering' field means we are entering a\n * function if it is positive, leaving a function if it is zero or\n * negative.\n */\nextern JS_PUBLIC_API(void)\nJS_SetFunctionCallback(JSContext *cx, JSFunctionCallback fcb);\n\nextern JS_PUBLIC_API(JSFunctionCallback)\nJS_GetFunctionCallback(JSContext *cx);\n#endif /* MOZ_TRACE_JSCALLS */\n\n/************************************************************************/\n\n/*\n * Strings.\n *\n * NB: JS_NewUCString takes ownership of bytes on success, avoiding a copy;\n * but on error (signified by null return), it leaves chars owned by the\n * caller. So the caller must free bytes in the error case, if it has no use\n * for them. In contrast, all the JS_New*StringCopy* functions do not take\n * ownership of the character memory passed to them -- they copy it.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyN(JSContext *cx, const char *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyZ(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternJSString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternStringN(JSContext *cx, const char *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternString(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCString(JSContext *cx, jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyN(JSContext *cx, const jschar *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyZ(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCString(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FileEscapedString(FILE *fp, JSString *str, char quote);\n\n/*\n * Extracting string characters and length.\n *\n * While getting the length of a string is infallible, getting the chars can\n * fail. As indicated by the lack of a JSContext parameter, there are two\n * special cases where getting the chars is infallible:\n *\n * The first case is interned strings, i.e., strings from JS_InternString or\n * JSID_TO_STRING(id), using JS_GetInternedStringChars*.\n *\n * The second case is \"flat\" strings that have been explicitly prepared in a\n * fallible context by JS_FlattenString. To catch errors, a separate opaque\n * JSFlatString type is returned by JS_FlattenString and expected by\n * JS_GetFlatStringChars. Note, though, that this is purely a syntactic\n * distinction: the input and output of JS_FlattenString are the same actual\n * GC-thing so only one needs to be rooted. If a JSString is known to be flat,\n * JS_ASSERT_STRING_IS_FLAT can be used to make a debug-checked cast. Example:\n *\n *   // in a fallible context\n *   JSFlatString *fstr = JS_FlattenString(cx, str);\n *   if (!fstr)\n *     return JS_FALSE;\n *   JS_ASSERT(fstr == JS_ASSERT_STRING_IS_FLAT(str));\n *\n *   // in an infallible context, for the same 'str'\n *   const jschar *chars = JS_GetFlatStringChars(fstr)\n *   JS_ASSERT(chars);\n *\n * The CharsZ APIs guarantee that the returned array has a null character at\n * chars[length]. This can require additional copying so clients should prefer\n * APIs without CharsZ if possible. The infallible functions also return\n * null-terminated arrays. (There is no additional cost or non-Z alternative\n * for the infallible functions, so 'Z' is left out of the identifier.)\n */\n\nextern JS_PUBLIC_API(size_t)\nJS_GetStringLength(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringChars(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringCharsAndLength(JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZ(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(JSFlatString *)\nJS_FlattenString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetFlatStringChars(JSFlatString *str);\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJSID_TO_FLAT_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSFlatString *)(JSID_BITS(id));\n}\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJS_ASSERT_STRING_IS_FLAT(JSString *str)\n{\n    JS_ASSERT(JS_GetFlatStringChars((JSFlatString *)str));\n    return (JSFlatString *)str;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJS_FORGET_STRING_FLATNESS(JSFlatString *fstr)\n{\n    return (JSString *)fstr;\n}\n\n/*\n * Additional APIs that avoid fallibility when given a flat string.\n */\n\nextern JS_PUBLIC_API(JSBool)\nJS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedFlatString(char *buffer, size_t size, JSFlatString *str, char quote);\n\n/*\n * This function is now obsolete and behaves the same as JS_NewUCString.  Use\n * JS_NewUCString instead.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewGrowableString(JSContext *cx, jschar *chars, size_t length);\n\n/*\n * Create a dependent string, i.e., a string that owns no character storage,\n * but that refers to a slice of another string's chars.  Dependent strings\n * are mutable by definition, so the thread safety comments above apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewDependentString(JSContext *cx, JSString *str, size_t start,\n                      size_t length);\n\n/*\n * Concatenate two strings, possibly resulting in a rope.\n * See above for thread safety comments.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_ConcatStrings(JSContext *cx, JSString *left, JSString *right);\n\n/*\n * For JS_DecodeBytes, set *dstlenp to the size of the destination buffer before\n * the call; on return, *dstlenp contains the number of jschars actually stored.\n * To determine the necessary destination buffer size, make a sizing call that\n * passes NULL for dst.\n *\n * On errors, the functions report the error. In that case, *dstlenp contains\n * the number of characters or bytes transferred so far.  If cx is NULL, no\n * error is reported on failure, and the functions simply return JS_FALSE.\n *\n * NB: This function does not store an additional zero byte or jschar after the\n * transcoded string.\n */\nJS_PUBLIC_API(JSBool)\nJS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst,\n               size_t *dstlenp);\n\n/*\n * A variation on JS_EncodeCharacters where a null terminated string is\n * returned that you are expected to call JS_free on when done.\n */\nJS_PUBLIC_API(char *)\nJS_EncodeString(JSContext *cx, JSString *str);\n\n/*\n * Same behavior as JS_EncodeString(), but encode into UTF-8 string\n */\nJS_PUBLIC_API(char *)\nJS_EncodeStringToUTF8(JSContext *cx, JSString *str);\n\n/*\n * Get number of bytes in the string encoding (without accounting for a\n * terminating zero bytes. The function returns (size_t) -1 if the string\n * can not be encoded into bytes and reports an error using cx accordingly.\n */\nJS_PUBLIC_API(size_t)\nJS_GetStringEncodingLength(JSContext *cx, JSString *str);\n\n/*\n * Encode string into a buffer. The function does not stores an additional\n * zero byte. The function returns (size_t) -1 if the string can not be\n * encoded into bytes with no error reported. Otherwise it returns the number\n * of bytes that are necessary to encode the string. If that exceeds the\n * length parameter, the string will be cut and only length bytes will be\n * written into the buffer.\n */\nJS_PUBLIC_API(size_t)\nJS_EncodeStringToBuffer(JSContext *cx, JSString *str, char *buffer, size_t length);\n\nclass JSAutoByteString\n{\n  public:\n    JSAutoByteString(JSContext *cx, JSString *str\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mBytes(JS_EncodeString(cx, str))\n    {\n        JS_ASSERT(cx);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    JSAutoByteString(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : mBytes(NULL)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoByteString() {\n        js_free(mBytes);\n    }\n\n    /* Take ownership of the given byte array. */\n    void initBytes(char *bytes) {\n        JS_ASSERT(!mBytes);\n        mBytes = bytes;\n    }\n\n    char *encodeLatin1(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeString(cx, str);\n        return mBytes;\n    }\n\n    char *encodeLatin1(js::ContextFriendFields *cx, JSString *str);\n\n    char *encodeUtf8(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeStringToUTF8(cx, str);\n        return mBytes;\n    }\n\n    void clear() {\n        js_free(mBytes);\n        mBytes = NULL;\n    }\n\n    char *ptr() const {\n        return mBytes;\n    }\n\n    bool operator!() const {\n        return !mBytes;\n    }\n\n    size_t length() const {\n        if (!mBytes)\n            return 0;\n        return strlen(mBytes);\n    }\n\n  private:\n    char        *mBytes;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* Copy and assignment are not supported. */\n    JSAutoByteString(const JSAutoByteString &another);\n    JSAutoByteString &operator=(const JSAutoByteString &another);\n};\n\n/************************************************************************/\n/*\n * JSON functions\n */\ntypedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);\n\n/*\n * JSON.stringify as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,\n             JSONWriteCallback callback, void *data);\n\n/*\n * JSON.parse as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle<JS::Value> vp);\n\nJS_PUBLIC_API(JSBool)\nJS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,\n                        jsval *vp);\n\n/************************************************************************/\n\n/* API for the HTML5 internal structured cloning algorithm. */\n\n/* The maximum supported structured-clone serialization format version. */\n#define JS_STRUCTURED_CLONE_VERSION 2\n\nstruct JSStructuredCloneCallbacks {\n    ReadStructuredCloneOp read;\n    WriteStructuredCloneOp write;\n    StructuredCloneErrorOp reportError;\n};\n\n/* Note: if the *data contains transferable objects, it can be read\n * only once */\nJS_PUBLIC_API(JSBool)\nJS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes,\n                       uint32_t version, jsval *vp,\n                       const JSStructuredCloneCallbacks *optionalCallbacks,\n                       void *closure);\n\n/* Note: On success, the caller is responsible for calling\n * JS_ClearStructuredClone(*datap, nbytesp). */\nJS_PUBLIC_API(JSBool)\nJS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,\n                        const JSStructuredCloneCallbacks *optionalCallbacks,\n                        void *closure, jsval transferable);\n\nJS_PUBLIC_API(JSBool)\nJS_ClearStructuredClone(const uint64_t *data, size_t nbytes);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes,\n                                   JSBool *hasTransferable);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredClone(JSContext *cx, jsval v, jsval *vp,\n                   const JSStructuredCloneCallbacks *optionalCallbacks,\n                   void *closure);\n\n/* RAII sugar for JS_WriteStructuredClone. */\nclass JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {\n    uint64_t *data_;\n    size_t nbytes_;\n    uint32_t version_;\n\n  public:\n    JSAutoStructuredCloneBuffer()\n        : data_(NULL), nbytes_(0), version_(JS_STRUCTURED_CLONE_VERSION) {}\n\n    ~JSAutoStructuredCloneBuffer() { clear(); }\n\n    uint64_t *data() const { return data_; }\n    size_t nbytes() const { return nbytes_; }\n\n    void clear();\n\n    /* Copy some memory. It will be automatically freed by the destructor. */\n    bool copy(const uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Adopt some memory. It will be automatically freed by the destructor.\n     * data must have been allocated by the JS engine (e.g., extracted via\n     * JSAutoStructuredCloneBuffer::steal).\n     */\n    void adopt(uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Remove the buffer so that it will not be automatically freed.\n     * After this, the caller is responsible for feeding the memory back to\n     * JSAutoStructuredCloneBuffer::adopt.\n     */\n    void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=NULL);\n\n    bool read(JSContext *cx, jsval *vp,\n              const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n              void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               jsval transferable,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    /**\n     * Swap ownership with another JSAutoStructuredCloneBuffer.\n     */\n    void swap(JSAutoStructuredCloneBuffer &other);\n\n  private:\n    /* Copy and assignment are not supported. */\n    JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other);\n    JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other);\n};\n\n/* API for implementing custom serialization behavior (for ImageData, File, etc.) */\n\n/* The range of tag values the application may use for its own custom object types. */\n#define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)\n#define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)\n\n#define JS_SCERR_RECURSION 0\n#define JS_SCERR_TRANSFERABLE 1\n\nJS_PUBLIC_API(void)\nJS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);\n\n/************************************************************************/\n\n/*\n * The default locale for the ECMAScript Internationalization API\n * (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).\n * Note that the Internationalization API encourages clients to\n * specify their own locales.\n * The locale string remains owned by the caller.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetDefaultLocale(JSRuntime *rt, const char *locale);\n\n/*\n * Reset the default locale to OS defaults.\n */\nextern JS_PUBLIC_API(void)\nJS_ResetDefaultLocale(JSRuntime *rt);\n\n/*\n * Locale specific string conversion and error message callbacks.\n */\nstruct JSLocaleCallbacks {\n    JSLocaleToUpperCase     localeToUpperCase;\n    JSLocaleToLowerCase     localeToLowerCase;\n    JSLocaleCompare         localeCompare; // not used #if ENABLE_INTL_API\n    JSLocaleToUnicode       localeToUnicode;\n    JSErrorCallback         localeGetErrorMessage;\n};\n\n/*\n * Establish locale callbacks. The pointer must persist as long as the\n * JSRuntime.  Passing NULL restores the default behaviour.\n */\nextern JS_PUBLIC_API(void)\nJS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks);\n\n/*\n * Return the address of the current locale callbacks struct, which may\n * be NULL.\n */\nextern JS_PUBLIC_API(JSLocaleCallbacks *)\nJS_GetLocaleCallbacks(JSRuntime *rt);\n\n/************************************************************************/\n\n/*\n * Error reporting.\n */\n\n/*\n * Report an exception represented by the sprintf-like conversion of format\n * and its arguments.  This exception message string is passed to a pre-set\n * JSErrorReporter function (set by JS_SetErrorReporter).\n */\nextern JS_PUBLIC_API(void)\nJS_ReportError(JSContext *cx, const char *format, ...);\n\n/*\n * Use an errorNumber to retrieve the format string, args are char *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,\n                       void *userRef, const unsigned errorNumber, va_list ap);\n#endif\n\n/*\n * Use an errorNumber to retrieve the format string, args are jschar *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUC(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback,\n                            void *userRef, const unsigned errorNumber,\n                            const jschar **args);\n\n/*\n * As above, but report a warning instead (JSREPORT_IS_WARNING(report.flags)).\n * Return true if there was no error trying to issue the warning, and if the\n * warning was not converted into an error due to the JSOPTION_WERROR option\n * being set, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReportWarning(JSContext *cx, const char *format, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags,\n                             JSErrorCallback errorCallback, void *userRef,\n                             const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags,\n                               JSErrorCallback errorCallback, void *userRef,\n                               const unsigned errorNumber, ...);\n\n/*\n * Complain when out of memory.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportOutOfMemory(JSContext *cx);\n\n/*\n * Complain when an allocation size overflows the maximum supported limit.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportAllocationOverflow(JSContext *cx);\n\nstruct JSErrorReport {\n    const char      *filename;      /* source file name, URL, etc., or null */\n    JSPrincipals    *originPrincipals; /* see 'originPrincipals' comment above */\n    unsigned        lineno;         /* source line number */\n    const char      *linebuf;       /* offending source line without final \\n */\n    const char      *tokenptr;      /* pointer to error token in linebuf */\n    const jschar    *uclinebuf;     /* unicode (original) line buffer */\n    const jschar    *uctokenptr;    /* unicode (original) token pointer */\n    unsigned        flags;          /* error/warning, etc. */\n    unsigned        errorNumber;    /* the error number, e.g. see js.msg */\n    const jschar    *ucmessage;     /* the (default) error message */\n    const jschar    **messageArgs;  /* arguments for the error message */\n    int16_t         exnType;        /* One of the JSExnType constants */\n    unsigned        column;         /* zero-based column index in line */\n};\n\n/*\n * JSErrorReport flag values.  These may be freely composed.\n */\n#define JSREPORT_ERROR      0x0     /* pseudo-flag for default case */\n#define JSREPORT_WARNING    0x1     /* reported via JS_ReportWarning */\n#define JSREPORT_EXCEPTION  0x2     /* exception was thrown */\n#define JSREPORT_STRICT     0x4     /* error or warning due to strict option */\n\n/*\n * This condition is an error in strict mode code, a warning if\n * JS_HAS_STRICT_OPTION(cx), and otherwise should not be reported at\n * all.  We check the strictness of the context's top frame's script;\n * where that isn't appropriate, the caller should do the right checks\n * itself instead of using this flag.\n */\n#define JSREPORT_STRICT_MODE_ERROR 0x8\n\n/*\n * If JSREPORT_EXCEPTION is set, then a JavaScript-catchable exception\n * has been thrown for this runtime error, and the host should ignore it.\n * Exception-aware hosts should also check for JS_IsExceptionPending if\n * JS_ExecuteScript returns failure, and signal or propagate the exception, as\n * appropriate.\n */\n#define JSREPORT_IS_WARNING(flags)      (((flags) & JSREPORT_WARNING) != 0)\n#define JSREPORT_IS_EXCEPTION(flags)    (((flags) & JSREPORT_EXCEPTION) != 0)\n#define JSREPORT_IS_STRICT(flags)       (((flags) & JSREPORT_STRICT) != 0)\n#define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) &                      \\\n                                              JSREPORT_STRICT_MODE_ERROR) != 0)\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_GetErrorReporter(JSContext *cx);\n\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_SetErrorReporter(JSContext *cx, JSErrorReporter er);\n\n/************************************************************************/\n\n/*\n * Dates.\n */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObjectMsec(JSContext *cx, double msec);\n\n/*\n * Infallible predicate to test whether obj is a date object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsDate(JSContext *cx, JSObject *obj);\n\n/*\n * Clears the cache of calculated local time from each Date object.\n * Call to propagate a system timezone change.\n */\nextern JS_PUBLIC_API(void)\nJS_ClearDateCaches(JSContext *cx);\n\n/************************************************************************/\n\n/*\n * Regular Expressions.\n */\n#define JSREG_FOLD      0x01    /* fold uppercase to lowercase */\n#define JSREG_GLOB      0x02    /* global exec, creates array of matches */\n#define JSREG_MULTILINE 0x04    /* treat ^ and $ as begin and end of line */\n#define JSREG_STICKY    0x08    /* only match starting at lastIndex */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObject(JSContext *cx, JSObject *obj, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(void)\nJS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRegExpStatics(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length,\n                 size_t *indexp, JSBool test, jsval *rval);\n\n/* RegExp interface for clients without a global object. */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length,\n                          size_t *indexp, JSBool test, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsRegExp(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetRegExpFlags(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetRegExpSource(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsExceptionPending(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPendingException(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_SetPendingException(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(void)\nJS_ClearPendingException(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportPendingException(JSContext *cx);\n\n/*\n * Save the current exception state.  This takes a snapshot of cx's current\n * exception state without making any change to that state.\n *\n * The returned state pointer MUST be passed later to JS_RestoreExceptionState\n * (to restore that saved state, overriding any more recent state) or else to\n * JS_DropExceptionState (to free the state struct in case it is not correct\n * or desirable to restore it).  Both Restore and Drop free the state struct,\n * so callers must stop using the pointer returned from Save after calling the\n * Release or Drop API.\n */\nextern JS_PUBLIC_API(JSExceptionState *)\nJS_SaveExceptionState(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreExceptionState(JSContext *cx, JSExceptionState *state);\n\nextern JS_PUBLIC_API(void)\nJS_DropExceptionState(JSContext *cx, JSExceptionState *state);\n\n/*\n * If the given value is an exception object that originated from an error,\n * the exception will contain an error report struct, and this API will return\n * the address of that struct.  Otherwise, it returns NULL.  The lifetime of\n * the error report struct that might be returned is the same as the lifetime\n * of the exception object.\n */\nextern JS_PUBLIC_API(JSErrorReport *)\nJS_ErrorFromException(JSContext *cx, jsval v);\n\n/*\n * Given a reported error's message and JSErrorReport struct pointer, throw\n * the corresponding exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowReportedError(JSContext *cx, const char *message,\n                      JSErrorReport *reportp);\n\n/*\n * Throws a StopIteration exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowStopIteration(JSContext *cx);\n\nextern JS_PUBLIC_API(intptr_t)\nJS_GetCurrentThread();\n\n/*\n * A JS runtime always has an \"owner thread\". The owner thread is set when the\n * runtime is created (to the current thread) and practically all entry points\n * into the JS engine check that a runtime (or anything contained in the\n * runtime: context, compartment, object, etc) is only touched by its owner\n * thread. Embeddings may check this invariant outside the JS engine by calling\n * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for\n * non-debug builds).\n *\n * It is possible to \"move\" a runtime between threads. This is accomplished by\n * calling JS_ClearRuntimeThread on a runtime's owner thread and then calling\n * JS_SetRuntimeThread on the new owner thread. The runtime must not be\n * accessed between JS_ClearRuntimeThread and JS_SetRuntimeThread. Also, the\n * caller is responsible for synchronizing the calls to Set/Clear.\n */\n\nextern JS_PUBLIC_API(void)\nJS_AbortIfWrongThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRuntimeThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeThread(JSRuntime *rt);\n\nclass JSAutoSetRuntimeThread\n{\n    JSRuntime *runtime_;\n\n  public:\n    JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime_(runtime) {\n        JS_SetRuntimeThread(runtime_);\n    }\n\n    ~JSAutoSetRuntimeThread() {\n        JS_ClearRuntimeThread(runtime_);\n    }\n};\n\n/************************************************************************/\n\n/*\n * JS_IsConstructing must be called from within a native given the\n * native's original cx and vp arguments. If JS_IsConstructing is true,\n * JS_THIS must not be used; the constructor should construct and return a\n * new object. Otherwise, the native is called as an ordinary function and\n * JS_THIS may be used.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJS_IsConstructing(JSContext *cx, const jsval *vp)\n{\n#ifdef DEBUG\n    JSObject *callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n    if (JS_ObjectIsFunction(cx, callee)) {\n        JSFunction *fun = JS_ValueToFunction(cx, JS_CALLEE(cx, vp));\n        JS_ASSERT(JS_IsConstructor(fun));\n    } else {\n        JS_ASSERT(JS_GetClass(callee)->construct != NULL);\n    }\n#else\n    (void)cx;\n#endif\n\n    return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));\n}\n\n/*\n * A constructor can request that the JS engine create a default new 'this'\n * object of the given class, using the callee to determine parentage and\n * [[Prototype]].\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp);\n\n/************************************************************************/\n\n#ifdef JS_GC_ZEAL\n#define JS_DEFAULT_ZEAL_FREQ 100\n\nextern JS_PUBLIC_API(void)\nJS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency);\n\nextern JS_PUBLIC_API(void)\nJS_ScheduleGC(JSContext *cx, uint32_t count);\n#endif\n\nextern JS_PUBLIC_API(void)\nJS_SetParallelCompilationEnabled(JSContext *cx, bool enabled);\n\ntypedef enum JSCompilerOption {\n    JSCOMPILER_BASELINE_USECOUNT_TRIGGER,\n    JSCOMPILER_ION_USECOUNT_TRIGGER,\n    JSCOMPILER_PJS_ENABLE\n} JSCompilerOption;\n\nextern JS_PUBLIC_API(void)\nJS_SetGlobalCompilerOption(JSContext *cx, JSCompilerOption opt, uint32_t value);\n\n/*\n * Convert a uint32_t index into a jsid.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IndexToId(JSContext *cx, uint32_t index, jsid *id);\n\n/*\n * Convert chars into a jsid.\n *\n * |chars| may not be an index.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp);\n\n/*\n *  Test if the given string is a valid ECMAScript identifier\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);\n\n/*\n * Return the current script and line number of the most currently running\n * frame. Returns true if a scripted frame was found, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno);\n\n\n/*\n * Encode/Decode interpreted scripts and functions to/from memory.\n */\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeScript(JSContext *cx, JSScript *script, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeInterpretedFunction(JSContext *cx, JSObject *funobj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_DecodeScript(JSContext *cx, const void *data, uint32_t length,\n                JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,\n                             JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\nextern JS_PUBLIC_DATA(const HandleId) JSID_VOIDHANDLE;\nextern JS_PUBLIC_DATA(const HandleId) JSID_EMPTYHANDLE;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Import some JS:: names into the js namespace so we can make unqualified\n * references to them.\n */\n\nusing JS::Value;\nusing JS::IsPoisonedValue;\nusing JS::NullValue;\nusing JS::UndefinedValue;\nusing JS::Int32Value;\nusing JS::DoubleValue;\nusing JS::StringValue;\nusing JS::BooleanValue;\nusing JS::ObjectValue;\nusing JS::MagicValue;\nusing JS::NumberValue;\nusing JS::ObjectOrNullValue;\nusing JS::PrivateValue;\nusing JS::PrivateUint32Value;\n\nusing JS::IsPoisonedPtr;\nusing JS::IsPoisonedId;\n\nusing JS::StableCharPtr;\nusing JS::TwoByteChars;\nusing JS::Latin1CharsZ;\n\nusing JS::AutoIdVector;\nusing JS::AutoValueVector;\nusing JS::AutoObjectVector;\nusing JS::AutoFunctionVector;\nusing JS::AutoScriptVector;\nusing JS::AutoIdArray;\n\nusing JS::AutoGCRooter;\nusing JS::AutoArrayRooter;\nusing JS::AutoVectorRooter;\nusing JS::AutoHashMapRooter;\nusing JS::AutoHashSetRooter;\n\nusing JS::CallArgs;\nusing JS::IsAcceptableThis;\nusing JS::NativeImpl;\nusing JS::CallReceiver;\nusing JS::CompileOptions;\nusing JS::CallNonGenericMethod;\n\nusing JS::Rooted;\nusing JS::RootedObject;\nusing JS::RootedModule;\nusing JS::RootedFunction;\nusing JS::RootedScript;\nusing JS::RootedString;\nusing JS::RootedId;\nusing JS::RootedValue;\n\nusing JS::Handle;\nusing JS::HandleObject;\nusing JS::HandleModule;\nusing JS::HandleFunction;\nusing JS::HandleScript;\nusing JS::HandleString;\nusing JS::HandleId;\nusing JS::HandleValue;\n\nusing JS::MutableHandle;\nusing JS::MutableHandleObject;\nusing JS::MutableHandleFunction;\nusing JS::MutableHandleScript;\nusing JS::MutableHandleString;\nusing JS::MutableHandleId;\nusing JS::MutableHandleValue;\n\nusing JS::Zone;\n\n} /* namespace js */\n\n#endif /* jsapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsclass.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclass_h\n#define jsclass_h\n/*\n * A JSClass acts as a vtable for JS objects that allows JSAPI clients to\n * control various aspects of the behavior of an object like property lookup.\n * js::Class is an engine-private extension that allows more control over\n * object behavior and, e.g., allows custom slow layout.\n */\n\n#include \"jsapi.h\"\n#include \"jsprvtd.h\"\n\nnamespace js {\n\nclass PropertyName;\nclass SpecialId;\nclass PropertyId;\n\n// This is equal to JSFunction::class_.  Use it in places where you don't want\n// to #include jsfun.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionClassPtr;\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid);\n\n/*\n * We partition the ways to refer to a property into three: by an index\n * (uint32_t); by a string whose characters do not represent an index\n * (PropertyName, see vm/String.h); and by various special values.\n *\n * Special values are encoded using SpecialId, which is layout-compatible but\n * non-interconvertible with jsid.  A SpecialId is used for JSID_VOID, which\n * does not occur in JS scripts but may be used to indicate the absence of a\n * valid identifier.  In the future, a SpecialId may also be an object used by\n * Harmony-proposed private names.\n */\nclass SpecialId\n{\n    uintptr_t bits_;\n\n    /* Needs access to raw bits. */\n    friend JS_ALWAYS_INLINE jsid SPECIALID_TO_JSID(const SpecialId &sid);\n    friend class PropertyId;\n\n    static const uintptr_t TYPE_VOID = JSID_TYPE_VOID;\n    static const uintptr_t TYPE_OBJECT = JSID_TYPE_OBJECT;\n    static const uintptr_t TYPE_MASK = JSID_TYPE_MASK;\n\n    SpecialId(uintptr_t bits) : bits_(bits) { }\n\n  public:\n    SpecialId() : bits_(TYPE_VOID) { }\n\n    /* Object-valued */\n\n    SpecialId(JSObject &obj)\n      : bits_(uintptr_t(&obj) | TYPE_OBJECT)\n    {\n        JS_ASSERT(&obj != NULL);\n        JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);\n    }\n\n    bool isObject() const {\n        return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT;\n    }\n\n    JSObject *toObject() const {\n        JS_ASSERT(isObject());\n        return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);\n    }\n\n    /* Empty */\n\n    static SpecialId empty() {\n        SpecialId sid(TYPE_OBJECT);\n        JS_ASSERT(sid.isEmpty());\n        return sid;\n    }\n\n    bool isEmpty() const {\n        return bits_ == TYPE_OBJECT;\n    }\n\n    /* Void */\n\n    static SpecialId voidId() {\n        SpecialId sid(TYPE_VOID);\n        JS_ASSERT(sid.isVoid());\n        return sid;\n    }\n\n    bool isVoid() const {\n        return bits_ == TYPE_VOID;\n    }\n};\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid)\n{\n    jsid id;\n    JSID_BITS(id) = sid.bits_;\n    JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());\n    JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));\n    JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE bool\nJSID_IS_SPECIAL(jsid id)\n{\n    return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id);\n}\n\nstatic JS_ALWAYS_INLINE SpecialId\nJSID_TO_SPECIALID(jsid id)\n{\n    JS_ASSERT(JSID_IS_SPECIAL(id));\n    if (JSID_IS_OBJECT(id))\n        return SpecialId(*JSID_TO_OBJECT(id));\n    if (JSID_IS_EMPTY(id))\n        return SpecialId::empty();\n    JS_ASSERT(JSID_IS_VOID(id));\n    return SpecialId::voidId();\n}\n\ntypedef JS::Handle<SpecialId> HandleSpecialId;\n\n/* js::Class operation signatures. */\n\ntypedef JSBool\n(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name,\n                 MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value,\n                 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);\ntypedef JSBool\n(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present);\ntypedef JSBool\n(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);\ntypedef JSBool\n(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);\ntypedef JSBool\n(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);\ntypedef JSBool\n(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);\ntypedef JSBool\n(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);\ntypedef JSBool\n(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded);\ntypedef JSBool\n(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded);\ntypedef JSBool\n(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded);\n\n\ntypedef JSObject *\n(* ObjectOp)(JSContext *cx, HandleObject obj);\ntypedef void\n(* FinalizeOp)(FreeOp *fop, JSObject *obj);\n\n#define JS_CLASS_MEMBERS                                                      \\\n    const char          *name;                                                \\\n    uint32_t            flags;                                                \\\n                                                                              \\\n    /* Mandatory function pointer members. */                                 \\\n    JSPropertyOp        addProperty;                                          \\\n    JSDeletePropertyOp  delProperty;                                          \\\n    JSPropertyOp        getProperty;                                          \\\n    JSStrictPropertyOp  setProperty;                                          \\\n    JSEnumerateOp       enumerate;                                            \\\n    JSResolveOp         resolve;                                              \\\n    JSConvertOp         convert;                                              \\\n                                                                              \\\n    /* Optional members (may be null). */                                     \\\n    FinalizeOp          finalize;                                             \\\n    JSCheckAccessOp     checkAccess;                                          \\\n    JSNative            call;                                                 \\\n    JSHasInstanceOp     hasInstance;                                          \\\n    JSNative            construct;                                            \\\n    JSTraceOp           trace\n\n/*\n * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much\n * we have to pad js::Class to match the size of JSClass.\n */\nstruct ClassSizeMeasurement\n{\n    JS_CLASS_MEMBERS;\n};\n\nstruct ClassExtension\n{\n    JSObjectOp          outerObject;\n    JSObjectOp          innerObject;\n    JSIteratorOp        iteratorObject;\n\n    /*\n     * isWrappedNative is true only if the class is an XPCWrappedNative.\n     * WeakMaps use this to override the wrapper disposal optimization.\n     */\n    bool                isWrappedNative;\n\n    /*\n     * If an object is used as a key in a weakmap, it may be desirable for the\n     * garbage collector to keep that object around longer than it otherwise\n     * would. A common case is when the key is a wrapper around an object in\n     * another compartment, and we want to avoid collecting the wrapper (and\n     * removing the weakmap entry) as long as the wrapped object is alive. In\n     * that case, the wrapped object is returned by the wrapper's\n     * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap\n     * key, it will not be collected (and remain in the weakmap) until the\n     * wrapped object is collected.\n     */\n    JSWeakmapKeyDelegateOp weakmapKeyDelegateOp;\n};\n\n#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,false,NULL}\n\nstruct ObjectOps\n{\n    LookupGenericOp     lookupGeneric;\n    LookupPropOp        lookupProperty;\n    LookupElementOp     lookupElement;\n    LookupSpecialOp     lookupSpecial;\n    DefineGenericOp     defineGeneric;\n    DefinePropOp        defineProperty;\n    DefineElementOp     defineElement;\n    DefineSpecialOp     defineSpecial;\n    GenericIdOp         getGeneric;\n    PropertyIdOp        getProperty;\n    ElementIdOp         getElement;\n    ElementIfPresentOp  getElementIfPresent; /* can be null */\n    SpecialIdOp         getSpecial;\n    StrictGenericIdOp   setGeneric;\n    StrictPropertyIdOp  setProperty;\n    StrictElementIdOp   setElement;\n    StrictSpecialIdOp   setSpecial;\n    GenericAttributesOp getGenericAttributes;\n    PropertyAttributesOp getPropertyAttributes;\n    ElementAttributesOp getElementAttributes;\n    SpecialAttributesOp getSpecialAttributes;\n    GenericAttributesOp setGenericAttributes;\n    PropertyAttributesOp setPropertyAttributes;\n    ElementAttributesOp setElementAttributes;\n    SpecialAttributesOp setSpecialAttributes;\n    DeletePropertyOp    deleteProperty;\n    DeleteElementOp     deleteElement;\n    DeleteSpecialOp     deleteSpecial;\n\n    JSNewEnumerateOp    enumerate;\n    ObjectOp            thisObject;\n};\n\n#define JS_NULL_OBJECT_OPS                                                    \\\n    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \\\n     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,        \\\n     NULL,NULL,NULL}\n\nstruct Class\n{\n    JS_CLASS_MEMBERS;\n    ClassExtension      ext;\n    ObjectOps           ops;\n    uint8_t             pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -\n                            sizeof(ClassExtension) - sizeof(ObjectOps)];\n\n    /* Class is not native and its map is not a scope. */\n    static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;\n\n    bool isNative() const {\n        return !(flags & NON_NATIVE);\n    }\n\n    bool hasPrivate() const {\n        return !!(flags & JSCLASS_HAS_PRIVATE);\n    }\n\n    bool emulatesUndefined() const {\n        return flags & JSCLASS_EMULATES_UNDEFINED;\n    }\n\n    bool isCallable() const {\n        return this == js::FunctionClassPtr || call;\n    }\n\n    static size_t offsetOfFlags() { return offsetof(Class, flags); }\n};\n\nJS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));\nJS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));\nJS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));\nJS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));\nJS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));\nJS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));\nJS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));\nJS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));\nJS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));\nJS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));\nJS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));\nJS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));\n\nstatic JS_ALWAYS_INLINE JSClass *\nJsvalify(Class *c)\n{\n    return (JSClass *)c;\n}\nstatic JS_ALWAYS_INLINE const JSClass *\nJsvalify(const Class *c)\n{\n    return (const JSClass *)c;\n}\n\nstatic JS_ALWAYS_INLINE Class *\nValueify(JSClass *c)\n{\n    return (Class *)c;\n}\nstatic JS_ALWAYS_INLINE const Class *\nValueify(const JSClass *c)\n{\n    return (const Class *)c;\n}\n\n/*\n * Enumeration describing possible values of the [[Class]] internal property\n * value of objects.\n */\nenum ESClassValue {\n    ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean,\n    ESClass_RegExp, ESClass_ArrayBuffer, ESClass_Date\n};\n\n/*\n * Return whether the given object has the given [[Class]] internal property\n * value. Beware, this query says nothing about the js::Class of the JSObject\n * so the caller must not assume anything about obj's representation (e.g., obj\n * may be a proxy).\n */\ninline bool\nObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx);\n\n/* Just a helper that checks v.isObject before calling ObjectClassIs. */\ninline bool\nIsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx);\n\ninline bool\nIsPoisonedSpecialId(js::SpecialId iden)\n{\n    if (iden.isObject())\n        return IsPoisonedPtr(iden.toObject());\n    return false;\n}\n\ntemplate <> struct GCMethods<SpecialId>\n{\n    static SpecialId initial() { return SpecialId(); }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(SpecialId id) { return IsPoisonedSpecialId(id); }\n};\n\n}  /* namespace js */\n\n#endif  /* jsclass_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsclist.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclist_h\n#define jsclist_h\n\n#include \"jstypes.h\"\n\n/*\n** Circular linked list\n*/\ntypedef struct JSCListStr {\n    struct JSCListStr *next;\n    struct JSCListStr *prev;\n} JSCList;\n\n/*\n** Insert element \"_e\" into the list, before \"_l\".\n*/\n#define JS_INSERT_BEFORE(_e,_l)  \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l);       \\\n        (_e)->prev = (_l)->prev; \\\n        (_l)->prev->next = (_e); \\\n        (_l)->prev = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Insert element \"_e\" into the list, after \"_l\".\n*/\n#define JS_INSERT_AFTER(_e,_l)   \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l)->next; \\\n        (_e)->prev = (_l);       \\\n        (_l)->next->prev = (_e); \\\n        (_l)->next = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Return the element following element \"_e\"\n*/\n#define JS_NEXT_LINK(_e)         \\\n        ((_e)->next)\n/*\n** Return the element preceding element \"_e\"\n*/\n#define JS_PREV_LINK(_e)         \\\n        ((_e)->prev)\n\n/*\n** Append an element \"_e\" to the end of the list \"_l\"\n*/\n#define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l)\n\n/*\n** Insert an element \"_e\" at the head of the list \"_l\"\n*/\n#define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l)\n\n/* Return the head/tail of the list */\n#define JS_LIST_HEAD(_l) (_l)->next\n#define JS_LIST_TAIL(_l) (_l)->prev\n\n/*\n** Remove the element \"_e\" from it's circular list.\n*/\n#define JS_REMOVE_LINK(_e)             \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n    JS_END_MACRO\n\n/*\n** Remove the element \"_e\" from it's circular list. Also initializes the\n** linkage.\n*/\n#define JS_REMOVE_AND_INIT_LINK(_e)    \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n        (_e)->next = (_e);             \\\n        (_e)->prev = (_e);             \\\n    JS_END_MACRO\n\n/*\n** Return non-zero if the given circular list \"_l\" is empty, zero if the\n** circular list is not empty\n*/\n#define JS_CLIST_IS_EMPTY(_l) \\\n    ((_l)->next == (_l))\n\n/*\n** Initialize a circular list\n*/\n#define JS_INIT_CLIST(_l)  \\\n    JS_BEGIN_MACRO         \\\n        (_l)->next = (_l); \\\n        (_l)->prev = (_l); \\\n    JS_END_MACRO\n\n#define JS_INIT_STATIC_CLIST(_l) \\\n    {(_l), (_l)}\n\n#endif /* jsclist_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jscpucfg.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jscpucfg_h\n#define jscpucfg_h\n\n#define JS_HAVE_LONG_LONG\n\n#if defined(_WIN64)\n\n# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n#  define JS_BYTES_PER_WORD   8\n#  define JS_BITS_PER_WORD_LOG2   6\n# else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n#  error \"CPU type is unknown\"\n# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n\n#elif defined(_WIN32) || defined(XP_OS2)\n\n# ifdef __WATCOMC__\n#  define HAVE_VA_LIST_AS_ARRAY 1\n# endif\n\n# define IS_LITTLE_ENDIAN 1\n# undef  IS_BIG_ENDIAN\n# define JS_BYTES_PER_WORD   4\n# define JS_BITS_PER_WORD_LOG2   5\n\n#elif defined(__APPLE__)\n# if __LITTLE_ENDIAN__\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n# elif __BIG_ENDIAN__\n#  undef  IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# endif\n\n#elif defined(JS_HAVE_ENDIAN_H)\n# include <endian.h>\n\n# if defined(__BYTE_ORDER)\n#  if __BYTE_ORDER == __LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif __BYTE_ORDER == __BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(__BYTE_ORDER) */\n#  error \"endian.h does not define __BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n/* BSDs */\n#elif defined(JS_HAVE_MACHINE_ENDIAN_H)\n# include <sys/types.h>\n# include <machine/endian.h>\n\n# if defined(_BYTE_ORDER)\n#  if _BYTE_ORDER == _LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif _BYTE_ORDER == _BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(_BYTE_ORDER) */\n#  error \"machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n#elif defined(JS_HAVE_SYS_ISA_DEFS_H)\n# include <sys/isa_defs.h>\n\n# if defined(_BIG_ENDIAN)\n#  undef IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# elif defined(_LITTLE_ENDIAN)\n#  define IS_LITTLE_ENDIAN 1\n#  undef IS_BIG_ENDIAN\n# else /* !defined(_LITTLE_ENDIAN) */\n#  error \"sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness.\"\n# endif\n# if !defined(JS_STACK_GROWTH_DIRECTION)\n#  if defined(_STACK_GROWS_UPWARD)\n#   define JS_STACK_GROWTH_DIRECTION (1)\n#  elif defined(_STACK_GROWS_DOWNWARD)\n#   define JS_STACK_GROWTH_DIRECTION (-1)\n#  endif\n# endif\n\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(_BIG_ENDIAN)\n/* IA64 running HP-UX will have _BIG_ENDIAN defined.\n * IA64 running Linux will have endian.h and be handled above.\n */\n# undef IS_LITTLE_ENDIAN\n# define IS_BIG_ENDIAN 1\n\n#else /* !defined(__sparc) && !defined(__sparc__) && ... */\n# error \"Cannot determine endianness of your platform. Please add support to jscpucfg.h.\"\n#endif\n\n#ifndef JS_STACK_GROWTH_DIRECTION\n# ifdef __hppa\n#  define JS_STACK_GROWTH_DIRECTION (1)\n# else\n#  define JS_STACK_GROWTH_DIRECTION (-1)\n# endif\n#endif\n\n#endif /* jscpucfg_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsdbgapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsdbgapi_h\n#define jsdbgapi_h\n/*\n * JS debugger API.\n */\n\n#include \"jsprvtd.h\"\n\nnamespace JS {\n\nstruct FrameDescription\n{\n    JSScript *script;\n    unsigned lineno;\n    JSFunction *fun;\n};\n\nstruct StackDescription\n{\n    unsigned nframes;\n    FrameDescription *frames;\n};\n\nextern JS_PUBLIC_API(StackDescription *)\nDescribeStack(JSContext *cx, unsigned maxFrames);\n\nextern JS_PUBLIC_API(void)\nFreeStackDescription(JSContext *cx, StackDescription *desc);\n\nextern JS_PUBLIC_API(char *)\nFormatStackDump(JSContext *cx, char *buf,\n                    JSBool showArgs, JSBool showLocals,\n                    JSBool showThisProps);\n\n}\n\n# ifdef DEBUG\nJS_FRIEND_API(void) js_DumpValue(const js::Value &val);\nJS_FRIEND_API(void) js_DumpId(jsid id);\nJS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);\n# endif\n\nJS_FRIEND_API(void)\njs_DumpBacktrace(JSContext *cx);\n\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * Currently, we only support runtime-wide debugging. In the future, we should\n * be able to support compartment-wide debugging.\n */\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);\n\n/*\n * Debug mode is a compartment-wide mode that enables a debugger to attach\n * to and interact with running methodjit-ed frames. In particular, it causes\n * every function to be compiled as if an eval was present (so eval-in-frame)\n * can work, and it ensures that functions can be re-JITed for other debug\n * features. In general, it is not safe to interact with frames that were live\n * before debug mode was enabled. For this reason, it is also not safe to\n * enable debug mode while frames are live.\n */\n\n/* Get current state of debugging mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_GetDebugMode(JSContext *cx);\n\n/*\n * Turn on/off debugging mode for all compartments. This returns false if any code\n * from any of the runtime's compartments is running or on the stack.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a single compartment. This should only be\n * used when no code from this compartment is running or on the stack in any\n * thread.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a context's compartment.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugMode(JSContext *cx, JSBool debug);\n\n/* Turn on single step mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);\n\n/* The closure argument will be marked. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n           JSTrapHandler handler, jsval closure);\n\nextern JS_PUBLIC_API(void)\nJS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n             JSTrapHandler *handlerp, jsval *closurep);\n\nextern JS_PUBLIC_API(void)\nJS_ClearScriptTraps(JSRuntime *rt, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_ClearAllTrapsForCompartment(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                 JSWatchPointHandler handler, JSObject *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                   JSWatchPointHandler *handlerp, JSObject **closurep);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearAllWatchPoints(JSContext *cx);\n\n/************************************************************************/\n\n// Raw JSScript* because this needs to be callable from a signal handler.\nextern JS_PUBLIC_API(unsigned)\nJS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_EndPC(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetLinePCs(JSContext *cx, JSScript *script,\n              unsigned startLine, unsigned maxLines,\n              unsigned* count, unsigned** lines, jsbytecode*** pcs);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);\n\n/*\n * N.B. The mark is in the context temp pool and thus the caller must take care\n * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other\n * call that may use the temp pool.\n */\nextern JS_PUBLIC_API(uintptr_t *)\nJS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);\n\nextern JS_PUBLIC_API(JSAtom *)\nJS_LocalNameToAtom(uintptr_t w);\n\nextern JS_PUBLIC_API(JSString *)\nJS_AtomKey(JSAtom *atom);\n\nextern JS_PUBLIC_API(void)\nJS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_GetFunctionScript(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSNative)\nJS_GetFunctionNative(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptPrincipals(JSScript *script);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptOriginPrincipals(JSScript *script);\n\nJS_PUBLIC_API(JSFunction *)\nJS_GetScriptFunction(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\n/*\n * This is almost JS_GetClass(obj)->name except that certain debug-only\n * proxies are made transparent. In particular, this function turns the class\n * of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject)\n * from \"Proxy\" to \"Call\", \"Block\", \"With\" etc.\n */\nextern JS_PUBLIC_API(const char *)\nJS_GetDebugClassName(JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const char *)\nJS_GetScriptFilename(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetScriptSourceMap(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptLineExtent(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetScriptVersion(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(bool)\nJS_GetScriptIsSelfHosted(JSScript *script);\n\n/************************************************************************/\n\n/*\n * Hook setters for script creation and destruction, see jsprvtd.h for the\n * typedefs.  These macros provide binary compatibility and newer, shorter\n * synonyms.\n */\n#define JS_SetNewScriptHook     JS_SetNewScriptHookProc\n#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc\n\nextern JS_PUBLIC_API(void)\nJS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,\n                        void *callerdata);\n\n/************************************************************************/\n\ntypedef struct JSPropertyDesc {\n    jsval           id;         /* primary id, atomized string, or int */\n    jsval           value;      /* property value */\n    uint8_t         flags;      /* flags, see below */\n    uint8_t         spare;      /* unused */\n    jsval           alias;      /* alias id if JSPD_ALIAS flag */\n} JSPropertyDesc;\n\n#define JSPD_ENUMERATE  0x01    /* visible to for/in loop */\n#define JSPD_READONLY   0x02    /* assignment is error */\n#define JSPD_PERMANENT  0x04    /* property cannot be deleted */\n#define JSPD_ALIAS      0x08    /* property has an alias id */\n#define JSPD_EXCEPTION  0x40    /* exception occurred fetching the property, */\n                                /* value is exception */\n#define JSPD_ERROR      0x80    /* native getter returned JS_FALSE without */\n                                /* throwing an exception */\n\ntypedef struct JSPropertyDescArray {\n    uint32_t        length;     /* number of elements in array */\n    JSPropertyDesc  *array;     /* alloc'd by Get, freed by Put */\n} JSPropertyDescArray;\n\ntypedef struct JSScopeProperty JSScopeProperty;\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);\n\nextern JS_PUBLIC_API(void)\nJS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);\n\n/************************************************************************/\n\n/*\n * JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a\n * StackFrame or baseline JIT frame.\n */\nclass JS_PUBLIC_API(JSAbstractFramePtr)\n{\n    uintptr_t ptr_;\n\n  protected:\n    JSAbstractFramePtr()\n      : ptr_(0)\n    { }\n\n  public:\n    explicit JSAbstractFramePtr(void *raw);\n\n    uintptr_t raw() const { return ptr_; }\n\n    operator bool() const { return !!ptr_; }\n\n    JSObject *scopeChain(JSContext *cx);\n    JSObject *callObject(JSContext *cx);\n\n    JSFunction *maybeFun();\n    JSScript *script();\n\n    bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv);\n\n    bool isDebuggerFrame();\n\n    bool evaluateInStackFrame(JSContext *cx,\n                              const char *bytes, unsigned length,\n                              const char *filename, unsigned lineno,\n                              JS::MutableHandleValue rval);\n\n    bool evaluateUCInStackFrame(JSContext *cx,\n                                const jschar *chars, unsigned length,\n                                const char *filename, unsigned lineno,\n                                JS::MutableHandleValue rval);\n};\n\nclass JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr\n{\n  public:\n    JSNullFramePtr()\n      : JSAbstractFramePtr()\n    {}\n};\n\n/*\n * This class does not work when IonMonkey is active. It's only used by jsd,\n * which can only be used when IonMonkey is disabled.\n *\n * To find the calling script and line number, use JS_DescribeSciptedCaller.\n * To summarize the call stack, use JS::DescribeStack.\n */\nclass JS_PUBLIC_API(JSBrokenFrameIterator)\n{\n    void *data_;\n\n  public:\n    JSBrokenFrameIterator(JSContext *cx);\n    ~JSBrokenFrameIterator();\n\n    bool done() const;\n    JSBrokenFrameIterator& operator++();\n\n    JSAbstractFramePtr abstractFramePtr() const;\n    jsbytecode *pc() const;\n\n    bool isConstructing() const;\n};\n\n/*\n * This hook captures high level script execution and function calls (JS or\n * native).  It is used by JS_SetExecuteHook to hook top level scripts and by\n * JS_SetCallHook to hook function calls.  It will get called twice per script\n * or function call: just before execution begins and just after it finishes.\n * In both cases the 'current' frame is that of the executing code.\n *\n * The 'before' param is JS_TRUE for the hook invocation before the execution\n * and JS_FALSE for the invocation after the code has run.\n *\n * The 'ok' param is significant only on the post execution invocation to\n * signify whether or not the code completed 'normally'.\n *\n * The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook\n * for the 'before'invocation, but is whatever value is returned from that\n * invocation for the 'after' invocation. Thus, the hook implementor *could*\n * allocate a structure in the 'before' invocation and return a pointer to that\n * structure. The pointer would then be handed to the hook for the 'after'\n * invocation. Alternately, the 'before' could just return the same value as\n * in 'closure' to cause the 'after' invocation to be called with the same\n * 'closure' value as the 'before'.\n *\n * Returning NULL in the 'before' hook will cause the 'after' hook *not* to\n * be called.\n */\ntypedef void *\n(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,\n                      JSBool before, JSBool *ok, void *closure);\n\ntypedef JSBool\n(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,\n                     void *closure);\n\ntypedef struct JSDebugHooks {\n    JSInterruptHook     interruptHook;\n    void                *interruptHookData;\n    JSNewScriptHook     newScriptHook;\n    void                *newScriptHookData;\n    JSDestroyScriptHook destroyScriptHook;\n    void                *destroyScriptHookData;\n    JSDebuggerHandler   debuggerHandler;\n    void                *debuggerHandlerData;\n    JSSourceHandler     sourceHandler;\n    void                *sourceHandlerData;\n    JSInterpreterHook   executeHook;\n    void                *executeHookData;\n    JSInterpreterHook   callHook;\n    void                *callHookData;\n    JSThrowHook         throwHook;\n    void                *throwHookData;\n    JSDebugErrorHook    debugErrorHook;\n    void                *debugErrorHookData;\n} JSDebugHooks;\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const JSDebugHooks *)\nJS_GetGlobalDebugHooks(JSRuntime *rt);\n\n/**\n * Add various profiling-related functions as properties of the given object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);\n\n/* Defined in vm/Debugger.cpp. */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineDebuggerObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_DumpBytecode(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentBytecode(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DumpPCCounts(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentPCCounts(JSContext *cx);\n\n/* Call the context debug handler on the topmost scripted frame. */\nextern JS_FRIEND_API(JSBool)\njs_CallContextDebugHandler(JSContext *cx);\n\n#endif /* jsdbgapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsfriendapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsfriendapi_h\n#define jsfriendapi_h\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include \"jsclass.h\"\n#include \"jsprvtd.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n\n/*\n * This macro checks if the stack pointer has exceeded a given limit. If\n * |tolerance| is non-zero, it returns true only if the stack pointer has\n * exceeded the limit by more than |tolerance| bytes.\n */\n#if JS_STACK_GROWTH_DIRECTION > 0\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) < (limit)+(tolerance))\n#else\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) > (limit)-(tolerance))\n#endif\n\n#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)\n\nnamespace JS {\ntemplate <class T>\nclass Heap;\n} /* namespace JS */\n\nextern JS_FRIEND_API(void)\nJS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\nextern JS_FRIEND_API(JSString *)\nJS_GetAnonymousString(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nJS_FindCompilationScope(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSFunction *)\nJS_GetObjectFunction(JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(uint32_t)\nJS_ObjectCountDynamicSlots(JS::HandleObject obj);\n\nextern JS_FRIEND_API(size_t)\nJS_SetProtoCalled(JSContext *cx);\n\nextern JS_FRIEND_API(size_t)\nJS_GetCustomIteratorCount(JSContext *cx);\n\nextern JS_FRIEND_API(JSBool)\nJS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret);\n\n/*\n * Determine whether the given object is backed by a DeadObjectProxy.\n *\n * Such objects hold no other objects (they have no outgoing reference edges)\n * and will throw if you touch them (e.g. by reading/writing a property).\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsDeadWrapper(JSObject *obj);\n\n/*\n * Used by the cycle collector to trace through the shape and all\n * shapes it reaches, marking all non-shape children found in the\n * process. Uses bounded stack space.\n */\nextern JS_FRIEND_API(void)\nJS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape);\n\nenum {\n    JS_TELEMETRY_GC_REASON,\n    JS_TELEMETRY_GC_IS_COMPARTMENTAL,\n    JS_TELEMETRY_GC_MS,\n    JS_TELEMETRY_GC_MAX_PAUSE_MS,\n    JS_TELEMETRY_GC_MARK_MS,\n    JS_TELEMETRY_GC_SWEEP_MS,\n    JS_TELEMETRY_GC_MARK_ROOTS_MS,\n    JS_TELEMETRY_GC_MARK_GRAY_MS,\n    JS_TELEMETRY_GC_SLICE_MS,\n    JS_TELEMETRY_GC_MMU_50,\n    JS_TELEMETRY_GC_RESET,\n    JS_TELEMETRY_GC_INCREMENTAL_DISABLED,\n    JS_TELEMETRY_GC_NON_INCREMENTAL,\n    JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS,\n    JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS\n};\n\ntypedef void\n(* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample);\n\nextern JS_FRIEND_API(void)\nJS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback);\n\nextern JS_FRIEND_API(JSPrincipals *)\nJS_GetCompartmentPrincipals(JSCompartment *compartment);\n\nextern JS_FRIEND_API(void)\nJS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);\n\n/* Safe to call with input obj == NULL. Returns non-NULL iff obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToInnerObject(JSContext *cx, JSObject *obj);\n\n/* Requires obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToOuterObject(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSObject *)\nJS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(JSString *)\nJS_BasicObjectToString(JSContext *cx, JS::HandleObject obj);\n\nextern JS_FRIEND_API(JSBool)\njs_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,\n                          JS::MutableHandleValue vp);\n\nJS_FRIEND_API(void)\njs_ReportOverRecursed(JSContext *maybecx);\n\nJS_FRIEND_API(bool)\njs_ObjectClassIs(JSContext *cx, JS::HandleObject obj, js::ESClassValue classValue);\n\nJS_FRIEND_API(const char *)\njs_ObjectClassName(JSContext *cx, JS::HandleObject obj);\n\nJS_FRIEND_API(bool)\njs_AddObjectRoot(JSRuntime *rt, JSObject **objp);\n\nJS_FRIEND_API(void)\njs_RemoveObjectRoot(JSRuntime *rt, JSObject **objp);\n\n#ifdef DEBUG\n\n/*\n * Routines to print out values during debugging.  These are FRIEND_API to help\n * the debugger find them and to support temporarily hacking js_Dump* calls\n * into other code.\n */\n\nextern JS_FRIEND_API(void)\njs_DumpString(JSString *str);\n\nextern JS_FRIEND_API(void)\njs_DumpAtom(JSAtom *atom);\n\nextern JS_FRIEND_API(void)\njs_DumpObject(JSObject *obj);\n\nextern JS_FRIEND_API(void)\njs_DumpChars(const jschar *s, size_t n);\n#endif\n\nextern JS_FRIEND_API(bool)\nJS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);\n\nextern JS_FRIEND_API(JSBool)\nJS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,\n                  js::MutableHandleValue statep, js::MutableHandleId idp);\n\nstruct JSFunctionSpecWithHelp {\n    const char      *name;\n    JSNative        call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *usage;\n    const char      *help;\n};\n\n#define JS_FN_HELP(name,call,nargs,flags,usage,help)                          \\\n    {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}\n#define JS_FS_HELP_END                                                        \\\n    {NULL, NULL, 0, 0, NULL, NULL}\n\nextern JS_FRIEND_API(bool)\nJS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);\n\ntypedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,\n                               jschar **src, uint32_t *length);\n\nextern JS_FRIEND_API(void)\nJS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);\n\nnamespace js {\n\ninline JSRuntime *\nGetRuntime(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->runtime_;\n}\n\ninline JSCompartment *\nGetContextCompartment(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->compartment_;\n}\n\ninline JS::Zone *\nGetContextZone(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->zone_;\n}\n\nextern JS_FRIEND_API(JS::Zone *)\nGetCompartmentZone(JSCompartment *comp);\n\ntypedef bool\n(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);\n\n /*\n  * Dump the complete object graph of heap-allocated things.\n  * fp is the file for the dump output.\n  */\nextern JS_FRIEND_API(void)\nDumpHeapComplete(JSRuntime *rt, FILE *fp);\n\n#ifdef OLD_GETTER_SETTER_METHODS\nJS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);\nJS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);\n#endif\n\nextern JS_FRIEND_API(bool)\nIsSystemCompartment(JSCompartment *comp);\n\nextern JS_FRIEND_API(bool)\nIsSystemZone(JS::Zone *zone);\n\nextern JS_FRIEND_API(bool)\nIsAtomsCompartment(JSCompartment *comp);\n\n/*\n * Check whether it is OK to assign an undeclared variable with the name\n * |propname| at the current location in script.  It is not an error if there is\n * no current script location, or if that location is not an assignment to an\n * undeclared variable.  Reports an error if one needs to be reported (and,\n * particularly, always reports when it returns false).\n */\nextern JS_FRIEND_API(bool)\nReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname);\n\n/*\n * Returns whether we're in a non-strict property set (in that we're in a\n * non-strict script and the bytecode we're on is a property set).  The return\n * value does NOT indicate any sort of exception was thrown: it's just a\n * boolean.\n */\nextern JS_FRIEND_API(bool)\nIsInNonStrictPropertySet(JSContext *cx);\n\nstruct WeakMapTracer;\n\n/*\n * Weak map tracer callback, called once for every binding of every\n * weak map that was live at the time of the last garbage collection.\n *\n * m will be NULL if the weak map is not contained in a JS Object.\n */\ntypedef void\n(* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m,\n                         void *k, JSGCTraceKind kkind,\n                         void *v, JSGCTraceKind vkind);\n\nstruct WeakMapTracer {\n    JSRuntime            *runtime;\n    WeakMapTraceCallback callback;\n\n    WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb)\n        : runtime(rt), callback(cb) {}\n};\n\nextern JS_FRIEND_API(void)\nTraceWeakMaps(WeakMapTracer *trc);\n\nextern JS_FRIEND_API(bool)\nAreGCGrayBitsValid(JSRuntime *rt);\n\ntypedef void\n(*GCThingCallback)(void *closure, void *gcthing);\n\nextern JS_FRIEND_API(void)\nVisitGrayWrapperTargets(JS::Zone *zone, GCThingCallback callback, void *closure);\n\nextern JS_FRIEND_API(JSObject *)\nGetWeakmapKeyDelegate(JSObject *key);\n\nJS_FRIEND_API(JSGCTraceKind)\nGCThingTraceKind(void *thing);\n\n/*\n * Invoke cellCallback on every gray JS_OBJECT in the given zone.\n */\nextern JS_FRIEND_API(void)\nIterateGrayObjects(JS::Zone *zone, GCThingCallback cellCallback, void *data);\n\n#ifdef JS_HAS_CTYPES\nextern JS_FRIEND_API(size_t)\nSizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj);\n#endif\n\nextern JS_FRIEND_API(JSCompartment *)\nGetAnyCompartmentInZone(JS::Zone *zone);\n\n/*\n * Shadow declarations of JS internal structures, for access by inline access\n * functions below. Do not use these structures in any other way. When adding\n * new fields for access by inline methods, make sure to add static asserts to\n * the original header file to ensure that offsets are consistent.\n */\nnamespace shadow {\n\nstruct TypeObject {\n    Class       *clasp;\n    JSObject    *proto;\n};\n\nstruct BaseShape {\n    js::Class *clasp;\n    JSObject *parent;\n    JSObject *_1;\n    JSCompartment *compartment;\n};\n\nclass Shape {\npublic:\n    shadow::BaseShape *base;\n    jsid              _1;\n    uint32_t          slotInfo;\n\n    static const uint32_t FIXED_SLOTS_SHIFT = 27;\n};\n\nstruct Object {\n    shadow::Shape      *shape;\n    shadow::TypeObject *type;\n    js::Value          *slots;\n    js::Value          *_1;\n\n    size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }\n    Value *fixedSlots() const {\n        return (Value *)(uintptr_t(this) + sizeof(shadow::Object));\n    }\n\n    js::Value &slotRef(size_t slot) const {\n        size_t nfixed = numFixedSlots();\n        if (slot < nfixed)\n            return fixedSlots()[slot];\n        return slots[slot - nfixed];\n    }\n};\n\nstruct Function {\n    Object base;\n    uint16_t nargs;\n    uint16_t flags;\n    /* Used only for natives */\n    Native native;\n    const JSJitInfo *jitinfo;\n    void *_1;\n};\n\nstruct Atom {\n    static const size_t LENGTH_SHIFT = 4;\n    size_t lengthAndFlags;\n    const jschar *chars;\n};\n\n} /* namespace shadow */\n\n// These are equal to |&{Function,Object,OuterWindow}ProxyObject::class_|.  Use\n// them in places where you don't want to #include vm/ProxyObject.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) ObjectProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) OuterWindowProxyClassPtr;\n\n// This is equal to |&JSObject::class_|.  Use it in places where you don't want\n// to #include jsobj.h.\nextern JS_FRIEND_DATA(js::Class* const) ObjectClassPtr;\n\ninline js::Class *\nGetObjectClass(JSObject *obj)\n{\n    return reinterpret_cast<const shadow::Object*>(obj)->type->clasp;\n}\n\ninline JSClass *\nGetObjectJSClass(JSObject *obj)\n{\n    return js::Jsvalify(GetObjectClass(obj));\n}\n\ninline bool\nIsInnerObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.outerObject;\n}\n\ninline bool\nIsOuterObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.innerObject;\n}\n\nJS_FRIEND_API(bool)\nIsFunctionObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsScopeObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsCallObject(JSObject *obj);\n\ninline JSObject *\nGetObjectParent(JSObject *obj)\n{\n    JS_ASSERT(!IsScopeObject(obj));\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->parent;\n}\n\nstatic JS_ALWAYS_INLINE JSCompartment *\nGetObjectCompartment(JSObject *obj)\n{\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->compartment;\n}\n\nJS_FRIEND_API(JSObject *)\nGetObjectParentMaybeScope(JSObject *obj);\n\nJS_FRIEND_API(JSObject *)\nGetGlobalForObjectCrossCompartment(JSObject *obj);\n\n// For legacy consumers only. This whole concept is going away soon.\nJS_FRIEND_API(JSObject *)\nDefaultObjectForContextOrNull(JSContext *cx);\n\nJS_FRIEND_API(void)\nSetDefaultObjectForContext(JSContext *cx, JSObject *obj);\n\nJS_FRIEND_API(void)\nNotifyAnimationActivity(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsOriginalScriptFunction(JSFunction *fun);\n\n/*\n * Return the outermost enclosing function (script) of the scripted caller.\n * This function returns NULL in several cases:\n *  - no script is running on the context\n *  - the caller is in global or eval code\n * In particular, this function will \"stop\" its outermost search at eval() and\n * thus it will really return the outermost enclosing function *since the\n * innermost eval*.\n */\nJS_FRIEND_API(JSScript *)\nGetOutermostEnclosingFunctionOfScriptedCaller(JSContext *cx);\n\nJS_FRIEND_API(JSFunction *)\nDefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                           unsigned nargs, unsigned attrs);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                        JSObject *parent, const char *name);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,\n                            JSObject *parent, jsid id);\n\nJS_FRIEND_API(JSObject *)\nInitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n                      JSClass *clasp, JSNative constructor, unsigned nargs,\n                      const JSPropertySpec *ps, const JSFunctionSpec *fs,\n                      const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\nJS_FRIEND_API(const Value &)\nGetFunctionNativeReserved(JSObject *fun, size_t which);\n\nJS_FRIEND_API(void)\nSetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val);\n\ninline bool\nGetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)\n{\n    js::Class *clasp = GetObjectClass(obj);\n    if (clasp == js::ObjectProxyClassPtr ||\n        clasp == js::OuterWindowProxyClassPtr ||\n        clasp == js::FunctionProxyClassPtr)\n    {\n        return JS_GetPrototype(cx, obj, proto);\n    }\n\n    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);\n    return true;\n}\n\ninline void *\nGetObjectPrivate(JSObject *obj)\n{\n    const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);\n    void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);\n    return *addr;\n}\n\n/*\n * Get a slot that is both reserved for object's clasp *and* is fixed (fits\n * within the maximum capacity for the object's fixed slots).\n */\ninline const Value &\nGetReservedSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\nJS_FRIEND_API(void)\nSetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);\n\ninline void\nSetReservedSlot(JSObject *obj, size_t slot, const Value &value)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);\n    if (sobj->slotRef(slot).isMarkable()\n#ifdef JSGC_GENERATIONAL\n        || value.isMarkable()\n#endif\n       )\n    {\n        SetReservedSlotWithBarrier(obj, slot, value);\n    } else {\n        sobj->slotRef(slot) = value;\n    }\n}\n\nJS_FRIEND_API(uint32_t)\nGetObjectSlotSpan(JSObject *obj);\n\ninline const Value &\nGetObjectSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < GetObjectSlotSpan(obj));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\ninline const jschar *\nGetAtomChars(JSAtom *atom)\n{\n    return reinterpret_cast<shadow::Atom *>(atom)->chars;\n}\n\ninline size_t\nGetAtomLength(JSAtom *atom)\n{\n    using shadow::Atom;\n    return reinterpret_cast<Atom*>(atom)->lengthAndFlags >> Atom::LENGTH_SHIFT;\n}\n\ninline JSLinearString *\nAtomToLinearString(JSAtom *atom)\n{\n    return reinterpret_cast<JSLinearString *>(atom);\n}\n\nstatic inline js::PropertyOp\nCastAsJSPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object);\n}\n\nstatic inline js::StrictPropertyOp\nCastAsJSStrictPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object);\n}\n\nJS_FRIEND_API(bool)\nGetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);\n\nJS_FRIEND_API(bool)\nAppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others);\n\nJS_FRIEND_API(bool)\nGetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);\n\nJS_FRIEND_API(bool)\nStringIsArrayIndex(JSLinearString *str, uint32_t *indexp);\n\nJS_FRIEND_API(void)\nSetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);\n\nJS_FRIEND_API(bool)\nIsObjectInContextCompartment(JSObject *obj, const JSContext *cx);\n\n/*\n * NB: these flag bits are encoded into the bytecode stream in the immediate\n * operand of JSOP_ITER, so don't change them without advancing vm/Xdr.h's\n * XDR_BYTECODE_VERSION.\n */\n#define JSITER_ENUMERATE  0x1   /* for-in compatible hidden default iterator */\n#define JSITER_FOREACH    0x2   /* return [key, value] pair rather than key */\n#define JSITER_KEYVALUE   0x4   /* destructuring for-in wants [key, value] */\n#define JSITER_OWNONLY    0x8   /* iterate over obj's own properties only */\n#define JSITER_HIDDEN     0x10  /* also enumerate non-enumerable properties */\n#define JSITER_FOR_OF     0x20  /* harmony for-of loop */\n\ninline uintptr_t\nGetNativeStackLimit(const JSRuntime *rt)\n{\n    return PerThreadDataFriendFields::getMainThread(rt)->nativeStackLimit;\n}\n\ninline uintptr_t\nGetNativeStackLimit(JSContext *cx)\n{\n    return GetNativeStackLimit(GetRuntime(cx));\n}\n\n/*\n * These macros report a stack overflow and run |onerror| if we are close to\n * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a little\n * extra space so that we can ensure that crucial code is able to run.\n */\n\n#define JS_CHECK_RECURSION(cx, onerror)                              \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), &stackDummy_)) {  \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, sp, onerror)                 \\\n    JS_BEGIN_MACRO                                                              \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), sp)) {            \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_CHROME_RECURSION(cx, onerror)                                  \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE_WITH_TOLERANCE(js::GetNativeStackLimit(cx),    \\\n                                                &stackDummy_,                   \\\n                                                1024 * sizeof(size_t)))         \\\n        {                                                                       \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\nJS_FRIEND_API(void)\nStartPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nStopPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nPurgePCCounts(JSContext *cx);\n\nJS_FRIEND_API(size_t)\nGetPCCountScriptCount(JSContext *cx);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptSummary(JSContext *cx, size_t script);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptContents(JSContext *cx, size_t script);\n\n/*\n * A call stack can be specified to the JS engine such that all JS entry/exits\n * to functions push/pop an entry to/from the specified stack.\n *\n * For more detailed information, see vm/SPSProfiler.h\n */\nclass ProfileEntry\n{\n    /*\n     * All fields are marked volatile to prevent the compiler from re-ordering\n     * instructions. Namely this sequence:\n     *\n     *    entry[size] = ...;\n     *    size++;\n     *\n     * If the size modification were somehow reordered before the stores, then\n     * if a sample were taken it would be examining bogus information.\n     *\n     * A ProfileEntry represents both a C++ profile entry and a JS one. Both use\n     * the string as a description, but JS uses the sp as NULL to indicate that\n     * it is a JS entry. The script_ is then only ever examined for a JS entry,\n     * and the idx is used by both, but with different meanings.\n     */\n    const char * volatile string; // Descriptive string of this entry\n    void * volatile sp;           // Relevant stack pointer for the entry\n    JSScript * volatile script_;  // if js(), non-null script which is running\n    int32_t volatile idx;         // if js(), idx of pc, otherwise line number\n\n  public:\n    /*\n     * All of these methods are marked with the 'volatile' keyword because SPS's\n     * representation of the stack is stored such that all ProfileEntry\n     * instances are volatile. These methods would not be available unless they\n     * were marked as volatile as well\n     */\n\n    bool js() volatile {\n        JS_ASSERT_IF(sp == NULL, script_ != NULL);\n        return sp == NULL;\n    }\n\n    uint32_t line() volatile { JS_ASSERT(!js()); return idx; }\n    JSScript *script() volatile { JS_ASSERT(js()); return script_; }\n    void *stackAddress() volatile { return sp; }\n    const char *label() volatile { return string; }\n\n    void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }\n    void setLabel(const char *aString) volatile { string = aString; }\n    void setStackAddress(void *aSp) volatile { sp = aSp; }\n    void setScript(JSScript *aScript) volatile { script_ = aScript; }\n\n    /* we can't know the layout of JSScript, so look in vm/SPSProfiler.cpp */\n    JS_FRIEND_API(jsbytecode *) pc() volatile;\n    JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile;\n\n    static size_t offsetOfString() { return offsetof(ProfileEntry, string); }\n    static size_t offsetOfStackAddress() { return offsetof(ProfileEntry, sp); }\n    static size_t offsetOfPCIdx() { return offsetof(ProfileEntry, idx); }\n    static size_t offsetOfScript() { return offsetof(ProfileEntry, script_); }\n\n    /*\n     * The index used in the entry can either be a line number or the offset of\n     * a pc into a script's code. To signify a NULL pc, use a -1 index. This is\n     * checked against in pc() and setPC() to set/get the right pc.\n     */\n    static const int32_t NullPCIndex = -1;\n};\n\nJS_FRIEND_API(void)\nSetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,\n                         uint32_t max);\n\nJS_FRIEND_API(void)\nEnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);\n\nJS_FRIEND_API(jsbytecode*)\nProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);\n\n#ifdef JS_THREADSAFE\nJS_FRIEND_API(bool)\nContextHasOutstandingRequests(const JSContext *cx);\n#endif\n\nJS_FRIEND_API(bool)\nHasUnrootedGlobal(const JSContext *cx);\n\ntypedef void\n(* ActivityCallback)(void *arg, JSBool active);\n\n/*\n * Sets a callback that is run whenever the runtime goes idle - the\n * last active request ceases - and begins activity - when it was\n * idle and a request begins.\n */\nJS_FRIEND_API(void)\nSetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg);\n\nextern JS_FRIEND_API(const JSStructuredCloneCallbacks *)\nGetContextStructuredCloneCallbacks(JSContext *cx);\n\nextern JS_FRIEND_API(bool)\nCanCallContextDebugHandler(JSContext *cx);\n\nextern JS_FRIEND_API(JSTrapStatus)\nCallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);\n\nextern JS_FRIEND_API(bool)\nIsContextRunningJS(JSContext *cx);\n\ntypedef void\n(* AnalysisPurgeCallback)(JSRuntime *rt, JS::Handle<JSFlatString*> desc);\n\nextern JS_FRIEND_API(AnalysisPurgeCallback)\nSetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback);\n\ntypedef JSBool\n(* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID,\n                                 uint32_t depth);\nstruct JSDOMCallbacks {\n    DOMInstanceClassMatchesProto instanceClassMatchesProto;\n};\ntypedef struct JSDOMCallbacks DOMCallbacks;\n\nextern JS_FRIEND_API(void)\nSetDOMCallbacks(JSRuntime *rt, const DOMCallbacks *callbacks);\n\nextern JS_FRIEND_API(const DOMCallbacks *)\nGetDOMCallbacks(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nGetTestingFunctions(JSContext *cx);\n\n/*\n * Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not\n * available and the compiler does not know that FreeOp inherits from\n * JSFreeOp.\n */\ninline JSFreeOp *\nCastToJSFreeOp(FreeOp *fop)\n{\n    return reinterpret_cast<JSFreeOp *>(fop);\n}\n\n/* Implemented in jsexn.cpp. */\n\n/*\n * Get an error type name from a JSExnType constant.\n * Returns NULL for invalid arguments and JSEXN_INTERNALERR\n */\nextern JS_FRIEND_API(const jschar*)\nGetErrorTypeName(JSContext* cx, int16_t exnType);\n\n#ifdef DEBUG\nextern JS_FRIEND_API(unsigned)\nGetEnterCompartmentDepth(JSContext* cx);\n#endif\n\n/* Implemented in jswrapper.cpp. */\ntypedef enum NukeReferencesToWindow {\n    NukeWindowReferences,\n    DontNukeWindowReferences\n} NukeReferencesToWindow;\n\n/*\n * These filters are designed to be ephemeral stack classes, and thus don't\n * do any rooting or holding of their members.\n */\nstruct CompartmentFilter {\n    virtual bool match(JSCompartment *c) const = 0;\n};\n\nstruct AllCompartments : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const { return true; }\n};\n\nstruct ContentCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return !IsSystemCompartment(c);\n    }\n};\n\nstruct ChromeCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return IsSystemCompartment(c);\n    }\n};\n\nstruct SingleCompartment : public CompartmentFilter {\n    JSCompartment *ours;\n    SingleCompartment(JSCompartment *c) : ours(c) {}\n    virtual bool match(JSCompartment *c) const { return c == ours; }\n};\n\nstruct CompartmentsWithPrincipals : public CompartmentFilter {\n    JSPrincipals *principals;\n    CompartmentsWithPrincipals(JSPrincipals *p) : principals(p) {}\n    virtual bool match(JSCompartment *c) const {\n        return JS_GetCompartmentPrincipals(c) == principals;\n    }\n};\n\nextern JS_FRIEND_API(JSBool)\nNukeCrossCompartmentWrappers(JSContext* cx,\n                             const CompartmentFilter& sourceFilter,\n                             const CompartmentFilter& targetFilter,\n                             NukeReferencesToWindow nukeReferencesToWindow);\n\n/* Specify information about DOMProxy proxies in the DOM, for use by ICs. */\n\n/*\n * The DOMProxyShadowsCheck function will be called to check if the property for\n * id should be gotten from the prototype, or if there is an own property that\n * shadows it.\n * If DoesntShadow is returned then the slot at listBaseExpandoSlot should\n * either be undefined or point to an expando object that would contain the own\n * property.\n * If DoesntShadowUnique is returned then the slot at listBaseExpandoSlot should\n * contain a private pointer to a ExpandoAndGeneration, which contains a\n * JS::Value that should either be undefined or point to an expando object, and\n * a uint32 value. If that value changes then the IC for getting a property will\n * be invalidated.\n */\n\nstruct ExpandoAndGeneration {\n  ExpandoAndGeneration()\n    : expando(UndefinedValue()),\n      generation(0)\n  {}\n\n  void Unlink()\n  {\n      ++generation;\n      expando.setUndefined();\n  }\n\n  JS::Heap<JS::Value> expando;\n  uint32_t generation;\n};\n\ntypedef enum DOMProxyShadowsResult {\n  ShadowCheckFailed,\n  Shadows,\n  DoesntShadow,\n  DoesntShadowUnique\n} DOMProxyShadowsResult;\ntypedef DOMProxyShadowsResult\n(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);\nJS_FRIEND_API(void)\nSetDOMProxyInformation(void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,\n                       DOMProxyShadowsCheck domProxyShadowsCheck);\n\nvoid *GetDOMProxyHandlerFamily();\nuint32_t GetDOMProxyExpandoSlot();\nDOMProxyShadowsCheck GetDOMProxyShadowsCheck();\n\n} /* namespace js */\n\n/* Implemented in jsdate.cpp. */\n\n/*\n * Detect whether the internal date value is NaN.  (Because failure is\n * out-of-band for js_DateGet*)\n */\nextern JS_FRIEND_API(JSBool)\njs_DateIsValid(JSObject* obj);\n\nextern JS_FRIEND_API(double)\njs_DateGetMsecSinceEpoch(JSObject *obj);\n\n/* Implemented in jscntxt.cpp. */\n\n/*\n * Report an exception, which is currently realized as a printf-style format\n * string and its arguments.\n */\ntypedef enum JSErrNum {\n#define MSG_DEF(name, number, count, exception, format) \\\n    name = number,\n#include \"js.msg\"\n#undef MSG_DEF\n    JSErr_Limit\n} JSErrNum;\n\nextern JS_FRIEND_API(const JSErrorFormatString *)\njs_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);\n\n/* Implemented in jsclone.cpp. */\n\nextern JS_FRIEND_API(uint64_t)\njs_GetSCOffset(JSStructuredCloneWriter* writer);\n\n/* Typed Array functions, implemented in jstypedarray.cpp */\n\nnamespace js {\nnamespace ArrayBufferView {\n\nenum ViewType {\n    TYPE_INT8 = 0,\n    TYPE_UINT8,\n    TYPE_INT16,\n    TYPE_UINT16,\n    TYPE_INT32,\n    TYPE_UINT32,\n    TYPE_FLOAT32,\n    TYPE_FLOAT64,\n\n    /*\n     * Special type that is a uint8_t, but assignments are clamped to [0, 256).\n     * Treat the raw data type as a uint8_t.\n     */\n    TYPE_UINT8_CLAMPED,\n\n    /*\n     * Type returned for a DataView. Note that there is no single element type\n     * in this case.\n     */\n    TYPE_DATAVIEW,\n\n    TYPE_MAX\n};\n\n} /* namespace ArrayBufferView */\n\n/*\n * A helper for building up an ArrayBuffer object's data\n * before creating the ArrayBuffer itself.  Will do doubling\n * based reallocation, up to an optional maximum growth given.\n *\n * When all the data has been appended, call getArrayBuffer,\n * passing in the JSContext* for which the ArrayBuffer object\n * is to be created.  This also implicitly resets the builder,\n * or it can be reset explicitly at any point by calling reset().\n */\nclass ArrayBufferBuilder\n{\n    void *rawcontents_;\n    uint8_t *dataptr_;\n    uint32_t capacity_;\n    uint32_t length_;\n  public:\n    ArrayBufferBuilder()\n        : rawcontents_(NULL),\n          dataptr_(NULL),\n          capacity_(0),\n          length_(0)\n    {\n    }\n\n    ~ArrayBufferBuilder() {\n        reset();\n    }\n\n    void reset() {\n        if (rawcontents_)\n            JS_free(NULL, rawcontents_);\n        rawcontents_ = dataptr_ = NULL;\n        capacity_ = length_ = 0;\n    }\n\n    // will truncate if newcap is < length()\n    bool setCapacity(uint32_t newcap) {\n        if (!JS_ReallocateArrayBufferContents(NULL, newcap, &rawcontents_, &dataptr_))\n            return false;\n\n        capacity_ = newcap;\n        if (length_ > newcap)\n            length_ = newcap;\n\n        return true;\n    }\n\n    // Append datalen bytes from data to the current buffer.  If we\n    // need to grow the buffer, grow by doubling the size up to a\n    // maximum of maxgrowth (if given).  If datalen is greater than\n    // what the new capacity would end up as, then grow by datalen.\n    //\n    // The data parameter must not overlap with anything beyond the\n    // builder's current valid contents [0..length)\n    bool append(const uint8_t *newdata, uint32_t datalen, uint32_t maxgrowth = 0) {\n        if (length_ + datalen > capacity_) {\n            uint32_t newcap;\n            // double while under maxgrowth or if not specified\n            if (!maxgrowth || capacity_ < maxgrowth)\n                newcap = capacity_ * 2;\n            else\n                newcap = capacity_ + maxgrowth;\n\n            // but make sure there's always enough to satisfy our request\n            if (newcap < length_ + datalen)\n                newcap = length_ + datalen;\n\n            // did we overflow?\n            if (newcap < capacity_)\n                return false;\n\n            if (!setCapacity(newcap))\n                return false;\n        }\n\n        // assert that the region isn't overlapping so we can memcpy;\n        JS_ASSERT(!areOverlappingRegions(newdata, datalen, dataptr_ + length_, datalen));\n\n        memcpy(dataptr_ + length_, newdata, datalen);\n        length_ += datalen;\n\n        return true;\n    }\n\n    uint8_t *data() {\n        return dataptr_;\n    }\n\n    uint32_t length() {\n        return length_;\n    }\n\n    uint32_t capacity() {\n        return capacity_;\n    }\n\n    JSObject* getArrayBuffer(JSContext *cx) {\n        // we need to check for length_ == 0, because nothing may have been\n        // added\n        if (capacity_ > length_ || length_ == 0) {\n            if (!setCapacity(length_))\n                return NULL;\n        }\n\n        JSObject* obj = JS_NewArrayBufferWithContents(cx, rawcontents_);\n        if (!obj)\n            return NULL;\n\n        rawcontents_ = dataptr_ = NULL;\n        length_ = capacity_ = 0;\n\n        return obj;\n    }\n\nprotected:\n\n    static bool areOverlappingRegions(const uint8_t *start1, uint32_t length1,\n                                      const uint8_t *start2, uint32_t length2)\n    {\n        const uint8_t *end1 = start1 + length1;\n        const uint8_t *end2 = start2 + length2;\n\n        const uint8_t *max_start = start1 > start2 ? start1 : start2;\n        const uint8_t *min_end   = end1 < end2 ? end1 : end2;\n\n        return max_start < min_end;\n    }\n};\n\n} /* namespace js */\n\ntypedef js::ArrayBufferView::ViewType JSArrayBufferViewType;\n\n/*\n * Create a new typed array with nelements elements.\n *\n * These functions (except the WithBuffer variants) fill in the array with zeros.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64Array(JSContext *cx, uint32_t nelements);\n\n/*\n * Create a new typed array and copy in values from the given object. The\n * object is used as if it were an array; that is, the new array (if\n * successfully created) will have length given by array.length, and its\n * elements will be those specified by array[0], array[1], and so on, after\n * conversion to the typed array element type.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array);\n\n/*\n * Create a new typed array using the given ArrayBuffer for storage.  The\n * length value is optional; if -1 is passed, enough elements to use up the\n * remainder of the byte array is used as the default value.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                          uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                                  uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\n\n/*\n * Create a new ArrayBuffer with the given byte length.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);\n\n/*\n * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return\n * false if a security wrapper is encountered that denies the unwrapping. If\n * this test or one of the JS_Is*Array tests succeeds, then it is safe to call\n * the various accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsTypedArrayObject(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test or one of the more specific tests succeeds, then it\n * is safe to call the various ArrayBufferView accessor JSAPI calls defined\n * below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * Test for specific typed array types (ArrayBufferView subtypes)\n */\n\nextern JS_FRIEND_API(JSBool)\nJS_IsInt8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8ClampedArray(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat64Array(JSObject *obj);\n\n/*\n * Unwrap Typed arrays all at once. Return NULL without throwing if the object\n * cannot be viewed as the correct typed array, or the typed array object on\n * success, filling both outparameters.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt8Array(JSObject *obj, uint32_t *length, int8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8Array(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8ClampedArray(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt16Array(JSObject *obj, uint32_t *length, int16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint16Array(JSObject *obj, uint32_t *length, uint16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt32Array(JSObject *obj, uint32_t *length, int32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint32Array(JSObject *obj, uint32_t *length, uint32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat32Array(JSObject *obj, uint32_t *length, float **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat64Array(JSObject *obj, uint32_t *length, double **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBufferView(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBuffer(JSObject *obj, uint32_t *length, uint8_t **data);\n\n/*\n * Get the type of elements in a typed array, or TYPE_DATAVIEW if a DataView.\n *\n * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is an ArrayBufferView or a\n * wrapper of an ArrayBufferView, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(JSArrayBufferViewType)\nJS_GetArrayBufferViewType(JSObject *obj);\n\n/*\n * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test succeeds, then it is safe to call the various\n * accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferObject(JSObject *obj);\n\n/*\n * Return the available byte length of an array buffer.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferByteLength(JSObject *obj);\n\n/*\n * Return a pointer to an array buffer's data. The buffer is still owned by the\n * array buffer object, and should not be modified on another thread. The\n * returned pointer is stable across GCs.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint8_t *)\nJS_GetArrayBufferData(JSObject *obj);\n\n/*\n * Return the number of elements in a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayLength(JSObject *obj);\n\n/*\n * Return the byte offset from the start of an array buffer to the start of a\n * typed array view.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteLength(JSObject *obj);\n\n/*\n * Check whether obj supports JS_ArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * More generic name for JS_GetTypedArrayByteLength to cover DataViews as well\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the start of the data referenced by a typed array. The\n * data is still owned by the typed array, and should not be modified on\n * another thread.\n *\n * |obj| must have passed a JS_Is*Array test, or somehow be known that it would\n * pass such a test: it is a typed array or a wrapper of a typed array, and the\n * unwrapping will succeed.\n */\n\nextern JS_FRIEND_API(int8_t *)\nJS_GetInt8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ClampedArrayData(JSObject *obj);\nextern JS_FRIEND_API(int16_t *)\nJS_GetInt16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint16_t *)\nJS_GetUint16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(int32_t *)\nJS_GetInt32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint32_t *)\nJS_GetUint32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(float *)\nJS_GetFloat32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(double *)\nJS_GetFloat64ArrayData(JSObject *obj);\n\n/*\n * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific\n * versions when possible.\n */\nextern JS_FRIEND_API(void *)\nJS_GetArrayBufferViewData(JSObject *obj);\n\n/*\n * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been\n * neutered, this will still return the neutered buffer. |obj| must be an\n * object that would return true for JS_IsArrayBufferViewObject().\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetArrayBufferViewBuffer(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetDataView* APIs.\n */\nJS_FRIEND_API(JSBool)\nJS_IsDataViewObject(JSObject *obj);\n\n/*\n * Return the byte offset of a data view into its array buffer. |obj| must be a\n * DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a data view.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the beginning of the data referenced by a DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(void *)\nJS_GetDataViewData(JSObject *obj);\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitGetterOp.\n */\nclass JSJitGetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitGetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args.rval())\n    {}\n\n    explicit JSJitGetterCallArgs(JS::Rooted<JS::Value>* rooted)\n      : JS::MutableHandleValue(rooted)\n    {}\n\n    JS::MutableHandleValue rval() {\n        return *this;\n    }\n};\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitSetterOp.\n */\nclass JSJitSetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitSetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args[0])\n    {}\n\n    JS::MutableHandleValue operator[](unsigned i) {\n        MOZ_ASSERT(i == 0);\n        return *this;\n    }\n\n    unsigned length() const { return 1; }\n\n    // Add get() or maybe hasDefined() as needed\n};\n\nstruct JSJitMethodCallArgsTraits;\n\n/*\n * A class, expected to be passed by reference, which represents the CallArgs\n * for a JSJitMethodOp.\n */\nclass JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUsedRval>\n{\n  private:\n    typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;\n    friend struct JSJitMethodCallArgsTraits;\n\n  public:\n    explicit JSJitMethodCallArgs(const JS::CallArgs& args) {\n        argv_ = args.array();\n        argc_ = args.length();\n    }\n\n    JS::MutableHandleValue rval() const {\n        return Base::rval();\n    }\n\n    unsigned length() const { return Base::length(); }\n\n    JS::MutableHandleValue operator[](unsigned i) const {\n        return Base::operator[](i);\n    }\n\n    bool hasDefined(unsigned i) const {\n        return Base::hasDefined(i);\n    }\n\n    // Add get() as needed\n};\n\nstruct JSJitMethodCallArgsTraits\n{\n    static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);\n    static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);\n};\n\n/*\n * This struct contains metadata passed from the DOM to the JS Engine for JIT\n * optimizations on DOM property accessors. Eventually, this should be made\n * available to general JSAPI users, but we are not currently ready to do so.\n */\ntypedef bool\n(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitGetterCallArgs args);\ntypedef bool\n(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitSetterCallArgs args);\ntypedef bool\n(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, const JSJitMethodCallArgs& args);\n\nstruct JSJitInfo {\n    enum OpType {\n        Getter,\n        Setter,\n        Method,\n        OpType_None\n    };\n\n    union {\n        JSJitGetterOp getter;\n        JSJitSetterOp setter;\n        JSJitMethodOp method;\n    };\n    uint32_t protoID;\n    uint32_t depth;\n    OpType type;\n    bool isInfallible;      /* Is op fallible? False in setters. */\n    bool isConstant;        /* Getting a construction-time constant? */\n    bool isPure;            /* As long as no non-pure DOM things happen, will\n                               keep returning the same value for the given\n                               \"this\" object\" */\n    JSValueType returnType; /* The return type tag.  Might be JSVAL_TYPE_UNKNOWN */\n\n    /* An alternative native that's safe to call in parallel mode. */\n    JSParallelNative parallelNative;\n};\n\n#define JS_JITINFO_NATIVE_PARALLEL(op)                                         \\\n    {{NULL},0,0,JSJitInfo::OpType_None,false,false,false,JSVAL_TYPE_MISSING,op}\n\nstatic JS_ALWAYS_INLINE const JSJitInfo *\nFUNCTION_VALUE_TO_JITINFO(const JS::Value& v)\n{\n    JS_ASSERT(js::GetObjectClass(&v.toObject()) == js::FunctionClassPtr);\n    return reinterpret_cast<js::shadow::Function *>(&v.toObject())->jitinfo;\n}\n\n/* Statically asserted in jsfun.h. */\nstatic const unsigned JS_FUNCTION_INTERPRETED_BIT = 0x1;\n\nstatic JS_ALWAYS_INLINE void\nSET_JITINFO(JSFunction * func, const JSJitInfo *info)\n{\n    js::shadow::Function *fun = reinterpret_cast<js::shadow::Function *>(func);\n    JS_ASSERT(!(fun->flags & JS_FUNCTION_INTERPRETED_BIT));\n    fun->jitinfo = info;\n}\n\n/*\n * Engine-internal extensions of jsid.  This code is here only until we\n * eliminate Gecko's dependencies on it!\n */\n\nstatic JS_ALWAYS_INLINE jsid\nJSID_FROM_BITS(size_t bits)\n{\n    jsid id;\n    JSID_BITS(id) = bits;\n    return id;\n}\n\n/*\n * Must not be used on atoms that are representable as integer jsids.\n * Prefer NameToId or AtomToId over this function:\n *\n * A PropertyName is an atom that does not contain an integer in the range\n * [0, UINT32_MAX]. However, jsid can only hold an integer in the range\n * [0, JSID_INT_MAX] (where JSID_INT_MAX == 2^31-1).  Thus, for the range of\n * integers (JSID_INT_MAX, UINT32_MAX], to represent as a jsid 'id', it must be\n * the case JSID_IS_ATOM(id) and !JSID_TO_ATOM(id)->isPropertyName().  In most\n * cases when creating a jsid, code does not have to care about this corner\n * case because:\n *\n * - When given an arbitrary JSAtom*, AtomToId must be used, which checks for\n *   integer atoms representable as integer jsids, and does this conversion.\n *\n * - When given a PropertyName*, NameToId can be used which which does not need\n *   to do any dynamic checks.\n *\n * Thus, it is only the rare third case which needs this function, which\n * handles any JSAtom* that is known not to be representable with an int jsid.\n */\nstatic JS_ALWAYS_INLINE jsid\nNON_INTEGER_ATOM_TO_JSID(JSAtom *atom)\n{\n    JS_ASSERT(((size_t)atom & 0x7) == 0);\n    jsid id = JSID_FROM_BITS((size_t)atom);\n    JS_ASSERT(id == INTERNED_STRING_TO_JSID(NULL, (JSString*)atom));\n    return id;\n}\n\n/* All strings stored in jsids are atomized, but are not necessarily property names. */\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id)\n{\n    return JSID_IS_STRING(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id, JSAtom *atom)\n{\n    return id == JSID_FROM_BITS((size_t)atom);\n}\n\nstatic JS_ALWAYS_INLINE JSAtom *\nJSID_TO_ATOM(jsid id)\n{\n    return (JSAtom *)JSID_TO_STRING(id);\n}\n\nJS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD);\n\nnamespace js {\n\nstatic JS_ALWAYS_INLINE Value\nIdToValue(jsid id)\n{\n    if (JSID_IS_STRING(id))\n        return StringValue(JSID_TO_STRING(id));\n    if (JS_LIKELY(JSID_IS_INT(id)))\n        return Int32Value(JSID_TO_INT(id));\n    if (JS_LIKELY(JSID_IS_OBJECT(id)))\n        return ObjectValue(*JSID_TO_OBJECT(id));\n    JS_ASSERT(JSID_IS_VOID(id));\n    return UndefinedValue();\n}\n\nstatic JS_ALWAYS_INLINE jsval\nIdToJsval(jsid id)\n{\n    return IdToValue(id);\n}\n\nextern JS_FRIEND_API(bool)\nIsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method);\n\nextern JS_FRIEND_API(bool)\nIsTypedArrayThisCheck(JS::IsAcceptableThis test);\n\nenum CTypesActivityType {\n    CTYPES_CALL_BEGIN,\n    CTYPES_CALL_END,\n    CTYPES_CALLBACK_BEGIN,\n    CTYPES_CALLBACK_END\n};\n\ntypedef void\n(* CTypesActivityCallback)(JSContext *cx, CTypesActivityType type);\n\n/*\n * Sets a callback that is run whenever js-ctypes is about to be used when\n * calling into C.\n */\nJS_FRIEND_API(void)\nSetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);\n\nclass JS_FRIEND_API(AutoCTypesActivityCallback) {\n  private:\n    JSContext *cx;\n    CTypesActivityCallback callback;\n    CTypesActivityType endType;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n  public:\n    AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,\n                               CTypesActivityType endType\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM);\n    ~AutoCTypesActivityCallback() {\n        DoEndCallback();\n    }\n    void DoEndCallback() {\n        if (callback) {\n            callback(cx, endType);\n            callback = NULL;\n        }\n    }\n};\n\n#ifdef DEBUG\nextern JS_FRIEND_API(void)\nassertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);\n#else\ninline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {};\n#endif\n\ntypedef bool\n(* ObjectMetadataCallback)(JSContext *cx, JSObject **pmetadata);\n\n/*\n * Specify a callback to invoke when creating each JS object in the current\n * compartment, which may return a metadata object to associate with the\n * object. Objects with different metadata have different shape hierarchies,\n * so for efficiency, objects should generally try to share metadata objects.\n */\nJS_FRIEND_API(void)\nSetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback);\n\n/* Manipulate the metadata associated with an object. */\n\nJS_FRIEND_API(bool)\nSetObjectMetadata(JSContext *cx, JS::HandleObject obj, JS::HandleObject metadata);\n\nJS_FRIEND_API(JSObject *)\nGetObjectMetadata(JSObject *obj);\n\n/* ES5 8.12.8. */\nextern JS_FRIEND_API(JSBool)\nDefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp);\n\n/*\n * Helper function. To approximate a call to the [[DefineOwnProperty]] internal\n * method described in ES5, first call this, then call JS_DefinePropertyById.\n *\n * JS_DefinePropertyById by itself does not enforce the invariants on\n * non-configurable properties when obj->isNative(). This function performs the\n * relevant checks (specified in ES5 8.12.9 [[DefineOwnProperty]] steps 1-11),\n * but only if obj is native.\n *\n * The reason for the messiness here is that ES5 uses [[DefineOwnProperty]] as\n * a sort of extension point, but there is no hook in js::Class,\n * js::ProxyHandler, or the JSAPI with precisely the right semantics for it.\n */\nextern JS_FRIEND_API(bool)\nCheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSBool)\njs_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,\n                     const js::PropertyDescriptor& descriptor, JSBool *bp);\n\nextern JS_FRIEND_API(JSBool)\njs_ReportIsNotFunction(JSContext *cx, const JS::Value& v);\n\n#ifdef JSGC_GENERATIONAL\nextern JS_FRIEND_API(void)\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data);\n\nextern JS_FRIEND_API(void)\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data);\n#else\ninline void\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data) {}\n\ninline void\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data) {}\n#endif /* JSGC_GENERATIONAL */\n\n#endif /* jsfriendapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jslock.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jslock_h\n#define jslock_h\n\n#ifdef JS_THREADSAFE\n\n# include \"jsapi.h\"\n# include \"pratom.h\"\n# include \"prcvar.h\"\n# include \"prinit.h\"\n# include \"prlock.h\"\n# include \"prthread.h\"\n\n# define JS_ATOMIC_INCREMENT(p)      PR_ATOMIC_INCREMENT((int32_t *)(p))\n# define JS_ATOMIC_DECREMENT(p)      PR_ATOMIC_DECREMENT((int32_t *)(p))\n# define JS_ATOMIC_ADD(p,v)          PR_ATOMIC_ADD((int32_t *)(p), (int32_t)(v))\n# define JS_ATOMIC_SET(p,v)          PR_ATOMIC_SET((int32_t *)(p), (int32_t)(v))\n\nnamespace js {\n    // Defined in jsgc.cpp.\n    unsigned GetCPUCount();\n}\n\n#else  /* JS_THREADSAFE */\n\ntypedef struct PRThread PRThread;\ntypedef struct PRCondVar PRCondVar;\ntypedef struct PRLock PRLock;\n\n# define JS_ATOMIC_INCREMENT(p)      (++*(p))\n# define JS_ATOMIC_DECREMENT(p)      (--*(p))\n# define JS_ATOMIC_ADD(p,v)          (*(p) += (v))\n# define JS_ATOMIC_SET(p,v)          (*(p) = (v))\n\n#endif /* JS_THREADSAFE */\n\n#endif /* jslock_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsperf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef perf_jsperf_h\n#define perf_jsperf_h\n\n#include \"jsapi.h\"\n\nnamespace JS {\n\n/*\n * JS::PerfMeasurement is a generic way to access detailed performance\n * measurement APIs provided by your operating system.  The details of\n * exactly how this works and what can be measured are highly\n * system-specific, but this interface is (one hopes) implementable\n * on top of all of them.\n *\n * To use this API, create a PerfMeasurement object, passing its\n * constructor a bitmask indicating which events you are interested\n * in.  Thereafter, Start() zeroes all counters and starts timing;\n * Stop() stops timing again; and the counters for the events you\n * requested are available as data values after calling Stop().  The\n * object may be reused for many measurements.\n */\nclass JS_FRIEND_API(PerfMeasurement)\n{\n  protected:\n    // Implementation-specific data, if any.\n    void* impl;\n\n  public:\n    /*\n     * Events that may be measured.  Taken directly from the list of\n     * \"generalized hardware performance event types\" in the Linux\n     * perf_event API, plus some of the \"software events\".\n     */\n    enum EventMask {\n        CPU_CYCLES          = 0x00000001,\n        INSTRUCTIONS        = 0x00000002,\n        CACHE_REFERENCES    = 0x00000004,\n        CACHE_MISSES        = 0x00000008,\n        BRANCH_INSTRUCTIONS = 0x00000010,\n        BRANCH_MISSES       = 0x00000020,\n        BUS_CYCLES          = 0x00000040,\n        PAGE_FAULTS         = 0x00000080,\n        MAJOR_PAGE_FAULTS   = 0x00000100,\n        CONTEXT_SWITCHES    = 0x00000200,\n        CPU_MIGRATIONS      = 0x00000400,\n\n        ALL                 = 0x000007ff,\n        NUM_MEASURABLE_EVENTS  = 11\n    };\n\n    /*\n     * Bitmask of events that will be measured when this object is\n     * active (between Start() and Stop()).  This may differ from the\n     * bitmask passed to the constructor if the platform does not\n     * support measuring all of the requested events.\n     */\n    const EventMask eventsMeasured;\n\n    /*\n     * Counters for each measurable event.\n     * Immediately after one of these objects is created, all of the\n     * counters for enabled events will be zero, and all of the\n     * counters for disabled events will be uint64_t(-1).\n     */\n    uint64_t cpu_cycles;\n    uint64_t instructions;\n    uint64_t cache_references;\n    uint64_t cache_misses;\n    uint64_t branch_instructions;\n    uint64_t branch_misses;\n    uint64_t bus_cycles;\n    uint64_t page_faults;\n    uint64_t major_page_faults;\n    uint64_t context_switches;\n    uint64_t cpu_migrations;\n\n    /*\n     * Prepare to measure the indicated set of events.  If not all of\n     * the requested events can be measured on the current platform,\n     * then the eventsMeasured bitmask will only include the subset of\n     * |toMeasure| corresponding to the events that can be measured.\n     */\n    PerfMeasurement(EventMask toMeasure);\n\n    /* Done with this set of measurements, tear down OS-level state. */\n    ~PerfMeasurement();\n\n    /* Start a measurement cycle. */\n    void start();\n\n    /*\n     * End a measurement cycle, and for each enabled counter, add the\n     * number of measured events of that type to the appropriate\n     * visible variable.\n     */\n    void stop();\n\n    /* Reset all enabled counters to zero. */\n    void reset();\n\n    /*\n     * True if this platform supports measuring _something_, i.e. it's\n     * not using the stub implementation.\n     */\n    static bool canMeasureSomething();\n};\n\n/* Inject a Javascript wrapper around the above C++ class into the\n * Javascript object passed as an argument (this will normally be a\n * global object).  The JS-visible API is identical to the C++ API.\n */\nextern JS_FRIEND_API(JSObject*)\n    RegisterPerfMeasurement(JSContext *cx, JSObject *global);\n\n/*\n * Given a jsval which contains an instance of the aforementioned\n * wrapper class, extract the C++ object.  Returns NULL if the\n * jsval is not an instance of the wrapper.\n */\nextern JS_FRIEND_API(PerfMeasurement*)\n    ExtractPerfMeasurement(jsval wrapper);\n\n} // namespace JS\n\n#endif /* perf_jsperf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsprf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprf_h\n#define jsprf_h\n\n/*\n** API for PR printf like routines. Supports the following formats\n**      %d - decimal\n**      %u - unsigned decimal\n**      %x - unsigned hex\n**      %X - unsigned uppercase hex\n**      %o - unsigned octal\n**      %hd, %hu, %hx, %hX, %ho - 16-bit versions of above\n**      %ld, %lu, %lx, %lX, %lo - 32-bit versions of above\n**      %lld, %llu, %llx, %llX, %llo - 64 bit versions of above\n**      %s - ascii string\n**      %hs - ucs2 string\n**      %c - character\n**      %p - pointer (deals with machine dependent pointer size)\n**      %f - float\n**      %g - float\n*/\n\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"jstypes.h\"\n\n/*\n** sprintf into a fixed size buffer. Guarantees that a NUL is at the end\n** of the buffer. Returns the length of the written output, NOT including\n** the NUL, or (uint32_t)-1 if an error occurs.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);\n\n/*\n** sprintf into a malloc'd buffer. Return a pointer to the malloc'd\n** buffer on success, NULL on failure. Call \"JS_smprintf_free\" to release\n** the memory returned.\n*/\nextern JS_PUBLIC_API(char*) JS_smprintf(const char *fmt, ...);\n\n/*\n** Free the memory allocated, for the caller, by JS_smprintf\n*/\nextern JS_PUBLIC_API(void) JS_smprintf_free(char *mem);\n\n/*\n** \"append\" sprintf into a malloc'd buffer. \"last\" is the last value of\n** the malloc'd buffer. sprintf will append data to the end of last,\n** growing it as necessary using realloc. If last is NULL, JS_sprintf_append\n** will allocate the initial string. The return value is the new value of\n** last for subsequent calls, or NULL if there is a malloc failure.\n*/\nextern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...);\n\n/*\n** sprintf into a function. The function \"f\" is called with a string to\n** place into the output. \"arg\" is an opaque pointer used by the stuff\n** function to hold any state needed to do the storage of the output\n** data. The return value is a count of the number of characters fed to\n** the stuff function, or (uint32_t)-1 if an error occurs.\n*/\ntypedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);\n\nextern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);\n\n/*\n** va_list forms of the above.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsmprintf(const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsprintf_append(char *last, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(uint32_t) JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap);\n\n#endif /* jsprf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsprototypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A higher-order macro for enumerating all JSProtoKey values. */\n\n#ifndef jsprototypes_h\n#define jsprototypes_h\n\n#include \"jsversion.h\"\n\n/*\n * Enumerator codes in the second column must not change -- they are part of\n * the JS XDR API.  Also note the symbols in the third column are extern \"C\";\n * clients should use extern \"C\" {} as appropriate when using this macro.\n */\n\n#define JS_FOR_EACH_PROTOTYPE(macro) \\\n    macro(Null,                   0,     js_InitNullClass) \\\n    macro(Object,                 1,     js_InitObjectClass) \\\n    macro(Function,               2,     js_InitFunctionClass) \\\n    macro(Array,                  3,     js_InitArrayClass) \\\n    macro(Boolean,                4,     js_InitBooleanClass) \\\n    macro(JSON,                   5,     js_InitJSONClass) \\\n    macro(Date,                   6,     js_InitDateClass) \\\n    macro(Math,                   7,     js_InitMathClass) \\\n    macro(Number,                 8,     js_InitNumberClass) \\\n    macro(String,                 9,     js_InitStringClass) \\\n    macro(RegExp,                10,     js_InitRegExpClass) \\\n    macro(Error,                 11,     js_InitExceptionClasses) \\\n    macro(InternalError,         12,     js_InitExceptionClasses) \\\n    macro(EvalError,             13,     js_InitExceptionClasses) \\\n    macro(RangeError,            14,     js_InitExceptionClasses) \\\n    macro(ReferenceError,        15,     js_InitExceptionClasses) \\\n    macro(SyntaxError,           16,     js_InitExceptionClasses) \\\n    macro(TypeError,             17,     js_InitExceptionClasses) \\\n    macro(URIError,              18,     js_InitExceptionClasses) \\\n    macro(Iterator,              19,     js_InitIteratorClasses) \\\n    macro(StopIteration,         20,     js_InitIteratorClasses) \\\n    macro(ArrayBuffer,           21,     js_InitTypedArrayClasses) \\\n    macro(Int8Array,             22,     js_InitTypedArrayClasses) \\\n    macro(Uint8Array,            23,     js_InitTypedArrayClasses) \\\n    macro(Int16Array,            24,     js_InitTypedArrayClasses) \\\n    macro(Uint16Array,           25,     js_InitTypedArrayClasses) \\\n    macro(Int32Array,            26,     js_InitTypedArrayClasses) \\\n    macro(Uint32Array,           27,     js_InitTypedArrayClasses) \\\n    macro(Float32Array,          28,     js_InitTypedArrayClasses) \\\n    macro(Float64Array,          29,     js_InitTypedArrayClasses) \\\n    macro(Uint8ClampedArray,     30,     js_InitTypedArrayClasses) \\\n    macro(Proxy,                 31,     js_InitProxyClass) \\\n    macro(WeakMap,               32,     js_InitWeakMapClass) \\\n    macro(Map,                   33,     js_InitMapClass) \\\n    macro(Set,                   34,     js_InitSetClass) \\\n    macro(DataView,              35,     js_InitTypedArrayClasses) \\\n    macro(ParallelArray,         36,     js_InitParallelArrayClass) \\\n    macro(Intl,                  37,     js_InitIntlClass) \\\n    macro(Type,                  38,     js_InitBinaryDataClasses) \\\n    macro(Data,                  39,     js_InitBinaryDataClasses) \\\n    macro(uint8,                 40,     js_InitBinaryDataClasses) \\\n    macro(uint16,                41,     js_InitBinaryDataClasses) \\\n    macro(uint32,                42,     js_InitBinaryDataClasses) \\\n    macro(uint64,                43,     js_InitBinaryDataClasses) \\\n    macro(int8,                  44,     js_InitBinaryDataClasses) \\\n    macro(int16,                 45,     js_InitBinaryDataClasses) \\\n    macro(int32,                 46,     js_InitBinaryDataClasses) \\\n    macro(int64,                 47,     js_InitBinaryDataClasses) \\\n    macro(float32,               48,     js_InitBinaryDataClasses) \\\n    macro(float64,               49,     js_InitBinaryDataClasses) \\\n    macro(ArrayType,             50,     js_InitBinaryDataClasses) \\\n    macro(StructType,            51,     js_InitBinaryDataClasses) \\\n    macro(ArrayTypeObject,       52,     js_InitBinaryDataClasses) \\\n\n#endif /* jsprototypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsproxy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsproxy_h\n#define jsproxy_h\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nnamespace js {\n\nclass JS_FRIEND_API(Wrapper);\n\n/*\n * A proxy is a JSObject that implements generic behavior by providing custom\n * implementations for each object trap. The implementation for each trap is\n * provided by a C++ object stored on the proxy, known as its handler.\n *\n * A major use case for proxies is to forward each trap to another object,\n * known as its target. The target can be an arbitrary C++ object. Not every\n * proxy has the notion of a target, however.\n *\n * Proxy traps are grouped into fundamental and derived traps. Every proxy has\n * to at least provide implementations for the fundamental traps, but the\n * derived traps can be implemented in terms of the fundamental ones\n * BaseProxyHandler provides implementations of the derived traps in terms of\n * the (pure virtual) fundamental traps.\n *\n * To minimize code duplication, a set of abstract proxy handler classes is\n * provided, from which other handlers may inherit. These abstract classes\n * are organized in the following hierarchy:\n *\n * BaseProxyHandler\n * |\n * DirectProxyHandler\n * |\n * Wrapper\n */\n\n/*\n * BaseProxyHandler is the most generic kind of proxy handler. It does not make\n * any assumptions about the target. Consequently, it does not provide any\n * default implementation for the fundamental traps. It does, however, implement\n * the derived traps in terms of the fundamental ones. This allows consumers of\n * this class to define any custom behavior they want.\n */\nclass JS_FRIEND_API(BaseProxyHandler)\n{\n    void *mFamily;\n    bool mHasPrototype;\n    bool mHasPolicy;\n  protected:\n    // Subclasses may set this in their constructor.\n    void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }\n    void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; }\n\n  public:\n    explicit BaseProxyHandler(void *family);\n    virtual ~BaseProxyHandler();\n\n    bool hasPrototype() {\n        return mHasPrototype;\n    }\n\n    bool hasPolicy() {\n        return mHasPolicy;\n    }\n\n    inline void *family() {\n        return mFamily;\n    }\n\n    virtual bool isOuterWindow() {\n        return false;\n    }\n\n    virtual bool finalizeInBackground(Value priv) {\n        /*\n         * Called on creation of a proxy to determine whether its finalize\n         * method can be finalized on the background thread.\n         */\n        return true;\n    }\n\n    /* Policy enforcement traps.\n     *\n     * enter() allows the policy to specify whether the caller may perform |act|\n     * on the proxy's |id| property. In the case when |act| is CALL, |id| is\n     * generally JSID_VOID.\n     *\n     * The |act| parameter to enter() specifies the action being performed.\n     * If |bp| is false, the trap suggests that the caller throw (though it\n     * may still decide to squelch the error).\n     */\n    enum Action {\n        GET,\n        SET,\n        CALL\n    };\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,\n                       bool *bp);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) = 0;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) = 0;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) = 0;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) = 0;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp);\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp);\n    virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) = 0;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    virtual const char *className(JSContext *cx, HandleObject proxy);\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    virtual void finalize(JSFreeOp *fop, JSObject *proxy);\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp, bool *present);\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    /* See comment for weakmapKeyDelegateOp in jsclass.h. */\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/*\n * DirectProxyHandler includes a notion of a target object. All traps are\n * reimplemented such that they forward their behavior to the target. This\n * allows consumers of this class to forward to another object as transparently\n * and efficiently as possible.\n */\nclass JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler\n{\n  public:\n    explicit DirectProxyHandler(void *family);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,\n                         bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy,\n                           AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id,\n                     bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id,\n                        bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject proxy,\n                      AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy,\n                                 RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */\nclass Proxy\n{\n  public:\n    /* ES5 Harmony fundamental proxy traps. */\n    static bool preventExtensions(JSContext *cx, HandleObject proxy);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                      PropertyDescriptor *desc, unsigned flags);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                      MutableHandleValue vp);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                         PropertyDescriptor *desc, unsigned flags);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                         MutableHandleValue vp);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v);\n    static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n\n    /* ES5 Harmony derived proxy traps. */\n    static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    MutableHandleValue vp);\n    static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                                    uint32_t index, MutableHandleValue vp, bool *present);\n    static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    bool strict, MutableHandleValue vp);\n    static bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    static bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible);\n    static bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    static bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    static const char *className(JSContext *cx, HandleObject proxy);\n    static JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    static bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    static bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    static bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static JSObject * const LazyProto;\n};\n\ninline bool IsObjectProxyClass(const Class *clasp)\n{\n    return clasp == js::ObjectProxyClassPtr || clasp == js::OuterWindowProxyClassPtr;\n}\n\ninline bool IsFunctionProxyClass(const Class *clasp)\n{\n    return clasp == js::FunctionProxyClassPtr;\n}\n\ninline bool IsProxyClass(const Class *clasp)\n{\n    return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp);\n}\n\ninline bool IsObjectProxy(JSObject *obj)\n{\n    return IsObjectProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsFunctionProxy(JSObject *obj)\n{\n    return IsFunctionProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsProxy(JSObject *obj)\n{\n    return IsProxyClass(GetObjectClass(obj));\n}\n\n/*\n * These are part of the API.\n *\n * NOTE: PROXY_PRIVATE_SLOT is 0 because that way slot 0 is usable by API\n * clients for both proxy and non-proxy objects.  So an API client that only\n * needs to store one slot's worth of data doesn't need to branch on what sort\n * of object it has.\n */\nconst uint32_t PROXY_PRIVATE_SLOT = 0;\nconst uint32_t PROXY_HANDLER_SLOT = 1;\nconst uint32_t PROXY_EXTRA_SLOT   = 2;\n\ninline BaseProxyHandler *\nGetProxyHandler(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return (BaseProxyHandler *) GetReservedSlot(obj, PROXY_HANDLER_SLOT).toPrivate();\n}\n\ninline const Value &\nGetProxyPrivate(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_PRIVATE_SLOT);\n}\n\ninline JSObject *\nGetProxyTargetObject(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetProxyPrivate(obj).toObjectOrNull();\n}\n\ninline const Value &\nGetProxyExtra(JSObject *obj, size_t n)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_EXTRA_SLOT + n);\n}\n\ninline void\nSetProxyHandler(JSObject *obj, BaseProxyHandler *handler)\n{\n    JS_ASSERT(IsProxy(obj));\n    SetReservedSlot(obj, PROXY_HANDLER_SLOT, PrivateValue(handler));\n}\n\ninline void\nSetProxyExtra(JSObject *obj, size_t n, const Value &extra)\n{\n    JS_ASSERT(IsProxy(obj));\n    JS_ASSERT(n <= 1);\n    SetReservedSlot(obj, PROXY_EXTRA_SLOT + n, extra);\n}\n\nenum ProxyCallable {\n    ProxyNotCallable = false,\n    ProxyIsCallable = true\n};\n\nJS_FRIEND_API(JSObject *)\nNewProxyObject(JSContext *cx, BaseProxyHandler *handler, HandleValue priv,\n               JSObject *proto, JSObject *parent, ProxyCallable callable = ProxyNotCallable);\n\nJSObject *\nRenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv);\n\nclass JS_FRIEND_API(AutoEnterPolicy)\n{\n  public:\n    typedef BaseProxyHandler::Action Action;\n    AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler,\n                    HandleObject wrapper, HandleId id, Action act, bool mayThrow)\n#ifdef DEBUG\n        : context(NULL)\n#endif\n    {\n        allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv)\n                                     : true;\n        recordEnter(cx, wrapper, id);\n        // We want to throw an exception if all of the following are true:\n        // * The policy disallowed access.\n        // * The policy set rv to false, indicating that we should throw.\n        // * The caller did not instruct us to ignore exceptions.\n        // * The policy did not throw itself.\n        if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx))\n            reportError(cx, id);\n    }\n\n    virtual ~AutoEnterPolicy() { recordLeave(); }\n    inline bool allowed() { return allow; }\n    inline bool returnValue() { JS_ASSERT(!allowed()); return rv; }\n\n  protected:\n    // no-op constructor for subclass\n    AutoEnterPolicy()\n#ifdef DEBUG\n        : context(NULL)\n#endif\n        {};\n    void reportError(JSContext *cx, jsid id);\n    bool allow;\n    bool rv;\n\n#ifdef DEBUG\n    JSContext *context;\n    mozilla::Maybe<HandleObject> enteredProxy;\n    mozilla::Maybe<HandleId> enteredId;\n    // NB: We explicitly don't track the entered action here, because sometimes\n    // SET traps do an implicit GET during their implementation, leading to\n    // spurious assertions.\n    AutoEnterPolicy *prev;\n    void recordEnter(JSContext *cx, HandleObject proxy, HandleId id);\n    void recordLeave();\n\n    friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id);\n#else\n    inline void recordEnter(JSContext *cx, JSObject *proxy, jsid id) {}\n    inline void recordLeave() {}\n#endif\n\n};\n\n#ifdef DEBUG\nclass JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {\npublic:\n    AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id)\n    {\n        allow = true;\n        recordEnter(cx, proxy, id);\n    }\n};\n#else\nclass JS_FRIEND_API(AutoWaivePolicy) {\n    public: AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) {};\n};\n#endif\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSObject *)\njs_InitProxyClass(JSContext *cx, JS::HandleObject obj);\n\n#endif /* jsproxy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsprvtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprvtd_h\n#define jsprvtd_h\n/*\n * JS private typename definitions.\n *\n * This header is included only in other .h files, for convenience and for\n * simplicity of type naming.  The alternative for structures is to use tags,\n * which are named the same as their typedef names (legal in C/C++, and less\n * noisy than suffixing the typedef name with \"Struct\" or \"Str\").  Instead,\n * all .h files that include this file may use the same typedef name, whether\n * declaring a pointer to struct type, or defining a member of struct type.\n *\n * A few fundamental scalar types are defined here too.  Neither the scalar\n * nor the struct typedefs should change much, therefore the nearly-global\n * make dependency induced by this file should not prove painful.\n */\n\n#include \"jsapi.h\"\n#include \"jsutil.h\"\n\n#include \"js/HashTable.h\"\n#include \"js/Vector.h\"\n\n/*\n * Convenience constants.\n */\n#define JS_BITS_PER_UINT32_LOG2 5\n#define JS_BITS_PER_UINT32      32\n\n/* The alignment required of objects stored in GC arenas. */\nstatic const unsigned JS_GCTHING_ALIGN = 8;\nstatic const unsigned JS_GCTHING_ZEROBITS = 3;\n\n/* Scalar typedefs. */\ntypedef uint8_t     jsbytecode;\ntypedef uint8_t     jssrcnote;\ntypedef uintptr_t   jsatomid;\n\n/* Struct typedefs. */\ntypedef struct JSGCThing            JSGCThing;\ntypedef struct JSGenerator          JSGenerator;\ntypedef struct JSNativeEnumerator   JSNativeEnumerator;\ntypedef struct JSTryNote            JSTryNote;\n\n/* Friend \"Advanced API\" typedefs. */\ntypedef struct JSAtomState          JSAtomState;\ntypedef struct JSCodeSpec           JSCodeSpec;\ntypedef struct JSPrinter            JSPrinter;\ntypedef struct JSStackHeader        JSStackHeader;\ntypedef struct JSSubString          JSSubString;\ntypedef struct JSSpecializedNative  JSSpecializedNative;\n\n/* String typedefs. */\nclass JSDependentString;\nclass JSExtensibleString;\nclass JSExternalString;\nclass JSLinearString;\nclass JSRope;\nclass JSAtom;\nclass JSWrapper;\n\nnamespace js {\n\nstruct ArgumentsData;\nstruct Class;\n\nclass AutoNameVector;\nclass RegExpGuard;\nclass RegExpObject;\nclass RegExpObjectBuilder;\nclass RegExpShared;\nclass RegExpStatics;\nclass MatchPairs;\nclass PropertyName;\nclass LazyScript;\n\nenum RegExpFlag\n{\n    IgnoreCaseFlag  = 0x01,\n    GlobalFlag      = 0x02,\n    MultilineFlag   = 0x04,\n    StickyFlag      = 0x08,\n\n    NoFlags         = 0x00,\n    AllFlags        = 0x0f\n};\n\nclass StringBuffer;\n\nclass FrameRegs;\nclass StackFrame;\nclass ScriptFrameIter;\n\nclass Proxy;\nclass JS_FRIEND_API(AutoEnterPolicy);\nclass JS_FRIEND_API(BaseProxyHandler);\nclass JS_FRIEND_API(Wrapper);\nclass JS_FRIEND_API(CrossCompartmentWrapper);\n\nclass TempAllocPolicy;\nclass RuntimeAllocPolicy;\n\nclass GlobalObject;\n\ntemplate <typename K,\n          typename V,\n          size_t InlineElems>\nclass InlineMap;\n\nclass LifoAlloc;\n\nclass Shape;\n\nclass Breakpoint;\nclass BreakpointSite;\nclass Debugger;\nclass WatchpointMap;\n\n/*\n * Env is the type of what ES5 calls \"lexical environments\" (runtime\n * activations of lexical scopes). This is currently just JSObject, and is\n * implemented by Call, Block, With, and DeclEnv objects, among others--but\n * environments and objects are really two different concepts.\n */\ntypedef JSObject Env;\n\ntypedef JSNative             Native;\ntypedef JSParallelNative     ParallelNative;\ntypedef JSThreadSafeNative   ThreadSafeNative;\ntypedef JSPropertyOp         PropertyOp;\ntypedef JSStrictPropertyOp   StrictPropertyOp;\ntypedef JSPropertyDescriptor PropertyDescriptor;\n\nstruct SourceCompressionToken;\n\nnamespace frontend {\n\nstruct BytecodeEmitter;\nstruct Definition;\nclass FullParseHandler;\nclass FunctionBox;\nclass ObjectBox;\nstruct Token;\nstruct TokenPos;\nclass TokenStream;\nclass ParseMapPool;\nclass ParseNode;\n\ntemplate <typename ParseHandler>\nclass Parser;\n\n} /* namespace frontend */\n\nnamespace analyze {\n\nstruct LifetimeVariable;\nclass LoopAnalysis;\nclass ScriptAnalysis;\nclass SlotValue;\nclass SSAValue;\nclass SSAUseChain;\n\n} /* namespace analyze */\n\nnamespace types {\n\nclass TypeSet;\nstruct TypeCallsite;\nstruct TypeObject;\nstruct TypeCompartment;\n\n} /* namespace types */\n\ntypedef JS::Handle<Shape*>             HandleShape;\ntypedef JS::Handle<types::TypeObject*> HandleTypeObject;\ntypedef JS::Handle<JSAtom*>            HandleAtom;\ntypedef JS::Handle<PropertyName*>      HandlePropertyName;\n\ntypedef JS::MutableHandle<Shape*>      MutableHandleShape;\ntypedef JS::MutableHandle<JSAtom*>     MutableHandleAtom;\n\ntypedef JS::Rooted<Shape*>             RootedShape;\ntypedef JS::Rooted<types::TypeObject*> RootedTypeObject;\ntypedef JS::Rooted<JSAtom*>            RootedAtom;\ntypedef JS::Rooted<PropertyName*>      RootedPropertyName;\n\nenum XDRMode {\n    XDR_ENCODE,\n    XDR_DECODE\n};\n\ntemplate <XDRMode mode>\nclass XDRState;\n\nclass FreeOp;\n\nstruct IdValuePair\n{\n    jsid id;\n    Value value;\n\n    IdValuePair() {}\n    IdValuePair(jsid idArg)\n      : id(idArg), value(UndefinedValue())\n    {}\n};\n\n} /* namespace js */\n\nnamespace JSC {\n\nclass ExecutableAllocator;\n\n} /* namespace JSC */\n\nnamespace WTF {\n\nclass BumpPointerAllocator;\n\n} /* namespace WTF */\n\n/* \"Friend\" types used by jscntxt.h and jsdbgapi.h. */\ntypedef enum JSTrapStatus {\n    JSTRAP_ERROR,\n    JSTRAP_CONTINUE,\n    JSTRAP_RETURN,\n    JSTRAP_THROW,\n    JSTRAP_LIMIT\n} JSTrapStatus;\n\ntypedef JSTrapStatus\n(* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                  jsval closure);\n\ntypedef JSTrapStatus\n(* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                    void *closure);\n\ntypedef JSTrapStatus\n(* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                      void *closure);\n\ntypedef JSTrapStatus\n(* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                void *closure);\n\ntypedef JSBool\n(* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old,\n                        jsval *newp, void *closure);\n\n/* called just after script creation */\ntypedef void\n(* JSNewScriptHook)(JSContext  *cx,\n                    const char *filename,  /* URL of script */\n                    unsigned   lineno,     /* first line */\n                    JSScript   *script,\n                    JSFunction *fun,\n                    void       *callerdata);\n\n/* called just before script destruction */\ntypedef void\n(* JSDestroyScriptHook)(JSFreeOp *fop,\n                        JSScript *script,\n                        void     *callerdata);\n\ntypedef void\n(* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str,\n                    size_t length, void **listenerTSData, void *closure);\n\n/* js::ObjectOps function pointer typedefs. */\n\n/*\n * A generic type for functions mapping an object to another object, or null\n * if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSObjectOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/* Signature for class initialization ops. */\ntypedef JSObject *\n(* JSClassInitializerOp)(JSContext *cx, JS::HandleObject obj);\n\n/*\n * Hook that creates an iterator object for a given object. Returns the\n * iterator object or null if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, JSBool keysonly);\n\n\n#endif /* jsprvtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jspubtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jspubtd_h\n#define jspubtd_h\n\n/*\n * JS public API typedefs.\n */\n\n#include \"mozilla/PodOperations.h\"\n\n#include \"jsprototypes.h\"\n#include \"jstypes.h\"\n\n#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || defined(DEBUG)\n# define JSGC_TRACK_EXACT_ROOTS\n#endif\n\nnamespace JS {\n\n/*\n * Allow headers to reference JS::Value without #including the whole jsapi.h.\n * Unfortunately, typedefs (hence jsval) cannot be declared.\n */\nclass Value;\n\ntemplate <typename T>\nclass Rooted;\n\nclass JS_PUBLIC_API(AutoGCRooter);\n\nstruct Zone;\n\n} /* namespace JS */\n\n/*\n * In release builds, jsid is defined to be an integral type. This\n * prevents many bugs from being caught at compile time. E.g.:\n *\n *  jsid id = ...\n *  if (id == JS_TRUE)  // error\n *    ...\n *\n *  size_t n = id;      // error\n *\n * To catch more errors, jsid is given a struct type in C++ debug builds.\n * Struct assignment and (in C++) operator== allow correct code to be mostly\n * oblivious to the change. This feature can be explicitly disabled in debug\n * builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES.\n */\n// Needed for cocos2d-js\n#define JS_NO_JSVAL_JSID_STRUCT_TYPES\n# if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)\n#  define JS_USE_JSID_STRUCT_TYPES\n# endif\n\n# ifdef JS_USE_JSID_STRUCT_TYPES\nstruct jsid\n{\n    size_t asBits;\n    bool operator==(jsid rhs) const { return asBits == rhs.asBits; }\n    bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }\n};\n#  define JSID_BITS(id) (id.asBits)\n# else  /* defined(JS_USE_JSID_STRUCT_TYPES) */\ntypedef ptrdiff_t jsid;\n#  define JSID_BITS(id) (id)\n# endif  /* defined(JS_USE_JSID_STRUCT_TYPES) */\n\n#ifdef WIN32\ntypedef wchar_t   jschar;\n#else\ntypedef uint16_t  jschar;\n#endif\n\n/*\n * Run-time version enumeration.  For compile-time version checking, please use\n * the JS_HAS_* macros in jsversion.h, or use MOZJS_MAJOR_VERSION,\n * MOZJS_MINOR_VERSION, MOZJS_PATCH_VERSION, and MOZJS_ALPHA definitions.\n */\ntypedef enum JSVersion {\n    JSVERSION_ECMA_3  = 148,\n    JSVERSION_1_6     = 160,\n    JSVERSION_1_7     = 170,\n    JSVERSION_1_8     = 180,\n    JSVERSION_ECMA_5  = 185,\n    JSVERSION_DEFAULT = 0,\n    JSVERSION_UNKNOWN = -1,\n    JSVERSION_LATEST  = JSVERSION_ECMA_5\n} JSVersion;\n\n/* Result of typeof operator enumeration. */\ntypedef enum JSType {\n    JSTYPE_VOID,                /* undefined */\n    JSTYPE_OBJECT,              /* object */\n    JSTYPE_FUNCTION,            /* function */\n    JSTYPE_STRING,              /* string */\n    JSTYPE_NUMBER,              /* number */\n    JSTYPE_BOOLEAN,             /* boolean */\n    JSTYPE_NULL,                /* null */\n    JSTYPE_LIMIT\n} JSType;\n\n/* Dense index into cached prototypes and class atoms for standard objects. */\ntypedef enum JSProtoKey {\n#define PROTOKEY_AND_INITIALIZER(name,code,init) JSProto_##name = code,\n    JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)\n#undef JS_PROTO\n    JSProto_LIMIT\n} JSProtoKey;\n\n/* js_CheckAccess mode enumeration. */\ntypedef enum JSAccessMode {\n    JSACC_PROTO  = 0,           /* XXXbe redundant w.r.t. id */\n\n                                /*\n                                 * enum value #1 formerly called JSACC_PARENT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n                                /*\n                                 * enum value #2 formerly called JSACC_IMPORT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n    JSACC_WATCH  = 3,           /* a watchpoint on object foo for id 'bar' */\n    JSACC_READ   = 4,           /* a \"get\" of foo.bar */\n    JSACC_WRITE  = 8,           /* a \"set\" of foo.bar = baz */\n    JSACC_LIMIT\n} JSAccessMode;\n\n#define JSACC_TYPEMASK          (JSACC_WRITE - 1)\n\n/*\n * This enum type is used to control the behavior of a JSObject property\n * iterator function that has type JSNewEnumerate.\n */\ntypedef enum JSIterateOp {\n    /* Create new iterator state over enumerable properties. */\n    JSENUMERATE_INIT,\n\n    /* Create new iterator state over all properties. */\n    JSENUMERATE_INIT_ALL,\n\n    /* Iterate once. */\n    JSENUMERATE_NEXT,\n\n    /* Destroy iterator state. */\n    JSENUMERATE_DESTROY\n} JSIterateOp;\n\n/* See JSVAL_TRACE_KIND and JSTraceCallback in jsapi.h. */\ntypedef enum {\n    JSTRACE_OBJECT,\n    JSTRACE_STRING,\n    JSTRACE_SCRIPT,\n\n    /*\n     * Trace kinds internal to the engine. The embedding can only see them if\n     * it implements JSTraceCallback.\n     */\n    JSTRACE_LAZY_SCRIPT,\n    JSTRACE_IONCODE,\n    JSTRACE_SHAPE,\n    JSTRACE_BASE_SHAPE,\n    JSTRACE_TYPE_OBJECT,\n    JSTRACE_LAST = JSTRACE_TYPE_OBJECT\n} JSGCTraceKind;\n\n/* Struct typedefs and class forward declarations. */\ntypedef struct JSClass                      JSClass;\ntypedef struct JSCompartment                JSCompartment;\ntypedef struct JSConstDoubleSpec            JSConstDoubleSpec;\ntypedef struct JSContext                    JSContext;\ntypedef struct JSCrossCompartmentCall       JSCrossCompartmentCall;\ntypedef struct JSErrorReport                JSErrorReport;\ntypedef struct JSExceptionState             JSExceptionState;\ntypedef struct JSFunctionSpec               JSFunctionSpec;\ntypedef struct JSIdArray                    JSIdArray;\ntypedef struct JSLocaleCallbacks            JSLocaleCallbacks;\ntypedef struct JSObjectMap                  JSObjectMap;\ntypedef struct JSPrincipals                 JSPrincipals;\ntypedef struct JSPropertyDescriptor         JSPropertyDescriptor;\ntypedef struct JSPropertyName               JSPropertyName;\ntypedef struct JSPropertySpec               JSPropertySpec;\ntypedef struct JSRuntime                    JSRuntime;\ntypedef struct JSSecurityCallbacks          JSSecurityCallbacks;\ntypedef struct JSStructuredCloneCallbacks   JSStructuredCloneCallbacks;\ntypedef struct JSStructuredCloneReader      JSStructuredCloneReader;\ntypedef struct JSStructuredCloneWriter      JSStructuredCloneWriter;\ntypedef struct JSTracer                     JSTracer;\n\nclass                                       JSFlatString;\nclass                                       JSFunction;\nclass                                       JSObject;\nclass                                       JSScript;\nclass                                       JSStableString;  // long story\nclass                                       JSString;\n\n#ifdef JS_THREADSAFE\ntypedef struct PRCallOnceType    JSCallOnceType;\n#else\ntypedef JSBool                   JSCallOnceType;\n#endif\ntypedef JSBool                 (*JSInitCallback)(void);\n\nnamespace JS {\nnamespace shadow {\n\nstruct Runtime\n{\n    /* Restrict zone access during Minor GC. */\n    bool needsBarrier_;\n\n#ifdef JSGC_GENERATIONAL\n    /* Allow inlining of Nursery::isInside. */\n    uintptr_t gcNurseryStart_;\n    uintptr_t gcNurseryEnd_;\n#endif\n\n    Runtime()\n      : needsBarrier_(false)\n#ifdef JSGC_GENERATIONAL\n      , gcNurseryStart_(0)\n      , gcNurseryEnd_(0)\n#endif\n    {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Parallel operations in general can have one of three states. They may\n * succeed, fail, or \"bail\", where bail indicates that the code encountered an\n * unexpected condition and should be re-run sequentially. Different\n * subcategories of the \"bail\" state are encoded as variants of TP_RETRY_*.\n */\nenum ParallelResult { TP_SUCCESS, TP_RETRY_SEQUENTIALLY, TP_RETRY_AFTER_GC, TP_FATAL };\n\nstruct ThreadSafeContext;\nstruct ForkJoinSlice;\nclass ExclusiveContext;\n\nclass Allocator;\n\nclass SkipRoot;\n\nenum ThingRootKind\n{\n    THING_ROOT_OBJECT,\n    THING_ROOT_SHAPE,\n    THING_ROOT_BASE_SHAPE,\n    THING_ROOT_TYPE_OBJECT,\n    THING_ROOT_STRING,\n    THING_ROOT_ION_CODE,\n    THING_ROOT_SCRIPT,\n    THING_ROOT_ID,\n    THING_ROOT_PROPERTY_ID,\n    THING_ROOT_VALUE,\n    THING_ROOT_TYPE,\n    THING_ROOT_BINDINGS,\n    THING_ROOT_PROPERTY_DESCRIPTOR,\n    THING_ROOT_LIMIT\n};\n\ntemplate <typename T>\nstruct RootKind;\n\n/*\n * Specifically mark the ThingRootKind of externally visible types, so that\n * JSAPI users may use JSRooted... types without having the class definition\n * available.\n */\ntemplate<typename T, ThingRootKind Kind>\nstruct SpecificRootKind\n{\n    static ThingRootKind rootKind() { return Kind; }\n};\n\ntemplate <> struct RootKind<JSObject *> : SpecificRootKind<JSObject *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSFlatString *> : SpecificRootKind<JSFlatString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSFunction *> : SpecificRootKind<JSFunction *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSString *> : SpecificRootKind<JSString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSScript *> : SpecificRootKind<JSScript *, THING_ROOT_SCRIPT> {};\ntemplate <> struct RootKind<jsid> : SpecificRootKind<jsid, THING_ROOT_ID> {};\ntemplate <> struct RootKind<JS::Value> : SpecificRootKind<JS::Value, THING_ROOT_VALUE> {};\n\nstruct ContextFriendFields\n{\n  protected:\n    JSRuntime *const     runtime_;\n\n    /* The current compartment. */\n    JSCompartment       *compartment_;\n\n    /* The current zone. */\n    JS::Zone            *zone_;\n\n  public:\n    explicit ContextFriendFields(JSRuntime *rt)\n      : runtime_(rt), compartment_(NULL), zone_(NULL), autoGCRooters(NULL)\n    {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        mozilla::PodArrayZero(thingGCRooters);\n#endif\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n        skipGCRooters = NULL;\n#endif\n    }\n\n    static const ContextFriendFields *get(const JSContext *cx) {\n        return reinterpret_cast<const ContextFriendFields *>(cx);\n    }\n\n    static ContextFriendFields *get(JSContext *cx) {\n        return reinterpret_cast<ContextFriendFields *>(cx);\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Stack of thread-stack-allocated GC roots. */\n    JS::AutoGCRooter   *autoGCRooters;\n\n    friend JSRuntime *GetRuntime(const JSContext *cx);\n    friend JSCompartment *GetContextCompartment(const JSContext *cx);\n    friend JS::Zone *GetContextZone(const JSContext *cx);\n};\n\nclass PerThreadData;\n\nstruct PerThreadDataFriendFields\n{\n  private:\n    // Note: this type only exists to permit us to derive the offset of\n    // the perThread data within the real JSRuntime* type in a portable\n    // way.\n    struct RuntimeDummy : JS::shadow::Runtime\n    {\n        struct PerThreadDummy {\n            void *field1;\n            uintptr_t field2;\n#ifdef DEBUG\n            uint64_t field3;\n#endif\n        } mainThread;\n    };\n\n  public:\n\n    PerThreadDataFriendFields();\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Limit pointer for checking native stack consumption. */\n    uintptr_t nativeStackLimit;\n\n    static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);\n\n    static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) {\n        return reinterpret_cast<PerThreadDataFriendFields *>(pt);\n    }\n\n    static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<PerThreadDataFriendFields *>(\n            reinterpret_cast<char*>(rt) + RuntimeMainThreadOffset);\n    }\n\n    static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<const PerThreadDataFriendFields *>(\n            reinterpret_cast<const char*>(rt) + RuntimeMainThreadOffset);\n    }\n};\n\n} /* namespace js */\n\n#endif /* jspubtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jstypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n** File:                jstypes.h\n** Description: Definitions of NSPR's basic types\n**\n** Prototypes and macros used to make up for deficiencies in ANSI environments\n** that we have found.\n**\n** Since we do not wrap <stdlib.h> and all the other standard headers, authors\n** of portable code will not know in general that they need these definitions.\n** Instead of requiring these authors to find the dependent uses in their code\n** and take the following steps only in those C files, we take steps once here\n** for all C files.\n**/\n\n#ifndef jstypes_h\n#define jstypes_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js-config.h\"\n\n/***********************************************************************\n** MACROS:      JS_EXTERN_API\n**              JS_EXPORT_API\n** DESCRIPTION:\n**      These are only for externally visible routines and globals.  For\n**      internal routines, just use \"extern\" for type checking and that\n**      will not export internal cross-file or forward-declared symbols.\n**      Define a macro for declaring procedures return types. We use this to\n**      deal with windoze specific type hackery for DLL definitions. Use\n**      JS_EXTERN_API when the prototype for the method is declared. Use\n**      JS_EXPORT_API for the implementation of the method.\n**\n** Example:\n**   in dowhim.h\n**     JS_EXTERN_API( void ) DoWhatIMean( void );\n**   in dowhim.c\n**     JS_EXPORT_API( void ) DoWhatIMean( void ) { return; }\n**\n**\n***********************************************************************/\n\n#define JS_EXTERN_API(type)  extern MOZ_EXPORT type\n#define JS_EXPORT_API(type)  MOZ_EXPORT type\n#define JS_EXPORT_DATA(type) MOZ_EXPORT type\n#define JS_IMPORT_API(type)  MOZ_IMPORT_API type\n#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type\n\n/*\n * The linkage of JS API functions differs depending on whether the file is\n * used within the JS library or not. Any source file within the JS\n * interpreter should define EXPORT_JS_API whereas any client of the library\n * should not. STATIC_JS_API is used to build JS as a static library.\n */\n#if defined(STATIC_JS_API)\n#  define JS_PUBLIC_API(t)   t\n#  define JS_PUBLIC_DATA(t)  t\n#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)\n#  define JS_PUBLIC_API(t)   MOZ_EXPORT t\n#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t\n#else\n#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t\n#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t\n#endif\n\n#define JS_FRIEND_API(t)    JS_PUBLIC_API(t)\n#define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)\n\n#if defined(_MSC_VER) && defined(_M_IX86)\n#define JS_FASTCALL __fastcall\n#elif defined(__GNUC__) && defined(__i386__)\n#define JS_FASTCALL __attribute__((fastcall))\n#else\n#define JS_FASTCALL\n#define JS_NO_FASTCALL\n#endif\n\n#ifndef JS_INLINE\n#define JS_INLINE MOZ_INLINE\n#endif\n\n#ifndef JS_ALWAYS_INLINE\n#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE\n#endif\n\n#ifndef JS_NEVER_INLINE\n#define JS_NEVER_INLINE MOZ_NEVER_INLINE\n#endif\n\n#ifndef JS_WARN_UNUSED_RESULT\n# if defined __GNUC__\n#  define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n# else\n#  define JS_WARN_UNUSED_RESULT\n# endif\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_MACRO\n**              JS_END_MACRO\n** DESCRIPTION:\n**      Macro body brackets so that macros with compound statement definitions\n**      behave syntactically more like functions when called.\n***********************************************************************/\n#define JS_BEGIN_MACRO  do {\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n# define JS_END_MACRO                                                         \\\n    } __pragma(warning(push)) __pragma(warning(disable:4127))                 \\\n    while (0) __pragma(warning(pop))\n#else\n# define JS_END_MACRO   } while (0)\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_EXTERN_C\n**              JS_END_EXTERN_C\n** DESCRIPTION:\n**      Macro shorthands for conditional C++ extern block delimiters.\n***********************************************************************/\n#define JS_BEGIN_EXTERN_C      MOZ_BEGIN_EXTERN_C\n#define JS_END_EXTERN_C        MOZ_END_EXTERN_C\n\n/***********************************************************************\n** MACROS:      JS_BIT\n**              JS_BITMASK\n** DESCRIPTION:\n** Bit masking macros.  XXX n must be <= 31 to be portable\n***********************************************************************/\n#define JS_BIT(n)       ((uint32_t)1 << (n))\n#define JS_BITMASK(n)   (JS_BIT(n) - 1)\n\n/***********************************************************************\n** MACROS:      JS_HOWMANY\n**              JS_ROUNDUP\n**              JS_MIN\n**              JS_MAX\n** DESCRIPTION:\n**      Commonly used macros for operations on compatible types.\n***********************************************************************/\n#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))\n#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))\n\n#include \"jscpucfg.h\"\n\n/*\n * Define JS_64BIT iff we are building in an environment with 64-bit\n * addresses.\n */\n#ifdef _MSC_VER\n# if defined(_M_X64) || defined(_M_AMD64)\n#  define JS_64BIT\n# endif\n#elif defined(__GNUC__)\n/* Additional GCC defines are when running on Solaris, AIX, and HPUX */\n# if defined(__x86_64__) || defined(__sparcv9) || \\\n        defined(__64BIT__) || defined(__LP64__)\n#  define JS_64BIT\n# endif\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */\n# if defined(__x86_64) || defined(__sparcv9)\n#  define JS_64BIT\n# endif\n#elif defined(__xlc__) || defined(__xlC__)        /* IBM XL C/C++ */\n# if defined(__64BIT__)\n#  define JS_64BIT\n# endif\n#elif defined(__HP_cc) || defined(__HP_aCC)       /* HP-UX cc/aCC */\n# if defined(__LP64__)\n#  define JS_64BIT\n# endif\n#else\n# error \"Implement me\"\n#endif\n\n\n/************************************************************************\n** TYPES:       JSBool\n** DESCRIPTION:\n**  Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE\n**      for clarity of target type in assignments and actual arguments. Use\n**      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans\n**      just as you would C int-valued conditions.\n************************************************************************/\ntypedef int JSBool;\n#define JS_TRUE (int)1\n#define JS_FALSE (int)0\n\n/***********************************************************************\n** MACROS:      JS_LIKELY\n**              JS_UNLIKELY\n** DESCRIPTION:\n**      These macros allow you to give a hint to the compiler about branch\n**      probability so that it can better optimize.  Use them like this:\n**\n**      if (JS_LIKELY(v == 1)) {\n**          ... expected code path ...\n**      }\n**\n**      if (JS_UNLIKELY(v == 0)) {\n**          ... non-expected code path ...\n**      }\n**\n***********************************************************************/\n#ifdef __GNUC__\n\n# define JS_LIKELY(x)   (__builtin_expect((x), 1))\n# define JS_UNLIKELY(x) (__builtin_expect((x), 0))\n\n#else\n\n# define JS_LIKELY(x)   (x)\n# define JS_UNLIKELY(x) (x)\n\n#endif\n\n/***********************************************************************\n** MACROS:      JS_ARRAY_LENGTH\n**              JS_ARRAY_END\n** DESCRIPTION:\n**      Macros to get the number of elements and the pointer to one past the\n**      last element of a C array. Use them like this:\n**\n**      jschar buf[10], *s;\n**      JSString *str;\n**      ...\n**      for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;\n**      ...\n**      str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));\n**      ...\n**\n***********************************************************************/\n\n#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])\n#define JS_ARRAY_END(array)    ((array) + JS_ARRAY_LENGTH(array))\n\n#define JS_BITS_PER_BYTE 8\n#define JS_BITS_PER_BYTE_LOG2 3\n\n#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)\n\n/***********************************************************************\n** MACROS:      JS_FUNC_TO_DATA_PTR\n**              JS_DATA_TO_FUNC_PTR\n** DESCRIPTION:\n**      Macros to convert between function and data pointers assuming that\n**      they have the same size. Use them like this:\n**\n**      JSPropertyOp nativeGetter;\n**      JSObject *scriptedGetter;\n**      ...\n**      scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter);\n**      ...\n**      nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter);\n**\n***********************************************************************/\n\n#ifdef __GNUC__\n# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (size_t) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (size_t) (ptr))\n#else\n/* Use an extra (void *) cast for MSVC. */\n# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))\n#endif\n\n#ifdef __GNUC__\n# define JS_EXTENSION __extension__\n# define JS_EXTENSION_(s) __extension__ ({ s; })\n#else\n# define JS_EXTENSION\n# define JS_EXTENSION_(s) s\n#endif\n\n#endif /* jstypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsutil.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * PR assertion checker.\n */\n\n#ifndef jsutil_h\n#define jsutil_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/GuardObjects.h\"\n\n#ifdef USE_ZLIB\n#include <zlib.h>\n#endif\n\n#include \"js/Utility.h\"\n\n/* Forward declarations. */\nstruct JSContext;\n\nstatic JS_ALWAYS_INLINE void *\njs_memcpy(void *dst_, const void *src_, size_t len)\n{\n    char *dst = (char *) dst_;\n    const char *src = (const char *) src_;\n    JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len);\n    JS_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len);\n\n    return memcpy(dst, src, len);\n}\n\nnamespace js {\n\ntemplate <class T>\nstruct AlignmentTestStruct\n{\n    char c;\n    T t;\n};\n\n/* This macro determines the alignment requirements of a type. */\n#define JS_ALIGNMENT_OF(t_) \\\n  (sizeof(js::AlignmentTestStruct<t_>) - sizeof(t_))\n\ntemplate <class T>\nclass AlignedPtrAndFlag\n{\n    uintptr_t bits;\n\n  public:\n    AlignedPtrAndFlag(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(aFlag);\n    }\n\n    T *ptr() const {\n        return (T *)(bits & ~uintptr_t(1));\n    }\n\n    bool flag() const {\n        return (bits & 1) != 0;\n    }\n\n    void setPtr(T *t) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(flag());\n    }\n\n    void setFlag() {\n        bits |= 1;\n    }\n\n    void unsetFlag() {\n        bits &= ~uintptr_t(1);\n    }\n\n    void set(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | aFlag;\n    }\n};\n\ntemplate <class T>\nstatic inline void\nReverse(T *beg, T *end)\n{\n    while (beg != end) {\n        if (--end == beg)\n            return;\n        T tmp = *beg;\n        *beg = *end;\n        *end = tmp;\n        ++beg;\n    }\n}\n\ntemplate <class T>\nstatic inline T *\nFind(T *beg, T *end, const T &v)\n{\n    for (T *p = beg; p != end; ++p) {\n        if (*p == v)\n            return p;\n    }\n    return end;\n}\n\ntemplate <class Container>\nstatic inline typename Container::ElementType *\nFind(Container &c, const typename Container::ElementType &v)\n{\n    return Find(c.begin(), c.end(), v);\n}\n\ntemplate <typename InputIterT, typename CallableT>\nvoid\nForEach(InputIterT begin, InputIterT end, CallableT f)\n{\n    for (; begin != end; ++begin)\n        f(*begin);\n}\n\ntemplate <class T>\nstatic inline T\nMin(T t1, T t2)\n{\n    return t1 < t2 ? t1 : t2;\n}\n\ntemplate <class T>\nstatic inline T\nMax(T t1, T t2)\n{\n    return t1 > t2 ? t1 : t2;\n}\n\n/* Allows a const variable to be initialized after its declaration. */\ntemplate <class T>\nstatic T&\nInitConst(const T &t)\n{\n    return const_cast<T &>(t);\n}\n\ntemplate <class T, class U>\nJS_ALWAYS_INLINE T &\nImplicitCast(U &u)\n{\n    T &t = u;\n    return t;\n}\n\ntemplate<typename T>\nclass AutoScopedAssign\n{\n  public:\n    AutoScopedAssign(T *addr, const T &value\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : addr_(addr), old(*addr_)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        *addr_ = value;\n    }\n\n    ~AutoScopedAssign() { *addr_ = old; }\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n    T *addr_;\n    T old;\n};\n\ntemplate <typename T>\nstatic inline bool\nIsPowerOfTwo(T t)\n{\n    return t && !(t & (t - 1));\n}\n\ntemplate <typename T, typename U>\nstatic inline U\nComputeByteAlignment(T bytes, U alignment)\n{\n    JS_ASSERT(IsPowerOfTwo(alignment));\n    return (alignment - (bytes % alignment)) % alignment;\n}\n\ntemplate <typename T, typename U>\nstatic inline T\nAlignBytes(T bytes, U alignment)\n{\n    return bytes + ComputeByteAlignment(bytes, alignment);\n}\n\nJS_ALWAYS_INLINE static size_t\nUnsignedPtrDiff(const void *bigger, const void *smaller)\n{\n    return size_t(bigger) - size_t(smaller);\n}\n\n/*****************************************************************************/\n\n/* A bit array is an array of bits represented by an array of words (size_t). */\n\nstatic inline unsigned\nNumWordsForBitArrayOfLength(size_t length)\n{\n    return (length + (JS_BITS_PER_WORD - 1)) / JS_BITS_PER_WORD;\n}\n\nstatic inline unsigned\nBitArrayIndexToWordIndex(size_t length, size_t bitIndex)\n{\n    unsigned wordIndex = bitIndex / JS_BITS_PER_WORD;\n    JS_ASSERT(wordIndex < length);\n    return wordIndex;\n}\n\nstatic inline size_t\nBitArrayIndexToWordMask(size_t i)\n{\n    return size_t(1) << (i % JS_BITS_PER_WORD);\n}\n\nstatic inline bool\nIsBitArrayElementSet(size_t *array, size_t length, size_t i)\n{\n    return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i);\n}\n\nstatic inline bool\nIsAnyBitArrayElementSet(size_t *array, size_t length)\n{\n    unsigned numWords = NumWordsForBitArrayOfLength(length);\n    for (unsigned i = 0; i < numWords; ++i) {\n        if (array[i])\n            return true;\n    }\n    return false;\n}\n\nstatic inline void\nSetBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearAllBitArrayElements(size_t *array, size_t length)\n{\n    for (unsigned i = 0; i < length; ++i)\n        array[i] = 0;\n}\n\n#ifdef USE_ZLIB\nclass Compressor\n{\n    /* Number of bytes we should hand to zlib each compressMore() call. */\n    static const size_t CHUNKSIZE = 2048;\n    z_stream zs;\n    const unsigned char *inp;\n    size_t inplen;\n    size_t outbytes;\n\n  public:\n    enum Status {\n        MOREOUTPUT,\n        DONE,\n        CONTINUE,\n        OOM\n    };\n\n    Compressor(const unsigned char *inp, size_t inplen);\n    ~Compressor();\n    bool init();\n    void setOutput(unsigned char *out, size_t outlen);\n    size_t outWritten() const { return outbytes; }\n    /* Compress some of the input. Return true if it should be called again. */\n    Status compressMore();\n};\n\n/*\n * Decompress a string. The caller must know the length of the output and\n * allocate |out| to a string of that length.\n */\nbool DecompressString(const unsigned char *inp, size_t inplen,\n                      unsigned char *out, size_t outlen);\n#endif\n\n}  /* namespace js */\n\n/* Crash diagnostics */\n#ifdef DEBUG\n# define JS_CRASH_DIAGNOSTICS 1\n#endif\n#ifdef JS_CRASH_DIAGNOSTICS\n# define JS_POISON(p, val, size) memset((p), (val), (size))\n#else\n# define JS_POISON(p, val, size) ((void) 0)\n#endif\n\n/* Basic stats */\n#ifdef DEBUG\n# define JS_BASIC_STATS 1\n#endif\n#ifdef JS_BASIC_STATS\n# include <stdio.h>\ntypedef struct JSBasicStats {\n    uint32_t    num;\n    uint32_t    max;\n    double      sum;\n    double      sqsum;\n    uint32_t    logscale;           /* logarithmic scale: 0 (linear), 2, 10 */\n    uint32_t    hist[11];\n} JSBasicStats;\n# define JS_INIT_STATIC_BASIC_STATS  {0,0,0,0,0,{0,0,0,0,0,0,0,0,0,0,0}}\n# define JS_BASIC_STATS_INIT(bs)     memset((bs), 0, sizeof(JSBasicStats))\n# define JS_BASIC_STATS_ACCUM(bs,val)                                         \\\n    JS_BasicStatsAccum(bs, val)\n# define JS_MeanAndStdDevBS(bs,sigma)                                         \\\n    JS_MeanAndStdDev((bs)->num, (bs)->sum, (bs)->sqsum, sigma)\nextern void\nJS_BasicStatsAccum(JSBasicStats *bs, uint32_t val);\nextern double\nJS_MeanAndStdDev(uint32_t num, double sum, double sqsum, double *sigma);\nextern void\nJS_DumpBasicStats(JSBasicStats *bs, const char *title, FILE *fp);\nextern void\nJS_DumpHistogram(JSBasicStats *bs, FILE *fp);\n#else\n# define JS_BASIC_STATS_ACCUM(bs,val)\n#endif\n\n/* A jsbitmap_t is a long integer that can be used for bitmaps. */\ntypedef size_t jsbitmap;\n#define JS_TEST_BIT(_map,_bit)  ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &      \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_SET_BIT(_map,_bit)   ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |=     \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &=     \\\n                                 ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n\n/* Wrapper for various macros to stop warnings coming from their expansions. */\n#if defined(__clang__)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"clang diagnostic push\")                                      \\\n        /* If these _Pragmas cause warnings for you, try disabling ccache. */ \\\n        _Pragma(\"clang diagnostic ignored \\\"-Wunused-value\\\"\")                \\\n        { expr; }                                                             \\\n        _Pragma(\"clang diagnostic pop\")                                       \\\n    JS_END_MACRO\n#elif MOZ_IS_GCC\n\n#if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"GCC diagnostic push\")                                        \\\n        _Pragma(\"GCC diagnostic ignored \\\"-Wunused-but-set-variable\\\"\")       \\\n        expr;                                                                 \\\n        _Pragma(\"GCC diagnostic pop\")                                         \\\n    JS_END_MACRO\n#endif\n#endif\n\n#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        expr;                                                                 \\\n    JS_END_MACRO\n#endif\n\n#endif /* jsutil_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jsversion.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsversion_h\n#define jsversion_h\n\n/*\n * Deprecated JS_VERSION handler.\n */\n#ifdef JS_VERSION\n# if JS_VERSION == 185\n#  warning \"JS_VERSION defined but unsupported (legacy)\"\n# elif JS_VERSION < 185\n#  error \"Unsupported JS_VERSION\"\n# else\n#  error \"Unknown JS_VERSION\"\n# endif\n#endif\n\n/*\n * JS Capability Macros.\n */\n#define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */\n#define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */\n#define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */\n#define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */\n#define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */\n#define JS_HAS_UNEVAL           1       /* has uneval() top-level function */\n#define JS_HAS_CONST            1       /* has JS2 const as alternative var */\n#define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */\n#define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */\n#define JS_HAS_FOR_EACH_IN      1       /* has for each (lhs in iterable) */\n#define JS_HAS_GENERATORS       1       /* has yield in generator function */\n#define JS_HAS_BLOCK_SCOPE      1       /* has block scope via let/arraycomp */\n#define JS_HAS_DESTRUCTURING    2       /* has [a,b] = ... or {p:a,q:b} = ... */\n#define JS_HAS_GENERATOR_EXPRS  1       /* has (expr for (lhs in iterable)) */\n#define JS_HAS_EXPR_CLOSURES    1       /* has function (formals) listexpr */\n\n/* Support for JS_NewGlobalObject. */\n#define JS_HAS_NEW_GLOBAL_OBJECT        1\n\n/* Support for JS_MakeSystemObject. */\n#define JS_HAS_MAKE_SYSTEM_OBJECT       1\n\n/* Feature-test macro for evolving destructuring support. */\n#define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)\n\n/*\n * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support;\n * support likely to be made opt-in at some future time.\n */\n#define OLD_GETTER_SETTER_METHODS       1\n\n/* A kill-switch for bug 586842.  Embedders shouldn't touch this! */\n#define USE_NEW_OBJECT_REPRESENTATION 0\n\n#if USE_NEW_OBJECT_REPRESENTATION\n#  define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0)\n#else\n#  define NEW_OBJECT_REPRESENTATION_ONLY() \\\n     MOZ_ASSUME_UNREACHABLE(\"don't call this!  to be used in the new object representation\")\n#endif\n\n#endif /* jsversion_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/jswrapper.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jswrapper_h\n#define jswrapper_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"jsapi.h\"\n#include \"jsproxy.h\"\n\nnamespace js {\n\nclass DummyFrameGuard;\n\n/*\n * A wrapper is a proxy with a target object to which it generally forwards\n * operations, but may restrict access to certain operations or instrument\n * the trap operations in various ways. A wrapper is distinct from a Direct Proxy\n * Handler in the sense that it can be \"unwrapped\" in C++, exposing the underlying\n * object (Direct Proxy Handlers have an underlying target object, but don't\n * expect to expose this object via any kind of unwrapping operation). Callers\n * should be careful to avoid unwrapping security wrappers in the wrong context.\n */\nclass JS_FRIEND_API(Wrapper) : public DirectProxyHandler\n{\n    unsigned mFlags;\n    bool mSafeToUnwrap;\n\n  public:\n    using BaseProxyHandler::Action;\n\n    enum Flags {\n        CROSS_COMPARTMENT = 1 << 0,\n        LAST_USED_FLAG = CROSS_COMPARTMENT\n    };\n\n    /*\n     * Wrappers can explicitly specify that they are unsafe to unwrap from a\n     * security perspective (as is the case for SecurityWrappers). If a wrapper\n     * is not safe to unwrap, operations requiring full access to the underlying\n     * object (via CheckedUnwrap) will throw. Otherwise, they will succeed.\n     */\n    void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; }\n    bool isSafeToUnwrap() { return mSafeToUnwrap; }\n\n    static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto,\n                         JSObject *parent, Wrapper *handler);\n\n    static JSObject *Renew(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *handler);\n\n    static Wrapper *wrapperHandler(JSObject *wrapper);\n\n    static JSObject *wrappedObject(JSObject *wrapper);\n\n    unsigned flags() const {\n        return mFlags;\n    }\n\n    explicit Wrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~Wrapper();\n\n    static Wrapper singleton;\n    static Wrapper singletonWithPrototype;\n};\n\n/* Base class for all cross compartment wrapper handlers. */\nclass JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper\n{\n  public:\n    CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~CrossCompartmentWrapper();\n\n    virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE;\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived wrapper traps. */\n    virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject wrapper, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject wrapper,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static CrossCompartmentWrapper singleton;\n    static CrossCompartmentWrapper singletonWithPrototype;\n};\n\n/*\n * Base class for security wrappers. A security wrapper is potentially hiding\n * all or part of some wrapped object thus SecurityWrapper defaults to denying\n * access to the wrappee. This is the opposite of Wrapper which tries to be\n * completely transparent.\n *\n * NB: Currently, only a few ProxyHandler operations are overridden to deny\n * access, relying on derived SecurityWrapper to block access when necessary.\n */\ntemplate <class Base>\nclass JS_FRIEND_API(SecurityWrapper) : public Base\n{\n  public:\n    SecurityWrapper(unsigned flags);\n\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act,\n                       bool *bp) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n\n    /*\n     * Allow our subclasses to select the superclass behavior they want without\n     * needing to specify an exact superclass.\n     */\n    typedef Base Permissive;\n    typedef SecurityWrapper<Base> Restrictive;\n};\n\ntypedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;\ntypedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;\n\nclass JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler\n{\n  public:\n    static int sDeadObjectFamily;\n\n    explicit DeadObjectProxy();\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp,\n                                     bool *present) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy,\n                                MutableHandleObject protop) MOZ_OVERRIDE;\n\n    static DeadObjectProxy singleton;\n};\n\nextern JSObject *\nTransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj,\n                         HandleObject wrappedProto, HandleObject parent,\n                         unsigned flags);\n\n// Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by\n// jsfriendapi users.\nextern JS_FRIEND_DATA(int) sWrapperFamily;\n\ninline bool\nIsWrapper(JSObject *obj)\n{\n    return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily;\n}\n\n// Given a JSObject, returns that object stripped of wrappers. If\n// stopAtOuter is true, then this returns the outer window if it was\n// previously wrapped. Otherwise, this returns the first object for\n// which JSObject::isWrapper returns false.\nJS_FRIEND_API(JSObject *)\nUncheckedUnwrap(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = NULL);\n\n// Given a JSObject, returns that object stripped of wrappers. At each stage,\n// the security wrapper has the opportunity to veto the unwrap. Since checked\n// code should never be unwrapping outer window wrappers, we always stop at\n// outer windows.\nJS_FRIEND_API(JSObject *)\nCheckedUnwrap(JSObject *obj, bool stopAtOuter = true);\n\n// Unwrap only the outermost security wrapper, with the same semantics as\n// above. This is the checked version of Wrapper::wrappedObject.\nJS_FRIEND_API(JSObject *)\nUnwrapOneChecked(JSObject *obj, bool stopAtOuter = true);\n\nJS_FRIEND_API(bool)\nIsCrossCompartmentWrapper(JSObject *obj);\n\nbool\nIsDeadProxyObject(JSObject *obj);\n\nJSObject *\nNewDeadProxyObject(JSContext *cx, JSObject *parent);\n\nvoid\nNukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper);\n\nbool\nRemapWrapper(JSContext *cx, JSObject *wobj, JSObject *newTarget);\n\nJS_FRIEND_API(bool)\nRemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget,\n                          JSObject *newTarget);\n\n// API to recompute all cross-compartment wrappers whose source and target\n// match the given filters.\nJS_FRIEND_API(bool)\nRecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,\n                  const CompartmentFilter &targetFilter);\n\n/*\n * This auto class should be used around any code, such as brain transplants,\n * that may touch dead zones. Brain transplants can cause problems\n * because they operate on all compartments, whether live or dead. A brain\n * transplant can cause a formerly dead object to be \"reanimated\" by causing a\n * read or write barrier to be invoked on it during the transplant. In this way,\n * a zone becomes a zombie, kept alive by repeatedly consuming\n * (transplanted) brains.\n *\n * To work around this issue, we observe when mark bits are set on objects in\n * dead zones. If this happens during a brain transplant, we do a full,\n * non-incremental GC at the end of the brain transplant. This will clean up any\n * objects that were improperly marked.\n */\nstruct JS_FRIEND_API(AutoMaybeTouchDeadZones)\n{\n    // The version that takes an object just uses it for its runtime.\n    AutoMaybeTouchDeadZones(JSContext *cx);\n    AutoMaybeTouchDeadZones(JSObject *obj);\n    ~AutoMaybeTouchDeadZones();\n\n  private:\n    JSRuntime *runtime;\n    unsigned markCount;\n    bool inIncremental;\n    bool manipulatingDeadZones;\n};\n\n} /* namespace js */\n\n#endif /* jswrapper_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/AllocPolicy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * An allocation policy concept, usable for structures and algorithms to\n * control how memory is allocated and how failures are handled.\n */\n\n#ifndef mozilla_AllocPolicy_h\n#define mozilla_AllocPolicy_h\n\n#include <stddef.h>\n#include <stdlib.h>\n\nnamespace mozilla {\n\n/*\n * Allocation policies are used to implement the standard allocation behaviors\n * in a customizable way.  Additionally, custom behaviors may be added to these\n * behaviors, such as additionally reporting an error through an out-of-band\n * mechanism when OOM occurs.  The concept modeled here is as follows:\n *\n *  - public copy constructor, assignment, destructor\n *  - void* malloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* calloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* realloc_(void*, size_t, size_t)\n *      Responsible for OOM reporting when null is returned.  The *used* bytes\n *      of the previous buffer is passed in (rather than the old allocation\n *      size), in addition to the *new* allocation size requested.\n *  - void free_(void*)\n *  - void reportAllocOverflow() const\n *      Called on allocation overflow (that is, an allocation implicitly tried\n *      to allocate more than the available memory space -- think allocating an\n *      array of large-size objects, where N * size overflows) before null is\n *      returned.\n *\n * mfbt provides (and typically uses by default) only MallocAllocPolicy, which\n * does nothing more than delegate to the malloc/alloc/free functions.\n */\n\n/*\n * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no\n * extra behaviors.\n */\nclass MallocAllocPolicy\n{\n  public:\n    void* malloc_(size_t bytes) { return malloc(bytes); }\n    void* calloc_(size_t bytes) { return calloc(bytes, 1); }\n    void* realloc_(void* p, size_t oldBytes, size_t bytes) { return realloc(p, bytes); }\n    void free_(void* p) { free(p); }\n    void reportAllocOverflow() const {}\n};\n\n\n} // namespace mozilla\n\n#endif /* mozilla_AllocPolicy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Array.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A compile-time constant-length array with bounds-checking assertions. */\n\n#ifndef mozilla_Array_h\n#define mozilla_Array_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\ntemplate<typename T, size_t Length>\nclass Array\n{\n    T arr[Length];\n\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n};\n\ntemplate<typename T>\nclass Array<T, 0>\n{\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_Array_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Assertions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of runtime and static assertion macros for C and C++. */\n\n#ifndef mozilla_Assertions_h\n#define mozilla_Assertions_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Likely.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef WIN32\n   /*\n    * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which\n    * further depends on <windef.h>.  We hardcode these few definitions manually\n    * because those headers clutter the global namespace with a significant\n    * number of undesired macros and symbols.\n    */\n#  ifdef __cplusplus\n   extern \"C\" {\n#  endif\n   __declspec(dllimport) int __stdcall\n   TerminateProcess(void* hProcess, unsigned int uExitCode);\n   __declspec(dllimport) void* __stdcall GetCurrentProcess(void);\n#  ifdef __cplusplus\n   }\n#  endif\n#else\n#  include <signal.h>\n#endif\n#ifdef ANDROID\n#  include <android/log.h>\n#endif\n\n/*\n * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.\n * In C++11, static_assert is provided by the compiler to the same effect.\n * This can be useful when you make certain assumptions about what must hold for\n * optimal, or even correct, behavior.  For example, you might assert that the\n * size of a struct is a multiple of the target architecture's word size:\n *\n *   struct S { ... };\n *   // C\n *   MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,\n *                     \"S should be a multiple of word size for efficiency\");\n *   // C++11\n *   static_assert(sizeof(S) % sizeof(size_t) == 0,\n *                 \"S should be a multiple of word size for efficiency\");\n *\n * This macro can be used in any location where both an extern declaration and a\n * typedef could be used.\n */\n#ifndef __cplusplus\n   /*\n    * Some of the definitions below create an otherwise-unused typedef.  This\n    * triggers compiler warnings with some versions of gcc, so mark the typedefs\n    * as permissibly-unused to disable the warnings.\n    */\n#  if defined(__GNUC__)\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))\n#  else\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */\n#  endif\n#  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y\n#  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)\n#  if defined(__SUNPRO_CC)\n     /*\n      * The Sun Studio C++ compiler is buggy when declaring, inside a function,\n      * another extern'd function with an array argument whose length contains a\n      * sizeof, triggering the error message \"sizeof expression not accepted as\n      * size of array parameter\".  This bug (6688515, not public yet) would hit\n      * defining moz_static_assert as a function, so we always define an extern\n      * array for Sun Studio.\n      *\n      * We include the line number in the symbol name in a best-effort attempt\n      * to avoid conflicts (see below).\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond) ? 1 : -1]\n#  elif defined(__COUNTER__)\n     /*\n      * If there was no preferred alternative, use a compiler-agnostic version.\n      *\n      * Note that the non-__COUNTER__ version has a bug in C++: it can't be used\n      * in both |extern \"C\"| and normal C++ in the same translation unit.  (Alas\n      * |extern \"C\"| isn't allowed in a function.)  The only affected compiler\n      * we really care about is gcc 4.2.  For that compiler and others like it,\n      * we include the line number in the function name to do the best we can to\n      * avoid conflicts.  These should be rare: a conflict would require use of\n      * MOZ_STATIC_ASSERT on the same line in separate files in the same\n      * translation unit, *and* the uses would have to be in code with\n      * different linkage, *and* the first observed use must be in C++-linkage\n      * code.\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  else\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  endif\n\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)\n#else\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Prints |s| as an assertion failure (using file and ln as the location of the\n * assertion) to the standard debug-output channel.\n *\n * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This\n * method is primarily for internal use in this header, and only secondarily\n * for use in implementing release-build assertions.\n */\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportAssertionFailure(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n  __android_log_print(ANDROID_LOG_FATAL, \"MOZ_Assert\",\n                      \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportCrash(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n    __android_log_print(ANDROID_LOG_FATAL, \"MOZ_CRASH\",\n                        \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\n/**\n * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH().  You should\n * call MOZ_CRASH instead.\n */\n#if defined(_MSC_VER)\n   /*\n    * On MSVC use the __debugbreak compiler intrinsic, which produces an inline\n    * (not nested in a system function) breakpoint.  This distinctively invokes\n    * Breakpad without requiring system library symbols on all stack-processing\n    * machines, as a nested breakpoint would require.\n    *\n    * We use TerminateProcess with the exit code aborting would generate\n    * because we don't want to invoke atexit handlers, destructors, library\n    * unload handlers, and so on when our process might be in a compromised\n    * state.\n    *\n    * We don't use abort() because it'd cause Windows to annoyingly pop up the\n    * process error dialog multiple times.  See bug 345118 and bug 426163.\n    *\n    * We follow TerminateProcess() with a call to MOZ_NoReturn() so that the\n    * compiler doesn't hassle us to provide a return statement after a\n    * MOZ_REALLY_CRASH() call.\n    *\n    * (Technically these are Windows requirements, not MSVC requirements.  But\n    * practically you need MSVC for debugging, and we only ship builds created\n    * by MSVC, so doing it this way reduces complexity.)\n    */\n\n__declspec(noreturn) __inline void MOZ_NoReturn() {}\n\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         ::TerminateProcess(::GetCurrentProcess(), 3); \\\n         ::MOZ_NoReturn(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         TerminateProcess(GetCurrentProcess(), 3); \\\n         MOZ_NoReturn(); \\\n       } while (0)\n#  endif\n#else\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         ::abort(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         abort(); \\\n       } while (0)\n#  endif\n#endif\n\n/*\n * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a\n * Breakpad-compatible way, in both debug and release builds.\n *\n * MOZ_CRASH is a good solution for \"handling\" failure cases when you're\n * unwilling or unable to handle them more cleanly -- for OOM, for likely memory\n * corruption, and so on.  It's also a good solution if you need safe behavior\n * in release builds as well as debug builds.  But if the failure is one that\n * should be debugged and fixed, MOZ_ASSERT is generally preferable.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining why we're crashing.  This argument is intended for use with\n * MOZ_CRASH() calls whose rationale is non-obvious; don't use it if it's\n * obvious why we're crashing.\n *\n * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an\n * explanation-string, we print the string to stderr.  Otherwise, we don't\n * print anything; this is because we want MOZ_CRASH to be 100% safe in release\n * builds, and it's hard to print to stderr safely when memory might have been\n * corrupted.\n */\n#ifndef DEBUG\n#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()\n#else\n#  define MOZ_CRASH(...) \\\n     do { \\\n       MOZ_ReportCrash(\"\" __VA_ARGS__, __FILE__, __LINE__); \\\n       MOZ_REALLY_CRASH(); \\\n     } while(0)\n#endif\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n/*\n * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in\n * debug builds.  If it is, execution continues.  Otherwise, an error message\n * including the expression and the explanation-string (if provided) is printed,\n * an attempt is made to invoke any existing debugger, and execution halts.\n * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition\n * which can correctly be falsy.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining the assertion.  It is intended for use with assertions whose\n * correctness or rationale is non-obvious, and for assertions where the \"real\"\n * condition being tested is best described prosaically.  Don't provide an\n * explanation if it's not actually helpful.\n *\n *   // No explanation needed: pointer arguments often must not be NULL.\n *   MOZ_ASSERT(arg);\n *\n *   // An explanation can be helpful to explain exactly how we know an\n *   // assertion is valid.\n *   MOZ_ASSERT(state == WAITING_FOR_RESPONSE,\n *              \"given that <thingA> and <thingB>, we must have...\");\n *\n *   // Or it might disambiguate multiple identical (save for their location)\n *   // assertions of the same expression.\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this Boolean object\");\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this String object\");\n *\n * MOZ_ASSERT has no effect in non-debug builds.  It is designed to catch bugs\n * *only* during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n   /* First the single-argument form. */\n#  define MOZ_ASSERT_HELPER1(expr) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* Now the two-argument form. */\n#  define MOZ_ASSERT_HELPER2(expr, explain) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr \" (\" explain \")\", __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* And now, helper macrology up the wazoo. */\n   /*\n    * Count the number of arguments passed to MOZ_ASSERT, very carefully\n    * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a\n    * single token in argument lists.  See these URLs for details:\n    *\n    *   http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement\n    *   http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644\n    */\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL2(_1, _2, count, ...) \\\n     count\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL(args) \\\n\t MOZ_COUNT_ASSERT_ARGS_IMPL2 args\n#  define MOZ_COUNT_ASSERT_ARGS(...) \\\n     MOZ_COUNT_ASSERT_ARGS_IMPL((__VA_ARGS__, 2, 1, 0))\n   /* Pick the right helper macro to invoke. */\n#  define MOZ_ASSERT_CHOOSE_HELPER2(count) MOZ_ASSERT_HELPER##count\n#  define MOZ_ASSERT_CHOOSE_HELPER1(count) MOZ_ASSERT_CHOOSE_HELPER2(count)\n#  define MOZ_ASSERT_CHOOSE_HELPER(count) MOZ_ASSERT_CHOOSE_HELPER1(count)\n   /* The actual macro. */\n#  define MOZ_ASSERT_GLUE(x, y) x y\n#  define MOZ_ASSERT(...) \\\n     MOZ_ASSERT_GLUE(MOZ_ASSERT_CHOOSE_HELPER(MOZ_COUNT_ASSERT_ARGS(__VA_ARGS__)), \\\n                     (__VA_ARGS__))\n#else\n#  define MOZ_ASSERT(...) do { } while(0)\n#endif /* DEBUG */\n\n/*\n * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is\n * true.\n *\n *   MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));\n *\n * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds.  It is\n * designed to catch bugs during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n#  define MOZ_ASSERT_IF(cond, expr) \\\n     do { \\\n       if (cond) \\\n         MOZ_ASSERT(expr); \\\n     } while (0)\n#else\n#  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that it is\n * undefined behavior for execution to reach this point.  No guarantees are made\n * about what will happen if this is reached at runtime.  Most code should\n * probably use the higher level MOZ_ASSUME_UNREACHABLE, which uses this when\n * appropriate.\n */\n#if defined(__clang__)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#elif defined(__GNUC__)\n   /*\n    * __builtin_unreachable() was implemented in gcc 4.5.  If we don't have\n    * that, call a noreturn function; abort() will do nicely.  Qualify the call\n    * in C++ in case there's another abort() visible in local scope.\n    */\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0)\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#  else\n#    ifdef __cplusplus\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#    else\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __assume(0)\n#else\n#  ifdef __cplusplus\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#  else\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#  endif\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE([reason]) tells the compiler that it can assume that\n * the macro call cannot be reached during execution.  This lets the compiler\n * generate better-optimized code under some circumstances, at the expense of\n * the program's behavior being undefined if control reaches the\n * MOZ_ASSUME_UNREACHABLE.\n *\n * In Gecko, you probably should not use this macro outside of performance- or\n * size-critical code, because it's unsafe.  If you don't care about code size\n * or performance, you should probably use MOZ_ASSERT or MOZ_CRASH.\n *\n * SpiderMonkey is a different beast, and there it's acceptable to use\n * MOZ_ASSUME_UNREACHABLE more widely.\n *\n * Note that MOZ_ASSUME_UNREACHABLE is noreturn, so it's valid not to return a\n * value following a MOZ_ASSUME_UNREACHABLE call.\n *\n * Example usage:\n *\n *   enum ValueType {\n *     VALUE_STRING,\n *     VALUE_INT,\n *     VALUE_FLOAT\n *   };\n *\n *   int ptrToInt(ValueType type, void* value) {\n *   {\n *     // We know for sure that type is either INT or FLOAT, and we want this\n *     // code to run as quickly as possible.\n *     switch (type) {\n *     case VALUE_INT:\n *       return *(int*) value;\n *     case VALUE_FLOAT:\n *       return (int) *(float*) value;\n *     default:\n *       MOZ_ASSUME_UNREACHABLE(\"can only handle VALUE_INT and VALUE_FLOAT\");\n *     }\n *   }\n */\n#if defined(DEBUG)\n#  define MOZ_ASSUME_UNREACHABLE(...) \\\n     do { \\\n       MOZ_ASSERT(false, \"MOZ_ASSUME_UNREACHABLE(\" __VA_ARGS__ \")\"); \\\n       MOZ_ASSUME_UNREACHABLE_MARKER(); \\\n     } while (0)\n#else\n#  define MOZ_ASSUME_UNREACHABLE(reason)  MOZ_ASSUME_UNREACHABLE_MARKER()\n#endif\n\n/*\n * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided\n * expression, in debug builds and in release builds both.  Then, in debug\n * builds only, the value of the expression is asserted either true or false\n * using MOZ_ASSERT.\n */\n#ifdef DEBUG\n#  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))\n#  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))\n#else\n#  define MOZ_ALWAYS_TRUE(expr)      ((void)(expr))\n#  define MOZ_ALWAYS_FALSE(expr)     ((void)(expr))\n#endif\n\n#endif /* mozilla_Assertions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Atomics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements (almost always) lock-free atomic operations. The operations here\n * are a subset of that which can be found in C++11's <atomic> header, with a\n * different API to enforce consistent memory ordering constraints.\n *\n * Anyone caught using |volatile| for inter-thread memory safety needs to be\n * sent a copy of this header and the C++11 standard.\n */\n\n#ifndef mozilla_Atomics_h\n#define mozilla_Atomics_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n\n/*\n * Our minimum deployment target on clang/OS X is OS X 10.6, whose SDK\n * does not have <atomic>.  So be sure to check for <atomic> support\n * along with C++0x support.\n */\n#if defined(__clang__)\n   /*\n    * clang doesn't like libstdc++'s version of <atomic> before GCC 4.7,\n    * due to the loose typing of the __sync_* family of functions done by\n    * GCC.  We do not have a particularly good way to detect this sort of\n    * case at this point, so just assume that if we're on a Linux system,\n    * we can't use the system's <atomic>.\n    *\n    * OpenBSD uses an old libstdc++ 4.2.1 and thus doesnt have <atomic>.\n    */\n#  if !defined(__linux__) && !defined(__OpenBSD__) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \\\n      __has_include(<atomic>)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n/*\n * Android uses a different C++ standard library that does not provide\n * support for <atomic>.\n *\n * GCC 4.5.x and 4.6.x's unspecialized std::atomic template doesn't include\n * inline definitions for the functions declared therein.  This oversight\n * leads to linking errors when using atomic enums.  We therefore require\n * GCC 4.7 or higher.\n */\n#elif defined(__GNUC__) && !defined(__ANDROID__)\n#  include \"mozilla/Compiler.h\"\n#  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \\\n      MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n#elif defined(_MSC_VER) && _MSC_VER >= 1700\n#  define MOZ_HAVE_CXX11_ATOMICS\n#endif\n\nnamespace mozilla {\n\n/**\n * An enum of memory ordering possibilities for atomics.\n *\n * Memory ordering is the observable state of distinct values in memory.\n * (It's a separate concept from atomicity, which concerns whether an\n * operation can ever be observed in an intermediate state.  Don't\n * conflate the two!)  Given a sequence of operations in source code on\n * memory, it is *not* always the case that, at all times and on all\n * cores, those operations will appear to have occurred in that exact\n * sequence.  First, the compiler might reorder that sequence, if it\n * thinks another ordering will be more efficient.  Second, the CPU may\n * not expose so consistent a view of memory.  CPUs will often perform\n * their own instruction reordering, above and beyond that performed by\n * the compiler.  And each core has its own memory caches, and accesses\n * (reads and writes both) to \"memory\" may only resolve to out-of-date\n * cache entries -- not to the \"most recently\" performed operation in\n * some global sense.  Any access to a value that may be used by\n * multiple threads, potentially across multiple cores, must therefore\n * have a memory ordering imposed on it, for all code on all\n * threads/cores to have a sufficiently coherent worldview.\n *\n * http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync and\n * http://en.cppreference.com/w/cpp/atomic/memory_order go into more\n * detail on all this, including examples of how each mode works.\n *\n * Note that for simplicity and practicality, not all of the modes in\n * C++11 are supported.  The missing C++11 modes are either subsumed by\n * the modes we provide below, or not relevant for the CPUs we support\n * in Gecko.  These three modes are confusing enough as it is!\n */\nenum MemoryOrdering {\n  /*\n   * Relaxed ordering is the simplest memory ordering: none at all.\n   * When the result of a write is observed, nothing may be inferred\n   * about other memory.  Writes ostensibly performed \"before\" on the\n   * writing thread may not yet be visible.  Writes performed \"after\" on\n   * the writing thread may already be visible, if the compiler or CPU\n   * reordered them.  (The latter can happen if reads and/or writes get\n   * held up in per-processor caches.)  Relaxed ordering means\n   * operations can always use cached values (as long as the actual\n   * updates to atomic values actually occur, correctly, eventually), so\n   * it's usually the fastest sort of atomic access.  For this reason,\n   * *it's also the most dangerous kind of access*.\n   *\n   * Relaxed ordering is good for things like process-wide statistics\n   * counters that don't need to be consistent with anything else, so\n   * long as updates themselves are atomic.  (And so long as any\n   * observations of that value can tolerate being out-of-date -- if you\n   * need some sort of up-to-date value, you need some sort of other\n   * synchronizing operation.)  It's *not* good for locks, mutexes,\n   * reference counts, etc. that mediate access to other memory, or must\n   * be observably consistent with other memory.\n   *\n   * x86 architectures don't take advantage of the optimization\n   * opportunities that relaxed ordering permits.  Thus it's possible\n   * that using relaxed ordering will \"work\" on x86 but fail elsewhere\n   * (ARM, say, which *does* implement non-sequentially-consistent\n   * relaxed ordering semantics).  Be extra-careful using relaxed\n   * ordering if you can't easily test non-x86 architectures!\n   */\n  Relaxed,\n  /*\n   * When an atomic value is updated with ReleaseAcquire ordering, and\n   * that new value is observed with ReleaseAcquire ordering, prior\n   * writes (atomic or not) are also observable.  What ReleaseAcquire\n   * *doesn't* give you is any observable ordering guarantees for\n   * ReleaseAcquire-ordered operations on different objects.  For\n   * example, if there are two cores that each perform ReleaseAcquire\n   * operations on separate objects, each core may or may not observe\n   * the operations made by the other core.  The only way the cores can\n   * be synchronized with ReleaseAcquire is if they both\n   * ReleaseAcquire-access the same object.  This implies that you can't\n   * necessarily describe some global total ordering of ReleaseAcquire\n   * operations.\n   *\n   * ReleaseAcquire ordering is good for (as the name implies) atomic\n   * operations on values controlling ownership of things: reference\n   * counts, mutexes, and the like.  However, if you are thinking about\n   * using these to implement your own locks or mutexes, you should take\n   * a good, hard look at actual lock or mutex primitives first.\n   */\n  ReleaseAcquire,\n  /*\n   * When an atomic value is updated with SequentiallyConsistent\n   * ordering, all writes observable when the update is observed, just\n   * as with ReleaseAcquire ordering.  But, furthermore, a global total\n   * ordering of SequentiallyConsistent operations *can* be described.\n   * For example, if two cores perform SequentiallyConsistent operations\n   * on separate objects, one core will observably perform its update\n   * (and all previous operations will have completed), then the other\n   * core will observably perform its update (and all previous\n   * operations will have completed).  (Although those previous\n   * operations aren't themselves ordered -- they could be intermixed,\n   * or ordered if they occur on atomic values with ordering\n   * requirements.)  SequentiallyConsistent is the *simplest and safest*\n   * ordering of atomic operations -- it's always as if one operation\n   * happens, then another, then another, in some order -- and every\n   * core observes updates to happen in that single order.  Because it\n   * has the most synchronization requirements, operations ordered this\n   * way also tend to be slowest.\n   *\n   * SequentiallyConsistent ordering can be desirable when multiple\n   * threads observe objects, and they all have to agree on the\n   * observable order of changes to them.  People expect\n   * SequentiallyConsistent ordering, even if they shouldn't, when\n   * writing code, atomic or otherwise.  SequentiallyConsistent is also\n   * the ordering of choice when designing lockless data structures.  If\n   * you don't know what order to use, use this one.\n   */\n  SequentiallyConsistent,\n};\n\n} // namespace mozilla\n\n// Build up the underlying intrinsics.\n#ifdef MOZ_HAVE_CXX11_ATOMICS\n\n#  include <atomic>\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * We provide CompareExchangeFailureOrder to work around a bug in some\n * versions of GCC's <atomic> header.  See bug 898491.\n */\ntemplate<MemoryOrdering Order> struct AtomicOrderConstraints;\n\ntemplate<>\nstruct AtomicOrderConstraints<Relaxed>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;\n    static const std::memory_order LoadOrder = std::memory_order_relaxed;\n    static const std::memory_order StoreOrder = std::memory_order_relaxed;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_relaxed;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<ReleaseAcquire>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;\n    static const std::memory_order LoadOrder = std::memory_order_acquire;\n    static const std::memory_order StoreOrder = std::memory_order_release;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_acquire;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<SequentiallyConsistent>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;\n    static const std::memory_order LoadOrder = std::memory_order_seq_cst;\n    static const std::memory_order StoreOrder = std::memory_order_seq_cst;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_seq_cst;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicBase\n{\n    typedef std::atomic<T> ValueType;\n    typedef AtomicOrderConstraints<Order> OrderedOp;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T load(const typename Base::ValueType& ptr) {\n      return ptr.load(Base::OrderedOp::LoadOrder);\n    }\n    static void store(typename Base::ValueType& ptr, T val) {\n      ptr.store(val, Base::OrderedOp::StoreOrder);\n    }\n    static T exchange(typename Base::ValueType& ptr, T val) {\n      return ptr.exchange(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static bool compareExchange(typename Base::ValueType& ptr, T oldVal, T newVal) {\n      return ptr.compare_exchange_strong(oldVal, newVal,\n                                         Base::OrderedOp::AtomicRMWOrder,\n                                         Base::OrderedOp::CompareExchangeFailureOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T add(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_add(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T sub(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_sub(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>\n{\n    typedef IntrinsicBase<T*, Order> Base;\n    static T* add(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_add(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T* sub(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_sub(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n  private:\n    /*\n     * GCC 4.6's <atomic> header has a bug where adding X to an\n     * atomic<T*> is not the same as adding X to a T*.  Hence the need\n     * for this function to provide the correct addend.\n     */\n    static ptrdiff_t fixupAddend(ptrdiff_t val) {\n#if defined(__clang__) || defined(_MSC_VER)\n      return val;\n#elif defined(__GNUC__) && MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) && \\\n      !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n      return val * sizeof(T);\n#else\n      return val;\n#endif\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T inc(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::add(ptr, 1);\n    }\n    static T dec(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::sub(ptr, 1);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T or_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_or(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T xor_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_xor(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T and_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_and(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order>\n  : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(__GNUC__)\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The __sync_* family of intrinsics is documented here:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Atomic-Builtins.html\n *\n * While these intrinsics are deprecated in favor of the newer __atomic_*\n * family of intrincs:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/_005f_005fatomic-Builtins.html\n *\n * any GCC version that supports the __atomic_* intrinsics will also support\n * the <atomic> header and so will be handled above.  We provide a version of\n * atomics using the __sync_* intrinsics to support older versions of GCC.\n *\n * All __sync_* intrinsics that we use below act as full memory barriers, for\n * both compiler and hardware reordering, except for __sync_lock_test_and_set,\n * which is a only an acquire barrier.  When we call __sync_lock_test_and_set,\n * we add a barrier above it as appropriate.\n */\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * Some processors (in particular, x86) don't require quite so many calls to\n * __sync_sychronize as our specializations of Barrier produce.  If\n * performance turns out to be an issue, defining these specializations\n * on a per-processor basis would be a good first tuning step.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { __sync_synchronize(); }\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() { __sync_synchronize(); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps\n{\n    static T load(const T& ptr) {\n      Barrier<Order>::beforeLoad();\n      T val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(T& ptr, T val) {\n      Barrier<Order>::beforeStore();\n      ptr = val;\n      Barrier<Order>::afterStore();\n    }\n    static T exchange(T& ptr, T val) {\n      // __sync_lock_test_and_set is only an acquire barrier; loads and stores\n      // can't be moved up from after to before it, but they can be moved down\n      // from before to after it.  We may want a stricter ordering, so we need\n      // an explicit barrier.\n\n      Barrier<Order>::beforeStore();\n      return __sync_lock_test_and_set(&ptr, val);\n    }\n    static bool compareExchange(T& ptr, T oldVal, T newVal) {\n      return __sync_bool_compare_and_swap(&ptr, oldVal, newVal);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub\n{\n    typedef T ValueType;\n    static T add(T& ptr, T val) {\n      return __sync_fetch_and_add(&ptr, val);\n    }\n    static T sub(T& ptr, T val) {\n      return __sync_fetch_and_sub(&ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*>\n{\n    typedef T* ValueType;\n    /*\n     * The reinterpret_casts are needed so that\n     * __sync_fetch_and_{add,sub} will properly type-check.\n     *\n     * Also, these functions do not provide standard semantics for\n     * pointer types, so we need to adjust the addend.\n     */\n    static ValueType add(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_add(&ptr, amount);\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_sub(&ptr, amount);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static T inc(T& ptr) { return IntrinsicAddSub<T>::add(ptr, 1); }\n    static T dec(T& ptr) { return IntrinsicAddSub<T>::sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static T or_(T& ptr, T val) {\n      return __sync_fetch_and_or(&ptr, val);\n    }\n    static T xor_(T& ptr, T val) {\n      return __sync_fetch_and_xor(&ptr, val);\n    }\n    static T and_(T& ptr, T val) {\n      return __sync_fetch_and_and(&ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(_MSC_VER)\n\n/*\n * Windows comes with a full complement of atomic operations.\n * Unfortunately, most of those aren't available for Windows XP (even if\n * the compiler supports intrinsics for them), which is the oldest\n * version of Windows we support.  Therefore, we only provide operations\n * on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows\n * versions, we support 64-bit datatypes as well.\n *\n * To avoid namespace pollution issues, we declare whatever functions we\n * need ourselves.\n */\n\nextern \"C\" {\nlong __cdecl _InterlockedExchangeAdd(long volatile* dst, long value);\nlong __cdecl _InterlockedOr(long volatile* dst, long value);\nlong __cdecl _InterlockedXor(long volatile* dst, long value);\nlong __cdecl _InterlockedAnd(long volatile* dst, long value);\nlong __cdecl _InterlockedExchange(long volatile *dst, long value);\nlong __cdecl _InterlockedCompareExchange(long volatile *dst, long newVal, long oldVal);\n}\n\n#  pragma intrinsic(_InterlockedExchangeAdd)\n#  pragma intrinsic(_InterlockedOr)\n#  pragma intrinsic(_InterlockedXor)\n#  pragma intrinsic(_InterlockedAnd)\n#  pragma intrinsic(_InterlockedExchange)\n#  pragma intrinsic(_InterlockedCompareExchange)\n\nnamespace mozilla {\nnamespace detail {\n\n#  if !defined(_M_IX86) && !defined(_M_X64)\n     /*\n      * The implementations below are optimized for x86ish systems.  You\n      * will have to modify them if you are porting to Windows on a\n      * different architecture.\n      */\n#    error \"Unknown CPU type\"\n#  endif\n\n/*\n * The PrimitiveIntrinsics template should define |Type|, the datatype of size\n * DataSize upon which we operate, and the following eight functions.\n *\n * static Type add(Type* ptr, Type val);\n * static Type sub(Type* ptr, Type val);\n * static Type or_(Type* ptr, Type val);\n * static Type xor_(Type* ptr, Type val);\n * static Type and_(Type* ptr, Type val);\n *\n *   These functions perform the obvious operation on the value contained in\n *   |*ptr| combined with |val| and return the value previously stored in\n *   |*ptr|.\n *\n * static void store(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and must provide a full\n *   memory fence after the store to prevent compiler and hardware instruction\n *   reordering.  It should also act as a compiler barrier to prevent reads and\n *   writes from moving to after the store.\n *\n * static Type exchange(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and returns the previous\n *   contents of *ptr;\n *\n * static bool compareExchange(Type* ptr, Type oldVal, Type newVal);\n *\n *   This function atomically performs the following operation:\n *\n *     if (*ptr == oldVal) {\n *       *ptr = newVal;\n *       return true;\n *     } else {\n *       return false;\n *     }\n *\n */\ntemplate<size_t DataSize> struct PrimitiveIntrinsics;\n\ntemplate<>\nstruct PrimitiveIntrinsics<4>\n{\n    typedef long Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * _InterlockedExchangeSubtract isn't available before Windows 7,\n       * and we must support Windows XP.\n       */\n      return _InterlockedExchangeAdd(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  if defined(_M_X64)\n\nextern \"C\" {\nlong long __cdecl _InterlockedExchangeAdd64(long long volatile* dst,\n                                            long long value);\nlong long __cdecl _InterlockedOr64(long long volatile* dst,\n                                   long long value);\nlong long __cdecl _InterlockedXor64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedAnd64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedExchange64(long long volatile* dst,\n                                         long long value);\nlong long __cdecl _InterlockedCompareExchange64(long long volatile* dst,\n                                                long long newVal,\n                                                long long oldVal);\n}\n\n#    pragma intrinsic(_InterlockedExchangeAdd64)\n#    pragma intrinsic(_InterlockedOr64)\n#    pragma intrinsic(_InterlockedXor64)\n#    pragma intrinsic(_InterlockedAnd64)\n#    pragma intrinsic(_InterlockedExchange64)\n#    pragma intrinsic(_InterlockedCompareExchange64)\n\ntemplate <>\nstruct PrimitiveIntrinsics<8>\n{\n    typedef __int64 Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd64(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * There is no _InterlockedExchangeSubtract64.\n       */\n      return _InterlockedExchangeAdd64(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr64(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor64(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd64(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange64(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange64(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange64(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  endif\n\nextern \"C\" { void _ReadWriteBarrier(); }\n\n#  pragma intrinsic(_ReadWriteBarrier)\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * We do not provide an afterStore method in Barrier, as Relaxed and\n * ReleaseAcquire orderings do not require one, and the required barrier\n * for SequentiallyConsistent is handled by PrimitiveIntrinsics.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { _ReadWriteBarrier(); }\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper\n{\n  static PrimType toPrimType(T val) { return static_cast<PrimType>(val); }\n  static T fromPrimType(PrimType val) { return static_cast<T>(val); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper<PrimType, T*>\n{\n  static PrimType toPrimType(T* val) { return reinterpret_cast<PrimType>(val); }\n  static T* fromPrimType(PrimType val) { return reinterpret_cast<T*>(val); }\n};\n\ntemplate<typename T>\nstruct IntrinsicBase\n{\n    typedef T ValueType;\n    typedef PrimitiveIntrinsics<sizeof(T)> Primitives;\n    typedef typename Primitives::Type PrimType;\n    static_assert(sizeof(PrimType) == sizeof(T),\n                  \"Selection of PrimitiveIntrinsics was wrong\");\n    typedef CastHelper<PrimType, T> Cast;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T>\n{\n    static ValueType load(const ValueType& ptr) {\n      Barrier<Order>::beforeLoad();\n      ValueType val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(ValueType& ptr, ValueType val) {\n      // For SequentiallyConsistent, Primitives::store() will generate the\n      // proper memory fence.  Everything else just needs a barrier before\n      // the store.\n      if (Order == SequentiallyConsistent) {\n        Primitives::store(reinterpret_cast<PrimType*>(&ptr),\n                          Cast::toPrimType(val));\n      } else {\n        Barrier<Order>::beforeStore();\n        ptr = val;\n      }\n    }\n    static ValueType exchange(ValueType& ptr, ValueType val) {\n      PrimType oldval =\n        Primitives::exchange(reinterpret_cast<PrimType*>(&ptr),\n                             Cast::toPrimType(val));\n      return Cast::fromPrimType(oldval);\n    }\n    static bool compareExchange(ValueType& ptr, ValueType oldVal, ValueType newVal) {\n      return Primitives::compareExchange(reinterpret_cast<PrimType*>(&ptr),\n                                         Cast::toPrimType(oldVal),\n                                         Cast::toPrimType(newVal));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicApplyHelper : public IntrinsicBase<T>\n{\n    typedef PrimType (*BinaryOp)(PrimType*, PrimType);\n    typedef PrimType (*UnaryOp)(PrimType*);\n\n    static ValueType applyBinaryFunction(BinaryOp op, ValueType& ptr,\n                                         ValueType val) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      PrimType primTypeVal = Cast::toPrimType(val);\n      return Cast::fromPrimType(op(primTypePtr, primTypeVal));\n    }\n\n    static ValueType applyUnaryFunction(UnaryOp op, ValueType& ptr) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      return Cast::fromPrimType(op(primTypePtr));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub : public IntrinsicApplyHelper<T>\n{\n    static ValueType add(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::add, ptr, val);\n    }\n    static ValueType sub(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::sub, ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*> : public IntrinsicApplyHelper<T*>\n{\n    static ValueType add(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::add, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::sub, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static ValueType inc(ValueType& ptr) { return add(ptr, 1); }\n    static ValueType dec(ValueType& ptr) { return sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static ValueType or_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::or_, ptr, val);\n    }\n    static ValueType xor_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::xor_, ptr, val);\n    }\n    static ValueType and_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::and_, ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#else\n# error \"Atomic compiler intrinsics are not supported on your platform\"\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBase\n{\n    // We only support 32-bit types on 32-bit Windows, which constrains our\n    // implementation elsewhere.  But we support pointer-sized types everywhere.\n    static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),\n                  \"mozilla/Atomics.h only supports 32-bit and pointer-sized types\");\n\n  protected:\n    typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;\n    typename Intrinsics::ValueType mValue;\n\n  public:\n    AtomicBase() : mValue() {}\n    AtomicBase(T aInit) { Intrinsics::store(mValue, aInit); }\n\n    operator T() const { return Intrinsics::load(mValue); }\n\n    T operator=(T aValue) {\n      Intrinsics::store(mValue, aValue);\n      return aValue;\n    }\n\n    /**\n     * Performs an atomic swap operation.  aValue is stored and the previous\n     * value of this variable is returned.\n     */\n    T exchange(T aValue) {\n      return Intrinsics::exchange(mValue, aValue);\n    }\n\n    /**\n     * Performs an atomic compare-and-swap operation and returns true if it\n     * succeeded. This is equivalent to atomically doing\n     *\n     *   if (mValue == aOldValue) {\n     *     mValue = aNewValue;\n     *     return true;\n     *   } else {\n     *     return false;\n     *   }\n     */\n    bool compareExchange(T aOldValue, T aNewValue) {\n      return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);\n    }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBaseIncDec : public AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    AtomicBaseIncDec() : Base() {}\n    AtomicBaseIncDec(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }\n    T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }\n    T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }\n    T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\n} // namespace detail\n\n/**\n * A wrapper for a type that enforces that all memory accesses are atomic.\n *\n * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in\n * its place.  Implementations for integral and pointer types are provided\n * below.\n *\n * Atomic accesses are sequentially consistent by default.  You should\n * use the default unless you are tall enough to ride the\n * memory-ordering roller coaster (if you're not sure, you aren't) and\n * you have a compelling reason to do otherwise.\n *\n * There is one exception to the case of atomic memory accesses: providing an\n * initial value of the atomic value is not guaranteed to be atomic.  This is a\n * deliberate design choice that enables static atomic variables to be declared\n * without introducing extra static constructors.\n */\ntemplate<typename T,\n         MemoryOrdering Order = SequentiallyConsistent,\n         typename Enable = void>\nclass Atomic;\n\n/**\n * Atomic<T> implementation for integral types.\n *\n * In addition to atomic store and load operations, compound assignment and\n * increment/decrement operators are implemented which perform the\n * corresponding read-modify-write operation atomically.  Finally, an atomic\n * swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsIntegral<T>::value>::Type>\n  : public detail::AtomicBaseIncDec<T, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator+=(T delta) { return Base::Intrinsics::add(Base::mValue, delta) + delta; }\n    T operator-=(T delta) { return Base::Intrinsics::sub(Base::mValue, delta) - delta; }\n    T operator|=(T val) { return Base::Intrinsics::or_(Base::mValue, val) | val; }\n    T operator^=(T val) { return Base::Intrinsics::xor_(Base::mValue, val) ^ val; }\n    T operator&=(T val) { return Base::Intrinsics::and_(Base::mValue, val) & val; }\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for pointer types.\n *\n * An atomic compare-and-swap primitive for pointer variables is provided, as\n * are atomic increment and decement operators.  Also provided are the compound\n * assignment operators for addition and subtraction. Atomic swap (via\n * exchange()) is included as well.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T*, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T* aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T* operator+=(ptrdiff_t delta) {\n      return Base::Intrinsics::add(Base::mValue, delta) + delta;\n    }\n    T* operator-=(ptrdiff_t delta) {\n      return Base::Intrinsics::sub(Base::mValue, delta) - delta;\n    }\n\n  private:\n    Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for enum types.\n *\n * The atomic store and load operations and the atomic swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>\n  : public detail::AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Atomics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Attributes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of various class and method modifier attributes. */\n\n#ifndef mozilla_Attributes_h\n#define mozilla_Attributes_h\n\n#include \"mozilla/Compiler.h\"\n\n/*\n * MOZ_INLINE is a macro which expands to tell the compiler that the method\n * decorated with it should be inlined.  This macro is usable from C and C++\n * code, even though C89 does not support the |inline| keyword.  The compiler\n * may ignore this directive if it chooses.\n */\n#if defined(__cplusplus)\n#  define MOZ_INLINE            inline\n#elif defined(_MSC_VER)\n#  define MOZ_INLINE            __inline\n#elif defined(__GNUC__)\n#  define MOZ_INLINE            __inline__\n#else\n#  define MOZ_INLINE            inline\n#endif\n\n/*\n * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must be inlined, even if the compiler thinks\n * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:\n * compilers are not guaranteed to respect it (although they're much more likely\n * to do so).\n *\n * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the\n * compiler to inline even in DEBUG builds. It should be used very rarely.\n */\n#if defined(_MSC_VER)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __forceinline\n#elif defined(__GNUC__)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     MOZ_INLINE\n#endif\n\n#if defined(DEBUG)\n#  define MOZ_ALWAYS_INLINE     MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG\n#endif\n\n/*\n * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality\n * without warnings (functionality used by the macros below).  These modes are\n * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more\n * standardly, by checking whether __cplusplus has a C++11 or greater value.\n * Current versions of g++ do not correctly set __cplusplus, so we check both\n * for forward compatibility.\n */\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_constexpr)\n#    define MOZ_HAVE_CXX11_CONSTEXPR\n#  endif\n#  if __has_extension(cxx_deleted_functions)\n#    define MOZ_HAVE_CXX11_DELETE\n#  endif\n#  if __has_extension(cxx_override_control)\n#    define MOZ_HAVE_CXX11_OVERRIDE\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  endif\n#  if __has_attribute(noinline)\n#    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))\n#  endif\n#  if __has_attribute(noreturn)\n#    define MOZ_HAVE_NORETURN            __attribute__((noreturn))\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_OVERRIDE\n#      define MOZ_HAVE_CXX11_FINAL       final\n#    endif\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_CONSTEXPR\n#    endif\n#    define MOZ_HAVE_CXX11_DELETE\n#  else\n     /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_FINAL       __final\n#    endif\n#  endif\n#  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))\n#  define MOZ_HAVE_NORETURN              __attribute__((noreturn))\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  else\n     /* MSVC <= 10 used to spell \"final\" as \"sealed\". */\n#    define MOZ_HAVE_CXX11_FINAL         sealed\n#  endif\n#  define MOZ_HAVE_CXX11_OVERRIDE\n#  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)\n#  define MOZ_HAVE_NORETURN              __declspec(noreturn)\n#endif\n\n/*\n * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a\n * function at compile time. A constexpr function cannot examine any values\n * except its arguments and can have no side effects except its return value.\n * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's\n * value may be computed at compile time.  It should be prefered to just\n * marking variables as MOZ_CONSTEXPR because if the compiler does not support\n * constexpr it will fall back to making the variable const, and some compilers\n * do not accept variables being marked both const and constexpr.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_CONSTEXPR         constexpr\n#  define MOZ_CONSTEXPR_VAR     constexpr\n#else\n#  define MOZ_CONSTEXPR         /* no support */\n#  define MOZ_CONSTEXPR_VAR     const\n#endif\n\n/*\n * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must never be inlined, even if the compiler would\n * otherwise choose to inline the method.  Compilers aren't absolutely\n * guaranteed to support this, but most do.\n */\n#if defined(MOZ_HAVE_NEVER_INLINE)\n#  define MOZ_NEVER_INLINE      MOZ_HAVE_NEVER_INLINE\n#else\n#  define MOZ_NEVER_INLINE      /* no support */\n#endif\n\n/*\n * MOZ_NORETURN, specified at the start of a function declaration, indicates\n * that the given function does not return.  (The function definition does not\n * need to be annotated.)\n *\n *   MOZ_NORETURN void abort(const char* msg);\n *\n * This modifier permits the compiler to optimize code assuming a call to such a\n * function will never return.  It also enables the compiler to avoid spurious\n * warnings about not initializing variables, or about any other seemingly-dodgy\n * operations performed after the function returns.\n *\n * This modifier does not affect the corresponding function's linking behavior.\n */\n#if defined(MOZ_HAVE_NORETURN)\n#  define MOZ_NORETURN          MOZ_HAVE_NORETURN\n#else\n#  define MOZ_NORETURN          /* no support */\n#endif\n\n/*\n * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time\n * instrumentation shipped with Clang) to not instrument the annotated function.\n * Furthermore, it will prevent the compiler from inlining the function because\n * inlining currently breaks the blacklisting mechanism of AddressSanitizer.\n */\n#if defined(MOZ_ASAN)\n#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis))\n# else\n#  define MOZ_ASAN_BLACKLIST\n#endif\n\n\n#ifdef __cplusplus\n\n/*\n * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-\n * method declaration, attempts to delete that method from the corresponding\n * class.  An attempt to use the method will always produce an error *at compile\n * time* (instead of sometimes as late as link time) when this macro can be\n * implemented.  For example, you can use MOZ_DELETE to produce classes with no\n * implicit copy constructor or assignment operator:\n *\n *   struct NonCopyable\n *   {\n *     private:\n *       NonCopyable(const NonCopyable& other) MOZ_DELETE;\n *       void operator=(const NonCopyable& other) MOZ_DELETE;\n *   };\n *\n * If MOZ_DELETE can't be implemented for the current compiler, use of the\n * annotated method will still cause an error, but the error might occur at link\n * time in some cases rather than at compile time.\n *\n * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a\n * backstop, method declarations using MOZ_DELETE should be private.\n */\n#if defined(MOZ_HAVE_CXX11_DELETE)\n#  define MOZ_DELETE            = delete\n#else\n#  define MOZ_DELETE            /* no support */\n#endif\n\n/*\n * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class\n * overrides a member function of a base class, rather than potentially being a\n * new member function.  MOZ_OVERRIDE should be placed immediately before the\n * ';' terminating the member function's declaration, or before '= 0;' if the\n * member function is pure.  If the member function is defined in the class\n * definition, it should appear before the opening brace of the function body.\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() = 0;\n *   };\n *   class Derived1 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE;\n *   };\n *   class Derived2 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE = 0;\n *   };\n *   class Derived3 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE { }\n *   };\n *\n * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that\n * the function marked with it override a member function of a base class: it\n * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect\n * semantics and merely documents the override relationship to the reader (but\n * of course must still be used correctly to not break C++11 compilers).\n */\n#if defined(MOZ_HAVE_CXX11_OVERRIDE)\n#  define MOZ_OVERRIDE          override\n#else\n#  define MOZ_OVERRIDE          /* no support */\n#endif\n\n/*\n * MOZ_FINAL indicates that some functionality cannot be overridden through\n * inheritance.  It can be used to annotate either classes/structs or virtual\n * member functions.\n *\n * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after\n * the name of the class, before the list of classes from which it derives (if\n * any) and before its opening brace.  MOZ_FINAL must not be used to annotate\n * unnamed classes or structs.  (With some compilers, and with C++11 proper, the\n * underlying expansion is ambiguous with specifying a class name.)\n *\n *   class Base MOZ_FINAL\n *   {\n *     public:\n *       Base();\n *       ~Base();\n *       virtual void f() { }\n *   };\n *   // This will be an error in some compilers:\n *   class Derived : public Base\n *   {\n *     public:\n *       ~Derived() { }\n *   };\n *\n * One particularly common reason to specify MOZ_FINAL upon a class is to tell\n * the compiler that it's not dangerous for it to have a non-virtual destructor\n * yet have one or more virtual functions, silencing the warning it might emit\n * in this case.  Suppose Base above weren't annotated with MOZ_FINAL.  Because\n * ~Base() is non-virtual, an attempt to delete a Derived* through a Base*\n * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen.\n * (Formally C++ says behavior is undefined, but compilers will likely just call\n * ~Base() and not ~Derived().)  Specifying MOZ_FINAL tells the compiler that\n * it's safe for the destructor to be non-virtual.\n *\n * In compilers implementing final controls, it is an error to inherit from a\n * class annotated with MOZ_FINAL.  In other compilers it serves only as\n * documentation.\n *\n * To annotate a virtual member function with MOZ_FINAL, place MOZ_FINAL\n * immediately before the ';' terminating the member function's declaration, or\n * before '= 0;' if the member function is pure.  If the member function is\n * defined in the class definition, it should appear before the opening brace of\n * the function body.  (This placement is identical to that for MOZ_OVERRIDE.\n * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE'\n * for consistency.)\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() MOZ_FINAL;\n *   };\n *   class Derived\n *   {\n *     public:\n *       // This will be an error in some compilers:\n *       virtual void f();\n *   };\n *\n * In compilers implementing final controls, it is an error for a derived class\n * to override a method annotated with MOZ_FINAL.  In other compilers it serves\n * only as documentation.\n */\n#if defined(MOZ_HAVE_CXX11_FINAL)\n#  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL\n#else\n#  define MOZ_FINAL             /* no support */\n#endif\n\n/**\n * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's\n * return value is not used by the caller.\n *\n * Place this attribute at the very beginning of a function definition. For\n * example, write\n *\n *   MOZ_WARN_UNUSED_RESULT int foo();\n *\n * or\n *\n *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }\n */\n#if defined(__GNUC__) || defined(__clang__)\n#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))\n#else\n#  define MOZ_WARN_UNUSED_RESULT\n#endif\n\n/*\n * The following macros are attributes that support the static analysis plugin\n * included with Mozilla, and will be implemented (when such support is enabled)\n * as C++11 attributes. Since such attributes are legal pretty much everywhere\n * and have subtly different semantics depending on their placement, the\n * following is a guide on where to place the attributes.\n *\n * Attributes that apply to a struct or class precede the name of the class:\n * (Note that this is different from the placement of MOZ_FINAL for classes!)\n *\n *   class MOZ_CLASS_ATTRIBUTE SomeClass {};\n *\n * Attributes that apply to functions follow the parentheses and const\n * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body:\n *\n *   void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE;\n *   void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {}\n *   void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0;\n *   void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE;\n *\n * Attributes that apply to variables or parameters follow the variable's name:\n *\n *   int variable MOZ_VARIABLE_ATTRIBUTE;\n *\n * Attributes that apply to types follow the type name:\n *\n *   typedef int MOZ_TYPE_ATTRIBUTE MagicInt;\n *   int MOZ_TYPE_ATTRIBUTE someVariable;\n *   int * MOZ_TYPE_ATTRIBUTE magicPtrInt;\n *   int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt;\n *\n * Attributes that apply to statements precede the statement:\n *\n *   MOZ_IF_ATTRIBUTE if (x == 0)\n *   MOZ_DO_ATTRIBUTE do { } while(0);\n *\n * Attributes that apply to labels precede the label:\n *\n *   MOZ_LABEL_ATTRIBUTE target:\n *     goto target;\n *   MOZ_CASE_ATTRIBUTE case 5:\n *   MOZ_DEFAULT_ATTRIBUTE default:\n *\n * The static analyses that are performed by the plugin are as follows:\n *\n * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate\n *   subclasses must provide an exact override of this method; if a subclass\n *   does not override this method, the compiler will emit an error. This\n *   attribute is not limited to virtual methods, so if it is applied to a\n *   nonvirtual method and the subclass does not provide an equivalent\n *   definition, the compiler will emit an error.\n * MOZ_STACK_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack, so it is a compile-time error to use it, or\n *   an array of such objects, as a global or static variable, or as the type of\n *   a new expression (unless placement new is being used). If a member of\n *   another class uses this class, or if another class inherits from this\n *   class, then it is considered to be a stack class as well, although this\n *   attribute need not be provided in such cases.\n * MOZ_NONHEAP_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack or in static storage, so it is a compile-time\n *   error to use it, or an array of such objects, as the type of a new\n *   expression (unless placement new is being used). If a member of another\n *   class uses this class, or if another class inherits from this class, then\n *   it is considered to be a non-heap class as well, although this attribute\n *   need not be provided in such cases.\n */\n#ifdef MOZ_CLANG_PLUGIN\n# define MOZ_MUST_OVERRIDE __attribute__((annotate(\"moz_must_override\")))\n# define MOZ_STACK_CLASS __attribute__((annotate(\"moz_stack_class\")))\n# define MOZ_NONHEAP_CLASS __attribute__((annotate(\"moz_nonheap_class\")))\n#else\n# define MOZ_MUST_OVERRIDE /* nothing */\n# define MOZ_STACK_CLASS /* nothing */\n# define MOZ_NONHEAP_CLASS /* nothing */\n#endif /* MOZ_CLANG_PLUGIN */\n\n/*\n * MOZ_THIS_IN_INITIALIZER_LIST is used to avoid a warning when we know that\n * it's safe to use 'this' in an initializer list.\n */\n#ifdef _MSC_VER\n#  define MOZ_THIS_IN_INITIALIZER_LIST() \\\n     __pragma(warning(push)) \\\n     __pragma(warning(disable:4355)) \\\n     this \\\n     __pragma(warning(pop))\n#else\n#  define MOZ_THIS_IN_INITIALIZER_LIST() this\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_Attributes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/BloomFilter.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A counting Bloom filter implementation.  This allows consumers to\n * do fast probabilistic \"is item X in set Y?\" testing which will\n * never answer \"no\" when the correct answer is \"yes\" (but might\n * incorrectly answer \"yes\" when the correct answer is \"no\").\n */\n\n#ifndef mozilla_BloomFilter_h\n#define mozilla_BloomFilter_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Likely.h\"\n#include \"mozilla/Util.h\"\n\n#include <stdint.h>\n#include <string.h>\n\nnamespace mozilla {\n\n/*\n * This class implements a counting Bloom filter as described at\n * <http://en.wikipedia.org/wiki/Bloom_filter#Counting_filters>, with\n * 8-bit counters.  This allows quick probabilistic answers to the\n * question \"is object X in set Y?\" where the contents of Y might not\n * be time-invariant.  The probabilistic nature of the test means that\n * sometimes the answer will be \"yes\" when it should be \"no\".  If the\n * answer is \"no\", then X is guaranteed not to be in Y.\n *\n * The filter is parametrized on KeySize, which is the size of the key\n * generated by each of hash functions used by the filter, in bits,\n * and the type of object T being added and removed.  T must implement\n * a |uint32_t hash() const| method which returns a uint32_t hash key\n * that will be used to generate the two separate hash functions for\n * the Bloom filter.  This hash key MUST be well-distributed for good\n * results!  KeySize is not allowed to be larger than 16.\n *\n * The filter uses exactly 2**KeySize bytes of memory.  From now on we\n * will refer to the memory used by the filter as M.\n *\n * The expected rate of incorrect \"yes\" answers depends on M and on\n * the number N of objects in set Y.  As long as N is small compared\n * to M, the rate of such answers is expected to be approximately\n * 4*(N/M)**2 for this filter.  In practice, if Y has a few hundred\n * elements then using a KeySize of 12 gives a reasonably low\n * incorrect answer rate.  A KeySize of 12 has the additional benefit\n * of using exactly one page for the filter in typical hardware\n * configurations.\n */\n\ntemplate<unsigned KeySize, class T>\nclass BloomFilter\n{\n    /*\n     * A counting Bloom filter with 8-bit counters.  For now we assume\n     * that having two hash functions is enough, but we may revisit that\n     * decision later.\n     *\n     * The filter uses an array with 2**KeySize entries.\n     *\n     * Assuming a well-distributed hash function, a Bloom filter with\n     * array size M containing N elements and\n     * using k hash function has expected false positive rate exactly\n     *\n     * $  (1 - (1 - 1/M)^{kN})^k  $\n     *\n     * because each array slot has a\n     *\n     * $  (1 - 1/M)^{kN}  $\n     *\n     * chance of being 0, and the expected false positive rate is the\n     * probability that all of the k hash functions will hit a nonzero\n     * slot.\n     *\n     * For reasonable assumptions (M large, kN large, which should both\n     * hold if we're worried about false positives) about M and kN this\n     * becomes approximately\n     *\n     * $$  (1 - \\exp(-kN/M))^k   $$\n     *\n     * For our special case of k == 2, that's $(1 - \\exp(-2N/M))^2$,\n     * or in other words\n     *\n     * $$    N/M = -0.5 * \\ln(1 - \\sqrt(r))   $$\n     *\n     * where r is the false positive rate.  This can be used to compute\n     * the desired KeySize for a given load N and false positive rate r.\n     *\n     * If N/M is assumed small, then the false positive rate can\n     * further be approximated as 4*N^2/M^2.  So increasing KeySize by\n     * 1, which doubles M, reduces the false positive rate by about a\n     * factor of 4, and a false positive rate of 1% corresponds to\n     * about M/N == 20.\n     *\n     * What this means in practice is that for a few hundred keys using a\n     * KeySize of 12 gives false positive rates on the order of 0.25-4%.\n     *\n     * Similarly, using a KeySize of 10 would lead to a 4% false\n     * positive rate for N == 100 and to quite bad false positive\n     * rates for larger N.\n     */\n  public:\n    BloomFilter() {\n        static_assert(KeySize <= keyShift, \"KeySize too big\");\n\n        // Should we have a custom operator new using calloc instead and\n        // require that we're allocated via the operator?\n        clear();\n    }\n\n    /*\n     * Clear the filter.  This should be done before reusing it, because\n     * just removing all items doesn't clear counters that hit the upper\n     * bound.\n     */\n    void clear();\n\n    /*\n     * Add an item to the filter.\n     */\n    void add(const T* t);\n\n    /*\n     * Remove an item from the filter.\n     */\n    void remove(const T* t);\n\n    /*\n     * Check whether the filter might contain an item.  This can\n     * sometimes return true even if the item is not in the filter,\n     * but will never return false for items that are actually in the\n     * filter.\n     */\n    bool mightContain(const T* t) const;\n\n    /*\n     * Methods for add/remove/contain when we already have a hash computed\n     */\n    void add(uint32_t hash);\n    void remove(uint32_t hash);\n    bool mightContain(uint32_t hash) const;\n\n  private:\n    static const size_t arraySize = (1 << KeySize);\n    static const uint32_t keyMask = (1 << KeySize) - 1;\n    static const uint32_t keyShift = 16;\n\n    static uint32_t hash1(uint32_t hash) { return hash & keyMask; }\n    static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; }\n\n    uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; }\n    uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; }\n    const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; }\n    const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; }\n\n    static bool full(const uint8_t& slot) { return slot == UINT8_MAX; }\n\n    uint8_t counters[arraySize];\n};\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::clear()\n{\n  memset(counters, 0, arraySize);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::add(uint32_t hash)\n{\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    ++slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    ++slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::add(const T* t)\n{\n  uint32_t hash = t->hash();\n  return add(hash);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::remove(uint32_t hash)\n{\n  // If the slots are full, we don't know whether we bumped them to be\n  // there when we added or not, so just leave them full.\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    --slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    --slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::remove(const T* t)\n{\n  uint32_t hash = t->hash();\n  remove(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(uint32_t hash) const\n{\n  // Check that all the slots for this hash contain something\n  return firstSlot(hash) && secondSlot(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(const T* t) const\n{\n  uint32_t hash = t->hash();\n  return mightContain(hash);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_BloomFilter_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Casting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cast operations to supplement the built-in casting operations. */\n\n#ifndef mozilla_Casting_h\n#define mozilla_Casting_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <limits.h>\n\nnamespace mozilla {\n\n/**\n * Return a value of type |To|, containing the underlying bit pattern of |from|.\n *\n * |To| and |From| must be types of the same size; be careful of cross-platform\n * size differences, or this might fail to compile on some but not all\n * platforms.\n */\ntemplate<typename To, typename From>\ninline To\nBitwiseCast(const From from)\n{\n  static_assert(sizeof(From) == sizeof(To),\n                \"To and From must have the same size\");\n  union {\n    From from;\n    To to;\n  } u;\n  u.from = from;\n  return u.to;\n}\n\nnamespace detail {\n\nenum ToSignedness { ToIsSigned, ToIsUnsigned };\nenum FromSignedness { FromIsSigned, FromIsUnsigned };\n\ntemplate<typename From,\n         typename To,\n         FromSignedness = IsSigned<From>::value ? FromIsSigned : FromIsUnsigned,\n         ToSignedness = IsSigned<To>::value ? ToIsSigned : ToIsUnsigned>\nstruct BoundsCheckImpl;\n\n// Implicit conversions on operands to binary operations make this all a bit\n// hard to verify.  Attempt to ease the pain below by *only* comparing values\n// that are obviously the same type (and will undergo no further conversions),\n// even when it's not strictly necessary, for explicitness.\n\nenum UUComparison { FromIsBigger, FromIsNotBigger };\n\n// Unsigned-to-unsigned range check\n\ntemplate<typename From, typename To,\n         UUComparison = (sizeof(From) > sizeof(To)) ? FromIsBigger : FromIsNotBigger>\nstruct UnsignedUnsignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return from <= From(To(-1));\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsNotBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedUnsignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-unsigned range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (from < 0)\n        return false;\n      if (sizeof(To) >= sizeof(From))\n        return true;\n      return from <= From(To(-1));\n    }\n};\n\n// Unsigned-to-signed range check\n\nenum USComparison { FromIsSmaller, FromIsNotSmaller };\n\ntemplate<typename From, typename To,\n         USComparison = (sizeof(From) < sizeof(To)) ? FromIsSmaller : FromIsNotSmaller>\nstruct UnsignedSignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsNotSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      return from <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedSignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-signed range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (sizeof(From) <= sizeof(To))\n        return true;\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      const To MinValue = -MaxValue - To(1);\n      return From(MinValue) <= from &&\n             From(from) <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To,\n         bool TypesAreIntegral = IsIntegral<From>::value && IsIntegral<To>::value>\nclass BoundsChecker;\n\ntemplate<typename From>\nclass BoundsChecker<From, From, true>\n{\n  public:\n    static bool checkBounds(const From from) { return true; }\n};\n\ntemplate<typename From, typename To>\nclass BoundsChecker<From, To, true>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return BoundsCheckImpl<From, To>::checkBounds(from);\n    }\n};\n\ntemplate<typename From, typename To>\ninline bool\nIsInBounds(const From from)\n{\n  return BoundsChecker<From, To>::checkBounds(from);\n}\n\n} // namespace detail\n\n/**\n * Cast a value of integral type |From| to a value of integral type |To|,\n * asserting that the cast will be a safe cast per C++ (that is, that |to| is in\n * the range of values permitted for the type |From|).\n */\ntemplate<typename To, typename From>\ninline To\nSafeCast(const From from)\n{\n  MOZ_ASSERT((detail::IsInBounds<From, To>(from)));\n  return static_cast<To>(from);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Casting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Char16.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implements a UTF-16 character type. */\n\n#ifndef mozilla_Char16_h\n#define mozilla_Char16_h\n\n#include \"mozilla/Assertions.h\"\n\n/*\n * C11 and C++11 introduce a char16_t type and support for UTF-16 string and\n * character literals. C++11's char16_t is a distinct builtin type. C11's\n * char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit\n * code unit of a Unicode code point, not a \"character\".\n *\n * For now, Char16.h only supports C++ because we don't want mix different C\n * and C++ definitions of char16_t in the same code base.\n */\n\n#ifdef _MSC_VER\n   /*\n    * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h\n    * typedefs char16_t as an unsigned short. We would like to alias char16_t\n    * to Windows's 16-bit wchar_t so we can declare UTF-16 literals as constant\n    * expressions (and pass char16_t pointers to Windows APIs). We #define our\n    * char16_t as a macro to override yval.h's typedef of the same name.\n    */\n#  define MOZ_UTF16_HELPER(s) L##s\n#  include <yvals.h>\n#  define char16_t wchar_t\n#elif defined(__cplusplus) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))\n   /* C++11 has a builtin char16_t type. */\n#  define MOZ_UTF16_HELPER(s) u##s\n#else\n#  error \"Char16.h requires C++11 (or something like it) for UTF-16 support.\"\n#endif\n\n/*\n * Macro arguments used in concatenation or stringification won't be expanded.\n * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to\n * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper\n * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro\n * argument to expand. See \"3.10.6 Separate Expansion of Macro Arguments\" of the\n * CPP manual for a more accurate and precise explanation.\n */\n#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)\n\nstatic_assert(sizeof(char16_t) == 2, \"Is char16_t type 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16('A')) == 2, \"Is char literal 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16(\"\")[0]) == 2, \"Is string char 16 bits?\");\n\n#endif /* mozilla_Char16_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/CheckedInt.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Provides checked integers, detecting integer overflow and divide-by-0. */\n\n#ifndef mozilla_CheckedInt_h\n#define mozilla_CheckedInt_h\n\n// Enable relying of Mozilla's MFBT for possibly-available C++11 features\n#define MOZ_CHECKEDINT_USE_MFBT\n\n#include <stdint.h>\n\n#ifdef MOZ_CHECKEDINT_USE_MFBT\n#  include \"mozilla/Assertions.h\"\n#else\n#  include <cassert>\n#  define MOZ_ASSERT(cond, reason) assert((cond) && reason)\n#  define MOZ_DELETE\n#endif\n\n#include <climits>\n#include <cstddef>\n\nnamespace mozilla {\n\ntemplate<typename T> class CheckedInt;\n\nnamespace detail {\n\n/*\n * Step 1: manually record supported types\n *\n * What's nontrivial here is that there are different families of integer\n * types: basic integer types and stdint types. It is merrily undefined which\n * types from one family may be just typedefs for a type from another family.\n *\n * For example, on GCC 4.6, aside from the basic integer types, the only other\n * type that isn't just a typedef for some of them, is int8_t.\n */\n\nstruct UnsupportedType {};\n\ntemplate<typename IntegerType>\nstruct IsSupportedPass2\n{\n    static const bool value = false;\n};\n\ntemplate<typename IntegerType>\nstruct IsSupported\n{\n    static const bool value = IsSupportedPass2<IntegerType>::value;\n};\n\ntemplate<>\nstruct IsSupported<int8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int64_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint64_t>\n{ static const bool value = true; };\n\n\ntemplate<>\nstruct IsSupportedPass2<char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<signed char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long long>\n{ static const bool value = true; };\n\n/*\n * Step 2: some integer-traits kind of stuff.\n */\n\ntemplate<size_t Size, bool Signedness>\nstruct StdintTypeForSizeAndSignedness\n{};\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, true>\n{ typedef int8_t   Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, false>\n{ typedef uint8_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, true>\n{ typedef int16_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, false>\n{ typedef uint16_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, true>\n{ typedef int32_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, false>\n{ typedef uint32_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, true>\n{ typedef int64_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, false>\n{ typedef uint64_t Type; };\n\ntemplate<typename IntegerType>\nstruct UnsignedType\n{\n    typedef typename StdintTypeForSizeAndSignedness<sizeof(IntegerType),\n                                                    false>::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct IsSigned\n{\n    static const bool value = IntegerType(-1) <= IntegerType(0);\n};\n\ntemplate<typename IntegerType, size_t Size = sizeof(IntegerType)>\nstruct TwiceBiggerType\n{\n    typedef typename StdintTypeForSizeAndSignedness<\n                       sizeof(IntegerType) * 2,\n                       IsSigned<IntegerType>::value\n                     >::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct TwiceBiggerType<IntegerType, 8>\n{\n    typedef UnsupportedType Type;\n};\n\ntemplate<typename IntegerType>\nstruct PositionOfSignBit\n{\n    static const size_t value = CHAR_BIT * sizeof(IntegerType) - 1;\n};\n\ntemplate<typename IntegerType>\nstruct MinValue\n{\n  private:\n    typedef typename UnsignedType<IntegerType>::Type UnsignedIntegerType;\n    static const size_t PosOfSignBit = PositionOfSignBit<IntegerType>::value;\n\n  public:\n    // Bitwise ops may return a larger type, that's why we cast explicitly.\n    // In C++, left bit shifts on signed values is undefined by the standard\n    // unless the shifted value is representable.\n    // Notice that signed-to-unsigned conversions are always well-defined in\n    // the standard as the value congruent to 2**n, as expected. By contrast,\n    // unsigned-to-signed is only well-defined if the value is representable.\n    static const IntegerType value =\n        IsSigned<IntegerType>::value\n        ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit)\n        : IntegerType(0);\n};\n\ntemplate<typename IntegerType>\nstruct MaxValue\n{\n    // Tricksy, but covered by the unit test.\n    // Relies heavily on the type of MinValue<IntegerType>::value\n    // being IntegerType.\n    static const IntegerType value = ~MinValue<IntegerType>::value;\n};\n\n/*\n * Step 3: Implement the actual validity checks.\n *\n * Ideas taken from IntegerLib, code different.\n */\n\ntemplate<typename T>\ninline bool\nHasSignBit(T x)\n{\n  // In C++, right bit shifts on negative values is undefined by the standard.\n  // Notice that signed-to-unsigned conversions are always well-defined in the\n  // standard, as the value congruent modulo 2**n as expected. By contrast,\n  // unsigned-to-signed is only well-defined if the value is representable.\n  return bool(typename UnsignedType<T>::Type(x)\n                >> PositionOfSignBit<T>::value);\n}\n\n// Bitwise ops may return a larger type, so it's good to use this inline\n// helper guaranteeing that the result is really of type T.\ntemplate<typename T>\ninline T\nBinaryComplement(T x)\n{\n  return ~x;\n}\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value>\nstruct DoesRangeContainRange\n{\n};\n\ntemplate<typename T, typename U, bool Signedness>\nstruct DoesRangeContainRange<T, U, Signedness, Signedness>\n{\n    static const bool value = sizeof(T) >= sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, true, false>\n{\n    static const bool value = sizeof(T) > sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, false, true>\n{\n    static const bool value = false;\n};\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value,\n         bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>\nstruct IsInRangeImpl {};\n\ntemplate<typename T, typename U, bool IsTSigned, bool IsUSigned>\nstruct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>\n{\n    static bool run(U)\n    {\n       return true;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, true, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value && x >= MinValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, false, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, false, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) > sizeof(U) || x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, true, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) >= sizeof(U)\n             ? x >= 0\n             : x >= 0 && x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\ninline bool\nIsInRange(U x)\n{\n  return IsInRangeImpl<T, U>::run(x);\n}\n\ntemplate<typename T>\ninline bool\nIsAddValid(T x, T y)\n{\n  // Addition is valid if the sign of x+y is equal to either that of x or that\n  // of y. Since the value of x+y is undefined if we have a signed type, we\n  // compute it using the unsigned type of the same size.\n  // Beware! These bitwise operations can return a larger integer type,\n  // if T was a small type like int8_t, so we explicitly cast to T.\n\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux + uy;\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y))))\n         : BinaryComplement(x) >= y;\n}\n\ntemplate<typename T>\ninline bool\nIsSubValid(T x, T y)\n{\n  // Subtraction is valid if either x and y have same sign, or x-y and x have\n  // same sign. Since the value of x-y is undefined if we have a signed type,\n  // we compute it using the unsigned type of the same size.\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux - uy;\n\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y))))\n         : x >= y;\n}\n\ntemplate<typename T,\n         bool IsTSigned = IsSigned<T>::value,\n         bool TwiceBiggerTypeIsSupported =\n           IsSupported<typename TwiceBiggerType<T>::Type>::value>\nstruct IsMulValidImpl {};\n\ntemplate<typename T, bool IsTSigned>\nstruct IsMulValidImpl<T, IsTSigned, true>\n{\n    static bool run(T x, T y)\n    {\n      typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;\n      TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y);\n      return IsInRange<T>(product);\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, true, false>\n{\n    static bool run(T x, T y)\n    {\n      const T max = MaxValue<T>::value;\n      const T min = MinValue<T>::value;\n\n      if (x == 0 || y == 0)\n        return true;\n\n      if (x > 0) {\n        return y > 0\n               ? x <= max / y\n               : y >= min / x;\n      }\n\n      // If we reach this point, we know that x < 0.\n      return y > 0\n             ? x >= min / y\n             : y >= max / x;\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, false, false>\n{\n    static bool run(T x, T y)\n    {\n      return y == 0 ||  x <= MaxValue<T>::value / y;\n    }\n};\n\ntemplate<typename T>\ninline bool\nIsMulValid(T x, T y)\n{\n  return IsMulValidImpl<T>::run(x, y);\n}\n\ntemplate<typename T>\ninline bool\nIsDivValid(T x, T y)\n{\n  // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max.\n  return y != 0 &&\n         !(IsSigned<T>::value && x == MinValue<T>::value && y == T(-1));\n}\n\ntemplate<typename T, bool IsTSigned = IsSigned<T>::value>\nstruct IsModValidImpl;\n\ntemplate<typename T>\ninline bool\nIsModValid(T x, T y)\n{\n  return IsModValidImpl<T>::run(x, y);\n}\n\n/*\n * Mod is pretty simple.\n * For now, let's just use the ANSI C definition:\n * If x or y are negative, the results are implementation defined.\n *   Consider these invalid.\n * Undefined for y=0.\n * The result will never exceed either x or y.\n *\n * Checking that x>=0 is a warning when T is unsigned.\n */\n\ntemplate<typename T>\nstruct IsModValidImpl<T, false> {\n  static inline bool run(T x, T y) {\n    return y >= 1;\n  }\n};\n\ntemplate<typename T>\nstruct IsModValidImpl<T, true> {\n  static inline bool run(T x, T y) {\n    if (x < 0)\n      return false;\n\n    return y >= 1;\n  }\n};\n\ntemplate<typename T, bool IsSigned = IsSigned<T>::value>\nstruct NegateImpl;\n\ntemplate<typename T>\nstruct NegateImpl<T, false>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Handle negation separately for signed/unsigned, for simpler code and to\n      // avoid an MSVC warning negating an unsigned value.\n      return CheckedInt<T>(0, val.isValid() && val.mValue == 0);\n    }\n};\n\ntemplate<typename T>\nstruct NegateImpl<T, true>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Watch out for the min-value, which (with twos-complement) can't be\n      // negated as -min-value is then (max-value + 1).\n      if (!val.isValid() || val.mValue == MinValue<T>::value)\n        return CheckedInt<T>(val.mValue, false);\n      return CheckedInt<T>(-val.mValue, true);\n    }\n};\n\n} // namespace detail\n\n\n/*\n * Step 4: Now define the CheckedInt class.\n */\n\n/**\n * @class CheckedInt\n * @brief Integer wrapper class checking for integer overflow and other errors\n * @param T the integer type to wrap. Can be any type among the following:\n *            - any basic integer type such as |int|\n *            - any stdint type such as |int8_t|\n *\n * This class implements guarded integer arithmetic. Do a computation, check\n * that isValid() returns true, you then have a guarantee that no problem, such\n * as integer overflow, happened during this computation, and you can call\n * value() to get the plain integer value.\n *\n * The arithmetic operators in this class are guaranteed not to raise a signal\n * (e.g. in case of a division by zero).\n *\n * For example, suppose that you want to implement a function that computes\n * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by\n * zero or integer overflow). You could code it as follows:\n   @code\n   bool computeXPlusYOverZ(int x, int y, int z, int *result)\n   {\n       CheckedInt<int> checkedResult = (CheckedInt<int>(x) + y) / z;\n       if (checkedResult.isValid()) {\n           *result = checkedResult.value();\n           return true;\n       } else {\n           return false;\n       }\n   }\n   @endcode\n *\n * Implicit conversion from plain integers to checked integers is allowed. The\n * plain integer is checked to be in range before being casted to the\n * destination type. This means that the following lines all compile, and the\n * resulting CheckedInts are correctly detected as valid or invalid:\n * @code\n   // 1 is of type int, is found to be in range for uint8_t, x is valid\n   CheckedInt<uint8_t> x(1);\n   // -1 is of type int, is found not to be in range for uint8_t, x is invalid\n   CheckedInt<uint8_t> x(-1);\n   // -1 is of type int, is found to be in range for int8_t, x is valid\n   CheckedInt<int8_t> x(-1);\n   // 1000 is of type int16_t, is found not to be in range for int8_t,\n   // x is invalid\n   CheckedInt<int8_t> x(int16_t(1000));\n   // 3123456789 is of type uint32_t, is found not to be in range for int32_t,\n   // x is invalid\n   CheckedInt<int32_t> x(uint32_t(3123456789));\n * @endcode\n * Implicit conversion from\n * checked integers to plain integers is not allowed. As shown in the\n * above example, to get the value of a checked integer as a normal integer,\n * call value().\n *\n * Arithmetic operations between checked and plain integers is allowed; the\n * result type is the type of the checked integer.\n *\n * Checked integers of different types cannot be used in the same arithmetic\n * expression.\n *\n * There are convenience typedefs for all stdint types, of the following form\n * (these are just 2 examples):\n   @code\n   typedef CheckedInt<int32_t> CheckedInt32;\n   typedef CheckedInt<uint16_t> CheckedUint16;\n   @endcode\n */\ntemplate<typename T>\nclass CheckedInt\n{\n  protected:\n    T mValue;\n    bool mIsValid;\n\n    template<typename U>\n    CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid)\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    friend struct detail::NegateImpl<T>;\n\n  public:\n    /**\n     * Constructs a checked integer with given @a value. The checked integer is\n     * initialized as valid or invalid depending on whether the @a value\n     * is in range.\n     *\n     * This constructor is not explicit. Instead, the type of its argument is a\n     * separate template parameter, ensuring that no conversion is performed\n     * before this constructor is actually called. As explained in the above\n     * documentation for class CheckedInt, this constructor checks that its\n     * argument is valid.\n     */\n    template<typename U>\n    CheckedInt(U value)\n      : mValue(T(value)),\n        mIsValid(detail::IsInRange<T>(value))\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    template<typename U>\n    friend class CheckedInt;\n\n    template<typename U>\n    CheckedInt<U> toChecked() const\n    {\n      CheckedInt<U> ret(mValue);\n      ret.mIsValid = ret.mIsValid && mIsValid;\n      return ret;\n    }\n\n    /** Constructs a valid checked integer with initial value 0 */\n    CheckedInt() : mValue(0), mIsValid(true)\n    {\n      static_assert(detail::IsSupported<T>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    /** @returns the actual value */\n    T value() const\n    {\n      MOZ_ASSERT(mIsValid, \"Invalid checked integer (division by zero or integer overflow)\");\n      return mValue;\n    }\n\n    /**\n     * @returns true if the checked integer is valid, i.e. is not the result\n     * of an invalid operation or of an operation involving an invalid checked\n     * integer\n     */\n    bool isValid() const\n    {\n      return mIsValid;\n    }\n\n    template<typename U>\n    friend CheckedInt<U> operator +(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator +=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator -(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator -=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator *(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator *=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator /(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator /=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator %(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator %=(U rhs);\n\n    CheckedInt operator -() const\n    {\n      return detail::NegateImpl<T>::negate(*this);\n    }\n\n    /**\n     * @returns true if the left and right hand sides are valid\n     * and have the same value.\n     *\n     * Note that these semantics are the reason why we don't offer\n     * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)\n     * but that would mean that whenever a or b is invalid, a!=b\n     * is always true, which would be very confusing.\n     *\n     * For similar reasons, operators <, >, <=, >= would be very tricky to\n     * specify, so we just avoid offering them.\n     *\n     * Notice that these == semantics are made more reasonable by these facts:\n     *  1. a==b implies equality at the raw data level\n     *     (the converse is false, as a==b is never true among invalids)\n     *  2. This is similar to the behavior of IEEE floats, where a==b\n     *     means that a and b have the same value *and* neither is NaN.\n     */\n    bool operator ==(const CheckedInt& other) const\n    {\n      return mIsValid && other.mIsValid && mValue == other.mValue;\n    }\n\n    /** prefix ++ */\n    CheckedInt& operator++()\n    {\n      *this += 1;\n      return *this;\n    }\n\n    /** postfix ++ */\n    CheckedInt operator++(int)\n    {\n      CheckedInt tmp = *this;\n      *this += 1;\n      return tmp;\n    }\n\n    /** prefix -- */\n    CheckedInt& operator--()\n    {\n      *this -= 1;\n      return *this;\n    }\n\n    /** postfix -- */\n    CheckedInt operator--(int)\n    {\n      CheckedInt tmp = *this;\n      *this -= 1;\n      return tmp;\n    }\n\n  private:\n    /**\n     * The !=, <, <=, >, >= operators are disabled:\n     * see the comment on operator==.\n     */\n    template<typename U>\n    bool operator !=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >=(U other) const MOZ_DELETE;\n};\n\n#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                \\\ntemplate<typename T>                                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs,            \\\n                                 const CheckedInt<T> &rhs)            \\\n{                                                                     \\\n  if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue))               \\\n    return CheckedInt<T>(0, false);                                   \\\n                                                                      \\\n  return CheckedInt<T>(lhs.mValue OP rhs.mValue,                      \\\n                       lhs.mIsValid && rhs.mIsValid);                 \\\n}\n\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)\n\n#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR\n\n// Implement castToCheckedInt<T>(x), making sure that\n//  - it allows x to be either a CheckedInt<T> or any integer type\n//    that can be casted to T\n//  - if x is already a CheckedInt<T>, we just return a reference to it,\n//    instead of copying it (optimization)\n\nnamespace detail {\n\ntemplate<typename T, typename U>\nstruct CastToCheckedIntImpl\n{\n    typedef CheckedInt<T> ReturnType;\n    static CheckedInt<T> run(U u) { return u; }\n};\n\ntemplate<typename T>\nstruct CastToCheckedIntImpl<T, CheckedInt<T> >\n{\n    typedef const CheckedInt<T>& ReturnType;\n    static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }\n};\n\n} // namespace detail\n\ntemplate<typename T, typename U>\ninline typename detail::CastToCheckedIntImpl<T, U>::ReturnType\ncastToCheckedInt(U u)\n{\n  static_assert(detail::IsSupported<T>::value &&\n                detail::IsSupported<U>::value,\n                \"This type is not supported by CheckedInt\");\n  return detail::CastToCheckedIntImpl<T, U>::run(u);\n}\n\n#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)  \\\ntemplate<typename T>                                              \\\ntemplate<typename U>                                              \\\nCheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U rhs)         \\\n{                                                                 \\\n  *this = *this OP castToCheckedInt<T>(rhs);                      \\\n  return *this;                                                   \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs, U rhs) \\\n{                                                                 \\\n  return lhs OP castToCheckedInt<T>(rhs);                         \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(U lhs, const CheckedInt<T> &rhs) \\\n{                                                                 \\\n  return castToCheckedInt<T>(lhs) OP rhs;                         \\\n}\n\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)\n\n#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(const CheckedInt<T> &lhs, U rhs)\n{\n  return lhs == castToCheckedInt<T>(rhs);\n}\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(U  lhs, const CheckedInt<T> &rhs)\n{\n  return castToCheckedInt<T>(lhs) == rhs;\n}\n\n// Convenience typedefs.\ntypedef CheckedInt<int8_t>   CheckedInt8;\ntypedef CheckedInt<uint8_t>  CheckedUint8;\ntypedef CheckedInt<int16_t>  CheckedInt16;\ntypedef CheckedInt<uint16_t> CheckedUint16;\ntypedef CheckedInt<int32_t>  CheckedInt32;\ntypedef CheckedInt<uint32_t> CheckedUint32;\ntypedef CheckedInt<int64_t>  CheckedInt64;\ntypedef CheckedInt<uint64_t> CheckedUint64;\n\n} // namespace mozilla\n\n#endif /* mozilla_CheckedInt_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Compiler.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various compiler checks. */\n\n#ifndef mozilla_Compiler_h\n#define mozilla_Compiler_h\n\n#if !defined(__clang__) && defined(__GNUC__)\n\n#define MOZ_IS_GCC 1\n   /*\n    * This macro should simplify gcc version checking. For example, to check\n    * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`.\n    */\n#  define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel)          \\\n     ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \\\n      >= ((major) * 10000 + (minor) * 100 + (patchlevel)))\n#if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0)\n#  error \"mfbt (and Gecko) require at least gcc 4.4 to build.\"\n#endif\n\n#else\n\n#define MOZ_IS_GCC 0\n\n#endif\n\n#endif /* mozilla_Compiler_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Constants.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt math constants. */\n\n#ifndef mozilla_Constants_h\n#define mozilla_Constants_h\n\n#ifndef M_PI\n#  define M_PI 3.14159265358979323846\n#endif\n\n#endif /* mozilla_Constants_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/DebugOnly.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides DebugOnly, a type for variables used only in debug builds (i.e. by\n * assertions).\n */\n\n#ifndef mozilla_DebugOnly_h\n#define mozilla_DebugOnly_h\n\nnamespace mozilla {\n\n/**\n * DebugOnly contains a value of type T, but only in debug builds.  In release\n * builds, it does not contain a value.  This helper is intended to be used with\n * MOZ_ASSERT()-style macros, allowing one to write:\n *\n *   DebugOnly<bool> check = func();\n *   MOZ_ASSERT(check);\n *\n * more concisely than declaring |check| conditional on #ifdef DEBUG, but also\n * without allocating storage space for |check| in release builds.\n *\n * DebugOnly instances can only be coerced to T in debug builds.  In release\n * builds they don't have a value, so type coercion is not well defined.\n */\ntemplate<typename T>\nclass DebugOnly\n{\n  public:\n#ifdef DEBUG\n    T value;\n\n    DebugOnly() { }\n    DebugOnly(const T& other) : value(other) { }\n    DebugOnly(const DebugOnly& other) : value(other.value) { }\n    DebugOnly& operator=(const T& rhs) {\n      value = rhs;\n      return *this;\n    }\n    void operator++(int) {\n      value++;\n    }\n    void operator--(int) {\n      value--;\n    }\n\n    T* operator&() { return &value; }\n\n    operator T&() { return value; }\n    operator const T&() const { return value; }\n\n    T& operator->() { return value; }\n\n#else\n    DebugOnly() { }\n    DebugOnly(const T&) { }\n    DebugOnly(const DebugOnly&) { }\n    DebugOnly& operator=(const T&) { return *this; }\n    void operator++(int) { }\n    void operator--(int) { }\n#endif\n\n    /*\n     * DebugOnly must always have a destructor or else it will\n     * generate \"unused variable\" warnings, exactly what it's intended\n     * to avoid!\n     */\n    ~DebugOnly() {}\n};\n\n}\n\n#endif /* mozilla_DebugOnly_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Decimal.h",
    "content": "/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * Imported from:\n * http://src.chromium.org/viewvc/blink/trunk/Source/core/platform/Decimal.h\n * Check hg log for the svn rev of the last update from Blink core.\n */\n\n#ifndef Decimal_h\n#define Decimal_h\n\n#include \"mozilla/Assertions.h\"\n#include <stdint.h>\n#include \"mozilla/Types.h\"\n\n#include <string>\n\n#ifndef ASSERT\n#define DEFINED_ASSERT_FOR_DECIMAL_H 1\n#define ASSERT MOZ_ASSERT\n#endif\n\n// To use WTF_MAKE_FAST_ALLOCATED we'd need:\n// http://src.chromium.org/viewvc/blink/trunk/Source/wtf/FastMalloc.h\n// Since we don't allocate Decimal objects, no need.\n#define WTF_MAKE_FAST_ALLOCATED \\\n  void ignore_this_dummy_method() MOZ_DELETE\n\nnamespace WebCore {\n\nnamespace DecimalPrivate {\nclass SpecialValueHandler;\n}\n\n// This class represents decimal base floating point number.\n//\n// FIXME: Once all C++ compiler support decimal type, we should replace this\n// class to compiler supported one. See below URI for current status of decimal\n// type for C++: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1977.html\nclass Decimal {\n    WTF_MAKE_FAST_ALLOCATED;\npublic:\n    enum Sign {\n        Positive,\n        Negative,\n    };\n\n    // You should not use EncodedData other than unit testing.\n    class EncodedData {\n        // For accessing FormatClass.\n        friend class Decimal;\n        friend class DecimalPrivate::SpecialValueHandler;\n    public:\n        EncodedData(Sign, int exponent, uint64_t coefficient);\n\n        bool operator==(const EncodedData&) const;\n        bool operator!=(const EncodedData& another) const { return !operator==(another); }\n\n        uint64_t coefficient() const { return m_coefficient; }\n        int countDigits() const;\n        int exponent() const { return m_exponent; }\n        bool isFinite() const { return !isSpecial(); }\n        bool isInfinity() const { return m_formatClass == ClassInfinity; }\n        bool isNaN() const { return m_formatClass == ClassNaN; }\n        bool isSpecial() const { return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; }\n        bool isZero() const { return m_formatClass == ClassZero; }\n        Sign sign() const { return m_sign; }\n        void setSign(Sign sign) { m_sign = sign; }\n\n    private:\n        enum FormatClass {\n            ClassInfinity,\n            ClassNormal,\n            ClassNaN,\n            ClassZero,\n        };\n\n        EncodedData(Sign, FormatClass);\n        FormatClass formatClass() const { return m_formatClass; }\n\n        uint64_t m_coefficient;\n        int16_t m_exponent;\n        FormatClass m_formatClass;\n        Sign m_sign;\n    };\n\n    MFBT_API Decimal(int32_t = 0);\n    MFBT_API Decimal(Sign, int exponent, uint64_t coefficient);\n    MFBT_API Decimal(const Decimal&);\n\n    MFBT_API Decimal& operator=(const Decimal&);\n    MFBT_API Decimal& operator+=(const Decimal&);\n    MFBT_API Decimal& operator-=(const Decimal&);\n    MFBT_API Decimal& operator*=(const Decimal&);\n    MFBT_API Decimal& operator/=(const Decimal&);\n\n    MFBT_API Decimal operator-() const;\n\n    MFBT_API bool operator==(const Decimal&) const;\n    MFBT_API bool operator!=(const Decimal&) const;\n    MFBT_API bool operator<(const Decimal&) const;\n    MFBT_API bool operator<=(const Decimal&) const;\n    MFBT_API bool operator>(const Decimal&) const;\n    MFBT_API bool operator>=(const Decimal&) const;\n\n    MFBT_API Decimal operator+(const Decimal&) const;\n    MFBT_API Decimal operator-(const Decimal&) const;\n    MFBT_API Decimal operator*(const Decimal&) const;\n    MFBT_API Decimal operator/(const Decimal&) const;\n\n    int exponent() const\n    {\n        ASSERT(isFinite());\n        return m_data.exponent();\n    }\n\n    bool isFinite() const { return m_data.isFinite(); }\n    bool isInfinity() const { return m_data.isInfinity(); }\n    bool isNaN() const { return m_data.isNaN(); }\n    bool isNegative() const { return sign() == Negative; }\n    bool isPositive() const { return sign() == Positive; }\n    bool isSpecial() const { return m_data.isSpecial(); }\n    bool isZero() const { return m_data.isZero(); }\n\n    MFBT_API Decimal abs() const;\n    MFBT_API Decimal ceiling() const;\n    MFBT_API Decimal floor() const;\n    MFBT_API Decimal remainder(const Decimal&) const;\n    MFBT_API Decimal round() const;\n\n    MFBT_API double toDouble() const;\n    // Note: toString method supports infinity and nan but fromString not.\n    MFBT_API std::string toString() const;\n    MFBT_API bool toString(char* strBuf, size_t bufLength) const;\n\n    static MFBT_API Decimal fromDouble(double);\n    // fromString supports following syntax EBNF:\n    //  number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?\n    //          | sign? '.' digit+ (exponent-marker sign? digit+)?\n    //  sign ::= '+' | '-'\n    //  exponent-marker ::= 'e' | 'E'\n    //  digit ::= '0' | '1' | ... | '9'\n    // Note: fromString doesn't support \"infinity\" and \"nan\".\n    static MFBT_API Decimal fromString(const std::string& aValue);\n    static MFBT_API Decimal infinity(Sign);\n    static MFBT_API Decimal nan();\n    static MFBT_API Decimal zero(Sign);\n\n    // You should not use below methods. We expose them for unit testing.\n    MFBT_API explicit Decimal(const EncodedData&);\n    const EncodedData& value() const { return m_data; }\n\nprivate:\n    struct AlignedOperands {\n        uint64_t lhsCoefficient;\n        uint64_t rhsCoefficient;\n        int exponent;\n    };\n\n    MFBT_API Decimal(double);\n    MFBT_API Decimal compareTo(const Decimal&) const;\n\n    static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);\n    static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; }\n\n    Sign sign() const { return m_data.sign(); }\n\n    EncodedData m_data;\n};\n\n} // namespace WebCore\n\nnamespace mozilla {\n  typedef WebCore::Decimal Decimal;\n}\n\n#undef WTF_MAKE_FAST_ALLOCATED\n\n#ifdef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef ASSERT\n#endif\n\n#endif // Decimal_h\n\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Endian.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Functions for reading and writing integers in various endiannesses. */\n\n/*\n * The classes LittleEndian and BigEndian expose static methods for\n * reading and writing 16-, 32-, and 64-bit signed and unsigned integers\n * in their respective endianness.  The naming scheme is:\n *\n * {Little,Big}Endian::{read,write}{Uint,Int}<bitsize>\n *\n * For instance, LittleEndian::readInt32 will read a 32-bit signed\n * integer from memory in little endian format.  Similarly,\n * BigEndian::writeUint16 will write a 16-bit unsigned integer to memory\n * in big-endian format.\n *\n * The class NativeEndian exposes methods for conversion of existing\n * data to and from the native endianness.  These methods are intended\n * for cases where data needs to be transferred, serialized, etc.\n * swap{To,From}{Little,Big}Endian byteswap a single value if necessary.\n * Bulk conversion functions are also provided which optimize the\n * no-conversion-needed case:\n *\n * - copyAndSwap{To,From}{Little,Big}Endian;\n * - swap{To,From}{Little,Big}EndianInPlace.\n *\n * The *From* variants are intended to be used for reading data and the\n * *To* variants for writing data.\n *\n * Methods on NativeEndian work with integer data of any type.\n * Floating-point data is not supported.\n *\n * For clarity in networking code, \"Network\" may be used as a synonym\n * for \"Big\" in any of the above methods or class names.\n *\n * As an example, reading a file format header whose fields are stored\n * in big-endian format might look like:\n *\n * class ExampleHeader\n * {\n *   private:\n *     uint32_t magic;\n *     uint32_t length;\n *     uint32_t totalRecords;\n *     uint64_t checksum;\n *\n *   public:\n *     ExampleHeader(const void* data) {\n *       const uint8_t* ptr = static_cast<const uint8_t*>(data);\n *       magic = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       length = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       totalRecords = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       checksum = BigEndian::readUint64(ptr);\n *     }\n *     ...\n * };\n */\n\n#ifndef mozilla_Endian_h\n#define mozilla_Endian_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n#include <string.h>\n\n#if defined(_MSC_VER) && _MSC_VER >= 1300\n#  include <stdlib.h>\n#  pragma intrinsic(_byteswap_ushort)\n#  pragma intrinsic(_byteswap_ulong)\n#  pragma intrinsic(_byteswap_uint64)\n#endif\n\n#if defined(_WIN64)\n#  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(_WIN32)\n#  if defined(_M_IX86)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(__APPLE__)\n#  if __LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  endif\n#elif defined(__GNUC__) && \\\n      defined(__BYTE_ORDER__) && \\\n      defined(__ORDER_LITTLE_ENDIAN__) && \\\n      defined(__ORDER_BIG_ENDIAN__)\n   /*\n    * Some versions of GCC provide architecture-independent macros for\n    * this.  Yes, there are more than two values for __BYTE_ORDER__.\n    */\n#  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  else\n#    error \"Can't handle mixed-endian architectures\"\n#  endif\n/*\n * We can't include useful headers like <endian.h> or <sys/isa_defs.h>\n * here because they're not present on all platforms.  Instead we have\n * this big conditional that ideally will catch all the interesting\n * cases.\n */\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(__ARMEB__) || \\\n      defined(__s390__) || \\\n      (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \\\n      (defined(__ia64) && defined(__BIG_ENDIAN__))\n#  define MOZ_BIG_ENDIAN 1\n#elif defined(__i386) || defined(__i386__) || \\\n      defined(__x86_64) || defined(__x86_64__) || \\\n      defined(_MIPSEL) || defined(__ARMEL__) || \\\n      defined(__alpha__) || \\\n      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \\\n      (defined(__ia64) && !defined(__BIG_ENDIAN__))\n#  define MOZ_LITTLE_ENDIAN 1\n#endif\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_LITTLE_ENDIAN 0\n#elif MOZ_LITTLE_ENDIAN\n#  define MOZ_BIG_ENDIAN 0\n#else\n#  error \"Cannot determine endianness\"\n#endif\n\n#if defined(__clang__)\n#  if __has_builtin(__builtin_bswap16)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(__GNUC__)\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(_MSC_VER)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n/*\n * We need wrappers here because free functions with default template\n * arguments and/or partial specialization of function templates are not\n * supported by all the compilers we use.\n */\ntemplate<typename T, size_t Size = sizeof(T)>\nstruct Swapper;\n\ntemplate<typename T>\nstruct Swapper<T, 2>\n{\n  static T swap(T value)\n  {\n#if defined(MOZ_HAVE_BUILTIN_BYTESWAP16)\n    return MOZ_HAVE_BUILTIN_BYTESWAP16(value);\n#else\n    return T(((value & 0x00ff) << 8) | ((value & 0xff00) >> 8));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 4>\n{\n  static T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap32(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_ulong(value));\n#else\n    return T(((value & 0x000000ffU) << 24) |\n             ((value & 0x0000ff00U) << 8) |\n             ((value & 0x00ff0000U) >> 8) |\n             ((value & 0xff000000U) >> 24));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 8>\n{\n  static inline T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap64(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_uint64(value));\n#else\n    return T(((value & 0x00000000000000ffULL) << 56) |\n             ((value & 0x000000000000ff00ULL) << 40) |\n             ((value & 0x0000000000ff0000ULL) << 24) |\n             ((value & 0x00000000ff000000ULL) << 8) |\n             ((value & 0x000000ff00000000ULL) >> 8) |\n             ((value & 0x0000ff0000000000ULL) >> 24) |\n             ((value & 0x00ff000000000000ULL) >> 40) |\n             ((value & 0xff00000000000000ULL) >> 56));\n#endif\n  }\n};\n\nenum Endianness { Little, Big };\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_NATIVE_ENDIANNESS detail::Big\n#else\n#  define MOZ_NATIVE_ENDIANNESS detail::Little\n#endif\n\nclass EndianUtils\n{\n    /**\n     * Assert that the memory regions [dest, dest+count) and [src, src+count]\n     * do not overlap.  count is given in bytes.\n     */\n    static void assertNoOverlap(const void* dest, const void* src, size_t count)\n    {\n      DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(dest);\n      DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(src);\n      MOZ_ASSERT((byteDestPtr < byteSrcPtr &&\n                  byteDestPtr + count <= byteSrcPtr) ||\n                 (byteSrcPtr < byteDestPtr &&\n                  byteSrcPtr + count <= byteDestPtr));\n    }\n\n    template<typename T>\n    static void assertAligned(T* ptr)\n    {\n      MOZ_ASSERT((uintptr_t(ptr) % sizeof(T)) == 0, \"Unaligned pointer!\");\n    }\n\n  protected:\n    /**\n     * Return |value| converted from SourceEndian encoding to DestEndian\n     * encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline T maybeSwap(T value)\n    {\n      if (SourceEndian == DestEndian)\n        return value;\n\n      return Swapper<T>::swap(value);\n    }\n\n    /**\n     * Convert |count| elements at |ptr| from SourceEndian encoding to\n     * DestEndian encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline void maybeSwapInPlace(T* ptr, size_t count)\n    {\n      assertAligned(ptr);\n\n      if (SourceEndian == DestEndian)\n        return;\n\n      for (size_t i = 0; i < count; i++)\n        ptr[i] = Swapper<T>::swap(ptr[i]);\n    }\n\n    /**\n     * Write |count| elements to the unaligned address |dest| in DestEndian\n     * format, using elements found at |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapTo(void* dest, const T* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(src);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      uint8_t* byteDestPtr = static_cast<uint8_t*>(dest);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        u.val = maybeSwap<SourceEndian, DestEndian>(src[i]);\n        memcpy(byteDestPtr, u.buffer, sizeof(T));\n        byteDestPtr += sizeof(T);\n      }\n    }\n\n    /**\n     * Write |count| elements to |dest| in DestEndian format, using elements\n     * found at the unaligned address |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapFrom(T* dest, const void* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(dest);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      const uint8_t* byteSrcPtr = static_cast<const uint8_t*>(src);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        memcpy(u.buffer, byteSrcPtr, sizeof(T));\n        dest[i] = maybeSwap<SourceEndian, DestEndian>(u.val);\n        byteSrcPtr += sizeof(T);\n      }\n    }\n};\n\ntemplate<Endianness ThisEndian>\nclass Endian : private EndianUtils\n{\n  protected:\n    /** Read a uint16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* p) {\n      return read<uint16_t>(p);\n    }\n\n    /** Read a uint32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read a uint64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* p) {\n      return read<uint64_t>(p);\n    }\n\n    /** Read an int16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* p) {\n      return read<int16_t>(p);\n    }\n\n    /** Read an int32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read an int64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* p) {\n      return read<int64_t>(p);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint16(void* p, uint16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint32(void* p, uint32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint64(void* p, uint64_t val) {\n      write(p, val);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt16(void* p, int16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt32(void* p, int32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt64(void* p, int64_t val) {\n      write(p, val);\n    }\n\n    /*\n     * Converts a value of type T to little-endian format.\n     *\n     * This function is intended for cases where you have data in your\n     * native-endian format and you need it to appear in little-endian\n     * format for transmission.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T value) {\n      return maybeSwap<ThisEndian, Little>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToLittleEndian(void* dest, const T* src,\n                                          size_t count) {\n      copyAndSwapTo<ThisEndian, Little>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Little>(p, count);\n    }\n\n    /*\n     * Converts a value of type T to big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T value) {\n      return maybeSwap<ThisEndian, Big>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToBigEndian(void* dest, const T* src, size_t count) {\n      copyAndSwapTo<ThisEndian, Big>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Big>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T value) {\n      return swapToBigEndian(value);\n    }\n    template<typename T>\n    static void\n    copyAndSwapToNetworkOrder(void* dest, const T* src, size_t count) {\n      copyAndSwapToBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void\n    swapToNetworkOrderInPlace(T* p, size_t count) {\n      swapToBigEndianInPlace(p, count);\n    }\n\n    /*\n     * Converts a value of type T from little-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T value) {\n      return maybeSwap<Little, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromLittleEndian(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFrom<Little, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Little, ThisEndian>(p, count);\n    }\n\n    /*\n     * Converts a value of type T from big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T value) {\n      return maybeSwap<Big, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromBigEndian(T* dest, const void* src,\n                                         size_t count) {\n      copyAndSwapFrom<Big, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Big, ThisEndian>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T value) {\n      return swapFromBigEndian(value);\n    }\n    template<typename T>\n    static void copyAndSwapFromNetworkOrder(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFromBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void swapFromNetworkOrderInPlace(T* p, size_t count) {\n      swapFromBigEndianInPlace(p, count);\n    }\n\n  private:\n    /**\n     * Read a value of type T, encoded in endianness ThisEndian from |p|.\n     * Return that value encoded in native endianness.\n     */\n    template<typename T>\n    static T read(const void* p) {\n      union {\n        T val;\n        uint8_t buffer[sizeof(T)];\n      } u;\n      memcpy(u.buffer, p, sizeof(T));\n      return maybeSwap<ThisEndian, MOZ_NATIVE_ENDIANNESS>(u.val);\n    }\n\n    /**\n     * Write a value of type T, in native endianness, to |p|, in ThisEndian\n     * endianness.\n     */\n    template<typename T>\n    static void write(void* p, T value) {\n      T tmp = maybeSwap<MOZ_NATIVE_ENDIANNESS, ThisEndian>(value);\n      memcpy(p, &tmp, sizeof(T));\n    }\n\n    Endian() MOZ_DELETE;\n    Endian(const Endian& other) MOZ_DELETE;\n    void operator=(const Endian& other) MOZ_DELETE;\n};\n\ntemplate<Endianness ThisEndian>\nclass EndianReadWrite : public Endian<ThisEndian>\n{\n  private:\n    typedef Endian<ThisEndian> super;\n\n  public:\n    using super::readUint16;\n    using super::readUint32;\n    using super::readUint64;\n    using super::readInt16;\n    using super::readInt32;\n    using super::readInt64;\n    using super::writeUint16;\n    using super::writeUint32;\n    using super::writeUint64;\n    using super::writeInt16;\n    using super::writeInt32;\n    using super::writeInt64;\n};\n\n} /* namespace detail */\n\nclass LittleEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Little>\n{};\n\nclass BigEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Big>\n{};\n\ntypedef BigEndian NetworkEndian;\n\nclass NativeEndian MOZ_FINAL : public detail::Endian<MOZ_NATIVE_ENDIANNESS>\n{\n  private:\n    typedef detail::Endian<MOZ_NATIVE_ENDIANNESS> super;\n\n  public:\n    /*\n     * These functions are intended for cases where you have data in your\n     * native-endian format and you need the data to appear in the appropriate\n     * endianness for transmission, serialization, etc.\n     */\n    using super::swapToLittleEndian;\n    using super::copyAndSwapToLittleEndian;\n    using super::swapToLittleEndianInPlace;\n    using super::swapToBigEndian;\n    using super::copyAndSwapToBigEndian;\n    using super::swapToBigEndianInPlace;\n    using super::swapToNetworkOrder;\n    using super::copyAndSwapToNetworkOrder;\n    using super::swapToNetworkOrderInPlace;\n\n    /*\n     * These functions are intended for cases where you have data in the\n     * given endianness (e.g. reading from disk or a file-format) and you\n     * need the data to appear in native-endian format for processing.\n     */\n    using super::swapFromLittleEndian;\n    using super::copyAndSwapFromLittleEndian;\n    using super::swapFromLittleEndianInPlace;\n    using super::swapFromBigEndian;\n    using super::copyAndSwapFromBigEndian;\n    using super::swapFromBigEndianInPlace;\n    using super::swapFromNetworkOrder;\n    using super::copyAndSwapFromNetworkOrder;\n    using super::swapFromNetworkOrderInPlace;\n};\n\n#undef MOZ_NATIVE_ENDIANNESS\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Endian_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/EnumSet.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A set abstraction for enumeration values. */\n\n#ifndef mozilla_EnumSet_h\n#define mozilla_EnumSet_h\n\n#include \"mozilla/Assertions.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * EnumSet<T> is a set of values defined by an enumeration. It is implemented\n * using a 32 bit mask for each value so it will only work for enums with an int\n * representation less than 32. It works both for enum and enum class types.\n */\ntemplate<typename T>\nclass EnumSet\n{\n  public:\n    EnumSet()\n      : mBitField(0)\n    { }\n\n    EnumSet(T aEnum)\n      : mBitField(aEnum)\n    { }\n\n    EnumSet(T aEnum1, T aEnum2)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2) |\n                  bitFor(aEnum3))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3, T aEnum4)\n     : mBitField(bitFor(aEnum1) |\n                 bitFor(aEnum2) |\n                 bitFor(aEnum3) |\n                 bitFor(aEnum4))\n    { }\n\n    EnumSet(const EnumSet& aEnumSet)\n     : mBitField(aEnumSet.mBitField)\n    { }\n\n    /**\n     * Add an element\n     */\n    void operator+=(T aEnum) {\n      mBitField |= bitFor(aEnum);\n    }\n\n    /**\n     * Add an element\n     */\n    EnumSet<T> operator+(T aEnum) const {\n      EnumSet<T> result(*this);\n      result += aEnum;\n      return result;\n    }\n\n    /**\n     * Union\n     */\n    void operator+=(const EnumSet<T> aEnumSet) {\n      mBitField |= aEnumSet.mBitField;\n    }\n\n    /**\n     * Union\n     */\n    EnumSet<T> operator+(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result += aEnumSet;\n      return result;\n    }\n\n    /**\n     * Remove an element\n     */\n    void operator-=(T aEnum) {\n      mBitField &= ~(bitFor(aEnum));\n    }\n\n    /**\n     * Remove an element\n     */\n    EnumSet<T> operator-(T aEnum) const {\n      EnumSet<T> result(*this);\n      result -= aEnum;\n      return result;\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    void operator-=(const EnumSet<T> aEnumSet) {\n      mBitField &= ~(aEnumSet.mBitField);\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    EnumSet<T> operator-(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result -= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Intersection\n     */\n    void operator&=(const EnumSet<T> aEnumSet) {\n      mBitField &= aEnumSet.mBitField;\n    }\n\n    /**\n     * Intersection\n     */\n    EnumSet<T> operator&(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result &= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Equality\n     */\n\n    bool operator==(const EnumSet<T> aEnumSet) const {\n      return mBitField == aEnumSet.mBitField;\n    }\n\n    /**\n     * Test is an element is contained in the set\n     */\n    bool contains(T aEnum) const {\n      return mBitField & bitFor(aEnum);\n    }\n\n    /**\n     * Return the number of elements in the set\n     */\n\n    uint8_t size() {\n      uint8_t count = 0;\n      for (uint32_t bitField = mBitField; bitField; bitField >>= 1) {\n        if (bitField & 1)\n          count++;\n      }\n      return count;\n    }\n\n  private:\n    static uint32_t bitFor(T aEnum) {\n      uint32_t bitNumber(aEnum);\n      MOZ_ASSERT(bitNumber < 32);\n      return 1U << bitNumber;\n    }\n\n    uint32_t mBitField;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_EnumSet_h_*/\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/FloatingPoint.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various predicates and operations on IEEE-754 floating point types. */\n\n#ifndef mozilla_FloatingPoint_h\n#define mozilla_FloatingPoint_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/*\n * It's reasonable to ask why we have this header at all.  Don't isnan,\n * copysign, the built-in comparison operators, and the like solve these\n * problems?  Unfortunately, they don't.  We've found that various compilers\n * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile\n * the standard methods in various situations, so we can't use them.  Some of\n * these compilers even have problems compiling seemingly reasonable bitwise\n * algorithms!  But with some care we've found algorithms that seem to not\n * trigger those compiler bugs.\n *\n * For the aforementioned reasons, be very wary of making changes to any of\n * these algorithms.  If you must make changes, keep a careful eye out for\n * compiler bustage, particularly PGO-specific bustage.\n */\n\n/*\n * These implementations all assume |double| is a 64-bit double format number\n * type, compatible with the IEEE-754 standard.  C/C++ don't require this to be\n * the case.  But we required this in implementations of these algorithms that\n * preceded this header, so we shouldn't break anything if we continue doing so.\n */\nstatic_assert(sizeof(double) == sizeof(uint64_t), \"double must be 64 bits\");\n\nconst unsigned DoubleExponentBias = 1023;\nconst unsigned DoubleExponentShift = 52;\n\nconst uint64_t DoubleSignBit         = 0x8000000000000000ULL;\nconst uint64_t DoubleExponentBits    = 0x7ff0000000000000ULL;\nconst uint64_t DoubleSignificandBits = 0x000fffffffffffffULL;\n\nstatic_assert((DoubleSignBit & DoubleExponentBits) == 0,\n              \"sign bit doesn't overlap exponent bits\");\nstatic_assert((DoubleSignBit & DoubleSignificandBits) == 0,\n              \"sign bit doesn't overlap significand bits\");\nstatic_assert((DoubleExponentBits & DoubleSignificandBits) == 0,\n              \"exponent bits don't overlap significand bits\");\n\nstatic_assert((DoubleSignBit | DoubleExponentBits | DoubleSignificandBits) ==\n              ~uint64_t(0),\n              \"all bits accounted for\");\n\n/** Determines whether a double is NaN. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNaN(double d)\n{\n  /*\n   * A double is NaN if all exponent bits are 1 and the significand contains at\n   * least one non-zero bit.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) == DoubleExponentBits &&\n         (bits & DoubleSignificandBits) != 0;\n}\n\n/** Determines whether a double is +Infinity or -Infinity. */\nstatic MOZ_ALWAYS_INLINE bool\nIsInfinite(double d)\n{\n  /* Infinities have all exponent bits set to 1 and an all-0 significand. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & ~DoubleSignBit) == DoubleExponentBits;\n}\n\n/** Determines whether a double is not NaN or infinite. */\nstatic MOZ_ALWAYS_INLINE bool\nIsFinite(double d)\n{\n  /*\n   * NaN and Infinities are the only non-finite doubles, and both have all\n   * exponent bits set to 1.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) != DoubleExponentBits;\n}\n\n/**\n * Determines whether a double is negative.  It is an error to call this method\n * on a double which is NaN.\n */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegative(double d)\n{\n  MOZ_ASSERT(!IsNaN(d), \"NaN does not have a sign\");\n\n  /* The sign bit is set if the double is negative. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleSignBit) != 0;\n}\n\n/** Determines whether a double represents -0. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegativeZero(double d)\n{\n  /* Only the sign bit is set if the double is -0. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return bits == DoubleSignBit;\n}\n\n/** Returns the exponent portion of the double. */\nstatic MOZ_ALWAYS_INLINE int_fast16_t\nExponentComponent(double d)\n{\n  /*\n   * The exponent component of a double is an unsigned number, biased from its\n   * actual value.  Subtract the bias to retrieve the actual exponent.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return int_fast16_t((bits & DoubleExponentBits) >> DoubleExponentShift) -\n         int_fast16_t(DoubleExponentBias);\n}\n\n/** Returns +Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nPositiveInfinity()\n{\n  /*\n   * Positive infinity has all exponent bits set, sign bit set to 0, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleExponentBits);\n}\n\n/** Returns -Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nNegativeInfinity()\n{\n  /*\n   * Negative infinity has all exponent bits set, sign bit set to 1, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleSignBit | DoubleExponentBits);\n}\n\n/** Constructs a NaN value with the specified sign bit and significand bits. */\nstatic MOZ_ALWAYS_INLINE double\nSpecificNaN(int signbit, uint64_t significand)\n{\n  MOZ_ASSERT(signbit == 0 || signbit == 1);\n  MOZ_ASSERT((significand & ~DoubleSignificandBits) == 0);\n  MOZ_ASSERT(significand & DoubleSignificandBits);\n\n  double d = BitwiseCast<double>((signbit ? DoubleSignBit : 0) |\n                                 DoubleExponentBits |\n                                 significand);\n  MOZ_ASSERT(IsNaN(d));\n  return d;\n}\n\n/** Computes the smallest non-zero positive double value. */\nstatic MOZ_ALWAYS_INLINE double\nMinDoubleValue()\n{\n  return BitwiseCast<double>(uint64_t(1));\n}\n\nstatic MOZ_ALWAYS_INLINE bool\nDoubleIsInt32(double d, int32_t* i)\n{\n  /*\n   * XXX Casting a double that doesn't truncate to int32_t, to int32_t, induces\n   *     undefined behavior.  We should definitely fix this (bug 744965), but as\n   *     apparently it \"works\" in practice, it's not a pressing concern now.\n   */\n  return !IsNegativeZero(d) && d == (*i = int32_t(d));\n}\n\n/**\n * Computes a NaN value.  Do not use this method if you depend upon a particular\n * NaN value being returned.\n */\nstatic MOZ_ALWAYS_INLINE double\nUnspecifiedNaN()\n{\n  return SpecificNaN(0, 0xfffffffffffffULL);\n}\n\n/**\n * Compare two doubles for equality, *without* equating -0 to +0, and equating\n * any NaN value to any other NaN value.  (The normal equality operators equate\n * -0 with +0, and they equate NaN to no other value.)\n */\nstatic inline bool\nDoublesAreIdentical(double d1, double d2)\n{\n  if (IsNaN(d1))\n    return IsNaN(d2);\n  return BitwiseCast<uint64_t>(d1) == BitwiseCast<uint64_t>(d2);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_FloatingPoint_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/GuardObjects.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementation of macros to ensure correct use of RAII Auto* objects. */\n\n#ifndef mozilla_GuardObjects_h\n#define mozilla_GuardObjects_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\n#ifdef DEBUG\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The following classes are designed to cause assertions to detect\n * inadvertent use of guard objects as temporaries. In other words,\n * when we have a guard object whose only purpose is its constructor and\n * destructor (and is never otherwise referenced), the intended use\n * might be:\n *\n *   AutoRestore savePainting(mIsPainting);\n *\n * but is is easy to accidentally write:\n *\n *   AutoRestore(mIsPainting);\n *\n * which compiles just fine, but runs the destructor well before the\n * intended time.\n *\n * They work by adding (#ifdef DEBUG) an additional parameter to the\n * guard object's constructor, with a default value, so that users of\n * the guard object's API do not need to do anything. The default value\n * of this parameter is a temporary object. C++ (ISO/IEC 14882:1998),\n * section 12.2 [class.temporary], clauses 4 and 5 seem to assume a\n * guarantee that temporaries are destroyed in the reverse of their\n * construction order, but I actually can't find a statement that that\n * is true in the general case (beyond the two specific cases mentioned\n * there). However, it seems to be true.\n *\n * These classes are intended to be used only via the macros immediately\n * below them:\n *\n *   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member\n *     variable, and should be put where a declaration of a private\n *     member variable would be placed.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the\n *     parameters to each constructor of the guard object; it declares\n *     (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM\n *     variant for constructors that take no other parameters.)\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in\n *     the implementation of such constructors when they are not inline.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in\n *     the implementation of such constructors to pass the parameter to\n *     a base class that also uses these macros\n *   MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each\n *     constructor. It uses the parameter declared by\n *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.\n *\n * For more details, and examples of using these macros, see\n * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla\n */\nclass MOZ_EXPORT GuardObjectNotifier\n{\n  private:\n    bool* statementDone;\n\n  public:\n    GuardObjectNotifier() : statementDone(nullptr) { }\n\n    ~GuardObjectNotifier() {\n      *statementDone = true;\n    }\n\n    void setStatementDone(bool* statementIsDone) {\n      statementDone = statementIsDone;\n    }\n};\n\nclass MOZ_EXPORT GuardObjectNotificationReceiver\n{\n  private:\n    bool statementDone;\n\n  public:\n    GuardObjectNotificationReceiver() : statementDone(false) { }\n\n    ~GuardObjectNotificationReceiver() {\n      /*\n       * Assert that the guard object was not used as a temporary.  (Note that\n       * this assert might also fire if init is not called because the guard\n       * object's implementation is not using the above macros correctly.)\n       */\n      MOZ_ASSERT(statementDone);\n    }\n\n    void init(const GuardObjectNotifier& constNotifier) {\n      /*\n       * constNotifier is passed as a const reference so that we can pass a\n       * temporary, but we really intend it as non-const.\n       */\n      GuardObjectNotifier& notifier = const_cast<GuardObjectNotifier&>(constNotifier);\n      notifier.setStatementDone(&statementDone);\n    }\n};\n\n} /* namespace detail */\n} /* namespace mozilla */\n\n#endif /* DEBUG */\n\n#ifdef DEBUG\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \\\n     mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary;\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \\\n     const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \\\n     const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \\\n     , _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \\\n       _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT \\\n     do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0)\n#else\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_GuardObjects_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/HashFunctions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Utilities for hashing. */\n\n/*\n * This file exports functions for hashing data down to a 32-bit value,\n * including:\n *\n *  - HashString    Hash a char* or uint16_t/wchar_t* of known or unknown\n *                  length.\n *\n *  - HashBytes     Hash a byte array of known length.\n *\n *  - HashGeneric   Hash one or more values.  Currently, we support uint32_t,\n *                  types which can be implicitly cast to uint32_t, data\n *                  pointers, and function pointers.\n *\n *  - AddToHash     Add one or more values to the given hash.  This supports the\n *                  same list of types as HashGeneric.\n *\n *\n * You can chain these functions together to hash complex objects.  For example:\n *\n *  class ComplexObject\n *  {\n *      char* str;\n *      uint32_t uint1, uint2;\n *      void (*callbackFn)();\n *\n *    public:\n *      uint32_t hash() {\n *        uint32_t hash = HashString(str);\n *        hash = AddToHash(hash, uint1, uint2);\n *        return AddToHash(hash, callbackFn);\n *      }\n *  };\n *\n * If you want to hash an nsAString or nsACString, use the HashString functions\n * in nsHashKeys.h.\n */\n\n#ifndef mozilla_HashFunctions_h\n#define mozilla_HashFunctions_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\n#ifdef __cplusplus\nnamespace mozilla {\n\n/**\n * The golden ratio as a 32-bit fixed-point value.\n */\nstatic const uint32_t GoldenRatioU32 = 0x9E3779B9U;\n\ninline uint32_t\nRotateBitsLeft32(uint32_t value, uint8_t bits)\n{\n  MOZ_ASSERT(bits < 32);\n  return (value << bits) | (value >> (32 - bits));\n}\n\nnamespace detail {\n\ninline uint32_t\nAddU32ToHash(uint32_t hash, uint32_t value)\n{\n  /*\n   * This is the meat of all our hash routines.  This hash function is not\n   * particularly sophisticated, but it seems to work well for our mostly\n   * plain-text inputs.  Implementation notes follow.\n   *\n   * Our use of the golden ratio here is arbitrary; we could pick almost any\n   * number which:\n   *\n   *  * is odd (because otherwise, all our hash values will be even)\n   *\n   *  * has a reasonably-even mix of 1's and 0's (consider the extreme case\n   *    where we multiply by 0x3 or 0xeffffff -- this will not produce good\n   *    mixing across all bits of the hash).\n   *\n   * The rotation length of 5 is also arbitrary, although an odd number is again\n   * preferable so our hash explores the whole universe of possible rotations.\n   *\n   * Finally, we multiply by the golden ratio *after* xor'ing, not before.\n   * Otherwise, if |hash| is 0 (as it often is for the beginning of a message),\n   * the expression\n   *\n   *   (GoldenRatioU32 * RotateBitsLeft(hash, 5)) |xor| value\n   *\n   * evaluates to |value|.\n   *\n   * (Number-theoretic aside: Because any odd number |m| is relatively prime to\n   * our modulus (2^32), the list\n   *\n   *    [x * m (mod 2^32) for 0 <= x < 2^32]\n   *\n   * has no duplicate elements.  This means that multiplying by |m| does not\n   * cause us to skip any possible hash values.\n   *\n   * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the\n   * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely\n   * multiply our hash value by |m| a few times without negating the\n   * multiplicative effect.  Our golden ratio constant has order 2^29, which is\n   * more than enough for our purposes.)\n   */\n  return GoldenRatioU32 * (RotateBitsLeft32(hash, 5) ^ value);\n}\n\n/**\n * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter.\n */\ntemplate<size_t PtrSize>\ninline uint32_t\nAddUintptrToHash(uint32_t hash, uintptr_t value);\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<4>(uint32_t hash, uintptr_t value)\n{\n  return AddU32ToHash(hash, static_cast<uint32_t>(value));\n}\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<8>(uint32_t hash, uintptr_t value)\n{\n  /*\n   * The static cast to uint64_t below is necessary because this function\n   * sometimes gets compiled on 32-bit platforms (yes, even though it's a\n   * template and we never call this particular override in a 32-bit build).  If\n   * we do value >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t\n   * right 32 bits, and the compiler throws an error.\n   */\n  uint32_t v1 = static_cast<uint32_t>(value);\n  uint32_t v2 = static_cast<uint32_t>(static_cast<uint64_t>(value) >> 32);\n  return AddU32ToHash(AddU32ToHash(hash, v1), v2);\n}\n\n} /* namespace detail */\n\n/**\n * AddToHash takes a hash and some values and returns a new hash based on the\n * inputs.\n *\n * Currently, we support hashing uint32_t's, values which we can implicitly\n * convert to uint32_t, data pointers, and function pointers.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A a)\n{\n  /*\n   * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,\n   * we'll error out.\n   */\n  return detail::AddU32ToHash(hash, a);\n}\n\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A* a)\n{\n  /*\n   * You might think this function should just take a void*.  But then we'd only\n   * catch data pointers and couldn't handle function pointers.\n   */\n\n  static_assert(sizeof(a) == sizeof(uintptr_t),\n                \"Strange pointer!\");\n\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, uintptr_t(a));\n}\n\ntemplate<>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, uintptr_t a)\n{\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b)\n{\n  return AddToHash(AddToHash(hash, a), b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c)\n{\n  return AddToHash(AddToHash(hash, a, b), c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d)\n{\n  return AddToHash(AddToHash(hash, a, b, c), d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d, E e)\n{\n  return AddToHash(AddToHash(hash, a, b, c, d), e);\n}\n\n/**\n * The HashGeneric class of functions let you hash one or more values.\n *\n * If you want to hash together two values x and y, calling HashGeneric(x, y) is\n * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes\n * that x has already been hashed.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a)\n{\n  return AddToHash(0, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b)\n{\n  return AddToHash(0, a, b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c)\n{\n  return AddToHash(0, a, b, c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d)\n{\n  return AddToHash(0, a, b, c, d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d, E e)\n{\n  return AddToHash(0, a, b, c, d, e);\n}\n\nnamespace detail {\n\ntemplate<typename T>\nuint32_t\nHashUntilZero(const T* str)\n{\n  uint32_t hash = 0;\n  for (T c; (c = *str); str++)\n    hash = AddToHash(hash, c);\n  return hash;\n}\n\ntemplate<typename T>\nuint32_t\nHashKnownLength(const T* str, size_t length)\n{\n  uint32_t hash = 0;\n  for (size_t i = 0; i < length; i++)\n    hash = AddToHash(hash, str[i]);\n  return hash;\n}\n\n} /* namespace detail */\n\n/**\n * The HashString overloads below do just what you'd expect.\n *\n * If you have the string's length, you might as well call the overload which\n * includes the length.  It may be marginally faster.\n */\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\n/*\n * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's\n * the same width!\n */\n#ifdef WIN32\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n#endif\n\n/**\n * Hash some number of bytes.\n *\n * This hash walks word-by-word, rather than byte-by-byte, so you won't get the\n * same result out of HashBytes as you would out of HashString.\n */\nMOZ_WARN_UNUSED_RESULT\nextern MFBT_API uint32_t\nHashBytes(const void* bytes, size_t length);\n\n} /* namespace mozilla */\n#endif /* __cplusplus */\n\n#endif /* mozilla_HashFunctions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Likely.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a\n * boolean predicate should be branch-predicted.\n */\n\n#ifndef mozilla_Likely_h\n#define mozilla_Likely_h\n\n#if defined(__clang__) || defined(__GNUC__)\n#  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))\n#  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))\n#else\n#  define MOZ_LIKELY(x)   (!!(x))\n#  define MOZ_UNLIKELY(x) (!!(x))\n#endif\n\n#endif /* mozilla_Likely_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/LinkedList.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type-safe doubly-linked list class. */\n\n/*\n * The classes LinkedList<T> and LinkedListElement<T> together form a\n * convenient, type-safe doubly-linked list implementation.\n *\n * The class T which will be inserted into the linked list must inherit from\n * LinkedListElement<T>.  A given object may be in only one linked list at a\n * time.\n *\n * A LinkedListElement automatically removes itself from the list upon\n * destruction, and a LinkedList will fatally assert in debug builds if it's\n * non-empty when it's destructed.\n *\n * For example, you might use LinkedList in a simple observer list class as\n * follows.\n *\n *   class Observer : public LinkedListElement<Observer>\n *   {\n *     public:\n *       void observe(char* topic) { ... }\n *   };\n *\n *   class ObserverContainer\n *   {\n *     private:\n *       LinkedList<Observer> list;\n *\n *     public:\n *       void addObserver(Observer* observer) {\n *         // Will assert if |observer| is part of another list.\n *         list.insertBack(observer);\n *       }\n *\n *       void removeObserver(Observer* observer) {\n *         // Will assert if |observer| is not part of some list.\n *         observer.remove();\n *         // Or, will assert if |observer| is not part of |list| specifically.\n *         // observer.removeFrom(list);\n *       }\n *\n *       void notifyObservers(char* topic) {\n *         for (Observer* o = list.getFirst(); o != nullptr; o = o->getNext())\n *           o->observe(topic);\n *       }\n *   };\n *\n */\n\n#ifndef mozilla_LinkedList_h\n#define mozilla_LinkedList_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\ntemplate<typename T>\nclass LinkedList;\n\ntemplate<typename T>\nclass LinkedListElement\n{\n    /*\n     * It's convenient that we return nullptr when getNext() or getPrevious()\n     * hits the end of the list, but doing so costs an extra word of storage in\n     * each linked list node (to keep track of whether |this| is the sentinel\n     * node) and a branch on this value in getNext/getPrevious.\n     *\n     * We could get rid of the extra word of storage by shoving the \"is\n     * sentinel\" bit into one of the pointers, although this would, of course,\n     * have performance implications of its own.\n     *\n     * But the goal here isn't to win an award for the fastest or slimmest\n     * linked list; rather, we want a *convenient* linked list.  So we won't\n     * waste time guessing which micro-optimization strategy is best.\n     *\n     *\n     * Speaking of unnecessary work, it's worth addressing here why we wrote\n     * mozilla::LinkedList in the first place, instead of using stl::list.\n     *\n     * The key difference between mozilla::LinkedList and stl::list is that\n     * mozilla::LinkedList stores the prev/next pointers in the object itself,\n     * while stl::list stores the prev/next pointers in a list element which\n     * itself points to the object being stored.\n     *\n     * mozilla::LinkedList's approach makes it harder to store an object in more\n     * than one list.  But the upside is that you can call next() / prev() /\n     * remove() directly on the object.  With stl::list, you'd need to store a\n     * pointer to its iterator in the object in order to accomplish this.  Not\n     * only would this waste space, but you'd have to remember to update that\n     * pointer every time you added or removed the object from a list.\n     *\n     * In-place, constant-time removal is a killer feature of doubly-linked\n     * lists, and supporting this painlessly was a key design criterion.\n     */\n\n  private:\n    LinkedListElement* next;\n    LinkedListElement* prev;\n    const bool isSentinel;\n\n  public:\n    LinkedListElement()\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(false)\n    { }\n\n    ~LinkedListElement() {\n      if (!isSentinel && isInList())\n        remove();\n    }\n\n    /*\n     * Get the next element in the list, or nullptr if this is the last element\n     * in the list.\n     */\n    T* getNext() {\n      return next->asT();\n    }\n    const T* getNext() const {\n      return next->asT();\n    }\n\n    /*\n     * Get the previous element in the list, or nullptr if this is the first\n     * element in the list.\n     */\n    T* getPrevious() {\n      return prev->asT();\n    }\n    const T* getPrevious() const {\n      return prev->asT();\n    }\n\n    /*\n     * Insert elem after this element in the list.  |this| must be part of a\n     * linked list when you call setNext(); otherwise, this method will assert.\n     */\n    void setNext(T* elem) {\n        MOZ_ASSERT(isInList());\n        setNextUnsafe(elem);\n    }\n\n    /*\n     * Insert elem before this element in the list.  |this| must be part of a\n     * linked list when you call setPrevious(); otherwise, this method will\n     * assert.\n     */\n    void setPrevious(T* elem) {\n      MOZ_ASSERT(isInList());\n      setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Remove this element from the list which contains it.  If this element is\n     * not currently part of a linked list, this method asserts.\n     */\n    void remove() {\n      MOZ_ASSERT(isInList());\n\n      prev->next = next;\n      next->prev = prev;\n      next = this;\n      prev = this;\n    }\n\n    /*\n     * Identical to remove(), but also asserts in debug builds that this element\n     * is in list.\n     */\n    void removeFrom(const LinkedList<T>& list) {\n      list.assertContains(asT());\n      remove();\n    }\n\n    /*\n     * Return true if |this| part is of a linked list, and false otherwise.\n     */\n    bool isInList() const {\n      MOZ_ASSERT((next == this) == (prev == this));\n      return next != this;\n    }\n\n  private:\n    friend class LinkedList<T>;\n\n    enum NodeKind {\n      NODE_KIND_NORMAL,\n      NODE_KIND_SENTINEL\n    };\n\n    LinkedListElement(NodeKind nodeKind)\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(nodeKind == NODE_KIND_SENTINEL)\n    { }\n\n    /*\n     * Return |this| cast to T* if we're a normal node, or return nullptr if\n     * we're a sentinel node.\n     */\n    T* asT() {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<T*>(this);\n    }\n    const T* asT() const {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<const T*>(this);\n    }\n\n    /*\n     * Insert elem after this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertFront().\n     */\n    void setNextUnsafe(T* elem) {\n      LinkedListElement *listElem = static_cast<LinkedListElement*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this->next;\n      listElem->prev = this;\n      this->next->prev = listElem;\n      this->next = listElem;\n    }\n\n    /*\n     * Insert elem before this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertBack().\n     */\n    void setPreviousUnsafe(T* elem) {\n      LinkedListElement<T>* listElem = static_cast<LinkedListElement<T>*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this;\n      listElem->prev = this->prev;\n      this->prev->next = listElem;\n      this->prev = listElem;\n    }\n\n  private:\n    LinkedListElement& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedListElement(const LinkedList<T>& other) MOZ_DELETE;\n};\n\ntemplate<typename T>\nclass LinkedList\n{\n  private:\n    LinkedListElement<T> sentinel;\n\n  public:\n    LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }\n\n    ~LinkedList() {\n      MOZ_ASSERT(isEmpty());\n    }\n\n    /*\n     * Add elem to the front of the list.\n     */\n    void insertFront(T* elem) {\n      /* Bypass setNext()'s this->isInList() assertion. */\n      sentinel.setNextUnsafe(elem);\n    }\n\n    /*\n     * Add elem to the back of the list.\n     */\n    void insertBack(T* elem) {\n      sentinel.setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Get the first element of the list, or nullptr if the list is empty.\n     */\n    T* getFirst() {\n      return sentinel.getNext();\n    }\n    const T* getFirst() const {\n      return sentinel.getNext();\n    }\n\n    /*\n     * Get the last element of the list, or nullptr if the list is empty.\n     */\n    T* getLast() {\n      return sentinel.getPrevious();\n    }\n    const T* getLast() const {\n      return sentinel.getPrevious();\n    }\n\n    /*\n     * Get and remove the first element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popFirst() {\n      T* ret = sentinel.getNext();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Get and remove the last element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popLast() {\n      T* ret = sentinel.getPrevious();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Return true if the list is empty, or false otherwise.\n     */\n    bool isEmpty() const {\n      return !sentinel.isInList();\n    }\n\n    /*\n     * Remove all the elements from the list.\n     *\n     * This runs in time linear to the list's length, because we have to mark\n     * each element as not in the list.\n     */\n    void clear() {\n      while (popFirst())\n        continue;\n    }\n\n    /*\n     * In a debug build, make sure that the list is sane (no cycles, consistent\n     * next/prev pointers, only one sentinel).  Has no effect in release builds.\n     */\n    void debugAssertIsSane() const {\n#ifdef DEBUG\n      const LinkedListElement<T>* slow;\n      const LinkedListElement<T>* fast1;\n      const LinkedListElement<T>* fast2;\n\n      /*\n       * Check for cycles in the forward singly-linked list using the\n       * tortoise/hare algorithm.\n       */\n      for (slow = sentinel.next,\n           fast1 = sentinel.next->next,\n           fast2 = sentinel.next->next->next;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->next, fast1 = fast2->next, fast2 = fast1->next)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /* Check for cycles in the backward singly-linked list. */\n      for (slow = sentinel.prev,\n           fast1 = sentinel.prev->prev,\n           fast2 = sentinel.prev->prev->prev;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /*\n       * Check that |sentinel| is the only node in the list with\n       * isSentinel == true.\n       */\n      for (const LinkedListElement<T>* elem = sentinel.next;\n           elem != sentinel;\n           elem = elem->next)\n      {\n        MOZ_ASSERT(!elem->isSentinel);\n      }\n\n      /* Check that the next/prev pointers match up. */\n      const LinkedListElement<T>* prev = sentinel;\n      const LinkedListElement<T>* cur = sentinel.next;\n      do {\n          MOZ_ASSERT(cur->prev == prev);\n          MOZ_ASSERT(prev->next == cur);\n\n          prev = cur;\n          cur = cur->next;\n      } while (cur != sentinel);\n#endif /* ifdef DEBUG */\n    }\n\n  private:\n    friend class LinkedListElement<T>;\n\n    void assertContains(const T* t) const {\n#ifdef DEBUG\n      for (const T* elem = getFirst();\n           elem;\n           elem = elem->getNext())\n      {\n        if (elem == t)\n          return;\n      }\n      MOZ_CRASH(\"element wasn't found in this list!\");\n#endif\n    }\n\n    LinkedList& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedList(const LinkedList<T>& other) MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_LinkedList_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/MathAlgorithms.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt maths algorithms. */\n\n#ifndef mozilla_MathAlgorithms_h\n#define mozilla_MathAlgorithms_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <cmath>\n#include <limits.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n// Greatest Common Divisor\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidGCD(IntegerType a, IntegerType b)\n{\n  // Euclid's algorithm; O(N) in the worst case.  (There are better\n  // ways, but we don't need them for the current use of this algo.)\n  MOZ_ASSERT(a > 0);\n  MOZ_ASSERT(b > 0);\n\n  while (a != b) {\n    if (a > b) {\n      a = a - b;\n    } else {\n      b = b - a;\n    }\n  }\n\n  return a;\n}\n\n// Least Common Multiple\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidLCM(IntegerType a, IntegerType b)\n{\n  // Divide first to reduce overflow risk.\n  return (a / EuclidGCD(a, b)) * b;\n}\n\nnamespace detail {\n\ntemplate<typename T>\nstruct AllowDeprecatedAbsFixed : FalseType {};\n\ntemplate<> struct AllowDeprecatedAbsFixed<int32_t> : TrueType {};\ntemplate<> struct AllowDeprecatedAbsFixed<int64_t> : TrueType {};\n\ntemplate<typename T>\nstruct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};\n\ntemplate<> struct AllowDeprecatedAbs<int> : TrueType {};\ntemplate<> struct AllowDeprecatedAbs<long> : TrueType {};\n\n} // namespace detail\n\n// DO NOT USE DeprecatedAbs.  It exists only until its callers can be converted\n// to Abs below, and it will be removed when all callers have been changed.\ntemplate<typename T>\ninline typename mozilla::EnableIf<detail::AllowDeprecatedAbs<T>::value, T>::Type\nDeprecatedAbs(const T t)\n{\n  // The absolute value of the smallest possible value of a signed-integer type\n  // won't fit in that type (on twos-complement systems -- and we're blithely\n  // assuming we're on such systems, for the non-<stdint.h> types listed above),\n  // so assert that the input isn't that value.\n  //\n  // This is the case if: the value is non-negative; or if adding one (giving a\n  // value in the range [-maxvalue, 0]), then negating (giving a value in the\n  // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement,\n  // (minvalue + 1) == -maxvalue).\n  MOZ_ASSERT(t >= 0 ||\n             -(t + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1),\n             \"You can't negate the smallest possible negative integer!\");\n  return t >= 0 ? t : -t;\n}\n\nnamespace detail {\n\n// For now mozilla::Abs only takes intN_T, the signed natural types, and\n// float/double/long double.  Feel free to add overloads for other standard,\n// signed types if you need them.\n\ntemplate<typename T>\nstruct AbsReturnTypeFixed;\n\ntemplate<> struct AbsReturnTypeFixed<int8_t> { typedef uint8_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int16_t> { typedef uint16_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int32_t> { typedef uint32_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int64_t> { typedef uint64_t Type; };\n\ntemplate<typename T>\nstruct AbsReturnType : AbsReturnTypeFixed<T> {};\n\ntemplate<> struct AbsReturnType<char> : EnableIf<char(-1) < char(0), unsigned char> {};\ntemplate<> struct AbsReturnType<signed char> { typedef unsigned char Type; };\ntemplate<> struct AbsReturnType<short> { typedef unsigned short Type; };\ntemplate<> struct AbsReturnType<int> { typedef unsigned int Type; };\ntemplate<> struct AbsReturnType<long> { typedef unsigned long Type; };\ntemplate<> struct AbsReturnType<long long> { typedef unsigned long long Type; };\ntemplate<> struct AbsReturnType<float> { typedef float Type; };\ntemplate<> struct AbsReturnType<double> { typedef double Type; };\ntemplate<> struct AbsReturnType<long double> { typedef long double Type; };\n\n} // namespace detail\n\ntemplate<typename T>\ninline typename detail::AbsReturnType<T>::Type\nAbs(const T t)\n{\n  typedef typename detail::AbsReturnType<T>::Type ReturnType;\n  return t >= 0 ? ReturnType(t) : ~ReturnType(t) + 1;\n}\n\ntemplate<>\ninline float\nAbs<float>(const float f)\n{\n  return std::fabs(f);\n}\n\ntemplate<>\ninline double\nAbs<double>(const double d)\n{\n  return std::fabs(d);\n}\n\ntemplate<>\ninline long double\nAbs<long double>(const long double d)\n{\n  return std::fabs(d);\n}\n\n} // namespace mozilla\n\n#if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))\n#  define MOZ_BITSCAN_WINDOWS\n\n  extern \"C\" {\n    unsigned char _BitScanForward(unsigned long* Index, unsigned long mask);\n    unsigned char _BitScanReverse(unsigned long* Index, unsigned long mask);\n#  pragma intrinsic(_BitScanForward, _BitScanReverse)\n\n#  if defined(_M_AMD64) || defined(_M_X64)\n#    define MOZ_BITSCAN_WINDOWS64\n    unsigned char _BitScanForward64(unsigned long* index, unsigned __int64 mask);\n    unsigned char _BitScanReverse64(unsigned long* index, unsigned __int64 mask);\n#   pragma intrinsic(_BitScanForward64, _BitScanReverse64)\n#  endif\n  } // extern \"C\"\n\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n#if defined(MOZ_BITSCAN_WINDOWS)\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanReverse(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(31 - index);\n  }\n\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanForward(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(index);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanReverse64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(63 - index);\n#  else\n    uint32_t hi = uint32_t(u >> 32);\n    if (hi != 0)\n      return CountLeadingZeroes32(hi);\n    return 32 + CountLeadingZeroes32(uint32_t(u));\n#  endif\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanForward64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(index);\n#  else\n    uint32_t lo = uint32_t(u);\n    if (lo != 0)\n      return CountTrailingZeroes32(lo);\n    return 32 + CountTrailingZeroes32(uint32_t(u >> 32));\n#  endif\n  }\n\n#  ifdef MOZ_HAVE_BITSCAN64\n#    undef MOZ_HAVE_BITSCAN64\n#  endif\n\n#elif defined(__clang__) || defined(__GNUC__)\n\n#  if defined(__clang__)\n#    if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz)\n#      error \"A clang providing __builtin_c[lt]z is required to build\"\n#    endif\n#  else\n     // gcc has had __builtin_clz and friends since 3.4: no need to check.\n#  endif\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    return __builtin_clz(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    return __builtin_ctz(u);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n    return __builtin_clzll(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n    return __builtin_ctzll(u);\n  }\n\n#else\n#  error \"Implement these!\"\n  inline uint_fast8_t CountLeadingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountLeadingZeroes64(uint64_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes64(uint64_t u) MOZ_DELETE;\n#endif\n\n} // namespace detail\n\n/**\n * Compute the number of high-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the highest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountLeadingZeroes32(0xF0FF1000) is 0;\n * CountLeadingZeroes32(0x7F8F0001) is 1;\n * CountLeadingZeroes32(0x3FFF0100) is 2;\n * CountLeadingZeroes32(0x1FF50010) is 3; and so on.\n */\ninline uint_fast8_t\nCountLeadingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes32(u);\n}\n\n/**\n * Compute the number of low-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the lowest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountTrailingZeroes32(0x0100FFFF) is 0;\n * CountTrailingZeroes32(0x7000FFFE) is 1;\n * CountTrailingZeroes32(0x0080FFFC) is 2;\n * CountTrailingZeroes32(0x0080FFF8) is 3; and so on.\n */\ninline uint_fast8_t\nCountTrailingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes32(u);\n}\n\n/** Analogous to CountLeadingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountLeadingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes64(u);\n}\n\n/** Analogous to CountTrailingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountTrailingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes64(u);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass CeilingLog2;\n\ntemplate<typename T>\nclass CeilingLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 32 - CountLeadingZeroes32(t - 1);\n    }\n};\n\ntemplate<typename T>\nclass CeilingLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 64 - CountLeadingZeroes64(t - 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the least power of 2 greater than or equal to |t|.\n *\n * CeilingLog2(0..1) is 0;\n * CeilingLog2(2) is 1;\n * CeilingLog2(3..4) is 2;\n * CeilingLog2(5..8) is 3;\n * CeilingLog2(9..16) is 4; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nCeilingLog2(const T t)\n{\n  return detail::CeilingLog2<T>::compute(t);\n}\n\n/** A CeilingLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nCeilingLog2Size(size_t n)\n{\n  return CeilingLog2(n);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass FloorLog2;\n\ntemplate<typename T>\nclass FloorLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 31 - CountLeadingZeroes32(t | 1);\n    }\n};\n\ntemplate<typename T>\nclass FloorLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 63 - CountLeadingZeroes64(t | 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the greatest power of 2 less than or equal to |t|.\n *\n * FloorLog2(0..1) is 0;\n * FloorLog2(2..3) is 1;\n * FloorLog2(4..7) is 2;\n * FloorLog2(8..15) is 3; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nFloorLog2(const T t)\n{\n  return detail::FloorLog2<T>::compute(t);\n}\n\n/** A FloorLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nFloorLog2Size(size_t n)\n{\n  return FloorLog2(n);\n}\n\n/*\n * Compute the smallest power of 2 greater than or equal to |x|.  |x| must not\n * be so great that the computed value would overflow |size_t|.\n */\ninline size_t\nRoundUpPow2(size_t x)\n{\n  MOZ_ASSERT(x <= (size_t(1) << (sizeof(size_t) * CHAR_BIT - 1)),\n             \"can't round up -- will overflow!\");\n  return size_t(1) << CeilingLog2(x);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_MathAlgorithms_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/MemoryChecking.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides a common interface to the ASan (AddressSanitizer) and Valgrind \n * functions used to mark memory in certain ways. In detail, the following\n * three macros are provided:\n *\n *   MOZ_MAKE_MEM_NOACCESS  - Mark memory as unsafe to access (e.g. freed)\n *   MOZ_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined\n *   MOZ_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined\n *\n * With Valgrind in use, these directly map to the three respective Valgrind\n * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory,\n * while the UNDEFINED/DEFINED macros unpoison memory.\n *\n * With no memory checker available, all macros expand to the empty statement.\n */\n\n#ifndef mozilla_MemoryChecking_h\n#define mozilla_MemoryChecking_h\n\n#if defined(MOZ_VALGRIND)\n#include \"valgrind/memcheck.h\"\n#endif\n\n#if defined(MOZ_ASAN) || defined(MOZ_VALGRIND)\n#define MOZ_HAVE_MEM_CHECKS 1\n#endif\n\n#if defined(MOZ_ASAN)\n#include <stddef.h>\n\nextern \"C\" {\n  /* These definitions are usually provided through the \n   * sanitizer/asan_interface.h header installed by ASan.\n   */\n  void __asan_poison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n  void __asan_unpoison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  __asan_poison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n}\n#elif defined(MOZ_VALGRIND)\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  VALGRIND_MAKE_MEM_NOACCESS((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_UNDEFINED((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_DEFINED((addr), (size))\n#else\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_DEFINED(addr, size) do {} while(0)\n\n#endif\n\n#endif /* mozilla_MemoryChecking_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/MemoryReporting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Memory reporting infrastructure. */\n\n#ifndef mozilla_MemoryReporting_h\n#define mozilla_MemoryReporting_h\n\n#include <stddef.h>\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This is for functions that are like malloc_usable_size.  Such functions are\n * used for measuring the size of data structures.\n */\ntypedef size_t (*MallocSizeOf)(const void* p);\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\ntypedef size_t (*MozMallocSizeOf)(const void* p);\n\n#endif /* mozilla_MemoryReporting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Move.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* C++11-style, but C++98-usable, \"move references\" implementation. */\n\n#ifndef mozilla_Move_h\n#define mozilla_Move_h\n\nnamespace mozilla {\n\n/*\n * \"Move\" References\n *\n * Some types can be copied much more efficiently if we know the original's\n * value need not be preserved --- that is, if we are doing a \"move\", not a\n * \"copy\". For example, if we have:\n *\n *   Vector<T> u;\n *   Vector<T> v(u);\n *\n * the constructor for v must apply a copy constructor to each element of u ---\n * taking time linear in the length of u. However, if we know we will not need u\n * any more once v has been initialized, then we could initialize v very\n * efficiently simply by stealing u's dynamically allocated buffer and giving it\n * to v --- a constant-time operation, regardless of the size of u.\n *\n * Moves often appear in container implementations. For example, when we append\n * to a vector, we may need to resize its buffer. This entails moving each of\n * its extant elements from the old, smaller buffer to the new, larger buffer.\n * But once the elements have been migrated, we're just going to throw away the\n * old buffer; we don't care if they still have their values. So if the vector's\n * element type can implement \"move\" more efficiently than \"copy\", the vector\n * resizing should by all means use a \"move\" operation. Hash tables also need to\n * be resized.\n *\n * The details of the optimization, and whether it's worth applying, vary from\n * one type to the next. And while some constructor calls are moves, many really\n * are copies, and can't be optimized this way. So we need:\n *\n * 1) a way for a particular invocation of a copy constructor to say that it's\n *    really a move, and that the value of the original isn't important\n *    afterwards (although it must still be safe to destroy); and\n *\n * 2) a way for a type (like Vector) to announce that it can be moved more\n *    efficiently than it can be copied, and provide an implementation of that\n *    move operation.\n *\n * The Move(T&) function takes a reference to a T, and returns a MoveRef<T>\n * referring to the same value; that's 1). A MoveRef<T> is simply a reference\n * to a T, annotated to say that a copy constructor applied to it may move that\n * T, instead of copying it. Finally, a constructor that accepts an MoveRef<T>\n * should perform a more efficient move, instead of a copy, providing 2).\n *\n * So, where we might define a copy constructor for a class C like this:\n *\n *   C(const C& rhs) { ... copy rhs to this ... }\n *\n * we would declare a move constructor like this:\n *\n *   C(MoveRef<C> rhs) { ... move rhs to this ... }\n *\n * And where we might perform a copy like this:\n *\n *   C c2(c1);\n *\n * we would perform a move like this:\n *\n *   C c2(Move(c1))\n *\n * Note that MoveRef<T> implicitly converts to T&, so you can pass a MoveRef<T>\n * to an ordinary copy constructor for a type that doesn't support a special\n * move constructor, and you'll just get a copy.  This means that templates can\n * use Move whenever they know they won't use the original value any more, even\n * if they're not sure whether the type at hand has a specialized move\n * constructor.  If it doesn't, the MoveRef<T> will just convert to a T&, and\n * the ordinary copy constructor will apply.\n *\n * A class with a move constructor can also provide a move assignment operator,\n * which runs this's destructor, and then applies the move constructor to\n * *this's memory. A typical definition:\n *\n *   C& operator=(MoveRef<C> rhs) {\n *     this->~C();\n *     new(this) C(rhs);\n *     return *this;\n *   }\n *\n * With that in place, one can write move assignments like this:\n *\n *   c2 = Move(c1);\n *\n * This destroys c1, moves c1's value to c2, and leaves c1 in an undefined but\n * destructible state.\n *\n * This header file defines MoveRef and Move in the mozilla namespace.  It's up\n * to individual containers to annotate moves as such, by calling Move; and it's\n * up to individual types to define move constructors.\n *\n * One hint: if you're writing a move constructor where the type has members\n * that should be moved themselves, it's much nicer to write this:\n *\n *   C(MoveRef<C> c) : x(Move(c->x)), y(Move(c->y)) { }\n *\n * than the equivalent:\n *\n *   C(MoveRef<C> c) { new(&x) X(Move(c->x)); new(&y) Y(Move(c->y)); }\n *\n * especially since GNU C++ fails to notice that this does indeed initialize x\n * and y, which may matter if they're const.\n */\ntemplate<typename T>\nclass MoveRef\n{\n    T* pointer;\n\n  public:\n    explicit MoveRef(T& t) : pointer(&t) { }\n    T& operator*() const { return *pointer; }\n    T* operator->() const { return pointer; }\n    operator T& () const { return *pointer; }\n};\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(T& t)\n{\n  return MoveRef<T>(t);\n}\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(const T& t)\n{\n  // With some versions of gcc, for a class C, there's an (incorrect) ambiguity\n  // between the C(const C&) constructor and the default C(C&&) C++11 move\n  // constructor, when the constructor is called with a const C& argument.\n  //\n  // This ambiguity manifests with the Move implementation above when Move is\n  // passed const U& for some class U.  Calling Move(const U&) returns a\n  // MoveRef<const U&>, which is then commonly passed to the U constructor,\n  // triggering an implicit conversion to const U&.  gcc doesn't know whether to\n  // call U(const U&) or U(U&&), so it wrongly reports a compile error.\n  //\n  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50442 has since been fixed, so\n  // this is no longer an issue for up-to-date compilers.  But there's no harm\n  // in keeping it around for older compilers, so we might as well.  See also\n  // bug 686280.\n  return MoveRef<T>(const_cast<T&>(t));\n}\n\n/** Swap |t| and |u| using move-construction if possible. */\ntemplate<typename T>\ninline void\nSwap(T& t, T& u)\n{\n  T tmp(Move(t));\n  t = Move(u);\n  u = Move(tmp);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Move_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/NullPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a workaround for compilers which do not support the C++11 nullptr\n * constant.\n */\n\n#ifndef mozilla_NullPtr_h\n#define mozilla_NullPtr_h\n\n#include \"mozilla/Compiler.h\"\n\n#if defined(__clang__)\n#  ifndef __has_extension\n#    define __has_extension __has_feature\n#  endif\n#  if __has_extension(cxx_nullptr)\n#    define MOZ_HAVE_CXX11_NULLPTR\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_NULLPTR\n#    endif\n#  endif\n#elif _MSC_VER >= 1600\n# define MOZ_HAVE_CXX11_NULLPTR\n#endif\n\n/**\n * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal\n * with the correct size to match the size of a pointer on a given platform.\n */\n\n#ifndef MOZ_HAVE_CXX11_NULLPTR\n#  if defined(__GNUC__)\n#    define nullptr __null\n#  elif defined(_WIN64)\n#    define nullptr 0LL\n#  else\n#    define nullptr 0L\n#  endif\n#endif\n\n#endif /* mozilla_NullPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/PodOperations.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Operations for zeroing POD types, arrays, and so on.\n *\n * These operations are preferable to memset, memcmp, and the like because they\n * don't require remembering to multiply by sizeof(T), array lengths, and so on\n * everywhere.\n */\n\n#ifndef mozilla_PodOperations_h\n#define mozilla_PodOperations_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include <string.h>\n\nnamespace mozilla {\n\n/** Set the contents of |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t)\n{\n  memset(t, 0, sizeof(T));\n}\n\n/** Set the contents of |nelem| elements starting at |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t, size_t nelem)\n{\n  /*\n   * This function is often called with 'nelem' small; we use an inline loop\n   * instead of calling 'memset' with a non-constant length.  The compiler\n   * should inline the memset call with constant size, though.\n   */\n  for (T* end = t + nelem; t < end; t++)\n    memset(t, 0, sizeof(T));\n}\n\n/*\n * Arrays implicitly convert to pointers to their first element, which is\n * dangerous when combined with the above PodZero definitions.  Adding an\n * overload for arrays is ambiguous, so we need another identifier.  The\n * ambiguous overload is left to catch mistaken uses of PodZero; if you get a\n * compile error involving PodZero and array types, use PodArrayZero instead.\n */\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N]) MOZ_DELETE;\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N], size_t nelem) MOZ_DELETE;\n\n/** Set the contents of the array |t| to zero. */\ntemplate <class T, size_t N>\nstatic void\nPodArrayZero(T (&t)[N])\n{\n  memset(t, 0, N * sizeof(T));\n}\n\n/**\n * Assign |*src| to |*dst|.  The locations must not be the same and must not\n * overlap.\n */\ntemplate<typename T>\nstatic void\nPodAssign(T* dst, const T* src)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= 1);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= 1);\n  memcpy(reinterpret_cast<char*>(dst), reinterpret_cast<const char*>(src), sizeof(T));\n}\n\n/**\n * Copy |nelem| T elements from |src| to |dst|.  The two memory ranges must not\n * overlap!\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(T* dst, const T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= nelem);\n\n  if (nelem < 128) {\n    /*\n     * Avoid using operator= in this loop, as it may have been\n     * intentionally deleted by the POD type.\n     */\n    for (const T* srcend = src + nelem; src < srcend; src++, dst++)\n      PodAssign(dst, src);\n  } else {\n    memcpy(dst, src, nelem * sizeof(T));\n  }\n}\n\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(volatile T* dst, const volatile T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst,\n                PointerRangeSize(src, static_cast<const volatile T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src,\n                PointerRangeSize(static_cast<const volatile T*>(dst), src) >= nelem);\n\n  /*\n   * Volatile |dst| requires extra work, because it's undefined behavior to\n   * modify volatile objects using the mem* functions.  Just write out the\n   * loops manually, using operator= rather than memcpy for the same reason,\n   * and let the compiler optimize to the extent it can.\n   */\n  for (const volatile T* srcend = src + nelem; src < srcend; src++, dst++)\n    *dst = *src;\n}\n\n/*\n * Copy the contents of the array |src| into the array |dst|, both of size N.\n * The arrays must not overlap!\n */\ntemplate <class T, size_t N>\nstatic void\nPodArrayCopy(T (&dst)[N], const T (&src)[N])\n{\n  PodCopy(dst, src, N);\n}\n\n/**\n * Determine whether the |len| elements at |one| are memory-identical to the\n * |len| elements at |two|.\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static bool\nPodEqual(const T* one, const T* two, size_t len)\n{\n  if (len < 128) {\n    const T* p1end = one + len;\n    const T* p1 = one;\n    const T* p2 = two;\n    for (; p1 < p1end; p1++, p2++) {\n      if (*p1 != *p2)\n        return false;\n    }\n    return true;\n  }\n\n  return !memcmp(one, two, len * sizeof(T));\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_PodOperations_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Poison.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A poison value that can be used to fill a memory space with\n * an address that leads to a safe crash when dereferenced.\n */\n\n#ifndef mozilla_Poison_h\n#define mozilla_Poison_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\nMOZ_BEGIN_EXTERN_C\n\nextern MFBT_DATA uintptr_t gMozillaPoisonValue;\n\n/**\n * @return the poison value.\n */\ninline uintptr_t mozPoisonValue()\n{\n  return gMozillaPoisonValue;\n}\n\n/**\n * Overwrite the memory block of aSize bytes at aPtr with the poison value.\n * aPtr MUST be aligned at a sizeof(uintptr_t) boundary.\n * Only an even number of sizeof(uintptr_t) bytes are overwritten, the last\n * few bytes (if any) is not overwritten.\n */\ninline void mozWritePoison(void* aPtr, size_t aSize)\n{\n  const uintptr_t POISON = mozPoisonValue();\n  char* p = (char*)aPtr;\n  char* limit = p + aSize;\n  MOZ_ASSERT((uintptr_t)aPtr % sizeof(uintptr_t) == 0, \"bad alignment\");\n  MOZ_ASSERT(aSize >= sizeof(uintptr_t), \"poisoning this object has no effect\");\n  for (; p < limit; p += sizeof(uintptr_t)) {\n    *((uintptr_t*)p) = POISON;\n  }\n}\n\n/**\n * Initialize the poison value.\n * This should only be called once.\n */\nextern MFBT_API void mozPoisonValueInit();\n\n/* Values annotated by CrashReporter */\nextern MFBT_DATA uintptr_t gMozillaPoisonBase;\nextern MFBT_DATA uintptr_t gMozillaPoisonSize;\n\nMOZ_END_EXTERN_C\n\n#endif /* mozilla_Poison_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Range.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef mozilla_Range_h\n#define mozilla_Range_h\n\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RangedPtr.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\n// Range<T> is a tuple containing a pointer and a length.\ntemplate <typename T>\nclass Range\n{\n    RangedPtr<T> mStart;\n    RangedPtr<T> mEnd;\n\n    typedef void (Range::* ConvertibleToBool)();\n    void nonNull() {}\n\n  public:\n    Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {}\n    Range(T* p, size_t len)\n      : mStart(p, p, p + len),\n        mEnd(p + len, p, p + len)\n    {}\n\n    RangedPtr<T> start() const { return mStart; }\n    RangedPtr<T> end() const { return mEnd; }\n    size_t length() const { return mEnd - mStart; }\n\n    T& operator[](size_t offset) {\n      return mStart[offset];\n    }\n\n    const T& operator[](size_t offset) const {\n      return mStart[offset];\n    }\n\n    operator ConvertibleToBool() const { return mStart ? &Range::nonNull : 0; }\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Range_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/RangedPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a smart pointer asserted to remain within a range specified at\n * construction.\n */\n\n#ifndef mozilla_RangedPtr_h\n#define mozilla_RangedPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Util.h\"\n\nnamespace mozilla {\n\n/*\n * RangedPtr is a smart pointer restricted to an address range specified at\n * creation.  The pointer (and any smart pointers derived from it) must remain\n * within the range [start, end] (inclusive of end to facilitate use as\n * sentinels).  Dereferencing or indexing into the pointer (or pointers derived\n * from it) must remain within the range [start, end).  All the standard pointer\n * operators are defined on it; in debug builds these operations assert that the\n * range specified at construction is respected.\n *\n * In theory passing a smart pointer instance as an argument can be slightly\n * slower than passing a T* (due to ABI requirements for passing structs versus\n * passing pointers), if the method being called isn't inlined.  If you are in\n * extremely performance-critical code, you may want to be careful using this\n * smart pointer as an argument type.\n *\n * RangedPtr<T> intentionally does not implicitly convert to T*.  Use get() to\n * explicitly convert to T*.  Keep in mind that the raw pointer of course won't\n * implement bounds checking in debug builds.\n */\ntemplate<typename T>\nclass RangedPtr\n{\n    T* ptr;\n\n#ifdef DEBUG\n    T* const rangeStart;\n    T* const rangeEnd;\n#endif\n\n    typedef void (RangedPtr::* ConvertibleToBool)();\n    void nonNull() {}\n\n    void checkSanity() {\n      MOZ_ASSERT(rangeStart <= ptr);\n      MOZ_ASSERT(ptr <= rangeEnd);\n    }\n\n    /* Creates a new pointer for |p|, restricted to this pointer's range. */\n    RangedPtr<T> create(T *p) const {\n#ifdef DEBUG\n      return RangedPtr<T>(p, rangeStart, rangeEnd);\n#else\n      return RangedPtr<T>(p, nullptr, size_t(0));\n#endif\n    }\n\n    uintptr_t asUintptr() const { return uintptr_t(ptr); }\n\n  public:\n    RangedPtr(T* p, T* start, T* end)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(end)\n#endif\n    {\n      MOZ_ASSERT(rangeStart <= rangeEnd);\n      checkSanity();\n    }\n    RangedPtr(T* p, T* start, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(start + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(p, p, length). */\n    RangedPtr(T* p, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(p), rangeEnd(p + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(arr, arr, N). */\n    template<size_t N>\n    RangedPtr(T (&arr)[N])\n      : ptr(arr)\n#ifdef DEBUG\n      , rangeStart(arr), rangeEnd(arr + N)\n#endif\n    {\n      checkSanity();\n    }\n\n    T* get() const {\n      return ptr;\n    }\n\n    operator ConvertibleToBool() const { return ptr ? &RangedPtr::nonNull : 0; }\n\n    /*\n     * You can only assign one RangedPtr into another if the two pointers have\n     * the same valid range:\n     *\n     *   char arr1[] = \"hi\";\n     *   char arr2[] = \"bye\";\n     *   RangedPtr<char> p1(arr1, 2);\n     *   p1 = RangedPtr<char>(arr1 + 1, arr1, arr1 + 2); // works\n     *   p1 = RangedPtr<char>(arr2, 3);                  // asserts\n     */\n    RangedPtr<T>& operator=(const RangedPtr<T>& other) {\n      MOZ_ASSERT(rangeStart == other.rangeStart);\n      MOZ_ASSERT(rangeEnd == other.rangeEnd);\n      ptr = other.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T> operator+(size_t inc) {\n      MOZ_ASSERT(inc <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() + inc * sizeof(T) >= asUintptr());\n      return create(ptr + inc);\n    }\n\n    RangedPtr<T> operator-(size_t dec) {\n      MOZ_ASSERT(dec <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() - dec * sizeof(T) <= asUintptr());\n      return create(ptr - dec);\n    }\n\n    /*\n     * You can assign a raw pointer into a RangedPtr if the raw pointer is\n     * within the range specified at creation.\n     */\n    template <typename U>\n    RangedPtr<T>& operator=(U* p) {\n      *this = create(p);\n      return *this;\n    }\n\n    template <typename U>\n    RangedPtr<T>& operator=(const RangedPtr<U>& p) {\n      MOZ_ASSERT(rangeStart <= p.ptr);\n      MOZ_ASSERT(p.ptr <= rangeEnd);\n      ptr = p.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T>& operator++() {\n      return (*this += 1);\n    }\n\n    RangedPtr<T> operator++(int) {\n      RangedPtr<T> rcp = *this;\n      ++*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator--() {\n      return (*this -= 1);\n    }\n\n    RangedPtr<T> operator--(int) {\n      RangedPtr<T> rcp = *this;\n      --*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator+=(size_t inc) {\n      *this = *this + inc;\n      return *this;\n    }\n\n    RangedPtr<T>& operator-=(size_t dec) {\n      *this = *this - dec;\n      return *this;\n    }\n\n    T& operator[](int index) const {\n      MOZ_ASSERT(size_t(index > 0 ? index : -index) <= size_t(-1) / sizeof(T));\n      return *create(ptr + index);\n    }\n\n    T& operator*() const {\n      return *ptr;\n    }\n\n    template <typename U>\n    bool operator==(const RangedPtr<U>& other) const {\n      return ptr == other.ptr;\n    }\n    template <typename U>\n    bool operator!=(const RangedPtr<U>& other) const {\n      return !(*this == other);\n    }\n\n    template<typename U>\n    bool operator==(const U* u) const {\n      return ptr == u;\n    }\n    template<typename U>\n    bool operator!=(const U* u) const {\n      return !(*this == u);\n    }\n\n    template <typename U>\n    bool operator<(const RangedPtr<U>& other) const {\n      return ptr < other.ptr;\n    }\n    template <typename U>\n    bool operator<=(const RangedPtr<U>& other) const {\n      return ptr <= other.ptr;\n    }\n\n    template <typename U>\n    bool operator>(const RangedPtr<U>& other) const {\n      return ptr > other.ptr;\n    }\n    template <typename U>\n    bool operator>=(const RangedPtr<U>& other) const {\n      return ptr >= other.ptr;\n    }\n\n    size_t operator-(const RangedPtr<T>& other) const {\n      MOZ_ASSERT(ptr >= other.ptr);\n      return PointerRangeSize(other.ptr, ptr);\n    }\n\n  private:\n    RangedPtr() MOZ_DELETE;\n    T* operator&() MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_RangedPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/ReentrancyGuard.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Small helper class for asserting uses of a class are non-reentrant. */\n\n#ifndef mozilla_ReentrancyGuard_h\n#define mozilla_ReentrancyGuard_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n\nnamespace mozilla {\n\n/* Useful for implementing containers that assert non-reentrancy */\nclass ReentrancyGuard\n{\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#ifdef DEBUG\n    bool& entered;\n#endif\n\n  public:\n    template<class T>\n#ifdef DEBUG\n    ReentrancyGuard(T& obj\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : entered(obj.entered)\n#else\n    ReentrancyGuard(T&\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n#endif\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n#ifdef DEBUG\n      MOZ_ASSERT(!entered);\n      entered = true;\n#endif\n    }\n    ~ReentrancyGuard()\n    {\n#ifdef DEBUG\n      entered = false;\n#endif\n    }\n\n  private:\n    ReentrancyGuard(const ReentrancyGuard&) MOZ_DELETE;\n    void operator=(const ReentrancyGuard&) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_ReentrancyGuard_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/RefPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Helpers for defining and using refcounted objects. */\n\n#ifndef mozilla_RefPtr_h\n#define mozilla_RefPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate<typename T> class RefCounted;\ntemplate<typename T> class RefPtr;\ntemplate<typename T> class TemporaryRef;\ntemplate<typename T> class OutParamRef;\ntemplate<typename T> OutParamRef<T> byRef(RefPtr<T>&);\n\n/**\n * RefCounted<T> is a sort of a \"mixin\" for a class T.  RefCounted\n * manages, well, refcounting for T, and because RefCounted is\n * parameterized on T, RefCounted<T> can call T's destructor directly.\n * This means T doesn't need to have a virtual dtor and so doesn't\n * need a vtable.\n *\n * RefCounted<T> is created with refcount == 0.  Newly-allocated\n * RefCounted<T> must immediately be assigned to a RefPtr to make the\n * refcount > 0.  It's an error to allocate and free a bare\n * RefCounted<T>, i.e. outside of the RefPtr machinery.  Attempts to\n * do so will abort DEBUG builds.\n *\n * Live RefCounted<T> have refcount > 0.  The lifetime (refcounts) of\n * live RefCounted<T> are controlled by RefPtr<T> and\n * RefPtr<super/subclass of T>.  Upon a transition from refcounted==1\n * to 0, the RefCounted<T> \"dies\" and is destroyed.  The \"destroyed\"\n * state is represented in DEBUG builds by refcount==0xffffdead.  This\n * state distinguishes use-before-ref (refcount==0) from\n * use-after-destroy (refcount==0xffffdead).\n */\nnamespace detail {\n#ifdef DEBUG\nstatic const int DEAD = 0xffffdead;\n#endif\n\n// This is used WeakPtr.h as well as this file.\nenum RefCountAtomicity\n{\n  AtomicRefCount,\n  NonAtomicRefCount\n};\n\ntemplate<typename T, RefCountAtomicity Atomicity>\nclass RefCounted\n{\n    friend class RefPtr<T>;\n\n  protected:\n    RefCounted() : refCnt(0) { }\n    ~RefCounted() {\n      MOZ_ASSERT(refCnt == detail::DEAD);\n    }\n\n  public:\n    // Compatibility with nsRefPtr.\n    void AddRef() {\n      MOZ_ASSERT(refCnt >= 0);\n      ++refCnt;\n    }\n\n    void Release() {\n      MOZ_ASSERT(refCnt > 0);\n      if (0 == --refCnt) {\n#ifdef DEBUG\n        refCnt = detail::DEAD;\n#endif\n        delete static_cast<T*>(this);\n      }\n    }\n\n    // Compatibility with wtf::RefPtr.\n    void ref() { AddRef(); }\n    void deref() { Release(); }\n    int refCount() const { return refCnt; }\n    bool hasOneRef() const {\n      MOZ_ASSERT(refCnt > 0);\n      return refCnt == 1;\n    }\n\n  private:\n    typename Conditional<Atomicity == AtomicRefCount, Atomic<int>, int>::Type refCnt;\n};\n\n}\n\ntemplate<typename T>\nclass RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>\n{\n  public:\n    ~RefCounted() {\n      static_assert(IsBaseOf<RefCounted, T>::value,\n                    \"T must derive from RefCounted<T>\");\n    }\n};\n\n/**\n * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated\n * reference counter.\n */\ntemplate<typename T>\nclass AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>\n{\n  public:\n    ~AtomicRefCounted() {\n      static_assert(IsBaseOf<AtomicRefCounted, T>::value,\n                    \"T must derive from AtomicRefCounted<T>\");\n    }\n};\n\n/**\n * RefPtr points to a refcounted thing that has AddRef and Release\n * methods to increase/decrease the refcount, respectively.  After a\n * RefPtr<T> is assigned a T*, the T* can be used through the RefPtr\n * as if it were a T*.\n *\n * A RefPtr can forget its underlying T*, which results in the T*\n * being wrapped in a temporary object until the T* is either\n * re-adopted from or released by the temporary.\n */\ntemplate<typename T>\nclass RefPtr\n{\n    // To allow them to use unref()\n    friend class TemporaryRef<T>;\n    friend class OutParamRef<T>;\n\n    struct DontRef {};\n\n  public:\n    RefPtr() : ptr(0) { }\n    RefPtr(const RefPtr& o) : ptr(ref(o.ptr)) {}\n    RefPtr(const TemporaryRef<T>& o) : ptr(o.drop()) {}\n    RefPtr(T* t) : ptr(ref(t)) {}\n\n    template<typename U>\n    RefPtr(const RefPtr<U>& o) : ptr(ref(o.get())) {}\n\n    ~RefPtr() { unref(ptr); }\n\n    RefPtr& operator=(const RefPtr& o) {\n      assign(ref(o.ptr));\n      return *this;\n    }\n    RefPtr& operator=(const TemporaryRef<T>& o) {\n      assign(o.drop());\n      return *this;\n    }\n    RefPtr& operator=(T* t) {\n      assign(ref(t));\n      return *this;\n    }\n\n    template<typename U>\n    RefPtr& operator=(const RefPtr<U>& o) {\n      assign(ref(o.get()));\n      return *this;\n    }\n\n    TemporaryRef<T> forget() {\n      T* tmp = ptr;\n      ptr = 0;\n      return TemporaryRef<T>(tmp, DontRef());\n    }\n\n    T* get() const { return ptr; }\n    operator T*() const { return ptr; }\n    T* operator->() const { return ptr; }\n    T& operator*() const { return *ptr; }\n    template<typename U>\n    operator TemporaryRef<U>() { return TemporaryRef<U>(ptr); }\n\n  private:\n    void assign(T* t) {\n      unref(ptr);\n      ptr = t;\n    }\n\n    T* ptr;\n\n    static MOZ_ALWAYS_INLINE T* ref(T* t) {\n      if (t)\n        t->AddRef();\n      return t;\n    }\n\n    static MOZ_ALWAYS_INLINE void unref(T* t) {\n      if (t)\n        t->Release();\n    }\n};\n\n/**\n * TemporaryRef<T> represents an object that holds a temporary\n * reference to a T.  TemporaryRef objects can't be manually ref'd or\n * unref'd (being temporaries, not lvalues), so can only relinquish\n * references to other objects, or unref on destruction.\n */\ntemplate<typename T>\nclass TemporaryRef\n{\n    // To allow it to construct TemporaryRef from a bare T*\n    friend class RefPtr<T>;\n\n    typedef typename RefPtr<T>::DontRef DontRef;\n\n  public:\n    TemporaryRef(T* t) : ptr(RefPtr<T>::ref(t)) {}\n    TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {}\n\n    template<typename U>\n    TemporaryRef(const TemporaryRef<U>& o) : ptr(o.drop()) {}\n\n    ~TemporaryRef() { RefPtr<T>::unref(ptr); }\n\n    T* drop() const {\n      T* tmp = ptr;\n      ptr = 0;\n      return tmp;\n    }\n\n  private:\n    TemporaryRef(T* t, const DontRef&) : ptr(t) {}\n\n    mutable T* ptr;\n\n    TemporaryRef() MOZ_DELETE;\n    void operator=(const TemporaryRef&) MOZ_DELETE;\n};\n\n/**\n * OutParamRef is a wrapper that tracks a refcounted pointer passed as\n * an outparam argument to a function.  OutParamRef implements COM T**\n * outparam semantics: this requires the callee to AddRef() the T*\n * returned through the T** outparam on behalf of the caller.  This\n * means the caller (through OutParamRef) must Release() the old\n * object contained in the tracked RefPtr.  It's OK if the callee\n * returns the same T* passed to it through the T** outparam, as long\n * as the callee obeys the COM discipline.\n *\n * Prefer returning TemporaryRef<T> from functions over creating T**\n * outparams and passing OutParamRef<T> to T**.  Prefer RefPtr<T>*\n * outparams over T** outparams.\n */\ntemplate<typename T>\nclass OutParamRef\n{\n    friend OutParamRef byRef<T>(RefPtr<T>&);\n\n  public:\n    ~OutParamRef() {\n      RefPtr<T>::unref(refPtr.ptr);\n      refPtr.ptr = tmp;\n    }\n\n    operator T**() { return &tmp; }\n\n  private:\n    OutParamRef(RefPtr<T>& p) : refPtr(p), tmp(p.get()) {}\n\n    RefPtr<T>& refPtr;\n    T* tmp;\n\n    OutParamRef() MOZ_DELETE;\n    OutParamRef& operator=(const OutParamRef&) MOZ_DELETE;\n};\n\n/**\n * byRef cooperates with OutParamRef to implement COM outparam semantics.\n */\ntemplate<typename T>\nOutParamRef<T>\nbyRef(RefPtr<T>& ptr)\n{\n  return OutParamRef<T>(ptr);\n}\n\n} // namespace mozilla\n\n#if 0\n\n// Command line that builds these tests\n//\n//   cp RefPtr.h test.cc && g++ -g -Wall -pedantic -DDEBUG -o test test.cc && ./test\n\nusing namespace mozilla;\n\nstruct Foo : public RefCounted<Foo>\n{\n  Foo() : dead(false) { }\n  ~Foo() {\n    MOZ_ASSERT(!dead);\n    dead = true;\n    numDestroyed++;\n  }\n\n  bool dead;\n  static int numDestroyed;\n};\nint Foo::numDestroyed;\n\nstruct Bar : public Foo { };\n\nTemporaryRef<Foo>\nNewFoo()\n{\n  return RefPtr<Foo>(new Foo());\n}\n\nTemporaryRef<Foo>\nNewBar()\n{\n  return new Bar();\n}\n\nvoid\nGetNewFoo(Foo** f)\n{\n  *f = new Bar();\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetPassedFoo(Foo** f)\n{\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetNewFoo(RefPtr<Foo>* f)\n{\n  *f = new Bar();\n}\n\nvoid\nGetPassedFoo(RefPtr<Foo>* f)\n{}\n\nTemporaryRef<Foo>\nGetNullFoo()\n{\n  return 0;\n}\n\nint\nmain(int argc, char** argv)\n{\n  // This should blow up\n//    Foo* f = new Foo(); delete f;\n\n  MOZ_ASSERT(0 == Foo::numDestroyed);\n  {\n    RefPtr<Foo> f = new Foo();\n    MOZ_ASSERT(f->refCount() == 1);\n  }\n  MOZ_ASSERT(1 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = NewFoo();\n    RefPtr<Foo> f2(NewFoo());\n    MOZ_ASSERT(1 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(3 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> b = NewBar();\n    MOZ_ASSERT(3 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(4 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1;\n    {\n      f1 = new Foo();\n      RefPtr<Foo> f2(f1);\n      RefPtr<Foo> f3 = f2;\n      MOZ_ASSERT(4 == Foo::numDestroyed);\n    }\n    MOZ_ASSERT(4 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(5 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    f.forget();\n    MOZ_ASSERT(6 == Foo::numDestroyed);\n  }\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(byRef(f));\n    MOZ_ASSERT(7 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(8 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(byRef(f));\n    MOZ_ASSERT(8 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(9 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(&f);\n    MOZ_ASSERT(10 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(11 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(&f);\n    MOZ_ASSERT(11 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(12 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = new Bar();\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = GetNullFoo();\n    MOZ_ASSERT(13 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  return 0;\n}\n\n#endif\n\n#endif /* mozilla_RefPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/SHA1.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Simple class for computing SHA1. */\n\n#ifndef mozilla_SHA1_h\n#define mozilla_SHA1_h\n\n#include \"mozilla/Types.h\"\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * This class computes the SHA1 hash of a byte sequence, or of the concatenation\n * of multiple sequences.  For example, computing the SHA1 of two sequences of\n * bytes could be done as follows:\n *\n *   void SHA1(const uint8_t* buf1, uint32_t size1,\n *             const uint8_t* buf2, uint32_t size2,\n *             SHA1Sum::Hash& hash)\n *   {\n *     SHA1Sum s;\n *     s.update(buf1, size1);\n *     s.update(buf2, size2);\n *     s.finish(hash);\n *   }\n *\n * The finish method may only be called once and cannot be followed by calls\n * to update.\n */\nclass SHA1Sum\n{\n    union {\n        uint32_t w[16]; /* input buffer */\n        uint8_t b[64];\n    } u;\n    uint64_t size; /* count of hashed bytes. */\n    unsigned H[22]; /* 5 state variables, 16 tmp values, 1 extra */\n    bool mDone;\n\n  public:\n    MFBT_API SHA1Sum();\n\n    static const size_t HashSize = 20;\n    typedef uint8_t Hash[HashSize];\n\n    /* Add len bytes of dataIn to the data sequence being hashed. */\n    MFBT_API void update(const void* dataIn, uint32_t len);\n\n    /* Compute the final hash of all data into hashOut. */\n    MFBT_API void finish(SHA1Sum::Hash& hashOut);\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_SHA1_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Scoped.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A number of structures to simplify scope-based RAII management. */\n\n#ifndef mozilla_Scoped_h\n#define mozilla_Scoped_h\n\n/*\n * Resource Acquisition Is Initialization is a programming idiom used\n * to write robust code that is able to deallocate resources properly,\n * even in presence of execution errors or exceptions that need to be\n * propagated.  The Scoped* classes defined in this header perform the\n * deallocation of the resource they hold once program execution\n * reaches the end of the scope for which they have been defined.\n *\n * This header provides the following RAII classes:\n *\n * - |ScopedFreePtr| - a container for a pointer, that automatically calls\n *   |free()| at the end of the scope;\n * - |ScopedDeletePtr| - a container for a pointer, that automatically calls\n *   |delete| at the end of the scope;\n * - |ScopedDeleteArray| - a container for a pointer to an array, that\n *   automatically calls |delete[]| at the end of the scope.\n *\n * The general scenario for each of the RAII classes is the following:\n *\n * ScopedClass foo(create_value());\n * // ... In this scope, |foo| is defined. Use |foo.get()| or |foo.rwget()|\n *        to access the value.\n * // ... In case of |return| or |throw|, |foo| is deallocated automatically.\n * // ... If |foo| needs to be returned or stored, use |foo.forget()|\n *\n * Note that the RAII classes defined in this header do _not_ perform any form\n * of reference-counting or garbage-collection. These classes have exactly two\n * behaviors:\n *\n * - if |forget()| has not been called, the resource is always deallocated at\n *   the end of the scope;\n * - if |forget()| has been called, any control on the resource is unbound\n *   and the resource is not deallocated by the class.\n *\n * Extension:\n *\n * In addition, this header provides class |Scoped| and macros |SCOPED_TEMPLATE|\n * and |MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE|  to simplify the definition\n * of RAII classes for other scenarios. These macros have been used to\n * automatically close file descriptors/file handles when reaching the end of\n * the scope, graphics contexts, etc.\n */\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n/*\n * Scoped is a helper to create RAII wrappers\n * Type argument |Traits| is expected to have the following structure:\n *\n *   struct Traits {\n *     // Define the type of the value stored in the wrapper\n *     typedef value_type type;\n *     // Returns the value corresponding to the uninitialized or freed state\n *     const static type empty();\n *     // Release resources corresponding to the wrapped value\n *     // This function is responsible for not releasing an |empty| value\n *     const static void release(type);\n *   }\n */\ntemplate<typename Traits>\nclass Scoped\n{\n  public:\n    typedef typename Traits::type Resource;\n\n    explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : value(Traits::empty())\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    explicit Scoped(const Resource& v\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : value(v)\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~Scoped() {\n      Traits::release(value);\n    }\n\n    // Constant getter\n    operator const Resource&() const { return value; }\n    const Resource& operator->() const { return value; }\n    const Resource& get() const { return value; }\n    // Non-constant getter.\n    Resource& rwget() { return value; }\n\n    /*\n     * Forget the resource.\n     *\n     * Once |forget| has been called, the |Scoped| is neutralized, i.e. it will\n     * have no effect at destruction (unless it is reset to another resource by\n     * |operator=|).\n     *\n     * @return The original resource.\n     */\n    Resource forget() {\n      Resource tmp = value;\n      value = Traits::empty();\n      return tmp;\n    }\n\n    /*\n     * Perform immediate clean-up of this |Scoped|.\n     *\n     * If this |Scoped| is currently empty, this method has no effect.\n     */\n    void dispose() {\n      Traits::release(value);\n      value = Traits::empty();\n    }\n\n    bool operator==(const Resource& other) const {\n      return value == other;\n    }\n\n    /*\n     * Replace the resource with another resource.\n     *\n     * Calling |operator=| has the side-effect of triggering clean-up. If you do\n     * not want to trigger clean-up, you should first invoke |forget|.\n     *\n     * @return this\n     */\n    Scoped<Traits>& operator=(const Resource& other) {\n      return reset(other);\n    }\n    Scoped<Traits>& reset(const Resource& other) {\n      Traits::release(value);\n      value = other;\n      return *this;\n    }\n\n  private:\n    explicit Scoped(const Scoped<Traits>& value) MOZ_DELETE;\n    Scoped<Traits>& operator=(const Scoped<Traits>& value) MOZ_DELETE;\n\n  private:\n    Resource value;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * SCOPED_TEMPLATE defines a templated class derived from Scoped\n * This allows to implement templates such as ScopedFreePtr.\n *\n * @param name The name of the class to define.\n * @param Traits A struct implementing clean-up. See the implementations\n * for more details.\n */\n#define SCOPED_TEMPLATE(name, Traits)                          \\\ntemplate<typename Type>                                        \\\nstruct name : public mozilla::Scoped<Traits<Type> >            \\\n{                                                              \\\n    typedef mozilla::Scoped<Traits<Type> > Super;              \\\n    typedef typename Super::Resource Resource;                 \\\n    name& operator=(Resource ptr) {                            \\\n      Super::operator=(ptr);                                   \\\n      return *this;                                            \\\n    }                                                          \\\n    explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)        \\\n      : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)  \\\n    {}                                                         \\\n    explicit name(Resource ptr                                 \\\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)             \\\n      : Super(ptr MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)   \\\n    {}                                                         \\\n  private:                                                     \\\n    explicit name(name& source) MOZ_DELETE;                    \\\n    name& operator=(name& source) MOZ_DELETE;                  \\\n};\n\n/*\n * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d.\n *\n *   struct S { ... };\n *   ScopedFreePtr<S> foo = malloc(sizeof(S));\n *   ScopedFreePtr<char> bar = strdup(str);\n */\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return nullptr; }\n    static void release(T* ptr) { free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)\n\n/*\n * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.\n *\n *   struct S { ... };\n *   ScopedDeletePtr<S> foo = new S();\n */\ntemplate<typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)\n\n/*\n * ScopedDeleteArray is a RAII wrapper for pointers that need to be delete[]ed.\n *\n *   struct S { ... };\n *   ScopedDeleteArray<S> foo = new S[42];\n */\ntemplate<typename T>\nstruct ScopedDeleteArrayTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete [] ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeleteArray, ScopedDeleteArrayTraits)\n\n/*\n * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped\n * pointers for types with custom deleters; just overload\n * TypeSpecificDelete(T*) in the same namespace as T to call the deleter for\n * type T.\n *\n * @param name The name of the class to define.\n * @param Type A struct implementing clean-up. See the implementations\n * for more details.\n * *param Deleter The function that is used to delete/destroy/free a\n *        non-null value of Type*.\n *\n * Example:\n *\n *   MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \\\n *                                             PR_Close)\n *   ...\n *   {\n *       ScopedPRFileDesc file(PR_OpenFile(...));\n *       ...\n *   } // file is closed with PR_Close here\n */\n#define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \\\ntemplate <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \\\ntypedef ::mozilla::TypeSpecificScopedPointer<Type> name;\n\ntemplate <typename T> void TypeSpecificDelete(T * value);\n\ntemplate <typename T>\nstruct TypeSpecificScopedPointerTraits\n{\n    typedef T* type;\n    const static type empty() { return nullptr; }\n    const static void release(type value)\n    {\n      if (value)\n        TypeSpecificDelete(value);\n    }\n};\n\nSCOPED_TEMPLATE(TypeSpecificScopedPointer, TypeSpecificScopedPointerTraits)\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Scoped_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/SplayTree.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/**\n * A sorted tree with optimal access times, where recently-accessed elements\n * are faster to access again.\n */\n\n#ifndef mozilla_SplayTree_h\n#define mozilla_SplayTree_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\ntemplate<class T, class C>\nclass SplayTree;\n\ntemplate<typename T>\nclass SplayTreeNode\n{\n  public:\n    template<class A, class B>\n    friend class SplayTree;\n\n    SplayTreeNode()\n      : left(nullptr), right(nullptr), parent(nullptr)\n    {}\n\n  private:\n    T* left;\n    T* right;\n    T* parent;\n};\n\n\n/**\n * Class which represents a splay tree.\n * Splay trees are balanced binary search trees for which search, insert and\n * remove are all amortized O(log n), but where accessing a node makes it\n * faster to access that node in the future.\n *\n * T indicates the type of tree elements, Comparator must have a static\n * compare(const T&, const T&) method ordering the elements. The compare\n * method must be free from side effects.\n */\ntemplate<typename T, class Comparator>\nclass SplayTree\n{\n    T* root;\n    T* freeList;\n\n  public:\n    SplayTree()\n      : root(nullptr), freeList(nullptr)\n    {}\n\n    bool empty() const {\n      return !root;\n    }\n\n    bool contains(const T& v)\n    {\n      if (empty())\n        return false;\n\n      T* last = lookup(v);\n      splay(last);\n      checkCoherency(root, nullptr);\n      return Comparator::compare(v, *last) == 0;\n    }\n\n    bool insert(T* v)\n    {\n      MOZ_ASSERT(!contains(*v), \"Duplicate elements are not allowed.\");\n\n      if (!root) {\n        root = v;\n        return true;\n      }\n      T* last = lookup(*v);\n      int cmp = Comparator::compare(*v, *last);\n\n      T** parentPointer = (cmp < 0) ? &last->left : &last->right;\n      MOZ_ASSERT(!*parentPointer);\n      *parentPointer = v;\n      v->parent = last;\n\n      splay(v);\n      checkCoherency(root, nullptr);\n      return true;\n    }\n\n    T* remove(const T& v)\n    {\n      T* last = lookup(v);\n      MOZ_ASSERT(last, \"This tree must contain the element being removed.\");\n      MOZ_ASSERT(Comparator::compare(v, *last) == 0);\n\n      // Splay the tree so that the item to remove is the root.\n      splay(last);\n      MOZ_ASSERT(last == root);\n\n      // Find another node which can be swapped in for the root: either the\n      // rightmost child of the root's left, or the leftmost child of the\n      // root's right.\n      T* swap;\n      T* swapChild;\n      if (root->left) {\n        swap = root->left;\n        while (swap->right)\n          swap = swap->right;\n        swapChild = swap->left;\n      } else if (root->right) {\n        swap = root->right;\n        while (swap->left)\n          swap = swap->left;\n        swapChild = swap->right;\n      } else {\n        T* result = root;\n        root = nullptr;\n        return result;\n      }\n\n      // The selected node has at most one child, in swapChild. Detach it\n      // from the subtree by replacing it with that child.\n      if (swap == swap->parent->left)\n        swap->parent->left = swapChild;\n      else\n        swap->parent->right = swapChild;\n      if (swapChild)\n        swapChild->parent = swap->parent;\n\n      // Make the selected node the new root.\n      root = swap;\n      root->parent = nullptr;\n      root->left = last->left;\n      root->right = last->right;\n      if (root->left) {\n        root->left->parent = root;\n      }\n      if (root->right) {\n        root->right->parent = root;\n      }\n\n      checkCoherency(root, nullptr);\n      return last;\n    }\n\n    T* removeMin()\n    {\n      MOZ_ASSERT(root, \"No min to remove!\");\n\n      T* min = root;\n      while (min->left)\n        min = min->left;\n      return remove(*min);\n    }\n\n  private:\n    /**\n     * Returns the node in this comparing equal to |v|, or a node just greater or\n     * just less than |v| if there is no such node.\n     */\n    T* lookup(const T& v)\n    {\n      MOZ_ASSERT(!empty());\n\n      T* node = root;\n      T* parent;\n      do {\n        parent = node;\n        int c = Comparator::compare(v, *node);\n        if (c == 0)\n          return node;\n        else if (c < 0)\n          node = node->left;\n        else\n          node = node->right;\n      } while (node);\n      return parent;\n    }\n\n    /**\n     * Rotate the tree until |node| is at the root of the tree. Performing\n     * the rotations in this fashion preserves the amortized balancing of\n     * the tree.\n     */\n    void splay(T* node)\n    {\n      MOZ_ASSERT(node);\n\n      while (node != root) {\n        T* parent = node->parent;\n        if (parent == root) {\n          // Zig rotation.\n          rotate(node);\n          MOZ_ASSERT(node == root);\n          return;\n        }\n        T* grandparent = parent->parent;\n        if ((parent->left == node) == (grandparent->left == parent)) {\n          // Zig-zig rotation.\n          rotate(parent);\n          rotate(node);\n        } else {\n          // Zig-zag rotation.\n          rotate(node);\n          rotate(node);\n        }\n      }\n    }\n\n    void rotate(T* node)\n    {\n      // Rearrange nodes so that node becomes the parent of its current\n      // parent, while preserving the sortedness of the tree.\n      T* parent = node->parent;\n      if (parent->left == node) {\n        //     x          y\n        //   y  c  ==>  a  x\n        //  a b           b c\n        parent->left = node->right;\n        if (node->right)\n          node->right->parent = parent;\n        node->right = parent;\n      } else {\n        MOZ_ASSERT(parent->right == node);\n        //   x             y\n        //  a  y   ==>   x  c\n        //    b c       a b\n        parent->right = node->left;\n        if (node->left)\n          node->left->parent = parent;\n        node->left = parent;\n      }\n      node->parent = parent->parent;\n      parent->parent = node;\n      if (T* grandparent = node->parent) {\n        if (grandparent->left == parent)\n          grandparent->left = node;\n        else\n          grandparent->right = node;\n      } else {\n        root = node;\n      }\n    }\n\n    T* checkCoherency(T* node, T* minimum)\n    {\n#ifdef DEBUG\n      MOZ_ASSERT_IF(root, !root->parent);\n      if (!node) {\n        MOZ_ASSERT(!root);\n        return nullptr;\n      }\n      MOZ_ASSERT_IF(!node->parent, node == root);\n      MOZ_ASSERT_IF(minimum, Comparator::compare(*minimum, *node) < 0);\n      if (node->left) {\n        MOZ_ASSERT(node->left->parent == node);\n        T* leftMaximum = checkCoherency(node->left, minimum);\n        MOZ_ASSERT(Comparator::compare(*leftMaximum, *node) < 0);\n      }\n      if (node->right) {\n        MOZ_ASSERT(node->right->parent == node);\n        return checkCoherency(node->right, node);\n      }\n      return node;\n#else\n      return nullptr;\n#endif\n    }\n\n    SplayTree(const SplayTree&) MOZ_DELETE;\n    void operator=(const SplayTree&) MOZ_DELETE;\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_SplayTree_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/TemplateLib.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Reusable template meta-functions on types and compile-time values.  Meta-\n * functions are placed inside the 'tl' namespace to avoid conflict with non-\n * meta functions of the same name (e.g., mozilla::tl::FloorLog2 vs.\n * mozilla::FloorLog2).\n *\n * When constexpr support becomes universal, we should probably use that instead\n * of some of these templates, for simplicity.\n */\n\n#ifndef mozilla_TemplateLib_h\n#define mozilla_TemplateLib_h\n\n#include <limits.h>\n#include <stddef.h>\n\nnamespace mozilla {\n\nnamespace tl {\n\n/** Compute min/max. */\ntemplate<size_t I, size_t J>\nstruct Min\n{\n    static const size_t value = I < J ? I : J;\n};\ntemplate<size_t I, size_t J>\nstruct Max\n{\n    static const size_t value = I > J ? I : J;\n};\n\n/** Compute floor(log2(i)). */\ntemplate<size_t I>\nstruct FloorLog2\n{\n    static const size_t value = 1 + FloorLog2<I / 2>::value;\n};\ntemplate<> struct FloorLog2<0> { /* Error */ };\ntemplate<> struct FloorLog2<1> { static const size_t value = 0; };\n\n/** Compute ceiling(log2(i)). */\ntemplate<size_t I>\nstruct CeilingLog2\n{\n    static const size_t value = FloorLog2<2 * I - 1>::value;\n};\n\n/** Round up to the nearest power of 2. */\ntemplate<size_t I>\nstruct RoundUpPow2\n{\n    static const size_t value = size_t(1) << CeilingLog2<I>::value;\n};\ntemplate<>\nstruct RoundUpPow2<0>\n{\n    static const size_t value = 1;\n};\n\n/** Compute the number of bits in the given unsigned type. */\ntemplate<typename T>\nstruct BitSize\n{\n    static const size_t value = sizeof(T) * CHAR_BIT;\n};\n\n/**\n * Produce an N-bit mask, where N <= BitSize<size_t>::value.  Handle the\n * language-undefined edge case when N = BitSize<size_t>::value.\n */\ntemplate<size_t N>\nstruct NBitMask\n{\n    // Assert the precondition.  On success this evaluates to 0.  Otherwise it\n    // triggers divide-by-zero at compile time: a guaranteed compile error in\n    // C++11, and usually one in C++98.  Add this value to |value| to assure\n    // its computation.\n    static const size_t checkPrecondition = 0 / size_t(N < BitSize<size_t>::value);\n    static const size_t value = (size_t(1) << N) - 1 + checkPrecondition;\n};\ntemplate<>\nstruct NBitMask<BitSize<size_t>::value>\n{\n    static const size_t value = size_t(-1);\n};\n\n/**\n * For the unsigned integral type size_t, compute a mask M for N such that\n * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t)\n */\ntemplate<size_t N>\nstruct MulOverflowMask\n{\n    static const size_t value =\n      ~NBitMask<BitSize<size_t>::value - CeilingLog2<N>::value>::value;\n};\ntemplate<> struct MulOverflowMask<0> { /* Error */ };\ntemplate<> struct MulOverflowMask<1> { static const size_t value = 0; };\n\n} // namespace tl\n\n} // namespace mozilla\n\n#endif /* mozilla_TemplateLib_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/ThreadLocal.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cross-platform lightweight thread local data wrappers. */\n\n#ifndef mozilla_ThreadLocal_h\n#define mozilla_ThreadLocal_h\n\n#if defined(XP_WIN)\n// This file will get included in any file that wants to add a profiler mark.\n// In order to not bring <windows.h> together we could include windef.h and\n// winbase.h which are sufficient to get the prototypes for the Tls* functions.\n// # include <windef.h>\n// # include <winbase.h>\n// Unfortunately, even including these headers causes us to add a bunch of ugly\n// stuff to our namespace e.g #define CreateEvent CreateEventW\nextern \"C\" {\n__declspec(dllimport) void* __stdcall TlsGetValue(unsigned long);\n__declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void*);\n__declspec(dllimport) unsigned long __stdcall TlsAlloc();\n}\n#else\n#  include <pthread.h>\n#  include <signal.h>\n#endif\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n// sig_safe_t denotes an atomic type which can be read or stored in a single\n// instruction.  This means that data of this type is safe to be manipulated\n// from a signal handler, or other similar asynchronous execution contexts.\n#if defined(XP_WIN)\ntypedef unsigned long sig_safe_t;\n#else\ntypedef sig_atomic_t sig_safe_t;\n#endif\n\n/*\n * Thread Local Storage helpers.\n *\n * Usage:\n *\n * Only static-storage-duration (e.g. global variables, or static class members)\n * objects of this class should be instantiated. This class relies on\n * zero-initialization, which is implicit for static-storage-duration objects.\n * It doesn't have a custom default constructor, to avoid static initializers.\n *\n * API usage:\n *\n * // Create a TLS item\n * mozilla::ThreadLocal<int> tlsKey;\n * if (!tlsKey.init()) {\n *   // deal with the error\n * }\n *\n * // Set the TLS value\n * tlsKey.set(123);\n *\n * // Get the TLS value\n * int value = tlsKey.get();\n */\ntemplate<typename T>\nclass ThreadLocal\n{\n#if defined(XP_WIN)\n    typedef unsigned long key_t;\n#else\n    typedef pthread_key_t key_t;\n#endif\n\n    union Helper {\n      void* ptr;\n      T value;\n    };\n\n  public:\n    MOZ_WARN_UNUSED_RESULT inline bool init();\n\n    inline T get() const;\n\n    inline void set(const T value);\n\n    bool initialized() const {\n      return inited;\n    }\n\n  private:\n    key_t key;\n    bool inited;\n};\n\ntemplate<typename T>\ninline bool\nThreadLocal<T>::init()\n{\n  static_assert(sizeof(T) <= sizeof(void*),\n                \"mozilla::ThreadLocal can't be used for types larger than \"\n                \"a pointer\");\n  MOZ_ASSERT(!initialized());\n#ifdef XP_WIN\n  key = TlsAlloc();\n  inited = key != 0xFFFFFFFFUL; // TLS_OUT_OF_INDEXES\n#else\n  inited = !pthread_key_create(&key, nullptr);\n#endif\n  return inited;\n}\n\ntemplate<typename T>\ninline T\nThreadLocal<T>::get() const\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n#ifdef XP_WIN\n  h.ptr = TlsGetValue(key);\n#else\n  h.ptr = pthread_getspecific(key);\n#endif\n  return h.value;\n}\n\ntemplate<typename T>\ninline void\nThreadLocal<T>::set(const T value)\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n  h.value = value;\n  bool succeeded;\n#ifdef XP_WIN\n  succeeded = TlsSetValue(key, h.ptr);\n#else\n  succeeded = !pthread_setspecific(key, h.ptr);\n#endif\n  if (!succeeded)\n    MOZ_CRASH();\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_ThreadLocal_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/TypeTraits.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Template-based metaprogramming and type-testing facilities. */\n\n#ifndef mozilla_TypeTraits_h\n#define mozilla_TypeTraits_h\n\n/*\n * These traits are approximate copies of the traits and semantics from C++11's\n * <type_traits> header.  Don't add traits not in that header!  When all\n * platforms provide that header, we can convert all users and remove this one.\n */\n\n#include <wchar.h>\n\nnamespace mozilla {\n\n/* Forward declarations. */\n\ntemplate<typename> struct RemoveCV;\n\n/* 20.9.3 Helper classes [meta.help] */\n\n/**\n * Helper class used as a base for various type traits, exposed publicly\n * because <type_traits> exposes it as well.\n */\ntemplate<typename T, T Value>\nstruct IntegralConstant\n{\n    static const T value = Value;\n    typedef T ValueType;\n    typedef IntegralConstant<T, Value> Type;\n};\n\n/** Convenient aliases. */\ntypedef IntegralConstant<bool, true> TrueType;\ntypedef IntegralConstant<bool, false> FalseType;\n\n/* 20.9.4 Unary type traits [meta.unary] */\n\n/* 20.9.4.1 Primary type categories [meta.unary.cat] */\n\nnamespace detail {\n\ntemplate <typename T>\nstruct IsIntegralHelper : FalseType {};\n\ntemplate<> struct IsIntegralHelper<char>               : TrueType {};\ntemplate<> struct IsIntegralHelper<signed char>        : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned char>      : TrueType {};\ntemplate<> struct IsIntegralHelper<short>              : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned short>     : TrueType {};\ntemplate<> struct IsIntegralHelper<int>                : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned int>       : TrueType {};\ntemplate<> struct IsIntegralHelper<long>               : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long>      : TrueType {};\ntemplate<> struct IsIntegralHelper<long long>          : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long long> : TrueType {};\ntemplate<> struct IsIntegralHelper<bool>               : TrueType {};\ntemplate<> struct IsIntegralHelper<wchar_t>            : TrueType {};\n\n} /* namespace detail */\n\n/**\n * IsIntegral determines whether a type is an integral type.\n *\n * mozilla::IsIntegral<int>::value is true;\n * mozilla::IsIntegral<unsigned short>::value is true;\n * mozilla::IsIntegral<const long>::value is true;\n * mozilla::IsIntegral<int*>::value is false;\n * mozilla::IsIntegral<double>::value is false;\n *\n * Note that the behavior of IsIntegral on char16_t and char32_t is\n * unspecified.\n */\ntemplate<typename T>\nstruct IsIntegral : detail::IsIntegralHelper<typename RemoveCV<T>::Type>\n{};\n\ntemplate<typename T, typename U>\nstruct IsSame;\n\nnamespace detail {\n\ntemplate<typename T>\nstruct IsFloatingPointHelper\n  : IntegralConstant<bool,\n                     IsSame<T, float>::value ||\n                     IsSame<T, double>::value ||\n                     IsSame<T, long double>::value>\n{};\n\n} // namespace detail\n\n/**\n * IsFloatingPoint determines whether a type is a floating point type (float,\n * double, long double).\n *\n * mozilla::IsFloatingPoint<int>::value is false;\n * mozilla::IsFloatingPoint<const float>::value is true;\n * mozilla::IsFloatingPoint<long double>::value is true;\n * mozilla::IsFloatingPoint<double*>::value is false.\n */\ntemplate<typename T>\nstruct IsFloatingPoint\n  : detail::IsFloatingPointHelper<typename RemoveCV<T>::Type>\n{};\n\n/**\n * IsPointer determines whether a type is a pointer type (but not a pointer-to-\n * member type).\n *\n * mozilla::IsPointer<struct S*>::value is true;\n * mozilla::IsPointer<int**>::value is true;\n * mozilla::IsPointer<void (*)(void)>::value is true;\n * mozilla::IsPointer<int>::value is false;\n * mozilla::IsPointer<struct S>::value is false.\n */\ntemplate<typename T>\nstruct IsPointer : FalseType {};\n\ntemplate<typename T>\nstruct IsPointer<T*> : TrueType {};\n\nnamespace detail {\n\n// __is_enum is a supported extension across all of our supported compilers.\ntemplate<typename T>\nstruct IsEnumHelper\n  : IntegralConstant<bool, __is_enum(T)>\n{};\n\n} // namespace detail\n\n/**\n * IsEnum determines whether a type is an enum type.\n *\n * mozilla::IsEnum<enum S>::value is true;\n * mozilla::IsEnum<enum S*>::value is false;\n * mozilla::IsEnum<int>::value is false;\n */\ntemplate<typename T>\nstruct IsEnum\n  : detail::IsEnumHelper<typename RemoveCV<T>::Type>\n{};\n\n/* 20.9.4.2 Composite type traits [meta.unary.comp] */\n\n/**\n * IsArithmetic determines whether a type is arithmetic.  A type is arithmetic\n * iff it is an integral type or a floating point type.\n *\n * mozilla::IsArithmetic<int>::value is true;\n * mozilla::IsArithmetic<double>::value is true;\n * mozilla::IsArithmetic<long double*>::value is false.\n */\ntemplate<typename T>\nstruct IsArithmetic\n  : IntegralConstant<bool, IsIntegral<T>::value || IsFloatingPoint<T>::value>\n{};\n\n/* 20.9.4.3 Type properties [meta.unary.prop] */\n\n/**\n * IsConst determines whether a type is const or not.\n *\n * mozilla::IsConst<int>::value is false;\n * mozilla::IsConst<void* const>::value is true;\n * mozilla::IsConst<const char*>::value is false.\n */\ntemplate<typename T>\nstruct IsConst : FalseType {};\n\ntemplate<typename T>\nstruct IsConst<const T> : TrueType {};\n\n/**\n * IsVolatile determines whether a type is volatile or not.\n *\n * mozilla::IsVolatile<int>::value is false;\n * mozilla::IsVolatile<void* volatile>::value is true;\n * mozilla::IsVolatile<volatile char*>::value is false.\n */\ntemplate<typename T>\nstruct IsVolatile : FalseType {};\n\ntemplate<typename T>\nstruct IsVolatile<volatile T> : TrueType {};\n\n/**\n * Traits class for identifying POD types.  Until C++11 there's no automatic\n * way to detect PODs, so for the moment this is done manually.  Users may\n * define specializations of this class that inherit from mozilla::TrueType and\n * mozilla::FalseType (or equivalently mozilla::IntegralConstant<bool, true or\n * false>, or conveniently from mozilla::IsPod for composite types) as needed to\n * ensure correct IsPod behavior.\n */\ntemplate<typename T>\nstruct IsPod : public FalseType {};\n\ntemplate<> struct IsPod<char>               : TrueType {};\ntemplate<> struct IsPod<signed char>        : TrueType {};\ntemplate<> struct IsPod<unsigned char>      : TrueType {};\ntemplate<> struct IsPod<short>              : TrueType {};\ntemplate<> struct IsPod<unsigned short>     : TrueType {};\ntemplate<> struct IsPod<int>                : TrueType {};\ntemplate<> struct IsPod<unsigned int>       : TrueType {};\ntemplate<> struct IsPod<long>               : TrueType {};\ntemplate<> struct IsPod<unsigned long>      : TrueType {};\ntemplate<> struct IsPod<long long>          : TrueType {};\ntemplate<> struct IsPod<unsigned long long> : TrueType {};\ntemplate<> struct IsPod<bool>               : TrueType {};\ntemplate<> struct IsPod<float>              : TrueType {};\ntemplate<> struct IsPod<double>             : TrueType {};\ntemplate<> struct IsPod<wchar_t>            : TrueType {};\ntemplate<typename T> struct IsPod<T*>       : TrueType {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsSignedHelper;\n\ntemplate<typename T>\nstruct IsSignedHelper<T, true> : TrueType {};\n\ntemplate<typename T>\nstruct IsSignedHelper<T, false>\n  : IntegralConstant<bool, IsArithmetic<T>::value && T(-1) < T(1)>\n{};\n\n} // namespace detail\n\n/**\n * IsSigned determines whether a type is a signed arithmetic type.  |char| is\n * considered a signed type if it has the same representation as |signed char|.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsSigned<int>::value is true;\n * mozilla::IsSigned<const unsigned int>::value is false;\n * mozilla::IsSigned<unsigned char>::value is false;\n * mozilla::IsSigned<float>::value is true.\n */\ntemplate<typename T>\nstruct IsSigned : detail::IsSignedHelper<T> {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsUnsignedHelper;\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, true> : FalseType {};\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, false>\n  : IntegralConstant<bool,\n                     IsArithmetic<T>::value &&\n                     (IsSame<typename RemoveCV<T>::Type, bool>::value ||\n                      T(1) < T(-1))>\n{};\n\n} // namespace detail\n\n/**\n * IsUnsigned determines whether a type is an unsigned arithmetic type.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsUnsigned<int>::value is false;\n * mozilla::IsUnsigned<const unsigned int>::value is true;\n * mozilla::IsUnsigned<unsigned char>::value is true;\n * mozilla::IsUnsigned<float>::value is false.\n */\ntemplate<typename T>\nstruct IsUnsigned : detail::IsUnsignedHelper<T> {};\n\n/* 20.9.5 Type property queries [meta.unary.prop.query] */\n\n/* 20.9.6 Relationships between types [meta.rel] */\n\n/**\n * IsSame tests whether two types are the same type.\n *\n * mozilla::IsSame<int, int>::value is true;\n * mozilla::IsSame<int*, int*>::value is true;\n * mozilla::IsSame<int, unsigned int>::value is false;\n * mozilla::IsSame<void, void>::value is true;\n * mozilla::IsSame<const int, int>::value is false;\n * mozilla::IsSame<struct S, struct S>::value is true.\n */\ntemplate<typename T, typename U>\nstruct IsSame : FalseType {};\n\ntemplate<typename T>\nstruct IsSame<T, T> : TrueType {};\n\nnamespace detail {\n\n// The trickery used to implement IsBaseOf here makes it possible to use it for\n// the cases of private and multiple inheritance.  This code was inspired by the\n// sample code here:\n//\n// http://stackoverflow.com/questions/2910979/how-is-base-of-works\ntemplate<class Base, class Derived>\nstruct BaseOfHelper\n{\n  public:\n    operator Base*() const;\n    operator Derived*();\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base, const Derived>\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base&, Derived&> : FalseType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, Type> : TrueType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, const Type> : TrueType {};\n\n} /* namespace detail */\n\n/*\n * IsBaseOf allows to know whether a given class is derived from another.\n *\n * Consider the following class definitions:\n *\n *   class A {};\n *   class B : public A {};\n *   class C {};\n *\n * mozilla::IsBaseOf<A, B>::value is true;\n * mozilla::IsBaseOf<A, C>::value is false;\n */\ntemplate<class Base, class Derived>\nstruct IsBaseOf\n  : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>\n{};\n\nnamespace detail {\n\ntemplate<typename From, typename To>\nstruct ConvertibleTester\n{\n  private:\n    static From create();\n\n    template<typename From1, typename To1>\n    static char test(To to);\n\n    template<typename From1, typename To1>\n    static int test(...);\n\n  public:\n    static const bool value =\n      sizeof(test<From, To>(create())) == sizeof(char);\n};\n\n} // namespace detail\n\n/**\n * IsConvertible determines whether a value of type From will implicitly convert\n * to a value of type To.  For example:\n *\n *   struct A {};\n *   struct B : public A {};\n *   struct C {};\n *\n * mozilla::IsConvertible<A, A>::value is true;\n * mozilla::IsConvertible<A*, A*>::value is true;\n * mozilla::IsConvertible<B, A>::value is true;\n * mozilla::IsConvertible<B*, A*>::value is true;\n * mozilla::IsConvertible<C, A>::value is false;\n * mozilla::IsConvertible<A, C>::value is false;\n * mozilla::IsConvertible<A*, C*>::value is false;\n * mozilla::IsConvertible<C*, A*>::value is false.\n *\n * For obscure reasons, you can't use IsConvertible when the types being tested\n * are related through private inheritance, and you'll get a compile error if\n * you try.  Just don't do it!\n */\ntemplate<typename From, typename To>\nstruct IsConvertible\n  : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>\n{};\n\n/* 20.9.7 Transformations between types [meta.trans] */\n\n/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */\n\n/**\n * RemoveConst removes top-level const qualifications on a type.\n *\n * mozilla::RemoveConst<int>::Type is int;\n * mozilla::RemoveConst<const int>::Type is int;\n * mozilla::RemoveConst<const int*>::Type is const int*;\n * mozilla::RemoveConst<int* const>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveConst\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveConst<const T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveVolatile removes top-level volatile qualifications on a type.\n *\n * mozilla::RemoveVolatile<int>::Type is int;\n * mozilla::RemoveVolatile<volatile int>::Type is int;\n * mozilla::RemoveVolatile<volatile int*>::Type is volatile int*;\n * mozilla::RemoveVolatile<int* volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveVolatile\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveVolatile<volatile T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveCV removes top-level const and volatile qualifications on a type.\n *\n * mozilla::RemoveCV<int>::Type is int;\n * mozilla::RemoveCV<const int>::Type is int;\n * mozilla::RemoveCV<volatile int>::Type is int;\n * mozilla::RemoveCV<int* const volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveCV\n{\n    typedef typename RemoveConst<typename RemoveVolatile<T>::Type>::Type Type;\n};\n\n/* 20.9.7.2 Reference modifications [meta.trans.ref] */\n\n/* 20.9.7.3 Sign modifications [meta.trans.sign] */\n\ntemplate<bool B, typename T = void>\nstruct EnableIf;\n\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional;\n\nnamespace detail {\n\ntemplate<bool MakeConst, typename T>\nstruct WithC : Conditional<MakeConst, const T, T>\n{};\n\ntemplate<bool MakeVolatile, typename T>\nstruct WithV : Conditional<MakeVolatile, volatile T, T>\n{};\n\n\ntemplate<bool MakeConst, bool MakeVolatile, typename T>\nstruct WithCV : WithC<MakeConst, typename WithV<MakeVolatile, T>::Type>\n{};\n\ntemplate<typename T>\nstruct CorrespondingSigned;\n\ntemplate<>\nstruct CorrespondingSigned<char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned short> { typedef short Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned int> { typedef int Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long> { typedef long Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long long> { typedef long long Type; };\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsSignedIntegerType = IsSigned<CVRemoved>::value &&\n                                    !IsSame<char, CVRemoved>::value>\nstruct MakeSigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingSigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeSigned produces the corresponding signed integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already a signed integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an unsigned integer type, the signed variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the integral type of the same size as T, with the lowest rank,\n * with T's const/volatile qualifiers, is produced.  (This basically only acts\n * to produce signed char when T = char.)\n *\n * mozilla::MakeSigned<unsigned long>::Type is signed long;\n * mozilla::MakeSigned<volatile int>::Type is volatile int;\n * mozilla::MakeSigned<const unsigned short>::Type is const signed short;\n * mozilla::MakeSigned<const char>::Type is const signed char;\n * mozilla::MakeSigned<bool> is an error;\n * mozilla::MakeSigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeSigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeSigned<T>\n            >::Type\n{};\n\nnamespace detail {\n\ntemplate<typename T>\nstruct CorrespondingUnsigned;\n\ntemplate<>\nstruct CorrespondingUnsigned<char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<signed char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<short> { typedef unsigned short Type; };\ntemplate<>\nstruct CorrespondingUnsigned<int> { typedef unsigned int Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long> { typedef unsigned long Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long long> { typedef unsigned long long Type; };\n\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsUnsignedIntegerType = IsUnsigned<CVRemoved>::value &&\n                                      !IsSame<char, CVRemoved>::value>\nstruct MakeUnsigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingUnsigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeUnsigned produces the corresponding unsigned integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already an unsigned integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an signed integer type, the unsigned variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the unsigned integral type of the same size as T, with the lowest\n * rank, with T's const/volatile qualifiers, is produced.  (This basically only\n * acts to produce unsigned char when T = char.)\n *\n * mozilla::MakeUnsigned<signed long>::Type is unsigned long;\n * mozilla::MakeUnsigned<volatile unsigned int>::Type is volatile unsigned int;\n * mozilla::MakeUnsigned<const signed short>::Type is const unsigned short;\n * mozilla::MakeUnsigned<const char>::Type is const unsigned char;\n * mozilla::MakeUnsigned<bool> is an error;\n * mozilla::MakeUnsigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeUnsigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeUnsigned<T>\n            >::Type\n{};\n\n/* 20.9.7.4 Array modifications [meta.trans.arr] */\n\n/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */\n\n/* 20.9.7.6 Other transformations [meta.trans.other] */\n\n/**\n * EnableIf is a struct containing a typedef of T if and only if B is true.\n *\n * mozilla::EnableIf<true, int>::Type is int;\n * mozilla::EnableIf<false, int>::Type is a compile-time error.\n *\n * Use this template to implement SFINAE-style (Substitution Failure Is not An\n * Error) requirements.  For example, you might use it to impose a restriction\n * on a template parameter:\n *\n *   template<typename T>\n *   class PodVector // vector optimized to store POD (memcpy-able) types\n *   {\n *      EnableIf<IsPod<T>::value, T>::Type* vector;\n *      size_t length;\n *      ...\n *   };\n */\ntemplate<bool B, typename T>\nstruct EnableIf\n{};\n\ntemplate<typename T>\nstruct EnableIf<true, T>\n{\n    typedef T Type;\n};\n\n/**\n * Conditional selects a class between two, depending on a given boolean value.\n *\n * mozilla::Conditional<true, A, B>::Type is A;\n * mozilla::Conditional<false, A, B>::Type is B;\n */\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional\n{\n    typedef A Type;\n};\n\ntemplate<class A, class B>\nstruct Conditional<false, A, B>\n{\n    typedef B Type;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_TypeTraits_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/TypedEnum.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Macros to emulate C++11 typed enums and enum classes. */\n\n#ifndef mozilla_TypedEnum_h\n#define mozilla_TypedEnum_h\n\n#include \"mozilla/Attributes.h\"\n\n#if defined(__cplusplus)\n\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_strong_enums)\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)\n#      define MOZ_HAVE_CXX11_ENUM_TYPE\n#      define MOZ_HAVE_CXX11_STRONG_ENUMS\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1400\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#  endif\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#endif\n\n/**\n * MOZ_ENUM_TYPE specifies the underlying numeric type for an enum.  It's\n * specified by placing MOZ_ENUM_TYPE(type) immediately after the enum name in\n * its declaration, and before the opening curly brace, like\n *\n *   enum MyEnum MOZ_ENUM_TYPE(uint16_t)\n *   {\n *     A,\n *     B = 7,\n *     C\n *   };\n *\n * In supporting compilers, the macro will expand to \": uint16_t\".  The\n * compiler will allocate exactly two bytes for MyEnum and will require all\n * enumerators to have values between 0 and 65535.  (Thus specifying \"B =\n * 100000\" instead of \"B = 7\" would fail to compile.)  In old compilers the\n * macro expands to the empty string, and the underlying type is generally\n * undefined.\n */\n#ifdef MOZ_HAVE_CXX11_ENUM_TYPE\n#  define MOZ_ENUM_TYPE(type)   : type\n#else\n#  define MOZ_ENUM_TYPE(type)   /* no support */\n#endif\n\n/**\n * MOZ_BEGIN_ENUM_CLASS and MOZ_END_ENUM_CLASS provide access to the\n * strongly-typed enumeration feature of C++11 (\"enum class\").  If supported\n * by the compiler, an enum defined using these macros will not be implicitly\n * converted to any other type, and its enumerators will be scoped using the\n * enumeration name.  Place MOZ_BEGIN_ENUM_CLASS(EnumName, type) in place of\n * \"enum EnumName {\", and MOZ_END_ENUM_CLASS(EnumName) in place of the closing\n * \"};\".  For example,\n *\n *   MOZ_BEGIN_ENUM_CLASS(Enum, int32_t)\n *     A,\n *     B = 6\n *   MOZ_END_ENUM_CLASS(Enum)\n *\n * This will make \"Enum::A\" and \"Enum::B\" appear in the global scope, but \"A\"\n * and \"B\" will not.  In compilers that support C++11 strongly-typed\n * enumerations, implicit conversions of Enum values to numeric types will\n * fail.  In other compilers, Enum itself will actually be defined as a class,\n * and some implicit conversions will fail while others will succeed.\n *\n * The type argument specifies the underlying type for the enum where\n * supported, as with MOZ_ENUM_TYPE().  For simplicity, it is currently\n * mandatory.  As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do\n * not support it.\n *\n * MOZ_{BEGIN,END}_ENUM_CLASS doesn't work for defining enum classes nested\n * inside classes.  To define an enum class nested inside another class, use\n * MOZ_{BEGIN,END}_NESTED_ENUM_CLASS, and place a MOZ_FINISH_NESTED_ENUM_CLASS\n * in namespace scope to handle bits that can only be implemented with\n * namespace-scoped code.  For example:\n *\n *   class FooBar {\n *\n *     MOZ_BEGIN_NESTED_ENUM_CLASS(Enum, int32_t)\n *       A,\n *       B = 6\n *     MOZ_END_NESTED_ENUM_CLASS(Enum)\n *\n *   };\n *\n *   MOZ_FINISH_NESTED_ENUM_CLASS(FooBar::Enum)\n */\n#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS)\n  /*\n   * All compilers that support strong enums also support an explicit\n   * underlying type, so no extra check is needed.\n   */\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     enum class Name : type {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) /* nothing */\n#else\n   /**\n    * We need Name to both name a type, and scope the provided enumerator\n    * names.  Namespaces and classes both provide scoping, but namespaces\n    * aren't types, so we need to use a class that wraps the enum values.  We\n    * have an implicit conversion from the inner enum type to the class, so\n    * statements like\n    *\n    *   Enum x = Enum::A;\n    *\n    * will still work.  We need to define an implicit conversion from the class\n    * to the inner enum as well, so that (for instance) switch statements will\n    * work.  This means that the class can be implicitly converted to a numeric\n    * value as well via the enum type, since C++ allows an implicit\n    * user-defined conversion followed by a standard conversion to still be\n    * implicit.\n    *\n    * We have an explicit constructor from int defined, so that casts like\n    * (Enum)7 will still work.  We also have a zero-argument constructor with\n    * no arguments, so declaration without initialization (like \"Enum foo;\")\n    * will work.\n    *\n    * Additionally, we'll delete as many operators as possible for the inner\n    * enum type, so statements like this will still fail:\n    *\n    *   f(5 + Enum::B); // deleted operator+\n    *\n    * But we can't prevent things like this, because C++ doesn't allow\n    * overriding conversions or assignment operators for enums:\n    *\n    *   int x = Enum::A;\n    *   int f()\n    *   {\n    *     return Enum::A;\n    *   }\n    */\\\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     class Name \\\n     { \\\n       public: \\\n         enum Enum MOZ_ENUM_TYPE(type) \\\n         {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n         }; \\\n         Name() {} \\\n         Name(Enum aEnum) : mEnum(aEnum) {} \\\n         explicit Name(int num) : mEnum((Enum)num) {} \\\n         operator Enum() const { return mEnum; } \\\n       private: \\\n         Enum mEnum; \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) \\\n     inline int operator+(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator-(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator*(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator*(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator/(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator/(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator%(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator%(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator++(Name::Enum&) MOZ_DELETE; \\\n     inline int operator++(Name::Enum&, int) MOZ_DELETE; \\\n     inline int& operator--(Name::Enum&) MOZ_DELETE; \\\n     inline int operator--(Name::Enum&, int) MOZ_DELETE; \\\n     inline bool operator==(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator==(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator!=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!(const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline bool operator||(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator||(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline int operator~(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator|(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator|(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator^(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator^(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator<<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator<<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator>>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator>>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int& operator+=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator-=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator*=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator/=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator%=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator&=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator|=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator^=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator<<=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator>>=(int&, const Name::Enum&) MOZ_DELETE;\n#endif\n#  define MOZ_BEGIN_ENUM_CLASS(Name, type) MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type)\n#  define MOZ_END_ENUM_CLASS(Name) \\\n     MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     MOZ_FINISH_NESTED_ENUM_CLASS(Name)\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_TypedEnum_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Types.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt foundational types and macros. */\n\n#ifndef mozilla_Types_h\n#define mozilla_Types_h\n\n/*\n * This header must be valid C and C++, includable by code embedding either\n * SpiderMonkey or Gecko.\n */\n\n/* Expose all <stdint.h> types and size_t. */\n#include <stddef.h>\n#include <stdint.h>\n\n/* Implement compiler and linker macros needed for APIs. */\n\n/*\n * MOZ_EXPORT is used to declare and define a symbol or type which is externally\n * visible to users of the current library.  It encapsulates various decorations\n * needed to properly export the method's symbol.\n *\n *   api.h:\n *     extern MOZ_EXPORT int MeaningOfLife(void);\n *     extern MOZ_EXPORT int LuggageCombination;\n *\n *   api.c:\n *     int MeaningOfLife(void) { return 42; }\n *     int LuggageCombination = 12345;\n *\n * If you are merely sharing a method across files, just use plain |extern|.\n * These macros are designed for use by library interfaces -- not for normal\n * methods or data used cross-file.\n */\n#if defined(WIN32) || defined(XP_OS2)\n#  define MOZ_EXPORT   __declspec(dllexport)\n#else /* Unix */\n#  ifdef HAVE_VISIBILITY_ATTRIBUTE\n#    define MOZ_EXPORT       __attribute__((visibility(\"default\")))\n#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n#    define MOZ_EXPORT      __global\n#  else\n#    define MOZ_EXPORT /* nothing */\n#  endif\n#endif\n\n\n/*\n * Whereas implementers use MOZ_EXPORT to declare and define library symbols,\n * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the\n * implementer of the library will expose an API macro which expands to either\n * the export or import version of the macro, depending upon the compilation\n * mode.\n */\n#ifdef _WIN32\n#  if defined(__MWERKS__)\n#    define MOZ_IMPORT_API /* nothing */\n#  else\n#    define MOZ_IMPORT_API __declspec(dllimport)\n#  endif\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_API  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_API MOZ_EXPORT\n#endif\n\n#if defined(_WIN32) && !defined(__MWERKS__)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_DATA  MOZ_EXPORT\n#endif\n\n/*\n * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose\n * export mfbt declarations when building mfbt, and they expose import mfbt\n * declarations when using mfbt.\n */\n#if defined(IMPL_MFBT)\n#  define MFBT_API     MOZ_EXPORT\n#  define MFBT_DATA    MOZ_EXPORT\n#else\n  /*\n   * On linux mozglue is linked in the program and we link libxul.so with\n   * -z,defs. Normally that causes the linker to reject undefined references in\n   * libxul.so, but as a loophole it allows undefined references to weak\n   * symbols. We add the weak attribute to the import version of the MFBT API\n   * macros to exploit this.\n   */\n#  if defined(MOZ_GLUE_IN_PROGRAM)\n#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API\n#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA\n#  else\n#    define MFBT_API   MOZ_IMPORT_API\n#    define MFBT_DATA  MOZ_IMPORT_DATA\n#  endif\n#endif\n\n/*\n * C symbols in C++ code must be declared immediately within |extern \"C\"|\n * blocks.  However, in C code, they need not be declared specially.  This\n * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C\n * macros, so that the user need not know whether he is being used in C or C++\n * code.\n *\n *   MOZ_BEGIN_EXTERN_C\n *\n *   extern MOZ_EXPORT int MostRandomNumber(void);\n *   ...other declarations...\n *\n *   MOZ_END_EXTERN_C\n *\n * This said, it is preferable to just use |extern \"C\"| in C++ header files for\n * its greater clarity.\n */\n#ifdef __cplusplus\n#  define MOZ_BEGIN_EXTERN_C    extern \"C\" {\n#  define MOZ_END_EXTERN_C      }\n#else\n#  define MOZ_BEGIN_EXTERN_C\n#  define MOZ_END_EXTERN_C\n#endif\n\n/*\n * GCC's typeof is available when decltype is not.\n */\n#if defined(__GNUC__) && defined(__cplusplus) && \\\n  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L\n#  define decltype __typeof__\n#endif\n\n#endif /* mozilla_Types_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Util.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Miscellaneous uncategorized functionality.  Please add new functionality to\n * new headers, or to other appropriate existing headers, not here.\n */\n\n#ifndef mozilla_Util_h\n#define mozilla_Util_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many \n * bytes of alignment a given type needs.\n */\ntemplate<class T>\nclass AlignmentFinder\n{\n    struct Aligner\n    {\n        char c;\n        T t;\n    };\n\n  public:\n    static const size_t alignment = sizeof(Aligner) - sizeof(T);\n};\n\n#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment\n\n/*\n * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.\n *\n * For instance,\n *\n *   MOZ_ALIGNED_DECL(char arr[2], 8);\n *\n * will declare a two-character array |arr| aligned to 8 bytes.\n */\n\n#if defined(__GNUC__)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     _type __attribute__((aligned(_align)))\n#elif defined(_MSC_VER)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     __declspec(align(_align)) _type\n#else\n#  warning \"We don't know how to align variables on this compiler.\"\n#  define MOZ_ALIGNED_DECL(_type, _align) _type\n#endif\n\n/*\n * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N\n * bytes.\n *\n * We support 1, 2, 4, 8, and 16-bit alignment.\n */\ntemplate<size_t align>\nstruct AlignedElem;\n\n/*\n * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where\n * foo is a template parameter.\n */\n\ntemplate<>\nstruct AlignedElem<1>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 1);\n};\n\ntemplate<>\nstruct AlignedElem<2>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 2);\n};\n\ntemplate<>\nstruct AlignedElem<4>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 4);\n};\n\ntemplate<>\nstruct AlignedElem<8>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 8);\n};\n\ntemplate<>\nstruct AlignedElem<16>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 16);\n};\n\n/*\n * This utility pales in comparison to Boost's aligned_storage. The utility\n * simply assumes that uint64_t is enough alignment for anyone. This may need\n * to be extended one day...\n *\n * As an important side effect, pulling the storage into this template is\n * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving\n * false negatives when we cast from the char buffer to whatever type we've\n * constructed using the bytes.\n */\ntemplate<size_t nbytes>\nstruct AlignedStorage\n{\n    union U {\n      char bytes[nbytes];\n      uint64_t _;\n    } u;\n\n    const void* addr() const { return u.bytes; }\n    void* addr() { return u.bytes; }\n};\n\ntemplate<class T>\nstruct AlignedStorage2\n{\n    union U {\n      char bytes[sizeof(T)];\n      uint64_t _;\n    } u;\n\n    const T* addr() const { return reinterpret_cast<const T*>(u.bytes); }\n    T* addr() { return static_cast<T*>(static_cast<void*>(u.bytes)); }\n};\n\n/*\n * Small utility for lazily constructing objects without using dynamic storage.\n * When a Maybe<T> is constructed, it is |empty()|, i.e., no value of T has\n * been constructed and no T destructor will be called when the Maybe<T> is\n * destroyed. Upon calling |construct|, a T object will be constructed with the\n * given arguments and that object will be destroyed when the owning Maybe<T>\n * is destroyed.\n *\n * N.B. GCC seems to miss some optimizations with Maybe and may generate extra\n * branches/loads/stores. Use with caution on hot paths.\n */\ntemplate<class T>\nclass Maybe\n{\n    AlignedStorage2<T> storage;\n    bool constructed;\n\n    T& asT() { return *storage.addr(); }\n\n  public:\n    Maybe() { constructed = false; }\n    ~Maybe() { if (constructed) asT().~T(); }\n\n    bool empty() const { return !constructed; }\n\n    void construct() {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T();\n      constructed = true;\n    }\n\n    template<class T1>\n    void construct(const T1& t1) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1);\n      constructed = true;\n    }\n\n    template<class T1, class T2>\n    void construct(const T1& t1, const T2& t2) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3>\n    void construct(const T1& t1, const T2& t2, const T3& t3) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9, class T10>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);\n      constructed = true;\n    }\n\n    T* addr() {\n      MOZ_ASSERT(constructed);\n      return &asT();\n    }\n\n    T& ref() {\n      MOZ_ASSERT(constructed);\n      return asT();\n    }\n\n    const T& ref() const {\n      MOZ_ASSERT(constructed);\n      return const_cast<Maybe*>(this)->asT();\n    }\n\n    void destroy() {\n      ref().~T();\n      constructed = false;\n    }\n\n    void destroyIfConstructed() {\n      if (!empty())\n        destroy();\n    }\n\n  private:\n    Maybe(const Maybe& other) MOZ_DELETE;\n    const Maybe& operator=(const Maybe& other) MOZ_DELETE;\n};\n\n/*\n * Safely subtract two pointers when it is known that end >= begin.  This avoids\n * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB\n * set, the unsigned subtraction followed by right shift will produce -1, or\n * size_t(-1), instead of the real difference.\n */\ntemplate<class T>\nMOZ_ALWAYS_INLINE size_t\nPointerRangeSize(T* begin, T* end)\n{\n  MOZ_ASSERT(end >= begin);\n  return (size_t(end) - size_t(begin)) / sizeof(T);\n}\n\n/*\n * Compute the length of an array with constant length.  (Use of this method\n * with a non-array pointer will not compile.)\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR size_t\nArrayLength(T (&arr)[N])\n{\n  return N;\n}\n\n/*\n * Compute the address one past the last element of a constant-length array.\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR T*\nArrayEnd(T (&arr)[N])\n{\n  return arr + ArrayLength(arr);\n}\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n/*\n * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files\n * that can't use C++ template functions and for static_assert() calls that\n * can't call ArrayLength() when it is not a C++11 constexpr function.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_ARRAY_LENGTH(array)   mozilla::ArrayLength(array)\n#else\n#  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))\n#endif\n\n#endif /* mozilla_Util_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type/length-parametrized vector class. */\n\n#ifndef mozilla_Vector_h\n#define mozilla_Vector_h\n\n#include \"mozilla/AllocPolicy.h\"\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/MathAlgorithms.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include <new> // for placement new\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace mozilla {\n\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase;\n\nnamespace detail {\n\n/*\n * Check that the given capacity wastes the minimal amount of space if\n * allocated on the heap.  This means that cap*sizeof(T) is as close to a\n * power-of-two as possible.  growStorageBy() is responsible for ensuring\n * this.\n */\ntemplate<typename T>\nstatic bool CapacityHasExcessSpace(size_t cap)\n{\n  size_t size = cap * sizeof(T);\n  return RoundUpPow2(size) - size >= sizeof(T);\n}\n\n/*\n * This template class provides a default implementation for vector operations\n * when the element type is not known to be a POD, as judged by IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector, bool IsPod>\nstruct VectorImpl\n{\n    /* Destroys constructed objects in the range [begin, end). */\n    static inline void destroy(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        p->~T();\n    }\n\n    /* Constructs objects in the uninitialized range [begin, end). */\n    static inline void initialize(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(*p);\n    }\n\n    /*\n     * Move-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(Move(*p));\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range [dst, dst+n) from the\n     * same object u.\n     */\n    template<typename U>\n    static inline void copyConstructN(T* dst, size_t n, const U& u) {\n      for (T* end = dst + n; dst < end; ++dst)\n        new(dst) T(u);\n    }\n\n    /*\n     * Grows the given buffer to have capacity newCap, preserving the objects\n     * constructed in the range [begin, end) and updating v. Assumes that (1)\n     * newCap has not overflowed, and (2) multiplying newCap by sizeof(T) will\n     * not overflow.\n     */\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      T* newbuf = reinterpret_cast<T*>(v.malloc_(newCap * sizeof(T)));\n      if (!newbuf)\n        return false;\n      T* dst = newbuf;\n      T* src = v.beginNoCheck();\n      for (; src < v.endNoCheck(); ++dst, ++src)\n        new(dst) T(Move(*src));\n      VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck());\n      v.free_(v.mBegin);\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n/*\n * This partial template specialization provides a default implementation for\n * vector operations when the element type is known to be a POD, as judged by\n * IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector>\nstruct VectorImpl<T, N, AP, ThisVector, true>\n{\n    static inline void destroy(T*, T*) {}\n\n    static inline void initialize(T* begin, T* end) {\n      /*\n       * You would think that memset would be a big win (or even break even)\n       * when we know T is a POD. But currently it's not. This is probably\n       * because |append| tends to be given small ranges and memset requires\n       * a function call that doesn't get inlined.\n       *\n       * memset(begin, 0, sizeof(T) * (end-begin));\n       */\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      /*\n       * See above memset comment. Also, notice that copyConstruct is\n       * currently templated (T != U), so memcpy won't work without\n       * requiring T == U.\n       *\n       * memcpy(dst, srcbeg, sizeof(T) * (srcend - srcbeg));\n       */\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        *dst = *p;\n    }\n\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      copyConstruct(dst, srcbeg, srcend);\n    }\n\n    static inline void copyConstructN(T* dst, size_t n, const T& t) {\n      for (T* end = dst + n; dst < end; ++dst)\n        *dst = t;\n    }\n\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      size_t oldSize = sizeof(T) * v.mCapacity;\n      size_t newSize = sizeof(T) * newCap;\n      T* newbuf = reinterpret_cast<T*>(v.realloc_(v.mBegin, oldSize, newSize));\n      if (!newbuf)\n        return false;\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n} // namespace detail\n\n/*\n * A CRTP base class for vector-like classes.  Unless you really really want\n * your own vector class -- and you almost certainly don't -- you should use\n * mozilla::Vector instead!\n *\n * See mozilla::Vector for interface requirements.\n */\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase : private AllocPolicy\n{\n    /* utilities */\n\n    static const bool sElemIsPod = IsPod<T>::value;\n    typedef detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod> Impl;\n    friend struct detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod>;\n\n    bool growStorageBy(size_t incr);\n    bool convertToHeapStorage(size_t newCap);\n\n    /* magic constants */\n\n    static const int sMaxInlineBytes = 1024;\n\n    /* compute constants */\n\n    /*\n     * Consider element size to be 1 for buffer sizing if there are 0 inline\n     * elements.  This allows us to compile when the definition of the element\n     * type is not visible here.\n     *\n     * Explicit specialization is only allowed at namespace scope, so in order\n     * to keep everything here, we use a dummy template parameter with partial\n     * specialization.\n     */\n    template<int M, int Dummy>\n    struct ElemSize\n    {\n        static const size_t value = sizeof(T);\n    };\n    template<int Dummy>\n    struct ElemSize<0, Dummy>\n    {\n        static const size_t value = 1;\n    };\n\n    static const size_t sInlineCapacity =\n      tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::value>::value;\n\n    /* Calculate inline buffer size; avoid 0-sized array. */\n    static const size_t sInlineBytes =\n      tl::Max<1, sInlineCapacity * ElemSize<N, 0>::value>::value;\n\n    /* member data */\n\n    /*\n     * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,\n     * mBegin + mLength) hold valid constructed T objects. The range [mBegin +\n     * mLength, mBegin + mCapacity) holds uninitialized memory. The range\n     * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory\n     * previously allocated by a call to reserve().\n     */\n    T* mBegin;\n\n    /* Number of elements in the vector. */\n    size_t mLength;\n\n    /* Max number of elements storable in the vector without resizing. */\n    size_t mCapacity;\n\n#ifdef DEBUG\n    /* Max elements of reserved or used space in this vector. */\n    size_t mReserved;\n#endif\n\n    /* Memory used for inline storage. */\n    AlignedStorage<sInlineBytes> storage;\n\n#ifdef DEBUG\n    friend class ReentrancyGuard;\n    bool entered;\n#endif\n\n    /* private accessors */\n\n    bool usingInlineStorage() const {\n      return mBegin == const_cast<VectorBase*>(this)->inlineStorage();\n    }\n\n    T* inlineStorage() {\n      return static_cast<T*>(storage.addr());\n    }\n\n    T* beginNoCheck() const {\n      return mBegin;\n    }\n\n    T* endNoCheck() {\n      return mBegin + mLength;\n    }\n\n    const T* endNoCheck() const {\n      return mBegin + mLength;\n    }\n\n#ifdef DEBUG\n    size_t reserved() const {\n      MOZ_ASSERT(mReserved <= mCapacity);\n      MOZ_ASSERT(mLength <= mReserved);\n      return mReserved;\n    }\n#endif\n\n    /* Append operations guaranteed to succeed due to pre-reserved space. */\n    template<typename U> void internalAppend(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    void internalAppendAll(const VectorBase<U, O, BP, UV>& u);\n    void internalAppendN(const T& t, size_t n);\n    template<typename U> void internalAppend(const U* begin, size_t length);\n\n  public:\n    static const size_t sMaxInlineStorage = N;\n\n    typedef T ElementType;\n\n    VectorBase(AllocPolicy = AllocPolicy());\n    VectorBase(MoveRef<ThisVector>); /* Move constructor. */\n    ThisVector& operator=(MoveRef<ThisVector>); /* Move assignment. */\n    ~VectorBase();\n\n    /* accessors */\n\n    const AllocPolicy& allocPolicy() const {\n      return *this;\n    }\n\n    AllocPolicy& allocPolicy() {\n      return *this;\n    }\n\n    enum { InlineLength = N };\n\n    size_t length() const {\n      return mLength;\n    }\n\n    bool empty() const {\n      return mLength == 0;\n    }\n\n    size_t capacity() const {\n      return mCapacity;\n    }\n\n    T* begin() {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    const T* begin() const {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    T* end() {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    const T* end() const {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    T& operator[](size_t i) {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    T& back() {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    const T& back() const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    class Range\n    {\n        friend class VectorBase;\n        T* cur_;\n        T* end_;\n        Range(T* cur, T* end) : cur_(cur), end_(end) {}\n\n      public:\n        Range() {}\n        bool empty() const { return cur_ == end_; }\n        size_t remain() const { return end_ - cur_; }\n        T& front() const { return *cur_; }\n        void popFront() { MOZ_ASSERT(!empty()); ++cur_; }\n        T popCopyFront() { MOZ_ASSERT(!empty()); return *cur_++; }\n    };\n\n    Range all() {\n      return Range(begin(), end());\n    }\n\n    /* mutators */\n\n    /**\n     * Given that the vector is empty and has no inline storage, grow to\n     * |capacity|.\n     */\n    bool initCapacity(size_t request);\n\n    /**\n     * If reserve(length() + N) succeeds, the N next appends are guaranteed to\n     * succeed.\n     */\n    bool reserve(size_t request);\n\n    /**\n     * Destroy elements in the range [end() - incr, end()). Does not deallocate\n     * or unreserve storage for those elements.\n     */\n    void shrinkBy(size_t incr);\n\n    /** Grow the vector by incr elements. */\n    bool growBy(size_t incr);\n\n    /** Call shrinkBy or growBy based on whether newSize > length(). */\n    bool resize(size_t newLength);\n\n    /**\n     * Increase the length of the vector, but don't initialize the new elements\n     * -- leave them as uninitialized memory.\n     */\n    bool growByUninitialized(size_t incr);\n    bool resizeUninitialized(size_t newLength);\n\n    /** Shorthand for shrinkBy(length()). */\n    void clear();\n\n    /** Clears and releases any heap-allocated storage. */\n    void clearAndFree();\n\n    /**\n     * If true, appending |needed| elements won't reallocate elements storage.\n     * This *doesn't* mean that infallibleAppend may be used!  You still must\n     * reserve the extra space, even if this method indicates that appends won't\n     * need to reallocate elements storage.\n     */\n    bool canAppendWithoutRealloc(size_t needed) const;\n\n    /**\n     * Potentially fallible append operations.\n     *\n     * The function templates that take an unspecified type U require a const T&\n     * or a MoveRef<T>.  The MoveRef<T> variants move their operands into the\n     * vector, instead of copying them.  If they fail, the operand is left\n     * unmoved.\n     */\n    template<typename U> bool append(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    bool appendAll(const VectorBase<U, O, BP, UV>& u);\n    bool appendN(const T& t, size_t n);\n    template<typename U> bool append(const U* begin, const U* end);\n    template<typename U> bool append(const U* begin, size_t length);\n\n    /*\n     * Guaranteed-infallible append operations for use upon vectors whose\n     * memory has been pre-reserved.  Don't use this if you haven't reserved the\n     * memory!\n     */\n    template<typename U> void infallibleAppend(const U& u) {\n      internalAppend(u);\n    }\n    void infallibleAppendN(const T& t, size_t n) {\n      internalAppendN(t, n);\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) {\n      internalAppend(aBegin, PointerRangeSize(aBegin, aEnd));\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, size_t aLength) {\n      internalAppend(aBegin, aLength);\n    }\n\n    void popBack();\n\n    T popCopy();\n\n    /**\n     * Transfers ownership of the internal buffer used by this vector to the\n     * caller.  (It's the caller's responsibility to properly deallocate this\n     * buffer, in accordance with this vector's AllocPolicy.)  After this call,\n     * the vector is empty.  Since the returned buffer may need to be allocated\n     * (if the elements are currently stored in-place), the call can fail,\n     * returning nullptr.\n     *\n     * N.B. Although a T*, only the range [0, length()) is constructed.\n     */\n    T* extractRawBuffer();\n\n    /**\n     * Transfer ownership of an array of objects into the vector.  The caller\n     * must have allocated the array in accordance with this vector's\n     * AllocPolicy.\n     *\n     * N.B. This call assumes that there are no uninitialized elements in the\n     *      passed array.\n     */\n    void replaceRawBuffer(T* p, size_t length);\n\n    /**\n     * Places |val| at position |p|, shifting existing elements from |p| onward\n     * one position higher.  On success, |p| should not be reused because it'll\n     * be a dangling pointer if reallocation of the vector storage occurred; the\n     * return value should be used instead.  On failure, nullptr is returned.\n     *\n     * Example usage:\n     *\n     *   if (!(p = vec.insert(p, val)))\n     *     <handle failure>\n     *   <keep working with p>\n     *\n     * This is inherently a linear-time operation.  Be careful!\n     */\n    T* insert(T* p, const T& val);\n\n    /**\n     * Removes the element |t|, which must fall in the bounds [begin, end),\n     * shifting existing elements from |t + 1| onward one position lower.\n     */\n    void erase(T* t);\n\n    /**\n     * Measure the size of the vector's heap-allocated storage.\n     */\n    size_t sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const;\n\n    /**\n     * Like sizeOfExcludingThis, but also measures the size of the vector\n     * object (which must be heap-allocated) itself.\n     */\n    size_t sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const;\n\n    void swap(ThisVector& other);\n\n  private:\n    VectorBase(const ThisVector&) MOZ_DELETE;\n    void operator=(const ThisVector&) MOZ_DELETE;\n};\n\n/* This does the re-entrancy check plus several other sanity checks. */\n#define MOZ_REENTRANCY_GUARD_ET_AL \\\n  ReentrancyGuard g(*this); \\\n  MOZ_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); \\\n  MOZ_ASSERT(reserved() <= mCapacity); \\\n  MOZ_ASSERT(mLength <= reserved()); \\\n  MOZ_ASSERT(mLength <= mCapacity)\n\n/* Vector Implementation */\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::VectorBase(AP ap)\n  : AP(ap),\n    mBegin(static_cast<T*>(storage.addr())),\n    mLength(0),\n    mCapacity(sInlineCapacity)\n#ifdef DEBUG\n  , mReserved(sInlineCapacity),\n    entered(false)\n#endif\n{}\n\n/* Move constructor. */\ntemplate<typename T, size_t N, class AllocPolicy, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AllocPolicy, TV>::VectorBase(MoveRef<TV> rhs)\n  : AllocPolicy(rhs)\n#ifdef DEBUG\n    , entered(false)\n#endif\n{\n  mLength = rhs->mLength;\n  mCapacity = rhs->mCapacity;\n#ifdef DEBUG\n  mReserved = rhs->mReserved;\n#endif\n\n  if (rhs->usingInlineStorage()) {\n    /* We can't move the buffer over in this case, so copy elements. */\n    mBegin = static_cast<T*>(storage.addr());\n    Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck());\n    /*\n     * Leave rhs's mLength, mBegin, mCapacity, and mReserved as they are.\n     * The elements in its in-line storage still need to be destroyed.\n     */\n  } else {\n    /*\n     * Take src's buffer, and turn src into an empty vector using\n     * in-line storage.\n     */\n    mBegin = rhs->mBegin;\n    rhs->mBegin = static_cast<T*>(rhs->storage.addr());\n    rhs->mCapacity = sInlineCapacity;\n    rhs->mLength = 0;\n#ifdef DEBUG\n    rhs->mReserved = sInlineCapacity;\n#endif\n  }\n}\n\n/* Move assignment. */\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nTV&\nVectorBase<T, N, AP, TV>::operator=(MoveRef<TV> rhs)\n{\n  TV* tv = static_cast<TV*>(this);\n  tv->~TV();\n  new(tv) TV(rhs);\n  return *tv;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::~VectorBase()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n}\n\n/*\n * This function will create a new heap buffer with capacity newCap,\n * move all elements in the inline buffer to this new buffer,\n * and fail on OOM.\n */\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::convertToHeapStorage(size_t newCap)\n{\n  MOZ_ASSERT(usingInlineStorage());\n\n  /* Allocate buffer. */\n  MOZ_ASSERT(!detail::CapacityHasExcessSpace<T>(newCap));\n  T* newBuf = reinterpret_cast<T*>(this->malloc_(newCap * sizeof(T)));\n  if (!newBuf)\n    return false;\n\n  /* Copy inline elements into heap buffer. */\n  Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());\n  Impl::destroy(beginNoCheck(), endNoCheck());\n\n  /* Switch in heap buffer. */\n  mBegin = newBuf;\n  /* mLength is unchanged. */\n  mCapacity = newCap;\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_NEVER_INLINE bool\nVectorBase<T, N, AP, TV>::growStorageBy(size_t incr)\n{\n  MOZ_ASSERT(mLength + incr > mCapacity);\n  MOZ_ASSERT_IF(!usingInlineStorage(),\n                !detail::CapacityHasExcessSpace<T>(mCapacity));\n\n  /*\n   * When choosing a new capacity, its size should is as close to 2**N bytes\n   * as possible.  2**N-sized requests are best because they are unlikely to\n   * be rounded up by the allocator.  Asking for a 2**N number of elements\n   * isn't as good, because if sizeof(T) is not a power-of-two that would\n   * result in a non-2**N request size.\n   */\n\n  size_t newCap;\n\n  if (incr == 1) {\n    if (usingInlineStorage()) {\n      /* This case occurs in ~70--80% of the calls to this function. */\n      size_t newSize =\n        tl::RoundUpPow2<(sInlineCapacity + 1) * sizeof(T)>::value;\n      newCap = newSize / sizeof(T);\n      goto convert;\n    }\n\n    if (mLength == 0) {\n      /* This case occurs in ~0--10% of the calls to this function. */\n      newCap = 1;\n      goto grow;\n    }\n\n    /* This case occurs in ~15--20% of the calls to this function. */\n\n    /*\n     * Will mLength * 4 *sizeof(T) overflow?  This condition limits a vector\n     * to 1GB of memory on a 32-bit system, which is a reasonable limit.  It\n     * also ensures that\n     *\n     *   static_cast<char*>(end()) - static_cast<char*>(begin())\n     *\n     * doesn't overflow ptrdiff_t (see bug 510319).\n     */\n    if (mLength & tl::MulOverflowMask<4 * sizeof(T)>::value) {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    /*\n     * If we reach here, the existing capacity will have a size that is already\n     * as close to 2^N as sizeof(T) will allow.  Just double the capacity, and\n     * then there might be space for one more element.\n     */\n    newCap = mLength * 2;\n    if (detail::CapacityHasExcessSpace<T>(newCap))\n      newCap += 1;\n  } else {\n    /* This case occurs in ~2% of the calls to this function. */\n    size_t newMinCap = mLength + incr;\n\n    /* Did mLength + incr overflow?  Will newCap * sizeof(T) overflow? */\n    if (newMinCap < mLength ||\n        newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::value)\n    {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    size_t newMinSize = newMinCap * sizeof(T);\n    size_t newSize = RoundUpPow2(newMinSize);\n    newCap = newSize / sizeof(T);\n  }\n\n  if (usingInlineStorage()) {\n  convert:\n    return convertToHeapStorage(newCap);\n  }\n\ngrow:\n  return Impl::growTo(*this, newCap);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::initCapacity(size_t request)\n{\n  MOZ_ASSERT(empty());\n  MOZ_ASSERT(usingInlineStorage());\n  if (request == 0)\n    return true;\n  T* newbuf = reinterpret_cast<T*>(this->malloc_(request * sizeof(T)));\n  if (!newbuf)\n    return false;\n  mBegin = newbuf;\n  mCapacity = request;\n#ifdef DEBUG\n  mReserved = request;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::reserve(size_t request)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (request > mCapacity && !growStorageBy(request - mLength))\n    return false;\n\n#ifdef DEBUG\n  if (request > mReserved)\n    mReserved = request;\n  MOZ_ASSERT(mLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::shrinkBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(incr <= mLength);\n  Impl::destroy(endNoCheck() - incr, endNoCheck());\n  mLength -= incr;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  T* newend = endNoCheck() + incr;\n  Impl::initialize(endNoCheck(), newend);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growByUninitialized(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::resize(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growBy(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::resizeUninitialized(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growByUninitialized(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clear()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  mLength = 0;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clearAndFree()\n{\n  clear();\n\n  if (usingInlineStorage())\n    return;\n\n  this->free_(beginNoCheck());\n  mBegin = static_cast<T*>(storage.addr());\n  mCapacity = sInlineCapacity;\n#ifdef DEBUG\n  mReserved = sInlineCapacity;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::canAppendWithoutRealloc(size_t needed) const\n{\n  return mLength + needed <= mCapacity;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  internalAppend(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U& u)\n{\n  MOZ_ASSERT(mLength + 1 <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  new(endNoCheck()) T(u);\n  ++mLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendN(const T& t, size_t needed)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppendN(t, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendN(const T& t, size_t needed)\n{\n  MOZ_ASSERT(mLength + needed <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstructN(endNoCheck(), needed, t);\n  mLength += needed;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::insert(T* p, const T& val)\n{\n  MOZ_ASSERT(begin() <= p);\n  MOZ_ASSERT(p <= end());\n  size_t pos = p - begin();\n  MOZ_ASSERT(pos <= mLength);\n  size_t oldLength = mLength;\n  if (pos == oldLength) {\n    if (!append(val))\n      return nullptr;\n  } else {\n    T oldBack = back();\n    if (!append(oldBack)) /* Dup the last element. */\n      return nullptr;\n    for (size_t i = oldLength; i > pos; --i)\n      (*this)[i] = (*this)[i - 1];\n    (*this)[pos] = val;\n  }\n  return begin() + pos;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::erase(T* it)\n{\n  MOZ_ASSERT(begin() <= it);\n  MOZ_ASSERT(it < end());\n  while (it + 1 < end()) {\n    *it = *(it + 1);\n    ++it;\n  }\n  popBack();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U* insBegin, const U* insEnd)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  size_t needed = PointerRangeSize(insBegin, insEnd);\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppend(insBegin, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U* insBegin, size_t insLength)\n{\n  MOZ_ASSERT(mLength + insLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstruct(endNoCheck(), insBegin, insBegin + insLength);\n  mLength += insLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U& u)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength == mCapacity && !growStorageBy(1))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + 1 > mReserved)\n    mReserved = mLength + 1;\n#endif\n  internalAppend(u);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  return append(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<class U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U *insBegin, size_t insLength)\n{\n  return append(insBegin, insBegin + insLength);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::popBack()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(!empty());\n  --mLength;\n  endNoCheck()->~T();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE T\nVectorBase<T, N, AP, TV>::popCopy()\n{\n  T ret = back();\n  popBack();\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::extractRawBuffer()\n{\n  T* ret;\n  if (usingInlineStorage()) {\n    ret = reinterpret_cast<T*>(this->malloc_(mLength * sizeof(T)));\n    if (!ret)\n      return nullptr;\n    Impl::copyConstruct(ret, beginNoCheck(), endNoCheck());\n    Impl::destroy(beginNoCheck(), endNoCheck());\n    /* mBegin, mCapacity are unchanged. */\n    mLength = 0;\n  } else {\n    ret = mBegin;\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = 0;\n    mCapacity = sInlineCapacity;\n#ifdef DEBUG\n    mReserved = sInlineCapacity;\n#endif\n  }\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::replaceRawBuffer(T* p, size_t aLength)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n\n  /* Destroy what we have. */\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n\n  /* Take in the new buffer. */\n  if (aLength <= sInlineCapacity) {\n    /*\n     * We convert to inline storage if possible, even though p might\n     * otherwise be acceptable.  Maybe this behaviour should be\n     * specifiable with an argument to this function.\n     */\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = aLength;\n    mCapacity = sInlineCapacity;\n    Impl::moveConstruct(mBegin, p, p + aLength);\n    Impl::destroy(p, p + aLength);\n    this->free_(p);\n  } else {\n    mBegin = p;\n    mLength = aLength;\n    mCapacity = aLength;\n  }\n#ifdef DEBUG\n  mReserved = aLength;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::swap(TV& other)\n{\n  static_assert(N == 0,\n                \"still need to implement this for N != 0\");\n\n  // This only works when inline storage is always empty.\n  if (!usingInlineStorage() && other.usingInlineStorage()) {\n    other.mBegin = mBegin;\n    mBegin = inlineStorage();\n  } else if (usingInlineStorage() && !other.usingInlineStorage()) {\n    mBegin = other.mBegin;\n    other.mBegin = other.inlineStorage();\n  } else if (!usingInlineStorage() && !other.usingInlineStorage()) {\n    Swap(mBegin, other.mBegin);\n  } else {\n    // This case is a no-op, since we'd set both to use their inline storage.\n  }\n\n  Swap(mLength, other.mLength);\n  Swap(mCapacity, other.mCapacity);\n#ifdef DEBUG\n  Swap(mReserved, other.mReserved);\n#endif\n}\n\n/*\n * STL-like container providing a short-lived, dynamic buffer.  Vector calls the\n * constructors/destructors of all elements stored in its internal buffer, so\n * non-PODs may be safely used.  Additionally, Vector will store the first N\n * elements in-place before resorting to dynamic allocation.\n *\n * T requirements:\n *  - default and copy constructible, assignable, destructible\n *  - operations do not throw\n * N requirements:\n *  - any value, however, N is clamped to min/max values\n * AllocPolicy:\n *  - see \"Allocation policies\" in AllocPolicy.h (defaults to\n *    mozilla::MallocAllocPolicy)\n *\n * Vector is not reentrant: T member functions called during Vector member\n * functions must not call back into the same object!\n */\ntemplate<typename T,\n         size_t MinInlineCapacity = 0,\n         class AllocPolicy = MallocAllocPolicy>\nclass Vector\n  : public VectorBase<T,\n                      MinInlineCapacity,\n                      AllocPolicy,\n                      Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector& operator=(mozilla::MoveRef<Vector> vec) {\n      return Base::operator=(vec);\n    }\n};\n\n} // namespace mozilla\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif /* mozilla_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/mac/mozilla/WeakPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Weak pointer functionality, implemented as a mixin for use with any class. */\n\n/**\n * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting\n * its lifetime. It works by creating a single shared reference counted object\n * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo'\n * clear the pointer in the WeakReference without having to know about all of\n * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime\n * of 'Foo'.\n *\n * AtomicSupportsWeakPtr can be used for a variant with an atomically updated\n * reference counter.\n *\n * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional\n * dereference, and an additional heap allocated pointer sized object shared\n * between all of the WeakPtrs.\n *\n * Example of usage:\n *\n *   // To have a class C support weak pointers, inherit from SupportsWeakPtr<C>.\n *   class C : public SupportsWeakPtr<C>\n *   {\n *    public:\n *      int num;\n *      void act();\n *   };\n *\n *   C* ptr =  new C();\n *\n *   // Get weak pointers to ptr. The first time asWeakPtr is called\n *   // a reference counted WeakReference object is created that\n *   // can live beyond the lifetime of 'ptr'. The WeakReference\n *   // object will be notified of 'ptr's destruction.\n *   WeakPtr<C> weak = ptr->asWeakPtr();\n *   WeakPtr<C> other = ptr->asWeakPtr();\n *\n *   // Test a weak pointer for validity before using it.\n *   if (weak) {\n *     weak->num = 17;\n *     weak->act();\n *   }\n *\n *   // Destroying the underlying object clears weak pointers to it.\n *   delete ptr;\n *\n *   MOZ_ASSERT(!weak, \"Deleting |ptr| clears weak pointers to it.\");\n *   MOZ_ASSERT(!other, \"Deleting |ptr| clears all weak pointers to it.\");\n *\n * WeakPtr is typesafe and may be used with any class. It is not required that\n * the class be reference-counted or allocated in any particular way.\n *\n * The API was loosely inspired by Chromium's weak_ptr.h:\n * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h\n */\n\n#ifndef mozilla_WeakPtr_h\n#define mozilla_WeakPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RefPtr.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate <typename T, class WeakReference> class WeakPtrBase;\ntemplate <typename T, class WeakReference> class SupportsWeakPtrBase;\n\nnamespace detail {\n\n// This can live beyond the lifetime of the class derived from SupportsWeakPtrBase.\ntemplate<class T, RefCountAtomicity Atomicity>\nclass WeakReference : public RefCounted<WeakReference<T, Atomicity>, Atomicity>\n{\n  public:\n    explicit WeakReference(T* p) : ptr(p) {}\n    T* get() const {\n      return ptr;\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n    void detach() {\n      ptr = nullptr;\n    }\n    T* ptr;\n};\n\n} // namespace detail\n\ntemplate <typename T, class WeakReference>\nclass SupportsWeakPtrBase\n{\n  public:\n    WeakPtrBase<T, WeakReference> asWeakPtr() {\n      if (!weakRef)\n        weakRef = new WeakReference(static_cast<T*>(this));\n      return WeakPtrBase<T, WeakReference>(weakRef);\n    }\n\n  protected:\n    ~SupportsWeakPtrBase() {\n      static_assert(IsBaseOf<SupportsWeakPtrBase<T, WeakReference>, T>::value,\n                    \"T must derive from SupportsWeakPtrBase<T, WeakReference>\");\n      if (weakRef)\n        weakRef->detach();\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n\n    RefPtr<WeakReference> weakRef;\n};\n\ntemplate <typename T>\nclass SupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::NonAtomicRefCount> >\n{\n};\n\ntemplate <typename T>\nclass AtomicSupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::AtomicRefCount> >\n{\n};\n\nnamespace detail {\n\ntemplate <typename T>\nstruct WeakReferenceCount\n{\n  static const RefCountAtomicity atomicity =\n    IsBaseOf<AtomicSupportsWeakPtr<T>, T>::value\n    ? AtomicRefCount\n    : NonAtomicRefCount;\n};\n\n}\n\ntemplate <typename T, class WeakReference>\nclass WeakPtrBase\n{\n  public:\n    WeakPtrBase(const WeakPtrBase<T, WeakReference>& o) : ref(o.ref) {}\n    // Ensure that ref is dereferenceable in the uninitialized state\n    WeakPtrBase() : ref(new WeakReference(nullptr)) {}\n\n    operator T*() const {\n      return ref->get();\n    }\n    T& operator*() const {\n      return *ref->get();\n    }\n\n    T* operator->() const {\n      return ref->get();\n    }\n\n    T* get() const {\n      return ref->get();\n    }\n\n  private:\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n\n    explicit WeakPtrBase(const RefPtr<WeakReference> &o) : ref(o) {}\n\n    RefPtr<WeakReference> ref;\n};\n\ntemplate <typename T>\nclass WeakPtr : public WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> >\n{\n    typedef WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> > Base;\n  public:\n    WeakPtr(const WeakPtr<T>& o) : Base(o) {}\n    WeakPtr(const Base& o) : Base(o) {}\n    WeakPtr() {}\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_WeakPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/Anchor.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Anchor implementation. */\n\n#ifndef js_Anchor_h\n#define js_Anchor_h\n\n#include \"mozilla/Attributes.h\"\n\nclass JSFunction;\nclass JSObject;\nclass JSScript;\nclass JSString;\n\nnamespace JS { class Value; }\n\nnamespace JS {\n\n/*\n * Protecting non-Value, non-JSObject *, non-JSString * values from collection\n *\n * Most of the time, the garbage collector's conservative stack scanner works\n * behind the scenes, finding all live values and protecting them from being\n * collected. However, when JSAPI client code obtains a pointer to data the\n * scanner does not know about, owned by an object the scanner does know about,\n * Care Must Be Taken.\n *\n * The scanner recognizes only a select set of types: pointers to JSObjects and\n * similar things (JSFunctions, and so on), pointers to JSStrings, and Values.\n * So while the scanner finds all live |JSString| pointers, it does not notice\n * |jschar| pointers.\n *\n * So suppose we have:\n *\n *   void f(JSString *str) {\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * After the call to |JS_GetStringCharsZ|, there are no further uses of\n * |str|, which means that the compiler is within its rights to not store\n * it anywhere. But because the stack scanner will not notice |ch|, there\n * is no longer any live value in this frame that would keep the string\n * alive. If |str| is the last reference to that |JSString|, and the\n * collector runs while we are using |ch|, the string's array of |jschar|s\n * may be freed out from under us.\n *\n * Note that there is only an issue when 1) we extract a thing X the scanner\n * doesn't recognize from 2) a thing Y the scanner does recognize, and 3) if Y\n * gets garbage-collected, then X gets freed. If we have code like this:\n *\n *   void g(JSObject *obj) {\n *     JS::Value x;\n *     JS_GetProperty(obj, \"x\", &x);\n *     ... do stuff with x ...\n *   }\n *\n * there's no problem, because the value we've extracted, x, is a Value, a\n * type that the conservative scanner recognizes.\n *\n * Conservative GC frees us from the obligation to explicitly root the types it\n * knows about, but when we work with derived values like |ch|, we must root\n * their owners, as the derived value alone won't keep them alive.\n *\n * A JS::Anchor is a kind of GC root that allows us to keep the owners of\n * derived values like |ch| alive throughout the Anchor's lifetime. We could\n * fix the above code as follows:\n *\n *   void f(JSString *str) {\n *     JS::Anchor<JSString *> a_str(str);\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * This simply ensures that |str| will be live until |a_str| goes out of scope.\n * As long as we don't retain a pointer to the string's characters for longer\n * than that, we have avoided all garbage collection hazards.\n */\ntemplate<typename T> class AnchorPermitted;\ntemplate<> class AnchorPermitted<JSObject *> { };\ntemplate<> class AnchorPermitted<const JSObject *> { };\ntemplate<> class AnchorPermitted<JSFunction *> { };\ntemplate<> class AnchorPermitted<const JSFunction *> { };\ntemplate<> class AnchorPermitted<JSString *> { };\ntemplate<> class AnchorPermitted<const JSString *> { };\ntemplate<> class AnchorPermitted<Value> { };\ntemplate<> class AnchorPermitted<const JSScript *> { };\ntemplate<> class AnchorPermitted<JSScript *> { };\n\ntemplate<typename T>\nclass Anchor : AnchorPermitted<T>\n{\n  public:\n    Anchor() { }\n    explicit Anchor(T t) { hold = t; }\n    inline ~Anchor();\n    T &get() { return hold; }\n    const T &get() const { return hold; }\n    void set(const T &t) { hold = t; }\n    void operator=(const T &t) { hold = t; }\n    void clear() { hold = 0; }\n\n  private:\n    T hold;\n    Anchor(const Anchor &other) MOZ_DELETE;\n    void operator=(const Anchor &other) MOZ_DELETE;\n};\n\ntemplate<typename T>\ninline Anchor<T>::~Anchor()\n{\n#ifdef __GNUC__\n    /*\n     * No code is generated for this. But because this is marked 'volatile', G++ will\n     * assume it has important side-effects, and won't delete it. (G++ never looks at\n     * the actual text and notices it's empty.) And because we have passed |hold| to\n     * it, GCC will keep |hold| alive until this point.\n     *\n     * The \"memory\" clobber operand ensures that G++ will not move prior memory\n     * accesses after the asm --- it's a barrier. Unfortunately, it also means that\n     * G++ will assume that all memory has changed after the asm, as it would for a\n     * call to an unknown function. I don't know of a way to avoid that consequence.\n     */\n    asm volatile(\"\":: \"g\" (hold) : \"memory\");\n#else\n    /*\n     * An adequate portable substitute, for non-structure types.\n     *\n     * The compiler promises that, by the end of an expression statement, the\n     * last-stored value to a volatile object is the same as it would be in an\n     * unoptimized, direct implementation (the \"abstract machine\" whose behavior the\n     * language spec describes). However, the compiler is still free to reorder\n     * non-volatile accesses across this store --- which is what we must prevent. So\n     * assigning the held value to a volatile variable, as we do here, is not enough.\n     *\n     * In our case, however, garbage collection only occurs at function calls, so it\n     * is sufficient to ensure that the destructor's store isn't moved earlier across\n     * any function calls that could collect. It is hard to imagine the compiler\n     * analyzing the program so thoroughly that it could prove that such motion was\n     * safe. In practice, compilers treat calls to the collector as opaque operations\n     * --- in particular, as operations which could access volatile variables, across\n     * which this destructor must not be moved.\n     *\n     * (\"Objection, your honor!  *Alleged* killer whale!\")\n     *\n     * The disadvantage of this approach is that it does generate code for the store.\n     * We do need to use Anchors in some cases where cycles are tight.\n     *\n     * Note that there is a Anchor<Value>::~Anchor() specialization in Value.h.\n     */\n    volatile T sink;\n    sink = hold;\n#endif  /* defined(__GNUC__) */\n}\n\n} // namespace JS\n\n#endif /* js_Anchor_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/CallArgs.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Helper classes encapsulating access to the callee, |this| value, arguments,\n * and argument count for a function call.\n *\n * The intent of JS::CallArgs and JS::CallReceiver is that they be used to\n * encapsulate access to the un-abstracted |unsigned argc, Value *vp| arguments\n * to a function.  It's possible (albeit deprecated) to manually index into\n * |vp| to access the callee, |this|, and arguments of a function, and to set\n * its return value.  It's also possible to use the supported API of JS_CALLEE,\n * JS_THIS, JS_ARGV, JS_RVAL and JS_SET_RVAL to the same ends.  But neither API\n * has the error-handling or moving-GC correctness of CallArgs or CallReceiver.\n * New code should use CallArgs and CallReceiver instead whenever possible.\n *\n * The eventual plan is to change JSNative to take |const CallArgs&| directly,\n * for automatic assertion of correct use and to make calling functions more\n * efficient.  Embedders should start internally switching away from using\n * |argc| and |vp| directly, except to create a |CallArgs|.  Then, when an\n * eventual release making that change occurs, porting efforts will require\n * changing methods' signatures but won't require invasive changes to the\n * methods' implementations, potentially under time pressure.\n */\n\n#ifndef js_CallArgs_h\n#define js_CallArgs_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"jstypes.h\"\n\n#include \"js/RootingAPI.h\"\n#include \"js/Value.h\"\n\nstruct JSContext;\nclass JSObject;\n\n/* Typedef for native functions called by the JS VM. */\ntypedef JSBool\n(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);\n\n/* Typedef for native functions that may be called in parallel. */\ntypedef js::ParallelResult\n(* JSParallelNative)(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Typedef for native functions that may be called either in parallel or\n * sequential execution.\n */\ntypedef JSBool\n(* JSThreadSafeNative)(js::ThreadSafeContext *cx, unsigned argc, JS::Value *vp);\n\n/*\n * Convenience wrappers for passing in ThreadSafeNative to places that expect\n * a JSNative or a JSParallelNative.\n */\ntemplate <JSThreadSafeNative threadSafeNative>\ninline JSBool\nJSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp);\n\ntemplate <JSThreadSafeNative threadSafeNative>\ninline js::ParallelResult\nJSParallelNativeThreadSafeWrapper(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Compute |this| for the |vp| inside a JSNative, either boxing primitives or\n * replacing with the global object as necessary.\n *\n * This method will go away at some point: instead use |args.thisv()|.  If the\n * value is an object, no further work is required.  If that value is |null| or\n * |undefined|, use |JS_GetGlobalForObject| to compute the global object.  If\n * the value is some other primitive, use |JS_ValueToObject| to box it.\n */\nextern JS_PUBLIC_API(JS::Value)\nJS_ComputeThis(JSContext *cx, JS::Value *vp);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\n/*\n * JS::CallReceiver encapsulates access to the callee, |this|, and eventual\n * return value for a function call.  The principal way to create a\n * CallReceiver is using JS::CallReceiverFromVp:\n *\n *   static JSBool\n *   FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallReceiver rec = JS::CallReceiverFromVp(vp);\n *\n *       // Access to the callee must occur before accessing/setting\n *       // the return value.\n *       JSObject &callee = rec.callee();\n *       rec.rval().set(JS::ObjectValue(callee));\n *\n *       // callee() and calleev() will now assert.\n *\n *       // It's always fine to access thisv().\n *       HandleValue thisv = rec.thisv();\n *       rec.rval().set(thisv);\n *\n *       // As the return value was last set to |this|, returns |this|.\n *       return true;\n *   }\n *\n * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't\n * part of the CallReceiver interface.  We will likely add them at some point.\n * Until then, you should probably continue using |vp| directly for these two\n * cases.\n *\n * CallReceiver is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\n\nnamespace detail {\n\n#ifdef DEBUG\nextern JS_PUBLIC_API(void)\nCheckIsValidConstructible(Value v);\n#endif\n\nenum UsedRval { IncludeUsedRval, NoUsedRval };\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS UsedRvalBase;\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<IncludeUsedRval>\n{\n  protected:\n    mutable bool usedRval_;\n    void setUsedRval() const { usedRval_ = true; }\n    void clearUsedRval() const { usedRval_ = false; }\n};\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>\n{\n  protected:\n    void setUsedRval() const {}\n    void clearUsedRval() const {}\n};\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<\n#ifdef DEBUG\n        WantUsedRval\n#else\n        NoUsedRval\n#endif\n    >\n{\n  protected:\n    Value *argv_;\n\n  public:\n    /*\n     * Returns the function being called, as an object.  Must not be called\n     * after rval() has been used!\n     */\n    JSObject &callee() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return argv_[-2].toObject();\n    }\n\n    /*\n     * Returns the function being called, as a value.  Must not be called after\n     * rval() has been used!\n     */\n    HandleValue calleev() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return HandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n    /*\n     * Returns the |this| value passed to the function.  This method must not\n     * be called when the function is being called as a constructor via |new|.\n     * The value may or may not be an object: it is the individual function's\n     * responsibility to box the value if needed.\n     */\n    HandleValue thisv() const {\n        // Some internal code uses thisv() in constructing cases, so don't do\n        // this yet.\n        // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING));\n        return HandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n\n    Value computeThis(JSContext *cx) const {\n        if (thisv().isObject())\n            return thisv();\n\n        return JS_ComputeThis(cx, base());\n    }\n\n    bool isConstructing() const {\n#ifdef DEBUG\n        if (this->usedRval_)\n            CheckIsValidConstructible(calleev());\n#endif\n        return argv_[-1].isMagic();\n    }\n\n    /*\n     * Returns the currently-set return value.  The initial contents of this\n     * value are unspecified.  Once this method has been called, callee() and\n     * calleev() can no longer be used.  (If you're compiling against a debug\n     * build of SpiderMonkey, these methods will assert to aid debugging.)\n     *\n     * If the method you're implementing succeeds by returning true, you *must*\n     * set this.  (SpiderMonkey doesn't currently assert this, but it will do\n     * so eventually.)  You don't need to use or change this if your method\n     * fails.\n     */\n    MutableHandleValue rval() const {\n        this->setUsedRval();\n        return MutableHandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n  public:\n    // These methods are only intended for internal use.  Embedders shouldn't\n    // use them!\n\n    Value *base() const { return argv_ - 2; }\n\n    Value *spAfterCall() const {\n        this->setUsedRval();\n        return argv_ - 1;\n    }\n\n  public:\n    // These methods are publicly exposed, but they are *not* to be used when\n    // implementing a JSNative method and encapsulating access to |vp| within\n    // it.  You probably don't want to use these!\n\n    void setCallee(Value aCalleev) const {\n        this->clearUsedRval();\n        argv_[-2] = aCalleev;\n    }\n\n    void setThis(Value aThisv) const {\n        argv_[-1] = aThisv;\n    }\n\n    MutableHandleValue mutableThisv() const {\n        return MutableHandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallReceiver : public detail::CallReceiverBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallReceiver CallReceiverFromVp(Value *vp);\n    friend CallReceiver CallReceiverFromArgv(Value *argv);\n};\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromArgv(Value *argv)\n{\n    CallReceiver receiver;\n    receiver.clearUsedRval();\n    receiver.argv_ = argv;\n    return receiver;\n}\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromVp(Value *vp)\n{\n    return CallReceiverFromArgv(vp + 2);\n}\n\n/*\n * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to\n * the function call's arguments.  The principal way to create a CallArgs is\n * like so, using JS::CallArgsFromVp:\n *\n *   static JSBool\n *   FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *\n *       // Guard against no arguments or a non-numeric arg0.\n *       if (args.length() == 0 || !args[0].isNumber()) {\n *           args.rval().setInt32(0);\n *           return true;\n *       }\n *\n *       args.rval().set(JS::NumberValue(args.length() * args[0].toNumber()));\n *       return true;\n *   }\n *\n * CallArgs is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\nnamespace detail {\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallArgsBase :\n        public mozilla::Conditional<WantUsedRval == detail::IncludeUsedRval,\n                                    CallReceiver,\n                                    CallReceiverBase<NoUsedRval> >::Type\n{\n  protected:\n    unsigned argc_;\n\n  public:\n    /* Returns the number of arguments. */\n    unsigned length() const { return argc_; }\n\n    /* Returns the i-th zero-indexed argument. */\n    MutableHandleValue operator[](unsigned i) const {\n        MOZ_ASSERT(i < argc_);\n        return MutableHandleValue::fromMarkedLocation(&this->argv_[i]);\n    }\n\n    /*\n     * Returns the i-th zero-indexed argument, or |undefined| if there's no\n     * such argument.\n     */\n    HandleValue get(unsigned i) const {\n        return i < length()\n               ? HandleValue::fromMarkedLocation(&this->argv_[i])\n               : UndefinedHandleValue;\n    }\n\n    /*\n     * Returns true if the i-th zero-indexed argument is present and is not\n     * |undefined|.\n     */\n    bool hasDefined(unsigned i) const {\n        return i < argc_ && !this->argv_[i].isUndefined();\n    }\n\n  public:\n    // These methods are publicly exposed, but we're less sure of the interface\n    // here than we'd like (because they're hackish and drop assertions).  Try\n    // to avoid using these if you can.\n\n    Value *array() const { return this->argv_; }\n    Value *end() const { return this->argv_ + argc_; }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);\n    friend CallArgs CallArgsFromSp(unsigned argc, Value *sp);\n\n    static CallArgs create(unsigned argc, Value *argv) {\n        CallArgs args;\n        args.clearUsedRval();\n        args.argv_ = argv;\n        args.argc_ = argc;\n        return args;\n    }\n\n};\n\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromVp(unsigned argc, Value *vp)\n{\n    return CallArgs::create(argc, vp + 2);\n}\n\n// This method is only intended for internal use in SpiderMonkey.  We may\n// eventually move it to an internal header.  Embedders should use\n// JS::CallArgsFromVp!\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromSp(unsigned argc, Value *sp)\n{\n    return CallArgs::create(argc, sp - argc);\n}\n\n} // namespace JS\n\n/*\n * Macros to hide interpreter stack layout details from a JSNative using its\n * JS::Value *vp parameter.  DO NOT USE THESE!  Instead use JS::CallArgs and\n * friends, above.  These macros will be removed when we change JSNative to\n * take a const JS::CallArgs&.\n */\n\n#define JS_CALLEE(cx,vp)        ((vp)[0])\n#define JS_THIS_OBJECT(cx,vp)   (JSVAL_TO_OBJECT(JS_THIS(cx,vp)))\n#define JS_ARGV(cx,vp)          ((vp) + 2)\n#define JS_RVAL(cx,vp)          (*(vp))\n#define JS_SET_RVAL(cx,vp,v)    (*(vp) = (v))\n\n/*\n * Note: if this method returns null, an error has occurred and must be\n * propagated or caught.\n */\nMOZ_ALWAYS_INLINE JS::Value\nJS_THIS(JSContext *cx, JS::Value *vp)\n{\n    return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1];\n}\n\n/*\n * |this| is passed to functions in ES5 without change.  Functions themselves\n * do any post-processing they desire to box |this|, compute the global object,\n * &c.  This macro retrieves a function's unboxed |this| value.\n *\n * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT,\n * or vice versa.  Either use the provided this value with this macro, or\n * compute the boxed |this| value using those.  JS_THIS_VALUE must not be used\n * if the function is being called as a constructor.\n *\n * But: DO NOT USE THIS!  Instead use JS::CallArgs::thisv(), above.\n *\n */\n#define JS_THIS_VALUE(cx,vp)    ((vp)[1])\n\n#endif /* js_CallArgs_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/CharacterEncoding.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_CharacterEncoding_h\n#define js_CharacterEncoding_h\n\n#include \"mozilla/Range.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\nnamespace JS {\n\n/*\n * By default, all C/C++ 1-byte-per-character strings passed into the JSAPI\n * are treated as ISO/IEC 8859-1, also known as Latin-1. That is, each\n * byte is treated as a 2-byte character, and there is no way to pass in a\n * string containing characters beyond U+00FF.\n */\nclass Latin1Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    Latin1Chars() : Base() {}\n    Latin1Chars(char *aBytes, size_t aLength) : Base(reinterpret_cast<unsigned char *>(aBytes), aLength) {}\n    Latin1Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * A Latin1Chars, but with \\0 termination for C compatibility.\n */\nclass Latin1CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    Latin1CharsZ() : Base(NULL, 0) {}\n\n    Latin1CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    Latin1CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\nclass UTF8Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    UTF8Chars() : Base() {}\n    UTF8Chars(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {}\n    UTF8Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * SpiderMonkey also deals directly with UTF-8 encoded text in some places.\n */\nclass UTF8CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    UTF8CharsZ() : Base(NULL, 0) {}\n\n    UTF8CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    UTF8CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\n/*\n * SpiderMonkey uses a 2-byte character representation: it is a\n * 2-byte-at-a-time view of a UTF-16 byte stream. This is similar to UCS-2,\n * but unlike UCS-2, we do not strip UTF-16 extension bytes. This allows a\n * sufficiently dedicated JavaScript program to be fully unicode-aware by\n * manually interpreting UTF-16 extension characters embedded in the JS\n * string.\n */\nclass TwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    TwoByteChars() : Base() {}\n    TwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    TwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A non-convertible variant of TwoByteChars that does not refer to characters\n * inlined inside a JSShortString or a JSInlineString. StableTwoByteChars are\n * thus safe to hold across a GC.\n */\nclass StableTwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    StableTwoByteChars() : Base() {}\n    StableTwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    StableTwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A TwoByteChars, but \\0 terminated for compatibility with JSFlatString.\n */\nclass TwoByteCharsZ : public mozilla::RangedPtr<jschar>\n{\n    typedef mozilla::RangedPtr<jschar> Base;\n\n  public:\n    TwoByteCharsZ() : Base(NULL, 0) {}\n\n    TwoByteCharsZ(jschar *chars, size_t length)\n      : Base(chars, length)\n    {\n        JS_ASSERT(chars[length] == '\\0');\n    }\n};\n\n/*\n * Convert a 2-byte character sequence to \"ISO-Latin-1\". This works by\n * truncating each 2-byte pair in the sequence to a 1-byte pair. If the source\n * contains any UTF-16 extension characters, then this may give invalid Latin1\n * output. The returned string is zero terminated. The returned string or the\n * returned string's |start()| must be freed with JS_free or js_free,\n * respectively. If allocation fails, an OOM error will be set and the method\n * will return a NULL chars (which can be tested for with the ! operator).\n * This method cannot trigger GC.\n */\nextern Latin1CharsZ\nLossyTwoByteCharsToNewLatin1CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nextern UTF8CharsZ\nTwoByteCharsToNewUTF8CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nuint32_t\nUtf8ToOneUcs4Char(const uint8_t *utf8Buffer, int utf8Length);\n\n/*\n * Inflate bytes in UTF-8 encoding to jschars.\n * - On error, returns an empty TwoByteCharsZ.\n * - On success, returns a malloc'd TwoByteCharsZ, and updates |outlen| to hold\n *   its length;  the length value excludes the trailing null.\n */\nextern TwoByteCharsZ\nUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n/*\n * The same as UTF8CharsToNewTwoByteCharsZ(), except that any malformed UTF-8 characters\n * will be replaced by \\uFFFD. No exception will be thrown for malformed UTF-8\n * input.\n */\nextern TwoByteCharsZ\nLossyUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n} // namespace JS\n\ninline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); }\ninline void JS_free(JS::UTF8CharsZ &ptr) { js_free((void*)ptr.get()); }\n\n#endif /* js_CharacterEncoding_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/Date.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Date_h\n#define js_Date_h\n\n#include \"jstypes.h\"\n\nnamespace JS {\n\n// Year is a year, month is 0-11, day is 1-based.  The return value is\n// a number of milliseconds since the epoch.  Can return NaN.\nJS_PUBLIC_API(double)\nMakeDate(double year, unsigned month, unsigned day);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// year.  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nYearFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// month (0-11).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nMonthFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// day (1-based).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nDayFromTime(double time);\n\n} // namespace JS\n\n#endif /* js_Date_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/GCAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_GCAPI_h\n#define js_GCAPI_h\n\n#include \"js/HeapAPI.h\"\n\nnamespace JS {\n\n#define GCREASONS(D)                            \\\n    /* Reasons internal to the JS engine */     \\\n    D(API)                                      \\\n    D(MAYBEGC)                                  \\\n    D(LAST_CONTEXT)                             \\\n    D(DESTROY_CONTEXT)                          \\\n    D(LAST_DITCH)                               \\\n    D(TOO_MUCH_MALLOC)                          \\\n    D(ALLOC_TRIGGER)                            \\\n    D(DEBUG_GC)                                 \\\n    D(DEBUG_MODE_GC)                            \\\n    D(TRANSPLANT)                               \\\n    D(RESET)                                    \\\n    D(OUT_OF_NURSERY)                           \\\n    D(EVICT_NURSERY)                            \\\n    D(FULL_STORE_BUFFER)                        \\\n                                                \\\n    /* These are reserved for future use. */    \\\n    D(RESERVED0)                                \\\n    D(RESERVED1)                                \\\n    D(RESERVED2)                                \\\n    D(RESERVED3)                                \\\n    D(RESERVED4)                                \\\n    D(RESERVED5)                                \\\n    D(RESERVED6)                                \\\n    D(RESERVED7)                                \\\n    D(RESERVED8)                                \\\n    D(RESERVED9)                                \\\n    D(RESERVED10)                               \\\n    D(RESERVED11)                               \\\n    D(RESERVED12)                               \\\n    D(RESERVED13)                               \\\n    D(RESERVED14)                               \\\n    D(RESERVED15)                               \\\n    D(RESERVED16)                               \\\n    D(RESERVED17)                               \\\n    D(RESERVED18)                               \\\n    D(RESERVED19)                               \\\n                                                \\\n    /* Reasons from Firefox */                  \\\n    D(DOM_WINDOW_UTILS)                         \\\n    D(COMPONENT_UTILS)                          \\\n    D(MEM_PRESSURE)                             \\\n    D(CC_WAITING)                               \\\n    D(CC_FORCED)                                \\\n    D(LOAD_END)                                 \\\n    D(POST_COMPARTMENT)                         \\\n    D(PAGE_HIDE)                                \\\n    D(NSJSCONTEXT_DESTROY)                      \\\n    D(SET_NEW_DOCUMENT)                         \\\n    D(SET_DOC_SHELL)                            \\\n    D(DOM_UTILS)                                \\\n    D(DOM_IPC)                                  \\\n    D(DOM_WORKER)                               \\\n    D(INTER_SLICE_GC)                           \\\n    D(REFRESH_FRAME)                            \\\n    D(FULL_GC_TIMER)                            \\\n    D(SHUTDOWN_CC)                              \\\n    D(FINISH_LARGE_EVALUTE)\n\nnamespace gcreason {\n\n/* GCReasons will end up looking like JSGC_MAYBEGC */\nenum Reason {\n#define MAKE_REASON(name) name,\n    GCREASONS(MAKE_REASON)\n#undef MAKE_REASON\n    NO_REASON,\n    NUM_REASONS,\n\n    /*\n     * For telemetry, we want to keep a fixed max bucket size over time so we\n     * don't have to switch histograms. 100 is conservative; as of this writing\n     * there are 26. But the cost of extra buckets seems to be low while the\n     * cost of switching histograms is high.\n     */\n    NUM_TELEMETRY_REASONS = 100\n};\n\n} /* namespace gcreason */\n\nextern JS_FRIEND_API(void)\nPrepareZoneForGC(Zone *zone);\n\nextern JS_FRIEND_API(void)\nPrepareForFullGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nPrepareForIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsGCScheduled(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nSkipZoneForGC(Zone *zone);\n\n/*\n * When triggering a GC using one of the functions below, it is first necessary\n * to select the compartments to be collected. To do this, you can call\n * PrepareZoneForGC on each compartment, or you can call PrepareForFullGC\n * to select all compartments. Failing to select any compartment is an error.\n */\n\nextern JS_FRIEND_API(void)\nGCForReason(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkingGC(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkGCBuffers(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nIncrementalGC(JSRuntime *rt, gcreason::Reason reason, int64_t millis = 0);\n\nextern JS_FRIEND_API(void)\nFinishIncrementalGC(JSRuntime *rt, gcreason::Reason reason);\n\nenum GCProgress {\n    /*\n     * During non-incremental GC, the GC is bracketed by JSGC_CYCLE_BEGIN/END\n     * callbacks. During an incremental GC, the sequence of callbacks is as\n     * follows:\n     *   JSGC_CYCLE_BEGIN, JSGC_SLICE_END  (first slice)\n     *   JSGC_SLICE_BEGIN, JSGC_SLICE_END  (second slice)\n     *   ...\n     *   JSGC_SLICE_BEGIN, JSGC_CYCLE_END  (last slice)\n     */\n\n    GC_CYCLE_BEGIN,\n    GC_SLICE_BEGIN,\n    GC_SLICE_END,\n    GC_CYCLE_END\n};\n\nstruct JS_FRIEND_API(GCDescription) {\n    bool isCompartment_;\n\n    GCDescription(bool isCompartment)\n      : isCompartment_(isCompartment) {}\n\n    jschar *formatMessage(JSRuntime *rt) const;\n    jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;\n};\n\ntypedef void\n(* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);\n\nextern JS_FRIEND_API(GCSliceCallback)\nSetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback);\n\n/*\n * Signals a good place to do an incremental slice, because the browser is\n * drawing a frame.\n */\nextern JS_FRIEND_API(void)\nNotifyDidPaint(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalGCEnabled(JSRuntime *rt);\n\nJS_FRIEND_API(bool)\nIsIncrementalGCInProgress(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nEnableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSContext *cx);\n\nextern JS_FRIEND_API(void)\nIncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind);\n\nextern JS_FRIEND_API(void)\nIncrementalValueBarrier(const Value &v);\n\nextern JS_FRIEND_API(void)\nIncrementalObjectBarrier(JSObject *obj);\n\nextern JS_FRIEND_API(void)\nPokeGC(JSRuntime *rt);\n\n/* Was the most recent GC run incrementally? */\nextern JS_FRIEND_API(bool)\nWasIncrementalGC(JSRuntime *rt);\n\nclass ObjectPtr\n{\n    Heap<JSObject *> value;\n\n  public:\n    ObjectPtr() : value(NULL) {}\n\n    ObjectPtr(JSObject *obj) : value(obj) {}\n\n    /* Always call finalize before the destructor. */\n    ~ObjectPtr() { JS_ASSERT(!value); }\n\n    void finalize(JSRuntime *rt) {\n        if (IsIncrementalBarrierNeeded(rt))\n            IncrementalObjectBarrier(value);\n        value = NULL;\n    }\n\n    void init(JSObject *obj) { value = obj; }\n\n    JSObject *get() const { return value; }\n\n    void writeBarrierPre(JSRuntime *rt) {\n        IncrementalObjectBarrier(value);\n    }\n\n    bool isAboutToBeFinalized() {\n        return JS_IsAboutToBeFinalized(&value);\n    }\n\n    ObjectPtr &operator=(JSObject *obj) {\n        IncrementalObjectBarrier(value);\n        value = obj;\n        return *this;\n    }\n\n    void trace(JSTracer *trc, const char *name) {\n        JS_CallHeapObjectTracer(trc, &value, name);\n    }\n\n    JSObject &operator*() const { return *value; }\n    JSObject *operator->() const { return value; }\n    operator JSObject *() const { return value; }\n};\n\n/*\n * Unsets the gray bit for anything reachable from |thing|. |kind| should not be\n * JSTRACE_SHAPE. |thing| should be non-null.\n */\nextern JS_FRIEND_API(void)\nUnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);\n\n/*\n * This should be called when an object that is marked gray is exposed to the JS\n * engine (by handing it to running JS code or writing it into live JS\n * data). During incremental GC, since the gray bits haven't been computed yet,\n * we conservatively mark the object black.\n */\nstatic JS_ALWAYS_INLINE void\nExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)\n{\n    JS_ASSERT(kind != JSTRACE_SHAPE);\n\n    shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);\n#ifdef JSGC_GENERATIONAL\n    /*\n     * GC things residing in the nursery cannot be gray: they have no mark bits.\n     * All live objects in the nursery are moved to tenured at the beginning of\n     * each GC slice, so the gray marker never sees nursery things.\n     */\n    if (uintptr_t(thing) >= rt->gcNurseryStart_ && uintptr_t(thing) < rt->gcNurseryEnd_)\n        return;\n#endif\n    if (IsIncrementalBarrierNeededOnGCThing(rt, thing, kind))\n        IncrementalReferenceBarrier(thing, kind);\n    else if (GCThingIsMarkedGray(thing))\n        UnmarkGrayGCThingRecursively(thing, kind);\n}\n\nstatic JS_ALWAYS_INLINE void\nExposeValueToActiveJS(const Value &v)\n{\n    if (v.isMarkable())\n        ExposeGCThingToActiveJS(v.toGCThing(), v.gcKind());\n}\n\n} /* namespace JS */\n\n#endif /* js_GCAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/HashTable.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HashTable_h\n#define js_HashTable_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/PodOperations.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js/Utility.h\"\n\nnamespace js {\n\nclass TempAllocPolicy;\ntemplate <class> struct DefaultHasher;\ntemplate <class, class> class HashMapEntry;\nnamespace detail {\n    template <class T> class HashTableEntry;\n    template <class T, class HashPolicy, class AllocPolicy> class HashTable;\n}\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based map from keys to\n// values. In particular, HashMap calls constructors and destructors of all\n// objects added so non-PODs may be used safely.\n//\n// Key/Value requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members\n//   called by HashMap must not call back into the same HashMap object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class Key,\n          class Value,\n          class HashPolicy = DefaultHasher<Key>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashMap\n{\n    typedef HashMapEntry<Key, Value> TableEntry;\n\n    struct MapHashPolicy : HashPolicy\n    {\n        typedef Key KeyType;\n        static const Key &getKey(TableEntry &e) { return e.key; }\n        static void setKey(TableEntry &e, Key &k) { const_cast<Key &>(e.key) = k; }\n    };\n\n    typedef detail::HashTable<TableEntry, MapHashPolicy, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef TableEntry Entry;\n\n    // HashMap construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashMap and check the return value.\n    HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   if (HM::Ptr p = h.lookup(3)) {\n    //     const HM::Entry &e = *p; // p acts like a pointer to Entry\n    //     assert(p->key == 3);     // Entry contains the key\n    //     char val = p->value;     // and value\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above (with T = Entry).\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Like lookup, but does not assert if two threads call lookup at the same\n    // time. Only use this method when none of the threads will modify the map.\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const { return impl.readonlyThreadsafeLookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of Key |k| (where |HashPolicy::match(k,l) == true|) using\n    // |add(p,k,v)|. After |add(p,k,v)|, |p| points to the new Entry. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   HM::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3, 'a'))\n    //       return false;\n    //   }\n    //   const HM::Entry &e = *p;   // p acts like a pointer to Entry\n    //   assert(p->key == 3);       // Entry contains the key\n    //   char val = p->value;       // and value\n    //\n    // Also see the definition of AddPtr in HashTable above (with T = Entry).\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HM::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 'a'))\n    //        return false;\n    //    }\n    //    const HM::Entry &e = *p;\n    //    assert(p->key == 3);\n    //    char val = p->value;\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return impl.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        Entry e(k, Value());\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.relookupOrAdd(p, k, mozilla::Move(e));\n    }\n\n    // |all()| returns a Range containing |count()| elements. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   for (HM::Range r = h.all(); !r.empty(); r.popFront())\n    //     char c = r.front().value;\n    //\n    // Also see the definition of Range in HashTable above (with T = Entry).\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM s;\n    //   for (HM::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front().value == 'l')\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above (with T = Entry).\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all entries without triggering destructors. This method is unsafe.\n    void clearWithoutCallingDestructors()             { impl.clearWithoutCallingDestructors(); }\n\n    // Remove all the entries and release all internal buffers. The map must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashMap.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashMap operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        AddPtr p = lookupForAdd(k);\n        if (p) {\n            p->value = v;\n            return true;\n        }\n        return add(p, k, v);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.putNew(k, mozilla::Move(e));\n    }\n\n    // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom.\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        AddPtr p = lookupForAdd(k);\n        if (p)\n            return p;\n        (void)add(p, k, defaultValue);  // p is left false-y on oom.\n        return p;\n    }\n\n    // Remove if present.\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const Key &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashMap is movable\n    HashMap(mozilla::MoveRef<HashMap> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashMap> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashMap is not copyable or assignable\n    HashMap(const HashMap &hm) MOZ_DELETE;\n    HashMap &operator=(const HashMap &hm) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based set of values. In\n// particular, HashSet calls constructors and destructors of all objects added\n// so non-PODs may be used safely.\n//\n// T requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashSet is not reentrant: T/HashPolicy/AllocPolicy members called by\n//   HashSet must not call back into the same HashSet object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class T,\n          class HashPolicy = DefaultHasher<T>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashSet\n{\n    struct SetOps : HashPolicy\n    {\n        typedef T KeyType;\n        static const KeyType &getKey(const T &t) { return t; }\n        static void setKey(T &t, KeyType &k) { t = k; }\n    };\n\n    typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef T Entry;\n\n    // HashSet construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashSet and check the return value.\n    HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   if (HS::Ptr p = h.lookup(3)) {\n    //     assert(*p == 3);   // p acts like a pointer to int\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above.\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of T value |t| (where |HashPolicy::match(t,l) == true|) using\n    // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   HS::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3))\n    //       return false;\n    //   }\n    //   assert(*p == 3);   // p acts like a pointer to int\n    //\n    // Also see the definition of AddPtr in HashTable above.\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HS::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 3))\n    //        return false;\n    //    }\n    //    assert(*p == 3);\n    //\n    // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the\n    // entry |t|, where the caller ensures match(l,t).\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const        { return impl.lookupForAdd(l); }\n\n    bool add(AddPtr &p, const T &t)                   { return impl.add(p, t); }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return impl.relookupOrAdd(p, l, t);\n    }\n\n    // |all()| returns a Range containing |count()| elements:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   for (HS::Range r = h.all(); !r.empty(); r.popFront())\n    //     int i = r.front();\n    //\n    // Also see the definition of Range in HashTable above.\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS s;\n    //   for (HS::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front() == 42)\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above.\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all the entries and release all internal buffers. The set must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashSet.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashSet operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    bool put(const T &t) {\n        AddPtr p = lookupForAdd(t);\n        return p ? true : add(p, t);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    bool putNew(const T &t) {\n        return impl.putNew(t, t);\n    }\n\n    bool putNew(const Lookup &l, const T &t) {\n        return impl.putNew(l, t);\n    }\n\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const T &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashSet is movable\n    HashSet(mozilla::MoveRef<HashSet> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashSet> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashSet is not copyable or assignable\n    HashSet(const HashSet &hs) MOZ_DELETE;\n    HashSet &operator=(const HashSet &hs) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// Hash Policy\n//\n// A hash policy P for a hash table with key-type Key must provide:\n//  - a type |P::Lookup| to use to lookup table entries;\n//  - a static member function |P::hash| with signature\n//\n//      static js::HashNumber hash(Lookup)\n//\n//    to use to hash the lookup type; and\n//  - a static member function |P::match| with signature\n//\n//      static bool match(Key, Lookup)\n//\n//    to use to test equality of key and lookup values.\n//\n// Normally, Lookup = Key. In general, though, different values and types of\n// values can be used to lookup and store. If a Lookup value |l| is != to the\n// added Key value |k|, the user must ensure that |P::match(k,l)|. E.g.:\n//\n//   js::HashSet<Key, P>::AddPtr p = h.lookup(l);\n//   if (!p) {\n//     assert(P::match(k, l));  // must hold\n//     h.add(p, k);\n//   }\n\n// Pointer hashing policy that strips the lowest zeroBits when calculating the\n// hash to improve key distribution.\ntemplate <typename Key, size_t zeroBits>\nstruct PointerHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        size_t word = reinterpret_cast<size_t>(l) >> zeroBits;\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n#if JS_BYTES_PER_WORD == 4\n        return HashNumber(word);\n#else\n        JS_STATIC_ASSERT(sizeof word == 8);\n        return HashNumber((word >> 32) ^ word);\n#endif\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(k));\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        return k == l;\n    }\n};\n\n// Default hash policy: just use the 'lookup' value. This of course only\n// works if the lookup value is integral. HashTable applies ScrambleHashCode to\n// the result of the 'hash' which means that it is 'ok' if the lookup value is\n// not well distributed over the HashNumber domain.\ntemplate <class Key>\nstruct DefaultHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        // Hash if can implicitly cast to hash number type.\n        return l;\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        // Use builtin or overloaded operator==.\n        return k == l;\n    }\n};\n\n// Specialize hashing policy for pointer types. It assumes that the type is\n// at least word-aligned. For types with smaller size use PointerHasher.\ntemplate <class T>\nstruct DefaultHasher<T *> : PointerHasher<T *, mozilla::tl::FloorLog2<sizeof(void *)>::value>\n{};\n\n// For doubles, we can xor the two uint32s.\ntemplate <>\nstruct DefaultHasher<double>\n{\n    typedef double Lookup;\n    static HashNumber hash(double d) {\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n        uint64_t u = mozilla::BitwiseCast<uint64_t>(d);\n        return HashNumber(u ^ (u >> 32));\n    }\n    static bool match(double lhs, double rhs) {\n        return mozilla::BitwiseCast<uint64_t>(lhs) == mozilla::BitwiseCast<uint64_t>(rhs);\n    }\n};\n\n/*****************************************************************************/\n\n// Both HashMap and HashSet are implemented by a single HashTable that is even\n// more heavily parameterized than the other two. This leaves HashTable gnarly\n// and extremely coupled to HashMap and HashSet; thus code should not use\n// HashTable directly.\n\ntemplate <class Key, class Value>\nclass HashMapEntry\n{\n    template <class, class, class> friend class detail::HashTable;\n    template <class> friend class detail::HashTableEntry;\n\n    HashMapEntry(const HashMapEntry &) MOZ_DELETE;\n    void operator=(const HashMapEntry &) MOZ_DELETE;\n\n  public:\n    template<typename KeyInput, typename ValueInput>\n    HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {}\n\n    HashMapEntry(mozilla::MoveRef<HashMapEntry> rhs)\n      : key(mozilla::Move(rhs->key)), value(mozilla::Move(rhs->value)) { }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n\n    const Key key;\n    Value value;\n};\n\n} // namespace js\n\nnamespace mozilla {\n\ntemplate <typename T>\nstruct IsPod<js::detail::HashTableEntry<T> > : IsPod<T> {};\n\ntemplate <typename K, typename V>\nstruct IsPod<js::HashMapEntry<K, V> >\n  : IntegralConstant<bool, IsPod<K>::value && IsPod<V>::value>\n{};\n\n} // namespace mozilla\n\nnamespace js {\n\nnamespace detail {\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable;\n\ntemplate <class T>\nclass HashTableEntry\n{\n    template <class, class, class> friend class HashTable;\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n\n    HashNumber keyHash;\n    mozilla::AlignedStorage2<NonConstT> mem;\n\n    static const HashNumber sFreeKey = 0;\n    static const HashNumber sRemovedKey = 1;\n    static const HashNumber sCollisionBit = 1;\n\n    // Assumed by calloc in createTable.\n    JS_STATIC_ASSERT(sFreeKey == 0);\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return hash > sRemovedKey;\n    }\n\n    HashTableEntry(const HashTableEntry &) MOZ_DELETE;\n    void operator=(const HashTableEntry &) MOZ_DELETE;\n    ~HashTableEntry() MOZ_DELETE;\n\n  public:\n    // NB: HashTableEntry is treated as a POD: no constructor or destructor calls.\n\n    void destroyIfLive() {\n        if (isLive())\n            mem.addr()->~T();\n    }\n\n    void destroy() {\n        JS_ASSERT(isLive());\n        mem.addr()->~T();\n    }\n\n    void swap(HashTableEntry *other) {\n        mozilla::Swap(keyHash, other->keyHash);\n        mozilla::Swap(mem, other->mem);\n    }\n\n    T &get() { JS_ASSERT(isLive()); return *mem.addr(); }\n\n    bool isFree() const    { return keyHash == sFreeKey; }\n    void clearLive()       { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }\n    void clear()           { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }\n    bool isRemoved() const { return keyHash == sRemovedKey; }\n    void removeLive()      { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }\n    bool isLive() const    { return isLiveHash(keyHash); }\n    void setCollision()               { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }\n    void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }\n    void unsetCollision()             { keyHash &= ~sCollisionBit; }\n    bool hasCollision() const         { return keyHash & sCollisionBit; }\n    bool matchHash(HashNumber hn)     { return (keyHash & ~sCollisionBit) == hn; }\n    HashNumber getKeyHash() const     { return keyHash & ~sCollisionBit; }\n\n    template <class U>\n    void setLive(HashNumber hn, const U &u)\n    {\n        JS_ASSERT(!isLive());\n        keyHash = hn;\n        new(mem.addr()) T(u);\n        JS_ASSERT(isLive());\n    }\n};\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable : private AllocPolicy\n{\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n    typedef typename HashPolicy::KeyType Key;\n    typedef typename HashPolicy::Lookup Lookup;\n\n  public:\n    typedef HashTableEntry<T> Entry;\n\n    // A nullable pointer to a hash table element. A Ptr |p| can be tested\n    // either explicitly |if (p.found()) p->...| or using boolean conversion\n    // |if (p) p->...|. Ptr objects must not be used after any mutating hash\n    // table operations unless |generation()| is tested.\n    class Ptr\n    {\n        friend class HashTable;\n        typedef void (Ptr::* ConvertibleToBool)();\n        void nonNull() {}\n\n        Entry *entry_;\n\n      protected:\n        Ptr(Entry &entry) : entry_(&entry) {}\n\n      public:\n        // Leaves Ptr uninitialized.\n        Ptr() {\n#ifdef DEBUG\n            entry_ = (Entry *)0xbad;\n#endif\n        }\n\n        bool found() const                    { return entry_->isLive(); }\n        operator ConvertibleToBool() const    { return found() ? &Ptr::nonNull : 0; }\n        bool operator==(const Ptr &rhs) const { JS_ASSERT(found() && rhs.found()); return entry_ == rhs.entry_; }\n        bool operator!=(const Ptr &rhs) const { return !(*this == rhs); }\n\n        T &operator*() const                  { return entry_->get(); }\n        T *operator->() const                 { return &entry_->get(); }\n    };\n\n    // A Ptr that can be used to add a key after a failed lookup.\n    class AddPtr : public Ptr\n    {\n        friend class HashTable;\n        HashNumber keyHash;\n        mozilla::DebugOnly<uint64_t> mutationCount;\n\n        AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}\n      public:\n        // Leaves AddPtr uninitialized.\n        AddPtr() {}\n    };\n\n    // A collection of hash table entries. The collection is enumerated by\n    // calling |front()| followed by |popFront()| as long as |!empty()|. As\n    // with Ptr/AddPtr, Range objects must not be used after any mutating hash\n    // table operation unless the |generation()| is tested.\n    class Range\n    {\n      protected:\n        friend class HashTable;\n\n        Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) {\n            while (cur < end && !cur->isLive())\n                ++cur;\n        }\n\n        Entry *cur, *end;\n        mozilla::DebugOnly<bool> validEntry;\n\n      public:\n        Range() : cur(NULL), end(NULL), validEntry(false) {}\n\n        bool empty() const {\n            return cur == end;\n        }\n\n        T &front() const {\n            JS_ASSERT(validEntry);\n            JS_ASSERT(!empty());\n            return cur->get();\n        }\n\n        void popFront() {\n            JS_ASSERT(!empty());\n            while (++cur < end && !cur->isLive())\n                continue;\n            validEntry = true;\n        }\n    };\n\n    // A Range whose lifetime delimits a mutating enumeration of a hash table.\n    // Since rehashing when elements were removed during enumeration would be\n    // bad, it is postponed until the Enum is destructed.  Since the Enum's\n    // destructor touches the hash table, the user must ensure that the hash\n    // table is still alive when the destructor runs.\n    class Enum : public Range\n    {\n        friend class HashTable;\n\n        HashTable &table;\n        bool rekeyed;\n        bool removed;\n\n        /* Not copyable. */\n        Enum(const Enum &);\n        void operator=(const Enum &);\n\n      public:\n        template<class Map> explicit\n        Enum(Map &map) : Range(map.all()), table(map.impl), rekeyed(false), removed(false) {}\n\n        // Removes the |front()| element from the table, leaving |front()|\n        // invalid until the next call to |popFront()|. For example:\n        //\n        //   HashSet<int> s;\n        //   for (HashSet<int>::Enum e(s); !e.empty(); e.popFront())\n        //     if (e.front() == 42)\n        //       e.removeFront();\n        void removeFront() {\n            table.remove(*this->cur);\n            removed = true;\n            this->validEntry = false;\n        }\n\n        // Removes the |front()| element and re-inserts it into the table with\n        // a new key at the new Lookup position.  |front()| is invalid after\n        // this operation until the next call to |popFront()|.\n        void rekeyFront(const Lookup &l, const Key &k) {\n            table.rekey(*this->cur, l, k);\n            rekeyed = true;\n            this->validEntry = false;\n        }\n\n        void rekeyFront(const Key &k) {\n            rekeyFront(k, k);\n        }\n\n        // Potentially rehashes the table.\n        ~Enum() {\n            if (rekeyed) {\n                table.gen++;\n                table.checkOverRemoved();\n            }\n\n            if (removed)\n                table.compactIfUnderloaded();\n        }\n    };\n\n    // HashTable is movable\n    HashTable(mozilla::MoveRef<HashTable> rhs)\n      : AllocPolicy(*rhs)\n    {\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n    void operator=(mozilla::MoveRef<HashTable> rhs) {\n        if (table)\n            destroyTable(*this, table, capacity());\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n\n  private:\n    // HashTable is not copyable or assignable\n    HashTable(const HashTable &) MOZ_DELETE;\n    void operator=(const HashTable &) MOZ_DELETE;\n\n  private:\n    uint32_t    hashShift;      // multiplicative hash shift\n    uint32_t    entryCount;     // number of entries in table\n    uint32_t    gen;            // entry storage generation number\n    uint32_t    removedCount;   // removed entry sentinels in table\n    Entry       *table;         // entry storage\n\n    void setTableSizeLog2(unsigned sizeLog2)\n    {\n        hashShift = sHashBits - sizeLog2;\n    }\n\n#ifdef DEBUG\n    mutable struct Stats\n    {\n        uint32_t        searches;       // total number of table searches\n        uint32_t        steps;          // hash chain links traversed\n        uint32_t        hits;           // searches that found key\n        uint32_t        misses;         // searches that didn't find key\n        uint32_t        addOverRemoved; // adds that recycled a removed entry\n        uint32_t        removes;        // calls to remove\n        uint32_t        removeFrees;    // calls to remove that freed the entry\n        uint32_t        grows;          // table expansions\n        uint32_t        shrinks;        // table contractions\n        uint32_t        compresses;     // table compressions\n        uint32_t        rehashes;       // tombstone decontaminations\n    } stats;\n#   define METER(x) x\n#else\n#   define METER(x)\n#endif\n\n    friend class mozilla::ReentrancyGuard;\n    mutable mozilla::DebugOnly<bool> entered;\n    mozilla::DebugOnly<uint64_t>     mutationCount;\n\n    // The default initial capacity is 32 (enough to hold 16 elements), but it\n    // can be as low as 4.\n    static const unsigned sMinCapacityLog2 = 2;\n    static const unsigned sMinCapacity  = 1 << sMinCapacityLog2;\n    static const unsigned sMaxInit      = JS_BIT(23);\n    static const unsigned sMaxCapacity  = JS_BIT(24);\n    static const unsigned sHashBits     = mozilla::tl::BitSize<HashNumber>::value;\n    static const uint8_t  sMinAlphaFrac = 64;  // (0x100 * .25)\n    static const uint8_t  sMaxAlphaFrac = 192; // (0x100 * .75)\n    static const uint8_t  sInvMaxAlpha  = 171; // (ceil(0x100 / .75) >> 1)\n    static const HashNumber sFreeKey = Entry::sFreeKey;\n    static const HashNumber sRemovedKey = Entry::sRemovedKey;\n    static const HashNumber sCollisionBit = Entry::sCollisionBit;\n\n    static void staticAsserts()\n    {\n        // Rely on compiler \"constant overflow warnings\".\n        JS_STATIC_ASSERT(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity);\n        JS_STATIC_ASSERT((sMaxCapacity * sInvMaxAlpha) <= UINT32_MAX);\n        JS_STATIC_ASSERT((sMaxCapacity * sizeof(Entry)) <= UINT32_MAX);\n    }\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return Entry::isLiveHash(hash);\n    }\n\n    static HashNumber prepareHash(const Lookup& l)\n    {\n        HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l));\n\n        // Avoid reserved hash codes.\n        if (!isLiveHash(keyHash))\n            keyHash -= (sRemovedKey + 1);\n        return keyHash & ~sCollisionBit;\n    }\n\n    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)\n    {\n        // See JS_STATIC_ASSERT(sFreeKey == 0) in HashTableEntry.\n        return (Entry *)alloc.calloc_(capacity * sizeof(Entry));\n    }\n\n    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)\n    {\n        for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)\n            e->destroyIfLive();\n        alloc.free_(oldTable);\n    }\n\n  public:\n    HashTable(AllocPolicy ap)\n      : AllocPolicy(ap),\n        hashShift(sHashBits),\n        entryCount(0),\n        gen(0),\n        removedCount(0),\n        table(NULL),\n        entered(false),\n        mutationCount(0)\n    {}\n\n    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)\n    {\n        JS_ASSERT(!initialized());\n\n        // Correct for sMaxAlphaFrac such that the table will not resize\n        // when adding 'length' entries.\n        if (length > sMaxInit) {\n            this->reportAllocOverflow();\n            return false;\n        }\n        uint32_t newCapacity = (length * sInvMaxAlpha) >> 7;\n\n        if (newCapacity < sMinCapacity)\n            newCapacity = sMinCapacity;\n\n        // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034).\n        uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2;\n        while (roundUp < newCapacity) {\n            roundUp <<= 1;\n            ++roundUpLog2;\n        }\n\n        newCapacity = roundUp;\n        JS_ASSERT(newCapacity <= sMaxCapacity);\n\n        table = createTable(*this, newCapacity);\n        if (!table)\n            return false;\n\n        setTableSizeLog2(roundUpLog2);\n        METER(memset(&stats, 0, sizeof(stats)));\n        return true;\n    }\n\n    bool initialized() const\n    {\n        return !!table;\n    }\n\n    ~HashTable()\n    {\n        if (table)\n            destroyTable(*this, table, capacity());\n    }\n\n  private:\n    HashNumber hash1(HashNumber hash0) const\n    {\n        return hash0 >> hashShift;\n    }\n\n    struct DoubleHash\n    {\n        HashNumber h2;\n        HashNumber sizeMask;\n    };\n\n    DoubleHash hash2(HashNumber curKeyHash) const\n    {\n        unsigned sizeLog2 = sHashBits - hashShift;\n        DoubleHash dh = {\n            ((curKeyHash << sizeLog2) >> hashShift) | 1,\n            (HashNumber(1) << sizeLog2) - 1\n        };\n        return dh;\n    }\n\n    static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh)\n    {\n        return (h1 - dh.h2) & dh.sizeMask;\n    }\n\n    bool overloaded()\n    {\n        return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);\n    }\n\n    // Would the table be underloaded if it had the given capacity and entryCount?\n    static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount)\n    {\n        return capacity > sMinCapacity && entryCount <= ((sMinAlphaFrac * capacity) >> 8);\n    }\n\n    bool underloaded()\n    {\n        return wouldBeUnderloaded(capacity(), entryCount);\n    }\n\n    static bool match(Entry &e, const Lookup &l)\n    {\n        return HashPolicy::match(HashPolicy::getKey(e.get()), l);\n    }\n\n    Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const\n    {\n        JS_ASSERT(isLiveHash(keyHash));\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (entry->isFree()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Hit: return entry.\n        if (entry->matchHash(keyHash) && match(*entry, l)) {\n            METER(stats.hits++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        // Save the first removed entry pointer so we can recycle later.\n        Entry *firstRemoved = NULL;\n\n        while(true) {\n            if (JS_UNLIKELY(entry->isRemoved())) {\n                if (!firstRemoved)\n                    firstRemoved = entry;\n            } else {\n                entry->setCollision(collisionBit);\n            }\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (entry->isFree()) {\n                METER(stats.misses++);\n                return firstRemoved ? *firstRemoved : *entry;\n            }\n\n            if (entry->matchHash(keyHash) && match(*entry, l)) {\n                METER(stats.hits++);\n                return *entry;\n            }\n        }\n    }\n\n    // This is a copy of lookup hardcoded to the assumptions:\n    //   1. the lookup is a lookupForAdd\n    //   2. the key, whose |keyHash| has been passed is not in the table,\n    //   3. no entries have been removed from the table.\n    // This specialized search avoids the need for recovering lookup values\n    // from entries, which allows more flexible Lookup/Key types.\n    Entry &findFreeEntry(HashNumber keyHash)\n    {\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // We assume 'keyHash' has already been distributed.\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (!entry->isLive()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        while(true) {\n            JS_ASSERT(!entry->isRemoved());\n            entry->setCollision();\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (!entry->isLive()) {\n                METER(stats.misses++);\n                return *entry;\n            }\n        }\n    }\n\n    enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed };\n\n    RebuildStatus changeTableSize(int deltaLog2)\n    {\n        // Look, but don't touch, until we succeed in getting new entry store.\n        Entry *oldTable = table;\n        uint32_t oldCap = capacity();\n        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;\n        uint32_t newCapacity = JS_BIT(newLog2);\n        if (newCapacity > sMaxCapacity) {\n            this->reportAllocOverflow();\n            return RehashFailed;\n        }\n\n        Entry *newTable = createTable(*this, newCapacity);\n        if (!newTable)\n            return RehashFailed;\n\n        // We can't fail from here on, so update table parameters.\n        setTableSizeLog2(newLog2);\n        removedCount = 0;\n        gen++;\n        table = newTable;\n\n        // Copy only live entries, leaving removed ones behind.\n        for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {\n            if (src->isLive()) {\n                HashNumber hn = src->getKeyHash();\n                findFreeEntry(hn).setLive(hn, mozilla::Move(src->get()));\n                src->destroy();\n            }\n        }\n\n        // All entries have been destroyed, no need to destroyTable.\n        this->free_(oldTable);\n        return Rehashed;\n    }\n\n    RebuildStatus checkOverloaded()\n    {\n        if (!overloaded())\n            return NotOverloaded;\n\n        // Compress if a quarter or more of all entries are removed.\n        int deltaLog2;\n        if (removedCount >= (capacity() >> 2)) {\n            METER(stats.compresses++);\n            deltaLog2 = 0;\n        } else {\n            METER(stats.grows++);\n            deltaLog2 = 1;\n        }\n\n        return changeTableSize(deltaLog2);\n    }\n\n    // Infallibly rehash the table if we are overloaded with removals.\n    void checkOverRemoved()\n    {\n        if (overloaded()) {\n            if (checkOverloaded() == RehashFailed)\n                rehashTableInPlace();\n        }\n    }\n\n    void remove(Entry &e)\n    {\n        JS_ASSERT(table);\n        METER(stats.removes++);\n\n        if (e.hasCollision()) {\n            e.removeLive();\n            removedCount++;\n        } else {\n            METER(stats.removeFrees++);\n            e.clearLive();\n        }\n        entryCount--;\n        mutationCount++;\n    }\n\n    void checkUnderloaded()\n    {\n        if (underloaded()) {\n            METER(stats.shrinks++);\n            (void) changeTableSize(-1);\n        }\n    }\n\n    // Resize the table down to the largest capacity which doesn't underload the\n    // table.  Since we call checkUnderloaded() on every remove, you only need\n    // to call this after a bulk removal of items done without calling remove().\n    void compactIfUnderloaded()\n    {\n        int32_t resizeLog2 = 0;\n        uint32_t newCapacity = capacity();\n        while (wouldBeUnderloaded(newCapacity, entryCount)) {\n            newCapacity = newCapacity >> 1;\n            resizeLog2--;\n        }\n\n        if (resizeLog2 != 0) {\n            changeTableSize(resizeLog2);\n        }\n    }\n\n    // This is identical to changeTableSize(currentSize), but without requiring\n    // a second table.  We do this by recycling the collision bits to tell us if\n    // the element is already inserted or still waiting to be inserted.  Since\n    // already-inserted elements win any conflicts, we get the same table as we\n    // would have gotten through random insertion order.\n    void rehashTableInPlace()\n    {\n        METER(stats.rehashes++);\n        removedCount = 0;\n        for (size_t i = 0; i < capacity(); ++i)\n            table[i].unsetCollision();\n\n        for (size_t i = 0; i < capacity();) {\n            Entry *src = &table[i];\n\n            if (!src->isLive() || src->hasCollision()) {\n                ++i;\n                continue;\n            }\n\n            HashNumber keyHash = src->getKeyHash();\n            HashNumber h1 = hash1(keyHash);\n            DoubleHash dh = hash2(keyHash);\n            Entry *tgt = &table[h1];\n            while (true) {\n                if (!tgt->hasCollision()) {\n                    src->swap(tgt);\n                    tgt->setCollision();\n                    break;\n                }\n\n                h1 = applyDoubleHash(h1, dh);\n                tgt = &table[h1];\n            }\n        }\n\n        // TODO: this algorithm leaves collision bits on *all* elements, even if\n        // they are on no collision path. We have the option of setting the\n        // collision bits correctly on a subsequent pass or skipping the rehash\n        // unless we are totally filled with tombstones: benchmark to find out\n        // which approach is best.\n    }\n\n  public:\n    void clear()\n    {\n        if (mozilla::IsPod<Entry>::value) {\n            memset(table, 0, sizeof(*table) * capacity());\n        } else {\n            uint32_t tableCapacity = capacity();\n            for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)\n                e->clear();\n        }\n        removedCount = 0;\n        entryCount = 0;\n        mutationCount++;\n    }\n\n    void finish()\n    {\n        JS_ASSERT(!entered);\n\n        if (!table)\n            return;\n\n        destroyTable(*this, table, capacity());\n        table = NULL;\n        gen++;\n        entryCount = 0;\n        removedCount = 0;\n        mutationCount++;\n    }\n\n    Range all() const\n    {\n        JS_ASSERT(table);\n        return Range(table, table + capacity());\n    }\n\n    bool empty() const\n    {\n        JS_ASSERT(table);\n        return !entryCount;\n    }\n\n    uint32_t count() const\n    {\n        JS_ASSERT(table);\n        return entryCount;\n    }\n\n    uint32_t capacity() const\n    {\n        JS_ASSERT(table);\n        return JS_BIT(sHashBits - hashShift);\n    }\n\n    uint32_t generation() const\n    {\n        JS_ASSERT(table);\n        return gen;\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(table);\n    }\n\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    Ptr lookup(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const\n    {\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    AddPtr lookupForAdd(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        Entry &entry = lookup(l, keyHash, sCollisionBit);\n        AddPtr p(entry, keyHash);\n        p.mutationCount = mutationCount;\n        return p;\n    }\n\n    template <class U>\n    bool add(AddPtr &p, const U &rhs)\n    {\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(mutationCount == p.mutationCount);\n        JS_ASSERT(table);\n        JS_ASSERT(!p.found());\n        JS_ASSERT(!(p.keyHash & sCollisionBit));\n\n        // Changing an entry from removed to live does not affect whether we\n        // are overloaded and can be handled separately.\n        if (p.entry_->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            p.keyHash |= sCollisionBit;\n        } else {\n            // Preserve the validity of |p.entry_|.\n            RebuildStatus status = checkOverloaded();\n            if (status == RehashFailed)\n                return false;\n            if (status == Rehashed)\n                p.entry_ = &findFreeEntry(p.keyHash);\n        }\n\n        p.entry_->setLive(p.keyHash, rhs);\n        entryCount++;\n        mutationCount++;\n        return true;\n    }\n\n    template <class U>\n    void putNewInfallible(const Lookup &l, const U &u)\n    {\n        JS_ASSERT(table);\n\n        HashNumber keyHash = prepareHash(l);\n        Entry *entry = &findFreeEntry(keyHash);\n\n        if (entry->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            keyHash |= sCollisionBit;\n        }\n\n        entry->setLive(keyHash, u);\n        entryCount++;\n        mutationCount++;\n    }\n\n    template <class U>\n    bool putNew(const Lookup &l, const U &u)\n    {\n        if (checkOverloaded() == RehashFailed)\n            return false;\n\n        putNewInfallible(l, u);\n        return true;\n    }\n\n    template <class U>\n    bool relookupOrAdd(AddPtr& p, const Lookup &l, const U &u)\n    {\n        p.mutationCount = mutationCount;\n        {\n            mozilla::ReentrancyGuard g(*this);\n            p.entry_ = &lookup(l, p.keyHash, sCollisionBit);\n        }\n        return p.found() || add(p, u);\n    }\n\n    void remove(Ptr p)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        remove(*p.entry_);\n        checkUnderloaded();\n    }\n\n    void rekey(Ptr p, const Lookup &l, const Key &k)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));\n        HashPolicy::setKey(t, const_cast<Key &>(k));\n        remove(*p.entry_);\n        putNewInfallible(l, mozilla::Move(t));\n    }\n\n#undef METER\n};\n\n}  // namespace detail\n}  // namespace js\n\n#endif  /* js_HashTable_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/HeapAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HeapAPI_h\n#define js_HeapAPI_h\n\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n\n/* These values are private to the JS engine. */\nnamespace js {\nnamespace gc {\n\nconst size_t ArenaShift = 12;\nconst size_t ArenaSize = size_t(1) << ArenaShift;\nconst size_t ArenaMask = ArenaSize - 1;\n\nconst size_t ChunkShift = 20;\nconst size_t ChunkSize = size_t(1) << ChunkShift;\nconst size_t ChunkMask = ChunkSize - 1;\n\nconst size_t CellShift = 3;\nconst size_t CellSize = size_t(1) << CellShift;\nconst size_t CellMask = CellSize - 1;\n\n/* These are magic constants derived from actual offsets in gc/Heap.h. */\nconst size_t ChunkMarkBitmapOffset = 1032368;\nconst size_t ChunkMarkBitmapBits = 129024;\nconst size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);\n\n/*\n * Live objects are marked black. How many other additional colors are available\n * depends on the size of the GCThing. Objects marked gray are eligible for\n * cycle collection.\n */\nstatic const uint32_t BLACK = 0;\nstatic const uint32_t GRAY = 1;\n\n} /* namespace gc */\n} /* namespace js */\n\nnamespace JS {\nstruct Zone;\n} /* namespace JS */\n\nnamespace JS {\nnamespace shadow {\n\nstruct ArenaHeader\n{\n    JS::Zone *zone;\n};\n\nstruct Zone\n{\n    bool needsBarrier_;\n\n    Zone() : needsBarrier_(false) {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\nnamespace gc {\n\nstatic JS_ALWAYS_INLINE uintptr_t *\nGetGCThingMarkBitmap(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkMarkBitmapOffset;\n    return reinterpret_cast<uintptr_t *>(addr);\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::Runtime *\nGetGCThingRuntime(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkRuntimeOffset;\n    return *reinterpret_cast<JS::shadow::Runtime **>(addr);\n}\n\nstatic JS_ALWAYS_INLINE void\nGetGCThingMarkWordAndMask(const void *thing, uint32_t color,\n                          uintptr_t **wordp, uintptr_t *maskp)\n{\n    uintptr_t addr = uintptr_t(thing);\n    size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;\n    JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);\n    uintptr_t *bitmap = GetGCThingMarkBitmap(thing);\n    *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD);\n    *wordp = &bitmap[bit / JS_BITS_PER_WORD];\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::ArenaHeader *\nGetGCThingArena(void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ArenaMask;\n    return reinterpret_cast<JS::shadow::ArenaHeader *>(addr);\n}\n\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\nstatic JS_ALWAYS_INLINE Zone *\nGetGCThingZone(void *thing)\n{\n    JS_ASSERT(thing);\n    return js::gc::GetGCThingArena(thing)->zone;\n}\n\nstatic JS_ALWAYS_INLINE Zone *\nGetObjectZone(JSObject *obj)\n{\n    return GetGCThingZone(obj);\n}\n\nstatic JS_ALWAYS_INLINE bool\nGCThingIsMarkedGray(void *thing)\n{\n    uintptr_t *word, mask;\n    js::gc::GetGCThingMarkWordAndMask(thing, js::gc::GRAY, &word, &mask);\n    return *word & mask;\n}\n\nstatic JS_ALWAYS_INLINE bool\nIsIncrementalBarrierNeededOnGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind)\n{\n    if (!rt->needsBarrier_)\n        return false;\n    JS::Zone *zone = GetGCThingZone(thing);\n    return reinterpret_cast<shadow::Zone *>(zone)->needsBarrier_;\n}\n\n} /* namespace JS */\n\n#endif /* js_HeapAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/LegacyIntTypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This section typedefs the old 'native' types to the new <stdint.h> types.\n * These redefinitions are provided solely to allow JSAPI users to more easily\n * transition to <stdint.h> types.  They are not to be used in the JSAPI, and\n * new JSAPI user code should not use them.  This mapping file may eventually\n * be removed from SpiderMonkey, so don't depend on it in the long run.\n */\n\n/*\n * BEWARE: Comity with other implementers of these types is not guaranteed.\n *         Indeed, if you use this header and third-party code defining these\n *         types, *expect* to encounter either compile errors or link errors,\n *         depending how these types are used and on the order of inclusion.\n *         It is safest to use only the <stdint.h> types.\n */\n#ifndef js_LegacyIntTypes_h\n#define js_LegacyIntTypes_h\n\n#include <stdint.h>\n\n#include \"js-config.h\"\n\ntypedef uint8_t uint8;\ntypedef uint16_t uint16;\ntypedef uint32_t uint32;\ntypedef uint64_t uint64;\n\n/*\n * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very\n * common header file) defines the types int8, int16, int32, and int64.\n * So we don't define these four types here to avoid conflicts in case\n * the code also includes sys/types.h.\n */\n#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)\n#include <sys/inttypes.h>\n#else\ntypedef int8_t int8;\ntypedef int16_t int16;\ntypedef int32_t int32;\ntypedef int64_t int64;\n#endif /* AIX && HAVE_SYS_INTTYPES_H */\n\ntypedef uint8_t JSUint8;\ntypedef uint16_t JSUint16;\ntypedef uint32_t JSUint32;\ntypedef uint64_t JSUint64;\n\ntypedef int8_t JSInt8;\ntypedef int16_t JSInt16;\ntypedef int32_t JSInt32;\ntypedef int64_t JSInt64;\n\n#endif /* js_LegacyIntTypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/MemoryMetrics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_MemoryMetrics_h\n#define js_MemoryMetrics_h\n\n// These declarations are not within jsapi.h because they are highly likely to\n// change in the future. Depend on them at your own risk.\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include <string.h>\n\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n#include \"js/Vector.h\"\n\nclass nsISupports;      // This is needed for ObjectPrivateVisitor.\n\nnamespace js {\n\n// In memory reporting, we have concept of \"sundries\", line items which are too\n// small to be worth reporting individually.  Under some circumstances, a memory\n// reporter gets tossed into the sundries bucket if it's smaller than\n// MemoryReportingSundriesThreshold() bytes.\n//\n// We need to define this value here, rather than in the code which actually\n// generates the memory reports, because HugeStringInfo uses this value.\nJS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();\n\n} // namespace js\n\nnamespace JS {\n\n// Data for tracking memory usage of things hanging off objects.\nstruct ObjectsExtraSizes\n{\n    size_t slots;\n    size_t elementsNonAsmJS;\n    size_t elementsAsmJSHeap;\n    size_t elementsAsmJSNonHeap;\n    size_t argumentsData;\n    size_t regExpStatics;\n    size_t propertyIteratorData;\n    size_t ctypesData;\n    size_t private_;    // The '_' suffix is required because |private| is a keyword.\n                        // Note that this field is measured separately from the others.\n\n    ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); }\n\n    void add(ObjectsExtraSizes &sizes) {\n        this->slots                += sizes.slots;\n        this->elementsNonAsmJS     += sizes.elementsNonAsmJS;\n        this->elementsAsmJSHeap    += sizes.elementsAsmJSHeap;\n        this->elementsAsmJSNonHeap += sizes.elementsAsmJSNonHeap;\n        this->argumentsData        += sizes.argumentsData;\n        this->regExpStatics        += sizes.regExpStatics;\n        this->propertyIteratorData += sizes.propertyIteratorData;\n        this->ctypesData           += sizes.ctypesData;\n        this->private_             += sizes.private_;\n    }\n};\n\n// Data for tracking analysis/inference memory usage.\nstruct TypeInferenceSizes\n{\n    size_t typeScripts;\n    size_t typeResults;\n    size_t analysisPool;\n    size_t pendingArrays;\n    size_t allocationSiteTables;\n    size_t arrayTypeTables;\n    size_t objectTypeTables;\n\n    TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); }\n\n    void add(TypeInferenceSizes &sizes) {\n        this->typeScripts          += sizes.typeScripts;\n        this->typeResults          += sizes.typeResults;\n        this->analysisPool         += sizes.analysisPool;\n        this->pendingArrays        += sizes.pendingArrays;\n        this->allocationSiteTables += sizes.allocationSiteTables;\n        this->arrayTypeTables      += sizes.arrayTypeTables;\n        this->objectTypeTables     += sizes.objectTypeTables;\n    }\n};\n\n// Data for tracking JIT-code memory usage.\nstruct CodeSizes\n{\n    size_t ion;\n    size_t asmJS;\n    size_t baseline;\n    size_t regexp;\n    size_t other;\n    size_t unused;\n\n    CodeSizes() { memset(this, 0, sizeof(CodeSizes)); }\n};\n\n// Holds data about a huge string (one which uses more HugeStringInfo::MinSize\n// bytes of memory), so we can report it individually.\nstruct HugeStringInfo\n{\n    HugeStringInfo() : length(0), size(0) { memset(&buffer, 0, sizeof(buffer)); }\n\n    // A string needs to take up this many bytes of storage before we consider\n    // it to be \"huge\".\n    static size_t MinSize() {\n        return js::MemoryReportingSundriesThreshold();\n    }\n\n    // A string's size in memory is not necessarily equal to twice its length\n    // because the allocator and the JS engine both may round up.\n    size_t length;\n    size_t size;\n\n    // We record the first 32 chars of the escaped string here.  (We escape the\n    // string so we can use a char[] instead of a jschar[] here.\n    char buffer[32];\n};\n\n// These measurements relate directly to the JSRuntime, and not to\n// compartments within it.\nstruct RuntimeSizes\n{\n    RuntimeSizes() { memset(this, 0, sizeof(RuntimeSizes)); }\n\n    size_t object;\n    size_t atomsTable;\n    size_t contexts;\n    size_t dtoa;\n    size_t temporary;\n    size_t regexpData;\n    size_t interpreterStack;\n    size_t gcMarker;\n    size_t mathCache;\n    size_t scriptData;\n    size_t scriptSources;\n\n    CodeSizes code;\n};\n\nstruct ZoneStats\n{\n    ZoneStats()\n      : extra(NULL),\n        gcHeapArenaAdmin(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapStringsNormal(0),\n        gcHeapStringsShort(0),\n        gcHeapLazyScripts(0),\n        gcHeapTypeObjects(0),\n        gcHeapIonCodes(0),\n        stringCharsNonHuge(0),\n        lazyScripts(0),\n        typeObjects(0),\n        typePool(0),\n        hugeStrings()\n    {}\n\n    ZoneStats(const ZoneStats &other)\n      : extra(other.extra),\n        gcHeapArenaAdmin(other.gcHeapArenaAdmin),\n        gcHeapUnusedGcThings(other.gcHeapUnusedGcThings),\n        gcHeapStringsNormal(other.gcHeapStringsNormal),\n        gcHeapStringsShort(other.gcHeapStringsShort),\n        gcHeapLazyScripts(other.gcHeapLazyScripts),\n        gcHeapTypeObjects(other.gcHeapTypeObjects),\n        gcHeapIonCodes(other.gcHeapIonCodes),\n        stringCharsNonHuge(other.stringCharsNonHuge),\n        lazyScripts(other.lazyScripts),\n        typeObjects(other.typeObjects),\n        typePool(other.typePool),\n        hugeStrings()\n    {\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // Add other's numbers to this object's numbers.\n    void add(ZoneStats &other) {\n        #define ADD(x)  this->x += other.x\n\n        ADD(gcHeapArenaAdmin);\n        ADD(gcHeapUnusedGcThings);\n\n        ADD(gcHeapStringsNormal);\n        ADD(gcHeapStringsShort);\n        ADD(gcHeapLazyScripts);\n        ADD(gcHeapTypeObjects);\n        ADD(gcHeapIonCodes);\n\n        ADD(stringCharsNonHuge);\n        ADD(lazyScripts);\n        ADD(typeObjects);\n        ADD(typePool);\n\n        #undef ADD\n\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    size_t gcHeapArenaAdmin;\n    size_t gcHeapUnusedGcThings;\n\n    size_t gcHeapStringsNormal;\n    size_t gcHeapStringsShort;\n\n    size_t gcHeapLazyScripts;\n    size_t gcHeapTypeObjects;\n    size_t gcHeapIonCodes;\n\n    size_t stringCharsNonHuge;\n    size_t lazyScripts;\n    size_t typeObjects;\n    size_t typePool;\n\n    js::Vector<HugeStringInfo, 0, js::SystemAllocPolicy> hugeStrings;\n\n    // The size of all the live things in the GC heap that don't belong to any\n    // compartment.\n    size_t GCHeapThingsSize();\n};\n\nstruct CompartmentStats\n{\n    CompartmentStats()\n      : extra(NULL),\n        gcHeapObjectsOrdinary(0),\n        gcHeapObjectsFunction(0),\n        gcHeapObjectsDenseArray(0),\n        gcHeapObjectsSlowArray(0),\n        gcHeapObjectsCrossCompartmentWrapper(0),\n        gcHeapShapesTreeGlobalParented(0),\n        gcHeapShapesTreeNonGlobalParented(0),\n        gcHeapShapesDict(0),\n        gcHeapShapesBase(0),\n        gcHeapScripts(0),\n        objectsExtra(),\n        shapesExtraTreeTables(0),\n        shapesExtraDictTables(0),\n        shapesExtraTreeShapeKids(0),\n        shapesCompartmentTables(0),\n        scriptData(0),\n        baselineData(0),\n        baselineStubsFallback(0),\n        baselineStubsOptimized(0),\n        ionData(0),\n        compartmentObject(0),\n        crossCompartmentWrappersTable(0),\n        regexpCompartment(0),\n        debuggeesSet(0),\n        typeInference()\n    {}\n\n    CompartmentStats(const CompartmentStats &other)\n      : extra(other.extra),\n        gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary),\n        gcHeapObjectsFunction(other.gcHeapObjectsFunction),\n        gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray),\n        gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray),\n        gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper),\n        gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented),\n        gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented),\n        gcHeapShapesDict(other.gcHeapShapesDict),\n        gcHeapShapesBase(other.gcHeapShapesBase),\n        gcHeapScripts(other.gcHeapScripts),\n        objectsExtra(other.objectsExtra),\n        shapesExtraTreeTables(other.shapesExtraTreeTables),\n        shapesExtraDictTables(other.shapesExtraDictTables),\n        shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids),\n        shapesCompartmentTables(other.shapesCompartmentTables),\n        scriptData(other.scriptData),\n        baselineData(other.baselineData),\n        baselineStubsFallback(other.baselineStubsFallback),\n        baselineStubsOptimized(other.baselineStubsOptimized),\n        ionData(other.ionData),\n        compartmentObject(other.compartmentObject),\n        crossCompartmentWrappersTable(other.crossCompartmentWrappersTable),\n        regexpCompartment(other.regexpCompartment),\n        debuggeesSet(other.debuggeesSet),\n        typeInference(other.typeInference)\n    {\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    // If you add a new number, remember to update the constructors, add(), and\n    // maybe gcHeapThingsSize()!\n    size_t gcHeapObjectsOrdinary;\n    size_t gcHeapObjectsFunction;\n    size_t gcHeapObjectsDenseArray;\n    size_t gcHeapObjectsSlowArray;\n    size_t gcHeapObjectsCrossCompartmentWrapper;\n    size_t gcHeapShapesTreeGlobalParented;\n    size_t gcHeapShapesTreeNonGlobalParented;\n    size_t gcHeapShapesDict;\n    size_t gcHeapShapesBase;\n    size_t gcHeapScripts;\n    ObjectsExtraSizes objectsExtra;\n\n    size_t shapesExtraTreeTables;\n    size_t shapesExtraDictTables;\n    size_t shapesExtraTreeShapeKids;\n    size_t shapesCompartmentTables;\n    size_t scriptData;\n    size_t baselineData;\n    size_t baselineStubsFallback;\n    size_t baselineStubsOptimized;\n    size_t ionData;\n    size_t compartmentObject;\n    size_t crossCompartmentWrappersTable;\n    size_t regexpCompartment;\n    size_t debuggeesSet;\n\n    TypeInferenceSizes typeInference;\n\n    // Add cStats's numbers to this object's numbers.\n    void add(CompartmentStats &cStats) {\n        #define ADD(x)  this->x += cStats.x\n\n        ADD(gcHeapObjectsOrdinary);\n        ADD(gcHeapObjectsFunction);\n        ADD(gcHeapObjectsDenseArray);\n        ADD(gcHeapObjectsSlowArray);\n        ADD(gcHeapObjectsCrossCompartmentWrapper);\n        ADD(gcHeapShapesTreeGlobalParented);\n        ADD(gcHeapShapesTreeNonGlobalParented);\n        ADD(gcHeapShapesDict);\n        ADD(gcHeapShapesBase);\n        ADD(gcHeapScripts);\n        objectsExtra.add(cStats.objectsExtra);\n\n        ADD(shapesExtraTreeTables);\n        ADD(shapesExtraDictTables);\n        ADD(shapesExtraTreeShapeKids);\n        ADD(shapesCompartmentTables);\n        ADD(scriptData);\n        ADD(baselineData);\n        ADD(baselineStubsFallback);\n        ADD(baselineStubsOptimized);\n        ADD(ionData);\n        ADD(compartmentObject);\n        ADD(crossCompartmentWrappersTable);\n        ADD(regexpCompartment);\n        ADD(debuggeesSet);\n\n        #undef ADD\n\n        typeInference.add(cStats.typeInference);\n    }\n\n    // The size of all the live things in the GC heap.\n    size_t GCHeapThingsSize();\n};\n\nstruct RuntimeStats\n{\n    RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)\n      : runtime(),\n        gcHeapChunkTotal(0),\n        gcHeapDecommittedArenas(0),\n        gcHeapUnusedChunks(0),\n        gcHeapUnusedArenas(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapChunkAdmin(0),\n        gcHeapGcThings(0),\n        cTotals(),\n        zTotals(),\n        compartmentStatsVector(),\n        zoneStatsVector(),\n        currZoneStats(NULL),\n        mallocSizeOf_(mallocSizeOf)\n    {}\n\n    RuntimeSizes runtime;\n\n    // If you add a new number, remember to update the constructor!\n\n    // Here's a useful breakdown of the GC heap.\n    //\n    // - rtStats.gcHeapChunkTotal\n    //   - decommitted bytes\n    //     - rtStats.gcHeapDecommittedArenas (decommitted arenas in non-empty chunks)\n    //   - unused bytes\n    //     - rtStats.gcHeapUnusedChunks (empty chunks)\n    //     - rtStats.gcHeapUnusedArenas (empty arenas within non-empty chunks)\n    //     - rtStats.total.gcHeapUnusedGcThings (empty GC thing slots within non-empty arenas)\n    //   - used bytes\n    //     - rtStats.gcHeapChunkAdmin\n    //     - rtStats.total.gcHeapArenaAdmin\n    //     - rtStats.gcHeapGcThings (in-use GC things)\n    //\n    // It's possible that some arenas in empty chunks may be decommitted, but\n    // we don't count those under rtStats.gcHeapDecommittedArenas because (a)\n    // it's rare, and (b) this means that rtStats.gcHeapUnusedChunks is a\n    // multiple of the chunk size, which is good.\n\n    size_t gcHeapChunkTotal;\n    size_t gcHeapDecommittedArenas;\n    size_t gcHeapUnusedChunks;\n    size_t gcHeapUnusedArenas;\n    size_t gcHeapUnusedGcThings;\n    size_t gcHeapChunkAdmin;\n    size_t gcHeapGcThings;\n\n    // The sum of all compartment's measurements.\n    CompartmentStats cTotals;\n    ZoneStats zTotals;\n\n    js::Vector<CompartmentStats, 0, js::SystemAllocPolicy> compartmentStatsVector;\n    js::Vector<ZoneStats, 0, js::SystemAllocPolicy> zoneStatsVector;\n\n    ZoneStats *currZoneStats;\n\n    mozilla::MallocSizeOf mallocSizeOf_;\n\n    virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;\n    virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;\n};\n\nclass ObjectPrivateVisitor\n{\n  public:\n    // Within CollectRuntimeStats, this method is called for each JS object\n    // that has an nsISupports pointer.\n    virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0;\n\n    // A callback that gets a JSObject's nsISupports pointer, if it has one.\n    // Note: this function does *not* addref |iface|.\n    typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface);\n    GetISupportsFun getISupports_;\n\n    ObjectPrivateVisitor(GetISupportsFun getISupports)\n      : getISupports_(getISupports)\n    {}\n};\n\nextern JS_PUBLIC_API(bool)\nCollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv);\n\nextern JS_PUBLIC_API(size_t)\nSystemCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nUserCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nPeakSizeOfTemporary(const JSRuntime *rt);\n\n} // namespace JS\n\n#endif /* js_MemoryMetrics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/PropertyKey.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::PropertyKey implementation. */\n\n#ifndef js_PropertyKey_h\n#define js_PropertyKey_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"js/Value.h\"\n\nstruct JSContext;\n\nnamespace JS {\n\nclass PropertyKey;\n\nnamespace detail {\n\nextern JS_PUBLIC_API(bool)\nToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n} // namespace detail\n\n/*\n * A PropertyKey is a key used to access some property on an object.  It is a\n * natural way to represent a property accessed using a JavaScript value.\n *\n * PropertyKey can represent indexes, named properties, and ES6 symbols.  The\n * latter aren't implemented in SpiderMonkey yet, but PropertyKey carves out\n * space for them.\n */\nclass PropertyKey\n{\n    Value v;\n    friend JS_PUBLIC_API(bool) detail::ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n  public:\n    explicit PropertyKey(uint32_t index) : v(PrivateUint32Value(index)) {}\n\n    /*\n     * An index is a string property name whose characters exactly spell out an\n     * unsigned 32-bit integer in decimal: \"0\", \"1\", \"2\", ...., \"4294967294\",\n     * \"4294967295\".\n     */\n    bool isIndex(uint32_t *index) {\n        // The implementation here assumes that private uint32_t are stored\n        // using the int32_t representation.  This is purely an implementation\n        // detail: embedders must not rely upon this!\n        if (!v.isInt32())\n            return false;\n        *index = v.toPrivateUint32();\n        return true;\n    }\n\n    /*\n     * A name is a string property name which is *not* an index.  Note that by\n     * the ECMAScript language grammar, any dotted property access |obj.prop|\n     * will access a named property.\n     */\n    bool isName(JSString **str) {\n        uint32_t dummy;\n        if (isIndex(&dummy))\n            return false;\n        *str = v.toString();\n        return true;\n    }\n\n    /*\n     * A symbol is a property name that's a Symbol, a particular kind of object\n     * in ES6.  It is the only kind of property name that's not a string.\n     *\n     * SpiderMonkey doesn't yet implement symbols, but we're carving out API\n     * space for them in advance.\n     */\n    bool isSymbol() {\n        return false;\n    }\n};\n\ninline bool\nToPropertyKey(JSContext *cx, HandleValue v, PropertyKey *key)\n{\n    if (v.isInt32() && v.toInt32() >= 0) {\n        *key = PropertyKey(uint32_t(v.toInt32()));\n        return true;\n    }\n\n    return detail::ToPropertyKeySlow(cx, v, key);\n}\n\n} // namespace JS\n\n#endif /* js_PropertyKey_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/RequiredDefines.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Various #defines required to build SpiderMonkey.  Embedders should add this\n * file to the start of the command line via -include or a similar mechanism,\n * or SpiderMonkey public headers may not work correctly.\n */\n\n#ifndef js_RequiredDefines_h\n#define js_RequiredDefines_h\n\n/*\n * The c99 defining the limit macros (UINT32_MAX for example), says:\n * C++ implementations should define these macros only when __STDC_LIMIT_MACROS\n * is defined before <stdint.h> is included.\n */\n#define __STDC_LIMIT_MACROS\n\n#endif /* js_RequiredDefines_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/RootingAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_RootingAPI_h\n#define js_RootingAPI_h\n\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\n/*\n * Moving GC Stack Rooting\n *\n * A moving GC may change the physical location of GC allocated things, even\n * when they are rooted, updating all pointers to the thing to refer to its new\n * location. The GC must therefore know about all live pointers to a thing,\n * not just one of them, in order to behave correctly.\n *\n * The |Rooted| and |Handle| classes below are used to root stack locations\n * whose value may be held live across a call that can trigger GC. For a\n * code fragment such as:\n *\n * JSObject *obj = NewObject(cx);\n * DoSomething(cx);\n * ... = obj->lastProperty();\n *\n * If |DoSomething()| can trigger a GC, the stack location of |obj| must be\n * rooted to ensure that the GC does not move the JSObject referred to by\n * |obj| without updating |obj|'s location itself. This rooting must happen\n * regardless of whether there are other roots which ensure that the object\n * itself will not be collected.\n *\n * If |DoSomething()| cannot trigger a GC, and the same holds for all other\n * calls made between |obj|'s definitions and its last uses, then no rooting\n * is required.\n *\n * SpiderMonkey can trigger a GC at almost any time and in ways that are not\n * always clear. For example, the following innocuous-looking actions can\n * cause a GC: allocation of any new GC thing; JSObject::hasProperty;\n * JS_ReportError and friends; and ToNumber, among many others. The following\n * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_,\n * rt->malloc_, and friends and JS_ReportOutOfMemory.\n *\n * The following family of three classes will exactly root a stack location.\n * Incorrect usage of these classes will result in a compile error in almost\n * all cases. Therefore, it is very hard to be incorrectly rooted if you use\n * these classes exclusively. These classes are all templated on the type T of\n * the value being rooted.\n *\n * - Rooted<T> declares a variable of type T, whose value is always rooted.\n *   Rooted<T> may be automatically coerced to a Handle<T>, below. Rooted<T>\n *   should be used whenever a local variable's value may be held live across a\n *   call which can trigger a GC.\n *\n * - Handle<T> is a const reference to a Rooted<T>. Functions which take GC\n *   things or values as arguments and need to root those arguments should\n *   generally use handles for those arguments and avoid any explicit rooting.\n *   This has two benefits. First, when several such functions call each other\n *   then redundant rooting of multiple copies of the GC thing can be avoided.\n *   Second, if the caller does not pass a rooted value a compile error will be\n *   generated, which is quicker and easier to fix than when relying on a\n *   separate rooting analysis.\n *\n * - MutableHandle<T> is a non-const reference to Rooted<T>. It is used in the\n *   same way as Handle<T> and includes a |set(const T &v)| method to allow\n *   updating the value of the referenced Rooted<T>. A MutableHandle<T> can be\n *   created from a Rooted<T> by using |Rooted<T>::operator&()|.\n *\n * In some cases the small performance overhead of exact rooting (measured to\n * be a few nanoseconds on desktop) is too much. In these cases, try the\n * following:\n *\n * - Move all Rooted<T> above inner loops: this allows you to re-use the root\n *   on each iteration of the loop.\n *\n * - Pass Handle<T> through your hot call stack to avoid re-rooting costs at\n *   every invocation.\n *\n * The following diagram explains the list of supported, implicit type\n * conversions between classes of this family:\n *\n *  Rooted<T> ----> Handle<T>\n *     |               ^\n *     |               |\n *     |               |\n *     +---> MutableHandle<T>\n *     (via &)\n *\n * All of these types have an implicit conversion to raw pointers.\n */\n\nnamespace js {\n\nclass Module;\nclass ScriptSourceObject;\n\ntemplate <typename T>\nstruct GCMethods {};\n\ntemplate <typename T>\nclass RootedBase {};\n\ntemplate <typename T>\nclass HandleBase {};\n\ntemplate <typename T>\nclass MutableHandleBase {};\n\ntemplate <typename T>\nclass HeapBase {};\n\n/*\n * js::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for js::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(js::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n *\n * This is the SpiderMonkey internal variant. js::NullPtr should be used in\n * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API\n * symbols.\n */\nstruct NullPtr\n{\n    static void * const constNullValue;\n};\n\nnamespace gc {\nstruct Cell;\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> class Rooted;\n\ntemplate <typename T> class Handle;\ntemplate <typename T> class MutableHandle;\n\n/* This is exposing internal state of the GC for inlining purposes. */\nJS_FRIEND_API(bool) isGCEnabled();\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\nextern void\nCheckStackRoots(JSContext *cx);\n#endif\n\n/*\n * JS::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for JS::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(JS::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n */\nstruct JS_PUBLIC_API(NullPtr)\n{\n    static void * const constNullValue;\n};\n\n/*\n * The Heap<T> class is a C/C++ heap-stored reference to a JS GC thing.  All\n * members of heap classes that refer to GC thing should use Heap<T> (or\n * possibly TenuredHeap<T>, described below).\n *\n * Heap<T> wraps the complex mechanisms required to ensure GC safety for the\n * contained reference into a C++ class that behaves similarly to a normal\n * pointer.\n *\n * GC references stored on the C/C++ stack must use Rooted/Handle/MutableHandle\n * instead.\n *\n * Requirements for type T:\n *  - Must be one of: Value, jsid, JSObject*, JSString*, JSScript*\n */\ntemplate <typename T>\nclass Heap : public js::HeapBase<T>\n{\n  public:\n    Heap() {\n        static_assert(sizeof(T) == sizeof(Heap<T>),\n                      \"Heap<T> must be binary compatible with T.\");\n        init(js::GCMethods<T>::initial());\n    }\n    explicit Heap(T p) { init(p); }\n    explicit Heap(const Heap<T> &p) { init(p.ptr); }\n\n    ~Heap() {\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            relocate();\n    }\n\n    bool operator==(const Heap<T> &other) { return ptr == other.ptr; }\n    bool operator!=(const Heap<T> &other) { return ptr != other.ptr; }\n\n    bool operator==(const T &other) const { return ptr == other; }\n    bool operator!=(const T &other) const { return ptr != other; }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    const T *address() const { return &ptr; }\n    const T &get() const { return ptr; }\n\n    T *unsafeGet() { return &ptr; }\n\n    Heap<T> &operator=(T p) {\n        set(p);\n        return *this;\n    }\n\n    void set(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (js::GCMethods<T>::needsPostBarrier(newPtr)) {\n            ptr = newPtr;\n            post();\n        } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {\n            relocate();  /* Called before overwriting ptr. */\n            ptr = newPtr;\n        } else {\n            ptr = newPtr;\n        }\n    }\n\n  private:\n    void init(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        ptr = newPtr;\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            post();\n    }\n\n    void post() {\n#ifdef JSGC_GENERATIONAL\n        JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));\n        js::GCMethods<T>::postBarrier(&ptr);\n#endif\n    }\n\n    void relocate() {\n#ifdef JSGC_GENERATIONAL\n        js::GCMethods<T>::relocate(&ptr);\n#endif\n    }\n\n    T ptr;\n};\n\n#ifdef DEBUG\n/*\n * For generational GC, assert that an object is in the tenured generation as\n * opposed to being in the nursery.\n */\nextern JS_FRIEND_API(void)\nAssertGCThingMustBeTenured(JSObject* obj);\n#else\ninline void\nAssertGCThingMustBeTenured(JSObject *obj) {}\n#endif\n\n/*\n * The TenuredHeap<T> class is similar to the Heap<T> class above in that it\n * encapsulates the GC concerns of an on-heap reference to a JS object. However,\n * it has two important differences:\n *\n *  1) Pointers which are statically known to only reference \"tenured\" objects\n *     can avoid the extra overhead of SpiderMonkey's write barriers.\n *\n *  2) Objects in the \"tenured\" heap have stronger alignment restrictions than\n *     those in the \"nursery\", so it is possible to store flags in the lower\n *     bits of pointers known to be tenured. TenuredHeap wraps a normal tagged\n *     pointer with a nice API for accessing the flag bits and adds various\n *     assertions to ensure that it is not mis-used.\n *\n * GC things are said to be \"tenured\" when they are located in the long-lived\n * heap: e.g. they have gained tenure as an object by surviving past at least\n * one GC. For performance, SpiderMonkey allocates some things which are known\n * to normally be long lived directly into the tenured generation; for example,\n * global objects. Additionally, SpiderMonkey does not visit individual objects\n * when deleting non-tenured objects, so object with finalizers are also always\n * tenured; for instance, this includes most DOM objects.\n *\n * The considerations to keep in mind when using a TenuredHeap<T> vs a normal\n * Heap<T> are:\n *\n *  - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing.\n *  - It is however valid for a Heap<T> to refer to a tenured thing.\n *  - It is not possible to store flag bits in a Heap<T>.\n */\ntemplate <typename T>\nclass TenuredHeap : public js::HeapBase<T>\n{\n  public:\n    TenuredHeap() : bits(0) {\n        static_assert(sizeof(T) == sizeof(TenuredHeap<T>),\n                      \"TenuredHeap<T> must be binary compatible with T.\");\n    }\n    explicit TenuredHeap(T p) : bits(0) { setPtr(p); }\n    explicit TenuredHeap(const TenuredHeap<T> &p) : bits(0) { setPtr(p.ptr); }\n\n    bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }\n    bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }\n\n    void setPtr(T newPtr) {\n        JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (newPtr)\n            AssertGCThingMustBeTenured(newPtr);\n        bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);\n    }\n\n    void setFlags(uintptr_t flagsToSet) {\n        JS_ASSERT((flagsToSet & ~flagsMask) == 0);\n        bits |= flagsToSet;\n    }\n\n    void unsetFlags(uintptr_t flagsToUnset) {\n        JS_ASSERT((flagsToUnset & ~flagsMask) == 0);\n        bits &= ~flagsToUnset;\n    }\n\n    bool hasFlag(uintptr_t flag) const {\n        JS_ASSERT((flag & ~flagsMask) == 0);\n        return (bits & flag) != 0;\n    }\n\n    T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }\n    uintptr_t getFlags() const { return bits & flagsMask; }\n\n    operator T() const { return getPtr(); }\n    T operator->() const { return getPtr(); }\n\n    TenuredHeap<T> &operator=(T p) {\n        setPtr(p);\n        return *this;\n    }\n\n    /*\n     * Set the pointer to a value which will cause a crash if it is\n     * dereferenced.\n     */\n    void setToCrashOnTouch() {\n        bits = (bits & flagsMask) | crashOnTouchPointer;\n    }\n\n    bool isSetToCrashOnTouch() {\n        return (bits & ~flagsMask) == crashOnTouchPointer;\n    }\n\n  private:\n    enum {\n        maskBits = 3,\n        flagsMask = (1 << maskBits) - 1,\n        crashOnTouchPointer = 1 << maskBits\n    };\n\n    uintptr_t bits;\n};\n\n/*\n * Reference to a T that has been rooted elsewhere. This is most useful\n * as a parameter type, which guarantees that the T lvalue is properly\n * rooted. See \"Move GC Stack Rooting\" above.\n *\n * If you want to add additional methods to Handle for a specific\n * specialization, define a HandleBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>\n{\n    friend class MutableHandle<T>;\n\n  public:\n    /* Creates a handle from a handle of a type convertible to T. */\n    template <typename S>\n    Handle(Handle<S> handle,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)\n    {\n        static_assert(sizeof(Handle<T>) == sizeof(T *),\n                      \"Handle must be binary compatible with T*.\");\n        ptr = reinterpret_cast<const T *>(handle.address());\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(js::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"js::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&js::NullPtr::constNullValue);\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(JS::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"JS::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&JS::NullPtr::constNullValue);\n    }\n\n    Handle(MutableHandle<T> handle) {\n        ptr = handle.address();\n    }\n\n    /*\n     * Take care when calling this method!\n     *\n     * This creates a Handle from the raw location of a T.\n     *\n     * It should be called only if the following conditions hold:\n     *\n     *  1) the location of the T is guaranteed to be marked (for some reason\n     *     other than being a Rooted), e.g., if it is guaranteed to be reachable\n     *     from an implicit root.\n     *\n     *  2) the contents of the location are immutable, or at least cannot change\n     *     for the lifetime of the handle, as its users may not expect its value\n     *     to change underneath them.\n     */\n    static Handle fromMarkedLocation(const T *p) {\n        Handle h;\n        h.ptr = p;\n        return h;\n    }\n\n    /*\n     * Construct a handle from an explicitly rooted location. This is the\n     * normal way to create a handle, and normally happens implicitly.\n     */\n    template <typename S>\n    inline\n    Handle(const Rooted<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    /* Construct a read only handle from a mutable handle. */\n    template <typename S>\n    inline\n    Handle(MutableHandle<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    const T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a Handle<T> to something that\n     * takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n    bool operator!=(const T &other) const { return *ptr != other; }\n    bool operator==(const T &other) const { return *ptr == other; }\n\n  private:\n    Handle() {}\n\n    const T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\ntypedef Handle<JSObject*>                   HandleObject;\ntypedef Handle<js::Module*>                 HandleModule;\ntypedef Handle<js::ScriptSourceObject *>    HandleScriptSource;\ntypedef Handle<JSFunction*>                 HandleFunction;\ntypedef Handle<JSScript*>                   HandleScript;\ntypedef Handle<JSString*>                   HandleString;\ntypedef Handle<jsid>                        HandleId;\ntypedef Handle<Value>                       HandleValue;\n\n/*\n * Similar to a handle, but the underlying storage can be changed. This is\n * useful for outparams.\n *\n * If you want to add additional methods to MutableHandle for a specific\n * specialization, define a MutableHandleBase<T> specialization containing\n * them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    inline MutableHandle(Rooted<T> *root);\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    /*\n     * This may be called only if the location of the T is guaranteed\n     * to be marked (for some reason other than being a Rooted),\n     * e.g., if it is guaranteed to be reachable from an implicit root.\n     *\n     * Create a MutableHandle from a raw location of a T.\n     */\n    static MutableHandle fromMarkedLocation(T *p) {\n        MutableHandle h;\n        h.ptr = p;\n        return h;\n    }\n\n    T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a MutableHandle<T> to something that takes\n     * a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    MutableHandle() {}\n\n    T *ptr;\n\n    template <typename S> void operator=(S v) MOZ_DELETE;\n    void operator=(MutableHandle other) MOZ_DELETE;\n};\n\ntypedef MutableHandle<JSObject*>   MutableHandleObject;\ntypedef MutableHandle<JSFunction*> MutableHandleFunction;\ntypedef MutableHandle<JSScript*>   MutableHandleScript;\ntypedef MutableHandle<JSString*>   MutableHandleString;\ntypedef MutableHandle<jsid>        MutableHandleId;\ntypedef MutableHandle<Value>       MutableHandleValue;\n\n#ifdef JSGC_GENERATIONAL\nJS_PUBLIC_API(void) HeapCellPostBarrier(js::gc::Cell **cellp);\nJS_PUBLIC_API(void) HeapCellRelocate(js::gc::Cell **cellp);\n#endif\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * InternalHandle is a handle to an internal pointer into a gcthing. Use\n * InternalHandle when you have a pointer to a direct field of a gcthing, or\n * when you need a parameter type for something that *may* be a pointer to a\n * direct field of a gcthing.\n */\ntemplate <typename T>\nclass InternalHandle {};\n\ntemplate <typename T>\nclass InternalHandle<T*>\n{\n    void * const *holder;\n    size_t offset;\n\n  public:\n    /*\n     * Create an InternalHandle using a Handle to the gcthing containing the\n     * field in question, and a pointer to the field.\n     */\n    template<typename H>\n    InternalHandle(const JS::Handle<H> &handle, T *field)\n      : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get()))\n    {}\n\n    /*\n     * Create an InternalHandle to a field within a Rooted<>.\n     */\n    template<typename R>\n    InternalHandle(const JS::Rooted<R> &root, T *field)\n      : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get()))\n    {}\n\n    T *get() const { return reinterpret_cast<T*>(uintptr_t(*holder) + offset); }\n\n    const T &operator*() const { return *get(); }\n    T *operator->() const { return get(); }\n\n    static InternalHandle<T*> fromMarkedLocation(T *fieldPtr) {\n        return InternalHandle(fieldPtr);\n    }\n\n  private:\n    /*\n     * Create an InternalHandle to something that is not a pointer to a\n     * gcthing, and so does not need to be rooted in the first place. Use these\n     * InternalHandles to pass pointers into functions that also need to accept\n     * regular InternalHandles to gcthing fields.\n     *\n     * Make this private to prevent accidental misuse; this is only for\n     * fromMarkedLocation().\n     */\n    InternalHandle(T *field)\n      : holder(reinterpret_cast<void * const *>(&js::NullPtr::constNullValue)),\n        offset(uintptr_t(field))\n    {}\n};\n\n/*\n * By default, pointers should use the inheritance hierarchy to find their\n * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that\n * Rooted<T> may be used without the class definition being available.\n */\ntemplate <typename T>\nstruct RootKind<T *>\n{\n    static ThingRootKind rootKind() { return T::rootKind(); }\n};\n\ntemplate <typename T>\nstruct GCMethods<T *>\n{\n    static T *initial() { return NULL; }\n    static ThingRootKind kind() { return RootKind<T *>::rootKind(); }\n    static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }\n    static bool needsPostBarrier(T *v) { return v; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(T **vp) {\n        JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n    static void relocate(T **vp) {\n        JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n#endif\n};\n\n// XXX: Needed for cocos2d JS Bindings\n//#if defined(DEBUG)\n/* This helper allows us to assert that Rooted<T> is scoped within a request. */\nextern JS_PUBLIC_API(bool)\nIsInRequest(JSContext *cx);\n//#endif\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Local variable of type T whose value is always rooted. This is typically\n * used for local variables, or for non-rooted values being passed to a\n * function that requires a handle, e.g. Foo(Root<T>(cx, x)).\n *\n * If you want to add additional methods to Rooted for a specific\n * specialization, define a RootedBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS Rooted : public js::RootedBase<T>\n{\n    /* Note: CX is a subclass of either ContextFriendFields or PerThreadDataFriendFields. */\n    template <typename CX>\n    void init(CX *cx) {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        js::ThingRootKind kind = js::GCMethods<T>::kind();\n        this->stack = &cx->thingGCRooters[kind];\n        this->prev = *stack;\n        *stack = reinterpret_cast<Rooted<void*>*>(this);\n\n        JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));\n#endif\n    }\n\n  public:\n    Rooted(JSContext *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(JSContext *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(js::ContextFriendFields *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::ContextFriendFields *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(JSRuntime *rt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    Rooted(JSRuntime *rt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    ~Rooted() {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));\n        *stack = prev;\n#endif\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<T> *previous() { return prev; }\n#endif\n\n    /*\n     * Important: Return a reference here so passing a Rooted<T> to\n     * something that takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    T &operator=(const Rooted &value) {\n        ptr = value;\n        return ptr;\n    }\n\n    void set(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<void*> **stack, *prev;\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /* Has the rooting analysis ever scanned this Rooted's stack location? */\n    friend void JS::CheckStackRoots(JSContext*);\n#endif\n\n#ifdef JSGC_ROOT_ANALYSIS\n    bool scanned;\n#endif\n\n    /*\n     * |ptr| must be the last field in Rooted because the analysis treats all\n     * Rooted as Rooted<void*> during the analysis. See bug 829372.\n     */\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    Rooted(const Rooted &) MOZ_DELETE;\n};\n\n#if !(defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING))\n// Defined in vm/String.h.\ntemplate <>\nclass Rooted<JSStableString *>;\n#endif\n\ntypedef Rooted<JSObject*>                   RootedObject;\ntypedef Rooted<js::Module*>                 RootedModule;\ntypedef Rooted<js::ScriptSourceObject *>    RootedScriptSource;\ntypedef Rooted<JSFunction*>                 RootedFunction;\ntypedef Rooted<JSScript*>                   RootedScript;\ntypedef Rooted<JSString*>                   RootedString;\ntypedef Rooted<jsid>                        RootedId;\ntypedef Rooted<JS::Value>                   RootedValue;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Mark a stack location as a root for the rooting analysis, without actually\n * rooting it in release builds. This should only be used for stack locations\n * of GC things that cannot be relocated by a garbage collection, and that\n * are definitely reachable via another path.\n */\nclass SkipRoot\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n\n    SkipRoot **stack, *prev;\n    const uint8_t *start;\n    const uint8_t *end;\n\n    template <typename CX, typename T>\n    void init(CX *cx, const T *ptr, size_t count) {\n        SkipRoot **head = &cx->skipGCRooters;\n        this->stack = head;\n        this->prev = *stack;\n        *stack = this;\n        this->start = (const uint8_t *) ptr;\n        this->end = this->start + (sizeof(T) * count);\n    }\n\n  public:\n    ~SkipRoot() {\n        JS_ASSERT(*stack == this);\n        *stack = prev;\n    }\n\n    SkipRoot *previous() { return prev; }\n\n    bool contains(const uint8_t *v, size_t len) {\n        return v >= start && v + len <= end;\n    }\n\n#else /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {}\n\n  public:\n\n#endif /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    SkipRoot(JSContext *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(ContextFriendFields::get(cx), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(ContextFriendFields *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(cx, ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(PerThreadData *pt, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(PerThreadDataFriendFields::get(pt), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Interface substitute for Rooted<T> which does not root the variable's memory. */\ntemplate <typename T>\nclass FakeRooted : public RootedBase<T>\n{\n  public:\n    template <typename CX>\n    FakeRooted(CX *cx\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename CX>\n    FakeRooted(CX *cx, T initial\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    FakeRooted(const FakeRooted &) MOZ_DELETE;\n};\n\n/* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */\ntemplate <typename T>\nclass FakeMutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    FakeMutableHandle(T *t) {\n        ptr = t;\n    }\n\n    FakeMutableHandle(FakeRooted<T> *root) {\n        ptr = root->address();\n    }\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    T *address() const { return ptr; }\n    T get() const { return *ptr; }\n\n    operator T() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    FakeMutableHandle() {}\n\n    T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\n/*\n * Types for a variable that either should or shouldn't be rooted, depending on\n * the template parameter Rooted. Used for implementing functions that can\n * operate on either rooted or unrooted data.\n *\n * The toHandle() and toMutableHandle() functions are for calling functions\n * which require handle types and are only called in the CanGC case. These\n * allow the calling code to type check.\n */\nenum AllowGC {\n    NoGC = 0,\n    CanGC = 1\n};\ntemplate <typename T, AllowGC allowGC>\nclass MaybeRooted\n{\n};\n\ntemplate <typename T> class MaybeRooted<T, CanGC>\n{\n  public:\n    typedef JS::Handle<T> HandleType;\n    typedef JS::Rooted<T> RootType;\n    typedef JS::MutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        return v;\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        return v;\n    }\n};\n\ntemplate <typename T> class MaybeRooted<T, NoGC>\n{\n  public:\n    typedef T HandleType;\n    typedef FakeRooted<T> RootType;\n    typedef FakeMutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n};\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(const Rooted<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(MutableHandle<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T>\ninline\nMutableHandle<T>::MutableHandle(Rooted<T> *root)\n{\n    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),\n                  \"MutableHandle must be binary compatible with T*.\");\n    ptr = root->address();\n}\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Hook for dynamic root analysis. Checks the native stack and poisons\n * references to GC things which have not been rooted.\n */\ninline void MaybeCheckStackRoots(JSContext *cx)\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    JS::CheckStackRoots(cx);\n#endif\n}\n\n/* Base class for automatic read-only object rooting during compilation. */\nclass CompilerRootNode\n{\n  protected:\n    CompilerRootNode(js::gc::Cell *ptr) : next(NULL), ptr_(ptr) {}\n\n  public:\n    void **address() { return (void **)&ptr_; }\n\n  public:\n    CompilerRootNode *next;\n\n  protected:\n    js::gc::Cell *ptr_;\n};\n\n}  /* namespace js */\n\n#endif  /* js_RootingAPI_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/Utility.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Utility_h\n#define js_Utility_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/Scoped.h\"\n#include \"mozilla/TemplateLib.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef JS_OOM_DO_BACKTRACES\n#include <stdio.h>\n#include <execinfo.h>\n#endif\n\n#include \"jstypes.h\"\n\n/* The public JS engine namespace. */\nnamespace JS {}\n\n/* The mozilla-shared reusable template/utility namespace. */\nnamespace mozilla {}\n\n/* The private JS engine namespace. */\nnamespace js {}\n\n/*\n * Pattern used to overwrite freed memory. If you are accessing an object with\n * this pattern, you probably have a dangling pointer.\n */\n#define JS_FREE_PATTERN 0xDA\n\n#define JS_ASSERT(expr)           MOZ_ASSERT(expr)\n#define JS_ASSERT_IF(cond, expr)  MOZ_ASSERT_IF(cond, expr)\n#define JS_ALWAYS_TRUE(expr)      MOZ_ALWAYS_TRUE(expr)\n#define JS_ALWAYS_FALSE(expr)     MOZ_ALWAYS_FALSE(expr)\n\n#ifdef DEBUG\n# ifdef JS_THREADSAFE\n#  define JS_THREADSAFE_ASSERT(expr) JS_ASSERT(expr)\n# else\n#  define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n# endif\n#else\n# define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n#endif\n\n#if defined(DEBUG)\n# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)\n#elif defined(JS_CRASH_DIAGNOSTICS)\n# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)\n#else\n# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)\n#endif\n\n#define JS_STATIC_ASSERT(cond)           static_assert(cond, \"JS_STATIC_ASSERT\")\n#define JS_STATIC_ASSERT_IF(cond, expr)  MOZ_STATIC_ASSERT_IF(cond, expr, \"JS_STATIC_ASSERT_IF\")\n\nextern MOZ_NORETURN JS_PUBLIC_API(void)\nJS_Assert(const char *s, const char *file, int ln);\n\n/*\n * Abort the process in a non-graceful manner. This will cause a core file,\n * call to the debugger or other moral equivalent as well as causing the\n * entire process to stop.\n */\nextern JS_PUBLIC_API(void) JS_Abort(void);\n\n/*\n * Custom allocator support for SpiderMonkey\n */\n#if defined JS_USE_CUSTOM_ALLOCATOR\n# include \"jscustomallocator.h\"\n#else\n# ifdef DEBUG\n/*\n * In order to test OOM conditions, when the testing function\n * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th\n * allocation from now.\n */\nextern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtins/TestingFunctions.cpp */\nextern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */\n\n#ifdef JS_OOM_DO_BACKTRACES\n#define JS_OOM_BACKTRACE_SIZE 32\nstatic JS_ALWAYS_INLINE void\nPrintBacktrace()\n{\n    void* OOM_trace[JS_OOM_BACKTRACE_SIZE];\n    char** OOM_traceSymbols = NULL;\n    int32_t OOM_traceSize = 0;\n    int32_t OOM_traceIdx = 0;\n    OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE);\n    OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize);\n\n    if (!OOM_traceSymbols)\n        return;\n\n    for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) {\n        fprintf(stderr, \"#%d %s\\n\", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]);\n    }\n\n    free(OOM_traceSymbols);\n}\n\n#define JS_OOM_EMIT_BACKTRACE() \\\n    do {\\\n        fprintf(stderr, \"Forcing artificial memory allocation function failure:\\n\");\\\n\tPrintBacktrace();\\\n    } while (0)\n# else\n#  define JS_OOM_EMIT_BACKTRACE() do {} while(0)\n#endif /* JS_OOM_DO_BACKTRACES */\n\n#  define JS_OOM_POSSIBLY_FAIL() \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            js_ReportOutOfMemory(cx);\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n# else\n#  define JS_OOM_POSSIBLY_FAIL() do {} while(0)\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)\n# endif /* DEBUG */\n\nstatic JS_INLINE void* js_malloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return malloc(bytes);\n}\n\nstatic JS_INLINE void* js_calloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(bytes, 1);\n}\n\nstatic JS_INLINE void* js_calloc(size_t nmemb, size_t size)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(nmemb, size);\n}\n\nstatic JS_INLINE void* js_realloc(void* p, size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return realloc(p, bytes);\n}\n\nstatic JS_INLINE void js_free(void* p)\n{\n    free(p);\n}\n#endif/* JS_USE_CUSTOM_ALLOCATOR */\n\n/*\n * JS_ROTATE_LEFT32\n *\n * There is no rotate operation in the C Language so the construct (a << 4) |\n * (a >> 28) is used instead. Most compilers convert this to a rotate\n * instruction but some versions of MSVC don't without a little help.  To get\n * MSVC to generate a rotate instruction, we have to use the _rotl intrinsic\n * and use a pragma to make _rotl inline.\n *\n * MSVC in VS2005 will do an inline rotate instruction on the above construct.\n */\n#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \\\n    defined(_M_X64))\n#include <stdlib.h>\n#pragma intrinsic(_rotl)\n#define JS_ROTATE_LEFT32(a, bits) _rotl(a, bits)\n#else\n#define JS_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))\n#endif\n\n#include <new>\n\n/*\n * Low-level memory management in SpiderMonkey:\n *\n *  ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these\n *     to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's\n *     these symbols.\n *\n *  ** Do not use the builtin C++ operator new and delete: these throw on\n *     error and we cannot override them not to.\n *\n * Allocation:\n *\n * - If the lifetime of the allocation is tied to the lifetime of a GC-thing\n *   (that is, finalizing the GC-thing will free the allocation), call one of\n *   the following functions:\n *\n *     JSContext::{malloc_,realloc_,calloc_,new_}\n *     JSRuntime::{malloc_,realloc_,calloc_,new_}\n *\n *   These functions accumulate the number of bytes allocated which is used as\n *   part of the GC-triggering heuristic.\n *\n *   The difference between the JSContext and JSRuntime versions is that the\n *   cx version reports an out-of-memory error on OOM. (This follows from the\n *   general SpiderMonkey idiom that a JSContext-taking function reports its\n *   own errors.)\n *\n * - Otherwise, use js_malloc/js_realloc/js_calloc/js_free/js_new\n *\n * Deallocation:\n *\n * - Ordinarily, use js_free/js_delete.\n *\n * - For deallocations during GC finalization, use one of the following\n *   operations on the FreeOp provided to the finalizer:\n *\n *     FreeOp::{free_,delete_}\n *\n *   The advantage of these operations is that the memory is batched and freed\n *   on another thread.\n */\n\n#define JS_NEW_BODY(allocator, t, parms)                                       \\\n    void *memory = allocator(sizeof(t));                                       \\\n    return memory ? new(memory) t parms : NULL;\n\n/*\n * Given a class which should provide 'new' methods, add\n * JS_DECLARE_NEW_METHODS (see JSContext for a usage example). This\n * adds news with up to 12 parameters. Add more versions of new below if\n * you need more than 12 parameters.\n *\n * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,\n * or the build will break.\n */\n#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\\\n    template <class T>\\\n    QUALIFIERS T *NEWNAME() {\\\n        JS_NEW_BODY(ALLOCATOR, T, ())\\\n    }\\\n\\\n    template <class T, class P1>\\\n    QUALIFIERS T *NEWNAME(P1 p1) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1))\\\n    }\\\n\\\n    template <class T, class P1, class P2>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\\\n    }\\\n\nJS_DECLARE_NEW_METHODS(js_new, js_malloc, static JS_ALWAYS_INLINE)\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE void\njs_delete(T *p)\n{\n    if (p) {\n        p->~T();\n        js_free(p);\n    }\n}\n\ntemplate<class T>\nstatic JS_ALWAYS_INLINE void\njs_delete_poison(T *p)\n{\n    if (p) {\n        p->~T();\n        memset(p, 0x3B, sizeof(T));\n        js_free(p);\n    }\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc()\n{\n    return (T *)js_malloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc()\n{\n    return (T *)js_calloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_malloc(numElems * sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_calloc(numElems * sizeof(T));\n}\n\nnamespace js {\n\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return NULL; }\n    static void release(T* ptr) { js_free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits)\n\ntemplate <typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { js_delete(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits)\n\ntemplate <typename T>\nstruct ScopedReleasePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { if (ptr) ptr->release(); }\n};\nSCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits)\n\n} /* namespace js */\n\nnamespace js {\n\n/* Integral types for all hash functions. */\ntypedef uint32_t HashNumber;\nconst unsigned HashNumberSizeBits = 32;\n\nnamespace detail {\n\n/*\n * Given a raw hash code, h, return a number that can be used to select a hash\n * bucket.\n *\n * This function aims to produce as uniform an output distribution as possible,\n * especially in the most significant (leftmost) bits, even though the input\n * distribution may be highly nonrandom, given the constraints that this must\n * be deterministic and quick to compute.\n *\n * Since the leftmost bits of the result are best, the hash bucket index is\n * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent\n * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask.\n *\n * FIXME: OrderedHashTable uses a bit-mask; see bug 775896.\n */\ninline HashNumber\nScrambleHashCode(HashNumber h)\n{\n    /*\n     * Simply returning h would not cause any hash tables to produce wrong\n     * answers. But it can produce pathologically bad performance: The caller\n     * right-shifts the result, keeping only the highest bits. The high bits of\n     * hash codes are very often completely entropy-free. (So are the lowest\n     * bits.)\n     *\n     * So we use Fibonacci hashing, as described in Knuth, The Art of Computer\n     * Programming, 6.4. This mixes all the bits of the input hash code h.\n     * \n     * The value of goldenRatio is taken from the hex\n     * expansion of the golden ratio, which starts 1.9E3779B9....\n     * This value is especially good if values with consecutive hash codes\n     * are stored in a hash table; see Knuth for details.\n     */\n    static const HashNumber goldenRatio = 0x9E3779B9U;\n    return h * goldenRatio;\n}\n\n} /* namespace detail */\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Methods for poisoning GC heap pointer words and checking for poisoned words.\n * These are in this file for use in Value methods and so forth.\n *\n * If the moving GC hazard analysis is in use and detects a non-rooted stack\n * pointer to a GC thing, one byte of that pointer is poisoned to refer to an\n * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the\n * pointer is overwritten, to reduce the likelihood of accidentally changing\n * a live integer value.\n */\n\ninline void PoisonPtr(void *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint8_t *ptr = (uint8_t *) v + 3;\n    *ptr = JS_FREE_PATTERN;\n#endif\n}\n\ntemplate <typename T>\ninline bool IsPoisonedPtr(T *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint32_t mask = uintptr_t(v) & 0xff000000;\n    return mask == uint32_t(JS_FREE_PATTERN << 24);\n#else\n    return false;\n#endif\n}\n\n}\n\n/* sixgill annotation defines */\n#ifndef HAVE_STATIC_ANNOTATIONS\n# define HAVE_STATIC_ANNOTATIONS\n# ifdef XGILL_PLUGIN\n#  define STATIC_PRECONDITION(COND)         __attribute__((precondition(#COND)))\n#  define STATIC_PRECONDITION_ASSUME(COND)  __attribute__((precondition_assume(#COND)))\n#  define STATIC_POSTCONDITION(COND)        __attribute__((postcondition(#COND)))\n#  define STATIC_POSTCONDITION_ASSUME(COND) __attribute__((postcondition_assume(#COND)))\n#  define STATIC_INVARIANT(COND)            __attribute__((invariant(#COND)))\n#  define STATIC_INVARIANT_ASSUME(COND)     __attribute__((invariant_assume(#COND)))\n#  define STATIC_PASTE2(X,Y) X ## Y\n#  define STATIC_PASTE1(X,Y) STATIC_PASTE2(X,Y)\n#  define STATIC_ASSERT(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assert_static(#COND), unused))    \\\n    int STATIC_PASTE1(assert_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSUME(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assume_static(#COND), unused))    \\\n    int STATIC_PASTE1(assume_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)                       \\\n  JS_BEGIN_MACRO                                            \\\n    __attribute__((assert_static_runtime(#COND), unused))   \\\n    int STATIC_PASTE1(assert_static_runtime_, __COUNTER__); \\\n  JS_END_MACRO\n# else /* XGILL_PLUGIN */\n#  define STATIC_PRECONDITION(COND)          /* nothing */\n#  define STATIC_PRECONDITION_ASSUME(COND)   /* nothing */\n#  define STATIC_POSTCONDITION(COND)         /* nothing */\n#  define STATIC_POSTCONDITION_ASSUME(COND)  /* nothing */\n#  define STATIC_INVARIANT(COND)             /* nothing */\n#  define STATIC_INVARIANT_ASSUME(COND)      /* nothing */\n#  define STATIC_ASSERT(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSUME(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)  JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n# endif /* XGILL_PLUGIN */\n# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())\n#endif /* HAVE_STATIC_ANNOTATIONS */\n\n#endif /* js_Utility_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/Value.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Value implementation. */\n\n#ifndef js_Value_h\n#define js_Value_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/Likely.h\"\n\n#include <limits> /* for std::numeric_limits */\n\n#include \"js/Anchor.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n\nnamespace JS { class Value; }\n\n/* JS::Value can store a full int32_t. */\n#define JSVAL_INT_BITS          32\n#define JSVAL_INT_MIN           ((int32_t)0x80000000)\n#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)\n\n/*\n * Try to get jsvals 64-bit aligned. We could almost assert that all values are\n * aligned, but MSVC and GCC occasionally break alignment.\n */\n#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__)\n# define JSVAL_ALIGNMENT        __attribute__((aligned (8)))\n#elif defined(_MSC_VER)\n  /*\n   * Structs can be aligned with MSVC, but not if they are used as parameters,\n   * so we just don't try to align.\n   */\n# define JSVAL_ALIGNMENT\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n# define JSVAL_ALIGNMENT\n#elif defined(__HP_cc) || defined(__HP_aCC)\n# define JSVAL_ALIGNMENT\n#endif\n\n#if JS_BITS_PER_WORD == 64\n# define JSVAL_TAG_SHIFT 47\n#endif\n\n/*\n * We try to use enums so that printing a jsval_layout in the debugger shows\n * nice symbolic type tags, however we can only do this when we can force the\n * underlying type of the enum to be the desired size.\n */\n#if !defined(__SUNPRO_CC) && !defined(__xlC__)\n\n#if defined(_MSC_VER)\n# define JS_ENUM_HEADER(id, type)              enum id : type\n# define JS_ENUM_FOOTER(id)\n#else\n# define JS_ENUM_HEADER(id, type)              enum id\n# define JS_ENUM_FOOTER(id)                    __attribute__((packed))\n#endif\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueType, uint8_t)\n{\n    JSVAL_TYPE_DOUBLE              = 0x00,\n    JSVAL_TYPE_INT32               = 0x01,\n    JSVAL_TYPE_UNDEFINED           = 0x02,\n    JSVAL_TYPE_BOOLEAN             = 0x03,\n    JSVAL_TYPE_MAGIC               = 0x04,\n    JSVAL_TYPE_STRING              = 0x05,\n    JSVAL_TYPE_NULL                = 0x06,\n    JSVAL_TYPE_OBJECT              = 0x07,\n\n    /* These never appear in a jsval; they are only provided as an out-of-band value. */\n    JSVAL_TYPE_UNKNOWN             = 0x20,\n    JSVAL_TYPE_MISSING             = 0x21\n} JS_ENUM_FOOTER(JSValueType);\n\nJS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n\n#if JS_BITS_PER_WORD == 32\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_CLEAR                = 0xFFFFFF80,\n    JSVAL_TAG_INT32                = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n\n#elif JS_BITS_PER_WORD == 64\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_MAX_DOUBLE           = 0x1FFF0,\n    JSVAL_TAG_INT32                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32_t));\n\nJS_ENUM_HEADER(JSValueShiftedTag, uint64_t)\n{\n    JSVAL_SHIFTED_TAG_MAX_DOUBLE   = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),\n    JSVAL_SHIFTED_TAG_INT32        = (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_UNDEFINED    = (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_STRING       = (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_BOOLEAN      = (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_MAGIC        = (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_NULL         = (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_OBJECT       = (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n} JS_ENUM_FOOTER(JSValueShiftedTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t));\n\n#endif\n\n#else  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\ntypedef uint8_t JSValueType;\n#define JSVAL_TYPE_DOUBLE            ((uint8_t)0x00)\n#define JSVAL_TYPE_INT32             ((uint8_t)0x01)\n#define JSVAL_TYPE_UNDEFINED         ((uint8_t)0x02)\n#define JSVAL_TYPE_BOOLEAN           ((uint8_t)0x03)\n#define JSVAL_TYPE_MAGIC             ((uint8_t)0x04)\n#define JSVAL_TYPE_STRING            ((uint8_t)0x05)\n#define JSVAL_TYPE_NULL              ((uint8_t)0x06)\n#define JSVAL_TYPE_OBJECT            ((uint8_t)0x07)\n#define JSVAL_TYPE_UNKNOWN           ((uint8_t)0x20)\n\n#if JS_BITS_PER_WORD == 32\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_CLEAR              ((uint32_t)(0xFFFFFF80))\n#define JSVAL_TAG_INT32              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32))\n#define JSVAL_TAG_UNDEFINED          ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED))\n#define JSVAL_TAG_STRING             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING))\n#define JSVAL_TAG_BOOLEAN            ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN))\n#define JSVAL_TAG_MAGIC              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC))\n#define JSVAL_TAG_NULL               ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL))\n#define JSVAL_TAG_OBJECT             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT))\n\n#elif JS_BITS_PER_WORD == 64\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_MAX_DOUBLE         ((uint32_t)(0x1FFF0))\n#define JSVAL_TAG_INT32              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32)\n#define JSVAL_TAG_UNDEFINED          (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED)\n#define JSVAL_TAG_STRING             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING)\n#define JSVAL_TAG_BOOLEAN            (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN)\n#define JSVAL_TAG_MAGIC              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC)\n#define JSVAL_TAG_NULL               (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL)\n#define JSVAL_TAG_OBJECT             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT)\n\ntypedef uint64_t JSValueShiftedTag;\n#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF)\n#define JSVAL_SHIFTED_TAG_INT32      (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_UNDEFINED  (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_STRING     (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_BOOLEAN    (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_MAGIC      (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_NULL       (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_OBJECT     (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n\n#endif  /* JS_BITS_PER_WORD */\n#endif  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\n#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET        JSVAL_TYPE_NULL\n#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET          JSVAL_TYPE_OBJECT\n#define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET             JSVAL_TYPE_INT32\n#define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET        JSVAL_TYPE_MAGIC\n\n#if JS_BITS_PER_WORD == 32\n\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_CLEAR | (type)))\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#elif JS_BITS_PER_WORD == 64\n\n#define JSVAL_PAYLOAD_MASK           0x00007FFFFFFFFFFFLL\n#define JSVAL_TAG_MASK               0xFFFF800000000000LL\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))\n#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET  JSVAL_SHIFTED_TAG_NULL\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET    JSVAL_SHIFTED_TAG_OBJECT\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET       JSVAL_SHIFTED_TAG_UNDEFINED\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET      JSVAL_SHIFTED_TAG_STRING\n\n#endif /* JS_BITS_PER_WORD */\n\ntypedef enum JSWhyMagic\n{\n    JS_ELEMENTS_HOLE,            /* a hole in a native object's elements */\n    JS_NATIVE_ENUMERATE,         /* indicates that a custom enumerate hook forwarded\n                                  * to JS_EnumerateState, which really means the object can be\n                                  * enumerated like a native object. */\n    JS_NO_ITER_VALUE,            /* there is not a pending iterator value */\n    JS_GENERATOR_CLOSING,        /* exception value thrown when closing a generator */\n    JS_NO_CONSTANT,              /* compiler sentinel value */\n    JS_THIS_POISON,              /* used in debug builds to catch tracing errors */\n    JS_ARG_POISON,               /* used in debug builds to catch tracing errors */\n    JS_SERIALIZE_NO_NODE,        /* an empty subnode in the AST serializer */\n    JS_LAZY_ARGUMENTS,           /* lazy arguments value on the stack */\n    JS_OPTIMIZED_ARGUMENTS,      /* optimized-away 'arguments' value */\n    JS_IS_CONSTRUCTING,          /* magic value passed to natives to indicate construction */\n    JS_OVERWRITTEN_CALLEE,       /* arguments.callee has been overwritten */\n    JS_FORWARD_TO_CALL_OBJECT,   /* args object element stored in call object */\n    JS_BLOCK_NEEDS_CLONE,        /* value of static block object slot */\n    JS_HASH_KEY_EMPTY,           /* see class js::HashableValue */\n    JS_ION_ERROR,                /* error while running Ion code */\n    JS_ION_BAILOUT,              /* status code to signal EnterIon will OSR into Interpret */\n    JS_GENERIC_MAGIC             /* for local use */\n} JSWhyMagic;\n\n#if defined(IS_LITTLE_ENDIAN)\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n        JSValueTag tag;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n#if !defined(_WIN64)\n    /* MSVC does not pack these correctly :-( */\n    struct {\n        uint64_t           payload47 : 47;\n        JSValueTag         tag : 17;\n    } debugView;\n#endif\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif  /* JS_BITS_PER_WORD */\n#else   /* defined(IS_LITTLE_ENDIAN) */\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag tag;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag         tag : 17;\n        uint64_t           payload47 : 47;\n    } debugView;\n    struct {\n        uint32_t           padding;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif /* JS_BITS_PER_WORD */\n#endif  /* defined(IS_LITTLE_ENDIAN) */\n\nJS_STATIC_ASSERT(sizeof(jsval_layout) == 8);\n\n#if JS_BITS_PER_WORD == 32\n\n/*\n * N.B. GCC, in some but not all cases, chooses to emit signed comparison of\n * JSValueTag even though its underlying type has been forced to be uint32_t.\n * Thus, all comparisons should explicitly cast operands to uint32_t.\n */\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint32_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return l.s.payload.i32;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_INT32;\n    l.s.payload.i32 = i;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    JSValueTag tag = l.s.tag;\n    MOZ_ASSERT(tag != JSVAL_TAG_CLEAR);\n    return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    MOZ_ASSERT(str);\n    l.s.tag = JSVAL_TAG_STRING;\n    l.s.payload.str = str;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return l.s.payload.str;\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.payload.boo;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.s.tag = JSVAL_TAG_BOOLEAN;\n    l.s.payload.boo = b;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT);\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.payload.obj;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    MOZ_ASSERT(obj);\n    l.s.tag = JSVAL_TAG_OBJECT;\n    l.s.payload.obj = obj;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_NULL;\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    MOZ_ASSERT(((uint32_t)ptr & 1) == 0);\n    l.s.tag = (JSValueTag)0;\n    l.s.payload.ptr = ptr;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    /* gcc sometimes generates signed < without explicit casts. */\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_MAGIC;\n    l.s.payload.why = why;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag;\n    return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n    uint32_t type = l.s.tag & 0xF;\n    MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n    return (JSValueType)type;\n}\n\n#elif JS_BITS_PER_WORD == 64\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint64_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE);\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return (int32_t)l.asBits;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i32)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    uint64_t strBits = (uint64_t)str;\n    MOZ_ASSERT(str);\n    MOZ_ASSERT((strBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = strBits | JSVAL_SHIFTED_TAG_STRING;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK);\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (JSBool)l.asBits;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT);\n    return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT);\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (JSObject *)ptrBits;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    uint64_t objBits = (uint64_t)obj;\n    MOZ_ASSERT(obj);\n    MOZ_ASSERT((objBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = objBits | JSVAL_SHIFTED_TAG_OBJECT;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_NULL;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (void *)ptrBits;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l);\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l));\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    uint64_t ptrBits = (uint64_t)ptr;\n    MOZ_ASSERT((ptrBits & 1) == 0);\n    l.asBits = ptrBits >> 1;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0);\n    return (void *)(l.asBits << 1);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)why) | JSVAL_SHIFTED_TAG_MAGIC;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    uint64_t lbits = lhs.asBits, rbits = rhs.asBits;\n    return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) ||\n           (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n   uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF;\n   MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n   return (JSValueType)type;\n}\n\n#endif  /* JS_BITS_PER_WORD */\n\nstatic inline jsval_layout JSVAL_TO_IMPL(JS::Value v);\nstatic inline JS::Value IMPL_TO_JSVAL(jsval_layout l);\n\nnamespace JS {\n\n/**\n * Returns a generic quiet NaN value, with all payload bits set to zero.\n *\n * Among other properties, this NaN's bit pattern conforms to JS::Value's\n * bit pattern restrictions.\n */\nstatic MOZ_ALWAYS_INLINE double\nGenericNaN()\n{\n    return mozilla::SpecificNaN(0, 0x8000000000000ULL);\n}\n\nstatic inline double\nCanonicalizeNaN(double d)\n{\n    if (MOZ_UNLIKELY(mozilla::IsNaN(d)))\n        return GenericNaN();\n    return d;\n}\n\n/*\n * JS::Value is the interface for a single JavaScript Engine value.  A few\n * general notes on JS::Value:\n *\n * - JS::Value has setX() and isX() members for X in\n *\n *     { Int32, Double, String, Boolean, Undefined, Null, Object, Magic }\n *\n *   JS::Value also contains toX() for each of the non-singleton types.\n *\n * - Magic is a singleton type whose payload contains a JSWhyMagic \"reason\" for\n *   the magic value. By providing JSWhyMagic values when creating and checking\n *   for magic values, it is possible to assert, at runtime, that only magic\n *   values with the expected reason flow through a particular value. For\n *   example, if cx->exception has a magic value, the reason must be\n *   JS_GENERATOR_CLOSING.\n *\n * - The JS::Value operations are preferred.  The JSVAL_* operations remain for\n *   compatibility; they may be removed at some point.  These operations mostly\n *   provide similar functionality.  But there are a few key differences.  One\n *   is that JS::Value gives null a separate type. Thus\n *\n *           JSVAL_IS_OBJECT(v) === v.isObjectOrNull()\n *       !JSVAL_IS_PRIMITIVE(v) === v.isObject()\n *\n *   Also, to help prevent mistakenly boxing a nullable JSObject* as an object,\n *   Value::setObject takes a JSObject&. (Conversely, Value::asObject returns a\n *   JSObject&.)  A convenience member Value::setObjectOrNull is provided.\n *\n * - JSVAL_VOID is the same as the singleton value of the Undefined type.\n *\n * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on\n *   32-bit user code should avoid copying jsval/JS::Value as much as possible,\n *   preferring to pass by const Value &.\n */\nclass Value\n{\n  public:\n    /*\n     * N.B. the default constructor leaves Value unitialized. Adding a default\n     * constructor prevents Value from being stored in a union.\n     */\n\n    /*** Mutators ***/\n\n    void setNull() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;\n    }\n\n    void setUndefined() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;\n    }\n\n    void setInt32(int32_t i) {\n        data = INT32_TO_JSVAL_IMPL(i);\n    }\n\n    int32_t &getInt32Ref() {\n        MOZ_ASSERT(isInt32());\n        return data.s.payload.i32;\n    }\n\n    void setDouble(double d) {\n        data = DOUBLE_TO_JSVAL_IMPL(d);\n    }\n\n    double &getDoubleRef() {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    void setString(JSString *str) {\n        MOZ_ASSERT(!IsPoisonedPtr(str));\n        data = STRING_TO_JSVAL_IMPL(str);\n    }\n\n    void setString(const JS::Anchor<JSString *> &str) {\n        setString(str.get());\n    }\n\n    void setObject(JSObject &obj) {\n        MOZ_ASSERT(!IsPoisonedPtr(&obj));\n        data = OBJECT_TO_JSVAL_IMPL(&obj);\n    }\n\n    void setBoolean(bool b) {\n        data = BOOLEAN_TO_JSVAL_IMPL(b);\n    }\n\n    void setMagic(JSWhyMagic why) {\n        data = MAGIC_TO_JSVAL_IMPL(why);\n    }\n\n    bool setNumber(uint32_t ui) {\n        if (ui > JSVAL_INT_MAX) {\n            setDouble((double)ui);\n            return false;\n        } else {\n            setInt32((int32_t)ui);\n            return true;\n        }\n    }\n\n    bool setNumber(double d) {\n        int32_t i;\n        if (mozilla::DoubleIsInt32(d, &i)) {\n            setInt32(i);\n            return true;\n        }\n\n        setDouble(d);\n        return false;\n    }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n\n    void swap(Value &rhs) {\n        uint64_t tmp = rhs.data.asBits;\n        rhs.data.asBits = data.asBits;\n        data.asBits = tmp;\n    }\n\n    /*** Value type queries ***/\n\n    bool isUndefined() const {\n        return JSVAL_IS_UNDEFINED_IMPL(data);\n    }\n\n    bool isNull() const {\n        return JSVAL_IS_NULL_IMPL(data);\n    }\n\n    bool isNullOrUndefined() const {\n        return isNull() || isUndefined();\n    }\n\n    bool isInt32() const {\n        return JSVAL_IS_INT32_IMPL(data);\n    }\n\n    bool isInt32(int32_t i32) const {\n        return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);\n    }\n\n    bool isDouble() const {\n        return JSVAL_IS_DOUBLE_IMPL(data);\n    }\n\n    bool isNumber() const {\n        return JSVAL_IS_NUMBER_IMPL(data);\n    }\n\n    bool isString() const {\n        return JSVAL_IS_STRING_IMPL(data);\n    }\n\n    bool isObject() const {\n        return JSVAL_IS_OBJECT_IMPL(data);\n    }\n\n    bool isPrimitive() const {\n        return JSVAL_IS_PRIMITIVE_IMPL(data);\n    }\n\n    bool isObjectOrNull() const {\n        return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);\n    }\n\n    bool isGCThing() const {\n        return JSVAL_IS_GCTHING_IMPL(data);\n    }\n\n    bool isBoolean() const {\n        return JSVAL_IS_BOOLEAN_IMPL(data);\n    }\n\n    bool isTrue() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, true);\n    }\n\n    bool isFalse() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, false);\n    }\n\n    bool isMagic() const {\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMagic(JSWhyMagic why) const {\n        MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMarkable() const {\n        return JSVAL_IS_TRACEABLE_IMPL(data);\n    }\n\n    JSGCTraceKind gcKind() const {\n        MOZ_ASSERT(isMarkable());\n        return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));\n    }\n\n    JSWhyMagic whyMagic() const {\n        MOZ_ASSERT(isMagic());\n        return data.s.payload.why;\n    }\n\n    /*** Comparison ***/\n\n    bool operator==(const Value &rhs) const {\n        return data.asBits == rhs.data.asBits;\n    }\n\n    bool operator!=(const Value &rhs) const {\n        return data.asBits != rhs.data.asBits;\n    }\n\n    friend inline bool SameType(const Value &lhs, const Value &rhs);\n\n    /*** Extract the value's typed payload ***/\n\n    int32_t toInt32() const {\n        MOZ_ASSERT(isInt32());\n        return JSVAL_TO_INT32_IMPL(data);\n    }\n\n    double toDouble() const {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    double toNumber() const {\n        MOZ_ASSERT(isNumber());\n        return isDouble() ? toDouble() : double(toInt32());\n    }\n\n    JSString *toString() const {\n        MOZ_ASSERT(isString());\n        return JSVAL_TO_STRING_IMPL(data);\n    }\n\n    JSObject &toObject() const {\n        MOZ_ASSERT(isObject());\n        return *JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    JSObject *toObjectOrNull() const {\n        MOZ_ASSERT(isObjectOrNull());\n        return JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    void *toGCThing() const {\n        MOZ_ASSERT(isGCThing());\n        return JSVAL_TO_GCTHING_IMPL(data);\n    }\n\n    bool toBoolean() const {\n        MOZ_ASSERT(isBoolean());\n        return JSVAL_TO_BOOLEAN_IMPL(data);\n    }\n\n    uint32_t payloadAsRawUint32() const {\n        MOZ_ASSERT(!isDouble());\n        return data.s.payload.u32;\n    }\n\n    uint64_t asRawBits() const {\n        return data.asBits;\n    }\n\n    JSValueType extractNonDoubleType() const {\n        return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data);\n    }\n\n    /*\n     * Private API\n     *\n     * Private setters/getters allow the caller to read/write arbitrary types\n     * that fit in the 64-bit payload. It is the caller's responsibility, after\n     * storing to a value with setPrivateX to read only using getPrivateX.\n     * Privates values are given a type which ensures they are not marked.\n     */\n\n    void setPrivate(void *ptr) {\n        data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);\n    }\n\n    void *toPrivate() const {\n        MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));\n        return JSVAL_TO_PRIVATE_PTR_IMPL(data);\n    }\n\n    void setPrivateUint32(uint32_t ui) {\n        MOZ_ASSERT(uint32_t(int32_t(ui)) == ui);\n        setInt32(int32_t(ui));\n    }\n\n    uint32_t toPrivateUint32() const {\n        return uint32_t(toInt32());\n    }\n\n    /*\n     * An unmarked value is just a void* cast as a Value. Thus, the Value is\n     * not safe for GC and must not be marked. This API avoids raw casts\n     * and the ensuing strict-aliasing warnings.\n     */\n\n    void setUnmarkedPtr(void *ptr) {\n        data.asPtr = ptr;\n    }\n\n    void *toUnmarkedPtr() const {\n        return data.asPtr;\n    }\n\n    const size_t *payloadWord() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.word;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asWord;\n#endif\n    }\n\n    const uintptr_t *payloadUIntPtr() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.uintptr;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asUIntPtr;\n#endif\n    }\n\n#if !defined(_MSC_VER) && !defined(__sparc)\n  // Value must be POD so that MSVC will pass it by value and not in memory\n  // (bug 689101); the same is true for SPARC as well (bug 737344).  More\n  // precisely, we don't want Value return values compiled as out params.\n  private:\n#endif\n\n    jsval_layout data;\n\n  private:\n    void staticAssertions() {\n        JS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n        JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n        JS_STATIC_ASSERT(sizeof(JSBool) == 4);\n        JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4);\n        JS_STATIC_ASSERT(sizeof(Value) == 8);\n    }\n\n    friend jsval_layout (::JSVAL_TO_IMPL)(Value);\n    friend Value (::IMPL_TO_JSVAL)(jsval_layout l);\n};\n\ninline bool\nIsPoisonedValue(const Value &v)\n{\n    if (v.isString())\n        return IsPoisonedPtr(v.toString());\n    if (v.isObject())\n        return IsPoisonedPtr(&v.toObject());\n    return false;\n}\n\n/************************************************************************/\n\nstatic inline Value\nNullValue()\n{\n    Value v;\n    v.setNull();\n    return v;\n}\n\nstatic inline Value\nUndefinedValue()\n{\n    Value v;\n    v.setUndefined();\n    return v;\n}\n\nstatic inline Value\nInt32Value(int32_t i32)\n{\n    Value v;\n    v.setInt32(i32);\n    return v;\n}\n\nstatic inline Value\nDoubleValue(double dbl)\n{\n    Value v;\n    v.setDouble(dbl);\n    return v;\n}\n\nstatic inline Value\nStringValue(JSString *str)\n{\n    Value v;\n    v.setString(str);\n    return v;\n}\n\nstatic inline Value\nBooleanValue(bool boo)\n{\n    Value v;\n    v.setBoolean(boo);\n    return v;\n}\n\nstatic inline Value\nObjectValue(JSObject &obj)\n{\n    Value v;\n    v.setObject(obj);\n    return v;\n}\n\nstatic inline Value\nObjectValueCrashOnTouch()\n{\n    Value v;\n    v.setObject(*reinterpret_cast<JSObject *>(0x42));\n    return v;\n}\n\nstatic inline Value\nMagicValue(JSWhyMagic why)\n{\n    Value v;\n    v.setMagic(why);\n    return v;\n}\n\nstatic inline Value\nNumberValue(float f)\n{\n    Value v;\n    v.setNumber(f);\n    return v;\n}\n\nstatic inline Value\nNumberValue(double dbl)\n{\n    Value v;\n    v.setNumber(dbl);\n    return v;\n}\n\nstatic inline Value\nNumberValue(int8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int32_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint32_t i)\n{\n    Value v;\n    v.setNumber(i);\n    return v;\n}\n\nnamespace detail {\n\ntemplate <bool Signed>\nclass MakeNumberValue\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (JSVAL_INT_MIN <= t && t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\ntemplate <>\nclass MakeNumberValue<false>\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\n} // namespace detail\n\ntemplate <typename T>\nstatic inline Value\nNumberValue(const T t)\n{\n    MOZ_ASSERT(T(double(t)) == t, \"value creation would be lossy\");\n    return detail::MakeNumberValue<std::numeric_limits<T>::is_signed>::create(t);\n}\n\nstatic inline Value\nObjectOrNullValue(JSObject *obj)\n{\n    Value v;\n    v.setObjectOrNull(obj);\n    return v;\n}\n\nstatic inline Value\nPrivateValue(void *ptr)\n{\n    Value v;\n    v.setPrivate(ptr);\n    return v;\n}\n\nstatic inline Value\nPrivateUint32Value(uint32_t ui)\n{\n    Value v;\n    v.setPrivateUint32(ui);\n    return v;\n}\n\ninline bool\nSameType(const Value &lhs, const Value &rhs)\n{\n    return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);\n}\n\n} // namespace JS\n\n/************************************************************************/\n\n#ifdef JSGC_GENERATIONAL\nnamespace JS {\nJS_PUBLIC_API(void) HeapValuePostBarrier(Value *valuep);\nJS_PUBLIC_API(void) HeapValueRelocate(Value *valuep);\n}\n#endif\n\nnamespace js {\n\ntemplate <> struct GCMethods<const JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n};\n\ntemplate <> struct GCMethods<JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n    static bool needsPostBarrier(const JS::Value &v) { return v.isMarkable(); }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }\n    static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }\n#endif\n};\n\ntemplate <class Outer> class UnbarrieredMutableValueOperations;\ntemplate <class Outer> class MutableValueOperations;\n\n/*\n * A class designed for CRTP use in implementing the non-mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * ValueOperations<Outer> with a visible extract() method returning the\n * const Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass ValueOperations\n{\n    friend class UnbarrieredMutableValueOperations<Outer>;\n    friend class MutableValueOperations<Outer>;\n\n    const JS::Value * value() const { return static_cast<const Outer*>(this)->extract(); }\n\n  public:\n    bool isUndefined() const { return value()->isUndefined(); }\n    bool isNull() const { return value()->isNull(); }\n    bool isBoolean() const { return value()->isBoolean(); }\n    bool isTrue() const { return value()->isTrue(); }\n    bool isFalse() const { return value()->isFalse(); }\n    bool isNumber() const { return value()->isNumber(); }\n    bool isInt32() const { return value()->isInt32(); }\n    bool isDouble() const { return value()->isDouble(); }\n    bool isString() const { return value()->isString(); }\n    bool isObject() const { return value()->isObject(); }\n    bool isMagic() const { return value()->isMagic(); }\n    bool isMagic(JSWhyMagic why) const { return value()->isMagic(why); }\n    bool isMarkable() const { return value()->isMarkable(); }\n    bool isPrimitive() const { return value()->isPrimitive(); }\n    bool isGCThing() const { return value()->isGCThing(); }\n\n    bool isNullOrUndefined() const { return value()->isNullOrUndefined(); }\n    bool isObjectOrNull() const { return value()->isObjectOrNull(); }\n\n    bool toBoolean() const { return value()->toBoolean(); }\n    double toNumber() const { return value()->toNumber(); }\n    int32_t toInt32() const { return value()->toInt32(); }\n    double toDouble() const { return value()->toDouble(); }\n    JSString *toString() const { return value()->toString(); }\n    JSObject &toObject() const { return value()->toObject(); }\n    JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); }\n    void *toGCThing() const { return value()->toGCThing(); }\n\n    JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); }\n    uint32_t toPrivateUint32() const { return value()->toPrivateUint32(); }\n\n    JSWhyMagic whyMagic() const { return value()->whyMagic(); }\n};\n\n/*\n * A class designed for CRTP use in implementing the mutating parts of the Value\n * interface in Value-like classes that don't need post barriers.  Outer must be\n * a class inheriting UnbarrieredMutableValueOperations<Outer> with visible\n * extractMutable() and extract() methods returning the const Value* and Value*\n * abstracted by Outer.\n */\ntemplate <class Outer>\nclass UnbarrieredMutableValueOperations : public ValueOperations<Outer>\n{\n    friend class MutableValueOperations<Outer>;\n    JS::Value * value() { return static_cast<Outer*>(this)->extractMutable(); }\n\n  public:\n    void setNull() { value()->setNull(); }\n    void setUndefined() { value()->setUndefined(); }\n    void setInt32(int32_t i) { value()->setInt32(i); }\n    void setDouble(double d) { value()->setDouble(d); }\n    void setBoolean(bool b) { value()->setBoolean(b); }\n    void setMagic(JSWhyMagic why) { value()->setMagic(why); }\n    bool setNumber(uint32_t ui) { return value()->setNumber(ui); }\n    bool setNumber(double d) { return value()->setNumber(d); }\n};\n\n/*\n * A class designed for CRTP use in implementing all the mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * MutableValueOperations<Outer> with visible extractMutable() and extract()\n * methods returning the const Value* and Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass MutableValueOperations : public UnbarrieredMutableValueOperations<Outer>\n{\n  public:\n    void setString(JSString *str) { this->value()->setString(str); }\n    void setString(const JS::Anchor<JSString *> &str) { this->value()->setString(str); }\n    void setObject(JSObject &obj) { this->value()->setObject(obj); }\n    void setObjectOrNull(JSObject *arg) { this->value()->setObjectOrNull(arg); }\n};\n\n/*\n * Augment the generic Heap<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass HeapBase<JS::Value> : public UnbarrieredMutableValueOperations<JS::Heap<JS::Value> >\n{\n    typedef JS::Heap<JS::Value> Outer;\n\n    friend class ValueOperations<Outer>;\n    friend class UnbarrieredMutableValueOperations<Outer>;\n\n    const JS::Value * extract() const { return static_cast<const Outer*>(this)->address(); }\n    JS::Value * extractMutable() { return static_cast<Outer*>(this)->unsafeGet(); }\n\n    /*\n     * Setters that potentially change the value to a GC thing from a non-GC\n     * thing must call JS::Heap::set() to trigger the post barrier.\n     *\n     * Changing from a GC thing to a non-GC thing value will leave the heap\n     * value in the store buffer, but it will be ingored so this is not a\n     * problem.\n     */\n    void setBarriered(const JS::Value &v) {\n        static_cast<JS::Heap<JS::Value> *>(this)->set(v);\n    }\n\n  public:\n    void setString(JSString *str) { setBarriered(JS::StringValue(str)); }\n    void setString(const JS::Anchor<JSString *> &str) { setBarriered(JS::StringValue(str.get())); }\n    void setObject(JSObject &obj) { setBarriered(JS::ObjectValue(obj)); }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n};\n\n/*\n * Augment the generic Handle<T> interface when T = Value with type-querying\n * and value-extracting operations.\n */\ntemplate <>\nclass HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> >\n{\n    friend class ValueOperations<JS::Handle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Handle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic MutableHandle<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass MutableHandleBase<JS::Value> : public MutableValueOperations<JS::MutableHandle<JS::Value> >\n{\n    friend class ValueOperations<JS::MutableHandle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::MutableHandle<JS::Value> >;\n    friend class MutableValueOperations<JS::MutableHandle<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic Rooted<T> interface when T = Value with type-querying,\n * value-extracting, and mutating operations.\n */\ntemplate <>\nclass RootedBase<JS::Value> : public MutableValueOperations<JS::Rooted<JS::Value> >\n{\n    friend class ValueOperations<JS::Rooted<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Rooted<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::Rooted<JS::Value> >;\n    friend class MutableValueOperations<JS::Rooted<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::Rooted<JS::Value>*>(this)->address();\n    }\n};\n\n} // namespace js\n\ninline jsval_layout\nJSVAL_TO_IMPL(JS::Value v)\n{\n    return v.data;\n}\n\ninline JS::Value\nIMPL_TO_JSVAL(jsval_layout l)\n{\n    JS::Value v;\n    v.data = l;\n    return v;\n}\n\nnamespace JS {\n\n#ifndef __GNUC__\n/*\n * The default assignment operator for |struct C| has the signature:\n *\n *   C& C::operator=(const C&)\n *\n * And in particular requires implicit conversion of |this| to type |C| for the\n * return value. But |volatile C| cannot thus be converted to |C|, so just\n * doing |sink = hold| as in the non-specialized version would fail to compile.\n * Do the assignment on asBits instead, since I don't think we want to give\n * jsval_layout an assignment operator returning |volatile jsval_layout|.\n */\ntemplate<>\ninline Anchor<Value>::~Anchor()\n{\n    volatile uint64_t bits;\n    bits = JSVAL_TO_IMPL(hold).asBits;\n}\n#endif\n\n#ifdef DEBUG\nnamespace detail {\n\nstruct ValueAlignmentTester { char c; JS::Value v; };\nstatic_assert(sizeof(ValueAlignmentTester) == 16,\n              \"JS::Value must be 16-byte-aligned\");\n\nstruct LayoutAlignmentTester { char c; jsval_layout l; };\nstatic_assert(sizeof(LayoutAlignmentTester) == 16,\n              \"jsval_layout must be 16-byte-aligned\");\n\n} // namespace detail\n#endif /* DEBUG */\n\n} // namespace JS\n\n/*\n * JS::Value and jsval are the same type; jsval is the old name, kept around\n * for backwards compatibility along with all the JSVAL_* operations below.\n * jsval_layout is an implementation detail and should not be used externally.\n */\ntypedef JS::Value jsval;\n\nstatic_assert(sizeof(jsval_layout) == sizeof(JS::Value),\n              \"jsval_layout and JS::Value must have identical layouts\");\n\n/************************************************************************/\n\nstatic inline JSBool\nJSVAL_IS_NULL(jsval v)\n{\n    return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_VOID(jsval v)\n{\n    return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_INT(jsval v)\n{\n    return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline int32_t\nJSVAL_TO_INT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_INT(v));\n    return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nINT_TO_JSVAL(int32_t i)\n{\n    return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE(jsval v)\n{\n    return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline double\nJSVAL_TO_DOUBLE(jsval v)\n{\n    jsval_layout l;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    l = JSVAL_TO_IMPL(v);\n    return l.asDouble;\n}\n\nstatic inline jsval\nDOUBLE_TO_JSVAL(double d)\n{\n    /*\n     * This is a manually inlined version of:\n     *    d = JS_CANONICALIZE_NAN(d);\n     *    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));\n     * because GCC from XCode 3.1.4 miscompiles the above code.\n     */\n    jsval_layout l;\n    if (MOZ_UNLIKELY(d != d))\n        l.asBits = 0x7FF8000000000000LL;\n    else\n        l.asDouble = d;\n    return IMPL_TO_JSVAL(l);\n}\n\nstatic inline jsval\nUINT_TO_JSVAL(uint32_t i)\n{\n    if (i <= JSVAL_INT_MAX)\n        return INT_TO_JSVAL((int32_t)i);\n    return DOUBLE_TO_JSVAL((double)i);\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER(jsval v)\n{\n    return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING(jsval v)\n{\n    return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_STRING(v));\n    return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nSTRING_TO_JSVAL(JSString *str)\n{\n    return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str));\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v)));\n    return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nOBJECT_TO_JSVAL(JSObject *obj)\n{\n    if (obj)\n        return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj));\n    return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0));\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN(jsval v)\n{\n    return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_BOOLEAN(v));\n    return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nBOOLEAN_TO_JSVAL(JSBool b)\n{\n    return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE(jsval v)\n{\n    return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING(jsval v)\n{\n    return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_GCTHING(v));\n    return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/* To be GC-safe, privates are tagged as doubles. */\n\nstatic inline jsval\nPRIVATE_TO_JSVAL(void *ptr)\n{\n    return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));\n}\n\n#endif /* js_Value_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Vector_h\n#define js_Vector_h\n\n#include \"mozilla/Vector.h\"\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace js {\n\nclass TempAllocPolicy;\n\n// If we had C++11 template aliases, we could just use this:\n//\n//   template <typename T,\n//             size_t MinInlineCapacity = 0,\n//             class AllocPolicy = TempAllocPolicy>\n//   using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;\n//\n// ...and get rid of all the CRTP madness in mozilla::Vector(Base).  But we\n// can't because compiler support's not up to snuff.  (Template aliases are in\n// gcc 4.7 and clang 3.0 and are expected to be in MSVC 2013.)  Instead, have a\n// completely separate class inheriting from mozilla::Vector, and throw CRTP at\n// the problem til things work.\n//\n// This workaround presents a couple issues.  First, because js::Vector is a\n// distinct type from mozilla::Vector, overload resolution, method calls, etc.\n// are affected.  *Hopefully* this won't be too bad in practice.  (A bunch of\n// places had to be fixed when mozilla::Vector was introduced, but it wasn't a\n// crazy number.)  Second, mozilla::Vector's interface has to be made subclass-\n// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one\n// should use.  :-)  Third, we have to redefine the constructors and the non-\n// inherited operators.  Blech.  Happily there aren't too many of these, so it\n// isn't the end of the world.\n\ntemplate <typename T,\n          size_t MinInlineCapacity = 0,\n          class AllocPolicy = TempAllocPolicy>\nclass Vector\n  : public mozilla::VectorBase<T,\n                               MinInlineCapacity,\n                               AllocPolicy,\n                               Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector &operator=(mozilla::MoveRef<Vector> vec) {\n        return Base::operator=(vec);\n    }\n};\n\n} // namespace js\n\n#endif /* js_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js-config.h",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sw=4 et tw=78:\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_config_h___\n#define js_config_h___\n\n/* Definitions set at build time that affect SpiderMonkey's public API.\n   This header file is generated by the SpiderMonkey configure script,\n   and installed along with jsapi.h.  */\n\n/* Define to 1 if SpiderMonkey should support multi-threaded clients.  */\n/* #undef JS_THREADSAFE */\n\n/* Define to 1 if SpiderMonkey should include ctypes support.  */\n/* #undef JS_HAS_CTYPES */\n\n/* Define to 1 if SpiderMonkey should support the ability to perform\n   entirely too much GC.  */\n/* #undef JS_GC_ZEAL */\n\n/* Define to 1 if the <endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_ENDIAN_H */\n\n/* Define to 1 if the <machine/endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_MACHINE_ENDIAN_H */\n\n/* Define to 1 if the <sys/isa_defs.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_SYS_ISA_DEFS_H */\n\n/* The configure script defines these if it doesn't #define\n   JS_HAVE_STDINT_H.  */\n/* #undef JS_BYTES_PER_WORD */\n\n/* MOZILLA JSAPI version number components */\n#define MOZJS_MAJOR_VERSION 25\n#define MOZJS_MINOR_VERSION 0\n\n#endif /* js_config_h___ */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/js.msg",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This is the JavaScript error message file.\n *\n * The format for each JS error message is:\n *\n * MSG_DEF(<SYMBOLIC_NAME>, <ERROR_NUMBER>, <ARGUMENT_COUNT>, <EXCEPTION_NAME>,\n *         <FORMAT_STRING>)\n *\n * where ;\n * <SYMBOLIC_NAME> is a legal C identifer that will be used in the\n * JS engine source.\n *\n * <ERROR_NUMBER> is an unique integral value identifying this error.\n *\n * <ARGUMENT_COUNT> is an integer literal specifying the total number of\n * replaceable arguments in the following format string.\n *\n * <EXCEPTION_NAME> is an exception index from the enum in jsexn.c;\n * JSEXN_NONE for none.  The given exception index will be raised by the\n * engine when the corresponding error occurs.\n *\n * <FORMAT_STRING> is a string literal, optionally containing sequences\n * {X} where X  is an integer representing the argument number that will\n * be replaced with a string value when the error is reported.\n *\n * e.g.\n *\n * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 73, JSEXN_NONE, 2,\n *         \"{0} is not a member of the {1} family\")\n *\n * can be used:\n *\n * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, \"Rhino\", \"Monkey\");\n *\n * to report:\n *\n * \"Rhino is not a member of the Monkey family\"\n *\n * When removing MSG_DEFs, convert them to JSMSG_UNUSED<n> placeholders:\n *\n *    MSG_DEF(JSMSG_UNUSED7,                  7, 0, JSEXN_NONE, \"\")\n *\n * Before adding a new MSG_DEF at the end, look for existing JSMSG_UNUSED<n>\n * free index placeholders in the middle of the list.\n */\n\nMSG_DEF(JSMSG_NOT_AN_ERROR,             0, 0, JSEXN_NONE, \"<Error #0 is reserved>\")\nMSG_DEF(JSMSG_NOT_DEFINED,              1, 1, JSEXN_REFERENCEERR, \"{0} is not defined\")\nMSG_DEF(JSMSG_INACTIVE,                 2, 0, JSEXN_INTERNALERR, \"nothing active on context\")\nMSG_DEF(JSMSG_MORE_ARGS_NEEDED,         3, 3, JSEXN_TYPEERR, \"{0} requires more than {1} argument{2}\")\nMSG_DEF(JSMSG_BAD_CHAR,                 4, 1, JSEXN_INTERNALERR, \"invalid format character {0}\")\nMSG_DEF(JSMSG_BAD_TYPE,                 5, 1, JSEXN_TYPEERR, \"unknown type {0}\")\nMSG_DEF(JSMSG_ALLOC_OVERFLOW,           6, 0, JSEXN_INTERNALERR, \"allocation size overflow\")\nMSG_DEF(JSMSG_MISSING_HEXDIGITS,        7, 0, JSEXN_SYNTAXERR, \"missing hexadecimal digits after '0x'\")\nMSG_DEF(JSMSG_INCOMPATIBLE_PROTO,       8, 3, JSEXN_TYPEERR, \"{0}.prototype.{1} called on incompatible {2}\")\nMSG_DEF(JSMSG_NO_CONSTRUCTOR,           9, 1, JSEXN_TYPEERR, \"{0} has no constructor\")\nMSG_DEF(JSMSG_CANT_ALIAS,              10, 3, JSEXN_TYPEERR, \"can't alias {0} to {1} in class {2}\")\nMSG_DEF(JSMSG_NOT_SCRIPTED_FUNCTION,   11, 1, JSEXN_TYPEERR, \"{0} is not a scripted function\")\nMSG_DEF(JSMSG_BAD_SORT_ARG,            12, 0, JSEXN_TYPEERR, \"invalid Array.prototype.sort argument\")\nMSG_DEF(JSMSG_BAD_ATOMIC_NUMBER,       13, 1, JSEXN_INTERNALERR, \"internal error: no index for atom {0}\")\nMSG_DEF(JSMSG_TOO_MANY_LITERALS,       14, 0, JSEXN_INTERNALERR, \"too many literals\")\nMSG_DEF(JSMSG_CANT_WATCH,              15, 1, JSEXN_TYPEERR, \"can't watch non-native objects of class {0}\")\nMSG_DEF(JSMSG_STACK_UNDERFLOW,         16, 2, JSEXN_INTERNALERR, \"internal error compiling {0}: stack underflow at pc {1}\")\nMSG_DEF(JSMSG_NEED_DIET,               17, 1, JSEXN_INTERNALERR, \"{0} too large\")\nMSG_DEF(JSMSG_TOO_MANY_LOCAL_ROOTS,    18, 0, JSEXN_ERR, \"out of local root space\")\nMSG_DEF(JSMSG_READ_ONLY,               19, 1, JSEXN_TYPEERR, \"{0} is read-only\")\nMSG_DEF(JSMSG_BAD_FORMAL,              20, 0, JSEXN_SYNTAXERR, \"malformed formal parameter\")\nMSG_DEF(JSMSG_CANT_DELETE,             21, 1, JSEXN_TYPEERR, \"property {0} is non-configurable and can't be deleted\")\nMSG_DEF(JSMSG_NOT_FUNCTION,            22, 1, JSEXN_TYPEERR, \"{0} is not a function\")\nMSG_DEF(JSMSG_NOT_CONSTRUCTOR,         23, 1, JSEXN_TYPEERR, \"{0} is not a constructor\")\nMSG_DEF(JSMSG_INVALID_DATE,            24, 0, JSEXN_RANGEERR, \"invalid date\")\nMSG_DEF(JSMSG_TOO_DEEP,                25, 1, JSEXN_INTERNALERR, \"{0} nested too deeply\")\nMSG_DEF(JSMSG_OVER_RECURSED,           26, 0, JSEXN_INTERNALERR, \"too much recursion\")\nMSG_DEF(JSMSG_IN_NOT_OBJECT,           27, 1, JSEXN_TYPEERR, \"invalid 'in' operand {0}\")\nMSG_DEF(JSMSG_BAD_NEW_RESULT,          28, 1, JSEXN_TYPEERR, \"invalid new expression result {0}\")\nMSG_DEF(JSMSG_OBJECT_ACCESS_DENIED,    29, 0, JSEXN_ERR, \"Permission denied to access object\")\nMSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED,  30, 1, JSEXN_ERR, \"Permission denied to access property '{0}'\")\nMSG_DEF(JSMSG_BAD_INSTANCEOF_RHS,      31, 1, JSEXN_TYPEERR, \"invalid 'instanceof' operand {0}\")\nMSG_DEF(JSMSG_BAD_BYTECODE,            32, 1, JSEXN_INTERNALERR, \"unimplemented JavaScript bytecode {0}\")\nMSG_DEF(JSMSG_BAD_RADIX,               33, 0, JSEXN_RANGEERR, \"radix must be an integer at least 2 and no greater than 36\")\nMSG_DEF(JSMSG_PAREN_BEFORE_LET,        34, 0, JSEXN_SYNTAXERR, \"missing ( before let head\")\nMSG_DEF(JSMSG_CANT_CONVERT,            35, 1, JSEXN_ERR, \"can't convert {0} to an integer\")\nMSG_DEF(JSMSG_CYCLIC_VALUE,            36, 1, JSEXN_TYPEERR, \"cyclic {0} value\")\nMSG_DEF(JSMSG_COMPILE_EXECED_SCRIPT,   37, 0, JSEXN_TYPEERR, \"can't compile over a script that is currently executing\")\nMSG_DEF(JSMSG_CANT_CONVERT_TO,         38, 2, JSEXN_TYPEERR, \"can't convert {0} to {1}\")\nMSG_DEF(JSMSG_NO_PROPERTIES,           39, 1, JSEXN_TYPEERR, \"{0} has no properties\")\nMSG_DEF(JSMSG_CANT_FIND_CLASS,         40, 1, JSEXN_TYPEERR, \"can't find class id {0}\")\nMSG_DEF(JSMSG_DEAD_OBJECT,             41, 0, JSEXN_TYPEERR, \"can't access dead object\")\nMSG_DEF(JSMSG_BYTECODE_TOO_BIG,        42, 2, JSEXN_INTERNALERR, \"bytecode {0} too large (limit {1})\")\nMSG_DEF(JSMSG_UNKNOWN_FORMAT,          43, 1, JSEXN_INTERNALERR, \"unknown bytecode format {0}\")\nMSG_DEF(JSMSG_TOO_MANY_CON_ARGS,       44, 0, JSEXN_SYNTAXERR, \"too many constructor arguments\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_ARGS,       45, 0, JSEXN_SYNTAXERR, \"too many function arguments\")\nMSG_DEF(JSMSG_BAD_QUANTIFIER,          46, 0, JSEXN_SYNTAXERR, \"invalid quantifier\")\nMSG_DEF(JSMSG_MIN_TOO_BIG,             47, 1, JSEXN_SYNTAXERR, \"overlarge minimum {0}\")\nMSG_DEF(JSMSG_MAX_TOO_BIG,             48, 1, JSEXN_SYNTAXERR, \"overlarge maximum {0}\")\nMSG_DEF(JSMSG_OUT_OF_ORDER,            49, 1, JSEXN_SYNTAXERR, \"maximum {0} less than minimum\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_DECL,       50, 0, JSEXN_SYNTAXERR, \"missing = in destructuring declaration\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASS,        51, 0, JSEXN_REFERENCEERR, \"invalid destructuring assignment operator\")\nMSG_DEF(JSMSG_PAREN_AFTER_LET,         52, 0, JSEXN_SYNTAXERR, \"missing ) after let head\")\nMSG_DEF(JSMSG_CURLY_AFTER_LET,         53, 0, JSEXN_SYNTAXERR, \"missing } after let block\")\nMSG_DEF(JSMSG_MISSING_PAREN,           54, 0, JSEXN_SYNTAXERR, \"unterminated parenthetical\")\nMSG_DEF(JSMSG_UNTERM_CLASS,            55, 1, JSEXN_SYNTAXERR, \"unterminated character class {0}\")\nMSG_DEF(JSMSG_TRAILING_SLASH,          56, 0, JSEXN_SYNTAXERR, \"trailing \\\\ in regular expression\")\nMSG_DEF(JSMSG_BAD_CLASS_RANGE,         57, 0, JSEXN_SYNTAXERR, \"invalid range in character class\")\nMSG_DEF(JSMSG_BAD_REGEXP_FLAG,         58, 1, JSEXN_SYNTAXERR, \"invalid regular expression flag {0}\")\nMSG_DEF(JSMSG_NO_INPUT,                59, 5, JSEXN_SYNTAXERR, \"no input for /{0}/{1}{2}{3}{4}\")\nMSG_DEF(JSMSG_CANT_OPEN,               60, 2, JSEXN_ERR, \"can't open {0}: {1}\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_APPLY_ARGS, 61, 0, JSEXN_RANGEERR, \"arguments array passed to Function.prototype.apply is too large\")\nMSG_DEF(JSMSG_UNMATCHED_RIGHT_PAREN,   62, 0, JSEXN_SYNTAXERR, \"unmatched ) in regular expression\")\nMSG_DEF(JSMSG_TOO_BIG_TO_ENCODE,       63, 0, JSEXN_INTERNALERR, \"data are to big to encode\")\nMSG_DEF(JSMSG_ARG_INDEX_OUT_OF_RANGE,  64, 1, JSEXN_RANGEERR, \"argument {0} accesses an index that is out of range\")\nMSG_DEF(JSMSG_SPREAD_TOO_LARGE,        65, 0, JSEXN_RANGEERR, \"array too large due to spread operand(s)\")\nMSG_DEF(JSMSG_SOURCE_TOO_LONG,         66, 0, JSEXN_RANGEERR, \"source is too long\")\nMSG_DEF(JSMSG_BAD_WEAKMAP_KEY,         67, 0, JSEXN_TYPEERR, \"cannot use the given object as a weak map key\")\nMSG_DEF(JSMSG_BAD_SCRIPT_MAGIC,        68, 0, JSEXN_INTERNALERR, \"bad script XDR magic number\")\nMSG_DEF(JSMSG_PAREN_BEFORE_FORMAL,     69, 0, JSEXN_SYNTAXERR, \"missing ( before formal parameters\")\nMSG_DEF(JSMSG_MISSING_FORMAL,          70, 0, JSEXN_SYNTAXERR, \"missing formal parameter\")\nMSG_DEF(JSMSG_PAREN_AFTER_FORMAL,      71, 0, JSEXN_SYNTAXERR, \"missing ) after formal parameters\")\nMSG_DEF(JSMSG_CURLY_BEFORE_BODY,       72, 0, JSEXN_SYNTAXERR, \"missing { before function body\")\nMSG_DEF(JSMSG_CURLY_AFTER_BODY,        73, 0, JSEXN_SYNTAXERR, \"missing } after function body\")\nMSG_DEF(JSMSG_PAREN_BEFORE_COND,       74, 0, JSEXN_SYNTAXERR, \"missing ( before condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_COND,        75, 0, JSEXN_SYNTAXERR, \"missing ) after condition\")\nMSG_DEF(JSMSG_BAD_DUP_ARGS,            76, 0, JSEXN_SYNTAXERR, \"duplicate argument names not allowed in this context\")\nMSG_DEF(JSMSG_NAME_AFTER_DOT,          77, 0, JSEXN_SYNTAXERR, \"missing name after . operator\")\nMSG_DEF(JSMSG_BRACKET_IN_INDEX,        78, 0, JSEXN_SYNTAXERR, \"missing ] in index expression\")\nMSG_DEF(JSMSG_ACCESSOR_DEF_DENIED,     79, 1, JSEXN_ERR, \"Permission denied to define accessor property '{0}'\")\nMSG_DEF(JSMSG_PAREN_BEFORE_SWITCH,     80, 0, JSEXN_SYNTAXERR, \"missing ( before switch expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_SWITCH,      81, 0, JSEXN_SYNTAXERR, \"missing ) after switch expression\")\nMSG_DEF(JSMSG_CURLY_BEFORE_SWITCH,     82, 0, JSEXN_SYNTAXERR, \"missing { before switch body\")\nMSG_DEF(JSMSG_COLON_AFTER_CASE,        83, 0, JSEXN_SYNTAXERR, \"missing : after case label\")\nMSG_DEF(JSMSG_WHILE_AFTER_DO,          84, 0, JSEXN_SYNTAXERR, \"missing while after do-loop body\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR,         85, 0, JSEXN_SYNTAXERR, \"missing ( after for\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT,     86, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop initializer\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_COND,     87, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR_CTRL,    88, 0, JSEXN_SYNTAXERR, \"missing ) after for-loop control\")\nMSG_DEF(JSMSG_CURLY_BEFORE_TRY,        89, 0, JSEXN_SYNTAXERR, \"missing { before try block\")\nMSG_DEF(JSMSG_CURLY_AFTER_TRY,         90, 0, JSEXN_SYNTAXERR, \"missing } after try block\")\nMSG_DEF(JSMSG_PAREN_BEFORE_CATCH,      91, 0, JSEXN_SYNTAXERR, \"missing ( before catch\")\nMSG_DEF(JSMSG_CATCH_IDENTIFIER,        92, 0, JSEXN_SYNTAXERR, \"missing identifier in catch\")\nMSG_DEF(JSMSG_PAREN_AFTER_CATCH,       93, 0, JSEXN_SYNTAXERR, \"missing ) after catch\")\nMSG_DEF(JSMSG_CURLY_BEFORE_CATCH,      94, 0, JSEXN_SYNTAXERR, \"missing { before catch block\")\nMSG_DEF(JSMSG_CURLY_AFTER_CATCH,       95, 0, JSEXN_SYNTAXERR, \"missing } after catch block\")\nMSG_DEF(JSMSG_CURLY_BEFORE_FINALLY,    96, 0, JSEXN_SYNTAXERR, \"missing { before finally block\")\nMSG_DEF(JSMSG_CURLY_AFTER_FINALLY,     97, 0, JSEXN_SYNTAXERR, \"missing } after finally block\")\nMSG_DEF(JSMSG_CATCH_OR_FINALLY,        98, 0, JSEXN_SYNTAXERR, \"missing catch or finally after try\")\nMSG_DEF(JSMSG_PAREN_BEFORE_WITH,       99, 0, JSEXN_SYNTAXERR, \"missing ( before with-statement object\")\nMSG_DEF(JSMSG_PAREN_AFTER_WITH,       100, 0, JSEXN_SYNTAXERR, \"missing ) after with-statement object\")\nMSG_DEF(JSMSG_CURLY_IN_COMPOUND,      101, 0, JSEXN_SYNTAXERR, \"missing } in compound statement\")\nMSG_DEF(JSMSG_NO_VARIABLE_NAME,       102, 0, JSEXN_SYNTAXERR, \"missing variable name\")\nMSG_DEF(JSMSG_COLON_IN_COND,          103, 0, JSEXN_SYNTAXERR, \"missing : in conditional expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_ARGS,       104, 0, JSEXN_SYNTAXERR, \"missing ) after argument list\")\nMSG_DEF(JSMSG_BRACKET_AFTER_LIST,     105, 0, JSEXN_SYNTAXERR, \"missing ] after element list\")\nMSG_DEF(JSMSG_COLON_AFTER_ID,         106, 0, JSEXN_SYNTAXERR, \"missing : after property id\")\nMSG_DEF(JSMSG_CURLY_AFTER_LIST,       107, 0, JSEXN_SYNTAXERR, \"missing } after property list\")\nMSG_DEF(JSMSG_PAREN_IN_PAREN,         108, 0, JSEXN_SYNTAXERR, \"missing ) in parenthetical\")\nMSG_DEF(JSMSG_SEMI_BEFORE_STMNT,      109, 0, JSEXN_SYNTAXERR, \"missing ; before statement\")\nMSG_DEF(JSMSG_NO_RETURN_VALUE,        110, 1, JSEXN_TYPEERR, \"function {0} does not always return a value\")\nMSG_DEF(JSMSG_DUPLICATE_FORMAL,       111, 1, JSEXN_SYNTAXERR, \"duplicate formal argument {0}\")\nMSG_DEF(JSMSG_EQUAL_AS_ASSIGN,        112, 0, JSEXN_SYNTAXERR, \"test for equality (==) mistyped as assignment (=)?\")\nMSG_DEF(JSMSG_OPTIMIZED_CLOSURE_LEAK, 113, 0, JSEXN_INTERNALERR, \"can't access optimized closure\")\nMSG_DEF(JSMSG_TOO_MANY_DEFAULTS,      114, 0, JSEXN_SYNTAXERR, \"more than one switch default\")\nMSG_DEF(JSMSG_TOO_MANY_CASES,         115, 0, JSEXN_INTERNALERR, \"too many switch cases\")\nMSG_DEF(JSMSG_BAD_SWITCH,             116, 0, JSEXN_SYNTAXERR, \"invalid switch statement\")\nMSG_DEF(JSMSG_BAD_FOR_LEFTSIDE,       117, 0, JSEXN_SYNTAXERR, \"invalid for/in left-hand side\")\nMSG_DEF(JSMSG_CATCH_AFTER_GENERAL,    118, 0, JSEXN_SYNTAXERR, \"catch after unconditional catch\")\nMSG_DEF(JSMSG_CATCH_WITHOUT_TRY,      119, 0, JSEXN_SYNTAXERR, \"catch without try\")\nMSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,    120, 0, JSEXN_SYNTAXERR, \"finally without try\")\nMSG_DEF(JSMSG_LABEL_NOT_FOUND,        121, 0, JSEXN_SYNTAXERR, \"label not found\")\nMSG_DEF(JSMSG_TOUGH_BREAK,            122, 0, JSEXN_SYNTAXERR, \"unlabeled break must be inside loop or switch\")\nMSG_DEF(JSMSG_BAD_CONTINUE,           123, 0, JSEXN_SYNTAXERR, \"continue must be inside loop\")\nMSG_DEF(JSMSG_BAD_RETURN_OR_YIELD,    124, 1, JSEXN_SYNTAXERR, \"{0} not in function\")\nMSG_DEF(JSMSG_BAD_LABEL,              125, 0, JSEXN_SYNTAXERR, \"invalid label\")\nMSG_DEF(JSMSG_DUPLICATE_LABEL,        126, 0, JSEXN_SYNTAXERR, \"duplicate label\")\nMSG_DEF(JSMSG_VAR_HIDES_ARG,          127, 1, JSEXN_TYPEERR, \"variable {0} redeclares argument\")\nMSG_DEF(JSMSG_BAD_VAR_INIT,           128, 0, JSEXN_SYNTAXERR, \"invalid variable initialization\")\nMSG_DEF(JSMSG_BAD_LEFTSIDE_OF_ASS,    129, 0, JSEXN_REFERENCEERR, \"invalid assignment left-hand side\")\nMSG_DEF(JSMSG_BAD_OPERAND,            130, 1, JSEXN_SYNTAXERR, \"invalid {0} operand\")\nMSG_DEF(JSMSG_BAD_PROP_ID,            131, 0, JSEXN_SYNTAXERR, \"invalid property id\")\nMSG_DEF(JSMSG_RESERVED_ID,            132, 1, JSEXN_SYNTAXERR, \"{0} is a reserved identifier\")\nMSG_DEF(JSMSG_SYNTAX_ERROR,           133, 0, JSEXN_SYNTAXERR, \"syntax error\")\nMSG_DEF(JSMSG_MISSING_BINARY_DIGITS,  134, 0, JSEXN_SYNTAXERR, \"missing binary digits after '0b'\")\nMSG_DEF(JSMSG_BAD_PROTOTYPE,          135, 1, JSEXN_TYPEERR,   \"'prototype' property of {0} is not an object\")\nMSG_DEF(JSMSG_MISSING_EXPONENT,       136, 0, JSEXN_SYNTAXERR, \"missing exponent\")\nMSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, \"out of memory\")\nMSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, \"unterminated string literal\")\nMSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, \"too many parentheses in regular expression\")\nMSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, \"unterminated comment\")\nMSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, \"unterminated regular expression literal\")\nMSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, \"bad cloned function scope chain\")\nMSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, \"missing octal digits after '0o'\")\nMSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, \"illegal character\")\nMSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, \"{0} is not a legal ECMA-262 octal constant\")\nMSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, \"repeat count must be less than infinity and not overflow maximum string size\")\nMSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, \"uncaught exception: {0}\")\nMSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, \"non-octal digit in an escape sequence that doesn't match a back-reference\")\nMSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, \"back-reference exceeds number of capturing parentheses\")\nMSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, \"precision {0} out of range\")\nMSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, \"invalid {0} usage\")\nMSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, \"invalid array length\")\nMSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, \"can't describe non-native properties of class {0}\")\nMSG_DEF(JSMSG_BAD_APPLY_ARGS,         154, 1, JSEXN_TYPEERR, \"second argument to Function.prototype.{0} must be an array\")\nMSG_DEF(JSMSG_REDECLARED_VAR,         155, 2, JSEXN_TYPEERR, \"redeclaration of {0} {1}\")\nMSG_DEF(JSMSG_UNDECLARED_VAR,         156, 1, JSEXN_REFERENCEERR, \"assignment to undeclared variable {0}\")\nMSG_DEF(JSMSG_ANON_NO_RETURN_VALUE,   157, 0, JSEXN_TYPEERR, \"anonymous function does not always return a value\")\nMSG_DEF(JSMSG_DEPRECATED_USAGE,       158, 1, JSEXN_REFERENCEERR, \"deprecated {0} usage\")\nMSG_DEF(JSMSG_BAD_URI,                159, 0, JSEXN_URIERR, \"malformed URI sequence\")\nMSG_DEF(JSMSG_GETTER_ONLY,            160, 0, JSEXN_TYPEERR, \"setting a property that has only a getter\")\nMSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,   161, 0, JSEXN_SYNTAXERR, \"identifier starts immediately after numeric literal\")\nMSG_DEF(JSMSG_UNDEFINED_PROP,         162, 1, JSEXN_REFERENCEERR, \"reference to undefined property {0}\")\nMSG_DEF(JSMSG_USELESS_EXPR,           163, 0, JSEXN_TYPEERR, \"useless expression\")\nMSG_DEF(JSMSG_REDECLARED_PARAM,       164, 1, JSEXN_TYPEERR, \"redeclaration of formal parameter {0}\")\nMSG_DEF(JSMSG_NEWREGEXP_FLAGGED,      165, 0, JSEXN_TYPEERR, \"can't supply flags when constructing one RegExp from another\")\nMSG_DEF(JSMSG_RESERVED_SLOT_RANGE,    166, 0, JSEXN_RANGEERR, \"reserved slot index out of range\")\nMSG_DEF(JSMSG_CANT_DECODE_PRINCIPALS, 167, 0, JSEXN_INTERNALERR, \"can't decode JSPrincipals\")\nMSG_DEF(JSMSG_CANT_SEAL_OBJECT,       168, 1, JSEXN_ERR, \"can't seal {0} objects\")\nMSG_DEF(JSMSG_TOO_MANY_CATCH_VARS,    169, 0, JSEXN_SYNTAXERR, \"too many catch variables\")\nMSG_DEF(JSMSG_NEGATIVE_REPETITION_COUNT, 170, 0, JSEXN_RANGEERR, \"repeat count must be non-negative\")\nMSG_DEF(JSMSG_UNUSED171,              171, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED172,              172, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED173,              173, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED174,              174, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_NESTING_GENERATOR,      175, 0, JSEXN_TYPEERR, \"already executing generator\")\nMSG_DEF(JSMSG_UNUSED176,              176, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED177,              177, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED178,              178, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED179,              179, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED180,              180, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED181,              181, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SEND,     182, 1, JSEXN_TYPEERR, \"attempt to send {0} to newborn generator\")\nMSG_DEF(JSMSG_UNUSED183,              183, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED184,              184, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE, 185, 0, JSEXN_TYPEERR, \"proxy can't report an extensible object as non-extensible\")\nMSG_DEF(JSMSG_UNUSED186,              186, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED187,              187, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INCOMPATIBLE_METHOD,    188, 3, JSEXN_TYPEERR, \"{0} {1} called on incompatible {2}\")\nMSG_DEF(JSMSG_UNUSED189,              189, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED190,              190, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED191,              191, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED192,              192, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_FOR_EACH_LOOP,      193, 0, JSEXN_SYNTAXERR, \"invalid for each loop\")\nMSG_DEF(JSMSG_UNUSED194,              194, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED195,              195, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED196,              196, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INTERNAL_INTL_ERROR,    197, 0, JSEXN_ERR, \"internal error while computing Intl data\")\nMSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR,   198, 0, JSEXN_ERR, \"internal error getting the default locale\")\nMSG_DEF(JSMSG_TOO_MANY_LOCALS,        199, 0, JSEXN_SYNTAXERR, \"too many local variables\")\nMSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG,     200, 0, JSEXN_INTERNALERR, \"array initialiser too large\")\nMSG_DEF(JSMSG_REGEXP_TOO_COMPLEX,     201, 0, JSEXN_INTERNALERR, \"regular expression too complex\")\nMSG_DEF(JSMSG_BUFFER_TOO_SMALL,       202, 0, JSEXN_INTERNALERR, \"buffer too small\")\nMSG_DEF(JSMSG_BAD_SURROGATE_CHAR,     203, 1, JSEXN_TYPEERR, \"bad surrogate character {0}\")\nMSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE,    204, 1, JSEXN_TYPEERR, \"UTF-8 character {0} too large\")\nMSG_DEF(JSMSG_MALFORMED_UTF8_CHAR,    205, 1, JSEXN_TYPEERR, \"malformed UTF-8 character sequence at offset {0}\")\nMSG_DEF(JSMSG_USER_DEFINED_ERROR,     206, 0, JSEXN_ERR, \"JS_ReportError was called\")\nMSG_DEF(JSMSG_WRONG_CONSTRUCTOR,      207, 1, JSEXN_TYPEERR, \"wrong constructor called for {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_RETURN,   208, 1, JSEXN_TYPEERR, \"generator function {0} returns a value\")\nMSG_DEF(JSMSG_BAD_ANON_GENERATOR_RETURN, 209, 0, JSEXN_TYPEERR, \"anonymous generator function returns a value\")\nMSG_DEF(JSMSG_NAME_AFTER_FOR_PAREN,   210, 0, JSEXN_SYNTAXERR, \"missing name after for (\")\nMSG_DEF(JSMSG_IN_AFTER_FOR_NAME,      211, 0, JSEXN_SYNTAXERR, \"missing 'in' or 'of' after for\")\nMSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE,  212, 2, JSEXN_TYPEERR,\"trap {1} for {0} returned a primitive value\")\nMSG_DEF(JSMSG_UNUSED213,              213, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_YIELD,    214, 1, JSEXN_TYPEERR, \"yield from closing generator {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SYNTAX,   215, 1, JSEXN_SYNTAXERR, \"{0} expression must be parenthesized\")\nMSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE,    216, 0, JSEXN_SYNTAXERR, \"invalid array comprehension left-hand side\")\nMSG_DEF(JSMSG_UNUSED217,              217, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE,     218, 0, JSEXN_TYPEERR, \"reduce of empty array with no initial value\")\nMSG_DEF(JSMSG_UNUSED219,              219, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_DELETE_OPERAND,     220, 0, JSEXN_REFERENCEERR, \"invalid delete operand\")\nMSG_DEF(JSMSG_BAD_INCOP_OPERAND,      221, 0, JSEXN_REFERENCEERR, \"invalid increment/decrement operand\")\nMSG_DEF(JSMSG_UNEXPECTED_TYPE,        222, 2, JSEXN_TYPEERR, \"{0} is {1}\")\nMSG_DEF(JSMSG_LET_DECL_NOT_IN_BLOCK,  223, 0, JSEXN_SYNTAXERR, \"let declaration not directly within block\")\nMSG_DEF(JSMSG_BAD_OBJECT_INIT,        224, 0, JSEXN_SYNTAXERR, \"invalid object initializer\")\nMSG_DEF(JSMSG_CANT_SET_ARRAY_ATTRS,   225, 0, JSEXN_INTERNALERR, \"can't set attributes on indexed array properties\")\nMSG_DEF(JSMSG_EVAL_ARITY,             226, 0, JSEXN_TYPEERR, \"eval accepts only one parameter\")\nMSG_DEF(JSMSG_MISSING_FUN_ARG,        227, 2, JSEXN_TYPEERR, \"missing argument {0} when calling function {1}\")\nMSG_DEF(JSMSG_JSON_BAD_PARSE,         228, 1, JSEXN_SYNTAXERR, \"JSON.parse: {0}\")\nMSG_DEF(JSMSG_JSON_BAD_STRINGIFY,     229, 0, JSEXN_ERR, \"JSON.stringify\")\nMSG_DEF(JSMSG_NOT_CALLABLE_OR_UNDEFINED, 230, 0, JSEXN_TYPEERR, \"value is not a function or undefined\")\nMSG_DEF(JSMSG_NOT_NONNULL_OBJECT,     231, 0, JSEXN_TYPEERR, \"value is not a non-null object\")\nMSG_DEF(JSMSG_DEPRECATED_OCTAL,       232, 0, JSEXN_SYNTAXERR, \"octal literals and octal escape sequences are deprecated\")\nMSG_DEF(JSMSG_STRICT_CODE_WITH,       233, 0, JSEXN_SYNTAXERR, \"strict mode code may not contain 'with' statements\")\nMSG_DEF(JSMSG_DUPLICATE_PROPERTY,     234, 1, JSEXN_SYNTAXERR, \"property name {0} appears more than once in object literal\")\nMSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 235, 0, JSEXN_SYNTAXERR, \"applying the 'delete' operator to an unqualified name is deprecated\")\nMSG_DEF(JSMSG_BAD_STRICT_ASSIGN,      236, 1, JSEXN_SYNTAXERR, \"can't assign to {0} in strict mode\")\nMSG_DEF(JSMSG_BAD_BINDING,            237, 1, JSEXN_SYNTAXERR, \"redefining {0} is deprecated\")\nMSG_DEF(JSMSG_INVALID_DESCRIPTOR,     238, 0, JSEXN_TYPEERR, \"property descriptors must not specify a value or be writable when a getter or setter has been specified\")\nMSG_DEF(JSMSG_OBJECT_NOT_EXTENSIBLE,  239, 1, JSEXN_TYPEERR, \"{0} is not extensible\")\nMSG_DEF(JSMSG_CANT_REDEFINE_PROP,     240, 1, JSEXN_TYPEERR, \"can't redefine non-configurable property '{0}'\")\nMSG_DEF(JSMSG_CANT_APPEND_TO_ARRAY,   241, 0, JSEXN_TYPEERR, \"can't add elements past the end of an array if its length property is unwritable\")\nMSG_DEF(JSMSG_CANT_REDEFINE_ARRAY_LENGTH,242, 0, JSEXN_TYPEERR, \"can't redefine array length\")\nMSG_DEF(JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH,243, 0, JSEXN_TYPEERR, \"can't define array index property past the end of an array with non-writable length\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_INDEX,  244, 0, JSEXN_ERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG, 245, 1, JSEXN_ERR, \"argument {0} must be >= 0\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS,   246, 0, JSEXN_ERR, \"invalid arguments\")\nMSG_DEF(JSMSG_CSP_BLOCKED_FUNCTION,   247, 0, JSEXN_ERR, \"call to Function() blocked by CSP\")\nMSG_DEF(JSMSG_BAD_GET_SET_FIELD,      248, 1, JSEXN_TYPEERR, \"property descriptor's {0} field is neither undefined nor a function\")\nMSG_DEF(JSMSG_BAD_PROXY_FIX,          249, 0, JSEXN_TYPEERR, \"proxy was fixed while executing the handler\")\nMSG_DEF(JSMSG_INVALID_EVAL_SCOPE_ARG, 250, 0, JSEXN_EVALERR, \"invalid eval scope argument\")\nMSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS,    251, 3, JSEXN_SYNTAXERR, \"{0} functions must have {1} argument{2}\")\nMSG_DEF(JSMSG_THROW_TYPE_ERROR,       252, 0, JSEXN_TYPEERR, \"'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them\")\nMSG_DEF(JSMSG_BAD_TOISOSTRING_PROP,   253, 0, JSEXN_TYPEERR, \"toISOString property is not callable\")\nMSG_DEF(JSMSG_BAD_PARSE_NODE,         254, 0, JSEXN_INTERNALERR, \"bad parse node\")\nMSG_DEF(JSMSG_NOT_EXPECTED_TYPE,      255, 3, JSEXN_TYPEERR, \"{0}: expected {1}, got {2}\")\nMSG_DEF(JSMSG_CALLER_IS_STRICT,       256, 0, JSEXN_TYPEERR, \"access to strict mode caller function is censored\")\nMSG_DEF(JSMSG_NEED_DEBUG_MODE,        257, 0, JSEXN_ERR, \"function can be called only in debug mode\")\nMSG_DEF(JSMSG_STRICT_CODE_LET_EXPR_STMT, 258, 0, JSEXN_ERR, \"strict mode code may not contain unparenthesized let expression statements\")\nMSG_DEF(JSMSG_CANT_CHANGE_EXTENSIBILITY, 259, 0, JSEXN_TYPEERR, \"can't change object's extensibility\")\nMSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA, 260, 1, JSEXN_INTERNALERR, \"bad serialized structured data ({0})\")\nMSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE,    261, 0, JSEXN_TYPEERR, \"unsupported type for structured data\")\nMSG_DEF(JSMSG_SC_RECURSION,           262, 0, JSEXN_INTERNALERR, \"recursive object\")\nMSG_DEF(JSMSG_DEBUG_CANT_DEBUG_GLOBAL, 263, 0, JSEXN_ERR, \"passing non-debuggable global to addDebuggee\")\nMSG_DEF(JSMSG_BAD_CLONE_VERSION,      264, 0, JSEXN_ERR, \"unsupported structured clone version\")\nMSG_DEF(JSMSG_CANT_CLONE_OBJECT,      265, 0, JSEXN_TYPEERR, \"can't clone object\")\nMSG_DEF(JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED, 266, 0, JSEXN_TYPEERR, \"resumption values are disallowed in this hook\")\nMSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, \"in strict mode code, functions may be declared only at top level or immediately within another function\")\nMSG_DEF(JSMSG_INVALID_FOR_IN_INIT,    268, 0, JSEXN_SYNTAXERR, \"for-in loop let declaration may not have an initializer\")\nMSG_DEF(JSMSG_CLEARED_SCOPE,          269, 0, JSEXN_TYPEERR, \"attempt to run compile-and-go script on a cleared scope\")\nMSG_DEF(JSMSG_MALFORMED_ESCAPE,       270, 1, JSEXN_SYNTAXERR, \"malformed {0} character escape sequence\")\nMSG_DEF(JSMSG_BAD_GENEXP_BODY,        271, 1, JSEXN_SYNTAXERR, \"illegal use of {0} in generator expression\")\nMSG_DEF(JSMSG_YIELD_WITHOUT_OPERAND,  272, 0, JSEXN_SYNTAXERR, \"yield without a value is deprecated, and illegal in ES6 (use 'yield undefined' instead)\")\nMSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT,  273, 0, JSEXN_SYNTAXERR, \"function statement requires a name\")\nMSG_DEF(JSMSG_CCW_REQUIRED,           274, 1, JSEXN_TYPEERR, \"{0}: argument must be an object from a different compartment\")\nMSG_DEF(JSMSG_DEBUG_BAD_RESUMPTION,   275, 0, JSEXN_TYPEERR, \"debugger resumption value must be undefined, {throw: val}, {return: val}, or null\")\nMSG_DEF(JSMSG_ASSIGN_FUNCTION_OR_NULL, 276, 1, JSEXN_TYPEERR, \"value assigned to {0} must be a function or null\")\nMSG_DEF(JSMSG_DEBUG_NOT_LIVE,         277, 1, JSEXN_ERR, \"{0} is not live\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_WRONG_OWNER, 278, 0, JSEXN_TYPEERR, \"Debugger.Object belongs to a different Debugger\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_PROTO,     279, 0, JSEXN_TYPEERR, \"Debugger.Object.prototype is not a valid Debugger.Object\")\nMSG_DEF(JSMSG_DEBUG_LOOP,             280, 0, JSEXN_TYPEERR, \"cannot debug an object in same compartment as debugger or a compartment that is already debugging the debugger\")\nMSG_DEF(JSMSG_DEBUG_NOT_IDLE,         281, 0, JSEXN_ERR, \"can't start debugging: a debuggee script is on the stack\")\nMSG_DEF(JSMSG_DEBUG_BAD_OFFSET,       282, 0, JSEXN_TYPEERR, \"invalid script offset\")\nMSG_DEF(JSMSG_DEBUG_BAD_LINE,         283, 0, JSEXN_TYPEERR, \"invalid line number\")\nMSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING,    284, 0, JSEXN_ERR, \"can't set breakpoint: script global is not a debuggee\")\nMSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, \"{0}: descriptor .{1} property is an object in a different compartment than the target object\")\nMSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, \"stack frame is not running JavaScript code\")\nMSG_DEF(JSMSG_CANT_WATCH_PROP,        287, 0, JSEXN_TYPEERR, \"properties whose names are objects can't be watched\")\nMSG_DEF(JSMSG_CSP_BLOCKED_EVAL,       288, 0, JSEXN_ERR, \"call to eval() blocked by CSP\")\nMSG_DEF(JSMSG_DEBUG_NO_SCOPE_OBJECT,  289, 0, JSEXN_TYPEERR, \"declarative Environments don't have binding objects\")\nMSG_DEF(JSMSG_EMPTY_CONSEQUENT,       290, 0, JSEXN_SYNTAXERR, \"mistyped ; after conditional?\")\nMSG_DEF(JSMSG_NOT_ITERABLE,           291, 1, JSEXN_TYPEERR, \"{0} is not iterable\")\nMSG_DEF(JSMSG_QUERY_LINE_WITHOUT_URL, 292, 0, JSEXN_TYPEERR, \"findScripts query object has 'line' property, but no 'url' property\")\nMSG_DEF(JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL, 293, 0, JSEXN_TYPEERR, \"findScripts query object has 'innermost' property without both 'url' and 'line' properties\")\nMSG_DEF(JSMSG_DEBUG_VARIABLE_NOT_FOUND, 294, 0, JSEXN_TYPEERR, \"variable not found in environment\")\nMSG_DEF(JSMSG_PARAMETER_AFTER_REST,   295, 0, JSEXN_SYNTAXERR, \"parameter after rest parameter\")\nMSG_DEF(JSMSG_NO_REST_NAME,           296, 0, JSEXN_SYNTAXERR, \"no parameter name after ...\")\nMSG_DEF(JSMSG_ARGUMENTS_AND_REST,     297, 0, JSEXN_SYNTAXERR, \"'arguments' object may not be used in conjunction with a rest parameter\")\nMSG_DEF(JSMSG_FUNCTION_ARGUMENTS_AND_REST, 298, 0, JSEXN_ERR, \"the 'arguments' property of a function with a rest parameter may not be used\")\nMSG_DEF(JSMSG_REST_WITH_DEFAULT,      299, 0, JSEXN_SYNTAXERR, \"rest parameter may not have a default\")\nMSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, \"parameter(s) with default followed by parameter without default\")\nMSG_DEF(JSMSG_YIELD_IN_DEFAULT,       301, 0, JSEXN_SYNTAXERR, \"yield in default expression\")\nMSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED,  302, 1, JSEXN_REFERENCEERR, \"no intrinsic function {0}\")\nMSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP,  303, 1, JSEXN_ERR,      \"{0} is being assigned a source map, yet already has one\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG,      304, 1, JSEXN_RANGEERR, \"invalid ParallelArray{0} argument\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, \"argument must be divisible by outermost dimension\")\nMSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, \"cannot reduce ParallelArray object whose outermost dimension is empty\")\nMSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, \"cannot flatten 1-dimensional ParallelArray object\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, \"no conflict resolution function provided\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, \"index in scatter vector out of bounds\")\nMSG_DEF(JSMSG_CANT_REPORT_NC_AS_NE,   310, 0, JSEXN_TYPEERR, \"proxy can't report a non-configurable own property as non-existent\")\nMSG_DEF(JSMSG_CANT_REPORT_E_AS_NE,    311, 0, JSEXN_TYPEERR, \"proxy can't report an existing own property as non-existent on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_NEW,        312, 0, JSEXN_TYPEERR, \"proxy can't report a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_INVALID,    313, 0, JSEXN_TYPEERR, \"proxy can't report an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_REPORT_NE_AS_NC,   314, 0, JSEXN_TYPEERR, \"proxy can't report a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_CANT_DEFINE_NEW,        315, 0, JSEXN_TYPEERR, \"proxy can't define a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_DEFINE_INVALID,    316, 0, JSEXN_TYPEERR, \"proxy can't define an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_DEFINE_NE_AS_NC,   317, 0, JSEXN_TYPEERR, \"proxy can't define a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_INVALID_TRAP_RESULT,    318, 2, JSEXN_TYPEERR, \"trap {1} for {0} returned an invalid result\")\nMSG_DEF(JSMSG_CANT_SKIP_NC,           319, 0, JSEXN_TYPEERR, \"proxy can't skip a non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_SAME_VALUE, 320, 0, JSEXN_TYPEERR, \"proxy must report the same value for a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_UNDEFINED,  321, 0, JSEXN_TYPEERR, \"proxy must report undefined for a non-configurable accessor property without a getter\")\nMSG_DEF(JSMSG_CANT_SET_NW_NC,         322, 0, JSEXN_TYPEERR, \"proxy can't successfully set a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_CANT_SET_WO_SETTER,     323, 0, JSEXN_TYPEERR, \"proxy can't succesfully set an accessor property without a setter\")\nMSG_DEF(JSMSG_DEBUG_BAD_REFERENT,     324, 2, JSEXN_TYPEERR, \"{0} does not refer to {1}\")\nMSG_DEF(JSMSG_DEBUG_WRAPPER_IN_WAY,   325, 2, JSEXN_TYPEERR, \"{0} is a wrapper around {1}, but a direct reference is required\")\nMSG_DEF(JSMSG_UNWRAP_DENIED,          326, 0, JSEXN_ERR, \"permission denied to unwrap object\")\nMSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 327, 3, JSEXN_TYPEERR, \"Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}\")\nMSG_DEF(JSMSG_INVALID_LOCALES_ELEMENT,328, 0, JSEXN_TYPEERR, \"invalid element in locales argument\")\nMSG_DEF(JSMSG_INVALID_LANGUAGE_TAG,   329, 1, JSEXN_RANGEERR, \"invalid language tag: {0}\")\nMSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, \"invalid locale matcher in supportedLocalesOf(): {0}\")\nMSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, \"invalid value {1} for option {0}\")\nMSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, \"invalid digits value: {0}\")\nMSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, \"can't initialize object twice as an object of an Intl constructor\")\nMSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, \"invalid currency code in NumberFormat(): {0}\")\nMSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, \"undefined currency in NumberFormat() with currency style\")\nMSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, \"invalid time zone in DateTimeFormat(): {0}\")\nMSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, \"date value is not finite in DateTimeFormat.format()\")\nMSG_DEF(JSMSG_MODULE_STATEMENT,       338, 0, JSEXN_SYNTAXERR, \"module declarations may only appear at the top level of a program or module body\")\nMSG_DEF(JSMSG_CURLY_BEFORE_MODULE,    339, 0, JSEXN_SYNTAXERR, \"missing { before module body\")\nMSG_DEF(JSMSG_CURLY_AFTER_MODULE,     340, 0, JSEXN_SYNTAXERR, \"missing } after module body\")\nMSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 341, 0, JSEXN_SYNTAXERR, \"\\\"use asm\\\" is only meaningful in the Directive Prologue of a function body\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_FAIL,      342, 1, JSEXN_TYPEERR, \"asm.js type error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_LINK_FAIL,      343, 1, JSEXN_TYPEERR, \"asm.js link error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_OK,        344, 1, JSEXN_ERR,     \"successfully compiled asm.js code ({0})\")\nMSG_DEF(JSMSG_BAD_ARROW_ARGS,         345, 0, JSEXN_SYNTAXERR, \"invalid arrow-function arguments (parentheses around the arrow-function may help)\")\nMSG_DEF(JSMSG_YIELD_IN_ARROW,         346, 0, JSEXN_SYNTAXERR, \"arrow function may not contain yield\")\nMSG_DEF(JSMSG_WRONG_VALUE,            347, 2, JSEXN_ERR, \"expected {0} but found {1}\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, \"target for index {0} is not an integer\")\nMSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME,349, 0, JSEXN_TYPEERR, \"self-hosted code may not contain unbound name lookups\")\nMSG_DEF(JSMSG_DEPRECATED_SOURCE_MAP,  350, 0, JSEXN_SYNTAXERR, \"Using //@ to indicate source map URL pragmas is deprecated. Use //# instead\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASSIGN,    351, 1, JSEXN_SYNTAXERR, \"can't assign to {0} using destructuring assignment\")\nMSG_DEF(JSMSG_BINARYDATA_ARRAYTYPE_BAD_ARGS, 352, 0, JSEXN_ERR, \"Invalid arguments\")\nMSG_DEF(JSMSG_BINARYDATA_BINARYARRAY_BAD_INDEX, 353, 0, JSEXN_RANGEERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_ARGS, 354, 0, JSEXN_RANGEERR, \"invalid field descriptor\")\nMSG_DEF(JSMSG_BINARYDATA_NOT_BINARYSTRUCT,   355, 1, JSEXN_TYPEERR, \"{0} is not a BinaryStruct\")\nMSG_DEF(JSMSG_BINARYDATA_SUBARRAY_INTEGER_ARG, 356, 1, JSEXN_ERR, \"argument {0} must be an integer\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_EMPTY_DESCRIPTOR, 357, 0, JSEXN_ERR, \"field descriptor cannot be empty\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_FIELD, 358, 1, JSEXN_ERR, \"field {0} is not a valid BinaryData Type descriptor\")\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsalloc.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS allocation policies. */\n\n#ifndef jsalloc_h\n#define jsalloc_h\n\n#include \"mozilla/AllocPolicy.h\"\n\n#include \"js/Utility.h\"\n\nstruct JSContext;\n\nnamespace js {\n\nclass ContextFriendFields;\n\n/* Policy for using system memory functions and doing no error reporting. */\nclass SystemAllocPolicy\n{\n  public:\n    void *malloc_(size_t bytes) { return js_malloc(bytes); }\n    void *calloc_(size_t bytes) { return js_calloc(bytes); }\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }\n    void free_(void *p) { js_free(p); }\n    void reportAllocOverflow() const {}\n};\n\n/*\n * Allocation policy that calls the system memory functions and reports errors\n * to the context. Since the JSContext given on construction is stored for\n * the lifetime of the container, this policy may only be used for containers\n * whose lifetime is a shorter than the given JSContext.\n *\n * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,\n * not the system ones.\n */\nclass TempAllocPolicy\n{\n    ContextFriendFields *const cx_;\n\n    /*\n     * Non-inline helper to call JSRuntime::onOutOfMemory with minimal\n     * code bloat.\n     */\n    JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);\n\n  public:\n    TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(\n    TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}\n\n    void *malloc_(size_t bytes) {\n        void *p = js_malloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *calloc_(size_t bytes) {\n        void *p = js_calloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) {\n        void *p2 = js_realloc(p, bytes);\n        if (JS_UNLIKELY(!p2))\n            p2 = onOutOfMemory(p2, bytes);\n        return p2;\n    }\n\n    void free_(void *p) {\n        js_free(p);\n    }\n\n    JS_FRIEND_API(void) reportAllocOverflow() const;\n};\n\n} /* namespace js */\n\n#endif /* jsalloc_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JavaScript API. */\n\n#ifndef jsapi_h\n#define jsapi_h\n\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/RangedPtr.h\"\n#include \"mozilla/ThreadLocal.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"js-config.h\"\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n#include \"js/CharacterEncoding.h\"\n#include \"js/HashTable.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n#include \"js/Value.h\"\n#include \"js/Vector.h\"\n\n/************************************************************************/\n\nnamespace JS {\n\ntypedef mozilla::RangedPtr<const jschar> CharPtr;\n\nclass StableCharPtr : public CharPtr {\n  public:\n    StableCharPtr(const StableCharPtr &s) : CharPtr(s) {}\n    StableCharPtr(const mozilla::RangedPtr<const jschar> &s) : CharPtr(s) {}\n    StableCharPtr(const jschar *s, size_t len) : CharPtr(s, len) {}\n    StableCharPtr(const jschar *pos, const jschar *start, size_t len)\n      : CharPtr(pos, start, len)\n    {}\n};\n\n#if defined JS_THREADSAFE && defined DEBUG\n\nclass JS_PUBLIC_API(AutoCheckRequestDepth)\n{\n    JSContext *cx;\n  public:\n    AutoCheckRequestDepth(JSContext *cx);\n    AutoCheckRequestDepth(js::ContextFriendFields *cx);\n    ~AutoCheckRequestDepth();\n};\n\n# define CHECK_REQUEST(cx) \\\n    JS::AutoCheckRequestDepth _autoCheckRequestDepth(cx)\n\n#else\n\n# define CHECK_REQUEST(cx) \\\n    ((void) 0)\n\n#endif /* JS_THREADSAFE && DEBUG */\n\n#ifdef DEBUG\n/*\n * Assert that we're not doing GC on cx, that we're in a request as\n * needed, and that the compartments for cx and v are correct.\n * Also check that GC would be safe at this point.\n */\nJS_PUBLIC_API(void)\nAssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v);\n#else\ninline void AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v) {\n    /* Do nothing */\n}\n#endif /* DEBUG */\n\nclass JS_PUBLIC_API(AutoGCRooter) {\n  public:\n    AutoGCRooter(JSContext *cx, ptrdiff_t tag);\n    AutoGCRooter(js::ContextFriendFields *cx, ptrdiff_t tag);\n\n    ~AutoGCRooter() {\n        JS_ASSERT(this == *stackTop);\n        *stackTop = down;\n    }\n\n    /* Implemented in gc/RootMarking.cpp. */\n    inline void trace(JSTracer *trc);\n    static void traceAll(JSTracer *trc);\n    static void traceAllWrappers(JSTracer *trc);\n\n  protected:\n    AutoGCRooter * const down;\n\n    /*\n     * Discriminates actual subclass of this being used.  If non-negative, the\n     * subclass roots an array of values of the length stored in this field.\n     * If negative, meaning is indicated by the corresponding value in the enum\n     * below.  Any other negative value indicates some deeper problem such as\n     * memory corruption.\n     */\n    ptrdiff_t tag_;\n\n    enum {\n        VALARRAY =     -2, /* js::AutoValueArray */\n        PARSER =       -3, /* js::frontend::Parser */\n        SHAPEVECTOR =  -4, /* js::AutoShapeVector */\n        IDARRAY =      -6, /* js::AutoIdArray */\n        DESCRIPTORS =  -7, /* js::AutoPropDescArrayRooter */\n        ID =           -9, /* js::AutoIdRooter */\n        VALVECTOR =   -10, /* js::AutoValueVector */\n        DESCRIPTOR =  -11, /* js::AutoPropertyDescriptorRooter */\n        STRING =      -12, /* js::AutoStringRooter */\n        IDVECTOR =    -13, /* js::AutoIdVector */\n        OBJVECTOR =   -14, /* js::AutoObjectVector */\n        STRINGVECTOR =-15, /* js::AutoStringVector */\n        SCRIPTVECTOR =-16, /* js::AutoScriptVector */\n        NAMEVECTOR =  -17, /* js::AutoNameVector */\n        HASHABLEVALUE=-18, /* js::HashableValue */\n        IONMASM =     -19, /* js::jit::MacroAssembler */\n        IONALLOC =    -20, /* js::jit::AutoTempAllocatorRooter */\n        WRAPVECTOR =  -21, /* js::AutoWrapperVector */\n        WRAPPER =     -22, /* js::AutoWrapperRooter */\n        OBJOBJHASHMAP=-23, /* js::AutoObjectObjectHashMap */\n        OBJU32HASHMAP=-24, /* js::AutoObjectUnsigned32HashMap */\n        OBJHASHSET =  -25, /* js::AutoObjectHashSet */\n        JSONPARSER =  -26, /* js::JSONParser */\n        CUSTOM =      -27, /* js::CustomAutoRooter */\n        FUNVECTOR =   -28  /* js::AutoFunctionVector */\n    };\n\n  private:\n    AutoGCRooter ** const stackTop;\n\n    /* No copy or assignment semantics. */\n    AutoGCRooter(AutoGCRooter &ida) MOZ_DELETE;\n    void operator=(AutoGCRooter &ida) MOZ_DELETE;\n};\n\nclass AutoStringRooter : private AutoGCRooter {\n  public:\n    AutoStringRooter(JSContext *cx, JSString *str = NULL\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, STRING), str_(str)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    void setString(JSString *str) {\n        str_ = str;\n    }\n\n    JSString * string() const {\n        return str_;\n    }\n\n    JSString ** addr() {\n        return &str_;\n    }\n\n    JSString * const * addr() const {\n        return &str_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    JSString *str_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoArrayRooter : private AutoGCRooter {\n  public:\n    AutoArrayRooter(JSContext *cx, size_t len, Value *vec\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, len), array(vec), skip(cx, array, len)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeLength(size_t newLength) {\n        tag_ = ptrdiff_t(newLength);\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeArray(Value *newArray, size_t newLength) {\n        changeLength(newLength);\n        array = newArray;\n    }\n\n    Value *array;\n\n    MutableHandleValue handleAt(size_t i)\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return MutableHandleValue::fromMarkedLocation(&array[i]);\n    }\n    HandleValue handleAt(size_t i) const\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return HandleValue::fromMarkedLocation(&array[i]);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    js::SkipRoot skip;\n};\n\ntemplate<class T>\nclass AutoVectorRooter : protected AutoGCRooter\n{\n  public:\n    explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoVectorRooter(js::ContextFriendFields *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef T ElementType;\n\n    size_t length() const { return vector.length(); }\n    bool empty() const { return vector.empty(); }\n\n    bool append(const T &v) { return vector.append(v); }\n    bool appendAll(const AutoVectorRooter<T> &other) {\n        return vector.appendAll(other.vector);\n    }\n\n    bool insert(T *p, const T &val) { return vector.insert(p, val); }\n\n    /* For use when space has already been reserved. */\n    void infallibleAppend(const T &v) { vector.infallibleAppend(v); }\n\n    void popBack() { vector.popBack(); }\n    T popCopy() { return vector.popCopy(); }\n\n    bool growBy(size_t inc) {\n        size_t oldLength = vector.length();\n        if (!vector.growByUninitialized(inc))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    bool resize(size_t newLength) {\n        size_t oldLength = vector.length();\n        if (newLength <= oldLength) {\n            vector.shrinkBy(oldLength - newLength);\n            return true;\n        }\n        if (!vector.growByUninitialized(newLength - oldLength))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    void clear() { vector.clear(); }\n\n    bool reserve(size_t newLength) {\n        return vector.reserve(newLength);\n    }\n\n    T &operator[](size_t i) { return vector[i]; }\n    const T &operator[](size_t i) const { return vector[i]; }\n\n    JS::MutableHandle<T> handleAt(size_t i) { return JS::MutableHandle<T>::fromMarkedLocation(&vector[i]); }\n    JS::Handle<T> handleAt(size_t i) const { return JS::Handle<T>::fromMarkedLocation(&vector[i]); }\n\n    const T *begin() const { return vector.begin(); }\n    T *begin() { return vector.begin(); }\n\n    const T *end() const { return vector.end(); }\n    T *end() { return vector.end(); }\n\n    const T &back() const { return vector.back(); }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    void makeRangeGCSafe(size_t oldLength) {\n        T *t = vector.begin() + oldLength;\n        for (size_t i = oldLength; i < vector.length(); ++i, ++t)\n            memset(t, 0, sizeof(T));\n    }\n\n    typedef js::Vector<T, 8> VectorImpl;\n    VectorImpl vector;\n\n    /* Prevent overwriting of inline elements in vector. */\n    js::SkipRoot vectorRoot;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class Key, class Value>\nclass AutoHashMapRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashMap<Key, Value> HashMapImpl;\n\n  public:\n    explicit AutoHashMapRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), map(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n    typedef typename HashMapImpl::Lookup Lookup;\n    typedef typename HashMapImpl::Ptr Ptr;\n    typedef typename HashMapImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return map.init(len);\n    }\n    bool initialized() const {\n        return map.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return map.lookup(l);\n    }\n    void remove(Ptr p) {\n        map.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return map.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.add(p, k, v);\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        return map.add(p, k);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.relookupOrAdd(p, k, v);\n    }\n\n    typedef typename HashMapImpl::Range Range;\n    Range all() const {\n        return map.all();\n    }\n\n    typedef typename HashMapImpl::Enum Enum;\n\n    void clear() {\n        map.clear();\n    }\n\n    void finish() {\n        map.finish();\n    }\n\n    bool empty() const {\n        return map.empty();\n    }\n\n    uint32_t count() const {\n        return map.count();\n    }\n\n    size_t capacity() const {\n        return map.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return map.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return map.has(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        return map.put(k, v);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        return map.putNew(k, v);\n    }\n\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        return map.lookupWithDefault(k, defaultValue);\n    }\n\n    void remove(const Lookup &l) {\n        map.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashMapRooter(const AutoHashMapRooter &hmr) MOZ_DELETE;\n    AutoHashMapRooter &operator=(const AutoHashMapRooter &hmr) MOZ_DELETE;\n\n    HashMapImpl map;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class T>\nclass AutoHashSetRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashSet<T> HashSetImpl;\n\n  public:\n    explicit AutoHashSetRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), set(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef typename HashSetImpl::Lookup Lookup;\n    typedef typename HashSetImpl::Ptr Ptr;\n    typedef typename HashSetImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return set.init(len);\n    }\n    bool initialized() const {\n        return set.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return set.lookup(l);\n    }\n    void remove(Ptr p) {\n        set.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return set.lookupForAdd(l);\n    }\n\n    bool add(AddPtr &p, const T &t) {\n        return set.add(p, t);\n    }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return set.relookupOrAdd(p, l, t);\n    }\n\n    typedef typename HashSetImpl::Range Range;\n    Range all() const {\n        return set.all();\n    }\n\n    typedef typename HashSetImpl::Enum Enum;\n\n    void clear() {\n        set.clear();\n    }\n\n    void finish() {\n        set.finish();\n    }\n\n    bool empty() const {\n        return set.empty();\n    }\n\n    uint32_t count() const {\n        return set.count();\n    }\n\n    size_t capacity() const {\n        return set.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return set.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return set.has(l);\n    }\n\n    bool put(const T &t) {\n        return set.put(t);\n    }\n\n    bool putNew(const T &t) {\n        return set.putNew(t);\n    }\n\n    void remove(const Lookup &l) {\n        set.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashSetRooter(const AutoHashSetRooter &hmr) MOZ_DELETE;\n    AutoHashSetRooter &operator=(const AutoHashSetRooter &hmr) MOZ_DELETE;\n\n    HashSetImpl set;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoValueVector : public AutoVectorRooter<Value>\n{\n  public:\n    explicit AutoValueVector(JSContext *cx\n                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<Value>(cx, VALVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoIdVector : public AutoVectorRooter<jsid>\n{\n  public:\n    explicit AutoIdVector(JSContext *cx\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<jsid>(cx, IDVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoObjectVector : public AutoVectorRooter<JSObject *>\n{\n  public:\n    explicit AutoObjectVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoFunctionVector : public AutoVectorRooter<JSFunction *>\n{\n  public:\n    explicit AutoFunctionVector(JSContext *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoFunctionVector(js::ContextFriendFields *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoScriptVector : public AutoVectorRooter<JSScript *>\n{\n  public:\n    explicit AutoScriptVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * Cutsom rooting behavior for internal and external clients.\n */\nclass JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter\n{\n  public:\n    template <typename CX>\n    explicit CustomAutoRooter(CX *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, CUSTOM)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  protected:\n    /* Supplied by derived class to trace roots. */\n    virtual void trace(JSTracer *trc) = 0;\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Returns true if |v| is considered an acceptable this-value. */\ntypedef bool (*IsAcceptableThis)(const Value &v);\n\n/*\n * Implements the guts of a method; guaranteed to be provided an acceptable\n * this-value, as determined by a corresponding IsAcceptableThis method.\n */\ntypedef bool (*NativeImpl)(JSContext *cx, CallArgs args);\n\nnamespace detail {\n\n/* DON'T CALL THIS DIRECTLY.  It's for use only by CallNonGenericMethod! */\nextern JS_PUBLIC_API(bool)\nCallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n\n} /* namespace detail */\n\n/*\n * Methods usually act upon |this| objects only from a single global object and\n * compartment.  Sometimes, however, a method must act upon |this| values from\n * multiple global objects or compartments.  In such cases the |this| value a\n * method might see will be wrapped, such that various access to the object --\n * to its class, its private data, its reserved slots, and so on -- will not\n * work properly without entering that object's compartment.  This method\n * implements a solution to this problem.\n *\n * To implement a method that accepts |this| values from multiple compartments,\n * define two functions.  The first function matches the IsAcceptableThis type\n * and indicates whether the provided value is an acceptable |this| for the\n * method; it must be a pure function only of its argument.\n *\n *   static JSClass AnswerClass = { ... };\n *\n *   static bool\n *   IsAnswerObject(const Value &v)\n *   {\n *       if (!v.isObject())\n *           return false;\n *       return JS_GetClass(&v.toObject()) == &AnswerClass;\n *   }\n *\n * The second function implements the NativeImpl signature and defines the\n * behavior of the method when it is provided an acceptable |this| value.\n * Aside from some typing niceties -- see the CallArgs interface for details --\n * its interface is the same as that of JSNative.\n *\n *   static bool\n *   answer_getAnswer_impl(JSContext *cx, JS::CallArgs args)\n *   {\n *       args.rval().setInt32(42);\n *       return true;\n *   }\n *\n * The implementation function is guaranteed to be called *only* with a |this|\n * value which is considered acceptable.\n *\n * Now to implement the actual method, write a JSNative that calls the method\n * declared below, passing the appropriate template and runtime arguments.\n *\n *   static JSBool\n *   answer_getAnswer(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *       return JS::CallNonGenericMethod<IsAnswerObject, answer_getAnswer_impl>(cx, args);\n *   }\n *\n * Note that, because they are used as template arguments, the predicate\n * and implementation functions must have external linkage. (This is\n * unfortunate, but GCC wasn't inlining things as one would hope when we\n * passed them as function arguments.)\n *\n * JS::CallNonGenericMethod will test whether |args.thisv()| is acceptable.  If\n * it is, it will call the provided implementation function, which will return\n * a value and indicate success.  If it is not, it will attempt to unwrap\n * |this| and call the implementation function on the unwrapped |this|.  If\n * that succeeds, all well and good.  If it doesn't succeed, a TypeError will\n * be thrown.\n *\n * Note: JS::CallNonGenericMethod will only work correctly if it's called in\n *       tail position in a JSNative.  Do not call it from any other place.\n */\ntemplate<IsAcceptableThis Test, NativeImpl Impl>\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\n}  /* namespace JS */\n\n/************************************************************************/\n\n/* JSClass operation signatures. */\n\n/*\n * Add or get a property named by id in obj.  Note the jsid id type -- id may\n * be a string (Unicode property identifier) or an int (element index).  The\n * *vp out parameter, on success, is the new property value after the action.\n */\ntypedef JSBool\n(* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Set a property named by id in obj, treating the assignment as strict\n * mode code if strict is true. Note the jsid id type -- id may be a string\n * (Unicode property identifier) or an int (element index). The *vp out\n * parameter, on success, is the new property value after the\n * set.\n */\ntypedef JSBool\n(* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Delete a property named by id in obj.\n *\n * If an error occurred, return false as per normal JSAPI error practice.\n *\n * If no error occurred, but the deletion attempt wasn't allowed (perhaps\n * because the property was non-configurable), set *succeeded to false and\n * return true.  This will cause |delete obj[id]| to evaluate to false in\n * non-strict mode code, and to throw a TypeError in strict mode code.\n *\n * If no error occurred and the deletion wasn't disallowed (this is *not* the\n * same as saying that a deletion actually occurred -- deleting a non-existent\n * property, or an inherited property, is allowed -- it's just pointless),\n * set *succeeded to true and return true.\n */\ntypedef JSBool\n(* JSDeletePropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);\n\n/*\n * This function type is used for callbacks that enumerate the properties of\n * a JSObject.  The behavior depends on the value of enum_op:\n *\n *  JSENUMERATE_INIT\n *    A new, opaque iterator state should be allocated and stored in *statep.\n *    (You can use PRIVATE_TO_JSVAL() to tag the pointer to be stored).\n *\n *    The number of properties that will be enumerated should be returned as\n *    an integer jsval in *idp, if idp is non-null, and provided the number of\n *    enumerable properties is known.  If idp is non-null and the number of\n *    enumerable properties can't be computed in advance, *idp should be set\n *    to JSVAL_ZERO.\n *\n *  JSENUMERATE_INIT_ALL\n *    Used identically to JSENUMERATE_INIT, but exposes all properties of the\n *    object regardless of enumerability.\n *\n *  JSENUMERATE_NEXT\n *    A previously allocated opaque iterator state is passed in via statep.\n *    Return the next jsid in the iteration using *idp.  The opaque iterator\n *    state pointed at by statep is destroyed and *statep is set to JSVAL_NULL\n *    if there are no properties left to enumerate.\n *\n *  JSENUMERATE_DESTROY\n *    Destroy the opaque iterator state previously allocated in *statep by a\n *    call to this function when enum_op was JSENUMERATE_INIT or\n *    JSENUMERATE_INIT_ALL.\n *\n * The return value is used to indicate success, with a value of JS_FALSE\n * indicating failure.\n */\ntypedef JSBool\n(* JSNewEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,\n                     JS::MutableHandle<JS::Value> statep, JS::MutableHandleId idp);\n\n/*\n * The old-style JSClass.enumerate op should define all lazy properties not\n * yet reflected in obj.\n */\ntypedef JSBool\n(* JSEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/*\n * Resolve a lazy property named by id in obj by defining it directly in obj.\n * Lazy properties are those reflected from some peer native property space\n * (e.g., the DOM attributes for a given node reflected as obj) on demand.\n *\n * JS looks for a property in an object, and if not found, tries to resolve\n * the given id.  If resolve succeeds, the engine looks again in case resolve\n * defined obj[id].  If no such property exists directly in obj, the process\n * is repeated with obj's prototype, etc.\n *\n * NB: JSNewResolveOp provides a cheaper way to resolve lazy properties.\n */\ntypedef JSBool\n(* JSResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\n/*\n * Like JSResolveOp, but flags provide contextual information as follows:\n *\n *  JSRESOLVE_ASSIGNING   obj[id] is on the left-hand side of an assignment\n *\n * The *objp out parameter, on success, should be null to indicate that id\n * was not resolved; and non-null, referring to obj or one of its prototypes,\n * if id was resolved.  The hook may assume *objp is null on entry.\n *\n * This hook instead of JSResolveOp is called via the JSClass.resolve member\n * if JSCLASS_NEW_RESOLVE is set in JSClass.flags.\n */\ntypedef JSBool\n(* JSNewResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,\n                   JS::MutableHandleObject objp);\n\n/*\n * Convert obj to the given type, returning true with the resulting value in\n * *vp on success, and returning false on error or exception.\n */\ntypedef JSBool\n(* JSConvertOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n                JS::MutableHandle<JS::Value> vp);\n\ntypedef struct JSFreeOp JSFreeOp;\n\nstruct JSFreeOp {\n  private:\n    JSRuntime   *runtime_;\n\n  protected:\n    JSFreeOp(JSRuntime *rt)\n      : runtime_(rt) { }\n\n  public:\n    JSRuntime *runtime() const {\n        return runtime_;\n    }\n};\n\n/*\n * Finalize obj, which the garbage collector has determined to be unreachable\n * from other live objects or from GC roots.  Obviously, finalizers must never\n * store a reference to obj.\n */\ntypedef void\n(* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);\n\n/*\n * Finalizes external strings created by JS_NewExternalString.\n */\ntypedef struct JSStringFinalizer JSStringFinalizer;\n\nstruct JSStringFinalizer {\n    void (*finalize)(const JSStringFinalizer *fin, jschar *chars);\n};\n\n/*\n * JSClass.checkAccess type: check whether obj[id] may be accessed per mode,\n * returning false on error/exception, true on success with obj[id]'s last-got\n * value in *vp, and its attributes in *attrsp.  As for JSPropertyOp above, id\n * is either a string or an int jsval.\n */\ntypedef JSBool\n(* JSCheckAccessOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                    JSAccessMode mode, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Check whether v is an instance of obj.  Return false on error or exception,\n * true on success with JS_TRUE in *bp if v is an instance of obj, JS_FALSE in\n * *bp otherwise.\n */\ntypedef JSBool\n(* JSHasInstanceOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,\n                    JSBool *bp);\n\n/*\n * Function type for trace operation of the class called to enumerate all\n * traceable things reachable from obj's private data structure. For each such\n * thing, a trace implementation must call one of the JS_Call*Tracer variants\n * on the thing.\n *\n * JSTraceOp implementation can assume that no other threads mutates object\n * state. It must not change state of the object or corresponding native\n * structures. The only exception for this rule is the case when the embedding\n * needs a tight integration with GC. In that case the embedding can check if\n * the traversal is a part of the marking phase through calling\n * JS_IsGCMarkingTracer and apply a special code like emptying caches or\n * marking its native structures.\n */\ntypedef void\n(* JSTraceOp)(JSTracer *trc, JSObject *obj);\n\n/*\n * Callback that JSTraceOp implementation can provide to return a string\n * describing the reference traced with JS_CallTracer.\n */\ntypedef void\n(* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);\n\ntypedef JSObject *\n(* JSWeakmapKeyDelegateOp)(JSObject *obj);\n\n/* Callbacks and their arguments. */\n\ntypedef enum JSContextOp {\n    JSCONTEXT_NEW,\n    JSCONTEXT_DESTROY\n} JSContextOp;\n\n/*\n * The possible values for contextOp when the runtime calls the callback are:\n *   JSCONTEXT_NEW      JS_NewContext successfully created a new JSContext\n *                      instance. The callback can initialize the instance as\n *                      required. If the callback returns false, the instance\n *                      will be destroyed and JS_NewContext returns null. In\n *                      this case the callback is not called again.\n *   JSCONTEXT_DESTROY  One of JS_DestroyContext* methods is called. The\n *                      callback may perform its own cleanup and must always\n *                      return true.\n *   Any other value    For future compatibility the callback must do nothing\n *                      and return true in this case.\n */\ntypedef JSBool\n(* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data);\n\ntypedef enum JSGCStatus {\n    JSGC_BEGIN,\n    JSGC_END\n} JSGCStatus;\n\ntypedef void\n(* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data);\n\ntypedef enum JSFinalizeStatus {\n    /*\n     * Called when preparing to sweep a group of compartments, before anything\n     * has been swept.  The collector will not yield to the mutator before\n     * calling the callback with JSFINALIZE_GROUP_END status.\n     */\n    JSFINALIZE_GROUP_START,\n\n    /*\n     * Called when preparing to sweep a group of compartments. Weak references\n     * to unmarked things have been removed and things that are not swept\n     * incrementally have been finalized at this point.  The collector may yield\n     * to the mutator after this point.\n     */\n    JSFINALIZE_GROUP_END,\n\n    /*\n     * Called at the end of collection when everything has been swept.\n     */\n    JSFINALIZE_COLLECTION_END\n} JSFinalizeStatus;\n\ntypedef void\n(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment);\n\n/*\n * Generic trace operation that calls JS_CallTracer on each traceable thing\n * stored in data.\n */\ntypedef void\n(* JSTraceDataOp)(JSTracer *trc, void *data);\n\ntypedef JSBool\n(* JSOperationCallback)(JSContext *cx);\n\ntypedef void\n(* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);\n\n#ifdef MOZ_TRACE_JSCALLS\ntypedef void\n(* JSFunctionCallback)(const JSFunction *fun,\n                       const JSScript *scr,\n                       const JSContext *cx,\n                       int entering);\n#endif\n\n/*\n * Possible exception types. These types are part of a JSErrorFormatString\n * structure. They define which error to throw in case of a runtime error.\n * JSEXN_NONE marks an unthrowable error.\n */\ntypedef enum JSExnType {\n    JSEXN_NONE = -1,\n      JSEXN_ERR,\n        JSEXN_INTERNALERR,\n        JSEXN_EVALERR,\n        JSEXN_RANGEERR,\n        JSEXN_REFERENCEERR,\n        JSEXN_SYNTAXERR,\n        JSEXN_TYPEERR,\n        JSEXN_URIERR,\n        JSEXN_LIMIT\n} JSExnType;\n\ntypedef struct JSErrorFormatString {\n    /* The error format string in ASCII. */\n    const char *format;\n\n    /* The number of arguments to expand in the formatted error message. */\n    uint16_t argCount;\n\n    /* One of the JSExnType constants above. */\n    int16_t exnType;\n} JSErrorFormatString;\n\ntypedef const JSErrorFormatString *\n(* JSErrorCallback)(void *userRef, const char *locale,\n                    const unsigned errorNumber);\n\ntypedef JSBool\n(* JSLocaleToUpperCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToLowerCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleCompare)(JSContext *cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,\n                    JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandle<JS::Value> rval);\n\n/*\n * Security protocol types.\n */\n\ntypedef void\n(* JSDestroyPrincipalsOp)(JSPrincipals *principals);\n\n/*\n * Used to check if a CSP instance wants to disable eval() and friends.\n * See js_CheckCSPPermitsJSAction() in jsobj.\n */\ntypedef JSBool\n(* JSCSPEvalChecker)(JSContext *cx);\n\n/*\n * Callback used to ask the embedding for the cross compartment wrapper handler\n * that implements the desired prolicy for this kind of object in the\n * destination compartment. |obj| is the object to be wrapped. If |existing| is\n * non-NULL, it will point to an existing wrapper object that should be re-used\n * if possible. |existing| is guaranteed to be a cross-compartment wrapper with\n * a lazily-defined prototype and the correct global. It is guaranteed not to\n * wrap a function.\n */\ntypedef JSObject *\n(* JSWrapObjectCallback)(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj,\n                         JS::HandleObject proto, JS::HandleObject parent,\n                         unsigned flags);\n\n/*\n * Callback used by the wrap hook to ask the embedding to prepare an object\n * for wrapping in a context. This might include unwrapping other wrappers\n * or even finding a more suitable object for the new compartment.\n */\ntypedef JSObject *\n(* JSPreWrapCallback)(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj,\n                      unsigned flags);\n\n/*\n * Callback used when wrapping determines that the underlying object is already\n * in the compartment for which it is being wrapped. This allows consumers to\n * maintain same-compartment wrapping invariants.\n *\n * |obj| is guaranteed to be same-compartment as |cx|, but it may (or may not)\n * be a security or cross-compartment wrapper. This is an unfortunate contract,\n * but is important for to avoid unnecessarily recomputing every cross-\n * compartment wrapper that gets passed to wrap.\n */\ntypedef JSObject *\n(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JS::HandleObject obj);\n\ntypedef void\n(* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);\n\ntypedef void\n(* JSCompartmentNameCallback)(JSRuntime *rt, JSCompartment *compartment,\n                              char *buf, size_t bufsize);\n\n/*\n * Read structured data from the reader r. This hook is used to read a value\n * previously serialized by a call to the WriteStructuredCloneOp hook.\n *\n * tag and data are the pair of uint32_t values from the header. The callback\n * may use the JS_Read* APIs to read any other relevant parts of the object\n * from the reader r. closure is any value passed to the JS_ReadStructuredClone\n * function. Return the new object on success, NULL on error/exception.\n */\ntypedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,\n                                           uint32_t tag, uint32_t data, void *closure);\n\n/*\n * Structured data serialization hook. The engine can write primitive values,\n * Objects, Arrays, Dates, RegExps, TypedArrays, and ArrayBuffers. Any other\n * type of object requires application support. This callback must first use\n * the JS_WriteUint32Pair API to write an object header, passing a value\n * greater than JS_SCTAG_USER to the tag parameter. Then it can use the\n * JS_Write* APIs to write any other relevant parts of the value v to the\n * writer w. closure is any value passed to the JS_WriteStructuredCLone function.\n *\n * Return true on success, false on error/exception.\n */\ntypedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,\n                                         JS::Handle<JSObject*> obj, void *closure);\n\n/*\n * This is called when JS_WriteStructuredClone is given an invalid transferable.\n * To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException\n * with error set to one of the JS_SCERR_* values.\n */\ntypedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);\n\n/************************************************************************/\n\n/*\n * JS constants. For efficiency, prefer predicates (e.g. v.isNull()) and\n * constructing values from scratch (e.g. Int32Value(0)).  These constants are\n * stored in memory and initialized at startup, so testing against them and\n * using them requires memory loads and will be correspondingly slow.\n */\nextern JS_PUBLIC_DATA(const jsval) JSVAL_NULL;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ZERO;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ONE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_FALSE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_TRUE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_VOID;\n\nstatic JS_ALWAYS_INLINE jsval\nJS_NumberValue(double d)\n{\n    int32_t i;\n    d = JS::CanonicalizeNaN(d);\n    if (mozilla::DoubleIsInt32(d, &i))\n        return INT_TO_JSVAL(i);\n    return DOUBLE_TO_JSVAL(d);\n}\n\n/************************************************************************/\n\n/*\n * A jsid is an identifier for a property or method of an object which is\n * either a 31-bit signed integer, interned string or object.  Also, there is\n * an additional jsid value, JSID_VOID, which does not occur in JS scripts but\n * may be used to indicate the absence of a valid jsid.\n *\n * A jsid is not implicitly convertible to or from a jsval; JS_ValueToId or\n * JS_IdToValue must be used instead.\n */\n\n#define JSID_TYPE_STRING                 0x0\n#define JSID_TYPE_INT                    0x1\n#define JSID_TYPE_VOID                   0x2\n#define JSID_TYPE_OBJECT                 0x4\n#define JSID_TYPE_MASK                   0x7\n\n/*\n * Avoid using canonical 'id' for jsid parameters since this is a magic word in\n * Objective-C++ which, apparently, wants to be able to #include jsapi.h.\n */\n#define id iden\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_STRING(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJSID_TO_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSString *)JSID_BITS(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ZERO(jsid id)\n{\n    return JSID_BITS(id) == 0;\n}\n\nJS_PUBLIC_API(JSBool)\nJS_StringHasBeenInterned(JSContext *cx, JSString *str);\n\n/*\n * Only JSStrings that have been interned via the JSAPI can be turned into\n * jsids by API clients.\n *\n * N.B. if a jsid is backed by a string which has not been interned, that\n * string must be appropriately rooted to avoid being collected by the GC.\n */\nJS_PUBLIC_API(jsid)\nINTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_INT(jsid id)\n{\n    return !!(JSID_BITS(id) & JSID_TYPE_INT);\n}\n\nstatic JS_ALWAYS_INLINE int32_t\nJSID_TO_INT(jsid id)\n{\n    JS_ASSERT(JSID_IS_INT(id));\n    return ((uint32_t)JSID_BITS(id)) >> 1;\n}\n\n#define JSID_INT_MIN  0\n#define JSID_INT_MAX  INT32_MAX\n\nstatic JS_ALWAYS_INLINE JSBool\nINT_FITS_IN_JSID(int32_t i)\n{\n    return i >= 0;\n}\n\nstatic JS_ALWAYS_INLINE jsid\nINT_TO_JSID(int32_t i)\n{\n    jsid id;\n    JS_ASSERT(INT_FITS_IN_JSID(i));\n    JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_OBJECT(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT &&\n           (size_t)JSID_BITS(id) != JSID_TYPE_OBJECT;\n}\n\nstatic JS_ALWAYS_INLINE JSObject *\nJSID_TO_OBJECT(jsid id)\n{\n    JS_ASSERT(JSID_IS_OBJECT(id));\n    return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\nstatic JS_ALWAYS_INLINE jsid\nOBJECT_TO_JSID(JSObject *obj)\n{\n    jsid id;\n    JS_ASSERT(obj != NULL);\n    JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);\n    JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_GCTHING(jsid id)\n{\n    return JSID_IS_STRING(id) || JSID_IS_OBJECT(id);\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSID_TO_GCTHING(jsid id)\n{\n    return (void *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\n/*\n * A void jsid is not a valid id and only arises as an exceptional API return\n * value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into\n * JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in\n * hooks receiving a jsid except when explicitly noted in the API contract.\n */\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_VOID(const jsid id)\n{\n    JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,\n                 JSID_BITS(id) == JSID_TYPE_VOID);\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_EMPTY(const jsid id)\n{\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);\n}\n\n#undef id\n\n#ifdef JS_USE_JSID_STRUCT_TYPES\nextern JS_PUBLIC_DATA(const jsid) JSID_VOID;\nextern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;\n#else\n# define JSID_VOID ((jsid)JSID_TYPE_VOID)\n# define JSID_EMPTY ((jsid)JSID_TYPE_OBJECT)\n#endif\n\n/*\n * Returns true iff the given jsval is immune to GC and can be used across\n * multiple JSRuntimes without requiring any conversion API.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_UNIVERSAL(jsval v)\n{\n    return !JSVAL_IS_GCTHING(v);\n}\n\nnamespace JS {\n\nclass AutoIdRooter : private AutoGCRooter\n{\n  public:\n    explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, ID), id_(aId)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    jsid id() {\n        return id_;\n    }\n\n    jsid * addr() {\n        return &id_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    jsid id_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n} /* namespace JS */\n\n/************************************************************************/\n\n/* Property attributes, set in JSPropertySpec and passed to API functions. */\n#define JSPROP_ENUMERATE        0x01    /* property is visible to for/in loop */\n#define JSPROP_READONLY         0x02    /* not settable: assignment is no-op.\n                                           This flag is only valid when neither\n                                           JSPROP_GETTER nor JSPROP_SETTER is\n                                           set. */\n#define JSPROP_PERMANENT        0x04    /* property cannot be deleted */\n#define JSPROP_NATIVE_ACCESSORS 0x08    /* set in JSPropertyDescriptor.flags\n                                           if getters/setters are JSNatives */\n#define JSPROP_GETTER           0x10    /* property holds getter function */\n#define JSPROP_SETTER           0x20    /* property holds setter function */\n#define JSPROP_SHARED           0x40    /* don't allocate a value slot for this\n                                           property; don't copy the property on\n                                           set of the same-named property in an\n                                           object that delegates to a prototype\n                                           containing this property */\n#define JSPROP_INDEX            0x80    /* name is actually (int) index */\n#define JSPROP_SHORTID         0x100    /* set in JS_DefineProperty attrs\n                                           if getters/setters use a shortid */\n\n#define JSFUN_STUB_GSOPS       0x200    /* use JS_PropertyStub getter/setter\n                                           instead of defaulting to class gsops\n                                           for property holding function */\n\n#define JSFUN_CONSTRUCTOR      0x400    /* native that can be called as a ctor */\n\n\n/*\n * Specify a generic native prototype methods, i.e., methods of a class\n * prototype that are exposed as static methods taking an extra leading\n * argument: the generic |this| parameter.\n *\n * If you set this flag in a JSFunctionSpec struct's flags initializer, then\n * that struct must live at least as long as the native static method object\n * created due to this flag by JS_DefineFunctions or JS_InitClass.  Typically\n * JSFunctionSpec structs are allocated in static arrays.\n */\n#define JSFUN_GENERIC_NATIVE   0x800\n\n#define JSFUN_FLAGS_MASK       0xe00    /* | of all the JSFUN_* flags */\n\n/*\n * The first call to JS_CallOnce by any thread in a process will call 'func'.\n * Later calls to JS_CallOnce with the same JSCallOnceType object will be\n * suppressed.\n *\n * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce\n * to invoke its JSInitCallback.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CallOnce(JSCallOnceType *once, JSInitCallback func);\n\n/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */\nextern JS_PUBLIC_API(int64_t)\nJS_Now(void);\n\n/* Don't want to export data, so provide accessors for non-inline jsvals. */\nextern JS_PUBLIC_API(jsval)\nJS_GetNaNValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetNegativeInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetPositiveInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetEmptyStringValue(JSContext *cx);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetEmptyString(JSRuntime *rt);\n\n/*\n * Format is a string of the following characters (spaces are insignificant),\n * specifying the tabulated type conversions:\n *\n *   b      JSBool          Boolean\n *   c      uint16_t/jschar ECMA uint16_t, Unicode char\n *   i      int32_t         ECMA int32_t\n *   u      uint32_t        ECMA uint32_t\n *   j      int32_t         Rounded int32_t (coordinate)\n *   d      double          IEEE double\n *   I      double          Integral IEEE double\n *   S      JSString *      Unicode string, accessed by a JSString pointer\n *   W      jschar *        Unicode character vector, 0-terminated (W for wide)\n *   o      JSObject *      Object reference\n *   f      JSFunction *    Function private\n *   v      jsval           Argument value (no conversion)\n *   *      N/A             Skip this argument (no vararg)\n *   /      N/A             End of required arguments\n *\n * The variable argument list after format must consist of &b, &c, &s, e.g.,\n * where those variables have the types given above.  For the pointer types\n * char *, JSString *, and JSObject *, the pointed-at memory returned belongs\n * to the JS runtime, not to the calling native code.  The runtime promises\n * to keep this memory valid so long as argv refers to allocated stack space\n * (so long as the native function is active).\n *\n * Fewer arguments than format specifies may be passed only if there is a /\n * in format after the last required argument specifier and argc is at least\n * the number of required arguments.  More arguments than format specifies\n * may be passed without error; it is up to the caller to deal with trailing\n * unconverted arguments.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format,\n                    ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv,\n                      const char *format, va_list ap);\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToObject(JSContext *cx, jsval v, JSObject **objp);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToFunction(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToConstructor(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToString(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToSource(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToNumber(JSContext *cx, jsval v, double *dp);\n\nnamespace js {\n/*\n * DO NOT CALL THIS.  Use JS::ToNumber\n */\nextern JS_PUBLIC_API(bool)\nToNumberSlow(JSContext *cx, JS::Value v, double *dp);\n\n/*\n * DO NOT CALL THIS. Use JS::ToBoolean\n */\nextern JS_PUBLIC_API(bool)\nToBooleanSlow(const JS::Value &v);\n} /* namespace js */\n\nnamespace JS {\n\n/* ES5 9.3 ToNumber. */\nJS_ALWAYS_INLINE bool\nToNumber(JSContext *cx, HandleValue v, double *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    {\n        js::SkipRoot root(cx, &v);\n        js::MaybeCheckStackRoots(cx);\n    }\n\n    if (v.isNumber()) {\n        *out = v.toNumber();\n        return true;\n    }\n    return js::ToNumberSlow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToBoolean(const Value &v)\n{\n    if (v.isBoolean())\n        return v.toBoolean();\n    if (v.isInt32())\n        return v.toInt32() != 0;\n    if (v.isNullOrUndefined())\n        return false;\n    if (v.isDouble()) {\n        double d = v.toDouble();\n        return !mozilla::IsNaN(d) && d != 0;\n    }\n\n    /* The slow path handles strings and objects. */\n    return js::ToBooleanSlow(v);\n}\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_DoubleIsInt32(double d, int32_t *ip);\n\nextern JS_PUBLIC_API(int32_t)\nJS_DoubleToInt32(double d);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_DoubleToUint32(double d);\n\n/*\n * Convert a value to a number, then to an int32_t, according to the ECMA rules\n * for ToInt32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * Convert a value to a number, then to an int64_t, according to the WebIDL\n * rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt64(JSContext *cx, jsval v, int64_t *ip);\n\n/*\n * Convert a value to a number, then to an uint64_t, according to the WebIDL\n * rules for ToUint64: http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint64(JSContext *cx, jsval v, uint64_t *ip);\n\nnamespace js {\n/* DO NOT CALL THIS.  Use JS::ToInt16. */\nextern JS_PUBLIC_API(bool)\nToUint16Slow(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToInt32. */\nextern JS_PUBLIC_API(bool)\nToInt32Slow(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToUint32. */\nextern JS_PUBLIC_API(bool)\nToUint32Slow(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToInt64. */\nextern JS_PUBLIC_API(bool)\nToInt64Slow(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToUint64. */\nextern JS_PUBLIC_API(bool)\nToUint64Slow(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out);\n} /* namespace js */\n\nnamespace JS {\n\nJS_ALWAYS_INLINE bool\nToUint16(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint16_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint16Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt32(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = v.toInt32();\n        return true;\n    }\n    return js::ToInt32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint32(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint32_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt64(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = int64_t(v.toInt32());\n        return true;\n    }\n\n    return js::ToInt64Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint64(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        /* Account for sign extension of negatives into the longer 64bit space. */\n        *out = uint64_t(int64_t(v.toInt32()));\n        return true;\n    }\n\n    return js::ToUint64Slow(cx, v, out);\n}\n\n\n} /* namespace JS */\n\n/*\n * Convert a value to a number, then to a uint32_t, according to the ECMA rules\n * for ToUint32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);\n\n/*\n * Convert a value to a number, then to an int32_t if it fits by rounding to\n * nearest; but failing with an error report if the double is out of range\n * or unordered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * ECMA ToUint16, for mapping a jsval to a Unicode point.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(JSType)\nJS_TypeOfValue(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTypeName(JSContext *cx, JSType type);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same);\n\n/* True iff fun is the global eval function. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinEvalFunction(JSFunction *fun);\n\n/* True iff fun is the Function constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinFunctionConstructor(JSFunction *fun);\n\n/************************************************************************/\n\n/*\n * Initialization, locking, contexts, and memory allocation.\n *\n * It is important that the first runtime and first context be created in a\n * single-threaded fashion, otherwise the behavior of the library is undefined.\n * See: http://developer.mozilla.org/en/docs/Category:JSAPI_Reference\n */\n\ntypedef enum JSUseHelperThreads\n{\n    JS_NO_HELPER_THREADS,\n    JS_USE_HELPER_THREADS\n} JSUseHelperThreads;\n\n/**\n * Initialize SpiderMonkey, returning true only if initialization succeeded.\n * Once this method has succeeded, it is safe to call JS_NewRuntime and other\n * JSAPI methods.\n *\n * This method must be called before any other JSAPI method is used on any\n * thread.  Once it has been used, it is safe to call any JSAPI method, and it\n * remains safe to do so until JS_ShutDown is correctly called.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_Init(void);\n\n/**\n * Destroy free-standing resources allocated by SpiderMonkey, not associated\n * with any runtime, context, or other structure.\n *\n * This method should be called after all other JSAPI data has been properly\n * cleaned up: every new runtime must have been destroyed, every new context\n * must have been destroyed, and so on.  Calling this method before all other\n * resources have been destroyed has undefined behavior.\n *\n * Failure to call this method, at present, has no adverse effects other than\n * leaking memory.  This may not always be the case; it's recommended that all\n * embedders call this method when all other JSAPI operations have completed.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(void)\nJS_ShutDown(void);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_NewRuntime(uint32_t maxbytes, JSUseHelperThreads useHelperThreads);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyRuntime(JSRuntime *rt);\n\n// These are equivalent to ICU's |UMemAllocFn|, |UMemReallocFn|, and\n// |UMemFreeFn| types.  The first argument (called |context| in the ICU docs)\n// will always be NULL, and should be ignored.\ntypedef void *(*JS_ICUAllocFn)(const void *, size_t size);\ntypedef void *(*JS_ICUReallocFn)(const void *, void *p, size_t size);\ntypedef void (*JS_ICUFreeFn)(const void *, void *p);\n\n// This function can be used to track memory used by ICU.\n// Do not use it unless you know what you are doing!\nextern JS_PUBLIC_API(bool)\nJS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn, JS_ICUReallocFn reallocFn, JS_ICUFreeFn freeFn);\n\nJS_PUBLIC_API(void *)\nJS_GetRuntimePrivate(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nJS_PUBLIC_API(void)\nJS_SetRuntimePrivate(JSRuntime *rt, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_BeginRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_EndRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsInRequest(JSRuntime *rt);\n\nnamespace JS {\n\ninline bool\nIsPoisonedId(jsid iden)\n{\n    if (JSID_IS_STRING(iden))\n        return JS::IsPoisonedPtr(JSID_TO_STRING(iden));\n    if (JSID_IS_OBJECT(iden))\n        return JS::IsPoisonedPtr(JSID_TO_OBJECT(iden));\n    return false;\n}\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <> struct GCMethods<jsid>\n{\n    static jsid initial() { return JSID_VOID; }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(jsid id) { return JS::IsPoisonedId(id); }\n    static bool needsPostBarrier(jsid id) { return false; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(jsid *idp) {}\n    static void relocate(jsid *idp) {}\n#endif\n};\n\n} /* namespace js */\n\nclass JSAutoRequest\n{\n  public:\n    JSAutoRequest(JSContext *cx\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mContext(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_BeginRequest(mContext);\n    }\n    ~JSAutoRequest() {\n        JS_EndRequest(mContext);\n    }\n\n  protected:\n    JSContext *mContext;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n#if 0\n  private:\n    static void *operator new(size_t) CPP_THROW_NEW { return 0; };\n    static void operator delete(void *, size_t) { };\n#endif\n};\n\nclass JSAutoCheckRequest\n{\n  public:\n    JSAutoCheckRequest(JSContext *cx\n                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n#if defined JS_THREADSAFE && defined DEBUG\n        mContext = cx;\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));\n#endif\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoCheckRequest() {\n#if defined JS_THREADSAFE && defined DEBUG\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(mContext)));\n#endif\n    }\n\n\n  private:\n#if defined JS_THREADSAFE && defined DEBUG\n    JSContext *mContext;\n#endif\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback, void *data);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_NewContext(JSRuntime *rt, size_t stackChunkSize);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContext(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContextNoGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void *)\nJS_GetContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetSecondContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetSecondContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_ContextIterator(JSRuntime *rt, JSContext **iterp);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetVersion(JSContext *cx);\n\n// Mutate the version on the compartment. This is generally discouraged, but\n// necessary to support the version mutation in the js and xpc shell command\n// set.\n//\n// It would be nice to put this in jsfriendapi, but the linkage requirements\n// of the shells make that impossible.\nJS_PUBLIC_API(void)\nJS_SetVersionForCompartment(JSCompartment *compartment, JSVersion version);\n\nextern JS_PUBLIC_API(const char *)\nJS_VersionToString(JSVersion version);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_StringToVersion(const char *string);\n\n/*\n * JS options are orthogonal to version, and may be freely composed with one\n * another as well as with version.\n *\n * JSOPTION_VAROBJFIX is recommended -- see the comments associated with the\n * prototypes for JS_ExecuteScript, JS_EvaluateScript, etc.\n */\n#define JSOPTION_EXTRA_WARNINGS JS_BIT(0)       /* warn on dubious practices */\n#define JSOPTION_WERROR         JS_BIT(1)       /* convert warning to error */\n#define JSOPTION_VAROBJFIX      JS_BIT(2)       /* make JS_EvaluateScript use\n                                                   the last object on its 'obj'\n                                                   param's scope chain as the\n                                                   ECMA 'variables object' */\n#define JSOPTION_PRIVATE_IS_NSISUPPORTS \\\n                                JS_BIT(3)       /* context private data points\n                                                   to an nsISupports subclass */\n#define JSOPTION_COMPILE_N_GO   JS_BIT(4)       /* caller of JS_Compile*Script\n                                                   promises to execute compiled\n                                                   script once only; enables\n                                                   compile-time scope chain\n                                                   resolution of consts. */\n\n/* JS_BIT(5) is currently unused. */\n\n/* JS_BIT(6) is currently unused. */\n\n/* JS_BIT(7) is currently unused. */\n\n#define JSOPTION_DONT_REPORT_UNCAUGHT                                   \\\n                                JS_BIT(8)       /* When returning from the\n                                                   outermost API call, prevent\n                                                   uncaught exceptions from\n                                                   being converted to error\n                                                   reports */\n\n/* JS_BIT(9) is currently unused. */\n\n/* JS_BIT(10) is currently unused. */\n\n/* JS_BIT(11) is currently unused. */\n\n#define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12)      /* A promise to the compiler\n                                                   that a null rval out-param\n                                                   will be passed to each call\n                                                   to JS_ExecuteScript. */\n#define JSOPTION_UNROOTED_GLOBAL JS_BIT(13)     /* The GC will not root the\n                                                   contexts' default compartment\n                                                   object, leaving that up to the\n                                                   embedding. */\n\n#define JSOPTION_BASELINE       JS_BIT(14)      /* Baseline compiler. */\n\n#define JSOPTION_TYPE_INFERENCE JS_BIT(16)      /* Perform type inference. */\n#define JSOPTION_STRICT_MODE    JS_BIT(17)      /* Provides a way to force\n                                                   strict mode for all code\n                                                   without requiring\n                                                   \"use strict\" annotations. */\n\n#define JSOPTION_ION            JS_BIT(18)      /* IonMonkey */\n\n#define JSOPTION_ASMJS          JS_BIT(19)      /* optimizingasm.js compiler */\n\n#define JSOPTION_MASK           JS_BITMASK(20)\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetOptions(JSContext *cx);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_SetOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_ToggleOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(void)\nJS_SetJitHardening(JSRuntime *rt, JSBool enabled);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetImplementationVersion(void);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentNameCallback(JSRuntime *rt, JSCompartmentNameCallback callback);\n\nextern JS_PUBLIC_API(JSWrapObjectCallback)\nJS_SetWrapObjectCallbacks(JSRuntime *rt,\n                          JSWrapObjectCallback callback,\n                          JSSameCompartmentWrapObjectCallback sccallback,\n                          JSPreWrapCallback precallback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentPrivate(JSCompartment *compartment, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetCompartmentPrivate(JSCompartment *compartment);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapObject(JSContext *cx, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapValue(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapId(JSContext *cx, jsid *idp);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_TransplantObject(JSContext *cx, JS::HandleObject origobj, JS::HandleObject target);\n\nextern JS_FRIEND_API(JSObject *)\njs_TransplantObjectWithWrapper(JSContext *cx,\n                               JS::HandleObject origobj,\n                               JS::HandleObject origwrapper,\n                               JS::HandleObject targetobj,\n                               JS::HandleObject targetwrapper);\n\nextern JS_PUBLIC_API(JSBool)\nJS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob);\n\n/*\n * At any time, a JSContext has a current (possibly-NULL) compartment.\n * Compartments are described in:\n *\n *   developer.mozilla.org/en-US/docs/SpiderMonkey/SpiderMonkey_compartments\n *\n * The current compartment of a context may be changed. The preferred way to do\n * this is with JSAutoCompartment:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in some compartment 'c'\n *     {\n *       JSAutoCompartment ac(cx, obj);  // constructor enters\n *       // in the compartment of 'obj'\n *     }                                 // destructor leaves\n *     // back in compartment 'c'\n *   }\n *\n * For more complicated uses that don't neatly fit in a C++ stack frame, the\n * compartment can entered and left using separate function calls:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in 'oldCompartment'\n *     JSCompartment *oldCompartment = JS_EnterCompartment(cx, obj);\n *     // in the compartment of 'obj'\n *     JS_LeaveCompartment(cx, oldCompartment);\n *     // back in 'oldCompartment'\n *   }\n *\n * Note: these calls must still execute in a LIFO manner w.r.t all other\n * enter/leave calls on the context. Furthermore, only the return value of a\n * JS_EnterCompartment call may be passed as the 'oldCompartment' argument of\n * the corresponding JS_LeaveCompartment call.\n */\n\nclass JS_PUBLIC_API(JSAutoCompartment)\n{\n    JSContext *cx_;\n    JSCompartment *oldCompartment_;\n  public:\n    JSAutoCompartment(JSContext *cx, JSObject *target);\n    JSAutoCompartment(JSContext *cx, JSScript *target);\n    ~JSAutoCompartment();\n};\n\n/* NB: This API is infallible; a NULL return value does not indicate error. */\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartment(JSContext *cx, JSObject *target);\n\nextern JS_PUBLIC_API(void)\nJS_LeaveCompartment(JSContext *cx, JSCompartment *oldCompartment);\n\ntypedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);\n\n/*\n * This function calls |compartmentCallback| on every compartment.  Beware that\n * there is no guarantee that the compartment will survive after the callback\n * returns.\n */\nextern JS_PUBLIC_API(void)\nJS_IterateCompartments(JSRuntime *rt, void *data,\n                       JSIterateCompartmentCallback compartmentCallback);\n\n/*\n * Initialize standard JS class constructors, prototypes, and any top-level\n * functions and constants associated with the standard classes (e.g. isNaN\n * for Number).\n *\n * NB: This sets cx's global object to obj if it was null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitStandardClasses(JSContext *cx, JSObject *obj);\n\n/*\n * Resolve id, which must contain either a string or an int, to a standard\n * class name in obj if possible, defining the class's constructor and/or\n * prototype and storing true in *resolved.  If id does not name a standard\n * class or a top-level property induced by initializing a standard class,\n * store false in *resolved and just return true.  Return false on error,\n * as usual for JSBool result-typed API entry points.\n *\n * This API can be called directly from a global object class's resolve op,\n * to define standard classes lazily.  The class's enumerate op should call\n * JS_EnumerateStandardClasses(cx, obj), to define eagerly during for..in\n * loops any classes not yet resolved lazily.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStandardClass(JSContext *cx, JS::HandleObject obj, JS::HandleId id,\n                        JSBool *resolved);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStandardClasses(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSProtoKey)\nJS_IdentifyClassPrototype(JSContext *cx, JSObject *obj);\n\n/*\n * Returns the original value of |Function.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Object.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetObjectPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Array.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetArrayPrototype(JSContext *cx, JSObject *forObj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGlobalObject(JSObject *obj);\n\n/*\n * May return NULL, if |c| never had a global (e.g. the atoms compartment), or\n * if |c|'s global has been collected.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForCompartmentOrNull(JSContext *cx, JSCompartment *c);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(JSObject *)\nCurrentGlobalOrNull(JSContext *cx);\n\n}\n\n/*\n * This method returns the global corresponding to the most recent scripted\n * frame, which may not match the cx's current compartment. This is extremely\n * dangerous, because it can bypass compartment security invariants in subtle\n * ways. To use it safely, the caller must perform a subsequent security\n * check. There is currently only one consumer of this function in Gecko, and\n * it should probably stay that way. If you'd like to use it, please consult\n * the XPConnect module owner first.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetScriptedGlobal(JSContext *cx);\n\n/*\n * Initialize the 'Reflect' object on a global object.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_InitReflect(JSContext *cx, JSObject *global);\n\n#ifdef JS_HAS_CTYPES\n/*\n * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'\n * object will be sealed.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitCTypesClass(JSContext *cx, JSObject *global);\n\n/*\n * Convert a unicode string 'source' of length 'slen' to the platform native\n * charset, returning a null-terminated string allocated with JS_malloc. On\n * failure, this function should report an error.\n */\ntypedef char *\n(* JSCTypesUnicodeToNativeFun)(JSContext *cx, const jschar *source, size_t slen);\n\n/*\n * Set of function pointers that ctypes can use for various internal functions.\n * See JS_SetCTypesCallbacks below. Providing NULL for a function is safe,\n * and will result in the applicable ctypes functionality not being available.\n */\nstruct JSCTypesCallbacks {\n    JSCTypesUnicodeToNativeFun unicodeToNative;\n};\n\ntypedef struct JSCTypesCallbacks JSCTypesCallbacks;\n\n/*\n * Set the callbacks on the provided 'ctypesObj' object. 'callbacks' should be a\n * pointer to static data that exists for the lifetime of 'ctypesObj', but it\n * may safely be altered after calling this function and without having\n * to call this function again.\n */\nextern JS_PUBLIC_API(void)\nJS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);\n#endif\n\ntypedef JSBool\n(* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);\n\n/*\n * Enumerate memory regions that contain diagnostic information\n * intended to be included in crash report minidumps.\n */\nextern JS_PUBLIC_API(void)\nJS_EnumerateDiagnosticMemoryRegions(JSEnumerateDiagnosticMemoryCallback callback);\n\nextern JS_PUBLIC_API(void *)\nJS_malloc(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(void *)\nJS_realloc(JSContext *cx, void *p, size_t nbytes);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization.\n * cx may be NULL.\n */\nextern JS_PUBLIC_API(void)\nJS_free(JSContext *cx, void *p);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization as specified by the given JSFreeOp instance.\n */\nextern JS_PUBLIC_API(void)\nJS_freeop(JSFreeOp *fop, void *p);\n\nextern JS_PUBLIC_API(JSFreeOp *)\nJS_GetDefaultFreeOp(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_updateMallocCounter(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSContext *cx, const char *s);\n\n/* Duplicate a string.  Does not report an error on failure. */\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSRuntime *rt, const char *s);\n\n\n/*\n * A GC root is a pointer to a jsval, JSObject * or JSString * that itself\n * points into the GC heap. JS_AddValueRoot takes a pointer to a jsval and\n * JS_AddGCThingRoot takes a pointer to a JSObject * or JString *.\n *\n * Note that, since JS_Add*Root stores the address of a variable (of type\n * jsval, JSString *, or JSObject *), that variable must live until\n * JS_Remove*Root is called to remove that variable. For example, after:\n *\n *   void some_function() {\n *     jsval v;\n *     JS_AddNamedValueRoot(cx, &v, \"name\");\n *\n * the caller must perform\n *\n *     JS_RemoveValueRoot(cx, &v);\n *\n * before some_function() returns.\n *\n * Also, use JS_AddNamed*Root(cx, &structPtr->memberObj, \"structPtr->memberObj\")\n * in preference to JS_Add*Root(cx, &structPtr->memberObj), in order to identify\n * roots by their source callsites.  This way, you can find the callsite while\n * debugging if you should fail to do JS_Remove*Root(cx, &structPtr->memberObj)\n * before freeing structPtr's memory.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddObjectRoot(JSContext *cx, JSObject **rp);\n\n#ifdef NAME_ALL_GC_ROOTS\n#define JS_DEFINE_TO_TOKEN(def) #def\n#define JS_DEFINE_TO_STRING(def) JS_DEFINE_TO_TOKEN(def)\n#define JS_AddValueRoot(cx,vp) JS_AddNamedValueRoot((cx), (vp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddStringRoot(cx,rp) JS_AddNamedStringRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddObjectRoot(cx,rp) JS_AddNamedObjectRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRoot(JSContext *cx, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRoot(JSContext *cx, JSScript **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRootRT(JSRuntime *rt, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRootRT(JSRuntime *rt, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);\n\n/* TODO: remove these APIs */\n\nextern JS_FRIEND_API(void)\njs_RemoveRoot(JSRuntime *rt, void *rp);\n\n/*\n * C-compatible version of the Anchor class. It should be called after the last\n * use of the variable it protects.\n */\nextern JS_NEVER_INLINE JS_PUBLIC_API(void)\nJS_AnchorPtr(void *p);\n\n/*\n * Register externally maintained GC roots.\n *\n * traceOp: the trace operation. For each root the implementation should call\n *          JS_CallTracer whenever the root contains a traceable thing.\n * data:    the data argument to pass to each invocation of traceOp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/* Undo a call to JS_AddExtraGCRootsTracer. */\nextern JS_PUBLIC_API(void)\nJS_RemoveExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/*\n * JS_CallTracer API and related macros for implementors of JSTraceOp, to\n * enumerate all references to traceable things reachable via a property or\n * other strong ref identified for debugging purposes by name or index or\n * a naming callback.\n *\n * See the JSTraceOp typedef.\n */\n\n/*\n * Use the following macros to check if a particular jsval is a traceable\n * thing and to extract the thing and its kind to pass to JS_CallTracer.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_TRACEABLE(jsval v)\n{\n    return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSVAL_TO_TRACEABLE(jsval v)\n{\n    return JSVAL_TO_GCTHING(v);\n}\n\nstatic JS_ALWAYS_INLINE JSGCTraceKind\nJSVAL_TRACE_KIND(jsval v)\n{\n    JS_ASSERT(JSVAL_IS_GCTHING(v));\n    return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/*\n * Tracer callback, called for each traceable thing directly referenced by a\n * particular object or runtime structure. It is the callback responsibility\n * to ensure the traversal of the full object graph via calling eventually\n * JS_TraceChildren on the passed thing. In this case the callback must be\n * prepared to deal with cycles in the traversal graph.\n *\n * kind argument is one of JSTRACE_OBJECT, JSTRACE_STRING or a tag denoting\n * internal implementation-specific traversal kind. In the latter case the only\n * operations on thing that the callback can do is to call JS_TraceChildren or\n * JS_GetTraceThingInfo.\n *\n * If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all\n * of its mappings.  This should be used in cases where the tracer\n * wants to use the existing liveness of entries.\n */\ntypedef void\n(* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);\n\nenum WeakMapTraceKind {\n    DoNotTraceWeakMaps = 0,\n    TraceWeakMapValues = 1,\n    TraceWeakMapKeysValues = 2\n};\n\nstruct JSTracer {\n    JSRuntime           *runtime;\n    JSTraceCallback     callback;\n    JSTraceNamePrinter  debugPrinter;\n    const void          *debugPrintArg;\n    size_t              debugPrintIndex;\n    WeakMapTraceKind    eagerlyTraceWeakMaps;\n#ifdef JS_GC_ZEAL\n    void                *realLocation;\n#endif\n};\n\n/*\n * Set debugging information about a reference to a traceable thing to prepare\n * for the following call to JS_CallTracer.\n *\n * When printer is null, arg must be const char * or char * C string naming\n * the reference and index must be either (size_t)-1 indicating that the name\n * alone describes the reference or it must be an index into some array vector\n * that stores the reference.\n *\n * When printer callback is not null, the arg and index arguments are\n * available to the callback as debugPrintArg and debugPrintIndex fields\n * of JSTracer.\n *\n * The storage for name or callback's arguments needs to live only until\n * the following call to JS_CallTracer returns.\n */\n# define JS_SET_TRACING_DETAILS(trc, printer, arg, index)                     \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->debugPrinter = (printer);                                      \\\n        (trc)->debugPrintArg = (arg);                                         \\\n        (trc)->debugPrintIndex = (index);                                     \\\n    JS_END_MACRO\n\n/*\n * Sets the real location for a marked reference, when passing the address\n * directly is not feasable.\n *\n * FIXME: This is currently overcomplicated by our need to nest calls for Values\n * stored as keys in hash tables, but will get simplified once we can rekey\n * in-place.\n */\n#ifdef JS_GC_ZEAL\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n        if (!(trc)->realLocation || !(location))                              \\\n            (trc)->realLocation = (location);                                 \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->realLocation = NULL;                                           \\\n    JS_END_MACRO\n#else\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n#endif\n\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string\n * and index.\n */\n# define JS_SET_TRACING_INDEX(trc, name, index)                               \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, index)\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string.\n */\n# define JS_SET_TRACING_NAME(trc, name)                                       \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, (size_t)-1)\n\n/*\n * The JS_Call*Tracer family of functions traces the given GC thing reference.\n * This performs the tracing action configured on the given JSTracer:\n * typically calling the JSTracer::callback or marking the thing as live.\n *\n * The argument to JS_Call*Tracer is an in-out param: when the function\n * returns, the garbage collector might have moved the GC thing. In this case,\n * the reference passed to JS_Call*Tracer will be updated to the object's new\n * location. Callers of this method are responsible for updating any state\n * that is dependent on the object's address. For example, if the object's\n * address is used as a key in a hashtable, then the object must be removed\n * and re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(void)\nJS_CallValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);\n\ntemplate <typename HashSetEnum>\ninline void\nJS_CallHashSetObjectTracer(JSTracer *trc, HashSetEnum &e, JSObject *const &key, const char *name)\n{\n    JSObject *updated = key;\n    JS_SET_TRACING_LOCATION(trc, reinterpret_cast<void *>(&const_cast<JSObject *&>(key)));\n    JS_CallObjectTracer(trc, &updated, name);\n    if (updated != key)\n        e.rekeyFront(key, updated);\n}\n\n/*\n * Trace an object that is known to always be tenured.  No post barriers are\n * required in this case.\n */\nextern JS_PUBLIC_API(void)\nJS_CallTenuredObjectTracer(JSTracer *trc, JS::TenuredHeap<JSObject *> *objp, const char *name);\n\n/*\n * API for JSTraceCallback implementations.\n */\nextern JS_PUBLIC_API(void)\nJS_TracerInit(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);\n\nextern JS_PUBLIC_API(void)\nJS_TraceRuntime(JSTracer *trc);\n\nextern JS_PUBLIC_API(void)\nJS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc,\n                     void *thing, JSGCTraceKind kind, JSBool includeDetails);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize);\n\n#ifdef DEBUG\n\n/*\n * DEBUG-only method to dump the object graph of heap-allocated things.\n *\n * fp:              file for the dump output.\n * start:           when non-null, dump only things reachable from start\n *                  thing. Otherwise dump all things reachable from the\n *                  runtime roots.\n * startKind:       trace kind of start if start is not null. Must be\n *                  JSTRACE_OBJECT when start is null.\n * thingToFind:     dump only paths in the object graph leading to thingToFind\n *                  when non-null.\n * maxDepth:        the upper bound on the number of edges to descend from the\n *                  graph roots.\n * thingToIgnore:   thing to ignore during the graph traversal when non-null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind,\n            void *thingToFind, size_t maxDepth, void *thingToIgnore);\n\n#endif\n\n/*\n * Garbage collector API.\n */\nextern JS_PUBLIC_API(void)\nJS_GC(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_MaybeGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCCallback(JSRuntime *rt, JSGCCallback cb, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGCMarkingTracer(JSTracer *trc);\n\n/*\n * JS_IsAboutToBeFinalized checks if the given object is going to be finalized\n * at the end of the current GC. When called outside of the context of a GC,\n * this function will return false. Typically this function is used on weak\n * references, where the reference should be nulled out or destroyed if the\n * given object is about to be finalized.\n *\n * The argument to JS_IsAboutToBeFinalized is an in-out param: when the\n * function returns false, the object being referenced is still alive, but the\n * garbage collector might have moved it. In this case, the reference passed\n * to JS_IsAboutToBeFinalized will be updated to the object's new location.\n * Callers of this method are responsible for updating any state that is\n * dependent on the object's address. For example, if the object's address is\n * used as a key in a hashtable, then the object must be removed and\n * re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalized(JS::Heap<JSObject *> *objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalizedUnbarriered(JSObject **objp);\n\ntypedef enum JSGCParamKey {\n    /* Maximum nominal heap before last ditch GC. */\n    JSGC_MAX_BYTES          = 0,\n\n    /* Number of JS_malloc bytes before last ditch GC. */\n    JSGC_MAX_MALLOC_BYTES   = 1,\n\n    /* Amount of bytes allocated by the GC. */\n    JSGC_BYTES = 3,\n\n    /* Number of times when GC was invoked. */\n    JSGC_NUMBER = 4,\n\n    /* Max size of the code cache in bytes. */\n    JSGC_MAX_CODE_CACHE_BYTES = 5,\n\n    /* Select GC mode. */\n    JSGC_MODE = 6,\n\n    /* Number of cached empty GC chunks. */\n    JSGC_UNUSED_CHUNKS = 7,\n\n    /* Total number of allocated GC chunks. */\n    JSGC_TOTAL_CHUNKS = 8,\n\n    /* Max milliseconds to spend in an incremental GC slice. */\n    JSGC_SLICE_TIME_BUDGET = 9,\n\n    /* Maximum size the GC mark stack can grow to. */\n    JSGC_MARK_STACK_LIMIT = 10,\n\n    /*\n     * GCs less than this far apart in time will be considered 'high-frequency GCs'.\n     * See setGCLastBytes in jsgc.cpp.\n     */\n    JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11,\n\n    /* Start of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_LOW_LIMIT = 12,\n\n    /* End of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_HIGH_LIMIT = 13,\n\n    /* Upper bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX = 14,\n\n    /* Lower bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN = 15,\n\n    /* Heap growth for low frequency GCs. */\n    JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16,\n\n    /*\n     * If false, the heap growth factor is fixed at 3. If true, it is determined\n     * based on whether GCs are high- or low- frequency.\n     */\n    JSGC_DYNAMIC_HEAP_GROWTH = 17,\n\n    /* If true, high-frequency GCs will use a longer mark slice. */\n    JSGC_DYNAMIC_MARK_SLICE = 18,\n\n    /* Number of megabytes of analysis data to allocate before purging. */\n    JSGC_ANALYSIS_PURGE_TRIGGER = 19,\n\n    /* Lower limit after which we limit the heap growth. */\n    JSGC_ALLOCATION_THRESHOLD = 20,\n\n    /*\n     * We decommit memory lazily. If more than this number of megabytes is\n     * available to be decommitted, then JS_MaybeGC will trigger a shrinking GC\n     * to decommit it.\n     */\n    JSGC_DECOMMIT_THRESHOLD = 21\n} JSGCParamKey;\n\ntypedef enum JSGCMode {\n    /* Perform only global GCs. */\n    JSGC_MODE_GLOBAL = 0,\n\n    /* Perform per-compartment GCs until too much garbage has accumulated. */\n    JSGC_MODE_COMPARTMENT = 1,\n\n    /*\n     * Collect in short time slices rather than all at once. Implies\n     * JSGC_MODE_COMPARTMENT.\n     */\n    JSGC_MODE_INCREMENTAL = 2\n} JSGCMode;\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);\n\n/*\n * Create a new JSString whose chars member refers to external memory, i.e.,\n * memory requiring application-specific finalization.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewExternalString(JSContext *cx, const jschar *chars, size_t length,\n                     const JSStringFinalizer *fin);\n\n/*\n * Return whether 'str' was created with JS_NewExternalString or\n * JS_NewExternalStringWithClosure.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExternalString(JSString *str);\n\n/*\n * Return the 'closure' arg passed to JS_NewExternalStringWithClosure or NULL\n * if the external string was created via JS_NewExternalString.\n */\nextern JS_PUBLIC_API(const JSStringFinalizer *)\nJS_GetExternalStringFinalizer(JSString *str);\n\n/*\n * Set the size of the native stack that should not be exceed. To disable\n * stack size checking pass 0.\n */\nextern JS_PUBLIC_API(void)\nJS_SetNativeStackQuota(JSRuntime *cx, size_t stackSize);\n\n/************************************************************************/\n\n/*\n * Classes, objects, and properties.\n */\ntypedef void (*JSClassInternal)();\n\nstruct JSClass {\n    const char          *name;\n    uint32_t            flags;\n\n    /* Mandatory function pointer members. */\n    JSPropertyOp        addProperty;\n    JSDeletePropertyOp  delProperty;\n    JSPropertyOp        getProperty;\n    JSStrictPropertyOp  setProperty;\n    JSEnumerateOp       enumerate;\n    JSResolveOp         resolve;\n    JSConvertOp         convert;\n\n    /* Optional members (may be null). */\n    JSFinalizeOp        finalize;\n    JSCheckAccessOp     checkAccess;\n    JSNative            call;\n    JSHasInstanceOp     hasInstance;\n    JSNative            construct;\n    JSTraceOp           trace;\n\n    void                *reserved[40];\n};\n\n#define JSCLASS_HAS_PRIVATE             (1<<0)  /* objects have private slot */\n#define JSCLASS_NEW_ENUMERATE           (1<<1)  /* has JSNewEnumerateOp hook */\n#define JSCLASS_NEW_RESOLVE             (1<<2)  /* has JSNewResolveOp hook */\n#define JSCLASS_PRIVATE_IS_NSISUPPORTS  (1<<3)  /* private is (nsISupports *) */\n#define JSCLASS_IS_DOMJSCLASS           (1<<4)  /* objects are DOM */\n#define JSCLASS_IMPLEMENTS_BARRIERS     (1<<5)  /* Correctly implements GC read\n                                                   and write barriers */\n#define JSCLASS_EMULATES_UNDEFINED      (1<<6)  /* objects of this class act\n                                                   like the value undefined,\n                                                   in some contexts */\n#define JSCLASS_USERBIT1                (1<<7)  /* Reserved for embeddings. */\n\n/*\n * To reserve slots fetched and stored via JS_Get/SetReservedSlot, bitwise-or\n * JSCLASS_HAS_RESERVED_SLOTS(n) into the initializer for JSClass.flags, where\n * n is a constant in [1, 255].  Reserved slots are indexed from 0 to n-1.\n */\n#define JSCLASS_RESERVED_SLOTS_SHIFT    8       /* room for 8 flags below */\n#define JSCLASS_RESERVED_SLOTS_WIDTH    8       /* and 16 above this field */\n#define JSCLASS_RESERVED_SLOTS_MASK     JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)\n#define JSCLASS_HAS_RESERVED_SLOTS(n)   (((n) & JSCLASS_RESERVED_SLOTS_MASK)  \\\n                                         << JSCLASS_RESERVED_SLOTS_SHIFT)\n#define JSCLASS_RESERVED_SLOTS(clasp)   (((clasp)->flags                      \\\n                                          >> JSCLASS_RESERVED_SLOTS_SHIFT)    \\\n                                         & JSCLASS_RESERVED_SLOTS_MASK)\n\n#define JSCLASS_HIGH_FLAGS_SHIFT        (JSCLASS_RESERVED_SLOTS_SHIFT +       \\\n                                         JSCLASS_RESERVED_SLOTS_WIDTH)\n\n#define JSCLASS_IS_ANONYMOUS            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))\n#define JSCLASS_IS_GLOBAL               (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))\n#define JSCLASS_INTERNAL_FLAG2          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))\n#define JSCLASS_INTERNAL_FLAG3          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))\n\n/* Indicate whether the proto or ctor should be frozen. */\n#define JSCLASS_FREEZE_PROTO            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))\n#define JSCLASS_FREEZE_CTOR             (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))\n\n/* Reserved for embeddings. */\n#define JSCLASS_USERBIT2                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))\n#define JSCLASS_USERBIT3                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))\n\n#define JSCLASS_BACKGROUND_FINALIZE     (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))\n\n/*\n * Bits 26 through 31 are reserved for the CACHED_PROTO_KEY mechanism, see\n * below.\n */\n\n/* Global flags. */\n#define JSGLOBAL_FLAGS_CLEARED          0x1\n\n/*\n * ECMA-262 requires that most constructors used internally create objects\n * with \"the original Foo.prototype value\" as their [[Prototype]] (__proto__)\n * member initial value.  The \"original ... value\" verbiage is there because\n * in ECMA-262, global properties naming class objects are read/write and\n * deleteable, for the most part.\n *\n * Implementing this efficiently requires that global objects have classes\n * with the following flags. Failure to use JSCLASS_GLOBAL_FLAGS was\n * prevously allowed, but is now an ES5 violation and thus unsupported.\n */\n#define JSCLASS_GLOBAL_SLOT_COUNT      (JSProto_LIMIT * 3 + 25)\n#define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n)                                    \\\n    (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))\n#define JSCLASS_GLOBAL_FLAGS                                                  \\\n    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)\n#define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp)                              \\\n  (((clasp)->flags & JSCLASS_IS_GLOBAL)                                       \\\n   && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)\n\n/* Fast access to the original value of each standard class's prototype. */\n#define JSCLASS_CACHED_PROTO_SHIFT      (JSCLASS_HIGH_FLAGS_SHIFT + 10)\n#define JSCLASS_CACHED_PROTO_WIDTH      6\n#define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)\n#define JSCLASS_HAS_CACHED_PROTO(key)   (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)\n#define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey)                         \\\n                                         (((clasp)->flags                     \\\n                                           >> JSCLASS_CACHED_PROTO_SHIFT)     \\\n                                          & JSCLASS_CACHED_PROTO_MASK))\n\n/* Initializer for unused members of statically initialized JSClass structs. */\n#define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n#define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS\n\nextern JS_PUBLIC_API(int)\nJS_IdArrayLength(JSContext *cx, JSIdArray *ida);\n\nextern JS_PUBLIC_API(jsid)\nJS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyIdArray(JSContext *cx, JSIdArray *ida);\n\nnamespace JS {\n\nclass AutoIdArray : private AutoGCRooter\n{\n  public:\n    AutoIdArray(JSContext *cx, JSIdArray *ida\n                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, IDARRAY), context(cx), idArray(ida)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~AutoIdArray() {\n        if (idArray)\n            JS_DestroyIdArray(context, idArray);\n    }\n    bool operator!() {\n        return !idArray;\n    }\n    jsid operator[](size_t i) const {\n        JS_ASSERT(idArray);\n        JS_ASSERT(i < length());\n        return JS_IdArrayGet(context, idArray, i);\n    }\n    size_t length() const {\n        return JS_IdArrayLength(context, idArray);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n    JSIdArray *steal() {\n        JSIdArray *copy = idArray;\n        idArray = NULL;\n        return copy;\n    }\n\n  protected:\n    inline void trace(JSTracer *trc);\n\n  private:\n    JSContext *context;\n    JSIdArray *idArray;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* No copy or assignment semantics. */\n    AutoIdArray(AutoIdArray &ida) MOZ_DELETE;\n    void operator=(AutoIdArray &ida) MOZ_DELETE;\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToId(JSContext *cx, jsval v, jsid *idp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IdToValue(JSContext *cx, jsid id, jsval *vp);\n\n/*\n * JSNewResolveOp flag bits.\n */\n#define JSRESOLVE_ASSIGNING     0x01    /* resolve on the left of assignment */\n\n/*\n * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on\n * the specified object, computing a primitive default value for the object.\n * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On\n * success the resulting value is stored in *vp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictPropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                      JSBool *succeeded);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStub(JSContext *cx, JS::Handle<JSObject*> obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertStub(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n               JS::MutableHandle<JS::Value> vp);\n\nstruct JSConstDoubleSpec {\n    double          dval;\n    const char      *name;\n    uint8_t         flags;\n    uint8_t         spare[3];\n};\n\ntypedef struct JSJitInfo JSJitInfo;\n\n/*\n * Wrappers to replace {Strict,}PropertyOp for JSPropertySpecs. This will allow\n * us to pass one JSJitInfo per function with the property spec, without\n * additional field overhead.\n */\ntypedef struct JSStrictPropertyOpWrapper {\n    JSStrictPropertyOp  op;\n    const JSJitInfo     *info;\n} JSStrictPropertyOpWrapper;\n\ntypedef struct JSPropertyOpWrapper {\n    JSPropertyOp        op;\n    const JSJitInfo     *info;\n} JSPropertyOpWrapper;\n\n/*\n * Wrapper to do as above, but for JSNatives for JSFunctionSpecs.\n */\ntypedef struct JSNativeWrapper {\n    JSNative        op;\n    const JSJitInfo *info;\n} JSNativeWrapper;\n\n/*\n * Macro static initializers which make it easy to pass no JSJitInfo as part of a\n * JSPropertySpec or JSFunctionSpec.\n */\n#define JSOP_WRAPPER(op) {op, NULL}\n#define JSOP_NULLWRAPPER JSOP_WRAPPER(NULL)\n\n/*\n * To define an array element rather than a named property member, cast the\n * element's index to (const char *) and initialize name with it, and set the\n * JSPROP_INDEX bit in flags.\n */\nstruct JSPropertySpec {\n    const char                  *name;\n    int8_t                      tinyid;\n    uint8_t                     flags;\n    JSPropertyOpWrapper         getter;\n    JSStrictPropertyOpWrapper   setter;\n};\n\nnamespace JS {\nnamespace detail {\n\n/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_NATIVE_TO only. */\ninline int CheckIsNative(JSNative native);\n\n} // namespace detail\n} // namespace JS\n\n#define JS_CAST_NATIVE_TO(v, To) \\\n  (static_cast<void>(sizeof(JS::detail::CheckIsNative(v))), \\\n   reinterpret_cast<To>(v))\n\n/*\n * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function\n * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be\n * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform\n * type-safe casts.\n */\n#define JS_PSG(name, getter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_NULLWRAPPER}\n#define JS_PSGS(name, getter, setter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(setter, JSStrictPropertyOp))}\n#define JS_PS_END {0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\n/*\n * To define a native function, set call to a JSNativeWrapper. To define a\n * self-hosted function, set selfHostedName to the name of a function\n * compiled during JSRuntime::initSelfHosting.\n */\nstruct JSFunctionSpec {\n    const char      *name;\n    JSNativeWrapper call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *selfHostedName;\n};\n\n/*\n * Terminating sentinel initializer to put at the end of a JSFunctionSpec array\n * that's passed to JS_DefineFunctions or JS_InitClass.\n */\n#define JS_FS_END JS_FS(NULL,NULL,0,0)\n\n/*\n * Initializer macros for a JSFunctionSpec array element. JS_FN (whose name\n * pays homage to the old JSNative/JSFastNative split) simply adds the flag\n * JSFUN_STUB_GSOPS. JS_FNINFO allows the simple adding of JSJitInfos.\n */\n#define JS_FS(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, flags}\n#define JS_FN(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, (flags) | JSFUN_STUB_GSOPS}\n#define JS_FNINFO(name,call,info,nargs,flags)                                 \\\n    {name,{call,info},nargs,flags}\n\nextern JS_PUBLIC_API(JSObject *)\nJS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n             JSClass *clasp, JSNative constructor, unsigned nargs,\n             const JSPropertySpec *ps, const JSFunctionSpec *fs,\n             const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\n/*\n * Set up ctor.prototype = proto and proto.constructor = ctor with the\n * right property flags.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);\n\nextern JS_PUBLIC_API(JSClass *)\nJS_GetClass(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(void *)\nJS_GetPrivate(JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_SetPrivate(JSObject *obj, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp,\n                      jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> protop);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<JSObject*> proto);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParent(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetConstructor(JSContext *cx, JSObject *proto);\n\n/*\n * Get a unique identifier for obj, good for the lifetime of obj (even if it\n * is moved by a copying GC).  Return false on failure (likely out of memory),\n * and true with *idp containing the unique id on success.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);\n\nnamespace JS {\n\nenum {\n    FreshZone,\n    SystemZone,\n    SpecificZones\n};\n\ntypedef uintptr_t ZoneSpecifier;\n\ninline ZoneSpecifier\nSameZoneAs(JSObject *obj)\n{\n    JS_ASSERT(uintptr_t(obj) > SpecificZones);\n    return ZoneSpecifier(obj);\n}\n\nstruct JS_PUBLIC_API(CompartmentOptions) {\n    ZoneSpecifier zoneSpec;\n    JSVersion version;\n    bool invisibleToDebugger;\n\n    explicit CompartmentOptions() : zoneSpec(JS::FreshZone)\n                                  , version(JSVERSION_UNKNOWN)\n                                  , invisibleToDebugger(false)\n    {}\n\n    CompartmentOptions &setZone(ZoneSpecifier spec) { zoneSpec = spec; return *this; }\n    CompartmentOptions &setVersion(JSVersion version_) {\n        JS_ASSERT(version_ != JSVERSION_UNKNOWN);\n        version = version_;\n        return *this;\n    }\n\n    // Certain scopes (i.e. XBL compilation scopes) are implementation details\n    // of the embedding, and references to them should never leak out to script.\n    // This flag causes the this compartment to skip firing onNewGlobalObject\n    // and makes addDebuggee a no-op for this global.\n    CompartmentOptions &setInvisibleToDebugger(bool invisible) {\n        invisibleToDebugger = invisible;\n        return *this;\n    }\n};\n\n// During global creation, we fire notifications to callbacks registered\n// via the Debugger API. These callbacks are arbitrary script, and can touch\n// the global in arbitrary ways. When that happens, the global should not be\n// in a half-baked state. But this creates a problem for consumers that need\n// to set slots on the global to put it in a consistent state.\n//\n// This API provides a way for consumers to set slots atomically (immediately\n// after the global is created), before any debugger hooks are fired. It's\n// unfortunately on the clunky side, but that's the way the cookie crumbles.\n//\n// If callers have no additional state on the global to set up, they may pass\n// |FireOnNewGlobalHook| to JS_NewGlobalObject, which causes that function to\n// fire the hook as its final act before returning. Otherwise, callers should\n// pass |DontFireOnNewGlobalHook|, which means that they are responsible for\n// invoking JS_FireOnNewGlobalObject upon successfully creating the global. If\n// an error occurs and the operation aborts, callers should skip firing the\n// hook. But otherwise, callers must take care to fire the hook exactly once\n// before compiling any script in the global's scope (we have assertions in\n// place to enforce this). This lets us be sure that debugger clients never miss\n// breakpoints.\nenum OnNewGlobalHookOption {\n    FireOnNewGlobalHook,\n    DontFireOnNewGlobalHook\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals,\n                   JS::OnNewGlobalHookOption hookOption,\n                   const JS::CompartmentOptions &options = JS::CompartmentOptions());\n\nextern JS_PUBLIC_API(void)\nJS_FireOnNewGlobalObject(JSContext *cx, JS::HandleObject global);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\n/* Queries the [[Extensible]] property of the object. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExtensible(JSContext *cx, JS::HandleObject obj, JSBool *extensible);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNative(JSObject *obj);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetObjectRuntime(JSObject *obj);\n\n/*\n * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default\n * proto if proto's actual parameter value is null.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,\n                           JSObject *parent);\n\n/*\n * Freeze obj, and all objects it refers to, recursively. This will not recurse\n * through non-extensible objects, on the assumption that those are already\n * deep-frozen.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DeepFreezeObject(JSContext *cx, JSObject *obj);\n\n/*\n * Freezes an object; see ES5's Object.freeze(obj) method.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_FreezeObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PreventExtensions(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_New(JSContext *cx, JSObject *ctor, unsigned argc, jsval *argv);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp,\n                JSObject *proto, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineConstDoubles(JSContext *cx, JSObject *obj, const JSConstDoubleSpec *cds);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,\n                  JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,\n                      JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                   const char *name,\n                                   unsigned *attrsp, JSBool *foundp,\n                                   JSPropertyOp *getterp,\n                                   JSStrictPropertyOp *setterp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,\n                                       jsid id,\n                                       unsigned *attrsp, JSBool *foundp,\n                                       JSPropertyOp *getterp,\n                                       JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned attrs, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,\n                            int8_t tinyid, jsval value,\n                            JSPropertyOp getter, JSStrictPropertyOp setter,\n                            unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,\n                         JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id,\n                             JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name,\n                           unsigned flags, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,\n                               unsigned flags, JSObject **objp, JS::MutableHandle<JS::Value> vp);\n\nstruct JSPropertyDescriptor {\n    JSObject           *obj;\n    unsigned           attrs;\n    unsigned           shortid;\n    JSPropertyOp       getter;\n    JSStrictPropertyOp setter;\n    JS::Value          value;\n\n    JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL),\n                             setter(NULL), value(JSVAL_VOID)\n    {}\n\n    void trace(JSTracer *trc);\n};\n\nnamespace JS {\n\ntemplate <typename Outer>\nclass PropertyDescriptorOperations\n{\n    const JSPropertyDescriptor * desc() const { return static_cast<const Outer*>(this)->extract(); }\n    JSPropertyDescriptor * desc() { return static_cast<Outer*>(this)->extract(); }\n\n  public:\n    bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; }\n    bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; }\n    bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; }\n    bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; }\n    bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; }\n    bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; }\n    bool isShared() const { return desc()->attrs & JSPROP_SHARED; }\n    bool isIndex() const { return desc()->attrs & JSPROP_INDEX; }\n    bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; }\n    bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; }\n\n    JS::MutableHandleObject object() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); }\n    unsigned attributes() const { return desc()->attrs; }\n    unsigned shortid() const {\n        MOZ_ASSERT(hasShortId());\n        return desc()->shortid;\n    }\n    JSPropertyOp getter() const { return desc()->getter; }\n    JSStrictPropertyOp setter() const { return desc()->setter; }\n    JS::HandleObject getterObject() const {\n        MOZ_ASSERT(hasGetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->getter));\n    }\n    JS::HandleObject setterObject() const {\n        MOZ_ASSERT(hasSetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->setter));\n    }\n    JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); }\n\n    void setAttributes(unsigned attrs) { desc()->attrs = attrs; }\n    void setShortId(unsigned id) { desc()->shortid = id; }\n    void setGetter(JSPropertyOp op) { desc()->getter = op; }\n    void setSetter(JSStrictPropertyOp op) { desc()->setter = op; }\n    void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast<JSPropertyOp>(obj); }\n    void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast<JSStrictPropertyOp>(obj); }\n};\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <>\nstruct GCMethods<JSPropertyDescriptor> {\n    static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); }\n    static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; }\n    static bool poisoned(const JSPropertyDescriptor &desc) {\n        return (desc.obj && JS::IsPoisonedPtr(desc.obj)) ||\n               (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) ||\n               (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) ||\n               (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing()));\n    }\n};\n\ntemplate <>\nclass RootedBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\ntemplate <>\nclass HandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Handle<JSPropertyDescriptor>*>(this)->address();\n    }\n  public:\n    JS::HandleValue value() const { return JS::HandleValue::fromMarkedLocation(&extract()->value); }\n    JS::HandleObject obj() const { return JS::HandleObject::fromMarkedLocation(&extract()->obj); }\n};\n\ntemplate <>\nclass MutableHandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\n} /* namespace js */\n\n/*\n * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on\n * an object on the prototype chain (returned in objp). If data->obj is null,\n * then this property was not found on the prototype chain.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags,\n                             JSPropertyDescriptor *desc);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def,\n                          JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf,\n                        JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name,\n                   JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, jsval value,\n                    JSPropertyOp getter, JSStrictPropertyOp setter,\n                    unsigned attrs);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                     const jschar *name, size_t namelen,\n                                     unsigned *attrsp, JSBool *foundp,\n                                     JSPropertyOp *getterp,\n                                     JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned attrs, JSBool *foundp);\n\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,\n                              const jschar *name, size_t namelen,\n                              int8_t tinyid, jsval value,\n                              JSPropertyOp getter, JSStrictPropertyOp setter,\n                              unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,\n                           size_t namelen, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JSBool *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen,\n                    JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteUCProperty2(JSContext *cx, JSObject *obj,\n                     const jschar *name, size_t namelen,\n                     JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayObject(JSContext *cx, int length, jsval *vector);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsArrayObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,\n                 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp);\n\n/*\n * Get the property with name given by |index|, if it has one.  If\n * not, |*present| will be set to false and the value of |vp| must not\n * be relied on.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp, JSBool* present);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);\n\n/*\n * Remove all configurable properties from the given (non-global) object and\n * assign undefined to all writable data properties.\n */\nJS_PUBLIC_API(void)\nJS_ClearNonGlobalObject(JSContext *cx, JSObject *objArg);\n\n/*\n * Assign 'undefined' to all of the object's non-reserved slots. Note: this is\n * done for all slots, regardless of the associated property descriptor.\n */\nJS_PUBLIC_API(void)\nJS_SetAllNonReservedSlotsToUndefined(JSContext *cx, JSObject *objArg);\n\n/*\n * Create a new array buffer with the given contents, which must have been\n * returned by JS_AllocateArrayBufferContents or JS_StealArrayBufferContents.\n * The new array buffer takes ownership. After calling this function, do not\n * free |contents| or use |contents| from another thread.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayBufferWithContents(JSContext *cx, void *contents);\n\n/*\n * Steal the contents of the given array buffer. The array buffer has its\n * length set to 0 and its contents array cleared. The caller takes ownership\n * of |*contents| and must free it or transfer ownership via\n * JS_NewArrayBufferWithContents when done using it.\n * To free |*contents|, call free().\n * A pointer to the buffer's data is returned in |*data|. This pointer can\n * be used until |*contents| is freed or has its ownership transferred.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents,\n                            uint8_t **data);\n\n/*\n * Allocate memory that may be eventually passed to\n * JS_NewArrayBufferWithContents. |nbytes| is the number of payload bytes\n * required. The pointer to pass to JS_NewArrayBufferWithContents is returned\n * in |contents|. The pointer to the |nbytes| of usable memory is returned in\n * |data|. (*|contents| will contain a header before |data|.) The only legal\n * operations on *|contents| is to free it, or pass it to\n * JS_NewArrayBufferWithContents or JS_ReallocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\n/*\n * Reallocate memory allocated by JS_AllocateArrayBufferContents, growing or shrinking it\n * as appropriate.  The new data pointer will be returned in data.  If *contents is NULL,\n * behaves like JS_AllocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\nextern JS_PUBLIC_API(JSIdArray *)\nJS_Enumerate(JSContext *cx, JSObject *obj);\n\n/*\n * Create an object to iterate over enumerable properties of obj, in arbitrary\n * property definition order.  NB: This differs from longstanding for..in loop\n * order, which uses order of property definition in obj.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewPropertyIterator(JSContext *cx, JSObject *obj);\n\n/*\n * Return true on success with *idp containing the id of the next enumerable\n * property to visit using iterobj, or JSID_IS_VOID if there is no such property\n * left to visit.  Return false on error.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);\n\n/*\n * A JSNative that creates and returns a new iterator that iterates over the\n * elements of |this|, up to |this.length|, in index order. This can be used to\n * make any array-like object iterable. Just give the object an obj.iterator()\n * method using this JSNative as the implementation.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,\n               jsval *vp, unsigned *attrsp);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetReservedSlot(JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(void)\nJS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v);\n\n/************************************************************************/\n\n/*\n * Security protocol.\n */\nstruct JSPrincipals {\n    /* Don't call \"destroy\"; use reference counting macros below. */\n    int refcount;\n\n#ifdef DEBUG\n    /* A helper to facilitate principals debugging. */\n    uint32_t    debugToken;\n#endif\n\n    void setDebugToken(uint32_t token) {\n# ifdef DEBUG\n        debugToken = token;\n# endif\n    }\n\n    /*\n     * This is not defined by the JS engine but should be provided by the\n     * embedding.\n     */\n    JS_PUBLIC_API(void) dump();\n};\n\nextern JS_PUBLIC_API(void)\nJS_HoldPrincipals(JSPrincipals *principals);\n\nextern JS_PUBLIC_API(void)\nJS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);\n\nstruct JSSecurityCallbacks {\n    JSCheckAccessOp            checkObjectAccess;\n    JSCSPEvalChecker           contentSecurityPolicyAllows;\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetSecurityCallbacks(JSRuntime *rt, const JSSecurityCallbacks *callbacks);\n\nextern JS_PUBLIC_API(const JSSecurityCallbacks *)\nJS_GetSecurityCallbacks(JSRuntime *rt);\n\n/*\n * Code running with \"trusted\" principals will be given a deeper stack\n * allocation than ordinary scripts. This allows trusted script to run after\n * untrusted script has exhausted the stack. This function sets the\n * runtime-wide trusted principal.\n *\n * This principals is not held (via JS_HoldPrincipals/JS_DropPrincipals) since\n * there is no available JSContext. Instead, the caller must ensure that the\n * given principals stays valid for as long as 'rt' may point to it. If the\n * principals would be destroyed before 'rt', JS_SetTrustedPrincipals must be\n * called again, passing NULL for 'prin'.\n */\nextern JS_PUBLIC_API(void)\nJS_SetTrustedPrincipals(JSRuntime *rt, JSPrincipals *prin);\n\n/*\n * Initialize the callback that is called to destroy JSPrincipals instance\n * when its reference counter drops to zero. The initialization can be done\n * only once per JS runtime.\n */\nextern JS_PUBLIC_API(void)\nJS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPrincipals);\n\n/************************************************************************/\n\n/*\n * Functions and scripts.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n               JSObject *parent, const char *name);\n\n/*\n * Create the function with the name given by the id. JSID_IS_STRING(id) must\n * be true.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                   JSObject *parent, jsid id);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionObject(JSFunction *fun);\n\n/*\n * Return the function's identifier as a JSString, or null if fun is unnamed.\n * The returned string lives as long as fun, so you don't need to root a saved\n * reference to it if fun is well-connected or rooted, and provided you bound\n * the use of the saved reference by fun's lifetime.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionId(JSFunction *fun);\n\n/*\n * Return a function's display name. This is the defined name if one was given\n * where the function was defined, or it could be an inferred name by the JS\n * engine in the case that the function was defined to be anonymous. This can\n * still return NULL if a useful display name could not be inferred. The same\n * restrictions on rooting as those in JS_GetFunctionId apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionDisplayId(JSFunction *fun);\n\n/*\n * Return the arity (length) of fun.\n */\nextern JS_PUBLIC_API(uint16_t)\nJS_GetFunctionArity(JSFunction *fun);\n\n/*\n * Infallible predicate to test whether obj is a function object (faster than\n * comparing obj's class name to \"Function\", but equivalent unless someone has\n * overwritten the \"Function\" identifier with a different constructor and then\n * created instances using that constructor that might be passed in as obj).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsFunction(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsCallable(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNativeFunction(JSObject *funobj, JSNative call);\n\n/* Return whether the given function is a valid constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsConstructor(JSFunction *fun);\n\n/*\n * Bind the given callable to use the given object as \"this\".\n *\n * If |callable| is not callable, will throw and return NULL.\n */\nextern JS_PUBLIC_API(JSObject*)\nJS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                  unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineUCFunction(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, JSNative call,\n                    unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,\n                      unsigned nargs, unsigned attrs);\n\n/*\n * Clone a top-level function into a new scope. This function will dynamically\n * fail if funobj was lexically nested inside some other function.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);\n\n/*\n * Given a buffer, return JS_FALSE if the buffer might become a valid\n * javascript statement with the addition of more lines.  Otherwise return\n * JS_TRUE.  The intent is to support interactive compilation - accumulate\n * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to\n * the compiler.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScript(JSContext *cx, JSObject *obj,\n                 const char *ascii, size_t length,\n                 const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,\n                              JSPrincipals *principals,\n                              const char *ascii, size_t length,\n                              const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScript(JSContext *cx, JSObject *obj,\n                   const jschar *chars, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals,\n                                const jschar *chars, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalFromScript(JSScript *script);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,\n                   unsigned nargs, const char **argnames,\n                   const char *bytes, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals, const char *name,\n                                unsigned nargs, const char **argnames,\n                                const char *bytes, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileUCFunction(JSContext *cx, JSObject *obj, const char *name,\n                     unsigned nargs, const char **argnames,\n                     const jschar *chars, size_t length,\n                     const char *filename, unsigned lineno);\n\nnamespace JS {\n\n/* Options for JavaScript compilation. */\nclass JS_PUBLIC_API(CompileOptions)\n{\n    JSPrincipals *principals_;\n    JSPrincipals *originPrincipals_;\n\n  public:\n    JSPrincipals *principals() const { return principals_; }\n    JSPrincipals *originPrincipals() const;\n\n    JSVersion version;\n    bool versionSet;\n    bool utf8;\n    const char *filename;\n    unsigned lineno;\n    unsigned column;\n    HandleObject element;\n    bool compileAndGo;\n    bool forEval;\n    bool noScriptRval;\n    bool selfHostingMode;\n    bool canLazilyParse;\n    bool strictOption;\n    bool extraWarningsOption;\n    bool werrorOption;\n    bool asmJSOption;\n    enum SourcePolicy {\n        NO_SOURCE,\n        LAZY_SOURCE,\n        SAVE_SOURCE\n    } sourcePolicy;\n\n    explicit CompileOptions(JSContext *cx, JSVersion version = JSVERSION_UNKNOWN);\n    CompileOptions &setPrincipals(JSPrincipals *p) { principals_ = p; return *this; }\n    CompileOptions &setOriginPrincipals(JSPrincipals *p) { originPrincipals_ = p; return *this; }\n    CompileOptions &setVersion(JSVersion v) { version = v; versionSet = true; return *this; }\n    CompileOptions &setUTF8(bool u) { utf8 = u; return *this; }\n    CompileOptions &setFileAndLine(const char *f, unsigned l) {\n        filename = f; lineno = l; return *this;\n    }\n    CompileOptions &setColumn(unsigned c) { column = c; return *this; }\n    CompileOptions &setElement(HandleObject e) { element = e; return *this; }\n    CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }\n    CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }\n    CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }\n    CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }\n    CompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }\n    CompileOptions &setSourcePolicy(SourcePolicy sp) { sourcePolicy = sp; return *this; }\n};\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, FILE *file);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, const char *filename);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const jschar *chars, size_t length);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * API extension: OR this into indent to avoid pretty-printing the decompiled\n * source resulting from JS_DecompileFunction{,Body}.\n */\n#define JS_DONT_PRETTY_PRINT    ((unsigned)0x8000)\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);\n\n/*\n * NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj\n * parameter as the initial scope chain header, the 'this' keyword value, and\n * the variables object (ECMA parlance for where 'var' and 'function' bind\n * names) of the execution context for script.\n *\n * Using obj as the variables object is problematic if obj's parent (which is\n * the scope chain link; see JS_SetParent and JS_NewObject) is not null: in\n * this case, variables created by 'var x = 0', e.g., go in obj, but variables\n * created by assignment to an unbound id, 'x = 0', go in the last object on\n * the scope chain linked by parent.\n *\n * ECMA calls that last scoping object the \"global object\", but note that many\n * embeddings have several such objects.  ECMA requires that \"global code\" be\n * executed with the variables object equal to this global object.  But these\n * JS API entry points provide freedom to execute code against a \"sub-global\",\n * i.e., a parented or scoped object, in which case the variables object will\n * differ from the last object on the scope chain, resulting in confusing and\n * non-ECMA explicit vs. implicit variable creation.\n *\n * Caveat embedders: unless you already depend on this buggy variables object\n * binding behavior, you should call JS_SetOptions(cx, JSOPTION_VAROBJFIX) or\n * JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_VAROBJFIX) -- the latter if\n * someone may have set other options on cx already -- for each context in the\n * application, if you pass parented objects as the obj parameter, or may ever\n * pass such objects in the future.\n *\n * Why a runtime option?  The alternative is to add six or so new API entry\n * points with signatures matching the following six, and that doesn't seem\n * worth the code bloat cost.  Such new entry points would probably have less\n * obvious names, too, so would not tend to be used.  The JS_SetOption call,\n * OTOH, can be more easily hacked into existing code that does not depend on\n * the bug; such code can continue to use the familiar JS_EvaluateScript,\n * etc., entry points.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,\n                        JSVersion version);\n\n/*\n * Execute either the function-defining prolog of a script, or the script's\n * main body, but not both.\n */\ntypedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart;\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScript(JSContext *cx, JSObject *obj,\n                  const char *bytes, unsigned length,\n                  const char *filename, unsigned lineno,\n                  jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,\n                               JSPrincipals *principals,\n                               const char *bytes, unsigned length,\n                               const char *filename, unsigned lineno,\n                               jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                      JSPrincipals *principals,\n                                      const char *bytes, unsigned length,\n                                      const char *filename, unsigned lineno,\n                                      jsval *rval, JSVersion version);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScript(JSContext *cx, JSObject *obj,\n                    const jschar *chars, unsigned length,\n                    const char *filename, unsigned lineno,\n                    jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                 JSPrincipals *principals,\n                                 const jschar *chars, unsigned length,\n                                 const char *filename, unsigned lineno,\n                                 jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                        JSPrincipals *principals,\n                                        const jschar *chars, unsigned length,\n                                        const char *filename, unsigned lineno,\n                                        jsval *rval, JSVersion version);\n\n/*\n * JSAPI clients may optionally specify the 'originPrincipals' of a script.\n * A script's originPrincipals may be retrieved through the debug API (via\n * JS_GetScriptOriginPrincipals) and the originPrincipals are transitively\n * assigned to any nested scripts (including scripts dynamically created via\n * eval and the Function constructor). If originPrincipals is null, then the\n * value of principals is used as origin principals for the script.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,\n                                              JSPrincipals *principals,\n                                              JSPrincipals *originPrincipals,\n                                              const jschar *chars, unsigned length,\n                                              const char *filename, unsigned lineno,\n                                              jsval *rval, JSVersion version);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const jschar *chars, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *bytes, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *filename, jsval *rval);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc,\n                jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc,\n                    jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc,\n                     jsval *argv, jsval *rval);\n\nnamespace JS {\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, JSFunction *fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunction(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, const char *name, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionName(cx, thisObj, name, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, jsval fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionValue(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nextern JS_PUBLIC_API(bool)\nCall(JSContext *cx, jsval thisv, jsval fun, unsigned argc, jsval *argv, MutableHandle<Value> rval);\n\nstatic inline bool\nCall(JSContext *cx, jsval thisv, JSObject *funObj, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return Call(cx, thisv, OBJECT_TO_JSVAL(funObj), argc, argv, rval);\n}\n\n} /* namespace JS */\n\n/*\n * These functions allow setting an operation callback that will be called\n * from the JS thread some time after any thread triggered the callback using\n * JS_TriggerOperationCallback(rt).\n *\n * To schedule the GC and for other activities the engine internally triggers\n * operation callbacks. The embedding should thus not rely on callbacks being\n * triggered through the external API only.\n *\n * Important note: Additional callbacks can occur inside the callback handler\n * if it re-enters the JS engine. The embedding must ensure that the callback\n * is disconnected before attempting such re-entry.\n */\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_SetOperationCallback(JSContext *cx, JSOperationCallback callback);\n\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_GetOperationCallback(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_TriggerOperationCallback(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsRunning(JSContext *cx);\n\n/*\n * Saving and restoring frame chains.\n *\n * These two functions are used to set aside cx's call stack while that stack\n * is inactive. After a call to JS_SaveFrameChain, it looks as if there is no\n * code running on cx. Before calling JS_RestoreFrameChain, cx's call stack\n * must be balanced and all nested calls to JS_SaveFrameChain must have had\n * matching JS_RestoreFrameChain calls.\n *\n * JS_SaveFrameChain deals with cx not having any code running on it.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SaveFrameChain(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreFrameChain(JSContext *cx);\n\n#ifdef MOZ_TRACE_JSCALLS\n/*\n * The callback is expected to be quick and noninvasive. It should not\n * trigger interrupts, turn on debugging, or produce uncaught JS\n * exceptions. The state of the stack and registers in the context\n * cannot be relied upon, since this callback may be invoked directly\n * from either JIT. The 'entering' field means we are entering a\n * function if it is positive, leaving a function if it is zero or\n * negative.\n */\nextern JS_PUBLIC_API(void)\nJS_SetFunctionCallback(JSContext *cx, JSFunctionCallback fcb);\n\nextern JS_PUBLIC_API(JSFunctionCallback)\nJS_GetFunctionCallback(JSContext *cx);\n#endif /* MOZ_TRACE_JSCALLS */\n\n/************************************************************************/\n\n/*\n * Strings.\n *\n * NB: JS_NewUCString takes ownership of bytes on success, avoiding a copy;\n * but on error (signified by null return), it leaves chars owned by the\n * caller. So the caller must free bytes in the error case, if it has no use\n * for them. In contrast, all the JS_New*StringCopy* functions do not take\n * ownership of the character memory passed to them -- they copy it.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyN(JSContext *cx, const char *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyZ(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternJSString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternStringN(JSContext *cx, const char *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternString(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCString(JSContext *cx, jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyN(JSContext *cx, const jschar *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyZ(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCString(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FileEscapedString(FILE *fp, JSString *str, char quote);\n\n/*\n * Extracting string characters and length.\n *\n * While getting the length of a string is infallible, getting the chars can\n * fail. As indicated by the lack of a JSContext parameter, there are two\n * special cases where getting the chars is infallible:\n *\n * The first case is interned strings, i.e., strings from JS_InternString or\n * JSID_TO_STRING(id), using JS_GetInternedStringChars*.\n *\n * The second case is \"flat\" strings that have been explicitly prepared in a\n * fallible context by JS_FlattenString. To catch errors, a separate opaque\n * JSFlatString type is returned by JS_FlattenString and expected by\n * JS_GetFlatStringChars. Note, though, that this is purely a syntactic\n * distinction: the input and output of JS_FlattenString are the same actual\n * GC-thing so only one needs to be rooted. If a JSString is known to be flat,\n * JS_ASSERT_STRING_IS_FLAT can be used to make a debug-checked cast. Example:\n *\n *   // in a fallible context\n *   JSFlatString *fstr = JS_FlattenString(cx, str);\n *   if (!fstr)\n *     return JS_FALSE;\n *   JS_ASSERT(fstr == JS_ASSERT_STRING_IS_FLAT(str));\n *\n *   // in an infallible context, for the same 'str'\n *   const jschar *chars = JS_GetFlatStringChars(fstr)\n *   JS_ASSERT(chars);\n *\n * The CharsZ APIs guarantee that the returned array has a null character at\n * chars[length]. This can require additional copying so clients should prefer\n * APIs without CharsZ if possible. The infallible functions also return\n * null-terminated arrays. (There is no additional cost or non-Z alternative\n * for the infallible functions, so 'Z' is left out of the identifier.)\n */\n\nextern JS_PUBLIC_API(size_t)\nJS_GetStringLength(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringChars(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringCharsAndLength(JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZ(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(JSFlatString *)\nJS_FlattenString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetFlatStringChars(JSFlatString *str);\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJSID_TO_FLAT_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSFlatString *)(JSID_BITS(id));\n}\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJS_ASSERT_STRING_IS_FLAT(JSString *str)\n{\n    JS_ASSERT(JS_GetFlatStringChars((JSFlatString *)str));\n    return (JSFlatString *)str;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJS_FORGET_STRING_FLATNESS(JSFlatString *fstr)\n{\n    return (JSString *)fstr;\n}\n\n/*\n * Additional APIs that avoid fallibility when given a flat string.\n */\n\nextern JS_PUBLIC_API(JSBool)\nJS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedFlatString(char *buffer, size_t size, JSFlatString *str, char quote);\n\n/*\n * This function is now obsolete and behaves the same as JS_NewUCString.  Use\n * JS_NewUCString instead.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewGrowableString(JSContext *cx, jschar *chars, size_t length);\n\n/*\n * Create a dependent string, i.e., a string that owns no character storage,\n * but that refers to a slice of another string's chars.  Dependent strings\n * are mutable by definition, so the thread safety comments above apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewDependentString(JSContext *cx, JSString *str, size_t start,\n                      size_t length);\n\n/*\n * Concatenate two strings, possibly resulting in a rope.\n * See above for thread safety comments.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_ConcatStrings(JSContext *cx, JSString *left, JSString *right);\n\n/*\n * For JS_DecodeBytes, set *dstlenp to the size of the destination buffer before\n * the call; on return, *dstlenp contains the number of jschars actually stored.\n * To determine the necessary destination buffer size, make a sizing call that\n * passes NULL for dst.\n *\n * On errors, the functions report the error. In that case, *dstlenp contains\n * the number of characters or bytes transferred so far.  If cx is NULL, no\n * error is reported on failure, and the functions simply return JS_FALSE.\n *\n * NB: This function does not store an additional zero byte or jschar after the\n * transcoded string.\n */\nJS_PUBLIC_API(JSBool)\nJS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst,\n               size_t *dstlenp);\n\n/*\n * A variation on JS_EncodeCharacters where a null terminated string is\n * returned that you are expected to call JS_free on when done.\n */\nJS_PUBLIC_API(char *)\nJS_EncodeString(JSContext *cx, JSString *str);\n\n/*\n * Same behavior as JS_EncodeString(), but encode into UTF-8 string\n */\nJS_PUBLIC_API(char *)\nJS_EncodeStringToUTF8(JSContext *cx, JSString *str);\n\n/*\n * Get number of bytes in the string encoding (without accounting for a\n * terminating zero bytes. The function returns (size_t) -1 if the string\n * can not be encoded into bytes and reports an error using cx accordingly.\n */\nJS_PUBLIC_API(size_t)\nJS_GetStringEncodingLength(JSContext *cx, JSString *str);\n\n/*\n * Encode string into a buffer. The function does not stores an additional\n * zero byte. The function returns (size_t) -1 if the string can not be\n * encoded into bytes with no error reported. Otherwise it returns the number\n * of bytes that are necessary to encode the string. If that exceeds the\n * length parameter, the string will be cut and only length bytes will be\n * written into the buffer.\n */\nJS_PUBLIC_API(size_t)\nJS_EncodeStringToBuffer(JSContext *cx, JSString *str, char *buffer, size_t length);\n\nclass JSAutoByteString\n{\n  public:\n    JSAutoByteString(JSContext *cx, JSString *str\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mBytes(JS_EncodeString(cx, str))\n    {\n        JS_ASSERT(cx);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    JSAutoByteString(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : mBytes(NULL)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoByteString() {\n        js_free(mBytes);\n    }\n\n    /* Take ownership of the given byte array. */\n    void initBytes(char *bytes) {\n        JS_ASSERT(!mBytes);\n        mBytes = bytes;\n    }\n\n    char *encodeLatin1(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeString(cx, str);\n        return mBytes;\n    }\n\n    char *encodeLatin1(js::ContextFriendFields *cx, JSString *str);\n\n    char *encodeUtf8(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeStringToUTF8(cx, str);\n        return mBytes;\n    }\n\n    void clear() {\n        js_free(mBytes);\n        mBytes = NULL;\n    }\n\n    char *ptr() const {\n        return mBytes;\n    }\n\n    bool operator!() const {\n        return !mBytes;\n    }\n\n    size_t length() const {\n        if (!mBytes)\n            return 0;\n        return strlen(mBytes);\n    }\n\n  private:\n    char        *mBytes;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* Copy and assignment are not supported. */\n    JSAutoByteString(const JSAutoByteString &another);\n    JSAutoByteString &operator=(const JSAutoByteString &another);\n};\n\n/************************************************************************/\n/*\n * JSON functions\n */\ntypedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);\n\n/*\n * JSON.stringify as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,\n             JSONWriteCallback callback, void *data);\n\n/*\n * JSON.parse as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle<JS::Value> vp);\n\nJS_PUBLIC_API(JSBool)\nJS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,\n                        jsval *vp);\n\n/************************************************************************/\n\n/* API for the HTML5 internal structured cloning algorithm. */\n\n/* The maximum supported structured-clone serialization format version. */\n#define JS_STRUCTURED_CLONE_VERSION 2\n\nstruct JSStructuredCloneCallbacks {\n    ReadStructuredCloneOp read;\n    WriteStructuredCloneOp write;\n    StructuredCloneErrorOp reportError;\n};\n\n/* Note: if the *data contains transferable objects, it can be read\n * only once */\nJS_PUBLIC_API(JSBool)\nJS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes,\n                       uint32_t version, jsval *vp,\n                       const JSStructuredCloneCallbacks *optionalCallbacks,\n                       void *closure);\n\n/* Note: On success, the caller is responsible for calling\n * JS_ClearStructuredClone(*datap, nbytesp). */\nJS_PUBLIC_API(JSBool)\nJS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,\n                        const JSStructuredCloneCallbacks *optionalCallbacks,\n                        void *closure, jsval transferable);\n\nJS_PUBLIC_API(JSBool)\nJS_ClearStructuredClone(const uint64_t *data, size_t nbytes);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes,\n                                   JSBool *hasTransferable);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredClone(JSContext *cx, jsval v, jsval *vp,\n                   const JSStructuredCloneCallbacks *optionalCallbacks,\n                   void *closure);\n\n/* RAII sugar for JS_WriteStructuredClone. */\nclass JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {\n    uint64_t *data_;\n    size_t nbytes_;\n    uint32_t version_;\n\n  public:\n    JSAutoStructuredCloneBuffer()\n        : data_(NULL), nbytes_(0), version_(JS_STRUCTURED_CLONE_VERSION) {}\n\n    ~JSAutoStructuredCloneBuffer() { clear(); }\n\n    uint64_t *data() const { return data_; }\n    size_t nbytes() const { return nbytes_; }\n\n    void clear();\n\n    /* Copy some memory. It will be automatically freed by the destructor. */\n    bool copy(const uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Adopt some memory. It will be automatically freed by the destructor.\n     * data must have been allocated by the JS engine (e.g., extracted via\n     * JSAutoStructuredCloneBuffer::steal).\n     */\n    void adopt(uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Remove the buffer so that it will not be automatically freed.\n     * After this, the caller is responsible for feeding the memory back to\n     * JSAutoStructuredCloneBuffer::adopt.\n     */\n    void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=NULL);\n\n    bool read(JSContext *cx, jsval *vp,\n              const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n              void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               jsval transferable,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    /**\n     * Swap ownership with another JSAutoStructuredCloneBuffer.\n     */\n    void swap(JSAutoStructuredCloneBuffer &other);\n\n  private:\n    /* Copy and assignment are not supported. */\n    JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other);\n    JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other);\n};\n\n/* API for implementing custom serialization behavior (for ImageData, File, etc.) */\n\n/* The range of tag values the application may use for its own custom object types. */\n#define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)\n#define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)\n\n#define JS_SCERR_RECURSION 0\n#define JS_SCERR_TRANSFERABLE 1\n\nJS_PUBLIC_API(void)\nJS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);\n\n/************************************************************************/\n\n/*\n * The default locale for the ECMAScript Internationalization API\n * (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).\n * Note that the Internationalization API encourages clients to\n * specify their own locales.\n * The locale string remains owned by the caller.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetDefaultLocale(JSRuntime *rt, const char *locale);\n\n/*\n * Reset the default locale to OS defaults.\n */\nextern JS_PUBLIC_API(void)\nJS_ResetDefaultLocale(JSRuntime *rt);\n\n/*\n * Locale specific string conversion and error message callbacks.\n */\nstruct JSLocaleCallbacks {\n    JSLocaleToUpperCase     localeToUpperCase;\n    JSLocaleToLowerCase     localeToLowerCase;\n    JSLocaleCompare         localeCompare; // not used #if ENABLE_INTL_API\n    JSLocaleToUnicode       localeToUnicode;\n    JSErrorCallback         localeGetErrorMessage;\n};\n\n/*\n * Establish locale callbacks. The pointer must persist as long as the\n * JSRuntime.  Passing NULL restores the default behaviour.\n */\nextern JS_PUBLIC_API(void)\nJS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks);\n\n/*\n * Return the address of the current locale callbacks struct, which may\n * be NULL.\n */\nextern JS_PUBLIC_API(JSLocaleCallbacks *)\nJS_GetLocaleCallbacks(JSRuntime *rt);\n\n/************************************************************************/\n\n/*\n * Error reporting.\n */\n\n/*\n * Report an exception represented by the sprintf-like conversion of format\n * and its arguments.  This exception message string is passed to a pre-set\n * JSErrorReporter function (set by JS_SetErrorReporter).\n */\nextern JS_PUBLIC_API(void)\nJS_ReportError(JSContext *cx, const char *format, ...);\n\n/*\n * Use an errorNumber to retrieve the format string, args are char *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,\n                       void *userRef, const unsigned errorNumber, va_list ap);\n#endif\n\n/*\n * Use an errorNumber to retrieve the format string, args are jschar *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUC(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback,\n                            void *userRef, const unsigned errorNumber,\n                            const jschar **args);\n\n/*\n * As above, but report a warning instead (JSREPORT_IS_WARNING(report.flags)).\n * Return true if there was no error trying to issue the warning, and if the\n * warning was not converted into an error due to the JSOPTION_WERROR option\n * being set, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReportWarning(JSContext *cx, const char *format, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags,\n                             JSErrorCallback errorCallback, void *userRef,\n                             const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags,\n                               JSErrorCallback errorCallback, void *userRef,\n                               const unsigned errorNumber, ...);\n\n/*\n * Complain when out of memory.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportOutOfMemory(JSContext *cx);\n\n/*\n * Complain when an allocation size overflows the maximum supported limit.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportAllocationOverflow(JSContext *cx);\n\nstruct JSErrorReport {\n    const char      *filename;      /* source file name, URL, etc., or null */\n    JSPrincipals    *originPrincipals; /* see 'originPrincipals' comment above */\n    unsigned        lineno;         /* source line number */\n    const char      *linebuf;       /* offending source line without final \\n */\n    const char      *tokenptr;      /* pointer to error token in linebuf */\n    const jschar    *uclinebuf;     /* unicode (original) line buffer */\n    const jschar    *uctokenptr;    /* unicode (original) token pointer */\n    unsigned        flags;          /* error/warning, etc. */\n    unsigned        errorNumber;    /* the error number, e.g. see js.msg */\n    const jschar    *ucmessage;     /* the (default) error message */\n    const jschar    **messageArgs;  /* arguments for the error message */\n    int16_t         exnType;        /* One of the JSExnType constants */\n    unsigned        column;         /* zero-based column index in line */\n};\n\n/*\n * JSErrorReport flag values.  These may be freely composed.\n */\n#define JSREPORT_ERROR      0x0     /* pseudo-flag for default case */\n#define JSREPORT_WARNING    0x1     /* reported via JS_ReportWarning */\n#define JSREPORT_EXCEPTION  0x2     /* exception was thrown */\n#define JSREPORT_STRICT     0x4     /* error or warning due to strict option */\n\n/*\n * This condition is an error in strict mode code, a warning if\n * JS_HAS_STRICT_OPTION(cx), and otherwise should not be reported at\n * all.  We check the strictness of the context's top frame's script;\n * where that isn't appropriate, the caller should do the right checks\n * itself instead of using this flag.\n */\n#define JSREPORT_STRICT_MODE_ERROR 0x8\n\n/*\n * If JSREPORT_EXCEPTION is set, then a JavaScript-catchable exception\n * has been thrown for this runtime error, and the host should ignore it.\n * Exception-aware hosts should also check for JS_IsExceptionPending if\n * JS_ExecuteScript returns failure, and signal or propagate the exception, as\n * appropriate.\n */\n#define JSREPORT_IS_WARNING(flags)      (((flags) & JSREPORT_WARNING) != 0)\n#define JSREPORT_IS_EXCEPTION(flags)    (((flags) & JSREPORT_EXCEPTION) != 0)\n#define JSREPORT_IS_STRICT(flags)       (((flags) & JSREPORT_STRICT) != 0)\n#define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) &                      \\\n                                              JSREPORT_STRICT_MODE_ERROR) != 0)\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_GetErrorReporter(JSContext *cx);\n\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_SetErrorReporter(JSContext *cx, JSErrorReporter er);\n\n/************************************************************************/\n\n/*\n * Dates.\n */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObjectMsec(JSContext *cx, double msec);\n\n/*\n * Infallible predicate to test whether obj is a date object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsDate(JSContext *cx, JSObject *obj);\n\n/*\n * Clears the cache of calculated local time from each Date object.\n * Call to propagate a system timezone change.\n */\nextern JS_PUBLIC_API(void)\nJS_ClearDateCaches(JSContext *cx);\n\n/************************************************************************/\n\n/*\n * Regular Expressions.\n */\n#define JSREG_FOLD      0x01    /* fold uppercase to lowercase */\n#define JSREG_GLOB      0x02    /* global exec, creates array of matches */\n#define JSREG_MULTILINE 0x04    /* treat ^ and $ as begin and end of line */\n#define JSREG_STICKY    0x08    /* only match starting at lastIndex */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObject(JSContext *cx, JSObject *obj, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(void)\nJS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRegExpStatics(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length,\n                 size_t *indexp, JSBool test, jsval *rval);\n\n/* RegExp interface for clients without a global object. */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length,\n                          size_t *indexp, JSBool test, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsRegExp(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetRegExpFlags(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetRegExpSource(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsExceptionPending(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPendingException(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_SetPendingException(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(void)\nJS_ClearPendingException(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportPendingException(JSContext *cx);\n\n/*\n * Save the current exception state.  This takes a snapshot of cx's current\n * exception state without making any change to that state.\n *\n * The returned state pointer MUST be passed later to JS_RestoreExceptionState\n * (to restore that saved state, overriding any more recent state) or else to\n * JS_DropExceptionState (to free the state struct in case it is not correct\n * or desirable to restore it).  Both Restore and Drop free the state struct,\n * so callers must stop using the pointer returned from Save after calling the\n * Release or Drop API.\n */\nextern JS_PUBLIC_API(JSExceptionState *)\nJS_SaveExceptionState(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreExceptionState(JSContext *cx, JSExceptionState *state);\n\nextern JS_PUBLIC_API(void)\nJS_DropExceptionState(JSContext *cx, JSExceptionState *state);\n\n/*\n * If the given value is an exception object that originated from an error,\n * the exception will contain an error report struct, and this API will return\n * the address of that struct.  Otherwise, it returns NULL.  The lifetime of\n * the error report struct that might be returned is the same as the lifetime\n * of the exception object.\n */\nextern JS_PUBLIC_API(JSErrorReport *)\nJS_ErrorFromException(JSContext *cx, jsval v);\n\n/*\n * Given a reported error's message and JSErrorReport struct pointer, throw\n * the corresponding exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowReportedError(JSContext *cx, const char *message,\n                      JSErrorReport *reportp);\n\n/*\n * Throws a StopIteration exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowStopIteration(JSContext *cx);\n\nextern JS_PUBLIC_API(intptr_t)\nJS_GetCurrentThread();\n\n/*\n * A JS runtime always has an \"owner thread\". The owner thread is set when the\n * runtime is created (to the current thread) and practically all entry points\n * into the JS engine check that a runtime (or anything contained in the\n * runtime: context, compartment, object, etc) is only touched by its owner\n * thread. Embeddings may check this invariant outside the JS engine by calling\n * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for\n * non-debug builds).\n *\n * It is possible to \"move\" a runtime between threads. This is accomplished by\n * calling JS_ClearRuntimeThread on a runtime's owner thread and then calling\n * JS_SetRuntimeThread on the new owner thread. The runtime must not be\n * accessed between JS_ClearRuntimeThread and JS_SetRuntimeThread. Also, the\n * caller is responsible for synchronizing the calls to Set/Clear.\n */\n\nextern JS_PUBLIC_API(void)\nJS_AbortIfWrongThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRuntimeThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeThread(JSRuntime *rt);\n\nclass JSAutoSetRuntimeThread\n{\n    JSRuntime *runtime_;\n\n  public:\n    JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime_(runtime) {\n        JS_SetRuntimeThread(runtime_);\n    }\n\n    ~JSAutoSetRuntimeThread() {\n        JS_ClearRuntimeThread(runtime_);\n    }\n};\n\n/************************************************************************/\n\n/*\n * JS_IsConstructing must be called from within a native given the\n * native's original cx and vp arguments. If JS_IsConstructing is true,\n * JS_THIS must not be used; the constructor should construct and return a\n * new object. Otherwise, the native is called as an ordinary function and\n * JS_THIS may be used.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJS_IsConstructing(JSContext *cx, const jsval *vp)\n{\n#ifdef DEBUG\n    JSObject *callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n    if (JS_ObjectIsFunction(cx, callee)) {\n        JSFunction *fun = JS_ValueToFunction(cx, JS_CALLEE(cx, vp));\n        JS_ASSERT(JS_IsConstructor(fun));\n    } else {\n        JS_ASSERT(JS_GetClass(callee)->construct != NULL);\n    }\n#else\n    (void)cx;\n#endif\n\n    return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));\n}\n\n/*\n * A constructor can request that the JS engine create a default new 'this'\n * object of the given class, using the callee to determine parentage and\n * [[Prototype]].\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp);\n\n/************************************************************************/\n\n#ifdef JS_GC_ZEAL\n#define JS_DEFAULT_ZEAL_FREQ 100\n\nextern JS_PUBLIC_API(void)\nJS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency);\n\nextern JS_PUBLIC_API(void)\nJS_ScheduleGC(JSContext *cx, uint32_t count);\n#endif\n\nextern JS_PUBLIC_API(void)\nJS_SetParallelCompilationEnabled(JSContext *cx, bool enabled);\n\ntypedef enum JSCompilerOption {\n    JSCOMPILER_BASELINE_USECOUNT_TRIGGER,\n    JSCOMPILER_ION_USECOUNT_TRIGGER,\n    JSCOMPILER_PJS_ENABLE\n} JSCompilerOption;\n\nextern JS_PUBLIC_API(void)\nJS_SetGlobalCompilerOption(JSContext *cx, JSCompilerOption opt, uint32_t value);\n\n/*\n * Convert a uint32_t index into a jsid.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IndexToId(JSContext *cx, uint32_t index, jsid *id);\n\n/*\n * Convert chars into a jsid.\n *\n * |chars| may not be an index.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp);\n\n/*\n *  Test if the given string is a valid ECMAScript identifier\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);\n\n/*\n * Return the current script and line number of the most currently running\n * frame. Returns true if a scripted frame was found, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno);\n\n\n/*\n * Encode/Decode interpreted scripts and functions to/from memory.\n */\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeScript(JSContext *cx, JSScript *script, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeInterpretedFunction(JSContext *cx, JSObject *funobj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_DecodeScript(JSContext *cx, const void *data, uint32_t length,\n                JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,\n                             JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\nextern JS_PUBLIC_DATA(const HandleId) JSID_VOIDHANDLE;\nextern JS_PUBLIC_DATA(const HandleId) JSID_EMPTYHANDLE;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Import some JS:: names into the js namespace so we can make unqualified\n * references to them.\n */\n\nusing JS::Value;\nusing JS::IsPoisonedValue;\nusing JS::NullValue;\nusing JS::UndefinedValue;\nusing JS::Int32Value;\nusing JS::DoubleValue;\nusing JS::StringValue;\nusing JS::BooleanValue;\nusing JS::ObjectValue;\nusing JS::MagicValue;\nusing JS::NumberValue;\nusing JS::ObjectOrNullValue;\nusing JS::PrivateValue;\nusing JS::PrivateUint32Value;\n\nusing JS::IsPoisonedPtr;\nusing JS::IsPoisonedId;\n\nusing JS::StableCharPtr;\nusing JS::TwoByteChars;\nusing JS::Latin1CharsZ;\n\nusing JS::AutoIdVector;\nusing JS::AutoValueVector;\nusing JS::AutoObjectVector;\nusing JS::AutoFunctionVector;\nusing JS::AutoScriptVector;\nusing JS::AutoIdArray;\n\nusing JS::AutoGCRooter;\nusing JS::AutoArrayRooter;\nusing JS::AutoVectorRooter;\nusing JS::AutoHashMapRooter;\nusing JS::AutoHashSetRooter;\n\nusing JS::CallArgs;\nusing JS::IsAcceptableThis;\nusing JS::NativeImpl;\nusing JS::CallReceiver;\nusing JS::CompileOptions;\nusing JS::CallNonGenericMethod;\n\nusing JS::Rooted;\nusing JS::RootedObject;\nusing JS::RootedModule;\nusing JS::RootedFunction;\nusing JS::RootedScript;\nusing JS::RootedString;\nusing JS::RootedId;\nusing JS::RootedValue;\n\nusing JS::Handle;\nusing JS::HandleObject;\nusing JS::HandleModule;\nusing JS::HandleFunction;\nusing JS::HandleScript;\nusing JS::HandleString;\nusing JS::HandleId;\nusing JS::HandleValue;\n\nusing JS::MutableHandle;\nusing JS::MutableHandleObject;\nusing JS::MutableHandleFunction;\nusing JS::MutableHandleScript;\nusing JS::MutableHandleString;\nusing JS::MutableHandleId;\nusing JS::MutableHandleValue;\n\nusing JS::Zone;\n\n} /* namespace js */\n\n#endif /* jsapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsclass.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclass_h\n#define jsclass_h\n/*\n * A JSClass acts as a vtable for JS objects that allows JSAPI clients to\n * control various aspects of the behavior of an object like property lookup.\n * js::Class is an engine-private extension that allows more control over\n * object behavior and, e.g., allows custom slow layout.\n */\n\n#include \"jsapi.h\"\n#include \"jsprvtd.h\"\n\nnamespace js {\n\nclass PropertyName;\nclass SpecialId;\nclass PropertyId;\n\n// This is equal to JSFunction::class_.  Use it in places where you don't want\n// to #include jsfun.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionClassPtr;\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid);\n\n/*\n * We partition the ways to refer to a property into three: by an index\n * (uint32_t); by a string whose characters do not represent an index\n * (PropertyName, see vm/String.h); and by various special values.\n *\n * Special values are encoded using SpecialId, which is layout-compatible but\n * non-interconvertible with jsid.  A SpecialId is used for JSID_VOID, which\n * does not occur in JS scripts but may be used to indicate the absence of a\n * valid identifier.  In the future, a SpecialId may also be an object used by\n * Harmony-proposed private names.\n */\nclass SpecialId\n{\n    uintptr_t bits_;\n\n    /* Needs access to raw bits. */\n    friend JS_ALWAYS_INLINE jsid SPECIALID_TO_JSID(const SpecialId &sid);\n    friend class PropertyId;\n\n    static const uintptr_t TYPE_VOID = JSID_TYPE_VOID;\n    static const uintptr_t TYPE_OBJECT = JSID_TYPE_OBJECT;\n    static const uintptr_t TYPE_MASK = JSID_TYPE_MASK;\n\n    SpecialId(uintptr_t bits) : bits_(bits) { }\n\n  public:\n    SpecialId() : bits_(TYPE_VOID) { }\n\n    /* Object-valued */\n\n    SpecialId(JSObject &obj)\n      : bits_(uintptr_t(&obj) | TYPE_OBJECT)\n    {\n        JS_ASSERT(&obj != NULL);\n        JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);\n    }\n\n    bool isObject() const {\n        return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT;\n    }\n\n    JSObject *toObject() const {\n        JS_ASSERT(isObject());\n        return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);\n    }\n\n    /* Empty */\n\n    static SpecialId empty() {\n        SpecialId sid(TYPE_OBJECT);\n        JS_ASSERT(sid.isEmpty());\n        return sid;\n    }\n\n    bool isEmpty() const {\n        return bits_ == TYPE_OBJECT;\n    }\n\n    /* Void */\n\n    static SpecialId voidId() {\n        SpecialId sid(TYPE_VOID);\n        JS_ASSERT(sid.isVoid());\n        return sid;\n    }\n\n    bool isVoid() const {\n        return bits_ == TYPE_VOID;\n    }\n};\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid)\n{\n    jsid id;\n    JSID_BITS(id) = sid.bits_;\n    JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());\n    JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));\n    JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE bool\nJSID_IS_SPECIAL(jsid id)\n{\n    return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id);\n}\n\nstatic JS_ALWAYS_INLINE SpecialId\nJSID_TO_SPECIALID(jsid id)\n{\n    JS_ASSERT(JSID_IS_SPECIAL(id));\n    if (JSID_IS_OBJECT(id))\n        return SpecialId(*JSID_TO_OBJECT(id));\n    if (JSID_IS_EMPTY(id))\n        return SpecialId::empty();\n    JS_ASSERT(JSID_IS_VOID(id));\n    return SpecialId::voidId();\n}\n\ntypedef JS::Handle<SpecialId> HandleSpecialId;\n\n/* js::Class operation signatures. */\n\ntypedef JSBool\n(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name,\n                 MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value,\n                 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);\ntypedef JSBool\n(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present);\ntypedef JSBool\n(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);\ntypedef JSBool\n(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);\ntypedef JSBool\n(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);\ntypedef JSBool\n(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);\ntypedef JSBool\n(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);\ntypedef JSBool\n(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded);\ntypedef JSBool\n(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded);\ntypedef JSBool\n(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded);\n\n\ntypedef JSObject *\n(* ObjectOp)(JSContext *cx, HandleObject obj);\ntypedef void\n(* FinalizeOp)(FreeOp *fop, JSObject *obj);\n\n#define JS_CLASS_MEMBERS                                                      \\\n    const char          *name;                                                \\\n    uint32_t            flags;                                                \\\n                                                                              \\\n    /* Mandatory function pointer members. */                                 \\\n    JSPropertyOp        addProperty;                                          \\\n    JSDeletePropertyOp  delProperty;                                          \\\n    JSPropertyOp        getProperty;                                          \\\n    JSStrictPropertyOp  setProperty;                                          \\\n    JSEnumerateOp       enumerate;                                            \\\n    JSResolveOp         resolve;                                              \\\n    JSConvertOp         convert;                                              \\\n                                                                              \\\n    /* Optional members (may be null). */                                     \\\n    FinalizeOp          finalize;                                             \\\n    JSCheckAccessOp     checkAccess;                                          \\\n    JSNative            call;                                                 \\\n    JSHasInstanceOp     hasInstance;                                          \\\n    JSNative            construct;                                            \\\n    JSTraceOp           trace\n\n/*\n * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much\n * we have to pad js::Class to match the size of JSClass.\n */\nstruct ClassSizeMeasurement\n{\n    JS_CLASS_MEMBERS;\n};\n\nstruct ClassExtension\n{\n    JSObjectOp          outerObject;\n    JSObjectOp          innerObject;\n    JSIteratorOp        iteratorObject;\n\n    /*\n     * isWrappedNative is true only if the class is an XPCWrappedNative.\n     * WeakMaps use this to override the wrapper disposal optimization.\n     */\n    bool                isWrappedNative;\n\n    /*\n     * If an object is used as a key in a weakmap, it may be desirable for the\n     * garbage collector to keep that object around longer than it otherwise\n     * would. A common case is when the key is a wrapper around an object in\n     * another compartment, and we want to avoid collecting the wrapper (and\n     * removing the weakmap entry) as long as the wrapped object is alive. In\n     * that case, the wrapped object is returned by the wrapper's\n     * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap\n     * key, it will not be collected (and remain in the weakmap) until the\n     * wrapped object is collected.\n     */\n    JSWeakmapKeyDelegateOp weakmapKeyDelegateOp;\n};\n\n#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,false,NULL}\n\nstruct ObjectOps\n{\n    LookupGenericOp     lookupGeneric;\n    LookupPropOp        lookupProperty;\n    LookupElementOp     lookupElement;\n    LookupSpecialOp     lookupSpecial;\n    DefineGenericOp     defineGeneric;\n    DefinePropOp        defineProperty;\n    DefineElementOp     defineElement;\n    DefineSpecialOp     defineSpecial;\n    GenericIdOp         getGeneric;\n    PropertyIdOp        getProperty;\n    ElementIdOp         getElement;\n    ElementIfPresentOp  getElementIfPresent; /* can be null */\n    SpecialIdOp         getSpecial;\n    StrictGenericIdOp   setGeneric;\n    StrictPropertyIdOp  setProperty;\n    StrictElementIdOp   setElement;\n    StrictSpecialIdOp   setSpecial;\n    GenericAttributesOp getGenericAttributes;\n    PropertyAttributesOp getPropertyAttributes;\n    ElementAttributesOp getElementAttributes;\n    SpecialAttributesOp getSpecialAttributes;\n    GenericAttributesOp setGenericAttributes;\n    PropertyAttributesOp setPropertyAttributes;\n    ElementAttributesOp setElementAttributes;\n    SpecialAttributesOp setSpecialAttributes;\n    DeletePropertyOp    deleteProperty;\n    DeleteElementOp     deleteElement;\n    DeleteSpecialOp     deleteSpecial;\n\n    JSNewEnumerateOp    enumerate;\n    ObjectOp            thisObject;\n};\n\n#define JS_NULL_OBJECT_OPS                                                    \\\n    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \\\n     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,        \\\n     NULL,NULL,NULL}\n\nstruct Class\n{\n    JS_CLASS_MEMBERS;\n    ClassExtension      ext;\n    ObjectOps           ops;\n    uint8_t             pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -\n                            sizeof(ClassExtension) - sizeof(ObjectOps)];\n\n    /* Class is not native and its map is not a scope. */\n    static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;\n\n    bool isNative() const {\n        return !(flags & NON_NATIVE);\n    }\n\n    bool hasPrivate() const {\n        return !!(flags & JSCLASS_HAS_PRIVATE);\n    }\n\n    bool emulatesUndefined() const {\n        return flags & JSCLASS_EMULATES_UNDEFINED;\n    }\n\n    bool isCallable() const {\n        return this == js::FunctionClassPtr || call;\n    }\n\n    static size_t offsetOfFlags() { return offsetof(Class, flags); }\n};\n\nJS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));\nJS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));\nJS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));\nJS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));\nJS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));\nJS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));\nJS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));\nJS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));\nJS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));\nJS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));\nJS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));\nJS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));\n\nstatic JS_ALWAYS_INLINE JSClass *\nJsvalify(Class *c)\n{\n    return (JSClass *)c;\n}\nstatic JS_ALWAYS_INLINE const JSClass *\nJsvalify(const Class *c)\n{\n    return (const JSClass *)c;\n}\n\nstatic JS_ALWAYS_INLINE Class *\nValueify(JSClass *c)\n{\n    return (Class *)c;\n}\nstatic JS_ALWAYS_INLINE const Class *\nValueify(const JSClass *c)\n{\n    return (const Class *)c;\n}\n\n/*\n * Enumeration describing possible values of the [[Class]] internal property\n * value of objects.\n */\nenum ESClassValue {\n    ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean,\n    ESClass_RegExp, ESClass_ArrayBuffer, ESClass_Date\n};\n\n/*\n * Return whether the given object has the given [[Class]] internal property\n * value. Beware, this query says nothing about the js::Class of the JSObject\n * so the caller must not assume anything about obj's representation (e.g., obj\n * may be a proxy).\n */\ninline bool\nObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx);\n\n/* Just a helper that checks v.isObject before calling ObjectClassIs. */\ninline bool\nIsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx);\n\ninline bool\nIsPoisonedSpecialId(js::SpecialId iden)\n{\n    if (iden.isObject())\n        return IsPoisonedPtr(iden.toObject());\n    return false;\n}\n\ntemplate <> struct GCMethods<SpecialId>\n{\n    static SpecialId initial() { return SpecialId(); }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(SpecialId id) { return IsPoisonedSpecialId(id); }\n};\n\n}  /* namespace js */\n\n#endif  /* jsclass_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsclist.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclist_h\n#define jsclist_h\n\n#include \"jstypes.h\"\n\n/*\n** Circular linked list\n*/\ntypedef struct JSCListStr {\n    struct JSCListStr *next;\n    struct JSCListStr *prev;\n} JSCList;\n\n/*\n** Insert element \"_e\" into the list, before \"_l\".\n*/\n#define JS_INSERT_BEFORE(_e,_l)  \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l);       \\\n        (_e)->prev = (_l)->prev; \\\n        (_l)->prev->next = (_e); \\\n        (_l)->prev = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Insert element \"_e\" into the list, after \"_l\".\n*/\n#define JS_INSERT_AFTER(_e,_l)   \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l)->next; \\\n        (_e)->prev = (_l);       \\\n        (_l)->next->prev = (_e); \\\n        (_l)->next = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Return the element following element \"_e\"\n*/\n#define JS_NEXT_LINK(_e)         \\\n        ((_e)->next)\n/*\n** Return the element preceding element \"_e\"\n*/\n#define JS_PREV_LINK(_e)         \\\n        ((_e)->prev)\n\n/*\n** Append an element \"_e\" to the end of the list \"_l\"\n*/\n#define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l)\n\n/*\n** Insert an element \"_e\" at the head of the list \"_l\"\n*/\n#define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l)\n\n/* Return the head/tail of the list */\n#define JS_LIST_HEAD(_l) (_l)->next\n#define JS_LIST_TAIL(_l) (_l)->prev\n\n/*\n** Remove the element \"_e\" from it's circular list.\n*/\n#define JS_REMOVE_LINK(_e)             \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n    JS_END_MACRO\n\n/*\n** Remove the element \"_e\" from it's circular list. Also initializes the\n** linkage.\n*/\n#define JS_REMOVE_AND_INIT_LINK(_e)    \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n        (_e)->next = (_e);             \\\n        (_e)->prev = (_e);             \\\n    JS_END_MACRO\n\n/*\n** Return non-zero if the given circular list \"_l\" is empty, zero if the\n** circular list is not empty\n*/\n#define JS_CLIST_IS_EMPTY(_l) \\\n    ((_l)->next == (_l))\n\n/*\n** Initialize a circular list\n*/\n#define JS_INIT_CLIST(_l)  \\\n    JS_BEGIN_MACRO         \\\n        (_l)->next = (_l); \\\n        (_l)->prev = (_l); \\\n    JS_END_MACRO\n\n#define JS_INIT_STATIC_CLIST(_l) \\\n    {(_l), (_l)}\n\n#endif /* jsclist_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jscpucfg.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jscpucfg_h\n#define jscpucfg_h\n\n#define JS_HAVE_LONG_LONG\n\n#if defined(_WIN64)\n\n# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n#  define JS_BYTES_PER_WORD   8\n#  define JS_BITS_PER_WORD_LOG2   6\n# else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n#  error \"CPU type is unknown\"\n# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n\n#elif defined(_WIN32) || defined(XP_OS2)\n\n# ifdef __WATCOMC__\n#  define HAVE_VA_LIST_AS_ARRAY 1\n# endif\n\n# define IS_LITTLE_ENDIAN 1\n# undef  IS_BIG_ENDIAN\n# define JS_BYTES_PER_WORD   4\n# define JS_BITS_PER_WORD_LOG2   5\n\n#elif defined(__APPLE__)\n# if __LITTLE_ENDIAN__\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n# elif __BIG_ENDIAN__\n#  undef  IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# endif\n\n#elif defined(JS_HAVE_ENDIAN_H)\n# include <endian.h>\n\n# if defined(__BYTE_ORDER)\n#  if __BYTE_ORDER == __LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif __BYTE_ORDER == __BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(__BYTE_ORDER) */\n#  error \"endian.h does not define __BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n/* BSDs */\n#elif defined(JS_HAVE_MACHINE_ENDIAN_H)\n# include <sys/types.h>\n# include <machine/endian.h>\n\n# if defined(_BYTE_ORDER)\n#  if _BYTE_ORDER == _LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif _BYTE_ORDER == _BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(_BYTE_ORDER) */\n#  error \"machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n#elif defined(JS_HAVE_SYS_ISA_DEFS_H)\n# include <sys/isa_defs.h>\n\n# if defined(_BIG_ENDIAN)\n#  undef IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# elif defined(_LITTLE_ENDIAN)\n#  define IS_LITTLE_ENDIAN 1\n#  undef IS_BIG_ENDIAN\n# else /* !defined(_LITTLE_ENDIAN) */\n#  error \"sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness.\"\n# endif\n# if !defined(JS_STACK_GROWTH_DIRECTION)\n#  if defined(_STACK_GROWS_UPWARD)\n#   define JS_STACK_GROWTH_DIRECTION (1)\n#  elif defined(_STACK_GROWS_DOWNWARD)\n#   define JS_STACK_GROWTH_DIRECTION (-1)\n#  endif\n# endif\n\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(_BIG_ENDIAN)\n/* IA64 running HP-UX will have _BIG_ENDIAN defined.\n * IA64 running Linux will have endian.h and be handled above.\n */\n# undef IS_LITTLE_ENDIAN\n# define IS_BIG_ENDIAN 1\n\n#else /* !defined(__sparc) && !defined(__sparc__) && ... */\n# error \"Cannot determine endianness of your platform. Please add support to jscpucfg.h.\"\n#endif\n\n#ifndef JS_STACK_GROWTH_DIRECTION\n# ifdef __hppa\n#  define JS_STACK_GROWTH_DIRECTION (1)\n# else\n#  define JS_STACK_GROWTH_DIRECTION (-1)\n# endif\n#endif\n\n#endif /* jscpucfg_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsdbgapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsdbgapi_h\n#define jsdbgapi_h\n/*\n * JS debugger API.\n */\n\n#include \"jsprvtd.h\"\n\nnamespace JS {\n\nstruct FrameDescription\n{\n    JSScript *script;\n    unsigned lineno;\n    JSFunction *fun;\n};\n\nstruct StackDescription\n{\n    unsigned nframes;\n    FrameDescription *frames;\n};\n\nextern JS_PUBLIC_API(StackDescription *)\nDescribeStack(JSContext *cx, unsigned maxFrames);\n\nextern JS_PUBLIC_API(void)\nFreeStackDescription(JSContext *cx, StackDescription *desc);\n\nextern JS_PUBLIC_API(char *)\nFormatStackDump(JSContext *cx, char *buf,\n                    JSBool showArgs, JSBool showLocals,\n                    JSBool showThisProps);\n\n}\n\n# ifdef DEBUG\nJS_FRIEND_API(void) js_DumpValue(const js::Value &val);\nJS_FRIEND_API(void) js_DumpId(jsid id);\nJS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);\n# endif\n\nJS_FRIEND_API(void)\njs_DumpBacktrace(JSContext *cx);\n\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * Currently, we only support runtime-wide debugging. In the future, we should\n * be able to support compartment-wide debugging.\n */\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);\n\n/*\n * Debug mode is a compartment-wide mode that enables a debugger to attach\n * to and interact with running methodjit-ed frames. In particular, it causes\n * every function to be compiled as if an eval was present (so eval-in-frame)\n * can work, and it ensures that functions can be re-JITed for other debug\n * features. In general, it is not safe to interact with frames that were live\n * before debug mode was enabled. For this reason, it is also not safe to\n * enable debug mode while frames are live.\n */\n\n/* Get current state of debugging mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_GetDebugMode(JSContext *cx);\n\n/*\n * Turn on/off debugging mode for all compartments. This returns false if any code\n * from any of the runtime's compartments is running or on the stack.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a single compartment. This should only be\n * used when no code from this compartment is running or on the stack in any\n * thread.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a context's compartment.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugMode(JSContext *cx, JSBool debug);\n\n/* Turn on single step mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);\n\n/* The closure argument will be marked. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n           JSTrapHandler handler, jsval closure);\n\nextern JS_PUBLIC_API(void)\nJS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n             JSTrapHandler *handlerp, jsval *closurep);\n\nextern JS_PUBLIC_API(void)\nJS_ClearScriptTraps(JSRuntime *rt, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_ClearAllTrapsForCompartment(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                 JSWatchPointHandler handler, JSObject *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                   JSWatchPointHandler *handlerp, JSObject **closurep);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearAllWatchPoints(JSContext *cx);\n\n/************************************************************************/\n\n// Raw JSScript* because this needs to be callable from a signal handler.\nextern JS_PUBLIC_API(unsigned)\nJS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_EndPC(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetLinePCs(JSContext *cx, JSScript *script,\n              unsigned startLine, unsigned maxLines,\n              unsigned* count, unsigned** lines, jsbytecode*** pcs);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);\n\n/*\n * N.B. The mark is in the context temp pool and thus the caller must take care\n * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other\n * call that may use the temp pool.\n */\nextern JS_PUBLIC_API(uintptr_t *)\nJS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);\n\nextern JS_PUBLIC_API(JSAtom *)\nJS_LocalNameToAtom(uintptr_t w);\n\nextern JS_PUBLIC_API(JSString *)\nJS_AtomKey(JSAtom *atom);\n\nextern JS_PUBLIC_API(void)\nJS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_GetFunctionScript(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSNative)\nJS_GetFunctionNative(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptPrincipals(JSScript *script);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptOriginPrincipals(JSScript *script);\n\nJS_PUBLIC_API(JSFunction *)\nJS_GetScriptFunction(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\n/*\n * This is almost JS_GetClass(obj)->name except that certain debug-only\n * proxies are made transparent. In particular, this function turns the class\n * of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject)\n * from \"Proxy\" to \"Call\", \"Block\", \"With\" etc.\n */\nextern JS_PUBLIC_API(const char *)\nJS_GetDebugClassName(JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const char *)\nJS_GetScriptFilename(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetScriptSourceMap(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptLineExtent(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetScriptVersion(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(bool)\nJS_GetScriptIsSelfHosted(JSScript *script);\n\n/************************************************************************/\n\n/*\n * Hook setters for script creation and destruction, see jsprvtd.h for the\n * typedefs.  These macros provide binary compatibility and newer, shorter\n * synonyms.\n */\n#define JS_SetNewScriptHook     JS_SetNewScriptHookProc\n#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc\n\nextern JS_PUBLIC_API(void)\nJS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,\n                        void *callerdata);\n\n/************************************************************************/\n\ntypedef struct JSPropertyDesc {\n    jsval           id;         /* primary id, atomized string, or int */\n    jsval           value;      /* property value */\n    uint8_t         flags;      /* flags, see below */\n    uint8_t         spare;      /* unused */\n    jsval           alias;      /* alias id if JSPD_ALIAS flag */\n} JSPropertyDesc;\n\n#define JSPD_ENUMERATE  0x01    /* visible to for/in loop */\n#define JSPD_READONLY   0x02    /* assignment is error */\n#define JSPD_PERMANENT  0x04    /* property cannot be deleted */\n#define JSPD_ALIAS      0x08    /* property has an alias id */\n#define JSPD_EXCEPTION  0x40    /* exception occurred fetching the property, */\n                                /* value is exception */\n#define JSPD_ERROR      0x80    /* native getter returned JS_FALSE without */\n                                /* throwing an exception */\n\ntypedef struct JSPropertyDescArray {\n    uint32_t        length;     /* number of elements in array */\n    JSPropertyDesc  *array;     /* alloc'd by Get, freed by Put */\n} JSPropertyDescArray;\n\ntypedef struct JSScopeProperty JSScopeProperty;\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);\n\nextern JS_PUBLIC_API(void)\nJS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);\n\n/************************************************************************/\n\n/*\n * JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a\n * StackFrame or baseline JIT frame.\n */\nclass JS_PUBLIC_API(JSAbstractFramePtr)\n{\n    uintptr_t ptr_;\n\n  protected:\n    JSAbstractFramePtr()\n      : ptr_(0)\n    { }\n\n  public:\n    explicit JSAbstractFramePtr(void *raw);\n\n    uintptr_t raw() const { return ptr_; }\n\n    operator bool() const { return !!ptr_; }\n\n    JSObject *scopeChain(JSContext *cx);\n    JSObject *callObject(JSContext *cx);\n\n    JSFunction *maybeFun();\n    JSScript *script();\n\n    bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv);\n\n    bool isDebuggerFrame();\n\n    bool evaluateInStackFrame(JSContext *cx,\n                              const char *bytes, unsigned length,\n                              const char *filename, unsigned lineno,\n                              JS::MutableHandleValue rval);\n\n    bool evaluateUCInStackFrame(JSContext *cx,\n                                const jschar *chars, unsigned length,\n                                const char *filename, unsigned lineno,\n                                JS::MutableHandleValue rval);\n};\n\nclass JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr\n{\n  public:\n    JSNullFramePtr()\n      : JSAbstractFramePtr()\n    {}\n};\n\n/*\n * This class does not work when IonMonkey is active. It's only used by jsd,\n * which can only be used when IonMonkey is disabled.\n *\n * To find the calling script and line number, use JS_DescribeSciptedCaller.\n * To summarize the call stack, use JS::DescribeStack.\n */\nclass JS_PUBLIC_API(JSBrokenFrameIterator)\n{\n    void *data_;\n\n  public:\n    JSBrokenFrameIterator(JSContext *cx);\n    ~JSBrokenFrameIterator();\n\n    bool done() const;\n    JSBrokenFrameIterator& operator++();\n\n    JSAbstractFramePtr abstractFramePtr() const;\n    jsbytecode *pc() const;\n\n    bool isConstructing() const;\n};\n\n/*\n * This hook captures high level script execution and function calls (JS or\n * native).  It is used by JS_SetExecuteHook to hook top level scripts and by\n * JS_SetCallHook to hook function calls.  It will get called twice per script\n * or function call: just before execution begins and just after it finishes.\n * In both cases the 'current' frame is that of the executing code.\n *\n * The 'before' param is JS_TRUE for the hook invocation before the execution\n * and JS_FALSE for the invocation after the code has run.\n *\n * The 'ok' param is significant only on the post execution invocation to\n * signify whether or not the code completed 'normally'.\n *\n * The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook\n * for the 'before'invocation, but is whatever value is returned from that\n * invocation for the 'after' invocation. Thus, the hook implementor *could*\n * allocate a structure in the 'before' invocation and return a pointer to that\n * structure. The pointer would then be handed to the hook for the 'after'\n * invocation. Alternately, the 'before' could just return the same value as\n * in 'closure' to cause the 'after' invocation to be called with the same\n * 'closure' value as the 'before'.\n *\n * Returning NULL in the 'before' hook will cause the 'after' hook *not* to\n * be called.\n */\ntypedef void *\n(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,\n                      JSBool before, JSBool *ok, void *closure);\n\ntypedef JSBool\n(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,\n                     void *closure);\n\ntypedef struct JSDebugHooks {\n    JSInterruptHook     interruptHook;\n    void                *interruptHookData;\n    JSNewScriptHook     newScriptHook;\n    void                *newScriptHookData;\n    JSDestroyScriptHook destroyScriptHook;\n    void                *destroyScriptHookData;\n    JSDebuggerHandler   debuggerHandler;\n    void                *debuggerHandlerData;\n    JSSourceHandler     sourceHandler;\n    void                *sourceHandlerData;\n    JSInterpreterHook   executeHook;\n    void                *executeHookData;\n    JSInterpreterHook   callHook;\n    void                *callHookData;\n    JSThrowHook         throwHook;\n    void                *throwHookData;\n    JSDebugErrorHook    debugErrorHook;\n    void                *debugErrorHookData;\n} JSDebugHooks;\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const JSDebugHooks *)\nJS_GetGlobalDebugHooks(JSRuntime *rt);\n\n/**\n * Add various profiling-related functions as properties of the given object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);\n\n/* Defined in vm/Debugger.cpp. */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineDebuggerObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_DumpBytecode(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentBytecode(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DumpPCCounts(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentPCCounts(JSContext *cx);\n\n/* Call the context debug handler on the topmost scripted frame. */\nextern JS_FRIEND_API(JSBool)\njs_CallContextDebugHandler(JSContext *cx);\n\n#endif /* jsdbgapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsfriendapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsfriendapi_h\n#define jsfriendapi_h\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include \"jsclass.h\"\n#include \"jsprvtd.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n\n/*\n * This macro checks if the stack pointer has exceeded a given limit. If\n * |tolerance| is non-zero, it returns true only if the stack pointer has\n * exceeded the limit by more than |tolerance| bytes.\n */\n#if JS_STACK_GROWTH_DIRECTION > 0\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) < (limit)+(tolerance))\n#else\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) > (limit)-(tolerance))\n#endif\n\n#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)\n\nnamespace JS {\ntemplate <class T>\nclass Heap;\n} /* namespace JS */\n\nextern JS_FRIEND_API(void)\nJS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\nextern JS_FRIEND_API(JSString *)\nJS_GetAnonymousString(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nJS_FindCompilationScope(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSFunction *)\nJS_GetObjectFunction(JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(uint32_t)\nJS_ObjectCountDynamicSlots(JS::HandleObject obj);\n\nextern JS_FRIEND_API(size_t)\nJS_SetProtoCalled(JSContext *cx);\n\nextern JS_FRIEND_API(size_t)\nJS_GetCustomIteratorCount(JSContext *cx);\n\nextern JS_FRIEND_API(JSBool)\nJS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret);\n\n/*\n * Determine whether the given object is backed by a DeadObjectProxy.\n *\n * Such objects hold no other objects (they have no outgoing reference edges)\n * and will throw if you touch them (e.g. by reading/writing a property).\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsDeadWrapper(JSObject *obj);\n\n/*\n * Used by the cycle collector to trace through the shape and all\n * shapes it reaches, marking all non-shape children found in the\n * process. Uses bounded stack space.\n */\nextern JS_FRIEND_API(void)\nJS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape);\n\nenum {\n    JS_TELEMETRY_GC_REASON,\n    JS_TELEMETRY_GC_IS_COMPARTMENTAL,\n    JS_TELEMETRY_GC_MS,\n    JS_TELEMETRY_GC_MAX_PAUSE_MS,\n    JS_TELEMETRY_GC_MARK_MS,\n    JS_TELEMETRY_GC_SWEEP_MS,\n    JS_TELEMETRY_GC_MARK_ROOTS_MS,\n    JS_TELEMETRY_GC_MARK_GRAY_MS,\n    JS_TELEMETRY_GC_SLICE_MS,\n    JS_TELEMETRY_GC_MMU_50,\n    JS_TELEMETRY_GC_RESET,\n    JS_TELEMETRY_GC_INCREMENTAL_DISABLED,\n    JS_TELEMETRY_GC_NON_INCREMENTAL,\n    JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS,\n    JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS\n};\n\ntypedef void\n(* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample);\n\nextern JS_FRIEND_API(void)\nJS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback);\n\nextern JS_FRIEND_API(JSPrincipals *)\nJS_GetCompartmentPrincipals(JSCompartment *compartment);\n\nextern JS_FRIEND_API(void)\nJS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);\n\n/* Safe to call with input obj == NULL. Returns non-NULL iff obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToInnerObject(JSContext *cx, JSObject *obj);\n\n/* Requires obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToOuterObject(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSObject *)\nJS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(JSString *)\nJS_BasicObjectToString(JSContext *cx, JS::HandleObject obj);\n\nextern JS_FRIEND_API(JSBool)\njs_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,\n                          JS::MutableHandleValue vp);\n\nJS_FRIEND_API(void)\njs_ReportOverRecursed(JSContext *maybecx);\n\nJS_FRIEND_API(bool)\njs_ObjectClassIs(JSContext *cx, JS::HandleObject obj, js::ESClassValue classValue);\n\nJS_FRIEND_API(const char *)\njs_ObjectClassName(JSContext *cx, JS::HandleObject obj);\n\nJS_FRIEND_API(bool)\njs_AddObjectRoot(JSRuntime *rt, JSObject **objp);\n\nJS_FRIEND_API(void)\njs_RemoveObjectRoot(JSRuntime *rt, JSObject **objp);\n\n#ifdef DEBUG\n\n/*\n * Routines to print out values during debugging.  These are FRIEND_API to help\n * the debugger find them and to support temporarily hacking js_Dump* calls\n * into other code.\n */\n\nextern JS_FRIEND_API(void)\njs_DumpString(JSString *str);\n\nextern JS_FRIEND_API(void)\njs_DumpAtom(JSAtom *atom);\n\nextern JS_FRIEND_API(void)\njs_DumpObject(JSObject *obj);\n\nextern JS_FRIEND_API(void)\njs_DumpChars(const jschar *s, size_t n);\n#endif\n\nextern JS_FRIEND_API(bool)\nJS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);\n\nextern JS_FRIEND_API(JSBool)\nJS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,\n                  js::MutableHandleValue statep, js::MutableHandleId idp);\n\nstruct JSFunctionSpecWithHelp {\n    const char      *name;\n    JSNative        call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *usage;\n    const char      *help;\n};\n\n#define JS_FN_HELP(name,call,nargs,flags,usage,help)                          \\\n    {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}\n#define JS_FS_HELP_END                                                        \\\n    {NULL, NULL, 0, 0, NULL, NULL}\n\nextern JS_FRIEND_API(bool)\nJS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);\n\ntypedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,\n                               jschar **src, uint32_t *length);\n\nextern JS_FRIEND_API(void)\nJS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);\n\nnamespace js {\n\ninline JSRuntime *\nGetRuntime(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->runtime_;\n}\n\ninline JSCompartment *\nGetContextCompartment(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->compartment_;\n}\n\ninline JS::Zone *\nGetContextZone(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->zone_;\n}\n\nextern JS_FRIEND_API(JS::Zone *)\nGetCompartmentZone(JSCompartment *comp);\n\ntypedef bool\n(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);\n\n /*\n  * Dump the complete object graph of heap-allocated things.\n  * fp is the file for the dump output.\n  */\nextern JS_FRIEND_API(void)\nDumpHeapComplete(JSRuntime *rt, FILE *fp);\n\n#ifdef OLD_GETTER_SETTER_METHODS\nJS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);\nJS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);\n#endif\n\nextern JS_FRIEND_API(bool)\nIsSystemCompartment(JSCompartment *comp);\n\nextern JS_FRIEND_API(bool)\nIsSystemZone(JS::Zone *zone);\n\nextern JS_FRIEND_API(bool)\nIsAtomsCompartment(JSCompartment *comp);\n\n/*\n * Check whether it is OK to assign an undeclared variable with the name\n * |propname| at the current location in script.  It is not an error if there is\n * no current script location, or if that location is not an assignment to an\n * undeclared variable.  Reports an error if one needs to be reported (and,\n * particularly, always reports when it returns false).\n */\nextern JS_FRIEND_API(bool)\nReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname);\n\n/*\n * Returns whether we're in a non-strict property set (in that we're in a\n * non-strict script and the bytecode we're on is a property set).  The return\n * value does NOT indicate any sort of exception was thrown: it's just a\n * boolean.\n */\nextern JS_FRIEND_API(bool)\nIsInNonStrictPropertySet(JSContext *cx);\n\nstruct WeakMapTracer;\n\n/*\n * Weak map tracer callback, called once for every binding of every\n * weak map that was live at the time of the last garbage collection.\n *\n * m will be NULL if the weak map is not contained in a JS Object.\n */\ntypedef void\n(* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m,\n                         void *k, JSGCTraceKind kkind,\n                         void *v, JSGCTraceKind vkind);\n\nstruct WeakMapTracer {\n    JSRuntime            *runtime;\n    WeakMapTraceCallback callback;\n\n    WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb)\n        : runtime(rt), callback(cb) {}\n};\n\nextern JS_FRIEND_API(void)\nTraceWeakMaps(WeakMapTracer *trc);\n\nextern JS_FRIEND_API(bool)\nAreGCGrayBitsValid(JSRuntime *rt);\n\ntypedef void\n(*GCThingCallback)(void *closure, void *gcthing);\n\nextern JS_FRIEND_API(void)\nVisitGrayWrapperTargets(JS::Zone *zone, GCThingCallback callback, void *closure);\n\nextern JS_FRIEND_API(JSObject *)\nGetWeakmapKeyDelegate(JSObject *key);\n\nJS_FRIEND_API(JSGCTraceKind)\nGCThingTraceKind(void *thing);\n\n/*\n * Invoke cellCallback on every gray JS_OBJECT in the given zone.\n */\nextern JS_FRIEND_API(void)\nIterateGrayObjects(JS::Zone *zone, GCThingCallback cellCallback, void *data);\n\n#ifdef JS_HAS_CTYPES\nextern JS_FRIEND_API(size_t)\nSizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj);\n#endif\n\nextern JS_FRIEND_API(JSCompartment *)\nGetAnyCompartmentInZone(JS::Zone *zone);\n\n/*\n * Shadow declarations of JS internal structures, for access by inline access\n * functions below. Do not use these structures in any other way. When adding\n * new fields for access by inline methods, make sure to add static asserts to\n * the original header file to ensure that offsets are consistent.\n */\nnamespace shadow {\n\nstruct TypeObject {\n    Class       *clasp;\n    JSObject    *proto;\n};\n\nstruct BaseShape {\n    js::Class *clasp;\n    JSObject *parent;\n    JSObject *_1;\n    JSCompartment *compartment;\n};\n\nclass Shape {\npublic:\n    shadow::BaseShape *base;\n    jsid              _1;\n    uint32_t          slotInfo;\n\n    static const uint32_t FIXED_SLOTS_SHIFT = 27;\n};\n\nstruct Object {\n    shadow::Shape      *shape;\n    shadow::TypeObject *type;\n    js::Value          *slots;\n    js::Value          *_1;\n\n    size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }\n    Value *fixedSlots() const {\n        return (Value *)(uintptr_t(this) + sizeof(shadow::Object));\n    }\n\n    js::Value &slotRef(size_t slot) const {\n        size_t nfixed = numFixedSlots();\n        if (slot < nfixed)\n            return fixedSlots()[slot];\n        return slots[slot - nfixed];\n    }\n};\n\nstruct Function {\n    Object base;\n    uint16_t nargs;\n    uint16_t flags;\n    /* Used only for natives */\n    Native native;\n    const JSJitInfo *jitinfo;\n    void *_1;\n};\n\nstruct Atom {\n    static const size_t LENGTH_SHIFT = 4;\n    size_t lengthAndFlags;\n    const jschar *chars;\n};\n\n} /* namespace shadow */\n\n// These are equal to |&{Function,Object,OuterWindow}ProxyObject::class_|.  Use\n// them in places where you don't want to #include vm/ProxyObject.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) ObjectProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) OuterWindowProxyClassPtr;\n\n// This is equal to |&JSObject::class_|.  Use it in places where you don't want\n// to #include jsobj.h.\nextern JS_FRIEND_DATA(js::Class* const) ObjectClassPtr;\n\ninline js::Class *\nGetObjectClass(JSObject *obj)\n{\n    return reinterpret_cast<const shadow::Object*>(obj)->type->clasp;\n}\n\ninline JSClass *\nGetObjectJSClass(JSObject *obj)\n{\n    return js::Jsvalify(GetObjectClass(obj));\n}\n\ninline bool\nIsInnerObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.outerObject;\n}\n\ninline bool\nIsOuterObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.innerObject;\n}\n\nJS_FRIEND_API(bool)\nIsFunctionObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsScopeObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsCallObject(JSObject *obj);\n\ninline JSObject *\nGetObjectParent(JSObject *obj)\n{\n    JS_ASSERT(!IsScopeObject(obj));\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->parent;\n}\n\nstatic JS_ALWAYS_INLINE JSCompartment *\nGetObjectCompartment(JSObject *obj)\n{\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->compartment;\n}\n\nJS_FRIEND_API(JSObject *)\nGetObjectParentMaybeScope(JSObject *obj);\n\nJS_FRIEND_API(JSObject *)\nGetGlobalForObjectCrossCompartment(JSObject *obj);\n\n// For legacy consumers only. This whole concept is going away soon.\nJS_FRIEND_API(JSObject *)\nDefaultObjectForContextOrNull(JSContext *cx);\n\nJS_FRIEND_API(void)\nSetDefaultObjectForContext(JSContext *cx, JSObject *obj);\n\nJS_FRIEND_API(void)\nNotifyAnimationActivity(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsOriginalScriptFunction(JSFunction *fun);\n\n/*\n * Return the outermost enclosing function (script) of the scripted caller.\n * This function returns NULL in several cases:\n *  - no script is running on the context\n *  - the caller is in global or eval code\n * In particular, this function will \"stop\" its outermost search at eval() and\n * thus it will really return the outermost enclosing function *since the\n * innermost eval*.\n */\nJS_FRIEND_API(JSScript *)\nGetOutermostEnclosingFunctionOfScriptedCaller(JSContext *cx);\n\nJS_FRIEND_API(JSFunction *)\nDefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                           unsigned nargs, unsigned attrs);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                        JSObject *parent, const char *name);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,\n                            JSObject *parent, jsid id);\n\nJS_FRIEND_API(JSObject *)\nInitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n                      JSClass *clasp, JSNative constructor, unsigned nargs,\n                      const JSPropertySpec *ps, const JSFunctionSpec *fs,\n                      const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\nJS_FRIEND_API(const Value &)\nGetFunctionNativeReserved(JSObject *fun, size_t which);\n\nJS_FRIEND_API(void)\nSetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val);\n\ninline bool\nGetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)\n{\n    js::Class *clasp = GetObjectClass(obj);\n    if (clasp == js::ObjectProxyClassPtr ||\n        clasp == js::OuterWindowProxyClassPtr ||\n        clasp == js::FunctionProxyClassPtr)\n    {\n        return JS_GetPrototype(cx, obj, proto);\n    }\n\n    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);\n    return true;\n}\n\ninline void *\nGetObjectPrivate(JSObject *obj)\n{\n    const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);\n    void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);\n    return *addr;\n}\n\n/*\n * Get a slot that is both reserved for object's clasp *and* is fixed (fits\n * within the maximum capacity for the object's fixed slots).\n */\ninline const Value &\nGetReservedSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\nJS_FRIEND_API(void)\nSetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);\n\ninline void\nSetReservedSlot(JSObject *obj, size_t slot, const Value &value)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);\n    if (sobj->slotRef(slot).isMarkable()\n#ifdef JSGC_GENERATIONAL\n        || value.isMarkable()\n#endif\n       )\n    {\n        SetReservedSlotWithBarrier(obj, slot, value);\n    } else {\n        sobj->slotRef(slot) = value;\n    }\n}\n\nJS_FRIEND_API(uint32_t)\nGetObjectSlotSpan(JSObject *obj);\n\ninline const Value &\nGetObjectSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < GetObjectSlotSpan(obj));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\ninline const jschar *\nGetAtomChars(JSAtom *atom)\n{\n    return reinterpret_cast<shadow::Atom *>(atom)->chars;\n}\n\ninline size_t\nGetAtomLength(JSAtom *atom)\n{\n    using shadow::Atom;\n    return reinterpret_cast<Atom*>(atom)->lengthAndFlags >> Atom::LENGTH_SHIFT;\n}\n\ninline JSLinearString *\nAtomToLinearString(JSAtom *atom)\n{\n    return reinterpret_cast<JSLinearString *>(atom);\n}\n\nstatic inline js::PropertyOp\nCastAsJSPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object);\n}\n\nstatic inline js::StrictPropertyOp\nCastAsJSStrictPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object);\n}\n\nJS_FRIEND_API(bool)\nGetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);\n\nJS_FRIEND_API(bool)\nAppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others);\n\nJS_FRIEND_API(bool)\nGetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);\n\nJS_FRIEND_API(bool)\nStringIsArrayIndex(JSLinearString *str, uint32_t *indexp);\n\nJS_FRIEND_API(void)\nSetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);\n\nJS_FRIEND_API(bool)\nIsObjectInContextCompartment(JSObject *obj, const JSContext *cx);\n\n/*\n * NB: these flag bits are encoded into the bytecode stream in the immediate\n * operand of JSOP_ITER, so don't change them without advancing vm/Xdr.h's\n * XDR_BYTECODE_VERSION.\n */\n#define JSITER_ENUMERATE  0x1   /* for-in compatible hidden default iterator */\n#define JSITER_FOREACH    0x2   /* return [key, value] pair rather than key */\n#define JSITER_KEYVALUE   0x4   /* destructuring for-in wants [key, value] */\n#define JSITER_OWNONLY    0x8   /* iterate over obj's own properties only */\n#define JSITER_HIDDEN     0x10  /* also enumerate non-enumerable properties */\n#define JSITER_FOR_OF     0x20  /* harmony for-of loop */\n\ninline uintptr_t\nGetNativeStackLimit(const JSRuntime *rt)\n{\n    return PerThreadDataFriendFields::getMainThread(rt)->nativeStackLimit;\n}\n\ninline uintptr_t\nGetNativeStackLimit(JSContext *cx)\n{\n    return GetNativeStackLimit(GetRuntime(cx));\n}\n\n/*\n * These macros report a stack overflow and run |onerror| if we are close to\n * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a little\n * extra space so that we can ensure that crucial code is able to run.\n */\n\n#define JS_CHECK_RECURSION(cx, onerror)                              \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), &stackDummy_)) {  \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, sp, onerror)                 \\\n    JS_BEGIN_MACRO                                                              \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), sp)) {            \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_CHROME_RECURSION(cx, onerror)                                  \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE_WITH_TOLERANCE(js::GetNativeStackLimit(cx),    \\\n                                                &stackDummy_,                   \\\n                                                1024 * sizeof(size_t)))         \\\n        {                                                                       \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\nJS_FRIEND_API(void)\nStartPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nStopPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nPurgePCCounts(JSContext *cx);\n\nJS_FRIEND_API(size_t)\nGetPCCountScriptCount(JSContext *cx);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptSummary(JSContext *cx, size_t script);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptContents(JSContext *cx, size_t script);\n\n/*\n * A call stack can be specified to the JS engine such that all JS entry/exits\n * to functions push/pop an entry to/from the specified stack.\n *\n * For more detailed information, see vm/SPSProfiler.h\n */\nclass ProfileEntry\n{\n    /*\n     * All fields are marked volatile to prevent the compiler from re-ordering\n     * instructions. Namely this sequence:\n     *\n     *    entry[size] = ...;\n     *    size++;\n     *\n     * If the size modification were somehow reordered before the stores, then\n     * if a sample were taken it would be examining bogus information.\n     *\n     * A ProfileEntry represents both a C++ profile entry and a JS one. Both use\n     * the string as a description, but JS uses the sp as NULL to indicate that\n     * it is a JS entry. The script_ is then only ever examined for a JS entry,\n     * and the idx is used by both, but with different meanings.\n     */\n    const char * volatile string; // Descriptive string of this entry\n    void * volatile sp;           // Relevant stack pointer for the entry\n    JSScript * volatile script_;  // if js(), non-null script which is running\n    int32_t volatile idx;         // if js(), idx of pc, otherwise line number\n\n  public:\n    /*\n     * All of these methods are marked with the 'volatile' keyword because SPS's\n     * representation of the stack is stored such that all ProfileEntry\n     * instances are volatile. These methods would not be available unless they\n     * were marked as volatile as well\n     */\n\n    bool js() volatile {\n        JS_ASSERT_IF(sp == NULL, script_ != NULL);\n        return sp == NULL;\n    }\n\n    uint32_t line() volatile { JS_ASSERT(!js()); return idx; }\n    JSScript *script() volatile { JS_ASSERT(js()); return script_; }\n    void *stackAddress() volatile { return sp; }\n    const char *label() volatile { return string; }\n\n    void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }\n    void setLabel(const char *aString) volatile { string = aString; }\n    void setStackAddress(void *aSp) volatile { sp = aSp; }\n    void setScript(JSScript *aScript) volatile { script_ = aScript; }\n\n    /* we can't know the layout of JSScript, so look in vm/SPSProfiler.cpp */\n    JS_FRIEND_API(jsbytecode *) pc() volatile;\n    JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile;\n\n    static size_t offsetOfString() { return offsetof(ProfileEntry, string); }\n    static size_t offsetOfStackAddress() { return offsetof(ProfileEntry, sp); }\n    static size_t offsetOfPCIdx() { return offsetof(ProfileEntry, idx); }\n    static size_t offsetOfScript() { return offsetof(ProfileEntry, script_); }\n\n    /*\n     * The index used in the entry can either be a line number or the offset of\n     * a pc into a script's code. To signify a NULL pc, use a -1 index. This is\n     * checked against in pc() and setPC() to set/get the right pc.\n     */\n    static const int32_t NullPCIndex = -1;\n};\n\nJS_FRIEND_API(void)\nSetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,\n                         uint32_t max);\n\nJS_FRIEND_API(void)\nEnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);\n\nJS_FRIEND_API(jsbytecode*)\nProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);\n\n#ifdef JS_THREADSAFE\nJS_FRIEND_API(bool)\nContextHasOutstandingRequests(const JSContext *cx);\n#endif\n\nJS_FRIEND_API(bool)\nHasUnrootedGlobal(const JSContext *cx);\n\ntypedef void\n(* ActivityCallback)(void *arg, JSBool active);\n\n/*\n * Sets a callback that is run whenever the runtime goes idle - the\n * last active request ceases - and begins activity - when it was\n * idle and a request begins.\n */\nJS_FRIEND_API(void)\nSetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg);\n\nextern JS_FRIEND_API(const JSStructuredCloneCallbacks *)\nGetContextStructuredCloneCallbacks(JSContext *cx);\n\nextern JS_FRIEND_API(bool)\nCanCallContextDebugHandler(JSContext *cx);\n\nextern JS_FRIEND_API(JSTrapStatus)\nCallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);\n\nextern JS_FRIEND_API(bool)\nIsContextRunningJS(JSContext *cx);\n\ntypedef void\n(* AnalysisPurgeCallback)(JSRuntime *rt, JS::Handle<JSFlatString*> desc);\n\nextern JS_FRIEND_API(AnalysisPurgeCallback)\nSetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback);\n\ntypedef JSBool\n(* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID,\n                                 uint32_t depth);\nstruct JSDOMCallbacks {\n    DOMInstanceClassMatchesProto instanceClassMatchesProto;\n};\ntypedef struct JSDOMCallbacks DOMCallbacks;\n\nextern JS_FRIEND_API(void)\nSetDOMCallbacks(JSRuntime *rt, const DOMCallbacks *callbacks);\n\nextern JS_FRIEND_API(const DOMCallbacks *)\nGetDOMCallbacks(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nGetTestingFunctions(JSContext *cx);\n\n/*\n * Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not\n * available and the compiler does not know that FreeOp inherits from\n * JSFreeOp.\n */\ninline JSFreeOp *\nCastToJSFreeOp(FreeOp *fop)\n{\n    return reinterpret_cast<JSFreeOp *>(fop);\n}\n\n/* Implemented in jsexn.cpp. */\n\n/*\n * Get an error type name from a JSExnType constant.\n * Returns NULL for invalid arguments and JSEXN_INTERNALERR\n */\nextern JS_FRIEND_API(const jschar*)\nGetErrorTypeName(JSContext* cx, int16_t exnType);\n\n#ifdef DEBUG\nextern JS_FRIEND_API(unsigned)\nGetEnterCompartmentDepth(JSContext* cx);\n#endif\n\n/* Implemented in jswrapper.cpp. */\ntypedef enum NukeReferencesToWindow {\n    NukeWindowReferences,\n    DontNukeWindowReferences\n} NukeReferencesToWindow;\n\n/*\n * These filters are designed to be ephemeral stack classes, and thus don't\n * do any rooting or holding of their members.\n */\nstruct CompartmentFilter {\n    virtual bool match(JSCompartment *c) const = 0;\n};\n\nstruct AllCompartments : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const { return true; }\n};\n\nstruct ContentCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return !IsSystemCompartment(c);\n    }\n};\n\nstruct ChromeCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return IsSystemCompartment(c);\n    }\n};\n\nstruct SingleCompartment : public CompartmentFilter {\n    JSCompartment *ours;\n    SingleCompartment(JSCompartment *c) : ours(c) {}\n    virtual bool match(JSCompartment *c) const { return c == ours; }\n};\n\nstruct CompartmentsWithPrincipals : public CompartmentFilter {\n    JSPrincipals *principals;\n    CompartmentsWithPrincipals(JSPrincipals *p) : principals(p) {}\n    virtual bool match(JSCompartment *c) const {\n        return JS_GetCompartmentPrincipals(c) == principals;\n    }\n};\n\nextern JS_FRIEND_API(JSBool)\nNukeCrossCompartmentWrappers(JSContext* cx,\n                             const CompartmentFilter& sourceFilter,\n                             const CompartmentFilter& targetFilter,\n                             NukeReferencesToWindow nukeReferencesToWindow);\n\n/* Specify information about DOMProxy proxies in the DOM, for use by ICs. */\n\n/*\n * The DOMProxyShadowsCheck function will be called to check if the property for\n * id should be gotten from the prototype, or if there is an own property that\n * shadows it.\n * If DoesntShadow is returned then the slot at listBaseExpandoSlot should\n * either be undefined or point to an expando object that would contain the own\n * property.\n * If DoesntShadowUnique is returned then the slot at listBaseExpandoSlot should\n * contain a private pointer to a ExpandoAndGeneration, which contains a\n * JS::Value that should either be undefined or point to an expando object, and\n * a uint32 value. If that value changes then the IC for getting a property will\n * be invalidated.\n */\n\nstruct ExpandoAndGeneration {\n  ExpandoAndGeneration()\n    : expando(UndefinedValue()),\n      generation(0)\n  {}\n\n  void Unlink()\n  {\n      ++generation;\n      expando.setUndefined();\n  }\n\n  JS::Heap<JS::Value> expando;\n  uint32_t generation;\n};\n\ntypedef enum DOMProxyShadowsResult {\n  ShadowCheckFailed,\n  Shadows,\n  DoesntShadow,\n  DoesntShadowUnique\n} DOMProxyShadowsResult;\ntypedef DOMProxyShadowsResult\n(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);\nJS_FRIEND_API(void)\nSetDOMProxyInformation(void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,\n                       DOMProxyShadowsCheck domProxyShadowsCheck);\n\nvoid *GetDOMProxyHandlerFamily();\nuint32_t GetDOMProxyExpandoSlot();\nDOMProxyShadowsCheck GetDOMProxyShadowsCheck();\n\n} /* namespace js */\n\n/* Implemented in jsdate.cpp. */\n\n/*\n * Detect whether the internal date value is NaN.  (Because failure is\n * out-of-band for js_DateGet*)\n */\nextern JS_FRIEND_API(JSBool)\njs_DateIsValid(JSObject* obj);\n\nextern JS_FRIEND_API(double)\njs_DateGetMsecSinceEpoch(JSObject *obj);\n\n/* Implemented in jscntxt.cpp. */\n\n/*\n * Report an exception, which is currently realized as a printf-style format\n * string and its arguments.\n */\ntypedef enum JSErrNum {\n#define MSG_DEF(name, number, count, exception, format) \\\n    name = number,\n#include \"js.msg\"\n#undef MSG_DEF\n    JSErr_Limit\n} JSErrNum;\n\nextern JS_FRIEND_API(const JSErrorFormatString *)\njs_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);\n\n/* Implemented in jsclone.cpp. */\n\nextern JS_FRIEND_API(uint64_t)\njs_GetSCOffset(JSStructuredCloneWriter* writer);\n\n/* Typed Array functions, implemented in jstypedarray.cpp */\n\nnamespace js {\nnamespace ArrayBufferView {\n\nenum ViewType {\n    TYPE_INT8 = 0,\n    TYPE_UINT8,\n    TYPE_INT16,\n    TYPE_UINT16,\n    TYPE_INT32,\n    TYPE_UINT32,\n    TYPE_FLOAT32,\n    TYPE_FLOAT64,\n\n    /*\n     * Special type that is a uint8_t, but assignments are clamped to [0, 256).\n     * Treat the raw data type as a uint8_t.\n     */\n    TYPE_UINT8_CLAMPED,\n\n    /*\n     * Type returned for a DataView. Note that there is no single element type\n     * in this case.\n     */\n    TYPE_DATAVIEW,\n\n    TYPE_MAX\n};\n\n} /* namespace ArrayBufferView */\n\n/*\n * A helper for building up an ArrayBuffer object's data\n * before creating the ArrayBuffer itself.  Will do doubling\n * based reallocation, up to an optional maximum growth given.\n *\n * When all the data has been appended, call getArrayBuffer,\n * passing in the JSContext* for which the ArrayBuffer object\n * is to be created.  This also implicitly resets the builder,\n * or it can be reset explicitly at any point by calling reset().\n */\nclass ArrayBufferBuilder\n{\n    void *rawcontents_;\n    uint8_t *dataptr_;\n    uint32_t capacity_;\n    uint32_t length_;\n  public:\n    ArrayBufferBuilder()\n        : rawcontents_(NULL),\n          dataptr_(NULL),\n          capacity_(0),\n          length_(0)\n    {\n    }\n\n    ~ArrayBufferBuilder() {\n        reset();\n    }\n\n    void reset() {\n        if (rawcontents_)\n            JS_free(NULL, rawcontents_);\n        rawcontents_ = dataptr_ = NULL;\n        capacity_ = length_ = 0;\n    }\n\n    // will truncate if newcap is < length()\n    bool setCapacity(uint32_t newcap) {\n        if (!JS_ReallocateArrayBufferContents(NULL, newcap, &rawcontents_, &dataptr_))\n            return false;\n\n        capacity_ = newcap;\n        if (length_ > newcap)\n            length_ = newcap;\n\n        return true;\n    }\n\n    // Append datalen bytes from data to the current buffer.  If we\n    // need to grow the buffer, grow by doubling the size up to a\n    // maximum of maxgrowth (if given).  If datalen is greater than\n    // what the new capacity would end up as, then grow by datalen.\n    //\n    // The data parameter must not overlap with anything beyond the\n    // builder's current valid contents [0..length)\n    bool append(const uint8_t *newdata, uint32_t datalen, uint32_t maxgrowth = 0) {\n        if (length_ + datalen > capacity_) {\n            uint32_t newcap;\n            // double while under maxgrowth or if not specified\n            if (!maxgrowth || capacity_ < maxgrowth)\n                newcap = capacity_ * 2;\n            else\n                newcap = capacity_ + maxgrowth;\n\n            // but make sure there's always enough to satisfy our request\n            if (newcap < length_ + datalen)\n                newcap = length_ + datalen;\n\n            // did we overflow?\n            if (newcap < capacity_)\n                return false;\n\n            if (!setCapacity(newcap))\n                return false;\n        }\n\n        // assert that the region isn't overlapping so we can memcpy;\n        JS_ASSERT(!areOverlappingRegions(newdata, datalen, dataptr_ + length_, datalen));\n\n        memcpy(dataptr_ + length_, newdata, datalen);\n        length_ += datalen;\n\n        return true;\n    }\n\n    uint8_t *data() {\n        return dataptr_;\n    }\n\n    uint32_t length() {\n        return length_;\n    }\n\n    uint32_t capacity() {\n        return capacity_;\n    }\n\n    JSObject* getArrayBuffer(JSContext *cx) {\n        // we need to check for length_ == 0, because nothing may have been\n        // added\n        if (capacity_ > length_ || length_ == 0) {\n            if (!setCapacity(length_))\n                return NULL;\n        }\n\n        JSObject* obj = JS_NewArrayBufferWithContents(cx, rawcontents_);\n        if (!obj)\n            return NULL;\n\n        rawcontents_ = dataptr_ = NULL;\n        length_ = capacity_ = 0;\n\n        return obj;\n    }\n\nprotected:\n\n    static bool areOverlappingRegions(const uint8_t *start1, uint32_t length1,\n                                      const uint8_t *start2, uint32_t length2)\n    {\n        const uint8_t *end1 = start1 + length1;\n        const uint8_t *end2 = start2 + length2;\n\n        const uint8_t *max_start = start1 > start2 ? start1 : start2;\n        const uint8_t *min_end   = end1 < end2 ? end1 : end2;\n\n        return max_start < min_end;\n    }\n};\n\n} /* namespace js */\n\ntypedef js::ArrayBufferView::ViewType JSArrayBufferViewType;\n\n/*\n * Create a new typed array with nelements elements.\n *\n * These functions (except the WithBuffer variants) fill in the array with zeros.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64Array(JSContext *cx, uint32_t nelements);\n\n/*\n * Create a new typed array and copy in values from the given object. The\n * object is used as if it were an array; that is, the new array (if\n * successfully created) will have length given by array.length, and its\n * elements will be those specified by array[0], array[1], and so on, after\n * conversion to the typed array element type.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array);\n\n/*\n * Create a new typed array using the given ArrayBuffer for storage.  The\n * length value is optional; if -1 is passed, enough elements to use up the\n * remainder of the byte array is used as the default value.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                          uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                                  uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\n\n/*\n * Create a new ArrayBuffer with the given byte length.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);\n\n/*\n * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return\n * false if a security wrapper is encountered that denies the unwrapping. If\n * this test or one of the JS_Is*Array tests succeeds, then it is safe to call\n * the various accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsTypedArrayObject(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test or one of the more specific tests succeeds, then it\n * is safe to call the various ArrayBufferView accessor JSAPI calls defined\n * below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * Test for specific typed array types (ArrayBufferView subtypes)\n */\n\nextern JS_FRIEND_API(JSBool)\nJS_IsInt8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8ClampedArray(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat64Array(JSObject *obj);\n\n/*\n * Unwrap Typed arrays all at once. Return NULL without throwing if the object\n * cannot be viewed as the correct typed array, or the typed array object on\n * success, filling both outparameters.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt8Array(JSObject *obj, uint32_t *length, int8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8Array(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8ClampedArray(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt16Array(JSObject *obj, uint32_t *length, int16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint16Array(JSObject *obj, uint32_t *length, uint16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt32Array(JSObject *obj, uint32_t *length, int32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint32Array(JSObject *obj, uint32_t *length, uint32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat32Array(JSObject *obj, uint32_t *length, float **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat64Array(JSObject *obj, uint32_t *length, double **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBufferView(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBuffer(JSObject *obj, uint32_t *length, uint8_t **data);\n\n/*\n * Get the type of elements in a typed array, or TYPE_DATAVIEW if a DataView.\n *\n * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is an ArrayBufferView or a\n * wrapper of an ArrayBufferView, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(JSArrayBufferViewType)\nJS_GetArrayBufferViewType(JSObject *obj);\n\n/*\n * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test succeeds, then it is safe to call the various\n * accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferObject(JSObject *obj);\n\n/*\n * Return the available byte length of an array buffer.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferByteLength(JSObject *obj);\n\n/*\n * Return a pointer to an array buffer's data. The buffer is still owned by the\n * array buffer object, and should not be modified on another thread. The\n * returned pointer is stable across GCs.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint8_t *)\nJS_GetArrayBufferData(JSObject *obj);\n\n/*\n * Return the number of elements in a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayLength(JSObject *obj);\n\n/*\n * Return the byte offset from the start of an array buffer to the start of a\n * typed array view.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteLength(JSObject *obj);\n\n/*\n * Check whether obj supports JS_ArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * More generic name for JS_GetTypedArrayByteLength to cover DataViews as well\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the start of the data referenced by a typed array. The\n * data is still owned by the typed array, and should not be modified on\n * another thread.\n *\n * |obj| must have passed a JS_Is*Array test, or somehow be known that it would\n * pass such a test: it is a typed array or a wrapper of a typed array, and the\n * unwrapping will succeed.\n */\n\nextern JS_FRIEND_API(int8_t *)\nJS_GetInt8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ClampedArrayData(JSObject *obj);\nextern JS_FRIEND_API(int16_t *)\nJS_GetInt16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint16_t *)\nJS_GetUint16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(int32_t *)\nJS_GetInt32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint32_t *)\nJS_GetUint32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(float *)\nJS_GetFloat32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(double *)\nJS_GetFloat64ArrayData(JSObject *obj);\n\n/*\n * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific\n * versions when possible.\n */\nextern JS_FRIEND_API(void *)\nJS_GetArrayBufferViewData(JSObject *obj);\n\n/*\n * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been\n * neutered, this will still return the neutered buffer. |obj| must be an\n * object that would return true for JS_IsArrayBufferViewObject().\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetArrayBufferViewBuffer(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetDataView* APIs.\n */\nJS_FRIEND_API(JSBool)\nJS_IsDataViewObject(JSObject *obj);\n\n/*\n * Return the byte offset of a data view into its array buffer. |obj| must be a\n * DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a data view.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the beginning of the data referenced by a DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(void *)\nJS_GetDataViewData(JSObject *obj);\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitGetterOp.\n */\nclass JSJitGetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitGetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args.rval())\n    {}\n\n    explicit JSJitGetterCallArgs(JS::Rooted<JS::Value>* rooted)\n      : JS::MutableHandleValue(rooted)\n    {}\n\n    JS::MutableHandleValue rval() {\n        return *this;\n    }\n};\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitSetterOp.\n */\nclass JSJitSetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitSetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args[0])\n    {}\n\n    JS::MutableHandleValue operator[](unsigned i) {\n        MOZ_ASSERT(i == 0);\n        return *this;\n    }\n\n    unsigned length() const { return 1; }\n\n    // Add get() or maybe hasDefined() as needed\n};\n\nstruct JSJitMethodCallArgsTraits;\n\n/*\n * A class, expected to be passed by reference, which represents the CallArgs\n * for a JSJitMethodOp.\n */\nclass JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUsedRval>\n{\n  private:\n    typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;\n    friend struct JSJitMethodCallArgsTraits;\n\n  public:\n    explicit JSJitMethodCallArgs(const JS::CallArgs& args) {\n        argv_ = args.array();\n        argc_ = args.length();\n    }\n\n    JS::MutableHandleValue rval() const {\n        return Base::rval();\n    }\n\n    unsigned length() const { return Base::length(); }\n\n    JS::MutableHandleValue operator[](unsigned i) const {\n        return Base::operator[](i);\n    }\n\n    bool hasDefined(unsigned i) const {\n        return Base::hasDefined(i);\n    }\n\n    // Add get() as needed\n};\n\nstruct JSJitMethodCallArgsTraits\n{\n    static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);\n    static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);\n};\n\n/*\n * This struct contains metadata passed from the DOM to the JS Engine for JIT\n * optimizations on DOM property accessors. Eventually, this should be made\n * available to general JSAPI users, but we are not currently ready to do so.\n */\ntypedef bool\n(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitGetterCallArgs args);\ntypedef bool\n(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitSetterCallArgs args);\ntypedef bool\n(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, const JSJitMethodCallArgs& args);\n\nstruct JSJitInfo {\n    enum OpType {\n        Getter,\n        Setter,\n        Method,\n        OpType_None\n    };\n\n    union {\n        JSJitGetterOp getter;\n        JSJitSetterOp setter;\n        JSJitMethodOp method;\n    };\n    uint32_t protoID;\n    uint32_t depth;\n    OpType type;\n    bool isInfallible;      /* Is op fallible? False in setters. */\n    bool isConstant;        /* Getting a construction-time constant? */\n    bool isPure;            /* As long as no non-pure DOM things happen, will\n                               keep returning the same value for the given\n                               \"this\" object\" */\n    JSValueType returnType; /* The return type tag.  Might be JSVAL_TYPE_UNKNOWN */\n\n    /* An alternative native that's safe to call in parallel mode. */\n    JSParallelNative parallelNative;\n};\n\n#define JS_JITINFO_NATIVE_PARALLEL(op)                                         \\\n    {{NULL},0,0,JSJitInfo::OpType_None,false,false,false,JSVAL_TYPE_MISSING,op}\n\nstatic JS_ALWAYS_INLINE const JSJitInfo *\nFUNCTION_VALUE_TO_JITINFO(const JS::Value& v)\n{\n    JS_ASSERT(js::GetObjectClass(&v.toObject()) == js::FunctionClassPtr);\n    return reinterpret_cast<js::shadow::Function *>(&v.toObject())->jitinfo;\n}\n\n/* Statically asserted in jsfun.h. */\nstatic const unsigned JS_FUNCTION_INTERPRETED_BIT = 0x1;\n\nstatic JS_ALWAYS_INLINE void\nSET_JITINFO(JSFunction * func, const JSJitInfo *info)\n{\n    js::shadow::Function *fun = reinterpret_cast<js::shadow::Function *>(func);\n    JS_ASSERT(!(fun->flags & JS_FUNCTION_INTERPRETED_BIT));\n    fun->jitinfo = info;\n}\n\n/*\n * Engine-internal extensions of jsid.  This code is here only until we\n * eliminate Gecko's dependencies on it!\n */\n\nstatic JS_ALWAYS_INLINE jsid\nJSID_FROM_BITS(size_t bits)\n{\n    jsid id;\n    JSID_BITS(id) = bits;\n    return id;\n}\n\n/*\n * Must not be used on atoms that are representable as integer jsids.\n * Prefer NameToId or AtomToId over this function:\n *\n * A PropertyName is an atom that does not contain an integer in the range\n * [0, UINT32_MAX]. However, jsid can only hold an integer in the range\n * [0, JSID_INT_MAX] (where JSID_INT_MAX == 2^31-1).  Thus, for the range of\n * integers (JSID_INT_MAX, UINT32_MAX], to represent as a jsid 'id', it must be\n * the case JSID_IS_ATOM(id) and !JSID_TO_ATOM(id)->isPropertyName().  In most\n * cases when creating a jsid, code does not have to care about this corner\n * case because:\n *\n * - When given an arbitrary JSAtom*, AtomToId must be used, which checks for\n *   integer atoms representable as integer jsids, and does this conversion.\n *\n * - When given a PropertyName*, NameToId can be used which which does not need\n *   to do any dynamic checks.\n *\n * Thus, it is only the rare third case which needs this function, which\n * handles any JSAtom* that is known not to be representable with an int jsid.\n */\nstatic JS_ALWAYS_INLINE jsid\nNON_INTEGER_ATOM_TO_JSID(JSAtom *atom)\n{\n    JS_ASSERT(((size_t)atom & 0x7) == 0);\n    jsid id = JSID_FROM_BITS((size_t)atom);\n    JS_ASSERT(id == INTERNED_STRING_TO_JSID(NULL, (JSString*)atom));\n    return id;\n}\n\n/* All strings stored in jsids are atomized, but are not necessarily property names. */\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id)\n{\n    return JSID_IS_STRING(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id, JSAtom *atom)\n{\n    return id == JSID_FROM_BITS((size_t)atom);\n}\n\nstatic JS_ALWAYS_INLINE JSAtom *\nJSID_TO_ATOM(jsid id)\n{\n    return (JSAtom *)JSID_TO_STRING(id);\n}\n\nJS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD);\n\nnamespace js {\n\nstatic JS_ALWAYS_INLINE Value\nIdToValue(jsid id)\n{\n    if (JSID_IS_STRING(id))\n        return StringValue(JSID_TO_STRING(id));\n    if (JS_LIKELY(JSID_IS_INT(id)))\n        return Int32Value(JSID_TO_INT(id));\n    if (JS_LIKELY(JSID_IS_OBJECT(id)))\n        return ObjectValue(*JSID_TO_OBJECT(id));\n    JS_ASSERT(JSID_IS_VOID(id));\n    return UndefinedValue();\n}\n\nstatic JS_ALWAYS_INLINE jsval\nIdToJsval(jsid id)\n{\n    return IdToValue(id);\n}\n\nextern JS_FRIEND_API(bool)\nIsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method);\n\nextern JS_FRIEND_API(bool)\nIsTypedArrayThisCheck(JS::IsAcceptableThis test);\n\nenum CTypesActivityType {\n    CTYPES_CALL_BEGIN,\n    CTYPES_CALL_END,\n    CTYPES_CALLBACK_BEGIN,\n    CTYPES_CALLBACK_END\n};\n\ntypedef void\n(* CTypesActivityCallback)(JSContext *cx, CTypesActivityType type);\n\n/*\n * Sets a callback that is run whenever js-ctypes is about to be used when\n * calling into C.\n */\nJS_FRIEND_API(void)\nSetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);\n\nclass JS_FRIEND_API(AutoCTypesActivityCallback) {\n  private:\n    JSContext *cx;\n    CTypesActivityCallback callback;\n    CTypesActivityType endType;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n  public:\n    AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,\n                               CTypesActivityType endType\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM);\n    ~AutoCTypesActivityCallback() {\n        DoEndCallback();\n    }\n    void DoEndCallback() {\n        if (callback) {\n            callback(cx, endType);\n            callback = NULL;\n        }\n    }\n};\n\n#ifdef DEBUG\nextern JS_FRIEND_API(void)\nassertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);\n#else\ninline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {};\n#endif\n\ntypedef bool\n(* ObjectMetadataCallback)(JSContext *cx, JSObject **pmetadata);\n\n/*\n * Specify a callback to invoke when creating each JS object in the current\n * compartment, which may return a metadata object to associate with the\n * object. Objects with different metadata have different shape hierarchies,\n * so for efficiency, objects should generally try to share metadata objects.\n */\nJS_FRIEND_API(void)\nSetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback);\n\n/* Manipulate the metadata associated with an object. */\n\nJS_FRIEND_API(bool)\nSetObjectMetadata(JSContext *cx, JS::HandleObject obj, JS::HandleObject metadata);\n\nJS_FRIEND_API(JSObject *)\nGetObjectMetadata(JSObject *obj);\n\n/* ES5 8.12.8. */\nextern JS_FRIEND_API(JSBool)\nDefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp);\n\n/*\n * Helper function. To approximate a call to the [[DefineOwnProperty]] internal\n * method described in ES5, first call this, then call JS_DefinePropertyById.\n *\n * JS_DefinePropertyById by itself does not enforce the invariants on\n * non-configurable properties when obj->isNative(). This function performs the\n * relevant checks (specified in ES5 8.12.9 [[DefineOwnProperty]] steps 1-11),\n * but only if obj is native.\n *\n * The reason for the messiness here is that ES5 uses [[DefineOwnProperty]] as\n * a sort of extension point, but there is no hook in js::Class,\n * js::ProxyHandler, or the JSAPI with precisely the right semantics for it.\n */\nextern JS_FRIEND_API(bool)\nCheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSBool)\njs_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,\n                     const js::PropertyDescriptor& descriptor, JSBool *bp);\n\nextern JS_FRIEND_API(JSBool)\njs_ReportIsNotFunction(JSContext *cx, const JS::Value& v);\n\n#ifdef JSGC_GENERATIONAL\nextern JS_FRIEND_API(void)\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data);\n\nextern JS_FRIEND_API(void)\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data);\n#else\ninline void\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data) {}\n\ninline void\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data) {}\n#endif /* JSGC_GENERATIONAL */\n\n#endif /* jsfriendapi_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jslock.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jslock_h\n#define jslock_h\n\n#ifdef JS_THREADSAFE\n\n# include \"jsapi.h\"\n# include \"pratom.h\"\n# include \"prcvar.h\"\n# include \"prinit.h\"\n# include \"prlock.h\"\n# include \"prthread.h\"\n\n# define JS_ATOMIC_INCREMENT(p)      PR_ATOMIC_INCREMENT((int32_t *)(p))\n# define JS_ATOMIC_DECREMENT(p)      PR_ATOMIC_DECREMENT((int32_t *)(p))\n# define JS_ATOMIC_ADD(p,v)          PR_ATOMIC_ADD((int32_t *)(p), (int32_t)(v))\n# define JS_ATOMIC_SET(p,v)          PR_ATOMIC_SET((int32_t *)(p), (int32_t)(v))\n\nnamespace js {\n    // Defined in jsgc.cpp.\n    unsigned GetCPUCount();\n}\n\n#else  /* JS_THREADSAFE */\n\ntypedef struct PRThread PRThread;\ntypedef struct PRCondVar PRCondVar;\ntypedef struct PRLock PRLock;\n\n# define JS_ATOMIC_INCREMENT(p)      (++*(p))\n# define JS_ATOMIC_DECREMENT(p)      (--*(p))\n# define JS_ATOMIC_ADD(p,v)          (*(p) += (v))\n# define JS_ATOMIC_SET(p,v)          (*(p) = (v))\n\n#endif /* JS_THREADSAFE */\n\n#endif /* jslock_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsperf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef perf_jsperf_h\n#define perf_jsperf_h\n\n#include \"jsapi.h\"\n\nnamespace JS {\n\n/*\n * JS::PerfMeasurement is a generic way to access detailed performance\n * measurement APIs provided by your operating system.  The details of\n * exactly how this works and what can be measured are highly\n * system-specific, but this interface is (one hopes) implementable\n * on top of all of them.\n *\n * To use this API, create a PerfMeasurement object, passing its\n * constructor a bitmask indicating which events you are interested\n * in.  Thereafter, Start() zeroes all counters and starts timing;\n * Stop() stops timing again; and the counters for the events you\n * requested are available as data values after calling Stop().  The\n * object may be reused for many measurements.\n */\nclass JS_FRIEND_API(PerfMeasurement)\n{\n  protected:\n    // Implementation-specific data, if any.\n    void* impl;\n\n  public:\n    /*\n     * Events that may be measured.  Taken directly from the list of\n     * \"generalized hardware performance event types\" in the Linux\n     * perf_event API, plus some of the \"software events\".\n     */\n    enum EventMask {\n        CPU_CYCLES          = 0x00000001,\n        INSTRUCTIONS        = 0x00000002,\n        CACHE_REFERENCES    = 0x00000004,\n        CACHE_MISSES        = 0x00000008,\n        BRANCH_INSTRUCTIONS = 0x00000010,\n        BRANCH_MISSES       = 0x00000020,\n        BUS_CYCLES          = 0x00000040,\n        PAGE_FAULTS         = 0x00000080,\n        MAJOR_PAGE_FAULTS   = 0x00000100,\n        CONTEXT_SWITCHES    = 0x00000200,\n        CPU_MIGRATIONS      = 0x00000400,\n\n        ALL                 = 0x000007ff,\n        NUM_MEASURABLE_EVENTS  = 11\n    };\n\n    /*\n     * Bitmask of events that will be measured when this object is\n     * active (between Start() and Stop()).  This may differ from the\n     * bitmask passed to the constructor if the platform does not\n     * support measuring all of the requested events.\n     */\n    const EventMask eventsMeasured;\n\n    /*\n     * Counters for each measurable event.\n     * Immediately after one of these objects is created, all of the\n     * counters for enabled events will be zero, and all of the\n     * counters for disabled events will be uint64_t(-1).\n     */\n    uint64_t cpu_cycles;\n    uint64_t instructions;\n    uint64_t cache_references;\n    uint64_t cache_misses;\n    uint64_t branch_instructions;\n    uint64_t branch_misses;\n    uint64_t bus_cycles;\n    uint64_t page_faults;\n    uint64_t major_page_faults;\n    uint64_t context_switches;\n    uint64_t cpu_migrations;\n\n    /*\n     * Prepare to measure the indicated set of events.  If not all of\n     * the requested events can be measured on the current platform,\n     * then the eventsMeasured bitmask will only include the subset of\n     * |toMeasure| corresponding to the events that can be measured.\n     */\n    PerfMeasurement(EventMask toMeasure);\n\n    /* Done with this set of measurements, tear down OS-level state. */\n    ~PerfMeasurement();\n\n    /* Start a measurement cycle. */\n    void start();\n\n    /*\n     * End a measurement cycle, and for each enabled counter, add the\n     * number of measured events of that type to the appropriate\n     * visible variable.\n     */\n    void stop();\n\n    /* Reset all enabled counters to zero. */\n    void reset();\n\n    /*\n     * True if this platform supports measuring _something_, i.e. it's\n     * not using the stub implementation.\n     */\n    static bool canMeasureSomething();\n};\n\n/* Inject a Javascript wrapper around the above C++ class into the\n * Javascript object passed as an argument (this will normally be a\n * global object).  The JS-visible API is identical to the C++ API.\n */\nextern JS_FRIEND_API(JSObject*)\n    RegisterPerfMeasurement(JSContext *cx, JSObject *global);\n\n/*\n * Given a jsval which contains an instance of the aforementioned\n * wrapper class, extract the C++ object.  Returns NULL if the\n * jsval is not an instance of the wrapper.\n */\nextern JS_FRIEND_API(PerfMeasurement*)\n    ExtractPerfMeasurement(jsval wrapper);\n\n} // namespace JS\n\n#endif /* perf_jsperf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsprf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprf_h\n#define jsprf_h\n\n/*\n** API for PR printf like routines. Supports the following formats\n**      %d - decimal\n**      %u - unsigned decimal\n**      %x - unsigned hex\n**      %X - unsigned uppercase hex\n**      %o - unsigned octal\n**      %hd, %hu, %hx, %hX, %ho - 16-bit versions of above\n**      %ld, %lu, %lx, %lX, %lo - 32-bit versions of above\n**      %lld, %llu, %llx, %llX, %llo - 64 bit versions of above\n**      %s - ascii string\n**      %hs - ucs2 string\n**      %c - character\n**      %p - pointer (deals with machine dependent pointer size)\n**      %f - float\n**      %g - float\n*/\n\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"jstypes.h\"\n\n/*\n** sprintf into a fixed size buffer. Guarantees that a NUL is at the end\n** of the buffer. Returns the length of the written output, NOT including\n** the NUL, or (uint32_t)-1 if an error occurs.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);\n\n/*\n** sprintf into a malloc'd buffer. Return a pointer to the malloc'd\n** buffer on success, NULL on failure. Call \"JS_smprintf_free\" to release\n** the memory returned.\n*/\nextern JS_PUBLIC_API(char*) JS_smprintf(const char *fmt, ...);\n\n/*\n** Free the memory allocated, for the caller, by JS_smprintf\n*/\nextern JS_PUBLIC_API(void) JS_smprintf_free(char *mem);\n\n/*\n** \"append\" sprintf into a malloc'd buffer. \"last\" is the last value of\n** the malloc'd buffer. sprintf will append data to the end of last,\n** growing it as necessary using realloc. If last is NULL, JS_sprintf_append\n** will allocate the initial string. The return value is the new value of\n** last for subsequent calls, or NULL if there is a malloc failure.\n*/\nextern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...);\n\n/*\n** sprintf into a function. The function \"f\" is called with a string to\n** place into the output. \"arg\" is an opaque pointer used by the stuff\n** function to hold any state needed to do the storage of the output\n** data. The return value is a count of the number of characters fed to\n** the stuff function, or (uint32_t)-1 if an error occurs.\n*/\ntypedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);\n\nextern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);\n\n/*\n** va_list forms of the above.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsmprintf(const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsprintf_append(char *last, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(uint32_t) JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap);\n\n#endif /* jsprf_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsprototypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A higher-order macro for enumerating all JSProtoKey values. */\n\n#ifndef jsprototypes_h\n#define jsprototypes_h\n\n#include \"jsversion.h\"\n\n/*\n * Enumerator codes in the second column must not change -- they are part of\n * the JS XDR API.  Also note the symbols in the third column are extern \"C\";\n * clients should use extern \"C\" {} as appropriate when using this macro.\n */\n\n#define JS_FOR_EACH_PROTOTYPE(macro) \\\n    macro(Null,                   0,     js_InitNullClass) \\\n    macro(Object,                 1,     js_InitObjectClass) \\\n    macro(Function,               2,     js_InitFunctionClass) \\\n    macro(Array,                  3,     js_InitArrayClass) \\\n    macro(Boolean,                4,     js_InitBooleanClass) \\\n    macro(JSON,                   5,     js_InitJSONClass) \\\n    macro(Date,                   6,     js_InitDateClass) \\\n    macro(Math,                   7,     js_InitMathClass) \\\n    macro(Number,                 8,     js_InitNumberClass) \\\n    macro(String,                 9,     js_InitStringClass) \\\n    macro(RegExp,                10,     js_InitRegExpClass) \\\n    macro(Error,                 11,     js_InitExceptionClasses) \\\n    macro(InternalError,         12,     js_InitExceptionClasses) \\\n    macro(EvalError,             13,     js_InitExceptionClasses) \\\n    macro(RangeError,            14,     js_InitExceptionClasses) \\\n    macro(ReferenceError,        15,     js_InitExceptionClasses) \\\n    macro(SyntaxError,           16,     js_InitExceptionClasses) \\\n    macro(TypeError,             17,     js_InitExceptionClasses) \\\n    macro(URIError,              18,     js_InitExceptionClasses) \\\n    macro(Iterator,              19,     js_InitIteratorClasses) \\\n    macro(StopIteration,         20,     js_InitIteratorClasses) \\\n    macro(ArrayBuffer,           21,     js_InitTypedArrayClasses) \\\n    macro(Int8Array,             22,     js_InitTypedArrayClasses) \\\n    macro(Uint8Array,            23,     js_InitTypedArrayClasses) \\\n    macro(Int16Array,            24,     js_InitTypedArrayClasses) \\\n    macro(Uint16Array,           25,     js_InitTypedArrayClasses) \\\n    macro(Int32Array,            26,     js_InitTypedArrayClasses) \\\n    macro(Uint32Array,           27,     js_InitTypedArrayClasses) \\\n    macro(Float32Array,          28,     js_InitTypedArrayClasses) \\\n    macro(Float64Array,          29,     js_InitTypedArrayClasses) \\\n    macro(Uint8ClampedArray,     30,     js_InitTypedArrayClasses) \\\n    macro(Proxy,                 31,     js_InitProxyClass) \\\n    macro(WeakMap,               32,     js_InitWeakMapClass) \\\n    macro(Map,                   33,     js_InitMapClass) \\\n    macro(Set,                   34,     js_InitSetClass) \\\n    macro(DataView,              35,     js_InitTypedArrayClasses) \\\n    macro(ParallelArray,         36,     js_InitParallelArrayClass) \\\n    macro(Intl,                  37,     js_InitIntlClass) \\\n    macro(Type,                  38,     js_InitBinaryDataClasses) \\\n    macro(Data,                  39,     js_InitBinaryDataClasses) \\\n    macro(uint8,                 40,     js_InitBinaryDataClasses) \\\n    macro(uint16,                41,     js_InitBinaryDataClasses) \\\n    macro(uint32,                42,     js_InitBinaryDataClasses) \\\n    macro(uint64,                43,     js_InitBinaryDataClasses) \\\n    macro(int8,                  44,     js_InitBinaryDataClasses) \\\n    macro(int16,                 45,     js_InitBinaryDataClasses) \\\n    macro(int32,                 46,     js_InitBinaryDataClasses) \\\n    macro(int64,                 47,     js_InitBinaryDataClasses) \\\n    macro(float32,               48,     js_InitBinaryDataClasses) \\\n    macro(float64,               49,     js_InitBinaryDataClasses) \\\n    macro(ArrayType,             50,     js_InitBinaryDataClasses) \\\n    macro(StructType,            51,     js_InitBinaryDataClasses) \\\n    macro(ArrayTypeObject,       52,     js_InitBinaryDataClasses) \\\n\n#endif /* jsprototypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsproxy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsproxy_h\n#define jsproxy_h\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nnamespace js {\n\nclass JS_FRIEND_API(Wrapper);\n\n/*\n * A proxy is a JSObject that implements generic behavior by providing custom\n * implementations for each object trap. The implementation for each trap is\n * provided by a C++ object stored on the proxy, known as its handler.\n *\n * A major use case for proxies is to forward each trap to another object,\n * known as its target. The target can be an arbitrary C++ object. Not every\n * proxy has the notion of a target, however.\n *\n * Proxy traps are grouped into fundamental and derived traps. Every proxy has\n * to at least provide implementations for the fundamental traps, but the\n * derived traps can be implemented in terms of the fundamental ones\n * BaseProxyHandler provides implementations of the derived traps in terms of\n * the (pure virtual) fundamental traps.\n *\n * To minimize code duplication, a set of abstract proxy handler classes is\n * provided, from which other handlers may inherit. These abstract classes\n * are organized in the following hierarchy:\n *\n * BaseProxyHandler\n * |\n * DirectProxyHandler\n * |\n * Wrapper\n */\n\n/*\n * BaseProxyHandler is the most generic kind of proxy handler. It does not make\n * any assumptions about the target. Consequently, it does not provide any\n * default implementation for the fundamental traps. It does, however, implement\n * the derived traps in terms of the fundamental ones. This allows consumers of\n * this class to define any custom behavior they want.\n */\nclass JS_FRIEND_API(BaseProxyHandler)\n{\n    void *mFamily;\n    bool mHasPrototype;\n    bool mHasPolicy;\n  protected:\n    // Subclasses may set this in their constructor.\n    void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }\n    void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; }\n\n  public:\n    explicit BaseProxyHandler(void *family);\n    virtual ~BaseProxyHandler();\n\n    bool hasPrototype() {\n        return mHasPrototype;\n    }\n\n    bool hasPolicy() {\n        return mHasPolicy;\n    }\n\n    inline void *family() {\n        return mFamily;\n    }\n\n    virtual bool isOuterWindow() {\n        return false;\n    }\n\n    virtual bool finalizeInBackground(Value priv) {\n        /*\n         * Called on creation of a proxy to determine whether its finalize\n         * method can be finalized on the background thread.\n         */\n        return true;\n    }\n\n    /* Policy enforcement traps.\n     *\n     * enter() allows the policy to specify whether the caller may perform |act|\n     * on the proxy's |id| property. In the case when |act| is CALL, |id| is\n     * generally JSID_VOID.\n     *\n     * The |act| parameter to enter() specifies the action being performed.\n     * If |bp| is false, the trap suggests that the caller throw (though it\n     * may still decide to squelch the error).\n     */\n    enum Action {\n        GET,\n        SET,\n        CALL\n    };\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,\n                       bool *bp);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) = 0;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) = 0;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) = 0;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) = 0;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp);\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp);\n    virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) = 0;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    virtual const char *className(JSContext *cx, HandleObject proxy);\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    virtual void finalize(JSFreeOp *fop, JSObject *proxy);\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp, bool *present);\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    /* See comment for weakmapKeyDelegateOp in jsclass.h. */\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/*\n * DirectProxyHandler includes a notion of a target object. All traps are\n * reimplemented such that they forward their behavior to the target. This\n * allows consumers of this class to forward to another object as transparently\n * and efficiently as possible.\n */\nclass JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler\n{\n  public:\n    explicit DirectProxyHandler(void *family);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,\n                         bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy,\n                           AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id,\n                     bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id,\n                        bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject proxy,\n                      AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy,\n                                 RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */\nclass Proxy\n{\n  public:\n    /* ES5 Harmony fundamental proxy traps. */\n    static bool preventExtensions(JSContext *cx, HandleObject proxy);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                      PropertyDescriptor *desc, unsigned flags);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                      MutableHandleValue vp);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                         PropertyDescriptor *desc, unsigned flags);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                         MutableHandleValue vp);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v);\n    static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n\n    /* ES5 Harmony derived proxy traps. */\n    static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    MutableHandleValue vp);\n    static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                                    uint32_t index, MutableHandleValue vp, bool *present);\n    static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    bool strict, MutableHandleValue vp);\n    static bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    static bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible);\n    static bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    static bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    static const char *className(JSContext *cx, HandleObject proxy);\n    static JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    static bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    static bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    static bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static JSObject * const LazyProto;\n};\n\ninline bool IsObjectProxyClass(const Class *clasp)\n{\n    return clasp == js::ObjectProxyClassPtr || clasp == js::OuterWindowProxyClassPtr;\n}\n\ninline bool IsFunctionProxyClass(const Class *clasp)\n{\n    return clasp == js::FunctionProxyClassPtr;\n}\n\ninline bool IsProxyClass(const Class *clasp)\n{\n    return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp);\n}\n\ninline bool IsObjectProxy(JSObject *obj)\n{\n    return IsObjectProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsFunctionProxy(JSObject *obj)\n{\n    return IsFunctionProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsProxy(JSObject *obj)\n{\n    return IsProxyClass(GetObjectClass(obj));\n}\n\n/*\n * These are part of the API.\n *\n * NOTE: PROXY_PRIVATE_SLOT is 0 because that way slot 0 is usable by API\n * clients for both proxy and non-proxy objects.  So an API client that only\n * needs to store one slot's worth of data doesn't need to branch on what sort\n * of object it has.\n */\nconst uint32_t PROXY_PRIVATE_SLOT = 0;\nconst uint32_t PROXY_HANDLER_SLOT = 1;\nconst uint32_t PROXY_EXTRA_SLOT   = 2;\n\ninline BaseProxyHandler *\nGetProxyHandler(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return (BaseProxyHandler *) GetReservedSlot(obj, PROXY_HANDLER_SLOT).toPrivate();\n}\n\ninline const Value &\nGetProxyPrivate(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_PRIVATE_SLOT);\n}\n\ninline JSObject *\nGetProxyTargetObject(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetProxyPrivate(obj).toObjectOrNull();\n}\n\ninline const Value &\nGetProxyExtra(JSObject *obj, size_t n)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_EXTRA_SLOT + n);\n}\n\ninline void\nSetProxyHandler(JSObject *obj, BaseProxyHandler *handler)\n{\n    JS_ASSERT(IsProxy(obj));\n    SetReservedSlot(obj, PROXY_HANDLER_SLOT, PrivateValue(handler));\n}\n\ninline void\nSetProxyExtra(JSObject *obj, size_t n, const Value &extra)\n{\n    JS_ASSERT(IsProxy(obj));\n    JS_ASSERT(n <= 1);\n    SetReservedSlot(obj, PROXY_EXTRA_SLOT + n, extra);\n}\n\nenum ProxyCallable {\n    ProxyNotCallable = false,\n    ProxyIsCallable = true\n};\n\nJS_FRIEND_API(JSObject *)\nNewProxyObject(JSContext *cx, BaseProxyHandler *handler, HandleValue priv,\n               JSObject *proto, JSObject *parent, ProxyCallable callable = ProxyNotCallable);\n\nJSObject *\nRenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv);\n\nclass JS_FRIEND_API(AutoEnterPolicy)\n{\n  public:\n    typedef BaseProxyHandler::Action Action;\n    AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler,\n                    HandleObject wrapper, HandleId id, Action act, bool mayThrow)\n#ifdef DEBUG\n        : context(NULL)\n#endif\n    {\n        allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv)\n                                     : true;\n        recordEnter(cx, wrapper, id);\n        // We want to throw an exception if all of the following are true:\n        // * The policy disallowed access.\n        // * The policy set rv to false, indicating that we should throw.\n        // * The caller did not instruct us to ignore exceptions.\n        // * The policy did not throw itself.\n        if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx))\n            reportError(cx, id);\n    }\n\n    virtual ~AutoEnterPolicy() { recordLeave(); }\n    inline bool allowed() { return allow; }\n    inline bool returnValue() { JS_ASSERT(!allowed()); return rv; }\n\n  protected:\n    // no-op constructor for subclass\n    AutoEnterPolicy()\n#ifdef DEBUG\n        : context(NULL)\n#endif\n        {};\n    void reportError(JSContext *cx, jsid id);\n    bool allow;\n    bool rv;\n\n#ifdef DEBUG\n    JSContext *context;\n    mozilla::Maybe<HandleObject> enteredProxy;\n    mozilla::Maybe<HandleId> enteredId;\n    // NB: We explicitly don't track the entered action here, because sometimes\n    // SET traps do an implicit GET during their implementation, leading to\n    // spurious assertions.\n    AutoEnterPolicy *prev;\n    void recordEnter(JSContext *cx, HandleObject proxy, HandleId id);\n    void recordLeave();\n\n    friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id);\n#else\n    inline void recordEnter(JSContext *cx, JSObject *proxy, jsid id) {}\n    inline void recordLeave() {}\n#endif\n\n};\n\n#ifdef DEBUG\nclass JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {\npublic:\n    AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id)\n    {\n        allow = true;\n        recordEnter(cx, proxy, id);\n    }\n};\n#else\nclass JS_FRIEND_API(AutoWaivePolicy) {\n    public: AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) {};\n};\n#endif\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSObject *)\njs_InitProxyClass(JSContext *cx, JS::HandleObject obj);\n\n#endif /* jsproxy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsprvtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprvtd_h\n#define jsprvtd_h\n/*\n * JS private typename definitions.\n *\n * This header is included only in other .h files, for convenience and for\n * simplicity of type naming.  The alternative for structures is to use tags,\n * which are named the same as their typedef names (legal in C/C++, and less\n * noisy than suffixing the typedef name with \"Struct\" or \"Str\").  Instead,\n * all .h files that include this file may use the same typedef name, whether\n * declaring a pointer to struct type, or defining a member of struct type.\n *\n * A few fundamental scalar types are defined here too.  Neither the scalar\n * nor the struct typedefs should change much, therefore the nearly-global\n * make dependency induced by this file should not prove painful.\n */\n\n#include \"jsapi.h\"\n#include \"jsutil.h\"\n\n#include \"js/HashTable.h\"\n#include \"js/Vector.h\"\n\n/*\n * Convenience constants.\n */\n#define JS_BITS_PER_UINT32_LOG2 5\n#define JS_BITS_PER_UINT32      32\n\n/* The alignment required of objects stored in GC arenas. */\nstatic const unsigned JS_GCTHING_ALIGN = 8;\nstatic const unsigned JS_GCTHING_ZEROBITS = 3;\n\n/* Scalar typedefs. */\ntypedef uint8_t     jsbytecode;\ntypedef uint8_t     jssrcnote;\ntypedef uintptr_t   jsatomid;\n\n/* Struct typedefs. */\ntypedef struct JSGCThing            JSGCThing;\ntypedef struct JSGenerator          JSGenerator;\ntypedef struct JSNativeEnumerator   JSNativeEnumerator;\ntypedef struct JSTryNote            JSTryNote;\n\n/* Friend \"Advanced API\" typedefs. */\ntypedef struct JSAtomState          JSAtomState;\ntypedef struct JSCodeSpec           JSCodeSpec;\ntypedef struct JSPrinter            JSPrinter;\ntypedef struct JSStackHeader        JSStackHeader;\ntypedef struct JSSubString          JSSubString;\ntypedef struct JSSpecializedNative  JSSpecializedNative;\n\n/* String typedefs. */\nclass JSDependentString;\nclass JSExtensibleString;\nclass JSExternalString;\nclass JSLinearString;\nclass JSRope;\nclass JSAtom;\nclass JSWrapper;\n\nnamespace js {\n\nstruct ArgumentsData;\nstruct Class;\n\nclass AutoNameVector;\nclass RegExpGuard;\nclass RegExpObject;\nclass RegExpObjectBuilder;\nclass RegExpShared;\nclass RegExpStatics;\nclass MatchPairs;\nclass PropertyName;\nclass LazyScript;\n\nenum RegExpFlag\n{\n    IgnoreCaseFlag  = 0x01,\n    GlobalFlag      = 0x02,\n    MultilineFlag   = 0x04,\n    StickyFlag      = 0x08,\n\n    NoFlags         = 0x00,\n    AllFlags        = 0x0f\n};\n\nclass StringBuffer;\n\nclass FrameRegs;\nclass StackFrame;\nclass ScriptFrameIter;\n\nclass Proxy;\nclass JS_FRIEND_API(AutoEnterPolicy);\nclass JS_FRIEND_API(BaseProxyHandler);\nclass JS_FRIEND_API(Wrapper);\nclass JS_FRIEND_API(CrossCompartmentWrapper);\n\nclass TempAllocPolicy;\nclass RuntimeAllocPolicy;\n\nclass GlobalObject;\n\ntemplate <typename K,\n          typename V,\n          size_t InlineElems>\nclass InlineMap;\n\nclass LifoAlloc;\n\nclass Shape;\n\nclass Breakpoint;\nclass BreakpointSite;\nclass Debugger;\nclass WatchpointMap;\n\n/*\n * Env is the type of what ES5 calls \"lexical environments\" (runtime\n * activations of lexical scopes). This is currently just JSObject, and is\n * implemented by Call, Block, With, and DeclEnv objects, among others--but\n * environments and objects are really two different concepts.\n */\ntypedef JSObject Env;\n\ntypedef JSNative             Native;\ntypedef JSParallelNative     ParallelNative;\ntypedef JSThreadSafeNative   ThreadSafeNative;\ntypedef JSPropertyOp         PropertyOp;\ntypedef JSStrictPropertyOp   StrictPropertyOp;\ntypedef JSPropertyDescriptor PropertyDescriptor;\n\nstruct SourceCompressionToken;\n\nnamespace frontend {\n\nstruct BytecodeEmitter;\nstruct Definition;\nclass FullParseHandler;\nclass FunctionBox;\nclass ObjectBox;\nstruct Token;\nstruct TokenPos;\nclass TokenStream;\nclass ParseMapPool;\nclass ParseNode;\n\ntemplate <typename ParseHandler>\nclass Parser;\n\n} /* namespace frontend */\n\nnamespace analyze {\n\nstruct LifetimeVariable;\nclass LoopAnalysis;\nclass ScriptAnalysis;\nclass SlotValue;\nclass SSAValue;\nclass SSAUseChain;\n\n} /* namespace analyze */\n\nnamespace types {\n\nclass TypeSet;\nstruct TypeCallsite;\nstruct TypeObject;\nstruct TypeCompartment;\n\n} /* namespace types */\n\ntypedef JS::Handle<Shape*>             HandleShape;\ntypedef JS::Handle<types::TypeObject*> HandleTypeObject;\ntypedef JS::Handle<JSAtom*>            HandleAtom;\ntypedef JS::Handle<PropertyName*>      HandlePropertyName;\n\ntypedef JS::MutableHandle<Shape*>      MutableHandleShape;\ntypedef JS::MutableHandle<JSAtom*>     MutableHandleAtom;\n\ntypedef JS::Rooted<Shape*>             RootedShape;\ntypedef JS::Rooted<types::TypeObject*> RootedTypeObject;\ntypedef JS::Rooted<JSAtom*>            RootedAtom;\ntypedef JS::Rooted<PropertyName*>      RootedPropertyName;\n\nenum XDRMode {\n    XDR_ENCODE,\n    XDR_DECODE\n};\n\ntemplate <XDRMode mode>\nclass XDRState;\n\nclass FreeOp;\n\nstruct IdValuePair\n{\n    jsid id;\n    Value value;\n\n    IdValuePair() {}\n    IdValuePair(jsid idArg)\n      : id(idArg), value(UndefinedValue())\n    {}\n};\n\n} /* namespace js */\n\nnamespace JSC {\n\nclass ExecutableAllocator;\n\n} /* namespace JSC */\n\nnamespace WTF {\n\nclass BumpPointerAllocator;\n\n} /* namespace WTF */\n\n/* \"Friend\" types used by jscntxt.h and jsdbgapi.h. */\ntypedef enum JSTrapStatus {\n    JSTRAP_ERROR,\n    JSTRAP_CONTINUE,\n    JSTRAP_RETURN,\n    JSTRAP_THROW,\n    JSTRAP_LIMIT\n} JSTrapStatus;\n\ntypedef JSTrapStatus\n(* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                  jsval closure);\n\ntypedef JSTrapStatus\n(* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                    void *closure);\n\ntypedef JSTrapStatus\n(* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                      void *closure);\n\ntypedef JSTrapStatus\n(* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                void *closure);\n\ntypedef JSBool\n(* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old,\n                        jsval *newp, void *closure);\n\n/* called just after script creation */\ntypedef void\n(* JSNewScriptHook)(JSContext  *cx,\n                    const char *filename,  /* URL of script */\n                    unsigned   lineno,     /* first line */\n                    JSScript   *script,\n                    JSFunction *fun,\n                    void       *callerdata);\n\n/* called just before script destruction */\ntypedef void\n(* JSDestroyScriptHook)(JSFreeOp *fop,\n                        JSScript *script,\n                        void     *callerdata);\n\ntypedef void\n(* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str,\n                    size_t length, void **listenerTSData, void *closure);\n\n/* js::ObjectOps function pointer typedefs. */\n\n/*\n * A generic type for functions mapping an object to another object, or null\n * if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSObjectOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/* Signature for class initialization ops. */\ntypedef JSObject *\n(* JSClassInitializerOp)(JSContext *cx, JS::HandleObject obj);\n\n/*\n * Hook that creates an iterator object for a given object. Returns the\n * iterator object or null if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, JSBool keysonly);\n\n\n#endif /* jsprvtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jspubtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jspubtd_h\n#define jspubtd_h\n\n/*\n * JS public API typedefs.\n */\n\n#include \"mozilla/PodOperations.h\"\n\n#include \"jsprototypes.h\"\n#include \"jstypes.h\"\n\n#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || (defined(DEBUG) && !defined(_WIN32))\n# define JSGC_TRACK_EXACT_ROOTS\n#endif\n\nnamespace JS {\n\n/*\n * Allow headers to reference JS::Value without #including the whole jsapi.h.\n * Unfortunately, typedefs (hence jsval) cannot be declared.\n */\nclass Value;\n\ntemplate <typename T>\nclass Rooted;\n\nclass JS_PUBLIC_API(AutoGCRooter);\n\nstruct Zone;\n\n} /* namespace JS */\n\n/*\n * In release builds, jsid is defined to be an integral type. This\n * prevents many bugs from being caught at compile time. E.g.:\n *\n *  jsid id = ...\n *  if (id == JS_TRUE)  // error\n *    ...\n *\n *  size_t n = id;      // error\n *\n * To catch more errors, jsid is given a struct type in C++ debug builds.\n * Struct assignment and (in C++) operator== allow correct code to be mostly\n * oblivious to the change. This feature can be explicitly disabled in debug\n * builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES.\n */\n// Needed for cocos2d-js\n#define JS_NO_JSVAL_JSID_STRUCT_TYPES\n# if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)\n#  define JS_USE_JSID_STRUCT_TYPES\n# endif\n\n# ifdef JS_USE_JSID_STRUCT_TYPES\nstruct jsid\n{\n    size_t asBits;\n    bool operator==(jsid rhs) const { return asBits == rhs.asBits; }\n    bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }\n};\n#  define JSID_BITS(id) (id.asBits)\n# else  /* defined(JS_USE_JSID_STRUCT_TYPES) */\ntypedef ptrdiff_t jsid;\n#  define JSID_BITS(id) (id)\n# endif  /* defined(JS_USE_JSID_STRUCT_TYPES) */\n\n#ifdef WIN32\ntypedef wchar_t   jschar;\n#else\ntypedef uint16_t  jschar;\n#endif\n\n/*\n * Run-time version enumeration.  For compile-time version checking, please use\n * the JS_HAS_* macros in jsversion.h, or use MOZJS_MAJOR_VERSION,\n * MOZJS_MINOR_VERSION, MOZJS_PATCH_VERSION, and MOZJS_ALPHA definitions.\n */\ntypedef enum JSVersion {\n    JSVERSION_ECMA_3  = 148,\n    JSVERSION_1_6     = 160,\n    JSVERSION_1_7     = 170,\n    JSVERSION_1_8     = 180,\n    JSVERSION_ECMA_5  = 185,\n    JSVERSION_DEFAULT = 0,\n    JSVERSION_UNKNOWN = -1,\n    JSVERSION_LATEST  = JSVERSION_ECMA_5\n} JSVersion;\n\n/* Result of typeof operator enumeration. */\ntypedef enum JSType {\n    JSTYPE_VOID,                /* undefined */\n    JSTYPE_OBJECT,              /* object */\n    JSTYPE_FUNCTION,            /* function */\n    JSTYPE_STRING,              /* string */\n    JSTYPE_NUMBER,              /* number */\n    JSTYPE_BOOLEAN,             /* boolean */\n    JSTYPE_NULL,                /* null */\n    JSTYPE_LIMIT\n} JSType;\n\n/* Dense index into cached prototypes and class atoms for standard objects. */\ntypedef enum JSProtoKey {\n#define PROTOKEY_AND_INITIALIZER(name,code,init) JSProto_##name = code,\n    JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)\n#undef JS_PROTO\n    JSProto_LIMIT\n} JSProtoKey;\n\n/* js_CheckAccess mode enumeration. */\ntypedef enum JSAccessMode {\n    JSACC_PROTO  = 0,           /* XXXbe redundant w.r.t. id */\n\n                                /*\n                                 * enum value #1 formerly called JSACC_PARENT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n                                /*\n                                 * enum value #2 formerly called JSACC_IMPORT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n    JSACC_WATCH  = 3,           /* a watchpoint on object foo for id 'bar' */\n    JSACC_READ   = 4,           /* a \"get\" of foo.bar */\n    JSACC_WRITE  = 8,           /* a \"set\" of foo.bar = baz */\n    JSACC_LIMIT\n} JSAccessMode;\n\n#define JSACC_TYPEMASK          (JSACC_WRITE - 1)\n\n/*\n * This enum type is used to control the behavior of a JSObject property\n * iterator function that has type JSNewEnumerate.\n */\ntypedef enum JSIterateOp {\n    /* Create new iterator state over enumerable properties. */\n    JSENUMERATE_INIT,\n\n    /* Create new iterator state over all properties. */\n    JSENUMERATE_INIT_ALL,\n\n    /* Iterate once. */\n    JSENUMERATE_NEXT,\n\n    /* Destroy iterator state. */\n    JSENUMERATE_DESTROY\n} JSIterateOp;\n\n/* See JSVAL_TRACE_KIND and JSTraceCallback in jsapi.h. */\ntypedef enum {\n    JSTRACE_OBJECT,\n    JSTRACE_STRING,\n    JSTRACE_SCRIPT,\n\n    /*\n     * Trace kinds internal to the engine. The embedding can only see them if\n     * it implements JSTraceCallback.\n     */\n    JSTRACE_LAZY_SCRIPT,\n    JSTRACE_IONCODE,\n    JSTRACE_SHAPE,\n    JSTRACE_BASE_SHAPE,\n    JSTRACE_TYPE_OBJECT,\n    JSTRACE_LAST = JSTRACE_TYPE_OBJECT\n} JSGCTraceKind;\n\n/* Struct typedefs and class forward declarations. */\ntypedef struct JSClass                      JSClass;\ntypedef struct JSCompartment                JSCompartment;\ntypedef struct JSConstDoubleSpec            JSConstDoubleSpec;\ntypedef struct JSContext                    JSContext;\ntypedef struct JSCrossCompartmentCall       JSCrossCompartmentCall;\ntypedef struct JSErrorReport                JSErrorReport;\ntypedef struct JSExceptionState             JSExceptionState;\ntypedef struct JSFunctionSpec               JSFunctionSpec;\ntypedef struct JSIdArray                    JSIdArray;\ntypedef struct JSLocaleCallbacks            JSLocaleCallbacks;\ntypedef struct JSObjectMap                  JSObjectMap;\ntypedef struct JSPrincipals                 JSPrincipals;\ntypedef struct JSPropertyDescriptor         JSPropertyDescriptor;\ntypedef struct JSPropertyName               JSPropertyName;\ntypedef struct JSPropertySpec               JSPropertySpec;\ntypedef struct JSRuntime                    JSRuntime;\ntypedef struct JSSecurityCallbacks          JSSecurityCallbacks;\ntypedef struct JSStructuredCloneCallbacks   JSStructuredCloneCallbacks;\ntypedef struct JSStructuredCloneReader      JSStructuredCloneReader;\ntypedef struct JSStructuredCloneWriter      JSStructuredCloneWriter;\ntypedef struct JSTracer                     JSTracer;\n\nclass                                       JSFlatString;\nclass                                       JSFunction;\nclass                                       JSObject;\nclass                                       JSScript;\nclass                                       JSStableString;  // long story\nclass                                       JSString;\n\n#ifdef JS_THREADSAFE\ntypedef struct PRCallOnceType    JSCallOnceType;\n#else\ntypedef JSBool                   JSCallOnceType;\n#endif\ntypedef JSBool                 (*JSInitCallback)(void);\n\nnamespace JS {\nnamespace shadow {\n\nstruct Runtime\n{\n    /* Restrict zone access during Minor GC. */\n    bool needsBarrier_;\n\n#ifdef JSGC_GENERATIONAL\n    /* Allow inlining of Nursery::isInside. */\n    uintptr_t gcNurseryStart_;\n    uintptr_t gcNurseryEnd_;\n#endif\n\n    Runtime()\n      : needsBarrier_(false)\n#ifdef JSGC_GENERATIONAL\n      , gcNurseryStart_(0)\n      , gcNurseryEnd_(0)\n#endif\n    {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Parallel operations in general can have one of three states. They may\n * succeed, fail, or \"bail\", where bail indicates that the code encountered an\n * unexpected condition and should be re-run sequentially. Different\n * subcategories of the \"bail\" state are encoded as variants of TP_RETRY_*.\n */\nenum ParallelResult { TP_SUCCESS, TP_RETRY_SEQUENTIALLY, TP_RETRY_AFTER_GC, TP_FATAL };\n\nstruct ThreadSafeContext;\nstruct ForkJoinSlice;\nclass ExclusiveContext;\n\nclass Allocator;\n\nclass SkipRoot;\n\nenum ThingRootKind\n{\n    THING_ROOT_OBJECT,\n    THING_ROOT_SHAPE,\n    THING_ROOT_BASE_SHAPE,\n    THING_ROOT_TYPE_OBJECT,\n    THING_ROOT_STRING,\n    THING_ROOT_ION_CODE,\n    THING_ROOT_SCRIPT,\n    THING_ROOT_ID,\n    THING_ROOT_PROPERTY_ID,\n    THING_ROOT_VALUE,\n    THING_ROOT_TYPE,\n    THING_ROOT_BINDINGS,\n    THING_ROOT_PROPERTY_DESCRIPTOR,\n    THING_ROOT_LIMIT\n};\n\ntemplate <typename T>\nstruct RootKind;\n\n/*\n * Specifically mark the ThingRootKind of externally visible types, so that\n * JSAPI users may use JSRooted... types without having the class definition\n * available.\n */\ntemplate<typename T, ThingRootKind Kind>\nstruct SpecificRootKind\n{\n    static ThingRootKind rootKind() { return Kind; }\n};\n\ntemplate <> struct RootKind<JSObject *> : SpecificRootKind<JSObject *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSFlatString *> : SpecificRootKind<JSFlatString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSFunction *> : SpecificRootKind<JSFunction *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSString *> : SpecificRootKind<JSString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSScript *> : SpecificRootKind<JSScript *, THING_ROOT_SCRIPT> {};\ntemplate <> struct RootKind<jsid> : SpecificRootKind<jsid, THING_ROOT_ID> {};\ntemplate <> struct RootKind<JS::Value> : SpecificRootKind<JS::Value, THING_ROOT_VALUE> {};\n\nstruct ContextFriendFields\n{\n  protected:\n    JSRuntime *const     runtime_;\n\n    /* The current compartment. */\n    JSCompartment       *compartment_;\n\n    /* The current zone. */\n    JS::Zone            *zone_;\n\n  public:\n    explicit ContextFriendFields(JSRuntime *rt)\n      : runtime_(rt), compartment_(NULL), zone_(NULL), autoGCRooters(NULL)\n    {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        mozilla::PodArrayZero(thingGCRooters);\n#endif\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n        skipGCRooters = NULL;\n#endif\n    }\n\n    static const ContextFriendFields *get(const JSContext *cx) {\n        return reinterpret_cast<const ContextFriendFields *>(cx);\n    }\n\n    static ContextFriendFields *get(JSContext *cx) {\n        return reinterpret_cast<ContextFriendFields *>(cx);\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Stack of thread-stack-allocated GC roots. */\n    JS::AutoGCRooter   *autoGCRooters;\n\n    friend JSRuntime *GetRuntime(const JSContext *cx);\n    friend JSCompartment *GetContextCompartment(const JSContext *cx);\n    friend JS::Zone *GetContextZone(const JSContext *cx);\n};\n\nclass PerThreadData;\n\nstruct PerThreadDataFriendFields\n{\n  private:\n    // Note: this type only exists to permit us to derive the offset of\n    // the perThread data within the real JSRuntime* type in a portable\n    // way.\n    struct RuntimeDummy : JS::shadow::Runtime\n    {\n        struct PerThreadDummy {\n            void *field1;\n            uintptr_t field2;\n#ifdef DEBUG\n            uint64_t field3;\n#endif\n        } mainThread;\n    };\n\n  public:\n\n    PerThreadDataFriendFields();\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Limit pointer for checking native stack consumption. */\n    uintptr_t nativeStackLimit;\n\n    static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);\n\n    static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) {\n        return reinterpret_cast<PerThreadDataFriendFields *>(pt);\n    }\n\n    static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<PerThreadDataFriendFields *>(\n            reinterpret_cast<char*>(rt) + RuntimeMainThreadOffset);\n    }\n\n    static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<const PerThreadDataFriendFields *>(\n            reinterpret_cast<const char*>(rt) + RuntimeMainThreadOffset);\n    }\n};\n\n} /* namespace js */\n\n#endif /* jspubtd_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jstypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n** File:                jstypes.h\n** Description: Definitions of NSPR's basic types\n**\n** Prototypes and macros used to make up for deficiencies in ANSI environments\n** that we have found.\n**\n** Since we do not wrap <stdlib.h> and all the other standard headers, authors\n** of portable code will not know in general that they need these definitions.\n** Instead of requiring these authors to find the dependent uses in their code\n** and take the following steps only in those C files, we take steps once here\n** for all C files.\n**/\n\n#ifndef jstypes_h\n#define jstypes_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js-config.h\"\n\n/***********************************************************************\n** MACROS:      JS_EXTERN_API\n**              JS_EXPORT_API\n** DESCRIPTION:\n**      These are only for externally visible routines and globals.  For\n**      internal routines, just use \"extern\" for type checking and that\n**      will not export internal cross-file or forward-declared symbols.\n**      Define a macro for declaring procedures return types. We use this to\n**      deal with windoze specific type hackery for DLL definitions. Use\n**      JS_EXTERN_API when the prototype for the method is declared. Use\n**      JS_EXPORT_API for the implementation of the method.\n**\n** Example:\n**   in dowhim.h\n**     JS_EXTERN_API( void ) DoWhatIMean( void );\n**   in dowhim.c\n**     JS_EXPORT_API( void ) DoWhatIMean( void ) { return; }\n**\n**\n***********************************************************************/\n\n#define JS_EXTERN_API(type)  extern MOZ_EXPORT type\n#define JS_EXPORT_API(type)  MOZ_EXPORT type\n#define JS_EXPORT_DATA(type) MOZ_EXPORT type\n#define JS_IMPORT_API(type)  MOZ_IMPORT_API type\n#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type\n\n/*\n * The linkage of JS API functions differs depending on whether the file is\n * used within the JS library or not. Any source file within the JS\n * interpreter should define EXPORT_JS_API whereas any client of the library\n * should not. STATIC_JS_API is used to build JS as a static library.\n */\n#if defined(STATIC_JS_API)\n#  define JS_PUBLIC_API(t)   t\n#  define JS_PUBLIC_DATA(t)  t\n#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)\n#  define JS_PUBLIC_API(t)   MOZ_EXPORT t\n#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t\n#else\n#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t\n#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t\n#endif\n\n#define JS_FRIEND_API(t)    JS_PUBLIC_API(t)\n#define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)\n\n#if defined(_MSC_VER) && defined(_M_IX86)\n#define JS_FASTCALL __fastcall\n#elif defined(__GNUC__) && defined(__i386__)\n#define JS_FASTCALL __attribute__((fastcall))\n#else\n#define JS_FASTCALL\n#define JS_NO_FASTCALL\n#endif\n\n#ifndef JS_INLINE\n#define JS_INLINE MOZ_INLINE\n#endif\n\n#ifndef JS_ALWAYS_INLINE\n#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE\n#endif\n\n#ifndef JS_NEVER_INLINE\n#define JS_NEVER_INLINE MOZ_NEVER_INLINE\n#endif\n\n#ifndef JS_WARN_UNUSED_RESULT\n# if defined __GNUC__\n#  define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n# else\n#  define JS_WARN_UNUSED_RESULT\n# endif\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_MACRO\n**              JS_END_MACRO\n** DESCRIPTION:\n**      Macro body brackets so that macros with compound statement definitions\n**      behave syntactically more like functions when called.\n***********************************************************************/\n#define JS_BEGIN_MACRO  do {\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n# define JS_END_MACRO                                                         \\\n    } __pragma(warning(push)) __pragma(warning(disable:4127))                 \\\n    while (0) __pragma(warning(pop))\n#else\n# define JS_END_MACRO   } while (0)\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_EXTERN_C\n**              JS_END_EXTERN_C\n** DESCRIPTION:\n**      Macro shorthands for conditional C++ extern block delimiters.\n***********************************************************************/\n#define JS_BEGIN_EXTERN_C      MOZ_BEGIN_EXTERN_C\n#define JS_END_EXTERN_C        MOZ_END_EXTERN_C\n\n/***********************************************************************\n** MACROS:      JS_BIT\n**              JS_BITMASK\n** DESCRIPTION:\n** Bit masking macros.  XXX n must be <= 31 to be portable\n***********************************************************************/\n#define JS_BIT(n)       ((uint32_t)1 << (n))\n#define JS_BITMASK(n)   (JS_BIT(n) - 1)\n\n/***********************************************************************\n** MACROS:      JS_HOWMANY\n**              JS_ROUNDUP\n**              JS_MIN\n**              JS_MAX\n** DESCRIPTION:\n**      Commonly used macros for operations on compatible types.\n***********************************************************************/\n#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))\n#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))\n\n#include \"jscpucfg.h\"\n\n/*\n * Define JS_64BIT iff we are building in an environment with 64-bit\n * addresses.\n */\n#ifdef _MSC_VER\n# if defined(_M_X64) || defined(_M_AMD64)\n#  define JS_64BIT\n# endif\n#elif defined(__GNUC__)\n/* Additional GCC defines are when running on Solaris, AIX, and HPUX */\n# if defined(__x86_64__) || defined(__sparcv9) || \\\n        defined(__64BIT__) || defined(__LP64__)\n#  define JS_64BIT\n# endif\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */\n# if defined(__x86_64) || defined(__sparcv9)\n#  define JS_64BIT\n# endif\n#elif defined(__xlc__) || defined(__xlC__)        /* IBM XL C/C++ */\n# if defined(__64BIT__)\n#  define JS_64BIT\n# endif\n#elif defined(__HP_cc) || defined(__HP_aCC)       /* HP-UX cc/aCC */\n# if defined(__LP64__)\n#  define JS_64BIT\n# endif\n#else\n# error \"Implement me\"\n#endif\n\n\n/************************************************************************\n** TYPES:       JSBool\n** DESCRIPTION:\n**  Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE\n**      for clarity of target type in assignments and actual arguments. Use\n**      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans\n**      just as you would C int-valued conditions.\n************************************************************************/\ntypedef int JSBool;\n#define JS_TRUE (int)1\n#define JS_FALSE (int)0\n\n/***********************************************************************\n** MACROS:      JS_LIKELY\n**              JS_UNLIKELY\n** DESCRIPTION:\n**      These macros allow you to give a hint to the compiler about branch\n**      probability so that it can better optimize.  Use them like this:\n**\n**      if (JS_LIKELY(v == 1)) {\n**          ... expected code path ...\n**      }\n**\n**      if (JS_UNLIKELY(v == 0)) {\n**          ... non-expected code path ...\n**      }\n**\n***********************************************************************/\n#ifdef __GNUC__\n\n# define JS_LIKELY(x)   (__builtin_expect((x), 1))\n# define JS_UNLIKELY(x) (__builtin_expect((x), 0))\n\n#else\n\n# define JS_LIKELY(x)   (x)\n# define JS_UNLIKELY(x) (x)\n\n#endif\n\n/***********************************************************************\n** MACROS:      JS_ARRAY_LENGTH\n**              JS_ARRAY_END\n** DESCRIPTION:\n**      Macros to get the number of elements and the pointer to one past the\n**      last element of a C array. Use them like this:\n**\n**      jschar buf[10], *s;\n**      JSString *str;\n**      ...\n**      for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;\n**      ...\n**      str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));\n**      ...\n**\n***********************************************************************/\n\n#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])\n#define JS_ARRAY_END(array)    ((array) + JS_ARRAY_LENGTH(array))\n\n#define JS_BITS_PER_BYTE 8\n#define JS_BITS_PER_BYTE_LOG2 3\n\n#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)\n\n/***********************************************************************\n** MACROS:      JS_FUNC_TO_DATA_PTR\n**              JS_DATA_TO_FUNC_PTR\n** DESCRIPTION:\n**      Macros to convert between function and data pointers assuming that\n**      they have the same size. Use them like this:\n**\n**      JSPropertyOp nativeGetter;\n**      JSObject *scriptedGetter;\n**      ...\n**      scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter);\n**      ...\n**      nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter);\n**\n***********************************************************************/\n\n#ifdef __GNUC__\n# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (size_t) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (size_t) (ptr))\n#else\n/* Use an extra (void *) cast for MSVC. */\n# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))\n#endif\n\n#ifdef __GNUC__\n# define JS_EXTENSION __extension__\n# define JS_EXTENSION_(s) __extension__ ({ s; })\n#else\n# define JS_EXTENSION\n# define JS_EXTENSION_(s) s\n#endif\n\n#endif /* jstypes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsutil.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * PR assertion checker.\n */\n\n#ifndef jsutil_h\n#define jsutil_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/GuardObjects.h\"\n\n#ifdef USE_ZLIB\n#include <zlib.h>\n#endif\n\n#include \"js/Utility.h\"\n\n/* Forward declarations. */\nstruct JSContext;\n\nstatic JS_ALWAYS_INLINE void *\njs_memcpy(void *dst_, const void *src_, size_t len)\n{\n    char *dst = (char *) dst_;\n    const char *src = (const char *) src_;\n    JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len);\n    JS_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len);\n\n    return memcpy(dst, src, len);\n}\n\nnamespace js {\n\ntemplate <class T>\nstruct AlignmentTestStruct\n{\n    char c;\n    T t;\n};\n\n/* This macro determines the alignment requirements of a type. */\n#define JS_ALIGNMENT_OF(t_) \\\n  (sizeof(js::AlignmentTestStruct<t_>) - sizeof(t_))\n\ntemplate <class T>\nclass AlignedPtrAndFlag\n{\n    uintptr_t bits;\n\n  public:\n    AlignedPtrAndFlag(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(aFlag);\n    }\n\n    T *ptr() const {\n        return (T *)(bits & ~uintptr_t(1));\n    }\n\n    bool flag() const {\n        return (bits & 1) != 0;\n    }\n\n    void setPtr(T *t) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(flag());\n    }\n\n    void setFlag() {\n        bits |= 1;\n    }\n\n    void unsetFlag() {\n        bits &= ~uintptr_t(1);\n    }\n\n    void set(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | aFlag;\n    }\n};\n\ntemplate <class T>\nstatic inline void\nReverse(T *beg, T *end)\n{\n    while (beg != end) {\n        if (--end == beg)\n            return;\n        T tmp = *beg;\n        *beg = *end;\n        *end = tmp;\n        ++beg;\n    }\n}\n\ntemplate <class T>\nstatic inline T *\nFind(T *beg, T *end, const T &v)\n{\n    for (T *p = beg; p != end; ++p) {\n        if (*p == v)\n            return p;\n    }\n    return end;\n}\n\ntemplate <class Container>\nstatic inline typename Container::ElementType *\nFind(Container &c, const typename Container::ElementType &v)\n{\n    return Find(c.begin(), c.end(), v);\n}\n\ntemplate <typename InputIterT, typename CallableT>\nvoid\nForEach(InputIterT begin, InputIterT end, CallableT f)\n{\n    for (; begin != end; ++begin)\n        f(*begin);\n}\n\ntemplate <class T>\nstatic inline T\nMin(T t1, T t2)\n{\n    return t1 < t2 ? t1 : t2;\n}\n\ntemplate <class T>\nstatic inline T\nMax(T t1, T t2)\n{\n    return t1 > t2 ? t1 : t2;\n}\n\n/* Allows a const variable to be initialized after its declaration. */\ntemplate <class T>\nstatic T&\nInitConst(const T &t)\n{\n    return const_cast<T &>(t);\n}\n\ntemplate <class T, class U>\nJS_ALWAYS_INLINE T &\nImplicitCast(U &u)\n{\n    T &t = u;\n    return t;\n}\n\ntemplate<typename T>\nclass AutoScopedAssign\n{\n  public:\n    AutoScopedAssign(T *addr, const T &value\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : addr_(addr), old(*addr_)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        *addr_ = value;\n    }\n\n    ~AutoScopedAssign() { *addr_ = old; }\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n    T *addr_;\n    T old;\n};\n\ntemplate <typename T>\nstatic inline bool\nIsPowerOfTwo(T t)\n{\n    return t && !(t & (t - 1));\n}\n\ntemplate <typename T, typename U>\nstatic inline U\nComputeByteAlignment(T bytes, U alignment)\n{\n    JS_ASSERT(IsPowerOfTwo(alignment));\n    return (alignment - (bytes % alignment)) % alignment;\n}\n\ntemplate <typename T, typename U>\nstatic inline T\nAlignBytes(T bytes, U alignment)\n{\n    return bytes + ComputeByteAlignment(bytes, alignment);\n}\n\nJS_ALWAYS_INLINE static size_t\nUnsignedPtrDiff(const void *bigger, const void *smaller)\n{\n    return size_t(bigger) - size_t(smaller);\n}\n\n/*****************************************************************************/\n\n/* A bit array is an array of bits represented by an array of words (size_t). */\n\nstatic inline unsigned\nNumWordsForBitArrayOfLength(size_t length)\n{\n    return (length + (JS_BITS_PER_WORD - 1)) / JS_BITS_PER_WORD;\n}\n\nstatic inline unsigned\nBitArrayIndexToWordIndex(size_t length, size_t bitIndex)\n{\n    unsigned wordIndex = bitIndex / JS_BITS_PER_WORD;\n    JS_ASSERT(wordIndex < length);\n    return wordIndex;\n}\n\nstatic inline size_t\nBitArrayIndexToWordMask(size_t i)\n{\n    return size_t(1) << (i % JS_BITS_PER_WORD);\n}\n\nstatic inline bool\nIsBitArrayElementSet(size_t *array, size_t length, size_t i)\n{\n    return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i);\n}\n\nstatic inline bool\nIsAnyBitArrayElementSet(size_t *array, size_t length)\n{\n    unsigned numWords = NumWordsForBitArrayOfLength(length);\n    for (unsigned i = 0; i < numWords; ++i) {\n        if (array[i])\n            return true;\n    }\n    return false;\n}\n\nstatic inline void\nSetBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearAllBitArrayElements(size_t *array, size_t length)\n{\n    for (unsigned i = 0; i < length; ++i)\n        array[i] = 0;\n}\n\n#ifdef USE_ZLIB\nclass Compressor\n{\n    /* Number of bytes we should hand to zlib each compressMore() call. */\n    static const size_t CHUNKSIZE = 2048;\n    z_stream zs;\n    const unsigned char *inp;\n    size_t inplen;\n    size_t outbytes;\n\n  public:\n    enum Status {\n        MOREOUTPUT,\n        DONE,\n        CONTINUE,\n        OOM\n    };\n\n    Compressor(const unsigned char *inp, size_t inplen);\n    ~Compressor();\n    bool init();\n    void setOutput(unsigned char *out, size_t outlen);\n    size_t outWritten() const { return outbytes; }\n    /* Compress some of the input. Return true if it should be called again. */\n    Status compressMore();\n};\n\n/*\n * Decompress a string. The caller must know the length of the output and\n * allocate |out| to a string of that length.\n */\nbool DecompressString(const unsigned char *inp, size_t inplen,\n                      unsigned char *out, size_t outlen);\n#endif\n\n}  /* namespace js */\n\n/* Crash diagnostics */\n#ifdef DEBUG\n# define JS_CRASH_DIAGNOSTICS 1\n#endif\n#ifdef JS_CRASH_DIAGNOSTICS\n# define JS_POISON(p, val, size) memset((p), (val), (size))\n#else\n# define JS_POISON(p, val, size) ((void) 0)\n#endif\n\n/* Basic stats */\n#ifdef DEBUG\n# define JS_BASIC_STATS 1\n#endif\n#ifdef JS_BASIC_STATS\n# include <stdio.h>\ntypedef struct JSBasicStats {\n    uint32_t    num;\n    uint32_t    max;\n    double      sum;\n    double      sqsum;\n    uint32_t    logscale;           /* logarithmic scale: 0 (linear), 2, 10 */\n    uint32_t    hist[11];\n} JSBasicStats;\n# define JS_INIT_STATIC_BASIC_STATS  {0,0,0,0,0,{0,0,0,0,0,0,0,0,0,0,0}}\n# define JS_BASIC_STATS_INIT(bs)     memset((bs), 0, sizeof(JSBasicStats))\n# define JS_BASIC_STATS_ACCUM(bs,val)                                         \\\n    JS_BasicStatsAccum(bs, val)\n# define JS_MeanAndStdDevBS(bs,sigma)                                         \\\n    JS_MeanAndStdDev((bs)->num, (bs)->sum, (bs)->sqsum, sigma)\nextern void\nJS_BasicStatsAccum(JSBasicStats *bs, uint32_t val);\nextern double\nJS_MeanAndStdDev(uint32_t num, double sum, double sqsum, double *sigma);\nextern void\nJS_DumpBasicStats(JSBasicStats *bs, const char *title, FILE *fp);\nextern void\nJS_DumpHistogram(JSBasicStats *bs, FILE *fp);\n#else\n# define JS_BASIC_STATS_ACCUM(bs,val)\n#endif\n\n/* A jsbitmap_t is a long integer that can be used for bitmaps. */\ntypedef size_t jsbitmap;\n#define JS_TEST_BIT(_map,_bit)  ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &      \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_SET_BIT(_map,_bit)   ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |=     \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &=     \\\n                                 ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n\n/* Wrapper for various macros to stop warnings coming from their expansions. */\n#if defined(__clang__)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"clang diagnostic push\")                                      \\\n        /* If these _Pragmas cause warnings for you, try disabling ccache. */ \\\n        _Pragma(\"clang diagnostic ignored \\\"-Wunused-value\\\"\")                \\\n        { expr; }                                                             \\\n        _Pragma(\"clang diagnostic pop\")                                       \\\n    JS_END_MACRO\n#elif MOZ_IS_GCC\n\n#if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"GCC diagnostic push\")                                        \\\n        _Pragma(\"GCC diagnostic ignored \\\"-Wunused-but-set-variable\\\"\")       \\\n        expr;                                                                 \\\n        _Pragma(\"GCC diagnostic pop\")                                         \\\n    JS_END_MACRO\n#endif\n#endif\n\n#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        expr;                                                                 \\\n    JS_END_MACRO\n#endif\n\n#endif /* jsutil_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jsversion.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsversion_h\n#define jsversion_h\n\n/*\n * Deprecated JS_VERSION handler.\n */\n#ifdef JS_VERSION\n# if JS_VERSION == 185\n#  warning \"JS_VERSION defined but unsupported (legacy)\"\n# elif JS_VERSION < 185\n#  error \"Unsupported JS_VERSION\"\n# else\n#  error \"Unknown JS_VERSION\"\n# endif\n#endif\n\n/*\n * JS Capability Macros.\n */\n#define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */\n#define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */\n#define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */\n#define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */\n#define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */\n#define JS_HAS_UNEVAL           1       /* has uneval() top-level function */\n#define JS_HAS_CONST            1       /* has JS2 const as alternative var */\n#define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */\n#define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */\n#define JS_HAS_FOR_EACH_IN      1       /* has for each (lhs in iterable) */\n#define JS_HAS_GENERATORS       1       /* has yield in generator function */\n#define JS_HAS_BLOCK_SCOPE      1       /* has block scope via let/arraycomp */\n#define JS_HAS_DESTRUCTURING    2       /* has [a,b] = ... or {p:a,q:b} = ... */\n#define JS_HAS_GENERATOR_EXPRS  1       /* has (expr for (lhs in iterable)) */\n#define JS_HAS_EXPR_CLOSURES    1       /* has function (formals) listexpr */\n\n/* Support for JS_NewGlobalObject. */\n#define JS_HAS_NEW_GLOBAL_OBJECT        1\n\n/* Support for JS_MakeSystemObject. */\n#define JS_HAS_MAKE_SYSTEM_OBJECT       1\n\n/* Feature-test macro for evolving destructuring support. */\n#define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)\n\n/*\n * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support;\n * support likely to be made opt-in at some future time.\n */\n#define OLD_GETTER_SETTER_METHODS       1\n\n/* A kill-switch for bug 586842.  Embedders shouldn't touch this! */\n#define USE_NEW_OBJECT_REPRESENTATION 0\n\n#if USE_NEW_OBJECT_REPRESENTATION\n#  define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0)\n#else\n#  define NEW_OBJECT_REPRESENTATION_ONLY() \\\n     MOZ_ASSUME_UNREACHABLE(\"don't call this!  to be used in the new object representation\")\n#endif\n\n#endif /* jsversion_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/jswrapper.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jswrapper_h\n#define jswrapper_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"jsapi.h\"\n#include \"jsproxy.h\"\n\nnamespace js {\n\nclass DummyFrameGuard;\n\n/*\n * A wrapper is a proxy with a target object to which it generally forwards\n * operations, but may restrict access to certain operations or instrument\n * the trap operations in various ways. A wrapper is distinct from a Direct Proxy\n * Handler in the sense that it can be \"unwrapped\" in C++, exposing the underlying\n * object (Direct Proxy Handlers have an underlying target object, but don't\n * expect to expose this object via any kind of unwrapping operation). Callers\n * should be careful to avoid unwrapping security wrappers in the wrong context.\n */\nclass JS_FRIEND_API(Wrapper) : public DirectProxyHandler\n{\n    unsigned mFlags;\n    bool mSafeToUnwrap;\n\n  public:\n    using BaseProxyHandler::Action;\n\n    enum Flags {\n        CROSS_COMPARTMENT = 1 << 0,\n        LAST_USED_FLAG = CROSS_COMPARTMENT\n    };\n\n    /*\n     * Wrappers can explicitly specify that they are unsafe to unwrap from a\n     * security perspective (as is the case for SecurityWrappers). If a wrapper\n     * is not safe to unwrap, operations requiring full access to the underlying\n     * object (via CheckedUnwrap) will throw. Otherwise, they will succeed.\n     */\n    void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; }\n    bool isSafeToUnwrap() { return mSafeToUnwrap; }\n\n    static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto,\n                         JSObject *parent, Wrapper *handler);\n\n    static JSObject *Renew(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *handler);\n\n    static Wrapper *wrapperHandler(JSObject *wrapper);\n\n    static JSObject *wrappedObject(JSObject *wrapper);\n\n    unsigned flags() const {\n        return mFlags;\n    }\n\n    explicit Wrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~Wrapper();\n\n    static Wrapper singleton;\n    static Wrapper singletonWithPrototype;\n};\n\n/* Base class for all cross compartment wrapper handlers. */\nclass JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper\n{\n  public:\n    CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~CrossCompartmentWrapper();\n\n    virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE;\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived wrapper traps. */\n    virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject wrapper, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject wrapper,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static CrossCompartmentWrapper singleton;\n    static CrossCompartmentWrapper singletonWithPrototype;\n};\n\n/*\n * Base class for security wrappers. A security wrapper is potentially hiding\n * all or part of some wrapped object thus SecurityWrapper defaults to denying\n * access to the wrappee. This is the opposite of Wrapper which tries to be\n * completely transparent.\n *\n * NB: Currently, only a few ProxyHandler operations are overridden to deny\n * access, relying on derived SecurityWrapper to block access when necessary.\n */\ntemplate <class Base>\nclass JS_FRIEND_API(SecurityWrapper) : public Base\n{\n  public:\n    SecurityWrapper(unsigned flags);\n\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act,\n                       bool *bp) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n\n    /*\n     * Allow our subclasses to select the superclass behavior they want without\n     * needing to specify an exact superclass.\n     */\n    typedef Base Permissive;\n    typedef SecurityWrapper<Base> Restrictive;\n};\n\ntypedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;\ntypedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;\n\nclass JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler\n{\n  public:\n    static int sDeadObjectFamily;\n\n    explicit DeadObjectProxy();\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp,\n                                     bool *present) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy,\n                                MutableHandleObject protop) MOZ_OVERRIDE;\n\n    static DeadObjectProxy singleton;\n};\n\nextern JSObject *\nTransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj,\n                         HandleObject wrappedProto, HandleObject parent,\n                         unsigned flags);\n\n// Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by\n// jsfriendapi users.\nextern JS_FRIEND_DATA(int) sWrapperFamily;\n\ninline bool\nIsWrapper(JSObject *obj)\n{\n    return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily;\n}\n\n// Given a JSObject, returns that object stripped of wrappers. If\n// stopAtOuter is true, then this returns the outer window if it was\n// previously wrapped. Otherwise, this returns the first object for\n// which JSObject::isWrapper returns false.\nJS_FRIEND_API(JSObject *)\nUncheckedUnwrap(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = NULL);\n\n// Given a JSObject, returns that object stripped of wrappers. At each stage,\n// the security wrapper has the opportunity to veto the unwrap. Since checked\n// code should never be unwrapping outer window wrappers, we always stop at\n// outer windows.\nJS_FRIEND_API(JSObject *)\nCheckedUnwrap(JSObject *obj, bool stopAtOuter = true);\n\n// Unwrap only the outermost security wrapper, with the same semantics as\n// above. This is the checked version of Wrapper::wrappedObject.\nJS_FRIEND_API(JSObject *)\nUnwrapOneChecked(JSObject *obj, bool stopAtOuter = true);\n\nJS_FRIEND_API(bool)\nIsCrossCompartmentWrapper(JSObject *obj);\n\nbool\nIsDeadProxyObject(JSObject *obj);\n\nJSObject *\nNewDeadProxyObject(JSContext *cx, JSObject *parent);\n\nvoid\nNukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper);\n\nbool\nRemapWrapper(JSContext *cx, JSObject *wobj, JSObject *newTarget);\n\nJS_FRIEND_API(bool)\nRemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget,\n                          JSObject *newTarget);\n\n// API to recompute all cross-compartment wrappers whose source and target\n// match the given filters.\nJS_FRIEND_API(bool)\nRecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,\n                  const CompartmentFilter &targetFilter);\n\n/*\n * This auto class should be used around any code, such as brain transplants,\n * that may touch dead zones. Brain transplants can cause problems\n * because they operate on all compartments, whether live or dead. A brain\n * transplant can cause a formerly dead object to be \"reanimated\" by causing a\n * read or write barrier to be invoked on it during the transplant. In this way,\n * a zone becomes a zombie, kept alive by repeatedly consuming\n * (transplanted) brains.\n *\n * To work around this issue, we observe when mark bits are set on objects in\n * dead zones. If this happens during a brain transplant, we do a full,\n * non-incremental GC at the end of the brain transplant. This will clean up any\n * objects that were improperly marked.\n */\nstruct JS_FRIEND_API(AutoMaybeTouchDeadZones)\n{\n    // The version that takes an object just uses it for its runtime.\n    AutoMaybeTouchDeadZones(JSContext *cx);\n    AutoMaybeTouchDeadZones(JSObject *obj);\n    ~AutoMaybeTouchDeadZones();\n\n  private:\n    JSRuntime *runtime;\n    unsigned markCount;\n    bool inIncremental;\n    bool manipulatingDeadZones;\n};\n\n} /* namespace js */\n\n#endif /* jswrapper_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/AllocPolicy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * An allocation policy concept, usable for structures and algorithms to\n * control how memory is allocated and how failures are handled.\n */\n\n#ifndef mozilla_AllocPolicy_h\n#define mozilla_AllocPolicy_h\n\n#include <stddef.h>\n#include <stdlib.h>\n\nnamespace mozilla {\n\n/*\n * Allocation policies are used to implement the standard allocation behaviors\n * in a customizable way.  Additionally, custom behaviors may be added to these\n * behaviors, such as additionally reporting an error through an out-of-band\n * mechanism when OOM occurs.  The concept modeled here is as follows:\n *\n *  - public copy constructor, assignment, destructor\n *  - void* malloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* calloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* realloc_(void*, size_t, size_t)\n *      Responsible for OOM reporting when null is returned.  The *used* bytes\n *      of the previous buffer is passed in (rather than the old allocation\n *      size), in addition to the *new* allocation size requested.\n *  - void free_(void*)\n *  - void reportAllocOverflow() const\n *      Called on allocation overflow (that is, an allocation implicitly tried\n *      to allocate more than the available memory space -- think allocating an\n *      array of large-size objects, where N * size overflows) before null is\n *      returned.\n *\n * mfbt provides (and typically uses by default) only MallocAllocPolicy, which\n * does nothing more than delegate to the malloc/alloc/free functions.\n */\n\n/*\n * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no\n * extra behaviors.\n */\nclass MallocAllocPolicy\n{\n  public:\n    void* malloc_(size_t bytes) { return malloc(bytes); }\n    void* calloc_(size_t bytes) { return calloc(bytes, 1); }\n    void* realloc_(void* p, size_t oldBytes, size_t bytes) { return realloc(p, bytes); }\n    void free_(void* p) { free(p); }\n    void reportAllocOverflow() const {}\n};\n\n\n} // namespace mozilla\n\n#endif /* mozilla_AllocPolicy_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Array.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A compile-time constant-length array with bounds-checking assertions. */\n\n#ifndef mozilla_Array_h\n#define mozilla_Array_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\ntemplate<typename T, size_t Length>\nclass Array\n{\n    T arr[Length];\n\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n};\n\ntemplate<typename T>\nclass Array<T, 0>\n{\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_Array_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Assertions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of runtime and static assertion macros for C and C++. */\n\n#ifndef mozilla_Assertions_h\n#define mozilla_Assertions_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Likely.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef WIN32\n   /*\n    * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which\n    * further depends on <windef.h>.  We hardcode these few definitions manually\n    * because those headers clutter the global namespace with a significant\n    * number of undesired macros and symbols.\n    */\n#  ifdef __cplusplus\n   extern \"C\" {\n#  endif\n   __declspec(dllimport) int __stdcall\n   TerminateProcess(void* hProcess, unsigned int uExitCode);\n   __declspec(dllimport) void* __stdcall GetCurrentProcess(void);\n#  ifdef __cplusplus\n   }\n#  endif\n#else\n#  include <signal.h>\n#endif\n#ifdef ANDROID\n#  include <android/log.h>\n#endif\n\n/*\n * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.\n * In C++11, static_assert is provided by the compiler to the same effect.\n * This can be useful when you make certain assumptions about what must hold for\n * optimal, or even correct, behavior.  For example, you might assert that the\n * size of a struct is a multiple of the target architecture's word size:\n *\n *   struct S { ... };\n *   // C\n *   MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,\n *                     \"S should be a multiple of word size for efficiency\");\n *   // C++11\n *   static_assert(sizeof(S) % sizeof(size_t) == 0,\n *                 \"S should be a multiple of word size for efficiency\");\n *\n * This macro can be used in any location where both an extern declaration and a\n * typedef could be used.\n */\n#ifndef __cplusplus\n   /*\n    * Some of the definitions below create an otherwise-unused typedef.  This\n    * triggers compiler warnings with some versions of gcc, so mark the typedefs\n    * as permissibly-unused to disable the warnings.\n    */\n#  if defined(__GNUC__)\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))\n#  else\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */\n#  endif\n#  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y\n#  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)\n#  if defined(__SUNPRO_CC)\n     /*\n      * The Sun Studio C++ compiler is buggy when declaring, inside a function,\n      * another extern'd function with an array argument whose length contains a\n      * sizeof, triggering the error message \"sizeof expression not accepted as\n      * size of array parameter\".  This bug (6688515, not public yet) would hit\n      * defining moz_static_assert as a function, so we always define an extern\n      * array for Sun Studio.\n      *\n      * We include the line number in the symbol name in a best-effort attempt\n      * to avoid conflicts (see below).\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond) ? 1 : -1]\n#  elif defined(__COUNTER__)\n     /*\n      * If there was no preferred alternative, use a compiler-agnostic version.\n      *\n      * Note that the non-__COUNTER__ version has a bug in C++: it can't be used\n      * in both |extern \"C\"| and normal C++ in the same translation unit.  (Alas\n      * |extern \"C\"| isn't allowed in a function.)  The only affected compiler\n      * we really care about is gcc 4.2.  For that compiler and others like it,\n      * we include the line number in the function name to do the best we can to\n      * avoid conflicts.  These should be rare: a conflict would require use of\n      * MOZ_STATIC_ASSERT on the same line in separate files in the same\n      * translation unit, *and* the uses would have to be in code with\n      * different linkage, *and* the first observed use must be in C++-linkage\n      * code.\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  else\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  endif\n\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)\n#else\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Prints |s| as an assertion failure (using file and ln as the location of the\n * assertion) to the standard debug-output channel.\n *\n * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This\n * method is primarily for internal use in this header, and only secondarily\n * for use in implementing release-build assertions.\n */\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportAssertionFailure(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n  __android_log_print(ANDROID_LOG_FATAL, \"MOZ_Assert\",\n                      \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportCrash(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n    __android_log_print(ANDROID_LOG_FATAL, \"MOZ_CRASH\",\n                        \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\n/**\n * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH().  You should\n * call MOZ_CRASH instead.\n */\n#if defined(_MSC_VER)\n   /*\n    * On MSVC use the __debugbreak compiler intrinsic, which produces an inline\n    * (not nested in a system function) breakpoint.  This distinctively invokes\n    * Breakpad without requiring system library symbols on all stack-processing\n    * machines, as a nested breakpoint would require.\n    *\n    * We use TerminateProcess with the exit code aborting would generate\n    * because we don't want to invoke atexit handlers, destructors, library\n    * unload handlers, and so on when our process might be in a compromised\n    * state.\n    *\n    * We don't use abort() because it'd cause Windows to annoyingly pop up the\n    * process error dialog multiple times.  See bug 345118 and bug 426163.\n    *\n    * We follow TerminateProcess() with a call to MOZ_NoReturn() so that the\n    * compiler doesn't hassle us to provide a return statement after a\n    * MOZ_REALLY_CRASH() call.\n    *\n    * (Technically these are Windows requirements, not MSVC requirements.  But\n    * practically you need MSVC for debugging, and we only ship builds created\n    * by MSVC, so doing it this way reduces complexity.)\n    */\n\n__declspec(noreturn) __inline void MOZ_NoReturn() {}\n\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         ::TerminateProcess(::GetCurrentProcess(), 3); \\\n         ::MOZ_NoReturn(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         TerminateProcess(GetCurrentProcess(), 3); \\\n         MOZ_NoReturn(); \\\n       } while (0)\n#  endif\n#else\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         ::abort(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         abort(); \\\n       } while (0)\n#  endif\n#endif\n\n/*\n * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a\n * Breakpad-compatible way, in both debug and release builds.\n *\n * MOZ_CRASH is a good solution for \"handling\" failure cases when you're\n * unwilling or unable to handle them more cleanly -- for OOM, for likely memory\n * corruption, and so on.  It's also a good solution if you need safe behavior\n * in release builds as well as debug builds.  But if the failure is one that\n * should be debugged and fixed, MOZ_ASSERT is generally preferable.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining why we're crashing.  This argument is intended for use with\n * MOZ_CRASH() calls whose rationale is non-obvious; don't use it if it's\n * obvious why we're crashing.\n *\n * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an\n * explanation-string, we print the string to stderr.  Otherwise, we don't\n * print anything; this is because we want MOZ_CRASH to be 100% safe in release\n * builds, and it's hard to print to stderr safely when memory might have been\n * corrupted.\n */\n#ifndef DEBUG\n#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()\n#else\n#  define MOZ_CRASH(...) \\\n     do { \\\n       MOZ_ReportCrash(\"\" __VA_ARGS__, __FILE__, __LINE__); \\\n       MOZ_REALLY_CRASH(); \\\n     } while(0)\n#endif\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n/*\n * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in\n * debug builds.  If it is, execution continues.  Otherwise, an error message\n * including the expression and the explanation-string (if provided) is printed,\n * an attempt is made to invoke any existing debugger, and execution halts.\n * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition\n * which can correctly be falsy.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining the assertion.  It is intended for use with assertions whose\n * correctness or rationale is non-obvious, and for assertions where the \"real\"\n * condition being tested is best described prosaically.  Don't provide an\n * explanation if it's not actually helpful.\n *\n *   // No explanation needed: pointer arguments often must not be NULL.\n *   MOZ_ASSERT(arg);\n *\n *   // An explanation can be helpful to explain exactly how we know an\n *   // assertion is valid.\n *   MOZ_ASSERT(state == WAITING_FOR_RESPONSE,\n *              \"given that <thingA> and <thingB>, we must have...\");\n *\n *   // Or it might disambiguate multiple identical (save for their location)\n *   // assertions of the same expression.\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this Boolean object\");\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this String object\");\n *\n * MOZ_ASSERT has no effect in non-debug builds.  It is designed to catch bugs\n * *only* during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n   /* First the single-argument form. */\n#  define MOZ_ASSERT_HELPER1(expr) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* Now the two-argument form. */\n#  define MOZ_ASSERT_HELPER2(expr, explain) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr \" (\" explain \")\", __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* And now, helper macrology up the wazoo. */\n   /*\n    * Count the number of arguments passed to MOZ_ASSERT, very carefully\n    * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a\n    * single token in argument lists.  See these URLs for details:\n    *\n    *   http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement\n    *   http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644\n    */\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL2(_1, _2, count, ...) \\\n     count\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL(args) \\\n\t MOZ_COUNT_ASSERT_ARGS_IMPL2 args\n#  define MOZ_COUNT_ASSERT_ARGS(...) \\\n     MOZ_COUNT_ASSERT_ARGS_IMPL((__VA_ARGS__, 2, 1, 0))\n   /* Pick the right helper macro to invoke. */\n#  define MOZ_ASSERT_CHOOSE_HELPER2(count) MOZ_ASSERT_HELPER##count\n#  define MOZ_ASSERT_CHOOSE_HELPER1(count) MOZ_ASSERT_CHOOSE_HELPER2(count)\n#  define MOZ_ASSERT_CHOOSE_HELPER(count) MOZ_ASSERT_CHOOSE_HELPER1(count)\n   /* The actual macro. */\n#  define MOZ_ASSERT_GLUE(x, y) x y\n#  define MOZ_ASSERT(...) \\\n     MOZ_ASSERT_GLUE(MOZ_ASSERT_CHOOSE_HELPER(MOZ_COUNT_ASSERT_ARGS(__VA_ARGS__)), \\\n                     (__VA_ARGS__))\n#else\n#  define MOZ_ASSERT(...) do { } while(0)\n#endif /* DEBUG */\n\n/*\n * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is\n * true.\n *\n *   MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));\n *\n * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds.  It is\n * designed to catch bugs during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n#  define MOZ_ASSERT_IF(cond, expr) \\\n     do { \\\n       if (cond) \\\n         MOZ_ASSERT(expr); \\\n     } while (0)\n#else\n#  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that it is\n * undefined behavior for execution to reach this point.  No guarantees are made\n * about what will happen if this is reached at runtime.  Most code should\n * probably use the higher level MOZ_ASSUME_UNREACHABLE, which uses this when\n * appropriate.\n */\n#if defined(__clang__)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#elif defined(__GNUC__)\n   /*\n    * __builtin_unreachable() was implemented in gcc 4.5.  If we don't have\n    * that, call a noreturn function; abort() will do nicely.  Qualify the call\n    * in C++ in case there's another abort() visible in local scope.\n    */\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0)\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#  else\n#    ifdef __cplusplus\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#    else\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __assume(0)\n#else\n#  ifdef __cplusplus\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#  else\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#  endif\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE([reason]) tells the compiler that it can assume that\n * the macro call cannot be reached during execution.  This lets the compiler\n * generate better-optimized code under some circumstances, at the expense of\n * the program's behavior being undefined if control reaches the\n * MOZ_ASSUME_UNREACHABLE.\n *\n * In Gecko, you probably should not use this macro outside of performance- or\n * size-critical code, because it's unsafe.  If you don't care about code size\n * or performance, you should probably use MOZ_ASSERT or MOZ_CRASH.\n *\n * SpiderMonkey is a different beast, and there it's acceptable to use\n * MOZ_ASSUME_UNREACHABLE more widely.\n *\n * Note that MOZ_ASSUME_UNREACHABLE is noreturn, so it's valid not to return a\n * value following a MOZ_ASSUME_UNREACHABLE call.\n *\n * Example usage:\n *\n *   enum ValueType {\n *     VALUE_STRING,\n *     VALUE_INT,\n *     VALUE_FLOAT\n *   };\n *\n *   int ptrToInt(ValueType type, void* value) {\n *   {\n *     // We know for sure that type is either INT or FLOAT, and we want this\n *     // code to run as quickly as possible.\n *     switch (type) {\n *     case VALUE_INT:\n *       return *(int*) value;\n *     case VALUE_FLOAT:\n *       return (int) *(float*) value;\n *     default:\n *       MOZ_ASSUME_UNREACHABLE(\"can only handle VALUE_INT and VALUE_FLOAT\");\n *     }\n *   }\n */\n#if defined(DEBUG)\n#  define MOZ_ASSUME_UNREACHABLE(...) \\\n     do { \\\n       MOZ_ASSERT(false, \"MOZ_ASSUME_UNREACHABLE(\" __VA_ARGS__ \")\"); \\\n       MOZ_ASSUME_UNREACHABLE_MARKER(); \\\n     } while (0)\n#else\n#  define MOZ_ASSUME_UNREACHABLE(reason)  MOZ_ASSUME_UNREACHABLE_MARKER()\n#endif\n\n/*\n * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided\n * expression, in debug builds and in release builds both.  Then, in debug\n * builds only, the value of the expression is asserted either true or false\n * using MOZ_ASSERT.\n */\n#ifdef DEBUG\n#  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))\n#  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))\n#else\n#  define MOZ_ALWAYS_TRUE(expr)      ((void)(expr))\n#  define MOZ_ALWAYS_FALSE(expr)     ((void)(expr))\n#endif\n\n#endif /* mozilla_Assertions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Atomics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements (almost always) lock-free atomic operations. The operations here\n * are a subset of that which can be found in C++11's <atomic> header, with a\n * different API to enforce consistent memory ordering constraints.\n *\n * Anyone caught using |volatile| for inter-thread memory safety needs to be\n * sent a copy of this header and the C++11 standard.\n */\n\n#ifndef mozilla_Atomics_h\n#define mozilla_Atomics_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n\n/*\n * Our minimum deployment target on clang/OS X is OS X 10.6, whose SDK\n * does not have <atomic>.  So be sure to check for <atomic> support\n * along with C++0x support.\n */\n#if defined(__clang__)\n   /*\n    * clang doesn't like libstdc++'s version of <atomic> before GCC 4.7,\n    * due to the loose typing of the __sync_* family of functions done by\n    * GCC.  We do not have a particularly good way to detect this sort of\n    * case at this point, so just assume that if we're on a Linux system,\n    * we can't use the system's <atomic>.\n    *\n    * OpenBSD uses an old libstdc++ 4.2.1 and thus doesnt have <atomic>.\n    */\n#  if !defined(__linux__) && !defined(__OpenBSD__) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \\\n      __has_include(<atomic>)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n/*\n * Android uses a different C++ standard library that does not provide\n * support for <atomic>.\n *\n * GCC 4.5.x and 4.6.x's unspecialized std::atomic template doesn't include\n * inline definitions for the functions declared therein.  This oversight\n * leads to linking errors when using atomic enums.  We therefore require\n * GCC 4.7 or higher.\n */\n#elif defined(__GNUC__) && !defined(__ANDROID__)\n#  include \"mozilla/Compiler.h\"\n#  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \\\n      MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n#elif defined(_MSC_VER) && _MSC_VER >= 1700\n#  define MOZ_HAVE_CXX11_ATOMICS\n#endif\n\nnamespace mozilla {\n\n/**\n * An enum of memory ordering possibilities for atomics.\n *\n * Memory ordering is the observable state of distinct values in memory.\n * (It's a separate concept from atomicity, which concerns whether an\n * operation can ever be observed in an intermediate state.  Don't\n * conflate the two!)  Given a sequence of operations in source code on\n * memory, it is *not* always the case that, at all times and on all\n * cores, those operations will appear to have occurred in that exact\n * sequence.  First, the compiler might reorder that sequence, if it\n * thinks another ordering will be more efficient.  Second, the CPU may\n * not expose so consistent a view of memory.  CPUs will often perform\n * their own instruction reordering, above and beyond that performed by\n * the compiler.  And each core has its own memory caches, and accesses\n * (reads and writes both) to \"memory\" may only resolve to out-of-date\n * cache entries -- not to the \"most recently\" performed operation in\n * some global sense.  Any access to a value that may be used by\n * multiple threads, potentially across multiple cores, must therefore\n * have a memory ordering imposed on it, for all code on all\n * threads/cores to have a sufficiently coherent worldview.\n *\n * http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync and\n * http://en.cppreference.com/w/cpp/atomic/memory_order go into more\n * detail on all this, including examples of how each mode works.\n *\n * Note that for simplicity and practicality, not all of the modes in\n * C++11 are supported.  The missing C++11 modes are either subsumed by\n * the modes we provide below, or not relevant for the CPUs we support\n * in Gecko.  These three modes are confusing enough as it is!\n */\nenum MemoryOrdering {\n  /*\n   * Relaxed ordering is the simplest memory ordering: none at all.\n   * When the result of a write is observed, nothing may be inferred\n   * about other memory.  Writes ostensibly performed \"before\" on the\n   * writing thread may not yet be visible.  Writes performed \"after\" on\n   * the writing thread may already be visible, if the compiler or CPU\n   * reordered them.  (The latter can happen if reads and/or writes get\n   * held up in per-processor caches.)  Relaxed ordering means\n   * operations can always use cached values (as long as the actual\n   * updates to atomic values actually occur, correctly, eventually), so\n   * it's usually the fastest sort of atomic access.  For this reason,\n   * *it's also the most dangerous kind of access*.\n   *\n   * Relaxed ordering is good for things like process-wide statistics\n   * counters that don't need to be consistent with anything else, so\n   * long as updates themselves are atomic.  (And so long as any\n   * observations of that value can tolerate being out-of-date -- if you\n   * need some sort of up-to-date value, you need some sort of other\n   * synchronizing operation.)  It's *not* good for locks, mutexes,\n   * reference counts, etc. that mediate access to other memory, or must\n   * be observably consistent with other memory.\n   *\n   * x86 architectures don't take advantage of the optimization\n   * opportunities that relaxed ordering permits.  Thus it's possible\n   * that using relaxed ordering will \"work\" on x86 but fail elsewhere\n   * (ARM, say, which *does* implement non-sequentially-consistent\n   * relaxed ordering semantics).  Be extra-careful using relaxed\n   * ordering if you can't easily test non-x86 architectures!\n   */\n  Relaxed,\n  /*\n   * When an atomic value is updated with ReleaseAcquire ordering, and\n   * that new value is observed with ReleaseAcquire ordering, prior\n   * writes (atomic or not) are also observable.  What ReleaseAcquire\n   * *doesn't* give you is any observable ordering guarantees for\n   * ReleaseAcquire-ordered operations on different objects.  For\n   * example, if there are two cores that each perform ReleaseAcquire\n   * operations on separate objects, each core may or may not observe\n   * the operations made by the other core.  The only way the cores can\n   * be synchronized with ReleaseAcquire is if they both\n   * ReleaseAcquire-access the same object.  This implies that you can't\n   * necessarily describe some global total ordering of ReleaseAcquire\n   * operations.\n   *\n   * ReleaseAcquire ordering is good for (as the name implies) atomic\n   * operations on values controlling ownership of things: reference\n   * counts, mutexes, and the like.  However, if you are thinking about\n   * using these to implement your own locks or mutexes, you should take\n   * a good, hard look at actual lock or mutex primitives first.\n   */\n  ReleaseAcquire,\n  /*\n   * When an atomic value is updated with SequentiallyConsistent\n   * ordering, all writes observable when the update is observed, just\n   * as with ReleaseAcquire ordering.  But, furthermore, a global total\n   * ordering of SequentiallyConsistent operations *can* be described.\n   * For example, if two cores perform SequentiallyConsistent operations\n   * on separate objects, one core will observably perform its update\n   * (and all previous operations will have completed), then the other\n   * core will observably perform its update (and all previous\n   * operations will have completed).  (Although those previous\n   * operations aren't themselves ordered -- they could be intermixed,\n   * or ordered if they occur on atomic values with ordering\n   * requirements.)  SequentiallyConsistent is the *simplest and safest*\n   * ordering of atomic operations -- it's always as if one operation\n   * happens, then another, then another, in some order -- and every\n   * core observes updates to happen in that single order.  Because it\n   * has the most synchronization requirements, operations ordered this\n   * way also tend to be slowest.\n   *\n   * SequentiallyConsistent ordering can be desirable when multiple\n   * threads observe objects, and they all have to agree on the\n   * observable order of changes to them.  People expect\n   * SequentiallyConsistent ordering, even if they shouldn't, when\n   * writing code, atomic or otherwise.  SequentiallyConsistent is also\n   * the ordering of choice when designing lockless data structures.  If\n   * you don't know what order to use, use this one.\n   */\n  SequentiallyConsistent,\n};\n\n} // namespace mozilla\n\n// Build up the underlying intrinsics.\n#ifdef MOZ_HAVE_CXX11_ATOMICS\n\n#  include <atomic>\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * We provide CompareExchangeFailureOrder to work around a bug in some\n * versions of GCC's <atomic> header.  See bug 898491.\n */\ntemplate<MemoryOrdering Order> struct AtomicOrderConstraints;\n\ntemplate<>\nstruct AtomicOrderConstraints<Relaxed>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;\n    static const std::memory_order LoadOrder = std::memory_order_relaxed;\n    static const std::memory_order StoreOrder = std::memory_order_relaxed;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_relaxed;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<ReleaseAcquire>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;\n    static const std::memory_order LoadOrder = std::memory_order_acquire;\n    static const std::memory_order StoreOrder = std::memory_order_release;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_acquire;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<SequentiallyConsistent>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;\n    static const std::memory_order LoadOrder = std::memory_order_seq_cst;\n    static const std::memory_order StoreOrder = std::memory_order_seq_cst;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_seq_cst;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicBase\n{\n    typedef std::atomic<T> ValueType;\n    typedef AtomicOrderConstraints<Order> OrderedOp;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T load(const typename Base::ValueType& ptr) {\n      return ptr.load(Base::OrderedOp::LoadOrder);\n    }\n    static void store(typename Base::ValueType& ptr, T val) {\n      ptr.store(val, Base::OrderedOp::StoreOrder);\n    }\n    static T exchange(typename Base::ValueType& ptr, T val) {\n      return ptr.exchange(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static bool compareExchange(typename Base::ValueType& ptr, T oldVal, T newVal) {\n      return ptr.compare_exchange_strong(oldVal, newVal,\n                                         Base::OrderedOp::AtomicRMWOrder,\n                                         Base::OrderedOp::CompareExchangeFailureOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T add(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_add(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T sub(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_sub(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>\n{\n    typedef IntrinsicBase<T*, Order> Base;\n    static T* add(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_add(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T* sub(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_sub(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n  private:\n    /*\n     * GCC 4.6's <atomic> header has a bug where adding X to an\n     * atomic<T*> is not the same as adding X to a T*.  Hence the need\n     * for this function to provide the correct addend.\n     */\n    static ptrdiff_t fixupAddend(ptrdiff_t val) {\n#if defined(__clang__) || defined(_MSC_VER)\n      return val;\n#elif defined(__GNUC__) && MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) && \\\n      !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n      return val * sizeof(T);\n#else\n      return val;\n#endif\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T inc(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::add(ptr, 1);\n    }\n    static T dec(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::sub(ptr, 1);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T or_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_or(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T xor_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_xor(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T and_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_and(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order>\n  : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(__GNUC__)\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The __sync_* family of intrinsics is documented here:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Atomic-Builtins.html\n *\n * While these intrinsics are deprecated in favor of the newer __atomic_*\n * family of intrincs:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/_005f_005fatomic-Builtins.html\n *\n * any GCC version that supports the __atomic_* intrinsics will also support\n * the <atomic> header and so will be handled above.  We provide a version of\n * atomics using the __sync_* intrinsics to support older versions of GCC.\n *\n * All __sync_* intrinsics that we use below act as full memory barriers, for\n * both compiler and hardware reordering, except for __sync_lock_test_and_set,\n * which is a only an acquire barrier.  When we call __sync_lock_test_and_set,\n * we add a barrier above it as appropriate.\n */\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * Some processors (in particular, x86) don't require quite so many calls to\n * __sync_sychronize as our specializations of Barrier produce.  If\n * performance turns out to be an issue, defining these specializations\n * on a per-processor basis would be a good first tuning step.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { __sync_synchronize(); }\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() { __sync_synchronize(); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps\n{\n    static T load(const T& ptr) {\n      Barrier<Order>::beforeLoad();\n      T val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(T& ptr, T val) {\n      Barrier<Order>::beforeStore();\n      ptr = val;\n      Barrier<Order>::afterStore();\n    }\n    static T exchange(T& ptr, T val) {\n      // __sync_lock_test_and_set is only an acquire barrier; loads and stores\n      // can't be moved up from after to before it, but they can be moved down\n      // from before to after it.  We may want a stricter ordering, so we need\n      // an explicit barrier.\n\n      Barrier<Order>::beforeStore();\n      return __sync_lock_test_and_set(&ptr, val);\n    }\n    static bool compareExchange(T& ptr, T oldVal, T newVal) {\n      return __sync_bool_compare_and_swap(&ptr, oldVal, newVal);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub\n{\n    typedef T ValueType;\n    static T add(T& ptr, T val) {\n      return __sync_fetch_and_add(&ptr, val);\n    }\n    static T sub(T& ptr, T val) {\n      return __sync_fetch_and_sub(&ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*>\n{\n    typedef T* ValueType;\n    /*\n     * The reinterpret_casts are needed so that\n     * __sync_fetch_and_{add,sub} will properly type-check.\n     *\n     * Also, these functions do not provide standard semantics for\n     * pointer types, so we need to adjust the addend.\n     */\n    static ValueType add(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_add(&ptr, amount);\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_sub(&ptr, amount);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static T inc(T& ptr) { return IntrinsicAddSub<T>::add(ptr, 1); }\n    static T dec(T& ptr) { return IntrinsicAddSub<T>::sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static T or_(T& ptr, T val) {\n      return __sync_fetch_and_or(&ptr, val);\n    }\n    static T xor_(T& ptr, T val) {\n      return __sync_fetch_and_xor(&ptr, val);\n    }\n    static T and_(T& ptr, T val) {\n      return __sync_fetch_and_and(&ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(_MSC_VER)\n\n/*\n * Windows comes with a full complement of atomic operations.\n * Unfortunately, most of those aren't available for Windows XP (even if\n * the compiler supports intrinsics for them), which is the oldest\n * version of Windows we support.  Therefore, we only provide operations\n * on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows\n * versions, we support 64-bit datatypes as well.\n *\n * To avoid namespace pollution issues, we declare whatever functions we\n * need ourselves.\n */\n\nextern \"C\" {\nlong __cdecl _InterlockedExchangeAdd(long volatile* dst, long value);\nlong __cdecl _InterlockedOr(long volatile* dst, long value);\nlong __cdecl _InterlockedXor(long volatile* dst, long value);\nlong __cdecl _InterlockedAnd(long volatile* dst, long value);\nlong __cdecl _InterlockedExchange(long volatile *dst, long value);\nlong __cdecl _InterlockedCompareExchange(long volatile *dst, long newVal, long oldVal);\n}\n\n#  pragma intrinsic(_InterlockedExchangeAdd)\n#  pragma intrinsic(_InterlockedOr)\n#  pragma intrinsic(_InterlockedXor)\n#  pragma intrinsic(_InterlockedAnd)\n#  pragma intrinsic(_InterlockedExchange)\n#  pragma intrinsic(_InterlockedCompareExchange)\n\nnamespace mozilla {\nnamespace detail {\n\n#  if !defined(_M_IX86) && !defined(_M_X64)\n     /*\n      * The implementations below are optimized for x86ish systems.  You\n      * will have to modify them if you are porting to Windows on a\n      * different architecture.\n      */\n#    error \"Unknown CPU type\"\n#  endif\n\n/*\n * The PrimitiveIntrinsics template should define |Type|, the datatype of size\n * DataSize upon which we operate, and the following eight functions.\n *\n * static Type add(Type* ptr, Type val);\n * static Type sub(Type* ptr, Type val);\n * static Type or_(Type* ptr, Type val);\n * static Type xor_(Type* ptr, Type val);\n * static Type and_(Type* ptr, Type val);\n *\n *   These functions perform the obvious operation on the value contained in\n *   |*ptr| combined with |val| and return the value previously stored in\n *   |*ptr|.\n *\n * static void store(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and must provide a full\n *   memory fence after the store to prevent compiler and hardware instruction\n *   reordering.  It should also act as a compiler barrier to prevent reads and\n *   writes from moving to after the store.\n *\n * static Type exchange(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and returns the previous\n *   contents of *ptr;\n *\n * static bool compareExchange(Type* ptr, Type oldVal, Type newVal);\n *\n *   This function atomically performs the following operation:\n *\n *     if (*ptr == oldVal) {\n *       *ptr = newVal;\n *       return true;\n *     } else {\n *       return false;\n *     }\n *\n */\ntemplate<size_t DataSize> struct PrimitiveIntrinsics;\n\ntemplate<>\nstruct PrimitiveIntrinsics<4>\n{\n    typedef long Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * _InterlockedExchangeSubtract isn't available before Windows 7,\n       * and we must support Windows XP.\n       */\n      return _InterlockedExchangeAdd(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  if defined(_M_X64)\n\nextern \"C\" {\nlong long __cdecl _InterlockedExchangeAdd64(long long volatile* dst,\n                                            long long value);\nlong long __cdecl _InterlockedOr64(long long volatile* dst,\n                                   long long value);\nlong long __cdecl _InterlockedXor64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedAnd64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedExchange64(long long volatile* dst,\n                                         long long value);\nlong long __cdecl _InterlockedCompareExchange64(long long volatile* dst,\n                                                long long newVal,\n                                                long long oldVal);\n}\n\n#    pragma intrinsic(_InterlockedExchangeAdd64)\n#    pragma intrinsic(_InterlockedOr64)\n#    pragma intrinsic(_InterlockedXor64)\n#    pragma intrinsic(_InterlockedAnd64)\n#    pragma intrinsic(_InterlockedExchange64)\n#    pragma intrinsic(_InterlockedCompareExchange64)\n\ntemplate <>\nstruct PrimitiveIntrinsics<8>\n{\n    typedef __int64 Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd64(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * There is no _InterlockedExchangeSubtract64.\n       */\n      return _InterlockedExchangeAdd64(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr64(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor64(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd64(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange64(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange64(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange64(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  endif\n\nextern \"C\" { void _ReadWriteBarrier(); }\n\n#  pragma intrinsic(_ReadWriteBarrier)\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * We do not provide an afterStore method in Barrier, as Relaxed and\n * ReleaseAcquire orderings do not require one, and the required barrier\n * for SequentiallyConsistent is handled by PrimitiveIntrinsics.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { _ReadWriteBarrier(); }\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper\n{\n  static PrimType toPrimType(T val) { return static_cast<PrimType>(val); }\n  static T fromPrimType(PrimType val) { return static_cast<T>(val); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper<PrimType, T*>\n{\n  static PrimType toPrimType(T* val) { return reinterpret_cast<PrimType>(val); }\n  static T* fromPrimType(PrimType val) { return reinterpret_cast<T*>(val); }\n};\n\ntemplate<typename T>\nstruct IntrinsicBase\n{\n    typedef T ValueType;\n    typedef PrimitiveIntrinsics<sizeof(T)> Primitives;\n    typedef typename Primitives::Type PrimType;\n    static_assert(sizeof(PrimType) == sizeof(T),\n                  \"Selection of PrimitiveIntrinsics was wrong\");\n    typedef CastHelper<PrimType, T> Cast;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T>\n{\n    static ValueType load(const ValueType& ptr) {\n      Barrier<Order>::beforeLoad();\n      ValueType val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(ValueType& ptr, ValueType val) {\n      // For SequentiallyConsistent, Primitives::store() will generate the\n      // proper memory fence.  Everything else just needs a barrier before\n      // the store.\n      if (Order == SequentiallyConsistent) {\n        Primitives::store(reinterpret_cast<PrimType*>(&ptr),\n                          Cast::toPrimType(val));\n      } else {\n        Barrier<Order>::beforeStore();\n        ptr = val;\n      }\n    }\n    static ValueType exchange(ValueType& ptr, ValueType val) {\n      PrimType oldval =\n        Primitives::exchange(reinterpret_cast<PrimType*>(&ptr),\n                             Cast::toPrimType(val));\n      return Cast::fromPrimType(oldval);\n    }\n    static bool compareExchange(ValueType& ptr, ValueType oldVal, ValueType newVal) {\n      return Primitives::compareExchange(reinterpret_cast<PrimType*>(&ptr),\n                                         Cast::toPrimType(oldVal),\n                                         Cast::toPrimType(newVal));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicApplyHelper : public IntrinsicBase<T>\n{\n    typedef PrimType (*BinaryOp)(PrimType*, PrimType);\n    typedef PrimType (*UnaryOp)(PrimType*);\n\n    static ValueType applyBinaryFunction(BinaryOp op, ValueType& ptr,\n                                         ValueType val) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      PrimType primTypeVal = Cast::toPrimType(val);\n      return Cast::fromPrimType(op(primTypePtr, primTypeVal));\n    }\n\n    static ValueType applyUnaryFunction(UnaryOp op, ValueType& ptr) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      return Cast::fromPrimType(op(primTypePtr));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub : public IntrinsicApplyHelper<T>\n{\n    static ValueType add(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::add, ptr, val);\n    }\n    static ValueType sub(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::sub, ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*> : public IntrinsicApplyHelper<T*>\n{\n    static ValueType add(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::add, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::sub, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static ValueType inc(ValueType& ptr) { return add(ptr, 1); }\n    static ValueType dec(ValueType& ptr) { return sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static ValueType or_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::or_, ptr, val);\n    }\n    static ValueType xor_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::xor_, ptr, val);\n    }\n    static ValueType and_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::and_, ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#else\n# error \"Atomic compiler intrinsics are not supported on your platform\"\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBase\n{\n    // We only support 32-bit types on 32-bit Windows, which constrains our\n    // implementation elsewhere.  But we support pointer-sized types everywhere.\n    static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),\n                  \"mozilla/Atomics.h only supports 32-bit and pointer-sized types\");\n\n  protected:\n    typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;\n    typename Intrinsics::ValueType mValue;\n\n  public:\n    AtomicBase() : mValue() {}\n    AtomicBase(T aInit) { Intrinsics::store(mValue, aInit); }\n\n    operator T() const { return Intrinsics::load(mValue); }\n\n    T operator=(T aValue) {\n      Intrinsics::store(mValue, aValue);\n      return aValue;\n    }\n\n    /**\n     * Performs an atomic swap operation.  aValue is stored and the previous\n     * value of this variable is returned.\n     */\n    T exchange(T aValue) {\n      return Intrinsics::exchange(mValue, aValue);\n    }\n\n    /**\n     * Performs an atomic compare-and-swap operation and returns true if it\n     * succeeded. This is equivalent to atomically doing\n     *\n     *   if (mValue == aOldValue) {\n     *     mValue = aNewValue;\n     *     return true;\n     *   } else {\n     *     return false;\n     *   }\n     */\n    bool compareExchange(T aOldValue, T aNewValue) {\n      return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);\n    }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBaseIncDec : public AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    AtomicBaseIncDec() : Base() {}\n    AtomicBaseIncDec(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }\n    T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }\n    T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }\n    T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\n} // namespace detail\n\n/**\n * A wrapper for a type that enforces that all memory accesses are atomic.\n *\n * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in\n * its place.  Implementations for integral and pointer types are provided\n * below.\n *\n * Atomic accesses are sequentially consistent by default.  You should\n * use the default unless you are tall enough to ride the\n * memory-ordering roller coaster (if you're not sure, you aren't) and\n * you have a compelling reason to do otherwise.\n *\n * There is one exception to the case of atomic memory accesses: providing an\n * initial value of the atomic value is not guaranteed to be atomic.  This is a\n * deliberate design choice that enables static atomic variables to be declared\n * without introducing extra static constructors.\n */\ntemplate<typename T,\n         MemoryOrdering Order = SequentiallyConsistent,\n         typename Enable = void>\nclass Atomic;\n\n/**\n * Atomic<T> implementation for integral types.\n *\n * In addition to atomic store and load operations, compound assignment and\n * increment/decrement operators are implemented which perform the\n * corresponding read-modify-write operation atomically.  Finally, an atomic\n * swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsIntegral<T>::value>::Type>\n  : public detail::AtomicBaseIncDec<T, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator+=(T delta) { return Base::Intrinsics::add(Base::mValue, delta) + delta; }\n    T operator-=(T delta) { return Base::Intrinsics::sub(Base::mValue, delta) - delta; }\n    T operator|=(T val) { return Base::Intrinsics::or_(Base::mValue, val) | val; }\n    T operator^=(T val) { return Base::Intrinsics::xor_(Base::mValue, val) ^ val; }\n    T operator&=(T val) { return Base::Intrinsics::and_(Base::mValue, val) & val; }\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for pointer types.\n *\n * An atomic compare-and-swap primitive for pointer variables is provided, as\n * are atomic increment and decement operators.  Also provided are the compound\n * assignment operators for addition and subtraction. Atomic swap (via\n * exchange()) is included as well.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T*, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T* aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T* operator+=(ptrdiff_t delta) {\n      return Base::Intrinsics::add(Base::mValue, delta) + delta;\n    }\n    T* operator-=(ptrdiff_t delta) {\n      return Base::Intrinsics::sub(Base::mValue, delta) - delta;\n    }\n\n  private:\n    Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for enum types.\n *\n * The atomic store and load operations and the atomic swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>\n  : public detail::AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Atomics_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Attributes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of various class and method modifier attributes. */\n\n#ifndef mozilla_Attributes_h\n#define mozilla_Attributes_h\n\n#include \"mozilla/Compiler.h\"\n\n/*\n * MOZ_INLINE is a macro which expands to tell the compiler that the method\n * decorated with it should be inlined.  This macro is usable from C and C++\n * code, even though C89 does not support the |inline| keyword.  The compiler\n * may ignore this directive if it chooses.\n */\n#if defined(__cplusplus)\n#  define MOZ_INLINE            inline\n#elif defined(_MSC_VER)\n#  define MOZ_INLINE            __inline\n#elif defined(__GNUC__)\n#  define MOZ_INLINE            __inline__\n#else\n#  define MOZ_INLINE            inline\n#endif\n\n/*\n * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must be inlined, even if the compiler thinks\n * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:\n * compilers are not guaranteed to respect it (although they're much more likely\n * to do so).\n *\n * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the\n * compiler to inline even in DEBUG builds. It should be used very rarely.\n */\n#if defined(_MSC_VER)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __forceinline\n#elif defined(__GNUC__)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     MOZ_INLINE\n#endif\n\n#if defined(DEBUG)\n#  define MOZ_ALWAYS_INLINE     MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG\n#endif\n\n/*\n * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality\n * without warnings (functionality used by the macros below).  These modes are\n * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more\n * standardly, by checking whether __cplusplus has a C++11 or greater value.\n * Current versions of g++ do not correctly set __cplusplus, so we check both\n * for forward compatibility.\n */\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_constexpr)\n#    define MOZ_HAVE_CXX11_CONSTEXPR\n#  endif\n#  if __has_extension(cxx_deleted_functions)\n#    define MOZ_HAVE_CXX11_DELETE\n#  endif\n#  if __has_extension(cxx_override_control)\n#    define MOZ_HAVE_CXX11_OVERRIDE\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  endif\n#  if __has_attribute(noinline)\n#    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))\n#  endif\n#  if __has_attribute(noreturn)\n#    define MOZ_HAVE_NORETURN            __attribute__((noreturn))\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_OVERRIDE\n#      define MOZ_HAVE_CXX11_FINAL       final\n#    endif\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_CONSTEXPR\n#    endif\n#    define MOZ_HAVE_CXX11_DELETE\n#  else\n     /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_FINAL       __final\n#    endif\n#  endif\n#  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))\n#  define MOZ_HAVE_NORETURN              __attribute__((noreturn))\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  else\n     /* MSVC <= 10 used to spell \"final\" as \"sealed\". */\n#    define MOZ_HAVE_CXX11_FINAL         sealed\n#  endif\n#  define MOZ_HAVE_CXX11_OVERRIDE\n#  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)\n#  define MOZ_HAVE_NORETURN              __declspec(noreturn)\n#endif\n\n/*\n * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a\n * function at compile time. A constexpr function cannot examine any values\n * except its arguments and can have no side effects except its return value.\n * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's\n * value may be computed at compile time.  It should be prefered to just\n * marking variables as MOZ_CONSTEXPR because if the compiler does not support\n * constexpr it will fall back to making the variable const, and some compilers\n * do not accept variables being marked both const and constexpr.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_CONSTEXPR         constexpr\n#  define MOZ_CONSTEXPR_VAR     constexpr\n#else\n#  define MOZ_CONSTEXPR         /* no support */\n#  define MOZ_CONSTEXPR_VAR     const\n#endif\n\n/*\n * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must never be inlined, even if the compiler would\n * otherwise choose to inline the method.  Compilers aren't absolutely\n * guaranteed to support this, but most do.\n */\n#if defined(MOZ_HAVE_NEVER_INLINE)\n#  define MOZ_NEVER_INLINE      MOZ_HAVE_NEVER_INLINE\n#else\n#  define MOZ_NEVER_INLINE      /* no support */\n#endif\n\n/*\n * MOZ_NORETURN, specified at the start of a function declaration, indicates\n * that the given function does not return.  (The function definition does not\n * need to be annotated.)\n *\n *   MOZ_NORETURN void abort(const char* msg);\n *\n * This modifier permits the compiler to optimize code assuming a call to such a\n * function will never return.  It also enables the compiler to avoid spurious\n * warnings about not initializing variables, or about any other seemingly-dodgy\n * operations performed after the function returns.\n *\n * This modifier does not affect the corresponding function's linking behavior.\n */\n#if defined(MOZ_HAVE_NORETURN)\n#  define MOZ_NORETURN          MOZ_HAVE_NORETURN\n#else\n#  define MOZ_NORETURN          /* no support */\n#endif\n\n/*\n * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time\n * instrumentation shipped with Clang) to not instrument the annotated function.\n * Furthermore, it will prevent the compiler from inlining the function because\n * inlining currently breaks the blacklisting mechanism of AddressSanitizer.\n */\n#if defined(MOZ_ASAN)\n#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis))\n# else\n#  define MOZ_ASAN_BLACKLIST\n#endif\n\n\n#ifdef __cplusplus\n\n/*\n * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-\n * method declaration, attempts to delete that method from the corresponding\n * class.  An attempt to use the method will always produce an error *at compile\n * time* (instead of sometimes as late as link time) when this macro can be\n * implemented.  For example, you can use MOZ_DELETE to produce classes with no\n * implicit copy constructor or assignment operator:\n *\n *   struct NonCopyable\n *   {\n *     private:\n *       NonCopyable(const NonCopyable& other) MOZ_DELETE;\n *       void operator=(const NonCopyable& other) MOZ_DELETE;\n *   };\n *\n * If MOZ_DELETE can't be implemented for the current compiler, use of the\n * annotated method will still cause an error, but the error might occur at link\n * time in some cases rather than at compile time.\n *\n * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a\n * backstop, method declarations using MOZ_DELETE should be private.\n */\n#if defined(MOZ_HAVE_CXX11_DELETE)\n#  define MOZ_DELETE            = delete\n#else\n#  define MOZ_DELETE            /* no support */\n#endif\n\n/*\n * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class\n * overrides a member function of a base class, rather than potentially being a\n * new member function.  MOZ_OVERRIDE should be placed immediately before the\n * ';' terminating the member function's declaration, or before '= 0;' if the\n * member function is pure.  If the member function is defined in the class\n * definition, it should appear before the opening brace of the function body.\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() = 0;\n *   };\n *   class Derived1 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE;\n *   };\n *   class Derived2 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE = 0;\n *   };\n *   class Derived3 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE { }\n *   };\n *\n * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that\n * the function marked with it override a member function of a base class: it\n * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect\n * semantics and merely documents the override relationship to the reader (but\n * of course must still be used correctly to not break C++11 compilers).\n */\n#if defined(MOZ_HAVE_CXX11_OVERRIDE)\n#  define MOZ_OVERRIDE          override\n#else\n#  define MOZ_OVERRIDE          /* no support */\n#endif\n\n/*\n * MOZ_FINAL indicates that some functionality cannot be overridden through\n * inheritance.  It can be used to annotate either classes/structs or virtual\n * member functions.\n *\n * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after\n * the name of the class, before the list of classes from which it derives (if\n * any) and before its opening brace.  MOZ_FINAL must not be used to annotate\n * unnamed classes or structs.  (With some compilers, and with C++11 proper, the\n * underlying expansion is ambiguous with specifying a class name.)\n *\n *   class Base MOZ_FINAL\n *   {\n *     public:\n *       Base();\n *       ~Base();\n *       virtual void f() { }\n *   };\n *   // This will be an error in some compilers:\n *   class Derived : public Base\n *   {\n *     public:\n *       ~Derived() { }\n *   };\n *\n * One particularly common reason to specify MOZ_FINAL upon a class is to tell\n * the compiler that it's not dangerous for it to have a non-virtual destructor\n * yet have one or more virtual functions, silencing the warning it might emit\n * in this case.  Suppose Base above weren't annotated with MOZ_FINAL.  Because\n * ~Base() is non-virtual, an attempt to delete a Derived* through a Base*\n * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen.\n * (Formally C++ says behavior is undefined, but compilers will likely just call\n * ~Base() and not ~Derived().)  Specifying MOZ_FINAL tells the compiler that\n * it's safe for the destructor to be non-virtual.\n *\n * In compilers implementing final controls, it is an error to inherit from a\n * class annotated with MOZ_FINAL.  In other compilers it serves only as\n * documentation.\n *\n * To annotate a virtual member function with MOZ_FINAL, place MOZ_FINAL\n * immediately before the ';' terminating the member function's declaration, or\n * before '= 0;' if the member function is pure.  If the member function is\n * defined in the class definition, it should appear before the opening brace of\n * the function body.  (This placement is identical to that for MOZ_OVERRIDE.\n * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE'\n * for consistency.)\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() MOZ_FINAL;\n *   };\n *   class Derived\n *   {\n *     public:\n *       // This will be an error in some compilers:\n *       virtual void f();\n *   };\n *\n * In compilers implementing final controls, it is an error for a derived class\n * to override a method annotated with MOZ_FINAL.  In other compilers it serves\n * only as documentation.\n */\n#if defined(MOZ_HAVE_CXX11_FINAL)\n#  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL\n#else\n#  define MOZ_FINAL             /* no support */\n#endif\n\n/**\n * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's\n * return value is not used by the caller.\n *\n * Place this attribute at the very beginning of a function definition. For\n * example, write\n *\n *   MOZ_WARN_UNUSED_RESULT int foo();\n *\n * or\n *\n *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }\n */\n#if defined(__GNUC__) || defined(__clang__)\n#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))\n#else\n#  define MOZ_WARN_UNUSED_RESULT\n#endif\n\n/*\n * The following macros are attributes that support the static analysis plugin\n * included with Mozilla, and will be implemented (when such support is enabled)\n * as C++11 attributes. Since such attributes are legal pretty much everywhere\n * and have subtly different semantics depending on their placement, the\n * following is a guide on where to place the attributes.\n *\n * Attributes that apply to a struct or class precede the name of the class:\n * (Note that this is different from the placement of MOZ_FINAL for classes!)\n *\n *   class MOZ_CLASS_ATTRIBUTE SomeClass {};\n *\n * Attributes that apply to functions follow the parentheses and const\n * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body:\n *\n *   void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE;\n *   void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {}\n *   void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0;\n *   void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE;\n *\n * Attributes that apply to variables or parameters follow the variable's name:\n *\n *   int variable MOZ_VARIABLE_ATTRIBUTE;\n *\n * Attributes that apply to types follow the type name:\n *\n *   typedef int MOZ_TYPE_ATTRIBUTE MagicInt;\n *   int MOZ_TYPE_ATTRIBUTE someVariable;\n *   int * MOZ_TYPE_ATTRIBUTE magicPtrInt;\n *   int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt;\n *\n * Attributes that apply to statements precede the statement:\n *\n *   MOZ_IF_ATTRIBUTE if (x == 0)\n *   MOZ_DO_ATTRIBUTE do { } while(0);\n *\n * Attributes that apply to labels precede the label:\n *\n *   MOZ_LABEL_ATTRIBUTE target:\n *     goto target;\n *   MOZ_CASE_ATTRIBUTE case 5:\n *   MOZ_DEFAULT_ATTRIBUTE default:\n *\n * The static analyses that are performed by the plugin are as follows:\n *\n * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate\n *   subclasses must provide an exact override of this method; if a subclass\n *   does not override this method, the compiler will emit an error. This\n *   attribute is not limited to virtual methods, so if it is applied to a\n *   nonvirtual method and the subclass does not provide an equivalent\n *   definition, the compiler will emit an error.\n * MOZ_STACK_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack, so it is a compile-time error to use it, or\n *   an array of such objects, as a global or static variable, or as the type of\n *   a new expression (unless placement new is being used). If a member of\n *   another class uses this class, or if another class inherits from this\n *   class, then it is considered to be a stack class as well, although this\n *   attribute need not be provided in such cases.\n * MOZ_NONHEAP_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack or in static storage, so it is a compile-time\n *   error to use it, or an array of such objects, as the type of a new\n *   expression (unless placement new is being used). If a member of another\n *   class uses this class, or if another class inherits from this class, then\n *   it is considered to be a non-heap class as well, although this attribute\n *   need not be provided in such cases.\n */\n#ifdef MOZ_CLANG_PLUGIN\n# define MOZ_MUST_OVERRIDE __attribute__((annotate(\"moz_must_override\")))\n# define MOZ_STACK_CLASS __attribute__((annotate(\"moz_stack_class\")))\n# define MOZ_NONHEAP_CLASS __attribute__((annotate(\"moz_nonheap_class\")))\n#else\n# define MOZ_MUST_OVERRIDE /* nothing */\n# define MOZ_STACK_CLASS /* nothing */\n# define MOZ_NONHEAP_CLASS /* nothing */\n#endif /* MOZ_CLANG_PLUGIN */\n\n/*\n * MOZ_THIS_IN_INITIALIZER_LIST is used to avoid a warning when we know that\n * it's safe to use 'this' in an initializer list.\n */\n#ifdef _MSC_VER\n#  define MOZ_THIS_IN_INITIALIZER_LIST() \\\n     __pragma(warning(push)) \\\n     __pragma(warning(disable:4355)) \\\n     this \\\n     __pragma(warning(pop))\n#else\n#  define MOZ_THIS_IN_INITIALIZER_LIST() this\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_Attributes_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/BloomFilter.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A counting Bloom filter implementation.  This allows consumers to\n * do fast probabilistic \"is item X in set Y?\" testing which will\n * never answer \"no\" when the correct answer is \"yes\" (but might\n * incorrectly answer \"yes\" when the correct answer is \"no\").\n */\n\n#ifndef mozilla_BloomFilter_h\n#define mozilla_BloomFilter_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Likely.h\"\n#include \"mozilla/Util.h\"\n\n#include <stdint.h>\n#include <string.h>\n\nnamespace mozilla {\n\n/*\n * This class implements a counting Bloom filter as described at\n * <http://en.wikipedia.org/wiki/Bloom_filter#Counting_filters>, with\n * 8-bit counters.  This allows quick probabilistic answers to the\n * question \"is object X in set Y?\" where the contents of Y might not\n * be time-invariant.  The probabilistic nature of the test means that\n * sometimes the answer will be \"yes\" when it should be \"no\".  If the\n * answer is \"no\", then X is guaranteed not to be in Y.\n *\n * The filter is parametrized on KeySize, which is the size of the key\n * generated by each of hash functions used by the filter, in bits,\n * and the type of object T being added and removed.  T must implement\n * a |uint32_t hash() const| method which returns a uint32_t hash key\n * that will be used to generate the two separate hash functions for\n * the Bloom filter.  This hash key MUST be well-distributed for good\n * results!  KeySize is not allowed to be larger than 16.\n *\n * The filter uses exactly 2**KeySize bytes of memory.  From now on we\n * will refer to the memory used by the filter as M.\n *\n * The expected rate of incorrect \"yes\" answers depends on M and on\n * the number N of objects in set Y.  As long as N is small compared\n * to M, the rate of such answers is expected to be approximately\n * 4*(N/M)**2 for this filter.  In practice, if Y has a few hundred\n * elements then using a KeySize of 12 gives a reasonably low\n * incorrect answer rate.  A KeySize of 12 has the additional benefit\n * of using exactly one page for the filter in typical hardware\n * configurations.\n */\n\ntemplate<unsigned KeySize, class T>\nclass BloomFilter\n{\n    /*\n     * A counting Bloom filter with 8-bit counters.  For now we assume\n     * that having two hash functions is enough, but we may revisit that\n     * decision later.\n     *\n     * The filter uses an array with 2**KeySize entries.\n     *\n     * Assuming a well-distributed hash function, a Bloom filter with\n     * array size M containing N elements and\n     * using k hash function has expected false positive rate exactly\n     *\n     * $  (1 - (1 - 1/M)^{kN})^k  $\n     *\n     * because each array slot has a\n     *\n     * $  (1 - 1/M)^{kN}  $\n     *\n     * chance of being 0, and the expected false positive rate is the\n     * probability that all of the k hash functions will hit a nonzero\n     * slot.\n     *\n     * For reasonable assumptions (M large, kN large, which should both\n     * hold if we're worried about false positives) about M and kN this\n     * becomes approximately\n     *\n     * $$  (1 - \\exp(-kN/M))^k   $$\n     *\n     * For our special case of k == 2, that's $(1 - \\exp(-2N/M))^2$,\n     * or in other words\n     *\n     * $$    N/M = -0.5 * \\ln(1 - \\sqrt(r))   $$\n     *\n     * where r is the false positive rate.  This can be used to compute\n     * the desired KeySize for a given load N and false positive rate r.\n     *\n     * If N/M is assumed small, then the false positive rate can\n     * further be approximated as 4*N^2/M^2.  So increasing KeySize by\n     * 1, which doubles M, reduces the false positive rate by about a\n     * factor of 4, and a false positive rate of 1% corresponds to\n     * about M/N == 20.\n     *\n     * What this means in practice is that for a few hundred keys using a\n     * KeySize of 12 gives false positive rates on the order of 0.25-4%.\n     *\n     * Similarly, using a KeySize of 10 would lead to a 4% false\n     * positive rate for N == 100 and to quite bad false positive\n     * rates for larger N.\n     */\n  public:\n    BloomFilter() {\n        static_assert(KeySize <= keyShift, \"KeySize too big\");\n\n        // Should we have a custom operator new using calloc instead and\n        // require that we're allocated via the operator?\n        clear();\n    }\n\n    /*\n     * Clear the filter.  This should be done before reusing it, because\n     * just removing all items doesn't clear counters that hit the upper\n     * bound.\n     */\n    void clear();\n\n    /*\n     * Add an item to the filter.\n     */\n    void add(const T* t);\n\n    /*\n     * Remove an item from the filter.\n     */\n    void remove(const T* t);\n\n    /*\n     * Check whether the filter might contain an item.  This can\n     * sometimes return true even if the item is not in the filter,\n     * but will never return false for items that are actually in the\n     * filter.\n     */\n    bool mightContain(const T* t) const;\n\n    /*\n     * Methods for add/remove/contain when we already have a hash computed\n     */\n    void add(uint32_t hash);\n    void remove(uint32_t hash);\n    bool mightContain(uint32_t hash) const;\n\n  private:\n    static const size_t arraySize = (1 << KeySize);\n    static const uint32_t keyMask = (1 << KeySize) - 1;\n    static const uint32_t keyShift = 16;\n\n    static uint32_t hash1(uint32_t hash) { return hash & keyMask; }\n    static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; }\n\n    uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; }\n    uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; }\n    const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; }\n    const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; }\n\n    static bool full(const uint8_t& slot) { return slot == UINT8_MAX; }\n\n    uint8_t counters[arraySize];\n};\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::clear()\n{\n  memset(counters, 0, arraySize);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::add(uint32_t hash)\n{\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    ++slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    ++slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::add(const T* t)\n{\n  uint32_t hash = t->hash();\n  return add(hash);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::remove(uint32_t hash)\n{\n  // If the slots are full, we don't know whether we bumped them to be\n  // there when we added or not, so just leave them full.\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    --slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    --slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::remove(const T* t)\n{\n  uint32_t hash = t->hash();\n  remove(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(uint32_t hash) const\n{\n  // Check that all the slots for this hash contain something\n  return firstSlot(hash) && secondSlot(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(const T* t) const\n{\n  uint32_t hash = t->hash();\n  return mightContain(hash);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_BloomFilter_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Casting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cast operations to supplement the built-in casting operations. */\n\n#ifndef mozilla_Casting_h\n#define mozilla_Casting_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <limits.h>\n\nnamespace mozilla {\n\n/**\n * Return a value of type |To|, containing the underlying bit pattern of |from|.\n *\n * |To| and |From| must be types of the same size; be careful of cross-platform\n * size differences, or this might fail to compile on some but not all\n * platforms.\n */\ntemplate<typename To, typename From>\ninline To\nBitwiseCast(const From from)\n{\n  static_assert(sizeof(From) == sizeof(To),\n                \"To and From must have the same size\");\n  union {\n    From from;\n    To to;\n  } u;\n  u.from = from;\n  return u.to;\n}\n\nnamespace detail {\n\nenum ToSignedness { ToIsSigned, ToIsUnsigned };\nenum FromSignedness { FromIsSigned, FromIsUnsigned };\n\ntemplate<typename From,\n         typename To,\n         FromSignedness = IsSigned<From>::value ? FromIsSigned : FromIsUnsigned,\n         ToSignedness = IsSigned<To>::value ? ToIsSigned : ToIsUnsigned>\nstruct BoundsCheckImpl;\n\n// Implicit conversions on operands to binary operations make this all a bit\n// hard to verify.  Attempt to ease the pain below by *only* comparing values\n// that are obviously the same type (and will undergo no further conversions),\n// even when it's not strictly necessary, for explicitness.\n\nenum UUComparison { FromIsBigger, FromIsNotBigger };\n\n// Unsigned-to-unsigned range check\n\ntemplate<typename From, typename To,\n         UUComparison = (sizeof(From) > sizeof(To)) ? FromIsBigger : FromIsNotBigger>\nstruct UnsignedUnsignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return from <= From(To(-1));\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsNotBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedUnsignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-unsigned range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (from < 0)\n        return false;\n      if (sizeof(To) >= sizeof(From))\n        return true;\n      return from <= From(To(-1));\n    }\n};\n\n// Unsigned-to-signed range check\n\nenum USComparison { FromIsSmaller, FromIsNotSmaller };\n\ntemplate<typename From, typename To,\n         USComparison = (sizeof(From) < sizeof(To)) ? FromIsSmaller : FromIsNotSmaller>\nstruct UnsignedSignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsNotSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      return from <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedSignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-signed range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (sizeof(From) <= sizeof(To))\n        return true;\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      const To MinValue = -MaxValue - To(1);\n      return From(MinValue) <= from &&\n             From(from) <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To,\n         bool TypesAreIntegral = IsIntegral<From>::value && IsIntegral<To>::value>\nclass BoundsChecker;\n\ntemplate<typename From>\nclass BoundsChecker<From, From, true>\n{\n  public:\n    static bool checkBounds(const From from) { return true; }\n};\n\ntemplate<typename From, typename To>\nclass BoundsChecker<From, To, true>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return BoundsCheckImpl<From, To>::checkBounds(from);\n    }\n};\n\ntemplate<typename From, typename To>\ninline bool\nIsInBounds(const From from)\n{\n  return BoundsChecker<From, To>::checkBounds(from);\n}\n\n} // namespace detail\n\n/**\n * Cast a value of integral type |From| to a value of integral type |To|,\n * asserting that the cast will be a safe cast per C++ (that is, that |to| is in\n * the range of values permitted for the type |From|).\n */\ntemplate<typename To, typename From>\ninline To\nSafeCast(const From from)\n{\n  MOZ_ASSERT((detail::IsInBounds<From, To>(from)));\n  return static_cast<To>(from);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Casting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Char16.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implements a UTF-16 character type. */\n\n#ifndef mozilla_Char16_h\n#define mozilla_Char16_h\n\n#include \"mozilla/Assertions.h\"\n\n/*\n * C11 and C++11 introduce a char16_t type and support for UTF-16 string and\n * character literals. C++11's char16_t is a distinct builtin type. C11's\n * char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit\n * code unit of a Unicode code point, not a \"character\".\n *\n * For now, Char16.h only supports C++ because we don't want mix different C\n * and C++ definitions of char16_t in the same code base.\n */\n\n#ifdef _MSC_VER\n   /*\n    * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h\n    * typedefs char16_t as an unsigned short. We would like to alias char16_t\n    * to Windows's 16-bit wchar_t so we can declare UTF-16 literals as constant\n    * expressions (and pass char16_t pointers to Windows APIs). We #define our\n    * char16_t as a macro to override yval.h's typedef of the same name.\n    */\n#  define MOZ_UTF16_HELPER(s) L##s\n#  include <yvals.h>\n#  define char16_t wchar_t\n#elif defined(__cplusplus) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))\n   /* C++11 has a builtin char16_t type. */\n#  define MOZ_UTF16_HELPER(s) u##s\n#else\n#  error \"Char16.h requires C++11 (or something like it) for UTF-16 support.\"\n#endif\n\n/*\n * Macro arguments used in concatenation or stringification won't be expanded.\n * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to\n * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper\n * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro\n * argument to expand. See \"3.10.6 Separate Expansion of Macro Arguments\" of the\n * CPP manual for a more accurate and precise explanation.\n */\n#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)\n\nstatic_assert(sizeof(char16_t) == 2, \"Is char16_t type 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16('A')) == 2, \"Is char literal 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16(\"\")[0]) == 2, \"Is string char 16 bits?\");\n\n#endif /* mozilla_Char16_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/CheckedInt.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Provides checked integers, detecting integer overflow and divide-by-0. */\n\n#ifndef mozilla_CheckedInt_h\n#define mozilla_CheckedInt_h\n\n// Enable relying of Mozilla's MFBT for possibly-available C++11 features\n#define MOZ_CHECKEDINT_USE_MFBT\n\n#include <stdint.h>\n\n#ifdef MOZ_CHECKEDINT_USE_MFBT\n#  include \"mozilla/Assertions.h\"\n#else\n#  include <cassert>\n#  define MOZ_ASSERT(cond, reason) assert((cond) && reason)\n#  define MOZ_DELETE\n#endif\n\n#include <climits>\n#include <cstddef>\n\nnamespace mozilla {\n\ntemplate<typename T> class CheckedInt;\n\nnamespace detail {\n\n/*\n * Step 1: manually record supported types\n *\n * What's nontrivial here is that there are different families of integer\n * types: basic integer types and stdint types. It is merrily undefined which\n * types from one family may be just typedefs for a type from another family.\n *\n * For example, on GCC 4.6, aside from the basic integer types, the only other\n * type that isn't just a typedef for some of them, is int8_t.\n */\n\nstruct UnsupportedType {};\n\ntemplate<typename IntegerType>\nstruct IsSupportedPass2\n{\n    static const bool value = false;\n};\n\ntemplate<typename IntegerType>\nstruct IsSupported\n{\n    static const bool value = IsSupportedPass2<IntegerType>::value;\n};\n\ntemplate<>\nstruct IsSupported<int8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int64_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint64_t>\n{ static const bool value = true; };\n\n\ntemplate<>\nstruct IsSupportedPass2<char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<signed char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long long>\n{ static const bool value = true; };\n\n/*\n * Step 2: some integer-traits kind of stuff.\n */\n\ntemplate<size_t Size, bool Signedness>\nstruct StdintTypeForSizeAndSignedness\n{};\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, true>\n{ typedef int8_t   Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, false>\n{ typedef uint8_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, true>\n{ typedef int16_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, false>\n{ typedef uint16_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, true>\n{ typedef int32_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, false>\n{ typedef uint32_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, true>\n{ typedef int64_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, false>\n{ typedef uint64_t Type; };\n\ntemplate<typename IntegerType>\nstruct UnsignedType\n{\n    typedef typename StdintTypeForSizeAndSignedness<sizeof(IntegerType),\n                                                    false>::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct IsSigned\n{\n    static const bool value = IntegerType(-1) <= IntegerType(0);\n};\n\ntemplate<typename IntegerType, size_t Size = sizeof(IntegerType)>\nstruct TwiceBiggerType\n{\n    typedef typename StdintTypeForSizeAndSignedness<\n                       sizeof(IntegerType) * 2,\n                       IsSigned<IntegerType>::value\n                     >::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct TwiceBiggerType<IntegerType, 8>\n{\n    typedef UnsupportedType Type;\n};\n\ntemplate<typename IntegerType>\nstruct PositionOfSignBit\n{\n    static const size_t value = CHAR_BIT * sizeof(IntegerType) - 1;\n};\n\ntemplate<typename IntegerType>\nstruct MinValue\n{\n  private:\n    typedef typename UnsignedType<IntegerType>::Type UnsignedIntegerType;\n    static const size_t PosOfSignBit = PositionOfSignBit<IntegerType>::value;\n\n  public:\n    // Bitwise ops may return a larger type, that's why we cast explicitly.\n    // In C++, left bit shifts on signed values is undefined by the standard\n    // unless the shifted value is representable.\n    // Notice that signed-to-unsigned conversions are always well-defined in\n    // the standard as the value congruent to 2**n, as expected. By contrast,\n    // unsigned-to-signed is only well-defined if the value is representable.\n    static const IntegerType value =\n        IsSigned<IntegerType>::value\n        ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit)\n        : IntegerType(0);\n};\n\ntemplate<typename IntegerType>\nstruct MaxValue\n{\n    // Tricksy, but covered by the unit test.\n    // Relies heavily on the type of MinValue<IntegerType>::value\n    // being IntegerType.\n    static const IntegerType value = ~MinValue<IntegerType>::value;\n};\n\n/*\n * Step 3: Implement the actual validity checks.\n *\n * Ideas taken from IntegerLib, code different.\n */\n\ntemplate<typename T>\ninline bool\nHasSignBit(T x)\n{\n  // In C++, right bit shifts on negative values is undefined by the standard.\n  // Notice that signed-to-unsigned conversions are always well-defined in the\n  // standard, as the value congruent modulo 2**n as expected. By contrast,\n  // unsigned-to-signed is only well-defined if the value is representable.\n  return bool(typename UnsignedType<T>::Type(x)\n                >> PositionOfSignBit<T>::value);\n}\n\n// Bitwise ops may return a larger type, so it's good to use this inline\n// helper guaranteeing that the result is really of type T.\ntemplate<typename T>\ninline T\nBinaryComplement(T x)\n{\n  return ~x;\n}\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value>\nstruct DoesRangeContainRange\n{\n};\n\ntemplate<typename T, typename U, bool Signedness>\nstruct DoesRangeContainRange<T, U, Signedness, Signedness>\n{\n    static const bool value = sizeof(T) >= sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, true, false>\n{\n    static const bool value = sizeof(T) > sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, false, true>\n{\n    static const bool value = false;\n};\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value,\n         bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>\nstruct IsInRangeImpl {};\n\ntemplate<typename T, typename U, bool IsTSigned, bool IsUSigned>\nstruct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>\n{\n    static bool run(U)\n    {\n       return true;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, true, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value && x >= MinValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, false, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, false, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) > sizeof(U) || x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, true, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) >= sizeof(U)\n             ? x >= 0\n             : x >= 0 && x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\ninline bool\nIsInRange(U x)\n{\n  return IsInRangeImpl<T, U>::run(x);\n}\n\ntemplate<typename T>\ninline bool\nIsAddValid(T x, T y)\n{\n  // Addition is valid if the sign of x+y is equal to either that of x or that\n  // of y. Since the value of x+y is undefined if we have a signed type, we\n  // compute it using the unsigned type of the same size.\n  // Beware! These bitwise operations can return a larger integer type,\n  // if T was a small type like int8_t, so we explicitly cast to T.\n\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux + uy;\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y))))\n         : BinaryComplement(x) >= y;\n}\n\ntemplate<typename T>\ninline bool\nIsSubValid(T x, T y)\n{\n  // Subtraction is valid if either x and y have same sign, or x-y and x have\n  // same sign. Since the value of x-y is undefined if we have a signed type,\n  // we compute it using the unsigned type of the same size.\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux - uy;\n\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y))))\n         : x >= y;\n}\n\ntemplate<typename T,\n         bool IsTSigned = IsSigned<T>::value,\n         bool TwiceBiggerTypeIsSupported =\n           IsSupported<typename TwiceBiggerType<T>::Type>::value>\nstruct IsMulValidImpl {};\n\ntemplate<typename T, bool IsTSigned>\nstruct IsMulValidImpl<T, IsTSigned, true>\n{\n    static bool run(T x, T y)\n    {\n      typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;\n      TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y);\n      return IsInRange<T>(product);\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, true, false>\n{\n    static bool run(T x, T y)\n    {\n      const T max = MaxValue<T>::value;\n      const T min = MinValue<T>::value;\n\n      if (x == 0 || y == 0)\n        return true;\n\n      if (x > 0) {\n        return y > 0\n               ? x <= max / y\n               : y >= min / x;\n      }\n\n      // If we reach this point, we know that x < 0.\n      return y > 0\n             ? x >= min / y\n             : y >= max / x;\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, false, false>\n{\n    static bool run(T x, T y)\n    {\n      return y == 0 ||  x <= MaxValue<T>::value / y;\n    }\n};\n\ntemplate<typename T>\ninline bool\nIsMulValid(T x, T y)\n{\n  return IsMulValidImpl<T>::run(x, y);\n}\n\ntemplate<typename T>\ninline bool\nIsDivValid(T x, T y)\n{\n  // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max.\n  return y != 0 &&\n         !(IsSigned<T>::value && x == MinValue<T>::value && y == T(-1));\n}\n\ntemplate<typename T, bool IsTSigned = IsSigned<T>::value>\nstruct IsModValidImpl;\n\ntemplate<typename T>\ninline bool\nIsModValid(T x, T y)\n{\n  return IsModValidImpl<T>::run(x, y);\n}\n\n/*\n * Mod is pretty simple.\n * For now, let's just use the ANSI C definition:\n * If x or y are negative, the results are implementation defined.\n *   Consider these invalid.\n * Undefined for y=0.\n * The result will never exceed either x or y.\n *\n * Checking that x>=0 is a warning when T is unsigned.\n */\n\ntemplate<typename T>\nstruct IsModValidImpl<T, false> {\n  static inline bool run(T x, T y) {\n    return y >= 1;\n  }\n};\n\ntemplate<typename T>\nstruct IsModValidImpl<T, true> {\n  static inline bool run(T x, T y) {\n    if (x < 0)\n      return false;\n\n    return y >= 1;\n  }\n};\n\ntemplate<typename T, bool IsSigned = IsSigned<T>::value>\nstruct NegateImpl;\n\ntemplate<typename T>\nstruct NegateImpl<T, false>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Handle negation separately for signed/unsigned, for simpler code and to\n      // avoid an MSVC warning negating an unsigned value.\n      return CheckedInt<T>(0, val.isValid() && val.mValue == 0);\n    }\n};\n\ntemplate<typename T>\nstruct NegateImpl<T, true>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Watch out for the min-value, which (with twos-complement) can't be\n      // negated as -min-value is then (max-value + 1).\n      if (!val.isValid() || val.mValue == MinValue<T>::value)\n        return CheckedInt<T>(val.mValue, false);\n      return CheckedInt<T>(-val.mValue, true);\n    }\n};\n\n} // namespace detail\n\n\n/*\n * Step 4: Now define the CheckedInt class.\n */\n\n/**\n * @class CheckedInt\n * @brief Integer wrapper class checking for integer overflow and other errors\n * @param T the integer type to wrap. Can be any type among the following:\n *            - any basic integer type such as |int|\n *            - any stdint type such as |int8_t|\n *\n * This class implements guarded integer arithmetic. Do a computation, check\n * that isValid() returns true, you then have a guarantee that no problem, such\n * as integer overflow, happened during this computation, and you can call\n * value() to get the plain integer value.\n *\n * The arithmetic operators in this class are guaranteed not to raise a signal\n * (e.g. in case of a division by zero).\n *\n * For example, suppose that you want to implement a function that computes\n * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by\n * zero or integer overflow). You could code it as follows:\n   @code\n   bool computeXPlusYOverZ(int x, int y, int z, int *result)\n   {\n       CheckedInt<int> checkedResult = (CheckedInt<int>(x) + y) / z;\n       if (checkedResult.isValid()) {\n           *result = checkedResult.value();\n           return true;\n       } else {\n           return false;\n       }\n   }\n   @endcode\n *\n * Implicit conversion from plain integers to checked integers is allowed. The\n * plain integer is checked to be in range before being casted to the\n * destination type. This means that the following lines all compile, and the\n * resulting CheckedInts are correctly detected as valid or invalid:\n * @code\n   // 1 is of type int, is found to be in range for uint8_t, x is valid\n   CheckedInt<uint8_t> x(1);\n   // -1 is of type int, is found not to be in range for uint8_t, x is invalid\n   CheckedInt<uint8_t> x(-1);\n   // -1 is of type int, is found to be in range for int8_t, x is valid\n   CheckedInt<int8_t> x(-1);\n   // 1000 is of type int16_t, is found not to be in range for int8_t,\n   // x is invalid\n   CheckedInt<int8_t> x(int16_t(1000));\n   // 3123456789 is of type uint32_t, is found not to be in range for int32_t,\n   // x is invalid\n   CheckedInt<int32_t> x(uint32_t(3123456789));\n * @endcode\n * Implicit conversion from\n * checked integers to plain integers is not allowed. As shown in the\n * above example, to get the value of a checked integer as a normal integer,\n * call value().\n *\n * Arithmetic operations between checked and plain integers is allowed; the\n * result type is the type of the checked integer.\n *\n * Checked integers of different types cannot be used in the same arithmetic\n * expression.\n *\n * There are convenience typedefs for all stdint types, of the following form\n * (these are just 2 examples):\n   @code\n   typedef CheckedInt<int32_t> CheckedInt32;\n   typedef CheckedInt<uint16_t> CheckedUint16;\n   @endcode\n */\ntemplate<typename T>\nclass CheckedInt\n{\n  protected:\n    T mValue;\n    bool mIsValid;\n\n    template<typename U>\n    CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid)\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    friend struct detail::NegateImpl<T>;\n\n  public:\n    /**\n     * Constructs a checked integer with given @a value. The checked integer is\n     * initialized as valid or invalid depending on whether the @a value\n     * is in range.\n     *\n     * This constructor is not explicit. Instead, the type of its argument is a\n     * separate template parameter, ensuring that no conversion is performed\n     * before this constructor is actually called. As explained in the above\n     * documentation for class CheckedInt, this constructor checks that its\n     * argument is valid.\n     */\n    template<typename U>\n    CheckedInt(U value)\n      : mValue(T(value)),\n        mIsValid(detail::IsInRange<T>(value))\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    template<typename U>\n    friend class CheckedInt;\n\n    template<typename U>\n    CheckedInt<U> toChecked() const\n    {\n      CheckedInt<U> ret(mValue);\n      ret.mIsValid = ret.mIsValid && mIsValid;\n      return ret;\n    }\n\n    /** Constructs a valid checked integer with initial value 0 */\n    CheckedInt() : mValue(0), mIsValid(true)\n    {\n      static_assert(detail::IsSupported<T>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    /** @returns the actual value */\n    T value() const\n    {\n      MOZ_ASSERT(mIsValid, \"Invalid checked integer (division by zero or integer overflow)\");\n      return mValue;\n    }\n\n    /**\n     * @returns true if the checked integer is valid, i.e. is not the result\n     * of an invalid operation or of an operation involving an invalid checked\n     * integer\n     */\n    bool isValid() const\n    {\n      return mIsValid;\n    }\n\n    template<typename U>\n    friend CheckedInt<U> operator +(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator +=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator -(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator -=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator *(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator *=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator /(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator /=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator %(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator %=(U rhs);\n\n    CheckedInt operator -() const\n    {\n      return detail::NegateImpl<T>::negate(*this);\n    }\n\n    /**\n     * @returns true if the left and right hand sides are valid\n     * and have the same value.\n     *\n     * Note that these semantics are the reason why we don't offer\n     * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)\n     * but that would mean that whenever a or b is invalid, a!=b\n     * is always true, which would be very confusing.\n     *\n     * For similar reasons, operators <, >, <=, >= would be very tricky to\n     * specify, so we just avoid offering them.\n     *\n     * Notice that these == semantics are made more reasonable by these facts:\n     *  1. a==b implies equality at the raw data level\n     *     (the converse is false, as a==b is never true among invalids)\n     *  2. This is similar to the behavior of IEEE floats, where a==b\n     *     means that a and b have the same value *and* neither is NaN.\n     */\n    bool operator ==(const CheckedInt& other) const\n    {\n      return mIsValid && other.mIsValid && mValue == other.mValue;\n    }\n\n    /** prefix ++ */\n    CheckedInt& operator++()\n    {\n      *this += 1;\n      return *this;\n    }\n\n    /** postfix ++ */\n    CheckedInt operator++(int)\n    {\n      CheckedInt tmp = *this;\n      *this += 1;\n      return tmp;\n    }\n\n    /** prefix -- */\n    CheckedInt& operator--()\n    {\n      *this -= 1;\n      return *this;\n    }\n\n    /** postfix -- */\n    CheckedInt operator--(int)\n    {\n      CheckedInt tmp = *this;\n      *this -= 1;\n      return tmp;\n    }\n\n  private:\n    /**\n     * The !=, <, <=, >, >= operators are disabled:\n     * see the comment on operator==.\n     */\n    template<typename U>\n    bool operator !=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >=(U other) const MOZ_DELETE;\n};\n\n#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                \\\ntemplate<typename T>                                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs,            \\\n                                 const CheckedInt<T> &rhs)            \\\n{                                                                     \\\n  if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue))               \\\n    return CheckedInt<T>(0, false);                                   \\\n                                                                      \\\n  return CheckedInt<T>(lhs.mValue OP rhs.mValue,                      \\\n                       lhs.mIsValid && rhs.mIsValid);                 \\\n}\n\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)\n\n#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR\n\n// Implement castToCheckedInt<T>(x), making sure that\n//  - it allows x to be either a CheckedInt<T> or any integer type\n//    that can be casted to T\n//  - if x is already a CheckedInt<T>, we just return a reference to it,\n//    instead of copying it (optimization)\n\nnamespace detail {\n\ntemplate<typename T, typename U>\nstruct CastToCheckedIntImpl\n{\n    typedef CheckedInt<T> ReturnType;\n    static CheckedInt<T> run(U u) { return u; }\n};\n\ntemplate<typename T>\nstruct CastToCheckedIntImpl<T, CheckedInt<T> >\n{\n    typedef const CheckedInt<T>& ReturnType;\n    static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }\n};\n\n} // namespace detail\n\ntemplate<typename T, typename U>\ninline typename detail::CastToCheckedIntImpl<T, U>::ReturnType\ncastToCheckedInt(U u)\n{\n  static_assert(detail::IsSupported<T>::value &&\n                detail::IsSupported<U>::value,\n                \"This type is not supported by CheckedInt\");\n  return detail::CastToCheckedIntImpl<T, U>::run(u);\n}\n\n#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)  \\\ntemplate<typename T>                                              \\\ntemplate<typename U>                                              \\\nCheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U rhs)         \\\n{                                                                 \\\n  *this = *this OP castToCheckedInt<T>(rhs);                      \\\n  return *this;                                                   \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs, U rhs) \\\n{                                                                 \\\n  return lhs OP castToCheckedInt<T>(rhs);                         \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(U lhs, const CheckedInt<T> &rhs) \\\n{                                                                 \\\n  return castToCheckedInt<T>(lhs) OP rhs;                         \\\n}\n\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)\n\n#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(const CheckedInt<T> &lhs, U rhs)\n{\n  return lhs == castToCheckedInt<T>(rhs);\n}\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(U  lhs, const CheckedInt<T> &rhs)\n{\n  return castToCheckedInt<T>(lhs) == rhs;\n}\n\n// Convenience typedefs.\ntypedef CheckedInt<int8_t>   CheckedInt8;\ntypedef CheckedInt<uint8_t>  CheckedUint8;\ntypedef CheckedInt<int16_t>  CheckedInt16;\ntypedef CheckedInt<uint16_t> CheckedUint16;\ntypedef CheckedInt<int32_t>  CheckedInt32;\ntypedef CheckedInt<uint32_t> CheckedUint32;\ntypedef CheckedInt<int64_t>  CheckedInt64;\ntypedef CheckedInt<uint64_t> CheckedUint64;\n\n} // namespace mozilla\n\n#endif /* mozilla_CheckedInt_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Compiler.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various compiler checks. */\n\n#ifndef mozilla_Compiler_h\n#define mozilla_Compiler_h\n\n#if !defined(__clang__) && defined(__GNUC__)\n\n#define MOZ_IS_GCC 1\n   /*\n    * This macro should simplify gcc version checking. For example, to check\n    * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`.\n    */\n#  define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel)          \\\n     ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \\\n      >= ((major) * 10000 + (minor) * 100 + (patchlevel)))\n#if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0)\n#  error \"mfbt (and Gecko) require at least gcc 4.4 to build.\"\n#endif\n\n#else\n\n#define MOZ_IS_GCC 0\n\n#endif\n\n#endif /* mozilla_Compiler_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Constants.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt math constants. */\n\n#ifndef mozilla_Constants_h\n#define mozilla_Constants_h\n\n#ifndef M_PI\n#  define M_PI 3.14159265358979323846\n#endif\n\n#endif /* mozilla_Constants_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/DebugOnly.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides DebugOnly, a type for variables used only in debug builds (i.e. by\n * assertions).\n */\n\n#ifndef mozilla_DebugOnly_h\n#define mozilla_DebugOnly_h\n\nnamespace mozilla {\n\n/**\n * DebugOnly contains a value of type T, but only in debug builds.  In release\n * builds, it does not contain a value.  This helper is intended to be used with\n * MOZ_ASSERT()-style macros, allowing one to write:\n *\n *   DebugOnly<bool> check = func();\n *   MOZ_ASSERT(check);\n *\n * more concisely than declaring |check| conditional on #ifdef DEBUG, but also\n * without allocating storage space for |check| in release builds.\n *\n * DebugOnly instances can only be coerced to T in debug builds.  In release\n * builds they don't have a value, so type coercion is not well defined.\n */\ntemplate<typename T>\nclass DebugOnly\n{\n  public:\n#ifdef DEBUG\n    T value;\n\n    DebugOnly() { }\n    DebugOnly(const T& other) : value(other) { }\n    DebugOnly(const DebugOnly& other) : value(other.value) { }\n    DebugOnly& operator=(const T& rhs) {\n      value = rhs;\n      return *this;\n    }\n    void operator++(int) {\n      value++;\n    }\n    void operator--(int) {\n      value--;\n    }\n\n    T* operator&() { return &value; }\n\n    operator T&() { return value; }\n    operator const T&() const { return value; }\n\n    T& operator->() { return value; }\n\n#else\n    DebugOnly() { }\n    DebugOnly(const T&) { }\n    DebugOnly(const DebugOnly&) { }\n    DebugOnly& operator=(const T&) { return *this; }\n    void operator++(int) { }\n    void operator--(int) { }\n#endif\n\n    /*\n     * DebugOnly must always have a destructor or else it will\n     * generate \"unused variable\" warnings, exactly what it's intended\n     * to avoid!\n     */\n    ~DebugOnly() {}\n};\n\n}\n\n#endif /* mozilla_DebugOnly_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Decimal.h",
    "content": "/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * Imported from:\n * http://src.chromium.org/viewvc/blink/trunk/Source/core/platform/Decimal.h\n * Check hg log for the svn rev of the last update from Blink core.\n */\n\n#ifndef Decimal_h\n#define Decimal_h\n\n#include \"mozilla/Assertions.h\"\n#include <stdint.h>\n#include \"mozilla/Types.h\"\n\n#include <string>\n\n#ifndef ASSERT\n#define DEFINED_ASSERT_FOR_DECIMAL_H 1\n#define ASSERT MOZ_ASSERT\n#endif\n\n// To use WTF_MAKE_FAST_ALLOCATED we'd need:\n// http://src.chromium.org/viewvc/blink/trunk/Source/wtf/FastMalloc.h\n// Since we don't allocate Decimal objects, no need.\n#define WTF_MAKE_FAST_ALLOCATED \\\n  void ignore_this_dummy_method() MOZ_DELETE\n\nnamespace WebCore {\n\nnamespace DecimalPrivate {\nclass SpecialValueHandler;\n}\n\n// This class represents decimal base floating point number.\n//\n// FIXME: Once all C++ compiler support decimal type, we should replace this\n// class to compiler supported one. See below URI for current status of decimal\n// type for C++: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1977.html\nclass Decimal {\n    WTF_MAKE_FAST_ALLOCATED;\npublic:\n    enum Sign {\n        Positive,\n        Negative,\n    };\n\n    // You should not use EncodedData other than unit testing.\n    class EncodedData {\n        // For accessing FormatClass.\n        friend class Decimal;\n        friend class DecimalPrivate::SpecialValueHandler;\n    public:\n        EncodedData(Sign, int exponent, uint64_t coefficient);\n\n        bool operator==(const EncodedData&) const;\n        bool operator!=(const EncodedData& another) const { return !operator==(another); }\n\n        uint64_t coefficient() const { return m_coefficient; }\n        int countDigits() const;\n        int exponent() const { return m_exponent; }\n        bool isFinite() const { return !isSpecial(); }\n        bool isInfinity() const { return m_formatClass == ClassInfinity; }\n        bool isNaN() const { return m_formatClass == ClassNaN; }\n        bool isSpecial() const { return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; }\n        bool isZero() const { return m_formatClass == ClassZero; }\n        Sign sign() const { return m_sign; }\n        void setSign(Sign sign) { m_sign = sign; }\n\n    private:\n        enum FormatClass {\n            ClassInfinity,\n            ClassNormal,\n            ClassNaN,\n            ClassZero,\n        };\n\n        EncodedData(Sign, FormatClass);\n        FormatClass formatClass() const { return m_formatClass; }\n\n        uint64_t m_coefficient;\n        int16_t m_exponent;\n        FormatClass m_formatClass;\n        Sign m_sign;\n    };\n\n    MFBT_API Decimal(int32_t = 0);\n    MFBT_API Decimal(Sign, int exponent, uint64_t coefficient);\n    MFBT_API Decimal(const Decimal&);\n\n    MFBT_API Decimal& operator=(const Decimal&);\n    MFBT_API Decimal& operator+=(const Decimal&);\n    MFBT_API Decimal& operator-=(const Decimal&);\n    MFBT_API Decimal& operator*=(const Decimal&);\n    MFBT_API Decimal& operator/=(const Decimal&);\n\n    MFBT_API Decimal operator-() const;\n\n    MFBT_API bool operator==(const Decimal&) const;\n    MFBT_API bool operator!=(const Decimal&) const;\n    MFBT_API bool operator<(const Decimal&) const;\n    MFBT_API bool operator<=(const Decimal&) const;\n    MFBT_API bool operator>(const Decimal&) const;\n    MFBT_API bool operator>=(const Decimal&) const;\n\n    MFBT_API Decimal operator+(const Decimal&) const;\n    MFBT_API Decimal operator-(const Decimal&) const;\n    MFBT_API Decimal operator*(const Decimal&) const;\n    MFBT_API Decimal operator/(const Decimal&) const;\n\n    int exponent() const\n    {\n        ASSERT(isFinite());\n        return m_data.exponent();\n    }\n\n    bool isFinite() const { return m_data.isFinite(); }\n    bool isInfinity() const { return m_data.isInfinity(); }\n    bool isNaN() const { return m_data.isNaN(); }\n    bool isNegative() const { return sign() == Negative; }\n    bool isPositive() const { return sign() == Positive; }\n    bool isSpecial() const { return m_data.isSpecial(); }\n    bool isZero() const { return m_data.isZero(); }\n\n    MFBT_API Decimal abs() const;\n    MFBT_API Decimal ceiling() const;\n    MFBT_API Decimal floor() const;\n    MFBT_API Decimal remainder(const Decimal&) const;\n    MFBT_API Decimal round() const;\n\n    MFBT_API double toDouble() const;\n    // Note: toString method supports infinity and nan but fromString not.\n    MFBT_API std::string toString() const;\n    MFBT_API bool toString(char* strBuf, size_t bufLength) const;\n\n    static MFBT_API Decimal fromDouble(double);\n    // fromString supports following syntax EBNF:\n    //  number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?\n    //          | sign? '.' digit+ (exponent-marker sign? digit+)?\n    //  sign ::= '+' | '-'\n    //  exponent-marker ::= 'e' | 'E'\n    //  digit ::= '0' | '1' | ... | '9'\n    // Note: fromString doesn't support \"infinity\" and \"nan\".\n    static MFBT_API Decimal fromString(const std::string& aValue);\n    static MFBT_API Decimal infinity(Sign);\n    static MFBT_API Decimal nan();\n    static MFBT_API Decimal zero(Sign);\n\n    // You should not use below methods. We expose them for unit testing.\n    MFBT_API explicit Decimal(const EncodedData&);\n    const EncodedData& value() const { return m_data; }\n\nprivate:\n    struct AlignedOperands {\n        uint64_t lhsCoefficient;\n        uint64_t rhsCoefficient;\n        int exponent;\n    };\n\n    MFBT_API Decimal(double);\n    MFBT_API Decimal compareTo(const Decimal&) const;\n\n    static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);\n    static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; }\n\n    Sign sign() const { return m_data.sign(); }\n\n    EncodedData m_data;\n};\n\n} // namespace WebCore\n\nnamespace mozilla {\n  typedef WebCore::Decimal Decimal;\n}\n\n#undef WTF_MAKE_FAST_ALLOCATED\n\n#ifdef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef ASSERT\n#endif\n\n#endif // Decimal_h\n\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Endian.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Functions for reading and writing integers in various endiannesses. */\n\n/*\n * The classes LittleEndian and BigEndian expose static methods for\n * reading and writing 16-, 32-, and 64-bit signed and unsigned integers\n * in their respective endianness.  The naming scheme is:\n *\n * {Little,Big}Endian::{read,write}{Uint,Int}<bitsize>\n *\n * For instance, LittleEndian::readInt32 will read a 32-bit signed\n * integer from memory in little endian format.  Similarly,\n * BigEndian::writeUint16 will write a 16-bit unsigned integer to memory\n * in big-endian format.\n *\n * The class NativeEndian exposes methods for conversion of existing\n * data to and from the native endianness.  These methods are intended\n * for cases where data needs to be transferred, serialized, etc.\n * swap{To,From}{Little,Big}Endian byteswap a single value if necessary.\n * Bulk conversion functions are also provided which optimize the\n * no-conversion-needed case:\n *\n * - copyAndSwap{To,From}{Little,Big}Endian;\n * - swap{To,From}{Little,Big}EndianInPlace.\n *\n * The *From* variants are intended to be used for reading data and the\n * *To* variants for writing data.\n *\n * Methods on NativeEndian work with integer data of any type.\n * Floating-point data is not supported.\n *\n * For clarity in networking code, \"Network\" may be used as a synonym\n * for \"Big\" in any of the above methods or class names.\n *\n * As an example, reading a file format header whose fields are stored\n * in big-endian format might look like:\n *\n * class ExampleHeader\n * {\n *   private:\n *     uint32_t magic;\n *     uint32_t length;\n *     uint32_t totalRecords;\n *     uint64_t checksum;\n *\n *   public:\n *     ExampleHeader(const void* data) {\n *       const uint8_t* ptr = static_cast<const uint8_t*>(data);\n *       magic = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       length = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       totalRecords = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       checksum = BigEndian::readUint64(ptr);\n *     }\n *     ...\n * };\n */\n\n#ifndef mozilla_Endian_h\n#define mozilla_Endian_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n#include <string.h>\n\n#if defined(_MSC_VER) && _MSC_VER >= 1300\n#  include <stdlib.h>\n#  pragma intrinsic(_byteswap_ushort)\n#  pragma intrinsic(_byteswap_ulong)\n#  pragma intrinsic(_byteswap_uint64)\n#endif\n\n#if defined(_WIN64)\n#  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(_WIN32)\n#  if defined(_M_IX86)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(__APPLE__)\n#  if __LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  endif\n#elif defined(__GNUC__) && \\\n      defined(__BYTE_ORDER__) && \\\n      defined(__ORDER_LITTLE_ENDIAN__) && \\\n      defined(__ORDER_BIG_ENDIAN__)\n   /*\n    * Some versions of GCC provide architecture-independent macros for\n    * this.  Yes, there are more than two values for __BYTE_ORDER__.\n    */\n#  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  else\n#    error \"Can't handle mixed-endian architectures\"\n#  endif\n/*\n * We can't include useful headers like <endian.h> or <sys/isa_defs.h>\n * here because they're not present on all platforms.  Instead we have\n * this big conditional that ideally will catch all the interesting\n * cases.\n */\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(__ARMEB__) || \\\n      defined(__s390__) || \\\n      (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \\\n      (defined(__ia64) && defined(__BIG_ENDIAN__))\n#  define MOZ_BIG_ENDIAN 1\n#elif defined(__i386) || defined(__i386__) || \\\n      defined(__x86_64) || defined(__x86_64__) || \\\n      defined(_MIPSEL) || defined(__ARMEL__) || \\\n      defined(__alpha__) || \\\n      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \\\n      (defined(__ia64) && !defined(__BIG_ENDIAN__))\n#  define MOZ_LITTLE_ENDIAN 1\n#endif\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_LITTLE_ENDIAN 0\n#elif MOZ_LITTLE_ENDIAN\n#  define MOZ_BIG_ENDIAN 0\n#else\n#  error \"Cannot determine endianness\"\n#endif\n\n#if defined(__clang__)\n#  if __has_builtin(__builtin_bswap16)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(__GNUC__)\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(_MSC_VER)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n/*\n * We need wrappers here because free functions with default template\n * arguments and/or partial specialization of function templates are not\n * supported by all the compilers we use.\n */\ntemplate<typename T, size_t Size = sizeof(T)>\nstruct Swapper;\n\ntemplate<typename T>\nstruct Swapper<T, 2>\n{\n  static T swap(T value)\n  {\n#if defined(MOZ_HAVE_BUILTIN_BYTESWAP16)\n    return MOZ_HAVE_BUILTIN_BYTESWAP16(value);\n#else\n    return T(((value & 0x00ff) << 8) | ((value & 0xff00) >> 8));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 4>\n{\n  static T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap32(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_ulong(value));\n#else\n    return T(((value & 0x000000ffU) << 24) |\n             ((value & 0x0000ff00U) << 8) |\n             ((value & 0x00ff0000U) >> 8) |\n             ((value & 0xff000000U) >> 24));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 8>\n{\n  static inline T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap64(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_uint64(value));\n#else\n    return T(((value & 0x00000000000000ffULL) << 56) |\n             ((value & 0x000000000000ff00ULL) << 40) |\n             ((value & 0x0000000000ff0000ULL) << 24) |\n             ((value & 0x00000000ff000000ULL) << 8) |\n             ((value & 0x000000ff00000000ULL) >> 8) |\n             ((value & 0x0000ff0000000000ULL) >> 24) |\n             ((value & 0x00ff000000000000ULL) >> 40) |\n             ((value & 0xff00000000000000ULL) >> 56));\n#endif\n  }\n};\n\nenum Endianness { Little, Big };\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_NATIVE_ENDIANNESS detail::Big\n#else\n#  define MOZ_NATIVE_ENDIANNESS detail::Little\n#endif\n\nclass EndianUtils\n{\n    /**\n     * Assert that the memory regions [dest, dest+count) and [src, src+count]\n     * do not overlap.  count is given in bytes.\n     */\n    static void assertNoOverlap(const void* dest, const void* src, size_t count)\n    {\n      DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(dest);\n      DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(src);\n      MOZ_ASSERT((byteDestPtr < byteSrcPtr &&\n                  byteDestPtr + count <= byteSrcPtr) ||\n                 (byteSrcPtr < byteDestPtr &&\n                  byteSrcPtr + count <= byteDestPtr));\n    }\n\n    template<typename T>\n    static void assertAligned(T* ptr)\n    {\n      MOZ_ASSERT((uintptr_t(ptr) % sizeof(T)) == 0, \"Unaligned pointer!\");\n    }\n\n  protected:\n    /**\n     * Return |value| converted from SourceEndian encoding to DestEndian\n     * encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline T maybeSwap(T value)\n    {\n      if (SourceEndian == DestEndian)\n        return value;\n\n      return Swapper<T>::swap(value);\n    }\n\n    /**\n     * Convert |count| elements at |ptr| from SourceEndian encoding to\n     * DestEndian encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline void maybeSwapInPlace(T* ptr, size_t count)\n    {\n      assertAligned(ptr);\n\n      if (SourceEndian == DestEndian)\n        return;\n\n      for (size_t i = 0; i < count; i++)\n        ptr[i] = Swapper<T>::swap(ptr[i]);\n    }\n\n    /**\n     * Write |count| elements to the unaligned address |dest| in DestEndian\n     * format, using elements found at |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapTo(void* dest, const T* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(src);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      uint8_t* byteDestPtr = static_cast<uint8_t*>(dest);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        u.val = maybeSwap<SourceEndian, DestEndian>(src[i]);\n        memcpy(byteDestPtr, u.buffer, sizeof(T));\n        byteDestPtr += sizeof(T);\n      }\n    }\n\n    /**\n     * Write |count| elements to |dest| in DestEndian format, using elements\n     * found at the unaligned address |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapFrom(T* dest, const void* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(dest);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      const uint8_t* byteSrcPtr = static_cast<const uint8_t*>(src);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        memcpy(u.buffer, byteSrcPtr, sizeof(T));\n        dest[i] = maybeSwap<SourceEndian, DestEndian>(u.val);\n        byteSrcPtr += sizeof(T);\n      }\n    }\n};\n\ntemplate<Endianness ThisEndian>\nclass Endian : private EndianUtils\n{\n  protected:\n    /** Read a uint16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* p) {\n      return read<uint16_t>(p);\n    }\n\n    /** Read a uint32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read a uint64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* p) {\n      return read<uint64_t>(p);\n    }\n\n    /** Read an int16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* p) {\n      return read<int16_t>(p);\n    }\n\n    /** Read an int32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read an int64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* p) {\n      return read<int64_t>(p);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint16(void* p, uint16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint32(void* p, uint32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint64(void* p, uint64_t val) {\n      write(p, val);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt16(void* p, int16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt32(void* p, int32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt64(void* p, int64_t val) {\n      write(p, val);\n    }\n\n    /*\n     * Converts a value of type T to little-endian format.\n     *\n     * This function is intended for cases where you have data in your\n     * native-endian format and you need it to appear in little-endian\n     * format for transmission.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T value) {\n      return maybeSwap<ThisEndian, Little>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToLittleEndian(void* dest, const T* src,\n                                          size_t count) {\n      copyAndSwapTo<ThisEndian, Little>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Little>(p, count);\n    }\n\n    /*\n     * Converts a value of type T to big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T value) {\n      return maybeSwap<ThisEndian, Big>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToBigEndian(void* dest, const T* src, size_t count) {\n      copyAndSwapTo<ThisEndian, Big>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Big>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T value) {\n      return swapToBigEndian(value);\n    }\n    template<typename T>\n    static void\n    copyAndSwapToNetworkOrder(void* dest, const T* src, size_t count) {\n      copyAndSwapToBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void\n    swapToNetworkOrderInPlace(T* p, size_t count) {\n      swapToBigEndianInPlace(p, count);\n    }\n\n    /*\n     * Converts a value of type T from little-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T value) {\n      return maybeSwap<Little, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromLittleEndian(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFrom<Little, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Little, ThisEndian>(p, count);\n    }\n\n    /*\n     * Converts a value of type T from big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T value) {\n      return maybeSwap<Big, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromBigEndian(T* dest, const void* src,\n                                         size_t count) {\n      copyAndSwapFrom<Big, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Big, ThisEndian>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T value) {\n      return swapFromBigEndian(value);\n    }\n    template<typename T>\n    static void copyAndSwapFromNetworkOrder(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFromBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void swapFromNetworkOrderInPlace(T* p, size_t count) {\n      swapFromBigEndianInPlace(p, count);\n    }\n\n  private:\n    /**\n     * Read a value of type T, encoded in endianness ThisEndian from |p|.\n     * Return that value encoded in native endianness.\n     */\n    template<typename T>\n    static T read(const void* p) {\n      union {\n        T val;\n        uint8_t buffer[sizeof(T)];\n      } u;\n      memcpy(u.buffer, p, sizeof(T));\n      return maybeSwap<ThisEndian, MOZ_NATIVE_ENDIANNESS>(u.val);\n    }\n\n    /**\n     * Write a value of type T, in native endianness, to |p|, in ThisEndian\n     * endianness.\n     */\n    template<typename T>\n    static void write(void* p, T value) {\n      T tmp = maybeSwap<MOZ_NATIVE_ENDIANNESS, ThisEndian>(value);\n      memcpy(p, &tmp, sizeof(T));\n    }\n\n    Endian() MOZ_DELETE;\n    Endian(const Endian& other) MOZ_DELETE;\n    void operator=(const Endian& other) MOZ_DELETE;\n};\n\ntemplate<Endianness ThisEndian>\nclass EndianReadWrite : public Endian<ThisEndian>\n{\n  private:\n    typedef Endian<ThisEndian> super;\n\n  public:\n    using super::readUint16;\n    using super::readUint32;\n    using super::readUint64;\n    using super::readInt16;\n    using super::readInt32;\n    using super::readInt64;\n    using super::writeUint16;\n    using super::writeUint32;\n    using super::writeUint64;\n    using super::writeInt16;\n    using super::writeInt32;\n    using super::writeInt64;\n};\n\n} /* namespace detail */\n\nclass LittleEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Little>\n{};\n\nclass BigEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Big>\n{};\n\ntypedef BigEndian NetworkEndian;\n\nclass NativeEndian MOZ_FINAL : public detail::Endian<MOZ_NATIVE_ENDIANNESS>\n{\n  private:\n    typedef detail::Endian<MOZ_NATIVE_ENDIANNESS> super;\n\n  public:\n    /*\n     * These functions are intended for cases where you have data in your\n     * native-endian format and you need the data to appear in the appropriate\n     * endianness for transmission, serialization, etc.\n     */\n    using super::swapToLittleEndian;\n    using super::copyAndSwapToLittleEndian;\n    using super::swapToLittleEndianInPlace;\n    using super::swapToBigEndian;\n    using super::copyAndSwapToBigEndian;\n    using super::swapToBigEndianInPlace;\n    using super::swapToNetworkOrder;\n    using super::copyAndSwapToNetworkOrder;\n    using super::swapToNetworkOrderInPlace;\n\n    /*\n     * These functions are intended for cases where you have data in the\n     * given endianness (e.g. reading from disk or a file-format) and you\n     * need the data to appear in native-endian format for processing.\n     */\n    using super::swapFromLittleEndian;\n    using super::copyAndSwapFromLittleEndian;\n    using super::swapFromLittleEndianInPlace;\n    using super::swapFromBigEndian;\n    using super::copyAndSwapFromBigEndian;\n    using super::swapFromBigEndianInPlace;\n    using super::swapFromNetworkOrder;\n    using super::copyAndSwapFromNetworkOrder;\n    using super::swapFromNetworkOrderInPlace;\n};\n\n#undef MOZ_NATIVE_ENDIANNESS\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Endian_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/EnumSet.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A set abstraction for enumeration values. */\n\n#ifndef mozilla_EnumSet_h\n#define mozilla_EnumSet_h\n\n#include \"mozilla/Assertions.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * EnumSet<T> is a set of values defined by an enumeration. It is implemented\n * using a 32 bit mask for each value so it will only work for enums with an int\n * representation less than 32. It works both for enum and enum class types.\n */\ntemplate<typename T>\nclass EnumSet\n{\n  public:\n    EnumSet()\n      : mBitField(0)\n    { }\n\n    EnumSet(T aEnum)\n      : mBitField(aEnum)\n    { }\n\n    EnumSet(T aEnum1, T aEnum2)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2) |\n                  bitFor(aEnum3))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3, T aEnum4)\n     : mBitField(bitFor(aEnum1) |\n                 bitFor(aEnum2) |\n                 bitFor(aEnum3) |\n                 bitFor(aEnum4))\n    { }\n\n    EnumSet(const EnumSet& aEnumSet)\n     : mBitField(aEnumSet.mBitField)\n    { }\n\n    /**\n     * Add an element\n     */\n    void operator+=(T aEnum) {\n      mBitField |= bitFor(aEnum);\n    }\n\n    /**\n     * Add an element\n     */\n    EnumSet<T> operator+(T aEnum) const {\n      EnumSet<T> result(*this);\n      result += aEnum;\n      return result;\n    }\n\n    /**\n     * Union\n     */\n    void operator+=(const EnumSet<T> aEnumSet) {\n      mBitField |= aEnumSet.mBitField;\n    }\n\n    /**\n     * Union\n     */\n    EnumSet<T> operator+(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result += aEnumSet;\n      return result;\n    }\n\n    /**\n     * Remove an element\n     */\n    void operator-=(T aEnum) {\n      mBitField &= ~(bitFor(aEnum));\n    }\n\n    /**\n     * Remove an element\n     */\n    EnumSet<T> operator-(T aEnum) const {\n      EnumSet<T> result(*this);\n      result -= aEnum;\n      return result;\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    void operator-=(const EnumSet<T> aEnumSet) {\n      mBitField &= ~(aEnumSet.mBitField);\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    EnumSet<T> operator-(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result -= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Intersection\n     */\n    void operator&=(const EnumSet<T> aEnumSet) {\n      mBitField &= aEnumSet.mBitField;\n    }\n\n    /**\n     * Intersection\n     */\n    EnumSet<T> operator&(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result &= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Equality\n     */\n\n    bool operator==(const EnumSet<T> aEnumSet) const {\n      return mBitField == aEnumSet.mBitField;\n    }\n\n    /**\n     * Test is an element is contained in the set\n     */\n    bool contains(T aEnum) const {\n      return mBitField & bitFor(aEnum);\n    }\n\n    /**\n     * Return the number of elements in the set\n     */\n\n    uint8_t size() {\n      uint8_t count = 0;\n      for (uint32_t bitField = mBitField; bitField; bitField >>= 1) {\n        if (bitField & 1)\n          count++;\n      }\n      return count;\n    }\n\n  private:\n    static uint32_t bitFor(T aEnum) {\n      uint32_t bitNumber(aEnum);\n      MOZ_ASSERT(bitNumber < 32);\n      return 1U << bitNumber;\n    }\n\n    uint32_t mBitField;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_EnumSet_h_*/\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/FloatingPoint.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various predicates and operations on IEEE-754 floating point types. */\n\n#ifndef mozilla_FloatingPoint_h\n#define mozilla_FloatingPoint_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/*\n * It's reasonable to ask why we have this header at all.  Don't isnan,\n * copysign, the built-in comparison operators, and the like solve these\n * problems?  Unfortunately, they don't.  We've found that various compilers\n * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile\n * the standard methods in various situations, so we can't use them.  Some of\n * these compilers even have problems compiling seemingly reasonable bitwise\n * algorithms!  But with some care we've found algorithms that seem to not\n * trigger those compiler bugs.\n *\n * For the aforementioned reasons, be very wary of making changes to any of\n * these algorithms.  If you must make changes, keep a careful eye out for\n * compiler bustage, particularly PGO-specific bustage.\n */\n\n/*\n * These implementations all assume |double| is a 64-bit double format number\n * type, compatible with the IEEE-754 standard.  C/C++ don't require this to be\n * the case.  But we required this in implementations of these algorithms that\n * preceded this header, so we shouldn't break anything if we continue doing so.\n */\nstatic_assert(sizeof(double) == sizeof(uint64_t), \"double must be 64 bits\");\n\nconst unsigned DoubleExponentBias = 1023;\nconst unsigned DoubleExponentShift = 52;\n\nconst uint64_t DoubleSignBit         = 0x8000000000000000ULL;\nconst uint64_t DoubleExponentBits    = 0x7ff0000000000000ULL;\nconst uint64_t DoubleSignificandBits = 0x000fffffffffffffULL;\n\nstatic_assert((DoubleSignBit & DoubleExponentBits) == 0,\n              \"sign bit doesn't overlap exponent bits\");\nstatic_assert((DoubleSignBit & DoubleSignificandBits) == 0,\n              \"sign bit doesn't overlap significand bits\");\nstatic_assert((DoubleExponentBits & DoubleSignificandBits) == 0,\n              \"exponent bits don't overlap significand bits\");\n\nstatic_assert((DoubleSignBit | DoubleExponentBits | DoubleSignificandBits) ==\n              ~uint64_t(0),\n              \"all bits accounted for\");\n\n/** Determines whether a double is NaN. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNaN(double d)\n{\n  /*\n   * A double is NaN if all exponent bits are 1 and the significand contains at\n   * least one non-zero bit.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) == DoubleExponentBits &&\n         (bits & DoubleSignificandBits) != 0;\n}\n\n/** Determines whether a double is +Infinity or -Infinity. */\nstatic MOZ_ALWAYS_INLINE bool\nIsInfinite(double d)\n{\n  /* Infinities have all exponent bits set to 1 and an all-0 significand. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & ~DoubleSignBit) == DoubleExponentBits;\n}\n\n/** Determines whether a double is not NaN or infinite. */\nstatic MOZ_ALWAYS_INLINE bool\nIsFinite(double d)\n{\n  /*\n   * NaN and Infinities are the only non-finite doubles, and both have all\n   * exponent bits set to 1.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) != DoubleExponentBits;\n}\n\n/**\n * Determines whether a double is negative.  It is an error to call this method\n * on a double which is NaN.\n */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegative(double d)\n{\n  MOZ_ASSERT(!IsNaN(d), \"NaN does not have a sign\");\n\n  /* The sign bit is set if the double is negative. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleSignBit) != 0;\n}\n\n/** Determines whether a double represents -0. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegativeZero(double d)\n{\n  /* Only the sign bit is set if the double is -0. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return bits == DoubleSignBit;\n}\n\n/** Returns the exponent portion of the double. */\nstatic MOZ_ALWAYS_INLINE int_fast16_t\nExponentComponent(double d)\n{\n  /*\n   * The exponent component of a double is an unsigned number, biased from its\n   * actual value.  Subtract the bias to retrieve the actual exponent.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return int_fast16_t((bits & DoubleExponentBits) >> DoubleExponentShift) -\n         int_fast16_t(DoubleExponentBias);\n}\n\n/** Returns +Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nPositiveInfinity()\n{\n  /*\n   * Positive infinity has all exponent bits set, sign bit set to 0, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleExponentBits);\n}\n\n/** Returns -Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nNegativeInfinity()\n{\n  /*\n   * Negative infinity has all exponent bits set, sign bit set to 1, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleSignBit | DoubleExponentBits);\n}\n\n/** Constructs a NaN value with the specified sign bit and significand bits. */\nstatic MOZ_ALWAYS_INLINE double\nSpecificNaN(int signbit, uint64_t significand)\n{\n  MOZ_ASSERT(signbit == 0 || signbit == 1);\n  MOZ_ASSERT((significand & ~DoubleSignificandBits) == 0);\n  MOZ_ASSERT(significand & DoubleSignificandBits);\n\n  double d = BitwiseCast<double>((signbit ? DoubleSignBit : 0) |\n                                 DoubleExponentBits |\n                                 significand);\n  MOZ_ASSERT(IsNaN(d));\n  return d;\n}\n\n/** Computes the smallest non-zero positive double value. */\nstatic MOZ_ALWAYS_INLINE double\nMinDoubleValue()\n{\n  return BitwiseCast<double>(uint64_t(1));\n}\n\nstatic MOZ_ALWAYS_INLINE bool\nDoubleIsInt32(double d, int32_t* i)\n{\n  /*\n   * XXX Casting a double that doesn't truncate to int32_t, to int32_t, induces\n   *     undefined behavior.  We should definitely fix this (bug 744965), but as\n   *     apparently it \"works\" in practice, it's not a pressing concern now.\n   */\n  return !IsNegativeZero(d) && d == (*i = int32_t(d));\n}\n\n/**\n * Computes a NaN value.  Do not use this method if you depend upon a particular\n * NaN value being returned.\n */\nstatic MOZ_ALWAYS_INLINE double\nUnspecifiedNaN()\n{\n  return SpecificNaN(0, 0xfffffffffffffULL);\n}\n\n/**\n * Compare two doubles for equality, *without* equating -0 to +0, and equating\n * any NaN value to any other NaN value.  (The normal equality operators equate\n * -0 with +0, and they equate NaN to no other value.)\n */\nstatic inline bool\nDoublesAreIdentical(double d1, double d2)\n{\n  if (IsNaN(d1))\n    return IsNaN(d2);\n  return BitwiseCast<uint64_t>(d1) == BitwiseCast<uint64_t>(d2);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_FloatingPoint_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/GuardObjects.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementation of macros to ensure correct use of RAII Auto* objects. */\n\n#ifndef mozilla_GuardObjects_h\n#define mozilla_GuardObjects_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\n#ifdef DEBUG\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The following classes are designed to cause assertions to detect\n * inadvertent use of guard objects as temporaries. In other words,\n * when we have a guard object whose only purpose is its constructor and\n * destructor (and is never otherwise referenced), the intended use\n * might be:\n *\n *   AutoRestore savePainting(mIsPainting);\n *\n * but is is easy to accidentally write:\n *\n *   AutoRestore(mIsPainting);\n *\n * which compiles just fine, but runs the destructor well before the\n * intended time.\n *\n * They work by adding (#ifdef DEBUG) an additional parameter to the\n * guard object's constructor, with a default value, so that users of\n * the guard object's API do not need to do anything. The default value\n * of this parameter is a temporary object. C++ (ISO/IEC 14882:1998),\n * section 12.2 [class.temporary], clauses 4 and 5 seem to assume a\n * guarantee that temporaries are destroyed in the reverse of their\n * construction order, but I actually can't find a statement that that\n * is true in the general case (beyond the two specific cases mentioned\n * there). However, it seems to be true.\n *\n * These classes are intended to be used only via the macros immediately\n * below them:\n *\n *   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member\n *     variable, and should be put where a declaration of a private\n *     member variable would be placed.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the\n *     parameters to each constructor of the guard object; it declares\n *     (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM\n *     variant for constructors that take no other parameters.)\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in\n *     the implementation of such constructors when they are not inline.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in\n *     the implementation of such constructors to pass the parameter to\n *     a base class that also uses these macros\n *   MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each\n *     constructor. It uses the parameter declared by\n *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.\n *\n * For more details, and examples of using these macros, see\n * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla\n */\nclass MOZ_EXPORT GuardObjectNotifier\n{\n  private:\n    bool* statementDone;\n\n  public:\n    GuardObjectNotifier() : statementDone(nullptr) { }\n\n    ~GuardObjectNotifier() {\n      *statementDone = true;\n    }\n\n    void setStatementDone(bool* statementIsDone) {\n      statementDone = statementIsDone;\n    }\n};\n\nclass MOZ_EXPORT GuardObjectNotificationReceiver\n{\n  private:\n    bool statementDone;\n\n  public:\n    GuardObjectNotificationReceiver() : statementDone(false) { }\n\n    ~GuardObjectNotificationReceiver() {\n      /*\n       * Assert that the guard object was not used as a temporary.  (Note that\n       * this assert might also fire if init is not called because the guard\n       * object's implementation is not using the above macros correctly.)\n       */\n      MOZ_ASSERT(statementDone);\n    }\n\n    void init(const GuardObjectNotifier& constNotifier) {\n      /*\n       * constNotifier is passed as a const reference so that we can pass a\n       * temporary, but we really intend it as non-const.\n       */\n      GuardObjectNotifier& notifier = const_cast<GuardObjectNotifier&>(constNotifier);\n      notifier.setStatementDone(&statementDone);\n    }\n};\n\n} /* namespace detail */\n} /* namespace mozilla */\n\n#endif /* DEBUG */\n\n#ifdef DEBUG\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \\\n     mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary;\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \\\n     const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \\\n     const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \\\n     , _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \\\n       _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT \\\n     do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0)\n#else\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_GuardObjects_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/HashFunctions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Utilities for hashing. */\n\n/*\n * This file exports functions for hashing data down to a 32-bit value,\n * including:\n *\n *  - HashString    Hash a char* or uint16_t/wchar_t* of known or unknown\n *                  length.\n *\n *  - HashBytes     Hash a byte array of known length.\n *\n *  - HashGeneric   Hash one or more values.  Currently, we support uint32_t,\n *                  types which can be implicitly cast to uint32_t, data\n *                  pointers, and function pointers.\n *\n *  - AddToHash     Add one or more values to the given hash.  This supports the\n *                  same list of types as HashGeneric.\n *\n *\n * You can chain these functions together to hash complex objects.  For example:\n *\n *  class ComplexObject\n *  {\n *      char* str;\n *      uint32_t uint1, uint2;\n *      void (*callbackFn)();\n *\n *    public:\n *      uint32_t hash() {\n *        uint32_t hash = HashString(str);\n *        hash = AddToHash(hash, uint1, uint2);\n *        return AddToHash(hash, callbackFn);\n *      }\n *  };\n *\n * If you want to hash an nsAString or nsACString, use the HashString functions\n * in nsHashKeys.h.\n */\n\n#ifndef mozilla_HashFunctions_h\n#define mozilla_HashFunctions_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\n#ifdef __cplusplus\nnamespace mozilla {\n\n/**\n * The golden ratio as a 32-bit fixed-point value.\n */\nstatic const uint32_t GoldenRatioU32 = 0x9E3779B9U;\n\ninline uint32_t\nRotateBitsLeft32(uint32_t value, uint8_t bits)\n{\n  MOZ_ASSERT(bits < 32);\n  return (value << bits) | (value >> (32 - bits));\n}\n\nnamespace detail {\n\ninline uint32_t\nAddU32ToHash(uint32_t hash, uint32_t value)\n{\n  /*\n   * This is the meat of all our hash routines.  This hash function is not\n   * particularly sophisticated, but it seems to work well for our mostly\n   * plain-text inputs.  Implementation notes follow.\n   *\n   * Our use of the golden ratio here is arbitrary; we could pick almost any\n   * number which:\n   *\n   *  * is odd (because otherwise, all our hash values will be even)\n   *\n   *  * has a reasonably-even mix of 1's and 0's (consider the extreme case\n   *    where we multiply by 0x3 or 0xeffffff -- this will not produce good\n   *    mixing across all bits of the hash).\n   *\n   * The rotation length of 5 is also arbitrary, although an odd number is again\n   * preferable so our hash explores the whole universe of possible rotations.\n   *\n   * Finally, we multiply by the golden ratio *after* xor'ing, not before.\n   * Otherwise, if |hash| is 0 (as it often is for the beginning of a message),\n   * the expression\n   *\n   *   (GoldenRatioU32 * RotateBitsLeft(hash, 5)) |xor| value\n   *\n   * evaluates to |value|.\n   *\n   * (Number-theoretic aside: Because any odd number |m| is relatively prime to\n   * our modulus (2^32), the list\n   *\n   *    [x * m (mod 2^32) for 0 <= x < 2^32]\n   *\n   * has no duplicate elements.  This means that multiplying by |m| does not\n   * cause us to skip any possible hash values.\n   *\n   * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the\n   * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely\n   * multiply our hash value by |m| a few times without negating the\n   * multiplicative effect.  Our golden ratio constant has order 2^29, which is\n   * more than enough for our purposes.)\n   */\n  return GoldenRatioU32 * (RotateBitsLeft32(hash, 5) ^ value);\n}\n\n/**\n * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter.\n */\ntemplate<size_t PtrSize>\ninline uint32_t\nAddUintptrToHash(uint32_t hash, uintptr_t value);\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<4>(uint32_t hash, uintptr_t value)\n{\n  return AddU32ToHash(hash, static_cast<uint32_t>(value));\n}\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<8>(uint32_t hash, uintptr_t value)\n{\n  /*\n   * The static cast to uint64_t below is necessary because this function\n   * sometimes gets compiled on 32-bit platforms (yes, even though it's a\n   * template and we never call this particular override in a 32-bit build).  If\n   * we do value >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t\n   * right 32 bits, and the compiler throws an error.\n   */\n  uint32_t v1 = static_cast<uint32_t>(value);\n  uint32_t v2 = static_cast<uint32_t>(static_cast<uint64_t>(value) >> 32);\n  return AddU32ToHash(AddU32ToHash(hash, v1), v2);\n}\n\n} /* namespace detail */\n\n/**\n * AddToHash takes a hash and some values and returns a new hash based on the\n * inputs.\n *\n * Currently, we support hashing uint32_t's, values which we can implicitly\n * convert to uint32_t, data pointers, and function pointers.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A a)\n{\n  /*\n   * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,\n   * we'll error out.\n   */\n  return detail::AddU32ToHash(hash, a);\n}\n\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A* a)\n{\n  /*\n   * You might think this function should just take a void*.  But then we'd only\n   * catch data pointers and couldn't handle function pointers.\n   */\n\n  static_assert(sizeof(a) == sizeof(uintptr_t),\n                \"Strange pointer!\");\n\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, uintptr_t(a));\n}\n\ntemplate<>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, uintptr_t a)\n{\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b)\n{\n  return AddToHash(AddToHash(hash, a), b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c)\n{\n  return AddToHash(AddToHash(hash, a, b), c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d)\n{\n  return AddToHash(AddToHash(hash, a, b, c), d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d, E e)\n{\n  return AddToHash(AddToHash(hash, a, b, c, d), e);\n}\n\n/**\n * The HashGeneric class of functions let you hash one or more values.\n *\n * If you want to hash together two values x and y, calling HashGeneric(x, y) is\n * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes\n * that x has already been hashed.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a)\n{\n  return AddToHash(0, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b)\n{\n  return AddToHash(0, a, b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c)\n{\n  return AddToHash(0, a, b, c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d)\n{\n  return AddToHash(0, a, b, c, d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d, E e)\n{\n  return AddToHash(0, a, b, c, d, e);\n}\n\nnamespace detail {\n\ntemplate<typename T>\nuint32_t\nHashUntilZero(const T* str)\n{\n  uint32_t hash = 0;\n  for (T c; (c = *str); str++)\n    hash = AddToHash(hash, c);\n  return hash;\n}\n\ntemplate<typename T>\nuint32_t\nHashKnownLength(const T* str, size_t length)\n{\n  uint32_t hash = 0;\n  for (size_t i = 0; i < length; i++)\n    hash = AddToHash(hash, str[i]);\n  return hash;\n}\n\n} /* namespace detail */\n\n/**\n * The HashString overloads below do just what you'd expect.\n *\n * If you have the string's length, you might as well call the overload which\n * includes the length.  It may be marginally faster.\n */\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\n/*\n * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's\n * the same width!\n */\n#ifdef WIN32\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n#endif\n\n/**\n * Hash some number of bytes.\n *\n * This hash walks word-by-word, rather than byte-by-byte, so you won't get the\n * same result out of HashBytes as you would out of HashString.\n */\nMOZ_WARN_UNUSED_RESULT\nextern MFBT_API uint32_t\nHashBytes(const void* bytes, size_t length);\n\n} /* namespace mozilla */\n#endif /* __cplusplus */\n\n#endif /* mozilla_HashFunctions_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Likely.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a\n * boolean predicate should be branch-predicted.\n */\n\n#ifndef mozilla_Likely_h\n#define mozilla_Likely_h\n\n#if defined(__clang__) || defined(__GNUC__)\n#  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))\n#  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))\n#else\n#  define MOZ_LIKELY(x)   (!!(x))\n#  define MOZ_UNLIKELY(x) (!!(x))\n#endif\n\n#endif /* mozilla_Likely_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/LinkedList.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type-safe doubly-linked list class. */\n\n/*\n * The classes LinkedList<T> and LinkedListElement<T> together form a\n * convenient, type-safe doubly-linked list implementation.\n *\n * The class T which will be inserted into the linked list must inherit from\n * LinkedListElement<T>.  A given object may be in only one linked list at a\n * time.\n *\n * A LinkedListElement automatically removes itself from the list upon\n * destruction, and a LinkedList will fatally assert in debug builds if it's\n * non-empty when it's destructed.\n *\n * For example, you might use LinkedList in a simple observer list class as\n * follows.\n *\n *   class Observer : public LinkedListElement<Observer>\n *   {\n *     public:\n *       void observe(char* topic) { ... }\n *   };\n *\n *   class ObserverContainer\n *   {\n *     private:\n *       LinkedList<Observer> list;\n *\n *     public:\n *       void addObserver(Observer* observer) {\n *         // Will assert if |observer| is part of another list.\n *         list.insertBack(observer);\n *       }\n *\n *       void removeObserver(Observer* observer) {\n *         // Will assert if |observer| is not part of some list.\n *         observer.remove();\n *         // Or, will assert if |observer| is not part of |list| specifically.\n *         // observer.removeFrom(list);\n *       }\n *\n *       void notifyObservers(char* topic) {\n *         for (Observer* o = list.getFirst(); o != nullptr; o = o->getNext())\n *           o->observe(topic);\n *       }\n *   };\n *\n */\n\n#ifndef mozilla_LinkedList_h\n#define mozilla_LinkedList_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\ntemplate<typename T>\nclass LinkedList;\n\ntemplate<typename T>\nclass LinkedListElement\n{\n    /*\n     * It's convenient that we return nullptr when getNext() or getPrevious()\n     * hits the end of the list, but doing so costs an extra word of storage in\n     * each linked list node (to keep track of whether |this| is the sentinel\n     * node) and a branch on this value in getNext/getPrevious.\n     *\n     * We could get rid of the extra word of storage by shoving the \"is\n     * sentinel\" bit into one of the pointers, although this would, of course,\n     * have performance implications of its own.\n     *\n     * But the goal here isn't to win an award for the fastest or slimmest\n     * linked list; rather, we want a *convenient* linked list.  So we won't\n     * waste time guessing which micro-optimization strategy is best.\n     *\n     *\n     * Speaking of unnecessary work, it's worth addressing here why we wrote\n     * mozilla::LinkedList in the first place, instead of using stl::list.\n     *\n     * The key difference between mozilla::LinkedList and stl::list is that\n     * mozilla::LinkedList stores the prev/next pointers in the object itself,\n     * while stl::list stores the prev/next pointers in a list element which\n     * itself points to the object being stored.\n     *\n     * mozilla::LinkedList's approach makes it harder to store an object in more\n     * than one list.  But the upside is that you can call next() / prev() /\n     * remove() directly on the object.  With stl::list, you'd need to store a\n     * pointer to its iterator in the object in order to accomplish this.  Not\n     * only would this waste space, but you'd have to remember to update that\n     * pointer every time you added or removed the object from a list.\n     *\n     * In-place, constant-time removal is a killer feature of doubly-linked\n     * lists, and supporting this painlessly was a key design criterion.\n     */\n\n  private:\n    LinkedListElement* next;\n    LinkedListElement* prev;\n    const bool isSentinel;\n\n  public:\n    LinkedListElement()\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(false)\n    { }\n\n    ~LinkedListElement() {\n      if (!isSentinel && isInList())\n        remove();\n    }\n\n    /*\n     * Get the next element in the list, or nullptr if this is the last element\n     * in the list.\n     */\n    T* getNext() {\n      return next->asT();\n    }\n    const T* getNext() const {\n      return next->asT();\n    }\n\n    /*\n     * Get the previous element in the list, or nullptr if this is the first\n     * element in the list.\n     */\n    T* getPrevious() {\n      return prev->asT();\n    }\n    const T* getPrevious() const {\n      return prev->asT();\n    }\n\n    /*\n     * Insert elem after this element in the list.  |this| must be part of a\n     * linked list when you call setNext(); otherwise, this method will assert.\n     */\n    void setNext(T* elem) {\n        MOZ_ASSERT(isInList());\n        setNextUnsafe(elem);\n    }\n\n    /*\n     * Insert elem before this element in the list.  |this| must be part of a\n     * linked list when you call setPrevious(); otherwise, this method will\n     * assert.\n     */\n    void setPrevious(T* elem) {\n      MOZ_ASSERT(isInList());\n      setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Remove this element from the list which contains it.  If this element is\n     * not currently part of a linked list, this method asserts.\n     */\n    void remove() {\n      MOZ_ASSERT(isInList());\n\n      prev->next = next;\n      next->prev = prev;\n      next = this;\n      prev = this;\n    }\n\n    /*\n     * Identical to remove(), but also asserts in debug builds that this element\n     * is in list.\n     */\n    void removeFrom(const LinkedList<T>& list) {\n      list.assertContains(asT());\n      remove();\n    }\n\n    /*\n     * Return true if |this| part is of a linked list, and false otherwise.\n     */\n    bool isInList() const {\n      MOZ_ASSERT((next == this) == (prev == this));\n      return next != this;\n    }\n\n  private:\n    friend class LinkedList<T>;\n\n    enum NodeKind {\n      NODE_KIND_NORMAL,\n      NODE_KIND_SENTINEL\n    };\n\n    LinkedListElement(NodeKind nodeKind)\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(nodeKind == NODE_KIND_SENTINEL)\n    { }\n\n    /*\n     * Return |this| cast to T* if we're a normal node, or return nullptr if\n     * we're a sentinel node.\n     */\n    T* asT() {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<T*>(this);\n    }\n    const T* asT() const {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<const T*>(this);\n    }\n\n    /*\n     * Insert elem after this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertFront().\n     */\n    void setNextUnsafe(T* elem) {\n      LinkedListElement *listElem = static_cast<LinkedListElement*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this->next;\n      listElem->prev = this;\n      this->next->prev = listElem;\n      this->next = listElem;\n    }\n\n    /*\n     * Insert elem before this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertBack().\n     */\n    void setPreviousUnsafe(T* elem) {\n      LinkedListElement<T>* listElem = static_cast<LinkedListElement<T>*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this;\n      listElem->prev = this->prev;\n      this->prev->next = listElem;\n      this->prev = listElem;\n    }\n\n  private:\n    LinkedListElement& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedListElement(const LinkedList<T>& other) MOZ_DELETE;\n};\n\ntemplate<typename T>\nclass LinkedList\n{\n  private:\n    LinkedListElement<T> sentinel;\n\n  public:\n    LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }\n\n    ~LinkedList() {\n      MOZ_ASSERT(isEmpty());\n    }\n\n    /*\n     * Add elem to the front of the list.\n     */\n    void insertFront(T* elem) {\n      /* Bypass setNext()'s this->isInList() assertion. */\n      sentinel.setNextUnsafe(elem);\n    }\n\n    /*\n     * Add elem to the back of the list.\n     */\n    void insertBack(T* elem) {\n      sentinel.setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Get the first element of the list, or nullptr if the list is empty.\n     */\n    T* getFirst() {\n      return sentinel.getNext();\n    }\n    const T* getFirst() const {\n      return sentinel.getNext();\n    }\n\n    /*\n     * Get the last element of the list, or nullptr if the list is empty.\n     */\n    T* getLast() {\n      return sentinel.getPrevious();\n    }\n    const T* getLast() const {\n      return sentinel.getPrevious();\n    }\n\n    /*\n     * Get and remove the first element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popFirst() {\n      T* ret = sentinel.getNext();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Get and remove the last element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popLast() {\n      T* ret = sentinel.getPrevious();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Return true if the list is empty, or false otherwise.\n     */\n    bool isEmpty() const {\n      return !sentinel.isInList();\n    }\n\n    /*\n     * Remove all the elements from the list.\n     *\n     * This runs in time linear to the list's length, because we have to mark\n     * each element as not in the list.\n     */\n    void clear() {\n      while (popFirst())\n        continue;\n    }\n\n    /*\n     * In a debug build, make sure that the list is sane (no cycles, consistent\n     * next/prev pointers, only one sentinel).  Has no effect in release builds.\n     */\n    void debugAssertIsSane() const {\n#ifdef DEBUG\n      const LinkedListElement<T>* slow;\n      const LinkedListElement<T>* fast1;\n      const LinkedListElement<T>* fast2;\n\n      /*\n       * Check for cycles in the forward singly-linked list using the\n       * tortoise/hare algorithm.\n       */\n      for (slow = sentinel.next,\n           fast1 = sentinel.next->next,\n           fast2 = sentinel.next->next->next;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->next, fast1 = fast2->next, fast2 = fast1->next)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /* Check for cycles in the backward singly-linked list. */\n      for (slow = sentinel.prev,\n           fast1 = sentinel.prev->prev,\n           fast2 = sentinel.prev->prev->prev;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /*\n       * Check that |sentinel| is the only node in the list with\n       * isSentinel == true.\n       */\n      for (const LinkedListElement<T>* elem = sentinel.next;\n           elem != sentinel;\n           elem = elem->next)\n      {\n        MOZ_ASSERT(!elem->isSentinel);\n      }\n\n      /* Check that the next/prev pointers match up. */\n      const LinkedListElement<T>* prev = sentinel;\n      const LinkedListElement<T>* cur = sentinel.next;\n      do {\n          MOZ_ASSERT(cur->prev == prev);\n          MOZ_ASSERT(prev->next == cur);\n\n          prev = cur;\n          cur = cur->next;\n      } while (cur != sentinel);\n#endif /* ifdef DEBUG */\n    }\n\n  private:\n    friend class LinkedListElement<T>;\n\n    void assertContains(const T* t) const {\n#ifdef DEBUG\n      for (const T* elem = getFirst();\n           elem;\n           elem = elem->getNext())\n      {\n        if (elem == t)\n          return;\n      }\n      MOZ_CRASH(\"element wasn't found in this list!\");\n#endif\n    }\n\n    LinkedList& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedList(const LinkedList<T>& other) MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_LinkedList_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/MathAlgorithms.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt maths algorithms. */\n\n#ifndef mozilla_MathAlgorithms_h\n#define mozilla_MathAlgorithms_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <cmath>\n#include <limits.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n// Greatest Common Divisor\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidGCD(IntegerType a, IntegerType b)\n{\n  // Euclid's algorithm; O(N) in the worst case.  (There are better\n  // ways, but we don't need them for the current use of this algo.)\n  MOZ_ASSERT(a > 0);\n  MOZ_ASSERT(b > 0);\n\n  while (a != b) {\n    if (a > b) {\n      a = a - b;\n    } else {\n      b = b - a;\n    }\n  }\n\n  return a;\n}\n\n// Least Common Multiple\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidLCM(IntegerType a, IntegerType b)\n{\n  // Divide first to reduce overflow risk.\n  return (a / EuclidGCD(a, b)) * b;\n}\n\nnamespace detail {\n\ntemplate<typename T>\nstruct AllowDeprecatedAbsFixed : FalseType {};\n\ntemplate<> struct AllowDeprecatedAbsFixed<int32_t> : TrueType {};\ntemplate<> struct AllowDeprecatedAbsFixed<int64_t> : TrueType {};\n\ntemplate<typename T>\nstruct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};\n\ntemplate<> struct AllowDeprecatedAbs<int> : TrueType {};\ntemplate<> struct AllowDeprecatedAbs<long> : TrueType {};\n\n} // namespace detail\n\n// DO NOT USE DeprecatedAbs.  It exists only until its callers can be converted\n// to Abs below, and it will be removed when all callers have been changed.\ntemplate<typename T>\ninline typename mozilla::EnableIf<detail::AllowDeprecatedAbs<T>::value, T>::Type\nDeprecatedAbs(const T t)\n{\n  // The absolute value of the smallest possible value of a signed-integer type\n  // won't fit in that type (on twos-complement systems -- and we're blithely\n  // assuming we're on such systems, for the non-<stdint.h> types listed above),\n  // so assert that the input isn't that value.\n  //\n  // This is the case if: the value is non-negative; or if adding one (giving a\n  // value in the range [-maxvalue, 0]), then negating (giving a value in the\n  // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement,\n  // (minvalue + 1) == -maxvalue).\n  MOZ_ASSERT(t >= 0 ||\n             -(t + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1),\n             \"You can't negate the smallest possible negative integer!\");\n  return t >= 0 ? t : -t;\n}\n\nnamespace detail {\n\n// For now mozilla::Abs only takes intN_T, the signed natural types, and\n// float/double/long double.  Feel free to add overloads for other standard,\n// signed types if you need them.\n\ntemplate<typename T>\nstruct AbsReturnTypeFixed;\n\ntemplate<> struct AbsReturnTypeFixed<int8_t> { typedef uint8_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int16_t> { typedef uint16_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int32_t> { typedef uint32_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int64_t> { typedef uint64_t Type; };\n\ntemplate<typename T>\nstruct AbsReturnType : AbsReturnTypeFixed<T> {};\n\ntemplate<> struct AbsReturnType<char> : EnableIf<char(-1) < char(0), unsigned char> {};\ntemplate<> struct AbsReturnType<signed char> { typedef unsigned char Type; };\ntemplate<> struct AbsReturnType<short> { typedef unsigned short Type; };\ntemplate<> struct AbsReturnType<int> { typedef unsigned int Type; };\ntemplate<> struct AbsReturnType<long> { typedef unsigned long Type; };\ntemplate<> struct AbsReturnType<long long> { typedef unsigned long long Type; };\ntemplate<> struct AbsReturnType<float> { typedef float Type; };\ntemplate<> struct AbsReturnType<double> { typedef double Type; };\ntemplate<> struct AbsReturnType<long double> { typedef long double Type; };\n\n} // namespace detail\n\ntemplate<typename T>\ninline typename detail::AbsReturnType<T>::Type\nAbs(const T t)\n{\n  typedef typename detail::AbsReturnType<T>::Type ReturnType;\n  return t >= 0 ? ReturnType(t) : ~ReturnType(t) + 1;\n}\n\ntemplate<>\ninline float\nAbs<float>(const float f)\n{\n  return std::fabs(f);\n}\n\ntemplate<>\ninline double\nAbs<double>(const double d)\n{\n  return std::fabs(d);\n}\n\ntemplate<>\ninline long double\nAbs<long double>(const long double d)\n{\n  return std::fabs(d);\n}\n\n} // namespace mozilla\n\n#if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))\n#  define MOZ_BITSCAN_WINDOWS\n\n  extern \"C\" {\n    unsigned char _BitScanForward(unsigned long* Index, unsigned long mask);\n    unsigned char _BitScanReverse(unsigned long* Index, unsigned long mask);\n#  pragma intrinsic(_BitScanForward, _BitScanReverse)\n\n#  if defined(_M_AMD64) || defined(_M_X64)\n#    define MOZ_BITSCAN_WINDOWS64\n    unsigned char _BitScanForward64(unsigned long* index, unsigned __int64 mask);\n    unsigned char _BitScanReverse64(unsigned long* index, unsigned __int64 mask);\n#   pragma intrinsic(_BitScanForward64, _BitScanReverse64)\n#  endif\n  } // extern \"C\"\n\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n#if defined(MOZ_BITSCAN_WINDOWS)\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanReverse(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(31 - index);\n  }\n\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanForward(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(index);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanReverse64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(63 - index);\n#  else\n    uint32_t hi = uint32_t(u >> 32);\n    if (hi != 0)\n      return CountLeadingZeroes32(hi);\n    return 32 + CountLeadingZeroes32(uint32_t(u));\n#  endif\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanForward64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(index);\n#  else\n    uint32_t lo = uint32_t(u);\n    if (lo != 0)\n      return CountTrailingZeroes32(lo);\n    return 32 + CountTrailingZeroes32(uint32_t(u >> 32));\n#  endif\n  }\n\n#  ifdef MOZ_HAVE_BITSCAN64\n#    undef MOZ_HAVE_BITSCAN64\n#  endif\n\n#elif defined(__clang__) || defined(__GNUC__)\n\n#  if defined(__clang__)\n#    if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz)\n#      error \"A clang providing __builtin_c[lt]z is required to build\"\n#    endif\n#  else\n     // gcc has had __builtin_clz and friends since 3.4: no need to check.\n#  endif\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    return __builtin_clz(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    return __builtin_ctz(u);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n    return __builtin_clzll(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n    return __builtin_ctzll(u);\n  }\n\n#else\n#  error \"Implement these!\"\n  inline uint_fast8_t CountLeadingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountLeadingZeroes64(uint64_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes64(uint64_t u) MOZ_DELETE;\n#endif\n\n} // namespace detail\n\n/**\n * Compute the number of high-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the highest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountLeadingZeroes32(0xF0FF1000) is 0;\n * CountLeadingZeroes32(0x7F8F0001) is 1;\n * CountLeadingZeroes32(0x3FFF0100) is 2;\n * CountLeadingZeroes32(0x1FF50010) is 3; and so on.\n */\ninline uint_fast8_t\nCountLeadingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes32(u);\n}\n\n/**\n * Compute the number of low-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the lowest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountTrailingZeroes32(0x0100FFFF) is 0;\n * CountTrailingZeroes32(0x7000FFFE) is 1;\n * CountTrailingZeroes32(0x0080FFFC) is 2;\n * CountTrailingZeroes32(0x0080FFF8) is 3; and so on.\n */\ninline uint_fast8_t\nCountTrailingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes32(u);\n}\n\n/** Analogous to CountLeadingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountLeadingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes64(u);\n}\n\n/** Analogous to CountTrailingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountTrailingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes64(u);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass CeilingLog2;\n\ntemplate<typename T>\nclass CeilingLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 32 - CountLeadingZeroes32(t - 1);\n    }\n};\n\ntemplate<typename T>\nclass CeilingLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 64 - CountLeadingZeroes64(t - 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the least power of 2 greater than or equal to |t|.\n *\n * CeilingLog2(0..1) is 0;\n * CeilingLog2(2) is 1;\n * CeilingLog2(3..4) is 2;\n * CeilingLog2(5..8) is 3;\n * CeilingLog2(9..16) is 4; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nCeilingLog2(const T t)\n{\n  return detail::CeilingLog2<T>::compute(t);\n}\n\n/** A CeilingLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nCeilingLog2Size(size_t n)\n{\n  return CeilingLog2(n);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass FloorLog2;\n\ntemplate<typename T>\nclass FloorLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 31 - CountLeadingZeroes32(t | 1);\n    }\n};\n\ntemplate<typename T>\nclass FloorLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 63 - CountLeadingZeroes64(t | 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the greatest power of 2 less than or equal to |t|.\n *\n * FloorLog2(0..1) is 0;\n * FloorLog2(2..3) is 1;\n * FloorLog2(4..7) is 2;\n * FloorLog2(8..15) is 3; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nFloorLog2(const T t)\n{\n  return detail::FloorLog2<T>::compute(t);\n}\n\n/** A FloorLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nFloorLog2Size(size_t n)\n{\n  return FloorLog2(n);\n}\n\n/*\n * Compute the smallest power of 2 greater than or equal to |x|.  |x| must not\n * be so great that the computed value would overflow |size_t|.\n */\ninline size_t\nRoundUpPow2(size_t x)\n{\n  MOZ_ASSERT(x <= (size_t(1) << (sizeof(size_t) * CHAR_BIT - 1)),\n             \"can't round up -- will overflow!\");\n  return size_t(1) << CeilingLog2(x);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_MathAlgorithms_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/MemoryChecking.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides a common interface to the ASan (AddressSanitizer) and Valgrind \n * functions used to mark memory in certain ways. In detail, the following\n * three macros are provided:\n *\n *   MOZ_MAKE_MEM_NOACCESS  - Mark memory as unsafe to access (e.g. freed)\n *   MOZ_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined\n *   MOZ_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined\n *\n * With Valgrind in use, these directly map to the three respective Valgrind\n * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory,\n * while the UNDEFINED/DEFINED macros unpoison memory.\n *\n * With no memory checker available, all macros expand to the empty statement.\n */\n\n#ifndef mozilla_MemoryChecking_h\n#define mozilla_MemoryChecking_h\n\n#if defined(MOZ_VALGRIND)\n#include \"valgrind/memcheck.h\"\n#endif\n\n#if defined(MOZ_ASAN) || defined(MOZ_VALGRIND)\n#define MOZ_HAVE_MEM_CHECKS 1\n#endif\n\n#if defined(MOZ_ASAN)\n#include <stddef.h>\n\nextern \"C\" {\n  /* These definitions are usually provided through the \n   * sanitizer/asan_interface.h header installed by ASan.\n   */\n  void __asan_poison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n  void __asan_unpoison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  __asan_poison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n}\n#elif defined(MOZ_VALGRIND)\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  VALGRIND_MAKE_MEM_NOACCESS((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_UNDEFINED((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_DEFINED((addr), (size))\n#else\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_DEFINED(addr, size) do {} while(0)\n\n#endif\n\n#endif /* mozilla_MemoryChecking_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/MemoryReporting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Memory reporting infrastructure. */\n\n#ifndef mozilla_MemoryReporting_h\n#define mozilla_MemoryReporting_h\n\n#include <stddef.h>\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This is for functions that are like malloc_usable_size.  Such functions are\n * used for measuring the size of data structures.\n */\ntypedef size_t (*MallocSizeOf)(const void* p);\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\ntypedef size_t (*MozMallocSizeOf)(const void* p);\n\n#endif /* mozilla_MemoryReporting_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Move.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* C++11-style, but C++98-usable, \"move references\" implementation. */\n\n#ifndef mozilla_Move_h\n#define mozilla_Move_h\n\nnamespace mozilla {\n\n/*\n * \"Move\" References\n *\n * Some types can be copied much more efficiently if we know the original's\n * value need not be preserved --- that is, if we are doing a \"move\", not a\n * \"copy\". For example, if we have:\n *\n *   Vector<T> u;\n *   Vector<T> v(u);\n *\n * the constructor for v must apply a copy constructor to each element of u ---\n * taking time linear in the length of u. However, if we know we will not need u\n * any more once v has been initialized, then we could initialize v very\n * efficiently simply by stealing u's dynamically allocated buffer and giving it\n * to v --- a constant-time operation, regardless of the size of u.\n *\n * Moves often appear in container implementations. For example, when we append\n * to a vector, we may need to resize its buffer. This entails moving each of\n * its extant elements from the old, smaller buffer to the new, larger buffer.\n * But once the elements have been migrated, we're just going to throw away the\n * old buffer; we don't care if they still have their values. So if the vector's\n * element type can implement \"move\" more efficiently than \"copy\", the vector\n * resizing should by all means use a \"move\" operation. Hash tables also need to\n * be resized.\n *\n * The details of the optimization, and whether it's worth applying, vary from\n * one type to the next. And while some constructor calls are moves, many really\n * are copies, and can't be optimized this way. So we need:\n *\n * 1) a way for a particular invocation of a copy constructor to say that it's\n *    really a move, and that the value of the original isn't important\n *    afterwards (although it must still be safe to destroy); and\n *\n * 2) a way for a type (like Vector) to announce that it can be moved more\n *    efficiently than it can be copied, and provide an implementation of that\n *    move operation.\n *\n * The Move(T&) function takes a reference to a T, and returns a MoveRef<T>\n * referring to the same value; that's 1). A MoveRef<T> is simply a reference\n * to a T, annotated to say that a copy constructor applied to it may move that\n * T, instead of copying it. Finally, a constructor that accepts an MoveRef<T>\n * should perform a more efficient move, instead of a copy, providing 2).\n *\n * So, where we might define a copy constructor for a class C like this:\n *\n *   C(const C& rhs) { ... copy rhs to this ... }\n *\n * we would declare a move constructor like this:\n *\n *   C(MoveRef<C> rhs) { ... move rhs to this ... }\n *\n * And where we might perform a copy like this:\n *\n *   C c2(c1);\n *\n * we would perform a move like this:\n *\n *   C c2(Move(c1))\n *\n * Note that MoveRef<T> implicitly converts to T&, so you can pass a MoveRef<T>\n * to an ordinary copy constructor for a type that doesn't support a special\n * move constructor, and you'll just get a copy.  This means that templates can\n * use Move whenever they know they won't use the original value any more, even\n * if they're not sure whether the type at hand has a specialized move\n * constructor.  If it doesn't, the MoveRef<T> will just convert to a T&, and\n * the ordinary copy constructor will apply.\n *\n * A class with a move constructor can also provide a move assignment operator,\n * which runs this's destructor, and then applies the move constructor to\n * *this's memory. A typical definition:\n *\n *   C& operator=(MoveRef<C> rhs) {\n *     this->~C();\n *     new(this) C(rhs);\n *     return *this;\n *   }\n *\n * With that in place, one can write move assignments like this:\n *\n *   c2 = Move(c1);\n *\n * This destroys c1, moves c1's value to c2, and leaves c1 in an undefined but\n * destructible state.\n *\n * This header file defines MoveRef and Move in the mozilla namespace.  It's up\n * to individual containers to annotate moves as such, by calling Move; and it's\n * up to individual types to define move constructors.\n *\n * One hint: if you're writing a move constructor where the type has members\n * that should be moved themselves, it's much nicer to write this:\n *\n *   C(MoveRef<C> c) : x(Move(c->x)), y(Move(c->y)) { }\n *\n * than the equivalent:\n *\n *   C(MoveRef<C> c) { new(&x) X(Move(c->x)); new(&y) Y(Move(c->y)); }\n *\n * especially since GNU C++ fails to notice that this does indeed initialize x\n * and y, which may matter if they're const.\n */\ntemplate<typename T>\nclass MoveRef\n{\n    T* pointer;\n\n  public:\n    explicit MoveRef(T& t) : pointer(&t) { }\n    T& operator*() const { return *pointer; }\n    T* operator->() const { return pointer; }\n    operator T& () const { return *pointer; }\n};\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(T& t)\n{\n  return MoveRef<T>(t);\n}\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(const T& t)\n{\n  // With some versions of gcc, for a class C, there's an (incorrect) ambiguity\n  // between the C(const C&) constructor and the default C(C&&) C++11 move\n  // constructor, when the constructor is called with a const C& argument.\n  //\n  // This ambiguity manifests with the Move implementation above when Move is\n  // passed const U& for some class U.  Calling Move(const U&) returns a\n  // MoveRef<const U&>, which is then commonly passed to the U constructor,\n  // triggering an implicit conversion to const U&.  gcc doesn't know whether to\n  // call U(const U&) or U(U&&), so it wrongly reports a compile error.\n  //\n  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50442 has since been fixed, so\n  // this is no longer an issue for up-to-date compilers.  But there's no harm\n  // in keeping it around for older compilers, so we might as well.  See also\n  // bug 686280.\n  return MoveRef<T>(const_cast<T&>(t));\n}\n\n/** Swap |t| and |u| using move-construction if possible. */\ntemplate<typename T>\ninline void\nSwap(T& t, T& u)\n{\n  T tmp(Move(t));\n  t = Move(u);\n  u = Move(tmp);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Move_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/NullPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a workaround for compilers which do not support the C++11 nullptr\n * constant.\n */\n\n#ifndef mozilla_NullPtr_h\n#define mozilla_NullPtr_h\n\n#include \"mozilla/Compiler.h\"\n\n#if defined(__clang__)\n#  ifndef __has_extension\n#    define __has_extension __has_feature\n#  endif\n#  if __has_extension(cxx_nullptr)\n#    define MOZ_HAVE_CXX11_NULLPTR\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_NULLPTR\n#    endif\n#  endif\n#elif _MSC_VER >= 1600\n# define MOZ_HAVE_CXX11_NULLPTR\n#endif\n\n/**\n * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal\n * with the correct size to match the size of a pointer on a given platform.\n */\n\n#ifndef MOZ_HAVE_CXX11_NULLPTR\n#  if defined(__GNUC__)\n#    define nullptr __null\n#  elif defined(_WIN64)\n#    define nullptr 0LL\n#  else\n#    define nullptr 0L\n#  endif\n#endif\n\n#endif /* mozilla_NullPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/PodOperations.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Operations for zeroing POD types, arrays, and so on.\n *\n * These operations are preferable to memset, memcmp, and the like because they\n * don't require remembering to multiply by sizeof(T), array lengths, and so on\n * everywhere.\n */\n\n#ifndef mozilla_PodOperations_h\n#define mozilla_PodOperations_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include <string.h>\n\nnamespace mozilla {\n\n/** Set the contents of |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t)\n{\n  memset(t, 0, sizeof(T));\n}\n\n/** Set the contents of |nelem| elements starting at |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t, size_t nelem)\n{\n  /*\n   * This function is often called with 'nelem' small; we use an inline loop\n   * instead of calling 'memset' with a non-constant length.  The compiler\n   * should inline the memset call with constant size, though.\n   */\n  for (T* end = t + nelem; t < end; t++)\n    memset(t, 0, sizeof(T));\n}\n\n/*\n * Arrays implicitly convert to pointers to their first element, which is\n * dangerous when combined with the above PodZero definitions.  Adding an\n * overload for arrays is ambiguous, so we need another identifier.  The\n * ambiguous overload is left to catch mistaken uses of PodZero; if you get a\n * compile error involving PodZero and array types, use PodArrayZero instead.\n */\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N]) MOZ_DELETE;\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N], size_t nelem) MOZ_DELETE;\n\n/** Set the contents of the array |t| to zero. */\ntemplate <class T, size_t N>\nstatic void\nPodArrayZero(T (&t)[N])\n{\n  memset(t, 0, N * sizeof(T));\n}\n\n/**\n * Assign |*src| to |*dst|.  The locations must not be the same and must not\n * overlap.\n */\ntemplate<typename T>\nstatic void\nPodAssign(T* dst, const T* src)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= 1);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= 1);\n  memcpy(reinterpret_cast<char*>(dst), reinterpret_cast<const char*>(src), sizeof(T));\n}\n\n/**\n * Copy |nelem| T elements from |src| to |dst|.  The two memory ranges must not\n * overlap!\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(T* dst, const T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= nelem);\n\n  if (nelem < 128) {\n    /*\n     * Avoid using operator= in this loop, as it may have been\n     * intentionally deleted by the POD type.\n     */\n    for (const T* srcend = src + nelem; src < srcend; src++, dst++)\n      PodAssign(dst, src);\n  } else {\n    memcpy(dst, src, nelem * sizeof(T));\n  }\n}\n\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(volatile T* dst, const volatile T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst,\n                PointerRangeSize(src, static_cast<const volatile T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src,\n                PointerRangeSize(static_cast<const volatile T*>(dst), src) >= nelem);\n\n  /*\n   * Volatile |dst| requires extra work, because it's undefined behavior to\n   * modify volatile objects using the mem* functions.  Just write out the\n   * loops manually, using operator= rather than memcpy for the same reason,\n   * and let the compiler optimize to the extent it can.\n   */\n  for (const volatile T* srcend = src + nelem; src < srcend; src++, dst++)\n    *dst = *src;\n}\n\n/*\n * Copy the contents of the array |src| into the array |dst|, both of size N.\n * The arrays must not overlap!\n */\ntemplate <class T, size_t N>\nstatic void\nPodArrayCopy(T (&dst)[N], const T (&src)[N])\n{\n  PodCopy(dst, src, N);\n}\n\n/**\n * Determine whether the |len| elements at |one| are memory-identical to the\n * |len| elements at |two|.\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static bool\nPodEqual(const T* one, const T* two, size_t len)\n{\n  if (len < 128) {\n    const T* p1end = one + len;\n    const T* p1 = one;\n    const T* p2 = two;\n    for (; p1 < p1end; p1++, p2++) {\n      if (*p1 != *p2)\n        return false;\n    }\n    return true;\n  }\n\n  return !memcmp(one, two, len * sizeof(T));\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_PodOperations_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Poison.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A poison value that can be used to fill a memory space with\n * an address that leads to a safe crash when dereferenced.\n */\n\n#ifndef mozilla_Poison_h\n#define mozilla_Poison_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\nMOZ_BEGIN_EXTERN_C\n\nextern MFBT_DATA uintptr_t gMozillaPoisonValue;\n\n/**\n * @return the poison value.\n */\ninline uintptr_t mozPoisonValue()\n{\n  return gMozillaPoisonValue;\n}\n\n/**\n * Overwrite the memory block of aSize bytes at aPtr with the poison value.\n * aPtr MUST be aligned at a sizeof(uintptr_t) boundary.\n * Only an even number of sizeof(uintptr_t) bytes are overwritten, the last\n * few bytes (if any) is not overwritten.\n */\ninline void mozWritePoison(void* aPtr, size_t aSize)\n{\n  const uintptr_t POISON = mozPoisonValue();\n  char* p = (char*)aPtr;\n  char* limit = p + aSize;\n  MOZ_ASSERT((uintptr_t)aPtr % sizeof(uintptr_t) == 0, \"bad alignment\");\n  MOZ_ASSERT(aSize >= sizeof(uintptr_t), \"poisoning this object has no effect\");\n  for (; p < limit; p += sizeof(uintptr_t)) {\n    *((uintptr_t*)p) = POISON;\n  }\n}\n\n/**\n * Initialize the poison value.\n * This should only be called once.\n */\nextern MFBT_API void mozPoisonValueInit();\n\n/* Values annotated by CrashReporter */\nextern MFBT_DATA uintptr_t gMozillaPoisonBase;\nextern MFBT_DATA uintptr_t gMozillaPoisonSize;\n\nMOZ_END_EXTERN_C\n\n#endif /* mozilla_Poison_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Range.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef mozilla_Range_h\n#define mozilla_Range_h\n\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RangedPtr.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\n// Range<T> is a tuple containing a pointer and a length.\ntemplate <typename T>\nclass Range\n{\n    RangedPtr<T> mStart;\n    RangedPtr<T> mEnd;\n\n    typedef void (Range::* ConvertibleToBool)();\n    void nonNull() {}\n\n  public:\n    Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {}\n    Range(T* p, size_t len)\n      : mStart(p, p, p + len),\n        mEnd(p + len, p, p + len)\n    {}\n\n    RangedPtr<T> start() const { return mStart; }\n    RangedPtr<T> end() const { return mEnd; }\n    size_t length() const { return mEnd - mStart; }\n\n    T& operator[](size_t offset) {\n      return mStart[offset];\n    }\n\n    const T& operator[](size_t offset) const {\n      return mStart[offset];\n    }\n\n    operator ConvertibleToBool() const { return mStart ? &Range::nonNull : 0; }\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Range_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/RangedPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a smart pointer asserted to remain within a range specified at\n * construction.\n */\n\n#ifndef mozilla_RangedPtr_h\n#define mozilla_RangedPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Util.h\"\n\nnamespace mozilla {\n\n/*\n * RangedPtr is a smart pointer restricted to an address range specified at\n * creation.  The pointer (and any smart pointers derived from it) must remain\n * within the range [start, end] (inclusive of end to facilitate use as\n * sentinels).  Dereferencing or indexing into the pointer (or pointers derived\n * from it) must remain within the range [start, end).  All the standard pointer\n * operators are defined on it; in debug builds these operations assert that the\n * range specified at construction is respected.\n *\n * In theory passing a smart pointer instance as an argument can be slightly\n * slower than passing a T* (due to ABI requirements for passing structs versus\n * passing pointers), if the method being called isn't inlined.  If you are in\n * extremely performance-critical code, you may want to be careful using this\n * smart pointer as an argument type.\n *\n * RangedPtr<T> intentionally does not implicitly convert to T*.  Use get() to\n * explicitly convert to T*.  Keep in mind that the raw pointer of course won't\n * implement bounds checking in debug builds.\n */\ntemplate<typename T>\nclass RangedPtr\n{\n    T* ptr;\n\n#ifdef DEBUG\n    T* const rangeStart;\n    T* const rangeEnd;\n#endif\n\n    typedef void (RangedPtr::* ConvertibleToBool)();\n    void nonNull() {}\n\n    void checkSanity() {\n      MOZ_ASSERT(rangeStart <= ptr);\n      MOZ_ASSERT(ptr <= rangeEnd);\n    }\n\n    /* Creates a new pointer for |p|, restricted to this pointer's range. */\n    RangedPtr<T> create(T *p) const {\n#ifdef DEBUG\n      return RangedPtr<T>(p, rangeStart, rangeEnd);\n#else\n      return RangedPtr<T>(p, nullptr, size_t(0));\n#endif\n    }\n\n    uintptr_t asUintptr() const { return uintptr_t(ptr); }\n\n  public:\n    RangedPtr(T* p, T* start, T* end)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(end)\n#endif\n    {\n      MOZ_ASSERT(rangeStart <= rangeEnd);\n      checkSanity();\n    }\n    RangedPtr(T* p, T* start, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(start + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(p, p, length). */\n    RangedPtr(T* p, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(p), rangeEnd(p + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(arr, arr, N). */\n    template<size_t N>\n    RangedPtr(T (&arr)[N])\n      : ptr(arr)\n#ifdef DEBUG\n      , rangeStart(arr), rangeEnd(arr + N)\n#endif\n    {\n      checkSanity();\n    }\n\n    T* get() const {\n      return ptr;\n    }\n\n    operator ConvertibleToBool() const { return ptr ? &RangedPtr::nonNull : 0; }\n\n    /*\n     * You can only assign one RangedPtr into another if the two pointers have\n     * the same valid range:\n     *\n     *   char arr1[] = \"hi\";\n     *   char arr2[] = \"bye\";\n     *   RangedPtr<char> p1(arr1, 2);\n     *   p1 = RangedPtr<char>(arr1 + 1, arr1, arr1 + 2); // works\n     *   p1 = RangedPtr<char>(arr2, 3);                  // asserts\n     */\n    RangedPtr<T>& operator=(const RangedPtr<T>& other) {\n      MOZ_ASSERT(rangeStart == other.rangeStart);\n      MOZ_ASSERT(rangeEnd == other.rangeEnd);\n      ptr = other.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T> operator+(size_t inc) {\n      MOZ_ASSERT(inc <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() + inc * sizeof(T) >= asUintptr());\n      return create(ptr + inc);\n    }\n\n    RangedPtr<T> operator-(size_t dec) {\n      MOZ_ASSERT(dec <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() - dec * sizeof(T) <= asUintptr());\n      return create(ptr - dec);\n    }\n\n    /*\n     * You can assign a raw pointer into a RangedPtr if the raw pointer is\n     * within the range specified at creation.\n     */\n    template <typename U>\n    RangedPtr<T>& operator=(U* p) {\n      *this = create(p);\n      return *this;\n    }\n\n    template <typename U>\n    RangedPtr<T>& operator=(const RangedPtr<U>& p) {\n      MOZ_ASSERT(rangeStart <= p.ptr);\n      MOZ_ASSERT(p.ptr <= rangeEnd);\n      ptr = p.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T>& operator++() {\n      return (*this += 1);\n    }\n\n    RangedPtr<T> operator++(int) {\n      RangedPtr<T> rcp = *this;\n      ++*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator--() {\n      return (*this -= 1);\n    }\n\n    RangedPtr<T> operator--(int) {\n      RangedPtr<T> rcp = *this;\n      --*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator+=(size_t inc) {\n      *this = *this + inc;\n      return *this;\n    }\n\n    RangedPtr<T>& operator-=(size_t dec) {\n      *this = *this - dec;\n      return *this;\n    }\n\n    T& operator[](int index) const {\n      MOZ_ASSERT(size_t(index > 0 ? index : -index) <= size_t(-1) / sizeof(T));\n      return *create(ptr + index);\n    }\n\n    T& operator*() const {\n      return *ptr;\n    }\n\n    template <typename U>\n    bool operator==(const RangedPtr<U>& other) const {\n      return ptr == other.ptr;\n    }\n    template <typename U>\n    bool operator!=(const RangedPtr<U>& other) const {\n      return !(*this == other);\n    }\n\n    template<typename U>\n    bool operator==(const U* u) const {\n      return ptr == u;\n    }\n    template<typename U>\n    bool operator!=(const U* u) const {\n      return !(*this == u);\n    }\n\n    template <typename U>\n    bool operator<(const RangedPtr<U>& other) const {\n      return ptr < other.ptr;\n    }\n    template <typename U>\n    bool operator<=(const RangedPtr<U>& other) const {\n      return ptr <= other.ptr;\n    }\n\n    template <typename U>\n    bool operator>(const RangedPtr<U>& other) const {\n      return ptr > other.ptr;\n    }\n    template <typename U>\n    bool operator>=(const RangedPtr<U>& other) const {\n      return ptr >= other.ptr;\n    }\n\n    size_t operator-(const RangedPtr<T>& other) const {\n      MOZ_ASSERT(ptr >= other.ptr);\n      return PointerRangeSize(other.ptr, ptr);\n    }\n\n  private:\n    RangedPtr() MOZ_DELETE;\n    T* operator&() MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_RangedPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/ReentrancyGuard.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Small helper class for asserting uses of a class are non-reentrant. */\n\n#ifndef mozilla_ReentrancyGuard_h\n#define mozilla_ReentrancyGuard_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n\nnamespace mozilla {\n\n/* Useful for implementing containers that assert non-reentrancy */\nclass ReentrancyGuard\n{\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#ifdef DEBUG\n    bool& entered;\n#endif\n\n  public:\n    template<class T>\n#ifdef DEBUG\n    ReentrancyGuard(T& obj\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : entered(obj.entered)\n#else\n    ReentrancyGuard(T&\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n#endif\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n#ifdef DEBUG\n      MOZ_ASSERT(!entered);\n      entered = true;\n#endif\n    }\n    ~ReentrancyGuard()\n    {\n#ifdef DEBUG\n      entered = false;\n#endif\n    }\n\n  private:\n    ReentrancyGuard(const ReentrancyGuard&) MOZ_DELETE;\n    void operator=(const ReentrancyGuard&) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_ReentrancyGuard_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/RefPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Helpers for defining and using refcounted objects. */\n\n#ifndef mozilla_RefPtr_h\n#define mozilla_RefPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate<typename T> class RefCounted;\ntemplate<typename T> class RefPtr;\ntemplate<typename T> class TemporaryRef;\ntemplate<typename T> class OutParamRef;\ntemplate<typename T> OutParamRef<T> byRef(RefPtr<T>&);\n\n/**\n * RefCounted<T> is a sort of a \"mixin\" for a class T.  RefCounted\n * manages, well, refcounting for T, and because RefCounted is\n * parameterized on T, RefCounted<T> can call T's destructor directly.\n * This means T doesn't need to have a virtual dtor and so doesn't\n * need a vtable.\n *\n * RefCounted<T> is created with refcount == 0.  Newly-allocated\n * RefCounted<T> must immediately be assigned to a RefPtr to make the\n * refcount > 0.  It's an error to allocate and free a bare\n * RefCounted<T>, i.e. outside of the RefPtr machinery.  Attempts to\n * do so will abort DEBUG builds.\n *\n * Live RefCounted<T> have refcount > 0.  The lifetime (refcounts) of\n * live RefCounted<T> are controlled by RefPtr<T> and\n * RefPtr<super/subclass of T>.  Upon a transition from refcounted==1\n * to 0, the RefCounted<T> \"dies\" and is destroyed.  The \"destroyed\"\n * state is represented in DEBUG builds by refcount==0xffffdead.  This\n * state distinguishes use-before-ref (refcount==0) from\n * use-after-destroy (refcount==0xffffdead).\n */\nnamespace detail {\n#ifdef DEBUG\nstatic const int DEAD = 0xffffdead;\n#endif\n\n// This is used WeakPtr.h as well as this file.\nenum RefCountAtomicity\n{\n  AtomicRefCount,\n  NonAtomicRefCount\n};\n\ntemplate<typename T, RefCountAtomicity Atomicity>\nclass RefCounted\n{\n    friend class RefPtr<T>;\n\n  protected:\n    RefCounted() : refCnt(0) { }\n    ~RefCounted() {\n      MOZ_ASSERT(refCnt == detail::DEAD);\n    }\n\n  public:\n    // Compatibility with nsRefPtr.\n    void AddRef() {\n      MOZ_ASSERT(refCnt >= 0);\n      ++refCnt;\n    }\n\n    void Release() {\n      MOZ_ASSERT(refCnt > 0);\n      if (0 == --refCnt) {\n#ifdef DEBUG\n        refCnt = detail::DEAD;\n#endif\n        delete static_cast<T*>(this);\n      }\n    }\n\n    // Compatibility with wtf::RefPtr.\n    void ref() { AddRef(); }\n    void deref() { Release(); }\n    int refCount() const { return refCnt; }\n    bool hasOneRef() const {\n      MOZ_ASSERT(refCnt > 0);\n      return refCnt == 1;\n    }\n\n  private:\n    typename Conditional<Atomicity == AtomicRefCount, Atomic<int>, int>::Type refCnt;\n};\n\n}\n\ntemplate<typename T>\nclass RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>\n{\n  public:\n    ~RefCounted() {\n      static_assert(IsBaseOf<RefCounted, T>::value,\n                    \"T must derive from RefCounted<T>\");\n    }\n};\n\n/**\n * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated\n * reference counter.\n */\ntemplate<typename T>\nclass AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>\n{\n  public:\n    ~AtomicRefCounted() {\n      static_assert(IsBaseOf<AtomicRefCounted, T>::value,\n                    \"T must derive from AtomicRefCounted<T>\");\n    }\n};\n\n/**\n * RefPtr points to a refcounted thing that has AddRef and Release\n * methods to increase/decrease the refcount, respectively.  After a\n * RefPtr<T> is assigned a T*, the T* can be used through the RefPtr\n * as if it were a T*.\n *\n * A RefPtr can forget its underlying T*, which results in the T*\n * being wrapped in a temporary object until the T* is either\n * re-adopted from or released by the temporary.\n */\ntemplate<typename T>\nclass RefPtr\n{\n    // To allow them to use unref()\n    friend class TemporaryRef<T>;\n    friend class OutParamRef<T>;\n\n    struct DontRef {};\n\n  public:\n    RefPtr() : ptr(0) { }\n    RefPtr(const RefPtr& o) : ptr(ref(o.ptr)) {}\n    RefPtr(const TemporaryRef<T>& o) : ptr(o.drop()) {}\n    RefPtr(T* t) : ptr(ref(t)) {}\n\n    template<typename U>\n    RefPtr(const RefPtr<U>& o) : ptr(ref(o.get())) {}\n\n    ~RefPtr() { unref(ptr); }\n\n    RefPtr& operator=(const RefPtr& o) {\n      assign(ref(o.ptr));\n      return *this;\n    }\n    RefPtr& operator=(const TemporaryRef<T>& o) {\n      assign(o.drop());\n      return *this;\n    }\n    RefPtr& operator=(T* t) {\n      assign(ref(t));\n      return *this;\n    }\n\n    template<typename U>\n    RefPtr& operator=(const RefPtr<U>& o) {\n      assign(ref(o.get()));\n      return *this;\n    }\n\n    TemporaryRef<T> forget() {\n      T* tmp = ptr;\n      ptr = 0;\n      return TemporaryRef<T>(tmp, DontRef());\n    }\n\n    T* get() const { return ptr; }\n    operator T*() const { return ptr; }\n    T* operator->() const { return ptr; }\n    T& operator*() const { return *ptr; }\n    template<typename U>\n    operator TemporaryRef<U>() { return TemporaryRef<U>(ptr); }\n\n  private:\n    void assign(T* t) {\n      unref(ptr);\n      ptr = t;\n    }\n\n    T* ptr;\n\n    static MOZ_ALWAYS_INLINE T* ref(T* t) {\n      if (t)\n        t->AddRef();\n      return t;\n    }\n\n    static MOZ_ALWAYS_INLINE void unref(T* t) {\n      if (t)\n        t->Release();\n    }\n};\n\n/**\n * TemporaryRef<T> represents an object that holds a temporary\n * reference to a T.  TemporaryRef objects can't be manually ref'd or\n * unref'd (being temporaries, not lvalues), so can only relinquish\n * references to other objects, or unref on destruction.\n */\ntemplate<typename T>\nclass TemporaryRef\n{\n    // To allow it to construct TemporaryRef from a bare T*\n    friend class RefPtr<T>;\n\n    typedef typename RefPtr<T>::DontRef DontRef;\n\n  public:\n    TemporaryRef(T* t) : ptr(RefPtr<T>::ref(t)) {}\n    TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {}\n\n    template<typename U>\n    TemporaryRef(const TemporaryRef<U>& o) : ptr(o.drop()) {}\n\n    ~TemporaryRef() { RefPtr<T>::unref(ptr); }\n\n    T* drop() const {\n      T* tmp = ptr;\n      ptr = 0;\n      return tmp;\n    }\n\n  private:\n    TemporaryRef(T* t, const DontRef&) : ptr(t) {}\n\n    mutable T* ptr;\n\n    TemporaryRef() MOZ_DELETE;\n    void operator=(const TemporaryRef&) MOZ_DELETE;\n};\n\n/**\n * OutParamRef is a wrapper that tracks a refcounted pointer passed as\n * an outparam argument to a function.  OutParamRef implements COM T**\n * outparam semantics: this requires the callee to AddRef() the T*\n * returned through the T** outparam on behalf of the caller.  This\n * means the caller (through OutParamRef) must Release() the old\n * object contained in the tracked RefPtr.  It's OK if the callee\n * returns the same T* passed to it through the T** outparam, as long\n * as the callee obeys the COM discipline.\n *\n * Prefer returning TemporaryRef<T> from functions over creating T**\n * outparams and passing OutParamRef<T> to T**.  Prefer RefPtr<T>*\n * outparams over T** outparams.\n */\ntemplate<typename T>\nclass OutParamRef\n{\n    friend OutParamRef byRef<T>(RefPtr<T>&);\n\n  public:\n    ~OutParamRef() {\n      RefPtr<T>::unref(refPtr.ptr);\n      refPtr.ptr = tmp;\n    }\n\n    operator T**() { return &tmp; }\n\n  private:\n    OutParamRef(RefPtr<T>& p) : refPtr(p), tmp(p.get()) {}\n\n    RefPtr<T>& refPtr;\n    T* tmp;\n\n    OutParamRef() MOZ_DELETE;\n    OutParamRef& operator=(const OutParamRef&) MOZ_DELETE;\n};\n\n/**\n * byRef cooperates with OutParamRef to implement COM outparam semantics.\n */\ntemplate<typename T>\nOutParamRef<T>\nbyRef(RefPtr<T>& ptr)\n{\n  return OutParamRef<T>(ptr);\n}\n\n} // namespace mozilla\n\n#if 0\n\n// Command line that builds these tests\n//\n//   cp RefPtr.h test.cc && g++ -g -Wall -pedantic -DDEBUG -o test test.cc && ./test\n\nusing namespace mozilla;\n\nstruct Foo : public RefCounted<Foo>\n{\n  Foo() : dead(false) { }\n  ~Foo() {\n    MOZ_ASSERT(!dead);\n    dead = true;\n    numDestroyed++;\n  }\n\n  bool dead;\n  static int numDestroyed;\n};\nint Foo::numDestroyed;\n\nstruct Bar : public Foo { };\n\nTemporaryRef<Foo>\nNewFoo()\n{\n  return RefPtr<Foo>(new Foo());\n}\n\nTemporaryRef<Foo>\nNewBar()\n{\n  return new Bar();\n}\n\nvoid\nGetNewFoo(Foo** f)\n{\n  *f = new Bar();\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetPassedFoo(Foo** f)\n{\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetNewFoo(RefPtr<Foo>* f)\n{\n  *f = new Bar();\n}\n\nvoid\nGetPassedFoo(RefPtr<Foo>* f)\n{}\n\nTemporaryRef<Foo>\nGetNullFoo()\n{\n  return 0;\n}\n\nint\nmain(int argc, char** argv)\n{\n  // This should blow up\n//    Foo* f = new Foo(); delete f;\n\n  MOZ_ASSERT(0 == Foo::numDestroyed);\n  {\n    RefPtr<Foo> f = new Foo();\n    MOZ_ASSERT(f->refCount() == 1);\n  }\n  MOZ_ASSERT(1 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = NewFoo();\n    RefPtr<Foo> f2(NewFoo());\n    MOZ_ASSERT(1 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(3 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> b = NewBar();\n    MOZ_ASSERT(3 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(4 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1;\n    {\n      f1 = new Foo();\n      RefPtr<Foo> f2(f1);\n      RefPtr<Foo> f3 = f2;\n      MOZ_ASSERT(4 == Foo::numDestroyed);\n    }\n    MOZ_ASSERT(4 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(5 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    f.forget();\n    MOZ_ASSERT(6 == Foo::numDestroyed);\n  }\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(byRef(f));\n    MOZ_ASSERT(7 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(8 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(byRef(f));\n    MOZ_ASSERT(8 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(9 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(&f);\n    MOZ_ASSERT(10 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(11 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(&f);\n    MOZ_ASSERT(11 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(12 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = new Bar();\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = GetNullFoo();\n    MOZ_ASSERT(13 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  return 0;\n}\n\n#endif\n\n#endif /* mozilla_RefPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/SHA1.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Simple class for computing SHA1. */\n\n#ifndef mozilla_SHA1_h\n#define mozilla_SHA1_h\n\n#include \"mozilla/Types.h\"\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * This class computes the SHA1 hash of a byte sequence, or of the concatenation\n * of multiple sequences.  For example, computing the SHA1 of two sequences of\n * bytes could be done as follows:\n *\n *   void SHA1(const uint8_t* buf1, uint32_t size1,\n *             const uint8_t* buf2, uint32_t size2,\n *             SHA1Sum::Hash& hash)\n *   {\n *     SHA1Sum s;\n *     s.update(buf1, size1);\n *     s.update(buf2, size2);\n *     s.finish(hash);\n *   }\n *\n * The finish method may only be called once and cannot be followed by calls\n * to update.\n */\nclass SHA1Sum\n{\n    union {\n        uint32_t w[16]; /* input buffer */\n        uint8_t b[64];\n    } u;\n    uint64_t size; /* count of hashed bytes. */\n    unsigned H[22]; /* 5 state variables, 16 tmp values, 1 extra */\n    bool mDone;\n\n  public:\n    MFBT_API SHA1Sum();\n\n    static const size_t HashSize = 20;\n    typedef uint8_t Hash[HashSize];\n\n    /* Add len bytes of dataIn to the data sequence being hashed. */\n    MFBT_API void update(const void* dataIn, uint32_t len);\n\n    /* Compute the final hash of all data into hashOut. */\n    MFBT_API void finish(SHA1Sum::Hash& hashOut);\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_SHA1_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Scoped.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A number of structures to simplify scope-based RAII management. */\n\n#ifndef mozilla_Scoped_h\n#define mozilla_Scoped_h\n\n/*\n * Resource Acquisition Is Initialization is a programming idiom used\n * to write robust code that is able to deallocate resources properly,\n * even in presence of execution errors or exceptions that need to be\n * propagated.  The Scoped* classes defined in this header perform the\n * deallocation of the resource they hold once program execution\n * reaches the end of the scope for which they have been defined.\n *\n * This header provides the following RAII classes:\n *\n * - |ScopedFreePtr| - a container for a pointer, that automatically calls\n *   |free()| at the end of the scope;\n * - |ScopedDeletePtr| - a container for a pointer, that automatically calls\n *   |delete| at the end of the scope;\n * - |ScopedDeleteArray| - a container for a pointer to an array, that\n *   automatically calls |delete[]| at the end of the scope.\n *\n * The general scenario for each of the RAII classes is the following:\n *\n * ScopedClass foo(create_value());\n * // ... In this scope, |foo| is defined. Use |foo.get()| or |foo.rwget()|\n *        to access the value.\n * // ... In case of |return| or |throw|, |foo| is deallocated automatically.\n * // ... If |foo| needs to be returned or stored, use |foo.forget()|\n *\n * Note that the RAII classes defined in this header do _not_ perform any form\n * of reference-counting or garbage-collection. These classes have exactly two\n * behaviors:\n *\n * - if |forget()| has not been called, the resource is always deallocated at\n *   the end of the scope;\n * - if |forget()| has been called, any control on the resource is unbound\n *   and the resource is not deallocated by the class.\n *\n * Extension:\n *\n * In addition, this header provides class |Scoped| and macros |SCOPED_TEMPLATE|\n * and |MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE|  to simplify the definition\n * of RAII classes for other scenarios. These macros have been used to\n * automatically close file descriptors/file handles when reaching the end of\n * the scope, graphics contexts, etc.\n */\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n/*\n * Scoped is a helper to create RAII wrappers\n * Type argument |Traits| is expected to have the following structure:\n *\n *   struct Traits {\n *     // Define the type of the value stored in the wrapper\n *     typedef value_type type;\n *     // Returns the value corresponding to the uninitialized or freed state\n *     const static type empty();\n *     // Release resources corresponding to the wrapped value\n *     // This function is responsible for not releasing an |empty| value\n *     const static void release(type);\n *   }\n */\ntemplate<typename Traits>\nclass Scoped\n{\n  public:\n    typedef typename Traits::type Resource;\n\n    explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : value(Traits::empty())\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    explicit Scoped(const Resource& v\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : value(v)\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~Scoped() {\n      Traits::release(value);\n    }\n\n    // Constant getter\n    operator const Resource&() const { return value; }\n    const Resource& operator->() const { return value; }\n    const Resource& get() const { return value; }\n    // Non-constant getter.\n    Resource& rwget() { return value; }\n\n    /*\n     * Forget the resource.\n     *\n     * Once |forget| has been called, the |Scoped| is neutralized, i.e. it will\n     * have no effect at destruction (unless it is reset to another resource by\n     * |operator=|).\n     *\n     * @return The original resource.\n     */\n    Resource forget() {\n      Resource tmp = value;\n      value = Traits::empty();\n      return tmp;\n    }\n\n    /*\n     * Perform immediate clean-up of this |Scoped|.\n     *\n     * If this |Scoped| is currently empty, this method has no effect.\n     */\n    void dispose() {\n      Traits::release(value);\n      value = Traits::empty();\n    }\n\n    bool operator==(const Resource& other) const {\n      return value == other;\n    }\n\n    /*\n     * Replace the resource with another resource.\n     *\n     * Calling |operator=| has the side-effect of triggering clean-up. If you do\n     * not want to trigger clean-up, you should first invoke |forget|.\n     *\n     * @return this\n     */\n    Scoped<Traits>& operator=(const Resource& other) {\n      return reset(other);\n    }\n    Scoped<Traits>& reset(const Resource& other) {\n      Traits::release(value);\n      value = other;\n      return *this;\n    }\n\n  private:\n    explicit Scoped(const Scoped<Traits>& value) MOZ_DELETE;\n    Scoped<Traits>& operator=(const Scoped<Traits>& value) MOZ_DELETE;\n\n  private:\n    Resource value;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * SCOPED_TEMPLATE defines a templated class derived from Scoped\n * This allows to implement templates such as ScopedFreePtr.\n *\n * @param name The name of the class to define.\n * @param Traits A struct implementing clean-up. See the implementations\n * for more details.\n */\n#define SCOPED_TEMPLATE(name, Traits)                          \\\ntemplate<typename Type>                                        \\\nstruct name : public mozilla::Scoped<Traits<Type> >            \\\n{                                                              \\\n    typedef mozilla::Scoped<Traits<Type> > Super;              \\\n    typedef typename Super::Resource Resource;                 \\\n    name& operator=(Resource ptr) {                            \\\n      Super::operator=(ptr);                                   \\\n      return *this;                                            \\\n    }                                                          \\\n    explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)        \\\n      : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)  \\\n    {}                                                         \\\n    explicit name(Resource ptr                                 \\\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)             \\\n      : Super(ptr MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)   \\\n    {}                                                         \\\n  private:                                                     \\\n    explicit name(name& source) MOZ_DELETE;                    \\\n    name& operator=(name& source) MOZ_DELETE;                  \\\n};\n\n/*\n * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d.\n *\n *   struct S { ... };\n *   ScopedFreePtr<S> foo = malloc(sizeof(S));\n *   ScopedFreePtr<char> bar = strdup(str);\n */\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return nullptr; }\n    static void release(T* ptr) { free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)\n\n/*\n * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.\n *\n *   struct S { ... };\n *   ScopedDeletePtr<S> foo = new S();\n */\ntemplate<typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)\n\n/*\n * ScopedDeleteArray is a RAII wrapper for pointers that need to be delete[]ed.\n *\n *   struct S { ... };\n *   ScopedDeleteArray<S> foo = new S[42];\n */\ntemplate<typename T>\nstruct ScopedDeleteArrayTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete [] ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeleteArray, ScopedDeleteArrayTraits)\n\n/*\n * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped\n * pointers for types with custom deleters; just overload\n * TypeSpecificDelete(T*) in the same namespace as T to call the deleter for\n * type T.\n *\n * @param name The name of the class to define.\n * @param Type A struct implementing clean-up. See the implementations\n * for more details.\n * *param Deleter The function that is used to delete/destroy/free a\n *        non-null value of Type*.\n *\n * Example:\n *\n *   MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \\\n *                                             PR_Close)\n *   ...\n *   {\n *       ScopedPRFileDesc file(PR_OpenFile(...));\n *       ...\n *   } // file is closed with PR_Close here\n */\n#define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \\\ntemplate <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \\\ntypedef ::mozilla::TypeSpecificScopedPointer<Type> name;\n\ntemplate <typename T> void TypeSpecificDelete(T * value);\n\ntemplate <typename T>\nstruct TypeSpecificScopedPointerTraits\n{\n    typedef T* type;\n    const static type empty() { return nullptr; }\n    const static void release(type value)\n    {\n      if (value)\n        TypeSpecificDelete(value);\n    }\n};\n\nSCOPED_TEMPLATE(TypeSpecificScopedPointer, TypeSpecificScopedPointerTraits)\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Scoped_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/SplayTree.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/**\n * A sorted tree with optimal access times, where recently-accessed elements\n * are faster to access again.\n */\n\n#ifndef mozilla_SplayTree_h\n#define mozilla_SplayTree_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\ntemplate<class T, class C>\nclass SplayTree;\n\ntemplate<typename T>\nclass SplayTreeNode\n{\n  public:\n    template<class A, class B>\n    friend class SplayTree;\n\n    SplayTreeNode()\n      : left(nullptr), right(nullptr), parent(nullptr)\n    {}\n\n  private:\n    T* left;\n    T* right;\n    T* parent;\n};\n\n\n/**\n * Class which represents a splay tree.\n * Splay trees are balanced binary search trees for which search, insert and\n * remove are all amortized O(log n), but where accessing a node makes it\n * faster to access that node in the future.\n *\n * T indicates the type of tree elements, Comparator must have a static\n * compare(const T&, const T&) method ordering the elements. The compare\n * method must be free from side effects.\n */\ntemplate<typename T, class Comparator>\nclass SplayTree\n{\n    T* root;\n    T* freeList;\n\n  public:\n    SplayTree()\n      : root(nullptr), freeList(nullptr)\n    {}\n\n    bool empty() const {\n      return !root;\n    }\n\n    bool contains(const T& v)\n    {\n      if (empty())\n        return false;\n\n      T* last = lookup(v);\n      splay(last);\n      checkCoherency(root, nullptr);\n      return Comparator::compare(v, *last) == 0;\n    }\n\n    bool insert(T* v)\n    {\n      MOZ_ASSERT(!contains(*v), \"Duplicate elements are not allowed.\");\n\n      if (!root) {\n        root = v;\n        return true;\n      }\n      T* last = lookup(*v);\n      int cmp = Comparator::compare(*v, *last);\n\n      T** parentPointer = (cmp < 0) ? &last->left : &last->right;\n      MOZ_ASSERT(!*parentPointer);\n      *parentPointer = v;\n      v->parent = last;\n\n      splay(v);\n      checkCoherency(root, nullptr);\n      return true;\n    }\n\n    T* remove(const T& v)\n    {\n      T* last = lookup(v);\n      MOZ_ASSERT(last, \"This tree must contain the element being removed.\");\n      MOZ_ASSERT(Comparator::compare(v, *last) == 0);\n\n      // Splay the tree so that the item to remove is the root.\n      splay(last);\n      MOZ_ASSERT(last == root);\n\n      // Find another node which can be swapped in for the root: either the\n      // rightmost child of the root's left, or the leftmost child of the\n      // root's right.\n      T* swap;\n      T* swapChild;\n      if (root->left) {\n        swap = root->left;\n        while (swap->right)\n          swap = swap->right;\n        swapChild = swap->left;\n      } else if (root->right) {\n        swap = root->right;\n        while (swap->left)\n          swap = swap->left;\n        swapChild = swap->right;\n      } else {\n        T* result = root;\n        root = nullptr;\n        return result;\n      }\n\n      // The selected node has at most one child, in swapChild. Detach it\n      // from the subtree by replacing it with that child.\n      if (swap == swap->parent->left)\n        swap->parent->left = swapChild;\n      else\n        swap->parent->right = swapChild;\n      if (swapChild)\n        swapChild->parent = swap->parent;\n\n      // Make the selected node the new root.\n      root = swap;\n      root->parent = nullptr;\n      root->left = last->left;\n      root->right = last->right;\n      if (root->left) {\n        root->left->parent = root;\n      }\n      if (root->right) {\n        root->right->parent = root;\n      }\n\n      checkCoherency(root, nullptr);\n      return last;\n    }\n\n    T* removeMin()\n    {\n      MOZ_ASSERT(root, \"No min to remove!\");\n\n      T* min = root;\n      while (min->left)\n        min = min->left;\n      return remove(*min);\n    }\n\n  private:\n    /**\n     * Returns the node in this comparing equal to |v|, or a node just greater or\n     * just less than |v| if there is no such node.\n     */\n    T* lookup(const T& v)\n    {\n      MOZ_ASSERT(!empty());\n\n      T* node = root;\n      T* parent;\n      do {\n        parent = node;\n        int c = Comparator::compare(v, *node);\n        if (c == 0)\n          return node;\n        else if (c < 0)\n          node = node->left;\n        else\n          node = node->right;\n      } while (node);\n      return parent;\n    }\n\n    /**\n     * Rotate the tree until |node| is at the root of the tree. Performing\n     * the rotations in this fashion preserves the amortized balancing of\n     * the tree.\n     */\n    void splay(T* node)\n    {\n      MOZ_ASSERT(node);\n\n      while (node != root) {\n        T* parent = node->parent;\n        if (parent == root) {\n          // Zig rotation.\n          rotate(node);\n          MOZ_ASSERT(node == root);\n          return;\n        }\n        T* grandparent = parent->parent;\n        if ((parent->left == node) == (grandparent->left == parent)) {\n          // Zig-zig rotation.\n          rotate(parent);\n          rotate(node);\n        } else {\n          // Zig-zag rotation.\n          rotate(node);\n          rotate(node);\n        }\n      }\n    }\n\n    void rotate(T* node)\n    {\n      // Rearrange nodes so that node becomes the parent of its current\n      // parent, while preserving the sortedness of the tree.\n      T* parent = node->parent;\n      if (parent->left == node) {\n        //     x          y\n        //   y  c  ==>  a  x\n        //  a b           b c\n        parent->left = node->right;\n        if (node->right)\n          node->right->parent = parent;\n        node->right = parent;\n      } else {\n        MOZ_ASSERT(parent->right == node);\n        //   x             y\n        //  a  y   ==>   x  c\n        //    b c       a b\n        parent->right = node->left;\n        if (node->left)\n          node->left->parent = parent;\n        node->left = parent;\n      }\n      node->parent = parent->parent;\n      parent->parent = node;\n      if (T* grandparent = node->parent) {\n        if (grandparent->left == parent)\n          grandparent->left = node;\n        else\n          grandparent->right = node;\n      } else {\n        root = node;\n      }\n    }\n\n    T* checkCoherency(T* node, T* minimum)\n    {\n#ifdef DEBUG\n      MOZ_ASSERT_IF(root, !root->parent);\n      if (!node) {\n        MOZ_ASSERT(!root);\n        return nullptr;\n      }\n      MOZ_ASSERT_IF(!node->parent, node == root);\n      MOZ_ASSERT_IF(minimum, Comparator::compare(*minimum, *node) < 0);\n      if (node->left) {\n        MOZ_ASSERT(node->left->parent == node);\n        T* leftMaximum = checkCoherency(node->left, minimum);\n        MOZ_ASSERT(Comparator::compare(*leftMaximum, *node) < 0);\n      }\n      if (node->right) {\n        MOZ_ASSERT(node->right->parent == node);\n        return checkCoherency(node->right, node);\n      }\n      return node;\n#else\n      return nullptr;\n#endif\n    }\n\n    SplayTree(const SplayTree&) MOZ_DELETE;\n    void operator=(const SplayTree&) MOZ_DELETE;\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_SplayTree_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/TemplateLib.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Reusable template meta-functions on types and compile-time values.  Meta-\n * functions are placed inside the 'tl' namespace to avoid conflict with non-\n * meta functions of the same name (e.g., mozilla::tl::FloorLog2 vs.\n * mozilla::FloorLog2).\n *\n * When constexpr support becomes universal, we should probably use that instead\n * of some of these templates, for simplicity.\n */\n\n#ifndef mozilla_TemplateLib_h\n#define mozilla_TemplateLib_h\n\n#include <limits.h>\n#include <stddef.h>\n\nnamespace mozilla {\n\nnamespace tl {\n\n/** Compute min/max. */\ntemplate<size_t I, size_t J>\nstruct Min\n{\n    static const size_t value = I < J ? I : J;\n};\ntemplate<size_t I, size_t J>\nstruct Max\n{\n    static const size_t value = I > J ? I : J;\n};\n\n/** Compute floor(log2(i)). */\ntemplate<size_t I>\nstruct FloorLog2\n{\n    static const size_t value = 1 + FloorLog2<I / 2>::value;\n};\ntemplate<> struct FloorLog2<0> { /* Error */ };\ntemplate<> struct FloorLog2<1> { static const size_t value = 0; };\n\n/** Compute ceiling(log2(i)). */\ntemplate<size_t I>\nstruct CeilingLog2\n{\n    static const size_t value = FloorLog2<2 * I - 1>::value;\n};\n\n/** Round up to the nearest power of 2. */\ntemplate<size_t I>\nstruct RoundUpPow2\n{\n    static const size_t value = size_t(1) << CeilingLog2<I>::value;\n};\ntemplate<>\nstruct RoundUpPow2<0>\n{\n    static const size_t value = 1;\n};\n\n/** Compute the number of bits in the given unsigned type. */\ntemplate<typename T>\nstruct BitSize\n{\n    static const size_t value = sizeof(T) * CHAR_BIT;\n};\n\n/**\n * Produce an N-bit mask, where N <= BitSize<size_t>::value.  Handle the\n * language-undefined edge case when N = BitSize<size_t>::value.\n */\ntemplate<size_t N>\nstruct NBitMask\n{\n    // Assert the precondition.  On success this evaluates to 0.  Otherwise it\n    // triggers divide-by-zero at compile time: a guaranteed compile error in\n    // C++11, and usually one in C++98.  Add this value to |value| to assure\n    // its computation.\n    static const size_t checkPrecondition = 0 / size_t(N < BitSize<size_t>::value);\n    static const size_t value = (size_t(1) << N) - 1 + checkPrecondition;\n};\ntemplate<>\nstruct NBitMask<BitSize<size_t>::value>\n{\n    static const size_t value = size_t(-1);\n};\n\n/**\n * For the unsigned integral type size_t, compute a mask M for N such that\n * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t)\n */\ntemplate<size_t N>\nstruct MulOverflowMask\n{\n    static const size_t value =\n      ~NBitMask<BitSize<size_t>::value - CeilingLog2<N>::value>::value;\n};\ntemplate<> struct MulOverflowMask<0> { /* Error */ };\ntemplate<> struct MulOverflowMask<1> { static const size_t value = 0; };\n\n} // namespace tl\n\n} // namespace mozilla\n\n#endif /* mozilla_TemplateLib_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/ThreadLocal.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cross-platform lightweight thread local data wrappers. */\n\n#ifndef mozilla_ThreadLocal_h\n#define mozilla_ThreadLocal_h\n\n#if defined(XP_WIN)\n// This file will get included in any file that wants to add a profiler mark.\n// In order to not bring <windows.h> together we could include windef.h and\n// winbase.h which are sufficient to get the prototypes for the Tls* functions.\n// # include <windef.h>\n// # include <winbase.h>\n// Unfortunately, even including these headers causes us to add a bunch of ugly\n// stuff to our namespace e.g #define CreateEvent CreateEventW\nextern \"C\" {\n__declspec(dllimport) void* __stdcall TlsGetValue(unsigned long);\n__declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void*);\n__declspec(dllimport) unsigned long __stdcall TlsAlloc();\n}\n#else\n#  include <pthread.h>\n#  include <signal.h>\n#endif\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n// sig_safe_t denotes an atomic type which can be read or stored in a single\n// instruction.  This means that data of this type is safe to be manipulated\n// from a signal handler, or other similar asynchronous execution contexts.\n#if defined(XP_WIN)\ntypedef unsigned long sig_safe_t;\n#else\ntypedef sig_atomic_t sig_safe_t;\n#endif\n\n/*\n * Thread Local Storage helpers.\n *\n * Usage:\n *\n * Only static-storage-duration (e.g. global variables, or static class members)\n * objects of this class should be instantiated. This class relies on\n * zero-initialization, which is implicit for static-storage-duration objects.\n * It doesn't have a custom default constructor, to avoid static initializers.\n *\n * API usage:\n *\n * // Create a TLS item\n * mozilla::ThreadLocal<int> tlsKey;\n * if (!tlsKey.init()) {\n *   // deal with the error\n * }\n *\n * // Set the TLS value\n * tlsKey.set(123);\n *\n * // Get the TLS value\n * int value = tlsKey.get();\n */\ntemplate<typename T>\nclass ThreadLocal\n{\n#if defined(XP_WIN)\n    typedef unsigned long key_t;\n#else\n    typedef pthread_key_t key_t;\n#endif\n\n    union Helper {\n      void* ptr;\n      T value;\n    };\n\n  public:\n    MOZ_WARN_UNUSED_RESULT inline bool init();\n\n    inline T get() const;\n\n    inline void set(const T value);\n\n    bool initialized() const {\n      return inited;\n    }\n\n  private:\n    key_t key;\n    bool inited;\n};\n\ntemplate<typename T>\ninline bool\nThreadLocal<T>::init()\n{\n  static_assert(sizeof(T) <= sizeof(void*),\n                \"mozilla::ThreadLocal can't be used for types larger than \"\n                \"a pointer\");\n  MOZ_ASSERT(!initialized());\n#ifdef XP_WIN\n  key = TlsAlloc();\n  inited = key != 0xFFFFFFFFUL; // TLS_OUT_OF_INDEXES\n#else\n  inited = !pthread_key_create(&key, nullptr);\n#endif\n  return inited;\n}\n\ntemplate<typename T>\ninline T\nThreadLocal<T>::get() const\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n#ifdef XP_WIN\n  h.ptr = TlsGetValue(key);\n#else\n  h.ptr = pthread_getspecific(key);\n#endif\n  return h.value;\n}\n\ntemplate<typename T>\ninline void\nThreadLocal<T>::set(const T value)\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n  h.value = value;\n  bool succeeded;\n#ifdef XP_WIN\n  succeeded = TlsSetValue(key, h.ptr);\n#else\n  succeeded = !pthread_setspecific(key, h.ptr);\n#endif\n  if (!succeeded)\n    MOZ_CRASH();\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_ThreadLocal_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/TypeTraits.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Template-based metaprogramming and type-testing facilities. */\n\n#ifndef mozilla_TypeTraits_h\n#define mozilla_TypeTraits_h\n\n/*\n * These traits are approximate copies of the traits and semantics from C++11's\n * <type_traits> header.  Don't add traits not in that header!  When all\n * platforms provide that header, we can convert all users and remove this one.\n */\n\n#include <wchar.h>\n\nnamespace mozilla {\n\n/* Forward declarations. */\n\ntemplate<typename> struct RemoveCV;\n\n/* 20.9.3 Helper classes [meta.help] */\n\n/**\n * Helper class used as a base for various type traits, exposed publicly\n * because <type_traits> exposes it as well.\n */\ntemplate<typename T, T Value>\nstruct IntegralConstant\n{\n    static const T value = Value;\n    typedef T ValueType;\n    typedef IntegralConstant<T, Value> Type;\n};\n\n/** Convenient aliases. */\ntypedef IntegralConstant<bool, true> TrueType;\ntypedef IntegralConstant<bool, false> FalseType;\n\n/* 20.9.4 Unary type traits [meta.unary] */\n\n/* 20.9.4.1 Primary type categories [meta.unary.cat] */\n\nnamespace detail {\n\ntemplate <typename T>\nstruct IsIntegralHelper : FalseType {};\n\ntemplate<> struct IsIntegralHelper<char>               : TrueType {};\ntemplate<> struct IsIntegralHelper<signed char>        : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned char>      : TrueType {};\ntemplate<> struct IsIntegralHelper<short>              : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned short>     : TrueType {};\ntemplate<> struct IsIntegralHelper<int>                : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned int>       : TrueType {};\ntemplate<> struct IsIntegralHelper<long>               : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long>      : TrueType {};\ntemplate<> struct IsIntegralHelper<long long>          : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long long> : TrueType {};\ntemplate<> struct IsIntegralHelper<bool>               : TrueType {};\ntemplate<> struct IsIntegralHelper<wchar_t>            : TrueType {};\n\n} /* namespace detail */\n\n/**\n * IsIntegral determines whether a type is an integral type.\n *\n * mozilla::IsIntegral<int>::value is true;\n * mozilla::IsIntegral<unsigned short>::value is true;\n * mozilla::IsIntegral<const long>::value is true;\n * mozilla::IsIntegral<int*>::value is false;\n * mozilla::IsIntegral<double>::value is false;\n *\n * Note that the behavior of IsIntegral on char16_t and char32_t is\n * unspecified.\n */\ntemplate<typename T>\nstruct IsIntegral : detail::IsIntegralHelper<typename RemoveCV<T>::Type>\n{};\n\ntemplate<typename T, typename U>\nstruct IsSame;\n\nnamespace detail {\n\ntemplate<typename T>\nstruct IsFloatingPointHelper\n  : IntegralConstant<bool,\n                     IsSame<T, float>::value ||\n                     IsSame<T, double>::value ||\n                     IsSame<T, long double>::value>\n{};\n\n} // namespace detail\n\n/**\n * IsFloatingPoint determines whether a type is a floating point type (float,\n * double, long double).\n *\n * mozilla::IsFloatingPoint<int>::value is false;\n * mozilla::IsFloatingPoint<const float>::value is true;\n * mozilla::IsFloatingPoint<long double>::value is true;\n * mozilla::IsFloatingPoint<double*>::value is false.\n */\ntemplate<typename T>\nstruct IsFloatingPoint\n  : detail::IsFloatingPointHelper<typename RemoveCV<T>::Type>\n{};\n\n/**\n * IsPointer determines whether a type is a pointer type (but not a pointer-to-\n * member type).\n *\n * mozilla::IsPointer<struct S*>::value is true;\n * mozilla::IsPointer<int**>::value is true;\n * mozilla::IsPointer<void (*)(void)>::value is true;\n * mozilla::IsPointer<int>::value is false;\n * mozilla::IsPointer<struct S>::value is false.\n */\ntemplate<typename T>\nstruct IsPointer : FalseType {};\n\ntemplate<typename T>\nstruct IsPointer<T*> : TrueType {};\n\nnamespace detail {\n\n// __is_enum is a supported extension across all of our supported compilers.\ntemplate<typename T>\nstruct IsEnumHelper\n  : IntegralConstant<bool, __is_enum(T)>\n{};\n\n} // namespace detail\n\n/**\n * IsEnum determines whether a type is an enum type.\n *\n * mozilla::IsEnum<enum S>::value is true;\n * mozilla::IsEnum<enum S*>::value is false;\n * mozilla::IsEnum<int>::value is false;\n */\ntemplate<typename T>\nstruct IsEnum\n  : detail::IsEnumHelper<typename RemoveCV<T>::Type>\n{};\n\n/* 20.9.4.2 Composite type traits [meta.unary.comp] */\n\n/**\n * IsArithmetic determines whether a type is arithmetic.  A type is arithmetic\n * iff it is an integral type or a floating point type.\n *\n * mozilla::IsArithmetic<int>::value is true;\n * mozilla::IsArithmetic<double>::value is true;\n * mozilla::IsArithmetic<long double*>::value is false.\n */\ntemplate<typename T>\nstruct IsArithmetic\n  : IntegralConstant<bool, IsIntegral<T>::value || IsFloatingPoint<T>::value>\n{};\n\n/* 20.9.4.3 Type properties [meta.unary.prop] */\n\n/**\n * IsConst determines whether a type is const or not.\n *\n * mozilla::IsConst<int>::value is false;\n * mozilla::IsConst<void* const>::value is true;\n * mozilla::IsConst<const char*>::value is false.\n */\ntemplate<typename T>\nstruct IsConst : FalseType {};\n\ntemplate<typename T>\nstruct IsConst<const T> : TrueType {};\n\n/**\n * IsVolatile determines whether a type is volatile or not.\n *\n * mozilla::IsVolatile<int>::value is false;\n * mozilla::IsVolatile<void* volatile>::value is true;\n * mozilla::IsVolatile<volatile char*>::value is false.\n */\ntemplate<typename T>\nstruct IsVolatile : FalseType {};\n\ntemplate<typename T>\nstruct IsVolatile<volatile T> : TrueType {};\n\n/**\n * Traits class for identifying POD types.  Until C++11 there's no automatic\n * way to detect PODs, so for the moment this is done manually.  Users may\n * define specializations of this class that inherit from mozilla::TrueType and\n * mozilla::FalseType (or equivalently mozilla::IntegralConstant<bool, true or\n * false>, or conveniently from mozilla::IsPod for composite types) as needed to\n * ensure correct IsPod behavior.\n */\ntemplate<typename T>\nstruct IsPod : public FalseType {};\n\ntemplate<> struct IsPod<char>               : TrueType {};\ntemplate<> struct IsPod<signed char>        : TrueType {};\ntemplate<> struct IsPod<unsigned char>      : TrueType {};\ntemplate<> struct IsPod<short>              : TrueType {};\ntemplate<> struct IsPod<unsigned short>     : TrueType {};\ntemplate<> struct IsPod<int>                : TrueType {};\ntemplate<> struct IsPod<unsigned int>       : TrueType {};\ntemplate<> struct IsPod<long>               : TrueType {};\ntemplate<> struct IsPod<unsigned long>      : TrueType {};\ntemplate<> struct IsPod<long long>          : TrueType {};\ntemplate<> struct IsPod<unsigned long long> : TrueType {};\ntemplate<> struct IsPod<bool>               : TrueType {};\ntemplate<> struct IsPod<float>              : TrueType {};\ntemplate<> struct IsPod<double>             : TrueType {};\ntemplate<> struct IsPod<wchar_t>            : TrueType {};\ntemplate<typename T> struct IsPod<T*>       : TrueType {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsSignedHelper;\n\ntemplate<typename T>\nstruct IsSignedHelper<T, true> : TrueType {};\n\ntemplate<typename T>\nstruct IsSignedHelper<T, false>\n  : IntegralConstant<bool, IsArithmetic<T>::value && T(-1) < T(1)>\n{};\n\n} // namespace detail\n\n/**\n * IsSigned determines whether a type is a signed arithmetic type.  |char| is\n * considered a signed type if it has the same representation as |signed char|.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsSigned<int>::value is true;\n * mozilla::IsSigned<const unsigned int>::value is false;\n * mozilla::IsSigned<unsigned char>::value is false;\n * mozilla::IsSigned<float>::value is true.\n */\ntemplate<typename T>\nstruct IsSigned : detail::IsSignedHelper<T> {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsUnsignedHelper;\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, true> : FalseType {};\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, false>\n  : IntegralConstant<bool,\n                     IsArithmetic<T>::value &&\n                     (IsSame<typename RemoveCV<T>::Type, bool>::value ||\n                      T(1) < T(-1))>\n{};\n\n} // namespace detail\n\n/**\n * IsUnsigned determines whether a type is an unsigned arithmetic type.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsUnsigned<int>::value is false;\n * mozilla::IsUnsigned<const unsigned int>::value is true;\n * mozilla::IsUnsigned<unsigned char>::value is true;\n * mozilla::IsUnsigned<float>::value is false.\n */\ntemplate<typename T>\nstruct IsUnsigned : detail::IsUnsignedHelper<T> {};\n\n/* 20.9.5 Type property queries [meta.unary.prop.query] */\n\n/* 20.9.6 Relationships between types [meta.rel] */\n\n/**\n * IsSame tests whether two types are the same type.\n *\n * mozilla::IsSame<int, int>::value is true;\n * mozilla::IsSame<int*, int*>::value is true;\n * mozilla::IsSame<int, unsigned int>::value is false;\n * mozilla::IsSame<void, void>::value is true;\n * mozilla::IsSame<const int, int>::value is false;\n * mozilla::IsSame<struct S, struct S>::value is true.\n */\ntemplate<typename T, typename U>\nstruct IsSame : FalseType {};\n\ntemplate<typename T>\nstruct IsSame<T, T> : TrueType {};\n\nnamespace detail {\n\n// The trickery used to implement IsBaseOf here makes it possible to use it for\n// the cases of private and multiple inheritance.  This code was inspired by the\n// sample code here:\n//\n// http://stackoverflow.com/questions/2910979/how-is-base-of-works\ntemplate<class Base, class Derived>\nstruct BaseOfHelper\n{\n  public:\n    operator Base*() const;\n    operator Derived*();\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base, const Derived>\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base&, Derived&> : FalseType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, Type> : TrueType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, const Type> : TrueType {};\n\n} /* namespace detail */\n\n/*\n * IsBaseOf allows to know whether a given class is derived from another.\n *\n * Consider the following class definitions:\n *\n *   class A {};\n *   class B : public A {};\n *   class C {};\n *\n * mozilla::IsBaseOf<A, B>::value is true;\n * mozilla::IsBaseOf<A, C>::value is false;\n */\ntemplate<class Base, class Derived>\nstruct IsBaseOf\n  : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>\n{};\n\nnamespace detail {\n\ntemplate<typename From, typename To>\nstruct ConvertibleTester\n{\n  private:\n    static From create();\n\n    template<typename From1, typename To1>\n    static char test(To to);\n\n    template<typename From1, typename To1>\n    static int test(...);\n\n  public:\n    static const bool value =\n      sizeof(test<From, To>(create())) == sizeof(char);\n};\n\n} // namespace detail\n\n/**\n * IsConvertible determines whether a value of type From will implicitly convert\n * to a value of type To.  For example:\n *\n *   struct A {};\n *   struct B : public A {};\n *   struct C {};\n *\n * mozilla::IsConvertible<A, A>::value is true;\n * mozilla::IsConvertible<A*, A*>::value is true;\n * mozilla::IsConvertible<B, A>::value is true;\n * mozilla::IsConvertible<B*, A*>::value is true;\n * mozilla::IsConvertible<C, A>::value is false;\n * mozilla::IsConvertible<A, C>::value is false;\n * mozilla::IsConvertible<A*, C*>::value is false;\n * mozilla::IsConvertible<C*, A*>::value is false.\n *\n * For obscure reasons, you can't use IsConvertible when the types being tested\n * are related through private inheritance, and you'll get a compile error if\n * you try.  Just don't do it!\n */\ntemplate<typename From, typename To>\nstruct IsConvertible\n  : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>\n{};\n\n/* 20.9.7 Transformations between types [meta.trans] */\n\n/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */\n\n/**\n * RemoveConst removes top-level const qualifications on a type.\n *\n * mozilla::RemoveConst<int>::Type is int;\n * mozilla::RemoveConst<const int>::Type is int;\n * mozilla::RemoveConst<const int*>::Type is const int*;\n * mozilla::RemoveConst<int* const>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveConst\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveConst<const T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveVolatile removes top-level volatile qualifications on a type.\n *\n * mozilla::RemoveVolatile<int>::Type is int;\n * mozilla::RemoveVolatile<volatile int>::Type is int;\n * mozilla::RemoveVolatile<volatile int*>::Type is volatile int*;\n * mozilla::RemoveVolatile<int* volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveVolatile\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveVolatile<volatile T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveCV removes top-level const and volatile qualifications on a type.\n *\n * mozilla::RemoveCV<int>::Type is int;\n * mozilla::RemoveCV<const int>::Type is int;\n * mozilla::RemoveCV<volatile int>::Type is int;\n * mozilla::RemoveCV<int* const volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveCV\n{\n    typedef typename RemoveConst<typename RemoveVolatile<T>::Type>::Type Type;\n};\n\n/* 20.9.7.2 Reference modifications [meta.trans.ref] */\n\n/* 20.9.7.3 Sign modifications [meta.trans.sign] */\n\ntemplate<bool B, typename T = void>\nstruct EnableIf;\n\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional;\n\nnamespace detail {\n\ntemplate<bool MakeConst, typename T>\nstruct WithC : Conditional<MakeConst, const T, T>\n{};\n\ntemplate<bool MakeVolatile, typename T>\nstruct WithV : Conditional<MakeVolatile, volatile T, T>\n{};\n\n\ntemplate<bool MakeConst, bool MakeVolatile, typename T>\nstruct WithCV : WithC<MakeConst, typename WithV<MakeVolatile, T>::Type>\n{};\n\ntemplate<typename T>\nstruct CorrespondingSigned;\n\ntemplate<>\nstruct CorrespondingSigned<char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned short> { typedef short Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned int> { typedef int Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long> { typedef long Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long long> { typedef long long Type; };\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsSignedIntegerType = IsSigned<CVRemoved>::value &&\n                                    !IsSame<char, CVRemoved>::value>\nstruct MakeSigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingSigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeSigned produces the corresponding signed integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already a signed integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an unsigned integer type, the signed variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the integral type of the same size as T, with the lowest rank,\n * with T's const/volatile qualifiers, is produced.  (This basically only acts\n * to produce signed char when T = char.)\n *\n * mozilla::MakeSigned<unsigned long>::Type is signed long;\n * mozilla::MakeSigned<volatile int>::Type is volatile int;\n * mozilla::MakeSigned<const unsigned short>::Type is const signed short;\n * mozilla::MakeSigned<const char>::Type is const signed char;\n * mozilla::MakeSigned<bool> is an error;\n * mozilla::MakeSigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeSigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeSigned<T>\n            >::Type\n{};\n\nnamespace detail {\n\ntemplate<typename T>\nstruct CorrespondingUnsigned;\n\ntemplate<>\nstruct CorrespondingUnsigned<char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<signed char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<short> { typedef unsigned short Type; };\ntemplate<>\nstruct CorrespondingUnsigned<int> { typedef unsigned int Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long> { typedef unsigned long Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long long> { typedef unsigned long long Type; };\n\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsUnsignedIntegerType = IsUnsigned<CVRemoved>::value &&\n                                      !IsSame<char, CVRemoved>::value>\nstruct MakeUnsigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingUnsigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeUnsigned produces the corresponding unsigned integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already an unsigned integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an signed integer type, the unsigned variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the unsigned integral type of the same size as T, with the lowest\n * rank, with T's const/volatile qualifiers, is produced.  (This basically only\n * acts to produce unsigned char when T = char.)\n *\n * mozilla::MakeUnsigned<signed long>::Type is unsigned long;\n * mozilla::MakeUnsigned<volatile unsigned int>::Type is volatile unsigned int;\n * mozilla::MakeUnsigned<const signed short>::Type is const unsigned short;\n * mozilla::MakeUnsigned<const char>::Type is const unsigned char;\n * mozilla::MakeUnsigned<bool> is an error;\n * mozilla::MakeUnsigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeUnsigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeUnsigned<T>\n            >::Type\n{};\n\n/* 20.9.7.4 Array modifications [meta.trans.arr] */\n\n/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */\n\n/* 20.9.7.6 Other transformations [meta.trans.other] */\n\n/**\n * EnableIf is a struct containing a typedef of T if and only if B is true.\n *\n * mozilla::EnableIf<true, int>::Type is int;\n * mozilla::EnableIf<false, int>::Type is a compile-time error.\n *\n * Use this template to implement SFINAE-style (Substitution Failure Is not An\n * Error) requirements.  For example, you might use it to impose a restriction\n * on a template parameter:\n *\n *   template<typename T>\n *   class PodVector // vector optimized to store POD (memcpy-able) types\n *   {\n *      EnableIf<IsPod<T>::value, T>::Type* vector;\n *      size_t length;\n *      ...\n *   };\n */\ntemplate<bool B, typename T>\nstruct EnableIf\n{};\n\ntemplate<typename T>\nstruct EnableIf<true, T>\n{\n    typedef T Type;\n};\n\n/**\n * Conditional selects a class between two, depending on a given boolean value.\n *\n * mozilla::Conditional<true, A, B>::Type is A;\n * mozilla::Conditional<false, A, B>::Type is B;\n */\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional\n{\n    typedef A Type;\n};\n\ntemplate<class A, class B>\nstruct Conditional<false, A, B>\n{\n    typedef B Type;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_TypeTraits_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/TypedEnum.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Macros to emulate C++11 typed enums and enum classes. */\n\n#ifndef mozilla_TypedEnum_h\n#define mozilla_TypedEnum_h\n\n#include \"mozilla/Attributes.h\"\n\n#if defined(__cplusplus)\n\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_strong_enums)\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)\n#      define MOZ_HAVE_CXX11_ENUM_TYPE\n#      define MOZ_HAVE_CXX11_STRONG_ENUMS\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1400\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#  endif\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#endif\n\n/**\n * MOZ_ENUM_TYPE specifies the underlying numeric type for an enum.  It's\n * specified by placing MOZ_ENUM_TYPE(type) immediately after the enum name in\n * its declaration, and before the opening curly brace, like\n *\n *   enum MyEnum MOZ_ENUM_TYPE(uint16_t)\n *   {\n *     A,\n *     B = 7,\n *     C\n *   };\n *\n * In supporting compilers, the macro will expand to \": uint16_t\".  The\n * compiler will allocate exactly two bytes for MyEnum and will require all\n * enumerators to have values between 0 and 65535.  (Thus specifying \"B =\n * 100000\" instead of \"B = 7\" would fail to compile.)  In old compilers the\n * macro expands to the empty string, and the underlying type is generally\n * undefined.\n */\n#ifdef MOZ_HAVE_CXX11_ENUM_TYPE\n#  define MOZ_ENUM_TYPE(type)   : type\n#else\n#  define MOZ_ENUM_TYPE(type)   /* no support */\n#endif\n\n/**\n * MOZ_BEGIN_ENUM_CLASS and MOZ_END_ENUM_CLASS provide access to the\n * strongly-typed enumeration feature of C++11 (\"enum class\").  If supported\n * by the compiler, an enum defined using these macros will not be implicitly\n * converted to any other type, and its enumerators will be scoped using the\n * enumeration name.  Place MOZ_BEGIN_ENUM_CLASS(EnumName, type) in place of\n * \"enum EnumName {\", and MOZ_END_ENUM_CLASS(EnumName) in place of the closing\n * \"};\".  For example,\n *\n *   MOZ_BEGIN_ENUM_CLASS(Enum, int32_t)\n *     A,\n *     B = 6\n *   MOZ_END_ENUM_CLASS(Enum)\n *\n * This will make \"Enum::A\" and \"Enum::B\" appear in the global scope, but \"A\"\n * and \"B\" will not.  In compilers that support C++11 strongly-typed\n * enumerations, implicit conversions of Enum values to numeric types will\n * fail.  In other compilers, Enum itself will actually be defined as a class,\n * and some implicit conversions will fail while others will succeed.\n *\n * The type argument specifies the underlying type for the enum where\n * supported, as with MOZ_ENUM_TYPE().  For simplicity, it is currently\n * mandatory.  As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do\n * not support it.\n *\n * MOZ_{BEGIN,END}_ENUM_CLASS doesn't work for defining enum classes nested\n * inside classes.  To define an enum class nested inside another class, use\n * MOZ_{BEGIN,END}_NESTED_ENUM_CLASS, and place a MOZ_FINISH_NESTED_ENUM_CLASS\n * in namespace scope to handle bits that can only be implemented with\n * namespace-scoped code.  For example:\n *\n *   class FooBar {\n *\n *     MOZ_BEGIN_NESTED_ENUM_CLASS(Enum, int32_t)\n *       A,\n *       B = 6\n *     MOZ_END_NESTED_ENUM_CLASS(Enum)\n *\n *   };\n *\n *   MOZ_FINISH_NESTED_ENUM_CLASS(FooBar::Enum)\n */\n#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS)\n  /*\n   * All compilers that support strong enums also support an explicit\n   * underlying type, so no extra check is needed.\n   */\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     enum class Name : type {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) /* nothing */\n#else\n   /**\n    * We need Name to both name a type, and scope the provided enumerator\n    * names.  Namespaces and classes both provide scoping, but namespaces\n    * aren't types, so we need to use a class that wraps the enum values.  We\n    * have an implicit conversion from the inner enum type to the class, so\n    * statements like\n    *\n    *   Enum x = Enum::A;\n    *\n    * will still work.  We need to define an implicit conversion from the class\n    * to the inner enum as well, so that (for instance) switch statements will\n    * work.  This means that the class can be implicitly converted to a numeric\n    * value as well via the enum type, since C++ allows an implicit\n    * user-defined conversion followed by a standard conversion to still be\n    * implicit.\n    *\n    * We have an explicit constructor from int defined, so that casts like\n    * (Enum)7 will still work.  We also have a zero-argument constructor with\n    * no arguments, so declaration without initialization (like \"Enum foo;\")\n    * will work.\n    *\n    * Additionally, we'll delete as many operators as possible for the inner\n    * enum type, so statements like this will still fail:\n    *\n    *   f(5 + Enum::B); // deleted operator+\n    *\n    * But we can't prevent things like this, because C++ doesn't allow\n    * overriding conversions or assignment operators for enums:\n    *\n    *   int x = Enum::A;\n    *   int f()\n    *   {\n    *     return Enum::A;\n    *   }\n    */\\\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     class Name \\\n     { \\\n       public: \\\n         enum Enum MOZ_ENUM_TYPE(type) \\\n         {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n         }; \\\n         Name() {} \\\n         Name(Enum aEnum) : mEnum(aEnum) {} \\\n         explicit Name(int num) : mEnum((Enum)num) {} \\\n         operator Enum() const { return mEnum; } \\\n       private: \\\n         Enum mEnum; \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) \\\n     inline int operator+(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator-(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator*(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator*(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator/(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator/(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator%(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator%(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator++(Name::Enum&) MOZ_DELETE; \\\n     inline int operator++(Name::Enum&, int) MOZ_DELETE; \\\n     inline int& operator--(Name::Enum&) MOZ_DELETE; \\\n     inline int operator--(Name::Enum&, int) MOZ_DELETE; \\\n     inline bool operator==(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator==(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator!=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!(const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline bool operator||(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator||(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline int operator~(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator|(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator|(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator^(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator^(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator<<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator<<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator>>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator>>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int& operator+=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator-=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator*=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator/=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator%=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator&=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator|=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator^=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator<<=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator>>=(int&, const Name::Enum&) MOZ_DELETE;\n#endif\n#  define MOZ_BEGIN_ENUM_CLASS(Name, type) MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type)\n#  define MOZ_END_ENUM_CLASS(Name) \\\n     MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     MOZ_FINISH_NESTED_ENUM_CLASS(Name)\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_TypedEnum_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Types.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt foundational types and macros. */\n\n#ifndef mozilla_Types_h\n#define mozilla_Types_h\n\n/*\n * This header must be valid C and C++, includable by code embedding either\n * SpiderMonkey or Gecko.\n */\n\n/* Expose all <stdint.h> types and size_t. */\n#include <stddef.h>\n#include <stdint.h>\n\n/* Implement compiler and linker macros needed for APIs. */\n\n/*\n * MOZ_EXPORT is used to declare and define a symbol or type which is externally\n * visible to users of the current library.  It encapsulates various decorations\n * needed to properly export the method's symbol.\n *\n *   api.h:\n *     extern MOZ_EXPORT int MeaningOfLife(void);\n *     extern MOZ_EXPORT int LuggageCombination;\n *\n *   api.c:\n *     int MeaningOfLife(void) { return 42; }\n *     int LuggageCombination = 12345;\n *\n * If you are merely sharing a method across files, just use plain |extern|.\n * These macros are designed for use by library interfaces -- not for normal\n * methods or data used cross-file.\n */\n#if defined(WIN32) || defined(XP_OS2)\n#  define MOZ_EXPORT   __declspec(dllexport)\n#else /* Unix */\n#  ifdef HAVE_VISIBILITY_ATTRIBUTE\n#    define MOZ_EXPORT       __attribute__((visibility(\"default\")))\n#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n#    define MOZ_EXPORT      __global\n#  else\n#    define MOZ_EXPORT /* nothing */\n#  endif\n#endif\n\n\n/*\n * Whereas implementers use MOZ_EXPORT to declare and define library symbols,\n * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the\n * implementer of the library will expose an API macro which expands to either\n * the export or import version of the macro, depending upon the compilation\n * mode.\n */\n#ifdef _WIN32\n#  if defined(__MWERKS__)\n#    define MOZ_IMPORT_API /* nothing */\n#  else\n#    define MOZ_IMPORT_API __declspec(dllimport)\n#  endif\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_API  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_API MOZ_EXPORT\n#endif\n\n#if defined(_WIN32) && !defined(__MWERKS__)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_DATA  MOZ_EXPORT\n#endif\n\n/*\n * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose\n * export mfbt declarations when building mfbt, and they expose import mfbt\n * declarations when using mfbt.\n */\n#if defined(IMPL_MFBT)\n#  define MFBT_API     MOZ_EXPORT\n#  define MFBT_DATA    MOZ_EXPORT\n#else\n  /*\n   * On linux mozglue is linked in the program and we link libxul.so with\n   * -z,defs. Normally that causes the linker to reject undefined references in\n   * libxul.so, but as a loophole it allows undefined references to weak\n   * symbols. We add the weak attribute to the import version of the MFBT API\n   * macros to exploit this.\n   */\n#  if defined(MOZ_GLUE_IN_PROGRAM)\n#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API\n#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA\n#  else\n#    define MFBT_API   MOZ_IMPORT_API\n#    define MFBT_DATA  MOZ_IMPORT_DATA\n#  endif\n#endif\n\n/*\n * C symbols in C++ code must be declared immediately within |extern \"C\"|\n * blocks.  However, in C code, they need not be declared specially.  This\n * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C\n * macros, so that the user need not know whether he is being used in C or C++\n * code.\n *\n *   MOZ_BEGIN_EXTERN_C\n *\n *   extern MOZ_EXPORT int MostRandomNumber(void);\n *   ...other declarations...\n *\n *   MOZ_END_EXTERN_C\n *\n * This said, it is preferable to just use |extern \"C\"| in C++ header files for\n * its greater clarity.\n */\n#ifdef __cplusplus\n#  define MOZ_BEGIN_EXTERN_C    extern \"C\" {\n#  define MOZ_END_EXTERN_C      }\n#else\n#  define MOZ_BEGIN_EXTERN_C\n#  define MOZ_END_EXTERN_C\n#endif\n\n/*\n * GCC's typeof is available when decltype is not.\n */\n#if defined(__GNUC__) && defined(__cplusplus) && \\\n  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L\n#  define decltype __typeof__\n#endif\n\n#endif /* mozilla_Types_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Util.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Miscellaneous uncategorized functionality.  Please add new functionality to\n * new headers, or to other appropriate existing headers, not here.\n */\n\n#ifndef mozilla_Util_h\n#define mozilla_Util_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many \n * bytes of alignment a given type needs.\n */\ntemplate<class T>\nclass AlignmentFinder\n{\n    struct Aligner\n    {\n        char c;\n        T t;\n    };\n\n  public:\n    static const size_t alignment = sizeof(Aligner) - sizeof(T);\n};\n\n#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment\n\n/*\n * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.\n *\n * For instance,\n *\n *   MOZ_ALIGNED_DECL(char arr[2], 8);\n *\n * will declare a two-character array |arr| aligned to 8 bytes.\n */\n\n#if defined(__GNUC__)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     _type __attribute__((aligned(_align)))\n#elif defined(_MSC_VER)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     __declspec(align(_align)) _type\n#else\n#  warning \"We don't know how to align variables on this compiler.\"\n#  define MOZ_ALIGNED_DECL(_type, _align) _type\n#endif\n\n/*\n * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N\n * bytes.\n *\n * We support 1, 2, 4, 8, and 16-bit alignment.\n */\ntemplate<size_t align>\nstruct AlignedElem;\n\n/*\n * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where\n * foo is a template parameter.\n */\n\ntemplate<>\nstruct AlignedElem<1>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 1);\n};\n\ntemplate<>\nstruct AlignedElem<2>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 2);\n};\n\ntemplate<>\nstruct AlignedElem<4>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 4);\n};\n\ntemplate<>\nstruct AlignedElem<8>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 8);\n};\n\ntemplate<>\nstruct AlignedElem<16>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 16);\n};\n\n/*\n * This utility pales in comparison to Boost's aligned_storage. The utility\n * simply assumes that uint64_t is enough alignment for anyone. This may need\n * to be extended one day...\n *\n * As an important side effect, pulling the storage into this template is\n * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving\n * false negatives when we cast from the char buffer to whatever type we've\n * constructed using the bytes.\n */\ntemplate<size_t nbytes>\nstruct AlignedStorage\n{\n    union U {\n      char bytes[nbytes];\n      uint64_t _;\n    } u;\n\n    const void* addr() const { return u.bytes; }\n    void* addr() { return u.bytes; }\n};\n\ntemplate<class T>\nstruct AlignedStorage2\n{\n    union U {\n      char bytes[sizeof(T)];\n      uint64_t _;\n    } u;\n\n    const T* addr() const { return reinterpret_cast<const T*>(u.bytes); }\n    T* addr() { return static_cast<T*>(static_cast<void*>(u.bytes)); }\n};\n\n/*\n * Small utility for lazily constructing objects without using dynamic storage.\n * When a Maybe<T> is constructed, it is |empty()|, i.e., no value of T has\n * been constructed and no T destructor will be called when the Maybe<T> is\n * destroyed. Upon calling |construct|, a T object will be constructed with the\n * given arguments and that object will be destroyed when the owning Maybe<T>\n * is destroyed.\n *\n * N.B. GCC seems to miss some optimizations with Maybe and may generate extra\n * branches/loads/stores. Use with caution on hot paths.\n */\ntemplate<class T>\nclass Maybe\n{\n    AlignedStorage2<T> storage;\n    bool constructed;\n\n    T& asT() { return *storage.addr(); }\n\n  public:\n    Maybe() { constructed = false; }\n    ~Maybe() { if (constructed) asT().~T(); }\n\n    bool empty() const { return !constructed; }\n\n    void construct() {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T();\n      constructed = true;\n    }\n\n    template<class T1>\n    void construct(const T1& t1) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1);\n      constructed = true;\n    }\n\n    template<class T1, class T2>\n    void construct(const T1& t1, const T2& t2) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3>\n    void construct(const T1& t1, const T2& t2, const T3& t3) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9, class T10>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);\n      constructed = true;\n    }\n\n    T* addr() {\n      MOZ_ASSERT(constructed);\n      return &asT();\n    }\n\n    T& ref() {\n      MOZ_ASSERT(constructed);\n      return asT();\n    }\n\n    const T& ref() const {\n      MOZ_ASSERT(constructed);\n      return const_cast<Maybe*>(this)->asT();\n    }\n\n    void destroy() {\n      ref().~T();\n      constructed = false;\n    }\n\n    void destroyIfConstructed() {\n      if (!empty())\n        destroy();\n    }\n\n  private:\n    Maybe(const Maybe& other) MOZ_DELETE;\n    const Maybe& operator=(const Maybe& other) MOZ_DELETE;\n};\n\n/*\n * Safely subtract two pointers when it is known that end >= begin.  This avoids\n * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB\n * set, the unsigned subtraction followed by right shift will produce -1, or\n * size_t(-1), instead of the real difference.\n */\ntemplate<class T>\nMOZ_ALWAYS_INLINE size_t\nPointerRangeSize(T* begin, T* end)\n{\n  MOZ_ASSERT(end >= begin);\n  return (size_t(end) - size_t(begin)) / sizeof(T);\n}\n\n/*\n * Compute the length of an array with constant length.  (Use of this method\n * with a non-array pointer will not compile.)\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR size_t\nArrayLength(T (&arr)[N])\n{\n  return N;\n}\n\n/*\n * Compute the address one past the last element of a constant-length array.\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR T*\nArrayEnd(T (&arr)[N])\n{\n  return arr + ArrayLength(arr);\n}\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n/*\n * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files\n * that can't use C++ template functions and for static_assert() calls that\n * can't call ArrayLength() when it is not a C++11 constexpr function.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_ARRAY_LENGTH(array)   mozilla::ArrayLength(array)\n#else\n#  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))\n#endif\n\n#endif /* mozilla_Util_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type/length-parametrized vector class. */\n\n#ifndef mozilla_Vector_h\n#define mozilla_Vector_h\n\n#include \"mozilla/AllocPolicy.h\"\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/MathAlgorithms.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include <new> // for placement new\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace mozilla {\n\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase;\n\nnamespace detail {\n\n/*\n * Check that the given capacity wastes the minimal amount of space if\n * allocated on the heap.  This means that cap*sizeof(T) is as close to a\n * power-of-two as possible.  growStorageBy() is responsible for ensuring\n * this.\n */\ntemplate<typename T>\nstatic bool CapacityHasExcessSpace(size_t cap)\n{\n  size_t size = cap * sizeof(T);\n  return RoundUpPow2(size) - size >= sizeof(T);\n}\n\n/*\n * This template class provides a default implementation for vector operations\n * when the element type is not known to be a POD, as judged by IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector, bool IsPod>\nstruct VectorImpl\n{\n    /* Destroys constructed objects in the range [begin, end). */\n    static inline void destroy(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        p->~T();\n    }\n\n    /* Constructs objects in the uninitialized range [begin, end). */\n    static inline void initialize(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(*p);\n    }\n\n    /*\n     * Move-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(Move(*p));\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range [dst, dst+n) from the\n     * same object u.\n     */\n    template<typename U>\n    static inline void copyConstructN(T* dst, size_t n, const U& u) {\n      for (T* end = dst + n; dst < end; ++dst)\n        new(dst) T(u);\n    }\n\n    /*\n     * Grows the given buffer to have capacity newCap, preserving the objects\n     * constructed in the range [begin, end) and updating v. Assumes that (1)\n     * newCap has not overflowed, and (2) multiplying newCap by sizeof(T) will\n     * not overflow.\n     */\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      T* newbuf = reinterpret_cast<T*>(v.malloc_(newCap * sizeof(T)));\n      if (!newbuf)\n        return false;\n      T* dst = newbuf;\n      T* src = v.beginNoCheck();\n      for (; src < v.endNoCheck(); ++dst, ++src)\n        new(dst) T(Move(*src));\n      VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck());\n      v.free_(v.mBegin);\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n/*\n * This partial template specialization provides a default implementation for\n * vector operations when the element type is known to be a POD, as judged by\n * IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector>\nstruct VectorImpl<T, N, AP, ThisVector, true>\n{\n    static inline void destroy(T*, T*) {}\n\n    static inline void initialize(T* begin, T* end) {\n      /*\n       * You would think that memset would be a big win (or even break even)\n       * when we know T is a POD. But currently it's not. This is probably\n       * because |append| tends to be given small ranges and memset requires\n       * a function call that doesn't get inlined.\n       *\n       * memset(begin, 0, sizeof(T) * (end-begin));\n       */\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      /*\n       * See above memset comment. Also, notice that copyConstruct is\n       * currently templated (T != U), so memcpy won't work without\n       * requiring T == U.\n       *\n       * memcpy(dst, srcbeg, sizeof(T) * (srcend - srcbeg));\n       */\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        *dst = *p;\n    }\n\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      copyConstruct(dst, srcbeg, srcend);\n    }\n\n    static inline void copyConstructN(T* dst, size_t n, const T& t) {\n      for (T* end = dst + n; dst < end; ++dst)\n        *dst = t;\n    }\n\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      size_t oldSize = sizeof(T) * v.mCapacity;\n      size_t newSize = sizeof(T) * newCap;\n      T* newbuf = reinterpret_cast<T*>(v.realloc_(v.mBegin, oldSize, newSize));\n      if (!newbuf)\n        return false;\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n} // namespace detail\n\n/*\n * A CRTP base class for vector-like classes.  Unless you really really want\n * your own vector class -- and you almost certainly don't -- you should use\n * mozilla::Vector instead!\n *\n * See mozilla::Vector for interface requirements.\n */\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase : private AllocPolicy\n{\n    /* utilities */\n\n    static const bool sElemIsPod = IsPod<T>::value;\n    typedef detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod> Impl;\n    friend struct detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod>;\n\n    bool growStorageBy(size_t incr);\n    bool convertToHeapStorage(size_t newCap);\n\n    /* magic constants */\n\n    static const int sMaxInlineBytes = 1024;\n\n    /* compute constants */\n\n    /*\n     * Consider element size to be 1 for buffer sizing if there are 0 inline\n     * elements.  This allows us to compile when the definition of the element\n     * type is not visible here.\n     *\n     * Explicit specialization is only allowed at namespace scope, so in order\n     * to keep everything here, we use a dummy template parameter with partial\n     * specialization.\n     */\n    template<int M, int Dummy>\n    struct ElemSize\n    {\n        static const size_t value = sizeof(T);\n    };\n    template<int Dummy>\n    struct ElemSize<0, Dummy>\n    {\n        static const size_t value = 1;\n    };\n\n    static const size_t sInlineCapacity =\n      tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::value>::value;\n\n    /* Calculate inline buffer size; avoid 0-sized array. */\n    static const size_t sInlineBytes =\n      tl::Max<1, sInlineCapacity * ElemSize<N, 0>::value>::value;\n\n    /* member data */\n\n    /*\n     * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,\n     * mBegin + mLength) hold valid constructed T objects. The range [mBegin +\n     * mLength, mBegin + mCapacity) holds uninitialized memory. The range\n     * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory\n     * previously allocated by a call to reserve().\n     */\n    T* mBegin;\n\n    /* Number of elements in the vector. */\n    size_t mLength;\n\n    /* Max number of elements storable in the vector without resizing. */\n    size_t mCapacity;\n\n#ifdef DEBUG\n    /* Max elements of reserved or used space in this vector. */\n    size_t mReserved;\n#endif\n\n    /* Memory used for inline storage. */\n    AlignedStorage<sInlineBytes> storage;\n\n#ifdef DEBUG\n    friend class ReentrancyGuard;\n    bool entered;\n#endif\n\n    /* private accessors */\n\n    bool usingInlineStorage() const {\n      return mBegin == const_cast<VectorBase*>(this)->inlineStorage();\n    }\n\n    T* inlineStorage() {\n      return static_cast<T*>(storage.addr());\n    }\n\n    T* beginNoCheck() const {\n      return mBegin;\n    }\n\n    T* endNoCheck() {\n      return mBegin + mLength;\n    }\n\n    const T* endNoCheck() const {\n      return mBegin + mLength;\n    }\n\n#ifdef DEBUG\n    size_t reserved() const {\n      MOZ_ASSERT(mReserved <= mCapacity);\n      MOZ_ASSERT(mLength <= mReserved);\n      return mReserved;\n    }\n#endif\n\n    /* Append operations guaranteed to succeed due to pre-reserved space. */\n    template<typename U> void internalAppend(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    void internalAppendAll(const VectorBase<U, O, BP, UV>& u);\n    void internalAppendN(const T& t, size_t n);\n    template<typename U> void internalAppend(const U* begin, size_t length);\n\n  public:\n    static const size_t sMaxInlineStorage = N;\n\n    typedef T ElementType;\n\n    VectorBase(AllocPolicy = AllocPolicy());\n    VectorBase(MoveRef<ThisVector>); /* Move constructor. */\n    ThisVector& operator=(MoveRef<ThisVector>); /* Move assignment. */\n    ~VectorBase();\n\n    /* accessors */\n\n    const AllocPolicy& allocPolicy() const {\n      return *this;\n    }\n\n    AllocPolicy& allocPolicy() {\n      return *this;\n    }\n\n    enum { InlineLength = N };\n\n    size_t length() const {\n      return mLength;\n    }\n\n    bool empty() const {\n      return mLength == 0;\n    }\n\n    size_t capacity() const {\n      return mCapacity;\n    }\n\n    T* begin() {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    const T* begin() const {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    T* end() {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    const T* end() const {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    T& operator[](size_t i) {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    T& back() {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    const T& back() const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    class Range\n    {\n        friend class VectorBase;\n        T* cur_;\n        T* end_;\n        Range(T* cur, T* end) : cur_(cur), end_(end) {}\n\n      public:\n        Range() {}\n        bool empty() const { return cur_ == end_; }\n        size_t remain() const { return end_ - cur_; }\n        T& front() const { return *cur_; }\n        void popFront() { MOZ_ASSERT(!empty()); ++cur_; }\n        T popCopyFront() { MOZ_ASSERT(!empty()); return *cur_++; }\n    };\n\n    Range all() {\n      return Range(begin(), end());\n    }\n\n    /* mutators */\n\n    /**\n     * Given that the vector is empty and has no inline storage, grow to\n     * |capacity|.\n     */\n    bool initCapacity(size_t request);\n\n    /**\n     * If reserve(length() + N) succeeds, the N next appends are guaranteed to\n     * succeed.\n     */\n    bool reserve(size_t request);\n\n    /**\n     * Destroy elements in the range [end() - incr, end()). Does not deallocate\n     * or unreserve storage for those elements.\n     */\n    void shrinkBy(size_t incr);\n\n    /** Grow the vector by incr elements. */\n    bool growBy(size_t incr);\n\n    /** Call shrinkBy or growBy based on whether newSize > length(). */\n    bool resize(size_t newLength);\n\n    /**\n     * Increase the length of the vector, but don't initialize the new elements\n     * -- leave them as uninitialized memory.\n     */\n    bool growByUninitialized(size_t incr);\n    bool resizeUninitialized(size_t newLength);\n\n    /** Shorthand for shrinkBy(length()). */\n    void clear();\n\n    /** Clears and releases any heap-allocated storage. */\n    void clearAndFree();\n\n    /**\n     * If true, appending |needed| elements won't reallocate elements storage.\n     * This *doesn't* mean that infallibleAppend may be used!  You still must\n     * reserve the extra space, even if this method indicates that appends won't\n     * need to reallocate elements storage.\n     */\n    bool canAppendWithoutRealloc(size_t needed) const;\n\n    /**\n     * Potentially fallible append operations.\n     *\n     * The function templates that take an unspecified type U require a const T&\n     * or a MoveRef<T>.  The MoveRef<T> variants move their operands into the\n     * vector, instead of copying them.  If they fail, the operand is left\n     * unmoved.\n     */\n    template<typename U> bool append(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    bool appendAll(const VectorBase<U, O, BP, UV>& u);\n    bool appendN(const T& t, size_t n);\n    template<typename U> bool append(const U* begin, const U* end);\n    template<typename U> bool append(const U* begin, size_t length);\n\n    /*\n     * Guaranteed-infallible append operations for use upon vectors whose\n     * memory has been pre-reserved.  Don't use this if you haven't reserved the\n     * memory!\n     */\n    template<typename U> void infallibleAppend(const U& u) {\n      internalAppend(u);\n    }\n    void infallibleAppendN(const T& t, size_t n) {\n      internalAppendN(t, n);\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) {\n      internalAppend(aBegin, PointerRangeSize(aBegin, aEnd));\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, size_t aLength) {\n      internalAppend(aBegin, aLength);\n    }\n\n    void popBack();\n\n    T popCopy();\n\n    /**\n     * Transfers ownership of the internal buffer used by this vector to the\n     * caller.  (It's the caller's responsibility to properly deallocate this\n     * buffer, in accordance with this vector's AllocPolicy.)  After this call,\n     * the vector is empty.  Since the returned buffer may need to be allocated\n     * (if the elements are currently stored in-place), the call can fail,\n     * returning nullptr.\n     *\n     * N.B. Although a T*, only the range [0, length()) is constructed.\n     */\n    T* extractRawBuffer();\n\n    /**\n     * Transfer ownership of an array of objects into the vector.  The caller\n     * must have allocated the array in accordance with this vector's\n     * AllocPolicy.\n     *\n     * N.B. This call assumes that there are no uninitialized elements in the\n     *      passed array.\n     */\n    void replaceRawBuffer(T* p, size_t length);\n\n    /**\n     * Places |val| at position |p|, shifting existing elements from |p| onward\n     * one position higher.  On success, |p| should not be reused because it'll\n     * be a dangling pointer if reallocation of the vector storage occurred; the\n     * return value should be used instead.  On failure, nullptr is returned.\n     *\n     * Example usage:\n     *\n     *   if (!(p = vec.insert(p, val)))\n     *     <handle failure>\n     *   <keep working with p>\n     *\n     * This is inherently a linear-time operation.  Be careful!\n     */\n    T* insert(T* p, const T& val);\n\n    /**\n     * Removes the element |t|, which must fall in the bounds [begin, end),\n     * shifting existing elements from |t + 1| onward one position lower.\n     */\n    void erase(T* t);\n\n    /**\n     * Measure the size of the vector's heap-allocated storage.\n     */\n    size_t sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const;\n\n    /**\n     * Like sizeOfExcludingThis, but also measures the size of the vector\n     * object (which must be heap-allocated) itself.\n     */\n    size_t sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const;\n\n    void swap(ThisVector& other);\n\n  private:\n    VectorBase(const ThisVector&) MOZ_DELETE;\n    void operator=(const ThisVector&) MOZ_DELETE;\n};\n\n/* This does the re-entrancy check plus several other sanity checks. */\n#define MOZ_REENTRANCY_GUARD_ET_AL \\\n  ReentrancyGuard g(*this); \\\n  MOZ_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); \\\n  MOZ_ASSERT(reserved() <= mCapacity); \\\n  MOZ_ASSERT(mLength <= reserved()); \\\n  MOZ_ASSERT(mLength <= mCapacity)\n\n/* Vector Implementation */\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::VectorBase(AP ap)\n  : AP(ap),\n    mBegin(static_cast<T*>(storage.addr())),\n    mLength(0),\n    mCapacity(sInlineCapacity)\n#ifdef DEBUG\n  , mReserved(sInlineCapacity),\n    entered(false)\n#endif\n{}\n\n/* Move constructor. */\ntemplate<typename T, size_t N, class AllocPolicy, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AllocPolicy, TV>::VectorBase(MoveRef<TV> rhs)\n  : AllocPolicy(rhs)\n#ifdef DEBUG\n    , entered(false)\n#endif\n{\n  mLength = rhs->mLength;\n  mCapacity = rhs->mCapacity;\n#ifdef DEBUG\n  mReserved = rhs->mReserved;\n#endif\n\n  if (rhs->usingInlineStorage()) {\n    /* We can't move the buffer over in this case, so copy elements. */\n    mBegin = static_cast<T*>(storage.addr());\n    Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck());\n    /*\n     * Leave rhs's mLength, mBegin, mCapacity, and mReserved as they are.\n     * The elements in its in-line storage still need to be destroyed.\n     */\n  } else {\n    /*\n     * Take src's buffer, and turn src into an empty vector using\n     * in-line storage.\n     */\n    mBegin = rhs->mBegin;\n    rhs->mBegin = static_cast<T*>(rhs->storage.addr());\n    rhs->mCapacity = sInlineCapacity;\n    rhs->mLength = 0;\n#ifdef DEBUG\n    rhs->mReserved = sInlineCapacity;\n#endif\n  }\n}\n\n/* Move assignment. */\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nTV&\nVectorBase<T, N, AP, TV>::operator=(MoveRef<TV> rhs)\n{\n  TV* tv = static_cast<TV*>(this);\n  tv->~TV();\n  new(tv) TV(rhs);\n  return *tv;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::~VectorBase()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n}\n\n/*\n * This function will create a new heap buffer with capacity newCap,\n * move all elements in the inline buffer to this new buffer,\n * and fail on OOM.\n */\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::convertToHeapStorage(size_t newCap)\n{\n  MOZ_ASSERT(usingInlineStorage());\n\n  /* Allocate buffer. */\n  MOZ_ASSERT(!detail::CapacityHasExcessSpace<T>(newCap));\n  T* newBuf = reinterpret_cast<T*>(this->malloc_(newCap * sizeof(T)));\n  if (!newBuf)\n    return false;\n\n  /* Copy inline elements into heap buffer. */\n  Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());\n  Impl::destroy(beginNoCheck(), endNoCheck());\n\n  /* Switch in heap buffer. */\n  mBegin = newBuf;\n  /* mLength is unchanged. */\n  mCapacity = newCap;\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_NEVER_INLINE bool\nVectorBase<T, N, AP, TV>::growStorageBy(size_t incr)\n{\n  MOZ_ASSERT(mLength + incr > mCapacity);\n  MOZ_ASSERT_IF(!usingInlineStorage(),\n                !detail::CapacityHasExcessSpace<T>(mCapacity));\n\n  /*\n   * When choosing a new capacity, its size should is as close to 2**N bytes\n   * as possible.  2**N-sized requests are best because they are unlikely to\n   * be rounded up by the allocator.  Asking for a 2**N number of elements\n   * isn't as good, because if sizeof(T) is not a power-of-two that would\n   * result in a non-2**N request size.\n   */\n\n  size_t newCap;\n\n  if (incr == 1) {\n    if (usingInlineStorage()) {\n      /* This case occurs in ~70--80% of the calls to this function. */\n      size_t newSize =\n        tl::RoundUpPow2<(sInlineCapacity + 1) * sizeof(T)>::value;\n      newCap = newSize / sizeof(T);\n      goto convert;\n    }\n\n    if (mLength == 0) {\n      /* This case occurs in ~0--10% of the calls to this function. */\n      newCap = 1;\n      goto grow;\n    }\n\n    /* This case occurs in ~15--20% of the calls to this function. */\n\n    /*\n     * Will mLength * 4 *sizeof(T) overflow?  This condition limits a vector\n     * to 1GB of memory on a 32-bit system, which is a reasonable limit.  It\n     * also ensures that\n     *\n     *   static_cast<char*>(end()) - static_cast<char*>(begin())\n     *\n     * doesn't overflow ptrdiff_t (see bug 510319).\n     */\n    if (mLength & tl::MulOverflowMask<4 * sizeof(T)>::value) {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    /*\n     * If we reach here, the existing capacity will have a size that is already\n     * as close to 2^N as sizeof(T) will allow.  Just double the capacity, and\n     * then there might be space for one more element.\n     */\n    newCap = mLength * 2;\n    if (detail::CapacityHasExcessSpace<T>(newCap))\n      newCap += 1;\n  } else {\n    /* This case occurs in ~2% of the calls to this function. */\n    size_t newMinCap = mLength + incr;\n\n    /* Did mLength + incr overflow?  Will newCap * sizeof(T) overflow? */\n    if (newMinCap < mLength ||\n        newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::value)\n    {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    size_t newMinSize = newMinCap * sizeof(T);\n    size_t newSize = RoundUpPow2(newMinSize);\n    newCap = newSize / sizeof(T);\n  }\n\n  if (usingInlineStorage()) {\n  convert:\n    return convertToHeapStorage(newCap);\n  }\n\ngrow:\n  return Impl::growTo(*this, newCap);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::initCapacity(size_t request)\n{\n  MOZ_ASSERT(empty());\n  MOZ_ASSERT(usingInlineStorage());\n  if (request == 0)\n    return true;\n  T* newbuf = reinterpret_cast<T*>(this->malloc_(request * sizeof(T)));\n  if (!newbuf)\n    return false;\n  mBegin = newbuf;\n  mCapacity = request;\n#ifdef DEBUG\n  mReserved = request;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::reserve(size_t request)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (request > mCapacity && !growStorageBy(request - mLength))\n    return false;\n\n#ifdef DEBUG\n  if (request > mReserved)\n    mReserved = request;\n  MOZ_ASSERT(mLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::shrinkBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(incr <= mLength);\n  Impl::destroy(endNoCheck() - incr, endNoCheck());\n  mLength -= incr;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  T* newend = endNoCheck() + incr;\n  Impl::initialize(endNoCheck(), newend);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growByUninitialized(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::resize(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growBy(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::resizeUninitialized(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growByUninitialized(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clear()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  mLength = 0;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clearAndFree()\n{\n  clear();\n\n  if (usingInlineStorage())\n    return;\n\n  this->free_(beginNoCheck());\n  mBegin = static_cast<T*>(storage.addr());\n  mCapacity = sInlineCapacity;\n#ifdef DEBUG\n  mReserved = sInlineCapacity;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::canAppendWithoutRealloc(size_t needed) const\n{\n  return mLength + needed <= mCapacity;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  internalAppend(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U& u)\n{\n  MOZ_ASSERT(mLength + 1 <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  new(endNoCheck()) T(u);\n  ++mLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendN(const T& t, size_t needed)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppendN(t, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendN(const T& t, size_t needed)\n{\n  MOZ_ASSERT(mLength + needed <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstructN(endNoCheck(), needed, t);\n  mLength += needed;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::insert(T* p, const T& val)\n{\n  MOZ_ASSERT(begin() <= p);\n  MOZ_ASSERT(p <= end());\n  size_t pos = p - begin();\n  MOZ_ASSERT(pos <= mLength);\n  size_t oldLength = mLength;\n  if (pos == oldLength) {\n    if (!append(val))\n      return nullptr;\n  } else {\n    T oldBack = back();\n    if (!append(oldBack)) /* Dup the last element. */\n      return nullptr;\n    for (size_t i = oldLength; i > pos; --i)\n      (*this)[i] = (*this)[i - 1];\n    (*this)[pos] = val;\n  }\n  return begin() + pos;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::erase(T* it)\n{\n  MOZ_ASSERT(begin() <= it);\n  MOZ_ASSERT(it < end());\n  while (it + 1 < end()) {\n    *it = *(it + 1);\n    ++it;\n  }\n  popBack();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U* insBegin, const U* insEnd)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  size_t needed = PointerRangeSize(insBegin, insEnd);\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppend(insBegin, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U* insBegin, size_t insLength)\n{\n  MOZ_ASSERT(mLength + insLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstruct(endNoCheck(), insBegin, insBegin + insLength);\n  mLength += insLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U& u)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength == mCapacity && !growStorageBy(1))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + 1 > mReserved)\n    mReserved = mLength + 1;\n#endif\n  internalAppend(u);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  return append(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<class U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U *insBegin, size_t insLength)\n{\n  return append(insBegin, insBegin + insLength);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::popBack()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(!empty());\n  --mLength;\n  endNoCheck()->~T();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE T\nVectorBase<T, N, AP, TV>::popCopy()\n{\n  T ret = back();\n  popBack();\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::extractRawBuffer()\n{\n  T* ret;\n  if (usingInlineStorage()) {\n    ret = reinterpret_cast<T*>(this->malloc_(mLength * sizeof(T)));\n    if (!ret)\n      return nullptr;\n    Impl::copyConstruct(ret, beginNoCheck(), endNoCheck());\n    Impl::destroy(beginNoCheck(), endNoCheck());\n    /* mBegin, mCapacity are unchanged. */\n    mLength = 0;\n  } else {\n    ret = mBegin;\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = 0;\n    mCapacity = sInlineCapacity;\n#ifdef DEBUG\n    mReserved = sInlineCapacity;\n#endif\n  }\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::replaceRawBuffer(T* p, size_t aLength)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n\n  /* Destroy what we have. */\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n\n  /* Take in the new buffer. */\n  if (aLength <= sInlineCapacity) {\n    /*\n     * We convert to inline storage if possible, even though p might\n     * otherwise be acceptable.  Maybe this behaviour should be\n     * specifiable with an argument to this function.\n     */\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = aLength;\n    mCapacity = sInlineCapacity;\n    Impl::moveConstruct(mBegin, p, p + aLength);\n    Impl::destroy(p, p + aLength);\n    this->free_(p);\n  } else {\n    mBegin = p;\n    mLength = aLength;\n    mCapacity = aLength;\n  }\n#ifdef DEBUG\n  mReserved = aLength;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::swap(TV& other)\n{\n  static_assert(N == 0,\n                \"still need to implement this for N != 0\");\n\n  // This only works when inline storage is always empty.\n  if (!usingInlineStorage() && other.usingInlineStorage()) {\n    other.mBegin = mBegin;\n    mBegin = inlineStorage();\n  } else if (usingInlineStorage() && !other.usingInlineStorage()) {\n    mBegin = other.mBegin;\n    other.mBegin = other.inlineStorage();\n  } else if (!usingInlineStorage() && !other.usingInlineStorage()) {\n    Swap(mBegin, other.mBegin);\n  } else {\n    // This case is a no-op, since we'd set both to use their inline storage.\n  }\n\n  Swap(mLength, other.mLength);\n  Swap(mCapacity, other.mCapacity);\n#ifdef DEBUG\n  Swap(mReserved, other.mReserved);\n#endif\n}\n\n/*\n * STL-like container providing a short-lived, dynamic buffer.  Vector calls the\n * constructors/destructors of all elements stored in its internal buffer, so\n * non-PODs may be safely used.  Additionally, Vector will store the first N\n * elements in-place before resorting to dynamic allocation.\n *\n * T requirements:\n *  - default and copy constructible, assignable, destructible\n *  - operations do not throw\n * N requirements:\n *  - any value, however, N is clamped to min/max values\n * AllocPolicy:\n *  - see \"Allocation policies\" in AllocPolicy.h (defaults to\n *    mozilla::MallocAllocPolicy)\n *\n * Vector is not reentrant: T member functions called during Vector member\n * functions must not call back into the same object!\n */\ntemplate<typename T,\n         size_t MinInlineCapacity = 0,\n         class AllocPolicy = MallocAllocPolicy>\nclass Vector\n  : public VectorBase<T,\n                      MinInlineCapacity,\n                      AllocPolicy,\n                      Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector& operator=(mozilla::MoveRef<Vector> vec) {\n      return Base::operator=(vec);\n    }\n};\n\n} // namespace mozilla\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif /* mozilla_Vector_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/include/win32/mozilla/WeakPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Weak pointer functionality, implemented as a mixin for use with any class. */\n\n/**\n * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting\n * its lifetime. It works by creating a single shared reference counted object\n * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo'\n * clear the pointer in the WeakReference without having to know about all of\n * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime\n * of 'Foo'.\n *\n * AtomicSupportsWeakPtr can be used for a variant with an atomically updated\n * reference counter.\n *\n * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional\n * dereference, and an additional heap allocated pointer sized object shared\n * between all of the WeakPtrs.\n *\n * Example of usage:\n *\n *   // To have a class C support weak pointers, inherit from SupportsWeakPtr<C>.\n *   class C : public SupportsWeakPtr<C>\n *   {\n *    public:\n *      int num;\n *      void act();\n *   };\n *\n *   C* ptr =  new C();\n *\n *   // Get weak pointers to ptr. The first time asWeakPtr is called\n *   // a reference counted WeakReference object is created that\n *   // can live beyond the lifetime of 'ptr'. The WeakReference\n *   // object will be notified of 'ptr's destruction.\n *   WeakPtr<C> weak = ptr->asWeakPtr();\n *   WeakPtr<C> other = ptr->asWeakPtr();\n *\n *   // Test a weak pointer for validity before using it.\n *   if (weak) {\n *     weak->num = 17;\n *     weak->act();\n *   }\n *\n *   // Destroying the underlying object clears weak pointers to it.\n *   delete ptr;\n *\n *   MOZ_ASSERT(!weak, \"Deleting |ptr| clears weak pointers to it.\");\n *   MOZ_ASSERT(!other, \"Deleting |ptr| clears all weak pointers to it.\");\n *\n * WeakPtr is typesafe and may be used with any class. It is not required that\n * the class be reference-counted or allocated in any particular way.\n *\n * The API was loosely inspired by Chromium's weak_ptr.h:\n * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h\n */\n\n#ifndef mozilla_WeakPtr_h\n#define mozilla_WeakPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RefPtr.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate <typename T, class WeakReference> class WeakPtrBase;\ntemplate <typename T, class WeakReference> class SupportsWeakPtrBase;\n\nnamespace detail {\n\n// This can live beyond the lifetime of the class derived from SupportsWeakPtrBase.\ntemplate<class T, RefCountAtomicity Atomicity>\nclass WeakReference : public RefCounted<WeakReference<T, Atomicity>, Atomicity>\n{\n  public:\n    explicit WeakReference(T* p) : ptr(p) {}\n    T* get() const {\n      return ptr;\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n    void detach() {\n      ptr = nullptr;\n    }\n    T* ptr;\n};\n\n} // namespace detail\n\ntemplate <typename T, class WeakReference>\nclass SupportsWeakPtrBase\n{\n  public:\n    WeakPtrBase<T, WeakReference> asWeakPtr() {\n      if (!weakRef)\n        weakRef = new WeakReference(static_cast<T*>(this));\n      return WeakPtrBase<T, WeakReference>(weakRef);\n    }\n\n  protected:\n    ~SupportsWeakPtrBase() {\n      static_assert(IsBaseOf<SupportsWeakPtrBase<T, WeakReference>, T>::value,\n                    \"T must derive from SupportsWeakPtrBase<T, WeakReference>\");\n      if (weakRef)\n        weakRef->detach();\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n\n    RefPtr<WeakReference> weakRef;\n};\n\ntemplate <typename T>\nclass SupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::NonAtomicRefCount> >\n{\n};\n\ntemplate <typename T>\nclass AtomicSupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::AtomicRefCount> >\n{\n};\n\nnamespace detail {\n\ntemplate <typename T>\nstruct WeakReferenceCount\n{\n  static const RefCountAtomicity atomicity =\n    IsBaseOf<AtomicSupportsWeakPtr<T>, T>::value\n    ? AtomicRefCount\n    : NonAtomicRefCount;\n};\n\n}\n\ntemplate <typename T, class WeakReference>\nclass WeakPtrBase\n{\n  public:\n    WeakPtrBase(const WeakPtrBase<T, WeakReference>& o) : ref(o.ref) {}\n    // Ensure that ref is dereferenceable in the uninitialized state\n    WeakPtrBase() : ref(new WeakReference(nullptr)) {}\n\n    operator T*() const {\n      return ref->get();\n    }\n    T& operator*() const {\n      return *ref->get();\n    }\n\n    T* operator->() const {\n      return ref->get();\n    }\n\n    T* get() const {\n      return ref->get();\n    }\n\n  private:\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n\n    explicit WeakPtrBase(const RefPtr<WeakReference> &o) : ref(o) {}\n\n    RefPtr<WeakReference> ref;\n};\n\ntemplate <typename T>\nclass WeakPtr : public WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> >\n{\n    typedef WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> > Base;\n  public:\n    WeakPtr(const WeakPtr<T>& o) : Base(o) {}\n    WeakPtr(const Base& o) : Base(o) {}\n    WeakPtr() {}\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_WeakPtr_h */\n"
  },
  {
    "path": "cocos2d/external/spidermonkey/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE    := spidermonkey_static\nLOCAL_MODULE_FILENAME := js_static\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libjs_static.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android\nLOCAL_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -Wno-invalid-offsetof\nLOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -Wno-invalid-offsetof\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/sqlite3/Android.mk",
    "content": ""
  },
  {
    "path": "cocos2d/external/sqlite3/include/sqlite3.h",
    "content": "/*\n** 2001 September 15\n**\n** The author disclaims copyright to this source code.  In place of\n** a legal notice, here is a blessing:\n**\n**    May you do good and not evil.\n**    May you find forgiveness for yourself and forgive others.\n**    May you share freely, never taking more than you give.\n**\n*************************************************************************\n** This header file defines the interface that the SQLite library\n** presents to client programs.  If a C-function, structure, datatype,\n** or constant definition does not appear in this file, then it is\n** not a published API of SQLite, is subject to change without\n** notice, and should not be referenced by programs that use SQLite.\n**\n** Some of the definitions that are in this file are marked as\n** \"experimental\".  Experimental interfaces are normally new\n** features recently added to SQLite.  We do not anticipate changes\n** to experimental interfaces but reserve the right to make minor changes\n** if experience from use \"in the wild\" suggest such changes are prudent.\n**\n** The official C-language API documentation for SQLite is derived\n** from comments in this file.  This file is the authoritative source\n** on how SQLite interfaces are suppose to operate.\n**\n** The name of this file under configuration management is \"sqlite.h.in\".\n** The makefile makes some minor changes to this file (such as inserting\n** the version number) and changes its name to \"sqlite3.h\" as\n** part of the build process.\n*/\n#ifndef _SQLITE3_H_\n#define _SQLITE3_H_\n#include <stdarg.h>     /* Needed for the definition of va_list */\n\n/*\n** Make sure we can call this stuff from C++.\n*/\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/*\n** Add the ability to override 'extern'\n*/\n#ifndef SQLITE_EXTERN\n# define SQLITE_EXTERN extern\n#endif\n\n#ifndef SQLITE_API\n# define SQLITE_API\n#endif\n\n\n/*\n** These no-op macros are used in front of interfaces to mark those\n** interfaces as either deprecated or experimental.  New applications\n** should not use deprecated interfaces - they are support for backwards\n** compatibility only.  Application writers should be aware that\n** experimental interfaces are subject to change in point releases.\n**\n** These macros used to resolve to various kinds of compiler magic that\n** would generate warning messages when they were used.  But that\n** compiler magic ended up generating such a flurry of bug reports\n** that we have taken it all out and gone back to using simple\n** noop macros.\n*/\n#define SQLITE_DEPRECATED\n#define SQLITE_EXPERIMENTAL\n\n/*\n** Ensure these symbols were not defined by some previous header file.\n*/\n#ifdef SQLITE_VERSION\n# undef SQLITE_VERSION\n#endif\n#ifdef SQLITE_VERSION_NUMBER\n# undef SQLITE_VERSION_NUMBER\n#endif\n\n/*\n** CAPI3REF: Compile-Time Library Version Numbers\n**\n** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header\n** evaluates to a string literal that is the SQLite version in the\n** format \"X.Y.Z\" where X is the major version number (always 3 for\n** SQLite3) and Y is the minor version number and Z is the release number.)^\n** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer\n** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same\n** numbers used in [SQLITE_VERSION].)^\n** The SQLITE_VERSION_NUMBER for any given release of SQLite will also\n** be larger than the release from which it is derived.  Either Y will\n** be held constant and Z will be incremented or else Y will be incremented\n** and Z will be reset to zero.\n**\n** Since version 3.6.18, SQLite source code has been stored in the\n** <a href=\"http://www.fossil-scm.org/\">Fossil configuration management\n** system</a>.  ^The SQLITE_SOURCE_ID macro evaluates to\n** a string which identifies a particular check-in of SQLite\n** within its configuration management system.  ^The SQLITE_SOURCE_ID\n** string contains the date and time of the check-in (UTC) and an SHA1\n** hash of the entire source tree.\n**\n** See also: [sqlite3_libversion()],\n** [sqlite3_libversion_number()], [sqlite3_sourceid()],\n** [sqlite_version()] and [sqlite_source_id()].\n*/\n#define SQLITE_VERSION        \"3.7.15.1\"\n#define SQLITE_VERSION_NUMBER 3007015\n#define SQLITE_SOURCE_ID      \"2012-12-19 20:39:10 6b85b767d0ff7975146156a99ad673f2c1a23318\"\n\n/*\n** CAPI3REF: Run-Time Library Version Numbers\n** KEYWORDS: sqlite3_version, sqlite3_sourceid\n**\n** These interfaces provide the same information as the [SQLITE_VERSION],\n** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros\n** but are associated with the library instead of the header file.  ^(Cautious\n** programmers might include assert() statements in their application to\n** verify that values returned by these interfaces match the macros in\n** the header, and thus insure that the application is\n** compiled with matching library and header files.\n**\n** <blockquote><pre>\n** assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );\n** assert( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)==0 );\n** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );\n** </pre></blockquote>)^\n**\n** ^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION]\n** macro.  ^The sqlite3_libversion() function returns a pointer to the\n** to the sqlite3_version[] string constant.  The sqlite3_libversion()\n** function is provided for use in DLLs since DLL users usually do not have\n** direct access to string constants within the DLL.  ^The\n** sqlite3_libversion_number() function returns an integer equal to\n** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns \n** a pointer to a string constant whose value is the same as the \n** [SQLITE_SOURCE_ID] C preprocessor macro.\n**\n** See also: [sqlite_version()] and [sqlite_source_id()].\n*/\nSQLITE_API SQLITE_EXTERN const char sqlite3_version[];\nSQLITE_API const char *sqlite3_libversion(void);\nSQLITE_API const char *sqlite3_sourceid(void);\nSQLITE_API int sqlite3_libversion_number(void);\n\n/*\n** CAPI3REF: Run-Time Library Compilation Options Diagnostics\n**\n** ^The sqlite3_compileoption_used() function returns 0 or 1 \n** indicating whether the specified option was defined at \n** compile time.  ^The SQLITE_ prefix may be omitted from the \n** option name passed to sqlite3_compileoption_used().  \n**\n** ^The sqlite3_compileoption_get() function allows iterating\n** over the list of options that were defined at compile time by\n** returning the N-th compile time option string.  ^If N is out of range,\n** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_ \n** prefix is omitted from any strings returned by \n** sqlite3_compileoption_get().\n**\n** ^Support for the diagnostic functions sqlite3_compileoption_used()\n** and sqlite3_compileoption_get() may be omitted by specifying the \n** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time.\n**\n** See also: SQL functions [sqlite_compileoption_used()] and\n** [sqlite_compileoption_get()] and the [compile_options pragma].\n*/\n#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS\nSQLITE_API int sqlite3_compileoption_used(const char *zOptName);\nSQLITE_API const char *sqlite3_compileoption_get(int N);\n#endif\n\n/*\n** CAPI3REF: Test To See If The Library Is Threadsafe\n**\n** ^The sqlite3_threadsafe() function returns zero if and only if\n** SQLite was compiled with mutexing code omitted due to the\n** [SQLITE_THREADSAFE] compile-time option being set to 0.\n**\n** SQLite can be compiled with or without mutexes.  When\n** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes\n** are enabled and SQLite is threadsafe.  When the\n** [SQLITE_THREADSAFE] macro is 0, \n** the mutexes are omitted.  Without the mutexes, it is not safe\n** to use SQLite concurrently from more than one thread.\n**\n** Enabling mutexes incurs a measurable performance penalty.\n** So if speed is of utmost importance, it makes sense to disable\n** the mutexes.  But for maximum safety, mutexes should be enabled.\n** ^The default behavior is for mutexes to be enabled.\n**\n** This interface can be used by an application to make sure that the\n** version of SQLite that it is linking against was compiled with\n** the desired setting of the [SQLITE_THREADSAFE] macro.\n**\n** This interface only reports on the compile-time mutex setting\n** of the [SQLITE_THREADSAFE] flag.  If SQLite is compiled with\n** SQLITE_THREADSAFE=1 or =2 then mutexes are enabled by default but\n** can be fully or partially disabled using a call to [sqlite3_config()]\n** with the verbs [SQLITE_CONFIG_SINGLETHREAD], [SQLITE_CONFIG_MULTITHREAD],\n** or [SQLITE_CONFIG_MUTEX].  ^(The return value of the\n** sqlite3_threadsafe() function shows only the compile-time setting of\n** thread safety, not any run-time changes to that setting made by\n** sqlite3_config(). In other words, the return value from sqlite3_threadsafe()\n** is unchanged by calls to sqlite3_config().)^\n**\n** See the [threading mode] documentation for additional information.\n*/\nSQLITE_API int sqlite3_threadsafe(void);\n\n/*\n** CAPI3REF: Database Connection Handle\n** KEYWORDS: {database connection} {database connections}\n**\n** Each open SQLite database is represented by a pointer to an instance of\n** the opaque structure named \"sqlite3\".  It is useful to think of an sqlite3\n** pointer as an object.  The [sqlite3_open()], [sqlite3_open16()], and\n** [sqlite3_open_v2()] interfaces are its constructors, and [sqlite3_close()]\n** and [sqlite3_close_v2()] are its destructors.  There are many other\n** interfaces (such as\n** [sqlite3_prepare_v2()], [sqlite3_create_function()], and\n** [sqlite3_busy_timeout()] to name but three) that are methods on an\n** sqlite3 object.\n*/\ntypedef struct sqlite3 sqlite3;\n\n/*\n** CAPI3REF: 64-Bit Integer Types\n** KEYWORDS: sqlite_int64 sqlite_uint64\n**\n** Because there is no cross-platform way to specify 64-bit integer types\n** SQLite includes typedefs for 64-bit signed and unsigned integers.\n**\n** The sqlite3_int64 and sqlite3_uint64 are the preferred type definitions.\n** The sqlite_int64 and sqlite_uint64 types are supported for backwards\n** compatibility only.\n**\n** ^The sqlite3_int64 and sqlite_int64 types can store integer values\n** between -9223372036854775808 and +9223372036854775807 inclusive.  ^The\n** sqlite3_uint64 and sqlite_uint64 types can store integer values \n** between 0 and +18446744073709551615 inclusive.\n*/\n#ifdef SQLITE_INT64_TYPE\n  typedef SQLITE_INT64_TYPE sqlite_int64;\n  typedef unsigned SQLITE_INT64_TYPE sqlite_uint64;\n#elif defined(_MSC_VER) || defined(__BORLANDC__)\n  typedef __int64 sqlite_int64;\n  typedef unsigned __int64 sqlite_uint64;\n#else\n  typedef long long int sqlite_int64;\n  typedef unsigned long long int sqlite_uint64;\n#endif\ntypedef sqlite_int64 sqlite3_int64;\ntypedef sqlite_uint64 sqlite3_uint64;\n\n/*\n** If compiling for a processor that lacks floating point support,\n** substitute integer for floating-point.\n*/\n#ifdef SQLITE_OMIT_FLOATING_POINT\n# define double sqlite3_int64\n#endif\n\n/*\n** CAPI3REF: Closing A Database Connection\n**\n** ^The sqlite3_close() and sqlite3_close_v2() routines are destructors\n** for the [sqlite3] object.\n** ^Calls to sqlite3_close() and sqlite3_close_v2() return SQLITE_OK if\n** the [sqlite3] object is successfully destroyed and all associated\n** resources are deallocated.\n**\n** ^If the database connection is associated with unfinalized prepared\n** statements or unfinished sqlite3_backup objects then sqlite3_close()\n** will leave the database connection open and return [SQLITE_BUSY].\n** ^If sqlite3_close_v2() is called with unfinalized prepared statements\n** and unfinished sqlite3_backups, then the database connection becomes\n** an unusable \"zombie\" which will automatically be deallocated when the\n** last prepared statement is finalized or the last sqlite3_backup is\n** finished.  The sqlite3_close_v2() interface is intended for use with\n** host languages that are garbage collected, and where the order in which\n** destructors are called is arbitrary.\n**\n** Applications should [sqlite3_finalize | finalize] all [prepared statements],\n** [sqlite3_blob_close | close] all [BLOB handles], and \n** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated\n** with the [sqlite3] object prior to attempting to close the object.  ^If\n** sqlite3_close() is called on a [database connection] that still has\n** outstanding [prepared statements], [BLOB handles], and/or\n** [sqlite3_backup] objects then it returns SQLITE_OK but the deallocation\n** of resources is deferred until all [prepared statements], [BLOB handles],\n** and [sqlite3_backup] objects are also destroyed.\n**\n** ^If an [sqlite3] object is destroyed while a transaction is open,\n** the transaction is automatically rolled back.\n**\n** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]\n** must be either a NULL\n** pointer or an [sqlite3] object pointer obtained\n** from [sqlite3_open()], [sqlite3_open16()], or\n** [sqlite3_open_v2()], and not previously closed.\n** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer\n** argument is a harmless no-op.\n*/\nSQLITE_API int sqlite3_close(sqlite3*);\nSQLITE_API int sqlite3_close_v2(sqlite3*);\n\n/*\n** The type for a callback function.\n** This is legacy and deprecated.  It is included for historical\n** compatibility and is not documented.\n*/\ntypedef int (*sqlite3_callback)(void*,int,char**, char**);\n\n/*\n** CAPI3REF: One-Step Query Execution Interface\n**\n** The sqlite3_exec() interface is a convenience wrapper around\n** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()],\n** that allows an application to run multiple statements of SQL\n** without having to use a lot of C code. \n**\n** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,\n** semicolon-separate SQL statements passed into its 2nd argument,\n** in the context of the [database connection] passed in as its 1st\n** argument.  ^If the callback function of the 3rd argument to\n** sqlite3_exec() is not NULL, then it is invoked for each result row\n** coming out of the evaluated SQL statements.  ^The 4th argument to\n** sqlite3_exec() is relayed through to the 1st argument of each\n** callback invocation.  ^If the callback pointer to sqlite3_exec()\n** is NULL, then no callback is ever invoked and result rows are\n** ignored.\n**\n** ^If an error occurs while evaluating the SQL statements passed into\n** sqlite3_exec(), then execution of the current statement stops and\n** subsequent statements are skipped.  ^If the 5th parameter to sqlite3_exec()\n** is not NULL then any error message is written into memory obtained\n** from [sqlite3_malloc()] and passed back through the 5th parameter.\n** To avoid memory leaks, the application should invoke [sqlite3_free()]\n** on error message strings returned through the 5th parameter of\n** of sqlite3_exec() after the error message string is no longer needed.\n** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors\n** occur, then sqlite3_exec() sets the pointer in its 5th parameter to\n** NULL before returning.\n**\n** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()\n** routine returns SQLITE_ABORT without invoking the callback again and\n** without running any subsequent SQL statements.\n**\n** ^The 2nd argument to the sqlite3_exec() callback function is the\n** number of columns in the result.  ^The 3rd argument to the sqlite3_exec()\n** callback is an array of pointers to strings obtained as if from\n** [sqlite3_column_text()], one for each column.  ^If an element of a\n** result row is NULL then the corresponding string pointer for the\n** sqlite3_exec() callback is a NULL pointer.  ^The 4th argument to the\n** sqlite3_exec() callback is an array of pointers to strings where each\n** entry represents the name of corresponding result column as obtained\n** from [sqlite3_column_name()].\n**\n** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer\n** to an empty string, or a pointer that contains only whitespace and/or \n** SQL comments, then no SQL statements are evaluated and the database\n** is not changed.\n**\n** Restrictions:\n**\n** <ul>\n** <li> The application must insure that the 1st parameter to sqlite3_exec()\n**      is a valid and open [database connection].\n** <li> The application must not close [database connection] specified by\n**      the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.\n** <li> The application must not modify the SQL statement text passed into\n**      the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.\n** </ul>\n*/\nSQLITE_API int sqlite3_exec(\n  sqlite3*,                                  /* An open database */\n  const char *sql,                           /* SQL to be evaluated */\n  int (*callback)(void*,int,char**,char**),  /* Callback function */\n  void *,                                    /* 1st argument to callback */\n  char **errmsg                              /* Error msg written here */\n);\n\n/*\n** CAPI3REF: Result Codes\n** KEYWORDS: SQLITE_OK {error code} {error codes}\n** KEYWORDS: {result code} {result codes}\n**\n** Many SQLite functions return an integer result code from the set shown\n** here in order to indicate success or failure.\n**\n** New error codes may be added in future versions of SQLite.\n**\n** See also: [SQLITE_IOERR_READ | extended result codes],\n** [sqlite3_vtab_on_conflict()] [SQLITE_ROLLBACK | result codes].\n*/\n#define SQLITE_OK           0   /* Successful result */\n/* beginning-of-error-codes */\n#define SQLITE_ERROR        1   /* SQL error or missing database */\n#define SQLITE_INTERNAL     2   /* Internal logic error in SQLite */\n#define SQLITE_PERM         3   /* Access permission denied */\n#define SQLITE_ABORT        4   /* Callback routine requested an abort */\n#define SQLITE_BUSY         5   /* The database file is locked */\n#define SQLITE_LOCKED       6   /* A table in the database is locked */\n#define SQLITE_NOMEM        7   /* A malloc() failed */\n#define SQLITE_READONLY     8   /* Attempt to write a readonly database */\n#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite3_interrupt()*/\n#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */\n#define SQLITE_CORRUPT     11   /* The database disk image is malformed */\n#define SQLITE_NOTFOUND    12   /* Unknown opcode in sqlite3_file_control() */\n#define SQLITE_FULL        13   /* Insertion failed because database is full */\n#define SQLITE_CANTOPEN    14   /* Unable to open the database file */\n#define SQLITE_PROTOCOL    15   /* Database lock protocol error */\n#define SQLITE_EMPTY       16   /* Database is empty */\n#define SQLITE_SCHEMA      17   /* The database schema changed */\n#define SQLITE_TOOBIG      18   /* String or BLOB exceeds size limit */\n#define SQLITE_CONSTRAINT  19   /* Abort due to constraint violation */\n#define SQLITE_MISMATCH    20   /* Data type mismatch */\n#define SQLITE_MISUSE      21   /* Library used incorrectly */\n#define SQLITE_NOLFS       22   /* Uses OS features not supported on host */\n#define SQLITE_AUTH        23   /* Authorization denied */\n#define SQLITE_FORMAT      24   /* Auxiliary database format error */\n#define SQLITE_RANGE       25   /* 2nd parameter to sqlite3_bind out of range */\n#define SQLITE_NOTADB      26   /* File opened that is not a database file */\n#define SQLITE_ROW         100  /* sqlite3_step() has another row ready */\n#define SQLITE_DONE        101  /* sqlite3_step() has finished executing */\n/* end-of-error-codes */\n\n/*\n** CAPI3REF: Extended Result Codes\n** KEYWORDS: {extended error code} {extended error codes}\n** KEYWORDS: {extended result code} {extended result codes}\n**\n** In its default configuration, SQLite API routines return one of 26 integer\n** [SQLITE_OK | result codes].  However, experience has shown that many of\n** these result codes are too coarse-grained.  They do not provide as\n** much information about problems as programmers might like.  In an effort to\n** address this, newer versions of SQLite (version 3.3.8 and later) include\n** support for additional result codes that provide more detailed information\n** about errors. The extended result codes are enabled or disabled\n** on a per database connection basis using the\n** [sqlite3_extended_result_codes()] API.\n**\n** Some of the available extended result codes are listed here.\n** One may expect the number of extended result codes will be expand\n** over time.  Software that uses extended result codes should expect\n** to see new result codes in future releases of SQLite.\n**\n** The SQLITE_OK result code will never be extended.  It will always\n** be exactly zero.\n*/\n#define SQLITE_IOERR_READ              (SQLITE_IOERR | (1<<8))\n#define SQLITE_IOERR_SHORT_READ        (SQLITE_IOERR | (2<<8))\n#define SQLITE_IOERR_WRITE             (SQLITE_IOERR | (3<<8))\n#define SQLITE_IOERR_FSYNC             (SQLITE_IOERR | (4<<8))\n#define SQLITE_IOERR_DIR_FSYNC         (SQLITE_IOERR | (5<<8))\n#define SQLITE_IOERR_TRUNCATE          (SQLITE_IOERR | (6<<8))\n#define SQLITE_IOERR_FSTAT             (SQLITE_IOERR | (7<<8))\n#define SQLITE_IOERR_UNLOCK            (SQLITE_IOERR | (8<<8))\n#define SQLITE_IOERR_RDLOCK            (SQLITE_IOERR | (9<<8))\n#define SQLITE_IOERR_DELETE            (SQLITE_IOERR | (10<<8))\n#define SQLITE_IOERR_BLOCKED           (SQLITE_IOERR | (11<<8))\n#define SQLITE_IOERR_NOMEM             (SQLITE_IOERR | (12<<8))\n#define SQLITE_IOERR_ACCESS            (SQLITE_IOERR | (13<<8))\n#define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8))\n#define SQLITE_IOERR_LOCK              (SQLITE_IOERR | (15<<8))\n#define SQLITE_IOERR_CLOSE             (SQLITE_IOERR | (16<<8))\n#define SQLITE_IOERR_DIR_CLOSE         (SQLITE_IOERR | (17<<8))\n#define SQLITE_IOERR_SHMOPEN           (SQLITE_IOERR | (18<<8))\n#define SQLITE_IOERR_SHMSIZE           (SQLITE_IOERR | (19<<8))\n#define SQLITE_IOERR_SHMLOCK           (SQLITE_IOERR | (20<<8))\n#define SQLITE_IOERR_SHMMAP            (SQLITE_IOERR | (21<<8))\n#define SQLITE_IOERR_SEEK              (SQLITE_IOERR | (22<<8))\n#define SQLITE_IOERR_DELETE_NOENT      (SQLITE_IOERR | (23<<8))\n#define SQLITE_LOCKED_SHAREDCACHE      (SQLITE_LOCKED |  (1<<8))\n#define SQLITE_BUSY_RECOVERY           (SQLITE_BUSY   |  (1<<8))\n#define SQLITE_CANTOPEN_NOTEMPDIR      (SQLITE_CANTOPEN | (1<<8))\n#define SQLITE_CANTOPEN_ISDIR          (SQLITE_CANTOPEN | (2<<8))\n#define SQLITE_CANTOPEN_FULLPATH       (SQLITE_CANTOPEN | (3<<8))\n#define SQLITE_CORRUPT_VTAB            (SQLITE_CORRUPT | (1<<8))\n#define SQLITE_READONLY_RECOVERY       (SQLITE_READONLY | (1<<8))\n#define SQLITE_READONLY_CANTLOCK       (SQLITE_READONLY | (2<<8))\n#define SQLITE_ABORT_ROLLBACK          (SQLITE_ABORT | (2<<8))\n\n/*\n** CAPI3REF: Flags For File Open Operations\n**\n** These bit values are intended for use in the\n** 3rd parameter to the [sqlite3_open_v2()] interface and\n** in the 4th parameter to the [sqlite3_vfs.xOpen] method.\n*/\n#define SQLITE_OPEN_READONLY         0x00000001  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_READWRITE        0x00000002  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_CREATE           0x00000004  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_DELETEONCLOSE    0x00000008  /* VFS only */\n#define SQLITE_OPEN_EXCLUSIVE        0x00000010  /* VFS only */\n#define SQLITE_OPEN_AUTOPROXY        0x00000020  /* VFS only */\n#define SQLITE_OPEN_URI              0x00000040  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_MEMORY           0x00000080  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_MAIN_DB          0x00000100  /* VFS only */\n#define SQLITE_OPEN_TEMP_DB          0x00000200  /* VFS only */\n#define SQLITE_OPEN_TRANSIENT_DB     0x00000400  /* VFS only */\n#define SQLITE_OPEN_MAIN_JOURNAL     0x00000800  /* VFS only */\n#define SQLITE_OPEN_TEMP_JOURNAL     0x00001000  /* VFS only */\n#define SQLITE_OPEN_SUBJOURNAL       0x00002000  /* VFS only */\n#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000  /* VFS only */\n#define SQLITE_OPEN_NOMUTEX          0x00008000  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_FULLMUTEX        0x00010000  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_SHAREDCACHE      0x00020000  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_PRIVATECACHE     0x00040000  /* Ok for sqlite3_open_v2() */\n#define SQLITE_OPEN_WAL              0x00080000  /* VFS only */\n\n/* Reserved:                         0x00F00000 */\n\n/*\n** CAPI3REF: Device Characteristics\n**\n** The xDeviceCharacteristics method of the [sqlite3_io_methods]\n** object returns an integer which is a vector of these\n** bit values expressing I/O characteristics of the mass storage\n** device that holds the file that the [sqlite3_io_methods]\n** refers to.\n**\n** The SQLITE_IOCAP_ATOMIC property means that all writes of\n** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values\n** mean that writes of blocks that are nnn bytes in size and\n** are aligned to an address which is an integer multiple of\n** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means\n** that when data is appended to a file, the data is appended\n** first then the size of the file is extended, never the other\n** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that\n** information is written to disk in the same order as calls\n** to xWrite().  The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that\n** after reboot following a crash or power loss, the only bytes in a\n** file that were written at the application level might have changed\n** and that adjacent bytes, even bytes within the same sector are\n** guaranteed to be unchanged.\n*/\n#define SQLITE_IOCAP_ATOMIC                 0x00000001\n#define SQLITE_IOCAP_ATOMIC512              0x00000002\n#define SQLITE_IOCAP_ATOMIC1K               0x00000004\n#define SQLITE_IOCAP_ATOMIC2K               0x00000008\n#define SQLITE_IOCAP_ATOMIC4K               0x00000010\n#define SQLITE_IOCAP_ATOMIC8K               0x00000020\n#define SQLITE_IOCAP_ATOMIC16K              0x00000040\n#define SQLITE_IOCAP_ATOMIC32K              0x00000080\n#define SQLITE_IOCAP_ATOMIC64K              0x00000100\n#define SQLITE_IOCAP_SAFE_APPEND            0x00000200\n#define SQLITE_IOCAP_SEQUENTIAL             0x00000400\n#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN  0x00000800\n#define SQLITE_IOCAP_POWERSAFE_OVERWRITE    0x00001000\n\n/*\n** CAPI3REF: File Locking Levels\n**\n** SQLite uses one of these integer values as the second\n** argument to calls it makes to the xLock() and xUnlock() methods\n** of an [sqlite3_io_methods] object.\n*/\n#define SQLITE_LOCK_NONE          0\n#define SQLITE_LOCK_SHARED        1\n#define SQLITE_LOCK_RESERVED      2\n#define SQLITE_LOCK_PENDING       3\n#define SQLITE_LOCK_EXCLUSIVE     4\n\n/*\n** CAPI3REF: Synchronization Type Flags\n**\n** When SQLite invokes the xSync() method of an\n** [sqlite3_io_methods] object it uses a combination of\n** these integer values as the second argument.\n**\n** When the SQLITE_SYNC_DATAONLY flag is used, it means that the\n** sync operation only needs to flush data to mass storage.  Inode\n** information need not be flushed. If the lower four bits of the flag\n** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.\n** If the lower four bits equal SQLITE_SYNC_FULL, that means\n** to use Mac OS X style fullsync instead of fsync().\n**\n** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags\n** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL\n** settings.  The [synchronous pragma] determines when calls to the\n** xSync VFS method occur and applies uniformly across all platforms.\n** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how\n** energetic or rigorous or forceful the sync operations are and\n** only make a difference on Mac OSX for the default SQLite code.\n** (Third-party VFS implementations might also make the distinction\n** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the\n** operating systems natively supported by SQLite, only Mac OSX\n** cares about the difference.)\n*/\n#define SQLITE_SYNC_NORMAL        0x00002\n#define SQLITE_SYNC_FULL          0x00003\n#define SQLITE_SYNC_DATAONLY      0x00010\n\n/*\n** CAPI3REF: OS Interface Open File Handle\n**\n** An [sqlite3_file] object represents an open file in the \n** [sqlite3_vfs | OS interface layer].  Individual OS interface\n** implementations will\n** want to subclass this object by appending additional fields\n** for their own use.  The pMethods entry is a pointer to an\n** [sqlite3_io_methods] object that defines methods for performing\n** I/O operations on the open file.\n*/\ntypedef struct sqlite3_file sqlite3_file;\nstruct sqlite3_file {\n  const struct sqlite3_io_methods *pMethods;  /* Methods for an open file */\n};\n\n/*\n** CAPI3REF: OS Interface File Virtual Methods Object\n**\n** Every file opened by the [sqlite3_vfs.xOpen] method populates an\n** [sqlite3_file] object (or, more commonly, a subclass of the\n** [sqlite3_file] object) with a pointer to an instance of this object.\n** This object defines the methods used to perform various operations\n** against the open file represented by the [sqlite3_file] object.\n**\n** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element \n** to a non-NULL pointer, then the sqlite3_io_methods.xClose method\n** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed.  The\n** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen]\n** is for the [sqlite3_vfs.xOpen] to set the sqlite3_file.pMethods element\n** to NULL.\n**\n** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or\n** [SQLITE_SYNC_FULL].  The first choice is the normal fsync().\n** The second choice is a Mac OS X style fullsync.  The [SQLITE_SYNC_DATAONLY]\n** flag may be ORed in to indicate that only the data of the file\n** and not its inode needs to be synced.\n**\n** The integer values to xLock() and xUnlock() are one of\n** <ul>\n** <li> [SQLITE_LOCK_NONE],\n** <li> [SQLITE_LOCK_SHARED],\n** <li> [SQLITE_LOCK_RESERVED],\n** <li> [SQLITE_LOCK_PENDING], or\n** <li> [SQLITE_LOCK_EXCLUSIVE].\n** </ul>\n** xLock() increases the lock. xUnlock() decreases the lock.\n** The xCheckReservedLock() method checks whether any database connection,\n** either in this process or in some other process, is holding a RESERVED,\n** PENDING, or EXCLUSIVE lock on the file.  It returns true\n** if such a lock exists and false otherwise.\n**\n** The xFileControl() method is a generic interface that allows custom\n** VFS implementations to directly control an open file using the\n** [sqlite3_file_control()] interface.  The second \"op\" argument is an\n** integer opcode.  The third argument is a generic pointer intended to\n** point to a structure that may contain arguments or space in which to\n** write return values.  Potential uses for xFileControl() might be\n** functions to enable blocking locks with timeouts, to change the\n** locking strategy (for example to use dot-file locks), to inquire\n** about the status of a lock, or to break stale locks.  The SQLite\n** core reserves all opcodes less than 100 for its own use.\n** A [SQLITE_FCNTL_LOCKSTATE | list of opcodes] less than 100 is available.\n** Applications that define a custom xFileControl method should use opcodes\n** greater than 100 to avoid conflicts.  VFS implementations should\n** return [SQLITE_NOTFOUND] for file control opcodes that they do not\n** recognize.\n**\n** The xSectorSize() method returns the sector size of the\n** device that underlies the file.  The sector size is the\n** minimum write that can be performed without disturbing\n** other bytes in the file.  The xDeviceCharacteristics()\n** method returns a bit vector describing behaviors of the\n** underlying device:\n**\n** <ul>\n** <li> [SQLITE_IOCAP_ATOMIC]\n** <li> [SQLITE_IOCAP_ATOMIC512]\n** <li> [SQLITE_IOCAP_ATOMIC1K]\n** <li> [SQLITE_IOCAP_ATOMIC2K]\n** <li> [SQLITE_IOCAP_ATOMIC4K]\n** <li> [SQLITE_IOCAP_ATOMIC8K]\n** <li> [SQLITE_IOCAP_ATOMIC16K]\n** <li> [SQLITE_IOCAP_ATOMIC32K]\n** <li> [SQLITE_IOCAP_ATOMIC64K]\n** <li> [SQLITE_IOCAP_SAFE_APPEND]\n** <li> [SQLITE_IOCAP_SEQUENTIAL]\n** </ul>\n**\n** The SQLITE_IOCAP_ATOMIC property means that all writes of\n** any size are atomic.  The SQLITE_IOCAP_ATOMICnnn values\n** mean that writes of blocks that are nnn bytes in size and\n** are aligned to an address which is an integer multiple of\n** nnn are atomic.  The SQLITE_IOCAP_SAFE_APPEND value means\n** that when data is appended to a file, the data is appended\n** first then the size of the file is extended, never the other\n** way around.  The SQLITE_IOCAP_SEQUENTIAL property means that\n** information is written to disk in the same order as calls\n** to xWrite().\n**\n** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill\n** in the unread portions of the buffer with zeros.  A VFS that\n** fails to zero-fill short reads might seem to work.  However,\n** failure to zero-fill short reads will eventually lead to\n** database corruption.\n*/\ntypedef struct sqlite3_io_methods sqlite3_io_methods;\nstruct sqlite3_io_methods {\n  int iVersion;\n  int (*xClose)(sqlite3_file*);\n  int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);\n  int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst);\n  int (*xTruncate)(sqlite3_file*, sqlite3_int64 size);\n  int (*xSync)(sqlite3_file*, int flags);\n  int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize);\n  int (*xLock)(sqlite3_file*, int);\n  int (*xUnlock)(sqlite3_file*, int);\n  int (*xCheckReservedLock)(sqlite3_file*, int *pResOut);\n  int (*xFileControl)(sqlite3_file*, int op, void *pArg);\n  int (*xSectorSize)(sqlite3_file*);\n  int (*xDeviceCharacteristics)(sqlite3_file*);\n  /* Methods above are valid for version 1 */\n  int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**);\n  int (*xShmLock)(sqlite3_file*, int offset, int n, int flags);\n  void (*xShmBarrier)(sqlite3_file*);\n  int (*xShmUnmap)(sqlite3_file*, int deleteFlag);\n  /* Methods above are valid for version 2 */\n  /* Additional methods may be added in future releases */\n};\n\n/*\n** CAPI3REF: Standard File Control Opcodes\n**\n** These integer constants are opcodes for the xFileControl method\n** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]\n** interface.\n**\n** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging.  This\n** opcode causes the xFileControl method to write the current state of\n** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],\n** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])\n** into an integer that the pArg argument points to. This capability\n** is used during testing and only needs to be supported when SQLITE_TEST\n** is defined.\n** <ul>\n** <li>[[SQLITE_FCNTL_SIZE_HINT]]\n** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS\n** layer a hint of how large the database file will grow to be during the\n** current transaction.  This hint is not guaranteed to be accurate but it\n** is often close.  The underlying VFS might choose to preallocate database\n** file space based on this hint in order to help writes to the database\n** file run faster.\n**\n** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]\n** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS\n** extends and truncates the database file in chunks of a size specified\n** by the user. The fourth argument to [sqlite3_file_control()] should \n** point to an integer (type int) containing the new chunk-size to use\n** for the nominated database. Allocating database file space in large\n** chunks (say 1MB at a time), may reduce file-system fragmentation and\n** improve performance on some systems.\n**\n** <li>[[SQLITE_FCNTL_FILE_POINTER]]\n** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer\n** to the [sqlite3_file] object associated with a particular database\n** connection.  See the [sqlite3_file_control()] documentation for\n** additional information.\n**\n** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]\n** ^(The [SQLITE_FCNTL_SYNC_OMITTED] opcode is generated internally by\n** SQLite and sent to all VFSes in place of a call to the xSync method\n** when the database connection has [PRAGMA synchronous] set to OFF.)^\n** Some specialized VFSes need this signal in order to operate correctly\n** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most \n** VFSes do not need this signal and should silently ignore this opcode.\n** Applications should not call [sqlite3_file_control()] with this\n** opcode as doing so may disrupt the operation of the specialized VFSes\n** that do require it.  \n**\n** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]\n** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic\n** retry counts and intervals for certain disk I/O operations for the\n** windows [VFS] in order to provide robustness in the presence of\n** anti-virus programs.  By default, the windows VFS will retry file read,\n** file write, and file delete operations up to 10 times, with a delay\n** of 25 milliseconds before the first retry and with the delay increasing\n** by an additional 25 milliseconds with each subsequent retry.  This\n** opcode allows these two values (10 retries and 25 milliseconds of delay)\n** to be adjusted.  The values are changed for all database connections\n** within the same process.  The argument is a pointer to an array of two\n** integers where the first integer i the new retry count and the second\n** integer is the delay.  If either integer is negative, then the setting\n** is not changed but instead the prior value of that setting is written\n** into the array entry, allowing the current retry settings to be\n** interrogated.  The zDbName parameter is ignored.\n**\n** <li>[[SQLITE_FCNTL_PERSIST_WAL]]\n** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the\n** persistent [WAL | Write Ahead Log] setting.  By default, the auxiliary\n** write ahead log and shared memory files used for transaction control\n** are automatically deleted when the latest connection to the database\n** closes.  Setting persistent WAL mode causes those files to persist after\n** close.  Persisting the files is useful when other processes that do not\n** have write permission on the directory containing the database file want\n** to read the database file, as the WAL and shared memory files must exist\n** in order for the database to be readable.  The fourth parameter to\n** [sqlite3_file_control()] for this opcode should be a pointer to an integer.\n** That integer is 0 to disable persistent WAL mode or 1 to enable persistent\n** WAL mode.  If the integer is -1, then it is overwritten with the current\n** WAL persistence setting.\n**\n** <li>[[SQLITE_FCNTL_POWERSAFE_OVERWRITE]]\n** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the\n** persistent \"powersafe-overwrite\" or \"PSOW\" setting.  The PSOW setting\n** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the\n** xDeviceCharacteristics methods. The fourth parameter to\n** [sqlite3_file_control()] for this opcode should be a pointer to an integer.\n** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage\n** mode.  If the integer is -1, then it is overwritten with the current\n** zero-damage mode setting.\n**\n** <li>[[SQLITE_FCNTL_OVERWRITE]]\n** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening\n** a write transaction to indicate that, unless it is rolled back for some\n** reason, the entire database file will be overwritten by the current \n** transaction. This is used by VACUUM operations.\n**\n** <li>[[SQLITE_FCNTL_VFSNAME]]\n** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of\n** all [VFSes] in the VFS stack.  The names are of all VFS shims and the\n** final bottom-level VFS are written into memory obtained from \n** [sqlite3_malloc()] and the result is stored in the char* variable\n** that the fourth parameter of [sqlite3_file_control()] points to.\n** The caller is responsible for freeing the memory when done.  As with\n** all file-control actions, there is no guarantee that this will actually\n** do anything.  Callers should initialize the char* variable to a NULL\n** pointer in case this file-control is not implemented.  This file-control\n** is intended for diagnostic use only.\n**\n** <li>[[SQLITE_FCNTL_PRAGMA]]\n** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] \n** file control is sent to the open [sqlite3_file] object corresponding\n** to the database file to which the pragma statement refers. ^The argument\n** to the [SQLITE_FCNTL_PRAGMA] file control is an array of\n** pointers to strings (char**) in which the second element of the array\n** is the name of the pragma and the third element is the argument to the\n** pragma or NULL if the pragma has no argument.  ^The handler for an\n** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element\n** of the char** argument point to a string obtained from [sqlite3_mprintf()]\n** or the equivalent and that string will become the result of the pragma or\n** the error message if the pragma fails. ^If the\n** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal \n** [PRAGMA] processing continues.  ^If the [SQLITE_FCNTL_PRAGMA]\n** file control returns [SQLITE_OK], then the parser assumes that the\n** VFS has handled the PRAGMA itself and the parser generates a no-op\n** prepared statement.  ^If the [SQLITE_FCNTL_PRAGMA] file control returns\n** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means\n** that the VFS encountered an error while handling the [PRAGMA] and the\n** compilation of the PRAGMA fails with an error.  ^The [SQLITE_FCNTL_PRAGMA]\n** file control occurs at the beginning of pragma statement analysis and so\n** it is able to override built-in [PRAGMA] statements.\n**\n** <li>[[SQLITE_FCNTL_BUSYHANDLER]]\n** ^This file-control may be invoked by SQLite on the database file handle\n** shortly after it is opened in order to provide a custom VFS with access\n** to the connections busy-handler callback. The argument is of type (void **)\n** - an array of two (void *) values. The first (void *) actually points\n** to a function of type (int (*)(void *)). In order to invoke the connections\n** busy-handler, this function should be invoked with the second (void *) in\n** the array as the only argument. If it returns non-zero, then the operation\n** should be retried. If it returns zero, the custom VFS should abandon the\n** current operation.\n**\n** <li>[[SQLITE_FCNTL_TEMPFILENAME]]\n** ^Application can invoke this file-control to have SQLite generate a\n** temporary filename using the same algorithm that is followed to generate\n** temporary filenames for TEMP tables and other internal uses.  The\n** argument should be a char** which will be filled with the filename\n** written into memory obtained from [sqlite3_malloc()].  The caller should\n** invoke [sqlite3_free()] on the result to avoid a memory leak.\n**\n** </ul>\n*/\n#define SQLITE_FCNTL_LOCKSTATE               1\n#define SQLITE_GET_LOCKPROXYFILE             2\n#define SQLITE_SET_LOCKPROXYFILE             3\n#define SQLITE_LAST_ERRNO                    4\n#define SQLITE_FCNTL_SIZE_HINT               5\n#define SQLITE_FCNTL_CHUNK_SIZE              6\n#define SQLITE_FCNTL_FILE_POINTER            7\n#define SQLITE_FCNTL_SYNC_OMITTED            8\n#define SQLITE_FCNTL_WIN32_AV_RETRY          9\n#define SQLITE_FCNTL_PERSIST_WAL            10\n#define SQLITE_FCNTL_OVERWRITE              11\n#define SQLITE_FCNTL_VFSNAME                12\n#define SQLITE_FCNTL_POWERSAFE_OVERWRITE    13\n#define SQLITE_FCNTL_PRAGMA                 14\n#define SQLITE_FCNTL_BUSYHANDLER            15\n#define SQLITE_FCNTL_TEMPFILENAME           16\n\n/*\n** CAPI3REF: Mutex Handle\n**\n** The mutex module within SQLite defines [sqlite3_mutex] to be an\n** abstract type for a mutex object.  The SQLite core never looks\n** at the internal representation of an [sqlite3_mutex].  It only\n** deals with pointers to the [sqlite3_mutex] object.\n**\n** Mutexes are created using [sqlite3_mutex_alloc()].\n*/\ntypedef struct sqlite3_mutex sqlite3_mutex;\n\n/*\n** CAPI3REF: OS Interface Object\n**\n** An instance of the sqlite3_vfs object defines the interface between\n** the SQLite core and the underlying operating system.  The \"vfs\"\n** in the name of the object stands for \"virtual file system\".  See\n** the [VFS | VFS documentation] for further information.\n**\n** The value of the iVersion field is initially 1 but may be larger in\n** future versions of SQLite.  Additional fields may be appended to this\n** object when the iVersion value is increased.  Note that the structure\n** of the sqlite3_vfs object changes in the transaction between\n** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not\n** modified.\n**\n** The szOsFile field is the size of the subclassed [sqlite3_file]\n** structure used by this VFS.  mxPathname is the maximum length of\n** a pathname in this VFS.\n**\n** Registered sqlite3_vfs objects are kept on a linked list formed by\n** the pNext pointer.  The [sqlite3_vfs_register()]\n** and [sqlite3_vfs_unregister()] interfaces manage this list\n** in a thread-safe way.  The [sqlite3_vfs_find()] interface\n** searches the list.  Neither the application code nor the VFS\n** implementation should use the pNext pointer.\n**\n** The pNext field is the only field in the sqlite3_vfs\n** structure that SQLite will ever modify.  SQLite will only access\n** or modify this field while holding a particular static mutex.\n** The application should never modify anything within the sqlite3_vfs\n** object once the object has been registered.\n**\n** The zName field holds the name of the VFS module.  The name must\n** be unique across all VFS modules.\n**\n** [[sqlite3_vfs.xOpen]]\n** ^SQLite guarantees that the zFilename parameter to xOpen\n** is either a NULL pointer or string obtained\n** from xFullPathname() with an optional suffix added.\n** ^If a suffix is added to the zFilename parameter, it will\n** consist of a single \"-\" character followed by no more than\n** 11 alphanumeric and/or \"-\" characters.\n** ^SQLite further guarantees that\n** the string will be valid and unchanged until xClose() is\n** called. Because of the previous sentence,\n** the [sqlite3_file] can safely store a pointer to the\n** filename if it needs to remember the filename for some reason.\n** If the zFilename parameter to xOpen is a NULL pointer then xOpen\n** must invent its own temporary name for the file.  ^Whenever the \n** xFilename parameter is NULL it will also be the case that the\n** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE].\n**\n** The flags argument to xOpen() includes all bits set in\n** the flags argument to [sqlite3_open_v2()].  Or if [sqlite3_open()]\n** or [sqlite3_open16()] is used, then flags includes at least\n** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. \n** If xOpen() opens a file read-only then it sets *pOutFlags to\n** include [SQLITE_OPEN_READONLY].  Other bits in *pOutFlags may be set.\n**\n** ^(SQLite will also add one of the following flags to the xOpen()\n** call, depending on the object being opened:\n**\n** <ul>\n** <li>  [SQLITE_OPEN_MAIN_DB]\n** <li>  [SQLITE_OPEN_MAIN_JOURNAL]\n** <li>  [SQLITE_OPEN_TEMP_DB]\n** <li>  [SQLITE_OPEN_TEMP_JOURNAL]\n** <li>  [SQLITE_OPEN_TRANSIENT_DB]\n** <li>  [SQLITE_OPEN_SUBJOURNAL]\n** <li>  [SQLITE_OPEN_MASTER_JOURNAL]\n** <li>  [SQLITE_OPEN_WAL]\n** </ul>)^\n**\n** The file I/O implementation can use the object type flags to\n** change the way it deals with files.  For example, an application\n** that does not care about crash recovery or rollback might make\n** the open of a journal file a no-op.  Writes to this journal would\n** also be no-ops, and any attempt to read the journal would return\n** SQLITE_IOERR.  Or the implementation might recognize that a database\n** file will be doing page-aligned sector reads and writes in a random\n** order and set up its I/O subsystem accordingly.\n**\n** SQLite might also add one of the following flags to the xOpen method:\n**\n** <ul>\n** <li> [SQLITE_OPEN_DELETEONCLOSE]\n** <li> [SQLITE_OPEN_EXCLUSIVE]\n** </ul>\n**\n** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be\n** deleted when it is closed.  ^The [SQLITE_OPEN_DELETEONCLOSE]\n** will be set for TEMP databases and their journals, transient\n** databases, and subjournals.\n**\n** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction\n** with the [SQLITE_OPEN_CREATE] flag, which are both directly\n** analogous to the O_EXCL and O_CREAT flags of the POSIX open()\n** API.  The SQLITE_OPEN_EXCLUSIVE flag, when paired with the \n** SQLITE_OPEN_CREATE, is used to indicate that file should always\n** be created, and that it is an error if it already exists.\n** It is <i>not</i> used to indicate the file should be opened \n** for exclusive access.\n**\n** ^At least szOsFile bytes of memory are allocated by SQLite\n** to hold the  [sqlite3_file] structure passed as the third\n** argument to xOpen.  The xOpen method does not have to\n** allocate the structure; it should just fill it in.  Note that\n** the xOpen method must set the sqlite3_file.pMethods to either\n** a valid [sqlite3_io_methods] object or to NULL.  xOpen must do\n** this even if the open fails.  SQLite expects that the sqlite3_file.pMethods\n** element will be valid after xOpen returns regardless of the success\n** or failure of the xOpen call.\n**\n** [[sqlite3_vfs.xAccess]]\n** ^The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS]\n** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to\n** test whether a file is readable and writable, or [SQLITE_ACCESS_READ]\n** to test whether a file is at least readable.   The file can be a\n** directory.\n**\n** ^SQLite will always allocate at least mxPathname+1 bytes for the\n** output buffer xFullPathname.  The exact size of the output buffer\n** is also passed as a parameter to both  methods. If the output buffer\n** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is\n** handled as a fatal error by SQLite, vfs implementations should endeavor\n** to prevent this by setting mxPathname to a sufficiently large value.\n**\n** The xRandomness(), xSleep(), xCurrentTime(), and xCurrentTimeInt64()\n** interfaces are not strictly a part of the filesystem, but they are\n** included in the VFS structure for completeness.\n** The xRandomness() function attempts to return nBytes bytes\n** of good-quality randomness into zOut.  The return value is\n** the actual number of bytes of randomness obtained.\n** The xSleep() method causes the calling thread to sleep for at\n** least the number of microseconds given.  ^The xCurrentTime()\n** method returns a Julian Day Number for the current date and time as\n** a floating point value.\n** ^The xCurrentTimeInt64() method returns, as an integer, the Julian\n** Day Number multiplied by 86400000 (the number of milliseconds in \n** a 24-hour day).  \n** ^SQLite will use the xCurrentTimeInt64() method to get the current\n** date and time if that method is available (if iVersion is 2 or \n** greater and the function pointer is not NULL) and will fall back\n** to xCurrentTime() if xCurrentTimeInt64() is unavailable.\n**\n** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces\n** are not used by the SQLite core.  These optional interfaces are provided\n** by some VFSes to facilitate testing of the VFS code. By overriding \n** system calls with functions under its control, a test program can\n** simulate faults and error conditions that would otherwise be difficult\n** or impossible to induce.  The set of system calls that can be overridden\n** varies from one VFS to another, and from one version of the same VFS to the\n** next.  Applications that use these interfaces must be prepared for any\n** or all of these interfaces to be NULL or for their behavior to change\n** from one release to the next.  Applications must not attempt to access\n** any of these methods if the iVersion of the VFS is less than 3.\n*/\ntypedef struct sqlite3_vfs sqlite3_vfs;\ntypedef void (*sqlite3_syscall_ptr)(void);\nstruct sqlite3_vfs {\n  int iVersion;            /* Structure version number (currently 3) */\n  int szOsFile;            /* Size of subclassed sqlite3_file */\n  int mxPathname;          /* Maximum file pathname length */\n  sqlite3_vfs *pNext;      /* Next registered VFS */\n  const char *zName;       /* Name of this virtual file system */\n  void *pAppData;          /* Pointer to application-specific data */\n  int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,\n               int flags, int *pOutFlags);\n  int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);\n  int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);\n  int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut);\n  void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename);\n  void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg);\n  void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void);\n  void (*xDlClose)(sqlite3_vfs*, void*);\n  int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut);\n  int (*xSleep)(sqlite3_vfs*, int microseconds);\n  int (*xCurrentTime)(sqlite3_vfs*, double*);\n  int (*xGetLastError)(sqlite3_vfs*, int, char *);\n  /*\n  ** The methods above are in version 1 of the sqlite_vfs object\n  ** definition.  Those that follow are added in version 2 or later\n  */\n  int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*);\n  /*\n  ** The methods above are in versions 1 and 2 of the sqlite_vfs object.\n  ** Those below are for version 3 and greater.\n  */\n  int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr);\n  sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName);\n  const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName);\n  /*\n  ** The methods above are in versions 1 through 3 of the sqlite_vfs object.\n  ** New fields may be appended in figure versions.  The iVersion\n  ** value will increment whenever this happens. \n  */\n};\n\n/*\n** CAPI3REF: Flags for the xAccess VFS method\n**\n** These integer constants can be used as the third parameter to\n** the xAccess method of an [sqlite3_vfs] object.  They determine\n** what kind of permissions the xAccess method is looking for.\n** With SQLITE_ACCESS_EXISTS, the xAccess method\n** simply checks whether the file exists.\n** With SQLITE_ACCESS_READWRITE, the xAccess method\n** checks whether the named directory is both readable and writable\n** (in other words, if files can be added, removed, and renamed within\n** the directory).\n** The SQLITE_ACCESS_READWRITE constant is currently used only by the\n** [temp_store_directory pragma], though this could change in a future\n** release of SQLite.\n** With SQLITE_ACCESS_READ, the xAccess method\n** checks whether the file is readable.  The SQLITE_ACCESS_READ constant is\n** currently unused, though it might be used in a future release of\n** SQLite.\n*/\n#define SQLITE_ACCESS_EXISTS    0\n#define SQLITE_ACCESS_READWRITE 1   /* Used by PRAGMA temp_store_directory */\n#define SQLITE_ACCESS_READ      2   /* Unused */\n\n/*\n** CAPI3REF: Flags for the xShmLock VFS method\n**\n** These integer constants define the various locking operations\n** allowed by the xShmLock method of [sqlite3_io_methods].  The\n** following are the only legal combinations of flags to the\n** xShmLock method:\n**\n** <ul>\n** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_SHARED\n** <li>  SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE\n** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED\n** <li>  SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE\n** </ul>\n**\n** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as\n** was given no the corresponding lock.  \n**\n** The xShmLock method can transition between unlocked and SHARED or\n** between unlocked and EXCLUSIVE.  It cannot transition between SHARED\n** and EXCLUSIVE.\n*/\n#define SQLITE_SHM_UNLOCK       1\n#define SQLITE_SHM_LOCK         2\n#define SQLITE_SHM_SHARED       4\n#define SQLITE_SHM_EXCLUSIVE    8\n\n/*\n** CAPI3REF: Maximum xShmLock index\n**\n** The xShmLock method on [sqlite3_io_methods] may use values\n** between 0 and this upper bound as its \"offset\" argument.\n** The SQLite core will never attempt to acquire or release a\n** lock outside of this range\n*/\n#define SQLITE_SHM_NLOCK        8\n\n\n/*\n** CAPI3REF: Initialize The SQLite Library\n**\n** ^The sqlite3_initialize() routine initializes the\n** SQLite library.  ^The sqlite3_shutdown() routine\n** deallocates any resources that were allocated by sqlite3_initialize().\n** These routines are designed to aid in process initialization and\n** shutdown on embedded systems.  Workstation applications using\n** SQLite normally do not need to invoke either of these routines.\n**\n** A call to sqlite3_initialize() is an \"effective\" call if it is\n** the first time sqlite3_initialize() is invoked during the lifetime of\n** the process, or if it is the first time sqlite3_initialize() is invoked\n** following a call to sqlite3_shutdown().  ^(Only an effective call\n** of sqlite3_initialize() does any initialization.  All other calls\n** are harmless no-ops.)^\n**\n** A call to sqlite3_shutdown() is an \"effective\" call if it is the first\n** call to sqlite3_shutdown() since the last sqlite3_initialize().  ^(Only\n** an effective call to sqlite3_shutdown() does any deinitialization.\n** All other valid calls to sqlite3_shutdown() are harmless no-ops.)^\n**\n** The sqlite3_initialize() interface is threadsafe, but sqlite3_shutdown()\n** is not.  The sqlite3_shutdown() interface must only be called from a\n** single thread.  All open [database connections] must be closed and all\n** other SQLite resources must be deallocated prior to invoking\n** sqlite3_shutdown().\n**\n** Among other things, ^sqlite3_initialize() will invoke\n** sqlite3_os_init().  Similarly, ^sqlite3_shutdown()\n** will invoke sqlite3_os_end().\n**\n** ^The sqlite3_initialize() routine returns [SQLITE_OK] on success.\n** ^If for some reason, sqlite3_initialize() is unable to initialize\n** the library (perhaps it is unable to allocate a needed resource such\n** as a mutex) it returns an [error code] other than [SQLITE_OK].\n**\n** ^The sqlite3_initialize() routine is called internally by many other\n** SQLite interfaces so that an application usually does not need to\n** invoke sqlite3_initialize() directly.  For example, [sqlite3_open()]\n** calls sqlite3_initialize() so the SQLite library will be automatically\n** initialized when [sqlite3_open()] is called if it has not be initialized\n** already.  ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]\n** compile-time option, then the automatic calls to sqlite3_initialize()\n** are omitted and the application must call sqlite3_initialize() directly\n** prior to using any other SQLite interface.  For maximum portability,\n** it is recommended that applications always invoke sqlite3_initialize()\n** directly prior to using any other SQLite interface.  Future releases\n** of SQLite may require this.  In other words, the behavior exhibited\n** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the\n** default behavior in some future release of SQLite.\n**\n** The sqlite3_os_init() routine does operating-system specific\n** initialization of the SQLite library.  The sqlite3_os_end()\n** routine undoes the effect of sqlite3_os_init().  Typical tasks\n** performed by these routines include allocation or deallocation\n** of static resources, initialization of global variables,\n** setting up a default [sqlite3_vfs] module, or setting up\n** a default configuration using [sqlite3_config()].\n**\n** The application should never invoke either sqlite3_os_init()\n** or sqlite3_os_end() directly.  The application should only invoke\n** sqlite3_initialize() and sqlite3_shutdown().  The sqlite3_os_init()\n** interface is called automatically by sqlite3_initialize() and\n** sqlite3_os_end() is called by sqlite3_shutdown().  Appropriate\n** implementations for sqlite3_os_init() and sqlite3_os_end()\n** are built into SQLite when it is compiled for Unix, Windows, or OS/2.\n** When [custom builds | built for other platforms]\n** (using the [SQLITE_OS_OTHER=1] compile-time\n** option) the application must supply a suitable implementation for\n** sqlite3_os_init() and sqlite3_os_end().  An application-supplied\n** implementation of sqlite3_os_init() or sqlite3_os_end()\n** must return [SQLITE_OK] on success and some other [error code] upon\n** failure.\n*/\nSQLITE_API int sqlite3_initialize(void);\nSQLITE_API int sqlite3_shutdown(void);\nSQLITE_API int sqlite3_os_init(void);\nSQLITE_API int sqlite3_os_end(void);\n\n/*\n** CAPI3REF: Configuring The SQLite Library\n**\n** The sqlite3_config() interface is used to make global configuration\n** changes to SQLite in order to tune SQLite to the specific needs of\n** the application.  The default configuration is recommended for most\n** applications and so this routine is usually not necessary.  It is\n** provided to support rare applications with unusual needs.\n**\n** The sqlite3_config() interface is not threadsafe.  The application\n** must insure that no other SQLite interfaces are invoked by other\n** threads while sqlite3_config() is running.  Furthermore, sqlite3_config()\n** may only be invoked prior to library initialization using\n** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].\n** ^If sqlite3_config() is called after [sqlite3_initialize()] and before\n** [sqlite3_shutdown()] then it will return SQLITE_MISUSE.\n** Note, however, that ^sqlite3_config() can be called as part of the\n** implementation of an application-defined [sqlite3_os_init()].\n**\n** The first argument to sqlite3_config() is an integer\n** [configuration option] that determines\n** what property of SQLite is to be configured.  Subsequent arguments\n** vary depending on the [configuration option]\n** in the first argument.\n**\n** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].\n** ^If the option is unknown or SQLite is unable to set the option\n** then this routine returns a non-zero [error code].\n*/\nSQLITE_API int sqlite3_config(int, ...);\n\n/*\n** CAPI3REF: Configure database connections\n**\n** The sqlite3_db_config() interface is used to make configuration\n** changes to a [database connection].  The interface is similar to\n** [sqlite3_config()] except that the changes apply to a single\n** [database connection] (specified in the first argument).\n**\n** The second argument to sqlite3_db_config(D,V,...)  is the\n** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code \n** that indicates what aspect of the [database connection] is being configured.\n** Subsequent arguments vary depending on the configuration verb.\n**\n** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if\n** the call is considered successful.\n*/\nSQLITE_API int sqlite3_db_config(sqlite3*, int op, ...);\n\n/*\n** CAPI3REF: Memory Allocation Routines\n**\n** An instance of this object defines the interface between SQLite\n** and low-level memory allocation routines.\n**\n** This object is used in only one place in the SQLite interface.\n** A pointer to an instance of this object is the argument to\n** [sqlite3_config()] when the configuration option is\n** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC].  \n** By creating an instance of this object\n** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC])\n** during configuration, an application can specify an alternative\n** memory allocation subsystem for SQLite to use for all of its\n** dynamic memory needs.\n**\n** Note that SQLite comes with several [built-in memory allocators]\n** that are perfectly adequate for the overwhelming majority of applications\n** and that this object is only useful to a tiny minority of applications\n** with specialized memory allocation requirements.  This object is\n** also used during testing of SQLite in order to specify an alternative\n** memory allocator that simulates memory out-of-memory conditions in\n** order to verify that SQLite recovers gracefully from such\n** conditions.\n**\n** The xMalloc, xRealloc, and xFree methods must work like the\n** malloc(), realloc() and free() functions from the standard C library.\n** ^SQLite guarantees that the second argument to\n** xRealloc is always a value returned by a prior call to xRoundup.\n**\n** xSize should return the allocated size of a memory allocation\n** previously obtained from xMalloc or xRealloc.  The allocated size\n** is always at least as big as the requested size but may be larger.\n**\n** The xRoundup method returns what would be the allocated size of\n** a memory allocation given a particular requested size.  Most memory\n** allocators round up memory allocations at least to the next multiple\n** of 8.  Some allocators round up to a larger multiple or to a power of 2.\n** Every memory allocation request coming in through [sqlite3_malloc()]\n** or [sqlite3_realloc()] first calls xRoundup.  If xRoundup returns 0, \n** that causes the corresponding memory allocation to fail.\n**\n** The xInit method initializes the memory allocator.  (For example,\n** it might allocate any require mutexes or initialize internal data\n** structures.  The xShutdown method is invoked (indirectly) by\n** [sqlite3_shutdown()] and should deallocate any resources acquired\n** by xInit.  The pAppData pointer is used as the only parameter to\n** xInit and xShutdown.\n**\n** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes\n** the xInit method, so the xInit method need not be threadsafe.  The\n** xShutdown method is only called from [sqlite3_shutdown()] so it does\n** not need to be threadsafe either.  For all other methods, SQLite\n** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the\n** [SQLITE_CONFIG_MEMSTATUS] configuration option is turned on (which\n** it is by default) and so the methods are automatically serialized.\n** However, if [SQLITE_CONFIG_MEMSTATUS] is disabled, then the other\n** methods must be threadsafe or else make their own arrangements for\n** serialization.\n**\n** SQLite will never invoke xInit() more than once without an intervening\n** call to xShutdown().\n*/\ntypedef struct sqlite3_mem_methods sqlite3_mem_methods;\nstruct sqlite3_mem_methods {\n  void *(*xMalloc)(int);         /* Memory allocation function */\n  void (*xFree)(void*);          /* Free a prior allocation */\n  void *(*xRealloc)(void*,int);  /* Resize an allocation */\n  int (*xSize)(void*);           /* Return the size of an allocation */\n  int (*xRoundup)(int);          /* Round up request size to allocation size */\n  int (*xInit)(void*);           /* Initialize the memory allocator */\n  void (*xShutdown)(void*);      /* Deinitialize the memory allocator */\n  void *pAppData;                /* Argument to xInit() and xShutdown() */\n};\n\n/*\n** CAPI3REF: Configuration Options\n** KEYWORDS: {configuration option}\n**\n** These constants are the available integer configuration options that\n** can be passed as the first argument to the [sqlite3_config()] interface.\n**\n** New configuration options may be added in future releases of SQLite.\n** Existing configuration options might be discontinued.  Applications\n** should check the return code from [sqlite3_config()] to make sure that\n** the call worked.  The [sqlite3_config()] interface will return a\n** non-zero [error code] if a discontinued or unsupported configuration option\n** is invoked.\n**\n** <dl>\n** [[SQLITE_CONFIG_SINGLETHREAD]] <dt>SQLITE_CONFIG_SINGLETHREAD</dt>\n** <dd>There are no arguments to this option.  ^This option sets the\n** [threading mode] to Single-thread.  In other words, it disables\n** all mutexing and puts SQLite into a mode where it can only be used\n** by a single thread.   ^If SQLite is compiled with\n** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then\n** it is not possible to change the [threading mode] from its default\n** value of Single-thread and so [sqlite3_config()] will return \n** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD\n** configuration option.</dd>\n**\n** [[SQLITE_CONFIG_MULTITHREAD]] <dt>SQLITE_CONFIG_MULTITHREAD</dt>\n** <dd>There are no arguments to this option.  ^This option sets the\n** [threading mode] to Multi-thread.  In other words, it disables\n** mutexing on [database connection] and [prepared statement] objects.\n** The application is responsible for serializing access to\n** [database connections] and [prepared statements].  But other mutexes\n** are enabled so that SQLite will be safe to use in a multi-threaded\n** environment as long as no two threads attempt to use the same\n** [database connection] at the same time.  ^If SQLite is compiled with\n** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then\n** it is not possible to set the Multi-thread [threading mode] and\n** [sqlite3_config()] will return [SQLITE_ERROR] if called with the\n** SQLITE_CONFIG_MULTITHREAD configuration option.</dd>\n**\n** [[SQLITE_CONFIG_SERIALIZED]] <dt>SQLITE_CONFIG_SERIALIZED</dt>\n** <dd>There are no arguments to this option.  ^This option sets the\n** [threading mode] to Serialized. In other words, this option enables\n** all mutexes including the recursive\n** mutexes on [database connection] and [prepared statement] objects.\n** In this mode (which is the default when SQLite is compiled with\n** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access\n** to [database connections] and [prepared statements] so that the\n** application is free to use the same [database connection] or the\n** same [prepared statement] in different threads at the same time.\n** ^If SQLite is compiled with\n** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then\n** it is not possible to set the Serialized [threading mode] and\n** [sqlite3_config()] will return [SQLITE_ERROR] if called with the\n** SQLITE_CONFIG_SERIALIZED configuration option.</dd>\n**\n** [[SQLITE_CONFIG_MALLOC]] <dt>SQLITE_CONFIG_MALLOC</dt>\n** <dd> ^(This option takes a single argument which is a pointer to an\n** instance of the [sqlite3_mem_methods] structure.  The argument specifies\n** alternative low-level memory allocation routines to be used in place of\n** the memory allocation routines built into SQLite.)^ ^SQLite makes\n** its own private copy of the content of the [sqlite3_mem_methods] structure\n** before the [sqlite3_config()] call returns.</dd>\n**\n** [[SQLITE_CONFIG_GETMALLOC]] <dt>SQLITE_CONFIG_GETMALLOC</dt>\n** <dd> ^(This option takes a single argument which is a pointer to an\n** instance of the [sqlite3_mem_methods] structure.  The [sqlite3_mem_methods]\n** structure is filled with the currently defined memory allocation routines.)^\n** This option can be used to overload the default memory allocation\n** routines with a wrapper that simulations memory allocation failure or\n** tracks memory usage, for example. </dd>\n**\n** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>\n** <dd> ^This option takes single argument of type int, interpreted as a \n** boolean, which enables or disables the collection of memory allocation \n** statistics. ^(When memory allocation statistics are disabled, the \n** following SQLite interfaces become non-operational:\n**   <ul>\n**   <li> [sqlite3_memory_used()]\n**   <li> [sqlite3_memory_highwater()]\n**   <li> [sqlite3_soft_heap_limit64()]\n**   <li> [sqlite3_status()]\n**   </ul>)^\n** ^Memory allocation statistics are enabled by default unless SQLite is\n** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory\n** allocation statistics are disabled by default.\n** </dd>\n**\n** [[SQLITE_CONFIG_SCRATCH]] <dt>SQLITE_CONFIG_SCRATCH</dt>\n** <dd> ^This option specifies a static memory buffer that SQLite can use for\n** scratch memory.  There are three arguments:  A pointer an 8-byte\n** aligned memory buffer from which the scratch allocations will be\n** drawn, the size of each scratch allocation (sz),\n** and the maximum number of scratch allocations (N).  The sz\n** argument must be a multiple of 16.\n** The first argument must be a pointer to an 8-byte aligned buffer\n** of at least sz*N bytes of memory.\n** ^SQLite will use no more than two scratch buffers per thread.  So\n** N should be set to twice the expected maximum number of threads.\n** ^SQLite will never require a scratch buffer that is more than 6\n** times the database page size. ^If SQLite needs needs additional\n** scratch memory beyond what is provided by this configuration option, then \n** [sqlite3_malloc()] will be used to obtain the memory needed.</dd>\n**\n** [[SQLITE_CONFIG_PAGECACHE]] <dt>SQLITE_CONFIG_PAGECACHE</dt>\n** <dd> ^This option specifies a static memory buffer that SQLite can use for\n** the database page cache with the default page cache implementation.  \n** This configuration should not be used if an application-define page\n** cache implementation is loaded using the SQLITE_CONFIG_PCACHE2 option.\n** There are three arguments to this option: A pointer to 8-byte aligned\n** memory, the size of each page buffer (sz), and the number of pages (N).\n** The sz argument should be the size of the largest database page\n** (a power of two between 512 and 32768) plus a little extra for each\n** page header.  ^The page header size is 20 to 40 bytes depending on\n** the host architecture.  ^It is harmless, apart from the wasted memory,\n** to make sz a little too large.  The first\n** argument should point to an allocation of at least sz*N bytes of memory.\n** ^SQLite will use the memory provided by the first argument to satisfy its\n** memory needs for the first N pages that it adds to cache.  ^If additional\n** page cache memory is needed beyond what is provided by this option, then\n** SQLite goes to [sqlite3_malloc()] for the additional storage space.\n** The pointer in the first argument must\n** be aligned to an 8-byte boundary or subsequent behavior of SQLite\n** will be undefined.</dd>\n**\n** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>\n** <dd> ^This option specifies a static memory buffer that SQLite will use\n** for all of its dynamic memory allocation needs beyond those provided\n** for by [SQLITE_CONFIG_SCRATCH] and [SQLITE_CONFIG_PAGECACHE].\n** There are three arguments: An 8-byte aligned pointer to the memory,\n** the number of bytes in the memory buffer, and the minimum allocation size.\n** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts\n** to using its default memory allocator (the system malloc() implementation),\n** undoing any prior invocation of [SQLITE_CONFIG_MALLOC].  ^If the\n** memory pointer is not NULL and either [SQLITE_ENABLE_MEMSYS3] or\n** [SQLITE_ENABLE_MEMSYS5] are defined, then the alternative memory\n** allocator is engaged to handle all of SQLites memory allocation needs.\n** The first pointer (the memory pointer) must be aligned to an 8-byte\n** boundary or subsequent behavior of SQLite will be undefined.\n** The minimum allocation size is capped at 2**12. Reasonable values\n** for the minimum allocation size are 2**5 through 2**8.</dd>\n**\n** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>\n** <dd> ^(This option takes a single argument which is a pointer to an\n** instance of the [sqlite3_mutex_methods] structure.  The argument specifies\n** alternative low-level mutex routines to be used in place\n** the mutex routines built into SQLite.)^  ^SQLite makes a copy of the\n** content of the [sqlite3_mutex_methods] structure before the call to\n** [sqlite3_config()] returns. ^If SQLite is compiled with\n** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then\n** the entire mutexing subsystem is omitted from the build and hence calls to\n** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will\n** return [SQLITE_ERROR].</dd>\n**\n** [[SQLITE_CONFIG_GETMUTEX]] <dt>SQLITE_CONFIG_GETMUTEX</dt>\n** <dd> ^(This option takes a single argument which is a pointer to an\n** instance of the [sqlite3_mutex_methods] structure.  The\n** [sqlite3_mutex_methods]\n** structure is filled with the currently defined mutex routines.)^\n** This option can be used to overload the default mutex allocation\n** routines with a wrapper used to track mutex usage for performance\n** profiling or testing, for example.   ^If SQLite is compiled with\n** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then\n** the entire mutexing subsystem is omitted from the build and hence calls to\n** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will\n** return [SQLITE_ERROR].</dd>\n**\n** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>\n** <dd> ^(This option takes two arguments that determine the default\n** memory allocation for the lookaside memory allocator on each\n** [database connection].  The first argument is the\n** size of each lookaside buffer slot and the second is the number of\n** slots allocated to each database connection.)^  ^(This option sets the\n** <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]\n** verb to [sqlite3_db_config()] can be used to change the lookaside\n** configuration on individual connections.)^ </dd>\n**\n** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>\n** <dd> ^(This option takes a single argument which is a pointer to\n** an [sqlite3_pcache_methods2] object.  This object specifies the interface\n** to a custom page cache implementation.)^  ^SQLite makes a copy of the\n** object and uses it for page cache memory allocations.</dd>\n**\n** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>\n** <dd> ^(This option takes a single argument which is a pointer to an\n** [sqlite3_pcache_methods2] object.  SQLite copies of the current\n** page cache implementation into that object.)^ </dd>\n**\n** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>\n** <dd> ^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a\n** function with a call signature of void(*)(void*,int,const char*), \n** and a pointer to void. ^If the function pointer is not NULL, it is\n** invoked by [sqlite3_log()] to process each logging event.  ^If the\n** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.\n** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is\n** passed through as the first parameter to the application-defined logger\n** function whenever that function is invoked.  ^The second parameter to\n** the logger function is a copy of the first parameter to the corresponding\n** [sqlite3_log()] call and is intended to be a [result code] or an\n** [extended result code].  ^The third parameter passed to the logger is\n** log message after formatting via [sqlite3_snprintf()].\n** The SQLite logging interface is not reentrant; the logger function\n** supplied by the application must not invoke any SQLite interface.\n** In a multi-threaded application, the application-defined logger\n** function must be threadsafe. </dd>\n**\n** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI\n** <dd> This option takes a single argument of type int. If non-zero, then\n** URI handling is globally enabled. If the parameter is zero, then URI handling\n** is globally disabled. If URI handling is globally enabled, all filenames\n** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or\n** specified as part of [ATTACH] commands are interpreted as URIs, regardless\n** of whether or not the [SQLITE_OPEN_URI] flag is set when the database\n** connection is opened. If it is globally disabled, filenames are\n** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the\n** database connection is opened. By default, URI handling is globally\n** disabled. The default value may be changed by compiling with the\n** [SQLITE_USE_URI] symbol defined.\n**\n** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN\n** <dd> This option takes a single integer argument which is interpreted as\n** a boolean in order to enable or disable the use of covering indices for\n** full table scans in the query optimizer.  The default setting is determined\n** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is \"on\"\n** if that compile-time option is omitted.\n** The ability to disable the use of covering indices for full table scans\n** is because some incorrectly coded legacy applications might malfunction\n** malfunction when the optimization is enabled.  Providing the ability to\n** disable the optimization allows the older, buggy application code to work\n** without change even with newer versions of SQLite.\n**\n** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]]\n** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE\n** <dd> These options are obsolete and should not be used by new code.\n** They are retained for backwards compatibility but are now no-ops.\n** </dl>\n**\n** [[SQLITE_CONFIG_SQLLOG]]\n** <dt>SQLITE_CONFIG_SQLLOG\n** <dd>This option is only available if sqlite is compiled with the\n** SQLITE_ENABLE_SQLLOG pre-processor macro defined. The first argument should\n** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).\n** The second should be of type (void*). The callback is invoked by the library\n** in three separate circumstances, identified by the value passed as the\n** fourth parameter. If the fourth parameter is 0, then the database connection\n** passed as the second argument has just been opened. The third argument\n** points to a buffer containing the name of the main database file. If the\n** fourth parameter is 1, then the SQL statement that the third parameter\n** points to has just been executed. Or, if the fourth parameter is 2, then\n** the connection being passed as the second parameter is being closed. The\n** third parameter is passed NULL In this case.\n** </dl>\n*/\n#define SQLITE_CONFIG_SINGLETHREAD  1  /* nil */\n#define SQLITE_CONFIG_MULTITHREAD   2  /* nil */\n#define SQLITE_CONFIG_SERIALIZED    3  /* nil */\n#define SQLITE_CONFIG_MALLOC        4  /* sqlite3_mem_methods* */\n#define SQLITE_CONFIG_GETMALLOC     5  /* sqlite3_mem_methods* */\n#define SQLITE_CONFIG_SCRATCH       6  /* void*, int sz, int N */\n#define SQLITE_CONFIG_PAGECACHE     7  /* void*, int sz, int N */\n#define SQLITE_CONFIG_HEAP          8  /* void*, int nByte, int min */\n#define SQLITE_CONFIG_MEMSTATUS     9  /* boolean */\n#define SQLITE_CONFIG_MUTEX        10  /* sqlite3_mutex_methods* */\n#define SQLITE_CONFIG_GETMUTEX     11  /* sqlite3_mutex_methods* */\n/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ \n#define SQLITE_CONFIG_LOOKASIDE    13  /* int int */\n#define SQLITE_CONFIG_PCACHE       14  /* no-op */\n#define SQLITE_CONFIG_GETPCACHE    15  /* no-op */\n#define SQLITE_CONFIG_LOG          16  /* xFunc, void* */\n#define SQLITE_CONFIG_URI          17  /* int */\n#define SQLITE_CONFIG_PCACHE2      18  /* sqlite3_pcache_methods2* */\n#define SQLITE_CONFIG_GETPCACHE2   19  /* sqlite3_pcache_methods2* */\n#define SQLITE_CONFIG_COVERING_INDEX_SCAN 20  /* int */\n#define SQLITE_CONFIG_SQLLOG       21  /* xSqllog, void* */\n\n/*\n** CAPI3REF: Database Connection Configuration Options\n**\n** These constants are the available integer configuration options that\n** can be passed as the second argument to the [sqlite3_db_config()] interface.\n**\n** New configuration options may be added in future releases of SQLite.\n** Existing configuration options might be discontinued.  Applications\n** should check the return code from [sqlite3_db_config()] to make sure that\n** the call worked.  ^The [sqlite3_db_config()] interface will return a\n** non-zero [error code] if a discontinued or unsupported configuration option\n** is invoked.\n**\n** <dl>\n** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>\n** <dd> ^This option takes three additional arguments that determine the \n** [lookaside memory allocator] configuration for the [database connection].\n** ^The first argument (the third parameter to [sqlite3_db_config()] is a\n** pointer to a memory buffer to use for lookaside memory.\n** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb\n** may be NULL in which case SQLite will allocate the\n** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the\n** size of each lookaside buffer slot.  ^The third argument is the number of\n** slots.  The size of the buffer in the first argument must be greater than\n** or equal to the product of the second and third arguments.  The buffer\n** must be aligned to an 8-byte boundary.  ^If the second argument to\n** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally\n** rounded down to the next smaller multiple of 8.  ^(The lookaside memory\n** configuration for a database connection can only be changed when that\n** connection is not currently using lookaside memory, or in other words\n** when the \"current value\" returned by\n** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero.\n** Any attempt to change the lookaside memory configuration when lookaside\n** memory is in use leaves the configuration unchanged and returns \n** [SQLITE_BUSY].)^</dd>\n**\n** <dt>SQLITE_DBCONFIG_ENABLE_FKEY</dt>\n** <dd> ^This option is used to enable or disable the enforcement of\n** [foreign key constraints].  There should be two additional arguments.\n** The first argument is an integer which is 0 to disable FK enforcement,\n** positive to enable FK enforcement or negative to leave FK enforcement\n** unchanged.  The second parameter is a pointer to an integer into which\n** is written 0 or 1 to indicate whether FK enforcement is off or on\n** following this call.  The second parameter may be a NULL pointer, in\n** which case the FK enforcement setting is not reported back. </dd>\n**\n** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt>\n** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers].\n** There should be two additional arguments.\n** The first argument is an integer which is 0 to disable triggers,\n** positive to enable triggers or negative to leave the setting unchanged.\n** The second parameter is a pointer to an integer into which\n** is written 0 or 1 to indicate whether triggers are disabled or enabled\n** following this call.  The second parameter may be a NULL pointer, in\n** which case the trigger setting is not reported back. </dd>\n**\n** </dl>\n*/\n#define SQLITE_DBCONFIG_LOOKASIDE       1001  /* void* int int */\n#define SQLITE_DBCONFIG_ENABLE_FKEY     1002  /* int int* */\n#define SQLITE_DBCONFIG_ENABLE_TRIGGER  1003  /* int int* */\n\n\n/*\n** CAPI3REF: Enable Or Disable Extended Result Codes\n**\n** ^The sqlite3_extended_result_codes() routine enables or disables the\n** [extended result codes] feature of SQLite. ^The extended result\n** codes are disabled by default for historical compatibility.\n*/\nSQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff);\n\n/*\n** CAPI3REF: Last Insert Rowid\n**\n** ^Each entry in an SQLite table has a unique 64-bit signed\n** integer key called the [ROWID | \"rowid\"]. ^The rowid is always available\n** as an undeclared column named ROWID, OID, or _ROWID_ as long as those\n** names are not also used by explicitly declared columns. ^If\n** the table has a column of type [INTEGER PRIMARY KEY] then that column\n** is another alias for the rowid.\n**\n** ^This routine returns the [rowid] of the most recent\n** successful [INSERT] into the database from the [database connection]\n** in the first argument.  ^As of SQLite version 3.7.7, this routines\n** records the last insert rowid of both ordinary tables and [virtual tables].\n** ^If no successful [INSERT]s\n** have ever occurred on that database connection, zero is returned.\n**\n** ^(If an [INSERT] occurs within a trigger or within a [virtual table]\n** method, then this routine will return the [rowid] of the inserted\n** row as long as the trigger or virtual table method is running.\n** But once the trigger or virtual table method ends, the value returned \n** by this routine reverts to what it was before the trigger or virtual\n** table method began.)^\n**\n** ^An [INSERT] that fails due to a constraint violation is not a\n** successful [INSERT] and does not change the value returned by this\n** routine.  ^Thus INSERT OR FAIL, INSERT OR IGNORE, INSERT OR ROLLBACK,\n** and INSERT OR ABORT make no changes to the return value of this\n** routine when their insertion fails.  ^(When INSERT OR REPLACE\n** encounters a constraint violation, it does not fail.  The\n** INSERT continues to completion after deleting rows that caused\n** the constraint problem so INSERT OR REPLACE will always change\n** the return value of this interface.)^\n**\n** ^For the purposes of this routine, an [INSERT] is considered to\n** be successful even if it is subsequently rolled back.\n**\n** This function is accessible to SQL statements via the\n** [last_insert_rowid() SQL function].\n**\n** If a separate thread performs a new [INSERT] on the same\n** database connection while the [sqlite3_last_insert_rowid()]\n** function is running and thus changes the last insert [rowid],\n** then the value returned by [sqlite3_last_insert_rowid()] is\n** unpredictable and might not equal either the old or the new\n** last insert [rowid].\n*/\nSQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*);\n\n/*\n** CAPI3REF: Count The Number Of Rows Modified\n**\n** ^This function returns the number of database rows that were changed\n** or inserted or deleted by the most recently completed SQL statement\n** on the [database connection] specified by the first parameter.\n** ^(Only changes that are directly specified by the [INSERT], [UPDATE],\n** or [DELETE] statement are counted.  Auxiliary changes caused by\n** triggers or [foreign key actions] are not counted.)^ Use the\n** [sqlite3_total_changes()] function to find the total number of changes\n** including changes caused by triggers and foreign key actions.\n**\n** ^Changes to a view that are simulated by an [INSTEAD OF trigger]\n** are not counted.  Only real table changes are counted.\n**\n** ^(A \"row change\" is a change to a single row of a single table\n** caused by an INSERT, DELETE, or UPDATE statement.  Rows that\n** are changed as side effects of [REPLACE] constraint resolution,\n** rollback, ABORT processing, [DROP TABLE], or by any other\n** mechanisms do not count as direct row changes.)^\n**\n** A \"trigger context\" is a scope of execution that begins and\n** ends with the script of a [CREATE TRIGGER | trigger]. \n** Most SQL statements are\n** evaluated outside of any trigger.  This is the \"top level\"\n** trigger context.  If a trigger fires from the top level, a\n** new trigger context is entered for the duration of that one\n** trigger.  Subtriggers create subcontexts for their duration.\n**\n** ^Calling [sqlite3_exec()] or [sqlite3_step()] recursively does\n** not create a new trigger context.\n**\n** ^This function returns the number of direct row changes in the\n** most recent INSERT, UPDATE, or DELETE statement within the same\n** trigger context.\n**\n** ^Thus, when called from the top level, this function returns the\n** number of changes in the most recent INSERT, UPDATE, or DELETE\n** that also occurred at the top level.  ^(Within the body of a trigger,\n** the sqlite3_changes() interface can be called to find the number of\n** changes in the most recently completed INSERT, UPDATE, or DELETE\n** statement within the body of the same trigger.\n** However, the number returned does not include changes\n** caused by subtriggers since those have their own context.)^\n**\n** See also the [sqlite3_total_changes()] interface, the\n** [count_changes pragma], and the [changes() SQL function].\n**\n** If a separate thread makes changes on the same database connection\n** while [sqlite3_changes()] is running then the value returned\n** is unpredictable and not meaningful.\n*/\nSQLITE_API int sqlite3_changes(sqlite3*);\n\n/*\n** CAPI3REF: Total Number Of Rows Modified\n**\n** ^This function returns the number of row changes caused by [INSERT],\n** [UPDATE] or [DELETE] statements since the [database connection] was opened.\n** ^(The count returned by sqlite3_total_changes() includes all changes\n** from all [CREATE TRIGGER | trigger] contexts and changes made by\n** [foreign key actions]. However,\n** the count does not include changes used to implement [REPLACE] constraints,\n** do rollbacks or ABORT processing, or [DROP TABLE] processing.  The\n** count does not include rows of views that fire an [INSTEAD OF trigger],\n** though if the INSTEAD OF trigger makes changes of its own, those changes \n** are counted.)^\n** ^The sqlite3_total_changes() function counts the changes as soon as\n** the statement that makes them is completed (when the statement handle\n** is passed to [sqlite3_reset()] or [sqlite3_finalize()]).\n**\n** See also the [sqlite3_changes()] interface, the\n** [count_changes pragma], and the [total_changes() SQL function].\n**\n** If a separate thread makes changes on the same database connection\n** while [sqlite3_total_changes()] is running then the value\n** returned is unpredictable and not meaningful.\n*/\nSQLITE_API int sqlite3_total_changes(sqlite3*);\n\n/*\n** CAPI3REF: Interrupt A Long-Running Query\n**\n** ^This function causes any pending database operation to abort and\n** return at its earliest opportunity. This routine is typically\n** called in response to a user action such as pressing \"Cancel\"\n** or Ctrl-C where the user wants a long query operation to halt\n** immediately.\n**\n** ^It is safe to call this routine from a thread different from the\n** thread that is currently running the database operation.  But it\n** is not safe to call this routine with a [database connection] that\n** is closed or might close before sqlite3_interrupt() returns.\n**\n** ^If an SQL operation is very nearly finished at the time when\n** sqlite3_interrupt() is called, then it might not have an opportunity\n** to be interrupted and might continue to completion.\n**\n** ^An SQL operation that is interrupted will return [SQLITE_INTERRUPT].\n** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE\n** that is inside an explicit transaction, then the entire transaction\n** will be rolled back automatically.\n**\n** ^The sqlite3_interrupt(D) call is in effect until all currently running\n** SQL statements on [database connection] D complete.  ^Any new SQL statements\n** that are started after the sqlite3_interrupt() call and before the \n** running statements reaches zero are interrupted as if they had been\n** running prior to the sqlite3_interrupt() call.  ^New SQL statements\n** that are started after the running statement count reaches zero are\n** not effected by the sqlite3_interrupt().\n** ^A call to sqlite3_interrupt(D) that occurs when there are no running\n** SQL statements is a no-op and has no effect on SQL statements\n** that are started after the sqlite3_interrupt() call returns.\n**\n** If the database connection closes while [sqlite3_interrupt()]\n** is running then bad things will likely happen.\n*/\nSQLITE_API void sqlite3_interrupt(sqlite3*);\n\n/*\n** CAPI3REF: Determine If An SQL Statement Is Complete\n**\n** These routines are useful during command-line input to determine if the\n** currently entered text seems to form a complete SQL statement or\n** if additional input is needed before sending the text into\n** SQLite for parsing.  ^These routines return 1 if the input string\n** appears to be a complete SQL statement.  ^A statement is judged to be\n** complete if it ends with a semicolon token and is not a prefix of a\n** well-formed CREATE TRIGGER statement.  ^Semicolons that are embedded within\n** string literals or quoted identifier names or comments are not\n** independent tokens (they are part of the token in which they are\n** embedded) and thus do not count as a statement terminator.  ^Whitespace\n** and comments that follow the final semicolon are ignored.\n**\n** ^These routines return 0 if the statement is incomplete.  ^If a\n** memory allocation fails, then SQLITE_NOMEM is returned.\n**\n** ^These routines do not parse the SQL statements thus\n** will not detect syntactically incorrect SQL.\n**\n** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior \n** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked\n** automatically by sqlite3_complete16().  If that initialization fails,\n** then the return value from sqlite3_complete16() will be non-zero\n** regardless of whether or not the input SQL is complete.)^\n**\n** The input to [sqlite3_complete()] must be a zero-terminated\n** UTF-8 string.\n**\n** The input to [sqlite3_complete16()] must be a zero-terminated\n** UTF-16 string in native byte order.\n*/\nSQLITE_API int sqlite3_complete(const char *sql);\nSQLITE_API int sqlite3_complete16(const void *sql);\n\n/*\n** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors\n**\n** ^This routine sets a callback function that might be invoked whenever\n** an attempt is made to open a database table that another thread\n** or process has locked.\n**\n** ^If the busy callback is NULL, then [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED]\n** is returned immediately upon encountering the lock.  ^If the busy callback\n** is not NULL, then the callback might be invoked with two arguments.\n**\n** ^The first argument to the busy handler is a copy of the void* pointer which\n** is the third argument to sqlite3_busy_handler().  ^The second argument to\n** the busy handler callback is the number of times that the busy handler has\n** been invoked for this locking event.  ^If the\n** busy callback returns 0, then no additional attempts are made to\n** access the database and [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED] is returned.\n** ^If the callback returns non-zero, then another attempt\n** is made to open the database for reading and the cycle repeats.\n**\n** The presence of a busy handler does not guarantee that it will be invoked\n** when there is lock contention. ^If SQLite determines that invoking the busy\n** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY]\n** or [SQLITE_IOERR_BLOCKED] instead of invoking the busy handler.\n** Consider a scenario where one process is holding a read lock that\n** it is trying to promote to a reserved lock and\n** a second process is holding a reserved lock that it is trying\n** to promote to an exclusive lock.  The first process cannot proceed\n** because it is blocked by the second and the second process cannot\n** proceed because it is blocked by the first.  If both processes\n** invoke the busy handlers, neither will make any progress.  Therefore,\n** SQLite returns [SQLITE_BUSY] for the first process, hoping that this\n** will induce the first process to release its read lock and allow\n** the second process to proceed.\n**\n** ^The default busy callback is NULL.\n**\n** ^The [SQLITE_BUSY] error is converted to [SQLITE_IOERR_BLOCKED]\n** when SQLite is in the middle of a large transaction where all the\n** changes will not fit into the in-memory cache.  SQLite will\n** already hold a RESERVED lock on the database file, but it needs\n** to promote this lock to EXCLUSIVE so that it can spill cache\n** pages into the database file without harm to concurrent\n** readers.  ^If it is unable to promote the lock, then the in-memory\n** cache will be left in an inconsistent state and so the error\n** code is promoted from the relatively benign [SQLITE_BUSY] to\n** the more severe [SQLITE_IOERR_BLOCKED].  ^This error code promotion\n** forces an automatic rollback of the changes.  See the\n** <a href=\"/cvstrac/wiki?p=CorruptionFollowingBusyError\">\n** CorruptionFollowingBusyError</a> wiki page for a discussion of why\n** this is important.\n**\n** ^(There can only be a single busy handler defined for each\n** [database connection].  Setting a new busy handler clears any\n** previously set handler.)^  ^Note that calling [sqlite3_busy_timeout()]\n** will also set or clear the busy handler.\n**\n** The busy callback should not take any actions which modify the\n** database connection that invoked the busy handler.  Any such actions\n** result in undefined behavior.\n** \n** A busy handler must not close the database connection\n** or [prepared statement] that invoked the busy handler.\n*/\nSQLITE_API int sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*);\n\n/*\n** CAPI3REF: Set A Busy Timeout\n**\n** ^This routine sets a [sqlite3_busy_handler | busy handler] that sleeps\n** for a specified amount of time when a table is locked.  ^The handler\n** will sleep multiple times until at least \"ms\" milliseconds of sleeping\n** have accumulated.  ^After at least \"ms\" milliseconds of sleeping,\n** the handler returns 0 which causes [sqlite3_step()] to return\n** [SQLITE_BUSY] or [SQLITE_IOERR_BLOCKED].\n**\n** ^Calling this routine with an argument less than or equal to zero\n** turns off all busy handlers.\n**\n** ^(There can only be a single busy handler for a particular\n** [database connection] any any given moment.  If another busy handler\n** was defined  (using [sqlite3_busy_handler()]) prior to calling\n** this routine, that other busy handler is cleared.)^\n*/\nSQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);\n\n/*\n** CAPI3REF: Convenience Routines For Running Queries\n**\n** This is a legacy interface that is preserved for backwards compatibility.\n** Use of this interface is not recommended.\n**\n** Definition: A <b>result table</b> is memory data structure created by the\n** [sqlite3_get_table()] interface.  A result table records the\n** complete query results from one or more queries.\n**\n** The table conceptually has a number of rows and columns.  But\n** these numbers are not part of the result table itself.  These\n** numbers are obtained separately.  Let N be the number of rows\n** and M be the number of columns.\n**\n** A result table is an array of pointers to zero-terminated UTF-8 strings.\n** There are (N+1)*M elements in the array.  The first M pointers point\n** to zero-terminated strings that  contain the names of the columns.\n** The remaining entries all point to query results.  NULL values result\n** in NULL pointers.  All other values are in their UTF-8 zero-terminated\n** string representation as returned by [sqlite3_column_text()].\n**\n** A result table might consist of one or more memory allocations.\n** It is not safe to pass a result table directly to [sqlite3_free()].\n** A result table should be deallocated using [sqlite3_free_table()].\n**\n** ^(As an example of the result table format, suppose a query result\n** is as follows:\n**\n** <blockquote><pre>\n**        Name        | Age\n**        -----------------------\n**        Alice       | 43\n**        Bob         | 28\n**        Cindy       | 21\n** </pre></blockquote>\n**\n** There are two column (M==2) and three rows (N==3).  Thus the\n** result table has 8 entries.  Suppose the result table is stored\n** in an array names azResult.  Then azResult holds this content:\n**\n** <blockquote><pre>\n**        azResult&#91;0] = \"Name\";\n**        azResult&#91;1] = \"Age\";\n**        azResult&#91;2] = \"Alice\";\n**        azResult&#91;3] = \"43\";\n**        azResult&#91;4] = \"Bob\";\n**        azResult&#91;5] = \"28\";\n**        azResult&#91;6] = \"Cindy\";\n**        azResult&#91;7] = \"21\";\n** </pre></blockquote>)^\n**\n** ^The sqlite3_get_table() function evaluates one or more\n** semicolon-separated SQL statements in the zero-terminated UTF-8\n** string of its 2nd parameter and returns a result table to the\n** pointer given in its 3rd parameter.\n**\n** After the application has finished with the result from sqlite3_get_table(),\n** it must pass the result table pointer to sqlite3_free_table() in order to\n** release the memory that was malloced.  Because of the way the\n** [sqlite3_malloc()] happens within sqlite3_get_table(), the calling\n** function must not try to call [sqlite3_free()] directly.  Only\n** [sqlite3_free_table()] is able to release the memory properly and safely.\n**\n** The sqlite3_get_table() interface is implemented as a wrapper around\n** [sqlite3_exec()].  The sqlite3_get_table() routine does not have access\n** to any internal data structures of SQLite.  It uses only the public\n** interface defined here.  As a consequence, errors that occur in the\n** wrapper layer outside of the internal [sqlite3_exec()] call are not\n** reflected in subsequent calls to [sqlite3_errcode()] or\n** [sqlite3_errmsg()].\n*/\nSQLITE_API int sqlite3_get_table(\n  sqlite3 *db,          /* An open database */\n  const char *zSql,     /* SQL to be evaluated */\n  char ***pazResult,    /* Results of the query */\n  int *pnRow,           /* Number of result rows written here */\n  int *pnColumn,        /* Number of result columns written here */\n  char **pzErrmsg       /* Error msg written here */\n);\nSQLITE_API void sqlite3_free_table(char **result);\n\n/*\n** CAPI3REF: Formatted String Printing Functions\n**\n** These routines are work-alikes of the \"printf()\" family of functions\n** from the standard C library.\n**\n** ^The sqlite3_mprintf() and sqlite3_vmprintf() routines write their\n** results into memory obtained from [sqlite3_malloc()].\n** The strings returned by these two routines should be\n** released by [sqlite3_free()].  ^Both routines return a\n** NULL pointer if [sqlite3_malloc()] is unable to allocate enough\n** memory to hold the resulting string.\n**\n** ^(The sqlite3_snprintf() routine is similar to \"snprintf()\" from\n** the standard C library.  The result is written into the\n** buffer supplied as the second parameter whose size is given by\n** the first parameter. Note that the order of the\n** first two parameters is reversed from snprintf().)^  This is an\n** historical accident that cannot be fixed without breaking\n** backwards compatibility.  ^(Note also that sqlite3_snprintf()\n** returns a pointer to its buffer instead of the number of\n** characters actually written into the buffer.)^  We admit that\n** the number of characters written would be a more useful return\n** value but we cannot change the implementation of sqlite3_snprintf()\n** now without breaking compatibility.\n**\n** ^As long as the buffer size is greater than zero, sqlite3_snprintf()\n** guarantees that the buffer is always zero-terminated.  ^The first\n** parameter \"n\" is the total size of the buffer, including space for\n** the zero terminator.  So the longest string that can be completely\n** written will be n-1 characters.\n**\n** ^The sqlite3_vsnprintf() routine is a varargs version of sqlite3_snprintf().\n**\n** These routines all implement some additional formatting\n** options that are useful for constructing SQL statements.\n** All of the usual printf() formatting options apply.  In addition, there\n** is are \"%q\", \"%Q\", and \"%z\" options.\n**\n** ^(The %q option works like %s in that it substitutes a nul-terminated\n** string from the argument list.  But %q also doubles every '\\'' character.\n** %q is designed for use inside a string literal.)^  By doubling each '\\''\n** character it escapes that character and allows it to be inserted into\n** the string.\n**\n** For example, assume the string variable zText contains text as follows:\n**\n** <blockquote><pre>\n**  char *zText = \"It's a happy day!\";\n** </pre></blockquote>\n**\n** One can use this text in an SQL statement as follows:\n**\n** <blockquote><pre>\n**  char *zSQL = sqlite3_mprintf(\"INSERT INTO table VALUES('%q')\", zText);\n**  sqlite3_exec(db, zSQL, 0, 0, 0);\n**  sqlite3_free(zSQL);\n** </pre></blockquote>\n**\n** Because the %q format string is used, the '\\'' character in zText\n** is escaped and the SQL generated is as follows:\n**\n** <blockquote><pre>\n**  INSERT INTO table1 VALUES('It''s a happy day!')\n** </pre></blockquote>\n**\n** This is correct.  Had we used %s instead of %q, the generated SQL\n** would have looked like this:\n**\n** <blockquote><pre>\n**  INSERT INTO table1 VALUES('It's a happy day!');\n** </pre></blockquote>\n**\n** This second example is an SQL syntax error.  As a general rule you should\n** always use %q instead of %s when inserting text into a string literal.\n**\n** ^(The %Q option works like %q except it also adds single quotes around\n** the outside of the total string.  Additionally, if the parameter in the\n** argument list is a NULL pointer, %Q substitutes the text \"NULL\" (without\n** single quotes).)^  So, for example, one could say:\n**\n** <blockquote><pre>\n**  char *zSQL = sqlite3_mprintf(\"INSERT INTO table VALUES(%Q)\", zText);\n**  sqlite3_exec(db, zSQL, 0, 0, 0);\n**  sqlite3_free(zSQL);\n** </pre></blockquote>\n**\n** The code above will render a correct SQL statement in the zSQL\n** variable even if the zText variable is a NULL pointer.\n**\n** ^(The \"%z\" formatting option works like \"%s\" but with the\n** addition that after the string has been read and copied into\n** the result, [sqlite3_free()] is called on the input string.)^\n*/\nSQLITE_API char *sqlite3_mprintf(const char*,...);\nSQLITE_API char *sqlite3_vmprintf(const char*, va_list);\nSQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...);\nSQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);\n\n/*\n** CAPI3REF: Memory Allocation Subsystem\n**\n** The SQLite core uses these three routines for all of its own\n** internal memory allocation needs. \"Core\" in the previous sentence\n** does not include operating-system specific VFS implementation.  The\n** Windows VFS uses native malloc() and free() for some operations.\n**\n** ^The sqlite3_malloc() routine returns a pointer to a block\n** of memory at least N bytes in length, where N is the parameter.\n** ^If sqlite3_malloc() is unable to obtain sufficient free\n** memory, it returns a NULL pointer.  ^If the parameter N to\n** sqlite3_malloc() is zero or negative then sqlite3_malloc() returns\n** a NULL pointer.\n**\n** ^Calling sqlite3_free() with a pointer previously returned\n** by sqlite3_malloc() or sqlite3_realloc() releases that memory so\n** that it might be reused.  ^The sqlite3_free() routine is\n** a no-op if is called with a NULL pointer.  Passing a NULL pointer\n** to sqlite3_free() is harmless.  After being freed, memory\n** should neither be read nor written.  Even reading previously freed\n** memory might result in a segmentation fault or other severe error.\n** Memory corruption, a segmentation fault, or other severe error\n** might result if sqlite3_free() is called with a non-NULL pointer that\n** was not obtained from sqlite3_malloc() or sqlite3_realloc().\n**\n** ^(The sqlite3_realloc() interface attempts to resize a\n** prior memory allocation to be at least N bytes, where N is the\n** second parameter.  The memory allocation to be resized is the first\n** parameter.)^ ^ If the first parameter to sqlite3_realloc()\n** is a NULL pointer then its behavior is identical to calling\n** sqlite3_malloc(N) where N is the second parameter to sqlite3_realloc().\n** ^If the second parameter to sqlite3_realloc() is zero or\n** negative then the behavior is exactly the same as calling\n** sqlite3_free(P) where P is the first parameter to sqlite3_realloc().\n** ^sqlite3_realloc() returns a pointer to a memory allocation\n** of at least N bytes in size or NULL if sufficient memory is unavailable.\n** ^If M is the size of the prior allocation, then min(N,M) bytes\n** of the prior allocation are copied into the beginning of buffer returned\n** by sqlite3_realloc() and the prior allocation is freed.\n** ^If sqlite3_realloc() returns NULL, then the prior allocation\n** is not freed.\n**\n** ^The memory returned by sqlite3_malloc() and sqlite3_realloc()\n** is always aligned to at least an 8 byte boundary, or to a\n** 4 byte boundary if the [SQLITE_4_BYTE_ALIGNED_MALLOC] compile-time\n** option is used.\n**\n** In SQLite version 3.5.0 and 3.5.1, it was possible to define\n** the SQLITE_OMIT_MEMORY_ALLOCATION which would cause the built-in\n** implementation of these routines to be omitted.  That capability\n** is no longer provided.  Only built-in memory allocators can be used.\n**\n** Prior to SQLite version 3.7.10, the Windows OS interface layer called\n** the system malloc() and free() directly when converting\n** filenames between the UTF-8 encoding used by SQLite\n** and whatever filename encoding is used by the particular Windows\n** installation.  Memory allocation errors were detected, but\n** they were reported back as [SQLITE_CANTOPEN] or\n** [SQLITE_IOERR] rather than [SQLITE_NOMEM].\n**\n** The pointer arguments to [sqlite3_free()] and [sqlite3_realloc()]\n** must be either NULL or else pointers obtained from a prior\n** invocation of [sqlite3_malloc()] or [sqlite3_realloc()] that have\n** not yet been released.\n**\n** The application must not read or write any part of\n** a block of memory after it has been released using\n** [sqlite3_free()] or [sqlite3_realloc()].\n*/\nSQLITE_API void *sqlite3_malloc(int);\nSQLITE_API void *sqlite3_realloc(void*, int);\nSQLITE_API void sqlite3_free(void*);\n\n/*\n** CAPI3REF: Memory Allocator Statistics\n**\n** SQLite provides these two interfaces for reporting on the status\n** of the [sqlite3_malloc()], [sqlite3_free()], and [sqlite3_realloc()]\n** routines, which form the built-in memory allocation subsystem.\n**\n** ^The [sqlite3_memory_used()] routine returns the number of bytes\n** of memory currently outstanding (malloced but not freed).\n** ^The [sqlite3_memory_highwater()] routine returns the maximum\n** value of [sqlite3_memory_used()] since the high-water mark\n** was last reset.  ^The values returned by [sqlite3_memory_used()] and\n** [sqlite3_memory_highwater()] include any overhead\n** added by SQLite in its implementation of [sqlite3_malloc()],\n** but not overhead added by the any underlying system library\n** routines that [sqlite3_malloc()] may call.\n**\n** ^The memory high-water mark is reset to the current value of\n** [sqlite3_memory_used()] if and only if the parameter to\n** [sqlite3_memory_highwater()] is true.  ^The value returned\n** by [sqlite3_memory_highwater(1)] is the high-water mark\n** prior to the reset.\n*/\nSQLITE_API sqlite3_int64 sqlite3_memory_used(void);\nSQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag);\n\n/*\n** CAPI3REF: Pseudo-Random Number Generator\n**\n** SQLite contains a high-quality pseudo-random number generator (PRNG) used to\n** select random [ROWID | ROWIDs] when inserting new records into a table that\n** already uses the largest possible [ROWID].  The PRNG is also used for\n** the build-in random() and randomblob() SQL functions.  This interface allows\n** applications to access the same PRNG for other purposes.\n**\n** ^A call to this routine stores N bytes of randomness into buffer P.\n**\n** ^The first time this routine is invoked (either internally or by\n** the application) the PRNG is seeded using randomness obtained\n** from the xRandomness method of the default [sqlite3_vfs] object.\n** ^On all subsequent invocations, the pseudo-randomness is generated\n** internally and without recourse to the [sqlite3_vfs] xRandomness\n** method.\n*/\nSQLITE_API void sqlite3_randomness(int N, void *P);\n\n/*\n** CAPI3REF: Compile-Time Authorization Callbacks\n**\n** ^This routine registers an authorizer callback with a particular\n** [database connection], supplied in the first argument.\n** ^The authorizer callback is invoked as SQL statements are being compiled\n** by [sqlite3_prepare()] or its variants [sqlite3_prepare_v2()],\n** [sqlite3_prepare16()] and [sqlite3_prepare16_v2()].  ^At various\n** points during the compilation process, as logic is being created\n** to perform various actions, the authorizer callback is invoked to\n** see if those actions are allowed.  ^The authorizer callback should\n** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the\n** specific action but allow the SQL statement to continue to be\n** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be\n** rejected with an error.  ^If the authorizer callback returns\n** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY]\n** then the [sqlite3_prepare_v2()] or equivalent call that triggered\n** the authorizer will fail with an error message.\n**\n** When the callback returns [SQLITE_OK], that means the operation\n** requested is ok.  ^When the callback returns [SQLITE_DENY], the\n** [sqlite3_prepare_v2()] or equivalent call that triggered the\n** authorizer will fail with an error message explaining that\n** access is denied. \n**\n** ^The first parameter to the authorizer callback is a copy of the third\n** parameter to the sqlite3_set_authorizer() interface. ^The second parameter\n** to the callback is an integer [SQLITE_COPY | action code] that specifies\n** the particular action to be authorized. ^The third through sixth parameters\n** to the callback are zero-terminated strings that contain additional\n** details about the action to be authorized.\n**\n** ^If the action code is [SQLITE_READ]\n** and the callback returns [SQLITE_IGNORE] then the\n** [prepared statement] statement is constructed to substitute\n** a NULL value in place of the table column that would have\n** been read if [SQLITE_OK] had been returned.  The [SQLITE_IGNORE]\n** return can be used to deny an untrusted user access to individual\n** columns of a table.\n** ^If the action code is [SQLITE_DELETE] and the callback returns\n** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the\n** [truncate optimization] is disabled and all rows are deleted individually.\n**\n** An authorizer is used when [sqlite3_prepare | preparing]\n** SQL statements from an untrusted source, to ensure that the SQL statements\n** do not try to access data they are not allowed to see, or that they do not\n** try to execute malicious statements that damage the database.  For\n** example, an application may allow a user to enter arbitrary\n** SQL queries for evaluation by a database.  But the application does\n** not want the user to be able to make arbitrary changes to the\n** database.  An authorizer could then be put in place while the\n** user-entered SQL is being [sqlite3_prepare | prepared] that\n** disallows everything except [SELECT] statements.\n**\n** Applications that need to process SQL from untrusted sources\n** might also consider lowering resource limits using [sqlite3_limit()]\n** and limiting database size using the [max_page_count] [PRAGMA]\n** in addition to using an authorizer.\n**\n** ^(Only a single authorizer can be in place on a database connection\n** at a time.  Each call to sqlite3_set_authorizer overrides the\n** previous call.)^  ^Disable the authorizer by installing a NULL callback.\n** The authorizer is disabled by default.\n**\n** The authorizer callback must not do anything that will modify\n** the database connection that invoked the authorizer callback.\n** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their\n** database connections for the meaning of \"modify\" in this paragraph.\n**\n** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the\n** statement might be re-prepared during [sqlite3_step()] due to a \n** schema change.  Hence, the application should ensure that the\n** correct authorizer callback remains in place during the [sqlite3_step()].\n**\n** ^Note that the authorizer callback is invoked only during\n** [sqlite3_prepare()] or its variants.  Authorization is not\n** performed during statement evaluation in [sqlite3_step()], unless\n** as stated in the previous paragraph, sqlite3_step() invokes\n** sqlite3_prepare_v2() to reprepare a statement after a schema change.\n*/\nSQLITE_API int sqlite3_set_authorizer(\n  sqlite3*,\n  int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),\n  void *pUserData\n);\n\n/*\n** CAPI3REF: Authorizer Return Codes\n**\n** The [sqlite3_set_authorizer | authorizer callback function] must\n** return either [SQLITE_OK] or one of these two constants in order\n** to signal SQLite whether or not the action is permitted.  See the\n** [sqlite3_set_authorizer | authorizer documentation] for additional\n** information.\n**\n** Note that SQLITE_IGNORE is also used as a [SQLITE_ROLLBACK | return code]\n** from the [sqlite3_vtab_on_conflict()] interface.\n*/\n#define SQLITE_DENY   1   /* Abort the SQL statement with an error */\n#define SQLITE_IGNORE 2   /* Don't allow access, but don't generate an error */\n\n/*\n** CAPI3REF: Authorizer Action Codes\n**\n** The [sqlite3_set_authorizer()] interface registers a callback function\n** that is invoked to authorize certain SQL statement actions.  The\n** second parameter to the callback is an integer code that specifies\n** what action is being authorized.  These are the integer action codes that\n** the authorizer callback may be passed.\n**\n** These action code values signify what kind of operation is to be\n** authorized.  The 3rd and 4th parameters to the authorization\n** callback function will be parameters or NULL depending on which of these\n** codes is used as the second parameter.  ^(The 5th parameter to the\n** authorizer callback is the name of the database (\"main\", \"temp\",\n** etc.) if applicable.)^  ^The 6th parameter to the authorizer callback\n** is the name of the inner-most trigger or view that is responsible for\n** the access attempt or NULL if this access attempt is directly from\n** top-level SQL code.\n*/\n/******************************************* 3rd ************ 4th ***********/\n#define SQLITE_CREATE_INDEX          1   /* Index Name      Table Name      */\n#define SQLITE_CREATE_TABLE          2   /* Table Name      NULL            */\n#define SQLITE_CREATE_TEMP_INDEX     3   /* Index Name      Table Name      */\n#define SQLITE_CREATE_TEMP_TABLE     4   /* Table Name      NULL            */\n#define SQLITE_CREATE_TEMP_TRIGGER   5   /* Trigger Name    Table Name      */\n#define SQLITE_CREATE_TEMP_VIEW      6   /* View Name       NULL            */\n#define SQLITE_CREATE_TRIGGER        7   /* Trigger Name    Table Name      */\n#define SQLITE_CREATE_VIEW           8   /* View Name       NULL            */\n#define SQLITE_DELETE                9   /* Table Name      NULL            */\n#define SQLITE_DROP_INDEX           10   /* Index Name      Table Name      */\n#define SQLITE_DROP_TABLE           11   /* Table Name      NULL            */\n#define SQLITE_DROP_TEMP_INDEX      12   /* Index Name      Table Name      */\n#define SQLITE_DROP_TEMP_TABLE      13   /* Table Name      NULL            */\n#define SQLITE_DROP_TEMP_TRIGGER    14   /* Trigger Name    Table Name      */\n#define SQLITE_DROP_TEMP_VIEW       15   /* View Name       NULL            */\n#define SQLITE_DROP_TRIGGER         16   /* Trigger Name    Table Name      */\n#define SQLITE_DROP_VIEW            17   /* View Name       NULL            */\n#define SQLITE_INSERT               18   /* Table Name      NULL            */\n#define SQLITE_PRAGMA               19   /* Pragma Name     1st arg or NULL */\n#define SQLITE_READ                 20   /* Table Name      Column Name     */\n#define SQLITE_SELECT               21   /* NULL            NULL            */\n#define SQLITE_TRANSACTION          22   /* Operation       NULL            */\n#define SQLITE_UPDATE               23   /* Table Name      Column Name     */\n#define SQLITE_ATTACH               24   /* Filename        NULL            */\n#define SQLITE_DETACH               25   /* Database Name   NULL            */\n#define SQLITE_ALTER_TABLE          26   /* Database Name   Table Name      */\n#define SQLITE_REINDEX              27   /* Index Name      NULL            */\n#define SQLITE_ANALYZE              28   /* Table Name      NULL            */\n#define SQLITE_CREATE_VTABLE        29   /* Table Name      Module Name     */\n#define SQLITE_DROP_VTABLE          30   /* Table Name      Module Name     */\n#define SQLITE_FUNCTION             31   /* NULL            Function Name   */\n#define SQLITE_SAVEPOINT            32   /* Operation       Savepoint Name  */\n#define SQLITE_COPY                  0   /* No longer used */\n\n/*\n** CAPI3REF: Tracing And Profiling Functions\n**\n** These routines register callback functions that can be used for\n** tracing and profiling the execution of SQL statements.\n**\n** ^The callback function registered by sqlite3_trace() is invoked at\n** various times when an SQL statement is being run by [sqlite3_step()].\n** ^The sqlite3_trace() callback is invoked with a UTF-8 rendering of the\n** SQL statement text as the statement first begins executing.\n** ^(Additional sqlite3_trace() callbacks might occur\n** as each triggered subprogram is entered.  The callbacks for triggers\n** contain a UTF-8 SQL comment that identifies the trigger.)^\n**\n** ^The callback function registered by sqlite3_profile() is invoked\n** as each SQL statement finishes.  ^The profile callback contains\n** the original statement text and an estimate of wall-clock time\n** of how long that statement took to run.  ^The profile callback\n** time is in units of nanoseconds, however the current implementation\n** is only capable of millisecond resolution so the six least significant\n** digits in the time are meaningless.  Future versions of SQLite\n** might provide greater resolution on the profiler callback.  The\n** sqlite3_profile() function is considered experimental and is\n** subject to change in future versions of SQLite.\n*/\nSQLITE_API void *sqlite3_trace(sqlite3*, void(*xTrace)(void*,const char*), void*);\nSQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_profile(sqlite3*,\n   void(*xProfile)(void*,const char*,sqlite3_uint64), void*);\n\n/*\n** CAPI3REF: Query Progress Callbacks\n**\n** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback\n** function X to be invoked periodically during long running calls to\n** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for\n** database connection D.  An example use for this\n** interface is to keep a GUI updated during a large query.\n**\n** ^The parameter P is passed through as the only parameter to the \n** callback function X.  ^The parameter N is the number of \n** [virtual machine instructions] that are evaluated between successive\n** invocations of the callback X.\n**\n** ^Only a single progress handler may be defined at one time per\n** [database connection]; setting a new progress handler cancels the\n** old one.  ^Setting parameter X to NULL disables the progress handler.\n** ^The progress handler is also disabled by setting N to a value less\n** than 1.\n**\n** ^If the progress callback returns non-zero, the operation is\n** interrupted.  This feature can be used to implement a\n** \"Cancel\" button on a GUI progress dialog box.\n**\n** The progress handler callback must not do anything that will modify\n** the database connection that invoked the progress handler.\n** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their\n** database connections for the meaning of \"modify\" in this paragraph.\n**\n*/\nSQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);\n\n/*\n** CAPI3REF: Opening A New Database Connection\n**\n** ^These routines open an SQLite database file as specified by the \n** filename argument. ^The filename argument is interpreted as UTF-8 for\n** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte\n** order for sqlite3_open16(). ^(A [database connection] handle is usually\n** returned in *ppDb, even if an error occurs.  The only exception is that\n** if SQLite is unable to allocate memory to hold the [sqlite3] object,\n** a NULL will be written into *ppDb instead of a pointer to the [sqlite3]\n** object.)^ ^(If the database is opened (and/or created) successfully, then\n** [SQLITE_OK] is returned.  Otherwise an [error code] is returned.)^ ^The\n** [sqlite3_errmsg()] or [sqlite3_errmsg16()] routines can be used to obtain\n** an English language description of the error following a failure of any\n** of the sqlite3_open() routines.\n**\n** ^The default encoding for the database will be UTF-8 if\n** sqlite3_open() or sqlite3_open_v2() is called and\n** UTF-16 in the native byte order if sqlite3_open16() is used.\n**\n** Whether or not an error occurs when it is opened, resources\n** associated with the [database connection] handle should be released by\n** passing it to [sqlite3_close()] when it is no longer required.\n**\n** The sqlite3_open_v2() interface works like sqlite3_open()\n** except that it accepts two additional parameters for additional control\n** over the new database connection.  ^(The flags parameter to\n** sqlite3_open_v2() can take one of\n** the following three values, optionally combined with the \n** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE],\n** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^\n**\n** <dl>\n** ^(<dt>[SQLITE_OPEN_READONLY]</dt>\n** <dd>The database is opened in read-only mode.  If the database does not\n** already exist, an error is returned.</dd>)^\n**\n** ^(<dt>[SQLITE_OPEN_READWRITE]</dt>\n** <dd>The database is opened for reading and writing if possible, or reading\n** only if the file is write protected by the operating system.  In either\n** case the database must already exist, otherwise an error is returned.</dd>)^\n**\n** ^(<dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt>\n** <dd>The database is opened for reading and writing, and is created if\n** it does not already exist. This is the behavior that is always used for\n** sqlite3_open() and sqlite3_open16().</dd>)^\n** </dl>\n**\n** If the 3rd parameter to sqlite3_open_v2() is not one of the\n** combinations shown above optionally combined with other\n** [SQLITE_OPEN_READONLY | SQLITE_OPEN_* bits]\n** then the behavior is undefined.\n**\n** ^If the [SQLITE_OPEN_NOMUTEX] flag is set, then the database connection\n** opens in the multi-thread [threading mode] as long as the single-thread\n** mode has not been set at compile-time or start-time.  ^If the\n** [SQLITE_OPEN_FULLMUTEX] flag is set then the database connection opens\n** in the serialized [threading mode] unless single-thread was\n** previously selected at compile-time or start-time.\n** ^The [SQLITE_OPEN_SHAREDCACHE] flag causes the database connection to be\n** eligible to use [shared cache mode], regardless of whether or not shared\n** cache is enabled using [sqlite3_enable_shared_cache()].  ^The\n** [SQLITE_OPEN_PRIVATECACHE] flag causes the database connection to not\n** participate in [shared cache mode] even if it is enabled.\n**\n** ^The fourth parameter to sqlite3_open_v2() is the name of the\n** [sqlite3_vfs] object that defines the operating system interface that\n** the new database connection should use.  ^If the fourth parameter is\n** a NULL pointer then the default [sqlite3_vfs] object is used.\n**\n** ^If the filename is \":memory:\", then a private, temporary in-memory database\n** is created for the connection.  ^This in-memory database will vanish when\n** the database connection is closed.  Future versions of SQLite might\n** make use of additional special filenames that begin with the \":\" character.\n** It is recommended that when a database filename actually does begin with\n** a \":\" character you should prefix the filename with a pathname such as\n** \"./\" to avoid ambiguity.\n**\n** ^If the filename is an empty string, then a private, temporary\n** on-disk database will be created.  ^This private database will be\n** automatically deleted as soon as the database connection is closed.\n**\n** [[URI filenames in sqlite3_open()]] <h3>URI Filenames</h3>\n**\n** ^If [URI filename] interpretation is enabled, and the filename argument\n** begins with \"file:\", then the filename is interpreted as a URI. ^URI\n** filename interpretation is enabled if the [SQLITE_OPEN_URI] flag is\n** set in the fourth argument to sqlite3_open_v2(), or if it has\n** been enabled globally using the [SQLITE_CONFIG_URI] option with the\n** [sqlite3_config()] method or by the [SQLITE_USE_URI] compile-time option.\n** As of SQLite version 3.7.7, URI filename interpretation is turned off\n** by default, but future releases of SQLite might enable URI filename\n** interpretation by default.  See \"[URI filenames]\" for additional\n** information.\n**\n** URI filenames are parsed according to RFC 3986. ^If the URI contains an\n** authority, then it must be either an empty string or the string \n** \"localhost\". ^If the authority is not an empty string or \"localhost\", an \n** error is returned to the caller. ^The fragment component of a URI, if \n** present, is ignored.\n**\n** ^SQLite uses the path component of the URI as the name of the disk file\n** which contains the database. ^If the path begins with a '/' character, \n** then it is interpreted as an absolute path. ^If the path does not begin \n** with a '/' (meaning that the authority section is omitted from the URI)\n** then the path is interpreted as a relative path. \n** ^On windows, the first component of an absolute path \n** is a drive specification (e.g. \"C:\").\n**\n** [[core URI query parameters]]\n** The query component of a URI may contain parameters that are interpreted\n** either by SQLite itself, or by a [VFS | custom VFS implementation].\n** SQLite interprets the following three query parameters:\n**\n** <ul>\n**   <li> <b>vfs</b>: ^The \"vfs\" parameter may be used to specify the name of\n**     a VFS object that provides the operating system interface that should\n**     be used to access the database file on disk. ^If this option is set to\n**     an empty string the default VFS object is used. ^Specifying an unknown\n**     VFS is an error. ^If sqlite3_open_v2() is used and the vfs option is\n**     present, then the VFS specified by the option takes precedence over\n**     the value passed as the fourth parameter to sqlite3_open_v2().\n**\n**   <li> <b>mode</b>: ^(The mode parameter may be set to either \"ro\", \"rw\",\n**     \"rwc\", or \"memory\". Attempting to set it to any other value is\n**     an error)^. \n**     ^If \"ro\" is specified, then the database is opened for read-only \n**     access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the \n**     third argument to sqlite3_open_v2(). ^If the mode option is set to \n**     \"rw\", then the database is opened for read-write (but not create) \n**     access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had \n**     been set. ^Value \"rwc\" is equivalent to setting both \n**     SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE.  ^If the mode option is\n**     set to \"memory\" then a pure [in-memory database] that never reads\n**     or writes from disk is used. ^It is an error to specify a value for\n**     the mode parameter that is less restrictive than that specified by\n**     the flags passed in the third parameter to sqlite3_open_v2().\n**\n**   <li> <b>cache</b>: ^The cache parameter may be set to either \"shared\" or\n**     \"private\". ^Setting it to \"shared\" is equivalent to setting the\n**     SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to\n**     sqlite3_open_v2(). ^Setting the cache parameter to \"private\" is \n**     equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.\n**     ^If sqlite3_open_v2() is used and the \"cache\" parameter is present in\n**     a URI filename, its value overrides any behaviour requested by setting\n**     SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.\n** </ul>\n**\n** ^Specifying an unknown parameter in the query component of a URI is not an\n** error.  Future versions of SQLite might understand additional query\n** parameters.  See \"[query parameters with special meaning to SQLite]\" for\n** additional information.\n**\n** [[URI filename examples]] <h3>URI filename examples</h3>\n**\n** <table border=\"1\" align=center cellpadding=5>\n** <tr><th> URI filenames <th> Results\n** <tr><td> file:data.db <td> \n**          Open the file \"data.db\" in the current directory.\n** <tr><td> file:/home/fred/data.db<br>\n**          file:///home/fred/data.db <br> \n**          file://localhost/home/fred/data.db <br> <td> \n**          Open the database file \"/home/fred/data.db\".\n** <tr><td> file://darkstar/home/fred/data.db <td> \n**          An error. \"darkstar\" is not a recognized authority.\n** <tr><td style=\"white-space:nowrap\"> \n**          file:///C:/Documents%20and%20Settings/fred/Desktop/data.db\n**     <td> Windows only: Open the file \"data.db\" on fred's desktop on drive\n**          C:. Note that the %20 escaping in this example is not strictly \n**          necessary - space characters can be used literally\n**          in URI filenames.\n** <tr><td> file:data.db?mode=ro&cache=private <td> \n**          Open file \"data.db\" in the current directory for read-only access.\n**          Regardless of whether or not shared-cache mode is enabled by\n**          default, use a private cache.\n** <tr><td> file:/home/fred/data.db?vfs=unix-nolock <td>\n**          Open file \"/home/fred/data.db\". Use the special VFS \"unix-nolock\".\n** <tr><td> file:data.db?mode=readonly <td> \n**          An error. \"readonly\" is not a valid option for the \"mode\" parameter.\n** </table>\n**\n** ^URI hexadecimal escape sequences (%HH) are supported within the path and\n** query components of a URI. A hexadecimal escape sequence consists of a\n** percent sign - \"%\" - followed by exactly two hexadecimal digits \n** specifying an octet value. ^Before the path or query components of a\n** URI filename are interpreted, they are encoded using UTF-8 and all \n** hexadecimal escape sequences replaced by a single byte containing the\n** corresponding octet. If this process generates an invalid UTF-8 encoding,\n** the results are undefined.\n**\n** <b>Note to Windows users:</b>  The encoding used for the filename argument\n** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever\n** codepage is currently defined.  Filenames containing international\n** characters must be converted to UTF-8 prior to passing them into\n** sqlite3_open() or sqlite3_open_v2().\n**\n** <b>Note to Windows Runtime users:</b>  The temporary directory must be set\n** prior to calling sqlite3_open() or sqlite3_open_v2().  Otherwise, various\n** features that require the use of temporary files may fail.\n**\n** See also: [sqlite3_temp_directory]\n*/\nSQLITE_API int sqlite3_open(\n  const char *filename,   /* Database filename (UTF-8) */\n  sqlite3 **ppDb          /* OUT: SQLite db handle */\n);\nSQLITE_API int sqlite3_open16(\n  const void *filename,   /* Database filename (UTF-16) */\n  sqlite3 **ppDb          /* OUT: SQLite db handle */\n);\nSQLITE_API int sqlite3_open_v2(\n  const char *filename,   /* Database filename (UTF-8) */\n  sqlite3 **ppDb,         /* OUT: SQLite db handle */\n  int flags,              /* Flags */\n  const char *zVfs        /* Name of VFS module to use */\n);\n\n/*\n** CAPI3REF: Obtain Values For URI Parameters\n**\n** These are utility routines, useful to VFS implementations, that check\n** to see if a database file was a URI that contained a specific query \n** parameter, and if so obtains the value of that query parameter.\n**\n** If F is the database filename pointer passed into the xOpen() method of \n** a VFS implementation when the flags parameter to xOpen() has one or \n** more of the [SQLITE_OPEN_URI] or [SQLITE_OPEN_MAIN_DB] bits set and\n** P is the name of the query parameter, then\n** sqlite3_uri_parameter(F,P) returns the value of the P\n** parameter if it exists or a NULL pointer if P does not appear as a \n** query parameter on F.  If P is a query parameter of F\n** has no explicit value, then sqlite3_uri_parameter(F,P) returns\n** a pointer to an empty string.\n**\n** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean\n** parameter and returns true (1) or false (0) according to the value\n** of P.  The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the\n** value of query parameter P is one of \"yes\", \"true\", or \"on\" in any\n** case or if the value begins with a non-zero number.  The \n** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of\n** query parameter P is one of \"no\", \"false\", or \"off\" in any case or\n** if the value begins with a numeric zero.  If P is not a query\n** parameter on F or if the value of P is does not match any of the\n** above, then sqlite3_uri_boolean(F,P,B) returns (B!=0).\n**\n** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a\n** 64-bit signed integer and returns that integer, or D if P does not\n** exist.  If the value of P is something other than an integer, then\n** zero is returned.\n** \n** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and\n** sqlite3_uri_boolean(F,P,B) returns B.  If F is not a NULL pointer and\n** is not a database file pathname pointer that SQLite passed into the xOpen\n** VFS method, then the behavior of this routine is undefined and probably\n** undesirable.\n*/\nSQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);\nSQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);\nSQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);\n\n\n/*\n** CAPI3REF: Error Codes And Messages\n**\n** ^The sqlite3_errcode() interface returns the numeric [result code] or\n** [extended result code] for the most recent failed sqlite3_* API call\n** associated with a [database connection]. If a prior API call failed\n** but the most recent API call succeeded, the return value from\n** sqlite3_errcode() is undefined.  ^The sqlite3_extended_errcode()\n** interface is the same except that it always returns the \n** [extended result code] even when extended result codes are\n** disabled.\n**\n** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language\n** text that describes the error, as either UTF-8 or UTF-16 respectively.\n** ^(Memory to hold the error message string is managed internally.\n** The application does not need to worry about freeing the result.\n** However, the error string might be overwritten or deallocated by\n** subsequent calls to other SQLite interface functions.)^\n**\n** ^The sqlite3_errstr() interface returns the English-language text\n** that describes the [result code], as UTF-8.\n** ^(Memory to hold the error message string is managed internally\n** and must not be freed by the application)^.\n**\n** When the serialized [threading mode] is in use, it might be the\n** case that a second error occurs on a separate thread in between\n** the time of the first error and the call to these interfaces.\n** When that happens, the second error will be reported since these\n** interfaces always report the most recent result.  To avoid\n** this, each thread can obtain exclusive use of the [database connection] D\n** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning\n** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after\n** all calls to the interfaces listed here are completed.\n**\n** If an interface fails with SQLITE_MISUSE, that means the interface\n** was invoked incorrectly by the application.  In that case, the\n** error code and message may or may not be set.\n*/\nSQLITE_API int sqlite3_errcode(sqlite3 *db);\nSQLITE_API int sqlite3_extended_errcode(sqlite3 *db);\nSQLITE_API const char *sqlite3_errmsg(sqlite3*);\nSQLITE_API const void *sqlite3_errmsg16(sqlite3*);\nSQLITE_API const char *sqlite3_errstr(int);\n\n/*\n** CAPI3REF: SQL Statement Object\n** KEYWORDS: {prepared statement} {prepared statements}\n**\n** An instance of this object represents a single SQL statement.\n** This object is variously known as a \"prepared statement\" or a\n** \"compiled SQL statement\" or simply as a \"statement\".\n**\n** The life of a statement object goes something like this:\n**\n** <ol>\n** <li> Create the object using [sqlite3_prepare_v2()] or a related\n**      function.\n** <li> Bind values to [host parameters] using the sqlite3_bind_*()\n**      interfaces.\n** <li> Run the SQL by calling [sqlite3_step()] one or more times.\n** <li> Reset the statement using [sqlite3_reset()] then go back\n**      to step 2.  Do this zero or more times.\n** <li> Destroy the object using [sqlite3_finalize()].\n** </ol>\n**\n** Refer to documentation on individual methods above for additional\n** information.\n*/\ntypedef struct sqlite3_stmt sqlite3_stmt;\n\n/*\n** CAPI3REF: Run-time Limits\n**\n** ^(This interface allows the size of various constructs to be limited\n** on a connection by connection basis.  The first parameter is the\n** [database connection] whose limit is to be set or queried.  The\n** second parameter is one of the [limit categories] that define a\n** class of constructs to be size limited.  The third parameter is the\n** new limit for that construct.)^\n**\n** ^If the new limit is a negative number, the limit is unchanged.\n** ^(For each limit category SQLITE_LIMIT_<i>NAME</i> there is a \n** [limits | hard upper bound]\n** set at compile-time by a C preprocessor macro called\n** [limits | SQLITE_MAX_<i>NAME</i>].\n** (The \"_LIMIT_\" in the name is changed to \"_MAX_\".))^\n** ^Attempts to increase a limit above its hard upper bound are\n** silently truncated to the hard upper bound.\n**\n** ^Regardless of whether or not the limit was changed, the \n** [sqlite3_limit()] interface returns the prior value of the limit.\n** ^Hence, to find the current value of a limit without changing it,\n** simply invoke this interface with the third parameter set to -1.\n**\n** Run-time limits are intended for use in applications that manage\n** both their own internal database and also databases that are controlled\n** by untrusted external sources.  An example application might be a\n** web browser that has its own databases for storing history and\n** separate databases controlled by JavaScript applications downloaded\n** off the Internet.  The internal databases can be given the\n** large, default limits.  Databases managed by external sources can\n** be given much smaller limits designed to prevent a denial of service\n** attack.  Developers might also want to use the [sqlite3_set_authorizer()]\n** interface to further control untrusted SQL.  The size of the database\n** created by an untrusted script can be contained using the\n** [max_page_count] [PRAGMA].\n**\n** New run-time limit categories may be added in future releases.\n*/\nSQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);\n\n/*\n** CAPI3REF: Run-Time Limit Categories\n** KEYWORDS: {limit category} {*limit categories}\n**\n** These constants define various performance limits\n** that can be lowered at run-time using [sqlite3_limit()].\n** The synopsis of the meanings of the various limits is shown below.\n** Additional information is available at [limits | Limits in SQLite].\n**\n** <dl>\n** [[SQLITE_LIMIT_LENGTH]] ^(<dt>SQLITE_LIMIT_LENGTH</dt>\n** <dd>The maximum size of any string or BLOB or table row, in bytes.<dd>)^\n**\n** [[SQLITE_LIMIT_SQL_LENGTH]] ^(<dt>SQLITE_LIMIT_SQL_LENGTH</dt>\n** <dd>The maximum length of an SQL statement, in bytes.</dd>)^\n**\n** [[SQLITE_LIMIT_COLUMN]] ^(<dt>SQLITE_LIMIT_COLUMN</dt>\n** <dd>The maximum number of columns in a table definition or in the\n** result set of a [SELECT] or the maximum number of columns in an index\n** or in an ORDER BY or GROUP BY clause.</dd>)^\n**\n** [[SQLITE_LIMIT_EXPR_DEPTH]] ^(<dt>SQLITE_LIMIT_EXPR_DEPTH</dt>\n** <dd>The maximum depth of the parse tree on any expression.</dd>)^\n**\n** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt>\n** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^\n**\n** [[SQLITE_LIMIT_VDBE_OP]] ^(<dt>SQLITE_LIMIT_VDBE_OP</dt>\n** <dd>The maximum number of instructions in a virtual machine program\n** used to implement an SQL statement.  This limit is not currently\n** enforced, though that might be added in some future release of\n** SQLite.</dd>)^\n**\n** [[SQLITE_LIMIT_FUNCTION_ARG]] ^(<dt>SQLITE_LIMIT_FUNCTION_ARG</dt>\n** <dd>The maximum number of arguments on a function.</dd>)^\n**\n** [[SQLITE_LIMIT_ATTACHED]] ^(<dt>SQLITE_LIMIT_ATTACHED</dt>\n** <dd>The maximum number of [ATTACH | attached databases].)^</dd>\n**\n** [[SQLITE_LIMIT_LIKE_PATTERN_LENGTH]]\n** ^(<dt>SQLITE_LIMIT_LIKE_PATTERN_LENGTH</dt>\n** <dd>The maximum length of the pattern argument to the [LIKE] or\n** [GLOB] operators.</dd>)^\n**\n** [[SQLITE_LIMIT_VARIABLE_NUMBER]]\n** ^(<dt>SQLITE_LIMIT_VARIABLE_NUMBER</dt>\n** <dd>The maximum index number of any [parameter] in an SQL statement.)^\n**\n** [[SQLITE_LIMIT_TRIGGER_DEPTH]] ^(<dt>SQLITE_LIMIT_TRIGGER_DEPTH</dt>\n** <dd>The maximum depth of recursion for triggers.</dd>)^\n** </dl>\n*/\n#define SQLITE_LIMIT_LENGTH                    0\n#define SQLITE_LIMIT_SQL_LENGTH                1\n#define SQLITE_LIMIT_COLUMN                    2\n#define SQLITE_LIMIT_EXPR_DEPTH                3\n#define SQLITE_LIMIT_COMPOUND_SELECT           4\n#define SQLITE_LIMIT_VDBE_OP                   5\n#define SQLITE_LIMIT_FUNCTION_ARG              6\n#define SQLITE_LIMIT_ATTACHED                  7\n#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH       8\n#define SQLITE_LIMIT_VARIABLE_NUMBER           9\n#define SQLITE_LIMIT_TRIGGER_DEPTH            10\n\n/*\n** CAPI3REF: Compiling An SQL Statement\n** KEYWORDS: {SQL statement compiler}\n**\n** To execute an SQL query, it must first be compiled into a byte-code\n** program using one of these routines.\n**\n** The first argument, \"db\", is a [database connection] obtained from a\n** prior successful call to [sqlite3_open()], [sqlite3_open_v2()] or\n** [sqlite3_open16()].  The database connection must not have been closed.\n**\n** The second argument, \"zSql\", is the statement to be compiled, encoded\n** as either UTF-8 or UTF-16.  The sqlite3_prepare() and sqlite3_prepare_v2()\n** interfaces use UTF-8, and sqlite3_prepare16() and sqlite3_prepare16_v2()\n** use UTF-16.\n**\n** ^If the nByte argument is less than zero, then zSql is read up to the\n** first zero terminator. ^If nByte is non-negative, then it is the maximum\n** number of  bytes read from zSql.  ^When nByte is non-negative, the\n** zSql string ends at either the first '\\000' or '\\u0000' character or\n** the nByte-th byte, whichever comes first. If the caller knows\n** that the supplied string is nul-terminated, then there is a small\n** performance advantage to be gained by passing an nByte parameter that\n** is equal to the number of bytes in the input string <i>including</i>\n** the nul-terminator bytes as this saves SQLite from having to\n** make a copy of the input string.\n**\n** ^If pzTail is not NULL then *pzTail is made to point to the first byte\n** past the end of the first SQL statement in zSql.  These routines only\n** compile the first statement in zSql, so *pzTail is left pointing to\n** what remains uncompiled.\n**\n** ^*ppStmt is left pointing to a compiled [prepared statement] that can be\n** executed using [sqlite3_step()].  ^If there is an error, *ppStmt is set\n** to NULL.  ^If the input text contains no SQL (if the input is an empty\n** string or a comment) then *ppStmt is set to NULL.\n** The calling procedure is responsible for deleting the compiled\n** SQL statement using [sqlite3_finalize()] after it has finished with it.\n** ppStmt may not be NULL.\n**\n** ^On success, the sqlite3_prepare() family of routines return [SQLITE_OK];\n** otherwise an [error code] is returned.\n**\n** The sqlite3_prepare_v2() and sqlite3_prepare16_v2() interfaces are\n** recommended for all new programs. The two older interfaces are retained\n** for backwards compatibility, but their use is discouraged.\n** ^In the \"v2\" interfaces, the prepared statement\n** that is returned (the [sqlite3_stmt] object) contains a copy of the\n** original SQL text. This causes the [sqlite3_step()] interface to\n** behave differently in three ways:\n**\n** <ol>\n** <li>\n** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it\n** always used to do, [sqlite3_step()] will automatically recompile the SQL\n** statement and try to run it again.\n** </li>\n**\n** <li>\n** ^When an error occurs, [sqlite3_step()] will return one of the detailed\n** [error codes] or [extended error codes].  ^The legacy behavior was that\n** [sqlite3_step()] would only return a generic [SQLITE_ERROR] result code\n** and the application would have to make a second call to [sqlite3_reset()]\n** in order to find the underlying cause of the problem. With the \"v2\" prepare\n** interfaces, the underlying reason for the error is returned immediately.\n** </li>\n**\n** <li>\n** ^If the specific value bound to [parameter | host parameter] in the \n** WHERE clause might influence the choice of query plan for a statement,\n** then the statement will be automatically recompiled, as if there had been \n** a schema change, on the first  [sqlite3_step()] call following any change\n** to the [sqlite3_bind_text | bindings] of that [parameter]. \n** ^The specific value of WHERE-clause [parameter] might influence the \n** choice of query plan if the parameter is the left-hand side of a [LIKE]\n** or [GLOB] operator or if the parameter is compared to an indexed column\n** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.\n** the \n** </li>\n** </ol>\n*/\nSQLITE_API int sqlite3_prepare(\n  sqlite3 *db,            /* Database handle */\n  const char *zSql,       /* SQL statement, UTF-8 encoded */\n  int nByte,              /* Maximum length of zSql in bytes. */\n  sqlite3_stmt **ppStmt,  /* OUT: Statement handle */\n  const char **pzTail     /* OUT: Pointer to unused portion of zSql */\n);\nSQLITE_API int sqlite3_prepare_v2(\n  sqlite3 *db,            /* Database handle */\n  const char *zSql,       /* SQL statement, UTF-8 encoded */\n  int nByte,              /* Maximum length of zSql in bytes. */\n  sqlite3_stmt **ppStmt,  /* OUT: Statement handle */\n  const char **pzTail     /* OUT: Pointer to unused portion of zSql */\n);\nSQLITE_API int sqlite3_prepare16(\n  sqlite3 *db,            /* Database handle */\n  const void *zSql,       /* SQL statement, UTF-16 encoded */\n  int nByte,              /* Maximum length of zSql in bytes. */\n  sqlite3_stmt **ppStmt,  /* OUT: Statement handle */\n  const void **pzTail     /* OUT: Pointer to unused portion of zSql */\n);\nSQLITE_API int sqlite3_prepare16_v2(\n  sqlite3 *db,            /* Database handle */\n  const void *zSql,       /* SQL statement, UTF-16 encoded */\n  int nByte,              /* Maximum length of zSql in bytes. */\n  sqlite3_stmt **ppStmt,  /* OUT: Statement handle */\n  const void **pzTail     /* OUT: Pointer to unused portion of zSql */\n);\n\n/*\n** CAPI3REF: Retrieving Statement SQL\n**\n** ^This interface can be used to retrieve a saved copy of the original\n** SQL text used to create a [prepared statement] if that statement was\n** compiled using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()].\n*/\nSQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);\n\n/*\n** CAPI3REF: Determine If An SQL Statement Writes The Database\n**\n** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if\n** and only if the [prepared statement] X makes no direct changes to\n** the content of the database file.\n**\n** Note that [application-defined SQL functions] or\n** [virtual tables] might change the database indirectly as a side effect.  \n** ^(For example, if an application defines a function \"eval()\" that \n** calls [sqlite3_exec()], then the following SQL statement would\n** change the database file through side-effects:\n**\n** <blockquote><pre>\n**    SELECT eval('DELETE FROM t1') FROM t2;\n** </pre></blockquote>\n**\n** But because the [SELECT] statement does not change the database file\n** directly, sqlite3_stmt_readonly() would still return true.)^\n**\n** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK],\n** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true,\n** since the statements themselves do not actually modify the database but\n** rather they control the timing of when other statements modify the \n** database.  ^The [ATTACH] and [DETACH] statements also cause\n** sqlite3_stmt_readonly() to return true since, while those statements\n** change the configuration of a database connection, they do not make \n** changes to the content of the database files on disk.\n*/\nSQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);\n\n/*\n** CAPI3REF: Determine If A Prepared Statement Has Been Reset\n**\n** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the\n** [prepared statement] S has been stepped at least once using \n** [sqlite3_step(S)] but has not run to completion and/or has not \n** been reset using [sqlite3_reset(S)].  ^The sqlite3_stmt_busy(S)\n** interface returns false if S is a NULL pointer.  If S is not a \n** NULL pointer and is not a pointer to a valid [prepared statement]\n** object, then the behavior is undefined and probably undesirable.\n**\n** This interface can be used in combination [sqlite3_next_stmt()]\n** to locate all prepared statements associated with a database \n** connection that are in need of being reset.  This can be used,\n** for example, in diagnostic routines to search for prepared \n** statements that are holding a transaction open.\n*/\nSQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);\n\n/*\n** CAPI3REF: Dynamically Typed Value Object\n** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}\n**\n** SQLite uses the sqlite3_value object to represent all values\n** that can be stored in a database table. SQLite uses dynamic typing\n** for the values it stores.  ^Values stored in sqlite3_value objects\n** can be integers, floating point values, strings, BLOBs, or NULL.\n**\n** An sqlite3_value object may be either \"protected\" or \"unprotected\".\n** Some interfaces require a protected sqlite3_value.  Other interfaces\n** will accept either a protected or an unprotected sqlite3_value.\n** Every interface that accepts sqlite3_value arguments specifies\n** whether or not it requires a protected sqlite3_value.\n**\n** The terms \"protected\" and \"unprotected\" refer to whether or not\n** a mutex is held.  An internal mutex is held for a protected\n** sqlite3_value object but no mutex is held for an unprotected\n** sqlite3_value object.  If SQLite is compiled to be single-threaded\n** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0)\n** or if SQLite is run in one of reduced mutex modes \n** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD]\n** then there is no distinction between protected and unprotected\n** sqlite3_value objects and they can be used interchangeably.  However,\n** for maximum code portability it is recommended that applications\n** still make the distinction between protected and unprotected\n** sqlite3_value objects even when not strictly required.\n**\n** ^The sqlite3_value objects that are passed as parameters into the\n** implementation of [application-defined SQL functions] are protected.\n** ^The sqlite3_value object returned by\n** [sqlite3_column_value()] is unprotected.\n** Unprotected sqlite3_value objects may only be used with\n** [sqlite3_result_value()] and [sqlite3_bind_value()].\n** The [sqlite3_value_blob | sqlite3_value_type()] family of\n** interfaces require protected sqlite3_value objects.\n*/\ntypedef struct Mem sqlite3_value;\n\n/*\n** CAPI3REF: SQL Function Context Object\n**\n** The context in which an SQL function executes is stored in an\n** sqlite3_context object.  ^A pointer to an sqlite3_context object\n** is always first parameter to [application-defined SQL functions].\n** The application-defined SQL function implementation will pass this\n** pointer through into calls to [sqlite3_result_int | sqlite3_result()],\n** [sqlite3_aggregate_context()], [sqlite3_user_data()],\n** [sqlite3_context_db_handle()], [sqlite3_get_auxdata()],\n** and/or [sqlite3_set_auxdata()].\n*/\ntypedef struct sqlite3_context sqlite3_context;\n\n/*\n** CAPI3REF: Binding Values To Prepared Statements\n** KEYWORDS: {host parameter} {host parameters} {host parameter name}\n** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding}\n**\n** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants,\n** literals may be replaced by a [parameter] that matches one of following\n** templates:\n**\n** <ul>\n** <li>  ?\n** <li>  ?NNN\n** <li>  :VVV\n** <li>  @VVV\n** <li>  $VVV\n** </ul>\n**\n** In the templates above, NNN represents an integer literal,\n** and VVV represents an alphanumeric identifier.)^  ^The values of these\n** parameters (also called \"host parameter names\" or \"SQL parameters\")\n** can be set using the sqlite3_bind_*() routines defined here.\n**\n** ^The first argument to the sqlite3_bind_*() routines is always\n** a pointer to the [sqlite3_stmt] object returned from\n** [sqlite3_prepare_v2()] or its variants.\n**\n** ^The second argument is the index of the SQL parameter to be set.\n** ^The leftmost SQL parameter has an index of 1.  ^When the same named\n** SQL parameter is used more than once, second and subsequent\n** occurrences have the same index as the first occurrence.\n** ^The index for named parameters can be looked up using the\n** [sqlite3_bind_parameter_index()] API if desired.  ^The index\n** for \"?NNN\" parameters is the value of NNN.\n** ^The NNN value must be between 1 and the [sqlite3_limit()]\n** parameter [SQLITE_LIMIT_VARIABLE_NUMBER] (default value: 999).\n**\n** ^The third argument is the value to bind to the parameter.\n**\n** ^(In those routines that have a fourth argument, its value is the\n** number of bytes in the parameter.  To be clear: the value is the\n** number of <u>bytes</u> in the value, not the number of characters.)^\n** ^If the fourth parameter to sqlite3_bind_text() or sqlite3_bind_text16()\n** is negative, then the length of the string is\n** the number of bytes up to the first zero terminator.\n** If the fourth parameter to sqlite3_bind_blob() is negative, then\n** the behavior is undefined.\n** If a non-negative fourth parameter is provided to sqlite3_bind_text()\n** or sqlite3_bind_text16() then that parameter must be the byte offset\n** where the NUL terminator would occur assuming the string were NUL\n** terminated.  If any NUL characters occur at byte offsets less than \n** the value of the fourth parameter then the resulting string value will\n** contain embedded NULs.  The result of expressions involving strings\n** with embedded NULs is undefined.\n**\n** ^The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and\n** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or\n** string after SQLite has finished with it.  ^The destructor is called\n** to dispose of the BLOB or string even if the call to sqlite3_bind_blob(),\n** sqlite3_bind_text(), or sqlite3_bind_text16() fails.  \n** ^If the fifth argument is\n** the special value [SQLITE_STATIC], then SQLite assumes that the\n** information is in static, unmanaged space and does not need to be freed.\n** ^If the fifth argument has the value [SQLITE_TRANSIENT], then\n** SQLite makes its own private copy of the data immediately, before\n** the sqlite3_bind_*() routine returns.\n**\n** ^The sqlite3_bind_zeroblob() routine binds a BLOB of length N that\n** is filled with zeroes.  ^A zeroblob uses a fixed amount of memory\n** (just an integer to hold its size) while it is being processed.\n** Zeroblobs are intended to serve as placeholders for BLOBs whose\n** content is later written using\n** [sqlite3_blob_open | incremental BLOB I/O] routines.\n** ^A negative value for the zeroblob results in a zero-length BLOB.\n**\n** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer\n** for the [prepared statement] or with a prepared statement for which\n** [sqlite3_step()] has been called more recently than [sqlite3_reset()],\n** then the call will return [SQLITE_MISUSE].  If any sqlite3_bind_()\n** routine is passed a [prepared statement] that has been finalized, the\n** result is undefined and probably harmful.\n**\n** ^Bindings are not cleared by the [sqlite3_reset()] routine.\n** ^Unbound parameters are interpreted as NULL.\n**\n** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an\n** [error code] if anything goes wrong.\n** ^[SQLITE_RANGE] is returned if the parameter\n** index is out of range.  ^[SQLITE_NOMEM] is returned if malloc() fails.\n**\n** See also: [sqlite3_bind_parameter_count()],\n** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()].\n*/\nSQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));\nSQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double);\nSQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int);\nSQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64);\nSQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int);\nSQLITE_API int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));\nSQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));\nSQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);\nSQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);\n\n/*\n** CAPI3REF: Number Of SQL Parameters\n**\n** ^This routine can be used to find the number of [SQL parameters]\n** in a [prepared statement].  SQL parameters are tokens of the\n** form \"?\", \"?NNN\", \":AAA\", \"$AAA\", or \"@AAA\" that serve as\n** placeholders for values that are [sqlite3_bind_blob | bound]\n** to the parameters at a later time.\n**\n** ^(This routine actually returns the index of the largest (rightmost)\n** parameter. For all forms except ?NNN, this will correspond to the\n** number of unique parameters.  If parameters of the ?NNN form are used,\n** there may be gaps in the list.)^\n**\n** See also: [sqlite3_bind_blob|sqlite3_bind()],\n** [sqlite3_bind_parameter_name()], and\n** [sqlite3_bind_parameter_index()].\n*/\nSQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*);\n\n/*\n** CAPI3REF: Name Of A Host Parameter\n**\n** ^The sqlite3_bind_parameter_name(P,N) interface returns\n** the name of the N-th [SQL parameter] in the [prepared statement] P.\n** ^(SQL parameters of the form \"?NNN\" or \":AAA\" or \"@AAA\" or \"$AAA\"\n** have a name which is the string \"?NNN\" or \":AAA\" or \"@AAA\" or \"$AAA\"\n** respectively.\n** In other words, the initial \":\" or \"$\" or \"@\" or \"?\"\n** is included as part of the name.)^\n** ^Parameters of the form \"?\" without a following integer have no name\n** and are referred to as \"nameless\" or \"anonymous parameters\".\n**\n** ^The first host parameter has an index of 1, not 0.\n**\n** ^If the value N is out of range or if the N-th parameter is\n** nameless, then NULL is returned.  ^The returned string is\n** always in UTF-8 encoding even if the named parameter was\n** originally specified as UTF-16 in [sqlite3_prepare16()] or\n** [sqlite3_prepare16_v2()].\n**\n** See also: [sqlite3_bind_blob|sqlite3_bind()],\n** [sqlite3_bind_parameter_count()], and\n** [sqlite3_bind_parameter_index()].\n*/\nSQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int);\n\n/*\n** CAPI3REF: Index Of A Parameter With A Given Name\n**\n** ^Return the index of an SQL parameter given its name.  ^The\n** index value returned is suitable for use as the second\n** parameter to [sqlite3_bind_blob|sqlite3_bind()].  ^A zero\n** is returned if no matching parameter is found.  ^The parameter\n** name must be given in UTF-8 even if the original statement\n** was prepared from UTF-16 text using [sqlite3_prepare16_v2()].\n**\n** See also: [sqlite3_bind_blob|sqlite3_bind()],\n** [sqlite3_bind_parameter_count()], and\n** [sqlite3_bind_parameter_index()].\n*/\nSQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName);\n\n/*\n** CAPI3REF: Reset All Bindings On A Prepared Statement\n**\n** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset\n** the [sqlite3_bind_blob | bindings] on a [prepared statement].\n** ^Use this routine to reset all host parameters to NULL.\n*/\nSQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);\n\n/*\n** CAPI3REF: Number Of Columns In A Result Set\n**\n** ^Return the number of columns in the result set returned by the\n** [prepared statement]. ^This routine returns 0 if pStmt is an SQL\n** statement that does not return data (for example an [UPDATE]).\n**\n** See also: [sqlite3_data_count()]\n*/\nSQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt);\n\n/*\n** CAPI3REF: Column Names In A Result Set\n**\n** ^These routines return the name assigned to a particular column\n** in the result set of a [SELECT] statement.  ^The sqlite3_column_name()\n** interface returns a pointer to a zero-terminated UTF-8 string\n** and sqlite3_column_name16() returns a pointer to a zero-terminated\n** UTF-16 string.  ^The first parameter is the [prepared statement]\n** that implements the [SELECT] statement. ^The second parameter is the\n** column number.  ^The leftmost column is number 0.\n**\n** ^The returned string pointer is valid until either the [prepared statement]\n** is destroyed by [sqlite3_finalize()] or until the statement is automatically\n** reprepared by the first call to [sqlite3_step()] for a particular run\n** or until the next call to\n** sqlite3_column_name() or sqlite3_column_name16() on the same column.\n**\n** ^If sqlite3_malloc() fails during the processing of either routine\n** (for example during a conversion from UTF-8 to UTF-16) then a\n** NULL pointer is returned.\n**\n** ^The name of a result column is the value of the \"AS\" clause for\n** that column, if there is an AS clause.  If there is no AS clause\n** then the name of the column is unspecified and may change from\n** one release of SQLite to the next.\n*/\nSQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N);\nSQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N);\n\n/*\n** CAPI3REF: Source Of Data In A Query Result\n**\n** ^These routines provide a means to determine the database, table, and\n** table column that is the origin of a particular result column in\n** [SELECT] statement.\n** ^The name of the database or table or column can be returned as\n** either a UTF-8 or UTF-16 string.  ^The _database_ routines return\n** the database name, the _table_ routines return the table name, and\n** the origin_ routines return the column name.\n** ^The returned string is valid until the [prepared statement] is destroyed\n** using [sqlite3_finalize()] or until the statement is automatically\n** reprepared by the first call to [sqlite3_step()] for a particular run\n** or until the same information is requested\n** again in a different encoding.\n**\n** ^The names returned are the original un-aliased names of the\n** database, table, and column.\n**\n** ^The first argument to these interfaces is a [prepared statement].\n** ^These functions return information about the Nth result column returned by\n** the statement, where N is the second function argument.\n** ^The left-most column is column 0 for these routines.\n**\n** ^If the Nth column returned by the statement is an expression or\n** subquery and is not a column value, then all of these functions return\n** NULL.  ^These routine might also return NULL if a memory allocation error\n** occurs.  ^Otherwise, they return the name of the attached database, table,\n** or column that query result column was extracted from.\n**\n** ^As with all other SQLite APIs, those whose names end with \"16\" return\n** UTF-16 encoded strings and the other functions return UTF-8.\n**\n** ^These APIs are only available if the library was compiled with the\n** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol.\n**\n** If two or more threads call one or more of these routines against the same\n** prepared statement and column at the same time then the results are\n** undefined.\n**\n** If two or more threads call one or more\n** [sqlite3_column_database_name | column metadata interfaces]\n** for the same [prepared statement] and result column\n** at the same time then the results are undefined.\n*/\nSQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int);\nSQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int);\nSQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int);\nSQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int);\nSQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int);\nSQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int);\n\n/*\n** CAPI3REF: Declared Datatype Of A Query Result\n**\n** ^(The first parameter is a [prepared statement].\n** If this statement is a [SELECT] statement and the Nth column of the\n** returned result set of that [SELECT] is a table column (not an\n** expression or subquery) then the declared type of the table\n** column is returned.)^  ^If the Nth column of the result set is an\n** expression or subquery, then a NULL pointer is returned.\n** ^The returned string is always UTF-8 encoded.\n**\n** ^(For example, given the database schema:\n**\n** CREATE TABLE t1(c1 VARIANT);\n**\n** and the following statement to be compiled:\n**\n** SELECT c1 + 1, c1 FROM t1;\n**\n** this routine would return the string \"VARIANT\" for the second result\n** column (i==1), and a NULL pointer for the first result column (i==0).)^\n**\n** ^SQLite uses dynamic run-time typing.  ^So just because a column\n** is declared to contain a particular type does not mean that the\n** data stored in that column is of the declared type.  SQLite is\n** strongly typed, but the typing is dynamic not static.  ^Type\n** is associated with individual values, not with the containers\n** used to hold those values.\n*/\nSQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int);\nSQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);\n\n/*\n** CAPI3REF: Evaluate An SQL Statement\n**\n** After a [prepared statement] has been prepared using either\n** [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] or one of the legacy\n** interfaces [sqlite3_prepare()] or [sqlite3_prepare16()], this function\n** must be called one or more times to evaluate the statement.\n**\n** The details of the behavior of the sqlite3_step() interface depend\n** on whether the statement was prepared using the newer \"v2\" interface\n** [sqlite3_prepare_v2()] and [sqlite3_prepare16_v2()] or the older legacy\n** interface [sqlite3_prepare()] and [sqlite3_prepare16()].  The use of the\n** new \"v2\" interface is recommended for new applications but the legacy\n** interface will continue to be supported.\n**\n** ^In the legacy interface, the return value will be either [SQLITE_BUSY],\n** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE].\n** ^With the \"v2\" interface, any of the other [result codes] or\n** [extended result codes] might be returned as well.\n**\n** ^[SQLITE_BUSY] means that the database engine was unable to acquire the\n** database locks it needs to do its job.  ^If the statement is a [COMMIT]\n** or occurs outside of an explicit transaction, then you can retry the\n** statement.  If the statement is not a [COMMIT] and occurs within an\n** explicit transaction then you should rollback the transaction before\n** continuing.\n**\n** ^[SQLITE_DONE] means that the statement has finished executing\n** successfully.  sqlite3_step() should not be called again on this virtual\n** machine without first calling [sqlite3_reset()] to reset the virtual\n** machine back to its initial state.\n**\n** ^If the SQL statement being executed returns any data, then [SQLITE_ROW]\n** is returned each time a new row of data is ready for processing by the\n** caller. The values may be accessed using the [column access functions].\n** sqlite3_step() is called again to retrieve the next row of data.\n**\n** ^[SQLITE_ERROR] means that a run-time error (such as a constraint\n** violation) has occurred.  sqlite3_step() should not be called again on\n** the VM. More information may be found by calling [sqlite3_errmsg()].\n** ^With the legacy interface, a more specific error code (for example,\n** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth)\n** can be obtained by calling [sqlite3_reset()] on the\n** [prepared statement].  ^In the \"v2\" interface,\n** the more specific error code is returned directly by sqlite3_step().\n**\n** [SQLITE_MISUSE] means that the this routine was called inappropriately.\n** Perhaps it was called on a [prepared statement] that has\n** already been [sqlite3_finalize | finalized] or on one that had\n** previously returned [SQLITE_ERROR] or [SQLITE_DONE].  Or it could\n** be the case that the same database connection is being used by two or\n** more threads at the same moment in time.\n**\n** For all versions of SQLite up to and including 3.6.23.1, a call to\n** [sqlite3_reset()] was required after sqlite3_step() returned anything\n** other than [SQLITE_ROW] before any subsequent invocation of\n** sqlite3_step().  Failure to reset the prepared statement using \n** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from\n** sqlite3_step().  But after version 3.6.23.1, sqlite3_step() began\n** calling [sqlite3_reset()] automatically in this circumstance rather\n** than returning [SQLITE_MISUSE].  This is not considered a compatibility\n** break because any application that ever receives an SQLITE_MISUSE error\n** is broken by definition.  The [SQLITE_OMIT_AUTORESET] compile-time option\n** can be used to restore the legacy behavior.\n**\n** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite3_step()\n** API always returns a generic error code, [SQLITE_ERROR], following any\n** error other than [SQLITE_BUSY] and [SQLITE_MISUSE].  You must call\n** [sqlite3_reset()] or [sqlite3_finalize()] in order to find one of the\n** specific [error codes] that better describes the error.\n** We admit that this is a goofy design.  The problem has been fixed\n** with the \"v2\" interface.  If you prepare all of your SQL statements\n** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead\n** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces,\n** then the more specific [error codes] are returned directly\n** by sqlite3_step().  The use of the \"v2\" interface is recommended.\n*/\nSQLITE_API int sqlite3_step(sqlite3_stmt*);\n\n/*\n** CAPI3REF: Number of columns in a result set\n**\n** ^The sqlite3_data_count(P) interface returns the number of columns in the\n** current row of the result set of [prepared statement] P.\n** ^If prepared statement P does not have results ready to return\n** (via calls to the [sqlite3_column_int | sqlite3_column_*()] of\n** interfaces) then sqlite3_data_count(P) returns 0.\n** ^The sqlite3_data_count(P) routine also returns 0 if P is a NULL pointer.\n** ^The sqlite3_data_count(P) routine returns 0 if the previous call to\n** [sqlite3_step](P) returned [SQLITE_DONE].  ^The sqlite3_data_count(P)\n** will return non-zero if previous call to [sqlite3_step](P) returned\n** [SQLITE_ROW], except in the case of the [PRAGMA incremental_vacuum]\n** where it always returns zero since each step of that multi-step\n** pragma returns 0 columns of data.\n**\n** See also: [sqlite3_column_count()]\n*/\nSQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt);\n\n/*\n** CAPI3REF: Fundamental Datatypes\n** KEYWORDS: SQLITE_TEXT\n**\n** ^(Every value in SQLite has one of five fundamental datatypes:\n**\n** <ul>\n** <li> 64-bit signed integer\n** <li> 64-bit IEEE floating point number\n** <li> string\n** <li> BLOB\n** <li> NULL\n** </ul>)^\n**\n** These constants are codes for each of those types.\n**\n** Note that the SQLITE_TEXT constant was also used in SQLite version 2\n** for a completely different meaning.  Software that links against both\n** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not\n** SQLITE_TEXT.\n*/\n#define SQLITE_INTEGER  1\n#define SQLITE_FLOAT    2\n#define SQLITE_BLOB     4\n#define SQLITE_NULL     5\n#ifdef SQLITE_TEXT\n# undef SQLITE_TEXT\n#else\n# define SQLITE_TEXT     3\n#endif\n#define SQLITE3_TEXT     3\n\n/*\n** CAPI3REF: Result Values From A Query\n** KEYWORDS: {column access functions}\n**\n** These routines form the \"result set\" interface.\n**\n** ^These routines return information about a single column of the current\n** result row of a query.  ^In every case the first argument is a pointer\n** to the [prepared statement] that is being evaluated (the [sqlite3_stmt*]\n** that was returned from [sqlite3_prepare_v2()] or one of its variants)\n** and the second argument is the index of the column for which information\n** should be returned. ^The leftmost column of the result set has the index 0.\n** ^The number of columns in the result can be determined using\n** [sqlite3_column_count()].\n**\n** If the SQL statement does not currently point to a valid row, or if the\n** column index is out of range, the result is undefined.\n** These routines may only be called when the most recent call to\n** [sqlite3_step()] has returned [SQLITE_ROW] and neither\n** [sqlite3_reset()] nor [sqlite3_finalize()] have been called subsequently.\n** If any of these routines are called after [sqlite3_reset()] or\n** [sqlite3_finalize()] or after [sqlite3_step()] has returned\n** something other than [SQLITE_ROW], the results are undefined.\n** If [sqlite3_step()] or [sqlite3_reset()] or [sqlite3_finalize()]\n** are called from a different thread while any of these routines\n** are pending, then the results are undefined.\n**\n** ^The sqlite3_column_type() routine returns the\n** [SQLITE_INTEGER | datatype code] for the initial data type\n** of the result column.  ^The returned value is one of [SQLITE_INTEGER],\n** [SQLITE_FLOAT], [SQLITE_TEXT], [SQLITE_BLOB], or [SQLITE_NULL].  The value\n** returned by sqlite3_column_type() is only meaningful if no type\n** conversions have occurred as described below.  After a type conversion,\n** the value returned by sqlite3_column_type() is undefined.  Future\n** versions of SQLite may change the behavior of sqlite3_column_type()\n** following a type conversion.\n**\n** ^If the result is a BLOB or UTF-8 string then the sqlite3_column_bytes()\n** routine returns the number of bytes in that BLOB or string.\n** ^If the result is a UTF-16 string, then sqlite3_column_bytes() converts\n** the string to UTF-8 and then returns the number of bytes.\n** ^If the result is a numeric value then sqlite3_column_bytes() uses\n** [sqlite3_snprintf()] to convert that value to a UTF-8 string and returns\n** the number of bytes in that string.\n** ^If the result is NULL, then sqlite3_column_bytes() returns zero.\n**\n** ^If the result is a BLOB or UTF-16 string then the sqlite3_column_bytes16()\n** routine returns the number of bytes in that BLOB or string.\n** ^If the result is a UTF-8 string, then sqlite3_column_bytes16() converts\n** the string to UTF-16 and then returns the number of bytes.\n** ^If the result is a numeric value then sqlite3_column_bytes16() uses\n** [sqlite3_snprintf()] to convert that value to a UTF-16 string and returns\n** the number of bytes in that string.\n** ^If the result is NULL, then sqlite3_column_bytes16() returns zero.\n**\n** ^The values returned by [sqlite3_column_bytes()] and \n** [sqlite3_column_bytes16()] do not include the zero terminators at the end\n** of the string.  ^For clarity: the values returned by\n** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of\n** bytes in the string, not the number of characters.\n**\n** ^Strings returned by sqlite3_column_text() and sqlite3_column_text16(),\n** even empty strings, are always zero-terminated.  ^The return\n** value from sqlite3_column_blob() for a zero-length BLOB is a NULL pointer.\n**\n** ^The object returned by [sqlite3_column_value()] is an\n** [unprotected sqlite3_value] object.  An unprotected sqlite3_value object\n** may only be used with [sqlite3_bind_value()] and [sqlite3_result_value()].\n** If the [unprotected sqlite3_value] object returned by\n** [sqlite3_column_value()] is used in any other way, including calls\n** to routines like [sqlite3_value_int()], [sqlite3_value_text()],\n** or [sqlite3_value_bytes()], then the behavior is undefined.\n**\n** These routines attempt to convert the value where appropriate.  ^For\n** example, if the internal representation is FLOAT and a text result\n** is requested, [sqlite3_snprintf()] is used internally to perform the\n** conversion automatically.  ^(The following table details the conversions\n** that are applied:\n**\n** <blockquote>\n** <table border=\"1\">\n** <tr><th> Internal<br>Type <th> Requested<br>Type <th>  Conversion\n**\n** <tr><td>  NULL    <td> INTEGER   <td> Result is 0\n** <tr><td>  NULL    <td>  FLOAT    <td> Result is 0.0\n** <tr><td>  NULL    <td>   TEXT    <td> Result is NULL pointer\n** <tr><td>  NULL    <td>   BLOB    <td> Result is NULL pointer\n** <tr><td> INTEGER  <td>  FLOAT    <td> Convert from integer to float\n** <tr><td> INTEGER  <td>   TEXT    <td> ASCII rendering of the integer\n** <tr><td> INTEGER  <td>   BLOB    <td> Same as INTEGER->TEXT\n** <tr><td>  FLOAT   <td> INTEGER   <td> Convert from float to integer\n** <tr><td>  FLOAT   <td>   TEXT    <td> ASCII rendering of the float\n** <tr><td>  FLOAT   <td>   BLOB    <td> Same as FLOAT->TEXT\n** <tr><td>  TEXT    <td> INTEGER   <td> Use atoi()\n** <tr><td>  TEXT    <td>  FLOAT    <td> Use atof()\n** <tr><td>  TEXT    <td>   BLOB    <td> No change\n** <tr><td>  BLOB    <td> INTEGER   <td> Convert to TEXT then use atoi()\n** <tr><td>  BLOB    <td>  FLOAT    <td> Convert to TEXT then use atof()\n** <tr><td>  BLOB    <td>   TEXT    <td> Add a zero terminator if needed\n** </table>\n** </blockquote>)^\n**\n** The table above makes reference to standard C library functions atoi()\n** and atof().  SQLite does not really use these functions.  It has its\n** own equivalent internal routines.  The atoi() and atof() names are\n** used in the table for brevity and because they are familiar to most\n** C programmers.\n**\n** Note that when type conversions occur, pointers returned by prior\n** calls to sqlite3_column_blob(), sqlite3_column_text(), and/or\n** sqlite3_column_text16() may be invalidated.\n** Type conversions and pointer invalidations might occur\n** in the following cases:\n**\n** <ul>\n** <li> The initial content is a BLOB and sqlite3_column_text() or\n**      sqlite3_column_text16() is called.  A zero-terminator might\n**      need to be added to the string.</li>\n** <li> The initial content is UTF-8 text and sqlite3_column_bytes16() or\n**      sqlite3_column_text16() is called.  The content must be converted\n**      to UTF-16.</li>\n** <li> The initial content is UTF-16 text and sqlite3_column_bytes() or\n**      sqlite3_column_text() is called.  The content must be converted\n**      to UTF-8.</li>\n** </ul>\n**\n** ^Conversions between UTF-16be and UTF-16le are always done in place and do\n** not invalidate a prior pointer, though of course the content of the buffer\n** that the prior pointer references will have been modified.  Other kinds\n** of conversion are done in place when it is possible, but sometimes they\n** are not possible and in those cases prior pointers are invalidated.\n**\n** The safest and easiest to remember policy is to invoke these routines\n** in one of the following ways:\n**\n** <ul>\n**  <li>sqlite3_column_text() followed by sqlite3_column_bytes()</li>\n**  <li>sqlite3_column_blob() followed by sqlite3_column_bytes()</li>\n**  <li>sqlite3_column_text16() followed by sqlite3_column_bytes16()</li>\n** </ul>\n**\n** In other words, you should call sqlite3_column_text(),\n** sqlite3_column_blob(), or sqlite3_column_text16() first to force the result\n** into the desired format, then invoke sqlite3_column_bytes() or\n** sqlite3_column_bytes16() to find the size of the result.  Do not mix calls\n** to sqlite3_column_text() or sqlite3_column_blob() with calls to\n** sqlite3_column_bytes16(), and do not mix calls to sqlite3_column_text16()\n** with calls to sqlite3_column_bytes().\n**\n** ^The pointers returned are valid until a type conversion occurs as\n** described above, or until [sqlite3_step()] or [sqlite3_reset()] or\n** [sqlite3_finalize()] is called.  ^The memory space used to hold strings\n** and BLOBs is freed automatically.  Do <b>not</b> pass the pointers returned\n** [sqlite3_column_blob()], [sqlite3_column_text()], etc. into\n** [sqlite3_free()].\n**\n** ^(If a memory allocation error occurs during the evaluation of any\n** of these routines, a default value is returned.  The default value\n** is either the integer 0, the floating point number 0.0, or a NULL\n** pointer.  Subsequent calls to [sqlite3_errcode()] will return\n** [SQLITE_NOMEM].)^\n*/\nSQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);\nSQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol);\nSQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol);\nSQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol);\nSQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol);\nSQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol);\nSQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);\nSQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol);\nSQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);\nSQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol);\n\n/*\n** CAPI3REF: Destroy A Prepared Statement Object\n**\n** ^The sqlite3_finalize() function is called to delete a [prepared statement].\n** ^If the most recent evaluation of the statement encountered no errors\n** or if the statement is never been evaluated, then sqlite3_finalize() returns\n** SQLITE_OK.  ^If the most recent evaluation of statement S failed, then\n** sqlite3_finalize(S) returns the appropriate [error code] or\n** [extended error code].\n**\n** ^The sqlite3_finalize(S) routine can be called at any point during\n** the life cycle of [prepared statement] S:\n** before statement S is ever evaluated, after\n** one or more calls to [sqlite3_reset()], or after any call\n** to [sqlite3_step()] regardless of whether or not the statement has\n** completed execution.\n**\n** ^Invoking sqlite3_finalize() on a NULL pointer is a harmless no-op.\n**\n** The application must finalize every [prepared statement] in order to avoid\n** resource leaks.  It is a grievous error for the application to try to use\n** a prepared statement after it has been finalized.  Any use of a prepared\n** statement after it has been finalized can result in undefined and\n** undesirable behavior such as segfaults and heap corruption.\n*/\nSQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);\n\n/*\n** CAPI3REF: Reset A Prepared Statement Object\n**\n** The sqlite3_reset() function is called to reset a [prepared statement]\n** object back to its initial state, ready to be re-executed.\n** ^Any SQL statement variables that had values bound to them using\n** the [sqlite3_bind_blob | sqlite3_bind_*() API] retain their values.\n** Use [sqlite3_clear_bindings()] to reset the bindings.\n**\n** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S\n** back to the beginning of its program.\n**\n** ^If the most recent call to [sqlite3_step(S)] for the\n** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE],\n** or if [sqlite3_step(S)] has never before been called on S,\n** then [sqlite3_reset(S)] returns [SQLITE_OK].\n**\n** ^If the most recent call to [sqlite3_step(S)] for the\n** [prepared statement] S indicated an error, then\n** [sqlite3_reset(S)] returns an appropriate [error code].\n**\n** ^The [sqlite3_reset(S)] interface does not change the values\n** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.\n*/\nSQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);\n\n/*\n** CAPI3REF: Create Or Redefine SQL Functions\n** KEYWORDS: {function creation routines}\n** KEYWORDS: {application-defined SQL function}\n** KEYWORDS: {application-defined SQL functions}\n**\n** ^These functions (collectively known as \"function creation routines\")\n** are used to add SQL functions or aggregates or to redefine the behavior\n** of existing SQL functions or aggregates.  The only differences between\n** these routines are the text encoding expected for\n** the second parameter (the name of the function being created)\n** and the presence or absence of a destructor callback for\n** the application data pointer.\n**\n** ^The first parameter is the [database connection] to which the SQL\n** function is to be added.  ^If an application uses more than one database\n** connection then application-defined SQL functions must be added\n** to each database connection separately.\n**\n** ^The second parameter is the name of the SQL function to be created or\n** redefined.  ^The length of the name is limited to 255 bytes in a UTF-8\n** representation, exclusive of the zero-terminator.  ^Note that the name\n** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes.  \n** ^Any attempt to create a function with a longer name\n** will result in [SQLITE_MISUSE] being returned.\n**\n** ^The third parameter (nArg)\n** is the number of arguments that the SQL function or\n** aggregate takes. ^If this parameter is -1, then the SQL function or\n** aggregate may take any number of arguments between 0 and the limit\n** set by [sqlite3_limit]([SQLITE_LIMIT_FUNCTION_ARG]).  If the third\n** parameter is less than -1 or greater than 127 then the behavior is\n** undefined.\n**\n** ^The fourth parameter, eTextRep, specifies what\n** [SQLITE_UTF8 | text encoding] this SQL function prefers for\n** its parameters.  Every SQL function implementation must be able to work\n** with UTF-8, UTF-16le, or UTF-16be.  But some implementations may be\n** more efficient with one encoding than another.  ^An application may\n** invoke sqlite3_create_function() or sqlite3_create_function16() multiple\n** times with the same function but with different values of eTextRep.\n** ^When multiple implementations of the same function are available, SQLite\n** will pick the one that involves the least amount of data conversion.\n** If there is only a single implementation which does not care what text\n** encoding is used, then the fourth argument should be [SQLITE_ANY].\n**\n** ^(The fifth parameter is an arbitrary pointer.  The implementation of the\n** function can gain access to this pointer using [sqlite3_user_data()].)^\n**\n** ^The sixth, seventh and eighth parameters, xFunc, xStep and xFinal, are\n** pointers to C-language functions that implement the SQL function or\n** aggregate. ^A scalar SQL function requires an implementation of the xFunc\n** callback only; NULL pointers must be passed as the xStep and xFinal\n** parameters. ^An aggregate SQL function requires an implementation of xStep\n** and xFinal and NULL pointer must be passed for xFunc. ^To delete an existing\n** SQL function or aggregate, pass NULL pointers for all three function\n** callbacks.\n**\n** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL,\n** then it is destructor for the application data pointer. \n** The destructor is invoked when the function is deleted, either by being\n** overloaded or when the database connection closes.)^\n** ^The destructor is also invoked if the call to\n** sqlite3_create_function_v2() fails.\n** ^When the destructor callback of the tenth parameter is invoked, it\n** is passed a single argument which is a copy of the application data \n** pointer which was the fifth parameter to sqlite3_create_function_v2().\n**\n** ^It is permitted to register multiple implementations of the same\n** functions with the same name but with either differing numbers of\n** arguments or differing preferred text encodings.  ^SQLite will use\n** the implementation that most closely matches the way in which the\n** SQL function is used.  ^A function implementation with a non-negative\n** nArg parameter is a better match than a function implementation with\n** a negative nArg.  ^A function where the preferred text encoding\n** matches the database encoding is a better\n** match than a function where the encoding is different.  \n** ^A function where the encoding difference is between UTF16le and UTF16be\n** is a closer match than a function where the encoding difference is\n** between UTF8 and UTF16.\n**\n** ^Built-in functions may be overloaded by new application-defined functions.\n**\n** ^An application-defined function is permitted to call other\n** SQLite interfaces.  However, such calls must not\n** close the database connection nor finalize or reset the prepared\n** statement in which the function is running.\n*/\nSQLITE_API int sqlite3_create_function(\n  sqlite3 *db,\n  const char *zFunctionName,\n  int nArg,\n  int eTextRep,\n  void *pApp,\n  void (*xFunc)(sqlite3_context*,int,sqlite3_value**),\n  void (*xStep)(sqlite3_context*,int,sqlite3_value**),\n  void (*xFinal)(sqlite3_context*)\n);\nSQLITE_API int sqlite3_create_function16(\n  sqlite3 *db,\n  const void *zFunctionName,\n  int nArg,\n  int eTextRep,\n  void *pApp,\n  void (*xFunc)(sqlite3_context*,int,sqlite3_value**),\n  void (*xStep)(sqlite3_context*,int,sqlite3_value**),\n  void (*xFinal)(sqlite3_context*)\n);\nSQLITE_API int sqlite3_create_function_v2(\n  sqlite3 *db,\n  const char *zFunctionName,\n  int nArg,\n  int eTextRep,\n  void *pApp,\n  void (*xFunc)(sqlite3_context*,int,sqlite3_value**),\n  void (*xStep)(sqlite3_context*,int,sqlite3_value**),\n  void (*xFinal)(sqlite3_context*),\n  void(*xDestroy)(void*)\n);\n\n/*\n** CAPI3REF: Text Encodings\n**\n** These constant define integer codes that represent the various\n** text encodings supported by SQLite.\n*/\n#define SQLITE_UTF8           1\n#define SQLITE_UTF16LE        2\n#define SQLITE_UTF16BE        3\n#define SQLITE_UTF16          4    /* Use native byte order */\n#define SQLITE_ANY            5    /* sqlite3_create_function only */\n#define SQLITE_UTF16_ALIGNED  8    /* sqlite3_create_collation only */\n\n/*\n** CAPI3REF: Deprecated Functions\n** DEPRECATED\n**\n** These functions are [deprecated].  In order to maintain\n** backwards compatibility with older code, these functions continue \n** to be supported.  However, new applications should avoid\n** the use of these functions.  To help encourage people to avoid\n** using these functions, we are not going to tell you what they do.\n*/\n#ifndef SQLITE_OMIT_DEPRECATED\nSQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*);\nSQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*);\nSQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);\nSQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void);\nSQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void);\nSQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),void*,sqlite3_int64);\n#endif\n\n/*\n** CAPI3REF: Obtaining SQL Function Parameter Values\n**\n** The C-language implementation of SQL functions and aggregates uses\n** this set of interface routines to access the parameter values on\n** the function or aggregate.\n**\n** The xFunc (for scalar functions) or xStep (for aggregates) parameters\n** to [sqlite3_create_function()] and [sqlite3_create_function16()]\n** define callbacks that implement the SQL functions and aggregates.\n** The 3rd parameter to these callbacks is an array of pointers to\n** [protected sqlite3_value] objects.  There is one [sqlite3_value] object for\n** each parameter to the SQL function.  These routines are used to\n** extract values from the [sqlite3_value] objects.\n**\n** These routines work only with [protected sqlite3_value] objects.\n** Any attempt to use these routines on an [unprotected sqlite3_value]\n** object results in undefined behavior.\n**\n** ^These routines work just like the corresponding [column access functions]\n** except that  these routines take a single [protected sqlite3_value] object\n** pointer instead of a [sqlite3_stmt*] pointer and an integer column number.\n**\n** ^The sqlite3_value_text16() interface extracts a UTF-16 string\n** in the native byte-order of the host machine.  ^The\n** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces\n** extract UTF-16 strings as big-endian and little-endian respectively.\n**\n** ^(The sqlite3_value_numeric_type() interface attempts to apply\n** numeric affinity to the value.  This means that an attempt is\n** made to convert the value to an integer or floating point.  If\n** such a conversion is possible without loss of information (in other\n** words, if the value is a string that looks like a number)\n** then the conversion is performed.  Otherwise no conversion occurs.\n** The [SQLITE_INTEGER | datatype] after conversion is returned.)^\n**\n** Please pay particular attention to the fact that the pointer returned\n** from [sqlite3_value_blob()], [sqlite3_value_text()], or\n** [sqlite3_value_text16()] can be invalidated by a subsequent call to\n** [sqlite3_value_bytes()], [sqlite3_value_bytes16()], [sqlite3_value_text()],\n** or [sqlite3_value_text16()].\n**\n** These routines must be called from the same thread as\n** the SQL function that supplied the [sqlite3_value*] parameters.\n*/\nSQLITE_API const void *sqlite3_value_blob(sqlite3_value*);\nSQLITE_API int sqlite3_value_bytes(sqlite3_value*);\nSQLITE_API int sqlite3_value_bytes16(sqlite3_value*);\nSQLITE_API double sqlite3_value_double(sqlite3_value*);\nSQLITE_API int sqlite3_value_int(sqlite3_value*);\nSQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*);\nSQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);\nSQLITE_API const void *sqlite3_value_text16(sqlite3_value*);\nSQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);\nSQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);\nSQLITE_API int sqlite3_value_type(sqlite3_value*);\nSQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);\n\n/*\n** CAPI3REF: Obtain Aggregate Function Context\n**\n** Implementations of aggregate SQL functions use this\n** routine to allocate memory for storing their state.\n**\n** ^The first time the sqlite3_aggregate_context(C,N) routine is called \n** for a particular aggregate function, SQLite\n** allocates N of memory, zeroes out that memory, and returns a pointer\n** to the new memory. ^On second and subsequent calls to\n** sqlite3_aggregate_context() for the same aggregate function instance,\n** the same buffer is returned.  Sqlite3_aggregate_context() is normally\n** called once for each invocation of the xStep callback and then one\n** last time when the xFinal callback is invoked.  ^(When no rows match\n** an aggregate query, the xStep() callback of the aggregate function\n** implementation is never called and xFinal() is called exactly once.\n** In those cases, sqlite3_aggregate_context() might be called for the\n** first time from within xFinal().)^\n**\n** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer if N is\n** less than or equal to zero or if a memory allocate error occurs.\n**\n** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is\n** determined by the N parameter on first successful call.  Changing the\n** value of N in subsequent call to sqlite3_aggregate_context() within\n** the same aggregate function instance will not resize the memory\n** allocation.)^\n**\n** ^SQLite automatically frees the memory allocated by \n** sqlite3_aggregate_context() when the aggregate query concludes.\n**\n** The first parameter must be a copy of the\n** [sqlite3_context | SQL function context] that is the first parameter\n** to the xStep or xFinal callback routine that implements the aggregate\n** function.\n**\n** This routine must be called from the same thread in which\n** the aggregate SQL function is running.\n*/\nSQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes);\n\n/*\n** CAPI3REF: User Data For Functions\n**\n** ^The sqlite3_user_data() interface returns a copy of\n** the pointer that was the pUserData parameter (the 5th parameter)\n** of the [sqlite3_create_function()]\n** and [sqlite3_create_function16()] routines that originally\n** registered the application defined function.\n**\n** This routine must be called from the same thread in which\n** the application-defined function is running.\n*/\nSQLITE_API void *sqlite3_user_data(sqlite3_context*);\n\n/*\n** CAPI3REF: Database Connection For Functions\n**\n** ^The sqlite3_context_db_handle() interface returns a copy of\n** the pointer to the [database connection] (the 1st parameter)\n** of the [sqlite3_create_function()]\n** and [sqlite3_create_function16()] routines that originally\n** registered the application defined function.\n*/\nSQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);\n\n/*\n** CAPI3REF: Function Auxiliary Data\n**\n** The following two functions may be used by scalar SQL functions to\n** associate metadata with argument values. If the same value is passed to\n** multiple invocations of the same SQL function during query execution, under\n** some circumstances the associated metadata may be preserved. This may\n** be used, for example, to add a regular-expression matching scalar\n** function. The compiled version of the regular expression is stored as\n** metadata associated with the SQL value passed as the regular expression\n** pattern.  The compiled regular expression can be reused on multiple\n** invocations of the same function so that the original pattern string\n** does not need to be recompiled on each invocation.\n**\n** ^The sqlite3_get_auxdata() interface returns a pointer to the metadata\n** associated by the sqlite3_set_auxdata() function with the Nth argument\n** value to the application-defined function. ^If no metadata has been ever\n** been set for the Nth argument of the function, or if the corresponding\n** function parameter has changed since the meta-data was set,\n** then sqlite3_get_auxdata() returns a NULL pointer.\n**\n** ^The sqlite3_set_auxdata() interface saves the metadata\n** pointed to by its 3rd parameter as the metadata for the N-th\n** argument of the application-defined function.  Subsequent\n** calls to sqlite3_get_auxdata() might return this data, if it has\n** not been destroyed.\n** ^If it is not NULL, SQLite will invoke the destructor\n** function given by the 4th parameter to sqlite3_set_auxdata() on\n** the metadata when the corresponding function parameter changes\n** or when the SQL statement completes, whichever comes first.\n**\n** SQLite is free to call the destructor and drop metadata on any\n** parameter of any function at any time.  ^The only guarantee is that\n** the destructor will be called before the metadata is dropped.\n**\n** ^(In practice, metadata is preserved between function calls for\n** expressions that are constant at compile time. This includes literal\n** values and [parameters].)^\n**\n** These routines must be called from the same thread in which\n** the SQL function is running.\n*/\nSQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);\nSQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));\n\n\n/*\n** CAPI3REF: Constants Defining Special Destructor Behavior\n**\n** These are special values for the destructor that is passed in as the\n** final argument to routines like [sqlite3_result_blob()].  ^If the destructor\n** argument is SQLITE_STATIC, it means that the content pointer is constant\n** and will never change.  It does not need to be destroyed.  ^The\n** SQLITE_TRANSIENT value means that the content will likely change in\n** the near future and that SQLite should make its own private copy of\n** the content before returning.\n**\n** The typedef is necessary to work around problems in certain\n** C++ compilers.  See ticket #2191.\n*/\ntypedef void (*sqlite3_destructor_type)(void*);\n#define SQLITE_STATIC      ((sqlite3_destructor_type)0)\n#define SQLITE_TRANSIENT   ((sqlite3_destructor_type)-1)\n\n/*\n** CAPI3REF: Setting The Result Of An SQL Function\n**\n** These routines are used by the xFunc or xFinal callbacks that\n** implement SQL functions and aggregates.  See\n** [sqlite3_create_function()] and [sqlite3_create_function16()]\n** for additional information.\n**\n** These functions work very much like the [parameter binding] family of\n** functions used to bind values to host parameters in prepared statements.\n** Refer to the [SQL parameter] documentation for additional information.\n**\n** ^The sqlite3_result_blob() interface sets the result from\n** an application-defined function to be the BLOB whose content is pointed\n** to by the second parameter and which is N bytes long where N is the\n** third parameter.\n**\n** ^The sqlite3_result_zeroblob() interfaces set the result of\n** the application-defined function to be a BLOB containing all zero\n** bytes and N bytes in size, where N is the value of the 2nd parameter.\n**\n** ^The sqlite3_result_double() interface sets the result from\n** an application-defined function to be a floating point value specified\n** by its 2nd argument.\n**\n** ^The sqlite3_result_error() and sqlite3_result_error16() functions\n** cause the implemented SQL function to throw an exception.\n** ^SQLite uses the string pointed to by the\n** 2nd parameter of sqlite3_result_error() or sqlite3_result_error16()\n** as the text of an error message.  ^SQLite interprets the error\n** message string from sqlite3_result_error() as UTF-8. ^SQLite\n** interprets the string from sqlite3_result_error16() as UTF-16 in native\n** byte order.  ^If the third parameter to sqlite3_result_error()\n** or sqlite3_result_error16() is negative then SQLite takes as the error\n** message all text up through the first zero character.\n** ^If the third parameter to sqlite3_result_error() or\n** sqlite3_result_error16() is non-negative then SQLite takes that many\n** bytes (not characters) from the 2nd parameter as the error message.\n** ^The sqlite3_result_error() and sqlite3_result_error16()\n** routines make a private copy of the error message text before\n** they return.  Hence, the calling function can deallocate or\n** modify the text after they return without harm.\n** ^The sqlite3_result_error_code() function changes the error code\n** returned by SQLite as a result of an error in a function.  ^By default,\n** the error code is SQLITE_ERROR.  ^A subsequent call to sqlite3_result_error()\n** or sqlite3_result_error16() resets the error code to SQLITE_ERROR.\n**\n** ^The sqlite3_result_error_toobig() interface causes SQLite to throw an\n** error indicating that a string or BLOB is too long to represent.\n**\n** ^The sqlite3_result_error_nomem() interface causes SQLite to throw an\n** error indicating that a memory allocation failed.\n**\n** ^The sqlite3_result_int() interface sets the return value\n** of the application-defined function to be the 32-bit signed integer\n** value given in the 2nd argument.\n** ^The sqlite3_result_int64() interface sets the return value\n** of the application-defined function to be the 64-bit signed integer\n** value given in the 2nd argument.\n**\n** ^The sqlite3_result_null() interface sets the return value\n** of the application-defined function to be NULL.\n**\n** ^The sqlite3_result_text(), sqlite3_result_text16(),\n** sqlite3_result_text16le(), and sqlite3_result_text16be() interfaces\n** set the return value of the application-defined function to be\n** a text string which is represented as UTF-8, UTF-16 native byte order,\n** UTF-16 little endian, or UTF-16 big endian, respectively.\n** ^SQLite takes the text result from the application from\n** the 2nd parameter of the sqlite3_result_text* interfaces.\n** ^If the 3rd parameter to the sqlite3_result_text* interfaces\n** is negative, then SQLite takes result text from the 2nd parameter\n** through the first zero character.\n** ^If the 3rd parameter to the sqlite3_result_text* interfaces\n** is non-negative, then as many bytes (not characters) of the text\n** pointed to by the 2nd parameter are taken as the application-defined\n** function result.  If the 3rd parameter is non-negative, then it\n** must be the byte offset into the string where the NUL terminator would\n** appear if the string where NUL terminated.  If any NUL characters occur\n** in the string at a byte offset that is less than the value of the 3rd\n** parameter, then the resulting string will contain embedded NULs and the\n** result of expressions operating on strings with embedded NULs is undefined.\n** ^If the 4th parameter to the sqlite3_result_text* interfaces\n** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that\n** function as the destructor on the text or BLOB result when it has\n** finished using that result.\n** ^If the 4th parameter to the sqlite3_result_text* interfaces or to\n** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite\n** assumes that the text or BLOB result is in constant space and does not\n** copy the content of the parameter nor call a destructor on the content\n** when it has finished using that result.\n** ^If the 4th parameter to the sqlite3_result_text* interfaces\n** or sqlite3_result_blob is the special constant SQLITE_TRANSIENT\n** then SQLite makes a copy of the result into space obtained from\n** from [sqlite3_malloc()] before it returns.\n**\n** ^The sqlite3_result_value() interface sets the result of\n** the application-defined function to be a copy the\n** [unprotected sqlite3_value] object specified by the 2nd parameter.  ^The\n** sqlite3_result_value() interface makes a copy of the [sqlite3_value]\n** so that the [sqlite3_value] specified in the parameter may change or\n** be deallocated after sqlite3_result_value() returns without harm.\n** ^A [protected sqlite3_value] object may always be used where an\n** [unprotected sqlite3_value] object is required, so either\n** kind of [sqlite3_value] object can be used with this interface.\n**\n** If these routines are called from within the different thread\n** than the one containing the application-defined function that received\n** the [sqlite3_context] pointer, the results are undefined.\n*/\nSQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*));\nSQLITE_API void sqlite3_result_double(sqlite3_context*, double);\nSQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int);\nSQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int);\nSQLITE_API void sqlite3_result_error_toobig(sqlite3_context*);\nSQLITE_API void sqlite3_result_error_nomem(sqlite3_context*);\nSQLITE_API void sqlite3_result_error_code(sqlite3_context*, int);\nSQLITE_API void sqlite3_result_int(sqlite3_context*, int);\nSQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64);\nSQLITE_API void sqlite3_result_null(sqlite3_context*);\nSQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*));\nSQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));\nSQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));\nSQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));\nSQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);\nSQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);\n\n/*\n** CAPI3REF: Define New Collating Sequences\n**\n** ^These functions add, remove, or modify a [collation] associated\n** with the [database connection] specified as the first argument.\n**\n** ^The name of the collation is a UTF-8 string\n** for sqlite3_create_collation() and sqlite3_create_collation_v2()\n** and a UTF-16 string in native byte order for sqlite3_create_collation16().\n** ^Collation names that compare equal according to [sqlite3_strnicmp()] are\n** considered to be the same name.\n**\n** ^(The third argument (eTextRep) must be one of the constants:\n** <ul>\n** <li> [SQLITE_UTF8],\n** <li> [SQLITE_UTF16LE],\n** <li> [SQLITE_UTF16BE],\n** <li> [SQLITE_UTF16], or\n** <li> [SQLITE_UTF16_ALIGNED].\n** </ul>)^\n** ^The eTextRep argument determines the encoding of strings passed\n** to the collating function callback, xCallback.\n** ^The [SQLITE_UTF16] and [SQLITE_UTF16_ALIGNED] values for eTextRep\n** force strings to be UTF16 with native byte order.\n** ^The [SQLITE_UTF16_ALIGNED] value for eTextRep forces strings to begin\n** on an even byte address.\n**\n** ^The fourth argument, pArg, is an application data pointer that is passed\n** through as the first argument to the collating function callback.\n**\n** ^The fifth argument, xCallback, is a pointer to the collating function.\n** ^Multiple collating functions can be registered using the same name but\n** with different eTextRep parameters and SQLite will use whichever\n** function requires the least amount of data transformation.\n** ^If the xCallback argument is NULL then the collating function is\n** deleted.  ^When all collating functions having the same name are deleted,\n** that collation is no longer usable.\n**\n** ^The collating function callback is invoked with a copy of the pArg \n** application data pointer and with two strings in the encoding specified\n** by the eTextRep argument.  The collating function must return an\n** integer that is negative, zero, or positive\n** if the first string is less than, equal to, or greater than the second,\n** respectively.  A collating function must always return the same answer\n** given the same inputs.  If two or more collating functions are registered\n** to the same collation name (using different eTextRep values) then all\n** must give an equivalent answer when invoked with equivalent strings.\n** The collating function must obey the following properties for all\n** strings A, B, and C:\n**\n** <ol>\n** <li> If A==B then B==A.\n** <li> If A==B and B==C then A==C.\n** <li> If A&lt;B THEN B&gt;A.\n** <li> If A&lt;B and B&lt;C then A&lt;C.\n** </ol>\n**\n** If a collating function fails any of the above constraints and that\n** collating function is  registered and used, then the behavior of SQLite\n** is undefined.\n**\n** ^The sqlite3_create_collation_v2() works like sqlite3_create_collation()\n** with the addition that the xDestroy callback is invoked on pArg when\n** the collating function is deleted.\n** ^Collating functions are deleted when they are overridden by later\n** calls to the collation creation functions or when the\n** [database connection] is closed using [sqlite3_close()].\n**\n** ^The xDestroy callback is <u>not</u> called if the \n** sqlite3_create_collation_v2() function fails.  Applications that invoke\n** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should \n** check the return code and dispose of the application data pointer\n** themselves rather than expecting SQLite to deal with it for them.\n** This is different from every other SQLite interface.  The inconsistency \n** is unfortunate but cannot be changed without breaking backwards \n** compatibility.\n**\n** See also:  [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].\n*/\nSQLITE_API int sqlite3_create_collation(\n  sqlite3*, \n  const char *zName, \n  int eTextRep, \n  void *pArg,\n  int(*xCompare)(void*,int,const void*,int,const void*)\n);\nSQLITE_API int sqlite3_create_collation_v2(\n  sqlite3*, \n  const char *zName, \n  int eTextRep, \n  void *pArg,\n  int(*xCompare)(void*,int,const void*,int,const void*),\n  void(*xDestroy)(void*)\n);\nSQLITE_API int sqlite3_create_collation16(\n  sqlite3*, \n  const void *zName,\n  int eTextRep, \n  void *pArg,\n  int(*xCompare)(void*,int,const void*,int,const void*)\n);\n\n/*\n** CAPI3REF: Collation Needed Callbacks\n**\n** ^To avoid having to register all collation sequences before a database\n** can be used, a single callback function may be registered with the\n** [database connection] to be invoked whenever an undefined collation\n** sequence is required.\n**\n** ^If the function is registered using the sqlite3_collation_needed() API,\n** then it is passed the names of undefined collation sequences as strings\n** encoded in UTF-8. ^If sqlite3_collation_needed16() is used,\n** the names are passed as UTF-16 in machine native byte order.\n** ^A call to either function replaces the existing collation-needed callback.\n**\n** ^(When the callback is invoked, the first argument passed is a copy\n** of the second argument to sqlite3_collation_needed() or\n** sqlite3_collation_needed16().  The second argument is the database\n** connection.  The third argument is one of [SQLITE_UTF8], [SQLITE_UTF16BE],\n** or [SQLITE_UTF16LE], indicating the most desirable form of the collation\n** sequence function required.  The fourth parameter is the name of the\n** required collation sequence.)^\n**\n** The callback function should register the desired collation using\n** [sqlite3_create_collation()], [sqlite3_create_collation16()], or\n** [sqlite3_create_collation_v2()].\n*/\nSQLITE_API int sqlite3_collation_needed(\n  sqlite3*, \n  void*, \n  void(*)(void*,sqlite3*,int eTextRep,const char*)\n);\nSQLITE_API int sqlite3_collation_needed16(\n  sqlite3*, \n  void*,\n  void(*)(void*,sqlite3*,int eTextRep,const void*)\n);\n\n#ifdef SQLITE_HAS_CODEC\n/*\n** Specify the key for an encrypted database.  This routine should be\n** called right after sqlite3_open().\n**\n** The code to implement this API is not available in the public release\n** of SQLite.\n*/\nSQLITE_API int sqlite3_key(\n  sqlite3 *db,                   /* Database to be rekeyed */\n  const void *pKey, int nKey     /* The key */\n);\n\n/*\n** Change the key on an open database.  If the current database is not\n** encrypted, this routine will encrypt it.  If pNew==0 or nNew==0, the\n** database is decrypted.\n**\n** The code to implement this API is not available in the public release\n** of SQLite.\n*/\nSQLITE_API int sqlite3_rekey(\n  sqlite3 *db,                   /* Database to be rekeyed */\n  const void *pKey, int nKey     /* The new key */\n);\n\n/*\n** Specify the activation key for a SEE database.  Unless \n** activated, none of the SEE routines will work.\n*/\nSQLITE_API void sqlite3_activate_see(\n  const char *zPassPhrase        /* Activation phrase */\n);\n#endif\n\n#ifdef SQLITE_ENABLE_CEROD\n/*\n** Specify the activation key for a CEROD database.  Unless \n** activated, none of the CEROD routines will work.\n*/\nSQLITE_API void sqlite3_activate_cerod(\n  const char *zPassPhrase        /* Activation phrase */\n);\n#endif\n\n/*\n** CAPI3REF: Suspend Execution For A Short Time\n**\n** The sqlite3_sleep() function causes the current thread to suspend execution\n** for at least a number of milliseconds specified in its parameter.\n**\n** If the operating system does not support sleep requests with\n** millisecond time resolution, then the time will be rounded up to\n** the nearest second. The number of milliseconds of sleep actually\n** requested from the operating system is returned.\n**\n** ^SQLite implements this interface by calling the xSleep()\n** method of the default [sqlite3_vfs] object.  If the xSleep() method\n** of the default VFS is not implemented correctly, or not implemented at\n** all, then the behavior of sqlite3_sleep() may deviate from the description\n** in the previous paragraphs.\n*/\nSQLITE_API int sqlite3_sleep(int);\n\n/*\n** CAPI3REF: Name Of The Folder Holding Temporary Files\n**\n** ^(If this global variable is made to point to a string which is\n** the name of a folder (a.k.a. directory), then all temporary files\n** created by SQLite when using a built-in [sqlite3_vfs | VFS]\n** will be placed in that directory.)^  ^If this variable\n** is a NULL pointer, then SQLite performs a search for an appropriate\n** temporary file directory.\n**\n** It is not safe to read or modify this variable in more than one\n** thread at a time.  It is not safe to read or modify this variable\n** if a [database connection] is being used at the same time in a separate\n** thread.\n** It is intended that this variable be set once\n** as part of process initialization and before any SQLite interface\n** routines have been called and that this variable remain unchanged\n** thereafter.\n**\n** ^The [temp_store_directory pragma] may modify this variable and cause\n** it to point to memory obtained from [sqlite3_malloc].  ^Furthermore,\n** the [temp_store_directory pragma] always assumes that any string\n** that this variable points to is held in memory obtained from \n** [sqlite3_malloc] and the pragma may attempt to free that memory\n** using [sqlite3_free].\n** Hence, if this variable is modified directly, either it should be\n** made NULL or made to point to memory obtained from [sqlite3_malloc]\n** or else the use of the [temp_store_directory pragma] should be avoided.\n**\n** <b>Note to Windows Runtime users:</b>  The temporary directory must be set\n** prior to calling [sqlite3_open] or [sqlite3_open_v2].  Otherwise, various\n** features that require the use of temporary files may fail.  Here is an\n** example of how to do this using C++ with the Windows Runtime:\n**\n** <blockquote><pre>\n** LPCWSTR zPath = Windows::Storage::ApplicationData::Current->\n** &nbsp;     TemporaryFolder->Path->Data();\n** char zPathBuf&#91;MAX_PATH + 1&#93;;\n** memset(zPathBuf, 0, sizeof(zPathBuf));\n** WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf),\n** &nbsp;     NULL, NULL);\n** sqlite3_temp_directory = sqlite3_mprintf(\"%s\", zPathBuf);\n** </pre></blockquote>\n*/\nSQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory;\n\n/*\n** CAPI3REF: Name Of The Folder Holding Database Files\n**\n** ^(If this global variable is made to point to a string which is\n** the name of a folder (a.k.a. directory), then all database files\n** specified with a relative pathname and created or accessed by\n** SQLite when using a built-in windows [sqlite3_vfs | VFS] will be assumed\n** to be relative to that directory.)^ ^If this variable is a NULL\n** pointer, then SQLite assumes that all database files specified\n** with a relative pathname are relative to the current directory\n** for the process.  Only the windows VFS makes use of this global\n** variable; it is ignored by the unix VFS.\n**\n** Changing the value of this variable while a database connection is\n** open can result in a corrupt database.\n**\n** It is not safe to read or modify this variable in more than one\n** thread at a time.  It is not safe to read or modify this variable\n** if a [database connection] is being used at the same time in a separate\n** thread.\n** It is intended that this variable be set once\n** as part of process initialization and before any SQLite interface\n** routines have been called and that this variable remain unchanged\n** thereafter.\n**\n** ^The [data_store_directory pragma] may modify this variable and cause\n** it to point to memory obtained from [sqlite3_malloc].  ^Furthermore,\n** the [data_store_directory pragma] always assumes that any string\n** that this variable points to is held in memory obtained from \n** [sqlite3_malloc] and the pragma may attempt to free that memory\n** using [sqlite3_free].\n** Hence, if this variable is modified directly, either it should be\n** made NULL or made to point to memory obtained from [sqlite3_malloc]\n** or else the use of the [data_store_directory pragma] should be avoided.\n*/\nSQLITE_API SQLITE_EXTERN char *sqlite3_data_directory;\n\n/*\n** CAPI3REF: Test For Auto-Commit Mode\n** KEYWORDS: {autocommit mode}\n**\n** ^The sqlite3_get_autocommit() interface returns non-zero or\n** zero if the given database connection is or is not in autocommit mode,\n** respectively.  ^Autocommit mode is on by default.\n** ^Autocommit mode is disabled by a [BEGIN] statement.\n** ^Autocommit mode is re-enabled by a [COMMIT] or [ROLLBACK].\n**\n** If certain kinds of errors occur on a statement within a multi-statement\n** transaction (errors including [SQLITE_FULL], [SQLITE_IOERR],\n** [SQLITE_NOMEM], [SQLITE_BUSY], and [SQLITE_INTERRUPT]) then the\n** transaction might be rolled back automatically.  The only way to\n** find out whether SQLite automatically rolled back the transaction after\n** an error is to use this function.\n**\n** If another thread changes the autocommit status of the database\n** connection while this routine is running, then the return value\n** is undefined.\n*/\nSQLITE_API int sqlite3_get_autocommit(sqlite3*);\n\n/*\n** CAPI3REF: Find The Database Handle Of A Prepared Statement\n**\n** ^The sqlite3_db_handle interface returns the [database connection] handle\n** to which a [prepared statement] belongs.  ^The [database connection]\n** returned by sqlite3_db_handle is the same [database connection]\n** that was the first argument\n** to the [sqlite3_prepare_v2()] call (or its variants) that was used to\n** create the statement in the first place.\n*/\nSQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);\n\n/*\n** CAPI3REF: Return The Filename For A Database Connection\n**\n** ^The sqlite3_db_filename(D,N) interface returns a pointer to a filename\n** associated with database N of connection D.  ^The main database file\n** has the name \"main\".  If there is no attached database N on the database\n** connection D, or if database N is a temporary or in-memory database, then\n** a NULL pointer is returned.\n**\n** ^The filename returned by this function is the output of the\n** xFullPathname method of the [VFS].  ^In other words, the filename\n** will be an absolute pathname, even if the filename used\n** to open the database originally was a URI or relative pathname.\n*/\nSQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);\n\n/*\n** CAPI3REF: Determine if a database is read-only\n**\n** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N\n** of connection D is read-only, 0 if it is read/write, or -1 if N is not\n** the name of a database on connection D.\n*/\nSQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);\n\n/*\n** CAPI3REF: Find the next prepared statement\n**\n** ^This interface returns a pointer to the next [prepared statement] after\n** pStmt associated with the [database connection] pDb.  ^If pStmt is NULL\n** then this interface returns a pointer to the first prepared statement\n** associated with the database connection pDb.  ^If no prepared statement\n** satisfies the conditions of this routine, it returns NULL.\n**\n** The [database connection] pointer D in a call to\n** [sqlite3_next_stmt(D,S)] must refer to an open database\n** connection and in particular must not be a NULL pointer.\n*/\nSQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt);\n\n/*\n** CAPI3REF: Commit And Rollback Notification Callbacks\n**\n** ^The sqlite3_commit_hook() interface registers a callback\n** function to be invoked whenever a transaction is [COMMIT | committed].\n** ^Any callback set by a previous call to sqlite3_commit_hook()\n** for the same database connection is overridden.\n** ^The sqlite3_rollback_hook() interface registers a callback\n** function to be invoked whenever a transaction is [ROLLBACK | rolled back].\n** ^Any callback set by a previous call to sqlite3_rollback_hook()\n** for the same database connection is overridden.\n** ^The pArg argument is passed through to the callback.\n** ^If the callback on a commit hook function returns non-zero,\n** then the commit is converted into a rollback.\n**\n** ^The sqlite3_commit_hook(D,C,P) and sqlite3_rollback_hook(D,C,P) functions\n** return the P argument from the previous call of the same function\n** on the same [database connection] D, or NULL for\n** the first call for each function on D.\n**\n** The commit and rollback hook callbacks are not reentrant.\n** The callback implementation must not do anything that will modify\n** the database connection that invoked the callback.  Any actions\n** to modify the database connection must be deferred until after the\n** completion of the [sqlite3_step()] call that triggered the commit\n** or rollback hook in the first place.\n** Note that running any other SQL statements, including SELECT statements,\n** or merely calling [sqlite3_prepare_v2()] and [sqlite3_step()] will modify\n** the database connections for the meaning of \"modify\" in this paragraph.\n**\n** ^Registering a NULL function disables the callback.\n**\n** ^When the commit hook callback routine returns zero, the [COMMIT]\n** operation is allowed to continue normally.  ^If the commit hook\n** returns non-zero, then the [COMMIT] is converted into a [ROLLBACK].\n** ^The rollback hook is invoked on a rollback that results from a commit\n** hook returning non-zero, just as it would be with any other rollback.\n**\n** ^For the purposes of this API, a transaction is said to have been\n** rolled back if an explicit \"ROLLBACK\" statement is executed, or\n** an error or constraint causes an implicit rollback to occur.\n** ^The rollback callback is not invoked if a transaction is\n** automatically rolled back because the database connection is closed.\n**\n** See also the [sqlite3_update_hook()] interface.\n*/\nSQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*);\nSQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);\n\n/*\n** CAPI3REF: Data Change Notification Callbacks\n**\n** ^The sqlite3_update_hook() interface registers a callback function\n** with the [database connection] identified by the first argument\n** to be invoked whenever a row is updated, inserted or deleted.\n** ^Any callback set by a previous call to this function\n** for the same database connection is overridden.\n**\n** ^The second argument is a pointer to the function to invoke when a\n** row is updated, inserted or deleted.\n** ^The first argument to the callback is a copy of the third argument\n** to sqlite3_update_hook().\n** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],\n** or [SQLITE_UPDATE], depending on the operation that caused the callback\n** to be invoked.\n** ^The third and fourth arguments to the callback contain pointers to the\n** database and table name containing the affected row.\n** ^The final callback parameter is the [rowid] of the row.\n** ^In the case of an update, this is the [rowid] after the update takes place.\n**\n** ^(The update hook is not invoked when internal system tables are\n** modified (i.e. sqlite_master and sqlite_sequence).)^\n**\n** ^In the current implementation, the update hook\n** is not invoked when duplication rows are deleted because of an\n** [ON CONFLICT | ON CONFLICT REPLACE] clause.  ^Nor is the update hook\n** invoked when rows are deleted using the [truncate optimization].\n** The exceptions defined in this paragraph might change in a future\n** release of SQLite.\n**\n** The update hook implementation must not do anything that will modify\n** the database connection that invoked the update hook.  Any actions\n** to modify the database connection must be deferred until after the\n** completion of the [sqlite3_step()] call that triggered the update hook.\n** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their\n** database connections for the meaning of \"modify\" in this paragraph.\n**\n** ^The sqlite3_update_hook(D,C,P) function\n** returns the P argument from the previous call\n** on the same [database connection] D, or NULL for\n** the first call on D.\n**\n** See also the [sqlite3_commit_hook()] and [sqlite3_rollback_hook()]\n** interfaces.\n*/\nSQLITE_API void *sqlite3_update_hook(\n  sqlite3*, \n  void(*)(void *,int ,char const *,char const *,sqlite3_int64),\n  void*\n);\n\n/*\n** CAPI3REF: Enable Or Disable Shared Pager Cache\n**\n** ^(This routine enables or disables the sharing of the database cache\n** and schema data structures between [database connection | connections]\n** to the same database. Sharing is enabled if the argument is true\n** and disabled if the argument is false.)^\n**\n** ^Cache sharing is enabled and disabled for an entire process.\n** This is a change as of SQLite version 3.5.0. In prior versions of SQLite,\n** sharing was enabled or disabled for each thread separately.\n**\n** ^(The cache sharing mode set by this interface effects all subsequent\n** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()].\n** Existing database connections continue use the sharing mode\n** that was in effect at the time they were opened.)^\n**\n** ^(This routine returns [SQLITE_OK] if shared cache was enabled or disabled\n** successfully.  An [error code] is returned otherwise.)^\n**\n** ^Shared cache is disabled by default. But this might change in\n** future releases of SQLite.  Applications that care about shared\n** cache setting should set it explicitly.\n**\n** This interface is threadsafe on processors where writing a\n** 32-bit integer is atomic.\n**\n** See Also:  [SQLite Shared-Cache Mode]\n*/\nSQLITE_API int sqlite3_enable_shared_cache(int);\n\n/*\n** CAPI3REF: Attempt To Free Heap Memory\n**\n** ^The sqlite3_release_memory() interface attempts to free N bytes\n** of heap memory by deallocating non-essential memory allocations\n** held by the database library.   Memory used to cache database\n** pages to improve performance is an example of non-essential memory.\n** ^sqlite3_release_memory() returns the number of bytes actually freed,\n** which might be more or less than the amount requested.\n** ^The sqlite3_release_memory() routine is a no-op returning zero\n** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT].\n**\n** See also: [sqlite3_db_release_memory()]\n*/\nSQLITE_API int sqlite3_release_memory(int);\n\n/*\n** CAPI3REF: Free Memory Used By A Database Connection\n**\n** ^The sqlite3_db_release_memory(D) interface attempts to free as much heap\n** memory as possible from database connection D. Unlike the\n** [sqlite3_release_memory()] interface, this interface is effect even\n** when then [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is\n** omitted.\n**\n** See also: [sqlite3_release_memory()]\n*/\nSQLITE_API int sqlite3_db_release_memory(sqlite3*);\n\n/*\n** CAPI3REF: Impose A Limit On Heap Size\n**\n** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the\n** soft limit on the amount of heap memory that may be allocated by SQLite.\n** ^SQLite strives to keep heap memory utilization below the soft heap\n** limit by reducing the number of pages held in the page cache\n** as heap memory usages approaches the limit.\n** ^The soft heap limit is \"soft\" because even though SQLite strives to stay\n** below the limit, it will exceed the limit rather than generate\n** an [SQLITE_NOMEM] error.  In other words, the soft heap limit \n** is advisory only.\n**\n** ^The return value from sqlite3_soft_heap_limit64() is the size of\n** the soft heap limit prior to the call, or negative in the case of an\n** error.  ^If the argument N is negative\n** then no change is made to the soft heap limit.  Hence, the current\n** size of the soft heap limit can be determined by invoking\n** sqlite3_soft_heap_limit64() with a negative argument.\n**\n** ^If the argument N is zero then the soft heap limit is disabled.\n**\n** ^(The soft heap limit is not enforced in the current implementation\n** if one or more of following conditions are true:\n**\n** <ul>\n** <li> The soft heap limit is set to zero.\n** <li> Memory accounting is disabled using a combination of the\n**      [sqlite3_config]([SQLITE_CONFIG_MEMSTATUS],...) start-time option and\n**      the [SQLITE_DEFAULT_MEMSTATUS] compile-time option.\n** <li> An alternative page cache implementation is specified using\n**      [sqlite3_config]([SQLITE_CONFIG_PCACHE2],...).\n** <li> The page cache allocates from its own memory pool supplied\n**      by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than\n**      from the heap.\n** </ul>)^\n**\n** Beginning with SQLite version 3.7.3, the soft heap limit is enforced\n** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT]\n** compile-time option is invoked.  With [SQLITE_ENABLE_MEMORY_MANAGEMENT],\n** the soft heap limit is enforced on every memory allocation.  Without\n** [SQLITE_ENABLE_MEMORY_MANAGEMENT], the soft heap limit is only enforced\n** when memory is allocated by the page cache.  Testing suggests that because\n** the page cache is the predominate memory user in SQLite, most\n** applications will achieve adequate soft heap limit enforcement without\n** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT].\n**\n** The circumstances under which SQLite will enforce the soft heap limit may\n** changes in future releases of SQLite.\n*/\nSQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N);\n\n/*\n** CAPI3REF: Deprecated Soft Heap Limit Interface\n** DEPRECATED\n**\n** This is a deprecated version of the [sqlite3_soft_heap_limit64()]\n** interface.  This routine is provided for historical compatibility\n** only.  All new applications should use the\n** [sqlite3_soft_heap_limit64()] interface rather than this one.\n*/\nSQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N);\n\n\n/*\n** CAPI3REF: Extract Metadata About A Column Of A Table\n**\n** ^This routine returns metadata about a specific column of a specific\n** database table accessible using the [database connection] handle\n** passed as the first function argument.\n**\n** ^The column is identified by the second, third and fourth parameters to\n** this function. ^The second parameter is either the name of the database\n** (i.e. \"main\", \"temp\", or an attached database) containing the specified\n** table or NULL. ^If it is NULL, then all attached databases are searched\n** for the table using the same algorithm used by the database engine to\n** resolve unqualified table references.\n**\n** ^The third and fourth parameters to this function are the table and column\n** name of the desired column, respectively. Neither of these parameters\n** may be NULL.\n**\n** ^Metadata is returned by writing to the memory locations passed as the 5th\n** and subsequent parameters to this function. ^Any of these arguments may be\n** NULL, in which case the corresponding element of metadata is omitted.\n**\n** ^(<blockquote>\n** <table border=\"1\">\n** <tr><th> Parameter <th> Output<br>Type <th>  Description\n**\n** <tr><td> 5th <td> const char* <td> Data type\n** <tr><td> 6th <td> const char* <td> Name of default collation sequence\n** <tr><td> 7th <td> int         <td> True if column has a NOT NULL constraint\n** <tr><td> 8th <td> int         <td> True if column is part of the PRIMARY KEY\n** <tr><td> 9th <td> int         <td> True if column is [AUTOINCREMENT]\n** </table>\n** </blockquote>)^\n**\n** ^The memory pointed to by the character pointers returned for the\n** declaration type and collation sequence is valid only until the next\n** call to any SQLite API function.\n**\n** ^If the specified table is actually a view, an [error code] is returned.\n**\n** ^If the specified column is \"rowid\", \"oid\" or \"_rowid_\" and an\n** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output\n** parameters are set for the explicitly declared column. ^(If there is no\n** explicitly declared [INTEGER PRIMARY KEY] column, then the output\n** parameters are set as follows:\n**\n** <pre>\n**     data type: \"INTEGER\"\n**     collation sequence: \"BINARY\"\n**     not null: 0\n**     primary key: 1\n**     auto increment: 0\n** </pre>)^\n**\n** ^(This function may load one or more schemas from database files. If an\n** error occurs during this process, or if the requested table or column\n** cannot be found, an [error code] is returned and an error message left\n** in the [database connection] (to be retrieved using sqlite3_errmsg()).)^\n**\n** ^This API is only available if the library was compiled with the\n** [SQLITE_ENABLE_COLUMN_METADATA] C-preprocessor symbol defined.\n*/\nSQLITE_API int sqlite3_table_column_metadata(\n  sqlite3 *db,                /* Connection handle */\n  const char *zDbName,        /* Database name or NULL */\n  const char *zTableName,     /* Table name */\n  const char *zColumnName,    /* Column name */\n  char const **pzDataType,    /* OUTPUT: Declared data type */\n  char const **pzCollSeq,     /* OUTPUT: Collation sequence name */\n  int *pNotNull,              /* OUTPUT: True if NOT NULL constraint exists */\n  int *pPrimaryKey,           /* OUTPUT: True if column part of PK */\n  int *pAutoinc               /* OUTPUT: True if column is auto-increment */\n);\n\n/*\n** CAPI3REF: Load An Extension\n**\n** ^This interface loads an SQLite extension library from the named file.\n**\n** ^The sqlite3_load_extension() interface attempts to load an\n** SQLite extension library contained in the file zFile.\n**\n** ^The entry point is zProc.\n** ^zProc may be 0, in which case the name of the entry point\n** defaults to \"sqlite3_extension_init\".\n** ^The sqlite3_load_extension() interface returns\n** [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong.\n** ^If an error occurs and pzErrMsg is not 0, then the\n** [sqlite3_load_extension()] interface shall attempt to\n** fill *pzErrMsg with error message text stored in memory\n** obtained from [sqlite3_malloc()]. The calling function\n** should free this memory by calling [sqlite3_free()].\n**\n** ^Extension loading must be enabled using\n** [sqlite3_enable_load_extension()] prior to calling this API,\n** otherwise an error will be returned.\n**\n** See also the [load_extension() SQL function].\n*/\nSQLITE_API int sqlite3_load_extension(\n  sqlite3 *db,          /* Load the extension into this database connection */\n  const char *zFile,    /* Name of the shared library containing extension */\n  const char *zProc,    /* Entry point.  Derived from zFile if 0 */\n  char **pzErrMsg       /* Put error message here if not 0 */\n);\n\n/*\n** CAPI3REF: Enable Or Disable Extension Loading\n**\n** ^So as not to open security holes in older applications that are\n** unprepared to deal with extension loading, and as a means of disabling\n** extension loading while evaluating user-entered SQL, the following API\n** is provided to turn the [sqlite3_load_extension()] mechanism on and off.\n**\n** ^Extension loading is off by default. See ticket #1863.\n** ^Call the sqlite3_enable_load_extension() routine with onoff==1\n** to turn extension loading on and call it with onoff==0 to turn\n** it back off again.\n*/\nSQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff);\n\n/*\n** CAPI3REF: Automatically Load Statically Linked Extensions\n**\n** ^This interface causes the xEntryPoint() function to be invoked for\n** each new [database connection] that is created.  The idea here is that\n** xEntryPoint() is the entry point for a statically linked SQLite extension\n** that is to be automatically loaded into all new database connections.\n**\n** ^(Even though the function prototype shows that xEntryPoint() takes\n** no arguments and returns void, SQLite invokes xEntryPoint() with three\n** arguments and expects and integer result as if the signature of the\n** entry point where as follows:\n**\n** <blockquote><pre>\n** &nbsp;  int xEntryPoint(\n** &nbsp;    sqlite3 *db,\n** &nbsp;    const char **pzErrMsg,\n** &nbsp;    const struct sqlite3_api_routines *pThunk\n** &nbsp;  );\n** </pre></blockquote>)^\n**\n** If the xEntryPoint routine encounters an error, it should make *pzErrMsg\n** point to an appropriate error message (obtained from [sqlite3_mprintf()])\n** and return an appropriate [error code].  ^SQLite ensures that *pzErrMsg\n** is NULL before calling the xEntryPoint().  ^SQLite will invoke\n** [sqlite3_free()] on *pzErrMsg after xEntryPoint() returns.  ^If any\n** xEntryPoint() returns an error, the [sqlite3_open()], [sqlite3_open16()],\n** or [sqlite3_open_v2()] call that provoked the xEntryPoint() will fail.\n**\n** ^Calling sqlite3_auto_extension(X) with an entry point X that is already\n** on the list of automatic extensions is a harmless no-op. ^No entry point\n** will be called more than once for each database connection that is opened.\n**\n** See also: [sqlite3_reset_auto_extension()].\n*/\nSQLITE_API int sqlite3_auto_extension(void (*xEntryPoint)(void));\n\n/*\n** CAPI3REF: Reset Automatic Extension Loading\n**\n** ^This interface disables all automatic extensions previously\n** registered using [sqlite3_auto_extension()].\n*/\nSQLITE_API void sqlite3_reset_auto_extension(void);\n\n/*\n** The interface to the virtual-table mechanism is currently considered\n** to be experimental.  The interface might change in incompatible ways.\n** If this is a problem for you, do not use the interface at this time.\n**\n** When the virtual-table mechanism stabilizes, we will declare the\n** interface fixed, support it indefinitely, and remove this comment.\n*/\n\n/*\n** Structures used by the virtual table interface\n*/\ntypedef struct sqlite3_vtab sqlite3_vtab;\ntypedef struct sqlite3_index_info sqlite3_index_info;\ntypedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor;\ntypedef struct sqlite3_module sqlite3_module;\n\n/*\n** CAPI3REF: Virtual Table Object\n** KEYWORDS: sqlite3_module {virtual table module}\n**\n** This structure, sometimes called a \"virtual table module\", \n** defines the implementation of a [virtual tables].  \n** This structure consists mostly of methods for the module.\n**\n** ^A virtual table module is created by filling in a persistent\n** instance of this structure and passing a pointer to that instance\n** to [sqlite3_create_module()] or [sqlite3_create_module_v2()].\n** ^The registration remains valid until it is replaced by a different\n** module or until the [database connection] closes.  The content\n** of this structure must not change while it is registered with\n** any database connection.\n*/\nstruct sqlite3_module {\n  int iVersion;\n  int (*xCreate)(sqlite3*, void *pAux,\n               int argc, const char *const*argv,\n               sqlite3_vtab **ppVTab, char**);\n  int (*xConnect)(sqlite3*, void *pAux,\n               int argc, const char *const*argv,\n               sqlite3_vtab **ppVTab, char**);\n  int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);\n  int (*xDisconnect)(sqlite3_vtab *pVTab);\n  int (*xDestroy)(sqlite3_vtab *pVTab);\n  int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);\n  int (*xClose)(sqlite3_vtab_cursor*);\n  int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,\n                int argc, sqlite3_value **argv);\n  int (*xNext)(sqlite3_vtab_cursor*);\n  int (*xEof)(sqlite3_vtab_cursor*);\n  int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);\n  int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);\n  int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);\n  int (*xBegin)(sqlite3_vtab *pVTab);\n  int (*xSync)(sqlite3_vtab *pVTab);\n  int (*xCommit)(sqlite3_vtab *pVTab);\n  int (*xRollback)(sqlite3_vtab *pVTab);\n  int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,\n                       void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),\n                       void **ppArg);\n  int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);\n  /* The methods above are in version 1 of the sqlite_module object. Those \n  ** below are for version 2 and greater. */\n  int (*xSavepoint)(sqlite3_vtab *pVTab, int);\n  int (*xRelease)(sqlite3_vtab *pVTab, int);\n  int (*xRollbackTo)(sqlite3_vtab *pVTab, int);\n};\n\n/*\n** CAPI3REF: Virtual Table Indexing Information\n** KEYWORDS: sqlite3_index_info\n**\n** The sqlite3_index_info structure and its substructures is used as part\n** of the [virtual table] interface to\n** pass information into and receive the reply from the [xBestIndex]\n** method of a [virtual table module].  The fields under **Inputs** are the\n** inputs to xBestIndex and are read-only.  xBestIndex inserts its\n** results into the **Outputs** fields.\n**\n** ^(The aConstraint[] array records WHERE clause constraints of the form:\n**\n** <blockquote>column OP expr</blockquote>\n**\n** where OP is =, &lt;, &lt;=, &gt;, or &gt;=.)^  ^(The particular operator is\n** stored in aConstraint[].op using one of the\n** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^\n** ^(The index of the column is stored in\n** aConstraint[].iColumn.)^  ^(aConstraint[].usable is TRUE if the\n** expr on the right-hand side can be evaluated (and thus the constraint\n** is usable) and false if it cannot.)^\n**\n** ^The optimizer automatically inverts terms of the form \"expr OP column\"\n** and makes other simplifications to the WHERE clause in an attempt to\n** get as many WHERE clause terms into the form shown above as possible.\n** ^The aConstraint[] array only reports WHERE clause terms that are\n** relevant to the particular virtual table being queried.\n**\n** ^Information about the ORDER BY clause is stored in aOrderBy[].\n** ^Each term of aOrderBy records a column of the ORDER BY clause.\n**\n** The [xBestIndex] method must fill aConstraintUsage[] with information\n** about what parameters to pass to xFilter.  ^If argvIndex>0 then\n** the right-hand side of the corresponding aConstraint[] is evaluated\n** and becomes the argvIndex-th entry in argv.  ^(If aConstraintUsage[].omit\n** is true, then the constraint is assumed to be fully handled by the\n** virtual table and is not checked again by SQLite.)^\n**\n** ^The idxNum and idxPtr values are recorded and passed into the\n** [xFilter] method.\n** ^[sqlite3_free()] is used to free idxPtr if and only if\n** needToFreeIdxPtr is true.\n**\n** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in\n** the correct order to satisfy the ORDER BY clause so that no separate\n** sorting step is required.\n**\n** ^The estimatedCost value is an estimate of the cost of doing the\n** particular lookup.  A full scan of a table with N entries should have\n** a cost of N.  A binary search of a table of N entries should have a\n** cost of approximately log(N).\n*/\nstruct sqlite3_index_info {\n  /* Inputs */\n  int nConstraint;           /* Number of entries in aConstraint */\n  struct sqlite3_index_constraint {\n     int iColumn;              /* Column on left-hand side of constraint */\n     unsigned char op;         /* Constraint operator */\n     unsigned char usable;     /* True if this constraint is usable */\n     int iTermOffset;          /* Used internally - xBestIndex should ignore */\n  } *aConstraint;            /* Table of WHERE clause constraints */\n  int nOrderBy;              /* Number of terms in the ORDER BY clause */\n  struct sqlite3_index_orderby {\n     int iColumn;              /* Column number */\n     unsigned char desc;       /* True for DESC.  False for ASC. */\n  } *aOrderBy;               /* The ORDER BY clause */\n  /* Outputs */\n  struct sqlite3_index_constraint_usage {\n    int argvIndex;           /* if >0, constraint is part of argv to xFilter */\n    unsigned char omit;      /* Do not code a test for this constraint */\n  } *aConstraintUsage;\n  int idxNum;                /* Number used to identify the index */\n  char *idxStr;              /* String, possibly obtained from sqlite3_malloc */\n  int needToFreeIdxStr;      /* Free idxStr using sqlite3_free() if true */\n  int orderByConsumed;       /* True if output is already ordered */\n  double estimatedCost;      /* Estimated cost of using this index */\n};\n\n/*\n** CAPI3REF: Virtual Table Constraint Operator Codes\n**\n** These macros defined the allowed values for the\n** [sqlite3_index_info].aConstraint[].op field.  Each value represents\n** an operator that is part of a constraint term in the wHERE clause of\n** a query that uses a [virtual table].\n*/\n#define SQLITE_INDEX_CONSTRAINT_EQ    2\n#define SQLITE_INDEX_CONSTRAINT_GT    4\n#define SQLITE_INDEX_CONSTRAINT_LE    8\n#define SQLITE_INDEX_CONSTRAINT_LT    16\n#define SQLITE_INDEX_CONSTRAINT_GE    32\n#define SQLITE_INDEX_CONSTRAINT_MATCH 64\n\n/*\n** CAPI3REF: Register A Virtual Table Implementation\n**\n** ^These routines are used to register a new [virtual table module] name.\n** ^Module names must be registered before\n** creating a new [virtual table] using the module and before using a\n** preexisting [virtual table] for the module.\n**\n** ^The module name is registered on the [database connection] specified\n** by the first parameter.  ^The name of the module is given by the \n** second parameter.  ^The third parameter is a pointer to\n** the implementation of the [virtual table module].   ^The fourth\n** parameter is an arbitrary client data pointer that is passed through\n** into the [xCreate] and [xConnect] methods of the virtual table module\n** when a new virtual table is be being created or reinitialized.\n**\n** ^The sqlite3_create_module_v2() interface has a fifth parameter which\n** is a pointer to a destructor for the pClientData.  ^SQLite will\n** invoke the destructor function (if it is not NULL) when SQLite\n** no longer needs the pClientData pointer.  ^The destructor will also\n** be invoked if the call to sqlite3_create_module_v2() fails.\n** ^The sqlite3_create_module()\n** interface is equivalent to sqlite3_create_module_v2() with a NULL\n** destructor.\n*/\nSQLITE_API int sqlite3_create_module(\n  sqlite3 *db,               /* SQLite connection to register module with */\n  const char *zName,         /* Name of the module */\n  const sqlite3_module *p,   /* Methods for the module */\n  void *pClientData          /* Client data for xCreate/xConnect */\n);\nSQLITE_API int sqlite3_create_module_v2(\n  sqlite3 *db,               /* SQLite connection to register module with */\n  const char *zName,         /* Name of the module */\n  const sqlite3_module *p,   /* Methods for the module */\n  void *pClientData,         /* Client data for xCreate/xConnect */\n  void(*xDestroy)(void*)     /* Module destructor function */\n);\n\n/*\n** CAPI3REF: Virtual Table Instance Object\n** KEYWORDS: sqlite3_vtab\n**\n** Every [virtual table module] implementation uses a subclass\n** of this object to describe a particular instance\n** of the [virtual table].  Each subclass will\n** be tailored to the specific needs of the module implementation.\n** The purpose of this superclass is to define certain fields that are\n** common to all module implementations.\n**\n** ^Virtual tables methods can set an error message by assigning a\n** string obtained from [sqlite3_mprintf()] to zErrMsg.  The method should\n** take care that any prior string is freed by a call to [sqlite3_free()]\n** prior to assigning a new string to zErrMsg.  ^After the error message\n** is delivered up to the client application, the string will be automatically\n** freed by sqlite3_free() and the zErrMsg field will be zeroed.\n*/\nstruct sqlite3_vtab {\n  const sqlite3_module *pModule;  /* The module for this virtual table */\n  int nRef;                       /* NO LONGER USED */\n  char *zErrMsg;                  /* Error message from sqlite3_mprintf() */\n  /* Virtual table implementations will typically add additional fields */\n};\n\n/*\n** CAPI3REF: Virtual Table Cursor Object\n** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor}\n**\n** Every [virtual table module] implementation uses a subclass of the\n** following structure to describe cursors that point into the\n** [virtual table] and are used\n** to loop through the virtual table.  Cursors are created using the\n** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed\n** by the [sqlite3_module.xClose | xClose] method.  Cursors are used\n** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods\n** of the module.  Each module implementation will define\n** the content of a cursor structure to suit its own needs.\n**\n** This superclass exists in order to define fields of the cursor that\n** are common to all implementations.\n*/\nstruct sqlite3_vtab_cursor {\n  sqlite3_vtab *pVtab;      /* Virtual table of this cursor */\n  /* Virtual table implementations will typically add additional fields */\n};\n\n/*\n** CAPI3REF: Declare The Schema Of A Virtual Table\n**\n** ^The [xCreate] and [xConnect] methods of a\n** [virtual table module] call this interface\n** to declare the format (the names and datatypes of the columns) of\n** the virtual tables they implement.\n*/\nSQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);\n\n/*\n** CAPI3REF: Overload A Function For A Virtual Table\n**\n** ^(Virtual tables can provide alternative implementations of functions\n** using the [xFindFunction] method of the [virtual table module].  \n** But global versions of those functions\n** must exist in order to be overloaded.)^\n**\n** ^(This API makes sure a global version of a function with a particular\n** name and number of parameters exists.  If no such function exists\n** before this API is called, a new function is created.)^  ^The implementation\n** of the new function always causes an exception to be thrown.  So\n** the new function is not good for anything by itself.  Its only\n** purpose is to be a placeholder function that can be overloaded\n** by a [virtual table].\n*/\nSQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);\n\n/*\n** The interface to the virtual-table mechanism defined above (back up\n** to a comment remarkably similar to this one) is currently considered\n** to be experimental.  The interface might change in incompatible ways.\n** If this is a problem for you, do not use the interface at this time.\n**\n** When the virtual-table mechanism stabilizes, we will declare the\n** interface fixed, support it indefinitely, and remove this comment.\n*/\n\n/*\n** CAPI3REF: A Handle To An Open BLOB\n** KEYWORDS: {BLOB handle} {BLOB handles}\n**\n** An instance of this object represents an open BLOB on which\n** [sqlite3_blob_open | incremental BLOB I/O] can be performed.\n** ^Objects of this type are created by [sqlite3_blob_open()]\n** and destroyed by [sqlite3_blob_close()].\n** ^The [sqlite3_blob_read()] and [sqlite3_blob_write()] interfaces\n** can be used to read or write small subsections of the BLOB.\n** ^The [sqlite3_blob_bytes()] interface returns the size of the BLOB in bytes.\n*/\ntypedef struct sqlite3_blob sqlite3_blob;\n\n/*\n** CAPI3REF: Open A BLOB For Incremental I/O\n**\n** ^(This interfaces opens a [BLOB handle | handle] to the BLOB located\n** in row iRow, column zColumn, table zTable in database zDb;\n** in other words, the same BLOB that would be selected by:\n**\n** <pre>\n**     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;\n** </pre>)^\n**\n** ^If the flags parameter is non-zero, then the BLOB is opened for read\n** and write access. ^If it is zero, the BLOB is opened for read access.\n** ^It is not possible to open a column that is part of an index or primary \n** key for writing. ^If [foreign key constraints] are enabled, it is \n** not possible to open a column that is part of a [child key] for writing.\n**\n** ^Note that the database name is not the filename that contains\n** the database but rather the symbolic name of the database that\n** appears after the AS keyword when the database is connected using [ATTACH].\n** ^For the main database file, the database name is \"main\".\n** ^For TEMP tables, the database name is \"temp\".\n**\n** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is written\n** to *ppBlob. Otherwise an [error code] is returned and *ppBlob is set\n** to be a null pointer.)^\n** ^This function sets the [database connection] error code and message\n** accessible via [sqlite3_errcode()] and [sqlite3_errmsg()] and related\n** functions. ^Note that the *ppBlob variable is always initialized in a\n** way that makes it safe to invoke [sqlite3_blob_close()] on *ppBlob\n** regardless of the success or failure of this routine.\n**\n** ^(If the row that a BLOB handle points to is modified by an\n** [UPDATE], [DELETE], or by [ON CONFLICT] side-effects\n** then the BLOB handle is marked as \"expired\".\n** This is true if any column of the row is changed, even a column\n** other than the one the BLOB handle is open on.)^\n** ^Calls to [sqlite3_blob_read()] and [sqlite3_blob_write()] for\n** an expired BLOB handle fail with a return code of [SQLITE_ABORT].\n** ^(Changes written into a BLOB prior to the BLOB expiring are not\n** rolled back by the expiration of the BLOB.  Such changes will eventually\n** commit if the transaction continues to completion.)^\n**\n** ^Use the [sqlite3_blob_bytes()] interface to determine the size of\n** the opened blob.  ^The size of a blob may not be changed by this\n** interface.  Use the [UPDATE] SQL command to change the size of a\n** blob.\n**\n** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces\n** and the built-in [zeroblob] SQL function can be used, if desired,\n** to create an empty, zero-filled blob in which to read or write using\n** this interface.\n**\n** To avoid a resource leak, every open [BLOB handle] should eventually\n** be released by a call to [sqlite3_blob_close()].\n*/\nSQLITE_API int sqlite3_blob_open(\n  sqlite3*,\n  const char *zDb,\n  const char *zTable,\n  const char *zColumn,\n  sqlite3_int64 iRow,\n  int flags,\n  sqlite3_blob **ppBlob\n);\n\n/*\n** CAPI3REF: Move a BLOB Handle to a New Row\n**\n** ^This function is used to move an existing blob handle so that it points\n** to a different row of the same database table. ^The new row is identified\n** by the rowid value passed as the second argument. Only the row can be\n** changed. ^The database, table and column on which the blob handle is open\n** remain the same. Moving an existing blob handle to a new row can be\n** faster than closing the existing handle and opening a new one.\n**\n** ^(The new row must meet the same criteria as for [sqlite3_blob_open()] -\n** it must exist and there must be either a blob or text value stored in\n** the nominated column.)^ ^If the new row is not present in the table, or if\n** it does not contain a blob or text value, or if another error occurs, an\n** SQLite error code is returned and the blob handle is considered aborted.\n** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or\n** [sqlite3_blob_reopen()] on an aborted blob handle immediately return\n** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle\n** always returns zero.\n**\n** ^This function sets the database handle error code and message.\n*/\nSQLITE_API SQLITE_EXPERIMENTAL int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);\n\n/*\n** CAPI3REF: Close A BLOB Handle\n**\n** ^Closes an open [BLOB handle].\n**\n** ^Closing a BLOB shall cause the current transaction to commit\n** if there are no other BLOBs, no pending prepared statements, and the\n** database connection is in [autocommit mode].\n** ^If any writes were made to the BLOB, they might be held in cache\n** until the close operation if they will fit.\n**\n** ^(Closing the BLOB often forces the changes\n** out to disk and so if any I/O errors occur, they will likely occur\n** at the time when the BLOB is closed.  Any errors that occur during\n** closing are reported as a non-zero return value.)^\n**\n** ^(The BLOB is closed unconditionally.  Even if this routine returns\n** an error code, the BLOB is still closed.)^\n**\n** ^Calling this routine with a null pointer (such as would be returned\n** by a failed call to [sqlite3_blob_open()]) is a harmless no-op.\n*/\nSQLITE_API int sqlite3_blob_close(sqlite3_blob *);\n\n/*\n** CAPI3REF: Return The Size Of An Open BLOB\n**\n** ^Returns the size in bytes of the BLOB accessible via the \n** successfully opened [BLOB handle] in its only argument.  ^The\n** incremental blob I/O routines can only read or overwriting existing\n** blob content; they cannot change the size of a blob.\n**\n** This routine only works on a [BLOB handle] which has been created\n** by a prior successful call to [sqlite3_blob_open()] and which has not\n** been closed by [sqlite3_blob_close()].  Passing any other pointer in\n** to this routine results in undefined and probably undesirable behavior.\n*/\nSQLITE_API int sqlite3_blob_bytes(sqlite3_blob *);\n\n/*\n** CAPI3REF: Read Data From A BLOB Incrementally\n**\n** ^(This function is used to read data from an open [BLOB handle] into a\n** caller-supplied buffer. N bytes of data are copied into buffer Z\n** from the open BLOB, starting at offset iOffset.)^\n**\n** ^If offset iOffset is less than N bytes from the end of the BLOB,\n** [SQLITE_ERROR] is returned and no data is read.  ^If N or iOffset is\n** less than zero, [SQLITE_ERROR] is returned and no data is read.\n** ^The size of the blob (and hence the maximum value of N+iOffset)\n** can be determined using the [sqlite3_blob_bytes()] interface.\n**\n** ^An attempt to read from an expired [BLOB handle] fails with an\n** error code of [SQLITE_ABORT].\n**\n** ^(On success, sqlite3_blob_read() returns SQLITE_OK.\n** Otherwise, an [error code] or an [extended error code] is returned.)^\n**\n** This routine only works on a [BLOB handle] which has been created\n** by a prior successful call to [sqlite3_blob_open()] and which has not\n** been closed by [sqlite3_blob_close()].  Passing any other pointer in\n** to this routine results in undefined and probably undesirable behavior.\n**\n** See also: [sqlite3_blob_write()].\n*/\nSQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset);\n\n/*\n** CAPI3REF: Write Data Into A BLOB Incrementally\n**\n** ^This function is used to write data into an open [BLOB handle] from a\n** caller-supplied buffer. ^N bytes of data are copied from the buffer Z\n** into the open BLOB, starting at offset iOffset.\n**\n** ^If the [BLOB handle] passed as the first argument was not opened for\n** writing (the flags parameter to [sqlite3_blob_open()] was zero),\n** this function returns [SQLITE_READONLY].\n**\n** ^This function may only modify the contents of the BLOB; it is\n** not possible to increase the size of a BLOB using this API.\n** ^If offset iOffset is less than N bytes from the end of the BLOB,\n** [SQLITE_ERROR] is returned and no data is written.  ^If N is\n** less than zero [SQLITE_ERROR] is returned and no data is written.\n** The size of the BLOB (and hence the maximum value of N+iOffset)\n** can be determined using the [sqlite3_blob_bytes()] interface.\n**\n** ^An attempt to write to an expired [BLOB handle] fails with an\n** error code of [SQLITE_ABORT].  ^Writes to the BLOB that occurred\n** before the [BLOB handle] expired are not rolled back by the\n** expiration of the handle, though of course those changes might\n** have been overwritten by the statement that expired the BLOB handle\n** or by other independent statements.\n**\n** ^(On success, sqlite3_blob_write() returns SQLITE_OK.\n** Otherwise, an  [error code] or an [extended error code] is returned.)^\n**\n** This routine only works on a [BLOB handle] which has been created\n** by a prior successful call to [sqlite3_blob_open()] and which has not\n** been closed by [sqlite3_blob_close()].  Passing any other pointer in\n** to this routine results in undefined and probably undesirable behavior.\n**\n** See also: [sqlite3_blob_read()].\n*/\nSQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset);\n\n/*\n** CAPI3REF: Virtual File System Objects\n**\n** A virtual filesystem (VFS) is an [sqlite3_vfs] object\n** that SQLite uses to interact\n** with the underlying operating system.  Most SQLite builds come with a\n** single default VFS that is appropriate for the host computer.\n** New VFSes can be registered and existing VFSes can be unregistered.\n** The following interfaces are provided.\n**\n** ^The sqlite3_vfs_find() interface returns a pointer to a VFS given its name.\n** ^Names are case sensitive.\n** ^Names are zero-terminated UTF-8 strings.\n** ^If there is no match, a NULL pointer is returned.\n** ^If zVfsName is NULL then the default VFS is returned.\n**\n** ^New VFSes are registered with sqlite3_vfs_register().\n** ^Each new VFS becomes the default VFS if the makeDflt flag is set.\n** ^The same VFS can be registered multiple times without injury.\n** ^To make an existing VFS into the default VFS, register it again\n** with the makeDflt flag set.  If two different VFSes with the\n** same name are registered, the behavior is undefined.  If a\n** VFS is registered with a name that is NULL or an empty string,\n** then the behavior is undefined.\n**\n** ^Unregister a VFS with the sqlite3_vfs_unregister() interface.\n** ^(If the default VFS is unregistered, another VFS is chosen as\n** the default.  The choice for the new VFS is arbitrary.)^\n*/\nSQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName);\nSQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt);\nSQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);\n\n/*\n** CAPI3REF: Mutexes\n**\n** The SQLite core uses these routines for thread\n** synchronization. Though they are intended for internal\n** use by SQLite, code that links against SQLite is\n** permitted to use any of these routines.\n**\n** The SQLite source code contains multiple implementations\n** of these mutex routines.  An appropriate implementation\n** is selected automatically at compile-time.  ^(The following\n** implementations are available in the SQLite core:\n**\n** <ul>\n** <li>   SQLITE_MUTEX_PTHREADS\n** <li>   SQLITE_MUTEX_W32\n** <li>   SQLITE_MUTEX_NOOP\n** </ul>)^\n**\n** ^The SQLITE_MUTEX_NOOP implementation is a set of routines\n** that does no real locking and is appropriate for use in\n** a single-threaded application.  ^The SQLITE_MUTEX_PTHREADS and\n** SQLITE_MUTEX_W32 implementations are appropriate for use on Unix\n** and Windows.\n**\n** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor\n** macro defined (with \"-DSQLITE_MUTEX_APPDEF=1\"), then no mutex\n** implementation is included with the library. In this case the\n** application must supply a custom mutex implementation using the\n** [SQLITE_CONFIG_MUTEX] option of the sqlite3_config() function\n** before calling sqlite3_initialize() or any other public sqlite3_\n** function that calls sqlite3_initialize().)^\n**\n** ^The sqlite3_mutex_alloc() routine allocates a new\n** mutex and returns a pointer to it. ^If it returns NULL\n** that means that a mutex could not be allocated.  ^SQLite\n** will unwind its stack and return an error.  ^(The argument\n** to sqlite3_mutex_alloc() is one of these integer constants:\n**\n** <ul>\n** <li>  SQLITE_MUTEX_FAST\n** <li>  SQLITE_MUTEX_RECURSIVE\n** <li>  SQLITE_MUTEX_STATIC_MASTER\n** <li>  SQLITE_MUTEX_STATIC_MEM\n** <li>  SQLITE_MUTEX_STATIC_MEM2\n** <li>  SQLITE_MUTEX_STATIC_PRNG\n** <li>  SQLITE_MUTEX_STATIC_LRU\n** <li>  SQLITE_MUTEX_STATIC_LRU2\n** </ul>)^\n**\n** ^The first two constants (SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE)\n** cause sqlite3_mutex_alloc() to create\n** a new mutex.  ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE\n** is used but not necessarily so when SQLITE_MUTEX_FAST is used.\n** The mutex implementation does not need to make a distinction\n** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does\n** not want to.  ^SQLite will only request a recursive mutex in\n** cases where it really needs one.  ^If a faster non-recursive mutex\n** implementation is available on the host platform, the mutex subsystem\n** might return such a mutex in response to SQLITE_MUTEX_FAST.\n**\n** ^The other allowed parameters to sqlite3_mutex_alloc() (anything other\n** than SQLITE_MUTEX_FAST and SQLITE_MUTEX_RECURSIVE) each return\n** a pointer to a static preexisting mutex.  ^Six static mutexes are\n** used by the current version of SQLite.  Future versions of SQLite\n** may add additional static mutexes.  Static mutexes are for internal\n** use by SQLite only.  Applications that use SQLite mutexes should\n** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or\n** SQLITE_MUTEX_RECURSIVE.\n**\n** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST\n** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()\n** returns a different mutex on every call.  ^But for the static\n** mutex types, the same mutex is returned on every call that has\n** the same type number.\n**\n** ^The sqlite3_mutex_free() routine deallocates a previously\n** allocated dynamic mutex.  ^SQLite is careful to deallocate every\n** dynamic mutex that it allocates.  The dynamic mutexes must not be in\n** use when they are deallocated.  Attempting to deallocate a static\n** mutex results in undefined behavior.  ^SQLite never deallocates\n** a static mutex.\n**\n** ^The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt\n** to enter a mutex.  ^If another thread is already within the mutex,\n** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return\n** SQLITE_BUSY.  ^The sqlite3_mutex_try() interface returns [SQLITE_OK]\n** upon successful entry.  ^(Mutexes created using\n** SQLITE_MUTEX_RECURSIVE can be entered multiple times by the same thread.\n** In such cases the,\n** mutex must be exited an equal number of times before another thread\n** can enter.)^  ^(If the same thread tries to enter any other\n** kind of mutex more than once, the behavior is undefined.\n** SQLite will never exhibit\n** such behavior in its own use of mutexes.)^\n**\n** ^(Some systems (for example, Windows 95) do not support the operation\n** implemented by sqlite3_mutex_try().  On those systems, sqlite3_mutex_try()\n** will always return SQLITE_BUSY.  The SQLite core only ever uses\n** sqlite3_mutex_try() as an optimization so this is acceptable behavior.)^\n**\n** ^The sqlite3_mutex_leave() routine exits a mutex that was\n** previously entered by the same thread.   ^(The behavior\n** is undefined if the mutex is not currently entered by the\n** calling thread or is not currently allocated.  SQLite will\n** never do either.)^\n**\n** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or\n** sqlite3_mutex_leave() is a NULL pointer, then all three routines\n** behave as no-ops.\n**\n** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].\n*/\nSQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int);\nSQLITE_API void sqlite3_mutex_free(sqlite3_mutex*);\nSQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*);\nSQLITE_API int sqlite3_mutex_try(sqlite3_mutex*);\nSQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*);\n\n/*\n** CAPI3REF: Mutex Methods Object\n**\n** An instance of this structure defines the low-level routines\n** used to allocate and use mutexes.\n**\n** Usually, the default mutex implementations provided by SQLite are\n** sufficient, however the user has the option of substituting a custom\n** implementation for specialized deployments or systems for which SQLite\n** does not provide a suitable implementation. In this case, the user\n** creates and populates an instance of this structure to pass\n** to sqlite3_config() along with the [SQLITE_CONFIG_MUTEX] option.\n** Additionally, an instance of this structure can be used as an\n** output variable when querying the system for the current mutex\n** implementation, using the [SQLITE_CONFIG_GETMUTEX] option.\n**\n** ^The xMutexInit method defined by this structure is invoked as\n** part of system initialization by the sqlite3_initialize() function.\n** ^The xMutexInit routine is called by SQLite exactly once for each\n** effective call to [sqlite3_initialize()].\n**\n** ^The xMutexEnd method defined by this structure is invoked as\n** part of system shutdown by the sqlite3_shutdown() function. The\n** implementation of this method is expected to release all outstanding\n** resources obtained by the mutex methods implementation, especially\n** those obtained by the xMutexInit method.  ^The xMutexEnd()\n** interface is invoked exactly once for each call to [sqlite3_shutdown()].\n**\n** ^(The remaining seven methods defined by this structure (xMutexAlloc,\n** xMutexFree, xMutexEnter, xMutexTry, xMutexLeave, xMutexHeld and\n** xMutexNotheld) implement the following interfaces (respectively):\n**\n** <ul>\n**   <li>  [sqlite3_mutex_alloc()] </li>\n**   <li>  [sqlite3_mutex_free()] </li>\n**   <li>  [sqlite3_mutex_enter()] </li>\n**   <li>  [sqlite3_mutex_try()] </li>\n**   <li>  [sqlite3_mutex_leave()] </li>\n**   <li>  [sqlite3_mutex_held()] </li>\n**   <li>  [sqlite3_mutex_notheld()] </li>\n** </ul>)^\n**\n** The only difference is that the public sqlite3_XXX functions enumerated\n** above silently ignore any invocations that pass a NULL pointer instead\n** of a valid mutex handle. The implementations of the methods defined\n** by this structure are not required to handle this case, the results\n** of passing a NULL pointer instead of a valid mutex handle are undefined\n** (i.e. it is acceptable to provide an implementation that segfaults if\n** it is passed a NULL pointer).\n**\n** The xMutexInit() method must be threadsafe.  ^It must be harmless to\n** invoke xMutexInit() multiple times within the same process and without\n** intervening calls to xMutexEnd().  Second and subsequent calls to\n** xMutexInit() must be no-ops.\n**\n** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]\n** and its associates).  ^Similarly, xMutexAlloc() must not use SQLite memory\n** allocation for a static mutex.  ^However xMutexAlloc() may use SQLite\n** memory allocation for a fast or recursive mutex.\n**\n** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is\n** called, but only if the prior call to xMutexInit returned SQLITE_OK.\n** If xMutexInit fails in any way, it is expected to clean up after itself\n** prior to returning.\n*/\ntypedef struct sqlite3_mutex_methods sqlite3_mutex_methods;\nstruct sqlite3_mutex_methods {\n  int (*xMutexInit)(void);\n  int (*xMutexEnd)(void);\n  sqlite3_mutex *(*xMutexAlloc)(int);\n  void (*xMutexFree)(sqlite3_mutex *);\n  void (*xMutexEnter)(sqlite3_mutex *);\n  int (*xMutexTry)(sqlite3_mutex *);\n  void (*xMutexLeave)(sqlite3_mutex *);\n  int (*xMutexHeld)(sqlite3_mutex *);\n  int (*xMutexNotheld)(sqlite3_mutex *);\n};\n\n/*\n** CAPI3REF: Mutex Verification Routines\n**\n** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines\n** are intended for use inside assert() statements.  ^The SQLite core\n** never uses these routines except inside an assert() and applications\n** are advised to follow the lead of the core.  ^The SQLite core only\n** provides implementations for these routines when it is compiled\n** with the SQLITE_DEBUG flag.  ^External mutex implementations\n** are only required to provide these routines if SQLITE_DEBUG is\n** defined and if NDEBUG is not defined.\n**\n** ^These routines should return true if the mutex in their argument\n** is held or not held, respectively, by the calling thread.\n**\n** ^The implementation is not required to provide versions of these\n** routines that actually work. If the implementation does not provide working\n** versions of these routines, it should at least provide stubs that always\n** return true so that one does not get spurious assertion failures.\n**\n** ^If the argument to sqlite3_mutex_held() is a NULL pointer then\n** the routine should return 1.   This seems counter-intuitive since\n** clearly the mutex cannot be held if it does not exist.  But\n** the reason the mutex does not exist is because the build is not\n** using mutexes.  And we do not want the assert() containing the\n** call to sqlite3_mutex_held() to fail, so a non-zero return is\n** the appropriate thing to do.  ^The sqlite3_mutex_notheld()\n** interface should also return 1 when given a NULL pointer.\n*/\n#ifndef NDEBUG\nSQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);\nSQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);\n#endif\n\n/*\n** CAPI3REF: Mutex Types\n**\n** The [sqlite3_mutex_alloc()] interface takes a single argument\n** which is one of these integer constants.\n**\n** The set of static mutexes may change from one SQLite release to the\n** next.  Applications that override the built-in mutex logic must be\n** prepared to accommodate additional static mutexes.\n*/\n#define SQLITE_MUTEX_FAST             0\n#define SQLITE_MUTEX_RECURSIVE        1\n#define SQLITE_MUTEX_STATIC_MASTER    2\n#define SQLITE_MUTEX_STATIC_MEM       3  /* sqlite3_malloc() */\n#define SQLITE_MUTEX_STATIC_MEM2      4  /* NOT USED */\n#define SQLITE_MUTEX_STATIC_OPEN      4  /* sqlite3BtreeOpen() */\n#define SQLITE_MUTEX_STATIC_PRNG      5  /* sqlite3_random() */\n#define SQLITE_MUTEX_STATIC_LRU       6  /* lru page list */\n#define SQLITE_MUTEX_STATIC_LRU2      7  /* NOT USED */\n#define SQLITE_MUTEX_STATIC_PMEM      7  /* sqlite3PageMalloc() */\n\n/*\n** CAPI3REF: Retrieve the mutex for a database connection\n**\n** ^This interface returns a pointer the [sqlite3_mutex] object that \n** serializes access to the [database connection] given in the argument\n** when the [threading mode] is Serialized.\n** ^If the [threading mode] is Single-thread or Multi-thread then this\n** routine returns a NULL pointer.\n*/\nSQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);\n\n/*\n** CAPI3REF: Low-Level Control Of Database Files\n**\n** ^The [sqlite3_file_control()] interface makes a direct call to the\n** xFileControl method for the [sqlite3_io_methods] object associated\n** with a particular database identified by the second argument. ^The\n** name of the database is \"main\" for the main database or \"temp\" for the\n** TEMP database, or the name that appears after the AS keyword for\n** databases that are added using the [ATTACH] SQL command.\n** ^A NULL pointer can be used in place of \"main\" to refer to the\n** main database file.\n** ^The third and fourth parameters to this routine\n** are passed directly through to the second and third parameters of\n** the xFileControl method.  ^The return value of the xFileControl\n** method becomes the return value of this routine.\n**\n** ^The SQLITE_FCNTL_FILE_POINTER value for the op parameter causes\n** a pointer to the underlying [sqlite3_file] object to be written into\n** the space pointed to by the 4th parameter.  ^The SQLITE_FCNTL_FILE_POINTER\n** case is a short-circuit path which does not actually invoke the\n** underlying sqlite3_io_methods.xFileControl method.\n**\n** ^If the second parameter (zDbName) does not match the name of any\n** open database file, then SQLITE_ERROR is returned.  ^This error\n** code is not remembered and will not be recalled by [sqlite3_errcode()]\n** or [sqlite3_errmsg()].  The underlying xFileControl method might\n** also return SQLITE_ERROR.  There is no way to distinguish between\n** an incorrect zDbName and an SQLITE_ERROR return from the underlying\n** xFileControl method.\n**\n** See also: [SQLITE_FCNTL_LOCKSTATE]\n*/\nSQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*);\n\n/*\n** CAPI3REF: Testing Interface\n**\n** ^The sqlite3_test_control() interface is used to read out internal\n** state of SQLite and to inject faults into SQLite for testing\n** purposes.  ^The first parameter is an operation code that determines\n** the number, meaning, and operation of all subsequent parameters.\n**\n** This interface is not for use by applications.  It exists solely\n** for verifying the correct operation of the SQLite library.  Depending\n** on how the SQLite library is compiled, this interface might not exist.\n**\n** The details of the operation codes, their meanings, the parameters\n** they take, and what they do are all subject to change without notice.\n** Unlike most of the SQLite API, this function is not guaranteed to\n** operate consistently from one release to the next.\n*/\nSQLITE_API int sqlite3_test_control(int op, ...);\n\n/*\n** CAPI3REF: Testing Interface Operation Codes\n**\n** These constants are the valid operation code parameters used\n** as the first argument to [sqlite3_test_control()].\n**\n** These parameters and their meanings are subject to change\n** without notice.  These values are for testing purposes only.\n** Applications should not use any of these parameters or the\n** [sqlite3_test_control()] interface.\n*/\n#define SQLITE_TESTCTRL_FIRST                    5\n#define SQLITE_TESTCTRL_PRNG_SAVE                5\n#define SQLITE_TESTCTRL_PRNG_RESTORE             6\n#define SQLITE_TESTCTRL_PRNG_RESET               7\n#define SQLITE_TESTCTRL_BITVEC_TEST              8\n#define SQLITE_TESTCTRL_FAULT_INSTALL            9\n#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS     10\n#define SQLITE_TESTCTRL_PENDING_BYTE            11\n#define SQLITE_TESTCTRL_ASSERT                  12\n#define SQLITE_TESTCTRL_ALWAYS                  13\n#define SQLITE_TESTCTRL_RESERVE                 14\n#define SQLITE_TESTCTRL_OPTIMIZATIONS           15\n#define SQLITE_TESTCTRL_ISKEYWORD               16\n#define SQLITE_TESTCTRL_SCRATCHMALLOC           17\n#define SQLITE_TESTCTRL_LOCALTIME_FAULT         18\n#define SQLITE_TESTCTRL_EXPLAIN_STMT            19\n#define SQLITE_TESTCTRL_LAST                    19\n\n/*\n** CAPI3REF: SQLite Runtime Status\n**\n** ^This interface is used to retrieve runtime status information\n** about the performance of SQLite, and optionally to reset various\n** highwater marks.  ^The first argument is an integer code for\n** the specific parameter to measure.  ^(Recognized integer codes\n** are of the form [status parameters | SQLITE_STATUS_...].)^\n** ^The current value of the parameter is returned into *pCurrent.\n** ^The highest recorded value is returned in *pHighwater.  ^If the\n** resetFlag is true, then the highest record value is reset after\n** *pHighwater is written.  ^(Some parameters do not record the highest\n** value.  For those parameters\n** nothing is written into *pHighwater and the resetFlag is ignored.)^\n** ^(Other parameters record only the highwater mark and not the current\n** value.  For these latter parameters nothing is written into *pCurrent.)^\n**\n** ^The sqlite3_status() routine returns SQLITE_OK on success and a\n** non-zero [error code] on failure.\n**\n** This routine is threadsafe but is not atomic.  This routine can be\n** called while other threads are running the same or different SQLite\n** interfaces.  However the values returned in *pCurrent and\n** *pHighwater reflect the status of SQLite at different points in time\n** and it is possible that another thread might change the parameter\n** in between the times when *pCurrent and *pHighwater are written.\n**\n** See also: [sqlite3_db_status()]\n*/\nSQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag);\n\n\n/*\n** CAPI3REF: Status Parameters\n** KEYWORDS: {status parameters}\n**\n** These integer constants designate various run-time status parameters\n** that can be returned by [sqlite3_status()].\n**\n** <dl>\n** [[SQLITE_STATUS_MEMORY_USED]] ^(<dt>SQLITE_STATUS_MEMORY_USED</dt>\n** <dd>This parameter is the current amount of memory checked out\n** using [sqlite3_malloc()], either directly or indirectly.  The\n** figure includes calls made to [sqlite3_malloc()] by the application\n** and internal memory usage by the SQLite library.  Scratch memory\n** controlled by [SQLITE_CONFIG_SCRATCH] and auxiliary page-cache\n** memory controlled by [SQLITE_CONFIG_PAGECACHE] is not included in\n** this parameter.  The amount returned is the sum of the allocation\n** sizes as reported by the xSize method in [sqlite3_mem_methods].</dd>)^\n**\n** [[SQLITE_STATUS_MALLOC_SIZE]] ^(<dt>SQLITE_STATUS_MALLOC_SIZE</dt>\n** <dd>This parameter records the largest memory allocation request\n** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their\n** internal equivalents).  Only the value returned in the\n** *pHighwater parameter to [sqlite3_status()] is of interest.  \n** The value written into the *pCurrent parameter is undefined.</dd>)^\n**\n** [[SQLITE_STATUS_MALLOC_COUNT]] ^(<dt>SQLITE_STATUS_MALLOC_COUNT</dt>\n** <dd>This parameter records the number of separate memory allocations\n** currently checked out.</dd>)^\n**\n** [[SQLITE_STATUS_PAGECACHE_USED]] ^(<dt>SQLITE_STATUS_PAGECACHE_USED</dt>\n** <dd>This parameter returns the number of pages used out of the\n** [pagecache memory allocator] that was configured using \n** [SQLITE_CONFIG_PAGECACHE].  The\n** value returned is in pages, not in bytes.</dd>)^\n**\n** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] \n** ^(<dt>SQLITE_STATUS_PAGECACHE_OVERFLOW</dt>\n** <dd>This parameter returns the number of bytes of page cache\n** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE]\n** buffer and where forced to overflow to [sqlite3_malloc()].  The\n** returned value includes allocations that overflowed because they\n** where too large (they were larger than the \"sz\" parameter to\n** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because\n** no space was left in the page cache.</dd>)^\n**\n** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(<dt>SQLITE_STATUS_PAGECACHE_SIZE</dt>\n** <dd>This parameter records the largest memory allocation request\n** handed to [pagecache memory allocator].  Only the value returned in the\n** *pHighwater parameter to [sqlite3_status()] is of interest.  \n** The value written into the *pCurrent parameter is undefined.</dd>)^\n**\n** [[SQLITE_STATUS_SCRATCH_USED]] ^(<dt>SQLITE_STATUS_SCRATCH_USED</dt>\n** <dd>This parameter returns the number of allocations used out of the\n** [scratch memory allocator] configured using\n** [SQLITE_CONFIG_SCRATCH].  The value returned is in allocations, not\n** in bytes.  Since a single thread may only have one scratch allocation\n** outstanding at time, this parameter also reports the number of threads\n** using scratch memory at the same time.</dd>)^\n**\n** [[SQLITE_STATUS_SCRATCH_OVERFLOW]] ^(<dt>SQLITE_STATUS_SCRATCH_OVERFLOW</dt>\n** <dd>This parameter returns the number of bytes of scratch memory\n** allocation which could not be satisfied by the [SQLITE_CONFIG_SCRATCH]\n** buffer and where forced to overflow to [sqlite3_malloc()].  The values\n** returned include overflows because the requested allocation was too\n** larger (that is, because the requested allocation was larger than the\n** \"sz\" parameter to [SQLITE_CONFIG_SCRATCH]) and because no scratch buffer\n** slots were available.\n** </dd>)^\n**\n** [[SQLITE_STATUS_SCRATCH_SIZE]] ^(<dt>SQLITE_STATUS_SCRATCH_SIZE</dt>\n** <dd>This parameter records the largest memory allocation request\n** handed to [scratch memory allocator].  Only the value returned in the\n** *pHighwater parameter to [sqlite3_status()] is of interest.  \n** The value written into the *pCurrent parameter is undefined.</dd>)^\n**\n** [[SQLITE_STATUS_PARSER_STACK]] ^(<dt>SQLITE_STATUS_PARSER_STACK</dt>\n** <dd>This parameter records the deepest parser stack.  It is only\n** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].</dd>)^\n** </dl>\n**\n** New status parameters may be added from time to time.\n*/\n#define SQLITE_STATUS_MEMORY_USED          0\n#define SQLITE_STATUS_PAGECACHE_USED       1\n#define SQLITE_STATUS_PAGECACHE_OVERFLOW   2\n#define SQLITE_STATUS_SCRATCH_USED         3\n#define SQLITE_STATUS_SCRATCH_OVERFLOW     4\n#define SQLITE_STATUS_MALLOC_SIZE          5\n#define SQLITE_STATUS_PARSER_STACK         6\n#define SQLITE_STATUS_PAGECACHE_SIZE       7\n#define SQLITE_STATUS_SCRATCH_SIZE         8\n#define SQLITE_STATUS_MALLOC_COUNT         9\n\n/*\n** CAPI3REF: Database Connection Status\n**\n** ^This interface is used to retrieve runtime status information \n** about a single [database connection].  ^The first argument is the\n** database connection object to be interrogated.  ^The second argument\n** is an integer constant, taken from the set of\n** [SQLITE_DBSTATUS options], that\n** determines the parameter to interrogate.  The set of \n** [SQLITE_DBSTATUS options] is likely\n** to grow in future releases of SQLite.\n**\n** ^The current value of the requested parameter is written into *pCur\n** and the highest instantaneous value is written into *pHiwtr.  ^If\n** the resetFlg is true, then the highest instantaneous value is\n** reset back down to the current value.\n**\n** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a\n** non-zero [error code] on failure.\n**\n** See also: [sqlite3_status()] and [sqlite3_stmt_status()].\n*/\nSQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);\n\n/*\n** CAPI3REF: Status Parameters for database connections\n** KEYWORDS: {SQLITE_DBSTATUS options}\n**\n** These constants are the available integer \"verbs\" that can be passed as\n** the second argument to the [sqlite3_db_status()] interface.\n**\n** New verbs may be added in future releases of SQLite. Existing verbs\n** might be discontinued. Applications should check the return code from\n** [sqlite3_db_status()] to make sure that the call worked.\n** The [sqlite3_db_status()] interface will return a non-zero error code\n** if a discontinued or unsupported verb is invoked.\n**\n** <dl>\n** [[SQLITE_DBSTATUS_LOOKASIDE_USED]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_USED</dt>\n** <dd>This parameter returns the number of lookaside memory slots currently\n** checked out.</dd>)^\n**\n** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt>\n** <dd>This parameter returns the number malloc attempts that were \n** satisfied using lookaside memory. Only the high-water value is meaningful;\n** the current value is always zero.)^\n**\n** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]]\n** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt>\n** <dd>This parameter returns the number malloc attempts that might have\n** been satisfied using lookaside memory but failed due to the amount of\n** memory requested being larger than the lookaside slot size.\n** Only the high-water value is meaningful;\n** the current value is always zero.)^\n**\n** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]]\n** ^(<dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt>\n** <dd>This parameter returns the number malloc attempts that might have\n** been satisfied using lookaside memory but failed due to all lookaside\n** memory already being in use.\n** Only the high-water value is meaningful;\n** the current value is always zero.)^\n**\n** [[SQLITE_DBSTATUS_CACHE_USED]] ^(<dt>SQLITE_DBSTATUS_CACHE_USED</dt>\n** <dd>This parameter returns the approximate number of of bytes of heap\n** memory used by all pager caches associated with the database connection.)^\n** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.\n**\n** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(<dt>SQLITE_DBSTATUS_SCHEMA_USED</dt>\n** <dd>This parameter returns the approximate number of of bytes of heap\n** memory used to store the schema for all databases associated\n** with the connection - main, temp, and any [ATTACH]-ed databases.)^ \n** ^The full amount of memory used by the schemas is reported, even if the\n** schema memory is shared with other database connections due to\n** [shared cache mode] being enabled.\n** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0.\n**\n** [[SQLITE_DBSTATUS_STMT_USED]] ^(<dt>SQLITE_DBSTATUS_STMT_USED</dt>\n** <dd>This parameter returns the approximate number of of bytes of heap\n** and lookaside memory used by all prepared statements associated with\n** the database connection.)^\n** ^The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.\n** </dd>\n**\n** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(<dt>SQLITE_DBSTATUS_CACHE_HIT</dt>\n** <dd>This parameter returns the number of pager cache hits that have\n** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT \n** is always 0.\n** </dd>\n**\n** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(<dt>SQLITE_DBSTATUS_CACHE_MISS</dt>\n** <dd>This parameter returns the number of pager cache misses that have\n** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS \n** is always 0.\n** </dd>\n**\n** [[SQLITE_DBSTATUS_CACHE_WRITE]] ^(<dt>SQLITE_DBSTATUS_CACHE_WRITE</dt>\n** <dd>This parameter returns the number of dirty cache entries that have\n** been written to disk. Specifically, the number of pages written to the\n** wal file in wal mode databases, or the number of pages written to the\n** database file in rollback mode databases. Any pages written as part of\n** transaction rollback or database recovery operations are not included.\n** If an IO or other error occurs while writing a page to disk, the effect\n** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The\n** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0.\n** </dd>\n** </dl>\n*/\n#define SQLITE_DBSTATUS_LOOKASIDE_USED       0\n#define SQLITE_DBSTATUS_CACHE_USED           1\n#define SQLITE_DBSTATUS_SCHEMA_USED          2\n#define SQLITE_DBSTATUS_STMT_USED            3\n#define SQLITE_DBSTATUS_LOOKASIDE_HIT        4\n#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE  5\n#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL  6\n#define SQLITE_DBSTATUS_CACHE_HIT            7\n#define SQLITE_DBSTATUS_CACHE_MISS           8\n#define SQLITE_DBSTATUS_CACHE_WRITE          9\n#define SQLITE_DBSTATUS_MAX                  9   /* Largest defined DBSTATUS */\n\n\n/*\n** CAPI3REF: Prepared Statement Status\n**\n** ^(Each prepared statement maintains various\n** [SQLITE_STMTSTATUS counters] that measure the number\n** of times it has performed specific operations.)^  These counters can\n** be used to monitor the performance characteristics of the prepared\n** statements.  For example, if the number of table steps greatly exceeds\n** the number of table searches or result rows, that would tend to indicate\n** that the prepared statement is using a full table scan rather than\n** an index.  \n**\n** ^(This interface is used to retrieve and reset counter values from\n** a [prepared statement].  The first argument is the prepared statement\n** object to be interrogated.  The second argument\n** is an integer code for a specific [SQLITE_STMTSTATUS counter]\n** to be interrogated.)^\n** ^The current value of the requested counter is returned.\n** ^If the resetFlg is true, then the counter is reset to zero after this\n** interface call returns.\n**\n** See also: [sqlite3_status()] and [sqlite3_db_status()].\n*/\nSQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);\n\n/*\n** CAPI3REF: Status Parameters for prepared statements\n** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters}\n**\n** These preprocessor macros define integer codes that name counter\n** values associated with the [sqlite3_stmt_status()] interface.\n** The meanings of the various counters are as follows:\n**\n** <dl>\n** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]] <dt>SQLITE_STMTSTATUS_FULLSCAN_STEP</dt>\n** <dd>^This is the number of times that SQLite has stepped forward in\n** a table as part of a full table scan.  Large numbers for this counter\n** may indicate opportunities for performance improvement through \n** careful use of indices.</dd>\n**\n** [[SQLITE_STMTSTATUS_SORT]] <dt>SQLITE_STMTSTATUS_SORT</dt>\n** <dd>^This is the number of sort operations that have occurred.\n** A non-zero value in this counter may indicate an opportunity to\n** improvement performance through careful use of indices.</dd>\n**\n** [[SQLITE_STMTSTATUS_AUTOINDEX]] <dt>SQLITE_STMTSTATUS_AUTOINDEX</dt>\n** <dd>^This is the number of rows inserted into transient indices that\n** were created automatically in order to help joins run faster.\n** A non-zero value in this counter may indicate an opportunity to\n** improvement performance by adding permanent indices that do not\n** need to be reinitialized each time the statement is run.</dd>\n** </dl>\n*/\n#define SQLITE_STMTSTATUS_FULLSCAN_STEP     1\n#define SQLITE_STMTSTATUS_SORT              2\n#define SQLITE_STMTSTATUS_AUTOINDEX         3\n\n/*\n** CAPI3REF: Custom Page Cache Object\n**\n** The sqlite3_pcache type is opaque.  It is implemented by\n** the pluggable module.  The SQLite core has no knowledge of\n** its size or internal structure and never deals with the\n** sqlite3_pcache object except by holding and passing pointers\n** to the object.\n**\n** See [sqlite3_pcache_methods2] for additional information.\n*/\ntypedef struct sqlite3_pcache sqlite3_pcache;\n\n/*\n** CAPI3REF: Custom Page Cache Object\n**\n** The sqlite3_pcache_page object represents a single page in the\n** page cache.  The page cache will allocate instances of this\n** object.  Various methods of the page cache use pointers to instances\n** of this object as parameters or as their return value.\n**\n** See [sqlite3_pcache_methods2] for additional information.\n*/\ntypedef struct sqlite3_pcache_page sqlite3_pcache_page;\nstruct sqlite3_pcache_page {\n  void *pBuf;        /* The content of the page */\n  void *pExtra;      /* Extra information associated with the page */\n};\n\n/*\n** CAPI3REF: Application Defined Page Cache.\n** KEYWORDS: {page cache}\n**\n** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can\n** register an alternative page cache implementation by passing in an \n** instance of the sqlite3_pcache_methods2 structure.)^\n** In many applications, most of the heap memory allocated by \n** SQLite is used for the page cache.\n** By implementing a \n** custom page cache using this API, an application can better control\n** the amount of memory consumed by SQLite, the way in which \n** that memory is allocated and released, and the policies used to \n** determine exactly which parts of a database file are cached and for \n** how long.\n**\n** The alternative page cache mechanism is an\n** extreme measure that is only needed by the most demanding applications.\n** The built-in page cache is recommended for most uses.\n**\n** ^(The contents of the sqlite3_pcache_methods2 structure are copied to an\n** internal buffer by SQLite within the call to [sqlite3_config].  Hence\n** the application may discard the parameter after the call to\n** [sqlite3_config()] returns.)^\n**\n** [[the xInit() page cache method]]\n** ^(The xInit() method is called once for each effective \n** call to [sqlite3_initialize()])^\n** (usually only once during the lifetime of the process). ^(The xInit()\n** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^\n** The intent of the xInit() method is to set up global data structures \n** required by the custom page cache implementation. \n** ^(If the xInit() method is NULL, then the \n** built-in default page cache is used instead of the application defined\n** page cache.)^\n**\n** [[the xShutdown() page cache method]]\n** ^The xShutdown() method is called by [sqlite3_shutdown()].\n** It can be used to clean up \n** any outstanding resources before process shutdown, if required.\n** ^The xShutdown() method may be NULL.\n**\n** ^SQLite automatically serializes calls to the xInit method,\n** so the xInit method need not be threadsafe.  ^The\n** xShutdown method is only called from [sqlite3_shutdown()] so it does\n** not need to be threadsafe either.  All other methods must be threadsafe\n** in multithreaded applications.\n**\n** ^SQLite will never invoke xInit() more than once without an intervening\n** call to xShutdown().\n**\n** [[the xCreate() page cache methods]]\n** ^SQLite invokes the xCreate() method to construct a new cache instance.\n** SQLite will typically create one cache instance for each open database file,\n** though this is not guaranteed. ^The\n** first parameter, szPage, is the size in bytes of the pages that must\n** be allocated by the cache.  ^szPage will always a power of two.  ^The\n** second parameter szExtra is a number of bytes of extra storage \n** associated with each page cache entry.  ^The szExtra parameter will\n** a number less than 250.  SQLite will use the\n** extra szExtra bytes on each page to store metadata about the underlying\n** database page on disk.  The value passed into szExtra depends\n** on the SQLite version, the target platform, and how SQLite was compiled.\n** ^The third argument to xCreate(), bPurgeable, is true if the cache being\n** created will be used to cache database pages of a file stored on disk, or\n** false if it is used for an in-memory database. The cache implementation\n** does not have to do anything special based with the value of bPurgeable;\n** it is purely advisory.  ^On a cache where bPurgeable is false, SQLite will\n** never invoke xUnpin() except to deliberately delete a page.\n** ^In other words, calls to xUnpin() on a cache with bPurgeable set to\n** false will always have the \"discard\" flag set to true.  \n** ^Hence, a cache created with bPurgeable false will\n** never contain any unpinned pages.\n**\n** [[the xCachesize() page cache method]]\n** ^(The xCachesize() method may be called at any time by SQLite to set the\n** suggested maximum cache-size (number of pages stored by) the cache\n** instance passed as the first argument. This is the value configured using\n** the SQLite \"[PRAGMA cache_size]\" command.)^  As with the bPurgeable\n** parameter, the implementation is not required to do anything with this\n** value; it is advisory only.\n**\n** [[the xPagecount() page cache methods]]\n** The xPagecount() method must return the number of pages currently\n** stored in the cache, both pinned and unpinned.\n** \n** [[the xFetch() page cache methods]]\n** The xFetch() method locates a page in the cache and returns a pointer to \n** an sqlite3_pcache_page object associated with that page, or a NULL pointer.\n** The pBuf element of the returned sqlite3_pcache_page object will be a\n** pointer to a buffer of szPage bytes used to store the content of a \n** single database page.  The pExtra element of sqlite3_pcache_page will be\n** a pointer to the szExtra bytes of extra storage that SQLite has requested\n** for each entry in the page cache.\n**\n** The page to be fetched is determined by the key. ^The minimum key value\n** is 1.  After it has been retrieved using xFetch, the page is considered\n** to be \"pinned\".\n**\n** If the requested page is already in the page cache, then the page cache\n** implementation must return a pointer to the page buffer with its content\n** intact.  If the requested page is not already in the cache, then the\n** cache implementation should use the value of the createFlag\n** parameter to help it determined what action to take:\n**\n** <table border=1 width=85% align=center>\n** <tr><th> createFlag <th> Behaviour when page is not already in cache\n** <tr><td> 0 <td> Do not allocate a new page.  Return NULL.\n** <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.\n**                 Otherwise return NULL.\n** <tr><td> 2 <td> Make every effort to allocate a new page.  Only return\n**                 NULL if allocating a new page is effectively impossible.\n** </table>\n**\n** ^(SQLite will normally invoke xFetch() with a createFlag of 0 or 1.  SQLite\n** will only use a createFlag of 2 after a prior call with a createFlag of 1\n** failed.)^  In between the to xFetch() calls, SQLite may\n** attempt to unpin one or more cache pages by spilling the content of\n** pinned pages to disk and synching the operating system disk cache.\n**\n** [[the xUnpin() page cache method]]\n** ^xUnpin() is called by SQLite with a pointer to a currently pinned page\n** as its second argument.  If the third parameter, discard, is non-zero,\n** then the page must be evicted from the cache.\n** ^If the discard parameter is\n** zero, then the page may be discarded or retained at the discretion of\n** page cache implementation. ^The page cache implementation\n** may choose to evict unpinned pages at any time.\n**\n** The cache must not perform any reference counting. A single \n** call to xUnpin() unpins the page regardless of the number of prior calls \n** to xFetch().\n**\n** [[the xRekey() page cache methods]]\n** The xRekey() method is used to change the key value associated with the\n** page passed as the second argument. If the cache\n** previously contains an entry associated with newKey, it must be\n** discarded. ^Any prior cache entry associated with newKey is guaranteed not\n** to be pinned.\n**\n** When SQLite calls the xTruncate() method, the cache must discard all\n** existing cache entries with page numbers (keys) greater than or equal\n** to the value of the iLimit parameter passed to xTruncate(). If any\n** of these pages are pinned, they are implicitly unpinned, meaning that\n** they can be safely discarded.\n**\n** [[the xDestroy() page cache method]]\n** ^The xDestroy() method is used to delete a cache allocated by xCreate().\n** All resources associated with the specified cache should be freed. ^After\n** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]\n** handle invalid, and will not use it with any other sqlite3_pcache_methods2\n** functions.\n**\n** [[the xShrink() page cache method]]\n** ^SQLite invokes the xShrink() method when it wants the page cache to\n** free up as much of heap memory as possible.  The page cache implementation\n** is not obligated to free any memory, but well-behaved implementations should\n** do their best.\n*/\ntypedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2;\nstruct sqlite3_pcache_methods2 {\n  int iVersion;\n  void *pArg;\n  int (*xInit)(void*);\n  void (*xShutdown)(void*);\n  sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable);\n  void (*xCachesize)(sqlite3_pcache*, int nCachesize);\n  int (*xPagecount)(sqlite3_pcache*);\n  sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);\n  void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard);\n  void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, \n      unsigned oldKey, unsigned newKey);\n  void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);\n  void (*xDestroy)(sqlite3_pcache*);\n  void (*xShrink)(sqlite3_pcache*);\n};\n\n/*\n** This is the obsolete pcache_methods object that has now been replaced\n** by sqlite3_pcache_methods2.  This object is not used by SQLite.  It is\n** retained in the header file for backwards compatibility only.\n*/\ntypedef struct sqlite3_pcache_methods sqlite3_pcache_methods;\nstruct sqlite3_pcache_methods {\n  void *pArg;\n  int (*xInit)(void*);\n  void (*xShutdown)(void*);\n  sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable);\n  void (*xCachesize)(sqlite3_pcache*, int nCachesize);\n  int (*xPagecount)(sqlite3_pcache*);\n  void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag);\n  void (*xUnpin)(sqlite3_pcache*, void*, int discard);\n  void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey);\n  void (*xTruncate)(sqlite3_pcache*, unsigned iLimit);\n  void (*xDestroy)(sqlite3_pcache*);\n};\n\n\n/*\n** CAPI3REF: Online Backup Object\n**\n** The sqlite3_backup object records state information about an ongoing\n** online backup operation.  ^The sqlite3_backup object is created by\n** a call to [sqlite3_backup_init()] and is destroyed by a call to\n** [sqlite3_backup_finish()].\n**\n** See Also: [Using the SQLite Online Backup API]\n*/\ntypedef struct sqlite3_backup sqlite3_backup;\n\n/*\n** CAPI3REF: Online Backup API.\n**\n** The backup API copies the content of one database into another.\n** It is useful either for creating backups of databases or\n** for copying in-memory databases to or from persistent files. \n**\n** See Also: [Using the SQLite Online Backup API]\n**\n** ^SQLite holds a write transaction open on the destination database file\n** for the duration of the backup operation.\n** ^The source database is read-locked only while it is being read;\n** it is not locked continuously for the entire backup operation.\n** ^Thus, the backup may be performed on a live source database without\n** preventing other database connections from\n** reading or writing to the source database while the backup is underway.\n** \n** ^(To perform a backup operation: \n**   <ol>\n**     <li><b>sqlite3_backup_init()</b> is called once to initialize the\n**         backup, \n**     <li><b>sqlite3_backup_step()</b> is called one or more times to transfer \n**         the data between the two databases, and finally\n**     <li><b>sqlite3_backup_finish()</b> is called to release all resources \n**         associated with the backup operation. \n**   </ol>)^\n** There should be exactly one call to sqlite3_backup_finish() for each\n** successful call to sqlite3_backup_init().\n**\n** [[sqlite3_backup_init()]] <b>sqlite3_backup_init()</b>\n**\n** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the \n** [database connection] associated with the destination database \n** and the database name, respectively.\n** ^The database name is \"main\" for the main database, \"temp\" for the\n** temporary database, or the name specified after the AS keyword in\n** an [ATTACH] statement for an attached database.\n** ^The S and M arguments passed to \n** sqlite3_backup_init(D,N,S,M) identify the [database connection]\n** and database name of the source database, respectively.\n** ^The source and destination [database connections] (parameters S and D)\n** must be different or else sqlite3_backup_init(D,N,S,M) will fail with\n** an error.\n**\n** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is\n** returned and an error code and error message are stored in the\n** destination [database connection] D.\n** ^The error code and message for the failed call to sqlite3_backup_init()\n** can be retrieved using the [sqlite3_errcode()], [sqlite3_errmsg()], and/or\n** [sqlite3_errmsg16()] functions.\n** ^A successful call to sqlite3_backup_init() returns a pointer to an\n** [sqlite3_backup] object.\n** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and\n** sqlite3_backup_finish() functions to perform the specified backup \n** operation.\n**\n** [[sqlite3_backup_step()]] <b>sqlite3_backup_step()</b>\n**\n** ^Function sqlite3_backup_step(B,N) will copy up to N pages between \n** the source and destination databases specified by [sqlite3_backup] object B.\n** ^If N is negative, all remaining source pages are copied. \n** ^If sqlite3_backup_step(B,N) successfully copies N pages and there\n** are still more pages to be copied, then the function returns [SQLITE_OK].\n** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages\n** from source to destination, then it returns [SQLITE_DONE].\n** ^If an error occurs while running sqlite3_backup_step(B,N),\n** then an [error code] is returned. ^As well as [SQLITE_OK] and\n** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY],\n** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an\n** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code.\n**\n** ^(The sqlite3_backup_step() might return [SQLITE_READONLY] if\n** <ol>\n** <li> the destination database was opened read-only, or\n** <li> the destination database is using write-ahead-log journaling\n** and the destination and source page sizes differ, or\n** <li> the destination database is an in-memory database and the\n** destination and source page sizes differ.\n** </ol>)^\n**\n** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then\n** the [sqlite3_busy_handler | busy-handler function]\n** is invoked (if one is specified). ^If the \n** busy-handler returns non-zero before the lock is available, then \n** [SQLITE_BUSY] is returned to the caller. ^In this case the call to\n** sqlite3_backup_step() can be retried later. ^If the source\n** [database connection]\n** is being used to write to the source database when sqlite3_backup_step()\n** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this\n** case the call to sqlite3_backup_step() can be retried later on. ^(If\n** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or\n** [SQLITE_READONLY] is returned, then \n** there is no point in retrying the call to sqlite3_backup_step(). These \n** errors are considered fatal.)^  The application must accept \n** that the backup operation has failed and pass the backup operation handle \n** to the sqlite3_backup_finish() to release associated resources.\n**\n** ^The first call to sqlite3_backup_step() obtains an exclusive lock\n** on the destination file. ^The exclusive lock is not released until either \n** sqlite3_backup_finish() is called or the backup operation is complete \n** and sqlite3_backup_step() returns [SQLITE_DONE].  ^Every call to\n** sqlite3_backup_step() obtains a [shared lock] on the source database that\n** lasts for the duration of the sqlite3_backup_step() call.\n** ^Because the source database is not locked between calls to\n** sqlite3_backup_step(), the source database may be modified mid-way\n** through the backup process.  ^If the source database is modified by an\n** external process or via a database connection other than the one being\n** used by the backup operation, then the backup will be automatically\n** restarted by the next call to sqlite3_backup_step(). ^If the source \n** database is modified by the using the same database connection as is used\n** by the backup operation, then the backup database is automatically\n** updated at the same time.\n**\n** [[sqlite3_backup_finish()]] <b>sqlite3_backup_finish()</b>\n**\n** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the \n** application wishes to abandon the backup operation, the application\n** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish().\n** ^The sqlite3_backup_finish() interfaces releases all\n** resources associated with the [sqlite3_backup] object. \n** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any\n** active write-transaction on the destination database is rolled back.\n** The [sqlite3_backup] object is invalid\n** and may not be used following a call to sqlite3_backup_finish().\n**\n** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no\n** sqlite3_backup_step() errors occurred, regardless or whether or not\n** sqlite3_backup_step() completed.\n** ^If an out-of-memory condition or IO error occurred during any prior\n** sqlite3_backup_step() call on the same [sqlite3_backup] object, then\n** sqlite3_backup_finish() returns the corresponding [error code].\n**\n** ^A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step()\n** is not a permanent error and does not affect the return value of\n** sqlite3_backup_finish().\n**\n** [[sqlite3_backup__remaining()]] [[sqlite3_backup_pagecount()]]\n** <b>sqlite3_backup_remaining() and sqlite3_backup_pagecount()</b>\n**\n** ^Each call to sqlite3_backup_step() sets two values inside\n** the [sqlite3_backup] object: the number of pages still to be backed\n** up and the total number of pages in the source database file.\n** The sqlite3_backup_remaining() and sqlite3_backup_pagecount() interfaces\n** retrieve these two values, respectively.\n**\n** ^The values returned by these functions are only updated by\n** sqlite3_backup_step(). ^If the source database is modified during a backup\n** operation, then the values are not updated to account for any extra\n** pages that need to be updated or the size of the source database file\n** changing.\n**\n** <b>Concurrent Usage of Database Handles</b>\n**\n** ^The source [database connection] may be used by the application for other\n** purposes while a backup operation is underway or being initialized.\n** ^If SQLite is compiled and configured to support threadsafe database\n** connections, then the source database connection may be used concurrently\n** from within other threads.\n**\n** However, the application must guarantee that the destination \n** [database connection] is not passed to any other API (by any thread) after \n** sqlite3_backup_init() is called and before the corresponding call to\n** sqlite3_backup_finish().  SQLite does not currently check to see\n** if the application incorrectly accesses the destination [database connection]\n** and so no error code is reported, but the operations may malfunction\n** nevertheless.  Use of the destination database connection while a\n** backup is in progress might also also cause a mutex deadlock.\n**\n** If running in [shared cache mode], the application must\n** guarantee that the shared cache used by the destination database\n** is not accessed while the backup is running. In practice this means\n** that the application must guarantee that the disk file being \n** backed up to is not accessed by any connection within the process,\n** not just the specific connection that was passed to sqlite3_backup_init().\n**\n** The [sqlite3_backup] object itself is partially threadsafe. Multiple \n** threads may safely make multiple concurrent calls to sqlite3_backup_step().\n** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount()\n** APIs are not strictly speaking threadsafe. If they are invoked at the\n** same time as another thread is invoking sqlite3_backup_step() it is\n** possible that they return invalid values.\n*/\nSQLITE_API sqlite3_backup *sqlite3_backup_init(\n  sqlite3 *pDest,                        /* Destination database handle */\n  const char *zDestName,                 /* Destination database name */\n  sqlite3 *pSource,                      /* Source database handle */\n  const char *zSourceName                /* Source database name */\n);\nSQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage);\nSQLITE_API int sqlite3_backup_finish(sqlite3_backup *p);\nSQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p);\nSQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);\n\n/*\n** CAPI3REF: Unlock Notification\n**\n** ^When running in shared-cache mode, a database operation may fail with\n** an [SQLITE_LOCKED] error if the required locks on the shared-cache or\n** individual tables within the shared-cache cannot be obtained. See\n** [SQLite Shared-Cache Mode] for a description of shared-cache locking. \n** ^This API may be used to register a callback that SQLite will invoke \n** when the connection currently holding the required lock relinquishes it.\n** ^This API is only available if the library was compiled with the\n** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined.\n**\n** See Also: [Using the SQLite Unlock Notification Feature].\n**\n** ^Shared-cache locks are released when a database connection concludes\n** its current transaction, either by committing it or rolling it back. \n**\n** ^When a connection (known as the blocked connection) fails to obtain a\n** shared-cache lock and SQLITE_LOCKED is returned to the caller, the\n** identity of the database connection (the blocking connection) that\n** has locked the required resource is stored internally. ^After an \n** application receives an SQLITE_LOCKED error, it may call the\n** sqlite3_unlock_notify() method with the blocked connection handle as \n** the first argument to register for a callback that will be invoked\n** when the blocking connections current transaction is concluded. ^The\n** callback is invoked from within the [sqlite3_step] or [sqlite3_close]\n** call that concludes the blocking connections transaction.\n**\n** ^(If sqlite3_unlock_notify() is called in a multi-threaded application,\n** there is a chance that the blocking connection will have already\n** concluded its transaction by the time sqlite3_unlock_notify() is invoked.\n** If this happens, then the specified callback is invoked immediately,\n** from within the call to sqlite3_unlock_notify().)^\n**\n** ^If the blocked connection is attempting to obtain a write-lock on a\n** shared-cache table, and more than one other connection currently holds\n** a read-lock on the same table, then SQLite arbitrarily selects one of \n** the other connections to use as the blocking connection.\n**\n** ^(There may be at most one unlock-notify callback registered by a \n** blocked connection. If sqlite3_unlock_notify() is called when the\n** blocked connection already has a registered unlock-notify callback,\n** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is\n** called with a NULL pointer as its second argument, then any existing\n** unlock-notify callback is canceled. ^The blocked connections \n** unlock-notify callback may also be canceled by closing the blocked\n** connection using [sqlite3_close()].\n**\n** The unlock-notify callback is not reentrant. If an application invokes\n** any sqlite3_xxx API functions from within an unlock-notify callback, a\n** crash or deadlock may be the result.\n**\n** ^Unless deadlock is detected (see below), sqlite3_unlock_notify() always\n** returns SQLITE_OK.\n**\n** <b>Callback Invocation Details</b>\n**\n** When an unlock-notify callback is registered, the application provides a \n** single void* pointer that is passed to the callback when it is invoked.\n** However, the signature of the callback function allows SQLite to pass\n** it an array of void* context pointers. The first argument passed to\n** an unlock-notify callback is a pointer to an array of void* pointers,\n** and the second is the number of entries in the array.\n**\n** When a blocking connections transaction is concluded, there may be\n** more than one blocked connection that has registered for an unlock-notify\n** callback. ^If two or more such blocked connections have specified the\n** same callback function, then instead of invoking the callback function\n** multiple times, it is invoked once with the set of void* context pointers\n** specified by the blocked connections bundled together into an array.\n** This gives the application an opportunity to prioritize any actions \n** related to the set of unblocked database connections.\n**\n** <b>Deadlock Detection</b>\n**\n** Assuming that after registering for an unlock-notify callback a \n** database waits for the callback to be issued before taking any further\n** action (a reasonable assumption), then using this API may cause the\n** application to deadlock. For example, if connection X is waiting for\n** connection Y's transaction to be concluded, and similarly connection\n** Y is waiting on connection X's transaction, then neither connection\n** will proceed and the system may remain deadlocked indefinitely.\n**\n** To avoid this scenario, the sqlite3_unlock_notify() performs deadlock\n** detection. ^If a given call to sqlite3_unlock_notify() would put the\n** system in a deadlocked state, then SQLITE_LOCKED is returned and no\n** unlock-notify callback is registered. The system is said to be in\n** a deadlocked state if connection A has registered for an unlock-notify\n** callback on the conclusion of connection B's transaction, and connection\n** B has itself registered for an unlock-notify callback when connection\n** A's transaction is concluded. ^Indirect deadlock is also detected, so\n** the system is also considered to be deadlocked if connection B has\n** registered for an unlock-notify callback on the conclusion of connection\n** C's transaction, where connection C is waiting on connection A. ^Any\n** number of levels of indirection are allowed.\n**\n** <b>The \"DROP TABLE\" Exception</b>\n**\n** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost \n** always appropriate to call sqlite3_unlock_notify(). There is however,\n** one exception. When executing a \"DROP TABLE\" or \"DROP INDEX\" statement,\n** SQLite checks if there are any currently executing SELECT statements\n** that belong to the same connection. If there are, SQLITE_LOCKED is\n** returned. In this case there is no \"blocking connection\", so invoking\n** sqlite3_unlock_notify() results in the unlock-notify callback being\n** invoked immediately. If the application then re-attempts the \"DROP TABLE\"\n** or \"DROP INDEX\" query, an infinite loop might be the result.\n**\n** One way around this problem is to check the extended error code returned\n** by an sqlite3_step() call. ^(If there is a blocking connection, then the\n** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in\n** the special \"DROP TABLE/INDEX\" case, the extended error code is just \n** SQLITE_LOCKED.)^\n*/\nSQLITE_API int sqlite3_unlock_notify(\n  sqlite3 *pBlocked,                          /* Waiting connection */\n  void (*xNotify)(void **apArg, int nArg),    /* Callback function to invoke */\n  void *pNotifyArg                            /* Argument to pass to xNotify */\n);\n\n\n/*\n** CAPI3REF: String Comparison\n**\n** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications\n** and extensions to compare the contents of two buffers containing UTF-8\n** strings in a case-independent fashion, using the same definition of \"case\n** independence\" that SQLite uses internally when comparing identifiers.\n*/\nSQLITE_API int sqlite3_stricmp(const char *, const char *);\nSQLITE_API int sqlite3_strnicmp(const char *, const char *, int);\n\n/*\n** CAPI3REF: Error Logging Interface\n**\n** ^The [sqlite3_log()] interface writes a message into the error log\n** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()].\n** ^If logging is enabled, the zFormat string and subsequent arguments are\n** used with [sqlite3_snprintf()] to generate the final output string.\n**\n** The sqlite3_log() interface is intended for use by extensions such as\n** virtual tables, collating functions, and SQL functions.  While there is\n** nothing to prevent an application from calling sqlite3_log(), doing so\n** is considered bad form.\n**\n** The zFormat string must not be NULL.\n**\n** To avoid deadlocks and other threading problems, the sqlite3_log() routine\n** will not use dynamically allocated memory.  The log message is stored in\n** a fixed-length buffer on the stack.  If the log message is longer than\n** a few hundred characters, it will be truncated to the length of the\n** buffer.\n*/\nSQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);\n\n/*\n** CAPI3REF: Write-Ahead Log Commit Hook\n**\n** ^The [sqlite3_wal_hook()] function is used to register a callback that\n** will be invoked each time a database connection commits data to a\n** [write-ahead log] (i.e. whenever a transaction is committed in\n** [journal_mode | journal_mode=WAL mode]). \n**\n** ^The callback is invoked by SQLite after the commit has taken place and \n** the associated write-lock on the database released, so the implementation \n** may read, write or [checkpoint] the database as required.\n**\n** ^The first parameter passed to the callback function when it is invoked\n** is a copy of the third parameter passed to sqlite3_wal_hook() when\n** registering the callback. ^The second is a copy of the database handle.\n** ^The third parameter is the name of the database that was written to -\n** either \"main\" or the name of an [ATTACH]-ed database. ^The fourth parameter\n** is the number of pages currently in the write-ahead log file,\n** including those that were just committed.\n**\n** The callback function should normally return [SQLITE_OK].  ^If an error\n** code is returned, that error will propagate back up through the\n** SQLite code base to cause the statement that provoked the callback\n** to report an error, though the commit will have still occurred. If the\n** callback returns [SQLITE_ROW] or [SQLITE_DONE], or if it returns a value\n** that does not correspond to any valid SQLite error code, the results\n** are undefined.\n**\n** A single database handle may have at most a single write-ahead log callback \n** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any\n** previously registered write-ahead log callback. ^Note that the\n** [sqlite3_wal_autocheckpoint()] interface and the\n** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will\n** those overwrite any prior [sqlite3_wal_hook()] settings.\n*/\nSQLITE_API void *sqlite3_wal_hook(\n  sqlite3*, \n  int(*)(void *,sqlite3*,const char*,int),\n  void*\n);\n\n/*\n** CAPI3REF: Configure an auto-checkpoint\n**\n** ^The [sqlite3_wal_autocheckpoint(D,N)] is a wrapper around\n** [sqlite3_wal_hook()] that causes any database on [database connection] D\n** to automatically [checkpoint]\n** after committing a transaction if there are N or\n** more frames in the [write-ahead log] file.  ^Passing zero or \n** a negative value as the nFrame parameter disables automatic\n** checkpoints entirely.\n**\n** ^The callback registered by this function replaces any existing callback\n** registered using [sqlite3_wal_hook()].  ^Likewise, registering a callback\n** using [sqlite3_wal_hook()] disables the automatic checkpoint mechanism\n** configured by this function.\n**\n** ^The [wal_autocheckpoint pragma] can be used to invoke this interface\n** from SQL.\n**\n** ^Every new [database connection] defaults to having the auto-checkpoint\n** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]\n** pages.  The use of this interface\n** is only necessary if the default setting is found to be suboptimal\n** for a particular application.\n*/\nSQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);\n\n/*\n** CAPI3REF: Checkpoint a database\n**\n** ^The [sqlite3_wal_checkpoint(D,X)] interface causes database named X\n** on [database connection] D to be [checkpointed].  ^If X is NULL or an\n** empty string, then a checkpoint is run on all databases of\n** connection D.  ^If the database connection D is not in\n** [WAL | write-ahead log mode] then this interface is a harmless no-op.\n**\n** ^The [wal_checkpoint pragma] can be used to invoke this interface\n** from SQL.  ^The [sqlite3_wal_autocheckpoint()] interface and the\n** [wal_autocheckpoint pragma] can be used to cause this interface to be\n** run whenever the WAL reaches a certain size threshold.\n**\n** See also: [sqlite3_wal_checkpoint_v2()]\n*/\nSQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);\n\n/*\n** CAPI3REF: Checkpoint a database\n**\n** Run a checkpoint operation on WAL database zDb attached to database \n** handle db. The specific operation is determined by the value of the \n** eMode parameter:\n**\n** <dl>\n** <dt>SQLITE_CHECKPOINT_PASSIVE<dd>\n**   Checkpoint as many frames as possible without waiting for any database \n**   readers or writers to finish. Sync the db file if all frames in the log\n**   are checkpointed. This mode is the same as calling \n**   sqlite3_wal_checkpoint(). The busy-handler callback is never invoked.\n**\n** <dt>SQLITE_CHECKPOINT_FULL<dd>\n**   This mode blocks (calls the busy-handler callback) until there is no\n**   database writer and all readers are reading from the most recent database\n**   snapshot. It then checkpoints all frames in the log file and syncs the\n**   database file. This call blocks database writers while it is running,\n**   but not database readers.\n**\n** <dt>SQLITE_CHECKPOINT_RESTART<dd>\n**   This mode works the same way as SQLITE_CHECKPOINT_FULL, except after \n**   checkpointing the log file it blocks (calls the busy-handler callback)\n**   until all readers are reading from the database file only. This ensures \n**   that the next client to write to the database file restarts the log file \n**   from the beginning. This call blocks database writers while it is running,\n**   but not database readers.\n** </dl>\n**\n** If pnLog is not NULL, then *pnLog is set to the total number of frames in\n** the log file before returning. If pnCkpt is not NULL, then *pnCkpt is set to\n** the total number of checkpointed frames (including any that were already\n** checkpointed when this function is called). *pnLog and *pnCkpt may be\n** populated even if sqlite3_wal_checkpoint_v2() returns other than SQLITE_OK.\n** If no values are available because of an error, they are both set to -1\n** before returning to communicate this to the caller.\n**\n** All calls obtain an exclusive \"checkpoint\" lock on the database file. If\n** any other process is running a checkpoint operation at the same time, the \n** lock cannot be obtained and SQLITE_BUSY is returned. Even if there is a \n** busy-handler configured, it will not be invoked in this case.\n**\n** The SQLITE_CHECKPOINT_FULL and RESTART modes also obtain the exclusive \n** \"writer\" lock on the database file. If the writer lock cannot be obtained\n** immediately, and a busy-handler is configured, it is invoked and the writer\n** lock retried until either the busy-handler returns 0 or the lock is\n** successfully obtained. The busy-handler is also invoked while waiting for\n** database readers as described above. If the busy-handler returns 0 before\n** the writer lock is obtained or while waiting for database readers, the\n** checkpoint operation proceeds from that point in the same way as \n** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible \n** without blocking any further. SQLITE_BUSY is returned in this case.\n**\n** If parameter zDb is NULL or points to a zero length string, then the\n** specified operation is attempted on all WAL databases. In this case the\n** values written to output parameters *pnLog and *pnCkpt are undefined. If \n** an SQLITE_BUSY error is encountered when processing one or more of the \n** attached WAL databases, the operation is still attempted on any remaining \n** attached databases and SQLITE_BUSY is returned to the caller. If any other \n** error occurs while processing an attached database, processing is abandoned \n** and the error code returned to the caller immediately. If no error \n** (SQLITE_BUSY or otherwise) is encountered while processing the attached \n** databases, SQLITE_OK is returned.\n**\n** If database zDb is the name of an attached database that is not in WAL\n** mode, SQLITE_OK is returned and both *pnLog and *pnCkpt set to -1. If\n** zDb is not NULL (or a zero length string) and is not the name of any\n** attached database, SQLITE_ERROR is returned to the caller.\n*/\nSQLITE_API int sqlite3_wal_checkpoint_v2(\n  sqlite3 *db,                    /* Database handle */\n  const char *zDb,                /* Name of attached database (or NULL) */\n  int eMode,                      /* SQLITE_CHECKPOINT_* value */\n  int *pnLog,                     /* OUT: Size of WAL log in frames */\n  int *pnCkpt                     /* OUT: Total number of frames checkpointed */\n);\n\n/*\n** CAPI3REF: Checkpoint operation parameters\n**\n** These constants can be used as the 3rd parameter to\n** [sqlite3_wal_checkpoint_v2()].  See the [sqlite3_wal_checkpoint_v2()]\n** documentation for additional information about the meaning and use of\n** each of these values.\n*/\n#define SQLITE_CHECKPOINT_PASSIVE 0\n#define SQLITE_CHECKPOINT_FULL    1\n#define SQLITE_CHECKPOINT_RESTART 2\n\n/*\n** CAPI3REF: Virtual Table Interface Configuration\n**\n** This function may be called by either the [xConnect] or [xCreate] method\n** of a [virtual table] implementation to configure\n** various facets of the virtual table interface.\n**\n** If this interface is invoked outside the context of an xConnect or\n** xCreate virtual table method then the behavior is undefined.\n**\n** At present, there is only one option that may be configured using\n** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].)  Further options\n** may be added in the future.\n*/\nSQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);\n\n/*\n** CAPI3REF: Virtual Table Configuration Options\n**\n** These macros define the various options to the\n** [sqlite3_vtab_config()] interface that [virtual table] implementations\n** can use to customize and optimize their behavior.\n**\n** <dl>\n** <dt>SQLITE_VTAB_CONSTRAINT_SUPPORT\n** <dd>Calls of the form\n** [sqlite3_vtab_config](db,SQLITE_VTAB_CONSTRAINT_SUPPORT,X) are supported,\n** where X is an integer.  If X is zero, then the [virtual table] whose\n** [xCreate] or [xConnect] method invoked [sqlite3_vtab_config()] does not\n** support constraints.  In this configuration (which is the default) if\n** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire\n** statement is rolled back as if [ON CONFLICT | OR ABORT] had been\n** specified as part of the users SQL statement, regardless of the actual\n** ON CONFLICT mode specified.\n**\n** If X is non-zero, then the virtual table implementation guarantees\n** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before\n** any modifications to internal or persistent data structures have been made.\n** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite \n** is able to roll back a statement or database transaction, and abandon\n** or continue processing the current SQL statement as appropriate. \n** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns\n** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode\n** had been ABORT.\n**\n** Virtual table implementations that are required to handle OR REPLACE\n** must do so within the [xUpdate] method. If a call to the \n** [sqlite3_vtab_on_conflict()] function indicates that the current ON \n** CONFLICT policy is REPLACE, the virtual table implementation should \n** silently replace the appropriate rows within the xUpdate callback and\n** return SQLITE_OK. Or, if this is not possible, it may return\n** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT \n** constraint handling.\n** </dl>\n*/\n#define SQLITE_VTAB_CONSTRAINT_SUPPORT 1\n\n/*\n** CAPI3REF: Determine The Virtual Table Conflict Policy\n**\n** This function may only be called from within a call to the [xUpdate] method\n** of a [virtual table] implementation for an INSERT or UPDATE operation. ^The\n** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL],\n** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode\n** of the SQL statement that triggered the call to the [xUpdate] method of the\n** [virtual table].\n*/\nSQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);\n\n/*\n** CAPI3REF: Conflict resolution modes\n**\n** These constants are returned by [sqlite3_vtab_on_conflict()] to\n** inform a [virtual table] implementation what the [ON CONFLICT] mode\n** is for the SQL statement being evaluated.\n**\n** Note that the [SQLITE_IGNORE] constant is also used as a potential\n** return value from the [sqlite3_set_authorizer()] callback and that\n** [SQLITE_ABORT] is also a [result code].\n*/\n#define SQLITE_ROLLBACK 1\n/* #define SQLITE_IGNORE 2 // Also used by sqlite3_authorizer() callback */\n#define SQLITE_FAIL     3\n/* #define SQLITE_ABORT 4  // Also an error code */\n#define SQLITE_REPLACE  5\n\n\n\n/*\n** Undo the hack that converts floating point types to integer for\n** builds on processors without floating point support.\n*/\n#ifdef SQLITE_OMIT_FLOATING_POINT\n# undef double\n#endif\n\n#ifdef __cplusplus\n}  /* End of the 'extern \"C\"' block */\n#endif\n#endif\n\n/*\n** 2010 August 30\n**\n** The author disclaims copyright to this source code.  In place of\n** a legal notice, here is a blessing:\n**\n**    May you do good and not evil.\n**    May you find forgiveness for yourself and forgive others.\n**    May you share freely, never taking more than you give.\n**\n*************************************************************************\n*/\n\n#ifndef _SQLITE3RTREE_H_\n#define _SQLITE3RTREE_H_\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry;\n\n/*\n** Register a geometry callback named zGeom that can be used as part of an\n** R-Tree geometry query as follows:\n**\n**   SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...)\n*/\nSQLITE_API int sqlite3_rtree_geometry_callback(\n  sqlite3 *db,\n  const char *zGeom,\n#ifdef SQLITE_RTREE_INT_ONLY\n  int (*xGeom)(sqlite3_rtree_geometry*, int n, sqlite3_int64 *a, int *pRes),\n#else\n  int (*xGeom)(sqlite3_rtree_geometry*, int n, double *a, int *pRes),\n#endif\n  void *pContext\n);\n\n\n/*\n** A pointer to a structure of the following type is passed as the first\n** argument to callbacks registered using rtree_geometry_callback().\n*/\nstruct sqlite3_rtree_geometry {\n  void *pContext;                 /* Copy of pContext passed to s_r_g_c() */\n  int nParam;                     /* Size of array aParam[] */\n  double *aParam;                 /* Parameters passed to SQL geom function */\n  void *pUser;                    /* Callback implementation user data */\n  void (*xDelUser)(void *);       /* Called by SQLite to clean up pUser */\n};\n\n\n#ifdef __cplusplus\n}  /* end of the 'extern \"C\"' block */\n#endif\n\n#endif  /* ifndef _SQLITE3RTREE_H_ */\n\n"
  },
  {
    "path": "cocos2d/external/sqlite3/include/sqlite3ext.h",
    "content": "/*\n** 2006 June 7\n**\n** The author disclaims copyright to this source code.  In place of\n** a legal notice, here is a blessing:\n**\n**    May you do good and not evil.\n**    May you find forgiveness for yourself and forgive others.\n**    May you share freely, never taking more than you give.\n**\n*************************************************************************\n** This header file defines the SQLite interface for use by\n** shared libraries that want to be imported as extensions into\n** an SQLite instance.  Shared libraries that intend to be loaded\n** as extensions by SQLite should #include this file instead of \n** sqlite3.h.\n*/\n#ifndef _SQLITE3EXT_H_\n#define _SQLITE3EXT_H_\n#include \"sqlite3.h\"\n\ntypedef struct sqlite3_api_routines sqlite3_api_routines;\n\n/*\n** The following structure holds pointers to all of the SQLite API\n** routines.\n**\n** WARNING:  In order to maintain backwards compatibility, add new\n** interfaces to the end of this structure only.  If you insert new\n** interfaces in the middle of this structure, then older different\n** versions of SQLite will not be able to load each others' shared\n** libraries!\n*/\nstruct sqlite3_api_routines {\n  void * (*aggregate_context)(sqlite3_context*,int nBytes);\n  int  (*aggregate_count)(sqlite3_context*);\n  int  (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));\n  int  (*bind_double)(sqlite3_stmt*,int,double);\n  int  (*bind_int)(sqlite3_stmt*,int,int);\n  int  (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);\n  int  (*bind_null)(sqlite3_stmt*,int);\n  int  (*bind_parameter_count)(sqlite3_stmt*);\n  int  (*bind_parameter_index)(sqlite3_stmt*,const char*zName);\n  const char * (*bind_parameter_name)(sqlite3_stmt*,int);\n  int  (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));\n  int  (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));\n  int  (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);\n  int  (*busy_handler)(sqlite3*,int(*)(void*,int),void*);\n  int  (*busy_timeout)(sqlite3*,int ms);\n  int  (*changes)(sqlite3*);\n  int  (*close)(sqlite3*);\n  int  (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,\n                           int eTextRep,const char*));\n  int  (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,\n                             int eTextRep,const void*));\n  const void * (*column_blob)(sqlite3_stmt*,int iCol);\n  int  (*column_bytes)(sqlite3_stmt*,int iCol);\n  int  (*column_bytes16)(sqlite3_stmt*,int iCol);\n  int  (*column_count)(sqlite3_stmt*pStmt);\n  const char * (*column_database_name)(sqlite3_stmt*,int);\n  const void * (*column_database_name16)(sqlite3_stmt*,int);\n  const char * (*column_decltype)(sqlite3_stmt*,int i);\n  const void * (*column_decltype16)(sqlite3_stmt*,int);\n  double  (*column_double)(sqlite3_stmt*,int iCol);\n  int  (*column_int)(sqlite3_stmt*,int iCol);\n  sqlite_int64  (*column_int64)(sqlite3_stmt*,int iCol);\n  const char * (*column_name)(sqlite3_stmt*,int);\n  const void * (*column_name16)(sqlite3_stmt*,int);\n  const char * (*column_origin_name)(sqlite3_stmt*,int);\n  const void * (*column_origin_name16)(sqlite3_stmt*,int);\n  const char * (*column_table_name)(sqlite3_stmt*,int);\n  const void * (*column_table_name16)(sqlite3_stmt*,int);\n  const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);\n  const void * (*column_text16)(sqlite3_stmt*,int iCol);\n  int  (*column_type)(sqlite3_stmt*,int iCol);\n  sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);\n  void * (*commit_hook)(sqlite3*,int(*)(void*),void*);\n  int  (*complete)(const char*sql);\n  int  (*complete16)(const void*sql);\n  int  (*create_collation)(sqlite3*,const char*,int,void*,\n                           int(*)(void*,int,const void*,int,const void*));\n  int  (*create_collation16)(sqlite3*,const void*,int,void*,\n                             int(*)(void*,int,const void*,int,const void*));\n  int  (*create_function)(sqlite3*,const char*,int,int,void*,\n                          void (*xFunc)(sqlite3_context*,int,sqlite3_value**),\n                          void (*xStep)(sqlite3_context*,int,sqlite3_value**),\n                          void (*xFinal)(sqlite3_context*));\n  int  (*create_function16)(sqlite3*,const void*,int,int,void*,\n                            void (*xFunc)(sqlite3_context*,int,sqlite3_value**),\n                            void (*xStep)(sqlite3_context*,int,sqlite3_value**),\n                            void (*xFinal)(sqlite3_context*));\n  int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);\n  int  (*data_count)(sqlite3_stmt*pStmt);\n  sqlite3 * (*db_handle)(sqlite3_stmt*);\n  int (*declare_vtab)(sqlite3*,const char*);\n  int  (*enable_shared_cache)(int);\n  int  (*errcode)(sqlite3*db);\n  const char * (*errmsg)(sqlite3*);\n  const void * (*errmsg16)(sqlite3*);\n  int  (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);\n  int  (*expired)(sqlite3_stmt*);\n  int  (*finalize)(sqlite3_stmt*pStmt);\n  void  (*free)(void*);\n  void  (*free_table)(char**result);\n  int  (*get_autocommit)(sqlite3*);\n  void * (*get_auxdata)(sqlite3_context*,int);\n  int  (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);\n  int  (*global_recover)(void);\n  void  (*interruptx)(sqlite3*);\n  sqlite_int64  (*last_insert_rowid)(sqlite3*);\n  const char * (*libversion)(void);\n  int  (*libversion_number)(void);\n  void *(*malloc)(int);\n  char * (*mprintf)(const char*,...);\n  int  (*open)(const char*,sqlite3**);\n  int  (*open16)(const void*,sqlite3**);\n  int  (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);\n  int  (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);\n  void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);\n  void  (*progress_handler)(sqlite3*,int,int(*)(void*),void*);\n  void *(*realloc)(void*,int);\n  int  (*reset)(sqlite3_stmt*pStmt);\n  void  (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));\n  void  (*result_double)(sqlite3_context*,double);\n  void  (*result_error)(sqlite3_context*,const char*,int);\n  void  (*result_error16)(sqlite3_context*,const void*,int);\n  void  (*result_int)(sqlite3_context*,int);\n  void  (*result_int64)(sqlite3_context*,sqlite_int64);\n  void  (*result_null)(sqlite3_context*);\n  void  (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));\n  void  (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));\n  void  (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));\n  void  (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));\n  void  (*result_value)(sqlite3_context*,sqlite3_value*);\n  void * (*rollback_hook)(sqlite3*,void(*)(void*),void*);\n  int  (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,\n                         const char*,const char*),void*);\n  void  (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));\n  char * (*snprintf)(int,char*,const char*,...);\n  int  (*step)(sqlite3_stmt*);\n  int  (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,\n                                char const**,char const**,int*,int*,int*);\n  void  (*thread_cleanup)(void);\n  int  (*total_changes)(sqlite3*);\n  void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);\n  int  (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);\n  void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,\n                                         sqlite_int64),void*);\n  void * (*user_data)(sqlite3_context*);\n  const void * (*value_blob)(sqlite3_value*);\n  int  (*value_bytes)(sqlite3_value*);\n  int  (*value_bytes16)(sqlite3_value*);\n  double  (*value_double)(sqlite3_value*);\n  int  (*value_int)(sqlite3_value*);\n  sqlite_int64  (*value_int64)(sqlite3_value*);\n  int  (*value_numeric_type)(sqlite3_value*);\n  const unsigned char * (*value_text)(sqlite3_value*);\n  const void * (*value_text16)(sqlite3_value*);\n  const void * (*value_text16be)(sqlite3_value*);\n  const void * (*value_text16le)(sqlite3_value*);\n  int  (*value_type)(sqlite3_value*);\n  char *(*vmprintf)(const char*,va_list);\n  /* Added ??? */\n  int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);\n  /* Added by 3.3.13 */\n  int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);\n  int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);\n  int (*clear_bindings)(sqlite3_stmt*);\n  /* Added by 3.4.1 */\n  int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,\n                          void (*xDestroy)(void *));\n  /* Added by 3.5.0 */\n  int (*bind_zeroblob)(sqlite3_stmt*,int,int);\n  int (*blob_bytes)(sqlite3_blob*);\n  int (*blob_close)(sqlite3_blob*);\n  int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,\n                   int,sqlite3_blob**);\n  int (*blob_read)(sqlite3_blob*,void*,int,int);\n  int (*blob_write)(sqlite3_blob*,const void*,int,int);\n  int (*create_collation_v2)(sqlite3*,const char*,int,void*,\n                             int(*)(void*,int,const void*,int,const void*),\n                             void(*)(void*));\n  int (*file_control)(sqlite3*,const char*,int,void*);\n  sqlite3_int64 (*memory_highwater)(int);\n  sqlite3_int64 (*memory_used)(void);\n  sqlite3_mutex *(*mutex_alloc)(int);\n  void (*mutex_enter)(sqlite3_mutex*);\n  void (*mutex_free)(sqlite3_mutex*);\n  void (*mutex_leave)(sqlite3_mutex*);\n  int (*mutex_try)(sqlite3_mutex*);\n  int (*open_v2)(const char*,sqlite3**,int,const char*);\n  int (*release_memory)(int);\n  void (*result_error_nomem)(sqlite3_context*);\n  void (*result_error_toobig)(sqlite3_context*);\n  int (*sleep)(int);\n  void (*soft_heap_limit)(int);\n  sqlite3_vfs *(*vfs_find)(const char*);\n  int (*vfs_register)(sqlite3_vfs*,int);\n  int (*vfs_unregister)(sqlite3_vfs*);\n  int (*xthreadsafe)(void);\n  void (*result_zeroblob)(sqlite3_context*,int);\n  void (*result_error_code)(sqlite3_context*,int);\n  int (*test_control)(int, ...);\n  void (*randomness)(int,void*);\n  sqlite3 *(*context_db_handle)(sqlite3_context*);\n  int (*extended_result_codes)(sqlite3*,int);\n  int (*limit)(sqlite3*,int,int);\n  sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);\n  const char *(*sql)(sqlite3_stmt*);\n  int (*status)(int,int*,int*,int);\n  int (*backup_finish)(sqlite3_backup*);\n  sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);\n  int (*backup_pagecount)(sqlite3_backup*);\n  int (*backup_remaining)(sqlite3_backup*);\n  int (*backup_step)(sqlite3_backup*,int);\n  const char *(*compileoption_get)(int);\n  int (*compileoption_used)(const char*);\n  int (*create_function_v2)(sqlite3*,const char*,int,int,void*,\n                            void (*xFunc)(sqlite3_context*,int,sqlite3_value**),\n                            void (*xStep)(sqlite3_context*,int,sqlite3_value**),\n                            void (*xFinal)(sqlite3_context*),\n                            void(*xDestroy)(void*));\n  int (*db_config)(sqlite3*,int,...);\n  sqlite3_mutex *(*db_mutex)(sqlite3*);\n  int (*db_status)(sqlite3*,int,int*,int*,int);\n  int (*extended_errcode)(sqlite3*);\n  void (*log)(int,const char*,...);\n  sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);\n  const char *(*sourceid)(void);\n  int (*stmt_status)(sqlite3_stmt*,int,int);\n  int (*strnicmp)(const char*,const char*,int);\n  int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);\n  int (*wal_autocheckpoint)(sqlite3*,int);\n  int (*wal_checkpoint)(sqlite3*,const char*);\n  void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);\n  int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);\n  int (*vtab_config)(sqlite3*,int op,...);\n  int (*vtab_on_conflict)(sqlite3*);\n};\n\n/*\n** The following macros redefine the API routines so that they are\n** redirected throught the global sqlite3_api structure.\n**\n** This header file is also used by the loadext.c source file\n** (part of the main SQLite library - not an extension) so that\n** it can get access to the sqlite3_api_routines structure\n** definition.  But the main library does not want to redefine\n** the API.  So the redefinition macros are only valid if the\n** SQLITE_CORE macros is undefined.\n*/\n#ifndef SQLITE_CORE\n#define sqlite3_aggregate_context      sqlite3_api->aggregate_context\n#ifndef SQLITE_OMIT_DEPRECATED\n#define sqlite3_aggregate_count        sqlite3_api->aggregate_count\n#endif\n#define sqlite3_bind_blob              sqlite3_api->bind_blob\n#define sqlite3_bind_double            sqlite3_api->bind_double\n#define sqlite3_bind_int               sqlite3_api->bind_int\n#define sqlite3_bind_int64             sqlite3_api->bind_int64\n#define sqlite3_bind_null              sqlite3_api->bind_null\n#define sqlite3_bind_parameter_count   sqlite3_api->bind_parameter_count\n#define sqlite3_bind_parameter_index   sqlite3_api->bind_parameter_index\n#define sqlite3_bind_parameter_name    sqlite3_api->bind_parameter_name\n#define sqlite3_bind_text              sqlite3_api->bind_text\n#define sqlite3_bind_text16            sqlite3_api->bind_text16\n#define sqlite3_bind_value             sqlite3_api->bind_value\n#define sqlite3_busy_handler           sqlite3_api->busy_handler\n#define sqlite3_busy_timeout           sqlite3_api->busy_timeout\n#define sqlite3_changes                sqlite3_api->changes\n#define sqlite3_close                  sqlite3_api->close\n#define sqlite3_collation_needed       sqlite3_api->collation_needed\n#define sqlite3_collation_needed16     sqlite3_api->collation_needed16\n#define sqlite3_column_blob            sqlite3_api->column_blob\n#define sqlite3_column_bytes           sqlite3_api->column_bytes\n#define sqlite3_column_bytes16         sqlite3_api->column_bytes16\n#define sqlite3_column_count           sqlite3_api->column_count\n#define sqlite3_column_database_name   sqlite3_api->column_database_name\n#define sqlite3_column_database_name16 sqlite3_api->column_database_name16\n#define sqlite3_column_decltype        sqlite3_api->column_decltype\n#define sqlite3_column_decltype16      sqlite3_api->column_decltype16\n#define sqlite3_column_double          sqlite3_api->column_double\n#define sqlite3_column_int             sqlite3_api->column_int\n#define sqlite3_column_int64           sqlite3_api->column_int64\n#define sqlite3_column_name            sqlite3_api->column_name\n#define sqlite3_column_name16          sqlite3_api->column_name16\n#define sqlite3_column_origin_name     sqlite3_api->column_origin_name\n#define sqlite3_column_origin_name16   sqlite3_api->column_origin_name16\n#define sqlite3_column_table_name      sqlite3_api->column_table_name\n#define sqlite3_column_table_name16    sqlite3_api->column_table_name16\n#define sqlite3_column_text            sqlite3_api->column_text\n#define sqlite3_column_text16          sqlite3_api->column_text16\n#define sqlite3_column_type            sqlite3_api->column_type\n#define sqlite3_column_value           sqlite3_api->column_value\n#define sqlite3_commit_hook            sqlite3_api->commit_hook\n#define sqlite3_complete               sqlite3_api->complete\n#define sqlite3_complete16             sqlite3_api->complete16\n#define sqlite3_create_collation       sqlite3_api->create_collation\n#define sqlite3_create_collation16     sqlite3_api->create_collation16\n#define sqlite3_create_function        sqlite3_api->create_function\n#define sqlite3_create_function16      sqlite3_api->create_function16\n#define sqlite3_create_module          sqlite3_api->create_module\n#define sqlite3_create_module_v2       sqlite3_api->create_module_v2\n#define sqlite3_data_count             sqlite3_api->data_count\n#define sqlite3_db_handle              sqlite3_api->db_handle\n#define sqlite3_declare_vtab           sqlite3_api->declare_vtab\n#define sqlite3_enable_shared_cache    sqlite3_api->enable_shared_cache\n#define sqlite3_errcode                sqlite3_api->errcode\n#define sqlite3_errmsg                 sqlite3_api->errmsg\n#define sqlite3_errmsg16               sqlite3_api->errmsg16\n#define sqlite3_exec                   sqlite3_api->exec\n#ifndef SQLITE_OMIT_DEPRECATED\n#define sqlite3_expired                sqlite3_api->expired\n#endif\n#define sqlite3_finalize               sqlite3_api->finalize\n#define sqlite3_free                   sqlite3_api->free\n#define sqlite3_free_table             sqlite3_api->free_table\n#define sqlite3_get_autocommit         sqlite3_api->get_autocommit\n#define sqlite3_get_auxdata            sqlite3_api->get_auxdata\n#define sqlite3_get_table              sqlite3_api->get_table\n#ifndef SQLITE_OMIT_DEPRECATED\n#define sqlite3_global_recover         sqlite3_api->global_recover\n#endif\n#define sqlite3_interrupt              sqlite3_api->interruptx\n#define sqlite3_last_insert_rowid      sqlite3_api->last_insert_rowid\n#define sqlite3_libversion             sqlite3_api->libversion\n#define sqlite3_libversion_number      sqlite3_api->libversion_number\n#define sqlite3_malloc                 sqlite3_api->malloc\n#define sqlite3_mprintf                sqlite3_api->mprintf\n#define sqlite3_open                   sqlite3_api->open\n#define sqlite3_open16                 sqlite3_api->open16\n#define sqlite3_prepare                sqlite3_api->prepare\n#define sqlite3_prepare16              sqlite3_api->prepare16\n#define sqlite3_prepare_v2             sqlite3_api->prepare_v2\n#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2\n#define sqlite3_profile                sqlite3_api->profile\n#define sqlite3_progress_handler       sqlite3_api->progress_handler\n#define sqlite3_realloc                sqlite3_api->realloc\n#define sqlite3_reset                  sqlite3_api->reset\n#define sqlite3_result_blob            sqlite3_api->result_blob\n#define sqlite3_result_double          sqlite3_api->result_double\n#define sqlite3_result_error           sqlite3_api->result_error\n#define sqlite3_result_error16         sqlite3_api->result_error16\n#define sqlite3_result_int             sqlite3_api->result_int\n#define sqlite3_result_int64           sqlite3_api->result_int64\n#define sqlite3_result_null            sqlite3_api->result_null\n#define sqlite3_result_text            sqlite3_api->result_text\n#define sqlite3_result_text16          sqlite3_api->result_text16\n#define sqlite3_result_text16be        sqlite3_api->result_text16be\n#define sqlite3_result_text16le        sqlite3_api->result_text16le\n#define sqlite3_result_value           sqlite3_api->result_value\n#define sqlite3_rollback_hook          sqlite3_api->rollback_hook\n#define sqlite3_set_authorizer         sqlite3_api->set_authorizer\n#define sqlite3_set_auxdata            sqlite3_api->set_auxdata\n#define sqlite3_snprintf               sqlite3_api->snprintf\n#define sqlite3_step                   sqlite3_api->step\n#define sqlite3_table_column_metadata  sqlite3_api->table_column_metadata\n#define sqlite3_thread_cleanup         sqlite3_api->thread_cleanup\n#define sqlite3_total_changes          sqlite3_api->total_changes\n#define sqlite3_trace                  sqlite3_api->trace\n#ifndef SQLITE_OMIT_DEPRECATED\n#define sqlite3_transfer_bindings      sqlite3_api->transfer_bindings\n#endif\n#define sqlite3_update_hook            sqlite3_api->update_hook\n#define sqlite3_user_data              sqlite3_api->user_data\n#define sqlite3_value_blob             sqlite3_api->value_blob\n#define sqlite3_value_bytes            sqlite3_api->value_bytes\n#define sqlite3_value_bytes16          sqlite3_api->value_bytes16\n#define sqlite3_value_double           sqlite3_api->value_double\n#define sqlite3_value_int              sqlite3_api->value_int\n#define sqlite3_value_int64            sqlite3_api->value_int64\n#define sqlite3_value_numeric_type     sqlite3_api->value_numeric_type\n#define sqlite3_value_text             sqlite3_api->value_text\n#define sqlite3_value_text16           sqlite3_api->value_text16\n#define sqlite3_value_text16be         sqlite3_api->value_text16be\n#define sqlite3_value_text16le         sqlite3_api->value_text16le\n#define sqlite3_value_type             sqlite3_api->value_type\n#define sqlite3_vmprintf               sqlite3_api->vmprintf\n#define sqlite3_overload_function      sqlite3_api->overload_function\n#define sqlite3_prepare_v2             sqlite3_api->prepare_v2\n#define sqlite3_prepare16_v2           sqlite3_api->prepare16_v2\n#define sqlite3_clear_bindings         sqlite3_api->clear_bindings\n#define sqlite3_bind_zeroblob          sqlite3_api->bind_zeroblob\n#define sqlite3_blob_bytes             sqlite3_api->blob_bytes\n#define sqlite3_blob_close             sqlite3_api->blob_close\n#define sqlite3_blob_open              sqlite3_api->blob_open\n#define sqlite3_blob_read              sqlite3_api->blob_read\n#define sqlite3_blob_write             sqlite3_api->blob_write\n#define sqlite3_create_collation_v2    sqlite3_api->create_collation_v2\n#define sqlite3_file_control           sqlite3_api->file_control\n#define sqlite3_memory_highwater       sqlite3_api->memory_highwater\n#define sqlite3_memory_used            sqlite3_api->memory_used\n#define sqlite3_mutex_alloc            sqlite3_api->mutex_alloc\n#define sqlite3_mutex_enter            sqlite3_api->mutex_enter\n#define sqlite3_mutex_free             sqlite3_api->mutex_free\n#define sqlite3_mutex_leave            sqlite3_api->mutex_leave\n#define sqlite3_mutex_try              sqlite3_api->mutex_try\n#define sqlite3_open_v2                sqlite3_api->open_v2\n#define sqlite3_release_memory         sqlite3_api->release_memory\n#define sqlite3_result_error_nomem     sqlite3_api->result_error_nomem\n#define sqlite3_result_error_toobig    sqlite3_api->result_error_toobig\n#define sqlite3_sleep                  sqlite3_api->sleep\n#define sqlite3_soft_heap_limit        sqlite3_api->soft_heap_limit\n#define sqlite3_vfs_find               sqlite3_api->vfs_find\n#define sqlite3_vfs_register           sqlite3_api->vfs_register\n#define sqlite3_vfs_unregister         sqlite3_api->vfs_unregister\n#define sqlite3_threadsafe             sqlite3_api->xthreadsafe\n#define sqlite3_result_zeroblob        sqlite3_api->result_zeroblob\n#define sqlite3_result_error_code      sqlite3_api->result_error_code\n#define sqlite3_test_control           sqlite3_api->test_control\n#define sqlite3_randomness             sqlite3_api->randomness\n#define sqlite3_context_db_handle      sqlite3_api->context_db_handle\n#define sqlite3_extended_result_codes  sqlite3_api->extended_result_codes\n#define sqlite3_limit                  sqlite3_api->limit\n#define sqlite3_next_stmt              sqlite3_api->next_stmt\n#define sqlite3_sql                    sqlite3_api->sql\n#define sqlite3_status                 sqlite3_api->status\n#define sqlite3_backup_finish          sqlite3_api->backup_finish\n#define sqlite3_backup_init            sqlite3_api->backup_init\n#define sqlite3_backup_pagecount       sqlite3_api->backup_pagecount\n#define sqlite3_backup_remaining       sqlite3_api->backup_remaining\n#define sqlite3_backup_step            sqlite3_api->backup_step\n#define sqlite3_compileoption_get      sqlite3_api->compileoption_get\n#define sqlite3_compileoption_used     sqlite3_api->compileoption_used\n#define sqlite3_create_function_v2     sqlite3_api->create_function_v2\n#define sqlite3_db_config              sqlite3_api->db_config\n#define sqlite3_db_mutex               sqlite3_api->db_mutex\n#define sqlite3_db_status              sqlite3_api->db_status\n#define sqlite3_extended_errcode       sqlite3_api->extended_errcode\n#define sqlite3_log                    sqlite3_api->log\n#define sqlite3_soft_heap_limit64      sqlite3_api->soft_heap_limit64\n#define sqlite3_sourceid               sqlite3_api->sourceid\n#define sqlite3_stmt_status            sqlite3_api->stmt_status\n#define sqlite3_strnicmp               sqlite3_api->strnicmp\n#define sqlite3_unlock_notify          sqlite3_api->unlock_notify\n#define sqlite3_wal_autocheckpoint     sqlite3_api->wal_autocheckpoint\n#define sqlite3_wal_checkpoint         sqlite3_api->wal_checkpoint\n#define sqlite3_wal_hook               sqlite3_api->wal_hook\n#define sqlite3_blob_reopen            sqlite3_api->blob_reopen\n#define sqlite3_vtab_config            sqlite3_api->vtab_config\n#define sqlite3_vtab_on_conflict       sqlite3_api->vtab_on_conflict\n#endif /* SQLITE_CORE */\n\n#define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api = 0;\n#define SQLITE_EXTENSION_INIT2(v)  sqlite3_api = v;\n\n#endif /* _SQLITE3EXT_H_ */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/android/tiff.h",
    "content": "/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and \n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n * \n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  \n * \n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF \n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE \n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFF_\n#define\t_TIFF_\n\n#include \"tiffconf.h\"\n\n/*\n * Tag Image File Format (TIFF)\n *\n * Based on Rev 6.0 from:\n *    Developer's Desk\n *    Aldus Corporation\n *    411 First Ave. South\n *    Suite 200\n *    Seattle, WA  98104\n *    206-622-5500\n *\n *    (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)\n *\n * For BigTIFF design notes see the following links\n *    http://www.remotesensing.org/libtiff/bigtiffdesign.html\n *    http://www.awaresystems.be/imaging/tiff/bigtiff.html\n */\n\n#define TIFF_VERSION_CLASSIC 42\n#define TIFF_VERSION_BIG 43\n\n#define TIFF_BIGENDIAN      0x4d4d\n#define TIFF_LITTLEENDIAN   0x4949\n#define MDI_LITTLEENDIAN    0x5045\n#define MDI_BIGENDIAN       0x4550\n\n/*\n * Intrinsic data types required by the file format:\n *\n * 8-bit quantities     int8/uint8\n * 16-bit quantities    int16/uint16\n * 32-bit quantities    int32/uint32\n * 64-bit quantities    int64/uint64\n * strings              unsigned char*\n */\n\ntypedef TIFF_INT8_T   int8;\ntypedef TIFF_UINT8_T  uint8;\n\ntypedef TIFF_INT16_T  int16;\ntypedef TIFF_UINT16_T uint16;\n\ntypedef TIFF_INT32_T  int32;\ntypedef TIFF_UINT32_T uint32;\n\ntypedef TIFF_INT64_T  int64;\ntypedef TIFF_UINT64_T uint64;\n\n/*\n * Some types as promoted in a variable argument list\n * We use uint16_vap rather then directly using int, because this way\n * we document the type we actually want to pass through, conceptually,\n * rather then confusing the issue by merely stating the type it gets\n * promoted to\n */\n\ntypedef int uint16_vap;\n\n/*\n * TIFF header.\n */\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n} TIFFHeaderCommon;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint32 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderClassic;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint16 tiff_offsetsize; /* size of offsets, should be 8 */\n\tuint16 tiff_unused;     /* unused word, should be 0 */\n\tuint64 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderBig;\n\n\n/*\n * NB: In the comments below,\n *  - items marked with a + are obsoleted by revision 5.0,\n *  - items marked with a ! are introduced in revision 6.0.\n *  - items marked with a % are introduced post revision 6.0.\n *  - items marked with a $ are obsoleted by revision 6.0.\n *  - items marked with a & are introduced by Adobe DNG specification.\n */\n\n/*\n * Tag data type information.\n *\n * Note: RATIONALs are the ratio of two 32-bit integer values.\n */\ntypedef enum {\n\tTIFF_NOTYPE = 0,      /* placeholder */\n\tTIFF_BYTE = 1,        /* 8-bit unsigned integer */\n\tTIFF_ASCII = 2,       /* 8-bit bytes w/ last byte null */\n\tTIFF_SHORT = 3,       /* 16-bit unsigned integer */\n\tTIFF_LONG = 4,        /* 32-bit unsigned integer */\n\tTIFF_RATIONAL = 5,    /* 64-bit unsigned fraction */\n\tTIFF_SBYTE = 6,       /* !8-bit signed integer */\n\tTIFF_UNDEFINED = 7,   /* !8-bit untyped data */\n\tTIFF_SSHORT = 8,      /* !16-bit signed integer */\n\tTIFF_SLONG = 9,       /* !32-bit signed integer */\n\tTIFF_SRATIONAL = 10,  /* !64-bit signed fraction */\n\tTIFF_FLOAT = 11,      /* !32-bit IEEE floating point */\n\tTIFF_DOUBLE = 12,     /* !64-bit IEEE floating point */\n\tTIFF_IFD = 13,        /* %32-bit unsigned integer (offset) */\n\tTIFF_LONG8 = 16,      /* BigTIFF 64-bit unsigned integer */\n\tTIFF_SLONG8 = 17,     /* BigTIFF 64-bit signed integer */\n\tTIFF_IFD8 = 18        /* BigTIFF 64-bit unsigned integer (offset) */\n} TIFFDataType;\n\n/*\n * TIFF Tag Definitions.\n */\n#define\tTIFFTAG_SUBFILETYPE\t\t254\t/* subfile data descriptor */\n#define\t    FILETYPE_REDUCEDIMAGE\t0x1\t/* reduced resolution version */\n#define\t    FILETYPE_PAGE\t\t0x2\t/* one page of many */\n#define\t    FILETYPE_MASK\t\t0x4\t/* transparency mask */\n#define\tTIFFTAG_OSUBFILETYPE\t\t255\t/* +kind of data in subfile */\n#define\t    OFILETYPE_IMAGE\t\t1\t/* full resolution image data */\n#define\t    OFILETYPE_REDUCEDIMAGE\t2\t/* reduced size image data */\n#define\t    OFILETYPE_PAGE\t\t3\t/* one page of many */\n#define\tTIFFTAG_IMAGEWIDTH\t\t256\t/* image width in pixels */\n#define\tTIFFTAG_IMAGELENGTH\t\t257\t/* image height in pixels */\n#define\tTIFFTAG_BITSPERSAMPLE\t\t258\t/* bits per channel (sample) */\n#define\tTIFFTAG_COMPRESSION\t\t259\t/* data compression technique */\n#define\t    COMPRESSION_NONE\t\t1\t/* dump mode */\n#define\t    COMPRESSION_CCITTRLE\t2\t/* CCITT modified Huffman RLE */\n#define\t    COMPRESSION_CCITTFAX3\t3\t/* CCITT Group 3 fax encoding */\n#define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */\n#define\t    COMPRESSION_CCITTFAX4\t4\t/* CCITT Group 4 fax encoding */\n#define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */\n#define\t    COMPRESSION_LZW\t\t5       /* Lempel-Ziv  & Welch */\n#define\t    COMPRESSION_OJPEG\t\t6\t/* !6.0 JPEG */\n#define\t    COMPRESSION_JPEG\t\t7\t/* %JPEG DCT compression */\n#define     COMPRESSION_T85\t\t\t9\t/* !TIFF/FX T.85 JBIG compression */\n#define     COMPRESSION_T43\t\t\t10\t/* !TIFF/FX T.43 colour by layered JBIG compression */\n#define\t    COMPRESSION_NEXT\t\t32766\t/* NeXT 2-bit RLE */\n#define\t    COMPRESSION_CCITTRLEW\t32771\t/* #1 w/ word alignment */\n#define\t    COMPRESSION_PACKBITS\t32773\t/* Macintosh RLE */\n#define\t    COMPRESSION_THUNDERSCAN\t32809\t/* ThunderScan RLE */\n/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define\t    COMPRESSION_IT8CTPAD\t32895   /* IT8 CT w/padding */\n#define\t    COMPRESSION_IT8LW\t\t32896   /* IT8 Linework RLE */\n#define\t    COMPRESSION_IT8MP\t\t32897   /* IT8 Monochrome picture */\n#define\t    COMPRESSION_IT8BL\t\t32898   /* IT8 Binary line art */\n/* compression codes 32908-32911 are reserved for Pixar */\n#define     COMPRESSION_PIXARFILM\t32908   /* Pixar companded 10bit LZW */\n#define\t    COMPRESSION_PIXARLOG\t32909   /* Pixar companded 11bit ZIP */\n#define\t    COMPRESSION_DEFLATE\t\t32946\t/* Deflate compression */\n#define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,\n\t\t\t\t\t\t   as recognized by Adobe */\n/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */\n#define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */\n#define\t    COMPRESSION_JBIG\t\t34661\t/* ISO JBIG */\n#define     COMPRESSION_SGILOG\t\t34676\t/* SGI Log Luminance RLE */\n#define     COMPRESSION_SGILOG24\t34677\t/* SGI Log 24-bit packed */\n#define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */\n#define\t    COMPRESSION_LZMA\t\t34925\t/* LZMA2 */\n#define\tTIFFTAG_PHOTOMETRIC\t\t262\t/* photometric interpretation */\n#define\t    PHOTOMETRIC_MINISWHITE\t0\t/* min value is white */\n#define\t    PHOTOMETRIC_MINISBLACK\t1\t/* min value is black */\n#define\t    PHOTOMETRIC_RGB\t\t2\t/* RGB color model */\n#define\t    PHOTOMETRIC_PALETTE\t\t3\t/* color map indexed */\n#define\t    PHOTOMETRIC_MASK\t\t4\t/* $holdout mask */\n#define\t    PHOTOMETRIC_SEPARATED\t5\t/* !color separations */\n#define\t    PHOTOMETRIC_YCBCR\t\t6\t/* !CCIR 601 */\n#define\t    PHOTOMETRIC_CIELAB\t\t8\t/* !1976 CIE L*a*b* */\n#define\t    PHOTOMETRIC_ICCLAB\t\t9\t/* ICC L*a*b* [Adobe TIFF Technote 4] */\n#define\t    PHOTOMETRIC_ITULAB\t\t10\t/* ITU L*a*b* */\n#define     PHOTOMETRIC_LOGL\t\t32844\t/* CIE Log2(L) */\n#define     PHOTOMETRIC_LOGLUV\t\t32845\t/* CIE Log2(L) (u',v') */\n#define\tTIFFTAG_THRESHHOLDING\t\t263\t/* +thresholding used on data */\n#define\t    THRESHHOLD_BILEVEL\t\t1\t/* b&w art scan */\n#define\t    THRESHHOLD_HALFTONE\t\t2\t/* or dithered scan */\n#define\t    THRESHHOLD_ERRORDIFFUSE\t3\t/* usually floyd-steinberg */\n#define\tTIFFTAG_CELLWIDTH\t\t264\t/* +dithering matrix width */\n#define\tTIFFTAG_CELLLENGTH\t\t265\t/* +dithering matrix height */\n#define\tTIFFTAG_FILLORDER\t\t266\t/* data order within a byte */\n#define\t    FILLORDER_MSB2LSB\t\t1\t/* most significant -> least */\n#define\t    FILLORDER_LSB2MSB\t\t2\t/* least significant -> most */\n#define\tTIFFTAG_DOCUMENTNAME\t\t269\t/* name of doc. image is from */\n#define\tTIFFTAG_IMAGEDESCRIPTION\t270\t/* info about image */\n#define\tTIFFTAG_MAKE\t\t\t271\t/* scanner manufacturer name */\n#define\tTIFFTAG_MODEL\t\t\t272\t/* scanner model name/number */\n#define\tTIFFTAG_STRIPOFFSETS\t\t273\t/* offsets to data strips */\n#define\tTIFFTAG_ORIENTATION\t\t274\t/* +image orientation */\n#define\t    ORIENTATION_TOPLEFT\t\t1\t/* row 0 top, col 0 lhs */\n#define\t    ORIENTATION_TOPRIGHT\t2\t/* row 0 top, col 0 rhs */\n#define\t    ORIENTATION_BOTRIGHT\t3\t/* row 0 bottom, col 0 rhs */\n#define\t    ORIENTATION_BOTLEFT\t\t4\t/* row 0 bottom, col 0 lhs */\n#define\t    ORIENTATION_LEFTTOP\t\t5\t/* row 0 lhs, col 0 top */\n#define\t    ORIENTATION_RIGHTTOP\t6\t/* row 0 rhs, col 0 top */\n#define\t    ORIENTATION_RIGHTBOT\t7\t/* row 0 rhs, col 0 bottom */\n#define\t    ORIENTATION_LEFTBOT\t\t8\t/* row 0 lhs, col 0 bottom */\n#define\tTIFFTAG_SAMPLESPERPIXEL\t\t277\t/* samples per pixel */\n#define\tTIFFTAG_ROWSPERSTRIP\t\t278\t/* rows per strip of data */\n#define\tTIFFTAG_STRIPBYTECOUNTS\t\t279\t/* bytes counts for strips */\n#define\tTIFFTAG_MINSAMPLEVALUE\t\t280\t/* +minimum sample value */\n#define\tTIFFTAG_MAXSAMPLEVALUE\t\t281\t/* +maximum sample value */\n#define\tTIFFTAG_XRESOLUTION\t\t282\t/* pixels/resolution in x */\n#define\tTIFFTAG_YRESOLUTION\t\t283\t/* pixels/resolution in y */\n#define\tTIFFTAG_PLANARCONFIG\t\t284\t/* storage organization */\n#define\t    PLANARCONFIG_CONTIG\t\t1\t/* single image plane */\n#define\t    PLANARCONFIG_SEPARATE\t2\t/* separate planes of data */\n#define\tTIFFTAG_PAGENAME\t\t285\t/* page name image is from */\n#define\tTIFFTAG_XPOSITION\t\t286\t/* x page offset of image lhs */\n#define\tTIFFTAG_YPOSITION\t\t287\t/* y page offset of image lhs */\n#define\tTIFFTAG_FREEOFFSETS\t\t288\t/* +byte offset to free block */\n#define\tTIFFTAG_FREEBYTECOUNTS\t\t289\t/* +sizes of free blocks */\n#define\tTIFFTAG_GRAYRESPONSEUNIT\t290\t/* $gray scale curve accuracy */\n#define\t    GRAYRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    GRAYRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    GRAYRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_GRAYRESPONSECURVE\t291\t/* $gray scale response curve */\n#define\tTIFFTAG_GROUP3OPTIONS\t\t292\t/* 32 flag bits */\n#define\tTIFFTAG_T4OPTIONS\t\t292\t/* TIFF 6.0 proper name alias */\n#define\t    GROUP3OPT_2DENCODING\t0x1\t/* 2-dimensional coding */\n#define\t    GROUP3OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\t    GROUP3OPT_FILLBITS\t\t0x4\t/* fill to byte boundary */\n#define\tTIFFTAG_GROUP4OPTIONS\t\t293\t/* 32 flag bits */\n#define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */\n#define\t    GROUP4OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\tTIFFTAG_RESOLUTIONUNIT\t\t296\t/* units of resolutions */\n#define\t    RESUNIT_NONE\t\t1\t/* no meaningful units */\n#define\t    RESUNIT_INCH\t\t2\t/* english */\n#define\t    RESUNIT_CENTIMETER\t\t3\t/* metric */\n#define\tTIFFTAG_PAGENUMBER\t\t297\t/* page numbers of multi-page */\n#define\tTIFFTAG_COLORRESPONSEUNIT\t300\t/* $color curve accuracy */\n#define\t    COLORRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    COLORRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    COLORRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_TRANSFERFUNCTION\t301\t/* !colorimetry info */\n#define\tTIFFTAG_SOFTWARE\t\t305\t/* name & release */\n#define\tTIFFTAG_DATETIME\t\t306\t/* creation date and time */\n#define\tTIFFTAG_ARTIST\t\t\t315\t/* creator of image */\n#define\tTIFFTAG_HOSTCOMPUTER\t\t316\t/* machine where created */\n#define\tTIFFTAG_PREDICTOR\t\t317\t/* prediction scheme w/ LZW */\n#define     PREDICTOR_NONE\t\t1\t/* no prediction scheme used */\n#define     PREDICTOR_HORIZONTAL\t2\t/* horizontal differencing */\n#define     PREDICTOR_FLOATINGPOINT\t3\t/* floating point predictor */\n#define\tTIFFTAG_WHITEPOINT\t\t318\t/* image white point */\n#define\tTIFFTAG_PRIMARYCHROMATICITIES\t319\t/* !primary chromaticities */\n#define\tTIFFTAG_COLORMAP\t\t320\t/* RGB map for pallette image */\n#define\tTIFFTAG_HALFTONEHINTS\t\t321\t/* !highlight+shadow info */\n#define\tTIFFTAG_TILEWIDTH\t\t322\t/* !tile width in pixels */\n#define\tTIFFTAG_TILELENGTH\t\t323\t/* !tile height in pixels */\n#define TIFFTAG_TILEOFFSETS\t\t324\t/* !offsets to data tiles */\n#define TIFFTAG_TILEBYTECOUNTS\t\t325\t/* !byte counts for tiles */\n#define\tTIFFTAG_BADFAXLINES\t\t326\t/* lines w/ wrong pixel count */\n#define\tTIFFTAG_CLEANFAXDATA\t\t327\t/* regenerated line info */\n#define\t    CLEANFAXDATA_CLEAN\t\t0\t/* no errors detected */\n#define\t    CLEANFAXDATA_REGENERATED\t1\t/* receiver regenerated lines */\n#define\t    CLEANFAXDATA_UNCLEAN\t2\t/* uncorrected errors exist */\n#define\tTIFFTAG_CONSECUTIVEBADFAXLINES\t328\t/* max consecutive bad lines */\n#define\tTIFFTAG_SUBIFD\t\t\t330\t/* subimage descriptors */\n#define\tTIFFTAG_INKSET\t\t\t332\t/* !inks in separated image */\n#define\t    INKSET_CMYK\t\t\t1\t/* !cyan-magenta-yellow-black color */\n#define\t    INKSET_MULTIINK\t\t2\t/* !multi-ink or hi-fi color */\n#define\tTIFFTAG_INKNAMES\t\t333\t/* !ascii names of inks */\n#define\tTIFFTAG_NUMBEROFINKS\t\t334\t/* !number of inks */\n#define\tTIFFTAG_DOTRANGE\t\t336\t/* !0% and 100% dot codes */\n#define\tTIFFTAG_TARGETPRINTER\t\t337\t/* !separation target */\n#define\tTIFFTAG_EXTRASAMPLES\t\t338\t/* !info about extra samples */\n#define\t    EXTRASAMPLE_UNSPECIFIED\t0\t/* !unspecified data */\n#define\t    EXTRASAMPLE_ASSOCALPHA\t1\t/* !associated alpha data */\n#define\t    EXTRASAMPLE_UNASSALPHA\t2\t/* !unassociated alpha data */\n#define\tTIFFTAG_SAMPLEFORMAT\t\t339\t/* !data sample format */\n#define\t    SAMPLEFORMAT_UINT\t\t1\t/* !unsigned integer data */\n#define\t    SAMPLEFORMAT_INT\t\t2\t/* !signed integer data */\n#define\t    SAMPLEFORMAT_IEEEFP\t\t3\t/* !IEEE floating point data */\n#define\t    SAMPLEFORMAT_VOID\t\t4\t/* !untyped data */\n#define\t    SAMPLEFORMAT_COMPLEXINT\t5\t/* !complex signed int */\n#define\t    SAMPLEFORMAT_COMPLEXIEEEFP\t6\t/* !complex ieee floating */\n#define\tTIFFTAG_SMINSAMPLEVALUE\t\t340\t/* !variable MinSampleValue */\n#define\tTIFFTAG_SMAXSAMPLEVALUE\t\t341\t/* !variable MaxSampleValue */\n#define\tTIFFTAG_CLIPPATH\t\t343\t/* %ClipPath\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_XCLIPPATHUNITS\t\t344\t/* %XClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_YCLIPPATHUNITS\t\t345\t/* %YClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_INDEXED\t\t\t346\t/* %Indexed\n\t\t\t\t\t\t   [Adobe TIFF Technote 3] */\n#define\tTIFFTAG_JPEGTABLES\t\t347\t/* %JPEG table stream */\n#define\tTIFFTAG_OPIPROXY\t\t351\t/* %OPI Proxy [Adobe TIFF technote] */\n/* Tags 400-435 are from the TIFF/FX spec */\n#define TIFFTAG_GLOBALPARAMETERSIFD\t400\t/* ! */\n#define TIFFTAG_PROFILETYPE\t\t\t401\t/* ! */\n#define     PROFILETYPE_UNSPECIFIED\t0\t/* ! */\n#define     PROFILETYPE_G3_FAX\t\t1\t/* ! */\n#define TIFFTAG_FAXPROFILE\t\t\t402\t/* ! */\n#define     FAXPROFILE_S\t\t\t1\t/* !TIFF/FX FAX profile S */\n#define     FAXPROFILE_F\t\t\t2\t/* !TIFF/FX FAX profile F */\n#define     FAXPROFILE_J\t\t\t3\t/* !TIFF/FX FAX profile J */\n#define     FAXPROFILE_C\t\t\t4\t/* !TIFF/FX FAX profile C */\n#define     FAXPROFILE_L\t\t\t5\t/* !TIFF/FX FAX profile L */\n#define     FAXPROFILE_M\t\t\t6\t/* !TIFF/FX FAX profile LM */\n#define TIFFTAG_CODINGMETHODS\t\t403\t/* !TIFF/FX coding methods */\n#define     CODINGMETHODS_T4_1D\t\t(1 << 1)\t/* !T.4 1D */\n#define     CODINGMETHODS_T4_2D\t\t(1 << 2)\t/* !T.4 2D */\n#define     CODINGMETHODS_T6\t\t(1 << 3)\t/* !T.6 */\n#define     CODINGMETHODS_T85 \t\t(1 << 4)\t/* !T.85 JBIG */\n#define     CODINGMETHODS_T42 \t\t(1 << 5)\t/* !T.42 JPEG */\n#define     CODINGMETHODS_T43\t\t(1 << 6)\t/* !T.43 colour by layered JBIG */\n#define TIFFTAG_VERSIONYEAR\t\t\t404\t/* !TIFF/FX version year */\n#define TIFFTAG_MODENUMBER\t\t\t405\t/* !TIFF/FX mode number */\n#define TIFFTAG_DECODE\t\t\t\t433\t/* !TIFF/FX decode */\n#define TIFFTAG_IMAGEBASECOLOR\t\t434\t/* !TIFF/FX image base colour */\n#define TIFFTAG_T82OPTIONS\t\t\t435\t/* !TIFF/FX T.82 options */\n/*\n * Tags 512-521 are obsoleted by Technical Note #2 which specifies a\n * revised JPEG-in-TIFF scheme.\n */\n#define\tTIFFTAG_JPEGPROC\t\t512\t/* !JPEG processing algorithm */\n#define\t    JPEGPROC_BASELINE\t\t1\t/* !baseline sequential */\n#define\t    JPEGPROC_LOSSLESS\t\t14\t/* !Huffman coded lossless */\n#define\tTIFFTAG_JPEGIFOFFSET\t\t513\t/* !pointer to SOI marker */\n#define\tTIFFTAG_JPEGIFBYTECOUNT\t\t514\t/* !JFIF stream length */\n#define\tTIFFTAG_JPEGRESTARTINTERVAL\t515\t/* !restart interval length */\n#define\tTIFFTAG_JPEGLOSSLESSPREDICTORS\t517\t/* !lossless proc predictor */\n#define\tTIFFTAG_JPEGPOINTTRANSFORM\t518\t/* !lossless point transform */\n#define\tTIFFTAG_JPEGQTABLES\t\t519\t/* !Q matrice offsets */\n#define\tTIFFTAG_JPEGDCTABLES\t\t520\t/* !DCT table offsets */\n#define\tTIFFTAG_JPEGACTABLES\t\t521\t/* !AC coefficient offsets */\n#define\tTIFFTAG_YCBCRCOEFFICIENTS\t529\t/* !RGB -> YCbCr transform */\n#define\tTIFFTAG_YCBCRSUBSAMPLING\t530\t/* !YCbCr subsampling factors */\n#define\tTIFFTAG_YCBCRPOSITIONING\t531\t/* !subsample positioning */\n#define\t    YCBCRPOSITION_CENTERED\t1\t/* !as in PostScript Level 2 */\n#define\t    YCBCRPOSITION_COSITED\t2\t/* !as in CCIR 601-1 */\n#define\tTIFFTAG_REFERENCEBLACKWHITE\t532\t/* !colorimetry info */\n#define TIFFTAG_STRIPROWCOUNTS\t\t559 /* !TIFF/FX strip row counts */\n#define\tTIFFTAG_XMLPACKET\t\t700\t/* %XML packet\n\t\t\t\t\t\t   [Adobe XMP Specification,\n\t\t\t\t\t\t   January 2004 */\n#define TIFFTAG_OPIIMAGEID\t\t32781\t/* %OPI ImageID\n\t\t\t\t\t\t   [Adobe TIFF technote] */\n/* tags 32952-32956 are private tags registered to Island Graphics */\n#define TIFFTAG_REFPTS\t\t\t32953\t/* image reference points */\n#define TIFFTAG_REGIONTACKPOINT\t\t32954\t/* region-xform tack point */\n#define TIFFTAG_REGIONWARPCORNERS\t32955\t/* warp quadrilateral */\n#define TIFFTAG_REGIONAFFINE\t\t32956\t/* affine transformation mat */\n/* tags 32995-32999 are private tags registered to SGI */\n#define\tTIFFTAG_MATTEING\t\t32995\t/* $use ExtraSamples */\n#define\tTIFFTAG_DATATYPE\t\t32996\t/* $use SampleFormat */\n#define\tTIFFTAG_IMAGEDEPTH\t\t32997\t/* z depth of image */\n#define\tTIFFTAG_TILEDEPTH\t\t32998\t/* z depth/data tile */\n/* tags 33300-33309 are private tags registered to Pixar */\n/*\n * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH\n * are set when an image has been cropped out of a larger image.  \n * They reflect the size of the original uncropped image.\n * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used\n * to determine the position of the smaller image in the larger one.\n */\n#define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */\n#define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */\n /* Tags 33302-33306 are used to identify special image modes and data\n  * used by Pixar's texture formats.\n  */\n#define TIFFTAG_PIXAR_TEXTUREFORMAT\t33302\t/* texture map format */\n#define TIFFTAG_PIXAR_WRAPMODES\t\t33303\t/* s & t wrap modes */\n#define TIFFTAG_PIXAR_FOVCOT\t\t33304\t/* cotan(fov) for env. maps */\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306\n/* tag 33405 is a private tag registered to Eastman Kodak */\n#define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */\n/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */\n#define\tTIFFTAG_COPYRIGHT\t\t33432\t/* copyright string */\n/* IPTC TAG from RichTIFF specifications */\n#define TIFFTAG_RICHTIFFIPTC\t\t33723\n/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define TIFFTAG_IT8SITE\t\t\t34016\t/* site name */\n#define TIFFTAG_IT8COLORSEQUENCE\t34017\t/* color seq. [RGB,CMYK,etc] */\n#define TIFFTAG_IT8HEADER\t\t34018\t/* DDES Header */\n#define TIFFTAG_IT8RASTERPADDING\t34019\t/* raster scanline padding */\n#define TIFFTAG_IT8BITSPERRUNLENGTH\t34020\t/* # of bits in short run */\n#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */\n#define TIFFTAG_IT8COLORTABLE\t\t34022\t/* LW colortable */\n#define TIFFTAG_IT8IMAGECOLORINDICATOR\t34023\t/* BP/BL image color switch */\n#define TIFFTAG_IT8BKGCOLORINDICATOR\t34024\t/* BP/BL bg color switch */\n#define TIFFTAG_IT8IMAGECOLORVALUE\t34025\t/* BP/BL image color value */\n#define TIFFTAG_IT8BKGCOLORVALUE\t34026\t/* BP/BL bg color value */\n#define TIFFTAG_IT8PIXELINTENSITYRANGE\t34027\t/* MP pixel intensity value */\n#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028\t/* HC transparency switch */\n#define TIFFTAG_IT8COLORCHARACTERIZATION 34029\t/* color character. table */\n#define TIFFTAG_IT8HCUSAGE\t\t34030\t/* HC usage indicator */\n#define TIFFTAG_IT8TRAPINDICATOR\t34031\t/* Trapping indicator\n\t\t\t\t\t\t   (untrapped=0, trapped=1) */\n#define TIFFTAG_IT8CMYKEQUIVALENT\t34032\t/* CMYK color equivalents */\n/* tags 34232-34236 are private tags registered to Texas Instruments */\n#define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */\n/* tag 34377 is private tag registered to Adobe for PhotoShop */\n#define TIFFTAG_PHOTOSHOP\t\t34377 \n/* tags 34665, 34853 and 40965 are documented in EXIF specification */\n#define TIFFTAG_EXIFIFD\t\t\t34665\t/* Pointer to EXIF private directory */\n/* tag 34750 is a private tag registered to Adobe? */\n#define TIFFTAG_ICCPROFILE\t\t34675\t/* ICC profile data */\n#define TIFFTAG_IMAGELAYER\t\t34732\t/* !TIFF/FX image layer information */\n/* tag 34750 is a private tag registered to Pixel Magic */\n#define\tTIFFTAG_JBIGOPTIONS\t\t34750\t/* JBIG options */\n#define TIFFTAG_GPSIFD\t\t\t34853\t/* Pointer to GPS private directory */\n/* tags 34908-34914 are private tags registered to SGI */\n#define\tTIFFTAG_FAXRECVPARAMS\t\t34908\t/* encoded Class 2 ses. parms */\n#define\tTIFFTAG_FAXSUBADDRESS\t\t34909\t/* received SubAddr string */\n#define\tTIFFTAG_FAXRECVTIME\t\t34910\t/* receive time (secs) */\n#define\tTIFFTAG_FAXDCS\t\t\t34911\t/* encoded fax ses. params, Table 2/T.30 */\n/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */\n#define TIFFTAG_STONITS\t\t\t37439\t/* Sample value to Nits */\n/* tag 34929 is a private tag registered to FedEx */\n#define\tTIFFTAG_FEDEX_EDR\t\t34929\t/* unknown use */\n#define TIFFTAG_INTEROPERABILITYIFD\t40965\t/* Pointer to Interoperability private directory */\n/* Adobe Digital Negative (DNG) format tags */\n#define TIFFTAG_DNGVERSION\t\t50706\t/* &DNG version number */\n#define TIFFTAG_DNGBACKWARDVERSION\t50707\t/* &DNG compatibility version */\n#define TIFFTAG_UNIQUECAMERAMODEL\t50708\t/* &name for the camera model */\n#define TIFFTAG_LOCALIZEDCAMERAMODEL\t50709\t/* &localized camera model\n\t\t\t\t\t\t   name */\n#define TIFFTAG_CFAPLANECOLOR\t\t50710\t/* &CFAPattern->LinearRaw space\n\t\t\t\t\t\t   mapping */\n#define TIFFTAG_CFALAYOUT\t\t50711\t/* &spatial layout of the CFA */\n#define TIFFTAG_LINEARIZATIONTABLE\t50712\t/* &lookup table description */\n#define TIFFTAG_BLACKLEVELREPEATDIM\t50713\t/* &repeat pattern size for\n\t\t\t\t\t\t   the BlackLevel tag */\n#define TIFFTAG_BLACKLEVEL\t\t50714\t/* &zero light encoding level */\n#define TIFFTAG_BLACKLEVELDELTAH\t50715\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (columns) */\n#define TIFFTAG_BLACKLEVELDELTAV\t50716\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (rows) */\n#define TIFFTAG_WHITELEVEL\t\t50717\t/* &fully saturated encoding\n\t\t\t\t\t\t   level */\n#define TIFFTAG_DEFAULTSCALE\t\t50718\t/* &default scale factors */\n#define TIFFTAG_DEFAULTCROPORIGIN\t50719\t/* &origin of the final image\n\t\t\t\t\t\t   area */\n#define TIFFTAG_DEFAULTCROPSIZE\t\t50720\t/* &size of the final image \n\t\t\t\t\t\t   area */\n#define TIFFTAG_COLORMATRIX1\t\t50721\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 1 */\n#define TIFFTAG_COLORMATRIX2\t\t50722\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 2 */\n#define TIFFTAG_CAMERACALIBRATION1\t50723\t/* &calibration matrix 1 */\n#define TIFFTAG_CAMERACALIBRATION2\t50724\t/* &calibration matrix 2 */\n#define TIFFTAG_REDUCTIONMATRIX1\t50725\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 1 */\n#define TIFFTAG_REDUCTIONMATRIX2\t50726\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 2 */\n#define TIFFTAG_ANALOGBALANCE\t\t50727\t/* &gain applied the stored raw\n\t\t\t\t\t\t   values*/\n#define TIFFTAG_ASSHOTNEUTRAL\t\t50728\t/* &selected white balance in\n\t\t\t\t\t\t   linear reference space */\n#define TIFFTAG_ASSHOTWHITEXY\t\t50729\t/* &selected white balance in\n\t\t\t\t\t\t   x-y chromaticity\n\t\t\t\t\t\t   coordinates */\n#define TIFFTAG_BASELINEEXPOSURE\t50730\t/* &how much to move the zero\n\t\t\t\t\t\t   point */\n#define TIFFTAG_BASELINENOISE\t\t50731\t/* &relative noise level */\n#define TIFFTAG_BASELINESHARPNESS\t50732\t/* &relative amount of\n\t\t\t\t\t\t   sharpening */\n#define TIFFTAG_BAYERGREENSPLIT\t\t50733\t/* &how closely the values of\n\t\t\t\t\t\t   the green pixels in the\n\t\t\t\t\t\t   blue/green rows track the\n\t\t\t\t\t\t   values of the green pixels\n\t\t\t\t\t\t   in the red/green rows */\n#define TIFFTAG_LINEARRESPONSELIMIT\t50734\t/* &non-linear encoding range */\n#define TIFFTAG_CAMERASERIALNUMBER\t50735\t/* &camera's serial number */\n#define TIFFTAG_LENSINFO\t\t50736\t/* info about the lens */\n#define TIFFTAG_CHROMABLURRADIUS\t50737\t/* &chroma blur radius */\n#define TIFFTAG_ANTIALIASSTRENGTH\t50738\t/* &relative strength of the\n\t\t\t\t\t\t   camera's anti-alias filter */\n#define TIFFTAG_SHADOWSCALE\t\t50739\t/* &used by Adobe Camera Raw */\n#define TIFFTAG_DNGPRIVATEDATA\t\t50740\t/* &manufacturer's private data */\n#define TIFFTAG_MAKERNOTESAFETY\t\t50741\t/* &whether the EXIF MakerNote\n\t\t\t\t\t\t   tag is safe to preserve\n\t\t\t\t\t\t   along with the rest of the\n\t\t\t\t\t\t   EXIF data */\n#define\tTIFFTAG_CALIBRATIONILLUMINANT1\t50778\t/* &illuminant 1 */\n#define TIFFTAG_CALIBRATIONILLUMINANT2\t50779\t/* &illuminant 2 */\n#define TIFFTAG_BESTQUALITYSCALE\t50780\t/* &best quality multiplier */\n#define TIFFTAG_RAWDATAUNIQUEID\t\t50781\t/* &unique identifier for\n\t\t\t\t\t\t   the raw image data */\n#define TIFFTAG_ORIGINALRAWFILENAME\t50827\t/* &file name of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ORIGINALRAWFILEDATA\t50828\t/* &contents of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ACTIVEAREA\t\t50829\t/* &active (non-masked) pixels\n\t\t\t\t\t\t   of the sensor */\n#define TIFFTAG_MASKEDAREAS\t\t50830\t/* &list of coordinates\n\t\t\t\t\t\t   of fully masked pixels */\n#define TIFFTAG_ASSHOTICCPROFILE\t50831\t/* &these two tags used to */\n#define TIFFTAG_ASSHOTPREPROFILEMATRIX\t50832\t/* map cameras's color space\n\t\t\t\t\t\t   into ICC profile space */\n#define TIFFTAG_CURRENTICCPROFILE\t50833\t/* & */\n#define TIFFTAG_CURRENTPREPROFILEMATRIX\t50834\t/* & */\n/* tag 65535 is an undefined tag used by Eastman Kodak */\n#define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */\n\n/*\n * The following are ``pseudo tags'' that can be used to control\n * codec-specific functionality.  These tags are not written to file.\n * Note that these values start at 0xffff+1 so that they'll never\n * collide with Aldus-assigned tags.\n *\n * If you want your private pseudo tags ``registered'' (i.e. added to\n * this file), please post a bug report via the tracking system at\n * http://www.remotesensing.org/libtiff/bugs.html with the appropriate\n * C definitions to add.\n */\n#define\tTIFFTAG_FAXMODE\t\t\t65536\t/* Group 3/4 format control */\n#define\t    FAXMODE_CLASSIC\t0x0000\t\t/* default, include RTC */\n#define\t    FAXMODE_NORTC\t0x0001\t\t/* no RTC at end of data */\n#define\t    FAXMODE_NOEOL\t0x0002\t\t/* no EOL code at end of row */\n#define\t    FAXMODE_BYTEALIGN\t0x0004\t\t/* byte align row */\n#define\t    FAXMODE_WORDALIGN\t0x0008\t\t/* word align row */\n#define\t    FAXMODE_CLASSF\tFAXMODE_NORTC\t/* TIFF Class F */\n#define\tTIFFTAG_JPEGQUALITY\t\t65537\t/* Compression quality level */\n/* Note: quality level is on the IJG 0-100 scale.  Default value is 75 */\n#define\tTIFFTAG_JPEGCOLORMODE\t\t65538\t/* Auto RGB<=>YCbCr convert? */\n#define\t    JPEGCOLORMODE_RAW\t0x0000\t\t/* no conversion (default) */\n#define\t    JPEGCOLORMODE_RGB\t0x0001\t\t/* do auto conversion */\n#define\tTIFFTAG_JPEGTABLESMODE\t\t65539\t/* What to put in JPEGTables */\n#define\t    JPEGTABLESMODE_QUANT 0x0001\t\t/* include quantization tbls */\n#define\t    JPEGTABLESMODE_HUFF\t0x0002\t\t/* include Huffman tbls */\n/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */\n#define\tTIFFTAG_FAXFILLFUNC\t\t65540\t/* G3/G4 fill function */\n#define\tTIFFTAG_PIXARLOGDATAFMT\t\t65549\t/* PixarLogCodec I/O data sz */\n#define\t    PIXARLOGDATAFMT_8BIT\t0\t/* regular u_char samples */\n#define\t    PIXARLOGDATAFMT_8BITABGR\t1\t/* ABGR-order u_chars */\n#define\t    PIXARLOGDATAFMT_11BITLOG\t2\t/* 11-bit log-encoded (raw) */\n#define\t    PIXARLOGDATAFMT_12BITPICIO\t3\t/* as per PICIO (1.0==2048) */\n#define\t    PIXARLOGDATAFMT_16BIT\t4\t/* signed short samples */\n#define\t    PIXARLOGDATAFMT_FLOAT\t5\t/* IEEE float samples */\n/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */\n#define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */\n#define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */\n#define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */\n#define     DCSIMAGERFILTER_IR          0       /* infrared filter */\n#define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */\n#define     DCSIMAGERFILTER_CFA         2       /* color filter array */\n#define     DCSIMAGERFILTER_OTHER       3       /* other filter */\n#define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */\n#define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */\n#define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */\n#define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */\n#define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */\n#define TIFFTAG_DCSGAMMA                65554   /* gamma value */\n#define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */\n#define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */\n/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */\n#define\tTIFFTAG_ZIPQUALITY\t\t65557\t/* compression quality level */\n#define\tTIFFTAG_PIXARLOGQUALITY\t\t65558\t/* PixarLog uses same scale */\n/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSCLIPRECTANGLE\t65559\t/* area of image to acquire */\n#define TIFFTAG_SGILOGDATAFMT\t\t65560\t/* SGILog user data format */\n#define     SGILOGDATAFMT_FLOAT\t\t0\t/* IEEE float samples */\n#define     SGILOGDATAFMT_16BIT\t\t1\t/* 16-bit samples */\n#define     SGILOGDATAFMT_RAW\t\t2\t/* uninterpreted data */\n#define     SGILOGDATAFMT_8BIT\t\t3\t/* 8-bit RGB monitor values */\n#define TIFFTAG_SGILOGENCODE\t\t65561 /* SGILog data encoding control*/\n#define     SGILOGENCODE_NODITHER\t0     /* do not dither encoded values*/\n#define     SGILOGENCODE_RANDITHER\t1     /* randomly dither encd values */\n#define\tTIFFTAG_LZMAPRESET\t\t65562\t/* LZMA2 preset (compression level) */\n#define TIFFTAG_PERSAMPLE       65563\t/* interface for per sample tags */\n#define     PERSAMPLE_MERGED        0\t/* present as a single value */\n#define     PERSAMPLE_MULTI         1\t/* present as multiple values */\n\n/*\n * EXIF tags\n */\n#define EXIFTAG_EXPOSURETIME\t\t33434\t/* Exposure time */\n#define EXIFTAG_FNUMBER\t\t\t33437\t/* F number */\n#define EXIFTAG_EXPOSUREPROGRAM\t\t34850\t/* Exposure program */\n#define EXIFTAG_SPECTRALSENSITIVITY\t34852\t/* Spectral sensitivity */\n#define EXIFTAG_ISOSPEEDRATINGS\t\t34855\t/* ISO speed rating */\n#define EXIFTAG_OECF\t\t\t34856\t/* Optoelectric conversion\n\t\t\t\t\t\t   factor */\n#define EXIFTAG_EXIFVERSION\t\t36864\t/* Exif version */\n#define EXIFTAG_DATETIMEORIGINAL\t36867\t/* Date and time of original\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_DATETIMEDIGITIZED\t36868\t/* Date and time of digital\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_COMPONENTSCONFIGURATION\t37121\t/* Meaning of each component */\n#define EXIFTAG_COMPRESSEDBITSPERPIXEL\t37122\t/* Image compression mode */\n#define EXIFTAG_SHUTTERSPEEDVALUE\t37377\t/* Shutter speed */\n#define EXIFTAG_APERTUREVALUE\t\t37378\t/* Aperture */\n#define EXIFTAG_BRIGHTNESSVALUE\t\t37379\t/* Brightness */\n#define EXIFTAG_EXPOSUREBIASVALUE\t37380\t/* Exposure bias */\n#define EXIFTAG_MAXAPERTUREVALUE\t37381\t/* Maximum lens aperture */\n#define EXIFTAG_SUBJECTDISTANCE\t\t37382\t/* Subject distance */\n#define EXIFTAG_METERINGMODE\t\t37383\t/* Metering mode */\n#define EXIFTAG_LIGHTSOURCE\t\t37384\t/* Light source */\n#define EXIFTAG_FLASH\t\t\t37385\t/* Flash */\n#define EXIFTAG_FOCALLENGTH\t\t37386\t/* Lens focal length */\n#define EXIFTAG_SUBJECTAREA\t\t37396\t/* Subject area */\n#define EXIFTAG_MAKERNOTE\t\t37500\t/* Manufacturer notes */\n#define EXIFTAG_USERCOMMENT\t\t37510\t/* User comments */\n#define EXIFTAG_SUBSECTIME\t\t37520\t/* DateTime subseconds */\n#define EXIFTAG_SUBSECTIMEORIGINAL\t37521\t/* DateTimeOriginal subseconds */\n#define EXIFTAG_SUBSECTIMEDIGITIZED\t37522\t/* DateTimeDigitized subseconds */\n#define EXIFTAG_FLASHPIXVERSION\t\t40960\t/* Supported Flashpix version */\n#define EXIFTAG_COLORSPACE\t\t40961\t/* Color space information */\n#define EXIFTAG_PIXELXDIMENSION\t\t40962\t/* Valid image width */\n#define EXIFTAG_PIXELYDIMENSION\t\t40963\t/* Valid image height */\n#define EXIFTAG_RELATEDSOUNDFILE\t40964\t/* Related audio file */\n#define EXIFTAG_FLASHENERGY\t\t41483\t/* Flash energy */\n#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484\t/* Spatial frequency response */\n#define EXIFTAG_FOCALPLANEXRESOLUTION\t41486\t/* Focal plane X resolution */\n#define EXIFTAG_FOCALPLANEYRESOLUTION\t41487\t/* Focal plane Y resolution */\n#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488\t/* Focal plane resolution unit */\n#define EXIFTAG_SUBJECTLOCATION\t\t41492\t/* Subject location */\n#define EXIFTAG_EXPOSUREINDEX\t\t41493\t/* Exposure index */\n#define EXIFTAG_SENSINGMETHOD\t\t41495\t/* Sensing method */\n#define EXIFTAG_FILESOURCE\t\t41728\t/* File source */\n#define EXIFTAG_SCENETYPE\t\t41729\t/* Scene type */\n#define EXIFTAG_CFAPATTERN\t\t41730\t/* CFA pattern */\n#define EXIFTAG_CUSTOMRENDERED\t\t41985\t/* Custom image processing */\n#define EXIFTAG_EXPOSUREMODE\t\t41986\t/* Exposure mode */\n#define EXIFTAG_WHITEBALANCE\t\t41987\t/* White balance */\n#define EXIFTAG_DIGITALZOOMRATIO\t41988\t/* Digital zoom ratio */\n#define EXIFTAG_FOCALLENGTHIN35MMFILM\t41989\t/* Focal length in 35 mm film */\n#define EXIFTAG_SCENECAPTURETYPE\t41990\t/* Scene capture type */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_CONTRAST\t\t41992\t/* Contrast */\n#define EXIFTAG_SATURATION\t\t41993\t/* Saturation */\n#define EXIFTAG_SHARPNESS\t\t41994\t/* Sharpness */\n#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995\t/* Device settings description */\n#define EXIFTAG_SUBJECTDISTANCERANGE\t41996\t/* Subject distance range */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_IMAGEUNIQUEID\t\t42016\t/* Unique image ID */\n\n#endif /* _TIFF_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/android/tiffconf.h",
    "content": "/* libtiff/tiffconf.h.  Generated from tiffconf.h.in by configure.  */\n/*\n  Configuration defines for installed libtiff.\n  This file maintained for backward compatibility. Do not use definitions\n  from this file in your programs.\n*/\n\n#ifndef _TIFFCONF_\n#define _TIFFCONF_\n\n/* Signed 16-bit type */\n#define TIFF_INT16_T signed short\n\n/* Signed 32-bit type */\n#define TIFF_INT32_T signed int\n\n/* Signed 64-bit type */\n#define TIFF_INT64_T signed long long\n\n/* Signed 8-bit type */\n#define TIFF_INT8_T signed char\n\n/* Unsigned 16-bit type */\n#define TIFF_UINT16_T unsigned short\n\n/* Unsigned 32-bit type */\n#define TIFF_UINT32_T unsigned int\n\n/* Unsigned 64-bit type */\n#define TIFF_UINT64_T unsigned long long\n\n/* Unsigned 8-bit type */\n#define TIFF_UINT8_T unsigned char\n\n/* Signed size type */\n#define TIFF_SSIZE_T signed long\n\n/* Pointer difference type */\n#define TIFF_PTRDIFF_T ptrdiff_t\n\n/* Define to 1 if the system has the type `int16'. */\n/* #undef HAVE_INT16 */\n\n/* Define to 1 if the system has the type `int32'. */\n/* #undef HAVE_INT32 */\n\n/* Define to 1 if the system has the type `int8'. */\n/* #undef HAVE_INT8 */\n\n/* Compatibility stuff. */\n\n/* Define as 0 or 1 according to the floating point format suported by the\n   machine */\n#define HAVE_IEEEFP 1\n\n/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */\n#define HOST_FILLORDER FILLORDER_MSB2LSB\n\n/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian\n   (Intel) */\n#define HOST_BIGENDIAN 0\n\n/* Support CCITT Group 3 & 4 algorithms */\n#define CCITT_SUPPORT 1\n\n/* Support JPEG compression (requires IJG JPEG library) */\n/* #undef JPEG_SUPPORT */\n\n/* Support JBIG compression (requires JBIG-KIT library) */\n/* #undef JBIG_SUPPORT */\n\n/* Support LogLuv high dynamic range encoding */\n#define LOGLUV_SUPPORT 1\n\n/* Support LZW algorithm */\n#define LZW_SUPPORT 1\n\n/* Support NeXT 2-bit RLE algorithm */\n#define NEXT_SUPPORT 1\n\n/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation\n   fails with unpatched IJG JPEG library) */\n/* #undef OJPEG_SUPPORT */\n\n/* Support Macintosh PackBits algorithm */\n#define PACKBITS_SUPPORT 1\n\n/* Support Pixar log-format algorithm (requires Zlib) */\n#define PIXARLOG_SUPPORT 1\n\n/* Support ThunderScan 4-bit RLE algorithm */\n#define THUNDER_SUPPORT 1\n\n/* Support Deflate compression */\n#define ZIP_SUPPORT 1\n\n/* Support strip chopping (whether or not to convert single-strip uncompressed\n   images to mutiple strips of ~8Kb to reduce memory usage) */\n#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP\n\n/* Enable SubIFD tag (330) support */\n#define SUBIFD_SUPPORT 1\n\n/* Treat extra sample as alpha (default enabled). The RGBA interface will\n   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many\n   packages produce RGBA files but don't mark the alpha properly. */\n#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1\n\n/* Pick up YCbCr subsampling info from the JPEG data stream to support files\n   lacking the tag (default enabled). */\n#define CHECK_JPEG_YCBCR_SUBSAMPLING 1\n\n/* Support MS MDI magic number files as TIFF */\n#define MDI_SUPPORT 1\n\n/*\n * Feature support definitions.\n * XXX: These macros are obsoleted. Don't use them in your apps!\n * Macros stays here for backward compatibility and should be always defined.\n */\n#define COLORIMETRY_SUPPORT\n#define YCBCR_SUPPORT\n#define CMYK_SUPPORT\n#define ICC_SUPPORT\n#define PHOTOSHOP_SUPPORT\n#define IPTC_SUPPORT\n\n#endif /* _TIFFCONF_ */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/android/tiffio.h",
    "content": "/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and\n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF\n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFFIO_\n#define\t_TIFFIO_\n\n/*\n * TIFF I/O Library Definitions.\n */\n#include \"tiff.h\"\n#include \"tiffvers.h\"\n\n/*\n * TIFF is defined as an incomplete type to hide the\n * library's internal data structures from clients.\n */\ntypedef struct tiff TIFF;\n\n/*\n * The following typedefs define the intrinsic size of\n * data types used in the *exported* interfaces.  These\n * definitions depend on the proper definition of types\n * in tiff.h.  Note also that the varargs interface used\n * to pass tag types and values uses the types defined in\n * tiff.h directly.\n *\n * NB: ttag_t is unsigned int and not unsigned short because\n *     ANSI C requires that the type before the ellipsis be a\n *     promoted type (i.e. one of int, unsigned int, pointer,\n *     or double) and because we defined pseudo-tags that are\n *     outside the range of legal Aldus-assigned tags.\n * NB: tsize_t is int32 and not uint32 because some functions\n *     return -1.\n * NB: toff_t is not off_t for many reasons; TIFFs max out at\n *     32-bit file offsets, and BigTIFF maxes out at 64-bit\n *     offsets being the most important, and to ensure use of\n *     a consistently unsigned type across architectures.\n *     Prior to libtiff 4.0, this was an unsigned 32 bit type.\n */\n/*\n * this is the machine addressing size type, only it's signed, so make it\n * int32 on 32bit machines, int64 on 64bit machines\n */\ntypedef TIFF_SSIZE_T tmsize_t;\ntypedef uint64 toff_t;          /* file offset */\n/* the following are deprecated and should be replaced by their defining\n   counterparts */\ntypedef uint32 ttag_t;          /* directory tag */\ntypedef uint16 tdir_t;          /* directory index */\ntypedef uint16 tsample_t;       /* sample number */\ntypedef uint32 tstrile_t;       /* strip or tile number */\ntypedef tstrile_t tstrip_t;     /* strip number */\ntypedef tstrile_t ttile_t;      /* tile number */\ntypedef tmsize_t tsize_t;       /* i/o size in bytes */\ntypedef void* tdata_t;          /* image data ref */\n\n#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))\n#define __WIN32__\n#endif\n\n/*\n * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c\n * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).\n *\n * By default tif_unix.c is assumed.\n */\n\n#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)\n#  if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)\n#    define AVOID_WIN32_FILEIO\n#  endif\n#endif\n\n#if defined(USE_WIN32_FILEIO)\n# define VC_EXTRALEAN\n# include <windows.h>\n# ifdef __WIN32__\nDECLARE_HANDLE(thandle_t);     /* Win32 file handle */\n# else\ntypedef HFILE thandle_t;       /* client data handle */\n# endif /* __WIN32__ */\n#else\ntypedef void* thandle_t;       /* client data handle */\n#endif /* USE_WIN32_FILEIO */\n\n/*\n * Flags to pass to TIFFPrintDirectory to control\n * printing of data structures that are potentially\n * very large.   Bit-or these flags to enable printing\n * multiple items.\n */\n#define TIFFPRINT_NONE\t       0x0    /* no extra info */\n#define TIFFPRINT_STRIPS       0x1    /* strips/tiles info */\n#define TIFFPRINT_CURVES       0x2    /* color/gray response curves */\n#define TIFFPRINT_COLORMAP     0x4    /* colormap */\n#define TIFFPRINT_JPEGQTABLES  0x100  /* JPEG Q matrices */\n#define TIFFPRINT_JPEGACTABLES 0x200  /* JPEG AC tables */\n#define TIFFPRINT_JPEGDCTABLES 0x200  /* JPEG DC tables */\n\n/* \n * Colour conversion stuff\n */\n\n/* reference white */\n#define D65_X0 (95.0470F)\n#define D65_Y0 (100.0F)\n#define D65_Z0 (108.8827F)\n\n#define D50_X0 (96.4250F)\n#define D50_Y0 (100.0F)\n#define D50_Z0 (82.4680F)\n\n/* Structure for holding information about a display device. */\n\ntypedef unsigned char TIFFRGBValue;               /* 8-bit samples */\n\ntypedef struct {\n\tfloat d_mat[3][3];                        /* XYZ -> luminance matrix */\n\tfloat d_YCR;                              /* Light o/p for reference white */\n\tfloat d_YCG;\n\tfloat d_YCB;\n\tuint32 d_Vrwr;                            /* Pixel values for ref. white */\n\tuint32 d_Vrwg;\n\tuint32 d_Vrwb;\n\tfloat d_Y0R;                              /* Residual light for black pixel */\n\tfloat d_Y0G;\n\tfloat d_Y0B;\n\tfloat d_gammaR;                           /* Gamma values for the three guns */\n\tfloat d_gammaG;\n\tfloat d_gammaB;\n} TIFFDisplay;\n\ntypedef struct {                                  /* YCbCr->RGB support */\n\tTIFFRGBValue* clamptab;                   /* range clamping table */\n\tint* Cr_r_tab;\n\tint* Cb_b_tab;\n\tint32* Cr_g_tab;\n\tint32* Cb_g_tab;\n\tint32* Y_tab;\n} TIFFYCbCrToRGB;\n\ntypedef struct {                                  /* CIE Lab 1976->RGB support */\n\tint range;                                /* Size of conversion table */\n#define CIELABTORGB_TABLE_RANGE 1500\n\tfloat rstep, gstep, bstep;\n\tfloat X0, Y0, Z0;                         /* Reference white point */\n\tTIFFDisplay display;\n\tfloat Yr2r[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yr to r */\n\tfloat Yg2g[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yg to g */\n\tfloat Yb2b[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yb to b */\n} TIFFCIELabToRGB;\n\n/*\n * RGBA-style image support.\n */\ntypedef struct _TIFFRGBAImage TIFFRGBAImage;\n/*\n * The image reading and conversion routines invoke\n * ``put routines'' to copy/image/whatever tiles of\n * raw image data.  A default set of routines are \n * provided to convert/copy raw image data to 8-bit\n * packed ABGR format rasters.  Applications can supply\n * alternate routines that unpack the data into a\n * different format or, for example, unpack the data\n * and draw the unpacked raster on the display.\n */\ntypedef void (*tileContigRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*);\ntypedef void (*tileSeparateRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*, unsigned char*, unsigned char*, unsigned char*);\n/*\n * RGBA-reader state.\n */\nstruct _TIFFRGBAImage {\n\tTIFF* tif;                              /* image handle */\n\tint stoponerr;                          /* stop on read error */\n\tint isContig;                           /* data is packed/separate */\n\tint alpha;                              /* type of alpha data present */\n\tuint32 width;                           /* image width */\n\tuint32 height;                          /* image height */\n\tuint16 bitspersample;                   /* image bits/sample */\n\tuint16 samplesperpixel;                 /* image samples/pixel */\n\tuint16 orientation;                     /* image orientation */\n\tuint16 req_orientation;                 /* requested orientation */\n\tuint16 photometric;                     /* image photometric interp */\n\tuint16* redcmap;                        /* colormap pallete */\n\tuint16* greencmap;\n\tuint16* bluecmap;\n\t/* get image data routine */\n\tint (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);\n\t/* put decoded strip/tile */\n\tunion {\n\t    void (*any)(TIFFRGBAImage*);\n\t    tileContigRoutine contig;\n\t    tileSeparateRoutine separate;\n\t} put;\n\tTIFFRGBValue* Map;                      /* sample mapping array */\n\tuint32** BWmap;                         /* black&white map */\n\tuint32** PALmap;                        /* palette image map */\n\tTIFFYCbCrToRGB* ycbcr;                  /* YCbCr conversion state */\n\tTIFFCIELabToRGB* cielab;                /* CIE L*a*b conversion state */\n\n\tuint8* UaToAa;                          /* Unassociated alpha to associated alpha convertion LUT */\n\tuint8* Bitdepth16To8;                   /* LUT for conversion from 16bit to 8bit values */\n\n\tint row_offset;\n\tint col_offset;\n};\n\n/*\n * Macros for extracting components from the\n * packed ABGR form returned by TIFFReadRGBAImage.\n */\n#define TIFFGetR(abgr) ((abgr) & 0xff)\n#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)\n#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)\n#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)\n\n/*\n * A CODEC is a software package that implements decoding,\n * encoding, or decoding+encoding of a compression algorithm.\n * The library provides a collection of builtin codecs.\n * More codecs may be registered through calls to the library\n * and/or the builtin implementations may be overridden.\n */\ntypedef int (*TIFFInitMethod)(TIFF*, int);\ntypedef struct {\n\tchar* name;\n\tuint16 scheme;\n\tTIFFInitMethod init;\n} TIFFCodec;\n\n#include <stdio.h>\n#include <stdarg.h>\n\n/* share internal LogLuv conversion routines? */\n#ifndef LOGLUV_PUBLIC\n#define LOGLUV_PUBLIC 1\n#endif\n\n#if !defined(__GNUC__) && !defined(__attribute__)\n#  define __attribute__(x) /*nothing*/\n#endif\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern \"C\" {\n#endif\ntypedef void (*TIFFErrorHandler)(const char*, const char*, va_list);\ntypedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);\ntypedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t);\ntypedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);\ntypedef int (*TIFFCloseProc)(thandle_t);\ntypedef toff_t (*TIFFSizeProc)(thandle_t);\ntypedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size);\ntypedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size);\ntypedef void (*TIFFExtendProc)(TIFF*);\n\nextern const char* TIFFGetVersion(void);\n\nextern const TIFFCodec* TIFFFindCODEC(uint16);\nextern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);\nextern void TIFFUnRegisterCODEC(TIFFCodec*);\nextern int TIFFIsCODECConfigured(uint16);\nextern TIFFCodec* TIFFGetConfiguredCODECs(void);\n\n/*\n * Auxiliary functions.\n */\n\nextern void* _TIFFmalloc(tmsize_t s);\nextern void* _TIFFrealloc(void* p, tmsize_t s);\nextern void _TIFFmemset(void* p, int v, tmsize_t c);\nextern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);\nextern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);\nextern void _TIFFfree(void* p);\n\n/*\n** Stuff, related to tag handling and creating custom tags.\n*/\nextern int TIFFGetTagListCount( TIFF * );\nextern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );\n    \n#define TIFF_ANY       TIFF_NOTYPE     /* for field descriptor searching */\n#define TIFF_VARIABLE  -1              /* marker for variable length tags */\n#define TIFF_SPP       -2              /* marker for SamplesPerPixel tags */\n#define TIFF_VARIABLE2 -3              /* marker for uint32 var-length tags */\n\n#define FIELD_CUSTOM    65\n\ntypedef struct _TIFFField TIFFField;\ntypedef struct _TIFFFieldArray TIFFFieldArray;\n\nextern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);\nextern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);\nextern const TIFFField* TIFFFieldWithName(TIFF*, const char *);\n\nextern uint32 TIFFFieldTag(const TIFFField*);\nextern const char* TIFFFieldName(const TIFFField*);\nextern TIFFDataType TIFFFieldDataType(const TIFFField*);\nextern int TIFFFieldPassCount(const TIFFField*);\nextern int TIFFFieldReadCount(const TIFFField*);\nextern int TIFFFieldWriteCount(const TIFFField*);\n\ntypedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);\ntypedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);\ntypedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);\n\ntypedef struct {\n    TIFFVSetMethod vsetfield; /* tag set routine */\n    TIFFVGetMethod vgetfield; /* tag get routine */\n    TIFFPrintMethod printdir; /* directory print routine */\n} TIFFTagMethods;\n\nextern  TIFFTagMethods *TIFFAccessTagMethods(TIFF *);\nextern  void *TIFFGetClientInfo(TIFF *, const char *);\nextern  void TIFFSetClientInfo(TIFF *, void *, const char *);\n\nextern void TIFFCleanup(TIFF* tif);\nextern void TIFFClose(TIFF* tif);\nextern int TIFFFlush(TIFF* tif);\nextern int TIFFFlushData(TIFF* tif);\nextern int TIFFGetField(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFReadDirectory(TIFF* tif);\nextern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);\nextern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);\nextern uint64 TIFFScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFScanlineSize(TIFF* tif);\nextern uint64 TIFFRasterScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFRasterScanlineSize(TIFF* tif);\nextern uint64 TIFFStripSize64(TIFF* tif);\nextern tmsize_t TIFFStripSize(TIFF* tif);\nextern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);\nextern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);\nextern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);\nextern uint64 TIFFTileRowSize64(TIFF* tif);\nextern tmsize_t TIFFTileRowSize(TIFF* tif);\nextern uint64 TIFFTileSize64(TIFF* tif);\nextern tmsize_t TIFFTileSize(TIFF* tif);\nextern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);\nextern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);\nextern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);\nextern int TIFFFileno(TIFF*);\nextern int TIFFSetFileno(TIFF*, int);\nextern thandle_t TIFFClientdata(TIFF*);\nextern thandle_t TIFFSetClientdata(TIFF*, thandle_t);\nextern int TIFFGetMode(TIFF*);\nextern int TIFFSetMode(TIFF*, int);\nextern int TIFFIsTiled(TIFF*);\nextern int TIFFIsByteSwapped(TIFF*);\nextern int TIFFIsUpSampled(TIFF*);\nextern int TIFFIsMSB2LSB(TIFF*);\nextern int TIFFIsBigEndian(TIFF*);\nextern TIFFReadWriteProc TIFFGetReadProc(TIFF*);\nextern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);\nextern TIFFSeekProc TIFFGetSeekProc(TIFF*);                                                          \nextern TIFFCloseProc TIFFGetCloseProc(TIFF*);\nextern TIFFSizeProc TIFFGetSizeProc(TIFF*);\nextern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);\nextern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);\nextern uint32 TIFFCurrentRow(TIFF*);\nextern uint16 TIFFCurrentDirectory(TIFF*);\nextern uint16 TIFFNumberOfDirectories(TIFF*);\nextern uint64 TIFFCurrentDirOffset(TIFF*);\nextern uint32 TIFFCurrentStrip(TIFF*);\nextern uint32 TIFFCurrentTile(TIFF* tif);\nextern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);\nextern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);  \nextern int TIFFSetupStrips(TIFF *);\nextern int TIFFWriteCheck(TIFF*, int, const char *);\nextern void TIFFFreeDirectory(TIFF*);\nextern int TIFFCreateDirectory(TIFF*);\nextern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*);\nextern int TIFFCreateEXIFDirectory(TIFF*);\nextern int TIFFLastDirectory(TIFF*);\nextern int TIFFSetDirectory(TIFF*, uint16);\nextern int TIFFSetSubDirectory(TIFF*, uint64);\nextern int TIFFUnlinkDirectory(TIFF*, uint16);\nextern int TIFFSetField(TIFF*, uint32, ...);\nextern int TIFFVSetField(TIFF*, uint32, va_list);\nextern int TIFFUnsetField(TIFF*, uint32);\nextern int TIFFWriteDirectory(TIFF *);\nextern int TIFFWriteCustomDirectory(TIFF *, uint64 *);\nextern int TIFFCheckpointDirectory(TIFF *);\nextern int TIFFRewriteDirectory(TIFF *);\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,\n    int = ORIENTATION_BOTLEFT, int = 0);\n#else\nextern void TIFFPrintDirectory(TIFF*, FILE*, long);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);\n#endif\n\nextern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );\nextern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );\nextern int TIFFRGBAImageOK(TIFF*, char [1024]);\nextern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);\nextern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);\nextern void TIFFRGBAImageEnd(TIFFRGBAImage*);\nextern TIFF* TIFFOpen(const char*, const char*);\n# ifdef __WIN32__\nextern TIFF* TIFFOpenW(const wchar_t*, const char*);\n# endif /* __WIN32__ */\nextern TIFF* TIFFFdOpen(int, const char*, const char*);\nextern TIFF* TIFFClientOpen(const char*, const char*,\n\t    thandle_t,\n\t    TIFFReadWriteProc, TIFFReadWriteProc,\n\t    TIFFSeekProc, TIFFCloseProc,\n\t    TIFFSizeProc,\n\t    TIFFMapFileProc, TIFFUnmapFileProc);\nextern const char* TIFFFileName(TIFF*);\nextern const char* TIFFSetFileName(TIFF*, const char *);\nextern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);\nextern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);\nextern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);\nextern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFNumberOfTiles(TIFF*);\nextern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);  \nextern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);\nextern uint32 TIFFNumberOfStrips(TIFF*);\nextern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);\nextern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);\nextern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern int TIFFDataWidth(TIFFDataType);    /* table of tag datatype widths */\nextern void TIFFSetWriteOffset(TIFF* tif, toff_t off);\nextern void TIFFSwabShort(uint16*);\nextern void TIFFSwabLong(uint32*);\nextern void TIFFSwabLong8(uint64*);\nextern void TIFFSwabFloat(float*);\nextern void TIFFSwabDouble(double*);\nextern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);\nextern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);\nextern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);\nextern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);\nextern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);\nextern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);\nextern void TIFFReverseBits(uint8* cp, tmsize_t n);\nextern const unsigned char* TIFFGetBitRevTable(int);\n\n#ifdef LOGLUV_PUBLIC\n#define U_NEU\t\t0.210526316\n#define V_NEU\t\t0.473684211\n#define UVSCALE\t\t410.\nextern double LogL16toY(int);\nextern double LogL10toY(int);\nextern void XYZtoRGB24(float*, uint8*);\nextern int uv_decode(double*, double*, int);\nextern void LogLuv24toXYZ(uint32, float*);\nextern void LogLuv32toXYZ(uint32, float*);\n#if defined(c_plusplus) || defined(__cplusplus)\nextern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);\nextern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);\nextern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);\n#else\nextern int LogL16fromY(double, int);\nextern int LogL10fromY(double, int);\nextern int uv_encode(double, double, int);\nextern uint32 LogLuv24fromXYZ(float*, int);\nextern uint32 LogLuv32fromXYZ(float*, int);\n#endif\n#endif /* LOGLUV_PUBLIC */\n\nextern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);\nextern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,\n    float *, float *, float *);\nextern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,\n    uint32 *, uint32 *, uint32 *);\n\nextern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);\nextern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,\n    uint32 *, uint32 *, uint32 *);\n\n/****************************************************************************\n *               O B S O L E T E D    I N T E R F A C E S\n *\n * Don't use this stuff in your applications, it may be removed in the future\n * libtiff versions.\n ****************************************************************************/\ntypedef\tstruct {\n\tttag_t\tfield_tag;\t\t/* field's tag */\n\tshort\tfield_readcount;\t/* read count/TIFF_VARIABLE/TIFF_SPP */\n\tshort\tfield_writecount;\t/* write count/TIFF_VARIABLE */\n\tTIFFDataType field_type;\t/* type of associated data */\n        unsigned short field_bit;\t/* bit in fieldsset bit vector */\n\tunsigned char field_oktochange;\t/* if true, can change while writing */\n\tunsigned char field_passcount;\t/* if true, pass dir count on set */\n\tchar\t*field_name;\t\t/* ASCII name */\n} TIFFFieldInfo;\n\nextern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);\n        \n#if defined(c_plusplus) || defined(__cplusplus)\n}\n#endif\n\n#endif /* _TIFFIO_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/android/tiffvers.h",
    "content": "#define TIFFLIB_VERSION_STR \"LIBTIFF, Version 4.0.3\\nCopyright (c) 1988-1996 Sam Leffler\\nCopyright (c) 1991-1996 Silicon Graphics, Inc.\"\n/*\n * This define can be used in code that requires\n * compilation-related definitions specific to a\n * version or versions of the library.  Runtime\n * version checking should be done based on the\n * string returned by TIFFGetVersion.\n */\n#define TIFFLIB_VERSION 20120922\n"
  },
  {
    "path": "cocos2d/external/tiff/include/ios/tiff.h",
    "content": "/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and \n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n * \n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  \n * \n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF \n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE \n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFF_\n#define\t_TIFF_\n\n#include \"tiffconf.h\"\n\n/*\n * Tag Image File Format (TIFF)\n *\n * Based on Rev 6.0 from:\n *    Developer's Desk\n *    Aldus Corporation\n *    411 First Ave. South\n *    Suite 200\n *    Seattle, WA  98104\n *    206-622-5500\n *\n *    (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)\n *\n * For BigTIFF design notes see the following links\n *    http://www.remotesensing.org/libtiff/bigtiffdesign.html\n *    http://www.awaresystems.be/imaging/tiff/bigtiff.html\n */\n\n#define TIFF_VERSION_CLASSIC 42\n#define TIFF_VERSION_BIG 43\n\n#define TIFF_BIGENDIAN      0x4d4d\n#define TIFF_LITTLEENDIAN   0x4949\n#define MDI_LITTLEENDIAN    0x5045\n#define MDI_BIGENDIAN       0x4550\n\n/*\n * Intrinsic data types required by the file format:\n *\n * 8-bit quantities     int8/uint8\n * 16-bit quantities    int16/uint16\n * 32-bit quantities    int32/uint32\n * 64-bit quantities    int64/uint64\n * strings              unsigned char*\n */\n\ntypedef TIFF_INT8_T   int8;\ntypedef TIFF_UINT8_T  uint8;\n\ntypedef TIFF_INT16_T  int16;\ntypedef TIFF_UINT16_T uint16;\n\ntypedef TIFF_INT32_T  int32;\ntypedef TIFF_UINT32_T uint32;\n\ntypedef TIFF_INT64_T  int64;\ntypedef TIFF_UINT64_T uint64;\n\n/*\n * Some types as promoted in a variable argument list\n * We use uint16_vap rather then directly using int, because this way\n * we document the type we actually want to pass through, conceptually,\n * rather then confusing the issue by merely stating the type it gets\n * promoted to\n */\n\ntypedef int uint16_vap;\n\n/*\n * TIFF header.\n */\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n} TIFFHeaderCommon;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint32 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderClassic;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint16 tiff_offsetsize; /* size of offsets, should be 8 */\n\tuint16 tiff_unused;     /* unused word, should be 0 */\n\tuint64 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderBig;\n\n\n/*\n * NB: In the comments below,\n *  - items marked with a + are obsoleted by revision 5.0,\n *  - items marked with a ! are introduced in revision 6.0.\n *  - items marked with a % are introduced post revision 6.0.\n *  - items marked with a $ are obsoleted by revision 6.0.\n *  - items marked with a & are introduced by Adobe DNG specification.\n */\n\n/*\n * Tag data type information.\n *\n * Note: RATIONALs are the ratio of two 32-bit integer values.\n */\ntypedef enum {\n\tTIFF_NOTYPE = 0,      /* placeholder */\n\tTIFF_BYTE = 1,        /* 8-bit unsigned integer */\n\tTIFF_ASCII = 2,       /* 8-bit bytes w/ last byte null */\n\tTIFF_SHORT = 3,       /* 16-bit unsigned integer */\n\tTIFF_LONG = 4,        /* 32-bit unsigned integer */\n\tTIFF_RATIONAL = 5,    /* 64-bit unsigned fraction */\n\tTIFF_SBYTE = 6,       /* !8-bit signed integer */\n\tTIFF_UNDEFINED = 7,   /* !8-bit untyped data */\n\tTIFF_SSHORT = 8,      /* !16-bit signed integer */\n\tTIFF_SLONG = 9,       /* !32-bit signed integer */\n\tTIFF_SRATIONAL = 10,  /* !64-bit signed fraction */\n\tTIFF_FLOAT = 11,      /* !32-bit IEEE floating point */\n\tTIFF_DOUBLE = 12,     /* !64-bit IEEE floating point */\n\tTIFF_IFD = 13,        /* %32-bit unsigned integer (offset) */\n\tTIFF_LONG8 = 16,      /* BigTIFF 64-bit unsigned integer */\n\tTIFF_SLONG8 = 17,     /* BigTIFF 64-bit signed integer */\n\tTIFF_IFD8 = 18        /* BigTIFF 64-bit unsigned integer (offset) */\n} TIFFDataType;\n\n/*\n * TIFF Tag Definitions.\n */\n#define\tTIFFTAG_SUBFILETYPE\t\t254\t/* subfile data descriptor */\n#define\t    FILETYPE_REDUCEDIMAGE\t0x1\t/* reduced resolution version */\n#define\t    FILETYPE_PAGE\t\t0x2\t/* one page of many */\n#define\t    FILETYPE_MASK\t\t0x4\t/* transparency mask */\n#define\tTIFFTAG_OSUBFILETYPE\t\t255\t/* +kind of data in subfile */\n#define\t    OFILETYPE_IMAGE\t\t1\t/* full resolution image data */\n#define\t    OFILETYPE_REDUCEDIMAGE\t2\t/* reduced size image data */\n#define\t    OFILETYPE_PAGE\t\t3\t/* one page of many */\n#define\tTIFFTAG_IMAGEWIDTH\t\t256\t/* image width in pixels */\n#define\tTIFFTAG_IMAGELENGTH\t\t257\t/* image height in pixels */\n#define\tTIFFTAG_BITSPERSAMPLE\t\t258\t/* bits per channel (sample) */\n#define\tTIFFTAG_COMPRESSION\t\t259\t/* data compression technique */\n#define\t    COMPRESSION_NONE\t\t1\t/* dump mode */\n#define\t    COMPRESSION_CCITTRLE\t2\t/* CCITT modified Huffman RLE */\n#define\t    COMPRESSION_CCITTFAX3\t3\t/* CCITT Group 3 fax encoding */\n#define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */\n#define\t    COMPRESSION_CCITTFAX4\t4\t/* CCITT Group 4 fax encoding */\n#define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */\n#define\t    COMPRESSION_LZW\t\t5       /* Lempel-Ziv  & Welch */\n#define\t    COMPRESSION_OJPEG\t\t6\t/* !6.0 JPEG */\n#define\t    COMPRESSION_JPEG\t\t7\t/* %JPEG DCT compression */\n#define     COMPRESSION_T85\t\t\t9\t/* !TIFF/FX T.85 JBIG compression */\n#define     COMPRESSION_T43\t\t\t10\t/* !TIFF/FX T.43 colour by layered JBIG compression */\n#define\t    COMPRESSION_NEXT\t\t32766\t/* NeXT 2-bit RLE */\n#define\t    COMPRESSION_CCITTRLEW\t32771\t/* #1 w/ word alignment */\n#define\t    COMPRESSION_PACKBITS\t32773\t/* Macintosh RLE */\n#define\t    COMPRESSION_THUNDERSCAN\t32809\t/* ThunderScan RLE */\n/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define\t    COMPRESSION_IT8CTPAD\t32895   /* IT8 CT w/padding */\n#define\t    COMPRESSION_IT8LW\t\t32896   /* IT8 Linework RLE */\n#define\t    COMPRESSION_IT8MP\t\t32897   /* IT8 Monochrome picture */\n#define\t    COMPRESSION_IT8BL\t\t32898   /* IT8 Binary line art */\n/* compression codes 32908-32911 are reserved for Pixar */\n#define     COMPRESSION_PIXARFILM\t32908   /* Pixar companded 10bit LZW */\n#define\t    COMPRESSION_PIXARLOG\t32909   /* Pixar companded 11bit ZIP */\n#define\t    COMPRESSION_DEFLATE\t\t32946\t/* Deflate compression */\n#define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,\n\t\t\t\t\t\t   as recognized by Adobe */\n/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */\n#define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */\n#define\t    COMPRESSION_JBIG\t\t34661\t/* ISO JBIG */\n#define     COMPRESSION_SGILOG\t\t34676\t/* SGI Log Luminance RLE */\n#define     COMPRESSION_SGILOG24\t34677\t/* SGI Log 24-bit packed */\n#define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */\n#define\t    COMPRESSION_LZMA\t\t34925\t/* LZMA2 */\n#define\tTIFFTAG_PHOTOMETRIC\t\t262\t/* photometric interpretation */\n#define\t    PHOTOMETRIC_MINISWHITE\t0\t/* min value is white */\n#define\t    PHOTOMETRIC_MINISBLACK\t1\t/* min value is black */\n#define\t    PHOTOMETRIC_RGB\t\t2\t/* RGB color model */\n#define\t    PHOTOMETRIC_PALETTE\t\t3\t/* color map indexed */\n#define\t    PHOTOMETRIC_MASK\t\t4\t/* $holdout mask */\n#define\t    PHOTOMETRIC_SEPARATED\t5\t/* !color separations */\n#define\t    PHOTOMETRIC_YCBCR\t\t6\t/* !CCIR 601 */\n#define\t    PHOTOMETRIC_CIELAB\t\t8\t/* !1976 CIE L*a*b* */\n#define\t    PHOTOMETRIC_ICCLAB\t\t9\t/* ICC L*a*b* [Adobe TIFF Technote 4] */\n#define\t    PHOTOMETRIC_ITULAB\t\t10\t/* ITU L*a*b* */\n#define     PHOTOMETRIC_LOGL\t\t32844\t/* CIE Log2(L) */\n#define     PHOTOMETRIC_LOGLUV\t\t32845\t/* CIE Log2(L) (u',v') */\n#define\tTIFFTAG_THRESHHOLDING\t\t263\t/* +thresholding used on data */\n#define\t    THRESHHOLD_BILEVEL\t\t1\t/* b&w art scan */\n#define\t    THRESHHOLD_HALFTONE\t\t2\t/* or dithered scan */\n#define\t    THRESHHOLD_ERRORDIFFUSE\t3\t/* usually floyd-steinberg */\n#define\tTIFFTAG_CELLWIDTH\t\t264\t/* +dithering matrix width */\n#define\tTIFFTAG_CELLLENGTH\t\t265\t/* +dithering matrix height */\n#define\tTIFFTAG_FILLORDER\t\t266\t/* data order within a byte */\n#define\t    FILLORDER_MSB2LSB\t\t1\t/* most significant -> least */\n#define\t    FILLORDER_LSB2MSB\t\t2\t/* least significant -> most */\n#define\tTIFFTAG_DOCUMENTNAME\t\t269\t/* name of doc. image is from */\n#define\tTIFFTAG_IMAGEDESCRIPTION\t270\t/* info about image */\n#define\tTIFFTAG_MAKE\t\t\t271\t/* scanner manufacturer name */\n#define\tTIFFTAG_MODEL\t\t\t272\t/* scanner model name/number */\n#define\tTIFFTAG_STRIPOFFSETS\t\t273\t/* offsets to data strips */\n#define\tTIFFTAG_ORIENTATION\t\t274\t/* +image orientation */\n#define\t    ORIENTATION_TOPLEFT\t\t1\t/* row 0 top, col 0 lhs */\n#define\t    ORIENTATION_TOPRIGHT\t2\t/* row 0 top, col 0 rhs */\n#define\t    ORIENTATION_BOTRIGHT\t3\t/* row 0 bottom, col 0 rhs */\n#define\t    ORIENTATION_BOTLEFT\t\t4\t/* row 0 bottom, col 0 lhs */\n#define\t    ORIENTATION_LEFTTOP\t\t5\t/* row 0 lhs, col 0 top */\n#define\t    ORIENTATION_RIGHTTOP\t6\t/* row 0 rhs, col 0 top */\n#define\t    ORIENTATION_RIGHTBOT\t7\t/* row 0 rhs, col 0 bottom */\n#define\t    ORIENTATION_LEFTBOT\t\t8\t/* row 0 lhs, col 0 bottom */\n#define\tTIFFTAG_SAMPLESPERPIXEL\t\t277\t/* samples per pixel */\n#define\tTIFFTAG_ROWSPERSTRIP\t\t278\t/* rows per strip of data */\n#define\tTIFFTAG_STRIPBYTECOUNTS\t\t279\t/* bytes counts for strips */\n#define\tTIFFTAG_MINSAMPLEVALUE\t\t280\t/* +minimum sample value */\n#define\tTIFFTAG_MAXSAMPLEVALUE\t\t281\t/* +maximum sample value */\n#define\tTIFFTAG_XRESOLUTION\t\t282\t/* pixels/resolution in x */\n#define\tTIFFTAG_YRESOLUTION\t\t283\t/* pixels/resolution in y */\n#define\tTIFFTAG_PLANARCONFIG\t\t284\t/* storage organization */\n#define\t    PLANARCONFIG_CONTIG\t\t1\t/* single image plane */\n#define\t    PLANARCONFIG_SEPARATE\t2\t/* separate planes of data */\n#define\tTIFFTAG_PAGENAME\t\t285\t/* page name image is from */\n#define\tTIFFTAG_XPOSITION\t\t286\t/* x page offset of image lhs */\n#define\tTIFFTAG_YPOSITION\t\t287\t/* y page offset of image lhs */\n#define\tTIFFTAG_FREEOFFSETS\t\t288\t/* +byte offset to free block */\n#define\tTIFFTAG_FREEBYTECOUNTS\t\t289\t/* +sizes of free blocks */\n#define\tTIFFTAG_GRAYRESPONSEUNIT\t290\t/* $gray scale curve accuracy */\n#define\t    GRAYRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    GRAYRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    GRAYRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_GRAYRESPONSECURVE\t291\t/* $gray scale response curve */\n#define\tTIFFTAG_GROUP3OPTIONS\t\t292\t/* 32 flag bits */\n#define\tTIFFTAG_T4OPTIONS\t\t292\t/* TIFF 6.0 proper name alias */\n#define\t    GROUP3OPT_2DENCODING\t0x1\t/* 2-dimensional coding */\n#define\t    GROUP3OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\t    GROUP3OPT_FILLBITS\t\t0x4\t/* fill to byte boundary */\n#define\tTIFFTAG_GROUP4OPTIONS\t\t293\t/* 32 flag bits */\n#define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */\n#define\t    GROUP4OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\tTIFFTAG_RESOLUTIONUNIT\t\t296\t/* units of resolutions */\n#define\t    RESUNIT_NONE\t\t1\t/* no meaningful units */\n#define\t    RESUNIT_INCH\t\t2\t/* english */\n#define\t    RESUNIT_CENTIMETER\t\t3\t/* metric */\n#define\tTIFFTAG_PAGENUMBER\t\t297\t/* page numbers of multi-page */\n#define\tTIFFTAG_COLORRESPONSEUNIT\t300\t/* $color curve accuracy */\n#define\t    COLORRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    COLORRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    COLORRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_TRANSFERFUNCTION\t301\t/* !colorimetry info */\n#define\tTIFFTAG_SOFTWARE\t\t305\t/* name & release */\n#define\tTIFFTAG_DATETIME\t\t306\t/* creation date and time */\n#define\tTIFFTAG_ARTIST\t\t\t315\t/* creator of image */\n#define\tTIFFTAG_HOSTCOMPUTER\t\t316\t/* machine where created */\n#define\tTIFFTAG_PREDICTOR\t\t317\t/* prediction scheme w/ LZW */\n#define     PREDICTOR_NONE\t\t1\t/* no prediction scheme used */\n#define     PREDICTOR_HORIZONTAL\t2\t/* horizontal differencing */\n#define     PREDICTOR_FLOATINGPOINT\t3\t/* floating point predictor */\n#define\tTIFFTAG_WHITEPOINT\t\t318\t/* image white point */\n#define\tTIFFTAG_PRIMARYCHROMATICITIES\t319\t/* !primary chromaticities */\n#define\tTIFFTAG_COLORMAP\t\t320\t/* RGB map for pallette image */\n#define\tTIFFTAG_HALFTONEHINTS\t\t321\t/* !highlight+shadow info */\n#define\tTIFFTAG_TILEWIDTH\t\t322\t/* !tile width in pixels */\n#define\tTIFFTAG_TILELENGTH\t\t323\t/* !tile height in pixels */\n#define TIFFTAG_TILEOFFSETS\t\t324\t/* !offsets to data tiles */\n#define TIFFTAG_TILEBYTECOUNTS\t\t325\t/* !byte counts for tiles */\n#define\tTIFFTAG_BADFAXLINES\t\t326\t/* lines w/ wrong pixel count */\n#define\tTIFFTAG_CLEANFAXDATA\t\t327\t/* regenerated line info */\n#define\t    CLEANFAXDATA_CLEAN\t\t0\t/* no errors detected */\n#define\t    CLEANFAXDATA_REGENERATED\t1\t/* receiver regenerated lines */\n#define\t    CLEANFAXDATA_UNCLEAN\t2\t/* uncorrected errors exist */\n#define\tTIFFTAG_CONSECUTIVEBADFAXLINES\t328\t/* max consecutive bad lines */\n#define\tTIFFTAG_SUBIFD\t\t\t330\t/* subimage descriptors */\n#define\tTIFFTAG_INKSET\t\t\t332\t/* !inks in separated image */\n#define\t    INKSET_CMYK\t\t\t1\t/* !cyan-magenta-yellow-black color */\n#define\t    INKSET_MULTIINK\t\t2\t/* !multi-ink or hi-fi color */\n#define\tTIFFTAG_INKNAMES\t\t333\t/* !ascii names of inks */\n#define\tTIFFTAG_NUMBEROFINKS\t\t334\t/* !number of inks */\n#define\tTIFFTAG_DOTRANGE\t\t336\t/* !0% and 100% dot codes */\n#define\tTIFFTAG_TARGETPRINTER\t\t337\t/* !separation target */\n#define\tTIFFTAG_EXTRASAMPLES\t\t338\t/* !info about extra samples */\n#define\t    EXTRASAMPLE_UNSPECIFIED\t0\t/* !unspecified data */\n#define\t    EXTRASAMPLE_ASSOCALPHA\t1\t/* !associated alpha data */\n#define\t    EXTRASAMPLE_UNASSALPHA\t2\t/* !unassociated alpha data */\n#define\tTIFFTAG_SAMPLEFORMAT\t\t339\t/* !data sample format */\n#define\t    SAMPLEFORMAT_UINT\t\t1\t/* !unsigned integer data */\n#define\t    SAMPLEFORMAT_INT\t\t2\t/* !signed integer data */\n#define\t    SAMPLEFORMAT_IEEEFP\t\t3\t/* !IEEE floating point data */\n#define\t    SAMPLEFORMAT_VOID\t\t4\t/* !untyped data */\n#define\t    SAMPLEFORMAT_COMPLEXINT\t5\t/* !complex signed int */\n#define\t    SAMPLEFORMAT_COMPLEXIEEEFP\t6\t/* !complex ieee floating */\n#define\tTIFFTAG_SMINSAMPLEVALUE\t\t340\t/* !variable MinSampleValue */\n#define\tTIFFTAG_SMAXSAMPLEVALUE\t\t341\t/* !variable MaxSampleValue */\n#define\tTIFFTAG_CLIPPATH\t\t343\t/* %ClipPath\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_XCLIPPATHUNITS\t\t344\t/* %XClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_YCLIPPATHUNITS\t\t345\t/* %YClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_INDEXED\t\t\t346\t/* %Indexed\n\t\t\t\t\t\t   [Adobe TIFF Technote 3] */\n#define\tTIFFTAG_JPEGTABLES\t\t347\t/* %JPEG table stream */\n#define\tTIFFTAG_OPIPROXY\t\t351\t/* %OPI Proxy [Adobe TIFF technote] */\n/* Tags 400-435 are from the TIFF/FX spec */\n#define TIFFTAG_GLOBALPARAMETERSIFD\t400\t/* ! */\n#define TIFFTAG_PROFILETYPE\t\t\t401\t/* ! */\n#define     PROFILETYPE_UNSPECIFIED\t0\t/* ! */\n#define     PROFILETYPE_G3_FAX\t\t1\t/* ! */\n#define TIFFTAG_FAXPROFILE\t\t\t402\t/* ! */\n#define     FAXPROFILE_S\t\t\t1\t/* !TIFF/FX FAX profile S */\n#define     FAXPROFILE_F\t\t\t2\t/* !TIFF/FX FAX profile F */\n#define     FAXPROFILE_J\t\t\t3\t/* !TIFF/FX FAX profile J */\n#define     FAXPROFILE_C\t\t\t4\t/* !TIFF/FX FAX profile C */\n#define     FAXPROFILE_L\t\t\t5\t/* !TIFF/FX FAX profile L */\n#define     FAXPROFILE_M\t\t\t6\t/* !TIFF/FX FAX profile LM */\n#define TIFFTAG_CODINGMETHODS\t\t403\t/* !TIFF/FX coding methods */\n#define     CODINGMETHODS_T4_1D\t\t(1 << 1)\t/* !T.4 1D */\n#define     CODINGMETHODS_T4_2D\t\t(1 << 2)\t/* !T.4 2D */\n#define     CODINGMETHODS_T6\t\t(1 << 3)\t/* !T.6 */\n#define     CODINGMETHODS_T85 \t\t(1 << 4)\t/* !T.85 JBIG */\n#define     CODINGMETHODS_T42 \t\t(1 << 5)\t/* !T.42 JPEG */\n#define     CODINGMETHODS_T43\t\t(1 << 6)\t/* !T.43 colour by layered JBIG */\n#define TIFFTAG_VERSIONYEAR\t\t\t404\t/* !TIFF/FX version year */\n#define TIFFTAG_MODENUMBER\t\t\t405\t/* !TIFF/FX mode number */\n#define TIFFTAG_DECODE\t\t\t\t433\t/* !TIFF/FX decode */\n#define TIFFTAG_IMAGEBASECOLOR\t\t434\t/* !TIFF/FX image base colour */\n#define TIFFTAG_T82OPTIONS\t\t\t435\t/* !TIFF/FX T.82 options */\n/*\n * Tags 512-521 are obsoleted by Technical Note #2 which specifies a\n * revised JPEG-in-TIFF scheme.\n */\n#define\tTIFFTAG_JPEGPROC\t\t512\t/* !JPEG processing algorithm */\n#define\t    JPEGPROC_BASELINE\t\t1\t/* !baseline sequential */\n#define\t    JPEGPROC_LOSSLESS\t\t14\t/* !Huffman coded lossless */\n#define\tTIFFTAG_JPEGIFOFFSET\t\t513\t/* !pointer to SOI marker */\n#define\tTIFFTAG_JPEGIFBYTECOUNT\t\t514\t/* !JFIF stream length */\n#define\tTIFFTAG_JPEGRESTARTINTERVAL\t515\t/* !restart interval length */\n#define\tTIFFTAG_JPEGLOSSLESSPREDICTORS\t517\t/* !lossless proc predictor */\n#define\tTIFFTAG_JPEGPOINTTRANSFORM\t518\t/* !lossless point transform */\n#define\tTIFFTAG_JPEGQTABLES\t\t519\t/* !Q matrice offsets */\n#define\tTIFFTAG_JPEGDCTABLES\t\t520\t/* !DCT table offsets */\n#define\tTIFFTAG_JPEGACTABLES\t\t521\t/* !AC coefficient offsets */\n#define\tTIFFTAG_YCBCRCOEFFICIENTS\t529\t/* !RGB -> YCbCr transform */\n#define\tTIFFTAG_YCBCRSUBSAMPLING\t530\t/* !YCbCr subsampling factors */\n#define\tTIFFTAG_YCBCRPOSITIONING\t531\t/* !subsample positioning */\n#define\t    YCBCRPOSITION_CENTERED\t1\t/* !as in PostScript Level 2 */\n#define\t    YCBCRPOSITION_COSITED\t2\t/* !as in CCIR 601-1 */\n#define\tTIFFTAG_REFERENCEBLACKWHITE\t532\t/* !colorimetry info */\n#define TIFFTAG_STRIPROWCOUNTS\t\t559 /* !TIFF/FX strip row counts */\n#define\tTIFFTAG_XMLPACKET\t\t700\t/* %XML packet\n\t\t\t\t\t\t   [Adobe XMP Specification,\n\t\t\t\t\t\t   January 2004 */\n#define TIFFTAG_OPIIMAGEID\t\t32781\t/* %OPI ImageID\n\t\t\t\t\t\t   [Adobe TIFF technote] */\n/* tags 32952-32956 are private tags registered to Island Graphics */\n#define TIFFTAG_REFPTS\t\t\t32953\t/* image reference points */\n#define TIFFTAG_REGIONTACKPOINT\t\t32954\t/* region-xform tack point */\n#define TIFFTAG_REGIONWARPCORNERS\t32955\t/* warp quadrilateral */\n#define TIFFTAG_REGIONAFFINE\t\t32956\t/* affine transformation mat */\n/* tags 32995-32999 are private tags registered to SGI */\n#define\tTIFFTAG_MATTEING\t\t32995\t/* $use ExtraSamples */\n#define\tTIFFTAG_DATATYPE\t\t32996\t/* $use SampleFormat */\n#define\tTIFFTAG_IMAGEDEPTH\t\t32997\t/* z depth of image */\n#define\tTIFFTAG_TILEDEPTH\t\t32998\t/* z depth/data tile */\n/* tags 33300-33309 are private tags registered to Pixar */\n/*\n * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH\n * are set when an image has been cropped out of a larger image.  \n * They reflect the size of the original uncropped image.\n * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used\n * to determine the position of the smaller image in the larger one.\n */\n#define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */\n#define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */\n /* Tags 33302-33306 are used to identify special image modes and data\n  * used by Pixar's texture formats.\n  */\n#define TIFFTAG_PIXAR_TEXTUREFORMAT\t33302\t/* texture map format */\n#define TIFFTAG_PIXAR_WRAPMODES\t\t33303\t/* s & t wrap modes */\n#define TIFFTAG_PIXAR_FOVCOT\t\t33304\t/* cotan(fov) for env. maps */\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306\n/* tag 33405 is a private tag registered to Eastman Kodak */\n#define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */\n/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */\n#define\tTIFFTAG_COPYRIGHT\t\t33432\t/* copyright string */\n/* IPTC TAG from RichTIFF specifications */\n#define TIFFTAG_RICHTIFFIPTC\t\t33723\n/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define TIFFTAG_IT8SITE\t\t\t34016\t/* site name */\n#define TIFFTAG_IT8COLORSEQUENCE\t34017\t/* color seq. [RGB,CMYK,etc] */\n#define TIFFTAG_IT8HEADER\t\t34018\t/* DDES Header */\n#define TIFFTAG_IT8RASTERPADDING\t34019\t/* raster scanline padding */\n#define TIFFTAG_IT8BITSPERRUNLENGTH\t34020\t/* # of bits in short run */\n#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */\n#define TIFFTAG_IT8COLORTABLE\t\t34022\t/* LW colortable */\n#define TIFFTAG_IT8IMAGECOLORINDICATOR\t34023\t/* BP/BL image color switch */\n#define TIFFTAG_IT8BKGCOLORINDICATOR\t34024\t/* BP/BL bg color switch */\n#define TIFFTAG_IT8IMAGECOLORVALUE\t34025\t/* BP/BL image color value */\n#define TIFFTAG_IT8BKGCOLORVALUE\t34026\t/* BP/BL bg color value */\n#define TIFFTAG_IT8PIXELINTENSITYRANGE\t34027\t/* MP pixel intensity value */\n#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028\t/* HC transparency switch */\n#define TIFFTAG_IT8COLORCHARACTERIZATION 34029\t/* color character. table */\n#define TIFFTAG_IT8HCUSAGE\t\t34030\t/* HC usage indicator */\n#define TIFFTAG_IT8TRAPINDICATOR\t34031\t/* Trapping indicator\n\t\t\t\t\t\t   (untrapped=0, trapped=1) */\n#define TIFFTAG_IT8CMYKEQUIVALENT\t34032\t/* CMYK color equivalents */\n/* tags 34232-34236 are private tags registered to Texas Instruments */\n#define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */\n/* tag 34377 is private tag registered to Adobe for PhotoShop */\n#define TIFFTAG_PHOTOSHOP\t\t34377 \n/* tags 34665, 34853 and 40965 are documented in EXIF specification */\n#define TIFFTAG_EXIFIFD\t\t\t34665\t/* Pointer to EXIF private directory */\n/* tag 34750 is a private tag registered to Adobe? */\n#define TIFFTAG_ICCPROFILE\t\t34675\t/* ICC profile data */\n#define TIFFTAG_IMAGELAYER\t\t34732\t/* !TIFF/FX image layer information */\n/* tag 34750 is a private tag registered to Pixel Magic */\n#define\tTIFFTAG_JBIGOPTIONS\t\t34750\t/* JBIG options */\n#define TIFFTAG_GPSIFD\t\t\t34853\t/* Pointer to GPS private directory */\n/* tags 34908-34914 are private tags registered to SGI */\n#define\tTIFFTAG_FAXRECVPARAMS\t\t34908\t/* encoded Class 2 ses. parms */\n#define\tTIFFTAG_FAXSUBADDRESS\t\t34909\t/* received SubAddr string */\n#define\tTIFFTAG_FAXRECVTIME\t\t34910\t/* receive time (secs) */\n#define\tTIFFTAG_FAXDCS\t\t\t34911\t/* encoded fax ses. params, Table 2/T.30 */\n/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */\n#define TIFFTAG_STONITS\t\t\t37439\t/* Sample value to Nits */\n/* tag 34929 is a private tag registered to FedEx */\n#define\tTIFFTAG_FEDEX_EDR\t\t34929\t/* unknown use */\n#define TIFFTAG_INTEROPERABILITYIFD\t40965\t/* Pointer to Interoperability private directory */\n/* Adobe Digital Negative (DNG) format tags */\n#define TIFFTAG_DNGVERSION\t\t50706\t/* &DNG version number */\n#define TIFFTAG_DNGBACKWARDVERSION\t50707\t/* &DNG compatibility version */\n#define TIFFTAG_UNIQUECAMERAMODEL\t50708\t/* &name for the camera model */\n#define TIFFTAG_LOCALIZEDCAMERAMODEL\t50709\t/* &localized camera model\n\t\t\t\t\t\t   name */\n#define TIFFTAG_CFAPLANECOLOR\t\t50710\t/* &CFAPattern->LinearRaw space\n\t\t\t\t\t\t   mapping */\n#define TIFFTAG_CFALAYOUT\t\t50711\t/* &spatial layout of the CFA */\n#define TIFFTAG_LINEARIZATIONTABLE\t50712\t/* &lookup table description */\n#define TIFFTAG_BLACKLEVELREPEATDIM\t50713\t/* &repeat pattern size for\n\t\t\t\t\t\t   the BlackLevel tag */\n#define TIFFTAG_BLACKLEVEL\t\t50714\t/* &zero light encoding level */\n#define TIFFTAG_BLACKLEVELDELTAH\t50715\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (columns) */\n#define TIFFTAG_BLACKLEVELDELTAV\t50716\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (rows) */\n#define TIFFTAG_WHITELEVEL\t\t50717\t/* &fully saturated encoding\n\t\t\t\t\t\t   level */\n#define TIFFTAG_DEFAULTSCALE\t\t50718\t/* &default scale factors */\n#define TIFFTAG_DEFAULTCROPORIGIN\t50719\t/* &origin of the final image\n\t\t\t\t\t\t   area */\n#define TIFFTAG_DEFAULTCROPSIZE\t\t50720\t/* &size of the final image \n\t\t\t\t\t\t   area */\n#define TIFFTAG_COLORMATRIX1\t\t50721\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 1 */\n#define TIFFTAG_COLORMATRIX2\t\t50722\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 2 */\n#define TIFFTAG_CAMERACALIBRATION1\t50723\t/* &calibration matrix 1 */\n#define TIFFTAG_CAMERACALIBRATION2\t50724\t/* &calibration matrix 2 */\n#define TIFFTAG_REDUCTIONMATRIX1\t50725\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 1 */\n#define TIFFTAG_REDUCTIONMATRIX2\t50726\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 2 */\n#define TIFFTAG_ANALOGBALANCE\t\t50727\t/* &gain applied the stored raw\n\t\t\t\t\t\t   values*/\n#define TIFFTAG_ASSHOTNEUTRAL\t\t50728\t/* &selected white balance in\n\t\t\t\t\t\t   linear reference space */\n#define TIFFTAG_ASSHOTWHITEXY\t\t50729\t/* &selected white balance in\n\t\t\t\t\t\t   x-y chromaticity\n\t\t\t\t\t\t   coordinates */\n#define TIFFTAG_BASELINEEXPOSURE\t50730\t/* &how much to move the zero\n\t\t\t\t\t\t   point */\n#define TIFFTAG_BASELINENOISE\t\t50731\t/* &relative noise level */\n#define TIFFTAG_BASELINESHARPNESS\t50732\t/* &relative amount of\n\t\t\t\t\t\t   sharpening */\n#define TIFFTAG_BAYERGREENSPLIT\t\t50733\t/* &how closely the values of\n\t\t\t\t\t\t   the green pixels in the\n\t\t\t\t\t\t   blue/green rows track the\n\t\t\t\t\t\t   values of the green pixels\n\t\t\t\t\t\t   in the red/green rows */\n#define TIFFTAG_LINEARRESPONSELIMIT\t50734\t/* &non-linear encoding range */\n#define TIFFTAG_CAMERASERIALNUMBER\t50735\t/* &camera's serial number */\n#define TIFFTAG_LENSINFO\t\t50736\t/* info about the lens */\n#define TIFFTAG_CHROMABLURRADIUS\t50737\t/* &chroma blur radius */\n#define TIFFTAG_ANTIALIASSTRENGTH\t50738\t/* &relative strength of the\n\t\t\t\t\t\t   camera's anti-alias filter */\n#define TIFFTAG_SHADOWSCALE\t\t50739\t/* &used by Adobe Camera Raw */\n#define TIFFTAG_DNGPRIVATEDATA\t\t50740\t/* &manufacturer's private data */\n#define TIFFTAG_MAKERNOTESAFETY\t\t50741\t/* &whether the EXIF MakerNote\n\t\t\t\t\t\t   tag is safe to preserve\n\t\t\t\t\t\t   along with the rest of the\n\t\t\t\t\t\t   EXIF data */\n#define\tTIFFTAG_CALIBRATIONILLUMINANT1\t50778\t/* &illuminant 1 */\n#define TIFFTAG_CALIBRATIONILLUMINANT2\t50779\t/* &illuminant 2 */\n#define TIFFTAG_BESTQUALITYSCALE\t50780\t/* &best quality multiplier */\n#define TIFFTAG_RAWDATAUNIQUEID\t\t50781\t/* &unique identifier for\n\t\t\t\t\t\t   the raw image data */\n#define TIFFTAG_ORIGINALRAWFILENAME\t50827\t/* &file name of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ORIGINALRAWFILEDATA\t50828\t/* &contents of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ACTIVEAREA\t\t50829\t/* &active (non-masked) pixels\n\t\t\t\t\t\t   of the sensor */\n#define TIFFTAG_MASKEDAREAS\t\t50830\t/* &list of coordinates\n\t\t\t\t\t\t   of fully masked pixels */\n#define TIFFTAG_ASSHOTICCPROFILE\t50831\t/* &these two tags used to */\n#define TIFFTAG_ASSHOTPREPROFILEMATRIX\t50832\t/* map cameras's color space\n\t\t\t\t\t\t   into ICC profile space */\n#define TIFFTAG_CURRENTICCPROFILE\t50833\t/* & */\n#define TIFFTAG_CURRENTPREPROFILEMATRIX\t50834\t/* & */\n/* tag 65535 is an undefined tag used by Eastman Kodak */\n#define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */\n\n/*\n * The following are ``pseudo tags'' that can be used to control\n * codec-specific functionality.  These tags are not written to file.\n * Note that these values start at 0xffff+1 so that they'll never\n * collide with Aldus-assigned tags.\n *\n * If you want your private pseudo tags ``registered'' (i.e. added to\n * this file), please post a bug report via the tracking system at\n * http://www.remotesensing.org/libtiff/bugs.html with the appropriate\n * C definitions to add.\n */\n#define\tTIFFTAG_FAXMODE\t\t\t65536\t/* Group 3/4 format control */\n#define\t    FAXMODE_CLASSIC\t0x0000\t\t/* default, include RTC */\n#define\t    FAXMODE_NORTC\t0x0001\t\t/* no RTC at end of data */\n#define\t    FAXMODE_NOEOL\t0x0002\t\t/* no EOL code at end of row */\n#define\t    FAXMODE_BYTEALIGN\t0x0004\t\t/* byte align row */\n#define\t    FAXMODE_WORDALIGN\t0x0008\t\t/* word align row */\n#define\t    FAXMODE_CLASSF\tFAXMODE_NORTC\t/* TIFF Class F */\n#define\tTIFFTAG_JPEGQUALITY\t\t65537\t/* Compression quality level */\n/* Note: quality level is on the IJG 0-100 scale.  Default value is 75 */\n#define\tTIFFTAG_JPEGCOLORMODE\t\t65538\t/* Auto RGB<=>YCbCr convert? */\n#define\t    JPEGCOLORMODE_RAW\t0x0000\t\t/* no conversion (default) */\n#define\t    JPEGCOLORMODE_RGB\t0x0001\t\t/* do auto conversion */\n#define\tTIFFTAG_JPEGTABLESMODE\t\t65539\t/* What to put in JPEGTables */\n#define\t    JPEGTABLESMODE_QUANT 0x0001\t\t/* include quantization tbls */\n#define\t    JPEGTABLESMODE_HUFF\t0x0002\t\t/* include Huffman tbls */\n/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */\n#define\tTIFFTAG_FAXFILLFUNC\t\t65540\t/* G3/G4 fill function */\n#define\tTIFFTAG_PIXARLOGDATAFMT\t\t65549\t/* PixarLogCodec I/O data sz */\n#define\t    PIXARLOGDATAFMT_8BIT\t0\t/* regular u_char samples */\n#define\t    PIXARLOGDATAFMT_8BITABGR\t1\t/* ABGR-order u_chars */\n#define\t    PIXARLOGDATAFMT_11BITLOG\t2\t/* 11-bit log-encoded (raw) */\n#define\t    PIXARLOGDATAFMT_12BITPICIO\t3\t/* as per PICIO (1.0==2048) */\n#define\t    PIXARLOGDATAFMT_16BIT\t4\t/* signed short samples */\n#define\t    PIXARLOGDATAFMT_FLOAT\t5\t/* IEEE float samples */\n/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */\n#define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */\n#define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */\n#define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */\n#define     DCSIMAGERFILTER_IR          0       /* infrared filter */\n#define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */\n#define     DCSIMAGERFILTER_CFA         2       /* color filter array */\n#define     DCSIMAGERFILTER_OTHER       3       /* other filter */\n#define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */\n#define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */\n#define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */\n#define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */\n#define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */\n#define TIFFTAG_DCSGAMMA                65554   /* gamma value */\n#define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */\n#define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */\n/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */\n#define\tTIFFTAG_ZIPQUALITY\t\t65557\t/* compression quality level */\n#define\tTIFFTAG_PIXARLOGQUALITY\t\t65558\t/* PixarLog uses same scale */\n/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSCLIPRECTANGLE\t65559\t/* area of image to acquire */\n#define TIFFTAG_SGILOGDATAFMT\t\t65560\t/* SGILog user data format */\n#define     SGILOGDATAFMT_FLOAT\t\t0\t/* IEEE float samples */\n#define     SGILOGDATAFMT_16BIT\t\t1\t/* 16-bit samples */\n#define     SGILOGDATAFMT_RAW\t\t2\t/* uninterpreted data */\n#define     SGILOGDATAFMT_8BIT\t\t3\t/* 8-bit RGB monitor values */\n#define TIFFTAG_SGILOGENCODE\t\t65561 /* SGILog data encoding control*/\n#define     SGILOGENCODE_NODITHER\t0     /* do not dither encoded values*/\n#define     SGILOGENCODE_RANDITHER\t1     /* randomly dither encd values */\n#define\tTIFFTAG_LZMAPRESET\t\t65562\t/* LZMA2 preset (compression level) */\n#define TIFFTAG_PERSAMPLE       65563\t/* interface for per sample tags */\n#define     PERSAMPLE_MERGED        0\t/* present as a single value */\n#define     PERSAMPLE_MULTI         1\t/* present as multiple values */\n\n/*\n * EXIF tags\n */\n#define EXIFTAG_EXPOSURETIME\t\t33434\t/* Exposure time */\n#define EXIFTAG_FNUMBER\t\t\t33437\t/* F number */\n#define EXIFTAG_EXPOSUREPROGRAM\t\t34850\t/* Exposure program */\n#define EXIFTAG_SPECTRALSENSITIVITY\t34852\t/* Spectral sensitivity */\n#define EXIFTAG_ISOSPEEDRATINGS\t\t34855\t/* ISO speed rating */\n#define EXIFTAG_OECF\t\t\t34856\t/* Optoelectric conversion\n\t\t\t\t\t\t   factor */\n#define EXIFTAG_EXIFVERSION\t\t36864\t/* Exif version */\n#define EXIFTAG_DATETIMEORIGINAL\t36867\t/* Date and time of original\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_DATETIMEDIGITIZED\t36868\t/* Date and time of digital\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_COMPONENTSCONFIGURATION\t37121\t/* Meaning of each component */\n#define EXIFTAG_COMPRESSEDBITSPERPIXEL\t37122\t/* Image compression mode */\n#define EXIFTAG_SHUTTERSPEEDVALUE\t37377\t/* Shutter speed */\n#define EXIFTAG_APERTUREVALUE\t\t37378\t/* Aperture */\n#define EXIFTAG_BRIGHTNESSVALUE\t\t37379\t/* Brightness */\n#define EXIFTAG_EXPOSUREBIASVALUE\t37380\t/* Exposure bias */\n#define EXIFTAG_MAXAPERTUREVALUE\t37381\t/* Maximum lens aperture */\n#define EXIFTAG_SUBJECTDISTANCE\t\t37382\t/* Subject distance */\n#define EXIFTAG_METERINGMODE\t\t37383\t/* Metering mode */\n#define EXIFTAG_LIGHTSOURCE\t\t37384\t/* Light source */\n#define EXIFTAG_FLASH\t\t\t37385\t/* Flash */\n#define EXIFTAG_FOCALLENGTH\t\t37386\t/* Lens focal length */\n#define EXIFTAG_SUBJECTAREA\t\t37396\t/* Subject area */\n#define EXIFTAG_MAKERNOTE\t\t37500\t/* Manufacturer notes */\n#define EXIFTAG_USERCOMMENT\t\t37510\t/* User comments */\n#define EXIFTAG_SUBSECTIME\t\t37520\t/* DateTime subseconds */\n#define EXIFTAG_SUBSECTIMEORIGINAL\t37521\t/* DateTimeOriginal subseconds */\n#define EXIFTAG_SUBSECTIMEDIGITIZED\t37522\t/* DateTimeDigitized subseconds */\n#define EXIFTAG_FLASHPIXVERSION\t\t40960\t/* Supported Flashpix version */\n#define EXIFTAG_COLORSPACE\t\t40961\t/* Color space information */\n#define EXIFTAG_PIXELXDIMENSION\t\t40962\t/* Valid image width */\n#define EXIFTAG_PIXELYDIMENSION\t\t40963\t/* Valid image height */\n#define EXIFTAG_RELATEDSOUNDFILE\t40964\t/* Related audio file */\n#define EXIFTAG_FLASHENERGY\t\t41483\t/* Flash energy */\n#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484\t/* Spatial frequency response */\n#define EXIFTAG_FOCALPLANEXRESOLUTION\t41486\t/* Focal plane X resolution */\n#define EXIFTAG_FOCALPLANEYRESOLUTION\t41487\t/* Focal plane Y resolution */\n#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488\t/* Focal plane resolution unit */\n#define EXIFTAG_SUBJECTLOCATION\t\t41492\t/* Subject location */\n#define EXIFTAG_EXPOSUREINDEX\t\t41493\t/* Exposure index */\n#define EXIFTAG_SENSINGMETHOD\t\t41495\t/* Sensing method */\n#define EXIFTAG_FILESOURCE\t\t41728\t/* File source */\n#define EXIFTAG_SCENETYPE\t\t41729\t/* Scene type */\n#define EXIFTAG_CFAPATTERN\t\t41730\t/* CFA pattern */\n#define EXIFTAG_CUSTOMRENDERED\t\t41985\t/* Custom image processing */\n#define EXIFTAG_EXPOSUREMODE\t\t41986\t/* Exposure mode */\n#define EXIFTAG_WHITEBALANCE\t\t41987\t/* White balance */\n#define EXIFTAG_DIGITALZOOMRATIO\t41988\t/* Digital zoom ratio */\n#define EXIFTAG_FOCALLENGTHIN35MMFILM\t41989\t/* Focal length in 35 mm film */\n#define EXIFTAG_SCENECAPTURETYPE\t41990\t/* Scene capture type */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_CONTRAST\t\t41992\t/* Contrast */\n#define EXIFTAG_SATURATION\t\t41993\t/* Saturation */\n#define EXIFTAG_SHARPNESS\t\t41994\t/* Sharpness */\n#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995\t/* Device settings description */\n#define EXIFTAG_SUBJECTDISTANCERANGE\t41996\t/* Subject distance range */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_IMAGEUNIQUEID\t\t42016\t/* Unique image ID */\n\n#endif /* _TIFF_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/ios/tiffconf.h",
    "content": "/* libtiff/tiffconf.h.  Generated from tiffconf.h.in by configure.  */\n/*\n  Configuration defines for installed libtiff.\n  This file maintained for backward compatibility. Do not use definitions\n  from this file in your programs.\n*/\n\n#ifndef _TIFFCONF_\n#define _TIFFCONF_\n\n/* Signed 16-bit type */\n#define TIFF_INT16_T signed short\n\n/* Signed 32-bit type */\n#define TIFF_INT32_T signed int\n\n/* Signed 64-bit type */\n#define TIFF_INT64_T signed long long\n\n/* Signed 8-bit type */\n#define TIFF_INT8_T signed char\n\n/* Unsigned 16-bit type */\n#define TIFF_UINT16_T unsigned short\n\n/* Unsigned 32-bit type */\n#define TIFF_UINT32_T unsigned int\n\n/* Unsigned 64-bit type */\n#define TIFF_UINT64_T unsigned long long\n\n/* Unsigned 8-bit type */\n#define TIFF_UINT8_T unsigned char\n\n/* Signed size type */\n#define TIFF_SSIZE_T signed long\n\n/* Pointer difference type */\n#define TIFF_PTRDIFF_T ptrdiff_t\n\n/* Define to 1 if the system has the type `int16'. */\n/* #undef HAVE_INT16 */\n\n/* Define to 1 if the system has the type `int32'. */\n/* #undef HAVE_INT32 */\n\n/* Define to 1 if the system has the type `int8'. */\n/* #undef HAVE_INT8 */\n\n/* Compatibility stuff. */\n\n/* Define as 0 or 1 according to the floating point format suported by the\n   machine */\n#define HAVE_IEEEFP 1\n\n/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */\n#define HOST_FILLORDER FILLORDER_MSB2LSB\n\n/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian\n   (Intel) */\n#define HOST_BIGENDIAN 0\n\n/* Support CCITT Group 3 & 4 algorithms */\n#define CCITT_SUPPORT 1\n\n/* Support JPEG compression (requires IJG JPEG library) */\n/* #undef JPEG_SUPPORT */\n\n/* Support JBIG compression (requires JBIG-KIT library) */\n/* #undef JBIG_SUPPORT */\n\n/* Support LogLuv high dynamic range encoding */\n#define LOGLUV_SUPPORT 1\n\n/* Support LZW algorithm */\n#define LZW_SUPPORT 1\n\n/* Support NeXT 2-bit RLE algorithm */\n#define NEXT_SUPPORT 1\n\n/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation\n   fails with unpatched IJG JPEG library) */\n/* #undef OJPEG_SUPPORT */\n\n/* Support Macintosh PackBits algorithm */\n#define PACKBITS_SUPPORT 1\n\n/* Support Pixar log-format algorithm (requires Zlib) */\n#define PIXARLOG_SUPPORT 1\n\n/* Support ThunderScan 4-bit RLE algorithm */\n#define THUNDER_SUPPORT 1\n\n/* Support Deflate compression */\n#define ZIP_SUPPORT 1\n\n/* Support strip chopping (whether or not to convert single-strip uncompressed\n   images to mutiple strips of ~8Kb to reduce memory usage) */\n#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP\n\n/* Enable SubIFD tag (330) support */\n#define SUBIFD_SUPPORT 1\n\n/* Treat extra sample as alpha (default enabled). The RGBA interface will\n   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many\n   packages produce RGBA files but don't mark the alpha properly. */\n#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1\n\n/* Pick up YCbCr subsampling info from the JPEG data stream to support files\n   lacking the tag (default enabled). */\n#define CHECK_JPEG_YCBCR_SUBSAMPLING 1\n\n/* Support MS MDI magic number files as TIFF */\n#define MDI_SUPPORT 1\n\n/*\n * Feature support definitions.\n * XXX: These macros are obsoleted. Don't use them in your apps!\n * Macros stays here for backward compatibility and should be always defined.\n */\n#define COLORIMETRY_SUPPORT\n#define YCBCR_SUPPORT\n#define CMYK_SUPPORT\n#define ICC_SUPPORT\n#define PHOTOSHOP_SUPPORT\n#define IPTC_SUPPORT\n\n#endif /* _TIFFCONF_ */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/ios/tiffio.h",
    "content": "/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and\n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF\n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFFIO_\n#define\t_TIFFIO_\n\n/*\n * TIFF I/O Library Definitions.\n */\n#include \"tiff.h\"\n#include \"tiffvers.h\"\n\n/*\n * TIFF is defined as an incomplete type to hide the\n * library's internal data structures from clients.\n */\ntypedef struct tiff TIFF;\n\n/*\n * The following typedefs define the intrinsic size of\n * data types used in the *exported* interfaces.  These\n * definitions depend on the proper definition of types\n * in tiff.h.  Note also that the varargs interface used\n * to pass tag types and values uses the types defined in\n * tiff.h directly.\n *\n * NB: ttag_t is unsigned int and not unsigned short because\n *     ANSI C requires that the type before the ellipsis be a\n *     promoted type (i.e. one of int, unsigned int, pointer,\n *     or double) and because we defined pseudo-tags that are\n *     outside the range of legal Aldus-assigned tags.\n * NB: tsize_t is int32 and not uint32 because some functions\n *     return -1.\n * NB: toff_t is not off_t for many reasons; TIFFs max out at\n *     32-bit file offsets, and BigTIFF maxes out at 64-bit\n *     offsets being the most important, and to ensure use of\n *     a consistently unsigned type across architectures.\n *     Prior to libtiff 4.0, this was an unsigned 32 bit type.\n */\n/*\n * this is the machine addressing size type, only it's signed, so make it\n * int32 on 32bit machines, int64 on 64bit machines\n */\ntypedef TIFF_SSIZE_T tmsize_t;\ntypedef uint64 toff_t;          /* file offset */\n/* the following are deprecated and should be replaced by their defining\n   counterparts */\ntypedef uint32 ttag_t;          /* directory tag */\ntypedef uint16 tdir_t;          /* directory index */\ntypedef uint16 tsample_t;       /* sample number */\ntypedef uint32 tstrile_t;       /* strip or tile number */\ntypedef tstrile_t tstrip_t;     /* strip number */\ntypedef tstrile_t ttile_t;      /* tile number */\ntypedef tmsize_t tsize_t;       /* i/o size in bytes */\ntypedef void* tdata_t;          /* image data ref */\n\n#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))\n#define __WIN32__\n#endif\n\n/*\n * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c\n * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).\n *\n * By default tif_unix.c is assumed.\n */\n\n#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)\n#  if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)\n#    define AVOID_WIN32_FILEIO\n#  endif\n#endif\n\n#if defined(USE_WIN32_FILEIO)\n# define VC_EXTRALEAN\n# include <windows.h>\n# ifdef __WIN32__\nDECLARE_HANDLE(thandle_t);     /* Win32 file handle */\n# else\ntypedef HFILE thandle_t;       /* client data handle */\n# endif /* __WIN32__ */\n#else\ntypedef void* thandle_t;       /* client data handle */\n#endif /* USE_WIN32_FILEIO */\n\n/*\n * Flags to pass to TIFFPrintDirectory to control\n * printing of data structures that are potentially\n * very large.   Bit-or these flags to enable printing\n * multiple items.\n */\n#define TIFFPRINT_NONE\t       0x0    /* no extra info */\n#define TIFFPRINT_STRIPS       0x1    /* strips/tiles info */\n#define TIFFPRINT_CURVES       0x2    /* color/gray response curves */\n#define TIFFPRINT_COLORMAP     0x4    /* colormap */\n#define TIFFPRINT_JPEGQTABLES  0x100  /* JPEG Q matrices */\n#define TIFFPRINT_JPEGACTABLES 0x200  /* JPEG AC tables */\n#define TIFFPRINT_JPEGDCTABLES 0x200  /* JPEG DC tables */\n\n/* \n * Colour conversion stuff\n */\n\n/* reference white */\n#define D65_X0 (95.0470F)\n#define D65_Y0 (100.0F)\n#define D65_Z0 (108.8827F)\n\n#define D50_X0 (96.4250F)\n#define D50_Y0 (100.0F)\n#define D50_Z0 (82.4680F)\n\n/* Structure for holding information about a display device. */\n\ntypedef unsigned char TIFFRGBValue;               /* 8-bit samples */\n\ntypedef struct {\n\tfloat d_mat[3][3];                        /* XYZ -> luminance matrix */\n\tfloat d_YCR;                              /* Light o/p for reference white */\n\tfloat d_YCG;\n\tfloat d_YCB;\n\tuint32 d_Vrwr;                            /* Pixel values for ref. white */\n\tuint32 d_Vrwg;\n\tuint32 d_Vrwb;\n\tfloat d_Y0R;                              /* Residual light for black pixel */\n\tfloat d_Y0G;\n\tfloat d_Y0B;\n\tfloat d_gammaR;                           /* Gamma values for the three guns */\n\tfloat d_gammaG;\n\tfloat d_gammaB;\n} TIFFDisplay;\n\ntypedef struct {                                  /* YCbCr->RGB support */\n\tTIFFRGBValue* clamptab;                   /* range clamping table */\n\tint* Cr_r_tab;\n\tint* Cb_b_tab;\n\tint32* Cr_g_tab;\n\tint32* Cb_g_tab;\n\tint32* Y_tab;\n} TIFFYCbCrToRGB;\n\ntypedef struct {                                  /* CIE Lab 1976->RGB support */\n\tint range;                                /* Size of conversion table */\n#define CIELABTORGB_TABLE_RANGE 1500\n\tfloat rstep, gstep, bstep;\n\tfloat X0, Y0, Z0;                         /* Reference white point */\n\tTIFFDisplay display;\n\tfloat Yr2r[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yr to r */\n\tfloat Yg2g[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yg to g */\n\tfloat Yb2b[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yb to b */\n} TIFFCIELabToRGB;\n\n/*\n * RGBA-style image support.\n */\ntypedef struct _TIFFRGBAImage TIFFRGBAImage;\n/*\n * The image reading and conversion routines invoke\n * ``put routines'' to copy/image/whatever tiles of\n * raw image data.  A default set of routines are \n * provided to convert/copy raw image data to 8-bit\n * packed ABGR format rasters.  Applications can supply\n * alternate routines that unpack the data into a\n * different format or, for example, unpack the data\n * and draw the unpacked raster on the display.\n */\ntypedef void (*tileContigRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*);\ntypedef void (*tileSeparateRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*, unsigned char*, unsigned char*, unsigned char*);\n/*\n * RGBA-reader state.\n */\nstruct _TIFFRGBAImage {\n\tTIFF* tif;                              /* image handle */\n\tint stoponerr;                          /* stop on read error */\n\tint isContig;                           /* data is packed/separate */\n\tint alpha;                              /* type of alpha data present */\n\tuint32 width;                           /* image width */\n\tuint32 height;                          /* image height */\n\tuint16 bitspersample;                   /* image bits/sample */\n\tuint16 samplesperpixel;                 /* image samples/pixel */\n\tuint16 orientation;                     /* image orientation */\n\tuint16 req_orientation;                 /* requested orientation */\n\tuint16 photometric;                     /* image photometric interp */\n\tuint16* redcmap;                        /* colormap pallete */\n\tuint16* greencmap;\n\tuint16* bluecmap;\n\t/* get image data routine */\n\tint (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);\n\t/* put decoded strip/tile */\n\tunion {\n\t    void (*any)(TIFFRGBAImage*);\n\t    tileContigRoutine contig;\n\t    tileSeparateRoutine separate;\n\t} put;\n\tTIFFRGBValue* Map;                      /* sample mapping array */\n\tuint32** BWmap;                         /* black&white map */\n\tuint32** PALmap;                        /* palette image map */\n\tTIFFYCbCrToRGB* ycbcr;                  /* YCbCr conversion state */\n\tTIFFCIELabToRGB* cielab;                /* CIE L*a*b conversion state */\n\n\tuint8* UaToAa;                          /* Unassociated alpha to associated alpha convertion LUT */\n\tuint8* Bitdepth16To8;                   /* LUT for conversion from 16bit to 8bit values */\n\n\tint row_offset;\n\tint col_offset;\n};\n\n/*\n * Macros for extracting components from the\n * packed ABGR form returned by TIFFReadRGBAImage.\n */\n#define TIFFGetR(abgr) ((abgr) & 0xff)\n#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)\n#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)\n#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)\n\n/*\n * A CODEC is a software package that implements decoding,\n * encoding, or decoding+encoding of a compression algorithm.\n * The library provides a collection of builtin codecs.\n * More codecs may be registered through calls to the library\n * and/or the builtin implementations may be overridden.\n */\ntypedef int (*TIFFInitMethod)(TIFF*, int);\ntypedef struct {\n\tchar* name;\n\tuint16 scheme;\n\tTIFFInitMethod init;\n} TIFFCodec;\n\n#include <stdio.h>\n#include <stdarg.h>\n\n/* share internal LogLuv conversion routines? */\n#ifndef LOGLUV_PUBLIC\n#define LOGLUV_PUBLIC 1\n#endif\n\n#if !defined(__GNUC__) && !defined(__attribute__)\n#  define __attribute__(x) /*nothing*/\n#endif\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern \"C\" {\n#endif\ntypedef void (*TIFFErrorHandler)(const char*, const char*, va_list);\ntypedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);\ntypedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t);\ntypedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);\ntypedef int (*TIFFCloseProc)(thandle_t);\ntypedef toff_t (*TIFFSizeProc)(thandle_t);\ntypedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size);\ntypedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size);\ntypedef void (*TIFFExtendProc)(TIFF*);\n\nextern const char* TIFFGetVersion(void);\n\nextern const TIFFCodec* TIFFFindCODEC(uint16);\nextern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);\nextern void TIFFUnRegisterCODEC(TIFFCodec*);\nextern int TIFFIsCODECConfigured(uint16);\nextern TIFFCodec* TIFFGetConfiguredCODECs(void);\n\n/*\n * Auxiliary functions.\n */\n\nextern void* _TIFFmalloc(tmsize_t s);\nextern void* _TIFFrealloc(void* p, tmsize_t s);\nextern void _TIFFmemset(void* p, int v, tmsize_t c);\nextern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);\nextern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);\nextern void _TIFFfree(void* p);\n\n/*\n** Stuff, related to tag handling and creating custom tags.\n*/\nextern int TIFFGetTagListCount( TIFF * );\nextern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );\n    \n#define TIFF_ANY       TIFF_NOTYPE     /* for field descriptor searching */\n#define TIFF_VARIABLE  -1              /* marker for variable length tags */\n#define TIFF_SPP       -2              /* marker for SamplesPerPixel tags */\n#define TIFF_VARIABLE2 -3              /* marker for uint32 var-length tags */\n\n#define FIELD_CUSTOM    65\n\ntypedef struct _TIFFField TIFFField;\ntypedef struct _TIFFFieldArray TIFFFieldArray;\n\nextern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);\nextern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);\nextern const TIFFField* TIFFFieldWithName(TIFF*, const char *);\n\nextern uint32 TIFFFieldTag(const TIFFField*);\nextern const char* TIFFFieldName(const TIFFField*);\nextern TIFFDataType TIFFFieldDataType(const TIFFField*);\nextern int TIFFFieldPassCount(const TIFFField*);\nextern int TIFFFieldReadCount(const TIFFField*);\nextern int TIFFFieldWriteCount(const TIFFField*);\n\ntypedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);\ntypedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);\ntypedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);\n\ntypedef struct {\n    TIFFVSetMethod vsetfield; /* tag set routine */\n    TIFFVGetMethod vgetfield; /* tag get routine */\n    TIFFPrintMethod printdir; /* directory print routine */\n} TIFFTagMethods;\n\nextern  TIFFTagMethods *TIFFAccessTagMethods(TIFF *);\nextern  void *TIFFGetClientInfo(TIFF *, const char *);\nextern  void TIFFSetClientInfo(TIFF *, void *, const char *);\n\nextern void TIFFCleanup(TIFF* tif);\nextern void TIFFClose(TIFF* tif);\nextern int TIFFFlush(TIFF* tif);\nextern int TIFFFlushData(TIFF* tif);\nextern int TIFFGetField(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFReadDirectory(TIFF* tif);\nextern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);\nextern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);\nextern uint64 TIFFScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFScanlineSize(TIFF* tif);\nextern uint64 TIFFRasterScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFRasterScanlineSize(TIFF* tif);\nextern uint64 TIFFStripSize64(TIFF* tif);\nextern tmsize_t TIFFStripSize(TIFF* tif);\nextern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);\nextern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);\nextern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);\nextern uint64 TIFFTileRowSize64(TIFF* tif);\nextern tmsize_t TIFFTileRowSize(TIFF* tif);\nextern uint64 TIFFTileSize64(TIFF* tif);\nextern tmsize_t TIFFTileSize(TIFF* tif);\nextern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);\nextern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);\nextern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);\nextern int TIFFFileno(TIFF*);\nextern int TIFFSetFileno(TIFF*, int);\nextern thandle_t TIFFClientdata(TIFF*);\nextern thandle_t TIFFSetClientdata(TIFF*, thandle_t);\nextern int TIFFGetMode(TIFF*);\nextern int TIFFSetMode(TIFF*, int);\nextern int TIFFIsTiled(TIFF*);\nextern int TIFFIsByteSwapped(TIFF*);\nextern int TIFFIsUpSampled(TIFF*);\nextern int TIFFIsMSB2LSB(TIFF*);\nextern int TIFFIsBigEndian(TIFF*);\nextern TIFFReadWriteProc TIFFGetReadProc(TIFF*);\nextern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);\nextern TIFFSeekProc TIFFGetSeekProc(TIFF*);                                                          \nextern TIFFCloseProc TIFFGetCloseProc(TIFF*);\nextern TIFFSizeProc TIFFGetSizeProc(TIFF*);\nextern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);\nextern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);\nextern uint32 TIFFCurrentRow(TIFF*);\nextern uint16 TIFFCurrentDirectory(TIFF*);\nextern uint16 TIFFNumberOfDirectories(TIFF*);\nextern uint64 TIFFCurrentDirOffset(TIFF*);\nextern uint32 TIFFCurrentStrip(TIFF*);\nextern uint32 TIFFCurrentTile(TIFF* tif);\nextern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);\nextern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);  \nextern int TIFFSetupStrips(TIFF *);\nextern int TIFFWriteCheck(TIFF*, int, const char *);\nextern void TIFFFreeDirectory(TIFF*);\nextern int TIFFCreateDirectory(TIFF*);\nextern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*);\nextern int TIFFCreateEXIFDirectory(TIFF*);\nextern int TIFFLastDirectory(TIFF*);\nextern int TIFFSetDirectory(TIFF*, uint16);\nextern int TIFFSetSubDirectory(TIFF*, uint64);\nextern int TIFFUnlinkDirectory(TIFF*, uint16);\nextern int TIFFSetField(TIFF*, uint32, ...);\nextern int TIFFVSetField(TIFF*, uint32, va_list);\nextern int TIFFUnsetField(TIFF*, uint32);\nextern int TIFFWriteDirectory(TIFF *);\nextern int TIFFWriteCustomDirectory(TIFF *, uint64 *);\nextern int TIFFCheckpointDirectory(TIFF *);\nextern int TIFFRewriteDirectory(TIFF *);\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,\n    int = ORIENTATION_BOTLEFT, int = 0);\n#else\nextern void TIFFPrintDirectory(TIFF*, FILE*, long);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);\n#endif\n\nextern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );\nextern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );\nextern int TIFFRGBAImageOK(TIFF*, char [1024]);\nextern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);\nextern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);\nextern void TIFFRGBAImageEnd(TIFFRGBAImage*);\nextern TIFF* TIFFOpen(const char*, const char*);\n# ifdef __WIN32__\nextern TIFF* TIFFOpenW(const wchar_t*, const char*);\n# endif /* __WIN32__ */\nextern TIFF* TIFFFdOpen(int, const char*, const char*);\nextern TIFF* TIFFClientOpen(const char*, const char*,\n\t    thandle_t,\n\t    TIFFReadWriteProc, TIFFReadWriteProc,\n\t    TIFFSeekProc, TIFFCloseProc,\n\t    TIFFSizeProc,\n\t    TIFFMapFileProc, TIFFUnmapFileProc);\nextern const char* TIFFFileName(TIFF*);\nextern const char* TIFFSetFileName(TIFF*, const char *);\nextern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);\nextern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);\nextern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);\nextern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFNumberOfTiles(TIFF*);\nextern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);  \nextern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);\nextern uint32 TIFFNumberOfStrips(TIFF*);\nextern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);\nextern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);\nextern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern int TIFFDataWidth(TIFFDataType);    /* table of tag datatype widths */\nextern void TIFFSetWriteOffset(TIFF* tif, toff_t off);\nextern void TIFFSwabShort(uint16*);\nextern void TIFFSwabLong(uint32*);\nextern void TIFFSwabLong8(uint64*);\nextern void TIFFSwabFloat(float*);\nextern void TIFFSwabDouble(double*);\nextern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);\nextern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);\nextern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);\nextern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);\nextern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);\nextern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);\nextern void TIFFReverseBits(uint8* cp, tmsize_t n);\nextern const unsigned char* TIFFGetBitRevTable(int);\n\n#ifdef LOGLUV_PUBLIC\n#define U_NEU\t\t0.210526316\n#define V_NEU\t\t0.473684211\n#define UVSCALE\t\t410.\nextern double LogL16toY(int);\nextern double LogL10toY(int);\nextern void XYZtoRGB24(float*, uint8*);\nextern int uv_decode(double*, double*, int);\nextern void LogLuv24toXYZ(uint32, float*);\nextern void LogLuv32toXYZ(uint32, float*);\n#if defined(c_plusplus) || defined(__cplusplus)\nextern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);\nextern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);\nextern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);\n#else\nextern int LogL16fromY(double, int);\nextern int LogL10fromY(double, int);\nextern int uv_encode(double, double, int);\nextern uint32 LogLuv24fromXYZ(float*, int);\nextern uint32 LogLuv32fromXYZ(float*, int);\n#endif\n#endif /* LOGLUV_PUBLIC */\n\nextern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);\nextern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,\n    float *, float *, float *);\nextern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,\n    uint32 *, uint32 *, uint32 *);\n\nextern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);\nextern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,\n    uint32 *, uint32 *, uint32 *);\n\n/****************************************************************************\n *               O B S O L E T E D    I N T E R F A C E S\n *\n * Don't use this stuff in your applications, it may be removed in the future\n * libtiff versions.\n ****************************************************************************/\ntypedef\tstruct {\n\tttag_t\tfield_tag;\t\t/* field's tag */\n\tshort\tfield_readcount;\t/* read count/TIFF_VARIABLE/TIFF_SPP */\n\tshort\tfield_writecount;\t/* write count/TIFF_VARIABLE */\n\tTIFFDataType field_type;\t/* type of associated data */\n        unsigned short field_bit;\t/* bit in fieldsset bit vector */\n\tunsigned char field_oktochange;\t/* if true, can change while writing */\n\tunsigned char field_passcount;\t/* if true, pass dir count on set */\n\tchar\t*field_name;\t\t/* ASCII name */\n} TIFFFieldInfo;\n\nextern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);\n        \n#if defined(c_plusplus) || defined(__cplusplus)\n}\n#endif\n\n#endif /* _TIFFIO_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/ios/tiffvers.h",
    "content": "#define TIFFLIB_VERSION_STR \"LIBTIFF, Version 4.0.3\\nCopyright (c) 1988-1996 Sam Leffler\\nCopyright (c) 1991-1996 Silicon Graphics, Inc.\"\n/*\n * This define can be used in code that requires\n * compilation-related definitions specific to a\n * version or versions of the library.  Runtime\n * version checking should be done based on the\n * string returned by TIFFGetVersion.\n */\n#define TIFFLIB_VERSION 20120922\n"
  },
  {
    "path": "cocos2d/external/tiff/include/linux/tiff.h",
    "content": "/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and \n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n * \n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  \n * \n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF \n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE \n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFF_\n#define\t_TIFF_\n\n#include \"tiffconf.h\"\n\n/*\n * Tag Image File Format (TIFF)\n *\n * Based on Rev 6.0 from:\n *    Developer's Desk\n *    Aldus Corporation\n *    411 First Ave. South\n *    Suite 200\n *    Seattle, WA  98104\n *    206-622-5500\n *\n *    (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)\n *\n * For BigTIFF design notes see the following links\n *    http://www.remotesensing.org/libtiff/bigtiffdesign.html\n *    http://www.awaresystems.be/imaging/tiff/bigtiff.html\n */\n\n#define TIFF_VERSION_CLASSIC 42\n#define TIFF_VERSION_BIG 43\n\n#define TIFF_BIGENDIAN      0x4d4d\n#define TIFF_LITTLEENDIAN   0x4949\n#define MDI_LITTLEENDIAN    0x5045\n#define MDI_BIGENDIAN       0x4550\n\n/*\n * Intrinsic data types required by the file format:\n *\n * 8-bit quantities     int8/uint8\n * 16-bit quantities    int16/uint16\n * 32-bit quantities    int32/uint32\n * 64-bit quantities    int64/uint64\n * strings              unsigned char*\n */\n\ntypedef TIFF_INT8_T   int8;\ntypedef TIFF_UINT8_T  uint8;\n\ntypedef TIFF_INT16_T  int16;\ntypedef TIFF_UINT16_T uint16;\n\ntypedef TIFF_INT32_T  int32;\ntypedef TIFF_UINT32_T uint32;\n\ntypedef TIFF_INT64_T  int64;\ntypedef TIFF_UINT64_T uint64;\n\n/*\n * Some types as promoted in a variable argument list\n * We use uint16_vap rather then directly using int, because this way\n * we document the type we actually want to pass through, conceptually,\n * rather then confusing the issue by merely stating the type it gets\n * promoted to\n */\n\ntypedef int uint16_vap;\n\n/*\n * TIFF header.\n */\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n} TIFFHeaderCommon;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint32 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderClassic;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint16 tiff_offsetsize; /* size of offsets, should be 8 */\n\tuint16 tiff_unused;     /* unused word, should be 0 */\n\tuint64 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderBig;\n\n\n/*\n * NB: In the comments below,\n *  - items marked with a + are obsoleted by revision 5.0,\n *  - items marked with a ! are introduced in revision 6.0.\n *  - items marked with a % are introduced post revision 6.0.\n *  - items marked with a $ are obsoleted by revision 6.0.\n *  - items marked with a & are introduced by Adobe DNG specification.\n */\n\n/*\n * Tag data type information.\n *\n * Note: RATIONALs are the ratio of two 32-bit integer values.\n */\ntypedef enum {\n\tTIFF_NOTYPE = 0,      /* placeholder */\n\tTIFF_BYTE = 1,        /* 8-bit unsigned integer */\n\tTIFF_ASCII = 2,       /* 8-bit bytes w/ last byte null */\n\tTIFF_SHORT = 3,       /* 16-bit unsigned integer */\n\tTIFF_LONG = 4,        /* 32-bit unsigned integer */\n\tTIFF_RATIONAL = 5,    /* 64-bit unsigned fraction */\n\tTIFF_SBYTE = 6,       /* !8-bit signed integer */\n\tTIFF_UNDEFINED = 7,   /* !8-bit untyped data */\n\tTIFF_SSHORT = 8,      /* !16-bit signed integer */\n\tTIFF_SLONG = 9,       /* !32-bit signed integer */\n\tTIFF_SRATIONAL = 10,  /* !64-bit signed fraction */\n\tTIFF_FLOAT = 11,      /* !32-bit IEEE floating point */\n\tTIFF_DOUBLE = 12,     /* !64-bit IEEE floating point */\n\tTIFF_IFD = 13,        /* %32-bit unsigned integer (offset) */\n\tTIFF_LONG8 = 16,      /* BigTIFF 64-bit unsigned integer */\n\tTIFF_SLONG8 = 17,     /* BigTIFF 64-bit signed integer */\n\tTIFF_IFD8 = 18        /* BigTIFF 64-bit unsigned integer (offset) */\n} TIFFDataType;\n\n/*\n * TIFF Tag Definitions.\n */\n#define\tTIFFTAG_SUBFILETYPE\t\t254\t/* subfile data descriptor */\n#define\t    FILETYPE_REDUCEDIMAGE\t0x1\t/* reduced resolution version */\n#define\t    FILETYPE_PAGE\t\t0x2\t/* one page of many */\n#define\t    FILETYPE_MASK\t\t0x4\t/* transparency mask */\n#define\tTIFFTAG_OSUBFILETYPE\t\t255\t/* +kind of data in subfile */\n#define\t    OFILETYPE_IMAGE\t\t1\t/* full resolution image data */\n#define\t    OFILETYPE_REDUCEDIMAGE\t2\t/* reduced size image data */\n#define\t    OFILETYPE_PAGE\t\t3\t/* one page of many */\n#define\tTIFFTAG_IMAGEWIDTH\t\t256\t/* image width in pixels */\n#define\tTIFFTAG_IMAGELENGTH\t\t257\t/* image height in pixels */\n#define\tTIFFTAG_BITSPERSAMPLE\t\t258\t/* bits per channel (sample) */\n#define\tTIFFTAG_COMPRESSION\t\t259\t/* data compression technique */\n#define\t    COMPRESSION_NONE\t\t1\t/* dump mode */\n#define\t    COMPRESSION_CCITTRLE\t2\t/* CCITT modified Huffman RLE */\n#define\t    COMPRESSION_CCITTFAX3\t3\t/* CCITT Group 3 fax encoding */\n#define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */\n#define\t    COMPRESSION_CCITTFAX4\t4\t/* CCITT Group 4 fax encoding */\n#define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */\n#define\t    COMPRESSION_LZW\t\t5       /* Lempel-Ziv  & Welch */\n#define\t    COMPRESSION_OJPEG\t\t6\t/* !6.0 JPEG */\n#define\t    COMPRESSION_JPEG\t\t7\t/* %JPEG DCT compression */\n#define     COMPRESSION_T85\t\t\t9\t/* !TIFF/FX T.85 JBIG compression */\n#define     COMPRESSION_T43\t\t\t10\t/* !TIFF/FX T.43 colour by layered JBIG compression */\n#define\t    COMPRESSION_NEXT\t\t32766\t/* NeXT 2-bit RLE */\n#define\t    COMPRESSION_CCITTRLEW\t32771\t/* #1 w/ word alignment */\n#define\t    COMPRESSION_PACKBITS\t32773\t/* Macintosh RLE */\n#define\t    COMPRESSION_THUNDERSCAN\t32809\t/* ThunderScan RLE */\n/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define\t    COMPRESSION_IT8CTPAD\t32895   /* IT8 CT w/padding */\n#define\t    COMPRESSION_IT8LW\t\t32896   /* IT8 Linework RLE */\n#define\t    COMPRESSION_IT8MP\t\t32897   /* IT8 Monochrome picture */\n#define\t    COMPRESSION_IT8BL\t\t32898   /* IT8 Binary line art */\n/* compression codes 32908-32911 are reserved for Pixar */\n#define     COMPRESSION_PIXARFILM\t32908   /* Pixar companded 10bit LZW */\n#define\t    COMPRESSION_PIXARLOG\t32909   /* Pixar companded 11bit ZIP */\n#define\t    COMPRESSION_DEFLATE\t\t32946\t/* Deflate compression */\n#define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,\n\t\t\t\t\t\t   as recognized by Adobe */\n/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */\n#define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */\n#define\t    COMPRESSION_JBIG\t\t34661\t/* ISO JBIG */\n#define     COMPRESSION_SGILOG\t\t34676\t/* SGI Log Luminance RLE */\n#define     COMPRESSION_SGILOG24\t34677\t/* SGI Log 24-bit packed */\n#define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */\n#define\t    COMPRESSION_LZMA\t\t34925\t/* LZMA2 */\n#define\tTIFFTAG_PHOTOMETRIC\t\t262\t/* photometric interpretation */\n#define\t    PHOTOMETRIC_MINISWHITE\t0\t/* min value is white */\n#define\t    PHOTOMETRIC_MINISBLACK\t1\t/* min value is black */\n#define\t    PHOTOMETRIC_RGB\t\t2\t/* RGB color model */\n#define\t    PHOTOMETRIC_PALETTE\t\t3\t/* color map indexed */\n#define\t    PHOTOMETRIC_MASK\t\t4\t/* $holdout mask */\n#define\t    PHOTOMETRIC_SEPARATED\t5\t/* !color separations */\n#define\t    PHOTOMETRIC_YCBCR\t\t6\t/* !CCIR 601 */\n#define\t    PHOTOMETRIC_CIELAB\t\t8\t/* !1976 CIE L*a*b* */\n#define\t    PHOTOMETRIC_ICCLAB\t\t9\t/* ICC L*a*b* [Adobe TIFF Technote 4] */\n#define\t    PHOTOMETRIC_ITULAB\t\t10\t/* ITU L*a*b* */\n#define     PHOTOMETRIC_LOGL\t\t32844\t/* CIE Log2(L) */\n#define     PHOTOMETRIC_LOGLUV\t\t32845\t/* CIE Log2(L) (u',v') */\n#define\tTIFFTAG_THRESHHOLDING\t\t263\t/* +thresholding used on data */\n#define\t    THRESHHOLD_BILEVEL\t\t1\t/* b&w art scan */\n#define\t    THRESHHOLD_HALFTONE\t\t2\t/* or dithered scan */\n#define\t    THRESHHOLD_ERRORDIFFUSE\t3\t/* usually floyd-steinberg */\n#define\tTIFFTAG_CELLWIDTH\t\t264\t/* +dithering matrix width */\n#define\tTIFFTAG_CELLLENGTH\t\t265\t/* +dithering matrix height */\n#define\tTIFFTAG_FILLORDER\t\t266\t/* data order within a byte */\n#define\t    FILLORDER_MSB2LSB\t\t1\t/* most significant -> least */\n#define\t    FILLORDER_LSB2MSB\t\t2\t/* least significant -> most */\n#define\tTIFFTAG_DOCUMENTNAME\t\t269\t/* name of doc. image is from */\n#define\tTIFFTAG_IMAGEDESCRIPTION\t270\t/* info about image */\n#define\tTIFFTAG_MAKE\t\t\t271\t/* scanner manufacturer name */\n#define\tTIFFTAG_MODEL\t\t\t272\t/* scanner model name/number */\n#define\tTIFFTAG_STRIPOFFSETS\t\t273\t/* offsets to data strips */\n#define\tTIFFTAG_ORIENTATION\t\t274\t/* +image orientation */\n#define\t    ORIENTATION_TOPLEFT\t\t1\t/* row 0 top, col 0 lhs */\n#define\t    ORIENTATION_TOPRIGHT\t2\t/* row 0 top, col 0 rhs */\n#define\t    ORIENTATION_BOTRIGHT\t3\t/* row 0 bottom, col 0 rhs */\n#define\t    ORIENTATION_BOTLEFT\t\t4\t/* row 0 bottom, col 0 lhs */\n#define\t    ORIENTATION_LEFTTOP\t\t5\t/* row 0 lhs, col 0 top */\n#define\t    ORIENTATION_RIGHTTOP\t6\t/* row 0 rhs, col 0 top */\n#define\t    ORIENTATION_RIGHTBOT\t7\t/* row 0 rhs, col 0 bottom */\n#define\t    ORIENTATION_LEFTBOT\t\t8\t/* row 0 lhs, col 0 bottom */\n#define\tTIFFTAG_SAMPLESPERPIXEL\t\t277\t/* samples per pixel */\n#define\tTIFFTAG_ROWSPERSTRIP\t\t278\t/* rows per strip of data */\n#define\tTIFFTAG_STRIPBYTECOUNTS\t\t279\t/* bytes counts for strips */\n#define\tTIFFTAG_MINSAMPLEVALUE\t\t280\t/* +minimum sample value */\n#define\tTIFFTAG_MAXSAMPLEVALUE\t\t281\t/* +maximum sample value */\n#define\tTIFFTAG_XRESOLUTION\t\t282\t/* pixels/resolution in x */\n#define\tTIFFTAG_YRESOLUTION\t\t283\t/* pixels/resolution in y */\n#define\tTIFFTAG_PLANARCONFIG\t\t284\t/* storage organization */\n#define\t    PLANARCONFIG_CONTIG\t\t1\t/* single image plane */\n#define\t    PLANARCONFIG_SEPARATE\t2\t/* separate planes of data */\n#define\tTIFFTAG_PAGENAME\t\t285\t/* page name image is from */\n#define\tTIFFTAG_XPOSITION\t\t286\t/* x page offset of image lhs */\n#define\tTIFFTAG_YPOSITION\t\t287\t/* y page offset of image lhs */\n#define\tTIFFTAG_FREEOFFSETS\t\t288\t/* +byte offset to free block */\n#define\tTIFFTAG_FREEBYTECOUNTS\t\t289\t/* +sizes of free blocks */\n#define\tTIFFTAG_GRAYRESPONSEUNIT\t290\t/* $gray scale curve accuracy */\n#define\t    GRAYRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    GRAYRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    GRAYRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_GRAYRESPONSECURVE\t291\t/* $gray scale response curve */\n#define\tTIFFTAG_GROUP3OPTIONS\t\t292\t/* 32 flag bits */\n#define\tTIFFTAG_T4OPTIONS\t\t292\t/* TIFF 6.0 proper name alias */\n#define\t    GROUP3OPT_2DENCODING\t0x1\t/* 2-dimensional coding */\n#define\t    GROUP3OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\t    GROUP3OPT_FILLBITS\t\t0x4\t/* fill to byte boundary */\n#define\tTIFFTAG_GROUP4OPTIONS\t\t293\t/* 32 flag bits */\n#define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */\n#define\t    GROUP4OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\tTIFFTAG_RESOLUTIONUNIT\t\t296\t/* units of resolutions */\n#define\t    RESUNIT_NONE\t\t1\t/* no meaningful units */\n#define\t    RESUNIT_INCH\t\t2\t/* english */\n#define\t    RESUNIT_CENTIMETER\t\t3\t/* metric */\n#define\tTIFFTAG_PAGENUMBER\t\t297\t/* page numbers of multi-page */\n#define\tTIFFTAG_COLORRESPONSEUNIT\t300\t/* $color curve accuracy */\n#define\t    COLORRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    COLORRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    COLORRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_TRANSFERFUNCTION\t301\t/* !colorimetry info */\n#define\tTIFFTAG_SOFTWARE\t\t305\t/* name & release */\n#define\tTIFFTAG_DATETIME\t\t306\t/* creation date and time */\n#define\tTIFFTAG_ARTIST\t\t\t315\t/* creator of image */\n#define\tTIFFTAG_HOSTCOMPUTER\t\t316\t/* machine where created */\n#define\tTIFFTAG_PREDICTOR\t\t317\t/* prediction scheme w/ LZW */\n#define     PREDICTOR_NONE\t\t1\t/* no prediction scheme used */\n#define     PREDICTOR_HORIZONTAL\t2\t/* horizontal differencing */\n#define     PREDICTOR_FLOATINGPOINT\t3\t/* floating point predictor */\n#define\tTIFFTAG_WHITEPOINT\t\t318\t/* image white point */\n#define\tTIFFTAG_PRIMARYCHROMATICITIES\t319\t/* !primary chromaticities */\n#define\tTIFFTAG_COLORMAP\t\t320\t/* RGB map for pallette image */\n#define\tTIFFTAG_HALFTONEHINTS\t\t321\t/* !highlight+shadow info */\n#define\tTIFFTAG_TILEWIDTH\t\t322\t/* !tile width in pixels */\n#define\tTIFFTAG_TILELENGTH\t\t323\t/* !tile height in pixels */\n#define TIFFTAG_TILEOFFSETS\t\t324\t/* !offsets to data tiles */\n#define TIFFTAG_TILEBYTECOUNTS\t\t325\t/* !byte counts for tiles */\n#define\tTIFFTAG_BADFAXLINES\t\t326\t/* lines w/ wrong pixel count */\n#define\tTIFFTAG_CLEANFAXDATA\t\t327\t/* regenerated line info */\n#define\t    CLEANFAXDATA_CLEAN\t\t0\t/* no errors detected */\n#define\t    CLEANFAXDATA_REGENERATED\t1\t/* receiver regenerated lines */\n#define\t    CLEANFAXDATA_UNCLEAN\t2\t/* uncorrected errors exist */\n#define\tTIFFTAG_CONSECUTIVEBADFAXLINES\t328\t/* max consecutive bad lines */\n#define\tTIFFTAG_SUBIFD\t\t\t330\t/* subimage descriptors */\n#define\tTIFFTAG_INKSET\t\t\t332\t/* !inks in separated image */\n#define\t    INKSET_CMYK\t\t\t1\t/* !cyan-magenta-yellow-black color */\n#define\t    INKSET_MULTIINK\t\t2\t/* !multi-ink or hi-fi color */\n#define\tTIFFTAG_INKNAMES\t\t333\t/* !ascii names of inks */\n#define\tTIFFTAG_NUMBEROFINKS\t\t334\t/* !number of inks */\n#define\tTIFFTAG_DOTRANGE\t\t336\t/* !0% and 100% dot codes */\n#define\tTIFFTAG_TARGETPRINTER\t\t337\t/* !separation target */\n#define\tTIFFTAG_EXTRASAMPLES\t\t338\t/* !info about extra samples */\n#define\t    EXTRASAMPLE_UNSPECIFIED\t0\t/* !unspecified data */\n#define\t    EXTRASAMPLE_ASSOCALPHA\t1\t/* !associated alpha data */\n#define\t    EXTRASAMPLE_UNASSALPHA\t2\t/* !unassociated alpha data */\n#define\tTIFFTAG_SAMPLEFORMAT\t\t339\t/* !data sample format */\n#define\t    SAMPLEFORMAT_UINT\t\t1\t/* !unsigned integer data */\n#define\t    SAMPLEFORMAT_INT\t\t2\t/* !signed integer data */\n#define\t    SAMPLEFORMAT_IEEEFP\t\t3\t/* !IEEE floating point data */\n#define\t    SAMPLEFORMAT_VOID\t\t4\t/* !untyped data */\n#define\t    SAMPLEFORMAT_COMPLEXINT\t5\t/* !complex signed int */\n#define\t    SAMPLEFORMAT_COMPLEXIEEEFP\t6\t/* !complex ieee floating */\n#define\tTIFFTAG_SMINSAMPLEVALUE\t\t340\t/* !variable MinSampleValue */\n#define\tTIFFTAG_SMAXSAMPLEVALUE\t\t341\t/* !variable MaxSampleValue */\n#define\tTIFFTAG_CLIPPATH\t\t343\t/* %ClipPath\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_XCLIPPATHUNITS\t\t344\t/* %XClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_YCLIPPATHUNITS\t\t345\t/* %YClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_INDEXED\t\t\t346\t/* %Indexed\n\t\t\t\t\t\t   [Adobe TIFF Technote 3] */\n#define\tTIFFTAG_JPEGTABLES\t\t347\t/* %JPEG table stream */\n#define\tTIFFTAG_OPIPROXY\t\t351\t/* %OPI Proxy [Adobe TIFF technote] */\n/* Tags 400-435 are from the TIFF/FX spec */\n#define TIFFTAG_GLOBALPARAMETERSIFD\t400\t/* ! */\n#define TIFFTAG_PROFILETYPE\t\t\t401\t/* ! */\n#define     PROFILETYPE_UNSPECIFIED\t0\t/* ! */\n#define     PROFILETYPE_G3_FAX\t\t1\t/* ! */\n#define TIFFTAG_FAXPROFILE\t\t\t402\t/* ! */\n#define     FAXPROFILE_S\t\t\t1\t/* !TIFF/FX FAX profile S */\n#define     FAXPROFILE_F\t\t\t2\t/* !TIFF/FX FAX profile F */\n#define     FAXPROFILE_J\t\t\t3\t/* !TIFF/FX FAX profile J */\n#define     FAXPROFILE_C\t\t\t4\t/* !TIFF/FX FAX profile C */\n#define     FAXPROFILE_L\t\t\t5\t/* !TIFF/FX FAX profile L */\n#define     FAXPROFILE_M\t\t\t6\t/* !TIFF/FX FAX profile LM */\n#define TIFFTAG_CODINGMETHODS\t\t403\t/* !TIFF/FX coding methods */\n#define     CODINGMETHODS_T4_1D\t\t(1 << 1)\t/* !T.4 1D */\n#define     CODINGMETHODS_T4_2D\t\t(1 << 2)\t/* !T.4 2D */\n#define     CODINGMETHODS_T6\t\t(1 << 3)\t/* !T.6 */\n#define     CODINGMETHODS_T85 \t\t(1 << 4)\t/* !T.85 JBIG */\n#define     CODINGMETHODS_T42 \t\t(1 << 5)\t/* !T.42 JPEG */\n#define     CODINGMETHODS_T43\t\t(1 << 6)\t/* !T.43 colour by layered JBIG */\n#define TIFFTAG_VERSIONYEAR\t\t\t404\t/* !TIFF/FX version year */\n#define TIFFTAG_MODENUMBER\t\t\t405\t/* !TIFF/FX mode number */\n#define TIFFTAG_DECODE\t\t\t\t433\t/* !TIFF/FX decode */\n#define TIFFTAG_IMAGEBASECOLOR\t\t434\t/* !TIFF/FX image base colour */\n#define TIFFTAG_T82OPTIONS\t\t\t435\t/* !TIFF/FX T.82 options */\n/*\n * Tags 512-521 are obsoleted by Technical Note #2 which specifies a\n * revised JPEG-in-TIFF scheme.\n */\n#define\tTIFFTAG_JPEGPROC\t\t512\t/* !JPEG processing algorithm */\n#define\t    JPEGPROC_BASELINE\t\t1\t/* !baseline sequential */\n#define\t    JPEGPROC_LOSSLESS\t\t14\t/* !Huffman coded lossless */\n#define\tTIFFTAG_JPEGIFOFFSET\t\t513\t/* !pointer to SOI marker */\n#define\tTIFFTAG_JPEGIFBYTECOUNT\t\t514\t/* !JFIF stream length */\n#define\tTIFFTAG_JPEGRESTARTINTERVAL\t515\t/* !restart interval length */\n#define\tTIFFTAG_JPEGLOSSLESSPREDICTORS\t517\t/* !lossless proc predictor */\n#define\tTIFFTAG_JPEGPOINTTRANSFORM\t518\t/* !lossless point transform */\n#define\tTIFFTAG_JPEGQTABLES\t\t519\t/* !Q matrice offsets */\n#define\tTIFFTAG_JPEGDCTABLES\t\t520\t/* !DCT table offsets */\n#define\tTIFFTAG_JPEGACTABLES\t\t521\t/* !AC coefficient offsets */\n#define\tTIFFTAG_YCBCRCOEFFICIENTS\t529\t/* !RGB -> YCbCr transform */\n#define\tTIFFTAG_YCBCRSUBSAMPLING\t530\t/* !YCbCr subsampling factors */\n#define\tTIFFTAG_YCBCRPOSITIONING\t531\t/* !subsample positioning */\n#define\t    YCBCRPOSITION_CENTERED\t1\t/* !as in PostScript Level 2 */\n#define\t    YCBCRPOSITION_COSITED\t2\t/* !as in CCIR 601-1 */\n#define\tTIFFTAG_REFERENCEBLACKWHITE\t532\t/* !colorimetry info */\n#define TIFFTAG_STRIPROWCOUNTS\t\t559 /* !TIFF/FX strip row counts */\n#define\tTIFFTAG_XMLPACKET\t\t700\t/* %XML packet\n\t\t\t\t\t\t   [Adobe XMP Specification,\n\t\t\t\t\t\t   January 2004 */\n#define TIFFTAG_OPIIMAGEID\t\t32781\t/* %OPI ImageID\n\t\t\t\t\t\t   [Adobe TIFF technote] */\n/* tags 32952-32956 are private tags registered to Island Graphics */\n#define TIFFTAG_REFPTS\t\t\t32953\t/* image reference points */\n#define TIFFTAG_REGIONTACKPOINT\t\t32954\t/* region-xform tack point */\n#define TIFFTAG_REGIONWARPCORNERS\t32955\t/* warp quadrilateral */\n#define TIFFTAG_REGIONAFFINE\t\t32956\t/* affine transformation mat */\n/* tags 32995-32999 are private tags registered to SGI */\n#define\tTIFFTAG_MATTEING\t\t32995\t/* $use ExtraSamples */\n#define\tTIFFTAG_DATATYPE\t\t32996\t/* $use SampleFormat */\n#define\tTIFFTAG_IMAGEDEPTH\t\t32997\t/* z depth of image */\n#define\tTIFFTAG_TILEDEPTH\t\t32998\t/* z depth/data tile */\n/* tags 33300-33309 are private tags registered to Pixar */\n/*\n * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH\n * are set when an image has been cropped out of a larger image.  \n * They reflect the size of the original uncropped image.\n * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used\n * to determine the position of the smaller image in the larger one.\n */\n#define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */\n#define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */\n /* Tags 33302-33306 are used to identify special image modes and data\n  * used by Pixar's texture formats.\n  */\n#define TIFFTAG_PIXAR_TEXTUREFORMAT\t33302\t/* texture map format */\n#define TIFFTAG_PIXAR_WRAPMODES\t\t33303\t/* s & t wrap modes */\n#define TIFFTAG_PIXAR_FOVCOT\t\t33304\t/* cotan(fov) for env. maps */\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306\n/* tag 33405 is a private tag registered to Eastman Kodak */\n#define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */\n/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */\n#define\tTIFFTAG_COPYRIGHT\t\t33432\t/* copyright string */\n/* IPTC TAG from RichTIFF specifications */\n#define TIFFTAG_RICHTIFFIPTC\t\t33723\n/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define TIFFTAG_IT8SITE\t\t\t34016\t/* site name */\n#define TIFFTAG_IT8COLORSEQUENCE\t34017\t/* color seq. [RGB,CMYK,etc] */\n#define TIFFTAG_IT8HEADER\t\t34018\t/* DDES Header */\n#define TIFFTAG_IT8RASTERPADDING\t34019\t/* raster scanline padding */\n#define TIFFTAG_IT8BITSPERRUNLENGTH\t34020\t/* # of bits in short run */\n#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */\n#define TIFFTAG_IT8COLORTABLE\t\t34022\t/* LW colortable */\n#define TIFFTAG_IT8IMAGECOLORINDICATOR\t34023\t/* BP/BL image color switch */\n#define TIFFTAG_IT8BKGCOLORINDICATOR\t34024\t/* BP/BL bg color switch */\n#define TIFFTAG_IT8IMAGECOLORVALUE\t34025\t/* BP/BL image color value */\n#define TIFFTAG_IT8BKGCOLORVALUE\t34026\t/* BP/BL bg color value */\n#define TIFFTAG_IT8PIXELINTENSITYRANGE\t34027\t/* MP pixel intensity value */\n#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028\t/* HC transparency switch */\n#define TIFFTAG_IT8COLORCHARACTERIZATION 34029\t/* color character. table */\n#define TIFFTAG_IT8HCUSAGE\t\t34030\t/* HC usage indicator */\n#define TIFFTAG_IT8TRAPINDICATOR\t34031\t/* Trapping indicator\n\t\t\t\t\t\t   (untrapped=0, trapped=1) */\n#define TIFFTAG_IT8CMYKEQUIVALENT\t34032\t/* CMYK color equivalents */\n/* tags 34232-34236 are private tags registered to Texas Instruments */\n#define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */\n/* tag 34377 is private tag registered to Adobe for PhotoShop */\n#define TIFFTAG_PHOTOSHOP\t\t34377 \n/* tags 34665, 34853 and 40965 are documented in EXIF specification */\n#define TIFFTAG_EXIFIFD\t\t\t34665\t/* Pointer to EXIF private directory */\n/* tag 34750 is a private tag registered to Adobe? */\n#define TIFFTAG_ICCPROFILE\t\t34675\t/* ICC profile data */\n#define TIFFTAG_IMAGELAYER\t\t34732\t/* !TIFF/FX image layer information */\n/* tag 34750 is a private tag registered to Pixel Magic */\n#define\tTIFFTAG_JBIGOPTIONS\t\t34750\t/* JBIG options */\n#define TIFFTAG_GPSIFD\t\t\t34853\t/* Pointer to GPS private directory */\n/* tags 34908-34914 are private tags registered to SGI */\n#define\tTIFFTAG_FAXRECVPARAMS\t\t34908\t/* encoded Class 2 ses. parms */\n#define\tTIFFTAG_FAXSUBADDRESS\t\t34909\t/* received SubAddr string */\n#define\tTIFFTAG_FAXRECVTIME\t\t34910\t/* receive time (secs) */\n#define\tTIFFTAG_FAXDCS\t\t\t34911\t/* encoded fax ses. params, Table 2/T.30 */\n/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */\n#define TIFFTAG_STONITS\t\t\t37439\t/* Sample value to Nits */\n/* tag 34929 is a private tag registered to FedEx */\n#define\tTIFFTAG_FEDEX_EDR\t\t34929\t/* unknown use */\n#define TIFFTAG_INTEROPERABILITYIFD\t40965\t/* Pointer to Interoperability private directory */\n/* Adobe Digital Negative (DNG) format tags */\n#define TIFFTAG_DNGVERSION\t\t50706\t/* &DNG version number */\n#define TIFFTAG_DNGBACKWARDVERSION\t50707\t/* &DNG compatibility version */\n#define TIFFTAG_UNIQUECAMERAMODEL\t50708\t/* &name for the camera model */\n#define TIFFTAG_LOCALIZEDCAMERAMODEL\t50709\t/* &localized camera model\n\t\t\t\t\t\t   name */\n#define TIFFTAG_CFAPLANECOLOR\t\t50710\t/* &CFAPattern->LinearRaw space\n\t\t\t\t\t\t   mapping */\n#define TIFFTAG_CFALAYOUT\t\t50711\t/* &spatial layout of the CFA */\n#define TIFFTAG_LINEARIZATIONTABLE\t50712\t/* &lookup table description */\n#define TIFFTAG_BLACKLEVELREPEATDIM\t50713\t/* &repeat pattern size for\n\t\t\t\t\t\t   the BlackLevel tag */\n#define TIFFTAG_BLACKLEVEL\t\t50714\t/* &zero light encoding level */\n#define TIFFTAG_BLACKLEVELDELTAH\t50715\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (columns) */\n#define TIFFTAG_BLACKLEVELDELTAV\t50716\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (rows) */\n#define TIFFTAG_WHITELEVEL\t\t50717\t/* &fully saturated encoding\n\t\t\t\t\t\t   level */\n#define TIFFTAG_DEFAULTSCALE\t\t50718\t/* &default scale factors */\n#define TIFFTAG_DEFAULTCROPORIGIN\t50719\t/* &origin of the final image\n\t\t\t\t\t\t   area */\n#define TIFFTAG_DEFAULTCROPSIZE\t\t50720\t/* &size of the final image \n\t\t\t\t\t\t   area */\n#define TIFFTAG_COLORMATRIX1\t\t50721\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 1 */\n#define TIFFTAG_COLORMATRIX2\t\t50722\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 2 */\n#define TIFFTAG_CAMERACALIBRATION1\t50723\t/* &calibration matrix 1 */\n#define TIFFTAG_CAMERACALIBRATION2\t50724\t/* &calibration matrix 2 */\n#define TIFFTAG_REDUCTIONMATRIX1\t50725\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 1 */\n#define TIFFTAG_REDUCTIONMATRIX2\t50726\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 2 */\n#define TIFFTAG_ANALOGBALANCE\t\t50727\t/* &gain applied the stored raw\n\t\t\t\t\t\t   values*/\n#define TIFFTAG_ASSHOTNEUTRAL\t\t50728\t/* &selected white balance in\n\t\t\t\t\t\t   linear reference space */\n#define TIFFTAG_ASSHOTWHITEXY\t\t50729\t/* &selected white balance in\n\t\t\t\t\t\t   x-y chromaticity\n\t\t\t\t\t\t   coordinates */\n#define TIFFTAG_BASELINEEXPOSURE\t50730\t/* &how much to move the zero\n\t\t\t\t\t\t   point */\n#define TIFFTAG_BASELINENOISE\t\t50731\t/* &relative noise level */\n#define TIFFTAG_BASELINESHARPNESS\t50732\t/* &relative amount of\n\t\t\t\t\t\t   sharpening */\n#define TIFFTAG_BAYERGREENSPLIT\t\t50733\t/* &how closely the values of\n\t\t\t\t\t\t   the green pixels in the\n\t\t\t\t\t\t   blue/green rows track the\n\t\t\t\t\t\t   values of the green pixels\n\t\t\t\t\t\t   in the red/green rows */\n#define TIFFTAG_LINEARRESPONSELIMIT\t50734\t/* &non-linear encoding range */\n#define TIFFTAG_CAMERASERIALNUMBER\t50735\t/* &camera's serial number */\n#define TIFFTAG_LENSINFO\t\t50736\t/* info about the lens */\n#define TIFFTAG_CHROMABLURRADIUS\t50737\t/* &chroma blur radius */\n#define TIFFTAG_ANTIALIASSTRENGTH\t50738\t/* &relative strength of the\n\t\t\t\t\t\t   camera's anti-alias filter */\n#define TIFFTAG_SHADOWSCALE\t\t50739\t/* &used by Adobe Camera Raw */\n#define TIFFTAG_DNGPRIVATEDATA\t\t50740\t/* &manufacturer's private data */\n#define TIFFTAG_MAKERNOTESAFETY\t\t50741\t/* &whether the EXIF MakerNote\n\t\t\t\t\t\t   tag is safe to preserve\n\t\t\t\t\t\t   along with the rest of the\n\t\t\t\t\t\t   EXIF data */\n#define\tTIFFTAG_CALIBRATIONILLUMINANT1\t50778\t/* &illuminant 1 */\n#define TIFFTAG_CALIBRATIONILLUMINANT2\t50779\t/* &illuminant 2 */\n#define TIFFTAG_BESTQUALITYSCALE\t50780\t/* &best quality multiplier */\n#define TIFFTAG_RAWDATAUNIQUEID\t\t50781\t/* &unique identifier for\n\t\t\t\t\t\t   the raw image data */\n#define TIFFTAG_ORIGINALRAWFILENAME\t50827\t/* &file name of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ORIGINALRAWFILEDATA\t50828\t/* &contents of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ACTIVEAREA\t\t50829\t/* &active (non-masked) pixels\n\t\t\t\t\t\t   of the sensor */\n#define TIFFTAG_MASKEDAREAS\t\t50830\t/* &list of coordinates\n\t\t\t\t\t\t   of fully masked pixels */\n#define TIFFTAG_ASSHOTICCPROFILE\t50831\t/* &these two tags used to */\n#define TIFFTAG_ASSHOTPREPROFILEMATRIX\t50832\t/* map cameras's color space\n\t\t\t\t\t\t   into ICC profile space */\n#define TIFFTAG_CURRENTICCPROFILE\t50833\t/* & */\n#define TIFFTAG_CURRENTPREPROFILEMATRIX\t50834\t/* & */\n/* tag 65535 is an undefined tag used by Eastman Kodak */\n#define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */\n\n/*\n * The following are ``pseudo tags'' that can be used to control\n * codec-specific functionality.  These tags are not written to file.\n * Note that these values start at 0xffff+1 so that they'll never\n * collide with Aldus-assigned tags.\n *\n * If you want your private pseudo tags ``registered'' (i.e. added to\n * this file), please post a bug report via the tracking system at\n * http://www.remotesensing.org/libtiff/bugs.html with the appropriate\n * C definitions to add.\n */\n#define\tTIFFTAG_FAXMODE\t\t\t65536\t/* Group 3/4 format control */\n#define\t    FAXMODE_CLASSIC\t0x0000\t\t/* default, include RTC */\n#define\t    FAXMODE_NORTC\t0x0001\t\t/* no RTC at end of data */\n#define\t    FAXMODE_NOEOL\t0x0002\t\t/* no EOL code at end of row */\n#define\t    FAXMODE_BYTEALIGN\t0x0004\t\t/* byte align row */\n#define\t    FAXMODE_WORDALIGN\t0x0008\t\t/* word align row */\n#define\t    FAXMODE_CLASSF\tFAXMODE_NORTC\t/* TIFF Class F */\n#define\tTIFFTAG_JPEGQUALITY\t\t65537\t/* Compression quality level */\n/* Note: quality level is on the IJG 0-100 scale.  Default value is 75 */\n#define\tTIFFTAG_JPEGCOLORMODE\t\t65538\t/* Auto RGB<=>YCbCr convert? */\n#define\t    JPEGCOLORMODE_RAW\t0x0000\t\t/* no conversion (default) */\n#define\t    JPEGCOLORMODE_RGB\t0x0001\t\t/* do auto conversion */\n#define\tTIFFTAG_JPEGTABLESMODE\t\t65539\t/* What to put in JPEGTables */\n#define\t    JPEGTABLESMODE_QUANT 0x0001\t\t/* include quantization tbls */\n#define\t    JPEGTABLESMODE_HUFF\t0x0002\t\t/* include Huffman tbls */\n/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */\n#define\tTIFFTAG_FAXFILLFUNC\t\t65540\t/* G3/G4 fill function */\n#define\tTIFFTAG_PIXARLOGDATAFMT\t\t65549\t/* PixarLogCodec I/O data sz */\n#define\t    PIXARLOGDATAFMT_8BIT\t0\t/* regular u_char samples */\n#define\t    PIXARLOGDATAFMT_8BITABGR\t1\t/* ABGR-order u_chars */\n#define\t    PIXARLOGDATAFMT_11BITLOG\t2\t/* 11-bit log-encoded (raw) */\n#define\t    PIXARLOGDATAFMT_12BITPICIO\t3\t/* as per PICIO (1.0==2048) */\n#define\t    PIXARLOGDATAFMT_16BIT\t4\t/* signed short samples */\n#define\t    PIXARLOGDATAFMT_FLOAT\t5\t/* IEEE float samples */\n/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */\n#define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */\n#define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */\n#define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */\n#define     DCSIMAGERFILTER_IR          0       /* infrared filter */\n#define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */\n#define     DCSIMAGERFILTER_CFA         2       /* color filter array */\n#define     DCSIMAGERFILTER_OTHER       3       /* other filter */\n#define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */\n#define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */\n#define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */\n#define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */\n#define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */\n#define TIFFTAG_DCSGAMMA                65554   /* gamma value */\n#define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */\n#define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */\n/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */\n#define\tTIFFTAG_ZIPQUALITY\t\t65557\t/* compression quality level */\n#define\tTIFFTAG_PIXARLOGQUALITY\t\t65558\t/* PixarLog uses same scale */\n/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSCLIPRECTANGLE\t65559\t/* area of image to acquire */\n#define TIFFTAG_SGILOGDATAFMT\t\t65560\t/* SGILog user data format */\n#define     SGILOGDATAFMT_FLOAT\t\t0\t/* IEEE float samples */\n#define     SGILOGDATAFMT_16BIT\t\t1\t/* 16-bit samples */\n#define     SGILOGDATAFMT_RAW\t\t2\t/* uninterpreted data */\n#define     SGILOGDATAFMT_8BIT\t\t3\t/* 8-bit RGB monitor values */\n#define TIFFTAG_SGILOGENCODE\t\t65561 /* SGILog data encoding control*/\n#define     SGILOGENCODE_NODITHER\t0     /* do not dither encoded values*/\n#define     SGILOGENCODE_RANDITHER\t1     /* randomly dither encd values */\n#define\tTIFFTAG_LZMAPRESET\t\t65562\t/* LZMA2 preset (compression level) */\n#define TIFFTAG_PERSAMPLE       65563\t/* interface for per sample tags */\n#define     PERSAMPLE_MERGED        0\t/* present as a single value */\n#define     PERSAMPLE_MULTI         1\t/* present as multiple values */\n\n/*\n * EXIF tags\n */\n#define EXIFTAG_EXPOSURETIME\t\t33434\t/* Exposure time */\n#define EXIFTAG_FNUMBER\t\t\t33437\t/* F number */\n#define EXIFTAG_EXPOSUREPROGRAM\t\t34850\t/* Exposure program */\n#define EXIFTAG_SPECTRALSENSITIVITY\t34852\t/* Spectral sensitivity */\n#define EXIFTAG_ISOSPEEDRATINGS\t\t34855\t/* ISO speed rating */\n#define EXIFTAG_OECF\t\t\t34856\t/* Optoelectric conversion\n\t\t\t\t\t\t   factor */\n#define EXIFTAG_EXIFVERSION\t\t36864\t/* Exif version */\n#define EXIFTAG_DATETIMEORIGINAL\t36867\t/* Date and time of original\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_DATETIMEDIGITIZED\t36868\t/* Date and time of digital\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_COMPONENTSCONFIGURATION\t37121\t/* Meaning of each component */\n#define EXIFTAG_COMPRESSEDBITSPERPIXEL\t37122\t/* Image compression mode */\n#define EXIFTAG_SHUTTERSPEEDVALUE\t37377\t/* Shutter speed */\n#define EXIFTAG_APERTUREVALUE\t\t37378\t/* Aperture */\n#define EXIFTAG_BRIGHTNESSVALUE\t\t37379\t/* Brightness */\n#define EXIFTAG_EXPOSUREBIASVALUE\t37380\t/* Exposure bias */\n#define EXIFTAG_MAXAPERTUREVALUE\t37381\t/* Maximum lens aperture */\n#define EXIFTAG_SUBJECTDISTANCE\t\t37382\t/* Subject distance */\n#define EXIFTAG_METERINGMODE\t\t37383\t/* Metering mode */\n#define EXIFTAG_LIGHTSOURCE\t\t37384\t/* Light source */\n#define EXIFTAG_FLASH\t\t\t37385\t/* Flash */\n#define EXIFTAG_FOCALLENGTH\t\t37386\t/* Lens focal length */\n#define EXIFTAG_SUBJECTAREA\t\t37396\t/* Subject area */\n#define EXIFTAG_MAKERNOTE\t\t37500\t/* Manufacturer notes */\n#define EXIFTAG_USERCOMMENT\t\t37510\t/* User comments */\n#define EXIFTAG_SUBSECTIME\t\t37520\t/* DateTime subseconds */\n#define EXIFTAG_SUBSECTIMEORIGINAL\t37521\t/* DateTimeOriginal subseconds */\n#define EXIFTAG_SUBSECTIMEDIGITIZED\t37522\t/* DateTimeDigitized subseconds */\n#define EXIFTAG_FLASHPIXVERSION\t\t40960\t/* Supported Flashpix version */\n#define EXIFTAG_COLORSPACE\t\t40961\t/* Color space information */\n#define EXIFTAG_PIXELXDIMENSION\t\t40962\t/* Valid image width */\n#define EXIFTAG_PIXELYDIMENSION\t\t40963\t/* Valid image height */\n#define EXIFTAG_RELATEDSOUNDFILE\t40964\t/* Related audio file */\n#define EXIFTAG_FLASHENERGY\t\t41483\t/* Flash energy */\n#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484\t/* Spatial frequency response */\n#define EXIFTAG_FOCALPLANEXRESOLUTION\t41486\t/* Focal plane X resolution */\n#define EXIFTAG_FOCALPLANEYRESOLUTION\t41487\t/* Focal plane Y resolution */\n#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488\t/* Focal plane resolution unit */\n#define EXIFTAG_SUBJECTLOCATION\t\t41492\t/* Subject location */\n#define EXIFTAG_EXPOSUREINDEX\t\t41493\t/* Exposure index */\n#define EXIFTAG_SENSINGMETHOD\t\t41495\t/* Sensing method */\n#define EXIFTAG_FILESOURCE\t\t41728\t/* File source */\n#define EXIFTAG_SCENETYPE\t\t41729\t/* Scene type */\n#define EXIFTAG_CFAPATTERN\t\t41730\t/* CFA pattern */\n#define EXIFTAG_CUSTOMRENDERED\t\t41985\t/* Custom image processing */\n#define EXIFTAG_EXPOSUREMODE\t\t41986\t/* Exposure mode */\n#define EXIFTAG_WHITEBALANCE\t\t41987\t/* White balance */\n#define EXIFTAG_DIGITALZOOMRATIO\t41988\t/* Digital zoom ratio */\n#define EXIFTAG_FOCALLENGTHIN35MMFILM\t41989\t/* Focal length in 35 mm film */\n#define EXIFTAG_SCENECAPTURETYPE\t41990\t/* Scene capture type */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_CONTRAST\t\t41992\t/* Contrast */\n#define EXIFTAG_SATURATION\t\t41993\t/* Saturation */\n#define EXIFTAG_SHARPNESS\t\t41994\t/* Sharpness */\n#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995\t/* Device settings description */\n#define EXIFTAG_SUBJECTDISTANCERANGE\t41996\t/* Subject distance range */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_IMAGEUNIQUEID\t\t42016\t/* Unique image ID */\n\n#endif /* _TIFF_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/linux/tiffconf.h",
    "content": "/* libtiff/tiffconf.h.  Generated from tiffconf.h.in by configure.  */\n/*\n  Configuration defines for installed libtiff.\n  This file maintained for backward compatibility. Do not use definitions\n  from this file in your programs.\n*/\n\n#ifndef _TIFFCONF_\n#define _TIFFCONF_\n\n/* Signed 16-bit type */\n#define TIFF_INT16_T signed short\n\n/* Signed 32-bit type */\n#define TIFF_INT32_T signed int\n\n/* Signed 64-bit type */\n#define TIFF_INT64_T signed long long\n\n/* Signed 8-bit type */\n#define TIFF_INT8_T signed char\n\n/* Unsigned 16-bit type */\n#define TIFF_UINT16_T unsigned short\n\n/* Unsigned 32-bit type */\n#define TIFF_UINT32_T unsigned int\n\n/* Unsigned 64-bit type */\n#define TIFF_UINT64_T unsigned long long\n\n/* Unsigned 8-bit type */\n#define TIFF_UINT8_T unsigned char\n\n/* Signed size type */\n#define TIFF_SSIZE_T signed long\n\n/* Pointer difference type */\n#define TIFF_PTRDIFF_T ptrdiff_t\n\n/* Define to 1 if the system has the type `int16'. */\n/* #undef HAVE_INT16 */\n\n/* Define to 1 if the system has the type `int32'. */\n/* #undef HAVE_INT32 */\n\n/* Define to 1 if the system has the type `int8'. */\n/* #undef HAVE_INT8 */\n\n/* Compatibility stuff. */\n\n/* Define as 0 or 1 according to the floating point format suported by the\n   machine */\n#define HAVE_IEEEFP 1\n\n/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */\n#define HOST_FILLORDER FILLORDER_LSB2MSB\n\n/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian\n   (Intel) */\n#define HOST_BIGENDIAN 0\n\n/* Support CCITT Group 3 & 4 algorithms */\n#define CCITT_SUPPORT 1\n\n/* Support JPEG compression (requires IJG JPEG library) */\n/* #undef JPEG_SUPPORT */\n\n/* Support JBIG compression (requires JBIG-KIT library) */\n/* #undef JBIG_SUPPORT */\n\n/* Support LogLuv high dynamic range encoding */\n#define LOGLUV_SUPPORT 1\n\n/* Support LZW algorithm */\n#define LZW_SUPPORT 1\n\n/* Support NeXT 2-bit RLE algorithm */\n#define NEXT_SUPPORT 1\n\n/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation\n   fails with unpatched IJG JPEG library) */\n/* #undef OJPEG_SUPPORT */\n\n/* Support Macintosh PackBits algorithm */\n#define PACKBITS_SUPPORT 1\n\n/* Support Pixar log-format algorithm (requires Zlib) */\n#define PIXARLOG_SUPPORT 1\n\n/* Support ThunderScan 4-bit RLE algorithm */\n#define THUNDER_SUPPORT 1\n\n/* Support Deflate compression */\n#define ZIP_SUPPORT 1\n\n/* Support strip chopping (whether or not to convert single-strip uncompressed\n   images to mutiple strips of ~8Kb to reduce memory usage) */\n#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP\n\n/* Enable SubIFD tag (330) support */\n#define SUBIFD_SUPPORT 1\n\n/* Treat extra sample as alpha (default enabled). The RGBA interface will\n   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many\n   packages produce RGBA files but don't mark the alpha properly. */\n#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1\n\n/* Pick up YCbCr subsampling info from the JPEG data stream to support files\n   lacking the tag (default enabled). */\n#define CHECK_JPEG_YCBCR_SUBSAMPLING 1\n\n/* Support MS MDI magic number files as TIFF */\n#define MDI_SUPPORT 1\n\n/*\n * Feature support definitions.\n * XXX: These macros are obsoleted. Don't use them in your apps!\n * Macros stays here for backward compatibility and should be always defined.\n */\n#define COLORIMETRY_SUPPORT\n#define YCBCR_SUPPORT\n#define CMYK_SUPPORT\n#define ICC_SUPPORT\n#define PHOTOSHOP_SUPPORT\n#define IPTC_SUPPORT\n\n#endif /* _TIFFCONF_ */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/linux/tiffio.h",
    "content": "/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and\n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF\n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFFIO_\n#define\t_TIFFIO_\n\n/*\n * TIFF I/O Library Definitions.\n */\n#include \"tiff.h\"\n#include \"tiffvers.h\"\n\n/*\n * TIFF is defined as an incomplete type to hide the\n * library's internal data structures from clients.\n */\ntypedef struct tiff TIFF;\n\n/*\n * The following typedefs define the intrinsic size of\n * data types used in the *exported* interfaces.  These\n * definitions depend on the proper definition of types\n * in tiff.h.  Note also that the varargs interface used\n * to pass tag types and values uses the types defined in\n * tiff.h directly.\n *\n * NB: ttag_t is unsigned int and not unsigned short because\n *     ANSI C requires that the type before the ellipsis be a\n *     promoted type (i.e. one of int, unsigned int, pointer,\n *     or double) and because we defined pseudo-tags that are\n *     outside the range of legal Aldus-assigned tags.\n * NB: tsize_t is int32 and not uint32 because some functions\n *     return -1.\n * NB: toff_t is not off_t for many reasons; TIFFs max out at\n *     32-bit file offsets, and BigTIFF maxes out at 64-bit\n *     offsets being the most important, and to ensure use of\n *     a consistently unsigned type across architectures.\n *     Prior to libtiff 4.0, this was an unsigned 32 bit type.\n */\n/*\n * this is the machine addressing size type, only it's signed, so make it\n * int32 on 32bit machines, int64 on 64bit machines\n */\ntypedef TIFF_SSIZE_T tmsize_t;\ntypedef uint64 toff_t;          /* file offset */\n/* the following are deprecated and should be replaced by their defining\n   counterparts */\ntypedef uint32 ttag_t;          /* directory tag */\ntypedef uint16 tdir_t;          /* directory index */\ntypedef uint16 tsample_t;       /* sample number */\ntypedef uint32 tstrile_t;       /* strip or tile number */\ntypedef tstrile_t tstrip_t;     /* strip number */\ntypedef tstrile_t ttile_t;      /* tile number */\ntypedef tmsize_t tsize_t;       /* i/o size in bytes */\ntypedef void* tdata_t;          /* image data ref */\n\n#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))\n#define __WIN32__\n#endif\n\n/*\n * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c\n * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).\n *\n * By default tif_unix.c is assumed.\n */\n\n#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)\n#  if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)\n#    define AVOID_WIN32_FILEIO\n#  endif\n#endif\n\n#if defined(USE_WIN32_FILEIO)\n# define VC_EXTRALEAN\n# include <windows.h>\n# ifdef __WIN32__\nDECLARE_HANDLE(thandle_t);     /* Win32 file handle */\n# else\ntypedef HFILE thandle_t;       /* client data handle */\n# endif /* __WIN32__ */\n#else\ntypedef void* thandle_t;       /* client data handle */\n#endif /* USE_WIN32_FILEIO */\n\n/*\n * Flags to pass to TIFFPrintDirectory to control\n * printing of data structures that are potentially\n * very large.   Bit-or these flags to enable printing\n * multiple items.\n */\n#define TIFFPRINT_NONE\t       0x0    /* no extra info */\n#define TIFFPRINT_STRIPS       0x1    /* strips/tiles info */\n#define TIFFPRINT_CURVES       0x2    /* color/gray response curves */\n#define TIFFPRINT_COLORMAP     0x4    /* colormap */\n#define TIFFPRINT_JPEGQTABLES  0x100  /* JPEG Q matrices */\n#define TIFFPRINT_JPEGACTABLES 0x200  /* JPEG AC tables */\n#define TIFFPRINT_JPEGDCTABLES 0x200  /* JPEG DC tables */\n\n/* \n * Colour conversion stuff\n */\n\n/* reference white */\n#define D65_X0 (95.0470F)\n#define D65_Y0 (100.0F)\n#define D65_Z0 (108.8827F)\n\n#define D50_X0 (96.4250F)\n#define D50_Y0 (100.0F)\n#define D50_Z0 (82.4680F)\n\n/* Structure for holding information about a display device. */\n\ntypedef unsigned char TIFFRGBValue;               /* 8-bit samples */\n\ntypedef struct {\n\tfloat d_mat[3][3];                        /* XYZ -> luminance matrix */\n\tfloat d_YCR;                              /* Light o/p for reference white */\n\tfloat d_YCG;\n\tfloat d_YCB;\n\tuint32 d_Vrwr;                            /* Pixel values for ref. white */\n\tuint32 d_Vrwg;\n\tuint32 d_Vrwb;\n\tfloat d_Y0R;                              /* Residual light for black pixel */\n\tfloat d_Y0G;\n\tfloat d_Y0B;\n\tfloat d_gammaR;                           /* Gamma values for the three guns */\n\tfloat d_gammaG;\n\tfloat d_gammaB;\n} TIFFDisplay;\n\ntypedef struct {                                  /* YCbCr->RGB support */\n\tTIFFRGBValue* clamptab;                   /* range clamping table */\n\tint* Cr_r_tab;\n\tint* Cb_b_tab;\n\tint32* Cr_g_tab;\n\tint32* Cb_g_tab;\n\tint32* Y_tab;\n} TIFFYCbCrToRGB;\n\ntypedef struct {                                  /* CIE Lab 1976->RGB support */\n\tint range;                                /* Size of conversion table */\n#define CIELABTORGB_TABLE_RANGE 1500\n\tfloat rstep, gstep, bstep;\n\tfloat X0, Y0, Z0;                         /* Reference white point */\n\tTIFFDisplay display;\n\tfloat Yr2r[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yr to r */\n\tfloat Yg2g[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yg to g */\n\tfloat Yb2b[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yb to b */\n} TIFFCIELabToRGB;\n\n/*\n * RGBA-style image support.\n */\ntypedef struct _TIFFRGBAImage TIFFRGBAImage;\n/*\n * The image reading and conversion routines invoke\n * ``put routines'' to copy/image/whatever tiles of\n * raw image data.  A default set of routines are \n * provided to convert/copy raw image data to 8-bit\n * packed ABGR format rasters.  Applications can supply\n * alternate routines that unpack the data into a\n * different format or, for example, unpack the data\n * and draw the unpacked raster on the display.\n */\ntypedef void (*tileContigRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*);\ntypedef void (*tileSeparateRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*, unsigned char*, unsigned char*, unsigned char*);\n/*\n * RGBA-reader state.\n */\nstruct _TIFFRGBAImage {\n\tTIFF* tif;                              /* image handle */\n\tint stoponerr;                          /* stop on read error */\n\tint isContig;                           /* data is packed/separate */\n\tint alpha;                              /* type of alpha data present */\n\tuint32 width;                           /* image width */\n\tuint32 height;                          /* image height */\n\tuint16 bitspersample;                   /* image bits/sample */\n\tuint16 samplesperpixel;                 /* image samples/pixel */\n\tuint16 orientation;                     /* image orientation */\n\tuint16 req_orientation;                 /* requested orientation */\n\tuint16 photometric;                     /* image photometric interp */\n\tuint16* redcmap;                        /* colormap pallete */\n\tuint16* greencmap;\n\tuint16* bluecmap;\n\t/* get image data routine */\n\tint (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);\n\t/* put decoded strip/tile */\n\tunion {\n\t    void (*any)(TIFFRGBAImage*);\n\t    tileContigRoutine contig;\n\t    tileSeparateRoutine separate;\n\t} put;\n\tTIFFRGBValue* Map;                      /* sample mapping array */\n\tuint32** BWmap;                         /* black&white map */\n\tuint32** PALmap;                        /* palette image map */\n\tTIFFYCbCrToRGB* ycbcr;                  /* YCbCr conversion state */\n\tTIFFCIELabToRGB* cielab;                /* CIE L*a*b conversion state */\n\n\tuint8* UaToAa;                          /* Unassociated alpha to associated alpha convertion LUT */\n\tuint8* Bitdepth16To8;                   /* LUT for conversion from 16bit to 8bit values */\n\n\tint row_offset;\n\tint col_offset;\n};\n\n/*\n * Macros for extracting components from the\n * packed ABGR form returned by TIFFReadRGBAImage.\n */\n#define TIFFGetR(abgr) ((abgr) & 0xff)\n#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)\n#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)\n#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)\n\n/*\n * A CODEC is a software package that implements decoding,\n * encoding, or decoding+encoding of a compression algorithm.\n * The library provides a collection of builtin codecs.\n * More codecs may be registered through calls to the library\n * and/or the builtin implementations may be overridden.\n */\ntypedef int (*TIFFInitMethod)(TIFF*, int);\ntypedef struct {\n\tchar* name;\n\tuint16 scheme;\n\tTIFFInitMethod init;\n} TIFFCodec;\n\n#include <stdio.h>\n#include <stdarg.h>\n\n/* share internal LogLuv conversion routines? */\n#ifndef LOGLUV_PUBLIC\n#define LOGLUV_PUBLIC 1\n#endif\n\n#if !defined(__GNUC__) && !defined(__attribute__)\n#  define __attribute__(x) /*nothing*/\n#endif\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern \"C\" {\n#endif\ntypedef void (*TIFFErrorHandler)(const char*, const char*, va_list);\ntypedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);\ntypedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t);\ntypedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);\ntypedef int (*TIFFCloseProc)(thandle_t);\ntypedef toff_t (*TIFFSizeProc)(thandle_t);\ntypedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size);\ntypedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size);\ntypedef void (*TIFFExtendProc)(TIFF*);\n\nextern const char* TIFFGetVersion(void);\n\nextern const TIFFCodec* TIFFFindCODEC(uint16);\nextern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);\nextern void TIFFUnRegisterCODEC(TIFFCodec*);\nextern int TIFFIsCODECConfigured(uint16);\nextern TIFFCodec* TIFFGetConfiguredCODECs(void);\n\n/*\n * Auxiliary functions.\n */\n\nextern void* _TIFFmalloc(tmsize_t s);\nextern void* _TIFFrealloc(void* p, tmsize_t s);\nextern void _TIFFmemset(void* p, int v, tmsize_t c);\nextern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);\nextern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);\nextern void _TIFFfree(void* p);\n\n/*\n** Stuff, related to tag handling and creating custom tags.\n*/\nextern int TIFFGetTagListCount( TIFF * );\nextern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );\n    \n#define TIFF_ANY       TIFF_NOTYPE     /* for field descriptor searching */\n#define TIFF_VARIABLE  -1              /* marker for variable length tags */\n#define TIFF_SPP       -2              /* marker for SamplesPerPixel tags */\n#define TIFF_VARIABLE2 -3              /* marker for uint32 var-length tags */\n\n#define FIELD_CUSTOM    65\n\ntypedef struct _TIFFField TIFFField;\ntypedef struct _TIFFFieldArray TIFFFieldArray;\n\nextern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);\nextern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);\nextern const TIFFField* TIFFFieldWithName(TIFF*, const char *);\n\nextern uint32 TIFFFieldTag(const TIFFField*);\nextern const char* TIFFFieldName(const TIFFField*);\nextern TIFFDataType TIFFFieldDataType(const TIFFField*);\nextern int TIFFFieldPassCount(const TIFFField*);\nextern int TIFFFieldReadCount(const TIFFField*);\nextern int TIFFFieldWriteCount(const TIFFField*);\n\ntypedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);\ntypedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);\ntypedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);\n\ntypedef struct {\n    TIFFVSetMethod vsetfield; /* tag set routine */\n    TIFFVGetMethod vgetfield; /* tag get routine */\n    TIFFPrintMethod printdir; /* directory print routine */\n} TIFFTagMethods;\n\nextern  TIFFTagMethods *TIFFAccessTagMethods(TIFF *);\nextern  void *TIFFGetClientInfo(TIFF *, const char *);\nextern  void TIFFSetClientInfo(TIFF *, void *, const char *);\n\nextern void TIFFCleanup(TIFF* tif);\nextern void TIFFClose(TIFF* tif);\nextern int TIFFFlush(TIFF* tif);\nextern int TIFFFlushData(TIFF* tif);\nextern int TIFFGetField(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFReadDirectory(TIFF* tif);\nextern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);\nextern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);\nextern uint64 TIFFScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFScanlineSize(TIFF* tif);\nextern uint64 TIFFRasterScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFRasterScanlineSize(TIFF* tif);\nextern uint64 TIFFStripSize64(TIFF* tif);\nextern tmsize_t TIFFStripSize(TIFF* tif);\nextern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);\nextern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);\nextern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);\nextern uint64 TIFFTileRowSize64(TIFF* tif);\nextern tmsize_t TIFFTileRowSize(TIFF* tif);\nextern uint64 TIFFTileSize64(TIFF* tif);\nextern tmsize_t TIFFTileSize(TIFF* tif);\nextern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);\nextern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);\nextern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);\nextern int TIFFFileno(TIFF*);\nextern int TIFFSetFileno(TIFF*, int);\nextern thandle_t TIFFClientdata(TIFF*);\nextern thandle_t TIFFSetClientdata(TIFF*, thandle_t);\nextern int TIFFGetMode(TIFF*);\nextern int TIFFSetMode(TIFF*, int);\nextern int TIFFIsTiled(TIFF*);\nextern int TIFFIsByteSwapped(TIFF*);\nextern int TIFFIsUpSampled(TIFF*);\nextern int TIFFIsMSB2LSB(TIFF*);\nextern int TIFFIsBigEndian(TIFF*);\nextern TIFFReadWriteProc TIFFGetReadProc(TIFF*);\nextern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);\nextern TIFFSeekProc TIFFGetSeekProc(TIFF*);                                                          \nextern TIFFCloseProc TIFFGetCloseProc(TIFF*);\nextern TIFFSizeProc TIFFGetSizeProc(TIFF*);\nextern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);\nextern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);\nextern uint32 TIFFCurrentRow(TIFF*);\nextern uint16 TIFFCurrentDirectory(TIFF*);\nextern uint16 TIFFNumberOfDirectories(TIFF*);\nextern uint64 TIFFCurrentDirOffset(TIFF*);\nextern uint32 TIFFCurrentStrip(TIFF*);\nextern uint32 TIFFCurrentTile(TIFF* tif);\nextern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);\nextern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);  \nextern int TIFFSetupStrips(TIFF *);\nextern int TIFFWriteCheck(TIFF*, int, const char *);\nextern void TIFFFreeDirectory(TIFF*);\nextern int TIFFCreateDirectory(TIFF*);\nextern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*);\nextern int TIFFCreateEXIFDirectory(TIFF*);\nextern int TIFFLastDirectory(TIFF*);\nextern int TIFFSetDirectory(TIFF*, uint16);\nextern int TIFFSetSubDirectory(TIFF*, uint64);\nextern int TIFFUnlinkDirectory(TIFF*, uint16);\nextern int TIFFSetField(TIFF*, uint32, ...);\nextern int TIFFVSetField(TIFF*, uint32, va_list);\nextern int TIFFUnsetField(TIFF*, uint32);\nextern int TIFFWriteDirectory(TIFF *);\nextern int TIFFWriteCustomDirectory(TIFF *, uint64 *);\nextern int TIFFCheckpointDirectory(TIFF *);\nextern int TIFFRewriteDirectory(TIFF *);\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,\n    int = ORIENTATION_BOTLEFT, int = 0);\n#else\nextern void TIFFPrintDirectory(TIFF*, FILE*, long);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);\n#endif\n\nextern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );\nextern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );\nextern int TIFFRGBAImageOK(TIFF*, char [1024]);\nextern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);\nextern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);\nextern void TIFFRGBAImageEnd(TIFFRGBAImage*);\nextern TIFF* TIFFOpen(const char*, const char*);\n# ifdef __WIN32__\nextern TIFF* TIFFOpenW(const wchar_t*, const char*);\n# endif /* __WIN32__ */\nextern TIFF* TIFFFdOpen(int, const char*, const char*);\nextern TIFF* TIFFClientOpen(const char*, const char*,\n\t    thandle_t,\n\t    TIFFReadWriteProc, TIFFReadWriteProc,\n\t    TIFFSeekProc, TIFFCloseProc,\n\t    TIFFSizeProc,\n\t    TIFFMapFileProc, TIFFUnmapFileProc);\nextern const char* TIFFFileName(TIFF*);\nextern const char* TIFFSetFileName(TIFF*, const char *);\nextern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);\nextern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);\nextern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);\nextern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFNumberOfTiles(TIFF*);\nextern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);  \nextern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);\nextern uint32 TIFFNumberOfStrips(TIFF*);\nextern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);\nextern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);\nextern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern int TIFFDataWidth(TIFFDataType);    /* table of tag datatype widths */\nextern void TIFFSetWriteOffset(TIFF* tif, toff_t off);\nextern void TIFFSwabShort(uint16*);\nextern void TIFFSwabLong(uint32*);\nextern void TIFFSwabLong8(uint64*);\nextern void TIFFSwabFloat(float*);\nextern void TIFFSwabDouble(double*);\nextern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);\nextern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);\nextern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);\nextern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);\nextern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);\nextern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);\nextern void TIFFReverseBits(uint8* cp, tmsize_t n);\nextern const unsigned char* TIFFGetBitRevTable(int);\n\n#ifdef LOGLUV_PUBLIC\n#define U_NEU\t\t0.210526316\n#define V_NEU\t\t0.473684211\n#define UVSCALE\t\t410.\nextern double LogL16toY(int);\nextern double LogL10toY(int);\nextern void XYZtoRGB24(float*, uint8*);\nextern int uv_decode(double*, double*, int);\nextern void LogLuv24toXYZ(uint32, float*);\nextern void LogLuv32toXYZ(uint32, float*);\n#if defined(c_plusplus) || defined(__cplusplus)\nextern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);\nextern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);\nextern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);\n#else\nextern int LogL16fromY(double, int);\nextern int LogL10fromY(double, int);\nextern int uv_encode(double, double, int);\nextern uint32 LogLuv24fromXYZ(float*, int);\nextern uint32 LogLuv32fromXYZ(float*, int);\n#endif\n#endif /* LOGLUV_PUBLIC */\n\nextern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);\nextern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,\n    float *, float *, float *);\nextern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,\n    uint32 *, uint32 *, uint32 *);\n\nextern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);\nextern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,\n    uint32 *, uint32 *, uint32 *);\n\n/****************************************************************************\n *               O B S O L E T E D    I N T E R F A C E S\n *\n * Don't use this stuff in your applications, it may be removed in the future\n * libtiff versions.\n ****************************************************************************/\ntypedef\tstruct {\n\tttag_t\tfield_tag;\t\t/* field's tag */\n\tshort\tfield_readcount;\t/* read count/TIFF_VARIABLE/TIFF_SPP */\n\tshort\tfield_writecount;\t/* write count/TIFF_VARIABLE */\n\tTIFFDataType field_type;\t/* type of associated data */\n        unsigned short field_bit;\t/* bit in fieldsset bit vector */\n\tunsigned char field_oktochange;\t/* if true, can change while writing */\n\tunsigned char field_passcount;\t/* if true, pass dir count on set */\n\tchar\t*field_name;\t\t/* ASCII name */\n} TIFFFieldInfo;\n\nextern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);\n        \n#if defined(c_plusplus) || defined(__cplusplus)\n}\n#endif\n\n#endif /* _TIFFIO_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/linux/tiffvers.h",
    "content": "#define TIFFLIB_VERSION_STR \"LIBTIFF, Version 4.0.3\\nCopyright (c) 1988-1996 Sam Leffler\\nCopyright (c) 1991-1996 Silicon Graphics, Inc.\"\n/*\n * This define can be used in code that requires\n * compilation-related definitions specific to a\n * version or versions of the library.  Runtime\n * version checking should be done based on the\n * string returned by TIFFGetVersion.\n */\n#define TIFFLIB_VERSION 20120922\n"
  },
  {
    "path": "cocos2d/external/tiff/include/mac/tiff.h",
    "content": "/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and \n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n * \n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  \n * \n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF \n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE \n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFF_\n#define\t_TIFF_\n\n#include \"tiffconf.h\"\n\n/*\n * Tag Image File Format (TIFF)\n *\n * Based on Rev 6.0 from:\n *    Developer's Desk\n *    Aldus Corporation\n *    411 First Ave. South\n *    Suite 200\n *    Seattle, WA  98104\n *    206-622-5500\n *\n *    (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)\n *\n * For BigTIFF design notes see the following links\n *    http://www.remotesensing.org/libtiff/bigtiffdesign.html\n *    http://www.awaresystems.be/imaging/tiff/bigtiff.html\n */\n\n#define TIFF_VERSION_CLASSIC 42\n#define TIFF_VERSION_BIG 43\n\n#define TIFF_BIGENDIAN      0x4d4d\n#define TIFF_LITTLEENDIAN   0x4949\n#define MDI_LITTLEENDIAN    0x5045\n#define MDI_BIGENDIAN       0x4550\n\n/*\n * Intrinsic data types required by the file format:\n *\n * 8-bit quantities     int8/uint8\n * 16-bit quantities    int16/uint16\n * 32-bit quantities    int32/uint32\n * 64-bit quantities    int64/uint64\n * strings              unsigned char*\n */\n\ntypedef TIFF_INT8_T   int8;\ntypedef TIFF_UINT8_T  uint8;\n\ntypedef TIFF_INT16_T  int16;\ntypedef TIFF_UINT16_T uint16;\n\ntypedef TIFF_INT32_T  int32;\ntypedef TIFF_UINT32_T uint32;\n\ntypedef TIFF_INT64_T  int64;\ntypedef TIFF_UINT64_T uint64;\n\n/*\n * Some types as promoted in a variable argument list\n * We use uint16_vap rather then directly using int, because this way\n * we document the type we actually want to pass through, conceptually,\n * rather then confusing the issue by merely stating the type it gets\n * promoted to\n */\n\ntypedef int uint16_vap;\n\n/*\n * TIFF header.\n */\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n} TIFFHeaderCommon;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint32 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderClassic;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint16 tiff_offsetsize; /* size of offsets, should be 8 */\n\tuint16 tiff_unused;     /* unused word, should be 0 */\n\tuint64 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderBig;\n\n\n/*\n * NB: In the comments below,\n *  - items marked with a + are obsoleted by revision 5.0,\n *  - items marked with a ! are introduced in revision 6.0.\n *  - items marked with a % are introduced post revision 6.0.\n *  - items marked with a $ are obsoleted by revision 6.0.\n *  - items marked with a & are introduced by Adobe DNG specification.\n */\n\n/*\n * Tag data type information.\n *\n * Note: RATIONALs are the ratio of two 32-bit integer values.\n */\ntypedef enum {\n\tTIFF_NOTYPE = 0,      /* placeholder */\n\tTIFF_BYTE = 1,        /* 8-bit unsigned integer */\n\tTIFF_ASCII = 2,       /* 8-bit bytes w/ last byte null */\n\tTIFF_SHORT = 3,       /* 16-bit unsigned integer */\n\tTIFF_LONG = 4,        /* 32-bit unsigned integer */\n\tTIFF_RATIONAL = 5,    /* 64-bit unsigned fraction */\n\tTIFF_SBYTE = 6,       /* !8-bit signed integer */\n\tTIFF_UNDEFINED = 7,   /* !8-bit untyped data */\n\tTIFF_SSHORT = 8,      /* !16-bit signed integer */\n\tTIFF_SLONG = 9,       /* !32-bit signed integer */\n\tTIFF_SRATIONAL = 10,  /* !64-bit signed fraction */\n\tTIFF_FLOAT = 11,      /* !32-bit IEEE floating point */\n\tTIFF_DOUBLE = 12,     /* !64-bit IEEE floating point */\n\tTIFF_IFD = 13,        /* %32-bit unsigned integer (offset) */\n\tTIFF_LONG8 = 16,      /* BigTIFF 64-bit unsigned integer */\n\tTIFF_SLONG8 = 17,     /* BigTIFF 64-bit signed integer */\n\tTIFF_IFD8 = 18        /* BigTIFF 64-bit unsigned integer (offset) */\n} TIFFDataType;\n\n/*\n * TIFF Tag Definitions.\n */\n#define\tTIFFTAG_SUBFILETYPE\t\t254\t/* subfile data descriptor */\n#define\t    FILETYPE_REDUCEDIMAGE\t0x1\t/* reduced resolution version */\n#define\t    FILETYPE_PAGE\t\t0x2\t/* one page of many */\n#define\t    FILETYPE_MASK\t\t0x4\t/* transparency mask */\n#define\tTIFFTAG_OSUBFILETYPE\t\t255\t/* +kind of data in subfile */\n#define\t    OFILETYPE_IMAGE\t\t1\t/* full resolution image data */\n#define\t    OFILETYPE_REDUCEDIMAGE\t2\t/* reduced size image data */\n#define\t    OFILETYPE_PAGE\t\t3\t/* one page of many */\n#define\tTIFFTAG_IMAGEWIDTH\t\t256\t/* image width in pixels */\n#define\tTIFFTAG_IMAGELENGTH\t\t257\t/* image height in pixels */\n#define\tTIFFTAG_BITSPERSAMPLE\t\t258\t/* bits per channel (sample) */\n#define\tTIFFTAG_COMPRESSION\t\t259\t/* data compression technique */\n#define\t    COMPRESSION_NONE\t\t1\t/* dump mode */\n#define\t    COMPRESSION_CCITTRLE\t2\t/* CCITT modified Huffman RLE */\n#define\t    COMPRESSION_CCITTFAX3\t3\t/* CCITT Group 3 fax encoding */\n#define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */\n#define\t    COMPRESSION_CCITTFAX4\t4\t/* CCITT Group 4 fax encoding */\n#define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */\n#define\t    COMPRESSION_LZW\t\t5       /* Lempel-Ziv  & Welch */\n#define\t    COMPRESSION_OJPEG\t\t6\t/* !6.0 JPEG */\n#define\t    COMPRESSION_JPEG\t\t7\t/* %JPEG DCT compression */\n#define     COMPRESSION_T85\t\t\t9\t/* !TIFF/FX T.85 JBIG compression */\n#define     COMPRESSION_T43\t\t\t10\t/* !TIFF/FX T.43 colour by layered JBIG compression */\n#define\t    COMPRESSION_NEXT\t\t32766\t/* NeXT 2-bit RLE */\n#define\t    COMPRESSION_CCITTRLEW\t32771\t/* #1 w/ word alignment */\n#define\t    COMPRESSION_PACKBITS\t32773\t/* Macintosh RLE */\n#define\t    COMPRESSION_THUNDERSCAN\t32809\t/* ThunderScan RLE */\n/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define\t    COMPRESSION_IT8CTPAD\t32895   /* IT8 CT w/padding */\n#define\t    COMPRESSION_IT8LW\t\t32896   /* IT8 Linework RLE */\n#define\t    COMPRESSION_IT8MP\t\t32897   /* IT8 Monochrome picture */\n#define\t    COMPRESSION_IT8BL\t\t32898   /* IT8 Binary line art */\n/* compression codes 32908-32911 are reserved for Pixar */\n#define     COMPRESSION_PIXARFILM\t32908   /* Pixar companded 10bit LZW */\n#define\t    COMPRESSION_PIXARLOG\t32909   /* Pixar companded 11bit ZIP */\n#define\t    COMPRESSION_DEFLATE\t\t32946\t/* Deflate compression */\n#define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,\n\t\t\t\t\t\t   as recognized by Adobe */\n/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */\n#define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */\n#define\t    COMPRESSION_JBIG\t\t34661\t/* ISO JBIG */\n#define     COMPRESSION_SGILOG\t\t34676\t/* SGI Log Luminance RLE */\n#define     COMPRESSION_SGILOG24\t34677\t/* SGI Log 24-bit packed */\n#define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */\n#define\t    COMPRESSION_LZMA\t\t34925\t/* LZMA2 */\n#define\tTIFFTAG_PHOTOMETRIC\t\t262\t/* photometric interpretation */\n#define\t    PHOTOMETRIC_MINISWHITE\t0\t/* min value is white */\n#define\t    PHOTOMETRIC_MINISBLACK\t1\t/* min value is black */\n#define\t    PHOTOMETRIC_RGB\t\t2\t/* RGB color model */\n#define\t    PHOTOMETRIC_PALETTE\t\t3\t/* color map indexed */\n#define\t    PHOTOMETRIC_MASK\t\t4\t/* $holdout mask */\n#define\t    PHOTOMETRIC_SEPARATED\t5\t/* !color separations */\n#define\t    PHOTOMETRIC_YCBCR\t\t6\t/* !CCIR 601 */\n#define\t    PHOTOMETRIC_CIELAB\t\t8\t/* !1976 CIE L*a*b* */\n#define\t    PHOTOMETRIC_ICCLAB\t\t9\t/* ICC L*a*b* [Adobe TIFF Technote 4] */\n#define\t    PHOTOMETRIC_ITULAB\t\t10\t/* ITU L*a*b* */\n#define     PHOTOMETRIC_LOGL\t\t32844\t/* CIE Log2(L) */\n#define     PHOTOMETRIC_LOGLUV\t\t32845\t/* CIE Log2(L) (u',v') */\n#define\tTIFFTAG_THRESHHOLDING\t\t263\t/* +thresholding used on data */\n#define\t    THRESHHOLD_BILEVEL\t\t1\t/* b&w art scan */\n#define\t    THRESHHOLD_HALFTONE\t\t2\t/* or dithered scan */\n#define\t    THRESHHOLD_ERRORDIFFUSE\t3\t/* usually floyd-steinberg */\n#define\tTIFFTAG_CELLWIDTH\t\t264\t/* +dithering matrix width */\n#define\tTIFFTAG_CELLLENGTH\t\t265\t/* +dithering matrix height */\n#define\tTIFFTAG_FILLORDER\t\t266\t/* data order within a byte */\n#define\t    FILLORDER_MSB2LSB\t\t1\t/* most significant -> least */\n#define\t    FILLORDER_LSB2MSB\t\t2\t/* least significant -> most */\n#define\tTIFFTAG_DOCUMENTNAME\t\t269\t/* name of doc. image is from */\n#define\tTIFFTAG_IMAGEDESCRIPTION\t270\t/* info about image */\n#define\tTIFFTAG_MAKE\t\t\t271\t/* scanner manufacturer name */\n#define\tTIFFTAG_MODEL\t\t\t272\t/* scanner model name/number */\n#define\tTIFFTAG_STRIPOFFSETS\t\t273\t/* offsets to data strips */\n#define\tTIFFTAG_ORIENTATION\t\t274\t/* +image orientation */\n#define\t    ORIENTATION_TOPLEFT\t\t1\t/* row 0 top, col 0 lhs */\n#define\t    ORIENTATION_TOPRIGHT\t2\t/* row 0 top, col 0 rhs */\n#define\t    ORIENTATION_BOTRIGHT\t3\t/* row 0 bottom, col 0 rhs */\n#define\t    ORIENTATION_BOTLEFT\t\t4\t/* row 0 bottom, col 0 lhs */\n#define\t    ORIENTATION_LEFTTOP\t\t5\t/* row 0 lhs, col 0 top */\n#define\t    ORIENTATION_RIGHTTOP\t6\t/* row 0 rhs, col 0 top */\n#define\t    ORIENTATION_RIGHTBOT\t7\t/* row 0 rhs, col 0 bottom */\n#define\t    ORIENTATION_LEFTBOT\t\t8\t/* row 0 lhs, col 0 bottom */\n#define\tTIFFTAG_SAMPLESPERPIXEL\t\t277\t/* samples per pixel */\n#define\tTIFFTAG_ROWSPERSTRIP\t\t278\t/* rows per strip of data */\n#define\tTIFFTAG_STRIPBYTECOUNTS\t\t279\t/* bytes counts for strips */\n#define\tTIFFTAG_MINSAMPLEVALUE\t\t280\t/* +minimum sample value */\n#define\tTIFFTAG_MAXSAMPLEVALUE\t\t281\t/* +maximum sample value */\n#define\tTIFFTAG_XRESOLUTION\t\t282\t/* pixels/resolution in x */\n#define\tTIFFTAG_YRESOLUTION\t\t283\t/* pixels/resolution in y */\n#define\tTIFFTAG_PLANARCONFIG\t\t284\t/* storage organization */\n#define\t    PLANARCONFIG_CONTIG\t\t1\t/* single image plane */\n#define\t    PLANARCONFIG_SEPARATE\t2\t/* separate planes of data */\n#define\tTIFFTAG_PAGENAME\t\t285\t/* page name image is from */\n#define\tTIFFTAG_XPOSITION\t\t286\t/* x page offset of image lhs */\n#define\tTIFFTAG_YPOSITION\t\t287\t/* y page offset of image lhs */\n#define\tTIFFTAG_FREEOFFSETS\t\t288\t/* +byte offset to free block */\n#define\tTIFFTAG_FREEBYTECOUNTS\t\t289\t/* +sizes of free blocks */\n#define\tTIFFTAG_GRAYRESPONSEUNIT\t290\t/* $gray scale curve accuracy */\n#define\t    GRAYRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    GRAYRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    GRAYRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_GRAYRESPONSECURVE\t291\t/* $gray scale response curve */\n#define\tTIFFTAG_GROUP3OPTIONS\t\t292\t/* 32 flag bits */\n#define\tTIFFTAG_T4OPTIONS\t\t292\t/* TIFF 6.0 proper name alias */\n#define\t    GROUP3OPT_2DENCODING\t0x1\t/* 2-dimensional coding */\n#define\t    GROUP3OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\t    GROUP3OPT_FILLBITS\t\t0x4\t/* fill to byte boundary */\n#define\tTIFFTAG_GROUP4OPTIONS\t\t293\t/* 32 flag bits */\n#define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */\n#define\t    GROUP4OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\tTIFFTAG_RESOLUTIONUNIT\t\t296\t/* units of resolutions */\n#define\t    RESUNIT_NONE\t\t1\t/* no meaningful units */\n#define\t    RESUNIT_INCH\t\t2\t/* english */\n#define\t    RESUNIT_CENTIMETER\t\t3\t/* metric */\n#define\tTIFFTAG_PAGENUMBER\t\t297\t/* page numbers of multi-page */\n#define\tTIFFTAG_COLORRESPONSEUNIT\t300\t/* $color curve accuracy */\n#define\t    COLORRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    COLORRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    COLORRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_TRANSFERFUNCTION\t301\t/* !colorimetry info */\n#define\tTIFFTAG_SOFTWARE\t\t305\t/* name & release */\n#define\tTIFFTAG_DATETIME\t\t306\t/* creation date and time */\n#define\tTIFFTAG_ARTIST\t\t\t315\t/* creator of image */\n#define\tTIFFTAG_HOSTCOMPUTER\t\t316\t/* machine where created */\n#define\tTIFFTAG_PREDICTOR\t\t317\t/* prediction scheme w/ LZW */\n#define     PREDICTOR_NONE\t\t1\t/* no prediction scheme used */\n#define     PREDICTOR_HORIZONTAL\t2\t/* horizontal differencing */\n#define     PREDICTOR_FLOATINGPOINT\t3\t/* floating point predictor */\n#define\tTIFFTAG_WHITEPOINT\t\t318\t/* image white point */\n#define\tTIFFTAG_PRIMARYCHROMATICITIES\t319\t/* !primary chromaticities */\n#define\tTIFFTAG_COLORMAP\t\t320\t/* RGB map for pallette image */\n#define\tTIFFTAG_HALFTONEHINTS\t\t321\t/* !highlight+shadow info */\n#define\tTIFFTAG_TILEWIDTH\t\t322\t/* !tile width in pixels */\n#define\tTIFFTAG_TILELENGTH\t\t323\t/* !tile height in pixels */\n#define TIFFTAG_TILEOFFSETS\t\t324\t/* !offsets to data tiles */\n#define TIFFTAG_TILEBYTECOUNTS\t\t325\t/* !byte counts for tiles */\n#define\tTIFFTAG_BADFAXLINES\t\t326\t/* lines w/ wrong pixel count */\n#define\tTIFFTAG_CLEANFAXDATA\t\t327\t/* regenerated line info */\n#define\t    CLEANFAXDATA_CLEAN\t\t0\t/* no errors detected */\n#define\t    CLEANFAXDATA_REGENERATED\t1\t/* receiver regenerated lines */\n#define\t    CLEANFAXDATA_UNCLEAN\t2\t/* uncorrected errors exist */\n#define\tTIFFTAG_CONSECUTIVEBADFAXLINES\t328\t/* max consecutive bad lines */\n#define\tTIFFTAG_SUBIFD\t\t\t330\t/* subimage descriptors */\n#define\tTIFFTAG_INKSET\t\t\t332\t/* !inks in separated image */\n#define\t    INKSET_CMYK\t\t\t1\t/* !cyan-magenta-yellow-black color */\n#define\t    INKSET_MULTIINK\t\t2\t/* !multi-ink or hi-fi color */\n#define\tTIFFTAG_INKNAMES\t\t333\t/* !ascii names of inks */\n#define\tTIFFTAG_NUMBEROFINKS\t\t334\t/* !number of inks */\n#define\tTIFFTAG_DOTRANGE\t\t336\t/* !0% and 100% dot codes */\n#define\tTIFFTAG_TARGETPRINTER\t\t337\t/* !separation target */\n#define\tTIFFTAG_EXTRASAMPLES\t\t338\t/* !info about extra samples */\n#define\t    EXTRASAMPLE_UNSPECIFIED\t0\t/* !unspecified data */\n#define\t    EXTRASAMPLE_ASSOCALPHA\t1\t/* !associated alpha data */\n#define\t    EXTRASAMPLE_UNASSALPHA\t2\t/* !unassociated alpha data */\n#define\tTIFFTAG_SAMPLEFORMAT\t\t339\t/* !data sample format */\n#define\t    SAMPLEFORMAT_UINT\t\t1\t/* !unsigned integer data */\n#define\t    SAMPLEFORMAT_INT\t\t2\t/* !signed integer data */\n#define\t    SAMPLEFORMAT_IEEEFP\t\t3\t/* !IEEE floating point data */\n#define\t    SAMPLEFORMAT_VOID\t\t4\t/* !untyped data */\n#define\t    SAMPLEFORMAT_COMPLEXINT\t5\t/* !complex signed int */\n#define\t    SAMPLEFORMAT_COMPLEXIEEEFP\t6\t/* !complex ieee floating */\n#define\tTIFFTAG_SMINSAMPLEVALUE\t\t340\t/* !variable MinSampleValue */\n#define\tTIFFTAG_SMAXSAMPLEVALUE\t\t341\t/* !variable MaxSampleValue */\n#define\tTIFFTAG_CLIPPATH\t\t343\t/* %ClipPath\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_XCLIPPATHUNITS\t\t344\t/* %XClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_YCLIPPATHUNITS\t\t345\t/* %YClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_INDEXED\t\t\t346\t/* %Indexed\n\t\t\t\t\t\t   [Adobe TIFF Technote 3] */\n#define\tTIFFTAG_JPEGTABLES\t\t347\t/* %JPEG table stream */\n#define\tTIFFTAG_OPIPROXY\t\t351\t/* %OPI Proxy [Adobe TIFF technote] */\n/* Tags 400-435 are from the TIFF/FX spec */\n#define TIFFTAG_GLOBALPARAMETERSIFD\t400\t/* ! */\n#define TIFFTAG_PROFILETYPE\t\t\t401\t/* ! */\n#define     PROFILETYPE_UNSPECIFIED\t0\t/* ! */\n#define     PROFILETYPE_G3_FAX\t\t1\t/* ! */\n#define TIFFTAG_FAXPROFILE\t\t\t402\t/* ! */\n#define     FAXPROFILE_S\t\t\t1\t/* !TIFF/FX FAX profile S */\n#define     FAXPROFILE_F\t\t\t2\t/* !TIFF/FX FAX profile F */\n#define     FAXPROFILE_J\t\t\t3\t/* !TIFF/FX FAX profile J */\n#define     FAXPROFILE_C\t\t\t4\t/* !TIFF/FX FAX profile C */\n#define     FAXPROFILE_L\t\t\t5\t/* !TIFF/FX FAX profile L */\n#define     FAXPROFILE_M\t\t\t6\t/* !TIFF/FX FAX profile LM */\n#define TIFFTAG_CODINGMETHODS\t\t403\t/* !TIFF/FX coding methods */\n#define     CODINGMETHODS_T4_1D\t\t(1 << 1)\t/* !T.4 1D */\n#define     CODINGMETHODS_T4_2D\t\t(1 << 2)\t/* !T.4 2D */\n#define     CODINGMETHODS_T6\t\t(1 << 3)\t/* !T.6 */\n#define     CODINGMETHODS_T85 \t\t(1 << 4)\t/* !T.85 JBIG */\n#define     CODINGMETHODS_T42 \t\t(1 << 5)\t/* !T.42 JPEG */\n#define     CODINGMETHODS_T43\t\t(1 << 6)\t/* !T.43 colour by layered JBIG */\n#define TIFFTAG_VERSIONYEAR\t\t\t404\t/* !TIFF/FX version year */\n#define TIFFTAG_MODENUMBER\t\t\t405\t/* !TIFF/FX mode number */\n#define TIFFTAG_DECODE\t\t\t\t433\t/* !TIFF/FX decode */\n#define TIFFTAG_IMAGEBASECOLOR\t\t434\t/* !TIFF/FX image base colour */\n#define TIFFTAG_T82OPTIONS\t\t\t435\t/* !TIFF/FX T.82 options */\n/*\n * Tags 512-521 are obsoleted by Technical Note #2 which specifies a\n * revised JPEG-in-TIFF scheme.\n */\n#define\tTIFFTAG_JPEGPROC\t\t512\t/* !JPEG processing algorithm */\n#define\t    JPEGPROC_BASELINE\t\t1\t/* !baseline sequential */\n#define\t    JPEGPROC_LOSSLESS\t\t14\t/* !Huffman coded lossless */\n#define\tTIFFTAG_JPEGIFOFFSET\t\t513\t/* !pointer to SOI marker */\n#define\tTIFFTAG_JPEGIFBYTECOUNT\t\t514\t/* !JFIF stream length */\n#define\tTIFFTAG_JPEGRESTARTINTERVAL\t515\t/* !restart interval length */\n#define\tTIFFTAG_JPEGLOSSLESSPREDICTORS\t517\t/* !lossless proc predictor */\n#define\tTIFFTAG_JPEGPOINTTRANSFORM\t518\t/* !lossless point transform */\n#define\tTIFFTAG_JPEGQTABLES\t\t519\t/* !Q matrice offsets */\n#define\tTIFFTAG_JPEGDCTABLES\t\t520\t/* !DCT table offsets */\n#define\tTIFFTAG_JPEGACTABLES\t\t521\t/* !AC coefficient offsets */\n#define\tTIFFTAG_YCBCRCOEFFICIENTS\t529\t/* !RGB -> YCbCr transform */\n#define\tTIFFTAG_YCBCRSUBSAMPLING\t530\t/* !YCbCr subsampling factors */\n#define\tTIFFTAG_YCBCRPOSITIONING\t531\t/* !subsample positioning */\n#define\t    YCBCRPOSITION_CENTERED\t1\t/* !as in PostScript Level 2 */\n#define\t    YCBCRPOSITION_COSITED\t2\t/* !as in CCIR 601-1 */\n#define\tTIFFTAG_REFERENCEBLACKWHITE\t532\t/* !colorimetry info */\n#define TIFFTAG_STRIPROWCOUNTS\t\t559 /* !TIFF/FX strip row counts */\n#define\tTIFFTAG_XMLPACKET\t\t700\t/* %XML packet\n\t\t\t\t\t\t   [Adobe XMP Specification,\n\t\t\t\t\t\t   January 2004 */\n#define TIFFTAG_OPIIMAGEID\t\t32781\t/* %OPI ImageID\n\t\t\t\t\t\t   [Adobe TIFF technote] */\n/* tags 32952-32956 are private tags registered to Island Graphics */\n#define TIFFTAG_REFPTS\t\t\t32953\t/* image reference points */\n#define TIFFTAG_REGIONTACKPOINT\t\t32954\t/* region-xform tack point */\n#define TIFFTAG_REGIONWARPCORNERS\t32955\t/* warp quadrilateral */\n#define TIFFTAG_REGIONAFFINE\t\t32956\t/* affine transformation mat */\n/* tags 32995-32999 are private tags registered to SGI */\n#define\tTIFFTAG_MATTEING\t\t32995\t/* $use ExtraSamples */\n#define\tTIFFTAG_DATATYPE\t\t32996\t/* $use SampleFormat */\n#define\tTIFFTAG_IMAGEDEPTH\t\t32997\t/* z depth of image */\n#define\tTIFFTAG_TILEDEPTH\t\t32998\t/* z depth/data tile */\n/* tags 33300-33309 are private tags registered to Pixar */\n/*\n * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH\n * are set when an image has been cropped out of a larger image.  \n * They reflect the size of the original uncropped image.\n * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used\n * to determine the position of the smaller image in the larger one.\n */\n#define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */\n#define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */\n /* Tags 33302-33306 are used to identify special image modes and data\n  * used by Pixar's texture formats.\n  */\n#define TIFFTAG_PIXAR_TEXTUREFORMAT\t33302\t/* texture map format */\n#define TIFFTAG_PIXAR_WRAPMODES\t\t33303\t/* s & t wrap modes */\n#define TIFFTAG_PIXAR_FOVCOT\t\t33304\t/* cotan(fov) for env. maps */\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306\n/* tag 33405 is a private tag registered to Eastman Kodak */\n#define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */\n/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */\n#define\tTIFFTAG_COPYRIGHT\t\t33432\t/* copyright string */\n/* IPTC TAG from RichTIFF specifications */\n#define TIFFTAG_RICHTIFFIPTC\t\t33723\n/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define TIFFTAG_IT8SITE\t\t\t34016\t/* site name */\n#define TIFFTAG_IT8COLORSEQUENCE\t34017\t/* color seq. [RGB,CMYK,etc] */\n#define TIFFTAG_IT8HEADER\t\t34018\t/* DDES Header */\n#define TIFFTAG_IT8RASTERPADDING\t34019\t/* raster scanline padding */\n#define TIFFTAG_IT8BITSPERRUNLENGTH\t34020\t/* # of bits in short run */\n#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */\n#define TIFFTAG_IT8COLORTABLE\t\t34022\t/* LW colortable */\n#define TIFFTAG_IT8IMAGECOLORINDICATOR\t34023\t/* BP/BL image color switch */\n#define TIFFTAG_IT8BKGCOLORINDICATOR\t34024\t/* BP/BL bg color switch */\n#define TIFFTAG_IT8IMAGECOLORVALUE\t34025\t/* BP/BL image color value */\n#define TIFFTAG_IT8BKGCOLORVALUE\t34026\t/* BP/BL bg color value */\n#define TIFFTAG_IT8PIXELINTENSITYRANGE\t34027\t/* MP pixel intensity value */\n#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028\t/* HC transparency switch */\n#define TIFFTAG_IT8COLORCHARACTERIZATION 34029\t/* color character. table */\n#define TIFFTAG_IT8HCUSAGE\t\t34030\t/* HC usage indicator */\n#define TIFFTAG_IT8TRAPINDICATOR\t34031\t/* Trapping indicator\n\t\t\t\t\t\t   (untrapped=0, trapped=1) */\n#define TIFFTAG_IT8CMYKEQUIVALENT\t34032\t/* CMYK color equivalents */\n/* tags 34232-34236 are private tags registered to Texas Instruments */\n#define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */\n/* tag 34377 is private tag registered to Adobe for PhotoShop */\n#define TIFFTAG_PHOTOSHOP\t\t34377 \n/* tags 34665, 34853 and 40965 are documented in EXIF specification */\n#define TIFFTAG_EXIFIFD\t\t\t34665\t/* Pointer to EXIF private directory */\n/* tag 34750 is a private tag registered to Adobe? */\n#define TIFFTAG_ICCPROFILE\t\t34675\t/* ICC profile data */\n#define TIFFTAG_IMAGELAYER\t\t34732\t/* !TIFF/FX image layer information */\n/* tag 34750 is a private tag registered to Pixel Magic */\n#define\tTIFFTAG_JBIGOPTIONS\t\t34750\t/* JBIG options */\n#define TIFFTAG_GPSIFD\t\t\t34853\t/* Pointer to GPS private directory */\n/* tags 34908-34914 are private tags registered to SGI */\n#define\tTIFFTAG_FAXRECVPARAMS\t\t34908\t/* encoded Class 2 ses. parms */\n#define\tTIFFTAG_FAXSUBADDRESS\t\t34909\t/* received SubAddr string */\n#define\tTIFFTAG_FAXRECVTIME\t\t34910\t/* receive time (secs) */\n#define\tTIFFTAG_FAXDCS\t\t\t34911\t/* encoded fax ses. params, Table 2/T.30 */\n/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */\n#define TIFFTAG_STONITS\t\t\t37439\t/* Sample value to Nits */\n/* tag 34929 is a private tag registered to FedEx */\n#define\tTIFFTAG_FEDEX_EDR\t\t34929\t/* unknown use */\n#define TIFFTAG_INTEROPERABILITYIFD\t40965\t/* Pointer to Interoperability private directory */\n/* Adobe Digital Negative (DNG) format tags */\n#define TIFFTAG_DNGVERSION\t\t50706\t/* &DNG version number */\n#define TIFFTAG_DNGBACKWARDVERSION\t50707\t/* &DNG compatibility version */\n#define TIFFTAG_UNIQUECAMERAMODEL\t50708\t/* &name for the camera model */\n#define TIFFTAG_LOCALIZEDCAMERAMODEL\t50709\t/* &localized camera model\n\t\t\t\t\t\t   name */\n#define TIFFTAG_CFAPLANECOLOR\t\t50710\t/* &CFAPattern->LinearRaw space\n\t\t\t\t\t\t   mapping */\n#define TIFFTAG_CFALAYOUT\t\t50711\t/* &spatial layout of the CFA */\n#define TIFFTAG_LINEARIZATIONTABLE\t50712\t/* &lookup table description */\n#define TIFFTAG_BLACKLEVELREPEATDIM\t50713\t/* &repeat pattern size for\n\t\t\t\t\t\t   the BlackLevel tag */\n#define TIFFTAG_BLACKLEVEL\t\t50714\t/* &zero light encoding level */\n#define TIFFTAG_BLACKLEVELDELTAH\t50715\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (columns) */\n#define TIFFTAG_BLACKLEVELDELTAV\t50716\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (rows) */\n#define TIFFTAG_WHITELEVEL\t\t50717\t/* &fully saturated encoding\n\t\t\t\t\t\t   level */\n#define TIFFTAG_DEFAULTSCALE\t\t50718\t/* &default scale factors */\n#define TIFFTAG_DEFAULTCROPORIGIN\t50719\t/* &origin of the final image\n\t\t\t\t\t\t   area */\n#define TIFFTAG_DEFAULTCROPSIZE\t\t50720\t/* &size of the final image \n\t\t\t\t\t\t   area */\n#define TIFFTAG_COLORMATRIX1\t\t50721\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 1 */\n#define TIFFTAG_COLORMATRIX2\t\t50722\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 2 */\n#define TIFFTAG_CAMERACALIBRATION1\t50723\t/* &calibration matrix 1 */\n#define TIFFTAG_CAMERACALIBRATION2\t50724\t/* &calibration matrix 2 */\n#define TIFFTAG_REDUCTIONMATRIX1\t50725\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 1 */\n#define TIFFTAG_REDUCTIONMATRIX2\t50726\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 2 */\n#define TIFFTAG_ANALOGBALANCE\t\t50727\t/* &gain applied the stored raw\n\t\t\t\t\t\t   values*/\n#define TIFFTAG_ASSHOTNEUTRAL\t\t50728\t/* &selected white balance in\n\t\t\t\t\t\t   linear reference space */\n#define TIFFTAG_ASSHOTWHITEXY\t\t50729\t/* &selected white balance in\n\t\t\t\t\t\t   x-y chromaticity\n\t\t\t\t\t\t   coordinates */\n#define TIFFTAG_BASELINEEXPOSURE\t50730\t/* &how much to move the zero\n\t\t\t\t\t\t   point */\n#define TIFFTAG_BASELINENOISE\t\t50731\t/* &relative noise level */\n#define TIFFTAG_BASELINESHARPNESS\t50732\t/* &relative amount of\n\t\t\t\t\t\t   sharpening */\n#define TIFFTAG_BAYERGREENSPLIT\t\t50733\t/* &how closely the values of\n\t\t\t\t\t\t   the green pixels in the\n\t\t\t\t\t\t   blue/green rows track the\n\t\t\t\t\t\t   values of the green pixels\n\t\t\t\t\t\t   in the red/green rows */\n#define TIFFTAG_LINEARRESPONSELIMIT\t50734\t/* &non-linear encoding range */\n#define TIFFTAG_CAMERASERIALNUMBER\t50735\t/* &camera's serial number */\n#define TIFFTAG_LENSINFO\t\t50736\t/* info about the lens */\n#define TIFFTAG_CHROMABLURRADIUS\t50737\t/* &chroma blur radius */\n#define TIFFTAG_ANTIALIASSTRENGTH\t50738\t/* &relative strength of the\n\t\t\t\t\t\t   camera's anti-alias filter */\n#define TIFFTAG_SHADOWSCALE\t\t50739\t/* &used by Adobe Camera Raw */\n#define TIFFTAG_DNGPRIVATEDATA\t\t50740\t/* &manufacturer's private data */\n#define TIFFTAG_MAKERNOTESAFETY\t\t50741\t/* &whether the EXIF MakerNote\n\t\t\t\t\t\t   tag is safe to preserve\n\t\t\t\t\t\t   along with the rest of the\n\t\t\t\t\t\t   EXIF data */\n#define\tTIFFTAG_CALIBRATIONILLUMINANT1\t50778\t/* &illuminant 1 */\n#define TIFFTAG_CALIBRATIONILLUMINANT2\t50779\t/* &illuminant 2 */\n#define TIFFTAG_BESTQUALITYSCALE\t50780\t/* &best quality multiplier */\n#define TIFFTAG_RAWDATAUNIQUEID\t\t50781\t/* &unique identifier for\n\t\t\t\t\t\t   the raw image data */\n#define TIFFTAG_ORIGINALRAWFILENAME\t50827\t/* &file name of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ORIGINALRAWFILEDATA\t50828\t/* &contents of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ACTIVEAREA\t\t50829\t/* &active (non-masked) pixels\n\t\t\t\t\t\t   of the sensor */\n#define TIFFTAG_MASKEDAREAS\t\t50830\t/* &list of coordinates\n\t\t\t\t\t\t   of fully masked pixels */\n#define TIFFTAG_ASSHOTICCPROFILE\t50831\t/* &these two tags used to */\n#define TIFFTAG_ASSHOTPREPROFILEMATRIX\t50832\t/* map cameras's color space\n\t\t\t\t\t\t   into ICC profile space */\n#define TIFFTAG_CURRENTICCPROFILE\t50833\t/* & */\n#define TIFFTAG_CURRENTPREPROFILEMATRIX\t50834\t/* & */\n/* tag 65535 is an undefined tag used by Eastman Kodak */\n#define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */\n\n/*\n * The following are ``pseudo tags'' that can be used to control\n * codec-specific functionality.  These tags are not written to file.\n * Note that these values start at 0xffff+1 so that they'll never\n * collide with Aldus-assigned tags.\n *\n * If you want your private pseudo tags ``registered'' (i.e. added to\n * this file), please post a bug report via the tracking system at\n * http://www.remotesensing.org/libtiff/bugs.html with the appropriate\n * C definitions to add.\n */\n#define\tTIFFTAG_FAXMODE\t\t\t65536\t/* Group 3/4 format control */\n#define\t    FAXMODE_CLASSIC\t0x0000\t\t/* default, include RTC */\n#define\t    FAXMODE_NORTC\t0x0001\t\t/* no RTC at end of data */\n#define\t    FAXMODE_NOEOL\t0x0002\t\t/* no EOL code at end of row */\n#define\t    FAXMODE_BYTEALIGN\t0x0004\t\t/* byte align row */\n#define\t    FAXMODE_WORDALIGN\t0x0008\t\t/* word align row */\n#define\t    FAXMODE_CLASSF\tFAXMODE_NORTC\t/* TIFF Class F */\n#define\tTIFFTAG_JPEGQUALITY\t\t65537\t/* Compression quality level */\n/* Note: quality level is on the IJG 0-100 scale.  Default value is 75 */\n#define\tTIFFTAG_JPEGCOLORMODE\t\t65538\t/* Auto RGB<=>YCbCr convert? */\n#define\t    JPEGCOLORMODE_RAW\t0x0000\t\t/* no conversion (default) */\n#define\t    JPEGCOLORMODE_RGB\t0x0001\t\t/* do auto conversion */\n#define\tTIFFTAG_JPEGTABLESMODE\t\t65539\t/* What to put in JPEGTables */\n#define\t    JPEGTABLESMODE_QUANT 0x0001\t\t/* include quantization tbls */\n#define\t    JPEGTABLESMODE_HUFF\t0x0002\t\t/* include Huffman tbls */\n/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */\n#define\tTIFFTAG_FAXFILLFUNC\t\t65540\t/* G3/G4 fill function */\n#define\tTIFFTAG_PIXARLOGDATAFMT\t\t65549\t/* PixarLogCodec I/O data sz */\n#define\t    PIXARLOGDATAFMT_8BIT\t0\t/* regular u_char samples */\n#define\t    PIXARLOGDATAFMT_8BITABGR\t1\t/* ABGR-order u_chars */\n#define\t    PIXARLOGDATAFMT_11BITLOG\t2\t/* 11-bit log-encoded (raw) */\n#define\t    PIXARLOGDATAFMT_12BITPICIO\t3\t/* as per PICIO (1.0==2048) */\n#define\t    PIXARLOGDATAFMT_16BIT\t4\t/* signed short samples */\n#define\t    PIXARLOGDATAFMT_FLOAT\t5\t/* IEEE float samples */\n/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */\n#define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */\n#define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */\n#define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */\n#define     DCSIMAGERFILTER_IR          0       /* infrared filter */\n#define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */\n#define     DCSIMAGERFILTER_CFA         2       /* color filter array */\n#define     DCSIMAGERFILTER_OTHER       3       /* other filter */\n#define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */\n#define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */\n#define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */\n#define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */\n#define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */\n#define TIFFTAG_DCSGAMMA                65554   /* gamma value */\n#define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */\n#define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */\n/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */\n#define\tTIFFTAG_ZIPQUALITY\t\t65557\t/* compression quality level */\n#define\tTIFFTAG_PIXARLOGQUALITY\t\t65558\t/* PixarLog uses same scale */\n/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSCLIPRECTANGLE\t65559\t/* area of image to acquire */\n#define TIFFTAG_SGILOGDATAFMT\t\t65560\t/* SGILog user data format */\n#define     SGILOGDATAFMT_FLOAT\t\t0\t/* IEEE float samples */\n#define     SGILOGDATAFMT_16BIT\t\t1\t/* 16-bit samples */\n#define     SGILOGDATAFMT_RAW\t\t2\t/* uninterpreted data */\n#define     SGILOGDATAFMT_8BIT\t\t3\t/* 8-bit RGB monitor values */\n#define TIFFTAG_SGILOGENCODE\t\t65561 /* SGILog data encoding control*/\n#define     SGILOGENCODE_NODITHER\t0     /* do not dither encoded values*/\n#define     SGILOGENCODE_RANDITHER\t1     /* randomly dither encd values */\n#define\tTIFFTAG_LZMAPRESET\t\t65562\t/* LZMA2 preset (compression level) */\n#define TIFFTAG_PERSAMPLE       65563\t/* interface for per sample tags */\n#define     PERSAMPLE_MERGED        0\t/* present as a single value */\n#define     PERSAMPLE_MULTI         1\t/* present as multiple values */\n\n/*\n * EXIF tags\n */\n#define EXIFTAG_EXPOSURETIME\t\t33434\t/* Exposure time */\n#define EXIFTAG_FNUMBER\t\t\t33437\t/* F number */\n#define EXIFTAG_EXPOSUREPROGRAM\t\t34850\t/* Exposure program */\n#define EXIFTAG_SPECTRALSENSITIVITY\t34852\t/* Spectral sensitivity */\n#define EXIFTAG_ISOSPEEDRATINGS\t\t34855\t/* ISO speed rating */\n#define EXIFTAG_OECF\t\t\t34856\t/* Optoelectric conversion\n\t\t\t\t\t\t   factor */\n#define EXIFTAG_EXIFVERSION\t\t36864\t/* Exif version */\n#define EXIFTAG_DATETIMEORIGINAL\t36867\t/* Date and time of original\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_DATETIMEDIGITIZED\t36868\t/* Date and time of digital\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_COMPONENTSCONFIGURATION\t37121\t/* Meaning of each component */\n#define EXIFTAG_COMPRESSEDBITSPERPIXEL\t37122\t/* Image compression mode */\n#define EXIFTAG_SHUTTERSPEEDVALUE\t37377\t/* Shutter speed */\n#define EXIFTAG_APERTUREVALUE\t\t37378\t/* Aperture */\n#define EXIFTAG_BRIGHTNESSVALUE\t\t37379\t/* Brightness */\n#define EXIFTAG_EXPOSUREBIASVALUE\t37380\t/* Exposure bias */\n#define EXIFTAG_MAXAPERTUREVALUE\t37381\t/* Maximum lens aperture */\n#define EXIFTAG_SUBJECTDISTANCE\t\t37382\t/* Subject distance */\n#define EXIFTAG_METERINGMODE\t\t37383\t/* Metering mode */\n#define EXIFTAG_LIGHTSOURCE\t\t37384\t/* Light source */\n#define EXIFTAG_FLASH\t\t\t37385\t/* Flash */\n#define EXIFTAG_FOCALLENGTH\t\t37386\t/* Lens focal length */\n#define EXIFTAG_SUBJECTAREA\t\t37396\t/* Subject area */\n#define EXIFTAG_MAKERNOTE\t\t37500\t/* Manufacturer notes */\n#define EXIFTAG_USERCOMMENT\t\t37510\t/* User comments */\n#define EXIFTAG_SUBSECTIME\t\t37520\t/* DateTime subseconds */\n#define EXIFTAG_SUBSECTIMEORIGINAL\t37521\t/* DateTimeOriginal subseconds */\n#define EXIFTAG_SUBSECTIMEDIGITIZED\t37522\t/* DateTimeDigitized subseconds */\n#define EXIFTAG_FLASHPIXVERSION\t\t40960\t/* Supported Flashpix version */\n#define EXIFTAG_COLORSPACE\t\t40961\t/* Color space information */\n#define EXIFTAG_PIXELXDIMENSION\t\t40962\t/* Valid image width */\n#define EXIFTAG_PIXELYDIMENSION\t\t40963\t/* Valid image height */\n#define EXIFTAG_RELATEDSOUNDFILE\t40964\t/* Related audio file */\n#define EXIFTAG_FLASHENERGY\t\t41483\t/* Flash energy */\n#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484\t/* Spatial frequency response */\n#define EXIFTAG_FOCALPLANEXRESOLUTION\t41486\t/* Focal plane X resolution */\n#define EXIFTAG_FOCALPLANEYRESOLUTION\t41487\t/* Focal plane Y resolution */\n#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488\t/* Focal plane resolution unit */\n#define EXIFTAG_SUBJECTLOCATION\t\t41492\t/* Subject location */\n#define EXIFTAG_EXPOSUREINDEX\t\t41493\t/* Exposure index */\n#define EXIFTAG_SENSINGMETHOD\t\t41495\t/* Sensing method */\n#define EXIFTAG_FILESOURCE\t\t41728\t/* File source */\n#define EXIFTAG_SCENETYPE\t\t41729\t/* Scene type */\n#define EXIFTAG_CFAPATTERN\t\t41730\t/* CFA pattern */\n#define EXIFTAG_CUSTOMRENDERED\t\t41985\t/* Custom image processing */\n#define EXIFTAG_EXPOSUREMODE\t\t41986\t/* Exposure mode */\n#define EXIFTAG_WHITEBALANCE\t\t41987\t/* White balance */\n#define EXIFTAG_DIGITALZOOMRATIO\t41988\t/* Digital zoom ratio */\n#define EXIFTAG_FOCALLENGTHIN35MMFILM\t41989\t/* Focal length in 35 mm film */\n#define EXIFTAG_SCENECAPTURETYPE\t41990\t/* Scene capture type */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_CONTRAST\t\t41992\t/* Contrast */\n#define EXIFTAG_SATURATION\t\t41993\t/* Saturation */\n#define EXIFTAG_SHARPNESS\t\t41994\t/* Sharpness */\n#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995\t/* Device settings description */\n#define EXIFTAG_SUBJECTDISTANCERANGE\t41996\t/* Subject distance range */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_IMAGEUNIQUEID\t\t42016\t/* Unique image ID */\n\n#endif /* _TIFF_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/mac/tiffconf.h",
    "content": "/* libtiff/tiffconf.h.  Generated from tiffconf.h.in by configure.  */\n/*\n  Configuration defines for installed libtiff.\n  This file maintained for backward compatibility. Do not use definitions\n  from this file in your programs.\n*/\n\n#ifndef _TIFFCONF_\n#define _TIFFCONF_\n\n/* Signed 16-bit type */\n#define TIFF_INT16_T signed short\n\n/* Signed 32-bit type */\n#define TIFF_INT32_T signed int\n\n/* Signed 64-bit type */\n#define TIFF_INT64_T signed long long\n\n/* Signed 8-bit type */\n#define TIFF_INT8_T signed char\n\n/* Unsigned 16-bit type */\n#define TIFF_UINT16_T unsigned short\n\n/* Unsigned 32-bit type */\n#define TIFF_UINT32_T unsigned int\n\n/* Unsigned 64-bit type */\n#define TIFF_UINT64_T unsigned long long\n\n/* Unsigned 8-bit type */\n#define TIFF_UINT8_T unsigned char\n\n/* Signed size type */\n#define TIFF_SSIZE_T signed long long\n\n/* Pointer difference type */\n#define TIFF_PTRDIFF_T ptrdiff_t\n\n/* Define to 1 if the system has the type `int16'. */\n/* #undef HAVE_INT16 */\n\n/* Define to 1 if the system has the type `int32'. */\n/* #undef HAVE_INT32 */\n\n/* Define to 1 if the system has the type `int8'. */\n/* #undef HAVE_INT8 */\n\n/* Compatibility stuff. */\n\n/* Define as 0 or 1 according to the floating point format suported by the\n   machine */\n#define HAVE_IEEEFP 1\n\n/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */\n#define HOST_FILLORDER FILLORDER_LSB2MSB\n\n/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian\n   (Intel) */\n#define HOST_BIGENDIAN 0\n\n/* Support CCITT Group 3 & 4 algorithms */\n#define CCITT_SUPPORT 1\n\n/* Support JPEG compression (requires IJG JPEG library) */\n#define JPEG_SUPPORT 1\n\n/* Support JBIG compression (requires JBIG-KIT library) */\n/* #undef JBIG_SUPPORT */\n\n/* Support LogLuv high dynamic range encoding */\n#define LOGLUV_SUPPORT 1\n\n/* Support LZW algorithm */\n#define LZW_SUPPORT 1\n\n/* Support NeXT 2-bit RLE algorithm */\n#define NEXT_SUPPORT 1\n\n/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation\n   fails with unpatched IJG JPEG library) */\n#define OJPEG_SUPPORT 1\n\n/* Support Macintosh PackBits algorithm */\n#define PACKBITS_SUPPORT 1\n\n/* Support Pixar log-format algorithm (requires Zlib) */\n#define PIXARLOG_SUPPORT 1\n\n/* Support ThunderScan 4-bit RLE algorithm */\n#define THUNDER_SUPPORT 1\n\n/* Support Deflate compression */\n#define ZIP_SUPPORT 1\n\n/* Support strip chopping (whether or not to convert single-strip uncompressed\n   images to mutiple strips of ~8Kb to reduce memory usage) */\n#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP\n\n/* Enable SubIFD tag (330) support */\n#define SUBIFD_SUPPORT 1\n\n/* Treat extra sample as alpha (default enabled). The RGBA interface will\n   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many\n   packages produce RGBA files but don't mark the alpha properly. */\n#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1\n\n/* Pick up YCbCr subsampling info from the JPEG data stream to support files\n   lacking the tag (default enabled). */\n#define CHECK_JPEG_YCBCR_SUBSAMPLING 1\n\n/* Support MS MDI magic number files as TIFF */\n#define MDI_SUPPORT 1\n\n/*\n * Feature support definitions.\n * XXX: These macros are obsoleted. Don't use them in your apps!\n * Macros stays here for backward compatibility and should be always defined.\n */\n#define COLORIMETRY_SUPPORT\n#define YCBCR_SUPPORT\n#define CMYK_SUPPORT\n#define ICC_SUPPORT\n#define PHOTOSHOP_SUPPORT\n#define IPTC_SUPPORT\n\n#endif /* _TIFFCONF_ */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/mac/tiffio.h",
    "content": "/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and\n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF\n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFFIO_\n#define\t_TIFFIO_\n\n/*\n * TIFF I/O Library Definitions.\n */\n#include \"tiff.h\"\n#include \"tiffvers.h\"\n\n/*\n * TIFF is defined as an incomplete type to hide the\n * library's internal data structures from clients.\n */\ntypedef struct tiff TIFF;\n\n/*\n * The following typedefs define the intrinsic size of\n * data types used in the *exported* interfaces.  These\n * definitions depend on the proper definition of types\n * in tiff.h.  Note also that the varargs interface used\n * to pass tag types and values uses the types defined in\n * tiff.h directly.\n *\n * NB: ttag_t is unsigned int and not unsigned short because\n *     ANSI C requires that the type before the ellipsis be a\n *     promoted type (i.e. one of int, unsigned int, pointer,\n *     or double) and because we defined pseudo-tags that are\n *     outside the range of legal Aldus-assigned tags.\n * NB: tsize_t is int32 and not uint32 because some functions\n *     return -1.\n * NB: toff_t is not off_t for many reasons; TIFFs max out at\n *     32-bit file offsets, and BigTIFF maxes out at 64-bit\n *     offsets being the most important, and to ensure use of\n *     a consistently unsigned type across architectures.\n *     Prior to libtiff 4.0, this was an unsigned 32 bit type.\n */\n/*\n * this is the machine addressing size type, only it's signed, so make it\n * int32 on 32bit machines, int64 on 64bit machines\n */\ntypedef TIFF_SSIZE_T tmsize_t;\ntypedef uint64 toff_t;          /* file offset */\n/* the following are deprecated and should be replaced by their defining\n   counterparts */\ntypedef uint32 ttag_t;          /* directory tag */\ntypedef uint16 tdir_t;          /* directory index */\ntypedef uint16 tsample_t;       /* sample number */\ntypedef uint32 tstrile_t;       /* strip or tile number */\ntypedef tstrile_t tstrip_t;     /* strip number */\ntypedef tstrile_t ttile_t;      /* tile number */\ntypedef tmsize_t tsize_t;       /* i/o size in bytes */\ntypedef void* tdata_t;          /* image data ref */\n\n#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))\n#define __WIN32__\n#endif\n\n/*\n * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c\n * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).\n *\n * By default tif_unix.c is assumed.\n */\n\n#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)\n#  if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)\n#    define AVOID_WIN32_FILEIO\n#  endif\n#endif\n\n#if defined(USE_WIN32_FILEIO)\n# define VC_EXTRALEAN\n# include <windows.h>\n# ifdef __WIN32__\nDECLARE_HANDLE(thandle_t);     /* Win32 file handle */\n# else\ntypedef HFILE thandle_t;       /* client data handle */\n# endif /* __WIN32__ */\n#else\ntypedef void* thandle_t;       /* client data handle */\n#endif /* USE_WIN32_FILEIO */\n\n/*\n * Flags to pass to TIFFPrintDirectory to control\n * printing of data structures that are potentially\n * very large.   Bit-or these flags to enable printing\n * multiple items.\n */\n#define TIFFPRINT_NONE\t       0x0    /* no extra info */\n#define TIFFPRINT_STRIPS       0x1    /* strips/tiles info */\n#define TIFFPRINT_CURVES       0x2    /* color/gray response curves */\n#define TIFFPRINT_COLORMAP     0x4    /* colormap */\n#define TIFFPRINT_JPEGQTABLES  0x100  /* JPEG Q matrices */\n#define TIFFPRINT_JPEGACTABLES 0x200  /* JPEG AC tables */\n#define TIFFPRINT_JPEGDCTABLES 0x200  /* JPEG DC tables */\n\n/* \n * Colour conversion stuff\n */\n\n/* reference white */\n#define D65_X0 (95.0470F)\n#define D65_Y0 (100.0F)\n#define D65_Z0 (108.8827F)\n\n#define D50_X0 (96.4250F)\n#define D50_Y0 (100.0F)\n#define D50_Z0 (82.4680F)\n\n/* Structure for holding information about a display device. */\n\ntypedef unsigned char TIFFRGBValue;               /* 8-bit samples */\n\ntypedef struct {\n\tfloat d_mat[3][3];                        /* XYZ -> luminance matrix */\n\tfloat d_YCR;                              /* Light o/p for reference white */\n\tfloat d_YCG;\n\tfloat d_YCB;\n\tuint32 d_Vrwr;                            /* Pixel values for ref. white */\n\tuint32 d_Vrwg;\n\tuint32 d_Vrwb;\n\tfloat d_Y0R;                              /* Residual light for black pixel */\n\tfloat d_Y0G;\n\tfloat d_Y0B;\n\tfloat d_gammaR;                           /* Gamma values for the three guns */\n\tfloat d_gammaG;\n\tfloat d_gammaB;\n} TIFFDisplay;\n\ntypedef struct {                                  /* YCbCr->RGB support */\n\tTIFFRGBValue* clamptab;                   /* range clamping table */\n\tint* Cr_r_tab;\n\tint* Cb_b_tab;\n\tint32* Cr_g_tab;\n\tint32* Cb_g_tab;\n\tint32* Y_tab;\n} TIFFYCbCrToRGB;\n\ntypedef struct {                                  /* CIE Lab 1976->RGB support */\n\tint range;                                /* Size of conversion table */\n#define CIELABTORGB_TABLE_RANGE 1500\n\tfloat rstep, gstep, bstep;\n\tfloat X0, Y0, Z0;                         /* Reference white point */\n\tTIFFDisplay display;\n\tfloat Yr2r[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yr to r */\n\tfloat Yg2g[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yg to g */\n\tfloat Yb2b[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yb to b */\n} TIFFCIELabToRGB;\n\n/*\n * RGBA-style image support.\n */\ntypedef struct _TIFFRGBAImage TIFFRGBAImage;\n/*\n * The image reading and conversion routines invoke\n * ``put routines'' to copy/image/whatever tiles of\n * raw image data.  A default set of routines are \n * provided to convert/copy raw image data to 8-bit\n * packed ABGR format rasters.  Applications can supply\n * alternate routines that unpack the data into a\n * different format or, for example, unpack the data\n * and draw the unpacked raster on the display.\n */\ntypedef void (*tileContigRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*);\ntypedef void (*tileSeparateRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*, unsigned char*, unsigned char*, unsigned char*);\n/*\n * RGBA-reader state.\n */\nstruct _TIFFRGBAImage {\n\tTIFF* tif;                              /* image handle */\n\tint stoponerr;                          /* stop on read error */\n\tint isContig;                           /* data is packed/separate */\n\tint alpha;                              /* type of alpha data present */\n\tuint32 width;                           /* image width */\n\tuint32 height;                          /* image height */\n\tuint16 bitspersample;                   /* image bits/sample */\n\tuint16 samplesperpixel;                 /* image samples/pixel */\n\tuint16 orientation;                     /* image orientation */\n\tuint16 req_orientation;                 /* requested orientation */\n\tuint16 photometric;                     /* image photometric interp */\n\tuint16* redcmap;                        /* colormap pallete */\n\tuint16* greencmap;\n\tuint16* bluecmap;\n\t/* get image data routine */\n\tint (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);\n\t/* put decoded strip/tile */\n\tunion {\n\t    void (*any)(TIFFRGBAImage*);\n\t    tileContigRoutine contig;\n\t    tileSeparateRoutine separate;\n\t} put;\n\tTIFFRGBValue* Map;                      /* sample mapping array */\n\tuint32** BWmap;                         /* black&white map */\n\tuint32** PALmap;                        /* palette image map */\n\tTIFFYCbCrToRGB* ycbcr;                  /* YCbCr conversion state */\n\tTIFFCIELabToRGB* cielab;                /* CIE L*a*b conversion state */\n\n\tuint8* UaToAa;                          /* Unassociated alpha to associated alpha convertion LUT */\n\tuint8* Bitdepth16To8;                   /* LUT for conversion from 16bit to 8bit values */\n\n\tint row_offset;\n\tint col_offset;\n};\n\n/*\n * Macros for extracting components from the\n * packed ABGR form returned by TIFFReadRGBAImage.\n */\n#define TIFFGetR(abgr) ((abgr) & 0xff)\n#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)\n#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)\n#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)\n\n/*\n * A CODEC is a software package that implements decoding,\n * encoding, or decoding+encoding of a compression algorithm.\n * The library provides a collection of builtin codecs.\n * More codecs may be registered through calls to the library\n * and/or the builtin implementations may be overridden.\n */\ntypedef int (*TIFFInitMethod)(TIFF*, int);\ntypedef struct {\n\tchar* name;\n\tuint16 scheme;\n\tTIFFInitMethod init;\n} TIFFCodec;\n\n#include <stdio.h>\n#include <stdarg.h>\n\n/* share internal LogLuv conversion routines? */\n#ifndef LOGLUV_PUBLIC\n#define LOGLUV_PUBLIC 1\n#endif\n\n#if !defined(__GNUC__) && !defined(__attribute__)\n#  define __attribute__(x) /*nothing*/\n#endif\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern \"C\" {\n#endif\ntypedef void (*TIFFErrorHandler)(const char*, const char*, va_list);\ntypedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);\ntypedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t);\ntypedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);\ntypedef int (*TIFFCloseProc)(thandle_t);\ntypedef toff_t (*TIFFSizeProc)(thandle_t);\ntypedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size);\ntypedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size);\ntypedef void (*TIFFExtendProc)(TIFF*);\n\nextern const char* TIFFGetVersion(void);\n\nextern const TIFFCodec* TIFFFindCODEC(uint16);\nextern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);\nextern void TIFFUnRegisterCODEC(TIFFCodec*);\nextern int TIFFIsCODECConfigured(uint16);\nextern TIFFCodec* TIFFGetConfiguredCODECs(void);\n\n/*\n * Auxiliary functions.\n */\n\nextern void* _TIFFmalloc(tmsize_t s);\nextern void* _TIFFrealloc(void* p, tmsize_t s);\nextern void _TIFFmemset(void* p, int v, tmsize_t c);\nextern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);\nextern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);\nextern void _TIFFfree(void* p);\n\n/*\n** Stuff, related to tag handling and creating custom tags.\n*/\nextern int TIFFGetTagListCount( TIFF * );\nextern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );\n    \n#define TIFF_ANY       TIFF_NOTYPE     /* for field descriptor searching */\n#define TIFF_VARIABLE  -1              /* marker for variable length tags */\n#define TIFF_SPP       -2              /* marker for SamplesPerPixel tags */\n#define TIFF_VARIABLE2 -3              /* marker for uint32 var-length tags */\n\n#define FIELD_CUSTOM    65\n\ntypedef struct _TIFFField TIFFField;\ntypedef struct _TIFFFieldArray TIFFFieldArray;\n\nextern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);\nextern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);\nextern const TIFFField* TIFFFieldWithName(TIFF*, const char *);\n\nextern uint32 TIFFFieldTag(const TIFFField*);\nextern const char* TIFFFieldName(const TIFFField*);\nextern TIFFDataType TIFFFieldDataType(const TIFFField*);\nextern int TIFFFieldPassCount(const TIFFField*);\nextern int TIFFFieldReadCount(const TIFFField*);\nextern int TIFFFieldWriteCount(const TIFFField*);\n\ntypedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);\ntypedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);\ntypedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);\n\ntypedef struct {\n    TIFFVSetMethod vsetfield; /* tag set routine */\n    TIFFVGetMethod vgetfield; /* tag get routine */\n    TIFFPrintMethod printdir; /* directory print routine */\n} TIFFTagMethods;\n\nextern  TIFFTagMethods *TIFFAccessTagMethods(TIFF *);\nextern  void *TIFFGetClientInfo(TIFF *, const char *);\nextern  void TIFFSetClientInfo(TIFF *, void *, const char *);\n\nextern void TIFFCleanup(TIFF* tif);\nextern void TIFFClose(TIFF* tif);\nextern int TIFFFlush(TIFF* tif);\nextern int TIFFFlushData(TIFF* tif);\nextern int TIFFGetField(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFReadDirectory(TIFF* tif);\nextern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);\nextern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);\nextern uint64 TIFFScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFScanlineSize(TIFF* tif);\nextern uint64 TIFFRasterScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFRasterScanlineSize(TIFF* tif);\nextern uint64 TIFFStripSize64(TIFF* tif);\nextern tmsize_t TIFFStripSize(TIFF* tif);\nextern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);\nextern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);\nextern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);\nextern uint64 TIFFTileRowSize64(TIFF* tif);\nextern tmsize_t TIFFTileRowSize(TIFF* tif);\nextern uint64 TIFFTileSize64(TIFF* tif);\nextern tmsize_t TIFFTileSize(TIFF* tif);\nextern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);\nextern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);\nextern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);\nextern int TIFFFileno(TIFF*);\nextern int TIFFSetFileno(TIFF*, int);\nextern thandle_t TIFFClientdata(TIFF*);\nextern thandle_t TIFFSetClientdata(TIFF*, thandle_t);\nextern int TIFFGetMode(TIFF*);\nextern int TIFFSetMode(TIFF*, int);\nextern int TIFFIsTiled(TIFF*);\nextern int TIFFIsByteSwapped(TIFF*);\nextern int TIFFIsUpSampled(TIFF*);\nextern int TIFFIsMSB2LSB(TIFF*);\nextern int TIFFIsBigEndian(TIFF*);\nextern TIFFReadWriteProc TIFFGetReadProc(TIFF*);\nextern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);\nextern TIFFSeekProc TIFFGetSeekProc(TIFF*);                                                          \nextern TIFFCloseProc TIFFGetCloseProc(TIFF*);\nextern TIFFSizeProc TIFFGetSizeProc(TIFF*);\nextern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);\nextern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);\nextern uint32 TIFFCurrentRow(TIFF*);\nextern uint16 TIFFCurrentDirectory(TIFF*);\nextern uint16 TIFFNumberOfDirectories(TIFF*);\nextern uint64 TIFFCurrentDirOffset(TIFF*);\nextern uint32 TIFFCurrentStrip(TIFF*);\nextern uint32 TIFFCurrentTile(TIFF* tif);\nextern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);\nextern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);  \nextern int TIFFSetupStrips(TIFF *);\nextern int TIFFWriteCheck(TIFF*, int, const char *);\nextern void TIFFFreeDirectory(TIFF*);\nextern int TIFFCreateDirectory(TIFF*);\nextern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*);\nextern int TIFFCreateEXIFDirectory(TIFF*);\nextern int TIFFLastDirectory(TIFF*);\nextern int TIFFSetDirectory(TIFF*, uint16);\nextern int TIFFSetSubDirectory(TIFF*, uint64);\nextern int TIFFUnlinkDirectory(TIFF*, uint16);\nextern int TIFFSetField(TIFF*, uint32, ...);\nextern int TIFFVSetField(TIFF*, uint32, va_list);\nextern int TIFFUnsetField(TIFF*, uint32);\nextern int TIFFWriteDirectory(TIFF *);\nextern int TIFFWriteCustomDirectory(TIFF *, uint64 *);\nextern int TIFFCheckpointDirectory(TIFF *);\nextern int TIFFRewriteDirectory(TIFF *);\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,\n    int = ORIENTATION_BOTLEFT, int = 0);\n#else\nextern void TIFFPrintDirectory(TIFF*, FILE*, long);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);\n#endif\n\nextern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );\nextern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );\nextern int TIFFRGBAImageOK(TIFF*, char [1024]);\nextern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);\nextern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);\nextern void TIFFRGBAImageEnd(TIFFRGBAImage*);\nextern TIFF* TIFFOpen(const char*, const char*);\n# ifdef __WIN32__\nextern TIFF* TIFFOpenW(const wchar_t*, const char*);\n# endif /* __WIN32__ */\nextern TIFF* TIFFFdOpen(int, const char*, const char*);\nextern TIFF* TIFFClientOpen(const char*, const char*,\n\t    thandle_t,\n\t    TIFFReadWriteProc, TIFFReadWriteProc,\n\t    TIFFSeekProc, TIFFCloseProc,\n\t    TIFFSizeProc,\n\t    TIFFMapFileProc, TIFFUnmapFileProc);\nextern const char* TIFFFileName(TIFF*);\nextern const char* TIFFSetFileName(TIFF*, const char *);\nextern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);\nextern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);\nextern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);\nextern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFNumberOfTiles(TIFF*);\nextern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);  \nextern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);\nextern uint32 TIFFNumberOfStrips(TIFF*);\nextern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);\nextern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);\nextern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern int TIFFDataWidth(TIFFDataType);    /* table of tag datatype widths */\nextern void TIFFSetWriteOffset(TIFF* tif, toff_t off);\nextern void TIFFSwabShort(uint16*);\nextern void TIFFSwabLong(uint32*);\nextern void TIFFSwabLong8(uint64*);\nextern void TIFFSwabFloat(float*);\nextern void TIFFSwabDouble(double*);\nextern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);\nextern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);\nextern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);\nextern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);\nextern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);\nextern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);\nextern void TIFFReverseBits(uint8* cp, tmsize_t n);\nextern const unsigned char* TIFFGetBitRevTable(int);\n\n#ifdef LOGLUV_PUBLIC\n#define U_NEU\t\t0.210526316\n#define V_NEU\t\t0.473684211\n#define UVSCALE\t\t410.\nextern double LogL16toY(int);\nextern double LogL10toY(int);\nextern void XYZtoRGB24(float*, uint8*);\nextern int uv_decode(double*, double*, int);\nextern void LogLuv24toXYZ(uint32, float*);\nextern void LogLuv32toXYZ(uint32, float*);\n#if defined(c_plusplus) || defined(__cplusplus)\nextern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);\nextern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);\nextern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);\n#else\nextern int LogL16fromY(double, int);\nextern int LogL10fromY(double, int);\nextern int uv_encode(double, double, int);\nextern uint32 LogLuv24fromXYZ(float*, int);\nextern uint32 LogLuv32fromXYZ(float*, int);\n#endif\n#endif /* LOGLUV_PUBLIC */\n\nextern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);\nextern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,\n    float *, float *, float *);\nextern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,\n    uint32 *, uint32 *, uint32 *);\n\nextern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);\nextern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,\n    uint32 *, uint32 *, uint32 *);\n\n/****************************************************************************\n *               O B S O L E T E D    I N T E R F A C E S\n *\n * Don't use this stuff in your applications, it may be removed in the future\n * libtiff versions.\n ****************************************************************************/\ntypedef\tstruct {\n\tttag_t\tfield_tag;\t\t/* field's tag */\n\tshort\tfield_readcount;\t/* read count/TIFF_VARIABLE/TIFF_SPP */\n\tshort\tfield_writecount;\t/* write count/TIFF_VARIABLE */\n\tTIFFDataType field_type;\t/* type of associated data */\n        unsigned short field_bit;\t/* bit in fieldsset bit vector */\n\tunsigned char field_oktochange;\t/* if true, can change while writing */\n\tunsigned char field_passcount;\t/* if true, pass dir count on set */\n\tchar\t*field_name;\t\t/* ASCII name */\n} TIFFFieldInfo;\n\nextern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);\n        \n#if defined(c_plusplus) || defined(__cplusplus)\n}\n#endif\n\n#endif /* _TIFFIO_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/mac/tiffvers.h",
    "content": "#define TIFFLIB_VERSION_STR \"LIBTIFF, Version 4.0.3\\nCopyright (c) 1988-1996 Sam Leffler\\nCopyright (c) 1991-1996 Silicon Graphics, Inc.\"\n/*\n * This define can be used in code that requires\n * compilation-related definitions specific to a\n * version or versions of the library.  Runtime\n * version checking should be done based on the\n * string returned by TIFFGetVersion.\n */\n#define TIFFLIB_VERSION 20120922\n"
  },
  {
    "path": "cocos2d/external/tiff/include/win32/tiff.h",
    "content": "/* $Id: tiff.h,v 1.68 2012-08-19 16:56:35 bfriesen Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and \n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n * \n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  \n * \n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF \n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE \n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFF_\n#define\t_TIFF_\n\n#include \"tiffconf.h\"\n\n/*\n * Tag Image File Format (TIFF)\n *\n * Based on Rev 6.0 from:\n *    Developer's Desk\n *    Aldus Corporation\n *    411 First Ave. South\n *    Suite 200\n *    Seattle, WA  98104\n *    206-622-5500\n *\n *    (http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf)\n *\n * For BigTIFF design notes see the following links\n *    http://www.remotesensing.org/libtiff/bigtiffdesign.html\n *    http://www.awaresystems.be/imaging/tiff/bigtiff.html\n */\n\n#define TIFF_VERSION_CLASSIC 42\n#define TIFF_VERSION_BIG 43\n\n#define TIFF_BIGENDIAN      0x4d4d\n#define TIFF_LITTLEENDIAN   0x4949\n#define MDI_LITTLEENDIAN    0x5045\n#define MDI_BIGENDIAN       0x4550\n\n/*\n * Intrinsic data types required by the file format:\n *\n * 8-bit quantities     int8/uint8\n * 16-bit quantities    int16/uint16\n * 32-bit quantities    int32/uint32\n * 64-bit quantities    int64/uint64\n * strings              unsigned char*\n */\n\ntypedef TIFF_INT8_T   int8;\ntypedef TIFF_UINT8_T  uint8;\n\ntypedef TIFF_INT16_T  int16;\ntypedef TIFF_UINT16_T uint16;\n\ntypedef TIFF_INT32_T  int32;\ntypedef TIFF_UINT32_T uint32;\n\ntypedef TIFF_INT64_T  int64;\ntypedef TIFF_UINT64_T uint64;\n\n/*\n * Some types as promoted in a variable argument list\n * We use uint16_vap rather then directly using int, because this way\n * we document the type we actually want to pass through, conceptually,\n * rather then confusing the issue by merely stating the type it gets\n * promoted to\n */\n\ntypedef int uint16_vap;\n\n/*\n * TIFF header.\n */\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n} TIFFHeaderCommon;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint32 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderClassic;\ntypedef struct {\n\tuint16 tiff_magic;      /* magic number (defines byte order) */\n\tuint16 tiff_version;    /* TIFF version number */\n\tuint16 tiff_offsetsize; /* size of offsets, should be 8 */\n\tuint16 tiff_unused;     /* unused word, should be 0 */\n\tuint64 tiff_diroff;     /* byte offset to first directory */\n} TIFFHeaderBig;\n\n\n/*\n * NB: In the comments below,\n *  - items marked with a + are obsoleted by revision 5.0,\n *  - items marked with a ! are introduced in revision 6.0.\n *  - items marked with a % are introduced post revision 6.0.\n *  - items marked with a $ are obsoleted by revision 6.0.\n *  - items marked with a & are introduced by Adobe DNG specification.\n */\n\n/*\n * Tag data type information.\n *\n * Note: RATIONALs are the ratio of two 32-bit integer values.\n */\ntypedef enum {\n\tTIFF_NOTYPE = 0,      /* placeholder */\n\tTIFF_BYTE = 1,        /* 8-bit unsigned integer */\n\tTIFF_ASCII = 2,       /* 8-bit bytes w/ last byte null */\n\tTIFF_SHORT = 3,       /* 16-bit unsigned integer */\n\tTIFF_LONG = 4,        /* 32-bit unsigned integer */\n\tTIFF_RATIONAL = 5,    /* 64-bit unsigned fraction */\n\tTIFF_SBYTE = 6,       /* !8-bit signed integer */\n\tTIFF_UNDEFINED = 7,   /* !8-bit untyped data */\n\tTIFF_SSHORT = 8,      /* !16-bit signed integer */\n\tTIFF_SLONG = 9,       /* !32-bit signed integer */\n\tTIFF_SRATIONAL = 10,  /* !64-bit signed fraction */\n\tTIFF_FLOAT = 11,      /* !32-bit IEEE floating point */\n\tTIFF_DOUBLE = 12,     /* !64-bit IEEE floating point */\n\tTIFF_IFD = 13,        /* %32-bit unsigned integer (offset) */\n\tTIFF_LONG8 = 16,      /* BigTIFF 64-bit unsigned integer */\n\tTIFF_SLONG8 = 17,     /* BigTIFF 64-bit signed integer */\n\tTIFF_IFD8 = 18        /* BigTIFF 64-bit unsigned integer (offset) */\n} TIFFDataType;\n\n/*\n * TIFF Tag Definitions.\n */\n#define\tTIFFTAG_SUBFILETYPE\t\t254\t/* subfile data descriptor */\n#define\t    FILETYPE_REDUCEDIMAGE\t0x1\t/* reduced resolution version */\n#define\t    FILETYPE_PAGE\t\t0x2\t/* one page of many */\n#define\t    FILETYPE_MASK\t\t0x4\t/* transparency mask */\n#define\tTIFFTAG_OSUBFILETYPE\t\t255\t/* +kind of data in subfile */\n#define\t    OFILETYPE_IMAGE\t\t1\t/* full resolution image data */\n#define\t    OFILETYPE_REDUCEDIMAGE\t2\t/* reduced size image data */\n#define\t    OFILETYPE_PAGE\t\t3\t/* one page of many */\n#define\tTIFFTAG_IMAGEWIDTH\t\t256\t/* image width in pixels */\n#define\tTIFFTAG_IMAGELENGTH\t\t257\t/* image height in pixels */\n#define\tTIFFTAG_BITSPERSAMPLE\t\t258\t/* bits per channel (sample) */\n#define\tTIFFTAG_COMPRESSION\t\t259\t/* data compression technique */\n#define\t    COMPRESSION_NONE\t\t1\t/* dump mode */\n#define\t    COMPRESSION_CCITTRLE\t2\t/* CCITT modified Huffman RLE */\n#define\t    COMPRESSION_CCITTFAX3\t3\t/* CCITT Group 3 fax encoding */\n#define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */\n#define\t    COMPRESSION_CCITTFAX4\t4\t/* CCITT Group 4 fax encoding */\n#define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */\n#define\t    COMPRESSION_LZW\t\t5       /* Lempel-Ziv  & Welch */\n#define\t    COMPRESSION_OJPEG\t\t6\t/* !6.0 JPEG */\n#define\t    COMPRESSION_JPEG\t\t7\t/* %JPEG DCT compression */\n#define     COMPRESSION_T85\t\t\t9\t/* !TIFF/FX T.85 JBIG compression */\n#define     COMPRESSION_T43\t\t\t10\t/* !TIFF/FX T.43 colour by layered JBIG compression */\n#define\t    COMPRESSION_NEXT\t\t32766\t/* NeXT 2-bit RLE */\n#define\t    COMPRESSION_CCITTRLEW\t32771\t/* #1 w/ word alignment */\n#define\t    COMPRESSION_PACKBITS\t32773\t/* Macintosh RLE */\n#define\t    COMPRESSION_THUNDERSCAN\t32809\t/* ThunderScan RLE */\n/* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define\t    COMPRESSION_IT8CTPAD\t32895   /* IT8 CT w/padding */\n#define\t    COMPRESSION_IT8LW\t\t32896   /* IT8 Linework RLE */\n#define\t    COMPRESSION_IT8MP\t\t32897   /* IT8 Monochrome picture */\n#define\t    COMPRESSION_IT8BL\t\t32898   /* IT8 Binary line art */\n/* compression codes 32908-32911 are reserved for Pixar */\n#define     COMPRESSION_PIXARFILM\t32908   /* Pixar companded 10bit LZW */\n#define\t    COMPRESSION_PIXARLOG\t32909   /* Pixar companded 11bit ZIP */\n#define\t    COMPRESSION_DEFLATE\t\t32946\t/* Deflate compression */\n#define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,\n\t\t\t\t\t\t   as recognized by Adobe */\n/* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */\n#define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */\n#define\t    COMPRESSION_JBIG\t\t34661\t/* ISO JBIG */\n#define     COMPRESSION_SGILOG\t\t34676\t/* SGI Log Luminance RLE */\n#define     COMPRESSION_SGILOG24\t34677\t/* SGI Log 24-bit packed */\n#define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */\n#define\t    COMPRESSION_LZMA\t\t34925\t/* LZMA2 */\n#define\tTIFFTAG_PHOTOMETRIC\t\t262\t/* photometric interpretation */\n#define\t    PHOTOMETRIC_MINISWHITE\t0\t/* min value is white */\n#define\t    PHOTOMETRIC_MINISBLACK\t1\t/* min value is black */\n#define\t    PHOTOMETRIC_RGB\t\t2\t/* RGB color model */\n#define\t    PHOTOMETRIC_PALETTE\t\t3\t/* color map indexed */\n#define\t    PHOTOMETRIC_MASK\t\t4\t/* $holdout mask */\n#define\t    PHOTOMETRIC_SEPARATED\t5\t/* !color separations */\n#define\t    PHOTOMETRIC_YCBCR\t\t6\t/* !CCIR 601 */\n#define\t    PHOTOMETRIC_CIELAB\t\t8\t/* !1976 CIE L*a*b* */\n#define\t    PHOTOMETRIC_ICCLAB\t\t9\t/* ICC L*a*b* [Adobe TIFF Technote 4] */\n#define\t    PHOTOMETRIC_ITULAB\t\t10\t/* ITU L*a*b* */\n#define     PHOTOMETRIC_LOGL\t\t32844\t/* CIE Log2(L) */\n#define     PHOTOMETRIC_LOGLUV\t\t32845\t/* CIE Log2(L) (u',v') */\n#define\tTIFFTAG_THRESHHOLDING\t\t263\t/* +thresholding used on data */\n#define\t    THRESHHOLD_BILEVEL\t\t1\t/* b&w art scan */\n#define\t    THRESHHOLD_HALFTONE\t\t2\t/* or dithered scan */\n#define\t    THRESHHOLD_ERRORDIFFUSE\t3\t/* usually floyd-steinberg */\n#define\tTIFFTAG_CELLWIDTH\t\t264\t/* +dithering matrix width */\n#define\tTIFFTAG_CELLLENGTH\t\t265\t/* +dithering matrix height */\n#define\tTIFFTAG_FILLORDER\t\t266\t/* data order within a byte */\n#define\t    FILLORDER_MSB2LSB\t\t1\t/* most significant -> least */\n#define\t    FILLORDER_LSB2MSB\t\t2\t/* least significant -> most */\n#define\tTIFFTAG_DOCUMENTNAME\t\t269\t/* name of doc. image is from */\n#define\tTIFFTAG_IMAGEDESCRIPTION\t270\t/* info about image */\n#define\tTIFFTAG_MAKE\t\t\t271\t/* scanner manufacturer name */\n#define\tTIFFTAG_MODEL\t\t\t272\t/* scanner model name/number */\n#define\tTIFFTAG_STRIPOFFSETS\t\t273\t/* offsets to data strips */\n#define\tTIFFTAG_ORIENTATION\t\t274\t/* +image orientation */\n#define\t    ORIENTATION_TOPLEFT\t\t1\t/* row 0 top, col 0 lhs */\n#define\t    ORIENTATION_TOPRIGHT\t2\t/* row 0 top, col 0 rhs */\n#define\t    ORIENTATION_BOTRIGHT\t3\t/* row 0 bottom, col 0 rhs */\n#define\t    ORIENTATION_BOTLEFT\t\t4\t/* row 0 bottom, col 0 lhs */\n#define\t    ORIENTATION_LEFTTOP\t\t5\t/* row 0 lhs, col 0 top */\n#define\t    ORIENTATION_RIGHTTOP\t6\t/* row 0 rhs, col 0 top */\n#define\t    ORIENTATION_RIGHTBOT\t7\t/* row 0 rhs, col 0 bottom */\n#define\t    ORIENTATION_LEFTBOT\t\t8\t/* row 0 lhs, col 0 bottom */\n#define\tTIFFTAG_SAMPLESPERPIXEL\t\t277\t/* samples per pixel */\n#define\tTIFFTAG_ROWSPERSTRIP\t\t278\t/* rows per strip of data */\n#define\tTIFFTAG_STRIPBYTECOUNTS\t\t279\t/* bytes counts for strips */\n#define\tTIFFTAG_MINSAMPLEVALUE\t\t280\t/* +minimum sample value */\n#define\tTIFFTAG_MAXSAMPLEVALUE\t\t281\t/* +maximum sample value */\n#define\tTIFFTAG_XRESOLUTION\t\t282\t/* pixels/resolution in x */\n#define\tTIFFTAG_YRESOLUTION\t\t283\t/* pixels/resolution in y */\n#define\tTIFFTAG_PLANARCONFIG\t\t284\t/* storage organization */\n#define\t    PLANARCONFIG_CONTIG\t\t1\t/* single image plane */\n#define\t    PLANARCONFIG_SEPARATE\t2\t/* separate planes of data */\n#define\tTIFFTAG_PAGENAME\t\t285\t/* page name image is from */\n#define\tTIFFTAG_XPOSITION\t\t286\t/* x page offset of image lhs */\n#define\tTIFFTAG_YPOSITION\t\t287\t/* y page offset of image lhs */\n#define\tTIFFTAG_FREEOFFSETS\t\t288\t/* +byte offset to free block */\n#define\tTIFFTAG_FREEBYTECOUNTS\t\t289\t/* +sizes of free blocks */\n#define\tTIFFTAG_GRAYRESPONSEUNIT\t290\t/* $gray scale curve accuracy */\n#define\t    GRAYRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    GRAYRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    GRAYRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    GRAYRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_GRAYRESPONSECURVE\t291\t/* $gray scale response curve */\n#define\tTIFFTAG_GROUP3OPTIONS\t\t292\t/* 32 flag bits */\n#define\tTIFFTAG_T4OPTIONS\t\t292\t/* TIFF 6.0 proper name alias */\n#define\t    GROUP3OPT_2DENCODING\t0x1\t/* 2-dimensional coding */\n#define\t    GROUP3OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\t    GROUP3OPT_FILLBITS\t\t0x4\t/* fill to byte boundary */\n#define\tTIFFTAG_GROUP4OPTIONS\t\t293\t/* 32 flag bits */\n#define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */\n#define\t    GROUP4OPT_UNCOMPRESSED\t0x2\t/* data not compressed */\n#define\tTIFFTAG_RESOLUTIONUNIT\t\t296\t/* units of resolutions */\n#define\t    RESUNIT_NONE\t\t1\t/* no meaningful units */\n#define\t    RESUNIT_INCH\t\t2\t/* english */\n#define\t    RESUNIT_CENTIMETER\t\t3\t/* metric */\n#define\tTIFFTAG_PAGENUMBER\t\t297\t/* page numbers of multi-page */\n#define\tTIFFTAG_COLORRESPONSEUNIT\t300\t/* $color curve accuracy */\n#define\t    COLORRESPONSEUNIT_10S\t1\t/* tenths of a unit */\n#define\t    COLORRESPONSEUNIT_100S\t2\t/* hundredths of a unit */\n#define\t    COLORRESPONSEUNIT_1000S\t3\t/* thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_10000S\t4\t/* ten-thousandths of a unit */\n#define\t    COLORRESPONSEUNIT_100000S\t5\t/* hundred-thousandths */\n#define\tTIFFTAG_TRANSFERFUNCTION\t301\t/* !colorimetry info */\n#define\tTIFFTAG_SOFTWARE\t\t305\t/* name & release */\n#define\tTIFFTAG_DATETIME\t\t306\t/* creation date and time */\n#define\tTIFFTAG_ARTIST\t\t\t315\t/* creator of image */\n#define\tTIFFTAG_HOSTCOMPUTER\t\t316\t/* machine where created */\n#define\tTIFFTAG_PREDICTOR\t\t317\t/* prediction scheme w/ LZW */\n#define     PREDICTOR_NONE\t\t1\t/* no prediction scheme used */\n#define     PREDICTOR_HORIZONTAL\t2\t/* horizontal differencing */\n#define     PREDICTOR_FLOATINGPOINT\t3\t/* floating point predictor */\n#define\tTIFFTAG_WHITEPOINT\t\t318\t/* image white point */\n#define\tTIFFTAG_PRIMARYCHROMATICITIES\t319\t/* !primary chromaticities */\n#define\tTIFFTAG_COLORMAP\t\t320\t/* RGB map for pallette image */\n#define\tTIFFTAG_HALFTONEHINTS\t\t321\t/* !highlight+shadow info */\n#define\tTIFFTAG_TILEWIDTH\t\t322\t/* !tile width in pixels */\n#define\tTIFFTAG_TILELENGTH\t\t323\t/* !tile height in pixels */\n#define TIFFTAG_TILEOFFSETS\t\t324\t/* !offsets to data tiles */\n#define TIFFTAG_TILEBYTECOUNTS\t\t325\t/* !byte counts for tiles */\n#define\tTIFFTAG_BADFAXLINES\t\t326\t/* lines w/ wrong pixel count */\n#define\tTIFFTAG_CLEANFAXDATA\t\t327\t/* regenerated line info */\n#define\t    CLEANFAXDATA_CLEAN\t\t0\t/* no errors detected */\n#define\t    CLEANFAXDATA_REGENERATED\t1\t/* receiver regenerated lines */\n#define\t    CLEANFAXDATA_UNCLEAN\t2\t/* uncorrected errors exist */\n#define\tTIFFTAG_CONSECUTIVEBADFAXLINES\t328\t/* max consecutive bad lines */\n#define\tTIFFTAG_SUBIFD\t\t\t330\t/* subimage descriptors */\n#define\tTIFFTAG_INKSET\t\t\t332\t/* !inks in separated image */\n#define\t    INKSET_CMYK\t\t\t1\t/* !cyan-magenta-yellow-black color */\n#define\t    INKSET_MULTIINK\t\t2\t/* !multi-ink or hi-fi color */\n#define\tTIFFTAG_INKNAMES\t\t333\t/* !ascii names of inks */\n#define\tTIFFTAG_NUMBEROFINKS\t\t334\t/* !number of inks */\n#define\tTIFFTAG_DOTRANGE\t\t336\t/* !0% and 100% dot codes */\n#define\tTIFFTAG_TARGETPRINTER\t\t337\t/* !separation target */\n#define\tTIFFTAG_EXTRASAMPLES\t\t338\t/* !info about extra samples */\n#define\t    EXTRASAMPLE_UNSPECIFIED\t0\t/* !unspecified data */\n#define\t    EXTRASAMPLE_ASSOCALPHA\t1\t/* !associated alpha data */\n#define\t    EXTRASAMPLE_UNASSALPHA\t2\t/* !unassociated alpha data */\n#define\tTIFFTAG_SAMPLEFORMAT\t\t339\t/* !data sample format */\n#define\t    SAMPLEFORMAT_UINT\t\t1\t/* !unsigned integer data */\n#define\t    SAMPLEFORMAT_INT\t\t2\t/* !signed integer data */\n#define\t    SAMPLEFORMAT_IEEEFP\t\t3\t/* !IEEE floating point data */\n#define\t    SAMPLEFORMAT_VOID\t\t4\t/* !untyped data */\n#define\t    SAMPLEFORMAT_COMPLEXINT\t5\t/* !complex signed int */\n#define\t    SAMPLEFORMAT_COMPLEXIEEEFP\t6\t/* !complex ieee floating */\n#define\tTIFFTAG_SMINSAMPLEVALUE\t\t340\t/* !variable MinSampleValue */\n#define\tTIFFTAG_SMAXSAMPLEVALUE\t\t341\t/* !variable MaxSampleValue */\n#define\tTIFFTAG_CLIPPATH\t\t343\t/* %ClipPath\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_XCLIPPATHUNITS\t\t344\t/* %XClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_YCLIPPATHUNITS\t\t345\t/* %YClipPathUnits\n\t\t\t\t\t\t   [Adobe TIFF technote 2] */\n#define\tTIFFTAG_INDEXED\t\t\t346\t/* %Indexed\n\t\t\t\t\t\t   [Adobe TIFF Technote 3] */\n#define\tTIFFTAG_JPEGTABLES\t\t347\t/* %JPEG table stream */\n#define\tTIFFTAG_OPIPROXY\t\t351\t/* %OPI Proxy [Adobe TIFF technote] */\n/* Tags 400-435 are from the TIFF/FX spec */\n#define TIFFTAG_GLOBALPARAMETERSIFD\t400\t/* ! */\n#define TIFFTAG_PROFILETYPE\t\t\t401\t/* ! */\n#define     PROFILETYPE_UNSPECIFIED\t0\t/* ! */\n#define     PROFILETYPE_G3_FAX\t\t1\t/* ! */\n#define TIFFTAG_FAXPROFILE\t\t\t402\t/* ! */\n#define     FAXPROFILE_S\t\t\t1\t/* !TIFF/FX FAX profile S */\n#define     FAXPROFILE_F\t\t\t2\t/* !TIFF/FX FAX profile F */\n#define     FAXPROFILE_J\t\t\t3\t/* !TIFF/FX FAX profile J */\n#define     FAXPROFILE_C\t\t\t4\t/* !TIFF/FX FAX profile C */\n#define     FAXPROFILE_L\t\t\t5\t/* !TIFF/FX FAX profile L */\n#define     FAXPROFILE_M\t\t\t6\t/* !TIFF/FX FAX profile LM */\n#define TIFFTAG_CODINGMETHODS\t\t403\t/* !TIFF/FX coding methods */\n#define     CODINGMETHODS_T4_1D\t\t(1 << 1)\t/* !T.4 1D */\n#define     CODINGMETHODS_T4_2D\t\t(1 << 2)\t/* !T.4 2D */\n#define     CODINGMETHODS_T6\t\t(1 << 3)\t/* !T.6 */\n#define     CODINGMETHODS_T85 \t\t(1 << 4)\t/* !T.85 JBIG */\n#define     CODINGMETHODS_T42 \t\t(1 << 5)\t/* !T.42 JPEG */\n#define     CODINGMETHODS_T43\t\t(1 << 6)\t/* !T.43 colour by layered JBIG */\n#define TIFFTAG_VERSIONYEAR\t\t\t404\t/* !TIFF/FX version year */\n#define TIFFTAG_MODENUMBER\t\t\t405\t/* !TIFF/FX mode number */\n#define TIFFTAG_DECODE\t\t\t\t433\t/* !TIFF/FX decode */\n#define TIFFTAG_IMAGEBASECOLOR\t\t434\t/* !TIFF/FX image base colour */\n#define TIFFTAG_T82OPTIONS\t\t\t435\t/* !TIFF/FX T.82 options */\n/*\n * Tags 512-521 are obsoleted by Technical Note #2 which specifies a\n * revised JPEG-in-TIFF scheme.\n */\n#define\tTIFFTAG_JPEGPROC\t\t512\t/* !JPEG processing algorithm */\n#define\t    JPEGPROC_BASELINE\t\t1\t/* !baseline sequential */\n#define\t    JPEGPROC_LOSSLESS\t\t14\t/* !Huffman coded lossless */\n#define\tTIFFTAG_JPEGIFOFFSET\t\t513\t/* !pointer to SOI marker */\n#define\tTIFFTAG_JPEGIFBYTECOUNT\t\t514\t/* !JFIF stream length */\n#define\tTIFFTAG_JPEGRESTARTINTERVAL\t515\t/* !restart interval length */\n#define\tTIFFTAG_JPEGLOSSLESSPREDICTORS\t517\t/* !lossless proc predictor */\n#define\tTIFFTAG_JPEGPOINTTRANSFORM\t518\t/* !lossless point transform */\n#define\tTIFFTAG_JPEGQTABLES\t\t519\t/* !Q matrice offsets */\n#define\tTIFFTAG_JPEGDCTABLES\t\t520\t/* !DCT table offsets */\n#define\tTIFFTAG_JPEGACTABLES\t\t521\t/* !AC coefficient offsets */\n#define\tTIFFTAG_YCBCRCOEFFICIENTS\t529\t/* !RGB -> YCbCr transform */\n#define\tTIFFTAG_YCBCRSUBSAMPLING\t530\t/* !YCbCr subsampling factors */\n#define\tTIFFTAG_YCBCRPOSITIONING\t531\t/* !subsample positioning */\n#define\t    YCBCRPOSITION_CENTERED\t1\t/* !as in PostScript Level 2 */\n#define\t    YCBCRPOSITION_COSITED\t2\t/* !as in CCIR 601-1 */\n#define\tTIFFTAG_REFERENCEBLACKWHITE\t532\t/* !colorimetry info */\n#define TIFFTAG_STRIPROWCOUNTS\t\t559 /* !TIFF/FX strip row counts */\n#define\tTIFFTAG_XMLPACKET\t\t700\t/* %XML packet\n\t\t\t\t\t\t   [Adobe XMP Specification,\n\t\t\t\t\t\t   January 2004 */\n#define TIFFTAG_OPIIMAGEID\t\t32781\t/* %OPI ImageID\n\t\t\t\t\t\t   [Adobe TIFF technote] */\n/* tags 32952-32956 are private tags registered to Island Graphics */\n#define TIFFTAG_REFPTS\t\t\t32953\t/* image reference points */\n#define TIFFTAG_REGIONTACKPOINT\t\t32954\t/* region-xform tack point */\n#define TIFFTAG_REGIONWARPCORNERS\t32955\t/* warp quadrilateral */\n#define TIFFTAG_REGIONAFFINE\t\t32956\t/* affine transformation mat */\n/* tags 32995-32999 are private tags registered to SGI */\n#define\tTIFFTAG_MATTEING\t\t32995\t/* $use ExtraSamples */\n#define\tTIFFTAG_DATATYPE\t\t32996\t/* $use SampleFormat */\n#define\tTIFFTAG_IMAGEDEPTH\t\t32997\t/* z depth of image */\n#define\tTIFFTAG_TILEDEPTH\t\t32998\t/* z depth/data tile */\n/* tags 33300-33309 are private tags registered to Pixar */\n/*\n * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH\n * are set when an image has been cropped out of a larger image.  \n * They reflect the size of the original uncropped image.\n * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used\n * to determine the position of the smaller image in the larger one.\n */\n#define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */\n#define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */\n /* Tags 33302-33306 are used to identify special image modes and data\n  * used by Pixar's texture formats.\n  */\n#define TIFFTAG_PIXAR_TEXTUREFORMAT\t33302\t/* texture map format */\n#define TIFFTAG_PIXAR_WRAPMODES\t\t33303\t/* s & t wrap modes */\n#define TIFFTAG_PIXAR_FOVCOT\t\t33304\t/* cotan(fov) for env. maps */\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305\n#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306\n/* tag 33405 is a private tag registered to Eastman Kodak */\n#define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */\n/* tag 33432 is listed in the 6.0 spec w/ unknown ownership */\n#define\tTIFFTAG_COPYRIGHT\t\t33432\t/* copyright string */\n/* IPTC TAG from RichTIFF specifications */\n#define TIFFTAG_RICHTIFFIPTC\t\t33723\n/* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */\n#define TIFFTAG_IT8SITE\t\t\t34016\t/* site name */\n#define TIFFTAG_IT8COLORSEQUENCE\t34017\t/* color seq. [RGB,CMYK,etc] */\n#define TIFFTAG_IT8HEADER\t\t34018\t/* DDES Header */\n#define TIFFTAG_IT8RASTERPADDING\t34019\t/* raster scanline padding */\n#define TIFFTAG_IT8BITSPERRUNLENGTH\t34020\t/* # of bits in short run */\n#define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */\n#define TIFFTAG_IT8COLORTABLE\t\t34022\t/* LW colortable */\n#define TIFFTAG_IT8IMAGECOLORINDICATOR\t34023\t/* BP/BL image color switch */\n#define TIFFTAG_IT8BKGCOLORINDICATOR\t34024\t/* BP/BL bg color switch */\n#define TIFFTAG_IT8IMAGECOLORVALUE\t34025\t/* BP/BL image color value */\n#define TIFFTAG_IT8BKGCOLORVALUE\t34026\t/* BP/BL bg color value */\n#define TIFFTAG_IT8PIXELINTENSITYRANGE\t34027\t/* MP pixel intensity value */\n#define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028\t/* HC transparency switch */\n#define TIFFTAG_IT8COLORCHARACTERIZATION 34029\t/* color character. table */\n#define TIFFTAG_IT8HCUSAGE\t\t34030\t/* HC usage indicator */\n#define TIFFTAG_IT8TRAPINDICATOR\t34031\t/* Trapping indicator\n\t\t\t\t\t\t   (untrapped=0, trapped=1) */\n#define TIFFTAG_IT8CMYKEQUIVALENT\t34032\t/* CMYK color equivalents */\n/* tags 34232-34236 are private tags registered to Texas Instruments */\n#define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */\n/* tag 34377 is private tag registered to Adobe for PhotoShop */\n#define TIFFTAG_PHOTOSHOP\t\t34377 \n/* tags 34665, 34853 and 40965 are documented in EXIF specification */\n#define TIFFTAG_EXIFIFD\t\t\t34665\t/* Pointer to EXIF private directory */\n/* tag 34750 is a private tag registered to Adobe? */\n#define TIFFTAG_ICCPROFILE\t\t34675\t/* ICC profile data */\n#define TIFFTAG_IMAGELAYER\t\t34732\t/* !TIFF/FX image layer information */\n/* tag 34750 is a private tag registered to Pixel Magic */\n#define\tTIFFTAG_JBIGOPTIONS\t\t34750\t/* JBIG options */\n#define TIFFTAG_GPSIFD\t\t\t34853\t/* Pointer to GPS private directory */\n/* tags 34908-34914 are private tags registered to SGI */\n#define\tTIFFTAG_FAXRECVPARAMS\t\t34908\t/* encoded Class 2 ses. parms */\n#define\tTIFFTAG_FAXSUBADDRESS\t\t34909\t/* received SubAddr string */\n#define\tTIFFTAG_FAXRECVTIME\t\t34910\t/* receive time (secs) */\n#define\tTIFFTAG_FAXDCS\t\t\t34911\t/* encoded fax ses. params, Table 2/T.30 */\n/* tags 37439-37443 are registered to SGI <gregl@sgi.com> */\n#define TIFFTAG_STONITS\t\t\t37439\t/* Sample value to Nits */\n/* tag 34929 is a private tag registered to FedEx */\n#define\tTIFFTAG_FEDEX_EDR\t\t34929\t/* unknown use */\n#define TIFFTAG_INTEROPERABILITYIFD\t40965\t/* Pointer to Interoperability private directory */\n/* Adobe Digital Negative (DNG) format tags */\n#define TIFFTAG_DNGVERSION\t\t50706\t/* &DNG version number */\n#define TIFFTAG_DNGBACKWARDVERSION\t50707\t/* &DNG compatibility version */\n#define TIFFTAG_UNIQUECAMERAMODEL\t50708\t/* &name for the camera model */\n#define TIFFTAG_LOCALIZEDCAMERAMODEL\t50709\t/* &localized camera model\n\t\t\t\t\t\t   name */\n#define TIFFTAG_CFAPLANECOLOR\t\t50710\t/* &CFAPattern->LinearRaw space\n\t\t\t\t\t\t   mapping */\n#define TIFFTAG_CFALAYOUT\t\t50711\t/* &spatial layout of the CFA */\n#define TIFFTAG_LINEARIZATIONTABLE\t50712\t/* &lookup table description */\n#define TIFFTAG_BLACKLEVELREPEATDIM\t50713\t/* &repeat pattern size for\n\t\t\t\t\t\t   the BlackLevel tag */\n#define TIFFTAG_BLACKLEVEL\t\t50714\t/* &zero light encoding level */\n#define TIFFTAG_BLACKLEVELDELTAH\t50715\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (columns) */\n#define TIFFTAG_BLACKLEVELDELTAV\t50716\t/* &zero light encoding level\n\t\t\t\t\t\t   differences (rows) */\n#define TIFFTAG_WHITELEVEL\t\t50717\t/* &fully saturated encoding\n\t\t\t\t\t\t   level */\n#define TIFFTAG_DEFAULTSCALE\t\t50718\t/* &default scale factors */\n#define TIFFTAG_DEFAULTCROPORIGIN\t50719\t/* &origin of the final image\n\t\t\t\t\t\t   area */\n#define TIFFTAG_DEFAULTCROPSIZE\t\t50720\t/* &size of the final image \n\t\t\t\t\t\t   area */\n#define TIFFTAG_COLORMATRIX1\t\t50721\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 1 */\n#define TIFFTAG_COLORMATRIX2\t\t50722\t/* &XYZ->reference color space\n\t\t\t\t\t\t   transformation matrix 2 */\n#define TIFFTAG_CAMERACALIBRATION1\t50723\t/* &calibration matrix 1 */\n#define TIFFTAG_CAMERACALIBRATION2\t50724\t/* &calibration matrix 2 */\n#define TIFFTAG_REDUCTIONMATRIX1\t50725\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 1 */\n#define TIFFTAG_REDUCTIONMATRIX2\t50726\t/* &dimensionality reduction\n\t\t\t\t\t\t   matrix 2 */\n#define TIFFTAG_ANALOGBALANCE\t\t50727\t/* &gain applied the stored raw\n\t\t\t\t\t\t   values*/\n#define TIFFTAG_ASSHOTNEUTRAL\t\t50728\t/* &selected white balance in\n\t\t\t\t\t\t   linear reference space */\n#define TIFFTAG_ASSHOTWHITEXY\t\t50729\t/* &selected white balance in\n\t\t\t\t\t\t   x-y chromaticity\n\t\t\t\t\t\t   coordinates */\n#define TIFFTAG_BASELINEEXPOSURE\t50730\t/* &how much to move the zero\n\t\t\t\t\t\t   point */\n#define TIFFTAG_BASELINENOISE\t\t50731\t/* &relative noise level */\n#define TIFFTAG_BASELINESHARPNESS\t50732\t/* &relative amount of\n\t\t\t\t\t\t   sharpening */\n#define TIFFTAG_BAYERGREENSPLIT\t\t50733\t/* &how closely the values of\n\t\t\t\t\t\t   the green pixels in the\n\t\t\t\t\t\t   blue/green rows track the\n\t\t\t\t\t\t   values of the green pixels\n\t\t\t\t\t\t   in the red/green rows */\n#define TIFFTAG_LINEARRESPONSELIMIT\t50734\t/* &non-linear encoding range */\n#define TIFFTAG_CAMERASERIALNUMBER\t50735\t/* &camera's serial number */\n#define TIFFTAG_LENSINFO\t\t50736\t/* info about the lens */\n#define TIFFTAG_CHROMABLURRADIUS\t50737\t/* &chroma blur radius */\n#define TIFFTAG_ANTIALIASSTRENGTH\t50738\t/* &relative strength of the\n\t\t\t\t\t\t   camera's anti-alias filter */\n#define TIFFTAG_SHADOWSCALE\t\t50739\t/* &used by Adobe Camera Raw */\n#define TIFFTAG_DNGPRIVATEDATA\t\t50740\t/* &manufacturer's private data */\n#define TIFFTAG_MAKERNOTESAFETY\t\t50741\t/* &whether the EXIF MakerNote\n\t\t\t\t\t\t   tag is safe to preserve\n\t\t\t\t\t\t   along with the rest of the\n\t\t\t\t\t\t   EXIF data */\n#define\tTIFFTAG_CALIBRATIONILLUMINANT1\t50778\t/* &illuminant 1 */\n#define TIFFTAG_CALIBRATIONILLUMINANT2\t50779\t/* &illuminant 2 */\n#define TIFFTAG_BESTQUALITYSCALE\t50780\t/* &best quality multiplier */\n#define TIFFTAG_RAWDATAUNIQUEID\t\t50781\t/* &unique identifier for\n\t\t\t\t\t\t   the raw image data */\n#define TIFFTAG_ORIGINALRAWFILENAME\t50827\t/* &file name of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ORIGINALRAWFILEDATA\t50828\t/* &contents of the original\n\t\t\t\t\t\t   raw file */\n#define TIFFTAG_ACTIVEAREA\t\t50829\t/* &active (non-masked) pixels\n\t\t\t\t\t\t   of the sensor */\n#define TIFFTAG_MASKEDAREAS\t\t50830\t/* &list of coordinates\n\t\t\t\t\t\t   of fully masked pixels */\n#define TIFFTAG_ASSHOTICCPROFILE\t50831\t/* &these two tags used to */\n#define TIFFTAG_ASSHOTPREPROFILEMATRIX\t50832\t/* map cameras's color space\n\t\t\t\t\t\t   into ICC profile space */\n#define TIFFTAG_CURRENTICCPROFILE\t50833\t/* & */\n#define TIFFTAG_CURRENTPREPROFILEMATRIX\t50834\t/* & */\n/* tag 65535 is an undefined tag used by Eastman Kodak */\n#define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */\n\n/*\n * The following are ``pseudo tags'' that can be used to control\n * codec-specific functionality.  These tags are not written to file.\n * Note that these values start at 0xffff+1 so that they'll never\n * collide with Aldus-assigned tags.\n *\n * If you want your private pseudo tags ``registered'' (i.e. added to\n * this file), please post a bug report via the tracking system at\n * http://www.remotesensing.org/libtiff/bugs.html with the appropriate\n * C definitions to add.\n */\n#define\tTIFFTAG_FAXMODE\t\t\t65536\t/* Group 3/4 format control */\n#define\t    FAXMODE_CLASSIC\t0x0000\t\t/* default, include RTC */\n#define\t    FAXMODE_NORTC\t0x0001\t\t/* no RTC at end of data */\n#define\t    FAXMODE_NOEOL\t0x0002\t\t/* no EOL code at end of row */\n#define\t    FAXMODE_BYTEALIGN\t0x0004\t\t/* byte align row */\n#define\t    FAXMODE_WORDALIGN\t0x0008\t\t/* word align row */\n#define\t    FAXMODE_CLASSF\tFAXMODE_NORTC\t/* TIFF Class F */\n#define\tTIFFTAG_JPEGQUALITY\t\t65537\t/* Compression quality level */\n/* Note: quality level is on the IJG 0-100 scale.  Default value is 75 */\n#define\tTIFFTAG_JPEGCOLORMODE\t\t65538\t/* Auto RGB<=>YCbCr convert? */\n#define\t    JPEGCOLORMODE_RAW\t0x0000\t\t/* no conversion (default) */\n#define\t    JPEGCOLORMODE_RGB\t0x0001\t\t/* do auto conversion */\n#define\tTIFFTAG_JPEGTABLESMODE\t\t65539\t/* What to put in JPEGTables */\n#define\t    JPEGTABLESMODE_QUANT 0x0001\t\t/* include quantization tbls */\n#define\t    JPEGTABLESMODE_HUFF\t0x0002\t\t/* include Huffman tbls */\n/* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */\n#define\tTIFFTAG_FAXFILLFUNC\t\t65540\t/* G3/G4 fill function */\n#define\tTIFFTAG_PIXARLOGDATAFMT\t\t65549\t/* PixarLogCodec I/O data sz */\n#define\t    PIXARLOGDATAFMT_8BIT\t0\t/* regular u_char samples */\n#define\t    PIXARLOGDATAFMT_8BITABGR\t1\t/* ABGR-order u_chars */\n#define\t    PIXARLOGDATAFMT_11BITLOG\t2\t/* 11-bit log-encoded (raw) */\n#define\t    PIXARLOGDATAFMT_12BITPICIO\t3\t/* as per PICIO (1.0==2048) */\n#define\t    PIXARLOGDATAFMT_16BIT\t4\t/* signed short samples */\n#define\t    PIXARLOGDATAFMT_FLOAT\t5\t/* IEEE float samples */\n/* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */\n#define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */\n#define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */\n#define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */\n#define     DCSIMAGERFILTER_IR          0       /* infrared filter */\n#define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */\n#define     DCSIMAGERFILTER_CFA         2       /* color filter array */\n#define     DCSIMAGERFILTER_OTHER       3       /* other filter */\n#define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */\n#define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */\n#define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */\n#define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */\n#define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */\n#define TIFFTAG_DCSGAMMA                65554   /* gamma value */\n#define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */\n#define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */\n/* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */\n#define\tTIFFTAG_ZIPQUALITY\t\t65557\t/* compression quality level */\n#define\tTIFFTAG_PIXARLOGQUALITY\t\t65558\t/* PixarLog uses same scale */\n/* 65559 is allocated to Oceana Matrix <dev@oceana.com> */\n#define TIFFTAG_DCSCLIPRECTANGLE\t65559\t/* area of image to acquire */\n#define TIFFTAG_SGILOGDATAFMT\t\t65560\t/* SGILog user data format */\n#define     SGILOGDATAFMT_FLOAT\t\t0\t/* IEEE float samples */\n#define     SGILOGDATAFMT_16BIT\t\t1\t/* 16-bit samples */\n#define     SGILOGDATAFMT_RAW\t\t2\t/* uninterpreted data */\n#define     SGILOGDATAFMT_8BIT\t\t3\t/* 8-bit RGB monitor values */\n#define TIFFTAG_SGILOGENCODE\t\t65561 /* SGILog data encoding control*/\n#define     SGILOGENCODE_NODITHER\t0     /* do not dither encoded values*/\n#define     SGILOGENCODE_RANDITHER\t1     /* randomly dither encd values */\n#define\tTIFFTAG_LZMAPRESET\t\t65562\t/* LZMA2 preset (compression level) */\n#define TIFFTAG_PERSAMPLE       65563\t/* interface for per sample tags */\n#define     PERSAMPLE_MERGED        0\t/* present as a single value */\n#define     PERSAMPLE_MULTI         1\t/* present as multiple values */\n\n/*\n * EXIF tags\n */\n#define EXIFTAG_EXPOSURETIME\t\t33434\t/* Exposure time */\n#define EXIFTAG_FNUMBER\t\t\t33437\t/* F number */\n#define EXIFTAG_EXPOSUREPROGRAM\t\t34850\t/* Exposure program */\n#define EXIFTAG_SPECTRALSENSITIVITY\t34852\t/* Spectral sensitivity */\n#define EXIFTAG_ISOSPEEDRATINGS\t\t34855\t/* ISO speed rating */\n#define EXIFTAG_OECF\t\t\t34856\t/* Optoelectric conversion\n\t\t\t\t\t\t   factor */\n#define EXIFTAG_EXIFVERSION\t\t36864\t/* Exif version */\n#define EXIFTAG_DATETIMEORIGINAL\t36867\t/* Date and time of original\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_DATETIMEDIGITIZED\t36868\t/* Date and time of digital\n\t\t\t\t\t\t   data generation */\n#define EXIFTAG_COMPONENTSCONFIGURATION\t37121\t/* Meaning of each component */\n#define EXIFTAG_COMPRESSEDBITSPERPIXEL\t37122\t/* Image compression mode */\n#define EXIFTAG_SHUTTERSPEEDVALUE\t37377\t/* Shutter speed */\n#define EXIFTAG_APERTUREVALUE\t\t37378\t/* Aperture */\n#define EXIFTAG_BRIGHTNESSVALUE\t\t37379\t/* Brightness */\n#define EXIFTAG_EXPOSUREBIASVALUE\t37380\t/* Exposure bias */\n#define EXIFTAG_MAXAPERTUREVALUE\t37381\t/* Maximum lens aperture */\n#define EXIFTAG_SUBJECTDISTANCE\t\t37382\t/* Subject distance */\n#define EXIFTAG_METERINGMODE\t\t37383\t/* Metering mode */\n#define EXIFTAG_LIGHTSOURCE\t\t37384\t/* Light source */\n#define EXIFTAG_FLASH\t\t\t37385\t/* Flash */\n#define EXIFTAG_FOCALLENGTH\t\t37386\t/* Lens focal length */\n#define EXIFTAG_SUBJECTAREA\t\t37396\t/* Subject area */\n#define EXIFTAG_MAKERNOTE\t\t37500\t/* Manufacturer notes */\n#define EXIFTAG_USERCOMMENT\t\t37510\t/* User comments */\n#define EXIFTAG_SUBSECTIME\t\t37520\t/* DateTime subseconds */\n#define EXIFTAG_SUBSECTIMEORIGINAL\t37521\t/* DateTimeOriginal subseconds */\n#define EXIFTAG_SUBSECTIMEDIGITIZED\t37522\t/* DateTimeDigitized subseconds */\n#define EXIFTAG_FLASHPIXVERSION\t\t40960\t/* Supported Flashpix version */\n#define EXIFTAG_COLORSPACE\t\t40961\t/* Color space information */\n#define EXIFTAG_PIXELXDIMENSION\t\t40962\t/* Valid image width */\n#define EXIFTAG_PIXELYDIMENSION\t\t40963\t/* Valid image height */\n#define EXIFTAG_RELATEDSOUNDFILE\t40964\t/* Related audio file */\n#define EXIFTAG_FLASHENERGY\t\t41483\t/* Flash energy */\n#define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484\t/* Spatial frequency response */\n#define EXIFTAG_FOCALPLANEXRESOLUTION\t41486\t/* Focal plane X resolution */\n#define EXIFTAG_FOCALPLANEYRESOLUTION\t41487\t/* Focal plane Y resolution */\n#define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488\t/* Focal plane resolution unit */\n#define EXIFTAG_SUBJECTLOCATION\t\t41492\t/* Subject location */\n#define EXIFTAG_EXPOSUREINDEX\t\t41493\t/* Exposure index */\n#define EXIFTAG_SENSINGMETHOD\t\t41495\t/* Sensing method */\n#define EXIFTAG_FILESOURCE\t\t41728\t/* File source */\n#define EXIFTAG_SCENETYPE\t\t41729\t/* Scene type */\n#define EXIFTAG_CFAPATTERN\t\t41730\t/* CFA pattern */\n#define EXIFTAG_CUSTOMRENDERED\t\t41985\t/* Custom image processing */\n#define EXIFTAG_EXPOSUREMODE\t\t41986\t/* Exposure mode */\n#define EXIFTAG_WHITEBALANCE\t\t41987\t/* White balance */\n#define EXIFTAG_DIGITALZOOMRATIO\t41988\t/* Digital zoom ratio */\n#define EXIFTAG_FOCALLENGTHIN35MMFILM\t41989\t/* Focal length in 35 mm film */\n#define EXIFTAG_SCENECAPTURETYPE\t41990\t/* Scene capture type */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_CONTRAST\t\t41992\t/* Contrast */\n#define EXIFTAG_SATURATION\t\t41993\t/* Saturation */\n#define EXIFTAG_SHARPNESS\t\t41994\t/* Sharpness */\n#define EXIFTAG_DEVICESETTINGDESCRIPTION 41995\t/* Device settings description */\n#define EXIFTAG_SUBJECTDISTANCERANGE\t41996\t/* Subject distance range */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_GAINCONTROL\t\t41991\t/* Gain control */\n#define EXIFTAG_IMAGEUNIQUEID\t\t42016\t/* Unique image ID */\n\n#endif /* _TIFF_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/win32/tiffconf.h",
    "content": "/*\n  Configuration defines for installed libtiff.\n  This file maintained for backward compatibility. Do not use definitions\n  from this file in your programs.\n*/\n\n#ifndef _TIFFCONF_\n#define _TIFFCONF_\n\n/* Define to 1 if the system has the type `int16'. */\n/* #undef HAVE_INT16 */\n\n/* Define to 1 if the system has the type `int32'. */\n/* #undef HAVE_INT32 */\n\n/* Define to 1 if the system has the type `int8'. */\n/* #undef HAVE_INT8 */\n\n/* The size of a `int', as computed by sizeof. */\n#define SIZEOF_INT 4\n\n/* Signed 8-bit type */\n#define TIFF_INT8_T signed char\n\n/* Unsigned 8-bit type */\n#define TIFF_UINT8_T unsigned char\n\n/* Signed 16-bit type */\n#define TIFF_INT16_T signed short\n\n/* Unsigned 16-bit type */\n#define TIFF_UINT16_T unsigned short\n\n/* Signed 32-bit type formatter */\n#define TIFF_INT32_FORMAT \"%d\"\n\n/* Signed 32-bit type */\n#define TIFF_INT32_T signed int\n\n/* Unsigned 32-bit type formatter */\n#define TIFF_UINT32_FORMAT \"%u\"\n\n/* Unsigned 32-bit type */\n#define TIFF_UINT32_T unsigned int\n\n/* Signed 64-bit type formatter */\n#define TIFF_INT64_FORMAT \"%I64d\"\n\n/* Signed 64-bit type */\n#define TIFF_INT64_T signed __int64\n\n/* Unsigned 64-bit type formatter */\n#define TIFF_UINT64_FORMAT \"%I64u\"\n\n/* Unsigned 64-bit type */\n#define TIFF_UINT64_T unsigned __int64\n\n/* Signed size type */\n#if defined(_WIN64)\n#define TIFF_SSIZE_T signed __int64\n#else\n#define TIFF_SSIZE_T signed int\n#endif\n\n/* Signed size type formatter */\n#if defined(_WIN64)\n#define TIFF_SSIZE_FORMAT \"%I64d\"\n#else\n#define TIFF_SSIZE_FORMAT \"%ld\"\n#endif\n\n/* Pointer difference type */\n#define TIFF_PTRDIFF_T long\n\n/* Compatibility stuff. */\n\n/* Define as 0 or 1 according to the floating point format suported by the\n   machine */\n#define HAVE_IEEEFP 1\n\n/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */\n#define HOST_FILLORDER FILLORDER_LSB2MSB\n\n/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian\n   (Intel) */\n#define HOST_BIGENDIAN 0\n\n/* Support CCITT Group 3 & 4 algorithms */\n#define CCITT_SUPPORT 1\n\n/* Support JPEG compression (requires IJG JPEG library) */\n/* #undef JPEG_SUPPORT */\n\n/* Support JBIG compression (requires JBIG-KIT library) */\n/* #undef JBIG_SUPPORT */\n\n/* Support LogLuv high dynamic range encoding */\n#define LOGLUV_SUPPORT 1\n\n/* Support LZW algorithm */\n#define LZW_SUPPORT 1\n\n/* Support NeXT 2-bit RLE algorithm */\n#define NEXT_SUPPORT 1\n\n/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation\n   fails with unpatched IJG JPEG library) */\n/* #undef OJPEG_SUPPORT */\n\n/* Support Macintosh PackBits algorithm */\n#define PACKBITS_SUPPORT 1\n\n/* Support Pixar log-format algorithm (requires Zlib) */\n/* #undef PIXARLOG_SUPPORT */\n\n/* Support ThunderScan 4-bit RLE algorithm */\n#define THUNDER_SUPPORT 1\n\n/* Support Deflate compression */\n/* #undef ZIP_SUPPORT */\n\n/* Support strip chopping (whether or not to convert single-strip uncompressed\n   images to mutiple strips of ~8Kb to reduce memory usage) */\n#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP\n\n/* Enable SubIFD tag (330) support */\n#define SUBIFD_SUPPORT 1\n\n/* Treat extra sample as alpha (default enabled). The RGBA interface will\n   treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many\n   packages produce RGBA files but don't mark the alpha properly. */\n#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1\n\n/* Pick up YCbCr subsampling info from the JPEG data stream to support files\n   lacking the tag (default enabled). */\n#define CHECK_JPEG_YCBCR_SUBSAMPLING 1\n\n/* Support MS MDI magic number files as TIFF */\n/* #undef MDI_SUPPORT */\n\n/*\n * Feature support definitions.\n * XXX: These macros are obsoleted. Don't use them in your apps!\n * Macros stays here for backward compatibility and should be always defined.\n */\n#define COLORIMETRY_SUPPORT\n#define YCBCR_SUPPORT\n#define CMYK_SUPPORT\n#define ICC_SUPPORT\n#define PHOTOSHOP_SUPPORT\n#define IPTC_SUPPORT\n\n#endif /* _TIFFCONF_ */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/win32/tiffio.h",
    "content": "/* $Id: tiffio.h,v 1.91 2012-07-29 15:45:29 tgl Exp $ */\n\n/*\n * Copyright (c) 1988-1997 Sam Leffler\n * Copyright (c) 1991-1997 Silicon Graphics, Inc.\n *\n * Permission to use, copy, modify, distribute, and sell this software and\n * its documentation for any purpose is hereby granted without fee, provided\n * that (i) the above copyright notices and this permission notice appear in\n * all copies of the software and related documentation, and (ii) the names of\n * Sam Leffler and Silicon Graphics may not be used in any advertising or\n * publicity relating to the software without the specific, prior written\n * permission of Sam Leffler and Silicon Graphics.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\n * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\n * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\n * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF\n * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE\n * OF THIS SOFTWARE.\n */\n\n#ifndef _TIFFIO_\n#define\t_TIFFIO_\n\n/*\n * TIFF I/O Library Definitions.\n */\n#include \"tiff.h\"\n#include \"tiffvers.h\"\n\n/*\n * TIFF is defined as an incomplete type to hide the\n * library's internal data structures from clients.\n */\ntypedef struct tiff TIFF;\n\n/*\n * The following typedefs define the intrinsic size of\n * data types used in the *exported* interfaces.  These\n * definitions depend on the proper definition of types\n * in tiff.h.  Note also that the varargs interface used\n * to pass tag types and values uses the types defined in\n * tiff.h directly.\n *\n * NB: ttag_t is unsigned int and not unsigned short because\n *     ANSI C requires that the type before the ellipsis be a\n *     promoted type (i.e. one of int, unsigned int, pointer,\n *     or double) and because we defined pseudo-tags that are\n *     outside the range of legal Aldus-assigned tags.\n * NB: tsize_t is int32 and not uint32 because some functions\n *     return -1.\n * NB: toff_t is not off_t for many reasons; TIFFs max out at\n *     32-bit file offsets, and BigTIFF maxes out at 64-bit\n *     offsets being the most important, and to ensure use of\n *     a consistently unsigned type across architectures.\n *     Prior to libtiff 4.0, this was an unsigned 32 bit type.\n */\n/*\n * this is the machine addressing size type, only it's signed, so make it\n * int32 on 32bit machines, int64 on 64bit machines\n */\ntypedef TIFF_SSIZE_T tmsize_t;\ntypedef uint64 toff_t;          /* file offset */\n/* the following are deprecated and should be replaced by their defining\n   counterparts */\ntypedef uint32 ttag_t;          /* directory tag */\ntypedef uint16 tdir_t;          /* directory index */\ntypedef uint16 tsample_t;       /* sample number */\ntypedef uint32 tstrile_t;       /* strip or tile number */\ntypedef tstrile_t tstrip_t;     /* strip number */\ntypedef tstrile_t ttile_t;      /* tile number */\ntypedef tmsize_t tsize_t;       /* i/o size in bytes */\ntypedef void* tdata_t;          /* image data ref */\n\n#if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32))\n#define __WIN32__\n#endif\n\n/*\n * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c\n * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c).\n *\n * By default tif_unix.c is assumed.\n */\n\n#if defined(_WINDOWS) || defined(__WIN32__) || defined(_Windows)\n#  if !defined(__CYGWIN) && !defined(AVOID_WIN32_FILEIO) && !defined(USE_WIN32_FILEIO)\n#    define AVOID_WIN32_FILEIO\n#  endif\n#endif\n\n#if defined(USE_WIN32_FILEIO)\n# define VC_EXTRALEAN\n# include <windows.h>\n# ifdef __WIN32__\nDECLARE_HANDLE(thandle_t);     /* Win32 file handle */\n# else\ntypedef HFILE thandle_t;       /* client data handle */\n# endif /* __WIN32__ */\n#else\ntypedef void* thandle_t;       /* client data handle */\n#endif /* USE_WIN32_FILEIO */\n\n/*\n * Flags to pass to TIFFPrintDirectory to control\n * printing of data structures that are potentially\n * very large.   Bit-or these flags to enable printing\n * multiple items.\n */\n#define TIFFPRINT_NONE\t       0x0    /* no extra info */\n#define TIFFPRINT_STRIPS       0x1    /* strips/tiles info */\n#define TIFFPRINT_CURVES       0x2    /* color/gray response curves */\n#define TIFFPRINT_COLORMAP     0x4    /* colormap */\n#define TIFFPRINT_JPEGQTABLES  0x100  /* JPEG Q matrices */\n#define TIFFPRINT_JPEGACTABLES 0x200  /* JPEG AC tables */\n#define TIFFPRINT_JPEGDCTABLES 0x200  /* JPEG DC tables */\n\n/* \n * Colour conversion stuff\n */\n\n/* reference white */\n#define D65_X0 (95.0470F)\n#define D65_Y0 (100.0F)\n#define D65_Z0 (108.8827F)\n\n#define D50_X0 (96.4250F)\n#define D50_Y0 (100.0F)\n#define D50_Z0 (82.4680F)\n\n/* Structure for holding information about a display device. */\n\ntypedef unsigned char TIFFRGBValue;               /* 8-bit samples */\n\ntypedef struct {\n\tfloat d_mat[3][3];                        /* XYZ -> luminance matrix */\n\tfloat d_YCR;                              /* Light o/p for reference white */\n\tfloat d_YCG;\n\tfloat d_YCB;\n\tuint32 d_Vrwr;                            /* Pixel values for ref. white */\n\tuint32 d_Vrwg;\n\tuint32 d_Vrwb;\n\tfloat d_Y0R;                              /* Residual light for black pixel */\n\tfloat d_Y0G;\n\tfloat d_Y0B;\n\tfloat d_gammaR;                           /* Gamma values for the three guns */\n\tfloat d_gammaG;\n\tfloat d_gammaB;\n} TIFFDisplay;\n\ntypedef struct {                                  /* YCbCr->RGB support */\n\tTIFFRGBValue* clamptab;                   /* range clamping table */\n\tint* Cr_r_tab;\n\tint* Cb_b_tab;\n\tint32* Cr_g_tab;\n\tint32* Cb_g_tab;\n\tint32* Y_tab;\n} TIFFYCbCrToRGB;\n\ntypedef struct {                                  /* CIE Lab 1976->RGB support */\n\tint range;                                /* Size of conversion table */\n#define CIELABTORGB_TABLE_RANGE 1500\n\tfloat rstep, gstep, bstep;\n\tfloat X0, Y0, Z0;                         /* Reference white point */\n\tTIFFDisplay display;\n\tfloat Yr2r[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yr to r */\n\tfloat Yg2g[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yg to g */\n\tfloat Yb2b[CIELABTORGB_TABLE_RANGE + 1];  /* Conversion of Yb to b */\n} TIFFCIELabToRGB;\n\n/*\n * RGBA-style image support.\n */\ntypedef struct _TIFFRGBAImage TIFFRGBAImage;\n/*\n * The image reading and conversion routines invoke\n * ``put routines'' to copy/image/whatever tiles of\n * raw image data.  A default set of routines are \n * provided to convert/copy raw image data to 8-bit\n * packed ABGR format rasters.  Applications can supply\n * alternate routines that unpack the data into a\n * different format or, for example, unpack the data\n * and draw the unpacked raster on the display.\n */\ntypedef void (*tileContigRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*);\ntypedef void (*tileSeparateRoutine)\n    (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,\n\tunsigned char*, unsigned char*, unsigned char*, unsigned char*);\n/*\n * RGBA-reader state.\n */\nstruct _TIFFRGBAImage {\n\tTIFF* tif;                              /* image handle */\n\tint stoponerr;                          /* stop on read error */\n\tint isContig;                           /* data is packed/separate */\n\tint alpha;                              /* type of alpha data present */\n\tuint32 width;                           /* image width */\n\tuint32 height;                          /* image height */\n\tuint16 bitspersample;                   /* image bits/sample */\n\tuint16 samplesperpixel;                 /* image samples/pixel */\n\tuint16 orientation;                     /* image orientation */\n\tuint16 req_orientation;                 /* requested orientation */\n\tuint16 photometric;                     /* image photometric interp */\n\tuint16* redcmap;                        /* colormap pallete */\n\tuint16* greencmap;\n\tuint16* bluecmap;\n\t/* get image data routine */\n\tint (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);\n\t/* put decoded strip/tile */\n\tunion {\n\t    void (*any)(TIFFRGBAImage*);\n\t    tileContigRoutine contig;\n\t    tileSeparateRoutine separate;\n\t} put;\n\tTIFFRGBValue* Map;                      /* sample mapping array */\n\tuint32** BWmap;                         /* black&white map */\n\tuint32** PALmap;                        /* palette image map */\n\tTIFFYCbCrToRGB* ycbcr;                  /* YCbCr conversion state */\n\tTIFFCIELabToRGB* cielab;                /* CIE L*a*b conversion state */\n\n\tuint8* UaToAa;                          /* Unassociated alpha to associated alpha convertion LUT */\n\tuint8* Bitdepth16To8;                   /* LUT for conversion from 16bit to 8bit values */\n\n\tint row_offset;\n\tint col_offset;\n};\n\n/*\n * Macros for extracting components from the\n * packed ABGR form returned by TIFFReadRGBAImage.\n */\n#define TIFFGetR(abgr) ((abgr) & 0xff)\n#define TIFFGetG(abgr) (((abgr) >> 8) & 0xff)\n#define TIFFGetB(abgr) (((abgr) >> 16) & 0xff)\n#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)\n\n/*\n * A CODEC is a software package that implements decoding,\n * encoding, or decoding+encoding of a compression algorithm.\n * The library provides a collection of builtin codecs.\n * More codecs may be registered through calls to the library\n * and/or the builtin implementations may be overridden.\n */\ntypedef int (*TIFFInitMethod)(TIFF*, int);\ntypedef struct {\n\tchar* name;\n\tuint16 scheme;\n\tTIFFInitMethod init;\n} TIFFCodec;\n\n#include <stdio.h>\n#include <stdarg.h>\n\n/* share internal LogLuv conversion routines? */\n#ifndef LOGLUV_PUBLIC\n#define LOGLUV_PUBLIC 1\n#endif\n\n#if !defined(__GNUC__) && !defined(__attribute__)\n#  define __attribute__(x) /*nothing*/\n#endif\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern \"C\" {\n#endif\ntypedef void (*TIFFErrorHandler)(const char*, const char*, va_list);\ntypedef void (*TIFFErrorHandlerExt)(thandle_t, const char*, const char*, va_list);\ntypedef tmsize_t (*TIFFReadWriteProc)(thandle_t, void*, tmsize_t);\ntypedef toff_t (*TIFFSeekProc)(thandle_t, toff_t, int);\ntypedef int (*TIFFCloseProc)(thandle_t);\ntypedef toff_t (*TIFFSizeProc)(thandle_t);\ntypedef int (*TIFFMapFileProc)(thandle_t, void** base, toff_t* size);\ntypedef void (*TIFFUnmapFileProc)(thandle_t, void* base, toff_t size);\ntypedef void (*TIFFExtendProc)(TIFF*);\n\nextern const char* TIFFGetVersion(void);\n\nextern const TIFFCodec* TIFFFindCODEC(uint16);\nextern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);\nextern void TIFFUnRegisterCODEC(TIFFCodec*);\nextern int TIFFIsCODECConfigured(uint16);\nextern TIFFCodec* TIFFGetConfiguredCODECs(void);\n\n/*\n * Auxiliary functions.\n */\n\nextern void* _TIFFmalloc(tmsize_t s);\nextern void* _TIFFrealloc(void* p, tmsize_t s);\nextern void _TIFFmemset(void* p, int v, tmsize_t c);\nextern void _TIFFmemcpy(void* d, const void* s, tmsize_t c);\nextern int _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c);\nextern void _TIFFfree(void* p);\n\n/*\n** Stuff, related to tag handling and creating custom tags.\n*/\nextern int TIFFGetTagListCount( TIFF * );\nextern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );\n    \n#define TIFF_ANY       TIFF_NOTYPE     /* for field descriptor searching */\n#define TIFF_VARIABLE  -1              /* marker for variable length tags */\n#define TIFF_SPP       -2              /* marker for SamplesPerPixel tags */\n#define TIFF_VARIABLE2 -3              /* marker for uint32 var-length tags */\n\n#define FIELD_CUSTOM    65\n\ntypedef struct _TIFFField TIFFField;\ntypedef struct _TIFFFieldArray TIFFFieldArray;\n\nextern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);\nextern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);\nextern const TIFFField* TIFFFieldWithName(TIFF*, const char *);\n\nextern uint32 TIFFFieldTag(const TIFFField*);\nextern const char* TIFFFieldName(const TIFFField*);\nextern TIFFDataType TIFFFieldDataType(const TIFFField*);\nextern int TIFFFieldPassCount(const TIFFField*);\nextern int TIFFFieldReadCount(const TIFFField*);\nextern int TIFFFieldWriteCount(const TIFFField*);\n\ntypedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);\ntypedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);\ntypedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);\n\ntypedef struct {\n    TIFFVSetMethod vsetfield; /* tag set routine */\n    TIFFVGetMethod vgetfield; /* tag get routine */\n    TIFFPrintMethod printdir; /* directory print routine */\n} TIFFTagMethods;\n\nextern  TIFFTagMethods *TIFFAccessTagMethods(TIFF *);\nextern  void *TIFFGetClientInfo(TIFF *, const char *);\nextern  void TIFFSetClientInfo(TIFF *, void *, const char *);\n\nextern void TIFFCleanup(TIFF* tif);\nextern void TIFFClose(TIFF* tif);\nextern int TIFFFlush(TIFF* tif);\nextern int TIFFFlushData(TIFF* tif);\nextern int TIFFGetField(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);\nextern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);\nextern int TIFFReadDirectory(TIFF* tif);\nextern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);\nextern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);\nextern uint64 TIFFScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFScanlineSize(TIFF* tif);\nextern uint64 TIFFRasterScanlineSize64(TIFF* tif);\nextern tmsize_t TIFFRasterScanlineSize(TIFF* tif);\nextern uint64 TIFFStripSize64(TIFF* tif);\nextern tmsize_t TIFFStripSize(TIFF* tif);\nextern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);\nextern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);\nextern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);\nextern uint64 TIFFTileRowSize64(TIFF* tif);\nextern tmsize_t TIFFTileRowSize(TIFF* tif);\nextern uint64 TIFFTileSize64(TIFF* tif);\nextern tmsize_t TIFFTileSize(TIFF* tif);\nextern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);\nextern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);\nextern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);\nextern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);\nextern int TIFFFileno(TIFF*);\nextern int TIFFSetFileno(TIFF*, int);\nextern thandle_t TIFFClientdata(TIFF*);\nextern thandle_t TIFFSetClientdata(TIFF*, thandle_t);\nextern int TIFFGetMode(TIFF*);\nextern int TIFFSetMode(TIFF*, int);\nextern int TIFFIsTiled(TIFF*);\nextern int TIFFIsByteSwapped(TIFF*);\nextern int TIFFIsUpSampled(TIFF*);\nextern int TIFFIsMSB2LSB(TIFF*);\nextern int TIFFIsBigEndian(TIFF*);\nextern TIFFReadWriteProc TIFFGetReadProc(TIFF*);\nextern TIFFReadWriteProc TIFFGetWriteProc(TIFF*);\nextern TIFFSeekProc TIFFGetSeekProc(TIFF*);                                                          \nextern TIFFCloseProc TIFFGetCloseProc(TIFF*);\nextern TIFFSizeProc TIFFGetSizeProc(TIFF*);\nextern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);\nextern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);\nextern uint32 TIFFCurrentRow(TIFF*);\nextern uint16 TIFFCurrentDirectory(TIFF*);\nextern uint16 TIFFNumberOfDirectories(TIFF*);\nextern uint64 TIFFCurrentDirOffset(TIFF*);\nextern uint32 TIFFCurrentStrip(TIFF*);\nextern uint32 TIFFCurrentTile(TIFF* tif);\nextern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);\nextern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);  \nextern int TIFFSetupStrips(TIFF *);\nextern int TIFFWriteCheck(TIFF*, int, const char *);\nextern void TIFFFreeDirectory(TIFF*);\nextern int TIFFCreateDirectory(TIFF*);\nextern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*);\nextern int TIFFCreateEXIFDirectory(TIFF*);\nextern int TIFFLastDirectory(TIFF*);\nextern int TIFFSetDirectory(TIFF*, uint16);\nextern int TIFFSetSubDirectory(TIFF*, uint64);\nextern int TIFFUnlinkDirectory(TIFF*, uint16);\nextern int TIFFSetField(TIFF*, uint32, ...);\nextern int TIFFVSetField(TIFF*, uint32, va_list);\nextern int TIFFUnsetField(TIFF*, uint32);\nextern int TIFFWriteDirectory(TIFF *);\nextern int TIFFWriteCustomDirectory(TIFF *, uint64 *);\nextern int TIFFCheckpointDirectory(TIFF *);\nextern int TIFFRewriteDirectory(TIFF *);\n\n#if defined(c_plusplus) || defined(__cplusplus)\nextern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,\n    int = ORIENTATION_BOTLEFT, int = 0);\n#else\nextern void TIFFPrintDirectory(TIFF*, FILE*, long);\nextern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);\nextern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);\nextern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);\n#endif\n\nextern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );\nextern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );\nextern int TIFFRGBAImageOK(TIFF*, char [1024]);\nextern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);\nextern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);\nextern void TIFFRGBAImageEnd(TIFFRGBAImage*);\nextern TIFF* TIFFOpen(const char*, const char*);\n# ifdef __WIN32__\nextern TIFF* TIFFOpenW(const wchar_t*, const char*);\n# endif /* __WIN32__ */\nextern TIFF* TIFFFdOpen(int, const char*, const char*);\nextern TIFF* TIFFClientOpen(const char*, const char*,\n\t    thandle_t,\n\t    TIFFReadWriteProc, TIFFReadWriteProc,\n\t    TIFFSeekProc, TIFFCloseProc,\n\t    TIFFSizeProc,\n\t    TIFFMapFileProc, TIFFUnmapFileProc);\nextern const char* TIFFFileName(TIFF*);\nextern const char* TIFFSetFileName(TIFF*, const char *);\nextern void TIFFError(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFErrorExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern void TIFFWarning(const char*, const char*, ...) __attribute__((__format__ (__printf__,2,3)));\nextern void TIFFWarningExt(thandle_t, const char*, const char*, ...) __attribute__((__format__ (__printf__,3,4)));\nextern TIFFErrorHandler TIFFSetErrorHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);\nextern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);\nextern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);\nextern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);\nextern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFNumberOfTiles(TIFF*);\nextern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);  \nextern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);\nextern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);\nextern uint32 TIFFNumberOfStrips(TIFF*);\nextern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);\nextern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);  \nextern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);\nextern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);  \nextern int TIFFDataWidth(TIFFDataType);    /* table of tag datatype widths */\nextern void TIFFSetWriteOffset(TIFF* tif, toff_t off);\nextern void TIFFSwabShort(uint16*);\nextern void TIFFSwabLong(uint32*);\nextern void TIFFSwabLong8(uint64*);\nextern void TIFFSwabFloat(float*);\nextern void TIFFSwabDouble(double*);\nextern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);\nextern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);\nextern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);\nextern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);\nextern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);\nextern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);\nextern void TIFFReverseBits(uint8* cp, tmsize_t n);\nextern const unsigned char* TIFFGetBitRevTable(int);\n\n#ifdef LOGLUV_PUBLIC\n#define U_NEU\t\t0.210526316\n#define V_NEU\t\t0.473684211\n#define UVSCALE\t\t410.\nextern double LogL16toY(int);\nextern double LogL10toY(int);\nextern void XYZtoRGB24(float*, uint8*);\nextern int uv_decode(double*, double*, int);\nextern void LogLuv24toXYZ(uint32, float*);\nextern void LogLuv32toXYZ(uint32, float*);\n#if defined(c_plusplus) || defined(__cplusplus)\nextern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);\nextern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);\nextern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);\nextern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);\n#else\nextern int LogL16fromY(double, int);\nextern int LogL10fromY(double, int);\nextern int uv_encode(double, double, int);\nextern uint32 LogLuv24fromXYZ(float*, int);\nextern uint32 LogLuv32fromXYZ(float*, int);\n#endif\n#endif /* LOGLUV_PUBLIC */\n\nextern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);\nextern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,\n    float *, float *, float *);\nextern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,\n    uint32 *, uint32 *, uint32 *);\n\nextern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);\nextern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,\n    uint32 *, uint32 *, uint32 *);\n\n/****************************************************************************\n *               O B S O L E T E D    I N T E R F A C E S\n *\n * Don't use this stuff in your applications, it may be removed in the future\n * libtiff versions.\n ****************************************************************************/\ntypedef\tstruct {\n\tttag_t\tfield_tag;\t\t/* field's tag */\n\tshort\tfield_readcount;\t/* read count/TIFF_VARIABLE/TIFF_SPP */\n\tshort\tfield_writecount;\t/* write count/TIFF_VARIABLE */\n\tTIFFDataType field_type;\t/* type of associated data */\n        unsigned short field_bit;\t/* bit in fieldsset bit vector */\n\tunsigned char field_oktochange;\t/* if true, can change while writing */\n\tunsigned char field_passcount;\t/* if true, pass dir count on set */\n\tchar\t*field_name;\t\t/* ASCII name */\n} TIFFFieldInfo;\n\nextern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);\n        \n#if defined(c_plusplus) || defined(__cplusplus)\n}\n#endif\n\n#endif /* _TIFFIO_ */\n\n/* vim: set ts=8 sts=8 sw=8 noet: */\n/*\n * Local Variables:\n * mode: c\n * c-basic-offset: 8\n * fill-column: 78\n * End:\n */\n"
  },
  {
    "path": "cocos2d/external/tiff/include/win32/tiffvers.h",
    "content": "#define TIFFLIB_VERSION_STR \"LIBTIFF, Version 4.0.3\\nCopyright (c) 1988-1996 Sam Leffler\\nCopyright (c) 1991-1996 Silicon Graphics, Inc.\"\n/*\n * This define can be used in code that requires\n * compilation-related definitions specific to a\n * version or versions of the library.  Runtime\n * version checking should be done based on the\n * string returned by TIFFGetVersion.\n */\n#define TIFFLIB_VERSION 20120922\n"
  },
  {
    "path": "cocos2d/external/tiff/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE := cocos_tiff_static\nLOCAL_MODULE_FILENAME := tiff\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libtiff.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/tinyxml2/CMakeLists.txt",
    "content": "set(TINYXML2_SRC\n  tinyxml2.cpp\n)\n\nadd_library(tinyxml2 STATIC\n  ${TINYXML2_SRC}\n)\n\nset_target_properties(tinyxml2\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/external/tinyxml2/tinyxml2.cpp",
    "content": "/*\nOriginal code by Lee Thomason (www.grinninglizard.com)\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any\ndamages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any\npurpose, including commercial applications, and to alter it and\nredistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must\nnot claim that you wrote the original software. If you use this\nsoftware in a product, an acknowledgment in the product documentation\nwould be appreciated but is not required.\n\n2. Altered source versions must be plainly marked as such, and\nmust not be misrepresented as being the original software.\n\n3. This notice may not be removed or altered from any source\ndistribution.\n*/\n\n#include \"tinyxml2.h\"\n\n#include <new>\t\t// yes, this one new style header, is in the Android SDK.\n#   if defined(ANDROID_NDK) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)\n#   include <stddef.h>\n#else\n#   include <cstddef>\n#endif\n\nstatic const char LINE_FEED\t\t\t\t= (char)0x0a;\t\t\t// all line endings are normalized to LF\nstatic const char LF = LINE_FEED;\nstatic const char CARRIAGE_RETURN\t\t= (char)0x0d;\t\t\t// CR gets filtered out\nstatic const char CR = CARRIAGE_RETURN;\nstatic const char SINGLE_QUOTE\t\t\t= '\\'';\nstatic const char DOUBLE_QUOTE\t\t\t= '\\\"';\n\n// Bunch of unicode info at:\n//\t\thttp://www.unicode.org/faq/utf_bom.html\n//\tef bb bf (Microsoft \"lead bytes\") - designates UTF-8\n\nstatic const unsigned char TIXML_UTF_LEAD_0 = 0xefU;\nstatic const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;\nstatic const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;\n\n\n#define DELETE_NODE( node )\t{\t\t\t\\\n        if ( node ) {\t\t\t\t\t\t\\\n            MemPool* pool = node->_memPool;\t\\\n            node->~XMLNode();\t\t\t\t\\\n            pool->Free( node );\t\t\t\t\\\n        }\t\t\t\t\t\t\t\t\t\\\n    }\n#define DELETE_ATTRIBUTE( attrib ) {\t\t\\\n        if ( attrib ) {\t\t\t\t\t\t\t\\\n            MemPool* pool = attrib->_memPool;\t\\\n            attrib->~XMLAttribute();\t\t\t\\\n            pool->Free( attrib );\t\t\t\t\\\n        }\t\t\t\t\t\t\t\t\t\t\\\n    }\n\nnamespace tinyxml2\n{\n\nstruct Entity {\n    const char* pattern;\n    int length;\n    char value;\n};\n\nstatic const int NUM_ENTITIES = 5;\nstatic const Entity entities[NUM_ENTITIES] = {\n    { \"quot\", 4,\tDOUBLE_QUOTE },\n    { \"amp\", 3,\t\t'&'  },\n    { \"apos\", 4,\tSINGLE_QUOTE },\n    { \"lt\",\t2, \t\t'<'\t },\n    { \"gt\",\t2,\t\t'>'\t }\n};\n\n\nStrPair::~StrPair()\n{\n    Reset();\n}\n\n\nvoid StrPair::Reset()\n{\n    if ( _flags & NEEDS_DELETE ) {\n        delete [] _start;\n    }\n    _flags = 0;\n    _start = 0;\n    _end = 0;\n}\n\n\nvoid StrPair::SetStr( const char* str, int flags )\n{\n    Reset();\n    size_t len = strlen( str );\n    _start = new char[ len+1 ];\n    memcpy( _start, str, len+1 );\n    _end = _start + len;\n    _flags = flags | NEEDS_DELETE;\n}\n\n\nchar* StrPair::ParseText( char* p, const char* endTag, int strFlags )\n{\n    TIXMLASSERT( endTag && *endTag );\n\n    char* start = p;\t// fixme: hides a member\n    char  endChar = *endTag;\n    size_t length = strlen( endTag );\n\n    // Inner loop of text parsing.\n    while ( *p ) {\n        if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) {\n            Set( start, p, strFlags );\n            return p + length;\n        }\n        ++p;\n    }\n    return 0;\n}\n\n\nchar* StrPair::ParseName( char* p )\n{\n    char* start = p;\n\n    if ( !start || !(*start) ) {\n        return 0;\n    }\n\n    while( *p && (\n                XMLUtil::IsAlphaNum( (unsigned char) *p )\n                || *p == '_'\n                || *p == ':'\n                || (*p == '-' && p>start )\t\t// can be in a name, but not lead it.\n                || (*p == '.' && p>start ) )) {\t// can be in a name, but not lead it.\n        ++p;\n    }\n\n    if ( p > start ) {\n        Set( start, p, 0 );\n        return p;\n    }\n    return 0;\n}\n\n\nvoid StrPair::CollapseWhitespace()\n{\n    // Trim leading space.\n    _start = XMLUtil::SkipWhiteSpace( _start );\n\n    if ( _start && *_start ) {\n        char* p = _start;\t// the read pointer\n        char* q = _start;\t// the write pointer\n\n        while( *p ) {\n            if ( XMLUtil::IsWhiteSpace( *p )) {\n                p = XMLUtil::SkipWhiteSpace( p );\n                if ( *p == 0 ) {\n                    break;    // don't write to q; this trims the trailing space.\n                }\n                *q = ' ';\n                ++q;\n            }\n            *q = *p;\n            ++q;\n            ++p;\n        }\n        *q = 0;\n    }\n}\n\n\nconst char* StrPair::GetStr()\n{\n    if ( _flags & NEEDS_FLUSH ) {\n        *_end = 0;\n        _flags ^= NEEDS_FLUSH;\n\n        if ( _flags ) {\n            char* p = _start;\t// the read pointer\n            char* q = _start;\t// the write pointer\n\n            while( p < _end ) {\n                if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) {\n                    // CR-LF pair becomes LF\n                    // CR alone becomes LF\n                    // LF-CR becomes LF\n                    if ( *(p+1) == LF ) {\n                        p += 2;\n                    }\n                    else {\n                        ++p;\n                    }\n                    *q++ = LF;\n                }\n                else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {\n                    if ( *(p+1) == CR ) {\n                        p += 2;\n                    }\n                    else {\n                        ++p;\n                    }\n                    *q++ = LF;\n                }\n                else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {\n                    // Entities handled by tinyXML2:\n                    // - special entities in the entity table [in/out]\n                    // - numeric character reference [in]\n                    //   &#20013; or &#x4e2d;\n\n                    if ( *(p+1) == '#' ) {\n                        char buf[10] = { 0 };\n                        int len;\n                        p = const_cast<char*>( XMLUtil::GetCharacterRef( p, buf, &len ) );\n                        for( int i=0; i<len; ++i ) {\n                            *q++ = buf[i];\n                        }\n                        TIXMLASSERT( q <= p );\n                    }\n                    else {\n                        int i=0;\n                        for(; i<NUM_ENTITIES; ++i ) {\n                            if (    strncmp( p+1, entities[i].pattern, entities[i].length ) == 0\n                                    && *(p+entities[i].length+1) == ';' ) {\n                                // Found an entity convert;\n                                *q = entities[i].value;\n                                ++q;\n                                p += entities[i].length + 2;\n                                break;\n                            }\n                        }\n                        if ( i == NUM_ENTITIES ) {\n                            // fixme: treat as error?\n                            ++p;\n                            ++q;\n                        }\n                    }\n                }\n                else {\n                    *q = *p;\n                    ++p;\n                    ++q;\n                }\n            }\n            *q = 0;\n        }\n        // The loop below has plenty going on, and this\n        // is a less useful mode. Break it out.\n        if ( _flags & COLLAPSE_WHITESPACE ) {\n            CollapseWhitespace();\n        }\n        _flags = (_flags & NEEDS_DELETE);\n    }\n    return _start;\n}\n\n\n\n\n// --------- XMLUtil ----------- //\n\nconst char* XMLUtil::ReadBOM( const char* p, bool* bom )\n{\n    *bom = false;\n    const unsigned char* pu = reinterpret_cast<const unsigned char*>(p);\n    // Check for BOM:\n    if (    *(pu+0) == TIXML_UTF_LEAD_0\n            && *(pu+1) == TIXML_UTF_LEAD_1\n            && *(pu+2) == TIXML_UTF_LEAD_2 ) {\n        *bom = true;\n        p += 3;\n    }\n    return p;\n}\n\n\nvoid XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length )\n{\n    const unsigned long BYTE_MASK = 0xBF;\n    const unsigned long BYTE_MARK = 0x80;\n    const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };\n\n    if (input < 0x80) {\n        *length = 1;\n    }\n    else if ( input < 0x800 ) {\n        *length = 2;\n    }\n    else if ( input < 0x10000 ) {\n        *length = 3;\n    }\n    else if ( input < 0x200000 ) {\n        *length = 4;\n    }\n    else {\n        *length = 0;    // This code won't covert this correctly anyway.\n        return;\n    }\n\n    output += *length;\n\n    // Scary scary fall throughs.\n    switch (*length) {\n        case 4:\n            --output;\n            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\n            input >>= 6;\n        case 3:\n            --output;\n            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\n            input >>= 6;\n        case 2:\n            --output;\n            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\n            input >>= 6;\n        case 1:\n            --output;\n            *output = (char)(input | FIRST_BYTE_MARK[*length]);\n        default:\n            break;\n    }\n}\n\n\nconst char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )\n{\n    // Presume an entity, and pull it out.\n    *length = 0;\n\n    if ( *(p+1) == '#' && *(p+2) ) {\n        unsigned long ucs = 0;\n        ptrdiff_t delta = 0;\n        unsigned mult = 1;\n\n        if ( *(p+2) == 'x' ) {\n            // Hexadecimal.\n            if ( !*(p+3) ) {\n                return 0;\n            }\n\n            const char* q = p+3;\n            q = strchr( q, ';' );\n\n            if ( !q || !*q ) {\n                return 0;\n            }\n\n            delta = q-p;\n            --q;\n\n            while ( *q != 'x' ) {\n                if ( *q >= '0' && *q <= '9' ) {\n                    ucs += mult * (*q - '0');\n                }\n                else if ( *q >= 'a' && *q <= 'f' ) {\n                    ucs += mult * (*q - 'a' + 10);\n                }\n                else if ( *q >= 'A' && *q <= 'F' ) {\n                    ucs += mult * (*q - 'A' + 10 );\n                }\n                else {\n                    return 0;\n                }\n                mult *= 16;\n                --q;\n            }\n        }\n        else {\n            // Decimal.\n            if ( !*(p+2) ) {\n                return 0;\n            }\n\n            const char* q = p+2;\n            q = strchr( q, ';' );\n\n            if ( !q || !*q ) {\n                return 0;\n            }\n\n            delta = q-p;\n            --q;\n\n            while ( *q != '#' ) {\n                if ( *q >= '0' && *q <= '9' ) {\n                    ucs += mult * (*q - '0');\n                }\n                else {\n                    return 0;\n                }\n                mult *= 10;\n                --q;\n            }\n        }\n        // convert the UCS to UTF-8\n        ConvertUTF32ToUTF8( ucs, value, length );\n        return p + delta + 1;\n    }\n    return p+1;\n}\n\n\nvoid XMLUtil::ToStr( int v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%d\", v );\n}\n\n\nvoid XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%u\", v );\n}\n\n\nvoid XMLUtil::ToStr( bool v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%d\", v ? 1 : 0 );\n}\n\n\nvoid XMLUtil::ToStr( float v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%g\", v );\n}\n\n\nvoid XMLUtil::ToStr( double v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%g\", v );\n}\n\n\nbool XMLUtil::ToInt( const char* str, int* value )\n{\n    if ( TIXML_SSCANF( str, \"%d\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\nbool XMLUtil::ToUnsigned( const char* str, unsigned *value )\n{\n    if ( TIXML_SSCANF( str, \"%u\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\nbool XMLUtil::ToBool( const char* str, bool* value )\n{\n    int ival = 0;\n    if ( ToInt( str, &ival )) {\n        *value = (ival==0) ? false : true;\n        return true;\n    }\n    if ( StringEqual( str, \"true\" ) ) {\n        *value = true;\n        return true;\n    }\n    else if ( StringEqual( str, \"false\" ) ) {\n        *value = false;\n        return true;\n    }\n    return false;\n}\n\n\nbool XMLUtil::ToFloat( const char* str, float* value )\n{\n    if ( TIXML_SSCANF( str, \"%f\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\nbool XMLUtil::ToDouble( const char* str, double* value )\n{\n    if ( TIXML_SSCANF( str, \"%lf\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\n\nchar* XMLDocument::Identify( char* p, XMLNode** node )\n{\n    XMLNode* returnNode = 0;\n    char* start = p;\n    p = XMLUtil::SkipWhiteSpace( p );\n    if( !p || !*p ) {\n        return p;\n    }\n\n    // What is this thing?\n    // - Elements start with a letter or underscore, but xml is reserved.\n    // - Comments: <!--\n    // - Decleration: <?\n    // - Everthing else is unknown to tinyxml.\n    //\n\n    static const char* xmlHeader\t\t= { \"<?\" };\n    static const char* commentHeader\t= { \"<!--\" };\n    static const char* dtdHeader\t\t= { \"<!\" };\n    static const char* cdataHeader\t\t= { \"<![CDATA[\" };\n    static const char* elementHeader\t= { \"<\" };\t// and a header for everything else; check last.\n\n    static const int xmlHeaderLen\t\t= 2;\n    static const int commentHeaderLen\t= 4;\n    static const int dtdHeaderLen\t\t= 2;\n    static const int cdataHeaderLen\t\t= 9;\n    static const int elementHeaderLen\t= 1;\n\n#if defined(_MSC_VER)\n#pragma warning ( push )\n#pragma warning ( disable : 4127 )\n#endif\n    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) );\t\t// use same memory pool\n    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) );\t// use same memory pool\n#if defined(_MSC_VER)\n#pragma warning (pop)\n#endif\n    if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {\n        returnNode = new (_commentPool.Alloc()) XMLDeclaration( this );\n        returnNode->_memPool = &_commentPool;\n        p += xmlHeaderLen;\n    }\n    else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) {\n        returnNode = new (_commentPool.Alloc()) XMLComment( this );\n        returnNode->_memPool = &_commentPool;\n        p += commentHeaderLen;\n    }\n    else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) {\n        XMLText* text = new (_textPool.Alloc()) XMLText( this );\n        returnNode = text;\n        returnNode->_memPool = &_textPool;\n        p += cdataHeaderLen;\n        text->SetCData( true );\n    }\n    else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) {\n        returnNode = new (_commentPool.Alloc()) XMLUnknown( this );\n        returnNode->_memPool = &_commentPool;\n        p += dtdHeaderLen;\n    }\n    else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) {\n        returnNode = new (_elementPool.Alloc()) XMLElement( this );\n        returnNode->_memPool = &_elementPool;\n        p += elementHeaderLen;\n    }\n    else {\n        returnNode = new (_textPool.Alloc()) XMLText( this );\n        returnNode->_memPool = &_textPool;\n        p = start;\t// Back it up, all the text counts.\n    }\n\n    *node = returnNode;\n    return p;\n}\n\n\nbool XMLDocument::Accept( XMLVisitor* visitor ) const\n{\n    if ( visitor->VisitEnter( *this ) ) {\n        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\n            if ( !node->Accept( visitor ) ) {\n                break;\n            }\n        }\n    }\n    return visitor->VisitExit( *this );\n}\n\n\n// --------- XMLNode ----------- //\n\nXMLNode::XMLNode( XMLDocument* doc ) :\n    _document( doc ),\n    _parent( 0 ),\n    _firstChild( 0 ), _lastChild( 0 ),\n    _prev( 0 ), _next( 0 )\n{\n}\n\n\nXMLNode::~XMLNode()\n{\n    DeleteChildren();\n    if ( _parent ) {\n        _parent->Unlink( this );\n    }\n}\n\n\nvoid XMLNode::SetValue( const char* str, bool staticMem )\n{\n    if ( staticMem ) {\n        _value.SetInternedStr( str );\n    }\n    else {\n        _value.SetStr( str );\n    }\n}\n\n\nvoid XMLNode::DeleteChildren()\n{\n    while( _firstChild ) {\n        XMLNode* node = _firstChild;\n        Unlink( node );\n\n        DELETE_NODE( node );\n    }\n    _firstChild = _lastChild = 0;\n}\n\n\nvoid XMLNode::Unlink( XMLNode* child )\n{\n    TIXMLASSERT( child->_parent == this );\n    if ( child == _firstChild ) {\n        _firstChild = _firstChild->_next;\n    }\n    if ( child == _lastChild ) {\n        _lastChild = _lastChild->_prev;\n    }\n\n    if ( child->_prev ) {\n        child->_prev->_next = child->_next;\n    }\n    if ( child->_next ) {\n        child->_next->_prev = child->_prev;\n    }\n    child->_parent = 0;\n}\n\n\nvoid XMLNode::DeleteChild( XMLNode* node )\n{\n    TIXMLASSERT( node->_parent == this );\n    DELETE_NODE( node );\n}\n\n\nXMLNode* XMLNode::InsertEndChild( XMLNode* addThis )\n{\n    if ( _lastChild ) {\n        TIXMLASSERT( _firstChild );\n        TIXMLASSERT( _lastChild->_next == 0 );\n        _lastChild->_next = addThis;\n        addThis->_prev = _lastChild;\n        _lastChild = addThis;\n\n        addThis->_next = 0;\n    }\n    else {\n        TIXMLASSERT( _firstChild == 0 );\n        _firstChild = _lastChild = addThis;\n\n        addThis->_prev = 0;\n        addThis->_next = 0;\n    }\n    addThis->_parent = this;\n    addThis->_memPool->SetTracked();\n    return addThis;\n}\n\n\nXMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )\n{\n    if ( _firstChild ) {\n        TIXMLASSERT( _lastChild );\n        TIXMLASSERT( _firstChild->_prev == 0 );\n\n        _firstChild->_prev = addThis;\n        addThis->_next = _firstChild;\n        _firstChild = addThis;\n\n        addThis->_prev = 0;\n    }\n    else {\n        TIXMLASSERT( _lastChild == 0 );\n        _firstChild = _lastChild = addThis;\n\n        addThis->_prev = 0;\n        addThis->_next = 0;\n    }\n    addThis->_parent = this;\n    addThis->_memPool->SetTracked();\n    return addThis;\n}\n\n\nXMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )\n{\n    TIXMLASSERT( afterThis->_parent == this );\n    if ( afterThis->_parent != this ) {\n        return 0;\n    }\n\n    if ( afterThis->_next == 0 ) {\n        // The last node or the only node.\n        return InsertEndChild( addThis );\n    }\n    addThis->_prev = afterThis;\n    addThis->_next = afterThis->_next;\n    afterThis->_next->_prev = addThis;\n    afterThis->_next = addThis;\n    addThis->_parent = this;\n    addThis->_memPool->SetTracked();\n    return addThis;\n}\n\n\n\n\nconst XMLElement* XMLNode::FirstChildElement( const char* value ) const\n{\n    for( XMLNode* node=_firstChild; node; node=node->_next ) {\n        XMLElement* element = node->ToElement();\n        if ( element ) {\n            if ( !value || XMLUtil::StringEqual( element->Name(), value ) ) {\n                return element;\n            }\n        }\n    }\n    return 0;\n}\n\n\nconst XMLElement* XMLNode::LastChildElement( const char* value ) const\n{\n    for( XMLNode* node=_lastChild; node; node=node->_prev ) {\n        XMLElement* element = node->ToElement();\n        if ( element ) {\n            if ( !value || XMLUtil::StringEqual( element->Name(), value ) ) {\n                return element;\n            }\n        }\n    }\n    return 0;\n}\n\n\nconst XMLElement* XMLNode::NextSiblingElement( const char* value ) const\n{\n    for( XMLNode* element=this->_next; element; element = element->_next ) {\n        if (    element->ToElement()\n                && (!value || XMLUtil::StringEqual( value, element->Value() ))) {\n            return element->ToElement();\n        }\n    }\n    return 0;\n}\n\n\nconst XMLElement* XMLNode::PreviousSiblingElement( const char* value ) const\n{\n    for( XMLNode* element=_prev; element; element = element->_prev ) {\n        if (    element->ToElement()\n                && (!value || XMLUtil::StringEqual( value, element->Value() ))) {\n            return element->ToElement();\n        }\n    }\n    return 0;\n}\n\n\nchar* XMLNode::ParseDeep( char* p, StrPair* parentEnd )\n{\n    // This is a recursive method, but thinking about it \"at the current level\"\n    // it is a pretty simple flat list:\n    //\t\t<foo/>\n    //\t\t<!-- comment -->\n    //\n    // With a special case:\n    //\t\t<foo>\n    //\t\t</foo>\n    //\t\t<!-- comment -->\n    //\n    // Where the closing element (/foo) *must* be the next thing after the opening\n    // element, and the names must match. BUT the tricky bit is that the closing\n    // element will be read by the child.\n    //\n    // 'endTag' is the end tag for this node, it is returned by a call to a child.\n    // 'parentEnd' is the end tag for the parent, which is filled in and returned.\n\n    while( p && *p ) {\n        XMLNode* node = 0;\n\n        p = _document->Identify( p, &node );\n        if ( p == 0 || node == 0 ) {\n            break;\n        }\n\n        StrPair endTag;\n        p = node->ParseDeep( p, &endTag );\n        if ( !p ) {\n            DELETE_NODE( node );\n            node = 0;\n            if ( !_document->Error() ) {\n                _document->SetError( XML_ERROR_PARSING, 0, 0 );\n            }\n            break;\n        }\n\n        // We read the end tag. Return it to the parent.\n        if ( node->ToElement() && node->ToElement()->ClosingType() == XMLElement::CLOSING ) {\n            if ( parentEnd ) {\n                *parentEnd = static_cast<XMLElement*>(node)->_value;\n            }\n\t\t\tnode->_memPool->SetTracked();\t// created and then immediately deleted.\n            DELETE_NODE( node );\n            return p;\n        }\n\n        // Handle an end tag returned to this level.\n        // And handle a bunch of annoying errors.\n        XMLElement* ele = node->ToElement();\n        if ( ele ) {\n            if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) {\n                _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 );\n                p = 0;\n            }\n            else if ( !endTag.Empty() && ele->ClosingType() != XMLElement::OPEN ) {\n                _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 );\n                p = 0;\n            }\n            else if ( !endTag.Empty() ) {\n                if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() )) {\n                    _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 );\n                    p = 0;\n                }\n            }\n        }\n        if ( p == 0 ) {\n            DELETE_NODE( node );\n            node = 0;\n        }\n        if ( node ) {\n            this->InsertEndChild( node );\n        }\n    }\n    return 0;\n}\n\n// --------- XMLText ---------- //\nchar* XMLText::ParseDeep( char* p, StrPair* )\n{\n    const char* start = p;\n    if ( this->CData() ) {\n        p = _value.ParseText( p, \"]]>\", StrPair::NEEDS_NEWLINE_NORMALIZATION );\n        if ( !p ) {\n            _document->SetError( XML_ERROR_PARSING_CDATA, start, 0 );\n        }\n        return p;\n    }\n    else {\n        int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES;\n        if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) {\n            flags |= StrPair::COLLAPSE_WHITESPACE;\n        }\n\n        p = _value.ParseText( p, \"<\", flags );\n        if ( !p ) {\n            _document->SetError( XML_ERROR_PARSING_TEXT, start, 0 );\n        }\n        if ( p && *p ) {\n            return p-1;\n        }\n    }\n    return 0;\n}\n\n\nXMLNode* XMLText::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLText* text = doc->NewText( Value() );\t// fixme: this will always allocate memory. Intern?\n    text->SetCData( this->CData() );\n    return text;\n}\n\n\nbool XMLText::ShallowEqual( const XMLNode* compare ) const\n{\n    return ( compare->ToText() && XMLUtil::StringEqual( compare->ToText()->Value(), Value() ));\n}\n\n\nbool XMLText::Accept( XMLVisitor* visitor ) const\n{\n    return visitor->Visit( *this );\n}\n\n\n// --------- XMLComment ---------- //\n\nXMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc )\n{\n}\n\n\nXMLComment::~XMLComment()\n{\n}\n\n\nchar* XMLComment::ParseDeep( char* p, StrPair* )\n{\n    // Comment parses as text.\n    const char* start = p;\n    p = _value.ParseText( p, \"-->\", StrPair::COMMENT );\n    if ( p == 0 ) {\n        _document->SetError( XML_ERROR_PARSING_COMMENT, start, 0 );\n    }\n    return p;\n}\n\n\nXMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLComment* comment = doc->NewComment( Value() );\t// fixme: this will always allocate memory. Intern?\n    return comment;\n}\n\n\nbool XMLComment::ShallowEqual( const XMLNode* compare ) const\n{\n    return ( compare->ToComment() && XMLUtil::StringEqual( compare->ToComment()->Value(), Value() ));\n}\n\n\nbool XMLComment::Accept( XMLVisitor* visitor ) const\n{\n    return visitor->Visit( *this );\n}\n\n\n// --------- XMLDeclaration ---------- //\n\nXMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc )\n{\n}\n\n\nXMLDeclaration::~XMLDeclaration()\n{\n    //printf( \"~XMLDeclaration\\n\" );\n}\n\n\nchar* XMLDeclaration::ParseDeep( char* p, StrPair* )\n{\n    // Declaration parses as text.\n    const char* start = p;\n    p = _value.ParseText( p, \"?>\", StrPair::NEEDS_NEWLINE_NORMALIZATION );\n    if ( p == 0 ) {\n        _document->SetError( XML_ERROR_PARSING_DECLARATION, start, 0 );\n    }\n    return p;\n}\n\n\nXMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLDeclaration* dec = doc->NewDeclaration( Value() );\t// fixme: this will always allocate memory. Intern?\n    return dec;\n}\n\n\nbool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const\n{\n    return ( compare->ToDeclaration() && XMLUtil::StringEqual( compare->ToDeclaration()->Value(), Value() ));\n}\n\n\n\nbool XMLDeclaration::Accept( XMLVisitor* visitor ) const\n{\n    return visitor->Visit( *this );\n}\n\n// --------- XMLUnknown ---------- //\n\nXMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc )\n{\n}\n\n\nXMLUnknown::~XMLUnknown()\n{\n}\n\n\nchar* XMLUnknown::ParseDeep( char* p, StrPair* )\n{\n    // Unknown parses as text.\n    const char* start = p;\n\n    p = _value.ParseText( p, \">\", StrPair::NEEDS_NEWLINE_NORMALIZATION );\n    if ( !p ) {\n        _document->SetError( XML_ERROR_PARSING_UNKNOWN, start, 0 );\n    }\n    return p;\n}\n\n\nXMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLUnknown* text = doc->NewUnknown( Value() );\t// fixme: this will always allocate memory. Intern?\n    return text;\n}\n\n\nbool XMLUnknown::ShallowEqual( const XMLNode* compare ) const\n{\n    return ( compare->ToUnknown() && XMLUtil::StringEqual( compare->ToUnknown()->Value(), Value() ));\n}\n\n\nbool XMLUnknown::Accept( XMLVisitor* visitor ) const\n{\n    return visitor->Visit( *this );\n}\n\n// --------- XMLAttribute ---------- //\nchar* XMLAttribute::ParseDeep( char* p, bool processEntities )\n{\n    // Parse using the name rules: bug fix, was using ParseText before\n    p = _name.ParseName( p );\n    if ( !p || !*p ) {\n        return 0;\n    }\n\n    // Skip white space before =\n    p = XMLUtil::SkipWhiteSpace( p );\n    if ( !p || *p != '=' ) {\n        return 0;\n    }\n\n    ++p;\t// move up to opening quote\n    p = XMLUtil::SkipWhiteSpace( p );\n    if ( *p != '\\\"' && *p != '\\'' ) {\n        return 0;\n    }\n\n    char endTag[2] = { *p, 0 };\n    ++p;\t// move past opening quote\n\n    p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES );\n    return p;\n}\n\n\nvoid XMLAttribute::SetName( const char* n )\n{\n    _name.SetStr( n );\n}\n\n\nXMLError XMLAttribute::QueryIntValue( int* value ) const\n{\n    if ( XMLUtil::ToInt( Value(), value )) {\n        return XML_NO_ERROR;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const\n{\n    if ( XMLUtil::ToUnsigned( Value(), value )) {\n        return XML_NO_ERROR;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryBoolValue( bool* value ) const\n{\n    if ( XMLUtil::ToBool( Value(), value )) {\n        return XML_NO_ERROR;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryFloatValue( float* value ) const\n{\n    if ( XMLUtil::ToFloat( Value(), value )) {\n        return XML_NO_ERROR;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryDoubleValue( double* value ) const\n{\n    if ( XMLUtil::ToDouble( Value(), value )) {\n        return XML_NO_ERROR;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nvoid XMLAttribute::SetAttribute( const char* v )\n{\n    _value.SetStr( v );\n}\n\n\nvoid XMLAttribute::SetAttribute( int v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\n\nvoid XMLAttribute::SetAttribute( unsigned v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\n\nvoid XMLAttribute::SetAttribute( bool v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\nvoid XMLAttribute::SetAttribute( double v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\nvoid XMLAttribute::SetAttribute( float v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\n\n// --------- XMLElement ---------- //\nXMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ),\n    _closingType( 0 ),\n    _rootAttribute( 0 )\n{\n}\n\n\nXMLElement::~XMLElement()\n{\n    while( _rootAttribute ) {\n        XMLAttribute* next = _rootAttribute->_next;\n        DELETE_ATTRIBUTE( _rootAttribute );\n        _rootAttribute = next;\n    }\n}\n\n\nXMLAttribute* XMLElement::FindAttribute( const char* name )\n{\n    XMLAttribute* a = 0;\n    for( a=_rootAttribute; a; a = a->_next ) {\n        if ( XMLUtil::StringEqual( a->Name(), name ) ) {\n            return a;\n        }\n    }\n    return 0;\n}\n\n\nconst XMLAttribute* XMLElement::FindAttribute( const char* name ) const\n{\n    XMLAttribute* a = 0;\n    for( a=_rootAttribute; a; a = a->_next ) {\n        if ( XMLUtil::StringEqual( a->Name(), name ) ) {\n            return a;\n        }\n    }\n    return 0;\n}\n\n\nconst char* XMLElement::Attribute( const char* name, const char* value ) const\n{\n    const XMLAttribute* a = FindAttribute( name );\n    if ( !a ) {\n        return 0;\n    }\n    if ( !value || XMLUtil::StringEqual( a->Value(), value )) {\n        return a->Value();\n    }\n    return 0;\n}\n\n\nconst char* XMLElement::GetText() const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        return FirstChild()->ToText()->Value();\n    }\n    return 0;\n}\n\n\nXMLError XMLElement::QueryIntText( int* ival ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->ToText()->Value();\n        if ( XMLUtil::ToInt( t, ival ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryUnsignedText( unsigned* uval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->ToText()->Value();\n        if ( XMLUtil::ToUnsigned( t, uval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryBoolText( bool* bval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->ToText()->Value();\n        if ( XMLUtil::ToBool( t, bval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryDoubleText( double* dval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->ToText()->Value();\n        if ( XMLUtil::ToDouble( t, dval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryFloatText( float* fval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->ToText()->Value();\n        if ( XMLUtil::ToFloat( t, fval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\n\nXMLAttribute* XMLElement::FindOrCreateAttribute( const char* name )\n{\n    XMLAttribute* last = 0;\n    XMLAttribute* attrib = 0;\n    for( attrib = _rootAttribute;\n            attrib;\n            last = attrib, attrib = attrib->_next ) {\n        if ( XMLUtil::StringEqual( attrib->Name(), name ) ) {\n            break;\n        }\n    }\n    if ( !attrib ) {\n        attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\n        attrib->_memPool = &_document->_attributePool;\n        if ( last ) {\n            last->_next = attrib;\n        }\n        else {\n            _rootAttribute = attrib;\n        }\n        attrib->SetName( name );\n        attrib->_memPool->SetTracked(); // always created and linked.\n    }\n    return attrib;\n}\n\n\nvoid XMLElement::DeleteAttribute( const char* name )\n{\n    XMLAttribute* prev = 0;\n    for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) {\n        if ( XMLUtil::StringEqual( name, a->Name() ) ) {\n            if ( prev ) {\n                prev->_next = a->_next;\n            }\n            else {\n                _rootAttribute = a->_next;\n            }\n            DELETE_ATTRIBUTE( a );\n            break;\n        }\n        prev = a;\n    }\n}\n\n\nchar* XMLElement::ParseAttributes( char* p )\n{\n    const char* start = p;\n    XMLAttribute* prevAttribute = 0;\n\n    // Read the attributes.\n    while( p ) {\n        p = XMLUtil::SkipWhiteSpace( p );\n        if ( !p || !(*p) ) {\n            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() );\n            return 0;\n        }\n\n        // attribute.\n        if ( XMLUtil::IsAlpha( *p ) ) {\n            XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\n            attrib->_memPool = &_document->_attributePool;\n\t\t\tattrib->_memPool->SetTracked();\n\n            p = attrib->ParseDeep( p, _document->ProcessEntities() );\n            if ( !p || Attribute( attrib->Name() ) ) {\n                DELETE_ATTRIBUTE( attrib );\n                _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p );\n                return 0;\n            }\n            // There is a minor bug here: if the attribute in the source xml\n            // document is duplicated, it will not be detected and the\n            // attribute will be doubly added. However, tracking the 'prevAttribute'\n            // avoids re-scanning the attribute list. Preferring performance for\n            // now, may reconsider in the future.\n            if ( prevAttribute ) {\n                prevAttribute->_next = attrib;\n            }\n            else {\n                _rootAttribute = attrib;\n            }\n            prevAttribute = attrib;\n        }\n        // end of the tag\n        else if ( *p == '/' && *(p+1) == '>' ) {\n            _closingType = CLOSED;\n            return p+2;\t// done; sealed element.\n        }\n        // end of the tag\n        else if ( *p == '>' ) {\n            ++p;\n            break;\n        }\n        else {\n            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p );\n            return 0;\n        }\n    }\n    return p;\n}\n\n\n//\n//\t<ele></ele>\n//\t<ele>foo<b>bar</b></ele>\n//\nchar* XMLElement::ParseDeep( char* p, StrPair* strPair )\n{\n    // Read the element name.\n    p = XMLUtil::SkipWhiteSpace( p );\n    if ( !p ) {\n        return 0;\n    }\n\n    // The closing element is the </element> form. It is\n    // parsed just like a regular element then deleted from\n    // the DOM.\n    if ( *p == '/' ) {\n        _closingType = CLOSING;\n        ++p;\n    }\n\n    p = _value.ParseName( p );\n    if ( _value.Empty() ) {\n        return 0;\n    }\n\n    p = ParseAttributes( p );\n    if ( !p || !*p || _closingType ) {\n        return p;\n    }\n\n    p = XMLNode::ParseDeep( p, strPair );\n    return p;\n}\n\n\n\nXMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLElement* element = doc->NewElement( Value() );\t\t\t\t\t// fixme: this will always allocate memory. Intern?\n    for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) {\n        element->SetAttribute( a->Name(), a->Value() );\t\t\t\t\t// fixme: this will always allocate memory. Intern?\n    }\n    return element;\n}\n\n\nbool XMLElement::ShallowEqual( const XMLNode* compare ) const\n{\n    const XMLElement* other = compare->ToElement();\n    if ( other && XMLUtil::StringEqual( other->Value(), Value() )) {\n\n        const XMLAttribute* a=FirstAttribute();\n        const XMLAttribute* b=other->FirstAttribute();\n\n        while ( a && b ) {\n            if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) {\n                return false;\n            }\n            a = a->Next();\n            b = b->Next();\n        }\n        if ( a || b ) {\n            // different count\n            return false;\n        }\n        return true;\n    }\n    return false;\n}\n\n\nbool XMLElement::Accept( XMLVisitor* visitor ) const\n{\n    if ( visitor->VisitEnter( *this, _rootAttribute ) ) {\n        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\n            if ( !node->Accept( visitor ) ) {\n                break;\n            }\n        }\n    }\n    return visitor->VisitExit( *this );\n}\n\n\n// --------- XMLDocument ----------- //\nXMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) :\n    XMLNode( 0 ),\n    _writeBOM( false ),\n    _processEntities( processEntities ),\n    _errorID( XML_NO_ERROR ),\n    _whitespace( whitespace ),\n    _errorStr1( 0 ),\n    _errorStr2( 0 ),\n    _charBuffer( 0 )\n{\n    _document = this;\t// avoid warning about 'this' in initializer list\n}\n\n\nXMLDocument::~XMLDocument()\n{\n    DeleteChildren();\n    delete [] _charBuffer;\n\n#if 0\n    textPool.Trace( \"text\" );\n    elementPool.Trace( \"element\" );\n    commentPool.Trace( \"comment\" );\n    attributePool.Trace( \"attribute\" );\n#endif\n\n#ifdef DEBUG\n\tif ( Error() == false ) {\n\t\tTIXMLASSERT( _elementPool.CurrentAllocs()   == _elementPool.Untracked() );\n\t\tTIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() );\n\t\tTIXMLASSERT( _textPool.CurrentAllocs()      == _textPool.Untracked() );\n\t\tTIXMLASSERT( _commentPool.CurrentAllocs()   == _commentPool.Untracked() );\n\t}\n#endif\n}\n\n\nvoid XMLDocument::InitDocument()\n{\n    _errorID = XML_NO_ERROR;\n    _errorStr1 = 0;\n    _errorStr2 = 0;\n\n    delete [] _charBuffer;\n    _charBuffer = 0;\n}\n\n\nXMLElement* XMLDocument::NewElement( const char* name )\n{\n    XMLElement* ele = new (_elementPool.Alloc()) XMLElement( this );\n    ele->_memPool = &_elementPool;\n    ele->SetName( name );\n    return ele;\n}\n\n\nXMLComment* XMLDocument::NewComment( const char* str )\n{\n    XMLComment* comment = new (_commentPool.Alloc()) XMLComment( this );\n    comment->_memPool = &_commentPool;\n    comment->SetValue( str );\n    return comment;\n}\n\n\nXMLText* XMLDocument::NewText( const char* str )\n{\n    XMLText* text = new (_textPool.Alloc()) XMLText( this );\n    text->_memPool = &_textPool;\n    text->SetValue( str );\n    return text;\n}\n\n\nXMLDeclaration* XMLDocument::NewDeclaration( const char* str )\n{\n    XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration( this );\n    dec->_memPool = &_commentPool;\n    dec->SetValue( str ? str : \"xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\" );\n    return dec;\n}\n\n\nXMLUnknown* XMLDocument::NewUnknown( const char* str )\n{\n    XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown( this );\n    unk->_memPool = &_commentPool;\n    unk->SetValue( str );\n    return unk;\n}\n\n\nXMLError XMLDocument::LoadFile( const char* filename )\n{\n    DeleteChildren();\n    InitDocument();\n    FILE* fp = 0;\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)\n    errno_t err = fopen_s(&fp, filename, \"rb\" );\n    if ( !fp || err) {\n#else\n    fp = fopen( filename, \"rb\" );\n    if ( !fp) {\n#endif\n        SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 );\n        return _errorID;\n    }\n    LoadFile( fp );\n    fclose( fp );\n    return _errorID;\n}\n\n\nXMLError XMLDocument::LoadFile( FILE* fp )\n{\n    DeleteChildren();\n    InitDocument();\n\n    fseek( fp, 0, SEEK_END );\n    size_t size = ftell( fp );\n    fseek( fp, 0, SEEK_SET );\n\n    if ( size == 0 ) {\n        return _errorID;\n    }\n\n    _charBuffer = new char[size+1];\n    size_t read = fread( _charBuffer, 1, size, fp );\n    if ( read != size ) {\n        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\n        return _errorID;\n    }\n\n    _charBuffer[size] = 0;\n\n    const char* p = _charBuffer;\n    p = XMLUtil::SkipWhiteSpace( p );\n    p = XMLUtil::ReadBOM( p, &_writeBOM );\n    if ( !p || !*p ) {\n        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\n        return _errorID;\n    }\n\n    ParseDeep( _charBuffer + (p-_charBuffer), 0 );\n    return _errorID;\n}\n\n\nXMLError XMLDocument::SaveFile( const char* filename, bool compact )\n{\n    FILE* fp = 0;\n#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)\n    errno_t err = fopen_s(&fp, filename, \"w\" );\n    if ( !fp || err) {\n#else\n    fp = fopen( filename, \"w\" );\n    if ( !fp) {\n#endif\n        SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );\n        return _errorID;\n    }\n    SaveFile(fp, compact);\n    fclose( fp );\n    return _errorID;\n}\n\n\nXMLError XMLDocument::SaveFile( FILE* fp, bool compact )\n{\n    XMLPrinter stream( fp, compact );\n    Print( &stream );\n    return _errorID;\n}\n\n\nXMLError XMLDocument::Parse( const char* p, size_t len )\n{\n    DeleteChildren();\n    InitDocument();\n\n    if ( !p || !*p ) {\n        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\n        return _errorID;\n    }\n    if ( len == (size_t)(-1) ) {\n        len = strlen( p );\n    }\n    _charBuffer = new char[ len+1 ];\n    memcpy( _charBuffer, p, len );\n    _charBuffer[len] = 0;\n\n    p = XMLUtil::SkipWhiteSpace( p );\n    p = XMLUtil::ReadBOM( p, &_writeBOM );\n    if ( !p || !*p ) {\n        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\n        return _errorID;\n    }\n\n    ParseDeep( _charBuffer, 0 );\n    return _errorID;\n}\n\n\nvoid XMLDocument::Print( XMLPrinter* streamer )\n{\n    XMLPrinter stdStreamer( stdout );\n    if ( !streamer ) {\n        streamer = &stdStreamer;\n    }\n    Accept( streamer );\n}\n\n\nvoid XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )\n{\n    _errorID = error;\n    _errorStr1 = str1;\n    _errorStr2 = str2;\n}\n\n\nvoid XMLDocument::PrintError() const\n{\n    if ( _errorID ) {\n        static const int LEN = 20;\n        char buf1[LEN] = { 0 };\n        char buf2[LEN] = { 0 };\n\n        if ( _errorStr1 ) {\n            TIXML_SNPRINTF( buf1, LEN, \"%s\", _errorStr1 );\n        }\n        if ( _errorStr2 ) {\n            TIXML_SNPRINTF( buf2, LEN, \"%s\", _errorStr2 );\n        }\n\n        printf( \"XMLDocument error id=%d str1=%s str2=%s\\n\",\n                _errorID, buf1, buf2 );\n    }\n}\n\n\nXMLPrinter::XMLPrinter( FILE* file, bool compact ) :\n    _elementJustOpened( false ),\n    _firstElement( true ),\n    _fp( file ),\n    _depth( 0 ),\n    _textDepth( -1 ),\n    _processEntities( true ),\n    _compactMode( compact )\n{\n    for( int i=0; i<ENTITY_RANGE; ++i ) {\n        _entityFlag[i] = false;\n        _restrictedEntityFlag[i] = false;\n    }\n    for( int i=0; i<NUM_ENTITIES; ++i ) {\n        TIXMLASSERT( entities[i].value < ENTITY_RANGE );\n        if ( entities[i].value < ENTITY_RANGE ) {\n            _entityFlag[ (int)entities[i].value ] = true;\n        }\n    }\n    _restrictedEntityFlag[(int)'&'] = true;\n    _restrictedEntityFlag[(int)'<'] = true;\n    _restrictedEntityFlag[(int)'>'] = true;\t// not required, but consistency is nice\n    _buffer.Push( 0 );\n}\n\n\nvoid XMLPrinter::Print( const char* format, ... )\n{\n    va_list     va;\n    va_start( va, format );\n\n    if ( _fp ) {\n        vfprintf( _fp, format, va );\n    }\n    else {\n        // This seems brutally complex. Haven't figured out a better\n        // way on windows.\n#if defined _MSC_VER && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)\n        int len = -1;\n        int expand = 1000;\n        while ( len < 0 ) {\n            len = vsnprintf_s( _accumulator.Mem(), _accumulator.Capacity(), _TRUNCATE, format, va );\n            if ( len < 0 ) {\n                expand *= 3/2;\n                _accumulator.PushArr( expand );\n            }\n        }\n        char* p = _buffer.PushArr( len ) - 1;\n        memcpy( p, _accumulator.Mem(), len+1 );\n#else\n        int len = vsnprintf( 0, 0, format, va );\n        // Close out and re-start the va-args\n        va_end( va );\n        va_start( va, format );\n        char* p = _buffer.PushArr( len ) - 1;\n        vsnprintf( p, len+1, format, va );\n#endif\n    }\n    va_end( va );\n}\n\n\nvoid XMLPrinter::PrintSpace( int depth )\n{\n    for( int i=0; i<depth; ++i ) {\n        Print( \"    \" );\n    }\n}\n\n\nvoid XMLPrinter::PrintString( const char* p, bool restricted )\n{\n    // Look for runs of bytes between entities to print.\n    const char* q = p;\n    const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;\n\n    if ( _processEntities ) {\n        while ( *q ) {\n            // Remember, char is sometimes signed. (How many times has that bitten me?)\n            if ( *q > 0 && *q < ENTITY_RANGE ) {\n                // Check for entities. If one is found, flush\n                // the stream up until the entity, write the\n                // entity, and keep looking.\n                if ( flag[(unsigned)(*q)] ) {\n                    while ( p < q ) {\n                        Print( \"%c\", *p );\n                        ++p;\n                    }\n                    for( int i=0; i<NUM_ENTITIES; ++i ) {\n                        if ( entities[i].value == *q ) {\n                            Print( \"&%s;\", entities[i].pattern );\n                            break;\n                        }\n                    }\n                    ++p;\n                }\n            }\n            ++q;\n        }\n    }\n    // Flush the remaining string. This will be the entire\n    // string if an entity wasn't found.\n    if ( !_processEntities || (q-p > 0) ) {\n        Print( \"%s\", p );\n    }\n}\n\n\nvoid XMLPrinter::PushHeader( bool writeBOM, bool writeDec )\n{\n    static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 };\n    if ( writeBOM ) {\n        Print( \"%s\", bom );\n    }\n    if ( writeDec ) {\n        PushDeclaration( \"xml version=\\\"1.0\\\"\" );\n    }\n}\n\n\nvoid XMLPrinter::OpenElement( const char* name )\n{\n    if ( _elementJustOpened ) {\n        SealElement();\n    }\n    _stack.Push( name );\n\n    if ( _textDepth < 0 && !_firstElement && !_compactMode ) {\n        Print( \"\\n\" );\n        PrintSpace( _depth );\n    }\n\n    Print( \"<%s\", name );\n    _elementJustOpened = true;\n    _firstElement = false;\n    ++_depth;\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, const char* value )\n{\n    TIXMLASSERT( _elementJustOpened );\n    Print( \" %s=\\\"\", name );\n    PrintString( value, false );\n    Print( \"\\\"\" );\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, int v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, unsigned v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, bool v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, double v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::CloseElement()\n{\n    --_depth;\n    const char* name = _stack.Pop();\n\n    if ( _elementJustOpened ) {\n        Print( \"/>\" );\n    }\n    else {\n        if ( _textDepth < 0 && !_compactMode) {\n            Print( \"\\n\" );\n            PrintSpace( _depth );\n        }\n        Print( \"</%s>\", name );\n    }\n\n    if ( _textDepth == _depth ) {\n        _textDepth = -1;\n    }\n    if ( _depth == 0 && !_compactMode) {\n        Print( \"\\n\" );\n    }\n    _elementJustOpened = false;\n}\n\n\nvoid XMLPrinter::SealElement()\n{\n    _elementJustOpened = false;\n    Print( \">\" );\n}\n\n\nvoid XMLPrinter::PushText( const char* text, bool cdata )\n{\n    _textDepth = _depth-1;\n\n    if ( _elementJustOpened ) {\n        SealElement();\n    }\n    if ( cdata ) {\n        Print( \"<![CDATA[\" );\n        Print( \"%s\", text );\n        Print( \"]]>\" );\n    }\n    else {\n        PrintString( text, true );\n    }\n}\n\nvoid XMLPrinter::PushText( int value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( unsigned value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( bool value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( float value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( double value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushComment( const char* comment )\n{\n    if ( _elementJustOpened ) {\n        SealElement();\n    }\n    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\n        Print( \"\\n\" );\n        PrintSpace( _depth );\n    }\n    _firstElement = false;\n    Print( \"<!--%s-->\", comment );\n}\n\n\nvoid XMLPrinter::PushDeclaration( const char* value )\n{\n    if ( _elementJustOpened ) {\n        SealElement();\n    }\n    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\n        Print( \"\\n\" );\n        PrintSpace( _depth );\n    }\n    _firstElement = false;\n    Print( \"<?%s?>\", value );\n}\n\n\nvoid XMLPrinter::PushUnknown( const char* value )\n{\n    if ( _elementJustOpened ) {\n        SealElement();\n    }\n    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\n        Print( \"\\n\" );\n        PrintSpace( _depth );\n    }\n    _firstElement = false;\n    Print( \"<!%s>\", value );\n}\n\n\nbool XMLPrinter::VisitEnter( const XMLDocument& doc )\n{\n    _processEntities = doc.ProcessEntities();\n    if ( doc.HasBOM() ) {\n        PushHeader( true, false );\n    }\n    return true;\n}\n\n\nbool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute )\n{\n    OpenElement( element.Name() );\n    while ( attribute ) {\n        PushAttribute( attribute->Name(), attribute->Value() );\n        attribute = attribute->Next();\n    }\n    return true;\n}\n\n\nbool XMLPrinter::VisitExit( const XMLElement& )\n{\n    CloseElement();\n    return true;\n}\n\n\nbool XMLPrinter::Visit( const XMLText& text )\n{\n    PushText( text.Value(), text.CData() );\n    return true;\n}\n\n\nbool XMLPrinter::Visit( const XMLComment& comment )\n{\n    PushComment( comment.Value() );\n    return true;\n}\n\nbool XMLPrinter::Visit( const XMLDeclaration& declaration )\n{\n    PushDeclaration( declaration.Value() );\n    return true;\n}\n\n\nbool XMLPrinter::Visit( const XMLUnknown& unknown )\n{\n    PushUnknown( unknown.Value() );\n    return true;\n}\n\n}   // namespace tinyxml2\n\n"
  },
  {
    "path": "cocos2d/external/tinyxml2/tinyxml2.h",
    "content": "/*\nOriginal code by Lee Thomason (www.grinninglizard.com)\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any\ndamages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any\npurpose, including commercial applications, and to alter it and\nredistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must\nnot claim that you wrote the original software. If you use this\nsoftware in a product, an acknowledgment in the product documentation\nwould be appreciated but is not required.\n\n2. Altered source versions must be plainly marked as such, and\nmust not be misrepresented as being the original software.\n\n3. This notice may not be removed or altered from any source\ndistribution.\n*/\n\n#ifndef TINYXML2_INCLUDED\n#define TINYXML2_INCLUDED\n\n#include \"CCPlatformConfig.h\"\n#include \"CCPlatformMacros.h\"\n\n#if defined(ANDROID_NDK) || defined(__BORLANDC__) || (CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY)\n#   include <ctype.h>\n#   include <limits.h>\n#   include <stdio.h>\n#   include <stdlib.h>\n#   include <string.h>\n#   include <stdarg.h>\n#else\n#   include <cctype>\n#   include <climits>\n#   include <cstdio>\n#   include <cstdlib>\n#   include <cstring>\n#   include <cstdarg>\n#endif\n\n/*\n   TODO: intern strings instead of allocation.\n*/\n/*\n\tgcc:\n        g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe\n\n    Formatting, Artistic Style:\n        AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h\n*/\n\n#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__)\n#   ifndef DEBUG\n#       define DEBUG\n#   endif\n#endif\n\n\n#if defined(DEBUG)\n#   if defined(_MSC_VER)\n#       define TIXMLASSERT( x )           if ( !(x)) { __debugbreak(); } //if ( !(x)) WinDebugBreak()\n#   elif defined (ANDROID_NDK)\n#       include <android/log.h>\n#       define TIXMLASSERT( x )           if ( !(x)) { __android_log_assert( \"assert\", \"grinliz\", \"ASSERT in '%s' at %d.\", __FILE__, __LINE__ ); }\n#   else\n#       include <assert.h>\n#       define TIXMLASSERT                assert\n#   endif\n#   else\n#       define TIXMLASSERT( x )           {}\n#endif\n\n\n#if (defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE))\n// Microsoft visual studio, version 2005 and higher.\n/*int _snprintf_s(\n   char *buffer,\n   size_t sizeOfBuffer,\n   size_t count,\n   const char *format [,\n\t  argument] ...\n);*/\ninline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )\n{\n    va_list va;\n    va_start( va, format );\n    int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\n    va_end( va );\n    return result;\n}\n#define TIXML_SSCANF   sscanf_s\n#else\n// GCC version 3 and higher\n//#warning( \"Using sn* functions.\" )\n#define TIXML_SNPRINTF snprintf\n#define TIXML_SSCANF   sscanf\n#endif\n\nstatic const int TIXML2_MAJOR_VERSION = 1;\nstatic const int TIXML2_MINOR_VERSION = 0;\nstatic const int TIXML2_PATCH_VERSION = 9;\n\nnamespace tinyxml2\n{\nclass XMLDocument;\nclass XMLElement;\nclass XMLAttribute;\nclass XMLComment;\nclass XMLNode;\nclass XMLText;\nclass XMLDeclaration;\nclass XMLUnknown;\n\nclass XMLPrinter;\n\n/*\n\tA class that wraps strings. Normally stores the start and end\n\tpointers into the XML file itself, and will apply normalization\n\tand entity translation if actually read. Can also store (and memory\n\tmanage) a traditional char[]\n*/\nclass CC_DLL StrPair\n{\npublic:\n    enum {\n        NEEDS_ENTITY_PROCESSING\t\t\t= 0x01,\n        NEEDS_NEWLINE_NORMALIZATION\t\t= 0x02,\n        COLLAPSE_WHITESPACE\t\t\t\t= 0x04,\n\n        TEXT_ELEMENT\t\t            = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\n        TEXT_ELEMENT_LEAVE_ENTITIES\t\t= NEEDS_NEWLINE_NORMALIZATION,\n        ATTRIBUTE_NAME\t\t            = 0,\n        ATTRIBUTE_VALUE\t\t            = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\n        ATTRIBUTE_VALUE_LEAVE_ENTITIES  = NEEDS_NEWLINE_NORMALIZATION,\n        COMMENT\t\t\t\t            = NEEDS_NEWLINE_NORMALIZATION\n    };\n\n    StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}\n    ~StrPair();\n\n    void Set( char* start, char* end, int flags ) {\n        Reset();\n        _start  = start;\n        _end    = end;\n        _flags  = flags | NEEDS_FLUSH;\n    }\n\n    const char* GetStr();\n\n    bool Empty() const {\n        return _start == _end;\n    }\n\n    void SetInternedStr( const char* str ) {\n        Reset();\n        _start = const_cast<char*>(str);\n    }\n\n    void SetStr( const char* str, int flags=0 );\n\n    char* ParseText( char* in, const char* endTag, int strFlags );\n    char* ParseName( char* in );\n\nprivate:\n    void Reset();\n    void CollapseWhitespace();\n\n    enum {\n        NEEDS_FLUSH = 0x100,\n        NEEDS_DELETE = 0x200\n    };\n\n    // After parsing, if *end != 0, it can be set to zero.\n    int     _flags;\n    char*   _start;\n    char*   _end;\n};\n\n\n/*\n\tA dynamic array of Plain Old Data. Doesn't support constructors, etc.\n\tHas a small initial memory pool, so that low or no usage will not\n\tcause a call to new/delete\n*/\ntemplate <class T, int INIT>\nclass CC_DLL DynArray\n{\npublic:\n    DynArray< T, INIT >() {\n        _mem = _pool;\n        _allocated = INIT;\n        _size = 0;\n    }\n\n    ~DynArray() {\n        if ( _mem != _pool ) {\n            delete [] _mem;\n        }\n    }\n\n    void Push( T t ) {\n        EnsureCapacity( _size+1 );\n        _mem[_size++] = t;\n    }\n\n    T* PushArr( int count ) {\n        EnsureCapacity( _size+count );\n        T* ret = &_mem[_size];\n        _size += count;\n        return ret;\n    }\n\n    T Pop() {\n        return _mem[--_size];\n    }\n\n    void PopArr( int count ) {\n        TIXMLASSERT( _size >= count );\n        _size -= count;\n    }\n\n    bool Empty() const\t\t\t\t\t{\n        return _size == 0;\n    }\n\n    T& operator[](int i)\t\t\t\t{\n        TIXMLASSERT( i>= 0 && i < _size );\n        return _mem[i];\n    }\n\n    const T& operator[](int i) const\t{\n        TIXMLASSERT( i>= 0 && i < _size );\n        return _mem[i];\n    }\n\n    int Size() const\t\t\t\t\t{\n        return _size;\n    }\n\n    int Capacity() const\t\t\t\t{\n        return _allocated;\n    }\n\n    const T* Mem() const\t\t\t\t{\n        return _mem;\n    }\n\n    T* Mem()\t\t\t\t\t\t\t{\n        return _mem;\n    }\n\nprivate:\n    void EnsureCapacity( int cap ) {\n        if ( cap > _allocated ) {\n            int newAllocated = cap * 2;\n            T* newMem = new T[newAllocated];\n            memcpy( newMem, _mem, sizeof(T)*_size );\t// warning: not using constructors, only works for PODs\n            if ( _mem != _pool ) {\n                delete [] _mem;\n            }\n            _mem = newMem;\n            _allocated = newAllocated;\n        }\n    }\n\n    T*  _mem;\n    T   _pool[INIT];\n    int _allocated;\t\t// objects allocated\n    int _size;\t\t\t// number objects in use\n};\n\n\n/*\n\tParent virtual class of a pool for fast allocation\n\tand deallocation of objects.\n*/\nclass CC_DLL MemPool\n{\npublic:\n    MemPool() {}\n    virtual ~MemPool() {}\n\n    virtual int ItemSize() const = 0;\n    virtual void* Alloc() = 0;\n    virtual void Free( void* ) = 0;\n    virtual void SetTracked() = 0;\n};\n\n\n/*\n\tTemplate child class to create pools of the correct type.\n*/\ntemplate< int SIZE >\nclass CC_DLL MemPoolT : public MemPool\n{\npublic:\n    MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0)\t{}\n    ~MemPoolT() {\n        // Delete the blocks.\n        for( int i=0; i<_blockPtrs.Size(); ++i ) {\n            delete _blockPtrs[i];\n        }\n    }\n\n    virtual int ItemSize() const\t{\n        return SIZE;\n    }\n    int CurrentAllocs() const\t\t{\n        return _currentAllocs;\n    }\n\n    virtual void* Alloc() {\n        if ( !_root ) {\n            // Need a new block.\n            Block* block = new Block();\n            _blockPtrs.Push( block );\n\n            for( int i=0; i<COUNT-1; ++i ) {\n                block->chunk[i].next = &block->chunk[i+1];\n            }\n            block->chunk[COUNT-1].next = 0;\n            _root = block->chunk;\n        }\n        void* result = _root;\n        _root = _root->next;\n\n        ++_currentAllocs;\n        if ( _currentAllocs > _maxAllocs ) {\n            _maxAllocs = _currentAllocs;\n        }\n        _nAllocs++;\n        _nUntracked++;\n        return result;\n    }\n    virtual void Free( void* mem ) {\n        if ( !mem ) {\n            return;\n        }\n        --_currentAllocs;\n        Chunk* chunk = (Chunk*)mem;\n#ifdef DEBUG\n        memset( chunk, 0xfe, sizeof(Chunk) );\n#endif\n        chunk->next = _root;\n        _root = chunk;\n    }\n    void Trace( const char* name ) {\n        printf( \"Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\\n\",\n                name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() );\n    }\n\n    void SetTracked() {\n        _nUntracked--;\n    }\n\n    int Untracked() const {\n        return _nUntracked;\n    }\n\n    enum { COUNT = 1024/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private\n\nprivate:\n    union Chunk {\n        Chunk*  next;\n        char    mem[SIZE];\n    };\n    struct Block {\n        Chunk chunk[COUNT];\n    };\n    DynArray< Block*, 10 > _blockPtrs;\n    Chunk* _root;\n\n    int _currentAllocs;\n    int _nAllocs;\n    int _maxAllocs;\n    int _nUntracked;\n};\n\n\n\n/**\n\tImplements the interface to the \"Visitor pattern\" (see the Accept() method.)\n\tIf you call the Accept() method, it requires being passed a XMLVisitor\n\tclass to handle callbacks. For nodes that contain other nodes (Document, Element)\n\tyou will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs\n\tare simply called with Visit().\n\n\tIf you return 'true' from a Visit method, recursive parsing will continue. If you return\n\tfalse, <b>no children of this node or its sibilings</b> will be visited.\n\n\tAll flavors of Visit methods have a default implementation that returns 'true' (continue\n\tvisiting). You need to only override methods that are interesting to you.\n\n\tGenerally Accept() is called on the TiXmlDocument, although all nodes support visiting.\n\n\tYou should never change the document from a callback.\n\n\t@sa XMLNode::Accept()\n*/\nclass CC_DLL XMLVisitor\n{\npublic:\n    virtual ~XMLVisitor() {}\n\n    /// Visit a document.\n    virtual bool VisitEnter( const XMLDocument& /*doc*/ )\t\t\t{\n        return true;\n    }\n    /// Visit a document.\n    virtual bool VisitExit( const XMLDocument& /*doc*/ )\t\t\t{\n        return true;\n    }\n\n    /// Visit an element.\n    virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ )\t{\n        return true;\n    }\n    /// Visit an element.\n    virtual bool VisitExit( const XMLElement& /*element*/ )\t\t\t{\n        return true;\n    }\n\n    /// Visit a declaration.\n    virtual bool Visit( const XMLDeclaration& /*declaration*/ )\t\t{\n        return true;\n    }\n    /// Visit a text node.\n    virtual bool Visit( const XMLText& /*text*/ )\t\t\t\t\t{\n        return true;\n    }\n    /// Visit a comment node.\n    virtual bool Visit( const XMLComment& /*comment*/ )\t\t\t\t{\n        return true;\n    }\n    /// Visit an unknown node.\n    virtual bool Visit( const XMLUnknown& /*unknown*/ )\t\t\t\t{\n        return true;\n    }\n};\n\n\n/*\n\tUtility functionality.\n*/\nclass CC_DLL XMLUtil\n{\npublic:\n    // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't\n    // correct, but simple, and usually works.\n    static const char* SkipWhiteSpace( const char* p )\t{\n        while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast<const unsigned char*>(p) ) ) {\n            ++p;\n        }\n        return p;\n    }\n    static char* SkipWhiteSpace( char* p )\t\t\t\t{\n        while( !IsUTF8Continuation(*p) && isspace( *reinterpret_cast<unsigned char*>(p) ) )\t\t{\n            ++p;\n        }\n        return p;\n    }\n    static bool IsWhiteSpace( char p )\t\t\t\t\t{\n        return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );\n    }\n\n    inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX )  {\n        int n = 0;\n        if ( p == q ) {\n            return true;\n        }\n        while( *p && *q && *p == *q && n<nChar ) {\n            ++p;\n            ++q;\n            ++n;\n        }\n        if ( (n == nChar) || ( *p == 0 && *q == 0 ) ) {\n            return true;\n        }\n        return false;\n    }\n    inline static int IsUTF8Continuation( const char p ) {\n        return p & 0x80;\n    }\n    inline static int IsAlphaNum( unsigned char anyByte )\t{\n        return ( anyByte < 128 ) ? isalnum( anyByte ) : 1;\n    }\n    inline static int IsAlpha( unsigned char anyByte )\t\t{\n        return ( anyByte < 128 ) ? isalpha( anyByte ) : 1;\n    }\n\n    static const char* ReadBOM( const char* p, bool* hasBOM );\n    // p is the starting location,\n    // the UTF-8 value of the entity will be placed in value, and length filled in.\n    static const char* GetCharacterRef( const char* p, char* value, int* length );\n    static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );\n\n    // converts primitive types to strings\n    static void ToStr( int v, char* buffer, int bufferSize );\n    static void ToStr( unsigned v, char* buffer, int bufferSize );\n    static void ToStr( bool v, char* buffer, int bufferSize );\n    static void ToStr( float v, char* buffer, int bufferSize );\n    static void ToStr( double v, char* buffer, int bufferSize );\n\n    // converts strings to primitive types\n    static bool\tToInt( const char* str, int* value );\n    static bool ToUnsigned( const char* str, unsigned* value );\n    static bool\tToBool( const char* str, bool* value );\n    static bool\tToFloat( const char* str, float* value );\n    static bool ToDouble( const char* str, double* value );\n};\n\n\n/** XMLNode is a base class for every object that is in the\n\tXML Document Object Model (DOM), except XMLAttributes.\n\tNodes have siblings, a parent, and children which can\n\tbe navigated. A node is always in a XMLDocument.\n\tThe type of a XMLNode can be queried, and it can\n\tbe cast to its more defined type.\n\n\tA XMLDocument allocates memory for all its Nodes.\n\tWhen the XMLDocument gets deleted, all its Nodes\n\twill also be deleted.\n\n\t@verbatim\n\tA Document can contain:\tElement\t(container or leaf)\n\t\t\t\t\t\t\tComment (leaf)\n\t\t\t\t\t\t\tUnknown (leaf)\n\t\t\t\t\t\t\tDeclaration( leaf )\n\n\tAn Element can contain:\tElement (container or leaf)\n\t\t\t\t\t\t\tText\t(leaf)\n\t\t\t\t\t\t\tAttributes (not on tree)\n\t\t\t\t\t\t\tComment (leaf)\n\t\t\t\t\t\t\tUnknown (leaf)\n\n\t@endverbatim\n*/\nclass CC_DLL XMLNode\n{\n    friend class XMLDocument;\n    friend class XMLElement;\npublic:\n\n    /// Get the XMLDocument that owns this XMLNode.\n    const XMLDocument* GetDocument() const\t{\n        return _document;\n    }\n    /// Get the XMLDocument that owns this XMLNode.\n    XMLDocument* GetDocument()\t\t\t\t{\n        return _document;\n    }\n\n    /// Safely cast to an Element, or null.\n    virtual XMLElement*\t\tToElement()\t\t{\n        return 0;\n    }\n    /// Safely cast to Text, or null.\n    virtual XMLText*\t\tToText()\t\t{\n        return 0;\n    }\n    /// Safely cast to a Comment, or null.\n    virtual XMLComment*\t\tToComment()\t\t{\n        return 0;\n    }\n    /// Safely cast to a Document, or null.\n    virtual XMLDocument*\tToDocument()\t{\n        return 0;\n    }\n    /// Safely cast to a Declaration, or null.\n    virtual XMLDeclaration*\tToDeclaration()\t{\n        return 0;\n    }\n    /// Safely cast to an Unknown, or null.\n    virtual XMLUnknown*\t\tToUnknown()\t\t{\n        return 0;\n    }\n\n    virtual const XMLElement*\t\tToElement() const\t\t{\n        return 0;\n    }\n    virtual const XMLText*\t\t\tToText() const\t\t\t{\n        return 0;\n    }\n    virtual const XMLComment*\t\tToComment() const\t\t{\n        return 0;\n    }\n    virtual const XMLDocument*\t\tToDocument() const\t\t{\n        return 0;\n    }\n    virtual const XMLDeclaration*\tToDeclaration() const\t{\n        return 0;\n    }\n    virtual const XMLUnknown*\t\tToUnknown() const\t\t{\n        return 0;\n    }\n\n    /** The meaning of 'value' changes for the specific type.\n    \t@verbatim\n    \tDocument:\tempty\n    \tElement:\tname of the element\n    \tComment:\tthe comment text\n    \tUnknown:\tthe tag contents\n    \tText:\t\tthe text string\n    \t@endverbatim\n    */\n    const char* Value() const\t\t\t{\n        return _value.GetStr();\n    }\n\n    /** Set the Value of an XML node.\n    \t@sa Value()\n    */\n    void SetValue( const char* val, bool staticMem=false );\n\n    /// Get the parent of this node on the DOM.\n    const XMLNode*\tParent() const\t\t\t{\n        return _parent;\n    }\n\n    XMLNode* Parent()\t\t\t\t\t\t{\n        return _parent;\n    }\n\n    /// Returns true if this node has no children.\n    bool NoChildren() const\t\t\t\t\t{\n        return !_firstChild;\n    }\n\n    /// Get the first child node, or null if none exists.\n    const XMLNode*  FirstChild() const\t\t{\n        return _firstChild;\n    }\n\n    XMLNode*\t\tFirstChild()\t\t\t{\n        return _firstChild;\n    }\n\n    /** Get the first child element, or optionally the first child\n        element with the specified name.\n    */\n    const XMLElement* FirstChildElement( const char* value=0 ) const;\n\n    XMLElement* FirstChildElement( const char* value=0 )\t{\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( value ));\n    }\n\n    /// Get the last child node, or null if none exists.\n    const XMLNode*\tLastChild() const\t\t\t\t\t\t{\n        return _lastChild;\n    }\n\n    XMLNode*\t\tLastChild()\t\t\t\t\t\t\t\t{\n        return const_cast<XMLNode*>(const_cast<const XMLNode*>(this)->LastChild() );\n    }\n\n    /** Get the last child element or optionally the last child\n        element with the specified name.\n    */\n    const XMLElement* LastChildElement( const char* value=0 ) const;\n\n    XMLElement* LastChildElement( const char* value=0 )\t{\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(value) );\n    }\n\n    /// Get the previous (left) sibling node of this node.\n    const XMLNode*\tPreviousSibling() const\t\t\t\t\t{\n        return _prev;\n    }\n\n    XMLNode*\tPreviousSibling()\t\t\t\t\t\t\t{\n        return _prev;\n    }\n\n    /// Get the previous (left) sibling element of this node, with an opitionally supplied name.\n    const XMLElement*\tPreviousSiblingElement( const char* value=0 ) const ;\n\n    XMLElement*\tPreviousSiblingElement( const char* value=0 ) {\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( value ) );\n    }\n\n    /// Get the next (right) sibling node of this node.\n    const XMLNode*\tNextSibling() const\t\t\t\t\t\t{\n        return _next;\n    }\n\n    XMLNode*\tNextSibling()\t\t\t\t\t\t\t\t{\n        return _next;\n    }\n\n    /// Get the next (right) sibling element of this node, with an opitionally supplied name.\n    const XMLElement*\tNextSiblingElement( const char* value=0 ) const;\n\n    XMLElement*\tNextSiblingElement( const char* value=0 )\t{\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( value ) );\n    }\n\n    /**\n    \tAdd a child node as the last (right) child.\n    */\n    XMLNode* InsertEndChild( XMLNode* addThis );\n\n    XMLNode* LinkEndChild( XMLNode* addThis )\t{\n        return InsertEndChild( addThis );\n    }\n    /**\n    \tAdd a child node as the first (left) child.\n    */\n    XMLNode* InsertFirstChild( XMLNode* addThis );\n    /**\n    \tAdd a node after the specified child node.\n    */\n    XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );\n\n    /**\n    \tDelete all the children of this node.\n    */\n    void DeleteChildren();\n\n    /**\n    \tDelete a child of this node.\n    */\n    void DeleteChild( XMLNode* node );\n\n    /**\n    \tMake a copy of this node, but not its children.\n    \tYou may pass in a Document pointer that will be\n    \tthe owner of the new Node. If the 'document' is\n    \tnull, then the node returned will be allocated\n    \tfrom the current Document. (this->GetDocument())\n\n    \tNote: if called on a XMLDocument, this will return null.\n    */\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;\n\n    /**\n    \tTest if 2 nodes are the same, but don't test children.\n    \tThe 2 nodes do not need to be in the same Document.\n\n    \tNote: if called on a XMLDocument, this will return false.\n    */\n    virtual bool ShallowEqual( const XMLNode* compare ) const = 0;\n\n    /** Accept a hierarchical visit of the nodes in the TinyXML DOM. Every node in the\n    \tXML tree will be conditionally visited and the host will be called back\n    \tvia the TiXmlVisitor interface.\n\n    \tThis is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse\n    \tthe XML for the callbacks, so the performance of TinyXML is unchanged by using this\n    \tinterface versus any other.)\n\n    \tThe interface has been based on ideas from:\n\n    \t- http://www.saxproject.org/\n    \t- http://c2.com/cgi/wiki?HierarchicalVisitorPattern\n\n    \tWhich are both good references for \"visiting\".\n\n    \tAn example of using Accept():\n    \t@verbatim\n    \tTiXmlPrinter printer;\n    \ttinyxmlDoc.Accept( &printer );\n    \tconst char* xmlcstr = printer.CStr();\n    \t@endverbatim\n    */\n    virtual bool Accept( XMLVisitor* visitor ) const = 0;\n\n    // internal\n    virtual char* ParseDeep( char*, StrPair* );\n\nprotected:\n    XMLNode( XMLDocument* );\n    virtual ~XMLNode();\n    XMLNode( const XMLNode& );\t// not supported\n    XMLNode& operator=( const XMLNode& );\t// not supported\n\n    XMLDocument*\t_document;\n    XMLNode*\t\t_parent;\n    mutable StrPair\t_value;\n\n    XMLNode*\t\t_firstChild;\n    XMLNode*\t\t_lastChild;\n\n    XMLNode*\t\t_prev;\n    XMLNode*\t\t_next;\n\nprivate:\n    MemPool*\t\t_memPool;\n    void Unlink( XMLNode* child );\n};\n\n\n/** XML text.\n\n\tNote that a text node can have child element nodes, for example:\n\t@verbatim\n\t<root>This is <b>bold</b></root>\n\t@endverbatim\n\n\tA text node can have 2 ways to output the next. \"normal\" output\n\tand CDATA. It will default to the mode it was parsed from the XML file and\n\tyou generally want to leave it alone, but you can change the output mode with\n\tSetCDATA() and query it with CDATA().\n*/\nclass CC_DLL XMLText : public XMLNode\n{\n    friend class XMLBase;\n    friend class XMLDocument;\npublic:\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    virtual XMLText* ToText()\t\t\t{\n        return this;\n    }\n    virtual const XMLText* ToText() const\t{\n        return this;\n    }\n\n    /// Declare whether this should be CDATA or standard text.\n    void SetCData( bool isCData )\t\t\t{\n        _isCData = isCData;\n    }\n    /// Returns true if this is a CDATA text element.\n    bool CData() const\t\t\t\t\t\t{\n        return _isCData;\n    }\n\n    char* ParseDeep( char*, StrPair* endTag );\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLText( XMLDocument* doc )\t: XMLNode( doc ), _isCData( false )\t{}\n    virtual ~XMLText()\t\t\t\t\t\t\t\t\t\t\t\t{}\n    XMLText( const XMLText& );\t// not supported\n    XMLText& operator=( const XMLText& );\t// not supported\n\nprivate:\n    bool _isCData;\n};\n\n\n/** An XML Comment. */\nclass CC_DLL XMLComment : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    virtual XMLComment*\tToComment()\t\t\t\t\t{\n        return this;\n    }\n    virtual const XMLComment* ToComment() const\t\t{\n        return this;\n    }\n\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    char* ParseDeep( char*, StrPair* endTag );\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLComment( XMLDocument* doc );\n    virtual ~XMLComment();\n    XMLComment( const XMLComment& );\t// not supported\n    XMLComment& operator=( const XMLComment& );\t// not supported\n\nprivate:\n};\n\n\n/** In correct XML the declaration is the first entry in the file.\n\t@verbatim\n\t\t<?xml version=\"1.0\" standalone=\"yes\"?>\n\t@endverbatim\n\n\tTinyXML2 will happily read or write files without a declaration,\n\thowever.\n\n\tThe text of the declaration isn't interpreted. It is parsed\n\tand written as a string.\n*/\nclass CC_DLL XMLDeclaration : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    virtual XMLDeclaration*\tToDeclaration()\t\t\t\t\t{\n        return this;\n    }\n    virtual const XMLDeclaration* ToDeclaration() const\t\t{\n        return this;\n    }\n\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    char* ParseDeep( char*, StrPair* endTag );\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLDeclaration( XMLDocument* doc );\n    virtual ~XMLDeclaration();\n    XMLDeclaration( const XMLDeclaration& );\t// not supported\n    XMLDeclaration& operator=( const XMLDeclaration& );\t// not supported\n};\n\n\n/** Any tag that tinyXml doesn't recognize is saved as an\n\tunknown. It is a tag of text, but should not be modified.\n\tIt will be written back to the XML, unchanged, when the file\n\tis saved.\n\n\tDTD tags get thrown into TiXmlUnknowns.\n*/\nclass CC_DLL XMLUnknown : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    virtual XMLUnknown*\tToUnknown()\t\t\t\t\t{\n        return this;\n    }\n    virtual const XMLUnknown* ToUnknown() const\t\t{\n        return this;\n    }\n\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    char* ParseDeep( char*, StrPair* endTag );\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLUnknown( XMLDocument* doc );\n    virtual ~XMLUnknown();\n    XMLUnknown( const XMLUnknown& );\t// not supported\n    XMLUnknown& operator=( const XMLUnknown& );\t// not supported\n};\n\n\nenum XMLError {\n    XML_NO_ERROR = 0,\n    XML_SUCCESS = 0,\n\n    XML_NO_ATTRIBUTE,\n    XML_WRONG_ATTRIBUTE_TYPE,\n\n    XML_ERROR_FILE_NOT_FOUND,\n    XML_ERROR_FILE_COULD_NOT_BE_OPENED,\n    XML_ERROR_FILE_READ_ERROR,\n    XML_ERROR_ELEMENT_MISMATCH,\n    XML_ERROR_PARSING_ELEMENT,\n    XML_ERROR_PARSING_ATTRIBUTE,\n    XML_ERROR_IDENTIFYING_TAG,\n    XML_ERROR_PARSING_TEXT,\n    XML_ERROR_PARSING_CDATA,\n    XML_ERROR_PARSING_COMMENT,\n    XML_ERROR_PARSING_DECLARATION,\n    XML_ERROR_PARSING_UNKNOWN,\n    XML_ERROR_EMPTY_DOCUMENT,\n    XML_ERROR_MISMATCHED_ELEMENT,\n    XML_ERROR_PARSING,\n\n    XML_CAN_NOT_CONVERT_TEXT,\n    XML_NO_TEXT_NODE\n};\n\n\n/** An attribute is a name-value pair. Elements have an arbitrary\n\tnumber of attributes, each with a unique name.\n\n\t@note The attributes are not XMLNodes. You may only query the\n\tNext() attribute in a list.\n*/\nclass CC_DLL XMLAttribute\n{\n    friend class XMLElement;\npublic:\n    /// The name of the attribute.\n    const char* Name() const {\n        return _name.GetStr();\n    }\n    /// The value of the attribute.\n    const char* Value() const {\n        return _value.GetStr();\n    }\n    /// The next attribute in the list.\n    const XMLAttribute* Next() const {\n        return _next;\n    }\n\n    /** IntAttribute interprets the attribute as an integer, and returns the value.\n        If the value isn't an integer, 0 will be returned. There is no error checking;\n    \tuse QueryIntAttribute() if you need error checking.\n    */\n    int\t\t IntValue() const\t\t\t\t{\n        int i=0;\n        QueryIntValue( &i );\n        return i;\n    }\n    /// Query as an unsigned integer. See IntAttribute()\n    unsigned UnsignedValue() const\t\t\t{\n        unsigned i=0;\n        QueryUnsignedValue( &i );\n        return i;\n    }\n    /// Query as a boolean. See IntAttribute()\n    bool\t BoolValue() const\t\t\t\t{\n        bool b=false;\n        QueryBoolValue( &b );\n        return b;\n    }\n    /// Query as a double. See IntAttribute()\n    double \t DoubleValue() const\t\t\t{\n        double d=0;\n        QueryDoubleValue( &d );\n        return d;\n    }\n    /// Query as a float. See IntAttribute()\n    float\t FloatValue() const\t\t\t\t{\n        float f=0;\n        QueryFloatValue( &f );\n        return f;\n    }\n\n    /** QueryIntAttribute interprets the attribute as an integer, and returns the value\n    \tin the provided paremeter. The function will return XML_NO_ERROR on success,\n    \tand XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.\n    */\n    XMLError QueryIntValue( int* value ) const;\n    /// See QueryIntAttribute\n    XMLError QueryUnsignedValue( unsigned int* value ) const;\n    /// See QueryIntAttribute\n    XMLError QueryBoolValue( bool* value ) const;\n    /// See QueryIntAttribute\n    XMLError QueryDoubleValue( double* value ) const;\n    /// See QueryIntAttribute\n    XMLError QueryFloatValue( float* value ) const;\n\n    /// Set the attribute to a string value.\n    void SetAttribute( const char* value );\n    /// Set the attribute to value.\n    void SetAttribute( int value );\n    /// Set the attribute to value.\n    void SetAttribute( unsigned value );\n    /// Set the attribute to value.\n    void SetAttribute( bool value );\n    /// Set the attribute to value.\n    void SetAttribute( double value );\n    /// Set the attribute to value.\n    void SetAttribute( float value );\n\nprivate:\n    enum { BUF_SIZE = 200 };\n\n    XMLAttribute() : _next( 0 ) {}\n    virtual ~XMLAttribute()\t{}\n\n    XMLAttribute( const XMLAttribute& );\t// not supported\n    void operator=( const XMLAttribute& );\t// not supported\n    void SetName( const char* name );\n\n    char* ParseDeep( char* p, bool processEntities );\n\n    mutable StrPair _name;\n    mutable StrPair _value;\n    XMLAttribute*   _next;\n    MemPool*        _memPool;\n};\n\n\n/** The element is a container class. It has a value, the element name,\n\tand can contain other elements, text, comments, and unknowns.\n\tElements also contain an arbitrary number of attributes.\n*/\nclass CC_DLL XMLElement : public XMLNode\n{\n    friend class XMLBase;\n    friend class XMLDocument;\npublic:\n    /// Get the name of an element (which is the Value() of the node.)\n    const char* Name() const\t\t{\n        return Value();\n    }\n    /// Set the name of the element.\n    void SetName( const char* str, bool staticMem=false )\t{\n        SetValue( str, staticMem );\n    }\n\n    virtual XMLElement* ToElement()\t\t\t\t{\n        return this;\n    }\n    virtual const XMLElement* ToElement() const {\n        return this;\n    }\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    /** Given an attribute name, Attribute() returns the value\n    \tfor the attribute of that name, or null if none\n    \texists. For example:\n\n    \t@verbatim\n    \tconst char* value = ele->Attribute( \"foo\" );\n    \t@endverbatim\n\n    \tThe 'value' parameter is normally null. However, if specified,\n    \tthe attribute will only be returned if the 'name' and 'value'\n    \tmatch. This allow you to write code:\n\n    \t@verbatim\n    \tif ( ele->Attribute( \"foo\", \"bar\" ) ) callFooIsBar();\n    \t@endverbatim\n\n    \trather than:\n    \t@verbatim\n    \tif ( ele->Attribute( \"foo\" ) ) {\n    \t\tif ( strcmp( ele->Attribute( \"foo\" ), \"bar\" ) == 0 ) callFooIsBar();\n    \t}\n    \t@endverbatim\n    */\n    const char* Attribute( const char* name, const char* value=0 ) const;\n\n    /** Given an attribute name, IntAttribute() returns the value\n    \tof the attribute interpreted as an integer. 0 will be\n    \treturned if there is an error. For a method with error\n    \tchecking, see QueryIntAttribute()\n    */\n    int\t\t IntAttribute( const char* name ) const\t\t{\n        int i=0;\n        QueryIntAttribute( name, &i );\n        return i;\n    }\n    /// See IntAttribute()\n    unsigned UnsignedAttribute( const char* name ) const {\n        unsigned i=0;\n        QueryUnsignedAttribute( name, &i );\n        return i;\n    }\n    /// See IntAttribute()\n    bool\t BoolAttribute( const char* name ) const\t{\n        bool b=false;\n        QueryBoolAttribute( name, &b );\n        return b;\n    }\n    /// See IntAttribute()\n    double \t DoubleAttribute( const char* name ) const\t{\n        double d=0;\n        QueryDoubleAttribute( name, &d );\n        return d;\n    }\n    /// See IntAttribute()\n    float\t FloatAttribute( const char* name ) const\t{\n        float f=0;\n        QueryFloatAttribute( name, &f );\n        return f;\n    }\n\n    /** Given an attribute name, QueryIntAttribute() returns\n    \tXML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion\n    \tcan't be performed, or XML_NO_ATTRIBUTE if the attribute\n    \tdoesn't exist. If successful, the result of the conversion\n    \twill be written to 'value'. If not successful, nothing will\n    \tbe written to 'value'. This allows you to provide default\n    \tvalue:\n\n    \t@verbatim\n    \tint value = 10;\n    \tQueryIntAttribute( \"foo\", &value );\t\t// if \"foo\" isn't found, value will still be 10\n    \t@endverbatim\n    */\n    XMLError QueryIntAttribute( const char* name, int* value ) const\t\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryIntValue( value );\n    }\n    /// See QueryIntAttribute()\n    XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryUnsignedValue( value );\n    }\n    /// See QueryIntAttribute()\n    XMLError QueryBoolAttribute( const char* name, bool* value ) const\t\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryBoolValue( value );\n    }\n    /// See QueryIntAttribute()\n    XMLError QueryDoubleAttribute( const char* name, double* value ) const\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryDoubleValue( value );\n    }\n    /// See QueryIntAttribute()\n    XMLError QueryFloatAttribute( const char* name, float* value ) const\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryFloatValue( value );\n    }\n\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, const char* value )\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, int value )\t\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, unsigned value )\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, bool value )\t\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, double value )\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n\n    /**\n    \tDelete an attribute.\n    */\n    void DeleteAttribute( const char* name );\n\n    /// Return the first attribute in the list.\n    const XMLAttribute* FirstAttribute() const {\n        return _rootAttribute;\n    }\n    /// Query a specific attribute in the list.\n    const XMLAttribute* FindAttribute( const char* name ) const;\n\n    /** Convenience function for easy access to the text inside an element. Although easy\n    \tand concise, GetText() is limited compared to getting the TiXmlText child\n    \tand accessing it directly.\n\n    \tIf the first child of 'this' is a TiXmlText, the GetText()\n    \treturns the character string of the Text node, else null is returned.\n\n    \tThis is a convenient method for getting the text of simple contained text:\n    \t@verbatim\n    \t<foo>This is text</foo>\n    \t\tconst char* str = fooElement->GetText();\n    \t@endverbatim\n\n    \t'str' will be a pointer to \"This is text\".\n\n    \tNote that this function can be misleading. If the element foo was created from\n    \tthis XML:\n    \t@verbatim\n    \t\t<foo><b>This is text</b></foo>\n    \t@endverbatim\n\n    \tthen the value of str would be null. The first child node isn't a text node, it is\n    \tanother element. From this XML:\n    \t@verbatim\n    \t\t<foo>This is <b>text</b></foo>\n    \t@endverbatim\n    \tGetText() will return \"This is \".\n    */\n    const char* GetText() const;\n\n    /**\n    \tConvenience method to query the value of a child text node. This is probably best\n    \tshown by example. Given you have a document is this form:\n    \t@verbatim\n    \t\t<point>\n    \t\t\t<x>1</x>\n    \t\t\t<y>1.4</y>\n    \t\t</point>\n    \t@endverbatim\n\n    \tThe QueryIntText() and similar functions provide a safe and easier way to get to the\n    \t\"value\" of x and y.\n\n    \t@verbatim\n    \t\tint x = 0;\n    \t\tfloat y = 0;\t// types of x and y are contrived for example\n    \t\tconst XMLElement* xElement = pointElement->FirstChildElement( \"x\" );\n    \t\tconst XMLElement* yElement = pointElement->FirstChildElement( \"y\" );\n    \t\txElement->QueryIntText( &x );\n    \t\tyElement->QueryFloatText( &y );\n    \t@endverbatim\n\n    \t@returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted\n    \t\t\t to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.\n\n    */\n    XMLError QueryIntText( int* ival ) const;\n    /// See QueryIntText()\n    XMLError QueryUnsignedText( unsigned* uval ) const;\n    /// See QueryIntText()\n    XMLError QueryBoolText( bool* bval ) const;\n    /// See QueryIntText()\n    XMLError QueryDoubleText( double* dval ) const;\n    /// See QueryIntText()\n    XMLError QueryFloatText( float* fval ) const;\n\n    // internal:\n    enum {\n        OPEN,\t\t// <foo>\n        CLOSED,\t\t// <foo/>\n        CLOSING\t\t// </foo>\n    };\n    int ClosingType() const {\n        return _closingType;\n    }\n    char* ParseDeep( char* p, StrPair* endTag );\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprivate:\n    XMLElement( XMLDocument* doc );\n    virtual ~XMLElement();\n    XMLElement( const XMLElement& );\t// not supported\n    void operator=( const XMLElement& );\t// not supported\n\n    XMLAttribute* FindAttribute( const char* name );\n    XMLAttribute* FindOrCreateAttribute( const char* name );\n    //void LinkAttribute( XMLAttribute* attrib );\n    char* ParseAttributes( char* p );\n\n    int _closingType;\n    // The attribute list is ordered; there is no 'lastAttribute'\n    // because the list needs to be scanned for dupes before adding\n    // a new attribute.\n    XMLAttribute* _rootAttribute;\n};\n\n\nenum Whitespace {\n    PRESERVE_WHITESPACE,\n    COLLAPSE_WHITESPACE\n};\n\n\n/** A Document binds together all the functionality.\n\tIt can be saved, loaded, and printed to the screen.\n\tAll Nodes are connected and allocated to a Document.\n\tIf the Document is deleted, all its Nodes are also deleted.\n*/\nclass CC_DLL XMLDocument : public XMLNode\n{\n    friend class XMLElement;\npublic:\n    /// constructor\n    XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE );\n    ~XMLDocument();\n\n    virtual XMLDocument* ToDocument()\t\t\t\t{\n        return this;\n    }\n    virtual const XMLDocument* ToDocument() const\t{\n        return this;\n    }\n\n    /**\n    \tParse an XML file from a character string.\n    \tReturns XML_NO_ERROR (0) on success, or\n    \tan errorID.\n\n    \tYou may optionally pass in the 'nBytes', which is\n    \tthe number of bytes which will be parsed. If not\n    \tspecified, TinyXML will assume 'xml' points to a\n    \tnull terminated string.\n    */\n    XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );\n\n    /**\n    \tLoad an XML file from disk.\n    \tReturns XML_NO_ERROR (0) on success, or\n    \tan errorID.\n    */\n    XMLError LoadFile( const char* filename );\n\n    /**\n    \tLoad an XML file from disk. You are responsible\n    \tfor providing and closing the FILE*.\n\n    \tReturns XML_NO_ERROR (0) on success, or\n    \tan errorID.\n    */\n    XMLError LoadFile( FILE* );\n\n    /**\n    \tSave the XML file to disk.\n    \tReturns XML_NO_ERROR (0) on success, or\n    \tan errorID.\n    */\n    XMLError SaveFile( const char* filename, bool compact = false );\n\n    /**\n    \tSave the XML file to disk. You are responsible\n    \tfor providing and closing the FILE*.\n\n    \tReturns XML_NO_ERROR (0) on success, or\n    \tan errorID.\n    */\n    XMLError SaveFile( FILE* fp, bool compact = false );\n\n    bool ProcessEntities() const\t\t{\n        return _processEntities;\n    }\n    Whitespace WhitespaceMode() const\t{\n        return _whitespace;\n    }\n\n    /**\n    \tReturns true if this document has a leading Byte Order Mark of UTF8.\n    */\n    bool HasBOM() const {\n        return _writeBOM;\n    }\n    /** Sets whether to write the BOM when writing the file.\n    */\n    void SetBOM( bool useBOM ) {\n        _writeBOM = useBOM;\n    }\n\n    /** Return the root element of DOM. Equivalent to FirstChildElement().\n        To get the first node, use FirstChild().\n    */\n    XMLElement* RootElement()\t\t\t\t{\n        return FirstChildElement();\n    }\n    const XMLElement* RootElement() const\t{\n        return FirstChildElement();\n    }\n\n    /** Print the Document. If the Printer is not provided, it will\n        print to stdout. If you provide Printer, this can print to a file:\n    \t@verbatim\n    \tXMLPrinter printer( fp );\n    \tdoc.Print( &printer );\n    \t@endverbatim\n\n    \tOr you can use a printer to print to memory:\n    \t@verbatim\n    \tXMLPrinter printer;\n    \tdoc->Print( &printer );\n    \t// printer.CStr() has a const char* to the XML\n    \t@endverbatim\n    */\n    void Print( XMLPrinter* streamer=0 );\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    /**\n    \tCreate a new Element associated with\n    \tthis Document. The memory for the Element\n    \tis managed by the Document.\n    */\n    XMLElement* NewElement( const char* name );\n    /**\n    \tCreate a new Comment associated with\n    \tthis Document. The memory for the Comment\n    \tis managed by the Document.\n    */\n    XMLComment* NewComment( const char* comment );\n    /**\n    \tCreate a new Text associated with\n    \tthis Document. The memory for the Text\n    \tis managed by the Document.\n    */\n    XMLText* NewText( const char* text );\n    /**\n    \tCreate a new Declaration associated with\n    \tthis Document. The memory for the object\n    \tis managed by the Document.\n\n    \tIf the 'text' param is null, the standard\n    \tdeclaration is used.:\n    \t@verbatim\n    \t\t<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    \t@endverbatim\n    */\n    XMLDeclaration* NewDeclaration( const char* text=0 );\n    /**\n    \tCreate a new Unknown associated with\n    \tthis Document. The memory forthe object\n    \tis managed by the Document.\n    */\n    XMLUnknown* NewUnknown( const char* text );\n\n    /**\n    \tDelete a node associated with this document.\n    \tIt will be unlinked from the DOM.\n    */\n    void DeleteNode( XMLNode* node )\t{\n        node->_parent->DeleteChild( node );\n    }\n\n    void SetError( XMLError error, const char* str1, const char* str2 );\n\n    /// Return true if there was an error parsing the document.\n    bool Error() const {\n        return _errorID != XML_NO_ERROR;\n    }\n    /// Return the errorID.\n    XMLError  ErrorID() const {\n        return _errorID;\n    }\n    /// Return a possibly helpful diagnostic location or string.\n    const char* GetErrorStr1() const {\n        return _errorStr1;\n    }\n    /// Return a possibly helpful secondary diagnostic location or string.\n    const char* GetErrorStr2() const {\n        return _errorStr2;\n    }\n    /// If there is an error, print it to stdout.\n    void PrintError() const;\n\n    // internal\n    char* Identify( char* p, XMLNode** node );\n\n    virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const\t{\n        return 0;\n    }\n    virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const\t{\n        return false;\n    }\n\nprivate:\n    XMLDocument( const XMLDocument& );\t// not supported\n    void operator=( const XMLDocument& );\t// not supported\n    void InitDocument();\n\n    bool        _writeBOM;\n    bool        _processEntities;\n    XMLError    _errorID;\n    Whitespace  _whitespace;\n    const char* _errorStr1;\n    const char* _errorStr2;\n    char*       _charBuffer;\n\n    MemPoolT< sizeof(XMLElement) >\t _elementPool;\n    MemPoolT< sizeof(XMLAttribute) > _attributePool;\n    MemPoolT< sizeof(XMLText) >\t\t _textPool;\n    MemPoolT< sizeof(XMLComment) >\t _commentPool;\n};\n\n\n/**\n\tA XMLHandle is a class that wraps a node pointer with null checks; this is\n\tan incredibly useful thing. Note that XMLHandle is not part of the TinyXML\n\tDOM structure. It is a separate utility class.\n\n\tTake an example:\n\t@verbatim\n\t<Document>\n\t\t<Element attributeA = \"valueA\">\n\t\t\t<Child attributeB = \"value1\" />\n\t\t\t<Child attributeB = \"value2\" />\n\t\t</Element>\n\t</Document>\n\t@endverbatim\n\n\tAssuming you want the value of \"attributeB\" in the 2nd \"Child\" element, it's very\n\teasy to write a *lot* of code that looks like:\n\n\t@verbatim\n\tXMLElement* root = document.FirstChildElement( \"Document\" );\n\tif ( root )\n\t{\n\t\tXMLElement* element = root->FirstChildElement( \"Element\" );\n\t\tif ( element )\n\t\t{\n\t\t\tXMLElement* child = element->FirstChildElement( \"Child\" );\n\t\t\tif ( child )\n\t\t\t{\n\t\t\t\tXMLElement* child2 = child->NextSiblingElement( \"Child\" );\n\t\t\t\tif ( child2 )\n\t\t\t\t{\n\t\t\t\t\t// Finally do something useful.\n\t@endverbatim\n\n\tAnd that doesn't even cover \"else\" cases. XMLHandle addresses the verbosity\n\tof such code. A XMLHandle checks for null pointers so it is perfectly safe\n\tand correct to use:\n\n\t@verbatim\n\tXMLHandle docHandle( &document );\n\tXMLElement* child2 = docHandle.FirstChild( \"Document\" ).FirstChild( \"Element\" ).FirstChild().NextSibling().ToElement();\n\tif ( child2 )\n\t{\n\t\t// do something useful\n\t@endverbatim\n\n\tWhich is MUCH more concise and useful.\n\n\tIt is also safe to copy handles - internally they are nothing more than node pointers.\n\t@verbatim\n\tXMLHandle handleCopy = handle;\n\t@endverbatim\n\n\tSee also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.\n*/\nclass CC_DLL XMLHandle\n{\npublic:\n    /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.\n    XMLHandle( XMLNode* node )\t\t\t\t\t\t\t\t\t\t\t\t{\n        _node = node;\n    }\n    /// Create a handle from a node.\n    XMLHandle( XMLNode& node )\t\t\t\t\t\t\t\t\t\t\t\t{\n        _node = &node;\n    }\n    /// Copy constructor\n    XMLHandle( const XMLHandle& ref )\t\t\t\t\t\t\t\t\t\t{\n        _node = ref._node;\n    }\n    /// Assignment\n    XMLHandle& operator=( const XMLHandle& ref )\t\t\t\t\t\t\t{\n        _node = ref._node;\n        return *this;\n    }\n\n    /// Get the first child of this handle.\n    XMLHandle FirstChild() \t\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->FirstChild() : 0 );\n    }\n    /// Get the first child element of this handle.\n    XMLHandle FirstChildElement( const char* value=0 )\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->FirstChildElement( value ) : 0 );\n    }\n    /// Get the last child of this handle.\n    XMLHandle LastChild()\t\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->LastChild() : 0 );\n    }\n    /// Get the last child element of this handle.\n    XMLHandle LastChildElement( const char* _value=0 )\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->LastChildElement( _value ) : 0 );\n    }\n    /// Get the previous sibling of this handle.\n    XMLHandle PreviousSibling()\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->PreviousSibling() : 0 );\n    }\n    /// Get the previous sibling element of this handle.\n    XMLHandle PreviousSiblingElement( const char* _value=0 )\t\t\t\t{\n        return XMLHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 );\n    }\n    /// Get the next sibling of this handle.\n    XMLHandle NextSibling()\t\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->NextSibling() : 0 );\n    }\n    /// Get the next sibling element of this handle.\n    XMLHandle NextSiblingElement( const char* _value=0 )\t\t\t\t\t{\n        return XMLHandle( _node ? _node->NextSiblingElement( _value ) : 0 );\n    }\n\n    /// Safe cast to XMLNode. This can return null.\n    XMLNode* ToNode()\t\t\t\t\t\t\t{\n        return _node;\n    }\n    /// Safe cast to XMLElement. This can return null.\n    XMLElement* ToElement() \t\t\t\t\t{\n        return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 );\n    }\n    /// Safe cast to XMLText. This can return null.\n    XMLText* ToText() \t\t\t\t\t\t\t{\n        return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 );\n    }\n    /// Safe cast to XMLUnknown. This can return null.\n    XMLUnknown* ToUnknown() \t\t\t\t\t{\n        return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 );\n    }\n    /// Safe cast to XMLDeclaration. This can return null.\n    XMLDeclaration* ToDeclaration() \t\t\t{\n        return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 );\n    }\n\nprivate:\n    XMLNode* _node;\n};\n\n\n/**\n\tA variant of the XMLHandle class for working with const XMLNodes and Documents. It is the\n\tsame in all regards, except for the 'const' qualifiers. See XMLHandle for API.\n*/\nclass CC_DLL XMLConstHandle\n{\npublic:\n    XMLConstHandle( const XMLNode* node )\t\t\t\t\t\t\t\t\t\t\t{\n        _node = node;\n    }\n    XMLConstHandle( const XMLNode& node )\t\t\t\t\t\t\t\t\t\t\t{\n        _node = &node;\n    }\n    XMLConstHandle( const XMLConstHandle& ref )\t\t\t\t\t\t\t\t\t\t{\n        _node = ref._node;\n    }\n\n    XMLConstHandle& operator=( const XMLConstHandle& ref )\t\t\t\t\t\t\t{\n        _node = ref._node;\n        return *this;\n    }\n\n    const XMLConstHandle FirstChild() const\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->FirstChild() : 0 );\n    }\n    const XMLConstHandle FirstChildElement( const char* value=0 ) const\t\t\t\t{\n        return XMLConstHandle( _node ? _node->FirstChildElement( value ) : 0 );\n    }\n    const XMLConstHandle LastChild()\tconst\t\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->LastChild() : 0 );\n    }\n    const XMLConstHandle LastChildElement( const char* _value=0 ) const\t\t\t\t{\n        return XMLConstHandle( _node ? _node->LastChildElement( _value ) : 0 );\n    }\n    const XMLConstHandle PreviousSibling() const\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );\n    }\n    const XMLConstHandle PreviousSiblingElement( const char* _value=0 ) const\t\t{\n        return XMLConstHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 );\n    }\n    const XMLConstHandle NextSibling() const\t\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->NextSibling() : 0 );\n    }\n    const XMLConstHandle NextSiblingElement( const char* _value=0 ) const\t\t\t{\n        return XMLConstHandle( _node ? _node->NextSiblingElement( _value ) : 0 );\n    }\n\n\n    const XMLNode* ToNode() const\t\t\t\t{\n        return _node;\n    }\n    const XMLElement* ToElement() const\t\t\t{\n        return ( ( _node && _node->ToElement() ) ? _node->ToElement() : 0 );\n    }\n    const XMLText* ToText() const\t\t\t\t{\n        return ( ( _node && _node->ToText() ) ? _node->ToText() : 0 );\n    }\n    const XMLUnknown* ToUnknown() const\t\t\t{\n        return ( ( _node && _node->ToUnknown() ) ? _node->ToUnknown() : 0 );\n    }\n    const XMLDeclaration* ToDeclaration() const\t{\n        return ( ( _node && _node->ToDeclaration() ) ? _node->ToDeclaration() : 0 );\n    }\n\nprivate:\n    const XMLNode* _node;\n};\n\n\n/**\n\tPrinting functionality. The XMLPrinter gives you more\n\toptions than the XMLDocument::Print() method.\n\n\tIt can:\n\t-# Print to memory.\n\t-# Print to a file you provide.\n\t-# Print XML without a XMLDocument.\n\n\tPrint to Memory\n\n\t@verbatim\n\tXMLPrinter printer;\n\tdoc->Print( &printer );\n\tSomeFunction( printer.CStr() );\n\t@endverbatim\n\n\tPrint to a File\n\n\tYou provide the file pointer.\n\t@verbatim\n\tXMLPrinter printer( fp );\n\tdoc.Print( &printer );\n\t@endverbatim\n\n\tPrint without a XMLDocument\n\n\tWhen loading, an XML parser is very useful. However, sometimes\n\twhen saving, it just gets in the way. The code is often set up\n\tfor streaming, and constructing the DOM is just overhead.\n\n\tThe Printer supports the streaming case. The following code\n\tprints out a trivially simple XML file without ever creating\n\tan XML document.\n\n\t@verbatim\n\tXMLPrinter printer( fp );\n\tprinter.OpenElement( \"foo\" );\n\tprinter.PushAttribute( \"foo\", \"bar\" );\n\tprinter.CloseElement();\n\t@endverbatim\n*/\nclass CC_DLL XMLPrinter : public XMLVisitor\n{\npublic:\n    /** Construct the printer. If the FILE* is specified,\n    \tthis will print to the FILE. Else it will print\n    \tto memory, and the result is available in CStr().\n    \tIf 'compact' is set to true, then output is created\n    \twith only required whitespace and newlines.\n    */\n    XMLPrinter( FILE* file=0, bool compact = false );\n    ~XMLPrinter()\t{}\n\n    /** If streaming, write the BOM and declaration. */\n    void PushHeader( bool writeBOM, bool writeDeclaration );\n    /** If streaming, start writing an element.\n        The element must be closed with CloseElement()\n    */\n    void OpenElement( const char* name );\n    /// If streaming, add an attribute to an open element.\n    void PushAttribute( const char* name, const char* value );\n    void PushAttribute( const char* name, int value );\n    void PushAttribute( const char* name, unsigned value );\n    void PushAttribute( const char* name, bool value );\n    void PushAttribute( const char* name, double value );\n    /// If streaming, close the Element.\n    void CloseElement();\n\n    /// Add a text node.\n    void PushText( const char* text, bool cdata=false );\n    /// Add a text node from an integer.\n    void PushText( int value );\n    /// Add a text node from an unsigned.\n    void PushText( unsigned value );\n    /// Add a text node from a bool.\n    void PushText( bool value );\n    /// Add a text node from a float.\n    void PushText( float value );\n    /// Add a text node from a double.\n    void PushText( double value );\n\n    /// Add a comment\n    void PushComment( const char* comment );\n\n    void PushDeclaration( const char* value );\n    void PushUnknown( const char* value );\n\n    virtual bool VisitEnter( const XMLDocument& /*doc*/ );\n    virtual bool VisitExit( const XMLDocument& /*doc*/ )\t\t\t{\n        return true;\n    }\n\n    virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );\n    virtual bool VisitExit( const XMLElement& element );\n\n    virtual bool Visit( const XMLText& text );\n    virtual bool Visit( const XMLComment& comment );\n    virtual bool Visit( const XMLDeclaration& declaration );\n    virtual bool Visit( const XMLUnknown& unknown );\n\n    /**\n    \tIf in print to memory mode, return a pointer to\n    \tthe XML file in memory.\n    */\n    const char* CStr() const {\n        return _buffer.Mem();\n    }\n    /**\n    \tIf in print to memory mode, return the size\n    \tof the XML file in memory. (Note the size returned\n    \tincludes the terminating null.)\n    */\n    int CStrSize() const {\n        return _buffer.Size();\n    }\n\nprivate:\n    void SealElement();\n    void PrintSpace( int depth );\n    void PrintString( const char*, bool restrictedEntitySet );\t// prints out, after detecting entities.\n    void Print( const char* format, ... );\n\n    bool _elementJustOpened;\n    bool _firstElement;\n    FILE* _fp;\n    int _depth;\n    int _textDepth;\n    bool _processEntities;\n    bool _compactMode;\n\n    enum {\n        ENTITY_RANGE = 64,\n        BUF_SIZE = 200\n    };\n    bool _entityFlag[ENTITY_RANGE];\n    bool _restrictedEntityFlag[ENTITY_RANGE];\n\n    DynArray< const char*, 10 > _stack;\n    DynArray< char, 20 > _buffer;\n#ifdef _MSC_VER\n    DynArray< char, 20 > _accumulator;\n#endif\n};\n\n\n}\t// tinyxml2\n\n\n#endif // TINYXML2_INCLUDED\n"
  },
  {
    "path": "cocos2d/external/unzip/CMakeLists.txt",
    "content": "set(UNZIP_SRC\n  ioapi.cpp\n  unzip.cpp\n)\n\nadd_library(unzip STATIC\n  ${UNZIP_SRC}\n)\n\nset_target_properties(unzip\n    PROPERTIES\n    ARCHIVE_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n    LIBRARY_OUTPUT_DIRECTORY \"${CMAKE_BINARY_DIR}/lib\"\n)\n\n"
  },
  {
    "path": "cocos2d/external/unzip/ioapi.cpp",
    "content": "/* ioapi.h -- IO base function header for compress/uncompress .zip\n   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Modifications for Zip64 support\n         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )\n\n         For more info read MiniZip_info.txt\n\n*/\n\n#include \"ioapi.h\"\n\nnamespace cocos2d {\n\nvoidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)\n{\n    if (pfilefunc->zfile_func64.zopen64_file != NULL)\n        return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);\n    else\n    {\n        return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);\n    }\n}\n\nlong call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)\n{\n    if (pfilefunc->zfile_func64.zseek64_file != NULL)\n        return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);\n    else\n    {\n        uLong offsetTruncated = (uLong)offset;\n        if (offsetTruncated != offset)\n            return -1;\n        else\n            return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);\n    }\n}\n\nZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)\n{\n    if (pfilefunc->zfile_func64.zseek64_file != NULL)\n        return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);\n    else\n    {\n        uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);\n        if ((tell_uLong) == ((uLong)-1))\n            return (ZPOS64_T)-1;\n        else\n            return tell_uLong;\n    }\n}\n\nvoid fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32)\n{\n    p_filefunc64_32->zfile_func64.zopen64_file = NULL;\n    p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file;\n    p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;\n    p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;\n    p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file;\n    p_filefunc64_32->zfile_func64.ztell64_file = NULL;\n    p_filefunc64_32->zfile_func64.zseek64_file = NULL;\n    p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file;\n    p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;\n    p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque;\n    p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file;\n    p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;\n}\n\n\n\nstatic voidpf  ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));\nstatic uLong   ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));\nstatic uLong   ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));\nstatic ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));\nstatic long    ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));\nstatic int     ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));\nstatic int     ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));\n\nstatic voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)\n{\n    FILE* file = NULL;\n    const char* mode_fopen = NULL;\n    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)\n        mode_fopen = \"rb\";\n    else\n    if (mode & ZLIB_FILEFUNC_MODE_EXISTING)\n        mode_fopen = \"r+b\";\n    else\n    if (mode & ZLIB_FILEFUNC_MODE_CREATE)\n        mode_fopen = \"wb\";\n\n    if ((filename!=NULL) && (mode_fopen != NULL))\n        file = fopen(filename, mode_fopen);\n    return file;\n}\n\nstatic voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)\n{\n    FILE* file = NULL;\n    const char* mode_fopen = NULL;\n    if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)\n        mode_fopen = \"rb\";\n    else\n    if (mode & ZLIB_FILEFUNC_MODE_EXISTING)\n        mode_fopen = \"r+b\";\n    else\n    if (mode & ZLIB_FILEFUNC_MODE_CREATE)\n        mode_fopen = \"wb\";\n\n    if ((filename!=NULL) && (mode_fopen != NULL))\n    {\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)\n        file = NULL;\n#else\n        file = fopen64((const char*)filename, mode_fopen);    \n#endif\n    }\n\n    return file;\n}\n\n\nstatic uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)\n{\n    uLong ret;\n    ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);\n    return ret;\n}\n\nstatic uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)\n{\n    uLong ret;\n    ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);\n    return ret;\n}\n\nstatic long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)\n{\n    long ret;\n    ret = ftell((FILE *)stream);\n    return ret;\n}\n\n\nstatic ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)\n{\n    ZPOS64_T ret;\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)\n    ret = 0;\n#else\n    ret = ftello64((FILE *)stream);\n#endif\n    return ret;\n}\n\nstatic long ZCALLBACK fseek_file_func (voidpf  opaque, voidpf stream, uLong offset, int origin)\n{\n    int fseek_origin=0;\n    long ret;\n    switch (origin)\n    {\n    case ZLIB_FILEFUNC_SEEK_CUR :\n        fseek_origin = SEEK_CUR;\n        break;\n    case ZLIB_FILEFUNC_SEEK_END :\n        fseek_origin = SEEK_END;\n        break;\n    case ZLIB_FILEFUNC_SEEK_SET :\n        fseek_origin = SEEK_SET;\n        break;\n    default: return -1;\n    }\n    ret = 0;\n    if (fseek((FILE *)stream, offset, fseek_origin) != 0)\n        ret = -1;\n    return ret;\n}\n\nstatic long ZCALLBACK fseek64_file_func (voidpf  opaque, voidpf stream, ZPOS64_T offset, int origin)\n{\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE || CC_TARGET_PLATFORM == CC_PLATFORM_BADA || CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY || CC_TARGET_PLATFORM == CC_PLATFORM_NACL || CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN)\n    return -1;\n#else\n    int fseek_origin=0;\n    switch (origin)\n    {\n    case ZLIB_FILEFUNC_SEEK_CUR :\n        fseek_origin = SEEK_CUR;\n        break;\n    case ZLIB_FILEFUNC_SEEK_END :\n        fseek_origin = SEEK_END;\n        break;\n    case ZLIB_FILEFUNC_SEEK_SET :\n        fseek_origin = SEEK_SET;\n        break;\n    default: return -1;\n    }\n    if(fseeko64((FILE *)stream, offset, fseek_origin) != 0)\n        return -1;\n    return 0;\n#endif\n}\n\n\nstatic int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)\n{\n    int ret;\n    ret = fclose((FILE *)stream);\n    return ret;\n}\n\nstatic int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)\n{\n    int ret;\n    ret = ferror((FILE *)stream);\n    return ret;\n}\n\nvoid fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def)\n{\n    pzlib_filefunc_def->zopen_file = fopen_file_func;\n    pzlib_filefunc_def->zread_file = fread_file_func;\n    pzlib_filefunc_def->zwrite_file = fwrite_file_func;\n    pzlib_filefunc_def->ztell_file = ftell_file_func;\n    pzlib_filefunc_def->zseek_file = fseek_file_func;\n    pzlib_filefunc_def->zclose_file = fclose_file_func;\n    pzlib_filefunc_def->zerror_file = ferror_file_func;\n    pzlib_filefunc_def->opaque = NULL;\n}\n\nvoid fill_fopen64_filefunc (zlib_filefunc64_def*  pzlib_filefunc_def)\n{\n    pzlib_filefunc_def->zopen64_file = fopen64_file_func;\n    pzlib_filefunc_def->zread_file = fread_file_func;\n    pzlib_filefunc_def->zwrite_file = fwrite_file_func;\n    pzlib_filefunc_def->ztell64_file = ftell64_file_func;\n    pzlib_filefunc_def->zseek64_file = fseek64_file_func;\n    pzlib_filefunc_def->zclose_file = fclose_file_func;\n    pzlib_filefunc_def->zerror_file = ferror_file_func;\n    pzlib_filefunc_def->opaque = NULL;\n}\n\n} // end of namespace cocos2d\n"
  },
  {
    "path": "cocos2d/external/unzip/ioapi.h",
    "content": "/* ioapi.h -- IO base function header for compress/uncompress .zip\n   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Modifications for Zip64 support\n         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )\n\n         For more info read MiniZip_info.txt\n\n         Changes\n\n    Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)\n    Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.\n               More if/def section may be needed to support other platforms\n    Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.\n                          (but you should use iowin32.c for windows instead)\n\n*/\n\n#ifndef _ZLIBIOAPI64_H\n#define _ZLIBIOAPI64_H\n\n#include \"CCPlatformConfig.h\"\n\n#if (!defined(_WIN32)) && (!defined(WIN32))\n\n  // Linux needs this to support file operation on files larger then 4+GB\n  // But might need better if/def to select just the platforms that needs them.\n\n        #ifndef __USE_FILE_OFFSET64\n                #define __USE_FILE_OFFSET64\n        #endif\n        #ifndef __USE_LARGEFILE64\n                #define __USE_LARGEFILE64\n        #endif\n        #ifndef _LARGEFILE64_SOURCE\n                #define _LARGEFILE64_SOURCE\n        #endif\n        #ifndef _FILE_OFFSET_BIT\n                #define _FILE_OFFSET_BIT 64\n        #endif\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"zlib.h\"\n\nnamespace cocos2d {\n\n#ifndef OF\n#define OF _Z_OF\n#endif\n\n#if defined(USE_FILE32API)\n#define fopen64 fopen\n#define ftello64 ftell\n#define fseeko64 fseek\n#else\n#ifdef _MSC_VER\n #define fopen64 fopen\n #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))\n  #define ftello64 _ftelli64\n  #define fseeko64 _fseeki64\n #else // old MSC\n  #define ftello64 ftell\n  #define fseeko64 fseek\n #endif\n#endif\n#endif\n\n/*\n#ifndef ZPOS64_T\n  #ifdef _WIN32\n                #define ZPOS64_T fpos_t\n  #else\n    #include <stdint.h>\n    #define ZPOS64_T uint64_t\n  #endif\n#endif\n*/\n\n#ifdef HAVE_MINIZIP64_CONF_H\n#include \"mz64conf.h\"\n#endif\n\n/* a type chosen by DEFINE */\n#ifdef HAVE_64BIT_INT_CUSTOM\ntypedef  64BIT_INT_CUSTOM_TYPE ZPOS64_T;\n#else\n#ifdef HAS_STDINT_H\n#include \"stdint.h\"\ntypedef uint64_t ZPOS64_T;\n#else\n\n\n#if defined(_MSC_VER) || defined(__BORLANDC__)\ntypedef unsigned __int64 ZPOS64_T;\n#else\ntypedef unsigned long long int ZPOS64_T;\n#endif\n#endif\n#endif\n\n\n\n#define ZLIB_FILEFUNC_SEEK_CUR (1)\n#define ZLIB_FILEFUNC_SEEK_END (2)\n#define ZLIB_FILEFUNC_SEEK_SET (0)\n\n#define ZLIB_FILEFUNC_MODE_READ      (1)\n#define ZLIB_FILEFUNC_MODE_WRITE     (2)\n#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)\n\n#define ZLIB_FILEFUNC_MODE_EXISTING (4)\n#define ZLIB_FILEFUNC_MODE_CREATE   (8)\n\n\n#ifndef ZCALLBACK\n #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)\n   #define ZCALLBACK CALLBACK\n #else\n   #define ZCALLBACK\n #endif\n#endif\n\n\n\n\ntypedef voidpf   (ZCALLBACK *open_file_func)      OF((voidpf opaque, const char* filename, int mode));\ntypedef uLong    (ZCALLBACK *read_file_func)      OF((voidpf opaque, voidpf stream, void* buf, uLong size));\ntypedef uLong    (ZCALLBACK *write_file_func)     OF((voidpf opaque, voidpf stream, const void* buf, uLong size));\ntypedef int      (ZCALLBACK *close_file_func)     OF((voidpf opaque, voidpf stream));\ntypedef int      (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));\n\ntypedef long     (ZCALLBACK *tell_file_func)      OF((voidpf opaque, voidpf stream));\ntypedef long     (ZCALLBACK *seek_file_func)      OF((voidpf opaque, voidpf stream, uLong offset, int origin));\n\n\n/* here is the \"old\" 32 bits structure structure */\ntypedef struct zlib_filefunc_def_s\n{\n    open_file_func      zopen_file;\n    read_file_func      zread_file;\n    write_file_func     zwrite_file;\n    tell_file_func      ztell_file;\n    seek_file_func      zseek_file;\n    close_file_func     zclose_file;\n    testerror_file_func zerror_file;\n    voidpf              opaque;\n} zlib_filefunc_def;\n\ntypedef ZPOS64_T (ZCALLBACK *tell64_file_func)    OF((voidpf opaque, voidpf stream));\ntypedef long     (ZCALLBACK *seek64_file_func)    OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));\ntypedef voidpf   (ZCALLBACK *open64_file_func)    OF((voidpf opaque, const void* filename, int mode));\n\ntypedef struct zlib_filefunc64_def_s\n{\n    open64_file_func    zopen64_file;\n    read_file_func      zread_file;\n    write_file_func     zwrite_file;\n    tell64_file_func    ztell64_file;\n    seek64_file_func    zseek64_file;\n    close_file_func     zclose_file;\n    testerror_file_func zerror_file;\n    voidpf              opaque;\n} zlib_filefunc64_def;\n\nvoid fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));\nvoid fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));\n\n/* now internal definition, only for zip.c and unzip.h */\ntypedef struct zlib_filefunc64_32_def_s\n{\n    zlib_filefunc64_def zfile_func64;\n    open_file_func      zopen32_file;\n    tell_file_func      ztell32_file;\n    seek_file_func      zseek32_file;\n} zlib_filefunc64_32_def;\n\n\n#define ZREAD64(filefunc,filestream,buf,size)     ((*((filefunc).zfile_func64.zread_file))   ((filefunc).zfile_func64.opaque,filestream,buf,size))\n#define ZWRITE64(filefunc,filestream,buf,size)    ((*((filefunc).zfile_func64.zwrite_file))  ((filefunc).zfile_func64.opaque,filestream,buf,size))\n//#define ZTELL64(filefunc,filestream)            ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))\n//#define ZSEEK64(filefunc,filestream,pos,mode)   ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))\n#define ZCLOSE64(filefunc,filestream)             ((*((filefunc).zfile_func64.zclose_file))  ((filefunc).zfile_func64.opaque,filestream))\n#define ZERROR64(filefunc,filestream)             ((*((filefunc).zfile_func64.zerror_file))  ((filefunc).zfile_func64.opaque,filestream))\n\nvoidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));\nlong    call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));\nZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));\n\nvoid    fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);\n\n#define ZOPEN64(filefunc,filename,mode)         (call_zopen64((&(filefunc)),(filename),(mode)))\n#define ZTELL64(filefunc,filestream)            (call_ztell64((&(filefunc)),(filestream)))\n#define ZSEEK64(filefunc,filestream,pos,mode)   (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))\n\n} // end of namespace cocos2d\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/unzip/unzip.cpp",
    "content": "/* unzip.c -- IO for uncompress .zip files using zlib\n   Version 1.1, February 14h, 2010\n   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Modifications of Unzip for Zip64\n         Copyright (C) 2007-2008 Even Rouault\n\n         Modifications for Zip64 support on both zip and unzip\n         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )\n\n         For more info read MiniZip_info.txt\n\n\n  ------------------------------------------------------------------------------------\n  Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of\n  compatibility with older software. The following is from the original crypt.c.\n  Code woven in by Terry Thorsen 1/2003.\n\n  Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.\n\n  See the accompanying file LICENSE, version 2000-Apr-09 or later\n  (the contents of which are also included in zip.h) for terms of use.\n  If, for some reason, all these files are missing, the Info-ZIP license\n  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html\n\n        crypt.c (full version) by Info-ZIP.      Last revised:  [see crypt.h]\n\n  The encryption/decryption parts of this source code (as opposed to the\n  non-echoing password parts) were originally written in Europe.  The\n  whole source package can be freely distributed, including from the USA.\n  (Prior to January 2000, re-export from the US was a violation of US law.)\n\n        This encryption code is a direct transcription of the algorithm from\n  Roger Schlafly, described by Phil Katz in the file appnote.txt.  This\n  file (appnote.txt) is distributed with the PKZIP program (even in the\n  version without encryption capabilities).\n\n        ------------------------------------------------------------------------------------\n\n        Changes in unzip.c\n\n        2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos\n  2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz*\n  2007-2008 - Even Rouault - Remove old C style function prototypes\n  2007-2008 - Even Rouault - Add unzip support for ZIP64\n\n        Copyright (C) 2007-2008 Even Rouault\n\n\n        Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again).\n  Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G\n                                should only read the compressed/uncompressed size from the Zip64 format if\n                                the size from normal header was 0xFFFFFFFF\n  Oct-2009 - Mathias Svensson - Applied some bug fixes from patches received from Gilles Vollant\n        Oct-2009 - Mathias Svensson - Applied support to unzip files with compression method BZIP2 (bzip2 lib is required)\n                                Patch created by Daniel Borca\n\n  Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer\n\n  Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson\n\n*/\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifndef NOUNCRYPT\n        #define NOUNCRYPT\n#endif\n\n#include \"zlib.h\"\n#include \"unzip.h\"\n\n#ifdef STDC\n#  include <stddef.h>\n#  include <string.h>\n#  include <stdlib.h>\n#endif\n#ifdef NO_ERRNO_H\n    extern int errno;\n#else\n#   include <errno.h>\n#endif\n\nnamespace cocos2d {\n\n#ifndef local\n#  define local static\n#endif\n/* compile with -Dlocal if your debugger can't find static symbols */\n\n\n#ifndef CASESENSITIVITYDEFAULT_NO\n#  if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES)\n#    define CASESENSITIVITYDEFAULT_NO\n#  endif\n#endif\n\n\n#ifndef UNZ_BUFSIZE\n#define UNZ_BUFSIZE (16384)\n#endif\n\n#ifndef UNZ_MAXFILENAMEINZIP\n#define UNZ_MAXFILENAMEINZIP (256)\n#endif\n\n#ifndef ALLOC\n# define ALLOC(size) (malloc(size))\n#endif\n#ifndef TRYFREE\n# define TRYFREE(p) {if (p) free(p);}\n#endif\n\n#define SIZECENTRALDIRITEM (0x2e)\n#define SIZEZIPLOCALHEADER (0x1e)\n\n\nconst char unz_copyright[] =\n   \" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll\";\n\n/* unz_file_info_interntal contain internal info about a file in zipfile*/\ntypedef struct unz_file_info64_internal_s\n{\n    ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */\n} unz_file_info64_internal;\n\n\n/* file_in_zip_read_info_s contain internal information about a file in zipfile,\n    when reading and decompress it */\ntypedef struct\n{\n    char  *read_buffer;         /* internal buffer for compressed data */\n    z_stream stream;            /* zLib stream structure for inflate */\n\n#ifdef HAVE_BZIP2\n    bz_stream bstream;          /* bzLib stream structure for bziped */\n#endif\n\n    ZPOS64_T pos_in_zipfile;       /* position in byte on the zipfile, for fseek*/\n    uLong stream_initialised;   /* flag set if stream structure is initialized*/\n\n    ZPOS64_T offset_local_extrafield;/* offset of the local extra field */\n    uInt  size_local_extrafield;/* size of the local extra field */\n    ZPOS64_T pos_local_extrafield;   /* position in the local extra field in read*/\n    ZPOS64_T total_out_64;\n\n    uLong crc32;                /* crc32 of all data uncompressed */\n    uLong crc32_wait;           /* crc32 we must obtain after decompress all */\n    ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */\n    ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/\n    zlib_filefunc64_32_def z_filefunc;\n    voidpf filestream;        /* io structure of the zipfile */\n    uLong compression_method;   /* compression method (0==store) */\n    ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/\n    int   raw;\n} file_in_zip64_read_info_s;\n\n\n/* unz64_s contain internal information about the zipfile\n*/\ntypedef struct\n{\n    zlib_filefunc64_32_def z_filefunc;\n    int is64bitOpenFunction;\n    voidpf filestream;        /* io structure of the zipfile */\n    unz_global_info64 gi;       /* public global information */\n    ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/\n    ZPOS64_T num_file;             /* number of the current file in the zipfile*/\n    ZPOS64_T pos_in_central_dir;   /* pos of the current file in the central dir*/\n    ZPOS64_T current_file_ok;      /* flag about the usability of the current file*/\n    ZPOS64_T central_pos;          /* position of the beginning of the central dir*/\n\n    ZPOS64_T size_central_dir;     /* size of the central directory  */\n    ZPOS64_T offset_central_dir;   /* offset of start of central directory with\n                                   respect to the starting disk number */\n\n    unz_file_info64 cur_file_info; /* public info about the current file in zip*/\n    unz_file_info64_internal cur_file_info_internal; /* private info about it*/\n    file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current\n                                        file if we are decompressing it */\n    int encrypted;\n\n    int isZip64;\n\n#    ifndef NOUNCRYPT\n    unsigned long keys[3];     /* keys defining the pseudo-random sequence */\n    const unsigned long* pcrc_32_tab;\n#    endif\n} unz64_s;\n\n\n#ifndef NOUNCRYPT\n#include \"crypt.h\"\n#endif\n\n/* ===========================================================================\n     Read a byte from a gz_stream; update next_in and avail_in. Return EOF\n   for end of file.\n   IN assertion: the stream s has been successfully opened for reading.\n*/\n\n\nlocal int unz64local_getByte OF((\n    const zlib_filefunc64_32_def* pzlib_filefunc_def,\n    voidpf filestream,\n    int *pi));\n\nlocal int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi)\n{\n    unsigned char c;\n    int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1);\n    if (err==1)\n    {\n        *pi = (int)c;\n        return UNZ_OK;\n    }\n    else\n    {\n        if (ZERROR64(*pzlib_filefunc_def,filestream))\n            return UNZ_ERRNO;\n        else\n            return UNZ_EOF;\n    }\n}\n\n\n/* ===========================================================================\n   Reads a long in LSB order from the given gz_stream. Sets\n*/\nlocal int unz64local_getShort OF((\n    const zlib_filefunc64_32_def* pzlib_filefunc_def,\n    voidpf filestream,\n    uLong *pX));\n\nlocal int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def,\n                             voidpf filestream,\n                             uLong *pX)\n{\n    uLong x ;\n    int i = 0;\n    int err;\n\n    err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x = (uLong)i;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((uLong)i)<<8;\n\n    if (err==UNZ_OK)\n        *pX = x;\n    else\n        *pX = 0;\n    return err;\n}\n\nlocal int unz64local_getLong OF((\n    const zlib_filefunc64_32_def* pzlib_filefunc_def,\n    voidpf filestream,\n    uLong *pX));\n\nlocal int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def,\n                            voidpf filestream,\n                            uLong *pX)\n{\n    uLong x ;\n    int i = 0;\n    int err;\n\n    err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x = (uLong)i;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((uLong)i)<<8;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((uLong)i)<<16;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x += ((uLong)i)<<24;\n\n    if (err==UNZ_OK)\n        *pX = x;\n    else\n        *pX = 0;\n    return err;\n}\n\nlocal int unz64local_getLong64 OF((\n    const zlib_filefunc64_32_def* pzlib_filefunc_def,\n    voidpf filestream,\n    ZPOS64_T *pX));\n\n\nlocal int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def,\n                            voidpf filestream,\n                            ZPOS64_T *pX)\n{\n    ZPOS64_T x ;\n    int i = 0;\n    int err;\n\n    err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x = (ZPOS64_T)i;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((ZPOS64_T)i)<<8;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((ZPOS64_T)i)<<16;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((ZPOS64_T)i)<<24;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((ZPOS64_T)i)<<32;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((ZPOS64_T)i)<<40;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((ZPOS64_T)i)<<48;\n\n    if (err==UNZ_OK)\n        err = unz64local_getByte(pzlib_filefunc_def,filestream,&i);\n    x |= ((ZPOS64_T)i)<<56;\n\n    if (err==UNZ_OK)\n        *pX = x;\n    else\n        *pX = 0;\n    return err;\n}\n\n/* My own strcmpi / strcasecmp */\nlocal int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2)\n{\n    for (;;)\n    {\n        char c1=*(fileName1++);\n        char c2=*(fileName2++);\n        if ((c1>='a') && (c1<='z'))\n            c1 -= 0x20;\n        if ((c2>='a') && (c2<='z'))\n            c2 -= 0x20;\n        if (c1=='\\0')\n            return ((c2=='\\0') ? 0 : -1);\n        if (c2=='\\0')\n            return 1;\n        if (c1<c2)\n            return -1;\n        if (c1>c2)\n            return 1;\n    }\n}\n\n\n#ifdef  CASESENSITIVITYDEFAULT_NO\n#define CASESENSITIVITYDEFAULTVALUE 2\n#else\n#define CASESENSITIVITYDEFAULTVALUE 1\n#endif\n\n#ifndef STRCMPCASENOSENTIVEFUNCTION\n#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal\n#endif\n\n/*\n   Compare two filename (fileName1,fileName2).\n   If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp)\n   If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi\n                                                                or strcasecmp)\n   If iCaseSenisivity = 0, case sensitivity is default of your operating system\n        (like 1 on Unix, 2 on Windows)\n\n*/\nint ZEXPORT unzStringFileNameCompare (const char*  fileName1,\n                                                 const char*  fileName2,\n                                                 int iCaseSensitivity)\n\n{\n    if (iCaseSensitivity==0)\n        iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE;\n\n    if (iCaseSensitivity==1)\n        return strcmp(fileName1,fileName2);\n\n    return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2);\n}\n\n#ifndef BUFREADCOMMENT\n#define BUFREADCOMMENT (0x400)\n#endif\n\n/*\n  Locate the Central directory of a zipfile (at the end, just before\n    the global comment)\n*/\nlocal ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream));\nlocal ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)\n{\n    unsigned char* buf;\n    ZPOS64_T uSizeFile;\n    ZPOS64_T uBackRead;\n    ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */\n    ZPOS64_T uPosFound=0;\n\n    if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)\n        return 0;\n\n\n    uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);\n\n    if (uMaxBack>uSizeFile)\n        uMaxBack = uSizeFile;\n\n    buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);\n    if (buf==NULL)\n        return 0;\n\n    uBackRead = 4;\n    while (uBackRead<uMaxBack)\n    {\n        uLong uReadSize;\n        ZPOS64_T uReadPos ;\n        int i;\n        if (uBackRead+BUFREADCOMMENT>uMaxBack)\n            uBackRead = uMaxBack;\n        else\n            uBackRead+=BUFREADCOMMENT;\n        uReadPos = uSizeFile-uBackRead ;\n\n        uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?\n                     (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);\n        if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)\n            break;\n\n        if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)\n            break;\n\n        for (i=(int)uReadSize-3; (i--)>0;)\n            if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&\n                ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))\n            {\n                uPosFound = uReadPos+i;\n                break;\n            }\n\n        if (uPosFound!=0)\n            break;\n    }\n    TRYFREE(buf);\n    return uPosFound;\n}\n\n\n/*\n  Locate the Central directory 64 of a zipfile (at the end, just before\n    the global comment)\n*/\nlocal ZPOS64_T unz64local_SearchCentralDir64 OF((\n    const zlib_filefunc64_32_def* pzlib_filefunc_def,\n    voidpf filestream));\n\nlocal ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def,\n                                      voidpf filestream)\n{\n    unsigned char* buf;\n    ZPOS64_T uSizeFile;\n    ZPOS64_T uBackRead;\n    ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */\n    ZPOS64_T uPosFound=0;\n    uLong uL;\n                ZPOS64_T relativeOffset;\n\n    if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0)\n        return 0;\n\n\n    uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream);\n\n    if (uMaxBack>uSizeFile)\n        uMaxBack = uSizeFile;\n\n    buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4);\n    if (buf==NULL)\n        return 0;\n\n    uBackRead = 4;\n    while (uBackRead<uMaxBack)\n    {\n        uLong uReadSize;\n        ZPOS64_T uReadPos;\n        int i;\n        if (uBackRead+BUFREADCOMMENT>uMaxBack)\n            uBackRead = uMaxBack;\n        else\n            uBackRead+=BUFREADCOMMENT;\n        uReadPos = uSizeFile-uBackRead ;\n\n        uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ?\n                     (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos);\n        if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0)\n            break;\n\n        if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)\n            break;\n\n        for (i=(int)uReadSize-3; (i--)>0;)\n            if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&\n                ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))\n            {\n                uPosFound = uReadPos+i;\n                break;\n            }\n\n        if (uPosFound!=0)\n            break;\n    }\n    TRYFREE(buf);\n    if (uPosFound == 0)\n        return 0;\n\n    /* Zip64 end of central directory locator */\n    if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0)\n        return 0;\n\n    /* the signature, already checked */\n    if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)\n        return 0;\n\n    /* number of the disk with the start of the zip64 end of  central directory */\n    if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)\n        return 0;\n    if (uL != 0)\n        return 0;\n\n    /* relative offset of the zip64 end of central directory record */\n    if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK)\n        return 0;\n\n    /* total number of disks */\n    if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)\n        return 0;\n    if (uL != 1)\n        return 0;\n\n    /* Goto end of central directory record */\n    if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0)\n        return 0;\n\n     /* the signature */\n    if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK)\n        return 0;\n\n    if (uL != 0x06064b50)\n        return 0;\n\n    return relativeOffset;\n}\n\n/*\n  Open a Zip file. path contain the full pathname (by example,\n     on a Windows NT computer \"c:\\\\test\\\\zlib114.zip\" or on an Unix computer\n     \"zlib/zlib114.zip\".\n     If the zipfile cannot be opened (file doesn't exist or in not valid), the\n       return value is NULL.\n     Else, the return value is a unzFile Handle, usable with other function\n       of this unzip package.\n*/\nlocal unzFile unzOpenInternal (const void *path,\n                               zlib_filefunc64_32_def* pzlib_filefunc64_32_def,\n                               int is64bitOpenFunction)\n{\n    unz64_s us;\n    unz64_s *s;\n    ZPOS64_T central_pos;\n    uLong   uL;\n\n    uLong number_disk;          /* number of the current dist, used for\n                                   spanning ZIP, unsupported, always 0*/\n    uLong number_disk_with_CD;  /* number the the disk with central dir, used\n                                   for spanning ZIP, unsupported, always 0*/\n    ZPOS64_T number_entry_CD;      /* total number of entries in\n                                   the central dir\n                                   (same than number_entry on nospan) */\n\n    int err=UNZ_OK;\n\n    if (unz_copyright[0]!=' ')\n        return NULL;\n\n    us.z_filefunc.zseek32_file = NULL;\n    us.z_filefunc.ztell32_file = NULL;\n    if (pzlib_filefunc64_32_def==NULL)\n        fill_fopen64_filefunc(&us.z_filefunc.zfile_func64);\n    else\n        us.z_filefunc = *pzlib_filefunc64_32_def;\n    us.is64bitOpenFunction = is64bitOpenFunction;\n\n\n\n    us.filestream = ZOPEN64(us.z_filefunc,\n                                                 path,\n                                                 ZLIB_FILEFUNC_MODE_READ |\n                                                 ZLIB_FILEFUNC_MODE_EXISTING);\n    if (us.filestream==NULL)\n        return NULL;\n\n    central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream);\n    if (central_pos)\n    {\n        uLong uS;\n        ZPOS64_T uL64;\n\n        us.isZip64 = 1;\n\n        if (ZSEEK64(us.z_filefunc, us.filestream,\n                                      central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)\n        err=UNZ_ERRNO;\n\n        /* the signature, already checked */\n        if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* size of zip64 end of central directory record */\n        if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* version made by */\n        if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* version needed to extract */\n        if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* number of this disk */\n        if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* number of the disk with the start of the central directory */\n        if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* total number of entries in the central directory on this disk */\n        if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* total number of entries in the central directory */\n        if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        if ((number_entry_CD!=us.gi.number_entry) ||\n            (number_disk_with_CD!=0) ||\n            (number_disk!=0))\n            err=UNZ_BADZIPFILE;\n\n        /* size of the central directory */\n        if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* offset of start of central directory with respect to the\n          starting disk number */\n        if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        us.gi.size_comment = 0;\n    }\n    else\n    {\n        central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream);\n        if (central_pos==0)\n            err=UNZ_ERRNO;\n\n        us.isZip64 = 0;\n\n        if (ZSEEK64(us.z_filefunc, us.filestream,\n                                        central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)\n            err=UNZ_ERRNO;\n\n        /* the signature, already checked */\n        if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* number of this disk */\n        if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* number of the disk with the start of the central directory */\n        if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)\n            err=UNZ_ERRNO;\n\n        /* total number of entries in the central dir on this disk */\n        if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)\n            err=UNZ_ERRNO;\n        us.gi.number_entry = uL;\n\n        /* total number of entries in the central dir */\n        if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)\n            err=UNZ_ERRNO;\n        number_entry_CD = uL;\n\n        if ((number_entry_CD!=us.gi.number_entry) ||\n            (number_disk_with_CD!=0) ||\n            (number_disk!=0))\n            err=UNZ_BADZIPFILE;\n\n        /* size of the central directory */\n        if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)\n            err=UNZ_ERRNO;\n        us.size_central_dir = uL;\n\n        /* offset of start of central directory with respect to the\n            starting disk number */\n        if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)\n            err=UNZ_ERRNO;\n        us.offset_central_dir = uL;\n\n        /* zipfile comment length */\n        if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK)\n            err=UNZ_ERRNO;\n    }\n\n    if ((central_pos<us.offset_central_dir+us.size_central_dir) &&\n        (err==UNZ_OK))\n        err=UNZ_BADZIPFILE;\n\n    if (err!=UNZ_OK)\n    {\n        ZCLOSE64(us.z_filefunc, us.filestream);\n        return NULL;\n    }\n\n    us.byte_before_the_zipfile = central_pos -\n                            (us.offset_central_dir+us.size_central_dir);\n    us.central_pos = central_pos;\n    us.pfile_in_zip_read = NULL;\n    us.encrypted = 0;\n\n\n    s=(unz64_s*)ALLOC(sizeof(unz64_s));\n    if( s != NULL)\n    {\n        *s=us;\n        unzGoToFirstFile((unzFile)s);\n    }\n    return (unzFile)s;\n}\n\n\nunzFile ZEXPORT unzOpen2 (const char *path,\n                                        zlib_filefunc_def* pzlib_filefunc32_def)\n{\n    if (pzlib_filefunc32_def != NULL)\n    {\n        zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;\n        fill_zlib_filefunc64_32_def_from_filefunc32(&zlib_filefunc64_32_def_fill,pzlib_filefunc32_def);\n        return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 0);\n    }\n    else\n        return unzOpenInternal(path, NULL, 0);\n}\n\nunzFile ZEXPORT unzOpen2_64 (const void *path,\n                                     zlib_filefunc64_def* pzlib_filefunc_def)\n{\n    if (pzlib_filefunc_def != NULL)\n    {\n        zlib_filefunc64_32_def zlib_filefunc64_32_def_fill;\n        zlib_filefunc64_32_def_fill.zfile_func64 = *pzlib_filefunc_def;\n        zlib_filefunc64_32_def_fill.ztell32_file = NULL;\n        zlib_filefunc64_32_def_fill.zseek32_file = NULL;\n        return unzOpenInternal(path, &zlib_filefunc64_32_def_fill, 1);\n    }\n    else\n        return unzOpenInternal(path, NULL, 1);\n}\n\nunzFile ZEXPORT unzOpen (const char *path)\n{\n    return unzOpenInternal(path, NULL, 0);\n}\n\nunzFile ZEXPORT unzOpen64 (const void *path)\n{\n    return unzOpenInternal(path, NULL, 1);\n}\n\n/*\n  Close a ZipFile opened with unzipOpen.\n  If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),\n    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.\n  return UNZ_OK if there is no problem. */\nint ZEXPORT unzClose (unzFile file)\n{\n    unz64_s* s;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n\n    if (s->pfile_in_zip_read!=NULL)\n        unzCloseCurrentFile(file);\n\n    ZCLOSE64(s->z_filefunc, s->filestream);\n    TRYFREE(s);\n    return UNZ_OK;\n}\n\n\n/*\n  Write info about the ZipFile in the *pglobal_info structure.\n  No preparation of the structure is needed\n  return UNZ_OK if there is no problem. */\nint ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info)\n{\n    unz64_s* s;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    *pglobal_info=s->gi;\n    return UNZ_OK;\n}\n\nint ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32)\n{\n    unz64_s* s;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    /* to do : check if number_entry is not truncated */\n    pglobal_info32->number_entry = (uLong)s->gi.number_entry;\n    pglobal_info32->size_comment = s->gi.size_comment;\n    return UNZ_OK;\n}\n/*\n   Translate date/time from Dos format to tm_unz (readable more easily)\n*/\nlocal void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm)\n{\n    ZPOS64_T uDate;\n    uDate = (ZPOS64_T)(ulDosDate>>16);\n    ptm->tm_mday = (uInt)(uDate&0x1f) ;\n    ptm->tm_mon =  (uInt)((((uDate)&0x1E0)/0x20)-1) ;\n    ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;\n\n    ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);\n    ptm->tm_min =  (uInt) ((ulDosDate&0x7E0)/0x20) ;\n    ptm->tm_sec =  (uInt) (2*(ulDosDate&0x1f)) ;\n}\n\n/*\n  Get Info about the current file in the zipfile, with internal only info\n*/\nlocal int unz64local_GetCurrentFileInfoInternal OF((unzFile file,\n                                                  unz_file_info64 *pfile_info,\n                                                  unz_file_info64_internal\n                                                  *pfile_info_internal,\n                                                  char *szFileName,\n                                                  uLong fileNameBufferSize,\n                                                  void *extraField,\n                                                  uLong extraFieldBufferSize,\n                                                  char *szComment,\n                                                  uLong commentBufferSize));\n\nlocal int unz64local_GetCurrentFileInfoInternal (unzFile file,\n                                                  unz_file_info64 *pfile_info,\n                                                  unz_file_info64_internal\n                                                  *pfile_info_internal,\n                                                  char *szFileName,\n                                                  uLong fileNameBufferSize,\n                                                  void *extraField,\n                                                  uLong extraFieldBufferSize,\n                                                  char *szComment,\n                                                  uLong commentBufferSize)\n{\n    unz64_s* s;\n    unz_file_info64 file_info;\n    unz_file_info64_internal file_info_internal;\n    int err=UNZ_OK;\n    uLong uMagic;\n    long lSeek=0;\n    uLong uL;\n\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    if (ZSEEK64(s->z_filefunc, s->filestream,\n              s->pos_in_central_dir+s->byte_before_the_zipfile,\n              ZLIB_FILEFUNC_SEEK_SET)!=0)\n        err=UNZ_ERRNO;\n\n\n    /* we check the magic */\n    if (err==UNZ_OK)\n    {\n        if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)\n            err=UNZ_ERRNO;\n        else if (uMagic!=0x02014b50)\n            err=UNZ_BADZIPFILE;\n    }\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)\n        err=UNZ_ERRNO;\n    file_info.compressed_size = uL;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)\n        err=UNZ_ERRNO;\n    file_info.uncompressed_size = uL;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n                // relative offset of local header\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)\n        err=UNZ_ERRNO;\n    file_info_internal.offset_curfile = uL;\n\n    lSeek+=file_info.size_filename;\n    if ((err==UNZ_OK) && (szFileName!=NULL))\n    {\n        uLong uSizeRead ;\n        if (file_info.size_filename<fileNameBufferSize)\n        {\n            *(szFileName+file_info.size_filename)='\\0';\n            uSizeRead = file_info.size_filename;\n        }\n        else\n            uSizeRead = fileNameBufferSize;\n\n        if ((file_info.size_filename>0) && (fileNameBufferSize>0))\n            if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead)\n                err=UNZ_ERRNO;\n        lSeek -= uSizeRead;\n    }\n\n    // Read extrafield\n    if ((err==UNZ_OK) && (extraField!=NULL))\n    {\n        ZPOS64_T uSizeRead ;\n        if (file_info.size_file_extra<extraFieldBufferSize)\n            uSizeRead = file_info.size_file_extra;\n        else\n            uSizeRead = extraFieldBufferSize;\n\n        if (lSeek!=0)\n        {\n            if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)\n                lSeek=0;\n            else\n                err=UNZ_ERRNO;\n        }\n\n        if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))\n            if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead)\n                err=UNZ_ERRNO;\n\n        lSeek += file_info.size_file_extra - (uLong)uSizeRead;\n    }\n    else\n        lSeek += file_info.size_file_extra;\n\n\n    if ((err==UNZ_OK) && (file_info.size_file_extra != 0))\n    {\n                                uLong acc = 0;\n\n        // since lSeek now points to after the extra field we need to move back\n        lSeek -= file_info.size_file_extra;\n\n        if (lSeek!=0)\n        {\n            if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)\n                lSeek=0;\n            else\n                err=UNZ_ERRNO;\n        }\n\n        while(acc < file_info.size_file_extra)\n        {\n            uLong headerId;\n            uLong dataSize;\n\n            if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK)\n                err=UNZ_ERRNO;\n\n            if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK)\n                err=UNZ_ERRNO;\n\n            /* ZIP64 extra fields */\n            if (headerId == 0x0001)\n            {\n                uLong uL2;\n\n                if (file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1)\n                {\n                    if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)\n                        err=UNZ_ERRNO;\n                    }\n\n                if (file_info.compressed_size == (ZPOS64_T)(unsigned long)-1)\n                {\n                    if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK)\n                        err=UNZ_ERRNO;\n                }\n\n                if (file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1)\n                {\n                    /* Relative Header offset */\n                    if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK)\n                        err=UNZ_ERRNO;\n                }\n\n                if(file_info.disk_num_start == (unsigned long)-1)\n                {\n                    /* Disk Start Number */\n                    if (unz64local_getLong(&s->z_filefunc, s->filestream, &uL2) != UNZ_OK)\n                        err=UNZ_ERRNO;\n                }\n\n            }\n            else\n            {\n                if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0)\n                    err=UNZ_ERRNO;\n            }\n\n            acc += 2 + 2 + dataSize;\n        }\n    }\n\n    if ((err==UNZ_OK) && (szComment!=NULL))\n    {\n        uLong uSizeRead ;\n        if (file_info.size_file_comment<commentBufferSize)\n        {\n            *(szComment+file_info.size_file_comment)='\\0';\n            uSizeRead = file_info.size_file_comment;\n        }\n        else\n            uSizeRead = commentBufferSize;\n\n        if (lSeek!=0)\n        {\n            if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) {\n              //lSeek=0;\n\t\t\t}\n            else\n                err=UNZ_ERRNO;\n        }\n\n        if ((file_info.size_file_comment>0) && (commentBufferSize>0))\n            if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead)\n                err=UNZ_ERRNO;\n        //lSeek+=file_info.size_file_comment - uSizeRead;\n    }\n    //else\n    //    lSeek+=file_info.size_file_comment;\n\n\n    if ((err==UNZ_OK) && (pfile_info!=NULL))\n        *pfile_info=file_info;\n\n    if ((err==UNZ_OK) && (pfile_info_internal!=NULL))\n        *pfile_info_internal=file_info_internal;\n\n    return err;\n}\n\n\n\n/*\n  Write info about the ZipFile in the *pglobal_info structure.\n  No preparation of the structure is needed\n  return UNZ_OK if there is no problem.\n*/\nint ZEXPORT unzGetCurrentFileInfo64 (unzFile file,\n                                          unz_file_info64 * pfile_info,\n                                          char * szFileName, uLong fileNameBufferSize,\n                                          void *extraField, uLong extraFieldBufferSize,\n                                          char* szComment,  uLong commentBufferSize)\n{\n    return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL,\n                                                szFileName,fileNameBufferSize,\n                                                extraField,extraFieldBufferSize,\n                                                szComment,commentBufferSize);\n}\n\nint ZEXPORT unzGetCurrentFileInfo (unzFile file,\n                                          unz_file_info * pfile_info,\n                                          char * szFileName, uLong fileNameBufferSize,\n                                          void *extraField, uLong extraFieldBufferSize,\n                                          char* szComment,  uLong commentBufferSize)\n{\n    int err;\n    unz_file_info64 file_info64;\n    err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL,\n                                                szFileName,fileNameBufferSize,\n                                                extraField,extraFieldBufferSize,\n                                                szComment,commentBufferSize);\n    if (err==UNZ_OK)\n    {\n        pfile_info->version = file_info64.version;\n        pfile_info->version_needed = file_info64.version_needed;\n        pfile_info->flag = file_info64.flag;\n        pfile_info->compression_method = file_info64.compression_method;\n        pfile_info->dosDate = file_info64.dosDate;\n        pfile_info->crc = file_info64.crc;\n\n        pfile_info->size_filename = file_info64.size_filename;\n        pfile_info->size_file_extra = file_info64.size_file_extra;\n        pfile_info->size_file_comment = file_info64.size_file_comment;\n\n        pfile_info->disk_num_start = file_info64.disk_num_start;\n        pfile_info->internal_fa = file_info64.internal_fa;\n        pfile_info->external_fa = file_info64.external_fa;\n\n        pfile_info->tmu_date = file_info64.tmu_date,\n\n\n        pfile_info->compressed_size = (uLong)file_info64.compressed_size;\n        pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size;\n\n    }\n    return err;\n}\n\n/*\n  Set the current file of the zipfile to the first file\n  with retrieving an information about the file.\n  return UNZ_OK if there is no problem\n*/\nint ZEXPORT unzGoToFirstFile64 (unzFile file,\n                        unz_file_info64 *pfile_info,\n                        char *szFileName,\n                        uLong fileNameBufferSize)\n{\n    int err=UNZ_OK;\n    unz64_s* s;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    s->pos_in_central_dir=s->offset_central_dir;\n    s->num_file=0;\n    err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,\n                                             &s->cur_file_info_internal,\n                                             szFileName,fileNameBufferSize,NULL,0,NULL,0);\n    s->current_file_ok = (err == UNZ_OK);\n    if (pfile_info)\n        *pfile_info = s->cur_file_info;\n    return err;\n}\n\n/*\n  Set the current file of the zipfile to the first file.\n  return UNZ_OK if there is no problem\n*/\nint ZEXPORT unzGoToFirstFile (unzFile file)\n{\n    return unzGoToFirstFile64(file, NULL, NULL, 0);\n}\n\n/*\n  Set the current file of the zipfile to the next file\n  with retrieving an information about the file.\n  return UNZ_OK if there is no problem\n  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.\n*/\nint ZEXPORT unzGoToNextFile64 (unzFile file,\n                       unz_file_info64 *pfile_info,\n                       char *szFileName,\n                       uLong fileNameBufferSize)\n{\n    unz64_s* s;\n    int err;\n\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    if (!s->current_file_ok)\n        return UNZ_END_OF_LIST_OF_FILE;\n    if (s->gi.number_entry != 0xffff)    /* 2^16 files overflow hack */\n      if (s->num_file+1==s->gi.number_entry)\n        return UNZ_END_OF_LIST_OF_FILE;\n\n    s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +\n            s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ;\n    s->num_file++;\n    err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,\n                                               &s->cur_file_info_internal,\n                                               szFileName,fileNameBufferSize,NULL,0,NULL,0);\n    s->current_file_ok = (err == UNZ_OK);\n    if (pfile_info)\n        *pfile_info = s->cur_file_info;\n    return err;\n}\n\n/*\n  Set the current file of the zipfile to the next file.\n  return UNZ_OK if there is no problem\n  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.\n*/\nint ZEXPORT unzGoToNextFile (unzFile  file)\n{\n    return unzGoToNextFile64(file, NULL, NULL, 0);\n}\n\n\n/*\n  Try locate the file szFileName in the zipfile.\n  For the iCaseSensitivity signification, see unzipStringFileNameCompare\n\n  return value :\n  UNZ_OK if the file is found. It becomes the current file.\n  UNZ_END_OF_LIST_OF_FILE if the file is not found\n*/\nint ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity)\n{\n    unz64_s* s;\n    int err;\n\n    /* We remember the 'current' position in the file so that we can jump\n     * back there if we fail.\n     */\n    unz_file_info64 cur_file_infoSaved;\n    unz_file_info64_internal cur_file_info_internalSaved;\n    ZPOS64_T num_fileSaved;\n    ZPOS64_T pos_in_central_dirSaved;\n\n\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n\n    if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP)\n        return UNZ_PARAMERROR;\n\n    s=(unz64_s*)file;\n    if (!s->current_file_ok)\n        return UNZ_END_OF_LIST_OF_FILE;\n\n    /* Save the current state */\n    num_fileSaved = s->num_file;\n    pos_in_central_dirSaved = s->pos_in_central_dir;\n    cur_file_infoSaved = s->cur_file_info;\n    cur_file_info_internalSaved = s->cur_file_info_internal;\n\n    err = unzGoToFirstFile(file);\n\n    while (err == UNZ_OK)\n    {\n        char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];\n        err = unzGetCurrentFileInfo64(file,NULL,\n                                    szCurrentFileName,sizeof(szCurrentFileName)-1,\n                                    NULL,0,NULL,0);\n        if (err == UNZ_OK)\n        {\n            if (unzStringFileNameCompare(szCurrentFileName,\n                                            szFileName,iCaseSensitivity)==0)\n                return UNZ_OK;\n            err = unzGoToNextFile(file);\n        }\n    }\n\n    /* We failed, so restore the state of the 'current file' to where we\n     * were.\n     */\n    s->num_file = num_fileSaved ;\n    s->pos_in_central_dir = pos_in_central_dirSaved ;\n    s->cur_file_info = cur_file_infoSaved;\n    s->cur_file_info_internal = cur_file_info_internalSaved;\n    return err;\n}\n\n\n/*\n///////////////////////////////////////////\n// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net)\n// I need random access\n//\n// Further optimization could be realized by adding an ability\n// to cache the directory in memory. The goal being a single\n// comprehensive file read to put the file I need in a memory.\n*/\n\n/*\ntypedef struct unz_file_pos_s\n{\n    ZPOS64_T pos_in_zip_directory;   // offset in file\n    ZPOS64_T num_of_file;            // # of file\n} unz_file_pos;\n*/\n\nint ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos*  file_pos)\n{\n    unz64_s* s;\n\n    if (file==NULL || file_pos==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    if (!s->current_file_ok)\n        return UNZ_END_OF_LIST_OF_FILE;\n\n    file_pos->pos_in_zip_directory  = s->pos_in_central_dir;\n    file_pos->num_of_file           = s->num_file;\n\n    return UNZ_OK;\n}\n\nint ZEXPORT unzGetFilePos(\n    unzFile file,\n    unz_file_pos* file_pos)\n{\n    unz64_file_pos file_pos64;\n    int err = unzGetFilePos64(file,&file_pos64);\n    if (err==UNZ_OK)\n    {\n        file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory;\n        file_pos->num_of_file = (uLong)file_pos64.num_of_file;\n    }\n    return err;\n}\n\nint ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos)\n{\n    unz64_s* s;\n    int err;\n\n    if (file==NULL || file_pos==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n\n    /* jump to the right spot */\n    s->pos_in_central_dir = file_pos->pos_in_zip_directory;\n    s->num_file           = file_pos->num_of_file;\n\n    /* set the current file */\n    err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,\n                                               &s->cur_file_info_internal,\n                                               NULL,0,NULL,0,NULL,0);\n    /* return results */\n    s->current_file_ok = (err == UNZ_OK);\n    return err;\n}\n\nint ZEXPORT unzGoToFilePos(\n    unzFile file,\n    unz_file_pos* file_pos)\n{\n    unz64_file_pos file_pos64;\n    if (file_pos == NULL)\n        return UNZ_PARAMERROR;\n\n    file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory;\n    file_pos64.num_of_file = file_pos->num_of_file;\n    return unzGoToFilePos64(file,&file_pos64);\n}\n\n/*\n// Unzip Helper Functions - should be here?\n///////////////////////////////////////////\n*/\n\n/*\n  Read the local header of the current zipfile\n  Check the coherency of the local header and info in the end of central\n        directory about this file\n  store in *piSizeVar the size of extra info in local header\n        (filename and size of extra field data)\n*/\nlocal int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar,\n                                                    ZPOS64_T * poffset_local_extrafield,\n                                                    uInt  * psize_local_extrafield)\n{\n    uLong uMagic,uData,uFlags;\n    uLong size_filename;\n    uLong size_extra_field;\n    int err=UNZ_OK;\n\n    *piSizeVar = 0;\n    *poffset_local_extrafield = 0;\n    *psize_local_extrafield = 0;\n\n    if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +\n                                s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0)\n        return UNZ_ERRNO;\n\n\n    if (err==UNZ_OK)\n    {\n        if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK)\n            err=UNZ_ERRNO;\n        else if (uMagic!=0x04034b50)\n            err=UNZ_BADZIPFILE;\n    }\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)\n        err=UNZ_ERRNO;\n/*\n    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))\n        err=UNZ_BADZIPFILE;\n*/\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK)\n        err=UNZ_ERRNO;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK)\n        err=UNZ_ERRNO;\n    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))\n        err=UNZ_BADZIPFILE;\n\n    if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&\n/* #ifdef HAVE_BZIP2 */\n                         (s->cur_file_info.compression_method!=Z_BZIP2ED) &&\n/* #endif */\n                         (s->cur_file_info.compression_method!=Z_DEFLATED))\n        err=UNZ_BADZIPFILE;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */\n        err=UNZ_ERRNO;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */\n        err=UNZ_ERRNO;\n    else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0))\n        err=UNZ_BADZIPFILE;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */\n        err=UNZ_ERRNO;\n    else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0))\n        err=UNZ_BADZIPFILE;\n\n    if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */\n        err=UNZ_ERRNO;\n    else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0))\n        err=UNZ_BADZIPFILE;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK)\n        err=UNZ_ERRNO;\n    else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))\n        err=UNZ_BADZIPFILE;\n\n    *piSizeVar += (uInt)size_filename;\n\n    if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK)\n        err=UNZ_ERRNO;\n    *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +\n                                    SIZEZIPLOCALHEADER + size_filename;\n    *psize_local_extrafield = (uInt)size_extra_field;\n\n    *piSizeVar += (uInt)size_extra_field;\n\n    return err;\n}\n\n/*\n  Open for reading data the current file in the zipfile.\n  If there is no error and the file is opened, the return value is UNZ_OK.\n*/\nint ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method,\n                                            int* level, int raw, const char* password)\n{\n    int err=UNZ_OK;\n    uInt iSizeVar;\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    ZPOS64_T offset_local_extrafield;  /* offset of the local extra field */\n    uInt  size_local_extrafield;    /* size of the local extra field */\n#    ifndef NOUNCRYPT\n    char source[12];\n#    else\n    if (password != NULL)\n        return UNZ_PARAMERROR;\n#    endif\n\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    if (!s->current_file_ok)\n        return UNZ_PARAMERROR;\n\n    if (s->pfile_in_zip_read != NULL)\n        unzCloseCurrentFile(file);\n\n    if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK)\n        return UNZ_BADZIPFILE;\n\n    pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s));\n    if (pfile_in_zip_read_info==NULL)\n        return UNZ_INTERNALERROR;\n\n    pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE);\n    pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield;\n    pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield;\n    pfile_in_zip_read_info->pos_local_extrafield=0;\n    pfile_in_zip_read_info->raw=raw;\n\n    if (pfile_in_zip_read_info->read_buffer==NULL)\n    {\n        TRYFREE(pfile_in_zip_read_info);\n        return UNZ_INTERNALERROR;\n    }\n\n    pfile_in_zip_read_info->stream_initialised=0;\n\n    if (method!=NULL)\n        *method = (int)s->cur_file_info.compression_method;\n\n    if (level!=NULL)\n    {\n        *level = 6;\n        switch (s->cur_file_info.flag & 0x06)\n        {\n          case 6 : *level = 1; break;\n          case 4 : *level = 2; break;\n          case 2 : *level = 9; break;\n        }\n    }\n\n    if ((s->cur_file_info.compression_method!=0) &&\n/* #ifdef HAVE_BZIP2 */\n        (s->cur_file_info.compression_method!=Z_BZIP2ED) &&\n/* #endif */\n        (s->cur_file_info.compression_method!=Z_DEFLATED)) {\n\n        //err=UNZ_BADZIPFILE;\n    }\n    pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc;\n    pfile_in_zip_read_info->crc32=0;\n    pfile_in_zip_read_info->total_out_64=0;\n    pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method;\n    pfile_in_zip_read_info->filestream=s->filestream;\n    pfile_in_zip_read_info->z_filefunc=s->z_filefunc;\n    pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile;\n\n    pfile_in_zip_read_info->stream.total_out = 0;\n\n    if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw))\n    {\n#ifdef HAVE_BZIP2\n      pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0;\n      pfile_in_zip_read_info->bstream.bzfree = (free_func)0;\n      pfile_in_zip_read_info->bstream.opaque = (voidpf)0;\n      pfile_in_zip_read_info->bstream.state = (voidpf)0;\n\n      pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;\n      pfile_in_zip_read_info->stream.zfree = (free_func)0;\n      pfile_in_zip_read_info->stream.opaque = (voidpf)0;\n      pfile_in_zip_read_info->stream.next_in = (voidpf)0;\n      pfile_in_zip_read_info->stream.avail_in = 0;\n\n      err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0);\n      if (err == Z_OK)\n        pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED;\n      else\n      {\n        TRYFREE(pfile_in_zip_read_info);\n        return err;\n      }\n#else\n      pfile_in_zip_read_info->raw=1;\n#endif\n    }\n    else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw))\n    {\n      pfile_in_zip_read_info->stream.zalloc = (alloc_func)0;\n      pfile_in_zip_read_info->stream.zfree = (free_func)0;\n      pfile_in_zip_read_info->stream.opaque = (voidpf)0;\n      pfile_in_zip_read_info->stream.next_in = 0;\n      pfile_in_zip_read_info->stream.avail_in = 0;\n\n      err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS);\n      if (err == Z_OK)\n        pfile_in_zip_read_info->stream_initialised=Z_DEFLATED;\n      else\n      {\n        TRYFREE(pfile_in_zip_read_info);\n        return err;\n      }\n        /* windowBits is passed < 0 to tell that there is no zlib header.\n         * Note that in this case inflate *requires* an extra \"dummy\" byte\n         * after the compressed stream in order to complete decompression and\n         * return Z_STREAM_END.\n         * In unzip, i don't wait absolutely Z_STREAM_END because I known the\n         * size of both compressed and uncompressed data\n         */\n    }\n    pfile_in_zip_read_info->rest_read_compressed =\n            s->cur_file_info.compressed_size ;\n    pfile_in_zip_read_info->rest_read_uncompressed =\n            s->cur_file_info.uncompressed_size ;\n\n\n    pfile_in_zip_read_info->pos_in_zipfile =\n            s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER +\n              iSizeVar;\n\n    pfile_in_zip_read_info->stream.avail_in = (uInt)0;\n\n    s->pfile_in_zip_read = pfile_in_zip_read_info;\n                s->encrypted = 0;\n\n#    ifndef NOUNCRYPT\n    if (password != NULL)\n    {\n        int i;\n        s->pcrc_32_tab = get_crc_table();\n        init_keys(password,s->keys,s->pcrc_32_tab);\n        if (ZSEEK64(s->z_filefunc, s->filestream,\n                  s->pfile_in_zip_read->pos_in_zipfile +\n                     s->pfile_in_zip_read->byte_before_the_zipfile,\n                  SEEK_SET)!=0)\n            return UNZ_INTERNALERROR;\n        if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12)\n            return UNZ_INTERNALERROR;\n\n        for (i = 0; i<12; i++)\n            zdecode(s->keys,s->pcrc_32_tab,source[i]);\n\n        s->pfile_in_zip_read->pos_in_zipfile+=12;\n        s->encrypted=1;\n    }\n#    endif\n\n\n    return UNZ_OK;\n}\n\nint ZEXPORT unzOpenCurrentFile (unzFile file)\n{\n    return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL);\n}\n\nint ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char*  password)\n{\n    return unzOpenCurrentFile3(file, NULL, NULL, 0, password);\n}\n\nint ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw)\n{\n    return unzOpenCurrentFile3(file, method, level, raw, NULL);\n}\n\n/** Addition for GDAL : START */\n\nZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file)\n{\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    s=(unz64_s*)file;\n    if (file==NULL)\n        return 0; //UNZ_PARAMERROR;\n    pfile_in_zip_read_info=s->pfile_in_zip_read;\n    if (pfile_in_zip_read_info==NULL)\n        return 0; //UNZ_PARAMERROR;\n    return pfile_in_zip_read_info->pos_in_zipfile +\n                         pfile_in_zip_read_info->byte_before_the_zipfile;\n}\n\n/** Addition for GDAL : END */\n\n/*\n  Read bytes from the current file.\n  buf contain buffer where data must be copied\n  len the size of buf.\n\n  return the number of byte copied if some bytes are copied\n  return 0 if the end of file was reached\n  return <0 with error code if there is an error\n    (UNZ_ERRNO for IO error, or zLib error for uncompress error)\n*/\nint ZEXPORT unzReadCurrentFile  (unzFile file, voidp buf, unsigned len)\n{\n    int err=UNZ_OK;\n    uInt iRead = 0;\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    pfile_in_zip_read_info=s->pfile_in_zip_read;\n\n    if (pfile_in_zip_read_info==NULL)\n        return UNZ_PARAMERROR;\n\n\n    if (pfile_in_zip_read_info->read_buffer == NULL)\n        return UNZ_END_OF_LIST_OF_FILE;\n    if (len==0)\n        return 0;\n\n    pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;\n\n    pfile_in_zip_read_info->stream.avail_out = (uInt)len;\n\n    if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&\n        (!(pfile_in_zip_read_info->raw)))\n        pfile_in_zip_read_info->stream.avail_out =\n            (uInt)pfile_in_zip_read_info->rest_read_uncompressed;\n\n    if ((len>pfile_in_zip_read_info->rest_read_compressed+\n           pfile_in_zip_read_info->stream.avail_in) &&\n         (pfile_in_zip_read_info->raw))\n        pfile_in_zip_read_info->stream.avail_out =\n            (uInt)pfile_in_zip_read_info->rest_read_compressed+\n            pfile_in_zip_read_info->stream.avail_in;\n\n    while (pfile_in_zip_read_info->stream.avail_out>0)\n    {\n        if ((pfile_in_zip_read_info->stream.avail_in==0) &&\n            (pfile_in_zip_read_info->rest_read_compressed>0))\n        {\n            uInt uReadThis = UNZ_BUFSIZE;\n            if (pfile_in_zip_read_info->rest_read_compressed<uReadThis)\n                uReadThis = (uInt)pfile_in_zip_read_info->rest_read_compressed;\n            if (uReadThis == 0)\n                return UNZ_EOF;\n            if (ZSEEK64(pfile_in_zip_read_info->z_filefunc,\n                      pfile_in_zip_read_info->filestream,\n                      pfile_in_zip_read_info->pos_in_zipfile +\n                         pfile_in_zip_read_info->byte_before_the_zipfile,\n                         ZLIB_FILEFUNC_SEEK_SET)!=0)\n                return UNZ_ERRNO;\n            if (ZREAD64(pfile_in_zip_read_info->z_filefunc,\n                      pfile_in_zip_read_info->filestream,\n                      pfile_in_zip_read_info->read_buffer,\n                      uReadThis)!=uReadThis)\n                return UNZ_ERRNO;\n\n\n#            ifndef NOUNCRYPT\n            if(s->encrypted)\n            {\n                uInt i;\n                for(i=0;i<uReadThis;i++)\n                  pfile_in_zip_read_info->read_buffer[i] =\n                      zdecode(s->keys,s->pcrc_32_tab,\n                              pfile_in_zip_read_info->read_buffer[i]);\n            }\n#            endif\n\n\n            pfile_in_zip_read_info->pos_in_zipfile += uReadThis;\n\n            pfile_in_zip_read_info->rest_read_compressed-=uReadThis;\n\n            pfile_in_zip_read_info->stream.next_in =\n                (Bytef*)pfile_in_zip_read_info->read_buffer;\n            pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis;\n        }\n\n        if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw))\n        {\n            uInt uDoCopy,i ;\n\n            if ((pfile_in_zip_read_info->stream.avail_in == 0) &&\n                (pfile_in_zip_read_info->rest_read_compressed == 0))\n                return (iRead==0) ? UNZ_EOF : iRead;\n\n            if (pfile_in_zip_read_info->stream.avail_out <\n                            pfile_in_zip_read_info->stream.avail_in)\n                uDoCopy = pfile_in_zip_read_info->stream.avail_out ;\n            else\n                uDoCopy = pfile_in_zip_read_info->stream.avail_in ;\n\n            for (i=0;i<uDoCopy;i++)\n                *(pfile_in_zip_read_info->stream.next_out+i) =\n                        *(pfile_in_zip_read_info->stream.next_in+i);\n\n            pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy;\n\n            pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,\n                                pfile_in_zip_read_info->stream.next_out,\n                                uDoCopy);\n            pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy;\n            pfile_in_zip_read_info->stream.avail_in -= uDoCopy;\n            pfile_in_zip_read_info->stream.avail_out -= uDoCopy;\n            pfile_in_zip_read_info->stream.next_out += uDoCopy;\n            pfile_in_zip_read_info->stream.next_in += uDoCopy;\n            pfile_in_zip_read_info->stream.total_out += uDoCopy;\n            iRead += uDoCopy;\n        }\n        else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED)\n        {\n#ifdef HAVE_BZIP2\n            uLong uTotalOutBefore,uTotalOutAfter;\n            const Bytef *bufBefore;\n            uLong uOutThis;\n\n            pfile_in_zip_read_info->bstream.next_in        = (char*)pfile_in_zip_read_info->stream.next_in;\n            pfile_in_zip_read_info->bstream.avail_in       = pfile_in_zip_read_info->stream.avail_in;\n            pfile_in_zip_read_info->bstream.total_in_lo32  = pfile_in_zip_read_info->stream.total_in;\n            pfile_in_zip_read_info->bstream.total_in_hi32  = 0;\n            pfile_in_zip_read_info->bstream.next_out       = (char*)pfile_in_zip_read_info->stream.next_out;\n            pfile_in_zip_read_info->bstream.avail_out      = pfile_in_zip_read_info->stream.avail_out;\n            pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out;\n            pfile_in_zip_read_info->bstream.total_out_hi32 = 0;\n\n            uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32;\n            bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out;\n\n            err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream);\n\n            uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32;\n            uOutThis = uTotalOutAfter-uTotalOutBefore;\n\n            pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;\n\n            pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis));\n            pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis;\n            iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);\n\n            pfile_in_zip_read_info->stream.next_in   = (Bytef*)pfile_in_zip_read_info->bstream.next_in;\n            pfile_in_zip_read_info->stream.avail_in  = pfile_in_zip_read_info->bstream.avail_in;\n            pfile_in_zip_read_info->stream.total_in  = pfile_in_zip_read_info->bstream.total_in_lo32;\n            pfile_in_zip_read_info->stream.next_out  = (Bytef*)pfile_in_zip_read_info->bstream.next_out;\n            pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out;\n            pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32;\n\n            if (err==BZ_STREAM_END)\n              return (iRead==0) ? UNZ_EOF : iRead;\n            if (err!=BZ_OK)\n              break;\n#endif\n        } // end Z_BZIP2ED\n        else\n        {\n            ZPOS64_T uTotalOutBefore,uTotalOutAfter;\n            const Bytef *bufBefore;\n            ZPOS64_T uOutThis;\n            int flush=Z_SYNC_FLUSH;\n\n            uTotalOutBefore = pfile_in_zip_read_info->stream.total_out;\n            bufBefore = pfile_in_zip_read_info->stream.next_out;\n\n            /*\n            if ((pfile_in_zip_read_info->rest_read_uncompressed ==\n                     pfile_in_zip_read_info->stream.avail_out) &&\n                (pfile_in_zip_read_info->rest_read_compressed == 0))\n                flush = Z_FINISH;\n            */\n            err=inflate(&pfile_in_zip_read_info->stream,flush);\n\n            if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))\n              err = Z_DATA_ERROR;\n\n            uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;\n            uOutThis = uTotalOutAfter-uTotalOutBefore;\n\n            pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;\n\n            pfile_in_zip_read_info->crc32 =\n                crc32(pfile_in_zip_read_info->crc32,bufBefore,\n                        (uInt)(uOutThis));\n\n            pfile_in_zip_read_info->rest_read_uncompressed -=\n                uOutThis;\n\n            iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);\n\n            if (err==Z_STREAM_END)\n                return (iRead==0) ? UNZ_EOF : iRead;\n            if (err!=Z_OK)\n                break;\n        }\n    }\n\n    if (err==Z_OK)\n        return iRead;\n    return err;\n}\n\n\n/*\n  Give the current position in uncompressed data\n*/\nz_off_t ZEXPORT unztell (unzFile file)\n{\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    pfile_in_zip_read_info=s->pfile_in_zip_read;\n\n    if (pfile_in_zip_read_info==NULL)\n        return UNZ_PARAMERROR;\n\n    return (z_off_t)pfile_in_zip_read_info->stream.total_out;\n}\n\nZPOS64_T ZEXPORT unztell64 (unzFile file)\n{\n\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    if (file==NULL)\n        return (ZPOS64_T)-1;\n    s=(unz64_s*)file;\n    pfile_in_zip_read_info=s->pfile_in_zip_read;\n\n    if (pfile_in_zip_read_info==NULL)\n        return (ZPOS64_T)-1;\n\n    return pfile_in_zip_read_info->total_out_64;\n}\n\n\n/*\n  return 1 if the end of file was reached, 0 elsewhere\n*/\nint ZEXPORT unzeof (unzFile file)\n{\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    pfile_in_zip_read_info=s->pfile_in_zip_read;\n\n    if (pfile_in_zip_read_info==NULL)\n        return UNZ_PARAMERROR;\n\n    if (pfile_in_zip_read_info->rest_read_uncompressed == 0)\n        return 1;\n    else\n        return 0;\n}\n\n\n\n/*\nRead extra field from the current file (opened by unzOpenCurrentFile)\nThis is the local-header version of the extra field (sometimes, there is\nmore info in the local-header version than in the central-header)\n\n  if buf==NULL, it return the size of the local extra field that can be read\n\n  if buf!=NULL, len is the size of the buffer, the extra header is copied in\n    buf.\n  the return value is the number of bytes copied in buf, or (if <0)\n    the error code\n*/\nint ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len)\n{\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    uInt read_now;\n    ZPOS64_T size_to_read;\n\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    pfile_in_zip_read_info=s->pfile_in_zip_read;\n\n    if (pfile_in_zip_read_info==NULL)\n        return UNZ_PARAMERROR;\n\n    size_to_read = (pfile_in_zip_read_info->size_local_extrafield -\n                pfile_in_zip_read_info->pos_local_extrafield);\n\n    if (buf==NULL)\n        return (int)size_to_read;\n\n    if (len>size_to_read)\n        read_now = (uInt)size_to_read;\n    else\n        read_now = (uInt)len ;\n\n    if (read_now==0)\n        return 0;\n\n    if (ZSEEK64(pfile_in_zip_read_info->z_filefunc,\n              pfile_in_zip_read_info->filestream,\n              pfile_in_zip_read_info->offset_local_extrafield +\n              pfile_in_zip_read_info->pos_local_extrafield,\n              ZLIB_FILEFUNC_SEEK_SET)!=0)\n        return UNZ_ERRNO;\n\n    if (ZREAD64(pfile_in_zip_read_info->z_filefunc,\n              pfile_in_zip_read_info->filestream,\n              buf,read_now)!=read_now)\n        return UNZ_ERRNO;\n\n    return (int)read_now;\n}\n\n/*\n  Close the file in zip opened with unzipOpenCurrentFile\n  Return UNZ_CRCERROR if all the file was read but the CRC is not good\n*/\nint ZEXPORT unzCloseCurrentFile (unzFile file)\n{\n    int err=UNZ_OK;\n\n    unz64_s* s;\n    file_in_zip64_read_info_s* pfile_in_zip_read_info;\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    pfile_in_zip_read_info=s->pfile_in_zip_read;\n\n    if (pfile_in_zip_read_info==NULL)\n        return UNZ_PARAMERROR;\n\n\n    if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) &&\n        (!pfile_in_zip_read_info->raw))\n    {\n        if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait)\n            err=UNZ_CRCERROR;\n    }\n\n\n    TRYFREE(pfile_in_zip_read_info->read_buffer);\n    pfile_in_zip_read_info->read_buffer = NULL;\n    if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED)\n        inflateEnd(&pfile_in_zip_read_info->stream);\n#ifdef HAVE_BZIP2\n    else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED)\n        BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream);\n#endif\n\n\n    pfile_in_zip_read_info->stream_initialised = 0;\n    TRYFREE(pfile_in_zip_read_info);\n\n    s->pfile_in_zip_read=NULL;\n\n    return err;\n}\n\n\n/*\n  Get the global comment string of the ZipFile, in the szComment buffer.\n  uSizeBuf is the size of the szComment buffer.\n  return the number of byte copied or an error code <0\n*/\nint ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf)\n{\n    unz64_s* s;\n    uLong uReadThis ;\n    if (file==NULL)\n        return (int)UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n\n    uReadThis = uSizeBuf;\n    if (uReadThis>s->gi.size_comment)\n        uReadThis = s->gi.size_comment;\n\n    if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0)\n        return UNZ_ERRNO;\n\n    if (uReadThis>0)\n    {\n      *szComment='\\0';\n      if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis)\n        return UNZ_ERRNO;\n    }\n\n    if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment))\n        *(szComment+s->gi.size_comment)='\\0';\n    return (int)uReadThis;\n}\n\n/* Additions by RX '2004 */\nZPOS64_T ZEXPORT unzGetOffset64(unzFile file)\n{\n    unz64_s* s;\n\n    if (file==NULL)\n          return 0; //UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n    if (!s->current_file_ok)\n      return 0;\n    if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff)\n      if (s->num_file==s->gi.number_entry)\n         return 0;\n    return s->pos_in_central_dir;\n}\n\nuLong ZEXPORT unzGetOffset (unzFile file)\n{\n    ZPOS64_T offset64;\n\n    if (file==NULL)\n          return 0; //UNZ_PARAMERROR;\n    offset64 = unzGetOffset64(file);\n    return (uLong)offset64;\n}\n\nint ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos)\n{\n    unz64_s* s;\n    int err;\n\n    if (file==NULL)\n        return UNZ_PARAMERROR;\n    s=(unz64_s*)file;\n\n    s->pos_in_central_dir = pos;\n    s->num_file = s->gi.number_entry;      /* hack */\n    err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info,\n                                              &s->cur_file_info_internal,\n                                              NULL,0,NULL,0,NULL,0);\n    s->current_file_ok = (err == UNZ_OK);\n    return err;\n}\n\nint ZEXPORT unzSetOffset (unzFile file, uLong pos)\n{\n    return unzSetOffset64(file,pos);\n}\n\n} // end of namespace cocos2d\n"
  },
  {
    "path": "cocos2d/external/unzip/unzip.h",
    "content": "/* unzip.h -- IO for uncompress .zip files using zlib\n   Version 1.1, February 14h, 2010\n   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )\n\n         Modifications of Unzip for Zip64\n         Copyright (C) 2007-2008 Even Rouault\n\n         Modifications for Zip64 support on both zip and unzip\n         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )\n\n         For more info read MiniZip_info.txt\n\n         ---------------------------------------------------------------------------------\n\n        Condition of use and distribution are the same than zlib :\n\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the authors be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  ---------------------------------------------------------------------------------\n\n        Changes\n\n        See header of unzip64.c\n\n*/\n\n#ifndef _unz64_H\n#define _unz64_H\n\n#include \"CCPlatformDefine.h\"\n\n#ifndef _ZLIB_H\n#include \"zlib.h\"\n#endif\n\n#ifndef  _ZLIBIOAPI_H\n#include \"ioapi.h\"\n#endif\n\n#ifdef HAVE_BZIP2\n#include \"bzlib.h\"\n#endif\n\n#define Z_BZIP2ED 12\n\n#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)\n/* like the STRICT of WIN32, we define a pointer that cannot be converted\n    from (void*) without cast */\ntypedef struct TagunzFile__ { int unused; } unzFile__;\ntypedef unzFile__ *unzFile;\n#else\ntypedef voidp unzFile;\n#endif\n\n\n#define UNZ_OK                          (0)\n#define UNZ_END_OF_LIST_OF_FILE         (-100)\n#define UNZ_ERRNO                       (Z_ERRNO)\n#define UNZ_EOF                         (0)\n#define UNZ_PARAMERROR                  (-102)\n#define UNZ_BADZIPFILE                  (-103)\n#define UNZ_INTERNALERROR               (-104)\n#define UNZ_CRCERROR                    (-105)\n\nnamespace cocos2d {\n\n/* tm_unz contain date/time info */\ntypedef struct tm_unz_s\n{\n    uInt tm_sec;            /* seconds after the minute - [0,59] */\n    uInt tm_min;            /* minutes after the hour - [0,59] */\n    uInt tm_hour;           /* hours since midnight - [0,23] */\n    uInt tm_mday;           /* day of the month - [1,31] */\n    uInt tm_mon;            /* months since January - [0,11] */\n    uInt tm_year;           /* years - [1980..2044] */\n} tm_unz;\n\n/* unz_global_info structure contain global data about the ZIPfile\n   These data comes from the end of central dir */\ntypedef struct unz_global_info64_s\n{\n    ZPOS64_T number_entry;         /* total number of entries in\n                                     the central dir on this disk */\n    uLong size_comment;         /* size of the global comment of the zipfile */\n} unz_global_info64;\n\ntypedef struct unz_global_info_s\n{\n    uLong number_entry;         /* total number of entries in\n                                     the central dir on this disk */\n    uLong size_comment;         /* size of the global comment of the zipfile */\n} unz_global_info;\n\n/* unz_file_info contain information about a file in the zipfile */\ntypedef struct unz_file_info64_s\n{\n    uLong version;              /* version made by                 2 bytes */\n    uLong version_needed;       /* version needed to extract       2 bytes */\n    uLong flag;                 /* general purpose bit flag        2 bytes */\n    uLong compression_method;   /* compression method              2 bytes */\n    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */\n    uLong crc;                  /* crc-32                          4 bytes */\n    ZPOS64_T compressed_size;   /* compressed size                 8 bytes */\n    ZPOS64_T uncompressed_size; /* uncompressed size               8 bytes */\n    uLong size_filename;        /* filename length                 2 bytes */\n    uLong size_file_extra;      /* extra field length              2 bytes */\n    uLong size_file_comment;    /* file comment length             2 bytes */\n\n    uLong disk_num_start;       /* disk number start               2 bytes */\n    uLong internal_fa;          /* internal file attributes        2 bytes */\n    uLong external_fa;          /* external file attributes        4 bytes */\n\n    tm_unz tmu_date;\n} unz_file_info64;\n\ntypedef struct unz_file_info_s\n{\n    uLong version;              /* version made by                 2 bytes */\n    uLong version_needed;       /* version needed to extract       2 bytes */\n    uLong flag;                 /* general purpose bit flag        2 bytes */\n    uLong compression_method;   /* compression method              2 bytes */\n    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */\n    uLong crc;                  /* crc-32                          4 bytes */\n    uLong compressed_size;      /* compressed size                 4 bytes */\n    uLong uncompressed_size;    /* uncompressed size               4 bytes */\n    uLong size_filename;        /* filename length                 2 bytes */\n    uLong size_file_extra;      /* extra field length              2 bytes */\n    uLong size_file_comment;    /* file comment length             2 bytes */\n\n    uLong disk_num_start;       /* disk number start               2 bytes */\n    uLong internal_fa;          /* internal file attributes        2 bytes */\n    uLong external_fa;          /* external file attributes        4 bytes */\n\n    tm_unz tmu_date;\n} unz_file_info;\n\nint CC_DLL unzStringFileNameCompare OF ((const char* fileName1,\n                                                 const char* fileName2,\n                                                 int iCaseSensitivity));\n/*\n   Compare two filename (fileName1,fileName2).\n   If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp)\n   If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi\n                                or strcasecmp)\n   If iCaseSenisivity = 0, case sensitivity is default of your operating system\n    (like 1 on Unix, 2 on Windows)\n*/\n\n\nunzFile CC_DLL unzOpen OF((const char *path));\nunzFile CC_DLL unzOpen64 OF((const void *path));\n/*\n  Open a Zip file. path contain the full pathname (by example,\n     on a Windows XP computer \"c:\\\\zlib\\\\zlib113.zip\" or on an Unix computer\n     \"zlib/zlib113.zip\".\n     If the zipfile cannot be opened (file don't exist or in not valid), the\n       return value is NULL.\n     Else, the return value is a unzFile Handle, usable with other function\n       of this unzip package.\n     the \"64\" function take a const void* pointer, because the path is just the\n       value passed to the open64_file_func callback.\n     Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path\n       is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*\n       does not describe the reality\n*/\n\n\nunzFile CC_DLL unzOpen2 OF((const char *path,\n                                    zlib_filefunc_def* pzlib_filefunc_def));\n/*\n   Open a Zip file, like unzOpen, but provide a set of file low level API\n      for read/write the zip file (see ioapi.h)\n*/\n\nunzFile CC_DLL unzOpen2_64 OF((const void *path,\n                                    zlib_filefunc64_def* pzlib_filefunc_def));\n/*\n   Open a Zip file, like unz64Open, but provide a set of file low level API\n      for read/write the zip file (see ioapi.h)\n*/\n\nint CC_DLL unzClose OF((unzFile file));\n/*\n  Close a ZipFile opened with unzipOpen.\n  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),\n    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.\n  return UNZ_OK if there is no problem. */\n\nint CC_DLL unzGetGlobalInfo OF((unzFile file,\n                                        unz_global_info *pglobal_info));\n\nint CC_DLL unzGetGlobalInfo64 OF((unzFile file,\n                                        unz_global_info64 *pglobal_info));\n/*\n  Write info about the ZipFile in the *pglobal_info structure.\n  No preparation of the structure is needed\n  return UNZ_OK if there is no problem. */\n\n\nint CC_DLL unzGetGlobalComment OF((unzFile file,\n                                           char *szComment,\n                                           uLong uSizeBuf));\n/*\n  Get the global comment string of the ZipFile, in the szComment buffer.\n  uSizeBuf is the size of the szComment buffer.\n  return the number of byte copied or an error code <0\n*/\n\n\n/***************************************************************************/\n/* Unzip package allow you browse the directory of the zipfile */\n\nint CC_DLL unzGoToFirstFile OF((unzFile file));\n\n/*\n  Set the current file of the zipfile to the first file.\n  return UNZ_OK if there is no problem\n*/\n\nint CC_DLL unzGoToFirstFile64 OF((unzFile file,\n                        unz_file_info64 *pfile_info,\n                        char *szFileName,\n                        uLong fileNameBufferSize));\n/*\n  Set the current file of the zipfile to the first file\n  with retrieving an information about the file.\n  return UNZ_OK if there is no problem\n*/\n\nint CC_DLL unzGoToNextFile OF((unzFile file));\n/*\n  Set the current file of the zipfile to the next file.\n  return UNZ_OK if there is no problem\n  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.\n*/\n\nint CC_DLL unzGoToNextFile64 OF((unzFile file,\n                       unz_file_info64 *pfile_info,\n                       char *szFileName,\n                       uLong fileNameBufferSize));\n/*\n  Set the current file of the zipfile to the next file\n  with retrieving an information about the file.\n  return UNZ_OK if there is no problem\n  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.\n*/\n\nint CC_DLL unzLocateFile OF((unzFile file,\n                     const char *szFileName,\n                     int iCaseSensitivity));\n/*\n  Try locate the file szFileName in the zipfile.\n  For the iCaseSensitivity signification, see unzStringFileNameCompare\n\n  return value :\n  UNZ_OK if the file is found. It becomes the current file.\n  UNZ_END_OF_LIST_OF_FILE if the file is not found\n*/\n\n\n/* ****************************************** */\n/* Ryan supplied functions */\n/* unz_file_info contain information about a file in the zipfile */\ntypedef struct unz_file_pos_s\n{\n    uLong pos_in_zip_directory;   /* offset in zip file directory */\n    uLong num_of_file;            /* # of file */\n} unz_file_pos;\n\nint CC_DLL unzGetFilePos(\n    unzFile file,\n    unz_file_pos* file_pos);\n\nint CC_DLL unzGoToFilePos(\n    unzFile file,\n    unz_file_pos* file_pos);\n\ntypedef struct unz64_file_pos_s\n{\n    ZPOS64_T pos_in_zip_directory;   /* offset in zip file directory */\n    ZPOS64_T num_of_file;            /* # of file */\n} unz64_file_pos;\n\nint CC_DLL unzGetFilePos64(\n    unzFile file,\n    unz64_file_pos* file_pos);\n\nint CC_DLL unzGoToFilePos64(\n    unzFile file,\n    const unz64_file_pos* file_pos);\n\n/* ****************************************** */\n\nint CC_DLL unzGetCurrentFileInfo64 OF((unzFile file,\n                         unz_file_info64 *pfile_info,\n                         char *szFileName,\n                         uLong fileNameBufferSize,\n                         void *extraField,\n                         uLong extraFieldBufferSize,\n                         char *szComment,\n                         uLong commentBufferSize));\n\nint CC_DLL unzGetCurrentFileInfo OF((unzFile file,\n                         unz_file_info *pfile_info,\n                         char *szFileName,\n                         uLong fileNameBufferSize,\n                         void *extraField,\n                         uLong extraFieldBufferSize,\n                         char *szComment,\n                         uLong commentBufferSize));\n/*\n  Get Info about the current file\n  if pfile_info!=NULL, the *pfile_info structure will contain some info about\n        the current file\n  if szFileName!=NULL, the filename string will be copied in szFileName\n            (fileNameBufferSize is the size of the buffer)\n  if extraField!=NULL, the extra field information will be copied in extraField\n            (extraFieldBufferSize is the size of the buffer).\n            This is the Central-header version of the extra field\n  if szComment!=NULL, the comment string of the file will be copied in szComment\n            (commentBufferSize is the size of the buffer)\n*/\n\n\n/** Addition for GDAL : START */\n\nZPOS64_T CC_DLL unzGetCurrentFileZStreamPos64 OF((unzFile file));\n\n/** Addition for GDAL : END */\n\n\n/***************************************************************************/\n/* for reading the content of the current zipfile, you can open it, read data\n   from it, and close it (you can close it before reading all the file)\n   */\n\nint CC_DLL unzOpenCurrentFile OF((unzFile file));\n/*\n  Open for reading data the current file in the zipfile.\n  If there is no error, the return value is UNZ_OK.\n*/\n\nint CC_DLL unzOpenCurrentFilePassword OF((unzFile file,\n                                                  const char* password));\n/*\n  Open for reading data the current file in the zipfile.\n  password is a crypting password\n  If there is no error, the return value is UNZ_OK.\n*/\n\nint CC_DLL unzOpenCurrentFile2 OF((unzFile file,\n                                           int* method,\n                                           int* level,\n                                           int raw));\n/*\n  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)\n    if raw==1\n  *method will receive method of compression, *level will receive level of\n     compression\n  note : you can set level parameter as NULL (if you did not want known level,\n         but you CANNOT set method parameter as NULL\n*/\n\nint CC_DLL unzOpenCurrentFile3 OF((unzFile file,\n                                           int* method,\n                                           int* level,\n                                           int raw,\n                                           const char* password));\n/*\n  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)\n    if raw==1\n  *method will receive method of compression, *level will receive level of\n     compression\n  note : you can set level parameter as NULL (if you did not want known level,\n         but you CANNOT set method parameter as NULL\n*/\n\n\nint CC_DLL unzCloseCurrentFile OF((unzFile file));\n/*\n  Close the file in zip opened with unzOpenCurrentFile\n  Return UNZ_CRCERROR if all the file was read but the CRC is not good\n*/\n\nint CC_DLL unzReadCurrentFile OF((unzFile file,\n                      voidp buf,\n                      unsigned len));\n/*\n  Read bytes from the current file (opened by unzOpenCurrentFile)\n  buf contain buffer where data must be copied\n  len the size of buf.\n\n  return the number of byte copied if some bytes are copied\n  return 0 if the end of file was reached\n  return <0 with error code if there is an error\n    (UNZ_ERRNO for IO error, or zLib error for uncompress error)\n*/\n\nz_off_t CC_DLL unztell OF((unzFile file));\n\nZPOS64_T CC_DLL unztell64 OF((unzFile file));\n/*\n  Give the current position in uncompressed data\n*/\n\nint CC_DLL unzeof OF((unzFile file));\n/*\n  return 1 if the end of file was reached, 0 elsewhere\n*/\n\nint CC_DLL unzGetLocalExtrafield OF((unzFile file,\n                                             voidp buf,\n                                             unsigned len));\n/*\n  Read extra field from the current file (opened by unzOpenCurrentFile)\n  This is the local-header version of the extra field (sometimes, there is\n    more info in the local-header version than in the central-header)\n\n  if buf==NULL, it return the size of the local extra field\n\n  if buf!=NULL, len is the size of the buffer, the extra header is copied in\n    buf.\n  the return value is the number of bytes copied in buf, or (if <0)\n    the error code\n*/\n\n/***************************************************************************/\n\n/* Get the current file offset */\nZPOS64_T CC_DLL unzGetOffset64 (unzFile file);\nuLong CC_DLL unzGetOffset (unzFile file);\n\n/* Set the current file offset */\nint CC_DLL unzSetOffset64 (unzFile file, ZPOS64_T pos);\nint CC_DLL unzSetOffset (unzFile file, uLong pos);\n\n} // end of namespace cocos2d\n\n#endif /* _unz64_H */\n"
  },
  {
    "path": "cocos2d/external/webp/include/android/decode.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Main decoding functions for WebP images.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_DECODE_H_\n#define WEBP_WEBP_DECODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_DECODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the decoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetDecoderVersion(void);\n\n// Retrieve basic header information: width, height.\n// This function will also validate the header and return 0 in\n// case of formatting error.\n// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.\nWEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size,\n                             int* width, int* height);\n\n// Decodes WebP images pointed to by 'data' and returns RGBA samples, along\n// with the dimensions in *width and *height. The ordering of samples in\n// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).\n// The returned pointer should be deleted calling free().\n// Returns NULL in case of error.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.\n// If the bitstream contains transparency, it is ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n\n// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer\n// returned is the Y samples buffer. Upon return, *u and *v will point to\n// the U and V chroma data. These U and V buffers need NOT be free()'d,\n// unlike the returned Y luma one. The dimension of the U and V planes\n// are both (*width + 1) / 2 and (*height + 1)/ 2.\n// Upon return, the Y buffer has a stride returned as '*stride', while U and V\n// have a common stride returned as '*uv_stride'.\n// Return NULL in case of error.\n// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr\nWEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size,\n                                    int* width, int* height,\n                                    uint8_t** u, uint8_t** v,\n                                    int* stride, int* uv_stride);\n\n// These five functions are variants of the above ones, that decode the image\n// directly into a pre-allocated buffer 'output_buffer'. The maximum storage\n// available in this buffer is indicated by 'output_buffer_size'. If this\n// storage is not sufficient (or an error occurred), NULL is returned.\n// Otherwise, output_buffer is returned, for convenience.\n// The parameter 'output_stride' specifies the distance (in bytes)\n// between scanlines. Hence, output_buffer_size is expected to be at least\n// output_stride x picture-height.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeARGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// RGB and BGR variants. Here too the transparency information, if present,\n// will be dropped and ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly\n// into pre-allocated luma/chroma plane buffers. This function requires the\n// strides to be passed: one for the luma plane and one for each of the\n// chroma ones. The size of each plane buffer is passed as 'luma_size',\n// 'u_size' and 'v_size' respectively.\n// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred\n// during decoding (or because some buffers were found to be too small).\nWEBP_EXTERN(uint8_t*) WebPDecodeYUVInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n//------------------------------------------------------------------------------\n// Output colorspaces and buffer\n\n// Colorspaces\n// Note: the naming describes the byte-ordering of packed samples in memory.\n// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,...\n// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels.\n// RGB-565 and RGBA-4444 are also endian-agnostic and byte-oriented.\ntypedef enum { MODE_RGB = 0, MODE_RGBA = 1,\n               MODE_BGR = 2, MODE_BGRA = 3,\n               MODE_ARGB = 4, MODE_RGBA_4444 = 5,\n               MODE_RGB_565 = 6,\n               // RGB-premultiplied transparent modes (alpha value is preserved)\n               MODE_rgbA = 7,\n               MODE_bgrA = 8,\n               MODE_Argb = 9,\n               MODE_rgbA_4444 = 10,\n               // YUV modes must come after RGB ones.\n               MODE_YUV = 11, MODE_YUVA = 12,  // yuv 4:2:0\n               MODE_LAST = 13\n             } WEBP_CSP_MODE;\n\n// Some useful macros:\nstatic WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb ||\n          mode == MODE_rgbA_4444);\n}\n\nstatic WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||\n          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||\n          WebPIsPremultipliedMode(mode));\n}\n\nstatic WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {\n  return (mode < MODE_YUV);\n}\n\n//------------------------------------------------------------------------------\n// WebPDecBuffer: Generic structure for describing the output sample buffer.\n\ntypedef struct {    // view as RGBA\n  uint8_t* rgba;    // pointer to RGBA samples\n  int stride;       // stride in bytes from one scanline to the next.\n  size_t size;      // total size of the *rgba buffer.\n} WebPRGBABuffer;\n\ntypedef struct {              // view as YUVA\n  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples\n  int y_stride;               // luma stride\n  int u_stride, v_stride;     // chroma strides\n  int a_stride;               // alpha stride\n  size_t y_size;              // luma plane size\n  size_t u_size, v_size;      // chroma planes size\n  size_t a_size;              // alpha-plane size\n} WebPYUVABuffer;\n\n// Output buffer\ntypedef struct {\n  WEBP_CSP_MODE colorspace;  // Colorspace.\n  int width, height;         // Dimensions.\n  int is_external_memory;    // If true, 'internal_memory' pointer is not used.\n  union {\n    WebPRGBABuffer RGBA;\n    WebPYUVABuffer YUVA;\n  } u;                       // Nameless union of buffer parameters.\n  uint32_t       pad[4];     // padding for later use\n\n  uint8_t* private_memory;   // Internally allocated memory (only when\n                             // is_external_memory is false). Should not be used\n                             // externally, but accessed via the buffer union.\n} WebPDecBuffer;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int);\n\n// Initialize the structure as empty. Must be called before any other use.\n// Returns false in case of version mismatch\nstatic WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {\n  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);\n}\n\n// Free any memory associated with the buffer. Must always be called last.\n// Note: doesn't free the 'buffer' structure itself.\nWEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer);\n\n//------------------------------------------------------------------------------\n// Enumeration of the status codes\n\ntypedef enum {\n  VP8_STATUS_OK = 0,\n  VP8_STATUS_OUT_OF_MEMORY,\n  VP8_STATUS_INVALID_PARAM,\n  VP8_STATUS_BITSTREAM_ERROR,\n  VP8_STATUS_UNSUPPORTED_FEATURE,\n  VP8_STATUS_SUSPENDED,\n  VP8_STATUS_USER_ABORT,\n  VP8_STATUS_NOT_ENOUGH_DATA\n} VP8StatusCode;\n\n//------------------------------------------------------------------------------\n// Incremental decoding\n//\n// This API allows streamlined decoding of partial data.\n// Picture can be incrementally decoded as data become available thanks to the\n// WebPIDecoder object. This object can be left in a SUSPENDED state if the\n// picture is only partially decoded, pending additional input.\n// Code example:\n//\n//   WebPInitDecBuffer(&buffer);\n//   buffer.colorspace = mode;\n//   ...\n//   WebPIDecoder* idec = WebPINewDecoder(&buffer);\n//   while (has_more_data) {\n//     // ... (get additional data)\n//     status = WebPIAppend(idec, new_data, new_data_size);\n//     if (status != VP8_STATUS_SUSPENDED ||\n//       break;\n//     }\n//\n//     // The above call decodes the current available buffer.\n//     // Part of the image can now be refreshed by calling to\n//     // WebPIDecGetRGB()/WebPIDecGetYUVA() etc.\n//   }\n//   WebPIDelete(idec);\n\ntypedef struct WebPIDecoder WebPIDecoder;\n\n// Creates a new incremental decoder with the supplied buffer parameter.\n// This output_buffer can be passed NULL, in which case a default output buffer\n// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer'\n// is kept, which means that the lifespan of 'output_buffer' must be larger than\n// that of the returned WebPIDecoder object.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the RGB/A samples specified by 'csp' into a preallocated\n// buffer 'output_buffer'. The size of this buffer is at least\n// 'output_buffer_size' and the stride (distance in bytes between two scanlines)\n// is specified by 'output_stride'. Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewRGB(\n    WEBP_CSP_MODE csp,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the raw luma/chroma samples into a preallocated planes. The luma\n// plane is specified by its pointer 'luma', its size 'luma_size' and its stride\n// 'luma_stride'. Similarly, the chroma-u plane is specified by the 'u',\n// 'u_size' and 'u_stride' parameters, and the chroma-v plane by 'v'\n// and 'v_size'. And same for the alpha-plane. The 'a' pointer can be pass\n// NULL in case one is not interested in the transparency plane.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUVA(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride,\n    uint8_t* a, size_t a_size, int a_stride);\n\n// Deprecated version of the above, without the alpha plane.\n// Kept for backward compatibility.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUV(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n// Deletes the WebPIDecoder object and associated memory. Must always be called\n// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.\nWEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec);\n\n// Copies and decodes the next available data. Returns VP8_STATUS_OK when\n// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more\n// data is expected. Returns error in other cases.\nWEBP_EXTERN(VP8StatusCode) WebPIAppend(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// A variant of the above function to be used when data buffer contains\n// partial data from the beginning. In this case data buffer is not copied\n// to the internal memory.\n// Note that the value of the 'data' pointer can change between calls to\n// WebPIUpdate, for instance when the data buffer is resized to fit larger data.\nWEBP_EXTERN(VP8StatusCode) WebPIUpdate(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// Returns the RGB/A image decoded so far. Returns NULL if output params\n// are not initialized yet. The RGB/A output type corresponds to the colorspace\n// specified during call to WebPINewDecoder() or WebPINewRGB().\n// *last_y is the index of last decoded row in raster scan order. Some pointers\n// (*last_y, *width etc.) can be NULL if corresponding information is not\n// needed.\nWEBP_EXTERN(uint8_t*) WebPIDecGetRGB(\n    const WebPIDecoder* idec, int* last_y,\n    int* width, int* height, int* stride);\n\n// Same as above function to get a YUVA image. Returns pointer to the luma\n// plane or NULL in case of error. If there is no alpha information\n// the alpha pointer '*a' will be returned NULL.\nWEBP_EXTERN(uint8_t*) WebPIDecGetYUVA(\n    const WebPIDecoder* idec, int* last_y,\n    uint8_t** u, uint8_t** v, uint8_t** a,\n    int* width, int* height, int* stride, int* uv_stride, int* a_stride);\n\n// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the\n// alpha information (if present). Kept for backward compatibility.\nstatic WEBP_INLINE uint8_t* WebPIDecGetYUV(\n    const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v,\n    int* width, int* height, int* stride, int* uv_stride) {\n  return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height,\n                         stride, uv_stride, NULL);\n}\n\n// Generic call to retrieve information about the displayable area.\n// If non NULL, the left/right/width/height pointers are filled with the visible\n// rectangular area so far.\n// Returns NULL in case the incremental decoder object is in an invalid state.\n// Otherwise returns the pointer to the internal representation. This structure\n// is read-only, tied to WebPIDecoder's lifespan and should not be modified.\nWEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea(\n    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);\n\n//------------------------------------------------------------------------------\n// Advanced decoding parametrization\n//\n//  Code sample for using the advanced decoding API\n/*\n     // A) Init a configuration object\n     WebPDecoderConfig config;\n     CHECK(WebPInitDecoderConfig(&config));\n\n     // B) optional: retrieve the bitstream's features.\n     CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK);\n\n     // C) Adjust 'config', if needed\n     config.no_fancy = 1;\n     config.output.colorspace = MODE_BGRA;\n     // etc.\n\n     // Note that you can also make config.output point to an externally\n     // supplied memory buffer, provided it's big enough to store the decoded\n     // picture. Otherwise, config.output will just be used to allocate memory\n     // and store the decoded picture.\n\n     // D) Decode!\n     CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK);\n\n     // E) Decoded image is now in config.output (and config.output.u.RGBA)\n\n     // F) Reclaim memory allocated in config's object. It's safe to call\n     // this function even if the memory is external and wasn't allocated\n     // by WebPDecode().\n     WebPFreeDecBuffer(&config.output);\n*/\n\n// Features gathered from the bitstream\ntypedef struct {\n  int width;        // Width in pixels, as read from the bitstream.\n  int height;       // Height in pixels, as read from the bitstream.\n  int has_alpha;    // True if the bitstream contains an alpha channel.\n\n  // Unused for now:\n  int bitstream_version;        // should be 0 for now. TODO(later)\n  int no_incremental_decoding;  // if true, using incremental decoding is not\n                                // recommended.\n  int rotate;                   // TODO(later)\n  int uv_sampling;              // should be 0 for now. TODO(later)\n  uint32_t pad[3];              // padding for later use\n} WebPBitstreamFeatures;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal(\n    const uint8_t*, size_t, WebPBitstreamFeatures*, int);\n\n// Retrieve features from the bitstream. The *features structure is filled\n// with information gathered from the bitstream.\n// Returns false in case of error or version mismatch.\n// In case of error, features->bitstream_status will reflect the error code.\nstatic WEBP_INLINE VP8StatusCode WebPGetFeatures(\n    const uint8_t* data, size_t data_size,\n    WebPBitstreamFeatures* features) {\n  return WebPGetFeaturesInternal(data, data_size, features,\n                                 WEBP_DECODER_ABI_VERSION);\n}\n\n// Decoding options\ntypedef struct {\n  int bypass_filtering;               // if true, skip the in-loop filtering\n  int no_fancy_upsampling;            // if true, use faster pointwise upsampler\n  int use_cropping;                   // if true, cropping is applied _first_\n  int crop_left, crop_top;            // top-left position for cropping.\n                                      // Will be snapped to even values.\n  int crop_width, crop_height;        // dimension of the cropping area\n  int use_scaling;                    // if true, scaling is applied _afterward_\n  int scaled_width, scaled_height;    // final resolution\n  int use_threads;                    // if true, use multi-threaded decoding\n\n  // Unused for now:\n  int force_rotation;                 // forced rotation (to be applied _last_)\n  int no_enhancement;                 // if true, discard enhancement layer\n  uint32_t pad[6];                    // padding for later use\n} WebPDecoderOptions;\n\n// Main object storing the configuration for advanced decoding.\ntypedef struct {\n  WebPBitstreamFeatures input;  // Immutable bitstream features (optional)\n  WebPDecBuffer output;         // Output buffer (can point to external mem)\n  WebPDecoderOptions options;   // Decoding options\n} WebPDecoderConfig;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);\n\n// Initialize the configuration as empty. This function must always be\n// called first, unless WebPGetFeatures() is to be called.\n// Returns false in case of mismatched version.\nstatic WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {\n  return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);\n}\n\n// Instantiate a new incremental decoder object with the requested\n// configuration. The bitstream can be passed using 'data' and 'data_size'\n// parameter, in which case the features will be parsed and stored into\n// config->input. Otherwise, 'data' can be NULL and no parsing will occur.\n// Note that 'config' can be NULL too, in which case a default configuration\n// is used.\n// The return WebPIDecoder object must always be deleted calling WebPIDelete().\n// Returns NULL in case of error (and config->status will then reflect\n// the error condition).\nWEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size,\n                                       WebPDecoderConfig* config);\n\n// Non-incremental version. This version decodes the full data at once, taking\n// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK\n// if the decoding was successful).\nWEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size,\n                                      WebPDecoderConfig* config);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DECODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/android/encode.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//   WebP encoder: main interface\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_ENCODE_H_\n#define WEBP_WEBP_ENCODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_ENCODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the encoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetEncoderVersion(void);\n\n//------------------------------------------------------------------------------\n// One-stop-shop call! No questions asked:\n\n// Returns the size of the compressed data (pointed to by *output), or 0 if\n// an error occurred. The compressed data must be released by the caller\n// using the call 'free(*output)'.\n// These functions compress using the lossy format, and the quality_factor\n// can go from 0 (smaller output, lower quality) to 100 (best quality,\n// larger output).\nWEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\n\n// These functions are the equivalent of the above, but compressing in a\n// lossless manner. Files are usually larger than lossy format, but will\n// not suffer any compression loss.\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\n\n//------------------------------------------------------------------------------\n// Coding parameters\n\n// Image characteristics hint for the underlying encoder.\ntypedef enum {\n  WEBP_HINT_DEFAULT = 0,  // default preset.\n  WEBP_HINT_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_HINT_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_HINT_GRAPH,        // Discrete tone image (graph, map-tile etc).\n  WEBP_HINT_LAST\n} WebPImageHint;\n\ntypedef struct {\n  int lossless;           // Lossless encoding (0=lossy(default), 1=lossless).\n  float quality;          // between 0 (smallest file) and 100 (biggest)\n  int method;             // quality/speed trade-off (0=fast, 6=slower-better)\n\n  WebPImageHint image_hint;  // Hint for image type (lossless only for now).\n\n  // Parameters related to lossy compression only:\n  int target_size;        // if non-zero, set the desired target size in bytes.\n                          // Takes precedence over the 'compression' parameter.\n  float target_PSNR;      // if non-zero, specifies the minimal distortion to\n                          // try to achieve. Takes precedence over target_size.\n  int segments;           // maximum number of segments to use, in [1..4]\n  int sns_strength;       // Spatial Noise Shaping. 0=off, 100=maximum.\n  int filter_strength;    // range: [0 = off .. 100 = strongest]\n  int filter_sharpness;   // range: [0 = off .. 7 = least sharp]\n  int filter_type;        // filtering type: 0 = simple, 1 = strong (only used\n                          // if filter_strength > 0 or autofilter > 0)\n  int autofilter;         // Auto adjust filter's strength [0 = off, 1 = on]\n  int alpha_compression;  // Algorithm for encoding the alpha plane (0 = none,\n                          // 1 = compressed with WebP lossless). Default is 1.\n  int alpha_filtering;    // Predictive filtering method for alpha plane.\n                          //  0: none, 1: fast, 2: best. Default if 1.\n  int alpha_quality;      // Between 0 (smallest size) and 100 (lossless).\n                          // Default is 100.\n  int pass;               // number of entropy-analysis passes (in [1..10]).\n\n  int show_compressed;    // if true, export the compressed picture back.\n                          // In-loop filtering is not applied.\n  int preprocessing;      // preprocessing filter (0=none, 1=segment-smooth)\n  int partitions;         // log2(number of token partitions) in [0..3]. Default\n                          // is set to 0 for easier progressive decoding.\n  int partition_limit;    // quality degradation allowed to fit the 512k limit\n                          // on prediction modes coding (0: no degradation,\n                          // 100: maximum possible degradation).\n\n  uint32_t pad[8];        // padding for later use\n} WebPConfig;\n\n// Enumerate some predefined settings for WebPConfig, depending on the type\n// of source picture. These presets are used when calling WebPConfigPreset().\ntypedef enum {\n  WEBP_PRESET_DEFAULT = 0,  // default preset.\n  WEBP_PRESET_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_PRESET_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_PRESET_DRAWING,      // hand or line drawing, with high-contrast details\n  WEBP_PRESET_ICON,         // small-sized colorful images\n  WEBP_PRESET_TEXT          // text-like\n} WebPPreset;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int);\n\n// Should always be called, to initialize a fresh WebPConfig structure before\n// modification. Returns false in case of version mismatch. WebPConfigInit()\n// must have succeeded before using the 'config' object.\n// Note that the default values are lossless=0 and quality=75.\nstatic WEBP_INLINE int WebPConfigInit(WebPConfig* config) {\n  return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// This function will initialize the configuration according to a predefined\n// set of parameters (referred to by 'preset') and a given quality factor.\n// This function can be called as a replacement to WebPConfigInit(). Will\n// return false in case of error.\nstatic WEBP_INLINE int WebPConfigPreset(WebPConfig* config,\n                                        WebPPreset preset, float quality) {\n  return WebPConfigInitInternal(config, preset, quality,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// Returns true if 'config' is non-NULL and all configuration parameters are\n// within their valid ranges.\nWEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config);\n\n//------------------------------------------------------------------------------\n// Input / Output\n\ntypedef struct WebPPicture WebPPicture;   // main structure for I/O\n\n// Structure for storing auxiliary statistics (mostly for lossy encoding).\ntypedef struct {\n  int coded_size;         // final size\n\n  float PSNR[5];          // peak-signal-to-noise ratio for Y/U/V/All/Alpha\n  int block_count[3];     // number of intra4/intra16/skipped macroblocks\n  int header_bytes[2];    // approximate number of bytes spent for header\n                          // and mode-partition #0\n  int residual_bytes[3][4];  // approximate number of bytes spent for\n                             // DC/AC/uv coefficients for each (0..3) segments.\n  int segment_size[4];    // number of macroblocks in each segments\n  int segment_quant[4];   // quantizer values for each segments\n  int segment_level[4];   // filtering strength for each segments [0..63]\n\n  int alpha_data_size;    // size of the transparency data\n  int layer_data_size;    // size of the enhancement layer data\n\n  // lossless encoder statistics\n  uint32_t lossless_features;  // bit0:predictor bit1:cross-color transform\n                               // bit2:subtract-green bit3:color indexing\n  int histogram_bits;          // number of precision bits of histogram\n  int transform_bits;          // precision bits for transform\n  int cache_bits;              // number of bits for color cache lookup\n  int palette_size;            // number of color in palette, if used\n  int lossless_size;           // final lossless size\n\n  uint32_t pad[4];        // padding for later use\n} WebPAuxStats;\n\n// Signature for output function. Should return true if writing was successful.\n// data/data_size is the segment of data to write, and 'picture' is for\n// reference (and so one can make use of picture->custom_ptr).\ntypedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size,\n                                  const WebPPicture* picture);\n\n// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using\n// the following WebPMemoryWriter object (to be set as a custom_ptr).\ntypedef struct {\n  uint8_t* mem;       // final buffer (of size 'max_size', larger than 'size').\n  size_t   size;      // final size\n  size_t   max_size;  // total capacity\n  uint32_t pad[1];    // padding for later use\n} WebPMemoryWriter;\n\n// The following must be called first before any use.\nWEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer);\n\n// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon\n// completion, writer.mem and writer.size will hold the coded data.\nWEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size,\n                                 const WebPPicture* picture);\n\n// Progress hook, called from time to time to report progress. It can return\n// false to request an abort of the encoding process, or true otherwise if\n// everything is OK.\ntypedef int (*WebPProgressHook)(int percent, const WebPPicture* picture);\n\ntypedef enum {\n  // chroma sampling\n  WEBP_YUV420 = 0,   // 4:2:0\n  WEBP_YUV422 = 1,   // 4:2:2\n  WEBP_YUV444 = 2,   // 4:4:4\n  WEBP_YUV400 = 3,   // grayscale\n  WEBP_CSP_UV_MASK = 3,   // bit-mask to get the UV sampling factors\n  // alpha channel variants\n  WEBP_YUV420A = 4,\n  WEBP_YUV422A = 5,\n  WEBP_YUV444A = 6,\n  WEBP_YUV400A = 7,   // grayscale + alpha\n  WEBP_CSP_ALPHA_BIT = 4   // bit that is set if alpha is present\n} WebPEncCSP;\n\n// Encoding error conditions.\ntypedef enum {\n  VP8_ENC_OK = 0,\n  VP8_ENC_ERROR_OUT_OF_MEMORY,            // memory error allocating objects\n  VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY,  // memory error while flushing bits\n  VP8_ENC_ERROR_NULL_PARAMETER,           // a pointer parameter is NULL\n  VP8_ENC_ERROR_INVALID_CONFIGURATION,    // configuration is invalid\n  VP8_ENC_ERROR_BAD_DIMENSION,            // picture has invalid width/height\n  VP8_ENC_ERROR_PARTITION0_OVERFLOW,      // partition is bigger than 512k\n  VP8_ENC_ERROR_PARTITION_OVERFLOW,       // partition is bigger than 16M\n  VP8_ENC_ERROR_BAD_WRITE,                // error while flushing bytes\n  VP8_ENC_ERROR_FILE_TOO_BIG,             // file is bigger than 4G\n  VP8_ENC_ERROR_USER_ABORT,               // abort request by user\n  VP8_ENC_ERROR_LAST                      // list terminator. always last.\n} WebPEncodingError;\n\n// maximum width/height allowed (inclusive), in pixels\n#define WEBP_MAX_DIMENSION 16383\n\n// Main exchange structure (input samples, output bytes, statistics)\nstruct WebPPicture {\n\n  //   INPUT\n  //////////////\n  // Main flag for encoder selecting between ARGB or YUV input.\n  // It is recommended to use ARGB input (*argb, argb_stride) for lossless\n  // compression, and YUV input (*y, *u, *v, etc.) for lossy compression\n  // since these are the respective native colorspace for these formats.\n  int use_argb;\n\n  // YUV input (mostly used for input to lossy compression)\n  WebPEncCSP colorspace;     // colorspace: should be YUV420 for now (=Y'CbCr).\n  int width, height;         // dimensions (less or equal to WEBP_MAX_DIMENSION)\n  uint8_t *y, *u, *v;        // pointers to luma/chroma planes.\n  int y_stride, uv_stride;   // luma/chroma strides.\n  uint8_t* a;                // pointer to the alpha plane\n  int a_stride;              // stride of the alpha plane\n  uint32_t pad1[2];          // padding for later use\n\n  // ARGB input (mostly used for input to lossless compression)\n  uint32_t* argb;            // Pointer to argb (32 bit) plane.\n  int argb_stride;           // This is stride in pixels units, not bytes.\n  uint32_t pad2[3];          // padding for later use\n\n  //   OUTPUT\n  ///////////////\n  // Byte-emission hook, to store compressed bytes as they are ready.\n  WebPWriterFunction writer;  // can be NULL\n  void* custom_ptr;           // can be used by the writer.\n\n  // map for extra information (only for lossy compression mode)\n  int extra_info_type;    // 1: intra type, 2: segment, 3: quant\n                          // 4: intra-16 prediction mode,\n                          // 5: chroma prediction mode,\n                          // 6: bit cost, 7: distortion\n  uint8_t* extra_info;    // if not NULL, points to an array of size\n                          // ((width + 15) / 16) * ((height + 15) / 16) that\n                          // will be filled with a macroblock map, depending\n                          // on extra_info_type.\n\n  //   STATS AND REPORTS\n  ///////////////////////////\n  // Pointer to side statistics (updated only if not NULL)\n  WebPAuxStats* stats;\n\n  // Error code for the latest error encountered during encoding\n  WebPEncodingError error_code;\n\n  // If not NULL, report progress during encoding.\n  WebPProgressHook progress_hook;\n\n  void* user_data;        // this field is free to be set to any value and\n                          // used during callbacks (like progress-report e.g.).\n\n  uint32_t pad3[3];       // padding for later use\n\n  // Unused for now: original samples (for non-YUV420 modes)\n  uint8_t *u0, *v0;\n  int uv0_stride;\n\n  uint32_t pad4[7];       // padding for later use\n\n  // PRIVATE FIELDS\n  ////////////////////\n  void* memory_;          // row chunk of memory for yuva planes\n  void* memory_argb_;     // and for argb too.\n  void* pad5[2];          // padding for later use\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int);\n\n// Should always be called, to initialize the structure. Returns false in case\n// of version mismatch. WebPPictureInit() must have succeeded before using the\n// 'picture' object.\n// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.\nstatic WEBP_INLINE int WebPPictureInit(WebPPicture* picture) {\n  return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION);\n}\n\n//------------------------------------------------------------------------------\n// WebPPicture utils\n\n// Convenience allocation / deallocation based on picture->width/height:\n// Allocate y/u/v buffers as per colorspace/width/height specification.\n// Note! This function will free the previous buffer if needed.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture);\n\n// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*().\n// Note that this function does _not_ free the memory used by the 'picture'\n// object itself.\n// Besides memory (which is reclaimed) all other fields of 'picture' are\n// preserved.\nWEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture);\n\n// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return,\n// *dst will fully own the copied pixels (this is not a view).\n// Returns false in case of memory allocation error.\nWEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst);\n\n// Compute PSNR or SSIM distortion between two pictures.\n// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order.\n// Returns false in case of error (pic1 and pic2 don't have same dimension, ...)\n// Warning: this function is rather CPU-intensive.\nWEBP_EXTERN(int) WebPPictureDistortion(\n    const WebPPicture* pic1, const WebPPicture* pic2,\n    int metric_type,           // 0 = PSNR, 1 = SSIM\n    float result[5]);\n\n// self-crops a picture to the rectangle defined by top/left/width/height.\n// Returns false in case of memory allocation error, or if the rectangle is\n// outside of the source picture.\n// The rectangle for the view is defined by the top-left corner pixel\n// coordinates (left, top) as well as its width and height. This rectangle\n// must be fully be comprised inside the 'src' source picture. If the source\n// picture uses the YUV420 colorspace, the top and left coordinates will be\n// snapped to even values.\nWEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture,\n                                 int left, int top, int width, int height);\n\n// Extracts a view from 'src' picture into 'dst'. The rectangle for the view\n// is defined by the top-left corner pixel coordinates (left, top) as well\n// as its width and height. This rectangle must be fully be comprised inside\n// the 'src' source picture. If the source picture uses the YUV420 colorspace,\n// the top and left coordinates will be snapped to even values.\n// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed\n// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so,\n// the original dimension will be lost).\n// Returns false in case of memory allocation error or invalid parameters.\nWEBP_EXTERN(int) WebPPictureView(const WebPPicture* src,\n                                 int left, int top, int width, int height,\n                                 WebPPicture* dst);\n\n// Returns true if the 'picture' is actually a view and therefore does\n// not own the memory for pixels.\nWEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture);\n\n// Rescale a picture to new dimension width x height.\n// Now gamma correction is applied.\n// Returns false in case of error (invalid parameter or insufficient memory).\nWEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height);\n\n// Colorspace conversion function to import RGB samples.\n// Previous buffer will be free'd, if any.\n// *rgb buffer should have a size of at least height * rgb_stride.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureImportRGB(\n    WebPPicture* picture, const uint8_t* rgb, int rgb_stride);\n// Same, but for RGBA buffer.\nWEBP_EXTERN(int) WebPPictureImportRGBA(\n    WebPPicture* picture, const uint8_t* rgba, int rgba_stride);\n// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format\n// input buffer ignoring the alpha channel. Avoids needing to copy the data\n// to a temporary 24-bit RGB buffer to import the RGB only.\nWEBP_EXTERN(int) WebPPictureImportRGBX(\n    WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride);\n\n// Variants of the above, but taking BGR(A|X) input.\nWEBP_EXTERN(int) WebPPictureImportBGR(\n    WebPPicture* picture, const uint8_t* bgr, int bgr_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRA(\n    WebPPicture* picture, const uint8_t* bgra, int bgra_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRX(\n    WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride);\n\n// Converts picture->argb data to the YUVA format specified by 'colorspace'.\n// Upon return, picture->use_argb is set to false. The presence of real\n// non-opaque transparent values is detected, and 'colorspace' will be\n// adjusted accordingly. Note that this method is lossy.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture,\n                                       WebPEncCSP colorspace);\n\n// Converts picture->yuv to picture->argb and sets picture->use_argb to true.\n// The input format must be YUV_420 or YUV_420A.\n// Note that the use of this method is discouraged if one has access to the\n// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the\n// conversion from YUV420 to ARGB incurs a small loss too.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture);\n\n// Helper function: given a width x height plane of YUV(A) samples\n// (with stride 'stride'), clean-up the YUV samples under fully transparent\n// area, to help compressibility (no guarantee, though).\nWEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture);\n\n// Scan the picture 'picture' for the presence of non fully opaque alpha values.\n// Returns true in such case. Otherwise returns false (indicating that the\n// alpha plane can be ignored altogether e.g.).\nWEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n// Main call\n\n// Main encoding call, after config and picture have been initialized.\n// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION),\n// and the 'config' object must be a valid one.\n// Returns false in case of error, true otherwise.\n// In case of error, picture->error_code is updated accordingly.\n// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending\n// on the value of 'picture->use_argb'. It is highly recommended to use\n// the former for lossy encoding, and the latter for lossless encoding\n// (when config.lossless is true). Automatic conversion from one format to\n// another is provided but they both incur some loss.\nWEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_ENCODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/android/types.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Common types\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_TYPES_H_\n#define WEBP_WEBP_TYPES_H_\n\n#include <stddef.h>  // for size_t\n\n#ifndef _MSC_VER\n#include <inttypes.h>\n#ifdef __STRICT_ANSI__\n#define WEBP_INLINE\n#else  /* __STRICT_ANSI__ */\n#define WEBP_INLINE inline\n#endif\n#else\ntypedef signed   char int8_t;\ntypedef unsigned char uint8_t;\ntypedef signed   short int16_t;\ntypedef unsigned short uint16_t;\ntypedef signed   int int32_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long int uint64_t;\ntypedef long long int int64_t;\n#define WEBP_INLINE __forceinline\n#endif  /* _MSC_VER */\n\n#ifndef WEBP_EXTERN\n// This explicitly marks library functions and allows for changing the\n// signature for e.g., Windows DLL builds.\n#define WEBP_EXTERN(type) extern type\n#endif  /* WEBP_EXTERN */\n\n// Macro to check ABI compatibility (same major revision number)\n#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))\n\n#endif  /* WEBP_WEBP_TYPES_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/ios/decode.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Main decoding functions for WebP images.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_DECODE_H_\n#define WEBP_WEBP_DECODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_DECODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the decoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetDecoderVersion(void);\n\n// Retrieve basic header information: width, height.\n// This function will also validate the header and return 0 in\n// case of formatting error.\n// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.\nWEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size,\n                             int* width, int* height);\n\n// Decodes WebP images pointed to by 'data' and returns RGBA samples, along\n// with the dimensions in *width and *height. The ordering of samples in\n// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).\n// The returned pointer should be deleted calling free().\n// Returns NULL in case of error.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.\n// If the bitstream contains transparency, it is ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n\n// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer\n// returned is the Y samples buffer. Upon return, *u and *v will point to\n// the U and V chroma data. These U and V buffers need NOT be free()'d,\n// unlike the returned Y luma one. The dimension of the U and V planes\n// are both (*width + 1) / 2 and (*height + 1)/ 2.\n// Upon return, the Y buffer has a stride returned as '*stride', while U and V\n// have a common stride returned as '*uv_stride'.\n// Return NULL in case of error.\n// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr\nWEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size,\n                                    int* width, int* height,\n                                    uint8_t** u, uint8_t** v,\n                                    int* stride, int* uv_stride);\n\n// These five functions are variants of the above ones, that decode the image\n// directly into a pre-allocated buffer 'output_buffer'. The maximum storage\n// available in this buffer is indicated by 'output_buffer_size'. If this\n// storage is not sufficient (or an error occurred), NULL is returned.\n// Otherwise, output_buffer is returned, for convenience.\n// The parameter 'output_stride' specifies the distance (in bytes)\n// between scanlines. Hence, output_buffer_size is expected to be at least\n// output_stride x picture-height.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeARGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// RGB and BGR variants. Here too the transparency information, if present,\n// will be dropped and ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly\n// into pre-allocated luma/chroma plane buffers. This function requires the\n// strides to be passed: one for the luma plane and one for each of the\n// chroma ones. The size of each plane buffer is passed as 'luma_size',\n// 'u_size' and 'v_size' respectively.\n// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred\n// during decoding (or because some buffers were found to be too small).\nWEBP_EXTERN(uint8_t*) WebPDecodeYUVInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n//------------------------------------------------------------------------------\n// Output colorspaces and buffer\n\n// Colorspaces\n// Note: the naming describes the byte-ordering of packed samples in memory.\n// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,...\n// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels.\n// RGB-565 and RGBA-4444 are also endian-agnostic and byte-oriented.\ntypedef enum { MODE_RGB = 0, MODE_RGBA = 1,\n               MODE_BGR = 2, MODE_BGRA = 3,\n               MODE_ARGB = 4, MODE_RGBA_4444 = 5,\n               MODE_RGB_565 = 6,\n               // RGB-premultiplied transparent modes (alpha value is preserved)\n               MODE_rgbA = 7,\n               MODE_bgrA = 8,\n               MODE_Argb = 9,\n               MODE_rgbA_4444 = 10,\n               // YUV modes must come after RGB ones.\n               MODE_YUV = 11, MODE_YUVA = 12,  // yuv 4:2:0\n               MODE_LAST = 13\n             } WEBP_CSP_MODE;\n\n// Some useful macros:\nstatic WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb ||\n          mode == MODE_rgbA_4444);\n}\n\nstatic WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||\n          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||\n          WebPIsPremultipliedMode(mode));\n}\n\nstatic WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {\n  return (mode < MODE_YUV);\n}\n\n//------------------------------------------------------------------------------\n// WebPDecBuffer: Generic structure for describing the output sample buffer.\n\ntypedef struct {    // view as RGBA\n  uint8_t* rgba;    // pointer to RGBA samples\n  int stride;       // stride in bytes from one scanline to the next.\n  size_t size;      // total size of the *rgba buffer.\n} WebPRGBABuffer;\n\ntypedef struct {              // view as YUVA\n  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples\n  int y_stride;               // luma stride\n  int u_stride, v_stride;     // chroma strides\n  int a_stride;               // alpha stride\n  size_t y_size;              // luma plane size\n  size_t u_size, v_size;      // chroma planes size\n  size_t a_size;              // alpha-plane size\n} WebPYUVABuffer;\n\n// Output buffer\ntypedef struct {\n  WEBP_CSP_MODE colorspace;  // Colorspace.\n  int width, height;         // Dimensions.\n  int is_external_memory;    // If true, 'internal_memory' pointer is not used.\n  union {\n    WebPRGBABuffer RGBA;\n    WebPYUVABuffer YUVA;\n  } u;                       // Nameless union of buffer parameters.\n  uint32_t       pad[4];     // padding for later use\n\n  uint8_t* private_memory;   // Internally allocated memory (only when\n                             // is_external_memory is false). Should not be used\n                             // externally, but accessed via the buffer union.\n} WebPDecBuffer;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int);\n\n// Initialize the structure as empty. Must be called before any other use.\n// Returns false in case of version mismatch\nstatic WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {\n  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);\n}\n\n// Free any memory associated with the buffer. Must always be called last.\n// Note: doesn't free the 'buffer' structure itself.\nWEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer);\n\n//------------------------------------------------------------------------------\n// Enumeration of the status codes\n\ntypedef enum {\n  VP8_STATUS_OK = 0,\n  VP8_STATUS_OUT_OF_MEMORY,\n  VP8_STATUS_INVALID_PARAM,\n  VP8_STATUS_BITSTREAM_ERROR,\n  VP8_STATUS_UNSUPPORTED_FEATURE,\n  VP8_STATUS_SUSPENDED,\n  VP8_STATUS_USER_ABORT,\n  VP8_STATUS_NOT_ENOUGH_DATA\n} VP8StatusCode;\n\n//------------------------------------------------------------------------------\n// Incremental decoding\n//\n// This API allows streamlined decoding of partial data.\n// Picture can be incrementally decoded as data become available thanks to the\n// WebPIDecoder object. This object can be left in a SUSPENDED state if the\n// picture is only partially decoded, pending additional input.\n// Code example:\n//\n//   WebPInitDecBuffer(&buffer);\n//   buffer.colorspace = mode;\n//   ...\n//   WebPIDecoder* idec = WebPINewDecoder(&buffer);\n//   while (has_more_data) {\n//     // ... (get additional data)\n//     status = WebPIAppend(idec, new_data, new_data_size);\n//     if (status != VP8_STATUS_SUSPENDED ||\n//       break;\n//     }\n//\n//     // The above call decodes the current available buffer.\n//     // Part of the image can now be refreshed by calling to\n//     // WebPIDecGetRGB()/WebPIDecGetYUVA() etc.\n//   }\n//   WebPIDelete(idec);\n\ntypedef struct WebPIDecoder WebPIDecoder;\n\n// Creates a new incremental decoder with the supplied buffer parameter.\n// This output_buffer can be passed NULL, in which case a default output buffer\n// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer'\n// is kept, which means that the lifespan of 'output_buffer' must be larger than\n// that of the returned WebPIDecoder object.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the RGB/A samples specified by 'csp' into a preallocated\n// buffer 'output_buffer'. The size of this buffer is at least\n// 'output_buffer_size' and the stride (distance in bytes between two scanlines)\n// is specified by 'output_stride'. Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewRGB(\n    WEBP_CSP_MODE csp,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the raw luma/chroma samples into a preallocated planes. The luma\n// plane is specified by its pointer 'luma', its size 'luma_size' and its stride\n// 'luma_stride'. Similarly, the chroma-u plane is specified by the 'u',\n// 'u_size' and 'u_stride' parameters, and the chroma-v plane by 'v'\n// and 'v_size'. And same for the alpha-plane. The 'a' pointer can be pass\n// NULL in case one is not interested in the transparency plane.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUVA(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride,\n    uint8_t* a, size_t a_size, int a_stride);\n\n// Deprecated version of the above, without the alpha plane.\n// Kept for backward compatibility.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUV(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n// Deletes the WebPIDecoder object and associated memory. Must always be called\n// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.\nWEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec);\n\n// Copies and decodes the next available data. Returns VP8_STATUS_OK when\n// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more\n// data is expected. Returns error in other cases.\nWEBP_EXTERN(VP8StatusCode) WebPIAppend(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// A variant of the above function to be used when data buffer contains\n// partial data from the beginning. In this case data buffer is not copied\n// to the internal memory.\n// Note that the value of the 'data' pointer can change between calls to\n// WebPIUpdate, for instance when the data buffer is resized to fit larger data.\nWEBP_EXTERN(VP8StatusCode) WebPIUpdate(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// Returns the RGB/A image decoded so far. Returns NULL if output params\n// are not initialized yet. The RGB/A output type corresponds to the colorspace\n// specified during call to WebPINewDecoder() or WebPINewRGB().\n// *last_y is the index of last decoded row in raster scan order. Some pointers\n// (*last_y, *width etc.) can be NULL if corresponding information is not\n// needed.\nWEBP_EXTERN(uint8_t*) WebPIDecGetRGB(\n    const WebPIDecoder* idec, int* last_y,\n    int* width, int* height, int* stride);\n\n// Same as above function to get a YUVA image. Returns pointer to the luma\n// plane or NULL in case of error. If there is no alpha information\n// the alpha pointer '*a' will be returned NULL.\nWEBP_EXTERN(uint8_t*) WebPIDecGetYUVA(\n    const WebPIDecoder* idec, int* last_y,\n    uint8_t** u, uint8_t** v, uint8_t** a,\n    int* width, int* height, int* stride, int* uv_stride, int* a_stride);\n\n// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the\n// alpha information (if present). Kept for backward compatibility.\nstatic WEBP_INLINE uint8_t* WebPIDecGetYUV(\n    const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v,\n    int* width, int* height, int* stride, int* uv_stride) {\n  return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height,\n                         stride, uv_stride, NULL);\n}\n\n// Generic call to retrieve information about the displayable area.\n// If non NULL, the left/right/width/height pointers are filled with the visible\n// rectangular area so far.\n// Returns NULL in case the incremental decoder object is in an invalid state.\n// Otherwise returns the pointer to the internal representation. This structure\n// is read-only, tied to WebPIDecoder's lifespan and should not be modified.\nWEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea(\n    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);\n\n//------------------------------------------------------------------------------\n// Advanced decoding parametrization\n//\n//  Code sample for using the advanced decoding API\n/*\n     // A) Init a configuration object\n     WebPDecoderConfig config;\n     CHECK(WebPInitDecoderConfig(&config));\n\n     // B) optional: retrieve the bitstream's features.\n     CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK);\n\n     // C) Adjust 'config', if needed\n     config.no_fancy = 1;\n     config.output.colorspace = MODE_BGRA;\n     // etc.\n\n     // Note that you can also make config.output point to an externally\n     // supplied memory buffer, provided it's big enough to store the decoded\n     // picture. Otherwise, config.output will just be used to allocate memory\n     // and store the decoded picture.\n\n     // D) Decode!\n     CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK);\n\n     // E) Decoded image is now in config.output (and config.output.u.RGBA)\n\n     // F) Reclaim memory allocated in config's object. It's safe to call\n     // this function even if the memory is external and wasn't allocated\n     // by WebPDecode().\n     WebPFreeDecBuffer(&config.output);\n*/\n\n// Features gathered from the bitstream\ntypedef struct {\n  int width;        // Width in pixels, as read from the bitstream.\n  int height;       // Height in pixels, as read from the bitstream.\n  int has_alpha;    // True if the bitstream contains an alpha channel.\n\n  // Unused for now:\n  int bitstream_version;        // should be 0 for now. TODO(later)\n  int no_incremental_decoding;  // if true, using incremental decoding is not\n                                // recommended.\n  int rotate;                   // TODO(later)\n  int uv_sampling;              // should be 0 for now. TODO(later)\n  uint32_t pad[3];              // padding for later use\n} WebPBitstreamFeatures;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal(\n    const uint8_t*, size_t, WebPBitstreamFeatures*, int);\n\n// Retrieve features from the bitstream. The *features structure is filled\n// with information gathered from the bitstream.\n// Returns false in case of error or version mismatch.\n// In case of error, features->bitstream_status will reflect the error code.\nstatic WEBP_INLINE VP8StatusCode WebPGetFeatures(\n    const uint8_t* data, size_t data_size,\n    WebPBitstreamFeatures* features) {\n  return WebPGetFeaturesInternal(data, data_size, features,\n                                 WEBP_DECODER_ABI_VERSION);\n}\n\n// Decoding options\ntypedef struct {\n  int bypass_filtering;               // if true, skip the in-loop filtering\n  int no_fancy_upsampling;            // if true, use faster pointwise upsampler\n  int use_cropping;                   // if true, cropping is applied _first_\n  int crop_left, crop_top;            // top-left position for cropping.\n                                      // Will be snapped to even values.\n  int crop_width, crop_height;        // dimension of the cropping area\n  int use_scaling;                    // if true, scaling is applied _afterward_\n  int scaled_width, scaled_height;    // final resolution\n  int use_threads;                    // if true, use multi-threaded decoding\n\n  // Unused for now:\n  int force_rotation;                 // forced rotation (to be applied _last_)\n  int no_enhancement;                 // if true, discard enhancement layer\n  uint32_t pad[6];                    // padding for later use\n} WebPDecoderOptions;\n\n// Main object storing the configuration for advanced decoding.\ntypedef struct {\n  WebPBitstreamFeatures input;  // Immutable bitstream features (optional)\n  WebPDecBuffer output;         // Output buffer (can point to external mem)\n  WebPDecoderOptions options;   // Decoding options\n} WebPDecoderConfig;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);\n\n// Initialize the configuration as empty. This function must always be\n// called first, unless WebPGetFeatures() is to be called.\n// Returns false in case of mismatched version.\nstatic WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {\n  return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);\n}\n\n// Instantiate a new incremental decoder object with the requested\n// configuration. The bitstream can be passed using 'data' and 'data_size'\n// parameter, in which case the features will be parsed and stored into\n// config->input. Otherwise, 'data' can be NULL and no parsing will occur.\n// Note that 'config' can be NULL too, in which case a default configuration\n// is used.\n// The return WebPIDecoder object must always be deleted calling WebPIDelete().\n// Returns NULL in case of error (and config->status will then reflect\n// the error condition).\nWEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size,\n                                       WebPDecoderConfig* config);\n\n// Non-incremental version. This version decodes the full data at once, taking\n// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK\n// if the decoding was successful).\nWEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size,\n                                      WebPDecoderConfig* config);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DECODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/ios/encode.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//   WebP encoder: main interface\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_ENCODE_H_\n#define WEBP_WEBP_ENCODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_ENCODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the encoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetEncoderVersion(void);\n\n//------------------------------------------------------------------------------\n// One-stop-shop call! No questions asked:\n\n// Returns the size of the compressed data (pointed to by *output), or 0 if\n// an error occurred. The compressed data must be released by the caller\n// using the call 'free(*output)'.\n// These functions compress using the lossy format, and the quality_factor\n// can go from 0 (smaller output, lower quality) to 100 (best quality,\n// larger output).\nWEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\n\n// These functions are the equivalent of the above, but compressing in a\n// lossless manner. Files are usually larger than lossy format, but will\n// not suffer any compression loss.\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\n\n//------------------------------------------------------------------------------\n// Coding parameters\n\n// Image characteristics hint for the underlying encoder.\ntypedef enum {\n  WEBP_HINT_DEFAULT = 0,  // default preset.\n  WEBP_HINT_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_HINT_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_HINT_GRAPH,        // Discrete tone image (graph, map-tile etc).\n  WEBP_HINT_LAST\n} WebPImageHint;\n\ntypedef struct {\n  int lossless;           // Lossless encoding (0=lossy(default), 1=lossless).\n  float quality;          // between 0 (smallest file) and 100 (biggest)\n  int method;             // quality/speed trade-off (0=fast, 6=slower-better)\n\n  WebPImageHint image_hint;  // Hint for image type (lossless only for now).\n\n  // Parameters related to lossy compression only:\n  int target_size;        // if non-zero, set the desired target size in bytes.\n                          // Takes precedence over the 'compression' parameter.\n  float target_PSNR;      // if non-zero, specifies the minimal distortion to\n                          // try to achieve. Takes precedence over target_size.\n  int segments;           // maximum number of segments to use, in [1..4]\n  int sns_strength;       // Spatial Noise Shaping. 0=off, 100=maximum.\n  int filter_strength;    // range: [0 = off .. 100 = strongest]\n  int filter_sharpness;   // range: [0 = off .. 7 = least sharp]\n  int filter_type;        // filtering type: 0 = simple, 1 = strong (only used\n                          // if filter_strength > 0 or autofilter > 0)\n  int autofilter;         // Auto adjust filter's strength [0 = off, 1 = on]\n  int alpha_compression;  // Algorithm for encoding the alpha plane (0 = none,\n                          // 1 = compressed with WebP lossless). Default is 1.\n  int alpha_filtering;    // Predictive filtering method for alpha plane.\n                          //  0: none, 1: fast, 2: best. Default if 1.\n  int alpha_quality;      // Between 0 (smallest size) and 100 (lossless).\n                          // Default is 100.\n  int pass;               // number of entropy-analysis passes (in [1..10]).\n\n  int show_compressed;    // if true, export the compressed picture back.\n                          // In-loop filtering is not applied.\n  int preprocessing;      // preprocessing filter (0=none, 1=segment-smooth)\n  int partitions;         // log2(number of token partitions) in [0..3]. Default\n                          // is set to 0 for easier progressive decoding.\n  int partition_limit;    // quality degradation allowed to fit the 512k limit\n                          // on prediction modes coding (0: no degradation,\n                          // 100: maximum possible degradation).\n\n  uint32_t pad[8];        // padding for later use\n} WebPConfig;\n\n// Enumerate some predefined settings for WebPConfig, depending on the type\n// of source picture. These presets are used when calling WebPConfigPreset().\ntypedef enum {\n  WEBP_PRESET_DEFAULT = 0,  // default preset.\n  WEBP_PRESET_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_PRESET_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_PRESET_DRAWING,      // hand or line drawing, with high-contrast details\n  WEBP_PRESET_ICON,         // small-sized colorful images\n  WEBP_PRESET_TEXT          // text-like\n} WebPPreset;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int);\n\n// Should always be called, to initialize a fresh WebPConfig structure before\n// modification. Returns false in case of version mismatch. WebPConfigInit()\n// must have succeeded before using the 'config' object.\n// Note that the default values are lossless=0 and quality=75.\nstatic WEBP_INLINE int WebPConfigInit(WebPConfig* config) {\n  return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// This function will initialize the configuration according to a predefined\n// set of parameters (referred to by 'preset') and a given quality factor.\n// This function can be called as a replacement to WebPConfigInit(). Will\n// return false in case of error.\nstatic WEBP_INLINE int WebPConfigPreset(WebPConfig* config,\n                                        WebPPreset preset, float quality) {\n  return WebPConfigInitInternal(config, preset, quality,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// Returns true if 'config' is non-NULL and all configuration parameters are\n// within their valid ranges.\nWEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config);\n\n//------------------------------------------------------------------------------\n// Input / Output\n\ntypedef struct WebPPicture WebPPicture;   // main structure for I/O\n\n// Structure for storing auxiliary statistics (mostly for lossy encoding).\ntypedef struct {\n  int coded_size;         // final size\n\n  float PSNR[5];          // peak-signal-to-noise ratio for Y/U/V/All/Alpha\n  int block_count[3];     // number of intra4/intra16/skipped macroblocks\n  int header_bytes[2];    // approximate number of bytes spent for header\n                          // and mode-partition #0\n  int residual_bytes[3][4];  // approximate number of bytes spent for\n                             // DC/AC/uv coefficients for each (0..3) segments.\n  int segment_size[4];    // number of macroblocks in each segments\n  int segment_quant[4];   // quantizer values for each segments\n  int segment_level[4];   // filtering strength for each segments [0..63]\n\n  int alpha_data_size;    // size of the transparency data\n  int layer_data_size;    // size of the enhancement layer data\n\n  // lossless encoder statistics\n  uint32_t lossless_features;  // bit0:predictor bit1:cross-color transform\n                               // bit2:subtract-green bit3:color indexing\n  int histogram_bits;          // number of precision bits of histogram\n  int transform_bits;          // precision bits for transform\n  int cache_bits;              // number of bits for color cache lookup\n  int palette_size;            // number of color in palette, if used\n  int lossless_size;           // final lossless size\n\n  uint32_t pad[4];        // padding for later use\n} WebPAuxStats;\n\n// Signature for output function. Should return true if writing was successful.\n// data/data_size is the segment of data to write, and 'picture' is for\n// reference (and so one can make use of picture->custom_ptr).\ntypedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size,\n                                  const WebPPicture* picture);\n\n// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using\n// the following WebPMemoryWriter object (to be set as a custom_ptr).\ntypedef struct {\n  uint8_t* mem;       // final buffer (of size 'max_size', larger than 'size').\n  size_t   size;      // final size\n  size_t   max_size;  // total capacity\n  uint32_t pad[1];    // padding for later use\n} WebPMemoryWriter;\n\n// The following must be called first before any use.\nWEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer);\n\n// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon\n// completion, writer.mem and writer.size will hold the coded data.\nWEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size,\n                                 const WebPPicture* picture);\n\n// Progress hook, called from time to time to report progress. It can return\n// false to request an abort of the encoding process, or true otherwise if\n// everything is OK.\ntypedef int (*WebPProgressHook)(int percent, const WebPPicture* picture);\n\ntypedef enum {\n  // chroma sampling\n  WEBP_YUV420 = 0,   // 4:2:0\n  WEBP_YUV422 = 1,   // 4:2:2\n  WEBP_YUV444 = 2,   // 4:4:4\n  WEBP_YUV400 = 3,   // grayscale\n  WEBP_CSP_UV_MASK = 3,   // bit-mask to get the UV sampling factors\n  // alpha channel variants\n  WEBP_YUV420A = 4,\n  WEBP_YUV422A = 5,\n  WEBP_YUV444A = 6,\n  WEBP_YUV400A = 7,   // grayscale + alpha\n  WEBP_CSP_ALPHA_BIT = 4   // bit that is set if alpha is present\n} WebPEncCSP;\n\n// Encoding error conditions.\ntypedef enum {\n  VP8_ENC_OK = 0,\n  VP8_ENC_ERROR_OUT_OF_MEMORY,            // memory error allocating objects\n  VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY,  // memory error while flushing bits\n  VP8_ENC_ERROR_NULL_PARAMETER,           // a pointer parameter is NULL\n  VP8_ENC_ERROR_INVALID_CONFIGURATION,    // configuration is invalid\n  VP8_ENC_ERROR_BAD_DIMENSION,            // picture has invalid width/height\n  VP8_ENC_ERROR_PARTITION0_OVERFLOW,      // partition is bigger than 512k\n  VP8_ENC_ERROR_PARTITION_OVERFLOW,       // partition is bigger than 16M\n  VP8_ENC_ERROR_BAD_WRITE,                // error while flushing bytes\n  VP8_ENC_ERROR_FILE_TOO_BIG,             // file is bigger than 4G\n  VP8_ENC_ERROR_USER_ABORT,               // abort request by user\n  VP8_ENC_ERROR_LAST                      // list terminator. always last.\n} WebPEncodingError;\n\n// maximum width/height allowed (inclusive), in pixels\n#define WEBP_MAX_DIMENSION 16383\n\n// Main exchange structure (input samples, output bytes, statistics)\nstruct WebPPicture {\n\n  //   INPUT\n  //////////////\n  // Main flag for encoder selecting between ARGB or YUV input.\n  // It is recommended to use ARGB input (*argb, argb_stride) for lossless\n  // compression, and YUV input (*y, *u, *v, etc.) for lossy compression\n  // since these are the respective native colorspace for these formats.\n  int use_argb;\n\n  // YUV input (mostly used for input to lossy compression)\n  WebPEncCSP colorspace;     // colorspace: should be YUV420 for now (=Y'CbCr).\n  int width, height;         // dimensions (less or equal to WEBP_MAX_DIMENSION)\n  uint8_t *y, *u, *v;        // pointers to luma/chroma planes.\n  int y_stride, uv_stride;   // luma/chroma strides.\n  uint8_t* a;                // pointer to the alpha plane\n  int a_stride;              // stride of the alpha plane\n  uint32_t pad1[2];          // padding for later use\n\n  // ARGB input (mostly used for input to lossless compression)\n  uint32_t* argb;            // Pointer to argb (32 bit) plane.\n  int argb_stride;           // This is stride in pixels units, not bytes.\n  uint32_t pad2[3];          // padding for later use\n\n  //   OUTPUT\n  ///////////////\n  // Byte-emission hook, to store compressed bytes as they are ready.\n  WebPWriterFunction writer;  // can be NULL\n  void* custom_ptr;           // can be used by the writer.\n\n  // map for extra information (only for lossy compression mode)\n  int extra_info_type;    // 1: intra type, 2: segment, 3: quant\n                          // 4: intra-16 prediction mode,\n                          // 5: chroma prediction mode,\n                          // 6: bit cost, 7: distortion\n  uint8_t* extra_info;    // if not NULL, points to an array of size\n                          // ((width + 15) / 16) * ((height + 15) / 16) that\n                          // will be filled with a macroblock map, depending\n                          // on extra_info_type.\n\n  //   STATS AND REPORTS\n  ///////////////////////////\n  // Pointer to side statistics (updated only if not NULL)\n  WebPAuxStats* stats;\n\n  // Error code for the latest error encountered during encoding\n  WebPEncodingError error_code;\n\n  // If not NULL, report progress during encoding.\n  WebPProgressHook progress_hook;\n\n  void* user_data;        // this field is free to be set to any value and\n                          // used during callbacks (like progress-report e.g.).\n\n  uint32_t pad3[3];       // padding for later use\n\n  // Unused for now: original samples (for non-YUV420 modes)\n  uint8_t *u0, *v0;\n  int uv0_stride;\n\n  uint32_t pad4[7];       // padding for later use\n\n  // PRIVATE FIELDS\n  ////////////////////\n  void* memory_;          // row chunk of memory for yuva planes\n  void* memory_argb_;     // and for argb too.\n  void* pad5[2];          // padding for later use\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int);\n\n// Should always be called, to initialize the structure. Returns false in case\n// of version mismatch. WebPPictureInit() must have succeeded before using the\n// 'picture' object.\n// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.\nstatic WEBP_INLINE int WebPPictureInit(WebPPicture* picture) {\n  return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION);\n}\n\n//------------------------------------------------------------------------------\n// WebPPicture utils\n\n// Convenience allocation / deallocation based on picture->width/height:\n// Allocate y/u/v buffers as per colorspace/width/height specification.\n// Note! This function will free the previous buffer if needed.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture);\n\n// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*().\n// Note that this function does _not_ free the memory used by the 'picture'\n// object itself.\n// Besides memory (which is reclaimed) all other fields of 'picture' are\n// preserved.\nWEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture);\n\n// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return,\n// *dst will fully own the copied pixels (this is not a view).\n// Returns false in case of memory allocation error.\nWEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst);\n\n// Compute PSNR or SSIM distortion between two pictures.\n// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order.\n// Returns false in case of error (pic1 and pic2 don't have same dimension, ...)\n// Warning: this function is rather CPU-intensive.\nWEBP_EXTERN(int) WebPPictureDistortion(\n    const WebPPicture* pic1, const WebPPicture* pic2,\n    int metric_type,           // 0 = PSNR, 1 = SSIM\n    float result[5]);\n\n// self-crops a picture to the rectangle defined by top/left/width/height.\n// Returns false in case of memory allocation error, or if the rectangle is\n// outside of the source picture.\n// The rectangle for the view is defined by the top-left corner pixel\n// coordinates (left, top) as well as its width and height. This rectangle\n// must be fully be comprised inside the 'src' source picture. If the source\n// picture uses the YUV420 colorspace, the top and left coordinates will be\n// snapped to even values.\nWEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture,\n                                 int left, int top, int width, int height);\n\n// Extracts a view from 'src' picture into 'dst'. The rectangle for the view\n// is defined by the top-left corner pixel coordinates (left, top) as well\n// as its width and height. This rectangle must be fully be comprised inside\n// the 'src' source picture. If the source picture uses the YUV420 colorspace,\n// the top and left coordinates will be snapped to even values.\n// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed\n// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so,\n// the original dimension will be lost).\n// Returns false in case of memory allocation error or invalid parameters.\nWEBP_EXTERN(int) WebPPictureView(const WebPPicture* src,\n                                 int left, int top, int width, int height,\n                                 WebPPicture* dst);\n\n// Returns true if the 'picture' is actually a view and therefore does\n// not own the memory for pixels.\nWEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture);\n\n// Rescale a picture to new dimension width x height.\n// Now gamma correction is applied.\n// Returns false in case of error (invalid parameter or insufficient memory).\nWEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height);\n\n// Colorspace conversion function to import RGB samples.\n// Previous buffer will be free'd, if any.\n// *rgb buffer should have a size of at least height * rgb_stride.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureImportRGB(\n    WebPPicture* picture, const uint8_t* rgb, int rgb_stride);\n// Same, but for RGBA buffer.\nWEBP_EXTERN(int) WebPPictureImportRGBA(\n    WebPPicture* picture, const uint8_t* rgba, int rgba_stride);\n// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format\n// input buffer ignoring the alpha channel. Avoids needing to copy the data\n// to a temporary 24-bit RGB buffer to import the RGB only.\nWEBP_EXTERN(int) WebPPictureImportRGBX(\n    WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride);\n\n// Variants of the above, but taking BGR(A|X) input.\nWEBP_EXTERN(int) WebPPictureImportBGR(\n    WebPPicture* picture, const uint8_t* bgr, int bgr_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRA(\n    WebPPicture* picture, const uint8_t* bgra, int bgra_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRX(\n    WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride);\n\n// Converts picture->argb data to the YUVA format specified by 'colorspace'.\n// Upon return, picture->use_argb is set to false. The presence of real\n// non-opaque transparent values is detected, and 'colorspace' will be\n// adjusted accordingly. Note that this method is lossy.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture,\n                                       WebPEncCSP colorspace);\n\n// Converts picture->yuv to picture->argb and sets picture->use_argb to true.\n// The input format must be YUV_420 or YUV_420A.\n// Note that the use of this method is discouraged if one has access to the\n// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the\n// conversion from YUV420 to ARGB incurs a small loss too.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture);\n\n// Helper function: given a width x height plane of YUV(A) samples\n// (with stride 'stride'), clean-up the YUV samples under fully transparent\n// area, to help compressibility (no guarantee, though).\nWEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture);\n\n// Scan the picture 'picture' for the presence of non fully opaque alpha values.\n// Returns true in such case. Otherwise returns false (indicating that the\n// alpha plane can be ignored altogether e.g.).\nWEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n// Main call\n\n// Main encoding call, after config and picture have been initialized.\n// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION),\n// and the 'config' object must be a valid one.\n// Returns false in case of error, true otherwise.\n// In case of error, picture->error_code is updated accordingly.\n// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending\n// on the value of 'picture->use_argb'. It is highly recommended to use\n// the former for lossy encoding, and the latter for lossless encoding\n// (when config.lossless is true). Automatic conversion from one format to\n// another is provided but they both incur some loss.\nWEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_ENCODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/ios/types.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Common types\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_TYPES_H_\n#define WEBP_WEBP_TYPES_H_\n\n#include <stddef.h>  // for size_t\n\n#ifndef _MSC_VER\n#include <inttypes.h>\n#ifdef __STRICT_ANSI__\n#define WEBP_INLINE\n#else  /* __STRICT_ANSI__ */\n#define WEBP_INLINE inline\n#endif\n#else\ntypedef signed   char int8_t;\ntypedef unsigned char uint8_t;\ntypedef signed   short int16_t;\ntypedef unsigned short uint16_t;\ntypedef signed   int int32_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long int uint64_t;\ntypedef long long int int64_t;\n#define WEBP_INLINE __forceinline\n#endif  /* _MSC_VER */\n\n#ifndef WEBP_EXTERN\n// This explicitly marks library functions and allows for changing the\n// signature for e.g., Windows DLL builds.\n#define WEBP_EXTERN(type) extern type\n#endif  /* WEBP_EXTERN */\n\n// Macro to check ABI compatibility (same major revision number)\n#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))\n\n#endif  /* WEBP_WEBP_TYPES_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/linux/decode.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Main decoding functions for WebP images.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_DECODE_H_\n#define WEBP_WEBP_DECODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_DECODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the decoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetDecoderVersion(void);\n\n// Retrieve basic header information: width, height.\n// This function will also validate the header and return 0 in\n// case of formatting error.\n// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.\nWEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size,\n                             int* width, int* height);\n\n// Decodes WebP images pointed to by 'data' and returns RGBA samples, along\n// with the dimensions in *width and *height. The ordering of samples in\n// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).\n// The returned pointer should be deleted calling free().\n// Returns NULL in case of error.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.\n// If the bitstream contains transparency, it is ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n\n// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer\n// returned is the Y samples buffer. Upon return, *u and *v will point to\n// the U and V chroma data. These U and V buffers need NOT be free()'d,\n// unlike the returned Y luma one. The dimension of the U and V planes\n// are both (*width + 1) / 2 and (*height + 1)/ 2.\n// Upon return, the Y buffer has a stride returned as '*stride', while U and V\n// have a common stride returned as '*uv_stride'.\n// Return NULL in case of error.\n// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr\nWEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size,\n                                    int* width, int* height,\n                                    uint8_t** u, uint8_t** v,\n                                    int* stride, int* uv_stride);\n\n// These five functions are variants of the above ones, that decode the image\n// directly into a pre-allocated buffer 'output_buffer'. The maximum storage\n// available in this buffer is indicated by 'output_buffer_size'. If this\n// storage is not sufficient (or an error occurred), NULL is returned.\n// Otherwise, output_buffer is returned, for convenience.\n// The parameter 'output_stride' specifies the distance (in bytes)\n// between scanlines. Hence, output_buffer_size is expected to be at least\n// output_stride x picture-height.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeARGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// RGB and BGR variants. Here too the transparency information, if present,\n// will be dropped and ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly\n// into pre-allocated luma/chroma plane buffers. This function requires the\n// strides to be passed: one for the luma plane and one for each of the\n// chroma ones. The size of each plane buffer is passed as 'luma_size',\n// 'u_size' and 'v_size' respectively.\n// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred\n// during decoding (or because some buffers were found to be too small).\nWEBP_EXTERN(uint8_t*) WebPDecodeYUVInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n//------------------------------------------------------------------------------\n// Output colorspaces and buffer\n\n// Colorspaces\n// Note: the naming describes the byte-ordering of packed samples in memory.\n// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,...\n// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels.\n// RGB-565 and RGBA-4444 are also endian-agnostic and byte-oriented.\ntypedef enum { MODE_RGB = 0, MODE_RGBA = 1,\n               MODE_BGR = 2, MODE_BGRA = 3,\n               MODE_ARGB = 4, MODE_RGBA_4444 = 5,\n               MODE_RGB_565 = 6,\n               // RGB-premultiplied transparent modes (alpha value is preserved)\n               MODE_rgbA = 7,\n               MODE_bgrA = 8,\n               MODE_Argb = 9,\n               MODE_rgbA_4444 = 10,\n               // YUV modes must come after RGB ones.\n               MODE_YUV = 11, MODE_YUVA = 12,  // yuv 4:2:0\n               MODE_LAST = 13\n             } WEBP_CSP_MODE;\n\n// Some useful macros:\nstatic WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb ||\n          mode == MODE_rgbA_4444);\n}\n\nstatic WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||\n          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||\n          WebPIsPremultipliedMode(mode));\n}\n\nstatic WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {\n  return (mode < MODE_YUV);\n}\n\n//------------------------------------------------------------------------------\n// WebPDecBuffer: Generic structure for describing the output sample buffer.\n\ntypedef struct {    // view as RGBA\n  uint8_t* rgba;    // pointer to RGBA samples\n  int stride;       // stride in bytes from one scanline to the next.\n  size_t size;      // total size of the *rgba buffer.\n} WebPRGBABuffer;\n\ntypedef struct {              // view as YUVA\n  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples\n  int y_stride;               // luma stride\n  int u_stride, v_stride;     // chroma strides\n  int a_stride;               // alpha stride\n  size_t y_size;              // luma plane size\n  size_t u_size, v_size;      // chroma planes size\n  size_t a_size;              // alpha-plane size\n} WebPYUVABuffer;\n\n// Output buffer\ntypedef struct {\n  WEBP_CSP_MODE colorspace;  // Colorspace.\n  int width, height;         // Dimensions.\n  int is_external_memory;    // If true, 'internal_memory' pointer is not used.\n  union {\n    WebPRGBABuffer RGBA;\n    WebPYUVABuffer YUVA;\n  } u;                       // Nameless union of buffer parameters.\n  uint32_t       pad[4];     // padding for later use\n\n  uint8_t* private_memory;   // Internally allocated memory (only when\n                             // is_external_memory is false). Should not be used\n                             // externally, but accessed via the buffer union.\n} WebPDecBuffer;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int);\n\n// Initialize the structure as empty. Must be called before any other use.\n// Returns false in case of version mismatch\nstatic WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {\n  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);\n}\n\n// Free any memory associated with the buffer. Must always be called last.\n// Note: doesn't free the 'buffer' structure itself.\nWEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer);\n\n//------------------------------------------------------------------------------\n// Enumeration of the status codes\n\ntypedef enum {\n  VP8_STATUS_OK = 0,\n  VP8_STATUS_OUT_OF_MEMORY,\n  VP8_STATUS_INVALID_PARAM,\n  VP8_STATUS_BITSTREAM_ERROR,\n  VP8_STATUS_UNSUPPORTED_FEATURE,\n  VP8_STATUS_SUSPENDED,\n  VP8_STATUS_USER_ABORT,\n  VP8_STATUS_NOT_ENOUGH_DATA\n} VP8StatusCode;\n\n//------------------------------------------------------------------------------\n// Incremental decoding\n//\n// This API allows streamlined decoding of partial data.\n// Picture can be incrementally decoded as data become available thanks to the\n// WebPIDecoder object. This object can be left in a SUSPENDED state if the\n// picture is only partially decoded, pending additional input.\n// Code example:\n//\n//   WebPInitDecBuffer(&buffer);\n//   buffer.colorspace = mode;\n//   ...\n//   WebPIDecoder* idec = WebPINewDecoder(&buffer);\n//   while (has_more_data) {\n//     // ... (get additional data)\n//     status = WebPIAppend(idec, new_data, new_data_size);\n//     if (status != VP8_STATUS_SUSPENDED ||\n//       break;\n//     }\n//\n//     // The above call decodes the current available buffer.\n//     // Part of the image can now be refreshed by calling to\n//     // WebPIDecGetRGB()/WebPIDecGetYUVA() etc.\n//   }\n//   WebPIDelete(idec);\n\ntypedef struct WebPIDecoder WebPIDecoder;\n\n// Creates a new incremental decoder with the supplied buffer parameter.\n// This output_buffer can be passed NULL, in which case a default output buffer\n// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer'\n// is kept, which means that the lifespan of 'output_buffer' must be larger than\n// that of the returned WebPIDecoder object.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the RGB/A samples specified by 'csp' into a preallocated\n// buffer 'output_buffer'. The size of this buffer is at least\n// 'output_buffer_size' and the stride (distance in bytes between two scanlines)\n// is specified by 'output_stride'. Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewRGB(\n    WEBP_CSP_MODE csp,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the raw luma/chroma samples into a preallocated planes. The luma\n// plane is specified by its pointer 'luma', its size 'luma_size' and its stride\n// 'luma_stride'. Similarly, the chroma-u plane is specified by the 'u',\n// 'u_size' and 'u_stride' parameters, and the chroma-v plane by 'v'\n// and 'v_size'. And same for the alpha-plane. The 'a' pointer can be pass\n// NULL in case one is not interested in the transparency plane.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUVA(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride,\n    uint8_t* a, size_t a_size, int a_stride);\n\n// Deprecated version of the above, without the alpha plane.\n// Kept for backward compatibility.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUV(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n// Deletes the WebPIDecoder object and associated memory. Must always be called\n// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.\nWEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec);\n\n// Copies and decodes the next available data. Returns VP8_STATUS_OK when\n// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more\n// data is expected. Returns error in other cases.\nWEBP_EXTERN(VP8StatusCode) WebPIAppend(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// A variant of the above function to be used when data buffer contains\n// partial data from the beginning. In this case data buffer is not copied\n// to the internal memory.\n// Note that the value of the 'data' pointer can change between calls to\n// WebPIUpdate, for instance when the data buffer is resized to fit larger data.\nWEBP_EXTERN(VP8StatusCode) WebPIUpdate(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// Returns the RGB/A image decoded so far. Returns NULL if output params\n// are not initialized yet. The RGB/A output type corresponds to the colorspace\n// specified during call to WebPINewDecoder() or WebPINewRGB().\n// *last_y is the index of last decoded row in raster scan order. Some pointers\n// (*last_y, *width etc.) can be NULL if corresponding information is not\n// needed.\nWEBP_EXTERN(uint8_t*) WebPIDecGetRGB(\n    const WebPIDecoder* idec, int* last_y,\n    int* width, int* height, int* stride);\n\n// Same as above function to get a YUVA image. Returns pointer to the luma\n// plane or NULL in case of error. If there is no alpha information\n// the alpha pointer '*a' will be returned NULL.\nWEBP_EXTERN(uint8_t*) WebPIDecGetYUVA(\n    const WebPIDecoder* idec, int* last_y,\n    uint8_t** u, uint8_t** v, uint8_t** a,\n    int* width, int* height, int* stride, int* uv_stride, int* a_stride);\n\n// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the\n// alpha information (if present). Kept for backward compatibility.\nstatic WEBP_INLINE uint8_t* WebPIDecGetYUV(\n    const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v,\n    int* width, int* height, int* stride, int* uv_stride) {\n  return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height,\n                         stride, uv_stride, NULL);\n}\n\n// Generic call to retrieve information about the displayable area.\n// If non NULL, the left/right/width/height pointers are filled with the visible\n// rectangular area so far.\n// Returns NULL in case the incremental decoder object is in an invalid state.\n// Otherwise returns the pointer to the internal representation. This structure\n// is read-only, tied to WebPIDecoder's lifespan and should not be modified.\nWEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea(\n    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);\n\n//------------------------------------------------------------------------------\n// Advanced decoding parametrization\n//\n//  Code sample for using the advanced decoding API\n/*\n     // A) Init a configuration object\n     WebPDecoderConfig config;\n     CHECK(WebPInitDecoderConfig(&config));\n\n     // B) optional: retrieve the bitstream's features.\n     CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK);\n\n     // C) Adjust 'config', if needed\n     config.no_fancy = 1;\n     config.output.colorspace = MODE_BGRA;\n     // etc.\n\n     // Note that you can also make config.output point to an externally\n     // supplied memory buffer, provided it's big enough to store the decoded\n     // picture. Otherwise, config.output will just be used to allocate memory\n     // and store the decoded picture.\n\n     // D) Decode!\n     CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK);\n\n     // E) Decoded image is now in config.output (and config.output.u.RGBA)\n\n     // F) Reclaim memory allocated in config's object. It's safe to call\n     // this function even if the memory is external and wasn't allocated\n     // by WebPDecode().\n     WebPFreeDecBuffer(&config.output);\n*/\n\n// Features gathered from the bitstream\ntypedef struct {\n  int width;        // Width in pixels, as read from the bitstream.\n  int height;       // Height in pixels, as read from the bitstream.\n  int has_alpha;    // True if the bitstream contains an alpha channel.\n\n  // Unused for now:\n  int bitstream_version;        // should be 0 for now. TODO(later)\n  int no_incremental_decoding;  // if true, using incremental decoding is not\n                                // recommended.\n  int rotate;                   // TODO(later)\n  int uv_sampling;              // should be 0 for now. TODO(later)\n  uint32_t pad[3];              // padding for later use\n} WebPBitstreamFeatures;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal(\n    const uint8_t*, size_t, WebPBitstreamFeatures*, int);\n\n// Retrieve features from the bitstream. The *features structure is filled\n// with information gathered from the bitstream.\n// Returns false in case of error or version mismatch.\n// In case of error, features->bitstream_status will reflect the error code.\nstatic WEBP_INLINE VP8StatusCode WebPGetFeatures(\n    const uint8_t* data, size_t data_size,\n    WebPBitstreamFeatures* features) {\n  return WebPGetFeaturesInternal(data, data_size, features,\n                                 WEBP_DECODER_ABI_VERSION);\n}\n\n// Decoding options\ntypedef struct {\n  int bypass_filtering;               // if true, skip the in-loop filtering\n  int no_fancy_upsampling;            // if true, use faster pointwise upsampler\n  int use_cropping;                   // if true, cropping is applied _first_\n  int crop_left, crop_top;            // top-left position for cropping.\n                                      // Will be snapped to even values.\n  int crop_width, crop_height;        // dimension of the cropping area\n  int use_scaling;                    // if true, scaling is applied _afterward_\n  int scaled_width, scaled_height;    // final resolution\n  int use_threads;                    // if true, use multi-threaded decoding\n\n  // Unused for now:\n  int force_rotation;                 // forced rotation (to be applied _last_)\n  int no_enhancement;                 // if true, discard enhancement layer\n  uint32_t pad[6];                    // padding for later use\n} WebPDecoderOptions;\n\n// Main object storing the configuration for advanced decoding.\ntypedef struct {\n  WebPBitstreamFeatures input;  // Immutable bitstream features (optional)\n  WebPDecBuffer output;         // Output buffer (can point to external mem)\n  WebPDecoderOptions options;   // Decoding options\n} WebPDecoderConfig;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);\n\n// Initialize the configuration as empty. This function must always be\n// called first, unless WebPGetFeatures() is to be called.\n// Returns false in case of mismatched version.\nstatic WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {\n  return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);\n}\n\n// Instantiate a new incremental decoder object with the requested\n// configuration. The bitstream can be passed using 'data' and 'data_size'\n// parameter, in which case the features will be parsed and stored into\n// config->input. Otherwise, 'data' can be NULL and no parsing will occur.\n// Note that 'config' can be NULL too, in which case a default configuration\n// is used.\n// The return WebPIDecoder object must always be deleted calling WebPIDelete().\n// Returns NULL in case of error (and config->status will then reflect\n// the error condition).\nWEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size,\n                                       WebPDecoderConfig* config);\n\n// Non-incremental version. This version decodes the full data at once, taking\n// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK\n// if the decoding was successful).\nWEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size,\n                                      WebPDecoderConfig* config);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DECODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/linux/encode.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//   WebP encoder: main interface\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_ENCODE_H_\n#define WEBP_WEBP_ENCODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_ENCODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the encoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetEncoderVersion(void);\n\n//------------------------------------------------------------------------------\n// One-stop-shop call! No questions asked:\n\n// Returns the size of the compressed data (pointed to by *output), or 0 if\n// an error occurred. The compressed data must be released by the caller\n// using the call 'free(*output)'.\n// These functions compress using the lossy format, and the quality_factor\n// can go from 0 (smaller output, lower quality) to 100 (best quality,\n// larger output).\nWEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\n\n// These functions are the equivalent of the above, but compressing in a\n// lossless manner. Files are usually larger than lossy format, but will\n// not suffer any compression loss.\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\n\n//------------------------------------------------------------------------------\n// Coding parameters\n\n// Image characteristics hint for the underlying encoder.\ntypedef enum {\n  WEBP_HINT_DEFAULT = 0,  // default preset.\n  WEBP_HINT_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_HINT_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_HINT_GRAPH,        // Discrete tone image (graph, map-tile etc).\n  WEBP_HINT_LAST\n} WebPImageHint;\n\ntypedef struct {\n  int lossless;           // Lossless encoding (0=lossy(default), 1=lossless).\n  float quality;          // between 0 (smallest file) and 100 (biggest)\n  int method;             // quality/speed trade-off (0=fast, 6=slower-better)\n\n  WebPImageHint image_hint;  // Hint for image type (lossless only for now).\n\n  // Parameters related to lossy compression only:\n  int target_size;        // if non-zero, set the desired target size in bytes.\n                          // Takes precedence over the 'compression' parameter.\n  float target_PSNR;      // if non-zero, specifies the minimal distortion to\n                          // try to achieve. Takes precedence over target_size.\n  int segments;           // maximum number of segments to use, in [1..4]\n  int sns_strength;       // Spatial Noise Shaping. 0=off, 100=maximum.\n  int filter_strength;    // range: [0 = off .. 100 = strongest]\n  int filter_sharpness;   // range: [0 = off .. 7 = least sharp]\n  int filter_type;        // filtering type: 0 = simple, 1 = strong (only used\n                          // if filter_strength > 0 or autofilter > 0)\n  int autofilter;         // Auto adjust filter's strength [0 = off, 1 = on]\n  int alpha_compression;  // Algorithm for encoding the alpha plane (0 = none,\n                          // 1 = compressed with WebP lossless). Default is 1.\n  int alpha_filtering;    // Predictive filtering method for alpha plane.\n                          //  0: none, 1: fast, 2: best. Default if 1.\n  int alpha_quality;      // Between 0 (smallest size) and 100 (lossless).\n                          // Default is 100.\n  int pass;               // number of entropy-analysis passes (in [1..10]).\n\n  int show_compressed;    // if true, export the compressed picture back.\n                          // In-loop filtering is not applied.\n  int preprocessing;      // preprocessing filter (0=none, 1=segment-smooth)\n  int partitions;         // log2(number of token partitions) in [0..3]. Default\n                          // is set to 0 for easier progressive decoding.\n  int partition_limit;    // quality degradation allowed to fit the 512k limit\n                          // on prediction modes coding (0: no degradation,\n                          // 100: maximum possible degradation).\n\n  uint32_t pad[8];        // padding for later use\n} WebPConfig;\n\n// Enumerate some predefined settings for WebPConfig, depending on the type\n// of source picture. These presets are used when calling WebPConfigPreset().\ntypedef enum {\n  WEBP_PRESET_DEFAULT = 0,  // default preset.\n  WEBP_PRESET_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_PRESET_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_PRESET_DRAWING,      // hand or line drawing, with high-contrast details\n  WEBP_PRESET_ICON,         // small-sized colorful images\n  WEBP_PRESET_TEXT          // text-like\n} WebPPreset;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int);\n\n// Should always be called, to initialize a fresh WebPConfig structure before\n// modification. Returns false in case of version mismatch. WebPConfigInit()\n// must have succeeded before using the 'config' object.\n// Note that the default values are lossless=0 and quality=75.\nstatic WEBP_INLINE int WebPConfigInit(WebPConfig* config) {\n  return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// This function will initialize the configuration according to a predefined\n// set of parameters (referred to by 'preset') and a given quality factor.\n// This function can be called as a replacement to WebPConfigInit(). Will\n// return false in case of error.\nstatic WEBP_INLINE int WebPConfigPreset(WebPConfig* config,\n                                        WebPPreset preset, float quality) {\n  return WebPConfigInitInternal(config, preset, quality,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// Returns true if 'config' is non-NULL and all configuration parameters are\n// within their valid ranges.\nWEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config);\n\n//------------------------------------------------------------------------------\n// Input / Output\n\ntypedef struct WebPPicture WebPPicture;   // main structure for I/O\n\n// Structure for storing auxiliary statistics (mostly for lossy encoding).\ntypedef struct {\n  int coded_size;         // final size\n\n  float PSNR[5];          // peak-signal-to-noise ratio for Y/U/V/All/Alpha\n  int block_count[3];     // number of intra4/intra16/skipped macroblocks\n  int header_bytes[2];    // approximate number of bytes spent for header\n                          // and mode-partition #0\n  int residual_bytes[3][4];  // approximate number of bytes spent for\n                             // DC/AC/uv coefficients for each (0..3) segments.\n  int segment_size[4];    // number of macroblocks in each segments\n  int segment_quant[4];   // quantizer values for each segments\n  int segment_level[4];   // filtering strength for each segments [0..63]\n\n  int alpha_data_size;    // size of the transparency data\n  int layer_data_size;    // size of the enhancement layer data\n\n  // lossless encoder statistics\n  uint32_t lossless_features;  // bit0:predictor bit1:cross-color transform\n                               // bit2:subtract-green bit3:color indexing\n  int histogram_bits;          // number of precision bits of histogram\n  int transform_bits;          // precision bits for transform\n  int cache_bits;              // number of bits for color cache lookup\n  int palette_size;            // number of color in palette, if used\n  int lossless_size;           // final lossless size\n\n  uint32_t pad[4];        // padding for later use\n} WebPAuxStats;\n\n// Signature for output function. Should return true if writing was successful.\n// data/data_size is the segment of data to write, and 'picture' is for\n// reference (and so one can make use of picture->custom_ptr).\ntypedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size,\n                                  const WebPPicture* picture);\n\n// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using\n// the following WebPMemoryWriter object (to be set as a custom_ptr).\ntypedef struct {\n  uint8_t* mem;       // final buffer (of size 'max_size', larger than 'size').\n  size_t   size;      // final size\n  size_t   max_size;  // total capacity\n  uint32_t pad[1];    // padding for later use\n} WebPMemoryWriter;\n\n// The following must be called first before any use.\nWEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer);\n\n// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon\n// completion, writer.mem and writer.size will hold the coded data.\nWEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size,\n                                 const WebPPicture* picture);\n\n// Progress hook, called from time to time to report progress. It can return\n// false to request an abort of the encoding process, or true otherwise if\n// everything is OK.\ntypedef int (*WebPProgressHook)(int percent, const WebPPicture* picture);\n\ntypedef enum {\n  // chroma sampling\n  WEBP_YUV420 = 0,   // 4:2:0\n  WEBP_YUV422 = 1,   // 4:2:2\n  WEBP_YUV444 = 2,   // 4:4:4\n  WEBP_YUV400 = 3,   // grayscale\n  WEBP_CSP_UV_MASK = 3,   // bit-mask to get the UV sampling factors\n  // alpha channel variants\n  WEBP_YUV420A = 4,\n  WEBP_YUV422A = 5,\n  WEBP_YUV444A = 6,\n  WEBP_YUV400A = 7,   // grayscale + alpha\n  WEBP_CSP_ALPHA_BIT = 4   // bit that is set if alpha is present\n} WebPEncCSP;\n\n// Encoding error conditions.\ntypedef enum {\n  VP8_ENC_OK = 0,\n  VP8_ENC_ERROR_OUT_OF_MEMORY,            // memory error allocating objects\n  VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY,  // memory error while flushing bits\n  VP8_ENC_ERROR_NULL_PARAMETER,           // a pointer parameter is NULL\n  VP8_ENC_ERROR_INVALID_CONFIGURATION,    // configuration is invalid\n  VP8_ENC_ERROR_BAD_DIMENSION,            // picture has invalid width/height\n  VP8_ENC_ERROR_PARTITION0_OVERFLOW,      // partition is bigger than 512k\n  VP8_ENC_ERROR_PARTITION_OVERFLOW,       // partition is bigger than 16M\n  VP8_ENC_ERROR_BAD_WRITE,                // error while flushing bytes\n  VP8_ENC_ERROR_FILE_TOO_BIG,             // file is bigger than 4G\n  VP8_ENC_ERROR_USER_ABORT,               // abort request by user\n  VP8_ENC_ERROR_LAST                      // list terminator. always last.\n} WebPEncodingError;\n\n// maximum width/height allowed (inclusive), in pixels\n#define WEBP_MAX_DIMENSION 16383\n\n// Main exchange structure (input samples, output bytes, statistics)\nstruct WebPPicture {\n\n  //   INPUT\n  //////////////\n  // Main flag for encoder selecting between ARGB or YUV input.\n  // It is recommended to use ARGB input (*argb, argb_stride) for lossless\n  // compression, and YUV input (*y, *u, *v, etc.) for lossy compression\n  // since these are the respective native colorspace for these formats.\n  int use_argb;\n\n  // YUV input (mostly used for input to lossy compression)\n  WebPEncCSP colorspace;     // colorspace: should be YUV420 for now (=Y'CbCr).\n  int width, height;         // dimensions (less or equal to WEBP_MAX_DIMENSION)\n  uint8_t *y, *u, *v;        // pointers to luma/chroma planes.\n  int y_stride, uv_stride;   // luma/chroma strides.\n  uint8_t* a;                // pointer to the alpha plane\n  int a_stride;              // stride of the alpha plane\n  uint32_t pad1[2];          // padding for later use\n\n  // ARGB input (mostly used for input to lossless compression)\n  uint32_t* argb;            // Pointer to argb (32 bit) plane.\n  int argb_stride;           // This is stride in pixels units, not bytes.\n  uint32_t pad2[3];          // padding for later use\n\n  //   OUTPUT\n  ///////////////\n  // Byte-emission hook, to store compressed bytes as they are ready.\n  WebPWriterFunction writer;  // can be NULL\n  void* custom_ptr;           // can be used by the writer.\n\n  // map for extra information (only for lossy compression mode)\n  int extra_info_type;    // 1: intra type, 2: segment, 3: quant\n                          // 4: intra-16 prediction mode,\n                          // 5: chroma prediction mode,\n                          // 6: bit cost, 7: distortion\n  uint8_t* extra_info;    // if not NULL, points to an array of size\n                          // ((width + 15) / 16) * ((height + 15) / 16) that\n                          // will be filled with a macroblock map, depending\n                          // on extra_info_type.\n\n  //   STATS AND REPORTS\n  ///////////////////////////\n  // Pointer to side statistics (updated only if not NULL)\n  WebPAuxStats* stats;\n\n  // Error code for the latest error encountered during encoding\n  WebPEncodingError error_code;\n\n  // If not NULL, report progress during encoding.\n  WebPProgressHook progress_hook;\n\n  void* user_data;        // this field is free to be set to any value and\n                          // used during callbacks (like progress-report e.g.).\n\n  uint32_t pad3[3];       // padding for later use\n\n  // Unused for now: original samples (for non-YUV420 modes)\n  uint8_t *u0, *v0;\n  int uv0_stride;\n\n  uint32_t pad4[7];       // padding for later use\n\n  // PRIVATE FIELDS\n  ////////////////////\n  void* memory_;          // row chunk of memory for yuva planes\n  void* memory_argb_;     // and for argb too.\n  void* pad5[2];          // padding for later use\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int);\n\n// Should always be called, to initialize the structure. Returns false in case\n// of version mismatch. WebPPictureInit() must have succeeded before using the\n// 'picture' object.\n// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.\nstatic WEBP_INLINE int WebPPictureInit(WebPPicture* picture) {\n  return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION);\n}\n\n//------------------------------------------------------------------------------\n// WebPPicture utils\n\n// Convenience allocation / deallocation based on picture->width/height:\n// Allocate y/u/v buffers as per colorspace/width/height specification.\n// Note! This function will free the previous buffer if needed.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture);\n\n// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*().\n// Note that this function does _not_ free the memory used by the 'picture'\n// object itself.\n// Besides memory (which is reclaimed) all other fields of 'picture' are\n// preserved.\nWEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture);\n\n// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return,\n// *dst will fully own the copied pixels (this is not a view).\n// Returns false in case of memory allocation error.\nWEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst);\n\n// Compute PSNR or SSIM distortion between two pictures.\n// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order.\n// Returns false in case of error (pic1 and pic2 don't have same dimension, ...)\n// Warning: this function is rather CPU-intensive.\nWEBP_EXTERN(int) WebPPictureDistortion(\n    const WebPPicture* pic1, const WebPPicture* pic2,\n    int metric_type,           // 0 = PSNR, 1 = SSIM\n    float result[5]);\n\n// self-crops a picture to the rectangle defined by top/left/width/height.\n// Returns false in case of memory allocation error, or if the rectangle is\n// outside of the source picture.\n// The rectangle for the view is defined by the top-left corner pixel\n// coordinates (left, top) as well as its width and height. This rectangle\n// must be fully be comprised inside the 'src' source picture. If the source\n// picture uses the YUV420 colorspace, the top and left coordinates will be\n// snapped to even values.\nWEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture,\n                                 int left, int top, int width, int height);\n\n// Extracts a view from 'src' picture into 'dst'. The rectangle for the view\n// is defined by the top-left corner pixel coordinates (left, top) as well\n// as its width and height. This rectangle must be fully be comprised inside\n// the 'src' source picture. If the source picture uses the YUV420 colorspace,\n// the top and left coordinates will be snapped to even values.\n// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed\n// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so,\n// the original dimension will be lost).\n// Returns false in case of memory allocation error or invalid parameters.\nWEBP_EXTERN(int) WebPPictureView(const WebPPicture* src,\n                                 int left, int top, int width, int height,\n                                 WebPPicture* dst);\n\n// Returns true if the 'picture' is actually a view and therefore does\n// not own the memory for pixels.\nWEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture);\n\n// Rescale a picture to new dimension width x height.\n// Now gamma correction is applied.\n// Returns false in case of error (invalid parameter or insufficient memory).\nWEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height);\n\n// Colorspace conversion function to import RGB samples.\n// Previous buffer will be free'd, if any.\n// *rgb buffer should have a size of at least height * rgb_stride.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureImportRGB(\n    WebPPicture* picture, const uint8_t* rgb, int rgb_stride);\n// Same, but for RGBA buffer.\nWEBP_EXTERN(int) WebPPictureImportRGBA(\n    WebPPicture* picture, const uint8_t* rgba, int rgba_stride);\n// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format\n// input buffer ignoring the alpha channel. Avoids needing to copy the data\n// to a temporary 24-bit RGB buffer to import the RGB only.\nWEBP_EXTERN(int) WebPPictureImportRGBX(\n    WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride);\n\n// Variants of the above, but taking BGR(A|X) input.\nWEBP_EXTERN(int) WebPPictureImportBGR(\n    WebPPicture* picture, const uint8_t* bgr, int bgr_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRA(\n    WebPPicture* picture, const uint8_t* bgra, int bgra_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRX(\n    WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride);\n\n// Converts picture->argb data to the YUVA format specified by 'colorspace'.\n// Upon return, picture->use_argb is set to false. The presence of real\n// non-opaque transparent values is detected, and 'colorspace' will be\n// adjusted accordingly. Note that this method is lossy.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture,\n                                       WebPEncCSP colorspace);\n\n// Converts picture->yuv to picture->argb and sets picture->use_argb to true.\n// The input format must be YUV_420 or YUV_420A.\n// Note that the use of this method is discouraged if one has access to the\n// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the\n// conversion from YUV420 to ARGB incurs a small loss too.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture);\n\n// Helper function: given a width x height plane of YUV(A) samples\n// (with stride 'stride'), clean-up the YUV samples under fully transparent\n// area, to help compressibility (no guarantee, though).\nWEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture);\n\n// Scan the picture 'picture' for the presence of non fully opaque alpha values.\n// Returns true in such case. Otherwise returns false (indicating that the\n// alpha plane can be ignored altogether e.g.).\nWEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n// Main call\n\n// Main encoding call, after config and picture have been initialized.\n// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION),\n// and the 'config' object must be a valid one.\n// Returns false in case of error, true otherwise.\n// In case of error, picture->error_code is updated accordingly.\n// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending\n// on the value of 'picture->use_argb'. It is highly recommended to use\n// the former for lossy encoding, and the latter for lossless encoding\n// (when config.lossless is true). Automatic conversion from one format to\n// another is provided but they both incur some loss.\nWEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_ENCODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/linux/types.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Common types\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_TYPES_H_\n#define WEBP_WEBP_TYPES_H_\n\n#include <stddef.h>  // for size_t\n\n#ifndef _MSC_VER\n#include <inttypes.h>\n#ifdef __STRICT_ANSI__\n#define WEBP_INLINE\n#else  /* __STRICT_ANSI__ */\n#define WEBP_INLINE inline\n#endif\n#else\ntypedef signed   char int8_t;\ntypedef unsigned char uint8_t;\ntypedef signed   short int16_t;\ntypedef unsigned short uint16_t;\ntypedef signed   int int32_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long int uint64_t;\ntypedef long long int int64_t;\n#define WEBP_INLINE __forceinline\n#endif  /* _MSC_VER */\n\n#ifndef WEBP_EXTERN\n// This explicitly marks library functions and allows for changing the\n// signature for e.g., Windows DLL builds.\n#define WEBP_EXTERN(type) extern type\n#endif  /* WEBP_EXTERN */\n\n// Macro to check ABI compatibility (same major revision number)\n#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))\n\n#endif  /* WEBP_WEBP_TYPES_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/mac/decode.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Main decoding functions for WebP images.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_DECODE_H_\n#define WEBP_WEBP_DECODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_DECODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the decoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetDecoderVersion(void);\n\n// Retrieve basic header information: width, height.\n// This function will also validate the header and return 0 in\n// case of formatting error.\n// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.\nWEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size,\n                             int* width, int* height);\n\n// Decodes WebP images pointed to by 'data' and returns RGBA samples, along\n// with the dimensions in *width and *height. The ordering of samples in\n// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).\n// The returned pointer should be deleted calling free().\n// Returns NULL in case of error.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.\n// If the bitstream contains transparency, it is ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n\n// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer\n// returned is the Y samples buffer. Upon return, *u and *v will point to\n// the U and V chroma data. These U and V buffers need NOT be free()'d,\n// unlike the returned Y luma one. The dimension of the U and V planes\n// are both (*width + 1) / 2 and (*height + 1)/ 2.\n// Upon return, the Y buffer has a stride returned as '*stride', while U and V\n// have a common stride returned as '*uv_stride'.\n// Return NULL in case of error.\n// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr\nWEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size,\n                                    int* width, int* height,\n                                    uint8_t** u, uint8_t** v,\n                                    int* stride, int* uv_stride);\n\n// These five functions are variants of the above ones, that decode the image\n// directly into a pre-allocated buffer 'output_buffer'. The maximum storage\n// available in this buffer is indicated by 'output_buffer_size'. If this\n// storage is not sufficient (or an error occurred), NULL is returned.\n// Otherwise, output_buffer is returned, for convenience.\n// The parameter 'output_stride' specifies the distance (in bytes)\n// between scanlines. Hence, output_buffer_size is expected to be at least\n// output_stride x picture-height.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeARGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// RGB and BGR variants. Here too the transparency information, if present,\n// will be dropped and ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly\n// into pre-allocated luma/chroma plane buffers. This function requires the\n// strides to be passed: one for the luma plane and one for each of the\n// chroma ones. The size of each plane buffer is passed as 'luma_size',\n// 'u_size' and 'v_size' respectively.\n// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred\n// during decoding (or because some buffers were found to be too small).\nWEBP_EXTERN(uint8_t*) WebPDecodeYUVInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n//------------------------------------------------------------------------------\n// Output colorspaces and buffer\n\n// Colorspaces\n// Note: the naming describes the byte-ordering of packed samples in memory.\n// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,...\n// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels.\n// RGB-565 and RGBA-4444 are also endian-agnostic and byte-oriented.\ntypedef enum { MODE_RGB = 0, MODE_RGBA = 1,\n               MODE_BGR = 2, MODE_BGRA = 3,\n               MODE_ARGB = 4, MODE_RGBA_4444 = 5,\n               MODE_RGB_565 = 6,\n               // RGB-premultiplied transparent modes (alpha value is preserved)\n               MODE_rgbA = 7,\n               MODE_bgrA = 8,\n               MODE_Argb = 9,\n               MODE_rgbA_4444 = 10,\n               // YUV modes must come after RGB ones.\n               MODE_YUV = 11, MODE_YUVA = 12,  // yuv 4:2:0\n               MODE_LAST = 13\n             } WEBP_CSP_MODE;\n\n// Some useful macros:\nstatic WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb ||\n          mode == MODE_rgbA_4444);\n}\n\nstatic WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||\n          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||\n          WebPIsPremultipliedMode(mode));\n}\n\nstatic WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {\n  return (mode < MODE_YUV);\n}\n\n//------------------------------------------------------------------------------\n// WebPDecBuffer: Generic structure for describing the output sample buffer.\n\ntypedef struct {    // view as RGBA\n  uint8_t* rgba;    // pointer to RGBA samples\n  int stride;       // stride in bytes from one scanline to the next.\n  size_t size;      // total size of the *rgba buffer.\n} WebPRGBABuffer;\n\ntypedef struct {              // view as YUVA\n  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples\n  int y_stride;               // luma stride\n  int u_stride, v_stride;     // chroma strides\n  int a_stride;               // alpha stride\n  size_t y_size;              // luma plane size\n  size_t u_size, v_size;      // chroma planes size\n  size_t a_size;              // alpha-plane size\n} WebPYUVABuffer;\n\n// Output buffer\ntypedef struct {\n  WEBP_CSP_MODE colorspace;  // Colorspace.\n  int width, height;         // Dimensions.\n  int is_external_memory;    // If true, 'internal_memory' pointer is not used.\n  union {\n    WebPRGBABuffer RGBA;\n    WebPYUVABuffer YUVA;\n  } u;                       // Nameless union of buffer parameters.\n  uint32_t       pad[4];     // padding for later use\n\n  uint8_t* private_memory;   // Internally allocated memory (only when\n                             // is_external_memory is false). Should not be used\n                             // externally, but accessed via the buffer union.\n} WebPDecBuffer;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int);\n\n// Initialize the structure as empty. Must be called before any other use.\n// Returns false in case of version mismatch\nstatic WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {\n  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);\n}\n\n// Free any memory associated with the buffer. Must always be called last.\n// Note: doesn't free the 'buffer' structure itself.\nWEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer);\n\n//------------------------------------------------------------------------------\n// Enumeration of the status codes\n\ntypedef enum {\n  VP8_STATUS_OK = 0,\n  VP8_STATUS_OUT_OF_MEMORY,\n  VP8_STATUS_INVALID_PARAM,\n  VP8_STATUS_BITSTREAM_ERROR,\n  VP8_STATUS_UNSUPPORTED_FEATURE,\n  VP8_STATUS_SUSPENDED,\n  VP8_STATUS_USER_ABORT,\n  VP8_STATUS_NOT_ENOUGH_DATA\n} VP8StatusCode;\n\n//------------------------------------------------------------------------------\n// Incremental decoding\n//\n// This API allows streamlined decoding of partial data.\n// Picture can be incrementally decoded as data become available thanks to the\n// WebPIDecoder object. This object can be left in a SUSPENDED state if the\n// picture is only partially decoded, pending additional input.\n// Code example:\n//\n//   WebPInitDecBuffer(&buffer);\n//   buffer.colorspace = mode;\n//   ...\n//   WebPIDecoder* idec = WebPINewDecoder(&buffer);\n//   while (has_more_data) {\n//     // ... (get additional data)\n//     status = WebPIAppend(idec, new_data, new_data_size);\n//     if (status != VP8_STATUS_SUSPENDED ||\n//       break;\n//     }\n//\n//     // The above call decodes the current available buffer.\n//     // Part of the image can now be refreshed by calling to\n//     // WebPIDecGetRGB()/WebPIDecGetYUVA() etc.\n//   }\n//   WebPIDelete(idec);\n\ntypedef struct WebPIDecoder WebPIDecoder;\n\n// Creates a new incremental decoder with the supplied buffer parameter.\n// This output_buffer can be passed NULL, in which case a default output buffer\n// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer'\n// is kept, which means that the lifespan of 'output_buffer' must be larger than\n// that of the returned WebPIDecoder object.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the RGB/A samples specified by 'csp' into a preallocated\n// buffer 'output_buffer'. The size of this buffer is at least\n// 'output_buffer_size' and the stride (distance in bytes between two scanlines)\n// is specified by 'output_stride'. Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewRGB(\n    WEBP_CSP_MODE csp,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the raw luma/chroma samples into a preallocated planes. The luma\n// plane is specified by its pointer 'luma', its size 'luma_size' and its stride\n// 'luma_stride'. Similarly, the chroma-u plane is specified by the 'u',\n// 'u_size' and 'u_stride' parameters, and the chroma-v plane by 'v'\n// and 'v_size'. And same for the alpha-plane. The 'a' pointer can be pass\n// NULL in case one is not interested in the transparency plane.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUVA(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride,\n    uint8_t* a, size_t a_size, int a_stride);\n\n// Deprecated version of the above, without the alpha plane.\n// Kept for backward compatibility.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUV(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n// Deletes the WebPIDecoder object and associated memory. Must always be called\n// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.\nWEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec);\n\n// Copies and decodes the next available data. Returns VP8_STATUS_OK when\n// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more\n// data is expected. Returns error in other cases.\nWEBP_EXTERN(VP8StatusCode) WebPIAppend(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// A variant of the above function to be used when data buffer contains\n// partial data from the beginning. In this case data buffer is not copied\n// to the internal memory.\n// Note that the value of the 'data' pointer can change between calls to\n// WebPIUpdate, for instance when the data buffer is resized to fit larger data.\nWEBP_EXTERN(VP8StatusCode) WebPIUpdate(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// Returns the RGB/A image decoded so far. Returns NULL if output params\n// are not initialized yet. The RGB/A output type corresponds to the colorspace\n// specified during call to WebPINewDecoder() or WebPINewRGB().\n// *last_y is the index of last decoded row in raster scan order. Some pointers\n// (*last_y, *width etc.) can be NULL if corresponding information is not\n// needed.\nWEBP_EXTERN(uint8_t*) WebPIDecGetRGB(\n    const WebPIDecoder* idec, int* last_y,\n    int* width, int* height, int* stride);\n\n// Same as above function to get a YUVA image. Returns pointer to the luma\n// plane or NULL in case of error. If there is no alpha information\n// the alpha pointer '*a' will be returned NULL.\nWEBP_EXTERN(uint8_t*) WebPIDecGetYUVA(\n    const WebPIDecoder* idec, int* last_y,\n    uint8_t** u, uint8_t** v, uint8_t** a,\n    int* width, int* height, int* stride, int* uv_stride, int* a_stride);\n\n// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the\n// alpha information (if present). Kept for backward compatibility.\nstatic WEBP_INLINE uint8_t* WebPIDecGetYUV(\n    const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v,\n    int* width, int* height, int* stride, int* uv_stride) {\n  return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height,\n                         stride, uv_stride, NULL);\n}\n\n// Generic call to retrieve information about the displayable area.\n// If non NULL, the left/right/width/height pointers are filled with the visible\n// rectangular area so far.\n// Returns NULL in case the incremental decoder object is in an invalid state.\n// Otherwise returns the pointer to the internal representation. This structure\n// is read-only, tied to WebPIDecoder's lifespan and should not be modified.\nWEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea(\n    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);\n\n//------------------------------------------------------------------------------\n// Advanced decoding parametrization\n//\n//  Code sample for using the advanced decoding API\n/*\n     // A) Init a configuration object\n     WebPDecoderConfig config;\n     CHECK(WebPInitDecoderConfig(&config));\n\n     // B) optional: retrieve the bitstream's features.\n     CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK);\n\n     // C) Adjust 'config', if needed\n     config.no_fancy = 1;\n     config.output.colorspace = MODE_BGRA;\n     // etc.\n\n     // Note that you can also make config.output point to an externally\n     // supplied memory buffer, provided it's big enough to store the decoded\n     // picture. Otherwise, config.output will just be used to allocate memory\n     // and store the decoded picture.\n\n     // D) Decode!\n     CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK);\n\n     // E) Decoded image is now in config.output (and config.output.u.RGBA)\n\n     // F) Reclaim memory allocated in config's object. It's safe to call\n     // this function even if the memory is external and wasn't allocated\n     // by WebPDecode().\n     WebPFreeDecBuffer(&config.output);\n*/\n\n// Features gathered from the bitstream\ntypedef struct {\n  int width;        // Width in pixels, as read from the bitstream.\n  int height;       // Height in pixels, as read from the bitstream.\n  int has_alpha;    // True if the bitstream contains an alpha channel.\n\n  // Unused for now:\n  int bitstream_version;        // should be 0 for now. TODO(later)\n  int no_incremental_decoding;  // if true, using incremental decoding is not\n                                // recommended.\n  int rotate;                   // TODO(later)\n  int uv_sampling;              // should be 0 for now. TODO(later)\n  uint32_t pad[3];              // padding for later use\n} WebPBitstreamFeatures;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal(\n    const uint8_t*, size_t, WebPBitstreamFeatures*, int);\n\n// Retrieve features from the bitstream. The *features structure is filled\n// with information gathered from the bitstream.\n// Returns false in case of error or version mismatch.\n// In case of error, features->bitstream_status will reflect the error code.\nstatic WEBP_INLINE VP8StatusCode WebPGetFeatures(\n    const uint8_t* data, size_t data_size,\n    WebPBitstreamFeatures* features) {\n  return WebPGetFeaturesInternal(data, data_size, features,\n                                 WEBP_DECODER_ABI_VERSION);\n}\n\n// Decoding options\ntypedef struct {\n  int bypass_filtering;               // if true, skip the in-loop filtering\n  int no_fancy_upsampling;            // if true, use faster pointwise upsampler\n  int use_cropping;                   // if true, cropping is applied _first_\n  int crop_left, crop_top;            // top-left position for cropping.\n                                      // Will be snapped to even values.\n  int crop_width, crop_height;        // dimension of the cropping area\n  int use_scaling;                    // if true, scaling is applied _afterward_\n  int scaled_width, scaled_height;    // final resolution\n  int use_threads;                    // if true, use multi-threaded decoding\n\n  // Unused for now:\n  int force_rotation;                 // forced rotation (to be applied _last_)\n  int no_enhancement;                 // if true, discard enhancement layer\n  uint32_t pad[6];                    // padding for later use\n} WebPDecoderOptions;\n\n// Main object storing the configuration for advanced decoding.\ntypedef struct {\n  WebPBitstreamFeatures input;  // Immutable bitstream features (optional)\n  WebPDecBuffer output;         // Output buffer (can point to external mem)\n  WebPDecoderOptions options;   // Decoding options\n} WebPDecoderConfig;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);\n\n// Initialize the configuration as empty. This function must always be\n// called first, unless WebPGetFeatures() is to be called.\n// Returns false in case of mismatched version.\nstatic WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {\n  return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);\n}\n\n// Instantiate a new incremental decoder object with the requested\n// configuration. The bitstream can be passed using 'data' and 'data_size'\n// parameter, in which case the features will be parsed and stored into\n// config->input. Otherwise, 'data' can be NULL and no parsing will occur.\n// Note that 'config' can be NULL too, in which case a default configuration\n// is used.\n// The return WebPIDecoder object must always be deleted calling WebPIDelete().\n// Returns NULL in case of error (and config->status will then reflect\n// the error condition).\nWEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size,\n                                       WebPDecoderConfig* config);\n\n// Non-incremental version. This version decodes the full data at once, taking\n// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK\n// if the decoding was successful).\nWEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size,\n                                      WebPDecoderConfig* config);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DECODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/mac/encode.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//   WebP encoder: main interface\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_ENCODE_H_\n#define WEBP_WEBP_ENCODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_ENCODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the encoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetEncoderVersion(void);\n\n//------------------------------------------------------------------------------\n// One-stop-shop call! No questions asked:\n\n// Returns the size of the compressed data (pointed to by *output), or 0 if\n// an error occurred. The compressed data must be released by the caller\n// using the call 'free(*output)'.\n// These functions compress using the lossy format, and the quality_factor\n// can go from 0 (smaller output, lower quality) to 100 (best quality,\n// larger output).\nWEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\n\n// These functions are the equivalent of the above, but compressing in a\n// lossless manner. Files are usually larger than lossy format, but will\n// not suffer any compression loss.\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\n\n//------------------------------------------------------------------------------\n// Coding parameters\n\n// Image characteristics hint for the underlying encoder.\ntypedef enum {\n  WEBP_HINT_DEFAULT = 0,  // default preset.\n  WEBP_HINT_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_HINT_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_HINT_GRAPH,        // Discrete tone image (graph, map-tile etc).\n  WEBP_HINT_LAST\n} WebPImageHint;\n\ntypedef struct {\n  int lossless;           // Lossless encoding (0=lossy(default), 1=lossless).\n  float quality;          // between 0 (smallest file) and 100 (biggest)\n  int method;             // quality/speed trade-off (0=fast, 6=slower-better)\n\n  WebPImageHint image_hint;  // Hint for image type (lossless only for now).\n\n  // Parameters related to lossy compression only:\n  int target_size;        // if non-zero, set the desired target size in bytes.\n                          // Takes precedence over the 'compression' parameter.\n  float target_PSNR;      // if non-zero, specifies the minimal distortion to\n                          // try to achieve. Takes precedence over target_size.\n  int segments;           // maximum number of segments to use, in [1..4]\n  int sns_strength;       // Spatial Noise Shaping. 0=off, 100=maximum.\n  int filter_strength;    // range: [0 = off .. 100 = strongest]\n  int filter_sharpness;   // range: [0 = off .. 7 = least sharp]\n  int filter_type;        // filtering type: 0 = simple, 1 = strong (only used\n                          // if filter_strength > 0 or autofilter > 0)\n  int autofilter;         // Auto adjust filter's strength [0 = off, 1 = on]\n  int alpha_compression;  // Algorithm for encoding the alpha plane (0 = none,\n                          // 1 = compressed with WebP lossless). Default is 1.\n  int alpha_filtering;    // Predictive filtering method for alpha plane.\n                          //  0: none, 1: fast, 2: best. Default if 1.\n  int alpha_quality;      // Between 0 (smallest size) and 100 (lossless).\n                          // Default is 100.\n  int pass;               // number of entropy-analysis passes (in [1..10]).\n\n  int show_compressed;    // if true, export the compressed picture back.\n                          // In-loop filtering is not applied.\n  int preprocessing;      // preprocessing filter (0=none, 1=segment-smooth)\n  int partitions;         // log2(number of token partitions) in [0..3]. Default\n                          // is set to 0 for easier progressive decoding.\n  int partition_limit;    // quality degradation allowed to fit the 512k limit\n                          // on prediction modes coding (0: no degradation,\n                          // 100: maximum possible degradation).\n\n  uint32_t pad[8];        // padding for later use\n} WebPConfig;\n\n// Enumerate some predefined settings for WebPConfig, depending on the type\n// of source picture. These presets are used when calling WebPConfigPreset().\ntypedef enum {\n  WEBP_PRESET_DEFAULT = 0,  // default preset.\n  WEBP_PRESET_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_PRESET_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_PRESET_DRAWING,      // hand or line drawing, with high-contrast details\n  WEBP_PRESET_ICON,         // small-sized colorful images\n  WEBP_PRESET_TEXT          // text-like\n} WebPPreset;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int);\n\n// Should always be called, to initialize a fresh WebPConfig structure before\n// modification. Returns false in case of version mismatch. WebPConfigInit()\n// must have succeeded before using the 'config' object.\n// Note that the default values are lossless=0 and quality=75.\nstatic WEBP_INLINE int WebPConfigInit(WebPConfig* config) {\n  return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// This function will initialize the configuration according to a predefined\n// set of parameters (referred to by 'preset') and a given quality factor.\n// This function can be called as a replacement to WebPConfigInit(). Will\n// return false in case of error.\nstatic WEBP_INLINE int WebPConfigPreset(WebPConfig* config,\n                                        WebPPreset preset, float quality) {\n  return WebPConfigInitInternal(config, preset, quality,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// Returns true if 'config' is non-NULL and all configuration parameters are\n// within their valid ranges.\nWEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config);\n\n//------------------------------------------------------------------------------\n// Input / Output\n\ntypedef struct WebPPicture WebPPicture;   // main structure for I/O\n\n// Structure for storing auxiliary statistics (mostly for lossy encoding).\ntypedef struct {\n  int coded_size;         // final size\n\n  float PSNR[5];          // peak-signal-to-noise ratio for Y/U/V/All/Alpha\n  int block_count[3];     // number of intra4/intra16/skipped macroblocks\n  int header_bytes[2];    // approximate number of bytes spent for header\n                          // and mode-partition #0\n  int residual_bytes[3][4];  // approximate number of bytes spent for\n                             // DC/AC/uv coefficients for each (0..3) segments.\n  int segment_size[4];    // number of macroblocks in each segments\n  int segment_quant[4];   // quantizer values for each segments\n  int segment_level[4];   // filtering strength for each segments [0..63]\n\n  int alpha_data_size;    // size of the transparency data\n  int layer_data_size;    // size of the enhancement layer data\n\n  // lossless encoder statistics\n  uint32_t lossless_features;  // bit0:predictor bit1:cross-color transform\n                               // bit2:subtract-green bit3:color indexing\n  int histogram_bits;          // number of precision bits of histogram\n  int transform_bits;          // precision bits for transform\n  int cache_bits;              // number of bits for color cache lookup\n  int palette_size;            // number of color in palette, if used\n  int lossless_size;           // final lossless size\n\n  uint32_t pad[4];        // padding for later use\n} WebPAuxStats;\n\n// Signature for output function. Should return true if writing was successful.\n// data/data_size is the segment of data to write, and 'picture' is for\n// reference (and so one can make use of picture->custom_ptr).\ntypedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size,\n                                  const WebPPicture* picture);\n\n// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using\n// the following WebPMemoryWriter object (to be set as a custom_ptr).\ntypedef struct {\n  uint8_t* mem;       // final buffer (of size 'max_size', larger than 'size').\n  size_t   size;      // final size\n  size_t   max_size;  // total capacity\n  uint32_t pad[1];    // padding for later use\n} WebPMemoryWriter;\n\n// The following must be called first before any use.\nWEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer);\n\n// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon\n// completion, writer.mem and writer.size will hold the coded data.\nWEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size,\n                                 const WebPPicture* picture);\n\n// Progress hook, called from time to time to report progress. It can return\n// false to request an abort of the encoding process, or true otherwise if\n// everything is OK.\ntypedef int (*WebPProgressHook)(int percent, const WebPPicture* picture);\n\ntypedef enum {\n  // chroma sampling\n  WEBP_YUV420 = 0,   // 4:2:0\n  WEBP_YUV422 = 1,   // 4:2:2\n  WEBP_YUV444 = 2,   // 4:4:4\n  WEBP_YUV400 = 3,   // grayscale\n  WEBP_CSP_UV_MASK = 3,   // bit-mask to get the UV sampling factors\n  // alpha channel variants\n  WEBP_YUV420A = 4,\n  WEBP_YUV422A = 5,\n  WEBP_YUV444A = 6,\n  WEBP_YUV400A = 7,   // grayscale + alpha\n  WEBP_CSP_ALPHA_BIT = 4   // bit that is set if alpha is present\n} WebPEncCSP;\n\n// Encoding error conditions.\ntypedef enum {\n  VP8_ENC_OK = 0,\n  VP8_ENC_ERROR_OUT_OF_MEMORY,            // memory error allocating objects\n  VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY,  // memory error while flushing bits\n  VP8_ENC_ERROR_NULL_PARAMETER,           // a pointer parameter is NULL\n  VP8_ENC_ERROR_INVALID_CONFIGURATION,    // configuration is invalid\n  VP8_ENC_ERROR_BAD_DIMENSION,            // picture has invalid width/height\n  VP8_ENC_ERROR_PARTITION0_OVERFLOW,      // partition is bigger than 512k\n  VP8_ENC_ERROR_PARTITION_OVERFLOW,       // partition is bigger than 16M\n  VP8_ENC_ERROR_BAD_WRITE,                // error while flushing bytes\n  VP8_ENC_ERROR_FILE_TOO_BIG,             // file is bigger than 4G\n  VP8_ENC_ERROR_USER_ABORT,               // abort request by user\n  VP8_ENC_ERROR_LAST                      // list terminator. always last.\n} WebPEncodingError;\n\n// maximum width/height allowed (inclusive), in pixels\n#define WEBP_MAX_DIMENSION 16383\n\n// Main exchange structure (input samples, output bytes, statistics)\nstruct WebPPicture {\n\n  //   INPUT\n  //////////////\n  // Main flag for encoder selecting between ARGB or YUV input.\n  // It is recommended to use ARGB input (*argb, argb_stride) for lossless\n  // compression, and YUV input (*y, *u, *v, etc.) for lossy compression\n  // since these are the respective native colorspace for these formats.\n  int use_argb;\n\n  // YUV input (mostly used for input to lossy compression)\n  WebPEncCSP colorspace;     // colorspace: should be YUV420 for now (=Y'CbCr).\n  int width, height;         // dimensions (less or equal to WEBP_MAX_DIMENSION)\n  uint8_t *y, *u, *v;        // pointers to luma/chroma planes.\n  int y_stride, uv_stride;   // luma/chroma strides.\n  uint8_t* a;                // pointer to the alpha plane\n  int a_stride;              // stride of the alpha plane\n  uint32_t pad1[2];          // padding for later use\n\n  // ARGB input (mostly used for input to lossless compression)\n  uint32_t* argb;            // Pointer to argb (32 bit) plane.\n  int argb_stride;           // This is stride in pixels units, not bytes.\n  uint32_t pad2[3];          // padding for later use\n\n  //   OUTPUT\n  ///////////////\n  // Byte-emission hook, to store compressed bytes as they are ready.\n  WebPWriterFunction writer;  // can be NULL\n  void* custom_ptr;           // can be used by the writer.\n\n  // map for extra information (only for lossy compression mode)\n  int extra_info_type;    // 1: intra type, 2: segment, 3: quant\n                          // 4: intra-16 prediction mode,\n                          // 5: chroma prediction mode,\n                          // 6: bit cost, 7: distortion\n  uint8_t* extra_info;    // if not NULL, points to an array of size\n                          // ((width + 15) / 16) * ((height + 15) / 16) that\n                          // will be filled with a macroblock map, depending\n                          // on extra_info_type.\n\n  //   STATS AND REPORTS\n  ///////////////////////////\n  // Pointer to side statistics (updated only if not NULL)\n  WebPAuxStats* stats;\n\n  // Error code for the latest error encountered during encoding\n  WebPEncodingError error_code;\n\n  // If not NULL, report progress during encoding.\n  WebPProgressHook progress_hook;\n\n  void* user_data;        // this field is free to be set to any value and\n                          // used during callbacks (like progress-report e.g.).\n\n  uint32_t pad3[3];       // padding for later use\n\n  // Unused for now: original samples (for non-YUV420 modes)\n  uint8_t *u0, *v0;\n  int uv0_stride;\n\n  uint32_t pad4[7];       // padding for later use\n\n  // PRIVATE FIELDS\n  ////////////////////\n  void* memory_;          // row chunk of memory for yuva planes\n  void* memory_argb_;     // and for argb too.\n  void* pad5[2];          // padding for later use\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int);\n\n// Should always be called, to initialize the structure. Returns false in case\n// of version mismatch. WebPPictureInit() must have succeeded before using the\n// 'picture' object.\n// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.\nstatic WEBP_INLINE int WebPPictureInit(WebPPicture* picture) {\n  return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION);\n}\n\n//------------------------------------------------------------------------------\n// WebPPicture utils\n\n// Convenience allocation / deallocation based on picture->width/height:\n// Allocate y/u/v buffers as per colorspace/width/height specification.\n// Note! This function will free the previous buffer if needed.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture);\n\n// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*().\n// Note that this function does _not_ free the memory used by the 'picture'\n// object itself.\n// Besides memory (which is reclaimed) all other fields of 'picture' are\n// preserved.\nWEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture);\n\n// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return,\n// *dst will fully own the copied pixels (this is not a view).\n// Returns false in case of memory allocation error.\nWEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst);\n\n// Compute PSNR or SSIM distortion between two pictures.\n// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order.\n// Returns false in case of error (pic1 and pic2 don't have same dimension, ...)\n// Warning: this function is rather CPU-intensive.\nWEBP_EXTERN(int) WebPPictureDistortion(\n    const WebPPicture* pic1, const WebPPicture* pic2,\n    int metric_type,           // 0 = PSNR, 1 = SSIM\n    float result[5]);\n\n// self-crops a picture to the rectangle defined by top/left/width/height.\n// Returns false in case of memory allocation error, or if the rectangle is\n// outside of the source picture.\n// The rectangle for the view is defined by the top-left corner pixel\n// coordinates (left, top) as well as its width and height. This rectangle\n// must be fully be comprised inside the 'src' source picture. If the source\n// picture uses the YUV420 colorspace, the top and left coordinates will be\n// snapped to even values.\nWEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture,\n                                 int left, int top, int width, int height);\n\n// Extracts a view from 'src' picture into 'dst'. The rectangle for the view\n// is defined by the top-left corner pixel coordinates (left, top) as well\n// as its width and height. This rectangle must be fully be comprised inside\n// the 'src' source picture. If the source picture uses the YUV420 colorspace,\n// the top and left coordinates will be snapped to even values.\n// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed\n// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so,\n// the original dimension will be lost).\n// Returns false in case of memory allocation error or invalid parameters.\nWEBP_EXTERN(int) WebPPictureView(const WebPPicture* src,\n                                 int left, int top, int width, int height,\n                                 WebPPicture* dst);\n\n// Returns true if the 'picture' is actually a view and therefore does\n// not own the memory for pixels.\nWEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture);\n\n// Rescale a picture to new dimension width x height.\n// Now gamma correction is applied.\n// Returns false in case of error (invalid parameter or insufficient memory).\nWEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height);\n\n// Colorspace conversion function to import RGB samples.\n// Previous buffer will be free'd, if any.\n// *rgb buffer should have a size of at least height * rgb_stride.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureImportRGB(\n    WebPPicture* picture, const uint8_t* rgb, int rgb_stride);\n// Same, but for RGBA buffer.\nWEBP_EXTERN(int) WebPPictureImportRGBA(\n    WebPPicture* picture, const uint8_t* rgba, int rgba_stride);\n// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format\n// input buffer ignoring the alpha channel. Avoids needing to copy the data\n// to a temporary 24-bit RGB buffer to import the RGB only.\nWEBP_EXTERN(int) WebPPictureImportRGBX(\n    WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride);\n\n// Variants of the above, but taking BGR(A|X) input.\nWEBP_EXTERN(int) WebPPictureImportBGR(\n    WebPPicture* picture, const uint8_t* bgr, int bgr_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRA(\n    WebPPicture* picture, const uint8_t* bgra, int bgra_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRX(\n    WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride);\n\n// Converts picture->argb data to the YUVA format specified by 'colorspace'.\n// Upon return, picture->use_argb is set to false. The presence of real\n// non-opaque transparent values is detected, and 'colorspace' will be\n// adjusted accordingly. Note that this method is lossy.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture,\n                                       WebPEncCSP colorspace);\n\n// Converts picture->yuv to picture->argb and sets picture->use_argb to true.\n// The input format must be YUV_420 or YUV_420A.\n// Note that the use of this method is discouraged if one has access to the\n// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the\n// conversion from YUV420 to ARGB incurs a small loss too.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture);\n\n// Helper function: given a width x height plane of YUV(A) samples\n// (with stride 'stride'), clean-up the YUV samples under fully transparent\n// area, to help compressibility (no guarantee, though).\nWEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture);\n\n// Scan the picture 'picture' for the presence of non fully opaque alpha values.\n// Returns true in such case. Otherwise returns false (indicating that the\n// alpha plane can be ignored altogether e.g.).\nWEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n// Main call\n\n// Main encoding call, after config and picture have been initialized.\n// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION),\n// and the 'config' object must be a valid one.\n// Returns false in case of error, true otherwise.\n// In case of error, picture->error_code is updated accordingly.\n// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending\n// on the value of 'picture->use_argb'. It is highly recommended to use\n// the former for lossy encoding, and the latter for lossless encoding\n// (when config.lossless is true). Automatic conversion from one format to\n// another is provided but they both incur some loss.\nWEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_ENCODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/mac/types.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Common types\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_TYPES_H_\n#define WEBP_WEBP_TYPES_H_\n\n#include <stddef.h>  // for size_t\n\n#ifndef _MSC_VER\n#include <inttypes.h>\n#ifdef __STRICT_ANSI__\n#define WEBP_INLINE\n#else  /* __STRICT_ANSI__ */\n#define WEBP_INLINE inline\n#endif\n#else\ntypedef signed   char int8_t;\ntypedef unsigned char uint8_t;\ntypedef signed   short int16_t;\ntypedef unsigned short uint16_t;\ntypedef signed   int int32_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long int uint64_t;\ntypedef long long int int64_t;\n#define WEBP_INLINE __forceinline\n#endif  /* _MSC_VER */\n\n#ifndef WEBP_EXTERN\n// This explicitly marks library functions and allows for changing the\n// signature for e.g., Windows DLL builds.\n#define WEBP_EXTERN(type) extern type\n#endif  /* WEBP_EXTERN */\n\n// Macro to check ABI compatibility (same major revision number)\n#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))\n\n#endif  /* WEBP_WEBP_TYPES_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/win32/decode.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Main decoding functions for WebP images.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_DECODE_H_\n#define WEBP_WEBP_DECODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_DECODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the decoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetDecoderVersion(void);\n\n// Retrieve basic header information: width, height.\n// This function will also validate the header and return 0 in\n// case of formatting error.\n// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.\nWEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size,\n                             int* width, int* height);\n\n// Decodes WebP images pointed to by 'data' and returns RGBA samples, along\n// with the dimensions in *width and *height. The ordering of samples in\n// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).\n// The returned pointer should be deleted calling free().\n// Returns NULL in case of error.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.\n// If the bitstream contains transparency, it is ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n\n// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer\n// returned is the Y samples buffer. Upon return, *u and *v will point to\n// the U and V chroma data. These U and V buffers need NOT be free()'d,\n// unlike the returned Y luma one. The dimension of the U and V planes\n// are both (*width + 1) / 2 and (*height + 1)/ 2.\n// Upon return, the Y buffer has a stride returned as '*stride', while U and V\n// have a common stride returned as '*uv_stride'.\n// Return NULL in case of error.\n// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr\nWEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size,\n                                    int* width, int* height,\n                                    uint8_t** u, uint8_t** v,\n                                    int* stride, int* uv_stride);\n\n// These five functions are variants of the above ones, that decode the image\n// directly into a pre-allocated buffer 'output_buffer'. The maximum storage\n// available in this buffer is indicated by 'output_buffer_size'. If this\n// storage is not sufficient (or an error occurred), NULL is returned.\n// Otherwise, output_buffer is returned, for convenience.\n// The parameter 'output_stride' specifies the distance (in bytes)\n// between scanlines. Hence, output_buffer_size is expected to be at least\n// output_stride x picture-height.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeARGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// RGB and BGR variants. Here too the transparency information, if present,\n// will be dropped and ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly\n// into pre-allocated luma/chroma plane buffers. This function requires the\n// strides to be passed: one for the luma plane and one for each of the\n// chroma ones. The size of each plane buffer is passed as 'luma_size',\n// 'u_size' and 'v_size' respectively.\n// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred\n// during decoding (or because some buffers were found to be too small).\nWEBP_EXTERN(uint8_t*) WebPDecodeYUVInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n//------------------------------------------------------------------------------\n// Output colorspaces and buffer\n\n// Colorspaces\n// Note: the naming describes the byte-ordering of packed samples in memory.\n// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,...\n// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels.\n// RGB-565 and RGBA-4444 are also endian-agnostic and byte-oriented.\ntypedef enum { MODE_RGB = 0, MODE_RGBA = 1,\n               MODE_BGR = 2, MODE_BGRA = 3,\n               MODE_ARGB = 4, MODE_RGBA_4444 = 5,\n               MODE_RGB_565 = 6,\n               // RGB-premultiplied transparent modes (alpha value is preserved)\n               MODE_rgbA = 7,\n               MODE_bgrA = 8,\n               MODE_Argb = 9,\n               MODE_rgbA_4444 = 10,\n               // YUV modes must come after RGB ones.\n               MODE_YUV = 11, MODE_YUVA = 12,  // yuv 4:2:0\n               MODE_LAST = 13\n             } WEBP_CSP_MODE;\n\n// Some useful macros:\nstatic WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb ||\n          mode == MODE_rgbA_4444);\n}\n\nstatic WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||\n          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||\n          WebPIsPremultipliedMode(mode));\n}\n\nstatic WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {\n  return (mode < MODE_YUV);\n}\n\n//------------------------------------------------------------------------------\n// WebPDecBuffer: Generic structure for describing the output sample buffer.\n\ntypedef struct {    // view as RGBA\n  uint8_t* rgba;    // pointer to RGBA samples\n  int stride;       // stride in bytes from one scanline to the next.\n  size_t size;      // total size of the *rgba buffer.\n} WebPRGBABuffer;\n\ntypedef struct {              // view as YUVA\n  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples\n  int y_stride;               // luma stride\n  int u_stride, v_stride;     // chroma strides\n  int a_stride;               // alpha stride\n  size_t y_size;              // luma plane size\n  size_t u_size, v_size;      // chroma planes size\n  size_t a_size;              // alpha-plane size\n} WebPYUVABuffer;\n\n// Output buffer\ntypedef struct {\n  WEBP_CSP_MODE colorspace;  // Colorspace.\n  int width, height;         // Dimensions.\n  int is_external_memory;    // If true, 'internal_memory' pointer is not used.\n  union {\n    WebPRGBABuffer RGBA;\n    WebPYUVABuffer YUVA;\n  } u;                       // Nameless union of buffer parameters.\n  uint32_t       pad[4];     // padding for later use\n\n  uint8_t* private_memory;   // Internally allocated memory (only when\n                             // is_external_memory is false). Should not be used\n                             // externally, but accessed via the buffer union.\n} WebPDecBuffer;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int);\n\n// Initialize the structure as empty. Must be called before any other use.\n// Returns false in case of version mismatch\nstatic WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {\n  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);\n}\n\n// Free any memory associated with the buffer. Must always be called last.\n// Note: doesn't free the 'buffer' structure itself.\nWEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer);\n\n//------------------------------------------------------------------------------\n// Enumeration of the status codes\n\ntypedef enum {\n  VP8_STATUS_OK = 0,\n  VP8_STATUS_OUT_OF_MEMORY,\n  VP8_STATUS_INVALID_PARAM,\n  VP8_STATUS_BITSTREAM_ERROR,\n  VP8_STATUS_UNSUPPORTED_FEATURE,\n  VP8_STATUS_SUSPENDED,\n  VP8_STATUS_USER_ABORT,\n  VP8_STATUS_NOT_ENOUGH_DATA\n} VP8StatusCode;\n\n//------------------------------------------------------------------------------\n// Incremental decoding\n//\n// This API allows streamlined decoding of partial data.\n// Picture can be incrementally decoded as data become available thanks to the\n// WebPIDecoder object. This object can be left in a SUSPENDED state if the\n// picture is only partially decoded, pending additional input.\n// Code example:\n//\n//   WebPInitDecBuffer(&buffer);\n//   buffer.colorspace = mode;\n//   ...\n//   WebPIDecoder* idec = WebPINewDecoder(&buffer);\n//   while (has_more_data) {\n//     // ... (get additional data)\n//     status = WebPIAppend(idec, new_data, new_data_size);\n//     if (status != VP8_STATUS_SUSPENDED ||\n//       break;\n//     }\n//\n//     // The above call decodes the current available buffer.\n//     // Part of the image can now be refreshed by calling to\n//     // WebPIDecGetRGB()/WebPIDecGetYUVA() etc.\n//   }\n//   WebPIDelete(idec);\n\ntypedef struct WebPIDecoder WebPIDecoder;\n\n// Creates a new incremental decoder with the supplied buffer parameter.\n// This output_buffer can be passed NULL, in which case a default output buffer\n// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer'\n// is kept, which means that the lifespan of 'output_buffer' must be larger than\n// that of the returned WebPIDecoder object.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the RGB/A samples specified by 'csp' into a preallocated\n// buffer 'output_buffer'. The size of this buffer is at least\n// 'output_buffer_size' and the stride (distance in bytes between two scanlines)\n// is specified by 'output_stride'. Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewRGB(\n    WEBP_CSP_MODE csp,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the raw luma/chroma samples into a preallocated planes. The luma\n// plane is specified by its pointer 'luma', its size 'luma_size' and its stride\n// 'luma_stride'. Similarly, the chroma-u plane is specified by the 'u',\n// 'u_size' and 'u_stride' parameters, and the chroma-v plane by 'v'\n// and 'v_size'. And same for the alpha-plane. The 'a' pointer can be pass\n// NULL in case one is not interested in the transparency plane.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUVA(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride,\n    uint8_t* a, size_t a_size, int a_stride);\n\n// Deprecated version of the above, without the alpha plane.\n// Kept for backward compatibility.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUV(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n// Deletes the WebPIDecoder object and associated memory. Must always be called\n// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.\nWEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec);\n\n// Copies and decodes the next available data. Returns VP8_STATUS_OK when\n// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more\n// data is expected. Returns error in other cases.\nWEBP_EXTERN(VP8StatusCode) WebPIAppend(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// A variant of the above function to be used when data buffer contains\n// partial data from the beginning. In this case data buffer is not copied\n// to the internal memory.\n// Note that the value of the 'data' pointer can change between calls to\n// WebPIUpdate, for instance when the data buffer is resized to fit larger data.\nWEBP_EXTERN(VP8StatusCode) WebPIUpdate(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// Returns the RGB/A image decoded so far. Returns NULL if output params\n// are not initialized yet. The RGB/A output type corresponds to the colorspace\n// specified during call to WebPINewDecoder() or WebPINewRGB().\n// *last_y is the index of last decoded row in raster scan order. Some pointers\n// (*last_y, *width etc.) can be NULL if corresponding information is not\n// needed.\nWEBP_EXTERN(uint8_t*) WebPIDecGetRGB(\n    const WebPIDecoder* idec, int* last_y,\n    int* width, int* height, int* stride);\n\n// Same as above function to get a YUVA image. Returns pointer to the luma\n// plane or NULL in case of error. If there is no alpha information\n// the alpha pointer '*a' will be returned NULL.\nWEBP_EXTERN(uint8_t*) WebPIDecGetYUVA(\n    const WebPIDecoder* idec, int* last_y,\n    uint8_t** u, uint8_t** v, uint8_t** a,\n    int* width, int* height, int* stride, int* uv_stride, int* a_stride);\n\n// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the\n// alpha information (if present). Kept for backward compatibility.\nstatic WEBP_INLINE uint8_t* WebPIDecGetYUV(\n    const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v,\n    int* width, int* height, int* stride, int* uv_stride) {\n  return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height,\n                         stride, uv_stride, NULL);\n}\n\n// Generic call to retrieve information about the displayable area.\n// If non NULL, the left/right/width/height pointers are filled with the visible\n// rectangular area so far.\n// Returns NULL in case the incremental decoder object is in an invalid state.\n// Otherwise returns the pointer to the internal representation. This structure\n// is read-only, tied to WebPIDecoder's lifespan and should not be modified.\nWEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea(\n    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);\n\n//------------------------------------------------------------------------------\n// Advanced decoding parametrization\n//\n//  Code sample for using the advanced decoding API\n/*\n     // A) Init a configuration object\n     WebPDecoderConfig config;\n     CHECK(WebPInitDecoderConfig(&config));\n\n     // B) optional: retrieve the bitstream's features.\n     CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK);\n\n     // C) Adjust 'config', if needed\n     config.no_fancy = 1;\n     config.output.colorspace = MODE_BGRA;\n     // etc.\n\n     // Note that you can also make config.output point to an externally\n     // supplied memory buffer, provided it's big enough to store the decoded\n     // picture. Otherwise, config.output will just be used to allocate memory\n     // and store the decoded picture.\n\n     // D) Decode!\n     CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK);\n\n     // E) Decoded image is now in config.output (and config.output.u.RGBA)\n\n     // F) Reclaim memory allocated in config's object. It's safe to call\n     // this function even if the memory is external and wasn't allocated\n     // by WebPDecode().\n     WebPFreeDecBuffer(&config.output);\n*/\n\n// Features gathered from the bitstream\ntypedef struct {\n  int width;        // Width in pixels, as read from the bitstream.\n  int height;       // Height in pixels, as read from the bitstream.\n  int has_alpha;    // True if the bitstream contains an alpha channel.\n\n  // Unused for now:\n  int bitstream_version;        // should be 0 for now. TODO(later)\n  int no_incremental_decoding;  // if true, using incremental decoding is not\n                                // recommended.\n  int rotate;                   // TODO(later)\n  int uv_sampling;              // should be 0 for now. TODO(later)\n  uint32_t pad[3];              // padding for later use\n} WebPBitstreamFeatures;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal(\n    const uint8_t*, size_t, WebPBitstreamFeatures*, int);\n\n// Retrieve features from the bitstream. The *features structure is filled\n// with information gathered from the bitstream.\n// Returns false in case of error or version mismatch.\n// In case of error, features->bitstream_status will reflect the error code.\nstatic WEBP_INLINE VP8StatusCode WebPGetFeatures(\n    const uint8_t* data, size_t data_size,\n    WebPBitstreamFeatures* features) {\n  return WebPGetFeaturesInternal(data, data_size, features,\n                                 WEBP_DECODER_ABI_VERSION);\n}\n\n// Decoding options\ntypedef struct {\n  int bypass_filtering;               // if true, skip the in-loop filtering\n  int no_fancy_upsampling;            // if true, use faster pointwise upsampler\n  int use_cropping;                   // if true, cropping is applied _first_\n  int crop_left, crop_top;            // top-left position for cropping.\n                                      // Will be snapped to even values.\n  int crop_width, crop_height;        // dimension of the cropping area\n  int use_scaling;                    // if true, scaling is applied _afterward_\n  int scaled_width, scaled_height;    // final resolution\n  int use_threads;                    // if true, use multi-threaded decoding\n\n  // Unused for now:\n  int force_rotation;                 // forced rotation (to be applied _last_)\n  int no_enhancement;                 // if true, discard enhancement layer\n  uint32_t pad[6];                    // padding for later use\n} WebPDecoderOptions;\n\n// Main object storing the configuration for advanced decoding.\ntypedef struct {\n  WebPBitstreamFeatures input;  // Immutable bitstream features (optional)\n  WebPDecBuffer output;         // Output buffer (can point to external mem)\n  WebPDecoderOptions options;   // Decoding options\n} WebPDecoderConfig;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);\n\n// Initialize the configuration as empty. This function must always be\n// called first, unless WebPGetFeatures() is to be called.\n// Returns false in case of mismatched version.\nstatic WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {\n  return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);\n}\n\n// Instantiate a new incremental decoder object with the requested\n// configuration. The bitstream can be passed using 'data' and 'data_size'\n// parameter, in which case the features will be parsed and stored into\n// config->input. Otherwise, 'data' can be NULL and no parsing will occur.\n// Note that 'config' can be NULL too, in which case a default configuration\n// is used.\n// The return WebPIDecoder object must always be deleted calling WebPIDelete().\n// Returns NULL in case of error (and config->status will then reflect\n// the error condition).\nWEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size,\n                                       WebPDecoderConfig* config);\n\n// Non-incremental version. This version decodes the full data at once, taking\n// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK\n// if the decoding was successful).\nWEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size,\n                                      WebPDecoderConfig* config);\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DECODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/win32/encode.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//   WebP encoder: main interface\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_ENCODE_H_\n#define WEBP_WEBP_ENCODE_H_\n\n#include \"./types.h\"\n\n#if defined(__cplusplus) || defined(c_plusplus)\nextern \"C\" {\n#endif\n\n#define WEBP_ENCODER_ABI_VERSION 0x0200    // MAJOR(8b) + MINOR(8b)\n\n// Return the encoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetEncoderVersion(void);\n\n//------------------------------------------------------------------------------\n// One-stop-shop call! No questions asked:\n\n// Returns the size of the compressed data (pointed to by *output), or 0 if\n// an error occurred. The compressed data must be released by the caller\n// using the call 'free(*output)'.\n// These functions compress using the lossy format, and the quality_factor\n// can go from 0 (smaller output, lower quality) to 100 (best quality,\n// larger output).\nWEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\n\n// These functions are the equivalent of the above, but compressing in a\n// lossless manner. Files are usually larger than lossy format, but will\n// not suffer any compression loss.\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\n\n//------------------------------------------------------------------------------\n// Coding parameters\n\n// Image characteristics hint for the underlying encoder.\ntypedef enum {\n  WEBP_HINT_DEFAULT = 0,  // default preset.\n  WEBP_HINT_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_HINT_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_HINT_GRAPH,        // Discrete tone image (graph, map-tile etc).\n  WEBP_HINT_LAST\n} WebPImageHint;\n\ntypedef struct {\n  int lossless;           // Lossless encoding (0=lossy(default), 1=lossless).\n  float quality;          // between 0 (smallest file) and 100 (biggest)\n  int method;             // quality/speed trade-off (0=fast, 6=slower-better)\n\n  WebPImageHint image_hint;  // Hint for image type (lossless only for now).\n\n  // Parameters related to lossy compression only:\n  int target_size;        // if non-zero, set the desired target size in bytes.\n                          // Takes precedence over the 'compression' parameter.\n  float target_PSNR;      // if non-zero, specifies the minimal distortion to\n                          // try to achieve. Takes precedence over target_size.\n  int segments;           // maximum number of segments to use, in [1..4]\n  int sns_strength;       // Spatial Noise Shaping. 0=off, 100=maximum.\n  int filter_strength;    // range: [0 = off .. 100 = strongest]\n  int filter_sharpness;   // range: [0 = off .. 7 = least sharp]\n  int filter_type;        // filtering type: 0 = simple, 1 = strong (only used\n                          // if filter_strength > 0 or autofilter > 0)\n  int autofilter;         // Auto adjust filter's strength [0 = off, 1 = on]\n  int alpha_compression;  // Algorithm for encoding the alpha plane (0 = none,\n                          // 1 = compressed with WebP lossless). Default is 1.\n  int alpha_filtering;    // Predictive filtering method for alpha plane.\n                          //  0: none, 1: fast, 2: best. Default if 1.\n  int alpha_quality;      // Between 0 (smallest size) and 100 (lossless).\n                          // Default is 100.\n  int pass;               // number of entropy-analysis passes (in [1..10]).\n\n  int show_compressed;    // if true, export the compressed picture back.\n                          // In-loop filtering is not applied.\n  int preprocessing;      // preprocessing filter (0=none, 1=segment-smooth)\n  int partitions;         // log2(number of token partitions) in [0..3]. Default\n                          // is set to 0 for easier progressive decoding.\n  int partition_limit;    // quality degradation allowed to fit the 512k limit\n                          // on prediction modes coding (0: no degradation,\n                          // 100: maximum possible degradation).\n\n  uint32_t pad[8];        // padding for later use\n} WebPConfig;\n\n// Enumerate some predefined settings for WebPConfig, depending on the type\n// of source picture. These presets are used when calling WebPConfigPreset().\ntypedef enum {\n  WEBP_PRESET_DEFAULT = 0,  // default preset.\n  WEBP_PRESET_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_PRESET_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_PRESET_DRAWING,      // hand or line drawing, with high-contrast details\n  WEBP_PRESET_ICON,         // small-sized colorful images\n  WEBP_PRESET_TEXT          // text-like\n} WebPPreset;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int);\n\n// Should always be called, to initialize a fresh WebPConfig structure before\n// modification. Returns false in case of version mismatch. WebPConfigInit()\n// must have succeeded before using the 'config' object.\n// Note that the default values are lossless=0 and quality=75.\nstatic WEBP_INLINE int WebPConfigInit(WebPConfig* config) {\n  return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// This function will initialize the configuration according to a predefined\n// set of parameters (referred to by 'preset') and a given quality factor.\n// This function can be called as a replacement to WebPConfigInit(). Will\n// return false in case of error.\nstatic WEBP_INLINE int WebPConfigPreset(WebPConfig* config,\n                                        WebPPreset preset, float quality) {\n  return WebPConfigInitInternal(config, preset, quality,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// Returns true if 'config' is non-NULL and all configuration parameters are\n// within their valid ranges.\nWEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config);\n\n//------------------------------------------------------------------------------\n// Input / Output\n\ntypedef struct WebPPicture WebPPicture;   // main structure for I/O\n\n// Structure for storing auxiliary statistics (mostly for lossy encoding).\ntypedef struct {\n  int coded_size;         // final size\n\n  float PSNR[5];          // peak-signal-to-noise ratio for Y/U/V/All/Alpha\n  int block_count[3];     // number of intra4/intra16/skipped macroblocks\n  int header_bytes[2];    // approximate number of bytes spent for header\n                          // and mode-partition #0\n  int residual_bytes[3][4];  // approximate number of bytes spent for\n                             // DC/AC/uv coefficients for each (0..3) segments.\n  int segment_size[4];    // number of macroblocks in each segments\n  int segment_quant[4];   // quantizer values for each segments\n  int segment_level[4];   // filtering strength for each segments [0..63]\n\n  int alpha_data_size;    // size of the transparency data\n  int layer_data_size;    // size of the enhancement layer data\n\n  // lossless encoder statistics\n  uint32_t lossless_features;  // bit0:predictor bit1:cross-color transform\n                               // bit2:subtract-green bit3:color indexing\n  int histogram_bits;          // number of precision bits of histogram\n  int transform_bits;          // precision bits for transform\n  int cache_bits;              // number of bits for color cache lookup\n  int palette_size;            // number of color in palette, if used\n  int lossless_size;           // final lossless size\n\n  uint32_t pad[4];        // padding for later use\n} WebPAuxStats;\n\n// Signature for output function. Should return true if writing was successful.\n// data/data_size is the segment of data to write, and 'picture' is for\n// reference (and so one can make use of picture->custom_ptr).\ntypedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size,\n                                  const WebPPicture* picture);\n\n// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using\n// the following WebPMemoryWriter object (to be set as a custom_ptr).\ntypedef struct {\n  uint8_t* mem;       // final buffer (of size 'max_size', larger than 'size').\n  size_t   size;      // final size\n  size_t   max_size;  // total capacity\n  uint32_t pad[1];    // padding for later use\n} WebPMemoryWriter;\n\n// The following must be called first before any use.\nWEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer);\n\n// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon\n// completion, writer.mem and writer.size will hold the coded data.\nWEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size,\n                                 const WebPPicture* picture);\n\n// Progress hook, called from time to time to report progress. It can return\n// false to request an abort of the encoding process, or true otherwise if\n// everything is OK.\ntypedef int (*WebPProgressHook)(int percent, const WebPPicture* picture);\n\ntypedef enum {\n  // chroma sampling\n  WEBP_YUV420 = 0,   // 4:2:0\n  WEBP_YUV422 = 1,   // 4:2:2\n  WEBP_YUV444 = 2,   // 4:4:4\n  WEBP_YUV400 = 3,   // grayscale\n  WEBP_CSP_UV_MASK = 3,   // bit-mask to get the UV sampling factors\n  // alpha channel variants\n  WEBP_YUV420A = 4,\n  WEBP_YUV422A = 5,\n  WEBP_YUV444A = 6,\n  WEBP_YUV400A = 7,   // grayscale + alpha\n  WEBP_CSP_ALPHA_BIT = 4   // bit that is set if alpha is present\n} WebPEncCSP;\n\n// Encoding error conditions.\ntypedef enum {\n  VP8_ENC_OK = 0,\n  VP8_ENC_ERROR_OUT_OF_MEMORY,            // memory error allocating objects\n  VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY,  // memory error while flushing bits\n  VP8_ENC_ERROR_NULL_PARAMETER,           // a pointer parameter is NULL\n  VP8_ENC_ERROR_INVALID_CONFIGURATION,    // configuration is invalid\n  VP8_ENC_ERROR_BAD_DIMENSION,            // picture has invalid width/height\n  VP8_ENC_ERROR_PARTITION0_OVERFLOW,      // partition is bigger than 512k\n  VP8_ENC_ERROR_PARTITION_OVERFLOW,       // partition is bigger than 16M\n  VP8_ENC_ERROR_BAD_WRITE,                // error while flushing bytes\n  VP8_ENC_ERROR_FILE_TOO_BIG,             // file is bigger than 4G\n  VP8_ENC_ERROR_USER_ABORT,               // abort request by user\n  VP8_ENC_ERROR_LAST                      // list terminator. always last.\n} WebPEncodingError;\n\n// maximum width/height allowed (inclusive), in pixels\n#define WEBP_MAX_DIMENSION 16383\n\n// Main exchange structure (input samples, output bytes, statistics)\nstruct WebPPicture {\n\n  //   INPUT\n  //////////////\n  // Main flag for encoder selecting between ARGB or YUV input.\n  // It is recommended to use ARGB input (*argb, argb_stride) for lossless\n  // compression, and YUV input (*y, *u, *v, etc.) for lossy compression\n  // since these are the respective native colorspace for these formats.\n  int use_argb;\n\n  // YUV input (mostly used for input to lossy compression)\n  WebPEncCSP colorspace;     // colorspace: should be YUV420 for now (=Y'CbCr).\n  int width, height;         // dimensions (less or equal to WEBP_MAX_DIMENSION)\n  uint8_t *y, *u, *v;        // pointers to luma/chroma planes.\n  int y_stride, uv_stride;   // luma/chroma strides.\n  uint8_t* a;                // pointer to the alpha plane\n  int a_stride;              // stride of the alpha plane\n  uint32_t pad1[2];          // padding for later use\n\n  // ARGB input (mostly used for input to lossless compression)\n  uint32_t* argb;            // Pointer to argb (32 bit) plane.\n  int argb_stride;           // This is stride in pixels units, not bytes.\n  uint32_t pad2[3];          // padding for later use\n\n  //   OUTPUT\n  ///////////////\n  // Byte-emission hook, to store compressed bytes as they are ready.\n  WebPWriterFunction writer;  // can be NULL\n  void* custom_ptr;           // can be used by the writer.\n\n  // map for extra information (only for lossy compression mode)\n  int extra_info_type;    // 1: intra type, 2: segment, 3: quant\n                          // 4: intra-16 prediction mode,\n                          // 5: chroma prediction mode,\n                          // 6: bit cost, 7: distortion\n  uint8_t* extra_info;    // if not NULL, points to an array of size\n                          // ((width + 15) / 16) * ((height + 15) / 16) that\n                          // will be filled with a macroblock map, depending\n                          // on extra_info_type.\n\n  //   STATS AND REPORTS\n  ///////////////////////////\n  // Pointer to side statistics (updated only if not NULL)\n  WebPAuxStats* stats;\n\n  // Error code for the latest error encountered during encoding\n  WebPEncodingError error_code;\n\n  // If not NULL, report progress during encoding.\n  WebPProgressHook progress_hook;\n\n  void* user_data;        // this field is free to be set to any value and\n                          // used during callbacks (like progress-report e.g.).\n\n  uint32_t pad3[3];       // padding for later use\n\n  // Unused for now: original samples (for non-YUV420 modes)\n  uint8_t *u0, *v0;\n  int uv0_stride;\n\n  uint32_t pad4[7];       // padding for later use\n\n  // PRIVATE FIELDS\n  ////////////////////\n  void* memory_;          // row chunk of memory for yuva planes\n  void* memory_argb_;     // and for argb too.\n  void* pad5[2];          // padding for later use\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int);\n\n// Should always be called, to initialize the structure. Returns false in case\n// of version mismatch. WebPPictureInit() must have succeeded before using the\n// 'picture' object.\n// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.\nstatic WEBP_INLINE int WebPPictureInit(WebPPicture* picture) {\n  return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION);\n}\n\n//------------------------------------------------------------------------------\n// WebPPicture utils\n\n// Convenience allocation / deallocation based on picture->width/height:\n// Allocate y/u/v buffers as per colorspace/width/height specification.\n// Note! This function will free the previous buffer if needed.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture);\n\n// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*().\n// Note that this function does _not_ free the memory used by the 'picture'\n// object itself.\n// Besides memory (which is reclaimed) all other fields of 'picture' are\n// preserved.\nWEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture);\n\n// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return,\n// *dst will fully own the copied pixels (this is not a view).\n// Returns false in case of memory allocation error.\nWEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst);\n\n// Compute PSNR or SSIM distortion between two pictures.\n// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order.\n// Returns false in case of error (pic1 and pic2 don't have same dimension, ...)\n// Warning: this function is rather CPU-intensive.\nWEBP_EXTERN(int) WebPPictureDistortion(\n    const WebPPicture* pic1, const WebPPicture* pic2,\n    int metric_type,           // 0 = PSNR, 1 = SSIM\n    float result[5]);\n\n// self-crops a picture to the rectangle defined by top/left/width/height.\n// Returns false in case of memory allocation error, or if the rectangle is\n// outside of the source picture.\n// The rectangle for the view is defined by the top-left corner pixel\n// coordinates (left, top) as well as its width and height. This rectangle\n// must be fully be comprised inside the 'src' source picture. If the source\n// picture uses the YUV420 colorspace, the top and left coordinates will be\n// snapped to even values.\nWEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture,\n                                 int left, int top, int width, int height);\n\n// Extracts a view from 'src' picture into 'dst'. The rectangle for the view\n// is defined by the top-left corner pixel coordinates (left, top) as well\n// as its width and height. This rectangle must be fully be comprised inside\n// the 'src' source picture. If the source picture uses the YUV420 colorspace,\n// the top and left coordinates will be snapped to even values.\n// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed\n// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so,\n// the original dimension will be lost).\n// Returns false in case of memory allocation error or invalid parameters.\nWEBP_EXTERN(int) WebPPictureView(const WebPPicture* src,\n                                 int left, int top, int width, int height,\n                                 WebPPicture* dst);\n\n// Returns true if the 'picture' is actually a view and therefore does\n// not own the memory for pixels.\nWEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture);\n\n// Rescale a picture to new dimension width x height.\n// Now gamma correction is applied.\n// Returns false in case of error (invalid parameter or insufficient memory).\nWEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height);\n\n// Colorspace conversion function to import RGB samples.\n// Previous buffer will be free'd, if any.\n// *rgb buffer should have a size of at least height * rgb_stride.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureImportRGB(\n    WebPPicture* picture, const uint8_t* rgb, int rgb_stride);\n// Same, but for RGBA buffer.\nWEBP_EXTERN(int) WebPPictureImportRGBA(\n    WebPPicture* picture, const uint8_t* rgba, int rgba_stride);\n// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format\n// input buffer ignoring the alpha channel. Avoids needing to copy the data\n// to a temporary 24-bit RGB buffer to import the RGB only.\nWEBP_EXTERN(int) WebPPictureImportRGBX(\n    WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride);\n\n// Variants of the above, but taking BGR(A|X) input.\nWEBP_EXTERN(int) WebPPictureImportBGR(\n    WebPPicture* picture, const uint8_t* bgr, int bgr_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRA(\n    WebPPicture* picture, const uint8_t* bgra, int bgra_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRX(\n    WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride);\n\n// Converts picture->argb data to the YUVA format specified by 'colorspace'.\n// Upon return, picture->use_argb is set to false. The presence of real\n// non-opaque transparent values is detected, and 'colorspace' will be\n// adjusted accordingly. Note that this method is lossy.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture,\n                                       WebPEncCSP colorspace);\n\n// Converts picture->yuv to picture->argb and sets picture->use_argb to true.\n// The input format must be YUV_420 or YUV_420A.\n// Note that the use of this method is discouraged if one has access to the\n// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the\n// conversion from YUV420 to ARGB incurs a small loss too.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture);\n\n// Helper function: given a width x height plane of YUV(A) samples\n// (with stride 'stride'), clean-up the YUV samples under fully transparent\n// area, to help compressibility (no guarantee, though).\nWEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture);\n\n// Scan the picture 'picture' for the presence of non fully opaque alpha values.\n// Returns true in such case. Otherwise returns false (indicating that the\n// alpha plane can be ignored altogether e.g.).\nWEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n// Main call\n\n// Main encoding call, after config and picture have been initialized.\n// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION),\n// and the 'config' object must be a valid one.\n// Returns false in case of error, true otherwise.\n// In case of error, picture->error_code is updated accordingly.\n// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending\n// on the value of 'picture->use_argb'. It is highly recommended to use\n// the former for lossy encoding, and the latter for lossless encoding\n// (when config.lossless is true). Automatic conversion from one format to\n// another is provided but they both incur some loss.\nWEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n\n#if defined(__cplusplus) || defined(c_plusplus)\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_ENCODE_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/include/win32/types.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// This code is licensed under the same terms as WebM:\n//  Software License Agreement:  http://www.webmproject.org/license/software/\n//  Additional IP Rights Grant:  http://www.webmproject.org/license/additional/\n// -----------------------------------------------------------------------------\n//\n//  Common types\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_TYPES_H_\n#define WEBP_WEBP_TYPES_H_\n\n#include <stddef.h>  // for size_t\n\n#ifndef _MSC_VER\n#include <inttypes.h>\n#ifdef __STRICT_ANSI__\n#define WEBP_INLINE\n#else  /* __STRICT_ANSI__ */\n#define WEBP_INLINE inline\n#endif\n#else\ntypedef signed   char int8_t;\ntypedef unsigned char uint8_t;\ntypedef signed   short int16_t;\ntypedef unsigned short uint16_t;\ntypedef signed   int int32_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long int uint64_t;\ntypedef long long int int64_t;\n#define WEBP_INLINE __forceinline\n#endif  /* _MSC_VER */\n\n#ifndef WEBP_EXTERN\n// This explicitly marks library functions and allows for changing the\n// signature for e.g., Windows DLL builds.\n#define WEBP_EXTERN(type) extern type\n#endif  /* WEBP_EXTERN */\n\n// Macro to check ABI compatibility (same major revision number)\n#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))\n\n#endif  /* WEBP_WEBP_TYPES_H_ */\n"
  },
  {
    "path": "cocos2d/external/webp/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE := cocos_webp_static\nLOCAL_MODULE_FILENAME := webp\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebp.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cpufeatures\n\nifeq ($(TARGET_ARCH_ABI),armeabi-v7a)\n    LOCAL_CFLAGS := -DHAVE_NEON=1\nendif\n\ninclude $(PREBUILT_STATIC_LIBRARY)\n\n$(call import-module, android/cpufeatures)\n"
  },
  {
    "path": "cocos2d/external/websockets/include/android/libwebsockets.h",
    "content": "/*\n * libwebsockets - small server side websockets and web server implementation\n *\n * Copyright (C) 2010-2013 Andy Green <andy@warmcat.com>\n *\n *  This library is free software; you can redistribute it and/or\n *  modify it under the terms of the GNU Lesser General Public\n *  License as published by the Free Software Foundation:\n *  version 2.1 of the License.\n *\n *  This library is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n *  Lesser General Public License for more details.\n *\n *  You should have received a copy of the GNU Lesser General Public\n *  License along with this library; if not, write to the Free Software\n *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n *  MA  02110-1301  USA\n */\n\n#ifndef __LIBWEBSOCKET_H__\n#define __LIBWEBSOCKET_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#include <cstddef>\n#endif\n\n#ifdef WIN32\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#include <stddef.h>\n#include \"../win32port/win32helpers/websock-w32.h\"\n\n#include \"../win32port/win32helpers/gettimeofday.h\"\n\n#define strcasecmp stricmp\n#define getdtablesize() 30000\n\ntypedef int ssize_t;\n\n#define LWS_VISIBLE\n\n#ifdef LWS_DLL\n#ifdef LWS_INTERNAL\n#define LWS_EXTERN extern __declspec(dllexport)\n#else\n#define LWS_EXTERN extern __declspec(dllimport)\n#endif\n#else\n#define LWS_EXTERN\n#endif\n\n#else // NOT WIN32\n#include <poll.h>\n#include <unistd.h>\n\n#if defined(__GNUC__)\n#define LWS_VISIBLE __attribute__((visibility(\"default\")))\n#else\n#define LWS_VISIBLE\n#endif\n\n#endif\n\n#include <assert.h>\n\n#ifndef LWS_EXTERN\n#define LWS_EXTERN extern\n#endif\n\n#define CONTEXT_PORT_NO_LISTEN 0\n#define MAX_MUX_RECURSION 2\n\nenum lws_log_levels {\n\tLLL_ERR = 1 << 0,\n\tLLL_WARN = 1 << 1,\n\tLLL_NOTICE = 1 << 2,\n\tLLL_INFO = 1 << 3,\n\tLLL_DEBUG = 1 << 4,\n\tLLL_PARSER = 1 << 5,\n\tLLL_HEADER = 1 << 6,\n\tLLL_EXT = 1 << 7,\n\tLLL_CLIENT = 1 << 8,\n\tLLL_LATENCY = 1 << 9,\n\n\tLLL_COUNT = 10 /* set to count of valid flags */\n};\n\nLWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...);\n\n/* notice, warn and log are always compiled in */\n#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__)\n#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__)\n#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__)\n/*\n *  weaker logging can be deselected at configure time using --disable-debug\n *  that gets rid of the overhead of checking while keeping _warn and _err\n *  active\n */\n#ifdef _DEBUG\n\n#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__)\n#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__)\n#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__)\n#define lwsl_header(...)  _lws_log(LLL_HEADER, __VA_ARGS__)\n#define lwsl_ext(...)  _lws_log(LLL_EXT, __VA_ARGS__)\n#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__)\n#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__)\nLWS_VISIBLE LWS_EXTERN void lwsl_hexdump(void *buf, size_t len);\n\n#else /* no debug */\n\n#define lwsl_info(...)\n#define lwsl_debug(...)\n#define lwsl_parser(...)\n#define lwsl_header(...)\n#define lwsl_ext(...)\n#define lwsl_client(...)\n#define lwsl_latency(...)\n#define lwsl_hexdump(a, b)\n\n#endif\n\nenum libwebsocket_context_options {\n\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2,\n\tLWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4,\n};\n\nenum libwebsocket_callback_reasons {\n\tLWS_CALLBACK_ESTABLISHED,\n\tLWS_CALLBACK_CLIENT_CONNECTION_ERROR,\n\tLWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH,\n\tLWS_CALLBACK_CLIENT_ESTABLISHED,\n\tLWS_CALLBACK_CLOSED,\n\tLWS_CALLBACK_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE_PONG,\n\tLWS_CALLBACK_CLIENT_WRITEABLE,\n\tLWS_CALLBACK_SERVER_WRITEABLE,\n\tLWS_CALLBACK_HTTP,\n\tLWS_CALLBACK_HTTP_FILE_COMPLETION,\n\tLWS_CALLBACK_HTTP_WRITEABLE,\n\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION,\n\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION,\n\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER,\n\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY,\n\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED,\n\tLWS_CALLBACK_PROTOCOL_INIT,\n\tLWS_CALLBACK_PROTOCOL_DESTROY,\n\t/* external poll() management support */\n\tLWS_CALLBACK_ADD_POLL_FD,\n\tLWS_CALLBACK_DEL_POLL_FD,\n\tLWS_CALLBACK_SET_MODE_POLL_FD,\n\tLWS_CALLBACK_CLEAR_MODE_POLL_FD,\n};\n\n#ifndef LWS_NO_EXTENSIONS\nenum libwebsocket_extension_callback_reasons {\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_REALLY_CLOSE,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_PROPOSE_EXTENSION,\n\tLWS_EXT_CALLBACK_DESTROY,\n\tLWS_EXT_CALLBACK_DESTROY_ANY_WSI_CLOSING,\n\tLWS_EXT_CALLBACK_ANY_WSI_ESTABLISHED,\n\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE,\n\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND,\n\tLWS_EXT_CALLBACK_PACKET_TX_DO_SEND,\n\tLWS_EXT_CALLBACK_HANDSHAKE_REPLY_TX,\n\tLWS_EXT_CALLBACK_FLUSH_PENDING_TX,\n\tLWS_EXT_CALLBACK_EXTENDED_PAYLOAD_RX,\n\tLWS_EXT_CALLBACK_CAN_PROXY_CLIENT_CONNECTION,\n\tLWS_EXT_CALLBACK_1HZ,\n\tLWS_EXT_CALLBACK_REQUEST_ON_WRITEABLE,\n\tLWS_EXT_CALLBACK_IS_WRITEABLE,\n\tLWS_EXT_CALLBACK_PAYLOAD_TX,\n\tLWS_EXT_CALLBACK_PAYLOAD_RX,\n};\n#endif\n\nenum libwebsocket_write_protocol {\n\tLWS_WRITE_TEXT,\n\tLWS_WRITE_BINARY,\n\tLWS_WRITE_CONTINUATION,\n\tLWS_WRITE_HTTP,\n\n\t/* special 04+ opcodes */\n\n\tLWS_WRITE_CLOSE,\n\tLWS_WRITE_PING,\n\tLWS_WRITE_PONG,\n\n\t/* flags */\n\n\tLWS_WRITE_NO_FIN = 0x40,\n\t/*\n\t * client packet payload goes out on wire unmunged\n\t * only useful for security tests since normal servers cannot\n\t * decode the content if used\n\t */\n\tLWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80\n};\n\n/*\n * you need these to look at headers that have been parsed if using the\n * LWS_CALLBACK_FILTER_CONNECTION callback.  If a header from the enum\n * list below is absent, .token = NULL and token_len = 0.  Otherwise .token\n * points to .token_len chars containing that header content.\n */\n\nstruct lws_tokens {\n\tchar *token;\n\tint token_len;\n};\n\nenum lws_token_indexes {\n\tWSI_TOKEN_GET_URI,\n\tWSI_TOKEN_HOST,\n\tWSI_TOKEN_CONNECTION,\n\tWSI_TOKEN_KEY1,\n\tWSI_TOKEN_KEY2,\n\tWSI_TOKEN_PROTOCOL,\n\tWSI_TOKEN_UPGRADE,\n\tWSI_TOKEN_ORIGIN,\n\tWSI_TOKEN_DRAFT,\n\tWSI_TOKEN_CHALLENGE,\n\n\t/* new for 04 */\n\tWSI_TOKEN_KEY,\n\tWSI_TOKEN_VERSION,\n\tWSI_TOKEN_SWORIGIN,\n\n\t/* new for 05 */\n\tWSI_TOKEN_EXTENSIONS,\n\n\t/* client receives these */\n\tWSI_TOKEN_ACCEPT,\n\tWSI_TOKEN_NONCE,\n\tWSI_TOKEN_HTTP,\n\tWSI_TOKEN_MUXURL,\n\n\t/* use token storage to stash these */\n\n\t_WSI_TOKEN_CLIENT_SENT_PROTOCOLS,\n\t_WSI_TOKEN_CLIENT_PEER_ADDRESS,\n\t_WSI_TOKEN_CLIENT_URI,\n\t_WSI_TOKEN_CLIENT_HOST,\n\t_WSI_TOKEN_CLIENT_ORIGIN,\n\n\t/* always last real token index*/\n\tWSI_TOKEN_COUNT,\n\t/* parser state additions */\n\tWSI_TOKEN_NAME_PART,\n\tWSI_TOKEN_SKIPPING,\n\tWSI_TOKEN_SKIPPING_SAW_CR,\n\tWSI_PARSING_COMPLETE,\n\tWSI_INIT_TOKEN_MUXURL,\n};\n\n/*\n * From RFC 6455\n   1000\n\n      1000 indicates a normal closure, meaning that the purpose for\n      which the connection was established has been fulfilled.\n\n   1001\n\n      1001 indicates that an endpoint is \"going away\", such as a server\n      going down or a browser having navigated away from a page.\n\n   1002\n\n      1002 indicates that an endpoint is terminating the connection due\n      to a protocol error.\n\n   1003\n\n      1003 indicates that an endpoint is terminating the connection\n      because it has received a type of data it cannot accept (e.g., an\n      endpoint that understands only text data MAY send this if it\n      receives a binary message).\n\n   1004\n\n      Reserved.  The specific meaning might be defined in the future.\n\n   1005\n\n      1005 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that no status\n      code was actually present.\n\n   1006\n\n      1006 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed abnormally, e.g., without sending or\n      receiving a Close control frame.\n\n   1007\n\n      1007 indicates that an endpoint is terminating the connection\n      because it has received data within a message that was not\n      consistent with the type of the message (e.g., non-UTF-8 [RFC3629]\n      data within a text message).\n\n   1008\n\n      1008 indicates that an endpoint is terminating the connection\n      because it has received a message that violates its policy.  This\n      is a generic status code that can be returned when there is no\n      other more suitable status code (e.g., 1003 or 1009) or if there\n      is a need to hide specific details about the policy.\n\n   1009\n\n      1009 indicates that an endpoint is terminating the connection\n      because it has received a message that is too big for it to\n      process.\n\n   1010\n\n      1010 indicates that an endpoint (client) is terminating the\n      connection because it has expected the server to negotiate one or\n      more extension, but the server didn't return them in the response\n      message of the WebSocket handshake.  The list of extensions that\n      are needed SHOULD appear in the /reason/ part of the Close frame.\n      Note that this status code is not used by the server, because it\n      can fail the WebSocket handshake instead.\n\n   1011\n\n      1011 indicates that a server is terminating the connection because\n      it encountered an unexpected condition that prevented it from\n      fulfilling the request.\n\n   1015\n\n      1015 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed due to a failure to perform a TLS handshake\n      (e.g., the server certificate can't be verified).\n*/\n\nenum lws_close_status {\n\tLWS_CLOSE_STATUS_NOSTATUS = 0,\n\tLWS_CLOSE_STATUS_NORMAL = 1000,\n\tLWS_CLOSE_STATUS_GOINGAWAY = 1001,\n\tLWS_CLOSE_STATUS_PROTOCOL_ERR = 1002,\n\tLWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003,\n\tLWS_CLOSE_STATUS_RESERVED = 1004,\n\tLWS_CLOSE_STATUS_NO_STATUS = 1005,\n\tLWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006,\n\tLWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007,\n\tLWS_CLOSE_STATUS_POLICY_VIOLATION = 1008,\n\tLWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009,\n\tLWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010,\n\tLWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011,\n\tLWS_CLOSE_STATUS_TLS_FAILURE = 1015,\n};\n\nstruct libwebsocket;\nstruct libwebsocket_context;\n/* needed even with extensions disabled for create context */\nstruct libwebsocket_extension;\n\n/**\n * callback_function() - User server actions\n * @context:\tWebsockets context\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tThis callback is the way the user controls what is served.  All the\n *\tprotocol detail is hidden and handled by the library.\n *\n *\tFor each connection / session there is user data allocated that is\n *\tpointed to by \"user\".  You set the size of this user data area when\n *\tthe library is initialized with libwebsocket_create_server.\n *\n *\tYou get an opportunity to initialize user data when called back with\n *\tLWS_CALLBACK_ESTABLISHED reason.\n *\n *  LWS_CALLBACK_ESTABLISHED:  after the server completes a handshake with\n *\t\t\t\tan incoming client\n *\n *  LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has\n *        been unable to complete a handshake with the remote server\n *\n *  LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: this is the last chance for the\n *\t\t\t\tclient user code to examine the http headers\n *\t\t\t\tand decide to reject the connection.  If the\n *\t\t\t\tcontent in the headers is interesting to the\n *\t\t\t\tclient (url, etc) it needs to copy it out at\n *\t\t\t\tthis point since it will be destroyed before\n *\t\t\t\tthe CLIENT_ESTABLISHED call\n *\n *  LWS_CALLBACK_CLIENT_ESTABLISHED: after your client connection completed\n *\t\t\t\ta handshake with the remote server\n *\n *\tLWS_CALLBACK_CLOSED: when the websocket session ends\n *\n *\tLWS_CALLBACK_RECEIVE: data has appeared for this server endpoint from a\n *\t\t\t\tremote client, it can be found at *in and is\n *\t\t\t\tlen bytes long\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE_PONG: if you elected to see PONG packets,\n *\t\t\t\tthey appear with this callback reason.  PONG\n *\t\t\t\tpackets only exist in 04+ protocol\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE: data has appeared from the server for the\n *\t\t\t\tclient connection, it can be found at *in and\n *\t\t\t\tis len bytes long\n *\n *\tLWS_CALLBACK_HTTP: an http request has come from a client that is not\n *\t\t\t\tasking to upgrade the connection to a websocket\n *\t\t\t\tone.  This is a chance to serve http content,\n *\t\t\t\tfor example, to send a script to the client\n *\t\t\t\twhich will then open the websockets connection.\n *\t\t\t\t@in points to the URI path requested and\n *\t\t\t\tlibwebsockets_serve_http_file() makes it very\n *\t\t\t\tsimple to send back a file to the client.\n *\t\t\t\tNormally after sending the file you are done\n *\t\t\t\twith the http connection, since the rest of the\n *\t\t\t\tactivity will come by websockets from the script\n *\t\t\t\tthat was delivered by http, so you will want to\n *\t\t\t\treturn 1; to close and free up the connection.\n *\t\t\t\tThat's important because it uses a slot in the\n *\t\t\t\ttotal number of client connections allowed set\n *\t\t\t\tby MAX_CLIENTS.\n *\n *\tLWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol\n *\t\tlink now.\n *\n *\tLWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down\n *\t\t\t\thttp link has completed.\n *\n *\tLWS_CALLBACK_CLIENT_WRITEABLE:\n *      LWS_CALLBACK_SERVER_WRITEABLE:   If you call\n *\t\tlibwebsocket_callback_on_writable() on a connection, you will\n *\t\tget one of these callbacks coming when the connection socket\n *\t\tis able to accept another write packet without blocking.\n *\t\tIf it already was able to take another packet without blocking,\n *\t\tyou'll get this callback at the next call to the service loop\n *\t\tfunction.  Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE\n *\t\tand servers get LWS_CALLBACK_SERVER_WRITEABLE.\n *\n *\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION: called when a client connects to\n *\t\tthe server at network level; the connection is accepted but then\n *\t\tpassed to this callback to decide whether to hang up immediately\n *\t\tor not, based on the client IP.  @in contains the connection\n *\t\tsocket's descriptor.  Return non-zero to terminate\n *\t\tthe connection before sending or receiving anything.\n *\t\tBecause this happens immediately after the network connection\n *\t\tfrom the client, there's no websocket protocol selected yet so\n *\t\tthis callback is issued only to protocol 0.\n *\n *\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: called when the handshake has\n *\t\tbeen received and parsed from the client, but the response is\n *\t\tnot sent yet.  Return non-zero to disallow the connection.\n *\t\t@user is a pointer to an array of struct lws_tokens, you can\n *\t\tuse the header enums lws_token_indexes from libwebsockets.h\n *\t\tto check for and read the supported header presence and\n *\t\tcontent before deciding to allow the handshake to proceed or\n *\t\tto kill the connection.\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto perform extra SSL_CTX_load_verify_locations() or similar\n *\t\tcalls to direct OpenSSL where to find certificates the client\n *\t\tcan use to confirm the remote server identity.  @user is the\n *\t\tOpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto load extra certifcates into the server which allow it to\n *\t\tverify the validity of certificates returned by clients.  @user\n *\t\tis the server's OpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: if the\n *\t\tlibwebsockets context was created with the option\n *\t\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this\n *\t\tcallback is generated during OpenSSL verification of the cert\n *\t\tsent from the client.  It is sent to protocol[0] callback as\n *\t\tno protocol has been negotiated on the connection yet.\n *\t\tNotice that the libwebsockets context and wsi are both NULL\n *\t\tduring this callback.  See\n *\t\t http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html\n *\t\tto understand more detail about the OpenSSL callback that\n *\t\tgenerates this libwebsockets callback and the meanings of the\n *\t\targuments passed.  In this callback, @user is the x509_ctx,\n *\t\t@in is the ssl pointer and @len is preverify_ok\n *\t\tNotice that this callback maintains libwebsocket return\n *\t\tconventions, return 0 to mean the cert is OK or 1 to fail it.\n *\t\tThis also means that if you don't handle this callback then\n *\t\tthe default callback action of returning 0 allows the client\n *\t\tcertificates.\n *\n *\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: this callback happens\n *\t\twhen a client handshake is being compiled.  @user is NULL,\n *\t\t@in is a char **, it's pointing to a char * which holds the\n *\t\tnext location in the header buffer where you can add\n *\t\theaders, and @len is the remaining space in the header buffer,\n *\t\twhich is typically some hundreds of bytes.  So, to add a canned\n *\t\tcookie, your handler code might look similar to:\n *\n *\t\tchar **p = (char **)in;\n *\n *\t\tif (len < 100)\n *\t\t\treturn 1;\n *\n *\t\t*p += sprintf(*p, \"Cookie: a=b\\x0d\\x0a\");\n *\n *\t\treturn 0;\n *\n *\t\tNotice if you add anything, you just have to take care about\n *\t\tthe CRLF on the line you added.  Obviously this callback is\n *\t\toptional, if you don't handle it everything is fine.\n *\n *\t\tNotice the callback is coming to protocols[0] all the time,\n *\t\tbecause there is no specific protocol handshook yet.\n *\n *\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY: When the server handshake code\n *\t\tsees that it does support a requested extension, before\n *\t\taccepting the extension by additing to the list sent back to\n *\t\tthe client it gives this callback just to check that it's okay\n *\t\tto use that extension.  It calls back to the requested protocol\n *\t\tand with @in being the extension name, @len is 0 and @user is\n *\t\tvalid.  Note though at this time the ESTABLISHED callback hasn't\n *\t\thappened yet so if you initialize @user content there, @user\n *\t\tcontent during this callback might not be useful for anything.\n *\t\tNotice this callback comes to protocols[0].\n *\n *\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED:\tWhen a client\n *\t\tconnection is being prepared to start a handshake to a server,\n *\t\teach supported extension is checked with protocols[0] callback\n *\t\twith this reason, giving the user code a chance to suppress the\n *\t\tclaim to support that extension by returning non-zero.  If\n *\t\tunhandled, by default 0 will be returned and the extension\n *\t\tsupport included in the header to the server.  Notice this\n *\t\tcallback comes to protocols[0].\n *\n *\tLWS_CALLBACK_PROTOCOL_INIT:\tOne-time call per protocol so it can\n *\t\tdo initial setup / allocations etc\n *\n *\tLWS_CALLBACK_PROTOCOL_DESTROY:\tOne-time call per protocol indicating\n *\t\tthis protocol won't get used at all after this callback, the\n *\t\tcontext is getting destroyed.  Take the opportunity to\n *\t\tdeallocate everything that was allocated by the protocol.\n *\n *\tThe next four reasons are optional and only need taking care of if you\n *\twill be integrating libwebsockets sockets into an external polling\n *\tarray.\n *\n *\tLWS_CALLBACK_ADD_POLL_FD: libwebsocket deals with its poll() loop\n *\t\tinternally, but in the case you are integrating with another\n *\t\tserver you will need to have libwebsocket sockets share a\n *\t\tpolling array with the other server.  This and the other\n *\t\tPOLL_FD related callbacks let you put your specialized\n *\t\tpoll array interface code in the callback for protocol 0, the\n *\t\tfirst protocol you support, usually the HTTP protocol in the\n *\t\tserving case.  This callback happens when a socket needs to be\n *\t\tadded to the polling loop: @in contains the fd, and\n *\t\t@len is the events bitmap (like, POLLIN).  If you are using the\n *\t\tinternal polling loop (the \"service\" callback), you can just\n *\t\tignore these callbacks.\n *\n *\tLWS_CALLBACK_DEL_POLL_FD: This callback happens when a socket descriptor\n *\t\tneeds to be removed from an external polling array.  @in is\n *\t\tthe socket desricptor.  If you are using the internal polling\n *\t\tloop, you can just ignore it.\n *\n *\tLWS_CALLBACK_SET_MODE_POLL_FD: This callback happens when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should OR @len on to the events member of the pollfd\n *\t\tstruct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n *\n *\tLWS_CALLBACK_CLEAR_MODE_POLL_FD: This callback occurs when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should AND ~@len on to the events member of the\n *\t\tpollfd struct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n */\nLWS_VISIBLE LWS_EXTERN int callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\ntypedef int (callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * extension_callback_function() - Hooks to allow extensions to operate\n * @context:\tWebsockets context\n * @ext:\tThis extension\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tEach extension that is active on a particular connection receives\n *\tcallbacks during the connection lifetime to allow the extension to\n *\toperate on websocket data and manage itself.\n *\n *\tLibwebsockets takes care of allocating and freeing \"user\" memory for\n *\teach active extension on each connection.  That is what is pointed to\n *\tby the @user parameter.\n *\n *\tLWS_EXT_CALLBACK_CONSTRUCT:  called when the server has decided to\n *\t\tselect this extension from the list provided by the client,\n *\t\tjust before the server will send back the handshake accepting\n *\t\tthe connection with this extension active.  This gives the\n *\t\textension a chance to initialize its connection context found\n *\t\tin @user.\n *\n *\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT: same as LWS_EXT_CALLBACK_CONSTRUCT\n *\t\tbut called when client is instantiating this extension.  Some\n *\t\textensions will work the same on client and server side and then\n *\t\tyou can just merge handlers for both CONSTRUCTS.\n *\n *\tLWS_EXT_CALLBACK_DESTROY:  called when the connection the extension was\n *\t\tbeing used on is about to be closed and deallocated.  It's the\n *\t\tlast chance for the extension to deallocate anything it has\n *\t\tallocated in the user data (pointed to by @user) before the\n *\t\tuser data is deleted.  This same callback is used whether you\n *\t\tare in client or server instantiation context.\n *\n *\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE: when this extension was active on\n *\t\ta connection, and a packet of data arrived at the connection,\n *\t\tit is passed to this callback to give the extension a chance to\n *\t\tchange the data, eg, decompress it.  @user is pointing to the\n *\t\textension's private connection context data, @in is pointing\n *\t\tto an lws_tokens struct, it consists of a char * pointer called\n *\t\ttoken, and an int called token_len.  At entry, these are\n *\t\tset to point to the received buffer and set to the content\n *\t\tlength.  If the extension will grow the content, it should use\n *\t\ta new buffer allocated in its private user context data and\n *\t\tset the pointed-to lws_tokens members to point to its buffer.\n *\n *\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND: this works the same way as\n *\t\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the\n *\t\textension a chance to change websocket data just before it will\n *\t\tbe sent out.  Using the same lws_token pointer scheme in @in,\n *\t\tthe extension can change the buffer and the length to be\n *\t\ttransmitted how it likes.  Again if it wants to grow the\n *\t\tbuffer safely, it should copy the data into its own buffer and\n *\t\tset the lws_tokens token pointer to it.\n */\nLWS_VISIBLE LWS_EXTERN int extension_callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n\ntypedef int (extension_callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n#endif\n\n/**\n * struct libwebsocket_protocols -\tList of protocols and handlers server\n *\t\t\t\t\tsupports.\n * @name:\tProtocol name that must match the one given in the client\n *\t\tJavascript new WebSocket(url, 'protocol') name\n * @callback:\tThe service callback used for this protocol.  It allows the\n *\t\tservice action for an entire protocol to be encapsulated in\n *\t\tthe protocol-specific callback\n * @per_session_data_size:\tEach new connection using this protocol gets\n *\t\tthis much memory allocated on connection establishment and\n *\t\tfreed on connection takedown.  A pointer to this per-connection\n *\t\tallocation is passed into the callback in the 'user' parameter\n * @rx_buffer_size: if you want atomic frames delivered to the callback, you\n *\t\tshould set this to the size of the biggest legal frame that\n *\t\tyou support.  If the frame size is exceeded, there is no\n *\t\terror, but the buffer will spill to the user callback when\n *\t\tfull, which you can detect by using\n *\t\tlibwebsockets_remaining_packet_payload().  Notice that you\n *\t\tjust talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING\n *\t\tand post-padding are automatically also allocated on top.\n * @owning_server:\tthe server init call fills in this opaque pointer when\n *\t\tregistering this protocol with the server.\n * @protocol_index: which protocol we are starting from zero\n *\n *\tThis structure represents one protocol supported by the server.  An\n *\tarray of these structures is passed to libwebsocket_create_server()\n *\tallows as many protocols as you like to be handled by one server.\n */\n\nstruct libwebsocket_protocols {\n\tconst char *name;\n\tcallback_function *callback;\n\tsize_t per_session_data_size;\n\tsize_t rx_buffer_size;\n\n\t/*\n\t * below are filled in on server init and can be left uninitialized,\n\t * no need for user to use them directly either\n\t */\n\n\tstruct libwebsocket_context *owning_server;\n\tint protocol_index;\n};\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * struct libwebsocket_extension -\tAn extension we know how to cope with\n *\n * @name:\t\t\tFormal extension name, eg, \"deflate-stream\"\n * @callback:\t\t\tService callback\n * @per_session_data_size:\tLibwebsockets will auto-malloc this much\n *\t\t\t\tmemory for the use of the extension, a pointer\n *\t\t\t\tto it comes in the @user callback parameter\n * @per_context_private_data:   Optional storage for this extension that\n *\t\t\t\tis per-context, so it can track stuff across\n *\t\t\t\tall sessions, etc, if it wants\n */\n\nstruct libwebsocket_extension {\n\tconst char *name;\n\textension_callback_function *callback;\n\tsize_t per_session_data_size;\n\tvoid *per_context_private_data;\n};\n#endif\n\n/**\n * struct lws_context_creation_info: parameters to create context with\n *\n * @port:\tPort to listen on... you can use 0 to suppress listening on\n *\t\tany port, that's what you want if you are not running a\n *\t\twebsocket server at all but just using it as a client\n * @iface:\tNULL to bind the listen socket to all interfaces, or the\n *\t\tinterface name, eg, \"eth2\"\n * @protocols:\tArray of structures listing supported protocols and a protocol-\n *\t\tspecific callback for each one.  The list is ended with an\n *\t\tentry that has a NULL callback pointer.\n *\t\tIt's not const because we write the owning_server member\n * @extensions: NULL or array of libwebsocket_extension structs listing the\n *\t\textensions this context supports.  If you configured with\n *\t\t--without-extensions, you should give NULL here.\n * @ssl_cert_filepath:\tIf libwebsockets was compiled to use ssl, and you want\n *\t\t\tto listen using SSL, set to the filepath to fetch the\n *\t\t\tserver cert from, otherwise NULL for unencrypted\n * @ssl_private_key_filepath: filepath to private key if wanting SSL mode,\n *\t\t\telse ignored\n * @ssl_ca_filepath: CA certificate filepath or NULL\n * @ssl_cipher_list:\tList of valid ciphers to use (eg,\n * \t\t\t\"RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL\"\n * \t\t\tor you can leave it as NULL to get \"DEFAULT\"\n * @gid:\tgroup id to change to after setting listen socket, or -1.\n * @uid:\tuser id to change to after setting listen socket, or -1.\n * @options:\t0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK\n * @user:\toptional user pointer that can be recovered via the context\n *\t\tpointer using libwebsocket_context_user\n * @ka_time:\t0 for no keepalive, otherwise apply this keepalive timeout to\n *\t\tall libwebsocket sockets, client or server\n * @ka_probes:\tif ka_time was nonzero, after the timeout expires how many\n *\t\ttimes to try to get a response from the peer before giving up\n *\t\tand killing the connection\n * @ka_interval: if ka_time was nonzero, how long to wait before each ka_probes\n *\t\tattempt\n */\n\nstruct lws_context_creation_info {\n\tint port;\n\tconst char *iface;\n\tstruct libwebsocket_protocols *protocols;\n\tstruct libwebsocket_extension *extensions;\n\tconst char *ssl_cert_filepath;\n\tconst char *ssl_private_key_filepath;\n\tconst char *ssl_ca_filepath;\n\tconst char *ssl_cipher_list;\n\tint gid;\n\tint uid;\n\tunsigned int options;\n\tvoid *user;\n\tint ka_time;\n\tint ka_probes;\n\tint ka_interval;\n\n};\n\nLWS_VISIBLE LWS_EXTERN\nvoid lws_set_log_level(int level,\n\t\t\tvoid (*log_emit_function)(int level, const char *line));\n\nLWS_VISIBLE LWS_EXTERN void\nlwsl_emit_syslog(int level, const char *line);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_context *\nlibwebsocket_create_context(struct lws_context_creation_info *info);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_context_destroy(struct libwebsocket_context *context);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service(struct libwebsocket_context *context, int timeout_ms);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service_fd(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t struct pollfd *pollfd);\n\nLWS_VISIBLE LWS_EXTERN void *\nlibwebsocket_context_user(struct libwebsocket_context *context);\n\n/*\n * IMPORTANT NOTICE!\n *\n * When sending with websocket protocol (LWS_WRITE_TEXT or LWS_WRITE_BINARY)\n * the send buffer has to have LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE\n * buf, and LWS_SEND_BUFFER_POST_PADDING bytes valid AFTER (buf + len).\n *\n * This allows us to add protocol info before and after the data, and send as\n * one packet on the network without payload copying, for maximum efficiency.\n *\n * So for example you need this kind of code to use libwebsocket_write with a\n * 128-byte payload\n *\n *   char buf[LWS_SEND_BUFFER_PRE_PADDING + 128 + LWS_SEND_BUFFER_POST_PADDING];\n *\n *   // fill your part of the buffer... for example here it's all zeros\n *   memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, 128);\n *\n *   libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], 128,\n *   \t\t\t\t\t\t\t\tLWS_WRITE_TEXT);\n *\n * When sending LWS_WRITE_HTTP, there is no protocol addition and you can just\n * use the whole buffer without taking care of the above.\n */\n\n/*\n * this is the frame nonce plus two header plus 8 length\n *   there's an additional two for mux extension per mux nesting level\n * 2 byte prepend on close will already fit because control frames cannot use\n * the big length style\n */\n\n#define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION))\n#define LWS_SEND_BUFFER_POST_PADDING 4\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len,\n\t\t\t\t     enum libwebsocket_write_protocol protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi, const char *file,\n\t\t\t\t\t\t     const char *content_type);\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file_fragment(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN const struct libwebsocket_protocols *\nlibwebsockets_get_protocol(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable(struct libwebsocket_context *context,\n\t\t\t\t\t\t      struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable_all_protocol(\n\t\t\t\t const struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_get_socket_fd(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_is_final_fragment(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char\nlibwebsocket_get_reserved_bits(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_rx_flow_allow_all_protocol(\n\t\t\t\tconst struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN size_t\nlibwebsockets_remaining_packet_payload(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect_extended(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one,\n\t\t\t      void *userdata);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlibwebsocket_canonical_hostname(struct libwebsocket_context *context);\n\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsockets_get_peer_addresses(struct libwebsocket_context *context,\n\t\tstruct libwebsocket *wsi, int fd, char *name, int name_len,\n\t\t\t\t\tchar *rip, int rip_len);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_get_random(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t    void *buf, int len);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_daemonize(const char *_lock_path);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_send_pipe_choked(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_frame_is_binary(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char *\nlibwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_encode_string(const char *in, int in_len, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_decode_string(const char *in, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlws_get_library_version(void);\n\n/* access to headers... only valid while headers valid */\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_copy(struct libwebsocket *wsi, char *dest, int len,\n\t\t\t\t\t\tenum lws_token_indexes h);\n\n/*\n * Note: this is not normally needed as a user api.  It's provided in case it is\n * useful when integrating with other app poll loop service code.\n */\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_read(struct libwebsocket_context *context,\n\t\t\t\tstruct libwebsocket *wsi,\n\t\t\t\t\t       unsigned char *buf, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions();\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/websockets/include/ios/libwebsockets.h",
    "content": "/*\n * libwebsockets - small server side websockets and web server implementation\n *\n * Copyright (C) 2010-2013 Andy Green <andy@warmcat.com>\n *\n *  This library is free software; you can redistribute it and/or\n *  modify it under the terms of the GNU Lesser General Public\n *  License as published by the Free Software Foundation:\n *  version 2.1 of the License.\n *\n *  This library is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n *  Lesser General Public License for more details.\n *\n *  You should have received a copy of the GNU Lesser General Public\n *  License along with this library; if not, write to the Free Software\n *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n *  MA  02110-1301  USA\n */\n\n#ifndef __LIBWEBSOCKET_H__\n#define __LIBWEBSOCKET_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#include <cstddef>\n#endif\n\n#ifdef WIN32\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#include <stddef.h>\n#include \"../win32port/win32helpers/websock-w32.h\"\n\n#include \"../win32port/win32helpers/gettimeofday.h\"\n\n#define strcasecmp stricmp\n#define getdtablesize() 30000\n\ntypedef int ssize_t;\n\n#define LWS_VISIBLE\n\n#ifdef LWS_DLL\n#ifdef LWS_INTERNAL\n#define LWS_EXTERN extern __declspec(dllexport)\n#else\n#define LWS_EXTERN extern __declspec(dllimport)\n#endif\n#else\n#define LWS_EXTERN\n#endif\n\n#else // NOT WIN32\n#include <poll.h>\n#include <unistd.h>\n\n#if defined(__GNUC__)\n#define LWS_VISIBLE __attribute__((visibility(\"default\")))\n#else\n#define LWS_VISIBLE\n#endif\n\n#endif\n\n#include <assert.h>\n\n#ifndef LWS_EXTERN\n#define LWS_EXTERN extern\n#endif\n\n#define CONTEXT_PORT_NO_LISTEN 0\n#define MAX_MUX_RECURSION 2\n\nenum lws_log_levels {\n\tLLL_ERR = 1 << 0,\n\tLLL_WARN = 1 << 1,\n\tLLL_NOTICE = 1 << 2,\n\tLLL_INFO = 1 << 3,\n\tLLL_DEBUG = 1 << 4,\n\tLLL_PARSER = 1 << 5,\n\tLLL_HEADER = 1 << 6,\n\tLLL_EXT = 1 << 7,\n\tLLL_CLIENT = 1 << 8,\n\tLLL_LATENCY = 1 << 9,\n\n\tLLL_COUNT = 10 /* set to count of valid flags */\n};\n\nLWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...);\n\n/* notice, warn and log are always compiled in */\n#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__)\n#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__)\n#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__)\n/*\n *  weaker logging can be deselected at configure time using --disable-debug\n *  that gets rid of the overhead of checking while keeping _warn and _err\n *  active\n */\n#ifdef _DEBUG\n\n#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__)\n#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__)\n#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__)\n#define lwsl_header(...)  _lws_log(LLL_HEADER, __VA_ARGS__)\n#define lwsl_ext(...)  _lws_log(LLL_EXT, __VA_ARGS__)\n#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__)\n#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__)\nLWS_VISIBLE LWS_EXTERN void lwsl_hexdump(void *buf, size_t len);\n\n#else /* no debug */\n\n#define lwsl_info(...)\n#define lwsl_debug(...)\n#define lwsl_parser(...)\n#define lwsl_header(...)\n#define lwsl_ext(...)\n#define lwsl_client(...)\n#define lwsl_latency(...)\n#define lwsl_hexdump(a, b)\n\n#endif\n\nenum libwebsocket_context_options {\n\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2,\n\tLWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4,\n};\n\nenum libwebsocket_callback_reasons {\n\tLWS_CALLBACK_ESTABLISHED,\n\tLWS_CALLBACK_CLIENT_CONNECTION_ERROR,\n\tLWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH,\n\tLWS_CALLBACK_CLIENT_ESTABLISHED,\n\tLWS_CALLBACK_CLOSED,\n\tLWS_CALLBACK_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE_PONG,\n\tLWS_CALLBACK_CLIENT_WRITEABLE,\n\tLWS_CALLBACK_SERVER_WRITEABLE,\n\tLWS_CALLBACK_HTTP,\n\tLWS_CALLBACK_HTTP_FILE_COMPLETION,\n\tLWS_CALLBACK_HTTP_WRITEABLE,\n\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION,\n\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION,\n\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER,\n\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY,\n\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED,\n\tLWS_CALLBACK_PROTOCOL_INIT,\n\tLWS_CALLBACK_PROTOCOL_DESTROY,\n\t/* external poll() management support */\n\tLWS_CALLBACK_ADD_POLL_FD,\n\tLWS_CALLBACK_DEL_POLL_FD,\n\tLWS_CALLBACK_SET_MODE_POLL_FD,\n\tLWS_CALLBACK_CLEAR_MODE_POLL_FD,\n};\n\n#ifndef LWS_NO_EXTENSIONS\nenum libwebsocket_extension_callback_reasons {\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_REALLY_CLOSE,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_PROPOSE_EXTENSION,\n\tLWS_EXT_CALLBACK_DESTROY,\n\tLWS_EXT_CALLBACK_DESTROY_ANY_WSI_CLOSING,\n\tLWS_EXT_CALLBACK_ANY_WSI_ESTABLISHED,\n\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE,\n\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND,\n\tLWS_EXT_CALLBACK_PACKET_TX_DO_SEND,\n\tLWS_EXT_CALLBACK_HANDSHAKE_REPLY_TX,\n\tLWS_EXT_CALLBACK_FLUSH_PENDING_TX,\n\tLWS_EXT_CALLBACK_EXTENDED_PAYLOAD_RX,\n\tLWS_EXT_CALLBACK_CAN_PROXY_CLIENT_CONNECTION,\n\tLWS_EXT_CALLBACK_1HZ,\n\tLWS_EXT_CALLBACK_REQUEST_ON_WRITEABLE,\n\tLWS_EXT_CALLBACK_IS_WRITEABLE,\n\tLWS_EXT_CALLBACK_PAYLOAD_TX,\n\tLWS_EXT_CALLBACK_PAYLOAD_RX,\n};\n#endif\n\nenum libwebsocket_write_protocol {\n\tLWS_WRITE_TEXT,\n\tLWS_WRITE_BINARY,\n\tLWS_WRITE_CONTINUATION,\n\tLWS_WRITE_HTTP,\n\n\t/* special 04+ opcodes */\n\n\tLWS_WRITE_CLOSE,\n\tLWS_WRITE_PING,\n\tLWS_WRITE_PONG,\n\n\t/* flags */\n\n\tLWS_WRITE_NO_FIN = 0x40,\n\t/*\n\t * client packet payload goes out on wire unmunged\n\t * only useful for security tests since normal servers cannot\n\t * decode the content if used\n\t */\n\tLWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80\n};\n\n/*\n * you need these to look at headers that have been parsed if using the\n * LWS_CALLBACK_FILTER_CONNECTION callback.  If a header from the enum\n * list below is absent, .token = NULL and token_len = 0.  Otherwise .token\n * points to .token_len chars containing that header content.\n */\n\nstruct lws_tokens {\n\tchar *token;\n\tint token_len;\n};\n\nenum lws_token_indexes {\n\tWSI_TOKEN_GET_URI,\n\tWSI_TOKEN_HOST,\n\tWSI_TOKEN_CONNECTION,\n\tWSI_TOKEN_KEY1,\n\tWSI_TOKEN_KEY2,\n\tWSI_TOKEN_PROTOCOL,\n\tWSI_TOKEN_UPGRADE,\n\tWSI_TOKEN_ORIGIN,\n\tWSI_TOKEN_DRAFT,\n\tWSI_TOKEN_CHALLENGE,\n\n\t/* new for 04 */\n\tWSI_TOKEN_KEY,\n\tWSI_TOKEN_VERSION,\n\tWSI_TOKEN_SWORIGIN,\n\n\t/* new for 05 */\n\tWSI_TOKEN_EXTENSIONS,\n\n\t/* client receives these */\n\tWSI_TOKEN_ACCEPT,\n\tWSI_TOKEN_NONCE,\n\tWSI_TOKEN_HTTP,\n\tWSI_TOKEN_MUXURL,\n\n\t/* use token storage to stash these */\n\n\t_WSI_TOKEN_CLIENT_SENT_PROTOCOLS,\n\t_WSI_TOKEN_CLIENT_PEER_ADDRESS,\n\t_WSI_TOKEN_CLIENT_URI,\n\t_WSI_TOKEN_CLIENT_HOST,\n\t_WSI_TOKEN_CLIENT_ORIGIN,\n\n\t/* always last real token index*/\n\tWSI_TOKEN_COUNT,\n\t/* parser state additions */\n\tWSI_TOKEN_NAME_PART,\n\tWSI_TOKEN_SKIPPING,\n\tWSI_TOKEN_SKIPPING_SAW_CR,\n\tWSI_PARSING_COMPLETE,\n\tWSI_INIT_TOKEN_MUXURL,\n};\n\n/*\n * From RFC 6455\n   1000\n\n      1000 indicates a normal closure, meaning that the purpose for\n      which the connection was established has been fulfilled.\n\n   1001\n\n      1001 indicates that an endpoint is \"going away\", such as a server\n      going down or a browser having navigated away from a page.\n\n   1002\n\n      1002 indicates that an endpoint is terminating the connection due\n      to a protocol error.\n\n   1003\n\n      1003 indicates that an endpoint is terminating the connection\n      because it has received a type of data it cannot accept (e.g., an\n      endpoint that understands only text data MAY send this if it\n      receives a binary message).\n\n   1004\n\n      Reserved.  The specific meaning might be defined in the future.\n\n   1005\n\n      1005 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that no status\n      code was actually present.\n\n   1006\n\n      1006 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed abnormally, e.g., without sending or\n      receiving a Close control frame.\n\n   1007\n\n      1007 indicates that an endpoint is terminating the connection\n      because it has received data within a message that was not\n      consistent with the type of the message (e.g., non-UTF-8 [RFC3629]\n      data within a text message).\n\n   1008\n\n      1008 indicates that an endpoint is terminating the connection\n      because it has received a message that violates its policy.  This\n      is a generic status code that can be returned when there is no\n      other more suitable status code (e.g., 1003 or 1009) or if there\n      is a need to hide specific details about the policy.\n\n   1009\n\n      1009 indicates that an endpoint is terminating the connection\n      because it has received a message that is too big for it to\n      process.\n\n   1010\n\n      1010 indicates that an endpoint (client) is terminating the\n      connection because it has expected the server to negotiate one or\n      more extension, but the server didn't return them in the response\n      message of the WebSocket handshake.  The list of extensions that\n      are needed SHOULD appear in the /reason/ part of the Close frame.\n      Note that this status code is not used by the server, because it\n      can fail the WebSocket handshake instead.\n\n   1011\n\n      1011 indicates that a server is terminating the connection because\n      it encountered an unexpected condition that prevented it from\n      fulfilling the request.\n\n   1015\n\n      1015 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed due to a failure to perform a TLS handshake\n      (e.g., the server certificate can't be verified).\n*/\n\nenum lws_close_status {\n\tLWS_CLOSE_STATUS_NOSTATUS = 0,\n\tLWS_CLOSE_STATUS_NORMAL = 1000,\n\tLWS_CLOSE_STATUS_GOINGAWAY = 1001,\n\tLWS_CLOSE_STATUS_PROTOCOL_ERR = 1002,\n\tLWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003,\n\tLWS_CLOSE_STATUS_RESERVED = 1004,\n\tLWS_CLOSE_STATUS_NO_STATUS = 1005,\n\tLWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006,\n\tLWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007,\n\tLWS_CLOSE_STATUS_POLICY_VIOLATION = 1008,\n\tLWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009,\n\tLWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010,\n\tLWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011,\n\tLWS_CLOSE_STATUS_TLS_FAILURE = 1015,\n};\n\nstruct libwebsocket;\nstruct libwebsocket_context;\n/* needed even with extensions disabled for create context */\nstruct libwebsocket_extension;\n\n/**\n * callback_function() - User server actions\n * @context:\tWebsockets context\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tThis callback is the way the user controls what is served.  All the\n *\tprotocol detail is hidden and handled by the library.\n *\n *\tFor each connection / session there is user data allocated that is\n *\tpointed to by \"user\".  You set the size of this user data area when\n *\tthe library is initialized with libwebsocket_create_server.\n *\n *\tYou get an opportunity to initialize user data when called back with\n *\tLWS_CALLBACK_ESTABLISHED reason.\n *\n *  LWS_CALLBACK_ESTABLISHED:  after the server completes a handshake with\n *\t\t\t\tan incoming client\n *\n *  LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has\n *        been unable to complete a handshake with the remote server\n *\n *  LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: this is the last chance for the\n *\t\t\t\tclient user code to examine the http headers\n *\t\t\t\tand decide to reject the connection.  If the\n *\t\t\t\tcontent in the headers is interesting to the\n *\t\t\t\tclient (url, etc) it needs to copy it out at\n *\t\t\t\tthis point since it will be destroyed before\n *\t\t\t\tthe CLIENT_ESTABLISHED call\n *\n *  LWS_CALLBACK_CLIENT_ESTABLISHED: after your client connection completed\n *\t\t\t\ta handshake with the remote server\n *\n *\tLWS_CALLBACK_CLOSED: when the websocket session ends\n *\n *\tLWS_CALLBACK_RECEIVE: data has appeared for this server endpoint from a\n *\t\t\t\tremote client, it can be found at *in and is\n *\t\t\t\tlen bytes long\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE_PONG: if you elected to see PONG packets,\n *\t\t\t\tthey appear with this callback reason.  PONG\n *\t\t\t\tpackets only exist in 04+ protocol\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE: data has appeared from the server for the\n *\t\t\t\tclient connection, it can be found at *in and\n *\t\t\t\tis len bytes long\n *\n *\tLWS_CALLBACK_HTTP: an http request has come from a client that is not\n *\t\t\t\tasking to upgrade the connection to a websocket\n *\t\t\t\tone.  This is a chance to serve http content,\n *\t\t\t\tfor example, to send a script to the client\n *\t\t\t\twhich will then open the websockets connection.\n *\t\t\t\t@in points to the URI path requested and\n *\t\t\t\tlibwebsockets_serve_http_file() makes it very\n *\t\t\t\tsimple to send back a file to the client.\n *\t\t\t\tNormally after sending the file you are done\n *\t\t\t\twith the http connection, since the rest of the\n *\t\t\t\tactivity will come by websockets from the script\n *\t\t\t\tthat was delivered by http, so you will want to\n *\t\t\t\treturn 1; to close and free up the connection.\n *\t\t\t\tThat's important because it uses a slot in the\n *\t\t\t\ttotal number of client connections allowed set\n *\t\t\t\tby MAX_CLIENTS.\n *\n *\tLWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol\n *\t\tlink now.\n *\n *\tLWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down\n *\t\t\t\thttp link has completed.\n *\n *\tLWS_CALLBACK_CLIENT_WRITEABLE:\n *      LWS_CALLBACK_SERVER_WRITEABLE:   If you call\n *\t\tlibwebsocket_callback_on_writable() on a connection, you will\n *\t\tget one of these callbacks coming when the connection socket\n *\t\tis able to accept another write packet without blocking.\n *\t\tIf it already was able to take another packet without blocking,\n *\t\tyou'll get this callback at the next call to the service loop\n *\t\tfunction.  Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE\n *\t\tand servers get LWS_CALLBACK_SERVER_WRITEABLE.\n *\n *\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION: called when a client connects to\n *\t\tthe server at network level; the connection is accepted but then\n *\t\tpassed to this callback to decide whether to hang up immediately\n *\t\tor not, based on the client IP.  @in contains the connection\n *\t\tsocket's descriptor.  Return non-zero to terminate\n *\t\tthe connection before sending or receiving anything.\n *\t\tBecause this happens immediately after the network connection\n *\t\tfrom the client, there's no websocket protocol selected yet so\n *\t\tthis callback is issued only to protocol 0.\n *\n *\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: called when the handshake has\n *\t\tbeen received and parsed from the client, but the response is\n *\t\tnot sent yet.  Return non-zero to disallow the connection.\n *\t\t@user is a pointer to an array of struct lws_tokens, you can\n *\t\tuse the header enums lws_token_indexes from libwebsockets.h\n *\t\tto check for and read the supported header presence and\n *\t\tcontent before deciding to allow the handshake to proceed or\n *\t\tto kill the connection.\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto perform extra SSL_CTX_load_verify_locations() or similar\n *\t\tcalls to direct OpenSSL where to find certificates the client\n *\t\tcan use to confirm the remote server identity.  @user is the\n *\t\tOpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto load extra certifcates into the server which allow it to\n *\t\tverify the validity of certificates returned by clients.  @user\n *\t\tis the server's OpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: if the\n *\t\tlibwebsockets context was created with the option\n *\t\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this\n *\t\tcallback is generated during OpenSSL verification of the cert\n *\t\tsent from the client.  It is sent to protocol[0] callback as\n *\t\tno protocol has been negotiated on the connection yet.\n *\t\tNotice that the libwebsockets context and wsi are both NULL\n *\t\tduring this callback.  See\n *\t\t http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html\n *\t\tto understand more detail about the OpenSSL callback that\n *\t\tgenerates this libwebsockets callback and the meanings of the\n *\t\targuments passed.  In this callback, @user is the x509_ctx,\n *\t\t@in is the ssl pointer and @len is preverify_ok\n *\t\tNotice that this callback maintains libwebsocket return\n *\t\tconventions, return 0 to mean the cert is OK or 1 to fail it.\n *\t\tThis also means that if you don't handle this callback then\n *\t\tthe default callback action of returning 0 allows the client\n *\t\tcertificates.\n *\n *\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: this callback happens\n *\t\twhen a client handshake is being compiled.  @user is NULL,\n *\t\t@in is a char **, it's pointing to a char * which holds the\n *\t\tnext location in the header buffer where you can add\n *\t\theaders, and @len is the remaining space in the header buffer,\n *\t\twhich is typically some hundreds of bytes.  So, to add a canned\n *\t\tcookie, your handler code might look similar to:\n *\n *\t\tchar **p = (char **)in;\n *\n *\t\tif (len < 100)\n *\t\t\treturn 1;\n *\n *\t\t*p += sprintf(*p, \"Cookie: a=b\\x0d\\x0a\");\n *\n *\t\treturn 0;\n *\n *\t\tNotice if you add anything, you just have to take care about\n *\t\tthe CRLF on the line you added.  Obviously this callback is\n *\t\toptional, if you don't handle it everything is fine.\n *\n *\t\tNotice the callback is coming to protocols[0] all the time,\n *\t\tbecause there is no specific protocol handshook yet.\n *\n *\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY: When the server handshake code\n *\t\tsees that it does support a requested extension, before\n *\t\taccepting the extension by additing to the list sent back to\n *\t\tthe client it gives this callback just to check that it's okay\n *\t\tto use that extension.  It calls back to the requested protocol\n *\t\tand with @in being the extension name, @len is 0 and @user is\n *\t\tvalid.  Note though at this time the ESTABLISHED callback hasn't\n *\t\thappened yet so if you initialize @user content there, @user\n *\t\tcontent during this callback might not be useful for anything.\n *\t\tNotice this callback comes to protocols[0].\n *\n *\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED:\tWhen a client\n *\t\tconnection is being prepared to start a handshake to a server,\n *\t\teach supported extension is checked with protocols[0] callback\n *\t\twith this reason, giving the user code a chance to suppress the\n *\t\tclaim to support that extension by returning non-zero.  If\n *\t\tunhandled, by default 0 will be returned and the extension\n *\t\tsupport included in the header to the server.  Notice this\n *\t\tcallback comes to protocols[0].\n *\n *\tLWS_CALLBACK_PROTOCOL_INIT:\tOne-time call per protocol so it can\n *\t\tdo initial setup / allocations etc\n *\n *\tLWS_CALLBACK_PROTOCOL_DESTROY:\tOne-time call per protocol indicating\n *\t\tthis protocol won't get used at all after this callback, the\n *\t\tcontext is getting destroyed.  Take the opportunity to\n *\t\tdeallocate everything that was allocated by the protocol.\n *\n *\tThe next four reasons are optional and only need taking care of if you\n *\twill be integrating libwebsockets sockets into an external polling\n *\tarray.\n *\n *\tLWS_CALLBACK_ADD_POLL_FD: libwebsocket deals with its poll() loop\n *\t\tinternally, but in the case you are integrating with another\n *\t\tserver you will need to have libwebsocket sockets share a\n *\t\tpolling array with the other server.  This and the other\n *\t\tPOLL_FD related callbacks let you put your specialized\n *\t\tpoll array interface code in the callback for protocol 0, the\n *\t\tfirst protocol you support, usually the HTTP protocol in the\n *\t\tserving case.  This callback happens when a socket needs to be\n *\t\tadded to the polling loop: @in contains the fd, and\n *\t\t@len is the events bitmap (like, POLLIN).  If you are using the\n *\t\tinternal polling loop (the \"service\" callback), you can just\n *\t\tignore these callbacks.\n *\n *\tLWS_CALLBACK_DEL_POLL_FD: This callback happens when a socket descriptor\n *\t\tneeds to be removed from an external polling array.  @in is\n *\t\tthe socket desricptor.  If you are using the internal polling\n *\t\tloop, you can just ignore it.\n *\n *\tLWS_CALLBACK_SET_MODE_POLL_FD: This callback happens when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should OR @len on to the events member of the pollfd\n *\t\tstruct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n *\n *\tLWS_CALLBACK_CLEAR_MODE_POLL_FD: This callback occurs when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should AND ~@len on to the events member of the\n *\t\tpollfd struct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n */\nLWS_VISIBLE LWS_EXTERN int callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\ntypedef int (callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * extension_callback_function() - Hooks to allow extensions to operate\n * @context:\tWebsockets context\n * @ext:\tThis extension\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tEach extension that is active on a particular connection receives\n *\tcallbacks during the connection lifetime to allow the extension to\n *\toperate on websocket data and manage itself.\n *\n *\tLibwebsockets takes care of allocating and freeing \"user\" memory for\n *\teach active extension on each connection.  That is what is pointed to\n *\tby the @user parameter.\n *\n *\tLWS_EXT_CALLBACK_CONSTRUCT:  called when the server has decided to\n *\t\tselect this extension from the list provided by the client,\n *\t\tjust before the server will send back the handshake accepting\n *\t\tthe connection with this extension active.  This gives the\n *\t\textension a chance to initialize its connection context found\n *\t\tin @user.\n *\n *\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT: same as LWS_EXT_CALLBACK_CONSTRUCT\n *\t\tbut called when client is instantiating this extension.  Some\n *\t\textensions will work the same on client and server side and then\n *\t\tyou can just merge handlers for both CONSTRUCTS.\n *\n *\tLWS_EXT_CALLBACK_DESTROY:  called when the connection the extension was\n *\t\tbeing used on is about to be closed and deallocated.  It's the\n *\t\tlast chance for the extension to deallocate anything it has\n *\t\tallocated in the user data (pointed to by @user) before the\n *\t\tuser data is deleted.  This same callback is used whether you\n *\t\tare in client or server instantiation context.\n *\n *\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE: when this extension was active on\n *\t\ta connection, and a packet of data arrived at the connection,\n *\t\tit is passed to this callback to give the extension a chance to\n *\t\tchange the data, eg, decompress it.  @user is pointing to the\n *\t\textension's private connection context data, @in is pointing\n *\t\tto an lws_tokens struct, it consists of a char * pointer called\n *\t\ttoken, and an int called token_len.  At entry, these are\n *\t\tset to point to the received buffer and set to the content\n *\t\tlength.  If the extension will grow the content, it should use\n *\t\ta new buffer allocated in its private user context data and\n *\t\tset the pointed-to lws_tokens members to point to its buffer.\n *\n *\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND: this works the same way as\n *\t\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the\n *\t\textension a chance to change websocket data just before it will\n *\t\tbe sent out.  Using the same lws_token pointer scheme in @in,\n *\t\tthe extension can change the buffer and the length to be\n *\t\ttransmitted how it likes.  Again if it wants to grow the\n *\t\tbuffer safely, it should copy the data into its own buffer and\n *\t\tset the lws_tokens token pointer to it.\n */\nLWS_VISIBLE LWS_EXTERN int extension_callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n\ntypedef int (extension_callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n#endif\n\n/**\n * struct libwebsocket_protocols -\tList of protocols and handlers server\n *\t\t\t\t\tsupports.\n * @name:\tProtocol name that must match the one given in the client\n *\t\tJavascript new WebSocket(url, 'protocol') name\n * @callback:\tThe service callback used for this protocol.  It allows the\n *\t\tservice action for an entire protocol to be encapsulated in\n *\t\tthe protocol-specific callback\n * @per_session_data_size:\tEach new connection using this protocol gets\n *\t\tthis much memory allocated on connection establishment and\n *\t\tfreed on connection takedown.  A pointer to this per-connection\n *\t\tallocation is passed into the callback in the 'user' parameter\n * @rx_buffer_size: if you want atomic frames delivered to the callback, you\n *\t\tshould set this to the size of the biggest legal frame that\n *\t\tyou support.  If the frame size is exceeded, there is no\n *\t\terror, but the buffer will spill to the user callback when\n *\t\tfull, which you can detect by using\n *\t\tlibwebsockets_remaining_packet_payload().  Notice that you\n *\t\tjust talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING\n *\t\tand post-padding are automatically also allocated on top.\n * @owning_server:\tthe server init call fills in this opaque pointer when\n *\t\tregistering this protocol with the server.\n * @protocol_index: which protocol we are starting from zero\n *\n *\tThis structure represents one protocol supported by the server.  An\n *\tarray of these structures is passed to libwebsocket_create_server()\n *\tallows as many protocols as you like to be handled by one server.\n */\n\nstruct libwebsocket_protocols {\n\tconst char *name;\n\tcallback_function *callback;\n\tsize_t per_session_data_size;\n\tsize_t rx_buffer_size;\n\n\t/*\n\t * below are filled in on server init and can be left uninitialized,\n\t * no need for user to use them directly either\n\t */\n\n\tstruct libwebsocket_context *owning_server;\n\tint protocol_index;\n};\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * struct libwebsocket_extension -\tAn extension we know how to cope with\n *\n * @name:\t\t\tFormal extension name, eg, \"deflate-stream\"\n * @callback:\t\t\tService callback\n * @per_session_data_size:\tLibwebsockets will auto-malloc this much\n *\t\t\t\tmemory for the use of the extension, a pointer\n *\t\t\t\tto it comes in the @user callback parameter\n * @per_context_private_data:   Optional storage for this extension that\n *\t\t\t\tis per-context, so it can track stuff across\n *\t\t\t\tall sessions, etc, if it wants\n */\n\nstruct libwebsocket_extension {\n\tconst char *name;\n\textension_callback_function *callback;\n\tsize_t per_session_data_size;\n\tvoid *per_context_private_data;\n};\n#endif\n\n/**\n * struct lws_context_creation_info: parameters to create context with\n *\n * @port:\tPort to listen on... you can use 0 to suppress listening on\n *\t\tany port, that's what you want if you are not running a\n *\t\twebsocket server at all but just using it as a client\n * @iface:\tNULL to bind the listen socket to all interfaces, or the\n *\t\tinterface name, eg, \"eth2\"\n * @protocols:\tArray of structures listing supported protocols and a protocol-\n *\t\tspecific callback for each one.  The list is ended with an\n *\t\tentry that has a NULL callback pointer.\n *\t\tIt's not const because we write the owning_server member\n * @extensions: NULL or array of libwebsocket_extension structs listing the\n *\t\textensions this context supports.  If you configured with\n *\t\t--without-extensions, you should give NULL here.\n * @ssl_cert_filepath:\tIf libwebsockets was compiled to use ssl, and you want\n *\t\t\tto listen using SSL, set to the filepath to fetch the\n *\t\t\tserver cert from, otherwise NULL for unencrypted\n * @ssl_private_key_filepath: filepath to private key if wanting SSL mode,\n *\t\t\telse ignored\n * @ssl_ca_filepath: CA certificate filepath or NULL\n * @ssl_cipher_list:\tList of valid ciphers to use (eg,\n * \t\t\t\"RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL\"\n * \t\t\tor you can leave it as NULL to get \"DEFAULT\"\n * @gid:\tgroup id to change to after setting listen socket, or -1.\n * @uid:\tuser id to change to after setting listen socket, or -1.\n * @options:\t0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK\n * @user:\toptional user pointer that can be recovered via the context\n *\t\tpointer using libwebsocket_context_user\n * @ka_time:\t0 for no keepalive, otherwise apply this keepalive timeout to\n *\t\tall libwebsocket sockets, client or server\n * @ka_probes:\tif ka_time was nonzero, after the timeout expires how many\n *\t\ttimes to try to get a response from the peer before giving up\n *\t\tand killing the connection\n * @ka_interval: if ka_time was nonzero, how long to wait before each ka_probes\n *\t\tattempt\n */\n\nstruct lws_context_creation_info {\n\tint port;\n\tconst char *iface;\n\tstruct libwebsocket_protocols *protocols;\n\tstruct libwebsocket_extension *extensions;\n\tconst char *ssl_cert_filepath;\n\tconst char *ssl_private_key_filepath;\n\tconst char *ssl_ca_filepath;\n\tconst char *ssl_cipher_list;\n\tint gid;\n\tint uid;\n\tunsigned int options;\n\tvoid *user;\n\tint ka_time;\n\tint ka_probes;\n\tint ka_interval;\n\n};\n\nLWS_VISIBLE LWS_EXTERN\nvoid lws_set_log_level(int level,\n\t\t\tvoid (*log_emit_function)(int level, const char *line));\n\nLWS_VISIBLE LWS_EXTERN void\nlwsl_emit_syslog(int level, const char *line);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_context *\nlibwebsocket_create_context(struct lws_context_creation_info *info);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_context_destroy(struct libwebsocket_context *context);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service(struct libwebsocket_context *context, int timeout_ms);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service_fd(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t struct pollfd *pollfd);\n\nLWS_VISIBLE LWS_EXTERN void *\nlibwebsocket_context_user(struct libwebsocket_context *context);\n\n/*\n * IMPORTANT NOTICE!\n *\n * When sending with websocket protocol (LWS_WRITE_TEXT or LWS_WRITE_BINARY)\n * the send buffer has to have LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE\n * buf, and LWS_SEND_BUFFER_POST_PADDING bytes valid AFTER (buf + len).\n *\n * This allows us to add protocol info before and after the data, and send as\n * one packet on the network without payload copying, for maximum efficiency.\n *\n * So for example you need this kind of code to use libwebsocket_write with a\n * 128-byte payload\n *\n *   char buf[LWS_SEND_BUFFER_PRE_PADDING + 128 + LWS_SEND_BUFFER_POST_PADDING];\n *\n *   // fill your part of the buffer... for example here it's all zeros\n *   memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, 128);\n *\n *   libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], 128,\n *   \t\t\t\t\t\t\t\tLWS_WRITE_TEXT);\n *\n * When sending LWS_WRITE_HTTP, there is no protocol addition and you can just\n * use the whole buffer without taking care of the above.\n */\n\n/*\n * this is the frame nonce plus two header plus 8 length\n *   there's an additional two for mux extension per mux nesting level\n * 2 byte prepend on close will already fit because control frames cannot use\n * the big length style\n */\n\n#define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION))\n#define LWS_SEND_BUFFER_POST_PADDING 4\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len,\n\t\t\t\t     enum libwebsocket_write_protocol protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi, const char *file,\n\t\t\t\t\t\t     const char *content_type);\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file_fragment(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN const struct libwebsocket_protocols *\nlibwebsockets_get_protocol(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable(struct libwebsocket_context *context,\n\t\t\t\t\t\t      struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable_all_protocol(\n\t\t\t\t const struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_get_socket_fd(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_is_final_fragment(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char\nlibwebsocket_get_reserved_bits(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_rx_flow_allow_all_protocol(\n\t\t\t\tconst struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN size_t\nlibwebsockets_remaining_packet_payload(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect_extended(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one,\n\t\t\t      void *userdata);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlibwebsocket_canonical_hostname(struct libwebsocket_context *context);\n\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsockets_get_peer_addresses(struct libwebsocket_context *context,\n\t\tstruct libwebsocket *wsi, int fd, char *name, int name_len,\n\t\t\t\t\tchar *rip, int rip_len);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_get_random(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t    void *buf, int len);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_daemonize(const char *_lock_path);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_send_pipe_choked(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_frame_is_binary(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char *\nlibwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_encode_string(const char *in, int in_len, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_decode_string(const char *in, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlws_get_library_version(void);\n\n/* access to headers... only valid while headers valid */\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_copy(struct libwebsocket *wsi, char *dest, int len,\n\t\t\t\t\t\tenum lws_token_indexes h);\n\n/*\n * Note: this is not normally needed as a user api.  It's provided in case it is\n * useful when integrating with other app poll loop service code.\n */\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_read(struct libwebsocket_context *context,\n\t\t\t\tstruct libwebsocket *wsi,\n\t\t\t\t\t       unsigned char *buf, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions();\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/websockets/include/mac/libwebsockets.h",
    "content": "/*\n * libwebsockets - small server side websockets and web server implementation\n *\n * Copyright (C) 2010-2013 Andy Green <andy@warmcat.com>\n *\n *  This library is free software; you can redistribute it and/or\n *  modify it under the terms of the GNU Lesser General Public\n *  License as published by the Free Software Foundation:\n *  version 2.1 of the License.\n *\n *  This library is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n *  Lesser General Public License for more details.\n *\n *  You should have received a copy of the GNU Lesser General Public\n *  License along with this library; if not, write to the Free Software\n *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n *  MA  02110-1301  USA\n */\n\n#ifndef __LIBWEBSOCKET_H__\n#define __LIBWEBSOCKET_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#include <cstddef>\n#endif\n\n#ifdef WIN32\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#include <stddef.h>\n#include \"../win32port/win32helpers/websock-w32.h\"\n\n#include \"../win32port/win32helpers/gettimeofday.h\"\n\n#define strcasecmp stricmp\n#define getdtablesize() 30000\n\ntypedef int ssize_t;\n\n#define LWS_VISIBLE\n\n#ifdef LWS_DLL\n#ifdef LWS_INTERNAL\n#define LWS_EXTERN extern __declspec(dllexport)\n#else\n#define LWS_EXTERN extern __declspec(dllimport)\n#endif\n#else\n#define LWS_EXTERN\n#endif\n\n#else // NOT WIN32\n#include <poll.h>\n#include <unistd.h>\n\n#if defined(__GNUC__)\n#define LWS_VISIBLE __attribute__((visibility(\"default\")))\n#else\n#define LWS_VISIBLE\n#endif\n\n#endif\n\n#include <assert.h>\n\n#ifndef LWS_EXTERN\n#define LWS_EXTERN extern\n#endif\n\n#define CONTEXT_PORT_NO_LISTEN 0\n#define MAX_MUX_RECURSION 2\n\nenum lws_log_levels {\n\tLLL_ERR = 1 << 0,\n\tLLL_WARN = 1 << 1,\n\tLLL_NOTICE = 1 << 2,\n\tLLL_INFO = 1 << 3,\n\tLLL_DEBUG = 1 << 4,\n\tLLL_PARSER = 1 << 5,\n\tLLL_HEADER = 1 << 6,\n\tLLL_EXT = 1 << 7,\n\tLLL_CLIENT = 1 << 8,\n\tLLL_LATENCY = 1 << 9,\n\n\tLLL_COUNT = 10 /* set to count of valid flags */\n};\n\nLWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...);\n\n/* notice, warn and log are always compiled in */\n#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__)\n#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__)\n#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__)\n/*\n *  weaker logging can be deselected at configure time using --disable-debug\n *  that gets rid of the overhead of checking while keeping _warn and _err\n *  active\n */\n#ifdef _DEBUG\n\n#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__)\n#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__)\n#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__)\n#define lwsl_header(...)  _lws_log(LLL_HEADER, __VA_ARGS__)\n#define lwsl_ext(...)  _lws_log(LLL_EXT, __VA_ARGS__)\n#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__)\n#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__)\nLWS_VISIBLE LWS_EXTERN void lwsl_hexdump(void *buf, size_t len);\n\n#else /* no debug */\n\n#define lwsl_info(...)\n#define lwsl_debug(...)\n#define lwsl_parser(...)\n#define lwsl_header(...)\n#define lwsl_ext(...)\n#define lwsl_client(...)\n#define lwsl_latency(...)\n#define lwsl_hexdump(a, b)\n\n#endif\n\nenum libwebsocket_context_options {\n\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2,\n\tLWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4,\n};\n\nenum libwebsocket_callback_reasons {\n\tLWS_CALLBACK_ESTABLISHED,\n\tLWS_CALLBACK_CLIENT_CONNECTION_ERROR,\n\tLWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH,\n\tLWS_CALLBACK_CLIENT_ESTABLISHED,\n\tLWS_CALLBACK_CLOSED,\n\tLWS_CALLBACK_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE_PONG,\n\tLWS_CALLBACK_CLIENT_WRITEABLE,\n\tLWS_CALLBACK_SERVER_WRITEABLE,\n\tLWS_CALLBACK_HTTP,\n\tLWS_CALLBACK_HTTP_FILE_COMPLETION,\n\tLWS_CALLBACK_HTTP_WRITEABLE,\n\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION,\n\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION,\n\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER,\n\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY,\n\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED,\n\tLWS_CALLBACK_PROTOCOL_INIT,\n\tLWS_CALLBACK_PROTOCOL_DESTROY,\n\t/* external poll() management support */\n\tLWS_CALLBACK_ADD_POLL_FD,\n\tLWS_CALLBACK_DEL_POLL_FD,\n\tLWS_CALLBACK_SET_MODE_POLL_FD,\n\tLWS_CALLBACK_CLEAR_MODE_POLL_FD,\n};\n\n#ifndef LWS_NO_EXTENSIONS\nenum libwebsocket_extension_callback_reasons {\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_REALLY_CLOSE,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_PROPOSE_EXTENSION,\n\tLWS_EXT_CALLBACK_DESTROY,\n\tLWS_EXT_CALLBACK_DESTROY_ANY_WSI_CLOSING,\n\tLWS_EXT_CALLBACK_ANY_WSI_ESTABLISHED,\n\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE,\n\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND,\n\tLWS_EXT_CALLBACK_PACKET_TX_DO_SEND,\n\tLWS_EXT_CALLBACK_HANDSHAKE_REPLY_TX,\n\tLWS_EXT_CALLBACK_FLUSH_PENDING_TX,\n\tLWS_EXT_CALLBACK_EXTENDED_PAYLOAD_RX,\n\tLWS_EXT_CALLBACK_CAN_PROXY_CLIENT_CONNECTION,\n\tLWS_EXT_CALLBACK_1HZ,\n\tLWS_EXT_CALLBACK_REQUEST_ON_WRITEABLE,\n\tLWS_EXT_CALLBACK_IS_WRITEABLE,\n\tLWS_EXT_CALLBACK_PAYLOAD_TX,\n\tLWS_EXT_CALLBACK_PAYLOAD_RX,\n};\n#endif\n\nenum libwebsocket_write_protocol {\n\tLWS_WRITE_TEXT,\n\tLWS_WRITE_BINARY,\n\tLWS_WRITE_CONTINUATION,\n\tLWS_WRITE_HTTP,\n\n\t/* special 04+ opcodes */\n\n\tLWS_WRITE_CLOSE,\n\tLWS_WRITE_PING,\n\tLWS_WRITE_PONG,\n\n\t/* flags */\n\n\tLWS_WRITE_NO_FIN = 0x40,\n\t/*\n\t * client packet payload goes out on wire unmunged\n\t * only useful for security tests since normal servers cannot\n\t * decode the content if used\n\t */\n\tLWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80\n};\n\n/*\n * you need these to look at headers that have been parsed if using the\n * LWS_CALLBACK_FILTER_CONNECTION callback.  If a header from the enum\n * list below is absent, .token = NULL and token_len = 0.  Otherwise .token\n * points to .token_len chars containing that header content.\n */\n\nstruct lws_tokens {\n\tchar *token;\n\tint token_len;\n};\n\nenum lws_token_indexes {\n\tWSI_TOKEN_GET_URI,\n\tWSI_TOKEN_HOST,\n\tWSI_TOKEN_CONNECTION,\n\tWSI_TOKEN_KEY1,\n\tWSI_TOKEN_KEY2,\n\tWSI_TOKEN_PROTOCOL,\n\tWSI_TOKEN_UPGRADE,\n\tWSI_TOKEN_ORIGIN,\n\tWSI_TOKEN_DRAFT,\n\tWSI_TOKEN_CHALLENGE,\n\n\t/* new for 04 */\n\tWSI_TOKEN_KEY,\n\tWSI_TOKEN_VERSION,\n\tWSI_TOKEN_SWORIGIN,\n\n\t/* new for 05 */\n\tWSI_TOKEN_EXTENSIONS,\n\n\t/* client receives these */\n\tWSI_TOKEN_ACCEPT,\n\tWSI_TOKEN_NONCE,\n\tWSI_TOKEN_HTTP,\n\tWSI_TOKEN_MUXURL,\n\n\t/* use token storage to stash these */\n\n\t_WSI_TOKEN_CLIENT_SENT_PROTOCOLS,\n\t_WSI_TOKEN_CLIENT_PEER_ADDRESS,\n\t_WSI_TOKEN_CLIENT_URI,\n\t_WSI_TOKEN_CLIENT_HOST,\n\t_WSI_TOKEN_CLIENT_ORIGIN,\n\n\t/* always last real token index*/\n\tWSI_TOKEN_COUNT,\n\t/* parser state additions */\n\tWSI_TOKEN_NAME_PART,\n\tWSI_TOKEN_SKIPPING,\n\tWSI_TOKEN_SKIPPING_SAW_CR,\n\tWSI_PARSING_COMPLETE,\n\tWSI_INIT_TOKEN_MUXURL,\n};\n\n/*\n * From RFC 6455\n   1000\n\n      1000 indicates a normal closure, meaning that the purpose for\n      which the connection was established has been fulfilled.\n\n   1001\n\n      1001 indicates that an endpoint is \"going away\", such as a server\n      going down or a browser having navigated away from a page.\n\n   1002\n\n      1002 indicates that an endpoint is terminating the connection due\n      to a protocol error.\n\n   1003\n\n      1003 indicates that an endpoint is terminating the connection\n      because it has received a type of data it cannot accept (e.g., an\n      endpoint that understands only text data MAY send this if it\n      receives a binary message).\n\n   1004\n\n      Reserved.  The specific meaning might be defined in the future.\n\n   1005\n\n      1005 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that no status\n      code was actually present.\n\n   1006\n\n      1006 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed abnormally, e.g., without sending or\n      receiving a Close control frame.\n\n   1007\n\n      1007 indicates that an endpoint is terminating the connection\n      because it has received data within a message that was not\n      consistent with the type of the message (e.g., non-UTF-8 [RFC3629]\n      data within a text message).\n\n   1008\n\n      1008 indicates that an endpoint is terminating the connection\n      because it has received a message that violates its policy.  This\n      is a generic status code that can be returned when there is no\n      other more suitable status code (e.g., 1003 or 1009) or if there\n      is a need to hide specific details about the policy.\n\n   1009\n\n      1009 indicates that an endpoint is terminating the connection\n      because it has received a message that is too big for it to\n      process.\n\n   1010\n\n      1010 indicates that an endpoint (client) is terminating the\n      connection because it has expected the server to negotiate one or\n      more extension, but the server didn't return them in the response\n      message of the WebSocket handshake.  The list of extensions that\n      are needed SHOULD appear in the /reason/ part of the Close frame.\n      Note that this status code is not used by the server, because it\n      can fail the WebSocket handshake instead.\n\n   1011\n\n      1011 indicates that a server is terminating the connection because\n      it encountered an unexpected condition that prevented it from\n      fulfilling the request.\n\n   1015\n\n      1015 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed due to a failure to perform a TLS handshake\n      (e.g., the server certificate can't be verified).\n*/\n\nenum lws_close_status {\n\tLWS_CLOSE_STATUS_NOSTATUS = 0,\n\tLWS_CLOSE_STATUS_NORMAL = 1000,\n\tLWS_CLOSE_STATUS_GOINGAWAY = 1001,\n\tLWS_CLOSE_STATUS_PROTOCOL_ERR = 1002,\n\tLWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003,\n\tLWS_CLOSE_STATUS_RESERVED = 1004,\n\tLWS_CLOSE_STATUS_NO_STATUS = 1005,\n\tLWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006,\n\tLWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007,\n\tLWS_CLOSE_STATUS_POLICY_VIOLATION = 1008,\n\tLWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009,\n\tLWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010,\n\tLWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011,\n\tLWS_CLOSE_STATUS_TLS_FAILURE = 1015,\n};\n\nstruct libwebsocket;\nstruct libwebsocket_context;\n/* needed even with extensions disabled for create context */\nstruct libwebsocket_extension;\n\n/**\n * callback_function() - User server actions\n * @context:\tWebsockets context\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tThis callback is the way the user controls what is served.  All the\n *\tprotocol detail is hidden and handled by the library.\n *\n *\tFor each connection / session there is user data allocated that is\n *\tpointed to by \"user\".  You set the size of this user data area when\n *\tthe library is initialized with libwebsocket_create_server.\n *\n *\tYou get an opportunity to initialize user data when called back with\n *\tLWS_CALLBACK_ESTABLISHED reason.\n *\n *  LWS_CALLBACK_ESTABLISHED:  after the server completes a handshake with\n *\t\t\t\tan incoming client\n *\n *  LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has\n *        been unable to complete a handshake with the remote server\n *\n *  LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: this is the last chance for the\n *\t\t\t\tclient user code to examine the http headers\n *\t\t\t\tand decide to reject the connection.  If the\n *\t\t\t\tcontent in the headers is interesting to the\n *\t\t\t\tclient (url, etc) it needs to copy it out at\n *\t\t\t\tthis point since it will be destroyed before\n *\t\t\t\tthe CLIENT_ESTABLISHED call\n *\n *  LWS_CALLBACK_CLIENT_ESTABLISHED: after your client connection completed\n *\t\t\t\ta handshake with the remote server\n *\n *\tLWS_CALLBACK_CLOSED: when the websocket session ends\n *\n *\tLWS_CALLBACK_RECEIVE: data has appeared for this server endpoint from a\n *\t\t\t\tremote client, it can be found at *in and is\n *\t\t\t\tlen bytes long\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE_PONG: if you elected to see PONG packets,\n *\t\t\t\tthey appear with this callback reason.  PONG\n *\t\t\t\tpackets only exist in 04+ protocol\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE: data has appeared from the server for the\n *\t\t\t\tclient connection, it can be found at *in and\n *\t\t\t\tis len bytes long\n *\n *\tLWS_CALLBACK_HTTP: an http request has come from a client that is not\n *\t\t\t\tasking to upgrade the connection to a websocket\n *\t\t\t\tone.  This is a chance to serve http content,\n *\t\t\t\tfor example, to send a script to the client\n *\t\t\t\twhich will then open the websockets connection.\n *\t\t\t\t@in points to the URI path requested and\n *\t\t\t\tlibwebsockets_serve_http_file() makes it very\n *\t\t\t\tsimple to send back a file to the client.\n *\t\t\t\tNormally after sending the file you are done\n *\t\t\t\twith the http connection, since the rest of the\n *\t\t\t\tactivity will come by websockets from the script\n *\t\t\t\tthat was delivered by http, so you will want to\n *\t\t\t\treturn 1; to close and free up the connection.\n *\t\t\t\tThat's important because it uses a slot in the\n *\t\t\t\ttotal number of client connections allowed set\n *\t\t\t\tby MAX_CLIENTS.\n *\n *\tLWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol\n *\t\tlink now.\n *\n *\tLWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down\n *\t\t\t\thttp link has completed.\n *\n *\tLWS_CALLBACK_CLIENT_WRITEABLE:\n *      LWS_CALLBACK_SERVER_WRITEABLE:   If you call\n *\t\tlibwebsocket_callback_on_writable() on a connection, you will\n *\t\tget one of these callbacks coming when the connection socket\n *\t\tis able to accept another write packet without blocking.\n *\t\tIf it already was able to take another packet without blocking,\n *\t\tyou'll get this callback at the next call to the service loop\n *\t\tfunction.  Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE\n *\t\tand servers get LWS_CALLBACK_SERVER_WRITEABLE.\n *\n *\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION: called when a client connects to\n *\t\tthe server at network level; the connection is accepted but then\n *\t\tpassed to this callback to decide whether to hang up immediately\n *\t\tor not, based on the client IP.  @in contains the connection\n *\t\tsocket's descriptor.  Return non-zero to terminate\n *\t\tthe connection before sending or receiving anything.\n *\t\tBecause this happens immediately after the network connection\n *\t\tfrom the client, there's no websocket protocol selected yet so\n *\t\tthis callback is issued only to protocol 0.\n *\n *\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: called when the handshake has\n *\t\tbeen received and parsed from the client, but the response is\n *\t\tnot sent yet.  Return non-zero to disallow the connection.\n *\t\t@user is a pointer to an array of struct lws_tokens, you can\n *\t\tuse the header enums lws_token_indexes from libwebsockets.h\n *\t\tto check for and read the supported header presence and\n *\t\tcontent before deciding to allow the handshake to proceed or\n *\t\tto kill the connection.\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto perform extra SSL_CTX_load_verify_locations() or similar\n *\t\tcalls to direct OpenSSL where to find certificates the client\n *\t\tcan use to confirm the remote server identity.  @user is the\n *\t\tOpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto load extra certifcates into the server which allow it to\n *\t\tverify the validity of certificates returned by clients.  @user\n *\t\tis the server's OpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: if the\n *\t\tlibwebsockets context was created with the option\n *\t\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this\n *\t\tcallback is generated during OpenSSL verification of the cert\n *\t\tsent from the client.  It is sent to protocol[0] callback as\n *\t\tno protocol has been negotiated on the connection yet.\n *\t\tNotice that the libwebsockets context and wsi are both NULL\n *\t\tduring this callback.  See\n *\t\t http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html\n *\t\tto understand more detail about the OpenSSL callback that\n *\t\tgenerates this libwebsockets callback and the meanings of the\n *\t\targuments passed.  In this callback, @user is the x509_ctx,\n *\t\t@in is the ssl pointer and @len is preverify_ok\n *\t\tNotice that this callback maintains libwebsocket return\n *\t\tconventions, return 0 to mean the cert is OK or 1 to fail it.\n *\t\tThis also means that if you don't handle this callback then\n *\t\tthe default callback action of returning 0 allows the client\n *\t\tcertificates.\n *\n *\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: this callback happens\n *\t\twhen a client handshake is being compiled.  @user is NULL,\n *\t\t@in is a char **, it's pointing to a char * which holds the\n *\t\tnext location in the header buffer where you can add\n *\t\theaders, and @len is the remaining space in the header buffer,\n *\t\twhich is typically some hundreds of bytes.  So, to add a canned\n *\t\tcookie, your handler code might look similar to:\n *\n *\t\tchar **p = (char **)in;\n *\n *\t\tif (len < 100)\n *\t\t\treturn 1;\n *\n *\t\t*p += sprintf(*p, \"Cookie: a=b\\x0d\\x0a\");\n *\n *\t\treturn 0;\n *\n *\t\tNotice if you add anything, you just have to take care about\n *\t\tthe CRLF on the line you added.  Obviously this callback is\n *\t\toptional, if you don't handle it everything is fine.\n *\n *\t\tNotice the callback is coming to protocols[0] all the time,\n *\t\tbecause there is no specific protocol handshook yet.\n *\n *\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY: When the server handshake code\n *\t\tsees that it does support a requested extension, before\n *\t\taccepting the extension by additing to the list sent back to\n *\t\tthe client it gives this callback just to check that it's okay\n *\t\tto use that extension.  It calls back to the requested protocol\n *\t\tand with @in being the extension name, @len is 0 and @user is\n *\t\tvalid.  Note though at this time the ESTABLISHED callback hasn't\n *\t\thappened yet so if you initialize @user content there, @user\n *\t\tcontent during this callback might not be useful for anything.\n *\t\tNotice this callback comes to protocols[0].\n *\n *\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED:\tWhen a client\n *\t\tconnection is being prepared to start a handshake to a server,\n *\t\teach supported extension is checked with protocols[0] callback\n *\t\twith this reason, giving the user code a chance to suppress the\n *\t\tclaim to support that extension by returning non-zero.  If\n *\t\tunhandled, by default 0 will be returned and the extension\n *\t\tsupport included in the header to the server.  Notice this\n *\t\tcallback comes to protocols[0].\n *\n *\tLWS_CALLBACK_PROTOCOL_INIT:\tOne-time call per protocol so it can\n *\t\tdo initial setup / allocations etc\n *\n *\tLWS_CALLBACK_PROTOCOL_DESTROY:\tOne-time call per protocol indicating\n *\t\tthis protocol won't get used at all after this callback, the\n *\t\tcontext is getting destroyed.  Take the opportunity to\n *\t\tdeallocate everything that was allocated by the protocol.\n *\n *\tThe next four reasons are optional and only need taking care of if you\n *\twill be integrating libwebsockets sockets into an external polling\n *\tarray.\n *\n *\tLWS_CALLBACK_ADD_POLL_FD: libwebsocket deals with its poll() loop\n *\t\tinternally, but in the case you are integrating with another\n *\t\tserver you will need to have libwebsocket sockets share a\n *\t\tpolling array with the other server.  This and the other\n *\t\tPOLL_FD related callbacks let you put your specialized\n *\t\tpoll array interface code in the callback for protocol 0, the\n *\t\tfirst protocol you support, usually the HTTP protocol in the\n *\t\tserving case.  This callback happens when a socket needs to be\n *\t\tadded to the polling loop: @in contains the fd, and\n *\t\t@len is the events bitmap (like, POLLIN).  If you are using the\n *\t\tinternal polling loop (the \"service\" callback), you can just\n *\t\tignore these callbacks.\n *\n *\tLWS_CALLBACK_DEL_POLL_FD: This callback happens when a socket descriptor\n *\t\tneeds to be removed from an external polling array.  @in is\n *\t\tthe socket desricptor.  If you are using the internal polling\n *\t\tloop, you can just ignore it.\n *\n *\tLWS_CALLBACK_SET_MODE_POLL_FD: This callback happens when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should OR @len on to the events member of the pollfd\n *\t\tstruct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n *\n *\tLWS_CALLBACK_CLEAR_MODE_POLL_FD: This callback occurs when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should AND ~@len on to the events member of the\n *\t\tpollfd struct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n */\nLWS_VISIBLE LWS_EXTERN int callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\ntypedef int (callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * extension_callback_function() - Hooks to allow extensions to operate\n * @context:\tWebsockets context\n * @ext:\tThis extension\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tEach extension that is active on a particular connection receives\n *\tcallbacks during the connection lifetime to allow the extension to\n *\toperate on websocket data and manage itself.\n *\n *\tLibwebsockets takes care of allocating and freeing \"user\" memory for\n *\teach active extension on each connection.  That is what is pointed to\n *\tby the @user parameter.\n *\n *\tLWS_EXT_CALLBACK_CONSTRUCT:  called when the server has decided to\n *\t\tselect this extension from the list provided by the client,\n *\t\tjust before the server will send back the handshake accepting\n *\t\tthe connection with this extension active.  This gives the\n *\t\textension a chance to initialize its connection context found\n *\t\tin @user.\n *\n *\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT: same as LWS_EXT_CALLBACK_CONSTRUCT\n *\t\tbut called when client is instantiating this extension.  Some\n *\t\textensions will work the same on client and server side and then\n *\t\tyou can just merge handlers for both CONSTRUCTS.\n *\n *\tLWS_EXT_CALLBACK_DESTROY:  called when the connection the extension was\n *\t\tbeing used on is about to be closed and deallocated.  It's the\n *\t\tlast chance for the extension to deallocate anything it has\n *\t\tallocated in the user data (pointed to by @user) before the\n *\t\tuser data is deleted.  This same callback is used whether you\n *\t\tare in client or server instantiation context.\n *\n *\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE: when this extension was active on\n *\t\ta connection, and a packet of data arrived at the connection,\n *\t\tit is passed to this callback to give the extension a chance to\n *\t\tchange the data, eg, decompress it.  @user is pointing to the\n *\t\textension's private connection context data, @in is pointing\n *\t\tto an lws_tokens struct, it consists of a char * pointer called\n *\t\ttoken, and an int called token_len.  At entry, these are\n *\t\tset to point to the received buffer and set to the content\n *\t\tlength.  If the extension will grow the content, it should use\n *\t\ta new buffer allocated in its private user context data and\n *\t\tset the pointed-to lws_tokens members to point to its buffer.\n *\n *\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND: this works the same way as\n *\t\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the\n *\t\textension a chance to change websocket data just before it will\n *\t\tbe sent out.  Using the same lws_token pointer scheme in @in,\n *\t\tthe extension can change the buffer and the length to be\n *\t\ttransmitted how it likes.  Again if it wants to grow the\n *\t\tbuffer safely, it should copy the data into its own buffer and\n *\t\tset the lws_tokens token pointer to it.\n */\nLWS_VISIBLE LWS_EXTERN int extension_callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n\ntypedef int (extension_callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n#endif\n\n/**\n * struct libwebsocket_protocols -\tList of protocols and handlers server\n *\t\t\t\t\tsupports.\n * @name:\tProtocol name that must match the one given in the client\n *\t\tJavascript new WebSocket(url, 'protocol') name\n * @callback:\tThe service callback used for this protocol.  It allows the\n *\t\tservice action for an entire protocol to be encapsulated in\n *\t\tthe protocol-specific callback\n * @per_session_data_size:\tEach new connection using this protocol gets\n *\t\tthis much memory allocated on connection establishment and\n *\t\tfreed on connection takedown.  A pointer to this per-connection\n *\t\tallocation is passed into the callback in the 'user' parameter\n * @rx_buffer_size: if you want atomic frames delivered to the callback, you\n *\t\tshould set this to the size of the biggest legal frame that\n *\t\tyou support.  If the frame size is exceeded, there is no\n *\t\terror, but the buffer will spill to the user callback when\n *\t\tfull, which you can detect by using\n *\t\tlibwebsockets_remaining_packet_payload().  Notice that you\n *\t\tjust talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING\n *\t\tand post-padding are automatically also allocated on top.\n * @owning_server:\tthe server init call fills in this opaque pointer when\n *\t\tregistering this protocol with the server.\n * @protocol_index: which protocol we are starting from zero\n *\n *\tThis structure represents one protocol supported by the server.  An\n *\tarray of these structures is passed to libwebsocket_create_server()\n *\tallows as many protocols as you like to be handled by one server.\n */\n\nstruct libwebsocket_protocols {\n\tconst char *name;\n\tcallback_function *callback;\n\tsize_t per_session_data_size;\n\tsize_t rx_buffer_size;\n\n\t/*\n\t * below are filled in on server init and can be left uninitialized,\n\t * no need for user to use them directly either\n\t */\n\n\tstruct libwebsocket_context *owning_server;\n\tint protocol_index;\n};\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * struct libwebsocket_extension -\tAn extension we know how to cope with\n *\n * @name:\t\t\tFormal extension name, eg, \"deflate-stream\"\n * @callback:\t\t\tService callback\n * @per_session_data_size:\tLibwebsockets will auto-malloc this much\n *\t\t\t\tmemory for the use of the extension, a pointer\n *\t\t\t\tto it comes in the @user callback parameter\n * @per_context_private_data:   Optional storage for this extension that\n *\t\t\t\tis per-context, so it can track stuff across\n *\t\t\t\tall sessions, etc, if it wants\n */\n\nstruct libwebsocket_extension {\n\tconst char *name;\n\textension_callback_function *callback;\n\tsize_t per_session_data_size;\n\tvoid *per_context_private_data;\n};\n#endif\n\n/**\n * struct lws_context_creation_info: parameters to create context with\n *\n * @port:\tPort to listen on... you can use 0 to suppress listening on\n *\t\tany port, that's what you want if you are not running a\n *\t\twebsocket server at all but just using it as a client\n * @iface:\tNULL to bind the listen socket to all interfaces, or the\n *\t\tinterface name, eg, \"eth2\"\n * @protocols:\tArray of structures listing supported protocols and a protocol-\n *\t\tspecific callback for each one.  The list is ended with an\n *\t\tentry that has a NULL callback pointer.\n *\t\tIt's not const because we write the owning_server member\n * @extensions: NULL or array of libwebsocket_extension structs listing the\n *\t\textensions this context supports.  If you configured with\n *\t\t--without-extensions, you should give NULL here.\n * @ssl_cert_filepath:\tIf libwebsockets was compiled to use ssl, and you want\n *\t\t\tto listen using SSL, set to the filepath to fetch the\n *\t\t\tserver cert from, otherwise NULL for unencrypted\n * @ssl_private_key_filepath: filepath to private key if wanting SSL mode,\n *\t\t\telse ignored\n * @ssl_ca_filepath: CA certificate filepath or NULL\n * @ssl_cipher_list:\tList of valid ciphers to use (eg,\n * \t\t\t\"RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL\"\n * \t\t\tor you can leave it as NULL to get \"DEFAULT\"\n * @gid:\tgroup id to change to after setting listen socket, or -1.\n * @uid:\tuser id to change to after setting listen socket, or -1.\n * @options:\t0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK\n * @user:\toptional user pointer that can be recovered via the context\n *\t\tpointer using libwebsocket_context_user\n * @ka_time:\t0 for no keepalive, otherwise apply this keepalive timeout to\n *\t\tall libwebsocket sockets, client or server\n * @ka_probes:\tif ka_time was nonzero, after the timeout expires how many\n *\t\ttimes to try to get a response from the peer before giving up\n *\t\tand killing the connection\n * @ka_interval: if ka_time was nonzero, how long to wait before each ka_probes\n *\t\tattempt\n */\n\nstruct lws_context_creation_info {\n\tint port;\n\tconst char *iface;\n\tstruct libwebsocket_protocols *protocols;\n\tstruct libwebsocket_extension *extensions;\n\tconst char *ssl_cert_filepath;\n\tconst char *ssl_private_key_filepath;\n\tconst char *ssl_ca_filepath;\n\tconst char *ssl_cipher_list;\n\tint gid;\n\tint uid;\n\tunsigned int options;\n\tvoid *user;\n\tint ka_time;\n\tint ka_probes;\n\tint ka_interval;\n\n};\n\nLWS_VISIBLE LWS_EXTERN\nvoid lws_set_log_level(int level,\n\t\t\tvoid (*log_emit_function)(int level, const char *line));\n\nLWS_VISIBLE LWS_EXTERN void\nlwsl_emit_syslog(int level, const char *line);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_context *\nlibwebsocket_create_context(struct lws_context_creation_info *info);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_context_destroy(struct libwebsocket_context *context);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service(struct libwebsocket_context *context, int timeout_ms);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service_fd(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t struct pollfd *pollfd);\n\nLWS_VISIBLE LWS_EXTERN void *\nlibwebsocket_context_user(struct libwebsocket_context *context);\n\n/*\n * IMPORTANT NOTICE!\n *\n * When sending with websocket protocol (LWS_WRITE_TEXT or LWS_WRITE_BINARY)\n * the send buffer has to have LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE\n * buf, and LWS_SEND_BUFFER_POST_PADDING bytes valid AFTER (buf + len).\n *\n * This allows us to add protocol info before and after the data, and send as\n * one packet on the network without payload copying, for maximum efficiency.\n *\n * So for example you need this kind of code to use libwebsocket_write with a\n * 128-byte payload\n *\n *   char buf[LWS_SEND_BUFFER_PRE_PADDING + 128 + LWS_SEND_BUFFER_POST_PADDING];\n *\n *   // fill your part of the buffer... for example here it's all zeros\n *   memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, 128);\n *\n *   libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], 128,\n *   \t\t\t\t\t\t\t\tLWS_WRITE_TEXT);\n *\n * When sending LWS_WRITE_HTTP, there is no protocol addition and you can just\n * use the whole buffer without taking care of the above.\n */\n\n/*\n * this is the frame nonce plus two header plus 8 length\n *   there's an additional two for mux extension per mux nesting level\n * 2 byte prepend on close will already fit because control frames cannot use\n * the big length style\n */\n\n#define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION))\n#define LWS_SEND_BUFFER_POST_PADDING 4\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len,\n\t\t\t\t     enum libwebsocket_write_protocol protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi, const char *file,\n\t\t\t\t\t\t     const char *content_type);\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file_fragment(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN const struct libwebsocket_protocols *\nlibwebsockets_get_protocol(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable(struct libwebsocket_context *context,\n\t\t\t\t\t\t      struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable_all_protocol(\n\t\t\t\t const struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_get_socket_fd(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_is_final_fragment(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char\nlibwebsocket_get_reserved_bits(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_rx_flow_allow_all_protocol(\n\t\t\t\tconst struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN size_t\nlibwebsockets_remaining_packet_payload(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect_extended(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one,\n\t\t\t      void *userdata);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlibwebsocket_canonical_hostname(struct libwebsocket_context *context);\n\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsockets_get_peer_addresses(struct libwebsocket_context *context,\n\t\tstruct libwebsocket *wsi, int fd, char *name, int name_len,\n\t\t\t\t\tchar *rip, int rip_len);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_get_random(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t    void *buf, int len);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_daemonize(const char *_lock_path);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_send_pipe_choked(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_frame_is_binary(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char *\nlibwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_encode_string(const char *in, int in_len, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_decode_string(const char *in, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlws_get_library_version(void);\n\n/* access to headers... only valid while headers valid */\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_copy(struct libwebsocket *wsi, char *dest, int len,\n\t\t\t\t\t\tenum lws_token_indexes h);\n\n/*\n * Note: this is not normally needed as a user api.  It's provided in case it is\n * useful when integrating with other app poll loop service code.\n */\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_read(struct libwebsocket_context *context,\n\t\t\t\tstruct libwebsocket *wsi,\n\t\t\t\t\t       unsigned char *buf, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions();\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/websockets/include/win32/libwebsockets.h",
    "content": "/*\n * libwebsockets - small server side websockets and web server implementation\n *\n * Copyright (C) 2010-2013 Andy Green <andy@warmcat.com>\n *\n *  This library is free software; you can redistribute it and/or\n *  modify it under the terms of the GNU Lesser General Public\n *  License as published by the Free Software Foundation:\n *  version 2.1 of the License.\n *\n *  This library is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n *  Lesser General Public License for more details.\n *\n *  You should have received a copy of the GNU Lesser General Public\n *  License along with this library; if not, write to the Free Software\n *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,\n *  MA  02110-1301  USA\n */\n\n#ifndef __LIBWEBSOCKET_H__\n#define __LIBWEBSOCKET_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#include <cstddef>\n#endif\n\n#ifdef WIN32\n\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#include <stddef.h>\n#include \"win32helpers/websock-w32.h\"\n\n//#include \"win32helpers/gettimeofday.h\"\n\n#define strcasecmp stricmp\n#define getdtablesize() 30000\n\ntypedef int ssize_t;\n\n#define LWS_VISIBLE\n\n#ifdef LWS_DLL\n#ifdef LWS_INTERNAL\n#define LWS_EXTERN extern __declspec(dllexport)\n#else\n#define LWS_EXTERN extern __declspec(dllimport)\n#endif\n#else\n#define LWS_EXTERN\n#endif\n\n#else // NOT WIN32\n#include <poll.h>\n#include <unistd.h>\n\n#if defined(__GNUC__)\n#define LWS_VISIBLE __attribute__((visibility(\"default\")))\n#else\n#define LWS_VISIBLE\n#endif\n\n#endif\n\n#include <assert.h>\n\n#ifndef LWS_EXTERN\n#define LWS_EXTERN extern\n#endif\n\n#define CONTEXT_PORT_NO_LISTEN 0\n#define MAX_MUX_RECURSION 2\n\nenum lws_log_levels {\n\tLLL_ERR = 1 << 0,\n\tLLL_WARN = 1 << 1,\n\tLLL_NOTICE = 1 << 2,\n\tLLL_INFO = 1 << 3,\n\tLLL_DEBUG = 1 << 4,\n\tLLL_PARSER = 1 << 5,\n\tLLL_HEADER = 1 << 6,\n\tLLL_EXT = 1 << 7,\n\tLLL_CLIENT = 1 << 8,\n\tLLL_LATENCY = 1 << 9,\n\n\tLLL_COUNT = 10 /* set to count of valid flags */\n};\n\nLWS_VISIBLE LWS_EXTERN void _lws_log(int filter, const char *format, ...);\n\n/* notice, warn and log are always compiled in */\n#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__)\n#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__)\n#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__)\n/*\n *  weaker logging can be deselected at configure time using --disable-debug\n *  that gets rid of the overhead of checking while keeping _warn and _err\n *  active\n */\n#ifdef _DEBUG\n\n#define lwsl_info(...) _lws_log(LLL_INFO, __VA_ARGS__)\n#define lwsl_debug(...) _lws_log(LLL_DEBUG, __VA_ARGS__)\n#define lwsl_parser(...) _lws_log(LLL_PARSER, __VA_ARGS__)\n#define lwsl_header(...)  _lws_log(LLL_HEADER, __VA_ARGS__)\n#define lwsl_ext(...)  _lws_log(LLL_EXT, __VA_ARGS__)\n#define lwsl_client(...) _lws_log(LLL_CLIENT, __VA_ARGS__)\n#define lwsl_latency(...) _lws_log(LLL_LATENCY, __VA_ARGS__)\nLWS_VISIBLE LWS_EXTERN void lwsl_hexdump(void *buf, size_t len);\n\n#else /* no debug */\n\n#define lwsl_info(...)\n#define lwsl_debug(...)\n#define lwsl_parser(...)\n#define lwsl_header(...)\n#define lwsl_ext(...)\n#define lwsl_client(...)\n#define lwsl_latency(...)\n#define lwsl_hexdump(a, b)\n\n#endif\n\nenum libwebsocket_context_options {\n\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT = 2,\n\tLWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME = 4,\n};\n\nenum libwebsocket_callback_reasons {\n\tLWS_CALLBACK_ESTABLISHED,\n\tLWS_CALLBACK_CLIENT_CONNECTION_ERROR,\n\tLWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH,\n\tLWS_CALLBACK_CLIENT_ESTABLISHED,\n\tLWS_CALLBACK_CLOSED,\n\tLWS_CALLBACK_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE,\n\tLWS_CALLBACK_CLIENT_RECEIVE_PONG,\n\tLWS_CALLBACK_CLIENT_WRITEABLE,\n\tLWS_CALLBACK_SERVER_WRITEABLE,\n\tLWS_CALLBACK_HTTP,\n\tLWS_CALLBACK_HTTP_FILE_COMPLETION,\n\tLWS_CALLBACK_HTTP_WRITEABLE,\n\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION,\n\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS,\n\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION,\n\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER,\n\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY,\n\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED,\n\tLWS_CALLBACK_PROTOCOL_INIT,\n\tLWS_CALLBACK_PROTOCOL_DESTROY,\n\t/* external poll() management support */\n\tLWS_CALLBACK_ADD_POLL_FD,\n\tLWS_CALLBACK_DEL_POLL_FD,\n\tLWS_CALLBACK_SET_MODE_POLL_FD,\n\tLWS_CALLBACK_CLEAR_MODE_POLL_FD,\n};\n\n#ifndef LWS_NO_EXTENSIONS\nenum libwebsocket_extension_callback_reasons {\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_SERVER_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONTEXT_DESTRUCT,\n\tLWS_EXT_CALLBACK_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_REALLY_CLOSE,\n\tLWS_EXT_CALLBACK_CHECK_OK_TO_PROPOSE_EXTENSION,\n\tLWS_EXT_CALLBACK_DESTROY,\n\tLWS_EXT_CALLBACK_DESTROY_ANY_WSI_CLOSING,\n\tLWS_EXT_CALLBACK_ANY_WSI_ESTABLISHED,\n\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE,\n\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND,\n\tLWS_EXT_CALLBACK_PACKET_TX_DO_SEND,\n\tLWS_EXT_CALLBACK_HANDSHAKE_REPLY_TX,\n\tLWS_EXT_CALLBACK_FLUSH_PENDING_TX,\n\tLWS_EXT_CALLBACK_EXTENDED_PAYLOAD_RX,\n\tLWS_EXT_CALLBACK_CAN_PROXY_CLIENT_CONNECTION,\n\tLWS_EXT_CALLBACK_1HZ,\n\tLWS_EXT_CALLBACK_REQUEST_ON_WRITEABLE,\n\tLWS_EXT_CALLBACK_IS_WRITEABLE,\n\tLWS_EXT_CALLBACK_PAYLOAD_TX,\n\tLWS_EXT_CALLBACK_PAYLOAD_RX,\n};\n#endif\n\nenum libwebsocket_write_protocol {\n\tLWS_WRITE_TEXT,\n\tLWS_WRITE_BINARY,\n\tLWS_WRITE_CONTINUATION,\n\tLWS_WRITE_HTTP,\n\n\t/* special 04+ opcodes */\n\n\tLWS_WRITE_CLOSE,\n\tLWS_WRITE_PING,\n\tLWS_WRITE_PONG,\n\n\t/* flags */\n\n\tLWS_WRITE_NO_FIN = 0x40,\n\t/*\n\t * client packet payload goes out on wire unmunged\n\t * only useful for security tests since normal servers cannot\n\t * decode the content if used\n\t */\n\tLWS_WRITE_CLIENT_IGNORE_XOR_MASK = 0x80\n};\n\n/*\n * you need these to look at headers that have been parsed if using the\n * LWS_CALLBACK_FILTER_CONNECTION callback.  If a header from the enum\n * list below is absent, .token = NULL and token_len = 0.  Otherwise .token\n * points to .token_len chars containing that header content.\n */\n\nstruct lws_tokens {\n\tchar *token;\n\tint token_len;\n};\n\nenum lws_token_indexes {\n\tWSI_TOKEN_GET_URI,\n\tWSI_TOKEN_HOST,\n\tWSI_TOKEN_CONNECTION,\n\tWSI_TOKEN_KEY1,\n\tWSI_TOKEN_KEY2,\n\tWSI_TOKEN_PROTOCOL,\n\tWSI_TOKEN_UPGRADE,\n\tWSI_TOKEN_ORIGIN,\n\tWSI_TOKEN_DRAFT,\n\tWSI_TOKEN_CHALLENGE,\n\n\t/* new for 04 */\n\tWSI_TOKEN_KEY,\n\tWSI_TOKEN_VERSION,\n\tWSI_TOKEN_SWORIGIN,\n\n\t/* new for 05 */\n\tWSI_TOKEN_EXTENSIONS,\n\n\t/* client receives these */\n\tWSI_TOKEN_ACCEPT,\n\tWSI_TOKEN_NONCE,\n\tWSI_TOKEN_HTTP,\n\tWSI_TOKEN_MUXURL,\n\n\t/* use token storage to stash these */\n\n\t_WSI_TOKEN_CLIENT_SENT_PROTOCOLS,\n\t_WSI_TOKEN_CLIENT_PEER_ADDRESS,\n\t_WSI_TOKEN_CLIENT_URI,\n\t_WSI_TOKEN_CLIENT_HOST,\n\t_WSI_TOKEN_CLIENT_ORIGIN,\n\n\t/* always last real token index*/\n\tWSI_TOKEN_COUNT,\n\t/* parser state additions */\n\tWSI_TOKEN_NAME_PART,\n\tWSI_TOKEN_SKIPPING,\n\tWSI_TOKEN_SKIPPING_SAW_CR,\n\tWSI_PARSING_COMPLETE,\n\tWSI_INIT_TOKEN_MUXURL,\n};\n\n/*\n * From RFC 6455\n   1000\n\n      1000 indicates a normal closure, meaning that the purpose for\n      which the connection was established has been fulfilled.\n\n   1001\n\n      1001 indicates that an endpoint is \"going away\", such as a server\n      going down or a browser having navigated away from a page.\n\n   1002\n\n      1002 indicates that an endpoint is terminating the connection due\n      to a protocol error.\n\n   1003\n\n      1003 indicates that an endpoint is terminating the connection\n      because it has received a type of data it cannot accept (e.g., an\n      endpoint that understands only text data MAY send this if it\n      receives a binary message).\n\n   1004\n\n      Reserved.  The specific meaning might be defined in the future.\n\n   1005\n\n      1005 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that no status\n      code was actually present.\n\n   1006\n\n      1006 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed abnormally, e.g., without sending or\n      receiving a Close control frame.\n\n   1007\n\n      1007 indicates that an endpoint is terminating the connection\n      because it has received data within a message that was not\n      consistent with the type of the message (e.g., non-UTF-8 [RFC3629]\n      data within a text message).\n\n   1008\n\n      1008 indicates that an endpoint is terminating the connection\n      because it has received a message that violates its policy.  This\n      is a generic status code that can be returned when there is no\n      other more suitable status code (e.g., 1003 or 1009) or if there\n      is a need to hide specific details about the policy.\n\n   1009\n\n      1009 indicates that an endpoint is terminating the connection\n      because it has received a message that is too big for it to\n      process.\n\n   1010\n\n      1010 indicates that an endpoint (client) is terminating the\n      connection because it has expected the server to negotiate one or\n      more extension, but the server didn't return them in the response\n      message of the WebSocket handshake.  The list of extensions that\n      are needed SHOULD appear in the /reason/ part of the Close frame.\n      Note that this status code is not used by the server, because it\n      can fail the WebSocket handshake instead.\n\n   1011\n\n      1011 indicates that a server is terminating the connection because\n      it encountered an unexpected condition that prevented it from\n      fulfilling the request.\n\n   1015\n\n      1015 is a reserved value and MUST NOT be set as a status code in a\n      Close control frame by an endpoint.  It is designated for use in\n      applications expecting a status code to indicate that the\n      connection was closed due to a failure to perform a TLS handshake\n      (e.g., the server certificate can't be verified).\n*/\n\nenum lws_close_status {\n\tLWS_CLOSE_STATUS_NOSTATUS = 0,\n\tLWS_CLOSE_STATUS_NORMAL = 1000,\n\tLWS_CLOSE_STATUS_GOINGAWAY = 1001,\n\tLWS_CLOSE_STATUS_PROTOCOL_ERR = 1002,\n\tLWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003,\n\tLWS_CLOSE_STATUS_RESERVED = 1004,\n\tLWS_CLOSE_STATUS_NO_STATUS = 1005,\n\tLWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006,\n\tLWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007,\n\tLWS_CLOSE_STATUS_POLICY_VIOLATION = 1008,\n\tLWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009,\n\tLWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010,\n\tLWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011,\n\tLWS_CLOSE_STATUS_TLS_FAILURE = 1015,\n};\n\nstruct libwebsocket;\nstruct libwebsocket_context;\n/* needed even with extensions disabled for create context */\nstruct libwebsocket_extension;\n\n/**\n * callback_function() - User server actions\n * @context:\tWebsockets context\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tThis callback is the way the user controls what is served.  All the\n *\tprotocol detail is hidden and handled by the library.\n *\n *\tFor each connection / session there is user data allocated that is\n *\tpointed to by \"user\".  You set the size of this user data area when\n *\tthe library is initialized with libwebsocket_create_server.\n *\n *\tYou get an opportunity to initialize user data when called back with\n *\tLWS_CALLBACK_ESTABLISHED reason.\n *\n *  LWS_CALLBACK_ESTABLISHED:  after the server completes a handshake with\n *\t\t\t\tan incoming client\n *\n *  LWS_CALLBACK_CLIENT_CONNECTION_ERROR: the request client connection has\n *        been unable to complete a handshake with the remote server\n *\n *  LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH: this is the last chance for the\n *\t\t\t\tclient user code to examine the http headers\n *\t\t\t\tand decide to reject the connection.  If the\n *\t\t\t\tcontent in the headers is interesting to the\n *\t\t\t\tclient (url, etc) it needs to copy it out at\n *\t\t\t\tthis point since it will be destroyed before\n *\t\t\t\tthe CLIENT_ESTABLISHED call\n *\n *  LWS_CALLBACK_CLIENT_ESTABLISHED: after your client connection completed\n *\t\t\t\ta handshake with the remote server\n *\n *\tLWS_CALLBACK_CLOSED: when the websocket session ends\n *\n *\tLWS_CALLBACK_RECEIVE: data has appeared for this server endpoint from a\n *\t\t\t\tremote client, it can be found at *in and is\n *\t\t\t\tlen bytes long\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE_PONG: if you elected to see PONG packets,\n *\t\t\t\tthey appear with this callback reason.  PONG\n *\t\t\t\tpackets only exist in 04+ protocol\n *\n *\tLWS_CALLBACK_CLIENT_RECEIVE: data has appeared from the server for the\n *\t\t\t\tclient connection, it can be found at *in and\n *\t\t\t\tis len bytes long\n *\n *\tLWS_CALLBACK_HTTP: an http request has come from a client that is not\n *\t\t\t\tasking to upgrade the connection to a websocket\n *\t\t\t\tone.  This is a chance to serve http content,\n *\t\t\t\tfor example, to send a script to the client\n *\t\t\t\twhich will then open the websockets connection.\n *\t\t\t\t@in points to the URI path requested and\n *\t\t\t\tlibwebsockets_serve_http_file() makes it very\n *\t\t\t\tsimple to send back a file to the client.\n *\t\t\t\tNormally after sending the file you are done\n *\t\t\t\twith the http connection, since the rest of the\n *\t\t\t\tactivity will come by websockets from the script\n *\t\t\t\tthat was delivered by http, so you will want to\n *\t\t\t\treturn 1; to close and free up the connection.\n *\t\t\t\tThat's important because it uses a slot in the\n *\t\t\t\ttotal number of client connections allowed set\n *\t\t\t\tby MAX_CLIENTS.\n *\n *\tLWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol\n *\t\tlink now.\n *\n *\tLWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down\n *\t\t\t\thttp link has completed.\n *\n *\tLWS_CALLBACK_CLIENT_WRITEABLE:\n *      LWS_CALLBACK_SERVER_WRITEABLE:   If you call\n *\t\tlibwebsocket_callback_on_writable() on a connection, you will\n *\t\tget one of these callbacks coming when the connection socket\n *\t\tis able to accept another write packet without blocking.\n *\t\tIf it already was able to take another packet without blocking,\n *\t\tyou'll get this callback at the next call to the service loop\n *\t\tfunction.  Notice that CLIENTs get LWS_CALLBACK_CLIENT_WRITEABLE\n *\t\tand servers get LWS_CALLBACK_SERVER_WRITEABLE.\n *\n *\tLWS_CALLBACK_FILTER_NETWORK_CONNECTION: called when a client connects to\n *\t\tthe server at network level; the connection is accepted but then\n *\t\tpassed to this callback to decide whether to hang up immediately\n *\t\tor not, based on the client IP.  @in contains the connection\n *\t\tsocket's descriptor.  Return non-zero to terminate\n *\t\tthe connection before sending or receiving anything.\n *\t\tBecause this happens immediately after the network connection\n *\t\tfrom the client, there's no websocket protocol selected yet so\n *\t\tthis callback is issued only to protocol 0.\n *\n *\tLWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: called when the handshake has\n *\t\tbeen received and parsed from the client, but the response is\n *\t\tnot sent yet.  Return non-zero to disallow the connection.\n *\t\t@user is a pointer to an array of struct lws_tokens, you can\n *\t\tuse the header enums lws_token_indexes from libwebsockets.h\n *\t\tto check for and read the supported header presence and\n *\t\tcontent before deciding to allow the handshake to proceed or\n *\t\tto kill the connection.\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto perform extra SSL_CTX_load_verify_locations() or similar\n *\t\tcalls to direct OpenSSL where to find certificates the client\n *\t\tcan use to confirm the remote server identity.  @user is the\n *\t\tOpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS: if configured for\n *\t\tincluding OpenSSL support, this callback allows your user code\n *\t\tto load extra certifcates into the server which allow it to\n *\t\tverify the validity of certificates returned by clients.  @user\n *\t\tis the server's OpenSSL SSL_CTX*\n *\n *\tLWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION: if the\n *\t\tlibwebsockets context was created with the option\n *\t\tLWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT, then this\n *\t\tcallback is generated during OpenSSL verification of the cert\n *\t\tsent from the client.  It is sent to protocol[0] callback as\n *\t\tno protocol has been negotiated on the connection yet.\n *\t\tNotice that the libwebsockets context and wsi are both NULL\n *\t\tduring this callback.  See\n *\t\t http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html\n *\t\tto understand more detail about the OpenSSL callback that\n *\t\tgenerates this libwebsockets callback and the meanings of the\n *\t\targuments passed.  In this callback, @user is the x509_ctx,\n *\t\t@in is the ssl pointer and @len is preverify_ok\n *\t\tNotice that this callback maintains libwebsocket return\n *\t\tconventions, return 0 to mean the cert is OK or 1 to fail it.\n *\t\tThis also means that if you don't handle this callback then\n *\t\tthe default callback action of returning 0 allows the client\n *\t\tcertificates.\n *\n *\tLWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER: this callback happens\n *\t\twhen a client handshake is being compiled.  @user is NULL,\n *\t\t@in is a char **, it's pointing to a char * which holds the\n *\t\tnext location in the header buffer where you can add\n *\t\theaders, and @len is the remaining space in the header buffer,\n *\t\twhich is typically some hundreds of bytes.  So, to add a canned\n *\t\tcookie, your handler code might look similar to:\n *\n *\t\tchar **p = (char **)in;\n *\n *\t\tif (len < 100)\n *\t\t\treturn 1;\n *\n *\t\t*p += sprintf(*p, \"Cookie: a=b\\x0d\\x0a\");\n *\n *\t\treturn 0;\n *\n *\t\tNotice if you add anything, you just have to take care about\n *\t\tthe CRLF on the line you added.  Obviously this callback is\n *\t\toptional, if you don't handle it everything is fine.\n *\n *\t\tNotice the callback is coming to protocols[0] all the time,\n *\t\tbecause there is no specific protocol handshook yet.\n *\n *\tLWS_CALLBACK_CONFIRM_EXTENSION_OKAY: When the server handshake code\n *\t\tsees that it does support a requested extension, before\n *\t\taccepting the extension by additing to the list sent back to\n *\t\tthe client it gives this callback just to check that it's okay\n *\t\tto use that extension.  It calls back to the requested protocol\n *\t\tand with @in being the extension name, @len is 0 and @user is\n *\t\tvalid.  Note though at this time the ESTABLISHED callback hasn't\n *\t\thappened yet so if you initialize @user content there, @user\n *\t\tcontent during this callback might not be useful for anything.\n *\t\tNotice this callback comes to protocols[0].\n *\n *\tLWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED:\tWhen a client\n *\t\tconnection is being prepared to start a handshake to a server,\n *\t\teach supported extension is checked with protocols[0] callback\n *\t\twith this reason, giving the user code a chance to suppress the\n *\t\tclaim to support that extension by returning non-zero.  If\n *\t\tunhandled, by default 0 will be returned and the extension\n *\t\tsupport included in the header to the server.  Notice this\n *\t\tcallback comes to protocols[0].\n *\n *\tLWS_CALLBACK_PROTOCOL_INIT:\tOne-time call per protocol so it can\n *\t\tdo initial setup / allocations etc\n *\n *\tLWS_CALLBACK_PROTOCOL_DESTROY:\tOne-time call per protocol indicating\n *\t\tthis protocol won't get used at all after this callback, the\n *\t\tcontext is getting destroyed.  Take the opportunity to\n *\t\tdeallocate everything that was allocated by the protocol.\n *\n *\tThe next four reasons are optional and only need taking care of if you\n *\twill be integrating libwebsockets sockets into an external polling\n *\tarray.\n *\n *\tLWS_CALLBACK_ADD_POLL_FD: libwebsocket deals with its poll() loop\n *\t\tinternally, but in the case you are integrating with another\n *\t\tserver you will need to have libwebsocket sockets share a\n *\t\tpolling array with the other server.  This and the other\n *\t\tPOLL_FD related callbacks let you put your specialized\n *\t\tpoll array interface code in the callback for protocol 0, the\n *\t\tfirst protocol you support, usually the HTTP protocol in the\n *\t\tserving case.  This callback happens when a socket needs to be\n *\t\tadded to the polling loop: @in contains the fd, and\n *\t\t@len is the events bitmap (like, POLLIN).  If you are using the\n *\t\tinternal polling loop (the \"service\" callback), you can just\n *\t\tignore these callbacks.\n *\n *\tLWS_CALLBACK_DEL_POLL_FD: This callback happens when a socket descriptor\n *\t\tneeds to be removed from an external polling array.  @in is\n *\t\tthe socket desricptor.  If you are using the internal polling\n *\t\tloop, you can just ignore it.\n *\n *\tLWS_CALLBACK_SET_MODE_POLL_FD: This callback happens when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should OR @len on to the events member of the pollfd\n *\t\tstruct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n *\n *\tLWS_CALLBACK_CLEAR_MODE_POLL_FD: This callback occurs when libwebsockets\n *\t\twants to modify the events for the socket descriptor in @in.\n *\t\tThe handler should AND ~@len on to the events member of the\n *\t\tpollfd struct for this socket descriptor.  If you are using the\n *\t\tinternal polling loop, you can just ignore it.\n */\nLWS_VISIBLE LWS_EXTERN int callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\ntypedef int (callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\t enum libwebsocket_callback_reasons reason, void *user,\n\t\t\t\t\t\t\t  void *in, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * extension_callback_function() - Hooks to allow extensions to operate\n * @context:\tWebsockets context\n * @ext:\tThis extension\n * @wsi:\tOpaque websocket instance pointer\n * @reason:\tThe reason for the call\n * @user:\tPointer to per-session user data allocated by library\n * @in:\t\tPointer used for some callback reasons\n * @len:\tLength set for some callback reasons\n *\n *\tEach extension that is active on a particular connection receives\n *\tcallbacks during the connection lifetime to allow the extension to\n *\toperate on websocket data and manage itself.\n *\n *\tLibwebsockets takes care of allocating and freeing \"user\" memory for\n *\teach active extension on each connection.  That is what is pointed to\n *\tby the @user parameter.\n *\n *\tLWS_EXT_CALLBACK_CONSTRUCT:  called when the server has decided to\n *\t\tselect this extension from the list provided by the client,\n *\t\tjust before the server will send back the handshake accepting\n *\t\tthe connection with this extension active.  This gives the\n *\t\textension a chance to initialize its connection context found\n *\t\tin @user.\n *\n *\tLWS_EXT_CALLBACK_CLIENT_CONSTRUCT: same as LWS_EXT_CALLBACK_CONSTRUCT\n *\t\tbut called when client is instantiating this extension.  Some\n *\t\textensions will work the same on client and server side and then\n *\t\tyou can just merge handlers for both CONSTRUCTS.\n *\n *\tLWS_EXT_CALLBACK_DESTROY:  called when the connection the extension was\n *\t\tbeing used on is about to be closed and deallocated.  It's the\n *\t\tlast chance for the extension to deallocate anything it has\n *\t\tallocated in the user data (pointed to by @user) before the\n *\t\tuser data is deleted.  This same callback is used whether you\n *\t\tare in client or server instantiation context.\n *\n *\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE: when this extension was active on\n *\t\ta connection, and a packet of data arrived at the connection,\n *\t\tit is passed to this callback to give the extension a chance to\n *\t\tchange the data, eg, decompress it.  @user is pointing to the\n *\t\textension's private connection context data, @in is pointing\n *\t\tto an lws_tokens struct, it consists of a char * pointer called\n *\t\ttoken, and an int called token_len.  At entry, these are\n *\t\tset to point to the received buffer and set to the content\n *\t\tlength.  If the extension will grow the content, it should use\n *\t\ta new buffer allocated in its private user context data and\n *\t\tset the pointed-to lws_tokens members to point to its buffer.\n *\n *\tLWS_EXT_CALLBACK_PACKET_TX_PRESEND: this works the same way as\n *\t\tLWS_EXT_CALLBACK_PACKET_RX_PREPARSE above, except it gives the\n *\t\textension a chance to change websocket data just before it will\n *\t\tbe sent out.  Using the same lws_token pointer scheme in @in,\n *\t\tthe extension can change the buffer and the length to be\n *\t\ttransmitted how it likes.  Again if it wants to grow the\n *\t\tbuffer safely, it should copy the data into its own buffer and\n *\t\tset the lws_tokens token pointer to it.\n */\nLWS_VISIBLE LWS_EXTERN int extension_callback(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n\ntypedef int (extension_callback_function)(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket_extension *ext,\n\t\t\tstruct libwebsocket *wsi,\n\t\t\tenum libwebsocket_extension_callback_reasons reason,\n\t\t\tvoid *user, void *in, size_t len);\n#endif\n\n/**\n * struct libwebsocket_protocols -\tList of protocols and handlers server\n *\t\t\t\t\tsupports.\n * @name:\tProtocol name that must match the one given in the client\n *\t\tJavascript new WebSocket(url, 'protocol') name\n * @callback:\tThe service callback used for this protocol.  It allows the\n *\t\tservice action for an entire protocol to be encapsulated in\n *\t\tthe protocol-specific callback\n * @per_session_data_size:\tEach new connection using this protocol gets\n *\t\tthis much memory allocated on connection establishment and\n *\t\tfreed on connection takedown.  A pointer to this per-connection\n *\t\tallocation is passed into the callback in the 'user' parameter\n * @rx_buffer_size: if you want atomic frames delivered to the callback, you\n *\t\tshould set this to the size of the biggest legal frame that\n *\t\tyou support.  If the frame size is exceeded, there is no\n *\t\terror, but the buffer will spill to the user callback when\n *\t\tfull, which you can detect by using\n *\t\tlibwebsockets_remaining_packet_payload().  Notice that you\n *\t\tjust talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING\n *\t\tand post-padding are automatically also allocated on top.\n * @owning_server:\tthe server init call fills in this opaque pointer when\n *\t\tregistering this protocol with the server.\n * @protocol_index: which protocol we are starting from zero\n *\n *\tThis structure represents one protocol supported by the server.  An\n *\tarray of these structures is passed to libwebsocket_create_server()\n *\tallows as many protocols as you like to be handled by one server.\n */\n\nstruct libwebsocket_protocols {\n\tconst char *name;\n\tcallback_function *callback;\n\tsize_t per_session_data_size;\n\tsize_t rx_buffer_size;\n\n\t/*\n\t * below are filled in on server init and can be left uninitialized,\n\t * no need for user to use them directly either\n\t */\n\n\tstruct libwebsocket_context *owning_server;\n\tint protocol_index;\n};\n\n#ifndef LWS_NO_EXTENSIONS\n/**\n * struct libwebsocket_extension -\tAn extension we know how to cope with\n *\n * @name:\t\t\tFormal extension name, eg, \"deflate-stream\"\n * @callback:\t\t\tService callback\n * @per_session_data_size:\tLibwebsockets will auto-malloc this much\n *\t\t\t\tmemory for the use of the extension, a pointer\n *\t\t\t\tto it comes in the @user callback parameter\n * @per_context_private_data:   Optional storage for this extension that\n *\t\t\t\tis per-context, so it can track stuff across\n *\t\t\t\tall sessions, etc, if it wants\n */\n\nstruct libwebsocket_extension {\n\tconst char *name;\n\textension_callback_function *callback;\n\tsize_t per_session_data_size;\n\tvoid *per_context_private_data;\n};\n#endif\n\n/**\n * struct lws_context_creation_info: parameters to create context with\n *\n * @port:\tPort to listen on... you can use 0 to suppress listening on\n *\t\tany port, that's what you want if you are not running a\n *\t\twebsocket server at all but just using it as a client\n * @iface:\tNULL to bind the listen socket to all interfaces, or the\n *\t\tinterface name, eg, \"eth2\"\n * @protocols:\tArray of structures listing supported protocols and a protocol-\n *\t\tspecific callback for each one.  The list is ended with an\n *\t\tentry that has a NULL callback pointer.\n *\t\tIt's not const because we write the owning_server member\n * @extensions: NULL or array of libwebsocket_extension structs listing the\n *\t\textensions this context supports.  If you configured with\n *\t\t--without-extensions, you should give NULL here.\n * @ssl_cert_filepath:\tIf libwebsockets was compiled to use ssl, and you want\n *\t\t\tto listen using SSL, set to the filepath to fetch the\n *\t\t\tserver cert from, otherwise NULL for unencrypted\n * @ssl_private_key_filepath: filepath to private key if wanting SSL mode,\n *\t\t\telse ignored\n * @ssl_ca_filepath: CA certificate filepath or NULL\n * @ssl_cipher_list:\tList of valid ciphers to use (eg,\n * \t\t\t\"RC4-MD5:RC4-SHA:AES128-SHA:AES256-SHA:HIGH:!DSS:!aNULL\"\n * \t\t\tor you can leave it as NULL to get \"DEFAULT\"\n * @gid:\tgroup id to change to after setting listen socket, or -1.\n * @uid:\tuser id to change to after setting listen socket, or -1.\n * @options:\t0, or LWS_SERVER_OPTION_DEFEAT_CLIENT_MASK\n * @user:\toptional user pointer that can be recovered via the context\n *\t\tpointer using libwebsocket_context_user\n * @ka_time:\t0 for no keepalive, otherwise apply this keepalive timeout to\n *\t\tall libwebsocket sockets, client or server\n * @ka_probes:\tif ka_time was nonzero, after the timeout expires how many\n *\t\ttimes to try to get a response from the peer before giving up\n *\t\tand killing the connection\n * @ka_interval: if ka_time was nonzero, how long to wait before each ka_probes\n *\t\tattempt\n */\n\nstruct lws_context_creation_info {\n\tint port;\n\tconst char *iface;\n\tstruct libwebsocket_protocols *protocols;\n\tstruct libwebsocket_extension *extensions;\n\tconst char *ssl_cert_filepath;\n\tconst char *ssl_private_key_filepath;\n\tconst char *ssl_ca_filepath;\n\tconst char *ssl_cipher_list;\n\tint gid;\n\tint uid;\n\tunsigned int options;\n\tvoid *user;\n\tint ka_time;\n\tint ka_probes;\n\tint ka_interval;\n\n};\n\nLWS_VISIBLE LWS_EXTERN\nvoid lws_set_log_level(int level,\n\t\t\tvoid (*log_emit_function)(int level, const char *line));\n\nLWS_VISIBLE LWS_EXTERN void\nlwsl_emit_syslog(int level, const char *line);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_context *\nlibwebsocket_create_context(struct lws_context_creation_info *info);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_context_destroy(struct libwebsocket_context *context);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service(struct libwebsocket_context *context, int timeout_ms);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_service_fd(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t struct pollfd *pollfd);\n\nLWS_VISIBLE LWS_EXTERN void *\nlibwebsocket_context_user(struct libwebsocket_context *context);\n\n/*\n * IMPORTANT NOTICE!\n *\n * When sending with websocket protocol (LWS_WRITE_TEXT or LWS_WRITE_BINARY)\n * the send buffer has to have LWS_SEND_BUFFER_PRE_PADDING bytes valid BEFORE\n * buf, and LWS_SEND_BUFFER_POST_PADDING bytes valid AFTER (buf + len).\n *\n * This allows us to add protocol info before and after the data, and send as\n * one packet on the network without payload copying, for maximum efficiency.\n *\n * So for example you need this kind of code to use libwebsocket_write with a\n * 128-byte payload\n *\n *   char buf[LWS_SEND_BUFFER_PRE_PADDING + 128 + LWS_SEND_BUFFER_POST_PADDING];\n *\n *   // fill your part of the buffer... for example here it's all zeros\n *   memset(&buf[LWS_SEND_BUFFER_PRE_PADDING], 0, 128);\n *\n *   libwebsocket_write(wsi, &buf[LWS_SEND_BUFFER_PRE_PADDING], 128,\n *   \t\t\t\t\t\t\t\tLWS_WRITE_TEXT);\n *\n * When sending LWS_WRITE_HTTP, there is no protocol addition and you can just\n * use the whole buffer without taking care of the above.\n */\n\n/*\n * this is the frame nonce plus two header plus 8 length\n *   there's an additional two for mux extension per mux nesting level\n * 2 byte prepend on close will already fit because control frames cannot use\n * the big length style\n */\n\n#define LWS_SEND_BUFFER_PRE_PADDING (4 + 10 + (2 * MAX_MUX_RECURSION))\n#define LWS_SEND_BUFFER_POST_PADDING 4\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len,\n\t\t\t\t     enum libwebsocket_write_protocol protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi, const char *file,\n\t\t\t\t\t\t     const char *content_type);\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_serve_http_file_fragment(struct libwebsocket_context *context,\n\t\t\tstruct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN const struct libwebsocket_protocols *\nlibwebsockets_get_protocol(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable(struct libwebsocket_context *context,\n\t\t\t\t\t\t      struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_callback_on_writable_all_protocol(\n\t\t\t\t const struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_get_socket_fd(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_is_final_fragment(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char\nlibwebsocket_get_reserved_bits(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_rx_flow_control(struct libwebsocket *wsi, int enable);\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsocket_rx_flow_allow_all_protocol(\n\t\t\t\tconst struct libwebsocket_protocols *protocol);\n\nLWS_VISIBLE LWS_EXTERN size_t\nlibwebsockets_remaining_packet_payload(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one);\n\nLWS_VISIBLE LWS_EXTERN struct libwebsocket *\nlibwebsocket_client_connect_extended(struct libwebsocket_context *clients,\n\t\t\t      const char *address,\n\t\t\t      int port,\n\t\t\t      int ssl_connection,\n\t\t\t      const char *path,\n\t\t\t      const char *host,\n\t\t\t      const char *origin,\n\t\t\t      const char *protocol,\n\t\t\t      int ietf_version_or_minus_one,\n\t\t\t      void *userdata);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlibwebsocket_canonical_hostname(struct libwebsocket_context *context);\n\n\nLWS_VISIBLE LWS_EXTERN void\nlibwebsockets_get_peer_addresses(struct libwebsocket_context *context,\n\t\tstruct libwebsocket *wsi, int fd, char *name, int name_len,\n\t\t\t\t\tchar *rip, int rip_len);\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsockets_get_random(struct libwebsocket_context *context,\n\t\t\t\t\t\t\t    void *buf, int len);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_daemonize(const char *_lock_path);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_send_pipe_choked(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_frame_is_binary(struct libwebsocket *wsi);\n\nLWS_VISIBLE LWS_EXTERN unsigned char *\nlibwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_encode_string(const char *in, int in_len, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_b64_decode_string(const char *in, char *out, int out_size);\n\nLWS_VISIBLE LWS_EXTERN const char *\nlws_get_library_version(void);\n\n/* access to headers... only valid while headers valid */\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_total_length(struct libwebsocket *wsi, enum lws_token_indexes h);\n\nLWS_VISIBLE LWS_EXTERN int\nlws_hdr_copy(struct libwebsocket *wsi, char *dest, int len,\n\t\t\t\t\t\tenum lws_token_indexes h);\n\n/*\n * Note: this is not normally needed as a user api.  It's provided in case it is\n * useful when integrating with other app poll loop service code.\n */\n\nLWS_VISIBLE LWS_EXTERN int\nlibwebsocket_read(struct libwebsocket_context *context,\n\t\t\t\tstruct libwebsocket *wsi,\n\t\t\t\t\t       unsigned char *buf, size_t len);\n\n#ifndef LWS_NO_EXTENSIONS\nLWS_VISIBLE LWS_EXTERN struct libwebsocket_extension *libwebsocket_get_internal_extensions();\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/websockets/include/win32/win32helpers/gettimeofday.h",
    "content": "#ifndef _GET_TIME_OF_DAY_H\n#define _GET_TIME_OF_DAY_H\n\n#ifdef  __MINGW64__\n#else\n#ifdef  __MINGW32__\n#else\n#include < time.h >\n#endif\n#endif\n\n#include <windows.h> //I've ommited context line.\n#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)\n  #define DELTA_EPOCH_IN_MICROSECS  11644473600000000Ui64\n#else\n  #define DELTA_EPOCH_IN_MICROSECS  11644473600000000ULL\n#endif\n \nstruct timezone \n{\n  int  tz_minuteswest; /* minutes W of Greenwich */\n  int  tz_dsttime;     /* type of dst correction */\n};\n \nint gettimeofday(struct timeval *tv, struct timezone *tz);\n\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/websockets/include/win32/win32helpers/websock-w32.h",
    "content": "#ifndef __WEB_SOCK_W32_H__\n#define __WEB_SOCK_W32_H__\n\n// Windows uses _DEBUG and NDEBUG\n#ifdef _DEBUG\n#undef DEBUG\n#define DEBUG 1\n#endif\n\n#pragma warning(disable : 4996)\n\n#define bzero(b,len) (memset((b), '\\0', (len)), (void) 0)\n\n#define MSG_NOSIGNAL 0\n#define SHUT_RDWR SD_BOTH\n\n#define SOL_TCP IPPROTO_TCP\n\n#define random rand\n#define usleep _sleep\n\n#ifdef  __MINGW64__                                                             \n#define DEF_POLL_STUFF\n#endif\n#ifdef  __MINGW32__                                                             \n#define DEF_POLL_STUFF\n#endif\n\n#ifdef DEF_POLL_STUFF\n\n#include <winsock2.h>\n\ntypedef struct pollfd {\n\tSOCKET fd;\n\tshort  events;\n\tshort  revents;\n} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;\n\n#define POLLIN      0x0001      /* any readable data available   */\n#define POLLOUT     0x0004      /* file descriptor is writeable  */\n#define POLLERR     0x0008      /* some poll error occurred      */\n#define POLLHUP     0x0010      /* file descriptor was \"hung up\" */\n#define POLLNVAL    0x0020\t\t/* requested events \"invalid\"    */\n\n#endif\n\ntypedef INT (WSAAPI *PFNWSAPOLL)(LPWSAPOLLFD fdarray, ULONG nfds, INT timeout);\nextern PFNWSAPOLL poll;\n\nextern INT WSAAPI emulated_poll(LPWSAPOLLFD fdarray, ULONG nfds, INT timeout);\n\n/* override configure because we are not using Makefiles */\n\n#define LWS_NO_FORK\n\n/* windows can't cope with this idea, needs assets in cwd */\n\n#ifndef INSTALL_DATADIR\n#define INSTALL_DATADIR \".\"\n#endif\n\n#endif\n"
  },
  {
    "path": "cocos2d/external/websockets/prebuilt/android/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\nLOCAL_MODULE    := websockets_static\nLOCAL_MODULE_FILENAME := libwebsockets_static\nLOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libwebsockets.a\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include/android\nLOCAL_CPPFLAGS := -D__STDC_LIMIT_MACROS=1\nLOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1\ninclude $(PREBUILT_STATIC_LIBRARY)\n"
  },
  {
    "path": "cocos2d/external/win32-specific/gles/include/OGLES/GL/glew.h",
    "content": "/*\n** The OpenGL Extension Wrangler Library\n** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\n** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\n** Copyright (C) 2002, Lev Povalahev\n** All rights reserved.\n** \n** Redistribution and use in source and binary forms, with or without \n** modification, are permitted provided that the following conditions are met:\n** \n** * Redistributions of source code must retain the above copyright notice, \n**   this list of conditions and the following disclaimer.\n** * Redistributions in binary form must reproduce the above copyright notice, \n**   this list of conditions and the following disclaimer in the documentation \n**   and/or other materials provided with the distribution.\n** * The name of the author may be used to endorse or promote products \n**   derived from this software without specific prior written permission.\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \n** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n** THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*\n * Mesa 3-D graphics library\n * Version:  7.0\n *\n * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/*\n** Copyright (c) 2007 The Khronos Group Inc.\n** \n** Permission is hereby granted, free of charge, to any person obtaining a\n** copy of this software and/or associated documentation files (the\n** \"Materials\"), to deal in the Materials without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Materials, and to\n** permit persons to whom the Materials are furnished to do so, subject to\n** the following conditions:\n** \n** The above copyright notice and this permission notice shall be included\n** in all copies or substantial portions of the Materials.\n** \n** THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n*/\n\n#ifndef __glew_h__\n#define __glew_h__\n#define __GLEW_H__\n\n#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H)\n#error gl.h included before glew.h\n#endif\n#if defined(__glext_h_) || defined(__GLEXT_H_)\n#error glext.h included before glew.h\n#endif\n#if defined(__gl_ATI_h_)\n#error glATI.h included before glew.h\n#endif\n\n#define __gl_h_\n#define __GL_H__\n#define __X_GL_H\n#define __glext_h_\n#define __GLEXT_H_\n#define __gl_ATI_h_\n\n#if defined(_WIN32)\n\n/*\n * GLEW does not include <windows.h> to avoid name space pollution.\n * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t\n * defined properly.\n */\n/* <windef.h> */\n#ifndef APIENTRY\n#define GLEW_APIENTRY_DEFINED\n#  if defined(__MINGW32__) || defined(__CYGWIN__)\n#    define APIENTRY __stdcall\n#  elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)\n#    define APIENTRY __stdcall\n#  else\n#    define APIENTRY\n#  endif\n#endif\n#ifndef GLAPI\n#  if defined(__MINGW32__) || defined(__CYGWIN__)\n#    define GLAPI extern\n#  endif\n#endif\n/* <winnt.h> */\n#ifndef CALLBACK\n#define GLEW_CALLBACK_DEFINED\n#  if defined(__MINGW32__) || defined(__CYGWIN__)\n#    define CALLBACK __attribute__ ((__stdcall__))\n#  elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)\n#    define CALLBACK __stdcall\n#  else\n#    define CALLBACK\n#  endif\n#endif\n/* <wingdi.h> and <winnt.h> */\n#ifndef WINGDIAPI\n#define GLEW_WINGDIAPI_DEFINED\n#define WINGDIAPI __declspec(dllimport)\n#endif\n/* <ctype.h> */\n#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED)\ntypedef unsigned short wchar_t;\n#  define _WCHAR_T_DEFINED\n#endif\n/* <stddef.h> */\n#if !defined(_W64)\n#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300\n#    define _W64 __w64\n#  else\n#    define _W64\n#  endif\n#endif\n#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__)\n#  ifdef _WIN64\ntypedef __int64 ptrdiff_t;\n#  else\ntypedef _W64 int ptrdiff_t;\n#  endif\n#  define _PTRDIFF_T_DEFINED\n#  define _PTRDIFF_T_\n#endif\n\n#ifndef GLAPI\n#  if defined(__MINGW32__) || defined(__CYGWIN__)\n#    define GLAPI extern\n#  else\n#    define GLAPI WINGDIAPI\n#  endif\n#endif\n\n#ifndef GLAPIENTRY\n#define GLAPIENTRY APIENTRY\n#endif\n\n/*\n * GLEW_STATIC is defined for static library.\n * GLEW_BUILD  is defined for building the DLL library.\n */\n\n#ifdef GLEW_STATIC\n#  define GLEWAPI extern\n#else\n#  ifdef GLEW_BUILD\n#    define GLEWAPI extern __declspec(dllexport)\n#  else\n#    define GLEWAPI extern __declspec(dllimport)\n#  endif\n#endif\n\n#else /* _UNIX */\n\n/*\n * Needed for ptrdiff_t in turn needed by VBO.  This is defined by ISO\n * C.  On my system, this amounts to _3 lines_ of included code, all of\n * them pretty much harmless.  If you know of a way of detecting 32 vs\n * 64 _targets_ at compile time you are free to replace this with\n * something that's portable.  For now, _this_ is the portable solution.\n * (mem, 2004-01-04)\n */\n\n#include <stddef.h>\n\n/* SGI MIPSPro doesn't like stdint.h in C++ mode          */\n/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */\n\n#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__)\n#include <inttypes.h>\n#else\n#include <stdint.h>\n#endif\n\n#define GLEW_APIENTRY_DEFINED\n#define APIENTRY\n\n/*\n * GLEW_STATIC is defined for static library.\n */\n\n#ifdef GLEW_STATIC\n#  define GLEWAPI extern\n#else\n#  if defined(__GNUC__) && __GNUC__>=4\n#   define GLEWAPI extern __attribute__ ((visibility(\"default\")))\n#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n#   define GLEWAPI extern __global\n#  else\n#   define GLEWAPI extern\n#  endif\n#endif\n\n/* <glu.h> */\n#ifndef GLAPI\n#define GLAPI extern\n#endif\n#ifndef GLAPIENTRY\n#define GLAPIENTRY\n#endif\n\n#endif /* _WIN32 */\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* ----------------------------- GL_VERSION_1_1 ---------------------------- */\n\n#ifndef GL_VERSION_1_1\n#define GL_VERSION_1_1 1\n\ntypedef unsigned int GLenum;\ntypedef unsigned int GLbitfield;\ntypedef unsigned int GLuint;\ntypedef int GLint;\ntypedef int GLsizei;\ntypedef unsigned char GLboolean;\ntypedef signed char GLbyte;\ntypedef short GLshort;\ntypedef unsigned char GLubyte;\ntypedef unsigned short GLushort;\ntypedef unsigned long GLulong;\ntypedef float GLfloat;\ntypedef float GLclampf;\ntypedef double GLdouble;\ntypedef double GLclampd;\ntypedef void GLvoid;\n#if defined(_MSC_VER) && _MSC_VER < 1400\ntypedef __int64 GLint64EXT;\ntypedef unsigned __int64 GLuint64EXT;\n#elif defined(_MSC_VER) || defined(__BORLANDC__)\ntypedef signed long long GLint64EXT;\ntypedef unsigned long long GLuint64EXT;\n#else\n#  if defined(__MINGW32__) || defined(__CYGWIN__)\n#include <inttypes.h>\n#  endif\ntypedef int64_t GLint64EXT;\ntypedef uint64_t GLuint64EXT;\n#endif\ntypedef GLint64EXT  GLint64;\ntypedef GLuint64EXT GLuint64;\ntypedef struct __GLsync *GLsync;\n\ntypedef char GLchar;\n\n#define GL_ZERO 0\n#define GL_FALSE 0\n#define GL_LOGIC_OP 0x0BF1\n#define GL_NONE 0\n#define GL_TEXTURE_COMPONENTS 0x1003\n#define GL_NO_ERROR 0\n#define GL_POINTS 0x0000\n#define GL_CURRENT_BIT 0x00000001\n#define GL_TRUE 1\n#define GL_ONE 1\n#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001\n#define GL_LINES 0x0001\n#define GL_LINE_LOOP 0x0002\n#define GL_POINT_BIT 0x00000002\n#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002\n#define GL_LINE_STRIP 0x0003\n#define GL_LINE_BIT 0x00000004\n#define GL_TRIANGLES 0x0004\n#define GL_TRIANGLE_STRIP 0x0005\n#define GL_TRIANGLE_FAN 0x0006\n#define GL_QUADS 0x0007\n#define GL_QUAD_STRIP 0x0008\n#define GL_POLYGON_BIT 0x00000008\n#define GL_POLYGON 0x0009\n#define GL_POLYGON_STIPPLE_BIT 0x00000010\n#define GL_PIXEL_MODE_BIT 0x00000020\n#define GL_LIGHTING_BIT 0x00000040\n#define GL_FOG_BIT 0x00000080\n#define GL_DEPTH_BUFFER_BIT 0x00000100\n#define GL_ACCUM 0x0100\n#define GL_LOAD 0x0101\n#define GL_RETURN 0x0102\n#define GL_MULT 0x0103\n#define GL_ADD 0x0104\n#define GL_NEVER 0x0200\n#define GL_ACCUM_BUFFER_BIT 0x00000200\n#define GL_LESS 0x0201\n#define GL_EQUAL 0x0202\n#define GL_LEQUAL 0x0203\n#define GL_GREATER 0x0204\n#define GL_NOTEQUAL 0x0205\n#define GL_GEQUAL 0x0206\n#define GL_ALWAYS 0x0207\n#define GL_SRC_COLOR 0x0300\n#define GL_ONE_MINUS_SRC_COLOR 0x0301\n#define GL_SRC_ALPHA 0x0302\n#define GL_ONE_MINUS_SRC_ALPHA 0x0303\n#define GL_DST_ALPHA 0x0304\n#define GL_ONE_MINUS_DST_ALPHA 0x0305\n#define GL_DST_COLOR 0x0306\n#define GL_ONE_MINUS_DST_COLOR 0x0307\n#define GL_SRC_ALPHA_SATURATE 0x0308\n#define GL_STENCIL_BUFFER_BIT 0x00000400\n#define GL_FRONT_LEFT 0x0400\n#define GL_FRONT_RIGHT 0x0401\n#define GL_BACK_LEFT 0x0402\n#define GL_BACK_RIGHT 0x0403\n#define GL_FRONT 0x0404\n#define GL_BACK 0x0405\n#define GL_LEFT 0x0406\n#define GL_RIGHT 0x0407\n#define GL_FRONT_AND_BACK 0x0408\n#define GL_AUX0 0x0409\n#define GL_AUX1 0x040A\n#define GL_AUX2 0x040B\n#define GL_AUX3 0x040C\n#define GL_INVALID_ENUM 0x0500\n#define GL_INVALID_VALUE 0x0501\n#define GL_INVALID_OPERATION 0x0502\n#define GL_STACK_OVERFLOW 0x0503\n#define GL_STACK_UNDERFLOW 0x0504\n#define GL_OUT_OF_MEMORY 0x0505\n#define GL_2D 0x0600\n#define GL_3D 0x0601\n#define GL_3D_COLOR 0x0602\n#define GL_3D_COLOR_TEXTURE 0x0603\n#define GL_4D_COLOR_TEXTURE 0x0604\n#define GL_PASS_THROUGH_TOKEN 0x0700\n#define GL_POINT_TOKEN 0x0701\n#define GL_LINE_TOKEN 0x0702\n#define GL_POLYGON_TOKEN 0x0703\n#define GL_BITMAP_TOKEN 0x0704\n#define GL_DRAW_PIXEL_TOKEN 0x0705\n#define GL_COPY_PIXEL_TOKEN 0x0706\n#define GL_LINE_RESET_TOKEN 0x0707\n#define GL_EXP 0x0800\n#define GL_VIEWPORT_BIT 0x00000800\n#define GL_EXP2 0x0801\n#define GL_CW 0x0900\n#define GL_CCW 0x0901\n#define GL_COEFF 0x0A00\n#define GL_ORDER 0x0A01\n#define GL_DOMAIN 0x0A02\n#define GL_CURRENT_COLOR 0x0B00\n#define GL_CURRENT_INDEX 0x0B01\n#define GL_CURRENT_NORMAL 0x0B02\n#define GL_CURRENT_TEXTURE_COORDS 0x0B03\n#define GL_CURRENT_RASTER_COLOR 0x0B04\n#define GL_CURRENT_RASTER_INDEX 0x0B05\n#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06\n#define GL_CURRENT_RASTER_POSITION 0x0B07\n#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08\n#define GL_CURRENT_RASTER_DISTANCE 0x0B09\n#define GL_POINT_SMOOTH 0x0B10\n#define GL_POINT_SIZE 0x0B11\n#define GL_POINT_SIZE_RANGE 0x0B12\n#define GL_POINT_SIZE_GRANULARITY 0x0B13\n#define GL_LINE_SMOOTH 0x0B20\n#define GL_LINE_WIDTH 0x0B21\n#define GL_LINE_WIDTH_RANGE 0x0B22\n#define GL_LINE_WIDTH_GRANULARITY 0x0B23\n#define GL_LINE_STIPPLE 0x0B24\n#define GL_LINE_STIPPLE_PATTERN 0x0B25\n#define GL_LINE_STIPPLE_REPEAT 0x0B26\n#define GL_LIST_MODE 0x0B30\n#define GL_MAX_LIST_NESTING 0x0B31\n#define GL_LIST_BASE 0x0B32\n#define GL_LIST_INDEX 0x0B33\n#define GL_POLYGON_MODE 0x0B40\n#define GL_POLYGON_SMOOTH 0x0B41\n#define GL_POLYGON_STIPPLE 0x0B42\n#define GL_EDGE_FLAG 0x0B43\n#define GL_CULL_FACE 0x0B44\n#define GL_CULL_FACE_MODE 0x0B45\n#define GL_FRONT_FACE 0x0B46\n#define GL_LIGHTING 0x0B50\n#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51\n#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52\n#define GL_LIGHT_MODEL_AMBIENT 0x0B53\n#define GL_SHADE_MODEL 0x0B54\n#define GL_COLOR_MATERIAL_FACE 0x0B55\n#define GL_COLOR_MATERIAL_PARAMETER 0x0B56\n#define GL_COLOR_MATERIAL 0x0B57\n#define GL_FOG 0x0B60\n#define GL_FOG_INDEX 0x0B61\n#define GL_FOG_DENSITY 0x0B62\n#define GL_FOG_START 0x0B63\n#define GL_FOG_END 0x0B64\n#define GL_FOG_MODE 0x0B65\n#define GL_FOG_COLOR 0x0B66\n#define GL_DEPTH_RANGE 0x0B70\n#define GL_DEPTH_TEST 0x0B71\n#define GL_DEPTH_WRITEMASK 0x0B72\n#define GL_DEPTH_CLEAR_VALUE 0x0B73\n#define GL_DEPTH_FUNC 0x0B74\n#define GL_ACCUM_CLEAR_VALUE 0x0B80\n#define GL_STENCIL_TEST 0x0B90\n#define GL_STENCIL_CLEAR_VALUE 0x0B91\n#define GL_STENCIL_FUNC 0x0B92\n#define GL_STENCIL_VALUE_MASK 0x0B93\n#define GL_STENCIL_FAIL 0x0B94\n#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95\n#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96\n#define GL_STENCIL_REF 0x0B97\n#define GL_STENCIL_WRITEMASK 0x0B98\n#define GL_MATRIX_MODE 0x0BA0\n#define GL_NORMALIZE 0x0BA1\n#define GL_VIEWPORT 0x0BA2\n#define GL_MODELVIEW_STACK_DEPTH 0x0BA3\n#define GL_PROJECTION_STACK_DEPTH 0x0BA4\n#define GL_TEXTURE_STACK_DEPTH 0x0BA5\n#define GL_MODELVIEW_MATRIX 0x0BA6\n#define GL_PROJECTION_MATRIX 0x0BA7\n#define GL_TEXTURE_MATRIX 0x0BA8\n#define GL_ATTRIB_STACK_DEPTH 0x0BB0\n#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1\n#define GL_ALPHA_TEST 0x0BC0\n#define GL_ALPHA_TEST_FUNC 0x0BC1\n#define GL_ALPHA_TEST_REF 0x0BC2\n#define GL_DITHER 0x0BD0\n#define GL_BLEND_DST 0x0BE0\n#define GL_BLEND_SRC 0x0BE1\n#define GL_BLEND 0x0BE2\n#define GL_LOGIC_OP_MODE 0x0BF0\n#define GL_INDEX_LOGIC_OP 0x0BF1\n#define GL_COLOR_LOGIC_OP 0x0BF2\n#define GL_AUX_BUFFERS 0x0C00\n#define GL_DRAW_BUFFER 0x0C01\n#define GL_READ_BUFFER 0x0C02\n#define GL_SCISSOR_BOX 0x0C10\n#define GL_SCISSOR_TEST 0x0C11\n#define GL_INDEX_CLEAR_VALUE 0x0C20\n#define GL_INDEX_WRITEMASK 0x0C21\n#define GL_COLOR_CLEAR_VALUE 0x0C22\n#define GL_COLOR_WRITEMASK 0x0C23\n#define GL_INDEX_MODE 0x0C30\n#define GL_RGBA_MODE 0x0C31\n#define GL_DOUBLEBUFFER 0x0C32\n#define GL_STEREO 0x0C33\n#define GL_RENDER_MODE 0x0C40\n#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50\n#define GL_POINT_SMOOTH_HINT 0x0C51\n#define GL_LINE_SMOOTH_HINT 0x0C52\n#define GL_POLYGON_SMOOTH_HINT 0x0C53\n#define GL_FOG_HINT 0x0C54\n#define GL_TEXTURE_GEN_S 0x0C60\n#define GL_TEXTURE_GEN_T 0x0C61\n#define GL_TEXTURE_GEN_R 0x0C62\n#define GL_TEXTURE_GEN_Q 0x0C63\n#define GL_PIXEL_MAP_I_TO_I 0x0C70\n#define GL_PIXEL_MAP_S_TO_S 0x0C71\n#define GL_PIXEL_MAP_I_TO_R 0x0C72\n#define GL_PIXEL_MAP_I_TO_G 0x0C73\n#define GL_PIXEL_MAP_I_TO_B 0x0C74\n#define GL_PIXEL_MAP_I_TO_A 0x0C75\n#define GL_PIXEL_MAP_R_TO_R 0x0C76\n#define GL_PIXEL_MAP_G_TO_G 0x0C77\n#define GL_PIXEL_MAP_B_TO_B 0x0C78\n#define GL_PIXEL_MAP_A_TO_A 0x0C79\n#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0\n#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1\n#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2\n#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3\n#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4\n#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5\n#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6\n#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7\n#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8\n#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9\n#define GL_UNPACK_SWAP_BYTES 0x0CF0\n#define GL_UNPACK_LSB_FIRST 0x0CF1\n#define GL_UNPACK_ROW_LENGTH 0x0CF2\n#define GL_UNPACK_SKIP_ROWS 0x0CF3\n#define GL_UNPACK_SKIP_PIXELS 0x0CF4\n#define GL_UNPACK_ALIGNMENT 0x0CF5\n#define GL_PACK_SWAP_BYTES 0x0D00\n#define GL_PACK_LSB_FIRST 0x0D01\n#define GL_PACK_ROW_LENGTH 0x0D02\n#define GL_PACK_SKIP_ROWS 0x0D03\n#define GL_PACK_SKIP_PIXELS 0x0D04\n#define GL_PACK_ALIGNMENT 0x0D05\n#define GL_MAP_COLOR 0x0D10\n#define GL_MAP_STENCIL 0x0D11\n#define GL_INDEX_SHIFT 0x0D12\n#define GL_INDEX_OFFSET 0x0D13\n#define GL_RED_SCALE 0x0D14\n#define GL_RED_BIAS 0x0D15\n#define GL_ZOOM_X 0x0D16\n#define GL_ZOOM_Y 0x0D17\n#define GL_GREEN_SCALE 0x0D18\n#define GL_GREEN_BIAS 0x0D19\n#define GL_BLUE_SCALE 0x0D1A\n#define GL_BLUE_BIAS 0x0D1B\n#define GL_ALPHA_SCALE 0x0D1C\n#define GL_ALPHA_BIAS 0x0D1D\n#define GL_DEPTH_SCALE 0x0D1E\n#define GL_DEPTH_BIAS 0x0D1F\n#define GL_MAX_EVAL_ORDER 0x0D30\n#define GL_MAX_LIGHTS 0x0D31\n#define GL_MAX_CLIP_PLANES 0x0D32\n#define GL_MAX_TEXTURE_SIZE 0x0D33\n#define GL_MAX_PIXEL_MAP_TABLE 0x0D34\n#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35\n#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36\n#define GL_MAX_NAME_STACK_DEPTH 0x0D37\n#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38\n#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39\n#define GL_MAX_VIEWPORT_DIMS 0x0D3A\n#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B\n#define GL_SUBPIXEL_BITS 0x0D50\n#define GL_INDEX_BITS 0x0D51\n#define GL_RED_BITS 0x0D52\n#define GL_GREEN_BITS 0x0D53\n#define GL_BLUE_BITS 0x0D54\n#define GL_ALPHA_BITS 0x0D55\n#define GL_DEPTH_BITS 0x0D56\n#define GL_STENCIL_BITS 0x0D57\n#define GL_ACCUM_RED_BITS 0x0D58\n#define GL_ACCUM_GREEN_BITS 0x0D59\n#define GL_ACCUM_BLUE_BITS 0x0D5A\n#define GL_ACCUM_ALPHA_BITS 0x0D5B\n#define GL_NAME_STACK_DEPTH 0x0D70\n#define GL_AUTO_NORMAL 0x0D80\n#define GL_MAP1_COLOR_4 0x0D90\n#define GL_MAP1_INDEX 0x0D91\n#define GL_MAP1_NORMAL 0x0D92\n#define GL_MAP1_TEXTURE_COORD_1 0x0D93\n#define GL_MAP1_TEXTURE_COORD_2 0x0D94\n#define GL_MAP1_TEXTURE_COORD_3 0x0D95\n#define GL_MAP1_TEXTURE_COORD_4 0x0D96\n#define GL_MAP1_VERTEX_3 0x0D97\n#define GL_MAP1_VERTEX_4 0x0D98\n#define GL_MAP2_COLOR_4 0x0DB0\n#define GL_MAP2_INDEX 0x0DB1\n#define GL_MAP2_NORMAL 0x0DB2\n#define GL_MAP2_TEXTURE_COORD_1 0x0DB3\n#define GL_MAP2_TEXTURE_COORD_2 0x0DB4\n#define GL_MAP2_TEXTURE_COORD_3 0x0DB5\n#define GL_MAP2_TEXTURE_COORD_4 0x0DB6\n#define GL_MAP2_VERTEX_3 0x0DB7\n#define GL_MAP2_VERTEX_4 0x0DB8\n#define GL_MAP1_GRID_DOMAIN 0x0DD0\n#define GL_MAP1_GRID_SEGMENTS 0x0DD1\n#define GL_MAP2_GRID_DOMAIN 0x0DD2\n#define GL_MAP2_GRID_SEGMENTS 0x0DD3\n#define GL_TEXTURE_1D 0x0DE0\n#define GL_TEXTURE_2D 0x0DE1\n#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0\n#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1\n#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2\n#define GL_SELECTION_BUFFER_POINTER 0x0DF3\n#define GL_SELECTION_BUFFER_SIZE 0x0DF4\n#define GL_TEXTURE_WIDTH 0x1000\n#define GL_TRANSFORM_BIT 0x00001000\n#define GL_TEXTURE_HEIGHT 0x1001\n#define GL_TEXTURE_INTERNAL_FORMAT 0x1003\n#define GL_TEXTURE_BORDER_COLOR 0x1004\n#define GL_TEXTURE_BORDER 0x1005\n#define GL_DONT_CARE 0x1100\n#define GL_FASTEST 0x1101\n#define GL_NICEST 0x1102\n#define GL_AMBIENT 0x1200\n#define GL_DIFFUSE 0x1201\n#define GL_SPECULAR 0x1202\n#define GL_POSITION 0x1203\n#define GL_SPOT_DIRECTION 0x1204\n#define GL_SPOT_EXPONENT 0x1205\n#define GL_SPOT_CUTOFF 0x1206\n#define GL_CONSTANT_ATTENUATION 0x1207\n#define GL_LINEAR_ATTENUATION 0x1208\n#define GL_QUADRATIC_ATTENUATION 0x1209\n#define GL_COMPILE 0x1300\n#define GL_COMPILE_AND_EXECUTE 0x1301\n#define GL_BYTE 0x1400\n#define GL_UNSIGNED_BYTE 0x1401\n#define GL_SHORT 0x1402\n#define GL_UNSIGNED_SHORT 0x1403\n#define GL_INT 0x1404\n#define GL_UNSIGNED_INT 0x1405\n#define GL_FLOAT 0x1406\n#define GL_2_BYTES 0x1407\n#define GL_3_BYTES 0x1408\n#define GL_4_BYTES 0x1409\n#define GL_DOUBLE 0x140A\n#define GL_CLEAR 0x1500\n#define GL_AND 0x1501\n#define GL_AND_REVERSE 0x1502\n#define GL_COPY 0x1503\n#define GL_AND_INVERTED 0x1504\n#define GL_NOOP 0x1505\n#define GL_XOR 0x1506\n#define GL_OR 0x1507\n#define GL_NOR 0x1508\n#define GL_EQUIV 0x1509\n#define GL_INVERT 0x150A\n#define GL_OR_REVERSE 0x150B\n#define GL_COPY_INVERTED 0x150C\n#define GL_OR_INVERTED 0x150D\n#define GL_NAND 0x150E\n#define GL_SET 0x150F\n#define GL_EMISSION 0x1600\n#define GL_SHININESS 0x1601\n#define GL_AMBIENT_AND_DIFFUSE 0x1602\n#define GL_COLOR_INDEXES 0x1603\n#define GL_MODELVIEW 0x1700\n#define GL_PROJECTION 0x1701\n#define GL_TEXTURE 0x1702\n#define GL_COLOR 0x1800\n#define GL_DEPTH 0x1801\n#define GL_STENCIL 0x1802\n#define GL_COLOR_INDEX 0x1900\n#define GL_STENCIL_INDEX 0x1901\n#define GL_DEPTH_COMPONENT 0x1902\n#define GL_RED 0x1903\n#define GL_GREEN 0x1904\n#define GL_BLUE 0x1905\n#define GL_ALPHA 0x1906\n#define GL_RGB 0x1907\n#define GL_RGBA 0x1908\n#define GL_LUMINANCE 0x1909\n#define GL_LUMINANCE_ALPHA 0x190A\n#define GL_BITMAP 0x1A00\n#define GL_POINT 0x1B00\n#define GL_LINE 0x1B01\n#define GL_FILL 0x1B02\n#define GL_RENDER 0x1C00\n#define GL_FEEDBACK 0x1C01\n#define GL_SELECT 0x1C02\n#define GL_FLAT 0x1D00\n#define GL_SMOOTH 0x1D01\n#define GL_KEEP 0x1E00\n#define GL_REPLACE 0x1E01\n#define GL_INCR 0x1E02\n#define GL_DECR 0x1E03\n#define GL_VENDOR 0x1F00\n#define GL_RENDERER 0x1F01\n#define GL_VERSION 0x1F02\n#define GL_EXTENSIONS 0x1F03\n#define GL_S 0x2000\n#define GL_ENABLE_BIT 0x00002000\n#define GL_T 0x2001\n#define GL_R 0x2002\n#define GL_Q 0x2003\n#define GL_MODULATE 0x2100\n#define GL_DECAL 0x2101\n#define GL_TEXTURE_ENV_MODE 0x2200\n#define GL_TEXTURE_ENV_COLOR 0x2201\n#define GL_TEXTURE_ENV 0x2300\n#define GL_EYE_LINEAR 0x2400\n#define GL_OBJECT_LINEAR 0x2401\n#define GL_SPHERE_MAP 0x2402\n#define GL_TEXTURE_GEN_MODE 0x2500\n#define GL_OBJECT_PLANE 0x2501\n#define GL_EYE_PLANE 0x2502\n#define GL_NEAREST 0x2600\n#define GL_LINEAR 0x2601\n#define GL_NEAREST_MIPMAP_NEAREST 0x2700\n#define GL_LINEAR_MIPMAP_NEAREST 0x2701\n#define GL_NEAREST_MIPMAP_LINEAR 0x2702\n#define GL_LINEAR_MIPMAP_LINEAR 0x2703\n#define GL_TEXTURE_MAG_FILTER 0x2800\n#define GL_TEXTURE_MIN_FILTER 0x2801\n#define GL_TEXTURE_WRAP_S 0x2802\n#define GL_TEXTURE_WRAP_T 0x2803\n#define GL_CLAMP 0x2900\n#define GL_REPEAT 0x2901\n#define GL_POLYGON_OFFSET_UNITS 0x2A00\n#define GL_POLYGON_OFFSET_POINT 0x2A01\n#define GL_POLYGON_OFFSET_LINE 0x2A02\n#define GL_R3_G3_B2 0x2A10\n#define GL_V2F 0x2A20\n#define GL_V3F 0x2A21\n#define GL_C4UB_V2F 0x2A22\n#define GL_C4UB_V3F 0x2A23\n#define GL_C3F_V3F 0x2A24\n#define GL_N3F_V3F 0x2A25\n#define GL_C4F_N3F_V3F 0x2A26\n#define GL_T2F_V3F 0x2A27\n#define GL_T4F_V4F 0x2A28\n#define GL_T2F_C4UB_V3F 0x2A29\n#define GL_T2F_C3F_V3F 0x2A2A\n#define GL_T2F_N3F_V3F 0x2A2B\n#define GL_T2F_C4F_N3F_V3F 0x2A2C\n#define GL_T4F_C4F_N3F_V4F 0x2A2D\n#define GL_CLIP_PLANE0 0x3000\n#define GL_CLIP_PLANE1 0x3001\n#define GL_CLIP_PLANE2 0x3002\n#define GL_CLIP_PLANE3 0x3003\n#define GL_CLIP_PLANE4 0x3004\n#define GL_CLIP_PLANE5 0x3005\n#define GL_LIGHT0 0x4000\n#define GL_COLOR_BUFFER_BIT 0x00004000\n#define GL_LIGHT1 0x4001\n#define GL_LIGHT2 0x4002\n#define GL_LIGHT3 0x4003\n#define GL_LIGHT4 0x4004\n#define GL_LIGHT5 0x4005\n#define GL_LIGHT6 0x4006\n#define GL_LIGHT7 0x4007\n#define GL_HINT_BIT 0x00008000\n#define GL_POLYGON_OFFSET_FILL 0x8037\n#define GL_POLYGON_OFFSET_FACTOR 0x8038\n#define GL_ALPHA4 0x803B\n#define GL_ALPHA8 0x803C\n#define GL_ALPHA12 0x803D\n#define GL_ALPHA16 0x803E\n#define GL_LUMINANCE4 0x803F\n#define GL_LUMINANCE8 0x8040\n#define GL_LUMINANCE12 0x8041\n#define GL_LUMINANCE16 0x8042\n#define GL_LUMINANCE4_ALPHA4 0x8043\n#define GL_LUMINANCE6_ALPHA2 0x8044\n#define GL_LUMINANCE8_ALPHA8 0x8045\n#define GL_LUMINANCE12_ALPHA4 0x8046\n#define GL_LUMINANCE12_ALPHA12 0x8047\n#define GL_LUMINANCE16_ALPHA16 0x8048\n#define GL_INTENSITY 0x8049\n#define GL_INTENSITY4 0x804A\n#define GL_INTENSITY8 0x804B\n#define GL_INTENSITY12 0x804C\n#define GL_INTENSITY16 0x804D\n#define GL_RGB4 0x804F\n#define GL_RGB5 0x8050\n#define GL_RGB8 0x8051\n#define GL_RGB10 0x8052\n#define GL_RGB12 0x8053\n#define GL_RGB16 0x8054\n#define GL_RGBA2 0x8055\n#define GL_RGBA4 0x8056\n#define GL_RGB5_A1 0x8057\n#define GL_RGBA8 0x8058\n#define GL_RGB10_A2 0x8059\n#define GL_RGBA12 0x805A\n#define GL_RGBA16 0x805B\n#define GL_TEXTURE_RED_SIZE 0x805C\n#define GL_TEXTURE_GREEN_SIZE 0x805D\n#define GL_TEXTURE_BLUE_SIZE 0x805E\n#define GL_TEXTURE_ALPHA_SIZE 0x805F\n#define GL_TEXTURE_LUMINANCE_SIZE 0x8060\n#define GL_TEXTURE_INTENSITY_SIZE 0x8061\n#define GL_PROXY_TEXTURE_1D 0x8063\n#define GL_PROXY_TEXTURE_2D 0x8064\n#define GL_TEXTURE_PRIORITY 0x8066\n#define GL_TEXTURE_RESIDENT 0x8067\n#define GL_TEXTURE_BINDING_1D 0x8068\n#define GL_TEXTURE_BINDING_2D 0x8069\n#define GL_VERTEX_ARRAY 0x8074\n#define GL_NORMAL_ARRAY 0x8075\n#define GL_COLOR_ARRAY 0x8076\n#define GL_INDEX_ARRAY 0x8077\n#define GL_TEXTURE_COORD_ARRAY 0x8078\n#define GL_EDGE_FLAG_ARRAY 0x8079\n#define GL_VERTEX_ARRAY_SIZE 0x807A\n#define GL_VERTEX_ARRAY_TYPE 0x807B\n#define GL_VERTEX_ARRAY_STRIDE 0x807C\n#define GL_NORMAL_ARRAY_TYPE 0x807E\n#define GL_NORMAL_ARRAY_STRIDE 0x807F\n#define GL_COLOR_ARRAY_SIZE 0x8081\n#define GL_COLOR_ARRAY_TYPE 0x8082\n#define GL_COLOR_ARRAY_STRIDE 0x8083\n#define GL_INDEX_ARRAY_TYPE 0x8085\n#define GL_INDEX_ARRAY_STRIDE 0x8086\n#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088\n#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089\n#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A\n#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C\n#define GL_VERTEX_ARRAY_POINTER 0x808E\n#define GL_NORMAL_ARRAY_POINTER 0x808F\n#define GL_COLOR_ARRAY_POINTER 0x8090\n#define GL_INDEX_ARRAY_POINTER 0x8091\n#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092\n#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093\n#define GL_COLOR_INDEX1_EXT 0x80E2\n#define GL_COLOR_INDEX2_EXT 0x80E3\n#define GL_COLOR_INDEX4_EXT 0x80E4\n#define GL_COLOR_INDEX8_EXT 0x80E5\n#define GL_COLOR_INDEX12_EXT 0x80E6\n#define GL_COLOR_INDEX16_EXT 0x80E7\n#define GL_EVAL_BIT 0x00010000\n#define GL_LIST_BIT 0x00020000\n#define GL_TEXTURE_BIT 0x00040000\n#define GL_SCISSOR_BIT 0x00080000\n#define GL_ALL_ATTRIB_BITS 0x000fffff\n#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff\n\nGLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value);\nGLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref);\nGLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);\nGLAPI void GLAPIENTRY glArrayElement (GLint i);\nGLAPI void GLAPIENTRY glBegin (GLenum mode);\nGLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture);\nGLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);\nGLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);\nGLAPI void GLAPIENTRY glCallList (GLuint list);\nGLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists);\nGLAPI void GLAPIENTRY glClear (GLbitfield mask);\nGLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\nGLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);\nGLAPI void GLAPIENTRY glClearDepth (GLclampd depth);\nGLAPI void GLAPIENTRY glClearIndex (GLfloat c);\nGLAPI void GLAPIENTRY glClearStencil (GLint s);\nGLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation);\nGLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue);\nGLAPI void GLAPIENTRY glColor3bv (const GLbyte *v);\nGLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue);\nGLAPI void GLAPIENTRY glColor3dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue);\nGLAPI void GLAPIENTRY glColor3fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue);\nGLAPI void GLAPIENTRY glColor3iv (const GLint *v);\nGLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue);\nGLAPI void GLAPIENTRY glColor3sv (const GLshort *v);\nGLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue);\nGLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v);\nGLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue);\nGLAPI void GLAPIENTRY glColor3uiv (const GLuint *v);\nGLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue);\nGLAPI void GLAPIENTRY glColor3usv (const GLushort *v);\nGLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);\nGLAPI void GLAPIENTRY glColor4bv (const GLbyte *v);\nGLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);\nGLAPI void GLAPIENTRY glColor4dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);\nGLAPI void GLAPIENTRY glColor4fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha);\nGLAPI void GLAPIENTRY glColor4iv (const GLint *v);\nGLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);\nGLAPI void GLAPIENTRY glColor4sv (const GLshort *v);\nGLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);\nGLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v);\nGLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);\nGLAPI void GLAPIENTRY glColor4uiv (const GLuint *v);\nGLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);\nGLAPI void GLAPIENTRY glColor4usv (const GLushort *v);\nGLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);\nGLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode);\nGLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);\nGLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);\nGLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\nGLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\nGLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void GLAPIENTRY glCullFace (GLenum mode);\nGLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range);\nGLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);\nGLAPI void GLAPIENTRY glDepthFunc (GLenum func);\nGLAPI void GLAPIENTRY glDepthMask (GLboolean flag);\nGLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar);\nGLAPI void GLAPIENTRY glDisable (GLenum cap);\nGLAPI void GLAPIENTRY glDisableClientState (GLenum array);\nGLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);\nGLAPI void GLAPIENTRY glDrawBuffer (GLenum mode);\nGLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);\nGLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag);\nGLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer);\nGLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag);\nGLAPI void GLAPIENTRY glEnable (GLenum cap);\nGLAPI void GLAPIENTRY glEnableClientState (GLenum array);\nGLAPI void GLAPIENTRY glEnd (void);\nGLAPI void GLAPIENTRY glEndList (void);\nGLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u);\nGLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u);\nGLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u);\nGLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u);\nGLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v);\nGLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u);\nGLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v);\nGLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u);\nGLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2);\nGLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);\nGLAPI void GLAPIENTRY glEvalPoint1 (GLint i);\nGLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j);\nGLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);\nGLAPI void GLAPIENTRY glFinish (void);\nGLAPI void GLAPIENTRY glFlush (void);\nGLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params);\nGLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params);\nGLAPI void GLAPIENTRY glFrontFace (GLenum mode);\nGLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);\nGLAPI GLuint GLAPIENTRY glGenLists (GLsizei range);\nGLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures);\nGLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params);\nGLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation);\nGLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params);\nGLAPI GLenum GLAPIENTRY glGetError (void);\nGLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params);\nGLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params);\nGLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);\nGLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params);\nGLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v);\nGLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v);\nGLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v);\nGLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);\nGLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params);\nGLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values);\nGLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values);\nGLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values);\nGLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params);\nGLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask);\nGLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name);\nGLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params);\nGLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);\nGLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);\nGLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);\nGLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);\nGLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);\nGLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);\nGLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);\nGLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);\nGLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode);\nGLAPI void GLAPIENTRY glIndexMask (GLuint mask);\nGLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void GLAPIENTRY glIndexd (GLdouble c);\nGLAPI void GLAPIENTRY glIndexdv (const GLdouble *c);\nGLAPI void GLAPIENTRY glIndexf (GLfloat c);\nGLAPI void GLAPIENTRY glIndexfv (const GLfloat *c);\nGLAPI void GLAPIENTRY glIndexi (GLint c);\nGLAPI void GLAPIENTRY glIndexiv (const GLint *c);\nGLAPI void GLAPIENTRY glIndexs (GLshort c);\nGLAPI void GLAPIENTRY glIndexsv (const GLshort *c);\nGLAPI void GLAPIENTRY glIndexub (GLubyte c);\nGLAPI void GLAPIENTRY glIndexubv (const GLubyte *c);\nGLAPI void GLAPIENTRY glInitNames (void);\nGLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer);\nGLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap);\nGLAPI GLboolean GLAPIENTRY glIsList (GLuint list);\nGLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture);\nGLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params);\nGLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params);\nGLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);\nGLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params);\nGLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern);\nGLAPI void GLAPIENTRY glLineWidth (GLfloat width);\nGLAPI void GLAPIENTRY glListBase (GLuint base);\nGLAPI void GLAPIENTRY glLoadIdentity (void);\nGLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m);\nGLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m);\nGLAPI void GLAPIENTRY glLoadName (GLuint name);\nGLAPI void GLAPIENTRY glLogicOp (GLenum opcode);\nGLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);\nGLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);\nGLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);\nGLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);\nGLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);\nGLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);\nGLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);\nGLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);\nGLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);\nGLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params);\nGLAPI void GLAPIENTRY glMatrixMode (GLenum mode);\nGLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m);\nGLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m);\nGLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode);\nGLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);\nGLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v);\nGLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);\nGLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);\nGLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz);\nGLAPI void GLAPIENTRY glNormal3iv (const GLint *v);\nGLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz);\nGLAPI void GLAPIENTRY glNormal3sv (const GLshort *v);\nGLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);\nGLAPI void GLAPIENTRY glPassThrough (GLfloat token);\nGLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values);\nGLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values);\nGLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values);\nGLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor);\nGLAPI void GLAPIENTRY glPointSize (GLfloat size);\nGLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode);\nGLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units);\nGLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask);\nGLAPI void GLAPIENTRY glPopAttrib (void);\nGLAPI void GLAPIENTRY glPopClientAttrib (void);\nGLAPI void GLAPIENTRY glPopMatrix (void);\nGLAPI void GLAPIENTRY glPopName (void);\nGLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities);\nGLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask);\nGLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask);\nGLAPI void GLAPIENTRY glPushMatrix (void);\nGLAPI void GLAPIENTRY glPushName (GLuint name);\nGLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y);\nGLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y);\nGLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y);\nGLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v);\nGLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y);\nGLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v);\nGLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);\nGLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);\nGLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z);\nGLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v);\nGLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z);\nGLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v);\nGLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w);\nGLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v);\nGLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);\nGLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v);\nGLAPI void GLAPIENTRY glReadBuffer (GLenum mode);\nGLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);\nGLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);\nGLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2);\nGLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);\nGLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2);\nGLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2);\nGLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2);\nGLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);\nGLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2);\nGLAPI GLint GLAPIENTRY glRenderMode (GLenum mode);\nGLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);\nGLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);\nGLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z);\nGLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);\nGLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);\nGLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer);\nGLAPI void GLAPIENTRY glShadeModel (GLenum mode);\nGLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);\nGLAPI void GLAPIENTRY glStencilMask (GLuint mask);\nGLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);\nGLAPI void GLAPIENTRY glTexCoord1d (GLdouble s);\nGLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glTexCoord1f (GLfloat s);\nGLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glTexCoord1i (GLint s);\nGLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v);\nGLAPI void GLAPIENTRY glTexCoord1s (GLshort s);\nGLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v);\nGLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t);\nGLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t);\nGLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t);\nGLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v);\nGLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t);\nGLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v);\nGLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);\nGLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);\nGLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r);\nGLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v);\nGLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r);\nGLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v);\nGLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);\nGLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);\nGLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q);\nGLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v);\nGLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);\nGLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v);\nGLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);\nGLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param);\nGLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params);\nGLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params);\nGLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params);\nGLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);\nGLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);\nGLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);\nGLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);\nGLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);\nGLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z);\nGLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);\nGLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y);\nGLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y);\nGLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y);\nGLAPI void GLAPIENTRY glVertex2iv (const GLint *v);\nGLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y);\nGLAPI void GLAPIENTRY glVertex2sv (const GLshort *v);\nGLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z);\nGLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z);\nGLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z);\nGLAPI void GLAPIENTRY glVertex3iv (const GLint *v);\nGLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z);\nGLAPI void GLAPIENTRY glVertex3sv (const GLshort *v);\nGLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);\nGLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v);\nGLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);\nGLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v);\nGLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w);\nGLAPI void GLAPIENTRY glVertex4iv (const GLint *v);\nGLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);\nGLAPI void GLAPIENTRY glVertex4sv (const GLshort *v);\nGLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\nGLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);\n\n#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1)\n\n#endif /* GL_VERSION_1_1 */\n\n/* ---------------------------------- GLU ---------------------------------- */\n\n#ifndef GLEW_NO_GLU\n/* this is where we can safely include GLU */\n#  if defined(__APPLE__) && defined(__MACH__)\n#    include <OpenGL/glu.h>\n#  else\n#    include <GL/glu.h>\n#  endif\n#endif\n\n/* ----------------------------- GL_VERSION_1_2 ---------------------------- */\n\n#ifndef GL_VERSION_1_2\n#define GL_VERSION_1_2 1\n\n#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12\n#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13\n#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22\n#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23\n#define GL_UNSIGNED_BYTE_3_3_2 0x8032\n#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033\n#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034\n#define GL_UNSIGNED_INT_8_8_8_8 0x8035\n#define GL_UNSIGNED_INT_10_10_10_2 0x8036\n#define GL_RESCALE_NORMAL 0x803A\n#define GL_TEXTURE_BINDING_3D 0x806A\n#define GL_PACK_SKIP_IMAGES 0x806B\n#define GL_PACK_IMAGE_HEIGHT 0x806C\n#define GL_UNPACK_SKIP_IMAGES 0x806D\n#define GL_UNPACK_IMAGE_HEIGHT 0x806E\n#define GL_TEXTURE_3D 0x806F\n#define GL_PROXY_TEXTURE_3D 0x8070\n#define GL_TEXTURE_DEPTH 0x8071\n#define GL_TEXTURE_WRAP_R 0x8072\n#define GL_MAX_3D_TEXTURE_SIZE 0x8073\n#define GL_BGR 0x80E0\n#define GL_BGRA 0x80E1\n#define GL_MAX_ELEMENTS_VERTICES 0x80E8\n#define GL_MAX_ELEMENTS_INDICES 0x80E9\n#define GL_CLAMP_TO_EDGE 0x812F\n#define GL_TEXTURE_MIN_LOD 0x813A\n#define GL_TEXTURE_MAX_LOD 0x813B\n#define GL_TEXTURE_BASE_LEVEL 0x813C\n#define GL_TEXTURE_MAX_LEVEL 0x813D\n#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8\n#define GL_SINGLE_COLOR 0x81F9\n#define GL_SEPARATE_SPECULAR_COLOR 0x81FA\n#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362\n#define GL_UNSIGNED_SHORT_5_6_5 0x8363\n#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364\n#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365\n#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366\n#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367\n#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368\n#define GL_ALIASED_POINT_SIZE_RANGE 0x846D\n#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E\n\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);\ntypedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);\n\n#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D)\n#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements)\n#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D)\n#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D)\n\n#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2)\n\n#endif /* GL_VERSION_1_2 */\n\n/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */\n\n#ifndef GL_VERSION_1_2_1\n#define GL_VERSION_1_2_1 1\n\n#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1)\n\n#endif /* GL_VERSION_1_2_1 */\n\n/* ----------------------------- GL_VERSION_1_3 ---------------------------- */\n\n#ifndef GL_VERSION_1_3\n#define GL_VERSION_1_3 1\n\n#define GL_MULTISAMPLE 0x809D\n#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE 0x809F\n#define GL_SAMPLE_COVERAGE 0x80A0\n#define GL_SAMPLE_BUFFERS 0x80A8\n#define GL_SAMPLES 0x80A9\n#define GL_SAMPLE_COVERAGE_VALUE 0x80AA\n#define GL_SAMPLE_COVERAGE_INVERT 0x80AB\n#define GL_CLAMP_TO_BORDER 0x812D\n#define GL_TEXTURE0 0x84C0\n#define GL_TEXTURE1 0x84C1\n#define GL_TEXTURE2 0x84C2\n#define GL_TEXTURE3 0x84C3\n#define GL_TEXTURE4 0x84C4\n#define GL_TEXTURE5 0x84C5\n#define GL_TEXTURE6 0x84C6\n#define GL_TEXTURE7 0x84C7\n#define GL_TEXTURE8 0x84C8\n#define GL_TEXTURE9 0x84C9\n#define GL_TEXTURE10 0x84CA\n#define GL_TEXTURE11 0x84CB\n#define GL_TEXTURE12 0x84CC\n#define GL_TEXTURE13 0x84CD\n#define GL_TEXTURE14 0x84CE\n#define GL_TEXTURE15 0x84CF\n#define GL_TEXTURE16 0x84D0\n#define GL_TEXTURE17 0x84D1\n#define GL_TEXTURE18 0x84D2\n#define GL_TEXTURE19 0x84D3\n#define GL_TEXTURE20 0x84D4\n#define GL_TEXTURE21 0x84D5\n#define GL_TEXTURE22 0x84D6\n#define GL_TEXTURE23 0x84D7\n#define GL_TEXTURE24 0x84D8\n#define GL_TEXTURE25 0x84D9\n#define GL_TEXTURE26 0x84DA\n#define GL_TEXTURE27 0x84DB\n#define GL_TEXTURE28 0x84DC\n#define GL_TEXTURE29 0x84DD\n#define GL_TEXTURE30 0x84DE\n#define GL_TEXTURE31 0x84DF\n#define GL_ACTIVE_TEXTURE 0x84E0\n#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1\n#define GL_MAX_TEXTURE_UNITS 0x84E2\n#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3\n#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4\n#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5\n#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6\n#define GL_SUBTRACT 0x84E7\n#define GL_COMPRESSED_ALPHA 0x84E9\n#define GL_COMPRESSED_LUMINANCE 0x84EA\n#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB\n#define GL_COMPRESSED_INTENSITY 0x84EC\n#define GL_COMPRESSED_RGB 0x84ED\n#define GL_COMPRESSED_RGBA 0x84EE\n#define GL_TEXTURE_COMPRESSION_HINT 0x84EF\n#define GL_NORMAL_MAP 0x8511\n#define GL_REFLECTION_MAP 0x8512\n#define GL_TEXTURE_CUBE_MAP 0x8513\n#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A\n#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B\n#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C\n#define GL_COMBINE 0x8570\n#define GL_COMBINE_RGB 0x8571\n#define GL_COMBINE_ALPHA 0x8572\n#define GL_RGB_SCALE 0x8573\n#define GL_ADD_SIGNED 0x8574\n#define GL_INTERPOLATE 0x8575\n#define GL_CONSTANT 0x8576\n#define GL_PRIMARY_COLOR 0x8577\n#define GL_PREVIOUS 0x8578\n#define GL_SOURCE0_RGB 0x8580\n#define GL_SOURCE1_RGB 0x8581\n#define GL_SOURCE2_RGB 0x8582\n#define GL_SOURCE0_ALPHA 0x8588\n#define GL_SOURCE1_ALPHA 0x8589\n#define GL_SOURCE2_ALPHA 0x858A\n#define GL_OPERAND0_RGB 0x8590\n#define GL_OPERAND1_RGB 0x8591\n#define GL_OPERAND2_RGB 0x8592\n#define GL_OPERAND0_ALPHA 0x8598\n#define GL_OPERAND1_ALPHA 0x8599\n#define GL_OPERAND2_ALPHA 0x859A\n#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0\n#define GL_TEXTURE_COMPRESSED 0x86A1\n#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2\n#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3\n#define GL_DOT3_RGB 0x86AE\n#define GL_DOT3_RGBA 0x86AF\n#define GL_MULTISAMPLE_BIT 0x20000000\n\ntypedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);\ntypedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);\ntypedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img);\ntypedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);\ntypedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);\ntypedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);\ntypedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);\n\n#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture)\n#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture)\n#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D)\n#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D)\n#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D)\n#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D)\n#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D)\n#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D)\n#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage)\n#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd)\n#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf)\n#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd)\n#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf)\n#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d)\n#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv)\n#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f)\n#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv)\n#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i)\n#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv)\n#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s)\n#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv)\n#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d)\n#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv)\n#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f)\n#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv)\n#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i)\n#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv)\n#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s)\n#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv)\n#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d)\n#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv)\n#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f)\n#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv)\n#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i)\n#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv)\n#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s)\n#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv)\n#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d)\n#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv)\n#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f)\n#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv)\n#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i)\n#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv)\n#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s)\n#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv)\n#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage)\n\n#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3)\n\n#endif /* GL_VERSION_1_3 */\n\n/* ----------------------------- GL_VERSION_1_4 ---------------------------- */\n\n#ifndef GL_VERSION_1_4\n#define GL_VERSION_1_4 1\n\n#define GL_BLEND_DST_RGB 0x80C8\n#define GL_BLEND_SRC_RGB 0x80C9\n#define GL_BLEND_DST_ALPHA 0x80CA\n#define GL_BLEND_SRC_ALPHA 0x80CB\n#define GL_POINT_SIZE_MIN 0x8126\n#define GL_POINT_SIZE_MAX 0x8127\n#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128\n#define GL_POINT_DISTANCE_ATTENUATION 0x8129\n#define GL_GENERATE_MIPMAP 0x8191\n#define GL_GENERATE_MIPMAP_HINT 0x8192\n#define GL_DEPTH_COMPONENT16 0x81A5\n#define GL_DEPTH_COMPONENT24 0x81A6\n#define GL_DEPTH_COMPONENT32 0x81A7\n#define GL_MIRRORED_REPEAT 0x8370\n#define GL_FOG_COORDINATE_SOURCE 0x8450\n#define GL_FOG_COORDINATE 0x8451\n#define GL_FRAGMENT_DEPTH 0x8452\n#define GL_CURRENT_FOG_COORDINATE 0x8453\n#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454\n#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455\n#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456\n#define GL_FOG_COORDINATE_ARRAY 0x8457\n#define GL_COLOR_SUM 0x8458\n#define GL_CURRENT_SECONDARY_COLOR 0x8459\n#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A\n#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B\n#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C\n#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D\n#define GL_SECONDARY_COLOR_ARRAY 0x845E\n#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD\n#define GL_TEXTURE_FILTER_CONTROL 0x8500\n#define GL_TEXTURE_LOD_BIAS 0x8501\n#define GL_INCR_WRAP 0x8507\n#define GL_DECR_WRAP 0x8508\n#define GL_TEXTURE_DEPTH_SIZE 0x884A\n#define GL_DEPTH_TEXTURE_MODE 0x884B\n#define GL_TEXTURE_COMPARE_MODE 0x884C\n#define GL_TEXTURE_COMPARE_FUNC 0x884D\n#define GL_COMPARE_R_TO_TEXTURE 0x884E\n\ntypedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord);\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p);\n\n#define glBlendColor GLEW_GET_FUN(__glewBlendColor)\n#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation)\n#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate)\n#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer)\n#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd)\n#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv)\n#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf)\n#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv)\n#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays)\n#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements)\n#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf)\n#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv)\n#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri)\n#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv)\n#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b)\n#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv)\n#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d)\n#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv)\n#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f)\n#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv)\n#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i)\n#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv)\n#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s)\n#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv)\n#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub)\n#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv)\n#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui)\n#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv)\n#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us)\n#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv)\n#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer)\n#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d)\n#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv)\n#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f)\n#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv)\n#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i)\n#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv)\n#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s)\n#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv)\n#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d)\n#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv)\n#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f)\n#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv)\n#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i)\n#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv)\n#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s)\n#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv)\n\n#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4)\n\n#endif /* GL_VERSION_1_4 */\n\n/* ----------------------------- GL_VERSION_1_5 ---------------------------- */\n\n#ifndef GL_VERSION_1_5\n#define GL_VERSION_1_5 1\n\n#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE\n#define GL_FOG_COORD GL_FOG_COORDINATE\n#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY\n#define GL_SRC0_RGB GL_SOURCE0_RGB\n#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER\n#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE\n#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA\n#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE\n#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE\n#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA\n#define GL_SRC1_RGB GL_SOURCE1_RGB\n#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING\n#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA\n#define GL_SRC2_RGB GL_SOURCE2_RGB\n#define GL_BUFFER_SIZE 0x8764\n#define GL_BUFFER_USAGE 0x8765\n#define GL_QUERY_COUNTER_BITS 0x8864\n#define GL_CURRENT_QUERY 0x8865\n#define GL_QUERY_RESULT 0x8866\n#define GL_QUERY_RESULT_AVAILABLE 0x8867\n#define GL_ARRAY_BUFFER 0x8892\n#define GL_ELEMENT_ARRAY_BUFFER 0x8893\n#define GL_ARRAY_BUFFER_BINDING 0x8894\n#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895\n#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896\n#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897\n#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898\n#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899\n#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A\n#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B\n#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C\n#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D\n#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E\n#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F\n#define GL_READ_ONLY 0x88B8\n#define GL_WRITE_ONLY 0x88B9\n#define GL_READ_WRITE 0x88BA\n#define GL_BUFFER_ACCESS 0x88BB\n#define GL_BUFFER_MAPPED 0x88BC\n#define GL_BUFFER_MAP_POINTER 0x88BD\n#define GL_STREAM_DRAW 0x88E0\n#define GL_STREAM_READ 0x88E1\n#define GL_STREAM_COPY 0x88E2\n#define GL_STATIC_DRAW 0x88E4\n#define GL_STATIC_READ 0x88E5\n#define GL_STATIC_COPY 0x88E6\n#define GL_DYNAMIC_DRAW 0x88E8\n#define GL_DYNAMIC_READ 0x88E9\n#define GL_DYNAMIC_COPY 0x88EA\n#define GL_SAMPLES_PASSED 0x8914\n\ntypedef ptrdiff_t GLintptr;\ntypedef ptrdiff_t GLsizeiptr;\n\ntypedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);\ntypedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);\ntypedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers);\ntypedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers);\ntypedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params);\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer);\ntypedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id);\ntypedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);\ntypedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target);\n\n#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery)\n#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer)\n#define glBufferData GLEW_GET_FUN(__glewBufferData)\n#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData)\n#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers)\n#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries)\n#define glEndQuery GLEW_GET_FUN(__glewEndQuery)\n#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers)\n#define glGenQueries GLEW_GET_FUN(__glewGenQueries)\n#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv)\n#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv)\n#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData)\n#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv)\n#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv)\n#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv)\n#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer)\n#define glIsQuery GLEW_GET_FUN(__glewIsQuery)\n#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer)\n#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer)\n\n#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5)\n\n#endif /* GL_VERSION_1_5 */\n\n/* ----------------------------- GL_VERSION_2_0 ---------------------------- */\n\n#ifndef GL_VERSION_2_0\n#define GL_VERSION_2_0 1\n\n#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION\n#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622\n#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623\n#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624\n#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625\n#define GL_CURRENT_VERTEX_ATTRIB 0x8626\n#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642\n#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643\n#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645\n#define GL_STENCIL_BACK_FUNC 0x8800\n#define GL_STENCIL_BACK_FAIL 0x8801\n#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802\n#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803\n#define GL_MAX_DRAW_BUFFERS 0x8824\n#define GL_DRAW_BUFFER0 0x8825\n#define GL_DRAW_BUFFER1 0x8826\n#define GL_DRAW_BUFFER2 0x8827\n#define GL_DRAW_BUFFER3 0x8828\n#define GL_DRAW_BUFFER4 0x8829\n#define GL_DRAW_BUFFER5 0x882A\n#define GL_DRAW_BUFFER6 0x882B\n#define GL_DRAW_BUFFER7 0x882C\n#define GL_DRAW_BUFFER8 0x882D\n#define GL_DRAW_BUFFER9 0x882E\n#define GL_DRAW_BUFFER10 0x882F\n#define GL_DRAW_BUFFER11 0x8830\n#define GL_DRAW_BUFFER12 0x8831\n#define GL_DRAW_BUFFER13 0x8832\n#define GL_DRAW_BUFFER14 0x8833\n#define GL_DRAW_BUFFER15 0x8834\n#define GL_BLEND_EQUATION_ALPHA 0x883D\n#define GL_POINT_SPRITE 0x8861\n#define GL_COORD_REPLACE 0x8862\n#define GL_MAX_VERTEX_ATTRIBS 0x8869\n#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A\n#define GL_MAX_TEXTURE_COORDS 0x8871\n#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872\n#define GL_FRAGMENT_SHADER 0x8B30\n#define GL_VERTEX_SHADER 0x8B31\n#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49\n#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A\n#define GL_MAX_VARYING_FLOATS 0x8B4B\n#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C\n#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D\n#define GL_SHADER_TYPE 0x8B4F\n#define GL_FLOAT_VEC2 0x8B50\n#define GL_FLOAT_VEC3 0x8B51\n#define GL_FLOAT_VEC4 0x8B52\n#define GL_INT_VEC2 0x8B53\n#define GL_INT_VEC3 0x8B54\n#define GL_INT_VEC4 0x8B55\n#define GL_BOOL 0x8B56\n#define GL_BOOL_VEC2 0x8B57\n#define GL_BOOL_VEC3 0x8B58\n#define GL_BOOL_VEC4 0x8B59\n#define GL_FLOAT_MAT2 0x8B5A\n#define GL_FLOAT_MAT3 0x8B5B\n#define GL_FLOAT_MAT4 0x8B5C\n#define GL_SAMPLER_1D 0x8B5D\n#define GL_SAMPLER_2D 0x8B5E\n#define GL_SAMPLER_3D 0x8B5F\n#define GL_SAMPLER_CUBE 0x8B60\n#define GL_SAMPLER_1D_SHADOW 0x8B61\n#define GL_SAMPLER_2D_SHADOW 0x8B62\n#define GL_DELETE_STATUS 0x8B80\n#define GL_COMPILE_STATUS 0x8B81\n#define GL_LINK_STATUS 0x8B82\n#define GL_VALIDATE_STATUS 0x8B83\n#define GL_INFO_LOG_LENGTH 0x8B84\n#define GL_ATTACHED_SHADERS 0x8B85\n#define GL_ACTIVE_UNIFORMS 0x8B86\n#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87\n#define GL_SHADER_SOURCE_LENGTH 0x8B88\n#define GL_ACTIVE_ATTRIBUTES 0x8B89\n#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A\n#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B\n#define GL_SHADING_LANGUAGE_VERSION 0x8B8C\n#define GL_CURRENT_PROGRAM 0x8B8D\n#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0\n#define GL_LOWER_LEFT 0x8CA1\n#define GL_UPPER_LEFT 0x8CA2\n#define GL_STENCIL_BACK_REF 0x8CA3\n#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4\n#define GL_STENCIL_BACK_WRITEMASK 0x8CA5\n\ntypedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);\ntypedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name);\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum);\ntypedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader);\ntypedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void);\ntypedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type);\ntypedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program);\ntypedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader);\ntypedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);\ntypedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);\ntypedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs);\ntypedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);\ntypedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders);\ntypedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param);\ntypedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog);\ntypedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source);\ntypedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param);\ntypedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*);\ntypedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program);\ntypedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader);\ntypedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program);\ntypedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths);\ntypedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);\ntypedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint);\ntypedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program);\ntypedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer);\n\n#define glAttachShader GLEW_GET_FUN(__glewAttachShader)\n#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation)\n#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate)\n#define glCompileShader GLEW_GET_FUN(__glewCompileShader)\n#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram)\n#define glCreateShader GLEW_GET_FUN(__glewCreateShader)\n#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram)\n#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader)\n#define glDetachShader GLEW_GET_FUN(__glewDetachShader)\n#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray)\n#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers)\n#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray)\n#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib)\n#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform)\n#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders)\n#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation)\n#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog)\n#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv)\n#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog)\n#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource)\n#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv)\n#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation)\n#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv)\n#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv)\n#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv)\n#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv)\n#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv)\n#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv)\n#define glIsProgram GLEW_GET_FUN(__glewIsProgram)\n#define glIsShader GLEW_GET_FUN(__glewIsShader)\n#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram)\n#define glShaderSource GLEW_GET_FUN(__glewShaderSource)\n#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate)\n#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate)\n#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate)\n#define glUniform1f GLEW_GET_FUN(__glewUniform1f)\n#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv)\n#define glUniform1i GLEW_GET_FUN(__glewUniform1i)\n#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv)\n#define glUniform2f GLEW_GET_FUN(__glewUniform2f)\n#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv)\n#define glUniform2i GLEW_GET_FUN(__glewUniform2i)\n#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv)\n#define glUniform3f GLEW_GET_FUN(__glewUniform3f)\n#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv)\n#define glUniform3i GLEW_GET_FUN(__glewUniform3i)\n#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv)\n#define glUniform4f GLEW_GET_FUN(__glewUniform4f)\n#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv)\n#define glUniform4i GLEW_GET_FUN(__glewUniform4i)\n#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv)\n#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv)\n#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv)\n#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv)\n#define glUseProgram GLEW_GET_FUN(__glewUseProgram)\n#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram)\n#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d)\n#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv)\n#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f)\n#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv)\n#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s)\n#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv)\n#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d)\n#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv)\n#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f)\n#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv)\n#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s)\n#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv)\n#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d)\n#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv)\n#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f)\n#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv)\n#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s)\n#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv)\n#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv)\n#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv)\n#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv)\n#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub)\n#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv)\n#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv)\n#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv)\n#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv)\n#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d)\n#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv)\n#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f)\n#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv)\n#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv)\n#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s)\n#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv)\n#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv)\n#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv)\n#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv)\n#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)\n\n#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0)\n\n#endif /* GL_VERSION_2_0 */\n\n/* ----------------------------- GL_VERSION_2_1 ---------------------------- */\n\n#ifndef GL_VERSION_2_1\n#define GL_VERSION_2_1 1\n\n#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F\n#define GL_PIXEL_PACK_BUFFER 0x88EB\n#define GL_PIXEL_UNPACK_BUFFER 0x88EC\n#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED\n#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF\n#define GL_FLOAT_MAT2x3 0x8B65\n#define GL_FLOAT_MAT2x4 0x8B66\n#define GL_FLOAT_MAT3x2 0x8B67\n#define GL_FLOAT_MAT3x4 0x8B68\n#define GL_FLOAT_MAT4x2 0x8B69\n#define GL_FLOAT_MAT4x3 0x8B6A\n#define GL_SRGB 0x8C40\n#define GL_SRGB8 0x8C41\n#define GL_SRGB_ALPHA 0x8C42\n#define GL_SRGB8_ALPHA8 0x8C43\n#define GL_SLUMINANCE_ALPHA 0x8C44\n#define GL_SLUMINANCE8_ALPHA8 0x8C45\n#define GL_SLUMINANCE 0x8C46\n#define GL_SLUMINANCE8 0x8C47\n#define GL_COMPRESSED_SRGB 0x8C48\n#define GL_COMPRESSED_SRGB_ALPHA 0x8C49\n#define GL_COMPRESSED_SLUMINANCE 0x8C4A\n#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B\n\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);\n\n#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv)\n#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv)\n#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv)\n#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv)\n#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv)\n#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv)\n\n#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1)\n\n#endif /* GL_VERSION_2_1 */\n\n/* ----------------------------- GL_VERSION_3_0 ---------------------------- */\n\n#ifndef GL_VERSION_3_0\n#define GL_VERSION_3_0 1\n\n#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES\n#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5\n#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1\n#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3\n#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB\n#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0\n#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4\n#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2\n#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS\n#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001\n#define GL_MAJOR_VERSION 0x821B\n#define GL_MINOR_VERSION 0x821C\n#define GL_NUM_EXTENSIONS 0x821D\n#define GL_CONTEXT_FLAGS 0x821E\n#define GL_DEPTH_BUFFER 0x8223\n#define GL_STENCIL_BUFFER 0x8224\n#define GL_COMPRESSED_RED 0x8225\n#define GL_COMPRESSED_RG 0x8226\n#define GL_RGBA32F 0x8814\n#define GL_RGB32F 0x8815\n#define GL_RGBA16F 0x881A\n#define GL_RGB16F 0x881B\n#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD\n#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF\n#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904\n#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905\n#define GL_CLAMP_VERTEX_COLOR 0x891A\n#define GL_CLAMP_FRAGMENT_COLOR 0x891B\n#define GL_CLAMP_READ_COLOR 0x891C\n#define GL_FIXED_ONLY 0x891D\n#define GL_TEXTURE_RED_TYPE 0x8C10\n#define GL_TEXTURE_GREEN_TYPE 0x8C11\n#define GL_TEXTURE_BLUE_TYPE 0x8C12\n#define GL_TEXTURE_ALPHA_TYPE 0x8C13\n#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14\n#define GL_TEXTURE_INTENSITY_TYPE 0x8C15\n#define GL_TEXTURE_DEPTH_TYPE 0x8C16\n#define GL_UNSIGNED_NORMALIZED 0x8C17\n#define GL_TEXTURE_1D_ARRAY 0x8C18\n#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19\n#define GL_TEXTURE_2D_ARRAY 0x8C1A\n#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B\n#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C\n#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D\n#define GL_R11F_G11F_B10F 0x8C3A\n#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B\n#define GL_RGB9_E5 0x8C3D\n#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E\n#define GL_TEXTURE_SHARED_SIZE 0x8C3F\n#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76\n#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80\n#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83\n#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84\n#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85\n#define GL_PRIMITIVES_GENERATED 0x8C87\n#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88\n#define GL_RASTERIZER_DISCARD 0x8C89\n#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B\n#define GL_INTERLEAVED_ATTRIBS 0x8C8C\n#define GL_SEPARATE_ATTRIBS 0x8C8D\n#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F\n#define GL_RGBA32UI 0x8D70\n#define GL_RGB32UI 0x8D71\n#define GL_RGBA16UI 0x8D76\n#define GL_RGB16UI 0x8D77\n#define GL_RGBA8UI 0x8D7C\n#define GL_RGB8UI 0x8D7D\n#define GL_RGBA32I 0x8D82\n#define GL_RGB32I 0x8D83\n#define GL_RGBA16I 0x8D88\n#define GL_RGB16I 0x8D89\n#define GL_RGBA8I 0x8D8E\n#define GL_RGB8I 0x8D8F\n#define GL_RED_INTEGER 0x8D94\n#define GL_GREEN_INTEGER 0x8D95\n#define GL_BLUE_INTEGER 0x8D96\n#define GL_ALPHA_INTEGER 0x8D97\n#define GL_RGB_INTEGER 0x8D98\n#define GL_RGBA_INTEGER 0x8D99\n#define GL_BGR_INTEGER 0x8D9A\n#define GL_BGRA_INTEGER 0x8D9B\n#define GL_SAMPLER_1D_ARRAY 0x8DC0\n#define GL_SAMPLER_2D_ARRAY 0x8DC1\n#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3\n#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4\n#define GL_SAMPLER_CUBE_SHADOW 0x8DC5\n#define GL_UNSIGNED_INT_VEC2 0x8DC6\n#define GL_UNSIGNED_INT_VEC3 0x8DC7\n#define GL_UNSIGNED_INT_VEC4 0x8DC8\n#define GL_INT_SAMPLER_1D 0x8DC9\n#define GL_INT_SAMPLER_2D 0x8DCA\n#define GL_INT_SAMPLER_3D 0x8DCB\n#define GL_INT_SAMPLER_CUBE 0x8DCC\n#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE\n#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF\n#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1\n#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2\n#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3\n#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4\n#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6\n#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7\n#define GL_QUERY_WAIT 0x8E13\n#define GL_QUERY_NO_WAIT 0x8E14\n#define GL_QUERY_BY_REGION_WAIT 0x8E15\n#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16\n\ntypedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum);\ntypedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum);\ntypedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*);\ntypedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum);\ntypedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint);\ntypedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*);\ntypedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*);\ntypedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);\ntypedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint);\ntypedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint);\ntypedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*);\ntypedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*);\ntypedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint);\ntypedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*);\ntypedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*);\ntypedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*);\ntypedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint);\ntypedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*);\ntypedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*);\n\n#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender)\n#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback)\n#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation)\n#define glClampColor GLEW_GET_FUN(__glewClampColor)\n#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi)\n#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv)\n#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv)\n#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv)\n#define glColorMaski GLEW_GET_FUN(__glewColorMaski)\n#define glDisablei GLEW_GET_FUN(__glewDisablei)\n#define glEnablei GLEW_GET_FUN(__glewEnablei)\n#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender)\n#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback)\n#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v)\n#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation)\n#define glGetStringi GLEW_GET_FUN(__glewGetStringi)\n#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv)\n#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv)\n#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying)\n#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv)\n#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv)\n#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv)\n#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi)\n#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv)\n#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv)\n#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings)\n#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui)\n#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv)\n#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui)\n#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv)\n#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui)\n#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv)\n#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui)\n#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv)\n#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i)\n#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv)\n#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui)\n#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv)\n#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i)\n#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv)\n#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui)\n#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv)\n#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i)\n#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv)\n#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui)\n#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv)\n#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv)\n#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i)\n#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv)\n#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv)\n#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv)\n#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui)\n#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv)\n#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv)\n#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer)\n\n#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0)\n\n#endif /* GL_VERSION_3_0 */\n\n/* ----------------------------- GL_VERSION_3_1 ---------------------------- */\n\n#ifndef GL_VERSION_3_1\n#define GL_VERSION_3_1 1\n\n#define GL_TEXTURE_RECTANGLE 0x84F5\n#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6\n#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7\n#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8\n#define GL_SAMPLER_2D_RECT 0x8B63\n#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64\n#define GL_TEXTURE_BUFFER 0x8C2A\n#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B\n#define GL_TEXTURE_BINDING_BUFFER 0x8C2C\n#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D\n#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E\n#define GL_SAMPLER_BUFFER 0x8DC2\n#define GL_INT_SAMPLER_2D_RECT 0x8DCD\n#define GL_INT_SAMPLER_BUFFER 0x8DD0\n#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5\n#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8\n#define GL_RED_SNORM 0x8F90\n#define GL_RG_SNORM 0x8F91\n#define GL_RGB_SNORM 0x8F92\n#define GL_RGBA_SNORM 0x8F93\n#define GL_R8_SNORM 0x8F94\n#define GL_RG8_SNORM 0x8F95\n#define GL_RGB8_SNORM 0x8F96\n#define GL_RGBA8_SNORM 0x8F97\n#define GL_R16_SNORM 0x8F98\n#define GL_RG16_SNORM 0x8F99\n#define GL_RGB16_SNORM 0x8F9A\n#define GL_RGBA16_SNORM 0x8F9B\n#define GL_SIGNED_NORMALIZED 0x8F9C\n#define GL_PRIMITIVE_RESTART 0x8F9D\n#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E\n#define GL_BUFFER_ACCESS_FLAGS 0x911F\n#define GL_BUFFER_MAP_LENGTH 0x9120\n#define GL_BUFFER_MAP_OFFSET 0x9121\n\ntypedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei);\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei);\ntypedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint);\ntypedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint);\n\n#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced)\n#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced)\n#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex)\n#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer)\n\n#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1)\n\n#endif /* GL_VERSION_3_1 */\n\n/* ----------------------------- GL_VERSION_3_2 ---------------------------- */\n\n#ifndef GL_VERSION_3_2\n#define GL_VERSION_3_2 1\n\n#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001\n#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002\n#define GL_LINES_ADJACENCY 0x000A\n#define GL_LINE_STRIP_ADJACENCY 0x000B\n#define GL_TRIANGLES_ADJACENCY 0x000C\n#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D\n#define GL_PROGRAM_POINT_SIZE 0x8642\n#define GL_GEOMETRY_VERTICES_OUT 0x8916\n#define GL_GEOMETRY_INPUT_TYPE 0x8917\n#define GL_GEOMETRY_OUTPUT_TYPE 0x8918\n#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29\n#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8\n#define GL_GEOMETRY_SHADER 0x8DD9\n#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF\n#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0\n#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1\n#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122\n#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123\n#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124\n#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125\n#define GL_CONTEXT_PROFILE_MASK 0x9126\n\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint);\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *);\ntypedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *);\n\n#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture)\n#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v)\n#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v)\n\n#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2)\n\n#endif /* GL_VERSION_3_2 */\n\n/* ----------------------------- GL_VERSION_3_3 ---------------------------- */\n\n#ifndef GL_VERSION_3_3\n#define GL_VERSION_3_3 1\n\n#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE\n#define GL_ANY_SAMPLES_PASSED 0x8C2F\n#define GL_TEXTURE_SWIZZLE_R 0x8E42\n#define GL_TEXTURE_SWIZZLE_G 0x8E43\n#define GL_TEXTURE_SWIZZLE_B 0x8E44\n#define GL_TEXTURE_SWIZZLE_A 0x8E45\n#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46\n#define GL_RGB10_A2UI 0x906F\n\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);\n\n#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor)\n\n#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3)\n\n#endif /* GL_VERSION_3_3 */\n\n/* ----------------------------- GL_VERSION_4_0 ---------------------------- */\n\n#ifndef GL_VERSION_4_0\n#define GL_VERSION_4_0 1\n\n#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F\n#define GL_SAMPLE_SHADING 0x8C36\n#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37\n#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A\n#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B\n#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C\n#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D\n#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F\n#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009\n#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A\n#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B\n#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C\n#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D\n#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E\n#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F\n\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);\ntypedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value);\n\n#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei)\n#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi)\n#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei)\n#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci)\n#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading)\n\n#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0)\n\n#endif /* GL_VERSION_4_0 */\n\n/* ----------------------------- GL_VERSION_4_1 ---------------------------- */\n\n#ifndef GL_VERSION_4_1\n#define GL_VERSION_4_1 1\n\n#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1)\n\n#endif /* GL_VERSION_4_1 */\n\n/* ----------------------------- GL_VERSION_4_2 ---------------------------- */\n\n#ifndef GL_VERSION_4_2\n#define GL_VERSION_4_2 1\n\n#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2)\n\n#endif /* GL_VERSION_4_2 */\n\n/* -------------------------- GL_3DFX_multisample -------------------------- */\n\n#ifndef GL_3DFX_multisample\n#define GL_3DFX_multisample 1\n\n#define GL_MULTISAMPLE_3DFX 0x86B2\n#define GL_SAMPLE_BUFFERS_3DFX 0x86B3\n#define GL_SAMPLES_3DFX 0x86B4\n#define GL_MULTISAMPLE_BIT_3DFX 0x20000000\n\n#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample)\n\n#endif /* GL_3DFX_multisample */\n\n/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */\n\n#ifndef GL_3DFX_tbuffer\n#define GL_3DFX_tbuffer 1\n\ntypedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);\n\n#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX)\n\n#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer)\n\n#endif /* GL_3DFX_tbuffer */\n\n/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */\n\n#ifndef GL_3DFX_texture_compression_FXT1\n#define GL_3DFX_texture_compression_FXT1 1\n\n#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0\n#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1\n\n#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1)\n\n#endif /* GL_3DFX_texture_compression_FXT1 */\n\n/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */\n\n#ifndef GL_AMD_blend_minmax_factor\n#define GL_AMD_blend_minmax_factor 1\n\n#define GL_FACTOR_MIN_AMD 0x901C\n#define GL_FACTOR_MAX_AMD 0x901D\n\n#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor)\n\n#endif /* GL_AMD_blend_minmax_factor */\n\n/* ----------------------- GL_AMD_conservative_depth ----------------------- */\n\n#ifndef GL_AMD_conservative_depth\n#define GL_AMD_conservative_depth 1\n\n#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth)\n\n#endif /* GL_AMD_conservative_depth */\n\n/* -------------------------- GL_AMD_debug_output -------------------------- */\n\n#ifndef GL_AMD_debug_output\n#define GL_AMD_debug_output 1\n\n#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143\n#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144\n#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145\n#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146\n#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147\n#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148\n#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149\n#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A\n#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B\n#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C\n#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D\n#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E\n#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F\n#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150\n\ntypedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);\n\ntypedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void* userParam);\ntypedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);\ntypedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const char* buf);\ntypedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, char* message);\n\n#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD)\n#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD)\n#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD)\n#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD)\n\n#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output)\n\n#endif /* GL_AMD_debug_output */\n\n/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */\n\n#ifndef GL_AMD_depth_clamp_separate\n#define GL_AMD_depth_clamp_separate 1\n\n#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E\n#define GL_DEPTH_CLAMP_FAR_AMD 0x901F\n\n#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate)\n\n#endif /* GL_AMD_depth_clamp_separate */\n\n/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */\n\n#ifndef GL_AMD_draw_buffers_blend\n#define GL_AMD_draw_buffers_blend 1\n\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\n\n#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD)\n#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD)\n#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD)\n#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD)\n\n#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend)\n\n#endif /* GL_AMD_draw_buffers_blend */\n\n/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */\n\n#ifndef GL_AMD_multi_draw_indirect\n#define GL_AMD_multi_draw_indirect 1\n\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void* indirect, GLsizei primcount, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void* indirect, GLsizei primcount, GLsizei stride);\n\n#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD)\n#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD)\n\n#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect)\n\n#endif /* GL_AMD_multi_draw_indirect */\n\n/* ------------------------- GL_AMD_name_gen_delete ------------------------ */\n\n#ifndef GL_AMD_name_gen_delete\n#define GL_AMD_name_gen_delete 1\n\n#define GL_DATA_BUFFER_AMD 0x9151\n#define GL_PERFORMANCE_MONITOR_AMD 0x9152\n#define GL_QUERY_OBJECT_AMD 0x9153\n#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154\n#define GL_SAMPLER_OBJECT_AMD 0x9155\n\ntypedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names);\ntypedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names);\ntypedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);\n\n#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD)\n#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD)\n#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD)\n\n#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete)\n\n#endif /* GL_AMD_name_gen_delete */\n\n/* ----------------------- GL_AMD_performance_monitor ---------------------- */\n\n#ifndef GL_AMD_performance_monitor\n#define GL_AMD_performance_monitor 1\n\n#define GL_UNSIGNED_INT 0x1405\n#define GL_FLOAT 0x1406\n#define GL_COUNTER_TYPE_AMD 0x8BC0\n#define GL_COUNTER_RANGE_AMD 0x8BC1\n#define GL_UNSIGNED_INT64_AMD 0x8BC2\n#define GL_PERCENTAGE_AMD 0x8BC3\n#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4\n#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5\n#define GL_PERFMON_RESULT_AMD 0x8BC6\n\ntypedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);\ntypedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors);\ntypedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);\ntypedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors);\ntypedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten);\ntypedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void* data);\ntypedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char *counterString);\ntypedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters);\ntypedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, char *groupString);\ntypedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups);\ntypedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList);\n\n#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD)\n#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD)\n#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD)\n#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD)\n#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD)\n#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD)\n#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD)\n#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD)\n#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD)\n#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD)\n#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD)\n\n#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor)\n\n#endif /* GL_AMD_performance_monitor */\n\n/* ------------------------ GL_AMD_sample_positions ------------------------ */\n\n#ifndef GL_AMD_sample_positions\n#define GL_AMD_sample_positions 1\n\n#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F\n\ntypedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val);\n\n#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD)\n\n#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions)\n\n#endif /* GL_AMD_sample_positions */\n\n/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */\n\n#ifndef GL_AMD_seamless_cubemap_per_texture\n#define GL_AMD_seamless_cubemap_per_texture 1\n\n#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F\n\n#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture)\n\n#endif /* GL_AMD_seamless_cubemap_per_texture */\n\n/* ---------------------- GL_AMD_shader_stencil_export --------------------- */\n\n#ifndef GL_AMD_shader_stencil_export\n#define GL_AMD_shader_stencil_export 1\n\n#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export)\n\n#endif /* GL_AMD_shader_stencil_export */\n\n/* ------------------------ GL_AMD_texture_texture4 ------------------------ */\n\n#ifndef GL_AMD_texture_texture4\n#define GL_AMD_texture_texture4 1\n\n#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4)\n\n#endif /* GL_AMD_texture_texture4 */\n\n/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */\n\n#ifndef GL_AMD_transform_feedback3_lines_triangles\n#define GL_AMD_transform_feedback3_lines_triangles 1\n\n#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles)\n\n#endif /* GL_AMD_transform_feedback3_lines_triangles */\n\n/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */\n\n#ifndef GL_AMD_vertex_shader_tessellator\n#define GL_AMD_vertex_shader_tessellator 1\n\n#define GL_SAMPLER_BUFFER_AMD 0x9001\n#define GL_INT_SAMPLER_BUFFER_AMD 0x9002\n#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003\n#define GL_TESSELLATION_MODE_AMD 0x9004\n#define GL_TESSELLATION_FACTOR_AMD 0x9005\n#define GL_DISCRETE_AMD 0x9006\n#define GL_CONTINUOUS_AMD 0x9007\n\ntypedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);\ntypedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);\n\n#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD)\n#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD)\n\n#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator)\n\n#endif /* GL_AMD_vertex_shader_tessellator */\n\n/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */\n\n#ifndef GL_APPLE_aux_depth_stencil\n#define GL_APPLE_aux_depth_stencil 1\n\n#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14\n\n#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil)\n\n#endif /* GL_APPLE_aux_depth_stencil */\n\n/* ------------------------ GL_APPLE_client_storage ------------------------ */\n\n#ifndef GL_APPLE_client_storage\n#define GL_APPLE_client_storage 1\n\n#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2\n\n#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage)\n\n#endif /* GL_APPLE_client_storage */\n\n/* ------------------------- GL_APPLE_element_array ------------------------ */\n\n#ifndef GL_APPLE_element_array\n#define GL_APPLE_element_array 1\n\n#define GL_ELEMENT_ARRAY_APPLE 0x8A0C\n#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D\n#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E\n\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);\ntypedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);\ntypedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount);\n\n#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE)\n#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE)\n#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE)\n#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE)\n#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE)\n\n#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array)\n\n#endif /* GL_APPLE_element_array */\n\n/* ----------------------------- GL_APPLE_fence ---------------------------- */\n\n#ifndef GL_APPLE_fence\n#define GL_APPLE_fence 1\n\n#define GL_DRAW_PIXELS_APPLE 0x8A0A\n#define GL_FENCE_APPLE 0x8A0B\n\ntypedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences);\ntypedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);\ntypedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);\ntypedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences);\ntypedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence);\ntypedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence);\ntypedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence);\ntypedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);\n\n#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE)\n#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE)\n#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE)\n#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE)\n#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE)\n#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE)\n#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE)\n#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE)\n\n#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence)\n\n#endif /* GL_APPLE_fence */\n\n/* ------------------------- GL_APPLE_float_pixels ------------------------- */\n\n#ifndef GL_APPLE_float_pixels\n#define GL_APPLE_float_pixels 1\n\n#define GL_HALF_APPLE 0x140B\n#define GL_RGBA_FLOAT32_APPLE 0x8814\n#define GL_RGB_FLOAT32_APPLE 0x8815\n#define GL_ALPHA_FLOAT32_APPLE 0x8816\n#define GL_INTENSITY_FLOAT32_APPLE 0x8817\n#define GL_LUMINANCE_FLOAT32_APPLE 0x8818\n#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819\n#define GL_RGBA_FLOAT16_APPLE 0x881A\n#define GL_RGB_FLOAT16_APPLE 0x881B\n#define GL_ALPHA_FLOAT16_APPLE 0x881C\n#define GL_INTENSITY_FLOAT16_APPLE 0x881D\n#define GL_LUMINANCE_FLOAT16_APPLE 0x881E\n#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F\n#define GL_COLOR_FLOAT_APPLE 0x8A0F\n\n#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels)\n\n#endif /* GL_APPLE_float_pixels */\n\n/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */\n\n#ifndef GL_APPLE_flush_buffer_range\n#define GL_APPLE_flush_buffer_range 1\n\n#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12\n#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13\n\ntypedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);\n\n#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE)\n#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE)\n\n#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range)\n\n#endif /* GL_APPLE_flush_buffer_range */\n\n/* ----------------------- GL_APPLE_object_purgeable ----------------------- */\n\n#ifndef GL_APPLE_object_purgeable\n#define GL_APPLE_object_purgeable 1\n\n#define GL_BUFFER_OBJECT_APPLE 0x85B3\n#define GL_RELEASED_APPLE 0x8A19\n#define GL_VOLATILE_APPLE 0x8A1A\n#define GL_RETAINED_APPLE 0x8A1B\n#define GL_UNDEFINED_APPLE 0x8A1C\n#define GL_PURGEABLE_APPLE 0x8A1D\n\ntypedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params);\ntypedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);\ntypedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);\n\n#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE)\n#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE)\n#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE)\n\n#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable)\n\n#endif /* GL_APPLE_object_purgeable */\n\n/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */\n\n#ifndef GL_APPLE_pixel_buffer\n#define GL_APPLE_pixel_buffer 1\n\n#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10\n\n#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer)\n\n#endif /* GL_APPLE_pixel_buffer */\n\n/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */\n\n#ifndef GL_APPLE_rgb_422\n#define GL_APPLE_rgb_422 1\n\n#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA\n#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB\n#define GL_RGB_422_APPLE 0x8A1F\n\n#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422)\n\n#endif /* GL_APPLE_rgb_422 */\n\n/* --------------------------- GL_APPLE_row_bytes -------------------------- */\n\n#ifndef GL_APPLE_row_bytes\n#define GL_APPLE_row_bytes 1\n\n#define GL_PACK_ROW_BYTES_APPLE 0x8A15\n#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16\n\n#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes)\n\n#endif /* GL_APPLE_row_bytes */\n\n/* ------------------------ GL_APPLE_specular_vector ----------------------- */\n\n#ifndef GL_APPLE_specular_vector\n#define GL_APPLE_specular_vector 1\n\n#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0\n\n#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector)\n\n#endif /* GL_APPLE_specular_vector */\n\n/* ------------------------- GL_APPLE_texture_range ------------------------ */\n\n#ifndef GL_APPLE_texture_range\n#define GL_APPLE_texture_range 1\n\n#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7\n#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8\n#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC\n#define GL_STORAGE_PRIVATE_APPLE 0x85BD\n#define GL_STORAGE_CACHED_APPLE 0x85BE\n#define GL_STORAGE_SHARED_APPLE 0x85BF\n\ntypedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params);\ntypedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer);\n\n#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE)\n#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE)\n\n#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range)\n\n#endif /* GL_APPLE_texture_range */\n\n/* ------------------------ GL_APPLE_transform_hint ------------------------ */\n\n#ifndef GL_APPLE_transform_hint\n#define GL_APPLE_transform_hint 1\n\n#define GL_TRANSFORM_HINT_APPLE 0x85B1\n\n#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint)\n\n#endif /* GL_APPLE_transform_hint */\n\n/* ---------------------- GL_APPLE_vertex_array_object --------------------- */\n\n#ifndef GL_APPLE_vertex_array_object\n#define GL_APPLE_vertex_array_object 1\n\n#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5\n\ntypedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);\ntypedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays);\ntypedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays);\ntypedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);\n\n#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE)\n#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE)\n#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE)\n#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE)\n\n#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object)\n\n#endif /* GL_APPLE_vertex_array_object */\n\n/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */\n\n#ifndef GL_APPLE_vertex_array_range\n#define GL_APPLE_vertex_array_range 1\n\n#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D\n#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E\n#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F\n#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520\n#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521\n#define GL_STORAGE_CLIENT_APPLE 0x85B4\n#define GL_STORAGE_CACHED_APPLE 0x85BE\n#define GL_STORAGE_SHARED_APPLE 0x85BF\n\ntypedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer);\n\n#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE)\n#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE)\n#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE)\n\n#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range)\n\n#endif /* GL_APPLE_vertex_array_range */\n\n/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */\n\n#ifndef GL_APPLE_vertex_program_evaluators\n#define GL_APPLE_vertex_program_evaluators 1\n\n#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00\n#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01\n#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02\n#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03\n#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04\n#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05\n#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06\n#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07\n#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08\n#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09\n\ntypedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);\ntypedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);\ntypedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);\ntypedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points);\ntypedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points);\ntypedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points);\ntypedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points);\n\n#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE)\n#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE)\n#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE)\n#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE)\n#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE)\n#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE)\n#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE)\n\n#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators)\n\n#endif /* GL_APPLE_vertex_program_evaluators */\n\n/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */\n\n#ifndef GL_APPLE_ycbcr_422\n#define GL_APPLE_ycbcr_422 1\n\n#define GL_YCBCR_422_APPLE 0x85B9\n#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA\n#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB\n\n#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422)\n\n#endif /* GL_APPLE_ycbcr_422 */\n\n/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */\n\n#ifndef GL_ARB_ES2_compatibility\n#define GL_ARB_ES2_compatibility 1\n\n#define GL_FIXED 0x140C\n#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A\n#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B\n#define GL_LOW_FLOAT 0x8DF0\n#define GL_MEDIUM_FLOAT 0x8DF1\n#define GL_HIGH_FLOAT 0x8DF2\n#define GL_LOW_INT 0x8DF3\n#define GL_MEDIUM_INT 0x8DF4\n#define GL_HIGH_INT 0x8DF5\n#define GL_SHADER_BINARY_FORMATS 0x8DF8\n#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9\n#define GL_SHADER_COMPILER 0x8DFA\n#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB\n#define GL_MAX_VARYING_VECTORS 0x8DFC\n#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD\n\ntypedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d);\ntypedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f);\ntypedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision);\ntypedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length);\n\n#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf)\n#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef)\n#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat)\n#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler)\n#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary)\n\n#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility)\n\n#endif /* GL_ARB_ES2_compatibility */\n\n/* -------------------------- GL_ARB_base_instance ------------------------- */\n\n#ifndef GL_ARB_base_instance\n#define GL_ARB_base_instance 1\n\ntypedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance);\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLuint baseinstance);\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex, GLuint baseinstance);\n\n#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance)\n#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance)\n#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance)\n\n#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance)\n\n#endif /* GL_ARB_base_instance */\n\n/* ----------------------- GL_ARB_blend_func_extended ---------------------- */\n\n#ifndef GL_ARB_blend_func_extended\n#define GL_ARB_blend_func_extended 1\n\n#define GL_SRC1_COLOR 0x88F9\n#define GL_ONE_MINUS_SRC1_COLOR 0x88FA\n#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB\n#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC\n\ntypedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const char * name);\ntypedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const char * name);\n\n#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed)\n#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex)\n\n#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended)\n\n#endif /* GL_ARB_blend_func_extended */\n\n/* ---------------------------- GL_ARB_cl_event ---------------------------- */\n\n#ifndef GL_ARB_cl_event\n#define GL_ARB_cl_event 1\n\n#define GL_SYNC_CL_EVENT_ARB 0x8240\n#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241\n\ntypedef struct _cl_context *cl_context;\ntypedef struct _cl_event *cl_event;\n\ntypedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags);\n\n#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB)\n\n#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event)\n\n#endif /* GL_ARB_cl_event */\n\n/* ----------------------- GL_ARB_color_buffer_float ----------------------- */\n\n#ifndef GL_ARB_color_buffer_float\n#define GL_ARB_color_buffer_float 1\n\n#define GL_RGBA_FLOAT_MODE_ARB 0x8820\n#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A\n#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B\n#define GL_CLAMP_READ_COLOR_ARB 0x891C\n#define GL_FIXED_ONLY_ARB 0x891D\n\ntypedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);\n\n#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB)\n\n#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float)\n\n#endif /* GL_ARB_color_buffer_float */\n\n/* -------------------------- GL_ARB_compatibility ------------------------- */\n\n#ifndef GL_ARB_compatibility\n#define GL_ARB_compatibility 1\n\n#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility)\n\n#endif /* GL_ARB_compatibility */\n\n/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */\n\n#ifndef GL_ARB_compressed_texture_pixel_storage\n#define GL_ARB_compressed_texture_pixel_storage 1\n\n#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127\n#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128\n#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129\n#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A\n#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B\n#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C\n#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D\n#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E\n\n#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage)\n\n#endif /* GL_ARB_compressed_texture_pixel_storage */\n\n/* ----------------------- GL_ARB_conservative_depth ----------------------- */\n\n#ifndef GL_ARB_conservative_depth\n#define GL_ARB_conservative_depth 1\n\n#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth)\n\n#endif /* GL_ARB_conservative_depth */\n\n/* --------------------------- GL_ARB_copy_buffer -------------------------- */\n\n#ifndef GL_ARB_copy_buffer\n#define GL_ARB_copy_buffer 1\n\n#define GL_COPY_READ_BUFFER 0x8F36\n#define GL_COPY_WRITE_BUFFER 0x8F37\n\ntypedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);\n\n#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData)\n\n#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer)\n\n#endif /* GL_ARB_copy_buffer */\n\n/* -------------------------- GL_ARB_debug_output -------------------------- */\n\n#ifndef GL_ARB_debug_output\n#define GL_ARB_debug_output 1\n\n#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242\n#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243\n#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244\n#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245\n#define GL_DEBUG_SOURCE_API_ARB 0x8246\n#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247\n#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248\n#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249\n#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A\n#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B\n#define GL_DEBUG_TYPE_ERROR_ARB 0x824C\n#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D\n#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E\n#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F\n#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250\n#define GL_DEBUG_TYPE_OTHER_ARB 0x8251\n#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143\n#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144\n#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145\n#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146\n#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147\n#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148\n\ntypedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);\n\ntypedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, void* userParam);\ntypedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);\ntypedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* buf);\ntypedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, char* messageLog);\n\n#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB)\n#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB)\n#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB)\n#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB)\n\n#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output)\n\n#endif /* GL_ARB_debug_output */\n\n/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */\n\n#ifndef GL_ARB_depth_buffer_float\n#define GL_ARB_depth_buffer_float 1\n\n#define GL_DEPTH_COMPONENT32F 0x8CAC\n#define GL_DEPTH32F_STENCIL8 0x8CAD\n#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD\n\n#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float)\n\n#endif /* GL_ARB_depth_buffer_float */\n\n/* --------------------------- GL_ARB_depth_clamp -------------------------- */\n\n#ifndef GL_ARB_depth_clamp\n#define GL_ARB_depth_clamp 1\n\n#define GL_DEPTH_CLAMP 0x864F\n\n#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp)\n\n#endif /* GL_ARB_depth_clamp */\n\n/* -------------------------- GL_ARB_depth_texture ------------------------- */\n\n#ifndef GL_ARB_depth_texture\n#define GL_ARB_depth_texture 1\n\n#define GL_DEPTH_COMPONENT16_ARB 0x81A5\n#define GL_DEPTH_COMPONENT24_ARB 0x81A6\n#define GL_DEPTH_COMPONENT32_ARB 0x81A7\n#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A\n#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B\n\n#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture)\n\n#endif /* GL_ARB_depth_texture */\n\n/* -------------------------- GL_ARB_draw_buffers -------------------------- */\n\n#ifndef GL_ARB_draw_buffers\n#define GL_ARB_draw_buffers 1\n\n#define GL_MAX_DRAW_BUFFERS_ARB 0x8824\n#define GL_DRAW_BUFFER0_ARB 0x8825\n#define GL_DRAW_BUFFER1_ARB 0x8826\n#define GL_DRAW_BUFFER2_ARB 0x8827\n#define GL_DRAW_BUFFER3_ARB 0x8828\n#define GL_DRAW_BUFFER4_ARB 0x8829\n#define GL_DRAW_BUFFER5_ARB 0x882A\n#define GL_DRAW_BUFFER6_ARB 0x882B\n#define GL_DRAW_BUFFER7_ARB 0x882C\n#define GL_DRAW_BUFFER8_ARB 0x882D\n#define GL_DRAW_BUFFER9_ARB 0x882E\n#define GL_DRAW_BUFFER10_ARB 0x882F\n#define GL_DRAW_BUFFER11_ARB 0x8830\n#define GL_DRAW_BUFFER12_ARB 0x8831\n#define GL_DRAW_BUFFER13_ARB 0x8832\n#define GL_DRAW_BUFFER14_ARB 0x8833\n#define GL_DRAW_BUFFER15_ARB 0x8834\n\ntypedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs);\n\n#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB)\n\n#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers)\n\n#endif /* GL_ARB_draw_buffers */\n\n/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */\n\n#ifndef GL_ARB_draw_buffers_blend\n#define GL_ARB_draw_buffers_blend 1\n\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);\n\n#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB)\n#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB)\n#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB)\n#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB)\n\n#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend)\n\n#endif /* GL_ARB_draw_buffers_blend */\n\n/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */\n\n#ifndef GL_ARB_draw_elements_base_vertex\n#define GL_ARB_draw_elements_base_vertex 1\n\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void* indices, GLint basevertex);\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex);\ntypedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void* indices, GLint basevertex);\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, GLvoid**indices, GLsizei primcount, GLint *basevertex);\n\n#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex)\n#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex)\n#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex)\n#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex)\n\n#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex)\n\n#endif /* GL_ARB_draw_elements_base_vertex */\n\n/* -------------------------- GL_ARB_draw_indirect ------------------------- */\n\n#ifndef GL_ARB_draw_indirect\n#define GL_ARB_draw_indirect 1\n\n#define GL_DRAW_INDIRECT_BUFFER 0x8F3F\n#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43\n\ntypedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect);\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect);\n\n#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect)\n#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect)\n\n#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect)\n\n#endif /* GL_ARB_draw_indirect */\n\n/* ------------------------- GL_ARB_draw_instanced ------------------------- */\n\n#ifndef GL_ARB_draw_instanced\n#define GL_ARB_draw_instanced 1\n\n#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced)\n\n#endif /* GL_ARB_draw_instanced */\n\n/* -------------------- GL_ARB_explicit_attrib_location -------------------- */\n\n#ifndef GL_ARB_explicit_attrib_location\n#define GL_ARB_explicit_attrib_location 1\n\n#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location)\n\n#endif /* GL_ARB_explicit_attrib_location */\n\n/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */\n\n#ifndef GL_ARB_fragment_coord_conventions\n#define GL_ARB_fragment_coord_conventions 1\n\n#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions)\n\n#endif /* GL_ARB_fragment_coord_conventions */\n\n/* ------------------------ GL_ARB_fragment_program ------------------------ */\n\n#ifndef GL_ARB_fragment_program\n#define GL_ARB_fragment_program 1\n\n#define GL_FRAGMENT_PROGRAM_ARB 0x8804\n#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805\n#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806\n#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807\n#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808\n#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809\n#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A\n#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B\n#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C\n#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D\n#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E\n#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F\n#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810\n#define GL_MAX_TEXTURE_COORDS_ARB 0x8871\n#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872\n\n#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program)\n\n#endif /* GL_ARB_fragment_program */\n\n/* --------------------- GL_ARB_fragment_program_shadow -------------------- */\n\n#ifndef GL_ARB_fragment_program_shadow\n#define GL_ARB_fragment_program_shadow 1\n\n#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow)\n\n#endif /* GL_ARB_fragment_program_shadow */\n\n/* ------------------------- GL_ARB_fragment_shader ------------------------ */\n\n#ifndef GL_ARB_fragment_shader\n#define GL_ARB_fragment_shader 1\n\n#define GL_FRAGMENT_SHADER_ARB 0x8B30\n#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49\n#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B\n\n#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader)\n\n#endif /* GL_ARB_fragment_shader */\n\n/* ----------------------- GL_ARB_framebuffer_object ----------------------- */\n\n#ifndef GL_ARB_framebuffer_object\n#define GL_ARB_framebuffer_object 1\n\n#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506\n#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210\n#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211\n#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212\n#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213\n#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214\n#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215\n#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216\n#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217\n#define GL_FRAMEBUFFER_DEFAULT 0x8218\n#define GL_FRAMEBUFFER_UNDEFINED 0x8219\n#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A\n#define GL_INDEX 0x8222\n#define GL_MAX_RENDERBUFFER_SIZE 0x84E8\n#define GL_DEPTH_STENCIL 0x84F9\n#define GL_UNSIGNED_INT_24_8 0x84FA\n#define GL_DEPTH24_STENCIL8 0x88F0\n#define GL_TEXTURE_STENCIL_SIZE 0x88F1\n#define GL_UNSIGNED_NORMALIZED 0x8C17\n#define GL_SRGB 0x8C40\n#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6\n#define GL_FRAMEBUFFER_BINDING 0x8CA6\n#define GL_RENDERBUFFER_BINDING 0x8CA7\n#define GL_READ_FRAMEBUFFER 0x8CA8\n#define GL_DRAW_FRAMEBUFFER 0x8CA9\n#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA\n#define GL_RENDERBUFFER_SAMPLES 0x8CAB\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4\n#define GL_FRAMEBUFFER_COMPLETE 0x8CD5\n#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6\n#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7\n#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB\n#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC\n#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD\n#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF\n#define GL_COLOR_ATTACHMENT0 0x8CE0\n#define GL_COLOR_ATTACHMENT1 0x8CE1\n#define GL_COLOR_ATTACHMENT2 0x8CE2\n#define GL_COLOR_ATTACHMENT3 0x8CE3\n#define GL_COLOR_ATTACHMENT4 0x8CE4\n#define GL_COLOR_ATTACHMENT5 0x8CE5\n#define GL_COLOR_ATTACHMENT6 0x8CE6\n#define GL_COLOR_ATTACHMENT7 0x8CE7\n#define GL_COLOR_ATTACHMENT8 0x8CE8\n#define GL_COLOR_ATTACHMENT9 0x8CE9\n#define GL_COLOR_ATTACHMENT10 0x8CEA\n#define GL_COLOR_ATTACHMENT11 0x8CEB\n#define GL_COLOR_ATTACHMENT12 0x8CEC\n#define GL_COLOR_ATTACHMENT13 0x8CED\n#define GL_COLOR_ATTACHMENT14 0x8CEE\n#define GL_COLOR_ATTACHMENT15 0x8CEF\n#define GL_DEPTH_ATTACHMENT 0x8D00\n#define GL_STENCIL_ATTACHMENT 0x8D20\n#define GL_FRAMEBUFFER 0x8D40\n#define GL_RENDERBUFFER 0x8D41\n#define GL_RENDERBUFFER_WIDTH 0x8D42\n#define GL_RENDERBUFFER_HEIGHT 0x8D43\n#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44\n#define GL_STENCIL_INDEX1 0x8D46\n#define GL_STENCIL_INDEX4 0x8D47\n#define GL_STENCIL_INDEX8 0x8D48\n#define GL_STENCIL_INDEX16 0x8D49\n#define GL_RENDERBUFFER_RED_SIZE 0x8D50\n#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51\n#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52\n#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53\n#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54\n#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55\n#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56\n#define GL_MAX_SAMPLES 0x8D57\n\ntypedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);\ntypedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\ntypedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers);\ntypedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);\ntypedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers);\ntypedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers);\ntypedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);\ntypedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\n\n#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer)\n#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer)\n#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer)\n#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus)\n#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers)\n#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers)\n#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer)\n#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D)\n#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D)\n#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D)\n#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer)\n#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers)\n#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers)\n#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap)\n#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv)\n#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv)\n#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer)\n#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer)\n#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage)\n#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample)\n\n#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object)\n\n#endif /* GL_ARB_framebuffer_object */\n\n/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */\n\n#ifndef GL_ARB_framebuffer_sRGB\n#define GL_ARB_framebuffer_sRGB 1\n\n#define GL_FRAMEBUFFER_SRGB 0x8DB9\n\n#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB)\n\n#endif /* GL_ARB_framebuffer_sRGB */\n\n/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */\n\n#ifndef GL_ARB_geometry_shader4\n#define GL_ARB_geometry_shader4 1\n\n#define GL_LINES_ADJACENCY_ARB 0xA\n#define GL_LINE_STRIP_ADJACENCY_ARB 0xB\n#define GL_TRIANGLES_ADJACENCY_ARB 0xC\n#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD\n#define GL_PROGRAM_POINT_SIZE_ARB 0x8642\n#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4\n#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9\n#define GL_GEOMETRY_SHADER_ARB 0x8DD9\n#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA\n#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB\n#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC\n#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD\n#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE\n#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF\n#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0\n#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1\n\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);\n\n#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB)\n#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB)\n#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB)\n#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB)\n\n#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4)\n\n#endif /* GL_ARB_geometry_shader4 */\n\n/* ----------------------- GL_ARB_get_program_binary ----------------------- */\n\n#ifndef GL_ARB_get_program_binary\n#define GL_ARB_get_program_binary 1\n\n#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257\n#define GL_PROGRAM_BINARY_LENGTH 0x8741\n#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE\n#define GL_PROGRAM_BINARY_FORMATS 0x87FF\n\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void* binary, GLsizei length);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);\n\n#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary)\n#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary)\n#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri)\n\n#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary)\n\n#endif /* GL_ARB_get_program_binary */\n\n/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */\n\n#ifndef GL_ARB_gpu_shader5\n#define GL_ARB_gpu_shader5 1\n\n#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F\n#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A\n#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B\n#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C\n#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D\n#define GL_MAX_VERTEX_STREAMS 0x8E71\n\n#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5)\n\n#endif /* GL_ARB_gpu_shader5 */\n\n/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */\n\n#ifndef GL_ARB_gpu_shader_fp64\n#define GL_ARB_gpu_shader_fp64 1\n\n#define GL_DOUBLE_MAT2 0x8F46\n#define GL_DOUBLE_MAT3 0x8F47\n#define GL_DOUBLE_MAT4 0x8F48\n#define GL_DOUBLE_MAT2x3 0x8F49\n#define GL_DOUBLE_MAT2x4 0x8F4A\n#define GL_DOUBLE_MAT3x2 0x8F4B\n#define GL_DOUBLE_MAT3x4 0x8F4C\n#define GL_DOUBLE_MAT4x2 0x8F4D\n#define GL_DOUBLE_MAT4x3 0x8F4E\n#define GL_DOUBLE_VEC2 0x8FFC\n#define GL_DOUBLE_VEC3 0x8FFD\n#define GL_DOUBLE_VEC4 0x8FFE\n\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\n\n#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv)\n#define glProgramUniform1dEXT GLEW_GET_FUN(__glewProgramUniform1dEXT)\n#define glProgramUniform1dvEXT GLEW_GET_FUN(__glewProgramUniform1dvEXT)\n#define glProgramUniform2dEXT GLEW_GET_FUN(__glewProgramUniform2dEXT)\n#define glProgramUniform2dvEXT GLEW_GET_FUN(__glewProgramUniform2dvEXT)\n#define glProgramUniform3dEXT GLEW_GET_FUN(__glewProgramUniform3dEXT)\n#define glProgramUniform3dvEXT GLEW_GET_FUN(__glewProgramUniform3dvEXT)\n#define glProgramUniform4dEXT GLEW_GET_FUN(__glewProgramUniform4dEXT)\n#define glProgramUniform4dvEXT GLEW_GET_FUN(__glewProgramUniform4dvEXT)\n#define glProgramUniformMatrix2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2dvEXT)\n#define glProgramUniformMatrix2x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3dvEXT)\n#define glProgramUniformMatrix2x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4dvEXT)\n#define glProgramUniformMatrix3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3dvEXT)\n#define glProgramUniformMatrix3x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2dvEXT)\n#define glProgramUniformMatrix3x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4dvEXT)\n#define glProgramUniformMatrix4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4dvEXT)\n#define glProgramUniformMatrix4x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2dvEXT)\n#define glProgramUniformMatrix4x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3dvEXT)\n#define glUniform1d GLEW_GET_FUN(__glewUniform1d)\n#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv)\n#define glUniform2d GLEW_GET_FUN(__glewUniform2d)\n#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv)\n#define glUniform3d GLEW_GET_FUN(__glewUniform3d)\n#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv)\n#define glUniform4d GLEW_GET_FUN(__glewUniform4d)\n#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv)\n#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv)\n#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv)\n#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv)\n#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv)\n#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv)\n#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv)\n#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv)\n#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv)\n#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv)\n\n#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64)\n\n#endif /* GL_ARB_gpu_shader_fp64 */\n\n/* ------------------------ GL_ARB_half_float_pixel ------------------------ */\n\n#ifndef GL_ARB_half_float_pixel\n#define GL_ARB_half_float_pixel 1\n\n#define GL_HALF_FLOAT_ARB 0x140B\n\n#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel)\n\n#endif /* GL_ARB_half_float_pixel */\n\n/* ------------------------ GL_ARB_half_float_vertex ----------------------- */\n\n#ifndef GL_ARB_half_float_vertex\n#define GL_ARB_half_float_vertex 1\n\n#define GL_HALF_FLOAT 0x140B\n\n#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex)\n\n#endif /* GL_ARB_half_float_vertex */\n\n/* ----------------------------- GL_ARB_imaging ---------------------------- */\n\n#ifndef GL_ARB_imaging\n#define GL_ARB_imaging 1\n\n#define GL_CONSTANT_COLOR 0x8001\n#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002\n#define GL_CONSTANT_ALPHA 0x8003\n#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004\n#define GL_BLEND_COLOR 0x8005\n#define GL_FUNC_ADD 0x8006\n#define GL_MIN 0x8007\n#define GL_MAX 0x8008\n#define GL_BLEND_EQUATION 0x8009\n#define GL_FUNC_SUBTRACT 0x800A\n#define GL_FUNC_REVERSE_SUBTRACT 0x800B\n#define GL_CONVOLUTION_1D 0x8010\n#define GL_CONVOLUTION_2D 0x8011\n#define GL_SEPARABLE_2D 0x8012\n#define GL_CONVOLUTION_BORDER_MODE 0x8013\n#define GL_CONVOLUTION_FILTER_SCALE 0x8014\n#define GL_CONVOLUTION_FILTER_BIAS 0x8015\n#define GL_REDUCE 0x8016\n#define GL_CONVOLUTION_FORMAT 0x8017\n#define GL_CONVOLUTION_WIDTH 0x8018\n#define GL_CONVOLUTION_HEIGHT 0x8019\n#define GL_MAX_CONVOLUTION_WIDTH 0x801A\n#define GL_MAX_CONVOLUTION_HEIGHT 0x801B\n#define GL_POST_CONVOLUTION_RED_SCALE 0x801C\n#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D\n#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E\n#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F\n#define GL_POST_CONVOLUTION_RED_BIAS 0x8020\n#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021\n#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022\n#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023\n#define GL_HISTOGRAM 0x8024\n#define GL_PROXY_HISTOGRAM 0x8025\n#define GL_HISTOGRAM_WIDTH 0x8026\n#define GL_HISTOGRAM_FORMAT 0x8027\n#define GL_HISTOGRAM_RED_SIZE 0x8028\n#define GL_HISTOGRAM_GREEN_SIZE 0x8029\n#define GL_HISTOGRAM_BLUE_SIZE 0x802A\n#define GL_HISTOGRAM_ALPHA_SIZE 0x802B\n#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C\n#define GL_HISTOGRAM_SINK 0x802D\n#define GL_MINMAX 0x802E\n#define GL_MINMAX_FORMAT 0x802F\n#define GL_MINMAX_SINK 0x8030\n#define GL_TABLE_TOO_LARGE 0x8031\n#define GL_COLOR_MATRIX 0x80B1\n#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2\n#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3\n#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4\n#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5\n#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6\n#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7\n#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8\n#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9\n#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA\n#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB\n#define GL_COLOR_TABLE 0x80D0\n#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1\n#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2\n#define GL_PROXY_COLOR_TABLE 0x80D3\n#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4\n#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5\n#define GL_COLOR_TABLE_SCALE 0x80D6\n#define GL_COLOR_TABLE_BIAS 0x80D7\n#define GL_COLOR_TABLE_FORMAT 0x80D8\n#define GL_COLOR_TABLE_WIDTH 0x80D9\n#define GL_COLOR_TABLE_RED_SIZE 0x80DA\n#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB\n#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC\n#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD\n#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE\n#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF\n#define GL_IGNORE_BORDER 0x8150\n#define GL_CONSTANT_BORDER 0x8151\n#define GL_WRAP_BORDER 0x8152\n#define GL_REPLICATE_BORDER 0x8153\n#define GL_CONVOLUTION_BORDER_COLOR 0x8154\n\ntypedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);\ntypedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);\ntypedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);\ntypedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);\ntypedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);\ntypedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);\ntypedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);\ntypedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);\ntypedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);\n\n#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable)\n#define glColorTable GLEW_GET_FUN(__glewColorTable)\n#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv)\n#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv)\n#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D)\n#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D)\n#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf)\n#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv)\n#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri)\n#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv)\n#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable)\n#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable)\n#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D)\n#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D)\n#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable)\n#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv)\n#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv)\n#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter)\n#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv)\n#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv)\n#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram)\n#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv)\n#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv)\n#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax)\n#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv)\n#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv)\n#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter)\n#define glHistogram GLEW_GET_FUN(__glewHistogram)\n#define glMinmax GLEW_GET_FUN(__glewMinmax)\n#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram)\n#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax)\n#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D)\n\n#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging)\n\n#endif /* GL_ARB_imaging */\n\n/* ------------------------ GL_ARB_instanced_arrays ------------------------ */\n\n#ifndef GL_ARB_instanced_arrays\n#define GL_ARB_instanced_arrays 1\n\n#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE\n\ntypedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);\n\n#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB)\n#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB)\n#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB)\n\n#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays)\n\n#endif /* GL_ARB_instanced_arrays */\n\n/* ---------------------- GL_ARB_internalformat_query ---------------------- */\n\n#ifndef GL_ARB_internalformat_query\n#define GL_ARB_internalformat_query 1\n\n#define GL_NUM_SAMPLE_COUNTS 0x9380\n\ntypedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params);\n\n#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ)\n\n#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query)\n\n#endif /* GL_ARB_internalformat_query */\n\n/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */\n\n#ifndef GL_ARB_map_buffer_alignment\n#define GL_ARB_map_buffer_alignment 1\n\n#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC\n\n#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment)\n\n#endif /* GL_ARB_map_buffer_alignment */\n\n/* ------------------------ GL_ARB_map_buffer_range ------------------------ */\n\n#ifndef GL_ARB_map_buffer_range\n#define GL_ARB_map_buffer_range 1\n\n#define GL_MAP_READ_BIT 0x0001\n#define GL_MAP_WRITE_BIT 0x0002\n#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004\n#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008\n#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010\n#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020\n\ntypedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);\ntypedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);\n\n#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange)\n#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange)\n\n#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range)\n\n#endif /* GL_ARB_map_buffer_range */\n\n/* ------------------------- GL_ARB_matrix_palette ------------------------- */\n\n#ifndef GL_ARB_matrix_palette\n#define GL_ARB_matrix_palette 1\n\n#define GL_MATRIX_PALETTE_ARB 0x8840\n#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841\n#define GL_MAX_PALETTE_MATRICES_ARB 0x8842\n#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843\n#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844\n#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845\n#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846\n#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847\n#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848\n#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849\n\ntypedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);\ntypedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);\ntypedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices);\ntypedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices);\ntypedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices);\n\n#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB)\n#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB)\n#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB)\n#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB)\n#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB)\n\n#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette)\n\n#endif /* GL_ARB_matrix_palette */\n\n/* --------------------------- GL_ARB_multisample -------------------------- */\n\n#ifndef GL_ARB_multisample\n#define GL_ARB_multisample 1\n\n#define GL_MULTISAMPLE_ARB 0x809D\n#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F\n#define GL_SAMPLE_COVERAGE_ARB 0x80A0\n#define GL_SAMPLE_BUFFERS_ARB 0x80A8\n#define GL_SAMPLES_ARB 0x80A9\n#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA\n#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB\n#define GL_MULTISAMPLE_BIT_ARB 0x20000000\n\ntypedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);\n\n#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB)\n\n#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample)\n\n#endif /* GL_ARB_multisample */\n\n/* -------------------------- GL_ARB_multitexture -------------------------- */\n\n#ifndef GL_ARB_multitexture\n#define GL_ARB_multitexture 1\n\n#define GL_TEXTURE0_ARB 0x84C0\n#define GL_TEXTURE1_ARB 0x84C1\n#define GL_TEXTURE2_ARB 0x84C2\n#define GL_TEXTURE3_ARB 0x84C3\n#define GL_TEXTURE4_ARB 0x84C4\n#define GL_TEXTURE5_ARB 0x84C5\n#define GL_TEXTURE6_ARB 0x84C6\n#define GL_TEXTURE7_ARB 0x84C7\n#define GL_TEXTURE8_ARB 0x84C8\n#define GL_TEXTURE9_ARB 0x84C9\n#define GL_TEXTURE10_ARB 0x84CA\n#define GL_TEXTURE11_ARB 0x84CB\n#define GL_TEXTURE12_ARB 0x84CC\n#define GL_TEXTURE13_ARB 0x84CD\n#define GL_TEXTURE14_ARB 0x84CE\n#define GL_TEXTURE15_ARB 0x84CF\n#define GL_TEXTURE16_ARB 0x84D0\n#define GL_TEXTURE17_ARB 0x84D1\n#define GL_TEXTURE18_ARB 0x84D2\n#define GL_TEXTURE19_ARB 0x84D3\n#define GL_TEXTURE20_ARB 0x84D4\n#define GL_TEXTURE21_ARB 0x84D5\n#define GL_TEXTURE22_ARB 0x84D6\n#define GL_TEXTURE23_ARB 0x84D7\n#define GL_TEXTURE24_ARB 0x84D8\n#define GL_TEXTURE25_ARB 0x84D9\n#define GL_TEXTURE26_ARB 0x84DA\n#define GL_TEXTURE27_ARB 0x84DB\n#define GL_TEXTURE28_ARB 0x84DC\n#define GL_TEXTURE29_ARB 0x84DD\n#define GL_TEXTURE30_ARB 0x84DE\n#define GL_TEXTURE31_ARB 0x84DF\n#define GL_ACTIVE_TEXTURE_ARB 0x84E0\n#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1\n#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2\n\ntypedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);\ntypedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);\n\n#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB)\n#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB)\n#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB)\n#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB)\n#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB)\n#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB)\n#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB)\n#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB)\n#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB)\n#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB)\n#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB)\n#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB)\n#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB)\n#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB)\n#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB)\n#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB)\n#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB)\n#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB)\n#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB)\n#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB)\n#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB)\n#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB)\n#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB)\n#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB)\n#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB)\n#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB)\n#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB)\n#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB)\n#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB)\n#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB)\n#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB)\n#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB)\n#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB)\n#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB)\n\n#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture)\n\n#endif /* GL_ARB_multitexture */\n\n/* ------------------------- GL_ARB_occlusion_query ------------------------ */\n\n#ifndef GL_ARB_occlusion_query\n#define GL_ARB_occlusion_query 1\n\n#define GL_QUERY_COUNTER_BITS_ARB 0x8864\n#define GL_CURRENT_QUERY_ARB 0x8865\n#define GL_QUERY_RESULT_ARB 0x8866\n#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867\n#define GL_SAMPLES_PASSED_ARB 0x8914\n\ntypedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id);\n\n#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB)\n#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB)\n#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB)\n#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB)\n#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB)\n#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB)\n#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB)\n#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB)\n\n#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query)\n\n#endif /* GL_ARB_occlusion_query */\n\n/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */\n\n#ifndef GL_ARB_occlusion_query2\n#define GL_ARB_occlusion_query2 1\n\n#define GL_ANY_SAMPLES_PASSED 0x8C2F\n\n#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2)\n\n#endif /* GL_ARB_occlusion_query2 */\n\n/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */\n\n#ifndef GL_ARB_pixel_buffer_object\n#define GL_ARB_pixel_buffer_object 1\n\n#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB\n#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC\n#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED\n#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF\n\n#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object)\n\n#endif /* GL_ARB_pixel_buffer_object */\n\n/* ------------------------ GL_ARB_point_parameters ------------------------ */\n\n#ifndef GL_ARB_point_parameters\n#define GL_ARB_point_parameters 1\n\n#define GL_POINT_SIZE_MIN_ARB 0x8126\n#define GL_POINT_SIZE_MAX_ARB 0x8127\n#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128\n#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129\n\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params);\n\n#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB)\n#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB)\n\n#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters)\n\n#endif /* GL_ARB_point_parameters */\n\n/* -------------------------- GL_ARB_point_sprite -------------------------- */\n\n#ifndef GL_ARB_point_sprite\n#define GL_ARB_point_sprite 1\n\n#define GL_POINT_SPRITE_ARB 0x8861\n#define GL_COORD_REPLACE_ARB 0x8862\n\n#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite)\n\n#endif /* GL_ARB_point_sprite */\n\n/* ------------------------ GL_ARB_provoking_vertex ------------------------ */\n\n#ifndef GL_ARB_provoking_vertex\n#define GL_ARB_provoking_vertex 1\n\n#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C\n#define GL_FIRST_VERTEX_CONVENTION 0x8E4D\n#define GL_LAST_VERTEX_CONVENTION 0x8E4E\n#define GL_PROVOKING_VERTEX 0x8E4F\n\ntypedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode);\n\n#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex)\n\n#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex)\n\n#endif /* GL_ARB_provoking_vertex */\n\n/* --------------------------- GL_ARB_robustness --------------------------- */\n\n#ifndef GL_ARB_robustness\n#define GL_ARB_robustness 1\n\n#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004\n#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252\n#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253\n#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254\n#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255\n#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256\n#define GL_NO_RESET_NOTIFICATION_ARB 0x8261\n\ntypedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table);\ntypedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img);\ntypedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image);\ntypedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values);\ntypedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v);\ntypedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values);\ntypedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values);\ntypedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values);\ntypedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values);\ntypedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern);\ntypedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span);\ntypedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img);\ntypedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data);\n\n#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB)\n#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB)\n#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB)\n#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB)\n#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB)\n#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB)\n#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB)\n#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB)\n#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB)\n#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB)\n#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB)\n#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB)\n#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB)\n#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB)\n#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB)\n#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB)\n#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB)\n#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB)\n#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB)\n#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB)\n\n#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness)\n\n#endif /* GL_ARB_robustness */\n\n/* ------------------------- GL_ARB_sample_shading ------------------------- */\n\n#ifndef GL_ARB_sample_shading\n#define GL_ARB_sample_shading 1\n\n#define GL_SAMPLE_SHADING_ARB 0x8C36\n#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37\n\ntypedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value);\n\n#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB)\n\n#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading)\n\n#endif /* GL_ARB_sample_shading */\n\n/* ------------------------- GL_ARB_sampler_objects ------------------------ */\n\n#ifndef GL_ARB_sampler_objects\n#define GL_ARB_sampler_objects 1\n\n#define GL_SAMPLER_BINDING 0x8919\n\ntypedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);\ntypedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers);\ntypedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers);\ntypedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler);\ntypedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params);\n\n#define glBindSampler GLEW_GET_FUN(__glewBindSampler)\n#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers)\n#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers)\n#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv)\n#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv)\n#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv)\n#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv)\n#define glIsSampler GLEW_GET_FUN(__glewIsSampler)\n#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv)\n#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv)\n#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf)\n#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv)\n#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri)\n#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv)\n\n#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects)\n\n#endif /* GL_ARB_sampler_objects */\n\n/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */\n\n#ifndef GL_ARB_seamless_cube_map\n#define GL_ARB_seamless_cube_map 1\n\n#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F\n\n#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map)\n\n#endif /* GL_ARB_seamless_cube_map */\n\n/* --------------------- GL_ARB_separate_shader_objects -------------------- */\n\n#ifndef GL_ARB_separate_shader_objects\n#define GL_ARB_separate_shader_objects 1\n\n#define GL_VERTEX_SHADER_BIT 0x00000001\n#define GL_FRAGMENT_SHADER_BIT 0x00000002\n#define GL_GEOMETRY_SHADER_BIT 0x00000004\n#define GL_TESS_CONTROL_SHADER_BIT 0x00000008\n#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010\n#define GL_PROGRAM_SEPARABLE 0x8258\n#define GL_ACTIVE_PROGRAM 0x8259\n#define GL_PROGRAM_PIPELINE_BINDING 0x825A\n#define GL_ALL_SHADER_BITS 0xFFFFFFFF\n\ntypedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);\ntypedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);\ntypedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const char ** strings);\ntypedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines);\ntypedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, char *infoLog);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);\ntypedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);\n\n#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram)\n#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline)\n#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv)\n#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines)\n#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines)\n#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog)\n#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv)\n#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline)\n#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d)\n#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv)\n#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f)\n#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv)\n#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i)\n#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv)\n#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui)\n#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv)\n#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d)\n#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv)\n#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f)\n#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv)\n#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i)\n#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv)\n#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui)\n#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv)\n#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d)\n#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv)\n#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f)\n#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv)\n#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i)\n#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv)\n#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui)\n#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv)\n#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d)\n#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv)\n#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f)\n#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv)\n#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i)\n#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv)\n#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui)\n#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv)\n#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv)\n#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv)\n#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv)\n#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv)\n#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv)\n#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv)\n#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv)\n#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv)\n#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv)\n#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv)\n#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv)\n#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv)\n#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv)\n#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv)\n#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv)\n#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv)\n#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv)\n#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv)\n#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages)\n#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline)\n\n#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects)\n\n#endif /* GL_ARB_separate_shader_objects */\n\n/* --------------------- GL_ARB_shader_atomic_counters --------------------- */\n\n#ifndef GL_ARB_shader_atomic_counters\n#define GL_ARB_shader_atomic_counters 1\n\n#define GL_ATOMIC_COUNTER_BUFFER 0x92C0\n#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1\n#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2\n#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3\n#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4\n#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5\n#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA\n#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB\n#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC\n#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD\n#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE\n#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF\n#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0\n#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1\n#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2\n#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3\n#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4\n#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5\n#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6\n#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7\n#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8\n#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9\n#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA\n#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB\n#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC\n\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params);\n\n#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv)\n\n#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters)\n\n#endif /* GL_ARB_shader_atomic_counters */\n\n/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */\n\n#ifndef GL_ARB_shader_bit_encoding\n#define GL_ARB_shader_bit_encoding 1\n\n#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding)\n\n#endif /* GL_ARB_shader_bit_encoding */\n\n/* --------------------- GL_ARB_shader_image_load_store -------------------- */\n\n#ifndef GL_ARB_shader_image_load_store\n#define GL_ARB_shader_image_load_store 1\n\n#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001\n#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002\n#define GL_UNIFORM_BARRIER_BIT 0x00000004\n#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008\n#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020\n#define GL_COMMAND_BARRIER_BIT 0x00000040\n#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080\n#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100\n#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200\n#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400\n#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800\n#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000\n#define GL_MAX_IMAGE_UNITS 0x8F38\n#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39\n#define GL_IMAGE_BINDING_NAME 0x8F3A\n#define GL_IMAGE_BINDING_LEVEL 0x8F3B\n#define GL_IMAGE_BINDING_LAYERED 0x8F3C\n#define GL_IMAGE_BINDING_LAYER 0x8F3D\n#define GL_IMAGE_BINDING_ACCESS 0x8F3E\n#define GL_IMAGE_1D 0x904C\n#define GL_IMAGE_2D 0x904D\n#define GL_IMAGE_3D 0x904E\n#define GL_IMAGE_2D_RECT 0x904F\n#define GL_IMAGE_CUBE 0x9050\n#define GL_IMAGE_BUFFER 0x9051\n#define GL_IMAGE_1D_ARRAY 0x9052\n#define GL_IMAGE_2D_ARRAY 0x9053\n#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054\n#define GL_IMAGE_2D_MULTISAMPLE 0x9055\n#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056\n#define GL_INT_IMAGE_1D 0x9057\n#define GL_INT_IMAGE_2D 0x9058\n#define GL_INT_IMAGE_3D 0x9059\n#define GL_INT_IMAGE_2D_RECT 0x905A\n#define GL_INT_IMAGE_CUBE 0x905B\n#define GL_INT_IMAGE_BUFFER 0x905C\n#define GL_INT_IMAGE_1D_ARRAY 0x905D\n#define GL_INT_IMAGE_2D_ARRAY 0x905E\n#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F\n#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060\n#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061\n#define GL_UNSIGNED_INT_IMAGE_1D 0x9062\n#define GL_UNSIGNED_INT_IMAGE_2D 0x9063\n#define GL_UNSIGNED_INT_IMAGE_3D 0x9064\n#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065\n#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066\n#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067\n#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068\n#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069\n#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C\n#define GL_MAX_IMAGE_SAMPLES 0x906D\n#define GL_IMAGE_BINDING_FORMAT 0x906E\n#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7\n#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8\n#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9\n#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA\n#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB\n#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC\n#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD\n#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE\n#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF\n#define GL_ALL_BARRIER_BITS 0xFFFFFFFF\n\ntypedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);\ntypedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);\n\n#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture)\n#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier)\n\n#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store)\n\n#endif /* GL_ARB_shader_image_load_store */\n\n/* ------------------------- GL_ARB_shader_objects ------------------------- */\n\n#ifndef GL_ARB_shader_objects\n#define GL_ARB_shader_objects 1\n\n#define GL_PROGRAM_OBJECT_ARB 0x8B40\n#define GL_SHADER_OBJECT_ARB 0x8B48\n#define GL_OBJECT_TYPE_ARB 0x8B4E\n#define GL_OBJECT_SUBTYPE_ARB 0x8B4F\n#define GL_FLOAT_VEC2_ARB 0x8B50\n#define GL_FLOAT_VEC3_ARB 0x8B51\n#define GL_FLOAT_VEC4_ARB 0x8B52\n#define GL_INT_VEC2_ARB 0x8B53\n#define GL_INT_VEC3_ARB 0x8B54\n#define GL_INT_VEC4_ARB 0x8B55\n#define GL_BOOL_ARB 0x8B56\n#define GL_BOOL_VEC2_ARB 0x8B57\n#define GL_BOOL_VEC3_ARB 0x8B58\n#define GL_BOOL_VEC4_ARB 0x8B59\n#define GL_FLOAT_MAT2_ARB 0x8B5A\n#define GL_FLOAT_MAT3_ARB 0x8B5B\n#define GL_FLOAT_MAT4_ARB 0x8B5C\n#define GL_SAMPLER_1D_ARB 0x8B5D\n#define GL_SAMPLER_2D_ARB 0x8B5E\n#define GL_SAMPLER_3D_ARB 0x8B5F\n#define GL_SAMPLER_CUBE_ARB 0x8B60\n#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61\n#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62\n#define GL_SAMPLER_2D_RECT_ARB 0x8B63\n#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64\n#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80\n#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81\n#define GL_OBJECT_LINK_STATUS_ARB 0x8B82\n#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83\n#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84\n#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85\n#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86\n#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87\n#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88\n\ntypedef char GLcharARB;\ntypedef unsigned int GLhandleARB;\n\ntypedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);\ntypedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);\ntypedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void);\ntypedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);\ntypedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);\ntypedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);\ntypedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj);\ntypedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname);\ntypedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog);\ntypedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source);\ntypedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);\ntypedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);\ntypedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);\n\n#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB)\n#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB)\n#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB)\n#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB)\n#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB)\n#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB)\n#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB)\n#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB)\n#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB)\n#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB)\n#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB)\n#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB)\n#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB)\n#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB)\n#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB)\n#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB)\n#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB)\n#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB)\n#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB)\n#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB)\n#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB)\n#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB)\n#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB)\n#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB)\n#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB)\n#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB)\n#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB)\n#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB)\n#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB)\n#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB)\n#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB)\n#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB)\n#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB)\n#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB)\n#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB)\n#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB)\n#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB)\n#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB)\n#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB)\n\n#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects)\n\n#endif /* GL_ARB_shader_objects */\n\n/* ------------------------ GL_ARB_shader_precision ------------------------ */\n\n#ifndef GL_ARB_shader_precision\n#define GL_ARB_shader_precision 1\n\n#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision)\n\n#endif /* GL_ARB_shader_precision */\n\n/* ---------------------- GL_ARB_shader_stencil_export --------------------- */\n\n#ifndef GL_ARB_shader_stencil_export\n#define GL_ARB_shader_stencil_export 1\n\n#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export)\n\n#endif /* GL_ARB_shader_stencil_export */\n\n/* ------------------------ GL_ARB_shader_subroutine ----------------------- */\n\n#ifndef GL_ARB_shader_subroutine\n#define GL_ARB_shader_subroutine 1\n\n#define GL_ACTIVE_SUBROUTINES 0x8DE5\n#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6\n#define GL_MAX_SUBROUTINES 0x8DE7\n#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8\n#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47\n#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48\n#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49\n#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A\n#define GL_COMPATIBLE_SUBROUTINES 0x8E4B\n\ntypedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, char *name);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, char *name);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values);\ntypedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const char* name);\ntypedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const char* name);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices);\n\n#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName)\n#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName)\n#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv)\n#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv)\n#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex)\n#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation)\n#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv)\n#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv)\n\n#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine)\n\n#endif /* GL_ARB_shader_subroutine */\n\n/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */\n\n#ifndef GL_ARB_shader_texture_lod\n#define GL_ARB_shader_texture_lod 1\n\n#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod)\n\n#endif /* GL_ARB_shader_texture_lod */\n\n/* ---------------------- GL_ARB_shading_language_100 ---------------------- */\n\n#ifndef GL_ARB_shading_language_100\n#define GL_ARB_shading_language_100 1\n\n#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C\n\n#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100)\n\n#endif /* GL_ARB_shading_language_100 */\n\n/* -------------------- GL_ARB_shading_language_420pack -------------------- */\n\n#ifndef GL_ARB_shading_language_420pack\n#define GL_ARB_shading_language_420pack 1\n\n#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack)\n\n#endif /* GL_ARB_shading_language_420pack */\n\n/* -------------------- GL_ARB_shading_language_include -------------------- */\n\n#ifndef GL_ARB_shading_language_include\n#define GL_ARB_shading_language_include 1\n\n#define GL_SHADER_INCLUDE_ARB 0x8DAE\n#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9\n#define GL_NAMED_STRING_TYPE_ARB 0x8DEA\n\ntypedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const char ** path, const GLint *length);\ntypedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const char* name);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const char* name, GLsizei bufSize, GLint *stringlen, char *string);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const char* name, GLenum pname, GLint *params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const char* name);\ntypedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const char* name, GLint stringlen, const char *string);\n\n#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB)\n#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB)\n#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB)\n#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB)\n#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB)\n#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB)\n\n#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include)\n\n#endif /* GL_ARB_shading_language_include */\n\n/* -------------------- GL_ARB_shading_language_packing -------------------- */\n\n#ifndef GL_ARB_shading_language_packing\n#define GL_ARB_shading_language_packing 1\n\n#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing)\n\n#endif /* GL_ARB_shading_language_packing */\n\n/* ----------------------------- GL_ARB_shadow ----------------------------- */\n\n#ifndef GL_ARB_shadow\n#define GL_ARB_shadow 1\n\n#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C\n#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D\n#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E\n\n#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow)\n\n#endif /* GL_ARB_shadow */\n\n/* ------------------------- GL_ARB_shadow_ambient ------------------------- */\n\n#ifndef GL_ARB_shadow_ambient\n#define GL_ARB_shadow_ambient 1\n\n#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF\n\n#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient)\n\n#endif /* GL_ARB_shadow_ambient */\n\n/* ------------------------------ GL_ARB_sync ------------------------------ */\n\n#ifndef GL_ARB_sync\n#define GL_ARB_sync 1\n\n#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001\n#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111\n#define GL_OBJECT_TYPE 0x9112\n#define GL_SYNC_CONDITION 0x9113\n#define GL_SYNC_STATUS 0x9114\n#define GL_SYNC_FLAGS 0x9115\n#define GL_SYNC_FENCE 0x9116\n#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117\n#define GL_UNSIGNALED 0x9118\n#define GL_SIGNALED 0x9119\n#define GL_ALREADY_SIGNALED 0x911A\n#define GL_TIMEOUT_EXPIRED 0x911B\n#define GL_CONDITION_SATISFIED 0x911C\n#define GL_WAIT_FAILED 0x911D\n#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF\n\ntypedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout);\ntypedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync);\ntypedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags);\ntypedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params);\ntypedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values);\ntypedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync);\ntypedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout);\n\n#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync)\n#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync)\n#define glFenceSync GLEW_GET_FUN(__glewFenceSync)\n#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v)\n#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv)\n#define glIsSync GLEW_GET_FUN(__glewIsSync)\n#define glWaitSync GLEW_GET_FUN(__glewWaitSync)\n\n#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync)\n\n#endif /* GL_ARB_sync */\n\n/* ----------------------- GL_ARB_tessellation_shader ---------------------- */\n\n#ifndef GL_ARB_tessellation_shader\n#define GL_ARB_tessellation_shader 1\n\n#define GL_PATCHES 0xE\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1\n#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C\n#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D\n#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E\n#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F\n#define GL_PATCH_VERTICES 0x8E72\n#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73\n#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74\n#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75\n#define GL_TESS_GEN_MODE 0x8E76\n#define GL_TESS_GEN_SPACING 0x8E77\n#define GL_TESS_GEN_VERTEX_ORDER 0x8E78\n#define GL_TESS_GEN_POINT_MODE 0x8E79\n#define GL_ISOLINES 0x8E7A\n#define GL_FRACTIONAL_ODD 0x8E7B\n#define GL_FRACTIONAL_EVEN 0x8E7C\n#define GL_MAX_PATCH_VERTICES 0x8E7D\n#define GL_MAX_TESS_GEN_LEVEL 0x8E7E\n#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F\n#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80\n#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81\n#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82\n#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83\n#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84\n#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85\n#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86\n#define GL_TESS_EVALUATION_SHADER 0x8E87\n#define GL_TESS_CONTROL_SHADER 0x8E88\n#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89\n#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A\n\ntypedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values);\ntypedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);\n\n#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv)\n#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri)\n\n#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader)\n\n#endif /* GL_ARB_tessellation_shader */\n\n/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */\n\n#ifndef GL_ARB_texture_border_clamp\n#define GL_ARB_texture_border_clamp 1\n\n#define GL_CLAMP_TO_BORDER_ARB 0x812D\n\n#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp)\n\n#endif /* GL_ARB_texture_border_clamp */\n\n/* ---------------------- GL_ARB_texture_buffer_object --------------------- */\n\n#ifndef GL_ARB_texture_buffer_object\n#define GL_ARB_texture_buffer_object 1\n\n#define GL_TEXTURE_BUFFER_ARB 0x8C2A\n#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B\n#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C\n#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D\n#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E\n\ntypedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);\n\n#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB)\n\n#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object)\n\n#endif /* GL_ARB_texture_buffer_object */\n\n/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */\n\n#ifndef GL_ARB_texture_buffer_object_rgb32\n#define GL_ARB_texture_buffer_object_rgb32 1\n\n#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32)\n\n#endif /* GL_ARB_texture_buffer_object_rgb32 */\n\n/* ----------------------- GL_ARB_texture_compression ---------------------- */\n\n#ifndef GL_ARB_texture_compression\n#define GL_ARB_texture_compression 1\n\n#define GL_COMPRESSED_ALPHA_ARB 0x84E9\n#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA\n#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB\n#define GL_COMPRESSED_INTENSITY_ARB 0x84EC\n#define GL_COMPRESSED_RGB_ARB 0x84ED\n#define GL_COMPRESSED_RGBA_ARB 0x84EE\n#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF\n#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0\n#define GL_TEXTURE_COMPRESSED_ARB 0x86A1\n#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2\n#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3\n\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img);\n\n#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB)\n#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB)\n#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB)\n#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB)\n#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB)\n#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB)\n#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB)\n\n#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression)\n\n#endif /* GL_ARB_texture_compression */\n\n/* -------------------- GL_ARB_texture_compression_bptc -------------------- */\n\n#ifndef GL_ARB_texture_compression_bptc\n#define GL_ARB_texture_compression_bptc 1\n\n#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C\n#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D\n#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E\n#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F\n\n#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc)\n\n#endif /* GL_ARB_texture_compression_bptc */\n\n/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */\n\n#ifndef GL_ARB_texture_compression_rgtc\n#define GL_ARB_texture_compression_rgtc 1\n\n#define GL_COMPRESSED_RED_RGTC1 0x8DBB\n#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC\n#define GL_COMPRESSED_RG_RGTC2 0x8DBD\n#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE\n\n#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc)\n\n#endif /* GL_ARB_texture_compression_rgtc */\n\n/* ------------------------ GL_ARB_texture_cube_map ------------------------ */\n\n#ifndef GL_ARB_texture_cube_map\n#define GL_ARB_texture_cube_map 1\n\n#define GL_NORMAL_MAP_ARB 0x8511\n#define GL_REFLECTION_MAP_ARB 0x8512\n#define GL_TEXTURE_CUBE_MAP_ARB 0x8513\n#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A\n#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B\n#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C\n\n#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map)\n\n#endif /* GL_ARB_texture_cube_map */\n\n/* --------------------- GL_ARB_texture_cube_map_array --------------------- */\n\n#ifndef GL_ARB_texture_cube_map_array\n#define GL_ARB_texture_cube_map_array 1\n\n#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009\n#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A\n#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B\n#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C\n#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D\n#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E\n#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F\n\n#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array)\n\n#endif /* GL_ARB_texture_cube_map_array */\n\n/* ------------------------- GL_ARB_texture_env_add ------------------------ */\n\n#ifndef GL_ARB_texture_env_add\n#define GL_ARB_texture_env_add 1\n\n#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add)\n\n#endif /* GL_ARB_texture_env_add */\n\n/* ----------------------- GL_ARB_texture_env_combine ---------------------- */\n\n#ifndef GL_ARB_texture_env_combine\n#define GL_ARB_texture_env_combine 1\n\n#define GL_SUBTRACT_ARB 0x84E7\n#define GL_COMBINE_ARB 0x8570\n#define GL_COMBINE_RGB_ARB 0x8571\n#define GL_COMBINE_ALPHA_ARB 0x8572\n#define GL_RGB_SCALE_ARB 0x8573\n#define GL_ADD_SIGNED_ARB 0x8574\n#define GL_INTERPOLATE_ARB 0x8575\n#define GL_CONSTANT_ARB 0x8576\n#define GL_PRIMARY_COLOR_ARB 0x8577\n#define GL_PREVIOUS_ARB 0x8578\n#define GL_SOURCE0_RGB_ARB 0x8580\n#define GL_SOURCE1_RGB_ARB 0x8581\n#define GL_SOURCE2_RGB_ARB 0x8582\n#define GL_SOURCE0_ALPHA_ARB 0x8588\n#define GL_SOURCE1_ALPHA_ARB 0x8589\n#define GL_SOURCE2_ALPHA_ARB 0x858A\n#define GL_OPERAND0_RGB_ARB 0x8590\n#define GL_OPERAND1_RGB_ARB 0x8591\n#define GL_OPERAND2_RGB_ARB 0x8592\n#define GL_OPERAND0_ALPHA_ARB 0x8598\n#define GL_OPERAND1_ALPHA_ARB 0x8599\n#define GL_OPERAND2_ALPHA_ARB 0x859A\n\n#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine)\n\n#endif /* GL_ARB_texture_env_combine */\n\n/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */\n\n#ifndef GL_ARB_texture_env_crossbar\n#define GL_ARB_texture_env_crossbar 1\n\n#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar)\n\n#endif /* GL_ARB_texture_env_crossbar */\n\n/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */\n\n#ifndef GL_ARB_texture_env_dot3\n#define GL_ARB_texture_env_dot3 1\n\n#define GL_DOT3_RGB_ARB 0x86AE\n#define GL_DOT3_RGBA_ARB 0x86AF\n\n#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3)\n\n#endif /* GL_ARB_texture_env_dot3 */\n\n/* -------------------------- GL_ARB_texture_float ------------------------- */\n\n#ifndef GL_ARB_texture_float\n#define GL_ARB_texture_float 1\n\n#define GL_RGBA32F_ARB 0x8814\n#define GL_RGB32F_ARB 0x8815\n#define GL_ALPHA32F_ARB 0x8816\n#define GL_INTENSITY32F_ARB 0x8817\n#define GL_LUMINANCE32F_ARB 0x8818\n#define GL_LUMINANCE_ALPHA32F_ARB 0x8819\n#define GL_RGBA16F_ARB 0x881A\n#define GL_RGB16F_ARB 0x881B\n#define GL_ALPHA16F_ARB 0x881C\n#define GL_INTENSITY16F_ARB 0x881D\n#define GL_LUMINANCE16F_ARB 0x881E\n#define GL_LUMINANCE_ALPHA16F_ARB 0x881F\n#define GL_TEXTURE_RED_TYPE_ARB 0x8C10\n#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11\n#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12\n#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13\n#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14\n#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15\n#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16\n#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17\n\n#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float)\n\n#endif /* GL_ARB_texture_float */\n\n/* ------------------------- GL_ARB_texture_gather ------------------------- */\n\n#ifndef GL_ARB_texture_gather\n#define GL_ARB_texture_gather 1\n\n#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F\n\n#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather)\n\n#endif /* GL_ARB_texture_gather */\n\n/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */\n\n#ifndef GL_ARB_texture_mirrored_repeat\n#define GL_ARB_texture_mirrored_repeat 1\n\n#define GL_MIRRORED_REPEAT_ARB 0x8370\n\n#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat)\n\n#endif /* GL_ARB_texture_mirrored_repeat */\n\n/* ----------------------- GL_ARB_texture_multisample ---------------------- */\n\n#ifndef GL_ARB_texture_multisample\n#define GL_ARB_texture_multisample 1\n\n#define GL_SAMPLE_POSITION 0x8E50\n#define GL_SAMPLE_MASK 0x8E51\n#define GL_SAMPLE_MASK_VALUE 0x8E52\n#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59\n#define GL_TEXTURE_2D_MULTISAMPLE 0x9100\n#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101\n#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102\n#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103\n#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104\n#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105\n#define GL_TEXTURE_SAMPLES 0x9106\n#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107\n#define GL_SAMPLER_2D_MULTISAMPLE 0x9108\n#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109\n#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A\n#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B\n#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C\n#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D\n#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E\n#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F\n#define GL_MAX_INTEGER_SAMPLES 0x9110\n\ntypedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val);\ntypedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);\ntypedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);\ntypedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);\n\n#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv)\n#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski)\n#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample)\n#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample)\n\n#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample)\n\n#endif /* GL_ARB_texture_multisample */\n\n/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */\n\n#ifndef GL_ARB_texture_non_power_of_two\n#define GL_ARB_texture_non_power_of_two 1\n\n#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two)\n\n#endif /* GL_ARB_texture_non_power_of_two */\n\n/* ------------------------ GL_ARB_texture_query_lod ----------------------- */\n\n#ifndef GL_ARB_texture_query_lod\n#define GL_ARB_texture_query_lod 1\n\n#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod)\n\n#endif /* GL_ARB_texture_query_lod */\n\n/* ------------------------ GL_ARB_texture_rectangle ----------------------- */\n\n#ifndef GL_ARB_texture_rectangle\n#define GL_ARB_texture_rectangle 1\n\n#define GL_TEXTURE_RECTANGLE_ARB 0x84F5\n#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6\n#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7\n#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8\n#define GL_SAMPLER_2D_RECT_ARB 0x8B63\n#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64\n\n#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle)\n\n#endif /* GL_ARB_texture_rectangle */\n\n/* --------------------------- GL_ARB_texture_rg --------------------------- */\n\n#ifndef GL_ARB_texture_rg\n#define GL_ARB_texture_rg 1\n\n#define GL_RED 0x1903\n#define GL_COMPRESSED_RED 0x8225\n#define GL_COMPRESSED_RG 0x8226\n#define GL_RG 0x8227\n#define GL_RG_INTEGER 0x8228\n#define GL_R8 0x8229\n#define GL_R16 0x822A\n#define GL_RG8 0x822B\n#define GL_RG16 0x822C\n#define GL_R16F 0x822D\n#define GL_R32F 0x822E\n#define GL_RG16F 0x822F\n#define GL_RG32F 0x8230\n#define GL_R8I 0x8231\n#define GL_R8UI 0x8232\n#define GL_R16I 0x8233\n#define GL_R16UI 0x8234\n#define GL_R32I 0x8235\n#define GL_R32UI 0x8236\n#define GL_RG8I 0x8237\n#define GL_RG8UI 0x8238\n#define GL_RG16I 0x8239\n#define GL_RG16UI 0x823A\n#define GL_RG32I 0x823B\n#define GL_RG32UI 0x823C\n\n#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg)\n\n#endif /* GL_ARB_texture_rg */\n\n/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */\n\n#ifndef GL_ARB_texture_rgb10_a2ui\n#define GL_ARB_texture_rgb10_a2ui 1\n\n#define GL_RGB10_A2UI 0x906F\n\n#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui)\n\n#endif /* GL_ARB_texture_rgb10_a2ui */\n\n/* ------------------------- GL_ARB_texture_storage ------------------------ */\n\n#ifndef GL_ARB_texture_storage\n#define GL_ARB_texture_storage 1\n\n#define GL_ALPHA8_EXT 0x803C\n#define GL_LUMINANCE8_EXT 0x8040\n#define GL_LUMINANCE8_ALPHA8_EXT 0x8045\n#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F\n\ntypedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);\ntypedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);\n\n#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D)\n#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D)\n#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D)\n#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT)\n#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT)\n#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT)\n\n#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage)\n\n#endif /* GL_ARB_texture_storage */\n\n/* ------------------------- GL_ARB_texture_swizzle ------------------------ */\n\n#ifndef GL_ARB_texture_swizzle\n#define GL_ARB_texture_swizzle 1\n\n#define GL_TEXTURE_SWIZZLE_R 0x8E42\n#define GL_TEXTURE_SWIZZLE_G 0x8E43\n#define GL_TEXTURE_SWIZZLE_B 0x8E44\n#define GL_TEXTURE_SWIZZLE_A 0x8E45\n#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46\n\n#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle)\n\n#endif /* GL_ARB_texture_swizzle */\n\n/* --------------------------- GL_ARB_timer_query -------------------------- */\n\n#ifndef GL_ARB_timer_query\n#define GL_ARB_timer_query 1\n\n#define GL_TIME_ELAPSED 0x88BF\n#define GL_TIMESTAMP 0x8E28\n\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params);\ntypedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);\n\n#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v)\n#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v)\n#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter)\n\n#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query)\n\n#endif /* GL_ARB_timer_query */\n\n/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */\n\n#ifndef GL_ARB_transform_feedback2\n#define GL_ARB_transform_feedback2 1\n\n#define GL_TRANSFORM_FEEDBACK 0x8E22\n#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23\n#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24\n#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25\n\ntypedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids);\ntypedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);\n\n#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback)\n#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks)\n#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback)\n#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks)\n#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback)\n#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback)\n#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback)\n\n#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2)\n\n#endif /* GL_ARB_transform_feedback2 */\n\n/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */\n\n#ifndef GL_ARB_transform_feedback3\n#define GL_ARB_transform_feedback3 1\n\n#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70\n#define GL_MAX_VERTEX_STREAMS 0x8E71\n\ntypedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);\ntypedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params);\n\n#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed)\n#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream)\n#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed)\n#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv)\n\n#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3)\n\n#endif /* GL_ARB_transform_feedback3 */\n\n/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */\n\n#ifndef GL_ARB_transform_feedback_instanced\n#define GL_ARB_transform_feedback_instanced 1\n\ntypedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount);\n\n#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced)\n#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced)\n\n#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced)\n\n#endif /* GL_ARB_transform_feedback_instanced */\n\n/* ------------------------ GL_ARB_transpose_matrix ------------------------ */\n\n#ifndef GL_ARB_transpose_matrix\n#define GL_ARB_transpose_matrix 1\n\n#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3\n#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4\n#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5\n#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6\n\ntypedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]);\ntypedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]);\ntypedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]);\ntypedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]);\n\n#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB)\n#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB)\n#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB)\n#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB)\n\n#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix)\n\n#endif /* GL_ARB_transpose_matrix */\n\n/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */\n\n#ifndef GL_ARB_uniform_buffer_object\n#define GL_ARB_uniform_buffer_object 1\n\n#define GL_UNIFORM_BUFFER 0x8A11\n#define GL_UNIFORM_BUFFER_BINDING 0x8A28\n#define GL_UNIFORM_BUFFER_START 0x8A29\n#define GL_UNIFORM_BUFFER_SIZE 0x8A2A\n#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B\n#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C\n#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D\n#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E\n#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F\n#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30\n#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31\n#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32\n#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33\n#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34\n#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35\n#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36\n#define GL_UNIFORM_TYPE 0x8A37\n#define GL_UNIFORM_SIZE 0x8A38\n#define GL_UNIFORM_NAME_LENGTH 0x8A39\n#define GL_UNIFORM_BLOCK_INDEX 0x8A3A\n#define GL_UNIFORM_OFFSET 0x8A3B\n#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C\n#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D\n#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E\n#define GL_UNIFORM_BLOCK_BINDING 0x8A3F\n#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40\n#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41\n#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42\n#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45\n#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46\n#define GL_INVALID_INDEX 0xFFFFFFFF\n\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, char* uniformBlockName);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, char* uniformName);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data);\ntypedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const char* uniformBlockName);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const char** uniformNames, GLuint* uniformIndices);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);\n\n#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase)\n#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange)\n#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName)\n#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv)\n#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName)\n#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv)\n#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v)\n#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex)\n#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices)\n#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding)\n\n#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object)\n\n#endif /* GL_ARB_uniform_buffer_object */\n\n/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */\n\n#ifndef GL_ARB_vertex_array_bgra\n#define GL_ARB_vertex_array_bgra 1\n\n#define GL_BGRA 0x80E1\n\n#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra)\n\n#endif /* GL_ARB_vertex_array_bgra */\n\n/* ----------------------- GL_ARB_vertex_array_object ---------------------- */\n\n#ifndef GL_ARB_vertex_array_object\n#define GL_ARB_vertex_array_object 1\n\n#define GL_VERTEX_ARRAY_BINDING 0x85B5\n\ntypedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array);\ntypedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays);\ntypedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays);\ntypedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array);\n\n#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray)\n#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays)\n#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays)\n#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray)\n\n#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object)\n\n#endif /* GL_ARB_vertex_array_object */\n\n/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */\n\n#ifndef GL_ARB_vertex_attrib_64bit\n#define GL_ARB_vertex_attrib_64bit 1\n\n#define GL_DOUBLE_MAT2 0x8F46\n#define GL_DOUBLE_MAT3 0x8F47\n#define GL_DOUBLE_MAT4 0x8F48\n#define GL_DOUBLE_VEC2 0x8FFC\n#define GL_DOUBLE_VEC3 0x8FFD\n#define GL_DOUBLE_VEC4 0x8FFE\n\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);\n\n#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv)\n#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d)\n#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv)\n#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d)\n#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv)\n#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d)\n#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv)\n#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d)\n#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv)\n#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer)\n\n#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit)\n\n#endif /* GL_ARB_vertex_attrib_64bit */\n\n/* -------------------------- GL_ARB_vertex_blend -------------------------- */\n\n#ifndef GL_ARB_vertex_blend\n#define GL_ARB_vertex_blend 1\n\n#define GL_MODELVIEW0_ARB 0x1700\n#define GL_MODELVIEW1_ARB 0x850A\n#define GL_MAX_VERTEX_UNITS_ARB 0x86A4\n#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5\n#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6\n#define GL_VERTEX_BLEND_ARB 0x86A7\n#define GL_CURRENT_WEIGHT_ARB 0x86A8\n#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9\n#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA\n#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB\n#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC\n#define GL_WEIGHT_ARRAY_ARB 0x86AD\n#define GL_MODELVIEW2_ARB 0x8722\n#define GL_MODELVIEW3_ARB 0x8723\n#define GL_MODELVIEW4_ARB 0x8724\n#define GL_MODELVIEW5_ARB 0x8725\n#define GL_MODELVIEW6_ARB 0x8726\n#define GL_MODELVIEW7_ARB 0x8727\n#define GL_MODELVIEW8_ARB 0x8728\n#define GL_MODELVIEW9_ARB 0x8729\n#define GL_MODELVIEW10_ARB 0x872A\n#define GL_MODELVIEW11_ARB 0x872B\n#define GL_MODELVIEW12_ARB 0x872C\n#define GL_MODELVIEW13_ARB 0x872D\n#define GL_MODELVIEW14_ARB 0x872E\n#define GL_MODELVIEW15_ARB 0x872F\n#define GL_MODELVIEW16_ARB 0x8730\n#define GL_MODELVIEW17_ARB 0x8731\n#define GL_MODELVIEW18_ARB 0x8732\n#define GL_MODELVIEW19_ARB 0x8733\n#define GL_MODELVIEW20_ARB 0x8734\n#define GL_MODELVIEW21_ARB 0x8735\n#define GL_MODELVIEW22_ARB 0x8736\n#define GL_MODELVIEW23_ARB 0x8737\n#define GL_MODELVIEW24_ARB 0x8738\n#define GL_MODELVIEW25_ARB 0x8739\n#define GL_MODELVIEW26_ARB 0x873A\n#define GL_MODELVIEW27_ARB 0x873B\n#define GL_MODELVIEW28_ARB 0x873C\n#define GL_MODELVIEW29_ARB 0x873D\n#define GL_MODELVIEW30_ARB 0x873E\n#define GL_MODELVIEW31_ARB 0x873F\n\ntypedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights);\n\n#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB)\n#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB)\n#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB)\n#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB)\n#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB)\n#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB)\n#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB)\n#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB)\n#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB)\n#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB)\n\n#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend)\n\n#endif /* GL_ARB_vertex_blend */\n\n/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */\n\n#ifndef GL_ARB_vertex_buffer_object\n#define GL_ARB_vertex_buffer_object 1\n\n#define GL_BUFFER_SIZE_ARB 0x8764\n#define GL_BUFFER_USAGE_ARB 0x8765\n#define GL_ARRAY_BUFFER_ARB 0x8892\n#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893\n#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894\n#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895\n#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896\n#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897\n#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898\n#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899\n#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A\n#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B\n#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C\n#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D\n#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E\n#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F\n#define GL_READ_ONLY_ARB 0x88B8\n#define GL_WRITE_ONLY_ARB 0x88B9\n#define GL_READ_WRITE_ARB 0x88BA\n#define GL_BUFFER_ACCESS_ARB 0x88BB\n#define GL_BUFFER_MAPPED_ARB 0x88BC\n#define GL_BUFFER_MAP_POINTER_ARB 0x88BD\n#define GL_STREAM_DRAW_ARB 0x88E0\n#define GL_STREAM_READ_ARB 0x88E1\n#define GL_STREAM_COPY_ARB 0x88E2\n#define GL_STATIC_DRAW_ARB 0x88E4\n#define GL_STATIC_READ_ARB 0x88E5\n#define GL_STATIC_COPY_ARB 0x88E6\n#define GL_DYNAMIC_DRAW_ARB 0x88E8\n#define GL_DYNAMIC_READ_ARB 0x88E9\n#define GL_DYNAMIC_COPY_ARB 0x88EA\n\ntypedef ptrdiff_t GLintptrARB;\ntypedef ptrdiff_t GLsizeiptrARB;\n\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage);\ntypedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data);\ntypedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers);\ntypedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers);\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params);\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data);\ntypedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer);\ntypedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);\ntypedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target);\n\n#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB)\n#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB)\n#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB)\n#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB)\n#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB)\n#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB)\n#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB)\n#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB)\n#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB)\n#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB)\n#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB)\n\n#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object)\n\n#endif /* GL_ARB_vertex_buffer_object */\n\n/* ------------------------- GL_ARB_vertex_program ------------------------- */\n\n#ifndef GL_ARB_vertex_program\n#define GL_ARB_vertex_program 1\n\n#define GL_COLOR_SUM_ARB 0x8458\n#define GL_VERTEX_PROGRAM_ARB 0x8620\n#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622\n#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623\n#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624\n#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625\n#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626\n#define GL_PROGRAM_LENGTH_ARB 0x8627\n#define GL_PROGRAM_STRING_ARB 0x8628\n#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E\n#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F\n#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640\n#define GL_CURRENT_MATRIX_ARB 0x8641\n#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642\n#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643\n#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645\n#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B\n#define GL_PROGRAM_BINDING_ARB 0x8677\n#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869\n#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A\n#define GL_PROGRAM_ERROR_STRING_ARB 0x8874\n#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875\n#define GL_PROGRAM_FORMAT_ARB 0x8876\n#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0\n#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1\n#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2\n#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3\n#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4\n#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5\n#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6\n#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7\n#define GL_PROGRAM_PARAMETERS_ARB 0x88A8\n#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9\n#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA\n#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB\n#define GL_PROGRAM_ATTRIBS_ARB 0x88AC\n#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD\n#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE\n#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF\n#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0\n#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1\n#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2\n#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3\n#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4\n#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5\n#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6\n#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7\n#define GL_MATRIX0_ARB 0x88C0\n#define GL_MATRIX1_ARB 0x88C1\n#define GL_MATRIX2_ARB 0x88C2\n#define GL_MATRIX3_ARB 0x88C3\n#define GL_MATRIX4_ARB 0x88C4\n#define GL_MATRIX5_ARB 0x88C5\n#define GL_MATRIX6_ARB 0x88C6\n#define GL_MATRIX7_ARB 0x88C7\n#define GL_MATRIX8_ARB 0x88C8\n#define GL_MATRIX9_ARB 0x88C9\n#define GL_MATRIX10_ARB 0x88CA\n#define GL_MATRIX11_ARB 0x88CB\n#define GL_MATRIX12_ARB 0x88CC\n#define GL_MATRIX13_ARB 0x88CD\n#define GL_MATRIX14_ARB 0x88CE\n#define GL_MATRIX15_ARB 0x88CF\n#define GL_MATRIX16_ARB 0x88D0\n#define GL_MATRIX17_ARB 0x88D1\n#define GL_MATRIX18_ARB 0x88D2\n#define GL_MATRIX19_ARB 0x88D3\n#define GL_MATRIX20_ARB 0x88D4\n#define GL_MATRIX21_ARB 0x88D5\n#define GL_MATRIX22_ARB 0x88D6\n#define GL_MATRIX23_ARB 0x88D7\n#define GL_MATRIX24_ARB 0x88D8\n#define GL_MATRIX25_ARB 0x88D9\n#define GL_MATRIX26_ARB 0x88DA\n#define GL_MATRIX27_ARB 0x88DB\n#define GL_MATRIX28_ARB 0x88DC\n#define GL_MATRIX29_ARB 0x88DD\n#define GL_MATRIX30_ARB 0x88DE\n#define GL_MATRIX31_ARB 0x88DF\n\ntypedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);\ntypedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs);\ntypedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);\ntypedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);\ntypedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer);\n\n#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB)\n#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB)\n#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB)\n#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB)\n#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB)\n#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB)\n#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB)\n#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB)\n#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB)\n#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB)\n#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB)\n#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB)\n#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB)\n#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB)\n#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB)\n#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB)\n#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB)\n#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB)\n#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB)\n#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB)\n#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB)\n#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB)\n#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB)\n#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB)\n#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB)\n#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB)\n#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB)\n#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB)\n#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB)\n#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB)\n#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB)\n#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB)\n#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB)\n#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB)\n#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB)\n#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB)\n#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB)\n#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB)\n#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB)\n#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB)\n#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB)\n#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB)\n#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB)\n#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB)\n#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB)\n#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB)\n#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB)\n#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB)\n#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB)\n#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB)\n#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB)\n#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB)\n#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB)\n#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB)\n#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB)\n#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB)\n#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB)\n#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB)\n#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB)\n#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB)\n#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB)\n#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB)\n\n#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program)\n\n#endif /* GL_ARB_vertex_program */\n\n/* -------------------------- GL_ARB_vertex_shader ------------------------- */\n\n#ifndef GL_ARB_vertex_shader\n#define GL_ARB_vertex_shader 1\n\n#define GL_VERTEX_SHADER_ARB 0x8B31\n#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A\n#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B\n#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C\n#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D\n#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89\n#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A\n\ntypedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);\ntypedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);\n\n#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB)\n#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB)\n#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB)\n\n#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader)\n\n#endif /* GL_ARB_vertex_shader */\n\n/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */\n\n#ifndef GL_ARB_vertex_type_2_10_10_10_rev\n#define GL_ARB_vertex_type_2_10_10_10_rev 1\n\n#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368\n#define GL_INT_2_10_10_10_REV 0x8D9F\n\ntypedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);\ntypedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color);\ntypedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);\ntypedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value);\n\n#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui)\n#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv)\n#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui)\n#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv)\n#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui)\n#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv)\n#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui)\n#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv)\n#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui)\n#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv)\n#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui)\n#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv)\n#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui)\n#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv)\n#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui)\n#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv)\n#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui)\n#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv)\n#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui)\n#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv)\n#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui)\n#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv)\n#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui)\n#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv)\n#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui)\n#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv)\n#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui)\n#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv)\n#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui)\n#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv)\n#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui)\n#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv)\n#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui)\n#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv)\n#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui)\n#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv)\n#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui)\n#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv)\n\n#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev)\n\n#endif /* GL_ARB_vertex_type_2_10_10_10_rev */\n\n/* ------------------------- GL_ARB_viewport_array ------------------------- */\n\n#ifndef GL_ARB_viewport_array\n#define GL_ARB_viewport_array 1\n\n#define GL_DEPTH_RANGE 0x0B70\n#define GL_VIEWPORT 0x0BA2\n#define GL_SCISSOR_BOX 0x0C10\n#define GL_SCISSOR_TEST 0x0C11\n#define GL_MAX_VIEWPORTS 0x825B\n#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C\n#define GL_VIEWPORT_BOUNDS_RANGE 0x825D\n#define GL_LAYER_PROVOKING_VERTEX 0x825E\n#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F\n#define GL_UNDEFINED_VERTEX 0x8260\n#define GL_FIRST_VERTEX_CONVENTION 0x8E4D\n#define GL_LAST_VERTEX_CONVENTION 0x8E4E\n#define GL_PROVOKING_VERTEX 0x8E4F\n\ntypedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v);\ntypedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f);\ntypedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data);\ntypedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data);\ntypedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v);\ntypedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v);\ntypedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v);\ntypedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);\ntypedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v);\n\n#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv)\n#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed)\n#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v)\n#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v)\n#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv)\n#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed)\n#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv)\n#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv)\n#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf)\n#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv)\n\n#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array)\n\n#endif /* GL_ARB_viewport_array */\n\n/* --------------------------- GL_ARB_window_pos --------------------------- */\n\n#ifndef GL_ARB_window_pos\n#define GL_ARB_window_pos 1\n\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p);\n\n#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB)\n#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB)\n#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB)\n#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB)\n#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB)\n#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB)\n#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB)\n#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB)\n#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB)\n#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB)\n#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB)\n#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB)\n#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB)\n#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB)\n#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB)\n#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB)\n\n#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos)\n\n#endif /* GL_ARB_window_pos */\n\n/* ------------------------- GL_ATIX_point_sprites ------------------------- */\n\n#ifndef GL_ATIX_point_sprites\n#define GL_ATIX_point_sprites 1\n\n#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0\n#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1\n#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2\n#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3\n#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4\n#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5\n\n#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites)\n\n#endif /* GL_ATIX_point_sprites */\n\n/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */\n\n#ifndef GL_ATIX_texture_env_combine3\n#define GL_ATIX_texture_env_combine3 1\n\n#define GL_MODULATE_ADD_ATIX 0x8744\n#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745\n#define GL_MODULATE_SUBTRACT_ATIX 0x8746\n\n#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3)\n\n#endif /* GL_ATIX_texture_env_combine3 */\n\n/* ----------------------- GL_ATIX_texture_env_route ----------------------- */\n\n#ifndef GL_ATIX_texture_env_route\n#define GL_ATIX_texture_env_route 1\n\n#define GL_SECONDARY_COLOR_ATIX 0x8747\n#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748\n#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749\n\n#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route)\n\n#endif /* GL_ATIX_texture_env_route */\n\n/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */\n\n#ifndef GL_ATIX_vertex_shader_output_point_size\n#define GL_ATIX_vertex_shader_output_point_size 1\n\n#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E\n\n#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size)\n\n#endif /* GL_ATIX_vertex_shader_output_point_size */\n\n/* -------------------------- GL_ATI_draw_buffers -------------------------- */\n\n#ifndef GL_ATI_draw_buffers\n#define GL_ATI_draw_buffers 1\n\n#define GL_MAX_DRAW_BUFFERS_ATI 0x8824\n#define GL_DRAW_BUFFER0_ATI 0x8825\n#define GL_DRAW_BUFFER1_ATI 0x8826\n#define GL_DRAW_BUFFER2_ATI 0x8827\n#define GL_DRAW_BUFFER3_ATI 0x8828\n#define GL_DRAW_BUFFER4_ATI 0x8829\n#define GL_DRAW_BUFFER5_ATI 0x882A\n#define GL_DRAW_BUFFER6_ATI 0x882B\n#define GL_DRAW_BUFFER7_ATI 0x882C\n#define GL_DRAW_BUFFER8_ATI 0x882D\n#define GL_DRAW_BUFFER9_ATI 0x882E\n#define GL_DRAW_BUFFER10_ATI 0x882F\n#define GL_DRAW_BUFFER11_ATI 0x8830\n#define GL_DRAW_BUFFER12_ATI 0x8831\n#define GL_DRAW_BUFFER13_ATI 0x8832\n#define GL_DRAW_BUFFER14_ATI 0x8833\n#define GL_DRAW_BUFFER15_ATI 0x8834\n\ntypedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs);\n\n#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI)\n\n#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers)\n\n#endif /* GL_ATI_draw_buffers */\n\n/* -------------------------- GL_ATI_element_array ------------------------- */\n\n#ifndef GL_ATI_element_array\n#define GL_ATI_element_array 1\n\n#define GL_ELEMENT_ARRAY_ATI 0x8768\n#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769\n#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A\n\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);\ntypedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);\ntypedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer);\n\n#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI)\n#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI)\n#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI)\n\n#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array)\n\n#endif /* GL_ATI_element_array */\n\n/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */\n\n#ifndef GL_ATI_envmap_bumpmap\n#define GL_ATI_envmap_bumpmap 1\n\n#define GL_BUMP_ROT_MATRIX_ATI 0x8775\n#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776\n#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777\n#define GL_BUMP_TEX_UNITS_ATI 0x8778\n#define GL_DUDV_ATI 0x8779\n#define GL_DU8DV8_ATI 0x877A\n#define GL_BUMP_ENVMAP_ATI 0x877B\n#define GL_BUMP_TARGET_ATI 0x877C\n\ntypedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);\ntypedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);\ntypedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);\ntypedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);\n\n#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI)\n#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI)\n#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI)\n#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI)\n\n#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap)\n\n#endif /* GL_ATI_envmap_bumpmap */\n\n/* ------------------------- GL_ATI_fragment_shader ------------------------ */\n\n#ifndef GL_ATI_fragment_shader\n#define GL_ATI_fragment_shader 1\n\n#define GL_RED_BIT_ATI 0x00000001\n#define GL_2X_BIT_ATI 0x00000001\n#define GL_4X_BIT_ATI 0x00000002\n#define GL_GREEN_BIT_ATI 0x00000002\n#define GL_COMP_BIT_ATI 0x00000002\n#define GL_BLUE_BIT_ATI 0x00000004\n#define GL_8X_BIT_ATI 0x00000004\n#define GL_NEGATE_BIT_ATI 0x00000004\n#define GL_BIAS_BIT_ATI 0x00000008\n#define GL_HALF_BIT_ATI 0x00000008\n#define GL_QUARTER_BIT_ATI 0x00000010\n#define GL_EIGHTH_BIT_ATI 0x00000020\n#define GL_SATURATE_BIT_ATI 0x00000040\n#define GL_FRAGMENT_SHADER_ATI 0x8920\n#define GL_REG_0_ATI 0x8921\n#define GL_REG_1_ATI 0x8922\n#define GL_REG_2_ATI 0x8923\n#define GL_REG_3_ATI 0x8924\n#define GL_REG_4_ATI 0x8925\n#define GL_REG_5_ATI 0x8926\n#define GL_CON_0_ATI 0x8941\n#define GL_CON_1_ATI 0x8942\n#define GL_CON_2_ATI 0x8943\n#define GL_CON_3_ATI 0x8944\n#define GL_CON_4_ATI 0x8945\n#define GL_CON_5_ATI 0x8946\n#define GL_CON_6_ATI 0x8947\n#define GL_CON_7_ATI 0x8948\n#define GL_MOV_ATI 0x8961\n#define GL_ADD_ATI 0x8963\n#define GL_MUL_ATI 0x8964\n#define GL_SUB_ATI 0x8965\n#define GL_DOT3_ATI 0x8966\n#define GL_DOT4_ATI 0x8967\n#define GL_MAD_ATI 0x8968\n#define GL_LERP_ATI 0x8969\n#define GL_CND_ATI 0x896A\n#define GL_CND0_ATI 0x896B\n#define GL_DOT2_ADD_ATI 0x896C\n#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D\n#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E\n#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F\n#define GL_NUM_PASSES_ATI 0x8970\n#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971\n#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972\n#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973\n#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974\n#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975\n#define GL_SWIZZLE_STR_ATI 0x8976\n#define GL_SWIZZLE_STQ_ATI 0x8977\n#define GL_SWIZZLE_STR_DR_ATI 0x8978\n#define GL_SWIZZLE_STQ_DQ_ATI 0x8979\n#define GL_SWIZZLE_STRQ_ATI 0x897A\n#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B\n\ntypedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);\ntypedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);\ntypedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);\ntypedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);\ntypedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);\ntypedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);\ntypedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void);\ntypedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);\ntypedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);\ntypedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);\ntypedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value);\n\n#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI)\n#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI)\n#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI)\n#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI)\n#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI)\n#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI)\n#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI)\n#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI)\n#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI)\n#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI)\n#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI)\n#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI)\n#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI)\n#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI)\n\n#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader)\n\n#endif /* GL_ATI_fragment_shader */\n\n/* ------------------------ GL_ATI_map_object_buffer ----------------------- */\n\n#ifndef GL_ATI_map_object_buffer\n#define GL_ATI_map_object_buffer 1\n\ntypedef void* (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);\n\n#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI)\n#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI)\n\n#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer)\n\n#endif /* GL_ATI_map_object_buffer */\n\n/* ----------------------------- GL_ATI_meminfo ---------------------------- */\n\n#ifndef GL_ATI_meminfo\n#define GL_ATI_meminfo 1\n\n#define GL_VBO_FREE_MEMORY_ATI 0x87FB\n#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC\n#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD\n\n#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo)\n\n#endif /* GL_ATI_meminfo */\n\n/* -------------------------- GL_ATI_pn_triangles -------------------------- */\n\n#ifndef GL_ATI_pn_triangles\n#define GL_ATI_pn_triangles 1\n\n#define GL_PN_TRIANGLES_ATI 0x87F0\n#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1\n#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2\n#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3\n#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4\n#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5\n#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6\n#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7\n#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8\n\ntypedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);\n\n#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI)\n#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI)\n\n#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles)\n\n#endif /* GL_ATI_pn_triangles */\n\n/* ------------------------ GL_ATI_separate_stencil ------------------------ */\n\n#ifndef GL_ATI_separate_stencil\n#define GL_ATI_separate_stencil 1\n\n#define GL_STENCIL_BACK_FUNC_ATI 0x8800\n#define GL_STENCIL_BACK_FAIL_ATI 0x8801\n#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802\n#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803\n\ntypedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);\ntypedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);\n\n#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI)\n#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI)\n\n#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil)\n\n#endif /* GL_ATI_separate_stencil */\n\n/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */\n\n#ifndef GL_ATI_shader_texture_lod\n#define GL_ATI_shader_texture_lod 1\n\n#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod)\n\n#endif /* GL_ATI_shader_texture_lod */\n\n/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */\n\n#ifndef GL_ATI_text_fragment_shader\n#define GL_ATI_text_fragment_shader 1\n\n#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200\n\n#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader)\n\n#endif /* GL_ATI_text_fragment_shader */\n\n/* --------------------- GL_ATI_texture_compression_3dc -------------------- */\n\n#ifndef GL_ATI_texture_compression_3dc\n#define GL_ATI_texture_compression_3dc 1\n\n#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837\n\n#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc)\n\n#endif /* GL_ATI_texture_compression_3dc */\n\n/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */\n\n#ifndef GL_ATI_texture_env_combine3\n#define GL_ATI_texture_env_combine3 1\n\n#define GL_MODULATE_ADD_ATI 0x8744\n#define GL_MODULATE_SIGNED_ADD_ATI 0x8745\n#define GL_MODULATE_SUBTRACT_ATI 0x8746\n\n#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3)\n\n#endif /* GL_ATI_texture_env_combine3 */\n\n/* -------------------------- GL_ATI_texture_float ------------------------- */\n\n#ifndef GL_ATI_texture_float\n#define GL_ATI_texture_float 1\n\n#define GL_RGBA_FLOAT32_ATI 0x8814\n#define GL_RGB_FLOAT32_ATI 0x8815\n#define GL_ALPHA_FLOAT32_ATI 0x8816\n#define GL_INTENSITY_FLOAT32_ATI 0x8817\n#define GL_LUMINANCE_FLOAT32_ATI 0x8818\n#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819\n#define GL_RGBA_FLOAT16_ATI 0x881A\n#define GL_RGB_FLOAT16_ATI 0x881B\n#define GL_ALPHA_FLOAT16_ATI 0x881C\n#define GL_INTENSITY_FLOAT16_ATI 0x881D\n#define GL_LUMINANCE_FLOAT16_ATI 0x881E\n#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F\n\n#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float)\n\n#endif /* GL_ATI_texture_float */\n\n/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */\n\n#ifndef GL_ATI_texture_mirror_once\n#define GL_ATI_texture_mirror_once 1\n\n#define GL_MIRROR_CLAMP_ATI 0x8742\n#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743\n\n#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once)\n\n#endif /* GL_ATI_texture_mirror_once */\n\n/* ----------------------- GL_ATI_vertex_array_object ---------------------- */\n\n#ifndef GL_ATI_vertex_array_object\n#define GL_ATI_vertex_array_object 1\n\n#define GL_STATIC_ATI 0x8760\n#define GL_DYNAMIC_ATI 0x8761\n#define GL_PRESERVE_ATI 0x8762\n#define GL_DISCARD_ATI 0x8763\n#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764\n#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765\n#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766\n#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767\n\ntypedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);\ntypedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);\ntypedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage);\ntypedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve);\ntypedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);\n\n#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI)\n#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI)\n#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI)\n#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI)\n#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI)\n#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI)\n#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI)\n#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI)\n#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI)\n#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI)\n#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI)\n#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI)\n\n#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object)\n\n#endif /* GL_ATI_vertex_array_object */\n\n/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */\n\n#ifndef GL_ATI_vertex_attrib_array_object\n#define GL_ATI_vertex_attrib_array_object 1\n\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);\n\n#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI)\n#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI)\n#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI)\n\n#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object)\n\n#endif /* GL_ATI_vertex_attrib_array_object */\n\n/* ------------------------- GL_ATI_vertex_streams ------------------------- */\n\n#ifndef GL_ATI_vertex_streams\n#define GL_ATI_vertex_streams 1\n\n#define GL_MAX_VERTEX_STREAMS_ATI 0x876B\n#define GL_VERTEX_SOURCE_ATI 0x876C\n#define GL_VERTEX_STREAM0_ATI 0x876D\n#define GL_VERTEX_STREAM1_ATI 0x876E\n#define GL_VERTEX_STREAM2_ATI 0x876F\n#define GL_VERTEX_STREAM3_ATI 0x8770\n#define GL_VERTEX_STREAM4_ATI 0x8771\n#define GL_VERTEX_STREAM5_ATI 0x8772\n#define GL_VERTEX_STREAM6_ATI 0x8773\n#define GL_VERTEX_STREAM7_ATI 0x8774\n\ntypedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *v);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *v);\n\n#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI)\n#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI)\n#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI)\n#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI)\n#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI)\n#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI)\n#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI)\n#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI)\n#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI)\n#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI)\n#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI)\n#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI)\n#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI)\n#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI)\n#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI)\n#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI)\n#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI)\n#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI)\n#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI)\n#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI)\n#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI)\n#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI)\n#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI)\n#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI)\n#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI)\n#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI)\n#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI)\n#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI)\n#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI)\n#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI)\n#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI)\n#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI)\n#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI)\n#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI)\n#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI)\n#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI)\n#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI)\n\n#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams)\n\n#endif /* GL_ATI_vertex_streams */\n\n/* --------------------------- GL_EXT_422_pixels --------------------------- */\n\n#ifndef GL_EXT_422_pixels\n#define GL_EXT_422_pixels 1\n\n#define GL_422_EXT 0x80CC\n#define GL_422_REV_EXT 0x80CD\n#define GL_422_AVERAGE_EXT 0x80CE\n#define GL_422_REV_AVERAGE_EXT 0x80CF\n\n#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels)\n\n#endif /* GL_EXT_422_pixels */\n\n/* ---------------------------- GL_EXT_Cg_shader --------------------------- */\n\n#ifndef GL_EXT_Cg_shader\n#define GL_EXT_Cg_shader 1\n\n#define GL_CG_VERTEX_SHADER_EXT 0x890E\n#define GL_CG_FRAGMENT_SHADER_EXT 0x890F\n\n#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader)\n\n#endif /* GL_EXT_Cg_shader */\n\n/* ------------------------------ GL_EXT_abgr ------------------------------ */\n\n#ifndef GL_EXT_abgr\n#define GL_EXT_abgr 1\n\n#define GL_ABGR_EXT 0x8000\n\n#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr)\n\n#endif /* GL_EXT_abgr */\n\n/* ------------------------------ GL_EXT_bgra ------------------------------ */\n\n#ifndef GL_EXT_bgra\n#define GL_EXT_bgra 1\n\n#define GL_BGR_EXT 0x80E0\n#define GL_BGRA_EXT 0x80E1\n\n#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra)\n\n#endif /* GL_EXT_bgra */\n\n/* ------------------------ GL_EXT_bindable_uniform ------------------------ */\n\n#ifndef GL_EXT_bindable_uniform\n#define GL_EXT_bindable_uniform 1\n\n#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2\n#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3\n#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4\n#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED\n#define GL_UNIFORM_BUFFER_EXT 0x8DEE\n#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF\n\ntypedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);\ntypedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);\n\n#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT)\n#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT)\n#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT)\n\n#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform)\n\n#endif /* GL_EXT_bindable_uniform */\n\n/* --------------------------- GL_EXT_blend_color -------------------------- */\n\n#ifndef GL_EXT_blend_color\n#define GL_EXT_blend_color 1\n\n#define GL_CONSTANT_COLOR_EXT 0x8001\n#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002\n#define GL_CONSTANT_ALPHA_EXT 0x8003\n#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004\n#define GL_BLEND_COLOR_EXT 0x8005\n\ntypedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);\n\n#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT)\n\n#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color)\n\n#endif /* GL_EXT_blend_color */\n\n/* --------------------- GL_EXT_blend_equation_separate -------------------- */\n\n#ifndef GL_EXT_blend_equation_separate\n#define GL_EXT_blend_equation_separate 1\n\n#define GL_BLEND_EQUATION_RGB_EXT 0x8009\n#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D\n\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);\n\n#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT)\n\n#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate)\n\n#endif /* GL_EXT_blend_equation_separate */\n\n/* ----------------------- GL_EXT_blend_func_separate ---------------------- */\n\n#ifndef GL_EXT_blend_func_separate\n#define GL_EXT_blend_func_separate 1\n\n#define GL_BLEND_DST_RGB_EXT 0x80C8\n#define GL_BLEND_SRC_RGB_EXT 0x80C9\n#define GL_BLEND_DST_ALPHA_EXT 0x80CA\n#define GL_BLEND_SRC_ALPHA_EXT 0x80CB\n\ntypedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);\n\n#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT)\n\n#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate)\n\n#endif /* GL_EXT_blend_func_separate */\n\n/* ------------------------- GL_EXT_blend_logic_op ------------------------- */\n\n#ifndef GL_EXT_blend_logic_op\n#define GL_EXT_blend_logic_op 1\n\n#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op)\n\n#endif /* GL_EXT_blend_logic_op */\n\n/* -------------------------- GL_EXT_blend_minmax -------------------------- */\n\n#ifndef GL_EXT_blend_minmax\n#define GL_EXT_blend_minmax 1\n\n#define GL_FUNC_ADD_EXT 0x8006\n#define GL_MIN_EXT 0x8007\n#define GL_MAX_EXT 0x8008\n#define GL_BLEND_EQUATION_EXT 0x8009\n\ntypedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);\n\n#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT)\n\n#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax)\n\n#endif /* GL_EXT_blend_minmax */\n\n/* ------------------------- GL_EXT_blend_subtract ------------------------- */\n\n#ifndef GL_EXT_blend_subtract\n#define GL_EXT_blend_subtract 1\n\n#define GL_FUNC_SUBTRACT_EXT 0x800A\n#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B\n\n#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract)\n\n#endif /* GL_EXT_blend_subtract */\n\n/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */\n\n#ifndef GL_EXT_clip_volume_hint\n#define GL_EXT_clip_volume_hint 1\n\n#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0\n\n#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint)\n\n#endif /* GL_EXT_clip_volume_hint */\n\n/* ------------------------------ GL_EXT_cmyka ----------------------------- */\n\n#ifndef GL_EXT_cmyka\n#define GL_EXT_cmyka 1\n\n#define GL_CMYK_EXT 0x800C\n#define GL_CMYKA_EXT 0x800D\n#define GL_PACK_CMYK_HINT_EXT 0x800E\n#define GL_UNPACK_CMYK_HINT_EXT 0x800F\n\n#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka)\n\n#endif /* GL_EXT_cmyka */\n\n/* ------------------------- GL_EXT_color_subtable ------------------------- */\n\n#ifndef GL_EXT_color_subtable\n#define GL_EXT_color_subtable 1\n\ntypedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);\n\n#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT)\n#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT)\n\n#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable)\n\n#endif /* GL_EXT_color_subtable */\n\n/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */\n\n#ifndef GL_EXT_compiled_vertex_array\n#define GL_EXT_compiled_vertex_array 1\n\n#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8\n#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9\n\ntypedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);\ntypedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void);\n\n#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT)\n#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT)\n\n#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array)\n\n#endif /* GL_EXT_compiled_vertex_array */\n\n/* --------------------------- GL_EXT_convolution -------------------------- */\n\n#ifndef GL_EXT_convolution\n#define GL_EXT_convolution 1\n\n#define GL_CONVOLUTION_1D_EXT 0x8010\n#define GL_CONVOLUTION_2D_EXT 0x8011\n#define GL_SEPARABLE_2D_EXT 0x8012\n#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013\n#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014\n#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015\n#define GL_REDUCE_EXT 0x8016\n#define GL_CONVOLUTION_FORMAT_EXT 0x8017\n#define GL_CONVOLUTION_WIDTH_EXT 0x8018\n#define GL_CONVOLUTION_HEIGHT_EXT 0x8019\n#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A\n#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B\n#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C\n#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D\n#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E\n#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F\n#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020\n#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021\n#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022\n#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023\n\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image);\ntypedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span);\ntypedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column);\n\n#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT)\n#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT)\n#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT)\n#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT)\n#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT)\n#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT)\n#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT)\n#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT)\n#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT)\n#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT)\n#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT)\n#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT)\n#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT)\n\n#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution)\n\n#endif /* GL_EXT_convolution */\n\n/* ------------------------ GL_EXT_coordinate_frame ------------------------ */\n\n#ifndef GL_EXT_coordinate_frame\n#define GL_EXT_coordinate_frame 1\n\n#define GL_TANGENT_ARRAY_EXT 0x8439\n#define GL_BINORMAL_ARRAY_EXT 0x843A\n#define GL_CURRENT_TANGENT_EXT 0x843B\n#define GL_CURRENT_BINORMAL_EXT 0x843C\n#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E\n#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F\n#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440\n#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441\n#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442\n#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443\n#define GL_MAP1_TANGENT_EXT 0x8444\n#define GL_MAP2_TANGENT_EXT 0x8445\n#define GL_MAP1_BINORMAL_EXT 0x8446\n#define GL_MAP2_BINORMAL_EXT 0x8447\n\ntypedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer);\ntypedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer);\n\n#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT)\n#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT)\n\n#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame)\n\n#endif /* GL_EXT_coordinate_frame */\n\n/* -------------------------- GL_EXT_copy_texture -------------------------- */\n\n#ifndef GL_EXT_copy_texture\n#define GL_EXT_copy_texture 1\n\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\n\n#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT)\n#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT)\n#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT)\n#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT)\n#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT)\n\n#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture)\n\n#endif /* GL_EXT_copy_texture */\n\n/* --------------------------- GL_EXT_cull_vertex -------------------------- */\n\n#ifndef GL_EXT_cull_vertex\n#define GL_EXT_cull_vertex 1\n\n#define GL_CULL_VERTEX_EXT 0x81AA\n#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB\n#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC\n\ntypedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params);\n\n#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT)\n#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT)\n\n#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex)\n\n#endif /* GL_EXT_cull_vertex */\n\n/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */\n\n#ifndef GL_EXT_depth_bounds_test\n#define GL_EXT_depth_bounds_test 1\n\n#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890\n#define GL_DEPTH_BOUNDS_EXT 0x8891\n\ntypedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);\n\n#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT)\n\n#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test)\n\n#endif /* GL_EXT_depth_bounds_test */\n\n/* ----------------------- GL_EXT_direct_state_access ---------------------- */\n\n#ifndef GL_EXT_direct_state_access\n#define GL_EXT_direct_state_access 1\n\n#define GL_PROGRAM_MATRIX_EXT 0x8E2D\n#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E\n#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F\n\ntypedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);\ntypedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);\ntypedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);\ntypedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\ntypedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\ntypedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);\ntypedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);\ntypedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);\ntypedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);\ntypedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img);\ntypedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img);\ntypedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params);\ntypedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params);\ntypedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels);\ntypedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param);\ntypedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);\ntypedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);\ntypedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);\ntypedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode);\ntypedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m);\ntypedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);\ntypedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode);\ntypedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode);\ntypedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage);\ntypedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data);\ntypedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);\ntypedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\ntypedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);\ntypedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string);\ntypedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param);\ntypedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);\ntypedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);\n\n#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT)\n#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT)\n#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT)\n#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT)\n#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT)\n#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT)\n#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT)\n#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT)\n#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT)\n#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT)\n#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT)\n#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT)\n#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT)\n#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT)\n#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT)\n#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT)\n#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT)\n#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT)\n#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT)\n#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT)\n#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT)\n#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT)\n#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT)\n#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT)\n#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT)\n#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT)\n#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT)\n#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT)\n#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT)\n#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT)\n#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT)\n#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT)\n#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT)\n#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT)\n#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT)\n#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT)\n#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT)\n#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT)\n#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT)\n#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT)\n#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT)\n#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT)\n#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT)\n#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT)\n#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT)\n#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT)\n#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT)\n#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT)\n#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT)\n#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT)\n#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT)\n#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT)\n#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT)\n#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT)\n#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT)\n#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT)\n#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT)\n#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT)\n#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT)\n#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT)\n#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT)\n#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT)\n#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT)\n#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT)\n#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT)\n#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT)\n#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT)\n#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT)\n#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT)\n#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT)\n#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT)\n#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT)\n#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT)\n#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT)\n#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT)\n#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT)\n#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT)\n#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT)\n#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT)\n#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT)\n#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT)\n#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT)\n#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT)\n#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT)\n#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT)\n#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT)\n#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT)\n#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT)\n#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT)\n#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT)\n#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT)\n#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT)\n#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT)\n#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT)\n#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT)\n#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT)\n#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT)\n#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT)\n#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT)\n#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT)\n#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT)\n#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT)\n#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT)\n#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT)\n#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT)\n#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT)\n#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT)\n#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT)\n#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT)\n#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT)\n#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT)\n#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT)\n#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT)\n#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT)\n#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT)\n#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT)\n#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT)\n#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT)\n#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT)\n#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT)\n#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT)\n#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT)\n#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT)\n#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT)\n#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT)\n#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT)\n#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT)\n#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT)\n#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT)\n#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT)\n#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT)\n#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT)\n#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT)\n#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT)\n#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT)\n#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT)\n#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT)\n#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT)\n#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT)\n#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT)\n#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT)\n#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT)\n#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT)\n#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT)\n#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT)\n#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT)\n#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT)\n#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT)\n#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT)\n#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT)\n#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT)\n#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT)\n#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT)\n#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT)\n#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT)\n#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT)\n#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT)\n#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT)\n#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT)\n#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT)\n#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT)\n#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT)\n#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT)\n#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT)\n#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT)\n#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT)\n#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT)\n#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT)\n#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT)\n#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT)\n#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT)\n#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT)\n#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT)\n#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT)\n#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT)\n#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT)\n#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT)\n#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT)\n#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT)\n#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT)\n#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT)\n#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT)\n#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT)\n#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT)\n#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT)\n#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT)\n#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT)\n#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT)\n#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT)\n#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT)\n#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT)\n#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT)\n#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT)\n#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT)\n#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT)\n#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT)\n#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT)\n#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT)\n#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT)\n#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT)\n#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT)\n#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT)\n#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT)\n#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT)\n#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT)\n#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT)\n#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT)\n#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT)\n#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT)\n#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT)\n#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT)\n#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT)\n#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT)\n\n#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access)\n\n#endif /* GL_EXT_direct_state_access */\n\n/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */\n\n#ifndef GL_EXT_draw_buffers2\n#define GL_EXT_draw_buffers2 1\n\ntypedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);\ntypedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);\ntypedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data);\ntypedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data);\ntypedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);\n\n#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT)\n#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT)\n#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT)\n#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT)\n#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT)\n#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT)\n\n#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2)\n\n#endif /* GL_EXT_draw_buffers2 */\n\n/* ------------------------- GL_EXT_draw_instanced ------------------------- */\n\n#ifndef GL_EXT_draw_instanced\n#define GL_EXT_draw_instanced 1\n\ntypedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);\n\n#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT)\n#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT)\n\n#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced)\n\n#endif /* GL_EXT_draw_instanced */\n\n/* ----------------------- GL_EXT_draw_range_elements ---------------------- */\n\n#ifndef GL_EXT_draw_range_elements\n#define GL_EXT_draw_range_elements 1\n\n#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8\n#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9\n\ntypedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);\n\n#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT)\n\n#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements)\n\n#endif /* GL_EXT_draw_range_elements */\n\n/* ---------------------------- GL_EXT_fog_coord --------------------------- */\n\n#ifndef GL_EXT_fog_coord\n#define GL_EXT_fog_coord 1\n\n#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450\n#define GL_FOG_COORDINATE_EXT 0x8451\n#define GL_FRAGMENT_DEPTH_EXT 0x8452\n#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453\n#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454\n#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455\n#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456\n#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457\n\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);\n\n#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT)\n#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT)\n#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT)\n#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT)\n#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT)\n\n#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord)\n\n#endif /* GL_EXT_fog_coord */\n\n/* ------------------------ GL_EXT_fragment_lighting ----------------------- */\n\n#ifndef GL_EXT_fragment_lighting\n#define GL_EXT_fragment_lighting 1\n\n#define GL_FRAGMENT_LIGHTING_EXT 0x8400\n#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401\n#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402\n#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403\n#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404\n#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405\n#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406\n#define GL_LIGHT_ENV_MODE_EXT 0x8407\n#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408\n#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409\n#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A\n#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B\n#define GL_FRAGMENT_LIGHT0_EXT 0x840C\n#define GL_FRAGMENT_LIGHT7_EXT 0x8413\n\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param);\n\n#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT)\n#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT)\n#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT)\n#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT)\n#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT)\n#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT)\n#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT)\n#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT)\n#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT)\n#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT)\n#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT)\n#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT)\n#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT)\n#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT)\n#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT)\n#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT)\n#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT)\n#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT)\n\n#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting)\n\n#endif /* GL_EXT_fragment_lighting */\n\n/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */\n\n#ifndef GL_EXT_framebuffer_blit\n#define GL_EXT_framebuffer_blit 1\n\n#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6\n#define GL_READ_FRAMEBUFFER_EXT 0x8CA8\n#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9\n#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA\n\ntypedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\n\n#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT)\n\n#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit)\n\n#endif /* GL_EXT_framebuffer_blit */\n\n/* --------------------- GL_EXT_framebuffer_multisample -------------------- */\n\n#ifndef GL_EXT_framebuffer_multisample\n#define GL_EXT_framebuffer_multisample 1\n\n#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB\n#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56\n#define GL_MAX_SAMPLES_EXT 0x8D57\n\ntypedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);\n\n#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT)\n\n#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample)\n\n#endif /* GL_EXT_framebuffer_multisample */\n\n/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */\n\n#ifndef GL_EXT_framebuffer_multisample_blit_scaled\n#define GL_EXT_framebuffer_multisample_blit_scaled 1\n\n#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA\n#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB\n\n#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled)\n\n#endif /* GL_EXT_framebuffer_multisample_blit_scaled */\n\n/* ----------------------- GL_EXT_framebuffer_object ----------------------- */\n\n#ifndef GL_EXT_framebuffer_object\n#define GL_EXT_framebuffer_object 1\n\n#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506\n#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8\n#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6\n#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0\n#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4\n#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5\n#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6\n#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7\n#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9\n#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA\n#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB\n#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC\n#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD\n#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF\n#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0\n#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1\n#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2\n#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3\n#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4\n#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5\n#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6\n#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7\n#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8\n#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9\n#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA\n#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB\n#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC\n#define GL_COLOR_ATTACHMENT13_EXT 0x8CED\n#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE\n#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF\n#define GL_DEPTH_ATTACHMENT_EXT 0x8D00\n#define GL_STENCIL_ATTACHMENT_EXT 0x8D20\n#define GL_FRAMEBUFFER_EXT 0x8D40\n#define GL_RENDERBUFFER_EXT 0x8D41\n#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42\n#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43\n#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44\n#define GL_STENCIL_INDEX1_EXT 0x8D46\n#define GL_STENCIL_INDEX4_EXT 0x8D47\n#define GL_STENCIL_INDEX8_EXT 0x8D48\n#define GL_STENCIL_INDEX16_EXT 0x8D49\n#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50\n#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51\n#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52\n#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53\n#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54\n#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55\n\ntypedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);\ntypedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);\ntypedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers);\ntypedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);\ntypedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers);\ntypedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers);\ntypedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);\ntypedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);\ntypedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);\n\n#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT)\n#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT)\n#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT)\n#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT)\n#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT)\n#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT)\n#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT)\n#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT)\n#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT)\n#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT)\n#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT)\n#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT)\n#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT)\n#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT)\n#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT)\n#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT)\n#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT)\n\n#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object)\n\n#endif /* GL_EXT_framebuffer_object */\n\n/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */\n\n#ifndef GL_EXT_framebuffer_sRGB\n#define GL_EXT_framebuffer_sRGB 1\n\n#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9\n#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA\n\n#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB)\n\n#endif /* GL_EXT_framebuffer_sRGB */\n\n/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */\n\n#ifndef GL_EXT_geometry_shader4\n#define GL_EXT_geometry_shader4 1\n\n#define GL_LINES_ADJACENCY_EXT 0xA\n#define GL_LINE_STRIP_ADJACENCY_EXT 0xB\n#define GL_TRIANGLES_ADJACENCY_EXT 0xC\n#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD\n#define GL_PROGRAM_POINT_SIZE_EXT 0x8642\n#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B\n#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29\n#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4\n#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8\n#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9\n#define GL_GEOMETRY_SHADER_EXT 0x8DD9\n#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA\n#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB\n#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC\n#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD\n#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE\n#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF\n#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0\n#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1\n\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);\n\n#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT)\n#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT)\n#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT)\n\n#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4)\n\n#endif /* GL_EXT_geometry_shader4 */\n\n/* --------------------- GL_EXT_gpu_program_parameters --------------------- */\n\n#ifndef GL_EXT_gpu_program_parameters\n#define GL_EXT_gpu_program_parameters 1\n\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);\n\n#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT)\n#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT)\n\n#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters)\n\n#endif /* GL_EXT_gpu_program_parameters */\n\n/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */\n\n#ifndef GL_EXT_gpu_shader4\n#define GL_EXT_gpu_shader4 1\n\n#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD\n#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0\n#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1\n#define GL_SAMPLER_BUFFER_EXT 0x8DC2\n#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3\n#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4\n#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5\n#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6\n#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7\n#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8\n#define GL_INT_SAMPLER_1D_EXT 0x8DC9\n#define GL_INT_SAMPLER_2D_EXT 0x8DCA\n#define GL_INT_SAMPLER_3D_EXT 0x8DCB\n#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC\n#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD\n#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE\n#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF\n#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0\n#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1\n#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2\n#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3\n#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4\n#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5\n#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6\n#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7\n#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8\n\ntypedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);\ntypedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n\n#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT)\n#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT)\n#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT)\n#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT)\n#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT)\n#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT)\n#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT)\n#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT)\n#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT)\n#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT)\n#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT)\n#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT)\n#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT)\n#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT)\n#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT)\n#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT)\n#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT)\n#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT)\n#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT)\n#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT)\n#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT)\n#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT)\n#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT)\n#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT)\n#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT)\n#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT)\n#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT)\n#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT)\n#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT)\n#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT)\n#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT)\n#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT)\n#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT)\n#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT)\n\n#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4)\n\n#endif /* GL_EXT_gpu_shader4 */\n\n/* ---------------------------- GL_EXT_histogram --------------------------- */\n\n#ifndef GL_EXT_histogram\n#define GL_EXT_histogram 1\n\n#define GL_HISTOGRAM_EXT 0x8024\n#define GL_PROXY_HISTOGRAM_EXT 0x8025\n#define GL_HISTOGRAM_WIDTH_EXT 0x8026\n#define GL_HISTOGRAM_FORMAT_EXT 0x8027\n#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028\n#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029\n#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A\n#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B\n#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C\n#define GL_HISTOGRAM_SINK_EXT 0x802D\n#define GL_MINMAX_EXT 0x802E\n#define GL_MINMAX_FORMAT_EXT 0x802F\n#define GL_MINMAX_SINK_EXT 0x8030\n\ntypedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values);\ntypedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values);\ntypedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);\ntypedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);\ntypedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target);\n\n#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT)\n#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT)\n#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT)\n#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT)\n#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT)\n#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT)\n#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT)\n#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT)\n#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT)\n#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT)\n\n#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram)\n\n#endif /* GL_EXT_histogram */\n\n/* ----------------------- GL_EXT_index_array_formats ---------------------- */\n\n#ifndef GL_EXT_index_array_formats\n#define GL_EXT_index_array_formats 1\n\n#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats)\n\n#endif /* GL_EXT_index_array_formats */\n\n/* --------------------------- GL_EXT_index_func --------------------------- */\n\n#ifndef GL_EXT_index_func\n#define GL_EXT_index_func 1\n\ntypedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref);\n\n#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT)\n\n#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func)\n\n#endif /* GL_EXT_index_func */\n\n/* ------------------------- GL_EXT_index_material ------------------------- */\n\n#ifndef GL_EXT_index_material\n#define GL_EXT_index_material 1\n\ntypedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);\n\n#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT)\n\n#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material)\n\n#endif /* GL_EXT_index_material */\n\n/* -------------------------- GL_EXT_index_texture ------------------------- */\n\n#ifndef GL_EXT_index_texture\n#define GL_EXT_index_texture 1\n\n#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture)\n\n#endif /* GL_EXT_index_texture */\n\n/* -------------------------- GL_EXT_light_texture ------------------------- */\n\n#ifndef GL_EXT_light_texture\n#define GL_EXT_light_texture 1\n\n#define GL_FRAGMENT_MATERIAL_EXT 0x8349\n#define GL_FRAGMENT_NORMAL_EXT 0x834A\n#define GL_FRAGMENT_COLOR_EXT 0x834C\n#define GL_ATTENUATION_EXT 0x834D\n#define GL_SHADOW_ATTENUATION_EXT 0x834E\n#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F\n#define GL_TEXTURE_LIGHT_EXT 0x8350\n#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351\n#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352\n#define GL_FRAGMENT_DEPTH_EXT 0x8452\n\ntypedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);\n\n#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT)\n#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT)\n#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT)\n\n#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture)\n\n#endif /* GL_EXT_light_texture */\n\n/* ------------------------- GL_EXT_misc_attribute ------------------------- */\n\n#ifndef GL_EXT_misc_attribute\n#define GL_EXT_misc_attribute 1\n\n#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute)\n\n#endif /* GL_EXT_misc_attribute */\n\n/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */\n\n#ifndef GL_EXT_multi_draw_arrays\n#define GL_EXT_multi_draw_arrays 1\n\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount);\ntypedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount);\n\n#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT)\n#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT)\n\n#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays)\n\n#endif /* GL_EXT_multi_draw_arrays */\n\n/* --------------------------- GL_EXT_multisample -------------------------- */\n\n#ifndef GL_EXT_multisample\n#define GL_EXT_multisample 1\n\n#define GL_MULTISAMPLE_EXT 0x809D\n#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F\n#define GL_SAMPLE_MASK_EXT 0x80A0\n#define GL_1PASS_EXT 0x80A1\n#define GL_2PASS_0_EXT 0x80A2\n#define GL_2PASS_1_EXT 0x80A3\n#define GL_4PASS_0_EXT 0x80A4\n#define GL_4PASS_1_EXT 0x80A5\n#define GL_4PASS_2_EXT 0x80A6\n#define GL_4PASS_3_EXT 0x80A7\n#define GL_SAMPLE_BUFFERS_EXT 0x80A8\n#define GL_SAMPLES_EXT 0x80A9\n#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA\n#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB\n#define GL_SAMPLE_PATTERN_EXT 0x80AC\n#define GL_MULTISAMPLE_BIT_EXT 0x20000000\n\ntypedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);\ntypedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);\n\n#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT)\n#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT)\n\n#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample)\n\n#endif /* GL_EXT_multisample */\n\n/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */\n\n#ifndef GL_EXT_packed_depth_stencil\n#define GL_EXT_packed_depth_stencil 1\n\n#define GL_DEPTH_STENCIL_EXT 0x84F9\n#define GL_UNSIGNED_INT_24_8_EXT 0x84FA\n#define GL_DEPTH24_STENCIL8_EXT 0x88F0\n#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1\n\n#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil)\n\n#endif /* GL_EXT_packed_depth_stencil */\n\n/* -------------------------- GL_EXT_packed_float -------------------------- */\n\n#ifndef GL_EXT_packed_float\n#define GL_EXT_packed_float 1\n\n#define GL_R11F_G11F_B10F_EXT 0x8C3A\n#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B\n#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C\n\n#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float)\n\n#endif /* GL_EXT_packed_float */\n\n/* -------------------------- GL_EXT_packed_pixels ------------------------- */\n\n#ifndef GL_EXT_packed_pixels\n#define GL_EXT_packed_pixels 1\n\n#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032\n#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033\n#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034\n#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035\n#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036\n\n#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels)\n\n#endif /* GL_EXT_packed_pixels */\n\n/* ------------------------ GL_EXT_paletted_texture ------------------------ */\n\n#ifndef GL_EXT_paletted_texture\n#define GL_EXT_paletted_texture 1\n\n#define GL_TEXTURE_1D 0x0DE0\n#define GL_TEXTURE_2D 0x0DE1\n#define GL_PROXY_TEXTURE_1D 0x8063\n#define GL_PROXY_TEXTURE_2D 0x8064\n#define GL_TEXTURE_3D_EXT 0x806F\n#define GL_PROXY_TEXTURE_3D_EXT 0x8070\n#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8\n#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9\n#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA\n#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB\n#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC\n#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD\n#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE\n#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF\n#define GL_COLOR_INDEX1_EXT 0x80E2\n#define GL_COLOR_INDEX2_EXT 0x80E3\n#define GL_COLOR_INDEX4_EXT 0x80E4\n#define GL_COLOR_INDEX8_EXT 0x80E5\n#define GL_COLOR_INDEX12_EXT 0x80E6\n#define GL_COLOR_INDEX16_EXT 0x80E7\n#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED\n#define GL_TEXTURE_CUBE_MAP_ARB 0x8513\n#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B\n\ntypedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);\n\n#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT)\n#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT)\n#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT)\n#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT)\n\n#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture)\n\n#endif /* GL_EXT_paletted_texture */\n\n/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */\n\n#ifndef GL_EXT_pixel_buffer_object\n#define GL_EXT_pixel_buffer_object 1\n\n#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB\n#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC\n#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED\n#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF\n\n#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object)\n\n#endif /* GL_EXT_pixel_buffer_object */\n\n/* ------------------------- GL_EXT_pixel_transform ------------------------ */\n\n#ifndef GL_EXT_pixel_transform\n#define GL_EXT_pixel_transform 1\n\n#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330\n#define GL_PIXEL_MAG_FILTER_EXT 0x8331\n#define GL_PIXEL_MIN_FILTER_EXT 0x8332\n#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333\n#define GL_CUBIC_EXT 0x8334\n#define GL_AVERAGE_EXT 0x8335\n#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336\n#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337\n#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338\n\ntypedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param);\ntypedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);\n\n#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT)\n#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT)\n#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT)\n#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT)\n#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT)\n#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT)\n\n#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform)\n\n#endif /* GL_EXT_pixel_transform */\n\n/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */\n\n#ifndef GL_EXT_pixel_transform_color_table\n#define GL_EXT_pixel_transform_color_table 1\n\n#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table)\n\n#endif /* GL_EXT_pixel_transform_color_table */\n\n/* ------------------------ GL_EXT_point_parameters ------------------------ */\n\n#ifndef GL_EXT_point_parameters\n#define GL_EXT_point_parameters 1\n\n#define GL_POINT_SIZE_MIN_EXT 0x8126\n#define GL_POINT_SIZE_MAX_EXT 0x8127\n#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128\n#define GL_DISTANCE_ATTENUATION_EXT 0x8129\n\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params);\n\n#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT)\n#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT)\n\n#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters)\n\n#endif /* GL_EXT_point_parameters */\n\n/* ------------------------- GL_EXT_polygon_offset ------------------------- */\n\n#ifndef GL_EXT_polygon_offset\n#define GL_EXT_polygon_offset 1\n\n#define GL_POLYGON_OFFSET_EXT 0x8037\n#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038\n#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039\n\ntypedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);\n\n#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT)\n\n#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset)\n\n#endif /* GL_EXT_polygon_offset */\n\n/* ------------------------ GL_EXT_provoking_vertex ------------------------ */\n\n#ifndef GL_EXT_provoking_vertex\n#define GL_EXT_provoking_vertex 1\n\n#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C\n#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D\n#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E\n#define GL_PROVOKING_VERTEX_EXT 0x8E4F\n\ntypedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);\n\n#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT)\n\n#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex)\n\n#endif /* GL_EXT_provoking_vertex */\n\n/* ------------------------- GL_EXT_rescale_normal ------------------------- */\n\n#ifndef GL_EXT_rescale_normal\n#define GL_EXT_rescale_normal 1\n\n#define GL_RESCALE_NORMAL_EXT 0x803A\n\n#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal)\n\n#endif /* GL_EXT_rescale_normal */\n\n/* -------------------------- GL_EXT_scene_marker -------------------------- */\n\n#ifndef GL_EXT_scene_marker\n#define GL_EXT_scene_marker 1\n\ntypedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void);\n\n#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT)\n#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT)\n\n#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker)\n\n#endif /* GL_EXT_scene_marker */\n\n/* ------------------------- GL_EXT_secondary_color ------------------------ */\n\n#ifndef GL_EXT_secondary_color\n#define GL_EXT_secondary_color 1\n\n#define GL_COLOR_SUM_EXT 0x8458\n#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459\n#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A\n#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B\n#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C\n#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D\n#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E\n\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);\n\n#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT)\n#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT)\n#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT)\n#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT)\n#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT)\n#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT)\n#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT)\n#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT)\n#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT)\n#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT)\n#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT)\n#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT)\n#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT)\n#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT)\n#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT)\n#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT)\n#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT)\n\n#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color)\n\n#endif /* GL_EXT_secondary_color */\n\n/* --------------------- GL_EXT_separate_shader_objects -------------------- */\n\n#ifndef GL_EXT_separate_shader_objects\n#define GL_EXT_separate_shader_objects 1\n\n#define GL_ACTIVE_PROGRAM_EXT 0x8B8D\n\ntypedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);\ntypedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const char* string);\ntypedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);\n\n#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT)\n#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT)\n#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT)\n\n#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects)\n\n#endif /* GL_EXT_separate_shader_objects */\n\n/* --------------------- GL_EXT_separate_specular_color -------------------- */\n\n#ifndef GL_EXT_separate_specular_color\n#define GL_EXT_separate_specular_color 1\n\n#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8\n#define GL_SINGLE_COLOR_EXT 0x81F9\n#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA\n\n#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color)\n\n#endif /* GL_EXT_separate_specular_color */\n\n/* --------------------- GL_EXT_shader_image_load_store -------------------- */\n\n#ifndef GL_EXT_shader_image_load_store\n#define GL_EXT_shader_image_load_store 1\n\n#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001\n#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002\n#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004\n#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008\n#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020\n#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040\n#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080\n#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100\n#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200\n#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400\n#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800\n#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000\n#define GL_MAX_IMAGE_UNITS_EXT 0x8F38\n#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39\n#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A\n#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B\n#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C\n#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D\n#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E\n#define GL_IMAGE_1D_EXT 0x904C\n#define GL_IMAGE_2D_EXT 0x904D\n#define GL_IMAGE_3D_EXT 0x904E\n#define GL_IMAGE_2D_RECT_EXT 0x904F\n#define GL_IMAGE_CUBE_EXT 0x9050\n#define GL_IMAGE_BUFFER_EXT 0x9051\n#define GL_IMAGE_1D_ARRAY_EXT 0x9052\n#define GL_IMAGE_2D_ARRAY_EXT 0x9053\n#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054\n#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055\n#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056\n#define GL_INT_IMAGE_1D_EXT 0x9057\n#define GL_INT_IMAGE_2D_EXT 0x9058\n#define GL_INT_IMAGE_3D_EXT 0x9059\n#define GL_INT_IMAGE_2D_RECT_EXT 0x905A\n#define GL_INT_IMAGE_CUBE_EXT 0x905B\n#define GL_INT_IMAGE_BUFFER_EXT 0x905C\n#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D\n#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E\n#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F\n#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060\n#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061\n#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062\n#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063\n#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064\n#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065\n#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066\n#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067\n#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068\n#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069\n#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B\n#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C\n#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D\n#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E\n#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF\n\ntypedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);\ntypedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);\n\n#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT)\n#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT)\n\n#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store)\n\n#endif /* GL_EXT_shader_image_load_store */\n\n/* -------------------------- GL_EXT_shadow_funcs -------------------------- */\n\n#ifndef GL_EXT_shadow_funcs\n#define GL_EXT_shadow_funcs 1\n\n#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs)\n\n#endif /* GL_EXT_shadow_funcs */\n\n/* --------------------- GL_EXT_shared_texture_palette --------------------- */\n\n#ifndef GL_EXT_shared_texture_palette\n#define GL_EXT_shared_texture_palette 1\n\n#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB\n\n#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette)\n\n#endif /* GL_EXT_shared_texture_palette */\n\n/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */\n\n#ifndef GL_EXT_stencil_clear_tag\n#define GL_EXT_stencil_clear_tag 1\n\n#define GL_STENCIL_TAG_BITS_EXT 0x88F2\n#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3\n\n#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag)\n\n#endif /* GL_EXT_stencil_clear_tag */\n\n/* ------------------------ GL_EXT_stencil_two_side ------------------------ */\n\n#ifndef GL_EXT_stencil_two_side\n#define GL_EXT_stencil_two_side 1\n\n#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910\n#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911\n\ntypedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);\n\n#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT)\n\n#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side)\n\n#endif /* GL_EXT_stencil_two_side */\n\n/* -------------------------- GL_EXT_stencil_wrap -------------------------- */\n\n#ifndef GL_EXT_stencil_wrap\n#define GL_EXT_stencil_wrap 1\n\n#define GL_INCR_WRAP_EXT 0x8507\n#define GL_DECR_WRAP_EXT 0x8508\n\n#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap)\n\n#endif /* GL_EXT_stencil_wrap */\n\n/* --------------------------- GL_EXT_subtexture --------------------------- */\n\n#ifndef GL_EXT_subtexture\n#define GL_EXT_subtexture 1\n\ntypedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);\n\n#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT)\n#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT)\n#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT)\n\n#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture)\n\n#endif /* GL_EXT_subtexture */\n\n/* ----------------------------- GL_EXT_texture ---------------------------- */\n\n#ifndef GL_EXT_texture\n#define GL_EXT_texture 1\n\n#define GL_ALPHA4_EXT 0x803B\n#define GL_ALPHA8_EXT 0x803C\n#define GL_ALPHA12_EXT 0x803D\n#define GL_ALPHA16_EXT 0x803E\n#define GL_LUMINANCE4_EXT 0x803F\n#define GL_LUMINANCE8_EXT 0x8040\n#define GL_LUMINANCE12_EXT 0x8041\n#define GL_LUMINANCE16_EXT 0x8042\n#define GL_LUMINANCE4_ALPHA4_EXT 0x8043\n#define GL_LUMINANCE6_ALPHA2_EXT 0x8044\n#define GL_LUMINANCE8_ALPHA8_EXT 0x8045\n#define GL_LUMINANCE12_ALPHA4_EXT 0x8046\n#define GL_LUMINANCE12_ALPHA12_EXT 0x8047\n#define GL_LUMINANCE16_ALPHA16_EXT 0x8048\n#define GL_INTENSITY_EXT 0x8049\n#define GL_INTENSITY4_EXT 0x804A\n#define GL_INTENSITY8_EXT 0x804B\n#define GL_INTENSITY12_EXT 0x804C\n#define GL_INTENSITY16_EXT 0x804D\n#define GL_RGB2_EXT 0x804E\n#define GL_RGB4_EXT 0x804F\n#define GL_RGB5_EXT 0x8050\n#define GL_RGB8_EXT 0x8051\n#define GL_RGB10_EXT 0x8052\n#define GL_RGB12_EXT 0x8053\n#define GL_RGB16_EXT 0x8054\n#define GL_RGBA2_EXT 0x8055\n#define GL_RGBA4_EXT 0x8056\n#define GL_RGB5_A1_EXT 0x8057\n#define GL_RGBA8_EXT 0x8058\n#define GL_RGB10_A2_EXT 0x8059\n#define GL_RGBA12_EXT 0x805A\n#define GL_RGBA16_EXT 0x805B\n#define GL_TEXTURE_RED_SIZE_EXT 0x805C\n#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D\n#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E\n#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F\n#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060\n#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061\n#define GL_REPLACE_EXT 0x8062\n#define GL_PROXY_TEXTURE_1D_EXT 0x8063\n#define GL_PROXY_TEXTURE_2D_EXT 0x8064\n\n#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture)\n\n#endif /* GL_EXT_texture */\n\n/* ---------------------------- GL_EXT_texture3D --------------------------- */\n\n#ifndef GL_EXT_texture3D\n#define GL_EXT_texture3D 1\n\n#define GL_PACK_SKIP_IMAGES_EXT 0x806B\n#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C\n#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D\n#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E\n#define GL_TEXTURE_3D_EXT 0x806F\n#define GL_PROXY_TEXTURE_3D_EXT 0x8070\n#define GL_TEXTURE_DEPTH_EXT 0x8071\n#define GL_TEXTURE_WRAP_R_EXT 0x8072\n#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073\n\ntypedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);\n\n#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT)\n\n#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D)\n\n#endif /* GL_EXT_texture3D */\n\n/* -------------------------- GL_EXT_texture_array ------------------------- */\n\n#ifndef GL_EXT_texture_array\n#define GL_EXT_texture_array 1\n\n#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E\n#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF\n#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18\n#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19\n#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A\n#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B\n#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C\n#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D\n\ntypedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);\n\n#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT)\n\n#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array)\n\n#endif /* GL_EXT_texture_array */\n\n/* ---------------------- GL_EXT_texture_buffer_object --------------------- */\n\n#ifndef GL_EXT_texture_buffer_object\n#define GL_EXT_texture_buffer_object 1\n\n#define GL_TEXTURE_BUFFER_EXT 0x8C2A\n#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B\n#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C\n#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D\n#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E\n\ntypedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);\n\n#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT)\n\n#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object)\n\n#endif /* GL_EXT_texture_buffer_object */\n\n/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */\n\n#ifndef GL_EXT_texture_compression_dxt1\n#define GL_EXT_texture_compression_dxt1 1\n\n#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0\n#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1\n\n#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1)\n\n#endif /* GL_EXT_texture_compression_dxt1 */\n\n/* -------------------- GL_EXT_texture_compression_latc -------------------- */\n\n#ifndef GL_EXT_texture_compression_latc\n#define GL_EXT_texture_compression_latc 1\n\n#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70\n#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71\n#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72\n#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73\n\n#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc)\n\n#endif /* GL_EXT_texture_compression_latc */\n\n/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */\n\n#ifndef GL_EXT_texture_compression_rgtc\n#define GL_EXT_texture_compression_rgtc 1\n\n#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB\n#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC\n#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD\n#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE\n\n#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc)\n\n#endif /* GL_EXT_texture_compression_rgtc */\n\n/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */\n\n#ifndef GL_EXT_texture_compression_s3tc\n#define GL_EXT_texture_compression_s3tc 1\n\n#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0\n#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1\n#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2\n#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3\n\n#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc)\n\n#endif /* GL_EXT_texture_compression_s3tc */\n\n/* ------------------------ GL_EXT_texture_cube_map ------------------------ */\n\n#ifndef GL_EXT_texture_cube_map\n#define GL_EXT_texture_cube_map 1\n\n#define GL_NORMAL_MAP_EXT 0x8511\n#define GL_REFLECTION_MAP_EXT 0x8512\n#define GL_TEXTURE_CUBE_MAP_EXT 0x8513\n#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518\n#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519\n#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A\n#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B\n#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C\n\n#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map)\n\n#endif /* GL_EXT_texture_cube_map */\n\n/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */\n\n#ifndef GL_EXT_texture_edge_clamp\n#define GL_EXT_texture_edge_clamp 1\n\n#define GL_CLAMP_TO_EDGE_EXT 0x812F\n\n#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp)\n\n#endif /* GL_EXT_texture_edge_clamp */\n\n/* --------------------------- GL_EXT_texture_env -------------------------- */\n\n#ifndef GL_EXT_texture_env\n#define GL_EXT_texture_env 1\n\n#define GL_TEXTURE_ENV0_EXT 0\n#define GL_ENV_BLEND_EXT 0\n#define GL_TEXTURE_ENV_SHIFT_EXT 0\n#define GL_ENV_REPLACE_EXT 0\n#define GL_ENV_ADD_EXT 0\n#define GL_ENV_SUBTRACT_EXT 0\n#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0\n#define GL_ENV_REVERSE_SUBTRACT_EXT 0\n#define GL_ENV_REVERSE_BLEND_EXT 0\n#define GL_ENV_COPY_EXT 0\n#define GL_ENV_MODULATE_EXT 0\n\n#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env)\n\n#endif /* GL_EXT_texture_env */\n\n/* ------------------------- GL_EXT_texture_env_add ------------------------ */\n\n#ifndef GL_EXT_texture_env_add\n#define GL_EXT_texture_env_add 1\n\n#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add)\n\n#endif /* GL_EXT_texture_env_add */\n\n/* ----------------------- GL_EXT_texture_env_combine ---------------------- */\n\n#ifndef GL_EXT_texture_env_combine\n#define GL_EXT_texture_env_combine 1\n\n#define GL_COMBINE_EXT 0x8570\n#define GL_COMBINE_RGB_EXT 0x8571\n#define GL_COMBINE_ALPHA_EXT 0x8572\n#define GL_RGB_SCALE_EXT 0x8573\n#define GL_ADD_SIGNED_EXT 0x8574\n#define GL_INTERPOLATE_EXT 0x8575\n#define GL_CONSTANT_EXT 0x8576\n#define GL_PRIMARY_COLOR_EXT 0x8577\n#define GL_PREVIOUS_EXT 0x8578\n#define GL_SOURCE0_RGB_EXT 0x8580\n#define GL_SOURCE1_RGB_EXT 0x8581\n#define GL_SOURCE2_RGB_EXT 0x8582\n#define GL_SOURCE0_ALPHA_EXT 0x8588\n#define GL_SOURCE1_ALPHA_EXT 0x8589\n#define GL_SOURCE2_ALPHA_EXT 0x858A\n#define GL_OPERAND0_RGB_EXT 0x8590\n#define GL_OPERAND1_RGB_EXT 0x8591\n#define GL_OPERAND2_RGB_EXT 0x8592\n#define GL_OPERAND0_ALPHA_EXT 0x8598\n#define GL_OPERAND1_ALPHA_EXT 0x8599\n#define GL_OPERAND2_ALPHA_EXT 0x859A\n\n#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine)\n\n#endif /* GL_EXT_texture_env_combine */\n\n/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */\n\n#ifndef GL_EXT_texture_env_dot3\n#define GL_EXT_texture_env_dot3 1\n\n#define GL_DOT3_RGB_EXT 0x8740\n#define GL_DOT3_RGBA_EXT 0x8741\n\n#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3)\n\n#endif /* GL_EXT_texture_env_dot3 */\n\n/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */\n\n#ifndef GL_EXT_texture_filter_anisotropic\n#define GL_EXT_texture_filter_anisotropic 1\n\n#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE\n#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF\n\n#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic)\n\n#endif /* GL_EXT_texture_filter_anisotropic */\n\n/* ------------------------- GL_EXT_texture_integer ------------------------ */\n\n#ifndef GL_EXT_texture_integer\n#define GL_EXT_texture_integer 1\n\n#define GL_RGBA32UI_EXT 0x8D70\n#define GL_RGB32UI_EXT 0x8D71\n#define GL_ALPHA32UI_EXT 0x8D72\n#define GL_INTENSITY32UI_EXT 0x8D73\n#define GL_LUMINANCE32UI_EXT 0x8D74\n#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75\n#define GL_RGBA16UI_EXT 0x8D76\n#define GL_RGB16UI_EXT 0x8D77\n#define GL_ALPHA16UI_EXT 0x8D78\n#define GL_INTENSITY16UI_EXT 0x8D79\n#define GL_LUMINANCE16UI_EXT 0x8D7A\n#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B\n#define GL_RGBA8UI_EXT 0x8D7C\n#define GL_RGB8UI_EXT 0x8D7D\n#define GL_ALPHA8UI_EXT 0x8D7E\n#define GL_INTENSITY8UI_EXT 0x8D7F\n#define GL_LUMINANCE8UI_EXT 0x8D80\n#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81\n#define GL_RGBA32I_EXT 0x8D82\n#define GL_RGB32I_EXT 0x8D83\n#define GL_ALPHA32I_EXT 0x8D84\n#define GL_INTENSITY32I_EXT 0x8D85\n#define GL_LUMINANCE32I_EXT 0x8D86\n#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87\n#define GL_RGBA16I_EXT 0x8D88\n#define GL_RGB16I_EXT 0x8D89\n#define GL_ALPHA16I_EXT 0x8D8A\n#define GL_INTENSITY16I_EXT 0x8D8B\n#define GL_LUMINANCE16I_EXT 0x8D8C\n#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D\n#define GL_RGBA8I_EXT 0x8D8E\n#define GL_RGB8I_EXT 0x8D8F\n#define GL_ALPHA8I_EXT 0x8D90\n#define GL_INTENSITY8I_EXT 0x8D91\n#define GL_LUMINANCE8I_EXT 0x8D92\n#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93\n#define GL_RED_INTEGER_EXT 0x8D94\n#define GL_GREEN_INTEGER_EXT 0x8D95\n#define GL_BLUE_INTEGER_EXT 0x8D96\n#define GL_ALPHA_INTEGER_EXT 0x8D97\n#define GL_RGB_INTEGER_EXT 0x8D98\n#define GL_RGBA_INTEGER_EXT 0x8D99\n#define GL_BGR_INTEGER_EXT 0x8D9A\n#define GL_BGRA_INTEGER_EXT 0x8D9B\n#define GL_LUMINANCE_INTEGER_EXT 0x8D9C\n#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D\n#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E\n\ntypedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);\ntypedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);\ntypedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);\ntypedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);\ntypedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);\n\n#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT)\n#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT)\n#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT)\n#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT)\n#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT)\n#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT)\n\n#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer)\n\n#endif /* GL_EXT_texture_integer */\n\n/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */\n\n#ifndef GL_EXT_texture_lod_bias\n#define GL_EXT_texture_lod_bias 1\n\n#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD\n#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500\n#define GL_TEXTURE_LOD_BIAS_EXT 0x8501\n\n#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias)\n\n#endif /* GL_EXT_texture_lod_bias */\n\n/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */\n\n#ifndef GL_EXT_texture_mirror_clamp\n#define GL_EXT_texture_mirror_clamp 1\n\n#define GL_MIRROR_CLAMP_EXT 0x8742\n#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743\n#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912\n\n#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp)\n\n#endif /* GL_EXT_texture_mirror_clamp */\n\n/* ------------------------- GL_EXT_texture_object ------------------------- */\n\n#ifndef GL_EXT_texture_object\n#define GL_EXT_texture_object 1\n\n#define GL_TEXTURE_PRIORITY_EXT 0x8066\n#define GL_TEXTURE_RESIDENT_EXT 0x8067\n#define GL_TEXTURE_1D_BINDING_EXT 0x8068\n#define GL_TEXTURE_2D_BINDING_EXT 0x8069\n#define GL_TEXTURE_3D_BINDING_EXT 0x806A\n\ntypedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences);\ntypedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);\ntypedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures);\ntypedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures);\ntypedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture);\ntypedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities);\n\n#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT)\n#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT)\n#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT)\n#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT)\n#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT)\n#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT)\n\n#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object)\n\n#endif /* GL_EXT_texture_object */\n\n/* --------------------- GL_EXT_texture_perturb_normal --------------------- */\n\n#ifndef GL_EXT_texture_perturb_normal\n#define GL_EXT_texture_perturb_normal 1\n\n#define GL_PERTURB_EXT 0x85AE\n#define GL_TEXTURE_NORMAL_EXT 0x85AF\n\ntypedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode);\n\n#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT)\n\n#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal)\n\n#endif /* GL_EXT_texture_perturb_normal */\n\n/* ------------------------ GL_EXT_texture_rectangle ----------------------- */\n\n#ifndef GL_EXT_texture_rectangle\n#define GL_EXT_texture_rectangle 1\n\n#define GL_TEXTURE_RECTANGLE_EXT 0x84F5\n#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6\n#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7\n#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8\n\n#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle)\n\n#endif /* GL_EXT_texture_rectangle */\n\n/* -------------------------- GL_EXT_texture_sRGB -------------------------- */\n\n#ifndef GL_EXT_texture_sRGB\n#define GL_EXT_texture_sRGB 1\n\n#define GL_SRGB_EXT 0x8C40\n#define GL_SRGB8_EXT 0x8C41\n#define GL_SRGB_ALPHA_EXT 0x8C42\n#define GL_SRGB8_ALPHA8_EXT 0x8C43\n#define GL_SLUMINANCE_ALPHA_EXT 0x8C44\n#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45\n#define GL_SLUMINANCE_EXT 0x8C46\n#define GL_SLUMINANCE8_EXT 0x8C47\n#define GL_COMPRESSED_SRGB_EXT 0x8C48\n#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49\n#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A\n#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B\n#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C\n#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D\n#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E\n#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F\n\n#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB)\n\n#endif /* GL_EXT_texture_sRGB */\n\n/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */\n\n#ifndef GL_EXT_texture_sRGB_decode\n#define GL_EXT_texture_sRGB_decode 1\n\n#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48\n#define GL_DECODE_EXT 0x8A49\n#define GL_SKIP_DECODE_EXT 0x8A4A\n\n#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode)\n\n#endif /* GL_EXT_texture_sRGB_decode */\n\n/* --------------------- GL_EXT_texture_shared_exponent -------------------- */\n\n#ifndef GL_EXT_texture_shared_exponent\n#define GL_EXT_texture_shared_exponent 1\n\n#define GL_RGB9_E5_EXT 0x8C3D\n#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E\n#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F\n\n#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent)\n\n#endif /* GL_EXT_texture_shared_exponent */\n\n/* -------------------------- GL_EXT_texture_snorm ------------------------- */\n\n#ifndef GL_EXT_texture_snorm\n#define GL_EXT_texture_snorm 1\n\n#define GL_RED_SNORM 0x8F90\n#define GL_RG_SNORM 0x8F91\n#define GL_RGB_SNORM 0x8F92\n#define GL_RGBA_SNORM 0x8F93\n#define GL_R8_SNORM 0x8F94\n#define GL_RG8_SNORM 0x8F95\n#define GL_RGB8_SNORM 0x8F96\n#define GL_RGBA8_SNORM 0x8F97\n#define GL_R16_SNORM 0x8F98\n#define GL_RG16_SNORM 0x8F99\n#define GL_RGB16_SNORM 0x8F9A\n#define GL_RGBA16_SNORM 0x8F9B\n#define GL_SIGNED_NORMALIZED 0x8F9C\n#define GL_ALPHA_SNORM 0x9010\n#define GL_LUMINANCE_SNORM 0x9011\n#define GL_LUMINANCE_ALPHA_SNORM 0x9012\n#define GL_INTENSITY_SNORM 0x9013\n#define GL_ALPHA8_SNORM 0x9014\n#define GL_LUMINANCE8_SNORM 0x9015\n#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016\n#define GL_INTENSITY8_SNORM 0x9017\n#define GL_ALPHA16_SNORM 0x9018\n#define GL_LUMINANCE16_SNORM 0x9019\n#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A\n#define GL_INTENSITY16_SNORM 0x901B\n\n#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm)\n\n#endif /* GL_EXT_texture_snorm */\n\n/* ------------------------- GL_EXT_texture_swizzle ------------------------ */\n\n#ifndef GL_EXT_texture_swizzle\n#define GL_EXT_texture_swizzle 1\n\n#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42\n#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43\n#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44\n#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45\n#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46\n\n#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle)\n\n#endif /* GL_EXT_texture_swizzle */\n\n/* --------------------------- GL_EXT_timer_query -------------------------- */\n\n#ifndef GL_EXT_timer_query\n#define GL_EXT_timer_query 1\n\n#define GL_TIME_ELAPSED_EXT 0x88BF\n\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);\ntypedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);\n\n#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT)\n#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT)\n\n#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query)\n\n#endif /* GL_EXT_timer_query */\n\n/* ----------------------- GL_EXT_transform_feedback ----------------------- */\n\n#ifndef GL_EXT_transform_feedback\n#define GL_EXT_transform_feedback 1\n\n#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76\n#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80\n#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83\n#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84\n#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85\n#define GL_PRIMITIVES_GENERATED_EXT 0x8C87\n#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88\n#define GL_RASTERIZER_DISCARD_EXT 0x8C89\n#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B\n#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C\n#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D\n#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F\n\ntypedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, char *name);\ntypedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode);\n\n#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT)\n#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT)\n#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT)\n#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT)\n#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT)\n#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT)\n#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT)\n\n#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback)\n\n#endif /* GL_EXT_transform_feedback */\n\n/* -------------------------- GL_EXT_vertex_array -------------------------- */\n\n#ifndef GL_EXT_vertex_array\n#define GL_EXT_vertex_array 1\n\n#define GL_DOUBLE_EXT 0x140A\n#define GL_VERTEX_ARRAY_EXT 0x8074\n#define GL_NORMAL_ARRAY_EXT 0x8075\n#define GL_COLOR_ARRAY_EXT 0x8076\n#define GL_INDEX_ARRAY_EXT 0x8077\n#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078\n#define GL_EDGE_FLAG_ARRAY_EXT 0x8079\n#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A\n#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B\n#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C\n#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D\n#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E\n#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F\n#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080\n#define GL_COLOR_ARRAY_SIZE_EXT 0x8081\n#define GL_COLOR_ARRAY_TYPE_EXT 0x8082\n#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083\n#define GL_COLOR_ARRAY_COUNT_EXT 0x8084\n#define GL_INDEX_ARRAY_TYPE_EXT 0x8085\n#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086\n#define GL_INDEX_ARRAY_COUNT_EXT 0x8087\n#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088\n#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089\n#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A\n#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B\n#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C\n#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D\n#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E\n#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F\n#define GL_COLOR_ARRAY_POINTER_EXT 0x8090\n#define GL_INDEX_ARRAY_POINTER_EXT 0x8091\n#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092\n#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093\n\ntypedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i);\ntypedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);\ntypedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer);\ntypedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer);\n\n#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT)\n#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT)\n#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT)\n#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT)\n#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT)\n#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT)\n#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT)\n#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT)\n\n#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array)\n\n#endif /* GL_EXT_vertex_array */\n\n/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */\n\n#ifndef GL_EXT_vertex_array_bgra\n#define GL_EXT_vertex_array_bgra 1\n\n#define GL_BGRA 0x80E1\n\n#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra)\n\n#endif /* GL_EXT_vertex_array_bgra */\n\n/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */\n\n#ifndef GL_EXT_vertex_attrib_64bit\n#define GL_EXT_vertex_attrib_64bit 1\n\n#define GL_DOUBLE_MAT2_EXT 0x8F46\n#define GL_DOUBLE_MAT3_EXT 0x8F47\n#define GL_DOUBLE_MAT4_EXT 0x8F48\n#define GL_DOUBLE_MAT2x3_EXT 0x8F49\n#define GL_DOUBLE_MAT2x4_EXT 0x8F4A\n#define GL_DOUBLE_MAT3x2_EXT 0x8F4B\n#define GL_DOUBLE_MAT3x4_EXT 0x8F4C\n#define GL_DOUBLE_MAT4x2_EXT 0x8F4D\n#define GL_DOUBLE_MAT4x3_EXT 0x8F4E\n#define GL_DOUBLE_VEC2_EXT 0x8FFC\n#define GL_DOUBLE_VEC3_EXT 0x8FFD\n#define GL_DOUBLE_VEC4_EXT 0x8FFE\n\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);\n\n#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT)\n#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT)\n#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT)\n#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT)\n#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT)\n#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT)\n#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT)\n#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT)\n#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT)\n#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT)\n#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT)\n\n#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit)\n\n#endif /* GL_EXT_vertex_attrib_64bit */\n\n/* -------------------------- GL_EXT_vertex_shader ------------------------- */\n\n#ifndef GL_EXT_vertex_shader\n#define GL_EXT_vertex_shader 1\n\n#define GL_VERTEX_SHADER_EXT 0x8780\n#define GL_VERTEX_SHADER_BINDING_EXT 0x8781\n#define GL_OP_INDEX_EXT 0x8782\n#define GL_OP_NEGATE_EXT 0x8783\n#define GL_OP_DOT3_EXT 0x8784\n#define GL_OP_DOT4_EXT 0x8785\n#define GL_OP_MUL_EXT 0x8786\n#define GL_OP_ADD_EXT 0x8787\n#define GL_OP_MADD_EXT 0x8788\n#define GL_OP_FRAC_EXT 0x8789\n#define GL_OP_MAX_EXT 0x878A\n#define GL_OP_MIN_EXT 0x878B\n#define GL_OP_SET_GE_EXT 0x878C\n#define GL_OP_SET_LT_EXT 0x878D\n#define GL_OP_CLAMP_EXT 0x878E\n#define GL_OP_FLOOR_EXT 0x878F\n#define GL_OP_ROUND_EXT 0x8790\n#define GL_OP_EXP_BASE_2_EXT 0x8791\n#define GL_OP_LOG_BASE_2_EXT 0x8792\n#define GL_OP_POWER_EXT 0x8793\n#define GL_OP_RECIP_EXT 0x8794\n#define GL_OP_RECIP_SQRT_EXT 0x8795\n#define GL_OP_SUB_EXT 0x8796\n#define GL_OP_CROSS_PRODUCT_EXT 0x8797\n#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798\n#define GL_OP_MOV_EXT 0x8799\n#define GL_OUTPUT_VERTEX_EXT 0x879A\n#define GL_OUTPUT_COLOR0_EXT 0x879B\n#define GL_OUTPUT_COLOR1_EXT 0x879C\n#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D\n#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E\n#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F\n#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0\n#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1\n#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2\n#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3\n#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4\n#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5\n#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6\n#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7\n#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8\n#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9\n#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA\n#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB\n#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC\n#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD\n#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE\n#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF\n#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0\n#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1\n#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2\n#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3\n#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4\n#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5\n#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6\n#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7\n#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8\n#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9\n#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA\n#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB\n#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC\n#define GL_OUTPUT_FOG_EXT 0x87BD\n#define GL_SCALAR_EXT 0x87BE\n#define GL_VECTOR_EXT 0x87BF\n#define GL_MATRIX_EXT 0x87C0\n#define GL_VARIANT_EXT 0x87C1\n#define GL_INVARIANT_EXT 0x87C2\n#define GL_LOCAL_CONSTANT_EXT 0x87C3\n#define GL_LOCAL_EXT 0x87C4\n#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5\n#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6\n#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7\n#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8\n#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD\n#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE\n#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF\n#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0\n#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1\n#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2\n#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3\n#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4\n#define GL_X_EXT 0x87D5\n#define GL_Y_EXT 0x87D6\n#define GL_Z_EXT 0x87D7\n#define GL_W_EXT 0x87D8\n#define GL_NEGATIVE_X_EXT 0x87D9\n#define GL_NEGATIVE_Y_EXT 0x87DA\n#define GL_NEGATIVE_Z_EXT 0x87DB\n#define GL_NEGATIVE_W_EXT 0x87DC\n#define GL_ZERO_EXT 0x87DD\n#define GL_ONE_EXT 0x87DE\n#define GL_NEGATIVE_ONE_EXT 0x87DF\n#define GL_NORMALIZED_RANGE_EXT 0x87E0\n#define GL_FULL_RANGE_EXT 0x87E1\n#define GL_CURRENT_VERTEX_EXT 0x87E2\n#define GL_MVP_MATRIX_EXT 0x87E3\n#define GL_VARIANT_VALUE_EXT 0x87E4\n#define GL_VARIANT_DATATYPE_EXT 0x87E5\n#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6\n#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7\n#define GL_VARIANT_ARRAY_EXT 0x87E8\n#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9\n#define GL_INVARIANT_VALUE_EXT 0x87EA\n#define GL_INVARIANT_DATATYPE_EXT 0x87EB\n#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC\n#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED\n\ntypedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void);\ntypedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);\ntypedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);\ntypedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value);\ntypedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);\ntypedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);\ntypedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);\ntypedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components);\ntypedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);\ntypedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);\ntypedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);\ntypedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);\ntypedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);\ntypedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);\ntypedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);\ntypedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);\ntypedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);\ntypedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);\ntypedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data);\ntypedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);\ntypedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);\ntypedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr);\ntypedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr);\ntypedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);\ntypedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);\ntypedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);\ntypedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);\ntypedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr);\ntypedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr);\ntypedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);\n\n#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT)\n#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT)\n#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT)\n#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT)\n#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT)\n#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT)\n#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT)\n#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT)\n#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT)\n#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT)\n#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT)\n#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT)\n#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT)\n#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT)\n#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT)\n#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT)\n#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT)\n#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT)\n#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT)\n#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT)\n#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT)\n#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT)\n#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT)\n#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT)\n#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT)\n#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT)\n#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT)\n#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT)\n#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT)\n#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT)\n#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT)\n#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT)\n#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT)\n#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT)\n#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT)\n#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT)\n#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT)\n#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT)\n#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT)\n#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT)\n#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT)\n#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT)\n\n#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader)\n\n#endif /* GL_EXT_vertex_shader */\n\n/* ------------------------ GL_EXT_vertex_weighting ------------------------ */\n\n#ifndef GL_EXT_vertex_weighting\n#define GL_EXT_vertex_weighting 1\n\n#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3\n#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6\n#define GL_MODELVIEW0_EXT 0x1700\n#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502\n#define GL_MODELVIEW1_MATRIX_EXT 0x8506\n#define GL_VERTEX_WEIGHTING_EXT 0x8509\n#define GL_MODELVIEW1_EXT 0x850A\n#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B\n#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C\n#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D\n#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E\n#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F\n#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510\n\ntypedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer);\ntypedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);\ntypedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight);\n\n#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT)\n#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT)\n#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT)\n\n#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting)\n\n#endif /* GL_EXT_vertex_weighting */\n\n/* ------------------------- GL_EXT_x11_sync_object ------------------------ */\n\n#ifndef GL_EXT_x11_sync_object\n#define GL_EXT_x11_sync_object 1\n\n#define GL_SYNC_X11_FENCE_EXT 0x90E1\n\ntypedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);\n\n#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT)\n\n#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object)\n\n#endif /* GL_EXT_x11_sync_object */\n\n/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */\n\n#ifndef GL_GREMEDY_frame_terminator\n#define GL_GREMEDY_frame_terminator 1\n\ntypedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void);\n\n#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY)\n\n#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator)\n\n#endif /* GL_GREMEDY_frame_terminator */\n\n/* ------------------------ GL_GREMEDY_string_marker ----------------------- */\n\n#ifndef GL_GREMEDY_string_marker\n#define GL_GREMEDY_string_marker 1\n\ntypedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string);\n\n#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY)\n\n#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker)\n\n#endif /* GL_GREMEDY_string_marker */\n\n/* --------------------- GL_HP_convolution_border_modes -------------------- */\n\n#ifndef GL_HP_convolution_border_modes\n#define GL_HP_convolution_border_modes 1\n\n#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes)\n\n#endif /* GL_HP_convolution_border_modes */\n\n/* ------------------------- GL_HP_image_transform ------------------------- */\n\n#ifndef GL_HP_image_transform\n#define GL_HP_image_transform 1\n\ntypedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param);\ntypedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params);\n\n#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP)\n#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP)\n#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP)\n#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP)\n#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP)\n#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP)\n\n#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform)\n\n#endif /* GL_HP_image_transform */\n\n/* -------------------------- GL_HP_occlusion_test ------------------------- */\n\n#ifndef GL_HP_occlusion_test\n#define GL_HP_occlusion_test 1\n\n#define GL_OCCLUSION_TEST_HP 0x8165\n#define GL_OCCLUSION_TEST_RESULT_HP 0x8166\n\n#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test)\n\n#endif /* GL_HP_occlusion_test */\n\n/* ------------------------- GL_HP_texture_lighting ------------------------ */\n\n#ifndef GL_HP_texture_lighting\n#define GL_HP_texture_lighting 1\n\n#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting)\n\n#endif /* GL_HP_texture_lighting */\n\n/* --------------------------- GL_IBM_cull_vertex -------------------------- */\n\n#ifndef GL_IBM_cull_vertex\n#define GL_IBM_cull_vertex 1\n\n#define GL_CULL_VERTEX_IBM 103050\n\n#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex)\n\n#endif /* GL_IBM_cull_vertex */\n\n/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */\n\n#ifndef GL_IBM_multimode_draw_arrays\n#define GL_IBM_multimode_draw_arrays 1\n\ntypedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);\ntypedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride);\n\n#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM)\n#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM)\n\n#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays)\n\n#endif /* GL_IBM_multimode_draw_arrays */\n\n/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */\n\n#ifndef GL_IBM_rasterpos_clip\n#define GL_IBM_rasterpos_clip 1\n\n#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010\n\n#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip)\n\n#endif /* GL_IBM_rasterpos_clip */\n\n/* --------------------------- GL_IBM_static_data -------------------------- */\n\n#ifndef GL_IBM_static_data\n#define GL_IBM_static_data 1\n\n#define GL_ALL_STATIC_DATA_IBM 103060\n#define GL_STATIC_VERTEX_ARRAY_IBM 103061\n\n#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data)\n\n#endif /* GL_IBM_static_data */\n\n/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */\n\n#ifndef GL_IBM_texture_mirrored_repeat\n#define GL_IBM_texture_mirrored_repeat 1\n\n#define GL_MIRRORED_REPEAT_IBM 0x8370\n\n#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat)\n\n#endif /* GL_IBM_texture_mirrored_repeat */\n\n/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */\n\n#ifndef GL_IBM_vertex_array_lists\n#define GL_IBM_vertex_array_lists 1\n\n#define GL_VERTEX_ARRAY_LIST_IBM 103070\n#define GL_NORMAL_ARRAY_LIST_IBM 103071\n#define GL_COLOR_ARRAY_LIST_IBM 103072\n#define GL_INDEX_ARRAY_LIST_IBM 103073\n#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074\n#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075\n#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076\n#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077\n#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080\n#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081\n#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082\n#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083\n#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084\n#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085\n#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086\n#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087\n\ntypedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);\ntypedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);\ntypedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);\ntypedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);\ntypedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);\n\n#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM)\n#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM)\n#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM)\n#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM)\n#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM)\n#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM)\n#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM)\n#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM)\n\n#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists)\n\n#endif /* GL_IBM_vertex_array_lists */\n\n/* -------------------------- GL_INGR_color_clamp -------------------------- */\n\n#ifndef GL_INGR_color_clamp\n#define GL_INGR_color_clamp 1\n\n#define GL_RED_MIN_CLAMP_INGR 0x8560\n#define GL_GREEN_MIN_CLAMP_INGR 0x8561\n#define GL_BLUE_MIN_CLAMP_INGR 0x8562\n#define GL_ALPHA_MIN_CLAMP_INGR 0x8563\n#define GL_RED_MAX_CLAMP_INGR 0x8564\n#define GL_GREEN_MAX_CLAMP_INGR 0x8565\n#define GL_BLUE_MAX_CLAMP_INGR 0x8566\n#define GL_ALPHA_MAX_CLAMP_INGR 0x8567\n\n#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp)\n\n#endif /* GL_INGR_color_clamp */\n\n/* ------------------------- GL_INGR_interlace_read ------------------------ */\n\n#ifndef GL_INGR_interlace_read\n#define GL_INGR_interlace_read 1\n\n#define GL_INTERLACE_READ_INGR 0x8568\n\n#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read)\n\n#endif /* GL_INGR_interlace_read */\n\n/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */\n\n#ifndef GL_INTEL_parallel_arrays\n#define GL_INTEL_parallel_arrays 1\n\n#define GL_PARALLEL_ARRAYS_INTEL 0x83F4\n#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5\n#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6\n#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7\n#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8\n\ntypedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);\ntypedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);\ntypedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);\n\n#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL)\n#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL)\n#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL)\n#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL)\n\n#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays)\n\n#endif /* GL_INTEL_parallel_arrays */\n\n/* ------------------------ GL_INTEL_texture_scissor ----------------------- */\n\n#ifndef GL_INTEL_texture_scissor\n#define GL_INTEL_texture_scissor 1\n\ntypedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc);\ntypedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh);\n\n#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL)\n#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL)\n\n#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor)\n\n#endif /* GL_INTEL_texture_scissor */\n\n/* -------------------------- GL_KTX_buffer_region ------------------------- */\n\n#ifndef GL_KTX_buffer_region\n#define GL_KTX_buffer_region 1\n\n#define GL_KTX_FRONT_REGION 0x0\n#define GL_KTX_BACK_REGION 0x1\n#define GL_KTX_Z_REGION 0x2\n#define GL_KTX_STENCIL_REGION 0x3\n\ntypedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region);\ntypedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest);\ntypedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region);\ntypedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height);\n\n#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled)\n#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion)\n#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion)\n#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion)\n#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion)\n\n#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region)\n\n#endif /* GL_KTX_buffer_region */\n\n/* ------------------------- GL_MESAX_texture_stack ------------------------ */\n\n#ifndef GL_MESAX_texture_stack\n#define GL_MESAX_texture_stack 1\n\n#define GL_TEXTURE_1D_STACK_MESAX 0x8759\n#define GL_TEXTURE_2D_STACK_MESAX 0x875A\n#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B\n#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C\n#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D\n#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E\n\n#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack)\n\n#endif /* GL_MESAX_texture_stack */\n\n/* -------------------------- GL_MESA_pack_invert -------------------------- */\n\n#ifndef GL_MESA_pack_invert\n#define GL_MESA_pack_invert 1\n\n#define GL_PACK_INVERT_MESA 0x8758\n\n#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert)\n\n#endif /* GL_MESA_pack_invert */\n\n/* ------------------------- GL_MESA_resize_buffers ------------------------ */\n\n#ifndef GL_MESA_resize_buffers\n#define GL_MESA_resize_buffers 1\n\ntypedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void);\n\n#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA)\n\n#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers)\n\n#endif /* GL_MESA_resize_buffers */\n\n/* --------------------------- GL_MESA_window_pos -------------------------- */\n\n#ifndef GL_MESA_window_pos\n#define GL_MESA_window_pos 1\n\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p);\n\n#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA)\n#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA)\n#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA)\n#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA)\n#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA)\n#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA)\n#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA)\n#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA)\n#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA)\n#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA)\n#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA)\n#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA)\n#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA)\n#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA)\n#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA)\n#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA)\n#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA)\n#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA)\n#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA)\n#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA)\n#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA)\n#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA)\n#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA)\n#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA)\n\n#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos)\n\n#endif /* GL_MESA_window_pos */\n\n/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */\n\n#ifndef GL_MESA_ycbcr_texture\n#define GL_MESA_ycbcr_texture 1\n\n#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA\n#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB\n#define GL_YCBCR_MESA 0x8757\n\n#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture)\n\n#endif /* GL_MESA_ycbcr_texture */\n\n/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */\n\n#ifndef GL_NVX_gpu_memory_info\n#define GL_NVX_gpu_memory_info 1\n\n#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047\n#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048\n#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049\n#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A\n#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B\n\n#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info)\n\n#endif /* GL_NVX_gpu_memory_info */\n\n/* --------------------------- GL_NV_blend_square -------------------------- */\n\n#ifndef GL_NV_blend_square\n#define GL_NV_blend_square 1\n\n#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square)\n\n#endif /* GL_NV_blend_square */\n\n/* ------------------------ GL_NV_conditional_render ----------------------- */\n\n#ifndef GL_NV_conditional_render\n#define GL_NV_conditional_render 1\n\n#define GL_QUERY_WAIT_NV 0x8E13\n#define GL_QUERY_NO_WAIT_NV 0x8E14\n#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15\n#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16\n\ntypedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void);\n\n#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV)\n#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV)\n\n#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render)\n\n#endif /* GL_NV_conditional_render */\n\n/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */\n\n#ifndef GL_NV_copy_depth_to_color\n#define GL_NV_copy_depth_to_color 1\n\n#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E\n#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F\n\n#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color)\n\n#endif /* GL_NV_copy_depth_to_color */\n\n/* ---------------------------- GL_NV_copy_image --------------------------- */\n\n#ifndef GL_NV_copy_image\n#define GL_NV_copy_image 1\n\ntypedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n\n#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV)\n\n#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image)\n\n#endif /* GL_NV_copy_image */\n\n/* ------------------------ GL_NV_depth_buffer_float ----------------------- */\n\n#ifndef GL_NV_depth_buffer_float\n#define GL_NV_depth_buffer_float 1\n\n#define GL_DEPTH_COMPONENT32F_NV 0x8DAB\n#define GL_DEPTH32F_STENCIL8_NV 0x8DAC\n#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD\n#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF\n\ntypedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);\ntypedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);\ntypedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);\n\n#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV)\n#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV)\n#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV)\n\n#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float)\n\n#endif /* GL_NV_depth_buffer_float */\n\n/* --------------------------- GL_NV_depth_clamp --------------------------- */\n\n#ifndef GL_NV_depth_clamp\n#define GL_NV_depth_clamp 1\n\n#define GL_DEPTH_CLAMP_NV 0x864F\n\n#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp)\n\n#endif /* GL_NV_depth_clamp */\n\n/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */\n\n#ifndef GL_NV_depth_range_unclamped\n#define GL_NV_depth_range_unclamped 1\n\n#define GL_SAMPLE_COUNT_BITS_NV 0x8864\n#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865\n#define GL_QUERY_RESULT_NV 0x8866\n#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867\n#define GL_SAMPLE_COUNT_NV 0x8914\n\n#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped)\n\n#endif /* GL_NV_depth_range_unclamped */\n\n/* ---------------------------- GL_NV_evaluators --------------------------- */\n\n#ifndef GL_NV_evaluators\n#define GL_NV_evaluators 1\n\n#define GL_EVAL_2D_NV 0x86C0\n#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1\n#define GL_MAP_TESSELLATION_NV 0x86C2\n#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3\n#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4\n#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5\n#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6\n#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7\n#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8\n#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9\n#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA\n#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB\n#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC\n#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD\n#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE\n#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF\n#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0\n#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1\n#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2\n#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3\n#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4\n#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5\n#define GL_MAX_MAP_TESSELLATION_NV 0x86D6\n#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7\n\ntypedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points);\ntypedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points);\ntypedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params);\n\n#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV)\n#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV)\n#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV)\n#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV)\n#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV)\n#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV)\n#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV)\n#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV)\n#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV)\n\n#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators)\n\n#endif /* GL_NV_evaluators */\n\n/* ----------------------- GL_NV_explicit_multisample ---------------------- */\n\n#ifndef GL_NV_explicit_multisample\n#define GL_NV_explicit_multisample 1\n\n#define GL_SAMPLE_POSITION_NV 0x8E50\n#define GL_SAMPLE_MASK_NV 0x8E51\n#define GL_SAMPLE_MASK_VALUE_NV 0x8E52\n#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53\n#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54\n#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55\n#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56\n#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57\n#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58\n#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59\n\ntypedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val);\ntypedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);\ntypedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);\n\n#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV)\n#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV)\n#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV)\n\n#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample)\n\n#endif /* GL_NV_explicit_multisample */\n\n/* ------------------------------ GL_NV_fence ------------------------------ */\n\n#ifndef GL_NV_fence\n#define GL_NV_fence 1\n\n#define GL_ALL_COMPLETED_NV 0x84F2\n#define GL_FENCE_STATUS_NV 0x84F3\n#define GL_FENCE_CONDITION_NV 0x84F4\n\ntypedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences);\ntypedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence);\ntypedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences);\ntypedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence);\ntypedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);\ntypedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence);\n\n#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV)\n#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV)\n#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV)\n#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV)\n#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV)\n#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV)\n#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV)\n\n#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence)\n\n#endif /* GL_NV_fence */\n\n/* --------------------------- GL_NV_float_buffer -------------------------- */\n\n#ifndef GL_NV_float_buffer\n#define GL_NV_float_buffer 1\n\n#define GL_FLOAT_R_NV 0x8880\n#define GL_FLOAT_RG_NV 0x8881\n#define GL_FLOAT_RGB_NV 0x8882\n#define GL_FLOAT_RGBA_NV 0x8883\n#define GL_FLOAT_R16_NV 0x8884\n#define GL_FLOAT_R32_NV 0x8885\n#define GL_FLOAT_RG16_NV 0x8886\n#define GL_FLOAT_RG32_NV 0x8887\n#define GL_FLOAT_RGB16_NV 0x8888\n#define GL_FLOAT_RGB32_NV 0x8889\n#define GL_FLOAT_RGBA16_NV 0x888A\n#define GL_FLOAT_RGBA32_NV 0x888B\n#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C\n#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D\n#define GL_FLOAT_RGBA_MODE_NV 0x888E\n\n#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer)\n\n#endif /* GL_NV_float_buffer */\n\n/* --------------------------- GL_NV_fog_distance -------------------------- */\n\n#ifndef GL_NV_fog_distance\n#define GL_NV_fog_distance 1\n\n#define GL_FOG_DISTANCE_MODE_NV 0x855A\n#define GL_EYE_RADIAL_NV 0x855B\n#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C\n\n#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance)\n\n#endif /* GL_NV_fog_distance */\n\n/* ------------------------- GL_NV_fragment_program ------------------------ */\n\n#ifndef GL_NV_fragment_program\n#define GL_NV_fragment_program 1\n\n#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868\n#define GL_FRAGMENT_PROGRAM_NV 0x8870\n#define GL_MAX_TEXTURE_COORDS_NV 0x8871\n#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872\n#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873\n#define GL_PROGRAM_ERROR_STRING_NV 0x8874\n\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]);\n\n#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV)\n#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV)\n#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV)\n#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV)\n#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV)\n#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV)\n\n#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program)\n\n#endif /* GL_NV_fragment_program */\n\n/* ------------------------ GL_NV_fragment_program2 ------------------------ */\n\n#ifndef GL_NV_fragment_program2\n#define GL_NV_fragment_program2 1\n\n#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4\n#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5\n#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6\n#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7\n#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8\n\n#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2)\n\n#endif /* GL_NV_fragment_program2 */\n\n/* ------------------------ GL_NV_fragment_program4 ------------------------ */\n\n#ifndef GL_NV_fragment_program4\n#define GL_NV_fragment_program4 1\n\n#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4)\n\n#endif /* GL_NV_fragment_program4 */\n\n/* --------------------- GL_NV_fragment_program_option --------------------- */\n\n#ifndef GL_NV_fragment_program_option\n#define GL_NV_fragment_program_option 1\n\n#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option)\n\n#endif /* GL_NV_fragment_program_option */\n\n/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */\n\n#ifndef GL_NV_framebuffer_multisample_coverage\n#define GL_NV_framebuffer_multisample_coverage 1\n\n#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB\n#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10\n#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11\n#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12\n\ntypedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);\n\n#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV)\n\n#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage)\n\n#endif /* GL_NV_framebuffer_multisample_coverage */\n\n/* ------------------------ GL_NV_geometry_program4 ------------------------ */\n\n#ifndef GL_NV_geometry_program4\n#define GL_NV_geometry_program4 1\n\n#define GL_GEOMETRY_PROGRAM_NV 0x8C26\n#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27\n#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28\n\ntypedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);\n\n#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV)\n\n#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4)\n\n#endif /* GL_NV_geometry_program4 */\n\n/* ------------------------- GL_NV_geometry_shader4 ------------------------ */\n\n#ifndef GL_NV_geometry_shader4\n#define GL_NV_geometry_shader4 1\n\n#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4)\n\n#endif /* GL_NV_geometry_shader4 */\n\n/* --------------------------- GL_NV_gpu_program4 -------------------------- */\n\n#ifndef GL_NV_gpu_program4\n#define GL_NV_gpu_program4 1\n\n#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904\n#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905\n#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906\n#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907\n#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908\n#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909\n#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5\n#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6\n\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);\n\n#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV)\n#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV)\n#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV)\n#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV)\n#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV)\n#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV)\n#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV)\n#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV)\n#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV)\n#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV)\n#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV)\n#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV)\n\n#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4)\n\n#endif /* GL_NV_gpu_program4 */\n\n/* --------------------------- GL_NV_gpu_program5 -------------------------- */\n\n#ifndef GL_NV_gpu_program5\n#define GL_NV_gpu_program5 1\n\n#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A\n#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B\n#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C\n#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D\n#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E\n#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F\n\n#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5)\n\n#endif /* GL_NV_gpu_program5 */\n\n/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */\n\n#ifndef GL_NV_gpu_program_fp64\n#define GL_NV_gpu_program_fp64 1\n\n#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64)\n\n#endif /* GL_NV_gpu_program_fp64 */\n\n/* --------------------------- GL_NV_gpu_shader5 --------------------------- */\n\n#ifndef GL_NV_gpu_shader5\n#define GL_NV_gpu_shader5 1\n\n#define GL_INT64_NV 0x140E\n#define GL_UNSIGNED_INT64_NV 0x140F\n#define GL_INT8_NV 0x8FE0\n#define GL_INT8_VEC2_NV 0x8FE1\n#define GL_INT8_VEC3_NV 0x8FE2\n#define GL_INT8_VEC4_NV 0x8FE3\n#define GL_INT16_NV 0x8FE4\n#define GL_INT16_VEC2_NV 0x8FE5\n#define GL_INT16_VEC3_NV 0x8FE6\n#define GL_INT16_VEC4_NV 0x8FE7\n#define GL_INT64_VEC2_NV 0x8FE9\n#define GL_INT64_VEC3_NV 0x8FEA\n#define GL_INT64_VEC4_NV 0x8FEB\n#define GL_UNSIGNED_INT8_NV 0x8FEC\n#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED\n#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE\n#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF\n#define GL_UNSIGNED_INT16_NV 0x8FF0\n#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1\n#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2\n#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3\n#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5\n#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6\n#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7\n#define GL_FLOAT16_NV 0x8FF8\n#define GL_FLOAT16_VEC2_NV 0x8FF9\n#define GL_FLOAT16_VEC3_NV 0x8FFA\n#define GL_FLOAT16_VEC4_NV 0x8FFB\n\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params);\ntypedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\ntypedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);\n\n#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV)\n#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV)\n#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV)\n#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV)\n#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV)\n#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV)\n#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV)\n#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV)\n#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV)\n#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV)\n#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV)\n#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV)\n#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV)\n#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV)\n#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV)\n#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV)\n#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV)\n#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV)\n#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV)\n#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV)\n#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV)\n#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV)\n#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV)\n#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV)\n#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV)\n#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV)\n#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV)\n#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV)\n#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV)\n#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV)\n#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV)\n#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV)\n#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV)\n#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV)\n\n#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5)\n\n#endif /* GL_NV_gpu_shader5 */\n\n/* ---------------------------- GL_NV_half_float --------------------------- */\n\n#ifndef GL_NV_half_float\n#define GL_NV_half_float 1\n\n#define GL_HALF_FLOAT_NV 0x140B\n\ntypedef unsigned short GLhalf;\n\ntypedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue);\ntypedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q);\ntypedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz);\ntypedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y);\ntypedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z);\ntypedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w);\ntypedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight);\ntypedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight);\n\n#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV)\n#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV)\n#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV)\n#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV)\n#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV)\n#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV)\n#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV)\n#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV)\n#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV)\n#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV)\n#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV)\n#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV)\n#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV)\n#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV)\n#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV)\n#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV)\n#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV)\n#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV)\n#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV)\n#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV)\n#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV)\n#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV)\n#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV)\n#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV)\n#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV)\n#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV)\n#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV)\n#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV)\n#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV)\n#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV)\n#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV)\n#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV)\n#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV)\n#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV)\n#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV)\n#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV)\n#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV)\n#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV)\n#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV)\n#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV)\n#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV)\n#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV)\n#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV)\n#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV)\n#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV)\n#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV)\n\n#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float)\n\n#endif /* GL_NV_half_float */\n\n/* ------------------------ GL_NV_light_max_exponent ----------------------- */\n\n#ifndef GL_NV_light_max_exponent\n#define GL_NV_light_max_exponent 1\n\n#define GL_MAX_SHININESS_NV 0x8504\n#define GL_MAX_SPOT_EXPONENT_NV 0x8505\n\n#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent)\n\n#endif /* GL_NV_light_max_exponent */\n\n/* ----------------------- GL_NV_multisample_coverage ---------------------- */\n\n#ifndef GL_NV_multisample_coverage\n#define GL_NV_multisample_coverage 1\n\n#define GL_COVERAGE_SAMPLES_NV 0x80A9\n#define GL_COLOR_SAMPLES_NV 0x8E20\n\n#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage)\n\n#endif /* GL_NV_multisample_coverage */\n\n/* --------------------- GL_NV_multisample_filter_hint --------------------- */\n\n#ifndef GL_NV_multisample_filter_hint\n#define GL_NV_multisample_filter_hint 1\n\n#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534\n\n#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint)\n\n#endif /* GL_NV_multisample_filter_hint */\n\n/* ------------------------- GL_NV_occlusion_query ------------------------- */\n\n#ifndef GL_NV_occlusion_query\n#define GL_NV_occlusion_query 1\n\n#define GL_PIXEL_COUNTER_BITS_NV 0x8864\n#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865\n#define GL_PIXEL_COUNT_NV 0x8866\n#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867\n\ntypedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);\n\n#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV)\n#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV)\n#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV)\n#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV)\n#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV)\n#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV)\n#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV)\n\n#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query)\n\n#endif /* GL_NV_occlusion_query */\n\n/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */\n\n#ifndef GL_NV_packed_depth_stencil\n#define GL_NV_packed_depth_stencil 1\n\n#define GL_DEPTH_STENCIL_NV 0x84F9\n#define GL_UNSIGNED_INT_24_8_NV 0x84FA\n\n#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil)\n\n#endif /* GL_NV_packed_depth_stencil */\n\n/* --------------------- GL_NV_parameter_buffer_object --------------------- */\n\n#ifndef GL_NV_parameter_buffer_object\n#define GL_NV_parameter_buffer_object 1\n\n#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0\n#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1\n#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2\n#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3\n#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4\n\ntypedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);\n\n#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV)\n#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV)\n#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV)\n\n#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object)\n\n#endif /* GL_NV_parameter_buffer_object */\n\n/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */\n\n#ifndef GL_NV_parameter_buffer_object2\n#define GL_NV_parameter_buffer_object2 1\n\n#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2)\n\n#endif /* GL_NV_parameter_buffer_object2 */\n\n/* -------------------------- GL_NV_path_rendering ------------------------- */\n\n#ifndef GL_NV_path_rendering\n#define GL_NV_path_rendering 1\n\n#define GL_CLOSE_PATH_NV 0x00\n#define GL_BOLD_BIT_NV 0x01\n#define GL_GLYPH_WIDTH_BIT_NV 0x01\n#define GL_MOVE_TO_NV 0x02\n#define GL_GLYPH_HEIGHT_BIT_NV 0x02\n#define GL_ITALIC_BIT_NV 0x02\n#define GL_RELATIVE_MOVE_TO_NV 0x03\n#define GL_LINE_TO_NV 0x04\n#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04\n#define GL_RELATIVE_LINE_TO_NV 0x05\n#define GL_HORIZONTAL_LINE_TO_NV 0x06\n#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07\n#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08\n#define GL_VERTICAL_LINE_TO_NV 0x08\n#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09\n#define GL_QUADRATIC_CURVE_TO_NV 0x0A\n#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B\n#define GL_CUBIC_CURVE_TO_NV 0x0C\n#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D\n#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E\n#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F\n#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10\n#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10\n#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11\n#define GL_SMALL_CCW_ARC_TO_NV 0x12\n#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13\n#define GL_SMALL_CW_ARC_TO_NV 0x14\n#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15\n#define GL_LARGE_CCW_ARC_TO_NV 0x16\n#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17\n#define GL_LARGE_CW_ARC_TO_NV 0x18\n#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19\n#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20\n#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40\n#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80\n#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8\n#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA\n#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC\n#define GL_ARC_TO_NV 0xFE\n#define GL_RELATIVE_ARC_TO_NV 0xFF\n#define GL_GLYPH_HAS_KERNING_NV 0x100\n#define GL_PRIMARY_COLOR_NV 0x852C\n#define GL_SECONDARY_COLOR_NV 0x852D\n#define GL_PRIMARY_COLOR 0x8577\n#define GL_PATH_FORMAT_SVG_NV 0x9070\n#define GL_PATH_FORMAT_PS_NV 0x9071\n#define GL_STANDARD_FONT_NAME_NV 0x9072\n#define GL_SYSTEM_FONT_NAME_NV 0x9073\n#define GL_FILE_NAME_NV 0x9074\n#define GL_PATH_STROKE_WIDTH_NV 0x9075\n#define GL_PATH_END_CAPS_NV 0x9076\n#define GL_PATH_INITIAL_END_CAP_NV 0x9077\n#define GL_PATH_TERMINAL_END_CAP_NV 0x9078\n#define GL_PATH_JOIN_STYLE_NV 0x9079\n#define GL_PATH_MITER_LIMIT_NV 0x907A\n#define GL_PATH_DASH_CAPS_NV 0x907B\n#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C\n#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D\n#define GL_PATH_DASH_OFFSET_NV 0x907E\n#define GL_PATH_CLIENT_LENGTH_NV 0x907F\n#define GL_PATH_FILL_MODE_NV 0x9080\n#define GL_PATH_FILL_MASK_NV 0x9081\n#define GL_PATH_FILL_COVER_MODE_NV 0x9082\n#define GL_PATH_STROKE_COVER_MODE_NV 0x9083\n#define GL_PATH_STROKE_MASK_NV 0x9084\n#define GL_COUNT_UP_NV 0x9088\n#define GL_COUNT_DOWN_NV 0x9089\n#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A\n#define GL_CONVEX_HULL_NV 0x908B\n#define GL_BOUNDING_BOX_NV 0x908D\n#define GL_TRANSLATE_X_NV 0x908E\n#define GL_TRANSLATE_Y_NV 0x908F\n#define GL_TRANSLATE_2D_NV 0x9090\n#define GL_TRANSLATE_3D_NV 0x9091\n#define GL_AFFINE_2D_NV 0x9092\n#define GL_AFFINE_3D_NV 0x9094\n#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096\n#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098\n#define GL_UTF8_NV 0x909A\n#define GL_UTF16_NV 0x909B\n#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C\n#define GL_PATH_COMMAND_COUNT_NV 0x909D\n#define GL_PATH_COORD_COUNT_NV 0x909E\n#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F\n#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0\n#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1\n#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2\n#define GL_SQUARE_NV 0x90A3\n#define GL_ROUND_NV 0x90A4\n#define GL_TRIANGULAR_NV 0x90A5\n#define GL_BEVEL_NV 0x90A6\n#define GL_MITER_REVERT_NV 0x90A7\n#define GL_MITER_TRUNCATE_NV 0x90A8\n#define GL_SKIP_MISSING_GLYPH_NV 0x90A9\n#define GL_USE_MISSING_GLYPH_NV 0x90AA\n#define GL_PATH_ERROR_POSITION_NV 0x90AB\n#define GL_PATH_FOG_GEN_MODE_NV 0x90AC\n#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD\n#define GL_ADJACENT_PAIRS_NV 0x90AE\n#define GL_FIRST_TO_REST_NV 0x90AF\n#define GL_PATH_GEN_MODE_NV 0x90B0\n#define GL_PATH_GEN_COEFF_NV 0x90B1\n#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2\n#define GL_PATH_GEN_COMPONENTS_NV 0x90B3\n#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4\n#define GL_MOVE_TO_RESETS_NV 0x90B5\n#define GL_MOVE_TO_CONTINUES_NV 0x90B6\n#define GL_PATH_STENCIL_FUNC_NV 0x90B7\n#define GL_PATH_STENCIL_REF_NV 0x90B8\n#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9\n#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD\n#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE\n#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF\n#define GL_FONT_X_MIN_BOUNDS_NV 0x00010000\n#define GL_FONT_Y_MIN_BOUNDS_NV 0x00020000\n#define GL_FONT_X_MAX_BOUNDS_NV 0x00040000\n#define GL_FONT_Y_MAX_BOUNDS_NV 0x00080000\n#define GL_FONT_UNITS_PER_EM_NV 0x00100000\n#define GL_FONT_ASCENDER_NV 0x00200000\n#define GL_FONT_DESCENDER_NV 0x00400000\n#define GL_FONT_HEIGHT_NV 0x00800000\n#define GL_FONT_MAX_ADVANCE_WIDTH_NV 0x01000000\n#define GL_FONT_MAX_ADVANCE_HEIGHT_NV 0x02000000\n#define GL_FONT_UNDERLINE_POSITION_NV 0x04000000\n#define GL_FONT_UNDERLINE_THICKNESS_NV 0x08000000\n#define GL_FONT_HAS_KERNING_NV 0x10000000\n\ntypedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);\ntypedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);\ntypedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);\ntypedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);\ntypedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode);\ntypedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);\ntypedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range);\ntypedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value);\ntypedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands);\ntypedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords);\ntypedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray);\ntypedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);\ntypedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics);\ntypedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);\ntypedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value);\ntypedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);\ntypedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value);\ntypedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);\ntypedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path);\ntypedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);\ntypedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs);\ntypedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords);\ntypedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords);\ntypedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc);\ntypedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray);\ntypedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode);\ntypedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);\ntypedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);\ntypedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);\ntypedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value);\ntypedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);\ntypedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value);\ntypedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLint units);\ntypedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);\ntypedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString);\ntypedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords);\ntypedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords);\ntypedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs);\ntypedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);\ntypedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);\ntypedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);\ntypedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);\ntypedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);\ntypedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues);\ntypedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]);\n\n#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV)\n#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV)\n#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV)\n#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV)\n#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV)\n#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV)\n#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV)\n#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV)\n#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV)\n#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV)\n#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV)\n#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV)\n#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV)\n#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV)\n#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV)\n#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV)\n#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV)\n#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV)\n#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV)\n#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV)\n#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV)\n#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV)\n#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV)\n#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV)\n#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV)\n#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV)\n#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV)\n#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV)\n#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV)\n#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV)\n#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV)\n#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV)\n#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV)\n#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV)\n#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV)\n#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV)\n#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV)\n#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV)\n#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV)\n#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV)\n#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV)\n#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV)\n#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV)\n#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV)\n#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV)\n#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV)\n#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV)\n#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV)\n#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV)\n\n#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering)\n\n#endif /* GL_NV_path_rendering */\n\n/* ------------------------- GL_NV_pixel_data_range ------------------------ */\n\n#ifndef GL_NV_pixel_data_range\n#define GL_NV_pixel_data_range 1\n\n#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878\n#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879\n#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A\n#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B\n#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C\n#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D\n\ntypedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer);\n\n#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV)\n#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV)\n\n#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range)\n\n#endif /* GL_NV_pixel_data_range */\n\n/* --------------------------- GL_NV_point_sprite -------------------------- */\n\n#ifndef GL_NV_point_sprite\n#define GL_NV_point_sprite 1\n\n#define GL_POINT_SPRITE_NV 0x8861\n#define GL_COORD_REPLACE_NV 0x8862\n#define GL_POINT_SPRITE_R_MODE_NV 0x8863\n\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params);\n\n#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV)\n#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV)\n\n#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite)\n\n#endif /* GL_NV_point_sprite */\n\n/* -------------------------- GL_NV_present_video -------------------------- */\n\n#ifndef GL_NV_present_video\n#define GL_NV_present_video 1\n\n#define GL_FRAME_NV 0x8E26\n#define GL_FIELDS_NV 0x8E27\n#define GL_CURRENT_TIME_NV 0x8E28\n#define GL_NUM_FILL_STREAMS_NV 0x8E29\n#define GL_PRESENT_TIME_NV 0x8E2A\n#define GL_PRESENT_DURATION_NV 0x8E2B\n\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params);\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params);\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params);\ntypedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);\ntypedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);\n\n#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV)\n#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV)\n#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV)\n#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV)\n#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV)\n#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV)\n\n#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video)\n\n#endif /* GL_NV_present_video */\n\n/* ------------------------ GL_NV_primitive_restart ------------------------ */\n\n#ifndef GL_NV_primitive_restart\n#define GL_NV_primitive_restart 1\n\n#define GL_PRIMITIVE_RESTART_NV 0x8558\n#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559\n\ntypedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);\ntypedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void);\n\n#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV)\n#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV)\n\n#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart)\n\n#endif /* GL_NV_primitive_restart */\n\n/* ------------------------ GL_NV_register_combiners ----------------------- */\n\n#ifndef GL_NV_register_combiners\n#define GL_NV_register_combiners 1\n\n#define GL_REGISTER_COMBINERS_NV 0x8522\n#define GL_VARIABLE_A_NV 0x8523\n#define GL_VARIABLE_B_NV 0x8524\n#define GL_VARIABLE_C_NV 0x8525\n#define GL_VARIABLE_D_NV 0x8526\n#define GL_VARIABLE_E_NV 0x8527\n#define GL_VARIABLE_F_NV 0x8528\n#define GL_VARIABLE_G_NV 0x8529\n#define GL_CONSTANT_COLOR0_NV 0x852A\n#define GL_CONSTANT_COLOR1_NV 0x852B\n#define GL_PRIMARY_COLOR_NV 0x852C\n#define GL_SECONDARY_COLOR_NV 0x852D\n#define GL_SPARE0_NV 0x852E\n#define GL_SPARE1_NV 0x852F\n#define GL_DISCARD_NV 0x8530\n#define GL_E_TIMES_F_NV 0x8531\n#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532\n#define GL_UNSIGNED_IDENTITY_NV 0x8536\n#define GL_UNSIGNED_INVERT_NV 0x8537\n#define GL_EXPAND_NORMAL_NV 0x8538\n#define GL_EXPAND_NEGATE_NV 0x8539\n#define GL_HALF_BIAS_NORMAL_NV 0x853A\n#define GL_HALF_BIAS_NEGATE_NV 0x853B\n#define GL_SIGNED_IDENTITY_NV 0x853C\n#define GL_SIGNED_NEGATE_NV 0x853D\n#define GL_SCALE_BY_TWO_NV 0x853E\n#define GL_SCALE_BY_FOUR_NV 0x853F\n#define GL_SCALE_BY_ONE_HALF_NV 0x8540\n#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541\n#define GL_COMBINER_INPUT_NV 0x8542\n#define GL_COMBINER_MAPPING_NV 0x8543\n#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544\n#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545\n#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546\n#define GL_COMBINER_MUX_SUM_NV 0x8547\n#define GL_COMBINER_SCALE_NV 0x8548\n#define GL_COMBINER_BIAS_NV 0x8549\n#define GL_COMBINER_AB_OUTPUT_NV 0x854A\n#define GL_COMBINER_CD_OUTPUT_NV 0x854B\n#define GL_COMBINER_SUM_OUTPUT_NV 0x854C\n#define GL_MAX_GENERAL_COMBINERS_NV 0x854D\n#define GL_NUM_GENERAL_COMBINERS_NV 0x854E\n#define GL_COLOR_SUM_CLAMP_NV 0x854F\n#define GL_COMBINER0_NV 0x8550\n#define GL_COMBINER1_NV 0x8551\n#define GL_COMBINER2_NV 0x8552\n#define GL_COMBINER3_NV 0x8553\n#define GL_COMBINER4_NV 0x8554\n#define GL_COMBINER5_NV 0x8555\n#define GL_COMBINER6_NV 0x8556\n#define GL_COMBINER7_NV 0x8557\n\ntypedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);\ntypedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);\ntypedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);\ntypedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params);\n\n#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV)\n#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV)\n#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV)\n#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV)\n#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV)\n#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV)\n#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV)\n#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV)\n#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV)\n#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV)\n#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV)\n#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV)\n#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV)\n\n#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners)\n\n#endif /* GL_NV_register_combiners */\n\n/* ----------------------- GL_NV_register_combiners2 ----------------------- */\n\n#ifndef GL_NV_register_combiners2\n#define GL_NV_register_combiners2 1\n\n#define GL_PER_STAGE_CONSTANTS_NV 0x8535\n\ntypedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params);\n\n#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV)\n#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV)\n\n#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2)\n\n#endif /* GL_NV_register_combiners2 */\n\n/* ------------------------ GL_NV_shader_buffer_load ----------------------- */\n\n#ifndef GL_NV_shader_buffer_load\n#define GL_NV_shader_buffer_load 1\n\n#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D\n#define GL_GPU_ADDRESS_NV 0x8F34\n#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35\n\ntypedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params);\ntypedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result);\ntypedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);\ntypedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);\ntypedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);\ntypedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);\ntypedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);\n\n#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV)\n#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV)\n#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV)\n#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV)\n#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV)\n#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV)\n#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV)\n#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV)\n#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV)\n#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV)\n#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV)\n#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV)\n#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV)\n\n#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load)\n\n#endif /* GL_NV_shader_buffer_load */\n\n/* ---------------------- GL_NV_tessellation_program5 ---------------------- */\n\n#ifndef GL_NV_tessellation_program5\n#define GL_NV_tessellation_program5 1\n\n#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8\n#define GL_TESS_CONTROL_PROGRAM_NV 0x891E\n#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F\n#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74\n#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75\n\n#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5)\n\n#endif /* GL_NV_tessellation_program5 */\n\n/* -------------------------- GL_NV_texgen_emboss -------------------------- */\n\n#ifndef GL_NV_texgen_emboss\n#define GL_NV_texgen_emboss 1\n\n#define GL_EMBOSS_LIGHT_NV 0x855D\n#define GL_EMBOSS_CONSTANT_NV 0x855E\n#define GL_EMBOSS_MAP_NV 0x855F\n\n#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss)\n\n#endif /* GL_NV_texgen_emboss */\n\n/* ------------------------ GL_NV_texgen_reflection ------------------------ */\n\n#ifndef GL_NV_texgen_reflection\n#define GL_NV_texgen_reflection 1\n\n#define GL_NORMAL_MAP_NV 0x8511\n#define GL_REFLECTION_MAP_NV 0x8512\n\n#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection)\n\n#endif /* GL_NV_texgen_reflection */\n\n/* ------------------------- GL_NV_texture_barrier ------------------------- */\n\n#ifndef GL_NV_texture_barrier\n#define GL_NV_texture_barrier 1\n\ntypedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void);\n\n#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV)\n\n#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier)\n\n#endif /* GL_NV_texture_barrier */\n\n/* --------------------- GL_NV_texture_compression_vtc --------------------- */\n\n#ifndef GL_NV_texture_compression_vtc\n#define GL_NV_texture_compression_vtc 1\n\n#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc)\n\n#endif /* GL_NV_texture_compression_vtc */\n\n/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */\n\n#ifndef GL_NV_texture_env_combine4\n#define GL_NV_texture_env_combine4 1\n\n#define GL_COMBINE4_NV 0x8503\n#define GL_SOURCE3_RGB_NV 0x8583\n#define GL_SOURCE3_ALPHA_NV 0x858B\n#define GL_OPERAND3_RGB_NV 0x8593\n#define GL_OPERAND3_ALPHA_NV 0x859B\n\n#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4)\n\n#endif /* GL_NV_texture_env_combine4 */\n\n/* ---------------------- GL_NV_texture_expand_normal ---------------------- */\n\n#ifndef GL_NV_texture_expand_normal\n#define GL_NV_texture_expand_normal 1\n\n#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F\n\n#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal)\n\n#endif /* GL_NV_texture_expand_normal */\n\n/* ----------------------- GL_NV_texture_multisample ----------------------- */\n\n#ifndef GL_NV_texture_multisample\n#define GL_NV_texture_multisample 1\n\n#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045\n#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046\n\ntypedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\ntypedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\ntypedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);\n\n#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV)\n#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV)\n#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV)\n#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV)\n#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV)\n#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV)\n\n#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample)\n\n#endif /* GL_NV_texture_multisample */\n\n/* ------------------------ GL_NV_texture_rectangle ------------------------ */\n\n#ifndef GL_NV_texture_rectangle\n#define GL_NV_texture_rectangle 1\n\n#define GL_TEXTURE_RECTANGLE_NV 0x84F5\n#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6\n#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7\n#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8\n\n#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle)\n\n#endif /* GL_NV_texture_rectangle */\n\n/* -------------------------- GL_NV_texture_shader ------------------------- */\n\n#ifndef GL_NV_texture_shader\n#define GL_NV_texture_shader 1\n\n#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C\n#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D\n#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E\n#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9\n#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA\n#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB\n#define GL_DSDT_MAG_INTENSITY_NV 0x86DC\n#define GL_SHADER_CONSISTENT_NV 0x86DD\n#define GL_TEXTURE_SHADER_NV 0x86DE\n#define GL_SHADER_OPERATION_NV 0x86DF\n#define GL_CULL_MODES_NV 0x86E0\n#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1\n#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1\n#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2\n#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2\n#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3\n#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3\n#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4\n#define GL_CONST_EYE_NV 0x86E5\n#define GL_PASS_THROUGH_NV 0x86E6\n#define GL_CULL_FRAGMENT_NV 0x86E7\n#define GL_OFFSET_TEXTURE_2D_NV 0x86E8\n#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9\n#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA\n#define GL_DOT_PRODUCT_NV 0x86EC\n#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED\n#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE\n#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0\n#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1\n#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2\n#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3\n#define GL_HILO_NV 0x86F4\n#define GL_DSDT_NV 0x86F5\n#define GL_DSDT_MAG_NV 0x86F6\n#define GL_DSDT_MAG_VIB_NV 0x86F7\n#define GL_HILO16_NV 0x86F8\n#define GL_SIGNED_HILO_NV 0x86F9\n#define GL_SIGNED_HILO16_NV 0x86FA\n#define GL_SIGNED_RGBA_NV 0x86FB\n#define GL_SIGNED_RGBA8_NV 0x86FC\n#define GL_SIGNED_RGB_NV 0x86FE\n#define GL_SIGNED_RGB8_NV 0x86FF\n#define GL_SIGNED_LUMINANCE_NV 0x8701\n#define GL_SIGNED_LUMINANCE8_NV 0x8702\n#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703\n#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704\n#define GL_SIGNED_ALPHA_NV 0x8705\n#define GL_SIGNED_ALPHA8_NV 0x8706\n#define GL_SIGNED_INTENSITY_NV 0x8707\n#define GL_SIGNED_INTENSITY8_NV 0x8708\n#define GL_DSDT8_NV 0x8709\n#define GL_DSDT8_MAG8_NV 0x870A\n#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B\n#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C\n#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D\n#define GL_HI_SCALE_NV 0x870E\n#define GL_LO_SCALE_NV 0x870F\n#define GL_DS_SCALE_NV 0x8710\n#define GL_DT_SCALE_NV 0x8711\n#define GL_MAGNITUDE_SCALE_NV 0x8712\n#define GL_VIBRANCE_SCALE_NV 0x8713\n#define GL_HI_BIAS_NV 0x8714\n#define GL_LO_BIAS_NV 0x8715\n#define GL_DS_BIAS_NV 0x8716\n#define GL_DT_BIAS_NV 0x8717\n#define GL_MAGNITUDE_BIAS_NV 0x8718\n#define GL_VIBRANCE_BIAS_NV 0x8719\n#define GL_TEXTURE_BORDER_VALUES_NV 0x871A\n#define GL_TEXTURE_HI_SIZE_NV 0x871B\n#define GL_TEXTURE_LO_SIZE_NV 0x871C\n#define GL_TEXTURE_DS_SIZE_NV 0x871D\n#define GL_TEXTURE_DT_SIZE_NV 0x871E\n#define GL_TEXTURE_MAG_SIZE_NV 0x871F\n\n#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader)\n\n#endif /* GL_NV_texture_shader */\n\n/* ------------------------- GL_NV_texture_shader2 ------------------------- */\n\n#ifndef GL_NV_texture_shader2\n#define GL_NV_texture_shader2 1\n\n#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA\n#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB\n#define GL_DSDT_MAG_INTENSITY_NV 0x86DC\n#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF\n#define GL_HILO_NV 0x86F4\n#define GL_DSDT_NV 0x86F5\n#define GL_DSDT_MAG_NV 0x86F6\n#define GL_DSDT_MAG_VIB_NV 0x86F7\n#define GL_HILO16_NV 0x86F8\n#define GL_SIGNED_HILO_NV 0x86F9\n#define GL_SIGNED_HILO16_NV 0x86FA\n#define GL_SIGNED_RGBA_NV 0x86FB\n#define GL_SIGNED_RGBA8_NV 0x86FC\n#define GL_SIGNED_RGB_NV 0x86FE\n#define GL_SIGNED_RGB8_NV 0x86FF\n#define GL_SIGNED_LUMINANCE_NV 0x8701\n#define GL_SIGNED_LUMINANCE8_NV 0x8702\n#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703\n#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704\n#define GL_SIGNED_ALPHA_NV 0x8705\n#define GL_SIGNED_ALPHA8_NV 0x8706\n#define GL_SIGNED_INTENSITY_NV 0x8707\n#define GL_SIGNED_INTENSITY8_NV 0x8708\n#define GL_DSDT8_NV 0x8709\n#define GL_DSDT8_MAG8_NV 0x870A\n#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B\n#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C\n#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D\n\n#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2)\n\n#endif /* GL_NV_texture_shader2 */\n\n/* ------------------------- GL_NV_texture_shader3 ------------------------- */\n\n#ifndef GL_NV_texture_shader3\n#define GL_NV_texture_shader3 1\n\n#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850\n#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851\n#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852\n#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853\n#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854\n#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855\n#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856\n#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857\n#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858\n#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859\n#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A\n#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B\n#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C\n#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D\n#define GL_HILO8_NV 0x885E\n#define GL_SIGNED_HILO8_NV 0x885F\n#define GL_FORCE_BLUE_TO_ONE_NV 0x8860\n\n#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3)\n\n#endif /* GL_NV_texture_shader3 */\n\n/* ------------------------ GL_NV_transform_feedback ----------------------- */\n\n#ifndef GL_NV_transform_feedback\n#define GL_NV_transform_feedback 1\n\n#define GL_BACK_PRIMARY_COLOR_NV 0x8C77\n#define GL_BACK_SECONDARY_COLOR_NV 0x8C78\n#define GL_TEXTURE_COORD_NV 0x8C79\n#define GL_CLIP_DISTANCE_NV 0x8C7A\n#define GL_VERTEX_ID_NV 0x8C7B\n#define GL_PRIMITIVE_ID_NV 0x8C7C\n#define GL_GENERIC_ATTRIB_NV 0x8C7D\n#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80\n#define GL_ACTIVE_VARYINGS_NV 0x8C81\n#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82\n#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83\n#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84\n#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85\n#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86\n#define GL_PRIMITIVES_GENERATED_NV 0x8C87\n#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88\n#define GL_RASTERIZER_DISCARD_NV 0x8C89\n#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A\n#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B\n#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C\n#define GL_SEPARATE_ATTRIBS_NV 0x8C8D\n#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E\n#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F\n\ntypedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);\ntypedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);\ntypedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);\ntypedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);\ntypedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);\ntypedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);\ntypedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);\ntypedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);\n\n#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV)\n#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV)\n#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV)\n#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV)\n#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV)\n#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV)\n#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV)\n#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV)\n#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV)\n#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV)\n#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV)\n\n#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback)\n\n#endif /* GL_NV_transform_feedback */\n\n/* ----------------------- GL_NV_transform_feedback2 ----------------------- */\n\n#ifndef GL_NV_transform_feedback2\n#define GL_NV_transform_feedback2 1\n\n#define GL_TRANSFORM_FEEDBACK_NV 0x8E22\n#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23\n#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24\n#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25\n\ntypedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids);\ntypedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);\n\n#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV)\n#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV)\n#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV)\n#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV)\n#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV)\n#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV)\n#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV)\n\n#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2)\n\n#endif /* GL_NV_transform_feedback2 */\n\n/* -------------------------- GL_NV_vdpau_interop -------------------------- */\n\n#ifndef GL_NV_vdpau_interop\n#define GL_NV_vdpau_interop 1\n\n#define GL_SURFACE_STATE_NV 0x86EB\n#define GL_SURFACE_REGISTERED_NV 0x86FD\n#define GL_SURFACE_MAPPED_NV 0x8700\n#define GL_WRITE_DISCARD_NV 0x88BE\n\ntypedef GLintptr GLvdpauSurfaceNV;\n\ntypedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values);\ntypedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress);\ntypedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);\ntypedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces);\ntypedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);\ntypedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);\ntypedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);\ntypedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces);\ntypedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);\n\n#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV)\n#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV)\n#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV)\n#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV)\n#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV)\n#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV)\n#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV)\n#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV)\n#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV)\n#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV)\n\n#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop)\n\n#endif /* GL_NV_vdpau_interop */\n\n/* ------------------------ GL_NV_vertex_array_range ----------------------- */\n\n#ifndef GL_NV_vertex_array_range\n#define GL_NV_vertex_array_range 1\n\n#define GL_VERTEX_ARRAY_RANGE_NV 0x851D\n#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E\n#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F\n#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520\n#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521\n\ntypedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);\ntypedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer);\n\n#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV)\n#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV)\n\n#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range)\n\n#endif /* GL_NV_vertex_array_range */\n\n/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */\n\n#ifndef GL_NV_vertex_array_range2\n#define GL_NV_vertex_array_range2 1\n\n#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533\n\n#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2)\n\n#endif /* GL_NV_vertex_array_range2 */\n\n/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */\n\n#ifndef GL_NV_vertex_attrib_integer_64bit\n#define GL_NV_vertex_attrib_integer_64bit 1\n\n#define GL_INT64_NV 0x140E\n#define GL_UNSIGNED_INT64_NV 0x140F\n\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);\n\n#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV)\n#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV)\n#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV)\n#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV)\n#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV)\n#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV)\n#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV)\n#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV)\n#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV)\n#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV)\n#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV)\n#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV)\n#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV)\n#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV)\n#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV)\n#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV)\n#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV)\n#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV)\n#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV)\n\n#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit)\n\n#endif /* GL_NV_vertex_attrib_integer_64bit */\n\n/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */\n\n#ifndef GL_NV_vertex_buffer_unified_memory\n#define GL_NV_vertex_buffer_unified_memory 1\n\n#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E\n#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F\n#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20\n#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21\n#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22\n#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23\n#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24\n#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25\n#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26\n#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27\n#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28\n#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29\n#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A\n#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B\n#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C\n#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D\n#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E\n#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F\n#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30\n#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31\n#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32\n#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33\n#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40\n#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41\n#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42\n\ntypedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);\ntypedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]);\ntypedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);\ntypedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);\n\n#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV)\n#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV)\n#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV)\n#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV)\n#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV)\n#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV)\n#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV)\n#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV)\n#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV)\n#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV)\n#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV)\n#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV)\n\n#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory)\n\n#endif /* GL_NV_vertex_buffer_unified_memory */\n\n/* -------------------------- GL_NV_vertex_program ------------------------- */\n\n#ifndef GL_NV_vertex_program\n#define GL_NV_vertex_program 1\n\n#define GL_VERTEX_PROGRAM_NV 0x8620\n#define GL_VERTEX_STATE_PROGRAM_NV 0x8621\n#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623\n#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624\n#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625\n#define GL_CURRENT_ATTRIB_NV 0x8626\n#define GL_PROGRAM_LENGTH_NV 0x8627\n#define GL_PROGRAM_STRING_NV 0x8628\n#define GL_MODELVIEW_PROJECTION_NV 0x8629\n#define GL_IDENTITY_NV 0x862A\n#define GL_INVERSE_NV 0x862B\n#define GL_TRANSPOSE_NV 0x862C\n#define GL_INVERSE_TRANSPOSE_NV 0x862D\n#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E\n#define GL_MAX_TRACK_MATRICES_NV 0x862F\n#define GL_MATRIX0_NV 0x8630\n#define GL_MATRIX1_NV 0x8631\n#define GL_MATRIX2_NV 0x8632\n#define GL_MATRIX3_NV 0x8633\n#define GL_MATRIX4_NV 0x8634\n#define GL_MATRIX5_NV 0x8635\n#define GL_MATRIX6_NV 0x8636\n#define GL_MATRIX7_NV 0x8637\n#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640\n#define GL_CURRENT_MATRIX_NV 0x8641\n#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642\n#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643\n#define GL_PROGRAM_PARAMETER_NV 0x8644\n#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645\n#define GL_PROGRAM_TARGET_NV 0x8646\n#define GL_PROGRAM_RESIDENT_NV 0x8647\n#define GL_TRACK_MATRIX_NV 0x8648\n#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649\n#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A\n#define GL_PROGRAM_ERROR_POSITION_NV 0x864B\n#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650\n#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651\n#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652\n#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653\n#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654\n#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655\n#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656\n#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657\n#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658\n#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659\n#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A\n#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B\n#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C\n#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D\n#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E\n#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F\n#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660\n#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661\n#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662\n#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663\n#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664\n#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665\n#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666\n#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667\n#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668\n#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669\n#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A\n#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B\n#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C\n#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D\n#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E\n#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F\n#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670\n#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671\n#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672\n#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673\n#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674\n#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675\n#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676\n#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677\n#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678\n#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679\n#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A\n#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B\n#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C\n#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D\n#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E\n#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F\n\ntypedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences);\ntypedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);\ntypedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program);\ntypedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params);\ntypedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id);\ntypedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids);\ntypedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);\ntypedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v);\n\n#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV)\n#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV)\n#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV)\n#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV)\n#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV)\n#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV)\n#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV)\n#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV)\n#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV)\n#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV)\n#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV)\n#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV)\n#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV)\n#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV)\n#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV)\n#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV)\n#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV)\n#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV)\n#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV)\n#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV)\n#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV)\n#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV)\n#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV)\n#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV)\n#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV)\n#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV)\n#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV)\n#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV)\n#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV)\n#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV)\n#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV)\n#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV)\n#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV)\n#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV)\n#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV)\n#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV)\n#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV)\n#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV)\n#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV)\n#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV)\n#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV)\n#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV)\n#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV)\n#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV)\n#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV)\n#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV)\n#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV)\n#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV)\n#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV)\n#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV)\n#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV)\n#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV)\n#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV)\n#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV)\n#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV)\n#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV)\n#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV)\n#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV)\n#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV)\n#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV)\n#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV)\n#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV)\n#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV)\n#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV)\n\n#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program)\n\n#endif /* GL_NV_vertex_program */\n\n/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */\n\n#ifndef GL_NV_vertex_program1_1\n#define GL_NV_vertex_program1_1 1\n\n#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1)\n\n#endif /* GL_NV_vertex_program1_1 */\n\n/* ------------------------- GL_NV_vertex_program2 ------------------------- */\n\n#ifndef GL_NV_vertex_program2\n#define GL_NV_vertex_program2 1\n\n#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2)\n\n#endif /* GL_NV_vertex_program2 */\n\n/* ---------------------- GL_NV_vertex_program2_option --------------------- */\n\n#ifndef GL_NV_vertex_program2_option\n#define GL_NV_vertex_program2_option 1\n\n#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4\n#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5\n\n#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option)\n\n#endif /* GL_NV_vertex_program2_option */\n\n/* ------------------------- GL_NV_vertex_program3 ------------------------- */\n\n#ifndef GL_NV_vertex_program3\n#define GL_NV_vertex_program3 1\n\n#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C\n\n#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3)\n\n#endif /* GL_NV_vertex_program3 */\n\n/* ------------------------- GL_NV_vertex_program4 ------------------------- */\n\n#ifndef GL_NV_vertex_program4\n#define GL_NV_vertex_program4 1\n\n#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD\n\n#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4)\n\n#endif /* GL_NV_vertex_program4 */\n\n/* -------------------------- GL_NV_video_capture -------------------------- */\n\n#ifndef GL_NV_video_capture\n#define GL_NV_video_capture 1\n\n#define GL_VIDEO_BUFFER_NV 0x9020\n#define GL_VIDEO_BUFFER_BINDING_NV 0x9021\n#define GL_FIELD_UPPER_NV 0x9022\n#define GL_FIELD_LOWER_NV 0x9023\n#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024\n#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025\n#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026\n#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027\n#define GL_VIDEO_BUFFER_PITCH_NV 0x9028\n#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029\n#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A\n#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B\n#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C\n#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D\n#define GL_PARTIAL_SUCCESS_NV 0x902E\n#define GL_SUCCESS_NV 0x902F\n#define GL_FAILURE_NV 0x9030\n#define GL_YCBYCR8_422_NV 0x9031\n#define GL_YCBAYCR8A_4224_NV 0x9032\n#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033\n#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034\n#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035\n#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036\n#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037\n#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038\n#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039\n#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A\n#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B\n#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C\n\ntypedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);\ntypedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);\ntypedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);\ntypedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params);\ntypedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time);\ntypedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params);\ntypedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params);\n\n#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV)\n#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV)\n#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV)\n#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV)\n#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV)\n#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV)\n#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV)\n#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV)\n#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV)\n#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV)\n#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV)\n#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV)\n\n#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture)\n\n#endif /* GL_NV_video_capture */\n\n/* ------------------------ GL_OES_byte_coordinates ------------------------ */\n\n#ifndef GL_OES_byte_coordinates\n#define GL_OES_byte_coordinates 1\n\n#define GL_BYTE 0x1400\n\n#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates)\n\n#endif /* GL_OES_byte_coordinates */\n\n/* ------------------- GL_OES_compressed_paletted_texture ------------------ */\n\n#ifndef GL_OES_compressed_paletted_texture\n#define GL_OES_compressed_paletted_texture 1\n\n#define GL_PALETTE4_RGB8_OES 0x8B90\n#define GL_PALETTE4_RGBA8_OES 0x8B91\n#define GL_PALETTE4_R5_G6_B5_OES 0x8B92\n#define GL_PALETTE4_RGBA4_OES 0x8B93\n#define GL_PALETTE4_RGB5_A1_OES 0x8B94\n#define GL_PALETTE8_RGB8_OES 0x8B95\n#define GL_PALETTE8_RGBA8_OES 0x8B96\n#define GL_PALETTE8_R5_G6_B5_OES 0x8B97\n#define GL_PALETTE8_RGBA4_OES 0x8B98\n#define GL_PALETTE8_RGB5_A1_OES 0x8B99\n\n#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture)\n\n#endif /* GL_OES_compressed_paletted_texture */\n\n/* --------------------------- GL_OES_read_format -------------------------- */\n\n#ifndef GL_OES_read_format\n#define GL_OES_read_format 1\n\n#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A\n#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B\n\n#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format)\n\n#endif /* GL_OES_read_format */\n\n/* ------------------------ GL_OES_single_precision ------------------------ */\n\n#ifndef GL_OES_single_precision\n#define GL_OES_single_precision 1\n\ntypedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth);\ntypedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation);\ntypedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f);\ntypedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);\ntypedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation);\ntypedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);\n\n#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES)\n#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES)\n#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES)\n#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES)\n#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES)\n#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES)\n\n#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision)\n\n#endif /* GL_OES_single_precision */\n\n/* ---------------------------- GL_OML_interlace --------------------------- */\n\n#ifndef GL_OML_interlace\n#define GL_OML_interlace 1\n\n#define GL_INTERLACE_OML 0x8980\n#define GL_INTERLACE_READ_OML 0x8981\n\n#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace)\n\n#endif /* GL_OML_interlace */\n\n/* ---------------------------- GL_OML_resample ---------------------------- */\n\n#ifndef GL_OML_resample\n#define GL_OML_resample 1\n\n#define GL_PACK_RESAMPLE_OML 0x8984\n#define GL_UNPACK_RESAMPLE_OML 0x8985\n#define GL_RESAMPLE_REPLICATE_OML 0x8986\n#define GL_RESAMPLE_ZERO_FILL_OML 0x8987\n#define GL_RESAMPLE_AVERAGE_OML 0x8988\n#define GL_RESAMPLE_DECIMATE_OML 0x8989\n\n#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample)\n\n#endif /* GL_OML_resample */\n\n/* ---------------------------- GL_OML_subsample --------------------------- */\n\n#ifndef GL_OML_subsample\n#define GL_OML_subsample 1\n\n#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982\n#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983\n\n#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample)\n\n#endif /* GL_OML_subsample */\n\n/* --------------------------- GL_PGI_misc_hints --------------------------- */\n\n#ifndef GL_PGI_misc_hints\n#define GL_PGI_misc_hints 1\n\n#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000\n#define GL_CONSERVE_MEMORY_HINT_PGI 107005\n#define GL_RECLAIM_MEMORY_HINT_PGI 107006\n#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010\n#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011\n#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012\n#define GL_ALWAYS_FAST_HINT_PGI 107020\n#define GL_ALWAYS_SOFT_HINT_PGI 107021\n#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022\n#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023\n#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024\n#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025\n#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030\n#define GL_STRICT_LIGHTING_HINT_PGI 107031\n#define GL_STRICT_SCISSOR_HINT_PGI 107032\n#define GL_FULL_STIPPLE_HINT_PGI 107033\n#define GL_CLIP_NEAR_HINT_PGI 107040\n#define GL_CLIP_FAR_HINT_PGI 107041\n#define GL_WIDE_LINE_HINT_PGI 107042\n#define GL_BACK_NORMALS_HINT_PGI 107043\n\n#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints)\n\n#endif /* GL_PGI_misc_hints */\n\n/* -------------------------- GL_PGI_vertex_hints -------------------------- */\n\n#ifndef GL_PGI_vertex_hints\n#define GL_PGI_vertex_hints 1\n\n#define GL_VERTEX23_BIT_PGI 0x00000004\n#define GL_VERTEX4_BIT_PGI 0x00000008\n#define GL_COLOR3_BIT_PGI 0x00010000\n#define GL_COLOR4_BIT_PGI 0x00020000\n#define GL_EDGEFLAG_BIT_PGI 0x00040000\n#define GL_INDEX_BIT_PGI 0x00080000\n#define GL_MAT_AMBIENT_BIT_PGI 0x00100000\n#define GL_VERTEX_DATA_HINT_PGI 107050\n#define GL_VERTEX_CONSISTENT_HINT_PGI 107051\n#define GL_MATERIAL_SIDE_HINT_PGI 107052\n#define GL_MAX_VERTEX_HINT_PGI 107053\n#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000\n#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000\n#define GL_MAT_EMISSION_BIT_PGI 0x00800000\n#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000\n#define GL_MAT_SHININESS_BIT_PGI 0x02000000\n#define GL_MAT_SPECULAR_BIT_PGI 0x04000000\n#define GL_NORMAL_BIT_PGI 0x08000000\n#define GL_TEXCOORD1_BIT_PGI 0x10000000\n#define GL_TEXCOORD2_BIT_PGI 0x20000000\n#define GL_TEXCOORD3_BIT_PGI 0x40000000\n#define GL_TEXCOORD4_BIT_PGI 0x80000000\n\n#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints)\n\n#endif /* GL_PGI_vertex_hints */\n\n/* ----------------------- GL_REND_screen_coordinates ---------------------- */\n\n#ifndef GL_REND_screen_coordinates\n#define GL_REND_screen_coordinates 1\n\n#define GL_SCREEN_COORDINATES_REND 0x8490\n#define GL_INVERTED_SCREEN_W_REND 0x8491\n\n#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates)\n\n#endif /* GL_REND_screen_coordinates */\n\n/* ------------------------------- GL_S3_s3tc ------------------------------ */\n\n#ifndef GL_S3_s3tc\n#define GL_S3_s3tc 1\n\n#define GL_RGB_S3TC 0x83A0\n#define GL_RGB4_S3TC 0x83A1\n#define GL_RGBA_S3TC 0x83A2\n#define GL_RGBA4_S3TC 0x83A3\n#define GL_RGBA_DXT5_S3TC 0x83A4\n#define GL_RGBA4_DXT5_S3TC 0x83A5\n\n#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc)\n\n#endif /* GL_S3_s3tc */\n\n/* -------------------------- GL_SGIS_color_range -------------------------- */\n\n#ifndef GL_SGIS_color_range\n#define GL_SGIS_color_range 1\n\n#define GL_EXTENDED_RANGE_SGIS 0x85A5\n#define GL_MIN_RED_SGIS 0x85A6\n#define GL_MAX_RED_SGIS 0x85A7\n#define GL_MIN_GREEN_SGIS 0x85A8\n#define GL_MAX_GREEN_SGIS 0x85A9\n#define GL_MIN_BLUE_SGIS 0x85AA\n#define GL_MAX_BLUE_SGIS 0x85AB\n#define GL_MIN_ALPHA_SGIS 0x85AC\n#define GL_MAX_ALPHA_SGIS 0x85AD\n\n#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range)\n\n#endif /* GL_SGIS_color_range */\n\n/* ------------------------- GL_SGIS_detail_texture ------------------------ */\n\n#ifndef GL_SGIS_detail_texture\n#define GL_SGIS_detail_texture 1\n\ntypedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points);\ntypedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points);\n\n#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS)\n#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS)\n\n#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture)\n\n#endif /* GL_SGIS_detail_texture */\n\n/* -------------------------- GL_SGIS_fog_function ------------------------- */\n\n#ifndef GL_SGIS_fog_function\n#define GL_SGIS_fog_function 1\n\ntypedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points);\ntypedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points);\n\n#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS)\n#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS)\n\n#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function)\n\n#endif /* GL_SGIS_fog_function */\n\n/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */\n\n#ifndef GL_SGIS_generate_mipmap\n#define GL_SGIS_generate_mipmap 1\n\n#define GL_GENERATE_MIPMAP_SGIS 0x8191\n#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192\n\n#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap)\n\n#endif /* GL_SGIS_generate_mipmap */\n\n/* -------------------------- GL_SGIS_multisample -------------------------- */\n\n#ifndef GL_SGIS_multisample\n#define GL_SGIS_multisample 1\n\n#define GL_MULTISAMPLE_SGIS 0x809D\n#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E\n#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F\n#define GL_SAMPLE_MASK_SGIS 0x80A0\n#define GL_1PASS_SGIS 0x80A1\n#define GL_2PASS_0_SGIS 0x80A2\n#define GL_2PASS_1_SGIS 0x80A3\n#define GL_4PASS_0_SGIS 0x80A4\n#define GL_4PASS_1_SGIS 0x80A5\n#define GL_4PASS_2_SGIS 0x80A6\n#define GL_4PASS_3_SGIS 0x80A7\n#define GL_SAMPLE_BUFFERS_SGIS 0x80A8\n#define GL_SAMPLES_SGIS 0x80A9\n#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA\n#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB\n#define GL_SAMPLE_PATTERN_SGIS 0x80AC\n#define GL_MULTISAMPLE_BIT_EXT 0x20000000\n\ntypedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);\ntypedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);\n\n#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS)\n#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS)\n\n#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample)\n\n#endif /* GL_SGIS_multisample */\n\n/* ------------------------- GL_SGIS_pixel_texture ------------------------- */\n\n#ifndef GL_SGIS_pixel_texture\n#define GL_SGIS_pixel_texture 1\n\n#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture)\n\n#endif /* GL_SGIS_pixel_texture */\n\n/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */\n\n#ifndef GL_SGIS_point_line_texgen\n#define GL_SGIS_point_line_texgen 1\n\n#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0\n#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1\n#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2\n#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3\n#define GL_EYE_POINT_SGIS 0x81F4\n#define GL_OBJECT_POINT_SGIS 0x81F5\n#define GL_EYE_LINE_SGIS 0x81F6\n#define GL_OBJECT_LINE_SGIS 0x81F7\n\n#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen)\n\n#endif /* GL_SGIS_point_line_texgen */\n\n/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */\n\n#ifndef GL_SGIS_sharpen_texture\n#define GL_SGIS_sharpen_texture 1\n\ntypedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points);\ntypedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points);\n\n#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS)\n#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS)\n\n#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture)\n\n#endif /* GL_SGIS_sharpen_texture */\n\n/* --------------------------- GL_SGIS_texture4D --------------------------- */\n\n#ifndef GL_SGIS_texture4D\n#define GL_SGIS_texture4D 1\n\ntypedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels);\ntypedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels);\n\n#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS)\n#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS)\n\n#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D)\n\n#endif /* GL_SGIS_texture4D */\n\n/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */\n\n#ifndef GL_SGIS_texture_border_clamp\n#define GL_SGIS_texture_border_clamp 1\n\n#define GL_CLAMP_TO_BORDER_SGIS 0x812D\n\n#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp)\n\n#endif /* GL_SGIS_texture_border_clamp */\n\n/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */\n\n#ifndef GL_SGIS_texture_edge_clamp\n#define GL_SGIS_texture_edge_clamp 1\n\n#define GL_CLAMP_TO_EDGE_SGIS 0x812F\n\n#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp)\n\n#endif /* GL_SGIS_texture_edge_clamp */\n\n/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */\n\n#ifndef GL_SGIS_texture_filter4\n#define GL_SGIS_texture_filter4 1\n\ntypedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights);\ntypedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights);\n\n#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS)\n#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS)\n\n#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4)\n\n#endif /* GL_SGIS_texture_filter4 */\n\n/* -------------------------- GL_SGIS_texture_lod -------------------------- */\n\n#ifndef GL_SGIS_texture_lod\n#define GL_SGIS_texture_lod 1\n\n#define GL_TEXTURE_MIN_LOD_SGIS 0x813A\n#define GL_TEXTURE_MAX_LOD_SGIS 0x813B\n#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C\n#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D\n\n#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod)\n\n#endif /* GL_SGIS_texture_lod */\n\n/* ------------------------- GL_SGIS_texture_select ------------------------ */\n\n#ifndef GL_SGIS_texture_select\n#define GL_SGIS_texture_select 1\n\n#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select)\n\n#endif /* GL_SGIS_texture_select */\n\n/* ----------------------------- GL_SGIX_async ----------------------------- */\n\n#ifndef GL_SGIX_async\n#define GL_SGIX_async 1\n\n#define GL_ASYNC_MARKER_SGIX 0x8329\n\ntypedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker);\ntypedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);\ntypedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp);\ntypedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);\ntypedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);\ntypedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp);\n\n#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX)\n#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX)\n#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX)\n#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX)\n#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX)\n#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX)\n\n#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async)\n\n#endif /* GL_SGIX_async */\n\n/* ------------------------ GL_SGIX_async_histogram ------------------------ */\n\n#ifndef GL_SGIX_async_histogram\n#define GL_SGIX_async_histogram 1\n\n#define GL_ASYNC_HISTOGRAM_SGIX 0x832C\n#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D\n\n#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram)\n\n#endif /* GL_SGIX_async_histogram */\n\n/* -------------------------- GL_SGIX_async_pixel -------------------------- */\n\n#ifndef GL_SGIX_async_pixel\n#define GL_SGIX_async_pixel 1\n\n#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C\n#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D\n#define GL_ASYNC_READ_PIXELS_SGIX 0x835E\n#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F\n#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360\n#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361\n\n#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel)\n\n#endif /* GL_SGIX_async_pixel */\n\n/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */\n\n#ifndef GL_SGIX_blend_alpha_minmax\n#define GL_SGIX_blend_alpha_minmax 1\n\n#define GL_ALPHA_MIN_SGIX 0x8320\n#define GL_ALPHA_MAX_SGIX 0x8321\n\n#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax)\n\n#endif /* GL_SGIX_blend_alpha_minmax */\n\n/* ---------------------------- GL_SGIX_clipmap ---------------------------- */\n\n#ifndef GL_SGIX_clipmap\n#define GL_SGIX_clipmap 1\n\n#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap)\n\n#endif /* GL_SGIX_clipmap */\n\n/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */\n\n#ifndef GL_SGIX_convolution_accuracy\n#define GL_SGIX_convolution_accuracy 1\n\n#define GL_CONVOLUTION_HINT_SGIX 0x8316\n\n#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy)\n\n#endif /* GL_SGIX_convolution_accuracy */\n\n/* ------------------------- GL_SGIX_depth_texture ------------------------- */\n\n#ifndef GL_SGIX_depth_texture\n#define GL_SGIX_depth_texture 1\n\n#define GL_DEPTH_COMPONENT16_SGIX 0x81A5\n#define GL_DEPTH_COMPONENT24_SGIX 0x81A6\n#define GL_DEPTH_COMPONENT32_SGIX 0x81A7\n\n#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture)\n\n#endif /* GL_SGIX_depth_texture */\n\n/* -------------------------- GL_SGIX_flush_raster ------------------------- */\n\n#ifndef GL_SGIX_flush_raster\n#define GL_SGIX_flush_raster 1\n\ntypedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void);\n\n#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX)\n\n#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster)\n\n#endif /* GL_SGIX_flush_raster */\n\n/* --------------------------- GL_SGIX_fog_offset -------------------------- */\n\n#ifndef GL_SGIX_fog_offset\n#define GL_SGIX_fog_offset 1\n\n#define GL_FOG_OFFSET_SGIX 0x8198\n#define GL_FOG_OFFSET_VALUE_SGIX 0x8199\n\n#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset)\n\n#endif /* GL_SGIX_fog_offset */\n\n/* -------------------------- GL_SGIX_fog_texture -------------------------- */\n\n#ifndef GL_SGIX_fog_texture\n#define GL_SGIX_fog_texture 1\n\n#define GL_TEXTURE_FOG_SGIX 0\n#define GL_FOG_PATCHY_FACTOR_SGIX 0\n#define GL_FRAGMENT_FOG_SGIX 0\n\ntypedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname);\n\n#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX)\n\n#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture)\n\n#endif /* GL_SGIX_fog_texture */\n\n/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */\n\n#ifndef GL_SGIX_fragment_specular_lighting\n#define GL_SGIX_fragment_specular_lighting 1\n\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param);\ntypedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data);\ntypedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data);\n\n#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX)\n#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX)\n#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX)\n#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX)\n#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX)\n#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX)\n#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX)\n#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX)\n#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX)\n#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX)\n#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX)\n#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX)\n#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX)\n#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX)\n#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX)\n#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX)\n#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX)\n\n#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting)\n\n#endif /* GL_SGIX_fragment_specular_lighting */\n\n/* --------------------------- GL_SGIX_framezoom --------------------------- */\n\n#ifndef GL_SGIX_framezoom\n#define GL_SGIX_framezoom 1\n\ntypedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor);\n\n#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX)\n\n#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom)\n\n#endif /* GL_SGIX_framezoom */\n\n/* --------------------------- GL_SGIX_interlace --------------------------- */\n\n#ifndef GL_SGIX_interlace\n#define GL_SGIX_interlace 1\n\n#define GL_INTERLACE_SGIX 0x8094\n\n#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace)\n\n#endif /* GL_SGIX_interlace */\n\n/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */\n\n#ifndef GL_SGIX_ir_instrument1\n#define GL_SGIX_ir_instrument1 1\n\n#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1)\n\n#endif /* GL_SGIX_ir_instrument1 */\n\n/* ------------------------- GL_SGIX_list_priority ------------------------- */\n\n#ifndef GL_SGIX_list_priority\n#define GL_SGIX_list_priority 1\n\n#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority)\n\n#endif /* GL_SGIX_list_priority */\n\n/* ------------------------- GL_SGIX_pixel_texture ------------------------- */\n\n#ifndef GL_SGIX_pixel_texture\n#define GL_SGIX_pixel_texture 1\n\ntypedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);\n\n#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX)\n\n#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture)\n\n#endif /* GL_SGIX_pixel_texture */\n\n/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */\n\n#ifndef GL_SGIX_pixel_texture_bits\n#define GL_SGIX_pixel_texture_bits 1\n\n#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits)\n\n#endif /* GL_SGIX_pixel_texture_bits */\n\n/* ------------------------ GL_SGIX_reference_plane ------------------------ */\n\n#ifndef GL_SGIX_reference_plane\n#define GL_SGIX_reference_plane 1\n\ntypedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation);\n\n#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX)\n\n#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane)\n\n#endif /* GL_SGIX_reference_plane */\n\n/* ---------------------------- GL_SGIX_resample --------------------------- */\n\n#ifndef GL_SGIX_resample\n#define GL_SGIX_resample 1\n\n#define GL_PACK_RESAMPLE_SGIX 0x842E\n#define GL_UNPACK_RESAMPLE_SGIX 0x842F\n#define GL_RESAMPLE_DECIMATE_SGIX 0x8430\n#define GL_RESAMPLE_REPLICATE_SGIX 0x8433\n#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434\n\n#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample)\n\n#endif /* GL_SGIX_resample */\n\n/* ----------------------------- GL_SGIX_shadow ---------------------------- */\n\n#ifndef GL_SGIX_shadow\n#define GL_SGIX_shadow 1\n\n#define GL_TEXTURE_COMPARE_SGIX 0x819A\n#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B\n#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C\n#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D\n\n#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow)\n\n#endif /* GL_SGIX_shadow */\n\n/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */\n\n#ifndef GL_SGIX_shadow_ambient\n#define GL_SGIX_shadow_ambient 1\n\n#define GL_SHADOW_AMBIENT_SGIX 0x80BF\n\n#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient)\n\n#endif /* GL_SGIX_shadow_ambient */\n\n/* ----------------------------- GL_SGIX_sprite ---------------------------- */\n\n#ifndef GL_SGIX_sprite\n#define GL_SGIX_sprite 1\n\ntypedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);\ntypedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);\ntypedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params);\n\n#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX)\n#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX)\n#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX)\n#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX)\n\n#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite)\n\n#endif /* GL_SGIX_sprite */\n\n/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */\n\n#ifndef GL_SGIX_tag_sample_buffer\n#define GL_SGIX_tag_sample_buffer 1\n\ntypedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);\n\n#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX)\n\n#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer)\n\n#endif /* GL_SGIX_tag_sample_buffer */\n\n/* ------------------------ GL_SGIX_texture_add_env ------------------------ */\n\n#ifndef GL_SGIX_texture_add_env\n#define GL_SGIX_texture_add_env 1\n\n#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env)\n\n#endif /* GL_SGIX_texture_add_env */\n\n/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */\n\n#ifndef GL_SGIX_texture_coordinate_clamp\n#define GL_SGIX_texture_coordinate_clamp 1\n\n#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369\n#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A\n#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B\n\n#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp)\n\n#endif /* GL_SGIX_texture_coordinate_clamp */\n\n/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */\n\n#ifndef GL_SGIX_texture_lod_bias\n#define GL_SGIX_texture_lod_bias 1\n\n#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias)\n\n#endif /* GL_SGIX_texture_lod_bias */\n\n/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */\n\n#ifndef GL_SGIX_texture_multi_buffer\n#define GL_SGIX_texture_multi_buffer 1\n\n#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E\n\n#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer)\n\n#endif /* GL_SGIX_texture_multi_buffer */\n\n/* ------------------------- GL_SGIX_texture_range ------------------------- */\n\n#ifndef GL_SGIX_texture_range\n#define GL_SGIX_texture_range 1\n\n#define GL_RGB_SIGNED_SGIX 0x85E0\n#define GL_RGBA_SIGNED_SGIX 0x85E1\n#define GL_ALPHA_SIGNED_SGIX 0x85E2\n#define GL_LUMINANCE_SIGNED_SGIX 0x85E3\n#define GL_INTENSITY_SIGNED_SGIX 0x85E4\n#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5\n#define GL_RGB16_SIGNED_SGIX 0x85E6\n#define GL_RGBA16_SIGNED_SGIX 0x85E7\n#define GL_ALPHA16_SIGNED_SGIX 0x85E8\n#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9\n#define GL_INTENSITY16_SIGNED_SGIX 0x85EA\n#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB\n#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC\n#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED\n#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE\n#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF\n#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0\n#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1\n#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2\n#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3\n#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4\n#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5\n#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6\n#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7\n#define GL_MIN_LUMINANCE_SGIS 0x85F8\n#define GL_MAX_LUMINANCE_SGIS 0x85F9\n#define GL_MIN_INTENSITY_SGIS 0x85FA\n#define GL_MAX_INTENSITY_SGIS 0x85FB\n\n#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range)\n\n#endif /* GL_SGIX_texture_range */\n\n/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */\n\n#ifndef GL_SGIX_texture_scale_bias\n#define GL_SGIX_texture_scale_bias 1\n\n#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179\n#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A\n#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B\n#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C\n\n#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias)\n\n#endif /* GL_SGIX_texture_scale_bias */\n\n/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */\n\n#ifndef GL_SGIX_vertex_preclip\n#define GL_SGIX_vertex_preclip 1\n\n#define GL_VERTEX_PRECLIP_SGIX 0x83EE\n#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF\n\n#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip)\n\n#endif /* GL_SGIX_vertex_preclip */\n\n/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */\n\n#ifndef GL_SGIX_vertex_preclip_hint\n#define GL_SGIX_vertex_preclip_hint 1\n\n#define GL_VERTEX_PRECLIP_SGIX 0x83EE\n#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF\n\n#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint)\n\n#endif /* GL_SGIX_vertex_preclip_hint */\n\n/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */\n\n#ifndef GL_SGIX_ycrcb\n#define GL_SGIX_ycrcb 1\n\n#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb)\n\n#endif /* GL_SGIX_ycrcb */\n\n/* -------------------------- GL_SGI_color_matrix -------------------------- */\n\n#ifndef GL_SGI_color_matrix\n#define GL_SGI_color_matrix 1\n\n#define GL_COLOR_MATRIX_SGI 0x80B1\n#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2\n#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3\n#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4\n#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5\n#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6\n#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7\n#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8\n#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9\n#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA\n#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB\n\n#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix)\n\n#endif /* GL_SGI_color_matrix */\n\n/* --------------------------- GL_SGI_color_table -------------------------- */\n\n#ifndef GL_SGI_color_table\n#define GL_SGI_color_table 1\n\n#define GL_COLOR_TABLE_SGI 0x80D0\n#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1\n#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2\n#define GL_PROXY_COLOR_TABLE_SGI 0x80D3\n#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4\n#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5\n#define GL_COLOR_TABLE_SCALE_SGI 0x80D6\n#define GL_COLOR_TABLE_BIAS_SGI 0x80D7\n#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8\n#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9\n#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA\n#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB\n#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC\n#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD\n#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE\n#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF\n\ntypedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params);\ntypedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table);\ntypedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params);\ntypedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table);\n\n#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI)\n#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI)\n#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI)\n#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI)\n#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI)\n#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI)\n#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI)\n\n#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table)\n\n#endif /* GL_SGI_color_table */\n\n/* ----------------------- GL_SGI_texture_color_table ---------------------- */\n\n#ifndef GL_SGI_texture_color_table\n#define GL_SGI_texture_color_table 1\n\n#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC\n#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD\n\n#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table)\n\n#endif /* GL_SGI_texture_color_table */\n\n/* ------------------------- GL_SUNX_constant_data ------------------------- */\n\n#ifndef GL_SUNX_constant_data\n#define GL_SUNX_constant_data 1\n\n#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5\n#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6\n\ntypedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void);\n\n#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX)\n\n#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data)\n\n#endif /* GL_SUNX_constant_data */\n\n/* -------------------- GL_SUN_convolution_border_modes -------------------- */\n\n#ifndef GL_SUN_convolution_border_modes\n#define GL_SUN_convolution_border_modes 1\n\n#define GL_WRAP_BORDER_SUN 0x81D4\n\n#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes)\n\n#endif /* GL_SUN_convolution_border_modes */\n\n/* -------------------------- GL_SUN_global_alpha -------------------------- */\n\n#ifndef GL_SUN_global_alpha\n#define GL_SUN_global_alpha 1\n\n#define GL_GLOBAL_ALPHA_SUN 0x81D9\n#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA\n\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);\ntypedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);\n\n#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN)\n#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN)\n#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN)\n#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN)\n#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN)\n#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN)\n#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN)\n#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN)\n\n#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha)\n\n#endif /* GL_SUN_global_alpha */\n\n/* --------------------------- GL_SUN_mesh_array --------------------------- */\n\n#ifndef GL_SUN_mesh_array\n#define GL_SUN_mesh_array 1\n\n#define GL_QUAD_MESH_SUN 0x8614\n#define GL_TRIANGLE_MESH_SUN 0x8615\n\n#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array)\n\n#endif /* GL_SUN_mesh_array */\n\n/* ------------------------ GL_SUN_read_video_pixels ----------------------- */\n\n#ifndef GL_SUN_read_video_pixels\n#define GL_SUN_read_video_pixels 1\n\ntypedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);\n\n#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN)\n\n#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels)\n\n#endif /* GL_SUN_read_video_pixels */\n\n/* --------------------------- GL_SUN_slice_accum -------------------------- */\n\n#ifndef GL_SUN_slice_accum\n#define GL_SUN_slice_accum 1\n\n#define GL_SLICE_ACCUM_SUN 0x85CC\n\n#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum)\n\n#endif /* GL_SUN_slice_accum */\n\n/* -------------------------- GL_SUN_triangle_list ------------------------- */\n\n#ifndef GL_SUN_triangle_list\n#define GL_SUN_triangle_list 1\n\n#define GL_RESTART_SUN 0x01\n#define GL_REPLACE_MIDDLE_SUN 0x02\n#define GL_REPLACE_OLDEST_SUN 0x03\n#define GL_TRIANGLE_LIST_SUN 0x81D7\n#define GL_REPLACEMENT_CODE_SUN 0x81D8\n#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0\n#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1\n#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2\n#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3\n#define GL_R1UI_V3F_SUN 0x85C4\n#define GL_R1UI_C4UB_V3F_SUN 0x85C5\n#define GL_R1UI_C3F_V3F_SUN 0x85C6\n#define GL_R1UI_N3F_V3F_SUN 0x85C7\n#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8\n#define GL_R1UI_T2F_V3F_SUN 0x85C9\n#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA\n#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB\n\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code);\n\n#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN)\n#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN)\n#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN)\n#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN)\n#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN)\n#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN)\n#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN)\n\n#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list)\n\n#endif /* GL_SUN_triangle_list */\n\n/* ----------------------------- GL_SUN_vertex ----------------------------- */\n\n#ifndef GL_SUN_vertex\n#define GL_SUN_vertex 1\n\ntypedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);\ntypedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v);\n\n#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN)\n#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN)\n#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN)\n#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN)\n#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN)\n#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN)\n#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN)\n#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN)\n#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN)\n#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN)\n#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN)\n#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN)\n#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN)\n#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN)\n#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN)\n#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN)\n#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN)\n#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN)\n#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)\n#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)\n#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)\n#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)\n#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN)\n#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN)\n#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN)\n#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN)\n#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN)\n#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN)\n#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN)\n#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN)\n#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN)\n#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN)\n#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN)\n#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN)\n#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN)\n#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN)\n#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN)\n#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN)\n#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN)\n#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN)\n\n#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex)\n\n#endif /* GL_SUN_vertex */\n\n/* -------------------------- GL_WIN_phong_shading ------------------------- */\n\n#ifndef GL_WIN_phong_shading\n#define GL_WIN_phong_shading 1\n\n#define GL_PHONG_WIN 0x80EA\n#define GL_PHONG_HINT_WIN 0x80EB\n\n#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading)\n\n#endif /* GL_WIN_phong_shading */\n\n/* -------------------------- GL_WIN_specular_fog -------------------------- */\n\n#ifndef GL_WIN_specular_fog\n#define GL_WIN_specular_fog 1\n\n#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC\n\n#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog)\n\n#endif /* GL_WIN_specular_fog */\n\n/* ---------------------------- GL_WIN_swap_hint --------------------------- */\n\n#ifndef GL_WIN_swap_hint\n#define GL_WIN_swap_hint 1\n\ntypedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height);\n\n#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN)\n\n#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint)\n\n#endif /* GL_WIN_swap_hint */\n\n/* ------------------------------------------------------------------------- */\n\n#if defined(GLEW_MX) && defined(_WIN32)\n#define GLEW_FUN_EXPORT\n#else\n#define GLEW_FUN_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n\n#if defined(GLEW_MX)\n#define GLEW_VAR_EXPORT\n#else\n#define GLEW_VAR_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n\n#if defined(GLEW_MX) && defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */\n\nGLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D;\nGLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements;\nGLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D;\nGLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D;\n\nGLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture;\nGLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D;\nGLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage;\nGLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd;\nGLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf;\nGLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd;\nGLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv;\nGLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage;\n\nGLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor;\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation;\nGLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate;\nGLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer;\nGLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd;\nGLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv;\nGLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf;\nGLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv;\nGLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays;\nGLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements;\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf;\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv;\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri;\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv;\n\nGLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery;\nGLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer;\nGLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData;\nGLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData;\nGLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers;\nGLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries;\nGLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery;\nGLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers;\nGLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries;\nGLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv;\nGLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv;\nGLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData;\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv;\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv;\nGLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv;\nGLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer;\nGLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery;\nGLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer;\nGLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer;\n\nGLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader;\nGLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation;\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate;\nGLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader;\nGLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram;\nGLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader;\nGLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram;\nGLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader;\nGLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader;\nGLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray;\nGLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers;\nGLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray;\nGLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib;\nGLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform;\nGLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders;\nGLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv;\nGLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog;\nGLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource;\nGLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv;\nGLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram;\nGLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader;\nGLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram;\nGLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource;\nGLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate;\nGLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate;\nGLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate;\nGLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f;\nGLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv;\nGLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i;\nGLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv;\nGLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f;\nGLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv;\nGLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i;\nGLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv;\nGLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f;\nGLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv;\nGLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i;\nGLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv;\nGLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f;\nGLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv;\nGLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i;\nGLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv;\nGLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram;\nGLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer;\n\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv;\n\nGLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender;\nGLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback;\nGLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation;\nGLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor;\nGLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi;\nGLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv;\nGLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv;\nGLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv;\nGLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski;\nGLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei;\nGLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei;\nGLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender;\nGLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback;\nGLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v;\nGLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation;\nGLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi;\nGLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv;\nGLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv;\nGLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv;\nGLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi;\nGLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv;\nGLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv;\nGLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings;\nGLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui;\nGLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv;\nGLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui;\nGLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv;\nGLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui;\nGLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv;\nGLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui;\nGLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer;\n\nGLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced;\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced;\nGLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex;\nGLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer;\n\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture;\nGLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v;\nGLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v;\n\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor;\n\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei;\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi;\nGLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei;\nGLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci;\nGLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading;\n\nGLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX;\n\nGLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD;\nGLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD;\nGLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD;\nGLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD;\n\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD;\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD;\nGLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD;\nGLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD;\n\nGLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD;\nGLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD;\n\nGLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD;\nGLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD;\nGLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD;\n\nGLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD;\nGLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD;\nGLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD;\nGLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD;\nGLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD;\nGLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD;\nGLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD;\nGLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD;\nGLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD;\nGLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD;\nGLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD;\n\nGLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD;\n\nGLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD;\nGLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD;\n\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE;\nGLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE;\nGLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE;\nGLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE;\nGLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE;\n\nGLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE;\nGLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE;\nGLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE;\nGLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE;\nGLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE;\nGLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE;\nGLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE;\nGLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE;\n\nGLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE;\nGLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE;\n\nGLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE;\nGLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE;\nGLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE;\n\nGLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE;\nGLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE;\n\nGLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE;\nGLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE;\nGLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE;\nGLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE;\n\nGLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE;\n\nGLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE;\nGLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE;\nGLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE;\nGLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE;\nGLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE;\nGLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE;\nGLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE;\n\nGLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf;\nGLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef;\nGLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat;\nGLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler;\nGLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary;\n\nGLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance;\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance;\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance;\n\nGLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed;\nGLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex;\n\nGLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB;\n\nGLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB;\n\nGLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData;\n\nGLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB;\nGLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB;\nGLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB;\nGLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB;\n\nGLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB;\n\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB;\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB;\nGLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB;\nGLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB;\n\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex;\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex;\nGLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex;\nGLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex;\n\nGLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect;\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect;\n\nGLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer;\nGLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer;\nGLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer;\nGLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;\nGLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers;\nGLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer;\nGLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers;\nGLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers;\nGLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap;\nGLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv;\nGLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv;\nGLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer;\nGLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer;\nGLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage;\nGLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample;\n\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB;\n\nGLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary;\nGLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri;\n\nGLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d;\nGLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv;\nGLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d;\nGLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv;\nGLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d;\nGLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv;\nGLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d;\nGLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv;\n\nGLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable;\nGLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable;\nGLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv;\nGLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv;\nGLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable;\nGLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable;\nGLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D;\nGLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv;\nGLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter;\nGLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv;\nGLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv;\nGLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram;\nGLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv;\nGLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv;\nGLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax;\nGLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv;\nGLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv;\nGLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter;\nGLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram;\nGLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax;\nGLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram;\nGLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax;\nGLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D;\n\nGLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB;\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB;\n\nGLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ;\n\nGLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange;\nGLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange;\n\nGLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB;\nGLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB;\nGLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB;\nGLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB;\nGLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB;\n\nGLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB;\n\nGLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB;\nGLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB;\n\nGLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB;\nGLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB;\nGLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB;\nGLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB;\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB;\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB;\nGLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB;\nGLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB;\n\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB;\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB;\n\nGLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex;\n\nGLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB;\nGLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB;\nGLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB;\nGLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB;\nGLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB;\nGLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB;\nGLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB;\nGLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB;\nGLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB;\nGLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB;\nGLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB;\nGLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB;\nGLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB;\nGLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB;\nGLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB;\nGLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB;\nGLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB;\nGLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB;\nGLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB;\nGLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB;\n\nGLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB;\n\nGLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler;\nGLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers;\nGLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers;\nGLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv;\nGLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv;\nGLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv;\nGLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv;\nGLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler;\nGLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv;\nGLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv;\nGLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf;\nGLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv;\nGLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri;\nGLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv;\n\nGLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram;\nGLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline;\nGLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv;\nGLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines;\nGLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv;\nGLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv;\nGLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages;\nGLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline;\n\nGLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv;\n\nGLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture;\nGLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier;\n\nGLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB;\nGLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB;\nGLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB;\nGLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB;\nGLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB;\nGLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB;\nGLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB;\nGLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB;\nGLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB;\nGLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB;\nGLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB;\nGLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB;\nGLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB;\nGLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB;\nGLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB;\nGLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB;\nGLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB;\nGLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB;\nGLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB;\n\nGLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName;\nGLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName;\nGLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv;\nGLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex;\nGLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv;\nGLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv;\n\nGLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB;\nGLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB;\nGLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB;\nGLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB;\nGLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB;\nGLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB;\n\nGLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync;\nGLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync;\nGLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync;\nGLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v;\nGLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv;\nGLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync;\nGLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync;\n\nGLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv;\nGLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri;\n\nGLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB;\n\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB;\nGLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB;\n\nGLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv;\nGLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski;\nGLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample;\nGLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample;\n\nGLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D;\nGLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D;\nGLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D;\nGLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT;\nGLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT;\nGLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT;\n\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v;\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v;\nGLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter;\n\nGLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback;\nGLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks;\nGLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback;\nGLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks;\nGLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback;\nGLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback;\nGLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback;\n\nGLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed;\nGLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream;\nGLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed;\nGLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv;\n\nGLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced;\nGLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced;\n\nGLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB;\nGLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB;\nGLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB;\nGLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB;\n\nGLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase;\nGLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange;\nGLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName;\nGLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv;\nGLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName;\nGLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv;\nGLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices;\nGLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding;\n\nGLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray;\nGLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays;\nGLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays;\nGLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray;\n\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer;\n\nGLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB;\nGLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB;\n\nGLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB;\nGLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB;\nGLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB;\nGLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB;\nGLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB;\nGLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB;\nGLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB;\nGLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB;\nGLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB;\nGLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB;\nGLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB;\n\nGLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB;\nGLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB;\nGLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB;\nGLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB;\nGLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB;\nGLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB;\nGLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB;\n\nGLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB;\nGLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB;\nGLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB;\n\nGLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui;\nGLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv;\nGLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui;\nGLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv;\nGLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui;\nGLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui;\nGLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui;\nGLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui;\nGLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv;\nGLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui;\nGLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv;\n\nGLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv;\nGLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed;\nGLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v;\nGLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v;\nGLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv;\nGLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed;\nGLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv;\nGLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv;\nGLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf;\nGLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv;\n\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB;\n\nGLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI;\n\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI;\nGLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI;\nGLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI;\n\nGLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI;\nGLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI;\nGLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI;\nGLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI;\n\nGLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI;\nGLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI;\nGLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI;\nGLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI;\nGLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI;\nGLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI;\nGLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI;\nGLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI;\nGLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI;\nGLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI;\nGLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI;\nGLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI;\nGLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI;\nGLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI;\n\nGLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI;\nGLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI;\n\nGLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI;\nGLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI;\n\nGLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI;\nGLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI;\n\nGLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI;\nGLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI;\nGLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI;\nGLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI;\nGLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI;\nGLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI;\nGLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI;\nGLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI;\nGLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI;\nGLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI;\nGLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI;\nGLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI;\n\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI;\n\nGLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI;\nGLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI;\nGLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI;\nGLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI;\nGLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI;\n\nGLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT;\n\nGLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT;\n\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT;\n\nGLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT;\n\nGLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT;\n\nGLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT;\nGLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT;\n\nGLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT;\nGLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT;\n\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT;\nGLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT;\nGLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT;\nGLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT;\nGLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT;\nGLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT;\n\nGLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT;\nGLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT;\n\nGLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT;\n\nGLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT;\nGLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT;\n\nGLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT;\n\nGLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT;\nGLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT;\nGLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT;\nGLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT;\nGLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT;\nGLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT;\nGLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT;\nGLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT;\nGLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT;\nGLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT;\nGLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT;\nGLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT;\nGLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT;\nGLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT;\nGLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT;\nGLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT;\nGLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT;\nGLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT;\nGLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT;\nGLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT;\nGLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT;\nGLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT;\nGLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT;\nGLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT;\nGLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT;\nGLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT;\nGLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT;\nGLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT;\nGLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT;\nGLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT;\nGLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT;\nGLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT;\nGLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT;\nGLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT;\n\nGLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT;\nGLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT;\nGLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT;\nGLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT;\nGLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT;\nGLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT;\n\nGLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT;\nGLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT;\n\nGLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT;\n\nGLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT;\nGLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT;\nGLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT;\nGLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT;\nGLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT;\n\nGLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT;\nGLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT;\n\nGLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT;\n\nGLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT;\n\nGLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT;\nGLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT;\nGLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT;\nGLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT;\nGLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT;\nGLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT;\nGLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT;\nGLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT;\nGLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT;\nGLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT;\nGLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT;\nGLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT;\n\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT;\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT;\n\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT;\n\nGLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT;\nGLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT;\nGLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT;\n\nGLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT;\nGLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT;\nGLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT;\nGLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT;\nGLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT;\nGLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT;\nGLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT;\nGLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT;\n\nGLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT;\n\nGLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT;\n\nGLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT;\nGLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT;\nGLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT;\n\nGLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT;\nGLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT;\n\nGLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT;\nGLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT;\n\nGLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT;\n\nGLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT;\nGLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT;\nGLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT;\nGLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT;\nGLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT;\n\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT;\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT;\n\nGLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT;\n\nGLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT;\n\nGLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT;\nGLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT;\n\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT;\n\nGLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT;\nGLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT;\nGLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT;\n\nGLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT;\nGLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT;\n\nGLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT;\n\nGLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT;\nGLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT;\nGLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT;\n\nGLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT;\n\nGLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT;\n\nGLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT;\n\nGLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT;\nGLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT;\nGLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT;\nGLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT;\nGLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT;\n\nGLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT;\nGLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT;\nGLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT;\nGLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT;\nGLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT;\nGLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT;\n\nGLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT;\n\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT;\nGLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT;\n\nGLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT;\nGLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT;\nGLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT;\nGLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT;\nGLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT;\nGLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT;\nGLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT;\n\nGLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT;\nGLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT;\nGLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT;\nGLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT;\nGLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT;\nGLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT;\nGLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT;\n\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT;\n\nGLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT;\nGLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT;\nGLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT;\nGLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT;\nGLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT;\nGLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT;\nGLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT;\nGLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT;\nGLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT;\nGLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT;\nGLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT;\nGLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT;\nGLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT;\nGLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT;\nGLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT;\nGLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT;\nGLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT;\nGLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT;\nGLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT;\nGLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT;\nGLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT;\nGLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT;\nGLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT;\nGLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT;\nGLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT;\nGLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT;\nGLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT;\nGLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT;\nGLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT;\nGLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT;\nGLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT;\nGLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT;\nGLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT;\nGLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT;\n\nGLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT;\nGLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT;\n\nGLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT;\n\nGLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY;\n\nGLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY;\n\nGLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP;\nGLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP;\nGLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP;\nGLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP;\nGLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP;\nGLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP;\n\nGLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM;\nGLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM;\n\nGLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM;\nGLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM;\nGLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM;\nGLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM;\nGLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM;\nGLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM;\nGLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM;\n\nGLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL;\nGLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL;\nGLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL;\nGLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL;\n\nGLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL;\nGLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL;\n\nGLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled;\nGLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion;\nGLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion;\nGLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion;\nGLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion;\n\nGLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA;\n\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA;\nGLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA;\n\nGLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV;\nGLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV;\n\nGLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV;\n\nGLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV;\nGLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV;\nGLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV;\n\nGLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV;\nGLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV;\nGLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV;\nGLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV;\nGLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV;\nGLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV;\nGLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV;\n\nGLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV;\nGLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV;\nGLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV;\n\nGLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV;\nGLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV;\nGLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV;\nGLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV;\nGLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV;\nGLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV;\nGLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV;\n\nGLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV;\n\nGLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV;\n\nGLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV;\n\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV;\n\nGLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV;\nGLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV;\n\nGLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV;\nGLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV;\nGLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV;\nGLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV;\nGLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV;\nGLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV;\nGLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV;\nGLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV;\nGLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV;\nGLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV;\nGLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV;\nGLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV;\nGLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV;\n\nGLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV;\nGLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV;\nGLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV;\nGLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV;\nGLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV;\nGLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV;\nGLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV;\n\nGLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV;\n\nGLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV;\nGLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV;\nGLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV;\nGLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV;\nGLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV;\nGLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV;\nGLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV;\nGLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV;\nGLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV;\nGLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV;\nGLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV;\nGLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV;\nGLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV;\nGLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV;\nGLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV;\nGLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV;\nGLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV;\nGLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV;\nGLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV;\nGLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV;\nGLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV;\nGLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV;\nGLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV;\nGLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV;\nGLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV;\nGLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV;\nGLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV;\nGLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV;\nGLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV;\nGLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV;\nGLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV;\nGLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV;\nGLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV;\nGLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV;\nGLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV;\nGLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV;\nGLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV;\nGLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV;\nGLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV;\nGLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV;\nGLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV;\nGLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV;\nGLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV;\nGLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV;\nGLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV;\nGLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV;\nGLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV;\nGLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV;\n\nGLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV;\nGLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV;\n\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV;\nGLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV;\n\nGLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV;\nGLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV;\nGLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV;\nGLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV;\nGLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV;\nGLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV;\n\nGLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV;\nGLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV;\n\nGLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV;\nGLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV;\nGLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV;\nGLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV;\nGLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV;\nGLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV;\nGLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV;\nGLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV;\nGLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV;\nGLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV;\n\nGLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV;\n\nGLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV;\nGLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV;\nGLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV;\nGLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV;\nGLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV;\nGLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV;\nGLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV;\nGLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV;\nGLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV;\nGLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV;\nGLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV;\nGLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV;\n\nGLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV;\n\nGLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV;\nGLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV;\nGLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV;\nGLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV;\nGLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV;\nGLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV;\n\nGLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV;\nGLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV;\nGLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV;\nGLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV;\nGLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV;\nGLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV;\nGLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV;\nGLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV;\nGLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV;\nGLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV;\nGLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV;\n\nGLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV;\nGLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV;\nGLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV;\nGLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV;\nGLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV;\nGLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV;\nGLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV;\n\nGLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV;\nGLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV;\nGLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV;\nGLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV;\nGLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV;\nGLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV;\nGLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV;\nGLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV;\nGLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV;\nGLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV;\n\nGLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV;\nGLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV;\n\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV;\n\nGLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV;\nGLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV;\nGLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV;\nGLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV;\nGLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV;\nGLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV;\nGLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV;\nGLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV;\nGLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV;\nGLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV;\n\nGLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV;\nGLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV;\nGLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV;\nGLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV;\nGLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV;\nGLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV;\nGLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV;\nGLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV;\nGLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV;\nGLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV;\nGLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV;\nGLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV;\nGLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV;\nGLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV;\n\nGLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV;\nGLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV;\nGLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV;\nGLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV;\nGLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV;\nGLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV;\nGLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV;\nGLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV;\nGLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV;\nGLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV;\nGLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV;\nGLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV;\n\nGLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES;\nGLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES;\nGLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES;\nGLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES;\nGLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES;\nGLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES;\n\nGLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS;\nGLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS;\n\nGLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS;\nGLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS;\n\nGLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS;\nGLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS;\n\nGLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS;\nGLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS;\n\nGLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS;\nGLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS;\n\nGLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS;\nGLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS;\n\nGLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX;\nGLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX;\nGLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX;\nGLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX;\nGLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX;\nGLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX;\n\nGLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX;\n\nGLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX;\n\nGLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX;\nGLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX;\nGLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX;\n\nGLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX;\n\nGLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX;\n\nGLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX;\n\nGLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX;\nGLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX;\nGLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX;\nGLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX;\n\nGLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX;\n\nGLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI;\nGLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI;\nGLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI;\nGLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI;\nGLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI;\n\nGLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX;\n\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN;\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN;\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN;\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN;\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN;\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN;\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN;\nGLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN;\n\nGLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN;\n\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN;\n\nGLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN;\nGLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN;\nGLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN;\nGLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN;\n\nGLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN;\n\n#if defined(GLEW_MX) && !defined(_WIN32)\nstruct GLEWContextStruct\n{\n#endif /* GLEW_MX */\n\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2;\nGLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer;\nGLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles;\nGLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators;\nGLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting;\nGLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator;\nGLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker;\nGLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes;\nGLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform;\nGLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test;\nGLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting;\nGLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex;\nGLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays;\nGLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip;\nGLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data;\nGLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat;\nGLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists;\nGLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read;\nGLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays;\nGLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor;\nGLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region;\nGLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack;\nGLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert;\nGLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers;\nGLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos;\nGLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_fence;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4;\nGLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture;\nGLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates;\nGLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format;\nGLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision;\nGLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace;\nGLEW_VAR_EXPORT GLboolean __GLEW_OML_resample;\nGLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample;\nGLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints;\nGLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints;\nGLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates;\nGLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table;\nGLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list;\nGLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex;\nGLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading;\nGLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog;\nGLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint;\n\n#ifdef GLEW_MX\n}; /* GLEWContextStruct */\n#endif /* GLEW_MX */\n\n/* ------------------------------------------------------------------------- */\n\n/* error codes */\n#define GLEW_OK 0\n#define GLEW_NO_ERROR 0\n#define GLEW_ERROR_NO_GL_VERSION 1  /* missing GL version */\n#define GLEW_ERROR_GL_VERSION_10_ONLY 2  /* Need at least OpenGL 1.1 */\n#define GLEW_ERROR_GLX_VERSION_11_ONLY 3  /* Need at least GLX 1.2 */\n\n/* string codes */\n#define GLEW_VERSION 1\n#define GLEW_VERSION_MAJOR 2\n#define GLEW_VERSION_MINOR 3\n#define GLEW_VERSION_MICRO 4\n\n/* API */\n#ifdef GLEW_MX\n\ntypedef struct GLEWContextStruct GLEWContext;\nGLEWAPI GLenum glewContextInit (GLEWContext* ctx);\nGLEWAPI GLboolean glewContextIsSupported (const GLEWContext* ctx, const char* name);\n\n#define glewInit() glewContextInit(glewGetContext())\n#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x)\n#define glewIsExtensionSupported(x) glewIsSupported(x)\n\n#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x))\n#ifdef _WIN32\n#  define GLEW_GET_FUN(x) glewGetContext()->x\n#else\n#  define GLEW_GET_FUN(x) x\n#endif\n\n#else /* GLEW_MX */\n\nGLEWAPI GLenum glewInit ();\nGLEWAPI GLboolean glewIsSupported (const char* name);\n#define glewIsExtensionSupported(x) glewIsSupported(x)\n\n#define GLEW_GET_VAR(x) (*(const GLboolean*)&x)\n#define GLEW_GET_FUN(x) x\n\n#endif /* GLEW_MX */\n\nGLEWAPI GLboolean glewExperimental;\nGLEWAPI GLboolean glewGetExtension (const char* name);\nGLEWAPI const GLubyte* glewGetErrorString (GLenum error);\nGLEWAPI const GLubyte* glewGetString (GLenum name);\n\n#ifdef __cplusplus\n}\n#endif\n\n#ifdef GLEW_APIENTRY_DEFINED\n#undef GLEW_APIENTRY_DEFINED\n#undef APIENTRY\n#undef GLAPIENTRY\n#define GLAPIENTRY\n#endif\n\n#ifdef GLEW_CALLBACK_DEFINED\n#undef GLEW_CALLBACK_DEFINED\n#undef CALLBACK\n#endif\n\n#ifdef GLEW_WINGDIAPI_DEFINED\n#undef GLEW_WINGDIAPI_DEFINED\n#undef WINGDIAPI\n#endif\n\n#undef GLAPI\n/* #undef GLEWAPI */\n\n#endif /* __glew_h__ */\n"
  },
  {
    "path": "cocos2d/external/win32-specific/gles/include/OGLES/GL/glxew.h",
    "content": "/*\n** The OpenGL Extension Wrangler Library\n** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\n** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\n** Copyright (C) 2002, Lev Povalahev\n** All rights reserved.\n** \n** Redistribution and use in source and binary forms, with or without \n** modification, are permitted provided that the following conditions are met:\n** \n** * Redistributions of source code must retain the above copyright notice, \n**   this list of conditions and the following disclaimer.\n** * Redistributions in binary form must reproduce the above copyright notice, \n**   this list of conditions and the following disclaimer in the documentation \n**   and/or other materials provided with the distribution.\n** * The name of the author may be used to endorse or promote products \n**   derived from this software without specific prior written permission.\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \n** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n** THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*\n * Mesa 3-D graphics library\n * Version:  7.0\n *\n * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n/*\n** Copyright (c) 2007 The Khronos Group Inc.\n** \n** Permission is hereby granted, free of charge, to any person obtaining a\n** copy of this software and/or associated documentation files (the\n** \"Materials\"), to deal in the Materials without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Materials, and to\n** permit persons to whom the Materials are furnished to do so, subject to\n** the following conditions:\n** \n** The above copyright notice and this permission notice shall be included\n** in all copies or substantial portions of the Materials.\n** \n** THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n*/\n\n#ifndef __glxew_h__\n#define __glxew_h__\n#define __GLXEW_H__\n\n#ifdef __glxext_h_\n#error glxext.h included before glxew.h\n#endif\n\n#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__)\n#error glx.h included before glxew.h\n#endif\n\n#define __glxext_h_\n\n#define GLX_H\n#define __GLX_glx_h__\n#define __glx_h__\n\n#include <X11/Xlib.h>\n#include <X11/Xutil.h>\n#include <X11/Xmd.h>\n#include <GL/glew.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* ---------------------------- GLX_VERSION_1_0 --------------------------- */\n\n#ifndef GLX_VERSION_1_0\n#define GLX_VERSION_1_0 1\n\n#define GLX_USE_GL 1\n#define GLX_BUFFER_SIZE 2\n#define GLX_LEVEL 3\n#define GLX_RGBA 4\n#define GLX_DOUBLEBUFFER 5\n#define GLX_STEREO 6\n#define GLX_AUX_BUFFERS 7\n#define GLX_RED_SIZE 8\n#define GLX_GREEN_SIZE 9\n#define GLX_BLUE_SIZE 10\n#define GLX_ALPHA_SIZE 11\n#define GLX_DEPTH_SIZE 12\n#define GLX_STENCIL_SIZE 13\n#define GLX_ACCUM_RED_SIZE 14\n#define GLX_ACCUM_GREEN_SIZE 15\n#define GLX_ACCUM_BLUE_SIZE 16\n#define GLX_ACCUM_ALPHA_SIZE 17\n#define GLX_BAD_SCREEN 1\n#define GLX_BAD_ATTRIBUTE 2\n#define GLX_NO_EXTENSION 3\n#define GLX_BAD_VISUAL 4\n#define GLX_BAD_CONTEXT 5\n#define GLX_BAD_VALUE 6\n#define GLX_BAD_ENUM 7\n\ntypedef XID GLXDrawable;\ntypedef XID GLXPixmap;\n#ifdef __sun\ntypedef struct __glXContextRec *GLXContext;\n#else\ntypedef struct __GLXcontextRec *GLXContext;\n#endif\n\ntypedef unsigned int GLXVideoDeviceNV; \n\nextern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase);\nextern Bool glXQueryVersion (Display *dpy, int *major, int *minor);\nextern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value);\nextern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList);\nextern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap);\nextern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix);\nextern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);\nextern void glXDestroyContext (Display *dpy, GLXContext ctx);\nextern Bool glXIsDirect (Display *dpy, GLXContext ctx);\nextern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask);\nextern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx);\nextern GLXContext glXGetCurrentContext (void);\nextern GLXDrawable glXGetCurrentDrawable (void);\nextern void glXWaitGL (void);\nextern void glXWaitX (void);\nextern void glXSwapBuffers (Display *dpy, GLXDrawable drawable);\nextern void glXUseXFont (Font font, int first, int count, int listBase);\n\n#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0)\n\n#endif /* GLX_VERSION_1_0 */\n\n/* ---------------------------- GLX_VERSION_1_1 --------------------------- */\n\n#ifndef GLX_VERSION_1_1\n#define GLX_VERSION_1_1\n\n#define GLX_VENDOR 0x1\n#define GLX_VERSION 0x2\n#define GLX_EXTENSIONS 0x3\n\nextern const char* glXQueryExtensionsString (Display *dpy, int screen);\nextern const char* glXGetClientString (Display *dpy, int name);\nextern const char* glXQueryServerString (Display *dpy, int screen, int name);\n\n#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1)\n\n#endif /* GLX_VERSION_1_1 */\n\n/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */\n\n#ifndef GLX_VERSION_1_2\n#define GLX_VERSION_1_2 1\n\ntypedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void);\n\n#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay)\n\n#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2)\n\n#endif /* GLX_VERSION_1_2 */\n\n/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */\n\n#ifndef GLX_VERSION_1_3\n#define GLX_VERSION_1_3 1\n\n#define GLX_RGBA_BIT 0x00000001\n#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001\n#define GLX_WINDOW_BIT 0x00000001\n#define GLX_COLOR_INDEX_BIT 0x00000002\n#define GLX_PIXMAP_BIT 0x00000002\n#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002\n#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004\n#define GLX_PBUFFER_BIT 0x00000004\n#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008\n#define GLX_AUX_BUFFERS_BIT 0x00000010\n#define GLX_CONFIG_CAVEAT 0x20\n#define GLX_DEPTH_BUFFER_BIT 0x00000020\n#define GLX_X_VISUAL_TYPE 0x22\n#define GLX_TRANSPARENT_TYPE 0x23\n#define GLX_TRANSPARENT_INDEX_VALUE 0x24\n#define GLX_TRANSPARENT_RED_VALUE 0x25\n#define GLX_TRANSPARENT_GREEN_VALUE 0x26\n#define GLX_TRANSPARENT_BLUE_VALUE 0x27\n#define GLX_TRANSPARENT_ALPHA_VALUE 0x28\n#define GLX_STENCIL_BUFFER_BIT 0x00000040\n#define GLX_ACCUM_BUFFER_BIT 0x00000080\n#define GLX_NONE 0x8000\n#define GLX_SLOW_CONFIG 0x8001\n#define GLX_TRUE_COLOR 0x8002\n#define GLX_DIRECT_COLOR 0x8003\n#define GLX_PSEUDO_COLOR 0x8004\n#define GLX_STATIC_COLOR 0x8005\n#define GLX_GRAY_SCALE 0x8006\n#define GLX_STATIC_GRAY 0x8007\n#define GLX_TRANSPARENT_RGB 0x8008\n#define GLX_TRANSPARENT_INDEX 0x8009\n#define GLX_VISUAL_ID 0x800B\n#define GLX_SCREEN 0x800C\n#define GLX_NON_CONFORMANT_CONFIG 0x800D\n#define GLX_DRAWABLE_TYPE 0x8010\n#define GLX_RENDER_TYPE 0x8011\n#define GLX_X_RENDERABLE 0x8012\n#define GLX_FBCONFIG_ID 0x8013\n#define GLX_RGBA_TYPE 0x8014\n#define GLX_COLOR_INDEX_TYPE 0x8015\n#define GLX_MAX_PBUFFER_WIDTH 0x8016\n#define GLX_MAX_PBUFFER_HEIGHT 0x8017\n#define GLX_MAX_PBUFFER_PIXELS 0x8018\n#define GLX_PRESERVED_CONTENTS 0x801B\n#define GLX_LARGEST_PBUFFER 0x801C\n#define GLX_WIDTH 0x801D\n#define GLX_HEIGHT 0x801E\n#define GLX_EVENT_MASK 0x801F\n#define GLX_DAMAGED 0x8020\n#define GLX_SAVED 0x8021\n#define GLX_WINDOW 0x8022\n#define GLX_PBUFFER 0x8023\n#define GLX_PBUFFER_HEIGHT 0x8040\n#define GLX_PBUFFER_WIDTH 0x8041\n#define GLX_PBUFFER_CLOBBER_MASK 0x08000000\n#define GLX_DONT_CARE 0xFFFFFFFF\n\ntypedef XID GLXFBConfigID;\ntypedef XID GLXPbuffer;\ntypedef XID GLXWindow;\ntypedef struct __GLXFBConfigRec *GLXFBConfig;\n\ntypedef struct {\n  int event_type; \n  int draw_type; \n  unsigned long serial; \n  Bool send_event; \n  Display *display; \n  GLXDrawable drawable; \n  unsigned int buffer_mask; \n  unsigned int aux_buffer; \n  int x, y; \n  int width, height; \n  int count; \n} GLXPbufferClobberEvent;\ntypedef union __GLXEvent {\n  GLXPbufferClobberEvent glxpbufferclobber; \n  long pad[24]; \n} GLXEvent;\n\ntypedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);\ntypedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);\ntypedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);\ntypedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);\ntypedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);\ntypedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);\ntypedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);\ntypedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);\ntypedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);\ntypedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);\ntypedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);\ntypedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);\ntypedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);\ntypedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);\ntypedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);\ntypedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);\ntypedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);\n\n#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig)\n#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext)\n#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer)\n#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap)\n#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow)\n#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer)\n#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap)\n#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow)\n#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable)\n#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib)\n#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs)\n#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent)\n#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig)\n#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent)\n#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext)\n#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable)\n#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent)\n\n#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3)\n\n#endif /* GLX_VERSION_1_3 */\n\n/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */\n\n#ifndef GLX_VERSION_1_4\n#define GLX_VERSION_1_4 1\n\n#define GLX_SAMPLE_BUFFERS 100000\n#define GLX_SAMPLES 100001\n\nextern void ( * glXGetProcAddress (const GLubyte *procName)) (void);\n\n#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4)\n\n#endif /* GLX_VERSION_1_4 */\n\n/* -------------------------- GLX_3DFX_multisample ------------------------- */\n\n#ifndef GLX_3DFX_multisample\n#define GLX_3DFX_multisample 1\n\n#define GLX_SAMPLE_BUFFERS_3DFX 0x8050\n#define GLX_SAMPLES_3DFX 0x8051\n\n#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample)\n\n#endif /* GLX_3DFX_multisample */\n\n/* ------------------------ GLX_AMD_gpu_association ------------------------ */\n\n#ifndef GLX_AMD_gpu_association\n#define GLX_AMD_gpu_association 1\n\n#define GLX_GPU_VENDOR_AMD 0x1F00\n#define GLX_GPU_RENDERER_STRING_AMD 0x1F01\n#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02\n#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2\n#define GLX_GPU_RAM_AMD 0x21A3\n#define GLX_GPU_CLOCK_AMD 0x21A4\n#define GLX_GPU_NUM_PIPES_AMD 0x21A5\n#define GLX_GPU_NUM_SIMD_AMD 0x21A6\n#define GLX_GPU_NUM_RB_AMD 0x21A7\n#define GLX_GPU_NUM_SPI_AMD 0x21A8\n\n#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association)\n\n#endif /* GLX_AMD_gpu_association */\n\n/* ------------------------- GLX_ARB_create_context ------------------------ */\n\n#ifndef GLX_ARB_create_context\n#define GLX_ARB_create_context 1\n\n#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001\n#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002\n#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091\n#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092\n#define GLX_CONTEXT_FLAGS_ARB 0x2094\n\ntypedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);\n\n#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB)\n\n#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context)\n\n#endif /* GLX_ARB_create_context */\n\n/* --------------------- GLX_ARB_create_context_profile -------------------- */\n\n#ifndef GLX_ARB_create_context_profile\n#define GLX_ARB_create_context_profile 1\n\n#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001\n#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002\n#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126\n\n#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile)\n\n#endif /* GLX_ARB_create_context_profile */\n\n/* ------------------- GLX_ARB_create_context_robustness ------------------- */\n\n#ifndef GLX_ARB_create_context_robustness\n#define GLX_ARB_create_context_robustness 1\n\n#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004\n#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252\n#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256\n#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261\n\n#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness)\n\n#endif /* GLX_ARB_create_context_robustness */\n\n/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */\n\n#ifndef GLX_ARB_fbconfig_float\n#define GLX_ARB_fbconfig_float 1\n\n#define GLX_RGBA_FLOAT_BIT 0x00000004\n#define GLX_RGBA_FLOAT_TYPE 0x20B9\n\n#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float)\n\n#endif /* GLX_ARB_fbconfig_float */\n\n/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */\n\n#ifndef GLX_ARB_framebuffer_sRGB\n#define GLX_ARB_framebuffer_sRGB 1\n\n#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2\n\n#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB)\n\n#endif /* GLX_ARB_framebuffer_sRGB */\n\n/* ------------------------ GLX_ARB_get_proc_address ----------------------- */\n\n#ifndef GLX_ARB_get_proc_address\n#define GLX_ARB_get_proc_address 1\n\nextern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);\n\n#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address)\n\n#endif /* GLX_ARB_get_proc_address */\n\n/* -------------------------- GLX_ARB_multisample -------------------------- */\n\n#ifndef GLX_ARB_multisample\n#define GLX_ARB_multisample 1\n\n#define GLX_SAMPLE_BUFFERS_ARB 100000\n#define GLX_SAMPLES_ARB 100001\n\n#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample)\n\n#endif /* GLX_ARB_multisample */\n\n/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */\n\n#ifndef GLX_ARB_vertex_buffer_object\n#define GLX_ARB_vertex_buffer_object 1\n\n#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095\n\n#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object)\n\n#endif /* GLX_ARB_vertex_buffer_object */\n\n/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */\n\n#ifndef GLX_ATI_pixel_format_float\n#define GLX_ATI_pixel_format_float 1\n\n#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100\n\n#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float)\n\n#endif /* GLX_ATI_pixel_format_float */\n\n/* ------------------------- GLX_ATI_render_texture ------------------------ */\n\n#ifndef GLX_ATI_render_texture\n#define GLX_ATI_render_texture 1\n\n#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800\n#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801\n#define GLX_TEXTURE_FORMAT_ATI 0x9802\n#define GLX_TEXTURE_TARGET_ATI 0x9803\n#define GLX_MIPMAP_TEXTURE_ATI 0x9804\n#define GLX_TEXTURE_RGB_ATI 0x9805\n#define GLX_TEXTURE_RGBA_ATI 0x9806\n#define GLX_NO_TEXTURE_ATI 0x9807\n#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808\n#define GLX_TEXTURE_1D_ATI 0x9809\n#define GLX_TEXTURE_2D_ATI 0x980A\n#define GLX_MIPMAP_LEVEL_ATI 0x980B\n#define GLX_CUBE_MAP_FACE_ATI 0x980C\n#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D\n#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E\n#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F\n#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810\n#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811\n#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812\n#define GLX_FRONT_LEFT_ATI 0x9813\n#define GLX_FRONT_RIGHT_ATI 0x9814\n#define GLX_BACK_LEFT_ATI 0x9815\n#define GLX_BACK_RIGHT_ATI 0x9816\n#define GLX_AUX0_ATI 0x9817\n#define GLX_AUX1_ATI 0x9818\n#define GLX_AUX2_ATI 0x9819\n#define GLX_AUX3_ATI 0x981A\n#define GLX_AUX4_ATI 0x981B\n#define GLX_AUX5_ATI 0x981C\n#define GLX_AUX6_ATI 0x981D\n#define GLX_AUX7_ATI 0x981E\n#define GLX_AUX8_ATI 0x981F\n#define GLX_AUX9_ATI 0x9820\n#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821\n#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822\n\ntypedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);\ntypedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list);\ntypedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);\n\n#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI)\n#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI)\n#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI)\n\n#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture)\n\n#endif /* GLX_ATI_render_texture */\n\n/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */\n\n#ifndef GLX_EXT_create_context_es2_profile\n#define GLX_EXT_create_context_es2_profile 1\n\n#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004\n\n#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile)\n\n#endif /* GLX_EXT_create_context_es2_profile */\n\n/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */\n\n#ifndef GLX_EXT_fbconfig_packed_float\n#define GLX_EXT_fbconfig_packed_float 1\n\n#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008\n#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1\n\n#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float)\n\n#endif /* GLX_EXT_fbconfig_packed_float */\n\n/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */\n\n#ifndef GLX_EXT_framebuffer_sRGB\n#define GLX_EXT_framebuffer_sRGB 1\n\n#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2\n\n#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB)\n\n#endif /* GLX_EXT_framebuffer_sRGB */\n\n/* ------------------------- GLX_EXT_import_context ------------------------ */\n\n#ifndef GLX_EXT_import_context\n#define GLX_EXT_import_context 1\n\n#define GLX_SHARE_CONTEXT_EXT 0x800A\n#define GLX_VISUAL_ID_EXT 0x800B\n#define GLX_SCREEN_EXT 0x800C\n\ntypedef XID GLXContextID;\n\ntypedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context);\ntypedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);\ntypedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID);\ntypedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value);\n\n#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT)\n#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT)\n#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT)\n#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT)\n\n#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context)\n\n#endif /* GLX_EXT_import_context */\n\n/* -------------------------- GLX_EXT_scene_marker ------------------------- */\n\n#ifndef GLX_EXT_scene_marker\n#define GLX_EXT_scene_marker 1\n\n#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker)\n\n#endif /* GLX_EXT_scene_marker */\n\n/* -------------------------- GLX_EXT_swap_control ------------------------- */\n\n#ifndef GLX_EXT_swap_control\n#define GLX_EXT_swap_control 1\n\n#define GLX_SWAP_INTERVAL_EXT 0x20F1\n#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2\n\ntypedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval);\n\n#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT)\n\n#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control)\n\n#endif /* GLX_EXT_swap_control */\n\n/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */\n\n#ifndef GLX_EXT_texture_from_pixmap\n#define GLX_EXT_texture_from_pixmap 1\n\n#define GLX_TEXTURE_1D_BIT_EXT 0x00000001\n#define GLX_TEXTURE_2D_BIT_EXT 0x00000002\n#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004\n#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0\n#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1\n#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2\n#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3\n#define GLX_Y_INVERTED_EXT 0x20D4\n#define GLX_TEXTURE_FORMAT_EXT 0x20D5\n#define GLX_TEXTURE_TARGET_EXT 0x20D6\n#define GLX_MIPMAP_TEXTURE_EXT 0x20D7\n#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8\n#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9\n#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA\n#define GLX_TEXTURE_1D_EXT 0x20DB\n#define GLX_TEXTURE_2D_EXT 0x20DC\n#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD\n#define GLX_FRONT_LEFT_EXT 0x20DE\n#define GLX_FRONT_RIGHT_EXT 0x20DF\n#define GLX_BACK_LEFT_EXT 0x20E0\n#define GLX_BACK_RIGHT_EXT 0x20E1\n#define GLX_AUX0_EXT 0x20E2\n#define GLX_AUX1_EXT 0x20E3\n#define GLX_AUX2_EXT 0x20E4\n#define GLX_AUX3_EXT 0x20E5\n#define GLX_AUX4_EXT 0x20E6\n#define GLX_AUX5_EXT 0x20E7\n#define GLX_AUX6_EXT 0x20E8\n#define GLX_AUX7_EXT 0x20E9\n#define GLX_AUX8_EXT 0x20EA\n#define GLX_AUX9_EXT 0x20EB\n\ntypedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list);\ntypedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer);\n\n#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT)\n#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT)\n\n#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap)\n\n#endif /* GLX_EXT_texture_from_pixmap */\n\n/* -------------------------- GLX_EXT_visual_info -------------------------- */\n\n#ifndef GLX_EXT_visual_info\n#define GLX_EXT_visual_info 1\n\n#define GLX_X_VISUAL_TYPE_EXT 0x22\n#define GLX_TRANSPARENT_TYPE_EXT 0x23\n#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24\n#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25\n#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26\n#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27\n#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28\n#define GLX_NONE_EXT 0x8000\n#define GLX_TRUE_COLOR_EXT 0x8002\n#define GLX_DIRECT_COLOR_EXT 0x8003\n#define GLX_PSEUDO_COLOR_EXT 0x8004\n#define GLX_STATIC_COLOR_EXT 0x8005\n#define GLX_GRAY_SCALE_EXT 0x8006\n#define GLX_STATIC_GRAY_EXT 0x8007\n#define GLX_TRANSPARENT_RGB_EXT 0x8008\n#define GLX_TRANSPARENT_INDEX_EXT 0x8009\n\n#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info)\n\n#endif /* GLX_EXT_visual_info */\n\n/* ------------------------- GLX_EXT_visual_rating ------------------------- */\n\n#ifndef GLX_EXT_visual_rating\n#define GLX_EXT_visual_rating 1\n\n#define GLX_VISUAL_CAVEAT_EXT 0x20\n#define GLX_SLOW_VISUAL_EXT 0x8001\n#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D\n\n#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating)\n\n#endif /* GLX_EXT_visual_rating */\n\n/* -------------------------- GLX_INTEL_swap_event ------------------------- */\n\n#ifndef GLX_INTEL_swap_event\n#define GLX_INTEL_swap_event 1\n\n#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180\n#define GLX_COPY_COMPLETE_INTEL 0x8181\n#define GLX_FLIP_COMPLETE_INTEL 0x8182\n#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000\n\n#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event)\n\n#endif /* GLX_INTEL_swap_event */\n\n/* -------------------------- GLX_MESA_agp_offset -------------------------- */\n\n#ifndef GLX_MESA_agp_offset\n#define GLX_MESA_agp_offset 1\n\ntypedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer);\n\n#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA)\n\n#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset)\n\n#endif /* GLX_MESA_agp_offset */\n\n/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */\n\n#ifndef GLX_MESA_copy_sub_buffer\n#define GLX_MESA_copy_sub_buffer 1\n\ntypedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height);\n\n#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA)\n\n#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer)\n\n#endif /* GLX_MESA_copy_sub_buffer */\n\n/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */\n\n#ifndef GLX_MESA_pixmap_colormap\n#define GLX_MESA_pixmap_colormap 1\n\ntypedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);\n\n#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA)\n\n#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap)\n\n#endif /* GLX_MESA_pixmap_colormap */\n\n/* ------------------------ GLX_MESA_release_buffers ----------------------- */\n\n#ifndef GLX_MESA_release_buffers\n#define GLX_MESA_release_buffers 1\n\ntypedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d);\n\n#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA)\n\n#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers)\n\n#endif /* GLX_MESA_release_buffers */\n\n/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */\n\n#ifndef GLX_MESA_set_3dfx_mode\n#define GLX_MESA_set_3dfx_mode 1\n\n#define GLX_3DFX_WINDOW_MODE_MESA 0x1\n#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2\n\ntypedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode);\n\n#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA)\n\n#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode)\n\n#endif /* GLX_MESA_set_3dfx_mode */\n\n/* ------------------------- GLX_MESA_swap_control ------------------------- */\n\n#ifndef GLX_MESA_swap_control\n#define GLX_MESA_swap_control 1\n\ntypedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void);\ntypedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);\n\n#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA)\n#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA)\n\n#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control)\n\n#endif /* GLX_MESA_swap_control */\n\n/* --------------------------- GLX_NV_copy_image --------------------------- */\n\n#ifndef GLX_NV_copy_image\n#define GLX_NV_copy_image 1\n\ntypedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n\n#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV)\n\n#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image)\n\n#endif /* GLX_NV_copy_image */\n\n/* -------------------------- GLX_NV_float_buffer -------------------------- */\n\n#ifndef GLX_NV_float_buffer\n#define GLX_NV_float_buffer 1\n\n#define GLX_FLOAT_COMPONENTS_NV 0x20B0\n\n#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer)\n\n#endif /* GLX_NV_float_buffer */\n\n/* ---------------------- GLX_NV_multisample_coverage ---------------------- */\n\n#ifndef GLX_NV_multisample_coverage\n#define GLX_NV_multisample_coverage 1\n\n#define GLX_COLOR_SAMPLES_NV 0x20B3\n#define GLX_COVERAGE_SAMPLES_NV 100001\n\n#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage)\n\n#endif /* GLX_NV_multisample_coverage */\n\n/* -------------------------- GLX_NV_present_video ------------------------- */\n\n#ifndef GLX_NV_present_video\n#define GLX_NV_present_video 1\n\n#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0\n\ntypedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);\ntypedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);\n\n#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV)\n#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV)\n\n#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video)\n\n#endif /* GLX_NV_present_video */\n\n/* --------------------------- GLX_NV_swap_group --------------------------- */\n\n#ifndef GLX_NV_swap_group\n#define GLX_NV_swap_group 1\n\ntypedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier);\ntypedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group);\ntypedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count);\ntypedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);\ntypedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);\ntypedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen);\n\n#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV)\n#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV)\n#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV)\n#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV)\n#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV)\n#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV)\n\n#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group)\n\n#endif /* GLX_NV_swap_group */\n\n/* ----------------------- GLX_NV_vertex_array_range ----------------------- */\n\n#ifndef GLX_NV_vertex_array_range\n#define GLX_NV_vertex_array_range 1\n\ntypedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);\ntypedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);\n\n#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV)\n#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV)\n\n#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range)\n\n#endif /* GLX_NV_vertex_array_range */\n\n/* -------------------------- GLX_NV_video_capture ------------------------- */\n\n#ifndef GLX_NV_video_capture\n#define GLX_NV_video_capture 1\n\n#define GLX_DEVICE_ID_NV 0x20CD\n#define GLX_UNIQUE_ID_NV 0x20CE\n#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF\n\ntypedef XID GLXVideoCaptureDeviceNV;\n\ntypedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);\ntypedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements);\ntypedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);\ntypedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);\ntypedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);\n\n#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV)\n#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV)\n#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV)\n#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV)\n#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV)\n\n#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture)\n\n#endif /* GLX_NV_video_capture */\n\n/* -------------------------- GLX_NV_video_output -------------------------- */\n\n#ifndef GLX_NV_video_output\n#define GLX_NV_video_output 1\n\n#define GLX_VIDEO_OUT_COLOR_NV 0x20C3\n#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4\n#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5\n#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6\n#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7\n#define GLX_VIDEO_OUT_FRAME_NV 0x20C8\n#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9\n#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA\n#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB\n#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC\n\ntypedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);\ntypedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);\ntypedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);\ntypedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice);\ntypedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf);\ntypedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);\n\n#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV)\n#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV)\n#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV)\n#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV)\n#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)\n#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)\n\n#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)\n\n#endif /* GLX_NV_video_output */\n\n/* -------------------------- GLX_OML_swap_method -------------------------- */\n\n#ifndef GLX_OML_swap_method\n#define GLX_OML_swap_method 1\n\n#define GLX_SWAP_METHOD_OML 0x8060\n#define GLX_SWAP_EXCHANGE_OML 0x8061\n#define GLX_SWAP_COPY_OML 0x8062\n#define GLX_SWAP_UNDEFINED_OML 0x8063\n\n#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method)\n\n#endif /* GLX_OML_swap_method */\n\n/* -------------------------- GLX_OML_sync_control ------------------------- */\n\n#ifndef GLX_OML_sync_control\n#define GLX_OML_sync_control 1\n\ntypedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);\ntypedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc);\ntypedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);\ntypedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc);\ntypedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc);\n\n#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML)\n#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML)\n#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML)\n#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML)\n#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML)\n\n#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control)\n\n#endif /* GLX_OML_sync_control */\n\n/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */\n\n#ifndef GLX_SGIS_blended_overlay\n#define GLX_SGIS_blended_overlay 1\n\n#define GLX_BLENDED_RGBA_SGIS 0x8025\n\n#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay)\n\n#endif /* GLX_SGIS_blended_overlay */\n\n/* -------------------------- GLX_SGIS_color_range ------------------------- */\n\n#ifndef GLX_SGIS_color_range\n#define GLX_SGIS_color_range 1\n\n#define GLX_MIN_RED_SGIS 0\n#define GLX_MAX_GREEN_SGIS 0\n#define GLX_MIN_BLUE_SGIS 0\n#define GLX_MAX_ALPHA_SGIS 0\n#define GLX_MIN_GREEN_SGIS 0\n#define GLX_MIN_ALPHA_SGIS 0\n#define GLX_MAX_RED_SGIS 0\n#define GLX_EXTENDED_RANGE_SGIS 0\n#define GLX_MAX_BLUE_SGIS 0\n\n#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range)\n\n#endif /* GLX_SGIS_color_range */\n\n/* -------------------------- GLX_SGIS_multisample ------------------------- */\n\n#ifndef GLX_SGIS_multisample\n#define GLX_SGIS_multisample 1\n\n#define GLX_SAMPLE_BUFFERS_SGIS 100000\n#define GLX_SAMPLES_SGIS 100001\n\n#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample)\n\n#endif /* GLX_SGIS_multisample */\n\n/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */\n\n#ifndef GLX_SGIS_shared_multisample\n#define GLX_SGIS_shared_multisample 1\n\n#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026\n#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027\n\n#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample)\n\n#endif /* GLX_SGIS_shared_multisample */\n\n/* --------------------------- GLX_SGIX_fbconfig --------------------------- */\n\n#ifndef GLX_SGIX_fbconfig\n#define GLX_SGIX_fbconfig 1\n\n#define GLX_WINDOW_BIT_SGIX 0x00000001\n#define GLX_RGBA_BIT_SGIX 0x00000001\n#define GLX_PIXMAP_BIT_SGIX 0x00000002\n#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002\n#define GLX_SCREEN_EXT 0x800C\n#define GLX_DRAWABLE_TYPE_SGIX 0x8010\n#define GLX_RENDER_TYPE_SGIX 0x8011\n#define GLX_X_RENDERABLE_SGIX 0x8012\n#define GLX_FBCONFIG_ID_SGIX 0x8013\n#define GLX_RGBA_TYPE_SGIX 0x8014\n#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015\n\ntypedef XID GLXFBConfigIDSGIX;\ntypedef struct __GLXFBConfigRec *GLXFBConfigSGIX;\n\ntypedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);\ntypedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);\ntypedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap);\ntypedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value);\ntypedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis);\ntypedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config);\n\n#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX)\n#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX)\n#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX)\n#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX)\n#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX)\n#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX)\n\n#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig)\n\n#endif /* GLX_SGIX_fbconfig */\n\n/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */\n\n#ifndef GLX_SGIX_hyperpipe\n#define GLX_SGIX_hyperpipe 1\n\n#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001\n#define GLX_PIPE_RECT_SGIX 0x00000001\n#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002\n#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002\n#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003\n#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004\n#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80\n#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91\n#define GLX_BAD_HYPERPIPE_SGIX 92\n#define GLX_HYPERPIPE_ID_SGIX 0x8030\n\ntypedef struct {\n  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; \n  int  networkId; \n} GLXHyperpipeNetworkSGIX;\ntypedef struct {\n  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; \n  int XOrigin; \n  int YOrigin; \n  int maxHeight; \n  int maxWidth; \n} GLXPipeRectLimits;\ntypedef struct {\n  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; \n  int channel; \n  unsigned int participationType; \n  int timeSlice; \n} GLXHyperpipeConfigSGIX;\ntypedef struct {\n  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; \n  int srcXOrigin; \n  int srcYOrigin; \n  int srcWidth; \n  int srcHeight; \n  int destXOrigin; \n  int destYOrigin; \n  int destWidth; \n  int destHeight; \n} GLXPipeRect;\n\ntypedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);\ntypedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);\ntypedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);\ntypedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);\ntypedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);\ntypedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);\ntypedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);\ntypedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);\n\n#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX)\n#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX)\n#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX)\n#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX)\n#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX)\n#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX)\n#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX)\n#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX)\n\n#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe)\n\n#endif /* GLX_SGIX_hyperpipe */\n\n/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */\n\n#ifndef GLX_SGIX_pbuffer\n#define GLX_SGIX_pbuffer 1\n\n#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001\n#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002\n#define GLX_PBUFFER_BIT_SGIX 0x00000004\n#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004\n#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008\n#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010\n#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020\n#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040\n#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080\n#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100\n#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016\n#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017\n#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018\n#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019\n#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A\n#define GLX_PRESERVED_CONTENTS_SGIX 0x801B\n#define GLX_LARGEST_PBUFFER_SGIX 0x801C\n#define GLX_WIDTH_SGIX 0x801D\n#define GLX_HEIGHT_SGIX 0x801E\n#define GLX_EVENT_MASK_SGIX 0x801F\n#define GLX_DAMAGED_SGIX 0x8020\n#define GLX_SAVED_SGIX 0x8021\n#define GLX_WINDOW_SGIX 0x8022\n#define GLX_PBUFFER_SGIX 0x8023\n#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000\n\ntypedef XID GLXPbufferSGIX;\ntypedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX;\n\ntypedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list);\ntypedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf);\ntypedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask);\ntypedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);\ntypedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask);\n\n#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX)\n#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX)\n#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX)\n#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX)\n#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX)\n\n#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer)\n\n#endif /* GLX_SGIX_pbuffer */\n\n/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */\n\n#ifndef GLX_SGIX_swap_barrier\n#define GLX_SGIX_swap_barrier 1\n\ntypedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);\ntypedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);\n\n#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX)\n#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX)\n\n#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier)\n\n#endif /* GLX_SGIX_swap_barrier */\n\n/* -------------------------- GLX_SGIX_swap_group -------------------------- */\n\n#ifndef GLX_SGIX_swap_group\n#define GLX_SGIX_swap_group 1\n\ntypedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);\n\n#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX)\n\n#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group)\n\n#endif /* GLX_SGIX_swap_group */\n\n/* ------------------------- GLX_SGIX_video_resize ------------------------- */\n\n#ifndef GLX_SGIX_video_resize\n#define GLX_SGIX_video_resize 1\n\n#define GLX_SYNC_FRAME_SGIX 0x00000000\n#define GLX_SYNC_SWAP_SGIX 0x00000001\n\ntypedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window);\ntypedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h);\ntypedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype);\ntypedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h);\ntypedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);\n\n#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX)\n#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX)\n#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX)\n#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX)\n#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX)\n\n#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize)\n\n#endif /* GLX_SGIX_video_resize */\n\n/* ---------------------- GLX_SGIX_visual_select_group --------------------- */\n\n#ifndef GLX_SGIX_visual_select_group\n#define GLX_SGIX_visual_select_group 1\n\n#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028\n\n#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group)\n\n#endif /* GLX_SGIX_visual_select_group */\n\n/* ---------------------------- GLX_SGI_cushion ---------------------------- */\n\n#ifndef GLX_SGI_cushion\n#define GLX_SGI_cushion 1\n\ntypedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion);\n\n#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI)\n\n#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion)\n\n#endif /* GLX_SGI_cushion */\n\n/* ----------------------- GLX_SGI_make_current_read ----------------------- */\n\n#ifndef GLX_SGI_make_current_read\n#define GLX_SGI_make_current_read 1\n\ntypedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);\ntypedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);\n\n#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI)\n#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI)\n\n#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read)\n\n#endif /* GLX_SGI_make_current_read */\n\n/* -------------------------- GLX_SGI_swap_control ------------------------- */\n\n#ifndef GLX_SGI_swap_control\n#define GLX_SGI_swap_control 1\n\ntypedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);\n\n#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI)\n\n#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control)\n\n#endif /* GLX_SGI_swap_control */\n\n/* --------------------------- GLX_SGI_video_sync -------------------------- */\n\n#ifndef GLX_SGI_video_sync\n#define GLX_SGI_video_sync 1\n\ntypedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count);\ntypedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count);\n\n#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI)\n#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI)\n\n#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync)\n\n#endif /* GLX_SGI_video_sync */\n\n/* --------------------- GLX_SUN_get_transparent_index --------------------- */\n\n#ifndef GLX_SUN_get_transparent_index\n#define GLX_SUN_get_transparent_index 1\n\ntypedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex);\n\n#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN)\n\n#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index)\n\n#endif /* GLX_SUN_get_transparent_index */\n\n/* -------------------------- GLX_SUN_video_resize ------------------------- */\n\n#ifndef GLX_SUN_video_resize\n#define GLX_SUN_video_resize 1\n\n#define GLX_VIDEO_RESIZE_SUN 0x8171\n#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD\n\ntypedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor);\ntypedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor);\n\n#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN)\n#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN)\n\n#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize)\n\n#endif /* GLX_SUN_video_resize */\n\n/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define GLXEW_EXPORT\n#else\n#define GLXEW_EXPORT extern\n#endif /* GLEW_MX */\n\nextern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;\n\nextern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;\nextern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;\nextern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;\nextern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;\nextern PFNGLXCREATEWINDOWPROC __glewXCreateWindow;\nextern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;\nextern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;\nextern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;\nextern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;\nextern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;\nextern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;\nextern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;\nextern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;\nextern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;\nextern PFNGLXQUERYCONTEXTPROC __glewXQueryContext;\nextern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;\nextern PFNGLXSELECTEVENTPROC __glewXSelectEvent;\n\nextern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;\n\nextern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;\nextern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;\nextern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;\n\nextern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;\nextern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;\nextern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;\nextern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;\n\nextern PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;\n\nextern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;\nextern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;\n\nextern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;\n\nextern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;\n\nextern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;\n\nextern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;\n\nextern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;\n\nextern PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA;\nextern PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA;\n\nextern PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;\n\nextern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;\nextern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;\n\nextern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;\nextern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;\nextern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;\nextern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;\nextern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;\nextern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;\n\nextern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;\nextern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;\n\nextern PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV;\nextern PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV;\nextern PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV;\nextern PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV;\nextern PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV;\n\nextern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;\nextern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;\nextern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;\nextern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;\nextern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;\nextern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;\n\nextern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;\nextern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;\nextern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;\nextern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;\nextern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;\n\nextern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;\nextern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;\nextern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;\nextern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;\nextern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;\nextern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;\n\nextern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;\nextern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;\nextern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;\nextern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;\nextern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;\nextern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;\nextern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;\nextern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;\n\nextern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;\nextern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;\nextern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;\nextern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;\nextern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;\n\nextern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;\nextern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;\n\nextern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;\n\nextern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;\nextern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;\nextern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;\nextern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;\nextern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;\n\nextern PFNGLXCUSHIONSGIPROC __glewXCushionSGI;\n\nextern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;\nextern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;\n\nextern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;\n\nextern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;\nextern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;\n\nextern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;\n\nextern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;\nextern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;\n\n#if defined(GLEW_MX)\nstruct GLXEWContextStruct\n{\n#endif /* GLEW_MX */\n\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3;\nGLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4;\nGLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample;\nGLXEW_EXPORT GLboolean __GLXEW_AMD_gpu_association;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_create_context;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_profile;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_multisample;\nGLXEW_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;\nGLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;\nGLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_import_context;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_swap_control;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info;\nGLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating;\nGLXEW_EXPORT GLboolean __GLXEW_INTEL_swap_event;\nGLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset;\nGLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;\nGLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;\nGLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers;\nGLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;\nGLXEW_EXPORT GLboolean __GLXEW_MESA_swap_control;\nGLXEW_EXPORT GLboolean __GLXEW_NV_copy_image;\nGLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer;\nGLXEW_EXPORT GLboolean __GLXEW_NV_multisample_coverage;\nGLXEW_EXPORT GLboolean __GLXEW_NV_present_video;\nGLXEW_EXPORT GLboolean __GLXEW_NV_swap_group;\nGLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range;\nGLXEW_EXPORT GLboolean __GLXEW_NV_video_capture;\nGLXEW_EXPORT GLboolean __GLXEW_NV_video_output;\nGLXEW_EXPORT GLboolean __GLXEW_OML_swap_method;\nGLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;\nGLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;\nGLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range;\nGLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample;\nGLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;\nGLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig;\nGLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;\nGLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer;\nGLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;\nGLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group;\nGLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize;\nGLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;\nGLXEW_EXPORT GLboolean __GLXEW_SGI_cushion;\nGLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read;\nGLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control;\nGLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync;\nGLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;\nGLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;\n\n#ifdef GLEW_MX\n}; /* GLXEWContextStruct */\n#endif /* GLEW_MX */\n\n/* ------------------------------------------------------------------------ */\n\n#ifdef GLEW_MX\n\ntypedef struct GLXEWContextStruct GLXEWContext;\nextern GLenum glxewContextInit (GLXEWContext* ctx);\nextern GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name);\n\n#define glxewInit() glxewContextInit(glxewGetContext())\n#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)\n\n#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x))\n#define GLXEW_GET_FUN(x) x\n\n#else /* GLEW_MX */\n\n#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)\n#define GLXEW_GET_FUN(x) x\n\nextern GLboolean glxewIsSupported (const char* name);\n\n#endif /* GLEW_MX */\n\nextern GLboolean glxewGetExtension (const char* name);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __glxew_h__ */\n"
  },
  {
    "path": "cocos2d/external/win32-specific/gles/include/OGLES/GL/wglew.h",
    "content": "/*\n** The OpenGL Extension Wrangler Library\n** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>\n** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>\n** Copyright (C) 2002, Lev Povalahev\n** All rights reserved.\n** \n** Redistribution and use in source and binary forms, with or without \n** modification, are permitted provided that the following conditions are met:\n** \n** * Redistributions of source code must retain the above copyright notice, \n**   this list of conditions and the following disclaimer.\n** * Redistributions in binary form must reproduce the above copyright notice, \n**   this list of conditions and the following disclaimer in the documentation \n**   and/or other materials provided with the distribution.\n** * The name of the author may be used to endorse or promote products \n**   derived from this software without specific prior written permission.\n**\n** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \n** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \n** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\n** THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*\n** Copyright (c) 2007 The Khronos Group Inc.\n** \n** Permission is hereby granted, free of charge, to any person obtaining a\n** copy of this software and/or associated documentation files (the\n** \"Materials\"), to deal in the Materials without restriction, including\n** without limitation the rights to use, copy, modify, merge, publish,\n** distribute, sublicense, and/or sell copies of the Materials, and to\n** permit persons to whom the Materials are furnished to do so, subject to\n** the following conditions:\n** \n** The above copyright notice and this permission notice shall be included\n** in all copies or substantial portions of the Materials.\n** \n** THE MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.\n*/\n\n#ifndef __wglew_h__\n#define __wglew_h__\n#define __WGLEW_H__\n\n#ifdef __wglext_h_\n#error wglext.h included before wglew.h\n#endif\n\n#define __wglext_h_\n\n#if !defined(WINAPI)\n#  ifndef WIN32_LEAN_AND_MEAN\n#    define WIN32_LEAN_AND_MEAN 1\n#  endif\n#include <windows.h>\n#  undef WIN32_LEAN_AND_MEAN\n#endif\n\n/*\n * GLEW_STATIC needs to be set when using the static version.\n * GLEW_BUILD is set when building the DLL version.\n */\n#ifdef GLEW_STATIC\n#  define GLEWAPI extern\n#else\n#  ifdef GLEW_BUILD\n#    define GLEWAPI extern __declspec(dllexport)\n#  else\n#    define GLEWAPI extern __declspec(dllimport)\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* -------------------------- WGL_3DFX_multisample ------------------------- */\n\n#ifndef WGL_3DFX_multisample\n#define WGL_3DFX_multisample 1\n\n#define WGL_SAMPLE_BUFFERS_3DFX 0x2060\n#define WGL_SAMPLES_3DFX 0x2061\n\n#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample)\n\n#endif /* WGL_3DFX_multisample */\n\n/* ------------------------- WGL_3DL_stereo_control ------------------------ */\n\n#ifndef WGL_3DL_stereo_control\n#define WGL_3DL_stereo_control 1\n\n#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055\n#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056\n#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057\n#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058\n\ntypedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);\n\n#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL)\n\n#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control)\n\n#endif /* WGL_3DL_stereo_control */\n\n/* ------------------------ WGL_AMD_gpu_association ------------------------ */\n\n#ifndef WGL_AMD_gpu_association\n#define WGL_AMD_gpu_association 1\n\n#define WGL_GPU_VENDOR_AMD 0x1F00\n#define WGL_GPU_RENDERER_STRING_AMD 0x1F01\n#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02\n#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2\n#define WGL_GPU_RAM_AMD 0x21A3\n#define WGL_GPU_CLOCK_AMD 0x21A4\n#define WGL_GPU_NUM_PIPES_AMD 0x21A5\n#define WGL_GPU_NUM_SIMD_AMD 0x21A6\n#define WGL_GPU_NUM_RB_AMD 0x21A7\n#define WGL_GPU_NUM_SPI_AMD 0x21A8\n\ntypedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);\ntypedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);\ntypedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList);\ntypedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);\ntypedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);\ntypedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);\ntypedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids);\ntypedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data);\ntypedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);\n\n#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD)\n#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD)\n#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD)\n#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD)\n#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD)\n#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD)\n#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD)\n#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD)\n#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD)\n\n#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association)\n\n#endif /* WGL_AMD_gpu_association */\n\n/* ------------------------- WGL_ARB_buffer_region ------------------------- */\n\n#ifndef WGL_ARB_buffer_region\n#define WGL_ARB_buffer_region 1\n\n#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001\n#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002\n#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004\n#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008\n\ntypedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);\ntypedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);\ntypedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);\ntypedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);\n\n#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB)\n#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB)\n#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB)\n#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB)\n\n#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region)\n\n#endif /* WGL_ARB_buffer_region */\n\n/* ------------------------- WGL_ARB_create_context ------------------------ */\n\n#ifndef WGL_ARB_create_context\n#define WGL_ARB_create_context 1\n\n#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001\n#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002\n#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091\n#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092\n#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093\n#define WGL_CONTEXT_FLAGS_ARB 0x2094\n#define ERROR_INVALID_VERSION_ARB 0x2095\n#define ERROR_INVALID_PROFILE_ARB 0x2096\n\ntypedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);\n\n#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB)\n\n#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context)\n\n#endif /* WGL_ARB_create_context */\n\n/* --------------------- WGL_ARB_create_context_profile -------------------- */\n\n#ifndef WGL_ARB_create_context_profile\n#define WGL_ARB_create_context_profile 1\n\n#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001\n#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002\n#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126\n\n#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile)\n\n#endif /* WGL_ARB_create_context_profile */\n\n/* ------------------- WGL_ARB_create_context_robustness ------------------- */\n\n#ifndef WGL_ARB_create_context_robustness\n#define WGL_ARB_create_context_robustness 1\n\n#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004\n#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252\n#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256\n#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261\n\n#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness)\n\n#endif /* WGL_ARB_create_context_robustness */\n\n/* ----------------------- WGL_ARB_extensions_string ----------------------- */\n\n#ifndef WGL_ARB_extensions_string\n#define WGL_ARB_extensions_string 1\n\ntypedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);\n\n#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB)\n\n#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string)\n\n#endif /* WGL_ARB_extensions_string */\n\n/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */\n\n#ifndef WGL_ARB_framebuffer_sRGB\n#define WGL_ARB_framebuffer_sRGB 1\n\n#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9\n\n#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB)\n\n#endif /* WGL_ARB_framebuffer_sRGB */\n\n/* ----------------------- WGL_ARB_make_current_read ----------------------- */\n\n#ifndef WGL_ARB_make_current_read\n#define WGL_ARB_make_current_read 1\n\n#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043\n#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054\n\ntypedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID);\ntypedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);\n\n#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB)\n#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB)\n\n#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read)\n\n#endif /* WGL_ARB_make_current_read */\n\n/* -------------------------- WGL_ARB_multisample -------------------------- */\n\n#ifndef WGL_ARB_multisample\n#define WGL_ARB_multisample 1\n\n#define WGL_SAMPLE_BUFFERS_ARB 0x2041\n#define WGL_SAMPLES_ARB 0x2042\n\n#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample)\n\n#endif /* WGL_ARB_multisample */\n\n/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */\n\n#ifndef WGL_ARB_pbuffer\n#define WGL_ARB_pbuffer 1\n\n#define WGL_DRAW_TO_PBUFFER_ARB 0x202D\n#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E\n#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F\n#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030\n#define WGL_PBUFFER_LARGEST_ARB 0x2033\n#define WGL_PBUFFER_WIDTH_ARB 0x2034\n#define WGL_PBUFFER_HEIGHT_ARB 0x2035\n#define WGL_PBUFFER_LOST_ARB 0x2036\n\nDECLARE_HANDLE(HPBUFFERARB);\n\ntypedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);\ntypedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);\ntypedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);\ntypedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue);\ntypedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);\n\n#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB)\n#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB)\n#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB)\n#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB)\n#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB)\n\n#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer)\n\n#endif /* WGL_ARB_pbuffer */\n\n/* -------------------------- WGL_ARB_pixel_format ------------------------- */\n\n#ifndef WGL_ARB_pixel_format\n#define WGL_ARB_pixel_format 1\n\n#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000\n#define WGL_DRAW_TO_WINDOW_ARB 0x2001\n#define WGL_DRAW_TO_BITMAP_ARB 0x2002\n#define WGL_ACCELERATION_ARB 0x2003\n#define WGL_NEED_PALETTE_ARB 0x2004\n#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005\n#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006\n#define WGL_SWAP_METHOD_ARB 0x2007\n#define WGL_NUMBER_OVERLAYS_ARB 0x2008\n#define WGL_NUMBER_UNDERLAYS_ARB 0x2009\n#define WGL_TRANSPARENT_ARB 0x200A\n#define WGL_SHARE_DEPTH_ARB 0x200C\n#define WGL_SHARE_STENCIL_ARB 0x200D\n#define WGL_SHARE_ACCUM_ARB 0x200E\n#define WGL_SUPPORT_GDI_ARB 0x200F\n#define WGL_SUPPORT_OPENGL_ARB 0x2010\n#define WGL_DOUBLE_BUFFER_ARB 0x2011\n#define WGL_STEREO_ARB 0x2012\n#define WGL_PIXEL_TYPE_ARB 0x2013\n#define WGL_COLOR_BITS_ARB 0x2014\n#define WGL_RED_BITS_ARB 0x2015\n#define WGL_RED_SHIFT_ARB 0x2016\n#define WGL_GREEN_BITS_ARB 0x2017\n#define WGL_GREEN_SHIFT_ARB 0x2018\n#define WGL_BLUE_BITS_ARB 0x2019\n#define WGL_BLUE_SHIFT_ARB 0x201A\n#define WGL_ALPHA_BITS_ARB 0x201B\n#define WGL_ALPHA_SHIFT_ARB 0x201C\n#define WGL_ACCUM_BITS_ARB 0x201D\n#define WGL_ACCUM_RED_BITS_ARB 0x201E\n#define WGL_ACCUM_GREEN_BITS_ARB 0x201F\n#define WGL_ACCUM_BLUE_BITS_ARB 0x2020\n#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021\n#define WGL_DEPTH_BITS_ARB 0x2022\n#define WGL_STENCIL_BITS_ARB 0x2023\n#define WGL_AUX_BUFFERS_ARB 0x2024\n#define WGL_NO_ACCELERATION_ARB 0x2025\n#define WGL_GENERIC_ACCELERATION_ARB 0x2026\n#define WGL_FULL_ACCELERATION_ARB 0x2027\n#define WGL_SWAP_EXCHANGE_ARB 0x2028\n#define WGL_SWAP_COPY_ARB 0x2029\n#define WGL_SWAP_UNDEFINED_ARB 0x202A\n#define WGL_TYPE_RGBA_ARB 0x202B\n#define WGL_TYPE_COLORINDEX_ARB 0x202C\n#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037\n#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038\n#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039\n#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A\n#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B\n\ntypedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues);\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues);\n\n#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB)\n#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB)\n#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB)\n\n#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format)\n\n#endif /* WGL_ARB_pixel_format */\n\n/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */\n\n#ifndef WGL_ARB_pixel_format_float\n#define WGL_ARB_pixel_format_float 1\n\n#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0\n\n#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float)\n\n#endif /* WGL_ARB_pixel_format_float */\n\n/* ------------------------- WGL_ARB_render_texture ------------------------ */\n\n#ifndef WGL_ARB_render_texture\n#define WGL_ARB_render_texture 1\n\n#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070\n#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071\n#define WGL_TEXTURE_FORMAT_ARB 0x2072\n#define WGL_TEXTURE_TARGET_ARB 0x2073\n#define WGL_MIPMAP_TEXTURE_ARB 0x2074\n#define WGL_TEXTURE_RGB_ARB 0x2075\n#define WGL_TEXTURE_RGBA_ARB 0x2076\n#define WGL_NO_TEXTURE_ARB 0x2077\n#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078\n#define WGL_TEXTURE_1D_ARB 0x2079\n#define WGL_TEXTURE_2D_ARB 0x207A\n#define WGL_MIPMAP_LEVEL_ARB 0x207B\n#define WGL_CUBE_MAP_FACE_ARB 0x207C\n#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D\n#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E\n#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F\n#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080\n#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081\n#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082\n#define WGL_FRONT_LEFT_ARB 0x2083\n#define WGL_FRONT_RIGHT_ARB 0x2084\n#define WGL_BACK_LEFT_ARB 0x2085\n#define WGL_BACK_RIGHT_ARB 0x2086\n#define WGL_AUX0_ARB 0x2087\n#define WGL_AUX1_ARB 0x2088\n#define WGL_AUX2_ARB 0x2089\n#define WGL_AUX3_ARB 0x208A\n#define WGL_AUX4_ARB 0x208B\n#define WGL_AUX5_ARB 0x208C\n#define WGL_AUX6_ARB 0x208D\n#define WGL_AUX7_ARB 0x208E\n#define WGL_AUX8_ARB 0x208F\n#define WGL_AUX9_ARB 0x2090\n\ntypedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);\ntypedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);\ntypedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList);\n\n#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB)\n#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB)\n#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB)\n\n#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture)\n\n#endif /* WGL_ARB_render_texture */\n\n/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */\n\n#ifndef WGL_ATI_pixel_format_float\n#define WGL_ATI_pixel_format_float 1\n\n#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0\n#define GL_RGBA_FLOAT_MODE_ATI 0x8820\n#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835\n\n#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float)\n\n#endif /* WGL_ATI_pixel_format_float */\n\n/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */\n\n#ifndef WGL_ATI_render_texture_rectangle\n#define WGL_ATI_render_texture_rectangle 1\n\n#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5\n\n#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle)\n\n#endif /* WGL_ATI_render_texture_rectangle */\n\n/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */\n\n#ifndef WGL_EXT_create_context_es2_profile\n#define WGL_EXT_create_context_es2_profile 1\n\n#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004\n\n#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile)\n\n#endif /* WGL_EXT_create_context_es2_profile */\n\n/* -------------------------- WGL_EXT_depth_float -------------------------- */\n\n#ifndef WGL_EXT_depth_float\n#define WGL_EXT_depth_float 1\n\n#define WGL_DEPTH_FLOAT_EXT 0x2040\n\n#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float)\n\n#endif /* WGL_EXT_depth_float */\n\n/* ---------------------- WGL_EXT_display_color_table ---------------------- */\n\n#ifndef WGL_EXT_display_color_table\n#define WGL_EXT_display_color_table 1\n\ntypedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);\ntypedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);\ntypedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);\ntypedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length);\n\n#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT)\n#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT)\n#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT)\n#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT)\n\n#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table)\n\n#endif /* WGL_EXT_display_color_table */\n\n/* ----------------------- WGL_EXT_extensions_string ----------------------- */\n\n#ifndef WGL_EXT_extensions_string\n#define WGL_EXT_extensions_string 1\n\ntypedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);\n\n#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT)\n\n#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string)\n\n#endif /* WGL_EXT_extensions_string */\n\n/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */\n\n#ifndef WGL_EXT_framebuffer_sRGB\n#define WGL_EXT_framebuffer_sRGB 1\n\n#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9\n\n#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB)\n\n#endif /* WGL_EXT_framebuffer_sRGB */\n\n/* ----------------------- WGL_EXT_make_current_read ----------------------- */\n\n#ifndef WGL_EXT_make_current_read\n#define WGL_EXT_make_current_read 1\n\n#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043\n\ntypedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID);\ntypedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);\n\n#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT)\n#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT)\n\n#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read)\n\n#endif /* WGL_EXT_make_current_read */\n\n/* -------------------------- WGL_EXT_multisample -------------------------- */\n\n#ifndef WGL_EXT_multisample\n#define WGL_EXT_multisample 1\n\n#define WGL_SAMPLE_BUFFERS_EXT 0x2041\n#define WGL_SAMPLES_EXT 0x2042\n\n#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample)\n\n#endif /* WGL_EXT_multisample */\n\n/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */\n\n#ifndef WGL_EXT_pbuffer\n#define WGL_EXT_pbuffer 1\n\n#define WGL_DRAW_TO_PBUFFER_EXT 0x202D\n#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E\n#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F\n#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030\n#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031\n#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032\n#define WGL_PBUFFER_LARGEST_EXT 0x2033\n#define WGL_PBUFFER_WIDTH_EXT 0x2034\n#define WGL_PBUFFER_HEIGHT_EXT 0x2035\n\nDECLARE_HANDLE(HPBUFFEREXT);\n\ntypedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);\ntypedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);\ntypedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);\ntypedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue);\ntypedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);\n\n#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT)\n#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT)\n#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT)\n#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT)\n#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT)\n\n#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer)\n\n#endif /* WGL_EXT_pbuffer */\n\n/* -------------------------- WGL_EXT_pixel_format ------------------------- */\n\n#ifndef WGL_EXT_pixel_format\n#define WGL_EXT_pixel_format 1\n\n#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000\n#define WGL_DRAW_TO_WINDOW_EXT 0x2001\n#define WGL_DRAW_TO_BITMAP_EXT 0x2002\n#define WGL_ACCELERATION_EXT 0x2003\n#define WGL_NEED_PALETTE_EXT 0x2004\n#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005\n#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006\n#define WGL_SWAP_METHOD_EXT 0x2007\n#define WGL_NUMBER_OVERLAYS_EXT 0x2008\n#define WGL_NUMBER_UNDERLAYS_EXT 0x2009\n#define WGL_TRANSPARENT_EXT 0x200A\n#define WGL_TRANSPARENT_VALUE_EXT 0x200B\n#define WGL_SHARE_DEPTH_EXT 0x200C\n#define WGL_SHARE_STENCIL_EXT 0x200D\n#define WGL_SHARE_ACCUM_EXT 0x200E\n#define WGL_SUPPORT_GDI_EXT 0x200F\n#define WGL_SUPPORT_OPENGL_EXT 0x2010\n#define WGL_DOUBLE_BUFFER_EXT 0x2011\n#define WGL_STEREO_EXT 0x2012\n#define WGL_PIXEL_TYPE_EXT 0x2013\n#define WGL_COLOR_BITS_EXT 0x2014\n#define WGL_RED_BITS_EXT 0x2015\n#define WGL_RED_SHIFT_EXT 0x2016\n#define WGL_GREEN_BITS_EXT 0x2017\n#define WGL_GREEN_SHIFT_EXT 0x2018\n#define WGL_BLUE_BITS_EXT 0x2019\n#define WGL_BLUE_SHIFT_EXT 0x201A\n#define WGL_ALPHA_BITS_EXT 0x201B\n#define WGL_ALPHA_SHIFT_EXT 0x201C\n#define WGL_ACCUM_BITS_EXT 0x201D\n#define WGL_ACCUM_RED_BITS_EXT 0x201E\n#define WGL_ACCUM_GREEN_BITS_EXT 0x201F\n#define WGL_ACCUM_BLUE_BITS_EXT 0x2020\n#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021\n#define WGL_DEPTH_BITS_EXT 0x2022\n#define WGL_STENCIL_BITS_EXT 0x2023\n#define WGL_AUX_BUFFERS_EXT 0x2024\n#define WGL_NO_ACCELERATION_EXT 0x2025\n#define WGL_GENERIC_ACCELERATION_EXT 0x2026\n#define WGL_FULL_ACCELERATION_EXT 0x2027\n#define WGL_SWAP_EXCHANGE_EXT 0x2028\n#define WGL_SWAP_COPY_EXT 0x2029\n#define WGL_SWAP_UNDEFINED_EXT 0x202A\n#define WGL_TYPE_RGBA_EXT 0x202B\n#define WGL_TYPE_COLORINDEX_EXT 0x202C\n\ntypedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues);\ntypedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues);\n\n#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT)\n#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT)\n#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT)\n\n#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format)\n\n#endif /* WGL_EXT_pixel_format */\n\n/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */\n\n#ifndef WGL_EXT_pixel_format_packed_float\n#define WGL_EXT_pixel_format_packed_float 1\n\n#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8\n\n#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float)\n\n#endif /* WGL_EXT_pixel_format_packed_float */\n\n/* -------------------------- WGL_EXT_swap_control ------------------------- */\n\n#ifndef WGL_EXT_swap_control\n#define WGL_EXT_swap_control 1\n\ntypedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);\ntypedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);\n\n#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT)\n#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT)\n\n#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control)\n\n#endif /* WGL_EXT_swap_control */\n\n/* --------------------- WGL_I3D_digital_video_control --------------------- */\n\n#ifndef WGL_I3D_digital_video_control\n#define WGL_I3D_digital_video_control 1\n\n#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050\n#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051\n#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052\n#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053\n\ntypedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);\ntypedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);\n\n#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D)\n#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D)\n\n#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control)\n\n#endif /* WGL_I3D_digital_video_control */\n\n/* ----------------------------- WGL_I3D_gamma ----------------------------- */\n\n#ifndef WGL_I3D_gamma\n#define WGL_I3D_gamma 1\n\n#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E\n#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F\n\ntypedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue);\ntypedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);\ntypedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue);\ntypedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);\n\n#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D)\n#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D)\n#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D)\n#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D)\n\n#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma)\n\n#endif /* WGL_I3D_gamma */\n\n/* ---------------------------- WGL_I3D_genlock ---------------------------- */\n\n#ifndef WGL_I3D_genlock\n#define WGL_I3D_genlock 1\n\n#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044\n#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045\n#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046\n#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047\n#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048\n#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049\n#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A\n#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B\n#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C\n\ntypedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);\ntypedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);\ntypedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge);\ntypedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource);\ntypedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag);\ntypedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay);\n\n#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D)\n#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D)\n#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D)\n#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D)\n#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D)\n#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D)\n#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D)\n#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D)\n#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D)\n#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D)\n#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D)\n#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D)\n\n#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock)\n\n#endif /* WGL_I3D_genlock */\n\n/* -------------------------- WGL_I3D_image_buffer ------------------------- */\n\n#ifndef WGL_I3D_image_buffer\n#define WGL_I3D_image_buffer 1\n\n#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001\n#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002\n\ntypedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count);\ntypedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);\ntypedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);\ntypedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count);\n\n#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D)\n#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D)\n#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D)\n#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D)\n\n#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer)\n\n#endif /* WGL_I3D_image_buffer */\n\n/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */\n\n#ifndef WGL_I3D_swap_frame_lock\n#define WGL_I3D_swap_frame_lock 1\n\ntypedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID);\ntypedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID);\ntypedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag);\ntypedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag);\n\n#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D)\n#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D)\n#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D)\n#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D)\n\n#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock)\n\n#endif /* WGL_I3D_swap_frame_lock */\n\n/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */\n\n#ifndef WGL_I3D_swap_frame_usage\n#define WGL_I3D_swap_frame_usage 1\n\ntypedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);\ntypedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);\ntypedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage);\ntypedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);\n\n#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D)\n#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D)\n#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D)\n#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D)\n\n#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage)\n\n#endif /* WGL_I3D_swap_frame_usage */\n\n/* --------------------------- WGL_NV_DX_interop --------------------------- */\n\n#ifndef WGL_NV_DX_interop\n#define WGL_NV_DX_interop 1\n\n#define WGL_ACCESS_READ_ONLY_NV 0x0000\n#define WGL_ACCESS_READ_WRITE_NV 0x0001\n#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002\n\ntypedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);\ntypedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);\ntypedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);\ntypedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice);\ntypedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);\ntypedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle);\ntypedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);\ntypedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);\n\n#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV)\n#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV)\n#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV)\n#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV)\n#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV)\n#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV)\n#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV)\n#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV)\n\n#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop)\n\n#endif /* WGL_NV_DX_interop */\n\n/* --------------------------- WGL_NV_copy_image --------------------------- */\n\n#ifndef WGL_NV_copy_image\n#define WGL_NV_copy_image 1\n\ntypedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);\n\n#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV)\n\n#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image)\n\n#endif /* WGL_NV_copy_image */\n\n/* -------------------------- WGL_NV_float_buffer -------------------------- */\n\n#ifndef WGL_NV_float_buffer\n#define WGL_NV_float_buffer 1\n\n#define WGL_FLOAT_COMPONENTS_NV 0x20B0\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4\n#define WGL_TEXTURE_FLOAT_R_NV 0x20B5\n#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6\n#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7\n#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8\n\n#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer)\n\n#endif /* WGL_NV_float_buffer */\n\n/* -------------------------- WGL_NV_gpu_affinity -------------------------- */\n\n#ifndef WGL_NV_gpu_affinity\n#define WGL_NV_gpu_affinity 1\n\n#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0\n#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1\n\nDECLARE_HANDLE(HGPUNV);\ntypedef struct _GPU_DEVICE {\n  DWORD cb; \n  CHAR DeviceName[32]; \n  CHAR DeviceString[128]; \n  DWORD Flags; \n  RECT rcVirtualScreen; \n} GPU_DEVICE, *PGPU_DEVICE;\n\ntypedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);\ntypedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);\ntypedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);\ntypedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);\ntypedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);\n\n#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV)\n#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV)\n#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV)\n#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV)\n#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV)\n\n#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity)\n\n#endif /* WGL_NV_gpu_affinity */\n\n/* ---------------------- WGL_NV_multisample_coverage ---------------------- */\n\n#ifndef WGL_NV_multisample_coverage\n#define WGL_NV_multisample_coverage 1\n\n#define WGL_COVERAGE_SAMPLES_NV 0x2042\n#define WGL_COLOR_SAMPLES_NV 0x20B9\n\n#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage)\n\n#endif /* WGL_NV_multisample_coverage */\n\n/* -------------------------- WGL_NV_present_video ------------------------- */\n\n#ifndef WGL_NV_present_video\n#define WGL_NV_present_video 1\n\n#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0\n\nDECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);\n\ntypedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList);\ntypedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList);\ntypedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue);\n\n#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV)\n#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV)\n#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV)\n\n#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video)\n\n#endif /* WGL_NV_present_video */\n\n/* ---------------------- WGL_NV_render_depth_texture ---------------------- */\n\n#ifndef WGL_NV_render_depth_texture\n#define WGL_NV_render_depth_texture 1\n\n#define WGL_NO_TEXTURE_ARB 0x2077\n#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4\n#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5\n#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6\n#define WGL_DEPTH_COMPONENT_NV 0x20A7\n\n#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture)\n\n#endif /* WGL_NV_render_depth_texture */\n\n/* -------------------- WGL_NV_render_texture_rectangle -------------------- */\n\n#ifndef WGL_NV_render_texture_rectangle\n#define WGL_NV_render_texture_rectangle 1\n\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0\n#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1\n#define WGL_TEXTURE_RECTANGLE_NV 0x20A2\n\n#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle)\n\n#endif /* WGL_NV_render_texture_rectangle */\n\n/* --------------------------- WGL_NV_swap_group --------------------------- */\n\n#ifndef WGL_NV_swap_group\n#define WGL_NV_swap_group 1\n\ntypedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);\ntypedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);\ntypedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count);\ntypedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers);\ntypedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier);\ntypedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);\n\n#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV)\n#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV)\n#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV)\n#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV)\n#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV)\n#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV)\n\n#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group)\n\n#endif /* WGL_NV_swap_group */\n\n/* ----------------------- WGL_NV_vertex_array_range ----------------------- */\n\n#ifndef WGL_NV_vertex_array_range\n#define WGL_NV_vertex_array_range 1\n\ntypedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);\ntypedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);\n\n#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV)\n#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV)\n\n#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range)\n\n#endif /* WGL_NV_vertex_array_range */\n\n/* -------------------------- WGL_NV_video_capture ------------------------- */\n\n#ifndef WGL_NV_video_capture\n#define WGL_NV_video_capture 1\n\n#define WGL_UNIQUE_ID_NV 0x20CE\n#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF\n\nDECLARE_HANDLE(HVIDEOINPUTDEVICENV);\n\ntypedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);\ntypedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList);\ntypedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);\ntypedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue);\ntypedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);\n\n#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV)\n#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV)\n#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV)\n#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV)\n#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV)\n\n#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture)\n\n#endif /* WGL_NV_video_capture */\n\n/* -------------------------- WGL_NV_video_output -------------------------- */\n\n#ifndef WGL_NV_video_output\n#define WGL_NV_video_output 1\n\n#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0\n#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1\n#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2\n#define WGL_VIDEO_OUT_COLOR_NV 0x20C3\n#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4\n#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5\n#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6\n#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7\n#define WGL_VIDEO_OUT_FRAME 0x20C8\n#define WGL_VIDEO_OUT_FIELD_1 0x20C9\n#define WGL_VIDEO_OUT_FIELD_2 0x20CA\n#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB\n#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC\n\nDECLARE_HANDLE(HPVIDEODEV);\n\ntypedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);\ntypedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice);\ntypedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);\ntypedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);\ntypedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);\ntypedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock);\n\n#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV)\n#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV)\n#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV)\n#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV)\n#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV)\n#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV)\n\n#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output)\n\n#endif /* WGL_NV_video_output */\n\n/* -------------------------- WGL_OML_sync_control ------------------------- */\n\n#ifndef WGL_OML_sync_control\n#define WGL_OML_sync_control 1\n\ntypedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator);\ntypedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc);\ntypedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);\ntypedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);\ntypedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc);\ntypedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc);\n\n#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML)\n#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML)\n#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML)\n#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML)\n#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML)\n#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML)\n\n#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control)\n\n#endif /* WGL_OML_sync_control */\n\n/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n#define WGLEW_EXPORT\n#else\n#define WGLEW_EXPORT GLEWAPI\n#endif /* GLEW_MX */\n\n#ifdef GLEW_MX\nstruct WGLEWContextStruct\n{\n#endif /* GLEW_MX */\n\nWGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL;\n\nWGLEW_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD;\nWGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD;\nWGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD;\nWGLEW_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD;\nWGLEW_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD;\nWGLEW_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD;\nWGLEW_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD;\nWGLEW_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;\nWGLEW_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD;\n\nWGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;\nWGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;\nWGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;\nWGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;\n\nWGLEW_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB;\n\nWGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;\n\nWGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;\nWGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;\n\nWGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;\nWGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;\nWGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;\nWGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;\nWGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;\n\nWGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;\nWGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;\nWGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;\n\nWGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;\nWGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;\nWGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;\n\nWGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;\nWGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;\nWGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;\nWGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;\n\nWGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;\n\nWGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;\nWGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;\n\nWGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;\nWGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;\nWGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;\nWGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;\nWGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;\n\nWGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;\nWGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;\nWGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;\n\nWGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;\nWGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;\n\nWGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;\nWGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;\n\nWGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;\nWGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;\nWGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;\nWGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;\n\nWGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;\nWGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;\nWGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;\nWGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;\nWGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;\nWGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;\nWGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;\nWGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;\nWGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;\nWGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;\nWGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;\nWGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;\n\nWGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;\nWGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;\nWGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;\nWGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;\n\nWGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;\nWGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;\nWGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;\nWGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;\n\nWGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;\nWGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;\nWGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;\nWGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;\n\nWGLEW_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV;\nWGLEW_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV;\nWGLEW_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV;\nWGLEW_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV;\nWGLEW_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV;\nWGLEW_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV;\nWGLEW_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV;\nWGLEW_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV;\n\nWGLEW_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;\n\nWGLEW_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;\nWGLEW_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;\nWGLEW_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;\nWGLEW_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV;\nWGLEW_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV;\n\nWGLEW_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV;\nWGLEW_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV;\nWGLEW_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV;\n\nWGLEW_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV;\nWGLEW_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV;\nWGLEW_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV;\nWGLEW_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV;\nWGLEW_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV;\nWGLEW_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;\n\nWGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;\nWGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;\n\nWGLEW_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV;\nWGLEW_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV;\nWGLEW_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV;\nWGLEW_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV;\nWGLEW_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV;\n\nWGLEW_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;\nWGLEW_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;\nWGLEW_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;\nWGLEW_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV;\nWGLEW_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV;\nWGLEW_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV;\n\nWGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;\nWGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;\nWGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;\nWGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;\nWGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;\nWGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;\nWGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample;\nWGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control;\nWGLEW_EXPORT GLboolean __WGLEW_AMD_gpu_association;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_create_context;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_profile;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_robustness;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_multisample;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;\nWGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture;\nWGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;\nWGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_multisample;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float;\nWGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control;\nWGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control;\nWGLEW_EXPORT GLboolean __WGLEW_I3D_gamma;\nWGLEW_EXPORT GLboolean __WGLEW_I3D_genlock;\nWGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer;\nWGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;\nWGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;\nWGLEW_EXPORT GLboolean __WGLEW_NV_DX_interop;\nWGLEW_EXPORT GLboolean __WGLEW_NV_copy_image;\nWGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer;\nWGLEW_EXPORT GLboolean __WGLEW_NV_gpu_affinity;\nWGLEW_EXPORT GLboolean __WGLEW_NV_multisample_coverage;\nWGLEW_EXPORT GLboolean __WGLEW_NV_present_video;\nWGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture;\nWGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;\nWGLEW_EXPORT GLboolean __WGLEW_NV_swap_group;\nWGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range;\nWGLEW_EXPORT GLboolean __WGLEW_NV_video_capture;\nWGLEW_EXPORT GLboolean __WGLEW_NV_video_output;\nWGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;\n\n#ifdef GLEW_MX\n}; /* WGLEWContextStruct */\n#endif /* GLEW_MX */\n\n/* ------------------------------------------------------------------------- */\n\n#ifdef GLEW_MX\n\ntypedef struct WGLEWContextStruct WGLEWContext;\nGLEWAPI GLenum wglewContextInit (WGLEWContext* ctx);\nGLEWAPI GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char* name);\n\n#define wglewInit() wglewContextInit(wglewGetContext())\n#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)\n\n#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x))\n#define WGLEW_GET_FUN(x) wglewGetContext()->x\n\n#else /* GLEW_MX */\n\n#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)\n#define WGLEW_GET_FUN(x) x\n\nGLEWAPI GLboolean wglewIsSupported (const char* name);\n\n#endif /* GLEW_MX */\n\nGLEWAPI GLboolean wglewGetExtension (const char* name);\n\n#ifdef __cplusplus\n}\n#endif\n\n#undef GLEWAPI\n\n#endif /* __wglew_h__ */\n"
  },
  {
    "path": "cocos2d/external/win32-specific/icon/include/iconv.h",
    "content": "/* Copyright (C) 1999-2003 Free Software Foundation, Inc.\n   This file is part of the GNU LIBICONV Library.\n\n   The GNU LIBICONV Library is free software; you can redistribute it\n   and/or modify it under the terms of the GNU Library General Public\n   License as published by the Free Software Foundation; either version 2\n   of the License, or (at your option) any later version.\n\n   The GNU LIBICONV Library is distributed in the hope that it will be\n   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Library General Public License for more details.\n\n   You should have received a copy of the GNU Library General Public\n   License along with the GNU LIBICONV Library; see the file COPYING.LIB.\n   If not, write to the Free Software Foundation, Inc., 59 Temple Place -\n   Suite 330, Boston, MA 02111-1307, USA.  */\n\n/* When installed, this file is called \"iconv.h\". */\n\n#ifndef _LIBICONV_H\n#define _LIBICONV_H\n\n#define _LIBICONV_VERSION 0x0109    /* version number: (major<<8) + minor */\nextern int _libiconv_version;       /* Likewise */\n\n/* We would like to #include any system header file which could define\n   iconv_t, 1. in order to eliminate the risk that the user gets compilation\n   errors because some other system header file includes /usr/include/iconv.h\n   which defines iconv_t or declares iconv after this file, 2. when compiling\n   for LIBICONV_PLUG, we need the proper iconv_t type in order to produce\n   binary compatible code.\n   But gcc's #include_next is not portable. Thus, once libiconv's iconv.h\n   has been installed in /usr/local/include, there is no way any more to\n   include the original /usr/include/iconv.h. We simply have to get away\n   without it.\n   Ad 1. The risk that a system header file does\n   #include \"iconv.h\"  or  #include_next \"iconv.h\"\n   is small. They all do #include <iconv.h>.\n   Ad 2. The iconv_t type is a pointer type in all cases I have seen. (It\n   has to be a scalar type because (iconv_t)(-1) is a possible return value\n   from iconv_open().) */\n\n/* Define iconv_t ourselves. */\n#undef iconv_t\n#define iconv_t libiconv_t\ntypedef void* iconv_t;\n\n/* Get size_t declaration. */\n#include <stddef.h>\n\n/* Get errno declaration and values. */\n#include <errno.h>\n/* Some systems, like SunOS 4, don't have EILSEQ. Some systems, like BSD/OS,\n   have EILSEQ in a different header.  On these systems, define EILSEQ\n   ourselves. */\n#ifndef EILSEQ\n/* Igor: called upon EILSEQ from glibc, since autogeneration of this header\n    on Windows didn't do the job. */\n/* #define EILSEQ @EILSEQ@ */\n#define EILSEQ 84\n#endif\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/* Allocates descriptor for code conversion from encoding `fromcode' to\n   encoding `tocode'. */\n#ifndef LIBICONV_PLUG\n#define iconv_open libiconv_open\n#endif\nextern iconv_t iconv_open (const char* tocode, const char* fromcode);\n\n/* Converts, using conversion descriptor `cd', at most `*inbytesleft' bytes\n   starting at `*inbuf', writing at most `*outbytesleft' bytes starting at\n   `*outbuf'.\n   Decrements `*inbytesleft' and increments `*inbuf' by the same amount.\n   Decrements `*outbytesleft' and increments `*outbuf' by the same amount. */\n#ifndef LIBICONV_PLUG\n#define iconv libiconv\n#endif\nextern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);\n\n/* Frees resources allocated for conversion descriptor `cd'. */\n#ifndef LIBICONV_PLUG\n#define iconv_close libiconv_close\n#endif\nextern int iconv_close (iconv_t cd);\n\n\n#ifndef LIBICONV_PLUG\n\n/* Nonstandard extensions. */\n\n/* Control of attributes. */\n#define iconvctl libiconvctl\nextern int iconvctl (iconv_t cd, int request, void* argument);\n\n/* Requests for iconvctl. */\n#define ICONV_TRIVIALP            0  /* int *argument */\n#define ICONV_GET_TRANSLITERATE   1  /* int *argument */\n#define ICONV_SET_TRANSLITERATE   2  /* const int *argument */\n#define ICONV_GET_DISCARD_ILSEQ   3  /* int *argument */\n#define ICONV_SET_DISCARD_ILSEQ   4  /* const int *argument */\n\n/* Listing of locale independent encodings. */\n#define iconvlist libiconvlist\nextern void iconvlist (int (*do_one) (unsigned int namescount,\n                                      const char * const * names,\n                                      void* data),\n                       void* data);\n\n/* Support for relocatable packages.  */\n\n/* Sets the original and the current installation prefix of the package.\n   Relocation simply replaces a pathname starting with the original prefix\n   by the corresponding pathname with the current prefix instead.  Both\n   prefixes should be directory names without trailing slash (i.e. use \"\"\n   instead of \"/\").  */\nextern void libiconv_set_relocation_prefix (const char *orig_prefix,\n                        const char *curr_prefix);\n\n#endif\n\n\n#ifdef __cplusplus\n}\n#endif\n\n\n#endif /* _LIBICONV_H */\n"
  },
  {
    "path": "cocos2d/external/win32-specific/zlib/include/zconf.h",
    "content": "/* zconf.h -- configuration of the zlib compression library\n * Copyright (C) 1995-2010 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#ifndef ZCONF_H\n#define ZCONF_H\n\n/*\n * If you *really* need a unique prefix for all types and library functions,\n * compile with -DZ_PREFIX. The \"standard\" zlib should be compiled without it.\n * Even better than compiling with -DZ_PREFIX would be to use configure to set\n * this permanently in zconf.h using \"./configure --zprefix\".\n */\n#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */\n\n/* all linked symbols */\n#  define _dist_code            z__dist_code\n#  define _length_code          z__length_code\n#  define _tr_align             z__tr_align\n#  define _tr_flush_block       z__tr_flush_block\n#  define _tr_init              z__tr_init\n#  define _tr_stored_block      z__tr_stored_block\n#  define _tr_tally             z__tr_tally\n#  define adler32               z_adler32\n#  define adler32_combine       z_adler32_combine\n#  define adler32_combine64     z_adler32_combine64\n#  define compress              z_compress\n#  define compress2             z_compress2\n#  define compressBound         z_compressBound\n#  define crc32                 z_crc32\n#  define crc32_combine         z_crc32_combine\n#  define crc32_combine64       z_crc32_combine64\n#  define deflate               z_deflate\n#  define deflateBound          z_deflateBound\n#  define deflateCopy           z_deflateCopy\n#  define deflateEnd            z_deflateEnd\n#  define deflateInit2_         z_deflateInit2_\n#  define deflateInit_          z_deflateInit_\n#  define deflateParams         z_deflateParams\n#  define deflatePrime          z_deflatePrime\n#  define deflateReset          z_deflateReset\n#  define deflateSetDictionary  z_deflateSetDictionary\n#  define deflateSetHeader      z_deflateSetHeader\n#  define deflateTune           z_deflateTune\n#  define deflate_copyright     z_deflate_copyright\n#  define get_crc_table         z_get_crc_table\n#  define gz_error              z_gz_error\n#  define gz_intmax             z_gz_intmax\n#  define gz_strwinerror        z_gz_strwinerror\n#  define gzbuffer              z_gzbuffer\n#  define gzclearerr            z_gzclearerr\n#  define gzclose               z_gzclose\n#  define gzclose_r             z_gzclose_r\n#  define gzclose_w             z_gzclose_w\n#  define gzdirect              z_gzdirect\n#  define gzdopen               z_gzdopen\n#  define gzeof                 z_gzeof\n#  define gzerror               z_gzerror\n#  define gzflush               z_gzflush\n#  define gzgetc                z_gzgetc\n#  define gzgets                z_gzgets\n#  define gzoffset              z_gzoffset\n#  define gzoffset64            z_gzoffset64\n#  define gzopen                z_gzopen\n#  define gzopen64              z_gzopen64\n#  define gzprintf              z_gzprintf\n#  define gzputc                z_gzputc\n#  define gzputs                z_gzputs\n#  define gzread                z_gzread\n#  define gzrewind              z_gzrewind\n#  define gzseek                z_gzseek\n#  define gzseek64              z_gzseek64\n#  define gzsetparams           z_gzsetparams\n#  define gztell                z_gztell\n#  define gztell64              z_gztell64\n#  define gzungetc              z_gzungetc\n#  define gzwrite               z_gzwrite\n#  define inflate               z_inflate\n#  define inflateBack           z_inflateBack\n#  define inflateBackEnd        z_inflateBackEnd\n#  define inflateBackInit_      z_inflateBackInit_\n#  define inflateCopy           z_inflateCopy\n#  define inflateEnd            z_inflateEnd\n#  define inflateGetHeader      z_inflateGetHeader\n#  define inflateInit2_         z_inflateInit2_\n#  define inflateInit_          z_inflateInit_\n#  define inflateMark           z_inflateMark\n#  define inflatePrime          z_inflatePrime\n#  define inflateReset          z_inflateReset\n#  define inflateReset2         z_inflateReset2\n#  define inflateSetDictionary  z_inflateSetDictionary\n#  define inflateSync           z_inflateSync\n#  define inflateSyncPoint      z_inflateSyncPoint\n#  define inflateUndermine      z_inflateUndermine\n#  define inflate_copyright     z_inflate_copyright\n#  define inflate_fast          z_inflate_fast\n#  define inflate_table         z_inflate_table\n#  define uncompress            z_uncompress\n#  define zError                z_zError\n#  define zcalloc               z_zcalloc\n#  define zcfree                z_zcfree\n#  define zlibCompileFlags      z_zlibCompileFlags\n#  define zlibVersion           z_zlibVersion\n\n/* all zlib typedefs in zlib.h and zconf.h */\n#  define Byte                  z_Byte\n#  define Bytef                 z_Bytef\n#  define alloc_func            z_alloc_func\n#  define charf                 z_charf\n#  define free_func             z_free_func\n#  define gzFile                z_gzFile\n#  define gz_header             z_gz_header\n#  define gz_headerp            z_gz_headerp\n#  define in_func               z_in_func\n#  define intf                  z_intf\n#  define out_func              z_out_func\n#  define uInt                  z_uInt\n#  define uIntf                 z_uIntf\n#  define uLong                 z_uLong\n#  define uLongf                z_uLongf\n#  define voidp                 z_voidp\n#  define voidpc                z_voidpc\n#  define voidpf                z_voidpf\n\n/* all zlib structs in zlib.h and zconf.h */\n#  define gz_header_s           z_gz_header_s\n#  define internal_state        z_internal_state\n\n#endif\n\n#if defined(__MSDOS__) && !defined(MSDOS)\n#  define MSDOS\n#endif\n#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)\n#  define OS2\n#endif\n#if defined(_WINDOWS) && !defined(WINDOWS)\n#  define WINDOWS\n#endif\n#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)\n#  ifndef WIN32\n#    define WIN32\n#  endif\n#endif\n#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)\n#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)\n#    ifndef SYS16BIT\n#      define SYS16BIT\n#    endif\n#  endif\n#endif\n\n/*\n * Compile with -DMAXSEG_64K if the alloc function cannot allocate more\n * than 64k bytes at a time (needed on systems with 16-bit int).\n */\n#ifdef SYS16BIT\n#  define MAXSEG_64K\n#endif\n#ifdef MSDOS\n#  define UNALIGNED_OK\n#endif\n\n#ifdef __STDC_VERSION__\n#  ifndef STDC\n#    define STDC\n#  endif\n#  if __STDC_VERSION__ >= 199901L\n#    ifndef STDC99\n#      define STDC99\n#    endif\n#  endif\n#endif\n#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))\n#  define STDC\n#endif\n\n#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */\n#  define STDC\n#endif\n\n#ifndef STDC\n#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */\n#    define const       /* note: need a more gentle solution here */\n#  endif\n#endif\n\n/* Some Mac compilers merge all .h files incorrectly: */\n#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)\n#  define NO_DUMMY_DECL\n#endif\n\n/* Maximum value for memLevel in deflateInit2 */\n#ifndef MAX_MEM_LEVEL\n#  ifdef MAXSEG_64K\n#    define MAX_MEM_LEVEL 8\n#  else\n#    define MAX_MEM_LEVEL 9\n#  endif\n#endif\n\n/* Maximum value for windowBits in deflateInit2 and inflateInit2.\n * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files\n * created by gzip. (Files created by minigzip can still be extracted by\n * gzip.)\n */\n#ifndef MAX_WBITS\n#  define MAX_WBITS   15 /* 32K LZ77 window */\n#endif\n\n/* The memory requirements for deflate are (in bytes):\n            (1 << (windowBits+2)) +  (1 << (memLevel+9))\n that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)\n plus a few kilobytes for small objects. For example, if you want to reduce\n the default memory requirements from 256K to 128K, compile with\n     make CFLAGS=\"-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7\"\n Of course this will generally degrade compression (there's no free lunch).\n\n   The memory requirements for inflate are (in bytes) 1 << windowBits\n that is, 32K for windowBits=15 (default value) plus a few kilobytes\n for small objects.\n*/\n\n                        /* Type declarations */\n\n#ifndef OF /* function prototypes */\n#  ifdef STDC\n#    define OF(args)  args\n#  else\n#    define OF(args)  ()\n#  endif\n#endif\n\n/* The following definitions for FAR are needed only for MSDOS mixed\n * model programming (small or medium model with some far allocations).\n * This was tested only with MSC; for other MSDOS compilers you may have\n * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,\n * just define FAR to be empty.\n */\n#ifdef SYS16BIT\n#  if defined(M_I86SM) || defined(M_I86MM)\n     /* MSC small or medium model */\n#    define SMALL_MEDIUM\n#    ifdef _MSC_VER\n#      define FAR _far\n#    else\n#      define FAR far\n#    endif\n#  endif\n#  if (defined(__SMALL__) || defined(__MEDIUM__))\n     /* Turbo C small or medium model */\n#    define SMALL_MEDIUM\n#    ifdef __BORLANDC__\n#      define FAR _far\n#    else\n#      define FAR far\n#    endif\n#  endif\n#endif\n\n#if defined(WINDOWS) || defined(WIN32)\n   /* If building or using zlib as a DLL, define ZLIB_DLL.\n    * This is not mandatory, but it offers a little performance increase.\n    */\n#  ifdef ZLIB_DLL\n#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))\n#      ifdef ZLIB_INTERNAL\n#        define ZEXTERN extern __declspec(dllexport)\n#      else\n#        define ZEXTERN extern __declspec(dllimport)\n#      endif\n#    endif\n#  endif  /* ZLIB_DLL */\n   /* If building or using zlib with the WINAPI/WINAPIV calling convention,\n    * define ZLIB_WINAPI.\n    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.\n    */\n#  ifdef ZLIB_WINAPI\n#    ifdef FAR\n#      undef FAR\n#    endif\n#    include <windows.h>\n     /* No need for _export, use ZLIB.DEF instead. */\n     /* For complete Windows compatibility, use WINAPI, not __stdcall. */\n#    define ZEXPORT WINAPI\n#    ifdef WIN32\n#      define ZEXPORTVA WINAPIV\n#    else\n#      define ZEXPORTVA FAR CDECL\n#    endif\n#  endif\n#endif\n\n#if defined (__BEOS__)\n#  ifdef ZLIB_DLL\n#    ifdef ZLIB_INTERNAL\n#      define ZEXPORT   __declspec(dllexport)\n#      define ZEXPORTVA __declspec(dllexport)\n#    else\n#      define ZEXPORT   __declspec(dllimport)\n#      define ZEXPORTVA __declspec(dllimport)\n#    endif\n#  endif\n#endif\n\n#ifndef ZEXTERN\n#  define ZEXTERN extern\n#endif\n#ifndef ZEXPORT\n#  define ZEXPORT\n#endif\n#ifndef ZEXPORTVA\n#  define ZEXPORTVA\n#endif\n\n#ifndef FAR\n#  define FAR\n#endif\n\n#if !defined(__MACTYPES__)\ntypedef unsigned char  Byte;  /* 8 bits */\n#endif\ntypedef unsigned int   uInt;  /* 16 bits or more */\ntypedef unsigned long  uLong; /* 32 bits or more */\n\n#ifdef SMALL_MEDIUM\n   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */\n#  define Bytef Byte FAR\n#else\n   typedef Byte  FAR Bytef;\n#endif\ntypedef char  FAR charf;\ntypedef int   FAR intf;\ntypedef uInt  FAR uIntf;\ntypedef uLong FAR uLongf;\n\n#ifdef STDC\n   typedef void const *voidpc;\n   typedef void FAR   *voidpf;\n   typedef void       *voidp;\n#else\n   typedef Byte const *voidpc;\n   typedef Byte FAR   *voidpf;\n   typedef Byte       *voidp;\n#endif\n\n#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */\n#  define Z_HAVE_UNISTD_H\n#endif\n\n#ifdef STDC\n#  include <sys/types.h>    /* for off_t */\n#endif\n\n/* a little trick to accommodate both \"#define _LARGEFILE64_SOURCE\" and\n * \"#define _LARGEFILE64_SOURCE 1\" as requesting 64-bit operations, (even\n * though the former does not conform to the LFS document), but considering\n * both \"#undef _LARGEFILE64_SOURCE\" and \"#define _LARGEFILE64_SOURCE 0\" as\n * equivalently requesting no 64-bit operations\n */\n#if -_LARGEFILE64_SOURCE - -1 == 1\n#  undef _LARGEFILE64_SOURCE\n#endif\n\n#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)\n#  include <unistd.h>       /* for SEEK_* and off_t */\n#  ifdef VMS\n#    include <unixio.h>     /* for off_t */\n#  endif\n#  ifndef z_off_t\n#    define z_off_t off_t\n#  endif\n#endif\n\n#ifndef SEEK_SET\n#  define SEEK_SET        0       /* Seek from beginning of file.  */\n#  define SEEK_CUR        1       /* Seek from current position.  */\n#  define SEEK_END        2       /* Set file pointer to EOF plus \"offset\" */\n#endif\n\n#ifndef z_off_t\n#  define z_off_t long\n#endif\n\n#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0\n#  define z_off64_t off64_t\n#else\n#  define z_off64_t z_off_t\n#endif\n\n#if defined(__OS400__)\n#  define NO_vsnprintf\n#endif\n\n#if defined(__MVS__)\n#  define NO_vsnprintf\n#endif\n\n/* MVS linker does not support external names larger than 8 bytes */\n#if defined(__MVS__)\n  #pragma map(deflateInit_,\"DEIN\")\n  #pragma map(deflateInit2_,\"DEIN2\")\n  #pragma map(deflateEnd,\"DEEND\")\n  #pragma map(deflateBound,\"DEBND\")\n  #pragma map(inflateInit_,\"ININ\")\n  #pragma map(inflateInit2_,\"ININ2\")\n  #pragma map(inflateEnd,\"INEND\")\n  #pragma map(inflateSync,\"INSY\")\n  #pragma map(inflateSetDictionary,\"INSEDI\")\n  #pragma map(compressBound,\"CMBND\")\n  #pragma map(inflate_table,\"INTABL\")\n  #pragma map(inflate_fast,\"INFA\")\n  #pragma map(inflate_copyright,\"INCOPY\")\n#endif\n\n#endif /* ZCONF_H */\n"
  },
  {
    "path": "cocos2d/external/win32-specific/zlib/include/zlib.h",
    "content": "/* zlib.h -- interface of the 'zlib' general purpose compression library\n  version 1.2.5, April 19th, 2010\n\n  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler\n\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the authors be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  Jean-loup Gailly        Mark Adler\n  jloup@gzip.org          madler@alumni.caltech.edu\n\n\n  The data format used by the zlib library is described by RFCs (Request for\n  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt\n  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).\n*/\n\n#ifndef ZLIB_H\n#define ZLIB_H\n\n#include \"zconf.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define ZLIB_VERSION \"1.2.5\"\n#define ZLIB_VERNUM 0x1250\n#define ZLIB_VER_MAJOR 1\n#define ZLIB_VER_MINOR 2\n#define ZLIB_VER_REVISION 5\n#define ZLIB_VER_SUBREVISION 0\n\n/*\n    The 'zlib' compression library provides in-memory compression and\n  decompression functions, including integrity checks of the uncompressed data.\n  This version of the library supports only one compression method (deflation)\n  but other algorithms will be added later and will have the same stream\n  interface.\n\n    Compression can be done in a single step if the buffers are large enough,\n  or can be done by repeated calls of the compression function.  In the latter\n  case, the application must provide more input and/or consume the output\n  (providing more output space) before each call.\n\n    The compressed data format used by default by the in-memory functions is\n  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped\n  around a deflate stream, which is itself documented in RFC 1951.\n\n    The library also supports reading and writing files in gzip (.gz) format\n  with an interface similar to that of stdio using the functions that start\n  with \"gz\".  The gzip format is different from the zlib format.  gzip is a\n  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.\n\n    This library can optionally read and write gzip streams in memory as well.\n\n    The zlib format was designed to be compact and fast for use in memory\n  and on communications channels.  The gzip format was designed for single-\n  file compression on file systems, has a larger header than zlib to maintain\n  directory information, and uses a different, slower check method than zlib.\n\n    The library does not install any signal handler.  The decoder checks\n  the consistency of the compressed data, so the library should never crash\n  even in case of corrupted input.\n*/\n\ntypedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));\ntypedef void   (*free_func)  OF((voidpf opaque, voidpf address));\n\nstruct internal_state;\n\ntypedef struct z_stream_s {\n    Bytef    *next_in;  /* next input byte */\n    uInt     avail_in;  /* number of bytes available at next_in */\n    uLong    total_in;  /* total nb of input bytes read so far */\n\n    Bytef    *next_out; /* next output byte should be put there */\n    uInt     avail_out; /* remaining free space at next_out */\n    uLong    total_out; /* total nb of bytes output so far */\n\n    char     *msg;      /* last error message, NULL if no error */\n    struct internal_state FAR *state; /* not visible by applications */\n\n    alloc_func zalloc;  /* used to allocate the internal state */\n    free_func  zfree;   /* used to free the internal state */\n    voidpf     opaque;  /* private data object passed to zalloc and zfree */\n\n    int     data_type;  /* best guess about the data type: binary or text */\n    uLong   adler;      /* adler32 value of the uncompressed data */\n    uLong   reserved;   /* reserved for future use */\n} z_stream;\n\ntypedef z_stream FAR *z_streamp;\n\n/*\n     gzip header information passed to and from zlib routines.  See RFC 1952\n  for more details on the meanings of these fields.\n*/\ntypedef struct gz_header_s {\n    int     text;       /* true if compressed data believed to be text */\n    uLong   time;       /* modification time */\n    int     xflags;     /* extra flags (not used when writing a gzip file) */\n    int     os;         /* operating system */\n    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */\n    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */\n    uInt    extra_max;  /* space at extra (only when reading header) */\n    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */\n    uInt    name_max;   /* space at name (only when reading header) */\n    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */\n    uInt    comm_max;   /* space at comment (only when reading header) */\n    int     hcrc;       /* true if there was or will be a header crc */\n    int     done;       /* true when done reading gzip header (not used\n                           when writing a gzip file) */\n} gz_header;\n\ntypedef gz_header FAR *gz_headerp;\n\n/*\n     The application must update next_in and avail_in when avail_in has dropped\n   to zero.  It must update next_out and avail_out when avail_out has dropped\n   to zero.  The application must initialize zalloc, zfree and opaque before\n   calling the init function.  All other fields are set by the compression\n   library and must not be updated by the application.\n\n     The opaque value provided by the application will be passed as the first\n   parameter for calls of zalloc and zfree.  This can be useful for custom\n   memory management.  The compression library attaches no meaning to the\n   opaque value.\n\n     zalloc must return Z_NULL if there is not enough memory for the object.\n   If zlib is used in a multi-threaded application, zalloc and zfree must be\n   thread safe.\n\n     On 16-bit systems, the functions zalloc and zfree must be able to allocate\n   exactly 65536 bytes, but will not be required to allocate more than this if\n   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers\n   returned by zalloc for objects of exactly 65536 bytes *must* have their\n   offset normalized to zero.  The default allocation function provided by this\n   library ensures this (see zutil.c).  To reduce memory requirements and avoid\n   any allocation of 64K objects, at the expense of compression ratio, compile\n   the library with -DMAX_WBITS=14 (see zconf.h).\n\n     The fields total_in and total_out can be used for statistics or progress\n   reports.  After compression, total_in holds the total size of the\n   uncompressed data and may be saved for use in the decompressor (particularly\n   if the decompressor wants to decompress everything in a single step).\n*/\n\n                        /* constants */\n\n#define Z_NO_FLUSH      0\n#define Z_PARTIAL_FLUSH 1\n#define Z_SYNC_FLUSH    2\n#define Z_FULL_FLUSH    3\n#define Z_FINISH        4\n#define Z_BLOCK         5\n#define Z_TREES         6\n/* Allowed flush values; see deflate() and inflate() below for details */\n\n#define Z_OK            0\n#define Z_STREAM_END    1\n#define Z_NEED_DICT     2\n#define Z_ERRNO        (-1)\n#define Z_STREAM_ERROR (-2)\n#define Z_DATA_ERROR   (-3)\n#define Z_MEM_ERROR    (-4)\n#define Z_BUF_ERROR    (-5)\n#define Z_VERSION_ERROR (-6)\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n\n#define Z_NO_COMPRESSION         0\n#define Z_BEST_SPEED             1\n#define Z_BEST_COMPRESSION       9\n#define Z_DEFAULT_COMPRESSION  (-1)\n/* compression levels */\n\n#define Z_FILTERED            1\n#define Z_HUFFMAN_ONLY        2\n#define Z_RLE                 3\n#define Z_FIXED               4\n#define Z_DEFAULT_STRATEGY    0\n/* compression strategy; see deflateInit2() below for details */\n\n#define Z_BINARY   0\n#define Z_TEXT     1\n#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */\n#define Z_UNKNOWN  2\n/* Possible values of the data_type field (though see inflate()) */\n\n#define Z_DEFLATED   8\n/* The deflate compression method (the only one supported in this version) */\n\n#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */\n\n#define zlib_version zlibVersion()\n/* for compatibility with versions < 1.0.2 */\n\n\n                        /* basic functions */\n\nZEXTERN const char * ZEXPORT zlibVersion OF((void));\n/* The application can compare zlibVersion and ZLIB_VERSION for consistency.\n   If the first character differs, the library code actually used is not\n   compatible with the zlib.h header file used by the application.  This check\n   is automatically made by deflateInit and inflateInit.\n */\n\n/*\nZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));\n\n     Initializes the internal stream state for compression.  The fields\n   zalloc, zfree and opaque must be initialized before by the caller.  If\n   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default\n   allocation functions.\n\n     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:\n   1 gives best speed, 9 gives best compression, 0 gives no compression at all\n   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION\n   requests a default compromise between speed and compression (currently\n   equivalent to level 6).\n\n     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if level is not a valid compression level, or\n   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible\n   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null\n   if there is no error message.  deflateInit does not perform any compression:\n   this will be done by deflate().\n*/\n\n\nZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));\n/*\n    deflate compresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full.  It may introduce\n  some output latency (reading input without producing any output) except when\n  forced to flush.\n\n    The detailed semantics are as follows.  deflate performs one or both of the\n  following actions:\n\n  - Compress more input starting at next_in and update next_in and avail_in\n    accordingly.  If not all input can be processed (because there is not\n    enough room in the output buffer), next_in and avail_in are updated and\n    processing will resume at this point for the next call of deflate().\n\n  - Provide more output starting at next_out and update next_out and avail_out\n    accordingly.  This action is forced if the parameter flush is non zero.\n    Forcing flush frequently degrades the compression ratio, so this parameter\n    should be set only when necessary (in interactive applications).  Some\n    output may be provided even if flush is not set.\n\n    Before the call of deflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming more\n  output, and updating avail_in or avail_out accordingly; avail_out should\n  never be zero before the call.  The application can consume the compressed\n  output when it wants, for example when the output buffer is full (avail_out\n  == 0), or after each call of deflate().  If deflate returns Z_OK and with\n  zero avail_out, it must be called again after making room in the output\n  buffer because there might be more output pending.\n\n    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to\n  decide how much data to accumulate before producing output, in order to\n  maximize compression.\n\n    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is\n  flushed to the output buffer and the output is aligned on a byte boundary, so\n  that the decompressor can get all input data available so far.  (In\n  particular avail_in is zero after the call if enough output space has been\n  provided before the call.) Flushing may degrade compression for some\n  compression algorithms and so it should be used only when necessary.  This\n  completes the current deflate block and follows it with an empty stored block\n  that is three bits plus filler bits to the next byte, followed by four bytes\n  (00 00 ff ff).\n\n    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the\n  output buffer, but the output is not aligned to a byte boundary.  All of the\n  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.\n  This completes the current deflate block and follows it with an empty fixed\n  codes block that is 10 bits long.  This assures that enough bytes are output\n  in order for the decompressor to finish the block before the empty fixed code\n  block.\n\n    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as\n  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to\n  seven bits of the current block are held to be written as the next byte after\n  the next deflate block is completed.  In this case, the decompressor may not\n  be provided enough bits at this point in order to complete decompression of\n  the data provided so far to the compressor.  It may need to wait for the next\n  block to be emitted.  This is for advanced applications that need to control\n  the emission of deflate blocks.\n\n    If flush is set to Z_FULL_FLUSH, all output is flushed as with\n  Z_SYNC_FLUSH, and the compression state is reset so that decompression can\n  restart from this point if previous compressed data has been damaged or if\n  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade\n  compression.\n\n    If deflate returns with avail_out == 0, this function must be called again\n  with the same value of the flush parameter and more output space (updated\n  avail_out), until the flush is complete (deflate returns with non-zero\n  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that\n  avail_out is greater than six to avoid repeated flush markers due to\n  avail_out == 0 on return.\n\n    If the parameter flush is set to Z_FINISH, pending input is processed,\n  pending output is flushed and deflate returns with Z_STREAM_END if there was\n  enough output space; if deflate returns with Z_OK, this function must be\n  called again with Z_FINISH and more output space (updated avail_out) but no\n  more input data, until it returns with Z_STREAM_END or an error.  After\n  deflate has returned Z_STREAM_END, the only possible operations on the stream\n  are deflateReset or deflateEnd.\n\n    Z_FINISH can be used immediately after deflateInit if all the compression\n  is to be done in a single step.  In this case, avail_out must be at least the\n  value returned by deflateBound (see below).  If deflate does not return\n  Z_STREAM_END, then it must be called again as described above.\n\n    deflate() sets strm->adler to the adler32 checksum of all input read\n  so far (that is, total_in bytes).\n\n    deflate() may update strm->data_type if it can make a good guess about\n  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered\n  binary.  This field is only for information purposes and does not affect the\n  compression algorithm in any manner.\n\n    deflate() returns Z_OK if some progress has been made (more input\n  processed or more output produced), Z_STREAM_END if all input has been\n  consumed and all output has been produced (only when flush is set to\n  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example\n  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible\n  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not\n  fatal, and deflate() can be called again with more input and more output\n  space to continue compressing.\n*/\n\n\nZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any pending\n   output.\n\n     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the\n   stream state was inconsistent, Z_DATA_ERROR if the stream was freed\n   prematurely (some input or output was discarded).  In the error case, msg\n   may be set but then points to a static string (which must not be\n   deallocated).\n*/\n\n\n/*\nZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));\n\n     Initializes the internal stream state for decompression.  The fields\n   next_in, avail_in, zalloc, zfree and opaque must be initialized before by\n   the caller.  If next_in is not Z_NULL and avail_in is large enough (the\n   exact value depends on the compression method), inflateInit determines the\n   compression method from the zlib header and allocates all data structures\n   accordingly; otherwise the allocation will be deferred to the first call of\n   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to\n   use default allocation functions.\n\n     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the\n   version assumed by the caller, or Z_STREAM_ERROR if the parameters are\n   invalid, such as a null pointer to the structure.  msg is set to null if\n   there is no error message.  inflateInit does not perform any decompression\n   apart from possibly reading the zlib header if present: actual decompression\n   will be done by inflate().  (So next_in and avail_in may be modified, but\n   next_out and avail_out are unused and unchanged.) The current implementation\n   of inflateInit() does not process any header information -- that is deferred\n   until inflate() is called.\n*/\n\n\nZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));\n/*\n    inflate decompresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full.  It may introduce\n  some output latency (reading input without producing any output) except when\n  forced to flush.\n\n  The detailed semantics are as follows.  inflate performs one or both of the\n  following actions:\n\n  - Decompress more input starting at next_in and update next_in and avail_in\n    accordingly.  If not all input can be processed (because there is not\n    enough room in the output buffer), next_in is updated and processing will\n    resume at this point for the next call of inflate().\n\n  - Provide more output starting at next_out and update next_out and avail_out\n    accordingly.  inflate() provides as much output as possible, until there is\n    no more input data or no more space in the output buffer (see below about\n    the flush parameter).\n\n    Before the call of inflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming more\n  output, and updating the next_* and avail_* values accordingly.  The\n  application can consume the uncompressed output when it wants, for example\n  when the output buffer is full (avail_out == 0), or after each call of\n  inflate().  If inflate returns Z_OK and with zero avail_out, it must be\n  called again after making room in the output buffer because there might be\n  more output pending.\n\n    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,\n  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much\n  output as possible to the output buffer.  Z_BLOCK requests that inflate()\n  stop if and when it gets to the next deflate block boundary.  When decoding\n  the zlib or gzip format, this will cause inflate() to return immediately\n  after the header and before the first block.  When doing a raw inflate,\n  inflate() will go ahead and process the first block, and will return when it\n  gets to the end of that block, or when it runs out of data.\n\n    The Z_BLOCK option assists in appending to or combining deflate streams.\n  Also to assist in this, on return inflate() will set strm->data_type to the\n  number of unused bits in the last byte taken from strm->next_in, plus 64 if\n  inflate() is currently decoding the last block in the deflate stream, plus\n  128 if inflate() returned immediately after decoding an end-of-block code or\n  decoding the complete header up to just before the first byte of the deflate\n  stream.  The end-of-block will not be indicated until all of the uncompressed\n  data from that block has been written to strm->next_out.  The number of\n  unused bits may in general be greater than seven, except when bit 7 of\n  data_type is set, in which case the number of unused bits will be less than\n  eight.  data_type is set as noted here every time inflate() returns for all\n  flush options, and so can be used to determine the amount of currently\n  consumed input in bits.\n\n    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the\n  end of each deflate block header is reached, before any actual data in that\n  block is decoded.  This allows the caller to determine the length of the\n  deflate block header for later use in random access within a deflate block.\n  256 is added to the value of strm->data_type when inflate() returns\n  immediately after reaching the end of the deflate block header.\n\n    inflate() should normally be called until it returns Z_STREAM_END or an\n  error.  However if all decompression is to be performed in a single step (a\n  single call of inflate), the parameter flush should be set to Z_FINISH.  In\n  this case all pending input is processed and all pending output is flushed;\n  avail_out must be large enough to hold all the uncompressed data.  (The size\n  of the uncompressed data may have been saved by the compressor for this\n  purpose.) The next operation on this stream must be inflateEnd to deallocate\n  the decompression state.  The use of Z_FINISH is never required, but can be\n  used to inform inflate that a faster approach may be used for the single\n  inflate() call.\n\n     In this implementation, inflate() always flushes as much output as\n  possible to the output buffer, and always uses the faster approach on the\n  first call.  So the only effect of the flush parameter in this implementation\n  is on the return value of inflate(), as noted below, or when it returns early\n  because Z_BLOCK or Z_TREES is used.\n\n     If a preset dictionary is needed after this call (see inflateSetDictionary\n  below), inflate sets strm->adler to the adler32 checksum of the dictionary\n  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets\n  strm->adler to the adler32 checksum of all output produced so far (that is,\n  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described\n  below.  At the end of the stream, inflate() checks that its computed adler32\n  checksum is equal to that saved by the compressor and returns Z_STREAM_END\n  only if the checksum is correct.\n\n    inflate() can decompress and check either zlib-wrapped or gzip-wrapped\n  deflate data.  The header type is detected automatically, if requested when\n  initializing with inflateInit2().  Any information contained in the gzip\n  header is not retained, so applications that need that information should\n  instead use raw inflate, see inflateInit2() below, or inflateBack() and\n  perform their own processing of the gzip header and trailer.\n\n    inflate() returns Z_OK if some progress has been made (more input processed\n  or more output produced), Z_STREAM_END if the end of the compressed data has\n  been reached and all uncompressed output has been produced, Z_NEED_DICT if a\n  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was\n  corrupted (input stream not conforming to the zlib format or incorrect check\n  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example\n  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,\n  Z_BUF_ERROR if no progress is possible or if there was not enough room in the\n  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and\n  inflate() can be called again with more input and more output space to\n  continue decompressing.  If Z_DATA_ERROR is returned, the application may\n  then call inflateSync() to look for a good compression block if a partial\n  recovery of the data is desired.\n*/\n\n\nZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any pending\n   output.\n\n     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state\n   was inconsistent.  In the error case, msg may be set but then points to a\n   static string (which must not be deallocated).\n*/\n\n\n                        /* Advanced functions */\n\n/*\n    The following functions are needed only in some special applications.\n*/\n\n/*\nZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,\n                                     int  level,\n                                     int  method,\n                                     int  windowBits,\n                                     int  memLevel,\n                                     int  strategy));\n\n     This is another version of deflateInit with more compression options.  The\n   fields next_in, zalloc, zfree and opaque must be initialized before by the\n   caller.\n\n     The method parameter is the compression method.  It must be Z_DEFLATED in\n   this version of the library.\n\n     The windowBits parameter is the base two logarithm of the window size\n   (the size of the history buffer).  It should be in the range 8..15 for this\n   version of the library.  Larger values of this parameter result in better\n   compression at the expense of memory usage.  The default value is 15 if\n   deflateInit is used instead.\n\n     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits\n   determines the window size.  deflate() will then generate raw deflate data\n   with no zlib header or trailer, and will not compute an adler32 check value.\n\n     windowBits can also be greater than 15 for optional gzip encoding.  Add\n   16 to windowBits to write a simple gzip header and trailer around the\n   compressed data instead of a zlib wrapper.  The gzip header will have no\n   file name, no extra data, no comment, no modification time (set to zero), no\n   header crc, and the operating system will be set to 255 (unknown).  If a\n   gzip stream is being written, strm->adler is a crc32 instead of an adler32.\n\n     The memLevel parameter specifies how much memory should be allocated\n   for the internal compression state.  memLevel=1 uses minimum memory but is\n   slow and reduces compression ratio; memLevel=9 uses maximum memory for\n   optimal speed.  The default value is 8.  See zconf.h for total memory usage\n   as a function of windowBits and memLevel.\n\n     The strategy parameter is used to tune the compression algorithm.  Use the\n   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a\n   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no\n   string match), or Z_RLE to limit match distances to one (run-length\n   encoding).  Filtered data consists mostly of small values with a somewhat\n   random distribution.  In this case, the compression algorithm is tuned to\n   compress them better.  The effect of Z_FILTERED is to force more Huffman\n   coding and less string matching; it is somewhat intermediate between\n   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as\n   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The\n   strategy parameter only affects the compression ratio but not the\n   correctness of the compressed output even if it is not set appropriately.\n   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler\n   decoder for special applications.\n\n     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid\n   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is\n   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is\n   set to null if there is no error message.  deflateInit2 does not perform any\n   compression: this will be done by deflate().\n*/\n\nZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,\n                                             const Bytef *dictionary,\n                                             uInt  dictLength));\n/*\n     Initializes the compression dictionary from the given byte sequence\n   without producing any compressed output.  This function must be called\n   immediately after deflateInit, deflateInit2 or deflateReset, before any call\n   of deflate.  The compressor and decompressor must use exactly the same\n   dictionary (see inflateSetDictionary).\n\n     The dictionary should consist of strings (byte sequences) that are likely\n   to be encountered later in the data to be compressed, with the most commonly\n   used strings preferably put towards the end of the dictionary.  Using a\n   dictionary is most useful when the data to be compressed is short and can be\n   predicted with good accuracy; the data can then be compressed better than\n   with the default empty dictionary.\n\n     Depending on the size of the compression data structures selected by\n   deflateInit or deflateInit2, a part of the dictionary may in effect be\n   discarded, for example if the dictionary is larger than the window size\n   provided in deflateInit or deflateInit2.  Thus the strings most likely to be\n   useful should be put at the end of the dictionary, not at the front.  In\n   addition, the current implementation of deflate will use at most the window\n   size minus 262 bytes of the provided dictionary.\n\n     Upon return of this function, strm->adler is set to the adler32 value\n   of the dictionary; the decompressor may later use this value to determine\n   which dictionary has been used by the compressor.  (The adler32 value\n   applies to the whole dictionary even if only a subset of the dictionary is\n   actually used by the compressor.) If a raw deflate was requested, then the\n   adler32 value is not computed and strm->adler is not set.\n\n     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a\n   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is\n   inconsistent (for example if deflate has already been called for this stream\n   or if the compression method is bsort).  deflateSetDictionary does not\n   perform any compression: this will be done by deflate().\n*/\n\nZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,\n                                    z_streamp source));\n/*\n     Sets the destination stream as a complete copy of the source stream.\n\n     This function can be useful when several compression strategies will be\n   tried, for example when there are several ways of pre-processing the input\n   data with a filter.  The streams that will be discarded should then be freed\n   by calling deflateEnd.  Note that deflateCopy duplicates the internal\n   compression state which can be quite large, so this strategy is slow and can\n   consume lots of memory.\n\n     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent\n   (such as zalloc being Z_NULL).  msg is left unchanged in both source and\n   destination.\n*/\n\nZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));\n/*\n     This function is equivalent to deflateEnd followed by deflateInit,\n   but does not free and reallocate all the internal compression state.  The\n   stream will keep the same compression level and any other attributes that\n   may have been set by deflateInit2.\n\n     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL).\n*/\n\nZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,\n                                      int level,\n                                      int strategy));\n/*\n     Dynamically update the compression level and compression strategy.  The\n   interpretation of level and strategy is as in deflateInit2.  This can be\n   used to switch between compression and straight copy of the input data, or\n   to switch to a different kind of input data requiring a different strategy.\n   If the compression level is changed, the input available so far is\n   compressed with the old level (and may be flushed); the new level will take\n   effect only at the next call of deflate().\n\n     Before the call of deflateParams, the stream state must be set as for\n   a call of deflate(), since the currently available input may have to be\n   compressed and flushed.  In particular, strm->avail_out must be non-zero.\n\n     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source\n   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if\n   strm->avail_out was zero.\n*/\n\nZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,\n                                    int good_length,\n                                    int max_lazy,\n                                    int nice_length,\n                                    int max_chain));\n/*\n     Fine tune deflate's internal compression parameters.  This should only be\n   used by someone who understands the algorithm used by zlib's deflate for\n   searching for the best matching string, and even then only by the most\n   fanatic optimizer trying to squeeze out the last compressed bit for their\n   specific input data.  Read the deflate.c source code for the meaning of the\n   max_lazy, good_length, nice_length, and max_chain parameters.\n\n     deflateTune() can be called after deflateInit() or deflateInit2(), and\n   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.\n */\n\nZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,\n                                       uLong sourceLen));\n/*\n     deflateBound() returns an upper bound on the compressed size after\n   deflation of sourceLen bytes.  It must be called after deflateInit() or\n   deflateInit2(), and after deflateSetHeader(), if used.  This would be used\n   to allocate an output buffer for deflation in a single pass, and so would be\n   called before deflate().\n*/\n\nZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,\n                                     int bits,\n                                     int value));\n/*\n     deflatePrime() inserts bits in the deflate output stream.  The intent\n   is that this function is used to start off the deflate output with the bits\n   leftover from a previous deflate stream when appending to it.  As such, this\n   function can only be used for raw deflate, and must be used before the first\n   deflate() call after a deflateInit2() or deflateReset().  bits must be less\n   than or equal to 16, and that many of the least significant bits of value\n   will be inserted in the output.\n\n     deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\nZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,\n                                         gz_headerp head));\n/*\n     deflateSetHeader() provides gzip header information for when a gzip\n   stream is requested by deflateInit2().  deflateSetHeader() may be called\n   after deflateInit2() or deflateReset() and before the first call of\n   deflate().  The text, time, os, extra field, name, and comment information\n   in the provided gz_header structure are written to the gzip header (xflag is\n   ignored -- the extra flags are set according to the compression level).  The\n   caller must assure that, if not Z_NULL, name and comment are terminated with\n   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are\n   available there.  If hcrc is true, a gzip header crc is included.  Note that\n   the current versions of the command-line version of gzip (up through version\n   1.3.x) do not support header crc's, and will report that it is a \"multi-part\n   gzip file\" and give up.\n\n     If deflateSetHeader is not used, the default gzip header has text false,\n   the time set to zero, and os set to 255, with no extra, name, or comment\n   fields.  The gzip header is returned to the default state by deflateReset().\n\n     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\n/*\nZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,\n                                     int  windowBits));\n\n     This is another version of inflateInit with an extra parameter.  The\n   fields next_in, avail_in, zalloc, zfree and opaque must be initialized\n   before by the caller.\n\n     The windowBits parameter is the base two logarithm of the maximum window\n   size (the size of the history buffer).  It should be in the range 8..15 for\n   this version of the library.  The default value is 15 if inflateInit is used\n   instead.  windowBits must be greater than or equal to the windowBits value\n   provided to deflateInit2() while compressing, or it must be equal to 15 if\n   deflateInit2() was not used.  If a compressed stream with a larger window\n   size is given as input, inflate() will return with the error code\n   Z_DATA_ERROR instead of trying to allocate a larger window.\n\n     windowBits can also be zero to request that inflate use the window size in\n   the zlib header of the compressed stream.\n\n     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits\n   determines the window size.  inflate() will then process raw deflate data,\n   not looking for a zlib or gzip header, not generating a check value, and not\n   looking for any check values for comparison at the end of the stream.  This\n   is for use with other formats that use the deflate compressed data format\n   such as zip.  Those formats provide their own check values.  If a custom\n   format is developed using the raw deflate format for compressed data, it is\n   recommended that a check value such as an adler32 or a crc32 be applied to\n   the uncompressed data as is done in the zlib, gzip, and zip formats.  For\n   most applications, the zlib format should be used as is.  Note that comments\n   above on the use in deflateInit2() applies to the magnitude of windowBits.\n\n     windowBits can also be greater than 15 for optional gzip decoding.  Add\n   32 to windowBits to enable zlib and gzip decoding with automatic header\n   detection, or add 16 to decode only the gzip format (the zlib format will\n   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a\n   crc32 instead of an adler32.\n\n     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the\n   version assumed by the caller, or Z_STREAM_ERROR if the parameters are\n   invalid, such as a null pointer to the structure.  msg is set to null if\n   there is no error message.  inflateInit2 does not perform any decompression\n   apart from possibly reading the zlib header if present: actual decompression\n   will be done by inflate().  (So next_in and avail_in may be modified, but\n   next_out and avail_out are unused and unchanged.) The current implementation\n   of inflateInit2() does not process any header information -- that is\n   deferred until inflate() is called.\n*/\n\nZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,\n                                             const Bytef *dictionary,\n                                             uInt  dictLength));\n/*\n     Initializes the decompression dictionary from the given uncompressed byte\n   sequence.  This function must be called immediately after a call of inflate,\n   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor\n   can be determined from the adler32 value returned by that call of inflate.\n   The compressor and decompressor must use exactly the same dictionary (see\n   deflateSetDictionary).  For raw inflate, this function can be called\n   immediately after inflateInit2() or inflateReset() and before any call of\n   inflate() to set the dictionary.  The application must insure that the\n   dictionary that was used for compression is provided.\n\n     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a\n   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is\n   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the\n   expected one (incorrect adler32 value).  inflateSetDictionary does not\n   perform any decompression: this will be done by subsequent calls of\n   inflate().\n*/\n\nZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));\n/*\n     Skips invalid compressed data until a full flush point (see above the\n   description of deflate with Z_FULL_FLUSH) can be found, or until all\n   available input is skipped.  No output is provided.\n\n     inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR\n   if no more input was provided, Z_DATA_ERROR if no flush point has been\n   found, or Z_STREAM_ERROR if the stream structure was inconsistent.  In the\n   success case, the application may save the current current value of total_in\n   which indicates where valid compressed data was found.  In the error case,\n   the application may repeatedly call inflateSync, providing more input each\n   time, until success or end of the input data.\n*/\n\nZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,\n                                    z_streamp source));\n/*\n     Sets the destination stream as a complete copy of the source stream.\n\n     This function can be useful when randomly accessing a large stream.  The\n   first pass through the stream can periodically record the inflate state,\n   allowing restarting inflate at those points when randomly accessing the\n   stream.\n\n     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent\n   (such as zalloc being Z_NULL).  msg is left unchanged in both source and\n   destination.\n*/\n\nZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));\n/*\n     This function is equivalent to inflateEnd followed by inflateInit,\n   but does not free and reallocate all the internal decompression state.  The\n   stream will keep attributes that may have been set by inflateInit2.\n\n     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL).\n*/\n\nZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,\n                                      int windowBits));\n/*\n     This function is the same as inflateReset, but it also permits changing\n   the wrap and window size requests.  The windowBits parameter is interpreted\n   the same as it is for inflateInit2.\n\n     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL), or if\n   the windowBits parameter is invalid.\n*/\n\nZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,\n                                     int bits,\n                                     int value));\n/*\n     This function inserts bits in the inflate input stream.  The intent is\n   that this function is used to start inflating at a bit position in the\n   middle of a byte.  The provided bits will be used before any bytes are used\n   from next_in.  This function should only be used with raw inflate, and\n   should be used before the first inflate() call after inflateInit2() or\n   inflateReset().  bits must be less than or equal to 16, and that many of the\n   least significant bits of value will be inserted in the input.\n\n     If bits is negative, then the input stream bit buffer is emptied.  Then\n   inflatePrime() can be called again to put bits in the buffer.  This is used\n   to clear out bits leftover after feeding inflate a block description prior\n   to feeding inflate codes.\n\n     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\nZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));\n/*\n     This function returns two values, one in the lower 16 bits of the return\n   value, and the other in the remaining upper bits, obtained by shifting the\n   return value down 16 bits.  If the upper value is -1 and the lower value is\n   zero, then inflate() is currently decoding information outside of a block.\n   If the upper value is -1 and the lower value is non-zero, then inflate is in\n   the middle of a stored block, with the lower value equaling the number of\n   bytes from the input remaining to copy.  If the upper value is not -1, then\n   it is the number of bits back from the current bit position in the input of\n   the code (literal or length/distance pair) currently being processed.  In\n   that case the lower value is the number of bytes already emitted for that\n   code.\n\n     A code is being processed if inflate is waiting for more input to complete\n   decoding of the code, or if it has completed decoding but is waiting for\n   more output space to write the literal or match data.\n\n     inflateMark() is used to mark locations in the input data for random\n   access, which may be at bit positions, and to note those cases where the\n   output of a code may span boundaries of random access blocks.  The current\n   location in the input stream can be determined from avail_in and data_type\n   as noted in the description for the Z_BLOCK flush parameter for inflate.\n\n     inflateMark returns the value noted above or -1 << 16 if the provided\n   source stream state was inconsistent.\n*/\n\nZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,\n                                         gz_headerp head));\n/*\n     inflateGetHeader() requests that gzip header information be stored in the\n   provided gz_header structure.  inflateGetHeader() may be called after\n   inflateInit2() or inflateReset(), and before the first call of inflate().\n   As inflate() processes the gzip stream, head->done is zero until the header\n   is completed, at which time head->done is set to one.  If a zlib stream is\n   being decoded, then head->done is set to -1 to indicate that there will be\n   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be\n   used to force inflate() to return immediately after header processing is\n   complete and before any actual data is decompressed.\n\n     The text, time, xflags, and os fields are filled in with the gzip header\n   contents.  hcrc is set to true if there is a header CRC.  (The header CRC\n   was valid if done is set to one.) If extra is not Z_NULL, then extra_max\n   contains the maximum number of bytes to write to extra.  Once done is true,\n   extra_len contains the actual extra field length, and extra contains the\n   extra field, or that field truncated if extra_max is less than extra_len.\n   If name is not Z_NULL, then up to name_max characters are written there,\n   terminated with a zero unless the length is greater than name_max.  If\n   comment is not Z_NULL, then up to comm_max characters are written there,\n   terminated with a zero unless the length is greater than comm_max.  When any\n   of extra, name, or comment are not Z_NULL and the respective field is not\n   present in the header, then that field is set to Z_NULL to signal its\n   absence.  This allows the use of deflateSetHeader() with the returned\n   structure to duplicate the header.  However if those fields are set to\n   allocated memory, then the application will need to save those pointers\n   elsewhere so that they can be eventually freed.\n\n     If inflateGetHeader is not used, then the header information is simply\n   discarded.  The header is always checked for validity, including the header\n   CRC if present.  inflateReset() will reset the process to discard the header\n   information.  The application would need to call inflateGetHeader() again to\n   retrieve the header from the next gzip stream.\n\n     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\n/*\nZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,\n                                        unsigned char FAR *window));\n\n     Initialize the internal stream state for decompression using inflateBack()\n   calls.  The fields zalloc, zfree and opaque in strm must be initialized\n   before the call.  If zalloc and zfree are Z_NULL, then the default library-\n   derived memory allocation routines are used.  windowBits is the base two\n   logarithm of the window size, in the range 8..15.  window is a caller\n   supplied buffer of that size.  Except for special applications where it is\n   assured that deflate was used with small window sizes, windowBits must be 15\n   and a 32K byte window must be supplied to be able to decompress general\n   deflate streams.\n\n     See inflateBack() for the usage of these routines.\n\n     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of\n   the paramaters are invalid, Z_MEM_ERROR if the internal state could not be\n   allocated, or Z_VERSION_ERROR if the version of the library does not match\n   the version of the header file.\n*/\n\ntypedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));\ntypedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));\n\nZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,\n                                    in_func in, void FAR *in_desc,\n                                    out_func out, void FAR *out_desc));\n/*\n     inflateBack() does a raw inflate with a single call using a call-back\n   interface for input and output.  This is more efficient than inflate() for\n   file i/o applications in that it avoids copying between the output and the\n   sliding window by simply making the window itself the output buffer.  This\n   function trusts the application to not change the output buffer passed by\n   the output function, at least until inflateBack() returns.\n\n     inflateBackInit() must be called first to allocate the internal state\n   and to initialize the state with the user-provided window buffer.\n   inflateBack() may then be used multiple times to inflate a complete, raw\n   deflate stream with each call.  inflateBackEnd() is then called to free the\n   allocated state.\n\n     A raw deflate stream is one with no zlib or gzip header or trailer.\n   This routine would normally be used in a utility that reads zip or gzip\n   files and writes out uncompressed files.  The utility would decode the\n   header and process the trailer on its own, hence this routine expects only\n   the raw deflate stream to decompress.  This is different from the normal\n   behavior of inflate(), which expects either a zlib or gzip header and\n   trailer around the deflate stream.\n\n     inflateBack() uses two subroutines supplied by the caller that are then\n   called by inflateBack() for input and output.  inflateBack() calls those\n   routines until it reads a complete deflate stream and writes out all of the\n   uncompressed data, or until it encounters an error.  The function's\n   parameters and return types are defined above in the in_func and out_func\n   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the\n   number of bytes of provided input, and a pointer to that input in buf.  If\n   there is no input available, in() must return zero--buf is ignored in that\n   case--and inflateBack() will return a buffer error.  inflateBack() will call\n   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()\n   should return zero on success, or non-zero on failure.  If out() returns\n   non-zero, inflateBack() will return with an error.  Neither in() nor out()\n   are permitted to change the contents of the window provided to\n   inflateBackInit(), which is also the buffer that out() uses to write from.\n   The length written by out() will be at most the window size.  Any non-zero\n   amount of input may be provided by in().\n\n     For convenience, inflateBack() can be provided input on the first call by\n   setting strm->next_in and strm->avail_in.  If that input is exhausted, then\n   in() will be called.  Therefore strm->next_in must be initialized before\n   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called\n   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in\n   must also be initialized, and then if strm->avail_in is not zero, input will\n   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].\n\n     The in_desc and out_desc parameters of inflateBack() is passed as the\n   first parameter of in() and out() respectively when they are called.  These\n   descriptors can be optionally used to pass any information that the caller-\n   supplied in() and out() functions need to do their job.\n\n     On return, inflateBack() will set strm->next_in and strm->avail_in to\n   pass back any unused input that was provided by the last in() call.  The\n   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR\n   if in() or out() returned an error, Z_DATA_ERROR if there was a format error\n   in the deflate stream (in which case strm->msg is set to indicate the nature\n   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.\n   In the case of Z_BUF_ERROR, an input or output error can be distinguished\n   using strm->next_in which will be Z_NULL only if in() returned an error.  If\n   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning\n   non-zero.  (in() will always be called before out(), so strm->next_in is\n   assured to be defined if out() returns non-zero.) Note that inflateBack()\n   cannot return Z_OK.\n*/\n\nZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));\n/*\n     All memory allocated by inflateBackInit() is freed.\n\n     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream\n   state was inconsistent.\n*/\n\nZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));\n/* Return flags indicating compile-time options.\n\n    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:\n     1.0: size of uInt\n     3.2: size of uLong\n     5.4: size of voidpf (pointer)\n     7.6: size of z_off_t\n\n    Compiler, assembler, and debug options:\n     8: DEBUG\n     9: ASMV or ASMINF -- use ASM code\n     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention\n     11: 0 (reserved)\n\n    One-time table building (smaller code, but not thread-safe if true):\n     12: BUILDFIXED -- build static block decoding tables when needed\n     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed\n     14,15: 0 (reserved)\n\n    Library content (indicates missing functionality):\n     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking\n                          deflate code when not needed)\n     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect\n                    and decode gzip streams (to avoid linking crc code)\n     18-19: 0 (reserved)\n\n    Operation variations (changes in library functionality):\n     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate\n     21: FASTEST -- deflate algorithm with only one, lowest compression level\n     22,23: 0 (reserved)\n\n    The sprintf variant used by gzprintf (zero is best):\n     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format\n     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!\n     26: 0 = returns value, 1 = void -- 1 means inferred string length returned\n\n    Remainder:\n     27-31: 0 (reserved)\n */\n\n\n                        /* utility functions */\n\n/*\n     The following utility functions are implemented on top of the basic\n   stream-oriented functions.  To simplify the interface, some default options\n   are assumed (compression level and memory usage, standard memory allocation\n   functions).  The source code of these utility functions can be modified if\n   you need special options.\n*/\n\nZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,\n                                 const Bytef *source, uLong sourceLen));\n/*\n     Compresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer.  Upon entry, destLen is the total size\n   of the destination buffer, which must be at least the value returned by\n   compressBound(sourceLen).  Upon exit, destLen is the actual size of the\n   compressed buffer.\n\n     compress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer.\n*/\n\nZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,\n                                  const Bytef *source, uLong sourceLen,\n                                  int level));\n/*\n     Compresses the source buffer into the destination buffer.  The level\n   parameter has the same meaning as in deflateInit.  sourceLen is the byte\n   length of the source buffer.  Upon entry, destLen is the total size of the\n   destination buffer, which must be at least the value returned by\n   compressBound(sourceLen).  Upon exit, destLen is the actual size of the\n   compressed buffer.\n\n     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_BUF_ERROR if there was not enough room in the output buffer,\n   Z_STREAM_ERROR if the level parameter is invalid.\n*/\n\nZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));\n/*\n     compressBound() returns an upper bound on the compressed size after\n   compress() or compress2() on sourceLen bytes.  It would be used before a\n   compress() or compress2() call to allocate the destination buffer.\n*/\n\nZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,\n                                   const Bytef *source, uLong sourceLen));\n/*\n     Decompresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer.  Upon entry, destLen is the total size\n   of the destination buffer, which must be large enough to hold the entire\n   uncompressed data.  (The size of the uncompressed data must have been saved\n   previously by the compressor and transmitted to the decompressor by some\n   mechanism outside the scope of this compression library.) Upon exit, destLen\n   is the actual size of the uncompressed buffer.\n\n     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.\n*/\n\n\n                        /* gzip file access functions */\n\n/*\n     This library supports reading and writing files in gzip (.gz) format with\n   an interface similar to that of stdio, using the functions that start with\n   \"gz\".  The gzip format is different from the zlib format.  gzip is a gzip\n   wrapper, documented in RFC 1952, wrapped around a deflate stream.\n*/\n\ntypedef voidp gzFile;       /* opaque gzip file descriptor */\n\n/*\nZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));\n\n     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as\n   in fopen (\"rb\" or \"wb\") but can also include a compression level (\"wb9\") or\n   a strategy: 'f' for filtered data as in \"wb6f\", 'h' for Huffman-only\n   compression as in \"wb1h\", 'R' for run-length encoding as in \"wb1R\", or 'F'\n   for fixed code compression as in \"wb9F\".  (See the description of\n   deflateInit2 for more information about the strategy parameter.) Also \"a\"\n   can be used instead of \"w\" to request that the gzip stream that will be\n   written be appended to the file.  \"+\" will result in an error, since reading\n   and writing to the same gzip file is not supported.\n\n     gzopen can be used to read a file which is not in gzip format; in this\n   case gzread will directly read from the file without decompression.\n\n     gzopen returns NULL if the file could not be opened, if there was\n   insufficient memory to allocate the gzFile state, or if an invalid mode was\n   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).\n   errno can be checked to determine if the reason gzopen failed was that the\n   file could not be opened.\n*/\n\nZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));\n/*\n     gzdopen associates a gzFile with the file descriptor fd.  File descriptors\n   are obtained from calls like open, dup, creat, pipe or fileno (if the file\n   has been previously opened with fopen).  The mode parameter is as in gzopen.\n\n     The next call of gzclose on the returned gzFile will also close the file\n   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor\n   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,\n   mode);.  The duplicated descriptor should be saved to avoid a leak, since\n   gzdopen does not close fd if it fails.\n\n     gzdopen returns NULL if there was insufficient memory to allocate the\n   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not\n   provided, or '+' was provided), or if fd is -1.  The file descriptor is not\n   used until the next gz* read, write, seek, or close operation, so gzdopen\n   will not detect if fd is invalid (unless fd is -1).\n*/\n\nZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));\n/*\n     Set the internal buffer size used by this library's functions.  The\n   default buffer size is 8192 bytes.  This function must be called after\n   gzopen() or gzdopen(), and before any other calls that read or write the\n   file.  The buffer memory allocation is always deferred to the first read or\n   write.  Two buffers are allocated, either both of the specified size when\n   writing, or one of the specified size and the other twice that size when\n   reading.  A larger buffer size of, for example, 64K or 128K bytes will\n   noticeably increase the speed of decompression (reading).\n\n     The new buffer size also affects the maximum length for gzprintf().\n\n     gzbuffer() returns 0 on success, or -1 on failure, such as being called\n   too late.\n*/\n\nZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));\n/*\n     Dynamically update the compression level or strategy.  See the description\n   of deflateInit2 for the meaning of these parameters.\n\n     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not\n   opened for writing.\n*/\n\nZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));\n/*\n     Reads the given number of uncompressed bytes from the compressed file.  If\n   the input file was not in gzip format, gzread copies the given number of\n   bytes into the buffer.\n\n     After reaching the end of a gzip stream in the input, gzread will continue\n   to read, looking for another gzip stream, or failing that, reading the rest\n   of the input file directly without decompression.  The entire input file\n   will be read if gzread is called until it returns less than the requested\n   len.\n\n     gzread returns the number of uncompressed bytes actually read, less than\n   len for end of file, or -1 for error.\n*/\n\nZEXTERN int ZEXPORT gzwrite OF((gzFile file,\n                                voidpc buf, unsigned len));\n/*\n     Writes the given number of uncompressed bytes into the compressed file.\n   gzwrite returns the number of uncompressed bytes written or 0 in case of\n   error.\n*/\n\nZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));\n/*\n     Converts, formats, and writes the arguments to the compressed file under\n   control of the format string, as in fprintf.  gzprintf returns the number of\n   uncompressed bytes actually written, or 0 in case of error.  The number of\n   uncompressed bytes written is limited to 8191, or one less than the buffer\n   size given to gzbuffer().  The caller should assure that this limit is not\n   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with\n   nothing written.  In this case, there may also be a buffer overflow with\n   unpredictable consequences, which is possible only if zlib was compiled with\n   the insecure functions sprintf() or vsprintf() because the secure snprintf()\n   or vsnprintf() functions were not available.  This can be determined using\n   zlibCompileFlags().\n*/\n\nZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));\n/*\n     Writes the given null-terminated string to the compressed file, excluding\n   the terminating null character.\n\n     gzputs returns the number of characters written, or -1 in case of error.\n*/\n\nZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));\n/*\n     Reads bytes from the compressed file until len-1 characters are read, or a\n   newline character is read and transferred to buf, or an end-of-file\n   condition is encountered.  If any characters are read or if len == 1, the\n   string is terminated with a null character.  If no characters are read due\n   to an end-of-file or len < 1, then the buffer is left untouched.\n\n     gzgets returns buf which is a null-terminated string, or it returns NULL\n   for end-of-file or in case of error.  If there was an error, the contents at\n   buf are indeterminate.\n*/\n\nZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));\n/*\n     Writes c, converted to an unsigned char, into the compressed file.  gzputc\n   returns the value that was written, or -1 in case of error.\n*/\n\nZEXTERN int ZEXPORT gzgetc OF((gzFile file));\n/*\n     Reads one byte from the compressed file.  gzgetc returns this byte or -1\n   in case of end of file or error.\n*/\n\nZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));\n/*\n     Push one character back onto the stream to be read as the first character\n   on the next read.  At least one character of push-back is allowed.\n   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will\n   fail if c is -1, and may fail if a character has been pushed but not read\n   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the\n   output buffer size of pushed characters is allowed.  (See gzbuffer above.)\n   The pushed character will be discarded if the stream is repositioned with\n   gzseek() or gzrewind().\n*/\n\nZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));\n/*\n     Flushes all pending output into the compressed file.  The parameter flush\n   is as in the deflate() function.  The return value is the zlib error number\n   (see function gzerror below).  gzflush is only permitted when writing.\n\n     If the flush parameter is Z_FINISH, the remaining data is written and the\n   gzip stream is completed in the output.  If gzwrite() is called again, a new\n   gzip stream will be started in the output.  gzread() is able to read such\n   concatented gzip streams.\n\n     gzflush should be called only when strictly necessary because it will\n   degrade compression if called too often.\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,\n                                   z_off_t offset, int whence));\n\n     Sets the starting position for the next gzread or gzwrite on the given\n   compressed file.  The offset represents a number of bytes in the\n   uncompressed data stream.  The whence parameter is defined as in lseek(2);\n   the value SEEK_END is not supported.\n\n     If the file is opened for reading, this function is emulated but can be\n   extremely slow.  If the file is opened for writing, only forward seeks are\n   supported; gzseek then compresses a sequence of zeroes up to the new\n   starting position.\n\n     gzseek returns the resulting offset location as measured in bytes from\n   the beginning of the uncompressed stream, or -1 in case of error, in\n   particular if the file is opened for writing and the new starting position\n   would be before the current position.\n*/\n\nZEXTERN int ZEXPORT    gzrewind OF((gzFile file));\n/*\n     Rewinds the given file. This function is supported only for reading.\n\n     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));\n\n     Returns the starting position for the next gzread or gzwrite on the given\n   compressed file.  This position represents a number of bytes in the\n   uncompressed data stream, and is zero when starting, even if appending or\n   reading a gzip stream from the middle of a file using gzdopen().\n\n     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));\n\n     Returns the current offset in the file being read or written.  This offset\n   includes the count of bytes that precede the gzip stream, for example when\n   appending or when using gzdopen() for reading.  When reading, the offset\n   does not include as yet unused buffered input.  This information can be used\n   for a progress indicator.  On error, gzoffset() returns -1.\n*/\n\nZEXTERN int ZEXPORT gzeof OF((gzFile file));\n/*\n     Returns true (1) if the end-of-file indicator has been set while reading,\n   false (0) otherwise.  Note that the end-of-file indicator is set only if the\n   read tried to go past the end of the input, but came up short.  Therefore,\n   just like feof(), gzeof() may return false even if there is no more data to\n   read, in the event that the last read request was for the exact number of\n   bytes remaining in the input file.  This will happen if the input file size\n   is an exact multiple of the buffer size.\n\n     If gzeof() returns true, then the read functions will return no more data,\n   unless the end-of-file indicator is reset by gzclearerr() and the input file\n   has grown since the previous end of file was detected.\n*/\n\nZEXTERN int ZEXPORT gzdirect OF((gzFile file));\n/*\n     Returns true (1) if file is being copied directly while reading, or false\n   (0) if file is a gzip stream being decompressed.  This state can change from\n   false to true while reading the input file if the end of a gzip stream is\n   reached, but is followed by data that is not another gzip stream.\n\n     If the input file is empty, gzdirect() will return true, since the input\n   does not contain a gzip stream.\n\n     If gzdirect() is used immediately after gzopen() or gzdopen() it will\n   cause buffers to be allocated to allow reading the file to determine if it\n   is a gzip file.  Therefore if gzbuffer() is used, it should be called before\n   gzdirect().\n*/\n\nZEXTERN int ZEXPORT    gzclose OF((gzFile file));\n/*\n     Flushes all pending output if necessary, closes the compressed file and\n   deallocates the (de)compression state.  Note that once file is closed, you\n   cannot call gzerror with file, since its structures have been deallocated.\n   gzclose must not be called more than once on the same file, just as free\n   must not be called more than once on the same allocation.\n\n     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a\n   file operation error, or Z_OK on success.\n*/\n\nZEXTERN int ZEXPORT gzclose_r OF((gzFile file));\nZEXTERN int ZEXPORT gzclose_w OF((gzFile file));\n/*\n     Same as gzclose(), but gzclose_r() is only for use when reading, and\n   gzclose_w() is only for use when writing or appending.  The advantage to\n   using these instead of gzclose() is that they avoid linking in zlib\n   compression or decompression code that is not used when only reading or only\n   writing respectively.  If gzclose() is used, then both compression and\n   decompression code will be included the application when linking to a static\n   zlib library.\n*/\n\nZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));\n/*\n     Returns the error message for the last error which occurred on the given\n   compressed file.  errnum is set to zlib error number.  If an error occurred\n   in the file system and not in the compression library, errnum is set to\n   Z_ERRNO and the application may consult errno to get the exact error code.\n\n     The application must not modify the returned string.  Future calls to\n   this function may invalidate the previously returned string.  If file is\n   closed, then the string previously returned by gzerror will no longer be\n   available.\n\n     gzerror() should be used to distinguish errors from end-of-file for those\n   functions above that do not distinguish those cases in their return values.\n*/\n\nZEXTERN void ZEXPORT gzclearerr OF((gzFile file));\n/*\n     Clears the error and end-of-file flags for file.  This is analogous to the\n   clearerr() function in stdio.  This is useful for continuing to read a gzip\n   file that is being written concurrently.\n*/\n\n\n                        /* checksum functions */\n\n/*\n     These functions are not related to compression but are exported\n   anyway because they might be useful in applications using the compression\n   library.\n*/\n\nZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));\n/*\n     Update a running Adler-32 checksum with the bytes buf[0..len-1] and\n   return the updated checksum.  If buf is Z_NULL, this function returns the\n   required initial value for the checksum.\n\n     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed\n   much faster.\n\n   Usage example:\n\n     uLong adler = adler32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       adler = adler32(adler, buffer, length);\n     }\n     if (adler != original_adler) error();\n*/\n\n/*\nZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,\n                                          z_off_t len2));\n\n     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1\n   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for\n   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of\n   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.\n*/\n\nZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));\n/*\n     Update a running CRC-32 with the bytes buf[0..len-1] and return the\n   updated CRC-32.  If buf is Z_NULL, this function returns the required\n   initial value for the for the crc.  Pre- and post-conditioning (one's\n   complement) is performed within this function so it shouldn't be done by the\n   application.\n\n   Usage example:\n\n     uLong crc = crc32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       crc = crc32(crc, buffer, length);\n     }\n     if (crc != original_crc) error();\n*/\n\n/*\nZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));\n\n     Combine two CRC-32 check values into one.  For two sequences of bytes,\n   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were\n   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32\n   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and\n   len2.\n*/\n\n\n                        /* various hacks, don't look :) */\n\n/* deflateInit and inflateInit are macros to allow checking the zlib version\n * and the compiler's view of z_stream:\n */\nZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,\n                                     const char *version, int stream_size));\nZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,\n                                     const char *version, int stream_size));\nZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,\n                                      int windowBits, int memLevel,\n                                      int strategy, const char *version,\n                                      int stream_size));\nZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,\n                                      const char *version, int stream_size));\nZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,\n                                         unsigned char FAR *window,\n                                         const char *version,\n                                         int stream_size));\n#define deflateInit(strm, level) \\\n        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))\n#define inflateInit(strm) \\\n        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))\n#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \\\n        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\\\n                      (strategy),           ZLIB_VERSION, sizeof(z_stream))\n#define inflateInit2(strm, windowBits) \\\n        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))\n#define inflateBackInit(strm, windowBits, window) \\\n        inflateBackInit_((strm), (windowBits), (window), \\\n                                            ZLIB_VERSION, sizeof(z_stream))\n\n/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or\n * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if\n * both are true, the application gets the *64 functions, and the regular\n * functions are changed to 64 bits) -- in case these are set on systems\n * without large file support, _LFS64_LARGEFILE must also be true\n */\n#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0\n   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));\n   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));\n   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));\n   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));\n   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));\n   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));\n#endif\n\n#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0\n#  define gzopen gzopen64\n#  define gzseek gzseek64\n#  define gztell gztell64\n#  define gzoffset gzoffset64\n#  define adler32_combine adler32_combine64\n#  define crc32_combine crc32_combine64\n#  ifdef _LARGEFILE64_SOURCE\n     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));\n     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));\n     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));\n     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));\n     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));\n     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));\n#  endif\n#else\n   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));\n   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));\n   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));\n   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));\n   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));\n   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));\n#endif\n\n/* hack for buggy compilers */\n#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)\n    struct internal_state {int dummy;};\n#endif\n\n/* undocumented functions */\nZEXTERN const char   * ZEXPORT zError           OF((int));\nZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));\nZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));\nZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* ZLIB_H */\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_CCBReader.txt",
    "content": "CocosBuilder Reader: http://www.cocosbuilder.com\n\nCopyright (c) 2010-2011 - Viktor Lidholt\nCopyright (c) 2011-2012 - Zynga Inc. and contributors\n(see each file to see the different copyright owners)\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_CCControlExtension.txt",
    "content": "/*\n *\n * Copyright 2012 Yannick Loriot.\n * http://yannickloriot.com\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */"
  },
  {
    "path": "cocos2d/licenses/LICENSE_JSON4Lua.txt",
    "content": "The MIT License\n\nCopyright (c) 2009 Craig Mason-Jones\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_Kazmath.txt",
    "content": "Kazmath is a 3D math library aimed at game programming. It is released under the modified BSD license.\n\nAuthors\n\nLuke Benstead\nCarsten Haubold\n\nLicense\n\nCopyright (c) 2008, Luke Benstead.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright notice,\n      this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright notice,\n      this list of conditions and the following disclaimer in the documentation\n      and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_SpiderMonkey.txt",
    "content": "SpiderMonkey is Mozilla's JavaScript engine written in C/C++. It is used in various Mozilla products, including Firefox, and is available under MPL/GPL/LGPL tri-license.\n(from https://developer.mozilla.org/en/SpiderMonkey)\n\n--------\n\nPlease see the file toolkit/content/license.html for the copyright licensing\nconditions attached to this codebase, including copies of the licenses\nconcerned.\n\nYou are not granted rights or licenses to the trademarks of the\nMozilla Foundation or any party, including without limitation the\nFirefox name or logo.\n\nFor more information, see: http://www.mozilla.org/foundation/licensing.html"
  },
  {
    "path": "cocos2d/licenses/LICENSE_artwork.txt",
    "content": "GROSSINI AND FRIENDS\n--------------------\n\nResources/Images/grossini*.png\n\nFrom:\n   http://www.stortroopers.com/\n\nLICENSE: Attribution-NonCommercial-ShareAlike 2.0\n\n\nSPRITE SHEETS\n-------------\n\nResoruces/Images/spritesheet*\n\nLICENSE: unsure... don't use them in your project.\n\n\nTILES & TILEMAP:\n----------------\n\n'Barbie Seahorse' tiles:\n    Resources/Images/tiles.png\n    Resources/Images/levelmap.tga\n    Resources/Images/background.png\n\n    From 'Barbie Seahorse' game:\n        http://www.imitationpickles.org/barbie/\n\n    LICENSE: GNU GPL v2\n\n'Hex tiles'\n    Resources/Images/tilemap/hexa-tiles.png\n    From 'Pioneers' game:\n        http://pio.sourceforge.net/\n\n    LICENSE: GNU GPL v2\n\n'Planet Cute' tiles:\n    Resources/Images/tilemap/ortho-test1.png\n\n    From Lost Garden:\n        http://lostgarden.com/2007/05/dancs-miraculously-flexible-game.html\n\n    LICENSE:\n        http://lostgarden.com/2007/03/lost-garden-license.html\n\n\n'Spritelib GPL':\n    Resources/Images/tilemap/fixed-ortho-test2.png\n    Resources/Images/tilemap/ortho-test2.png\n\n    From 'SpriteLib GPL':\n        http://www.flyingyogi.com/fun/spritelib.html\n\n    LICENSE: Common Public License\n    http://www.opensource.org/licenses/cpl.php\n\n'Tiled examples':\n    Resources/Images/tilemap/iso_test.png\n    Resources/Images/tilemap/iso_test2.png\n    Resources/Images/tilemap/tmw_desert_spacing.png\n\n    From 'Tiled' editor.\n        http://www.mapeditor.og\n    LICENSE: GNU GPL v2\n\nFONTS:\n------\n\nTTF fonts:\n    Resources/Fonts/*.ttf\n    From:\n        http://www.webpagepublicity.com/free-fonts.html\n    LICENSE: For personal Use.\n        \n\nSpriteSheet fonts:\n    Resources/Images/tuffy_bold_italic-charmap.png\n\n    From:\n        http://tulrich.com/fonts/\n\n    LICENSE: Public Domain\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_box2d.txt",
    "content": "Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com\n\nThis software is provided 'as-is', without any express or implied\nwarranty.  In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\nclaim that you wrote the original software. If you use this software\nin a product, an acknowledgment in the product documentation would be\nappreciated but is not required.\n2. Altered source versions must be plainly marked as such, and must not be\nmisrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_chipmunk.txt",
    "content": "Copyright (c) 2007 Scott Lembcke and Howling Moon Software\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_cocos2d-iphone.txt",
    "content": "cocos2d for iPhone: http://www.cocos2d-iphone.org\n\nCopyright (c) 2011 - Zynga Inc. and contributors\n(see each file to see the different copyright owners)\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_cocos2d-x.txt",
    "content": "cocos2d-x   http://www.cocos2d-x.org\n\nCopyright (c) 2010-2011 - cocos2d-x community\n(see each file to see the different copyright owners)\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."
  },
  {
    "path": "cocos2d/licenses/LICENSE_cocosdenshion.txt",
    "content": " CocosDenshion Sound Engine\n\n Copyright (c) 2010 Steve Oldmeadow\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE."
  },
  {
    "path": "cocos2d/licenses/LICENSE_curl.txt",
    "content": "COPYRIGHT AND PERMISSION NOTICE\n \nCopyright (c) 1996 - 2011, Daniel Stenberg, <daniel@haxx.se>.\n \nAll rights reserved.\n\nPermission to use, copy, modify, and distribute this software for any purpose\nwith or without fee is hereby granted, provided that the above copyright\nnotice and this permission notice appear in all copies.\n \nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN\nNO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE\nOR OTHER DEALINGS IN THE SOFTWARE.\n \nExcept as contained in this notice, the name of a copyright holder shall not\nbe used in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization of the copyright holder."
  },
  {
    "path": "cocos2d/licenses/LICENSE_js.txt",
    "content": "cocos2d-x-js   http://www.cocos2d-x.org\n\nCopyright (c) 2010-2011 - cocos2d-x community\n(see each file to see the different copyright owners)\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_jsoncpp.txt",
    "content": "The JsonCpp library's source code, including accompanying documentation, \ntests and demonstration applications, are licensed under the following\nconditions...\n\nThe author (Baptiste Lepilleur) explicitly disclaims copyright in all \njurisdictions which recognize such a disclaimer. In such jurisdictions, \nthis software is released into the Public Domain.\n\nIn jurisdictions which do not recognize Public Domain property (e.g. Germany as of\n2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is\nreleased under the terms of the MIT License (see below).\n\nIn jurisdictions which recognize Public Domain property, the user of this \nsoftware may choose to accept it either as 1) Public Domain, 2) under the \nconditions of the MIT License (see below), or 3) under the terms of dual \nPublic Domain/MIT License conditions described here, as they choose.\n\nThe MIT License is about as close to Public Domain as a license can get, and is\ndescribed in clear, concise terms at:\n\n   http://en.wikipedia.org/wiki/MIT_License\n   \nThe full text of the MIT License follows:\n\n========================================================================\nCopyright (c) 2007-2010 Baptiste Lepilleur\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use, copy,\nmodify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\nBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\nACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n========================================================================\n(END LICENSE TEXT)\n\nThe MIT license is compatible with both the GPL and commercial\nsoftware, affording one all of the rights of Public Domain with the\nminor nuisance of being required to keep the above copyright notice\nand license text in the source code. Note also that by accepting the\nPublic Domain \"license\" you can re-license your copy using whatever\nlicense you like.\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_libjpeg.txt",
    "content": "LEGAL ISSUES\n============\n\nIn plain English:\n\n1. We don't promise that this software works.  (But if you find any bugs,\n   please let us know!)\n2. You can use this software for whatever you want.  You don't have to pay us.\n3. You may not pretend that you wrote this software.  If you use it in a\n   program, you must acknowledge somewhere in your documentation that\n   you've used the IJG code.\n\nIn legalese:\n\nThe authors make NO WARRANTY or representation, either express or implied,\nwith respect to this software, its quality, accuracy, merchantability, or\nfitness for a particular purpose.  This software is provided \"AS IS\", and you,\nits user, assume the entire risk as to its quality and accuracy.\n\nThis software is copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.\nAll Rights Reserved except as specified below.\n\nPermission is hereby granted to use, copy, modify, and distribute this\nsoftware (or portions thereof) for any purpose, without fee, subject to these\nconditions:\n(1) If any part of the source code for this software is distributed, then this\nREADME file must be included, with this copyright and no-warranty notice\nunaltered; and any additions, deletions, or changes to the original files\nmust be clearly indicated in accompanying documentation.\n(2) If only executable code is distributed, then the accompanying\ndocumentation must state that \"this software is based in part on the work of\nthe Independent JPEG Group\".\n(3) Permission for use of this software is granted only if the user accepts\nfull responsibility for any undesirable consequences; the authors accept\nNO LIABILITY for damages of any kind.\n\nThese conditions apply to any software derived from or based on the IJG code,\nnot just to the unmodified library.  If you use our work, you ought to\nacknowledge us.\n\nPermission is NOT granted for the use of any IJG author's name or company name\nin advertising or publicity relating to this software or products derived from\nit.  This software may be referred to only as \"the Independent JPEG Group's\nsoftware\".\n\nWe specifically permit and encourage the use of this software as the basis of\ncommercial products, provided that all warranty or liability claims are\nassumed by the product vendor."
  },
  {
    "path": "cocos2d/licenses/LICENSE_libpng.txt",
    "content": "This copy of the libpng notices is provided for your convenience.  In case of\nany discrepancy between this copy and the notices in the file png.h that is\nincluded in the libpng distribution, the latter shall prevail.\n\nCOPYRIGHT NOTICE, DISCLAIMER, and LICENSE:\n\nIf you modify libpng you may insert additional notices immediately following\nthis sentence.\n\nThis code is released under the libpng license.\n\nlibpng versions 1.2.6, August 15, 2004, through 1.2.38, July 16, 2009, are\nCopyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are\ndistributed according to the same disclaimer and license as libpng-1.2.5\nwith the following individual added to the list of Contributing Authors\n\n   Cosmin Truta\n\nlibpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are\nCopyright (c) 2000-2002 Glenn Randers-Pehrson, and are\ndistributed according to the same disclaimer and license as libpng-1.0.6\nwith the following individuals added to the list of Contributing Authors\n\n   Simon-Pierre Cadieux\n   Eric S. Raymond\n   Gilles Vollant\n\nand with the following additions to the disclaimer:\n\n   There is no warranty against interference with your enjoyment of the\n   library or against infringement.  There is no warranty that our\n   efforts or the library will fulfill any of your particular purposes\n   or needs.  This library is provided with all faults, and the entire\n   risk of satisfactory quality, performance, accuracy, and effort is with\n   the user.\n\nlibpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are\nCopyright (c) 1998, 1999 Glenn Randers-Pehrson, and are\ndistributed according to the same disclaimer and license as libpng-0.96,\nwith the following individuals added to the list of Contributing Authors:\n\n   Tom Lane\n   Glenn Randers-Pehrson\n   Willem van Schaik\n\nlibpng versions 0.89, June 1996, through 0.96, May 1997, are\nCopyright (c) 1996, 1997 Andreas Dilger\nDistributed according to the same disclaimer and license as libpng-0.88,\nwith the following individuals added to the list of Contributing Authors:\n\n   John Bowler\n   Kevin Bracey\n   Sam Bushell\n   Magnus Holmgren\n   Greg Roelofs\n   Tom Tanner\n\nlibpng versions 0.5, May 1995, through 0.88, January 1996, are\nCopyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n\nFor the purposes of this copyright and license, \"Contributing Authors\"\nis defined as the following set of individuals:\n\n   Andreas Dilger\n   Dave Martindale\n   Guy Eric Schalnat\n   Paul Schmidt\n   Tim Wegner\n\nThe PNG Reference Library is supplied \"AS IS\".  The Contributing Authors\nand Group 42, Inc. disclaim all warranties, expressed or implied,\nincluding, without limitation, the warranties of merchantability and of\nfitness for any purpose.  The Contributing Authors and Group 42, Inc.\nassume no liability for direct, indirect, incidental, special, exemplary,\nor consequential damages, which may result from the use of the PNG\nReference Library, even if advised of the possibility of such damage.\n\nPermission is hereby granted to use, copy, modify, and distribute this\nsource code, or portions hereof, for any purpose, without fee, subject\nto the following restrictions:\n\n1. The origin of this source code must not be misrepresented.\n\n2. Altered versions must be plainly marked as such and must not\n   be misrepresented as being the original source.\n\n3. This Copyright notice may not be removed or altered from any\n   source or altered source distribution.\n\nThe Contributing Authors and Group 42, Inc. specifically permit, without\nfee, and encourage the use of this source code as a component to\nsupporting the PNG file format in commercial products.  If you use this\nsource code in a product, acknowledgment is not required but would be\nappreciated.\n\n\nA \"png_get_copyright\" function is available, for convenient use in \"about\"\nboxes and the like:\n\n   printf(\"%s\",png_get_copyright(NULL));\n\nAlso, the PNG logo (in PNG format, of course) is supplied in the\nfiles \"pngbar.png\" and \"pngbar.jpg (88x31) and \"pngnow.png\" (98x31).\n\nLibpng is OSI Certified Open Source Software.  OSI Certified Open Source is a\ncertification mark of the Open Source Initiative.\n\nGlenn Randers-Pehrson\nglennrp at users.sourceforge.net\nJuly 16, 2009\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_libtiff.txt",
    "content": "Copyright (c) 1988-1997 Sam Leffler\nCopyright (c) 1991-1997 Silicon Graphics, Inc.\n\nPermission to use, copy, modify, distribute, and sell this software and \nits documentation for any purpose is hereby granted without fee, provided\nthat (i) the above copyright notices and this permission notice appear in\nall copies of the software and related documentation, and (ii) the names of\nSam Leffler and Silicon Graphics may not be used in any advertising or\npublicity relating to the software without the specific, prior written\npermission of Sam Leffler and Silicon Graphics.\n\nTHE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND, \nEXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY \nWARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  \n\nIN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR\nANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,\nOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,\nWHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF \nLIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE \nOF THIS SOFTWARE.\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_libwebsockets.txt",
    "content": "Libwebsockets and included programs are provided under the terms of the GNU\nLibrary General Public License (LGPL) 2.1, with the following exceptions:\n\n1) Static linking of programs with the libwebsockets library does not\nconstitute a derivative work and does not require the author to provide \nsource code for the program, use the shared libwebsockets libraries, or\nlink their program against a user-supplied version of libwebsockets.\n\nIf you link the program to a modified version of libwebsockets, then the\nchanges to libwebsockets must be provided under the terms of the LGPL in\nsections 1, 2, and 4.\n\n2) You do not have to provide a copy of the libwebsockets license with\nprograms that are linked to the libwebsockets library, nor do you have to\nidentify the libwebsockets license in your program or documentation as\nrequired by section 6 of the LGPL.\n\nHowever, programs must still identify their use of libwebsockets. The\nfollowing example statement can be included in user documentation to\nsatisfy this requirement:\n\n\"[program] is based in part on the work of the libwebsockets  project\n(http://libwebsockets.org)\"\n\n                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\f\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\f\n                  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n\n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\f\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\f\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\f\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\f\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\f\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\f\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                            NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\f\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_libxml2.txt",
    "content": "Except where otherwise noted in the source code (e.g. the files hash.c,\nlist.c and the trio files, which are covered by a similar licence but\nwith different Copyright notices) all the files are:\n\n Copyright (C) 1998-2003 Daniel Veillard.  All Rights Reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is fur-\nnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-\nNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nDANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-\nNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of Daniel Veillard shall not\nbe used in advertising or otherwise to promote the sale, use or other deal-\nings in this Software without prior written authorization from him.\n\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_lua.txt",
    "content": "License for Lua 5.0 and later versions\nhttp://www.lua.org/license.html\n\nCopyright  19942011 Lua.org, PUC-Rio.\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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."
  },
  {
    "path": "cocos2d/licenses/LICENSE_ogg_vorbis.txt",
    "content": "Copyright (c) 2002-2008 Xiph.org Foundation\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n- Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyright\nnotice, this list of conditions and the following disclaimer in the\ndocumentation and/or other materials provided with the distribution.\n\n- Neither the name of the Xiph.org Foundation nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "cocos2d/licenses/LICENSE_tolua++.txt",
    "content": "tolua++ License\n---------------\n\ntolua++ is based on toLua (www.tecgraf.puc-rio.br/~celes/tolua), and\nit's licensed under the terms of the MIT license reproduced below.\nThis means that Lua is free software and can be used for both academic\nand commercial purposes at absolutely no cost.\n\n===============================================================================\n\nCopyright (C) 2009 Ariel Manzur.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n===============================================================================\n\n(end of COPYRIGHT)"
  },
  {
    "path": "cocos2d/licenses/LICENSE_zlib.txt",
    "content": "Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler\n\nThis software is provided 'as-is', without any express or implied\nwarranty.  In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\n   claim that you wrote the original software. If you use this software\n   in a product, an acknowledgment in the product documentation would be\n   appreciated but is not required.\n2. Altered source versions must be plainly marked as such, and must not be\n   misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n\nJean-loup Gailly\nMark Adler"
  },
  {
    "path": "cocos2d/plugin/.gitignore",
    "content": "# Ignore thumbnails created by windows\nThumbs.db\n\n# Ignore files build by Visual Studio\n*.obj\n*.exe\n*.pdb\n*.aps\n*.vcproj.*.user\n*.vspscc\n*_i.c\n*.i\n*.icf\n*_p.c\n*.ncb\n*.suo\n*.tlb\n*.tlh\n*.bak\n*.cache\n*.ilk\n*.log\n[Bb]in\n[Dd]ebug*/\n*.sbr\n*.sdf\nobj/\n[Rr]elease*/\n_ReSharper*/\n[Tt]est[Rr]esult*\nipch/\n*.opensdf\n\n# Ignore files build by ndk and eclipse\nlibs/\nbin/\nobj/\ngen/\nassets/\nlocal.properties\n\n# Ignore files built by NaCl\nsamples/Cpp/HelloCpp/proj.nacl/Resources/\nsamples/Cpp/TestCpp/proj.nacl/Resources/\nsamples/Cpp/TestCpp/proj.nacl/out/\nsamples/Cpp/SimpleGame/proj.nacl/Resources/\nsamples/Lua/HelloLua/proj.nacl/Resources/\nsamples/Lua/TestLua/proj.nacl/Resources/\n\n# Ignore python compiled files\n*.pyc\n\n# Ignore files build by airplay and marmalade\nbuild_*_xcode/\nbuild_*_vc10/\n\n# Ignore files build by xcode\n*.mode*v*\n*.pbxuser\n*.xcbkptlist\n*.xcscheme\n*.xcworkspacedata\n*.xcuserstate\nxcschememanagement.plist\nbuild/\n.DS_Store\n._.*\nxcuserdata/\nDerivedData/\n\n# Ignore files built by bada\n.Simulator-Debug/\n.Target-Debug/\n.Target-Release/\n\n# Ignore files built by blackberry\nSimulator/\nDevice-Debug/\nDevice-Release/\n\n# Ignore vim swaps\n*.swp\n\n# Ignore config files in javascript bindings generator\ntools/tojs/user.cfg\n# ... userconf.ini generated if running from tools/tojs\ntools/tojs/userconf.ini\n# ... userconf.ini generated if running from tools/jenkins_scripts/mac/android/\ntools/jenkins_scripts/mac/android/userconf.ini\n\n# Ignore files built by plugin\npublish/*\ntools/toolsForPublish/environment.sh\n.settings\nplugins/china*\nplugins/punchbox*\nplugins/touchpay*\nsamplesPrivate*\n"
  },
  {
    "path": "cocos2d/plugin/README.md",
    "content": "plugin-x\n========\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/auto/jsb_pluginx_protocols_auto.cpp",
    "content": "#include \"jsb_pluginx_protocols_auto.hpp\"\n#include \"jsb_pluginx_spidermonkey_specifics.h\"\n#include \"jsb_pluginx_basic_conversions.h\"\nusing namespace pluginx;\n#include \"PluginManager.h\"\n#include \"ProtocolAnalytics.h\"\n#include \"ProtocolIAP.h\"\n#include \"ProtocolAds.h\"\n#include \"ProtocolShare.h\"\n#include \"ProtocolSocial.h\"\n#include \"ProtocolUser.h\"\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tT* cobj = new T();\n\t\tjs_proxy_t *pp = jsb_new_proxy(cobj, _tmp);\n\t\tJS_AddObjectRoot(cx, &pp->obj);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nJSClass  *jsb_cocos2d_plugin_PluginProtocol_class;\nJSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nJSBool js_pluginx_protocols_PluginProtocol_getPluginName(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_PluginProtocol_getPluginName : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tconst char* ret = cobj->getPluginName();\n\t\tjsval jsret;\n\t\tjsret = c_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginProtocol_getPluginName : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_PluginProtocol_getPluginVersion(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_PluginProtocol_getPluginVersion : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getPluginVersion();\n\t\tjsval jsret;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginProtocol_getPluginVersion : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_PluginProtocol_getSDKVersion(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_PluginProtocol_getSDKVersion : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getSDKVersion();\n\t\tjsval jsret;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginProtocol_getSDKVersion : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_PluginProtocol_setDebugMode(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_PluginProtocol_setDebugMode : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_PluginProtocol_setDebugMode : Error processing arguments\");\n\t\tcobj->setDebugMode(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginProtocol_setDebugMode : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\n\nvoid js_cocos2d_plugin_PluginProtocol_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (PluginProtocol)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::PluginProtocol *nobj = static_cast<cocos2d::plugin::PluginProtocol *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_PluginProtocol(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_PluginProtocol_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_PluginProtocol_class->name = \"PluginProtocol\";\n\tjsb_cocos2d_plugin_PluginProtocol_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_PluginProtocol_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_PluginProtocol_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_PluginProtocol_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_PluginProtocol_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_PluginProtocol_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_PluginProtocol_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_PluginProtocol_class->finalize = js_cocos2d_plugin_PluginProtocol_finalize;\n\tjsb_cocos2d_plugin_PluginProtocol_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"getPluginName\", js_pluginx_protocols_PluginProtocol_getPluginName, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getPluginVersion\", js_pluginx_protocols_PluginProtocol_getPluginVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSDKVersion\", js_pluginx_protocols_PluginProtocol_getSDKVersion, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setDebugMode\", js_pluginx_protocols_PluginProtocol_setDebugMode, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_plugin_PluginProtocol_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_plugin_PluginProtocol_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"PluginProtocol\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::PluginProtocol> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_PluginProtocol_class;\n\t\tp->proto = jsb_cocos2d_plugin_PluginProtocol_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_plugin_PluginManager_class;\nJSObject *jsb_cocos2d_plugin_PluginManager_prototype;\n\nJSBool js_pluginx_protocols_PluginManager_unloadPlugin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::PluginManager* cobj = (cocos2d::plugin::PluginManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_PluginManager_unloadPlugin : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_PluginManager_unloadPlugin : Error processing arguments\");\n\t\tcobj->unloadPlugin(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginManager_unloadPlugin : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_PluginManager_loadPlugin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::PluginManager* cobj = (cocos2d::plugin::PluginManager *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_PluginManager_loadPlugin : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_PluginManager_loadPlugin : Error processing arguments\");\n\t\tcocos2d::plugin::PluginProtocol* ret = cobj->loadPlugin(arg0);\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::plugin::PluginProtocol>(cx, ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginManager_loadPlugin : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_PluginManager_end(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::plugin::PluginManager::end();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginManager_end : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_pluginx_protocols_PluginManager_getInstance(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tif (argc == 0) {\n\t\tcocos2d::plugin::PluginManager* ret = cocos2d::plugin::PluginManager::getInstance();\n\t\tjsval jsret;\n\t\tdo {\n\t\tif (ret) {\n\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::plugin::PluginManager>(cx, ret);\n\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t} else {\n\t\t\tjsret = JSVAL_NULL;\n\t\t}\n\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"js_pluginx_protocols_PluginManager_getInstance : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\n\nvoid js_cocos2d_plugin_PluginManager_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (PluginManager)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::PluginManager *nobj = static_cast<cocos2d::plugin::PluginManager *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_PluginManager(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_PluginManager_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_PluginManager_class->name = \"PluginManager\";\n\tjsb_cocos2d_plugin_PluginManager_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_PluginManager_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_PluginManager_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_PluginManager_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_PluginManager_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_PluginManager_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_PluginManager_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_PluginManager_class->finalize = js_cocos2d_plugin_PluginManager_finalize;\n\tjsb_cocos2d_plugin_PluginManager_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"unloadPlugin\", js_pluginx_protocols_PluginManager_unloadPlugin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"loadPlugin\", js_pluginx_protocols_PluginManager_loadPlugin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\tJS_FN(\"end\", js_pluginx_protocols_PluginManager_end, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getInstance\", js_pluginx_protocols_PluginManager_getInstance, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FS_END\n\t};\n\n\tjsb_cocos2d_plugin_PluginManager_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_cocos2d_plugin_PluginManager_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"PluginManager\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::PluginManager> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_PluginManager_class;\n\t\tp->proto = jsb_cocos2d_plugin_PluginManager_prototype;\n\t\tp->parentProto = NULL;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_plugin_ProtocolAnalytics_class;\nJSObject *jsb_cocos2d_plugin_ProtocolAnalytics_prototype;\n\nJSBool js_pluginx_protocols_ProtocolAnalytics_logTimedEventBegin(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logTimedEventBegin : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logTimedEventBegin : Error processing arguments\");\n\t\tcobj->logTimedEventBegin(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_logTimedEventBegin : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAnalytics_logError(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logError : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tconst char* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logError : Error processing arguments\");\n\t\tcobj->logError(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_logError : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAnalytics_setCaptureUncaughtException(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_setCaptureUncaughtException : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tJSBool arg0;\n\t\tok &= JS_ValueToBoolean(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_setCaptureUncaughtException : Error processing arguments\");\n\t\tcobj->setCaptureUncaughtException(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_setCaptureUncaughtException : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAnalytics_setSessionContinueMillis(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_setSessionContinueMillis : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tlong arg0;\n\t\tok &= jsval_to_long(cx, argv[0], (long *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_setSessionContinueMillis : Error processing arguments\");\n\t\tcobj->setSessionContinueMillis(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_setSessionContinueMillis : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAnalytics_logEvent(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logEvent : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logEvent : Error processing arguments\");\n\t\tcobj->logEvent(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tcocos2d::plugin::LogEventParamMap* arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tLogEventParamMap arg1_tmp;\n\t\tdo {\n\t\t\tok &= jsval_to_LogEventParamMap(cx, argv[1], &arg1);\n\t\t\tif (ok) { arg1_tmp = *arg1; delete arg1; arg1 = &arg1_tmp; } else { arg1 = NULL; }\n\t\t} while(0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logEvent : Error processing arguments\");\n\t\tcobj->logEvent(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_logEvent : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAnalytics_startSession(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_startSession : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_startSession : Error processing arguments\");\n\t\tcobj->startSession(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_startSession : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAnalytics_stopSession(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_stopSession : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->stopSession();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_stopSession : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAnalytics_logTimedEventEnd(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAnalytics* cobj = (cocos2d::plugin::ProtocolAnalytics *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logTimedEventEnd : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAnalytics_logTimedEventEnd : Error processing arguments\");\n\t\tcobj->logTimedEventEnd(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAnalytics_logTimedEventEnd : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nvoid js_cocos2d_plugin_ProtocolAnalytics_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProtocolAnalytics)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::ProtocolAnalytics *nobj = static_cast<cocos2d::plugin::ProtocolAnalytics *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_ProtocolAnalytics(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->name = \"ProtocolAnalytics\";\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->finalize = js_cocos2d_plugin_ProtocolAnalytics_finalize;\n\tjsb_cocos2d_plugin_ProtocolAnalytics_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tJSPropertySpec *properties = NULL;\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"logTimedEventBegin\", js_pluginx_protocols_ProtocolAnalytics_logTimedEventBegin, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"logError\", js_pluginx_protocols_ProtocolAnalytics_logError, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setCaptureUncaughtException\", js_pluginx_protocols_ProtocolAnalytics_setCaptureUncaughtException, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"setSessionContinueMillis\", js_pluginx_protocols_ProtocolAnalytics_setSessionContinueMillis, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"logEvent\", js_pluginx_protocols_ProtocolAnalytics_logEvent, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"startSession\", js_pluginx_protocols_ProtocolAnalytics_startSession, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"stopSession\", js_pluginx_protocols_ProtocolAnalytics_stopSession, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"logTimedEventEnd\", js_pluginx_protocols_ProtocolAnalytics_logTimedEventEnd, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_plugin_ProtocolAnalytics_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_plugin_PluginProtocol_prototype,\n\t\tjsb_cocos2d_plugin_ProtocolAnalytics_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProtocolAnalytics\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::ProtocolAnalytics> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_ProtocolAnalytics_class;\n\t\tp->proto = jsb_cocos2d_plugin_ProtocolAnalytics_prototype;\n\t\tp->parentProto = jsb_cocos2d_plugin_PluginProtocol_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_plugin_ProtocolIAP_class;\nJSObject *jsb_cocos2d_plugin_ProtocolIAP_prototype;\n\nJSBool js_pluginx_protocols_ProtocolIAP_payForProduct(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolIAP* cobj = (cocos2d::plugin::ProtocolIAP *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolIAP_payForProduct : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TProductInfo arg0;\n\t\tok &= jsval_to_TProductInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolIAP_payForProduct : Error processing arguments\");\n\t\tcobj->payForProduct(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolIAP_payForProduct : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolIAP_onPayResult(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolIAP* cobj = (cocos2d::plugin::ProtocolIAP *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolIAP_onPayResult : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::plugin::PayResultCode arg0;\n\t\tconst char* arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolIAP_onPayResult : Error processing arguments\");\n\t\tcobj->onPayResult(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolIAP_onPayResult : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolIAP_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolIAP* cobj = (cocos2d::plugin::ProtocolIAP *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolIAP_configDeveloperInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TIAPDeveloperInfo arg0;\n\t\tok &= jsval_to_TIAPDeveloperInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolIAP_configDeveloperInfo : Error processing arguments\");\n\t\tcobj->configDeveloperInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolIAP_configDeveloperInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nvoid js_cocos2d_plugin_ProtocolIAP_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProtocolIAP)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::ProtocolIAP *nobj = static_cast<cocos2d::plugin::ProtocolIAP *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_ProtocolIAP(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_ProtocolIAP_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_ProtocolIAP_class->name = \"ProtocolIAP\";\n\tjsb_cocos2d_plugin_ProtocolIAP_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->finalize = js_cocos2d_plugin_ProtocolIAP_finalize;\n\tjsb_cocos2d_plugin_ProtocolIAP_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"payForProduct\", js_pluginx_protocols_ProtocolIAP_payForProduct, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"onPayResult\", js_pluginx_protocols_ProtocolIAP_onPayResult, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"configDeveloperInfo\", js_pluginx_protocols_ProtocolIAP_configDeveloperInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_plugin_ProtocolIAP_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_plugin_PluginProtocol_prototype,\n\t\tjsb_cocos2d_plugin_ProtocolIAP_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProtocolIAP\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::ProtocolIAP> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_ProtocolIAP_class;\n\t\tp->proto = jsb_cocos2d_plugin_ProtocolIAP_prototype;\n\t\tp->parentProto = jsb_cocos2d_plugin_PluginProtocol_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_plugin_ProtocolAds_class;\nJSObject *jsb_cocos2d_plugin_ProtocolAds_prototype;\n\nJSBool js_pluginx_protocols_ProtocolAds_showAds(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAds* cobj = (cocos2d::plugin::ProtocolAds *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_showAds : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TAdsInfo arg0;\n\t\tok &= jsval_to_TAdsInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_showAds : Error processing arguments\");\n\t\tcobj->showAds(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\tif (argc == 2) {\n\t\tcocos2d::plugin::TAdsInfo arg0;\n\t\tcocos2d::plugin::ProtocolAds::AdsPos arg1;\n\t\tok &= jsval_to_TAdsInfo(cx, argv[0], &arg0);\n\t\tok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_showAds : Error processing arguments\");\n\t\tcobj->showAds(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAds_showAds : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAds_hideAds(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAds* cobj = (cocos2d::plugin::ProtocolAds *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_hideAds : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TAdsInfo arg0;\n\t\tok &= jsval_to_TAdsInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_hideAds : Error processing arguments\");\n\t\tcobj->hideAds(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAds_hideAds : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAds_queryPoints(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAds* cobj = (cocos2d::plugin::ProtocolAds *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_queryPoints : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->queryPoints();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAds_queryPoints : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAds_spendPoints(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAds* cobj = (cocos2d::plugin::ProtocolAds *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_spendPoints : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tint arg0;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_spendPoints : Error processing arguments\");\n\t\tcobj->spendPoints(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAds_spendPoints : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAds_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAds* cobj = (cocos2d::plugin::ProtocolAds *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_configDeveloperInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TAdsDeveloperInfo arg0;\n\t\tok &= jsval_to_TAdsDeveloperInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_configDeveloperInfo : Error processing arguments\");\n\t\tcobj->configDeveloperInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAds_configDeveloperInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolAds_getAdsListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolAds* cobj = (cocos2d::plugin::ProtocolAds *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolAds_getAdsListener : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcocos2d::plugin::AdsListener* ret = cobj->getAdsListener();\n\t\tjsval jsret;\n\t\tdo {\n\t\t\tif (ret) {\n\t\t\t\tjs_proxy_t *proxy = js_get_or_create_proxy<cocos2d::plugin::AdsListener>(cx, ret);\n\t\t\t\tjsret = OBJECT_TO_JSVAL(proxy->obj);\n\t\t\t} else {\n\t\t\t\tjsret = JSVAL_NULL;\n\t\t\t}\n\t\t} while (0);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolAds_getAdsListener : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nvoid js_cocos2d_plugin_ProtocolAds_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProtocolAds)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::ProtocolAds *nobj = static_cast<cocos2d::plugin::ProtocolAds *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_ProtocolAds(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_ProtocolAds_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_ProtocolAds_class->name = \"ProtocolAds\";\n\tjsb_cocos2d_plugin_ProtocolAds_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAds_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAds_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAds_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_ProtocolAds_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_ProtocolAds_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_ProtocolAds_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_ProtocolAds_class->finalize = js_cocos2d_plugin_ProtocolAds_finalize;\n\tjsb_cocos2d_plugin_ProtocolAds_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"showAds\", js_pluginx_protocols_ProtocolAds_showAds, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"hideAds\", js_pluginx_protocols_ProtocolAds_hideAds, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"queryPoints\", js_pluginx_protocols_ProtocolAds_queryPoints, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"spendPoints\", js_pluginx_protocols_ProtocolAds_spendPoints, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"configDeveloperInfo\", js_pluginx_protocols_ProtocolAds_configDeveloperInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getAdsListener\", js_pluginx_protocols_ProtocolAds_getAdsListener, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_plugin_ProtocolAds_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_plugin_PluginProtocol_prototype,\n\t\tjsb_cocos2d_plugin_ProtocolAds_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProtocolAds\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::ProtocolAds> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_ProtocolAds_class;\n\t\tp->proto = jsb_cocos2d_plugin_ProtocolAds_prototype;\n\t\tp->parentProto = jsb_cocos2d_plugin_PluginProtocol_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_plugin_ProtocolShare_class;\nJSObject *jsb_cocos2d_plugin_ProtocolShare_prototype;\n\nJSBool js_pluginx_protocols_ProtocolShare_onShareResult(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolShare* cobj = (cocos2d::plugin::ProtocolShare *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolShare_onShareResult : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tcocos2d::plugin::ShareResultCode arg0;\n\t\tconst char* arg1;\n\t\tok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolShare_onShareResult : Error processing arguments\");\n\t\tcobj->onShareResult(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolShare_onShareResult : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolShare_share(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolShare* cobj = (cocos2d::plugin::ProtocolShare *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolShare_share : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TShareInfo arg0;\n\t\tok &= jsval_to_TShareInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolShare_share : Error processing arguments\");\n\t\tcobj->share(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolShare_share : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolShare_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolShare* cobj = (cocos2d::plugin::ProtocolShare *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolShare_configDeveloperInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TShareDeveloperInfo arg0;\n\t\tok &= jsval_to_TShareDeveloperInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolShare_configDeveloperInfo : Error processing arguments\");\n\t\tcobj->configDeveloperInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolShare_configDeveloperInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nvoid js_cocos2d_plugin_ProtocolShare_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProtocolShare)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::ProtocolShare *nobj = static_cast<cocos2d::plugin::ProtocolShare *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_ProtocolShare(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_ProtocolShare_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_ProtocolShare_class->name = \"ProtocolShare\";\n\tjsb_cocos2d_plugin_ProtocolShare_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolShare_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_ProtocolShare_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolShare_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_ProtocolShare_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_ProtocolShare_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_ProtocolShare_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_ProtocolShare_class->finalize = js_cocos2d_plugin_ProtocolShare_finalize;\n\tjsb_cocos2d_plugin_ProtocolShare_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"onShareResult\", js_pluginx_protocols_ProtocolShare_onShareResult, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"share\", js_pluginx_protocols_ProtocolShare_share, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"configDeveloperInfo\", js_pluginx_protocols_ProtocolShare_configDeveloperInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_plugin_ProtocolShare_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_plugin_PluginProtocol_prototype,\n\t\tjsb_cocos2d_plugin_ProtocolShare_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProtocolShare\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::ProtocolShare> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_ProtocolShare_class;\n\t\tp->proto = jsb_cocos2d_plugin_ProtocolShare_prototype;\n\t\tp->parentProto = jsb_cocos2d_plugin_PluginProtocol_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_plugin_ProtocolSocial_class;\nJSObject *jsb_cocos2d_plugin_ProtocolSocial_prototype;\n\nJSBool js_pluginx_protocols_ProtocolSocial_showLeaderboard(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolSocial* cobj = (cocos2d::plugin::ProtocolSocial *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_showLeaderboard : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tconst char* arg0;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_showLeaderboard : Error processing arguments\");\n\t\tcobj->showLeaderboard(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolSocial_showLeaderboard : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolSocial_showAchievements(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolSocial* cobj = (cocos2d::plugin::ProtocolSocial *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_showAchievements : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->showAchievements();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolSocial_showAchievements : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolSocial_submitScore(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolSocial* cobj = (cocos2d::plugin::ProtocolSocial *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_submitScore : Invalid Native Object\");\n\tif (argc == 2) {\n\t\tconst char* arg0;\n\t\tlong arg1;\n\t\tstd::string arg0_tmp; ok &= jsval_to_std_string(cx, argv[0], &arg0_tmp); arg0 = arg0_tmp.c_str();\n\t\tok &= jsval_to_long(cx, argv[1], (long *)&arg1);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_submitScore : Error processing arguments\");\n\t\tcobj->submitScore(arg0, arg1);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolSocial_submitScore : wrong number of arguments: %d, was expecting %d\", argc, 2);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolSocial_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolSocial* cobj = (cocos2d::plugin::ProtocolSocial *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_configDeveloperInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TSocialDeveloperInfo arg0;\n\t\tok &= jsval_to_TSocialDeveloperInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_configDeveloperInfo : Error processing arguments\");\n\t\tcobj->configDeveloperInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolSocial_configDeveloperInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolSocial_unlockAchievement(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolSocial* cobj = (cocos2d::plugin::ProtocolSocial *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_unlockAchievement : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TAchievementInfo arg0;\n\t\tok &= jsval_to_TAchievementInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolSocial_unlockAchievement : Error processing arguments\");\n\t\tcobj->unlockAchievement(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolSocial_unlockAchievement : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nvoid js_cocos2d_plugin_ProtocolSocial_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProtocolSocial)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::ProtocolSocial *nobj = static_cast<cocos2d::plugin::ProtocolSocial *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_ProtocolSocial(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_ProtocolSocial_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_ProtocolSocial_class->name = \"ProtocolSocial\";\n\tjsb_cocos2d_plugin_ProtocolSocial_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->finalize = js_cocos2d_plugin_ProtocolSocial_finalize;\n\tjsb_cocos2d_plugin_ProtocolSocial_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"showLeaderboard\", js_pluginx_protocols_ProtocolSocial_showLeaderboard, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"showAchievements\", js_pluginx_protocols_ProtocolSocial_showAchievements, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"submitScore\", js_pluginx_protocols_ProtocolSocial_submitScore, 2, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"configDeveloperInfo\", js_pluginx_protocols_ProtocolSocial_configDeveloperInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"unlockAchievement\", js_pluginx_protocols_ProtocolSocial_unlockAchievement, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_plugin_ProtocolSocial_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_plugin_PluginProtocol_prototype,\n\t\tjsb_cocos2d_plugin_ProtocolSocial_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProtocolSocial\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::ProtocolSocial> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_ProtocolSocial_class;\n\t\tp->proto = jsb_cocos2d_plugin_ProtocolSocial_prototype;\n\t\tp->parentProto = jsb_cocos2d_plugin_PluginProtocol_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSClass  *jsb_cocos2d_plugin_ProtocolUser_class;\nJSObject *jsb_cocos2d_plugin_ProtocolUser_prototype;\n\nJSBool js_pluginx_protocols_ProtocolUser_isLogined(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolUser* cobj = (cocos2d::plugin::ProtocolUser *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolUser_isLogined : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tJSBool ret = cobj->isLogined();\n\t\tjsval jsret;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolUser_isLogined : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolUser_logout(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolUser* cobj = (cocos2d::plugin::ProtocolUser *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolUser_logout : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->logout();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolUser_logout : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolUser_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolUser* cobj = (cocos2d::plugin::ProtocolUser *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolUser_configDeveloperInfo : Invalid Native Object\");\n\tif (argc == 1) {\n\t\tcocos2d::plugin::TUserDeveloperInfo arg0;\n\t\tok &= jsval_to_TUserDeveloperInfo(cx, argv[0], &arg0);\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolUser_configDeveloperInfo : Error processing arguments\");\n\t\tcobj->configDeveloperInfo(arg0);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolUser_configDeveloperInfo : wrong number of arguments: %d, was expecting %d\", argc, 1);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolUser_login(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolUser* cobj = (cocos2d::plugin::ProtocolUser *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolUser_login : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tcobj->login();\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolUser_login : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\nJSBool js_pluginx_protocols_ProtocolUser_getSessionID(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcocos2d::plugin::ProtocolUser* cobj = (cocos2d::plugin::ProtocolUser *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"js_pluginx_protocols_ProtocolUser_getSessionID : Invalid Native Object\");\n\tif (argc == 0) {\n\t\tstd::string ret = cobj->getSessionID();\n\t\tjsval jsret;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n\n\tJS_ReportError(cx, \"js_pluginx_protocols_ProtocolUser_getSessionID : wrong number of arguments: %d, was expecting %d\", argc, 0);\n\treturn JS_FALSE;\n}\n\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nvoid js_cocos2d_plugin_ProtocolUser_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (ProtocolUser)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n//        cocos2d::plugin::ProtocolUser *nobj = static_cast<cocos2d::plugin::ProtocolUser *>(nproxy->ptr);\n//        if (nobj)\n//            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n}\n\nvoid js_register_pluginx_protocols_ProtocolUser(JSContext *cx, JSObject *global) {\n\tjsb_cocos2d_plugin_ProtocolUser_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_cocos2d_plugin_ProtocolUser_class->name = \"ProtocolUser\";\n\tjsb_cocos2d_plugin_ProtocolUser_class->addProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolUser_class->delProperty = JS_DeletePropertyStub;\n\tjsb_cocos2d_plugin_ProtocolUser_class->getProperty = JS_PropertyStub;\n\tjsb_cocos2d_plugin_ProtocolUser_class->setProperty = JS_StrictPropertyStub;\n\tjsb_cocos2d_plugin_ProtocolUser_class->enumerate = JS_EnumerateStub;\n\tjsb_cocos2d_plugin_ProtocolUser_class->resolve = JS_ResolveStub;\n\tjsb_cocos2d_plugin_ProtocolUser_class->convert = JS_ConvertStub;\n\tjsb_cocos2d_plugin_ProtocolUser_class->finalize = js_cocos2d_plugin_ProtocolUser_finalize;\n\tjsb_cocos2d_plugin_ProtocolUser_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\tJS_FN(\"isLogined\", js_pluginx_protocols_ProtocolUser_isLogined, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"logout\", js_pluginx_protocols_ProtocolUser_logout, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"configDeveloperInfo\", js_pluginx_protocols_ProtocolUser_configDeveloperInfo, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"login\", js_pluginx_protocols_ProtocolUser_login, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\tJS_FN(\"getSessionID\", js_pluginx_protocols_ProtocolUser_getSessionID, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n        JS_FS_END\n\t};\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_cocos2d_plugin_ProtocolUser_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tjsb_cocos2d_plugin_PluginProtocol_prototype,\n\t\tjsb_cocos2d_plugin_ProtocolUser_class,\n\t\tempty_constructor, 0,\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"ProtocolUser\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::ProtocolUser> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_cocos2d_plugin_ProtocolUser_class;\n\t\tp->proto = jsb_cocos2d_plugin_ProtocolUser_prototype;\n\t\tp->parentProto = jsb_cocos2d_plugin_PluginProtocol_prototype;\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj) {\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"plugin\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"plugin\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\n\tjs_register_pluginx_protocols_PluginProtocol(cx, obj);\n\tjs_register_pluginx_protocols_ProtocolUser(cx, obj);\n\tjs_register_pluginx_protocols_ProtocolShare(cx, obj);\n\tjs_register_pluginx_protocols_ProtocolIAP(cx, obj);\n\tjs_register_pluginx_protocols_ProtocolSocial(cx, obj);\n\tjs_register_pluginx_protocols_ProtocolAnalytics(cx, obj);\n\tjs_register_pluginx_protocols_ProtocolAds(cx, obj);\n\tjs_register_pluginx_protocols_PluginManager(cx, obj);\n}\n\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/auto/jsb_pluginx_protocols_auto.hpp",
    "content": "#ifndef __pluginx_protocols_h__\n#define __pluginx_protocols_h__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n\nextern JSClass  *jsb_cocos2d_plugin_PluginProtocol_class;\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\n\nJSBool js_pluginx_protocols_PluginProtocol_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_PluginProtocol_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_PluginProtocol(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_PluginProtocol_getPluginName(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_PluginProtocol_getPluginVersion(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_PluginProtocol_getSDKVersion(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_PluginProtocol_setDebugMode(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_plugin_PluginManager_class;\nextern JSObject *jsb_cocos2d_plugin_PluginManager_prototype;\n\nJSBool js_pluginx_protocols_PluginManager_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_PluginManager_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_PluginManager(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_PluginManager_unloadPlugin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_PluginManager_loadPlugin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_PluginManager_end(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_PluginManager_getInstance(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_plugin_ProtocolAnalytics_class;\nextern JSObject *jsb_cocos2d_plugin_ProtocolAnalytics_prototype;\n\nJSBool js_pluginx_protocols_ProtocolAnalytics_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_ProtocolAnalytics_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_ProtocolAnalytics(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_ProtocolAnalytics_logTimedEventBegin(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAnalytics_logError(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAnalytics_setCaptureUncaughtException(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAnalytics_setSessionContinueMillis(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAnalytics_logEvent(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAnalytics_startSession(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAnalytics_stopSession(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAnalytics_logTimedEventEnd(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_plugin_ProtocolIAP_class;\nextern JSObject *jsb_cocos2d_plugin_ProtocolIAP_prototype;\n\nJSBool js_pluginx_protocols_ProtocolIAP_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_ProtocolIAP_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_ProtocolIAP(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_ProtocolIAP_payForProduct(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolIAP_onPayResult(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolIAP_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_plugin_ProtocolAds_class;\nextern JSObject *jsb_cocos2d_plugin_ProtocolAds_prototype;\n\nJSBool js_pluginx_protocols_ProtocolAds_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_ProtocolAds_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_ProtocolAds(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_ProtocolAds_showAds(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAds_hideAds(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAds_queryPoints(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAds_spendPoints(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAds_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolAds_getAdsListener(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_plugin_ProtocolShare_class;\nextern JSObject *jsb_cocos2d_plugin_ProtocolShare_prototype;\n\nJSBool js_pluginx_protocols_ProtocolShare_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_ProtocolShare_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_ProtocolShare(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_ProtocolShare_onShareResult(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolShare_share(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolShare_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_plugin_ProtocolSocial_class;\nextern JSObject *jsb_cocos2d_plugin_ProtocolSocial_prototype;\n\nJSBool js_pluginx_protocols_ProtocolSocial_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_ProtocolSocial_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_ProtocolSocial(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_ProtocolSocial_showLeaderboard(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolSocial_showAchievements(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolSocial_submitScore(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolSocial_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolSocial_unlockAchievement(JSContext *cx, uint32_t argc, jsval *vp);\n\nextern JSClass  *jsb_cocos2d_plugin_ProtocolUser_class;\nextern JSObject *jsb_cocos2d_plugin_ProtocolUser_prototype;\n\nJSBool js_pluginx_protocols_ProtocolUser_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_ProtocolUser_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_ProtocolUser(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_ProtocolUser_isLogined(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolUser_logout(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolUser_configDeveloperInfo(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolUser_login(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_protocols_ProtocolUser_getSessionID(JSContext *cx, uint32_t argc, jsval *vp);\n#endif\n\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/auto/jsb_pluginx_protocols_auto_api.js",
    "content": "/**\n * @module pluginx_protocols\n */\nvar plugin = plugin || {};\n\n/**\n * @class PluginProtocol\n */\nplugin.PluginProtocol = {\n\n/**\n * @method getPluginName\n * @return A value converted from C/C++ \"const char*\"\n */\ngetPluginName : function () {},\n\n/**\n * @method getPluginVersion\n * @return A value converted from C/C++ \"std::string\"\n */\ngetPluginVersion : function () {},\n\n/**\n * @method getSDKVersion\n * @return A value converted from C/C++ \"std::string\"\n */\ngetSDKVersion : function () {},\n\n/**\n * @method setDebugMode\n * @param {bool}\n */\nsetDebugMode : function () {},\n\n};\n\n/**\n * @class PluginManager\n */\nplugin.PluginManager = {\n\n/**\n * @method unloadPlugin\n * @param {const char*}\n */\nunloadPlugin : function () {},\n\n/**\n * @method loadPlugin\n * @return A value converted from C/C++ \"cocos2d::plugin::PluginProtocol*\"\n * @param {const char*}\n */\nloadPlugin : function () {},\n\n/**\n * @method end\n */\nend : function () {},\n\n/**\n * @method getInstance\n * @return A value converted from C/C++ \"cocos2d::plugin::PluginManager*\"\n */\ngetInstance : function () {},\n\n};\n\n/**\n * @class ProtocolAnalytics\n */\nplugin.ProtocolAnalytics = {\n\n/**\n * @method logTimedEventBegin\n * @param {const char*}\n */\nlogTimedEventBegin : function () {},\n\n/**\n * @method logError\n * @param {const char*}\n * @param {const char*}\n */\nlogError : function () {},\n\n/**\n * @method setCaptureUncaughtException\n * @param {bool}\n */\nsetCaptureUncaughtException : function () {},\n\n/**\n * @method setSessionContinueMillis\n * @param {long}\n */\nsetSessionContinueMillis : function () {},\n\n/**\n * @method logEvent\n * @param {const char*}\n * @param {cocos2d::plugin::LogEventParamMap*}\n */\nlogEvent : function () {},\n\n/**\n * @method startSession\n * @param {const char*}\n */\nstartSession : function () {},\n\n/**\n * @method stopSession\n */\nstopSession : function () {},\n\n/**\n * @method logTimedEventEnd\n * @param {const char*}\n */\nlogTimedEventEnd : function () {},\n\n};\n\n/**\n * @class ProtocolIAP\n */\nplugin.ProtocolIAP = {\n\n/**\n * @method payForProduct\n * @param {cocos2d::plugin::TProductInfo}\n */\npayForProduct : function () {},\n\n/**\n * @method onPayResult\n * @param {cocos2d::plugin::PayResultCode}\n * @param {const char*}\n */\nonPayResult : function () {},\n\n/**\n * @method configDeveloperInfo\n * @param {cocos2d::plugin::TIAPDeveloperInfo}\n */\nconfigDeveloperInfo : function () {},\n\n};\n\n/**\n * @class ProtocolAds\n */\nplugin.ProtocolAds = {\n\n/**\n * @method showAds\n * @param {cocos2d::plugin::TAdsInfo}\n * @param {cocos2d::plugin::ProtocolAds::AdsPos}\n */\nshowAds : function () {},\n\n/**\n * @method hideAds\n * @param {cocos2d::plugin::TAdsInfo}\n */\nhideAds : function () {},\n\n/**\n * @method queryPoints\n */\nqueryPoints : function () {},\n\n/**\n * @method spendPoints\n * @param {int}\n */\nspendPoints : function () {},\n\n/**\n * @method configDeveloperInfo\n * @param {cocos2d::plugin::TAdsDeveloperInfo}\n */\nconfigDeveloperInfo : function () {},\n\n/**\n * @method getAdsListener\n * @return A value converted from C/C++ \"cocos2d::plugin::AdsListener*\"\n */\ngetAdsListener : function () {},\n\n};\n\n/**\n * @class ProtocolShare\n */\nplugin.ProtocolShare = {\n\n/**\n * @method onShareResult\n * @param {cocos2d::plugin::ShareResultCode}\n * @param {const char*}\n */\nonShareResult : function () {},\n\n/**\n * @method share\n * @param {cocos2d::plugin::TShareInfo}\n */\nshare : function () {},\n\n/**\n * @method configDeveloperInfo\n * @param {cocos2d::plugin::TShareDeveloperInfo}\n */\nconfigDeveloperInfo : function () {},\n\n};\n\n/**\n * @class ProtocolSocial\n */\nplugin.ProtocolSocial = {\n\n/**\n * @method showLeaderboard\n * @param {const char*}\n */\nshowLeaderboard : function () {},\n\n/**\n * @method showAchievements\n */\nshowAchievements : function () {},\n\n/**\n * @method submitScore\n * @param {const char*}\n * @param {long}\n */\nsubmitScore : function () {},\n\n/**\n * @method configDeveloperInfo\n * @param {cocos2d::plugin::TSocialDeveloperInfo}\n */\nconfigDeveloperInfo : function () {},\n\n/**\n * @method unlockAchievement\n * @param {cocos2d::plugin::TAchievementInfo}\n */\nunlockAchievement : function () {},\n\n};\n\n/**\n * @class ProtocolUser\n */\nplugin.ProtocolUser = {\n\n/**\n * @method isLogined\n * @return A value converted from C/C++ \"bool\"\n */\nisLogined : function () {},\n\n/**\n * @method logout\n */\nlogout : function () {},\n\n/**\n * @method configDeveloperInfo\n * @param {cocos2d::plugin::TUserDeveloperInfo}\n */\nconfigDeveloperInfo : function () {},\n\n/**\n * @method login\n */\nlogin : function () {},\n\n/**\n * @method getSessionID\n * @return A value converted from C/C++ \"std::string\"\n */\ngetSessionID : function () {},\n\n};\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/js/jsb_pluginx.js",
    "content": "plugin = plugin || {};\n\nplugin.PluginParam.ParamType = {};\nplugin.PluginParam.ParamType.TypeInt = 1;\nplugin.PluginParam.ParamType.TypeFloat = 2;\nplugin.PluginParam.ParamType.TypeBool = 3;\nplugin.PluginParam.ParamType.TypeString = 4;\nplugin.PluginParam.ParamType.TypeStringMap = 5;\n\nplugin.ProtocolAds.AdsResultCode = {};\nplugin.ProtocolAds.AdsResultCode.AdsReceived = 0;\nplugin.ProtocolAds.AdsResultCode.FullScreenViewShown = 1;\nplugin.ProtocolAds.AdsResultCode.FullScreenViewDismissed = 2;\nplugin.ProtocolAds.AdsResultCode.PointsSpendSucceed = 3;\nplugin.ProtocolAds.AdsResultCode.PointsSpendFailed = 4;\nplugin.ProtocolAds.AdsResultCode.NetworkError = 5;\nplugin.ProtocolAds.AdsResultCode.UnknownError = 6;\n\nplugin.ProtocolAds.AdsPos = {};\nplugin.ProtocolAds.AdsPos.PosCenter = 0;\nplugin.ProtocolAds.AdsPos.PosTop = 1;\nplugin.ProtocolAds.AdsPos.PosTopLeft = 2;\nplugin.ProtocolAds.AdsPos.PosTopRight = 3;\nplugin.ProtocolAds.AdsPos.PosBottom = 4;\nplugin.ProtocolAds.AdsPos.PosBottomLeft = 5;\nplugin.ProtocolAds.AdsPos.PosBottomRight = 6;\n\nplugin.ProtocolIAP.PayResultCode = {};\nplugin.ProtocolIAP.PayResultCode.PaySuccess = 0;\nplugin.ProtocolIAP.PayResultCode.PayFail = 1;\nplugin.ProtocolIAP.PayResultCode.PayCancel = 2;\nplugin.ProtocolIAP.PayResultCode.PayTimeOut = 3;\n\nplugin.ProtocolShare.ShareResultCode = {};\nplugin.ProtocolShare.ShareResultCode.ShareSuccess = 0;\nplugin.ProtocolShare.ShareResultCode.ShareFail = 1;\nplugin.ProtocolShare.ShareResultCode.ShareCancel = 2;\nplugin.ProtocolShare.ShareResultCode.ShareTimeOut = 3;\n\nplugin.ProtocolSocial.SocialRetCode = {};\nplugin.ProtocolSocial.SocialRetCode.ScoreSubmitSuccess = 1;\nplugin.ProtocolSocial.SocialRetCode.ScoreSubmitFailed = 2;\nplugin.ProtocolSocial.SocialRetCode.AchUnlockSuccess = 3;\nplugin.ProtocolSocial.SocialRetCode.AchUnlockFailed = 4;\n\nplugin.ProtocolUser.UserActionResultCode = {};\nplugin.ProtocolUser.UserActionResultCode.LoginSucceed = 0;\nplugin.ProtocolUser.UserActionResultCode.LoginFailed = 1;\nplugin.ProtocolUser.UserActionResultCode.LogoutSucceed = 2;\n\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_basic_conversions.cpp",
    "content": "#include \"jsb_pluginx_basic_conversions.h\"\n#include <math.h>\n\n#include \"jsb_pluginx_spidermonkey_specifics.h\"\n#include \"pluginxUTF8.h\"\n\nnamespace pluginx {\n\n// just a simple utility to avoid mem leaking when using JSString\nclass JSStringWrapper\n{\n    JSString*   string;\n    const char* buffer;\n    JSContext* cx;\npublic:\n    JSStringWrapper() {\n        buffer = NULL;\n    }\n    JSStringWrapper(JSString* str, JSContext* cx) {\n        set(str, cx);\n    }\n    JSStringWrapper(jsval val, JSContext* cx) {\n        set(val, cx);\n    }\n    ~JSStringWrapper() {\n        if (buffer) {\n            // delete[] buffer;\n            // buffer = NULL;\n            JS_free(cx, (void*)buffer);\n        }\n    }\n    void set(jsval val, JSContext* cx) {\n        if (val.isString()) {\n            this->set(val.toString(), cx);\n        } else {\n            buffer = NULL;\n        }\n    }\n    void set(JSString* str, JSContext* cx) {\n        this->cx = cx;\n        string = str;\n        // Not suppored in SpiderMonkey v19\n        //buffer = JS_EncodeString(cx, string);\n        \n        const jschar *chars = JS_GetStringCharsZ(cx, string);\n        size_t l = JS_GetStringLength(string);\n        char* pUTF8Str = cc_utf16_to_utf8((const unsigned short*)chars, l, NULL, NULL);\n        buffer = pUTF8Str;\n    }\n\n    std::string get() {\n        return buffer;\n    }\n\n    operator std::string() {\n        return std::string(buffer);\n    }\n    operator char*() {\n        return (char*)buffer;\n    }\n};\n\n\nJSBool jsval_to_int32( JSContext *cx, jsval vp, int32_t *outval )\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    if (!ok) {\n        LOGD(\"jsval_to_int32: the argument is not a number\");\n        return JS_FALSE;\n    }\n    ok &= !isnan(dp);\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    *outval = (int32_t)dp;\n\n    return ok;\n}\n\nJSBool jsval_to_uint32( JSContext *cx, jsval vp, uint32_t *outval )\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    if (!ok) {\n        LOGD(\"jsval_to_uint32: the argument is not a number\");\n        return JS_FALSE;\n    }\n    ok &= !isnan(dp);\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    *outval = (uint32_t)dp;\n\n    return ok;\n}\n\nJSBool jsval_to_uint16( JSContext *cx, jsval vp, uint16_t *outval )\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    if (!ok) {\n        LOGD(\"jsval_to_uint16: the argument is not a number\");\n        return JS_FALSE;\n    }\n    ok &= !isnan(dp);\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    *outval = (uint16_t)dp;\n\n    return ok;\n}\n\nJSBool jsval_to_long_long(JSContext *cx, jsval vp, long long* r) {\n    JSObject *tmp_arg;\n    JSBool ok = JS_ValueToObject( cx, vp, &tmp_arg );\n    if (!ok) {\n        LOGD(\"jsval_to_long_long: Error converting value to object\");\n        return JS_FALSE;\n    }\n\n    JSB_PRECONDITION2( tmp_arg && JS_IsTypedArrayObject( tmp_arg ), cx, JS_FALSE, \"Not a TypedArray object\");\n    JSB_PRECONDITION2( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(long long), cx, JS_FALSE, \"Invalid Typed Array length\");\n    \n    uint32_t* arg_array = (uint32_t*)JS_GetArrayBufferViewData( tmp_arg );\n    long long ret =  arg_array[0];\n    ret = ret << 32;\n    ret |= arg_array[1];\n    \n    *r = ret;\n    return JS_TRUE;\n}\n\nJSBool jsval_to_long(JSContext *cx, jsval vp, long* ret)\n{\n    JSBool ok = JS_TRUE;\n    double dp;\n    ok &= JS_ValueToNumber(cx, vp, &dp);\n    if (!ok) {\n        LOGD(\"jsval_to_long: the argument is not a number\");\n        return JS_FALSE;\n    }\n    ok &= !isnan(dp);\n    JSB_PRECONDITION2(ok, cx, JS_FALSE, \"Error processing arguments\");\n\n    *ret = (long)dp;\n\n    return ok;\n}\n\nJSBool jsval_to_std_string(JSContext *cx, jsval v, std::string* ret) {\n    JSString *tmp = JS_ValueToString(cx, v);\n    if (!tmp) {\n        LOGD(\"jsval_to_std_string: the jsval is not a string.\");\n        return JS_FALSE;\n    }\n\n    JSStringWrapper str(tmp, cx);\n    *ret = str.get();\n    return JS_TRUE;\n}\n\nJSBool jsval_to_TProductInfo(JSContext *cx, jsval v, TProductInfo* ret)\n{\n    JSObject* tmp = JSVAL_TO_OBJECT(v);\n    if (!tmp) {\n        LOGD(\"jsval_to_TProductInfo: the jsval is not an object.\");\n        return JS_FALSE;\n    }\n\n    JSObject* it = JS_NewPropertyIterator(cx, tmp);\n\n    while (true)\n    {\n        jsid idp;\n        jsval key;\n        if (! JS_NextProperty(cx, it, &idp) || ! JS_IdToValue(cx, idp, &key))\n            return JS_FALSE; // error\n        if (key == JSVAL_VOID)\n            break; // end of iteration\n        if (! JSVAL_IS_STRING(key))\n            continue; // ignore integer properties\n        JS::RootedValue value(cx);\n        JS_GetPropertyById(cx, tmp, idp, &value);\n        if (! JSVAL_IS_STRING(value))\n            continue; // ignore integer properties\n\n        JSStringWrapper strWrapper(JSVAL_TO_STRING(key), cx);\n        JSStringWrapper strWrapper2(JSVAL_TO_STRING(value), cx);\n\n        (*ret)[strWrapper.get()] = strWrapper2.get();\n        LOGD(\"iterate object: key = %s, value = %s\", strWrapper.get().c_str(), strWrapper2.get().c_str());\n    }\n\n    return JS_TRUE;\n}\n\nJSBool jsval_to_TIAPDeveloperInfo(JSContext *cx, jsval v, TIAPDeveloperInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TAdsDeveloperInfo(JSContext *cx, jsval v, TAdsDeveloperInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TAdsInfo(JSContext *cx, jsval v, TAdsInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TShareDeveloperInfo(JSContext *cx, jsval v, TShareDeveloperInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TShareInfo(JSContext *cx, jsval v, TShareInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TPaymentInfo(JSContext *cx, jsval v, std::map<std::string, std::string>* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TSocialDeveloperInfo(JSContext *cx, jsval v, TSocialDeveloperInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TAchievementInfo(JSContext *cx, jsval v, TAchievementInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_TUserDeveloperInfo(JSContext *cx, jsval v, TUserDeveloperInfo* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\nJSBool jsval_to_LogEventParamMap(JSContext *cx, jsval v, LogEventParamMap** ret)\n{\n    JSBool jsret = JS_FALSE;\n    if (v.isObject())\n    {\n        LogEventParamMap* tmp = new LogEventParamMap();\n        jsret = jsval_to_TProductInfo(cx, v, tmp);\n        if (jsret) {\n            *ret = tmp;\n        }\n    }\n\n    return jsret;\n}\n\nJSBool jsval_to_StringMap(JSContext *cx, jsval v, StringMap* ret)\n{\n    return jsval_to_TProductInfo(cx, v, ret);\n}\n\n// From native type to jsval\njsval int32_to_jsval( JSContext *cx, int32_t number )\n{\n    return INT_TO_JSVAL(number);\n}\n\njsval uint32_to_jsval( JSContext *cx, uint32_t number )\n{\n    return UINT_TO_JSVAL(number);\n}\n\njsval long_long_to_jsval(JSContext* cx, long long v) {\n    JSObject *tmp = JS_NewUint32Array(cx, 2);\n    uint32_t *data = (uint32_t *)JS_GetArrayBufferViewData(tmp);\n    data[0] = ((uint32_t *)(&v))[0];\n    data[1] = ((uint32_t *)(&v))[1];\n    return OBJECT_TO_JSVAL(tmp);\n}\n\njsval long_to_jsval(JSContext* cx, long v)\n{\n    return INT_TO_JSVAL(v);\n}\n\njsval std_string_to_jsval(JSContext* cx, const std::string& v) {\n    return c_string_to_jsval(cx, v.c_str());\n}\n\njsval c_string_to_jsval(JSContext* cx, const char* v, size_t length /* = -1 */) {\n    if (v == NULL) {\n        return JSVAL_NULL;\n    }\n    jsval ret = JSVAL_NULL;\n    int utf16_size = 0;\n    jschar* strUTF16 = (jschar*)cc_utf8_to_utf16(v, length, &utf16_size);\n\n    if (strUTF16 && utf16_size > 0) {\n        JSString* str = JS_NewUCStringCopyN(cx, strUTF16, utf16_size);\n        if (str) {\n            ret = STRING_TO_JSVAL(str);\n        }\n        delete[] strUTF16;\n    }\n    return ret;\n}\n\njsval TProductInfo_to_jsval(JSContext *cx, TProductInfo& ret)\n{\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n\n    for (TProductInfo::iterator it = ret.begin(); it != ret.end(); ++it)\n    {\n        JS_DefineProperty(cx, tmp, it->first.c_str(), std_string_to_jsval(cx, it->second), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    }\n\n    return OBJECT_TO_JSVAL(tmp);\n}\n\njsval LogEventParamMap_to_jsval(JSContext *cx, LogEventParamMap*& ret)\n{// TODO:\n    return JSVAL_NULL;\n}\n\n}// namespace pluginx {\n\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_basic_conversions.h",
    "content": "#ifndef __JS_BASIC_CONVERSIONS_H__\n#define __JS_BASIC_CONVERSIONS_H__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n#include \"ProtocolIAP.h\"\n#include \"ProtocolAnalytics.h\"\n#include \"ProtocolAds.h\"\n#include \"ProtocolShare.h\"\n#include \"ProtocolSocial.h\"\n#include \"ProtocolUser.h\"\n\n#ifndef CCLOGINFO\n#define CCLOGINFO(...)      \n#endif\n\nusing namespace cocos2d::plugin;\n\nnamespace pluginx {\n\n// to native\nJSBool jsval_to_int32( JSContext *cx, jsval vp, int32_t *ret );\nJSBool jsval_to_uint32( JSContext *cx, jsval vp, uint32_t *ret );\nJSBool jsval_to_uint16( JSContext *cx, jsval vp, uint16_t *ret );\nJSBool jsval_to_long(JSContext *cx, jsval v, long* ret);\nJSBool jsval_to_long_long(JSContext *cx, jsval v, long long* ret);\nJSBool jsval_to_std_string(JSContext *cx, jsval v, std::string* ret);\nJSBool jsval_to_TProductInfo(JSContext *cx, jsval v, TProductInfo* ret);\nJSBool jsval_to_TIAPDeveloperInfo(JSContext *cx, jsval v, TIAPDeveloperInfo* ret);\nJSBool jsval_to_TAdsDeveloperInfo(JSContext *cx, jsval v, TAdsDeveloperInfo* ret);\nJSBool jsval_to_TAdsInfo(JSContext *cx, jsval v, TAdsInfo* ret);\nJSBool jsval_to_TShareDeveloperInfo(JSContext *cx, jsval v, TShareDeveloperInfo* ret);\nJSBool jsval_to_TShareInfo(JSContext *cx, jsval v, TShareInfo* ret);\nJSBool jsval_to_TSocialDeveloperInfo(JSContext *cx, jsval v, TSocialDeveloperInfo* ret);\nJSBool jsval_to_TAchievementInfo(JSContext *cx, jsval v, TAchievementInfo* ret);\nJSBool jsval_to_TPaymentInfo(JSContext *cx, jsval v, std::map<std::string, std::string>* ret);\nJSBool jsval_to_TUserDeveloperInfo(JSContext *cx, jsval v, TUserDeveloperInfo* ret);\nJSBool jsval_to_LogEventParamMap(JSContext *cx, jsval v, LogEventParamMap** ret);\nJSBool jsval_to_StringMap(JSContext *cx, jsval v, StringMap* ret);\n\n// from native\njsval int32_to_jsval( JSContext *cx, int32_t l);\njsval uint32_to_jsval( JSContext *cx, uint32_t number );\njsval long_long_to_jsval(JSContext* cx, long long v);\njsval long_to_jsval(JSContext* cx, long v);\njsval std_string_to_jsval(JSContext* cx, const std::string& v);\njsval c_string_to_jsval(JSContext* cx, const char* v, size_t length = -1);\njsval TProductInfo_to_jsval(JSContext *cx, TProductInfo& ret);\njsval LogEventParamMap_to_jsval(JSContext *cx, LogEventParamMap*& ret);\n\n} // namespace pluginx {\n\n#endif /* __JS_BASIC_CONVERSIONS_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_extension_registration.cpp",
    "content": "#include \"jsb_pluginx_extension_registration.h\"\n#include \"jsb_pluginx_manual_callback.h\"\n#include \"jsb_pluginx_manual_protocols.h\"\n\nstatic jsval anonEvaluate(JSContext *cx, JSObject *thisObj, const char* string) {\n    jsval out;\n    if (JS_EvaluateScript(cx, thisObj, string, strlen(string), \"(string)\", 1, &out) == JS_TRUE) {\n        return out;\n    }\n    return JSVAL_VOID;\n}\n\nextern JSObject *jsb_cocos2d_plugin_ProtocolIAP_prototype;\nextern JSObject *jsb_cocos2d_plugin_ProtocolAds_prototype;\nextern JSObject *jsb_cocos2d_plugin_ProtocolShare_prototype;\nextern JSObject *jsb_cocos2d_plugin_PluginProtocol_prototype;\nextern JSObject *jsb_cocos2d_plugin_ProtocolSocial_prototype;\nextern JSObject *jsb_cocos2d_plugin_ProtocolUser_prototype;\n\nvoid register_pluginx_js_extensions(JSContext* cx, JSObject* global)\n{\n    // first, try to get the ns\n    JS::RootedValue nsval(cx);\n    JSObject *ns;\n    JS_GetProperty(cx, global, \"plugin\", &nsval);\n    if (nsval == JSVAL_VOID) {\n        ns = JS_NewObject(cx, NULL, NULL, NULL);\n        nsval = OBJECT_TO_JSVAL(ns);\n        JS_SetProperty(cx, global, \"plugin\", nsval);\n    } else {\n        JS_ValueToObject(cx, nsval, &ns);\n    }\n\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_ProtocolIAP_prototype, \"setResultListener\", js_pluginx_ProtocolIAP_setResultListener, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_ProtocolAds_prototype, \"setAdsListener\", js_pluginx_ProtocolAds_setAdsListener, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_ProtocolShare_prototype, \"setResultListener\", js_pluginx_ProtocolShare_setResultListener, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_ProtocolSocial_prototype, \"setListener\", js_pluginx_ProtocolSocial_setListener, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_ProtocolUser_prototype, \"setActionListener\", js_pluginx_ProtocolUser_setActionListener, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_PluginProtocol_prototype, \"callFuncWithParam\", js_pluginx_PluginProtocol_callFuncWithParam, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_PluginProtocol_prototype, \"callStringFuncWithParam\", js_pluginx_PluginProtocol_callStringFuncWithParam, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_PluginProtocol_prototype, \"callIntFuncWithParam\", js_pluginx_PluginProtocol_callIntFuncWithParam, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_PluginProtocol_prototype, \"callFloatFuncWithParam\", js_pluginx_PluginProtocol_callFloatFuncWithParam, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, jsb_cocos2d_plugin_PluginProtocol_prototype, \"callBoolFuncWithParam\", js_pluginx_PluginProtocol_callBoolFuncWithParam, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\n    global = ns;\n    js_register_pluginx_protocols_PluginParam(cx, global);\n}\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_extension_registration.h",
    "content": "#ifndef __JS_EXTENSION_REGISTRATION_H__\n#define __JS_EXTENSION_REGISTRATION_H__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nvoid register_pluginx_js_extensions(JSContext* cx, JSObject* global);\n\n#endif /* __JS_EXTENSION_REGISTRATION_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_manual_callback.cpp",
    "content": "#include \"jsb_pluginx_manual_callback.h\"\n#include \"jsb_pluginx_basic_conversions.h\"\n#include \"jsb_pluginx_spidermonkey_specifics.h\"\n#include \"ProtocolAds.h\"\n\nusing namespace pluginx;\n\nstatic JSContext* s_cx = NULL;\n\nclass Pluginx_PurchaseResult : public cocos2d::plugin::PayResultListener\n{\npublic:\n    virtual void onPayResult(cocos2d::plugin::PayResultCode ret, const char* msg, cocos2d::plugin::TProductInfo info)\n    {\n        char goodInfo[1024] = { 0 };\n        sprintf(goodInfo, \"商品名称:%s\\n商品价格:%s\\n商品描述:%s\",\n                info.find(\"productName\")->second.c_str(),\n                info.find(\"productPrice\")->second.c_str(),\n                info.find(\"productDesc\")->second.c_str());\n        LOGD(goodInfo);\n        \n        JSContext* cx = s_cx;\n\n        JSBool hasAction;\n        jsval retval;\n        JS::RootedValue temp_retval(cx);\n        jsval dataVal[3];\n        dataVal[0] = INT_TO_JSVAL(ret);\n        std::string strMsgInfo = msg;\n        dataVal[1] = std_string_to_jsval(cx, strMsgInfo);\n        dataVal[2] = TProductInfo_to_jsval(cx, info);\n        \n        JSObject* obj = _JSDelegate;\n        \n        if (JS_HasProperty(cx, obj, \"onPayResult\", &hasAction) && hasAction) {\n            if(!JS_GetProperty(cx, obj, \"onPayResult\", &temp_retval)) {\n                return;\n            }\n            if(temp_retval == JSVAL_VOID) {\n                return;\n            }\n            JSAutoCompartment ac(cx, obj);\n            JS_CallFunctionName(cx, obj, \"onPayResult\",\n                                3, dataVal, &retval);\n        }\n    }\n\n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n    }\n\nprivate:\n    JSObject* _JSDelegate;\n};\n\nJSBool js_pluginx_ProtocolIAP_setResultListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    s_cx = cx;\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n    cocos2d::plugin::ProtocolIAP* cobj = (cocos2d::plugin::ProtocolIAP *)(proxy ? proxy->ptr : NULL);\n    JSBool ok = JS_TRUE;\n\n    if (argc == 1) {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        Pluginx_PurchaseResult* nativeDelegate = new Pluginx_PurchaseResult();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        cobj->setResultListener(nativeDelegate);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nclass Pluginx_AdsListener : public cocos2d::plugin::AdsListener\n{\npublic:\n\n    virtual void onAdsResult(AdsResultCode code, const char* msg)\n    {\n        JSContext* cx = s_cx;\n\n        JSBool hasAction;\n        jsval retval;\n        JS::RootedValue temp_retval(cx);\n        jsval dataVal[2];\n        dataVal[0] = INT_TO_JSVAL(code);\n        std::string strMsgInfo = msg;\n        dataVal[1] = std_string_to_jsval(cx, strMsgInfo);\n        \n        JSObject* obj = _JSDelegate;\n        JSBool bRet = JS_HasProperty(cx, obj, \"onAdsResult\", &hasAction);\n        if (bRet && hasAction) {\n            if(!JS_GetProperty(cx, obj, \"onAdsResult\", &temp_retval)) {\n                return;\n            }\n            if(temp_retval == JSVAL_VOID) {\n                return;\n            }\n            JSAutoCompartment ac(cx, obj);\n            JS_CallFunctionName(cx, obj, \"onAdsResult\",\n                                2, dataVal, &retval);\n        }\n    }\n\n    virtual void onPlayerGetPoints(ProtocolAds* pAdsPlugin, int points)\n    {\n        JSContext* cx = s_cx;\n\n        JSBool hasAction;\n        jsval retval;\n        JS::RootedValue temp_retval(cx);\n\n        js_proxy_t * p;\n        JS_GET_PROXY(p, pAdsPlugin);\n        \n        if (! p) return;\n        jsval dataVal[2];\n        jsval arg = OBJECT_TO_JSVAL(p->obj);\n        dataVal[0] = arg;\n        dataVal[1] = INT_TO_JSVAL(points);\n        \n        JSObject* obj = _JSDelegate;\n        JSBool bRet = JS_HasProperty(cx, obj, \"onPlayerGetPoints\", &hasAction);\n        if (bRet && hasAction) {\n            if(!JS_GetProperty(cx, obj, \"onPlayerGetPoints\", &temp_retval)) {\n                return;\n            }\n            if(temp_retval == JSVAL_VOID) {\n                return;\n            }\n            JSAutoCompartment ac(cx, obj);\n            JS_CallFunctionName(cx, obj, \"onPlayerGetPoints\",\n                                2, NULL, &retval);\n        }\n    }\n\n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n    }\n\nprivate:\n    JSObject* _JSDelegate;\n};\n\nJSBool js_pluginx_ProtocolAds_setAdsListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    s_cx = cx;\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n    cocos2d::plugin::ProtocolAds* cobj = (cocos2d::plugin::ProtocolAds *)(proxy ? proxy->ptr : NULL);\n    JSBool ok = JS_TRUE;\n    if (argc == 1) {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        Pluginx_AdsListener* nativeDelegate = new Pluginx_AdsListener();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        cobj->setAdsListener(nativeDelegate);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nclass Pluginx_ShareResult : public cocos2d::plugin::ShareResultListener\n{\npublic:\n    virtual void onShareResult(cocos2d::plugin::ShareResultCode ret, const char* msg)\n    {\n        JSContext* cx = s_cx;\n\n        JSBool hasAction;\n        jsval retval;\n        JS::RootedValue temp_retval(cx);\n        jsval dataVal[2];\n        dataVal[0] = INT_TO_JSVAL(ret);\n        std::string strMsgInfo = msg;\n        dataVal[1] = std_string_to_jsval(cx, strMsgInfo);\n        \n        JSObject* obj = _JSDelegate;\n        \n        if (JS_HasProperty(cx, obj, \"onShareResult\", &hasAction) && hasAction) {\n            if(!JS_GetProperty(cx, obj, \"onShareResult\", &temp_retval)) {\n                return;\n            }\n            if(temp_retval == JSVAL_VOID) {\n                return;\n            }\n            JSAutoCompartment ac(cx, obj);\n            JS_CallFunctionName(cx, obj, \"onShareResult\",\n                                2, dataVal, &retval);\n        }\n    }\n\n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n    }\n\nprivate:\n    JSObject* _JSDelegate;\n};\n\nJSBool js_pluginx_ProtocolShare_setResultListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    s_cx = cx;\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n    cocos2d::plugin::ProtocolShare* cobj = (cocos2d::plugin::ProtocolShare *)(proxy ? proxy->ptr : NULL);\n    JSBool ok = JS_TRUE;\n\n    if (argc == 1) {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        Pluginx_ShareResult* nativeDelegate = new Pluginx_ShareResult();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        cobj->setResultListener(nativeDelegate);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nclass Pluginx_SocialResult : public cocos2d::plugin::SocialListener\n{\npublic:\n    virtual void onSocialResult(cocos2d::plugin::SocialRetCode ret, const char* msg)\n    {\n        JSContext* cx = s_cx;\n\n        JSBool hasAction;\n        jsval retval;\n        JS::RootedValue temp_retval(cx);\n        jsval dataVal[2];\n        dataVal[0] = INT_TO_JSVAL(ret);\n        std::string strMsgInfo = msg;\n        dataVal[1] = std_string_to_jsval(cx, strMsgInfo);\n        \n        JSObject* obj = _JSDelegate;\n        \n        if (JS_HasProperty(cx, obj, \"onSocialResult\", &hasAction) && hasAction) {\n            if(!JS_GetProperty(cx, obj, \"onSocialResult\", &temp_retval)) {\n                return;\n            }\n            if(temp_retval == JSVAL_VOID) {\n                return;\n            }\n            JSAutoCompartment ac(cx, obj);\n            JS_CallFunctionName(cx, obj, \"onSocialResult\",\n                                2, dataVal, &retval);\n        }\n    }\n\n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n    }\n\nprivate:\n    JSObject* _JSDelegate;\n};\n\nJSBool js_pluginx_ProtocolSocial_setListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    s_cx = cx;\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n    cocos2d::plugin::ProtocolSocial* cobj = (cocos2d::plugin::ProtocolSocial *)(proxy ? proxy->ptr : NULL);\n    JSBool ok = JS_TRUE;\n\n    if (argc == 1) {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        Pluginx_SocialResult* nativeDelegate = new Pluginx_SocialResult();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        cobj->setListener(nativeDelegate);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\nclass Pluginx_UserActionListener : public cocos2d::plugin::UserActionListener\n{\npublic:\n    virtual void onActionResult(ProtocolUser* userPlugin, cocos2d::plugin::UserActionResultCode ret, const char* msg)\n    {\n        JSContext* cx = s_cx;\n\n        JSBool hasAction;\n        jsval retval;\n        JS::RootedValue temp_retval(cx);\n\n        js_proxy_t * p;\n        JS_GET_PROXY(p, userPlugin);\n        \n        if (! p) return;\n        jsval dataVal[3];\n        jsval arg1 = OBJECT_TO_JSVAL(p->obj);\n        dataVal[0] = arg1;\n        dataVal[1] = INT_TO_JSVAL(ret);\n        std::string strMsgInfo = msg;\n        dataVal[2] = std_string_to_jsval(cx, strMsgInfo);\n        \n        JSObject* obj = _JSDelegate;\n        \n        if (JS_HasProperty(cx, obj, \"onActionResult\", &hasAction) && hasAction) {\n            if(!JS_GetProperty(cx, obj, \"onActionResult\", &temp_retval)) {\n                return;\n            }\n            if(temp_retval == JSVAL_VOID) {\n                return;\n            }\n            JSAutoCompartment ac(cx, obj);\n            JS_CallFunctionName(cx, obj, \"onActionResult\",\n                                3, dataVal, &retval);\n        }\n    }\n\n    void setJSDelegate(JSObject* pJSDelegate)\n    {\n        _JSDelegate = pJSDelegate;\n    }\n\nprivate:\n    JSObject* _JSDelegate;\n};\n\nJSBool js_pluginx_ProtocolUser_setActionListener(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    s_cx = cx;\n    jsval *argv = JS_ARGV(cx, vp);\n    JSObject *obj = JS_THIS_OBJECT(cx, vp);\n    js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n    cocos2d::plugin::ProtocolUser* cobj = (cocos2d::plugin::ProtocolUser *)(proxy ? proxy->ptr : NULL);\n    JSBool ok = JS_TRUE;\n\n    if (argc == 1) {\n        // save the delegate\n        JSObject *jsDelegate = JSVAL_TO_OBJECT(argv[0]);\n        Pluginx_UserActionListener* nativeDelegate = new Pluginx_UserActionListener();\n        nativeDelegate->setJSDelegate(jsDelegate);\n        cobj->setActionListener(nativeDelegate);\n        \n        JS_SET_RVAL(cx, vp, JSVAL_VOID);\n        return JS_TRUE;\n    }\n\n    JS_ReportError(cx, \"wrong number of arguments: %d, was expecting %d\", argc, 1);\n    return JS_FALSE;\n}\n\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_manual_callback.h",
    "content": "#ifndef __JS_MANUAL_CALLBACK_H__\n#define __JS_MANUAL_CALLBACK_H__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nJSBool js_pluginx_ProtocolIAP_setResultListener(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_ProtocolAds_setAdsListener(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_ProtocolShare_setResultListener(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_ProtocolSocial_setListener(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_ProtocolUser_setActionListener(JSContext *cx, uint32_t argc, jsval *vp);\n\n#endif /* __JS_MANUAL_CALLBACK_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_manual_protocols.cpp",
    "content": "#include \"jsb_pluginx_manual_protocols.h\"\n#include \"jsb_pluginx_basic_conversions.h\"\n#include \"jsb_pluginx_spidermonkey_specifics.h\"\n#include <string>\n#include <vector>\n#include \"PluginProtocol.h\"\n\nusing namespace pluginx;\n\nJSClass  *jsb_PluginParam_class;\nJSObject *jsb_PluginParam_prototype;\n\nJSBool js_pluginx_protocols_PluginParam_constructor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\tcocos2d::plugin::PluginParam* cobj = NULL;\n\n    do {\n        if (argc == 2) {\n            int arg0;\n            ok &= jsval_to_int32(cx, argv[0], (int32_t *)&arg0);\n            if (!ok) { ok = JS_TRUE; break; }\n\n            switch (arg0)\n            {\n            case cocos2d::plugin::PluginParam::kParamTypeInt:\n                {\n                    int arg1;\n                    ok &= jsval_to_int32(cx, argv[1], (int32_t *)&arg1);\n                    if (ok) { cobj = new cocos2d::plugin::PluginParam(arg1); }\n                }\n                break;\n            case cocos2d::plugin::PluginParam::kParamTypeFloat:\n                {\n                   \tdouble arg1;\n        \t\t\tok &= JS_ValueToNumber(cx, argv[1], &arg1);\n        \t\t\tif (ok) { \n            \t\t\tfloat tempArg = arg1;\n            \t\t\tcobj = new cocos2d::plugin::PluginParam(tempArg);\n                    }\n                }\n                break;\n            case cocos2d::plugin::PluginParam::kParamTypeBool:\n                {\n                    JSBool arg1;\n        \t\t\tok &= JS_ValueToBoolean(cx, argv[1], &arg1);\n        \t\t\tif (ok) { cobj = new cocos2d::plugin::PluginParam(arg1); }\n                }\n                break;\n            case cocos2d::plugin::PluginParam::kParamTypeString:\n                {\n                    const char* arg1;\n        \t\t\tstd::string arg1_tmp; ok &= jsval_to_std_string(cx, argv[1], &arg1_tmp); arg1 = arg1_tmp.c_str();\n        \t\t\tif (ok) { cobj = new cocos2d::plugin::PluginParam(arg1); }\n                }\n                break;\n            case cocos2d::plugin::PluginParam::kParamTypeStringMap:\n                {\n           \t        StringMap arg1;\n            \t\tok &= jsval_to_StringMap(cx, argv[1], &arg1);\n\t\t\t        if (ok) { cobj = new cocos2d::plugin::PluginParam(arg1); }\n                }\n                break;\n            default:\n                break;\n            }\n            if (!ok || NULL == cobj) { ok = JS_TRUE; break; }\n\n            TypeTest<cocos2d::plugin::PluginParam> t;\n\t\t\tjs_type_class_t *typeClass;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tassert(typeMapIter != _js_global_type_map.end());\n            typeClass = typeMapIter->second;\n\t\t\tassert(typeClass);\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJS_NEW_PROXY(proxy, cobj, obj);\n        }\n    } while (0);\n\n\tif (cobj) {\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n\tJS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n\nvoid js_pluginx_protocols_PluginParam_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (PluginParam)\", obj);\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    JS_GET_NATIVE_PROXY(jsproxy, obj);\n    if (jsproxy) {\n        JS_GET_PROXY(nproxy, jsproxy->ptr);\n\n    cocos2d::plugin::PluginParam *nobj = static_cast<cocos2d::plugin::PluginParam *>(nproxy->ptr);\n    if (nobj)\n        delete nobj;\n\n        JS_REMOVE_PROXY(nproxy, jsproxy);\n    }\n}\n\nstatic JSBool js_pluginx_protocols_PluginParam_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    cocos2d::plugin::PluginParam *nobj = new cocos2d::plugin::PluginParam();\n    js_proxy_t* p;\n    JS_NEW_PROXY(p, nobj, obj);\n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n\nvoid js_register_pluginx_protocols_PluginParam(JSContext *cx, JSObject *global) {\n\tjsb_PluginParam_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_PluginParam_class->name = \"PluginParam\";\n\tjsb_PluginParam_class->addProperty = JS_PropertyStub;\n\tjsb_PluginParam_class->delProperty = JS_DeletePropertyStub;\n\tjsb_PluginParam_class->getProperty = JS_PropertyStub;\n\tjsb_PluginParam_class->setProperty = JS_StrictPropertyStub;\n\tjsb_PluginParam_class->enumerate = JS_EnumerateStub;\n\tjsb_PluginParam_class->resolve = JS_ResolveStub;\n\tjsb_PluginParam_class->convert = JS_ConvertStub;\n\tjsb_PluginParam_class->finalize = js_pluginx_protocols_PluginParam_finalize;\n\tjsb_PluginParam_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tJSFunctionSpec *funcs = NULL;\n\n\tJSFunctionSpec *st_funcs = NULL;\n\n\tjsb_PluginParam_prototype = JS_InitClass(\n\t\tcx, global,\n\t\tNULL, // parent proto\n\t\tjsb_PluginParam_class,\n\t\tjs_pluginx_protocols_PluginParam_constructor, 0, // constructor\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"PluginParam\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<cocos2d::plugin::PluginParam> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n    auto typeMapIter = _js_global_type_map.find(typeName);\n    if (typeMapIter == _js_global_type_map.end())\n    {\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_PluginParam_class;\n\t\tp->proto = jsb_PluginParam_prototype;\n\t\tp->parentProto = NULL;\n        _js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\nJSBool js_pluginx_PluginProtocol_callFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n     jsval *argv = JS_ARGV(cx, vp);\n \tif (argc > 0) {\n \t    std::string strName;\n \t    ok &= jsval_to_std_string(cx, argv[0], &strName);\n \t\tstd::vector<cocos2d::plugin::PluginParam*> params;\n \t\tuint32_t i = 1;\n \t\twhile (i < argc) {\n \t\t\tjs_proxy_t *proxy;\n \t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n            if (tmpObj == NULL)\n                break;\n\n \t\t\tJS_GET_NATIVE_PROXY(proxy, tmpObj);\n \t\t\tcocos2d::plugin::PluginParam* item = (cocos2d::plugin::PluginParam*)(proxy ? proxy->ptr : NULL);\n \t\t\tJS_TEST_NATIVE_OBJECT(cx, item)\n \t\t\tparams.push_back(item);\n \t\t\ti++;\n \t\t}\n \n         JSObject *obj = JS_THIS_OBJECT(cx, vp);\n         js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n         cocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n         cobj->callFuncWithParam(strName.c_str(), params);\n \n         JS_SET_RVAL(cx, vp, JSVAL_VOID);\n \t\treturn JS_TRUE;\n \t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_pluginx_PluginProtocol_callStringFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n    jsval *argv = JS_ARGV(cx, vp);\n\tif (argc > 0) {\n\t    std::string strName;\n\t    ok &= jsval_to_std_string(cx, argv[0], &strName);\n\n\t\tstd::vector<cocos2d::plugin::PluginParam*> params;\n\t\tuint32_t i = 1;\n\t\twhile (i < argc) {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n            if (tmpObj == NULL)\n                break;\n\n\t\t\tJS_GET_NATIVE_PROXY(proxy, tmpObj);\n\t\t\tcocos2d::plugin::PluginParam* item = (cocos2d::plugin::PluginParam*)(proxy ? proxy->ptr : NULL);\n\t\t\tJS_TEST_NATIVE_OBJECT(cx, item)\n\t\t\tparams.push_back(item);\n\t\t\ti++;\n\t\t}\n\n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n        js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n        cocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n        std::string ret = cobj->callStringFuncWithParam(strName.c_str(), params);\n\t\tjsval jsret;\n\t\tjsret = std_string_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_pluginx_PluginProtocol_callIntFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n    jsval *argv = JS_ARGV(cx, vp);\n\tif (argc > 0) {\n\t    std::string strName;\n\t    ok &= jsval_to_std_string(cx, argv[0], &strName);\n\n\t\tstd::vector<cocos2d::plugin::PluginParam*> params;\n\t\tuint32_t i = 1;\n\t\twhile (i < argc) {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n            if (tmpObj == NULL)\n                break;\n\n\t\t\tJS_GET_NATIVE_PROXY(proxy, tmpObj);\n\t\t\tcocos2d::plugin::PluginParam* item = (cocos2d::plugin::PluginParam*)(proxy ? proxy->ptr : NULL);\n\t\t\tJS_TEST_NATIVE_OBJECT(cx, item)\n\t\t\tparams.push_back(item);\n\t\t\ti++;\n\t\t}\n\n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n        js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n        cocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n        int ret = cobj->callIntFuncWithParam(strName.c_str(), params);\n\t\tjsval jsret;\n\t\tjsret = int32_to_jsval(cx, ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_pluginx_PluginProtocol_callFloatFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n    jsval *argv = JS_ARGV(cx, vp);\n\tif (argc > 0) {\n\t    std::string strName;\n\t    ok &= jsval_to_std_string(cx, argv[0], &strName);\n\n\t\tstd::vector<cocos2d::plugin::PluginParam*> params;\n\t\tuint32_t i = 1;\n\t\twhile (i < argc) {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n            if (tmpObj == NULL)\n                break;\n\n\t\t\tJS_GET_NATIVE_PROXY(proxy, tmpObj);\n\t\t\tcocos2d::plugin::PluginParam* item = (cocos2d::plugin::PluginParam*)(proxy ? proxy->ptr : NULL);\n\t\t\tJS_TEST_NATIVE_OBJECT(cx, item)\n\t\t\tparams.push_back(item);\n\t\t\ti++;\n\t\t}\n\n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n        js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n        cocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n        float ret = cobj->callFloatFuncWithParam(strName.c_str(), params);\n\t\tjsval jsret;\n\t\tjsret = DOUBLE_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\nJSBool js_pluginx_PluginProtocol_callBoolFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    JSBool ok = JS_TRUE;\n    jsval *argv = JS_ARGV(cx, vp);\n\tif (argc > 0) {\n\t    std::string strName;\n\t    ok &= jsval_to_std_string(cx, argv[0], &strName);\n\n\t\tstd::vector<cocos2d::plugin::PluginParam*> params;\n\t\tuint32_t i = 1;\n\t\twhile (i < argc) {\n\t\t\tjs_proxy_t *proxy;\n\t\t\tJSObject *tmpObj = JSVAL_TO_OBJECT(argv[i]);\n            if (tmpObj == NULL)\n                break;\n\n\t\t\tJS_GET_NATIVE_PROXY(proxy, tmpObj);\n\t\t\tcocos2d::plugin::PluginParam* item = (cocos2d::plugin::PluginParam*)(proxy ? proxy->ptr : NULL);\n\t\t\tJS_TEST_NATIVE_OBJECT(cx, item)\n\t\t\tparams.push_back(item);\n\t\t\ti++;\n\t\t}\n\n        JSObject *obj = JS_THIS_OBJECT(cx, vp);\n        js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj);\n        cocos2d::plugin::PluginProtocol* cobj = (cocos2d::plugin::PluginProtocol *)(proxy ? proxy->ptr : NULL);\n        bool ret = cobj->callBoolFuncWithParam(strName.c_str(), params);\n\t\tjsval jsret;\n\t\tjsret = BOOLEAN_TO_JSVAL(ret);\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\treturn JS_TRUE;\n\t}\n    JS_ReportError(cx, \"wrong number of arguments\");\n\treturn JS_FALSE;\n}\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_manual_protocols.h",
    "content": "#ifndef __JS_MANUAL_PROTOCOLS_H__\n#define __JS_MANUAL_PROTOCOLS_H__\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nextern JSClass  *jsb_PluginParam_class;\nextern JSObject *jsb_PluginParam_prototype;\n\nJSBool js_pluginx_protocols_PluginParam_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_pluginx_protocols_PluginParam_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_pluginx_protocols_PluginParam(JSContext *cx, JSObject *global);\nvoid register_all_pluginx_protocols(JSContext* cx, JSObject* obj);\nJSBool js_pluginx_protocols_PluginParam_PluginParam(JSContext *cx, uint32_t argc, jsval *vp);\n\nJSBool js_pluginx_PluginProtocol_callFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_PluginProtocol_callStringFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_PluginProtocol_callIntFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_PluginProtocol_callFloatFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp);\nJSBool js_pluginx_PluginProtocol_callBoolFuncWithParam(JSContext *cx, uint32_t argc, jsval *vp);\n\n#endif /* __JS_MANUAL_PROTOCOLS_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_spidermonkey_specifics.cpp",
    "content": "#include \"jsb_pluginx_spidermonkey_specifics.h\"\n\nnamespace pluginx {\n\njs_proxy_t *_native_js_global_ht = NULL;\njs_proxy_t *_js_native_global_ht = NULL;\nstd::unordered_map<std::string, js_type_class_t*> _js_global_type_map;\n\nunsigned int getHashCodeByString(const char *key)\n{\n    unsigned int len = strlen(key);\n    const char *end=key+len;\n    unsigned int hash;\n\n    for (hash = 0; key < end; key++)\n    {\n        hash *= 16777619;\n        hash ^= (unsigned int) (unsigned char) toupper(*key);\n    }\n    return (hash);\n}\n\njs_proxy_t* jsb_new_proxy(void* nativeObj, JSObject* jsObj)\n{\n    js_proxy_t* p;\n    JS_NEW_PROXY(p, nativeObj, jsObj);\n    return p;\n}\n\njs_proxy_t* jsb_get_native_proxy(void* nativeObj)\n{\n    js_proxy_t* p;\n    JS_GET_PROXY(p, nativeObj);\n    return p;\n}\n\njs_proxy_t* jsb_get_js_proxy(JSObject* jsObj)\n{\n    js_proxy_t* p;\n    JS_GET_NATIVE_PROXY(p, jsObj);\n    return p;\n}\n\nvoid jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy)\n{\n    JS_REMOVE_PROXY(nativeProxy, jsProxy);\n}\n\n} // namespace pluginx {\n\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/jsb_pluginx_spidermonkey_specifics.h",
    "content": "#ifndef __JS_PLUGINX_SPIDERMONKEY_SPECIFICS_H__\n#define __JS_PLUGINX_SPIDERMONKEY_SPECIFICS_H__\n\n#include <typeinfo>\n#include <ctype.h>\n#include <string.h>\n#include <assert.h>\n\n#include \"jsapi.h\"\n#include \"uthash.h\"\n#include <unordered_map>\n\n#ifdef ANDROID\n#include <android/log.h>\n#endif\n\n#ifndef CCASSERT\n#define CCASSERT(a,b) assert(a)\n#endif\n\n#define PLUGINX_JSB_DEBUG 0\n\nnamespace pluginx {\n\n#if PLUGINX_JSB_DEBUG\n#ifdef ANDROID\n    #define  LOG_TAG    \"jsb_pluginx\"\n    #define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n    #else\n    #define  LOGD(...) printf(__VA_ARGS__)\n    #endif\n#else\n    #define  LOGD(...)       do {} while (0)\n#endif\n\n#define JSB_PRECONDITION( condition, ...) do {\t\t\t\t\t\t\t\\\n\tif( ! (condition) ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n        LOGD(\"jsb: ERROR: File %s: Line: %d, Function: %s\", __FILE__, __LINE__, __FUNCTION__ );\t\t\t\\\n        LOGD(__VA_ARGS__);                                        \\\n\t\tJSContext* globalContext = ScriptingCore::getInstance()->getGlobalContext();\t\\\n\t\tif( ! JS_IsExceptionPending( globalContext ) ) {\t\t\t\t\t\t\\\n\t\t\tJS_ReportError( globalContext, __VA_ARGS__ );\t\t\t\t\t\t\t\\\n\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\treturn JS_FALSE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n} while(0)\n\n#define JSB_PRECONDITION2( condition, context, ret_value, ...) do {             \\\n    if( ! (condition) ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n        LOGD(\"jsb: ERROR: File %s: Line: %d, Function: %s\", __FILE__, __LINE__, __FUNCTION__ );\t\t\t\\\n        LOGD(__VA_ARGS__);                                        \\\n        if( ! JS_IsExceptionPending( context ) ) {\t\t\t\t\t\t\t\\\n            JS_ReportError( context, __VA_ARGS__ );\t\t\t\t\t\t\t\t\\\n        }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n        return ret_value;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n    }                                                                           \\\n} while(0)\n\n\ntypedef struct js_proxy {\n\tvoid *ptr;\n\tJSObject *obj;\n\tUT_hash_handle hh;\n} js_proxy_t;\n\nextern js_proxy_t *_native_js_global_ht;\nextern js_proxy_t *_js_native_global_ht;\n\ntypedef struct js_type_class {\n\tJSClass *jsclass;\n\tJSObject *proto;\n\tJSObject *parentProto;\n} js_type_class_t;\n\nextern std::unordered_map<std::string, js_type_class_t*> _js_global_type_map;\n\nunsigned int getHashCodeByString(const char *key);\n\ntemplate< typename DERIVED >\nclass TypeTest\n{\npublic:\n\n\tstatic int s_id()\n\t{\n\t\t// return id unique for DERIVED\n\t\t// NOT SURE IT WILL BE REALLY UNIQUE FOR EACH CLASS!!\n\t\t/* Commented by James Chen\n\t\tUsing 'getHashCodeByString(typeid(*native_obj).name())' instead of 'reinterpret_cast<long>(typeid(*native_obj).name());'.\n\t\tSince on win32 platform, 'reinterpret_cast<long>(typeid(*native_obj).name());' invoking in cocos2d.dll and outside cocos2d.dll(in TestJavascript.exe) will return different address.\n\t\tBut the return string from typeid(*native_obj).name() is the same string, so we must convert the string to hash id to make sure we can get unique id.\n\t\t*/\n\t\t// static const long id = reinterpret_cast<long>(typeid( DERIVED ).name());\n        static const long id = getHashCodeByString(typeid( DERIVED ).name());\n\t\treturn id;\n\t}\n\n\tstatic const char* s_name()\n\t{\n\t\t// return id unique for DERIVED\n\t\t// ALWAYS VALID BUT STRING, NOT INT - BUT VALID AND CROSS-PLATFORM/CROSS-VERSION COMPATBLE\n\t\t// AS FAR AS YOU KEEP THE CLASS NAME\n\t\treturn typeid( DERIVED ).name();\n\t}\n};\n\n\n#define JS_NEW_PROXY(p, native_obj, js_obj) \\\ndo { \\\n\tp = (js_proxy_t *)malloc(sizeof(js_proxy_t)); \\\n\tassert(p); \\\n    js_proxy_t* native_obj##js_obj##tmp = NULL; \\\n    HASH_FIND_PTR(_native_js_global_ht, &native_obj, native_obj##js_obj##tmp); \\\n    assert(!native_obj##js_obj##tmp); \\\n\tp->ptr = native_obj; \\\n\tp->obj = js_obj; \\\n\tHASH_ADD_PTR(_native_js_global_ht, ptr, p); \\\n\tp = (js_proxy_t *)malloc(sizeof(js_proxy_t)); \\\n\tassert(p); \\\n    native_obj##js_obj##tmp = NULL; \\\n    HASH_FIND_PTR(_js_native_global_ht, &js_obj, native_obj##js_obj##tmp); \\\n    assert(!native_obj##js_obj##tmp); \\\n\tp->ptr = native_obj; \\\n\tp->obj = js_obj; \\\n\tHASH_ADD_PTR(_js_native_global_ht, obj, p); \\\n} while(0) \\\n\n#define JS_GET_PROXY(p, native_obj) \\\ndo { \\\n\tHASH_FIND_PTR(_native_js_global_ht, &native_obj, p); \\\n} while (0)\n\n#define JS_GET_NATIVE_PROXY(p, js_obj) \\\ndo { \\\n\tHASH_FIND_PTR(_js_native_global_ht, &js_obj, p); \\\n} while (0)\n\n#define JS_REMOVE_PROXY(nproxy, jsproxy) \\\ndo { \\\n\tif (nproxy) { HASH_DEL(_native_js_global_ht, nproxy); free(nproxy); } \\\n\tif (jsproxy) { HASH_DEL(_js_native_global_ht, jsproxy); free(jsproxy); } \\\n} while (0)\n\n#define JS_TEST_NATIVE_OBJECT(cx, native_obj) \\\nif (!native_obj) { \\\n\tJS_ReportError(cx, \"Invalid Native Object\"); \\\n\treturn JS_FALSE; \\\n}\n\njs_proxy_t* jsb_new_proxy(void* nativeObj, JSObject* jsObj);\njs_proxy_t* jsb_get_native_proxy(void* nativeObj);\njs_proxy_t* jsb_get_js_proxy(JSObject* jsObj);\nvoid jsb_remove_proxy(js_proxy_t* nativeProxy, js_proxy_t* jsProxy);\n\n/**\n * You don't need to manage the returned pointer. They live for the whole life of\n * the app.\n */\ntemplate <class T>\ninline js_type_class_t *js_get_type_from_native(T* native_obj) {\n    bool found = false;\n    std::string typeName = typeid(*native_obj).name();\n    auto typeProxyIter = _js_global_type_map.find(typeName);\n    if (typeProxyIter == _js_global_type_map.end())\n    {\n        typeName = typeid(T).name();\n        typeProxyIter = _js_global_type_map.find(typeName);\n        if (typeProxyIter != _js_global_type_map.end())\n        {\n            found = true;\n        }\n    }\n    else\n    {\n        found = true;\n    }\n    return found ? typeProxyIter->second : nullptr;\n}\n\n/**\n * The returned pointer should be deleted using JS_REMOVE_PROXY. Most of the\n * time you do that in the C++ destructor.\n */\ntemplate<class T>\ninline js_proxy_t *js_get_or_create_proxy(JSContext *cx, T *native_obj) {\n    js_proxy_t *proxy;\n    HASH_FIND_PTR(_native_js_global_ht, &native_obj, proxy);\n    if (!proxy) {\n        js_type_class_t *typeProxy = js_get_type_from_native<T>(native_obj);\n        assert(typeProxy);\n        JSObject* js_obj = JS_NewObject(cx, typeProxy->jsclass, typeProxy->proto, typeProxy->parentProto);\n        JS_NEW_PROXY(proxy, native_obj, js_obj);\n//#ifdef COCOS2D_JAVASCRIPT\n// #ifdef DEBUG\n//         JS_AddNamedObjectRoot(cx, &proxy->obj, typeid(*native_obj).name());\n// #else\n//         JS_AddObjectRoot(cx, &proxy->obj);\n// #endif\n//#endif\n        return proxy;\n    } else {\n        return proxy;\n    }\n    return NULL;\n}\n\n\n} // namespace pluginx {\n\n#endif /* __JS_PLUGINX_SPIDERMONKEY_SPECIFICS_H__ */\n\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/pluginxUTF8.cpp",
    "content": "/* \n * This file uses some implementations of gutf8.c in glib.\n *\n * gutf8.c - Operations on UTF-8 strings.\n *\n * Copyright (C) 1999 Tom Tromey\n * Copyright (C) 2000 Red Hat, Inc.\n *\n * This library is free software; you can redistribute it and/or\n * modify it under the terms of the GNU Lesser General Public\n * License as published by the Free Software Foundation; either\n * version 2 of the License, or (at your option) any later version.\n *\n * This library is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\t See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this library; if not, write to the\n * Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n * Boston, MA 02111-1307, USA.\n */\n\n#include \"pluginxUTF8.h\"\n\nnamespace pluginx {\n\n#define CCLOGERROR(...)  do {} while(0)\n\n#ifndef NULL\n#define NULL 0\n#endif\n\nint cc_wcslen(const unsigned short* str)\n{\n    int i=0;\n    while(*str++) i++;\n    return i;\n}\n\n/* Code from GLIB gutf8.c starts here. */\n\n#define UTF8_COMPUTE(Char, Mask, Len)        \\\nif (Char < 128)                \\\n{                        \\\nLen = 1;                    \\\nMask = 0x7f;                \\\n}                        \\\nelse if ((Char & 0xe0) == 0xc0)        \\\n{                        \\\nLen = 2;                    \\\nMask = 0x1f;                \\\n}                        \\\nelse if ((Char & 0xf0) == 0xe0)        \\\n{                        \\\nLen = 3;                    \\\nMask = 0x0f;                \\\n}                        \\\nelse if ((Char & 0xf8) == 0xf0)        \\\n{                        \\\nLen = 4;                    \\\nMask = 0x07;                \\\n}                        \\\nelse if ((Char & 0xfc) == 0xf8)        \\\n{                        \\\nLen = 5;                    \\\nMask = 0x03;                \\\n}                        \\\nelse if ((Char & 0xfe) == 0xfc)        \\\n{                        \\\nLen = 6;                    \\\nMask = 0x01;                \\\n}                        \\\nelse                        \\\nLen = -1;\n\n#define UTF8_LENGTH(Char)            \\\n((Char) < 0x80 ? 1 :                \\\n((Char) < 0x800 ? 2 :            \\\n((Char) < 0x10000 ? 3 :            \\\n((Char) < 0x200000 ? 4 :            \\\n((Char) < 0x4000000 ? 5 : 6)))))\n\n\n#define UTF8_GET(Result, Chars, Count, Mask, Len)    \\\n(Result) = (Chars)[0] & (Mask);            \\\nfor ((Count) = 1; (Count) < (Len); ++(Count))        \\\n{                            \\\nif (((Chars)[(Count)] & 0xc0) != 0x80)        \\\n{                        \\\n(Result) = -1;                \\\nbreak;                    \\\n}                        \\\n(Result) <<= 6;                    \\\n(Result) |= ((Chars)[(Count)] & 0x3f);        \\\n}\n\n#define UNICODE_VALID(Char)            \\\n((Char) < 0x110000 &&                \\\n(((Char) & 0xFFFFF800) != 0xD800) &&        \\\n((Char) < 0xFDD0 || (Char) > 0xFDEF) &&    \\\n((Char) & 0xFFFE) != 0xFFFE)\n\n\nstatic const char utf8_skip_data[256] = {\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n    1, 1, 1, 1, 1, 1, 1,\n    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n    2, 2, 2, 2, 2, 2, 2,\n    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,\n    5, 5, 5, 6, 6, 1, 1\n};\n\nstatic const char *const g_utf8_skip = utf8_skip_data;\n\n#define cc_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(unsigned char *)(p)])\n\n/*\n * @str:    the string to search through.\n * @c:        the character to find.\n *\n * Returns the index of the first occurrence of the character, if found.  Otherwise -1 is returned.\n *\n * Return value: the index of the first occurrence of the character if found or -1 otherwise.\n * */\nstatic unsigned int cc_utf8_find_char(std::vector<unsigned short> str, unsigned short c)\n{\n    unsigned int len = str.size();\n    \n    for (unsigned int i = 0; i < len; ++i)\n        if (str[i] == c) return i;\n    \n    return -1;\n}\n\n/*\n * @str:    the string to search through.\n * @c:        the character to not look for.\n *\n * Return value: the index of the last character that is not c.\n * */\nunsigned int cc_utf8_find_last_not_char(std::vector<unsigned short> str, unsigned short c)\n{\n    int len = str.size();\n    \n    int i = len - 1;\n    for (; i >= 0; --i)\n        if (str[i] != c) return i;\n    \n    return i;\n}\n\n/*\n * @str:    the string to trim\n * @index:    the index to start trimming from.\n *\n * Trims str st str=[0, index) after the operation.\n *\n * Return value: the trimmed string.\n * */\nstatic void cc_utf8_trim_from(std::vector<unsigned short>* str, int index)\n{\n    int size = str->size();\n    if (index >= size || index < 0)\n        return;\n    \n    str->erase(str->begin() + index, str->begin() + size);\n}\n\n/*\n * @ch is the unicode character whitespace?\n *\n * Reference: http://en.wikipedia.org/wiki/Whitespace_character#Unicode\n *\n * Return value: weather the character is a whitespace character.\n * */\nbool isspace_unicode(unsigned short ch)\n{\n    return  (ch >= 0x0009 && ch <= 0x000D) || ch == 0x0020 || ch == 0x0085 || ch == 0x00A0 || ch == 0x1680\n    || (ch >= 0x2000 && ch <= 0x200A) || ch == 0x2028 || ch == 0x2029 || ch == 0x202F\n    ||  ch == 0x205F || ch == 0x3000;\n}\n\nvoid cc_utf8_trim_ws(std::vector<unsigned short>* str)\n{\n    int len = str->size();\n    \n    if ( len <= 0 )\n        return;\n    \n    int last_index = len - 1;\n    \n    // Only start trimming if the last character is whitespace..\n    if (isspace_unicode((*str)[last_index]))\n    {\n        for (int i = last_index - 1; i >= 0; --i)\n        {\n            if (isspace_unicode((*str)[i]))\n                last_index = i;\n            else\n                break;\n        }\n        \n        cc_utf8_trim_from(str, last_index);\n    }\n}\n\n/*\n * cc_utf8_strlen:\n * @p: pointer to the start of a UTF-8 encoded string.\n * @max: the maximum number of bytes to examine. If @max\n *       is less than 0, then the string is assumed to be\n *       null-terminated. If @max is 0, @p will not be examined and\n *       may be %NULL.\n *\n * Returns the length of the string in characters.\n *\n * Return value: the length of the string in characters\n **/\nlong\ncc_utf8_strlen (const char * p, int max)\n{\n    long len = 0;\n    const char *start = p;\n    \n    if (!(p != NULL || max == 0))\n    {\n        return 0;\n    }\n    \n    if (max < 0)\n    {\n        while (*p)\n        {\n            p = cc_utf8_next_char (p);\n            ++len;\n        }\n    }\n    else\n    {\n        if (max == 0 || !*p)\n            return 0;\n        \n        p = cc_utf8_next_char (p);\n        \n        while (p - start < max && *p)\n        {\n            ++len;\n            p = cc_utf8_next_char (p);\n        }\n        \n        /* only do the last len increment if we got a complete\n         * char (don't count partial chars)\n         */\n        if (p - start == max)\n            ++len;\n    }\n    \n    return len;\n}\n\n/*\n * g_utf8_get_char:\n * @p: a pointer to Unicode character encoded as UTF-8\n *\n * Converts a sequence of bytes encoded as UTF-8 to a Unicode character.\n * If @p does not point to a valid UTF-8 encoded character, results are\n * undefined. If you are not sure that the bytes are complete\n * valid Unicode characters, you should use g_utf8_get_char_validated()\n * instead.\n *\n * Return value: the resulting character\n **/\nstatic unsigned int\ncc_utf8_get_char (const char * p)\n{\n    int i, mask = 0, len;\n    unsigned int result;\n    unsigned char c = (unsigned char) *p;\n    \n    UTF8_COMPUTE (c, mask, len);\n    if (len == -1)\n        return (unsigned int) - 1;\n    UTF8_GET (result, p, i, mask, len);\n    \n    return result;\n}\n\n\nunsigned short* cc_utf8_to_utf16(const char* str_old, int length/* = -1 */, int* rUtf16Size/* = NULL */)\n{\n    int len = cc_utf8_strlen(str_old, length);\n    if (rUtf16Size != NULL) {\n        *rUtf16Size = len;\n    }\n    \n    unsigned short* str_new = new unsigned short[len + 1];\n    str_new[len] = 0;\n    \n    for (int i = 0; i < len; ++i)\n    {\n        str_new[i] = cc_utf8_get_char(str_old);\n        str_old = cc_utf8_next_char(str_old);\n    }\n    \n    return str_new;\n}\n\nstd::vector<unsigned short> cc_utf16_vec_from_utf16_str(const unsigned short* str)\n{\n    int len = cc_wcslen(str);\n    std::vector<unsigned short> str_new;\n    \n    for (int i = 0; i < len; ++i)\n    {\n        str_new.push_back(str[i]);\n    }\n    return str_new;\n}\n\n/**\n * cc_unichar_to_utf8:\n * @c: a ISO10646 character code\n * @outbuf: output buffer, must have at least 6 bytes of space.\n *       If %NULL, the length will be computed and returned\n *       and nothing will be written to @outbuf.\n *\n * Converts a single character to UTF-8.\n *\n * Return value: number of bytes written\n **/\nint\ncc_unichar_to_utf8 (unsigned short c,\n                   char   *outbuf)\n{\n    unsigned int len = 0;\n    int first;\n    int i;\n    \n    if (c < 0x80)\n    {\n        first = 0;\n        len = 1;\n    }\n    else if (c < 0x800)\n    {\n        first = 0xc0;\n        len = 2;\n    }\n    else if (c < 0x10000)\n    {\n        first = 0xe0;\n        len = 3;\n    }\n    else if (c < 0x200000)\n    {\n        first = 0xf0;\n        len = 4;\n    }\n    else if (c < 0x4000000)\n    {\n        first = 0xf8;\n        len = 5;\n    }\n    else\n    {\n        first = 0xfc;\n        len = 6;\n    }\n    \n    if (outbuf)\n    {\n        for (i = len - 1; i > 0; --i)\n        {\n            outbuf[i] = (c & 0x3f) | 0x80;\n            c >>= 6;\n        }\n        outbuf[0] = c | first;\n    }\n    \n    return len;\n}\n\n#define SURROGATE_VALUE(h,l) (((h) - 0xd800) * 0x400 + (l) - 0xdc00 + 0x10000)\n\n/**\n * cc_utf16_to_utf8:\n * @str: a UTF-16 encoded string\n * @len: the maximum length of @str to use. If @len < 0, then\n *       the string is terminated with a 0 character.\n * @items_read: location to store number of words read, or %NULL.\n *              If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be\n *              returned in case @str contains a trailing partial\n *              character. If an error occurs then the index of the\n *              invalid input is stored here.\n * @items_written: location to store number of bytes written, or %NULL.\n *                 The value stored here does not include the trailing\n *                 0 byte.\n * @error: location to store the error occuring, or %NULL to ignore\n *         errors. Any of the errors in #GConvertError other than\n *         %G_CONVERT_ERROR_NO_CONVERSION may occur.\n *\n * Convert a string from UTF-16 to UTF-8. The result will be\n * terminated with a 0 byte.\n *\n * Return value: a pointer to a newly allocated UTF-8 string.\n *               This value must be freed with free(). If an\n *               error occurs, %NULL will be returned and\n *               @error set.\n **/\nchar *\ncc_utf16_to_utf8 (const unsigned short  *str,\n                 long             len,\n                 long            *items_read,\n                 long            *items_written)\n{\n    /* This function and g_utf16_to_ucs4 are almost exactly identical - The lines that differ\n     * are marked.\n     */\n    const unsigned short *in;\n    char *out;\n    char *result = NULL;\n    int n_bytes;\n    unsigned short high_surrogate;\n    \n    if (str == 0) return NULL;\n    \n    n_bytes = 0;\n    in = str;\n    high_surrogate = 0;\n    while ((len < 0 || in - str < len) && *in)\n    {\n        unsigned short c = *in;\n        unsigned short wc;\n        \n        if (c >= 0xdc00 && c < 0xe000) /* low surrogate */\n        {\n            if (high_surrogate)\n            {\n                wc = SURROGATE_VALUE (high_surrogate, c);\n                high_surrogate = 0;\n            }\n            else\n            {\n                CCLOGERROR(\"Invalid sequence in conversion input\");\n                goto err_out;\n            }\n        }\n        else\n        {\n            if (high_surrogate)\n            {\n                CCLOGERROR(\"Invalid sequence in conversion input\");\n                goto err_out;\n            }\n            \n            if (c >= 0xd800 && c < 0xdc00) /* high surrogate */\n            {\n                high_surrogate = c;\n                goto next1;\n            }\n            else\n                wc = c;\n        }\n        \n        /********** DIFFERENT for UTF8/UCS4 **********/\n        n_bytes += UTF8_LENGTH (wc);\n        \n    next1:\n        in++;\n    }\n    \n    if (high_surrogate && !items_read)\n    {        \n        CCLOGERROR(\"Partial character sequence at end of input\");\n        goto err_out;\n    }\n    \n    /* At this point, everything is valid, and we just need to convert\n     */\n    /********** DIFFERENT for UTF8/UCS4 **********/\n    result = new char[n_bytes + 1];\n    \n    high_surrogate = 0;\n    out = result;\n    in = str;\n    while (out < result + n_bytes)\n    {\n        unsigned short c = *in;\n        unsigned short wc;\n        \n        if (c >= 0xdc00 && c < 0xe000) /* low surrogate */\n        {\n            wc = SURROGATE_VALUE (high_surrogate, c);\n            high_surrogate = 0;\n        }\n        else if (c >= 0xd800 && c < 0xdc00) /* high surrogate */\n        {\n            high_surrogate = c;\n            goto next2;\n        }\n        else\n            wc = c;\n        \n        /********** DIFFERENT for UTF8/UCS4 **********/\n        out += cc_unichar_to_utf8 (wc, out);\n        \n    next2:\n        in++;\n    }\n    \n    /********** DIFFERENT for UTF8/UCS4 **********/\n    *out = '\\0';\n    \n    if (items_written)\n    /********** DIFFERENT for UTF8/UCS4 **********/\n        *items_written = out - result;\n    \nerr_out:\n    if (items_read)\n        *items_read = in - str;\n    \n    return result;\n}\n\n}// namespace pluginx {\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/pluginxUTF8.h",
    "content": "//\n//  ccUTF8.h\n//  cocos2dx\n//\n//  Created by James Chen on 2/27/13.\n//\n\n#ifndef __pluginx__ccUTF8__\n#define __pluginx__ccUTF8__\n\n#include <vector>\n\nnamespace pluginx {\n\nint cc_wcslen(const unsigned short* str);\n\nvoid cc_utf8_trim_ws(std::vector<unsigned short>* str);\n\n/*\n * @ch is the unicode character whitespace?\n *\n * Reference: http://en.wikipedia.org/wiki/Whitespace_character#Unicode\n *\n * Return value: weather the character is a whitespace character.\n * */\nbool isspace_unicode(unsigned short ch);\n\n/*\n * cc_utf8_strlen:\n * @p: pointer to the start of a UTF-8 encoded string.\n * @max: the maximum number of bytes to examine. If @max\n *       is less than 0, then the string is assumed to be\n *       null-terminated. If @max is 0, @p will not be examined and\n *       may be %NULL.\n *\n * Returns the length of the string in characters.\n *\n * Return value: the length of the string in characters\n **/\nlong\ncc_utf8_strlen (const char * p, int max);\n\n/*\n * @str:    the string to search through.\n * @c:        the character to not look for.\n *\n * Return value: the index of the last character that is not c.\n * */\nunsigned int cc_utf8_find_last_not_char(std::vector<unsigned short> str, unsigned short c);\n\nstd::vector<unsigned short> cc_utf16_vec_from_utf16_str(const unsigned short* str);\n\n/*\n * cc_utf8_to_utf16:\n * @str_old: pointer to the start of a C string.\n *\n * Creates a utf8 string from a cstring.\n *\n * Return value: the newly created utf8 string.\n * */\nunsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, int* rUtf16Size = 0);\n\n/**\n * cc_utf16_to_utf8:\n * @str: a UTF-16 encoded string\n * @len: the maximum length of @str to use. If @len < 0, then\n *       the string is terminated with a 0 character.\n * @items_read: location to store number of words read, or %NULL.\n *              If %NULL, then %G_CONVERT_ERROR_PARTIAL_INPUT will be\n *              returned in case @str contains a trailing partial\n *              character. If an error occurs then the index of the\n *              invalid input is stored here.\n * @items_written: location to store number of bytes written, or %NULL.\n *                 The value stored here does not include the trailing\n *                 0 byte.\n * @error: location to store the error occuring, or %NULL to ignore\n *         errors. Any of the errors in #GConvertError other than\n *         %G_CONVERT_ERROR_NO_CONVERSION may occur.\n *\n * Convert a string from UTF-16 to UTF-8. The result will be\n * terminated with a 0 byte.\n *\n * Return value: a pointer to a newly allocated UTF-8 string.\n *               This value must be freed with free(). If an\n *               error occurs, %NULL will be returned and\n *               @error set.\n **/\nchar *\ncc_utf16_to_utf8 (const unsigned short  *str,\n                  long             len,\n                  long            *items_read,\n                  long            *items_written);\n\n} // namespace pluginx {\n\n#endif /* defined(__cocos2dx__ccUTF8__) */\n"
  },
  {
    "path": "cocos2d/plugin/jsbindings/manual/uthash.h",
    "content": "/*\nCopyright (c) 2003-2013, Troy D. Hanson     http://troydhanson.github.com/uthash/\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef UTHASH_H\n#define UTHASH_H \n\n#include <string.h>   /* memcmp,strlen */\n#include <stddef.h>   /* ptrdiff_t */\n#include <stdlib.h>   /* exit() */\n\n/* These macros use decltype or the earlier __typeof GNU extension.\n   As decltype is only available in newer compilers (VS2010 or gcc 4.3+\n   when compiling c++ source) this code uses whatever method is needed\n   or, for VS2008 where neither is available, uses casting workarounds. */\n#ifdef _MSC_VER         /* MS compiler */\n#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */\n#define DECLTYPE(x) (decltype(x))\n#else                   /* VS2008 or older (or VS2010 in C mode) */\n#define NO_DECLTYPE\n#define DECLTYPE(x)\n#endif\n#else                   /* GNU, Sun and other compilers */\n#define DECLTYPE(x) (__typeof(x))\n#endif\n\n#ifdef NO_DECLTYPE\n#define DECLTYPE_ASSIGN(dst,src)                                                 \\\ndo {                                                                             \\\n  char **_da_dst = (char**)(&(dst));                                             \\\n  *_da_dst = (char*)(src);                                                       \\\n} while(0)\n#else \n#define DECLTYPE_ASSIGN(dst,src)                                                 \\\ndo {                                                                             \\\n  (dst) = DECLTYPE(dst)(src);                                                    \\\n} while(0)\n#endif\n\n/* a number of the hash function use uint32_t which isn't defined on win32 */\n#ifdef _MSC_VER\ntypedef unsigned int uint32_t;\ntypedef unsigned char uint8_t;\n#else\n#include <inttypes.h>   /* uint32_t */\n#endif\n\n#define UTHASH_VERSION 1.9.8\n\n#ifndef uthash_fatal\n#define uthash_fatal(msg) exit(-1)        /* fatal error (out of memory,etc) */\n#endif\n#ifndef uthash_malloc\n#define uthash_malloc(sz) malloc(sz)      /* malloc fcn                      */\n#endif\n#ifndef uthash_free\n#define uthash_free(ptr,sz) free(ptr)     /* free fcn                        */\n#endif\n\n#ifndef uthash_noexpand_fyi\n#define uthash_noexpand_fyi(tbl)          /* can be defined to log noexpand  */\n#endif\n#ifndef uthash_expand_fyi\n#define uthash_expand_fyi(tbl)            /* can be defined to log expands   */\n#endif\n\n/* initial number of buckets */\n#define HASH_INITIAL_NUM_BUCKETS 32      /* initial number of buckets        */\n#define HASH_INITIAL_NUM_BUCKETS_LOG2 5  /* lg2 of initial number of buckets */\n#define HASH_BKT_CAPACITY_THRESH 10      /* expand when bucket count reaches */\n\n/* calculate the element whose hash handle address is hhe */\n#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))\n\n#define HASH_FIND(hh,head,keyptr,keylen,out)                                     \\\ndo {                                                                             \\\n  unsigned _hf_bkt,_hf_hashv;                                                    \\\n  out=NULL;                                                                      \\\n  if (head) {                                                                    \\\n     HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \\\n     if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) {                           \\\n       HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ],  \\\n                        keyptr,keylen,out);                                      \\\n     }                                                                           \\\n  }                                                                              \\\n} while (0)\n\n#ifdef HASH_BLOOM\n#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM)\n#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0)\n#define HASH_BLOOM_MAKE(tbl)                                                     \\\ndo {                                                                             \\\n  (tbl)->bloom_nbits = HASH_BLOOM;                                               \\\n  (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN);                 \\\n  if (!((tbl)->bloom_bv))  { uthash_fatal( \"out of memory\"); }                   \\\n  memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN);                                \\\n  (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE;                                       \\\n} while (0) \n\n#define HASH_BLOOM_FREE(tbl)                                                     \\\ndo {                                                                             \\\n  uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN);                              \\\n} while (0) \n\n#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8)))\n#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8)))\n\n#define HASH_BLOOM_ADD(tbl,hashv)                                                \\\n  HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))\n\n#define HASH_BLOOM_TEST(tbl,hashv)                                               \\\n  HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1)))\n\n#else\n#define HASH_BLOOM_MAKE(tbl) \n#define HASH_BLOOM_FREE(tbl) \n#define HASH_BLOOM_ADD(tbl,hashv) \n#define HASH_BLOOM_TEST(tbl,hashv) (1)\n#define HASH_BLOOM_BYTELEN 0\n#endif\n\n#define HASH_MAKE_TABLE(hh,head)                                                 \\\ndo {                                                                             \\\n  (head)->hh.tbl = (UT_hash_table*)uthash_malloc(                                \\\n                  sizeof(UT_hash_table));                                        \\\n  if (!((head)->hh.tbl))  { uthash_fatal( \"out of memory\"); }                    \\\n  memset((head)->hh.tbl, 0, sizeof(UT_hash_table));                              \\\n  (head)->hh.tbl->tail = &((head)->hh);                                          \\\n  (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS;                        \\\n  (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2;              \\\n  (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head);                    \\\n  (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc(                      \\\n          HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \\\n  if (! (head)->hh.tbl->buckets) { uthash_fatal( \"out of memory\"); }             \\\n  memset((head)->hh.tbl->buckets, 0,                                             \\\n          HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \\\n  HASH_BLOOM_MAKE((head)->hh.tbl);                                               \\\n  (head)->hh.tbl->signature = HASH_SIGNATURE;                                    \\\n} while(0)\n\n#define HASH_ADD(hh,head,fieldname,keylen_in,add)                                \\\n        HASH_ADD_KEYPTR(hh,head,&((add)->fieldname),keylen_in,add)\n\n#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced)                   \\\ndo {                                                                             \\\n  replaced=NULL;                                                                 \\\n  HASH_FIND(hh,head,&((add)->fieldname),keylen_in,replaced);                     \\\n  if (replaced!=NULL) {                                                          \\\n     HASH_DELETE(hh,head,replaced);                                              \\\n  };                                                                             \\\n  HASH_ADD(hh,head,fieldname,keylen_in,add);                                     \\\n} while(0)\n \n#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)                            \\\ndo {                                                                             \\\n unsigned _ha_bkt;                                                               \\\n (add)->hh.next = NULL;                                                          \\\n (add)->hh.key = (char*)keyptr;                                                  \\\n (add)->hh.keylen = (unsigned)keylen_in;                                                   \\\n if (!(head)) {                                                                  \\\n    head = (add);                                                                \\\n    (head)->hh.prev = NULL;                                                      \\\n    HASH_MAKE_TABLE(hh,head);                                                    \\\n } else {                                                                        \\\n    (head)->hh.tbl->tail->next = (add);                                          \\\n    (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail);         \\\n    (head)->hh.tbl->tail = &((add)->hh);                                         \\\n }                                                                               \\\n (head)->hh.tbl->num_items++;                                                    \\\n (add)->hh.tbl = (head)->hh.tbl;                                                 \\\n HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets,                         \\\n         (add)->hh.hashv, _ha_bkt);                                              \\\n HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh);                   \\\n HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv);                                 \\\n HASH_EMIT_KEY(hh,head,keyptr,keylen_in);                                        \\\n HASH_FSCK(hh,head);                                                             \\\n} while(0)\n\n#define HASH_TO_BKT( hashv, num_bkts, bkt )                                      \\\ndo {                                                                             \\\n  bkt = ((hashv) & ((num_bkts) - 1));                                            \\\n} while(0)\n\n/* delete \"delptr\" from the hash table.\n * \"the usual\" patch-up process for the app-order doubly-linked-list.\n * The use of _hd_hh_del below deserves special explanation.\n * These used to be expressed using (delptr) but that led to a bug\n * if someone used the same symbol for the head and deletee, like\n *  HASH_DELETE(hh,users,users);\n * We want that to work, but by changing the head (users) below\n * we were forfeiting our ability to further refer to the deletee (users)\n * in the patch-up process. Solution: use scratch space to\n * copy the deletee pointer, then the latter references are via that\n * scratch pointer rather than through the repointed (users) symbol.\n */\n#define HASH_DELETE(hh,head,delptr)                                              \\\ndo {                                                                             \\\n    unsigned _hd_bkt;                                                            \\\n    struct UT_hash_handle *_hd_hh_del;                                           \\\n    if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) )  {         \\\n        uthash_free((head)->hh.tbl->buckets,                                     \\\n                    (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \\\n        HASH_BLOOM_FREE((head)->hh.tbl);                                         \\\n        uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                      \\\n        head = NULL;                                                             \\\n    } else {                                                                     \\\n        _hd_hh_del = &((delptr)->hh);                                            \\\n        if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) {     \\\n            (head)->hh.tbl->tail =                                               \\\n                (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) +               \\\n                (head)->hh.tbl->hho);                                            \\\n        }                                                                        \\\n        if ((delptr)->hh.prev) {                                                 \\\n            ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) +                  \\\n                    (head)->hh.tbl->hho))->next = (delptr)->hh.next;             \\\n        } else {                                                                 \\\n            DECLTYPE_ASSIGN(head,(delptr)->hh.next);                             \\\n        }                                                                        \\\n        if (_hd_hh_del->next) {                                                  \\\n            ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next +                     \\\n                    (head)->hh.tbl->hho))->prev =                                \\\n                    _hd_hh_del->prev;                                            \\\n        }                                                                        \\\n        HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt);   \\\n        HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del);        \\\n        (head)->hh.tbl->num_items--;                                             \\\n    }                                                                            \\\n    HASH_FSCK(hh,head);                                                          \\\n} while (0)\n\n\n/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */\n#define HASH_FIND_STR(head,findstr,out)                                          \\\n    HASH_FIND(hh,head,findstr,strlen(findstr),out)\n#define HASH_ADD_STR(head,strfield,add)                                          \\\n    HASH_ADD(hh,head,strfield,strlen(add->strfield),add)\n#define HASH_REPLACE_STR(head,strfield,add,replaced)                             \\\n  HASH_REPLACE(hh,head,strfield,strlen(add->strfield),add,replaced)\n#define HASH_FIND_INT(head,findint,out)                                          \\\n    HASH_FIND(hh,head,findint,sizeof(int),out)\n#define HASH_ADD_INT(head,intfield,add)                                          \\\n    HASH_ADD(hh,head,intfield,sizeof(int),add)\n#define HASH_REPLACE_INT(head,intfield,add,replaced)                             \\\n    HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced)\n#define HASH_FIND_PTR(head,findptr,out)                                          \\\n    HASH_FIND(hh,head,findptr,sizeof(void *),out)\n#define HASH_ADD_PTR(head,ptrfield,add)                                          \\\n    HASH_ADD(hh,head,ptrfield,sizeof(void *),add)\n#define HASH_REPLACE_PTR(head,ptrfield,add)                                      \\\n    HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced)\n#define HASH_DEL(head,delptr)                                                    \\\n    HASH_DELETE(hh,head,delptr)\n\n/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.\n * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.\n */\n#ifdef HASH_DEBUG\n#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)\n#define HASH_FSCK(hh,head)                                                       \\\ndo {                                                                             \\\n    unsigned _bkt_i;                                                             \\\n    unsigned _count, _bkt_count;                                                 \\\n    char *_prev;                                                                 \\\n    struct UT_hash_handle *_thh;                                                 \\\n    if (head) {                                                                  \\\n        _count = 0;                                                              \\\n        for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) {       \\\n            _bkt_count = 0;                                                      \\\n            _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head;                      \\\n            _prev = NULL;                                                        \\\n            while (_thh) {                                                       \\\n               if (_prev != (char*)(_thh->hh_prev)) {                            \\\n                   HASH_OOPS(\"invalid hh_prev %p, actual %p\\n\",                  \\\n                    _thh->hh_prev, _prev );                                      \\\n               }                                                                 \\\n               _bkt_count++;                                                     \\\n               _prev = (char*)(_thh);                                            \\\n               _thh = _thh->hh_next;                                             \\\n            }                                                                    \\\n            _count += _bkt_count;                                                \\\n            if ((head)->hh.tbl->buckets[_bkt_i].count !=  _bkt_count) {          \\\n               HASH_OOPS(\"invalid bucket count %d, actual %d\\n\",                 \\\n                (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count);              \\\n            }                                                                    \\\n        }                                                                        \\\n        if (_count != (head)->hh.tbl->num_items) {                               \\\n            HASH_OOPS(\"invalid hh item count %d, actual %d\\n\",                   \\\n                (head)->hh.tbl->num_items, _count );                             \\\n        }                                                                        \\\n        /* traverse hh in app order; check next/prev integrity, count */         \\\n        _count = 0;                                                              \\\n        _prev = NULL;                                                            \\\n        _thh =  &(head)->hh;                                                     \\\n        while (_thh) {                                                           \\\n           _count++;                                                             \\\n           if (_prev !=(char*)(_thh->prev)) {                                    \\\n              HASH_OOPS(\"invalid prev %p, actual %p\\n\",                          \\\n                    _thh->prev, _prev );                                         \\\n           }                                                                     \\\n           _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh);                    \\\n           _thh = ( _thh->next ?  (UT_hash_handle*)((char*)(_thh->next) +        \\\n                                  (head)->hh.tbl->hho) : NULL );                 \\\n        }                                                                        \\\n        if (_count != (head)->hh.tbl->num_items) {                               \\\n            HASH_OOPS(\"invalid app item count %d, actual %d\\n\",                  \\\n                (head)->hh.tbl->num_items, _count );                             \\\n        }                                                                        \\\n    }                                                                            \\\n} while (0)\n#else\n#define HASH_FSCK(hh,head) \n#endif\n\n/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to \n * the descriptor to which this macro is defined for tuning the hash function.\n * The app can #include <unistd.h> to get the prototype for write(2). */\n#ifdef HASH_EMIT_KEYS\n#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                                   \\\ndo {                                                                             \\\n    unsigned _klen = fieldlen;                                                   \\\n    write(HASH_EMIT_KEYS, &_klen, sizeof(_klen));                                \\\n    write(HASH_EMIT_KEYS, keyptr, fieldlen);                                     \\\n} while (0)\n#else \n#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                    \n#endif\n\n/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */\n#ifdef HASH_FUNCTION \n#define HASH_FCN HASH_FUNCTION\n#else\n#define HASH_FCN HASH_JEN\n#endif\n\n/* The Bernstein hash function, used in Perl prior to v5.6 */\n#define HASH_BER(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _hb_keylen=keylen;                                                    \\\n  char *_hb_key=(char*)(key);                                                    \\\n  (hashv) = 0;                                                                   \\\n  while (_hb_keylen--)  { (hashv) = ((hashv) * 33) + *_hb_key++; }               \\\n  bkt = (hashv) & (num_bkts-1);                                                  \\\n} while (0)\n\n\n/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at \n * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */\n#define HASH_SAX(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _sx_i;                                                                \\\n  char *_hs_key=(char*)(key);                                                    \\\n  hashv = 0;                                                                     \\\n  for(_sx_i=0; _sx_i < keylen; _sx_i++)                                          \\\n      hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i];                     \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while (0)\n\n#define HASH_FNV(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _fn_i;                                                                \\\n  char *_hf_key=(char*)(key);                                                    \\\n  hashv = 2166136261UL;                                                          \\\n  for(_fn_i=0; _fn_i < keylen; _fn_i++)                                          \\\n      hashv = (hashv * 16777619) ^ _hf_key[_fn_i];                               \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0) \n \n#define HASH_OAT(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _ho_i;                                                                \\\n  char *_ho_key=(char*)(key);                                                    \\\n  hashv = 0;                                                                     \\\n  for(_ho_i=0; _ho_i < keylen; _ho_i++) {                                        \\\n      hashv += _ho_key[_ho_i];                                                   \\\n      hashv += (hashv << 10);                                                    \\\n      hashv ^= (hashv >> 6);                                                     \\\n  }                                                                              \\\n  hashv += (hashv << 3);                                                         \\\n  hashv ^= (hashv >> 11);                                                        \\\n  hashv += (hashv << 15);                                                        \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n\n#define HASH_JEN_MIX(a,b,c)                                                      \\\ndo {                                                                             \\\n  a -= b; a -= c; a ^= ( c >> 13 );                                              \\\n  b -= c; b -= a; b ^= ( a << 8 );                                               \\\n  c -= a; c -= b; c ^= ( b >> 13 );                                              \\\n  a -= b; a -= c; a ^= ( c >> 12 );                                              \\\n  b -= c; b -= a; b ^= ( a << 16 );                                              \\\n  c -= a; c -= b; c ^= ( b >> 5 );                                               \\\n  a -= b; a -= c; a ^= ( c >> 3 );                                               \\\n  b -= c; b -= a; b ^= ( a << 10 );                                              \\\n  c -= a; c -= b; c ^= ( b >> 15 );                                              \\\n} while (0)\n\n#define HASH_JEN(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _hj_i,_hj_j,_hj_k;                                                    \\\n  unsigned char *_hj_key=(unsigned char*)(key);                                  \\\n  hashv = 0xfeedbeef;                                                            \\\n  _hj_i = _hj_j = 0x9e3779b9;                                                    \\\n  _hj_k = (unsigned)keylen;                                                      \\\n  while (_hj_k >= 12) {                                                          \\\n    _hj_i +=    (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 )                      \\\n        + ( (unsigned)_hj_key[2] << 16 )                                         \\\n        + ( (unsigned)_hj_key[3] << 24 ) );                                      \\\n    _hj_j +=    (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 )                      \\\n        + ( (unsigned)_hj_key[6] << 16 )                                         \\\n        + ( (unsigned)_hj_key[7] << 24 ) );                                      \\\n    hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 )                         \\\n        + ( (unsigned)_hj_key[10] << 16 )                                        \\\n        + ( (unsigned)_hj_key[11] << 24 ) );                                     \\\n                                                                                 \\\n     HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                          \\\n                                                                                 \\\n     _hj_key += 12;                                                              \\\n     _hj_k -= 12;                                                                \\\n  }                                                                              \\\n  hashv += keylen;                                                               \\\n  switch ( _hj_k ) {                                                             \\\n     case 11: hashv += ( (unsigned)_hj_key[10] << 24 );                          \\\n     case 10: hashv += ( (unsigned)_hj_key[9] << 16 );                           \\\n     case 9:  hashv += ( (unsigned)_hj_key[8] << 8 );                            \\\n     case 8:  _hj_j += ( (unsigned)_hj_key[7] << 24 );                           \\\n     case 7:  _hj_j += ( (unsigned)_hj_key[6] << 16 );                           \\\n     case 6:  _hj_j += ( (unsigned)_hj_key[5] << 8 );                            \\\n     case 5:  _hj_j += _hj_key[4];                                               \\\n     case 4:  _hj_i += ( (unsigned)_hj_key[3] << 24 );                           \\\n     case 3:  _hj_i += ( (unsigned)_hj_key[2] << 16 );                           \\\n     case 2:  _hj_i += ( (unsigned)_hj_key[1] << 8 );                            \\\n     case 1:  _hj_i += _hj_key[0];                                               \\\n  }                                                                              \\\n  HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                             \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n\n/* The Paul Hsieh hash function */\n#undef get16bits\n#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__)             \\\n  || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)\n#define get16bits(d) (*((const uint16_t *) (d)))\n#endif\n\n#if !defined (get16bits)\n#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)             \\\n                       +(uint32_t)(((const uint8_t *)(d))[0]) )\n#endif\n#define HASH_SFH(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned char *_sfh_key=(unsigned char*)(key);                                 \\\n  uint32_t _sfh_tmp, _sfh_len = keylen;                                          \\\n                                                                                 \\\n  int _sfh_rem = _sfh_len & 3;                                                   \\\n  _sfh_len >>= 2;                                                                \\\n  hashv = 0xcafebabe;                                                            \\\n                                                                                 \\\n  /* Main loop */                                                                \\\n  for (;_sfh_len > 0; _sfh_len--) {                                              \\\n    hashv    += get16bits (_sfh_key);                                            \\\n    _sfh_tmp       = (uint32_t)(get16bits (_sfh_key+2)) << 11  ^ hashv;          \\\n    hashv     = (hashv << 16) ^ _sfh_tmp;                                        \\\n    _sfh_key += 2*sizeof (uint16_t);                                             \\\n    hashv    += hashv >> 11;                                                     \\\n  }                                                                              \\\n                                                                                 \\\n  /* Handle end cases */                                                         \\\n  switch (_sfh_rem) {                                                            \\\n    case 3: hashv += get16bits (_sfh_key);                                       \\\n            hashv ^= hashv << 16;                                                \\\n            hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)] << 18);              \\\n            hashv += hashv >> 11;                                                \\\n            break;                                                               \\\n    case 2: hashv += get16bits (_sfh_key);                                       \\\n            hashv ^= hashv << 11;                                                \\\n            hashv += hashv >> 17;                                                \\\n            break;                                                               \\\n    case 1: hashv += *_sfh_key;                                                  \\\n            hashv ^= hashv << 10;                                                \\\n            hashv += hashv >> 1;                                                 \\\n  }                                                                              \\\n                                                                                 \\\n    /* Force \"avalanching\" of final 127 bits */                                  \\\n    hashv ^= hashv << 3;                                                         \\\n    hashv += hashv >> 5;                                                         \\\n    hashv ^= hashv << 4;                                                         \\\n    hashv += hashv >> 17;                                                        \\\n    hashv ^= hashv << 25;                                                        \\\n    hashv += hashv >> 6;                                                         \\\n    bkt = hashv & (num_bkts-1);                                                  \\\n} while(0) \n\n#ifdef HASH_USING_NO_STRICT_ALIASING\n/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads.\n * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error.\n * MurmurHash uses the faster approach only on CPU's where we know it's safe. \n *\n * Note the preprocessor built-in defines can be emitted using:\n *\n *   gcc -m64 -dM -E - < /dev/null                  (on gcc)\n *   cc -## a.c (where a.c is a simple test file)   (Sun Studio)\n */\n#if (defined(__i386__) || defined(__x86_64__)  || defined(_M_IX86))\n#define MUR_GETBLOCK(p,i) p[i]\n#else /* non intel */\n#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0)\n#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1)\n#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2)\n#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3)\n#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))\n#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))\n#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))\n#define MUR_TWO_TWO(p)   ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))\n#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >>  8))\n#else /* assume little endian non-intel */\n#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24))\n#define MUR_TWO_TWO(p)   ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16))\n#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) <<  8))\n#endif\n#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) :           \\\n                            (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \\\n                             (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) :  \\\n                                                      MUR_ONE_THREE(p))))\n#endif\n#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))\n#define MUR_FMIX(_h) \\\ndo {                 \\\n  _h ^= _h >> 16;    \\\n  _h *= 0x85ebca6b;  \\\n  _h ^= _h >> 13;    \\\n  _h *= 0xc2b2ae35l; \\\n  _h ^= _h >> 16;    \\\n} while(0)\n\n#define HASH_MUR(key,keylen,num_bkts,hashv,bkt)                        \\\ndo {                                                                   \\\n  const uint8_t *_mur_data = (const uint8_t*)(key);                    \\\n  const int _mur_nblocks = (keylen) / 4;                               \\\n  uint32_t _mur_h1 = 0xf88D5353;                                       \\\n  uint32_t _mur_c1 = 0xcc9e2d51;                                       \\\n  uint32_t _mur_c2 = 0x1b873593;                                       \\\n  uint32_t _mur_k1 = 0;                                                \\\n  const uint8_t *_mur_tail;                                            \\\n  const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \\\n  int _mur_i;                                                          \\\n  for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) {                      \\\n    _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i);                        \\\n    _mur_k1 *= _mur_c1;                                                \\\n    _mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \\\n    _mur_k1 *= _mur_c2;                                                \\\n                                                                       \\\n    _mur_h1 ^= _mur_k1;                                                \\\n    _mur_h1 = MUR_ROTL32(_mur_h1,13);                                  \\\n    _mur_h1 = _mur_h1*5+0xe6546b64;                                    \\\n  }                                                                    \\\n  _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4);            \\\n  _mur_k1=0;                                                           \\\n  switch((keylen) & 3) {                                               \\\n    case 3: _mur_k1 ^= _mur_tail[2] << 16;                             \\\n    case 2: _mur_k1 ^= _mur_tail[1] << 8;                              \\\n    case 1: _mur_k1 ^= _mur_tail[0];                                   \\\n    _mur_k1 *= _mur_c1;                                                \\\n    _mur_k1 = MUR_ROTL32(_mur_k1,15);                                  \\\n    _mur_k1 *= _mur_c2;                                                \\\n    _mur_h1 ^= _mur_k1;                                                \\\n  }                                                                    \\\n  _mur_h1 ^= (keylen);                                                 \\\n  MUR_FMIX(_mur_h1);                                                   \\\n  hashv = _mur_h1;                                                     \\\n  bkt = hashv & (num_bkts-1);                                          \\\n} while(0)\n#endif  /* HASH_USING_NO_STRICT_ALIASING */\n\n/* key comparison function; return 0 if keys equal */\n#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) \n\n/* iterate over items in a known bucket to find desired item */\n#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out)                       \\\ndo {                                                                             \\\n if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head));          \\\n else out=NULL;                                                                  \\\n while (out) {                                                                   \\\n    if ((out)->hh.keylen == keylen_in) {                                           \\\n        if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break;             \\\n    }                                                                            \\\n    if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \\\n    else out = NULL;                                                             \\\n }                                                                               \\\n} while(0)\n\n/* add an item to a bucket  */\n#define HASH_ADD_TO_BKT(head,addhh)                                              \\\ndo {                                                                             \\\n head.count++;                                                                   \\\n (addhh)->hh_next = head.hh_head;                                                \\\n (addhh)->hh_prev = NULL;                                                        \\\n if (head.hh_head) { (head).hh_head->hh_prev = (addhh); }                        \\\n (head).hh_head=addhh;                                                           \\\n if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH)             \\\n     && (addhh)->tbl->noexpand != 1) {                                           \\\n       HASH_EXPAND_BUCKETS((addhh)->tbl);                                        \\\n }                                                                               \\\n} while(0)\n\n/* remove an item from a given bucket */\n#define HASH_DEL_IN_BKT(hh,head,hh_del)                                          \\\n    (head).count--;                                                              \\\n    if ((head).hh_head == hh_del) {                                              \\\n      (head).hh_head = hh_del->hh_next;                                          \\\n    }                                                                            \\\n    if (hh_del->hh_prev) {                                                       \\\n        hh_del->hh_prev->hh_next = hh_del->hh_next;                              \\\n    }                                                                            \\\n    if (hh_del->hh_next) {                                                       \\\n        hh_del->hh_next->hh_prev = hh_del->hh_prev;                              \\\n    }                                                                \n\n/* Bucket expansion has the effect of doubling the number of buckets\n * and redistributing the items into the new buckets. Ideally the\n * items will distribute more or less evenly into the new buckets\n * (the extent to which this is true is a measure of the quality of\n * the hash function as it applies to the key domain). \n * \n * With the items distributed into more buckets, the chain length\n * (item count) in each bucket is reduced. Thus by expanding buckets\n * the hash keeps a bound on the chain length. This bounded chain \n * length is the essence of how a hash provides constant time lookup.\n * \n * The calculation of tbl->ideal_chain_maxlen below deserves some\n * explanation. First, keep in mind that we're calculating the ideal\n * maximum chain length based on the *new* (doubled) bucket count.\n * In fractions this is just n/b (n=number of items,b=new num buckets).\n * Since the ideal chain length is an integer, we want to calculate \n * ceil(n/b). We don't depend on floating point arithmetic in this\n * hash, so to calculate ceil(n/b) with integers we could write\n * \n *      ceil(n/b) = (n/b) + ((n%b)?1:0)\n * \n * and in fact a previous version of this hash did just that.\n * But now we have improved things a bit by recognizing that b is\n * always a power of two. We keep its base 2 log handy (call it lb),\n * so now we can write this with a bit shift and logical AND:\n * \n *      ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)\n * \n */\n#define HASH_EXPAND_BUCKETS(tbl)                                                 \\\ndo {                                                                             \\\n    unsigned _he_bkt;                                                            \\\n    unsigned _he_bkt_i;                                                          \\\n    struct UT_hash_handle *_he_thh, *_he_hh_nxt;                                 \\\n    UT_hash_bucket *_he_new_buckets, *_he_newbkt;                                \\\n    _he_new_buckets = (UT_hash_bucket*)uthash_malloc(                            \\\n             2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));              \\\n    if (!_he_new_buckets) { uthash_fatal( \"out of memory\"); }                    \\\n    memset(_he_new_buckets, 0,                                                   \\\n            2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));               \\\n    tbl->ideal_chain_maxlen =                                                    \\\n       (tbl->num_items >> (tbl->log2_num_buckets+1)) +                           \\\n       ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0);                    \\\n    tbl->nonideal_items = 0;                                                     \\\n    for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++)                \\\n    {                                                                            \\\n        _he_thh = tbl->buckets[ _he_bkt_i ].hh_head;                             \\\n        while (_he_thh) {                                                        \\\n           _he_hh_nxt = _he_thh->hh_next;                                        \\\n           HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt);            \\\n           _he_newbkt = &(_he_new_buckets[ _he_bkt ]);                           \\\n           if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) {                \\\n             tbl->nonideal_items++;                                              \\\n             _he_newbkt->expand_mult = _he_newbkt->count /                       \\\n                                        tbl->ideal_chain_maxlen;                 \\\n           }                                                                     \\\n           _he_thh->hh_prev = NULL;                                              \\\n           _he_thh->hh_next = _he_newbkt->hh_head;                               \\\n           if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev =               \\\n                _he_thh;                                                         \\\n           _he_newbkt->hh_head = _he_thh;                                        \\\n           _he_thh = _he_hh_nxt;                                                 \\\n        }                                                                        \\\n    }                                                                            \\\n    uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \\\n    tbl->num_buckets *= 2;                                                       \\\n    tbl->log2_num_buckets++;                                                     \\\n    tbl->buckets = _he_new_buckets;                                              \\\n    tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ?         \\\n        (tbl->ineff_expands+1) : 0;                                              \\\n    if (tbl->ineff_expands > 1) {                                                \\\n        tbl->noexpand=1;                                                         \\\n        uthash_noexpand_fyi(tbl);                                                \\\n    }                                                                            \\\n    uthash_expand_fyi(tbl);                                                      \\\n} while(0)\n\n\n/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */\n/* Note that HASH_SORT assumes the hash handle name to be hh. \n * HASH_SRT was added to allow the hash handle name to be passed in. */\n#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn)\n#define HASH_SRT(hh,head,cmpfcn)                                                 \\\ndo {                                                                             \\\n  unsigned _hs_i;                                                                \\\n  unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize;               \\\n  struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail;            \\\n  if (head) {                                                                    \\\n      _hs_insize = 1;                                                            \\\n      _hs_looping = 1;                                                           \\\n      _hs_list = &((head)->hh);                                                  \\\n      while (_hs_looping) {                                                      \\\n          _hs_p = _hs_list;                                                      \\\n          _hs_list = NULL;                                                       \\\n          _hs_tail = NULL;                                                       \\\n          _hs_nmerges = 0;                                                       \\\n          while (_hs_p) {                                                        \\\n              _hs_nmerges++;                                                     \\\n              _hs_q = _hs_p;                                                     \\\n              _hs_psize = 0;                                                     \\\n              for ( _hs_i = 0; _hs_i  < _hs_insize; _hs_i++ ) {                  \\\n                  _hs_psize++;                                                   \\\n                  _hs_q = (UT_hash_handle*)((_hs_q->next) ?                      \\\n                          ((void*)((char*)(_hs_q->next) +                        \\\n                          (head)->hh.tbl->hho)) : NULL);                         \\\n                  if (! (_hs_q) ) break;                                         \\\n              }                                                                  \\\n              _hs_qsize = _hs_insize;                                            \\\n              while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) {           \\\n                  if (_hs_psize == 0) {                                          \\\n                      _hs_e = _hs_q;                                             \\\n                      _hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \\\n                              ((void*)((char*)(_hs_q->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_qsize--;                                               \\\n                  } else if ( (_hs_qsize == 0) || !(_hs_q) ) {                   \\\n                      _hs_e = _hs_p;                                             \\\n                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \\\n                              ((void*)((char*)(_hs_p->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_psize--;                                               \\\n                  } else if ((                                                   \\\n                      cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \\\n                             DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \\\n                             ) <= 0) {                                           \\\n                      _hs_e = _hs_p;                                             \\\n                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \\\n                              ((void*)((char*)(_hs_p->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_psize--;                                               \\\n                  } else {                                                       \\\n                      _hs_e = _hs_q;                                             \\\n                      _hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \\\n                              ((void*)((char*)(_hs_q->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_qsize--;                                               \\\n                  }                                                              \\\n                  if ( _hs_tail ) {                                              \\\n                      _hs_tail->next = ((_hs_e) ?                                \\\n                            ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL);          \\\n                  } else {                                                       \\\n                      _hs_list = _hs_e;                                          \\\n                  }                                                              \\\n                  _hs_e->prev = ((_hs_tail) ?                                    \\\n                     ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL);              \\\n                  _hs_tail = _hs_e;                                              \\\n              }                                                                  \\\n              _hs_p = _hs_q;                                                     \\\n          }                                                                      \\\n          _hs_tail->next = NULL;                                                 \\\n          if ( _hs_nmerges <= 1 ) {                                              \\\n              _hs_looping=0;                                                     \\\n              (head)->hh.tbl->tail = _hs_tail;                                   \\\n              DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list));      \\\n          }                                                                      \\\n          _hs_insize *= 2;                                                       \\\n      }                                                                          \\\n      HASH_FSCK(hh,head);                                                        \\\n }                                                                               \\\n} while (0)\n\n/* This function selects items from one hash into another hash. \n * The end result is that the selected items have dual presence \n * in both hashes. There is no copy of the items made; rather \n * they are added into the new hash through a secondary hash \n * hash handle that must be present in the structure. */\n#define HASH_SELECT(hh_dst, dst, hh_src, src, cond)                              \\\ndo {                                                                             \\\n  unsigned _src_bkt, _dst_bkt;                                                   \\\n  void *_last_elt=NULL, *_elt;                                                   \\\n  UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL;                         \\\n  ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst));                 \\\n  if (src) {                                                                     \\\n    for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) {     \\\n      for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head;                \\\n          _src_hh;                                                               \\\n          _src_hh = _src_hh->hh_next) {                                          \\\n          _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh);                       \\\n          if (cond(_elt)) {                                                      \\\n            _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho);               \\\n            _dst_hh->key = _src_hh->key;                                         \\\n            _dst_hh->keylen = _src_hh->keylen;                                   \\\n            _dst_hh->hashv = _src_hh->hashv;                                     \\\n            _dst_hh->prev = _last_elt;                                           \\\n            _dst_hh->next = NULL;                                                \\\n            if (_last_elt_hh) { _last_elt_hh->next = _elt; }                     \\\n            if (!dst) {                                                          \\\n              DECLTYPE_ASSIGN(dst,_elt);                                         \\\n              HASH_MAKE_TABLE(hh_dst,dst);                                       \\\n            } else {                                                             \\\n              _dst_hh->tbl = (dst)->hh_dst.tbl;                                  \\\n            }                                                                    \\\n            HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt);    \\\n            HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh);            \\\n            (dst)->hh_dst.tbl->num_items++;                                      \\\n            _last_elt = _elt;                                                    \\\n            _last_elt_hh = _dst_hh;                                              \\\n          }                                                                      \\\n      }                                                                          \\\n    }                                                                            \\\n  }                                                                              \\\n  HASH_FSCK(hh_dst,dst);                                                         \\\n} while (0)\n\n#define HASH_CLEAR(hh,head)                                                      \\\ndo {                                                                             \\\n  if (head) {                                                                    \\\n    uthash_free((head)->hh.tbl->buckets,                                         \\\n                (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket));      \\\n    HASH_BLOOM_FREE((head)->hh.tbl);                                             \\\n    uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                          \\\n    (head)=NULL;                                                                 \\\n  }                                                                              \\\n} while(0)\n\n#define HASH_OVERHEAD(hh,head)                                                   \\\n (size_t)((((head)->hh.tbl->num_items   * sizeof(UT_hash_handle))   +            \\\n           ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket))   +            \\\n            (sizeof(UT_hash_table))                                 +            \\\n            (HASH_BLOOM_BYTELEN)))\n\n#ifdef NO_DECLTYPE\n#define HASH_ITER(hh,head,el,tmp)                                                \\\nfor((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL);       \\\n  el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) \n#else\n#define HASH_ITER(hh,head,el,tmp)                                                \\\nfor((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL);                 \\\n  el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL))\n#endif\n\n/* obtain a count of items in the hash */\n#define HASH_COUNT(head) HASH_CNT(hh,head) \n#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0)\n\ntypedef struct UT_hash_bucket {\n   struct UT_hash_handle *hh_head;\n   unsigned count;\n\n   /* expand_mult is normally set to 0. In this situation, the max chain length\n    * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If\n    * the bucket's chain exceeds this length, bucket expansion is triggered). \n    * However, setting expand_mult to a non-zero value delays bucket expansion\n    * (that would be triggered by additions to this particular bucket)\n    * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.\n    * (The multiplier is simply expand_mult+1). The whole idea of this\n    * multiplier is to reduce bucket expansions, since they are expensive, in\n    * situations where we know that a particular bucket tends to be overused.\n    * It is better to let its chain length grow to a longer yet-still-bounded\n    * value, than to do an O(n) bucket expansion too often. \n    */\n   unsigned expand_mult;\n\n} UT_hash_bucket;\n\n/* random signature used only to find hash tables in external analysis */\n#define HASH_SIGNATURE 0xa0111fe1\n#define HASH_BLOOM_SIGNATURE 0xb12220f2\n\ntypedef struct UT_hash_table {\n   UT_hash_bucket *buckets;\n   unsigned num_buckets, log2_num_buckets;\n   unsigned num_items;\n   struct UT_hash_handle *tail; /* tail hh in app order, for fast append    */\n   ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */\n\n   /* in an ideal situation (all buckets used equally), no bucket would have\n    * more than ceil(#items/#buckets) items. that's the ideal chain length. */\n   unsigned ideal_chain_maxlen;\n\n   /* nonideal_items is the number of items in the hash whose chain position\n    * exceeds the ideal chain maxlen. these items pay the penalty for an uneven\n    * hash distribution; reaching them in a chain traversal takes >ideal steps */\n   unsigned nonideal_items;\n\n   /* ineffective expands occur when a bucket doubling was performed, but \n    * afterward, more than half the items in the hash had nonideal chain\n    * positions. If this happens on two consecutive expansions we inhibit any\n    * further expansion, as it's not helping; this happens when the hash\n    * function isn't a good fit for the key domain. When expansion is inhibited\n    * the hash will still work, albeit no longer in constant time. */\n   unsigned ineff_expands, noexpand;\n\n   uint32_t signature; /* used only to find hash tables in external analysis */\n#ifdef HASH_BLOOM\n   uint32_t bloom_sig; /* used only to test bloom exists in external analysis */\n   uint8_t *bloom_bv;\n   char bloom_nbits;\n#endif\n\n} UT_hash_table;\n\ntypedef struct UT_hash_handle {\n   struct UT_hash_table *tbl;\n   void *prev;                       /* prev element in app order      */\n   void *next;                       /* next element in app order      */\n   struct UT_hash_handle *hh_prev;   /* previous hh in bucket order    */\n   struct UT_hash_handle *hh_next;   /* next hh in bucket order        */\n   void *key;                        /* ptr to enclosing struct's key  */\n   unsigned keylen;                  /* enclosing struct's key len     */\n   unsigned hashv;                   /* result of hash-fcn(key)        */\n} UT_hash_handle;\n\n#endif /* UTHASH_H */\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/GoogleAdMobAdsSdk.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginAdmob</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libAdsAdmob\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <applicationCfg keyword=\"com.google.ads.AdActivity\">\n        <activity android:name=\"com.google.ads.AdActivity\" android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\"/>\n    </applicationCfg>\n\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.INTERNET\"/>\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n    </permissionCfg>\n</manifestConfig> \n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginAdmob\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.android/src/org/cocos2dx/plugin/AdsAdmob.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.HashSet;\nimport java.util.Hashtable;\nimport java.util.Iterator;\nimport java.util.Set;\n\nimport com.google.ads.*;\nimport com.google.ads.AdRequest.ErrorCode;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.util.Log;\nimport android.view.WindowManager;\n\npublic class AdsAdmob implements InterfaceAds {\n\n\tprivate static final String LOG_TAG = \"AdsAdmob\";\n\tprivate static Activity mContext = null;\n\tprivate static boolean bDebug = false;\n\tprivate static AdsAdmob mAdapter = null;\n\n\tprivate AdView adView = null;\n\tprivate String mPublishID = \"\";\n\tprivate Set<String> mTestDevices = null;\n\tprivate WindowManager mWm = null;\n\n\tprivate static final int ADMOB_SIZE_BANNER = 1;\n\tprivate static final int ADMOB_SIZE_IABMRect = 2;\n\tprivate static final int ADMOB_SIZE_IABBanner = 3;\n\tprivate static final int ADMOB_SIZE_IABLeaderboard = 4;\n\tprivate static final int ADMOB_SIZE_Skyscraper = 5;\n\n\tprivate static final int ADMOB_TYPE_BANNER = 1;\n\tprivate static final int ADMOB_TYPE_FULLSCREEN = 2;\n\n\tprotected static void LogE(String msg, Exception e) {\n\t\tLog.e(LOG_TAG, msg, e);\n\t\te.printStackTrace();\n\t}\n\n\tprotected static void LogD(String msg) {\n\t\tif (bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n\n\tpublic AdsAdmob(Context context) {\n\t\tmContext = (Activity) context;\n\t\tmAdapter = this;\n\t}\n\n\t@Override\n\tpublic void setDebugMode(boolean debug) {\n\t\tbDebug = debug;\n\t}\n\n\t@Override\n\tpublic String getSDKVersion() {\n\t\treturn \"6.3.1\";\n\t}\n\n\t@Override\n\tpublic void configDeveloperInfo(Hashtable<String, String> devInfo) {\n\t\ttry {\n\t\t\tmPublishID = devInfo.get(\"AdmobID\");\n\t\t\tLogD(\"init AppInfo : \" + mPublishID);\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"initAppInfo, The format of appInfo is wrong\", e);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void showAds(Hashtable<String, String> info, int pos) {\n\t    try\n\t    {\n\t        String strType = info.get(\"AdmobType\");\n\t        int adsType = Integer.parseInt(strType);\n\n\t        switch (adsType) {\n\t        case ADMOB_TYPE_BANNER:\n\t            {\n\t                String strSize = info.get(\"AdmobSizeEnum\");\n\t                int sizeEnum = Integer.parseInt(strSize);\n    \t            showBannerAd(sizeEnum, pos);\n                    break;\n\t            }\n\t        case ADMOB_TYPE_FULLSCREEN:\n\t            LogD(\"Now not support full screen view in Admob\");\n\t            break;\n\t        default:\n\t            break;\n\t        }\n\t    } catch (Exception e) {\n\t        LogE(\"Error when show Ads ( \" + info.toString() + \" )\", e);\n\t    }\n\t}\n\n\t@Override\n\tpublic void spendPoints(int points) {\n\t\tLogD(\"Admob not support spend points!\");\n\t}\n\n\t@Override\n\tpublic void hideAds(Hashtable<String, String> info) {\n\t    try\n        {\n            String strType = info.get(\"AdmobType\");\n            int adsType = Integer.parseInt(strType);\n\n            switch (adsType) {\n            case ADMOB_TYPE_BANNER:\n                hideBannerAd();\n                break;\n            case ADMOB_TYPE_FULLSCREEN:\n                LogD(\"Now not support full screen view in Admob\");\n                break;\n            default:\n                break;\n            }\n        } catch (Exception e) {\n            LogE(\"Error when hide Ads ( \" + info.toString() + \" )\", e);\n        }\n\t}\n\n\tprivate void showBannerAd(int sizeEnum, int pos) {\n\t\tfinal int curPos = pos;\n\t\tfinal int curSize = sizeEnum;\n\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// destory the ad view before\n\t\t\t\tif (null != adView) {\n\t\t\t\t\tif (null != mWm) {\n\t\t\t\t\t\tmWm.removeView(adView);\n\t\t\t\t\t}\n\t\t\t\t\tadView.destroy();\n\t\t\t\t\tadView = null;\n\t\t\t\t}\n\n\t\t\t\tAdSize size = AdSize.BANNER;\n\t\t\t\tswitch (curSize) {\n\t\t\t\tcase AdsAdmob.ADMOB_SIZE_BANNER:\n\t\t\t\t\tsize = AdSize.BANNER;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AdsAdmob.ADMOB_SIZE_IABMRect:\n\t\t\t\t\tsize = AdSize.IAB_MRECT;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AdsAdmob.ADMOB_SIZE_IABBanner:\n\t\t\t\t\tsize = AdSize.IAB_BANNER;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AdsAdmob.ADMOB_SIZE_IABLeaderboard:\n\t\t\t\t\tsize = AdSize.IAB_LEADERBOARD;\n\t\t\t\t\tbreak;\n\t\t\t\tcase AdsAdmob.ADMOB_SIZE_Skyscraper:\n\t\t\t\t    size = AdSize.IAB_WIDE_SKYSCRAPER;\n\t\t\t\t    break;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tadView = new AdView(mContext, size, mPublishID);\n\t\t\t\tAdRequest req = new AdRequest();\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif (mTestDevices != null) {\n\t\t\t\t\t\tIterator<String> ir = mTestDevices.iterator();\n\t\t\t\t\t\twhile(ir.hasNext())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treq.addTestDevice(ir.next());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLogE(\"Error during add test device\", e);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tadView.loadAd(req);\n\t\t\t\tadView.setAdListener(new AdmobAdsListener());\n\n\t\t\t\tif (null == mWm) {\n\t\t\t\t\tmWm = (WindowManager) mContext.getSystemService(\"window\");\n\t\t\t\t}\n\t\t\t\tAdsWrapper.addAdView(mWm, adView, curPos);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate void hideBannerAd() {\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (null != adView) {\n\t\t\t\t\tif (null != mWm) {\n\t\t\t\t\t\tmWm.removeView(adView);\n\t\t\t\t\t}\n\t\t\t\t\tadView.destroy();\n\t\t\t\t\tadView = null;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic void addTestDevice(String deviceID) {\n\t\tLogD(\"addTestDevice invoked : \" + deviceID);\n\t\tif (null == mTestDevices) {\n\t\t\tmTestDevices = new HashSet<String>();\n\t\t}\n\t\tmTestDevices.add(deviceID);\n\t}\n\n\tprivate class AdmobAdsListener implements AdListener {\n\n\t\t@Override\n\t\tpublic void onDismissScreen(Ad arg0) {\n\t\t\tLogD(\"onDismissScreen invoked\");\n\t\t\tAdsWrapper.onAdsResult(mAdapter, AdsWrapper.RESULT_CODE_AdsDismissed, \"Ads view dismissed!\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {\n\t\t\tint errorNo = AdsWrapper.RESULT_CODE_UnknownError;\n\t\t\tString errorMsg = \"Unknow error\";\n\t\t\tswitch (arg1) {\n\t\t\tcase NETWORK_ERROR:\n\t\t\t\terrorNo =  AdsWrapper.RESULT_CODE_NetworkError;\n\t\t\t\terrorMsg = \"Network error\";\n\t\t\t\tbreak;\n\t\t\tcase INVALID_REQUEST:\n\t\t\t\terrorNo = AdsWrapper.RESULT_CODE_NetworkError;\n\t\t\t\terrorMsg = \"The ad request is invalid\";\n\t\t\t\tbreak;\n\t\t\tcase NO_FILL:\n\t\t\t\terrorMsg = \"The ad request is successful, but no ad was returned due to lack of ad inventory.\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tLogD(\"failed to receive ad : \" + errorNo + \" , \" + errorMsg);\n\t\t\tAdsWrapper.onAdsResult(mAdapter, errorNo, errorMsg);\n\t\t}\n\n\t\t@Override\n\t\tpublic void onLeaveApplication(Ad arg0) {\n\t\t\tLogD(\"onLeaveApplication invoked\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onPresentScreen(Ad arg0) {\n\t\t\tLogD(\"onPresentScreen invoked\");\n\t\t\tAdsWrapper.onAdsResult(mAdapter, AdsWrapper.RESULT_CODE_AdsShown, \"Ads view shown!\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onReceiveAd(Ad arg0) {\n\t\t\tLogD(\"onReceiveAd invoked\");\n\t\t\tAdsWrapper.onAdsResult(mAdapter, AdsWrapper.RESULT_CODE_AdsReceived, \"Ads request received success!\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic String getPluginVersion() {\n\t\treturn \"0.2.0\";\n\t}\n\n    @Override\n    public void queryPoints() {\n        LogD(\"Admob not support query points!\");\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADAdMobExtras.h",
    "content": "//\n//  GADAdMobExtras.h\n//  Google Ads iOS SDK\n//\n//  Copyright (c) 2012 Google Inc. All rights reserved.\n//\n//  The additional parameters publishers may send to the AdMob network.\n//\n\n#import <Foundation/Foundation.h>\n\n#import \"GADAdNetworkExtras.h\"\n\n@interface GADAdMobExtras : NSObject <GADAdNetworkExtras>\n\n@property (nonatomic, retain) NSDictionary *additionalParameters;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADAdNetworkExtras.h",
    "content": "//\n//  GADAdNetworkExtras.h\n//  Google Ads iOS SDK\n//\n//  Copyright (c) 2012 Google Inc. All rights reserved.\n//\n//  An object implementing this protocol contains information set by the\n//  publisher on the client device for a particular ad network.\n//\n//  Ad networks should create an 'extras' object implementing this protocol for\n//  their publishers to use.\n//\n\n#import <Foundation/Foundation.h>\n\n@protocol GADAdNetworkExtras <NSObject>\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADAdSize.h",
    "content": "//\n//  GADAdSize.h\n//  Google Ads iOS SDK\n//\n//  Copyright 2012 Google Inc. All rights reserved.\n//\n//  A valid GADAdSize is considered to be one of the predefined GADAdSize\n//  constants or a GADAdSize constructed by GADAdSizeFromCGSize,\n//  GADAdSizeFullWidthPortraitWithHeight, GADAdSizeFullWidthLandscapeWithHeight.\n//\n\n#import <UIKit/UIKit.h>\n\n// Do not create a GADAdSize manually. Use one of the kGADAdSize constants.\n// Treat GADAdSize as an opaque type. Do not access any fields directly. To\n// obtain a concrete CGSize, use the function CGSizeFromGADAdSize().\ntypedef struct GADAdSize {\n  CGSize size;\n  NSUInteger flags;\n} GADAdSize;\n\n#pragma mark Standard Sizes\n\n// iPhone and iPod Touch ad size. Typically 320x50.\nextern GADAdSize const kGADAdSizeBanner;\n\n// Medium Rectangle size for the iPad (especially in a UISplitView's left pane).\n// Typically 300x250.\nextern GADAdSize const kGADAdSizeMediumRectangle;\n\n// Full Banner size for the iPad (especially in a UIPopoverController or in\n// UIModalPresentationFormSheet). Typically 468x60.\nextern GADAdSize const kGADAdSizeFullBanner;\n\n// Leaderboard size for the iPad. Typically 728x90.\nextern GADAdSize const kGADAdSizeLeaderboard;\n\n// Skyscraper size for the iPad. Mediation only. AdMob/Google does not offer\n// this size. Typically 120x600.\nextern GADAdSize const kGADAdSizeSkyscraper;\n\n// An ad size that spans the full width of the application in portrait\n// orientation. The height is typically 50 pixels on an iPhone/iPod UI, and 90\n// pixels tall on an iPad UI.\nextern GADAdSize const kGADAdSizeSmartBannerPortrait;\n\n// An ad size that spans the full width of the application in landscape\n// orientation. The height is typically 32 pixels on an iPhone/iPod UI, and 90\n// pixels tall on an iPad UI.\nextern GADAdSize const kGADAdSizeSmartBannerLandscape;\n\n// Invalid ad size marker.\nextern GADAdSize const kGADAdSizeInvalid;\n\n#pragma mark Custom Sizes\n\n// Given a CGSize, return a custom GADAdSize. Use this only if you require a\n// non-standard size, otherwise, use one of the standard size constants above.\nGADAdSize GADAdSizeFromCGSize(CGSize size);\n\n// Get a custom GADAdSize that spans the full width of the application in\n// portrait orientation with the height provided.\nGADAdSize GADAdSizeFullWidthPortraitWithHeight(CGFloat height);\n\n// Get a custom GADAdSize that spans the full width of the application in\n// landscape orientation with the height provided.\nGADAdSize GADAdSizeFullWidthLandscapeWithHeight(CGFloat height);\n\n#pragma mark Convenience Functions\n\n// Checks whether the two GADAdSizes are equal.\nBOOL GADAdSizeEqualToSize(GADAdSize size1, GADAdSize size2);\n\n// Given a GADAdSize constant, returns a CGSize. If the GADAdSize is unknown,\n// returns CGSizeZero.\nCGSize CGSizeFromGADAdSize(GADAdSize size);\n\n// Determines if |size| is one of the predefined constants, or a custom\n// GADAdSize generated by FromCGSize.\nBOOL IsGADAdSizeValid(GADAdSize size);\n\n// Given a GADAdSize constant, returns a NSString describing the GADAdSize.\nNSString *NSStringFromGADAdSize(GADAdSize size);\n\n\n#pragma mark Deprecated Macros\n\n#define GAD_SIZE_320x50     CGSizeFromGADAdSize(kGADAdSizeBanner)\n#define GAD_SIZE_300x250    CGSizeFromGADAdSize(kGADAdSizeMediumRectangle)\n#define GAD_SIZE_468x60     CGSizeFromGADAdSize(kGADAdSizeFullBanner)\n#define GAD_SIZE_728x90     CGSizeFromGADAdSize(kGADAdSizeLeaderboard)\n#define GAD_SIZE_120x600    CGSizeFromGADAdSize(kGADAdSizeSkyscraper)\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADBannerView.h",
    "content": "//\n//  GADBannerView.h\n//  Google AdMob Ads SDK\n//\n//  Copyright 2011 Google Inc. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n#import \"GADAdSize.h\"\n#import \"GADRequest.h\"\n#import \"GADRequestError.h\"\n#import \"GADBannerViewDelegate.h\"\n\n// The view that displays banner ads.  A minimum implementation to get an ad\n// from within a UIViewController class is:\n//\n//   // Create and setup the ad view, specifying the size and origin at {0, 0}.\n//   GADBannerView *adView =\n//       [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];\n//   adView.rootViewController = self;\n//   adView.adUnitID = @\"ID created when registering my app\";\n//\n//   // Place the ad view onto the screen.\n//   [self.view addSubview:adView];\n//   [adView release];\n//\n//   // Request an ad without any additional targeting information.\n//   [adView loadRequest:nil];\n//\n@interface GADBannerView : UIView\n\n#pragma mark Initialization\n\n// Initializes a GADBannerView and sets it to the specified size, and specifies\n// its placement within its superview bounds. If |size| is invalid, an\n// instance of GADBannerView is not created and nil is returned instead.\n- (id)initWithAdSize:(GADAdSize)size origin:(CGPoint)origin;\n\n// Initializes a GADBannerView and sets it to the specified size, and specifies\n// its placement at the top left of its superview. If |size| is invalid, an\n// instance of GADBannerView is not created and nil is returned instead.\n- (id)initWithAdSize:(GADAdSize)size;\n\n#pragma mark Pre-Request\n\n// Required value created in the AdSense website.  Create a new ad unit for\n// every unique placement of an ad in your application.  Set this to the ID\n// assigned for this placement.  Ad units are important for targeting and stats.\n// Example values for different request types:\n//     AdMob: a0123456789ABCD\n//       DFP: /0123/ca-pub-0123456789012345/my-ad-identifier\n//   AdSense: ca-mb-app-pub-0123456789012345/my-ad-identifier\n// Mediation: AB123456789ABCDE\n@property (nonatomic, copy) NSString *adUnitID;\n\n// Required reference to the current root view controller.  For example the root\n// view controller in tab-based application would be the UITabViewController.\n@property (nonatomic, assign) UIViewController *rootViewController;\n\n// Required to set this banner view to a proper size. Never create your own\n// GADAdSize directly. Use one of the predefined standard ad sizes\n// (such as kGADAdSizeBanner), or create one using the GADAdSizeFromCGSize\n// method. If not using mediation, then changing the adSize after an ad has\n// been shown will cause a new request (for an ad of the new size) to be sent.\n// If using mediation, then a new request may not be sent.\n@property (nonatomic) GADAdSize adSize;\n\n// Optional delegate object that receives state change notifications from this\n// GADBannerView.  Typically this is a UIViewController, however, if you are\n// unfamiliar with the delegate pattern it is recommended you subclass this\n// GADBannerView and make it the delegate.  That avoids any chance of your\n// application crashing if you forget to nil out the delegate.  For example:\n//\n//   @interface MyAdView : GADBannerView <GADBannerViewDelegate>\n//   @end\n//\n//   @implementation MyAdView\n//   - (id)initWithFrame:(CGRect)frame {\n//     if ((self = [super initWithFrame:frame])) {\n//       self.delegate = self;\n//     }\n//     return self;\n//   }\n//\n//   - (void)dealloc {\n//     self.delegate = nil;\n//     [super dealloc];\n//   }\n//\n//   @end\n//\n@property (nonatomic, assign) NSObject<GADBannerViewDelegate> *delegate;\n\n#pragma mark Making an Ad Request\n\n// Makes an ad request.  Additional targeting options can be supplied with a\n// request object.  Refresh the ad by calling this method again.\n- (void)loadRequest:(GADRequest *)request;\n\n#pragma mark Ad Request\n\n// YES, if the currently displayed ad (or most recent failure) was a result of\n// auto refreshing as specified on server.  This will be set to NO after each\n// loadRequest: method.\n@property (nonatomic, readonly) BOOL hasAutoRefreshed;\n\n#pragma mark Mediation\n\n// Gets the underlying ad view of the mediated ad network.\n// You may use this to find out the actual size of the ad and adjust\n// GADBannerView to fit the underlying ad view.\n@property (nonatomic, readonly) UIView *mediatedAdView;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADBannerViewDelegate.h",
    "content": "//\n//  GADBannerViewDelegate.h\n//  Google AdMob Ads SDK\n//\n//  Copyright 2011 Google Inc. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@class GADRequestError;\n@class GADBannerView;\n\n// Delegate for receiving state change messages from a GADBannerView such as ad\n// requests succeeding/failing or when an ad has been clicked.\n@protocol GADBannerViewDelegate <NSObject>\n\n@optional\n\n#pragma mark Ad Request Lifecycle Notifications\n\n// Sent when an ad request loaded an ad.  This is a good opportunity to add this\n// view to the hierarchy if it has not yet been added.  If the ad was received\n// as a part of the server-side auto refreshing, you can examine the\n// hasAutoRefreshed property of the view.\n- (void)adViewDidReceiveAd:(GADBannerView *)view;\n\n// Sent when an ad request failed.  Normally this is because no network\n// connection was available or no ads were available (i.e. no fill).  If the\n// error was received as a part of the server-side auto refreshing, you can\n// examine the hasAutoRefreshed property of the view.\n- (void)adView:(GADBannerView *)view\n    didFailToReceiveAdWithError:(GADRequestError *)error;\n\n#pragma mark Click-Time Lifecycle Notifications\n\n// Sent just before presenting the user a full screen view, such as a browser,\n// in response to clicking on an ad.  Use this opportunity to stop animations,\n// time sensitive interactions, etc.\n//\n// Normally the user looks at the ad, dismisses it, and control returns to your\n// application by calling adViewDidDismissScreen:.  However if the user hits the\n// Home button or clicks on an App Store link your application will end.  On iOS\n// 4.0+ the next method called will be applicationWillResignActive: of your\n// UIViewController (UIApplicationWillResignActiveNotification).  Immediately\n// after that adViewWillLeaveApplication: is called.\n- (void)adViewWillPresentScreen:(GADBannerView *)adView;\n\n// Sent just before dismissing a full screen view.\n- (void)adViewWillDismissScreen:(GADBannerView *)adView;\n\n// Sent just after dismissing a full screen view.  Use this opportunity to\n// restart anything you may have stopped as part of adViewWillPresentScreen:.\n- (void)adViewDidDismissScreen:(GADBannerView *)adView;\n\n// Sent just before the application will background or terminate because the\n// user clicked on an ad that will launch another application (such as the App\n// Store).  The normal UIApplicationDelegate methods, like\n// applicationDidEnterBackground:, will be called immediately before this.\n- (void)adViewWillLeaveApplication:(GADBannerView *)adView;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADInterstitial.h",
    "content": "//\n//  GADInterstitial.h\n//  Google AdMob Ads SDK\n//\n//  Copyright 2011 Google Inc. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\n#import \"GADInterstitialDelegate.h\"\n#import \"GADRequest.h\"\n#import \"GADRequestError.h\"\n\n// An interstitial ad.  This is a full-screen advertisement shown at natural\n// transition points in your application such as between game levels or news\n// stories.\n//\n// Interstitials are shown sparingly.  Expect low to no fill.\n@interface GADInterstitial : NSObject\n\n#pragma mark Pre-Request\n\n// Required value created in the AdSense website.  Create a new ad unit for\n// every unique placement of an ad in your application.  Set this to the ID\n// assigned for this placement.  Ad units are important for targeting and stats.\n// Example values for different request types:\n//   AdMob: a0123456789ABCD\n//     DFP: /0123/ca-pub-0123456789012345/my-ad-identifier\n// AdSense: ca-mb-app-pub-0123456789012345/my-ad-identifier\n@property (nonatomic, copy) NSString *adUnitID;\n\n// Optional delegate object that receives state change notifications from this\n// GADInterstitalAd.  Remember to nil the delegate before deallocating this\n// object.\n@property (nonatomic, assign) NSObject<GADInterstitialDelegate> *delegate;\n\n#pragma mark Making an Ad Request\n\n// Makes an interstitial ad request.  Additional targeting options can be\n// supplied with a request object.  Only one interstitial request is allowed at\n// a time.\n//\n// This is best to do several seconds before the interstitial is needed to\n// preload its content.  Then when transitioning between view controllers show\n// the interstital with presentFromViewController.\n- (void)loadRequest:(GADRequest *)request;\n\n#pragma mark Request at Application Launch\n\n// The |window| will be shown with the |image| displayed until either the\n// |request| interstitial is shown or a timeout occurs.  The delegate will\n// receive an interstitialDidDismissScreen: callback to indicate that your app\n// should continue when the interstitial has finished.\n- (void)loadAndDisplayRequest:(GADRequest *)request\n                  usingWindow:(UIWindow *)window\n                 initialImage:(UIImage *)image;\n\n#pragma mark Post-Request\n\n// Returns YES if the interstitial is ready to be displayed.  The delegate's\n// interstitialAdDidReceiveAd: will be called when this switches from NO to YES.\n@property (nonatomic, readonly) BOOL isReady;\n\n// Returns YES if the interstitial object has already shown an interstitial.\n// Note that an interstitial object can only be used once even with different\n// requests.\n@property (nonatomic, readonly) BOOL hasBeenUsed;\n\n// Presents the interstitial ad which takes over the entire screen until the\n// user dismisses it.  This has no effect unless isReady returns YES and/or the\n// delegate's interstitialDidReceiveAd: has been received.\n//\n// Set rootViewController to the current view controller at the time this method\n// is called.  If your application does not use view controllers pass in nil and\n// your views will be removed from the window to show the interstitial and\n// restored when done.  After the interstitial has been removed, the delegate's\n// interstitialDidDismissScreen: will be called.\n- (void)presentFromRootViewController:(UIViewController *)rootViewController;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADInterstitialDelegate.h",
    "content": "//\n//  GADInterstitialDelegate.h\n//  Google AdMob Ads SDK\n//\n//  Copyright 2011 Google Inc. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@class GADInterstitial;\n@class GADRequestError;\n\n// Delegate for receiving state change messages from a GADInterstitial such as\n// interstitial ad requests succeeding/failing.\n@protocol GADInterstitialDelegate <NSObject>\n\n@optional\n\n#pragma mark Ad Request Lifecycle Notifications\n\n// Sent when an interstitial ad request succeeded.  Show it at the next\n// transition point in your application such as when transitioning between view\n// controllers.\n- (void)interstitialDidReceiveAd:(GADInterstitial *)ad;\n\n// Sent when an interstitial ad request completed without an interstitial to\n// show.  This is common since interstitials are shown sparingly to users.\n- (void)interstitial:(GADInterstitial *)ad\n    didFailToReceiveAdWithError:(GADRequestError *)error;\n\n#pragma mark Display-Time Lifecycle Notifications\n\n// Sent just before presenting an interstitial.  After this method finishes the\n// interstitial will animate onto the screen.  Use this opportunity to stop\n// animations and save the state of your application in case the user leaves\n// while the interstitial is on screen (e.g. to visit the App Store from a link\n// on the interstitial).\n- (void)interstitialWillPresentScreen:(GADInterstitial *)ad;\n\n// Sent before the interstitial is to be animated off the screen.\n- (void)interstitialWillDismissScreen:(GADInterstitial *)ad;\n\n// Sent just after dismissing an interstitial and it has animated off the\n// screen.\n- (void)interstitialDidDismissScreen:(GADInterstitial *)ad;\n\n// Sent just before the application will background or terminate because the\n// user clicked on an ad that will launch another application (such as the App\n// Store).  The normal UIApplicationDelegate methods, like\n// applicationDidEnterBackground:, will be called immediately before this.\n- (void)interstitialWillLeaveApplication:(GADInterstitial *)ad;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADRequest.h",
    "content": "//\n//  GADRequest.h\n//  Google AdMob Ads SDK\n//\n//  Copyright 2011 Google Inc. All rights reserved.\n//\n\n#import <CoreGraphics/CoreGraphics.h>\n#import <Foundation/Foundation.h>\n\n@protocol GADAdNetworkExtras;\n\n// Constant for getting test ads on the simulator using the testDevices method.\n#define GAD_SIMULATOR_ID @\"Simulator\"\n\n// Genders to help deliver more relevant ads.\ntypedef enum {\n  kGADGenderUnknown,\n  kGADGenderMale,\n  kGADGenderFemale\n} GADGender;\n\n// Specifies optional parameters for ad requests.\n@interface GADRequest : NSObject <NSCopying>\n\n// Creates an autoreleased GADRequest.\n+ (GADRequest *)request;\n\n#pragma mark Additional Parameters For Ad Networks\n\n// Ad networks may have additional parameters they accept. To pass these\n// parameters to them, create the ad network extras object for that network,\n// fill in the parameters, and register it here. The ad network should have a\n// header defining the interface for the 'extras' object to create. All\n// networks will have access to the basic settings you've set in this GADRequest\n// (gender, birthday, testing mode, etc.). If you register an extras object\n// that is the same class as one you have registered before, the previous\n// extras will be overwritten.\n- (void)registerAdNetworkExtras:(id<GADAdNetworkExtras>)extras;\n\n// Get the network extras defined for an ad network.\n- (id<GADAdNetworkExtras>)adNetworkExtrasFor:(Class<GADAdNetworkExtras>)clazz;\n\n// Unsets the extras for an ad network. |clazz| is the class which represents\n// that network's extras type.\n- (void)removeAdNetworkExtrasFor:(Class<GADAdNetworkExtras>)clazz;\n\n// Extras sent to the mediation server (if using Mediation). For future use.\n@property (nonatomic, retain) NSDictionary *mediationExtras;\n\n#pragma mark Collecting SDK Information\n\n// Returns the version of the SDK.\n+ (NSString *)sdkVersion;\n\n#pragma mark Testing\n\n// Add the device's identifier into this array for testing purposes.\n@property (nonatomic, retain) NSArray *testDevices;\n\n#pragma mark User Information\n\n// The user's gender may be used to deliver more relevant ads.\n@property (nonatomic, assign) GADGender gender;\n\n// The user's birthday may be used to deliver more relevant ads.\n@property (nonatomic, retain) NSDate *birthday;\n- (void)setBirthdayWithMonth:(NSInteger)m day:(NSInteger)d year:(NSInteger)y;\n\n// The user's current location may be used to deliver more relevant ads.\n// However do not use Core Location just for advertising, make sure it is used\n// for more beneficial reasons as well.  It is both a good idea and part of\n// Apple's guidelines.\n- (void)setLocationWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude\n                       accuracy:(CGFloat)accuracyInMeters;\n\n// When Core Location isn't available but the user's location is known supplying\n// it here may deliver more relevant ads.  It can be any free-form text such as\n// @\"Champs-Elysees Paris\" or @\"94041 US\".\n- (void)setLocationWithDescription:(NSString *)locationDescription;\n\n#pragma mark Contextual Information\n\n// A keyword is a word or phrase describing the current activity of the user\n// such as @\"Sports Scores\".  Each keyword is an NSString in the NSArray.  To\n// clear the keywords set this to nil.\n@property (nonatomic, retain) NSMutableArray *keywords;\n\n// Convenience method for adding keywords one at a time such as @\"Sports Scores\"\n// and then @\"Football\".\n- (void)addKeyword:(NSString *)keyword;\n\n#pragma mark -\n#pragma mark Deprecated Methods\n\n// Accesses the additionalParameters for the \"GoogleAdmob\" ad network. Please\n// use -registerAdNetworkExtras: method above and pass an instance of\n// GADAdMobExtras instead.\n@property (nonatomic, retain) NSDictionary *additionalParameters;\n\n// This property has been deprecated with the latest SDK releases. Please use\n// testDevices.\n@property (nonatomic, getter=isTesting) BOOL testing;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/Admob/GADRequestError.h",
    "content": "//\n//  GADRequestError.h\n//  Google AdMob Ads SDK\n//\n//  Copyright 2011 Google Inc. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@class GADRequest;\n\nextern NSString *kGADErrorDomain;\n\n// NSError codes for GAD error domain.\ntypedef enum {\n  // The ad request is invalid.  The localizedFailureReason error description\n  // will have more details.  Typically this is because the ad did not have the\n  // ad unit ID or root view controller set.\n  kGADErrorInvalidRequest,\n\n  // The ad request was successful, but no ad was returned.\n  kGADErrorNoFill,\n\n  // There was an error loading data from the network.\n  kGADErrorNetworkError,\n\n  // The ad server experienced a failure processing the request.\n  kGADErrorServerError,\n\n  // The current device's OS is below the minimum required version.\n  kGADErrorOSVersionTooLow,\n\n  // The request was unable to be loaded before being timed out.\n  kGADErrorTimeout,\n\n  // Will not send request because the interstitial object has already been\n  // used.\n  kGADErrorInterstitialAlreadyUsed,\n\n  // The mediation response was invalid.\n  kGADErrorMediationDataError,\n\n  // Error finding or creating a mediation ad network adapter.\n  kGADErrorMediationAdapterError,\n\n  // The mediation request was successful, but no ad was returned from any\n  // ad networks.\n  kGADErrorMediationNoFill,\n\n  // Attempting to pass an invalid ad size to an adapter.\n  kGADErrorMediationInvalidAdSize,\n\n} GADErrorCode;\n\n// This class represents the error generated due to invalid request parameters.\n@interface GADRequestError : NSError\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/AdsAdmob.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import <Foundation/Foundation.h>\n#import \"InterfaceAds.h\"\n#import \"GADBannerView.h\"\n#import \"GADBannerViewDelegate.h\"\n\ntypedef enum {\n    kSizeBanner = 1,\n    kSizeIABMRect,\n    kSizeIABBanner,\n    kSizeIABLeaderboard,\n    kSizeSkyscraper,\n} AdmobSizeEnum;\n\ntypedef enum {\n    kTypeBanner = 1,\n    kTypeFullScreen,\n} AdmobType;\n\n@interface AdsAdmob : NSObject <InterfaceAds, GADBannerViewDelegate>\n{\n}\n\n@property BOOL debug;\n@property (copy, nonatomic) NSString* strPublishID;\n@property (assign, nonatomic) GADBannerView* bannerView;\n@property (assign, nonatomic) NSMutableArray* testDeviceIDs;\n\n/**\n interfaces from InterfaceAds\n */\n- (void) configDeveloperInfo: (NSMutableDictionary*) devInfo;\n- (void) showAds: (NSMutableDictionary*) info position:(int) pos;\n- (void) hideAds: (NSMutableDictionary*) info;\n- (void) queryPoints;\n- (void) spendPoints: (int) points;\n- (void) setDebugMode: (BOOL) isDebugMode;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n/**\n interface for Admob SDK\n */\n- (void) addTestDevice: (NSString*) deviceID;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/AdsAdmob.m",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"AdsAdmob.h\"\n#import \"AdsWrapper.h\"\n\n#define OUTPUT_LOG(...)     if (self.debug) NSLog(__VA_ARGS__);\n\n@implementation AdsAdmob\n\n@synthesize debug = __debug;\n@synthesize strPublishID = __PublishID;\n@synthesize testDeviceIDs = __TestDeviceIDs;\n\n- (void) dealloc\n{\n    if (self.bannerView != nil) {\n        [self.bannerView release];\n        self.bannerView = nil;\n    }\n\n    if (self.testDeviceIDs != nil) {\n        [self.testDeviceIDs release];\n        self.testDeviceIDs = nil;\n    }\n    [super dealloc];\n}\n\n#pragma mark InterfaceAds impl\n\n- (void) configDeveloperInfo: (NSMutableDictionary*) devInfo\n{\n    self.strPublishID = (NSString*) [devInfo objectForKey:@\"AdmobID\"];\n}\n\n- (void) showAds: (NSMutableDictionary*) info position:(int) pos\n{\n    if (self.strPublishID == nil ||\n        [self.strPublishID length] == 0) {\n        OUTPUT_LOG(@\"configDeveloperInfo() not correctly invoked in Admob!\");\n        return;\n    }\n\n    NSString* strType = [info objectForKey:@\"AdmobType\"];\n    int type = [strType intValue];\n    switch (type) {\n    case kTypeBanner:\n        {\n            NSString* strSize = [info objectForKey:@\"AdmobSizeEnum\"];\n            int sizeEnum = [strSize intValue];\n            [self showBanner:sizeEnum atPos:pos];\n            break;\n        }\n    case kTypeFullScreen:\n        OUTPUT_LOG(@\"Now not support full screen view in Admob\");\n        break;\n    default:\n        OUTPUT_LOG(@\"The value of 'AdmobType' is wrong (should be 1 or 2)\");\n        break;\n    }\n}\n\n- (void) hideAds: (NSMutableDictionary*) info\n{\n    NSString* strType = [info objectForKey:@\"AdmobType\"];\n    int type = [strType intValue];\n    switch (type) {\n    case kTypeBanner:\n        {\n            if (nil != self.bannerView) {\n                [self.bannerView removeFromSuperview];\n                [self.bannerView release];\n                self.bannerView = nil;\n            }\n            break;\n        }\n    case kTypeFullScreen:\n        OUTPUT_LOG(@\"Now not support full screen view in Admob\");\n        break;\n    default:\n        OUTPUT_LOG(@\"The value of 'AdmobType' is wrong (should be 1 or 2)\");\n        break;\n    }\n}\n\n- (void) queryPoints\n{\n    OUTPUT_LOG(@\"Admob not support query points!\");\n}\n\n- (void) spendPoints: (int) points\n{\n    OUTPUT_LOG(@\"Admob not support spend points!\");\n}\n\n- (void) setDebugMode: (BOOL) isDebugMode\n{\n    self.debug = isDebugMode;\n}\n\n- (NSString*) getSDKVersion\n{\n    return @\"6.4.2\";\n}\n\n- (NSString*) getPluginVersion\n{\n    return @\"0.2.0\";\n}\n\n- (void) showBanner: (int) sizeEnum atPos:(int) pos\n{\n    GADAdSize size = kGADAdSizeBanner;\n    switch (sizeEnum) {\n        case kSizeBanner:\n            size = kGADAdSizeBanner;\n            break;\n        case kSizeIABMRect:\n            size = kGADAdSizeMediumRectangle;\n            break;\n        case kSizeIABBanner:\n            size = kGADAdSizeFullBanner;\n            break;\n        case kSizeIABLeaderboard:\n            size = kGADAdSizeLeaderboard;\n            break;\n        case kSizeSkyscraper:\n            size = kGADAdSizeSkyscraper;\n            break;\n        default:\n            break;\n    }\n    if (nil != self.bannerView) {\n        [self.bannerView removeFromSuperview];\n        [self.bannerView release];\n        self.bannerView = nil;\n    }\n    \n    self.bannerView = [[GADBannerView alloc] initWithAdSize:size];\n    self.bannerView.adUnitID = self.strPublishID;\n    self.bannerView.delegate = self;\n    [self.bannerView setRootViewController:[AdsWrapper getCurrentRootViewController]];\n    [AdsWrapper addAdView:self.bannerView atPos:pos];\n    \n    GADRequest* request = [GADRequest request];\n    request.testDevices = [NSArray arrayWithArray:self.testDeviceIDs];\n    [self.bannerView loadRequest:request];\n}\n\n#pragma mark interface for Admob SDK\n\n- (void) addTestDevice: (NSString*) deviceID\n{\n    if (nil == self.testDeviceIDs) {\n        self.testDeviceIDs = [NSMutableArray alloc];\n        [self.testDeviceIDs addObject:GAD_SIMULATOR_ID];\n    }\n    [self.testDeviceIDs addObject:deviceID];\n}\n\n#pragma mark GADBannerViewDelegate impl\n\n// Since we've received an ad, let's go ahead and set the frame to display it.\n- (void)adViewDidReceiveAd:(GADBannerView *)adView {\n    NSLog(@\"Received ad\");\n    [AdsWrapper onAdsResult:self withRet:kAdsReceived withMsg:@\"Ads request received success!\"];\n}\n\n- (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error {\n    NSLog(@\"Failed to receive ad with error: %@\", [error localizedFailureReason]);\n    int errorNo = kUnknownError;\n    switch ([error code]) {\n    case kGADErrorNetworkError:\n        errorNo = kNetworkError;\n        break;\n    default:\n        break;\n    }\n    [AdsWrapper onAdsResult:self withRet:errorNo withMsg:[error localizedDescription]];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/admob/proj.ios/PluginAdmob.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tFADC44AB176EA82000B2D5ED /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC44AA176EA82000B2D5ED /* Foundation.framework */; };\n\t\tFADC44C5176EA84500B2D5ED /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FADC44C2176EA84500B2D5ED /* libGoogleAdMobAds.a */; };\n\t\tFADC44C6176EA84500B2D5ED /* AdsAdmob.m in Sources */ = {isa = PBXBuildFile; fileRef = FADC44C4176EA84500B2D5ED /* AdsAdmob.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tFADC44A5176EA82000B2D5ED /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/${PRODUCT_NAME}\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\tFADC44A7176EA82000B2D5ED /* libPluginAdmob.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPluginAdmob.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFADC44AA176EA82000B2D5ED /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\tFADC44B9176EA84500B2D5ED /* GADAdMobExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADAdMobExtras.h; sourceTree = \"<group>\"; };\n\t\tFADC44BA176EA84500B2D5ED /* GADAdNetworkExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADAdNetworkExtras.h; sourceTree = \"<group>\"; };\n\t\tFADC44BB176EA84500B2D5ED /* GADAdSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADAdSize.h; sourceTree = \"<group>\"; };\n\t\tFADC44BC176EA84500B2D5ED /* GADBannerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADBannerView.h; sourceTree = \"<group>\"; };\n\t\tFADC44BD176EA84500B2D5ED /* GADBannerViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADBannerViewDelegate.h; sourceTree = \"<group>\"; };\n\t\tFADC44BE176EA84500B2D5ED /* GADInterstitial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADInterstitial.h; sourceTree = \"<group>\"; };\n\t\tFADC44BF176EA84500B2D5ED /* GADInterstitialDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADInterstitialDelegate.h; sourceTree = \"<group>\"; };\n\t\tFADC44C0176EA84500B2D5ED /* GADRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADRequest.h; sourceTree = \"<group>\"; };\n\t\tFADC44C1176EA84500B2D5ED /* GADRequestError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADRequestError.h; sourceTree = \"<group>\"; };\n\t\tFADC44C2176EA84500B2D5ED /* libGoogleAdMobAds.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libGoogleAdMobAds.a; sourceTree = \"<group>\"; };\n\t\tFADC44C3176EA84500B2D5ED /* AdsAdmob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdsAdmob.h; sourceTree = \"<group>\"; };\n\t\tFADC44C4176EA84500B2D5ED /* AdsAdmob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdsAdmob.m; sourceTree = \"<group>\"; };\n\t\tFADC44C7176EA85F00B2D5ED /* PluginAdmob-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"PluginAdmob-Prefix.pch\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tFADC44A4176EA82000B2D5ED /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFADC44AB176EA82000B2D5ED /* Foundation.framework in Frameworks */,\n\t\t\t\tFADC44C5176EA84500B2D5ED /* libGoogleAdMobAds.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tFADC449E176EA82000B2D5ED = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADC44C7176EA85F00B2D5ED /* PluginAdmob-Prefix.pch */,\n\t\t\t\tFADC44B8176EA84500B2D5ED /* Admob */,\n\t\t\t\tFADC44C3176EA84500B2D5ED /* AdsAdmob.h */,\n\t\t\t\tFADC44C4176EA84500B2D5ED /* AdsAdmob.m */,\n\t\t\t\tFADC44A9176EA82000B2D5ED /* Frameworks */,\n\t\t\t\tFADC44A8176EA82000B2D5ED /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFADC44A8176EA82000B2D5ED /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADC44A7176EA82000B2D5ED /* libPluginAdmob.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFADC44A9176EA82000B2D5ED /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADC44AA176EA82000B2D5ED /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFADC44B8176EA84500B2D5ED /* Admob */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADC44B9176EA84500B2D5ED /* GADAdMobExtras.h */,\n\t\t\t\tFADC44BA176EA84500B2D5ED /* GADAdNetworkExtras.h */,\n\t\t\t\tFADC44BB176EA84500B2D5ED /* GADAdSize.h */,\n\t\t\t\tFADC44BC176EA84500B2D5ED /* GADBannerView.h */,\n\t\t\t\tFADC44BD176EA84500B2D5ED /* GADBannerViewDelegate.h */,\n\t\t\t\tFADC44BE176EA84500B2D5ED /* GADInterstitial.h */,\n\t\t\t\tFADC44BF176EA84500B2D5ED /* GADInterstitialDelegate.h */,\n\t\t\t\tFADC44C0176EA84500B2D5ED /* GADRequest.h */,\n\t\t\t\tFADC44C1176EA84500B2D5ED /* GADRequestError.h */,\n\t\t\t\tFADC44C2176EA84500B2D5ED /* libGoogleAdMobAds.a */,\n\t\t\t);\n\t\t\tpath = Admob;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tFADC44A6176EA82000B2D5ED /* PluginAdmob */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = FADC44B5176EA82000B2D5ED /* Build configuration list for PBXNativeTarget \"PluginAdmob\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tFADC44A3176EA82000B2D5ED /* Sources */,\n\t\t\t\tFADC44A4176EA82000B2D5ED /* Frameworks */,\n\t\t\t\tFADC44A5176EA82000B2D5ED /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = PluginAdmob;\n\t\t\tproductName = PluginAdmob;\n\t\t\tproductReference = FADC44A7176EA82000B2D5ED /* libPluginAdmob.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tFADC449F176EA82000B2D5ED /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0460;\n\t\t\t\tORGANIZATIONNAME = \"cocos2d-x\";\n\t\t\t};\n\t\t\tbuildConfigurationList = FADC44A2176EA82000B2D5ED /* Build configuration list for PBXProject \"PluginAdmob\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = FADC449E176EA82000B2D5ED;\n\t\t\tproductRefGroup = FADC44A8176EA82000B2D5ED /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tFADC44A6176EA82000B2D5ED /* PluginAdmob */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tFADC44A3176EA82000B2D5ED /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFADC44C6176EA84500B2D5ED /* AdsAdmob.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\tFADC44B3176EA82000B2D5ED /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 6.1;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFADC44B4176EA82000B2D5ED /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 6.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tFADC44B6176EA82000B2D5ED /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/PluginAdmob.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginAdmob-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/Admob\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFADC44B7176EA82000B2D5ED /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/PluginAdmob.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginAdmob-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/Admob\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tFADC44A2176EA82000B2D5ED /* Build configuration list for PBXProject \"PluginAdmob\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFADC44B3176EA82000B2D5ED /* Debug */,\n\t\t\t\tFADC44B4176EA82000B2D5ED /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tFADC44B5176EA82000B2D5ED /* Build configuration list for PBXNativeTarget \"PluginAdmob\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFADC44B6176EA82000B2D5ED /* Debug */,\n\t\t\t\tFADC44B7176EA82000B2D5ED /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = FADC449F176EA82000B2D5ED /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/alipay_plugin.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginAlipay</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libIAPAlipay\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.INTERNET\" />\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n        <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n    </permissionCfg>\n</manifestConfig> \n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginAlipay\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/AlixId.java",
    "content": "/*\n * Copyright (C) 2010 The MobileSecurePay Project\n * All right reserved.\n * author: shiqun.shi@alipay.com\n */\n\npackage org.cocos2dx.plugin;\n\npublic final class AlixId\n{\n\tpublic static final int BASE_ID \t\t\t= 0;\n\tpublic static final int RQF_PAY \t\t\t= BASE_ID + 1;\n\tpublic static final int RQF_INSTALL_CHECK = RQF_PAY + 1;\n}\n\nfinal class AlixDefine\n{\n\tpublic static final String IMEI \t\t\t= \"imei\";\n\tpublic static final String IMSI \t\t\t= \"imsi\";\n\tpublic static final String KEY \t\t\t= \"key\";\n\tpublic static final String USER_AGENT\t= \"user_agent\";\n\tpublic static final String VERSION\t\t= \"version\";\n\tpublic static final String DEVICE\t\t= \"device\";\n\tpublic static final String SID\t\t\t= \"sid\";\n\tpublic static final String partner\t\t= \"partner\";\n\tpublic static final String charset\t\t= \"charset\";\n\tpublic static final String sign_type\t\t= \"sign_type\";\n\tpublic static final String sign\t\t\t= \"sign\";\n\t\n\t\n\tpublic static final String URL\t\t= \"URL\";\n\tpublic static final String split\t\t= \"&\";\n\t\n\tpublic static final String AlixPay\t=  \"AlixPay\";\n\n\tpublic static final String action\t\t=  \"action\";\n\tpublic static final String actionUpdate=  \"update\";\n\tpublic static final String data\t\t=  \"data\";\n\tpublic static final String platform\t=  \"platform\";\n}"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/Base64.java",
    "content": "/*\n * Copyright (C) 2010 The MobileSecurePay Project\n * All right reserved.\n * author: shiqun.shi@alipay.com\n */\n\npackage org.cocos2dx.plugin;\n\n/**\n * Base64 工具类\n * \n */\npublic final class Base64 {\n\n\tstatic private final int BASELENGTH = 128;\n\tstatic private final int LOOKUPLENGTH = 64;\n\tstatic private final int TWENTYFOURBITGROUP = 24;\n\tstatic private final int EIGHTBIT = 8;\n\tstatic private final int SIXTEENBIT = 16;\n\tstatic private final int FOURBYTE = 4;\n\tstatic private final int SIGN = -128;\n\tstatic private final char PAD = '=';\n\tstatic private final boolean fDebug = false;\n\tstatic final private byte[] base64Alphabet = new byte[BASELENGTH];\n\tstatic final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];\n\n\tstatic {\n\t\tfor (int i = 0; i < BASELENGTH; ++i) {\n\t\t\tbase64Alphabet[i] = -1;\n\t\t}\n\t\tfor (int i = 'Z'; i >= 'A'; i--) {\n\t\t\tbase64Alphabet[i] = (byte) (i - 'A');\n\t\t}\n\t\tfor (int i = 'z'; i >= 'a'; i--) {\n\t\t\tbase64Alphabet[i] = (byte) (i - 'a' + 26);\n\t\t}\n\n\t\tfor (int i = '9'; i >= '0'; i--) {\n\t\t\tbase64Alphabet[i] = (byte) (i - '0' + 52);\n\t\t}\n\n\t\tbase64Alphabet['+'] = 62;\n\t\tbase64Alphabet['/'] = 63;\n\n\t\tfor (int i = 0; i <= 25; i++) {\n\t\t\tlookUpBase64Alphabet[i] = (char) ('A' + i);\n\t\t}\n\n\t\tfor (int i = 26, j = 0; i <= 51; i++, j++) {\n\t\t\tlookUpBase64Alphabet[i] = (char) ('a' + j);\n\t\t}\n\n\t\tfor (int i = 52, j = 0; i <= 61; i++, j++) {\n\t\t\tlookUpBase64Alphabet[i] = (char) ('0' + j);\n\t\t}\n\t\tlookUpBase64Alphabet[62] = (char) '+';\n\t\tlookUpBase64Alphabet[63] = (char) '/';\n\n\t}\n\n\tprivate static boolean isWhiteSpace(char octect) {\n\t\treturn (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);\n\t}\n\n\tprivate static boolean isPad(char octect) {\n\t\treturn (octect == PAD);\n\t}\n\n\tprivate static boolean isData(char octect) {\n\t\treturn (octect < BASELENGTH && base64Alphabet[octect] != -1);\n\t}\n\n\t/**\n\t * Encodes hex octects into Base64\n\t * \n\t * @param binaryData\n\t *            Array containing binaryData\n\t * @return Encoded Base64 array\n\t */\n\tpublic static String encode(byte[] binaryData) {\n\n\t\tif (binaryData == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tint lengthDataBits = binaryData.length * EIGHTBIT;\n\t\tif (lengthDataBits == 0) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\tint fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;\n\t\tint numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;\n\t\tint numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1\n\t\t\t\t: numberTriplets;\n\t\tchar encodedData[] = null;\n\n\t\tencodedData = new char[numberQuartet * 4];\n\n\t\tbyte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;\n\n\t\tint encodedIndex = 0;\n\t\tint dataIndex = 0;\n\t\tif (fDebug) {\n\t\t\tSystem.out.println(\"number of triplets = \" + numberTriplets);\n\t\t}\n\n\t\tfor (int i = 0; i < numberTriplets; i++) {\n\t\t\tb1 = binaryData[dataIndex++];\n\t\t\tb2 = binaryData[dataIndex++];\n\t\t\tb3 = binaryData[dataIndex++];\n\n\t\t\tif (fDebug) {\n\t\t\t\tSystem.out.println(\"b1= \" + b1 + \", b2= \" + b2 + \", b3= \" + b3);\n\t\t\t}\n\n\t\t\tl = (byte) (b2 & 0x0f);\n\t\t\tk = (byte) (b1 & 0x03);\n\n\t\t\tbyte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2)\n\t\t\t\t\t: (byte) ((b1) >> 2 ^ 0xc0);\n\t\t\tbyte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4)\n\t\t\t\t\t: (byte) ((b2) >> 4 ^ 0xf0);\n\t\t\tbyte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6)\n\t\t\t\t\t: (byte) ((b3) >> 6 ^ 0xfc);\n\n\t\t\tif (fDebug) {\n\t\t\t\tSystem.out.println(\"val2 = \" + val2);\n\t\t\t\tSystem.out.println(\"k4   = \" + (k << 4));\n\t\t\t\tSystem.out.println(\"vak  = \" + (val2 | (k << 4)));\n\t\t\t}\n\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[val1];\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];\n\t\t}\n\n\t\t// form integral number of 6-bit groups\n\t\tif (fewerThan24bits == EIGHTBIT) {\n\t\t\tb1 = binaryData[dataIndex];\n\t\t\tk = (byte) (b1 & 0x03);\n\t\t\tif (fDebug) {\n\t\t\t\tSystem.out.println(\"b1=\" + b1);\n\t\t\t\tSystem.out.println(\"b1<<2 = \" + (b1 >> 2));\n\t\t\t}\n\t\t\tbyte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2)\n\t\t\t\t\t: (byte) ((b1) >> 2 ^ 0xc0);\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[val1];\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];\n\t\t\tencodedData[encodedIndex++] = PAD;\n\t\t\tencodedData[encodedIndex++] = PAD;\n\t\t} else if (fewerThan24bits == SIXTEENBIT) {\n\t\t\tb1 = binaryData[dataIndex];\n\t\t\tb2 = binaryData[dataIndex + 1];\n\t\t\tl = (byte) (b2 & 0x0f);\n\t\t\tk = (byte) (b1 & 0x03);\n\n\t\t\tbyte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2)\n\t\t\t\t\t: (byte) ((b1) >> 2 ^ 0xc0);\n\t\t\tbyte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4)\n\t\t\t\t\t: (byte) ((b2) >> 4 ^ 0xf0);\n\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[val1];\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];\n\t\t\tencodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];\n\t\t\tencodedData[encodedIndex++] = PAD;\n\t\t}\n\n\t\treturn new String(encodedData);\n\t}\n\n\t/**\n\t * Decodes Base64 data into octects\n\t * \n\t * @param encoded\n\t *            string containing Base64 data\n\t * @return Array containind decoded data.\n\t */\n\tpublic static byte[] decode(String encoded) {\n\n\t\tif (encoded == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tchar[] base64Data = encoded.toCharArray();\n\t\t// remove white spaces\n\t\tint len = removeWhiteSpace(base64Data);\n\n\t\tif (len % FOURBYTE != 0) {\n\t\t\treturn null;// should be divisible by four\n\t\t}\n\n\t\tint numberQuadruple = (len / FOURBYTE);\n\n\t\tif (numberQuadruple == 0) {\n\t\t\treturn new byte[0];\n\t\t}\n\n\t\tbyte decodedData[] = null;\n\t\tbyte b1 = 0, b2 = 0, b3 = 0, b4 = 0;\n\t\tchar d1 = 0, d2 = 0, d3 = 0, d4 = 0;\n\n\t\tint i = 0;\n\t\tint encodedIndex = 0;\n\t\tint dataIndex = 0;\n\t\tdecodedData = new byte[(numberQuadruple) * 3];\n\n\t\tfor (; i < numberQuadruple - 1; i++) {\n\n\t\t\tif (!isData((d1 = base64Data[dataIndex++]))\n\t\t\t\t\t|| !isData((d2 = base64Data[dataIndex++]))\n\t\t\t\t\t|| !isData((d3 = base64Data[dataIndex++]))\n\t\t\t\t\t|| !isData((d4 = base64Data[dataIndex++]))) {\n\t\t\t\treturn null;\n\t\t\t}// if found \"no data\" just return null\n\n\t\t\tb1 = base64Alphabet[d1];\n\t\t\tb2 = base64Alphabet[d2];\n\t\t\tb3 = base64Alphabet[d3];\n\t\t\tb4 = base64Alphabet[d4];\n\n\t\t\tdecodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);\n\t\t\tdecodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));\n\t\t\tdecodedData[encodedIndex++] = (byte) (b3 << 6 | b4);\n\t\t}\n\n\t\tif (!isData((d1 = base64Data[dataIndex++]))\n\t\t\t\t|| !isData((d2 = base64Data[dataIndex++]))) {\n\t\t\treturn null;// if found \"no data\" just return null\n\t\t}\n\n\t\tb1 = base64Alphabet[d1];\n\t\tb2 = base64Alphabet[d2];\n\n\t\td3 = base64Data[dataIndex++];\n\t\td4 = base64Data[dataIndex++];\n\t\tif (!isData((d3)) || !isData((d4))) {// Check if they are PAD characters\n\t\t\tif (isPad(d3) && isPad(d4)) {\n\t\t\t\tif ((b2 & 0xf) != 0)// last 4 bits should be zero\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tbyte[] tmp = new byte[i * 3 + 1];\n\t\t\t\tSystem.arraycopy(decodedData, 0, tmp, 0, i * 3);\n\t\t\t\ttmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);\n\t\t\t\treturn tmp;\n\t\t\t} else if (!isPad(d3) && isPad(d4)) {\n\t\t\t\tb3 = base64Alphabet[d3];\n\t\t\t\tif ((b3 & 0x3) != 0)// last 2 bits should be zero\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tbyte[] tmp = new byte[i * 3 + 2];\n\t\t\t\tSystem.arraycopy(decodedData, 0, tmp, 0, i * 3);\n\t\t\t\ttmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);\n\t\t\t\ttmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));\n\t\t\t\treturn tmp;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else { // No PAD e.g 3cQl\n\t\t\tb3 = base64Alphabet[d3];\n\t\t\tb4 = base64Alphabet[d4];\n\t\t\tdecodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);\n\t\t\tdecodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));\n\t\t\tdecodedData[encodedIndex++] = (byte) (b3 << 6 | b4);\n\n\t\t}\n\n\t\treturn decodedData;\n\t}\n\n\t/**\n\t * remove WhiteSpace from MIME containing encoded Base64 data.\n\t * \n\t * @param data\n\t *            the byte array of base64 data (with WS)\n\t * @return the new length\n\t */\n\tprivate static int removeWhiteSpace(char[] data) {\n\t\tif (data == null) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// count characters that's not whitespace\n\t\tint newSize = 0;\n\t\tint len = data.length;\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tif (!isWhiteSpace(data[i])) {\n\t\t\t\tdata[newSize++] = data[i];\n\t\t\t}\n\t\t}\n\t\treturn newSize;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/BaseHelper.java",
    "content": "/*\n * Copyright (C) 2010 The MobileSecurePay Project\n * All right reserved.\n * author: shiqun.shi@alipay.com\n */\n\npackage org.cocos2dx.plugin;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\n\nimport org.json.JSONObject;\n\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.app.ProgressDialog;\nimport android.content.Context;\n\n/**\n * 工具类\n * \n */\npublic class BaseHelper {\n\n\t/**\n\t * 流转字符串方法\n\t * \n\t * @param is\n\t * @return\n\t */\n\tpublic static String convertStreamToString(InputStream is) {\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(is));\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString line = null;\n\t\ttry {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tsb.append(line);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}\n\n\t/**\n\t * 显示dialog\n\t * \n\t * @param context\n\t *            环境\n\t * @param strTitle\n\t *            标题\n\t * @param strText\n\t *            内容\n\t * @param icon\n\t *            图标\n\t */\n\tpublic static void showDialog(Activity context, String strTitle,\n\t\t\tString strText, int icon) {\n\t\tAlertDialog.Builder tDialog = new AlertDialog.Builder(context);\n\t\ttDialog.setIcon(icon);\n\t\ttDialog.setTitle(strTitle);\n\t\ttDialog.setMessage(strText);\n\t\ttDialog.setPositiveButton(\"确定\", null);\n\t\ttDialog.show();\n\t}\n\n\t/**\n\t * 打印信息\n\t * \n\t * @param tag\n\t *            标签\n\t * @param info\n\t *            信息\n\t */\n\tpublic static void log(String tag, String info) {\n\t\t// Log.d(tag, info);\n\t}\n\n\t/**\n\t * 获取权限\n\t * \n\t * @param permission\n\t *            权限\n\t * @param path\n\t *            路径\n\t */\n\tpublic static void chmod(String permission, String path) {\n\t\ttry {\n\t\t\tString command = \"chmod \" + permission + \" \" + path;\n\t\t\tRuntime runtime = Runtime.getRuntime();\n\t\t\truntime.exec(command);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\t//\n\t// show the progress bar.\n\t/**\n\t * 显示进度条\n\t * \n\t * @param context\n\t *            环境\n\t * @param title\n\t *            标题\n\t * @param message\n\t *            信息\n\t * @param indeterminate\n\t *            确定性\n\t * @param cancelable\n\t *            可撤销\n\t * @return\n\t */\n\tpublic static ProgressDialog showProgress(Context context,\n\t\t\tCharSequence title, CharSequence message, boolean indeterminate,\n\t\t\tboolean cancelable) {\n\t\tProgressDialog dialog = new ProgressDialog(context);\n\t\tdialog.setTitle(title);\n\t\tdialog.setMessage(message);\n\t\tdialog.setIndeterminate(indeterminate);\n\t\tdialog.setCancelable(false);\n\t\t// dialog.setDefaultButton(false);\n\t\tdialog.setOnCancelListener(new IAPAlipay.AlixOnCancelListener(\n\t\t\t\t(Activity) context));\n\n\t\tdialog.show();\n\t\treturn dialog;\n\t}\n\n\t/**\n\t * 字符串转json对象\n\t * @param str\n\t * @param split\n\t * @return\n\t */\n\tpublic static JSONObject string2JSON(String str, String split) {\n\t\tJSONObject json = new JSONObject();\n\t\ttry {\n\t\t\tString[] arrStr = str.split(split);\n\t\t\tfor (int i = 0; i < arrStr.length; i++) {\n\t\t\t\tString[] arrKeyValue = arrStr[i].split(\"=\");\n\t\t\t\tjson.put(arrKeyValue[0],\n\t\t\t\t\t\tarrStr[i].substring(arrKeyValue[0].length() + 1));\n\t\t\t}\n\t\t}\n\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn json;\n\t}\n}"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/IAPAlipay.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.net.URLEncoder;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Hashtable;\n\nimport android.app.Activity;\nimport android.app.ProgressDialog;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.net.ConnectivityManager;\nimport android.net.NetworkInfo;\nimport android.os.Handler;\nimport android.os.Message;\nimport android.util.Log;\nimport android.view.KeyEvent;\n\npublic class IAPAlipay implements InterfaceIAP {\n\n\tprivate static final String LOG_TAG = \"IAPAlipay\";\n\tprivate static Activity mContext = null;\n\tprivate static boolean bDebug = false;\n\tprivate static Handler mHandler = null;\n\tprivate static IAPAlipay mAdapter = null;\n\n\tprotected static void LogE(String msg, Exception e) {\n\t\tLog.e(LOG_TAG, msg, e);\n\t\te.printStackTrace();\n\t}\n\n\tprotected static void LogD(String msg) {\n\t\tif (bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n\n\tpublic IAPAlipay(Context context) {\n\t\tmContext = (Activity) context;\n\t\tmAdapter = this;\n\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinitUIHandle();\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n\t\tLogD(\"initDeveloperInfo invoked \" + cpInfo.toString());\n\t\ttry {\n\t\t\tPartnerConfig.PARTNER = cpInfo.get(\"AlipayPartner\");\n\t\t\tPartnerConfig.SELLER = cpInfo.get(\"AlipaySeller\");\n\t\t\tPartnerConfig.RSA_PRIVATE = cpInfo.get(\"AlipayRsaPrivate\");\n\t\t\tPartnerConfig.RSA_ALIPAY_PUBLIC = cpInfo.get(\"AlipayPublic\");\n\t\t\tPartnerConfig.ALIPAY_PLUGIN_NAME = cpInfo.get(\"AlipayPluginName\");\n\n\t\t\tstrPayAccount = cpInfo.get(\"AlipayRoyPayAccount\");\n\t\t\tstrReceiveAccount = cpInfo.get(\"AlipayRoyReceiveAccount\");\n\t\t\tfPayPercent = ((cpInfo.get(\"AlipayRoyPercent\") == null) ? 0.0f : Float.parseFloat(cpInfo.get(\"AlipayRoyPercent\")));\n\t\t\tstrRoyTip = cpInfo.get(\"AlipayRoyTip\");\n\t\t\tstrNotifyUrl = ((null == cpInfo.get(\"AlipayNotifyUrl\")) ? \"\" : cpInfo.get(\"AlipayNotifyUrl\"));\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Developer info is wrong!\", e);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void payForProduct(Hashtable<String, String> info) {\n\t\tLogD(\"payForProduct invoked \" + info.toString());\n\t\tif (! networkReachable()) {\n\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"网络不可用\");\n\t\t\treturn;\n\t\t}\n\n\t\tfinal Hashtable<String, String> productInfo = info;\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tMobileSecurePayHelper mspHelper = new MobileSecurePayHelper(mContext);\n\t\t\t\tboolean bInstalled = mspHelper.detectMobile_sp();\n\t\t\t\tif (! bInstalled) {\n\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"未安装支付宝插件\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// start pay for this order.\n\t\t\t\t// 根据订单信息开始进行支付\n\t\t\t\ttry {\n\t\t\t\t\t// prepare the order info.\n\t\t\t\t\t// 准备订单信息\n\t\t\t\t\tString orderInfo = getOrderInfo(productInfo);\n\t\t\t\t\t// 这里根据签名方式对订单信息进行签名\n\t\t\t\t\tString signType = getSignType();\n\t\t\t\t\tString strsign = sign(signType, orderInfo);\n\t\t\t\t\t// 对签名进行编码\n\t\t\t\t\tstrsign = URLEncoder.encode(strsign);\n\t\t\t\t\t// 组装好参数\n\t\t\t\t\tString info = orderInfo + \"&sign=\" + \"\\\"\" + strsign + \"\\\"\" + \"&\" + getSignType();\n\t\t\t\t\tLogD(\"pay info : \" + info);\n\t\t\t\t\t// start the pay.\n\t\t\t\t\t// 调用pay方法进行支付\n\t\t\t\t\tMobileSecurePayer msp = new MobileSecurePayer();\n\t\t\t\t\tboolean bRet = msp.pay(info, mHandler, AlixId.RQF_PAY, mContext);\n\n\t\t\t\t\tif (bRet) {\n\t\t\t\t\t\t// show the progress bar to indicate that we have started\n\t\t\t\t\t\t// paying.\n\t\t\t\t\t\t// 显示“正在支付”进度条\n\t\t\t\t\t\tcloseProgress();\n\t\t\t\t\t\tmProgress = BaseHelper.showProgress(mContext, null, \"正在支付\", false, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"支付失败\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tLogE(\"Remote call failed\", ex);\n\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"remote call failed\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void setDebugMode(boolean debug) {\n\t\tbDebug = debug;\n\t}\n\n\t@Override\n\tpublic String getSDKVersion() {\n\t\treturn \"Unknown version\";\n\t}\n\n\tstatic class AlixOnCancelListener implements DialogInterface.OnCancelListener {\n\t\tActivity mcontext;\n\t\tAlixOnCancelListener(Activity context) {\n\t\t\tmcontext = context;\n\t\t}\n\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmcontext.onKeyDown(KeyEvent.KEYCODE_BACK, null);\n\t\t}\n\t}\n\n\tprivate static void initUIHandle() {\n\t\t//\n\t\t// the handler use to receive the pay result.\n\t\t// 这里接收支付结果，支付宝手机端同步通知\n\t\tmHandler = new Handler() {\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\ttry {\n\t\t\t\t\tString strRet = (String) msg.obj;\n\t\t\t\t\tLogD(\"handle msg : \" + msg.toString());\n\n\t\t\t\t\tswitch (msg.what) {\n\t\t\t\t\tcase AlixId.RQF_PAY: {\n\t\t\t\t\t\tLogD(\"msg.what is RQF_PAY\");\n\t\t\t\t\t\tmAdapter.closeProgress();\n\n\t\t\t\t\t\t// 从通知中获取参数\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// 获取交易状态，具体状态代码请参看文档\n\t\t\t\t\t\t\tString memo = \"memo=\";\n\t\t\t\t\t\t\tint imemoStart = strRet.indexOf(\"memo=\");\n\t\t\t\t\t\t\timemoStart += memo.length();\n\t\t\t\t\t\t\tint imemoEnd = strRet.indexOf(\";result=\");\n\t\t\t\t\t\t\tmemo = strRet.substring(imemoStart, imemoEnd);\n\t\t\t\t\t\t\t// 对通知进行验签\n\t\t\t\t\t\t\tResultChecker resultChecker = new ResultChecker(strRet);\n\n\t\t\t\t\t\t\tint retVal = resultChecker.checkSign();\n\t\t\t\t\t\t\t// 返回验签结果以及交易状态\n\t\t\t\t\t\t\tif (retVal == ResultChecker.RESULT_CHECK_SIGN_FAILED) {\n\t\t\t\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"签名验证失败\");\n\t\t\t\t\t\t\t} else if (retVal == ResultChecker.RESULT_CHECK_SIGN_SUCCEED && resultChecker.isPayOk()) {\n\t\t\t\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_SUCCESS, \"支付成功\");\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"支付失败\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"结果解析失败\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmAdapter.closeProgress();\n\t\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"支付失败\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tsuper.handleMessage(msg);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t * get the selected order info for pay. 获取商品订单信息\n\t * \n\t * @param position\n\t *            商品在列表中的位置\n\t * @return\n\t */\n\tprivate static String strPayAccount = \"\";\n\tprivate static String strReceiveAccount = \"\";\n\tprivate static float fPayPercent = 0.0f;\n\tprivate static String strRoyTip = \"\";\n\tprivate static String strNotifyUrl = \"\";\n\tprivate String getOrderInfo(Hashtable<String, String> info) {\n\t\tString strRet = null;\n\t\ttry {\n\t\t\tfloat price = Float.parseFloat(info.get(\"productPrice\"));//IAPProducts.getProductPrice(productID);\n\t\t\tString productName = info.get(\"productName\");\n\t\t\tString productDesc = info.get(\"productDesc\");\n\t\t\tString royParam = \"\";\n\t\t\tif (fPayPercent > 0 ) {\n\t\t\t\tfloat royValue = fPayPercent * price;\n\t\t\t\troyParam = strPayAccount + \"^\" + strReceiveAccount + \"^\" + royValue + \"^\"+ strRoyTip;\n\t\t\t\troyParam = \"&royalty_parameters=\\\"\"+ royParam + \"\\\"\" + \"&royalty_type=\\\"10\" + \"\\\"\";\n\t\t\t}\n\n\t\t\tstrRet = \"partner=\\\"\" + PartnerConfig.PARTNER + \"\\\"\"\n\t\t\t\t\t\t+ \"&seller=\\\"\" + PartnerConfig.SELLER + \"\\\"\"\n\t\t\t\t\t\t+ \"&out_trade_no=\\\"\" + getOutTradeNo() + \"\\\"\"\n\t\t\t\t\t\t+ \"&subject=\\\"\" + productName + \"\\\"\"\n\t\t\t\t\t\t+ \"&body=\\\"\" + productDesc + \"\\\"\"\n\t\t\t\t\t\t+ \"&total_fee=\\\"\" + price + \"\\\"\"\n\t\t\t\t\t\t+ \"&notify_url=\\\"\" + strNotifyUrl + \"\\\"\"\n\t\t\t\t\t\t+ royParam;\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Product info parse error\", e);\n\t\t}\n\n\t\tLogD(\"order info : \" + strRet);\n\t\treturn strRet;\n\t}\n\n\t/**\n\t * get the out_trade_no for an order.\n\t * 获取外部订单号\n\t * \n\t * @return\n\t */\n\tString getOutTradeNo() {\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n\t\tDate date = new Date();\n\t\tString strKey = format.format(date);\n\n\t\tjava.util.Random r = new java.util.Random();\n\t\tstrKey = strKey + r.nextInt(10000);\n\t\treturn strKey;\n\t}\n\n\t//\n\t//\n\t/**\n\t *  sign the order info.\n\t *  对订单信息进行签名\n\t *  \n\t * @param signType\t签名方式 \n\t * @param content\t\t待签名订单信息\n\t * @return\n\t */\n\tprivate String sign(String signType, String content) {\n\t\tLogD(\"sign params :\");\n\t\tLogD(\"type : \" + signType + \", content : \" + content + \", private : \" + PartnerConfig.RSA_PRIVATE);\n\t\treturn Rsa.sign(content, PartnerConfig.RSA_PRIVATE);\n\t}\n\n\t/**\n\t * get the sign type we use.\n\t * 获取签名方式\n\t * \n\t * @return\n\t */\n\tprivate String getSignType() {\n\t\tString getSignType = \"sign_type=\" + \"\\\"\" + \"RSA\" + \"\\\"\";\n\t\treturn getSignType;\n\t}\n\t\n\tprivate ProgressDialog mProgress = null;\n\tvoid closeProgress() {\n\t\ttry {\n\t\t\tif (mProgress != null) {\n\t\t\t\tmProgress.dismiss();\n\t\t\t\tmProgress = null;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\tprivate boolean networkReachable() {\n\t\tboolean bRet = false;\n\t\ttry {\n\t\t\tConnectivityManager conn = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\tNetworkInfo netInfo = conn.getActiveNetworkInfo();\n\t\t\tbRet = (null == netInfo) ? false : netInfo.isAvailable();\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Fail to check network status\", e);\n\t\t}\n\t\tLogD(\"NetWork reachable : \" + bRet);\n\t\treturn bRet;\n\t}\n\n\tprivate static void payResult(int ret, String msg) {\n\t\tIAPWrapper.onPayResult(mAdapter, ret, msg);\n\t\tLogD(\"Alipay result : \" + ret + \" msg : \" + msg);\n\t}\n\n\t@Override\n\tpublic String getPluginVersion() {\n\t\treturn \"0.2.0\";\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/MobileSecurePayHelper.java",
    "content": "/*\n * Copyright (C) 2010 The MobileSecurePay Project\n * All right reserved.\n * author: shiqun.shi@alipay.com\n */\n\npackage org.cocos2dx.plugin;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.List;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport android.app.AlertDialog;\nimport android.app.ProgressDialog;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.net.Uri;\nimport android.os.Handler;\nimport android.os.Message;\n\n/**\n * 检测安全支付服务是否正确安装，如果没有安装进行本地安装，或者下载安装， 检测安全支付服务版本，有新版本时进行下载。\n * \n */\npublic class MobileSecurePayHelper {\n\tstatic final String TAG = \"MobileSecurePayHelper\";\n\n\tprivate ProgressDialog mProgress = null;\n\tContext mContext = null;\n\n\tpublic MobileSecurePayHelper(Context context) {\n\t\tthis.mContext = context;\n\t}\n\n\t/**\n\t * 检测安全支付服务是否安装\n\t * \n\t * @return\n\t */\n\tpublic boolean detectMobile_sp() {\n\t\tboolean isMobile_spExist = isMobile_spExist();\n\t\tif (!isMobile_spExist) {\n\t\t\t//\n\t\t\t// get the cacheDir.\n\t\t\t// 获取系统缓冲绝对路径 获取/data/data//cache目录\n\t\t\tFile cacheDir = mContext.getCacheDir();\n\t\t\tfinal String cachePath = cacheDir.getAbsolutePath() + \"/temp.apk\";\n\t\t\t//\n\t\t\t// 捆绑安装\n\t\t\tretrieveApkFromAssets(mContext, PartnerConfig.ALIPAY_PLUGIN_NAME,\n\t\t\t\t\tcachePath);\n\n\t\t\tmProgress = BaseHelper.showProgress(mContext, null, \"正在检测安全支付服务版本\",\n\t\t\t\t\tfalse, true);\n\n\t\t\t// 实例新线程检测是否有新版本进行下载\n\t\t\tnew Thread(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\t//\n\t\t\t\t\t// 检测是否有新的版本。\n\t\t\t\t\tPackageInfo apkInfo = getApkInfo(mContext, cachePath);\n\t\t\t\t\tString newApkdlUrl = checkNewUpdate(apkInfo);\n\n\t\t\t\t\t//\n\t\t\t\t\t// 动态下载\n\t\t\t\t\tif (newApkdlUrl != null)\n\t\t\t\t\t\tretrieveApkFromNet(mContext, newApkdlUrl, cachePath);\n\n\t\t\t\t\t// send the result back to caller.\n\t\t\t\t\t// 发送结果\n\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\tmsg.what = AlixId.RQF_INSTALL_CHECK;\n\t\t\t\t\tmsg.obj = cachePath;\n\t\t\t\t\tmHandler.sendMessage(msg);\n\t\t\t\t}\n\t\t\t}).start();\n\t\t}\n\t\t// else ok.\n\n\t\treturn isMobile_spExist;\n\t}\n\n\t/**\n\t * 显示确认安装的提示\n\t * \n\t * @param context\n\t *            上下文环境\n\t * @param cachePath\n\t *            安装文件路径\n\t */\n\tpublic void showInstallConfirmDialog(final Context context,\n\t\t\tfinal String cachePath) {\n\t\tAlertDialog.Builder tDialog = new AlertDialog.Builder(context);\n\t\ttDialog.setTitle(\"安装提示\");\n\t\ttDialog.setMessage(\"为保证您的交易安全，需要您安装支付宝安全支付服务，才能进行付款。\\n\\n点击确定，立即安装。\");\n\n\t\ttDialog.setPositiveButton(\"确定\",\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// 修改apk权限\n\t\t\t\t\t\tBaseHelper.chmod(\"777\", cachePath);\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// install the apk.\n\t\t\t\t\t\t// 安装安全支付服务APK\n\t\t\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\n\t\t\t\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\t\t\tintent.setDataAndType(Uri.parse(\"file://\" + cachePath),\n\t\t\t\t\t\t\t\t\"application/vnd.android.package-archive\");\n\t\t\t\t\t\tcontext.startActivity(intent);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\ttDialog.setNegativeButton(\"取消\",\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\ttDialog.show();\n\t}\n\n\t/**\n\t * 遍历程序列表，判断是否安装安全支付服务\n\t * \n\t * @return\n\t */\n\tpublic boolean isMobile_spExist() {\n\t\tPackageManager manager = mContext.getPackageManager();\n\t\tList<PackageInfo> pkgList = manager.getInstalledPackages(0);\n\t\tfor (int i = 0; i < pkgList.size(); i++) {\n\t\t\tPackageInfo pI = pkgList.get(i);\n\t\t\tif (pI.packageName.equalsIgnoreCase(\"com.alipay.android.app\"))\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * 安装安全支付服务，安装assets文件夹下的apk\n\t * \n\t * @param context\n\t *            上下文环境\n\t * @param fileName\n\t *            apk名称\n\t * @param path\n\t *            安装路径\n\t * @return\n\t */\n\tpublic boolean retrieveApkFromAssets(Context context, String fileName,\n\t\t\tString path) {\n\t\tboolean bRet = false;\n\n\t\ttry {\n\t\t\tInputStream is = context.getAssets().open(fileName);\n\n\t\t\tFile file = new File(path);\n\t\t\tfile.createNewFile();\n\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\n\t\t\tbyte[] temp = new byte[1024];\n\t\t\tint i = 0;\n\t\t\twhile ((i = is.read(temp)) > 0) {\n\t\t\t\tfos.write(temp, 0, i);\n\t\t\t}\n\n\t\t\tfos.close();\n\t\t\tis.close();\n\n\t\t\tbRet = true;\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\t/**\n\t * 获取未安装的APK信息\n\t * \n\t * @param context\n\t * @param archiveFilePath\n\t *            APK文件的路径。如：/sdcard/download/XX.apk\n\t */\n\tpublic static PackageInfo getApkInfo(Context context, String archiveFilePath) {\n\t\tPackageManager pm = context.getPackageManager();\n\t\tPackageInfo apkInfo = pm.getPackageArchiveInfo(archiveFilePath,\n\t\t\t\tPackageManager.GET_META_DATA);\n\t\treturn apkInfo;\n\t}\n\n\t/**\n\t * 检查是否有新版本，如果有，返回apk下载地址\n\t * \n\t * @param packageInfo\n\t *            {@link PackageInfo}\n\t * @return\n\t */\n\tpublic String checkNewUpdate(PackageInfo packageInfo) {\n\t\tString url = null;\n\n\t\ttry {\n\t\t\tJSONObject resp = sendCheckNewUpdate(packageInfo.versionName);\n\t\t\t// JSONObject resp = sendCheckNewUpdate(\"1.0.0\");\n\t\t\tif (resp.getString(\"needUpdate\").equalsIgnoreCase(\"true\")) {\n\t\t\t\turl = resp.getString(\"updateUrl\");\n\t\t\t}\n\t\t\t// else ok.\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn url;\n\t}\n\n\t/**\n\t * 发送当前版本信息，返回是否需要升级 如果需要升级返回更新apk地址\n\t * \n\t * @param versionName\n\t *            当前版本号\n\t * @return\n\t */\n\tpublic JSONObject sendCheckNewUpdate(String versionName) {\n\t\tJSONObject objResp = null;\n\t\ttry {\n\t\t\tJSONObject req = new JSONObject();\n\t\t\treq.put(AlixDefine.action, AlixDefine.actionUpdate);\n\n\t\t\tJSONObject data = new JSONObject();\n\t\t\tdata.put(AlixDefine.platform, \"android\");\n\t\t\tdata.put(AlixDefine.VERSION, versionName);\n\t\t\tdata.put(AlixDefine.partner, \"\");\n\n\t\t\treq.put(AlixDefine.data, data);\n\n\t\t\tobjResp = sendRequest(req.toString());\n\t\t} catch (JSONException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn objResp;\n\t}\n\n\t/**\n\t * 发送json数据\n\t * \n\t * @param content\n\t * @return\n\t */\n\tpublic final static String server_url = \"https://msp.alipay.com/x.htm\";\n\tpublic JSONObject sendRequest(final String content) {\n\t\tNetworkManager nM = new NetworkManager(this.mContext);\n\n\t\t//\n\t\tJSONObject jsonResponse = null;\n\t\ttry {\n\t\t\tString response = null;\n\n\t\t\tsynchronized (nM) {\n\t\t\t\t//\n\t\t\t\tresponse = nM.SendAndWaitResponse(content, server_url);\n\t\t\t}\n\n\t\t\tjsonResponse = new JSONObject(response);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t//\n\t\tif (jsonResponse != null)\n\t\t\tBaseHelper.log(TAG, jsonResponse.toString());\n\n\t\treturn jsonResponse;\n\t}\n\n\t/**\n\t * 动态下载apk\n\t * \n\t * @param context\n\t *            上下文环境\n\t * @param strurl\n\t *            下载地址\n\t * @param filename\n\t *            文件名称\n\t * @return\n\t */\n\tpublic boolean retrieveApkFromNet(Context context, String strurl,\n\t\t\tString filename) {\n\t\tboolean bRet = false;\n\n\t\ttry {\n\t\t\tNetworkManager nM = new NetworkManager(this.mContext);\n\t\t\tbRet = nM.urlDownloadToFile(context, strurl, filename);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn bRet;\n\t}\n\n\t//\n\t// close the progress bar\n\tvoid closeProgress() {\n\t\ttry {\n\t\t\tif (mProgress != null) {\n\t\t\t\tmProgress.dismiss();\n\t\t\t\tmProgress = null;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\t//\n\t// the handler use to receive the install check result.\n\t// 此处接收安装检测结果\n\tprivate Handler mHandler = new Handler() {\n\t\tpublic void handleMessage(Message msg) {\n\t\t\ttry {\n\t\t\t\tswitch (msg.what) {\n\t\t\t\tcase AlixId.RQF_INSTALL_CHECK: {\n\t\t\t\t\t//\n\t\t\t\t\tcloseProgress();\n\t\t\t\t\tString cachePath = (String) msg.obj;\n\n\t\t\t\t\tshowInstallConfirmDialog(mContext, cachePath);\n\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tsuper.handleMessage(msg);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t};\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/MobileSecurePayer.java",
    "content": "/*\n * Copyright (C) 2010 The MobileSecurePay Project\n * All right reserved.\n * author: shiqun.shi@alipay.com\n */\n\npackage org.cocos2dx.plugin;\n\nimport android.app.Activity;\nimport android.content.ComponentName;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.ServiceConnection;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.IBinder;\nimport android.os.Message;\nimport android.os.RemoteException;\n\nimport com.alipay.android.app.IAlixPay;\nimport com.alipay.android.app.IRemoteServiceCallback;\n\n/**\n * 和安全支付服务通信，发送订单信息进行支付，接收支付宝返回信息\n * \n */\npublic class MobileSecurePayer {\n\tstatic String TAG = \"MobileSecurePayer\";\n\n\tInteger lock = 0;\n\tIAlixPay mAlixPay = null;\n\tboolean mbPaying = false;\n\n\tActivity mActivity = null;\n\n\t// 和安全支付服务建立连接\n\tprivate ServiceConnection mAlixPayConnection = new ServiceConnection() {\n\n\t\tpublic void onServiceConnected(ComponentName className, IBinder service) {\n\t\t\t//\n\t\t\t// wake up the binder to continue.\n\t\t\t// 获得通信通道\n\t\t\tsynchronized (lock) {\n\t\t\t\tmAlixPay = IAlixPay.Stub.asInterface(service);\n\t\t\t\tlock.notify();\n\t\t\t}\n\t\t}\n\n\t\tpublic void onServiceDisconnected(ComponentName className) {\n\t\t\tmAlixPay = null;\n\t\t}\n\t};\n\n\t/**\n\t * 向支付宝发送支付请求\n\t * \n\t * @param strOrderInfo\n\t *            订单信息\n\t * @param callback\n\t *            回调handler\n\t * @param myWhat\n\t *            回调信息\n\t * @param activity\n\t *            目标activity\n\t * @return\n\t */\n\tpublic boolean pay(final String strOrderInfo, final Handler callback,\n\t\t\tfinal int myWhat, final Activity activity) {\n\t\tif (mbPaying)\n\t\t\treturn false;\n\t\tmbPaying = true;\n\n\t\t//\n\t\tmActivity = activity;\n\n\t\t// bind the service.\n\t\t// 绑定服务\n\t\tif (mAlixPay == null) {\n\t\t\t// 绑定安全支付服务需要获取上下文环境，\n\t\t\t// 如果绑定不成功使用mActivity.getApplicationContext().bindService\n\t\t\t// 解绑时同理\n\t\t\tmActivity.getApplicationContext().bindService(\n\t\t\t\t\tnew Intent(IAlixPay.class.getName()), mAlixPayConnection,\n\t\t\t\t\tContext.BIND_AUTO_CREATE);\n\t\t}\n\t\t// else ok.\n\n\t\t// 实例一个线程来进行支付\n\t\tnew Thread(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\t// wait for the service bind operation to completely\n\t\t\t\t\t// finished.\n\t\t\t\t\t// Note: this is important,otherwise the next mAlixPay.Pay()\n\t\t\t\t\t// will fail.\n\t\t\t\t\t// 等待安全支付服务绑定操作结束\n\t\t\t\t\t// 注意：这里很重要，否则mAlixPay.Pay()方法会失败\n\t\t\t\t\tsynchronized (lock) {\n\t\t\t\t\t\tif (mAlixPay == null)\n\t\t\t\t\t\t\tlock.wait();\n\t\t\t\t\t}\n\n\t\t\t\t\t// register a Callback for the service.\n\t\t\t\t\t// 为安全支付服务注册一个回调\n\t\t\t\t\tmAlixPay.registerCallback(mCallback);\n\n\t\t\t\t\t// call the MobileSecurePay service.\n\t\t\t\t\t// 调用安全支付服务的pay方法\n\t\t\t\t\tString strRet = mAlixPay.Pay(strOrderInfo);\n\t\t\t\t\tBaseHelper.log(TAG, \"After Pay: \" + strRet);\n\n\t\t\t\t\t// set the flag to indicate that we have finished.\n\t\t\t\t\t// unregister the Callback, and unbind the service.\n\t\t\t\t\t// 将mbPaying置为false，表示支付结束\n\t\t\t\t\t// 移除回调的注册，解绑安全支付服务\n\t\t\t\t\tmbPaying = false;\n\t\t\t\t\tmAlixPay.unregisterCallback(mCallback);\n\t\t\t\t\tmActivity.getApplicationContext().unbindService(\n\t\t\t\t\t\t\tmAlixPayConnection);\n\n\t\t\t\t\t// send the result back to caller.\n\t\t\t\t\t// 发送交易结果\n\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\tmsg.what = myWhat;\n\t\t\t\t\tmsg.obj = strRet;\n\t\t\t\t\tcallback.sendMessage(msg);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\n\t\t\t\t\t// send the result back to caller.\n\t\t\t\t\t// 发送交易结果\n\t\t\t\t\tMessage msg = new Message();\n\t\t\t\t\tmsg.what = myWhat;\n\t\t\t\t\tmsg.obj = e.toString();\n\t\t\t\t\tcallback.sendMessage(msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}).start();\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * This implementation is used to receive callbacks from the remote service.\n\t * 实现安全支付的回调\n\t */\n\tprivate IRemoteServiceCallback mCallback = new IRemoteServiceCallback.Stub() {\n\t\t/**\n\t\t * This is called by the remote service regularly to tell us about new\n\t\t * values. Note that IPC calls are dispatched through a thread pool\n\t\t * running in each process, so the code executing here will NOT be\n\t\t * running in our main thread like most other things -- so, to update\n\t\t * the UI, we need to use a Handler to hop over there.\n\t\t * 通过IPC机制启动安全支付服务\n\t\t */\n\t\tpublic void startActivity(String packageName, String className,\n\t\t\t\tint iCallingPid, Bundle bundle) throws RemoteException {\n\t\t\tIntent intent = new Intent(Intent.ACTION_MAIN, null);\n\n\t\t\tif (bundle == null)\n\t\t\t\tbundle = new Bundle();\n\t\t\t// else ok.\n\n\t\t\ttry {\n\t\t\t\tbundle.putInt(\"CallingPid\", iCallingPid);\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tintent.setClassName(packageName, className);\n\t\t\tmActivity.startActivity(intent);\n\t\t}\n\t};\n}"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/NetworkManager.java",
    "content": "/*\n * Copyright (C) 2010 The MobileSecurePay Project\n * All right reserved.\n * author: shiqun.shi@alipay.com\n */\n\npackage org.cocos2dx.plugin;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.HttpURLConnection;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\nimport java.net.URL;\nimport java.util.ArrayList;\n\nimport javax.net.ssl.HostnameVerifier;\nimport javax.net.ssl.HttpsURLConnection;\nimport javax.net.ssl.SSLSession;\n\nimport org.apache.http.client.entity.UrlEncodedFormEntity;\nimport org.apache.http.message.BasicNameValuePair;\n\nimport android.content.Context;\nimport android.net.ConnectivityManager;\nimport android.net.NetworkInfo;\n\n/**\n * 网络连接工具类\n * \n */\npublic class NetworkManager {\n\tstatic final String TAG = \"NetworkManager\";\n\n\tprivate int connectTimeout = 30 * 1000;\n\tprivate int readTimeout = 30 * 1000;\n\tProxy mProxy = null;\n\tContext mContext;\n\n\tpublic NetworkManager(Context context) {\n\t\tthis.mContext = context;\n\t\tsetDefaultHostnameVerifier();\n\t}\n\n\t/**\n\t * 检查代理，是否cnwap接入\n\t */\n\tprivate void detectProxy() {\n\t\tConnectivityManager cm = (ConnectivityManager) mContext\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo ni = cm.getActiveNetworkInfo();\n\t\tif (ni != null && ni.isAvailable()\n\t\t\t\t&& ni.getType() == ConnectivityManager.TYPE_MOBILE) {\n\t\t\tString proxyHost = android.net.Proxy.getDefaultHost();\n\t\t\tint port = android.net.Proxy.getDefaultPort();\n\t\t\tif (proxyHost != null) {\n\t\t\t\tfinal InetSocketAddress sa = new InetSocketAddress(proxyHost,\n\t\t\t\t\t\tport);\n\t\t\t\tmProxy = new Proxy(Proxy.Type.HTTP, sa);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void setDefaultHostnameVerifier() {\n\t\t//\n\t\tHostnameVerifier hv = new HostnameVerifier() {\n\t\t\tpublic boolean verify(String hostname, SSLSession session) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t};\n\n\t\tHttpsURLConnection.setDefaultHostnameVerifier(hv);\n\t}\n\n\t/**\n\t * 发送和接收数据\n\t * \n\t * @param strReqData\n\t *            请求数据\n\t * @param strUrl\n\t *            请求地址\n\t * @return\n\t */\n\tpublic String SendAndWaitResponse(String strReqData, String strUrl) {\n\t\t//\n\t\tdetectProxy();\n\n\t\tString strResponse = null;\n\t\tArrayList<BasicNameValuePair> pairs = new ArrayList<BasicNameValuePair>();\n\t\tpairs.add(new BasicNameValuePair(\"requestData\", strReqData));\n\n\t\tHttpURLConnection httpConnect = null;\n\t\tUrlEncodedFormEntity p_entity;\n\t\ttry {\n\t\t\tp_entity = new UrlEncodedFormEntity(pairs, \"utf-8\");\n\t\t\tURL url = new URL(strUrl);\n\n\t\t\tif (mProxy != null) {\n\t\t\t\thttpConnect = (HttpURLConnection) url.openConnection(mProxy);\n\t\t\t} else {\n\t\t\t\thttpConnect = (HttpURLConnection) url.openConnection();\n\t\t\t}\n\t\t\thttpConnect.setConnectTimeout(connectTimeout);\n\t\t\thttpConnect.setReadTimeout(readTimeout);\n\t\t\thttpConnect.setDoOutput(true);\n\t\t\thttpConnect.addRequestProperty(\"Content-type\",\n\t\t\t\t\t\"application/x-www-form-urlencoded;charset=utf-8\");\n\n\t\t\thttpConnect.connect();\n\n\t\t\tOutputStream os = httpConnect.getOutputStream();\n\t\t\tp_entity.writeTo(os);\n\t\t\tos.flush();\n\n\t\t\tInputStream content = httpConnect.getInputStream();\n\t\t\tstrResponse = BaseHelper.convertStreamToString(content);\n\t\t\tBaseHelper.log(TAG, \"response \" + strResponse);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\thttpConnect.disconnect();\n\t\t}\n\n\t\treturn strResponse;\n\t}\n\n\t/**\n\t * 下载文件\n\t * \n\t * @param context\n\t *            上下文环境\n\t * @param strurl\n\t *            下载地址\n\t * @param path\n\t *            下载路径\n\t * @return\n\t */\n\tpublic boolean urlDownloadToFile(Context context, String strurl, String path) {\n\t\tboolean bRet = false;\n\n\t\t//\n\t\tdetectProxy();\n\n\t\ttry {\n\t\t\tURL url = new URL(strurl);\n\t\t\tHttpURLConnection conn = null;\n\t\t\tif (mProxy != null) {\n\t\t\t\tconn = (HttpURLConnection) url.openConnection(mProxy);\n\t\t\t} else {\n\t\t\t\tconn = (HttpURLConnection) url.openConnection();\n\t\t\t}\n\t\t\tconn.setConnectTimeout(connectTimeout);\n\t\t\tconn.setReadTimeout(readTimeout);\n\t\t\tconn.setDoInput(true);\n\n\t\t\tconn.connect();\n\t\t\tInputStream is = conn.getInputStream();\n\n\t\t\tFile file = new File(path);\n\t\t\tfile.createNewFile();\n\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\n\t\t\tbyte[] temp = new byte[1024];\n\t\t\tint i = 0;\n\t\t\twhile ((i = is.read(temp)) > 0) {\n\t\t\t\tfos.write(temp, 0, i);\n\t\t\t}\n\n\t\t\tfos.close();\n\t\t\tis.close();\n\n\t\t\tbRet = true;\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn bRet;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/PartnerConfig.java",
    "content": "package org.cocos2dx.plugin;\n\npublic class PartnerConfig {\n\n\t// 合作商户ID。用签约支付宝账号登录ms.alipay.com后，在账户信息页面获取。\n\tpublic static String PARTNER = \"\";\n\t// 商户收款的支付宝账号\n\tpublic static String SELLER = \"\";\n\t// 商户（RSA）私钥\n\tpublic static String RSA_PRIVATE = \"\";\n\t// 支付宝（RSA）公钥 用签约支付宝账号登录ms.alipay.com后，在密钥管理页面获取。\n\tpublic static String RSA_ALIPAY_PUBLIC = \"\";\n\t// 支付宝安全支付服务apk的名称，必须与assets目录下的apk名称一致\n\tpublic static String ALIPAY_PLUGIN_NAME = \"\";\n\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/ResultChecker.java",
    "content": "package org.cocos2dx.plugin;\n\nimport org.json.JSONObject;\n\n/**\n * 对签名进行验签\n * \n */\npublic class ResultChecker {\n\n\tpublic static final int RESULT_INVALID_PARAM = 0;\n\tpublic static final int RESULT_CHECK_SIGN_FAILED = 1;\n\tpublic static final int RESULT_CHECK_SIGN_SUCCEED = 2;\n\n\tString mContent;\n\n\tpublic ResultChecker(String content) {\n\t\tthis.mContent = content;\n\t}\n\n\t/**\n\t * 从验签内容中获取成功状态\n\t * \n\t * @return\n\t */\n\tprivate String getSuccess() {\n\t\tString success = null;\n\n\t\ttry {\n\t\t\tJSONObject objContent = BaseHelper.string2JSON(this.mContent, \";\");\n\t\t\tString result = objContent.getString(\"result\");\n\t\t\tresult = result.substring(1, result.length() - 1);\n\n\t\t\tJSONObject objResult = BaseHelper.string2JSON(result, \"&\");\n\t\t\tsuccess = objResult.getString(\"success\");\n\t\t\tsuccess = success.replace(\"\\\"\", \"\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn success;\n\t}\n\n\t/**\n\t * 对签名进行验签\n\t * \n\t * @return\n\t */\n\tint checkSign() {\n\t\tint retVal = RESULT_CHECK_SIGN_SUCCEED;\n\n\t\ttry {\n\t\t\tJSONObject objContent = BaseHelper.string2JSON(this.mContent, \";\");\n\t\t\tString result = objContent.getString(\"result\");\n\t\t\tresult = result.substring(1, result.length() - 1);\n\t\t\t// 获取待签名数据\n\t\t\tint iSignContentEnd = result.indexOf(\"&sign_type=\");\n\t\t\tString signContent = result.substring(0, iSignContentEnd);\n\t\t\t// 获取签名\n\t\t\tJSONObject objResult = BaseHelper.string2JSON(result, \"&\");\n\t\t\tString signType = objResult.getString(\"sign_type\");\n\t\t\tsignType = signType.replace(\"\\\"\", \"\");\n\n\t\t\tString sign = objResult.getString(\"sign\");\n\t\t\tsign = sign.replace(\"\\\"\", \"\");\n\t\t\t// 进行验签 返回验签结果\n\t\t\tif (signType.equalsIgnoreCase(\"RSA\")) {\n\t\t\t\tif (!Rsa.doCheck(signContent, sign,\n\t\t\t\t\t\tPartnerConfig.RSA_ALIPAY_PUBLIC))\n\t\t\t\t\tretVal = RESULT_CHECK_SIGN_FAILED;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tretVal = RESULT_INVALID_PARAM;\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn retVal;\n\t}\n\t\n\tint getResultStatus() {\n\t\tint ret = 9000;\n\t\ttry {\n\t\t\tJSONObject objContent = BaseHelper.string2JSON(this.mContent, \";\");\n\t\t\tString result = objContent.getString(\"resultStatus\");\n\t\t\tresult = result.substring(1, result.length() - 1);\n\t\t\t\n\t\t\tret = Integer.parseInt(result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tret = 4001;\n\t\t}\n\t\treturn ret;\n\t}\n\n\tprivate static final int PAY_SUCCESS_STATUS_CODE = 9000;\n\tpublic boolean isPayOk() {\n\t\tboolean isPayOk = false;\n\n\t\tString success = getSuccess();\n\t\tif (success.equalsIgnoreCase(\"true\") &&\n\t\t\tcheckSign() == RESULT_CHECK_SIGN_SUCCEED &&\n\t\t\tPAY_SUCCESS_STATUS_CODE == getResultStatus())\n\t\t{\n\t\t\tisPayOk = true;\n\t\t}\n\n\t\treturn isPayOk;\n\t}\n}"
  },
  {
    "path": "cocos2d/plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/Rsa.java",
    "content": "/*\n * Copyright (C) 2010 The MobileSecurePay Project\n * All right reserved.\n * author: shiqun.shi@alipay.com\n */\n\npackage org.cocos2dx.plugin;\n\nimport java.security.KeyFactory;\nimport java.security.PrivateKey;\nimport java.security.PublicKey;\nimport java.security.spec.PKCS8EncodedKeySpec;\nimport java.security.spec.X509EncodedKeySpec;\n\n/**\n * RSA工具类\n * \n */\npublic class Rsa {\n\n//\tprivate static final String ALGORITHM = \"RSA\";\n\n//\tprivate static PublicKey getPublicKeyFromX509(String algorithm,\n//\t\t\tString bysKey) throws NoSuchAlgorithmException, Exception {\n//\t\tbyte[] decodedKey = Base64.decode(bysKey);\n//\t\tX509EncodedKeySpec x509 = new X509EncodedKeySpec(decodedKey);\n//\n//\t\tKeyFactory keyFactory = KeyFactory.getInstance(algorithm);\n//\t\treturn keyFactory.generatePublic(x509);\n//\t}\n\n//\tpublic static String encrypt(String content, String key) {\n//\t\ttry {\n//\t\t\tPublicKey pubkey = getPublicKeyFromX509(ALGORITHM, key);\n//\n//\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n//\t\t\tcipher.init(Cipher.ENCRYPT_MODE, pubkey);\n//\n//\t\t\tbyte plaintext[] = content.getBytes(\"UTF-8\");\n//\t\t\tbyte[] output = cipher.doFinal(plaintext);\n//\n//\t\t\tString s = new String(Base64.encode(output));\n//\n//\t\t\treturn s;\n//\n//\t\t} catch (Exception e) {\n//\t\t\te.printStackTrace();\n//\t\t\treturn null;\n//\t\t}\n//\t}\n\n\tpublic static final String SIGN_ALGORITHMS = \"SHA1WithRSA\";\n\n\tpublic static String sign(String content, String privateKey) {\n\t\tString charset = \"utf-8\";\n\t\ttry {\n\t\t\tPKCS8EncodedKeySpec priPKCS8 = new PKCS8EncodedKeySpec(\n\t\t\t\t\tBase64.decode(privateKey));\n\t\t\tKeyFactory keyf = KeyFactory.getInstance(\"RSA\");\n\t\t\tPrivateKey priKey = keyf.generatePrivate(priPKCS8);\n\n\t\t\tjava.security.Signature signature = java.security.Signature\n\t\t\t\t\t.getInstance(SIGN_ALGORITHMS);\n\n\t\t\tsignature.initSign(priKey);\n\t\t\tsignature.update(content.getBytes(charset));\n\n\t\t\tbyte[] signed = signature.sign();\n\n\t\t\treturn Base64.encode(signed);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tpublic static boolean doCheck(String content, String sign, String publicKey) {\n\t\ttry {\n\t\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\t\tbyte[] encodedKey = Base64.decode(publicKey);\n\t\t\tPublicKey pubKey = keyFactory\n\t\t\t\t\t.generatePublic(new X509EncodedKeySpec(encodedKey));\n\n\t\t\tjava.security.Signature signature = java.security.Signature\n\t\t\t\t\t.getInstance(SIGN_ALGORITHMS);\n\n\t\t\tsignature.initVerify(pubKey);\n\t\t\tsignature.update(content.getBytes(\"utf-8\"));\n\n\t\t\tboolean bverify = signature.verify(Base64.decode(sign));\n\t\t\treturn bverify;\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn false;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/FlurryAgent.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginFlurry</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libAnalyticsFlurry\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <applicationCfg keyword=\"com.flurry.android.FlurryFullscreenTakeoverActivity\">\n        <activity android:name=\"com.flurry.android.FlurryFullscreenTakeoverActivity\"\n             android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode\"\n             android:hardwareAccelerated=\"false\" >\n        </activity>\n    </applicationCfg>\n    \n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.INTERNET\" />\n    </permissionCfg>\n</manifestConfig> \n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginFlurry\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/src/org/cocos2dx/plugin/AdsFlurry.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\nimport android.content.Context;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.ViewGroup;\nimport android.view.WindowManager;\nimport android.widget.FrameLayout;\n\nimport com.flurry.android.FlurryAdListener;\nimport com.flurry.android.FlurryAdSize;\nimport com.flurry.android.FlurryAdType;\nimport com.flurry.android.FlurryAds;\nimport com.flurry.android.FlurryAgent;\n\npublic class AdsFlurry implements InterfaceAds, FlurryAdListener {\n\n    private Context mContext = null;\n    protected static String TAG = \"AdsFlurry\";\n\n    private FrameLayout mBannerView = null;\n    private WindowManager mWm = null;\n    private AdsFlurry mAdapter = null;\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    private static boolean isDebug = false;\n    protected static void LogD(String msg) {\n        if (isDebug) {\n            Log.d(TAG, msg);\n        }\n    }\n\n    public AdsFlurry(Context context) {\n        mContext = context;\n        mAdapter = this;\n    }\n\n    @Override\n    public void setDebugMode(boolean isDebugMode) {\n        isDebug = isDebugMode;\n        final boolean curDebug = isDebug;\n        PluginWrapper.runOnMainThread(new Runnable(){\n            @Override\n            public void run() {\n                FlurryAgent.setLogEnabled(curDebug);\n                if (curDebug) {\n                    FlurryAgent.setLogLevel(Log.DEBUG);\n                }\n            }\n        });\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return \"3.2.1\";\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return \"0.2.0\";\n    }\n\n    @Override\n    public void configDeveloperInfo(Hashtable<String, String> devInfo) {\n        final Hashtable<String, String> curInfo = devInfo;\n        PluginWrapper.runOnMainThread(new Runnable(){\n            @Override\n            public void run() {\n                try {\n                    String appKey = curInfo.get(\"FlurryAppKey\");\n                    FlurryAgent.onStartSession(mContext, appKey);\n                    FlurryAds.setAdListener(mAdapter);\n                    FlurryAds.initializeAds(mContext);\n                } catch (Exception e) {\n                    LogE(\"Error during configDeveloperInfo.\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void showAds(Hashtable<String, String> adsInfo, int pos) {\n        final Hashtable<String, String> curInfo = adsInfo;\n        final int curPos = pos;\n        PluginWrapper.runOnMainThread(new Runnable(){\n            @Override\n            public void run() {\n                try\n                {\n                    String spaceID = curInfo.get(\"FlurryAdsID\");\n                    if (null == spaceID || TextUtils.isEmpty(spaceID))\n                    {\n                        LogD(\"Value of 'FlurryAdsID' should not be empty\");\n                        return;\n                    }\n\n                    String strSize = curInfo.get(\"FlurryAdsSize\");\n                    int size = Integer.parseInt(strSize);\n                    if (size != 1 && size != 2 && size != 3) {\n                        LogD(\"Valur of 'FlurryAdsSize' should be one of '1', '2', '3'\");\n                        return;\n                    }\n\n                    FlurryAdSize eSize = FlurryAdSize.BANNER_TOP;\n                    switch (size)\n                    {\n                    case 1:\n                        eSize = FlurryAdSize.BANNER_TOP;\n                        break;\n                    case 2:\n                        eSize = FlurryAdSize.BANNER_BOTTOM;\n                        break;\n                    case 3:\n                        eSize = FlurryAdSize.FULLSCREEN;\n                        break;\n                    default:\n                        break;\n                    }\n\n                    if (null == mWm) {\n                        mWm = (WindowManager) mContext.getSystemService(\"window\");\n                    }\n                    if (null != mBannerView) {\n                        mWm.removeView(mBannerView);\n                        mBannerView = null;\n                    }\n                    mBannerView = new FrameLayout(mContext);\n                    AdsWrapper.addAdView(mWm, mBannerView, curPos);\n\n                    FlurryAds.fetchAd(mContext, spaceID, mBannerView, eSize);\n                } catch (Exception e) {\n                    LogE(\"Error during showAds\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void hideAds(Hashtable<String, String> adsInfo) {\n        final Hashtable<String, String> curInfo = adsInfo;\n        PluginWrapper.runOnMainThread(new Runnable(){\n            @Override\n            public void run() {\n                try\n                {\n                    String spaceID = curInfo.get(\"FlurryAdsID\");\n                    if (null == spaceID || TextUtils.isEmpty(spaceID))\n                    {\n                        LogD(\"Value of 'FlurryAdsID' should not be empty\");\n                        return;\n                    }\n\n                    FlurryAds.removeAd(mContext, spaceID, (ViewGroup) mBannerView);\n                } catch (Exception e) {\n                    LogE(\"Error during hideAds\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void queryPoints() {\n        // TODO Auto-generated method stub\n        \n    }\n\n    @Override\n    public void spendPoints(int points) {\n        // TODO Auto-generated method stub\n        \n    }\n\n    @Override\n    public void onAdClicked(String arg0) {\n        // TODO Auto-generated method stub\n        \n    }\n\n    @Override\n    public void onAdClosed(String arg0) {\n        AdsWrapper.onAdsResult(this, AdsWrapper.RESULT_CODE_AdsDismissed, \"Ads will be dismissed\");\n    }\n\n    @Override\n    public void onAdOpened(String arg0) {\n        // TODO Auto-generated method stub\n        \n    }\n\n    @Override\n    public void onApplicationExit(String arg0) {\n        // TODO Auto-generated method stub\n        \n    }\n\n    @Override\n    public void onRenderFailed(String arg0) {\n        // TODO Auto-generated method stub\n        \n    }\n\n    @Override\n    public void onVideoCompleted(String arg0) {\n        // TODO Auto-generated method stub\n        \n    }\n\n    @Override\n    public boolean shouldDisplayAd(String arg0, FlurryAdType arg1) {\n        AdsWrapper.onAdsResult(this, AdsWrapper.RESULT_CODE_AdsShown, \"Ads will be shown\");\n        return true;\n    }\n\n    @Override\n    public void spaceDidFailToReceiveAd(String arg0) {\n        LogD(\"param : \" + arg0);\n        AdsWrapper.onAdsResult(this, AdsWrapper.RESULT_CODE_UnknownError, \"Failed to receive Ads of flurry\");\n    }\n\n    @Override\n    public void spaceDidReceiveAd(String arg0) {\n        AdsWrapper.onAdsResult(this, AdsWrapper.RESULT_CODE_AdsReceived, \"Ads of flurry received\");\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.android/src/org/cocos2dx/plugin/AnalyticsFlurry.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\nimport java.util.Iterator;\n\nimport org.json.JSONObject;\n\nimport android.content.Context;\nimport android.util.Log;\n\nimport com.flurry.android.Constants;\nimport com.flurry.android.FlurryAgent;\n\npublic class AnalyticsFlurry implements InterfaceAnalytics {\n\n    private Context mContext = null;\n    protected static String TAG = \"AnalyticsFlurry\";\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    private static boolean isDebug = false;\n    protected static void LogD(String msg) {\n        if (isDebug) {\n            Log.d(TAG, msg);\n        }\n    }\n\n    public AnalyticsFlurry(Context context) {\n        mContext = context;\n    }\n    \n    @Override\n    public void startSession(String appKey) {\n        LogD(\"startSession invoked!\");\n        final String curKey = appKey;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    Class.forName(\"android.os.AsyncTask\");\n                } catch (ClassNotFoundException e) {\n                   e.printStackTrace();\n                }\n                FlurryAgent.onStartSession(mContext, curKey);\n            }\n            \n        });\n    }\n\n    @Override\n    public void stopSession() {\n        LogD(\"stopSession invoked!\");\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.onEndSession(mContext);\n            }\n        });\n    }\n\n    @Override\n    public void setSessionContinueMillis(int millis) {\n        LogD(\"setSessionContinueMillis invoked!\");\n        final int curMillis = millis;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.setContinueSessionMillis(curMillis);\n            }\n        });\n    }\n\n    @Override\n    public void setCaptureUncaughtException(boolean isEnabled) {\n        LogD(\"setCaptureUncaughtException invoked!\");\n        final boolean curEnable = isEnabled;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.setCaptureUncaughtExceptions(curEnable);\n            }\n        });\n    }\n\n    @Override\n    public void setDebugMode(boolean isDebugMode) {\n        isDebug = isDebugMode;\n        final boolean curDebugMode = isDebug;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.setLogEnabled(curDebugMode);\n                if (curDebugMode) {\n                    FlurryAgent.setLogLevel(Log.DEBUG);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void logError(String errorId, String message) {\n        LogD(\"logError invoked!\");\n        final String curID = errorId;\n        final String curMsg = message;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.onError(curID, curMsg, \"\");\n            }\n        });\n    }\n\n    @Override\n    public void logEvent(String eventId) {\n        LogD(\"logEvent(eventId) invoked!\");\n        final String curId = eventId;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.logEvent(curId);\n            }\n        });\n    }\n\n    @Override\n    public void logEvent(String eventId, Hashtable<String, String> paramMap) {\n        LogD(\"logEvent(eventId, paramMap) invoked!\");\n        final String curId = eventId;\n        final Hashtable<String, String> curParam = paramMap;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.logEvent(curId, curParam);\n            }\n        });\n    }\n\n    @Override\n    public void logTimedEventBegin(String eventId) {\n        LogD(\"logTimedEventBegin invoked!\");\n        final String curId = eventId;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.logEvent(curId, true);\n            }\n        });\n    }\n\n    @Override\n    public void logTimedEventEnd(String eventId) {\n        LogD(\"logTimedEventEnd invoked!\");\n        final String curId = eventId;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                FlurryAgent.endTimedEvent(curId);\n            }\n        });\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return \"3.2.1\";\n    }\n\n    protected void logTimedEventBeginWithParams(JSONObject eventInfo) {\n        LogD(\"logTimedEventBegin invoked!\");\n        final JSONObject curInfo = eventInfo;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try{\n                    String eventId = curInfo.getString(\"Param1\");\n                    \n                    if (curInfo.has(\"Param2\"))\n                    {\n                        JSONObject params = curInfo.getJSONObject(\"Param2\");\n                        @SuppressWarnings(\"rawtypes\")\n                        Iterator it = params.keys();\n                        Hashtable<String, String> paramMap = new Hashtable<String, String>();\n                        while (it.hasNext()) {\n                            String key = (String) it.next();\n                            String value = params.getString(key);\n                            paramMap.put(key, value);\n                        }\n                        FlurryAgent.logEvent(eventId, paramMap, true);\n                    } else {\n                        FlurryAgent.logEvent(eventId, true);\n                    }\n                } catch(Exception e){\n                    LogE(\"Exception in logTimedEventBegin\", e);\n                }\n            }\n        });\n    }\n    \n    protected void setReportLocation(boolean enabled) {\n        LogD(\"setReportLocation invoked!\");\n        final boolean curEnable = enabled;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try{\n                    FlurryAgent.setReportLocation(curEnable);\n                } catch(Exception e){\n                    LogE(\"Exception in setReportLocation\", e);\n                }\n            }\n        });\n    }\n    \n    protected void  logPageView() {\n        LogD(\"logPageView invoked!\");\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try{\n                    FlurryAgent.onPageView();\n                } catch(Exception e){\n                    LogE(\"Exception in logPageView\", e);\n                }\n            }\n        });\n    }\n\n    protected void setVersionName(String versionName) {\n        LogD(\"setVersionName invoked!\");\n        final String curVer = versionName;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    FlurryAgent.setVersionName(curVer);\n                } catch(Exception e){\n                    LogE(\"Exception in setVersionName\", e);\n                }\n            }\n        });\n    }\n    \n    protected void setAge(int age) {\n        LogD(\"setAge invoked!\");\n        final int curAge = age;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    FlurryAgent.setAge(curAge);\n                } catch(Exception e){\n                    LogE(\"Exception in setAge\", e);\n                }\n            }\n        });\n    }\n    \n    protected void setGender(int gender) {\n        LogD(\"setGender invoked!\");\n        final int curGender = gender;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    byte bGender;\n                    if (1 == curGender) {\n                        bGender = Constants.MALE;\n                    } else {\n                        bGender = Constants.FEMALE;\n                    }\n                    FlurryAgent.setGender(bGender);\n                } catch(Exception e){\n                    LogE(\"Exception in setGender\", e);\n                }\n            }\n        });\n    }\n    \n    protected void setUserId(String userId) {\n        LogD(\"setUserId invoked!\");\n        final String curUser = userId;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    FlurryAgent.setUserId(curUser);\n                } catch(Exception e){\n                    LogE(\"Exception in setUserId\", e);\n                }\n            }\n        });\n    }\n    \n    protected void setUseHttps(boolean useHttps) {\n        LogD(\"setUseHttps invoked!\");\n        \n        final boolean curCfg = useHttps;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    FlurryAgent.setUseHttps(curCfg);\n                } catch(Exception e){\n                    LogE(\"Exception in setUseHttps\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return \"0.2.0\";\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/AdsFlurry.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import \"InterfaceAds.h\"\n#import \"FlurryAdDelegate.h\"\n\n@interface AdsFlurry : NSObject <InterfaceAds, FlurryAdDelegate>\n{\n    \n}\n\n@property BOOL debug;\n\n/**\n interfaces of protocol : InterfaceAds\n */\n- (void) configDeveloperInfo: (NSMutableDictionary*) devInfo;\n- (void) showAds: (NSMutableDictionary*) info position:(int) pos;\n- (void) hideAds: (NSMutableDictionary*) info;\n- (void) queryPoints;\n- (void) spendPoints: (int) points;\n- (void) setDebugMode: (BOOL) isDebugMode;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n/**\n interfaces of protocol : FlurryAdDelegate\n */\n- (void) spaceDidReceiveAd:(NSString*)adSpace;\n- (void) spaceDidFailToReceiveAd:(NSString*)adSpace error:(NSError *)error;\n- (BOOL) spaceShouldDisplay:(NSString*)adSpace interstitial:(BOOL)interstitial;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/AdsFlurry.m",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import \"AdsFlurry.h\"\n#import \"Flurry.h\"\n#import \"FlurryAds.h\"\n#import \"AdsWrapper.h\"\n\n#define OUTPUT_LOG(...)     if (self.debug) NSLog(__VA_ARGS__);\n\n@implementation AdsFlurry\n\n@synthesize debug = __debug;\n\n\n#pragma mark Interfaces for ProtocolAds impl\n\n- (void) configDeveloperInfo: (NSMutableDictionary*) devInfo\n{\n    NSString* appKey = [devInfo objectForKey:@\"FlurryAppKey\"];\n    if (appKey) {\n        [Flurry startSession:appKey];\n    }\n\n    [FlurryAds initialize:[AdsWrapper getCurrentRootViewController]];\n    [FlurryAds setAdDelegate:self];\n}\n\n- (void) showAds: (NSMutableDictionary*) info position:(int) pos\n{\n    NSString* strSpaceID = [info objectForKey:@\"FlurryAdsID\"];\n    if (! strSpaceID || [strSpaceID length] == 0) {\n        OUTPUT_LOG(@\"Value of 'FlurryAdsID' should not be empty\");\n        return;\n    }\n\n    NSString* strSize = [info objectForKey:@\"FlurryAdsSize\"];\n    int size = [strSize intValue];\n    if (size != 1 && size != 2 && size != 3) {\n        OUTPUT_LOG(@\"Value of 'FlurryAdsSize' should be one of '1', '2', '3' \");\n        return;\n    }\n\n    UIViewController* controller = [AdsWrapper getCurrentRootViewController];\n    if (controller) {\n        [FlurryAds fetchAndDisplayAdForSpace:strSpaceID view:controller.view size:size];\n    }\n}\n\n- (void) hideAds: (NSMutableDictionary*) info\n{\n    NSString* strSpaceID = [info objectForKey:@\"FlurryAdsID\"];\n    if (! strSpaceID || [strSpaceID length] == 0) {\n        OUTPUT_LOG(@\"Value of 'FlurryAdsID' should not be empty\");\n        return;\n    }\n\n    [FlurryAds removeAdFromSpace:strSpaceID];\n}\n\n- (void) queryPoints\n{\n    \n}\n\n- (void) spendPoints: (int) points\n{\n    \n}\n\n- (void) setDebugMode: (BOOL) isDebugMode\n{\n    OUTPUT_LOG(@\"Flurry setDebugMode invoked(%d)\", isDebugMode);\n    self.debug = isDebugMode;\n    [Flurry setDebugLogEnabled:isDebugMode];\n\n    if (self.debug) {\n        [FlurryAds enableTestAds:YES]; \n    }\n}\n\n- (NSString*) getSDKVersion\n{\n    return @\"4.2.1\";\n}\n\n- (NSString*) getPluginVersion\n{\n    return @\"0.2.0\";\n}\n\n#pragma mark Interfaces for FlurryAdDelegate impl\n\n- (void) spaceDidReceiveAd:(NSString*)adSpace\n{\n    [AdsWrapper onAdsResult:self withRet:kAdsReceived  withMsg:@\"Ads of flurry received\"];\n}\n\n- (void) spaceDidFailToReceiveAd:(NSString*)adSpace error:(NSError *)error\n{\n    NSString* strMsg = [[error userInfo] objectForKey:@\"NSLocalizedDescription\"];\n    if (! strMsg) {\n        strMsg = @\"Failed to receive ads\";\n    }\n    [AdsWrapper onAdsResult:self withRet:kUnknownError withMsg:strMsg];\n}\n\n- (BOOL) spaceShouldDisplay:(NSString*)adSpace interstitial:(BOOL)interstitial\n{\n    [AdsWrapper onAdsResult:self withRet:kAdsShown withMsg:@\"Ads will be shown\"];\n    return YES;\n}\n\n- (void) spaceWillDismiss:(NSString *)adSpace\n{\n    [AdsWrapper onAdsResult:self withRet:kAdsDismissed withMsg:@\"Ads will be dismissed\"];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/AnalyticsFlurry.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import \"InterfaceAnalytics.h\"\n\n@interface AnalyticsFlurry : NSObject <InterfaceAnalytics>\n{\n    \n}\n\n@property BOOL debug;\n\n/**\n interfaces of protocol : InterfaceAnalytics\n */\n- (void) startSession: (NSString*) appKey;\n- (void) stopSession;\n- (void) setSessionContinueMillis: (long) millis;\n- (void) setCaptureUncaughtException: (BOOL) isEnabled;\n- (void) setDebugMode: (BOOL) isDebugMode;\n- (void) logError: (NSString*) errorId withMsg:(NSString*) message;\n- (void) logEvent: (NSString*) eventId;\n- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap;\n- (void) logTimedEventBegin: (NSString*) eventId;\n- (void) logTimedEventEnd: (NSString*) eventId;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n/**\n interfaces of flurry SDK\n */\n- (void) setAge: (NSNumber*) age;\n- (void) setGender: (NSNumber*) gender;\n- (void) setUserId: (NSString*) userId;\n- (void) setUseHttps: (NSNumber*) enabled;\n- (void) logPageView;\n- (void) setVersionName: (NSString*) versionName;\n- (void) logTimedEventBeginWithParams: (NSMutableDictionary*) params;\n- (void) logTimedEventEndWithParams: (NSMutableDictionary*) params;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/AnalyticsFlurry.m",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import \"AnalyticsFlurry.h\"\n#import \"Flurry.h\"\n\n#define OUTPUT_LOG(...)     if (self.debug) NSLog(__VA_ARGS__);\n\n@implementation AnalyticsFlurry\n\n@synthesize debug = __debug;\n\n- (void) startSession: (NSString*) appKey\n{\n    [Flurry startSession:appKey];\n}\n\n- (void) stopSession\n{\n    OUTPUT_LOG(@\"Flurry stopSession in flurry not available on iOS\");\n}\n\n- (void) setSessionContinueMillis: (long) millis\n{\n    OUTPUT_LOG(@\"Flurry setSessionContinueMillis invoked(%ld)\", millis);\n    int seconds = (int)(millis / 1000);\n    [Flurry setSessionContinueSeconds:seconds];\n}\n\n- (void) setCaptureUncaughtException: (BOOL) isEnabled\n{\n    OUTPUT_LOG(@\"Flurry setCaptureUncaughtException in flurry not available on iOS\");\n}\n\n- (void) setDebugMode: (BOOL) isDebugMode\n{\n    OUTPUT_LOG(@\"Flurry setDebugMode invoked(%d)\", isDebugMode);\n    self.debug = isDebugMode;\n    [Flurry setDebugLogEnabled:isDebugMode];\n}\n\n- (void) logError: (NSString*) errorId withMsg:(NSString*) message\n{\n    OUTPUT_LOG(@\"Flurry logError invoked(%@, %@)\", errorId, message);\n    NSString* msg = nil;\n    if (nil == message) {\n        msg = @\"\";\n    } else {\n        msg = message;\n    }\n    [Flurry logError:errorId message:msg exception:nil];\n}\n\n- (void) logEvent: (NSString*) eventId\n{\n    OUTPUT_LOG(@\"Flurry logEvent invoked(%@)\", eventId);\n    [Flurry logEvent:eventId];\n}\n\n- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap\n{\n    OUTPUT_LOG(@\"Flurry logEventWithParams invoked (%@, %@)\", eventId, [paramMap debugDescription]);\n    [Flurry logEvent:eventId withParameters:paramMap];\n}\n\n- (void) logTimedEventBegin: (NSString*) eventId\n{\n    OUTPUT_LOG(@\"Flurry logTimedEventBegin invoked (%@)\", eventId);\n    [Flurry logEvent:eventId timed:YES];\n}\n\n- (void) logTimedEventEnd: (NSString*) eventId\n{\n    OUTPUT_LOG(@\"Flurry logTimedEventEnd invoked (%@)\", eventId);\n    [Flurry endTimedEvent:eventId withParameters:nil];\n}\n\n- (NSString*) getSDKVersion\n{\n    return @\"4.2.1\";\n}\n\n- (NSString*) getPluginVersion\n{\n    return @\"0.2.0\";\n}\n\n- (void) setAge: (NSNumber*) age\n{\n    int nAge = [age integerValue];\n    OUTPUT_LOG(@\"Flurry setAge invoked (%d)\", nAge);\n    [Flurry setAge:nAge];\n}\n\n- (void) setGender: (NSNumber*) gender\n{\n    OUTPUT_LOG(@\"Flurry setGender invoked (%@)\", gender);\n    int nValue = [gender intValue];\n    NSString* strGender;\n    if (nValue == 1) {\n        strGender = @\"m\";\n    } else {\n        strGender = @\"f\";\n    }\n    [Flurry setGender:strGender];\n}\n\n- (void) setUserId: (NSString*) userId\n{\n    OUTPUT_LOG(@\"Flurry setUserId invoked (%@)\", userId);\n    [Flurry setUserID:userId];\n}\n\n- (void) setUseHttps: (NSNumber*) enabled\n{\n    BOOL bEnabled = [enabled boolValue];\n    OUTPUT_LOG(@\"Flurry setUseHttps invoked (%@)\", enabled);\n    [Flurry setSecureTransportEnabled:bEnabled];\n}\n\n- (void) logPageView\n{\n    OUTPUT_LOG(@\"Flurry logPageView invoked\");\n    [Flurry logPageView];\n}\n\n- (void) setVersionName: (NSString*) versionName\n{\n    OUTPUT_LOG(@\"Flurry setVersionName invoked (%@)\", versionName);\n    [Flurry setAppVersion:versionName];\n}\n\n- (void) logTimedEventBeginWithParams: (NSMutableDictionary*) paramMap\n{\n    OUTPUT_LOG(@\"Flurry logTimedEventBeginWithParams invoked (%@)\", [paramMap debugDescription]);\n    NSString* eventId = (NSString*) [paramMap objectForKey:@\"Param1\"];\n    NSMutableDictionary* params = (NSMutableDictionary*) [paramMap objectForKey:@\"Param2\"];\n    if (params) {\n        [Flurry logEvent:eventId withParameters:paramMap timed:YES];\n    } else {\n        [Flurry logEvent:eventId timed:YES];\n    }\n}\n\n- (void) logTimedEventEndWithParams: (NSMutableDictionary*) paramMap\n{\n    OUTPUT_LOG(@\"Flurry logTimedEventEndWithParams invoked (%@)\", [paramMap debugDescription]);\n    NSString* eventId = (NSString*) [paramMap objectForKey:@\"Param1\"];\n    NSMutableDictionary* params = (NSMutableDictionary*) [paramMap objectForKey:@\"Param2\"];\n    [Flurry endTimedEvent:eventId withParameters:params];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/Flurry.h",
    "content": "//\n//  Flurry.h\n//  Flurry iOS Analytics Agent\n//\n//  Copyright 2009-2012 Flurry, Inc. All rights reserved.\n//\t\n//\tMethods in this header file are for use with Flurry Analytics\n\n#import <UIKit/UIKit.h>\n\n/*!\n *  @brief Provides all available methods for defining and reporting Analytics from use\n *  of your app.\n * \n *  Set of methods that allow developers to capture detailed, aggregate information\n *  regarding the use of their app by end users.\n *  \n *  @note This class provides methods necessary for correct function of FlurryAds.h.\n *  For information on how to use Flurry's Ads SDK to\n *  attract high-quality users and monetize your user base see <a href=\"http://support.flurry.com/index.php?title=Publishers\">Support Center - Publishers</a>.\n *  \n *  @author 2009 - 2012 Flurry, Inc. All Rights Reserved.\n *  @version 4.2.0\n * \n */\n@interface Flurry : NSObject {\n}\n\n/** @name Pre-Session Calls\n *  Optional sdk settings that should be called before start session. \n */\n//@{\n\n/*!\n *  @brief Explicitly specifies the App Version that Flurry will use to group Analytics data.\n *  @since 2.7\n *\n *  This is an optional method that overrides the App Version Flurry uses for reporting. Flurry will\n *  use the CFBundleVersion in your info.plist file when this method is not invoked.\n *\n *  @note There is a maximum of 605 versions allowed for a single app. \\n\n *  This method must be called prior to invoking #startSession:.\n *\n *  @param version The custom version name.\n */\n\n+ (void)setAppVersion:(NSString *)version;\n\n/*!\n *  @brief Retrieves the Flurry Agent Build Version.\n *  @since 2.7\n *\n *  This is an optional method that retrieves the Flurry Agent Version the app is running under. \n *  It is most often used if reporting an unexpected behavior of the SDK to <a href=\"mailto:iphonesupport@flurry.com\">\n *  Flurry Support</a>\n *\n *  @note This method must be called prior to invoking #startSession:. \\n\n *  FAQ for the iPhone SDK is located at <a href=\"http://wiki.flurry.com/index.php?title=IPhone_FAQ\">\n *  Support Center - iPhone FAQ</a>.\n *\n *  @see #setDebugLogEnabled: for information on how to view debugging information on your console.\n *\n *  @return The agent version of the Flurry SDK.\n *\n */\n+ (NSString *)getFlurryAgentVersion;\n\n/*!\n *  @brief Displays an exception in the debug log if thrown during a Session.\n *  @since 2.7\n *\n *  This is an optional method that augments the debug logs with exceptions that occur during the session.\n *  You must both capture exceptions to Flurry and set debug logging to enabled for this method to\n *  display information to the console. The default setting for this method is @c NO.\n *\n *  @note This method must be called prior to invoking #startSession:.\n *\n *  @see #setDebugLogEnabled: for information on how to view debugging information on your console. \\n\n *  #logError:message:exception: for details on logging exceptions. \\n\n *  #logError:message:error: for details on logging errors.\n *\n *  @param value @c YES to show errors in debug logs, @c NO to omit errors in debug logs.\n */\n+ (void)setShowErrorInLogEnabled:(BOOL)value;\n\n/*!\n *  @brief Generates debug logs to console.\n *  @since 2.7\n *\n *  This is an optional method that displays debug information related to the Flurry SDK.\n *  display information to the console. The default setting for this method is @c NO.\n *\n *  @note This method must be called prior to invoking #startSession:.\n *\n *  @param value @c YES to show debug logs, @c NO to omit debug logs.\n *\n */\n+ (void)setDebugLogEnabled:(BOOL)value;\t\n\n/*!\n *  @brief Set the timeout for expiring a Flurry session.\n *  @since 2.7\n * \n *  This is an optional method that sets the time the app may be in the background before \n *  starting a new session upon resume.  The default value for the session timeout is 10 \n *  seconds in the background.\n * \n *  @note This method must be called prior to invoking #startSession:.\n * \n *  @param seconds The time in seconds to set the session timeout to.\n */\n+ (void)setSessionContinueSeconds:(int)seconds;\n\n/*!\n *  @brief Send data over a secure transport.\n *  @since 3.0\n * \n *  This is an optional method that sends data over an SSL connection when enabled. The\n *  default value is @c NO.\n * \n *  @note This method must be called prior to invoking #startSession:.\n * \n *  @param value @c YES to send data over secure connection.\n */\n+ (void)setSecureTransportEnabled:(BOOL)value;\n\n/*!\n *  @brief Enable automatic collection of crash reports.\n *  @since 4.1\n *\n *  This is an optional method that collects crash reports when enabled. The\n *  default value is @c NO.\n *\n *  @note This method must be called prior to invoking #startSession:.\n *\n *  @param value @c YES to enable collection of crash reports.\n */\n+ (void)setCrashReportingEnabled:(BOOL)value;\n\n//@}\n\n/*!\n *  @brief Start a Flurry session for the project denoted by @c apiKey.\n *  @since 2.6\n * \n *  This method serves as the entry point to Flurry Analytics collection.  It must be\n *  called in the scope of @c applicationDidFinishLaunching.  The session will continue \n *  for the period the app is in the foreground until your app is backgrounded for the \n *  time specified in #setSessionContinueSeconds:. If the app is resumed in that period\n *  the session will continue, otherwise a new session will begin.\n *\n *  Crash reporting will not be enabled. See #startSession:enableCrashReporting: for\n *  more information.\n * \n *  @note If testing on a simulator, please be sure to send App to background via home\n *  button. Flurry depends on the iOS lifecycle to be complete for full reporting.\n * \n * @see #setSessionContinueSeconds: for details on setting a custom session timeout.\n *\n * @code\n *  - (void)applicationDidFinishLaunching:(UIApplication *)application \n {\n // Optional Flurry startup methods\n [Flurry startSession:@\"YOUR_API_KEY\"];\n // ....\n }\n * @endcode\n * \n * @param apiKey The API key for this project.\n */\n\n+ (void)startSession:(NSString *)apiKey;\n\n\n/*!\n *  @brief Start a Flurry session for the project denoted by @c apiKey.\n *  @since 4.0.8\n *\n *  This method serves as the entry point to Flurry Analytics collection.  It must be\n *  called in the scope of @c applicationDidFinishLaunching passing in the launchOptions param.\n *  The session will continue\n *  for the period the app is in the foreground until your app is backgrounded for the\n *  time specified in #setSessionContinueSeconds:. If the app is resumed in that period\n *  the session will continue, otherwise a new session will begin.\n *\n *  @note If testing on a simulator, please be sure to send App to background via home\n *  button. Flurry depends on the iOS lifecycle to be complete for full reporting.\n *\n * @see #setSessionContinueSeconds: for details on setting a custom session timeout.\n *\n * @code\n *  - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n // Optional Flurry startup methods\n [Flurry startSession:@\"YOUR_API_KEY\" withOptions:launchOptions];\n // ....\n }\n * @endcode\n *\n * @param apiKey The API key for this project.\n * @param options passed launchOptions from the applicatin's didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n \n */\n+ (void) startSession:(NSString *)apiKey withOptions:(id)options;\n\n\n/** @name Event and Error Logging\n *  Methods for reporting custom events and errors during the session. \n */\n//@{\n\n/*!\n *  @brief Records a custom event specified by @c eventName.\n *  @since 2.8.4\n * \n *  This method allows you to specify custom events within your app.  As a general rule\n *  you should capture events related to user navigation within your app, any action \n *  around monetization, and other events as they are applicable to tracking progress\n *  towards your business goals. \n * \n *  @note You should not pass private or confidential information about your users in a\n *  custom event. \\n\n *  Where applicable, you should make a concerted effort to use timed events with\n *  parameters (#logEvent:withParameters:timed:) or events with parameters \n *  (#logEvent:withParameters:). This provides valuable information around the time the user\n *  spends within an action (e.g. - time spent on a level or viewing a page) or characteristics\n *  of an action (e.g. - Buy Event that has a Parameter of Widget with Value Golden Sword).\n * \n *  @see #logEvent:withParameters: for details on storing events with parameters. \\n\n *  #logEvent:timed: for details on storing timed events. \\n\n *  #logEvent:withParameters:timed: for details on storing timed events with parameters. \\n\n *  #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating \n *  parameters.\n *\n *  @code\n *  - (void)interestingAppAction \n {\n [Flurry logEvent:@\"Interesting_Action\"];\n // Perform interesting action\n }\n *  @endcode\n * \n *  @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme\n *  that can be easily understood by non-technical people in your business domain.\n */\n+ (void)logEvent:(NSString *)eventName;\n\n/*!\n *  @brief Records a custom parameterized event specified by @c eventName with @c parameters.\n *  @since 2.8.4\n * \n *  This method overrides #logEvent to allow you to associate parameters with an event. Parameters\n *  are extremely valuable as they allow you to store characteristics of an action. For example,\n *  if a user purchased an item it may be helpful to know what level that user was on.\n *  By setting this parameter you will be able to view a distribution of levels for the purcahsed\n *  event on the <a href=\"http://dev.flurry.com\">Flurrly Dev Portal</a>.\n * \n *  @note You should not pass private or confidential information about your users in a\n *  custom event. \\n\n *  A maximum of 10 parameter names may be associated with any event. Sending\n *  over 10 parameter names with a single event will result in no parameters being logged\n *  for that event. You may specify an infinite number of Parameter values. For example,\n *  a Search Box would have 1 parameter name (e.g. - Search Box) and many values, which would\n *  allow you to see what values users look for the most in your app. \\n\n *  Where applicable, you should make a concerted effort to use timed events with\n *  parameters (#logEvent:withParameters:timed:). This provides valuable information \n *  around the time the user spends within an action (e.g. - time spent on a level or \n *  viewing a page).\n * \n *  @see #logEvent:withParameters:timed: for details on storing timed events with parameters. \\n\n *  #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating \n *  parameters.\n *\n *  @code\n *  - (void)userPurchasedSomethingCool \n {\n NSDictionary *params =\n [NSDictionary dictionaryWithObjectsAndKeys:@\"Cool Item\", // Parameter Value\n @\"Item Purchased\", // Parameter Name\n nil];\n [Flurry logEvent:@\"Something Cool Purchased\" withParameters:params];\n // Give user cool item\n }\n *  @endcode\n * \n *  @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme\n *  that can be easily understood by non-technical people in your business domain.\n *  @param parameters A map containing Name-Value pairs of parameters.\n */\n+ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters;\n\n/*!\n *  @brief Records an app exception. Commonly used to catch unhandled exceptions.\n *  @since 2.7\n * \n *  This method captures an exception for reporting to Flurry. We recommend adding an uncaught\n *  exception listener to capture any exceptions that occur during usage that is not\n *  anticipated by your app.\n * \n *  @see #logError:message:error: for details on capturing errors.\n *\n *  @code\n *  - (void) uncaughtExceptionHandler(NSException *exception) \n {\n [Flurry logError:@\"Uncaught\" message:@\"Crash!\" exception:exception];\n }\n \n - (void)applicationDidFinishLaunching:(UIApplication *)application \n {\n NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);\n [Flurry startSession:@\"YOUR_API_KEY\"];\n // ....\n }\n *  @endcode\n * \n *  @param errorID Name of the error.\n *  @param message The message to associate with the error.\n *  @param exception The exception object to report.\n */\n+ (void)logError:(NSString *)errorID message:(NSString *)message exception:(NSException *)exception;\n\n/*!\n *  @brief Records an app error.\n *  @since 2.7\n * \n *  This method captures an error for reporting to Flurry.\n * \n *  @see #logError:message:exception: for details on capturing exceptions.\n *\n *  @code\n *  - (void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error \n {\n [Flurry logError:@\"WebView No Load\" message:[error localizedDescription] error:error];\n }\n *  @endcode\n * \n *  @param errorID Name of the error.\n *  @param message The message to associate with the error.\n *  @param error The error object to report.\n */\n+ (void)logError:(NSString *)errorID message:(NSString *)message error:(NSError *)error;\n\n/*!\n *  @brief Records a timed event specified by @c eventName.\n *  @since 2.8.4\n * \n *  This method overrides #logEvent to allow you to capture the length of an event. This can\n *  be extremely valuable to understand the level of engagement with a particular action. For\n *  example, you can capture how long a user spends on a level or reading an article.\n * \n *  @note You should not pass private or confidential information about your users in a\n *  custom event. \\n\n *  Where applicable, you should make a concerted effort to use parameters with your timed \n *  events (#logEvent:withParameters:timed:). This provides valuable information \n *  around the characteristics of an action (e.g. - Buy Event that has a Parameter of Widget with \n *  Value Golden Sword).\n * \n *  @see #logEvent:withParameters:timed: for details on storing timed events with parameters. \\n\n *  #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating \n *  parameters.\n *\n *  @code\n *  - (void)startLevel \n {\n [Flurry logEvent:@\"Level Played\" timed:YES];\n // Start user on level\n }\n \n - (void)endLevel \n {\n [Flurry endTimedEvent:@\"Level Played\" withParameters:nil];\n // User done with level\n }\n *  @endcode\n * \n *  @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme\n *  that can be easily understood by non-technical people in your business domain.\n *  @param timed Specifies the event will be timed.\n */\n+ (void)logEvent:(NSString *)eventName timed:(BOOL)timed;\n\n/*!\n *  @brief Records a custom parameterized timed event specified by @c eventName with @c parameters.\n *  @since 2.8.4\n * \n *  This method overrides #logEvent to allow you to capture the length of an event with parameters. \n *  This can be extremely valuable to understand the level of engagement with a particular action \n *  and the characteristics associated with that action. For example, you can capture how long a user \n *  spends on a level or reading an article. Parameters can be used to capture, for example, the\n *  author of an article or if something was purchased while on the level.\n * \n *  @note You should not pass private or confidential information about your users in a\n *  custom event.\n *\n *  @see #endTimedEvent:withParameters: for details on stopping a timed event and (optionally) updating \n *  parameters.\n *\n *  @code\n *  - (void)startLevel \n {\n NSDictionary *params =\n [NSDictionary dictionaryWithObjectsAndKeys:@\"100\", // Parameter Value\n @\"Current Points\", // Parameter Name\n nil];\n \n [Flurry logEvent:@\"Level Played\" withParameters:params timed:YES];\n // Start user on level\n }\n \n - (void)endLevel \n {\n // User gained additional 100 points in Level\n NSDictionary *params =\n [NSDictionary dictionaryWithObjectsAndKeys:@\"200\", // Parameter Value\n @\"Current Points\", // Parameter Name\n nil];\n [Flurry endTimedEvent:@\"Level Played\" withParameters:params];\n // User done with level\n }\n *  @endcode\n * \n *  @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme\n *  that can be easily understood by non-technical people in your business domain.\n *  @param parameters A map containing Name-Value pairs of parameters.\n *  @param timed Specifies the event will be timed.\n */\n+ (void)logEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters timed:(BOOL)timed;\n\n/*!\n *  @brief Ends a timed event specified by @c eventName and optionally updates parameters with @c parameters.\n *  @since 2.8.4\n * \n *  This method ends an existing timed event.  If parameters are provided, this will overwrite existing\n *  parameters with the same name or create new parameters if the name does not exist in the parameter\n *  map set by #logEvent:withParameters:timed:.\n * \n *  @note You should not pass private or confidential information about your users in a\n *  custom event. \\n\n *  If the app is backgrounded prior to ending a timed event, the Flurry SDK will automatically\n *  end the timer on the event. \\n \n *  #endTimedEvent:withParameters: is ignored if called on a previously\n *  terminated event.\n *\n *  @see #logEvent:withParameters:timed: for details on starting a timed event with parameters.\n *\n *  @code\n *  - (void)startLevel \n {\n NSDictionary *params =\n [NSDictionary dictionaryWithObjectsAndKeys:@\"100\", // Parameter Value\n @\"Current Points\", // Parameter Name\n nil];\n \n [Flurry logEvent:@\"Level Played\" withParameters:params timed:YES];\n // Start user on level\n }\n \n - (void)endLevel \n {\n // User gained additional 100 points in Level\n NSDictionary *params =\n [NSDictionary dictionaryWithObjectsAndKeys:@\"200\", // Parameter Value\n @\"Current Points\", // Parameter Name\n nil];\n [Flurry endTimedEvent:@\"Level Played\" withParameters:params];\n // User done with level\n }\n *  @endcode\n * \n *  @param eventName Name of the event. For maximum effectiveness, we recommend using a naming scheme\n *  that can be easily understood by non-technical people in your business domain.\n *  @param parameters A map containing Name-Value pairs of parameters.\n */\n+ (void)endTimedEvent:(NSString *)eventName withParameters:(NSDictionary *)parameters;\t// non-nil parameters will update the parameters\n\n//@}\n\n\n/** @name Page View Methods\n *  Count page views. \n */\n//@{\n\n/*!\n *  @brief Automatically track page views on a @c UINavigationController or @c UITabBarController.\n *  @since 2.7\n * \n *  This method increments the page view count for a session based on traversing a UINavigationController\n *  or UITabBarController. The page view count is only a counter for the number of transitions in your\n *  app. It does not associate a name with the page count. To associate a name with a count of occurences\n *  see #logEvent:.\n * \n *  @note Please make sure you assign the Tab and Navigation controllers to the view controllers before\n *  passing them to this method.\n *\n *  @see #logPageView for details on explictly incrementing page view count.\n *\n *  @code\n * -(void) trackViewsFromTabBar:(UITabBarController*) tabBar \n {\n [Flurry logAllPageViews:tabBar];\n }\n *  @endcode\n * \n *  @param target The navigation or tab bar controller.\n */\n+ (void)logAllPageViews:(id)target;\t\t\n\n/*!\n *  @brief Explicitly track a page view during a session.\n *  @since 2.7\n * \n *  This method increments the page view count for a session when invoked. It does not associate a name\n *  with the page count. To associate a name with a count of occurences see #logEvent:.\n *\n *  @see #logAllPageViews for details on automatically incrementing page view count based on user\n *  traversing navigation or tab bar controller.\n *\n *  @code\n *  -(void) trackView \n {\n [Flurry logPageView];\n }\n *  @endcode\n *\n */\n+ (void)logPageView;\n\n//@}\n\n/** @name User Info\n *  Methods to set user information. \n */\n//@{\n\n/*!\n *  @brief Assign a unique id for a user in your app.\n *  @since 2.7\n * \n *  @note Please be sure not to use this method to pass any private or confidential information\n *  about the user.\n *\n *  @param userID The app id for a user.\n */\n+ (void)setUserID:(NSString *)userID;\t\n\n/*!\n *  @brief Set your user's age in years.\n *  @since 2.7\n * \n *  Use this method to capture the age of your user. Only use this method if you collect this\n *  information explictly from your user (i.e. - there is no need to set a default value).\n *\n *  @note The age is aggregated across all users of your app and not available on a per user\n *  basis.\n *\n *  @param age Reported age of user.\n *\n */\n+ (void)setAge:(int)age;\n\n/*!\n *  @brief Set your user's gender.\n *  @since 2.7\n * \n *  Use this method to capture the gender of your user. Only use this method if you collect this\n *  information explictly from your user (i.e. - there is no need to set a default value). Allowable\n *  values are @c @\"M\" or @c @\"F\"\n *\n *  @note The gender is aggregated across all users of your app and not available on a per user\n *  basis.\n *\n *  @param gender Reported gender of user.\n *\n */\n+ (void)setGender:(NSString *)gender;\t// user's gender m or f\n\n//@}\n\n/** @name Location Reporting\n *  Methods for setting location information. \n */\n//@{\n/*!\n *  @brief Set the location of the session.\n *  @since 2.7\n * \n *  Use information from the CLLocationManager to specify the location of the session. Flurry does not\n *  automatically track this information or include the CLLocation framework.\n *\n *  @note Only the last location entered is captured per session. \\n\n *  Regardless of accuracy specified, the Flurry SDK will only report location at city level or higher. \\n\n *  Location is aggregated across all users of your app and not available on a per user basis. \\n\n *  This information should only be captured if it is germaine to the use of your app.\n *\n *  @code\n CLLocationManager *locationManager = [[CLLocationManager alloc] init];\n [locationManager startUpdatingLocation];\n *  @endcode\n *\n *  After starting the location manager, you can set the location with Flurry. You can implement\n *  CLLocationManagerDelegate to be aware of when the location is updated. Below is an example \n *  of how to use this method, after you have recieved a location update from the locationManager.\n *\n *  @code\n CLLocation *location = locationManager.location;\n [Flurry  setLatitude:location.coordinate.latitude\n            longitude:location.coordinate.longitude\n   horizontalAccuracy:location.horizontalAccuracy\n     verticalAccuracy:location.verticalAccuracy];\n *  @endcode\n *  @param latitude The latitude.\n *  @param longitude The longitude.\n *  @param horizontalAccuracy The radius of uncertainty for the location in meters.\n *  @param verticalAccuracy The accuracy of the altitude value in meters.\n *\n */\n+ (void)setLatitude:(double)latitude longitude:(double)longitude horizontalAccuracy:(float)horizontalAccuracy verticalAccuracy:(float)verticalAccuracy;\n\n//@}\n\n/** @name Session Reporting Calls\n *  Optional methods that can be called at any point to control session reporting. \n */\n//@{\n\n/*!\n *  @brief Set session to report when app closes.\n *  @since 2.7\n * \n *  Use this method report session data when the app is closed. The default value is @c YES.\n *\n *  @note This method is rarely invoked in iOS >= 3.2 due to the updated iOS lifecycle.\n *\n *  @see #setSessionReportsOnPauseEnabled:\n *\n *  @param sendSessionReportsOnClose YES to send on close, NO to omit reporting on close.\n *\n */\n+ (void)setSessionReportsOnCloseEnabled:(BOOL)sendSessionReportsOnClose;\t\n\n/*!\n *  @brief Set session to report when app is sent to the background.\n *  @since 2.7\n * \n *  Use this method report session data when the app is paused. The default value is @c YES.\n *\n *  @param setSessionReportsOnPauseEnabled YES to send on pause, NO to omit reporting on pause.\n *\n */\n+ (void)setSessionReportsOnPauseEnabled:(BOOL)setSessionReportsOnPauseEnabled;\n\n/*!\n *  @brief Enable custom event logging.\n *  @since 2.7\n * \n *  Use this method to allow the capture of custom events. The default value is @c YES.\n *\n *  @param value YES to enable event logging, NO to stop custom logging.\n *\n */\n+ (void)setEventLoggingEnabled:(BOOL)value;\n\n/*!\n *  @brief Set device push token.\n *  @since 2.7\n *\n *  After the device has successfully registered with APNS, call this method to set the push token received from APNS.\n *\n *\n */\n+ (void)setPushToken:(NSString *)pushToken;\n\n\n//@}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/FlurryAds/FlurryAdDelegate.h",
    "content": "//\n//  FlurryAdDelegate.h\n//  Flurry\n//\n//  Copyright 2010 - 2012 Flurry, Inc. All rights reserved.\n//\n//  Methods in this header file are for use with Flurry\n//\n\n#import <UIKit/UIKit.h>\n\ntypedef enum {\n    WEB_BANNER = 1,\n    WEB_TAKEOVER = 2,\n    VIDEO_TAKEOVER = 3,\n    AD_BANNER = 4,\n    AD_TAKEOVER = 5,\n    NETWORK_BANNER = 6,\n    NETWORK_TAKEOVER = 7\n} FlurryAdType;\n\n/*!\n *  @brief Provides all available delegates for receiving callbacks related to Ad Serving.\n *  \n *  Set of methods that allow developers to manage and take actions within\n *  different phases of App ad display.\n *  \n *  @note This class serves as a delegate for FlurryAds. \\n\n *  For additional information on how to use Flurry's Ads SDK to\n *  attract high-quality users and monetize your user base see <a href=\"http://wiki.flurry.com/index.php?title=Publisher\">Support Center - Publisher</a>.\n *  @author 2010 - 2012 Flurry, Inc. All Rights Reserved.\n *  @version 4.2.0\n * \n */\n@protocol FlurryAdDelegate <NSObject>\n\n@optional\n\n/*!\n *  @brief Invoked when an ad is received for the specified @c adSpace.\n *  @since 4.1\n * \n *  This method informs the app that an ad has been received and is available for display. \n *\n *  @see FlurryAds#fetchAdForSpace:frame:size: for details on the method that will invoke this delegate.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n */\n- (void) spaceDidReceiveAd:(NSString*)adSpace;\n\n/*!\n *  @brief Invoked when an ad can not be retrieved for the specified @c adSpace.\n *  @since 4.1\n * \n *  This method informs the app that an ad has failed to be received for the given adSpace. \n *\n *  @see FlurryAds#fetchAdForSpace:frame:size: for details on the method that will invoke this delegate.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  @param error The error, if known, that caused ads not to be received.\n *  be splash screen for SPLASH_AD.\n */\n- (void) spaceDidFailToReceiveAd:(NSString*)adSpace error:(NSError *)error;\n\n/*!\n *  @brief Invoked when an ad is about to display on the specified @c adSpace.\n *  @since 4.1.0\n *\n *  This method informs the app that an ad is about to be displayed. You can decide at this point not to show this ad by simply returning NO.\n *\n *  @see FlurryAds#displayAdForSpace:view: for details on the method that will invoke this delegate. \\n\n *  FlurryAds#fetchAndDisplayAdForSpace:view:size: for details on the method that will invoke this delegate.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n *  @param interstitial YES/NO if the space to display will be an interstitial.\n */\n- (BOOL) spaceShouldDisplay:(NSString*)adSpace interstitial:(BOOL)interstitial;\n\n/*!\n *  @brief [Deprecated] This method is deprecated. -[spaceShouldDisplay:interstitial:] should be used.\n */\n- (BOOL)spaceShouldDisplay:(NSString*)adSpace  forType:(FlurryAdType)type;\n\n/*!\n *  @brief Invoked when an ad fails to render.\n *  @since 4.0.0\n * \n *  This method informs the user an ad was retrieved, however, was unsuccessful in displaying to the user (could be lost network connectivity for example).\n *\n *  @see FlurryAds#displayAdForSpace:view: for details on the method that will invoke this delegate. \\n\n *  FlurryAds#fetchAndDisplayAdForSpace:view:size: for details on the method that will invoke this delegate.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  @param error The error, if known, that caused ads not to be rendered.\n *  be splash screen for SPLASH_AD.\n */\n- (void) spaceDidFailToRender:(NSString *)space error:(NSError *)error;\n\n/*!\n *  @brief Invoked when the ad will be removed.\n *  @since 4.1\n * \n *  This method informs the app that an ad will be removed. \n *\n *  @param adSpace The placement of an ad in your app, where placement may be splash screen for SPLASH_AD.\n *  @param interstitial YES/NO indicates if space being removed is an interstitial\n *  \n */\n- (void)spaceWillDismiss:(NSString *)adSpace interstitial:(BOOL)interstitial;\n\n/*!\n *  @brief Invoked when the ad has been removed.\n *  @since 4.0.0\n * \n *  This method informs the app that an ad has closed. You can use this to resume app\n *  states.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n *  @param interstitial YES/NO indicates if space being removed is an interstitial\n */\n- (void)spaceDidDismiss:(NSString *)adSpace interstitial:(BOOL)interstitial;\n\n/*!\n *  @brief Invoked when the ad has been selected that will take the user out of the app.\n *  @since 4.0.0\n * \n *  This method informs the app that an ad has been clicked and the user is about to be taken outside the app.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n */\n- (void)spaceWillLeaveApplication:(NSString *)adSpace;\n\n/*!\n *  @brief Invoked when a space will be expanded.\n *  @since 4.1\n * \n *  This method informs the app an ad space (typcially a banner) will be expanded. Apps should pause their state when they receive this notification\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n */\n- (void) spaceWillExpand:(NSString *)adSpace;\n\n/*!\n *  @brief Invoked when a space will be collapsed.\n *  @since 4.1\n * \n *  This method informs the app an ad space (typcially a banner) will be collapsed.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n */\n- (void) spaceWillCollapse:(NSString *)adSpace;\n\n/*!\n *  @brief Invoked when a space has been collapsed.\n *  @since 4.1\n * \n *  This method informs the app an ad space (typcially a banner) has been collapsed. Apps should resume their state when they receive this notification\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n */\n - (void) spaceDidCollapse:(NSString *)adSpace;\n\n/*!\n *  @brief Informational callback invoked when an ad is clicked for the specified @c adSpace.\n *  @since 4.1\n *\n *  This method informs the app that an ad has been clicked. This should not be used to adjust state of an app. It is only intended for informational purposes.\n *\n *  @param adSpace The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n */\n- (void) spaceDidReceiveClick:(NSString*)adSpace;\n\n\n/*!\n *  @brief Invoked when a video finishes playing\n *  @since 4.2.0\n *\n *  This method informs the app that a video associated with an ad has finished playing\n *\n *  @param adSpace The placement of an ad in your app, where placement may be splash screen for SPLASH_AD.\n *\n */\n- (void)videoDidFinish:(NSString *)adSpace;\n\n\n@optional\n\n#pragma mark App Keys\n/** @name Third party network Calls\n *  Optional calls to pass information needed to display ads through 3rd parties. \n */\n//@{\n\n/*!\n *  @brief The Millennial APID.\n *  @since 4.0.0\n * \n *  This is the id for your app as set in Millennial, found here: https://developer.millennialmedia.com/Application/index.php#manageApps.\n */\n- (NSString *)appSpotMillennialAppKey; //your millennial APID, found here: https://developer.millennialmedia.com/Application/index.php#manageApps\n\n/*!\n *  @brief The Millennial APID for interstitials.\n *  @since 4.0.0\n * \n *  This is the id for your app as set in Millennial, found here: https://developer.millennialmedia.com/Application/index.php#manageApps.\n */\n- (NSString *)appSpotMillennialInterstitalAppKey;\n\n/*!\n *  @brief The InMobi APID.\n *  @since 4.0.0\n * \n *  This is the id for your app as set in InMobi, found here: https://www.inmobi.com/pub/mysite.html?platFormType=all\n */\n- (NSString *)appSpotInMobiAppKey;\n\n/*!\n *  @brief The AdMob Publisher Id.\n *  @since 4.0.0\n * \n *  This is the id for your app as set in AdMob, found here: http://www.admob.com/my_sites/ (click manage settings)\n */\n- (NSString *)appSpotAdMobPublisherID;\n\n/*!\n *  @brief The Mobclix Application Id.\n *  @since 4.0.0\n * \n *  This is the id for your app as set in Mobclix \n */\n- (NSString *)appSpotMobclixApplicationID; \n\n/*!\n *  @brief The Jumptap Publisher Id.\n *  @since 4.1.2\n * \n *  This is the pub id for your app as set in Jumptap \n */\n- (NSString *)appSpotJumptapPublisherID;\n\n/*!\n *  @brief The Jumptap Site Id.\n *  @since 4.1.2\n *\n *  This is the site id for your app as set in Jumptap. It is an optional parameter.\n */\n- (NSString *)appSpotJumptapSiteID;\n\n/*!\n *  @brief Jumptap Banner Ad Spot ID\n *  @since 4.1.2\n *\n *  This is the ad spot id for a Banner (320x50) ad spot set in JumpTap\n */\n- (NSString *)appSpotJumptapBannerAdSpotID;\n\n/*!\n *  @brief Jumptap Leaderboard Ad Spot ID\n *  @since 4.1.2\n *\n *  This is the ad spot id for a Leaderboard (720x90) ad spot set in JumpTap\n */\n- (NSString *)appSpotJumptapLeaderboardAdSpotID;\n\n/*!\n *  @brief Jumptap Medium Rectange Ad Spot ID\n *  @since 4.1.2\n *\n *  This is the ad spot id for a Medium Rectangle (320x50) ad spot set in JumpTap.\n *  The Medium Rectangle Ad Spot ID will be used whenever the ad frame can fit it\n *  (e.g. interstitial ads).\n */\n- (NSString *)appSpotJumptapMediumRectangleAdSpotID;\n\n/*!\n *  @brief The Greystripe Application Id.\n *  @since 4.0.0\n * \n *  This is the id for your app as set in Greystripe \n */\n- (NSString *)appSpotGreystripeApplicationID;\n\n\n#pragma mark Information\n\n\n#pragma mark Callbacks\n\n/*!\n *  @brief [Deprecated] Allow you to set your rootViewController.\n *  @since 4.0.0\n *  @deprecated\n * \n *  This method has been deprecated.  Please call FlurryAds#initialze: instead.\n *\n */\n- (id)appSpotRootViewController;\n\n#pragma mark Optional settings\n\n/**\n Some networks support accelerometer-enabled ads.  \n */\n/*!\n *  @brief For networks that support accelerometer-enabled ads.\n *  @since 4.0.0\n * \n *  This method allows you to enable accelerometer based ads for networks that support this setting via the client sdk. Set to NO if your app uses the accelerometer\n to avoid conflict. Set to YES if you want the special ads. Default is NO.\n */\n- (BOOL)appSpotAccelerometerEnabled;\n\n//@}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/FlurryAds/FlurryAds.h",
    "content": "//\n//  FlurryAds.h\n//  Flurry iOS Analytics Agent\n//\n//  Copyright 2009-2012 Flurry, Inc. All rights reserved.\n//\t\n//\tMethods in this header file are for use by Flurry Publishers\n\n#import <UIKit/UIKit.h>\n\ntypedef enum {\n    BANNER_TOP    = 1,\n    BANNER_BOTTOM = 2,\n    FULLSCREEN    = 3,\n} FlurryAdSize;\n\n@protocol FlurryCustomAdNetwork;\n@protocol FlurryCustomAdNetworkProperties;\n\n/*!\n *  @brief Provides all available methods for displaying ads.\n * \n *  Set of methods that allow publishers to configure, target, and deliver ads to their customers.\n *  \n *  @note This class depends on Flurry.h.\n *  For information on how to use Flurry's Ads SDK to\n *  attract high-quality users and monetize your user base see <a href=\"http://support.flurry.com/index.php?title=Publishers\">Support Center - Publishers</a>.\n *  \n *  @author 2009 - 2012 Flurry, Inc. All Rights Reserved.\n *  @version 4.2.0\n * \n */\n@interface FlurryAds : NSObject {\n}\n\n/*!\n *  @brief Retrieves an ad for the given @c space.\n *  @since 4.1.0\n * \n *  This method will attempt to retrieve ads for the given space from the Flurry server.\n * \n *  @note The @c space simply represents the placement of the ad in your app and should be \n *  unique for each placement. For example, if you are displaying a full screen ad on your \n *  splash screen and after level completeion, you may have the following spaces \n *  @c @\"SPLASH_AD\" and @c @\"LEVEL_AD\".\n * \n *  @see #removeAdFromSpace: for details on manually removing an ad from a view. \\n\n *  FlurryAdDelegate#spaceDidReceiveAd: for details on the notification of ads being received.\n *  FlurryAdDelegate#spaceDidFailToReceiveAd:error: for details on notification of failure to receive ads from this request.\n *  #displayAdForSpace: for details on displaying an available ad.\n *\n *  @code\n *  - (void)fetchAd:(NSString *)placement \n {\n    // Placement may be SPLASH_AD as noted above\n    [FlurryAds fetchAdForSpace:placement view:self.view.frame size:FULLSCREEN]; \n }\n \n    // Show whenever delegate is invoked\n - (void) spaceDidReceiveAd:(NSString *)adSpace {\n    // Received Ad\n    [FlurryAds displayAdForSpace:adSpace];\n }\n    // Alternatively, try to display at a certain point in the app\n - (void) levelComplete {\n    if([FlurryAds adReadyForSpace:adSpace]) {\n        [FlurryAds displayAdForSpace:adSpace];\n    }\n }\n *  @endcode\n * \n *  @param space The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n *  @param frame The frame of the view that will be used for the ad container. Note: for fullscreen ads, this value is not used (you can pass in bounds of window).\n *  @param size The default size of an ad space. This can be overriden on the server. See @c FlurryAdSize in the FlurryAds.h file for allowable values.\n */\n+(void) fetchAdForSpace:(NSString*)space frame:(CGRect)frame size:(FlurryAdSize)size;\n\n/*!\n *  @brief Returns if an ad is currently ready to display for a given @c space.\n *  @since 4.1.0\n * \n *  This method will verify if there is an ad is currently available for this \n *  user. If an ad is not available, you may call #fetchAdForSpace:view:size: to load a new ad.\n * \n *  @note If this method returns YES, an ad will be available when you attempt to display an ad. However, it is still advisable to listen to the delegate FlurryAdsDelegate#spaceDidFailToRender:. \\n\n The @c space simply represents the placement of the ad in your app and should be \n *  unique for each placement. For example, if you are displaying a full screen ad on your \n *  splash screen and after level completeion, you may have the following spaces \n *  @c @\"SPLASH_AD\" and @c @\"LEVEL_AD\".\n * \n *  @see #fetchAdForSpace:view:size: for details on retrieving an ad.\\n\n    #displayAdForSpace: for details on displaying the available ad.\n *\n *  @code\n *  - (void)showButtonForAd:(NSString *)placement \n {\n // Placement may be SPLASH_AD as noted above\n if([FlurryAds adReadyForSpace:placement]) \n {\n // Show button that ads are available.\n }\n }\n *  @endcode\n * \n *  @param space The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n *\n *  @return YES/NO to indicate if an ad is ready to be displayed.\n */\n+(BOOL) adReadyForSpace:(NSString*)space;\n\n/*!\n *  @brief Display an ad for the given @c space.\n *  @since 4.1.0\n * \n *  This method will display an ad if one is ready for display on the device.\n * \n *  @note The @c space simply represents the placement of the ad in your app and should be \n *  unique for each placement. Only one ad will show at a time for any given ad space. For example, if you are displaying a full screen ad on your \n *  splash screen and after level completeion, you may have the following spaces \n *  @c @\"SPLASH_AD\" and @c @\"LEVEL_AD\".\n * \n *  @see #fetchAdForSpace:view:size: for details on retrieving an ad.\\n\n    #adReadyForSpace: for details on verifying is an ad is ready to be displayed. \\n\n *  #removeAdFromSpace: for details on manually removing an ad from a view. \\n\n *  FlurryAdDelegate#spaceShouldDisplay:forType: for details on controlling whether an ad will display immediately before it is set to be rendered to the user.\n *  FlurryAdDelegate#spaceDidFailToRender:error: for details on notification of error in rendering an ad for this request.\n *\n *  @code\n *  - (void)showFullscreenAd:(NSString *)placement \n {\n // Placement may be SPLASH_AD as noted above\n if([FlurryAds adReadyForSpace:placement])\n {\n    [FlurryAds displayAdForSpace:placement onView:view];\n }\n }\n *  @endcode\n * \n *  @param space The placement of an ad in your app, where placement may\n *  @param view The view to place the ad. The view frame should be identical to the view frame passed in #fetchAdForSpace:frame:size. Note view is not used for interstitials.\n *  be splash screen for SPLASH_AD.\n */\n+ (void)displayAdForSpace:(NSString*)space onView:(UIView *)view;\n\n/*!\n *  @brief Display an ad for the given interstitial @c space.\n *  @since 4.1.0\n * \n *  This method will display an interstitial ad if one is ready for display on the device for specified UIViewController instance\n * \n *  @note The @c space simply represents the placement of the ad in your app and should be \n *  unique for each placement. Only one ad will show at a time for any given ad space. For example, if you are displaying a full screen ad on your \n *  splash screen and after level completeion, you may have the following spaces \n *  @c @\"SPLASH_AD\" and @c @\"LEVEL_AD\".\n * \n *  @see #fetchAdForSpace:view:size: for details on retrieving an ad.\\n\n    #adReadyForSpace: for details on verifying is an ad is ready to be displayed. \\n\n *  #removeAdFromSpace: for details on manually removing an ad from a view. \\n\n *  FlurryAdDelegate#spaceShouldDisplay:forType: for details on controlling whether an ad will display immediately before it is set to be rendered to the user.\n *  FlurryAdDelegate#spaceDidFailToRender:error: for details on notification of error in rendering an ad for this request.\n *\n *  @code\n * in UIViewController based class:\n *  - (void)showFullscreenAd:(NSString *)placement \n {\n // Placement may be SPLASH_AD as noted above\n if([FlurryAds adReadyForSpace:placement])\n {\n    [FlurryAds displayAdForSpace:placement modallyForViewController:self];\n }\n }\n *  @endcode\n * \n *  @param space The placement of an ad in your app, where placement may\n *  @param viewController The viewController to show the fullscreen ad modally.  \n *  Note this method should not be used for banners.\n */\n + (void)displayAdForSpace:(NSString*)space modallyForViewController:(UIViewController *)viewController;\n\n/*!\n *  @brief [Deprecated] Check if an ad is available for the given @c space.\n *  @since 4.0.0\n *  @deprecated\n * \n *  [Deprecated] This method will verify with the Flurry server if an ad is currently available for this \n *  user. If an ad is not available, we recommend not providing the user the \n *  option to view. For example, you may have a button that reads \"See other great apps!\".\n *  That button should only be displayed if this method returns YES.\n * \n *  @note This method has been deprecated. \n * \n *  @see #fetchAdForSpace:view:size: for replacement method.\\n\n * \n *  @param space The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n *  @param view The UIView in your app that the ad will be placed as a subview. Note: for fullscreen ads, this view is not used as a container.\n *  @param size The default size of an ad space. This can be overriden on the server. See @c FlurryAdSize in the FlurryAds.h file for allowable values.\n *  @param timeout The maximum amount of time to wait for the server to return a result. Set this to 0 to check the cache and return immediately.\n *\n *  @return YES/NO to indicate if an ad is available.\n */\n+(BOOL) isAdAvailableForSpace:(NSString*)space view:(UIView *)view size:(FlurryAdSize)size timeout:(int64_t)timeout;\n\n/*!\n *  @brief [Deprecated] Display an ad for the given @c space.\n *  @since 4.0.0\n *  @deprecated\n * \n *  [Deprecated] This method will display an ad if one is available from the Flurry server for this \n *  user.\n * \n *  @note This method has been deprecated.\n * \n *  @see #fetchAndDisplayAdForSpace:view:size:timeout: for replacement method\n * \n *  @param space The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n *  @param view The UIView in your app that the ad will be placed as a subview. Note: for fullscreen ads, this view is not used as a container.\n *  @param size The default size of an ad space. This can be overriden on the server. See @c FlurryAdSize in the FlurryAds.h file for allowable values.\n *  @param timeout The maximum amount of time to wait for the server to return a valid ad. Set this to 0 to display an ad in the background (e.g. - for showing banners).\n *\n *  @return YES/NO to indicate if an ad is available.\n */\n+ (BOOL)showAdForSpace:(NSString*)space view:(UIView *)viewContainer size:(FlurryAdSize)size timeout:(int64_t)timeout;\n\n/*!\n *  @brief Fetch and Display an ad for the given @c space.\n *  @since 4.0.0\n *\n *  This method will display an ad if one is available from the Flurry server for this\n *  user.\n *\n *  @note If this method returns YES, an ad is available for the space within @c timeout. \\n\n *  This is a blocking method that allows you to change the user experience based on availability of an ad. If you would like to display an ad asynchronously, just set timeout to 0. This is useful in the case of banners for instance where the user should not wait for its display. If you are loading async with timeout set to 0, ignore the return value of this method and rely exclusively on the relevant delegate methods listed below\\n\n *  The @c space simply represents the placement of the ad in your app and should be\n *  unique for each placement. Only one ad will show at a time for any given ad space. For example, if you are displaying a full screen ad on your\n *  splash screen and after level completeion, you may have the following spaces\n *  @c @\"SPLASH_AD\" and @c @\"LEVEL_AD\".\n *\n *  @see #adReadyForSpace: for details on verifying is an ad is ready to be displayed. \\n\n *  #removeAdFromSpace: for details on manually removing an ad from a view. \\n\n *  FlurryAdDelegate#spaceDidReceiveAd: for details on the notification of ads being received.\n *  FlurryAdDelegate#spaceDidFailToReceiveAd:error: for details on notification of failure to receive ads from this request.\n *  FlurryAdDelegate#spaceShouldDisplay:forType: for details on controlling whether an ad will display immediately before it is set to be rendered to the user.\n *  FlurryAdDelegate#spaceDidFailToRender:error: for details on notification of error in rendering an ad for this request.\n *\n *  @code\n *  - (void)showFullscreenAd:(NSString *)placement\n {\n // Placement may be SPLASH_AD as noted above\n [FlurryAds fetchAndDisplayAdForSpace:placement view:self.view size:FULLSCREEN timeout:3000];\n \n }\n \n - (void)viewWillAppear:(BOOL)animated\n {\n // Show a banner whenever this view appears\n // Display banner ad completely asyncrhonously by providing timeout == 0\n [FlurryAds fetchAndDisplayAdForSpace:@\"VIEW_XYZ_BANNER_AD\" view:self.view size:BANNER_BOTTOM timeout:0];\n }\n *  @endcode\n *\n *  @param space The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n *  @param view The UIView in your app that the ad will be placed as a subview. Note: for fullscreen ads, this view is not used as a container.\n *  @param size The default size of an ad space. This can be overriden on the server. See @c FlurryAdSize in the FlurryAds.h file for allowable values.\n */\n+ (void)fetchAndDisplayAdForSpace:(NSString*)space view:(UIView *)viewContainer size:(FlurryAdSize)size;\n\n/*!\n *  @brief Removes an ad for the given @c space.\n *  @since 4.0.0\n * \n *  This method will remove an ad if one is currently displaying.\n * \n *  @note The @c space simply represents the placement of the ad in your app and should be \n *  unique for each placement. Only one ad will show at a time for any given ad space. \n * \n *  @see #isAdAvailableForSpace:view:size:timeout: for details on displaying an available ad. \\n\n *  #removeAdFromSpace: for details on manually removing an ad from a view. \\n\n *  FlurryAdDelegate#spaceShouldDisplay:forType: for details on controlling whether an ad will display immediately before it is set to be rendered to the user.\n *\n *  @code\n *  - (void)viewDidUnload \n    {\n        // Remove a banner whenever this view dissapears\n        [FlurryAds removeAdFromSpace:@\"VIEW_XYZ_BANNER_AD\"];\n    }\n *  @endcode\n * \n *  @param space The placement of an ad in your app, where placement may\n *  be splash screen for SPLASH_AD.\n */\n+ (void) removeAdFromSpace:(NSString*)space;\n\n/*!\n *  @brief Initializes the ad serving system.\n *  @since 4.0\n * \n *  This method initializes the ad serving system and can be used to pre-cache ads from the server (this is done when ad spaces are configured on the server).\n * \n *  @note This method must be called sometime after Flurry#startSession:.\n *\n *  @code\n *  - (void)applicationDidFinishLaunching:(UIApplication *)application \n    {\n        // Optional Flurry startup methods\n        [Flurry startSession:@\"YOUR_API_KEY\"];\n        [FlurryAds setAdDelegate:self];\n        [FlurryAds initialize:myWindow.rootViewController];\n \n        // ....\n    }\n *  @endcode\n * \n *  @param rvc The primary root view controller of your app.\n *\n */\n+ (void) initialize: (UIViewController *)rvc;\n\n/*!\n *  @brief Sets the object to receive various delegate methods.\n *  @since 4.0\n * \n *  This method allows you to register an object that will receive \n *  notifications at different phases of ad serving.\n * \n *  @see FlurryAdDelegate.h for details on delegates available.\n *\n *  @code\n *  - (void)applicationDidFinishLaunching:(UIApplication *)application \n    {\n        // Optional Flurry startup methods\n        [Flurry startSession:@\"YOUR_API_KEY\"];\n        [FlurryAds setAdDelegate:self];\n \n        // ....\n    }\n *  @endcode\n * \n *  @param delegate The object to receive notifications of various ad actions.\n *\n */\n+ (void)setAdDelegate:(id)delegate;\n\n/*!\n *  @brief Informs server to send test ads.\n *  @since 4.0\n * \n *  This method allows you to request test ads from the server.  These ads do not generate revenue so it is CRITICAL this call is removed prior to app submission.\n * \n *\n *  @code\n *  - (void)applicationDidFinishLaunching:(UIApplication *)application \n    {\n        // Optional Flurry startup methods\n        [Flurry startSession:@\"YOUR_API_KEY\"];\n        [FlurryAds enableTestAds:YES];\n \n        // ....\n    }\n *  @endcode\n * \n *  @param enable YES to receive test ads to the device. Not including this method is equivalent to passing NO.\n *\n */\n+ (void)enableTestAds:(BOOL)enable;\n\n/*!\n *  @brief Sets a dictionary of key/value pairs, which will be transmitted to Flurry servers when a user clicks on an ad.\n *  @since 4.0.0\n * \n *  UserCookies allow the developer to specify information on a user executing an ad action. There is one UserCookie object, and on each ad click that UserCookie is transmitted to the Flurry servers. The UserCookie key/value pairs will be transmitted back to the developer via the app callback if one is set. This is useful for rewarded inventory, to identify which of your users should be rewarded when a reward callback is sent.\n * \n *  @note Calling this method with a nil or empty dictionary has no effect. Calling this method a second time with a valid dictionary will replace the previous entries. To clear previously set userCookies, you must call #clearUserCookies.\n *  @see #clearUserCookies for details on removing user cookies set through this method.\n *\n *  @code\n *  - (void)applicationDidFinishLaunching:(UIApplication *)application \n    {\n        // Optional Flurry startup methods\n        [Flurry startSession:@\"YOUR_API_KEY\"];\n \n        NSDictionary *cookies =\n            [NSDictionary dictionaryWithObjectsAndKeys:@\"xyz123\", // Parameter Value\n            @\"UserCharacterId\", // Parameter Name\n            nil];\n        [FlurryAds setUserCookies:cookies];\n \n        // ....\n    }\n *  @endcode\n * \n *  @param userCookies The information about the user executing ad actions. Note: do not transmit personally identifiable information in the user cookies.\n */\n+ (void) setUserCookies:(NSDictionary *) userCookies;\n\n/*!\n *  @brief Removes a previously set dictionary of key/value pairs.\n *  @since 4.0.0\n * \n *  This method removes information from the one UserCookie object.\n * \n *  @see #setUserCookies: for details on setting user cookies.\n *\n */\n+ (void) clearUserCookies;\n\n/*!\n *  @brief Sets a dictionary of key/value pairs, which will be transmitted to Flurry servers when an ad is requested.\n *  @since 4.0.0\n * \n *  Keywords allow the developer to specify information on a user executing an ad action for the purposes of targeting.  There is one keywords object that is transmitted to the Flurry servers on each ad request. If corresponding keywords are matched on the ad server, a subset of targeted ads will be delivered. This allows partners to supply information they track internally, which is not available to Flurry's targeting system.\n * \n *  @note Calling this method with a nil or empty dictionary has no effect. Calling this method a second time with a valid dictionary will replace the previous entries. To clear previously set keywords, you must call #clearKeywords.\n *  @see #clearKeywords for details on removing keywords set through this method.\n *\n *  @code\n *  - (void)applicationDidFinishLaunching:(UIApplication *)application \n    {\n        // Optional Flurry startup methods\n        [Flurry startSession:@\"YOUR_API_KEY\"];\n \n        // Specify that user loves vacations\n        NSDictionary *keywords =\n            [NSDictionary dictionaryWithObjectsAndKeys:@\"vacation\", // Parameter Value\n            @\"UserPreference\", // Parameter Name\n            nil];\n            [FlurryAds setKeywords:keywords];\n \n // ....\n }\n *  @endcode\n * \n *  @param keywords The information about the user to be used in targeting an ad. Note: do not transmit personally identifiable information in keywords.\n */\n+ (void) setKeywordsForTargeting:(NSDictionary*) keywords;\n\n/*!\n *  @brief Removes a previously set dictionary of key/value pairs.\n *  @since 4.0.0\n * \n *  This method removes information from the one keywords object.\n * \n *  @see #setKeywords: for details on setting keywords.\n *\n */\n+ (void) clearKeywords;\n\n/*!\n *  @brief Method to add a custom ad network to be served through the standard Flurry ad system.\n *  @since 4.0.0\n * \n *  This method adds a network with the necessary publisher supplied properties to the Flurry sdk.\n * \n *  @see @c FlurryCustomAdNetwork and @c FlurryCustomAdNetworkProperties for details.\n *\n */\n+ (void) addCustomAdNetwork:(Class<FlurryCustomAdNetwork>)adNetworkClass withProperties:(id<FlurryCustomAdNetworkProperties>)adNetworkProperties;\n\n\n@end"
  },
  {
    "path": "cocos2d/plugin/plugins/flurry/proj.ios/PluginFlurry.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tFA09A376168AFD41008C1C7B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA09A375168AFD41008C1C7B /* Foundation.framework */; };\n\t\tFA73FC9117A11B84007E23C2 /* AdsFlurry.m in Sources */ = {isa = PBXBuildFile; fileRef = FA73FC8F17A11B84007E23C2 /* AdsFlurry.m */; };\n\t\tFA73FC9617A11E24007E23C2 /* libFlurryAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA73FC9517A11E24007E23C2 /* libFlurryAds.a */; };\n\t\tFAB6DFDD1756F22200C90D89 /* libFlurry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAB6DFDB1756F22200C90D89 /* libFlurry.a */; };\n\t\tFAB6DFE01756F29800C90D89 /* AnalyticsFlurry.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB6DFDF1756F29800C90D89 /* AnalyticsFlurry.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tFA09A370168AFD41008C1C7B /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/${PRODUCT_NAME}\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\tFA09A372168AFD41008C1C7B /* libPluginFlurry.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPluginFlurry.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFA09A375168AFD41008C1C7B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\tFA73FC8E17A11B84007E23C2 /* AdsFlurry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdsFlurry.h; sourceTree = \"<group>\"; };\n\t\tFA73FC8F17A11B84007E23C2 /* AdsFlurry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdsFlurry.m; sourceTree = \"<group>\"; };\n\t\tFA73FC9017A11B84007E23C2 /* PluginFlurry-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"PluginFlurry-Prefix.pch\"; sourceTree = \"<group>\"; };\n\t\tFA73FC9317A11E24007E23C2 /* FlurryAdDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlurryAdDelegate.h; sourceTree = \"<group>\"; };\n\t\tFA73FC9417A11E24007E23C2 /* FlurryAds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlurryAds.h; sourceTree = \"<group>\"; };\n\t\tFA73FC9517A11E24007E23C2 /* libFlurryAds.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libFlurryAds.a; sourceTree = \"<group>\"; };\n\t\tFA86650E168BE22D0073E055 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };\n\t\tFAB6DFD81756F22200C90D89 /* Flurry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Flurry.h; sourceTree = \"<group>\"; };\n\t\tFAB6DFDB1756F22200C90D89 /* libFlurry.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libFlurry.a; sourceTree = \"<group>\"; };\n\t\tFAB6DFDE1756F29800C90D89 /* AnalyticsFlurry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnalyticsFlurry.h; sourceTree = \"<group>\"; };\n\t\tFAB6DFDF1756F29800C90D89 /* AnalyticsFlurry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnalyticsFlurry.m; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tFA09A36F168AFD41008C1C7B /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFA09A376168AFD41008C1C7B /* Foundation.framework in Frameworks */,\n\t\t\t\tFAB6DFDD1756F22200C90D89 /* libFlurry.a in Frameworks */,\n\t\t\t\tFA73FC9617A11E24007E23C2 /* libFlurryAds.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tFA09A367168AFD41008C1C7B = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA73FC8E17A11B84007E23C2 /* AdsFlurry.h */,\n\t\t\t\tFA73FC8F17A11B84007E23C2 /* AdsFlurry.m */,\n\t\t\t\tFA73FC9017A11B84007E23C2 /* PluginFlurry-Prefix.pch */,\n\t\t\t\tFAB6DFDE1756F29800C90D89 /* AnalyticsFlurry.h */,\n\t\t\t\tFAB6DFDF1756F29800C90D89 /* AnalyticsFlurry.m */,\n\t\t\t\tFAB6DFD81756F22200C90D89 /* Flurry.h */,\n\t\t\t\tFAB6DFDB1756F22200C90D89 /* libFlurry.a */,\n\t\t\t\tFA73FC9217A11E24007E23C2 /* FlurryAds */,\n\t\t\t\tFA09A374168AFD41008C1C7B /* Frameworks */,\n\t\t\t\tFA09A373168AFD41008C1C7B /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA09A373168AFD41008C1C7B /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA09A372168AFD41008C1C7B /* libPluginFlurry.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA09A374168AFD41008C1C7B /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA86650E168BE22D0073E055 /* SystemConfiguration.framework */,\n\t\t\t\tFA09A375168AFD41008C1C7B /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA73FC9217A11E24007E23C2 /* FlurryAds */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA73FC9317A11E24007E23C2 /* FlurryAdDelegate.h */,\n\t\t\t\tFA73FC9417A11E24007E23C2 /* FlurryAds.h */,\n\t\t\t\tFA73FC9517A11E24007E23C2 /* libFlurryAds.a */,\n\t\t\t);\n\t\t\tpath = FlurryAds;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tFA09A371168AFD41008C1C7B /* PluginFlurry */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = FA09A380168AFD41008C1C7B /* Build configuration list for PBXNativeTarget \"PluginFlurry\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tFA09A36E168AFD41008C1C7B /* Sources */,\n\t\t\t\tFA09A36F168AFD41008C1C7B /* Frameworks */,\n\t\t\t\tFA09A370168AFD41008C1C7B /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = PluginFlurry;\n\t\t\tproductName = libPluginFlurry;\n\t\t\tproductReference = FA09A372168AFD41008C1C7B /* libPluginFlurry.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tFA09A369168AFD41008C1C7B /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0460;\n\t\t\t\tORGANIZATIONNAME = zhangbin;\n\t\t\t};\n\t\t\tbuildConfigurationList = FA09A36C168AFD41008C1C7B /* Build configuration list for PBXProject \"PluginFlurry\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = FA09A367168AFD41008C1C7B;\n\t\t\tproductRefGroup = FA09A373168AFD41008C1C7B /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tFA09A371168AFD41008C1C7B /* PluginFlurry */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tFA09A36E168AFD41008C1C7B /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFAB6DFE01756F29800C90D89 /* AnalyticsFlurry.m in Sources */,\n\t\t\t\tFA73FC9117A11B84007E23C2 /* AdsFlurry.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\tFA09A37E168AFD41008C1C7B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFA09A37F168AFD41008C1C7B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tFA09A381168AFD41008C1C7B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/libPluginFlurry.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginFlurry-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../platform/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/FlurryAds\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = PluginFlurry;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFA09A382168AFD41008C1C7B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/libPluginFlurry.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginFlurry-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../platform/ios\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/FlurryAds\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = PluginFlurry;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tFA09A36C168AFD41008C1C7B /* Build configuration list for PBXProject \"PluginFlurry\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFA09A37E168AFD41008C1C7B /* Debug */,\n\t\t\t\tFA09A37F168AFD41008C1C7B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tFA09A380168AFD41008C1C7B /* Build configuration list for PBXNativeTarget \"PluginFlurry\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFA09A381168AFD41008C1C7B /* Debug */,\n\t\t\t\tFA09A382168AFD41008C1C7B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = FA09A369168AFD41008C1C7B /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/NdComPlatform.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginNd91</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libIAPAlipay\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>91SDK_LibProject_complete</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tpackage=\"com.nd.commplatform.activity1\" android:versionCode=\"1\"\n\tandroid:versionName=\"3.2.0\"\n\tandroid:installLocation=\"preferExternal\">\n \n\t<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\t<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>\n\t<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n\t<uses-permission android:name=\"android.permission.SEND_SMS\"/> \n\t<uses-permission android:name=\"android.permission.INTERNET\"/>\n\t<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n\t<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>\n\t<uses-permission android:name=\"android.permission.CALL_PHONE\" /> \n    <uses-permission android:name=\"android.permission.GET_TASKS\" />\n    <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n     \n\t\t \n\n\t<application    android:debuggable=\"true\">\n  \n \n\t\n\t\t<activity android:name=\"com.nd.commplatform.activity.SNSControlCenterActivity\"\n\t\t\tandroid:configChanges=\"orientation|keyboardHidden|navigation|screenSize\"\n\t\t\tandroid:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n\t\t\tandroid:windowSoftInputMode=\"adjustPan\" android:windowBackground=\"@null\"\n\t\t\tandroid:launchMode=\"singleTask\"/>\n\t\t\t \n\t\t<activity android:name=\"com.nd.commplatform.activity.SNSLoginActivity\"\n\t\t    android:configChanges=\"orientation|keyboardHidden|navigation|screenSize\"\n\t\t\tandroid:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n\t\t\tandroid:windowSoftInputMode=\"adjustPan\" android:screenOrientation=\"landscape\"\n\t\t\tandroid:windowBackground=\"@null\"\n\t\t\tandroid:launchMode=\"singleTask\"/>\t\n\t\t\t\n\t\t<activity android:name=\".SNSAppPromotionActivity\"\n\t\t    android:configChanges=\"orientation|keyboardHidden|navigation|screenSize\"\n\t\t\tandroid:windowSoftInputMode=\"adjustPan\"  \n            android:theme=\"@android:style/Theme.NoTitleBar\"\n\t\t\tandroid:windowBackground=\"@null\"/>\t\n\t\t\t\n\t\t\n\t\t<service  android:name=\"com.nd.commplatform.service.NdDownloadService\"\n\t\t          android:process=\":com.nd.commplatform.download\"\n\t\t          android:enabled=\"true\"\n                  android:exported=\"false\"/>\n\t\t\t\n\t\t<receiver android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateNotify\"\n\t\t\tandroid:process=\"android.intent.nd.sns.commplatform.versionupdate\" android:exported=\"false\"/> \n\t\t \n\t\t<service android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateService\"\n\t\t\tandroid:process=\"android.intent.nd.sns.commplatform.versionupdate\" android:exported=\"false\"/>\n\t\t\n\t\t<service  android:name=\"com.nd.commplatform.service.NdNewMessageNotification\"\n\t\t          android:enabled=\"true\"\n                  android:exported=\"false\"/>\n       \n\n\t\t \n \n \t\t  \n\t\t\n\t \n</application>\n \n  \n \n\t<supports-screens android:anyDensity=\"true\"\n\t\tandroid:smallScreens=\"true\" android:normalScreens=\"true\"\n\t\tandroid:largeScreens=\"true\" />\n\n\t \n\n \n</manifest> "
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system use,\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n\n# Project target.\ntarget=android-16\nandroid.library=true\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipin.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:interpolator=\"@android:anim/overshoot_interpolator\">\n    <translate\n        android:fromXDelta=\"100%p\"\n        android:toXDelta=\"0\"\n        android:duration=\"500\"/>\n</set>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipin_reverse.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:interpolator=\"@android:anim/overshoot_interpolator\">\n    <translate\n        android:fromXDelta=\"-100%p\"\n        android:toXDelta=\"0\"\n        android:duration=\"500\"/>\n</set>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:interpolator=\"@android:anim/overshoot_interpolator\">\n    <translate\n        android:fromXDelta=\"0\"\n        android:toXDelta=\"-100%p\"\n        android:duration=\"500\"/>\n</set>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipout_reverse.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:interpolator=\"@android:anim/overshoot_interpolator\">\n    <translate\n        android:fromXDelta=\"0\"\n        android:toXDelta=\"100%p\"\n        android:duration=\"500\"/>\n</set>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_background_xml.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bitmap android:src=\"@drawable/nd3_background\" android:tileMode=\"repeat\"\n  xmlns:android=\"http://schemas.android.com/apk/res/android\" />"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_button2\" /> \n    <item android:drawable=\"@drawable/nd3_button1\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_02.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n     \n    <item android:state_enabled=\"false\" android:drawable=\"@drawable/nd3_button_bg_dis02\" />\n \n    <item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_button_bg_02_press\" />\n    <item android:drawable=\"@drawable/nd3_button_bg_02\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_action.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_button_long_press\" /> \n    <item android:drawable=\"@drawable/nd3_button_long\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_logout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_bnt_zhuxiao\" />\n    <item android:state_enabled=\"false\" android:drawable=\"@drawable/nd3_bnt_zhuxiao\" />\n    <item android:drawable=\"@drawable/nd3_bnt_zhuxiao\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_old.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n \n    <item android:state_enabled=\"false\" android:drawable=\"@drawable/nd3_button_bg_dis\" /> \n\n    <!-- Pressed --> \n    <!-- <item android:drawable=\"@drawable/nd_button_bg\" /> -->\n    <item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_button_130_03\" />\n    <item android:drawable=\"@drawable/nd3_button_130_01\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_x.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_button2\" /> \n    <item android:drawable=\"@drawable/nd3_button_x1\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_checkbox_button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_checked=\"false\" android:drawable=\"@drawable/nd3_image81\" />\n    <item android:drawable=\"@drawable/nd3_image82\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_friend_del_button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd3_redbtn_down\" />\n    <item android:drawable=\"@drawable/nd3_redbtn\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_image_48_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?> \n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:shape=\"rectangle\" > \n    <solid android:color=\"@color/nd3_white\" /> \n    <corners android:radius=\"5dip\"/>\n    <size\n    android:width=\"48dip\"\n    android:color=\"#00000000\"\n    android:height=\"48dip\"/>\n</shape>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_input_gray.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_focused=\"true\"   android:drawable=\"@drawable/nd3_input_2\" />\n    <item android:drawable=\"@drawable/nd3_input_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_message_item_1_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@color/nd3_blue\" />\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n    <item android:state_checked=\"true\" android:drawable=\"@color/nd3_blue\" />\n    <item android:state_selected=\"true\" android:drawable=\"@color/nd3_blue\" />\n    <item android:drawable=\"@color/nd3_list_view_item_bg_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_message_item_2_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@color/nd3_blue\" />\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n    <item android:state_checked=\"true\" android:drawable=\"@color/nd3_blue\" />\n    <item android:state_selected=\"true\" android:drawable=\"@color/nd3_blue\" />\n    <item android:drawable=\"@color/nd3_list_view_item_bg_2\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_pay_checkbox_button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_checked=\"false\" android:drawable=\"@drawable/nd3_icon_21\" />\n    <item android:drawable=\"@drawable/nd3_icon_22\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_progress_large.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n/*\n**\n** Copyright 2009, The Android Open Source Project\n**\n** Licensed under the Apache License, Version 2.0 (the \"License\"); \n** you may not use this file except in compliance with the License. \n** You may obtain a copy of the License at \n**\n**     http://www.apache.org/licenses/LICENSE-2.0 \n**\n** Unless required by applicable law or agreed to in writing, software \n** distributed under the License is distributed on an \"AS IS\" BASIS, \n** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n** See the License for the specific language governing permissions and \n** limitations under the License.\n*/\n-->\n<rotate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:pivotX=\"50%\" android:pivotY=\"50%\"\n        android:fromDegrees=\"0\" android:toDegrees=\"360\">\n        \n    <shape\n            android:shape=\"ring\"\n            android:innerRadiusRatio=\"3\"\n            android:thicknessRatio=\"8\"\n            android:useLevel=\"false\">\n\n        <size\n                android:width=\"76dip\"\n                android:height=\"76dip\"\n        />\n        \n        <gradient\n                android:type=\"sweep\"\n                android:useLevel=\"false\"\n                android:startColor=\"#7fbcbcbc\"\n                android:centerY=\"0.50\"\n                android:endColor=\"#7f6e6e6e\"\n        />\n        \n    </shape>\n    \n</rotate>\n    \n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_left_btn_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- Non focused states -->\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd3_rank_choice_left_2\" />\n\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n<!--Focused states-->\n    <item android:state_checked=\"true\" android:drawable=\"@drawable/nd3_rank_choice_left_2\" />\n    <item android:state_selected=\"true\" android:drawable=\"@drawable/nd3_rank_choice_left_2\" />\n\n    <!-- Pressed -->\n    \n    <item android:drawable=\"@drawable/nd3_rank_choice_left_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_middle_btn_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- Non focused states -->\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd3_rank_choice_middle_2\" />\n\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n<!--Focused states-->\n    <item android:state_checked=\"true\" android:drawable=\"@drawable/nd3_rank_choice_middle_2\" />\n    <item android:state_selected=\"true\" android:drawable=\"@drawable/nd3_rank_choice_middle_2\" />\n\n    <!-- Pressed -->\n    \n    <item android:drawable=\"@drawable/nd3_rank_choice_middle_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_right_btn_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- Non focused states -->\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd3_rank_choice_right_2\" />\n\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n<!--Focused states-->\n    <item android:state_checked=\"true\" android:drawable=\"@drawable/nd3_rank_choice_right_2\" />\n    <item android:state_selected=\"true\" android:drawable=\"@drawable/nd3_rank_choice_right_2\" />\n\n    <!-- Pressed -->\n    \n    <item android:drawable=\"@drawable/nd3_rank_choice_right_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_regist_checked.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- Non focused states --> \n    <item android:state_checked=\"true\" android:drawable=\"@drawable/nd3_icon_selected\" />\n\n    <!-- Pressed -->\n    <item android:drawable=\"@drawable/nd3_button_radio\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_round_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?> \n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:shape=\"rectangle\" > \n    <solid android:color=\"@color/nd3_white\" /> \n    <corners android:radius=\"10dip\"/>\n    \n    <padding android:left=\"0dp\" android:top=\"0dp\" android:right=\"0dp\" \n        android:bottom=\"0dp\"/> \n        \n   \n</shape>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_square_checkbox_button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_checked=\"false\" android:drawable=\"@drawable/nd3_icon_05\" />\n    <item android:drawable=\"@drawable/nd3_icon_06\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_action_btn_xml.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector\n  xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_title_bar_action_btn_pressed\" />\n    <item android:drawable=\"@drawable/nd3_title_bar_action_btn\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_return_btn_xml.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector\n  xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\" android:drawable=\"@drawable/nd3_title_bar_return_btn_pressed\" />\n    <item android:drawable=\"@drawable/nd3_title_bar_return_btn\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_user_item_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@color/nd3_blue\" />\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n    <item android:state_checked=\"true\" android:drawable=\"@color/nd3_blue\" />\n    <item android:state_selected=\"true\" android:drawable=\"@color/nd3_blue\" />\n    <item android:drawable=\"@color/nd3_white\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_blue.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_blue2\" />\n    <item android:drawable=\"@drawable/nd_blue1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_button_action_add.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_btn_add_press\" /> \n    <item android:drawable=\"@drawable/nd_btn_add\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_button_action_buy.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_btn_buy_press\" /> \n    <item android:drawable=\"@drawable/nd_btn_buy\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_button_action_reduce.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_btn_reduce_press\" /> \n    <item android:drawable=\"@drawable/nd_btn_reduce\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_c_blur.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"  android:drawable=\"@drawable/nd_c_blur2\" />\n    <item android:drawable=\"@drawable/nd_c_blur1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_download.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_download_2\" /> \n    <item android:drawable=\"@drawable/nd_download_1\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_green.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_green2\" />\n    <item android:drawable=\"@drawable/nd_green1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_left_btn_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- Non focused states -->\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_leaderboard_left_2\" />\n\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n<!--Focused states-->\n    <item android:state_checked=\"true\" android:drawable=\"@drawable/nd_leaderboard_left_2\" />\n    <item android:state_selected=\"true\" android:drawable=\"@drawable/nd_leaderboard_left_2\" />\n\n    <!-- Pressed -->\n    \n    <item android:drawable=\"@drawable/nd_leaderboard_left_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_right_btn_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <!-- Non focused states -->\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_leaderboard_right_2\" />\n\n    <!-- Focused states -->\n    <!-- item android:state_focused=\"true\" android:drawable=\"@drawable/a_sms_item2\" /-->\n<!--Focused states-->\n    <item android:state_checked=\"true\" android:drawable=\"@drawable/nd_leaderboard_right_2\" />\n    <item android:state_selected=\"true\" android:drawable=\"@drawable/nd_leaderboard_right_2\" />\n\n    <!-- Pressed -->\n    \n    <item android:drawable=\"@drawable/nd_leaderboard_right_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_list_btn_delete_selector.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!--\r\n     Copyright (C) 2008 The Android Open Source Project\r\n\r\n     Licensed under the Apache License, Version 2.0 (the \"License\");\r\n     you may not use this file except in compliance with the License.\r\n     You may obtain a copy of the License at\r\n  \r\n          http://www.apache.org/licenses/LICENSE-2.0\r\n  \r\n     Unless required by applicable law or agreed to in writing, software\r\n     distributed under the License is distributed on an \"AS IS\" BASIS,\r\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n     See the License for the specific language governing permissions and\r\n     limitations under the License.\r\r\n-->\r\n\r\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n\r\n    <item android:drawable=\"@drawable/nd_list_btn_delete_pressed\" android:state_pressed=\"true\"/>\r\n    <item android:drawable=\"@drawable/nd_list_btn_delete_normal\"/>\r\n\r\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_land_selector.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_login_btn_pressed_land\" />\n    <item android:drawable=\"@drawable/nd_login_btn_normal_land\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_portrait_selector.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_login_btn_pressed_portrait\" />\n    <item android:drawable=\"@drawable/nd_login_btn_normal_portrait\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_register_btn_portrait_selector.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_register_btn_pressed_portrait\" />\n    <item android:drawable=\"@drawable/nd_register_btn_normal_portrait\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_h.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_slider_handle_h_2\" /> \n    <item android:drawable=\"@drawable/nd_slider_handle_h_1\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_h_expand.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_slider_handle_h_2_expand\" /> \n    <item android:drawable=\"@drawable/nd_slider_handle_h_1_expand\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_v.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_slider_handle_v_2\" /> \n    <item android:drawable=\"@drawable/nd_slider_handle_v_1\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_v_expand.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:state_pressed=\"true\" android:drawable=\"@drawable/nd_slider_handle_v_2_expand\" /> \n    <item android:drawable=\"@drawable/nd_slider_handle_v_1_expand\" />\n</selector>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_white_btn.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n  \n          http://www.apache.org/licenses/LICENSE-2.0\n  \n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\"   android:drawable=\"@drawable/nd_white_btn_2\" />\n    <item android:state_enabled=\"false\"   android:drawable=\"@drawable/nd_white_btn_2\" />\n    <item android:drawable=\"@drawable/nd_white_btn_1\" />\n</selector>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_bind_bind.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_bind_bind_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<!-- 通行证、昵称、密码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 通行证 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_bind_bind_tip_account\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<AutoCompleteTextView\n\t\t\t\tandroid:id=\"@+id/nd3_account_bind_bind_account\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_bind_bind_hint_account\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\n\t\t\t<ImageView\n\t\t\t\tandroid:id=\"@+id/nd3_account_bind_bind_more\"\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\t\tandroid:paddingLeft=\"@dimen/nd3_margin_size\"\n\t\t\t\tandroid:paddingRight=\"@dimen/nd3_margin_size\"\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_01\"\n\t\t\t\t>\n\t\t\t\t\n\t\t\t</ImageView>\t\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_bind_bind_tip_password\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_account_bind_bind_password\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_bind_bind_hint_password\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_account_bind_bind_content\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:text=\"@string/nd3_account_bind_bind_content_format\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\t\t\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t</TextView>\n\t\n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_bind_register.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_bind_register_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\t\n\t<ScrollView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:layout_weight=\"1\"\n\t\t>\n\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:orientation=\"vertical\"\n\t\t\t>\n\t\t\t\n\t\t\t<!-- 通行证、密码 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"vertical\"\n\t\t\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t\t\t>\n\t\t\t\t\n\t\t\t\t<!-- 通行证 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd3_account_bind_register_tip_account\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<AutoCompleteTextView\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_bind_register_account\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:maxLength=\"70\"\n\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_bind_register_hint_account\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\n\t\t\t\t<!-- 分隔线 -->\n\t\t\t\t<ImageView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\t>\n\t\t\t\t</ImageView>\n\t\t\t\t\t\t\n\t\t\t\t<!-- 昵称 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t\t\t>\n\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_nickname\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<EditText\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_bind_register_nickname\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:maxLength=\"10\"\t\t\t\t\n\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_nickname\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</EditText>\n\t\t\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\n\t\t\t\t<!-- 分隔线 -->\n\t\t\t\t<ImageView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\t>\n\t\t\t\t</ImageView>\n\t\t\t\t\t\t\n\t\t\t\t<!-- 密码 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd3_account_bind_register_tip_password\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<EditText\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_bind_register_password\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_bind_register_hint_password\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</EditText>\n\t\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\t\t\t\t\t\n\t\t\t</LinearLayout>\n\t\t\n\t\t\t<!-- 使用条款 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t\t\t>\n\t\t\t\t\n\t\t\t\t<CheckBox\n\t\t\t\t\tandroid:id=\"@+id/nd3_account_bind_register_is_agree\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:button=\"@null\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_square_checkbox_button\"\n\t\t\t\t\tandroid:checked=\"true\"\t\t\t\n\t\t\t\t\t>\n\t\t\t\t</CheckBox>\n\t\t\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:id=\"@+id/nd3_account_bind_register_agreement\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t\tandroid:text=\"@string/nd3_account_bind_register_agreement\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\t\t\t\n\t\t\t\t\t>\n\t\t\t\t</TextView>\n\t\t\t\t\t\t\t\t\n\t\t\t</LinearLayout>\n\n\t\t</LinearLayout>\n\t\t\t\n\t</ScrollView>\n\t\n\t<!-- 注册提示 -->\t\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_account_bind_register_send_sms\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:text=\"@string/nd3_account_register_initial_register\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_register_sendsms_text_size\"\n\t\tandroid:layout_marginBottom=\"0dip\"\n\t\tandroid:paddingTop=\"0dip\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\n\t\t>\n\t</TextView>\n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_email_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n/* //device/apps/common/assets/res/any/layout/simple_spinner_item.xml\n**\n** Copyright 2008, The Android Open Source Project\n**\n** Licensed under the Apache License, Version 2.0 (the \"License\"); \n** you may not use this file except in compliance with the License. \n** You may obtain a copy of the License at \n**\n**     http://www.apache.org/licenses/LICENSE-2.0 \n**\n** Unless required by applicable law or agreed to in writing, software \n** distributed under the License is distributed on an \"AS IS\" BASIS, \n** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n** See the License for the specific language governing permissions and \n** limitations under the License.\n*/\n-->\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\" \n    android:id=\"@+id/nd3_account_email_item_title\"\n    style=\"?android:attr/dropDownItemStyle\"\n    android:textAppearance=\"?android:attr/textAppearanceInverse\"\n    android:singleLine=\"true\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"?android:attr/listPreferredItemHeight\" \n    android:padding=\"5dip\"\n    android:ellipsize=\"marquee\"/>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/nd3_account_login_layout\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\" >\n    \n\n</FrameLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_login_item_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" \n\tandroid:orientation =\"horizontal\"\n\tandroid:gravity=\"center_vertical\"\n\tandroid:paddingLeft=\"0dip\"\n\tstyle=\"@style/nd3_option_item_padding_style\"\t\t\n\t>\n\t\n\t<ImageView\n\t\tandroid:id=\"@+id/nd3_account_login_item_delete\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:paddingLeft=\"10dip\"\n\t\tandroid:paddingRight=\"@dimen/nd3_option_item_marginLeft\"\n\t\tandroid:src=\"@drawable/nd3_icon_08\"\t\t\t\n\t\t>\n\t</ImageView>\n\t\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_account_login_item_title\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_weight=\"1\"\n\t\tandroid:textAppearance=\"?android:attr/textAppearanceMediumInverse\"\n\t\t>\n\t</TextView>\n\n\t<ImageView\n\t\tandroid:id=\"@+id/nd3_account_login_item_checked\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:visibility=\"visible\"\t\t\t\n\t\tandroid:src=\"@drawable/nd3_icon_07\"\n\t\t>\n\t</ImageView>\n\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/nd3_account_login_layout_land\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:gravity=\"center_horizontal\"\n    android:orientation=\"vertical\" >\n\n    <!-- 标题栏 -->\n\n    <RelativeLayout\n        android:id=\"@+id/nd3_title_bar_layout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button>\n\n        <!-- 标题 -->\n\n        <TextView\n            android:id=\"@+id/nd3_title_bar_title\"\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\"\n            android:drawableLeft=\"@drawable/nd3_banner_logo\"\n            android:drawablePadding=\"@dimen/nd3_option_item_marginLeft\"\n            android:text=\"@string/nd3_account_login_title_land\" >\n        </TextView>\n\n        <!-- 右按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_right\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginRight=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_account_login_button_right\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\"\n            android:visibility=\"invisible\" >\n        </Button>\n    </RelativeLayout>\n\n    <!-- 内容 -->\n\n    <ScrollView\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\" >\n\n        <LinearLayout\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"fill_parent\"\n            android:gravity=\"center_horizontal\"\n            android:orientation=\"vertical\" >\n\n            <LinearLayout\n                style=\"@style/nd3_option_margin_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"@dimen/nd3_option_item_marginLeft\"\n                android:layout_marginBottom=\"0dip\"\n                android:orientation=\"horizontal\" >\n\n                <!-- 通行证、密码 -->\n\n                <LinearLayout\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1.0\"\n                    android:background=\"@drawable/nd3_bk1\"\n                    android:orientation=\"vertical\" >\n\n                    <!-- 通行证 -->\n\n                    <LinearLayout\n                        style=\"@style/nd3_option_item_margin_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:gravity=\"center_vertical\"\n                        android:orientation=\"horizontal\" >\n\n                        <TextView\n                            style=\"@style/nd3_option_textview_style\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"@string/nd3_account_login_tip_account\" >\n                        </TextView>\n\n                        <AutoCompleteTextView\n                            android:id=\"@+id/nd3_account_login_account\"\n                            style=\"@style/nd3_option_edittext_style\"\n                            android:layout_width=\"fill_parent\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:hint=\"@string/nd3_account_login_hint_account\"\n                            android:singleLine=\"true\" \n                            android:nextFocusDown=\"@+id/nd3_account_login_password\"\n                            android:inputType=\"textEmailAddress\"\n                            android:imeOptions=\"actionNext\">\n                        </AutoCompleteTextView>\n\n                        <ImageView\n                            android:id=\"@+id/nd3_account_login_more\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"fill_parent\"\n                            android:paddingLeft=\"@dimen/nd3_margin_size\"\n                            android:paddingRight=\"@dimen/nd3_margin_size\"\n                            android:src=\"@drawable/nd3_icon_01\" >\n                        </ImageView>\n                    </LinearLayout>\n\n                    <!-- 分隔线 -->\n\n                    <ImageView\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:background=\"@drawable/nd3_horizontal_line\" >\n                    </ImageView>\n\n                    <!-- 密码 -->\n\n                    <LinearLayout\n                        style=\"@style/nd3_option_item_margin_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:gravity=\"center_vertical\"\n                        android:orientation=\"horizontal\" >\n\n                        <TextView\n                            style=\"@style/nd3_option_textview_style\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"@string/nd3_account_login_tip_password\" >\n                        </TextView>\n\n                        <EditText\n                            android:id=\"@+id/nd3_account_login_password\"\n                            style=\"@style/nd3_option_edittext_style\"\n                            android:layout_width=\"fill_parent\"\n                            android:layout_height=\"wrap_content\"\n                            android:layout_weight=\"1\"\n                            android:hint=\"@string/nd3_account_login_hint_password\"\n                            android:inputType=\"textPassword\"\n                            android:singleLine=\"true\"\n                            android:imeOptions=\"actionDone\" >\n                        </EditText>\n                    </LinearLayout>\n                </LinearLayout>\n\n                <!-- 登录/注册 -->\n\n                <LinearLayout\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"vertical\"\n                    android:layout_gravity=\"center\" >\n\n                    <Button\n                        style=\"@style/nd3_option_textview_style\"\n                        android:id=\"@+id/nd3_account_login_log\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginLeft=\"10dip\"\n                        android:background=\"@drawable/nd_login_btn_land_selector\"\n                        android:text=\"@string/nd3_account_login_title\" \n                        android:textColor=\"@color/nd3_white\"\n                        >\n                    </Button>\n\n                    <LinearLayout \n                        style=\"@style/nd3_option_margin_padding_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_gravity=\"center\"\n                        android:orientation=\"horizontal\" \n                        >\n\n                        <TextView android:id=\"@+id/nd3_account_login_reg_tips\"\n                            style=\"@style/nd3_option_textview_style\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"@string/nd3_account_login_no_account\"\n                            android:textColor=\"@color/nd3_white\"\n                            android:textSize=\"@dimen/nd3_portrait_add_text_size\" \n                            >\n                        </TextView>\n\n                        <TextView\n                            android:id=\"@+id/nd3_account_login_reg\"\n                            android:layout_width=\"wrap_content\"\n                            android:layout_height=\"wrap_content\"\n                            android:text=\"@string/nd3_account_login_no_account_reg\"\n                            android:textColor=\"#FFffff00\"\n                            android:textSize=\"@dimen/nd3_portrait_add_text_size\"\n                            >\n                        </TextView>\n                    </LinearLayout>\n                </LinearLayout>\n            </LinearLayout>\n\n            <!-- 自动登录 -->\n\n            <LinearLayout\n                android:id=\"@+id/nd3_account_login_autologin\"\n                style=\"@style/nd3_option_margin_padding_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"@drawable/nd3_bk1\"\n                android:gravity=\"center_vertical\"\n                android:orientation=\"horizontal\"\n                android:visibility=\"gone\" >\n\n                <TextView\n                    style=\"@style/nd3_option_textview_style\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:text=\"@string/nd3_account_login_tip_auto_login\" >\n                </TextView>\n\n                <CheckBox\n                    android:id=\"@+id/nd3_account_login_is_autologin\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:background=\"@drawable/nd3_checkbox_button\"\n                    android:button=\"@null\" >\n                </CheckBox>\n            </LinearLayout>\n\n            <!-- 其他帐户登录 -->\n\n            <LinearLayout\n                android:id=\"@+id/nd3_account_login_other_layout\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"vertical\"\n                android:visibility=\"gone\" >\n\n                <TextView\n                    style=\"@style/nd3_option_textview_style\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginBottom=\"5dip\"\n                    android:layout_marginLeft=\"10dip\"\n                    android:layout_marginRight=\"10dip\"\n                    android:layout_marginTop=\"10dip\"\n                    android:layout_weight=\"1\"\n                    android:text=\"@string/nd3_account_login_tip_use_other_login\"\n                    android:textColor=\"@color/nd3_white\" >\n                </TextView>\n\n                <LinearLayout\n                    android:id=\"@+id/nd3_account_login_other\"\n                    style=\"@style/nd3_option_margin_style\"\n                    android:layout_marginBottom=\"0dip\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:background=\"@drawable/nd3_bk1\"\n                    android:gravity=\"left|center_vertical\"\n                    android:orientation=\"horizontal\"\n                    android:visibility=\"visible\" >\n                </LinearLayout>\n            </LinearLayout>\n\n            <!-- 忘记密码 -->\n\n            <LinearLayout android:id=\"@+id/nd3_forget_password_layout\"\n                style=\"@style/nd3_option_margin_padding_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:gravity=\"center\"\n                android:orientation=\"horizontal\"\n                android:visibility=\"visible\" >\n\n                <TextView\n                    style=\"@style/nd3_option_textview_style\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/nd3_account_login_tip_forget_password\"\n                    android:textColor=\"@color/nd3_white\"\n                    android:textSize=\"@dimen/nd3_portrait_add_text_size\" >\n                </TextView>\n\n                <TextView\n                    android:id=\"@+id/nd3_account_login_forget_password\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/nd3_account_login_click_to_find\"\n                    android:textColor=\"#FFffff00\"\n                    android:textSize=\"@dimen/nd3_portrait_add_text_size\" >\n                </TextView>\n            </LinearLayout>\n        </LinearLayout>\n    </ScrollView>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_other_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ImageView\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"@dimen/nd3_platform_image_size\"\n\tandroid:layout_height=\"@dimen/nd3_platform_image_size\"\n\tandroid:paddingLeft=\"@dimen/nd3_platform_padding_size\"\n\tandroid:paddingRight=\"@dimen/nd3_platform_padding_size\"\n\tandroid:src=\"@drawable/nd3_3rd_platform_icon\"\n\t\t\t\t\n\t/>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/nd3_account_login_layout_portrait\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:gravity=\"center_horizontal\"\n    android:orientation=\"vertical\" >\n\n    <!-- 标题栏 -->\n\n    <RelativeLayout\n        android:id=\"@+id/nd3_title_bar_layout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button>\n\n        <!-- 标题 -->\n\n        <TextView\n            android:id=\"@+id/nd3_title_bar_title\"\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\"\n            android:text=\"@string/nd3_account_login_title\" >\n        </TextView>\n\n        <!-- 右按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_right\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginRight=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_account_login_button_right\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\"\n            android:visibility=\"invisible\" >\n        </Button>\n    </RelativeLayout>\n\n    <!-- 内容 -->\n\n    <ScrollView\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\" >\n\n        <LinearLayout\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"fill_parent\"\n            android:gravity=\"center_horizontal\"\n            android:orientation=\"vertical\" >\n\n            <!-- 图标 -->\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:src=\"@drawable/nd3_banner\"\n\t\t\t\tandroid:scaleType=\"fitXY\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tandroid:layout_marginBottom=\"0dip\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t/>\n\n            <!-- 通行证、密码 -->\n\n            <LinearLayout\n                style=\"@style/nd3_option_margin_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"@dimen/nd3_margin_size\"\n                android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n                android:background=\"@drawable/nd3_bk1\"\n                android:orientation=\"vertical\" >\n\n                <!-- 通行证 -->\n\n                <LinearLayout\n                    style=\"@style/nd3_option_item_margin_style\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:gravity=\"center_vertical\"\n                    android:orientation=\"horizontal\" >\n\n                    <TextView\n                        style=\"@style/nd3_option_textview_style\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"@string/nd3_account_login_tip_account\" >\n                    </TextView>\n\n                    <AutoCompleteTextView\n                        android:id=\"@+id/nd3_account_login_account\"\n                        style=\"@style/nd3_option_edittext_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_weight=\"1\"\n                        android:hint=\"@string/nd3_account_login_hint_account\"\n                        android:singleLine=\"true\" \n                        android:nextFocusDown=\"@+id/nd3_account_login_password\"\n                        android:inputType=\"textEmailAddress\"\n                        android:imeOptions=\"actionNext\">\n                    </AutoCompleteTextView>\n\n                    <ImageView\n                        android:id=\"@+id/nd3_account_login_more\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"fill_parent\"\n                        android:paddingLeft=\"@dimen/nd3_margin_size\"\n                        android:paddingRight=\"@dimen/nd3_margin_size\"\n                        android:src=\"@drawable/nd3_icon_01\" >\n                    </ImageView>\n                </LinearLayout>\n\n                <!-- 分隔线 -->\n\n                <ImageView\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:background=\"@drawable/nd3_horizontal_line\" >\n                </ImageView>\n\n                <!-- 密码 -->\n\n                <LinearLayout\n                    style=\"@style/nd3_option_item_margin_style\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:gravity=\"center_vertical\"\n                    android:orientation=\"horizontal\" >\n\n                    <TextView\n                        style=\"@style/nd3_option_textview_style\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"@string/nd3_account_login_tip_password\" >\n                    </TextView>\n\n                    <EditText\n                        android:id=\"@+id/nd3_account_login_password\"\n                        style=\"@style/nd3_option_edittext_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_weight=\"1\"\n                        android:hint=\"@string/nd3_account_login_hint_password\"\n                        android:inputType=\"textPassword\"\n                        android:singleLine=\"true\" \n                        android:imeOptions=\"actionDone\">\n                    </EditText>\n                </LinearLayout>\n            </LinearLayout>\n\n            <!-- 注册/登录 -->\n\n            <LinearLayout\n                style=\"@style/nd3_option_margin_style\"\n                android:layout_marginBottom=\"0dip\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:gravity=\"center_vertical\"\n                android:orientation=\"horizontal\"\n                android:visibility=\"visible\" >\n                <TextView android:id=\"@+id/nd3_account_login_reg_tips\" \n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" \n                    android:visibility=\"gone\">\n                </TextView>\n                <Button\n                    style=\"@style/nd3_option_textview_style\"\n                    android:id=\"@+id/nd3_account_login_reg\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_margin=\"3.0dip\"\n                    android:layout_weight=\"1\"\n                    android:background=\"@drawable/nd_register_btn_portrait_selector\"\n                    android:text=\"@string/nd3_account_login_button_left\"\n                    android:textColor=\"@color/nd3_white\" >\n                </Button>\n\n                <Button\n                    style=\"@style/nd3_option_textview_style\"\n                    android:id=\"@+id/nd3_account_login_log\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_margin=\"3.0dip\"\n                    android:layout_weight=\"1\"\n                    android:background=\"@drawable/nd_login_btn_portrait_selector\"\n                    android:text=\"@string/nd3_account_login_title\"\n                    android:textColor=\"@color/nd3_white\" >\n                </Button>\n                \n            </LinearLayout>\n                        \n            <!-- 自动登录 -->\n\n            <LinearLayout\n                android:id=\"@+id/nd3_account_login_autologin\"\n                style=\"@style/nd3_option_margin_padding_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"@drawable/nd3_bk1\"\n                android:gravity=\"center_vertical\"\n                android:orientation=\"horizontal\"\n                android:visibility=\"gone\" >\n\n                <TextView\n                    style=\"@style/nd3_option_textview_style\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:text=\"@string/nd3_account_login_tip_auto_login\" >\n                </TextView>\n\n                <CheckBox\n                    android:id=\"@+id/nd3_account_login_is_autologin\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:background=\"@drawable/nd3_checkbox_button\"\n                    android:button=\"@null\" >\n                </CheckBox>\n            </LinearLayout>\n\n            <!-- 其他帐户登录 -->\n\n            <LinearLayout\n                android:id=\"@+id/nd3_account_login_other_layout\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"vertical\"\n                android:visibility=\"gone\" >\n\n                <TextView\n                    style=\"@style/nd3_option_textview_style\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginTop=\"10dip\"\n                    android:layout_marginBottom=\"5dip\"\n                    android:layout_marginLeft=\"10dip\"\n                    android:layout_marginRight=\"10dip\"\n                    android:layout_weight=\"1\"\n                    android:text=\"@string/nd3_account_login_tip_use_other_login\"\n                    android:textColor=\"@color/nd3_white\" >\n                </TextView>\n\n                <LinearLayout\n                    android:id=\"@+id/nd3_account_login_other\"\n                    style=\"@style/nd3_option_margin_style\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:background=\"@drawable/nd3_bk1\"\n                    android:gravity=\"left|center_vertical\"\n                    android:layout_marginBottom=\"0dip\"\n                    android:orientation=\"horizontal\"\n                    android:visibility=\"visible\" >\n                </LinearLayout>\n            </LinearLayout>\n\n            <!-- 忘记密码 -->\n\n            <LinearLayout  android:id=\"@+id/nd3_forget_password_layout\"\n                style=\"@style/nd3_option_margin_padding_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:gravity=\"center\"\n                android:orientation=\"horizontal\"\n                android:visibility=\"visible\" >\n\n                <TextView\n                    style=\"@style/nd3_option_textview_style\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/nd3_account_login_tip_forget_password\"\n                    android:textColor=\"@color/nd3_white\" \n                    android:textSize=\"@dimen/nd3_portrait_add_text_size\" >\n                </TextView>\n\n                <TextView\n                    android:id=\"@+id/nd3_account_login_forget_password\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/nd3_account_login_click_to_find\"\n                    android:textColor=\"#FFffff00\"\n                    android:textSize=\"@dimen/nd3_portrait_add_text_size\" >\n                </TextView>\n            </LinearLayout>\n        </LinearLayout>\n    </ScrollView>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_oauth_bind.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_bind_bind_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<!-- 说明文字 -->\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_account_bind_bind_content\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:text=\"@string/nd3_account_bind_bind_content\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\t\t\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t</TextView>\n\t\t\n\t<!-- 通行证、昵称、密码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 通行证 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_bind_bind_tip_account\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<AutoCompleteTextView\n\t\t\t\tandroid:id=\"@+id/nd3_account_bind_bind_account\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_bind_bind_hint_account\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\n\t\t\t<ImageView\n\t\t\t\tandroid:id=\"@+id/nd3_account_bind_bind_more\"\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\t\tandroid:paddingLeft=\"@dimen/nd3_margin_size\"\n\t\t\t\tandroid:paddingRight=\"@dimen/nd3_margin_size\"\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_01\"\n\t\t\t\tandroid:visibility=\"gone\"\n\t\t\t\t>\n\t\t\t\t\n\t\t\t</ImageView>\t\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_bind_bind_tip_password\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_account_bind_bind_password\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_bind_bind_hint_password\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t\n\t<Button\n\t\tandroid:id=\"@+id/nd3_account_bind_bind_complete\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd3_account_bind_bind_complete\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_logout_text_size\"\n\t\tandroid:background=\"@drawable/nd3_button_logout\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</Button>\n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/nd3_account_login_layout\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\" >\n    \n\n</FrameLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\" \n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\t\n\t<!-- 标题栏 -->\n\t<RelativeLayout \n        android:id=\"@+id/nd3_account_register_titlebar\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\" >\n\t\t\n\t    <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button> \n\t\t\n\t\t<!-- 标题 -->\n\t\t<TextView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_centerInParent=\"true\"\n\t\t\tandroid:text=\"@string/nd3_account_register_title\"\n\t\t\tstyle=\"@style/nd3_textview_0\"\n\t\t\t>\n\t\t\n\t\t</TextView>\t\n\n\t   \n    </RelativeLayout>\n    \n\t<!-- 内容 -->\n\t<ScrollView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:layout_weight=\"1\"\n\t\t>\n\n\t\t<LinearLayout  \n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\" \n\t\t\tandroid:orientation =\"vertical\"\n\t\t\tandroid:fillViewport=\"true\"\n\t\t\t>\n\t\t\n\t\t    <!-- 注册提示语 -->\n\t\t\t<TextView\n\t\t\t    android:id=\"@+id/nd_tips\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\tandroid:text=\"@string/nd_guest_regist_tips\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"  \n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\" \n\t\t\t\t>\t\n\t\t\t\t<!-- 通行证、昵称、密码 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"vertical\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t\tandroid:layout_weight=\"0.6\"\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t<!-- 通行证 -->\n\t\t\t\t\t<LinearLayout\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<TextView\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_account\"\n\t\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</TextView>\n\t\t\t\n\t\t\t\t\t\t<AutoCompleteTextView\n\t\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_account\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\t\tandroid:maxLength=\"70\"\n\t\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_account\"\n\t\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t\tandroid:imeOptions=\"actionNext\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t</LinearLayout>\n\t\t\t\t\t \n\t\t\t\t\t<!-- 分隔线 -->\n\t\t\t\t\t<ImageView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\t>\n\t\t\t\t    </ImageView>\n\t\t\t\t\t\t\t\n\t\t\t\t\t<!-- 密码 -->\n\t\t\t\t\t<LinearLayout\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<TextView\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_password\"\n\t\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</TextView>\n\t\t\t\n\t\t\t\t\t\t<EditText\n\t\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_password\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_password\"\n\t\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t\tandroid:imeOptions=\"actionDone\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</EditText>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t</LinearLayout>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\tandroid:orientation =\"vertical\"\n\t\t\t\t\tandroid:layout_gravity=\"center\">\n\t\t\t\t     <Button \n\t\t\t\t         android:id=\"@+id/nd_guest_regist\"\n\t\t\t\t\t\t android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_gravity=\"center\" \n\t\t\t\t\t\t android:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\t style=\"@style/nd3_option_margin_style\" \n\t\t\t\t\t\t android:text=\"@string/nd_guest_regist\" \t \n\t\t\t\t\t\t android:background=\"@drawable/nd_green\"\n\t\t\t\t\t\t android:textSize=\"18dip\"/>\n\t\t\t\t     \n\t\t\t\t     <Button \n\t\t\t\t         android:id=\"@+id/nd_login\"\n\t\t\t\t\t\t android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_gravity=\"center\"\n\t\t\t\t\t\t android:text=\"@string/nd_has_account\" \n\t\t\t\t\t\t android:textColor=\"@color/nd3_white\"\t \n\t\t\t\t\t\t android:textSize=\"18dip\"\n\t\t\t\t\t\t style=\"@style/nd3_option_margin_style\" \n\t\t\t\t\t\t android:background=\"@drawable/nd_blue\"/>\n\t\t\t\t</LinearLayout>     \n\t\t\t</LinearLayout>\t\n\t\t\t<!-- 使用条款 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t>\n\t\t\t\t\n\t\t\t\t<CheckBox\n\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_is_agree\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:checked=\"true\"\n\t\t\t\t\tandroid:button=\"@null\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_square_checkbox_button\"\n\t\t\t\t\t>\n\t\t\t\t</CheckBox>\n\t\t\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_agreement\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t\tandroid:text=\"@string/nd3_account_register_agreement\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t>\n\t\t\t\t</TextView>\n\t\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\n\t\t\t     \n\t\t\n\t\t\t<!-- 使用条款 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"vertical\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t> \n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_guest_official_tips\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\t\t\tandroid:textSize=\"18dip\"\n\t\t\t\t\tandroid:textStyle=\"bold\"\n\t\t\t\t\t/>\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_guest_official_tips0\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\" \n\t\t\t\t\t/>\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_guest_official_tips1\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\" \n\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t</LinearLayout>\n\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t</LinearLayout>\n\t\t\n\t</ScrollView>\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\" \n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\t\n\t<!-- 标题栏 -->\n\t<RelativeLayout\n        android:id=\"@+id/nd3_account_register_titlebar\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\" >\n\t\t\n\t    <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button> \n\t\t\n\t\t<!-- 标题 -->\n\t\t<TextView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_centerInParent=\"true\"\n\t\t\tandroid:text=\"@string/nd3_account_register_title\"\n\t\t\tstyle=\"@style/nd3_textview_0\"\n\t\t\t>\n\t\t\n\t\t</TextView>\t\n\n\t   \n    </RelativeLayout>\n    \n\t<!-- 内容 -->\n\t<ScrollView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:layout_weight=\"1\"\n\t\t>\n\n\t\t<LinearLayout  \n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\" \n\t\t\tandroid:orientation =\"vertical\"\n\t\t\tandroid:fillViewport=\"true\"\n\t\t\t>\n\t\t\n\t\t    <!-- 注册提示语 -->\n\t\t\t<TextView\n\t\t\t    android:id=\"@+id/nd_tips\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\tandroid:text=\"@string/nd_guest_regist_tips\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\n\t\t\t<!-- 通行证、昵称、密码 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"vertical\"\n\t\t\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t>\n\t\t\t\t\n\t\t\t\t<!-- 通行证 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_account\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<AutoCompleteTextView\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_account\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:maxLength=\"70\"\n\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_account\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\tandroid:imeOptions=\"actionNext\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\n\t\t\t\t<!-- 分隔线 -->\n\t\t\t\t<ImageView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\t>\n\t\t\t\t</ImageView>\n\t\t\t\t\t\t\n\t\t\t\t<!-- 昵称 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:visibility=\"gone\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t\t\t>\n\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_nickname\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<EditText\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_nickname\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:maxLength=\"10\"\n\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_nickname\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</EditText>\n\t\t\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\n\t\t\t\t<!-- 分隔线 -->\n\t\t\t\t<ImageView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\tandroid:visibility=\"gone\"\n\t\t\t\t\t>\n\t\t\t\t</ImageView>\n\t\t\t\t\t\t\n\t\t\t\t<!-- 密码 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_password\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<EditText\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_password\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_password\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\tandroid:imeOptions=\"actionDone\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</EditText>\n\t\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\t\t\t\t\t\n\t\t\t</LinearLayout>\n\t\t\t<!-- 使用条款 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t>\n\t\t\t\t\n\t\t\t\t<CheckBox\n\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_is_agree\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:checked=\"true\"\n\t\t\t\t\tandroid:button=\"@null\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_square_checkbox_button\"\n\t\t\t\t\t>\n\t\t\t\t</CheckBox>\n\t\t\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:id=\"@+id/nd3_account_register_agreement\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t\tandroid:text=\"@string/nd3_account_register_agreement\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t>\n\t\t\t\t</TextView>\n\t\t\t\t\t\t\t\t\n\t\t\t</LinearLayout>\n\t\t\t <Button \n\t\t         android:id=\"@+id/nd_guest_regist\"\n\t\t\t\t android:layout_width=\"wrap_content\"\n\t\t\t\t android:layout_height=\"wrap_content\"\n\t\t\t\t android:layout_gravity=\"center\" \n\t\t\t\t android:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t style=\"@style/nd3_option_margin_style\"\n\t\t\t\t android:layout_marginTop=\"@dimen/nd_20\"\t\n\t\t\t\t android:text=\"@string/nd_guest_regist\" \t \n\t\t\t\t android:background=\"@drawable/nd_green\"\n\t\t\t\t android:textSize=\"18dip\"/>\n\t\t\t     \n\t\t     <Button \n\t\t         android:id=\"@+id/nd_login\"\n\t\t\t\t android:layout_width=\"wrap_content\"\n\t\t\t\t android:layout_height=\"wrap_content\"\n\t\t\t\t android:layout_gravity=\"center\"\n\t\t\t\t android:text=\"@string/nd_has_account\" \n\t\t\t\t android:textColor=\"@color/nd3_white\"\t\n\t\t\t\t android:layout_marginTop=\"10dip\"\t\n\t\t\t\t android:textSize=\"18dip\"\n\t\t\t\t style=\"@style/nd3_option_margin_style\" \n\t\t\t\t android:background=\"@drawable/nd_blue\"/>    \n\t\t\n\t\t\t<!-- 使用条款 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"vertical\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t> \n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_guest_official_tips\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\t\t\tandroid:textSize=\"18dip\"\n\t\t\t\t\tandroid:textStyle=\"bold\"\n\t\t\t\t\t/>\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_guest_official_tips0\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\" \n\t\t\t\t\t/>\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_guest_official_tips1\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\" \n\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t</LinearLayout>\n\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t</LinearLayout>\n\t\t\n\t</ScrollView>\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_other_login.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_other_login_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\n\t<!-- 未绑定帐号 -->\n\t<LinearLayout\n\t\tandroid:id=\"@+id/nd3_account_other_login_unbinded_group\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:gravity=\"center_vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:paddingTop=\"0dip\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:layout_marginBottom=\"0dip\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\t\t\n\t\tandroid:visibility=\"gone\"\n\t\t>\n\t\t\n\t</LinearLayout>\n\t\t\n\t<!-- 已绑定帐号或第三方帐号列表 -->\n\t<LinearLayout\n\t\tandroid:id=\"@+id/nd3_account_other_login_group\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:gravity=\"center_vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:paddingTop=\"0dip\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:layout_marginBottom=\"0dip\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\t\t\n\t\t>\n\t\t\n\t</LinearLayout>\n\n\t<!-- 已绑定且不能绑定帐号 -->\n\t<LinearLayout\n\t\tandroid:id=\"@+id/nd3_account_other_login_cannot_unbinded_group\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:gravity=\"center_vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:paddingTop=\"0dip\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:layout_marginBottom=\"0dip\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\t\t\n\t\tandroid:visibility=\"gone\"\n\t\t>\n\t\t\n\t</LinearLayout>\n\n\t<!-- 填充，增加底部边距 -->\n\t<View\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:visibility=\"invisible\"\n\t\t/>\n\t\t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_register_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\t\n\t<!-- 标题栏 -->\n\t<RelativeLayout\n        android:id=\"@+id/nd3_account_register_titlebar\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\" >\n\t\t\n\t    <!-- 登录 -->\n\t\t<Button \n\t\t\tandroid:id=\"@+id/nd3_account_register_login\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_alignParentLeft=\"true\"\n\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\tandroid:textSize=\"16sp\"\n\t\t\tandroid:textColor=\"@color/nd3_btn_font_color\"\n\t\t\tandroid:text=\"@string/nd3_account_login_button_right\"\n\t\t\tandroid:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n\t\t\tandroid:layout_margin=\"10dip\"\n\t\t\t/>\n\t\t\n\t\t<!-- 标题 -->\n\t\t<TextView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_centerInParent=\"true\"\n\t\t\tandroid:text=\"@string/nd3_account_register_title\"\n\t\t\tstyle=\"@style/nd3_textview_0\"\n\t\t\t>\n\t\t\n\t\t</TextView>\t\n\n\t    <!-- 完成 -->\t\t    \t\t\n\t\t<Button \n\t\t\tandroid:id=\"@+id/nd3_account_register_complete\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\tandroid:textSize=\"16sp\"\n\t\t\tandroid:textColor=\"@color/nd3_btn_font_color\"\n\t\t\tandroid:text=\"@string/nd3_account_register_button_right\"\n\t\t\tandroid:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n\t\t\tandroid:layout_margin=\"10dip\"\n\t\t\tandroid:padding=\"5dip\"\n\t\t\t/>\t    \n    </RelativeLayout>\n    \n\t<!-- 内容 -->\n\t<ScrollView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:layout_weight=\"1\"\n\t\t>\n\n\t\t<!-- 快速注册 -->\t\t\n\t\t<include \n\t\t    android:id=\"@+id/nd3_account_register_quick\"\n\t\t    layout=\"@layout/nd3_account_register_quick\"\n\t\t    />\n\t\t\n\t</ScrollView>\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register_agreement.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_register_agreement_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:gravity=\"center_horizontal\"\n\tandroid:fillViewport=\"true\"\n\tandroid:background=\"@color/nd3_white\"\n\t>\n\t\n\t<!-- 图标 -->\n\t<ImageView \n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:src=\"@drawable/nd3_agreement_logo\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t> \n\t</ImageView>\n\n\t<!-- 文字内容 -->\t\t\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_account_register_agreement_content\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:textColor=\"@color/nd3_account_register_agreement_color\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t \n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register_phone.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_register_phone_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\n    <!-- 注册提示语 -->\n\t<TextView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"left\"\n\t\tandroid:text=\"@string/nd3_account_register_phone_tip\"\n\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t\t\n\t<!-- 手机号、密码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t\t<!-- 手机号 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_phone\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<AutoCompleteTextView\n\t\t\t\tandroid:id=\"@+id/nd3_account_register_phone_phone\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"11\"\n\t\t\t\tandroid:inputType=\"number\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_phone\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_password\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_account_register_phone_password\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_password\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t<!-- 验证码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"0dip\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t\t<!-- 手机号 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_code\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<AutoCompleteTextView\n\t\t\t\tandroid:id=\"@+id/nd3_account_register_phone_code\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"70\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_code\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t</LinearLayout>\n\t\t    \n\t<!-- 使用条款 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"horizontal\"\n\t\tandroid:visibility=\"gone\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t\t<CheckBox\n\t\t\tandroid:id=\"@+id/nd3_account_register_phone_is_agree\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:checked=\"true\"\n\t\t\tandroid:button=\"@null\"\n\t\t\tandroid:background=\"@drawable/nd3_square_checkbox_button\"\n\t\t\t>\n\t\t</CheckBox>\n\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_account_register_phone_agreement\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\tandroid:text=\"@string/nd3_account_register_agreement\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t>\n\t\t</TextView>\n\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t<Button \n\t    android:id=\"@+id/nd3_account_register_phone_gain\"\n    \tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd3_account_register_button_gain_code\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\n\t\t/>    \t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register_quick.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_register_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\n    <!-- 注册提示语 -->\n\t<TextView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"left\"\n\t\tandroid:text=\"@string/nd3_account_register_quick_tip\"\n\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t\t\n\t<!-- 通行证、昵称、密码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t\t<!-- 通行证 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_account\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<AutoCompleteTextView\n\t\t\t\tandroid:id=\"@+id/nd3_account_register_account\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"70\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_account\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\tandroid:inputType=\"textEmailAddress\"\n\t\t\t\t>\n\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 昵称 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tandroid:visibility=\"gone\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_nickname\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_account_register_nickname\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"10\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_nickname\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\tandroid:visibility=\"gone\"\n\t\t\t>\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_register_tip_password\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_account_register_password\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_register_hint_password\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t<!-- 使用条款 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"horizontal\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t\t<CheckBox\n\t\t\tandroid:id=\"@+id/nd3_account_register_is_agree\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:checked=\"true\"\n\t\t\tandroid:button=\"@null\"\n\t\t\tandroid:background=\"@drawable/nd3_square_checkbox_button\"\n\t\t\t>\n\t\t</CheckBox>\n\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_account_register_agreement\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\tandroid:text=\"@string/nd3_account_register_agreement\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t>\n\t\t</TextView>\n\t\t\t\t\t\t\n\t</LinearLayout>\n\t\t\t\n\t<!-- 注册提示 -->\t\n\t<!-- <TextView\n\t\tandroid:id=\"@+id/nd3_account_register_send_sms\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"bottom|center_horizontal\"\n\t\tandroid:text=\"@string/nd3_account_register_initial_register\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_register_sendsms_text_size\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\n\t\tandroid:visibility=\"gone\"\n\t\t>\n\t</TextView> -->\n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_secret_find.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout \n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" \n\tandroid:layout_height=\"fill_parent\"  \n\t>\n\n    <LinearLayout \n\t  android:id=\"@+id/nd3_account_secret_find_layout\"  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\" \n\t  >\n  \n \t</LinearLayout>\n\t<!--<WebView \n\t\tandroid:id=\"@+id/nd_91bean_manage\"\n\t\tandroid:layout_width=\"fill_parent\" \n\t\tandroid:layout_height=\"fill_parent\"\n\t\t />\n\t\t\n\t--><ProgressBar \n\t\tandroid:id=\"@+id/nd3_web_load_progress\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_gravity=\"center\" \n\t\tandroid:indeterminate=\"true\" \n\t\tandroid:layout_centerInParent=\"true\"\n\t\tandroid:visibility=\"gone\" \n\t\tandroid:indeterminateDrawable=\"@drawable/nd3_progress_large\"\n\t\tstyle=\"?android:attr/progressBarStyleLarge\"/>\n\t\t\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_secret_set.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout \n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" \n\tandroid:layout_height=\"fill_parent\"  \n\t>\n\n    <LinearLayout \n\t  android:id=\"@+id/nd3_account_secret_set_layout\"  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\" \n\t  >\n  \n \t</LinearLayout>\n\t<!--<WebView \n\t\tandroid:id=\"@+id/nd_91bean_manage\"\n\t\tandroid:layout_width=\"fill_parent\" \n\t\tandroid:layout_height=\"fill_parent\"\n\t\t />\n\t\t\n\t--><ProgressBar \n\t\tandroid:id=\"@+id/nd3_web_load_progress\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_gravity=\"center\" \n\t\tandroid:indeterminate=\"true\" \n\t\tandroid:layout_centerInParent=\"true\"\n\t\tandroid:visibility=\"gone\" \n\t\tandroid:indeterminateDrawable=\"@drawable/nd3_progress_large\"\n\t\tstyle=\"?android:attr/progressBarStyleLarge\"/>\n\t\t\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_sina.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_account_sina_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<!-- 帐号、密码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t\t<!-- 帐号 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_sina_tip_account\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<AutoCompleteTextView\n\t\t\t\tandroid:id=\"@+id/nd3_account_sina_account\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_sina_hint_account\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\tandroid:inputType=\"textEmailAddress\"\n\t\t\t\t>\n\t\t\t</AutoCompleteTextView>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_account_sina_tip_password\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_account_sina_password\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\tandroid:hint=\"@string/nd3_account_sina_hint_password\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_account_sina_content\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:text=\"@string/nd3_account_bind_bind_content_format\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\t\t\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t</TextView>\n\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_achieve_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:orientation=\"vertical\"\n  android:background=\"@color/nd3_list_view_item_bg_1\"\n  >\n  \n  <LinearLayout\n        android:layout_width=\"fill_parent\"\n  \t\tandroid:layout_height=\"wrap_content\"\n  \t\tandroid:orientation=\"vertical\"\n  \t\tandroid:background=\"@drawable/nd3_activity_action_above_bg\">\n  \t\t<RelativeLayout \n  \t\t\tandroid:layout_width=\"fill_parent\"\n  \t\t\tandroid:layout_height=\"wrap_content\"\n  \t\t\tandroid:layout_margin=\"@dimen/nd3_option_item_marginLeft\">\n  \t\t\t<ImageView android:id=\"@+id/nd3_achieve_image\"\n  \t\t\t\t\tandroid:layout_width=\"57dip\"\n  \t\t\t\t\tandroid:layout_height=\"57dip\"\n  \t\t\t\t\tandroid:scaleType=\"fitXY\"\n  \t\t\t\t\tandroid:layout_alignParentLeft=\"true\"\n  \t\t\t\t\tandroid:layout_alignParentTop=\"true\"\n  \t\t\t\t\tandroid:src=\"@drawable/nd3_leaderboard_default\"/>\n  \t\t\t\t\t\n  \t\t\t<TextView android:id=\"@+id/nd3_achieve_name\"\n  \t\t\t\t\tandroid:layout_width=\"fill_parent\"\n  \t\t\t\t\tandroid:layout_height=\"wrap_content\"\n  \t\t\t\t\tstyle=\"@style/nd3_textview_1\"\n  \t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n  \t\t\t\t\tandroid:layout_alignParentTop=\"true\"\n  \t\t\t\t\tandroid:layout_toRightOf=\"@+id/nd3_achieve_image\"/>\t\n  \t\t\t\t\t\n  \t\t\t<TextView android:id=\"@+id/nd3_achieve_remarks\"\n  \t\t\t\t\tandroid:layout_width=\"fill_parent\"\n  \t\t\t\t\tandroid:layout_height=\"wrap_content\"\n  \t\t\t\t\tstyle=\"@style/nd3_textview_2\"\n  \t\t\t\t\tandroid:layout_below=\"@id/nd3_achieve_name\"\n  \t\t\t\t\tandroid:layout_alignLeft=\"@id/nd3_achieve_name\"/>\t\t\t\t\n  \t\t</RelativeLayout>\t\n  \t\t\n  \t\t<TextView android:id=\"@+id/nd3_achieve_desc\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tstyle=\"@style/nd3_textview_2\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\tandroid:layout_marginRight=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\tandroid:paddingBottom=\"@dimen/nd3_option_item_marginLeft\" \n\t\t\t\tandroid:visibility=\"gone\"/>\n  </LinearLayout>\t\t\n  \n  <Button  \n        android:id=\"@+id/nd3_share_my_achieve\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:text=\"@string/nd3_share_my_achieve\"\n\t\tandroid:layout_margin=\"@dimen/nd3_option_item_marginLeft\" /> \n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_action_template.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n     <include\n     android:id=\"@+id/nd3_activity_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t layout=\"@layout/nd3_activity_head_reg\"/>\n  \t \n\t <RelativeLayout\n\t android:layout_width=\"fill_parent\"\n     android:layout_height=\"fill_parent\"\n     android:background=\"@color/nd3_list_view_item_bg_1\"\n     android:layout_below=\"@id/nd3_activity_head_layout\">\t\n        <!-- 文本部分 -->\n     \t<RelativeLayout\n     \t android:id=\"@+id/nd3_activity_content_1_rl\"\n     \t android:layout_width=\"fill_parent\"\n     \t android:layout_alignParentTop=\"true\"\n         android:layout_height=\"80dp\"\n         android:padding=\"@dimen/nd3_option_item_marginLeft\"\n         android:background=\"@drawable/nd3_activity_action_above_bg\">\n     \t</RelativeLayout>\n     \t\n     \t <!-- 动作部分 -->\n     \t<RelativeLayout\n     \t android:id=\"@+id/nd3_activity_content_2_rl\"\n     \t android:layout_width=\"fill_parent\"\n     \t android:layout_height=\"fill_parent\"\n         android:padding=\"@dimen/nd3_option_item_marginLeft\"\n         android:layout_below=\"@id/nd3_activity_content_1_rl\">\n     \t</RelativeLayout>\n\t </RelativeLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.uap.widget.NdActivityDescriptionPlusImageView\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <!-- 文本-1 -->\n  <com.nd.commplatform.widget.NdTextView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:id=\"@+id/nd3_activity_content_reg_1\"\n  android:layout_alignParentTop=\"true\"\n  android:textColor=\"@color/nd3_black\"/>\n  \n  <!-- 头像 -->\n  <ImageView\n  android:id=\"@+id/nd3_activity_content_reg_2\"\n  android:layout_width=\"@dimen/nd3_image_size\"\n  android:layout_height=\"@dimen/nd3_image_size\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_below=\"@id/nd3_activity_content_reg_1\"\n  android:scaleType=\"fitXY\"\n  android:paddingTop=\"@dimen/nd3_margin_size\"\n  android:layout_alignWithParentIfMissing=\"true\"/>\n  \n  <!-- 文本-2 -->\n  <TextView\n  android:id=\"@+id/nd3_activity_content_reg_3\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:paddingTop=\"@dimen/nd3_margin_size\"\n  android:textColor=\"@color/nd3_black\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\"\n  android:layout_below=\"@id/nd3_activity_content_reg_2\"\n  android:layout_alignWithParentIfMissing=\"true\"/>\n</com.nd.commplatform.uap.widget.NdActivityDescriptionPlusImageView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.uap.widget.NdActivityDescriptionView\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <!-- 文本-1 -->\n  <TextView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:id=\"@+id/nd3_activity_content_reg_1\"\n  android:layout_alignParentTop=\"true\"\n  android:textColor=\"@color/nd3_black\"/>\n  \n  \n  <!-- 文本-2 -->\n  <TextView\n  android:id=\"@+id/nd3_activity_content_reg_3\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:paddingTop=\"@dimen/nd3_margin_size\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\"\n  android:layout_below=\"@id/nd3_activity_content_reg_1\"\n  android:textColor=\"@color/nd3_black\"\n  android:layout_alignWithParentIfMissing=\"true\"/>\n</com.nd.commplatform.uap.widget.NdActivityDescriptionView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_2_ext.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.uap.widget.NdActivityDescriptionExtView\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <!-- 文本-1 -->\n  <com.nd.commplatform.widget.NdTextView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:id=\"@+id/nd3_activity_content_reg_1\"\n  android:layout_alignParentTop=\"true\"\n  android:textColor=\"@color/nd3_black\"/>\n  \n  \n  <!-- 文本-2 -->\n  <TextView\n  android:id=\"@+id/nd3_activity_content_reg_3\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:paddingTop=\"@dimen/nd3_margin_size\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\"\n  android:layout_below=\"@id/nd3_activity_content_reg_1\"\n  android:textColor=\"@color/nd3_black\"\n  android:layout_alignWithParentIfMissing=\"true\"/>\n</com.nd.commplatform.uap.widget.NdActivityDescriptionExtView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <!-- 按钮 -->\n  <Button\n  android:id=\"@+id/nd3_activity_content_3_btn\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:gravity=\"center\"\n  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\"/>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_4.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n  <!-- 列表 -->\n    <include \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:id=\"@+id/nd3_activity_listview\"\n\t  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\"\n\t  android:background=\"@drawable/nd3_bk1\"\n\t  layout=\"@layout/nd3_listview_template\"/>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n   <include\n     android:id=\"@+id/nd3_activity_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t android:layout_alignParentTop=\"true\"\n  \t layout=\"@layout/nd3_activity_head_reg\"/>\n  \t \n  \t <!-- 文本部分 -->\n  \t <ScrollView\n  \t android:layout_width=\"fill_parent\"\n     android:layout_height=\"fill_parent\"\n     android:fillViewport=\"true\"\n     android:fadingEdge=\"none\"\n     android:background=\"@color/nd3_list_view_item_bg_1\"\n     android:layout_below=\"@id/nd3_activity_head_layout\">\n\t\t <RelativeLayout\n\t\t android:layout_width=\"fill_parent\"\n\t     android:layout_height=\"fill_parent\"\n\t     android:padding=\"@dimen/nd3_option_item_marginLeft\"\n\t     >\t\n\t     \t<include\n\t\t     android:id=\"@+id/nd3_activity_description_layout\"\n\t\t  \t android:layout_width=\"fill_parent\"\n\t\t  \t android:layout_height=\"wrap_content\"\n\t\t  \t layout=\"@layout/nd3_activity_content_reg_template_2_ext\"/>\n\t\t </RelativeLayout>\n\t </ScrollView>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail_plus_image.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n     <include\n     android:id=\"@+id/nd3_activity_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t layout=\"@layout/nd3_activity_head_reg\"/>\n  \t <ScrollView\n  \t android:layout_width=\"fill_parent\"\n     android:layout_height=\"fill_parent\"\n     android:fillViewport=\"true\"\n     android:fadingEdge=\"none\"\n     android:layout_below=\"@id/nd3_activity_head_layout\">\n  \t    <LinearLayout\n  \t    android:layout_width=\"fill_parent\"\n     \tandroid:layout_height=\"fill_parent\"\n     \tandroid:orientation=\"vertical\"\n     \tandroid:background=\"@color/nd3_list_view_item_bg_1\">\n\t        <!-- 文本部分 -->\n\t     \t<RelativeLayout\n\t     \t android:id=\"@+id/nd3_activity_content_1_rl\"\n\t     \t android:layout_width=\"fill_parent\"\n\t     \t android:layout_height=\"wrap_content\"\n\t         android:padding=\"@dimen/nd3_option_item_marginLeft\"\n\t         android:background=\"@drawable/nd3_activity_action_above_bg\">\n\t\t          <include\n\t\t          android:id=\"@+id/nd3_activity_content_plus_image\"\n\t\t          android:layout_width=\"fill_parent\"\n\t\t     \t  android:layout_height=\"wrap_content\"\n\t\t     \t  layout=\"@layout/nd3_activity_content_reg_template_1\"/>\n\t     \t</RelativeLayout>\n\t     \t\n\t     \t <!-- 动作部分 -->\n\t     \t<RelativeLayout\n\t     \t android:id=\"@+id/nd3_activity_content_2_rl\"\n\t     \t android:layout_width=\"fill_parent\"\n\t     \t android:layout_height=\"fill_parent\"\n\t     \t android:layout_weight=\"1.0\"\n\t         android:padding=\"@dimen/nd3_option_item_marginLeft\"\n\t         android:layout_below=\"@id/nd3_activity_content_1_rl\">\n\t\t          <Button\n\t\t\t\t  android:id=\"@+id/nd3_activity_content_action_btn\"\n\t\t\t\t  android:layout_alignParentTop=\"true\"\n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t  android:gravity=\"center\"\n\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t  android:background=\"@drawable/nd3_button_action\"\n\t\t\t\t  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\"/>\n\t     \t</RelativeLayout>\n     \t</LinearLayout>\n      </ScrollView>\n\t\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail_plus_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n     <include\n     android:id=\"@+id/nd3_activity_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t android:layout_alignParentTop=\"true\"\n  \t layout=\"@layout/nd3_activity_head_reg\"/>\n  \t \n\t <ScrollView\n\t android:layout_width=\"fill_parent\"\n\t android:layout_height=\"fill_parent\"\n\t android:layout_below=\"@id/nd3_activity_head_layout\"\n\t android:fillViewport=\"true\"\n\t android:background=\"@color/nd3_list_view_item_bg_1\"\n\t android:fadingEdge=\"none\">\n\t     <RelativeLayout\n\t     android:layout_width=\"fill_parent\"\n\t     android:layout_height=\"fill_parent\">\n\t      <!-- 文本部分 -->\n\t\t <RelativeLayout\n\t\t android:layout_width=\"fill_parent\"\n\t     android:layout_height=\"wrap_content\"\n\t     android:layout_alignParentTop=\"true\"\n\t     android:background=\"@drawable/nd3_activity_action_above_bg\"\n\t     android:padding=\"@dimen/nd3_margin_size\"\n\t     android:id=\"@+id/nd3_activity_content_1_rl\">\t\n\t     \t<include\n\t\t     android:id=\"@+id/nd3_activity_description_layout\"\n\t\t  \t android:layout_width=\"fill_parent\"\n\t\t  \t android:layout_height=\"wrap_content\"\n\t\t  \t layout=\"@layout/nd3_activity_content_reg_template_2\"/>\n\t\t </RelativeLayout>\n    \n     \t\n\t     \t <!-- 列表部分 -->\n\t     \t<RelativeLayout\n\t     \t android:id=\"@+id/nd3_activity_content_2_rl\"\n\t     \t android:layout_width=\"fill_parent\"\n\t     \t android:layout_height=\"fill_parent\"\n\t         android:padding=\"@dimen/nd3_margin_size\"\n\t         android:background=\"@color/nd3_list_view_item_bg_1\"\n\t         android:layout_below=\"@id/nd3_activity_content_1_rl\">\n\t              <TextView\n\t              android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t  android:layout_alignParentTop=\"true\"\n\t\t\t\t  style=\"@style/nd3_textview_1\"\n\t\t\t\t  android:text=\"@string/nd3_list_item_loading\"/>\n\t\t           <com.nd.commplatform.uap.widget.NdNonScrollListView\n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t  android:layout_alignParentTop=\"true\"\n\t\t\t\t  android:background=\"@drawable/nd3_bk1\"\n\t\t\t\t  android:id=\"@+id/nd3_add_friend_listview\"\n\t\t\t\t  android:visibility=\"gone\"/>\n\t     \t</RelativeLayout>\n      </RelativeLayout>\n    </ScrollView>> \n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail_plus_list_ext.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n     <include\n     android:id=\"@+id/nd3_activity_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t android:layout_alignParentTop=\"true\"\n  \t layout=\"@layout/nd3_activity_head_reg\"/>\n  \t <RelativeLayout\n\t     android:layout_width=\"fill_parent\"\n\t     android:layout_height=\"fill_parent\"\n\t     android:background=\"@color/nd3_list_view_item_bg_1\"\n\t     android:layout_below=\"@id/nd3_activity_head_layout\">\n\t  \t <ListView\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"fill_parent\"\n\t\t  android:id=\"@+id/nd3_listview_template\"\n\t\t  android:headerDividersEnabled=\"false\"\n\t\t  android:footerDividersEnabled=\"false\"\n\t\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t\t  android:fastScrollEnabled=\"false\"\n\t\t  android:cacheColorHint=\"#00000000\"\n\t\t  android:fadingEdge=\"none\">\n\t     </ListView>\n     </RelativeLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_head_reg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n  <!--头像  布局文件-->\n  <com.nd.commplatform.uap.widget.NdActivityUserView \n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  \t\tandroid:layout_width=\"fill_parent\"\n  \t    android:layout_height=\"wrap_content\">\n\t  <RelativeLayout \n\t      android:id=\"@+id/nd3_activity_head_rl\"\n\t      android:layout_width=\"fill_parent\"\n\t  \t  android:layout_height=\"wrap_content\"\n\t  \t  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\">\n\t  \t  \n\t  \t  <ImageView android:id=\"@+id/nd3_activity_head_image\"\n\t\t      android:layout_width=\"57dip\"\n\t\t  \t  android:layout_height=\"57dip\"\n\t\t  \t  android:src=\"@drawable/nd3_head_bg\"\n\t\t  \t  android:layout_alignParentLeft=\"true\"\n\t\t  \t  android:layout_marginRight=\"@dimen/nd3_option_item_marginLeft\"/>\n\t  \t  <TextView android:id=\"@+id/nd3_activity_user_nickname\"\n\t  \t  \t  android:layout_width=\"0dip\"\n\t  \t  \t  android:layout_height=\"wrap_content\"\n\t  \t  \t  android:textColor=\"@color/nd3_white\"\n\t  \t  \t  android:textSize=\"@dimen/nd3_btn_text_size\"\n\t  \t  \t  android:singleLine=\"true\"\n\t  \t  \t  android:ellipsize=\"end\"\n\t  \t  \t  android:layout_toRightOf=\"@+id/nd3_activity_head_image\"\n\t  \t  \t  android:layout_toLeftOf=\"@+id/nd3_activity_head_switch_image\"\n\t  \t  \t  />\n\t  \t  \t  \n\t  \t  <ImageView \n\t  \t    android:id=\"@+id/nd3_activity_head_switch_image\"\n\t        android:layout_width=\"wrap_content\"\n\t  \t\tandroid:layout_height=\"wrap_content\"\n\t  \t\tandroid:background=\"@drawable/nd3_switch_image_white\"\n\t  \t\tandroid:layout_alignParentRight=\"true\"\n\t  \t\tandroid:layout_alignTop=\"@id/nd3_activity_user_nickname\"/>\n\t  \t  \n\t  \t  <TextView android:id=\"@+id/nd3_activity_user_mood\"\n\t  \t  \t  android:layout_width=\"fill_parent\"\n\t  \t  \t  android:layout_height=\"wrap_content\"\n\t  \t  \t  android:textColor=\"@color/nd3_white\"\n\t  \t  \t  android:layout_toRightOf=\"@+id/nd3_activity_head_image\"\n\t  \t  \t  android:maxLines=\"5\"\n\t  \t  \t  android:ellipsize=\"end\"\n\t  \t  \t  android:layout_below=\"@id/nd3_activity_user_nickname\" />\n\t  \t   \n\t  </RelativeLayout>\t  \n\t  \n\t  <ImageView\n       android:layout_width=\"fill_parent\"\n  \t   android:layout_height=\"wrap_content\"\n  \t   android:background=\"@drawable/nd3_line\"\n  \t   android:layout_below=\"@id/nd3_activity_head_rl\"/>\n </com.nd.commplatform.uap.widget.NdActivityUserView>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_no_action_template.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n     <include\n     android:id=\"@+id/nd3_activity_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t layout=\"@layout/nd3_activity_head_reg\"/>\n  \t \n  \t <!-- 文本部分 -->\n\t <RelativeLayout\n\t android:layout_width=\"fill_parent\"\n     android:layout_height=\"fill_parent\"\n     android:padding=\"@dimen/nd3_option_item_marginLeft\"\n     android:background=\"@color/nd3_list_view_item_bg_1\"\n     android:layout_below=\"@id/nd3_activity_head_layout\">\t\n\t </RelativeLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_app_feedback.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 个人设置面板 -->\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\" \n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation=\"vertical\"> \n  \n\t<LinearLayout\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:layout_margin=\"@dimen/nd3_margin_size\"\n\tandroid:background=\"@drawable/nd3_white_bg\" \n\tandroid:orientation=\"vertical\"\n\tandroid:gravity=\"center_horizontal\">\n\t\n\t\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_appname_txt\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:textColor=\"@color/nd3_black\"  \n\t\t\tandroid:singleLine=\"true\" \n\t\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\n\t\t\tandroid:layout_marginTop=\"5dp\"/>\n\t\t\t\n\t\t\t<ImageView  \n\t\t     android:src=\"@drawable/nd3_horizontal_line\"\n\t\t     android:layout_width=\"fill_parent\"\n\t\t     android:layout_height=\"wrap_content\"\n\t\t     android:scaleType=\"fitXY\"/>\n\t\t    \n\t\t    <LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:orientation=\"horizontal\"> \n\t\t\t\t<TextView  \n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_app_feedback_service_phone\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\tandroid:layout_marginTop=\"5dp\" \t />\n\t\t\t\t<TextView \n\t\t\t\tandroid:id=\"@+id/nd3_servicephone_txt\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:textColor=\"@color/nd3_blue\"\n\t\t\t\tandroid:singleLine=\"true\" \n\t\t\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\n\t\t\t\tandroid:layout_alignLeft=\"@id/nd3_appname_txt\"\n\t\t\t\tandroid:layout_below=\"@id/nd3_appname_txt\"\n\t\t\t\tandroid:layout_marginTop=\"5dp\"  \n\t\t\t\t/>\n\t\t\t</LinearLayout>\n\t\t\t\n\t\t\t<ImageView  \n\t\t     android:src=\"@drawable/nd3_horizontal_line\"\n\t\t     android:layout_width=\"fill_parent\"\n\t\t     android:layout_height=\"wrap_content\"\n\t\t     android:scaleType=\"fitXY\"\n\t\t     android:layout_marginBottom=\"5dp\"/>\n\t\t     \n\t\t\t <RadioGroup\n\t\t\t    \t\tandroid:visibility=\"gone\"\n\t\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t                android:layout_height=\"wrap_content\"\n\t\t                android:orientation=\"horizontal\"\n\t\t                android:id=\"@+id/nd3_feedback_type_group\"  \n\t\t                android:gravity=\"center_horizontal\"\n\t\t                >\n\t\t                \t<RadioButton  \n\t\t\t\t\t\t    android:id=\"@+id/nd3_enhance_advice_btn\" \n\t\t\t\t\t\t    android:text=\"@string/nd3_app_feedback_sub_type_1\"\n\t\t\t\t\t\t    android:button=\"@drawable/nd3_regist_checked\" \n\t\t\t\t\t\t    android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t\t    android:layout_width=\"wrap_content\" \n\t\t\t\t\t\t    android:paddingRight=\"15dip\"\n\t\t\t\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t    android:checked=\"true\" />\n\t\t\t\t\t\t   <RadioButton  \n\t\t\t\t\t\t \tandroid:id=\"@+id/nd3_problem_feedback_btn\" \n\t\t\t\t\t\t \tandroid:text=\"@string/nd3_app_feedback_sub_type_2\"\n\t\t\t\t\t\t \tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\t\t \tandroid:button=\"@drawable/nd3_regist_checked\" \n\t\t\t\t\t\t \tandroid:layout_width=\"wrap_content\" \n\t\t\t\t\t\t \tandroid:layout_marginRight=\"7dip\"\n\t\t\t\t\t\t \tandroid:layout_height=\"wrap_content\" />\n\t\t      </RadioGroup>\n\t\t     \n     </LinearLayout><!--\n     \n    \n    <ScrollView\n   \t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:layout_weight=\"1\" \n\t\tandroid:layout_margin=\"7dp\"\n    \t>\n    \t \n\t\t--><EditText\n\t\t\tandroid:id=\"@+id/nd3_feedback_edit\"\n\t\t\tandroid:inputType=\"textShortMessage|textAutoCorrect|textCapSentences|textMultiLine\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_white_bg\" \n\t\t\tandroid:hint=\"@string/nd3_app_feedback_input_hide\"\n\t\t\tandroid:gravity=\"left|top\"\n\t\t\tandroid:minLines=\"7\"\n\t\t\tandroid:maxLength=\"500\"\n\t\t\tandroid:scrollbars=\"vertical\"\n\t\t\tandroid:layout_margin=\"7dp\"\n\t\t\t/>\n\t\t\t\n\t\t<EditText\n\t\t\tandroid:id=\"@+id/nd3_tel_number_edit\"\n\t\t\tandroid:inputType=\"phone\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_white_bg\" \n\t\t\tandroid:hint=\"@string/nd3_feedback_tel_tip\"\n\t\t\tandroid:gravity=\"left|top\" \n\t\t\tandroid:scrollbars=\"vertical\"\n\t\t\tandroid:layout_margin=\"7dp\"\n\t\t\tandroid:visibility=\"gone\"\n\t\t\t/>\t\n\t\t\t\n\t<!--</ScrollView>\n\t     \n\n   \n\t\n--></LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_app_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdAppListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n  \n  <ImageView\n  android:id=\"@+id/nd3_app_image\"\n  android:layout_width=\"@dimen/nd3_image_size\"\n  android:layout_height=\"@dimen/nd3_image_size\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_alignParentTop=\"true\"\n  android:scaleType=\"fitXY\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n  \n  \n  <RelativeLayout\n  android:layout_alignParentTop=\"true\"\n  android:layout_width=\"0dip\"\n  android:layout_toRightOf=\"@id/nd3_app_image\"\n  android:layout_toLeftOf=\"@+id/nd3_app_action_btn\"\n  android:layout_height=\"wrap_content\">\n\t  <TextView\n\t  android:id=\"@+id/nd3_app_name_txt\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n      android:layout_toLeftOf=\"@+id/nd3_app_grade\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"  \n\t  style=\"@style/nd3_textview_1\"/>\n  \n\t  <RatingBar\n\t  android:id=\"@+id/nd3_app_grade\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentRight=\"true\"\n\t  android:layout_alignTop=\"@id/nd3_app_name_txt\"\n\t  android:paddingTop=\"@dimen/nd3_margin_size\"\n\t  android:numStars=\"5\"\n\t  android:rating=\"0\"\n\t  style=\"?android:attr/ratingBarStyleSmall\"/>\n\t  <TextView\n\t  android:id=\"@+id/nd3_app_grade_desc\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_below=\"@id/nd3_app_name_txt\"\n\t  android:layout_alignLeft=\"@+id/nd3_app_name_txt\"\n\t  style=\"@style/nd3_textview_2\"/>\n  </RelativeLayout>\n  \n  <ImageView\n  android:id=\"@+id/nd3_app_action_btn\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:src=\"@drawable/nd3_switch_image\"\n  android:layout_alignParentRight=\"true\"\n  android:layout_centerVertical=\"true\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n</com.nd.commplatform.widget.NdAppListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_app_property.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <com.nd.commplatform.widget.NdAppPropertyItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:id=\"@+id/nd3_app_property_layout\" \n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"   \n  android:layout_marginRight=\"@dimen/nd3_margin_size\" \n  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n  > \n\t  <ImageView  android:id=\"@+id/nd3_app_property_image_id\"\n\t\t  android:layout_width=\"30dip\"\n\t      android:layout_height=\"30dip\"  \n\t      android:layout_alignParentLeft=\"true\"\n\t      android:layout_centerVertical=\"true\"\n\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"  />\n\t\t  \n\t  <TextView  \n\t\t  android:id=\"@+id/nd3_app_property_label\" \n\t\t  android:layout_width=\"0dip\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:textColor=\"@color/nd3_black\"\n\t\t  android:textStyle=\"bold\" \n\t\t  android:layout_toRightOf=\"@id/nd3_app_property_image_id\"\n\t\t  android:layout_toLeftOf=\"@+id/nd3_switch_image\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  />\n\t  <ImageView \n\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t  android:id=\"@+id/nd3_switch_image\"\n\t\t  android:layout_width=\"wrap_content\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_alignParentRight=\"true\"\n\t      android:layout_centerVertical=\"true\"\n\t      />\t  \t\t\t  \n</com.nd.commplatform.widget.NdAppPropertyItem>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_banner_layout.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"vertical\"\n    android:background=\"@drawable/nd3_banner_bg\">\n\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_banner_title\" \n\t\tandroid:layout_width=\"fill_parent\" \n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\n\t\tandroid:textStyle=\"bold\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:drawableLeft=\"@drawable/nd3_banner_logo\"\n\t\tandroid:text=\"@string/nd3_banner_title_format\">\n\t\t\n\t</TextView>\n\n</LinearLayout>\n\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_blank_listview.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdListBlankView\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n >\n  <TextView\n  android:id=\"@+id/nd3_empty_listview_txt\"\n  android:text=\"@string/nd3_list_item_loading\"\n  android:textColor=\"@color/nd3_black\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:layout_alignParentTop=\"true\"/>\n \n  <TextView\n  android:id=\"@+id/nd3_empty_listview_no_data_txt\"\n  android:textColor=\"@color/nd3_black\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:layout_centerInParent=\"true\"\n  android:visibility=\"gone\"/>\n</com.nd.commplatform.widget.NdListBlankView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_bottom_bar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"  \n  android:orientation=\"horizontal\" \n  android:background=\"@drawable/nd3_bottom_bar_bg\" \n  android:id=\"@+id/nd3_bottom_layout\" \n  >\n  <LinearLayout \n  android:id=\"@+id/nd3_home_layout\"\n  android:layout_width=\"55dip\"\n  android:layout_height=\"55dip\" \n  android:layout_weight=\"1\"\n  android:orientation=\"vertical\"\n  android:layout_marginTop=\"5dip\"\n  android:gravity=\"center_horizontal\">\n\t  <ImageView android:id=\"@+id/nd3_home_image\"\n\t  android:layout_width=\"35dip\"\n\t  android:layout_height=\"35dip\" \n\t  android:src=\"@drawable/nd3_mainpage_1\"  \n\t  android:gravity=\"center|bottom\" \n\t  />\n\t  <TextView android:id=\"@+id/nd3_home_text\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"   \n\t  android:text=\"@string/nd3_category_home\"\n\t  android:textColor=\"@color/nd3_white\" \n\t  android:gravity=\"center|top\" \n\t  />\n  </LinearLayout>\n   \n  \n  <LinearLayout \n  android:id=\"@+id/nd3_friend_layout\"\n  android:layout_width=\"55dip\"\n  android:layout_height=\"55dip\" \n  android:layout_weight=\"1\"\n  android:orientation=\"vertical\"\n  android:layout_marginTop=\"5dip\"\n  android:gravity=\"center_horizontal\">\n\t  <ImageView android:id=\"@+id/nd3_friend_image\"\n\t\t  android:layout_width=\"35dip\"\n\t\t  android:layout_height=\"35dip\" \n\t\t  android:src=\"@drawable/nd3_mainfriend_1\" \n\t\t  android:layout_gravity=\"center_horizontal\" \n\t\t  android:gravity=\"center|bottom\"  \n\t\t  />\n\t  <TextView android:id=\"@+id/nd3_friend_text\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"   \n\t  android:text=\"@string/nd3_category_friend\"\n\t  android:textColor=\"@color/nd3_white\"\n\t  android:gravity=\"center|top\" \n\t  />\n  </LinearLayout>\n\n  \n  <RelativeLayout \n  android:id=\"@+id/nd3_message_layout\"\n  android:layout_width=\"55dip\"\n  android:layout_height=\"55dip\" \n  android:layout_marginTop=\"5dip\"\n  android:layout_weight=\"1\">\n      <RelativeLayout  android:id=\"@+id/nd3_message_image_layout\"\n\t\t  android:layout_width=\"55dip\"\n\t\t  android:layout_height=\"35dip\" \n\t\t  android:layout_centerHorizontal=\"true\" >\n\t      <ImageView android:id=\"@+id/nd3_message_image\"\n\t\t\t  android:layout_width=\"35dip\"\n\t\t\t  android:layout_height=\"35dip\" \n\t\t\t  android:src=\"@drawable/nd3_mainmessage_1\"   \n\t\t\t  android:layout_centerHorizontal=\"true\"\n\t\t\t  android:gravity=\"center|bottom\" \n\t\t\t  />\n\t\t  <TextView android:id=\"@+id/nd3_message_count\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t  android:layout_height=\"20dip\"     \n\t\t\t  android:background=\"@drawable/nd3_new_message\"\n\t\t\t  android:layout_alignParentRight=\"true\"\n\t\t\t  android:layout_alignParentTop=\"true\"\n\t\t\t  android:visibility=\"invisible\"\n\t\t\t  android:gravity=\"center\" \n\t\t\t  android:textColor=\"@color/nd3_white\"\n\t\t  \t  />\n\t  </RelativeLayout>\t  \t  \n\t  <TextView android:id=\"@+id/nd3_message_text\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"   \n\t\t  android:text=\"@string/nd3_category_message\"\n\t\t  android:textColor=\"@color/nd3_white\"\n\t\t  android:layout_below=\"@+id/nd3_message_image_layout\"\n\t\t  android:layout_centerHorizontal=\"true\"\n\t  \t  />\n\t  \n  </RelativeLayout>\n  \n  <RelativeLayout \n  android:id=\"@+id/nd3_game_layout\"\n  android:layout_width=\"55dip\"\n  android:layout_height=\"55dip\" \n  android:layout_marginTop=\"5dip\"\n  android:layout_weight=\"1\">\n      <RelativeLayout  android:id=\"@+id/nd3_game_image_layout\"\n\t\t  android:layout_width=\"55dip\"\n\t\t  android:layout_height=\"35dip\" \n\t\t  android:layout_centerHorizontal=\"true\" >\n\t      <ImageView android:id=\"@+id/nd3_game_image\"\n\t\t\t  android:layout_width=\"35dip\"\n\t\t\t  android:layout_height=\"35dip\" \n\t\t\t  android:src=\"@drawable/nd3_maingame_1\"   \n\t\t\t  android:layout_centerHorizontal=\"true\"\n\t\t\t  android:gravity=\"center|bottom\" \n\t\t\t  />\n\t\t  <TextView android:id=\"@+id/nd3_game_count\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t  android:layout_height=\"20dip\"     \n\t\t\t  android:background=\"@drawable/nd3_new_message\"\n\t\t\t  android:layout_alignParentRight=\"true\"\n\t\t\t  android:layout_alignParentTop=\"true\"\n\t\t\t  android:visibility=\"invisible\"\n\t\t\t  android:gravity=\"center\" \n\t\t\t  android:textColor=\"@color/nd3_white\"\n\t\t  \t  />\n\t  </RelativeLayout>\t  \t  \n\t  <TextView android:id=\"@+id/nd3_game_text\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"   \n\t\t  android:text=\"@string/nd3_category_game\"\n\t\t  android:textColor=\"@color/nd3_white\"\n\t\t  android:layout_below=\"@+id/nd3_game_image_layout\"\n\t\t  android:layout_centerHorizontal=\"true\"\n\t  \t  />\n\t  \n  </RelativeLayout>\n    \n  \n \n  <LinearLayout \n  android:id=\"@+id/nd3_more_layout\"\n  android:layout_width=\"55dip\"\n  android:layout_height=\"55dip\" \n  android:layout_marginTop=\"5dip\"\n  android:layout_weight=\"1\"\n  android:orientation=\"vertical\"\n  android:gravity=\"center_horizontal\">\n      <ImageView android:id=\"@+id/nd3_more_image\"\n\t\t  android:layout_width=\"35dip\"\n\t\t  android:layout_height=\"35dip\" \n\t\t  android:src=\"@drawable/nd3_mainmore_1\" \n\t\t  android:gravity=\"center|bottom\"   \n\t\t  />\n\t  <TextView android:id=\"@+id/nd3_more_text\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"   \n\t  android:text=\"@string/nd3_category_more\"\n\t  android:textColor=\"@color/nd3_white\"\n\t  android:gravity=\"center|top\" \n\t  />\n\t  \n  </LinearLayout>\n  \n \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_category_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n  \n<com.nd.commplatform.widget.NdCategoryItem\n      xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\t  android:layout_width=\"fill_parent\" \n\t  android:layout_height=\"wrap_content\"\n\t  android:id=\"@+id/nd3_category_item_rl\"\n\t  >\n\t      <!-- 名称 -->\n\t\t  <TextView\n\t\t  android:id=\"@+id/nd3_category_name\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:layout_toLeftOf=\"@+id/nd3_category_flag\"\n\t\t  android:layout_width=\"0dip\" \n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"\n\t\t  style=\"@style/nd3_textview_1\"/>\n\t\t  \n\t\t  <!--指示符  -->\n\t\t  <ImageView\n\t\t  android:id=\"@+id/nd3_category_flag\"\n\t\t  android:layout_alignParentRight=\"true\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:layout_width=\"wrap_content\" \n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:src=\"@drawable/nd3_switch_image\"/>\n</com.nd.commplatform.widget.NdCategoryItem>\n\t\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_category_plus_image_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdCategoryPlusImageItem\n      xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\t  android:layout_width=\"fill_parent\" \n\t  android:layout_height=\"wrap_content\"\n\t  android:id=\"@+id/nd3_category_item_rl\"\n\t  android:paddingBottom=\"@dimen/nd3_margin_size\"\n\t  >\n\t     <ImageView\n\t\t  android:id=\"@+id/nd3_category_image\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t\t  android:layout_alignParentTop=\"true\"\n\t\t  android:layout_width=\"@dimen/nd3_image_size\"\n\t\t  android:layout_height=\"@dimen/nd3_image_size\"\n\t\t  android:scaleType=\"fitXY\"\n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n\t\n\t      <!-- 名称 -->\n\t\t  <TextView\n\t\t  android:id=\"@+id/nd3_category_name\"\n\t\t  android:layout_toRightOf=\"@id/nd3_category_image\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:layout_toLeftOf=\"@+id/nd3_category_flag\"\n\t\t  android:layout_width=\"0dip\" \n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"\n\t\t  style=\"@style/nd3_textview_1\"/>\n\t\t  \n\t\t  <!--指示符  -->\n\t\t  <ImageView\n\t\t  android:id=\"@+id/nd3_category_flag\"\n\t\t  android:layout_alignParentRight=\"true\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:layout_width=\"wrap_content\" \n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:src=\"@drawable/nd3_switch_image\"/>\n</com.nd.commplatform.widget.NdCategoryPlusImageItem>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_control_center.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  android:id=\"@+id/nd_control_center\"\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation =\"vertical\"\n  android:fillViewport=\"true\">\n \n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_dispatch_search_friend.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  \n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_may_known_category_rl_ext\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_bk1\"\n  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t  <include\n\t  android:id=\"@+id/nd3_may_known_category_rl\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  layout=\"@layout/nd3_category_item\"/>\n  </RelativeLayout>\n  \n  <LinearLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_below=\"@id/nd3_may_known_category_rl_ext\"\n  android:background=\"@drawable/nd3_bk1\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:orientation=\"vertical\">\n\t  <include\n\t  android:id=\"@+id/nd3_account_search_rl\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  layout=\"@layout/nd3_category_item\"/>\n\t  \n\t  <ImageView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n\t  android:background=\"@drawable/nd3_horizontal_line\"/>\n\t   \n\t   <include\n\t  android:id=\"@+id/nd3_nickname_search_rl\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  layout=\"@layout/nd3_category_item\"/>\n\t  \n\t  <ImageView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n\t  android:background=\"@drawable/nd3_horizontal_line\"/>\n\t  \n\t  \n\t   <include\n\t  android:id=\"@+id/nd3_advance_search_rl\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  layout=\"@layout/nd3_category_item\"/>\n\t  \n  </LinearLayout>>\n  \n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <TextView\n\t  android:id=\"@+id/nd3_empty_listview_txt\"\n\t  android:text=\"@string/nd3_list_item_loading\"\n\t  android:textColor=\"@color/nd3_black\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n  \n  <ImageView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:background=\"@drawable/nd3_horizontal_line\"\n\t  android:layout_below=\"@id/nd3_empty_listview_txt\"/>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_frame.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\"\n>\n<LinearLayout\n    android:layout_width=\"fill_parent\" \n\tandroid:layout_height=\"0dip\"\n\tandroid:layout_weight=\"1.0\"\n\tandroid:orientation=\"vertical\"\n\tandroid:background=\"@drawable/nd3_background_xml\" >\n\t<com.nd.commplatform.widget.NdTopBar  \n\t    android:layout_width=\"fill_parent\" \n\t    android:layout_height=\"24dip\" \n\t    android:id=\"@+id/nd3_topbar\" \n\t/>\n\t<com.nd.commplatform.widget.NdTitleBar \n\t\tandroid:layout_width=\"fill_parent\" \n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:layout_below=\"@id/nd3_topbar\" \n\t\tandroid:id=\"@+id/nd3_titlepanel\"\n\t/>\n\t<RelativeLayout\n\t\tandroid:id=\"@+id/nd3_content\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"0dip\"\n\t\tandroid:layout_weight=\"1.0\">\n\t</RelativeLayout>\n</LinearLayout>\n\n<com.nd.commplatform.widget.NdBottomBar\n android:layout_width=\"fill_parent\" \n android:layout_height=\"wrap_content\" \n android:id=\"@+id/nd3_bottombar\"/>\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_home.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation=\"vertical\"\n  >\n  \n  <RelativeLayout\t \n  \t  android:id=\"@+id/nd3_person_layout\" \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\" \n\t  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t    <ImageView \n\t\t\t  android:id=\"@+id/nd3_head_image\" \n\t\t\t  android:layout_width=\"57dip\"\n\t\t      android:layout_height=\"57dip\" \n\t\t      android:src=\"@drawable/nd3_head_bg\"\n\t\t      android:layout_centerVertical=\"true\" \n\t\t      />\n\t  \t \n\t  \n\t    <RelativeLayout\n\t\t\t  android:id=\"@+id/nd3_person_info_layout\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"57dip\"\n\t\t\t  android:layout_centerInParent=\"true\"\t\n\t\t\t  android:orientation=\"vertical\"  \t\t  \n\t\t\t  android:layout_toRightOf=\"@+id/nd3_head_image\" \n\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t  android:background=\"@drawable/nd3_mood_bg\"> \n\t\t\t  \n\t\t\t  <TextView  \n\t\t\t\t  android:id=\"@+id/nd3_mood\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"fill_parent\" \n\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t\t  android:gravity=\"center_vertical\"\n\t\t\t\t  android:layout_toLeftOf=\"@+id/nd3_switch_image\"\n\t\t\t\t  android:maxLines=\"2\"\n\t\t\t\t  android:ellipsize=\"end\"\n\t\t\t\t \n\t\t\t\t  />\n\t\t\t\t  \n\t\t\t  <ImageView  android:id=\"@+id/nd3_switch_image\" \n\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t      android:layout_height=\"wrap_content\" \n\t\t\t      android:scaleType=\"centerInside\"\n\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t      /> \n\t\t\t\t  \t\t\t  \n\t\t</RelativeLayout>\n\t\t\n\t\t\n  </RelativeLayout>\t\n  \n  <LinearLayout\n\t\t  android:id=\"@+id/nd3_info_group_layout\" \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:orientation=\"vertical\"\n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"  \n\t\t  android:background=\"@drawable/nd3_white_bg\"\n\t\t  > \n\t\t <RelativeLayout\n\t\t android:id=\"@+id/nd3_comment_layout\"\n\t\t android:layout_width=\"fill_parent\"\n\t\t android:layout_height=\"wrap_content\"\n\t\t android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t\t android:layout_marginBottom=\"@dimen/nd3_margin_size\"  >\n\t\t  <TextView  \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\" \n\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t  android:textStyle=\"bold\"  \n\t\t\t  android:text=\"@string/nd3_edit_remark\"\n\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t  />\n\t\t  <ImageView \n\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t      />\t \n\t\t   </RelativeLayout>\t  \n\t\t   <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/> \t\t\n\t\t <RelativeLayout\n\t\t android:id=\"@+id/nd3_info_layout\"\n\t\t android:layout_width=\"fill_parent\"\n\t\t android:layout_height=\"wrap_content\"\n\t\t android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t\t android:layout_marginBottom=\"@dimen/nd3_margin_size\" >\n\t\t  <TextView  \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\" \n\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t  android:textStyle=\"bold\"  \n\t\t\t  android:text=\"@string/nd3_view_resources\"\n\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t  />\n\t\t  <ImageView \n\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t      />\t \n\t\t   </RelativeLayout>\n\t\t  \n\t\t\n  </LinearLayout>\n  \n  <LinearLayout\t \n  \t  android:id=\"@+id/nd3_top_layout\"  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\" \n\t  android:gravity=\"center_vertical\"\n\t  android:orientation=\"vertical\"\t  \n\t  >\n\t             <include \n                  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" \n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t   <!--\n\t\t    <RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" \n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t\t  > \n\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_achieve\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"  />\n\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_achieve_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_achieve_rank\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t  />\n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \t\t\t  \n\t\t\t</RelativeLayout>\n\t\t  -->\n\t\t\t<ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t\t\t <include \n                  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t\t\t\t<!--  \n\t\t\t<RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"> \n\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_rank_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\" \n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"/>\n\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_rank_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_ranking\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t  />\n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \t\t\t  \n\t\t\t</RelativeLayout> \n\t\t-->\n\t\t    <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t    <RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_game_detail_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" > \n\t\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_game_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_game_detail\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"\n\t\t\t\t      />\n\t\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_game_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_game\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_game_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"/>\n\t\t\t\t\t  \n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \n\t\t\t\t  \n  \t\t\t</RelativeLayout>\n  \t\t\t\n  </LinearLayout>  \n  \n  <RelativeLayout \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"   \n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"  > \n\t\t\t  \n\t\t  <Button  android:id=\"@+id/nd3_bizarre_button\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentLeft=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_toLeftOf=\"@+id/nd3_hint_button\"\n\t\t      android:text=\"@string/nd3_bizarre_friend\"\n\t\t      android:textStyle=\"bold\"\n\t\t      android:textColor=\"@color/nd3_black\"\n\t\t      android:background=\"@drawable/nd3_white_bg\"\n\t\t      android:gravity=\"center\"\n\t\t      />\n\t\t  <Button  android:id=\"@+id/nd3_hint_button\" \n\t\t\t  android:layout_width=\"30dip\"\n\t\t      android:layout_height=\"wrap_content\"\n\t\t      android:layout_centerInParent=\"true\" \n\t\t      android:visibility=\"invisible\"\n\t\t      />    \n\t\t  <Button  android:id=\"@+id/nd3_friend_button\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_toRightOf=\"@+id/nd3_hint_button\"\n\t\t      android:text=\"@string/nd3_friend_count\"\n\t\t      android:textStyle=\"bold\"\n\t\t      android:textColor=\"@color/nd3_black\"\n\t\t      android:background=\"@drawable/nd3_white_bg\"\n\t\t      android:gravity=\"center\"\n\t\t      />\t\t  \n\t\t     \n\t\t  \n  </RelativeLayout>\n  \n  \n  <Button  android:id=\"@+id/nd3_delete_friend_button\" \n\t\t  android:layout_width=\"fill_parent\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_margin=\"@dimen/nd3_margin_size\"\n\t      android:text=\"@string/nd3_delete_friend\"\n\t      android:textStyle=\"bold\" \n\t      android:textColor=\"@color/nd3_white\"\n\t      android:background=\"@drawable/nd3_friend_del_button\"\n\t      />\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_remark_setting.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  >\n  <RelativeLayout android:id=\"@+id/nd3_remarks_layout\"\n  \t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\tandroid:orientation=\"horizontal\"\n\t\tandroid:background=\"@drawable/nd3_white_bg\"\n\t\tandroid:layout_margin=\"@dimen/nd3_item_divider\"\n\t\t>\n\t\t<TextView android:id=\"@+id/nd3_remarks_label\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd3_remarks\"\n\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\tandroid:layout_alignParentLeft=\"true\"\n\t\t\tandroid:layout_centerVertical=\"true\"/>\n\t\t\t\n\t\t<EditText android:id=\"@+id/nd3_write_message\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\tandroid:textColorHint=\"@color/nd3_hint\" \n\t\t\tandroid:layout_toRightOf=\"@+id/nd3_remarks_label\"\n\t\t  \tandroid:layout_centerVertical=\"true\"\n\t\t  \tandroid:background=\"@null\" \n\t\t\t/>\t\n\t\t\t\n  </RelativeLayout>\n \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_section.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdFriendSectionHeader \n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"@drawable/nd3_friend_section_bg\"> \n    <TextView \n        android:id=\"@+id/nd3_header_txt\"\n        android:layout_width=\"56dip\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentLeft=\"true\"\n        android:textStyle=\"bold\"\n        android:textColor=\"@color/nd3_white\"\n        android:textSize=\"20sp\"\n        android:gravity=\"center\" />\n</com.nd.commplatform.widget.NdFriendSectionHeader>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_section_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdFriendSectionListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_user_item_bg\">\n  <include \n  android:id=\"@+id/nd3_friend_section_rl\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  layout=\"@layout/nd3_friend_section\"\n  />\n  <include\n  android:id=\"@+id/nd3_friend_list_item\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_below=\"@id/nd3_friend_section_rl\"\n  android:layout_alignWithParentIfMissing=\"true\"\n  layout=\"@layout/nd3_user_item\"/>\n  \n</com.nd.commplatform.widget.NdFriendSectionListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_section_panel.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <com.nd.commplatform.friend.NdFriendSectionPanel\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n   <include\n    android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\"\n\tandroid:id=\"@+id/nd3_friend_empty_txt\"\n\tandroid:visibility=\"gone\"\n\tlayout=\"@layout/nd3_blank_listview\"\n\t/>\n   <com.nd.commplatform.friend.FriendHeaderListView\n\t   android:id=\"@+id/nd3_friend_list\"\n\t   android:layout_width=\"fill_parent\"\n\t   android:layout_height=\"fill_parent\"\n\t   android:headerDividersEnabled=\"false\"\n\t   android:footerDividersEnabled=\"false\"\n\t   android:divider=\"@drawable/nd3_horizontal_line\"\n\t   android:cacheColorHint=\"#00000000\"\n\t   android:fadingEdge=\"none\"\n   />\n   \n   <com.nd.commplatform.friend.FriendSectionSwitcher\n\t  android:id=\"@+id/nd3_friend_switcher\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"0dip\"\n\t  android:layout_alignRight=\"@id/nd3_friend_list\"\n\t  android:layout_alignTop=\"@id/nd3_friend_list\"\n\t  android:layout_alignBottom=\"@id/nd3_friend_list\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n </com.nd.commplatform.friend.NdFriendSectionPanel>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_game_content.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<WebView \n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"  \n  android:layout_height=\"fill_parent\"\n  android:scrollbarStyle=\"insideOverlay\"> \n  </WebView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_game_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout  \n  xmlns:android=\"http://schemas.android.com/apk/res/android\" \n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n >\n \n <LinearLayout  android:id=\"@+id/nd3_game_main\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"  \n  android:layout_alignParentTop=\"true\"/>\n <ProgressBar \n android:layout_width=\"wrap_content\"  \n android:layout_height=\"wrap_content\"\n android:id=\"@+id/nd3_web_load_progress\"\n android:indeterminate=\"true\" \n android:layout_centerInParent=\"true\"\n android:visibility=\"gone\" \n android:indeterminateDrawable=\"@drawable/nd3_progress_large\"\n style=\"?android:attr/progressBarStyleLarge\"  />\n       \n <include    \n android:id=\"@+id/nd3_game_error_layout\"  \n android:layout_width=\"fill_parent\"  \n android:layout_height=\"fill_parent\"\n android:layout_alignParentTop=\"true\"\n android:visibility=\"gone\"\n layout=\"@layout/nd3_network_error\" /> \n \n \n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\" >\n\n    <include layout=\"@layout/nd3_title_bar\"/>\n    \n    <FrameLayout\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:layout_weight=\"1.0\" >\n\n        <ViewStub\n            android:id=\"@+id/nd3_home_portrait_stub\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"fill_parent\"\n            android:inflatedId=\"@+id/nd3_home_portrait\"\n            android:layout=\"@layout/nd3_home_portrait\" />\n\n        <ViewStub\n            android:id=\"@+id/nd3_home_land_stub\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"fill_parent\"\n            android:inflatedId=\"@+id/nd3_home_land\"\n            android:layout=\"@layout/nd3_home_land\" />\n    </FrameLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home_land.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\"\n    android:paddingTop=\"@dimen/nd3_platform_padding_size\"\n    android:paddingBottom=\"@dimen/nd3_platform_padding_size\"\n    android:paddingLeft=\"@dimen/nd3_option_item_marginLeft\" \n    android:paddingRight=\"@dimen/nd3_option_item_marginLeft\" >\n\n    <!-- 头像和心情 -->\n\n    <RelativeLayout\n        android:id=\"@+id/nd3_person_layout_land\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingLeft=\"@dimen/nd3_option_item_marginLeft\"\n        android:paddingRight=\"@dimen/nd3_option_item_marginLeft\"\n        android:layout_margin=\"@dimen/nd3_margin_size\" >\n\n        <ImageView\n            android:id=\"@+id/nd3_head_image_land\"\n            android:layout_width=\"57dip\"\n            android:layout_height=\"57dip\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/nd3_head_bg\" />\n\n        <RelativeLayout\n            android:id=\"@+id/nd3_person_info_layout_land\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"57dip\"\n            android:layout_centerInParent=\"true\"\n            android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n            android:layout_toRightOf=\"@+id/nd3_head_image_land\"\n            android:background=\"@drawable/nd3_mood_bg\" >\n\n            <TextView\n                android:id=\"@+id/nd3_mood_land\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"fill_parent\"\n                android:layout_alignParentLeft=\"true\"\n                android:layout_toLeftOf=\"@+id/nd3_switch_image\"\n                android:ellipsize=\"end\"\n                android:gravity=\"center_vertical\"\n                android:maxLines=\"2\"\n                android:textColor=\"@color/nd3_black\"\n                android:textStyle=\"bold\" />\n\n            <ImageView\n                android:id=\"@+id/nd3_switch_image_land\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_alignParentRight=\"true\"\n                android:layout_centerVertical=\"true\"\n                android:scaleType=\"centerInside\"\n                android:src=\"@drawable/nd3_switch_image\" />\n        </RelativeLayout>\n    </RelativeLayout>\n\n    <!-- 各个入口 -->\n\n    <LinearLayout\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:orientation=\"vertical\" >\n\n        <!-- 第一行 -->\n\n        <LinearLayout\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"horizontal\" >\n\n            <!-- 成就榜 -->\n            <Button\n                android:id=\"@+id/nd3_achieve_layout_land\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\" \n                android:layout_weight=\"1.0\"\n                android:paddingTop=\"@dimen/nd3_option_item_marginLeft\"\n                android:paddingBottom=\"@dimen/nd3_option_item_marginLeft\"\n                android:drawablePadding=\"@dimen/nd3_item_divider\"\n                android:background=\"@null\"\n                android:drawableTop=\"@drawable/nd3_achieve\"\n                android:textColor=\"@color/nd3_black\"\n                android:text=\"@string/nd3_achieve_rank\"/>\n\n        \t<ImageView\n\t            android:layout_width=\"1.0dip\"\n\t            android:layout_height=\"fill_parent\"\n\t            android:background=\"@android:color/black\" />\n                    \n        \t<!-- 排行榜 -->\n            <Button\n                android:id=\"@+id/nd3_rank_layout_land\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\" \n                android:layout_weight=\"1.0\"\n                android:paddingTop=\"@dimen/nd3_option_item_marginLeft\"\n                android:paddingBottom=\"@dimen/nd3_option_item_marginLeft\"\n                android:drawablePadding=\"@dimen/nd3_item_divider\"\n                android:background=\"@null\"\n                android:drawableTop=\"@drawable/nd3_rank_image\"\n                android:textColor=\"@color/nd3_black\"\n                android:text=\"@string/nd3_ranking\"/>\n\n        \t<ImageView\n\t            android:layout_width=\"1.0dip\"\n\t            android:layout_height=\"fill_parent\"\n\t            android:background=\"@android:color/black\" />\n        \t            \n        \t<!-- 论坛 -->\n            <Button\n                android:id=\"@+id/nd3_bbs_detail_layout_land\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\" \n                android:layout_weight=\"1.0\"\n                android:paddingTop=\"@dimen/nd3_option_item_marginLeft\"\n                android:paddingBottom=\"@dimen/nd3_option_item_marginLeft\"\n                android:drawablePadding=\"@dimen/nd3_item_divider\"\n                android:background=\"@null\"\n                android:drawableTop=\"@drawable/nd3_bbs_icon\"\n                android:textColor=\"@color/nd3_black\"\n                android:text=\"@string/nd3_show_bbs_detail\"/>                 \n        </LinearLayout>\n\n        <!-- 分割线 -->\n\n        <ImageView\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"1.0dip\"\n            android:background=\"@android:color/black\" />\n\n        <!-- 第二行 -->\n\n        <LinearLayout\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\" >\n\n            <!-- 新鲜事 -->\n            <Button\n                android:id=\"@+id/nd3_bizarre_layout_land\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\" \n                android:layout_weight=\"1.0\"\n                android:paddingTop=\"@dimen/nd3_option_item_marginLeft\"\n                android:paddingBottom=\"@dimen/nd3_option_item_marginLeft\"\n                android:drawablePadding=\"@dimen/nd3_item_divider\"\n                android:background=\"@null\"\n                android:drawableTop=\"@drawable/nd3_bizarre_image\"\n                android:textColor=\"@color/nd3_black\"\n                android:text=\"@string/nd3_bizarre_friend\"/>                 \n\n        \t<ImageView\n\t            android:layout_width=\"1.0dip\"\n\t            android:layout_height=\"fill_parent\"\n\t            android:background=\"@android:color/black\" />\n        \t             \n        \t<!-- 看看谁在玩 -->\n            <Button\n                android:id=\"@+id/nd3_show_player_layout_land\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\" \n                android:layout_weight=\"1.0\"\n                android:paddingTop=\"@dimen/nd3_option_item_marginLeft\"\n                android:paddingBottom=\"@dimen/nd3_option_item_marginLeft\"\n                android:drawablePadding=\"@dimen/nd3_item_divider\"\n                android:background=\"@null\"\n                android:drawableTop=\"@drawable/nd3_showplayer\"\n                android:textColor=\"@color/nd3_black\"\n                android:text=\"@string/nd3_show_player\"/>                 \n\n        \t<ImageView\n\t            android:layout_width=\"1.0dip\"\n\t            android:layout_height=\"fill_parent\"\n\t            android:background=\"@android:color/black\" />\n\n        \t<!-- 邀请好友 -->\t            \n            <Button\n                android:id=\"@+id/nd3_invite_layout_land\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\" \n                android:layout_weight=\"1.0\"\n                android:paddingTop=\"@dimen/nd3_option_item_marginLeft\"\n                android:paddingBottom=\"@dimen/nd3_option_item_marginLeft\"\n                android:drawablePadding=\"@dimen/nd3_item_divider\"\n                android:background=\"@null\"\n                android:drawableTop=\"@drawable/nd3_invite_image\"\n                android:textColor=\"@color/nd3_black\"\n                android:text=\"@string/nd3_invite_friend\"/>                                    \n                            \n        </LinearLayout>\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home_personal.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation=\"vertical\"\n  >\n  \n  <RelativeLayout\t \n  \t  android:id=\"@+id/nd3_person_layout\" \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\" \n\t  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t    <ImageView \n\t\t\t  android:id=\"@+id/nd3_head_image\" \n\t\t\t  android:layout_width=\"57dip\"\n\t\t      android:layout_height=\"57dip\" \n\t\t      android:src=\"@drawable/nd3_head_bg\"\n\t\t      android:layout_centerVertical=\"true\" \n\t\t      />\n\t  \t \n\t  \n\t    <RelativeLayout\n\t\t\t  android:id=\"@+id/nd3_person_info_layout\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"57dip\"\n\t\t\t  android:layout_centerInParent=\"true\"\t\n\t\t\t  android:orientation=\"vertical\"  \t\t  \n\t\t\t  android:layout_toRightOf=\"@+id/nd3_head_image\" \n\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t  android:background=\"@drawable/nd3_mood_bg\"> \n\t\t\t  \n\t\t\t  <TextView  \n\t\t\t\t  android:id=\"@+id/nd3_mood\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"fill_parent\" \n\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t\t  android:gravity=\"center_vertical\"\n\t\t\t\t  android:layout_toLeftOf=\"@+id/nd3_switch_image\"\n\t\t\t\t  android:maxLines=\"2\"\n\t\t\t\t  android:ellipsize=\"end\"\n\t\t\t\t \n\t\t\t\t  />\n\t\t\t\t  \n\t\t\t  <ImageView  android:id=\"@+id/nd3_switch_image\" \n\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t      android:layout_height=\"wrap_content\" \n\t\t\t      android:scaleType=\"centerInside\"\n\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t      /> \n\t\t\t\t  \t\t\t  \n\t\t</RelativeLayout>\n\t\t\n\t\t\n  </RelativeLayout>\t\n  \n  <RelativeLayout\n\t\t  android:id=\"@+id/nd3_info_layout\" \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\" \n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"  \n\t\t  android:background=\"@drawable/nd3_white_bg\"\n\t\t  > \n\t\t   \n\t\t  <TextView  \n\t\t\t  android:id=\"@+id/nd3_info_label\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\" \n\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t  android:textStyle=\"bold\"  \n\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t  />\n\t\t  <ImageView \n\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"  \n\t\t      />\t  \t\t\t  \n  </RelativeLayout>\n  \n  <LinearLayout\t \n  \t  android:id=\"@+id/nd3_top_layout\"  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\" \n\t  android:gravity=\"center_vertical\"\n\t  android:orientation=\"vertical\"\t  \n\t  >\n\t             <include \n                  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" \n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t   <!--\n\t\t    <RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" \n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t\t  > \n\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_achieve\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"  />\n\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_achieve_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_achieve_rank\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t  />\n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \t\t\t  \n\t\t\t</RelativeLayout>\n\t\t  -->\n\t\t\t<ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t\t\t <include \n                  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t\t\t\t<!--  \n\t\t\t<RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"> \n\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_rank_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\" \n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"/>\n\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_rank_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_ranking\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t  />\n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \t\t\t  \n\t\t\t</RelativeLayout> \n\t\t-->\n\t\t    <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t    <RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_game_detail_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" > \n\t\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_game_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_game_detail\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"\n\t\t\t\t      />\n\t\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_game_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_game\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_game_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"/>\n\t\t\t\t\t  \n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \n\t\t\t\t  \n  \t\t\t</RelativeLayout>\n  \t\t\t\n  </LinearLayout>  \n  \n  <RelativeLayout \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"   \n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"  > \n\t\t\t  \n\t\t  <Button  android:id=\"@+id/nd3_bizarre_button\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentLeft=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_toLeftOf=\"@+id/nd3_hint_button\"\n\t\t      android:text=\"@string/nd3_bizarre_friend\"\n\t\t      android:textStyle=\"bold\"\n\t\t      android:textColor=\"@color/nd3_black\"\n\t\t      android:background=\"@drawable/nd3_white_bg\"\n\t\t      />\n\t\t  <Button  android:id=\"@+id/nd3_hint_button\" \n\t\t\t  android:layout_width=\"30dip\"\n\t\t      android:layout_height=\"wrap_content\"\n\t\t      android:layout_centerInParent=\"true\" \n\t\t      android:visibility=\"invisible\"\n\t\t      />    \n\t\t  <Button  android:id=\"@+id/nd3_friend_button\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_toRightOf=\"@+id/nd3_hint_button\"\n\t\t      android:text=\"@string/nd3_friend_count\"\n\t\t      android:textStyle=\"bold\"\n\t\t      android:textColor=\"@color/nd3_black\"\n\t\t      android:background=\"@drawable/nd3_white_bg\"\n\t\t      android:gravity=\"center\"\n\t\t      />\t\t  \n\t\t     \n\t\t  \n  </RelativeLayout>\n  \n  \n  <Button  android:id=\"@+id/nd3_delete_friend_button\" \n\t\t  android:layout_width=\"fill_parent\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_margin=\"@dimen/nd3_margin_size\"\n\t      android:text=\"@string/nd3_delete_friend\"\n\t      android:textStyle=\"bold\" \n\t      android:textColor=\"@color/nd3_white\"\n\t      android:background=\"@drawable/nd3_friend_del_button\"\n\t      />\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home_portrait.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation=\"vertical\"\n  >\n  \n  <RelativeLayout\t \n  \t  android:id=\"@+id/nd3_person_layout\" \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\" \n\t  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t    <ImageView \n\t\t\t  android:id=\"@+id/nd3_head_image\" \n\t\t\t  android:layout_width=\"57dip\"\n\t\t      android:layout_height=\"57dip\" \n\t\t      android:src=\"@drawable/nd3_head_bg\"\n\t\t      android:layout_centerVertical=\"true\" \n\t\t      />\n\t  \t \n\t  \n\t    <RelativeLayout\n\t\t\t  android:id=\"@+id/nd3_person_info_layout\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"57dip\"\n\t\t\t  android:layout_centerInParent=\"true\"\t\t  \n\t\t\t  android:layout_toRightOf=\"@+id/nd3_head_image\"\n\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t  android:background=\"@drawable/nd3_mood_bg\"> \n\t\t\t  \n\t\t\t  <TextView  \n\t\t\t\t  android:id=\"@+id/nd3_mood\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"fill_parent\" \n\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t\t  android:gravity=\"center_vertical\"\n\t\t\t\t  android:layout_toLeftOf=\"@+id/nd3_switch_image\"\n\t\t\t\t  android:maxLines=\"2\"\n\t\t\t\t  android:ellipsize=\"end\"\n\t\t\t\t  />\n\t\t\t\t  \n\t\t\t  <ImageView  android:id=\"@+id/nd3_switch_image\" \n\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t      android:layout_height=\"wrap_content\" \n\t\t\t      android:scaleType=\"centerInside\"\n\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t      android:layout_centerVertical=\"true\"/> \n\t\t\t\t  \t\t\t  \n\t\t</RelativeLayout>\n\t\t\n\t\t\n  </RelativeLayout>\t\n  \n  \n  <LinearLayout\t  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:orientation=\"vertical\"\n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginRight=\"@dimen/nd3_margin_size\">\n\t  <LinearLayout\t \n\t  \t  android:id=\"@+id/nd3_top_layout\"  \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"  \n\t\t  android:gravity=\"center_vertical\"\n\t\t  >\n\t\t  \n\t\t  \t<ImageView  \n\t\t  \t      android:id=\"@+id/nd3_app_image\"\n\t\t\t\t  android:layout_width=\"57dip\"\n\t\t\t      android:layout_height=\"57dip\" \n\t\t\t      android:background=\"@drawable/nd3_game_head\"\n\t\t\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t      />\n\t\t\t\n\t\t    <ImageView \n\t\t    \t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_vertical_line\"\n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t    <LinearLayout \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t  android:orientation=\"vertical\">\n\t\t\t\t \n                  <include \n                  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t      android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t\t\t\t  <!-- \n\t\t\t\t    <RelativeLayout\n\t\t\t\t\t\t  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t      android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t\t  > \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  <ImageView  android:id=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t\t\t  android:src=\"@drawable/nd3_achieve\"\n\t\t\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t      />\n\t\t\t\t\t\t\t  \n\t\t\t\t\t\t  <TextView  \n\t\t\t\t\t\t\t  android:id=\"@+id/nd3_achieve_label\" \n\t\t\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t  android:text=\"@string/nd3_achieve_rank\"\n\t\t\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t\t\t  />\n\t\t\t\t\t\t  <ImageView \n\t\t\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t      />\t  \t\t\t  \n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t -->\n\t\t\t\t\t<ImageView \n\t\t\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t<include \n                  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\n\t\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t\t\t      android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t\t\t\t\t\t<!-- \n\t\t\t\t\t<RelativeLayout\n\t\t\t\t\t\t  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"> \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  <ImageView  android:id=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t\t\t  android:src=\"@drawable/nd3_rank_image\"\n\t\t\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t\t\t      android:layout_centerVertical=\"true\" />\n\t\t\t\t\t\t\t  \n\t\t\t\t\t\t  <TextView  \n\t\t\t\t\t\t\t  android:id=\"@+id/nd3_rank_label\" \n\t\t\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t  android:text=\"@string/nd3_ranking\"\n\t\t\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t\t\t  />\n\t\t\t\t\t\t  <ImageView \n\t\t\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t      />\t  \t\t\t  \n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t-->\n\t\t\t\t\t\n\t\t\t</LinearLayout>\t \n\t\t\t\n\t\t\t \n\t  </LinearLayout>  \n\t  <ImageView \n\t   \t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\" \n\t\t\t/>\n\t  <RelativeLayout\n\t\t  android:id=\"@+id/nd3_bbs_detail_layout\" \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"   \n\t\t  android:layout_marginTop=\"@dimen/nd3_margin_size\"> \n\t\t\t  \n\t\t  <ImageView  android:id=\"@+id/nd3_bbs_image_id\"\n\t\t\t  android:src=\"@drawable/nd3_bbs_icon\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentLeft=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t      />\n\t\t\t\t  \n\t\t  <TextView  \n\t\t\t  android:id=\"@+id/nd3_bbs_label\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t  android:text=\"@string/nd3_show_bbs_detail\"\n\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t  android:textStyle=\"bold\" \n\t\t\t  android:layout_toRightOf=\"@id/nd3_bbs_image_id\"\n\t\t\t  android:layout_centerVertical=\"true\"/>\n\t\t\t  \n\t\t  <ImageView \n\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      />\t  \n\t\t\t\t\t  \n\t  </RelativeLayout>\n  </LinearLayout>\n  \n \n   \n   <RelativeLayout\n\t  android:id=\"@+id/nd3_bizarre_layout\" \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"  \n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"> \n\t\t  \n\t  <ImageView  android:id=\"@+id/nd3_bizarre_image_id\"\n\t\t  android:src=\"@drawable/nd3_bizarre_image\"\n\t\t  android:layout_width=\"wrap_content\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_alignParentLeft=\"true\"\n\t      android:layout_centerVertical=\"true\"\n\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t      />\n\t\t\t  \n\t  <TextView  \n\t\t  android:id=\"@+id/nd3_bizarre_label\" \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:text=\"@string/nd3_bizarre_friend\"\n\t\t  android:textColor=\"@color/nd3_black\"\n\t\t  android:textStyle=\"bold\" \n\t\t  android:layout_toRightOf=\"@+id/nd3_bizarre_image_id\"\n\t\t  android:layout_centerVertical=\"true\"/>\n\t\t  \n\t  <ImageView \n\t\t  \t  android:id=\"@+id/nd3_bizarre_jump_image\"\n\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\" \n\t\t      />\t  \n   </RelativeLayout>\n   \n    <RelativeLayout\n\t  android:id=\"@+id/nd3_show_player_layout\" \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"  \n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\"> \n\t\t  \n\t  <ImageView  android:id=\"@+id/nd3_show_image_id\"\n\t\t  android:src=\"@drawable/nd3_showplayer\"\n\t\t  android:layout_width=\"wrap_content\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_alignParentLeft=\"true\"\n\t      android:layout_centerVertical=\"true\" \n\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t      />\n\t\t\t  \n\t  <TextView  \n\t\t  android:id=\"@+id/nd3_show_label\" \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:text=\"@string/nd3_show_player\"\n\t\t  android:textColor=\"@color/nd3_black\"\n\t\t  android:textStyle=\"bold\" \n\t\t  android:layout_toRightOf=\"@+id/nd3_show_image_id\"\n\t\t  android:layout_centerVertical=\"true\"/>\n\t\t  \n\t  <ImageView \n\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t  android:layout_width=\"wrap_content\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_alignParentRight=\"true\"\n\t      android:layout_centerVertical=\"true\"\n\t      />\t  \n\t\t\t\t  \n  </RelativeLayout>\n  \n  \n   <RelativeLayout\n\t  android:id=\"@+id/nd3_invite_layout\" \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"  \n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"> \n\t\t  \n\t  <ImageView  android:id=\"@+id/nd3_invite_image_id\"\n\t\t  android:src=\"@drawable/nd3_invite_image\"\n\t\t  android:layout_width=\"wrap_content\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_alignParentLeft=\"true\"\n\t      android:layout_centerVertical=\"true\"\n\t      android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t      />\n\t\t\t  \n\t  <TextView  \n\t\t  android:id=\"@+id/nd3_invite_label\" \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:text=\"@string/nd3_invite_friend\"\n\t\t  android:textColor=\"@color/nd3_black\"\n\t\t  android:textStyle=\"bold\" \n\t\t  android:layout_toRightOf=\"@+id/nd3_invite_image_id\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  />\n\t\t  \n\t  <ImageView \n\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t  android:layout_width=\"wrap_content\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_alignParentRight=\"true\"\n\t      android:layout_centerVertical=\"true\"\n\t      />\t  \n\t\t\t\t  \n   </RelativeLayout>\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_invite_friend.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation=\"vertical\"\n  >\n\t<LinearLayout\t  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\" \n\t  android:gravity=\"center_vertical\"\n\t  android:orientation=\"vertical\"\t  \n\t  >\n\t   \n\t\t    <RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_invite_91friend_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"  \n\t\t\t\t  > \n\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_91_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_91\"\n\t\t\t\t\t  android:layout_width=\"@dimen/nd3_platform_image_size\"\n\t\t\t\t      android:layout_height=\"@dimen/nd3_platform_image_size\"\n\t\t\t\t      android:scaleType=\"fitXY\"\n\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"  />\n\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_invite_91friend\"\n\t\t\t\t\t  style=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_91_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t  />\n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \t\t\t  \n\t\t\t</RelativeLayout>\n\t\t\t\n\t\t\t\n\t\t\t<LinearLayout android:id=\"@+id/nd3_thirdplatform_layout\"\n\t\t\t   \t\tandroid:layout_width=\"fill_parent\"\n\t  \t\t\t\tandroid:layout_height=\"wrap_content\"\n\t  \t\t\t\tandroid:orientation=\"vertical\">\n\t\t\t\t\t<!--<ImageView \n\t\t\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t<RelativeLayout \n\t\t\t\t\t\t  android:id=\"@+id/nd3_invite_sinafriend_layout\" \n\t\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" > \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  <ImageView  android:id=\"@+id/nd3_sina_image_id\" \n\t\t\t\t\t\t\t  android:src=\"@drawable/nd3_icon_03\"\n\t\t\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t\t\t      android:layout_alignParentLeft=\"true\" \n\t\t\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"/>\n\t\t\t\t\t\t\t  \n\t\t\t\t\t\t  <TextView   \n\t\t\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t  android:text=\"@string/nd3_invite_sinafriend\"\n\t\t\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_sina_image_id\"\n\t\t\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t\t  />\n\t\t\t\t\t\t  <ImageView \n\t\t\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t      />\t  \t\t\t  \n\t\t\t\t\t</RelativeLayout> \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t     --></LinearLayout>\n  \t\t\t\n  </LinearLayout>  \n\t\t    \n  \t\t\t\n</LinearLayout>  \n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_invite_friend_choice.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:orientation=\"vertical\"\n  >\n    <TextView\n    android:id=\"@+id/nd3_invite_friend_tip\"\n    android:text=\"@string/nd3_invite_friend_choice_tip\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    android:layout_margin=\"@dimen/nd3_margin_size\"\n    android:textColor=\"@color/nd3_white\"\n    android:layout_gravity=\"center_horizontal\"\n    android:visibility=\"gone\"/>\n    <RelativeLayout\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:background=\"@drawable/nd3_bk1\"\n    android:layout_margin=\"@dimen/nd3_margin_size\">\n\t  <ListView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\"\n\t  android:id=\"@+id/nd3_rank_category_listview\"\n\t  android:headerDividersEnabled=\"false\"\n\t  android:footerDividersEnabled=\"false\"\n\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t  android:fastScrollEnabled=\"true\"\n\t  android:cacheColorHint=\"#00000000\"\n\t  android:fadingEdge=\"none\"\n\t  />\n\t</RelativeLayout>\n \n </LinearLayout>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_invite_friend_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdInviteFriendListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_user_item_bg\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n   <ImageView\n  android:id=\"@+id/nd3_user_image\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_alignParentTop=\"true\"\n  android:layout_width=\"@dimen/nd3_image_size\"\n  android:layout_height=\"@dimen/nd3_image_size\"\n  android:scaleType=\"fitXY\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  />\n  <RelativeLayout\n  android:id=\"@+id/nd3_user_item_content_rl\"\n  android:layout_toRightOf=\"@id/nd3_user_image\"\n  android:layout_alignTop=\"@id/nd3_user_image\"\n  android:layout_toLeftOf=\"@+id/nd3_user_action_btn\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\">\n\t  <TextView\n\t  android:id=\"@+id/nd3_user_name_txt\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:singleLine=\"true\"\n      android:ellipsize=\"end\"  \n\t  android:layout_alignParentLeft=\"true\"\n      android:layout_alignParentTop=\"true\"\n\t  style=\"@style/nd3_textview_1\"/>\n\t  \n\t  <TextView\n\t  android:id=\"@+id/nd3_user_content\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_name_txt\"\n\t  android:layout_below=\"@id/nd3_user_name_txt\"\n\t  style=\"@style/nd3_textview_2\"/>\n  </RelativeLayout>\n  \n  <TextView\n  android:id=\"@+id/nd3_user_action_btn\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:layout_alignParentRight=\"true\"\n  android:layout_centerVertical=\"true\"\n  android:textColor=\"@color/nd3_black\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n</com.nd.commplatform.widget.NdInviteFriendListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_leaderboard_category.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  >\n    <RelativeLayout\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:background=\"@drawable/nd3_bk1\"\n    android:layout_margin=\"@dimen/nd3_margin_size\">\n\t  <ListView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\"\n\t  android:id=\"@+id/nd3_rank_category_listview\"\n\t  android:headerDividersEnabled=\"false\"\n\t  android:footerDividersEnabled=\"false\"\n\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t  android:fastScrollEnabled=\"true\"\n\t  android:cacheColorHint=\"#00000000\"\n\t  android:fadingEdge=\"none\"\n\t  />\n\t</RelativeLayout>\n \n </RelativeLayout>\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_leaderboard_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdLeaderBoardListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_user_item_bg\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n  \n  <ImageView\n  android:id=\"@+id/nd3_user_image\"\n  android:layout_width=\"@dimen/nd3_image_size\"\n  android:layout_height=\"@dimen/nd3_image_size\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_alignParentTop=\"true\"\n  android:scaleType=\"fitXY\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  />\n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_user_item_content_rl\"\n  android:layout_width=\"0dip\"\n  android:layout_height=\"wrap_content\"\n  android:layout_alignParentTop=\"true\"\n  android:layout_toRightOf=\"@id/nd3_user_image\"\n  android:layout_toLeftOf=\"@+id/nd3_rank_txt\">\n\t  <TextView\n\t  android:id=\"@+id/nd3_user_name_txt\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n      android:layout_alignParentTop=\"true\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"\n\t  style=\"@style/nd3_textview_1\"/>\n\t  \n\t  <TextView\n\t  android:id=\"@+id/nd3_user_content\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_name_txt\"\n\t  android:layout_below=\"@id/nd3_user_name_txt\"\n\t  style=\"@style/nd3_textview_2\"/>\n  </RelativeLayout>\n  \n  <TextView\n  android:id=\"@+id/nd3_rank_txt\"\n  android:layout_width=\"43dip\"\n  android:layout_height=\"43dip\"\n  style=\"@style/nd3_textview_4\"\n  android:gravity=\"center\"\n  android:layout_alignParentRight=\"true\"\n  android:layout_centerVertical=\"true\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n</com.nd.commplatform.widget.NdLeaderBoardListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_footer.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@color/nd3_list_view_divider\">\n  <TextView\n  android:id=\"@+id/nd3_listview_footer_txt\"\n  android:text=\"@string/nd3_list_view_more_record\"\n  android:textColor=\"@color/nd3_black\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:layout_centerHorizontal=\"true\"\n  android:layout_alignParentTop=\"true\"/>\n  \n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_footer_ext.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdListViewFooter\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@color/nd3_list_view_divider\">\n  <TextView\n  android:id=\"@+id/nd3_listview_footer_txt\"\n  android:text=\"@string/nd3_list_view_more_record\"\n  android:textColor=\"@color/nd3_black\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"40dip\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:layout_centerInParent=\"true\"\n  android:gravity=\"center\"/>\n  \n  \n  <ProgressBar \n  android:id=\"@+id/nd3_footer_more_loading\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:layout_alignParentRight=\"true\"\n  android:layout_centerVertical=\"true\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:visibility=\"invisible\"\n  style=\"?android:progressBarStyleSmall\"/>\n</com.nd.commplatform.widget.NdListViewFooter>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_template.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ListView\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:id=\"@+id/nd3_listview_template\"\n  android:headerDividersEnabled=\"false\"\n  android:footerDividersEnabled=\"false\"\n  android:divider=\"@drawable/nd3_list_separator\"\n  android:fastScrollEnabled=\"true\"\n  android:cacheColorHint=\"#00000000\"\n  android:fadingEdge=\"none\">\n</ListView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_template_no_divider.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ListView\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:id=\"@+id/nd3_listview_template\"\n  android:headerDividersEnabled=\"false\"\n  android:footerDividersEnabled=\"false\"\n  android:divider=\"@null\"\n  android:dividerHeight=\"0dip\"\n  android:fastScrollEnabled=\"true\"\n  android:cacheColorHint=\"#00000000\"\n  android:fadingEdge=\"none\">\n</ListView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_mesg_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n  \n  <RadioGroup \n        android:layout_width=\"fill_parent\"\n  \t\tandroid:layout_height=\"wrap_content\">\n  \t\t<RadioButton \n  \t\t\t\tandroid:id=\"@+id/nd3_my_msge\"\n  \t\t\t\tandroid:layout_width=\"wrap_content\"\n  \t\t\t\tandroid:layout_height=\"wrap_content\"\n  \t\t\t\tandroid:text=\"@string/nd3_my_msge\"/>\n  </RadioGroup>\t\t\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_friendmsge_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n  \n\t  <LinearLayout \n\t  \t\tandroid:id=\"@+id/nd3_msge_head_layout\"\n\t  \t\tandroid:layout_width=\"fill_parent\"\n\t  \t    android:layout_height=\"wrap_content\"\n\t  \t    android:orientation=\"vertical\">\n\t\t  <RelativeLayout \n\t\t      android:layout_width=\"fill_parent\"\n\t\t  \t  android:layout_height=\"wrap_content\"\n\t\t  \t  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\">\n\t\t  \t  \n\t\t  \t  <ImageView android:id=\"@+id/nd3_msge_head_image\"\n\t\t\t      android:layout_width=\"57dip\"\n\t\t\t  \t  android:layout_height=\"57dip\"\n\t\t\t  \t  android:src=\"@drawable/nd3_head_bg\"\n\t\t\t  \t  android:layout_alignParentLeft=\"true\"\n\t\t\t  \t  android:layout_marginRight=\"@dimen/nd3_option_item_marginLeft\"/>\n\t\t  \t  <TextView android:id=\"@+id/nd3_nickname\"\n\t\t  \t  \t  android:layout_width=\"0dip\"\n\t\t  \t  \t  android:layout_height=\"wrap_content\"\n\t\t  \t  \t  android:textColor=\"@color/nd3_white\"\n\t\t  \t  \t  android:textSize=\"@dimen/nd3_btn_text_size\"\n\t\t  \t  \t  android:layout_toRightOf=\"@id/nd3_msge_head_image\"\n\t\t  \t  \t  android:layout_toLeftOf=\"@+id/nd3_head_switch_image\"\n\t\t  \t  \t  />\n\t\t  \t  \t  \n\t\t  \t   <ImageView \n\t\t  \t    android:id=\"@+id/nd3_head_switch_image\"\n\t\t        android:layout_width=\"wrap_content\"\n\t\t  \t\tandroid:layout_height=\"wrap_content\"\n\t\t  \t\tandroid:background=\"@drawable/nd3_switch_image_white\"\n\t\t  \t\tandroid:layout_alignParentRight=\"true\"\n\t\t  \t\tandroid:layout_alignTop=\"@id/nd3_nickname\"/>\n\t\t  \t\t\n\t\t  \t  <TextView android:id=\"@+id/nd3_mood\"\n\t\t  \t  \t  android:layout_width=\"fill_parent\"\n\t\t  \t  \t  android:layout_height=\"wrap_content\"\n\t\t  \t  \t  android:layout_toRightOf=\"@+id/nd3_msge_head_image\"\n\t\t  \t  \t  android:layout_below=\"@+id/nd3_nickname\"\n\t\t  \t  \t  android:maxLines=\"5\"\n\t\t  \t  \t  android:ellipsize=\"end\"\n\t\t  \t  \t  android:textColor=\"@color/nd3_white\"/>\n\t\t  </RelativeLayout>\t  \n\t\t  <ImageView \n\t\t        android:layout_width=\"fill_parent\"\n\t\t  \t\tandroid:layout_height=\"wrap_content\"\n\t\t  \t\tandroid:background=\"@drawable/nd3_line\"\n\t\t  \t\t/>\n\t  </LinearLayout>\t\n\t  <RelativeLayout\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"0dip\"\n\t  android:layout_below=\"@+id/nd3_msge_head_layout\"\n\t  android:layout_above=\"@+id/nd3_send_msge\"\n\t  android:background=\"@color/nd3_list_view_item_bg_1\">\n\t\t  <ListView android:id=\"@+id/nd3_message_listview\"\n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"fill_parent\"\n\t\t\t  android:headerDividersEnabled=\"false\"\n\t\t\t  android:footerDividersEnabled=\"false\" \n\t\t\t  android:drawSelectorOnTop=\"true\" \n\t\t\t  android:cacheColorHint=\"#00000000\"\n\t\t\t  android:fadingEdge=\"none\"\n\t\t\t  android:divider=\"@null\"\n\t\t\t  android:listSelector=\"#00000000\"\n\t\t\t  android:fastScrollEnabled=\"true\"\n\t\t\t  />\n\t   </RelativeLayout>\n\t\t  \n\t  <RelativeLayout android:id=\"@+id/nd3_send_msge\"\n\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\"\n\t\t    android:layout_alignParentBottom=\"true\"\n\t\t    android:gravity=\"center_vertical\"\n\t\t    android:background=\"@drawable/nd3_input_bg\"\n\t\t    android:paddingRight=\"5dip\"\n\t\t    android:paddingLeft=\"5dip\"\n\t\t    android:paddingBottom=\"5dip\">\n\t\t    \n\t\t    <EditText android:id=\"@+id/nd3_msge\"\n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t    android:background=\"@drawable/nd3_inputbox_bg1\"\n\t\t\t    android:layout_alignParentLeft=\"true\"\n\t\t\t    android:layout_toLeftOf=\"@+id/nd3_send\"\n\t\t\t    android:layout_marginRight=\"5dip\"\n\t\t\t    android:maxLines=\"5\"\n\t\t\t    android:maxLength=\"140\"\n\t\t\t    android:layout_centerVertical=\"true\"/>\n\t\t    <Button android:id=\"@+id/nd3_send\"\n\t\t  \t\tandroid:layout_width=\"wrap_content\"\n\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t    android:text=\"@string/nd3_send\"\n\t\t\t    android:textColor=\"@color/nd3_white\"\n\t\t\t    android:background=\"@drawable/nd3_button_x\"\n\t\t\t    android:gravity=\"center\"\n\t\t\t    android:layout_alignParentRight=\"true\"  \n\t\t\t    android:layout_centerVertical=\"true\"/>\n\t  </RelativeLayout>\t     \n\t    \t\t\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n  \n  <RadioGroup \n        android:layout_width=\"fill_parent\"\n  \t\tandroid:layout_height=\"wrap_content\">\n  \t\t<RadioButton \n  \t\t\t\tandroid:id=\"@+id/nd3_my_msge\"\n  \t\t\t\tandroid:layout_width=\"wrap_content\"\n  \t\t\t\tandroid:layout_height=\"wrap_content\"\n  \t\t\t\tandroid:text=\"@string/nd3_my_msge\"/>\n  </RadioGroup>\t\t\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_receive_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 消息 from -->\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:id=\"@+id/nd3_message_send_item_layout\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_marginRight=\"@dimen/nd3_item_divider\">\n  \n  <TextView\n  android:id=\"@+id/nd3_messagetiem_txt\"\n  android:layout_height=\"wrap_content\"\n  android:layout_width=\"wrap_content\"\n  android:layout_marginRight=\"@dimen/nd3_item_divider\"\n  android:layout_centerHorizontal=\"true\"\n  android:textColor=\"@color/nd3_black\"\n  />\n  \n  <TextView\n  android:id=\"@+id/nd3_message_send_txt\"\n  android:layout_below=\"@id/nd3_messagetiem_txt\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:layout_marginRight=\"@dimen/nd3_item_divider\"\n  android:layout_alignParentRight=\"true\" \n  android:background=\"@drawable/nd3_msge_friend\" \n  android:textColor=\"@color/nd3_black\"\n  />\n     \n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_record_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdMessageRecordListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <TextView\n  android:id=\"@+id/nd3_messagetiem_txt\"\n  android:layout_height=\"wrap_content\"\n  android:layout_width=\"wrap_content\" \n  android:textColor=\"@color/nd3_black\"\n  android:layout_centerHorizontal=\"true\" \n  android:layout_alignParentTop=\"true\"/>\n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_message_item_layout\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_below=\"@id/nd3_messagetiem_txt\"\n  android:layout_marginLeft=\"@dimen/nd3_item_divider\"\n  android:layout_marginRight=\"@dimen/nd3_item_divider\">\n\t  \n\t  <TextView\n\t  android:id=\"@+id/nd3_message_send_txt\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:background=\"@drawable/nd3_msge_owen\" \n\t  android:textColor=\"@color/nd3_black\"/>\n\t  \n\t   <TextView\n\t  android:id=\"@+id/nd3_message_rcv_txt\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentRight=\"true\"\n\t  android:background=\"@drawable/nd3_msge_friend\" \n\t  android:textColor=\"@color/nd3_black\"/>\n     \n </RelativeLayout>\n</com.nd.commplatform.widget.NdMessageRecordListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_send.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:background=\"@color/nd3_white\">\n  \n  <RelativeLayout \n\t  android:id=\"@+id/nd3_receiver_layout\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\"\n\t  >\n  \t\t<TextView \t\n\t\t  \t  android:id=\"@+id/nd3_receiver_label\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t  android:text=\"@string/nd3_receiver\"\n\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t  android:textSize=\"16dip\"\n\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t  android:textColor=\"@color/nd3_black\"/>\n\t\t<EditText\t  \n  \t\t\t  android:id=\"@+id/nd3_receiver\"\n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t  android:layout_toRightOf=\"@+id/nd3_receiver_label\"\n\t\t\t  android:layout_toLeftOf=\"@+id/nd3_add_receiver\"\n\t\t\t  android:layout_centerInParent=\"true\"\n\t\t\t  android:background=\"@null\"\n\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t  android:editable=\"false\"\n\t\t\t  android:cursorVisible=\"false\"/>\n\t\t<ImageView \t  \n\t\t\t  android:id=\"@+id/nd3_add_receiver\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t  android:layout_alignParentRight=\"true\"\n\t\t\t  android:src=\"@drawable/nd3_add\"\n\t\t\t  android:layout_centerVertical=\"true\"/>\n  </RelativeLayout>\n  \n  <ImageView \n  \t\t  android:id=\"@+id/nd3_line\"\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\" \n\t\t  android:background=\"@drawable/nd3_horizontal_line\"\n\t\t  android:layout_below=\"@+id/nd3_receiver_layout\"/>\n\t\t  \n  <EditText \n  \t\t  android:id=\"@+id/nd3_message\"\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"fill_parent\" \n\t\t  android:background=\"@null\"\n\t\t  android:layout_below=\"@+id/nd3_line\"\n\t\t  android:hint=\"@string/nd3_send_message_sendhint_str\"\n\t\t  android:gravity=\"top\"\n\t\t  android:layout_margin=\"@dimen/nd3_item_divider\" />\n \t  \n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_send_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 消息to -->\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:id=\"@+id/nd3_message_send_item_layout\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_marginLeft=\"@dimen/nd3_item_divider\">\n  <TextView\n  android:id=\"@+id/nd3_messagetiem_txt\"\n  android:layout_height=\"wrap_content\"\n  android:layout_width=\"wrap_content\" \n  android:textColor=\"@color/nd3_black\"\n  android:layout_centerHorizontal=\"true\" \n  android:layout_marginLeft=\"@dimen/nd3_item_divider\"/>\n  \n  <TextView\n  android:id=\"@+id/nd3_message_send_txt\"\n  android:layout_below=\"@id/nd3_messagetiem_txt\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_marginLeft=\"@dimen/nd3_item_divider\"\n  android:layout_marginRight=\"@dimen/nd3_item_divider\"\n  android:background=\"@drawable/nd3_msge_owen\" \n  android:textColor=\"@color/nd3_black\"/>\n     \n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_about.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:orientation=\"vertical\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n    \n    <!-- 游戏开发商信息 -->\n    <LinearLayout  \n    \tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"horizontal\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\" \n\t\tandroid:gravity=\"left\">\n\t\t<ImageView \n\t\t\tandroid:id=\"@+id/nd_app_image\"\n\t\t\tandroid:layout_width=\"48dip\"\n\t\t\tandroid:layout_height=\"48dip\"\n\t\t\tandroid:layout_gravity=\"center_vertical\"\n\t\t\tandroid:layout_marginRight=\"20dip\"\n\t\t\tandroid:scaleType=\"centerInside\"\n\t\t\t/>\n\t    <LinearLayout\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"vertical\"  \n\t\t\t>\n\t\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_appname\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\"  \n\t\t\tandroid:gravity=\"left\" />\n\t\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_appversion\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\" \n\t\t\tandroid:layout_marginTop=\"@dimen/nd_about_size\"\n\t\t\tandroid:gravity=\"left\"/>\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd_about_size\"  \n\t\t\t\t>\n\t\t\t\t<TextView \n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_company_title\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\" \n\t\t\t\tandroid:gravity=\"left\"/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t<TextView \n\t\t\t\tandroid:id=\"@+id/nd3_company\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\" \n\t\t\t\tandroid:gravity=\"left\"/>\n\t\t\t</LinearLayout>\n\t\t\t\n\t\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_debug\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\" \n\t\t\tandroid:gravity=\"left\"\n\t\t\tandroid:text=\"@string/nd_debug_model\"\n\t\t\tandroid:layout_marginTop=\"@dimen/nd_about_size\"\n\t\t\tandroid:visibility=\"gone\"/>\n\t\t</LinearLayout>\t\n\t</LinearLayout>\n\t \n\t\n\t<!-- 91社区信息 -->\n\t<LinearLayout  \n    \tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"horizontal\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\n\t\tandroid:gravity=\"left\"\n\t\t>\n\t\t<ImageView  \n\t\t\tandroid:layout_width=\"48dip\"\n\t\t\tandroid:layout_height=\"48dip\"\n\t\t\tandroid:src=\"@drawable/nd_logo48\" \n\t\t\tandroid:layout_marginRight=\"20dip\"\n\t\t\tandroid:layout_gravity=\"center_vertical\"\n\t\t\tandroid:scaleType=\"centerInside\"\n\t\t\t/>\n\t    <LinearLayout\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"vertical\" \n\t\t\t>\n\t\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_sdkname\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\tandroid:gravity=\"left\" \n\t\t\t/>\n\t\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_sdkversion\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\tandroid:layout_marginTop=\"@dimen/nd_about_size\"\n\t\t\tandroid:gravity=\"left\" />\n\t\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_sdkcompany\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\tandroid:layout_marginTop=\"@dimen/nd_about_size\"\n\t\t\tandroid:gravity=\"left\" />\n\t\t</LinearLayout>\n    </LinearLayout> \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_account.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/nd3_more_account_layout\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:gravity=\"center_horizontal\"\n    android:orientation=\"vertical\" >\n\n    <!-- 当前帐号提示 -->\n\n    <TextView\n        android:id=\"@+id/nd3_more_account_account_id\"\n        style=\"@style/nd3_option_margin_style\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n        android:gravity=\"left\"\n        android:text=\"@string/nd3_more_account_account_format\"\n        android:textColor=\"@color/nd3_white\"\n        android:textSize=\"@dimen/nd3_btn_text_size\" >\n    </TextView>\n\n    <LinearLayout\n        android:id=\"@+id/nd3_more_more_layout_list\"\n        style=\"@style/nd3_option_margin_style\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:orientation=\"vertical\" >\n\n        <!-- 修改密码 -->\n\n        <LinearLayout\n            android:id=\"@+id/nd3_more_account_password\"\n            style=\"@style/nd3_option_item_margin_style\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_vertical\"\n            android:orientation=\"horizontal\" >\n\n            <TextView\n                android:id=\"@+id/nd3_more_account_password_title\"\n                style=\"@style/nd3_option_textview_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_weight=\"1\"\n                android:text=\"@string/nd3_more_account_password\" >\n            </TextView>\n\n            <ImageView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:src=\"@drawable/nd3_switch_image\" >\n            </ImageView>\n        </LinearLayout>\n         \n    </LinearLayout>\n\n    <LinearLayout android:id=\"@+id/nd3_more_account_other_bind\"\n        style=\"@style/nd3_option_margin_style\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:orientation=\"vertical\" >\n\n        <!-- 第三方帐户登录 -->\n\n        <LinearLayout\n            android:id=\"@+id/nd3_more_account_other\"\n            style=\"@style/nd3_option_item_margin_style\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_vertical\"\n            android:orientation=\"horizontal\"\n            android:visibility=\"visible\" >\n\n            <ImageView\n                android:id=\"@+id/nd3_more_account_other_icon\"\n                android:layout_width=\"@dimen/nd3_platform_image_size\"\n                android:layout_height=\"@dimen/nd3_platform_image_size\"\n                android:src=\"@drawable/nd3_3rd_platform_icon\" >\n            </ImageView>\n\n            <!-- 区分未/已绑定，不能绑定2种情况 -->\n\n            <FrameLayout\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_weight=\"1\" >\n\n                <!-- 未/已绑定 -->\n\n                <LinearLayout\n                    android:id=\"@+id/nd3_more_account_bind_layout\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:gravity=\"center_vertical\"\n                    android:orientation=\"horizontal\"\n                    android:visibility=\"visible\" >\n\n                    <TextView\n                        android:id=\"@+id/nd3_more_account_other_title\"\n                        style=\"@style/nd3_option_textview_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n                        android:layout_weight=\"1\"\n                        android:text=\"@string/nd3_more_account_other_login\" >\n                    </TextView>\n\n                    <TextView\n                        android:id=\"@+id/nd3_more_account_other_binded_title\"\n                        style=\"@style/nd3_option_textview_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n                        android:text=\"@string/nd3_more_account_other_login\"\n                        android:visibility=\"gone\" >\n                    </TextView>\n\n                    <ImageView\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:src=\"@drawable/nd3_switch_image\" >\n                    </ImageView>\n                </LinearLayout>\n\n                <!-- 不能绑定 -->\n\n                <LinearLayout\n                    android:id=\"@+id/nd3_more_account_cannot_bind_layout\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:orientation=\"vertical\"\n                    android:visibility=\"gone\" >\n\n                    <TextView\n                        android:id=\"@+id/nd3_more_account_cannot_bind_title\"\n                        style=\"@style/nd3_option_textview_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n                        android:layout_weight=\"1\"\n                        android:text=\"@string/nd3_more_account_other_login\" >\n                    </TextView>\n\n                    <TextView\n                        style=\"@style/nd3_option_textview_style\"\n                        android:layout_width=\"fill_parent\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n                        android:text=\"@string/nd3_more_account_cannot_bind\" >\n                    </TextView>\n                </LinearLayout>\n            </FrameLayout>\n        </LinearLayout>\n \n    </LinearLayout>\n\n    <!-- 绑定手机号码 -->\n\n    <LinearLayout\n            android:id=\"@+id/nd3_more_account_bind_phonenumber_new\"\n            style=\"@style/nd3_option_margin_style\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_vertical\"\n            android:orientation=\"horizontal\" \n            android:paddingLeft=\"@dimen/nd3_option_margin_top\"\n            android:paddingRight=\"@dimen/nd3_option_margin_top\"\n            android:background=\"@drawable/nd3_bk1\">\n\n            <ImageView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:src=\"@drawable/nd3_icon_more06\" >\n            </ImageView>\n\n            <TextView android:id=\"@+id/nd3_more_account_bind_phonenumber_label\"\n                style=\"@style/nd3_option_textview_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n                android:layout_weight=\"1\" >\n            </TextView>\n\n            <TextView\n                android:id=\"@+id/nd3_more_account_bind_phonenumber_status\"\n                style=\"@style/nd3_option_textview_style\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"  \n                android:layout_marginRight=\"@dimen/nd3_option_item_marginLeft\"\n                android:gravity=\"right\" \n                >\n            </TextView>\n                        \n            <ImageView android:id=\"@+id/nd_more_account_bind_switch\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:src=\"@drawable/nd3_switch_image\" >\n            </ImageView>\n        </LinearLayout> \n\n    <!-- 自动登录 -->\n\n    <LinearLayout\n        style=\"@style/nd3_option_margin_padding_style\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:visibility=\"gone\" >\n\n        <TextView\n            style=\"@style/nd3_option_textview_style\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"1\"\n            android:text=\"@string/nd3_more_account_autologin\" >\n        </TextView>\n\n        <CheckBox\n            android:id=\"@+id/nd3_more_account_is_autologin\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:background=\"@drawable/nd3_checkbox_button\"\n            android:button=\"@null\" >\n        </CheckBox>\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_bean_recharge.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout \n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" \n\tandroid:layout_height=\"fill_parent\"  \n\t>\n\n    <LinearLayout \n\t  android:id=\"@+id/nd3_91bean_manage_layout\"  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\" \n\t  >\n  \n \t</LinearLayout>\n\t<!--<WebView \n\t\tandroid:id=\"@+id/nd3_91bean_manage\"\n\t\tandroid:layout_width=\"fill_parent\" \n\t\tandroid:layout_height=\"fill_parent\"\n\t\t />\n\t\t\n\t--><ProgressBar \n\t\tandroid:id=\"@+id/nd3_web_load_progress\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_gravity=\"center\" \n\t\tandroid:indeterminate=\"true\" \n\t\tandroid:layout_centerInParent=\"true\"\n\t\tandroid:visibility=\"gone\" \n\t\tandroid:indeterminateDrawable=\"@drawable/nd3_progress_large\"\n\t\tstyle=\"?android:attr/progressBarStyleLarge\"/>\n\t\t\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_consume_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_consume_detail_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 订单号 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_consume_detail_item_order\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_consume_detail_item_order\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\n\t\t<!-- 时间 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_consume_detail_item_date\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_consume_detail_item_date\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 项目 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_consume_detail_item_app\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_consume_detail_item_app\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 物品 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_consume_detail_item_product\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_consume_detail_item_product\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 数量 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_consume_detail_item_number\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_consume_detail_item_number\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 91豆 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_consume_detail_item_money\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_consume_detail_item_money\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_consumes.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_consume_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_info.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_info_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<!-- 头像 -->\n\t<FrameLayout\n\t\tandroid:id=\"@+id/nd3_more_info_portrait_layout\"\n\t\tandroid:layout_width=\"57dip\"\n\t\tandroid:layout_height=\"57dip\"\n\t\tandroid:background=\"@drawable/nd3_default_portrait\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\n\t\t<!-- 添加头像 -->\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_more_info_portrait_add\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:layout_gravity=\"center\"\n\t\t\tandroid:gravity=\"center\"\n\t\t\tandroid:text=\"@string/nd3_more_info_portrait_add\"\n\t\t\tandroid:textSize=\"@dimen/nd3_portrait_add_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_portrait_add_color\"\n\t\t\t>\n\t\t</TextView>\n\t\t\t\t\n\t\t<!-- 头像 -->\n\t\t<ImageView\n\t\t\tandroid:id=\"@+id/nd3_more_info_portrait\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:visibility=\"gone\" \n\t\t\tandroid:scaleType=\"centerInside\"\n\t\t\t>\n\t\t</ImageView>\n\t\t\n\t\t<!-- 编辑头像 -->\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_more_info_portrait_edit\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:layout_gravity=\"bottom|center_horizontal\"\n\t\t\tandroid:gravity=\"bottom|center_horizontal\"\n\t\t\tandroid:text=\"@string/nd3_more_info_portrait_edit\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\tandroid:background=\"@drawable/nd3_portrait_edit_bg\"\n\t\t\tandroid:visibility=\"visible\" \n\t\t\t>\n\t\t</TextView>\n\t\t\n\t</FrameLayout>\n\n\t\n\t<!-- 姓名、昵称 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 姓名 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_real_name\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\tandroid:maxLength=\"24\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_real_name\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"24\"\n\t\t\t\tandroid:hint=\"@string/nd3_more_info_hint_real_name\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 昵称 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_nickname\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_nickname\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"10\"\n\t\t\t\tandroid:hint=\"@string/nd3_more_info_hint_nickname\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t</LinearLayout>\n\n\t<!-- 性别、生日、居住地 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 性别 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_sex\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_sex\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\tandroid:hint=\"@string/nd3_more_info_hint_sex\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</TextView>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 生日 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_date\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_date\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\tandroid:hint=\"@string/nd3_more_info_hint_date\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 居住地 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_address\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_address\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\tandroid:hint=\"@string/nd3_more_info_hint_address\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_info_edit_head_dialog.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout   \n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n \tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:orientation=\"vertical\"\n\tandroid:layout_marginTop=\"5dip\"\n\tandroid:layout_marginBottom=\"10dip\"\n\tandroid:gravity = \"center\">\n\t\n\t<!-- 本地相册 -->\n\t<Button android:id=\"@+id/nd3_local_album_btn\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd3_local_album\"\n\t\tandroid:textColor=\"@color/nd3_black\"\n\t\tandroid:background=\"@drawable/nd3_button_278\"/>\n\t\n\t<!-- 拍照 -->\n\t<Button android:id=\"@+id/nd3_pz_btn\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd3_pz\"\n\t\tandroid:textColor=\"@color/nd3_black\"\n\t\tandroid:background=\"@drawable/nd3_button_278\"/>\t\n\t\t\n\t<!-- 取消图片分享 --> \n\t<Button android:id=\"@+id/nd3_cancel_btn\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd3_cancel_share_photo\"\n\t\tandroid:textColor=\"@color/nd3_black\"\n\t\tandroid:background=\"@drawable/nd3_button_278\"/> \t\n\t\n\t<!-- 取消 -->\n\t<Button android:id=\"@+id/nd3_return\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd3_return_str\"\n\t\tandroid:textColor=\"@color/nd3_black\"\n\t\tandroid:background=\"@drawable/nd3_button_278\"/>\n\t\t\n</LinearLayout>\t\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_more.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_more_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\t\t\n\t\t>\n\t\t\n\t\t<!-- 个人信息管理 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_info\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_more01\"\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\tandroid:text=\"@string/nd3_more_more_info\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\t\t\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\n\t\t<!-- 通行证管理 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_account\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_more02\"\t\t\t\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\tandroid:text=\"@string/nd3_more_more_account\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\t\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 权限设置 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_permission\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\t\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_more03\"\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\tandroid:text=\"@string/nd3_more_more_permission\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 91豆充值 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_recharge\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_more04\"\t\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\tandroid:text=\"@string/nd3_more_more_recharge\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 充值消费记录 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_records\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\t\t\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_more05\"\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\tandroid:text=\"@string/nd3_more_more_records\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t/> \n\t\t<!-- 关于我们 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_change_account\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\t\t\t\n\t\t\t> \n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\t\t\n\t\t\t\tandroid:src=\"@drawable/nd3_game_detail\"\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\" \n\t\t\t\tandroid:text=\"@string/nd3_more_more_logout\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t>\n\t\t\t</TextView> \n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\t\t\t\t\t\t\t\t\n\t\t\n\t</LinearLayout>\n\t\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\" \n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\t\t\n\t\t>\n\t\t<!-- 检查更新 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_update\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\t\t\t\n\t\t\t>\n\t\t\t \n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\" \n\t\t\t\tandroid:text=\"@string/nd_checkupdate\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t/> \n\t\t<!-- 用户反馈 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_feekback\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\t\t\t\n\t\t\t>\n\t\t\t \n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\" \n\t\t\t\tandroid:text=\"@string/nd3_app_feedback_title\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t/> \n\t\t<!-- 关于我们 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_more_about\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\" \n\t\t\t\tandroid:text=\"@string/nd3_more_more_about\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t<TextView android:id=\"@+id/nd3_more_more_version\"\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"  \n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\"\n\t\t\t\tandroid:visibility=\"gone\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\t\t\n\t\t\n\t\t    \n\t\t\t\t\n\t</LinearLayout>\t\n\n\t \n\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_no_password.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_no_password_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\n\t<!-- 说明文字 -->\n\t<TextView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:text=\"@string/nd3_more_no_password_password_content\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\t\t\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t\t\n\t</TextView>\n\t\t\n\t<!-- 密码、确认密码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 旧密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_no_password_password\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_more_no_password_old\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 新密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_no_password_password_again\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_more_no_password_new\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t\n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_password.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_password_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<!-- 旧密码、新密码 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 旧密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_password_tip_old\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_more_password_old\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\tandroid:hint=\"@string/nd3_more_password_hint_old\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 新密码 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_password_tip_new\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<EditText\n\t\t\t\tandroid:id=\"@+id/nd3_more_password_new\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\tandroid:hint=\"@string/nd3_more_password_hint_new\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t>\n\t\t\t</EditText>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\n\t\n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_permission.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_permission_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<!-- 添加好友 -->\n\t<TextView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd_more_permission_friend\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\n\t\tandroid:textStyle=\"bold\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:layout_marginBottom=\"5dip\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"0dip\"\n\t\tandroid:layout_marginBottom=\"0dip\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 需要验证 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_permission_check\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:text=\"@string/nd3_more_permission_check\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:id=\"@+id/nd3_more_permission_check_tip\"\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_07\"\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\n\t\t<!-- 允许任何人 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_permission_yes\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:text=\"@string/nd3_more_permission_yes\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:id=\"@+id/nd3_more_permission_yes_tip\"\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\t\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_07\"\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\n\t\t<!-- 不允许任何人 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_permission_no\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:text=\"@string/nd3_more_permission_no\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:id=\"@+id/nd3_more_permission_no_tip\"\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\t\n\t\t\t\tandroid:src=\"@drawable/nd3_icon_07\"\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t<!-- 支付密码 -->\n\t<TextView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd_more_permission_pay_pwd\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\n\t\tandroid:textStyle=\"bold\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tandroid:layout_marginBottom=\"5dip\"\n\t\tandroid:visibility=\"visible\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"horizontal\"\n\t\tandroid:gravity=\"center_vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginBottom=\"0dip\"\n\t\tandroid:visibility=\"visible\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\n\t\t>\n\t\t\n\t\t<TextView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_weight=\"1\"\n\t\t\tandroid:text=\"@string/nd_more_permission_pay_pwd_tip\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t>\n\t\t</TextView>\n\n\t\t<com.nd.commplatform.widget.NdCheckBox\n\t\t\tandroid:id=\"@+id/nd_more_permission_pay_pwd_check\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:button=\"@null\"\n\t\t\tandroid:background=\"@drawable/nd3_checkbox_button\"\n\t\t\t>\n\t\t</com.nd.commplatform.widget.NdCheckBox>\n\t\t\t\t\t\t\n\t</LinearLayout>\t\n\t<TextView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:text=\"@string/nd_more_permission_pay_pwd_content\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\tandroid:textStyle=\"bold\"\n\t\tandroid:layout_marginTop=\"5dip\"\n\t\tandroid:visibility=\"visible\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_recharge_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_recharge_detail_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\t\n\t\t>\n\t\t\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_recharge_detail_item_date\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_recharge_detail_item_date\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 类型 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_recharge_detail_item_type\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_recharge_detail_item_type\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\t\t\n\t\t<!-- 充值91豆 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_recharge_detail_item_money\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_recharge_detail_item_money\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\n\t</LinearLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_recharges.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_recharge_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_records.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_more_records_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\t\n\t\t>\n\t\t\n\t\t<!-- 充值记录 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_records_recharges\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:text=\"@string/nd3_more_records_recharges\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\t\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\n\t\t<!-- 消费记录 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_more_records_consumes\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:text=\"@string/nd3_more_records_consumes\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<ImageView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\t\t\t\n\t\t\t\t>\n\t\t\t</ImageView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t</LinearLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_records_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout \n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" \n\tandroid:layout_height=\"wrap_content\"\n\tandroid:orientation=\"horizontal\" \n\tandroid:id=\"@+id/nd3_records_item_id\"\n\tandroid:gravity=\"center\"\n\tstyle=\"@style/nd3_option_item_padding_style\"\n\t>\n\n\t<LinearLayout \n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:layout_weight=\"1\"\n\t\tandroid:orientation=\"vertical\">\n\n\t\t<LinearLayout \n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation=\"horizontal\">\n\n\t\t\t<!-- 类型（消费91豆、充值91豆） -->\n\t\t\t<TextView \n\t\t\t\tandroid:id=\"@+id/nd3_type_text\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" \n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginRight=\"3dip\" \n\t\t\t\tandroid:gravity=\"left\" \n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:textAppearance=\"?android:attr/textAppearanceMedium\"\n\t\t\t\tandroid:ellipsize=\"end\" \n\t\t\t\tandroid:textColor=\"@color/nd3_records_title_color\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_records_title_text_size\"\n\t\t\t\t/>\n\n\t\t\t<!-- 个数 -->\n\t\t\t<TextView \n\t\t\t\tandroid:id=\"@+id/nd3_count_text\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" \n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginRight=\"3dip\" \n\t\t\t\tandroid:gravity=\"left\" \n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:ellipsize=\"end\"  \n\t\t\t\tandroid:textColor=\"@color/nd3_records_title_color\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_records_title_text_size\"\n\t\t\t\t/>\n\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 描述 -->\n\t\t<TextView \n\t\t\tandroid:id=\"@+id/nd3_money_text\"\n\t\t\tandroid:layout_width=\"wrap_content\" \n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_marginRight=\"3dip\" \n\t\t\tandroid:gravity=\"left\" \n\t\t\tandroid:singleLine=\"true\"\n\t\t\tandroid:ellipsize=\"end\"  \n\t\t\tandroid:textColor=\"@color/nd3_records_time_color\"\n\t\t\tandroid:textSize=\"@dimen/nd3_records_title_text_size\"\n\t\t\t/>\n\n\t</LinearLayout>\n\n\t<!-- 时间 -->\n\t<TextView \n\t\tandroid:id=\"@+id/nd3_time_text\" \n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:layout_marginRight=\"3dip\" \n\t\tandroid:gravity=\"right\" \n\t\tandroid:lines=\"2\"\n\t\tandroid:maxLines=\"2\"\n\t\tandroid:ellipsize=\"end\"  \n\t\tandroid:textColor=\"@color/nd3_records_time_color\"\n\t\tandroid:textSize=\"@dimen/nd3_records_time_text_size\"\n\t\t/>\n\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_myfriend.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <RelativeLayout\n   android:id=\"@+id/nd3_friend_search_rl\"\n   android:layout_width=\"fill_parent\"\n   android:layout_height=\"40dip\"\n   android:background=\"@drawable/nd3_search_layout_bg\">\n\t   <EditText \n\t   android:id=\"@+id/nd3_friend_search_edit\"\n\t   android:layout_width=\"fill_parent\"\n\t   android:layout_height=\"33dip\"\n\t   android:background=\"@drawable/nd3_search_edit_bg\"\n\t   android:drawableLeft=\"@drawable/nd3_search_edit_left\"\n\t   android:layout_centerVertical=\"true\"\n\t   android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t   android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t   android:singleLine=\"true\"\n\t   android:gravity=\"center_vertical|left\"/>\n  </RelativeLayout>\n  \n  <RelativeLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:layout_below=\"@id/nd3_friend_search_rl\">\n\t  <include\n\t   android:layout_width=\"fill_parent\"\n\t   android:layout_height=\"fill_parent\"\n\t   android:id=\"@+id/nd3_friend_panel\"\n\t   layout=\"@layout/nd3_friend_section_panel\"/>\n   </RelativeLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_network_error.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:background=\"@drawable/nd3_game_error_bg\">\n  \n  <ImageView android:id=\"@+id/nd3_error_image\"\n  \t\tandroid:layout_width=\"wrap_content\"\n  \t\tandroid:layout_height=\"wrap_content\"\n  \t\tandroid:src=\"@drawable/nd3_game_face\"\n  \t\tandroid:layout_centerInParent=\"true\"/>\n  \t\t\n   <TextView android:id=\"@+id/nd3_error_desc\"\n   \t\tandroid:layout_width=\"fill_parent\"\n  \t\tandroid:layout_height=\"wrap_content\"\n  \t\tandroid:layout_below=\"@+id/nd3_error_image\"\n  \t\tandroid:paddingTop=\"30dip\"\n  \t\tandroid:gravity=\"center_horizontal\"\n  \t\tandroid:textColor=\"@color/nd3_white\"\n  \t\t/>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_normal_search.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n \n   <RelativeLayout\n   android:id=\"@+id/nd3_friend_search_rl\"\n   android:layout_width=\"fill_parent\"\n   android:layout_height=\"40dip\"\n   android:background=\"@drawable/nd3_search_layout_bg\">\n\t   <EditText \n\t   android:id=\"@+id/nd3_friend_search_edit\"\n\t    android:layout_width=\"fill_parent\"\n\t   android:layout_height=\"33dip\"\n\t   android:background=\"@drawable/nd3_search_edit_bg\"\n\t   android:drawableLeft=\"@drawable/nd3_search_edit_left\"\n\t   android:layout_centerVertical=\"true\"\n\t   android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t   android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t   android:gravity=\"center_vertical|left\"/>\n  </RelativeLayout>\n  \n  <RelativeLayout\n   android:layout_width=\"fill_parent\"\n   android:layout_height=\"fill_parent\"\n   android:layout_below=\"@id/nd3_friend_search_rl\">\n\t  <include\n\t   android:id=\"@+id/nd3_friend_search_list\"\n\t   android:layout_width=\"fill_parent\"\n\t   android:layout_height=\"fill_parent\"\n\t   layout=\"@layout/nd3_listview_template\"/>\n   </RelativeLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_friend_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdPayFriendListItem\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_pay_friend_item_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:orientation=\"horizontal\"\n\tandroid:gravity=\"center_vertical\"\n\tstyle=\"@style/nd3_option_item_padding_style\"\n\tandroid:focusable=\"false\"\n\t>\n\t\n\t<com.nd.commplatform.widget.NdRadioButton\n\t\tandroid:id=\"@+id/nd3_pay_friend_item_checked\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:button=\"@null\"\n\t\tandroid:background=\"@drawable/nd3_pay_checkbox_button\"\n\t\tandroid:focusable=\"false\"\n\t\t/>\n\t\n\t\n\t<ImageView\n\t\tandroid:id=\"@+id/nd3_pay_friend_item_icon\"\n\t\tandroid:layout_width=\"@dimen/nd3_image_size\"\n\t\tandroid:layout_height=\"@dimen/nd3_image_size\"\n\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\tandroid:src=\"@drawable/nd3_default_portrait\"\n\t\tandroid:focusable=\"false\"\n\t\t>\n\t</ImageView>\n\t\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_weight=\"1\"\n\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\tandroid:orientation=\"vertical\"\n\t\tandroid:focusable=\"false\"\n\t\t>\n\t\t\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_pay_friend_item_name\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\t\n\t\t\tandroid:focusable=\"false\"\t\t\n\t\t\t>\n\t\t</TextView>\n\t\t\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_pay_friend_item_mood\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:textColor=\"@color/nd3_network_error_color\"\n\t\t\tandroid:textSize=\"@dimen/nd3_records_title_text_size\"\t\n\t\t\tandroid:focusable=\"false\"\t\t\t\t\t\n\t\t\t>\n\t\t</TextView>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n\t\t\t\n</com.nd.commplatform.widget.NdPayFriendListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_pass.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_pay_pass_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:gravity=\"center_horizontal\"\n\t>\n\t\n\t<include layout=\"@layout/nd3_title_bar\"/>\n\n\t<ScrollView\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\t>\n\t\t\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:orientation=\"vertical\"\n\t\t\tandroid:gravity=\"center_horizontal\"\n\t\t\t>\n\t\t\t<LinearLayout \n\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:orientation=\"vertical\"\n\t\t\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\n\t\t\t\tandroid:gravity=\"center_horizontal\">\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:gravity=\"center\"\n\t\t\t\t\tandroid:text=\"@string/nd3_pay_label_buy_success\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\t\t\n\t\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t\tandroid:drawableLeft=\"@drawable/nd_true\"\n\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_platform_image_size\"\n\t\t\t\t\t/>\n\t\t\t     <ImageView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\t\t\tandroid:src=\"@drawable/nd_xline\"\n\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd_20\"\n\t\t\t\t\tandroid:layout_marginBottom=\"@dimen/nd_20\"\n\t\t\t\t\t/>\n \n\t\t\t     <TextView \n\t\t\t         android:id=\"@+id/nd3_pay_pass_goto_consumes\"\n\t\t\t\t\t android:layout_width=\"wrap_content\"\n\t\t\t\t\t android:layout_height=\"wrap_content\"\n\t\t\t\t\t android:gravity=\"center\"\n\t\t\t\t\t android:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\t\t\t android:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t style=\"@style/nd3_option_margin_style\"\n\t\t\t\t\t android:layout_marginTop=\"@dimen/nd_20\"\t\n\t\t\t\t\t android:text=\"@string/nd3_pay_button_view_consumes\" \t \n\t\t\t\t\t android:background=\"@drawable/nd_green\"/>\n\t\t\t     \n\t\t\t     <TextView \n\t\t\t         android:id=\"@+id/nd3_pay_pass_exit\"\n\t\t\t\t\t android:layout_width=\"wrap_content\"\n\t\t\t\t\t android:layout_height=\"wrap_content\"\n\t\t\t\t\t android:gravity=\"center\"\n\t\t\t\t\t android:text=\"@string/nd3_pay_pass_exit\"\n\t\t\t\t\t android:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\t\t\t android:textColor=\"@color/nd3_white\"\t\n\t\t\t\t\t android:layout_marginTop=\"10dip\"\t\n\t\t\t\t\t style=\"@style/nd3_option_margin_style\" \n\t\t\t\t\t android:background=\"@drawable/nd_blue\"/>\n\t\t\t     \n\t\t\t</LinearLayout>\t\t\t\t\n\t\t\t \n\t\t\t\t\n\t\t\t<TextView\n\t\t\t    android:id=\"@+id/nd_pay_success_tips\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:gravity=\"center\" \n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\n\t\t\t \n\t\t</LinearLayout>\n\t</ScrollView>\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_password_check.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_pay_password_check_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_pay_password_check_text\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"center_horizontal\"\n\t\tandroid:text=\"@string/nd3_pay_label_check_pay_password\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_password_tip_text_size\"\n\t\tandroid:textColor=\"@color/nd3_pay_color\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t</TextView>\n\n\t<EditText\n\t\tandroid:id=\"@+id/nd3_pay_password_check_edit\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:singleLine=\"true\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</EditText>\t\t\t\n\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_products_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:orientation=\"horizontal\"\n\tandroid:id=\"@+id/nd3_records_item_id\"\n\tandroid:gravity=\"center\">\n  \n  \t<TextView\n  \t\tandroid:id=\"@+id/nd3_frist_id\"\n  \t\tandroid:layout_width=\"86dip\"\n  \t\tandroid:layout_height=\"wrap_content\" \n  \t\tandroid:textColor=\"@color/nd3_font_color\"\n  \t\tandroid:gravity=\"center\"\n  \t\tandroid:ellipsize=\"none\"\n  \t\tandroid:paddingLeft=\"5dip\"\n  \t\t/>\n  \n  \t<TextView\n  \t\tandroid:id=\"@+id/nd3_second_id\"\n  \t\tandroid:layout_width=\"105dip\"\n  \t\tandroid:layout_height=\"wrap_content\"\n  \t\tandroid:textColor=\"@color/nd3_font_color\"\n  \t\tandroid:gravity=\"center\"\n  \t\tandroid:ellipsize=\"none\"\n  \t\tandroid:paddingLeft=\"5dp\"\n  \t\t/>\n  \t\t\n  \t<TextView\n  \t\tandroid:id=\"@+id/nd3_third_id\"\n  \t\tandroid:layout_width=\"50dip\"\n  \t\tandroid:layout_height=\"wrap_content\"\n  \t\tandroid:textColor=\"@color/nd3_font_color\"\n  \t\tandroid:gravity=\"center\"\n  \t\tandroid:ellipsize=\"none\"\n  \t\tandroid:paddingLeft=\"5dp\"\n  \t\t/>\n \n\t<TextView\n\t\tandroid:id=\"@+id/nd3_fourth_id\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:textColor=\"@color/nd3_font_color\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:ellipsize=\"none\"\n\t\tandroid:paddingLeft=\"5dp\"\n\t/>\t\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_select_friend.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_pay_select_friend_layout\"\n\tandroid:layout_width=\"fill_parent\"\n  \tandroid:layout_height=\"fill_parent\"\n  \t>\n\n   <LinearLayout\n\tandroid:layout_width=\"fill_parent\"\n  \tandroid:layout_height=\"fill_parent\"\n  \tandroid:background=\"@drawable/nd3_bk1\"\n  \tandroid:layout_margin=\"@dimen/nd3_margin_size\"\n  \t>\n\t<ListView\n\t\tandroid:id=\"@+id/nd3_pay_select_friend_list\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:headerDividersEnabled=\"false\"\n\t\tandroid:footerDividersEnabled=\"false\"\n\t\tandroid:divider=\"@drawable/nd3_horizontal_line\"\n\t\tandroid:fastScrollEnabled=\"true\"\n\t\tandroid:cacheColorHint=\"#00000000\"\n\t\tandroid:fadingEdge=\"none\"\n\t\t>\n\t\t\n\t</ListView>\n</LinearLayout>\n  \t\n</LinearLayout>\n  \t\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_template.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_pay_template_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t\n    <!-- 购买清单 -->\n\t<LinearLayout\n\t\tandroid:id=\"@+id/nd3_pay_template_order_list\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\t\n\t\t>\n\t\t\n\t\t<!-- 游戏 -->\n\t\t<!-- <LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_pay_template_recharges\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_pay_label_app\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_pay_template_app\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t分隔线\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView> -->\n\t\t\n\t\t<!-- 物品 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_pay_template_recharges\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_pay_label_product\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_pay_template_product\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<!-- <ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView> -->\n\t\t\n\t\t<!-- 数量 -->\n\t\t<LinearLayout\n\t\t\tandroid:id=\"@+id/nd3_pay_template_recharges\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_pay_label_count\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_pay_template_count\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\n\t\t\n\t\t<!-- 价值 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_pay_label_money\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_pay_template_money\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\n\t</LinearLayout>\n\t\n\t    \n\n\t<!-- 当前余额 -->\n\t<LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\" \n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\n\t\t>\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_curren_account\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_curren_account\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t/>\n\t\t</LinearLayout>  \n\t\t\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\t\n\t\t\t>\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_pay_label_current_balance\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_pay_template_current_balance\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t/>\n\t\t</LinearLayout>\n\t\t  \n\t\n\t</LinearLayout>\t\n\t\n\t<Button \n\t    android:id=\"@+id/nd3_confirm_pay\"\n\t    android:layout_width=\"wrap_content\"\n\t    android:layout_height=\"wrap_content\" \n\t    android:layout_marginTop=\"@dimen/nd3_option_margin_top\"\t\t\n\t    android:background=\"@drawable/nd_blue\"\n\t    android:text=\"@string/nd3_confrim_pay\"\n\t    android:layout_gravity=\"center\"\n\t    android:textStyle=\"bold\"\n\t    android:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t    />    \n\t\t \n\n\t<!-- 代付提示 -->\n\t<!-- <TextView\n\t\tandroid:id=\"@+id/nd3_pay_template_pay_by_friend_tip\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"left\"\n\t\tandroid:text=\"@string/nd3_pay_cannot_pay_by_friend\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\tandroid:textColor=\"@color/nd3_pay_color\"\t\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\t\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t\t\t\n\t\n\n\t直购提示\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_pay_template_auto_buy\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"left\"\n\t\tandroid:text=\"@string/nd3_pay_label_auto_buy\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\tandroid:textColor=\"@color/nd3_pay_color\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView>\n\t\n\t让好朋友代付款\n\t<LinearLayout\n\t\tandroid:id=\"@+id/nd3_pay_template_pay_by_friend\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"horizontal\"\n\t\tandroid:gravity=\"center_vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tstyle=\"@style/nd3_option_margin_padding_style\"\t\t\t\n\t\t>\n\t\t\n\t\t<TextView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_weight=\"1\"\n\t\t\tandroid:text=\"@string/nd3_pay_label_pay_by_friend\"\n\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t>\n\t\t</TextView>\n\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\t\n\t\t\tandroid:src=\"@drawable/nd3_switch_image\"\t\t\t\n\t\t\t>\n\t\t</ImageView>\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t</LinearLayout>\n\n\t客服电话\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_pay_template_service\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:text=\"@string/nd3_pay_label_service_format_2\"\n\t\tandroid:textSize=\"@dimen/nd3_pay_service_text_size\"\n\t\tandroid:textColor=\"@color/nd3_pay_color\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\t</TextView> -->\n\t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_person_info_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:orientation=\"vertical\">\n  \t\n  <LinearLayout \n  \t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:orientation=\"vertical\"\n\t\tandroid:layout_margin=\"@dimen/nd3_item_divider\"\n\t\tandroid:background=\"@drawable/nd3_white_bg\">\n\t\t<LinearLayout\n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:orientation=\"horizontal\"\n\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_nickname_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_nickname\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_nickname\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\" \n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\n\t\t\t\t\t\t\t\n\t\t </LinearLayout> \n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:orientation=\"horizontal\"\n\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_name_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_real_name\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_name\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\tandroid:orientation=\"horizontal\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_sex_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_sex\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_sex\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\tandroid:orientation=\"horizontal\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_borndata_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_date\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_borndata\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\tandroid:orientation=\"horizontal\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_address_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_address\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_address\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t\n  </LinearLayout>\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_personinfo.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:orientation=\"vertical\">\n  \n  \n  <RelativeLayout android:id=\"@+id/nd3_remarks_layout\"\n  \t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\tandroid:orientation=\"horizontal\"\n\t\tandroid:background=\"@drawable/nd3_white_bg\"\n\t\tandroid:layout_margin=\"@dimen/nd3_item_divider\"\n\t\t>\n\t\t<TextView android:id=\"@+id/nd3_remarks_label\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd3_remarks\"\n\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\tandroid:layout_alignParentLeft=\"true\"\n\t\t\tandroid:layout_centerVertical=\"true\"/>\n\t\t\t\n\t\t<TextView android:id=\"@+id/nd3_remarks\"\n\t\t\tandroid:layout_width=\"0dip\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\tandroid:layout_toRightOf=\"@+id/nd3_remarks_label\"\n\t\t\tandroid:layout_toLeftOf=\"@+id/nd3_switch_image\"\n\t\t  \tandroid:layout_centerVertical=\"true\"\n\t\t\t/>\t\n\t\t<ImageView  \n\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\" \n\t\t      android:id=\"@+id/nd3_switch_image\"\n\t\t\t\t      />\t\n  </RelativeLayout>\n\t\t\n\t\t\n  <LinearLayout \n  \t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:orientation=\"vertical\"\n\t\tandroid:layout_margin=\"@dimen/nd3_item_divider\"\n\t\tandroid:background=\"@drawable/nd3_white_bg\">\n\t\t<LinearLayout\n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:orientation=\"horizontal\"\n\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_nickname_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_nickname\" \n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_nickname\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\" \n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\n\t\t\t\t\t\t\t\n\t\t </LinearLayout> \n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:orientation=\"horizontal\"\n\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_name_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_real_name\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_name\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\tandroid:orientation=\"horizontal\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_sex_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_sex\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_sex\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\tandroid:orientation=\"horizontal\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_borndata_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_date\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_borndata\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t <LinearLayout \n\t\t  \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_item_height\"\n\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\tandroid:orientation=\"horizontal\">\n\t\t\t\t<TextView android:id=\"@+id/nd3_address_label\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_address\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"/>\n\t\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/nd3_address\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t\tandroid:hint=\"@string/nd3_secret\"\n\t\t\t\t\t/>\t\n\t\t </LinearLayout>\n\t\t\n  </LinearLayout>\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_progressbar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\" \n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation=\"vertical\"\n  android:gravity=\"center\"\n>\n        <TextView android:id=\"@+id/nd3_softwareName_txt\"\n        android:layout_height=\"wrap_content\" \n        android:layout_width=\"200dip\" \n        android:layout_marginLeft=\"10dip\"\n        android:layout_marginTop=\"10dip\"\n        android:singleLine=\"true\"\n        android:ellipsize=\"end\"\n\t\tandroid:layout_marginRight=\"10dip\"\n\t\tandroid:textColor=\"@color/nd3_white\"/>\n\t\t\n        <TextView android:id=\"@+id/nd3_softwaredownloadpercent_txt\"\n        android:layout_height=\"wrap_content\" \n        android:layout_width=\"200dip\" \n        android:layout_marginLeft=\"10dip\"\n        android:singleLine=\"true\"\n        android:ellipsize=\"end\"\n\t\tandroid:layout_marginRight=\"10dip\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n        />\n        \n\t\t<ProgressBar android:id=\"@+id/nd3_progressBarHorizontal\" \n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:layout_width=\"200dip\" \n\t\t\tandroid:layout_marginTop=\"10dip\"\n\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\tandroid:layout_marginRight=\"10dip\"\n\t\t\tstyle=\"?android:attr/progressBarStyleHorizontal\" />\n\t\t\t\n\t\t<Button android:id=\"@+id/nd3_cancle_download\" \t\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:layout_width=\"100dip\" \n\t\t\tandroid:layout_marginTop=\"10dip\"\n\t\t\tandroid:text=\"@string/nd3_cancel\"\n\t\t\t/>\n</LinearLayout>\t\t\t\n\n\n\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_recharge_record.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdRechargeListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_recharge_count_rl\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  \n\t  <TextView\n\t  android:id=\"@+id/nd3_recharge_count_txt\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_toLeftOf=\"@+id/nd3_recharge_time_txt\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  style=\"@style/nd3_textview_1\"\n  \t  />\n  \t  \n  \t   <TextView\n\t  android:id=\"@+id/nd3_recharge_time_txt\"\n\t  android:layout_alignParentRight=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  style=\"@style/nd3_textview_2\"\n  \t  />\n  \n  </RelativeLayout>\n  \n  <TextView\n  android:id=\"@+id/nd3_recharge_desc_txt\"\n  android:layout_alignLeft=\"@id/nd3_recharge_count_rl\"\n  android:layout_below=\"@id/nd3_recharge_count_rl\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  style=\"@style/nd3_textview_2\"\n  />\n</com.nd.commplatform.widget.NdRechargeListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_searchfriend_condition.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n  <LinearLayout\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" \n\t\tandroid:orientation =\"vertical\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t>\n\t\t\n\t\t<!-- 性别 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_sex\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_sex\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:hint=\"@string/nd3_no_constrait_tip\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t>\n\t\t\t</TextView>\t\t\n\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 年龄 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_age\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_date\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:hint=\"@string/nd3_no_constrait_tip\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\t\n\t\t</LinearLayout>\n\n\t\t<!-- 分隔线 -->\n\t\t<ImageView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t>\n\t\t\n\t\t</ImageView>\t\n\t\t\t\t\n\t\t<!-- 居住地 -->\n\t\t<LinearLayout\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:orientation =\"horizontal\"\n\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t>\n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd3_more_info_tip_address\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\n\t\t\t<TextView\n\t\t\t\tandroid:id=\"@+id/nd3_more_info_address\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:hint=\"@string/nd3_no_constrait_tip\"\n\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t\t\t\n\t\t</LinearLayout>\n\t\t\t\t\t\t\t\n\t</LinearLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_share_bind_account_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t<LinearLayout \n\t    android:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"   \n\t\tandroid:layout_alignParentLeft=\"true\"\n\t\tandroid:layout_centerVertical=\"true\"\n\t\tandroid:layout_toLeftOf=\"@+id/nd3_share_account_switch\"\n\t\tandroid:gravity=\"center_vertical\">\n\t    \n\t\n\t    \t<ImageView \n\t\t        android:id=\"@+id/nd_thridplatform_image\"\n\t\t\t\tandroid:layout_width=\"@dimen/nd3_platform_image_size\"\n\t\t\t\tandroid:layout_height=\"@dimen/nd3_platform_image_size\" \n\t\t\t\tandroid:src=\"@drawable/nd3_3rd_platform_icon\" \n\t\t\t\t/>\n\t   \t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\tandroid:ellipsize=\"end\"\n\t\t\t\tandroid:id=\"@+id/nd3_share_account_txt\"\n\t\t\t\tstyle=\"@style/nd3_option_textview_style\"  \n\t\t\t\tandroid:gravity=\"center_vertical\" \n\t\t\t\tandroid:layout_marginLeft=\"5dip\"  \n\t\t\t\t>\n\t\t\t</TextView>\n\t</LinearLayout>\n\t\t<CheckBox\n\t\t\tandroid:id=\"@+id/nd3_share_account_switch\"\n\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:button=\"@null\"\n\t\t\tandroid:background=\"@drawable/nd3_checkbox_button\"\n\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t>\n\t\t</CheckBox>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_share_sina.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout\nxmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\"\nandroid:orientation=\"vertical\" \nandroid:padding=\"@dimen/nd3_margin_size\">\n<LinearLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\" \n  android:background=\"@drawable/nd3_bk1\"\n  android:layout_marginBottom=\"@dimen/nd3_option_item_marginLeft\"\n  >\n  \n  <!-- 头像 -->\n\t<FrameLayout\n\t\tandroid:id=\"@+id/nd3_more_info_portrait_layout\"\n\t\tandroid:layout_width=\"57dip\"\n\t\tandroid:layout_height=\"57dip\"\n\t\tandroid:background=\"@drawable/nd3_default_portrait\"\n\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t>\n\n\t\t<!-- 添加头像 -->\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_more_info_portrait_add\"\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:layout_gravity=\"center\"\n\t\t\tandroid:gravity=\"center\"\n\t\t\tandroid:text=\"@string/nd3_more_info_photo_add\"\n\t\t\tandroid:textSize=\"@dimen/nd3_portrait_add_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_portrait_add_color\"\n\t\t\t>\n\t\t</TextView>\n\t\t\t\t\n\t\t<!-- 头像 -->\n\t\t<ImageView\n\t\t\tandroid:id=\"@+id/nd3_photo_share\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:visibility=\"gone\" \n\t\t\tandroid:scaleType=\"centerInside\"\n\t\t\t>\n\t\t</ImageView>\n\t\t\n\t\t<!-- 编辑头像 -->\n\t\t<TextView\n\t\t\tandroid:id=\"@+id/nd3_more_info_portrait_edit\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:layout_gravity=\"bottom|center_horizontal\"\n\t\t\tandroid:gravity=\"bottom|center_horizontal\"\n\t\t\tandroid:text=\"@string/nd3_more_info_portrait_edit\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\tandroid:background=\"@drawable/nd3_portrait_edit_bg\"\n\t\t\tandroid:visibility=\"visible\" \n\t\t\t>\n\t\t</TextView>\n\t\t\n\t</FrameLayout>\n  <!--<ImageView \n  \t  android:id=\"@+id/nd3_photo_share\"\n  \t  android:layout_width=\"50dip\"\n\t  android:layout_height=\"50dip\"\n\t  android:layout_marginLeft=\"@dimen/nd3_item_divider\"\n\t  android:layout_marginTop=\"@dimen/nd3_item_divider\" \n\t  android:src=\"@drawable/nd3_agreement_logo\"\n\t  android:visibility=\"gone\" />\n  --><EditText\n  \t  android:id=\"@+id/nd3_write_message\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"  \n\t  android:minLines=\"6\"\n\t  android:textColorHint=\"@color/nd3_hint\" \n\t  android:layout_margin=\"@dimen/nd3_item_divider\" \n\t  android:singleLine=\"false\" \n\t  android:gravity=\"top\" \n\t  android:background=\"@null\" \n\t  android:scrollbarAlwaysDrawVerticalTrack=\"true\"\n\t  android:scrollbars=\"vertical\" \n\t  android:scrollbarStyle=\"outsideOverlay\" \n\t  />\n</LinearLayout>\n    <!-- 已经绑定的 -->\n\t<LinearLayout\n\tandroid:id=\"@+id/nd3_bind_third_account\"\n\tandroid:background=\"@drawable/nd3_bk1\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"@dimen/nd3_option_item_marginLeft\"\n\tandroid:orientation=\"vertical\" >\n\t</LinearLayout>\n\t\n\t <!-- 超时的 -->\n\t<LinearLayout\n\tandroid:id=\"@+id/nd3_bind_third_account_timeout_parent\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:orientation=\"vertical\" >\n\t\t<TextView\n\t\tandroid:text=\"@string/nd3_bind_account_timeout_tip\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"/>\n\t \n\t\t<LinearLayout\n\t\tandroid:id=\"@+id/nd3_bind_third_account_timeout\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:orientation=\"vertical\" >\n\t    </LinearLayout>\n    </LinearLayout>\n    <!-- 未绑定的 -->\n\t<LinearLayout\n\tandroid:id=\"@+id/nd3_unbind_third_account_parent\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\"\n\tandroid:orientation=\"vertical\" >\n\t\t<TextView\n\t\tandroid:text=\"@string/nd3_bind_third_account_tip\"\n\t\tandroid:textColor=\"@color/nd3_white\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"/>\n\t \n\t\t<LinearLayout\n\t\tandroid:id=\"@+id/nd3_unbind_third_account\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:orientation=\"vertical\" >\n\t    </LinearLayout>\n    </LinearLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_share_unbind_account_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_margin=\"@dimen/nd3_margin_size\">\n               <LinearLayout \n\t\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"   \n\t\t\t\t\tandroid:layout_alignParentLeft=\"true\" \n\t\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/nd3_unbind_tip_txt\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t    \n\t\t\t\t\n\t\t\t\t    \t<ImageView \n\t\t\t\t\t        android:id=\"@+id/nd_thridplatform_image\"\n\t\t\t\t\t\t\tandroid:layout_width=\"@dimen/nd3_platform_image_size\"\n\t\t\t\t\t\t\tandroid:layout_height=\"@dimen/nd3_platform_image_size\" \n\t\t\t\t\t\t\tandroid:src=\"@drawable/nd3_3rd_platform_icon\" \n\t\t\t\t\t\t\t/>\n\t\t\t\t   \t\t<TextView\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\t\tandroid:ellipsize=\"end\"\n\t\t\t\t\t\t\tandroid:id=\"@+id/nd3_share_account_txt\"\n\t\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\" \n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" \n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</TextView>\n\t\t\t\t</LinearLayout>\n                \n\t\t        <TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:id=\"@+id/nd3_unbind_tip_txt\"\n\t\t\t\t\tandroid:text=\"@string/nd3_unbind_account_tip\"\n\t\t\t\t\tandroid:textSize=\"14sp\"\n\t\t\t\t\tandroid:textColor=\"#FF0000FF\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/nd3_share_account_switch\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\t\t>\n\t\t\t\t</TextView>\n\t\t\t\t<ImageView\n\t\t\t\t\tandroid:id=\"@+id/nd3_share_account_switch\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_switch_image\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t>\n\t\t\t\t</ImageView>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_stranger_home.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:orientation=\"vertical\"\n  >\n  \n  <RelativeLayout\t \n  \t  android:id=\"@+id/nd3_person_layout\" \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\" \n\t  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t    <ImageView \n\t\t\t  android:id=\"@+id/nd3_head_image\" \n\t\t\t  android:layout_width=\"57dip\"\n\t\t      android:layout_height=\"57dip\" \n\t\t      android:src=\"@drawable/nd3_head_bg\"\n\t\t      android:layout_centerVertical=\"true\" \n\t\t      />\n\t  \t \n\t  \n\t    <RelativeLayout\n\t\t\t  android:id=\"@+id/nd3_person_info_layout\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"57dip\"\n\t\t\t  android:layout_centerInParent=\"true\"\t\n\t\t\t  android:orientation=\"vertical\"  \t\t  \n\t\t\t  android:layout_toRightOf=\"@+id/nd3_head_image\" \n\t\t\t  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n\t\t\t  android:background=\"@drawable/nd3_mood_bg\"> \n\t\t\t  \n\t\t\t  <TextView  \n\t\t\t\t  android:id=\"@+id/nd3_mood\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"fill_parent\" \n\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t\t  android:gravity=\"center_vertical\"\n\t\t\t\t  android:layout_toLeftOf=\"@+id/nd3_switch_image\"\n\t\t\t\t  android:maxLines=\"2\"\n\t\t\t\t  android:ellipsize=\"end\"\n\t\t\t\t \n\t\t\t\t  />\n\t\t\t\t  \n\t\t\t  <ImageView  android:id=\"@+id/nd3_switch_image\" \n\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t      android:layout_height=\"wrap_content\" \n\t\t\t      android:scaleType=\"centerInside\"\n\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t      /> \n\t\t\t\t  \t\t\t  \n\t\t</RelativeLayout>\n\t\t\n\t\t\n  </RelativeLayout>\t\n  \n  <RelativeLayout\n\t\t  android:id=\"@+id/nd3_info_layout\" \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\" \n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"  \n\t\t  android:background=\"@drawable/nd3_white_bg\"\n\t\t  > \n\t\t   \n\t\t  <TextView  \n\t\t\t  android:id=\"@+id/nd3_info_label\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\" \n\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t  android:textStyle=\"bold\"  \n\t\t\t  android:text=\"@string/nd3_view_resources\"\n\t\t\t  android:layout_alignParentLeft=\"true\"\n\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t  />\n\t\t  <ImageView \n\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t  android:layout_width=\"wrap_content\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_marginRight=\"@dimen/nd3_margin_size\" \n\t\t      />\t  \t\t\t  \n  </RelativeLayout>\n  \n  <LinearLayout\t \n  \t  android:id=\"@+id/nd3_top_layout\"  \n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:background=\"@drawable/nd3_white_bg\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\" \n\t  android:gravity=\"center_vertical\"\n\t  android:orientation=\"vertical\"\t  \n\t  >\n\t             <include \n                  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" \n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t   <!--\n\t\t    <RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_achieve_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"   \n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" \n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t\t  > \n\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_achieve\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"  />\n\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_achieve_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_achieve_rank\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_achieve_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t  />\n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \t\t\t  \n\t\t\t</RelativeLayout>\n\t\t  -->\n\t\t\t<ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t\t\t <include \n                  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"\n\t\t\t      layout=\"@layout/nd3_app_property\"/>\n\t\t\t\t<!--  \n\t\t\t<RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_rank_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t\t\t  android:layout_marginBottom=\"@dimen/nd3_item_divider\"> \n\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_rank_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\" \n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"/>\n\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_rank_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_ranking\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_rank_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t  />\n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \t\t\t  \n\t\t\t</RelativeLayout> \n\t\t-->\n\t\t    <ImageView \n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t/>\n\t\t    <RelativeLayout\n\t\t\t\t  android:id=\"@+id/nd3_game_detail_layout\" \n\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" > \n\t\t\t\t\t  \n\t\t\t\t  <ImageView  android:id=\"@+id/nd3_game_image_id\"\n\t\t\t\t\t  android:src=\"@drawable/nd3_game_detail\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentLeft=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"\n\t\t\t\t      />\n\t\t\t\t\t\t  \n\t\t\t\t  <TextView  \n\t\t\t\t\t  android:id=\"@+id/nd3_game_label\" \n\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t  android:text=\"@string/nd3_game\"\n\t\t\t\t\t  android:textColor=\"@color/nd3_black\"\n\t\t\t\t\t  android:textStyle=\"bold\" \n\t\t\t\t\t  android:layout_toRightOf=\"@+id/nd3_game_image_id\"\n\t\t\t\t\t  android:layout_centerVertical=\"true\"/>\n\t\t\t\t\t  \n\t\t\t\t  <ImageView \n\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t      />\t  \n\t\t\t\t  \n  \t\t\t</RelativeLayout>\n  \t\t\t\n  </LinearLayout>  \n  \n  <RelativeLayout \n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"   \n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\"  > \n\t\t\t  \n\t\t  <Button  android:id=\"@+id/nd3_bizarre_button\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentLeft=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_toLeftOf=\"@+id/nd3_hint_button\"\n\t\t      android:text=\"@string/nd3_bizarre_friend\"\n\t\t      android:textStyle=\"bold\"\n\t\t      android:background=\"@drawable/nd3_white_bg\"\n\t\t      />\n\t\t  <Button  android:id=\"@+id/nd3_hint_button\" \n\t\t\t  android:layout_width=\"30dip\"\n\t\t      android:layout_height=\"wrap_content\"\n\t\t      android:layout_centerInParent=\"true\" \n\t\t      android:visibility=\"invisible\"\n\t\t      />    \n\t\t  <Button  android:id=\"@+id/nd3_friend_button\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t      android:layout_height=\"wrap_content\"  \n\t\t      android:layout_alignParentRight=\"true\"\n\t\t      android:layout_centerVertical=\"true\"\n\t\t      android:layout_toRightOf=\"@+id/nd3_hint_button\"\n\t\t      android:text=\"@string/nd3_friend_count\"\n\t\t      android:textStyle=\"bold\"\n\t\t      android:background=\"@drawable/nd3_white_bg\"\n\t\t      />\t\t  \n\t\t     \n\t\t  \n  </RelativeLayout>\n  \n  \n  <Button  android:id=\"@+id/nd3_delete_friend_button\" \n\t\t  android:layout_width=\"fill_parent\"\n\t      android:layout_height=\"wrap_content\"  \n\t      android:layout_margin=\"@dimen/nd3_margin_size\"\n\t      android:text=\"@string/nd3_delete_friend\"\n\t      android:textStyle=\"bold\" \n\t      android:textColor=\"@color/nd3_white\"\n\t      android:background=\"@drawable/nd3_friend_del_button\"\n\t      />\n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_detail_action.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n  \n   <include\n     android:id=\"@+id/nd3_sysmessage_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t android:layout_alignParentTop=\"true\"\n  \t layout=\"@layout/nd3_sysmessage_head_reg\"/>\n  \t \n  \t  <ScrollView\n  \t android:layout_width=\"fill_parent\"\n\t android:layout_height=\"fill_parent\"\n\t android:fillViewport=\"true\"\n     android:fadingEdge=\"none\"\n     android:layout_below=\"@id/nd3_sysmessage_head_layout\">\n         <RelativeLayout\n         android:layout_width=\"fill_parent\"\n\t\t android:layout_height=\"fill_parent\"\n\t\t android:background=\"@color/nd3_list_view_item_bg_1\">\n\t\t\t <RelativeLayout\n\t\t\t android:id=\"@+id/nd3_sysmessge_content_rl\"\n\t\t\t android:layout_width=\"fill_parent\"\n\t\t     android:layout_height=\"wrap_content\"\n\t\t     android:padding=\"@dimen/nd3_option_item_marginLeft\"\n\t\t     android:background=\"@drawable/nd3_activity_action_above_bg\">\t\n\t\t     \t<TextView\n\t\t     \tandroid:id=\"@+id/nd3_sysmessge_content\"\n\t\t     \tandroid:layout_width=\"fill_parent\"\n\t\t        android:layout_height=\"wrap_content\"\n\t\t        android:layout_alignParentTop=\"true\"\n\t\t        android:textColor=\"@color/nd3_black\"/>\n\t\t     \t<TextView\n\t\t     \tandroid:id=\"@+id/nd3_sysmessge_time\"\n\t\t     \tandroid:layout_width=\"fill_parent\"\n\t\t        android:layout_height=\"wrap_content\"\n\t\t        android:textColor=\"@color/nd3_black\"\n\t\t        android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t\t        android:layout_below=\"@id/nd3_sysmessge_content\"/>\n\t\t\t </RelativeLayout>\n\t\t\t \n\t\t\t <LinearLayout\n\t\t\t android:layout_width=\"fill_parent\"\n\t\t     android:layout_height=\"fill_parent\"\n\t\t     android:padding=\"@dimen/nd3_option_item_marginLeft\"\n\t\t     android:layout_below=\"@id/nd3_sysmessge_content_rl\"\n\t\t     android:id=\"@+id/nd3_sysmessage_action_rl\"/>\n\t     </RelativeLayout>\n     \n      </ScrollView>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_detail_app.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:orientation=\"vertical\">\n \n  <include\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  layout=\"@layout/nd3_activity_head_reg\"/>\n  \n  <include\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  layout=\"@layout/nd3_activity_content_reg_template_1\"/>\n  \n  <Button\n  android:id=\"@+id/nd3_activity_game_action_btn\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:gravity=\"center\"\n  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\"/>\n  \n  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_detail_no_action.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n   <include\n     android:id=\"@+id/nd3_sysmessage_head_layout\"\n  \t android:layout_width=\"fill_parent\"\n  \t android:layout_height=\"wrap_content\"\n  \t android:layout_alignParentTop=\"true\"\n  \t layout=\"@layout/nd3_sysmessage_head_reg\"/>\n  \t \n  \t <ScrollView\n  \t android:layout_width=\"fill_parent\"\n\t android:layout_height=\"fill_parent\"\n     android:background=\"@color/nd3_list_view_item_bg_1\"\n     android:fillViewport=\"true\"\n     android:fadingEdge=\"none\"\n     android:layout_below=\"@id/nd3_sysmessage_head_layout\">\n\t\t <RelativeLayout\n\t\t android:layout_width=\"fill_parent\"\n\t     android:layout_height=\"fill_parent\"\n\t      android:padding=\"@dimen/nd3_option_item_marginLeft\"\n\t     >\t\n\t     \t<TextView\n\t     \tandroid:id=\"@+id/nd3_sysmessge_content\"\n\t     \tandroid:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:layout_alignParentTop=\"true\"\n\t        android:textColor=\"@color/nd3_black\"/>\n\t     \t<TextView\n\t     \tandroid:id=\"@+id/nd3_sysmessge_time\"\n\t     \tandroid:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t        android:layout_below=\"@id/nd3_sysmessge_content\"\n\t        android:textColor=\"@color/nd3_black\"/>\n\t\t </RelativeLayout>\n\t </ScrollView>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_head_reg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <!--头像  布局文件-->\n  <com.nd.commplatform.message.widget.NdSysMessageAppView \n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  \t\tandroid:layout_width=\"fill_parent\"\n  \t    android:layout_height=\"wrap_content\">\n\t  <RelativeLayout \n\t      android:id=\"@+id/nd3_sysmessage_head_rl\"\n\t      android:layout_width=\"fill_parent\"\n\t  \t  android:layout_height=\"wrap_content\"\n\t  \t  android:layout_margin=\"@dimen/nd3_option_item_marginLeft\">\n\t  \t  \n\t  \t  <ImageView \n\t  \t      android:id=\"@+id/nd3_sysmessage_head_image\"\n\t\t      android:layout_width=\"@dimen/nd3_image_size\"\n\t\t  \t  android:layout_height=\"@dimen/nd3_image_size\"\n\t\t  \t  android:src=\"@drawable/nd3_app_icon_default\"\n\t\t  \t  android:layout_alignParentLeft=\"true\"\n\t\t  \t  android:layout_alignParentTop=\"true\"\n\t\t  \t  android:scaleType=\"fitXY\"\n\t\t  \t  android:layout_marginRight=\"@dimen/nd3_option_item_marginLeft\"/>\n\t  \t  \n\t  \t  <TextView android:id=\"@+id/nd3_sysmessage_user_nickname\"\n\t  \t  \t  android:layout_width=\"wrap_content\"\n\t  \t  \t  android:layout_height=\"wrap_content\"\n\t  \t  \t  android:textColor=\"@color/nd3_white\"\n\t  \t  \t  android:textSize=\"@dimen/nd3_btn_text_size\"\n\t  \t  \t  android:singleLine=\"true\"\n\t  \t  \t  android:ellipsize=\"end\"\n\t  \t  \t  android:layout_alignTop=\"@id/nd3_sysmessage_head_image\"\n\t  \t  \t  android:layout_toRightOf=\"@id/nd3_sysmessage_head_image\"\n\t  \t  \t  android:layout_toLeftOf=\"@+id/nd3_sysmessage_head_switch_image\"/>\n\t  \t  \t  \n\t  \t  <ImageView \n\t  \t    android:id=\"@+id/nd3_sysmessage_head_switch_image\"\n\t        android:layout_width=\"12dip\"\n\t  \t\tandroid:layout_height=\"wrap_content\"\n\t  \t\tandroid:background=\"@drawable/nd3_switch_image_white\"\n\t  \t\tandroid:layout_alignParentRight=\"true\"\n\t  \t\tandroid:layout_alignTop=\"@id/nd3_sysmessage_user_nickname\"/>\n\t  </RelativeLayout>\t  \n\t  \n\t  <ImageView \n\t   android:id=\"@+id/nd3_sysmessage_head_switch\"\n       android:layout_width=\"fill_parent\"\n  \t   android:layout_height=\"wrap_content\"\n  \t   android:background=\"@drawable/nd3_line\"\n  \t   android:layout_below=\"@id/nd3_sysmessage_head_rl\"/>\n </com.nd.commplatform.message.widget.NdSysMessageAppView>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_thirdplatform_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  \n  android:orientation=\"vertical\">\n  \n  \t\t<!-- 分隔线 -->\n        <ImageView \n        \t\tandroid:id=\"@+id/nd3_sina_sperator_line_id\"\n\t    \t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_item_divider\" \n\t\t\t\t/>\n\t\t\n\t\t<!-- Item -->\t\t\n\t\t<RelativeLayout \n\t\t\t  android:id=\"@+id/nd3_invite_sinafriend_layout\" \n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\"  \n\t\t\t  android:layout_marginTop=\"@dimen/nd3_item_divider\"\n\t\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\" > \n\t\t\t  \n\t\t\t  <ImageView  android:id=\"@+id/nd3_sina_image_id\" \n\t\t\t\t  android:src=\"@drawable/nd3_3rd_platform_icon\"\n\t\t\t\t  android:layout_width=\"@dimen/nd3_platform_image_size\"\n\t\t\t\t  android:layout_height=\"@dimen/nd3_platform_image_size\"\n\t\t\t\t  android:scaleType=\"fitXY\"\n\t\t\t      android:layout_alignParentLeft=\"true\" \n\t\t\t      android:layout_marginRight=\"@dimen/nd3_item_divider\"\n\t\t\t      android:layout_centerVertical=\"true\"/>\n\n\t\t\t\t<!-- 区分未/已绑定，不能绑定2种情况 -->\n\t\t\t\t<FrameLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/nd3_sina_image_id\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\t\t\t>\t\t\n\t\t\t\t\t\n\t\t\t\t\t<!-- 未/已绑定 -->\n\t\t\t\t\t<LinearLayout\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_more_account_bind_layout\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:orientation=\"horizontal\"\n\t\t\t\t\t\tandroid:visibility=\"visible\"\n\t\t\t\t\t\t>\t\t  \n\t\t\t\t\t  <TextView  android:id=\"@+id/nd3_name_id\"  \n\t\t\t\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t  android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t  android:layout_weight=\"1\" \n\t\t\t\t\t\t  android:layout_toRightOf=\"@id/nd3_sina_image_id\"\n\t\t\t\t\t\t  android:layout_toLeftOf=\"@+id/nd3_swtich_image\"\n\t\t\t\t\t\t  android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t  style=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t  />\n\t\t\t\t\t\t  \n\t\t\t\t\t\t<TextView\n\t\t\t\t\t\t\tandroid:id=\"@+id/nd3_more_account_other_binded_title\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t\t\t\tandroid:textColor=\"#FF0000FF\"\n\t\t\t\t\t\t    android:textStyle=\"bold\" \n\t\t\t\t\t\t    android:singleLine=\"true\"\n\t  \t\t\t\t\t    android:ellipsize=\"end\"\n\t\t\t\t\t\t\tandroid:text=\"@string/nd3_more_account_other_login\"\n\t\t\t\t\t\t\tandroid:visibility=\"gone\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</TextView>\n\t\t\t\t\t\n\t\t\t\t\t  <ImageView \n\t\t\t\t\t      android:id=\"@+id/nd3_swtich_image\"\n\t\t\t\t\t\t  android:src=\"@drawable/nd3_switch_image\"\n\t\t\t\t\t\t  android:layout_width=\"wrap_content\"\n\t\t\t\t\t      android:layout_height=\"wrap_content\"  \n\t\t\t\t\t      android:layout_alignParentRight=\"true\"\n\t\t\t\t\t      android:layout_centerVertical=\"true\"\n\t\t\t\t\t      />\t  \n\t\t\t\t      </LinearLayout>\t\n\t\t\t\t      \n\t\t\t\t\t<!-- 不能绑定 -->\n\t\t\t\t\t<LinearLayout\n\t\t\t\t\t\tandroid:id=\"@+id/nd3_more_account_cannot_bind_layout\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:orientation=\"vertical\"\n\t\t\t\t\t\tandroid:visibility=\"gone\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<TextView\n\t\t\t\t\t\t\tandroid:id=\"@+id/nd3_more_account_cannot_bind_title\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\t\tandroid:text=\"@string/nd3_more_account_other_login\"\n\t\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</TextView>\n\t\t\t\t\n\t\t\t\t\t\t<TextView\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/nd3_more_account_cannot_bind\"\n\t\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</TextView>\n\t\t\t\t\t</LinearLayout>\t\t\n\t\t\t\t\t\n\t\t\t\t</FrameLayout>\t\n\t\t\t\t\t      \t\t\t  \n      </RelativeLayout>\n       \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_title_bar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd3_title_bar_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" \n\tandroid:orientation =\"vertical\"\n\tandroid:background=\"@drawable/nd3_title_bar_bg\"\n\t>\n\t\n\t<!-- 左按钮 -->\n\t<Button\n\t\tandroid:id=\"@+id/nd3_title_bar_button_left\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentLeft=\"true\"\n\t\tandroid:layout_centerVertical=\"true\"\n\t\tandroid:layout_marginLeft=\"10dip\"\n\t\tandroid:textSize=\"16sp\"\n\t\tandroid:textColor=\"#FFFFFFFF\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:background=\"@drawable/nd3_bnt_01\" \n\t\tandroid:text=\"@string/nd3_account_login_button_left\"\n\t\t>\n\t\t\n\t</Button>\n\t\t\n\t<!-- 标题 -->\n\t<TextView\n\t\tandroid:id=\"@+id/nd3_title_bar_title\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_centerInParent=\"true\"\n\t\tandroid:text=\"@string/nd3_account_login_title\"\n\t\tandroid:maxWidth=\"150.0dip\"\n\t\tandroid:singleLine=\"true\"\n\t\tstyle=\"@style/nd3_textview_0\"\n\t\t>\n\t\n\t</TextView>\t\n\t\n\t<!-- 进度条 -->\t\t\t\n\t<ProgressBar\n\t\tandroid:id=\"@+id/nd3_title_bar_progressbar\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:indeterminate=\"true\"\n\t\tandroid:visibility=\"invisible\"\n\t\tandroid:layout_centerVertical=\"true\"\n\t\tandroid:layout_toRightOf=\"@id/nd3_title_bar_title\"\n\t\tstyle=\"?android:attr/progressBarStyleSmall\"\n\t\t>\n\t</ProgressBar>\n\t\n\t<!-- 右按钮 -->\n\t<Button\n\t\tandroid:id=\"@+id/nd3_title_bar_button_right\"\n\t\tandroid:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentRight=\"true\"\n\t\tandroid:layout_centerVertical=\"true\"\n\t\tandroid:layout_marginRight=\"10dip\"\n\t\tandroid:textSize=\"16sp\"\n\t\tandroid:textColor=\"#FFFFFFFF\"\n\t\tandroid:gravity=\"center\"\n\t\tandroid:background=\"@drawable/nd3_title_bar_action_btn_xml\" \t\n\t\tandroid:text=\"@string/nd3_account_login_button_right\"\n\t\t>\n\t</Button>\n\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_fangle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdUserFangleItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  \n  <RelativeLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:id=\"@+id/nd3_activity_content\"\n  android:layout_alignParentTop=\"true\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n\t  <!-- 发起人头像 -->\n\t  <ImageView\n\t  android:id=\"@+id/nd3_user_image\"\n\t  android:layout_width=\"@dimen/nd3_image_size\"\n\t  android:layout_height=\"@dimen/nd3_image_size\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\"\n\t  android:scaleType=\"fitXY\"\n\t  />\n\t  \n\t  <RelativeLayout\n\t  android:id=\"@+id/nd3_user_name_rl\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_toRightOf=\"@+id/nd3_user_image\"\n\t  android:layout_alignTop=\"@id/nd3_user_image\">\n\t  \n\t      <!-- 发起人昵称 -->\n\t\t  <TextView\n\t\t  android:id=\"@+id/nd3_user_name_txt\"\n\t\t  android:layout_width=\"0dip\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentTop=\"true\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t\t  android:layout_toLeftOf=\"@+id/nd3_fangle_time_txt\"\n\t\t  style=\"@style/nd3_textview_1\"/>\n\t\t  \n\t\t  <!-- 发起时间 -->\n\t\t   <TextView\n\t\t  android:id=\"@+id/nd3_fangle_time_txt\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentRight=\"true\"\n\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t  android:layout_alignParentTop=\"true\"\n\t\t  style=\"@style/nd3_textview_5\"/>\n\t  \n\t  </RelativeLayout>\n\t  \n\t  <!-- 内容 -->\n\t  <TextView\n\t  android:id=\"@+id/nd3_user_content\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_name_rl\"\n\t  android:layout_below=\"@id/nd3_user_name_rl\"\n\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n\t  style=\"@style/nd3_textview_2\"/>\n\t  \n\t  <!-- 显示的图片 -->\n\t  <Gallery\n\t  android:id=\"@+id/nd3_fangle_images\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_content\"\n\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t  android:layout_below=\"@id/nd3_user_content\"\n\t  android:animationDuration=\"0\"\n\t  android:unselectedAlpha=\"255\"\n\t  android:fadingEdge=\"none\"\n\t  android:gravity=\"left\"\n\t  android:visibility=\"gone\"\n\t  android:spacing=\"@dimen/nd3_margin_size\"/>\n  </RelativeLayout>\n  <ImageView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_horizontal_line\"\n  android:layout_below=\"@id/nd3_activity_content\"/>\n</com.nd.commplatform.widget.NdUserFangleItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_fangle_ext.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdUserFangleExtItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  \n  <RelativeLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:id=\"@+id/nd3_activity_content\"\n  android:layout_alignParentTop=\"true\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n\t  <!-- 发起人头像 -->\n\t  <ImageView\n\t  android:id=\"@+id/nd3_user_image\"\n\t  android:layout_width=\"@dimen/nd3_image_size\"\n\t  android:layout_height=\"@dimen/nd3_image_size\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\"\n\t  android:scaleType=\"fitXY\"\n\t  />\n\t  \n\t  <RelativeLayout\n\t  android:id=\"@+id/nd3_user_name_rl\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_toRightOf=\"@+id/nd3_user_image\"\n\t  android:layout_alignTop=\"@id/nd3_user_image\">\n\t  \n\t      <!-- 发起人昵称 -->\n\t\t  <TextView\n\t\t  android:id=\"@+id/nd3_user_name_txt\"\n\t\t  android:layout_width=\"0dip\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentTop=\"true\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t\t  android:layout_toLeftOf=\"@+id/nd3_fangle_time_txt\"\n\t\t  android:maxLines=\"1\"\n          android:singleLine=\"true\"\n          android:ellipsize=\"end\"  \n\t\t  style=\"@style/nd3_textview_1\"/>\n\t\t  \n\t\t  <!-- 发起时间 -->\n\t\t   <TextView\n\t\t  android:id=\"@+id/nd3_fangle_time_txt\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentRight=\"true\"\n\t\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t\t  android:layout_alignParentTop=\"true\"\n\t\t  style=\"@style/nd3_textview_5\"/>\n\t  \n\t  </RelativeLayout>\n\t  \n\t  <!-- 内容 -->\n\t  <com.nd.commplatform.widget.NdTextView\n\t  android:id=\"@+id/nd3_user_content\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_name_rl\"\n\t  android:layout_below=\"@id/nd3_user_name_rl\"\n\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"/>\n\t  \n\t  <!-- 显示的图片 -->\n\t  <Gallery\n\t  android:id=\"@+id/nd3_fangle_images\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_content\"\n\t  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n\t  android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t  android:layout_below=\"@id/nd3_user_content\"\n\t  android:animationDuration=\"0\"\n\t  android:unselectedAlpha=\"255\"\n\t  android:fadingEdge=\"none\"\n\t  android:gravity=\"left\"\n\t  android:visibility=\"gone\"\n\t  android:spacing=\"@dimen/nd3_margin_size\"/>\n  </RelativeLayout>\n  <ImageView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_horizontal_line\"\n  android:layout_below=\"@id/nd3_activity_content\"/>\n</com.nd.commplatform.widget.NdUserFangleExtItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdUserListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\"\n  >\n  \n \n  <ImageView\n  android:id=\"@+id/nd3_user_image\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_alignParentTop=\"true\"\n  android:layout_width=\"@dimen/nd3_image_size\"\n  android:layout_height=\"@dimen/nd3_image_size\"\n  android:scaleType=\"fitXY\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n  \n \n  <ImageView\n  android:id=\"@+id/nd3_user_action_btn\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:src=\"@drawable/nd3_switch_image\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:layout_alignParentRight=\"true\"\n  android:layout_centerVertical=\"true\"/>\n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_user_item_content_rl\"\n  android:layout_width=\"0dip\"\n  android:layout_height=\"wrap_content\"\n  android:layout_toRightOf=\"@id/nd3_user_image\"\n  android:layout_toLeftOf=\"@+id/nd3_user_action_btn\"\n  android:layout_alignTop=\"@id/nd3_user_image\"\n  android:layout_marginBottom=\"@dimen/nd3_margin_size\">\n\t  <TextView\n\t  android:id=\"@+id/nd3_user_name_txt\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n      android:layout_alignParentTop=\"true\"\n      android:maxLines=\"1\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"  \n      style=\"@style/nd3_textview_1\"/> \n\t  <TextView\n\t  android:id=\"@+id/nd3_user_content\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_name_txt\"\n\t  android:layout_below=\"@id/nd3_user_name_txt\"\n\t  android:maxLines=\"1\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"  \n\t  style=\"@style/nd3_textview_2\"/>\n  </RelativeLayout>\n</com.nd.commplatform.widget.NdUserListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_item_divider.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdUserListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  >\n  <RelativeLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:id=\"@+id/nd3_user_content_rl\"\n  android:layout_alignParentTop=\"true\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n  <ImageView\n  android:id=\"@+id/nd3_user_image\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_alignParentTop=\"true\"\n  android:layout_width=\"@dimen/nd3_image_size\"\n  android:layout_height=\"@dimen/nd3_image_size\"\n  android:scaleType=\"fitXY\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"/>\n  \n \n  <ImageView\n  android:id=\"@+id/nd3_user_action_btn\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:src=\"@drawable/nd3_switch_image\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:layout_alignParentRight=\"true\"\n  android:layout_centerVertical=\"true\"/>\n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_user_item_content_rl\"\n  android:layout_width=\"0dip\"\n  android:layout_height=\"wrap_content\"\n  android:layout_toRightOf=\"@id/nd3_user_image\"\n  android:layout_toLeftOf=\"@+id/nd3_user_action_btn\"\n  android:layout_alignTop=\"@id/nd3_user_image\"\n  android:layout_marginBottom=\"@dimen/nd3_margin_size\">\n\t  <TextView\n\t  android:id=\"@+id/nd3_user_name_txt\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n      android:layout_alignParentTop=\"true\"\n      android:maxLines=\"1\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"  \n      style=\"@style/nd3_textview_1\"/> \n\t  <TextView\n\t  android:id=\"@+id/nd3_user_content\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd3_user_name_txt\"\n\t  android:layout_below=\"@id/nd3_user_name_txt\"\n\t  android:maxLines=\"1\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"  \n\t  style=\"@style/nd3_textview_2\"/>\n  </RelativeLayout>\n  \n  </RelativeLayout>\n  \n   <ImageView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_horizontal_line\"\n  android:layout_below=\"@id/nd3_user_content_rl\"/>\n</com.nd.commplatform.widget.NdUserListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_message.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdMessageListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n  \n  \n  <ImageView\n  android:id=\"@+id/nd3_new_message_flag\"\n  android:layout_width=\"12dip\"\n  android:layout_height=\"12dip\"\n  android:src=\"@drawable/nd3_new_message_flag\"\n  android:scaleType=\"centerInside\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_centerVertical=\"true\"\n  android:visibility=\"visible\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  />\n  \n  \n  <ImageView\n  android:id=\"@+id/nd3_user_image\"\n  android:layout_width=\"@dimen/nd3_image_size\"\n  android:layout_height=\"@dimen/nd3_image_size\"\n  android:layout_toRightOf=\"@id/nd3_new_message_flag\"\n  android:layout_alignParentTop=\"true\"\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:scaleType=\"fitXY\"\n  android:layout_alignWithParentIfMissing=\"true\"/>\n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_user_name_rl\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_toRightOf=\"@+id/nd3_user_image\"\n  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n  android:layout_alignTop=\"@id/nd3_user_image\">\n\t  <TextView\n\t  android:id=\"@+id/nd3_user_name_txt\"\n\t  android:layout_width=\"0dip\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:singleLine=\"true\"\n\t  android:ellipsize=\"end\"\n\t  android:layout_toLeftOf=\"@+id/nd3_message_time_txt\"\n\t  style=\"@style/nd3_textview_1\"/>\n\t  \n\t   <TextView\n\t  android:id=\"@+id/nd3_message_time_txt\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentRight=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n\t  style=\"@style/nd3_textview_5\"/>\n  </RelativeLayout>\n  \n  <TextView\n  android:id=\"@+id/nd3_message_content\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:layout_alignLeft=\"@id/nd3_user_name_rl\"\n  android:layout_below=\"@id/nd3_user_name_rl\"\n  android:layout_marginRight=\"@dimen/nd3_margin_size\"\n  android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n  android:maxLines=\"1\"\n  android:singleLine=\"true\"\n  android:ellipsize=\"end\"\n  style=\"@style/nd3_textview_2\"/>\n  \n</com.nd.commplatform.widget.NdMessageListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_message_switcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:id=\"@+id/nd3_message_switcher_root_rl\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\">\n  <RelativeLayout\n  android:id=\"@+id/nd3_user_message_title_bar_rl\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_title_bar_bg\"\n  >\n\t  <Button \n\t  android:id=\"@+id/nd3_message_refresh_btn\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:layout_margin=\"10dip\"\n\t  android:layout_centerVertical=\"true\"\n\t  android:textSize=\"16sp\"\n\t  android:textColor=\"@color/nd3_btn_font_color\"\n\t  android:text=\"@string/nd3_message_refresh\"\n\t  android:background=\"@drawable/nd3_title_bar_action_btn_xml\"/>\n\t  <RadioGroup\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_centerInParent=\"true\"\n\t  android:id=\"@+id/nd3_message_type_group\"\n\t  android:orientation=\"horizontal\">\n\t  \t       <RadioButton  \n\t\t\t    android:id=\"@+id/nd3_my_message_btn\" \n\t\t\t    android:background=\"@drawable/nd3_rank_choice_left_btn_bg\"\n\t\t\t    android:button=\"@null\"\n\t\t\t    android:layout_height=\"wrap_content\" \n\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t    android:text=\"@string/nd3_my_message_title\"\n\t\t\t    android:gravity=\"center\"\n\t\t\t    />\n\t\t\t <RadioButton  \n\t\t\t \tandroid:id=\"@+id/nd3_sys_message_btn\" \n\t\t\t \tandroid:background=\"@drawable/nd3_rank_choice_right_btn_bg\"\n\t\t\t \tandroid:button=\"@null\" \n\t\t\t \tandroid:layout_height=\"wrap_content\"\n\t\t\t \tandroid:layout_width=\"wrap_content\"\n\t\t\t \tandroid:text=\"@string/nd3_sys_message_title\"\n\t\t\t \tandroid:gravity=\"center\"\n\t\t\t \t/>\n\t  </RadioGroup>\n\t  <Button \n\t  android:id=\"@+id/nd3_message_send_btn\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentRight=\"true\"\n\t  android:layout_margin=\"10dip\"\n\t  android:layout_centerVertical=\"true\"\n\t  android:textSize=\"16sp\"\n\t  android:textColor=\"@color/nd3_btn_font_color\"\n\t  android:text=\"@string/nd3_my_message_send\"\n\t  android:background=\"@drawable/nd3_title_bar_action_btn_xml\"/>\n  </RelativeLayout>\n   <RelativeLayout\n  android:id=\"@+id/nd3_message_content\"\n  android:layout_below=\"@id/nd3_user_message_title_bar_rl\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"/>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_version_update.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:orientation=\"vertical\"\n        android:paddingTop=\"7dp\"\n        android:paddingLeft=\"5dp\"\n        >\n\n    <LinearLayout\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\n        android:paddingTop=\"3dp\"\n        >\n        \n        <TextView android:id=\"@+id/nd3_title\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:singleLine=\"true\"\n            android:ellipsize=\"marquee\"\n            android:fadingEdge=\"horizontal\"\n            android:textStyle=\"bold\"\n            android:textSize=\"16sp\"\n            android:paddingLeft=\"4dp\"\n            />\n            \n        <LinearLayout\n\t        android:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\"\n\t        android:gravity=\"center_vertical\"\n\t        >\n\t        \n\t       <ProgressBar android:id=\"@+id/nd3_version_update\" \n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:layout_width=\"fill_parent\"  \n\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\tstyle=\"?android:attr/progressBarStyleHorizontal\"\n\t\t\t\tandroid:layout_alignParentLeft=\"true\"/>\n\t\t\t\n\t\t\t<TextView android:id=\"@+id/nd3_progress_tip\"\n\t            android:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:singleLine=\"true\"\n\t            android:ellipsize=\"marquee\"\n\t            android:fadingEdge=\"horizontal\"\n\t            android:textStyle=\"bold\"\n\t            android:textSize=\"16sp\"\n\t            android:paddingLeft=\"4dp\"\n\t            android:layout_marginLeft=\"4dip\"\n\t            />\n            \n\t        <TextView android:id=\"@+id/nd3_time\"\n\t            android:layout_marginLeft=\"4dp\"\n\t            android:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:singleLine=\"true\"\n\t            android:textSize=\"14sp\"\n\t            android:paddingRight=\"5dp\"\n\t            \n\t            android:layout_alignParentRight=\"true\" />\n\t            \n    \t</LinearLayout>    \n        \n        \n    </LinearLayout>\n    \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_write_message.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\" \n  android:background=\"@color/nd3_white\"\n  >\n  \n  <EditText\n  \t  android:id=\"@+id/nd3_write_message\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\"  \n\t  android:textColorHint=\"@color/nd3_hint\" \n\t  android:layout_margin=\"@dimen/nd3_item_divider\" \n\t  android:singleLine=\"false\" \n\t  android:gravity=\"top\" \n\t  android:background=\"@null\" \n\t  android:scrollbarStyle=\"outsideOverlay\" \n\t  />\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_account_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    android:gravity=\"center_vertical\"\n    android:minHeight=\"?android:attr/listPreferredItemHeight\"\n    android:orientation=\"horizontal\"\n    android:padding=\"6.0dip\"\n    android:paddingLeft=\"0.0dip\" >\n\n    <ImageButton\n        android:id=\"@+id/nd_iv_delete\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"fill_parent\"\n        android:background=\"@null\"\n        android:paddingLeft=\"6.0dip\"\n        android:paddingRight=\"6.0dip\"\n        android:src=\"@drawable/nd3_icon_08\" />\n\n    <TextView\n        android:id=\"@+id/nd_tv_account\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_weight=\"1.0\"\n        android:ellipsize=\"marquee\"\n        android:paddingLeft=\"6.0dip\"\n        android:paddingRight=\"6.0dip\"\n        android:singleLine=\"true\" \n        android:textColor=\"@color/nd3_black\"\n        android:textSize=\"@dimen/nd3_btn_text_size\" />\n\n    <FrameLayout\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\" >\n\n        <Button\n            android:id=\"@+id/nd_btn_login\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\"\n            android:background=\"@drawable/nd3_button1\"\n            android:text=\"@string/nd_btn_login\"\n            android:textColor=\"@color/nd3_white\"\n            android:textSize=\"@dimen/nd3_pay_tip_text_size\" />\n\n        <Button\n            android:id=\"@+id/nd_btn_delete\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\"\n            android:background=\"@drawable/nd_list_btn_delete_selector\"\n            android:text=\"@string/nd_btn_delete\"\n            android:textColor=\"@color/nd3_white\"\n            android:textSize=\"@dimen/nd3_pay_tip_text_size\" />\n\n        <ImageView\n            android:id=\"@+id/nd_iv_check\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\"\n            android:src=\"@drawable/nd3_icon_07\" />\n    </FrameLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_account_manage.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/nd3_account_manage_layout\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:fillViewport=\"true\"\n    android:orientation=\"vertical\" >\n\n    <!-- 标题栏 -->\n\n    <RelativeLayout\n        android:id=\"@+id/nd3_account_manage_titlebar\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\" >\n\n        <!-- 登录 -->\n\n        <Button\n            android:id=\"@+id/nd3_account_manage_login\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_margin=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"@color/nd3_btn_font_color\"\n            android:textSize=\"16sp\" />\n\n        <!-- 标题 -->\n\n        <TextView\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\"\n            android:text=\"@string/nd_account_manage_title\" >\n        </TextView>\n\n        <!-- 完成 -->\n\n        <Button\n            android:id=\"@+id/nd3_account_manage_complete\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_margin=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:padding=\"5dip\"\n            android:text=\"@string/nd_btn_edit\"\n            android:textColor=\"@color/nd3_btn_font_color\"\n            android:textSize=\"16sp\" />\n    </RelativeLayout>\n\n    <!-- 内容 -->\n\n    <ListView\n        android:id=\"@+id/nd_account_listview\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:layout_margin=\"@dimen/nd3_margin_size\"\n        android:layout_weight=\"1.0\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:cacheColorHint=\"#00000000\"\n        android:divider=\"@drawable/nd3_horizontal_line\"\n        android:fadingEdge=\"none\"\n        android:fastScrollEnabled=\"true\"\n        android:footerDividersEnabled=\"false\"\n        android:headerDividersEnabled=\"false\" >\n    </ListView>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_lottery.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_bind_phone_number_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\tandroid:gravity=\"center\"\n\t>\n\t<RelativeLayout\n        android:id=\"@+id/nd3_title_bar_layout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button>\n\n        <!-- 标题 -->\n\n        <TextView\n            android:id=\"@+id/nd3_title_bar_title\"\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\" \n            android:drawablePadding=\"@dimen/nd3_option_item_marginLeft\"\n            android:text=\"@string/nd_bind_phone_title\" >\n        </TextView>\n\n        <!-- 右按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_right\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginRight=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_account_login_button_right\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\"\n            android:visibility=\"invisible\" >\n        </Button>\n    </RelativeLayout>\n <ScrollView\n     android:layout_width=\"fill_parent\"\n     android:layout_height=\"fill_parent\" >   \n  <LinearLayout \n\t    android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:orientation=\"vertical\"\n\t\tstyle=\"@style/nd3_option_item_margin_style\"\n\t\tandroid:gravity=\"center_horizontal\">\n        <ImageView \n            android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:src=\"@drawable/nd_winning\"\n\t\t\tandroid:layout_gravity=\"center\"/>\n\t    <!-- 提示信息 -->\n\t\t<TextView\n\t\t    android:id=\"@+id/nd_lottery_tip\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:gravity=\"center\"\n\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t>\n\t\t</TextView>\n\t \n\t\t   \n\t\t<Button \n\t\t    android:id=\"@+id/nd_lottery_exit\"\n\t    \tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd3_yes\"\n\t\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_font_color\"\t\n\t\t\tstyle=\"@style/nd3_button_margin_style\"\t\n\t\t\tandroid:background=\"@drawable/nd_white_btn\"\n\t\t\tandroid:gravity=\"center\"\n\t\t\tandroid:layout_marginTop=\"@dimen/nd_20\"\n\t\t\t/>      \n\t  \n\t   <TextView\n\t\t    android:id=\"@+id/nd_server_tel\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:gravity=\"center|bottom\"  \n\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t>\n\t\t</TextView>\n\t</LinearLayout>\n  </ScrollView>\t\t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_bind_phone_number_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\tandroid:gravity=\"center\"\n\t>\n\t<RelativeLayout\n        android:id=\"@+id/nd3_title_bar_layout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button>\n\n        <!-- 标题 -->\n\n        <TextView\n            android:id=\"@+id/nd3_title_bar_title\"\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\" \n            android:drawablePadding=\"@dimen/nd3_option_item_marginLeft\"\n            android:text=\"@string/nd_bind_phone_title\" >\n        </TextView>\n\n        <!-- 右按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_right\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginRight=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_account_login_button_right\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\"\n            android:visibility=\"invisible\" >\n        </Button>\n    </RelativeLayout>\n    \n    <ScrollView\n     android:layout_width=\"fill_parent\"\n     android:layout_height=\"fill_parent\" \n     android:fillViewport=\"true\"\n\t android:fadingEdge=\"none\" >\n    <LinearLayout \n\t    android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:orientation=\"vertical\">\n        <!-- 提示 -->\n        <TextView android:id=\"@+id/nd_account\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"  \n\t\t\tandroid:textSize=\"@dimen/nd3_pay_password_tip_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\tandroid:textStyle=\"bold\"\n\t\t\tandroid:padding=\"@dimen/nd3_margin_size\"\t\n\t\t\tandroid:gravity=\"center\" \n\t\t\t>\n\t\t</TextView>\n\t\t<TextView\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\tandroid:text=\"@string/nd_account_bind_tips\" \n\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\tandroid:textStyle=\"bold\"\n\t\t\tandroid:padding=\"@dimen/nd3_margin_size\"\t\n\t\t\tandroid:gravity=\"center\"\n\t\t\t \n\t\t\t>\n\t\t</TextView>\n        \n\t<!-- 输入绑定的手机号 -->\n\t<LinearLayout \n\t    android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:orientation=\"vertical\"\n\t\tandroid:paddingLeft=\"@dimen/nd_20\"\n\t\tandroid:paddingRight=\"@dimen/nd_20\"\n\t\t>\n\t\t \n\t\t\n\t\t<LinearLayout\n\t\t    android:id=\"@+id/nd_bind_group_code\" \n\t\t    android:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\" \n\t\t    >\n\t\t\t<LinearLayout \n\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t    android:layout_height=\"wrap_content\"  \n\t\t\t    android:layout_weight=\"0.8\"\n\t\t\t    android:orientation=\"vertical\">\n\t\t\t    \t<!-- 提示 -->\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_bind_phone_number_enter_number_tip\"\n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\t\n\t\t\t\t\t<!-- 编辑框 -->\n\t\t\t\t\t<EditText\n\t\t\t            android:id=\"@+id/nd_bind_edit_phone_number\"\n\t\t\t            android:textSize=\"16.0sp\"\n\t\t\t            android:layout_width=\"fill_parent\"\n\t\t\t            android:layout_height=\"wrap_content\"\n\t\t\t            android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t\t\t            android:inputType=\"phone\"\n\t\t\t            android:textColor=\"@color/nd3_white\"\n\t\t\t            android:background=\"@drawable/nd3_input_gray\"\n\t\t\t            android:singleLine=\"true\" >\n\t\t\t        </EditText>\t\n\t\t    \t\t\n\t\t\t</LinearLayout>\n\t\t\t    \n\t\t\t<!-- 和 -->\n\t\t\t<LinearLayout \n\t\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t    \tandroid:layout_height=\"wrap_content\"  \n\t\t\t    \tandroid:orientation=\"vertical\">\n\t\t\t\t\t<TextView\n\t\t\t\t\t    android:id=\"@+id/nd_number_gain_text\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_balance_color\"\t\n\t\t\t\t\t\tandroid:visibility=\"invisible\"\n\t\t\t\t\t\tandroid:layout_gravity=\"right\"/>\n\t\t\t\t\t\n\t\t\t\t\t<Button \n\t\t\t\t\t    android:id=\"@+id/nd_bind_phone_number_gain\"\n\t\t\t\t    \tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_bind_phone_number_gain_code\"\n\t\t\t\t\t\tandroid:background=\"@drawable/nd_white_btn\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_font_color\"\n\t\t\t\t\t\tandroid:layout_gravity=\"right\"\n\t\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t\t/>    \n\t\t\t</LinearLayout>\n\t\t</LinearLayout>\n\t\t<!-- 请输入收到的短信验证码 -->\n\t\t<LinearLayout\n\t\t    android:id=\"@+id/nd_bind_phone_number_bind_group_phone_number\" \n\t\t    android:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\"\n\t\t    android:orientation=\"vertical\"\n\t\t    android:layout_marginTop=\"@dimen/nd_10\"\n\t\t    >\n\t\t\t<!-- 提示 -->\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_number_enter_code_tip\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t<!-- 编辑框 -->\n\t\t\t<EditText\n\t            android:id=\"@+id/nd_bind_edit_code\"\n\t            android:textSize=\"16.0sp\"\n\t            android:layout_width=\"fill_parent\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:layout_weight=\"1.0\"\n\t            android:textColor=\"@color/nd3_white\"\n\t            android:background=\"@drawable/nd3_input_gray\"\n\t            android:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t            android:singleLine=\"true\" />\n\t\t    \t\t\t\t    \t\t\n\t\t</LinearLayout>\n\t\t <!-- 绑定手机 -->\t\t\t\t\n\t\t<Button \n\t\t    android:id=\"@+id/nd_bind_phone_number_bind\"\n\t    \tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd_bind_phone_number_bind\"\n\t\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t \n\t\t\tandroid:background=\"@drawable/nd_blue\"\n\t\t\tandroid:layout_gravity=\"center\"\n\t\t\tandroid:layout_marginTop=\"@dimen/nd_20\"\n\t\t\t/>      \n\t\t\n\t\t<TextView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd_bind_phone_reason\"\n\t\t\tandroid:textSize=\"@dimen/nd_20\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\tandroid:layout_marginTop=\"@dimen/nd_20\" \n\t\t\t/>\n\t\t<TextView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd_bind_phone_reason1\"\n\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\" \n\t\t\t/>\n\t\t<TextView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd_bind_phone_reason2\"\n\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t \n\t\t\t/>\n\t\t<!-- <TextView\n\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd_bind_phone_reason3\"\n\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t \n\t\t\t/> -->\n\t\t\n\t</LinearLayout>\n\t</LinearLayout>\n\t</ScrollView>  \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number_result.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_bind_phone_number_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\tandroid:gravity=\"center\"\n\t>\n\t<RelativeLayout\n        android:id=\"@+id/nd3_title_bar_layout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button>\n\n        <!-- 标题 -->\n\n        <TextView\n            android:id=\"@+id/nd3_title_bar_title\"\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\" \n            android:drawablePadding=\"@dimen/nd3_option_item_marginLeft\"\n            android:text=\"@string/nd_bind_phone_title\" >\n        </TextView>\n\n        <!-- 右按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_right\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginRight=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_account_login_button_right\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\"\n            android:visibility=\"invisible\" >\n        </Button>\n    </RelativeLayout>\n  <ScrollView\n     android:layout_width=\"fill_parent\"\n     android:layout_height=\"fill_parent\" >  \n\t  <LinearLayout \n\t\t    android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\tandroid:orientation=\"vertical\"\n\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\n\t\t\tandroid:gravity=\"center_horizontal\">\n\t\t    <!-- 提示信息 -->\n\t\t\t<TextView\n\t\t\t    android:id=\"@+id/nd_bind_phone_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_result_success_format\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t \n\t\t\t  <!-- 试试手气 -->\t\t\t\t\n\t\t\t<Button \n\t\t\t    android:id=\"@+id/nd_bind_phone_lottery\"\n\t\t    \tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_lottery\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\n\t\t\t\tandroid:background=\"@drawable/nd_blue\"\n\t\t\t\tandroid:gravity=\"center\" \n\t\t\t\t/>      \n\t\t\t\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_result_tips\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\t\tandroid:layout_gravity=\"left\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t/>\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_result_tips1\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\t\tandroid:layout_gravity=\"left\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t/>\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_result_tips2\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\t\tandroid:layout_gravity=\"left\"\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t/>\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_result_tips3\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\t\tandroid:layout_gravity=\"left\"\t\n\t\t\t\tandroid:layout_marginLeft=\"@dimen/nd3_option_item_marginLeft\"\n\t\t\t\t \n\t\t\t\t/> \t\n\t\t</LinearLayout>\n\t</ScrollView>\t\t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number_tip.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_bind_phone_number_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\tandroid:gravity=\"center\"\n\t>\n\t \n\t    \n  <RelativeLayout\n        android:id=\"@+id/nd3_title_bar_layout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button>\n\n        <!-- 标题 -->\n\n        <TextView\n            android:id=\"@+id/nd3_title_bar_title\"\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\" \n            android:drawablePadding=\"@dimen/nd3_option_item_marginLeft\"\n            android:text=\"@string/nd_bind_phone_title\" >\n        </TextView>\n\n        <!-- 右按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_right\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginRight=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_account_login_button_right\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\"\n            android:visibility=\"invisible\" >\n        </Button>\n    </RelativeLayout>\n  <!-- 文本部分 -->\n  \t <ScrollView\n\t  \t android:layout_width=\"fill_parent\"\n\t     android:layout_height=\"fill_parent\"\n\t     android:fillViewport=\"true\"\n\t     android:fadingEdge=\"none\">  \n\t\t  <LinearLayout \n\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:orientation=\"vertical\"\n\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\n\t\t\t\tandroid:gravity=\"center_horizontal\">\n\t\t\t    \n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:gravity=\"center_horizontal\"\n\t\t\t\t\tandroid:text=\"@string/nd_bind_phone_desc_title\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd_20\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_bind_phonenumber_paddingTop\"\n\t\t\t\t\tstyle=\"@style/nd3_option_margin_style\" \n\t\t\t\t\t>\n\t\t\t\t</TextView>\n\t\t\t\t\n\t\t\t\t<ImageView \n\t\t\t        android:layout_width=\"wrap_content\"\n\t\t\t        android:layout_height=\"wrap_content\" \n\t\t\t        style=\"@style/nd3_photo_margin_style\" \n\t\t\t        android:src=\"@drawable/nd_ad\"/>\n\t\t\t \n\t\t\t\t<!-- 内容简介 -->\n\t\t\t\t<TextView\n\t\t\t\t    android:id=\"@+id/nd_activityinfo\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:gravity=\"left\" \n\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\tstyle=\"@style/nd3_text_margin_style_25\"  \n\t\t\t\t\t>\n\t\t\t\t</TextView>\n\t\t\t\n\t\t\t\t \n\t\t\t    \n\t\t\t\t<Button \n\t\t\t\t    android:id=\"@+id/nd_join\"\n\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t        android:background=\"@drawable/nd_blue\"\n\t\t\t        android:textColor=\"@color/nd3_white\"\t\n\t\t\t        android:textSize=\"@dimen/nd_20\"\n\t\t\t        android:layout_marginTop=\"@dimen/nd3_bind_phonenumber_paddingTop\"\n\t\t\t        style=\"@style/nd3_button_margin_style\" \n\t\t\t        android:gravity=\"center\"\n\t\t\t        android:text=\"@string/nd_bind_phone_number_join\" />\n\t\t\t\t\n\t\t\t\t<Button \n\t\t\t\t    android:id=\"@+id/nd_leave\"\n\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t        android:background=\"@drawable/nd_white_btn\"\n\t\t\t        android:textColor=\"@color/nd3_font_color\"\t\n\t\t\t        android:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t        android:layout_marginBottom=\"@dimen/nd3_option_margin_top\"\n\t\t\t        style=\"@style/nd3_button_margin_style\" \n\t\t\t        android:gravity=\"center\"\n\t\t\t        android:textSize=\"@dimen/nd_20\"\n\t\t\t        android:text=\"@string/nd_bind_phone_number_leave\" />\n\t\t\t</LinearLayout>\n\t</ScrollView>\t\t     \t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number_unactivity_tip.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_bind_phone_number_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\tandroid:gravity=\"center\"\n\t>\n\t \n\t    \n  <RelativeLayout\n        android:id=\"@+id/nd3_title_bar_layout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- 左按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_left\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_topbar_ret\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\" >\n        </Button>\n\n        <!-- 标题 -->\n\n        <TextView\n            android:id=\"@+id/nd3_title_bar_title\"\n            style=\"@style/nd3_textview_0\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_centerInParent=\"true\" \n            android:drawablePadding=\"@dimen/nd3_option_item_marginLeft\"\n            android:text=\"@string/nd_bind_phone_title\" >\n        </TextView>\n\n        <!-- 右按钮 -->\n\n        <Button\n            android:id=\"@+id/nd3_title_bar_button_right\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginRight=\"10dip\"\n            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n            android:gravity=\"center\"\n            android:text=\"@string/nd3_account_login_button_right\"\n            android:textColor=\"#FFFFFFFF\"\n            android:textSize=\"16sp\"\n            android:visibility=\"invisible\" >\n        </Button>\n    </RelativeLayout>\n  <!-- 文本部分 -->\n  \t <ScrollView\n\t  \t android:layout_width=\"fill_parent\"\n\t     android:layout_height=\"fill_parent\"\n\t     android:fillViewport=\"true\"\n\t     android:fadingEdge=\"none\"\n\t     android:layout_below=\"@id/nd3_activity_head_layout\">  \n\t\t  <LinearLayout \n\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"fill_parent\"\n\t\t\t\tandroid:orientation=\"vertical\"\n\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd_20\"\n\t\t\t\tandroid:gravity=\"center_horizontal\">\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:gravity=\"center\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_bind_phone_unactivity_tip\"\n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\n\t\t\t\t\t\tandroid:drawableLeft=\"@drawable/nd_warn\" \n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t<!-- 内容简介 -->\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_bind_phone_unactivity_desc\"\n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\tstyle=\"@style/nd3_photo_margin_style\" \n\t\t\t\t\t\tandroid:layout_marginBottom=\"@dimen/nd_10\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t    \n\t\t\t\t\t<Button \n\t\t\t\t\t    android:id=\"@+id/nd_bind\"\n\t\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t\t        android:background=\"@drawable/nd_blue\"\n\t\t\t\t        android:textColor=\"@color/nd3_white\"\t \n\t\t\t\t        style=\"@style/nd3_button_margin_style\"\t\n\t\t\t\t        android:text=\"@string/nd_bind_phone_number_bind\" \n\t\t\t\t        android:gravity=\"center\"\n\t\t\t\t        android:layout_marginTop=\"@dimen/nd_20\"/>\n\t\t\t\t\t\n\t\t\t\t\t<Button \n\t\t\t\t\t    android:id=\"@+id/nd_leave\"\n\t\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t\t        android:background=\"@drawable/nd_white_btn\"\n\t\t\t\t        android:textColor=\"@color/nd3_font_color\"\t \n\t\t\t\t        style=\"@style/nd3_button_margin_style\"\t\n\t\t\t\t        android:gravity=\"center\"\n\t\t\t\t        android:layout_marginTop=\"@dimen/nd_20\"\n\t\t\t\t        android:layout_marginBottom=\"@dimen/nd_20\"\n\t\t\t\t        android:text=\"@string/nd_find_password_later\" />\n\t\t\t\t</LinearLayout>\t \n\t</ScrollView>\t\t     \t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_check_version.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:orientation=\"vertical\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n    \n    <TextView \n\t    android:id=\"@+id/nd_new_app_desc\"\n\t    android:layout_width=\"fill_parent\"\n\t    android:layout_height=\"wrap_content\"\n\t    android:gravity=\"center_horizontal\"\n\t    android:layout_marginTop=\"20dip\"   \n\t    android:textColor=\"@color/nd3_white\"\n\t    android:text=\"@string/nd_is_new_desc\"\n\t    />\n\t\t\t    \n    <LinearLayout\n        style=\"@style/nd3_option_margin_style\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:orientation=\"horizontal\" >\n\n        <LinearLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\"\n            android:layout_weight=\"0.6\"\n            android:gravity=\"center\"\n            android:paddingLeft=\"5dip\"\n            >\n\n            <TextView\n                android:id=\"@+id/nd_app_name\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"20dip\"\n                android:gravity=\"left\" \n                android:textColor=\"@color/nd3_black\"\n                android:textSize=\"18dip\"\n                android:textStyle=\"bold\" />\n\n            <!--\n                 <TextView \n\t\t\t    android:id=\"@+id/nd_curren_version\"\n\t\t\t    android:layout_width=\"180dip\"\n\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t    android:gravity=\"left\"\n\t\t\t    android:layout_gravity=\"center\"\n\t\t\t    android:layout_marginTop=\"10dip\"  \n\t\t\t    style=\"@style/nd_check_version_style\"/>\n            -->\n\n            <TextView\n                android:id=\"@+id/nd_laster_version\"\n                style=\"@style/nd_check_version_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_gravity=\"center\"\n                android:layout_marginTop=\"10dip\"\n                android:gravity=\"left\" />\n\n            <TextView\n                android:id=\"@+id/nd_version_size\"\n                style=\"@style/nd_check_version_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_gravity=\"center\"\n                android:layout_marginTop=\"10dip\"\n                android:gravity=\"left\"\n                android:visibility=\"gone\" />\n\n            <TextView\n                android:id=\"@+id/nd_merchantInfo\"\n                style=\"@style/nd_check_version_style\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_gravity=\"center\" \n                android:gravity=\"left\" />\n        </LinearLayout>\n\n        <ImageView\n            android:id=\"@+id/nd_app_image\"\n            android:layout_width=\"80dip\"\n            android:layout_height=\"80dip\"\n            android:layout_gravity=\"center_vertical\" \n            android:src=\"@drawable/nd3_game_head\" \n            android:scaleType=\"centerCrop\"\n            android:paddingLeft=\"20dip\"\n            android:paddingRight=\"20dip\"\n            />\n    </LinearLayout>\n                \n    <TextView \n\t    android:id=\"@+id/nd_down_tips\"\n\t    android:layout_width=\"fill_parent\"\n\t    android:layout_height=\"wrap_content\"\n\t    android:gravity=\"center\" \n\t    android:layout_marginTop=\"5dip\"  \n\t    android:textColor=\"@color/nd3_white\"\n\t    android:text=\"@string/nd_version_update_tips\"\n\t    android:visibility=\"gone\"/>\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n    \n    <LinearLayout \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:orientation=\"vertical\"\n        android:layout_margin=\"5dip\" >\n        <TextView \n                android:id=\"@+id/nd_title\"\n                android:layout_width=\"fill_parent\"\n        \t\tandroid:layout_height=\"50dip\"\n        \t\tandroid:text=\"@string/nd_feedback_choose_problem_type\"\n        \t\tandroid:textSize=\"16dip\"\n        \t\tandroid:textColor=\"@color/nd3_black\"\n        \t\tandroid:padding=\"5dip\"\n        \t\tandroid:gravity=\"center_vertical\"/> \n        <ImageView\n              android:layout_width=\"fill_parent\"\n              android:layout_height=\"wrap_content\"\n              android:background=\"@drawable/nd3_horizontal_line\" />\n        <TextView \n            android:id=\"@+id/nd_problem\"\n            android:layout_width=\"fill_parent\"\n       \t\tandroid:layout_height=\"fill_parent\"\n       \t\tandroid:textSize=\"14dip\"\n       \t\tandroid:textColor=\"@color/nd_font_color\"/>\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" \n\tandroid:orientation=\"vertical\" >\n    \n    <ListView\n          android:id=\"@+id/nd_feedback_faq_list\"\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\" \n\t\t  android:headerDividersEnabled=\"false\"\n\t\t  android:footerDividersEnabled=\"false\"\n\t\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t\t  android:fastScrollEnabled=\"true\"\n\t\t  android:cacheColorHint=\"#00000000\"\n\t\t  android:fadingEdge=\"none\" \n\t\t  android:background=\"@drawable/nd3_bk1\"\n\t\t  android:layout_margin=\"5dip\"\n\t\t  android:layout_alignParentTop=\"true\"\n\t\t  android:focusable=\"false\"\n\t\t  android:focusableInTouchMode=\"false\"\n\t\t  />\n     \n    <TextView \n         android:id=\"@+id/nd_tips\"\n         android:layout_width=\"fill_parent\"\n\t\t android:layout_height=\"wrap_content\" \n\t\t android:text=\"@string/nd_feedback_tips4\" \n\t\t android:background=\"@drawable/nd3_bk1\"\n\t\t android:gravity=\"center\" \n\t\t android:visibility=\"gone\"\n\t\t android:layout_margin=\"10dip\"\n\t\t />\n    \n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"vertical\" >\r\n    \r\n    <LinearLayout \r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:background=\"@drawable/nd3_bk1\"\r\n        android:orientation=\"vertical\"\r\n        android:layout_margin=\"10dip\" >\r\n        <LinearLayout \r\n            android:layout_width=\"fill_parent\"\r\n        \tandroid:layout_height=\"wrap_content\"\r\n        \tandroid:gravity=\"center_vertical\"\r\n        \tandroid:padding=\"5dip\">\r\n            <TextView \r\n                android:layout_width=\"wrap_content\"\r\n        \t\tandroid:layout_height=\"wrap_content\"\r\n        \t\tandroid:text=\"@string/nd_feedback_choose_problem_type\"\r\n        \t\tandroid:textSize=\"16dip\"\r\n        \t\tandroid:textColor=\"@color/nd3_black\"\r\n        \t\tandroid:gravity=\"center_vertical\"/>\r\n            \r\n            <TextView \r\n                android:layout_width=\"wrap_content\"\r\n        \t\tandroid:layout_height=\"wrap_content\"\r\n        \t\tandroid:text=\"@string/nd_star\"\r\n        \t\tandroid:textColor=\"@color/nd3_red\"\r\n        \t\tandroid:gravity=\"center_vertical\"/> \r\n        </LinearLayout>\r\n        <ImageView\r\n              android:layout_width=\"fill_parent\"\r\n              android:layout_height=\"wrap_content\"\r\n              android:background=\"@drawable/nd3_horizontal_line\" />\r\n        <LinearLayout \r\n            android:id=\"@+id/nd_fb_problem_type_layout\"\r\n            android:layout_width=\"fill_parent\"\r\n        \tandroid:layout_height=\"40dip\"\r\n        \tandroid:gravity=\"center_vertical\"\r\n        \tandroid:paddingRight=\"5dip\"\r\n        \tandroid:paddingLeft=\"5dip\">\r\n            <TextView \r\n                android:id=\"@+id/nd_fb_problem_type\"\r\n                android:layout_width=\"0dip\"\r\n        \t\tandroid:layout_height=\"wrap_content\" \r\n        \t\tandroid:textSize=\"16dip\"\r\n        \t\tandroid:textColor=\"@color/nd3_black\"\r\n        \t\tandroid:gravity=\"center_vertical\" \r\n        \t\tandroid:singleLine=\"true\"  \r\n        \t\tandroid:layout_weight=\"1\"/>\r\n            \r\n            <ImageView  \r\n\t\t        android:layout_width=\"wrap_content\"\r\n\t\t    \tandroid:layout_height=\"fill_parent\" \r\n\t\t    \tandroid:src=\"@drawable/nd3_switch_image\"/>\r\n        </LinearLayout>\r\n    </LinearLayout>\r\n    \r\n    \r\n    <LinearLayout \r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:background=\"@drawable/nd3_bk1\"\r\n        android:orientation=\"vertical\"\r\n        android:layout_marginLeft=\"10dip\"\r\n        android:layout_marginRight=\"10dip\"  >\r\n        <LinearLayout \r\n            android:layout_width=\"fill_parent\"\r\n        \tandroid:layout_height=\"wrap_content\"\r\n        \tandroid:gravity=\"center_vertical\"\r\n        \tandroid:paddingLeft=\"5dip\" >\r\n            <TextView \r\n                android:layout_width=\"wrap_content\"\r\n        \t\tandroid:layout_height=\"wrap_content\"\r\n        \t\tandroid:text=\"@string/nd_feedback_problem\"\r\n        \t\tandroid:textSize=\"16dip\"\r\n        \t\tandroid:textColor=\"@color/nd3_black\"\r\n        \t\tandroid:gravity=\"center_vertical\"/>\r\n            \r\n            <TextView \r\n                android:layout_width=\"wrap_content\"\r\n        \t\tandroid:layout_height=\"wrap_content\"\r\n        \t\tandroid:text=\"@string/nd_star\"\r\n        \t\tandroid:textColor=\"@color/nd3_red\"\r\n        \t\tandroid:gravity=\"center_vertical\"/>  \r\n            \r\n        </LinearLayout>\r\n        \r\n        \r\n        <EditText \r\n                android:id=\"@+id/nd_fb_problem\"\r\n                android:layout_width=\"fill_parent\"\r\n        \t\tandroid:layout_height=\"wrap_content\" \r\n        \t\tandroid:background=\"@drawable/nd_goods_count_input_bg\"\r\n        \t\tandroid:hint=\"@string/nd_feedback_input_tip\" \r\n        \t\tandroid:gravity=\"top\"\r\n        \t\tandroid:minLines=\"3\"\r\n        \t\tandroid:maxLength=\"500\" \r\n        \t\tandroid:nextFocusDown=\"@+id/nd_my_phone\"\r\n        \t\tandroid:imeOptions=\"actionNext\"\r\n        \t\t/> \r\n        <!-- <RelativeLayout \r\n            android:layout_width=\"fill_parent\"\r\n        \tandroid:layout_height=\"wrap_content\" \r\n        \tandroid:paddingLeft=\"5dip\"  >\r\n            <EditText \r\n                android:id=\"@+id/nd_fb_problem\"\r\n                android:layout_width=\"fill_parent\"\r\n        \t\tandroid:layout_height=\"wrap_content\" \r\n        \t\tandroid:background=\"@drawable/nd_goods_count_input_bg\"\r\n        \t\tandroid:hint=\"@string/nd_feedback_input_tip\" \r\n        \t\tandroid:gravity=\"top\"\r\n        \t\tandroid:minLines=\"4\"\r\n        \t\tandroid:layout_alignParentTop=\"true\" \r\n        \t\tandroid:maxLength=\"500\"/> \r\n            \r\n            <TextView \r\n                android:id=\"@+id/nd_fb_problem_count\"\r\n                android:layout_width=\"wrap_content\"\r\n        \t\tandroid:layout_height=\"wrap_content\" \r\n        \t\tandroid:textSize=\"12dip\"\r\n        \t\tandroid:textColor=\"@color/nd3_font_color\" \r\n        \t\tandroid:layout_alignParentRight=\"true\"\r\n        \t\tandroid:layout_alignParentBottom=\"true\"\r\n        \t\tandroid:text=\"@string/nd_feedback_input_count\"\r\n        \t\tandroid:layout_marginRight=\"5dip\"/>\r\n        </RelativeLayout>   -->  \r\n        \r\n        \r\n        <LinearLayout \r\n            android:layout_width=\"fill_parent\"\r\n        \tandroid:layout_height=\"wrap_content\"\r\n        \tandroid:gravity=\"center_vertical\"\r\n        \tandroid:padding=\"5dip\" >\r\n            <TextView \r\n                android:layout_width=\"wrap_content\"\r\n        \t\tandroid:layout_height=\"wrap_content\"\r\n        \t\tandroid:text=\"@string/nd_feedback_phoneno\"\r\n        \t\tandroid:textSize=\"16dip\"\r\n        \t\tandroid:textColor=\"@color/nd3_black\"\r\n        \t\tandroid:gravity=\"center_vertical\"/>\r\n            \r\n            <TextView \r\n                android:layout_width=\"wrap_content\"\r\n        \t\tandroid:layout_height=\"wrap_content\"\r\n        \t\tandroid:text=\"@string/nd_star\"\r\n        \t\tandroid:textColor=\"@color/nd3_red\"\r\n        \t\tandroid:gravity=\"center_vertical\"/>  \r\n            \r\n        </LinearLayout>\r\n        \r\n        <RelativeLayout \r\n            android:layout_width=\"fill_parent\"\r\n        \tandroid:layout_height=\"wrap_content\" \r\n        \t>\r\n            <EditText \r\n                android:id=\"@+id/nd_my_phone\"\r\n                android:layout_width=\"fill_parent\"\r\n        \t\tandroid:layout_height=\"wrap_content\" \r\n        \t\tandroid:background=\"@drawable/nd_goods_count_input_bg\"  \r\n        \t\tandroid:gravity=\"top\"\r\n        \t\tandroid:inputType=\"phone\"\r\n        \t\tandroid:imeOptions=\"actionDone\"/>  \r\n        </RelativeLayout> \r\n         \r\n         \r\n        <Button \r\n\t\t    android:id=\"@+id/nd_feedback_submit\"\r\n\t\t    android:layout_width=\"fill_parent\"\r\n\t\t    android:layout_height=\"wrap_content\"  \t\r\n\t\t    android:background=\"@drawable/nd_blue\"\r\n\t\t    android:text=\"@string/nd3_submit\"\r\n\t\t    android:layout_gravity=\"center\"\r\n\t\t    android:textStyle=\"bold\"\r\n\t\t    android:textSize=\"@dimen/nd3_pay_tip_text_size\"\r\n\t\t\tandroid:textColor=\"@color/nd3_white\"  \r\n\t\t\tandroid:layout_marginLeft=\"5dip\"\r\n\t\t\tandroid:layout_marginRight=\"5dip\"\r\n\t\t\tandroid:layout_marginTop=\"10dip\"  \r\n\t\t    />\r\n        \r\n    </LinearLayout>\r\n    \r\n    \r\n    <LinearLayout \r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:background=\"@drawable/nd3_bk1\" \r\n        android:layout_margin=\"10dip\" \r\n        >\r\n        <ImageView \r\n            android:layout_width=\"40dip\"\r\n\t        android:layout_height=\"40dip\"\r\n\t        android:src=\"@drawable/nd3_icon_more01\"\r\n\t        android:layout_gravity=\"center_vertical\"/>\r\n        <LinearLayout \r\n\t        android:layout_width=\"fill_parent\"\r\n\t        android:layout_height=\"wrap_content\"\r\n\t        android:orientation=\"vertical\"\r\n\t        >\r\t\t\t<LinearLayout \r\n\t\t        android:layout_width=\"fill_parent\"\r\n\t\t        android:layout_height=\"wrap_content\" \r\n\t\t        >\r\n\t            <TextView\r\n\t\t            android:layout_width=\"wrap_content\"\r\n\t\t            android:layout_height=\"50dip\"\r\n\t\t            android:layout_marginLeft=\"5dip\" \r\n\t\t            android:gravity=\"center_vertical\"\r\n\t\t            android:text=\"@string/nd_feedback_service_phone\"\r\n\t\t            android:textColor=\"@color/nd3_black\"\r\n\t\t            android:textSize=\"18dip\" />\r\n\t\t        <TextView\r\n\t\t            android:id=\"@+id/nd_fb_service_phone\"\r\n\t\t            android:layout_width=\"wrap_content\"\r\n\t\t            android:layout_height=\"50dip\"\r\n\t\t            android:layout_marginLeft=\"5dip\"\r\n\t\t            android:gravity=\"center_vertical\"\r\n\t\t            android:textColor=\"@color/nd3_black\"\r\n\t\t            android:textSize=\"18dip\" />\r\n\t        </LinearLayout>\r\n\t            \r\n\t        <TextView \r\n\t            android:id=\"@+id/nd_fb_service_time\"\r\n\t            android:layout_width=\"fill_parent\"\r\n\t    \t\tandroid:layout_height=\"wrap_content\"\r\n\t    \t\tandroid:text=\"@string/nd_feedback_service_time\"  \r\n\t    \t\tandroid:textColor=\"@color/nd_font_color\"\r\n\t    \t\tandroid:layout_marginLeft=\"5dip\"/>\r\n        </LinearLayout>\r\n    </LinearLayout>    \r\n\r\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation=\"vertical\">\n\t\n   <LinearLayout\n\t    android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"0dip\"  \n\t\tandroid:layout_weight=\"1\" \n\t\tandroid:layout_margin=\"5dip\" >\n\t\n       <ListView \n          android:id=\"@+id/nd_feedback_menu_list\"\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\" \n\t\t  android:headerDividersEnabled=\"false\"\n\t\t  android:footerDividersEnabled=\"false\"\n\t\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t\t  android:fastScrollEnabled=\"true\"\n\t\t  android:cacheColorHint=\"#00000000\"\n\t\t  android:fadingEdge=\"none\"  \n\t\t  android:scrollbarStyle=\"outsideOverlay\"\n\t\t  android:background=\"@drawable/nd3_bk1\" \n\t\t  /> \n       \n    </LinearLayout>   \n   \n   <LinearLayout\n    android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" \n\tandroid:orientation=\"vertical\"  \n\tandroid:layout_margin=\"5dip\" >  \n\t      <TextView \n\t        android:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\"  \n\t\t    android:text=\"@string/nd_feedback_reply8\"\n\t\t    android:textColor=\"@color/nd_orange_light\"\n\t\t    android:textSize=\"16dip\"/>\n\t      <Button \n\t\t    android:id=\"@+id/nd_feedback\"\n\t\t    android:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\"  \t\n\t\t    android:background=\"@drawable/nd_blue\"\n\t\t    android:text=\"@string/nd_feedback_i_fb\"\n\t\t    android:layout_gravity=\"center\"\n\t\t    android:textStyle=\"bold\"\n\t\t    android:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"   \n\t\t    />\n    </LinearLayout>\n    \n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"40dip\" \n     >\n    \n    <TextView \n        android:id=\"@+id/nd_menu_content\"\n        android:layout_width=\"fill_parent\"\n    \tandroid:layout_height=\"40dip\"\n    \tandroid:layout_alignParentLeft=\"true\"\n    \tandroid:layout_centerVertical=\"true\"\n    \tandroid:ellipsize=\"end\"\n    \tandroid:singleLine=\"true\" \n    \tandroid:textSize=\"18dip\"\n    \tandroid:textStyle=\"bold\"\n    \tandroid:textColor=\"@color/nd3_black\" \n    \tandroid:gravity=\"center_vertical\"/>\n    \n    <ImageView  \n        android:layout_width=\"wrap_content\"\n    \tandroid:layout_height=\"fill_parent\"\n    \tandroid:layout_alignParentRight=\"true\"\n    \tandroid:layout_centerVertical=\"true\"  \n    \tandroid:src=\"@drawable/nd3_switch_image\"/>\n\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"60dip\" \n\tandroid:layout_margin=\"@dimen/nd3_margin_size\" \n\t>\n    \n    <LinearLayout \n        android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:orientation=\"vertical\"\n\t\tandroid:layout_weight=\"1\"\n\t\tandroid:layout_margin=\"5dip\">\n        <TextView \n            android:id=\"@+id/nd_title\"\n            android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"0dip\" \n\t\t\tandroid:textColor=\"@color/nd3_black\"\n\t\t\tandroid:textSize=\"16dip\"\n\t\t\tandroid:textStyle=\"bold\"\n\t\t\tandroid:singleLine=\"true\" \n\t\t\tandroid:layout_weight=\"1\" />\n        <TextView \n            android:id=\"@+id/nd_time\"\n            android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:textColor=\"@color/nd_font_color\"\n\t\t\tandroid:textSize=\"12dip\"\n\t\t\tandroid:textStyle=\"bold\"  />\n    </LinearLayout>\n    \n    <LinearLayout \n        android:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"fill_parent\"\n\t\tandroid:layout_gravity=\"center\"\n\t\tandroid:layout_margin=\"5dip\">\n        <TextView \n            android:id=\"@+id/nd_pj\"\n            android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:textColor=\"@color/nd_font_color\"\n\t\t\tandroid:textSize=\"16dip\" \n\t\t\tandroid:layout_gravity=\"center\"/>\n        <ImageView  \n\t        android:layout_width=\"wrap_content\"\n\t    \tandroid:layout_height=\"wrap_content\" \n\t    \tandroid:scaleType=\"fitCenter\"\n\t    \tandroid:src=\"@drawable/nd3_switch_image\"\n\t    \tandroid:layout_gravity=\"center\"/>\n    </LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\"  \n\tandroid:orientation=\"vertical\"\n\t >\n    <LinearLayout\n        android:layout_margin=\"@dimen/nd3_margin_size\"\n\t    android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"0dip\"  \n\t\tandroid:layout_weight=\"1\"  >\n\t    <ListView\n\t          android:id=\"@+id/nd_feedback_list\"\n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"wrap_content\" \n\t\t\t  android:headerDividersEnabled=\"false\"\n\t\t\t  android:footerDividersEnabled=\"false\"\n\t\t\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t\t\t  android:fastScrollEnabled=\"true\"\n\t\t\t  android:cacheColorHint=\"#00000000\"\n\t\t\t  android:fadingEdge=\"none\" \n\t\t\t  android:background=\"@drawable/nd3_bk1\" \n\t\t\t  android:visibility=\"gone\" \n\t\t\t  />\n\t    <TextView \n\t         android:id=\"@+id/nd_tips\"\n\t         android:layout_width=\"fill_parent\"\n\t\t\t android:layout_height=\"wrap_content\" \n\t\t\t android:text=\"@string/nd_feedback_tips4\" \n\t\t\t android:background=\"@drawable/nd3_bk1\"\n\t\t\t android:gravity=\"center\" \n\t\t\t android:visibility=\"gone\"\n\t\t\t />\n    </LinearLayout>\n\n    <Button \n        android:layout_margin=\"@dimen/nd3_margin_size\"\n\t    android:id=\"@+id/nd_feedback\"\n\t    android:layout_width=\"fill_parent\"\n\t    android:layout_height=\"wrap_content\"  \t\n\t    android:background=\"@drawable/nd_blue\"\n\t    android:text=\"@string/nd_feedback_i_fb\"\n\t    android:layout_gravity=\"center\"\n\t    android:textStyle=\"bold\"\n\t    android:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\tandroid:textColor=\"@color/nd3_white\"   \n\t    />\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_landscape.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\" \n        android:orientation=\"vertical\"\n        ><!-- android:visibility=\"gone\"  -->\n        <LinearLayout \n            android:layout_width=\"fill_parent\"\n        \tandroid:layout_height=\"wrap_content\"\n        \tandroid:gravity=\"center\" \n        \tandroid:orientation=\"vertical\">\n            <TextView \n                android:layout_width=\"wrap_content\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:text=\"@string/nd_feedback_reply1\"\n        \t\tandroid:textSize=\"14dip\"\n        \t\tandroid:textColor=\"@color/nd3_black\"\n        \t\tandroid:gravity=\"center\"/>\n            \n            <TextView \n                android:layout_width=\"wrap_content\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:text=\"@string/nd_feedback_reply2\"\n        \t\tandroid:textSize=\"14dip\"\n        \t\tandroid:textColor=\"@color/nd3_black\"\n        \t\tandroid:gravity=\"center\"/>\n        </LinearLayout>\n        <ImageView\n              android:layout_width=\"fill_parent\"\n              android:layout_height=\"wrap_content\"\n              android:background=\"@drawable/nd3_horizontal_line\" />\n        \n        <!-- <LinearLayout \n            android:id=\"@+id/nd_fb_problem_type_layout\"\n            android:layout_width=\"fill_parent\"\n        \tandroid:layout_height=\"wrap_content\"\n        \tandroid:gravity=\"center_vertical\" \n        \tandroid:weightSum=\"3\">\n             \n            <ImageView  \n                android:id=\"@+id/nd_image1\"\n\t\t        android:layout_width=\"48dip\"\n\t\t    \tandroid:layout_height=\"48dip\" \n\t\t    \tandroid:src=\"@drawable/nd_satisfied\"\n\t\t    \tandroid:layout_weight=\"1\"/>\n            \n            <ImageView  \n                android:id=\"@+id/nd_image2\"\n\t\t        android:layout_width=\"48dip\"\n\t\t    \tandroid:layout_height=\"48dip\" \n\t\t    \tandroid:src=\"@drawable/nd_ordinary\"\n\t\t    \tandroid:layout_weight=\"1\"/>\n            \n            <ImageView  \n                android:id=\"@+id/nd_image3\"\n\t\t        android:layout_width=\"48dip\"\n\t\t    \tandroid:layout_height=\"48dip\" \n\t\t    \tandroid:src=\"@drawable/nd_unsatisfied\"\n\t\t    \tandroid:layout_weight=\"1\"/>\n        </LinearLayout> -->\n        \n        \n        <RadioGroup \n            android:id=\"@+id/nd_radiogroup\"\n            android:layout_width=\"fill_parent\"\n        \tandroid:layout_height=\"wrap_content\"\n        \tandroid:gravity=\"center\"\n        \tandroid:layout_gravity=\"center\"\n        \tandroid:orientation=\"horizontal\" \n        \tandroid:weightSum=\"3\"\n        \tandroid:checkedButton=\"@+id/nd_radio_2\">\n            <LinearLayout \n                android:layout_width=\"0dip\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:layout_weight=\"1\"\n        \t\tandroid:gravity=\"center\">\n        \t\t<ImageView  \n\t                android:id=\"@+id/nd_image1\"\n\t\t\t        android:layout_width=\"48dip\"\n\t\t\t    \tandroid:layout_height=\"48dip\" \n\t\t\t    \tandroid:src=\"@drawable/nd_satisfied\"/>\n                <RadioButton \n\t                android:id=\"@+id/nd_radio_1\"\n\t                android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"  \n\t        \t\tandroid:button=\"@null\"\n\t        \t\tandroid:background=\"@null\" \n\t        \t\tandroid:gravity=\"top|center_horizontal\" \n\t        \t\tandroid:textSize=\"14dip\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply3\" \n\t        \t\tandroid:textColor=\"@color/nd3_black\"/>\n                <!-- android:drawableLeft=\"@drawable/nd3_regist_checked\"  --> \n                \t\n\t        \t<!-- <TextView \n\t        \t    android:id=\"@+id/nd_text1\"\n\t        \t    android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"\n\t        \t\tandroid:paddingLeft=\"5dip\"\n\t        \t\tandroid:textColor=\"@color/nd3_black\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply3\"/>\t --> \n            </LinearLayout>\n            \n            <LinearLayout \n                android:layout_width=\"0dip\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:layout_weight=\"1\"\n        \t\tandroid:gravity=\"center\">\n\t        \t<ImageView  \n\t                android:id=\"@+id/nd_image2\"\n\t\t\t        android:layout_width=\"48dip\"\n\t\t\t    \tandroid:layout_height=\"48dip\" \n\t\t\t    \tandroid:src=\"@drawable/nd_ordinary\"/>\n\t            <RadioButton \n\t                android:id=\"@+id/nd_radio_2\"\n\t                android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"  \n\t        \t\tandroid:button=\"@null\"\n\t        \t\tandroid:background=\"@null\" \n\t        \t\tandroid:gravity=\"top|center_horizontal\" \n\t        \t\tandroid:textSize=\"14dip\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply4\" \n\t        \t\tandroid:textColor=\"@color/nd3_black\"/>\n\t            <!-- android:drawableLeft=\"@drawable/nd3_regist_checked\"  -->\n\t            \n\t            <!-- <TextView \n\t                android:id=\"@+id/nd_text2\"\n\t        \t    android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"\n\t        \t\tandroid:paddingLeft=\"5dip\"\n\t        \t\tandroid:textColor=\"@color/nd3_black\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply4\"/>\t -->\n\t        \t \t\n            </LinearLayout>\n            \n            <LinearLayout \n                android:layout_width=\"0dip\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:layout_weight=\"1\"\n        \t\tandroid:gravity=\"center\">\n\t            <ImageView  \n\t                android:id=\"@+id/nd_image3\"\n\t\t\t        android:layout_width=\"48dip\"\n\t\t\t    \tandroid:layout_height=\"48dip\" \n\t\t\t    \tandroid:src=\"@drawable/nd_unsatisfied\"/>\n\t            <RadioButton \n\t                android:id=\"@+id/nd_radio_3\"\n\t                android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"  \n\t        \t\tandroid:button=\"@null\"\n\t        \t\tandroid:background=\"@null\" \n\t        \t\tandroid:gravity=\"top|center_horizontal\"  \n\t        \t\tandroid:textSize=\"14dip\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply5\" \n\t        \t\tandroid:textColor=\"@color/nd3_black\"/>\n\t            <!-- android:drawableLeft=\"@drawable/nd3_regist_checked\"  -->\n\t            \n\t            <!-- <TextView \n\t                android:id=\"@+id/nd_text3\"\n\t        \t    android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"\n\t        \t\tandroid:paddingLeft=\"5dip\"\n\t        \t\tandroid:textColor=\"@color/nd3_black\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply5\"/> -->\t\n\t        \t\t\n            </LinearLayout>\n            \n        </RadioGroup>\n        \n        \n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_portrait.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\" \n        android:orientation=\"vertical\"\n        ><!-- android:visibility=\"gone\"  -->\n        <LinearLayout \n            android:layout_width=\"fill_parent\"\n        \tandroid:layout_height=\"wrap_content\"\n        \tandroid:gravity=\"center\"\n        \tandroid:padding=\"5dip\"\n        \tandroid:orientation=\"vertical\">\n            <TextView \n                android:layout_width=\"wrap_content\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:text=\"@string/nd_feedback_reply1\"\n        \t\tandroid:textSize=\"14dip\"\n        \t\tandroid:textColor=\"@color/nd3_black\"\n        \t\tandroid:gravity=\"center\"/>\n            \n            <TextView \n                android:layout_width=\"wrap_content\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:text=\"@string/nd_feedback_reply2\"\n        \t\tandroid:textSize=\"14dip\"\n        \t\tandroid:textColor=\"@color/nd3_black\"\n        \t\tandroid:gravity=\"center\"/>\n        </LinearLayout>\n        <ImageView\n              android:layout_width=\"fill_parent\"\n              android:layout_height=\"wrap_content\"\n              android:background=\"@drawable/nd3_horizontal_line\" />\n        \n        <LinearLayout \n            android:id=\"@+id/nd_fb_problem_type_layout\"\n            android:layout_width=\"fill_parent\"\n        \tandroid:layout_height=\"wrap_content\"\n        \tandroid:gravity=\"center_vertical\" \n        \tandroid:weightSum=\"3\">\n             \n            <ImageView  \n                android:id=\"@+id/nd_image1\"\n\t\t        android:layout_width=\"48dip\"\n\t\t    \tandroid:layout_height=\"48dip\" \n\t\t    \tandroid:src=\"@drawable/nd_satisfied\"\n\t\t    \tandroid:layout_weight=\"1\"/>\n            \n            <ImageView  \n                android:id=\"@+id/nd_image2\"\n\t\t        android:layout_width=\"48dip\"\n\t\t    \tandroid:layout_height=\"48dip\" \n\t\t    \tandroid:src=\"@drawable/nd_ordinary\"\n\t\t    \tandroid:layout_weight=\"1\"/>\n            \n            <ImageView  \n                android:id=\"@+id/nd_image3\"\n\t\t        android:layout_width=\"48dip\"\n\t\t    \tandroid:layout_height=\"48dip\" \n\t\t    \tandroid:src=\"@drawable/nd_unsatisfied\"\n\t\t    \tandroid:layout_weight=\"1\"/>\n        </LinearLayout>\n        \n        \n        <RadioGroup \n            android:id=\"@+id/nd_radiogroup\"\n            android:layout_width=\"fill_parent\"\n        \tandroid:layout_height=\"wrap_content\"\n        \tandroid:gravity=\"center\"\n        \tandroid:layout_gravity=\"center\"\n        \tandroid:orientation=\"horizontal\" \n        \tandroid:weightSum=\"3\"\n        \tandroid:checkedButton=\"@+id/nd_radio_2\"\n        \tandroid:layout_marginBottom=\"5dip\">\n            <LinearLayout \n                android:layout_width=\"0dip\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:layout_weight=\"1\"\n        \t\tandroid:gravity=\"center\">\n                <RadioButton \n\t                android:id=\"@+id/nd_radio_1\"\n\t                android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"  \n\t        \t\tandroid:button=\"@null\"\n\t        \t\tandroid:background=\"@null\" \n\t        \t\tandroid:gravity=\"top|center_horizontal\" \n\t        \t\tandroid:textSize=\"14dip\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply3\" \n\t        \t\tandroid:textColor=\"@color/nd3_black\"/> \n\t        \t\t<!-- android:drawableLeft=\"@drawable/nd3_regist_checked\"  -->\n\t        \t<!-- <TextView \n\t        \t    android:id=\"@+id/nd_text1\"\n\t        \t    android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"\n\t        \t\tandroid:paddingLeft=\"5dip\"\n\t        \t\tandroid:textColor=\"@color/nd3_black\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply3\"/>\t -->\n            </LinearLayout>\n            \n            <LinearLayout \n                android:layout_width=\"0dip\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:layout_weight=\"1\"\n        \t\tandroid:gravity=\"center\">\n\t            <RadioButton \n\t                android:id=\"@+id/nd_radio_2\"\n\t                android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"  \n\t        \t\tandroid:button=\"@null\"\n\t        \t\tandroid:background=\"@null\" \n\t        \t\tandroid:gravity=\"top|center_horizontal\" \n\t        \t\tandroid:textSize=\"14dip\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply4\" \n\t        \t\tandroid:checked=\"true\"\n\t        \t\tandroid:textColor=\"@color/nd3_black\"/>\n\t            <!-- android:drawableLeft=\"@drawable/nd3_regist_checked\"  -->\n\t            <!-- <TextView \n\t                android:id=\"@+id/nd_text2\"\n\t        \t    android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"\n\t        \t\tandroid:paddingLeft=\"5dip\"\n\t        \t\tandroid:textColor=\"@color/nd3_black\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply4\"/>\t -->\n            </LinearLayout>\n            \n            <LinearLayout \n                android:layout_width=\"0dip\"\n        \t\tandroid:layout_height=\"wrap_content\"\n        \t\tandroid:layout_weight=\"1\"\n        \t\tandroid:gravity=\"center\">\n\t            <RadioButton \n\t                android:id=\"@+id/nd_radio_3\"\n\t                android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"  \n\t        \t\tandroid:button=\"@null\"\n\t        \t\tandroid:background=\"@null\" \n\t        \t\tandroid:gravity=\"top|center_horizontal\"   \n\t        \t\tandroid:text=\"@string/nd_feedback_reply5\"\n\t        \t\tandroid:textSize=\"14dip\" \n\t        \t\tandroid:textColor=\"@color/nd3_black\"/>\n\t            <!-- android:drawableLeft=\"@drawable/nd3_regist_checked\"  -->\n\t           <!--  <TextView \n\t                android:id=\"@+id/nd_text3\"\n\t        \t    android:layout_width=\"wrap_content\"\n\t        \t\tandroid:layout_height=\"wrap_content\"\n\t        \t\tandroid:paddingLeft=\"5dip\"\n\t        \t\tandroid:textColor=\"@color/nd3_black\"\n\t        \t\tandroid:text=\"@string/nd_feedback_reply5\"/>\t -->\n            </LinearLayout>\n            \n        </RadioGroup>\n        \n        \n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n    \n    <LinearLayout\n        android:id=\"@+id/nd_pjlayout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_bk1\"\n        android:orientation=\"vertical\"\n        android:layout_marginTop=\"5dip\"\n        android:layout_marginLeft=\"5dip\"\n        android:layout_marginRight=\"5dip\" \n        android:visibility=\"gone\" \n        android:clickable=\"false\"\n        ><!-- android:visibility=\"gone\"  -->\n        \n        <!-- <include layout=\"@layout/nd_feedback_pj_landscape\"/>  -->\n    </LinearLayout>    \n    \n    \n    <LinearLayout \n        android:id=\"@+id/nd_reply_layout\"\n\t    android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\tandroid:layout_margin=\"5dip\" \n\t\tandroid:orientation=\"vertical\" \n\t\t><!-- android:visibility=\"gone\"  -->>\n\t    \n\t    <ListView\n\t          android:id=\"@+id/nd_feedback_reply_list\"\n\t\t\t  android:layout_width=\"fill_parent\"\n\t\t\t  android:layout_height=\"0dip\" \n\t\t\t  android:headerDividersEnabled=\"false\"\n\t\t\t  android:footerDividersEnabled=\"false\" \n\t\t\t  android:fastScrollEnabled=\"true\"\n\t\t\t  android:cacheColorHint=\"#00000000\"\n\t\t\t  android:fadingEdge=\"none\"\n\t\t\t  android:layout_weight=\"1\"\n\t\t\t  android:stackFromBottom=\"true\"\n              android:transcriptMode=\"alwaysScroll\"\n              android:divider=\"@null\"\n              />\n\t\n\t    \n\t     \n\t</LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_bottom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n    \n    <LinearLayout \n\t        android:id=\"@+id/nd_feedback\"\n\t\t    android:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\"  \n\t\t    android:layout_marginBottom=\"5dip\"\n\t\t    android:layout_marginTop=\"10dip\"\n\t        >\n\t        <EditText \n                android:id=\"@+id/nd_input\"\n                android:layout_width=\"0dip\"\n        \t\tandroid:layout_height=\"wrap_content\" \n        \t\tandroid:background=\"@drawable/nd_goods_count_input_bg\"  \n        \t\tandroid:gravity=\"top\"\n        \t\tandroid:layout_weight=\"1\"\n        \t\tandroid:layout_marginRight=\"20dip\"\n        \t\tandroid:layout_marginTop=\"3dip\"/>  \n        \t\t\n\t        <Button \n\t            android:id=\"@+id/nd_submit\"\n                android:layout_width=\"wrap_content\"\n        \t\tandroid:layout_height=\"wrap_content\" \n\t            android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n\t            android:paddingLeft=\"10dip\"\n\t            android:paddingRight=\"10dip\"\n\t            android:layout_marginRight=\"5dip\"\n\t            android:text=\"@string/nd3_submit\"\n\t            android:textColor=\"@color/nd3_white\"\n\t            android:textSize=\"18dip\"\n\t            android:textStyle=\"bold\"/>\n\t</LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_left.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n    \n    <LinearLayout \n        android:layout_width=\"fill_parent\"\n    \tandroid:layout_height=\"wrap_content\"\n    \tandroid:gravity=\"center\">\n    \t<ImageView \n    \t    android:layout_width=\"60dip\"\n    \t\tandroid:layout_height=\"wrap_content\"\n    \t\tandroid:layout_marginRight=\"10dip\"\n    \t\tandroid:background=\"@drawable/nd3_horizontal_line\" />\n    \t<TextView \n    \t    android:id=\"@+id/nd_time\"\n    \t    android:layout_width=\"wrap_content\"\n    \t\tandroid:layout_height=\"wrap_content\" \n    \t\tandroid:textColor=\"@color/nd3_black\"\n    \t\tandroid:gravity=\"center\"/>\n    \t<ImageView \n    \t    android:layout_width=\"60dip\"\n    \t\tandroid:layout_height=\"wrap_content\"\n    \t\tandroid:layout_marginLeft=\"10dip\"\n    \t\tandroid:background=\"@drawable/nd3_horizontal_line\" />\n        \n    </LinearLayout>\n    \n    <LinearLayout \n        android:layout_width=\"fill_parent\"\n    \tandroid:layout_height=\"wrap_content\"\n    \tandroid:gravity=\"bottom\">\n        <ImageView \n            android:id=\"@+id/nd_head\"\n            android:layout_width=\"48dip\"\n    \t\tandroid:layout_height=\"48dip\"\n    \t\tandroid:src=\"@drawable/nd3_default_portrait_big\"\n    \t\tandroid:layout_marginLeft=\"5dip\"/>\n        <TextView \n            android:id=\"@+id/nd_msge\"\n            android:layout_width=\"match_parent\"\n    \t\tandroid:layout_height=\"wrap_content\"\n    \t\tandroid:background=\"@drawable/nd3_msge_owen\" \n    \t\tandroid:textColor=\"@color/nd3_black\"\n    \t\tandroid:layout_marginRight=\"20dip\"\n    \t\t/>\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_right.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n    \n    <LinearLayout \n        android:layout_width=\"fill_parent\"\n    \tandroid:layout_height=\"wrap_content\"\n    \tandroid:gravity=\"center\">\n    \t<ImageView \n    \t    android:layout_width=\"60dip\"\n    \t\tandroid:layout_height=\"wrap_content\"\n    \t\tandroid:layout_marginRight=\"10dip\"\n    \t\tandroid:background=\"@drawable/nd3_horizontal_line\" />\n    \t<TextView \n    \t    android:id=\"@+id/nd_time\"\n    \t    android:layout_width=\"wrap_content\"\n    \t\tandroid:layout_height=\"wrap_content\" \n    \t\tandroid:textColor=\"@color/nd3_black\"\n    \t\tandroid:gravity=\"center\"/>\n    \t<ImageView \n    \t    android:layout_width=\"60dip\"\n    \t\tandroid:layout_height=\"wrap_content\"\n    \t\tandroid:layout_marginLeft=\"10dip\"\n    \t\tandroid:background=\"@drawable/nd3_horizontal_line\" />\n        \n    </LinearLayout>\n    \n    <LinearLayout \n        android:layout_width=\"fill_parent\"\n    \tandroid:layout_height=\"wrap_content\"\n    \tandroid:gravity=\"bottom\"> \n        <TextView \n            android:id=\"@+id/nd_msge\"\n            android:layout_width=\"0dip\"\n    \t\tandroid:layout_height=\"wrap_content\"\n    \t\tandroid:background=\"@drawable/nd3_msge_friend\" \n    \t\tandroid:textColor=\"@color/nd3_black\"\n    \t\tandroid:layout_marginLeft=\"20dip\"\n    \t\tandroid:layout_weight=\"1\"\n    \t\t/>\n        <ImageView \n            android:id=\"@+id/nd_head\"\n            android:layout_width=\"48dip\"\n    \t\tandroid:layout_height=\"48dip\"\n    \t\tandroid:src=\"@drawable/nd_service\"\n    \t\tandroid:layout_marginRight=\"5dip\"/>\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_find_password.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_find_password_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\t <!-- 提示 -->\n\t\t<TextView  \n\t\t    android:id=\"@+id/nd_find_password_tips\"\n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:gravity=\"center\"\n\t\t\tandroid:text=\"@string/nd_find_password_tips\" \n\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\tstyle=\"@style/nd3_photo_margin_style\"\n\t\t\tandroid:textStyle=\"bold\"\n\t\t\t>\n\t\t</TextView>\n  \t \n    \n\t\t\t\t<LinearLayout \n\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t\t    android:orientation=\"vertical\" \n\t\t\t\t    style=\"@style/nd3_photo_margin_style\">\n\t\n\t\t\t\t    <!-- 提示 -->\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_find_password_enter_account_tip\"\n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\t\n\t\t\t\t\t<!-- 编辑框 -->\n\t\t\t\t\t<EditText\n\t\t\t            android:id=\"@+id/nd_find_password_bind_edit_account\"\n\t\t\t            android:textSize=\"16.0sp\"\n\t\t\t            android:layout_width=\"fill_parent\"\n\t\t\t            android:layout_height=\"wrap_content\" \n\t\t\t            android:singleLine=\"true\" >\n\t\t\t        </EditText>\t\t\t\t\t    \t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\n\t\t\t\t<!-- 请输入收到的短信验证码 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t    android:id=\"@+id/nd_bind_group_code\"\n\t\t\t\t    style=\"@style/nd3_photo_margin_style\"\n\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t\t    >\n\t\t\t\t\t<LinearLayout \n\t\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\t\t    android:layout_height=\"wrap_content\" \n\t\t\t\t\t    android:layout_weight=\"0.8\"\n\t\t\t\t\t    android:orientation=\"vertical\">\n\t\t\t\t\t      <!-- 提示 -->\n\t\t\t\t\t\t\t<TextView\n\t\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\t\t\t\t\tandroid:text=\"@string/nd_find_password_enter_number_tip\"\n\t\t\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</TextView>\n\t\t\t\t\t\n\t\t\t\t\t\t\t<!-- 编辑框 -->\n\t\t\t\t\t\t\t<EditText\n\t\t\t\t\t            android:id=\"@+id/nd_find_password_bind_edit_phone_number\"\n\t\t\t\t\t            android:textSize=\"16.0sp\"\n\t\t\t\t\t            android:layout_width=\"fill_parent\"\n\t\t\t\t\t            android:layout_height=\"wrap_content\" \n\t\t\t\t\t            android:inputType=\"phone\" \n\t\t\t\t\t            android:singleLine=\"true\" >\n\t\t\t\t\t        </EditText>\t\n\t\t\t\t    \t\t\n\t\t\t\t\t</LinearLayout>\n\t\t\t\t\t    \n\t\t\t\t\t<!-- 和 -->\n\t\t\t\t\t<LinearLayout \n\t\t\t\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t\t\t    \tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t    \tandroid:gravity=\"center_horizontal\" \n\t\t\t\t\t    \tandroid:orientation=\"vertical\">\n\t\t\t\t\t\t\t<TextView\n\t\t\t\t\t\t\t    android:id=\"@+id/nd_find_password_gain_text\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"@color/nd3_balance_color\"\t\n\t\t\t\t\t\t\t\tandroid:visibility=\"invisible\"\n\t\t\t\t\t\t\t\tandroid:gravity=\"right\"/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<Button \n\t\t\t\t\t\t\t    android:id=\"@+id/nd_find_password_gain\"\n\t\t\t\t\t\t    \tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:text=\"@string/nd_find_password_gain_code\"\n\t\t\t\t\t\t\t\tandroid:background=\"@drawable/nd_white_btn\" \n\t\t\t\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_margin_size\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"@color/nd3_font_color\"\n\t\t\t\t\t\t\t\t/>    \n\t\t\t\t\t</LinearLayout>\n\t\t\t\t</LinearLayout>\n\t\t\t\t<LinearLayout\n\t\t\t\t    style=\"@style/nd3_photo_margin_style\"\n\t\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t\t    android:orientation=\"vertical\" >\n\t\t\t\t\t<!-- 提示 -->\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_find_password_enter_code_tip\"\n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\t\t\t<!-- 编辑框 -->\n\t\t\t\t\t<EditText\n\t\t\t            android:id=\"@+id/nd_find_password_bind_edit_code\" \n\t\t\t            android:layout_width=\"fill_parent\"\n\t\t\t            android:layout_height=\"wrap_content\"\n\t\t\t            android:layout_weight=\"1.0\" \n\t\t\t            android:singleLine=\"true\" />\n\t\t\t\t    \t\t\t\t    \t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t <!-- 绑定手机 -->\t\t\t\t\n\t\t\t\t<Button \n\t\t\t\t    android:id=\"@+id/nd_find_password_bind\"\n\t\t\t    \tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_find_password_confirm\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd3_pay_tip_text_size\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\"\n\t\t\t\t\tandroid:background=\"@drawable/nd_blue\"\n\t\t\t\t\tandroid:layout_gravity=\"center\"\n\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd_10\"\n\t\t\t\t\t/>      \n\t\t\t\t\t\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_bind_phone_reason\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd_20\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd_10\" \n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\"\n\t\t\t\t\t/>\n\t\t\t\t<TextView\n\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/nd_find_password_botton_tips\"\n\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\tandroid:textColor=\"@color/nd3_white\" \n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\"\n\t\t\t\t\t/>\n\t\t\t   \t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_custom_toast.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/llToast\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"#ffffffff\"\n    android:orientation=\"vertical\" >\n\n    <TextView\n        android:id=\"@+id/tvTitleToast\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"1dip\"\n        android:background=\"#bb000000\"\n        android:gravity=\"center\"\n        android:textColor=\"#ffffffff\" />\n\n    <LinearLayout\n        android:id=\"@+id/llToastContent\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"1dip\"\n        android:layout_marginLeft=\"1dip\"\n        android:layout_marginRight=\"1dip\"\n        android:background=\"#44000000\"\n        android:orientation=\"vertical\"\n        android:padding=\"15dip\" >\n\n        <ImageView\n            android:id=\"@+id/tvImageToast\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\" />\n\n        <TextView\n            android:id=\"@+id/tvTextToast\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center\"\n            android:paddingLeft=\"10dip\"\n            android:paddingRight=\"10dip\"\n            android:textColor=\"#ff000000\" />\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_exitpage.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\" \n    android:gravity=\"center\"\n    android:background=\"@color/nd_gcsdk_translucent\"\n    >\n    <LinearLayout \n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\n        >\n\t    <!-- 头部 -->\n\t    <LinearLayout \n\t        android:layout_width=\"310dip\"\n\t        android:layout_height=\"48dip\"\n\t        android:orientation=\"horizontal\"\n\t        android:gravity=\"center_vertical\"\n\t        android:background=\"@drawable/nd_gcsdk_box_tit_bg\"\n\t        >\n\t        <!-- 标题 -->\n\t        <TextView \n\t            android:id=\"@+id/txt_title\"\n\t            android:layout_width=\"0dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:layout_weight=\"1\"\n\t            android:paddingLeft=\"14dip\"\n\t            android:paddingRight=\"14dip\"\n\t\t        android:singleLine=\"true\"\n\t\t        android:ellipsize=\"end\"\n\t            android:text=\"@string/nd_gcsdk_pausepage_title\"\n\t            android:textSize=\"20sp\"\n\t            android:textStyle=\"bold\"\n\t            android:textColor=\"@color/nd_gcsdk_android_white\"\n\t            android:gravity=\"center_vertical\"\n\t            />\n\t        <View \n\t            android:layout_width=\"1dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:layout_marginTop=\"3dip\"\n\t            android:layout_marginBottom=\"3dip\"\n\t            android:background=\"@drawable/nd_gcsdk_box_title_line\"\n\t            />\n\t        <ImageButton \n\t            android:id=\"@+id/imgbtn_close\"\n\t            android:layout_width=\"48dip\"\n\t            android:layout_height=\"48dip\"\n\t            android:padding=\"3dip\"\n\t            android:src=\"@drawable/nd_gcsdk_box_close\"\n\t            android:background=\"@color/nd_gcsdk_transparent\"\n\t            />\n\t    </LinearLayout>\n\t    <!-- 广告 -->\n\t    <RelativeLayout \n\t        android:id=\"@+id/rlt_ad\"\n\t        android:layout_width=\"310dip\"\n\t        android:layout_height=\"150dip\"\n\t        >\n\t        <!-- 图片 -->\n\t\t\t<ImageView \n\t\t\t    android:id=\"@+id/img_ad\"\n\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t    android:layout_height=\"fill_parent\"\n\t\t\t    android:scaleType=\"fitXY\"\n\t\t\t    android:padding=\"2dip\"\n\t\t\t    android:src=\"@drawable/nd_gcsdk_image_default\"\n\t\t        android:background=\"@color/nd_gcsdk_box_bg\"\n\t\t\t    />\n\t\t\t<TextView \n\t\t\t    android:id=\"@+id/txt_summary\"\n\t\t        android:layout_width=\"fill_parent\"\n\t\t        android:layout_height=\"wrap_content\"\n\t\t        android:layout_alignParentBottom=\"true\"\n\t\t        android:padding=\"3dip\"\n\t\t        android:singleLine=\"true\"\n\t\t        android:ellipsize=\"end\"\n\t\t        android:textSize=\"15sp\"\n\t\t        android:textStyle=\"bold\"\n\t\t        android:textColor=\"@color/nd_gcsdk_android_white\"\n\t\t        android:gravity=\"center\"\n\t\t        android:background=\"@color/nd_gcsdk_translucent\"\n\t\t\t    />\n\t    </RelativeLayout>\n\t\t<!-- 靓点推荐 -->\n\t\t<TableLayout \n\t\t    android:id=\"@+id/table_project\"\n\t        android:layout_width=\"310dip\"\n\t        android:layout_height=\"150dip\"\n\t        android:background=\"@color/nd_gcsdk_box_bg\"\n\t        >\n\t        <TableRow \n\t            android:layout_width=\"fill_parent\"\n\t            android:layout_height=\"0dip\"\n\t            android:layout_weight=\"1\"\n\t            >\n\t            <!-- 1号位 -->\n\t\t        <com.nd.commplatform.gc.widget.NdProjectView \n\t\t\t        android:id=\"@+id/pv_1\"\n\t\t\t        android:layout_width=\"0dip\"\n\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t        android:layout_weight=\"1\"\n\t        \t\tandroid:padding=\"2dip\"\n\t\t\t        />\n\t\t        <!-- 2号位 -->\n\t\t        <com.nd.commplatform.gc.widget.NdProjectView\n\t\t\t        android:id=\"@+id/pv_2\"\n\t\t\t        android:layout_width=\"0dip\"\n\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t        android:layout_weight=\"1\"\n\t        \t\tandroid:padding=\"2dip\"\n\t\t\t        />\n\t        </TableRow>\n\t        <TableRow \n\t            android:layout_width=\"fill_parent\"\n\t            android:layout_height=\"0dip\"\n\t            android:layout_weight=\"1\"\n\t            >\n\t            <!-- 3号位 -->\n\t\t        <com.nd.commplatform.gc.widget.NdProjectView \n\t\t\t        android:id=\"@+id/pv_3\"\n\t\t\t        android:layout_width=\"0dip\"\n\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t        android:layout_weight=\"1\"\n\t\t\t        android:padding=\"2dip\"\n\t\t\t        />\n\t\t        <!-- 4号位 -->\n\t\t        <com.nd.commplatform.gc.widget.NdProjectView \n\t\t\t        android:id=\"@+id/pv_4\"\n\t\t\t        android:layout_width=\"0dip\"\n\t\t\t        android:layout_height=\"wrap_content\"\n\t\t\t        android:layout_weight=\"1\"\n\t\t\t        android:padding=\"2dip\"\n\t\t\t        />\n\t        </TableRow>\n\t    </TableLayout>\n\t\t<!-- 底部 -->\n\t\t<LinearLayout \n\t\t    android:layout_width=\"310dip\"\n\t\t    android:layout_height=\"61dip\"\n\t        android:background=\"@drawable/nd_gcsdk_box_bg\"\n\t        android:gravity=\"center\"\n\t\t    >\n\t\t    <Button \n\t\t        android:id=\"@+id/btn_exit\"\n\t\t        android:layout_width=\"fill_parent\"\n\t\t        android:layout_height=\"fill_parent\"\n\t\t        android:layout_marginLeft=\"14dip\"\n\t\t        android:layout_marginRight=\"14dip\"\n\t\t        android:layout_marginTop=\"12dip\"\n\t\t        android:layout_marginBottom=\"12dip\"\n\t        \tandroid:singleLine=\"true\"\n\t\t        android:ellipsize=\"end\"\n\t\t        android:textSize=\"22sp\"\n\t\t        android:textColor=\"@color/nd_gcsdk_android_white\"\n\t\t        android:gravity=\"center\"\n\t\t        android:background=\"@drawable/nd_gcsdk_box_btn_bg\"\n\t\t        />\n\t\t</LinearLayout>\n    </LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_pausepage.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\" \n    android:gravity=\"center\"\n    android:background=\"@color/nd_gcsdk_translucent\"\n    >\n    <LinearLayout \n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\n        >\n\t    <!-- 头部 -->\n\t    <LinearLayout \n\t        android:layout_width=\"310dip\"\n\t        android:layout_height=\"48dip\"\n\t        android:orientation=\"horizontal\"\n\t        android:gravity=\"center_vertical\"\n\t        android:background=\"@drawable/nd_gcsdk_box_tit_bg\"\n\t        >\n\t        <!-- 标题 -->\n\t        <TextView \n\t            android:id=\"@+id/txt_title\"\n\t            android:layout_width=\"0dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:layout_weight=\"1\"\n\t            android:paddingLeft=\"14dip\"\n\t            android:paddingRight=\"14dip\"\n\t\t        android:singleLine=\"true\"\n\t\t        android:ellipsize=\"end\"\n\t            android:text=\"@string/nd_gcsdk_pausepage_title\"\n\t            android:textSize=\"20sp\"\n\t            android:textStyle=\"bold\"\n\t            android:textColor=\"@color/nd_gcsdk_android_white\"\n\t            android:drawableLeft=\"@drawable/nd_gcsdk_box_logo\"\n\t            android:drawablePadding=\"5dip\"\n\t            android:gravity=\"center_vertical\"\n\t            />\n\t        <View \n\t            android:layout_width=\"1dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:layout_marginTop=\"3dip\"\n\t            android:layout_marginBottom=\"3dip\"\n\t            android:background=\"@drawable/nd_gcsdk_box_title_line\"\n\t            />\n\t        <ImageButton \n\t            android:id=\"@+id/imgbtn_close\"\n\t            android:layout_width=\"48dip\"\n\t            android:layout_height=\"48dip\"\n\t            android:padding=\"3dip\"\n\t            android:src=\"@drawable/nd_gcsdk_box_close\"\n\t            android:background=\"@color/nd_gcsdk_transparent\"\n\t            />\n\t    </LinearLayout>\n\t    <!-- 图片 -->\n\t\t<ImageView \n\t\t    android:id=\"@+id/img_ad\"\n\t\t    android:layout_width=\"310dip\"\n\t\t    android:layout_height=\"150dip\"\n\t\t    android:scaleType=\"fitXY\"\n\t\t    android:padding=\"2dip\"\n\t        android:background=\"@color/nd_gcsdk_box_bg\"\n\t\t    />\n\t\t<!-- 底部 -->\n\t    <TextView \n\t        android:id=\"@+id/txt_summary\"\n\t        android:layout_width=\"310dip\"\n\t        android:layout_height=\"45dip\"\n\t        android:paddingLeft=\"14sp\"\n\t        android:paddingRight=\"14sp\"\n\t        android:singleLine=\"true\"\n\t        android:ellipsize=\"end\"\n\t        android:textSize=\"15sp\"\n\t        android:textColor=\"@color/nd_gcsdk_android_white\"\n\t        android:gravity=\"center_vertical\"\n\t        android:background=\"@drawable/nd_gcsdk_box_bg\"\n\t        />\n    </LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 靓点推荐——图片类型 -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\" >\n    <!-- 大号图片 -->\n    <ImageView \n        android:id=\"@+id/img_logo\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:scaleType=\"fitXY\"\n        />\n    <!-- 主标题 -->\n    <TextView \n        android:id=\"@+id/txt_main_title\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignBottom=\"@id/img_logo\"\n        android:padding=\"2dip\"\n        android:singleLine=\"true\"\n        android:ellipsize=\"end\"\n        android:textSize=\"13sp\"\n        android:textStyle=\"bold\"\n        android:textColor=\"@color/nd_gcsdk_android_white\"\n        android:gravity=\"center\"\n        android:background=\"@color/nd_gcsdk_translucent\"\n        />\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 靓点推荐——专题类型 -->\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    >\n    <LinearLayout \n        android:layout_width=\"fill_parent\"\n\t    android:layout_height=\"fill_parent\"\n\t    android:padding=\"8dip\"\n\t    android:orientation=\"vertical\"\n        >\n        <!-- 主标题 -->\n\t    <TextView \n\t        android:id=\"@+id/txt_main_title\"\n\t        android:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:paddingRight=\"20dip\"\n\t        android:maxLines=\"2\"\n\t        style=\"@style/nd_gcsdk_project_main_title\"\n\t        />\n\t    <!-- 副标题 -->\n\t    <TextView \n\t        android:id=\"@+id/txt_sub_title\"\n\t        android:layout_width=\"wrap_content\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:singleLine=\"true\"\n\t        android:maxLength=\"8\"\n\t        style=\"@style/nd_gcsdk_project_sub_title\"\n\t        />\n    </LinearLayout>\n    <!-- 标签 -->\n    <TextView\n        android:id=\"@+id/txt_label\" \n        android:layout_alignParentRight=\"true\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_margin=\"8dip\"\n        style=\"@style/nd_gcsdk_project_label\"\n        />\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 靓点推荐——游戏类型 -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:padding=\"8dip\"\n    android:orientation=\"vertical\">\n    <LinearLayout \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"0dip\"\n        android:layout_weight=\"1\"\n        >\n\t\t<!-- 游戏Logo -->\n\t    <ImageView \n\t        android:id=\"@+id/img_logo\"\n\t        android:layout_width=\"35dip\"\n\t        android:layout_height=\"35dip\"\n\t        android:scaleType=\"fitXY\"\n\t        />\n\t    <!-- 游戏名称 -->\n\t    <TextView \n\t        android:id=\"@+id/txt_main_title\"\n\t        android:layout_width=\"wrap_content\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:paddingLeft=\"5dip\"\n\t        android:paddingRight=\"8dip\"\n\t        android:maxLines=\"2\"\n\t        style=\"@style/nd_gcsdk_project_main_title\"\n\t        />\n    </LinearLayout>\n\t<LinearLayout \n\t    android:layout_width=\"fill_parent\"\n\t    android:layout_height=\"wrap_content\"\n   \t\tandroid:paddingRight=\"3dip\"\n\t    android:orientation=\"horizontal\"\n\t    >\n\t    <!-- 副标题 -->\n\t    <TextView \n\t        android:id=\"@+id/txt_sub_title\"\n\t        android:layout_width=\"0dip\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:layout_weight=\"1\"\n\t        android:singleLine=\"true\"\n\t        android:maxLength=\"8\"\n\t        style=\"@style/nd_gcsdk_project_sub_title\"\n\t        />\n\t    <!-- 标签 -->\n\t    <TextView \n\t        android:id=\"@+id/txt_label\"\n\t        style=\"@style/nd_gcsdk_project_label\"\n\t        />\n\t</LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_goods_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n<ScrollView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:fillViewport=\"true\"\n  android:fadingEdge=\"none\"\n  >\n<RelativeLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n\n  <RelativeLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_bk1\"\n  android:id=\"@+id/nd_goods_price_rl\"\n  android:layout_alignParentTop=\"true\"\n  style=\"@style/nd3_option_item_margin_style\">\n  \n      <RelativeLayout\n      android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:id=\"@+id/nd_goods_detail_left_rl\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t  \t  <ImageView\n\t  \t  android:layout_width=\"@dimen/nd_goods_detail_size\"\n\t      android:layout_height=\"@dimen/nd_goods_detail_size\"\n\t      android:src=\"@drawable/nd_goods_detail_default\"\n\t      android:scaleType=\"fitXY\"\n\t      android:id=\"@+id/nd_goods_icon\"\n\t      android:layout_alignParentTop=\"true\"\n\t      android:layout_centerHorizontal=\"true\"\n\t      />\n\t\t  <LinearLayout\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:orientation=\"horizontal\"\n\t\t  android:id=\"@+id/nd_goods_count_rl\"\n\t\t  android:layout_below=\"@id/nd_goods_icon\"\n\t\t  android:layout_marginTop=\"@dimen/nd3_margin_size\">\n\t\t  \n\t\t  \t<Button\n\t\t  \tandroid:layout_width=\"28dip\"\n\t\t    android:layout_height=\"25dip\"\n\t\t    android:background=\"@drawable/nd_button_action_reduce\"\n\t\t    android:id=\"@+id/nd_reduce_goods\"\n\t\t    android:layout_gravity=\"center_vertical\"\n\t\t     android:layout_marginLeft=\"@dimen/nd3_margin_size\"/>\n\t\t  \t<EditText\n\t\t    android:layout_width=\"70dip\"\n\t\t    android:layout_height=\"30dip\"\n\t\t    android:singleLine=\"true\"\n\t\t    android:numeric=\"integer\"\n\t\t    android:background=\"@drawable/nd_goods_count_input_bg\"\n\t\t    android:id=\"@+id/nd_goods_count\"\n\t\t    />\n\t\t  \t<Button\n\t\t  \tandroid:layout_width=\"28dip\"\n\t\t    android:layout_height=\"25dip\"\n\t\t    android:background=\"@drawable/nd_button_action_add\"\n\t\t    android:id=\"@+id/nd_add_goods\"\n\t\t    android:layout_gravity=\"center_vertical\"\n\t\t    android:layout_marginRight=\"@dimen/nd3_margin_size\"/>\t\t    \n\t  \n\t      </LinearLayout>\n      </RelativeLayout>\n      \n      <LinearLayout\n      android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:id=\"@+id/nd_goods_detail_right_rl\"\n\t  android:layout_toRightOf=\"@id/nd_goods_detail_left_rl\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\"\n\t  android:orientation=\"vertical\">\n\t  \t\t<TextView\n\t  \t\tandroid:id=\"@+id/nd_goods_name\"\n\t  \t\tandroid:layout_width=\"wrap_content\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:gravity=\"bottom\"\n\t        style=\"@style/nd3_textview_1\"\n\t        android:layout_marginBottom=\"@dimen/nd3_margin_size\"/>\n\t  \t\t<LinearLayout\n\t  \t\tandroid:layout_width=\"wrap_content\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\">\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:text=\"@string/nd_goods_price_org\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:id=\"@+id/nd_goods_price_org_txt\"\n\t            android:textSize=\"14sp\"\n\t            android:textColor=\"@color/nd3_black\"\n\t            android:gravity=\"bottom\"/>\n\t  \t\t</LinearLayout>\n\t  \t\t<LinearLayout\n\t  \t\tandroid:layout_width=\"wrap_content\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\">\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:text=\"@string/nd_goods_price_sale\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:id=\"@+id/nd_goods_price_sale_txt\"\n\t            android:textSize=\"14sp\"\n\t            android:textColor=\"@color/nd3_black\"\n\t            android:gravity=\"bottom\"/>\n\t  \t\t</LinearLayout>\n\t  \t    <Button\n\t  \t\tandroid:layout_width=\"120dip\"\n\t        android:layout_height=\"35dip\"\n\t        android:background=\"@drawable/nd_button_action_buy\"\n\t        android:layout_margin=\"@dimen/nd3_margin_size\"\n\t        android:id=\"@+id/nd_to_buy\"\n\t        android:text=\"@string/nd_goods_buy_now\"\n\t        android:textColor=\"@color/nd3_white\"\n\t        android:gravity=\"center\"/>\n\t  \t\t\n\t  </LinearLayout>\n  </RelativeLayout>\n  \n  <TextView\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:id=\"@+id/nd_goods_desc_title\"\n  android:text=\"@string/nd_goods_desc_panel_title\"\n  android:layout_marginLeft=\"10dip\"\n  android:textColor=\"#ffffffff\"\n  android:textSize=\"20sp\"\n  android:layout_below=\"@id/nd_goods_price_rl\"/>\n\n  <LinearLayout\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_bk1\"\n  android:id=\"@+id/nd_goods_desc_rl\"\n  android:layout_below=\"@id/nd_goods_desc_title\"\n  android:orientation=\"vertical\"\n  android:padding=\"@dimen/nd3_option_item_marginLeft\"\n  style=\"@style/nd3_option_item_margin_style\">\n            <!-- 可用时长 -->\n  \t        <LinearLayout\n\t  \t\tandroid:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\">\n\t        \t<TextView\n\t        \tandroid:layout_width=\"80dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:text=\"@string/nd_goods_desc_panel_title1\"\n\t            android:gravity=\"fill_horizontal\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:id=\"@+id/nd_goods_valid_time_txt\"\n\t            android:gravity=\"left\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t  \t\t</LinearLayout>\n\t  \t\t<!-- 可用次数 -->\n\t  \t\t<LinearLayout\n\t  \t\tandroid:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\">\n\t        \t<TextView\n\t        \tandroid:layout_width=\"80dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:text=\"@string/nd_goods_desc_panel_title2\"\n\t            android:gravity=\"fill_horizontal\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:id=\"@+id/nd_goods_use_time_txt\"\n\t            android:gravity=\"left\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t  \t\t</LinearLayout>\n\t  \t\t<!-- 抢购时间 -->\n\t  \t\t<LinearLayout\n\t  \t\tandroid:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\">\n\t        \t<TextView\n\t        \tandroid:layout_width=\"80dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:text=\"@string/nd_goods_desc_panel_title3\"\n\t            android:gravity=\"fill_horizontal\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:id=\"@+id/nd_goods_buy_time_txt\"\n\t            android:gravity=\"left\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t  \t\t</LinearLayout>\n\t  \t\t<!-- 限购 -->\n\t  \t\t<LinearLayout\n\t  \t\tandroid:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\">\n\t        \t<TextView\n\t        \tandroid:layout_width=\"80dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:text=\"@string/nd_goods_desc_panel_title4\"\n\t            android:gravity=\"fill_horizontal\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:id=\"@+id/nd_goods_buy_max_txt\"\n\t            android:gravity=\"left\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t  \t\t</LinearLayout>\n\t  \t\t<!-- 描述 -->\n\t  \t\t<LinearLayout\n\t  \t\tandroid:layout_width=\"fill_parent\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\">\n\t        \t<TextView\n\t        \tandroid:layout_width=\"80dip\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:text=\"@string/nd_goods_desc_panel_title5\"\n\t            android:gravity=\"fill\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t        \t<TextView\n\t        \tandroid:layout_width=\"wrap_content\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:id=\"@+id/nd_goods_desc_txt\"\n\t            android:gravity=\"left\"\n\t            style=\"@style/nd_goods_item_style\"/>\n\t  \t\t</LinearLayout>\n  </LinearLayout>\n\n \n</RelativeLayout>\n</ScrollView>\n <ProgressBar   \n         android:id=\"@+id/nd_payprogress\"    \n         style=\"?android:attr/progressBarStyleLarge\" \n         android:indeterminate=\"true\"  \n         android:layout_width=\"wrap_content\"   \n         android:layout_height=\"wrap_content\"  \n         android:visibility=\"gone\" \n         android:layout_centerInParent=\"true\"  \n />    \n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_goods_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:layout_margin=\"@dimen/nd3_margin_size\">\n     <ListView\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"fill_parent\"\n\t\t  android:id=\"@+id/nd_goods_listview\"\n\t\t  android:headerDividersEnabled=\"false\"\n\t\t  android:layout_marginLeft=\"5dip\"\n\t\t  android:layout_marginRight=\"5dip\"\n\t\t  android:footerDividersEnabled=\"false\"\n\t\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t\t  android:fastScrollEnabled=\"true\"\n\t\t  android:cacheColorHint=\"#00000000\"\n\t\t  android:fadingEdge=\"none\">\n     </ListView>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_goods_list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.goods.NdGoodsListItem\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_user_item_bg\"\n  android:paddingBottom=\"@dimen/nd3_margin_size\">\n  \n  <RelativeLayout\n  android:layout_width=\"@dimen/nd_goods_flag_w\"\n  android:layout_height=\"wrap_content\"\n  android:layout_alignParentLeft=\"true\"\n  android:layout_alignParentTop=\"true\"\n  android:id=\"@+id/nd_head_rl\"\n  >\n\t  <ImageView\n\t  android:id=\"@+id/nd_goods_image\"\n\t  android:layout_width=\"@dimen/nd3_image_size\"\n\t  android:layout_height=\"@dimen/nd3_image_size\"\n\t  android:scaleType=\"fitXY\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_centerHorizontal=\"true\"\n\t  android:layout_marginTop=\"@dimen/nd3_margin_size\"/>\n\t  <ImageView\n\t  android:id=\"@+id/nd_goods_flag_image\"\n\t  android:layout_width=\"@dimen/nd_goods_flag_w\"\n\t  android:layout_height=\"@dimen/nd_goods_flag_h\"\n\t  android:layout_alignBottom=\"@id/nd_goods_image\"\n\t  android:layout_alignParentLeft=\"true\"/>\n   </RelativeLayout>\n  \n  <ImageView\n  android:id=\"@+id/nd_goods_action_btn\"\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  android:src=\"@drawable/nd3_switch_image\"\n  android:layout_marginTop=\"@dimen/nd3_margin_size\"\n  android:layout_marginBottom=\"@dimen/nd3_margin_size\"\n  android:layout_marginLeft=\"@dimen/nd3_margin_size\"\n  android:layout_marginRight=\"8dip\"\n  android:layout_alignParentRight=\"true\"\n  android:layout_centerVertical=\"true\"/>\n  \n  <RelativeLayout\n  android:id=\"@+id/nd_goods_item_content_rl\"\n  android:layout_width=\"0dip\"\n  android:layout_height=\"wrap_content\"\n  android:layout_toRightOf=\"@id/nd_head_rl\"\n  android:layout_toLeftOf=\"@+id/nd_goods_action_btn\"\n  android:layout_alignTop=\"@id/nd_head_rl\"\n  android:layout_marginBottom=\"@dimen/nd3_margin_size\">\n\t  <TextView\n\t  android:id=\"@+id/nd_goods_name_txt\"\n\t  android:layout_width=\"0dip\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentLeft=\"true\"\n      android:layout_alignParentTop=\"true\"\n      android:layout_toLeftOf=\"@+id/nd_goods_price_txt\"\n      android:maxLines=\"1\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"  \n      style=\"@style/nd3_textview_1\"/> \n      <TextView\n\t  android:id=\"@+id/nd_goods_price_txt\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentRight=\"true\"\n      android:layout_alignTop=\"@id/nd_goods_name_txt\"\n      android:maxLines=\"1\"\n      android:singleLine=\"true\"\n      android:ellipsize=\"end\"\n      android:textSize=\"16sp\"\n      android:textColor=\"@color/nd3_black\"/> \n\t  <TextView\n\t  android:id=\"@+id/nd_goods_content\"\n\t  android:layout_width=\"wrap_content\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignLeft=\"@id/nd_goods_name_txt\"\n\t  android:layout_below=\"@id/nd_goods_name_txt\"\n\t  android:maxLines=\"2\"\n      android:ellipsize=\"end\"  \n\t  style=\"@style/nd3_textview_2\"/>\n  </RelativeLayout>\n</com.nd.commplatform.widget.goods.NdGoodsListItem>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:orientation=\"vertical\">\n  \n  <RelativeLayout\n  android:id=\"@+id/nd3_rank_top\"\n  android:layout_width=\"fill_parent\"\n  android:background=\"@drawable/nd3_title_bar_bg\"\n  android:layout_height=\"wrap_content\"/>\n \n <FrameLayout\n  android:layout_margin=\"@dimen/nd3_margin_size\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\">\n      <TextView\n\t  android:id=\"@+id/nd_leaderboard_emptyview\"\n\t  android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      android:layout_gravity=\"center\"\n      android:textColor=\"@color/nd3_black\"\n      android:text=\"@string/nd3_no_rank_category_tip\"\n      android:visibility=\"gone\"/>\n\t  <ListView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\"\n\t  android:id=\"@+id/nd3_rank_listview\"\n\t  android:headerDividersEnabled=\"false\"\n\t  android:footerDividersEnabled=\"false\"\n\t  android:divider=\"@drawable/nd3_horizontal_line\"\n\t  android:fastScrollEnabled=\"true\"\n\t  android:cacheColorHint=\"#00000000\"\n\t  android:fadingEdge=\"none\">\n\t  </ListView>\n\t  \n  </FrameLayout>\n \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard_list_header.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n  <LinearLayout\n   xmlns:android=\"http://schemas.android.com/apk/res/android\"\n   android:layout_width=\"fill_parent\"\n   android:layout_height=\"wrap_content\"\n   android:orientation=\"vertical\">\n\t\t<RadioGroup\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:id=\"@+id/nd_rank_time_type_group_portrait\"\n\t\t  android:orientation=\"horizontal\">\n\t\t  \t    <RadioButton  \n\t\t\t\t    android:id=\"@+id/nd_rank_time_type_today_btn\" \n\t\t\t\t    android:background=\"@drawable/nd3_rank_choice_left_btn_bg\"\n\t\t\t\t    android:button=\"@null\"\n\t\t\t\t    android:layout_height=\"wrap_content\" \n\t\t\t\t    android:layout_width=\"0dip\"\n\t\t\t\t    android:text=\"@string/nd_leaderboard_scope_time_today\"\n\t\t\t\t    android:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t    android:gravity=\"center\"\n\t\t\t\t    android:layout_weight=\"1\"\n\t\t\t\t    />\n\t\t\t\t    <RadioButton  \n\t\t\t\t    android:id=\"@+id/nd_rank_time_type_week_btn\" \n\t\t\t\t    android:background=\"@drawable/nd3_rank_choice_middle_btn_bg\"\n\t\t\t\t    android:button=\"@null\"\n\t\t\t\t    android:layout_height=\"wrap_content\" \n\t\t\t\t    android:layout_width=\"0dip\"\n\t\t\t\t    android:text=\"@string/nd_leaderboard_scope_time_week\"\n\t\t\t\t    android:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t    android:gravity=\"center\"\n\t\t\t\t    android:layout_weight=\"1\"\n\t\t\t\t    />\n\t\t\t\t <RadioButton  \n\t\t\t\t \tandroid:id=\"@+id/nd_rank_time_type_all_btn\"  \n\t\t\t\t \tandroid:background=\"@drawable/nd3_rank_choice_right_btn_bg\"\n\t\t\t\t \tandroid:button=\"@null\" \n\t\t\t\t \tandroid:layout_height=\"wrap_content\"\n\t\t\t\t \tandroid:layout_width=\"0dip\"\n\t\t\t\t \tandroid:text=\"@string/nd_leaderboard_scope_time_all\"\n\t\t\t\t \tandroid:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t \tandroid:gravity=\"center\"\n\t\t\t\t \tandroid:layout_weight=\"1\"/>\n\t\t  </RadioGroup>  \n\t\n\t\n  <RelativeLayout\n  android:id=\"@+id/nd3_leaderboard_self\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"wrap_content\"\n  android:background=\"@drawable/nd3_bk1\"\n  android:layout_marginTop=\"@dimen/nd3_margin_size\"\n  android:layout_marginBottom=\"@dimen/nd3_margin_size\">\n  \n\t  <ImageView\n\t  android:id=\"@+id/nd3_user_image\"\n\t  android:layout_width=\"@dimen/nd3_image_size\"\n\t  android:layout_height=\"@dimen/nd3_image_size\"\n\t  android:layout_alignParentLeft=\"true\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:scaleType=\"fitXY\"\n\t  android:layout_margin=\"@dimen/nd3_margin_size\"\n\t  />\n  \n\t  <RelativeLayout\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  android:layout_alignParentTop=\"true\"\n\t  android:layout_toRightOf=\"@id/nd3_user_image\">\n\t\t  <TextView\n\t\t  android:id=\"@+id/nd3_user_name_txt\"\n\t\t  android:layout_width=\"fill_parent\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t      android:layout_alignParentTop=\"true\"\n\t\t  style=\"@style/nd3_textview_1\"/>\n\t\t  \n\t\t  <TextView\n\t\t  android:id=\"@+id/nd3_user_content\"\n\t\t  android:layout_width=\"0dip\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t\t  android:layout_toLeftOf=\"@+id/nd_rank_user_type_group_landscape\"\n\t\t  android:layout_below=\"@id/nd3_user_name_txt\"\n\t\t  android:layout_alignWithParentIfMissing=\"true\"\n\t\t  style=\"@style/nd3_textview_2\"/>\n\t\t  \n\t\t   \n\t\t<RadioGroup\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentRight=\"true\"\n\t\t  android:layout_alignTop=\"@id/nd3_user_content\"\n\t\t  android:id=\"@+id/nd_rank_user_type_group_landscape\"\n\t\t  android:orientation=\"horizontal\"\n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t\t  <RadioButton  \n\t\t\t\t    android:id=\"@+id/nd3_all_rank_btn_landscape\" \n\t\t\t\t    android:background=\"@drawable/nd_leaderboard_left_btn_bg\"\n\t\t\t\t    android:button=\"@null\"\n\t\t\t\t    android:layout_height=\"30dip\" \n\t\t\t\t    android:layout_width=\"60dip\"\n\t\t\t\t    android:text=\"@string/nd_leaderboard_all_player\"\n\t\t\t\t    android:textColor=\"@color/nd3_black\"\n\t\t\t\t    android:gravity=\"center\"\n\t\t\t\t    />\n\t\t\t\t <RadioButton  \n\t\t\t\t \tandroid:id=\"@+id/nd3_friend_rank_btn_landscape\" \n\t\t\t\t \tandroid:background=\"@drawable/nd_leaderboard_right_btn_bg\"\n\t\t\t\t \tandroid:button=\"@null\" \n\t\t\t\t \tandroid:layout_height=\"30dip\"\n\t\t\t\t \tandroid:layout_width=\"60dip\"\n\t\t\t\t \tandroid:text=\"@string/nd_leaderboard_friend_player\"\n\t\t\t\t \tandroid:textColor=\"@color/nd3_black\"\n\t\t\t\t \tandroid:gravity=\"center\"/>\n\t\t  </RadioGroup>  \n\t  </RelativeLayout>\n   </RelativeLayout>\n </LinearLayout>\n   \n  \n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard_switcher_landscape_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t<RelativeLayout\n\t\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  \n\t  >\n\t\t  <Button \n\t\t  android:id=\"@+id/nd3_rank_ret_btn\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:textSize=\"16sp\"\n\t\t  android:textColor=\"@color/nd3_btn_font_color\"\n\t\t  android:text=\"@string/nd3_topbar_ret\"\n\t\t  android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n\t\t  android:layout_margin=\"10dip\"/>\n\t\t  <RadioGroup\n\t\t  android:layout_width=\"0dip\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_toRightOf=\"@id/nd3_rank_ret_btn\"\n\t\t  android:layout_toLeftOf=\"@+id/nd3_rank_share_btn\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:id=\"@+id/nd_rank_time_type_group\"\n\t\t  android:orientation=\"horizontal\"\n\t\t  android:layout_margin=\"@dimen/nd3_margin_size\">\n\t\t   <RadioButton  \n\t\t\t\t    android:id=\"@+id/nd_rank_time_type_today_btn\" \n\t\t\t\t    android:background=\"@drawable/nd3_rank_choice_left_btn_bg\"\n\t\t\t\t    android:button=\"@null\"\n\t\t\t\t    android:layout_height=\"wrap_content\" \n\t\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t\t    android:text=\"@string/nd_leaderboard_scope_time_today\"\n\t\t\t\t    android:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t    android:gravity=\"center\"\n\t\t\t\t    android:layout_weight=\"1\"\n\t\t\t\t    />\n\t\t\t\t    <RadioButton  \n\t\t\t\t    android:id=\"@+id/nd_rank_time_type_week_btn\" \n\t\t\t\t    android:background=\"@drawable/nd3_rank_choice_middle_btn_bg\"\n\t\t\t\t    android:button=\"@null\"\n\t\t\t\t    android:layout_height=\"wrap_content\" \n\t\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t\t    android:text=\"@string/nd_leaderboard_scope_time_week\"\n\t\t\t\t    android:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t    android:gravity=\"center\"\n\t\t\t\t    android:layout_weight=\"1\"\n\t\t\t\t    />\n\t\t\t\t <RadioButton  \n\t\t\t\t \tandroid:id=\"@+id/nd_rank_time_type_all_btn\"  \n\t\t\t\t \tandroid:background=\"@drawable/nd3_rank_choice_right_btn_bg\"\n\t\t\t\t \tandroid:button=\"@null\" \n\t\t\t\t \tandroid:layout_height=\"wrap_content\"\n\t\t\t\t \tandroid:layout_width=\"wrap_content\"\n\t\t\t\t \tandroid:text=\"@string/nd_leaderboard_scope_time_all\"\n\t\t\t\t \tandroid:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t \tandroid:gravity=\"center\"\n\t\t\t\t \tandroid:layout_weight=\"1\"/>\n\t\t  </RadioGroup>\n\t\t  <Button \n\t\t  android:id=\"@+id/nd3_rank_share_btn\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentRight=\"true\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:textSize=\"16sp\"\n\t\t  android:textColor=\"@color/nd3_btn_font_color\"\n\t\t  android:text=\"@string/nd3_rank_share_btn_txt\"\n\t\t  android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n\t\t  android:layout_margin=\"10dip\"\n\t\t  android:padding=\"5dip\"\n\t\t  />\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard_switcher_portrait_1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n\t  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"wrap_content\"\n\t  >\n\t\t  <Button \n\t\t  android:id=\"@+id/nd3_rank_ret_btn\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentLeft=\"true\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:textSize=\"16sp\"\n\t\t  android:textColor=\"@color/nd3_btn_font_color\"\n\t\t  android:text=\"@string/nd3_topbar_ret\"\n\t\t  android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n\t\t  android:layout_margin=\"10dip\"/>\n\t\t  <RadioGroup\n\t\t  android:layout_width=\"0dip\"\n\t\t  android:layout_toRightOf=\"@id/nd3_rank_ret_btn\"\n\t\t  android:layout_toLeftOf=\"@+id/nd3_rank_share_btn\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:id=\"@+id/nd_rank_user_type_group\"\n\t\t  android:orientation=\"horizontal\">\n\t\t  \t       <RadioButton  \n\t\t\t\t    android:id=\"@+id/nd3_all_rank_btn\" \n\t\t\t\t    android:background=\"@drawable/nd3_rank_choice_left_btn_bg\"\n\t\t\t\t    android:button=\"@null\"\n\t\t\t\t    android:layout_height=\"wrap_content\" \n\t\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t\t    android:text=\"@string/nd_leaderboard_all_player\"\n\t\t\t\t    android:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t    android:gravity=\"center\"\n\t\t\t\t    android:layout_weight=\"1\"\n\t\t\t\t    />\n\t\t\t\t <RadioButton  \n\t\t\t\t \tandroid:id=\"@+id/nd3_friend_rank_btn\" \n\t\t\t\t \tandroid:background=\"@drawable/nd3_rank_choice_right_btn_bg\"\n\t\t\t\t \tandroid:button=\"@null\" \n\t\t\t\t \tandroid:layout_height=\"wrap_content\"\n\t\t\t\t \tandroid:layout_width=\"wrap_content\"\n\t\t\t\t \tandroid:text=\"@string/nd_leaderboard_friend_player\"\n\t\t\t\t \tandroid:textColor=\"@color/nd3_btn_font_color\"\n\t\t\t\t \tandroid:layout_weight=\"1\"\n\t\t\t\t \tandroid:gravity=\"center\"/>\n\t\t  </RadioGroup>\n\t\t  <Button \n\t\t  android:id=\"@+id/nd3_rank_share_btn\"\n\t\t  android:layout_width=\"wrap_content\"\n\t\t  android:layout_height=\"wrap_content\"\n\t\t  android:layout_alignParentRight=\"true\"\n\t\t  android:layout_centerVertical=\"true\"\n\t\t  android:textSize=\"16sp\"\n\t\t  android:textColor=\"@color/nd3_btn_font_color\"\n\t\t  android:text=\"@string/nd3_rank_share_btn_txt\"\n\t\t  android:background=\"@drawable/nd3_title_bar_action_btn_xml\"\n\t\t  android:layout_margin=\"10dip\"\n\t\t  android:padding=\"5dip\"\n\t\t  />\n</RelativeLayout>\n\t\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_login_director.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n  xmlns:android=\"http://schemas.android.com/apk/res/android\"\n  android:layout_width=\"fill_parent\"\n  android:layout_height=\"fill_parent\"\n  android:orientation=\"vertical\">\n   <FrameLayout\n   android:layout_width=\"fill_parent\"\n   android:layout_height=\"1dip\"\n   android:layout_weight=\"144\">\n      <ImageView\n\t   android:id=\"@+id/nd_logo\"\n\t   android:layout_width=\"198dip\"\n\t   android:layout_height=\"144dip\"\n\t   android:src=\"@drawable/nd_direct_logo\"\n\t   android:scaleType=\"centerInside\"\n\t   android:layout_gravity=\"center\"\n      />\n      </FrameLayout>\n \n  <FrameLayout\n   android:layout_width=\"fill_parent\"\n   android:layout_height=\"1dip\"\n   android:layout_weight=\"40\">\n     <Button\n     android:id=\"@+id/nd_goto_login\"\n     android:text=\"@string/nd3_account_login_title\"\n     android:layout_width=\"160dip\"\n     android:layout_height=\"40dip\"\n     android:textColor=\"@color/nd3_white\"\n     android:background=\"@drawable/nd_direct_login\"\n     android:gravity=\"center\"\n     android:textSize=\"@dimen/nd3_btn_text_size\"\n     android:layout_gravity=\"center_horizontal|top\"\n     />\n      </FrameLayout>\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_set_password.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_set_password_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\t>\n\t \n\t  \t \n  \t \n\t\t\t<!-- 旧密码、新密码 -->\n\t\t\t<LinearLayout\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\tandroid:orientation =\"vertical\"\n\t\t\t\tandroid:background=\"@drawable/nd3_bk1\"\n\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_option_margin_top\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\t\t\n\t\t\t\t>\n\t\t\t\t\n\t\t\t\t<!-- 旧密码 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_set_password_password\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<EditText\n\t\t\t\t\t\tandroid:id=\"@+id/nd_set_password_old\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\t\t\tandroid:hint=\"@string/nd_set_password_password_hint\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</EditText>\t\t\n\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\n\t\t\t\t<!-- 分隔线 -->\n\t\t\t\t<ImageView\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/nd3_horizontal_line\"\n\t\t\t\t\t>\n\t\t\t\t\n\t\t\t\t</ImageView>\t\n\t\t\t\t\t\t\n\t\t\t\t<!-- 新密码 -->\n\t\t\t\t<LinearLayout\n\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:orientation =\"horizontal\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\"\n\t\t\t\t\tstyle=\"@style/nd3_option_item_margin_style\"\t\t\t\n\t\t\t\t\t>\n\t\t\t\t\t\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_set_password_password_again\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_textview_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\n\t\t\t\t\t<EditText\n\t\t\t\t\t\tandroid:id=\"@+id/nd_set_password_new\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_weight=\"1\"\n\t\t\t\t\t\tandroid:inputType=\"textPassword\"\n\t\t\t\t\t\tandroid:singleLine=\"true\"\n\t\t\t\t\t\tandroid:maxLength=\"12\"\n\t\t\t\t\t\tandroid:hint=\"\"\n\t\t\t\t\t\tstyle=\"@style/nd3_option_edittext_style\"\n\t\t\t\t\t\t>\n\t\t\t\t\t</EditText>\n\t\t\t\t\t\t\t\n\t\t\t\t</LinearLayout>\n\t\t\t\t\t\t\t\t\t\n\t\t\t</LinearLayout>\n\t\t\n\t\t\t<!-- 确认 -->\t\t\t\t\n\t\t\t<Button \n\t\t\t    android:id=\"@+id/nd_set_password_confirm\"\n\t\t    \tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/nd_set_password_submit\"\n\t\t\t\tstyle=\"@style/nd3_option_margin_style\"\t\n\t\t\t\tandroid:background=\"@drawable/nd_blue\"\n\t\t\t\tandroid:layout_gravity=\"center\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\" \n\t\t\t\t/>    \n\t \n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_flipitem.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    >\n    \n    <RelativeLayout\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"67dip\"\n    android:background=\"@drawable/nd_flip_bg\"\n    >\n    \n    <ImageView \n    android:layout_width=\"48dip\"\n    android:layout_height=\"48dip\"\n    android:layout_alignParentLeft=\"true\"\n    android:layout_marginTop=\"13dip\"\n    android:scaleType=\"fitXY\"\n    android:src=\"@drawable/nd3_app_icon_default\"\n    android:layout_marginLeft=\"5dip\"\n    android:layout_marginRight=\"10dip\"\n    android:id=\"@+id/nd_app_icon\"/>\n    \n    <LinearLayout\n    android:layout_width=\"0dip\"\n    android:layout_height=\"57dip\"\n    android:orientation=\"vertical\"\n    android:layout_marginTop=\"13dip\"\n    android:layout_toRightOf=\"@id/nd_app_icon\"\n    android:layout_toLeftOf=\"@+id/nd_app_download\"\n    android:layout_alignParentTop=\"true\"\n    \n    >\n    \t<TextView\n    \tandroid:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/nd_app_name\"\n        android:textSize=\"18sp\"\n        android:textColor=\"@color/nd3_black\"\n        android:singleLine=\"true\"\n        android:ellipsize=\"end\"\n       />\n    \t<TextView\n    \tandroid:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/nd_app_desc\"\n        android:textSize=\"14sp\"\n        android:textColor=\"#f43f00\"\n        android:singleLine=\"true\"\n        android:ellipsize=\"end\"\n       />\n    </LinearLayout>\n    <Button\n    android:layout_width=\"110dip\"\n    android:layout_height=\"40dip\"\n    android:layout_alignParentRight=\"true\"\n    android:layout_marginTop=\"18dip\"\n    android:layout_marginRight=\"5dip\"\n    android:text=\"@string/nd_softpromotion_download\"\n    android:textColor=\"@color/nd3_white\"\n    android:textSize=\"14sp\"\n    android:gravity=\"center\"\n    android:background=\"@drawable/nd_download\"\n    android:id=\"@id/nd_app_download\" />\n\n</RelativeLayout>\n    \n</FrameLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_listitem.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"@color/nd3_white\" >\n    \n    <ImageView \n    android:layout_width=\"48dip\"\n    android:layout_height=\"48dip\"\n    android:layout_alignParentLeft=\"true\"\n    android:layout_centerVertical=\"true\"\n    android:scaleType=\"fitXY\"\n    android:layout_margin=\"10dip\"\n    android:src=\"@drawable/nd3_app_icon_default\"\n    android:id=\"@+id/nd_app_icon\"/>\n    \n    <LinearLayout\n    android:layout_width=\"0dip\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"vertical\"\n    android:layout_marginTop=\"5dip\"\n    android:layout_marginBottom=\"5dip\"\n    android:layout_toRightOf=\"@id/nd_app_icon\"\n    android:layout_toLeftOf=\"@+id/nd_app_download\"\n    android:layout_alignParentTop=\"true\"\n    >\n    \t<TextView\n    \tandroid:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/nd_app_name\"\n        android:textSize=\"18sp\"\n        android:singleLine=\"true\"\n        android:ellipsize=\"end\"\n        android:textColor=\"@color/nd3_black\"\n       />\n    \t<TextView\n    \tandroid:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/nd_app_desc\"\n        android:textSize=\"14sp\"\n        android:textColor=\"#f43f00\" \n        android:ellipsize=\"end\"\n        android:maxLines=\"2\"\n       />\n    </LinearLayout>\n    \n    <Button\n    android:layout_width=\"110dip\"\n    android:layout_height=\"40dip\"\n    android:layout_alignParentRight=\"true\"\n    android:layout_centerVertical=\"true\"\n    android:layout_margin=\"5dip\"\n    android:text=\"@string/nd_softpromotion_download\"\n    android:textColor=\"@color/nd3_white\"\n    android:textSize=\"14sp\"\n    android:gravity=\"center\"\n    android:background=\"@drawable/nd_download\"\n    android:id=\"@id/nd_app_download\" />\n\n\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_slider_h.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdWrappingSlidingDrawer xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    android:id=\"@+id/nd_slidingdrawer\"\n    android:handle=\"@+id/nd_handle\"\n    android:content=\"@+id/nd_content\"\n    android:orientation=\"vertical\">\n    \n    <ImageView\n    android:id=\"@id/nd_handle\"\n    android:layout_width=\"fill_parent\"  \n    android:layout_height=\"wrap_content\"\n    android:background=\"@drawable/nd_slider_handle_h_expand\" />\n    \n    <RelativeLayout\n    android:id=\"@id/nd_content\"\n    android:layout_width=\"fill_parent\"  \n\tandroid:layout_height=\"wrap_content\"\n\tandroid:background=\"@drawable/nd_slider_content_h\">\n        <ImageView\n        android:layout_width=\"wrap_content\"  \n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"10dip\"\n        android:layout_centerVertical=\"true\"\n        android:layout_alignParentLeft=\"true\"\n        android:src=\"@drawable/nd_slider_pre_h\"\n        android:id=\"@+id/nd_pre\"/>\n        \n\t    <HorizontalScrollView\n\t    android:layout_width=\"0dip\"  \n\t    android:layout_height=\"wrap_content\"\n\t    android:layout_centerVertical=\"true\"\n\t    android:layout_toRightOf=\"@id/nd_pre\"\n\t    android:layout_toLeftOf=\"@+id/nd_next\"\n\t    android:scrollbars=\"horizontal\">\n\t        <LinearLayout\n\t        android:layout_width=\"wrap_content\"  \n\t        android:layout_height=\"wrap_content\"\n\t        android:orientation=\"horizontal\"\n\t        android:id=\"@+id/nd_apps\"/>\n\t    </HorizontalScrollView>\n\t    \n\t    <ImageView\n        android:layout_width=\"wrap_content\"  \n        android:layout_height=\"wrap_content\"\n        android:layout_margin=\"10dip\"\n        android:layout_centerVertical=\"true\"\n        android:layout_alignParentRight=\"true\"\n        android:src=\"@drawable/nd_slider_next_h\"\n        android:id=\"@id/nd_next\"/>\n    </RelativeLayout>\n\n</com.nd.commplatform.widget.NdWrappingSlidingDrawer>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_slider_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\">\n    \n    <ImageView\n    android:id=\"@+id/nd_app_icon\"\n    android:layout_width=\"48dip\"\n    android:layout_height=\"48dip\"\n    android:src=\"@drawable/nd3_app_icon_default\"\n    android:layout_centerHorizontal=\"true\"\n    android:scaleType=\"fitXY\"/>\n    \n    <TextView\n    android:layout_width=\"80dip\"\n    android:layout_height=\"wrap_content\"\n    android:layout_below=\"@id/nd_app_icon\"\n    android:id=\"@+id/nd_app_name\"\n    android:gravity=\"center\"\n    android:textSize=\"14sp\"\n    android:singleLine=\"true\"\n    android:ellipsize=\"end\"\n    android:layout_centerHorizontal=\"true\"\n    android:textColor=\"@color/nd3_white\"/>\n    \n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_slider_v.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.nd.commplatform.widget.NdWrappingSlidingDrawer xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"fill_parent\"\n    android:id=\"@+id/nd_slidingdrawer\"\n    android:handle=\"@+id/nd_handle\"\n    android:content=\"@+id/nd_content\"\n    android:orientation=\"horizontal\" >\n    \n    <ImageView\n    android:id=\"@id/nd_handle\"\n    android:layout_width=\"wrap_content\"  \n    android:layout_height=\"fill_parent\"\n    android:background=\"@drawable/nd_slider_handle_v_expand\" />\n    \n   <RelativeLayout\n    android:id=\"@id/nd_content\"\n    android:layout_width=\"wrap_content\"  \n\tandroid:layout_height=\"fill_parent\"\n\tandroid:background=\"@drawable/nd_slider_content_v\">\n        <ImageView\n        android:layout_width=\"wrap_content\"  \n        android:layout_height=\"wrap_content\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_alignParentTop=\"true\"\n        android:layout_margin=\"10dip\"\n        android:background=\"@drawable/nd_slider_pre_v\"\n        android:id=\"@+id/nd_pre\"/>\n        \n\t    <ScrollView\n\t    android:layout_width=\"wrap_content\"  \n\t    android:layout_height=\"0dip\"\n\t    android:layout_centerHorizontal=\"true\"\n\t    android:scrollbars=\"vertical\"\n\t    android:layout_below=\"@id/nd_pre\"\n\t    android:layout_above=\"@+id/nd_next\"\n\t    android:fadingEdge=\"none\">\n\t        <LinearLayout\n\t        android:layout_width=\"wrap_content\"\n\t        android:layout_height=\"wrap_content\"\n\t        android:layout_marginLeft=\"5dip\"\n\t        android:layout_marginRight=\"5dip\"\n\t        android:orientation=\"vertical\"\n\t        android:id=\"@+id/nd_apps\"/>\n\t    </ScrollView>\n\t    \n\t    <ImageView\n        android:layout_width=\"wrap_content\"  \n        android:layout_height=\"wrap_content\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_margin=\"10dip\"\n        android:background=\"@drawable/nd_slider_next_v\"\n        android:id=\"@id/nd_next\"/>\n    </RelativeLayout>\n\n</com.nd.commplatform.widget.NdWrappingSlidingDrawer>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softwarepromotion.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\" >\n    \n    <RelativeLayout\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"@drawable/nd3_title_bar_bg\">\n    \n        <Button\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/nd3_title_bar_return_btn_xml\"\n        android:textSize=\"16sp\"\n        android:textColor=\"@color/nd3_white\"\n        android:text=\"@string/nd3_topbar_ret\"\n        android:layout_alignParentLeft=\"true\"\n        android:layout_centerVertical=\"true\"\n        android:layout_marginLeft=\"10dip\"\n        android:id=\"@+id/nd_return\"\n        />\n        \n        <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:text=\"@string/nd_softpromotion_title\"\n        android:textStyle=\"bold\"\n        android:textColor=\"@color/nd3_white\"\n        android:textSize=\"24sp\"/>\n    </RelativeLayout>\n  \n  <FrameLayout\n  android:layout_width=\"fill_parent\" \n  android:layout_height=\"0dip\"\n  android:layout_weight=\"1.0\"\n  android:background=\"@color/nd3_white\">\n\t  <ListView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\"\n\t  android:id=\"@+id/nd_listview\"\n\t  android:headerDividersEnabled=\"false\"\n\t  android:footerDividersEnabled=\"false\"\n\t  android:divider=\"@drawable/nd3_list_separator\"\n\t  android:fastScrollEnabled=\"true\"\n\t  android:cacheColorHint=\"#00000000\"\n\t  android:fadingEdge=\"none\">\n\t  </ListView>\n\t  <TextView\n\t  android:layout_width=\"fill_parent\"\n\t  android:layout_height=\"fill_parent\"\n\t  android:textColor=\"@color/nd3_black\"\n\t  android:textSize=\"16sp\"\n\t  android:padding=\"10dip\"\n\t  android:id=\"@+id/nd_empty\"/>\n </FrameLayout>\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_unbind_phone_number.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/nd_unbind_phone_number_layout\"\n\tandroid:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" \n\tandroid:orientation =\"vertical\"\n\tandroid:fillViewport=\"true\"\n\t>\n\t    \n\t\t <!-- 提示 -->\n\t\t<TextView android:id=\"@+id/nd_unbind_phone_number_tips\" \n\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:gravity=\"center\"\n\t\t\tandroid:text=\"@string/nd_unbind_phone_tips\"\n\t\t\tandroid:textSize=\"18dip\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\t\n\t\t\tandroid:paddingBottom=\"10dip\"\t\n\t\t\tandroid:paddingTop=\"10dip\"\n\t\t\tandroid:textStyle=\"bold\"\n\t\t\t>\n\t\t</TextView>\n\t\t\t\t\t\n\t\t<!-- 请输入收到的短信验证码 -->\n\t\t<LinearLayout\n\t\t    android:id=\"@+id/nd_bind_group_code\"\n\t\t    style=\"@style/nd3_photo_margin_style\"\n\t\t    android:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\"\n\t\t    >\n\t\t    \n\t\t\t<LinearLayout \n\t\t\t    android:layout_width=\"fill_parent\"\n\t\t\t    android:layout_height=\"wrap_content\"\n\t\t\t    android:layout_weight=\"0.8\"\n\t\t\t    android:orientation=\"vertical\">\n\t\t\t       <!-- 提示 -->\n\t\t\t\t\t<TextView\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_unbind_phone_number_enter_number_tip\"\n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t\t\t>\n\t\t\t\t\t</TextView>\n\t\t\t\n\t\t\t\t\t<!-- 编辑框 -->\n\t\t\t\t\t<EditText\n\t\t\t            android:id=\"@+id/nd_unbind_phone_number_bind_edit_phone_number\" \n\t\t\t            android:layout_width=\"fill_parent\"\n\t\t\t            android:layout_height=\"wrap_content\"\n\t\t\t            android:layout_marginTop=\"@dimen/nd3_margin_size\" \n\t\t\t            android:textColor=\"@color/nd3_white\"\n\t\t           \t\tandroid:background=\"@drawable/nd3_input_gray\"\n\t\t           \t\tandroid:inputType=\"phone\"\n\t\t           \t\tandroid:textSize=\"16.0sp\"\n\t\t\t            android:singleLine=\"true\" >\n\t\t\t        </EditText>\t\n\t\t    \t\t\n\t\t\t</LinearLayout>\n\t\t\t    \n\t\t\t<!-- 和 -->\n\t\t\t<LinearLayout \n\t\t\t\t    android:layout_width=\"wrap_content\"\n\t\t\t    \tandroid:layout_height=\"wrap_content\"\n\t\t\t    \tandroid:gravity=\"center_horizontal\" \n\t\t\t    \tandroid:orientation=\"vertical\">\n\t\t\t\t\t<TextView\n\t\t\t\t\t    android:id=\"@+id/nd_unbind_phone_number_gain_text\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_balance_color\"\t\n\t\t\t\t\t\tandroid:visibility=\"invisible\"\n\t\t\t\t\t\tandroid:gravity=\"right\"/>\n\t\t\t\t\t\n\t\t\t\t\t<Button \n\t\t\t\t\t    android:id=\"@+id/nd_unbind_phone_number_gain\"\n\t\t\t\t    \tandroid:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/nd_bind_phone_number_gain_code\"\n\t\t\t\t\t\tandroid:background=\"@drawable/nd_white_btn\"\n\t\t\t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_margin_size\" \n\t\t\t\t\t\tandroid:textColor=\"@color/nd3_font_color\"\n\t\t\t\t\t\t/>    \n\t\t\t</LinearLayout>\n\t\t</LinearLayout>\n\t\t<!-- 输入绑定的手机号 -->\n\t\t<LinearLayout\n\t\t    style=\"@style/nd3_photo_margin_style\"\n\t\t    android:layout_marginTop=\"@dimen/nd_20\"\n\t\t    android:layout_width=\"fill_parent\"\n\t\t    android:layout_height=\"wrap_content\"\n\t\t    android:orientation=\"vertical\" >\n\t\t    <!-- 提示 -->\n\t\t\t<TextView\n\t\t\t\tandroid:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:gravity=\"left\"\n\t\t\t\tandroid:text=\"@string/nd_bind_phone_number_enter_code_tip\"\n\t\t\t\tandroid:textSize=\"@dimen/nd3_register_agreement_text_size\"\n\t\t\t\tandroid:textColor=\"@color/nd3_white\"\t\t\n\t\t\t\t>\n\t\t\t</TextView>\n\t\t\t<!-- 编辑框 -->\n\t\t\t<EditText\n\t            android:id=\"@+id/nd_unbind_phone_number_bind_edit_code\" \n\t            android:layout_width=\"fill_parent\"\n\t            android:layout_height=\"wrap_content\"\n\t            android:layout_weight=\"1.0\" \n\t            android:textColor=\"@color/nd3_white\"\n\t            android:textSize=\"16.0sp\"\n         \t\t\t\tandroid:background=\"@drawable/nd3_input_gray\"\n         \t\t\t\tandroid:layout_marginTop=\"@dimen/nd3_margin_size\" \n\t            android:singleLine=\"true\" />\n\t       \n\t\t    \t\t\t\t    \t\t\n\t\t</LinearLayout>\t\n\t\t<!-- 绑定手机 -->\t\t\t\t\n\t\t<Button \n\t\t    android:id=\"@+id/nd_unbind_phone_number_bind\"\n\t    \tandroid:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\tandroid:text=\"@string/nd_unbind_phone_number_bind\"\n\t\t\tstyle=\"@style/nd3_text_margin_style_25\"\t\n\t\t\tandroid:background=\"@drawable/nd_blue\"\n\t\t\tandroid:gravity=\"center\"\n\t\t\tandroid:textSize=\"@dimen/nd3_btn_text_size\"\n\t\t\tandroid:textColor=\"@color/nd3_white\"\n\t\t\tandroid:layout_marginTop=\"@dimen/nd_20\"\n\t\t\t/>  \n\t\t \t\t\t  \t\t\t\n</LinearLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n<!-- color -->\n\n\t<color name=\"nd3_white\">#FFFFFF</color>\n\t<color name=\"nd3_black\">#000000</color>\n\t<color name=\"nd3_background\">#EBEBEB</color>\n\t<color name=\"nd3_blue\">#0000FF</color>\n\t<color name=\"nd3_dark_blue\">#415f91</color> \n\t<color name=\"nd3_user_setting_hint_color\">#898989</color>\n\t<color name=\"nd3_recharge_pay_record_bg_color\">#b0b0b0</color>\n\t<color name=\"nd_font_color\">#333333</color>\n\t<color name=\"nd_btn_font_color\">#ffffff</color>\n\t<color name=\"nd3_red\">#ff0000</color>\n\t<color name=\"nd3_list_view_divider\">#898989</color>\n\t<color name=\"nd3_balance_color\">#FFFF8000</color>\n\t\n\t\n\t<color name=\"nd3_hint\">#B3B3B3</color>\n\t\n\t<color name=\"nd_green\">#52e297</color>\n\t\n\t\n\t<!-- begin 未定义 -->\n\t<color name=\"nd3_list_view_item_bg_1\">#FFB8B8B8</color>\n\t<color name=\"nd3_list_view_item_bg_2\">#FFD9D9D9</color>\n\t<!-- end 未定义 -->\n\t\n\t\n\t<color name=\"nd3_account_register_agreement_color\">#FF777777</color>\n\t\n\t<color name=\"nd3_regist_greement_bg\">#f3f3f3</color>\n\t<color name=\"nd3_btn_font_color\">#ffffff</color>\n\t<color name=\"nd3_font_color\">#333333</color>\n\t<color name=\"nd3_conform_pay_font_color\">#000000</color>\n\t\n\t<color name=\"nd3_dark_color\">#FF515151</color>\n\t\n\t<color name=\"nd3_pay_color\">#FFebedec</color>\n\t\n\t<color name=\"nd3_network_error_color\">#FF4f4f4f</color>\n\t<color name=\"nd3_portrait_add_color\">#FF525252</color>\n\t\n\t<color name=\"nd3_records_title_color\">#FF000000</color>\n\t<color name=\"nd3_records_time_color\">#FF515151</color>\n\t<color name=\"nd3_records_time_bg_color_1\">#FFB7B7B7</color>\n\t<color name=\"nd3_records_time_bg_color_2\">#FFd8d8df</color>\n\t\n\t<color name=\"nd3_orchid_color\">#FF9dc4ed</color>\n\t<color name=\"nd_orange_light\">#ffffbb33</color>\n\n<!-- color -->\n\n<!-- Ids -->\n\n\t<item type=\"id\" name=\"nd3_left_btn_id\" />\n\t<item type=\"id\" name=\"nd3_right_btn_id\" />\n\t<item type=\"id\" name=\"nd3_title_txt_id\" />\n\t<item type=\"id\" name=\"nd3_title_progress_bar_id\" />\n \n<!-- Ids -->\n\n<!-- dimen -->\n\n    <dimen name=\"nd3_margin_size\">5dip</dimen>\n\t<dimen name=\"nd3_btn_text_size\">18sp</dimen>\n\t<dimen name=\"nd3_divider_height\">2dip</dimen>\n\t<dimen name=\"nd3_option_item_marginLeft\">10dip</dimen>\n\t\n \n    <dimen name=\"nd3_item_divider\">8dip</dimen>\n    <dimen name=\"nd3_item_height\">45dip</dimen>\n    \n    <dimen name=\"nd3_logout_text_size\">23sp</dimen>\n    \n    <dimen name=\"nd3_bind_phonenumber_paddingTop\">23dip</dimen>\n    \n    <dimen name=\"nd3_image_size\">48dip</dimen>\n    <dimen name=\"nd3_platform_image_size\">30dip</dimen>\n    <dimen name=\"nd3_platform_padding_size\">3dip</dimen>\n    \n    <dimen name=\"nd3_platform_image_size_large\">48dip</dimen>\n    \n    <dimen name=\"nd3_pay_tip_text_size\">16sp</dimen>\n    <dimen name=\"nd3_pay_service_text_size\">12sp</dimen>\n\n\t<dimen name=\"nd3_pay_password_tip_text_size\">18sp</dimen>\n    <dimen name=\"nd3_network_error_tip_text_size\">16sp</dimen>\n    <dimen name=\"nd3_network_error_content_text_size\">12sp</dimen>\n        \n\t<dimen name=\"nd3_portrait_add_text_size\">14sp</dimen>\n\t\n\t<dimen name=\"nd3_register_agreement_text_size\">16sp</dimen>\n\t<dimen name=\"nd3_register_sendsms_text_size\">12sp</dimen>\n\n\t<dimen name=\"nd3_records_title_text_size\">14sp</dimen>\n\t<dimen name=\"nd3_records_time_text_size\">12sp</dimen>\n\n\t<dimen name=\"nd3_option_margin_top\">15dip</dimen>\n\n\t<dimen name=\"nd_goods_flag_w\">68dip</dimen>\n\t<dimen name=\"nd_goods_flag_h\">25dip</dimen>\n\t<dimen name=\"nd_goods_detail_size\">85dip</dimen>\n\t<dimen name=\"nd_about_size\">3dip</dimen>\n\t\n\t<dimen name=\"nd_20\">20dip</dimen>\n\t<dimen name=\"nd_50\">50dip</dimen>\n\t<dimen name=\"nd_10\">10dip</dimen>\n\t \n\n<!-- dimen -->\n\n<!-- styles -->\n\n<!-- 定义文本等样式，不包含边距等 -->\n<!-- 顶部条标题 -->\n<style name=\"nd3_textview_0\" parent=\"@android:style/TextAppearance\">\n\t<item name=\"android:textSize\">24sp</item>\n\t<item name=\"android:textColor\">@color/nd3_white</item>\n\t<item name=\"android:textStyle\">bold</item>\n</style>\n\n<!-- 列表项， 用户名... -->\n<style name=\"nd3_textview_1\" parent=\"@android:style/TextAppearance\">\n\t<item name=\"android:textSize\">20sp</item>\n\t<item name=\"android:textColor\">@color/nd3_black</item>\n</style>\n\n<!-- 列表项，心情... -->\n<style name=\"nd3_textview_2\" parent=\"@android:style/TextAppearance\">\n\t<item name=\"android:textSize\">16sp</item>\n\t<item name=\"android:textColor\">@color/nd3_dark_color</item>\n</style>\n\n\n<!-- 列表项，排行榜    如\"积分排行榜\"  ->-->\n<style name=\"nd3_textview_3\" parent=\"@android:style/TextAppearance\">\n\t<item name=\"android:textSize\">18sp</item>\n\t<item name=\"android:textColor\">@color/nd3_black</item>\n</style>\n\n<!-- 列表项，排行榜...排名 >-->\n<style name=\"nd3_textview_4\" parent=\"@android:style/TextAppearance\">\n\t<item name=\"android:textSize\">16sp</item>\n\t<item name=\"android:textColor\">@color/nd3_dark_color</item>\n</style>\n<!-- 列表项，排行榜...时间 >-->\n<style name=\"nd3_textview_5\" parent=\"@android:style/TextAppearance\">\n\t<item name=\"android:textSize\">14sp</item>\n\t<item name=\"android:textColor\">@color/nd3_dark_color</item>\n</style>\n\n\n<!-- 编辑框 -->\n<style name=\"nd3_option_edittext_style\">\n\t<item name=\"android:textSize\">16sp</item>\n\t<item name=\"android:background\">@null</item>\n\t<item name=\"android:textColor\">#FF000000</item>\n</style>\n\n<!-- 文本框 -->\n<style name=\"nd3_option_textview_style\">\n\t<item name=\"android:textSize\">16sp</item>\n\t<item name=\"android:textStyle\">bold</item>\n\t<item name=\"android:textColor\">#FF000000</item>\t\n</style>\n\n<!-- 外框 -->\n<style name=\"nd3_option_margin_padding_style\">\n\t\t\t\t\n\t<item name=\"android:layout_marginTop\">0dip</item>\n\t<item name=\"android:layout_marginBottom\">15dip</item>\n\t<item name=\"android:layout_marginLeft\">10dip</item>\n\t<item name=\"android:layout_marginRight\">10dip</item>\t\n\n\t<item name=\"android:paddingTop\">10dip</item>\n\t<item name=\"android:paddingBottom\">10dip</item>\n\t<item name=\"android:paddingLeft\">10dip</item>\n\t<item name=\"android:paddingRight\">10dip</item>\n\t\n</style>\n\n<style name=\"nd3_option_margin_style\">\n\t\t\t\t\n\t<item name=\"android:layout_marginTop\">0dip</item>\n\t<item name=\"android:layout_marginBottom\">15dip</item>\n\t<item name=\"android:layout_marginLeft\">10dip</item>\n\t<item name=\"android:layout_marginRight\">10dip</item>\t\n\n</style>\n\n<style name=\"nd3_option_item_margin_style\">\n\t\t\t\t\n\t<item name=\"android:layout_marginTop\">10dip</item>\n\t<item name=\"android:layout_marginBottom\">10dip</item>\n\t<item name=\"android:layout_marginLeft\">10dip</item>\n\t<item name=\"android:layout_marginRight\">10dip</item>\t\n\t\t\n</style>\n\n<style name=\"nd3_photo_margin_style\"> \n    <item name=\"android:layout_marginTop\">10dip</item>\n\t<item name=\"android:layout_marginLeft\">20dip</item>\n\t<item name=\"android:layout_marginRight\">20dip</item>\t\n\t\t\n</style>\n<style name=\"nd3_text_margin_style_25\"> \n\t<item name=\"android:layout_marginLeft\">25dip</item>\n\t<item name=\"android:layout_marginRight\">25dip</item>\t\n\t\t\n</style>\n\n<style name=\"nd3_margin_style_20\"> \n    <item name=\"android:layout_marginTop\">20dip</item>\n\t<item name=\"android:layout_marginLeft\">20dip</item>\n\t<item name=\"android:layout_marginRight\">20dip</item> \n</style>\n    \n\n<style name=\"nd3_button_margin_style\"> \n\t<item name=\"android:layout_marginLeft\">50dip</item>\n\t<item name=\"android:layout_marginRight\">50dip</item>\t\n</style>\n\n<style name=\"nd3_option_item_padding_style\">\n\t\t\t\t\n\t<item name=\"android:paddingTop\">10dip</item>\n\t<item name=\"android:paddingBottom\">10dip</item>\n\t<item name=\"android:paddingLeft\">10dip</item>\n\t<item name=\"android:paddingRight\">10dip</item>\t\n\t\t\n</style>\n\n<style name=\"nd_goods_item_style\">\n\t<item name=\"android:textSize\">16sp</item>\n\t<item name=\"android:textColor\">@color/nd3_black</item>\n</style>\n\n<style name=\"nd_check_version_style\">\n\t<item name=\"android:textSize\">16sp</item> \n\t<item name=\"android:textStyle\">bold</item>\n\t<item name=\"android:textColor\">@android:color/darker_gray</item>\n</style>\n<!-- styles -->\n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_sdk_error_strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n\t<string name=\"nd3_sdk_error_not_found\">未知错误码：</string>\n\n    <string name=\"nd3_sdk_error_unknown\">未知错误</string>\n    <string name=\"nd3_sdk_error_network_fail\">网络连接错误</string>\n    <string name=\"nd3_sdk_error_package_invalid\">数据包不全、丢失或无效</string>\n    <string name=\"nd3_sdk_error_sessionid_invalid\">SessionId（用户的会话标识）无效</string>\n    <string name=\"nd3_sdk_error_param\">参数值错误或非法，请检查参数值是否有效</string>\n    <string name=\"nd3_sdk_error_client_app_id_invalid\">无效的应用ID接入</string>\n    <string name=\"nd3_sdk_error_network_error\">网络请求发生错误</string>\n    <string name=\"nd3_sdk_error_app_key_invalid\">该用户未授权接入（AppKey无效）</string>\n    <string name=\"nd3_sdk_error_no_sim\">未检测到SIM卡</string>\n    <string name=\"nd3_sdk_error_server_return_error\">服务器处理发生错误，请求无法完成</string>\n    <string name=\"nd3_sdk_error_has_not_login\">未登录</string>\n    <string name=\"nd3_sdk_error_account_invalid\">账号格式不合法，合法账号为4－70个字符，仅允许小写字母及数字，支持邮箱注册</string>\n    <string name=\"nd3_sdk_error_password_invalid\">密码格式不合法，密码不能为空，长度为6－12个字符，由字母和数字组成，大小写敏感</string>\n    <string name=\"nd3_sdk_error_login_fail\">登录失败</string>\n    <string name=\"nd3_sdk_error_account_not_exist\">账号不存在或停用</string>\n    <string name=\"nd3_sdk_error_account_password_error\">账号密码错误</string>\n    <string name=\"nd3_sdk_error_too_much_account_registed\">该手机或号码已经注册了n个账号</string>\n    <string name=\"nd3_sdk_error_regist_fail\">注册失败</string>\n    <string name=\"nd3_sdk_error_account_has_exist\">该91通行证账号已经被注册</string>\n    <string name=\"nd3_sdk_error_verify_account_fail\">账号验证失败</string>\n    <string name=\"nd3_sdk_error_nickname_invalid\">昵称不合法，合法昵称由1－16个非空字符构成，请勿使用敏感词汇</string>\n    <string name=\"nd3_sdk_error_new_password_invalid\">新密码格式非法，密码不能为空，长度为6－12个字符，由字母和数字组成，大小写敏感</string>\n    <string name=\"nd3_sdk_error_old_password_invalid\">请输入正确的原密码</string>\n    <string name=\"nd3_sdk_error_old_password_error\">请输入正确的原密码</string>\n    <string name=\"nd3_sdk_error_has_set_phone_num\">该用户已经设定了手机号码</string>\n    <string name=\"nd3_sdk_error_phone_has_registed\">该手机号已经被注册</string>\n    <string name=\"nd3_sdk_error_phone_send_repeated\">指定时间内不能重复发送（手机注册短信验证码）</string>\n    <string name=\"nd3_sdk_error_phone_verify_code_invalid\">手机短信验证码无效</string>\n    <string name=\"nd3_sdk_error_true_name_invalid\">真实姓名不合法</string>\n    <string name=\"nd3_sdk_error_emotion_length_too_long\">心情长度太长，不能超过140个字符</string>\n    <string name=\"nd3_sdk_error_emotion_content_invalid\">内容不合法</string>\n    <string name=\"nd3_sdk_error_permission_not_enough\">他（她）已不是您的好友，禁止当前操作！</string>\n    <string name=\"nd3_sdk_error_image_size_too_large\">发送的图片数据超过了服务器允许的大小</string>\n    <string name=\"nd3_sdk_error_image_data_invalid\">发送的图片数据内容不合法</string>\n    <string name=\"nd3_sdk_error_photo_not_changed\">头像没有变更</string>\n    <string name=\"nd3_sdk_error_no_custom_photo\">该用户没有自定义头像</string>\n    <string name=\"nd3_sdk_error_app_not_exist\">该应用不存在</string>\n    <string name=\"nd3_sdk_error_icon_not_changed\">图标没有变更</string>\n    <string name=\"nd3_sdk_error_no_custom_app_icon\">无自定义图标</string>\n    <string name=\"nd3_sdk_error_pay_password_error\">支付密码错误</string>\n    <string name=\"nd3_sdk_error_pay_account_not_actived\">该账号未在商城开户</string>\n    <string name=\"nd3_sdk_error_pay_password_not_set\">支付密码未设置</string>\n    <string name=\"nd3_sdk_error_pay_password_not_verify\">支付密码未验证</string>\n    <string name=\"nd3_sdk_error_balance_not_enough\">余额不足</string>\n    <string name=\"nd3_sdk_error_order_serial_duplicate\">订单号重复</string>\n    <string name=\"nd3_sdk_error_page_required_not_valid\">页码超过范围</string>\n    <string name=\"nd3_sdk_error_recharge_money_invalid\">充值面额非法</string>\n    <string name=\"nd3_sdk_error_sms_recharge_account_invalid\">短信支付账号无效</string>\n    <string name=\"nd3_sdk_error_no_phone_num\">没有手机号码，账号未绑定手机号</string>\n    <string name=\"nd3_sdk_error_recharge_card_number_error\">充值卡卡号无效</string>\n    <string name=\"nd3_sdk_error_recharge_card_password_error\">充值卡密码无效</string>\n    <string name=\"nd3_sdk_error_recharge_card_type_not_support\">充值卡类型不支持</string>\n    <string name=\"nd3_sdk_error_user_not_exist\">该用户不存在</string>\n    <string name=\"nd3_sdk_error_friend_not_exist\">该好友不存在</string>\n    <string name=\"nd3_sdk_error_not_allowed_to_be_added\">用户不允许被添加好友</string>\n    <string name=\"nd3_sdk_error_already_be_your_friend\">用户已经是您的好友</string>\n    <string name=\"nd3_sdk_error_note_length_invalid\">备注长度不合法</string>\n    <string name=\"nd3_sdk_error_arrive_max_friend_num\">您或对方已经到达好友个数上限</string>\n    <string name=\"nd3_sdk_error_app_id_invalid\">应用Id不合法</string>\n    <string name=\"nd3_sdk_error_activity_type_invalid\">动态类型不合法</string>\n    <string name=\"nd3_sdk_error_msg_not_exist\">没有该条消息</string>\n    <string name=\"nd3_sdk_error_content_length_invalid\">内容长度不合法</string>\n    <string name=\"nd3_sdk_error_not_allowed_to_send_msg\">发送者被禁止发消息</string>\n    <string name=\"nd3_sdk_error_can_not_send_msg_to_self\">不能给自己发送短消息</string>\n    <string name=\"nd3_sdk_error_client_tag\">该标签为客户端标签</string>\n    <string name=\"nd3_sdk_error_invalid_command_tag\">无效的标签指令</string>\n    <string name=\"nd3_sdk_error_invalid_content_tag\">无效的标签文本</string>\n    <string name=\"nd3_sdk_error_custom_tag_arg_not_enough\">自定义标签参数不足</string>\n    <string name=\"nd3_sdk_error_custom_tag_arg_not_invalid\">自定义标签参数无效</string>\n    <string name=\"nd3_sdk_error_feedback_id_invalid\">反馈类型无效</string>\n    <string name=\"nd3_sdk_error_too_much_account_logined\">您手机卡登录账号个数已达上限</string>\n    <string name=\"nd3_sdk_error_app_unpass_checked\">业务系统未通过审核</string>\n    <string name=\"nd3_sdk_error_act_unpermisstion_access\">接口不允许调用</string>\n    <string name=\"nd3_sdk_error_ignore_upload\">相同的通讯录已经上传，忽略此次上传</string>\n    \n     \n    <string name=\"nd3_sdk_error_cancel\">取消操作</string>\n    <string name=\"nd3_sdk_error_param_invalid\">参数无效</string>\n    <string name=\"nd3_sdk_error_icon_unexist\">该图标不存在</string>\n    <string name=\"nd3_sdk_error_modeid_invalid\">模板ID无效</string>\n    <string name=\"nd3_sdk_error_mode_param_invalid\">模板参数无效</string>\n    <string name=\"nd3_sdk_error_pay_failure\">支付失败</string>\n    <string name=\"nd3_sdk_error_cancel_pay\">取消支付</string>\n    <string name=\"nd3_sdk_error_leadbroad_unexist\">该排行榜不存在</string>\n    <string name=\"nd3_sdk_error_leadbroad_list_unexist\">用户排行列表不存在</string>\n    <string name=\"nd3_sdk_error_unplay_friend\">该用户没有好友在玩</string>\n    <string name=\"nd3_sdk_error_achive_unexist\">成就不存在</string>\n    <string name=\"nd3_sdk_error_unbind_thirdaccount\">用户没有绑定第三方账号</string>\n    <string name=\"nd3_sdk_error_repeat_share_content\">分享内容重复</string>\n    <string name=\"nd3_sdk_error_unexist_order\">无此订单</string>\n    <string name=\"nd3_sdk_error_substitue_uncurrent_user\">该代付订单的代付人不是当前用户</string>\n    <string name=\"nd3_sdk_error_nonfriend\">对方不是你的好友</string>\n    <string name=\"nd3_sdk_error_nonfriend_thirdaccount\">该第三方账号没有好友</string>\n    <string name=\"nd3_sdk_error_binded_thirdplatform\">已经绑定指定类型的第三方账号</string>\n    <string name=\"nd3_sdk_error_binded_other_91account\">第三方账号已经绑定其他91账号</string>\n    <string name=\"nd3_sdk_error_binded_91account\">已经绑定91账号</string>\n    <string name=\"nd3_sdk_error_miss_third_login_info\">第三方登陆信息丢失</string>\n    <string name=\"nd3_sdk_error_unabled_check_thirdacc_password\">无法验证第三方账号密码</string>\n    <string name=\"nd3_sdk_error_third_bind_91acc_exception\">第三方账号绑定的91账号异常(停用等)</string>\n    \n    \n    \n    <string name=\"nd_sdk_error_product_cate_invalid\">商品类型无效</string>\n    <string name=\"nd_sdk_error_fee_type_invalid\">计费类型无效</string>\n    \n    <string name=\"nd_sdk_error_info_unexists\">该第三方信息不存在</string>\n    <string name=\"nd_sdk_error_can_not_unbind\">不能解除当前登录的第三方账号的绑定</string>\n    <string name=\"nd_sdk_error_not_match_account\">当前登录的第三方账号与已绑定的第三方账号不符</string>\n    \n    \n    \n    <string name=\"nd_sdk_error_resend\">重复发送</string>\n    <string name=\"nd_sdk_error_time_out\">支付超时,请稍后重试</string>\n    <string name=\"nd_sdk_error_use_valid\">虚拟物品使用标志无效</string>\n    <string name=\"nd_sdk_error_goods_id_valid\">商品ID无效</string>\n    <string name=\"nd_sdk_error_sdk_valid\">无效的平台SDK版本号</string>\n    \n    <string name=\"nd_sdk_error_mPhoto_too_large\">图片大小不能超过1M</string>\n    \n    <string name=\"nd_sdk_error_phoneno_invalid\">手机号码格式无效</string>\n    <string name=\"nd_sdk_error_rebind\">重复绑定，账号已经绑定手机号</string>\n    <string name=\"nd_sdk_error_has_bind\">手机号已经绑定其他账号</string>\n    <!-- <string name=\"nd_sdk_error_unbind\">手机号码未绑定</string> -->\n    <string name=\"nd_sdk_error_phoneno_inconstistent\">手机号码与绑定手机号码不一致</string>\n    <string name=\"nd_sdk_error_smscode_error\">短信验证码错误</string>\n    <string name=\"nd_sdk_error_smscode_expired\">短信验证码过期</string>\n    <string name=\"nd_sdk_error_unbind_phone\">账号未绑定任何手机号</string>\n    <string name=\"nd_sdk_error_not_verified\">未通过手机号码验证</string>\n    <string name=\"nd_sdk_error_un_condition\">不符合抽奖条件</string>\n    <string name=\"nd_sdk_error_lotteryed\">已经抽过奖</string> \n    <string name=\"nd_sdk_error_send_too_more\">短信发送次数过多</string>\n    <string name=\"nd_sdk_error_vip_cant_find\">VIP用户无法使用手机号码找回密码 </string> \n    <string name=\"nd_sdk_error_phoneno_before\">手机号码前后不一致 </string>\n    \n    <string name=\"nd_sdk_error_contloginbyguest\">有关联的91账号，不能以游客方式登录 </string>\n    <string name=\"nd_sdk_error_unneet_official\">非游客登录状态 </string>\n    <string name=\"nd_sdk_error_uin_unvalid\">Uin不合法 </string>    \n    <string name=\"nd_sdk_error_uin_unvalid_account\">账号无效(可能是保留账号) </string>\n    <string name=\"nd_sdk_error_uin_token_unvalid\">自动登录凭据失效，请重新输入密码登录</string>\n     \n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\"> \n    \n    <string name=\"nd3_category_home\">首页</string>\n    <string name=\"nd3_category_friend\">好友</string>\n    <string name=\"nd3_category_message\">消息</string>\n    <string name=\"nd3_category_game\">精品</string>\n    <string name=\"nd3_category_more\">更多</string>\n    \n    <string name=\"nd3_activity_dispose\">请重新登录</string> \n    \n    <string name=\"nd3_delete\">删除</string>\n    <string name=\"nd3_cancel\">取消</string>\n    \n    \n    <string name=\"nd3_achieve_rank\">成就榜</string>\n    <string name=\"nd3_ranking\">排行榜</string>\n    <string name=\"nd3_show_bbs_detail\">论坛</string>\n    <string name=\"nd3_show_player\">看看谁在玩</string>\n    <string name=\"nd3_invite_friend\">邀请好友</string>\n    <string name=\"nd3_bizarre_friend\">新鲜事</string>\n     \n    <string name=\"nd3_game\">游戏</string>\n    <string name=\"nd3_friend_count\">好友(%1$s)</string>\n    <string name=\"nd3_message_refresh\">刷新</string>\n     \n    <string name=\"nd3_friend_main_title\">我的好友</string>\n    <string name=\"nd3_topbar_ret\">返回</string>\n    <string name=\"nd3_may_know_person\">可能认识的人</string>\n    <string name=\"nd3_list_item_loading\">正在加载数据…</string> \n    <string name=\"nd3_list_item_loading_fail\">加载数据失败，请点击重试</string> \n    <string name=\"nd3_no_may_known_person_tip\">暂时没有可能认识的人！</string>\n    <string name=\"nd3_no_who_play_tip\">内牛满面~~没有人玩游戏。</string>\n    <string name=\"nd3_no_myfriend_tip\">暂时没有好友！</string>\n    <string name=\"nd3_list_view_more_record\">更多记录......</string>\n    <string name=\"nd3_ta_friend_title\">%1$s的好友</string>\n    <string name=\"nd3_ta_friend_title_1\">Ta的好友</string>\n    <string name=\"nd3_normal_search_friend_title\">查找用户</string>\n    <string name=\"nd3_normal_search_friend_title_1\">按昵称查找用户</string>\n    <string name=\"nd3_normal_search_friend_title_2\">按通行证查找用户</string>\n    <string name=\"nd3_advance_search_friend_title\">按分类查找用户</string>\n    <string name=\"nd3_age_unit\">岁</string>\n    <string name=\"nd3_no_rank_current\">当前用户暂时没有排名！</string>\n    <string name=\"nd3_no_fangle_tip\">今日风平浪静，无事发生。</string>\n    <string name=\"nd3_no_constrait_tip\">不限</string>\n    <string name=\"nd3_no_my_friend\">别偷懒，快去加好友吧!</string>\n    <string name=\"nd3_no_invite_91_friend\">人都跑哪去了！都在躲猫猫吗？</string>\n    <string name=\"nd3_no_invite_sina_friend\">太懒了吧，一个好友都没有！</string>\n    <string name=\"nd3_no_user_info_tip\">这家伙很懒，什么都没留下！</string>\n    <string name=\"nd3_no_message_tip\">暂时没有消息记录！</string>\n   \n  \n    \n    <!-- begin -未定义 -->\n    <string name=\"nd3_normal_search_friend_btn_txt\">搜索</string>\n    <string name=\"nd3_search_friend_no_data_txt\">抱歉，没有找到相关记录！</string>\n    <!-- end -未定义 -->\n    \n    <string name=\"nd3_ta_app_title\">%1$s的游戏</string>\n    <string name=\"nd3_ta_app_title_1\">Ta的游戏</string>\n    <string name=\"nd3_age\">年龄：</string>\n    \n    <string name=\"nd3_mood_hint\">不要超过30个字哦~</string>\n    <string name=\"nd3_edit_mood\">编辑心情</string>\n    <string name=\"nd3_complete\">完成</string>\n    <string name=\"nd3_submit_success\">提交成功</string> \n    <string name=\"nd3_submit\">提交</string> \n    \n    <string name=\"nd3_ta_activity_title\">%1$s的新鲜事</string>\n    <string name=\"nd3_ta_activity_title_1\">Ta的新鲜事</string>\n   \n    \n    <string name=\"nd3_who_play_title\">看看谁在玩</string>\n    <string name=\"nd3_my_friend_title\">我的好友</string>\n    <string name=\"nd3_achievement_title\">@string/nd3_achieve_rank</string>\n    <string name=\"nd3_no_achievement_tip\">暂时没有成就！</string>\n    <string name=\"nd3_rank_category_title\">@string/nd3_ranking</string>\n    <string name=\"nd3_no_rank_category_tip\">暂时没有排行榜！</string>\n     \n    <string name=\"nd3_rank_share_btn_txt\">分享</string>\n    <string name=\"nd3_self_rank_content_fmt\">%1$s还没有分数</string>\n    <string name=\"nd3_other_rank_content_fmt\">%1$s分</string>\n    <string name=\"nd3_no_leaderboard_tip\">@string/nd3_no_rank_category_tip</string>\n    <string name=\"nd3_my_message_title\">我的消息</string>\n    <string name=\"nd3_sys_message_title\">系统消息</string>\n    <string name=\"nd3_my_message_send\">发送</string>\n    <string name=\"nd3_no_my_message_tip\">暂时没有消息，记得常和好友联系噢！</string>\n    <string name=\"nd3_no_sys_message_tip\">暂时没有消息记录！</string>\n    <string name=\"nd3_friend_message_receiver_title\">选取好友</string>\n    <string name=\"nd3_stranger_add_friend\">加为好友</string>\n    <string name=\"nd3_invite_flag\">邀请</string>\n    <string name=\"nd3_invite_flag_1\">已邀请</string>\n    <string name=\"nd3_invite_all\">邀请全部</string>\n    <string name=\"nd3_invite_sina_microblog_friend_title\">邀请新浪微博好友!</string>\n    <string name=\"nd3_no_friend_tip\">暂时没有%1$s好友!</string>\n    <string name=\"nd3_no_ta_friend_tip\">Ta还没有好友</string>\n    <string name=\"nd3_no_ta_app_tip\">Ta还没有玩游戏 ！</string>\n    \n    <string name=\"nd3_activity_action_btn_txt_1\">查看 %1$s</string>\n    <string name=\"nd3_activity_action_btn_txt_2\">查看 %1$s</string>\n   \n   \t<!-- 账号界面相关（登录、注册） -->\n   \t<string name=\"nd3_account_login_title\">登录</string>\n   \t<string name=\"nd3_account_login_title_land\">91社区登录</string>\n   \t<string name=\"nd3_account_login_button_left\">1秒注册</string>\n   \t<string name=\"nd3_account_login_button_right\">登录</string>\n   \t<string name=\"nd3_account_login_tip_account\">通行证：</string>\n   \t<string name=\"nd3_account_login_hint_account\"></string>\n   \t<string name=\"nd3_account_login_tip_password\">密码：　</string>\n   \t<string name=\"nd3_account_login_hint_password\"></string>\n   \t<string name=\"nd3_account_login_tip_auto_login\">自动登录</string>\n   \t<string name=\"nd3_account_login_tip_use_other_login\">其他账号登录</string>\n   \t<string name=\"nd3_account_login_tip_other_login\">其他账号登录</string>\n   \t<string name=\"nd3_account_login_tip_other_platform\">%1$s账户登录</string>\n   \t<string name=\"nd3_account_login_cancel\">取消</string>\n   \t<string name=\"nd3_account_login_click_to_find\">点击这里找回</string>\n   \t<string name=\"nd3_account_login_no_account\">没有91通行证？</string>\n   \t<string name=\"nd3_account_login_no_account_reg\">1秒注册</string>\n   \t<string name=\"nd3_use_other_account\">已有账号登录</string>\n   \t<string name=\"nd3_91acount_check\">账号应为4–70个字符，限小写字母、数字、邮箱账号</string>\n\t<string name=\"nd3_password_null\">密码应为6–12个字符，限字母、数字，区分大小写</string>\n\t<string name=\"nd3_pay_password_null\">支付密码不能为空</string>\n\n   \t<string name=\"nd3_account_register_title\">注册</string>\n   \t<string name=\"nd3_account_register_button_left\">返回</string>\n   \t<string name=\"nd3_account_register_button_right\">完成</string>\n   \t<string name=\"nd3_account_register_button_gain_code\">获取验证码</string>\n   \t<string name=\"nd3_account_register_button_wait_format\">%1$02d秒后重发验证码</string>\n   \t<string name=\"nd3_account_register_phone\">手机注册</string>\n   \t<string name=\"nd3_account_register_phone_tip\">您可以使用手机号作为通行证账号，您需要使用该手机接收验证码，才能完成注册。</string>\n   \t<string name=\"nd3_account_register_quick\">快速注册</string>\n   \t<string name=\"nd3_account_register_quick_tip\">您可以输入邮箱、小写字母/数字作为通行证账号，也可以使用系统为您默认分配的账号。</string>\n   \t<string name=\"nd3_account_register_tip_account\">通行证：</string>\n   \t<string name=\"nd3_account_register_tip_phone\">手机号：</string>\n   \t<string name=\"nd3_account_register_tip_code\">输入验证码：</string>\n   \t<string name=\"nd3_account_register_hint_account\">小写字母、数字、邮箱</string>\n   \t<string name=\"nd3_account_register_tip_nickname\">昵称：　</string>\n   \t<string name=\"nd3_account_register_hint_nickname\">10字以内</string>\n   \t<string name=\"nd3_account_register_hint_phone\">请输入手机号</string>\n   \t<string name=\"nd3_account_register_hint_code\">请输入短信验证码</string>\n   \t<string name=\"nd3_account_register_tip_password\">密码：　</string>\n   \t<string name=\"nd3_account_register_hint_password\">限6–12个字母、数字哦</string>\n   \t<string name=\"nd3_account_register_agreement\">我已阅读并同意遵守91社区服务条款</string>\n   \t<string name=\"nd3_account_register_agreement_law\">91社区服务条款</string>\n   \t<string name=\"nd3_account_register_initial_register\">首次注册需要发送一条注册短信，由运营商收取正常短信通讯费用不含信息费。</string>\n\t<string name=\"nd3_password_check\">密码应为6–12个字符，限字母、数字，区分大小写</string>\n\t<string name=\"nd3_nickname_null\">昵称应为10个字符以内，支持中文</string>\n\t<string name=\"nd3_phone_phone_empty\">手机号码不能为空</string>\n\t<string name=\"nd3_phone_phone_invalid\">手机号码格式不正确</string>\n\t<string name=\"nd3_phone_pwd_empty\">请输入密码，限6–12个字母、数字</string>\n\t<string name=\"nd3_phone_pwd_invalid\">密码格式错误，限6–12个字母、数字</string>\n\t<string name=\"nd3_phone_code_empty\">请输入验证码</string>\n\t<string name=\"nd3_phone_code_error\">验证码错误，请重输</string>\n\t<string name=\"nd3_phone_code_timeout\">验证码失效，请重新获取</string>\n\t\n\n   \t<string name=\"nd3_account_register_agreement_title\">91社区服务条款</string>\n   \t<string name=\"nd3_account_register_agreement_button_left\">返回</string>\n   \t<string name=\"nd3_account_register_agreement_button_right\"></string>\n   \t\n\t<string name=\"nd3_account_other_login_title\">第三方账户登录</string>\n   \t<string name=\"nd3_account_other_login_button_left\">返回</string>\n   \t<string name=\"nd3_account_other_login_button_right\"></string>\n   \t<string name=\"nd3_account_other_login_sina\">新浪微博账户登录</string>\n\t<string name=\"nd3_account_other_login_other_format\">%1$s账户登录</string>\n\n\t<string name=\"nd3_account_sina_title\">新浪微博账户登录</string>\n   \t<string name=\"nd3_account_sina_button_left\">返回</string>\n   \t<string name=\"nd3_account_sina_button_right\">下一步</string>\n   \t<string name=\"nd3_account_sina_title_format\">%1$s账户登录</string>\n   \t<string name=\"nd3_account_sina_tip_account\">账号：</string>\n   \t<string name=\"nd3_account_sina_hint_account\"></string>\n   \t<string name=\"nd3_account_sina_tip_password\">密码：</string>\n   \t<string name=\"nd3_account_sina_hint_password\"></string>\n   \t\n\t<string name=\"nd3_account_bind_title\">绑定91通行证</string>\n   \t<string name=\"nd3_account_bind_button_left\">返回</string>\n   \t<string name=\"nd3_account_bind_button_right\">下一步</string>\n   \t<string name=\"nd3_account_bind_account\">已经注册过91社区</string>\n   \t<string name=\"nd3_account_bind_register\">还未注册过91社区</string>\n   \t   \t\n\t<string name=\"nd3_account_bind_register_title\">注册91通行证</string>\n   \t<string name=\"nd3_account_bind_register_button_left\">返回</string>\n   \t<string name=\"nd3_account_bind_register_button_right\">下一步</string>\n   \t<string name=\"nd3_account_bind_register_tip_account\">通行证：</string>\n   \t<string name=\"nd3_account_bind_register_hint_account\">小写字母、数字、邮箱</string>\n   \t<string name=\"nd3_account_bind_register_tip_password\">密码：　</string>\n   \t<string name=\"nd3_account_bind_register_hint_password\">限6–12个字母、数字哦</string>\n\t<string name=\"nd3_account_bind_register_agreement\"><u>91通行证使用条款</u></string>   \t\n\t<string name=\"nd3_account_bind_register_already_bind\">91通行证（%1$s）已经绑定过%2$s账号。</string>\n\n\t<string name=\"nd3_account_bind_bind_title\">绑定91通行证</string>\n   \t<string name=\"nd3_account_bind_bind_button_left\">返回</string>\n   \t<string name=\"nd3_account_bind_bind_button_right\">下一步</string>\n   \t<string name=\"nd3_account_bind_bind_tip_account\">通行证：</string>\n   \t<string name=\"nd3_account_bind_bind_hint_account\">输入91通行证</string>\n   \t<string name=\"nd3_account_bind_bind_tip_password\">密码：　</string>\n   \t<string name=\"nd3_account_bind_bind_hint_password\"></string>\n \t<string name=\"nd3_account_bind_bind_content_format\">将%1$s账户与91通行证绑定，和粉丝们一起分享，轻松畅享互动的乐趣！</string>\n \t<string name=\"nd3_account_bind_bind_content\">如果已经注册了91通行证，建议您输入账号进行绑定，方便与好友联系，您也可以选择“跳过”直接进入社区。</string>\n   \t<string name=\"nd3_account_bind_bind_already_bind\">91通行证（%1$s）已经绑定过%2$s账号。</string>\n   \t<string name=\"nd3_account_bind_bind_skip\">跳过</string>\n   \t<string name=\"nd3_account_bind_bind_complete\">OK!绑定91通行证</string>\n   \t \n    <string name=\"nd3_share_my_achieve\">分享我的成就</string>\n \n   \t\n\t<!-- 更多（设置相关） -->\n\t<string name=\"nd3_more_more_title\">更多</string>\n\t<string name=\"nd3_more_more_info\">个人信息管理</string>\n\t<string name=\"nd3_more_more_account\">通行证管理</string>\n\t<string name=\"nd3_more_more_permission\">权限设置</string>\n\t<string name=\"nd3_more_more_recharge\">91豆充值</string>\n\t<string name=\"nd3_more_more_records\">充值消费记录</string>\n\t<string name=\"nd3_more_more_logout\">注销</string>\n\t   \n\t<string name=\"nd3_more_info_title\">个人信息管理</string>\n\t<string name=\"nd3_more_info_button_left\">返回</string>\n\t<string name=\"nd3_more_info_button_right\">完成</string>\n\t<string name=\"nd3_more_info_add_portrait\">添加照片</string>\n\t<string name=\"nd3_more_info_edit_portrait\">编辑</string>\n\t<string name=\"nd3_more_info_tip_real_name\">姓名：</string>\n\t<string name=\"nd3_more_info_hint_real_name\">24字以内</string>\n\t<string name=\"nd3_more_info_tip_nickname\">昵称：</string>\n\t<string name=\"nd3_more_info_hint_nickname\">10字以内</string>\n\t<string name=\"nd3_more_info_tip_sex\">性别：</string>\n\t<string name=\"nd3_more_info_hint_sex\">保密</string>\n\t<string name=\"nd3_more_info_tip_date\">生日：</string>\n\t<string name=\"nd3_more_info_hint_date\">保密</string>\n\t<string name=\"nd3_more_info_tip_address\">居住地：</string>\n\t<string name=\"nd3_more_info_hint_address\">保密</string>\n\t<string name=\"nd3_more_info_portrait_capture\">拍照</string>\n\t<string name=\"nd3_more_info_portrait_gallery\">选取现有图片</string>\n\t<string name=\"nd3_more_info_portrait_cancel\">取消</string>\n\t<string name=\"nd3_more_info_sex_male\">男</string>\n\t<string name=\"nd3_more_info_sex_female\">女</string>\n\t<string name=\"nd3_more_info_sex_secret\">保密</string>\n    <string name=\"nd3_more_info_error_nickname_empty\">昵称应为10个字符以内，支持中文</string>\n    <string name=\"nd3_more_info_error_realname_empty\">真实姓名不能为空</string>\n    <string name=\"nd3_more_info_error_realname_invalid\">真实姓名应为24个字符以内</string>\n    <string name=\"nd3_more_info_error_code_8000\">保存成功</string>\n    <string name=\"nd3_more_info_portrait_add\">添加\\n照片</string>\n    <string name=\"nd3_more_info_portrait_edit\">编辑</string>\n    <string name=\"nd3_more_info_error_code_12000\">上传成功</string>\n    <string name=\"nd3_local_album\">本地相册</string>\n\t<string name=\"nd3_pz\">马上拍照</string>\n\t<string name=\"nd3_return_str\">返回</string>\n\n\t<string name=\"nd3_more_account_title\">通行证管理</string>\n\t<string name=\"nd3_more_account_button_left\">返回</string>\n\t<string name=\"nd3_more_account_button_right\"></string>\n\t<string name=\"nd3_more_account_account_format\">91通行证ID：%1$s</string>\n\t<string name=\"nd3_more_account_autologin\">自动登录</string>\n\t<string name=\"nd3_more_account_password\">修改密码</string>\n\t<string name=\"nd3_more_account_no_set_password\">您尚未设置密码</string>\n\t<string name=\"nd3_more_account_other_login\">绑定第三方账号</string>\n\t<string name=\"nd3_more_account_other_login_format\">绑定%1$s账户</string>\n\t<string name=\"nd3_more_account_bind_hasactivity_label\">绑定手机送好礼</string>\n\t<string name=\"nd3_more_account_bind_label\">绑定手机</string>\n\t<string name=\"nd3_more_account_set_other_login\">绑定第三方账号</string>\n\t<string name=\"nd3_more_account_set_other_login_sina\">设置新浪微博账户登录</string>\n\t<string name=\"nd3_more_account_set_other_login_success\">您的%1$s账号%2$s和91通行证（%3$s）成功绑定！</string>\n\t<string name=\"nd3_more_account_set_other_login_binded\">您要解除绑定%1$s%2$s？</string>\n\t<string name=\"nd3_more_account_other_login_account_format\">设置%1$s账户登录</string>\n\t<string name=\"nd3_more_account_other_login_account_format_2\">%1$s账户登录</string>\n\t<string name=\"nd3_more_account_cannot_bind\">账号处于登录状态不允许解绑</string>\n\t<string name=\"nd3_more_account_has_bind\">已绑定</string>\n\t<string name=\"nd3_more_account_not_bind\">未绑定</string>\n\t<string name=\"nd3_more_account_bind\">立即绑定</string>\n\t\n\t<string name=\"nd3_more_password_title\">修改密码</string>\n\t<string name=\"nd3_more_password_button_left\">返回</string>\n\t<string name=\"nd3_more_password_button_right\">完成</string>\n\t<string name=\"nd3_more_password_tip_old\">旧密码：</string>\n\t<string name=\"nd3_more_password_hint_old\"></string>\n\t<string name=\"nd3_more_password_tip_new\">新密码：</string>\n\t<string name=\"nd3_more_password_hint_new\"></string>\n    <string name=\"nd3_error_oldpsw_empty\">请输入原密码</string>\n    <string name=\"nd3_error_oldpsw_invalid\">原密码应为6–12个字符，限字母、数字，区分大小写</string>\n    <string name=\"nd3_error_newpsw_empty\">请输入新密码</string>\n    <string name=\"nd3_error_newpsw_invalid\">新密码应为6–12个字符，限字母、数字，区分大小写</string>\n    <string name=\"nd3_error_code_5000\">修改成功</string>\n    \n    <string name=\"nd3_more_no_password_title\">设置密码</string>\n    <string name=\"nd3_more_no_password_password\">密码：　　</string>\n    <string name=\"nd3_more_no_password_password_again\">确认密码：</string>\n    <string name=\"nd3_more_no_password_password_content\">成功设置密码后，您可以使用91通行证登录</string>\n    <string name=\"nd3_error_no_password_no_equal\">2次密码不一致，请重新输入</string>\n    <string name=\"nd3_error_no_password_newpsw_invalid\">密码应为6–12个字符，限字母、数字，区分大小写</string>\n    <string name=\"nd3_error_no_password_code_5000\">设置成功</string>\n    \n    <string name=\"nd3_more_bind_check_button_right\">绑定</string>\n\t \n\n\t<string name=\"nd3_more_bind_other_platform_fail\">绑定失败，请重试</string>\n\n\t<string name=\"nd3_more_permission_title\">权限设置</string>\n\t<string name=\"nd3_more_permission_button_left\">返回</string>\n\t<string name=\"nd3_more_permission_button_right\"></string>\n\t<string name=\"nd_more_permission_friend\">添加好友</string>\n\t<string name=\"nd3_more_permission_check\">需要验证</string>\n\t<string name=\"nd3_more_permission_yes\">允许任何人加为好友</string>\n\t<string name=\"nd3_more_permission_no\">不允许任何人加为好友</string>\n\t<string name=\"nd3_error_code_10000\">设置成功</string>\n\t<string name=\"nd_more_permission_pay_pwd\">支付密码</string>\n\t<string name=\"nd_more_permission_pay_pwd_tip\">91豆支付密码验证</string>\n\t<string name=\"nd_more_permission_pay_pwd_content\">支付密码，即您的登录密码或设置过的支付密码。若开启91豆支付密码验证，登录后首次购买时会验证一次支付密码。</string>\n\t<string name=\"nd_more_permission_verify_password\">为保障支付安全，请输入支付密码，未设置支付密码时输入91通行证登录密码</string>\n\t<string name=\"nd_more_permission_verify_password_empty\">请输入支付密码</string>\n\t<string name=\"nd_more_permission_verify_password_error\">支付密码错误，请重输</string>\n\t\t\t\t\t\t\t\n\t<string name=\"nd3_more_records_title\">充值消费记录</string>\n\t<string name=\"nd3_more_records_button_left\">返回</string>\n\t<string name=\"nd3_more_records_button_right\"></string>\n\t<string name=\"nd3_more_records_recharges\">充值记录</string>\n\t<string name=\"nd3_more_records_consumes\">消费记录</string>\n\n\t<string name=\"nd3_more_recharges_title\">充值记录</string>\n\t<string name=\"nd3_more_recharges_button_left\">返回</string>\n\t<string name=\"nd3_more_recharges_button_right\">按月浏览</string>\n\t<string name=\"nd3_more_recharges_item_title\">充值91豆</string>\n\t<string name=\"nd3_more_recharges_item_number\">%1$d个</string>\n\t<string name=\"nd3_more_recharges_item_unit\">个</string>\n\t<string name=\"nd3_more_recharges_month_cancel\">取消</string>\n\t<string name=\"nd3_more_recharges_month_complete\">完成</string>\n\t<string name=\"nd3_more_recharges_month_records_view_by_format\">%1$04d年%2$02d月</string>\n\t<string name=\"nd3_more_recharges_no_recharge_tip\">本月暂无充值记录！</string>\n\t<string name=\"nd3_more_recharges_more\">更多记录…</string>\n\t\n\t<string name=\"nd3_more_recharge_detail_title\">充值记录</string>\n\t<string name=\"nd3_more_recharge_detail_button_left\">返回</string>\n\t<string name=\"nd3_more_recharge_detail_button_right\"></string>\n\t<string name=\"nd3_more_recharge_detail_item_order\">订单号：</string>\n\t<string name=\"nd3_more_recharge_detail_item_date\">充值时间：</string>\n\t<string name=\"nd3_more_recharge_detail_item_type\">充值方式：</string>\n\t<string name=\"nd3_more_recharge_detail_item_money\">充值91豆：</string>\n\n\t<string name=\"nd3_more_consumes_title\">消费记录</string>\n\t<string name=\"nd3_more_consumes_button_left\">返回</string>\n\t<string name=\"nd3_more_consumes_button_right\"></string>\n\t<string name=\"nd3_more_consumes_item_title\">消费91豆</string>\n\t<string name=\"nd3_more_consumes_item_number\">%1$s个</string>\n    <string name=\"nd3_more_consumes_no_consume_tip\">暂无消费记录！</string>\n    <string name=\"nd3_more_consumes_more\">更多记录…</string>\n    \n\t<string name=\"nd3_more_consume_detail_title\">消费记录</string>\n\t<string name=\"nd3_more_consume_detail_button_left\">返回</string>\n\t<string name=\"nd3_more_consume_detail_button_right\"></string>\n\t<string name=\"nd3_more_consume_detail_item_order\">订单号：</string>\n\t<string name=\"nd3_more_consume_detail_item_date\">时间：</string>\n\t<string name=\"nd3_more_consume_detail_item_app\">项目：</string>\n\t<string name=\"nd3_more_consume_detail_item_product\">物品：</string>\n\t<string name=\"nd3_more_consume_detail_item_number\">数量：</string>\n\t<string name=\"nd3_more_consume_detail_item_money\">91豆：</string>\n\t\n\t<string name=\"nd3_send_sms_failure\">很抱歉！短信发送失败！</string>\n    <string name=\"nd3_send_sms_success\">恭喜您！短信发送成功！</string>\n    \n\t<string name=\"nd3_person_info\">个人资料</string>\n\t\n\t<string name=\"nd3_remarks\">备注：</string>\n\t\n\t<string name=\"nd3_invite_91friend\">邀请91好友</string>\n\t<string name=\"nd3_invite_sinafriend\">邀请新浪微博好友</string>\n\t<string name=\"nd3_sina_account\">输入新浪微博账号</string>\n\t<string name=\"nd3_sina_password\">输入新浪微博账号密码</string>\n\t<string name=\"nd3_my_msge\">我的消息</string>\n\t<string name=\"nd3_send\">发送</string>\n\t<string name=\"nd3_send_success\">发送成功</string>\n\t<string name=\"nd3_null_msg\">发送的消息内容不能为空，限制140个字符</string>\n\t<string name=\"nd3_receiver\">收件人：</string>\n\t<string name=\"nd3_send_message_sendhint_str\">内容限制140字</string>\n\t<string name=\"nd_send_message_exceed_len\">您输入的内容太长，已经超出了%1$d个字符</string>\n\t<string name=\"nd3_new_message\">新消息</string>\n\t<string name=\"nd3_error_send_message_content_invalid\">消息不能全部为空格或者换行字符，请重新输入</string>\n\t\t\t\t\t\t   \n \t<!-- 购买（确认购买、购买成功、余额不足） -->\n \t<string name=\"nd3_blance_not_enough\">余额不足</string>\n\t<string name=\"nd3_confim_pay\">确认购买</string>\n\t<string name=\"nd3_pay_success\">购买成功</string>\n\t<string name=\"nd3_pay_fail\">购买失败</string>\n\t<string name=\"nd3_pay_cancel\">取消购买</string>\n\t<string name=\"nd3_blance_not_enough_desc\">您的91豆余额不足，无法购买以下商品：</string>\n\t<string name=\"nd3_blance_not_enough_desc_1\">您的91豆余额不足，需要充值才能购买以下商品：</string>\n\t<string name=\"nd3_app_name\">应用名称</string>\n\t<string name=\"nd3_product_name\">商品名称</string>\n\t<string name=\"nd3_neet_91beans\">所需91豆</string> \n\t<string name=\"nd3_pay_recharge\">充值到账后请返回重新购买。</string>\n\t<string name=\"nd3_pay_after_recharged\">91豆充值到账后自动购买该商品。</string>\n\t<string name=\"nd3_91dou_recharge\">91豆充值</string>\n\t<string name=\"nd3_products_list\">您的购买清单：</string>\n\t<string name=\"nd3_set_91beans_passw\">请输入支付密码：</string>\n\t<string name=\"nd3_passw_desc\">更换账号或使用其他手机登录时，首次支付需要输入91豆支付密码。\\n如果你尚未设置支付密码，可以输入你的登录密码。\\n为了保证支付安全，可以通过http://mpay.91.com/?v=2，网站设置支付密码。</string>\n\t<string name=\"nd3_shopping\">购买</string>\n\t<string name=\"nd3_customer_service\">支付与充值客服电话:<xliff:g id=\"COUNT\">%s</xliff:g></string>\n\t<string name=\"nd3_success_shopping\">您已成功购买以下商品：</string>\n\t<string name=\"nd3_show_consum_records\">消费记录</string>\n\t<string name=\"nd3_yes\">确定</string>\n\t<string name=\"nd3_pay_product_count\">数量</string>\n    <string name=\"nd3_pay_reguid_tips\">由于订单号重复，无法购买此商品。</string>\n    <string name=\"nd3_pay_failure_tips\">由于网络或者服务器原因，无法购买此商品。</string>\n    <string name=\"nd3_pay_timeout_tips\">支付超时,请稍后重试。</string>\n    \n    <!-- 购买（新界面：确认购买，余额不足，代付确认，代付余额不足，购买成功） -->\n    <string name=\"nd3_pay_title_buy\">确认订单</string>\n    <string name=\"nd3_pay_title_buy_success\">购买成功</string>\n    <string name=\"nd3_pay_title_balance_not_enough\">余额不足</string>\n    <string name=\"nd3_pay_title_pay_for_another\">让好友购买</string>\n    <string name=\"nd3_pay_button_back\">返回</string>\n    <string name=\"nd3_pay_button_buy\">购买</string>\n    <string name=\"nd3_pay_button_next\">下一步</string>\n    <string name=\"nd3_pay_button_send\">发送</string>\n    <string name=\"nd3_pay_button_view_consumes\">查看消费记录</string>\n    <string name=\"nd3_pay_button_bean_recharge\">充值</string> \n    <string name=\"nd3_pay_hint_pay_for_another\">还要和Ta说下哦~</string>\n    <string name=\"nd3_pay_hint_pay_for_another_success\">请求发送成功</string>\n    <string name=\"nd3_pay_hint_pay_for_another_fail\">请求发送失败</string>\n    <string name=\"nd3_pay_label_current_balance\">可用余额：</string>\n    <!-- <string name=\"nd3_pay_value_current_balance_format\">%1$s个91豆</string> -->\n    <string name=\"nd3_pay_cannot_pay_by_friend\">您的91豆余额不足，无法代付以下商品：</string>\n    <string name=\"nd3_pay_pay_by_friend\">您的代付清单：</string>\n    <string name=\"nd3_pay_label_app\">游戏：</string>\n    <string name=\"nd3_pay_label_product\">商品：</string>\n    <string name=\"nd3_pay_label_count\">数量：</string>\n    <string name=\"nd3_pay_label_money\">总价：</string>\n    <string name=\"nd3_pay_value_money_format\">%1$s个91豆</string>\n    <string name=\"nd3_pay_label_auto_buy\">91豆充值到账后自动购买该商品。</string>\n    <string name=\"nd3_pay_label_pay_by_friend\">让好友购买</string>\n    <string name=\"nd3_pay_label_service_format\">充值客服电话：%1$s</string>\n    <string name=\"nd3_pay_label_service_format_2\">客服电话：%1$s</string>\n    <string name=\"nd3_pay_label_buy_success\">付款成功，请注意查收商品！</string>\n    <string name=\"nd3_pay_label_view_consumes\">您可以到消费记录查看购买的商品。</string>\n    <string name=\"nd3_pay_label_check_pay_password\">为了您的支付安全，请输入支付密码，若未设置支付密码请输入91通行证登录密码。</string>\n    <string name=\"nd3_pay_label_check_pay_no_password\">请设置支付密码。支付密码可作为91通行证登录密码。</string>\n    <string name=\"nd3_pay_label_pay_title\">此商品已购买过了</string>\n    <string name=\"nd3_pay_label_pay_content\">3–5分钟即可到账，等会儿吧！</string>\n    <string name=\"nd3_pay_friend_empty\">你还没有好友，快去邀请好友吧:)</string>\n    \n    <string name=\"nd3_searchfriend_item2_str\">男</string>\n    <string name=\"nd3_searchfriend_item3_str\">女</string>\n    \n    <string name=\"nd3_addfriend_hint\">请输入验证信息(不要超过20字哦~)</string>\n    \n    \n    <string name=\"nd3_add_friend_default_request_1\">你好啊！</string>\n    <string name=\"nd3_add_friend_default_request_2\">你好！很高兴认识你，做个朋友吧。</string>\n    <string name=\"nd3_add_friend_default_request_3\">石头、剪刀、布，你输了，加我吧。</string>\n    <string name=\"nd3_add_friend_default_request_4\">加你为好友有肉吃，快点加我吧！</string>\n    <string name=\"nd3_add_friend_default_request_5\">这年头加好友还要输入验证信息，我容易嘛我。</string>\n    <string name=\"nd3_add_friend_default_request_6\">给个面子吧，加人被拒99次了。</string>\n    \n    <string name=\"nd3_delete_friend\">删除好友</string>\n    <string name=\"nd3_delete_friend_tips\">真的要删除这个好友吗?</string>\n    \n    <string name=\"nd3_sendmsge\">发送信息</string>\n    <string name=\"nd3_sendmsge_tisp\">不要超过140个字哦~</string>\n    \n    <string name=\"nd3_receiver_null\">收件人不能为空</string> \n    \n    <string name=\"nd3_friend_resources\">个人资料</string> \n    <string name=\"nd3_friend_resources_ext\">好友资料</string> \n    <string name=\"nd3_view_resources\">查看资料</string> \n    \n    <string name=\"nd3_invite_thirdplatform_friend\">邀请%s好友</string> \n    <string name=\"nd3_edit_remark\">设置备注</string> \n    <string name=\"nd3_edit_remark_hint\">限10个字</string>\n    <string name=\"nd3_check_remark\">备注不能为空或全空格</string>\n    \n    <string name=\"nd3_share_success\">分享成功</string>\n    <string name=\"nd3_share_failure\">分享失败</string>\n    \n    <string name=\"nd3_null_account\">账号不能为空</string>\n    <string name=\"nd3_null_password\">密码不能为空</string>\n    <string name=\"nd3_sina\">新浪微博</string>\n    \n    <string name=\"nd3_network_error_title\">不能上网啦！</string>\n    <string name=\"nd3_network_error_content\">看看网络连接，或者一会再试试吧~</string>\n    \n\n    \n     <string name=\"nd3_agree_friend_request\">你已经同意%1$s的请求！</string> \t\n     <string name=\"nd3_refuse_friend_request\">你已经拒绝%1$s的请求！</string> \t\n     <string name=\"nd3_cancel_friend_request\">该订单已经取消！</string>\n\n    <string name=\"nd3_default_my_emotion\">你在想什么呢？快点告诉大家吧！</string>\n    <string name=\"nd3_secret\">保密</string>\n    \n    <string name=\"nd3_add_success\">添加成功</string>\n    <string name=\"nd3_wait_check\">等待好友验证</string>\n    <string name=\"nd3_refuse\">该用户拒绝您的好友添加请求</string> \t\n    \n    <string name=\"nd3_invite91_desc\">我在玩%1$s, 相当好玩,赶快来玩吧~</string>\n    \n    <string name=\"nd3_unmounted_sdcard\">未准备存储卡，无法下载</string>\n    <string name=\"nd3_app_download_title_tip\">下载提示</string>\n    <string name=\"nd3_app_download_confirm\">继续</string>\n    <string name=\"nd3_downapp_failure\">下载应用失败</string>\n    <string name=\"nd3_app_download_too_big_tip\">准备下载%1$s&lt;br/&gt;软件版本%2$s，文件大小%3$s</string>\n    <string name=\"nd3_app_download_too_big_tip_1\">&lt;br/&gt;&lt;br/&gt;&lt;small&gt;文件较大，推荐您使用91手机助手下载安装（sj.91.com），节省手机流量！&lt;/small&gt;</string>\n    \n    <string name=\"nd3_app_feedback_sub_type_1\">改进建议</string>\n    <string name=\"nd3_app_feedback_sub_type_2\">问题反馈</string>\n    <string name=\"nd3_app_feedback_input_hide\">请输入您的意见，我们将不断改进</string> \n    <string name=\"nd3_app_feedback_input_tip\">请填写详细描述(500字以内)</string> \n    <string name=\"nd3_app_feedback_title\">意见反馈</string> \n    <string name=\"nd3_app_feedback_service_app\">%1$s（%2$s）</string>\n    <string name=\"nd3_app_feedback_service_app_1\">%1$s</string>\n    <string name=\"nd3_app_feedback_service_phone\">客服电话:　</string>\n    <string name=\"nd3_app_feedback_success_tip\">非常感谢您的支持！我们会尽快给您回复，请注意查阅91社区系统消息。</string>\n    <string name=\"nd3_share_to\">分享到%1$s</string>\n    \n    \n    <string name=\"nd3_version_force_91helper_2\">发现新版本V%1$s。建议您使用91手机助手升级节省手机流量</string>\n\t<string name=\"nd3_version_force_91helper\">发现新版本V%1$s/%2$s。建议您使用91手机助手升级节省手机流量</string>\n\t<string name=\"nd3_version_force_normal_2\">发现新版本V%1$s。本次更新为强制更新,请您立即升级版本,否则软件将无法正常运行！</string>\n\t<string name=\"nd3_version_force_normal\">发现新版本V%1$s/%2$s。本次更新为强制更新,请您立即升级版本,否则软件将无法正常运行！</string>\n\t<string name=\"nd3_version_intro_91helper_2\">发现新版本V%1$s。建议您使用91手机助手升级节省手机流量</string>\n\t<string name=\"nd3_version_intro_91helper\">发现新版本V%1$s/%2$s。建议您使用91手机助手升级节省手机流量</string>\n\t<string name=\"nd3_version_intro_normal_2\">发现新版本V%1$s</string>\n\t<string name=\"nd3_version_intro_normal\">发现新版本V%1$s/%2$s</string>\n\t\n\t<string name=\"nd3_app_download_progress_1\">已下载 %1$s KB / %2$s KB</string>\n\t<string name=\"nd3_app_download_progress_2\">已下载 %1$s KB / %2$s MB</string>\n    <string name=\"nd3_app_download_progress_3\">已下载 %1$s MB / %2$s MB</string>\n\t<string name=\"nd3_version_update_download_percent\">正在下载 %1$s</string> \n\t<string name=\"nd3_downapp_finish_instant\">%1$s下载完成，是否立即安装？</string>\n\t<string name=\"nd3_downapp_install_confirm_title\">确认安装</string>\n\t<string name=\"nd3_instant\">安装</string>\n\t<string name=\"nd3_version_update_loaded\">%1$s下载完成(点击安装)</string>\n\t<string name=\"nd3_version_update_loading\">%1$s正在下载(点击取消下载)</string>\n\t<string name=\"nd3_version_download_progress\">已下载 %1$s/%2$s</string>\n\t<string name=\"nd3_version_download_progress_2\">已下载 %1$s</string>\n\t\n\n\t<string name=\"nd3_banner_title_format\">%1$s，欢迎你回来！</string>\n\t<string name=\"nd3_call_phone\">您是否需要拨打客服电话？</string>\n\t<string name=\"nd3_call\">拨打</string>\n\t<string name=\"nd3_tips\">提示</string>\n\t<string name=\"nd3_search_input_tips\">输入内容不能为空！</string>\n\t\n\t<string name=\"nd3_year\">年</string>\n\t<string name=\"nd3_month\">月</string>\n\t<string name=\"nd3_date\">日</string>\n\n\t<string name=\"nd_goods_list_title\">商城</string>\n\t<string name=\"nd_goods_no_record\">暂时没有商品！</string>\n\t<string name=\"nd_goods_price_invalid\">商品单价无效</string>\n\t<string name=\"nd_goods_buy_count_invalid\">商品购买数量无效</string>\n\t<string name=\"nd_goods_price_fmt\"> %1$s个91豆</string>\n\t<string name=\"nd_goods_price_org\">原价：</string>\n\t<string name=\"nd_goods_price_sale\">现价：</string>\n\t<string name=\"nd_goods_buy_now\">立刻购买</string>\n\t<string name=\"nd_goods_desc_panel_title\">商品详情：</string>\n\t<string name=\"nd_goods_desc_panel_title1\">可用时长：</string>\n\t<string name=\"nd_goods_desc_panel_title2\">可用次数：</string>\n\t<string name=\"nd_goods_desc_panel_title3\">抢购时间：</string>\n\t<string name=\"nd_goods_desc_panel_title4\">限　　购：</string>\n\t<string name=\"nd_goods_desc_panel_title5\">描　　述：</string>\n\t<string name=\"nd_goods_desc_buy_limit_fmt\">每个ID限购%1$d%2$s商品</string>\n\t<string name=\"nd_goods_desc_use_limit_fmt\">%1$s次</string>\n\t<string name=\"nd_goods_desc_use_no_limit\">无限</string>\n\t<string name=\"nd_goods_desc_valid_limit_fmt\">%1$d天</string>\n\t<string name=\"nd_goods_count_limit_fmt\">最多允许购买%1$d%2$s商品</string>\n\t<string name=\"nd_goods_count_limit_min_fmt\">最少购买1%1$s商品</string>\n\t\n\t<string name=\"nd3_invite_sina_tisp\">不要超过300个字哦~</string>\n\t<string name=\"nd3_invite_null_tisp\">邀请内容不能为空！</string>\n\t\n\t<string name=\"nd3_cancel_share_photo\">取消图片分享</string>\n\t<string name=\"nd3_more_info_photo_add\">添加\\n图片</string>\n\n\t\n\t<string name=\"nd3_feedback_tel_tip\">请留下电话，以便与您联系</string> \n\t\n\t<string name=\"nd3_account_login_tip_forget_password\">忘记密码？</string>\n\t<string name=\"nd3_more_account_secret_set\">密保管理</string>\n\n\t<string name=\"nd3_new_message_tip\">您有%1$d条新消息</string>\n\t<string name=\"nd3_bind_third_account_tip\">绑定更多账号，和好友齐分享</string>\n\t<string name=\"nd3_share_item_name\">分享到%1$s</string>\n\t<string name=\"nd3_unbind_account_tip\">未绑定</string>\n\n\t<string name=\"nd3_more_more_about\">关于我们</string>\n\t<string name=\"nd3_sdkname\">91社区</string>\n\t<string name=\"nd3_version\">版本 %1$s</string>\n\t<string name=\"nd3_company\">开发商：%1$s</string>\n\t<string name=\"nd3_company_title\">开发商：</string>\n\t<string name=\"nd3_sdkcompany\">开发商：网龙.博远无线</string>\n\n\t<string name=\"nd3_bind_account_timeout_tip\">登录超时，请重新登录</string>\n \n\t\n\t<string name=\"nd_checkupdate\">检查更新</string>\n\t<string name=\"nd_update\">更新</string>\n\t<string name=\"nd_curren_version\">当前版本：%1$s</string>\n\t<string name=\"nd_laster_version\">最新版本：%1$s</string>\n\t<string name=\"nd_version_size\">版本大小：%1$s</string>\n\t<string name=\"nd_version_update_tips\">新版本正在下载，请到桌面的消息通知栏查看下载进度。</string>\n\n \n\t\n\t<string name=\"nd_leaderboard_scope_time_today\">今天</string>\n\t<string name=\"nd_leaderboard_scope_time_week\">本周</string>\n\t<string name=\"nd_leaderboard_scope_time_all\">所有时间</string>\n\t<string name=\"nd_leaderboard_self_fmt\">%1$s，排名%2$s, 共%3$d人</string>\n    <string name=\"nd_leaderboard_self\">我</string>\n    <string name=\"nd_leaderboard_other\">Ta</string>\n    <string name=\"nd_leaderboard_you\">您</string>\n\t<string name=\"nd_leaderboard_self_fmt1\">%1$s，排名前%2$s%%，共%3$d人</string>\n\t<string name=\"nd_leaderboard_self_fmt2\">%1$s，排名后%2$s%%，共%3$d人</string>\n\t\n\t<string name=\"nd_leaderboard_all_player\">全部</string>\n\t<string name=\"nd_leaderboard_friend_player\">好友</string>\n\t\n\t<string name=\"nd_debug_model\">当前为测试模式</string>\n\t<string name=\"nd_newapp_desc\">发现新版本您可以更新</string>\n\t<string name=\"nd_is_new_desc\">当前为最新版本，无需更新</string>\n\t<string name=\"nd_update_debug_model\">当前为升级测试模式</string>\n\n\t<string name=\"nd_balance_pre\">余额：</string>\n\n\t\n\t\n\t<string name=\"nd3_bean91\">91豆</string>\n\t<string name=\"nd3_bean91_unit\">个</string>\n\t\n\t<string name=\"nd3_pay_value_current_balance_format\">%1$s个%2$s</string>\n\n\t<string name=\"nd3_pay_button_recharge\">充值</string>\n\t<string name=\"nd3_pay_value_current_balance_virtual_format\">%1$1.2f%2$s%3$s</string>\n\t<string name=\"nd3_pay_value_current_balance_91_format\">%1$1.2f个91豆</string>\n\t\n\t\n\t<string name=\"nd3_notify\">通知</string>\n\t<string name=\"nd3_update_tip\">升级提示</string>\n\t<string name=\"nd3_update_now\">立即升级</string>\n\t<string name=\"nd3_important_update\">重要更新</string>\n \n\t<string name=\"nd3_balance_not_enough_recharge_title\">余额不足</string>\n \t<string name=\"nd3_balance_not_enough_recharge\">余额不足，是否充值？</string>\n \t<string name=\"nd3_request_serial_fail\">请求订单失败</string>\n \t<string name=\"nd3_pay_check_set_password\">请设置91通行证密码，初始支付密码与91通行证密码一致</string>\n \t<string name=\"nd3_pay_check_set_password_empty\">请输入91通行证密码</string>\n \t<string name=\"nd3_pay_check_check_password_fail\">91通行证密码错误，请重新输入</string>\n \t<string name=\"nd3_beyond_pay_max_money\">超过单次购买的最大金额</string>\n \t<string name=\"nd3_beyond_pay_max_count\">超过单次购买的最大数量</string>\n \t<string name=\"nd3_beyond_pay_max_stock\">超过商品的库存</string>\n \t<string name=\"nd3_invite_friend_choice_tip\">小提示：点击好友进行选择，一次可邀请10名</string>\n \t<string name=\"nd3_invite_friend_choice_beyond_max_tip\">本次邀请人数已超10人，您可以下次再邀请。</string>\n \t\n \t<string name=\"nd3_down_lastversion\">新版本下载</string>\n \t<string name=\"nd3_is_update_now\">是否立即下载？</string>\n \t<string name=\"nd3_loaddown\">下载</string>\n \t<string name=\"nd3_apksize_tip\">安装包比较大，建议您使用91手机助手升级节省手机流量。</string>\n \t\n \t<string name=\"nd3_importance_tis\">重要提示</string>\n \t<string name=\"nd3_change_account_tis\">注销账号需重启程序，是否现在重启？</string>\n \t<string name=\"nd3_restart\">重启</string>\n \t\n \t<string name=\"nd3_invite_success\">邀请成功</string>\n \t<string name=\"nd3_ack_app_fail\">连接服务器失败</string>\n \t<string name=\"nd3_auto_login_tip\">正在登录…</string>\n \t \n    <string name=\"nd_bind_phone_title\">绑定手机</string>\n \t<string name=\"nd_bind_phone_unactivity_tip\">您的账号安全级别：低</string>\n \t<string name=\"nd_bind_phone_unactivity_desc\">您尚未绑定手机,忘记密码或账号不慎被盗时将无法通过手机找回密码</string>    \n \t<string name=\"nd_bind_phone_desc_title\">绑定手机有惊喜,开心拿好礼</string>\n \t\n \t<string name=\"nd_bind_phone_number_enter_number_tip\">请输入手机号码</string>\n \t<string name=\"nd_bind_phone_number_enter_code_tip\">请输入短信验证码</string>\n \t<string name=\"nd_bind_phone_number_gain_code\">点击获取验证码</string>\n \t<!-- <string name=\"nd_bind_phone_number_later\">以后绑定</string> -->\n \t<string name=\"nd_bind_phone_number_wait_format\">%1$d秒后重新获取</string>\n \t<string name=\"nd_bind_phone_number_bind\">立即绑定手机</string>\n \t<string name=\"nd_bind_phone_number_error_empty_number\">手机号码不能为空</string>\n \t<string name=\"nd_bind_phone_number_error_invalid_number\">手机号码格式不正确</string>\n \t<string name=\"nd_bind_phone_number_error_empty_code\">请输入验证码</string>\n \t \n \t<string name=\"nd_bind_phone_number_success\">绑定成功</string>\n \t<string name=\"nd_bind_phone_number_join\">我要立即参加</string>\n \t<string name=\"nd_bind_phone_number_leave\">不了,我不想参加</string>\n \t<string name=\"nd_bind_phone_reason\">温馨提示：</string>\n \t<string name=\"nd_bind_phone_reason1\">1. 手机号码仅作为身份验证,我们不会收取任何费用,请放心使用。</string>\n \t<string name=\"nd_bind_phone_reason2\">2. 网龙公司承诺保障您的隐私权益,不会泄露您的手机号码。</string>\n \t<!-- <string name=\"nd_bind_phone_reason3\">•更多贴心服务将陆续为您呈现</string> -->\n \t<string name=\"nd_account_bind_tips\">绑定手机号码保障账号安全,享受91更多贴心服务!</string>\n \t \n \t<string name=\"nd_service_phone\">客服电话：%1$s</string>\n \t<string name=\"nd_sms_had_send_tip\">您的手机将收到一条包含验证码的短信，请注意查收。</string> \n \t<string name=\"nd_bind_phone_failure\">绑定失败</string>   \n \t\n \t<string name=\"nd_bind_phone_result_success_format\">91通行证%1$s已成功绑定手机%2$s恭喜您获得一次抽奖机会,机会仅此一次,快去试试手气吧!</string>\n \t<string name=\"nd_bind_phone_lottery\">试试手气</string>\n \t<string name=\"nd_bind_phone_result_tips\">提示:</string>\n \t<string name=\"nd_bind_phone_result_tips1\">•一个手机号码只能绑定一个帐号</string>\n \t<string name=\"nd_bind_phone_result_tips2\">•一个帐号只能被一个手机号码绑定</string>\n \t<string name=\"nd_bind_phone_result_tips3\">•解除绑定请到91社区进行操作</string> \n \t<string name=\"nd_bind_phone_result_confirm\">确定</string>\n \t<string name=\"nd_bind_phone_result_format_2\">账号%1$s已成功绑定手机%2$s</string>\n \t \n \t\n \t<string name=\"nd_unbind_phone_number_title\">解除绑定</string>\n \t\n \t \n \t<string name=\"nd_unbind_phone_number_wait_format\">%1$d秒后重新获取</string>\n \t<string name=\"nd_unbind_phone_number_enter_number_tip\">请输入手机号码</string>\n \t<string name=\"nd_unbind_phone_number_bind\">解除绑定</string>\n \t<string name=\"nd_unbind_phone_number_error_empty_number\">手机号码不能为空</string>\n \t<string name=\"nd_unbind_phone_number_error_invalid_number\">手机号码格式不正确</string>\n \t<string name=\"nd_unbind_phone_number_error_empty_code\">请输入验证码</string>\n \t<string name=\"nd_unbind_phone_result_success_format\">成功解除绑定!解除绑定后将无法享受更多贴心服务,建议您尽快再次绑定!</string>\n \t<string name=\"nd_unbind_phone_tips\">%1$s已绑定手机%2$s</string>\n \t \n\n\t<string name=\"nd_find_password_tips\">验证绑定的手机号码,快速轻松找回密码!</string>\n\t<string name=\"nd_find_password_no_bind_tips\">手机号码未绑定无法找回密码！您可以登录91安全中心aq.91.com找回密码。</string>\n \t<string name=\"nd_find_password_title\">找回密码</string>\n \t<string name=\"nd_find_password_enter_account_tip\">请输入帐号</string>\n \t<string name=\"nd_find_password_enter_number_tip\">请输入手机号码</string>\n \t<string name=\"nd_find_password_enter_code_tip\">请输入短信验证码</string>\n \t<string name=\"nd_find_password_gain_code\">点击获取验证码</string>\n \t<string name=\"nd_find_password_later\">以后绑定</string>\n \t<string name=\"nd_find_password_wait_format\">%1$d秒后重新获取</string>\n \t<string name=\"nd_find_password_confirm\">确定</string>\n \t<string name=\"nd_find_password_error_empty_account\">请输入帐号</string>\n \t<string name=\"nd_find_password_error_empty_number\">请输入您的手机号码</string>\n \t<string name=\"nd_find_password_error_invalid_number\">手机号格式不对，请重新输入</string>\n \t<string name=\"nd_find_password_error_empty_code\">请输入收到的短信验证码</string>\n \t<string name=\"nd_find_password_error_invalid_code\">验证码错误，请重输</string>\n \t<string name=\"nd_find_password_error_timeout_code\">验证码失效，请重新获取</string>\n \t<string name=\"nd_find_password_error_not_match\">输入的手机号与绑定的手机号不一致，请重新输入</string> \n \t<string name=\"nd_find_password_reset_success\">密码重置成功</string> \n \t<string name=\"nd_find_password_botton_tips\">未绑定手机号码的用户，可以使用电脑登录aq.91.com找回密码，或者联系91客服人工找回，客服热线：0591-87085788</string> \n \t \n \t<string name=\"nd_set_password_title\">重置密码</string>\n \t<string name=\"nd_set_password_password\">新密码：　</string>\n \t<string name=\"nd_set_password_password_hint\">限6–12个字母、数字</string>\n \t<string name=\"nd_set_password_password_again\">确认密码：</string>\n \t<string name=\"nd_set_password_submit\">提交</string>\n \t\t \t\t \t\n \t<string name=\"nd3_curren_account\">当前账户：</string>\n \t<string name=\"nd3_confrim_pay\">确定付款</string>\n \t\n \t<string name=\"nd3_pay_pass_exit\">退出支付中心</string>\n \t<string name=\"nd_pay_success_tips\">若商品未到账，请登录91社区“更多”进行用户反馈</string>\n \n \t\n \t<string name=\"nd_share_concernedmicblog_tips\">分享成功啦！活动随心享，关注有惊喜。是否立即关注%1$s官方微博?</string>\n \t<string name=\"nd_share_concernedmicblog\">立即关注</string>\n \t<string name=\"nd_share_concernedmicblog_success\">感谢您的关注</string>\n \t<string name=\"nd_guest_official_tips\">温馨提示:</string>\n \t<string name=\"nd_guest_official_tips0\">●注册91通行证可以更好地保存您的数据,享受更多贴心服务;</string>\n \t<string name=\"nd_guest_official_tips1\">●您也可以使用已有91通行证登录,但游客模式数据将会丢失。</string>\n \t<string name=\"nd_guest_regist\">注册91通行证</string>\n \t<string name=\"nd_has_account\">我已有91通行证</string>    \n \t\n \t<string name=\"nd_guest_regist_tips\">您现在处于游客模式，为了更好地保护您的数据，请注册91通行证</string>\n \n \t\n \t<string name=\"nd_switch_account\">注销</string>\n \t<string name=\"nd_exit_program\">退出程序</string>\n \t<string name=\"nd3_change_account_tis_no_exit\">您是否要注销当前账号，并使用其它账号登录？</string>\n \t\n    <string name=\"nd_clear\">清空</string>\n \n    \n    <string name=\"nd_bind_phone_account_tips\">你好，%1$s</string>    \n \n    \n    <string name=\"nd_bankunion_request\">请稍等，正在请求订单…… </string>\n    <string name=\"nd_bankunion_request_fail\">请求订单失败 </string>\n \n\t<string name=\"nd_account_manage_title\">帐号管理</string>\n\t<string name=\"nd_btn_back\">返回</string>\n\t<string name=\"nd_btn_edit\">编辑</string> \t\n\t<string name=\"nd_btn_complete\">完成</string>\n\t<string name=\"nd_btn_login\">登录</string>\n\t<string name=\"nd_btn_delete\">删除</string>\n\t\n\t\n\t\n\t<string name=\"nd_softpromotion_title\">精品游戏推荐</string>\n\t<string name=\"nd_softpromotion_download\">立即下载</string>\n\t<string name=\"nd_softpromotion_none\">暂时没有待推广的应用</string>\n\t<string name=\"nd_softpromotion_fail\">获取精品游戏推荐数据失败</string>\n\t<string name=\"nd_softpromotion_download_url_start\">正在请求下载地址……</string>\n\t<string name=\"nd_softpromotion_download_url_fail\">获取下载地址失败</string>\n\t<string name=\"nd_softpromotion_download_fail\">%1$s 下载失败</string>\n\t<string name=\"nd_softpromotion_download_now\">%1$s 正在下载</string>\n\t<string name=\"nd_softpromotion_download_start\">开始下载 %1$s</string>\n\t<string name=\"nd_softpromotion_download_finish\">%1$s 下载完成</string>\n\t\n\t\n\t\n\t<string name=\"nd_feedback_title\">意见反馈</string> \n\t<string name=\"nd_feedback_reply\">客服答复</string> \n\t<string name=\"nd_feedback_reply_0\">新回复</string> \n\t<string name=\"nd_feedback_i_fb\">我要反馈</string>\n\t<string name=\"nd_feedback_choose_problem_type\">请选择问题类型</string> \n\t<string name=\"nd_star\">*</string>\n\t<string name=\"nd_feedback_problem\">您遇到的问题</string> \n\t<string name=\"nd_feedback_input_tip\">输入要求最少10字</string>\n\t<string name=\"nd_feedback_input_count\">500</string>\n\t<string name=\"nd_feedback_phoneno\">您的联系电话</string>\n\t<string name=\"nd_feedback_service_phone\">客服电话：</string>\n\t<string name=\"nd_feedback_service_time\">服务时间：%1$s</string>\n\t<string name=\"nd_feedback_reply1\">您对我的服务是否满意？</string>\n\t<string name=\"nd_feedback_reply2\">麻烦亲抽一点时间帮我打一下分哦</string>\n\t<string name=\"nd_feedback_reply3\">满意</string>\n\t<string name=\"nd_feedback_reply4\">问题未解决</string>\n\t<string name=\"nd_feedback_reply5\">态度不满意</string>\n\t<string name=\"nd_feedback_reply6\">客服答复</string> \n\t<string name=\"nd_feedback_reply7\">请输入您的反馈信息</string>\n\t<string name=\"nd_feedback_reply8\">亲，上面常见问题，可能有您的答案哦</string>\n\t<string name=\"nd_feedback_phoneno1\">请输入您的联系电话</string>\n\t<string name=\"nd_feedback_faq\">常见问题</string>\n\t<string name=\"nd_feedback_my_fb\">我的反馈</string>\n\t<string name=\"nd_feedback_status0\">处理中</string>\n\t<string name=\"nd_feedback_status1\">未评价</string>\n\t<string name=\"nd_feedback_status2\">已评价</string>\n\t<string name=\"nd_feedback_tips0\">谢谢亲的肯定！我一定再接再厉为您提供更优质的服务</string>\n\t<string name=\"nd_feedback_tips1\">您可以继续说明问题</string>\n\t<string name=\"nd_feedback_tips2\">谢谢亲的反馈！我一定尽力改正，期待下次给我好评噢~</string>\n\t<string name=\"nd_feedback_tips3\">谢谢您的回复，我们将在3个工作日之内给你回复，请注意查询回复结果。</string>\n\t<string name=\"nd_feedback_tips4\">暂时没有信息</string>\n\t<string name=\"nd_feedback_tips5\">联系电话格式不正确</string>\n\t<string name=\"nd_feedback_tips6\">您有新的回复</string>\n\t<string name=\"nd_detail\">详情</string>\n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"nd_gcsdk_android_white\">#FFFFFF</color>\n    <!-- 半透明 -->\n    <color name=\"nd_gcsdk_translucent\">#90000000</color>\n    <!-- 全透明 -->\n    <color name=\"nd_gcsdk_transparent\">#00000000</color>\n    \n    <!-- 背景颜色 -->\n    <color name=\"nd_gcsdk_box_bg\">#0C64AB</color>\n</resources>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"nd_gcsdk_dialog\">          \n\t    <item name=\"android:windowFrame\">@null</item>\n        <item name=\"android:windowNoTitle\">true</item>\n        <item name=\"android:windowIsFloating\">true</item>\n        <item name=\"android:windowIsTranslucent\">true</item>\n        <item name=\"android:backgroundDimEnabled\">true</item>\n        <item name=\"android:windowBackground\">@color/nd_gcsdk_transparent</item>\n        <item name=\"android:windowAnimationStyle\">@android:style/Animation.Translucent</item>\n    </style>   \n    \n</resources>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_strings.xml",
    "content": "\n    <resources>\n        <string name=\"nd_gcsdk_pausepage_title\">继续游戏？</string>\n        <string name=\"nd_gcsdk_pausepage_default_text\">点击进入游戏专区</string>\n        \n        <string name=\"nd_gcsdk_exitpage_recently_play\">最近在玩的其他91游戏</string>\n        <string name=\"nd_gcsdk_exitpage_exit_title\">退出%1$s？</string>\n        <string name=\"nd_gcsdk_exitpage_project_title\">接着玩其他精品游戏吗？</string>\n        <string name=\"nd_gcsdk_exitpage_project_btn\">不玩啦，退出</string>\n        <string name=\"nd_gcsdk_exitpage_exit_btn\">退出</string>\n\n        <string name=\"nd_gcsdk_version_update_tips\">新版本正在下载，请到桌面的消息通知栏查看下载进度。</string>\n\n        <string name=\"nd_gcsdk_enter_sdk_gamecenter_download\">请先安装游戏中心</string>\n\n    </resources>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <!-- 靓点推荐-主标题 -->\n    <style name=\"nd_gcsdk_project_main_title\">\n        <item name=\"android:textColor\">#ffffffff</item>\n        <item name=\"android:textStyle\">bold</item>\n        <item name=\"android:textSize\">17sp</item>\n    </style>\n    \n    <!-- 靓点推荐-副标题 -->\n    <style name=\"nd_gcsdk_project_sub_title\">\n        <item name=\"android:textColor\">#7fffffff</item>\n        <item name=\"android:textSize\">13sp</item>\n    </style>\n    \n    <!-- 靓点推荐-标签 -->\n    <style name=\"nd_gcsdk_project_label\">\n        <item name=\"android:layout_width\">50dip</item>\n        <item name=\"android:layout_height\">21dip</item>\n        <item name=\"android:textColor\">#ff8b8b8b</item>\n        <item name=\"android:textSize\">13sp</item>\n        <item name=\"android:gravity\">center</item>\n        <item name=\"android:background\">@drawable/nd_gcsdk_label_bg</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/DependProject/src/.gitignore",
    "content": "#empty ignore file"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <applicationCfg keyword=\"com.nd.commplatform.activity.SNSControlCenterActivity\">\n        \n        <activity android:name=\"com.nd.commplatform.activity.SNSControlCenterActivity\"\n            android:configChanges=\"orientation|keyboardHidden|navigation\"\n            android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n            android:windowSoftInputMode=\"adjustPan\"\n            android:windowBackground=\"@null\"\n            android:launchMode=\"singleTask\"/>\n        \n        <activity android:name=\"com.nd.commplatform.activity.SNSLoginActivity\"\n            android:configChanges=\"orientation|keyboardHidden|navigation\"\n            android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n            android:windowSoftInputMode=\"adjustPan\"\n            android:windowBackground=\"@null\"\n            android:launchMode=\"singleTask\"/>\n        \n        <activity android:name=\"com.nd.commplatform.activity.SNSAppPromotionActivity\"\n            android:configChanges=\"orientation|keyboardHidden|navigation\"\n            android:windowSoftInputMode=\"adjustPan\"\n            android:theme=\"@android:style/Theme.NoTitleBar\"\n            android:windowBackground=\"@null\"/>\n        \n        \n        <service  android:name=\"com.nd.commplatform.service.NdDownloadService\"\n            android:process=\":com.nd.commplatform.download\"\n            android:enabled=\"true\"\n            android:exported=\"false\"/>\n        \n        <receiver android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateNotify\"\n            android:process=\"android.intent.nd.sns.commplatform.versionupdate\"\n            android:exported=\"false\"/>\n        \n        <service android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateService\"\n            android:process=\"android.intent.nd.sns.commplatform.versionupdate\"\n        \tandroid:exported=\"false\"/>\n        \n        <service  android:name=\"com.nd.commplatform.service.NdNewMessageNotification\"\n            android:enabled=\"true\"\n            android:exported=\"false\"/>\n    </applicationCfg>\n\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n        <uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n        <uses-permission android:name=\"android.permission.SEND_SMS\"/>\n        <uses-permission android:name=\"android.permission.INTERNET\" />\n        <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n        <uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>\n        <uses-permission android:name=\"android.permission.CALL_PHONE\" />   \n        <uses-permission android:name=\"android.permission.GET_TASKS\" />\n        <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n    </permissionCfg>\n</manifestConfig> \n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginNd91\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPNd91.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\nimport java.util.UUID;\n\nimport com.nd.commplatform.NdCommplatform;\nimport com.nd.commplatform.NdErrorCode;\nimport com.nd.commplatform.NdMiscCallbackListener;\nimport com.nd.commplatform.entry.NdBuyInfo;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.util.Log;\n\npublic class IAPNd91 implements InterfaceIAP {\n\n\tprivate static final String LOG_TAG = \"IAPNd91\";\n\tprivate static Activity mContext = null;\n\tprivate static IAPNd91 mNd91 = null;\n\tprivate static boolean bDebug = false;\n\tprivate static Hashtable<String, String> curProductInfo = null;\n\n\tprotected static void LogE(String msg, Exception e) {\n\t\tLog.e(LOG_TAG, msg, e);\n\t\te.printStackTrace();\n\t}\n\n\tprotected static void LogD(String msg) {\n\t\tif (bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n\n\tpublic IAPNd91(Context context) {\n\t\tmContext = (Activity) context;\n\t\tmNd91 = this;\n\t}\n\n\t@Override\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n\t\tLogD(\"initDeveloperInfo invoked \" + cpInfo.toString());\n\t\tfinal Hashtable<String, String> curCPInfo = cpInfo;\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t    String appId = curCPInfo.get(\"Nd91AppId\");\n                    String appKey = curCPInfo.get(\"Nd91AppKey\");\n                    int id = Integer.parseInt(appId);\n\n                    String orientation = curCPInfo.get(\"Nd91Orientation\");\n                    Nd91Wrapper.initSDK(mContext, id, appKey, orientation);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLogE(\"Developer info is wrong!\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void payForProduct(Hashtable<String, String> info) {\n\t\tLogD(\"payForProduct invoked \" + info.toString());\n\t\tif (! Nd91Wrapper.networkReachable(mContext)) {\n\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"网络不可用\");\n\t\t\treturn;\n\t\t}\n\n\t\tcurProductInfo = info;\n\t\tif (curProductInfo == null) {\n\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"商品信息错误\");\n\t\t\treturn;\n\t\t}\n\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (! Nd91Wrapper.isLogined()) {\n\t\t\t\t\tuserLogin();\n\t\t\t\t} else {\n\t\t\t\t\taddPayment(curProductInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void setDebugMode(boolean debug) {\n\t\tbDebug = debug;\n\t}\n\n\t@Override\n\tpublic String getSDKVersion() {\n\t\treturn Nd91Wrapper.getSDKVersion();\n\t}\n\n\tprivate static void payResult(int ret, String msg) {\n\t\tIAPWrapper.onPayResult(mNd91, ret, msg);\n\t\tLogD(\"Nd91 result : \" + ret + \" msg : \" + msg);\n\t}\n\n\tprivate static String getOrderSerial() {\n\t\tUUID guid = UUID.randomUUID(); \n\t\tString text = guid.toString(); \n\t\ttext = text.replace(\"-\", \"\".trim());\n\t\treturn text;\n\t}\n\n\tprivate static void userLogin() {\n\t\tLogD(\"User begin login\");\n\t\ttry {\n\t \t\tNd91Wrapper.userLogin(mContext, new NdMiscCallbackListener.OnLoginProcessListener() {\n    \t\t\t@Override\n\t \t\t\tpublic void finishLoginProcess(int code) {\n\t \t\t\t\tif (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS) {\n\t \t\t\t\t\taddPayment(curProductInfo);\n\t \t\t\t\t} else if (code == NdErrorCode.ND_COM_PLATFORM_ERROR_CANCEL) {\n\t \t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"用户取消登录\");\n\t \t\t\t\t} else {\n\t \t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"用户登录失败\");\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t});\n\t\t} catch (Exception e) {\n\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"用户登录失败\");\n\t\t\tLogE(\"User login error\", e);\n\t\t}\n\t}\n\n\tprivate static void addPayment(Hashtable<String, String> productInfo) {\n\t\ttry {\n\t\t\tdo {\n\t\t\t\tString id = productInfo.get(\"Nd91ProductId\");\n\t\t\t\tString strPrice = productInfo.get(\"productPrice\");\n\t\t\t\tString strName = productInfo.get(\"productName\");\n\t\t\t\tString strDesc = productInfo.get(\"productDesc\");\n\t\t\t\tString oriPrice = productInfo.get(\"Nd91OriginalPrice\");\n\t\t\t\tString strCount = productInfo.get(\"Nd91ProductCount\");\n\n\t\t\t\tif (id == null || id.length() == 0) {\n\t\t\t\t\tpayResult(IAPWrapper.PAYRESULT_FAIL, \"商品信息错误\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tfloat price = Float.parseFloat(strPrice);\n\t\t\t\tfloat fOriPrice = price;\n\t\t\t\tif (oriPrice != null && oriPrice.length() > 0) {\n\t\t\t\t\tfOriPrice = Float.parseFloat(oriPrice);\n\t\t\t\t}\n\t\t\t\tint count = 1;\n\t\t\t\tif (strCount != null && strCount.length() > 0) {\n\t\t\t\t\tcount = Integer.parseInt(strCount);\n\t\t\t\t}\n\n\t\t\t\tString serial = IAPNd91.getOrderSerial();\n\t\t\t\tNdBuyInfo order = new NdBuyInfo();\n\t\t\t\torder.setSerial(serial);\n    \t\t\torder.setProductId(id);\n    \t\t\torder.setProductName(strName);\n    \t\t\torder.setProductPrice(price);\n    \t\t\torder.setProductOrginalPrice(fOriPrice);\n    \t\t\torder.setCount(count);\n    \t\t\torder.setPayDescription(strDesc);\n    \t\t\t\n    \t\t\tint aError = NdCommplatform.getInstance().ndUniPay(order, mContext, new NdMiscCallbackListener.OnPayProcessListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void finishPayProcess(int code) {\n\t\t\t\t\t\tIAPNd91.LogD(\"finishPayProcess code : \" + code);\n\t\t\t\t\t\tswitch(code){\n\t\t\t\t\t\tcase NdErrorCode.ND_COM_PLATFORM_SUCCESS:\n\t\t\t\t\t\t\tIAPNd91.payResult(IAPWrapper.PAYRESULT_SUCCESS, \"购买成功\"); break;\n\t\t\t\t\t\tcase NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_FAILURE:\n\t\t\t\t\t\t\tIAPNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"购买失败\"); break;\n\t\t\t\t\t\tcase NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_CANCEL:\n\t\t\t\t\t\t\tIAPNd91.payResult(IAPWrapper.PAYRESULT_CANCEL, \"取消购买\"); break;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tIAPNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"购买失败\"); break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n    \t\t\t});\n\n\t\t\t\tif (aError != 0) {\n\t\t\t\t\tIAPNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"您输入参数有错,无法提交购买请求\");\n\t\t\t\t}\n\t\t\t} while (false);\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Error during payment\", e);\n\t\t\tIAPNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"支付失败\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic String getPluginVersion() {\n\t\treturn Nd91Wrapper.getPluginVersion();\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPOnlineNd91.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\nimport java.util.UUID;\n\nimport com.nd.commplatform.NdCommplatform;\nimport com.nd.commplatform.NdErrorCode;\nimport com.nd.commplatform.NdMiscCallbackListener;\nimport com.nd.commplatform.entry.NdBuyInfo;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.util.Log;\n\npublic class IAPOnlineNd91 implements InterfaceIAP {\n\n    private static final String LOG_TAG = \"IAPOnlineNd91\";\n    private static Activity mContext = null;\n    private static IAPOnlineNd91 mNd91 = null;\n    private static boolean bDebug = false;\n    private static Hashtable<String, String> curProductInfo = null;\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(LOG_TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    protected static void LogD(String msg) {\n        if (bDebug) {\n            Log.d(LOG_TAG, msg);\n        }\n    }\n\n    public IAPOnlineNd91(Context context) {\n        mContext = (Activity) context;\n        mNd91 = this;\n    }\n\n    @Override\n    public void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n        LogD(\"initDeveloperInfo invoked \" + cpInfo.toString());\n        final Hashtable<String, String> curCPInfo = cpInfo;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    String appId = curCPInfo.get(\"Nd91AppId\");\n                    String appKey = curCPInfo.get(\"Nd91AppKey\");\n                    int id = Integer.parseInt(appId);\n\n                    String orientation = curCPInfo.get(\"Nd91Orientation\");\n                    Nd91Wrapper.initSDK(mContext, id, appKey, orientation);\n                } catch (Exception e) {\n                    LogE(\"Developer info is wrong!\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void payForProduct(Hashtable<String, String> info) {\n        LogD(\"payForProduct invoked \" + info.toString());\n        if (! Nd91Wrapper.networkReachable(mContext)) {\n            payResult(IAPWrapper.PAYRESULT_FAIL, \"网络不可用\");\n            return;\n        }\n\n        curProductInfo = info;\n        if (curProductInfo == null) {\n            payResult(IAPWrapper.PAYRESULT_FAIL, \"商品信息错误\");\n            return;\n        }\n\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                if (! Nd91Wrapper.isLogined()) {\n                    userLogin();\n                } else {\n                    addPayment(curProductInfo);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void setDebugMode(boolean debug) {\n        bDebug = debug;\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return Nd91Wrapper.getSDKVersion();\n    }\n\n    private static void payResult(int ret, String msg) {\n        IAPWrapper.onPayResult(mNd91, ret, msg);\n        LogD(\"Nd91 result : \" + ret + \" msg : \" + msg);\n    }\n\n    private static String getOrderSerial() {\n        UUID guid = UUID.randomUUID(); \n        String text = guid.toString(); \n        text = text.replace(\"-\", \"\".trim());\n        return text;\n    }\n\n    private static void userLogin() {\n        LogD(\"User begin login\");\n        try {\n             Nd91Wrapper.userLogin(mContext, new NdMiscCallbackListener.OnLoginProcessListener() {\n                @Override\n                 public void finishLoginProcess(int code) {\n                     if (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS) {\n                         addPayment(curProductInfo);\n                     } else if (code == NdErrorCode.ND_COM_PLATFORM_ERROR_CANCEL) {\n                         payResult(IAPWrapper.PAYRESULT_FAIL, \"用户取消登录\");\n                     } else {\n                         payResult(IAPWrapper.PAYRESULT_FAIL, \"用户登录失败\");\n                     }\n                 }\n             });\n        } catch (Exception e) {\n            payResult(IAPWrapper.PAYRESULT_FAIL, \"用户登录失败\");\n            LogE(\"User login error\", e);\n        }\n    }\n\n    private static void addPayment(Hashtable<String, String> productInfo) {\n        try {\n            do {\n                String id = productInfo.get(\"Nd91ProductId\");\n                String strPrice = productInfo.get(\"productPrice\");\n                String strName = productInfo.get(\"productName\");\n                String strDesc = productInfo.get(\"productDesc\");\n                String oriPrice = productInfo.get(\"Nd91OriginalPrice\");\n                String strCount = productInfo.get(\"Nd91ProductCount\");\n\n                if (id == null || id.length() == 0) {\n                    payResult(IAPWrapper.PAYRESULT_FAIL, \"商品信息错误\");\n                    break;\n                }\n\n                float price = Float.parseFloat(strPrice);\n                float fOriPrice = price;\n                if (oriPrice != null && oriPrice.length() > 0) {\n                    fOriPrice = Float.parseFloat(oriPrice);\n                }\n                int count = 1;\n                if (strCount != null && strCount.length() > 0) {\n                    count = Integer.parseInt(strCount);\n                }\n\n                String serial = IAPOnlineNd91.getOrderSerial();\n                NdBuyInfo order = new NdBuyInfo();\n                order.setSerial(serial);\n                order.setProductId(id);\n                order.setProductName(strName);\n                order.setProductPrice(price);\n                order.setProductOrginalPrice(fOriPrice);\n                order.setCount(count);\n                order.setPayDescription(strDesc);\n                \n                int aError = NdCommplatform.getInstance().ndUniPayAsyn(order, mContext, new NdMiscCallbackListener.OnPayProcessListener() {\n\n                    @Override\n                    public void finishPayProcess(int code) {\n                        IAPOnlineNd91.LogD(\"finishPayProcess code : \" + code);\n                        switch(code){\n                        case NdErrorCode.ND_COM_PLATFORM_SUCCESS:\n                            IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_SUCCESS, \"购买成功\"); break;\n                        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_FAILURE:\n                            IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"购买失败\"); break;\n                        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_CANCEL:\n                            IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_CANCEL, \"取消购买\"); break;\n                        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_ASYN_SMS_SENT:\n                            IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_SUCCESS, \"订单已提交,充值短信已发送\"); break;\n                        case NdErrorCode.ND_COM_PLATFORM_ERROR_PAY_REQUEST_SUBMITTED:\n                            IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_SUCCESS, \"订单已提交\"); break;\n                        default:\n                            IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"购买失败\"); break;\n                        }\n                    }\n                });\n\n                if (aError != 0) {\n                    IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"您输入参数有错,无法提交购买请求\");\n                }\n            } while (false);\n        } catch (Exception e) {\n            LogE(\"Error during payment\", e);\n            IAPOnlineNd91.payResult(IAPWrapper.PAYRESULT_FAIL, \"支付失败\");\n        }\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return Nd91Wrapper.getPluginVersion();\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/Nd91Wrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport android.content.Context;\nimport android.net.ConnectivityManager;\nimport android.net.NetworkInfo;\n\nimport com.nd.commplatform.NdCommplatform;\nimport com.nd.commplatform.NdMiscCallbackListener.OnLoginProcessListener;\nimport com.nd.commplatform.entry.NdAppInfo;\n\npublic class Nd91Wrapper {\n\n    private static boolean isInited = false;\n\n    public static void initSDK(Context ctx, int appId, String appKey, String orientation) {\n        if (isInited) {\n            return;\n        }\n\n        NdAppInfo appInfo = new NdAppInfo();\n        appInfo.setCtx(ctx);\n\n        appInfo.setAppId(appId);\n        appInfo.setAppKey(appKey);\n        \n        NdCommplatform.getInstance().initial(0, appInfo);\n\n        if (null != orientation) {\n            if (orientation.equals(\"landscape\")) {\n                NdCommplatform.getInstance().ndSetScreenOrientation(NdCommplatform.SCREEN_ORIENTATION_LANDSCAPE);\n            } else\n            if (orientation.equals(\"auto\")) {\n                NdCommplatform.getInstance().ndSetScreenOrientation(NdCommplatform.SCREEN_ORIENTATION_AUTO);\n            }\n        }\n\n        isInited = true;\n    }\n\n    public static boolean isLogined() {\n        boolean bRet = NdCommplatform.getInstance().isLogined();\n        return bRet;\n    }\n\n    public static void userLogin(Context ctx, OnLoginProcessListener listener) {\n        NdCommplatform.getInstance().ndLogin(ctx, listener);\n    }\n\n    public static String getSDKVersion() {\n        return \"20130607_3.2.5.1\";\n    }\n\n    public static String getPluginVersion() {\n        return \"0.2.0\";\n    }\n\n    public static boolean networkReachable(Context ctx) {\n        boolean bRet = false;\n        try {\n            ConnectivityManager conn = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);\n            NetworkInfo netInfo = conn.getActiveNetworkInfo();\n            bRet = (null == netInfo) ? false : netInfo.isAvailable();\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n\n        return bRet;\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/SocialNd91.java",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\nimport com.nd.commplatform.NdCallbackListener;\nimport com.nd.commplatform.NdCommplatform;\nimport com.nd.commplatform.NdErrorCode;\nimport com.nd.commplatform.NdMiscCallbackListener.OnLoginProcessListener;\nimport com.nd.commplatform.entry.NdAchieveUnlockInfo;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.text.TextUtils;\nimport android.util.Log;\n\npublic class SocialNd91 implements InterfaceSocial {\n\n    private static final String LOG_TAG = \"UserNd91\";\n    private static Activity mContext = null;\n    private static SocialNd91 mNd91 = null;\n    private static boolean bDebug = false;\n    private static NdCallbackListener<Object> submitListener = null;\n    private static NdCallbackListener<Object> unlockListener = null;\n    \n    protected static void LogE(String msg, Exception e) {\n        Log.e(LOG_TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    protected static void LogD(String msg) {\n        if (bDebug) {\n            Log.d(LOG_TAG, msg);\n        }\n    }\n\n    public SocialNd91(Context context) {\n        mContext = (Activity) context;\n        mNd91 = this;\n\n        submitListener = new NdCallbackListener<Object>(){\n            @Override\n            public void callback(int arg0, Object arg1) {\n                int nRet = SocialWrapper.SOCIAL_SUBMITSCORE_FAILED;\n                String msg = \"Unknow Error\";\n                switch (arg0) {\n                case NdCommplatform.SCORE_SUBMIT_SUCCESS:\n                    nRet = SocialWrapper.SOCIAL_SUBMITSCORE_SUCCESS;\n                    msg = \"Submit Success\";\n                    break;\n                case NdCommplatform.SCORE_SAVE_LOCAL:\n                    nRet = SocialWrapper.SOCIAL_SUBMITSCORE_FAILED;\n                    msg = \"Score saved locally\";\n                    break;\n                case NdCommplatform.LEADERBOARD_NOT_EXIST:\n                    nRet = SocialWrapper.SOCIAL_SUBMITSCORE_FAILED;\n                    msg = \"The leaderboard not exist\";\n                    break;\n                default:\n                    nRet = SocialWrapper.SOCIAL_SUBMITSCORE_FAILED;\n                    break;\n                }\n                SocialWrapper.onSocialResult(mNd91, nRet, msg);\n            }\n        };\n\n        unlockListener = new NdCallbackListener<Object>(){\n            @Override\n            public void callback(int arg0, Object arg1) {\n                int nRet = SocialWrapper.SOCIAL_UNLOCKACH_FAILED;\n                String msg = \"Unknow Error\";\n                switch (arg0) {\n                case NdErrorCode.ND_COM_PLATFORM_SUCCESS:\n                    nRet = SocialWrapper.SOCIAL_UNLOCKACH_SUCCESS;\n                    msg = \"Unlock Success\";\n                    break;\n                case NdErrorCode.ND_COM_PLATFORM_ERROR_SERVER_RETURN_ERROR:\n                    nRet = SocialWrapper.SOCIAL_UNLOCKACH_FAILED;\n                    msg = \"Server return error\";\n                    break;\n                case NdErrorCode.ND_COM_PLATFORM_ERROR_ACHIEVEMENT_NO_EXIST:\n                    nRet = SocialWrapper.SOCIAL_UNLOCKACH_FAILED;\n                    msg = \"Achievement not exist\";\n                    break;\n                default:\n                    nRet = SocialWrapper.SOCIAL_UNLOCKACH_FAILED;\n                    break;\n                }\n                SocialWrapper.onSocialResult(mNd91, nRet, msg);\n            }\n        };\n    }\n\n    @Override\n    public void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n        LogD(\"initDeveloperInfo invoked \" + cpInfo.toString());\n        final Hashtable<String, String> curCPInfo = cpInfo;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    String appId = curCPInfo.get(\"Nd91AppId\");\n                    String appKey = curCPInfo.get(\"Nd91AppKey\");\n                    int id = Integer.parseInt(appId);\n\n                    String orientation = curCPInfo.get(\"Nd91Orientation\");\n                    Nd91Wrapper.initSDK(mContext, id, appKey, orientation);\n\n                } catch (Exception e) {\n                    LogE(\"Developer info is wrong!\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void submitScore(String leaderboardID, long score) {\n        final String curID = leaderboardID;\n        final long curScore = score;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                NdCommplatform.getInstance().ndSubmitScore(curID, (int) curScore, null, (Activity) mContext, submitListener);\n            }\n        });\n    }\n\n    @Override\n    public void showLeaderboard(String leaderboardID) {\n        final String curID = leaderboardID;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                if (Nd91Wrapper.isLogined()) {\n                    NdCommplatform.getInstance().ndOpenLeaderBoard(mContext, curID, 0);\n                } else {\n                    Nd91Wrapper.userLogin(mContext, new OnLoginProcessListener() {\n                        @Override\n                        public void finishLoginProcess(int code) {\n                            if (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS) {\n                                NdCommplatform.getInstance().ndOpenLeaderBoard(mContext, curID, 0);\n                            } else {\n                                LogD(\"User should login first\");\n                            }\n                        }\n                    });\n                }\n            }\n        });\n    }\n\n    @Override\n    public void unlockAchievement(Hashtable<String, String> achInfo) {\n        final Hashtable<String, String> curInfo = achInfo;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    String achID = curInfo.get(\"AchievementID\");\n                    if (achID == null || TextUtils.isEmpty(achID))\n                    {\n                        SocialWrapper.onSocialResult(mNd91, SocialWrapper.SOCIAL_UNLOCKACH_FAILED, \"Achievement info error\");\n                        return;\n                    }\n\n                    String displayText = curInfo.get(\"NDDisplayText\");\n                    String strScore = curInfo.get(\"NDScore\");\n                    long score = Long.parseLong(strScore);\n                    NdAchieveUnlockInfo info = new NdAchieveUnlockInfo();\n                    info.setAchievementId(achID);\n                    info.setCurrentValue(score);\n                    info.setDisplayText(displayText);\n\n                    NdCommplatform.getInstance().ndUnlockAchievement(info, mContext, unlockListener);\n                } catch (Exception e) {\n                    LogE(\"Unknown Error!\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void showAchievements() {\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                if (Nd91Wrapper.isLogined()) {\n                    NdCommplatform.getInstance().ndOpenAchievement(mContext, 0);\n                } else {\n                    Nd91Wrapper.userLogin(mContext, new OnLoginProcessListener() {\n                        @Override\n                        public void finishLoginProcess(int code) {\n                            if (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS) {\n                                NdCommplatform.getInstance().ndOpenAchievement(mContext, 0);\n                            } else {\n                                LogD(\"User should login first\");\n                            }\n                        }\n                    });\n                }\n            }\n        });\n    }\n\n    @Override\n    public void setDebugMode(boolean debug) {\n        bDebug = debug;\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return Nd91Wrapper.getSDKVersion();\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return Nd91Wrapper.getPluginVersion();\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/UserNd91.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\nimport com.nd.commplatform.NdCommplatform;\nimport com.nd.commplatform.NdErrorCode;\nimport com.nd.commplatform.NdMiscCallbackListener;\nimport com.nd.commplatform.NdMiscCallbackListener.OnSwitchAccountListener;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.util.Log;\n\npublic class UserNd91 implements InterfaceUser {\n\n\tprivate static final String LOG_TAG = \"UserNd91\";\n\tprivate static Activity mContext = null;\n\tprivate static UserNd91 mNd91 = null;\n\tprivate static boolean bDebug = false;\n\n\tprotected static void LogE(String msg, Exception e) {\n\t\tLog.e(LOG_TAG, msg, e);\n\t\te.printStackTrace();\n\t}\n\n\tprotected static void LogD(String msg) {\n\t\tif (bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n\n\tpublic UserNd91(Context context) {\n\t\tmContext = (Activity) context;\n\t\tmNd91 = this;\n\t}\n\n\t@Override\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n\t\tLogD(\"initDeveloperInfo invoked \" + cpInfo.toString());\n\t\tfinal Hashtable<String, String> curCPInfo = cpInfo;\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tString appId = curCPInfo.get(\"Nd91AppId\");\n\t\t\t\t\tString appKey = curCPInfo.get(\"Nd91AppKey\");\n\t\t\t\t\tint id = Integer.parseInt(appId);\n\n\t\t\t\t\tString orientation = curCPInfo.get(\"Nd91Orientation\");\n\t\t\t\t\tNd91Wrapper.initSDK(mContext, id, appKey, orientation);\n\n\t\t\t\t\tNdCommplatform.getInstance().setOnSwitchAccountListener(new OnSwitchAccountListener() {\n                        @Override\n                        public void onSwitchAccount(int arg0) {\n                            switch (arg0) {\n                            case NdErrorCode.ND_COM_PLATFORM_ERROR_USER_RESTART:\n                                break;\n                            case NdErrorCode.ND_COM_PLATFORM_ERROR_USER_SWITCH_ACCOUNT:\n                                break;\n                            case NdErrorCode.ND_COM_PLATFORM_SUCCESS:\n                                UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_SUCCEED, \"User login succeed\");\n                                break;\n                            case NdErrorCode.ND_COM_PLATFORM_ERROR_CANCEL:\n                                break;\n                            default:\n                                UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGOUT_SUCCEED, \"User logout\");\n                                break;\n                            }\n                        }\n\t\t\t\t\t});\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLogE(\"Developer info is wrong!\", e);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void setDebugMode(boolean debug) {\n\t\tbDebug = debug;\n\t}\n\n\t@Override\n\tpublic String getSDKVersion() {\n\t\treturn Nd91Wrapper.getSDKVersion();\n\t}\n\n\t@Override\n\tpublic String getPluginVersion() {\n\t\treturn Nd91Wrapper.getPluginVersion();\n\t}\n\n    @Override\n    public void login() {\n        if (isLogined()) {\n            UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_SUCCEED, \"Already logined!\");\n            return;\n        }\n\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                Nd91Wrapper.userLogin(mContext, new NdMiscCallbackListener.OnLoginProcessListener() {\n                    @Override\n                    public void finishLoginProcess(int code) {\n                        if (code == NdErrorCode.ND_COM_PLATFORM_SUCCESS) {\n                            UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_SUCCEED, \"User login succeed\");\n                        } else if (code == NdErrorCode.ND_COM_PLATFORM_ERROR_CANCEL) {\n                            UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_FAILED, \"User canceled\");\n                        } else {\n                            UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGIN_FAILED, \"User login failed\");\n                        }\n                    }\n                });\n            }\n        });\n    }\n\n    @Override\n    public void logout() {\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                NdCommplatform.getInstance().ndLogout(NdCommplatform.LOGOUT_TO_NON_RESET_AUTO_LOGIN_CONFIG, mContext);\n                UserWrapper.onActionResult(mNd91, UserWrapper.ACTION_RET_LOGOUT_SUCCEED, \"User logout\");\n            }\n        });\n    }\n\n    @Override\n    public boolean isLogined() {\n        return Nd91Wrapper.isLogined();\n    }\n\n    @Override\n    public String getSessionID() {\n        String strRet = \"\";\n        if (isLogined()) {\n            strRet = NdCommplatform.getInstance().getSessionId();\n        }\n        return strRet;\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/360SDK.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/annotations.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginQH360</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.plugin\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForAssets/upomp_bypay_config.xml",
    "content": "5ndtII3qG6kuOW5UwVEQ1e0Of3ibjmMbEX0w5EScjFBk36yrdcepJ78mR/RsxxsWvSFunswgX4pi\nCqnonUMw723wi7mFULv7qCOKcH0XabcQomXnthj4elSas9BEeBrh9rF4rXxia3mr94+6Rxr3upP5\nVtFOUHkeSo81e/WZiBnyjaNB/5Ud0LkpUToIRmBSt4li1jvA4kq9C+NAjyEIE5VOOikpm+SBzXo9\n/QtnIbYhV2ZdEe8jCt0OluMjMcUueOuQgSyF62MJQqjMlVmUjO4tCYNnLGx5sBGcBxqIYL1XCekf\nvVyUvPAVBR5i+x8NG/MmPdFhwjeuuHjoByroBjNGDAMgUJyxYdjok+GOahc16wgDZ7PBvu46gF7A\nG8or3ruF+qp8or5U17OBbiuisB0pHNW4h8c2TtJD6Rq8i4NRUlmrUmZsc7QqU1H9eKoNqbyrcnK5\nt8M8fb5U/uHKxq0NRmvppLUwGxJpUzocv7I/hRSk2LxtmD58lTNmfzjgaZeP9pa8h3Tpto/sT+wV\ntUgHImreS6DB1wbiuRkzPZsLH1fnToD2/JWr+9g5iBvS+s6q2oLQ6gFzxhVoigt/tdo/0pMKtVO7\n76//QaQOSVAEs6F5JqiVYU3sxEukjpRHX/N6g8GdzCTrp7drmsokblWKFzW1SzrMZV0/XXJpvIbS\nN95ArnkCRkaPiPGoBVv9e5jsLtMnGoPelYrbmrcTY5L/d8x7wl0piN3ZzW+11UxoYI3dkANP7D98\nP83gnyq3pi60AuTBWVUqpeCrBLsrsGl3SH5pNg7qEv/OA+qgpbXTLNBeqGpFJ+NGqXmFlbEwMbpQ\nqAV8BA1lC1Jaq0McCwIBF6hYPrzHs71u6+A9xQic1IJ4jHjfu50cFIcRyaIl4fhfJv7wsXdmnsKt\nWoNwabsXGNQbcTw+9+5khbsnrOYWUGjqzqDnbV23ZUpx68DV0d1pcQ3XlITePtmcyIZD3RkZSwH4\nVRU5mL613jiI3z50VI90CfCX5SgPwzdpnCZX+cxWP/BkiS3r4ZCtnI9WcFkVHEYWgnDhTGbVBaaq\nK8+l1HaIMwZY6nRHTr0DVMM9URgeqk9CXbhfleBqHAiv3ANn6pJFOg/xTFZmMPS/+9kr9/M3qY6G\nhCdytoi1vZWF4pv+qHQl+i5t8Iu5hVC7+y9ODxhWdkVNt14s6LgJY51Ycey1+uxdmIgNob0l/xRN\nyugdrOFu56trwkrAjSbdnPVgGPltleLPA9zOlKH7OcDBdgoOAz8RGXjD/ZI8eQOae8DjAkGKX1TW\nON5cXhvPTsjI+uVH0n/un7W4VSBsd8XSjBVVAEiVnp5R/rI0Q9Pg3zgosJkklx/GmMlLOdbXH8GA\nTA9D05nnPgYsBHiUAVzwDRiSXpK2iBqVxuo4JvTLYZMW+ElBpp0z07VrclYCO1Xt8jPdYg7X4U6R\nR3Y0AQZc/l6PG9Pi9qLiB2/OrI3Lm4vSFCKm+BIih1XzFhWUKI3clhguAErRmg33Hw//TfXBM2ab\nsLFOuH6l9XK93MR4gldVAAVBZ1Cp/phAOyL/3CREKGVPLGSFOnS3JD4bDkkxCfeL1SmDVQ1QXH+k\nlSHXV7ap52iCcJmwfYGC36JIMT9hWvQ/LJbPBDrxO/v3MNc3sTRayQsRGT0chLTPB3ZdL37HOtYO\npM9D7xjJ/HZXkHVBxGdUJtq09vKvl/vPYStk2xLb1EvdNXVLWeh4K5RTvFjQKsSYmJyMTOIHXgPP\n8p5Yld41hutn+eBY3Cvm4RnNFBcFiCQKCKpTsavUYt3OJGw4fbYX/n2V2tSue3xxks0K+MwaVP0B\ngINCvbd5Kf1Heg2pWg/UIiRPLTSqgzH7rZgci5CL3PIPN73v3xYPAXlnLs9V3CWfgINCvbd5Kf0D\nsvj7g/9SvvbHdgDI4WlDrZgci5CL3PIJiBvggx50ZxJ8HBFOYjNDuyvUNw4DO+/mILSuU8sXp3NY\nTXKZB5eq0md68ln+JjRLDXH0qbfNL6t3Bn5lJ8rqAPrjGlkPo2P7E2TPti1fK83qoxbY2JYyrZgc\ni5CL3PLYU08oU0MBIMpBFasBcMNAdUtZ6HgrlFMk249fN7o08a7utnOokH+xs/iPtlG4fKGlXHzW\nzLSuYqUD4BvyuQ7pKWXCoHgiDfREtGn8fpeoX430gyq665d84vBfb8ISwPbeeyBBbloLh8WbiXql\npNA6x1gn6Vc6zQrXsx3lW64Ubw==\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <applicationCfg keyword=\"com.qihoopay.insdk.activity.ContainerActivity\">\n        <activity\n            android:name=\"com.qihoopay.insdk.activity.ContainerActivity\"\n            android:configChanges=\"orientation|keyboardHidden|navigation\"\n            android:theme=\"@android:style/Theme.Translucent.NoTitleBar\" >\n        </activity>\n        <activity\n            android:name=\"com.qihoopay.insdk.activity.RemoteContainerActivity\"\n            android:configChanges=\"orientation|keyboardHidden|navigation|screenSize\"\n            android:theme=\"@android:style/Theme.Translucent.NoTitleBar\"\n            android:process=\":remote\" >\n        </activity>\n\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.SplashActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n            <intent-filter>\n                <action android:name=\"hanxin_303310048990001_1_1\" />\n                <category android:name=\"android.intent.category.DEFAULT\" />\n            </intent-filter>\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.PayMainActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.PayUserCreditActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.PayUserDebitActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.PayOnUserTelActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.PayResultActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.PayResultLoseActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.RegisterActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.RegisterResultActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.UserProtocalActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.OnUserCardManageActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.OnUserUserManageActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.changePswActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.changeTelActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.OnUserBindCardCreditActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.OnUserBindCardDebitActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.OnUserBindCardPanActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.OnUserBindCardResultActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" />\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.SupportActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.GetpassActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.AuthBindCardActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"com.unionpay.upomp.bypay.activity.AboutActivity\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/Activity_MyDialog\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n\n        <activity\n            android:name=\"cn.paypalm.jar.game360.InitialAct\"\n            android:configChanges=\"orientation|keyboardHidden|screenSize\"\n            android:screenOrientation=\"behind\"\n            android:theme=\"@style/FloatingWindowStyle\"\n            android:windowSoftInputMode=\"stateAlwaysHidden\" >\n        </activity>\n        <activity\n            android:name=\"cn.paypalm.jar.game360.UserMessageAct\"\n            android:configChanges=\"orientation|keyboardHidden|screenSize\"\n            android:screenOrientation=\"behind\"\n            android:theme=\"@style/FloatingWindowStyle\"\n            android:windowSoftInputMode=\"stateAlwaysHidden\" >\n        </activity>\n        <activity\n            android:name=\"cn.paypalm.jar.game360.BankcardPayAct\"\n            android:configChanges=\"orientation|keyboardHidden|screenSize\"\n            android:screenOrientation=\"behind\"\n            android:theme=\"@style/FloatingWindowStyle\"\n            android:windowSoftInputMode=\"stateAlwaysHidden\" >\n        </activity>\n        <activity\n            android:name=\"cn.paypalm.jar.game360.SuccessAct\"\n            android:configChanges=\"orientation|keyboardHidden|screenSize\"\n            android:screenOrientation=\"behind\"\n            android:theme=\"@style/FloatingWindowStyle\"\n            android:windowSoftInputMode=\"stateAlwaysHidden\" >\n        </activity>\n        <activity\n            android:name=\"cn.paypalm.jar.game360.BankcardAgreement\"\n            android:configChanges=\"orientation|keyboardHidden|screenSize\"\n            android:screenOrientation=\"behind\"\n            android:theme=\"@style/FloatingWindowStyle\"\n            android:windowSoftInputMode=\"stateAlwaysHidden\" >\n        </activity>\n\n        <meta-data android:name=\"QHOPENSDK_APPID\" android:value=\"Your app_id\" />\n        <meta-data android:name=\"QHOPENSDK_APPKEY\" android:value=\"Your app_key\" />\n        <meta-data android:name=\"QHOPENSDK_PRIVATEKEY\" android:value=\"Your app_private_key\" />\n        <meta-data android:name=\"QHOPENSDK_CHANNEL\" android:value=\"QH360\" />\n    </applicationCfg>\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n\t    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n\t    <uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\" />\n\t    <uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\" />\n\t    <uses-permission android:name=\"android.permission.GET_TASKS\" />\n\t    <uses-permission android:name=\"android.permission.INTERNET\" />\n\t    <uses-permission android:name=\"android.permission.SEND_SMS\" />\n\t    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n\t    <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n\t    <uses-permission android:name=\"android.permission.RECEIVE_SMS\" />\n\t    <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\" />\n\t    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n\t    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n\t    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n\t    <uses-permission android:name=\"android.permission.READ_SMS\" />\n\t    <uses-permission android:name=\"android.permission.WAKE_LOCK\" />\n\t    <uses-permission android:name=\"android.permission.VIBRATE\" />\n    </permissionCfg>\n</manifestConfig>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/anim/zsht_loading.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<animation-list android:oneshot=\"false\"\n\txmlns:android=\"http://schemas.android.com/apk/res/android\">\n\t<item android:duration=\"150\" android:drawable=\"@drawable/zsht_loading_01\" />\n\t<item android:duration=\"150\" android:drawable=\"@drawable/zsht_loading_02\" />\n\t<item android:duration=\"150\" android:drawable=\"@drawable/zsht_loading_03\" />\n\t<item android:duration=\"150\" android:drawable=\"@drawable/zsht_loading_04\" />\n\t<item android:duration=\"150\" android:drawable=\"@drawable/zsht_loading_05\" />\n\t<item android:duration=\"150\" android:drawable=\"@drawable/zsht_loading_06\" />\n\t<item android:duration=\"150\" android:drawable=\"@drawable/zsht_loading_07\" />\n</animation-list> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn1.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn1\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn1_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn1_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn1_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn1_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn2.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn2\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn2_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn2_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn2_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn2_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn3.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn3\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn3_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn3_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn3_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn3_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn4.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn4\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn4_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn4_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn4_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn4_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn5.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn5\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn5_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn5_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn5_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn5_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn6.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn6\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn6_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn6_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn6_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_info_btn6_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_card.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n\t<item android:state_window_focused=\"false\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_card_select\" />\n\t<item android:state_focused=\"true\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_card_select_click\" />\n\t<item android:state_focused=\"false\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_card_select_click\" />\n\t<item android:state_selected=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_card_select_click\" />\n\t<item android:state_focused=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_card_select_click\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_enter1.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter_bg\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter_bg_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter_bg_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter_bg_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter_bg_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_enter2.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter2_bg\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter2_bg_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter2_bg_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter2_bg_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_enter2_bg_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_esc1.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc_bg\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc_bg_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc_bg_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc_bg_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc_bg_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_esc2.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc2_bg\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc2_bg_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc2_bg_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc2_bg_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_esc2_bg_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_letter.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n<!-- 默认状态  -->\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_bg\" /> \n<!-- 按下状态  -->\n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_bg_on\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_bg_on\" /> \n<!-- 选中状态  -->\n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_bg_on\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_bg_on\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_member1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n\t<item android:state_window_focused=\"false\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn1\" />\n\t<item android:state_focused=\"true\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn1_click\" />\n\t<item android:state_focused=\"false\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn1_click\" />\n\t<item android:state_selected=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn1_click\" />\n\t<item android:state_focused=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn1_click\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_member2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n\t<item android:state_window_focused=\"false\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn2\" />\n\t<item android:state_focused=\"true\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn2_click\" />\n\t<item android:state_focused=\"false\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn2_click\" />\n\t<item android:state_selected=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn2_click\" />\n\t<item android:state_focused=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_member_btn2_click\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_month.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n\t<item android:state_window_focused=\"false\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_select_month\" />\n\t<item android:state_focused=\"true\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_select_month_on\" />\n\t<item android:state_focused=\"false\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_select_month_on\" />\n\t<item android:state_selected=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_select_month_on\" />\n\t<item android:state_focused=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_select_month_on\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_newweb.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n\t<item android:state_window_focused=\"false\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_hq_click\" />\n\t<item android:state_focused=\"true\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_hq\" />\n\t<item android:state_focused=\"false\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_hq\" />\n\t<item android:state_selected=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_hq\" />\n\t<item android:state_focused=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_hq\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_number.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n<!-- 默认状态  -->\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_number_bg\" /> \n<!-- 按下状态  -->\n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_number_bg_on\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_number_bg_on\" /> \n<!-- 选中状态  -->\n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_number_bg_on\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_number_bg_on\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_set.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_btn_change\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_change_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_change_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_change_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_btn_change_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_symbol.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n<!-- 默认状态  -->\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_fh_bg\" /> \n<!-- 按下状态  -->\n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_fh_bg_on\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_fh_bg_on\" /> \n<!-- 选中状态  -->\n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_fh_bg_on\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_fh_bg_on\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_title_esc.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_title_btn\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_title_btn_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_title_btn_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_title_btn_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_title_btn_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_year.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n<!-- 默认状态  -->\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_select_year\" /> \n<!-- 按下状态  -->\n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_select_year_on\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_select_year_on\" /> \n<!-- 选中状态  -->\n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_select_year_on\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_select_year_on\" /> \n\t\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_checkbox.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- This is the rating bar drawable that is used to a show a filled star. -->\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n \n     <item android:state_checked=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/upomp_bypay_info_select_1\" />\n    <item android:state_checked=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/upomp_bypay_info_select_2\" />\n \n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_input_btn2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n\t<item android:state_window_focused=\"false\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_2\" />\n\t<item android:state_focused=\"true\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_2_click\" />\n\t<item android:state_focused=\"false\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_2_click\" />\n\t<item android:state_selected=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_2_click\" />\n\t<item android:state_focused=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_2_click\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_input_btn4.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n\t\t<item android:state_window_focused=\"false\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_4\" />\n\t<item android:state_focused=\"true\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_4_click\" />\n\t<item android:state_focused=\"false\" android:state_pressed=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_4_click\" />\n\t<item android:state_selected=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_4_click\" />\n\t<item android:state_focused=\"true\"\n\t\tandroid:drawable=\"@drawable/upomp_bypay_input_btn_4_click\" />\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_keyboard_btn_clear.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n<!-- 默认状态  -->\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_clear_default\" /> \n<!-- 按下状态  -->\n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_clear_on\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_clear_on\" /> \n<!-- 选中状态  -->\n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_clear_on\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_clear_on\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_keyboard_btn_enter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n<!-- 默认状态  -->\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_enter_default\"/> \n<!-- 按下状态  -->\n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_enter_on\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_enter_on\" /> \n<!-- 选中状态  -->\n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_enter_on\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_btn_enter_on\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_keyboard_btn_l_clear.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n<!-- 默认状态  -->\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_clear_bg\" /> \n<!-- 按下状态  -->\n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_clear_bg_on\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_clear_bg_on\" /> \n<!-- 选中状态  -->\n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_clear_bg_on\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_keyboard_letter_clear_bg_on\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_open_btn_enter.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item android:state_window_focused=\"false\" \n        android:drawable=\"@drawable/upomp_bypay_open_btn\" /> \n  <item android:state_focused=\"true\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_open_btn_click\" /> \n  <item android:state_focused=\"false\" android:state_pressed=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_open_btn_click\" /> \n  <item android:state_selected=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_open_btn_click\" /> \n  <item android:state_focused=\"true\" \n        android:drawable=\"@drawable/upomp_bypay_open_btn_click\" /> \n</selector> "
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_progress.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rotate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:pivotX=\"50%\" android:pivotY=\"50%\" \n\tandroid:fromDegrees=\"0\" android:toDegrees=\"360\" >\n\t<shape android:shape=\"ring\" android:innerRadiusRatio=\"3\"\n\t\tandroid:thicknessRatio=\"8\" android:useLevel=\"false\">\n\t\t<gradient android:type=\"sweep\" android:useLevel=\"false\"\n\t\t\tandroid:startColor=\"#003c6a99\" android:centerColor=\"#883c6a99\"\n\t\t\tandroid:centerY=\"0.50\" android:endColor=\"#3c6a99\" />\n\t</shape>\n</rotate>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_progress_init.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rotate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:pivotX=\"50%\" android:pivotY=\"50%\" \n\tandroid:fromDegrees=\"0\" android:toDegrees=\"360\" >\n\t<shape android:shape=\"ring\" android:innerRadiusRatio=\"3\"\n\t\tandroid:thicknessRatio=\"8\" android:useLevel=\"false\">\n\t\t<gradient android:type=\"sweep\" android:useLevel=\"false\"\n\t\t\tandroid:startColor=\"#00ffffff\" android:centerColor=\"#88ffffff\"\n\t\t\tandroid:centerY=\"0.50\" android:endColor=\"#ffffff\" />\n\t</shape>\n</rotate>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_authcode_style.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item android:drawable=\"@drawable/zsht_get_authcode_button_pressed\" android:state_pressed=\"true\"/>\n    <item android:drawable=\"@drawable/zsht_get_authcode_button_pressed\" android:state_enabled=\"true\" android:state_focused=\"true\"/>\n    <item android:drawable=\"@drawable/zsht_get_authcode_button\" android:state_enabled=\"true\"/>\n\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_back_style.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item android:drawable=\"@drawable/zsht_back_pressed\" android:state_pressed=\"true\"/>\n    <item android:drawable=\"@drawable/zsht_back_pressed\" android:state_enabled=\"true\" android:state_focused=\"true\"/>\n    <item android:drawable=\"@drawable/zsht_back\" android:state_enabled=\"true\"/>\n\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_button_style.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item android:drawable=\"@drawable/zsht_button_pressed\" android:state_pressed=\"true\"/>\n    <item android:drawable=\"@drawable/zsht_button_pressed\" android:state_enabled=\"true\" android:state_focused=\"true\"/>\n    <item android:drawable=\"@drawable/zsht_button\" android:state_enabled=\"true\"/>\n\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_input_style.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n\r    <item android:drawable=\"@drawable/zsht_input_focused\" android:state_pressed=\"true\"/>\r\n    <item android:drawable=\"@drawable/zsht_input_focused\" android:state_enabled=\"true\" android:state_focused=\"true\"/>\r\n    <item android:drawable=\"@drawable/zsht_input\" android:state_enabled=\"true\"/>\r\n\r\n</selector>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_about.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_about\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_about\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\t<RelativeLayout android:id=\"@+id/sv_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_about\" android:layout_above=\"@+id/rl_bottom_about\"\n\t\tandroid:gravity=\"center_vertical\" >\n\t\t<ImageView android:id=\"@+id/about_0\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_loading_logo\"\n\t\t\tandroid:layout_centerHorizontal=\"true\"  android:layout_marginTop=\"-40dip\"/>\n\t\t<TextView android:id=\"@+id/about_1\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_0\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about1\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\t\t<TextView android:id=\"@+id/about_2\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_1\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about2\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\t\t<TextView android:id=\"@+id/about_3\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_2\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about3\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\t\t<TextView android:id=\"@+id/about_4\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_3\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about4\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\t\t<TextView android:id=\"@+id/about_5\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_4\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about5\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\t\t<TextView android:id=\"@+id/about_6\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_5\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about6\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\t\t<TextView android:id=\"@+id/about_7\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_6\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about7\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\t\t<TextView android:id=\"@+id/about_8\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/about_7\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:text=\"@string/upomp_bypay_about8\"\n\t\t\tandroid:textColor=\"#123860\" android:textSize=\"15sp\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\n\n\n\t</RelativeLayout>\n\n\t<RelativeLayout android:id=\"@+id/rl_bottom_about\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_about_btn.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    >\n    <Button android:id=\"@+id/btn_about\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n    android:background=\"@drawable/upomp_bypay_bottom_about\"  />\n\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_activity_dialog.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\">\r\n\t<LinearLayout android:focusable=\"true\"\r\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\r\n\t\tandroid:layout_height=\"0dip\" />\r\n\t<RelativeLayout android:id=\"@+id/rl_bg\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:background=\"#77000000\">\r\n\t</RelativeLayout>\r\n\t<RelativeLayout android:id=\"@+id/rl_dialog\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\">\r\n\t\t<RelativeLayout android:id=\"@+id/rl_bg_activity_dialog\"\r\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\tandroid:background=\"@drawable/upomp_bypay_open_bg\" android:gravity=\"center_vertical\">\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_content_activity_dialog\"\r\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:layout_centerHorizontal=\"true\">\r\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_icon_activity_dialog\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\r\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_activity_dialog\"\r\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_open_icon\"\r\n\t\t\t\t\t\tandroid:visibility=\"visible\" />\r\n\t\t\t\t\t<ProgressBar android:id=\"@+id/pb_activity_dialog\"\r\n\t\t\t\t\t\tandroid:layout_width=\"30dip\" android:layout_height=\"30dip\"\r\n\t\t\t\t\t\tandroid:visibility=\"gone\" />\r\n\t\t\t\t</RelativeLayout>\r\n\t\t\t\t<TextView android:id=\"@+id/tv_content_activity_dialog\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_icon_activity_dialog\"\r\n\t\t\t\t\t android:textColor=\"#ff000000\" android:textSize=\"16sp\"\r\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_marginLeft=\"10dip\" />\r\n\t\t\t</RelativeLayout>\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_btn_activity_dialog\"\r\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:layout_below=\"@id/rl_content_activity_dialog\"\r\n\t\t\t\tandroid:layout_marginTop=\"10dip\">\r\n\t\t\t\t<Button android:id=\"@+id/btn_return_activity_dialog\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_return\" android:background=\"@drawable/upomp_bypay_open_btn_enter\"\r\n\t\t\t\t\tandroid:textColor=\"#ffffffff\" android:textSize=\"16sp\"/>\r\n\t\t\t\t\r\n\t\t\t\t<Button android:id=\"@+id/btn_see_activity_dialog\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t android:layout_toRightOf=\"@+id/btn_return_activity_dialog\"\r\n\t\t\t\t\tandroid:layout_marginLeft=\"20dip\" android:background=\"@drawable/upomp_bypay_open_btn_enter\"\r\n\t\t\t\t\tandroid:textColor=\"#ffffffff\" android:textSize=\"16sp\"/>\r\n\t\t\t</RelativeLayout>\r\n\t\t</RelativeLayout>\r\t\t<ImageView android:layout_width=\"fill_parent\"\r\t\t\tandroid:layout_height=\"wrap_content\" android:layout_below=\"@id/rl_bg_activity_dialog\"\r\t\t\tandroid:background=\"@drawable/upomp_bypay_open_bg2\" />\r\n\t</RelativeLayout>\r</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_auth_bind_card.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_auth_bind_card\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_esc_auth_bind_card\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_pay_result_returnmerchant\" />\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_auth_bind_card\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_auth_bind_card\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_auth_bind_card\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_user_auth_bind_card\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_auth_bind_card\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_user_auth_bind_card\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_user_auth_bind_card\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon3\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_content_auth_bind_card\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_user_auth_bind_card\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_card_info_content_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/tv_tel_auth_bind_card\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_auth_bind_card\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_tel_user_auth_bind_card\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_auth_bind_card\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_tel_user_auth_bind_card\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_user_auth_bind_card\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/tv_tel_auth_bind_card\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_credit_auth_bind_card\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_user_auth_bind_card\">\n\n\n\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_validity_auth_bind_card\"\n\t\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_validity_title_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_date\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" />\n\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_validity_content_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/tv_validity_title_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t>\n\n\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_btn_mm_auth_bind_card\"\n\t\t\t\t\t\t\tandroid:layout_width=\"68dip\" android:layout_height=\"45dip\"\n\t\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_month\">\n\t\t\t\t\t\t\t<Button android:id=\"@+id/btn_mm_auth_bind_card\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:background=\"#00000000\"\n\t\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_btn_yy_auth_bind_card\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_btn_mm_auth_bind_card\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_width=\"68dip\"\n\t\t\t\t\t\t\tandroid:layout_height=\"45dip\" android:background=\"@drawable/upomp_bypay_btn_year\">\n\t\t\t\t\t\t\t<Button android:id=\"@+id/btn_yy_auth_bind_card\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\t\t\tandroid:background=\"#00000000\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t\t<ImageButton android:id=\"@+id/ib_image_cvn2\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_cvn2_auth_bind_card\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_validity_auth_bind_card\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\n\n\t\t\t\t\t<Button android:id=\"@+id/btn_cvn2_content_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypa_cvn2\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:password=\"true\" android:textSize=\"14sp\"\n\t\t\t\t\t\tandroid:background=\"#00000000\" android:layout_toLeftOf=\"@+id/ib_image_cvn21\" />\n\t\t\t\t\t<ImageButton android:id=\"@+id/ib_image_cvn21\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\n\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_debit_auth_bind_card\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_credit_auth_bind_card\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_pin_auth_bind_card\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" android:background=\"@drawable/upomp_bypay_input_bg\">\n\n\n\t\t\t\t\t<Button android:id=\"@+id/btn_pin_content_auth_bind_card\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:background=\"#00000000\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:hint=\"@string/upomp_bypay_secondcardpsw\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\t\t\t<Button android:id=\"@+id/btn_next_auth_bind_card\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_bind_card\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:layout_below=\"@id/rl_debit_auth_bind_card\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:textSize=\"20sp\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_auth_bind_card\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_auth_bind_card\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_auth_bind_card\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_auth_bind_card\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_credit.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_bindcard_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_bindcard_credit\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_bindcard_credit\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_bindcard_credit\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_bindcard_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_bindcard_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_bindcard_credit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_bindcard_credit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon3\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_bindcard_credit\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_issuercard_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_issuercard_content_bindcard_credit\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/tv_tel_bindcard_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_bindcard_credit\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_tel_bindcard_credit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_bindcard_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_tel_bindcard_credit\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_title_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_firstmobilenum\" android:gravity=\"right\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_telnum_title_bindcard_credit\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_bindcard_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/tv_tel_bindcard_credit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_mobilevalidcode_bindcard_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_bindcard_credit\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<EditText android:id=\"@+id/et_mobilevalidcode_content_bindcard_credit\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:maxLength=\"6\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondshortmessagesecuritycode\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_mobilevalidcode_content_bindcard_credit\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t<Button android:id=\"@+id/btn_mobilevalidcode_content_bindcard_credit\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_input_btn2\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_retry\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" />\n\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_validity_bindcard_credit\"\n\t\t\t\tandroid:layout_below=\"@id/rl_mobilevalidcode_bindcard_credit\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_validity_title_bindcard_credit\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_date\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" />\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_validity_content_bindcard_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/tv_validity_title_bindcard_credit\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\">\n\n\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_btn_mm_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"68dip\" android:layout_height=\"45dip\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_month\">\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_mm_bindcard_credit\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:background=\"#00000000\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_btn_yy_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_btn_mm_bindcard_credit\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_width=\"68dip\"\n\t\t\t\t\t\tandroid:layout_height=\"45dip\" android:background=\"@drawable/upomp_bypay_btn_year\">\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_yy_bindcard_credit\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\t\tandroid:background=\"#00000000\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageButton android:id=\"@+id/ib_image_cvn2\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\n\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_cvn2_bindcard_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_validity_bindcard_credit\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\n\t\t\t\t<Button android:id=\"@+id/btn_cvn2_content_bindcard_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypa_cvn2\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:password=\"true\" android:textSize=\"14sp\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/ib_image_cvn21\" />\n\t\t\t\t<ImageButton android:id=\"@+id/ib_image_cvn21\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\n\t\t\t</RelativeLayout>\n\n\t\t\t<Button android:id=\"@+id/btn_next_bindcard_credit\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_next\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:layout_below=\"@id/rl_cvn2_bindcard_credit\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:textSize=\"20sp\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_bindcard_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_bindcard_credit\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_bindcard_credit\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_bindcard_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_debit.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_bindcard_debit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_bindcard_debit\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_bindcard_debit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_bindcard_debit\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_bindcard_debit\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_bindcard_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_bindcard_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_bindcard_debit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_bindcard_debit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_bindcard_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon3\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_content_bindcard_debit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_bindcard_debit\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_issuercard_bindcard_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_issuercard_content_bindcard_debit\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/tv_tel_bindcard_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_bindcard_debit\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_tel_bindcard_debit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_bindcard_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_bindcard_debit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_tel_bindcard_debit\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_title_bindcard_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_firstmobilenum\" android:gravity=\"right\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_bindcard_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_telnum_title_bindcard_debit\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_bindcard_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/tv_tel_bindcard_debit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_mobilevalidcode_bindcard_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_bindcard_debit\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<EditText android:id=\"@+id/et_mobilevalidcode_content_bindcard_debit\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:maxLength=\"6\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondshortmessagesecuritycode\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_mobilevalidcode_content_bindcard_debit\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t<Button android:id=\"@+id/btn_mobilevalidcode_content_bindcard_debit\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_input_btn2\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_retry\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" />\n\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_pin_bindcard_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_mobilevalidcode_bindcard_debit\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:background=\"@drawable/upomp_bypay_input_bg\">\n\n\t\t\t\t\n\n\t\t\t\t<Button android:id=\"@+id/btn_pin_content_bindcard_debit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondcardpsw\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:background=\"#00000000\" />\n\n\t\t\t</RelativeLayout>\n\n\n\n\n\n\n\t\t\t<Button android:id=\"@+id/btn_next_bindcard_debit\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_next\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\tandroid:textSize=\"20sp\" android:layout_below=\"@id/rl_pin_bindcard_debit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginTop=\"8dip\" />\n\t\t\t\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_bindcard_debit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_bindcard_debit\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_bindcard_debit\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_bindcard_debit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_pan.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\r\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\r\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\r\n\t<LinearLayout android:focusable=\"true\"\r\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\r\n\t\tandroid:layout_height=\"0dip\" />\r\n\t<RelativeLayout android:id=\"@+id/rl_header_bindcard_pan\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\r\n\t\t<Button android:id=\"@+id/btn_return_bindcard_pan\"\r\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\r\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\r\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\r\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\r\n\t</RelativeLayout>\r\n\r\n\r\n\t<ScrollView android:id=\"@+id/sv_bindcard_pan\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:layout_below=\"@id/rl_header_bindcard_pan\"\r\n\t\tandroid:layout_above=\"@+id/rl_bottom_bindcard_pan\">\r\n\r\n\r\n\t\t<RelativeLayout android:id=\"@+id/rl_user_bindcard_pan\"\r\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\r\n\t\t\tandroid:layout_marginTop=\"20dip\">\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_user_content_bindcard_pan\"\r\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\r\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\r\n\r\n\t\t\t\t<EditText android:id=\"@+id/et_user_input_content_content_bindcard_pan\"\r\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:numeric=\"integer\"\r\n\t\t\t\t\tandroid:singleLine=\"true\" android:maxLength=\"23\"\r\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_pan\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\tandroid:background=\"#00000000\" android:textSize=\"15sp\"\r\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/ib_info_bindcard_pan\" />\r\n\t\t\t\t<ImageButton android:id=\"@+id/ib_info_bindcard_pan\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\r\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\r\n\t\t\t</RelativeLayout>\r\n\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_user_tel_bindcard_pan\"\r\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\r\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_below=\"@id/rl_user_content_bindcard_pan\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\r\n\r\n\t\t\t\t<EditText android:id=\"@+id/et_user_tel_content_bindcard_pan\"\r\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:numeric=\"integer\"\r\n\t\t\t\t\tandroid:singleLine=\"true\" android:maxLength=\"11\"\r\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:background=\"#00000000\"\r\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_tel\" android:textSize=\"15sp\" />\r\n\t\t\t</RelativeLayout>\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_user_webvalidcode_bindcard_pan\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:layout_below=\"@id/rl_user_tel_bindcard_pan\"\r\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\r\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\">\r\n\r\n\t\t\t\t<EditText android:id=\"@+id/et_user_webvalidcode_content_bindcard_pan\"\r\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\tandroid:numeric=\"integer\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\tandroid:maxLength=\"4\" android:singleLine=\"true\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\tandroid:background=\"#00000000\" android:textSize=\"15sp\"\r\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/iv_user_webvalidcode_content_bindcard_pan\"\r\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_image_validate\" />\r\n\t\t\t\t<ImageView android:id=\"@+id/iv_user_webvalidcode_content_bindcard_pan\"\r\n\t\t\t\t\tandroid:layout_width=\"70dip\" android:layout_height=\"38dip\"\r\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:layout_centerVertical=\"true\" />\r\n\t\t\t\t<ProgressBar android:id=\"@+id/p_user_webvalidcode_content_bindcard_pan\"\r\n\t\t\t\t\tandroid:layout_width=\"30dip\" android:layout_height=\"30dip\"\r\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"15dip\"\r\n\t\t\t\t\tandroid:indeterminateDrawable=\"@drawable/upomp_bypay_progress\"\r\n\t\t\t\t\tandroid:visibility=\"gone\" android:layout_marginLeft=\"30dip\"\r\n\t\t\t\t\tandroid:layout_marginTop=\"5dip\" />\r\n\r\n\t\t\t</RelativeLayout>\r\n\r\n\t\t\t<Button android:id=\"@+id/btn_user_login_content_next_bindcard_pan\"\r\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:text=\"@string/upomp_bypay_next\" android:textColor=\"#ffffff\"\r\n\t\t\t\tandroid:layout_below=\"@id/rl_user_webvalidcode_bindcard_pan\"\r\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_centerHorizontal=\"true\"\r\n\t\t\t\tandroid:textSize=\"20sp\" android:background=\"@drawable/upomp_bypay_btn_enter2\" />\r\n\r\n\r\n\t\t</RelativeLayout>\r\n\r\n\t</ScrollView>\r\n\t<com.unionpay.upomp.bypay.view.About\r\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:layout_alignParentBottom=\"true\"\r\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\r\n\t<RelativeLayout android:id=\"@+id/main_dialog_bindcard_pan\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:layout_below=\"@id/rl_header_bindcard_pan\"\r\n\t\tandroid:layout_above=\"@+id/rl_bottom_bindcard_pan\" />\r\n\t<RelativeLayout android:id=\"@+id/rl_bottom_bindcard_pan\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\r\n\t\tandroid:layout_alignParentBottom=\"true\">\r\n\t</RelativeLayout>\r</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_result.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\"\n\tandroid:layout_marginLeft=\"15dip\" android:layout_marginRight=\"15dip\"\n\tandroid:layout_marginTop=\"35dip\" android:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n<RelativeLayout android:id=\"@+id/rl_header_bindcard_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_bindcard_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_bindcard_result\" android:layout_above=\"@+id/rl_bottom_bindcard_result\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t\n\t\t\t<ImageView android:id=\"@+id/iv_result_top_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\"  />\n\t\t\t<RelativeLayout android:id=\"@+id/tv_result_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_result_top_bindcard_result\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_result_bindcard_result\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_result_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon1\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_result_content_bindcard_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_result_bindcard_result\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\n\t\t\t\t\n\t\t\t\t\t<TextView android:id=\"@+id/tv_result_content_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_marginLeft=\"10dip\"\n\t\t\t\t\t\tandroid:textColor=\"#ff0000\" android:textSize=\"14sp\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_result_bot_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/tv_result_bindcard_result\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\t\t\t\t\n\t\t\t<TextView android:id=\"@+id/iv_hint_bot_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_result_bot_bindcard_result\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:text=\"@string/upomp_bypay_bindcard_hint\"\n\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"/>\n\t\t\t\t\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_below=\"@id/iv_hint_bot_bindcard_result\"/>\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_bindcard_result\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_bindcard_result\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"90dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon3\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_content_bindcard_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"90dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_bindcard_result\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_issuercard_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_issuercard_title_bindcard_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_cardinfo_issuercard\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:gravity=\"right\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_issuercard_content_bindcard_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_issuercard_title_bindcard_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_issuercard_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_type_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_issuercard_bindcard_result\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_card_type_title_bindcard_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_cardtype\" android:gravity=\"right\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_card_type_content_bindcard_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_card_type_title_bindcard_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_card_type_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_pan_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_card_type_bindcard_result\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_pan_title_bindcard_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_cardmainactivity_cardid\"\n\t\t\t\t\t\t\tandroid:gravity=\"right\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:textSize=\"14sp\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_pan_content_bindcard_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_pan_title_bindcard_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/tv_tel_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_bindcard_result\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_tel_bindcard_result\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_bindcard_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_tel_bindcard_result\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_title_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_firstmobilenum\" android:gravity=\"right\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_bindcard_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_telnum_title_bindcard_result\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/tv_tel_bindcard_result\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\n\t\t\t<TextView android:id=\"@+id/tv_help_bot_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_bindcard_result\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:text=\"@string/upomp_bypay_bindcard_help\"\n\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"/>\n\n\n\t\t\t<Button android:id=\"@+id/btn_return_bindcard_result\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:textSize=\"20sp\" android:background=\"@drawable/upomp_bypay_btn_esc2\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_return\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_centerHorizontal=\"true\"\n\t\t\t\tandroid:layout_below=\"@id/tv_help_bot_bindcard_result\" />\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_bindcard_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_cardlist_content.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t<RelativeLayout android:id=\"@+id/rl_head_list_title\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_marginTop=\"10dip\">\n\n\t</RelativeLayout>\n\t<ImageView android:id=\"@+id/iv_info_top_user_list_title\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\tandroid:layout_below=\"@id/rl_head_list_title\" />\n\n\t<RelativeLayout android:id=\"@+id/rl_card_info_list_title\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\tandroid:layout_below=\"@id/iv_info_top_user_list_title\">\n\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_user_list_title\"\n\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\n\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t<ImageView android:id=\"@+id/iv_card_info_list_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon3\" />\n\t\t</RelativeLayout>\n\t\t<RelativeLayout android:id=\"@+id/rl_card_info_content_list_title\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_user_list_title\">\n\t\t\t<TextView android:id=\"@+id/tv_card_info_content_list_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" \n\t\t\t\t/>\n\n\t\t</RelativeLayout>\n\t</RelativeLayout>\n\t<ImageView android:id=\"@+id/iv_default_icon\" android:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\" android:layout_alignParentRight=\"true\"\n\t\tandroid:background=\"@drawable/upomp_bypay_card_icon1\"\n\t\tandroid:layout_below=\"@id/rl_head_list_title\" />\n\t<!-- default -->\n\t<RelativeLayout android:id=\"@+id/rl_default_card_list_title\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_card_info_list_title\"\n\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\">\n\n\t\t<RelativeLayout android:id=\"@+id/rl_iv_default_card_list_title\"\n\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\n\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\n\t\t</RelativeLayout>\n\n\t\t<RelativeLayout android:id=\"@+id/rl_default_card_content_list_title\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_default_card_list_title\"\n\t\t\t>\n\t\t\t<ImageView android:id=\"@+id/iv_default_icon_list_title\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_icon_card\"\n\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_centerVertical=\"true\"/>\n\t\t\t<TextView android:id=\"@+id/tv_default_card_content_list_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_card_btn2\" android:layout_marginLeft=\"5dip\"\n\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_centerVertical=\"true\"\n\t\t\t\tandroid:textSize=\"14sp\" android:layout_toRightOf=\"@+id/iv_default_icon_list_title\"/>\n\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_icon_jiantou\"\n\t\t\tandroid:layout_marginRight=\"5dip\" android:layout_alignParentRight=\"true\" android:layout_centerVertical=\"true\"/>\n\t\t</RelativeLayout>\n\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" \n\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_default_card_list_title\"/>\n\t</RelativeLayout>\n\n\t<!-- del -->\n\t<RelativeLayout android:id=\"@+id/rl_del_card_list_title\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_default_card_list_title\"\n\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\">\n\n\t\t<RelativeLayout android:id=\"@+id/rl_iv_del_card_list_title\"\n\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\n\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\n\t\t</RelativeLayout>\n\n\t\t<RelativeLayout android:id=\"@+id/rl_del_card_content_list_title\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_del_card_list_title\"\n\t\t\t>\n\t\t\t<ImageView android:id=\"@+id/iv_del_icon_list_title\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_icon_pw\"\n\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_centerVertical=\"true\"/>\n\t\t\t<TextView android:id=\"@+id/tv_del_card_content_list_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_card_btn3\" android:layout_marginLeft=\"5dip\"\n\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_centerVertical=\"true\"\n\t\t\t\tandroid:textSize=\"14sp\" android:layout_toRightOf=\"@+id/iv_del_icon_list_title\"/>\n\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_icon_jiantou\"\n\t\t\tandroid:layout_marginRight=\"5dip\" android:layout_alignParentRight=\"true\" android:layout_centerVertical=\"true\"/>\n\t\t</RelativeLayout>\n\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" \n\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_del_card_list_title\"/>\n\t</RelativeLayout>\n\t<ImageView android:id=\"@+id/iv_info_bot_user_list_title\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\tandroid:layout_below=\"@id/rl_del_card_list_title\" />\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_get_pass.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/rl_user_getpass\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" android:layout_marginBottom=\"35dip\"\n\tandroid:layout_marginLeft=\"15dip\" android:layout_marginRight=\"15dip\"\n\tandroid:layout_marginTop=\"35dip\" android:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\n\n\t<RelativeLayout android:id=\"@+id/rl_header_get_pass\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_get_pass\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\t<ScrollView android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\" android:layout_below=\"@id/rl_header_get_pass\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\n\t\t\t<!-- one -->\n\t\t\t<RelativeLayout android:id=\"@+id/rl_info_getpass\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:visibility=\"gone\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_username_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t\t<EditText android:id=\"@+id/et_username_getpass\"\n\t\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"40dip\" android:textColor=\"#000000\"\n\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_getpass_name_hint\"\n\t\t\t\t\t\tandroid:textSize=\"15sp\" android:background=\"#00000000\"\n\t\t\t\t\t\tandroid:maxLength=\"20\" android:layout_marginLeft=\"5dip\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_username_getpass\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t\t<EditText android:id=\"@+id/et_telnum_getpass\"\n\t\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"40dip\" android:textColor=\"#000000\"\n\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_getpass_tel_hint\"\n\t\t\t\t\t\tandroid:numeric=\"integer\" android:maxLength=\"11\" android:textSize=\"15sp\"\n\t\t\t\t\t\tandroid:background=\"#00000000\" android:layout_marginLeft=\"5dip\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_validcode_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_telnum_getpass\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t\t<EditText android:id=\"@+id/et_validcode_getpass\"\n\t\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"40dip\" android:numeric=\"integer\"\n\t\t\t\t\t\tandroid:maxLength=\"6\" android:textColor=\"#000000\"\n\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_note_validate\" android:textSize=\"15sp\"\n\t\t\t\t\t\tandroid:background=\"#00000000\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t<Button android:id=\"@+id/btn_validcode_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"40dip\"\n\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_btn4\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_get\" android:textSize=\"15dip\"\n\t\t\t\t\t\tandroid:textColor=\"#000000\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_webvalidcode_getpass\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_alignParentRight=\"true\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_validcode_getpass\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t\t<EditText android:layout_height=\"40dip\"\n\t\t\t\t\t\tandroid:singleLine=\"true\" android:id=\"@+id/et_webvalidcode_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"120dip\" android:numeric=\"integer\"\n\t\t\t\t\t\tandroid:textColor=\"#000000\" android:maxLength=\"4\"\n\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_image_validate\"\n\t\t\t\t\t\tandroid:textSize=\"15sp\" android:background=\"#00000000\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_webvalidcode_getpass\"\n\t\t\t\t\t\tandroid:layout_height=\"38dip\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:layout_width=\"70dip\" android:layout_alignParentRight=\"true\" />\n\t\t\t\t\t<ProgressBar android:id=\"@+id/p_webvalidcode_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"30dip\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\t\t\t\tandroid:indeterminateDrawable=\"@drawable/upomp_bypay_progress\"\n\t\t\t\t\t\tandroid:visibility=\"gone\" android:layout_marginLeft=\"30dip\"\n\t\t\t\t\t\tandroid:layout_marginTop=\"5dip\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_button_next_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_webvalidcode_getpass\"\n\t\t\t\t\tandroid:layout_marginTop=\"20dip\">\n\t\t\t\t\t<Button android:id=\"@+id/btn_button_next_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:textSize=\"20sp\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_next\" android:textColor=\"#FFFFFF\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t\t<!-- two -->\n\t\t\t<RelativeLayout android:id=\"@+id/rl_next_getpass\"\n\t\t\t\tandroid:visibility=\"visible\" android:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" android:layout_marginTop=\"8dip\"\n\t\t\t\t >\n\t\t\t\t<ImageView android:id=\"@+id/iv_info_top_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_name_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\tandroid:layout_below=\"@id/iv_info_top_getpass\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_name_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t\t<ImageView android:id=\"@+id/iv_name_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon4\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_name_content_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_name_getpass\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_name_title_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_getpass_name\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_name_content_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_name_title_getpass\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/tv_tel_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_name_getpass\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_tel_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t\t</RelativeLayout>\n\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_tel_getpass\" android:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_info_bot_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\t\tandroid:layout_below=\"@id/tv_tel_getpass\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_question_top_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\t\tandroid:layout_marginTop=\"10dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_below=\"@id/iv_info_bot_getpass\" />\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_question_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\tandroid:layout_below=\"@id/iv_question_top_getpass\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_question_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t\t<ImageView android:id=\"@+id/iv_question_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon4\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_question_content_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_question_getpass\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_question_title_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_securityissue\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_question_info_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_question_title_getpass\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_question_bot_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_question_getpass\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_question_result_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_below=\"@id/iv_question_bot_getpass\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t\t<EditText android:id=\"@+id/et_question_result_getpass\"\n\t\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"40dip\" android:textColor=\"#000000\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_getpass_questionkey_hint\" android:textSize=\"15sp\"\n\t\t\t\t\t\tandroid:background=\"#00000000\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_newpass_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_question_result_getpass\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_newpass_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_getpass_psw1_hint\" android:textColor=\"#000000\"\n\t\t\t\t\t\t\tandroid:gravity=\"left|center_vertical\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:background=\"#00000000\" />\n\t\t\t\t\t\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_confirm_newpass_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_newpass_getpass\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_confirm_newpass_getpass\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_getpass_psw2_hint\" android:textColor=\"#000000\"\n\t\t\t\t\t\t\tandroid:gravity=\"left|center_vertical\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:background=\"#00000000\" />\n\t\t\t\t\t\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_result_psw_getpass\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_confirm_newpass_getpass\"\n\t\t\t\t\tandroid:layout_marginTop=\"20dip\">\n\t\t\t\t\t<Button android:id=\"@+id/btn_result_psw_getpass\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:text=\"@string/upomp_bypay_affirm\"\n\t\t\t\t\t\tandroid:textColor=\"#FFFFFF\" android:textSize=\"20sp\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t</RelativeLayout>\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_get_pass\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_get_pass\" android:layout_above=\"@+id/rl_bottom_get_pass\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_get_pass\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_image_cvn2.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\">\r\n\t<LinearLayout android:focusable=\"true\"\r\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\r\n\t\tandroid:layout_height=\"0dip\" />\r\n\t<RelativeLayout android:id=\"@+id/rl_bg\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:background=\"#77000000\">\r\n\t</RelativeLayout>\r\n\t<RelativeLayout android:id=\"@+id/rl_dialog\"\r\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_cvn2\"\r\n\t\tandroid:layout_centerHorizontal=\"true\" android:layout_centerVertical=\"true\">\r\n\t</RelativeLayout>\r\n\r\r</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_dialog.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\tandroid:gravity=\"bottom\" android:id=\"@+id/keyborad_view\">\n\t<RelativeLayout android:layout_width=\"wrap_content\"\n\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_keyboard_bg\">\n\n\t\t<RelativeLayout android:id=\"@+id/rl_et_psw_window\"\n\t\t\tandroid:layout_marginTop=\"30dip\" android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:layout_marginLeft=\"5dip\"\n\t\t\tandroid:layout_marginRight=\"5dip\" android:background=\"@drawable/upomp_bypay_keyboard_input_bg\">\n\t\t\t<EditText android:id=\"@+id/et_psw_window\"\n\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" android:editable=\"false\"\n\t\t\t\tandroid:cursorVisible=\"false\" android:layout_marginLeft=\"15dip\"\n\t\t\t\tandroid:layout_marginRight=\"15dip\" android:password=\"true\"\n\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\tandroid:background=\"#00000000\" />\n\t\t</RelativeLayout>\n\t\t<RelativeLayout android:id=\"@+id/rl_bg_keyboard\"\n\t\t\tandroid:layout_below=\"@id/rl_et_psw_window\" android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_keyboard_pw_bg\"\n\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_marginRight=\"5dip\"\n\t\t\t android:layout_marginTop=\"5dip\">\n\t\t\t<LinearLayout android:id=\"@+id/ll_keyboard\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\">\n\n\t\t\t</LinearLayout>\n\t\t</RelativeLayout>\n\t\t<RelativeLayout android:id=\"@+id/rl_key_menu\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_below=\"@id/rl_bg_keyboard\" android:layout_marginTop=\"5dip\"\n\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_marginRight=\"5dip\">\n\t\t\t<RelativeLayout android:id=\"@+id/rl_line1_menu\"\n\t\t\t\tandroid:layout_width=\"225dip\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_keyboard_nav_bg\">\n\t\t\t\t<Button android:id=\"@+id/btn_num\" android:layout_width=\"75dip\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:background=\"@drawable/upomp_bypay_keyboard_btn1_on\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_keyboard_number\"\n\t\t\t\t\tandroid:textColor=\"#FFFFFF\" android:layout_centerVertical=\"true\" />\n\t\t\t\t<Button android:id=\"@+id/btn_letter\" android:layout_width=\"75dip\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_keyboard_letter\"\n\t\t\t\t\tandroid:textColor=\"#FFFFFF\" android:layout_toRightOf=\"@+id/btn_num\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\t\t\t\t<Button android:id=\"@+id/btn_symbol\" android:layout_width=\"75dip\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_keyboard_symbol\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#FFFFFF\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/btn_letter\" />\n\t\t\t</RelativeLayout>\n\t\t\t<Button android:id=\"@+id/btn_enter\" android:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_keyboard_btn_enter\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_affirm\" android:textColor=\"#FFFFFF\"\n\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginTop=\"2dip\" />\n\t\t</RelativeLayout>\n\t</RelativeLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_letter.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\n\t<RelativeLayout android:id=\"@+id/rl_letter_line1\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\n\t\t<Button android:id=\"@+id/btn_keyQ\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_keyW\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyQ\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyE\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyW\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyR\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyE\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyT\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyR\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyY\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyT\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyU\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyY\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyI\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyU\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyO\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyI\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyP\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyO\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t</RelativeLayout>\n\t<RelativeLayout android:id=\"@+id/rl_letter_line2\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_letter_line1\" android:layout_marginTop=\"10dip\"\n\t\tandroid:layout_marginLeft=\"17dip\">\n\t\t<Button android:id=\"@+id/btn_keyA\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_keyS\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyA\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyD\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyS\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyF\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyD\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyG\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyF\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyH\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyG\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyJ\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyH\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyK\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyJ\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyL\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyK\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t</RelativeLayout>\n\t<RelativeLayout android:id=\"@+id/rl_letter_line3\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_letter_line2\" android:layout_marginTop=\"10dip\">\n\t\t<Button android:id=\"@+id/btn_letter_size\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_keyboard_letter_a1\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_keyZ\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_letter_size\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyX\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyZ\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyC\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyX\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyV\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyC\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyB\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyV\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyN\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyB\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_keyM\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_letter\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_keyN\"\n\t\t\tandroid:layout_marginLeft=\"3dip\" />\n\t\t<Button android:id=\"@+id/btn_letter_backspace\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_keyboard_btn_l_clear\"\n\t\t\tandroid:text=\"@string/upomp_bypay_keyboard_clear\" android:textColor=\"#ffffff\"\n\t\t\tandroid:layout_toRightOf=\"@+id/btn_keyM\" android:layout_marginLeft=\"3dip\" />\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_num.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\n\t<RelativeLayout android:id=\"@+id/rl_line1\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\n\t\t<Button android:id=\"@+id/btn_key1\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_key2\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_key1\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t<Button android:id=\"@+id/btn_key3\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_key2\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t<Button android:id=\"@+id/btn_key4\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_key3\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t</RelativeLayout>\n\t<RelativeLayout android:id=\"@+id/rl_line2\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_line1\" android:layout_marginTop=\"10dip\">\n\t\t<Button android:id=\"@+id/btn_key5\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_key6\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_key5\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t<Button android:id=\"@+id/btn_key7\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_key6\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t<Button android:id=\"@+id/btn_key8\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_key7\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t</RelativeLayout>\n\t<RelativeLayout android:id=\"@+id/rl_line3\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_line2\" android:layout_marginTop=\"10dip\">\n\t\t<Button android:id=\"@+id/btn_key9\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_key0\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_number\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_key9\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t<Button android:id=\"@+id/btn_backspace\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_keyboard_btn_clear\"\n\t\t\tandroid:text=\"@string/upomp_bypay_keyboard_clear\" android:textColor=\"#ffffff\"\n\t\t\tandroid:layout_toRightOf=\"@+id/btn_key0\" android:layout_marginLeft=\"10dip\" />\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_symbol.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\n\t<RelativeLayout android:id=\"@+id/rl_symbol_line1\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\n\t\t<Button android:id=\"@+id/btn_symbol_0\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_symbol_1\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_0\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_2\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_1\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_3\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_2\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_4\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_3\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_5\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_4\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t</RelativeLayout>\n\t<RelativeLayout android:id=\"@+id/rl_symbol_line2\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_symbol_line1\" android:layout_marginTop=\"10dip\">\n\t\t<Button android:id=\"@+id/btn_symbol_6\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" />\n\t\t<Button android:id=\"@+id/btn_symbol_7\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_6\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_8\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_7\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_9\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_8\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_10\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_9\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_11\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_10\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t</RelativeLayout>\n\t<RelativeLayout android:id=\"@+id/rl_symbol_line3\"\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/rl_symbol_line2\" android:layout_marginTop=\"10dip\">\n\t\t<Button android:id=\"@+id/btn_symbol_change\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:text=\"@string/upomp_bypay_symbol\"/>\n\t\t<Button android:id=\"@+id/btn_symbol_12\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_change\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_13\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_12\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_14\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_13\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_15\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_symbol\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_14\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t\t<Button android:id=\"@+id/btn_symbol_backspace\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_symbol\" android:text=\"@string/upomp_bypay_keyboard_clear\"\n\t\t\tandroid:textColor=\"#ffffff\" android:layout_toRightOf=\"@+id/btn_symbol_15\"\n\t\t\tandroid:layout_marginLeft=\"7dip\" />\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_cardmanage.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_onuser_cardmanage\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_onuser_cardmanage\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\n\n\t<ScrollView android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\" android:layout_below=\"@id/rl_header_onuser_cardmanage\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_onuser_cardmanage\"\n\t\tandroid:layout_marginBottom=\"10dip\" android:layout_marginTop=\"20dip\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<RelativeLayout android:id=\"@+id/rl_onuser_cardmanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t</RelativeLayout>\n\t\t\t<Button android:id=\"@+id/btn_addcard_onuser_cardmanage\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_addcard\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:textSize=\"20dip\" android:layout_centerHorizontal=\"true\"\n\t\t\t\tandroid:layout_below=\"@id/rl_onuser_cardmanage\" android:background=\"@drawable/upomp_bypay_btn_esc2\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" />\n\n\t\t</RelativeLayout>\n\t</ScrollView>\n\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\n\t<RelativeLayout android:id=\"@+id/main_dialog_onuser_cardmanage\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_onuser_cardmanage\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_onuser_cardmanage\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_onuser_cardmanage\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_change_psw.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/rl_edit_pass\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_bg\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\n\t<RelativeLayout android:id=\"@+id/rl_header_change_psw\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_change_psw\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\n\n\t<ScrollView android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\" android:layout_below=\"@id/rl_header_change_psw\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_change_psw\">\n\t\t<RelativeLayout android:id=\"@+id/rl_body_change_psw\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\">\n\n\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_old_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_userpass_old_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:text=\"@string/upomp_bypay_editpass_oldpsw\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"15sp\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\n\t\t\t\t<Button android:id=\"@+id/btn_userpass_old_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_editpass_oldpswhint\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_toRightOf=\"@+id/tv_userpass_old_change_psw\" />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_new_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_userpass_old_change_psw\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_userpass_new_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:text=\"@string/upomp_bypay_newpsw\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:textSize=\"15sp\" />\n\n\t\t\t\t<Button android:id=\"@+id/btn_userpass_new_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_sixtotwelve\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:gravity=\"left|center_vertical\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_userpass_new_change_psw\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_re_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_userpass_new_change_psw\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_userpass_re_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_enternewpsw\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textSize=\"15sp\" />\n\n\t\t\t\t<Button android:id=\"@+id/btn_userpass_re_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_sixtotwelve\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:gravity=\"left|center_vertical\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_userpass_re_change_psw\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_top_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_below=\"@id/rl_userpass_re_change_psw\" />\n\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_old_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_top_change_psw\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_change_psw\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<TextView android:id=\"@+id/tv_telnum_title_old_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\" android:text=\"@string/upomp_bypay_firstmobilenum\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_toRightOf=\"@+id/rl_iv_change_psw\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\n\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_old_change_psw\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:maxLength=\"11\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"15sp\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_toRightOf=\"@+id/tv_telnum_title_old_change_psw\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_bot_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_telnum_old_change_psw\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\t\t\t<RelativeLayout android:id=\"@+id/rl_validcode_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_bot_change_psw\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_validcode_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_firstshortmessagesecuritycode\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textSize=\"15sp\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\n\t\t\t\t<EditText android:id=\"@+id/et_validcode_change_psw\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:maxLength=\"6\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondshortmessagesecuritycode\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_toRightOf=\"@+id/tv_validcode_change_psw\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_validcode_change_psw\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\n\t\t\t\t<Button android:id=\"@+id/btn_validcode_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_btn4\" android:text=\"@string/upomp_bypay_get\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:textColor=\"#6a7482\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_button_change_psw\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_validcode_change_psw\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\">\n\t\t\t\t<Button android:id=\"@+id/btn_button_change_psw\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:text=\"@string/upomp_bypay_affirm\"\n\t\t\t\t\tandroid:textColor=\"#FFFFFF\" android:textSize=\"20sp\" />\n\t\t\t\t\n\t\t\t</RelativeLayout>\n\t\t</RelativeLayout>\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_change_psw\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_change_psw\" android:layout_above=\"@+id/rl_bottom_change_psw\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_change_psw\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n\t\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_change_tel.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/rl_edit_info\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_bg\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_change_tel\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_change_tel\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\n\t<ScrollView android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\" android:layout_below=\"@id/rl_header_change_tel\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_change_tel\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\n\t\t\t<ImageView android:id=\"@+id/iv_top1_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\t\t\t<RelativeLayout android:id=\"@+id/rl_name_old_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_top1_change_tel\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv1_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv1_change_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon4\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<TextView android:id=\"@+id/tv_name_title_old_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\" android:text=\"@string/upomp_bypay_getpass_name\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_toRightOf=\"@+id/rl_iv1_change_tel\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\n\t\t\t\t<TextView android:id=\"@+id/tv_name_content_old_change_tel\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:maxLength=\"11\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"15sp\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_toRightOf=\"@+id/tv_name_title_old_change_tel\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_bot1_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_name_old_change_tel\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_login_psw_content_change_tel\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_bot1_change_tel\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<TextView android:id=\"@+id/tv_login_psw_content_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pswname\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\n\t\t\t\t<Button android:id=\"@+id/btn_login_psw_content_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_user_psw\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:textSize=\"15sp\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_login_psw_content_change_tel\"\n\t\t\t\t\tandroid:gravity=\"left|center\" android:background=\"#00000000\" />\n\n\t\t\t</RelativeLayout>\n\n\n\n\t\t\t<ImageView android:id=\"@+id/iv_top_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_below=\"@id/rl_login_psw_content_change_tel\" />\n\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_old_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_top_change_tel\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_change_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<TextView android:id=\"@+id/tv_telnum_title_old_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\" android:text=\"@string/upomp_bypay_editinfo_oldtel\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_toRightOf=\"@+id/rl_iv_change_tel\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\n\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_old_change_tel\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:maxLength=\"11\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"15sp\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_toRightOf=\"@+id/tv_telnum_title_old_change_tel\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_bot_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_telnum_old_change_tel\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_new_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\tandroid:layout_below=\"@id/iv_bot_change_tel\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_telnum_new_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_editinfo_newtel\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:textSize=\"15sp\" />\n\n\t\t\t\t<EditText android:id=\"@+id/et_telnum_new_change_tel\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:maxLength=\"11\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_telnum_new_change_tel\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_editinfo_newtelhint\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"15sp\"\n\t\t\t\t\tandroid:background=\"#00000000\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_validcode_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_telnum_new_change_tel\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_validcode_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_firstshortmessagesecuritycode\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\" />\n\n\t\t\t\t<EditText android:id=\"@+id/et_validcode_change_tel\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:maxLength=\"6\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondshortmessagesecuritycode\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_validcode_change_tel\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_validcode_change_tel\" />\n\t\t\t\t<Button android:id=\"@+id/btn_validcode_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_btn4\" android:text=\"@string/upomp_bypay_get\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:textColor=\"#000000\" />\n\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_button_change_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_validcode_change_tel\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\">\n\t\t\t\t<Button android:id=\"@+id/btn_button_change_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textSize=\"20sp\" android:layout_centerHorizontal=\"true\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\" android:text=\"@string/upomp_bypay_affirm\"\n\t\t\t\t\tandroid:textColor=\"#FFFFFF\" />\n\t\t\t</RelativeLayout>\n\t\t</RelativeLayout>\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_change_tel\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_change_tel\" android:layout_above=\"@+id/rl_bottom_change_tel\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_change_tel\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_tel.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_onuser_tel\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_onuser_tel\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_onuser_tel\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_onuser_tel\" android:layout_above=\"@+id/rl_bottom_onuser_tel\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\n\t\t\t<ImageView android:id=\"@+id/iv_top_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top3\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_info_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"80dip\"\n\t\t\t\tandroid:layout_below=\"@id/iv_top_onuser_tel\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_name_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/iv_info_right_onuser_tle\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_name_title_onuser_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:text=\"@string/upomp_bypay_username\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_name_content_onuser_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_name_title_onuser_tel\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_welcome_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_name_onuser_tel\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/iv_info_right_onuser_tle\">\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"1dip\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_welcome_title_onuser_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:text=\"@string/upomp_bypay_welcome\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_welcome_content_onuser_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_welcome_title_onuser_tel\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:id=\"@+id/iv_info_right_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"50dip\" android:layout_height=\"80dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_right\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\t\t\t\t<Button android:id=\"@+id/btn_user_manage_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\t\t\tandroid:layout_marginTop=\"10dip\" android:background=\"@drawable/upomp_bypay_info_btn2\"\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_hint_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_tips_bg\"\n\t\t\t\t\tandroid:layout_below=\"@id/btn_user_manage_onuser_tel\">\n\t\t\t\t\t<TextView android:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:text=\"@string/upomp_bypay_onuser_tel_in\"\n\t\t\t\t\t\tandroid:textSize=\"12sp\" android:textColor=\"#637681\" android:layout_centerHorizontal=\"true\" android:layout_marginTop=\"9dip\"/>\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<ImageView android:id=\"@+id/iv_bot_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot3\"\n\t\t\t\tandroid:layout_below=\"@id/rl_info_onuser_tel\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\t\t\t<ImageView android:id=\"@+id/iv_pay_info_top_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_below=\"@id/iv_bot_onuser_tel\" />\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/iv_pay_info_top_onuser_tel\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/iv_card_info_left_onuser_tle\">\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_card_content_onuser_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" \n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_toLeftOf=\"@+id/btn_change_card_onuser_tel\" />\n\n\t\t\t\t\t<Button android:id=\"@+id/btn_change_card_onuser_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:layout_alignParentRight=\"true\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_card\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_left_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\" />\n\t\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_icon3\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_tel_info_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_onuser_tel\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_tel_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/iv_tel_info_right_onuser_tle\">\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_tel_content_onuser_tel\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_centerVertical=\"true\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\"  />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_right_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\" />\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t\t<Button android:id=\"@+id/btn_user_manage_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_pay_info_bot_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_tel_info_onuser_tel\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_mobilevalidcode_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_below=\"@id/iv_pay_info_bot_onuser_tel\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_mobilevalidcode_title_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_firstshortmessagesecuritycode\" />\n\n\t\t\t\t<EditText android:id=\"@+id/et_mobilevalidcode_content_onuser_tel\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:maxLength=\"6\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondshortmessagesecuritycode\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_mobilevalidcode_title_onuser_tel\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_toLeftOf=\"@+id/btn_mobilevalidcode_content_onuser_tel\" />\n\t\t\t\t<Button android:id=\"@+id/btn_mobilevalidcode_content_onuser_tel\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_btn4\" android:text=\"@string/upomp_bypay_get\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:textColor=\"#6a7482\" />\n\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<Button android:id=\"@+id/btn_next_onuser_tel\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_next\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:textSize=\"20dip\" android:layout_below=\"@id/rl_mobilevalidcode_onuser_tel\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" />\n\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_onuser_tel\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_onuser_tel\" android:layout_above=\"@+id/rl_bottom_onuser_tel\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_onuser_tel\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\" />\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_usermanage.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\"\n\tandroid:layout_marginLeft=\"15dip\" android:layout_marginRight=\"15dip\"\n\tandroid:layout_marginTop=\"35dip\" android:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n<RelativeLayout android:id=\"@+id/rl_header_onuser_usermanage\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_onuser_usermanage\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\n\t<ScrollView android:id=\"@+id/sv_onuser_usermanage\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_onuser_usermanage\"  android:layout_above=\"@+id/rl_bottom_onuser_usermanage\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_top_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_info_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"80dip\"\n\t\t\t\tandroid:layout_below=\"@id/iv_top_onuser_usermanage\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_name_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/iv_info_right_onuser_tle\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_name_title_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:text=\"@string/upomp_bypay_username\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_name_content_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_name_title_onuser_usermanage\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_welcome_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_name_onuser_usermanage\" android:layout_toRightOf=\"@+id/iv_info_right_onuser_tle\">\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"1dip\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_welcome_title_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:text=\"@string/upomp_bypay_welcome\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_welcome_content_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_welcome_title_onuser_usermanage\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:id=\"@+id/iv_info_right_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"80dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\"\n\t\t\t\t\tandroid:layout_alignParentLeft=\"true\" />\n\t\t\t\t<ImageView \n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon4\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<ImageView android:id=\"@+id/iv_bot_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_info_onuser_usermanage\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\t\t\t<ImageView android:id=\"@+id/iv_pay_info_top_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_below=\"@id/iv_bot_onuser_usermanage\" />\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/iv_pay_info_top_onuser_usermanage\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/iv_card_info_left_onuser_tle\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_card_title_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" android:text=\"@string/upomp_bypay_bindcard\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\"  />\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_card_content_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" \n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_toRightOf=\"@+id/tv_card_title_onuser_usermanage\" />\n\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_left_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\" />\n\t\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:layout_centerVertical=\"true\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_icon3\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_tel_info_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_onuser_usermanage\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_tel_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/iv_tel_info_right_onuser_tle\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_tel_title_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_centerVertical=\"true\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\" android:text=\"@string/upomp_bypay_mobilenum\"/>\n\t\t\t\t\t<TextView android:id=\"@+id/tv_tel_content_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" android:layout_toRightOf=\"@+id/tv_tel_title_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_centerVertical=\"true\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_right_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"80dip\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\" />\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t\t<Button android:id=\"@+id/btn_user_manage_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_pay_info_bot_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_tel_info_onuser_usermanage\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\t\t\t\n\t\t\t<!--  \n\n\t\t\t<ImageView android:id=\"@+id/iv_top_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top1\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_name_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/iv_top_onuser_usermanage\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\n\t\t\t\t<TextView android:id=\"@+id/tv_name_title_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:text=\"@string/upomp_bypay_username\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\t\t\t\t<TextView android:id=\"@+id/tv_name_content_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_name_title_onuser_usermanage\" />\n\t\t\t\t\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_tel_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/rl_name_onuser_usermanage\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\n\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t<ImageView android:id=\"@+id/iv_tel_right_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"52dip\" android:layout_height=\"40dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_right\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginLeft=\"1dip\" />\n\n\t\t\t\t<TextView android:id=\"@+id/tv_tel_title_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_mobilenum\" />\n\t\t\t\t<TextView android:id=\"@+id/tv_tel_content_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_tel_title_onuser_usermanage\" android:layout_toLeftOf=\"@+id/btn_tel_onuser_usermanage\"/>\n\t\t\t\t<Button android:id=\"@+id/btn_tel_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_info_btn4\"\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_alignParentBottom=\"true\" android:layout_marginLeft=\"1dip\"\n\t\t\t\t\t />\n\t\t\t</RelativeLayout>\n\n\t\t\t\n\t\t\t<RelativeLayout android:id=\"@+id/rl_psw_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/rl_tel_onuser_usermanage\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\n\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t<ImageView android:id=\"@+id/iv_psw_right_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"52dip\" android:layout_height=\"40dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_right\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\n\t\t\t\t<TextView android:id=\"@+id/tv_psw_title_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_user_password\" />\n\t\t\t\t<TextView android:id=\"@+id/tv_psw_content_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" android:password=\"true\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_psw_title_onuser_usermanage\" \n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_psw_onuser_usermanage\"/>\n\t\t\t\t<Button android:id=\"@+id/btn_psw_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_info_btn3\"\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_alignParentBottom=\"true\" android:layout_marginLeft=\"1dip\"\n\t\t\t\t\t />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_defaultcard_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_below=\"@id/rl_psw_onuser_usermanage\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\n\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t<ImageView android:id=\"@+id/iv_defaultcard_right_onuser_tle\"\n\t\t\t\t\tandroid:layout_width=\"52dip\" android:layout_height=\"40dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_right\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\n\t\t\t\t<TextView android:id=\"@+id/tv_defaultcard_title_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_bindcard\" />\n\t\t\t\t<TextView android:id=\"@+id/tv_defaultcard_content_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_defaultcard_title_onuser_usermanage\" \n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_defaultcard_onuser_usermanage\"/>\n\t\t\t\t<Button android:id=\"@+id/btn_defaultcard_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" \n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_info_btn1\"\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t\n\t\t\t<ImageView android:id=\"@+id/iv_bot_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot3\"\n\t\t\t\tandroid:layout_below=\"@id/rl_defaultcard_onuser_usermanage\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\t\t\t-->\n\t\t\t\n\t\t\t<RelativeLayout android:id=\"@+id/rl_change_info_onuser_usermanage\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/iv_pay_info_bot_onuser_usermanage\" android:layout_marginTop=\"20dip\" \n\t\t\t\t\tandroid:gravity=\"center_horizontal\">\n\t\t\t\t\t<Button android:id=\"@+id/btn_change_tel_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#7498ab\" android:textSize=\"18sp\"\n\t\t\t\t\t\t\n\t\t\t\t\t\tandroid:gravity=\"center\" android:text=\"@string/upomp_bypay_head_changetel\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_member1\"/>\n\t\t\t\t\t<Button android:id=\"@+id/btn_change_psw_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#7498ab\" android:textSize=\"18sp\" android:layout_toRightOf=\"@+id/btn_change_tel_onuser_usermanage\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" \n\t\t\t\t\t\tandroid:gravity=\"center\" android:text=\"@string/upomp_bypay_head_changepsw\" android:background=\"@drawable/upomp_bypay_btn_member1\"/>\n\t\t\t\t</RelativeLayout>\n\t\t\t\n\t\t\n\t\t\t<Button android:id=\"@+id/btn_cardmanage_onuser_usermanage\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_head_cardmanage\" android:textColor=\"#7498ab\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:textSize=\"18sp\"\n\t\t\t\tandroid:layout_below=\"@id/rl_change_info_onuser_usermanage\" android:layout_marginTop=\"8dip\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_member2\"\n\t\t\t\t />\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n<RelativeLayout android:id=\"@+id/rl_bottom_onuser_usermanage\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_pay_main.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\r\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\r\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\r\n\t<LinearLayout android:focusable=\"true\"\r\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\r\n\t\tandroid:layout_height=\"0dip\" />\r\n\r\n\r\n\t<RelativeLayout android:id=\"@+id/rl_header_pay_main\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\r\n\t\t<Button android:id=\"@+id/btn_esc_pay_main\"\r\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\r\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\r\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\r\n\t\t\tandroid:text=\"@string/upomp_bypay_esc_pay\" />\r\n\t</RelativeLayout>\r\n\r\n\r\n\t<ScrollView android:id=\"@+id/sv_pay_info\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:layout_below=\"@id/rl_header_pay_main\" android:layout_above=\"@+id/rl_bottom_pay_main\">\r\n\t\t<RelativeLayout android:id=\"@+id/rl_pay_main\"\r\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\t\tandroid:paddingBottom=\"20dip\">\r\n\t\t\t<!-- 商品信息 -->\r\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_pay_main\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top3\"\r\n\t\t\t\tandroid:layout_marginTop=\"15dip\" android:layout_marginLeft=\"10dip\"\r\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_pay_main\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\r\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_pay_main\"\r\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\r\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_order_pay_main\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\r\n\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_ordername_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\r\n\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_toLeftOf=\"@+id/rl_orderinfo_btn_pay_main\">\r\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordername_title_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_merchantname\"\r\n\t\t\t\t\t\t\tandroid:gravity=\"right\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"14sp\" />\r\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordername_content_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_ordername_title_pay_main\"\r\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" \r\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"14sp\" />\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\r\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\r\n\t\t\t\t\t\tandroid:layout_marginLeft=\"1dip\" android:layout_below=\"@id/rl_orderinfo_ordername_pay_main\" />\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_ordermoney_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\r\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_orderinfo_ordername_pay_main\" android:layout_toLeftOf=\"@+id/rl_orderinfo_btn_pay_main\">\r\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordermoney_title_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_secondpayamount\"\r\n\t\t\t\t\t\t\tandroid:gravity=\"right\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_marginLeft=\"10dip\"\r\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\r\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordermoney_content_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t android:textColor=\"#ff0000\"\r\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_ordermoney_title_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textSize=\"14sp\" />\r\n\t\t\t\t\t\t<TextView android:layout_width=\"100dip\"\r\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:text=\"@string/upomp_bypay_yuan\"\r\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_ordermoney_content_pay_main\"\r\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_centerVertical=\"true\"\r\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<ImageView android:id=\"@+id/rl_orderinfo_btn_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_width=\"50dip\" android:layout_height=\"60dip\"\r\n\r\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_right\"\r\n\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\r\n\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_other_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_orderinfo_ordermoney_pay_main\"\r\n\t\t\t\t\t\tandroid:visibility=\"visible\">\r\n\t\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\r\n\t\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\r\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"1dip\" />\r\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_ordernum_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\" android:layout_toLeftOf=\"@+id/rl_orderinfo_btn_pay_main\">\r\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordernum_title_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_ordernum\"\r\n\t\t\t\t\t\t\t\tandroid:gravity=\"right\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_marginLeft=\"10dip\"\r\n\t\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\r\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordernum_content_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_ordernum_title_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_centerVertical=\"true\"\r\n\t\t\t\t\t\t\t\tandroid:textSize=\"13sp\" />\r\n\t\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\r\n\t\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\r\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"1dip\" android:layout_below=\"@id/rl_orderinfo_ordernum_pay_main\" />\r\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_date_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\r\n\t\t\t\t\t\t\tandroid:layout_below=\"@id/rl_orderinfo_ordernum_pay_main\" android:layout_toLeftOf=\"@+id/rl_orderinfo_btn_pay_main\">\r\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_date_title_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_orderdata\"\r\n\t\t\t\t\t\t\t\tandroid:gravity=\"right\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_marginLeft=\"10dip\"\r\n\t\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\r\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_date_content_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_date_title_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_centerVertical=\"true\"\r\n\t\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\r\n\t\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\r\n\t\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\r\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"1dip\" android:layout_below=\"@id/rl_orderinfo_date_pay_main\" />\r\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_info_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\r\n\t\t\t\t\t\t\tandroid:layout_below=\"@id/rl_orderinfo_date_pay_main\" android:layout_toLeftOf=\"@+id/rl_orderinfo_btn_pay_main\">\r\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_info_title_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_orderinfo\"\r\n\t\t\t\t\t\t\t\tandroid:gravity=\"right\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:layout_marginLeft=\"10dip\"\r\n\t\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\r\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_info_content_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_info_title_pay_main\"\r\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_centerVertical=\"true\"\r\n\t\t\t\t\t\t\t\tandroid:textSize=\"14sp\" />\r\n\t\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t\t<ImageView android:id=\"@+id/rl_orderinfo_btn_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"50dip\" android:layout_height=\"120dip\"\r\n\r\n\t\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_right\"\r\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\r\n\t\t\t\t\t</RelativeLayout>\r\n\r\n\r\n\t\t\t\t</RelativeLayout>\r\n\r\n\t\t\t\t<Button android:id=\"@+id/btn_orderinfo1_pay_main\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:layout_alignParentRight=\"true\"\r\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn5\" />\r\n\t\t\t\t<Button android:id=\"@+id/btn_orderinfo2_pay_main\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:layout_alignParentRight=\"true\"\r\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn6\"\r\n\t\t\t\t\t/>\r\n\t\t\t</RelativeLayout>\r\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_pay_main\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot3\"\r\n\t\t\t\tandroid:layout_below=\"@id/rl_orderinfo_pay_main\"\r\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\r\n\t\t\t<!-- 普通用户 -->\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_user_pay_main\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:layout_marginTop=\"15dip\" android:layout_below=\"@id/iv_info_bot_pay_main\"\r\n\t\t\t\tandroid:visibility=\"gone\">\r\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_user_content_pay_man\"\r\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\r\n\t\t\t\t\tandroid:visibility=\"visible\">\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_user_input_content_pay_main\"\r\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\">\r\n\r\n\t\t\t\t\t\t<EditText android:id=\"@+id/et_user_input_content_content_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:numeric=\"integer\"\r\n\t\t\t\t\t\t\tandroid:singleLine=\"true\" android:maxLength=\"23\"\r\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:background=\"#00000000\"\r\n\t\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_pan\" android:textSize=\"15sp\" />\r\n\t\t\t\t\t\t<ImageButton android:id=\"@+id/ib_info_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\r\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_user_tel_pay_main\"\r\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\r\n\t\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_below=\"@id/rl_user_input_content_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\">\r\n\r\n\t\t\t\t\t\t<EditText android:id=\"@+id/et_user_tel_content_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:numeric=\"integer\"\r\n\t\t\t\t\t\t\tandroid:singleLine=\"true\" android:maxLength=\"11\"\r\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:background=\"#00000000\"\r\n\t\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_tel\" android:textSize=\"15sp\" />\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_user_webvalidcode_pay_normal\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_user_tel_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\">\r\n\r\n\t\t\t\t\t\t<EditText android:id=\"@+id/et_user_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\t\t\tandroid:numeric=\"integer\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\t\t\tandroid:maxLength=\"4\" android:singleLine=\"true\"\r\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:background=\"#00000000\"\r\n\t\t\t\t\t\t\tandroid:textSize=\"15sp\" android:layout_toLeftOf=\"@+id/iv_user_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_image_validate\" />\r\n\t\t\t\t\t\t<ImageView android:id=\"@+id/iv_user_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"70dip\" android:layout_height=\"38dip\"\r\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\r\n\t\t\t\t\t\t<ProgressBar android:id=\"@+id/p_user_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"30dip\" android:layout_height=\"30dip\"\r\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\r\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"15dip\" android:indeterminateDrawable=\"@drawable/upomp_bypay_progress\"\r\n\t\t\t\t\t\t\tandroid:visibility=\"gone\" android:layout_marginLeft=\"30dip\"\r\n\t\t\t\t\t\t\tandroid:layout_marginTop=\"5dip\" />\r\n\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<Button android:id=\"@+id/btn_user_input_content_next_pay_man\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_next\" android:textColor=\"#ffffff\"\r\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_user_webvalidcode_pay_normal\"\r\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:layout_marginTop=\"8dip\"\r\n\t\t\t\t\t\tandroid:textSize=\"18sp\" android:background=\"@drawable/upomp_bypay_btn_enter2\" />\r\n\t\t\t\t</RelativeLayout>\r\n\r\n\t\t\t</RelativeLayout>\r\n\r\n\t\t\t<!-- 注册用户 -->\r\n\t\t\t<RelativeLayout android:id=\"@+id/rl_login_pay_main\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\t\t\tandroid:layout_below=\"@id/rl_user_pay_main\"\r\n\t\t\t\tandroid:layout_marginTop=\"15dip\" android:visibility=\"visible\">\r\n\r\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_login_content_pay_main\"\r\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\tandroid:visibility=\"visible\" android:layout_marginLeft=\"10dip\"\r\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\">\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_login_name_content_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\">\r\n\r\n\t\t\t\t\t\t<EditText android:id=\"@+id/et_login_name_content_content_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\r\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\t\t\tandroid:background=\"#00000000\" android:singleLine=\"true\"\r\n\t\t\t\t\t\t\tandroid:maxLength=\"20\" android:hint=\"@string/upomp_bypay_user_name\"\r\n\t\t\t\t\t\t\tandroid:textSize=\"15sp\" />\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_login_psw_content_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_login_name_content_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\">\r\n\r\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_login_psw_content_content_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_user_psw\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:textSize=\"15sp\"\r\n\t\t\t\t\t\t\tandroid:gravity=\"left|center\" android:background=\"#00000000\"\r\n\t\t\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_getpass_pay_main\" />\r\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_getpass_pay_main\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\r\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\r\n\t\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_btn4\"\r\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_getpass\" android:textSize=\"14sp\"\r\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" />\r\n\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_login_webvalidcode_pay_normal\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_login_psw_content_pay_main\"\r\n\t\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\">\r\n\r\n\t\t\t\t\t\t<EditText android:id=\"@+id/et_login_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\r\n\t\t\t\t\t\t\tandroid:maxLength=\"4\" android:textColor=\"#6a7482\"\r\n\t\t\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/iv_login_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:textSize=\"15sp\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\t\t\tandroid:background=\"#00000000\" android:numeric=\"integer\"\r\n\t\t\t\t\t\t\tandroid:singleLine=\"true\" android:hint=\"@string/upomp_bypay_image_validate\" />\r\n\t\t\t\t\t\t<ImageView android:id=\"@+id/iv_login_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"70dip\" android:layout_height=\"38dip\"\r\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\r\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\r\n\t\t\t\t\t\t<ProgressBar android:id=\"@+id/p_login_webvalidcode_content_pay_normal\"\r\n\t\t\t\t\t\t\tandroid:layout_width=\"30dip\" android:layout_height=\"30dip\"\r\n\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\"\r\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"15dip\" android:indeterminateDrawable=\"@drawable/upomp_bypay_progress\"\r\n\t\t\t\t\t\t\tandroid:visibility=\"gone\" android:layout_marginLeft=\"30dip\"\r\n\t\t\t\t\t\t\tandroid:layout_marginTop=\"5dip\" />\r\n\r\n\t\t\t\t\t</RelativeLayout>\r\n\t\t\t\t\t<Button android:id=\"@+id/btn_user_login_content_next_pay_man\"\r\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_loading\" android:textColor=\"#ffffff\"\r\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_login_webvalidcode_pay_normal\"\r\n\t\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_centerHorizontal=\"true\"\r\n\r\n\t\t\t\t\t\tandroid:textSize=\"18sp\" android:background=\"@drawable/upomp_bypay_btn_enter2\" />\r\n\t\t\t\t</RelativeLayout>\r\n\t\t\t</RelativeLayout>\r\n\t\t\t<Button android:id=\"@+id/btn_change_pay_man\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:text=\"@string/upomp_bypay_next\" android:textColor=\"#ffffff\"\r\n\t\t\t\tandroid:layout_below=\"@id/rl_login_pay_main\"\r\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\r\n\t\t\t\tandroid:layout_marginTop=\"15dip\" android:layout_centerHorizontal=\"true\"\r\n\t\t\t\tandroid:textSize=\"18sp\" android:background=\"@drawable/upomp_bypay_btn_set\" />\r\n\r\n\r\n\t\t</RelativeLayout>\r\n\r\n\t</ScrollView>\r\n\t<com.unionpay.upomp.bypay.view.About\r\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:layout_alignParentBottom=\"true\"\r\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\r\n\r\n\t<RelativeLayout android:id=\"@+id/main_dialog_pay_main\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:layout_below=\"@id/rl_header_pay_main\" android:layout_above=\"@+id/rl_bottom_pay_main\" />\r\n\t<RelativeLayout android:id=\"@+id/rl_bottom_pay_main\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\r\n\t\tandroid:layout_alignParentBottom=\"true\">\r\n\r\n\t</RelativeLayout>\r\n\r\n\t<!--\r\n\t\t<RelativeLayout android:id=\"@+id/rl_bottom_pay_main\"\r\n\t\tandroid:layout_width=\"fill_parent\"\r\n\t\tandroid:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_index_bot_bg\"\r\n\t\tandroid:layout_alignParentBottom=\"true\"> <TextView\r\n\t\tandroid:layout_width=\"wrap_content\"\r\n\t\tandroid:layout_height=\"wrap_content\"\r\n\t\tandroid:text=\"@string/upomp_bypay_fae\" android:textColor=\"#ffffff\"\r\n\t\tandroid:textSize=\"12sp\" android:layout_centerVertical=\"true\"\r\n\t\tandroid:layout_marginLeft=\"10dip\" /> <Button\r\n\t\tandroid:id=\"@+id/btn_esc_pay_main\" android:layout_width=\"wrap_content\"\r\n\t\tandroid:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_btn_esc\"\r\n\t\tandroid:layout_alignParentRight=\"true\"\r\n\t\tandroid:layout_marginRight=\"10dip\" /> </RelativeLayout>\r\n\t-->\r\r\r\r</RelativeLayout>\r\n\r\n\r\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_pay_result.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\"\n\tandroid:layout_marginLeft=\"15dip\" android:layout_marginRight=\"15dip\"\n\tandroid:layout_marginTop=\"35dip\" android:background=\"@drawable/upomp_bypay_bg\">\n\n\t<RelativeLayout android:id=\"@+id/rl_header_pay_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_pay_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_pay_result\" android:layout_above=\"@+id/rl_bottom_pay_result\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_pay_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_pay_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_pay_result\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_pay_result\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon1\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_result_pay_result\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_pay_result\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:gravity=\"center_vertical\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_result_title_pay_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_result\" android:gravity=\"right\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_result_content_pay_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_result_paysucceed\" android:layout_toRightOf=\"@+id/tv_result_title_pay_result\"\n\t\t\t\t\t\tandroid:textColor=\"#ff0000\" android:textSize=\"14sp\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_info_pay_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_pay_result\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_info_pay_result\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"170dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon2\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_info_pay_result\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_info_pay_result\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_merchantname_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_merchantname_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_merchantname\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_merchantname_content_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_merchantname_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_merchantname_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_money_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_merchantname_info_pay_result\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_money_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_secondpayamount\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_money_content_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_money_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#ff0000\" android:textSize=\"14sp\" />\n\t\t\t\t\t\t<TextView android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:text=\"@string/upomp_bypay_yuan\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_money_content_info_pay_result\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_money_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_ordernum_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_money_info_pay_result\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordernum_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_ordernum\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_ordernum_content_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_ordernum_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_ordernum_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_date_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_ordernum_info_pay_result\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_date_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_orderdata\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_date_content_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_date_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_date_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_info_pay_result\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"50dip\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_date_info_pay_result\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_orderinfo_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_main_orderinfo\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_orderinfo_content_info_pay_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_orderinfo_title_info_pay_result\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\"/>\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_pay_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_info_pay_result\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\t\t\t\n\n\t\t\t<Button android:id=\"@+id/btn_exit_pay_result\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:textSize=\"20sp\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_result_returnmerchant\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_pay_result\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:background=\"@drawable/upomp_bypay_btn_esc2\" />\n\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t\t<RelativeLayout android:id=\"@+id/main_dialog_pay_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\" \n\t\tandroid:layout_below=\"@id/rl_header_pay_result\" android:layout_above=\"@+id/rl_bottom_pay_result\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_pay_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_pay_result_lose.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\n\t<RelativeLayout android:id=\"@+id/rl_header_pay_result_lose\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_esc_result_lose\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_pay_result_returnmerchant\" />\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_pay_result_lose\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_pay_result_lose\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_pay_result_lose\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_pay_result_lose\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_pay_result_lose\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_pay_result_lose\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_pay_result_lose\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon6\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_result_pay_result_lose\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_pay_result_lose\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:gravity=\"center_vertical\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_result_title_pay_result_lose\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_pay_result\" android:gravity=\"right\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_result_content_pay_result_lose\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_payfail\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_result_title_pay_result_lose\"\n\t\t\t\t\t\tandroid:textColor=\"#ff0000\" android:textSize=\"14sp\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_info_pay_result_lose\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_pay_result_lose\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_info_pay_result_lose\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"90dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_info_pay_result_lose\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_info_pay_result_lose\">\n\n\n\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_info_pay_result_lose\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"90dip\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_orderinfo_title_info_pay_result_lose\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_failcause\" android:textSize=\"14sp\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_orderinfo_content_info_pay_result_lose\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_orderinfo_title_info_pay_result_lose\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_pay_result_lose\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_info_pay_result_lose\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\n\n\t\t\t<Button android:id=\"@+id/btn_new_pay_result_lose\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:textSize=\"20sp\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:text=\"@string/upomp_bypay_pay_result_newpay\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_pay_result_lose\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:background=\"@drawable/upomp_bypay_btn_enter2\" />\n\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_pay_result_lose\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_register.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/rl_register\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_bg\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_register\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t\n\t\t<Button android:id=\"@+id/btn_return_register\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t\t\t \n\t</RelativeLayout>\n\t<ScrollView android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\" android:layout_below=\"@id/rl_header_register\" android:layout_above=\"@+id/rl_bottom_register\" >\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\n\n\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_body_register\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginTop=\"10dip\"  >\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_top_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\t\tandroid:layout_marginTop=\"15dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_hint_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/iv_top_register\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_marginLeft=\"10dip\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_hint_title_register\"\n\t\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t\t<ImageView android:id=\"@+id/iv_hint_title_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon4\" />\n\t\t\t\t\t</RelativeLayout>\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_hint_register\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register_title_hint\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_hint_title_register\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:gravity=\"center_vertical\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:id=\"@+id/iv_bot_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_hint_register\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_username_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_2\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_below=\"@id/iv_bot_register\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_username_register_title\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\">\n\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_username_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:text=\"@string/upomp_bypay_username\"\n\t\t\t\t\t\t\tandroid:gravity=\"center_vertical\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:textSize=\"15sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_username_register_content\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/rl_username_register_title\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:layout_centerVertical=\"true\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_username_content_register\"\n\t\t\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:textSize=\"15sp\" android:background=\"#00000000\" \n\t\t\t\t\t\t\tandroid:maxLength=\"20\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_username_register\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_register_title\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_userpass_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:text=\"@string/upomp_bypay_register_password\"\n\t\t\t\t\t\t\tandroid:gravity=\"center_vertical\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:textSize=\"15sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_register_content\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/rl_userpass_register_title\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\">\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_userpass_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\tandroid:background=\"#00000000\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_re_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_userpass_register\"\n\t\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_re_register_title\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_userpass_re_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register_makesurepassword\"\n\t\t\t\t\t\t\tandroid:gravity=\"center_vertical\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:textSize=\"15sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_userpass_re_register_content\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/rl_userpass_re_register_title\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\">\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_userpass_re_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\tandroid:background=\"#00000000\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_user_register_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_userpass_re_register\"\n\t\t\t\t\tandroid:layout_marginTop=\"20dip\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_register_top_register\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top1\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_register1_register\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/iv_register_top_register\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_marginLeft=\"10dip\">\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_agree_agreement_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"15dip\">\n\t\t\t\t\t\t\t<CheckBox android:id=\"@+id/cb_agreement_register\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register_iagreewithuserdeal\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"#000000\" android:textSize=\"15sp\"\n\t\t\t\t\t\t\t\tandroid:checked=\"true\" android:button=\"@drawable/upomp_bypay_checkbox\" />\n\t\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_see_agreement_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_marginLeft=\"15dip\"\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"15dip\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t\t\t<ImageButton android:id=\"@+id/btn_see_agreement_register\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_view_xy\"\n\t\t\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\t\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_register2_register\"\n\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_below=\"@id/rl_register1_register\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot4\"\n\t\t\t\t\t\tandroid:layout_marginRight=\"10dip\" android:layout_marginLeft=\"10dip\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_register_hint_register\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register_hint\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"5dip\" android:textSize=\"14sp\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_button_register\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_user_register_register\"\n\t\t\t\t\tandroid:layout_marginTop=\"30dip\">\n\t\t\t\t\t<Button android:gravity=\"center\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:id=\"@+id/btn_button_register\"\n\t\t\t\t\t\tandroid:textSize=\"20sp\" android:textColor=\"#FFFFFF\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register\"\n\t\t\t\t\t\tandroid:layout_alignParentTop=\"true\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"></Button>\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t</RelativeLayout>\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/register_dialog_register\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\" \n\t\tandroid:layout_below=\"@id/rl_header_register\" android:layout_above=\"@+id/rl_bottom_register\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_register\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\" \n\t\tandroid:layout_below=\"@id/rl_header_register\" android:layout_above=\"@+id/rl_bottom_register\" />\n\t\n\t<RelativeLayout android:id=\"@+id/rl_bottom_register\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\"/>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_register2.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/rl_register\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" >\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_bg_register2\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:background=\"#77000000\">\n\t</RelativeLayout>\n\t<RelativeLayout android:id=\"@+id/rl_register_dialog\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_login_open_bg\" android:layout_alignParentBottom=\"true\">\n\t\t<RelativeLayout android:id=\"@+id/rl_welcome_register\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_marginTop=\"15dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t<RelativeLayout android:id=\"@+id/rl_welcome_register_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerVertical=\"true\">\n\t\t\t\t<TextView android:id=\"@+id/tv_welcome_register\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_welcome\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:textSize=\"15sp\" />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_welcome_register_content\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/rl_welcome_register_title\"\n\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginRight=\"5dip\">\n\t\t\t\t<EditText android:id=\"@+id/et_welcome_register\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:background=\"#00000000\" />\n\t\t\t</RelativeLayout>\n\t\t</RelativeLayout>\n\n\t\t<RelativeLayout android:id=\"@+id/rl_question_register\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_below=\"@id/rl_welcome_register\"\n\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t<RelativeLayout android:id=\"@+id/rl_question_register_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\">\n\t\t\t\t<TextView android:id=\"@+id/tv_question_register\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\" android:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_securityissue\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:textSize=\"15sp\" />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_question_register_content\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/rl_question_register_title\"\n\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_question_regiser\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/spnr_question_register\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" />\n\t\t\t\t<Button android:id=\"@+id/spnr_question_register\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_spinner\" />\n\n\t\t\t</RelativeLayout>\n\n\t\t</RelativeLayout>\n\t\t<RelativeLayout android:id=\"@+id/rl_question_Custem_register\"\n\t\t\tandroid:visibility=\"gone\" android:layout_marginTop=\"8dip\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\tandroid:layout_below=\"@id/rl_question_register\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t<RelativeLayout android:id=\"@+id/rl_question_Custem_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerVertical=\"true\">\n\t\t\t\t<TextView android:id=\"@+id/tv_question_Custem_register\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register_customquestion\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"15sp\" />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_question_Custem_register_content\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/rl_question_Custem_title\"\n\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"40dip\"\n\t\t\t\tandroid:layout_marginRight=\"5dip\">\n\t\t\t\t<EditText android:id=\"@+id/etquestion_Custem_register\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:maxLength=\"16\"\n\t\t\t\t\tandroid:layout_marginTop=\"5dip\" android:textSize=\"15sp\"\n\t\t\t\t\t android:background=\"#00000000\" />\n\t\t\t</RelativeLayout>\n\t\t</RelativeLayout>\n\t\t<RelativeLayout android:id=\"@+id/rl_result_register\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_below=\"@id/rl_question_Custem_register\"\n\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t<RelativeLayout android:id=\"@+id/rl_result_register_title\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerVertical=\"true\">\n\t\t\t\t<TextView android:id=\"@+id/tv_result_register\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_width=\"wrap_content\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_securityquestionanswer\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"15sp\" />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_result_register_content\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/rl_result_register_title\"\n\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginRight=\"5dip\">\n\t\t\t\t<EditText android:id=\"@+id/et_result_register\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:textSize=\"15sp\" android:layout_height=\"40dip\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:maxLength=\"16\" />\n\t\t\t</RelativeLayout>\n\t\t</RelativeLayout>\n\n\t\t<Button android:id=\"@+id/btn_button_register\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\tandroid:layout_below=\"@id/rl_result_register\"\n\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_centerHorizontal=\"true\"\n\t\t\tandroid:gravity=\"center\" android:text=\"@string/upomp_bypay_register\"\n\t\t\tandroid:textColor=\"#FFFFFF\" android:textSize=\"20sp\" />\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_register_result.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:id=\"@+id/rl_register_result\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_bg\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_register_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t</RelativeLayout>\n\t<ScrollView android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\" android:layout_below=\"@id/rl_header_register_result\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_register_result\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_hint_register_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\">\n\t\t\t\t<ImageView android:id=\"@+id/iv_hint_top_register_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_register_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\tandroid:layout_below=\"@id/iv_hint_top_register_result\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_register_result\"\n\t\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon1\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_result_register_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"30dip\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_register_result\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:gravity=\"center_vertical\">\n\t\t\t\t\t\t<TextView android:id=\"@+id/tv_result_content_register_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register_win\"\n\t\t\t\t\t\t\tandroid:textColor=\"#ff0000\" android:textSize=\"14sp\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_info_register_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_register_result\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\n\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\" />\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_info_register_result\"\n\t\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"40dip\"\n\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_info_register_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_info_register_result\">\n\n\n\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_orderinfo_info_register_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"40dip\"\n\t\t\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_orderinfo_content_info_register_result\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_register_win_hint\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:id=\"@+id/iv_info_bot_register_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_info_register_result\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_userinfo_register_result\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_hint_register_result\"\n\t\t\t\tandroid:layout_marginTop=\"15dip\">\n\t\t\t\t<ImageView android:id=\"@+id/iv_info_top_register_result1\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_into_register_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\t\tandroid:layout_below=\"@id/iv_info_top_register_result1\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_register_result\"\n\t\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"60dip\"\n\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t\t<ImageView android:layout_width=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon4\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_result_register_result\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"60dip\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_register_result\"\n\t\t\t\t\t\t android:gravity=\"center_vertical\">\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_name_register_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\">\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_name_title_register_result\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_accountmain_username\" android:textSize=\"14sp\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_name_content_register_result\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_name_title_register_result\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t\t<ImageView android:layout_width=\"fill_parent\" android:layout_below=\"@id/rl_name_register_result\"\n\t\t\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\t\t\tandroid:layout_marginRight=\"1dip\"  android:layout_marginTop=\"10dip\" />\n\t\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_welcome_register_result\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\tandroid:layout_below=\"@id/rl_name_register_result\"\n\t\t\t\t\t\t android:layout_marginTop=\"20dip\">\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_welcome_title_register_result\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_welcome\" android:textSize=\"14sp\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t\t\t<TextView android:id=\"@+id/tv_welcome_content_register_result\"\n\t\t\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_welcome_title_register_result\"\n\t\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t\t</RelativeLayout>\n\n\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<ImageView android:id=\"@+id/iv_info_bot_register_result\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\t\tandroid:layout_below=\"@id/rl_into_register_result\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t\n\t\t\t<Button android:id=\"@+id/btn_exit_register_result\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:textSize=\"20sp\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_register_bind_card\"\n\t\t\t\tandroid:layout_below=\"@id/rl_userinfo_register_result\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:background=\"@drawable/upomp_bypay_btn_esc2\" />\n\t\t</RelativeLayout>\n\t</ScrollView>\n<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_register_result\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\" />\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_splash.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:orientation=\"vertical\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" android:background=\"#ff000000\"\n\tandroid:layout_marginBottom=\"35dip\"\n\tandroid:layout_marginLeft=\"15dip\" android:layout_marginRight=\"15dip\"\n\tandroid:layout_marginTop=\"35dip\" android:gravity=\"center\">\n\t<RelativeLayout \n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t\t<ImageView android:id=\"@+id/iv_logo\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_loading_logo\"\n\t\t\tandroid:layout_centerHorizontal=\"true\" android:layout_above=\"@+id/rl_hint\"\n\t\t\tandroid:layout_marginBottom=\"20dip\" />\n\t\t<RelativeLayout android:id=\"@+id/rl_hint\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_above=\"@+id/rl_loading\" android:gravity=\"center_horizontal\"\n\t\t\tandroid:layout_marginBottom=\"20dip\">\n\t\t\t<TextView android:id=\"@+id/tv_hint1\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_splash_hint1\" android:textColor=\"#123860\"\n\t\t\t\tandroid:textSize=\"18sp\" />\n\n\t\t\t<TextView android:id=\"@+id/tv_hint2\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_hint1\" android:text=\"@string/upomp_bypay_splash_hint2\"\n\t\t\t\tandroid:textColor=\"#123860\" android:textSize=\"18sp\"\n\t\t\t\tandroid:layout_marginLeft=\"40dip\" />\n\t\t</RelativeLayout>\n\n\t\t<RelativeLayout android:id=\"@+id/rl_loading\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_centerVertical=\"true\" android:layout_centerHorizontal=\"true\">\n\t\t\t<ImageView android:id=\"@+id/iv_loading_bg\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_loading_bg\" />\n\t\t\t<ImageView android:id=\"@+id/iv_loading_tag\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_loading_tag\" />\n\t\t</RelativeLayout>\n\t\t<RelativeLayout android:id=\"@+id/rl_bottom\"\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:layout_alignParentBottom=\"true\" android:layout_marginBottom=\"10dip\">\n\t\t\t<TextView android:id=\"@+id/tv_version\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:text=\"@string/upomp_bypay_splash_version\"\n\t\t\t\tandroid:textColor=\"#123860\" android:textSize=\"14sp\" />\n\t\t\t<TextView android:id=\"@+id/tv_inc\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:layout_below=\"@id/tv_version\"\n\t\t\t\tandroid:layout_marginTop=\"10dip\" android:text=\"@string/upomp_bypay_splash_info\"\n\t\t\t\tandroid:textColor=\"#123860\" android:singleLine=\"true\" />\n\t\t\t\t<TextView android:id=\"@+id/tv_support\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_centerHorizontal=\"true\" android:layout_below=\"@id/tv_inc\"\n\t\t\t\tandroid:layout_marginTop=\"10dip\" android:text=\"@string/upomp_bypay_splash_cn\"\n\t\t\t\tandroid:textColor=\"#123860\" />\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t</RelativeLayout>\n\t</RelativeLayout>\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_support_card.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\r\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\r\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\r\n\t<LinearLayout android:focusable=\"true\"\r\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\r\n\t\tandroid:layout_height=\"0dip\" />\r\n\r\n\r\n\t<RelativeLayout android:id=\"@+id/rl_header_support_card\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\r\n\t\t<Button android:id=\"@+id/btn_return_support_card\"\r\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\r\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\r\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\r\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\r\n\t</RelativeLayout>\r\n<RelativeLayout android:id=\"@+id/rl_card_support_card\"\r\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_bank_list_title2\" android:layout_below=\"@id/rl_header_support_card\">\r\n\t\t\t\t<TextView android:layout_width=\"wrap_content\"\r\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:layout_centerVertical=\"true\"\r\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:text=\"@string/upomp_bypay_supportcard\"\r\n\t\t\t\t\tandroid:textColor=\"#ffffff\" android:textSize=\"15sp\" />\r\n\t\t\t\t<TextView  android:layout_width=\"wrap_content\"\r\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:layout_centerVertical=\"true\"\r\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" android:text=\"@string/upomp_bypay_creditcard\"\r\n\t\t\t\t\tandroid:textColor=\"#ffffff\" android:textSize=\"15sp\" \r\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/tv_debit_support_card\"/>\r\n\t\t\t\t<TextView android:id=\"@+id/tv_debit_support_card\" android:layout_width=\"wrap_content\"\r\n\t\t\t\t\tandroid:layout_height=\"wrap_content\" android:layout_centerVertical=\"true\"\r\n\t\t\t\t\tandroid:layout_marginRight=\"10dip\" android:text=\"@string/upomp_bypay_debitcard\"\r\n\t\t\t\t\tandroid:textColor=\"#ffffff\" android:textSize=\"15sp\"  android:layout_alignParentRight=\"true\"\r\n\t\t\t\t\t/>\r\n\t\t\t</RelativeLayout>\r\n\r\n\t<ScrollView android:id=\"@+id/sv_pay_info\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:layout_below=\"@id/rl_card_support_card\"\r\n\t\tandroid:layout_above=\"@+id/rl_bottom_support_card\">\r\n\t\t<RelativeLayout android:id=\"@+id/rl_support_card\"\r\n\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\">\r\n\r\n\r\n\t\t\t\r\n\t\t\t<RelativeLayout android:id=\"@+id/ll_card_support_card\" android:layout_width=\"fill_parent\"\r\n\t\t\t\tandroid:layout_height=\"wrap_content\" >\r\n\t\t\t</RelativeLayout>\r\n\r\n\r\n\t\t</RelativeLayout>\r\n\r\n\t</ScrollView>\r\n\t<com.unionpay.upomp.bypay.view.About\r\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:layout_alignParentBottom=\"true\"\r\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\r\n\t<RelativeLayout android:id=\"@+id/main_dialog_support_card\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\r\n\t\tandroid:layout_below=\"@id/rl_header_support_card\"\r\n\t\tandroid:layout_above=\"@+id/rl_bottom_support_card\" />\r\n\t<RelativeLayout android:id=\"@+id/rl_bottom_support_card\"\r\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\r\n\t\tandroid:layout_alignParentBottom=\"true\">\r\n\t</RelativeLayout>\r\n\r\n\t\r</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_support_card_list.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\r\n\tandroid:background=\"#00000000\">\r\n\r\n\t<RelativeLayout android:id=\"@+id/rl_content_card_list\" android:layout_width=\"wrap_content\"\r\n\t\tandroid:layout_height=\"40dip\" android:gravity=\"center_vertical\" android:layout_centerHorizontal=\"true\">\r\n\t\t<TextView android:id=\"@+id/tv_card_item\"\r\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\t android:textColor=\"#6a7482\" android:textSize=\"13sp\" \r\n\t\t\tandroid:layout_marginLeft=\"5dip\"/>\r\n\t\t<ImageView android:id=\"@+id/iv_debit_item\"\r\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\tandroid:background=\"@drawable/upomp_bypay_bank_list_icon1\" android:layout_marginRight=\"10dip\"\r\n\t\t\tandroid:layout_alignParentRight=\"true\"/>\r\n\t\t<ImageView android:id=\"@+id/iv_credit_item\"\r\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\r\n\t\t\tandroid:background=\"@drawable/upomp_bypay_bank_list_icon1\" android:layout_marginRight=\"40dip\"\r\n\t\t\tandroid:layout_toLeftOf=\"@+id/iv_debit_item\"/>\r\r\t\t\r\t</RelativeLayout>\r\n\t<ImageView android:layout_width=\"fill_parent\" android:layout_height=\"1dip\"\r\n\tandroid:background=\"#dbdee0\" android:layout_below=\"@id/rl_content_card_list\"/>\r\r</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_user_credit.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_header_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_credit\"\n\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_credit\" android:layout_above=\"@+id/rl_bottom_credit\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_user_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_user_credit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_user_credit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon3\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_user_credit\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_card_info_content_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/tv_tel_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_credit\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_tel_user_credit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_tel_user_credit\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_safety_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/tv_tel_credit\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_safety_credit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_safety_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon7\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_safety_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_safety_credit\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_safety_title_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_safety_info\" android:gravity=\"right\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_safety_content_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t android:layout_toRightOf=\"@+id/tv_safety_title_credit\"\n\t\t\t\t\t\tandroid:textColor=\"#ff0000\" android:textSize=\"14sp\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_user_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_safety_credit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_mobilevalidcode_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_user_credit\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<EditText android:id=\"@+id/et_mobilevalidcode_content_credit\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:maxLength=\"6\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondshortmessagesecuritycode\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_mobilevalidcode_content_credit\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t<Button android:id=\"@+id/btn_mobilevalidcode_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_input_btn2\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_retry\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" />\n\n\t\t\t</RelativeLayout>\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_validity_credit\"\n\t\t\t\tandroid:layout_below=\"@id/rl_mobilevalidcode_credit\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_width=\"fill_parent\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<TextView android:id=\"@+id/tv_validity_title_credit\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_date\" android:gravity=\"center_vertical\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:layout_centerVertical=\"true\" />\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_validity_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_toRightOf=\"@+id/tv_validity_title_credit\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_height=\"wrap_content\">\n\n\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_btn_mm_credit\"\n\t\t\t\t\t\tandroid:layout_width=\"68dip\" android:layout_height=\"45dip\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_month\">\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_mm_credit\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:background=\"#00000000\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<RelativeLayout android:id=\"@+id/rl_btn_yy_credit\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_btn_mm_credit\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_width=\"68dip\"\n\t\t\t\t\t\tandroid:layout_height=\"45dip\" android:background=\"@drawable/upomp_bypay_btn_year\"\n\t\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/ib_image_cvn2\">\n\t\t\t\t\t\t<Button android:id=\"@+id/btn_yy_credit\"\n\t\t\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\t\t\tandroid:background=\"#00000000\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\t\tandroid:textSize=\"14sp\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" />\n\t\t\t\t\t</RelativeLayout>\n\t\t\t\t\t<ImageButton android:id=\"@+id/ib_image_cvn2\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\n\t\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_cvn2_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_validity_credit\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\n\n\t\t\t\t<Button android:id=\"@+id/btn_cvn2_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypa_cvn2\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:password=\"true\" android:textSize=\"14sp\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/ib_image_cvn21\" />\n\t\t\t\t<ImageButton android:id=\"@+id/ib_image_cvn21\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_icon\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_user_webvalidcode_credit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_below=\"@id/rl_cvn2_credit\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\" android:gravity=\"clip_vertical\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\n\t\t\t\t<EditText android:id=\"@+id/et_user_webvalidcode_content_credit\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:maxLength=\"4\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:hint=\"@string/upomp_bypay_image_validate\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/iv_user_webvalidcode_content_credit\" />\n\t\t\t\t<ImageView android:id=\"@+id/iv_user_webvalidcode_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"70dip\" android:layout_height=\"38dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\n\t\t\t\t<ProgressBar android:id=\"@+id/p_user_webvalidcode_content_credit\"\n\t\t\t\t\tandroid:layout_width=\"30dip\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"15dip\"\n\t\t\t\t\tandroid:indeterminateDrawable=\"@drawable/upomp_bypay_progress\"\n\t\t\t\t\tandroid:visibility=\"gone\" android:layout_marginLeft=\"30dip\"\n\t\t\t\t\tandroid:layout_marginTop=\"5dip\" />\n\n\t\t\t</RelativeLayout>\n\n\n\n\n\n\n\t\t\t<Button android:id=\"@+id/btn_next_credit\"\n\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:text=\"@string/upomp_bypay_pay\" android:textColor=\"#ffffff\"\n\t\t\t\tandroid:layout_below=\"@id/rl_user_webvalidcode_credit\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:textSize=\"20sp\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" />\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_credit\" android:layout_above=\"@+id/rl_bottom_credit\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_credit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_user_debit.xml",
    "content": "﻿<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\tandroid:layout_marginBottom=\"35dip\" android:layout_marginLeft=\"15dip\"\n\tandroid:layout_marginRight=\"15dip\" android:layout_marginTop=\"35dip\"\n\tandroid:background=\"@drawable/upomp_bypay_bg\">\n\t<LinearLayout android:focusable=\"true\"\n\t\tandroid:focusableInTouchMode=\"true\" android:layout_width=\"0dip\"\n\t\tandroid:layout_height=\"0dip\" />\n\n\t<RelativeLayout android:id=\"@+id/rl_header_debit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n\t\t<Button android:id=\"@+id/btn_return_debit\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\n\n\t<ScrollView android:id=\"@+id/sv_debit\" android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"fill_parent\" android:layout_below=\"@id/rl_header_debit\"\n\t\tandroid:layout_above=\"@+id/rl_bottom_debit\">\n\t\t<RelativeLayout android:layout_width=\"fill_parent\"\n\t\t\tandroid:layout_height=\"wrap_content\">\n\t\t\t<ImageView android:id=\"@+id/iv_info_top_user_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_top2\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" />\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_top_user_debit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_card_user_debit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_card_info_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon3\" />\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_card_info_content_debit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_card_user_debit\">\n\t\t\t\t\t<TextView android:id=\"@+id/tv_card_info_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:gravity=\"right\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_centerVertical=\"true\"\n\t\t\t\t\t\t />\n\t\t\t\t</RelativeLayout>\n\t\t\t</RelativeLayout>\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_tel_info_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_card_info_debit\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_tel_user_debit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_tel_info_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon5\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_telnum_debit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_tel_user_debit\"\n\t\t\t\t\tandroid:gravity=\"center_vertical\">\n\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_telnum_content_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\t android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#6a7482\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_safety_info_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_tel_info_debit\" android:background=\"@drawable/upomp_bypay_info_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_iv_safety_debit\"\n\t\t\t\t\tandroid:layout_width=\"40dip\" android:layout_height=\"30dip\"\n\n\t\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_left\">\n\t\t\t\t\t<ImageView android:id=\"@+id/iv_safety_info_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_centerHorizontal=\"true\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:background=\"@drawable/upomp_bypay_info_icon7\" />\n\t\t\t\t</RelativeLayout>\n\n\t\t\t\t<RelativeLayout android:id=\"@+id/rl_safety_content_debit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_toRightOf=\"@+id/rl_iv_safety_debit\" android:gravity=\"center_vertical\">\n\n\t\t\t\t\t<TextView android:id=\"@+id/tv_safety_title_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:text=\"@string/upomp_bypay_safety_info\"\n\t\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:layout_centerVertical=\"true\"\n\t\t\t\t\t\tandroid:textColor=\"#6a7482\" android:textSize=\"14sp\" />\n\t\t\t\t\t<TextView android:id=\"@+id/tv_safety_content_debit\"\n\t\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\t\t\t\t\tandroid:layout_toRightOf=\"@+id/tv_safety_title_debit\"\n\t\t\t\t\t android:layout_marginLeft=\"5dip\"\n\t\t\t\t\t\tandroid:layout_centerVertical=\"true\" android:textColor=\"#ff0000\"\n\t\t\t\t\t\tandroid:textSize=\"14sp\" />\n\n\t\t\t\t</RelativeLayout>\n\t\t\t\t<ImageView android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"1dip\" android:background=\"#dbdee0\"\n\t\t\t\t\tandroid:layout_marginRight=\"1dip\" android:layout_marginLeft=\"1dip\" />\n\t\t\t</RelativeLayout>\n\t\t\t<ImageView android:id=\"@+id/iv_info_bot_user_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_info_bot2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_safety_info_debit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\" />\n\n\n\t\t\t<RelativeLayout android:id=\"@+id/rl_mobilevalidcode_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/iv_info_bot_user_debit\"\n\t\t\t\tandroid:layout_marginTop=\"20dip\" android:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<EditText android:id=\"@+id/et_mobilevalidcode_content_debit\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"45dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:maxLength=\"6\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:hint=\"@string/upomp_bypay_secondshortmessagesecuritycode\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/btn_mobilevalidcode_content_debit\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:layout_marginLeft=\"5dip\" />\n\t\t\t\t<Button android:id=\"@+id/btn_mobilevalidcode_content_debit\"\n\t\t\t\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:background=\"@drawable/upomp_bypay_input_btn2\"\n\t\t\t\t\tandroid:text=\"@string/upomp_bypay_retry\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_pin_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_below=\"@id/rl_mobilevalidcode_debit\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginRight=\"10dip\" android:background=\"@drawable/upomp_bypay_input_bg\">\n\n\n\t\t\t\t<Button android:id=\"@+id/btn_pin_content_debit\"\n\t\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"45dip\"\n\t\t\t\t\tandroid:textColor=\"#6a7482\" android:gravity=\"left|center_vertical\"\n\t\t\t\t\tandroid:textSize=\"14sp\" android:background=\"#00000000\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:hint=\"@string/upomp_bypay_secondcardpsw\" />\n\n\t\t\t</RelativeLayout>\n\t\t\t<RelativeLayout android:id=\"@+id/rl_user_webvalidcode_debit\"\n\t\t\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\t\t\tandroid:background=\"@drawable/upomp_bypay_input_bg\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" android:layout_below=\"@id/rl_pin_debit\"\n\t\t\t\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\">\n\n\t\t\t\t<EditText android:id=\"@+id/et_user_webvalidcode_content_debit\"\n\t\t\t\t\tandroid:singleLine=\"true\" android:layout_width=\"fill_parent\"\n\t\t\t\t\tandroid:layout_height=\"40dip\" android:numeric=\"integer\"\n\t\t\t\t\tandroid:maxLength=\"4\" android:textColor=\"#6a7482\"\n\t\t\t\t\tandroid:background=\"#00000000\" android:textSize=\"14sp\"\n\t\t\t\t\tandroid:layout_toLeftOf=\"@+id/iv_user_webvalidcode_content_debit\"\n\t\t\t\t\tandroid:layout_marginLeft=\"5dip\" android:hint=\"@string/upomp_bypay_image_validate\" />\n\t\t\t\t<ImageView android:id=\"@+id/iv_user_webvalidcode_content_debit\"\n\t\t\t\t\tandroid:layout_width=\"70dip\" android:layout_height=\"38dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginLeft=\"5dip\"\n\t\t\t\t\tandroid:layout_marginRight=\"5dip\" />\n\t\t\t\t<ProgressBar android:id=\"@+id/p_user_webvalidcode_content_debit\"\n\t\t\t\t\tandroid:layout_width=\"30dip\" android:layout_height=\"30dip\"\n\t\t\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"15dip\"\n\t\t\t\t\tandroid:indeterminateDrawable=\"@drawable/upomp_bypay_progress\"\n\t\t\t\t\tandroid:visibility=\"gone\" android:layout_marginLeft=\"30dip\"\n\t\t\t\t\tandroid:layout_marginTop=\"5dip\" />\n\n\t\t\t</RelativeLayout>\n\n\n\n\n\n\n\t\t\t<Button android:id=\"@+id/btn_next_debit\" android:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\" android:text=\"@string/upomp_bypay_pay\"\n\t\t\t\tandroid:textColor=\"#ffffff\" android:background=\"@drawable/upomp_bypay_btn_enter2\"\n\t\t\t\tandroid:layout_below=\"@id/rl_user_webvalidcode_debit\"\n\t\t\t\tandroid:textSize=\"20sp\" android:layout_marginLeft=\"10dip\"\n\t\t\t\tandroid:layout_marginTop=\"8dip\" />\n\t\t\t\n\t\t</RelativeLayout>\n\n\t</ScrollView>\n\t<com.unionpay.upomp.bypay.view.About\n\t\tandroid:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\"\n\t\tandroid:layout_alignParentRight=\"true\" android:paddingBottom=\"5dip\" />\n\t<RelativeLayout android:id=\"@+id/main_dialog_debit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"fill_parent\"\n\t\tandroid:layout_below=\"@id/rl_header_debit\" android:layout_above=\"@+id/rl_bottom_debit\" />\n\t<RelativeLayout android:id=\"@+id/rl_bottom_debit\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_bottom\"\n\t\tandroid:layout_alignParentBottom=\"true\">\n\t</RelativeLayout>\n\n</RelativeLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_userprotocal.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\tandroid:orientation=\"vertical\" android:layout_width=\"fill_parent\"\n\tandroid:layout_height=\"fill_parent\" android:layout_marginBottom=\"35dip\"\n\tandroid:layout_marginLeft=\"10dip\" android:layout_marginRight=\"10dip\"\n\tandroid:layout_marginTop=\"35dip\" android:background=\"@drawable/upomp_bypay_bg\">\n\n\n\t<RelativeLayout android:id=\"@+id/rl_header_protocal\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:background=\"@drawable/upomp_bypay_title_bg\">\n<Button android:id=\"@+id/btn_return_protocal\" android:layout_width=\"wrap_content\"\n\t\t\tandroid:layout_height=\"wrap_content\" android:background=\"@drawable/upomp_bypay_btn_title_esc\"\n\t\t\tandroid:layout_alignParentRight=\"true\" android:layout_marginRight=\"5dip\"\n\t\t\tandroid:layout_marginTop=\"5dip\" android:textColor=\"#ffffffff\"\n\t\t\tandroid:text=\"@string/upomp_bypay_return\" />\n\t</RelativeLayout>\n\t<ListView android:id=\"@id/android:list\" android:layout_width=\"fill_parent\"\n\t\tandroid:layout_height=\"wrap_content\" android:cacheColorHint=\"#00000000\"\n\t\tandroid:layout_below=\"@id/rl_header_protocal\" android:layout_above=\"@+id/rl_bot_protocal\"\n\t\tandroid:layout_marginLeft=\"5dip\" android:layout_marginRight=\"5dip\"\n\t\tandroid:layout_marginTop=\"8dip\" />\n\t<RelativeLayout android:id=\"@+id/rl_bot_protocal\"\n\t\tandroid:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\"\n\t\tandroid:layout_alignParentBottom=\"true\" android:background=\"@drawable/upomp_bypay_bottom\">\n\n\t</RelativeLayout>\n\n</RelativeLayout>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/zsht_bankcard_agreement.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    style=\"@style/zsht_BackgroundScrollViewStyle\" >\n\n    <LinearLayout style=\"@style/zsht_OutmostLinearLayoutStyle\" >\n\n        <FrameLayout style=\"@style/zsht_TitleStyle\" >\n\n            <ImageView style=\"@style/zsht_InvisibleLineStyle\" />\n\n            <ImageView style=\"@style/zsht_TitleBackgroundStyle\" />\n\n            <RelativeLayout style=\"@style/zsht_TitleLayoutStyle\" >\n\n                <FrameLayout\n                    android:id=\"@+id/zsht_fram_title\"\n                    style=\"@style/zsht_TitleFramLayoutStyle\" >\n\n                    <LinearLayout style=\"@style/zsht_TitleTextStyle\" >\n\n                        <ImageView style=\"@style/zsht_TitleImageStyle\" />\n\n                        <TextView style=\"@style/zsht_TitleTextViewStyle\" />\n                    </LinearLayout>\n\n                    <TextView\n                        android:id=\"@+id/zsht_tv_bankcard_agreement_back\"\n                        style=\"@style/zsht_TitleBackButtonStyle\" />\n                </FrameLayout>\n            </RelativeLayout>\n        </FrameLayout>\n\n        <TextView\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginLeft=\"10.0dip\"\n            android:layout_marginRight=\"10.0dip\"\n            android:layout_marginTop=\"15.0dip\"\n            android:gravity=\"center\"\n            android:text=\"@string/zsht_agreement_title\"\n            android:textColor=\"@android:color/black\"\n            android:textSize=\"20.0sp\"\n            android:textStyle=\"bold\" />\n\n        <TextView\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"10.0dip\"\n            android:layout_marginLeft=\"7.0dip\"\n            android:layout_marginRight=\"7.0dip\"\n            android:layout_marginTop=\"10.0dip\"\n            android:text=\"@string/zsht_bankcard_agreement\"\n            android:textColor=\"@android:color/black\"\n            android:textSize=\"16.0sp\" />\n    </LinearLayout>\n\n</ScrollView>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/zsht_bankcard_pay.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/zsht_bankcardLinearLayout\"\n    style=\"@style/zsht_BackgroundScrollViewStyle\"\n    android:orientation=\"vertical\" >\n\n    <ScrollView\n        android:id=\"@+id/zsht_scrollViewLayout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:layout_weight=\"1.0\" >\n\n        <LinearLayout\n            android:id=\"@+id/zsht_linearLayout\"\n            style=\"@style/zsht_OutmostLinearLayoutStyle\" >\n\n            <!-- title -->\n\n            <FrameLayout style=\"@style/zsht_TitleStyle\" >\n\n                <ImageView style=\"@style/zsht_InvisibleLineStyle\" />\n\n                <ImageView style=\"@style/zsht_TitleBackgroundStyle\" />\n\n                <RelativeLayout style=\"@style/zsht_TitleLayoutStyle\" >\n\n                    <FrameLayout\n                        android:id=\"@+id/zsht_fram_title\"\n                        style=\"@style/zsht_TitleFramLayoutStyle\" >\n\n                        <LinearLayout style=\"@style/zsht_TitleTextStyle\" >\n\n                            <ImageView style=\"@style/zsht_TitleImageStyle\" />\n\n                            <TextView style=\"@style/zsht_TitleTextViewStyle\" />\n                        </LinearLayout>\n\n                        <TextView\n                            android:id=\"@+id/zsht_tv_checkout_counter_bankcard_back\"\n                            style=\"@style/zsht_TitleBackButtonStyle\" />\n                    </FrameLayout>\n                </RelativeLayout>\n            </FrameLayout>\n            <!-- 商品信息 -->\n\n            <LinearLayout style=\"@style/zsht_OrderLayoutStyle\" >\n\n                <TextView\n                    android:id=\"@+id/zsht_tv_checkout_counter_bankcard_orderInfo\"\n                    style=\"@style/zsht_OrderInfoTextViewStyle\" />\n\n                <ImageView style=\"@style/zsht_OrderInfoLineStyle\" />\n\n                <TextView\n                    android:id=\"@+id/zsht_tv_checkout_counter_bankcard_orderAmt\"\n                    style=\"@style/zsht_OrderAmtTextViewStyle\" />\n            </LinearLayout>\n\n            <!-- 用户银行卡及密码 -->\n\n            <LinearLayout style=\"@style/zsht_InputLayoutStyle\" >\n\n                <TextView\n                    android:id=\"@+id/zsht_tv_checkout_counter_bank\"\n                    style=\"@style/zsht_InputTitleStyle\"\n                    android:text=\"@string/zsht_pay_bankcard_number\" />\n\n                <TextView\n                    android:id=\"@+id/zsht_tv_checkout_counter_bankcard_number\"\n                    style=\"@style/zsht_InputEditTextStyle\" />\n            </LinearLayout>\n\n            <LinearLayout style=\"@style/zsht_InputLayoutStyle\" >\n\n                <TextView\n                    style=\"@style/zsht_InputTitleStyle\"\n                    android:text=\"@string/zsht_user_name\" />\n\n                <TextView\n                    android:id=\"@+id/zsht_tv_checkout_counter_bankcard_name\"\n                    style=\"@style/zsht_InputEditTextStyle\" />\n            </LinearLayout>\n\n            <LinearLayout style=\"@style/zsht_InputLayoutStyle\" >\n\n                <TextView\n                    style=\"@style/zsht_InputTitleStyle\"\n                    android:text=\"@string/zsht_pay_password\" />\n\n                <TextView\n                    android:id=\"@+id/zsht_ed_checkout_counter_bankcard_password\"\n                    style=\"@style/zsht_InputEditTextStyle\"\n                    android:hint=\"@string/zsht_pay_password_six\" />\n            </LinearLayout>\n\n            <CheckBox\n                android:id=\"@+id/zsht_cb_nextAuth\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"8.0dip\"\n                android:checked=\"true\"\n                android:text=\"@string/zsht_not_send_authcode\"\n                android:textColor=\"@android:color/black\" />\n\n            <Button\n                android:id=\"@+id/zsht_bt_checkout_counter_pay_confirm\"\n                style=\"@style/zsht_ConfirmButtonStyle\" />\n        </LinearLayout>\n    </ScrollView>\n\n    <RelativeLayout\n        android:id=\"@+id/zsht_keyboardLayout\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingLeft=\"0.0dip\"\n        android:paddingRight=\"0.0dip\"\n        android:visibility=\"gone\" >\n\n        <RelativeLayout\n            android:id=\"@+id/zsht_popViewLinearLayout\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentTop=\"true\"\n            android:background=\"@drawable/zsht_keyboard_title\"\n            android:gravity=\"center_horizontal|center_vertical\"\n            android:orientation=\"vertical\" >\n\n            <TextView\n                android:id=\"@+id/zsht_tv_title\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginBottom=\"2.0dip\"\n                android:layout_marginTop=\"2.0dip\"\n                android:gravity=\"center_horizontal|center_vertical\"\n                android:text=\"@string/zsht_password_safe_keyboard\"\n                android:textColor=\"@android:color/white\" />\n        </RelativeLayout>\n\n        <RelativeLayout\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_below=\"@id/zsht_popViewLinearLayout\"\n            android:background=\"@drawable/zsht_keyboard_background\"\n            android:gravity=\"center_vertical\" >\n\n            <GridView\n                android:id=\"@+id/zsht_gv_keyboard\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"2.0dip\"\n                android:layout_marginRight=\"2.0dip\"\n                android:cacheColorHint=\"#00000000\"\n                android:gravity=\"center\"\n                android:horizontalSpacing=\"1.0dip\"\n                android:numColumns=\"6\"\n                android:stretchMode=\"columnWidth\"\n                android:verticalSpacing=\"1.0dip\" >\n            </GridView>\n        </RelativeLayout>\n    </RelativeLayout>\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/zsht_griditems.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:orientation=\"vertical\" >\n\n    <Button\n        android:id=\"@+id/zsht_bt_item\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:paddingTop=\"10.0dip\"\n        android:paddingBottom=\"10.0dip\"\n        android:layout_weight=\"1\"\n        android:background=\"@drawable/zsht_keyboard_button\"\n        android:clickable=\"false\"\n        android:focusable=\"false\"\n        android:text=\"@string/zsht_bt_item_text\"\n        android:textColor=\"@android:color/black\"\n        android:textSize=\"13dip\"\n        android:textStyle=\"bold\" />\n\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/zsht_loading_process_dialog_anim.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    android:gravity=\"center_vertical\"\n    android:orientation=\"vertical\" >\n\n    <LinearLayout\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"0dip\"\n        android:orientation=\"vertical\" >\n        <ImageView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:src=\"@drawable/zsht_loading_logo\" />\n    <ProgressBar\n        android:id=\"@+id/zsht_loading_process_dialog_progressBar\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"10dip\"\n        android:indeterminate=\"false\"\n        android:indeterminateDrawable=\"@anim/zsht_loading\" />\n\n\n    </LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/zsht_success_page.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    style=\"@style/zsht_BackgroundScrollViewStyle\" >\n\n    <LinearLayout style=\"@style/zsht_OutmostLinearLayoutStyle\" >\n\n        <!-- title -->\n\n        <FrameLayout style=\"@style/zsht_TitleStyle\" >\n\n            <ImageView style=\"@style/zsht_InvisibleLineStyle\" />\n\n            <ImageView style=\"@style/zsht_TitleBackgroundStyle\" />\n\n            <RelativeLayout style=\"@style/zsht_TitleLayoutStyle\" >\n\n                <FrameLayout\n                    android:id=\"@+id/zsht_fram_title\"\n                    style=\"@style/zsht_TitleFramLayoutStyle\" >\n\n                    <LinearLayout style=\"@style/zsht_TitleTextStyle\" >\n\n                        <ImageView style=\"@style/zsht_TitleImageStyle\" />\n\n                        <TextView style=\"@style/zsht_TitleTextViewStyle\" />\n                    </LinearLayout>\n                </FrameLayout>\n            </RelativeLayout>\n        </FrameLayout>\n\n        <LinearLayout\n            style=\"@style/zsht_OrderLayoutStyle\"\n            android:layout_marginTop=\"20.0dip\"\n            android:gravity=\"center_horizontal\"\n            android:orientation=\"horizontal\"\n            android:paddingBottom=\"20.0dip\"\n            android:paddingLeft=\"20.0dip\"\n            android:paddingRight=\"20.0dip\"\n            android:paddingTop=\"20.0dip\" >\n\n            <ImageView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_gravity=\"center_vertical\"\n                android:background=\"@drawable/zsht_success\" />\n\n            <TextView\n                android:id=\"@+id/zsht_tv_success_pointout\"\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"10.0dip\"\n                android:textColor=\"@android:color/black\"\n                android:textSize=\"18sp\" />\n        </LinearLayout>\n\n        <Button\n            android:id=\"@+id/zsht_bt_success\"\n            style=\"@style/zsht_ConfirmButtonStyle\"\n            android:layout_marginTop=\"20.0dip\" />\n\n        <TextView\n            android:id=\"@+id/zsht_tv_VIP_message\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\" />\n    </LinearLayout>\n\n</ScrollView>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/layout/zsht_user_message.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    style=\"@style/zsht_BackgroundScrollViewStyle\" >\n\n    <LinearLayout style=\"@style/zsht_OutmostLinearLayoutStyle\" >\n\n        <FrameLayout style=\"@style/zsht_TitleStyle\" >\n\n            <ImageView style=\"@style/zsht_InvisibleLineStyle\" />\n\n            <ImageView style=\"@style/zsht_TitleBackgroundStyle\" />\n\n            <RelativeLayout style=\"@style/zsht_TitleLayoutStyle\" >\n\n                <FrameLayout\n                    android:id=\"@+id/zsht_fram_title\"\n                    style=\"@style/zsht_TitleFramLayoutStyle\" >\n\n                    <LinearLayout style=\"@style/zsht_TitleTextStyle\" >\n\n                        <ImageView style=\"@style/zsht_TitleImageStyle\" />\n\n                        <TextView style=\"@style/zsht_TitleTextViewStyle\" />\n                    </LinearLayout>\n\n                    <TextView\n                        android:id=\"@+id/zsht_tv_user_message_back\"\n                        style=\"@style/zsht_TitleBackButtonStyle\" />\n                </FrameLayout>\n            </RelativeLayout>\n        </FrameLayout>\n        <!-- 商品信息 -->\n\n        <LinearLayout style=\"@style/zsht_OrderLayoutStyle\" >\n\n            <TextView\n                android:id=\"@+id/zsht_tv_pay_orderInfo\"\n                style=\"@style/zsht_OrderInfoTextViewStyle\" />\n\n            <ImageView style=\"@style/zsht_OrderInfoLineStyle\" />\n\n            <TextView\n                android:id=\"@+id/zsht_tv_pay_orderAmt\"\n                style=\"@style/zsht_OrderAmtTextViewStyle\" />\n        </LinearLayout>\n        <!-- 填写用户支付信息 -->\n\n        <TextView\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginLeft=\"10.0dip\"\n            android:layout_marginRight=\"10.0dip\"\n            android:layout_marginTop=\"5.0dip\"\n            android:gravity=\"center_vertical\"\n            android:paddingLeft=\"5.0dip\"\n            android:text=\"@string/zsht_bankcard_message_input\"\n            android:textColor=\"#d16a0b\"\n            android:textSize=\"18.0sp\" />\n\n        <LinearLayout style=\"@style/zsht_InputLayoutStyle\" >\n\n            <TextView\n                style=\"@style/zsht_InputTitleStyle\"\n                android:text=\"@string/zsht_hint_bankcard_number\" />\n\n            <EditText\n                android:id=\"@+id/zsht_ed_user_message_bankcard_card_number\"\n                style=\"@style/zsht_InputEditTextStyle\"\n                android:digits=\"0123456789\"\n                android:hint=\"@string/zsht_bankcard_number_input\"\n                android:inputType=\"number\"\n                android:maxLength=\"19\" />\n        </LinearLayout>\n\n        <LinearLayout style=\"@style/zsht_InputLayoutStyle\" >\n\n            <TextView\n                style=\"@style/zsht_InputTitleStyle\"\n                android:text=\"@string/zsht_id_number\" />\n\n            <EditText\n                android:id=\"@+id/zsht_ed_user_message_IDnumber\"\n                style=\"@style/zsht_InputEditTextStyle\"\n                android:digits=\"0123456789*xX\"\n                android:hint=\"@string/zsht_hint_id_number_input\"\n                android:maxLength=\"18\" />\n        </LinearLayout>\n\n        <LinearLayout style=\"@style/zsht_InputLayoutStyle\" >\n\n            <TextView\n                style=\"@style/zsht_InputTitleStyle\"\n                android:text=\"@string/zsht_real_name\" />\n\n            <EditText\n                android:id=\"@+id/zsht_ed_user_message_realName\"\n                style=\"@style/zsht_InputEditTextStyle\"\n                android:hint=\"@string/zsht_real_name_input\"\n                android:maxLength=\"4\" />\n        </LinearLayout>\n\n        <LinearLayout style=\"@style/zsht_InputLayoutStyle\" >\n\n            <TextView\n                style=\"@style/zsht_InputTitleStyle\"\n                android:text=\"@string/zsht_phone_number_xml\" />\n\n            <EditText\n                android:id=\"@+id/zsht_ed_user_message_phone_number\"\n                style=\"@style/zsht_InputEditTextStyle\"\n                android:digits=\"0123456789\"\n                android:hint=\"@string/zsht_phone_input\"\n                android:inputType=\"phone\"\n                android:maxLength=\"11\" />\n        </LinearLayout>\n\n        <RelativeLayout\n            android:id=\"@+id/zsht_authcodeLayout\"\n            style=\"@style/zsht_InputLayoutStyle\"\n            android:visibility=\"gone\" >\n\n            <Button\n                android:id=\"@+id/zsht_bt_user_message_getAuthCode\"\n                android:layout_width=\"60dip\"\n                android:layout_height=\"fill_parent\"\n                android:layout_alignParentRight=\"true\"\n                android:layout_below=\"@id/zsht_ed_user_message_phone_number\"\n                android:layout_centerVertical=\"true\"\n                android:layout_marginBottom=\"1.0dip\"\n                android:layout_marginRight=\"1.0dip\"\n                android:layout_marginTop=\"1.0dip\"\n                android:background=\"@drawable/zsht_authcode_style\"\n                android:text=\"@string/zsht_bt_get_authcode\"\n                android:textColor=\"#8d722b\"\n                android:textSize=\"12.0sp\" />\n\n            <TextView\n                android:id=\"@+id/zsht_tv_user_message_authCode\"\n                style=\"@style/zsht_InputTitleStyle\"\n                android:layout_below=\"@id/zsht_ed_user_message_phone_number\"\n                android:layout_centerVertical=\"true\"\n                android:text=\"@string/zsht_authcode\" />\n\n            <EditText\n                android:id=\"@+id/zsht_ed_user_message_authCode\"\n                style=\"@style/zsht_InputEditTextStyle\"\n                android:layout_centerVertical=\"true\"\n                android:layout_toLeftOf=\"@id/zsht_bt_user_message_getAuthCode\"\n                android:layout_toRightOf=\"@id/zsht_tv_user_message_authCode\"\n                android:digits=\"0123456789\"\n                android:hint=\"@string/zsht_authcode_six\"\n                android:inputType=\"number\"\n                android:maxLength=\"6\" />\n        </RelativeLayout>\n\n        <LinearLayout\n            android:id=\"@+id/zsht_layout_agreement\"\n            style=\"@style/zsht_InputLayoutStyle\"\n            android:layout_marginLeft=\"8.0dip\"\n            android:background=\"@null\"\n            android:gravity=\"center_vertical\"\n            android:paddingLeft=\"0dip\" >\n\n            <CheckBox\n                android:id=\"@+id/zsht_cb_bankcard_agreement\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:checked=\"true\"\n                android:gravity=\"center\"\n                android:text=\"@string/zsht_read_agree\"\n                android:textColor=\"@android:color/black\"\n                android:textSize=\"15sp\" />\n\n            <TextView\n                android:id=\"@+id/zsht_tv_bankcard_agreement\"\n                style=\"@style/zsht_InputEditTextStyle\"\n                android:layout_width=\"wrap_content\"\n                android:layout_marginLeft=\"0.0dip\"\n                android:gravity=\"center_vertical\"\n                android:text=\"@string/zsht_agreement\"\n                android:textColor=\"#449eff\"\n                android:textSize=\"15sp\" />\n        </LinearLayout>\n\n        <Button\n            android:id=\"@+id/zsht_bt_user_message_confirm\"\n            style=\"@style/zsht_ConfirmButtonStyle\" />\n    </LinearLayout>\n\n</ScrollView>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/values/upomp_strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <string name=\"upomp_bypay_sessionhint\">由于您过长时间未操作，此次交易已失效，请退出支付，并重新进行交易。是否立即退出支付？</string>\n    <string name=\"upomp_bypay_splash_hint1\">随时随地</string>\n    <string name=\"upomp_bypay_splash_hint2\">随心支付</string>\n    <string name=\"upomp_bypay_esc_pay\">退出支付</string>\n    <string name=\"upomp_bypay_pay_btn_hint1\">使用银联帐号支付</string>\n    <string name=\"upomp_bypay_pay_btn_hint2\">直接输入卡号支付</string>\n    <string name=\"upomp_bypay_pan\">信用卡\\u002F借记卡\\u002F储值卡</string>\n    <string name=\"upomp_bypay_tel\">银行预留手机号</string>\n    <string name=\"upomp_bypay_user_name\">用户名\\u002F手机号</string>\n    <string name=\"upomp_bypay_user_psw\">6-12位密码</string>\n    <string name=\"upomp_bypay_image_validate\">图形验证码</string>\n    <string name=\"upomp_bypay_note_validate\">短信验证码</string>\n    <string name=\"upomp_bypay_splash_loading\">加载中，请稍候...</string>\n    <string name=\"upomp_bypay_safety_info\">安全信息:</string>\n    <string name=\"upomp_bypay_secondshortmessagesecuritycode\">短信验证码</string>\n    <string name=\"upomp_bypay_secondcardpsw\">银行卡密码</string>\n    <string name=\"upomp_bypay_get\">获取</string>\n    <string name=\"upomp_bypay_retry\">重发</string>\n    <string name=\"upomp_bypay_return\">返回</string>\n    <string name=\"upomp_bypay_pay\">确认支付</string>\n    <string name=\"upomp_bypa_cvn2\">CVN2</string>\n    <string name=\"upomp_bypay_pay_result_paysucceed\">支付成功</string>\n    <string name=\"upomp_bypay_payfail\">支付失败</string>\n    <string name=\"upomp_bypay_pay_result_returnmerchant\">返回商户</string>\n    <string name=\"upomp_bypay_pay_result_newpay\">重新支付</string>\n    <string name=\"upomp_bypay_failcause\">失败原因:</string>\n    <string name=\"upomp_bypay_next\">下一步</string>\n    <string name=\"upomp_bypay_welcome\">欢\\u0020\\u0020迎\\u0020\\u0020语:</string>\n    <string name=\"upomp_bypay_securityissue\">安全问题:</string>\n    <string name=\"upomp_bypay_securityquestionanswer\">问题答案:</string>\n    <string name=\"upomp_bypay_register_hint\">成为银联在线支付用户可使用用户名和密码享受快捷支付。</string>\n    <string name=\"upomp_bypay_register_password\">密\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020码:</string>\n    <string name=\"upomp_bypay_register_makesurepassword\">确认密码:</string>\n    <string name=\"upomp_bypay_username\">用\\u0020\\u0020户\\u0020\\u0020名:</string>\n    <string name=\"upomp_bypay_register_win\">恭喜您，注册成功！</string>\n    <string name=\"upomp_bypay_register_win_hint\">成为银联在线支付用户可使用用户名和密码享受快捷支付。</string>\n    <string name=\"upomp_bypay_debitcard\">借记卡</string>\n    <string name=\"upomp_bypay_creditcard\">信用卡</string>\n    <string name=\"upomp_bypay_valuecard\">储值卡</string>\n    <string name=\"upomp_bypay_supportcard\">支持的银行</string>\n    <string name=\"upomp_bypay_getpass\">忘记密码</string>\n    <string name=\"upomp_bypay_getpass_name_hint\">请输入用户名</string>\n    <string name=\"upomp_bypay_getpass_tel_hint\">请输入绑定的手机号</string>\n    <string name=\"upomp_bypay_getpass_questionkey_hint\">请输入安全问题答案</string>\n    <string name=\"upomp_bypay_getpass_psw1_hint\">请输入新密码</string>\n    <string name=\"upomp_bypay_getpass_psw2_hint\">请再输入一次</string>\n    <string name=\"upomp_bypay_getpass_name\">用户名：</string>\n    <string name=\"upomp_bypay_pay_it_inputtel\">请重新点击“获取”按钮，获取最新短信验证码。</string>\n    <string name=\"upomp_bypay_register_bind_card\">快速绑卡,享受快捷支付</string>\n    <string name=\"upomp_bypay_bind_card\">确认绑卡</string>\n    <string name=\"upomp_bypay_pswname\">用户密码:</string>\n\n<!-- \t\tggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg -->\n    <string name=\"upomp_bypay_error\">错误</string>\n    <string name=\"upomp_bypay_linkerror\">网络连接错误，请重新尝试！</string>\n    <string name=\"upomp_bypay_fileerror\">系统检测到您的手机POS已被恶意修改，为确保您的支付安全，请重新安装使用！</string>\n    <string name=\"upomp_bypay_please\">请过\\u0020</string>\n    <string name=\"upomp_bypay_sendMac\">\\u0020秒后再发送验证码!</string>\n    <string name=\"upomp_bypay_sixtotwenty\">6~20位字符组合</string>\n    <string name=\"upomp_bypay_sixtotwelve\">6~12位字符组合</string>\n    <string name=\"upomp_bypay_twotosixteen\">2~16位字符组合</string>\n    <string name=\"upomp_bypay_secondmobilenum\">手机号码</string>\n    <string name=\"upomp_bypay_loading\">登录</string>\n    <string name=\"upomp_bypay_register\">注册</string>\n    <string name=\"upomp_bypay_selectcard\">选\\u0020择\\u0020卡\\u0020种\\u0020:</string>\n    <string name=\"upomp_bypay_firstcardid\">银行卡卡号:</string>\n    <string name=\"upomp_bypay_secondcardid\">银行卡卡号</string>\n    <string name=\"upomp_bypay_hint\">若与您预设的资料不符，极有可能是钓鱼软件，请终止操作。</string>\n    <string name=\"upomp_bypay_editpass\">修改密码</string>\n    <string name=\"upomp_bypay_editinfo\">更改手机号码</string>\n    <string name=\"upomp_bypay_selectdate\">请选择有效期。</string>\n    <string name=\"upomp_bypay_date\">有\\u0020\\u0020\\u0020效\\u0020\\u0020\\u0020期\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_checkcode\">校\\u0020\\u0020\\u0020验\\u0020\\u0020\\u0020码\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_payamount\">支\\u0020付\\u0020金\\u0020额\\u0020:</string>\n    <string name=\"upomp_bypay_backnum\">信用卡背面末三位数字</string>\n    <string name=\"upomp_bypay_cardmanage\">银行卡管理</string>\n    <string name=\"upomp_bypay_gantan\">！</string>\n    <string name=\"upomp_bypay_cancel\">取消</string>\n    <string name=\"upomp_bypay_returnlist\">返回列表</string>\n    <string name=\"upomp_bypay_cardunknown\">未知卡</string>\n    <string name=\"upomp_bypay_removecard\">解除关联</string>\n    <string name=\"upomp_bypay_affirmremovecard\">确认要解除关联本银行卡？[</string>\n    <string name=\"upomp_bypay_changedefultcard\">默认卡变更</string>\n    <string name=\"upomp_bypay_affirmchangedefultcard\">是否设置本卡为默认卡？[</string>\n    <string name=\"upomp_bypay_selectsucceed\">设置成功！</string>\n    <string name=\"upomp_bypay_selectfail\">设置失败，请重新尝试！</string>\n    <string name=\"upomp_bypay_updatelist\">更新列表</string>\n    <string name=\"upomp_bypay_balance\">余额查询</string>\n    <string name=\"upomp_bypay_changepswsucceed\">修改密码成功!</string>\n    <string name=\"upomp_bypay_newpsw\">新\\u0020\\u0020\\u0020密\\u0020\\u0020\\u0020码\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_enternewpsw\">确认新密码:</string>\n    <string name=\"upomp_bypay_logined\">已登录</string>\n    <string name=\"upomp_bypay_accountmainactivity_header\">我的信息</string>\n    <string name=\"upomp_bypay_accountmain_myinfo\">个人信息</string>\n    <string name=\"upomp_bypay_accountmain_username\">\\u0020用\\u0020户\\u0020名\\u0020:</string>\n    <string name=\"upomp_bypay_accountmain_email\">邮箱地址:</string>\n    <string name=\"upomp_bypay_addcard_binduser\">绑\\u0020定\\u0020用\\u0020户\\u0020:</string>\n    <string name=\"upomp_bypay_addcard_cvn2\">C\\u0020V\\u0020N\\u00202\\u0020:</string>\n    <string name=\"upomp_bypay_addcard_selectdefultcard\">设置成默认银行卡</string>\n    <string name=\"upomp_bypay_balanceresult_balance\">余额查询结果</string>\n    <string name=\"upomp_bypay_balanceresult_balancesucceed\">余额查询成功！</string>\n    <string name=\"upomp_bypay_balanceresult_balancefail\">余额查询失败！</string>\n    <string name=\"upomp_bypay_balanceresult_balancenumber\">您的银行卡余额是</string>\n    <string name=\"upomp_bypay_balanceresult_yuan\">元。</string>\n    <string name=\"upomp_bypay_bankrestlt_succeed\">添加银行卡成功！</string>\n    <string name=\"upomp_bypay_bankrestlt_fail\">添加银行卡失败！</string>\n    <string name=\"upomp_bypay_bankrestlt_cardid\">\\u0020\\u0020卡\\u0020\\u0020\\u0020\\u0020号\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_bankrestlt_continuebank\">继续绑卡</string>\n    <string name=\"upomp_bypay_cardinfo_hint1\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020您可以对该银行卡进行以下操作：默认卡设置、解除关联、余额查询。</string>\n    <string name=\"upomp_bypay_cardinfo_hint2\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020您可以对该银行卡进行以下操作：默认卡设置、解除关联。</string>\n    <string name=\"upomp_bypay_cardinfo_removecardsucceed\">银行卡解除关联成功!</string>\n    <string name=\"upomp_bypay_cardinfo\">银行卡信息</string>\n    <string name=\"upomp_bypay_cardmainactivity_firstlogin\">您尚未登录，请先登录再进行银行卡管理操作。</string>\n    <string name=\"upomp_bypay_cardmainactivity_defultcard\">(默认卡)</string>\n    <string name=\"upomp_bypay_cardmainactivity_cancelbanksucced\">取消绑定成功!</string>\n    <string name=\"upomp_bypay_cardmainactivity_issuedcard\">发卡行:\\u0020</string>\n    <string name=\"upomp_bypay_cardmainactivity_cardtype\">卡类型:\\u0020</string>\n    <string name=\"upomp_bypay_cardmainactivity_cardid\">卡\\u0020\\u0020\\u0020\\u0020号:\\u0020</string>\n    <string name=\"upomp_bypay_cardmainactivity_close\">关闭</string>\n    <string name=\"upomp_bypay_cardmain_relevancecard\">你已关联的银行卡:</string>\n    <string name=\"upomp_bypay_cardmain_norelevancecard\">你还没有关联的银行卡！</string>\n    <string name=\"upomp_bypay_cardmain_hint1\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020请点击添加银行卡按钮添加银行卡！</string>\n    <string name=\"upomp_bypay_cardmain_hint2\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020选择您绑定的银行卡后，您可以进行以下操作：查看银行卡信息；默认卡设置；银行卡删除；余额查询！</string>\n    <string name=\"upomp_bypay_editinfoactivity_nochange\">新手机号码与原手机号码一样，无需进行修改。</string>\n    <string name=\"upomp_bypay_editinfoactivity_inputtelnum\">请输入原手机号码。</string>\n    <string name=\"upomp_bypay_editinfoactivity_inputtelnum1\">原手机号码格式有误，应为11位数字。</string>\n    <string name=\"upomp_bypay_editinfoactivity_changetelfail\">更改手机号码失败！</string>\n    <string name=\"upomp_bypay_editinfoactivity_changetelsucceed\">更改手机号码成功！</string>\n    <string name=\"upomp_bypay_editinfo_registertel\">已注册手机:</string>\n    <string name=\"upomp_bypay_editinfo_oldtelhint\">原手机号码</string>\n    <string name=\"upomp_bypay_editinfo_newtelhint\">新手机号码</string>\n    <string name=\"upomp_bypay_editinfo_hint\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020如果您的用户名是手机号，您将不能修改手机号。</string>\n    <string name=\"upomp_bypay_editpassactivity_inputoldpsw\">请输入原密码。</string>\n    <string name=\"upomp_bypay_editpass_oldpsw\">原\\u0020\\u0020\\u0020密\\u0020\\u0020\\u0020码\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_editpass_oldpswhint\">原密码</string>\n    <string name=\"upomp_bypay_getpassactivity_updatepsw\">密码重置</string>\n    <string name=\"upomp_bypay_loginactivity_userlogin\">用户登录</string>\n    <string name=\"upomp_bypay_loginactivity_loginsucceed\">登录成功!</string>\n    <string name=\"upomp_bypay_loginactivity_loginfail\">登录失败!</string>\n    <string name=\"upomp_bypay_login_username\">用\\u0020\\u0020\\u0020户\\u0020\\u0020\\u0020名\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_login_psw\">\\u0020\\u0020\\u0020密\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020码\\u0020\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_login_webvalidcode\">校\\u0020\\u0020\\u0020验\\u0020\\u0020\\u0020码\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_login_hint\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020请使用中国银联的注册帐号及密码登录，为保证账户安全，如果您连续五次输错密码，您的账号将被锁定三个小时，给您带来的不便敬请原谅！</string>\n    <string name=\"upomp_bypay_pay_it_previewdifferent\">若与您预设的资料不符，极有可能是钓鱼软件，请终止支付。</string>\n    <string name=\"upomp_bypay_pay_it_valuecardpay\">储值卡支付</string>\n    <string name=\"upomp_bypay_pay_it_preventfish\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020为防止钓鱼应用，请核对您收到的95516发送的短信中，安全提示信息是否为：</string>\n    <string name=\"upomp_bypay_pay_it_bankmobilenum\">发卡行预留的手机号</string>\n    <string name=\"upomp_bypay_pay_it_securitycode\">\\u0020\\u0020\\u0020密\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020码\\u0020\\u0020\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_pay_it_pleaseaddcard\">您还未关联过银行卡，请先添加银行卡。</string>\n    <string name=\"upomp_bypay_pay_it_paycardnum\">支\\u0020付\\u0020卡\\u0020号\\u0020:</string>\n    <string name=\"upomp_bypay_pay_it_other\">其他</string>\n    <string name=\"upomp_bypay_pay_it_valueacrdtype\">储值卡类型:</string>\n    <string name=\"upomp_bypay_pay_it_choosevalueacrdtype\">请选择储值卡类型</string>\n    <string name=\"upomp_bypay_pay_it_valueacrdnum\">储值卡卡号:</string>\n    <string name=\"upomp_bypay_pay_it_valueacrdcode\">储值卡密码:</string>\n    <string name=\"upomp_bypay_pay_it_cvn2\">C\\u0020\\u0020V\\u0020\\u0020N\\u0020\\u0020\\u00202\\u0020\\u0020:</string>\n    <string name=\"upomp_bypay_pay_it_cardid\">银行卡卡号</string>\n    <string name=\"upomp_bypay_pay_it_cardpsw\">银行卡密码</string>\n    <string name=\"upomp_bypay_pay_it_getmac\">请先点击“获取”按钮，获取最新短信校验码。</string>\n    <string name=\"upomp_bypay_pay_it_macfail\">短信验证码不正确，请重新填写!</string>\n    <string name=\"upomp_bypay_pay_it_getlistfail\">读取储值卡列表错误！</string>\n    <string name=\"upomp_bypay_pay_it_selectcard\">银行卡选择</string>\n    <string name=\"upomp_bypay_pay_it_defultcard\">（默认）</string>\n    <string name=\"upomp_bypay_pay_it_changecard\">银行卡变更</string>\n    <string name=\"upomp_bypay_pay_it_yesornopay\">是否选择此卡进行支付？[</string>\n    <string name=\"upomp_bypay_pay_it_selectmm\">请选择有效期月份</string>\n    <string name=\"upomp_bypay_pay_it_selectyy\">请选择有效期年份</string>\n    <string name=\"upomp_bypay_pay_it_hint_normal\">只需验证发卡行预留手机号及银行卡信息（信用卡验证有效期和CVN2，借记卡验证卡密码），即可完成支付。</string>\n    <string name=\"upomp_bypay_pay_it_hint_auth\">银联在线支付注册用户可通过验证用户密码，选择绑定的银行卡并验证手机短信验证码，即可完成支付。</string>\n    <string name=\"upomp_bypay_pay_it_hint_valuecard\">使用银联支持的储值卡（也叫预付费卡，不记名不挂失），只需验证卡号和密码，即可完成支付。</string>\n    <string name=\"upomp_bypay_pay_main_tradeverify\">交易确认</string>\n    <string name=\"upomp_bypay_pay_main_secondindentnum\">订单编号:</string>\n    <string name=\"upomp_bypay_pay_main_secondexchangetime\">交易时间:</string>\n    <string name=\"upomp_bypay_pay_main_moneytype\">交易币种:</string>\n    <string name=\"upomp_bypay_pay_main_tradetype\">交易种类:</string>\n    <string name=\"upomp_bypay_pay_main_immediatelypay\">立即支付</string>\n    <string name=\"upomp_bypay_pay_main_checkinfocarefully\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020请仔细核对交易信息，以防止虚假交易或钓鱼软件。如与您之前交易信息不符，请不要进行交易。</string>\n    <string name=\"upomp_bypay_pay_result_indentnum\">订\\u0020单\\u0020编\\u0020号\\u0020:</string>\n    <string name=\"upomp_bypay_pay_result_exchangetime\">交\\u0020易\\u0020时\\u0020间\\u0020:</string>\n    <string name=\"upomp_bypay_pay_result_traderesult_maohao\">交\\u0020易\\u0020结\\u0020果\\u0020:</string>\n    <string name=\"upomp_bypay_pay_result_tradeturnover\">交\\u0020易\\u0020流\\u0020水\\u0020:</string>\n    <string name=\"upomp_bypay_pay_result_failinfo\">失\\u0020败\\u0020原\\u0020因\\u0020:</string>\n    <string name=\"upomp_bypay_register_email\">邮\\u0020箱\\u0020地\\u0020址\\u0020:</string>\n    <string name=\"upomp_bypay_register_emailhint\">邮箱地址</string>\n    <string name=\"upomp_bypay_register_setsecuritypromptquestion\">设置安全提示问题</string>\n    <string name=\"upomp_bypay_register_customquestion\">自定义问题:</string>\n    <string name=\"upomp_bypay_register_iagreewithuserdeal\">我同意用户协议</string>\n    <string name=\"upomp_bypay_registeractivity_yes\">请阅读注册协议，只有同意协议才能继续注册。</string>\n    <string name=\"upomp_bypay_registeractivity_usernamerepeat\">用户名已存在，请返回商户。</string>\n    <string name=\"upomp_bypay_splash_version\">版本1.1.0</string>\n    <string name=\"upomp_bypay_splash_info\">中国银联股份有限公司版权所有 ©2002-2012</string>\n    <string name=\"upomp_bypay_carddialog_select\">选择操作</string>\n    <string name=\"upomp_bypay_carddialog_seecardinfo\">银行卡信息查看</string>\n    <string name=\"upomp_bypay_keyboard_clear\">清除</string>\n    <string name=\"upomp_bypay_keyboard_number\">数字</string>\n    <string name=\"upomp_bypay_keyboard_letter\">字母</string>\n    <string name=\"upomp_bypay_keyboard_symbol\">符号</string>\n    <string name=\"upomp_bypay_loading1dialog_loading\">加载中,请稍后...</string>\n    <string name=\"upomp_bypay_splashactivity_initfail\">初始化数据失败！</string>\n    <string name=\"upomp_bypay_splashactivity_quit\">中途退出</string>\n    <string name=\"upomp_bypay_splashactivity_rmb\">人民币</string>\n    <string name=\"upomp_bypay_splashactivity_pay\">直接消费</string>\n    <string name=\"upomp_bypay_splashactivity_custom\">自定义</string>\n    <string name=\"upomp_bypay_utils_inputusername\">请输入用户名。</string>\n    <string name=\"upomp_bypay_utils_inputusernamefail\">用户名格式有误，应由6-20位字母和数字混合组成。</string>\n    <string name=\"upomp_bypay_utils_inputpsw\">请输入密码。</string>\n    <string name=\"upomp_bypay_utils_inputpswinfo\">密码格式有误，应由6-12位字母、数字或特殊符号混合组成（至少两种混合）。</string>\n    <string name=\"upomp_bypay_utils_enterquit\">确定要退出吗?</string>\n    <string name=\"upomp_bypay_utils_inputloginusername\">请输入用户名。</string>\n    <string name=\"upomp_bypay_utils_inputloginusernamefail\">用户名格式有误，长度应为6-20位。</string>\n    <string name=\"upomp_bypay_utils_inputusernameinfo\">用户名应由6-20位字符组合组成!</string>\n    <string name=\"upomp_bypay_utils_inputloginpsw\">请输入密码。</string>\n    <string name=\"upomp_bypay_utils_inputloginpswinfo\">密码应由6-12位字符组合组成!</string>\n    <string name=\"upomp_bypay_utils_inputpswfail\">密码格式有误，长度应为6-12位。</string>\n    <string name=\"upomp_bypay_utils_inputenterpsw\">请再次输入密码。</string>\n    <string name=\"upomp_bypay_utils_twopswfail\">两次输入的密码不一致。</string>\n    <string name=\"upomp_bypay_utils_twonewpswfail\">两次输入的新密码不一致。</string>\n    <string name=\"upomp_bypay_utils_inputnewpsw\">请输入新密码。</string>\n    <string name=\"upomp_bypay_utils_inputnewpswfail\">新密码格式有误，应由6-12位字母、数字或特殊符号混合组成（至少两种混合）。</string>\n    <string name=\"upomp_bypay_utils_inputenternewpsw\">请再次输入新密码。</string>\n    <string name=\"upomp_bypay_utils_inputtel\">请输入手机号码。</string>\n    <string name=\"upomp_bypay_utils_inputtelfail\">手机号码格式有误，应为11位数字。</string>\n    <string name=\"upomp_bypay_utils_inputnewtel\">请输入新手机号码。</string>\n    <string name=\"upomp_bypay_utils_inputnewtelfail\">新手机号码格式有误，应为11位数字。</string>\n    <string name=\"upomp_bypay_utils_inputmac\">请输入短信验证码。</string>\n    <string name=\"upomp_bypay_utils_inputwebvalidcode\">请输入校验码。</string>\n    <string name=\"upomp_bypay_utils_inputwebvalidcodefail\">校验码格式错误，应为4位数字。</string>\n    <string name=\"upomp_bypay_utils_inputemail\">请输入邮箱地址。</string>\n    <string name=\"upomp_bypay_utils_inputemailfail\">邮箱地址格式有误。</string>\n    <string name=\"upomp_bypay_utils_welcome\">请输入页面欢迎语。</string>\n    <string name=\"upomp_bypay_utils_welcomefail\">页面欢迎语格式有误，长度应为2-16位，内容可为中文、英文、数字或特殊字符。</string>\n    <string name=\"upomp_bypay_utils_question\">请选择安全问题。</string>\n    <string name=\"upomp_bypay_utils_questionfail\">安全问题由2-16位字符组合组成!</string>\n    <string name=\"upomp_bypay_utils_myquestion\">请输入自定义安全问题。</string>\n    <string name=\"upomp_bypay_utils_myquestionfail\">自定义安全问题格式有误，长度应为2-16位，内容可为中文、英文、数字或特殊字符。</string>\n    <string name=\"upomp_bypay_utils_questionresult\">请输入安全问题答案。</string>\n    <string name=\"upomp_bypay_utils_questionresultfail\">安全问题答案格式有误，长度应为2-16位，内容可为中文、英文、数字或特殊字符。</string>\n    <string name=\"upomp_bypay_utils_cardpsw\">请输入银行卡密码。</string>\n    <string name=\"upomp_bypay_utils_cardpswfail\">银行卡密码长度有误，应为6位数字。</string>\n    <string name=\"upomp_bypay_utils_valuecardid\">请输入储值卡卡号。</string>\n    <string name=\"upomp_bypay_utils_valuecardidfail\">储值卡卡号格式有误，应为16-19位数字。</string>\n    <string name=\"upomp_bypay_utils_valuecardpsw\">请输入银行卡密码。</string>\n    <string name=\"upomp_bypay_utils_valuecardpswfail\">银行卡密码长度有误，应为6位数字。</string>\n    <string name=\"upomp_bypay_utils_cvn2\">请输入CVN2。</string>\n    <string name=\"upomp_bypay_utils_cvn2fail\">CVN2长度有误，应为3位数字，一般为信用卡背面数字的末三位。</string>\n    <string name=\"upomp_bypay_utils_cardpsw_hint\">\\u0020\\u0020请输入密码</string>\n    <string name=\"upomp_bypay_editpassactivity_inputoldpsw_hint\">请输入原密码</string>\n    <string name=\"upomp_bypay_utils_inputnewpsw_hint\">\\u0020\\u0020请输入新密码</string>\n    <string name=\"upomp_bypay_utils_inputenternewpsw_hint\">\\u0020\\u0020请再次输入密码</string>\n    <string name=\"upomp_bypay_utils_valuecardpsw_hint\">\\u0020\\u0020请输入储值卡密码</string>\n    <string name=\"upomp_bypay_utils_inputenterpsw_hint\">\\u0020\\u0020请输入确认密码</string>\n    <string name=\"upomp_bypay_message_validation\">确认短信中安全提示信息为:</string>\n    <string name=\"upomp_bypay_pay_normal_2_1\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020您输入的是借记卡，请输入该卡在发卡行预留的手机号码并点击获取按钮，然后在手机收到短信验证码后输入到短信验证码输入框中。</string>\n    <string name=\"upomp_bypay_pay_normal_2_2\">\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020您输入的是信用卡，请输入该卡在发卡行预留的手机号码并点击获取按钮，然后在手机收到短信验证码后输入到短信验证码输入框中。</string>\n    <string name=\"upomp_bypay_pay_normal_2\">如果短信中安全提示信息一样， 请勾选“确认短信中安全提示信息”，只有确认短信中安全提示信息才能支付。</string>\n\n    <!-- qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq -->\n\n    <string name=\"upomp_bypay_prompt\">提示</string>\n    <string name=\"upomp_bypay_pay_main_merchantname\">商户名称:</string>\n    <string name=\"upomp_bypay_pay_main_secondpayamount\">订单金额:</string>\n    <string name=\"upomp_bypay_yuan\">\\u0020元</string>\n    <string name=\"upomp_bypay_pay_main_user\">普通用户</string>\n    <string name=\"upomp_bypay_pay_main_user_info\">使用卡号，手机号，卡密完成认证支付：</string>\n    <string name=\"upomp_bypay_pay_main_user_btn\">普通用户认证支付</string>\n    <string name=\"upomp_bypay_pay_main_user_pan\">卡\\u0020\\u0020\\u0020\\u0020号:</string>\n    <string name=\"upomp_bypay_affirm\">确认</string>\n    <string name=\"upomp_bypay_pay_main_onuser\">银联在线支付用户</string>\n    <string name=\"upomp_bypay_pay_main_onuser_info\">使用用户名，密码及绑定卡完成快捷支付:</string>\n    <string name=\"upomp_bypay_pay_main_onuser_btn\">银联在线支付用户快捷支付</string>\n    <string name=\"upomp_bypay_pay_main_cancelpay\">取消支付</string>\n    <string name=\"upomp_bypay_pay_main_user_name\">用户名:</string>\n    <string name=\"upomp_bypay_pay_main_user_password\">密码:</string>\n    <string name=\"upomp_bypay_pay_main_ordernum\">订单编号:</string>\n    <string name=\"upomp_bypay_pay_main_orderdata\">订单时间:</string>\n    <string name=\"upomp_bypay_pay_main_orderinfo\">订单详情:</string>\n    <string name=\"upomp_bypay_cardinfo_issuercard\">发卡行:</string>\n    <string name=\"upomp_bypay_cardtype\">卡类型:</string>\n    <string name=\"upomp_bypay_cardinfo_hint\">如果您在银行预留的手机号码已变更，请直接填写新手机号码。</string>\n    <string name=\"upomp_bypay_firstmobilenum\">手机号码:</string>\n    <string name=\"upomp_bypay_pin\">银行卡密码:</string>\n    <string name=\"upomp_bypay_pay_result\">交易结果:</string>\n    <string name=\"upomp_bypay_register_box_hint\">注册成为银联在线支付用户</string>\n    <string name=\"upomp_bypay_defaultcard\">默认卡:</string>\n    <string name=\"upomp_bypay_register_title_hint\">请填写以下信息进行注册:</string>\n    <string name=\"upomp_bypay_finish\">完成</string>\n    <string name=\"upomp_bypay_register_succeed\">注册成功!</string>\n    <string name=\"upomp_bypay_utils_cvn2_hint\">请输入CVN2</string>\n    <string name=\"upomp_bypay_utils_inputpsw_hint\">请输入密码</string>\n    <string name=\"upomp_bypay_fae\">百付天下\\u0020\\u0020\\u0020\\u0020技术支持</string>\n    <string name=\"upomp_bypay_pay_it_secondcheckcode\">校验码:</string>\n    <string name=\"upomp_bypay_utils_cardid\">请输入银行卡卡号。</string>\n    <string name=\"upomp_bypay_utils_cardidfail\">银行卡卡号格式有误，应为16-19位数字。</string>\n    <string name=\"upomp_bypay_head_change\">支付方式</string>\n    <string name=\"upomp_bypay_head_user\">认证支付</string>\n    <string name=\"upomp_bypay_head_onuser\">快捷支付</string>\n    <string name=\"upomp_bypay_head_addcard\">添加银行卡</string>\n    <string name=\"upomp_bypay_head_addresult\">添加结果</string>\n    <string name=\"upomp_bypay_head_usermanage\">用户管理</string>\n    <string name=\"upomp_bypay_head_cardmanage\">管理银行卡</string>\n    <string name=\"upomp_bypay_head_changetel\">修改手机号码</string>\n    <string name=\"upomp_bypay_head_changepsw\">修改密码</string>\n    <string name=\"upomp_bypay_head_payresult\">支付结果</string>\n    <string name=\"upomp_bypay_head_registerresult\">注册结果</string>\n    <string name=\"upomp_bypay_inputtel\">请重新点击“获取”按钮，获取最新短信验证码。</string>\n    <string name=\"upomp_bypay_getmac\">请先点击“获取”按钮，获取最新短信校验码。</string>\n    <string name=\"upomp_bypay_utils_inputmacfail\">短信验证码内容有误，请重新核对短信中的6位数字验证码。</string>\n    <string name=\"upomp_bypay_no_bindcard_hint\">请添加要支付的银行卡。</string>\n    <string name=\"upomp_bypay_mobilenum\">手机号码:</string>\n    <string name=\"upomp_bypay_bindcard\">已绑定卡:</string>\n    <string name=\"upomp_bypay_bindcardlength\">张(上限10张)</string>\n    <string name=\"upomp_bypay_editinfo_oldtel\">原手机号码:</string>\n    <string name=\"upomp_bypay_editinfo_newtel\">新手机号码:</string>\n    <string name=\"upomp_bypay_firstshortmessagesecuritycode\">短信验证码:</string>\n    <string name=\"upomp_bypay_bindcard_help\">如有疑问请致电95516或访问网站http://online.unionpay.com</string>\n    <string name=\"upomp_bypay_bindcard_hint\">所添加的银行卡信息如下:</string>\n    <string name=\"upomp_bypay_card_btn1\">选择此卡支付</string>\n    <string name=\"upomp_bypay_card_btn2\">设为默认卡</string>\n    <string name=\"upomp_bypay_card_btn3\">解除绑定</string>\n    <string name=\"upomp_bypay_addcard\">添加银行卡</string>\n    <string name=\"upomp_bypay_bindcard_win\">银行卡信息添加成功!</string>\n    <string name=\"upomp_bypay_bindcard_lose\">添加失败!</string>\n    <string name=\"upomp_bypay_registeractivity_register\">用户注册</string>\n    <string name=\"upomp_bypay_utils_change_tel_mac\">短信验证码对应手机号码已更改，请重新获取对应短信验证码。</string>\n    <string name=\"upomp_bypay_ispreauth_lose\">预授权失败</string>\n    <string name=\"upomp_bypay_ispreauth_win\">预授权成功</string>\n    <string name=\"upomp_bypay_splash_cn\">Support by Bypay.Cn</string>\n    <string name=\"upomp_bypay_onuser_tel_in\">点此进入会员管理</string>\n    <string name=\"upomp_bypay_symbol\">1/2</string>\n    <string name=\"upomp_bypay_about1\">银联手机支付安全支付控件</string>\n    <string name=\"upomp_bypay_about2\">版本1.1.0</string>\n    <string name=\"upomp_bypay_about3\">客服电话: 95516</string>\n    <string name=\"upomp_bypay_about4\">中国银联股份有限公司版权所有</string>\n    <string name=\"upomp_bypay_about5\">©2002-2012</string>\n    <string name=\"upomp_bypay_about6\">上海翰鑫信息科技有限公司</string>\n    <string name=\"upomp_bypay_about7\">www.bypay.cn</string>\n    <string name=\"upomp_bypay_about8\">400-618-5516</string>\n\n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/values/upomp_styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"upomp_bypay_MyDialog\" parent=\"@android:Theme.Dialog\">\n        <item name=\"android:windowFrame\">@null</item><!--边框-->\n\t\t<item name=\"android:windowIsFloating\">true</item><!--是否浮现在activity之上-->\n\t\t<item name=\"android:windowIsTranslucent\">false</item><!--半透明-->\n\t\t<item name=\"android:windowNoTitle\">true</item><!--无标题-->\n\t\t<item name=\"android:background\">@android:color/transparent</item>\n\t\t<item name=\"android:windowBackground\">@android:color/transparent</item><!--背景透明-->\n\t\t<item name=\"android:backgroundDimEnabled\">true</item><!--模糊-->\n    </style>\n    <style name=\"Activity_MyDialog\" parent=\"@android:Theme.Dialog\">\n\t\t<item name=\"android:windowFrame\">@null</item><!--边框-->\n\t\t<item name=\"android:windowIsFloating\">true</item><!--是否浮现在activity之上-->\n\t\t<item name=\"android:windowIsTranslucent\">false</item><!--半透明-->\n\t\t<item name=\"android:windowNoTitle\">true</item><!--无标题-->\n\t\t<item name=\"android:background\">@android:color/transparent</item>\n\t\t<item name=\"android:windowBackground\">@android:color/transparent</item><!--背景透明-->\n\t\t<item name=\"android:backgroundDimEnabled\">true</item><!--模糊-->\n\t\t\n\t</style>\n     \n</resources>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/values/zsht_strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <string name=\"zsht_pay_cancel\">取消APP支付！</string>\n    <string name=\"zsht_pay_back\">返回</string>\n    <string name=\"zsht_ok\">确定</string>\n    <string name=\"zsht_360pay\">360支付</string>\n    <string name=\"zsht_password_safe_keyboard\">密码安全键盘</string>\n    <string name=\"zsht_checkout_counter\">银行卡支付</string>\n    <string name=\"zsht_back\">后退</string>\n    <string name=\"zsht_bt_get_authcode\">获取</string>\n    <string name=\"zsht_hint_id_number_input\">请输入开户身份证号</string>\n    <string name=\"zsht_id_number\">身\\u0020份\\u0020\\u0020证\\u0020号</string>\n    <string name=\"zsht_real_name\">姓\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020名</string>\n    <string name=\"zsht_real_name_input\">请输入开户姓名</string>\n    <string name=\"zsht_user_name\">姓\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020名</string>\n    <string name=\"zsht_phone_number_xml\">手\\u0020机\\u0020\\u0020号\\u0020码</string>\n    <string name=\"zsht_phone_input\">请输入手机号码</string>\n    <string name=\"zsht_authcode\">短信验证码</string>\n    <string name=\"zsht_authcode_six\">数字验证码</string>\n    <string name=\"zsht_bankcard_message_input\">请输入支付必填信息</string>\n    <string name=\"zsht_hint_bankcard_number\">银\\u0020行\\u0020\\u0020卡\\u0020号</string>\n    <string name=\"zsht_bankcard_number_input\">请输入银行卡号</string>\n    <string name=\"zsht_pay_bankcard_number\">银行卡号</string>\n    <string name=\"zsht_pay_password_six\">6位取款密码</string>\n    <string name=\"zsht_pay_password\">密\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020码</string>\n    <string name=\"zsht_read_agree\">我已经阅读并同意</string>\n    <string name=\"zsht_not_send_authcode\">200元以下支付免发短信验证码</string>\n    <string name=\"zsht_support_banks\">支持银行（借记卡）</string>\n    <string name=\"zsht_agreement\">《银行卡支付协议》</string>\n    <string name=\"zsht_bankcard_agreement\">尊敬的用户：\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020银行卡支付业务客户服务协议（以下简称“本协议”）是北京掌上汇通科技发展有限公司（以下简称“掌上汇通”）与您就掌上汇通银行卡支付服务（以下简称“本服务”）的使用等相关事项所订立的有效合约。您通过网络页面点击确认或以其他方式选择接受本协议，即表示您与掌上汇通已达成协议并同意接受本协议的全部约定内容。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020您应具有完全的民事行为能力。本公司不为无民事行为能力或限制民事行为能力人提供本服务。在接受本协议之前，请您仔细阅读本协议的全部内容。如果您不同意本协议的任意内容，或者无法准确理解掌上汇通对条款的解释，请不要进行后续操作。\\n\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020根据《中华人民共和国合同法》、《中华人民共和国电信条例》及其他有关法律、法规的规定，在平等、自愿、公平、诚信的基础上，您与本公司就银行卡支付业务的有关事宜，达成如下协议：\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020一、服务内容和服务费用\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00201、本协议项下的银行卡支付，指您在订购商品的支付环节，在支付页面输入正确的验证要素，经过发卡机构验证通过后，最终完成支付的行为。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00202、本公司向您提供的银行卡支付业务，不向您收取任何费用。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020二、您的主要权利与义务\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00201、您自愿申请使用银行卡支付业务，经本公司同意后，有权享受该服务。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00202、您对本公司业务如有疑问、建议或意见时，可拨打电话010-84229990-1108进行咨询和投诉。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00203、您保证所提供的个人资料真实、完整、有效，因您个人资料不真实、不正确、不完整等原因而发生的风险和责任由您承担。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00204、您在享受本公司提供的服务时，应当遵守本协议以及本公司不定期通过网站等渠道公布的相关业务规则等要求。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00205、您不应将本服务用于任何非法的或违反本协议的目的。您同意并保证不得利用本服务从事侵害他人利益或违法之行为，包括但不限于涉嫌洗钱、套现等不法行为。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00206、您明确同意本公司服务的合作单位，所提供的服务品质及内容由该合作单位自行负责。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00207、您应妥善保管卡、卡号、密码等与银行卡有关的一切信息。如您遗失银行卡或相关信息的，您应及时通知发卡行，以减少可能发生的损失。因您或您的授权人泄露密码、丢失银行卡等所致损失需由用户自行承担。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00208、您如使用本服务进行支付的，应当在认真确认金额后根据要求输入密码或短信验证码进行支付。您认可和同意：输入密码或短信验证码即视为用户确认交易和交易金额并已不可撤销地向掌上汇通发出指令，掌上汇通有权根据用户的该指令委托银行或第三方从用户银行卡中划扣资金给收款人。届时用户不应以未在交易单据中签名、签名不符、非本人意愿交易等原因要求掌上汇通退款或承担其他责任。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020您有权在特定交易中对特定金额以下的交易设置是否发送短信验证码，并同意承担该设置所引起的支付体验变化和后果。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00209、您在对使用本服务过程中发出指令的真实性及有效性承担全部责任；您承诺，掌上汇通依照您的指令进行操作的一切风险由您承担。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u002010、您认可交易金额数据等均以掌上汇通系统平台记录的数据为准。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020三、出现下列情况之一的，掌上汇通有权立即终止您使用掌上汇通相关服务而无需承担任何责任：\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00201、用户违反本协议的约定；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00202、用户违反掌上汇通公司网站的条款、协议、规则、通告等相关规定，而被终止提供服务的；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00203、掌上汇通认为向您提供本服务存在风险的；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00204、您的银行卡有效期届满。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020四、如因下列原因导致您无法正常使用本公司提供的手机支付服务，本公司不承担损害赔偿责任，该状况包括但不限于：\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00201、本公司指定且预先通知的系统停机维护期间；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00202、因机线设备原因以致发生错误、迟滞中断或不能传递；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00203、因台风、地震、海啸、洪水、战争、恐怖袭击等不可抗力之因素，造成本公司系统障碍不能执行业务的；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00204、由于黑客攻击、相关部门技术调整或故障、网站升级的问题等原因而造成的服务中断或者延迟；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00205、由于银行本身系统问题、银行相关作业网络连线问题等因素，造成本服务无法提供；\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00206、本协议约定的其他本公司不承担赔偿责任的情况。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020五、协议的变更与终止\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00201、本协议内容包括协议正文及所有掌上汇通已经发布的或将来可能发布的掌上汇通服务的使用规则。所有规则为本协议不可分割的一部分，与协议正文具有相同法律效力。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00202、本公司有权在必要时修改或变更本协议内容，并将通过本公司网站公布最新的服务协议，不另作个別通知。若您在本协议内容发生修订后，继续使用本服务的，则视为您同意最新修订的协议内容；否则您须立即停止使用本服务。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00203、如遇国家政策调整，本公司有权终止本协议，因该种情况终止本协议的，本公司不承担违约责任。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020六、协议的适用法律及争议解决方式\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00201、本协议适用中华人民共和国法律。\\n\n\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u0020\\u00202、凡因本协议引起的或与本协议有关的任何争议，应通过协商解决；协商不成的，任何一方均可向本公司住所地人民法院提起诉讼。\\n\n    </string>\n    <string name=\"zsht_agreement_title\">银行卡支付业务客户服务协议</string>\n    <string name=\"zsht_bt_item_text\">0</string>\n    \n</resources>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/ForRes/values/zsht_styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <!-- 背景布局样式 -->\n    <style name=\"zsht_BackgroundScrollViewStyle\">\n        <item name=\"android:background\">#ffffff</item>\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">fill_parent</item>\n    </style>\n\n    <!-- 最外层布局样式 -->\n    <style name=\"zsht_OutmostLinearLayoutStyle\">\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">fill_parent</item>\n        <item name=\"android:orientation\">vertical</item>\n    </style>\n    <!-- title Back样式 -->\n    <style name=\"zsht_TitleBackButtonStyle\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">26dip</item>\n        <item name=\"android:layout_gravity\">left|center_vertical</item>\n        <item name=\"android:layout_marginLeft\">5.0dip</item>\n        <item name=\"android:paddingLeft\">7.0dip</item>\n        <item name=\"android:paddingRight\">7.0dip</item>\n        <item name=\"android:background\">@drawable/zsht_back_style</item>\n        <item name=\"android:gravity\">center</item>\n        <item name=\"android:text\">@string/zsht_back</item>\n        <item name=\"android:textColor\">@android:color/white</item>\n        <item name=\"android:textSize\">14sp</item>\n    </style>\n\n    <!-- title 图片和字体样式 -->\n    <style name=\"zsht_TitleTextStyle\">\n        <item name=\"android:orientation\">horizontal</item>\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_gravity\">center</item>\n    </style>\n\n    <!-- title image样式 -->\n    <style name=\"zsht_TitleImageStyle\">\n        <item name=\"android:layout_width\">20dip</item>\n        <item name=\"android:layout_height\">20dip</item>\n        <item name=\"android:layout_gravity\">center_vertical</item>\n        <item name=\"android:background\">@drawable/zsht_title_image</item>\n    </style>\n\n    <!-- title字体样式 -->\n    <style name=\"zsht_TitleTextViewStyle\">\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_marginLeft\">2.0dip</item>\n        <item name=\"android:gravity\">center_vertical</item>\n        <item name=\"android:textColor\">@android:color/white</item>\n        <item name=\"android:textSize\">16dip</item>\n        <item name=\"android:textStyle\">normal</item>\n        <item name=\"android:text\">@string/zsht_360pay</item>\n    </style>\n\n    <!-- title 整体样式 -->\n    <style name=\"zsht_TitleStyle\">\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">30dip</item>\n    </style>\n    <!-- title背景样式 -->\n    <style name=\"zsht_TitleBackgroundStyle\">\n        <item name=\"android:background\">@drawable/zsht_title</item>\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">fill_parent</item>\n    </style>\n\n    <!-- title隐藏黑条样式 -->\n    <style name=\"zsht_InvisibleLineStyle\">\n        <item name=\"android:background\">@android:color/black</item>\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">10.0dip</item>\n    </style>\n\n    <!-- title layout样式 -->\n    <style name=\"zsht_TitleLayoutStyle\">\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">fill_parent</item>\n    </style>\n    <!-- title framLayout样式 -->\n    <style name=\"zsht_TitleFramLayoutStyle\">\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_centerVertical\">true</item>\n    </style>\n\n    <!-- 商品信息布局样式 -->\n    <style name=\"zsht_OrderLayoutStyle\">\n        <item name=\"android:layout_gravity\">center_horizontal</item>\n        <item name=\"android:orientation\">vertical</item>\n        <item name=\"android:background\">@drawable/zsht_order_message</item>\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_marginLeft\">10.0dip</item>\n        <item name=\"android:layout_marginRight\">10.0dip</item>\n        <item name=\"android:layout_marginTop\">5.0dip</item>\n    </style>\n\n    <!-- 商品信息字体样式 -->\n    <style name=\"zsht_OrderInfoTextViewStyle\">\n        <item name=\"android:paddingLeft\">5.0dip</item>\n        <item name=\"android:textColor\">@android:color/black</item>\n        <item name=\"android:textSize\">20sp</item>\n        <item name=\"android:layout_marginTop\">2.0dip</item>\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:textStyle\">bold|normal</item>\n    </style>\n\n    <!-- 商品信息分割线样式 -->\n    <style name=\"zsht_OrderInfoLineStyle\">\n        <item name=\"android:paddingLeft\">5.0dip</item>\n        <item name=\"android:paddingRight\">5.0dip</item>\n        <item name=\"android:background\">@drawable/zsht_line</item>\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_marginTop\">3.0dip</item>\n    </style>\n\n    <!-- 商品金额字体样式 -->\n    <style name=\"zsht_OrderAmtTextViewStyle\">\n        <item name=\"android:paddingLeft\">5.0dip</item>\n        <item name=\"android:textColor\">@android:color/darker_gray</item>\n        <item name=\"android:textSize\">16sp</item>\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_marginTop\">3.0dip</item>\n        <item name=\"android:layout_marginBottom\">2.0dip</item>\n    </style>\n\n    <!-- 输入框布局样式 -->\n    <style name=\"zsht_InputLayoutStyle\">\n        <item name=\"android:orientation\">horizontal</item>\n        <item name=\"android:addStatesFromChildren\">true</item>\n        <item name=\"android:background\">@drawable/zsht_input_style</item>\n        <item name=\"android:paddingTop\">0.0dip</item>\n        <item name=\"android:paddingBottom\">0.0dip</item>\n        <item name=\"android:paddingLeft\">2.0dip</item>\n        <item name=\"android:paddingRight\">0.0dip</item>\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">40.0dip</item>\n        <item name=\"android:layout_marginLeft\">10.0dip</item>\n        <item name=\"android:layout_marginTop\">5.0dip</item>\n        <item name=\"android:layout_marginRight\">10.0dip</item>\n    </style>\n\n    <!-- 输入框title样式 -->\n    <style name=\"zsht_InputTitleStyle\">\n        <item name=\"android:layout_gravity\">center_vertical</item>\n        <item name=\"android:gravity\">center_vertical</item>\n        <item name=\"android:layout_width\">wrap_content</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:paddingLeft\">5.0dip</item>\n        <item name=\"android:textColor\">@android:color/black</item>\n        <item name=\"android:textSize\">16.0sp</item>\n    </style>\n\n    <!-- 输入框EditText样式 -->\n    <style name=\"zsht_InputEditTextStyle\">\n        <item name=\"android:textColor\">@android:color/black</item>\n        <item name=\"android:layout_gravity\">center_vertical</item>\n        <item name=\"android:gravity\">center_vertical</item>\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">wrap_content</item>\n        <item name=\"android:layout_marginLeft\">7.0dip</item>\n        <item name=\"android:layout_marginRight\">0.0dip</item>\n        <item name=\"android:background\">@null</item>\n        <item name=\"android:saveEnabled\">true</item>\n        <item name=\"android:singleLine\">true</item>\n        <item name=\"android:textSize\">16.0sp</item>\n    </style>\n\n    <style name=\"zsht_ConfirmButtonStyle\">\n        <item name=\"android:layout_width\">fill_parent</item>\n        <item name=\"android:layout_height\">45dip</item>\n        <item name=\"android:layout_marginLeft\">10.0dip</item>\n        <item name=\"android:layout_marginRight\">10.0dip</item>\n        <item name=\"android:layout_marginTop\">10.0dip</item>\n        <item name=\"android:layout_marginBottom\">10.0dip</item>\n        <item name=\"android:background\">@drawable/zsht_button_style</item>\n        <item name=\"android:gravity\">center</item>\n        <item name=\"android:text\">@string/zsht_ok</item>\n        <item name=\"android:textColor\">@android:color/white</item>\n        <item name=\"android:textSize\">18.0sp</item>\n        <item name=\"android:textStyle\">bold</item>\n    </style>\n    <!-- activity样式 -->\n    <style name=\"dialogAct\" parent=\"@android:style/Theme.Dialog\">\n        <item name=\"android:windowFrame\">@null</item>\n        <item name=\"android:windowIsFloating\">true</item>\n        <item name=\"android:windowIsTranslucent\">false</item>\n        <item name=\"android:windowNoTitle\">true</item>\n        <item name=\"android:windowBackground\">@null</item>\n        <item name=\"android:backgroundDimEnabled\">false</item>\n    </style>\n    \n    <style name=\"FloatingWindowStyle\">\n        <item name=\"android:windowBackground\">@android:color/transparent</item>\n        <item name=\"android:windowNoTitle\">true</item>\n        <item name=\"android:windowIsFloating\">true</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginQH360\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-17\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/IAPOnlineQH360.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\nimport org.json.JSONObject;\n\nimport com.qihoo.gamecenter.sdk.common.IDispatcherCallback;\nimport com.qihoo.gamecenter.sdk.protocols.pay.ProtocolConfigs;\nimport com.qihoo.gamecenter.sdk.protocols.pay.ProtocolKeys;\nimport com.qihoopay.insdk.activity.ContainerActivity;\nimport com.qihoopay.insdk.matrix.Matrix;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.util.Log;\n\npublic class IAPOnlineQH360 implements InterfaceIAP {\n\n    private static final String LOG_TAG = \"IAPOnlineQH360\";\n    private static Activity mContext = null;\n    private static IAPOnlineQH360 mAdapter = null;\n    private static boolean bDebug = false;\n\n    private static String mAppName = null;\n    private static String mExchangeRate = null;\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(LOG_TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    protected static void LogD(String msg) {\n        if (bDebug) {\n            Log.d(LOG_TAG, msg);\n        }\n    }\n\n    public IAPOnlineQH360(Context context) {\n        mContext = (Activity) context;\n        mAdapter = this;\n    }\n\n    @Override\n    public void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n        try {\n            mAppName = cpInfo.get(\"QHAppName\");\n            mExchangeRate = cpInfo.get(\"QHExchangeRate\");\n        } catch (Exception e) {\n            LogE(\"Developer info error\", e);\n        }\n\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                QH360Wrapper.initSDK(mContext);\n            }\n        });\n    }\n\n    @Override\n    public void payForProduct(Hashtable<String, String> info) {\n        LogD(\"payForProduct invoked \" + info.toString());\n        final Hashtable<String, String> curInfo = info;\n        PluginWrapper.runOnMainThread(new Runnable() {\n\n            @Override\n            public void run() {\n                try {\n                    Intent intent = getPayIntent(curInfo);\n                    Matrix.invokeActivity(mContext, intent, new IDispatcherCallback() {\n                        @Override\n                        public void onFinished(String data) {\n                            LogD(\"mPayCallback, data is \" + data);\n                            JSONObject jsonRes;\n                            try {\n                                jsonRes = new JSONObject(data);\n                                int errorCode = jsonRes.getInt(\"error_code\");\n                                String errorMsg = jsonRes.getString(\"error_msg\");\n                                int retCode = IAPWrapper.PAYRESULT_FAIL;\n                                switch (errorCode) {\n                                case 0:\n                                    // Success \n                                    retCode = IAPWrapper.PAYRESULT_SUCCESS;\n                                    break;\n                                case 1:\n                                    // Fail \n                                    retCode = IAPWrapper.PAYRESULT_FAIL;\n                                    break;\n                                case -1:\n                                    // cancel \n                                    retCode = IAPWrapper.PAYRESULT_CANCEL;\n                                    break;\n                                case -2:\n                                    // paying \n                                    retCode = IAPWrapper.PAYRESULT_SUCCESS;\n                                    break;\n                                default:\n                                    break;\n                                }\n\n                                IAPOnlineQH360.payResult(retCode, errorMsg);\n                            } catch (Exception e) {\n                                IAPOnlineQH360.payResult(IAPWrapper.PAYRESULT_FAIL, \"Unkonw Error\");\n                                LogE(\"Error when parse the result data!\", e);\n                            }\n                        }\n                    });\n                } catch (Exception e) {\n                    IAPOnlineQH360.payResult(IAPWrapper.PAYRESULT_FAIL, \"Unkonw Error\");\n                    LogE(\"Unknow Error!\", e);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void setDebugMode(boolean debug) {\n        bDebug = debug;\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return QH360Wrapper.getSDKVersion();\n    }\n\n    private static void payResult(int ret, String msg) {\n        IAPWrapper.onPayResult(mAdapter, ret, msg);\n        LogD(\"IAPOnlineQH360 result : \" + ret + \" msg : \" + msg);\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return \"0.2.0\";\n    }\n\n    private Intent getPayIntent(Hashtable<String, String> pInfo) {\n        Bundle bundle = new Bundle();\n        bundle.putBoolean(ProtocolKeys.IS_SCREEN_ORIENTATION_LANDSCAPE, QH360Wrapper.isLandscape(mContext));\n\n        // required params : accesstoken, userid, \n        bundle.putString(ProtocolKeys.ACCESS_TOKEN, pInfo.get(\"QHAccessToken\")); \n        bundle.putString(ProtocolKeys.QIHOO_USER_ID, pInfo.get(\"QHUserId\"));\n\n        String strPrice = pInfo.get(\"productPrice\");\n        float fPrice = Float.parseFloat(strPrice);\n        int nPrice = (int) (fPrice * 100);\n        bundle.putString(ProtocolKeys.AMOUNT, \"\" + nPrice);\n        bundle.putString(ProtocolKeys.RATE, mExchangeRate);\n        bundle.putString(ProtocolKeys.PRODUCT_NAME, pInfo.get(\"productName\"));\n        bundle.putString(ProtocolKeys.PRODUCT_ID, pInfo.get(\"QHProductID\"));\n        bundle.putString(ProtocolKeys.NOTIFY_URI, pInfo.get(\"QHNotifyUri\"));\n        bundle.putString(ProtocolKeys.APP_NAME, mAppName);\n        bundle.putString(ProtocolKeys.APP_USER_NAME, pInfo.get(\"QHUserName\"));\n        bundle.putString(ProtocolKeys.APP_USER_ID, pInfo.get(\"QHAppUserID\"));\n\n        // optional params : ext, app order id, pay type\n        String ext1 = pInfo.get(\"QHExtra1\");\n        if (null != ext1 && ! TextUtils.isEmpty(ext1)) {\n            bundle.putString(ProtocolKeys.APP_EXT_1, ext1);\n        }\n        String ext2 = pInfo.get(\"QHExtra2\");\n        if (null != ext2 && ! TextUtils.isEmpty(ext2)) {\n            bundle.putString(ProtocolKeys.APP_EXT_2, ext2);\n        }\n        String appOrderId = pInfo.get(\"QHAppOrderID\");\n        if (null != appOrderId && ! TextUtils.isEmpty(appOrderId)) {\n            bundle.putString(ProtocolKeys.APP_ORDER_ID, appOrderId);\n        }\n\n        bundle.putInt(ProtocolKeys.FUNCTION_CODE, ProtocolConfigs.FUNC_CODE_PAY); \n        Intent intent = new Intent(mContext, ContainerActivity.class); intent.putExtras(bundle);\n        return intent;\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport org.json.JSONObject;\n\nimport com.qihoo.gamecenter.sdk.common.IDispatcherCallback;\nimport com.qihoo.gamecenter.sdk.protocols.pay.ProtocolConfigs;\nimport com.qihoo.gamecenter.sdk.protocols.pay.ProtocolKeys;\nimport com.qihoopay.insdk.activity.ContainerActivity;\nimport com.qihoopay.insdk.matrix.Matrix;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.res.Configuration;\nimport android.os.Bundle;\n\npublic class QH360Wrapper {\n\n    private static boolean mInited = false;\n    public static void initSDK(Context ctx) {\n        if (mInited) {\n            return;\n        }\n\n        Matrix.init((Activity) ctx, isLandscape(ctx), new IDispatcherCallback() {\n            @Override\n            public void onFinished(String data) {\n                mInited = true;\n            }\n        });\n    }\n\n    public static String getSDKVersion() {\n        return \"0.7.6\";\n    }\n\n    public static boolean isLandscape(Context ctx)\n    {\n        Configuration config = ctx.getResources().getConfiguration();\n        int orientation = config.orientation;\n\n        if (orientation != Configuration.ORIENTATION_LANDSCAPE &&\n            orientation != Configuration.ORIENTATION_PORTRAIT)\n        {\n            orientation = Configuration.ORIENTATION_PORTRAIT;\n        }\n\n        return (orientation == Configuration.ORIENTATION_LANDSCAPE);\n    }\n\n    private static boolean mLogined = false;\n    private static String mAuthCode = \"\";\n    public static void userLogin(Context ctx, IDispatcherCallback callback) {\n        if (mLogined) {\n            return;\n        }\n\n        final Context curCtx = ctx;\n        final IDispatcherCallback curCallback = callback;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                Bundle bundle = new Bundle();\n                bundle.putBoolean(ProtocolKeys.IS_SCREEN_ORIENTATION_LANDSCAPE, isLandscape(curCtx));\n                bundle.putBoolean(ProtocolKeys.IS_LOGIN_BG_TRANSPARENT, true);\n                bundle.putString(ProtocolKeys.RESPONSE_TYPE, \"code\");\n                bundle.putInt(ProtocolKeys.FUNCTION_CODE, ProtocolConfigs.FUNC_CODE_LOGIN);\n                Intent intent = new Intent(curCtx, ContainerActivity.class);\n                intent.putExtras(bundle);\n\n                Matrix.invokeActivity(curCtx, intent, new IDispatcherCallback() {\n                    @Override\n                    public void onFinished(String data) {\n                        if (null == data) {\n                            mLogined = false;\n                            mAuthCode = \"\";\n                            curCallback.onFinished(data);\n                            return;\n                        }\n        \n                        String retStr = \"Unknown Error\";\n                        try {\n                            JSONObject json = new JSONObject(data);\n                            int errCode = json.optInt(\"error_code\");\n                            switch (errCode) {\n                            case 0:\n                                {\n                                    mLogined = true;\n                                    JSONObject content = json.optJSONObject(\"data\");\n                                    mAuthCode = content.optString(\"code\");\n                                    retStr = \"\";\n                                }\n                                break;\n                            default:\n                                mLogined = false;\n                                mAuthCode = \"\";\n                                retStr = \"Login Failed\";\n                                break;\n                            }\n                        } catch (Exception e) {\n                            mLogined = false;\n                            mAuthCode = \"\";\n                            retStr = \"Unknow Error\";\n                            e.printStackTrace();\n                        } finally {\n                            curCallback.onFinished(retStr);\n                        }\n                    }\n                });\n            }\n        });\n    }\n\n    public static void userLogout(Context ctx, IDispatcherCallback callback) {\n        final Context curCtx = ctx;\n        final IDispatcherCallback curCallback = callback;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                Bundle bundle = new Bundle();\n                bundle.putBoolean(ProtocolKeys.IS_SCREEN_ORIENTATION_LANDSCAPE, isLandscape(curCtx));\n                bundle.putInt(ProtocolKeys.FUNCTION_CODE, ProtocolConfigs.FUNC_CODE_QUIT);\n                Intent intent = new Intent(curCtx, ContainerActivity.class);\n                intent.putExtras(bundle);\n\n                Matrix.invokeActivity(curCtx, intent, new IDispatcherCallback() {\n                    @Override\n                    public void onFinished(String data) {\n                        if (null == data) {\n                            mAuthCode = \"\";\n                            mLogined = false;\n                        }\n                        curCallback.onFinished(data);\n                    }\n                });\n            }\n        });\n    }\n\n    public static boolean isLogined() {\n        return mLogined;\n    }\n\n    public static String getAuthCode() {\n        return mAuthCode;\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/UserQH360.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\nimport com.qihoo.gamecenter.sdk.common.IDispatcherCallback;\n\nimport android.content.Context;\nimport android.text.TextUtils;\nimport android.util.Log;\n\npublic class UserQH360 implements InterfaceUser {\n\n    private static Context mContext = null;\n    protected static String TAG = \"UserQH360\";\n    private static InterfaceUser mAdapter = null;\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    private static boolean isDebug = false;\n    protected static void LogD(String msg) {\n        if (isDebug) {\n            Log.d(TAG, msg);\n        }\n    }\n\n    public UserQH360(Context context) {\n        mContext = context;\n        mAdapter = this;\n\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                QH360Wrapper.initSDK(mContext);\n            }\n        });\n    }\n\n    @Override\n    public void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n        LogD(\"Developer info should configed in AndroidManifest.xml\");\n    }\n\n    @Override\n    public void login() {\n        if (isLogined()) {\n            UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_SUCCEED, \"Already logined!\");\n            return;\n        }\n\n        QH360Wrapper.userLogin(mContext, new IDispatcherCallback() {\n            @Override\n            public void onFinished(String data) {\n                LogD(\"Login callback data is \" + data);\n\n                if (null == data) {\n                    UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_FAILED, \"User Canceled\");\n                } else \n                if (TextUtils.isEmpty(data)) {\n                    UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_SUCCEED, \"Login Succeed\");\n                } else {\n                    UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_FAILED, data);\n                }\n            }\n        });\n    }\n\n    @Override\n    public void logout() {\n        if (! isLogined()) {\n            LogD(\"User not logined!\");\n            return;\n        }\n\n        QH360Wrapper.userLogout(mContext, new IDispatcherCallback() {\n            @Override\n            public void onFinished(String data) {\n                LogD(\"Logout callback data is \" + data);\n                if (null == data) {\n                    UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGOUT_SUCCEED, \"User Logout\");\n                }\n            }\n        });\n    }\n\n    @Override\n    public boolean isLogined() {\n        return QH360Wrapper.isLogined();\n    }\n\n    @Override\n    public String getSessionID() {\n        LogD(\"getSessionID() \" + QH360Wrapper.getAuthCode());\n        return QH360Wrapper.getAuthCode();\n    }\n\n    @Override\n    public void setDebugMode(boolean debug) {\n        isDebug = debug;\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return \"0.2.0\";\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return QH360Wrapper.getSDKVersion();\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/signpost-commonshttp4-1.2.1.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/signpost-core-1.2.1.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/signpost-jetty6-1.2.1.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/twitter4j-core-android-3.0.1.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginTwitter</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libSocialTwitter\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.INTERNET\" />\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n    </permissionCfg>\n</manifestConfig> \n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginSocialTwitter\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/Consts.java",
    "content": "package org.cocos2dx.plugin;\n\npublic interface Consts {\n\tpublic static int EGETTING_ACCESS_TOKEN =0;\n\tpublic static int EUSER_CANCELED = 1;\n\tpublic static int EGETTING_REQUEST_TOKEN=2;\n\tpublic static int EFAILED_OPENING_AUTHORIZATION_PAGE=3;\n\tpublic static int EPAGE_ERROR =4;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/ShareTwitter.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\nimport org.cocos2dx.plugin.TwitterApp.TwDialogListener;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.net.ConnectivityManager;\nimport android.net.NetworkInfo;\nimport android.util.Log;\n\npublic class ShareTwitter implements InterfaceShare {\n\n\tprivate static final String LOG_TAG = \"ShareTwitter\";\n\tprivate static Activity mContext = null;\n\tprivate static InterfaceShare mShareAdapter = null;\n\tprotected static boolean bDebug = false;\n\tprivate static String CONSUMER_KEY=\"\";\n\tprivate static String CONSUMER_SECRET=\"\";\n\t\n\tprivate static TwitterApp mTwitter = null;\n\tprivate static boolean isInitialized = false;\n\tprivate static Hashtable<String, String> mShareInfo = null;\n\t\n\tpublic static String KEY_TEXT=\"SharedText\";\n\tpublic static String KEY_IMAGE_PATH = \"SharedImagePath\";\n\n\tprotected static void LogE(String msg, Exception e) {\n\t\tLog.e(LOG_TAG, msg, e);\n\t\te.printStackTrace();\n\t}\n\n\tprotected static void LogD(String msg) {\n\t\tif (bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n\n\tpublic ShareTwitter(Context context) {\n\t\tmContext = (Activity) context;\n\t\tmShareAdapter = this;\n\t}\n\t\n\n\t@Override\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n\t\tLogD(\"initDeveloperInfo invoked \" + cpInfo.toString());\n\t\ttry {\n\t\t\tShareTwitter.CONSUMER_KEY = cpInfo.get(\"TwitterKey\");\n\t\t\tShareTwitter.CONSUMER_SECRET = cpInfo.get(\"TwitterSecret\");\n\t\t\tLogD(\"key : \" + ShareTwitter.CONSUMER_KEY);\n\t\t\tLogD(\"secret : \" + ShareTwitter.CONSUMER_SECRET);\n\t\t\tif(isInitialized){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tisInitialized = true;\t\n\t\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmTwitter =  new TwitterApp(PluginWrapper.getContext(), ShareTwitter.CONSUMER_KEY, ShareTwitter.CONSUMER_SECRET);\n\t\t\t\t\tmTwitter.setListener(mTwLoginDialogListener);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Developer info is wrong!\", e);\n\t\t}\n\n\t}\n\n\t@Override\n\tpublic void share(Hashtable<String, String> info) {\n\t\tLogD(\"share invoked \" + info.toString());\n\t\tmShareInfo =  info;\n\t\tif (! networkReachable()) {\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"Network error!\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (! isInitialized) {\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"Initialize failed!\");\n\t\t\treturn;\n\t\t}\n\n\t\t// need login\n\t\tif(!mTwitter.hasAccessToken()){\n\t\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmTwitter.authorize();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tShareTwitter.sendToTwitter();\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void setDebugMode(boolean debug) {\n\t\tbDebug = debug;\n\t}\n\n\t@Override\n\tpublic String getSDKVersion() {\n\t\treturn \"Unknown version\";\n\t}\n\n\tprivate boolean networkReachable() {\n\t\tboolean bRet = false;\n\t\ttry {\n\t\t\tConnectivityManager conn = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\tNetworkInfo netInfo = conn.getActiveNetworkInfo();\n\t\t\tbRet = (null == netInfo) ? false : netInfo.isAvailable();\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Fail to check network status\", e);\n\t\t}\n\t\tLogD(\"NetWork reachable : \" + bRet);\n\t\treturn bRet;\n\t}\n\n\tprivate static void shareResult(int ret, String msg) {\n\t\tShareWrapper.onShareResult(mShareAdapter, ret, msg);\n\t\tLogD(\"ShareTwitter result : \" + ret + \" msg : \" + msg);\n\t}\n\n\tprivate static final TwDialogListener mTwLoginDialogListener = new TwDialogListener() {\n\t\t\n\t\t@Override\n\t\tpublic void onError(int flag, String value) {\n\t\t\tLogD(\"Twitter connection failed!\");\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, value);\t\t\t\n\t\t}\n\t\t\n\t\t@Override\n\t\tpublic void onComplete(String value) {\n\t\t\tShareTwitter.sendToTwitter();\n\t\t}\n\t};\n\n\tprivate static void sendToTwitter() {\n\t\tString text = mShareInfo.get(KEY_TEXT);\n\t\tString imagePath = mShareInfo.get(KEY_IMAGE_PATH);\t\t\t\t\n\t\ttry {\n\t\t\tif(imagePath != null && imagePath.length() > 0){\n\t\t\t\tmTwitter.updateStatus(text, imagePath);\n\t\t\t}else{\n\t\t\t\tmTwitter.updateStatus(text);\t\n\t\t\t}\n\t\t\tLogD(\"Posted to Twitter!\");\n\t\t\tshareResult(ShareWrapper.SHARERESULT_SUCCESS, \"Share succeed!\");\n\t\t} catch (Exception e) {\n\t\t\tLogD(\"Post to Twitter failed!\");\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"Unknown error!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\t@Override\n\tpublic String getPluginVersion() {\n\t\treturn \"0.2.0\";\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/TwitterApp.java",
    "content": "/**\n * @author Lorensius W. L. T <lorenz@londatiga.net>\n * \n * http://www.londatiga.net\n */\n\npackage org.cocos2dx.plugin;\n\nimport java.io.File;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport java.net.URLDecoder;\n\nimport oauth.signpost.OAuthProvider;\nimport oauth.signpost.basic.DefaultOAuthProvider;\nimport oauth.signpost.commonshttp.CommonsHttpOAuthConsumer;\nimport twitter4j.StatusUpdate;\nimport twitter4j.Twitter;\nimport twitter4j.TwitterException;\nimport twitter4j.TwitterFactory;\nimport twitter4j.User;\nimport twitter4j.auth.AccessToken;\nimport android.app.ProgressDialog;\nimport android.content.Context;\nimport android.os.Handler;\nimport android.os.Message;\nimport android.util.Log;\nimport android.view.Window;\n\npublic class TwitterApp {\n\tprivate Twitter mTwitter;\n\tprivate TwitterSession mSession;\n\tprivate AccessToken mAccessToken;\n\tprivate CommonsHttpOAuthConsumer mHttpOauthConsumer;\n\tprivate OAuthProvider mHttpOauthprovider;\n\tprivate String mConsumerKey;\n\tprivate String mSecretKey;\n\tprivate ProgressDialog mProgressDlg;\n\tprivate TwDialogListener mListener;\n\tprivate Context context;\n\tprivate boolean mInit = true;\n\tprivate static final String LOG_TAG = \"TwitterApp\";\n\tpublic static final String CALLBACK_URL = \"twitterapp://connect\";\n\t\n\tprotected static void LogE(String msg, Exception e) {\n\t\tLog.e(LOG_TAG, msg, e);\n\t\te.printStackTrace();\n\t}\n\n\tprotected static void LogD(String msg) {\n\t\tif (ShareTwitter.bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n\n\t\n\tpublic TwitterApp(Context context, String consumerKey, String secretKey) {\n\t\tthis.context\t= context;\n\t\t\n\t\tmTwitter = new TwitterFactory().getInstance();\n\t\tmSession\t\t= new TwitterSession(context);\n\t\tmProgressDlg\t= new ProgressDialog(context);\n\t\tmProgressDlg.setCancelable(false);\n\t\tmProgressDlg.requestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\t\n\t\tmConsumerKey \t= consumerKey;\n\t\tmSecretKey\t \t= secretKey;\n\t\n\t\tmHttpOauthConsumer = new CommonsHttpOAuthConsumer(mConsumerKey, mSecretKey);\n\t\tmHttpOauthprovider = new DefaultOAuthProvider(\"https://twitter.com/oauth/request_token\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"https://twitter.com/oauth/access_token\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"https://twitter.com/oauth/authorize\");\n\t\t\n\t\tmAccessToken\t= mSession.getAccessToken();\n\t\t\n\t\tconfigureToken();\n\t}\n\t\n\tpublic void setListener(TwDialogListener listener) {\n\t\tmListener = listener;\n\t}\n\t\n\tprivate void configureToken() {\n\t\tif (mAccessToken != null) {\n\t\t\tif (mInit) {\n\t\t\t\tmTwitter.setOAuthConsumer(mConsumerKey, mSecretKey);\n\t\t\t\tmInit = false;\n\t\t\t}\n\t\t\tmTwitter.setOAuthAccessToken(mAccessToken);\n\t\t}\n\t}\n\t\n\tpublic boolean hasAccessToken() {\n\t\treturn (mAccessToken == null) ? false : true;\n\t}\n\t\n\tpublic void resetAccessToken() {\n\t\tif (mAccessToken != null) {\n\t\t\tmSession.resetAccessToken();\n\t\t\tmAccessToken = null;\n\t\t}\n\t}\n\t\n\tpublic String getUsername() {\n\t\treturn mSession.getUsername();\n\t}\n\t\n\tpublic void updateStatus(String status) throws Exception {\n\t\ttry {\n\t\t\tmTwitter.updateStatus(status);\n\t\t} catch (TwitterException e) {\n\t\t\tthrow e;\n\t\t}\n\t}\n\t\n\tpublic void updateStatus(String status, String imagePath)  throws Exception {\n\t\tStatusUpdate update = new StatusUpdate(status);\t\n\t\tupdate.setMedia(new File(imagePath));\n\t\ttry {\t\n\t\t\tmTwitter.updateStatus(update);\n\t\t} catch (TwitterException e) {\n\t\t\tthrow e;\n\t\t}\n\t}\n\t\n\tpublic void authorize() {\n\t\tmProgressDlg.setMessage(\"Initializing ...\");\n\t\tmProgressDlg.show();\n\t\t\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString authUrl = \"\";\n\t\t\t\tint what = 1;\n\t\t\t\ttry {\n\t\t\t\t\tauthUrl = mHttpOauthprovider.retrieveRequestToken(mHttpOauthConsumer, CALLBACK_URL);\t\t\t\t\t\t\n\t\t\t\t\twhat = 0;\t\t\t\t\t\n\t\t\t\t\tLogD(\"Request token url \" + authUrl);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLogD(\"Failed to get request token\");\t\t\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\t\t\t\t\n\t\t\t\tmHandler.sendMessage(mHandler.obtainMessage(what, 1, 0, authUrl));\n\t\t\t}\n\t\t}.start();\n\t}\n\t\n\tpublic void processToken(String callbackUrl)  {\n\t\tmProgressDlg.setMessage(\"Finalizing ...\");\n\t\tmProgressDlg.show();\n\t\t\n\t\tfinal String verifier = getVerifier(callbackUrl);\n\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tint what = 1;\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tmHttpOauthprovider.retrieveAccessToken(mHttpOauthConsumer, verifier);\t\t\n\t\t\t\t\tmAccessToken = new AccessToken(mHttpOauthConsumer.getToken(), mHttpOauthConsumer.getTokenSecret());\t\t\t\t\n\t\t\t\t\tconfigureToken();\t\t\t\t\n\t\t\t\t\tUser user = mTwitter.verifyCredentials();\t\t\t\t\n\t\t\t        mSession.storeAccessToken(mAccessToken, user.getName());\t\t\t        \n\t\t\t        what = 0;\n\t\t\t\t} catch (Exception e){\n\t\t\t\t\tLogD(\"Error getting access token\");\t\t\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\t\t\t\t\n\t\t\t\tmHandler.sendMessage(mHandler.obtainMessage(what, 2, 0));\n\t\t\t}\n\t\t}.start();\n\t}\n\t\n\tprivate String getVerifier(String callbackUrl) {\n\t\tString verifier\t = \"\";\t\t\n\t\ttry {\n\t\t\tcallbackUrl = callbackUrl.replace(\"twitterapp\", \"http\");\t\t\t\n\t\t\tURL url \t\t= new URL(callbackUrl);\n\t\t\tString query \t= url.getQuery();\t\t\n\t\t\tString array[]\t= query.split(\"&\");\n\t\t\tfor (String parameter : array) {\n\t             String v[] = parameter.split(\"=\");\t             \n\t             if (URLDecoder.decode(v[0]).equals(oauth.signpost.OAuth.OAUTH_VERIFIER)) {\n\t            \t verifier = URLDecoder.decode(v[1]);\n\t            \t break;\n\t             }\n\t        }\n\t\t} catch (MalformedURLException e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\t\treturn verifier;\n\t}\n\t\n\tprivate void showLoginDialog(String url) {\n\t\tfinal TwDialogListener listener = new TwDialogListener() {\n\t\t\t@Override\n\t\t\tpublic void onComplete(String value) {\n\t\t\t\tprocessToken(value);\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onError(int flag, String value) {\n\t\t\t\tmListener.onError(Consts.EFAILED_OPENING_AUTHORIZATION_PAGE, \"Failed opening authorization page\");\n\t\t\t}\n\t\t};\n\t\t\n\t\tnew TwitterDialog(context, url, listener).show();\n\t}\n\t\n\tprivate Handler mHandler = new Handler() {\n\t\t@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tmProgressDlg.dismiss();\n\t\t\t\n\t\t\tif (msg.what == 1) {\n\t\t\t\tif (msg.arg1 == 1)\n\t\t\t\t\tmListener.onError(Consts.EGETTING_REQUEST_TOKEN, \"Error getting request token\");\n\t\t\t\telse\n\t\t\t\t\tmListener.onError(Consts.EGETTING_ACCESS_TOKEN, \"Error getting access token\");\n\t\t\t}else {\n\t\t\t\tif (msg.arg1 == 1)\n\t\t\t\t\tshowLoginDialog((String) msg.obj);\n\t\t\t\telse\n\t\t\t\t\tmListener.onComplete(\"\");\n\t\t\t}\n\t\t}\n\t};\n\t\n\tpublic interface TwDialogListener {\n\t\tpublic void onComplete(String value);\t\t\n\t\t\n\t\tpublic void onError(int flag, String value);\n\t}\n\t\n}"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/TwitterDialog.java",
    "content": "/**\n * Modified from FbDialog from Facebook SDK\n * \n * Lorensius W. L. T <lorenz@londatiga.net>\n */\npackage org.cocos2dx.plugin;\n\nimport org.cocos2dx.plugin.TwitterApp.TwDialogListener;\n\nimport android.app.Dialog;\nimport android.app.ProgressDialog;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.graphics.Bitmap;\nimport android.graphics.Color;\nimport android.graphics.Typeface;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.Display;\nimport android.view.ViewGroup;\nimport android.view.Window;\nimport android.webkit.CookieManager;\nimport android.webkit.CookieSyncManager;\nimport android.webkit.WebView;\nimport android.webkit.WebViewClient;\nimport android.widget.FrameLayout;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\npublic class TwitterDialog extends Dialog {\n    static final FrameLayout.LayoutParams FILL = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,\n                         \t\t\t\t\t\tViewGroup.LayoutParams.FILL_PARENT);\n    static final int MARGIN = 4;\n    static final int PADDING = 2;\n\n    private String mUrl;\n    private TwDialogListener mListener;\n    private ProgressDialog mSpinner;\n    private WebView mWebView;\n    private LinearLayout mContent;\n    private TextView mTitle;\n\n    private static final String LOG_TAG = \"Twitter-WebView\";\n    \n\tprotected static void LogD(String msg) {\n\t\tif (ShareTwitter.bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n    public TwitterDialog(Context context, String url, TwDialogListener listener) {\n        super(context);\n        \n        mUrl \t\t= url;\n        mListener \t= listener;\n        setOnCancelListener(mCancelListener);\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        mSpinner = new ProgressDialog(getContext());\n        \n        mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);\n        mSpinner.setMessage(\"Loading...\");\n        mSpinner.setCancelable(false);\n\n        mContent = new LinearLayout(getContext());\n        \n        mContent.setOrientation(LinearLayout.VERTICAL);\n        \n        setUpTitle();\n        setUpWebView();\n        \n        Display display = getWindow().getWindowManager().getDefaultDisplay();\n        double[] dimensions = new double[2];\n        \n        if (display.getWidth() < display.getHeight()) {\n        \tdimensions[0]\t= 0.87 * display.getWidth();\n        \tdimensions[1]\t= 0.82 * display.getHeight();\n        } else {\n        \tdimensions[0]\t= 0.75 * display.getWidth();\n        \tdimensions[1]\t= 0.75 * display.getHeight();        \n        }\n        \n        addContentView(mContent, new FrameLayout.LayoutParams((int) dimensions[0], (int) dimensions[1]));\n    }\n\n    private void setUpTitle() {\n        requestWindowFeature(Window.FEATURE_NO_TITLE);\n        \n       // Drawable icon = getContext().getResources().getDrawable(R.drawable.twitter_icon);\n        \n        mTitle = new TextView(getContext());\n        \n        mTitle.setText(\"Twitter\");\n        mTitle.setTextColor(Color.WHITE);\n        mTitle.setTypeface(Typeface.DEFAULT_BOLD);\n        mTitle.setBackgroundColor(0xFFbbd7e9);\n        mTitle.setPadding(MARGIN + PADDING, MARGIN, MARGIN, MARGIN);\n        mTitle.setCompoundDrawablePadding(MARGIN + PADDING);\n       // mTitle.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null);\n        mTitle.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);\n        \n        mContent.addView(mTitle);\n    }\n\n    private void setUpWebView() {\n    \tCookieSyncManager.createInstance(getContext()); \n        CookieManager cookieManager = CookieManager.getInstance();\n        cookieManager.removeAllCookie();\n        \n        mWebView = new WebView(getContext());\n        \n        mWebView.setVerticalScrollBarEnabled(false);\n        mWebView.setHorizontalScrollBarEnabled(false);\n        mWebView.setWebViewClient(new TwitterWebViewClient());\n        mWebView.getSettings().setJavaScriptEnabled(true);\n        mWebView.loadUrl(mUrl);\n        mWebView.setLayoutParams(FILL);\n        \n        \n        mContent.addView(mWebView);\n    }\n\n    private class TwitterWebViewClient extends WebViewClient {\n\n        @Override\n        public boolean shouldOverrideUrlLoading(WebView view, String url) {\n        \tLogD(\"Redirecting URL \" + url);\n        \t\n        \tif (url.startsWith(TwitterApp.CALLBACK_URL)) {\n        \t\tmListener.onComplete(url);\n        \t\t\n        \t\tTwitterDialog.this.dismiss();\n        \t\t\n        \t\treturn true;\n        \t}  else if (url.startsWith(\"authorize\")) {\n        \t\treturn false;\n        \t}\n        \t\n            return true;\n        }\n\n        @Override\n        public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {\n       \tLogD(\"Page error: \" + description);\n        \t\n            super.onReceivedError(view, errorCode, description, failingUrl);\n      \n            mListener.onError(Consts.EPAGE_ERROR, description);\n            \n            TwitterDialog.this.dismiss();\n        }\n\n        @Override\n        public void onPageStarted(WebView view, String url, Bitmap favicon) {\n        \tLogD(\"Loading URL: \" + url);\n            super.onPageStarted(view, url, favicon);\n            mSpinner.show();\n        }\n\n        @Override\n        public void onPageFinished(WebView view, String url) {\n            super.onPageFinished(view, url);\n            String title = mWebView.getTitle();\n            if (title != null && title.length() > 0) {\n                mTitle.setText(title);\n            }\n            mSpinner.dismiss();\n        }\n    }\n    \n    private DialogInterface.OnCancelListener mCancelListener = new OnCancelListener() {\n\t\t\n\t\t@Override\n\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\tmSpinner.dismiss();\n\t\t\tmListener.onError(Consts.EUSER_CANCELED, \"User canceled!\");\n\t\t}\n\t};\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/TwitterSession.java",
    "content": "/**\n * @author Lorensius W. L. T <lorenz@londatiga.net>\n * \n * http://www.londatiga.net\n */\npackage org.cocos2dx.plugin;\n\nimport twitter4j.auth.AccessToken;\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.content.SharedPreferences.Editor;\n\npublic class TwitterSession {\n\tprivate SharedPreferences sharedPref;\n\tprivate Editor editor;\n\t\n\tprivate static final String TWEET_AUTH_KEY = \"auth_key\";\n\tprivate static final String TWEET_AUTH_SECRET_KEY = \"auth_secret_key\";\n\tprivate static final String TWEET_USER_NAME = \"user_name\";\n\tprivate static final String SHARED = \"Twitter_Preferences\";\n\t\n\tpublic TwitterSession(Context context) {\n\t\tsharedPref \t  = context.getSharedPreferences(SHARED, Context.MODE_PRIVATE);\t\t\n\t\teditor \t\t  = sharedPref.edit();\n\t}\n\t\n\tpublic void storeAccessToken(AccessToken accessToken, String username) {\n\t\teditor.putString(TWEET_AUTH_KEY, accessToken.getToken());\n\t\teditor.putString(TWEET_AUTH_SECRET_KEY, accessToken.getTokenSecret());\n\t\teditor.putString(TWEET_USER_NAME, username);\n\t\t\n\t\teditor.commit();\n\t}\n\t\n\tpublic void resetAccessToken() {\n\t\teditor.putString(TWEET_AUTH_KEY, null);\n\t\teditor.putString(TWEET_AUTH_SECRET_KEY, null);\n\t\teditor.putString(TWEET_USER_NAME, null);\n\t\t\n\t\teditor.commit();\n\t}\n\t\n\tpublic String getUsername() {\n\t\treturn sharedPref.getString(TWEET_USER_NAME, \"\");\n\t}\n\t\n\tpublic AccessToken getAccessToken() {\n\t\tString token \t\t= sharedPref.getString(TWEET_AUTH_KEY, null);\n\t\tString tokenSecret \t= sharedPref.getString(TWEET_AUTH_SECRET_KEY, null);\n\t\t\n\t\tif (token != null && tokenSecret != null) \n\t\t\treturn new AccessToken(token, tokenSecret);\n\t\telse\n\t\t\treturn null;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/FHSTwitterEngine.h",
    "content": "//\n//  FHSTwitterEngine.h\n//  FHSTwitterEngine\n//\n//  Created by Nathaniel Symer on 8/22/12.\n//  Copyright (C) 2012 Nathaniel Symer.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n//\n//\n//  //// FHSTwitterEngine Version 1.6.1 ////\n//    Modified OAuthConsumer Version 1.2.2\n//\n//\n\n\n//\n// FHSTwitterEngine\n// The synchronous Twitter engine that doesn’t suck!!\n//\n\n// FHSTwitterEngine is Synchronous\n// That means you will have to thread. Boo Hoo.\n\n// Setup\n// Just add the FHSTwitterEngine folder to you project.\n\n// USAGE\n// See README.markdown\n\n//\n// NOTE TO CONTRIBUTORS\n// Use NSJSONSerialization with removeNull(). Life is easy that way.\n//\n\n\n#import <Foundation/Foundation.h>\n\n// These are for the dispatch_async() calls that you use to get around the synchronous-ness\n#define GCDBackgroundThread dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)\n#define GCDMainThread dispatch_get_main_queue()\n\n// oEmbed align modes\ntypedef enum {\n    FHSTwitterEngineAlignModeLeft,\n    FHSTwitterEngineAlignModeRight,\n    FHSTwitterEngineAlignModeCenter,\n    FHSTwitterEngineAlignModeNone\n} FHSTwitterEngineAlignMode;\n\n// Image sizes\ntypedef enum {\n    FHSTwitterEngineImageSizeMini, // 24px by 24px\n    FHSTwitterEngineImageSizeNormal, // 48x48\n    FHSTwitterEngineImageSizeBigger, // 73x73\n    FHSTwitterEngineImageSizeOriginal // original size of image\n} FHSTwitterEngineImageSize;\n\ntypedef enum {\n    FHSTwitterEngineResultTypeMixed,\n    FHSTwitterEngineResultTypeRecent,\n    FHSTwitterEngineResultTypePopular\n} FHSTwitterEngineResultType;\n\n// Remove NSNulls from NSDictionary and NSArray\n// Credit for this function goes to Conrad Kramer\nid removeNull(id rootObject);\n\nextern NSString * const FHSProfileBackgroundColorKey;\nextern NSString * const FHSProfileLinkColorKey;\nextern NSString * const FHSProfileSidebarBorderColorKey;\nextern NSString * const FHSProfileSidebarFillColorKey;\nextern NSString * const FHSProfileTextColorKey;\n\nextern NSString * const FHSProfileNameKey;\nextern NSString * const FHSProfileURLKey;\nextern NSString * const FHSProfileLocationKey;\nextern NSString * const FHSProfileDescriptionKey;\n\n@protocol FHSTwitterEngineAccessTokenDelegate <NSObject>\n\n- (void)storeAccessToken:(NSString *)accessToken;\n- (NSString *)loadAccessToken;\n\n@end\n\n@class OAToken;\n@class OAConsumer;\n@class OAMutableURLRequest;\n\n@interface FHSTwitterEngine : NSObject <UIWebViewDelegate>\n\n//\n// REST API\n//\n\n// statuses/update\n- (NSError *)postTweet:(NSString *)tweetString;\n- (NSError *)postTweet:(NSString *)tweetString inReplyTo:(NSString *)inReplyToString;\n\n// statuses/home_timeline\n- (id)getHomeTimelineSinceID:(NSString *)sinceID count:(int)count;\n\n// help/test\n- (id)testService;\n\n// blocks/create\n- (NSError *)block:(NSString *)username;\n\n// blocks/destroy\n- (NSError *)unblock:(NSString *)username;\n\n// users/lookup\n- (id)lookupUsers:(NSArray *)users areIDs:(BOOL)areIDs;\n\n// users/search\n- (id)searchUsersWithQuery:(NSString *)q andCount:(int)count;\n\n// account/update_profile_image\n- (NSError *)setProfileImageWithImageAtPath:(NSString *)file;\n- (NSError *)setProfileImageWithImageData:(NSData *)data;\n\n// account/settings GET and POST\n// See FHSTwitterEngine.m For details\n- (id)getUserSettings;\n- (NSError *)updateSettingsWithDictionary:(NSDictionary *)settings;\n\n// account/update_profile\n// See FHSTwitterEngine.m for details\n- (NSError *)updateUserProfileWithDictionary:(NSDictionary *)settings;\n\n// account/update_profile_background_image\n- (NSError *)setProfileBackgroundImageWithImageData:(NSData *)data tiled:(BOOL)isTiled;\n- (NSError *)setProfileBackgroundImageWithImageAtPath:(NSString *)file tiled:(BOOL)isTiled;\n- (NSError *)setUseProfileBackgroundImage:(BOOL)shouldUseProfileBackgroundImage;\n\n// account/update_profile_colors\n// See FHSTwitterEngine.m for details\n// If the dictionary is nil, FHSTwitterEngine resets the values\n- (NSError *)updateProfileColorsWithDictionary:(NSDictionary *)dictionary;\n\n// account/rate_limit_status\n- (id)getRateLimitStatus;\n\n// favorites/create, favorites/destroy\n- (NSError *)markTweet:(NSString *)tweetID asFavorite:(BOOL)flag;\n\n// favorites/list\n- (id)getFavoritesForUser:(NSString *)user isID:(BOOL)isID andCount:(int)count;\n- (id)getFavoritesForUser:(NSString *)user isID:(BOOL)isID andCount:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID;\n\n// account/verify_credentials\n- (id)verifyCredentials;\n\n// friendships/create\n- (NSError *)followUser:(NSString *)user isID:(BOOL)isID;\n\n// friendships/destroy\n- (NSError *)unfollowUser:(NSString *)user isID:(BOOL)isID;\n\n// friendships/lookup\n- (id)lookupFriendshipStatusForUsers:(NSArray *)users areIDs:(BOOL)areIDs;\n\n// friendships/incoming\n- (id)getPendingIncomingFollowers;\n\n// friendships/outgoing\n- (id)getPendingOutgoingFollowers;\n\n// friendships/update\n- (NSError *)enableRetweets:(BOOL)enableRTs andDeviceNotifs:(BOOL)devNotifs forUser:(NSString *)user isID:(BOOL)isID;\n\n// friendships/no_retweet_ids\n- (id)getNoRetweetIDs;\n\n// help/tos\n- (id)getTermsOfService;\n\n// help/privacy\n- (id)getPrivacyPolicy;\n\n// direct_messages\n- (id)getDirectMessages:(int)count;\n\n// direct_messages/destroy\n- (NSError *)deleteDirectMessage:(NSString *)messageID;\n\n// direct_messages/sent\n- (id)getSentDirectMessages:(int)count;\n\n// direct_messages/new\n- (NSError *)sendDirectMessage:(NSString *)body toUser:(NSString *)user isID:(BOOL)isID;\n\n// direct_messages/show\n- (id)showDirectMessage:(NSString *)messageID;\n\n// users/report_spam\n- (NSError *)reportUserAsSpam:(NSString *)user isID:(BOOL)isID;\n\n// help/configuration\n- (id)getConfiguration;\n\n// help/languages\n- (id)getLanguages;\n\n// blocks/blocking/ids\n- (id)listBlockedIDs;\n\n// blocks/blocking\n- (id)listBlockedUsers;\n\n// blocks/exists\n- (id)authenticatedUserIsBlocking:(NSString *)user isID:(BOOL)isID;\n\n// users/profile_image\n- (id)getProfileImageForUsername:(NSString *)username andSize:(FHSTwitterEngineImageSize)size;\n\n// statuses/user_timeline\n- (id)getTimelineForUser:(NSString *)user isID:(BOOL)isID count:(int)count;\n- (id)getTimelineForUser:(NSString *)user isID:(BOOL)isID count:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID;\n\n// statuses/retweet\n- (NSError *)retweet:(NSString *)identifier;\n\n// statuses/oembed\n- (id)oembedTweet:(NSString *)identifier maxWidth:(float)maxWidth alignmentMode:(FHSTwitterEngineAlignMode)alignmentMode;\n\n// statuses/show\n- (id)getDetailsForTweet:(NSString *)identifier;\n\n// statuses/destroy\n- (NSError *)destroyTweet:(NSString *)identifier;\n\n// statuses/update_with_media\n- (NSError *)postTweet:(NSString *)tweetString withImageData:(NSData *)theData;\n- (NSError *)postTweet:(NSString *)tweetString withImageData:(NSData *)theData inReplyTo:(NSString *)irt;\n\n// statuses/mentions_timeline\n- (id)getMentionsTimelineWithCount:(int)count;\n- (id)getMentionsTimelineWithCount:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID;\n\n// statuses/retweets_of_me\n- (id)getRetweetedTimelineWithCount:(int)count;\n- (id)getRetweetedTimelineWithCount:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID;\n\n// statuses/retweets\n- (id)getRetweetsForTweet:(NSString *)identifier count:(int)count;\n\n// lists/list\n- (id)getListsForUser:(NSString *)user isID:(BOOL)isID;\n\n// lists/statuses\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count;\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID;\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count excludeRetweets:(BOOL)excludeRetweets excludeReplies:(BOOL)excludeReplies;\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID excludeRetweets:(BOOL)excludeRetweets excludeReplies:(BOOL)excludeReplies;\n\n// lists/members/create_all\n- (NSError *)addUsersToListWithID:(NSString *)listID users:(NSArray *)users;\n\n// lists/members/destroy_all\n- (NSError *)removeUsersFromListWithID:(NSString *)listID users:(NSArray *)users;\n\n// lists/members\n- (id)listUsersInListWithID:(NSString *)listID;\n\n// lists/update\n- (NSError *)setModeOfListWithID:(NSString *)listID toPrivate:(BOOL)isPrivate;\n- (NSError *)changeNameOfListWithID:(NSString *)listID toName:(NSString *)newName;\n- (NSError *)changeDescriptionOfListWithID:(NSString *)listID toDescription:(NSString *)newName;\n\n// lists/show\n- (id)getListWithID:(NSString *)listID;\n\n// lists/create\n- (NSError *)createListWithName:(NSString *)name isPrivate:(BOOL)isPrivate description:(NSString *)description;\n\n// tweets/search\n- (id)searchTweetsWithQuery:(NSString *)q count:(int)count resultType:(FHSTwitterEngineResultType)resultType unil:(NSDate *)untilDate sinceID:(NSString *)sinceID maxID:(NSString *)maxID;\n\n// followers/ids\n- (id)getFollowersIDs;\n\n// followers/list\n- (id)listFollowersForUser:(NSString *)user isID:(BOOL)isID withCursor:(NSString *)cursor;\n\n// friends/ids\n- (id)getFriendsIDs;\n\n// friends/list\n- (id)listFriendsForUser:(NSString *)user isID:(BOOL)isID withCursor:(NSString *)cursor;\n\n//\n// Login and Auth\n//\n\n// XAuth login\n- (NSError *)getXAuthAccessTokenForUsername:(NSString *)username password:(NSString *)password;\n\n// OAuth login\n- (void)showOAuthLoginControllerFromViewController:(UIViewController *)sender;\n- (void)showOAuthLoginControllerFromViewController:(UIViewController *)sender withCompletion:(void(^)(BOOL success))completionBlock;\n\n// Access Token Mangement\n- (void)clearAccessToken;\n- (void)loadAccessToken;\n- (BOOL)isAuthorized;\n\n// Clear Keys\n- (void)clearConsumer;\n\n// sendRequest methods, use these for every request\n- (NSError *)sendPOSTRequest:(OAMutableURLRequest *)request withParameters:(NSArray *)params;\n- (id)sendGETRequest:(OAMutableURLRequest *)request withParameters:(NSArray *)params;\n\n//\n// Misc Methods\n//\n\n// Date parser\n- (NSDate *)getDateFromTwitterCreatedAt:(NSString *)twitterDate;\n\n// id list generator - returns an array of id/username list strings\n- (NSArray *)generateRequestStringsFromArray:(NSArray *)array;\n\n// Temporaryily set keys\n// if you don't want your keys in memory, simply use\n// this method. You will have to use it before\n// making any API calls.\n- (void)temporarilySetConsumerKey:(NSString *)consumerKey andSecret:(NSString *)consumerSecret;\n\n// Use to set the consumer key when using the singleton\n- (void)permanentlySetConsumerKey:(NSString *)consumerKey andSecret:(NSString *)consumerSecret;\n\n// Singleton, NEVER use the -init method. Ever.\n+ (FHSTwitterEngine *)sharedEngine;\n\n// Determines your internet status\n+ (BOOL)isConnectedToInternet;\n\n// Determines if entities should be included\n@property (nonatomic, assign) BOOL includeEntities;\n\n// Logged in user's username\n@property (nonatomic, retain) NSString *loggedInUsername;\n\n// Logged in user's Twitter ID\n@property (nonatomic, retain) NSString *loggedInID;\n\n// Will be called to store the accesstoken\n@property (nonatomic, assign) id<FHSTwitterEngineAccessTokenDelegate> delegate;\n\n// Access Token\n@property (nonatomic, retain) OAToken *accessToken;\n\n@end\n\n@interface NSData (Base64)\n+ (NSData *)dataWithBase64EncodedString:(NSString *)string;\n- (id)initWithBase64EncodedString:(NSString *)string;\n- (NSString *)base64EncodingWithLineLength:(unsigned int)lineLength;\n@end\n\n@interface NSString (FHSTwitterEngine)\n- (NSString *)fhs_trimForTwitter;\n- (NSString *)fhs_stringWithRange:(NSRange)range;\n- (BOOL)fhs_isNumeric;\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/FHSTwitterEngine.m",
    "content": "//\n//  FHSTwitterEngine.m\n//  FHSTwitterEngine\n//\n//  Created by Nathaniel Symer on 8/22/12.\n//  Copyright (C) 2012 Nathaniel Symer.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n#import \"FHSTwitterEngine.h\"\n\n#import \"OAuthConsumer.h\"\n#import <QuartzCore/QuartzCore.h>\n#import <SystemConfiguration/SystemConfiguration.h>\n#import <sys/socket.h>\n#import <netinet/in.h>\n#import <ifaddrs.h>\n#import <objc/runtime.h>\n\nNSString * const FHSProfileBackgroundColorKey = @\"profile_background_color\";\nNSString * const FHSProfileLinkColorKey = @\"profile_link_color\";\nNSString * const FHSProfileSidebarBorderColorKey = @\"profile_sidebar_border_color\";\nNSString * const FHSProfileSidebarFillColorKey = @\"profile_sidebar_fill_color\";\nNSString * const FHSProfileTextColorKey = @\"profile_text_color\";\n\nNSString * const FHSProfileNameKey = @\"name\";\nNSString * const FHSProfileURLKey = @\"url\";\nNSString * const FHSProfileLocationKey = @\"location\";\nNSString * const FHSProfileDescriptionKey = @\"description\";\n\n\nstatic NSString * const errorFourhundred = @\"Bad Request: The request you are trying to make has missing or bad parameters.\";\n\nstatic NSString * const authBlockKey = @\"FHSTwitterEngineOAuthCompletion\";\n\nstatic FHSTwitterEngine *sharedInstance = nil;\n\nid removeNull(id rootObject) {\n    if ([rootObject isKindOfClass:[NSDictionary class]]) {\n        NSMutableDictionary *sanitizedDictionary = [NSMutableDictionary dictionaryWithDictionary:rootObject];\n        [rootObject enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {\n            id sanitized = removeNull(obj);\n            if (!sanitized) {\n                [sanitizedDictionary setObject:@\"\" forKey:key];\n            } else {\n                [sanitizedDictionary setObject:sanitized forKey:key];\n            }\n        }];\n        return [NSMutableDictionary dictionaryWithDictionary:sanitizedDictionary];\n    }\n    \n    if ([rootObject isKindOfClass:[NSArray class]]) {\n        NSMutableArray *sanitizedArray = [NSMutableArray arrayWithArray:rootObject];\n        [rootObject enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {\n            id sanitized = removeNull(obj);\n            if (!sanitized) {\n                [sanitizedArray replaceObjectAtIndex:[sanitizedArray indexOfObject:obj] withObject:@\"\"];\n            } else {\n                [sanitizedArray replaceObjectAtIndex:[sanitizedArray indexOfObject:obj] withObject:sanitized];\n            }\n        }];\n        return [NSMutableArray arrayWithArray:sanitizedArray];\n    }\n\n    if ([rootObject isKindOfClass:[NSNull class]]) {\n        return (id)nil;\n    } else {\n        return rootObject;\n    }\n}\n\nNSError * getBadRequestError() {\n    return [NSError errorWithDomain:errorFourhundred code:400 userInfo:nil];\n}\n\nNSError * getNilReturnLengthError() {\n    return [NSError errorWithDomain:@\"Twitter successfully processed the request, but did not return any content\" code:204 userInfo:nil];\n}\n\n@interface FHSTwitterEngineController : UIViewController <UIWebViewDelegate> \n\n@property (nonatomic, retain) UINavigationBar *navBar;\n@property (nonatomic, retain) UIView *blockerView;\n@property (nonatomic, retain) UIToolbar *pinCopyBar;\n\n//@property (nonatomic, retain) FHSTwitterEngine *engine;\n@property (nonatomic, retain) UIWebView *theWebView;\n@property (nonatomic, retain) OAToken *requestToken;\n\n//- (id)initWithEngine:(FHSTwitterEngine *)theEngine;\n- (NSString *)locatePin;\n- (void)showPinCopyPrompt;\n\n@end\n\n@interface FHSTwitterEngine()\n\n// Login stuff\n- (NSString *)getRequestTokenString;\n\n// General Get request sender\n- (id)sendRequest:(NSURLRequest *)request;\n\n// These are here to obfuscate them from prying eyes\n@property (retain, nonatomic) OAConsumer *consumer;\n@property (assign, nonatomic) BOOL shouldClearConsumer;\n@property (retain, nonatomic) NSDateFormatter *dateFormatter;\n\n@end\n\n@implementation NSString (FHSTwitterEngine)\n\n- (NSString *)fhs_trimForTwitter {\n    NSString *string = [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n    return (string.length > 140)?[string substringToIndex:140]:string;\n}\n\n- (NSString *)fhs_stringWithRange:(NSRange)range {\n    return [[self substringFromIndex:range.location]substringToIndex:range.length];\n}\n\n- (BOOL)fhs_isNumeric {\n\tconst char *raw = (const char *)[self UTF8String];\n    \n\tfor (int i = 0; i < strlen(raw); i++) {\n\t\tif (raw[i] < '0' || raw[i] > '9') {\n            return NO;\n        }\n\t}\n\treturn YES;\n}\n\n@end\n\n@implementation FHSTwitterEngine\n\nstatic NSString * const url_search_tweets = @\"https://api.twitter.com/1.1/search/tweets.json\";\n\nstatic NSString * const url_users_search = @\"https://api.twitter.com/1.1/users/search.json\";\nstatic NSString * const url_users_show = @\"https://api.twitter.com/1.1/users/show.json\";\nstatic NSString * const url_users_report_spam = @\"https://api.twitter.com/1.1/users/report_spam.json\";\nstatic NSString * const url_users_lookup = @\"https://api.twitter.com/1.1/users/lookup.json\";\n\nstatic NSString * const url_lists_create = @\"https://api.twitter.com/1.1/lists/create.json\";\nstatic NSString * const url_lists_show = @\"https://api.twitter.com/1.1/lists/show.json\";\nstatic NSString * const url_lists_update = @\"https://api.twitter.com/1.1/lists/update.json\";\nstatic NSString * const url_lists_members = @\"https://api.twitter.com/1.1/lists/members.json\";\nstatic NSString * const url_lists_members_destroy_all = @\"https://api.twitter.com/1.1/lists/members/destroy_all.json\";\nstatic NSString * const url_lists_members_create_all = @\"https://api.twitter.com/1.1/lists/members/create_all.json\";\nstatic NSString * const url_lists_statuses = @\"https://api.twitter.com/1.1/lists/statuses.json\";\nstatic NSString * const url_lists_list = @\"https://api.twitter.com/1.1/lists/list.json\";\n\nstatic NSString * const url_statuses_home_timeline = @\"https://api.twitter.com/1.1/statuses/home_timeline.json\";\nstatic NSString * const url_statuses_update = @\"https://api.twitter.com/1.1/statuses/update.json\";\nstatic NSString * const url_statuses_retweets_of_me = @\"https://api.twitter.com/1.1/statuses/retweets_of_me.json\";\nstatic NSString * const url_statuses_user_timeline = @\"https://api.twitter.com/1.1/statuses/user_timeline.json\";\nstatic NSString * const url_statuses_metions_timeline = @\"https://api.twitter.com/1.1/statuses/mentions_timeline.json\";\nstatic NSString * const url_statuses_update_with_media = @\"https://api.twitter.com/1.1/statuses/update_with_media.json\";\nstatic NSString * const url_statuses_destroy = @\"https://api.twitter.com/1.1/statuses/destroy.json\";\nstatic NSString * const url_statuses_show = @\"https://api.twitter.com/1.1/statuses/show.json\";\nstatic NSString * const url_statuses_oembed = @\"https://api.twitter.com/1.1/statuses/oembed.json\";\n\nstatic NSString * const url_blocks_exists = @\"https://api.twitter.com/1.1/blocks/exists.json\";\nstatic NSString * const url_blocks_blocking = @\"https://api.twitter.com/1.1/blocks/blocking.json\";\nstatic NSString * const url_blocks_blocking_ids = @\"https://api.twitter.com/1.1/blocks/blocking/ids.json\";\nstatic NSString * const url_blocks_destroy = @\"https://api.twitter.com/1.1/blocks/destroy.json\";\nstatic NSString * const url_blocks_create = @\"https://api.twitter.com/1.1/blocks/create.json\";\n\nstatic NSString * const url_help_languages = @\"https://api.twitter.com/1.1/help/languages.json\";\nstatic NSString * const url_help_configuration = @\"https://api.twitter.com/1.1/help/configuration.json\";\nstatic NSString * const url_help_privacy = @\"https://api.twitter.com/1.1/help/privacy.json\";\nstatic NSString * const url_help_tos = @\"https://api.twitter.com/1.1/help/tos.json\";\nstatic NSString * const url_help_test = @\"https://api.twitter.com/1.1/help/test.json\";\n\nstatic NSString * const url_direct_messages_show = @\"https://api.twitter.com/1.1/direct_messages/show.json\";\nstatic NSString * const url_direct_messages_new = @\"https://api.twitter.com/1.1/direct_messages/new.json\";\nstatic NSString * const url_direct_messages_sent = @\"https://api.twitter.com/1.1/direct_messages/sent.json\";\nstatic NSString * const url_direct_messages_destroy = @\"https://api.twitter.com/1.1/direct_messages/destroy.json\";\nstatic NSString * const url_direct_messages = @\"https://api.twitter.com/1.1/direct_messages.json\";\n\nstatic NSString * const url_friendships_no_retweets_ids = @\"https://api.twitter.com/1.1/friendships/no_retweets/ids.json\";\nstatic NSString * const url_friendships_update = @\"https://api.twitter.com/1.1/friendships/update.json\";\nstatic NSString * const url_friendships_outgoing = @\"https://api.twitter.com/1.1/friendships/outgoing.json\";\nstatic NSString * const url_friendships_incoming = @\"https://api.twitter.com/1.1/friendships/incoming.json\";\nstatic NSString * const url_friendships_lookup = @\"https://api.twitter.com/1.1/friendships/lookup.json\";\nstatic NSString * const url_friendships_destroy = @\"https://api.twitter.com/1.1/friendships/destroy.json\";\nstatic NSString * const url_friendships_create = @\"https://api.twitter.com/1.1/friendships/create.json\";\n\nstatic NSString * const url_account_verify_credentials = @\"https://api.twitter.com/1.1/account/verify_credentials.json\";\nstatic NSString * const url_account_update_profile_colors = @\"https://api.twitter.com/1.1/account/update_profile_colors.json\";\nstatic NSString * const url_account_update_profile_background_image = @\"https://api.twitter.com/1.1/account/update_profile_background_image.json\";\nstatic NSString * const url_account_update_profile_image = @\"https://api.twitter.com/1.1/account/update_profile_image.json\";\nstatic NSString * const url_account_settings = @\"https://api.twitter.com/1.1/account/settings.json\";\nstatic NSString * const url_account_update_profile = @\"https://api.twitter.com/1.1/account/update_profile.json\";\n\nstatic NSString * const url_favorites_list = @\"https://api.twitter.com/1.1/favorites/list.json\";\nstatic NSString * const url_favorites_create = @\"https://api.twitter.com/1.1/favorites/create.json\";\nstatic NSString * const url_favorites_destroy = @\"https://api.twitter.com/1.1/favorites/destroy.json\";\n\nstatic NSString * const url_application_rate_limit_status = @\"https://api.twitter.com/1.1/application/rate_limit_status.json\";\n\nstatic NSString * const url_followers_ids = @\"https://api.twitter.com/1.1/followers/ids.json\";\nstatic NSString * const url_followers_list = @\"https://api.twitter.com/1.1/followers/list.json\";\n\nstatic NSString * const url_friends_ids = @\"https://api.twitter.com/1.1/friends/ids.json\";\nstatic NSString * const url_friends_list = @\"https://api.twitter.com/1.1/friends/list.json\";\n\n- (id)listFollowersForUser:(NSString *)user isID:(BOOL)isID withCursor:(NSString *)cursor {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_friends_list];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *skipstatusP = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    OARequestParameter *include_entitiesP = [OARequestParameter requestParameterWithName:@\"include_entities\" value:self.includeEntities?@\"true\":@\"false\"];\n    OARequestParameter *screen_nameP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    OARequestParameter *cursorP = [OARequestParameter requestParameterWithName:@\"cursor\" value:cursor];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:include_entitiesP, skipstatusP, screen_nameP, cursorP, nil]];\n}\n\n- (id)listFriendsForUser:(NSString *)user isID:(BOOL)isID withCursor:(NSString *)cursor {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_friends_list];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *skipstatusP = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    OARequestParameter *include_entitiesP = [OARequestParameter requestParameterWithName:@\"include_entities\" value:self.includeEntities?@\"true\":@\"false\"];\n    OARequestParameter *screen_nameP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    OARequestParameter *cursorP = [OARequestParameter requestParameterWithName:@\"cursor\" value:cursor];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:include_entitiesP, skipstatusP, screen_nameP, cursorP, nil]];\n}\n\n- (id)searchUsersWithQuery:(NSString *)q andCount:(int)count {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    if (q.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (q.length > 1000) {\n        q = [q substringToIndex:1000];\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_users_search];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *include_entitiesP = [OARequestParameter requestParameterWithName:@\"include_entities\" value:self.includeEntities?@\"true\":@\"false\"];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *qP = [OARequestParameter requestParameterWithName:@\"q\" value:q];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:include_entitiesP, countP, qP, nil]];\n}\n\n- (id)searchTweetsWithQuery:(NSString *)q count:(int)count resultType:(FHSTwitterEngineResultType)resultType unil:(NSDate *)untilDate sinceID:(NSString *)sinceID maxID:(NSString *)maxID {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    if (q.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (q.length > 1000) {\n        q = [q substringToIndex:1000];\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_search_tweets];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *include_entitiesP = [OARequestParameter requestParameterWithName:@\"include_entities\" value:self.includeEntities?@\"true\":@\"false\"];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *untilP = [OARequestParameter requestParameterWithName:@\"until\" value:nil];\n    OARequestParameter *result_typeP = [OARequestParameter requestParameterWithName:@\"result_type\" value:nil];\n    OARequestParameter *qP = [OARequestParameter requestParameterWithName:@\"q\" value:q];\n    \n    [self.dateFormatter setDateFormat:@\"YYYY-MM-DD\"];\n    NSString *untilString = [self.dateFormatter stringFromDate:untilDate];\n    [self.dateFormatter setDateFormat:@\"EEE MMM dd HH:mm:ss ZZZZ yyyy\"];\n    \n    untilP.value = untilString;\n\n    if (resultType == FHSTwitterEngineResultTypeMixed) {\n        result_typeP.value = @\"mixed\";\n    } else if (resultType == FHSTwitterEngineResultTypeRecent) {\n        result_typeP.value = @\"recent\";\n    } else if (resultType == FHSTwitterEngineResultTypePopular) {\n        result_typeP.value = @\"popular\";\n    }\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:countP, include_entitiesP, qP, nil];\n    \n    if (maxID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"max_id\" value:maxID]];\n    }\n    \n    if (sinceID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"since_id\" value:sinceID]];\n    }\n    \n    return [self sendGETRequest:request withParameters:params];\n}\n\n- (NSError *)createListWithName:(NSString *)name isPrivate:(BOOL)isPrivate description:(NSString *)description {\n    \n    if (name.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_create];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *nameP = [OARequestParameter requestParameterWithName:@\"name\" value:name];\n    OARequestParameter *isPrivateP = [OARequestParameter requestParameterWithName:@\"mode\" value:isPrivate?@\"private\":@\"public\"];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:nameP, isPrivateP, nil];\n    \n    if (description.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"description\" value:description]];\n    }\n    \n    return [self sendPOSTRequest:request withParameters:params];\n}\n\n- (id)getListWithID:(NSString *)listID {\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_show];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *listIDP = [OARequestParameter requestParameterWithName:@\"list_id\" value:listID];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:listIDP, nil]];\n}\n\n- (NSError *)changeDescriptionOfListWithID:(NSString *)listID toDescription:(NSString *)newName {\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (newName.length == 0 ) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_update];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *listIDP = [OARequestParameter requestParameterWithName:@\"list_id\" value:listID];\n    OARequestParameter *nameP = [OARequestParameter requestParameterWithName:@\"description\" value:newName];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:listIDP, nameP, nil]];\n}\n\n- (NSError *)changeNameOfListWithID:(NSString *)listID toName:(NSString *)newName {\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (newName.length == 0 ) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_update];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *listIDP = [OARequestParameter requestParameterWithName:@\"list_id\" value:listID];\n    OARequestParameter *nameP = [OARequestParameter requestParameterWithName:@\"name\" value:newName];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:listIDP, nameP, nil]];\n}\n\n- (NSError *)setModeOfListWithID:(NSString *)listID toPrivate:(BOOL)isPrivate {\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_update];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *listIDP = [OARequestParameter requestParameterWithName:@\"list_id\" value:listID];\n    OARequestParameter *isPrivateP = [OARequestParameter requestParameterWithName:@\"mode\" value:isPrivate?@\"private\":@\"public\"];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:listIDP, isPrivateP, nil]];\n}\n\n- (id)listUsersInListWithID:(NSString *)listID {\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_members];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *listIDP = [OARequestParameter requestParameterWithName:@\"list_id\" value:listID];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:listIDP, nil]];\n}\n\n- (NSError *)removeUsersFromListWithID:(NSString *)listID users:(NSArray *)users {\n    \n    if (users.count == 0) {\n        return getBadRequestError();\n    }\n    \n    if (users.count > 100) {\n        return getBadRequestError();\n    }\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_members_destroy_all];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *screen_name = [OARequestParameter requestParameterWithName:@\"screen_name\" value:[users componentsJoinedByString:@\",\"]];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:screen_name, nil]];\n}\n\n- (NSError *)addUsersToListWithID:(NSString *)listID users:(NSArray *)users {\n    \n    if (users.count == 0) {\n        return getBadRequestError();\n    }\n    \n    if (users.count > 100) {\n        return getBadRequestError();\n    }\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_members_create_all];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *screen_name = [OARequestParameter requestParameterWithName:@\"screen_name\" value:[users componentsJoinedByString:@\",\"]];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:screen_name, nil]];\n}\n\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count {\n    return [self getTimelineForListWithID:listID count:count sinceID:nil maxID:nil];\n}\n\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID {\n    return [self getTimelineForListWithID:listID count:count sinceID:sinceID maxID:maxID excludeRetweets:YES excludeReplies:YES];\n}\n\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count excludeRetweets:(BOOL)excludeRetweets excludeReplies:(BOOL)excludeReplies {\n    return [self getTimelineForListWithID:listID count:count sinceID:nil maxID:nil excludeRetweets:excludeRetweets excludeReplies:excludeReplies];\n}\n\n- (id)getTimelineForListWithID:(NSString *)listID count:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID excludeRetweets:(BOOL)excludeRetweets excludeReplies:(BOOL)excludeReplies {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    if (listID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_statuses];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *excludeRepliesP = [OARequestParameter requestParameterWithName:@\"exclude_replies\" value:excludeReplies?@\"true\":@\"false\"];\n    OARequestParameter *includeRTsP = [OARequestParameter requestParameterWithName:@\"include_rts\" value:excludeRetweets?@\"false\":@\"true\"];\n    OARequestParameter *listIDP = [OARequestParameter requestParameterWithName:@\"list_id\" value:listID];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:countP, excludeRepliesP, includeRTsP, listIDP, nil];\n    \n    if (sinceID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"since_id\" value:sinceID]];\n    }\n    \n    if (maxID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"max_id\" value:maxID]];\n    }\n    \n    return [self sendGETRequest:request withParameters:params];\n}\n\n- (id)getListsForUser:(NSString *)user isID:(BOOL)isID {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_lists_list];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:userP, nil]];\n}\n\n- (id)getRetweetsForTweet:(NSString *)identifier count:(int)count {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    if (identifier.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:[NSString stringWithFormat:@\"https://api.twitter.com/1.1/statuses/retweets/%@.json\",identifier]];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *identifierP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:identifierP, nil]];\n}\n\n- (id)getRetweetedTimelineWithCount:(int)count {\n    return [self getRetweetedTimelineWithCount:count sinceID:nil maxID:nil];\n}\n\n- (id)getRetweetedTimelineWithCount:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_retweets_of_me];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *excludeRepliesP = [OARequestParameter requestParameterWithName:@\"exclude_replies\" value:@\"false\"];\n    OARequestParameter *includeRTsP = [OARequestParameter requestParameterWithName:@\"include_rts\" value:@\"true\"];\n    \n    NSMutableArray *params = [NSMutableArray array];\n    [params addObject:countP];\n    [params addObject:excludeRepliesP];\n    [params addObject:includeRTsP];\n    \n    if (sinceID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"since_id\" value:sinceID]];\n    }\n    \n    if (maxID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"max_id\" value:maxID]];\n    }\n    \n    return [self sendGETRequest:request withParameters:params];\n}\n\n- (id)getMentionsTimelineWithCount:(int)count {\n    return [self getMentionsTimelineWithCount:count sinceID:nil maxID:nil];\n}\n\n- (id)getMentionsTimelineWithCount:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID {\n    \n    if (count == 0) {\n        return nil;\n    }\n\n    NSURL *baseURL = [NSURL URLWithString:url_statuses_metions_timeline];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *excludeRepliesP = [OARequestParameter requestParameterWithName:@\"exclude_replies\" value:@\"false\"];\n    OARequestParameter *includeRTsP = [OARequestParameter requestParameterWithName:@\"include_rts\" value:@\"true\"];\n\n    NSMutableArray *params = [NSMutableArray array];\n    [params addObject:countP];\n    [params addObject:excludeRepliesP];\n    [params addObject:includeRTsP];\n    \n    if (sinceID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"since_id\" value:sinceID]];\n    }\n    \n    if (maxID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"max_id\" value:maxID]];\n    }\n    \n    return [self sendGETRequest:request withParameters:params];\n}\n\n- (NSError *)postTweet:(NSString *)tweetString withImageData:(NSData *)theData {\n    return [self postTweet:tweetString withImageData:theData inReplyTo:nil];\n}\n\n- (NSError *)postTweet:(NSString *)tweetString withImageData:(NSData *)theData inReplyTo:(NSString *)irt {\n    \n    if (tweetString.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (theData.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_update_with_media];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *statusP = [OARequestParameter requestParameterWithName:@\"status\" value:tweetString];\n    OARequestParameter *mediaP = [OARequestParameter requestParameterWithName:@\"media_data[]\" value:[theData base64EncodingWithLineLength:0]];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:statusP, mediaP, nil];\n    \n    if (irt.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"in_reply_to_status_id\" value:irt]];\n    }\n    \n    return [self sendPOSTRequest:request withParameters:params];\n}\n\n- (NSError *)destroyTweet:(NSString *)identifier {\n    \n    if (identifier.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_destroy];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *identifierP = [OARequestParameter requestParameterWithName:@\"id\" value:identifier];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:identifierP, nil]];\n}\n\n- (id)getDetailsForTweet:(NSString *)identifier {\n    \n    if (identifier.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_show];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *identifierP = [OARequestParameter requestParameterWithName:@\"id\" value:identifier];\n    OARequestParameter *includeMyRetweet = [OARequestParameter requestParameterWithName:@\"include_my_retweet\" value:@\"true\"];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:includeMyRetweet, identifierP, nil]];\n}\n\n- (id)oembedTweet:(NSString *)identifier maxWidth:(float)maxWidth alignmentMode:(FHSTwitterEngineAlignMode)alignmentMode {\n    \n    if (identifier.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSString *language = [[NSLocale preferredLanguages]objectAtIndex:0];\n    NSString *alignment = [[NSArray arrayWithObjects:@\"left\", @\"right\", @\"center\", @\"none\", nil]objectAtIndex:alignmentMode];\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_oembed];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *identifierP = [OARequestParameter requestParameterWithName:@\"id\" value:identifier];\n    OARequestParameter *maxWidthP = [OARequestParameter requestParameterWithName:@\"maxwidth\" value:[NSString stringWithFormat:@\"%f\",maxWidth]];\n    OARequestParameter *languageP= [OARequestParameter requestParameterWithName:@\"lang\" value:language];\n    OARequestParameter *alignmentP = [OARequestParameter requestParameterWithName:@\"align\" value:alignment];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:identifierP, maxWidthP, languageP,alignmentP, nil]];\n}\n\n- (NSError *)retweet:(NSString *)identifier {\n    \n    if (identifier.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:[NSString stringWithFormat:@\"https://api.twitter.com/1.1/statuses/retweet/%@.json\",identifier]];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    return [self sendPOSTRequest:request withParameters:nil];\n}\n\n- (id)getTimelineForUser:(NSString *)user isID:(BOOL)isID count:(int)count {\n    return [self getTimelineForUser:user isID:isID count:count sinceID:nil maxID:nil];\n}\n\n- (id)getTimelineForUser:(NSString *)user isID:(BOOL)isID count:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_user_timeline];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    OARequestParameter *excludeRepliesP = [OARequestParameter requestParameterWithName:@\"exclude_replies\" value:@\"false\"];\n    OARequestParameter *includeRTsP = [OARequestParameter requestParameterWithName:@\"include_rts\" value:@\"true\"];\n\n    NSMutableArray *params = [NSMutableArray array];\n    [params addObject:countP];\n    [params addObject:userP];\n    [params addObject:excludeRepliesP];\n    [params addObject:includeRTsP];\n    \n    if (sinceID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"since_id\" value:sinceID]];\n    }\n    \n    if (maxID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"max_id\" value:maxID]];\n    }\n    \n    return [self sendGETRequest:request withParameters:params];\n}\n\n- (id)getProfileImageForUsername:(NSString *)username andSize:(FHSTwitterEngineImageSize)size {\n    \n    if (username.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_users_show];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *usernameP = [OARequestParameter requestParameterWithName:@\"screen_name\" value:username];\n    \n    NSArray *params = [NSArray arrayWithObjects:usernameP, nil];\n    \n    id userShowReturn = [self sendGETRequest:request withParameters:params];\n    \n    if ([userShowReturn isKindOfClass:[NSError class]]) {\n        return [NSError errorWithDomain:[(NSError *)userShowReturn domain] code:[(NSError *)userShowReturn code] userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n    } else if ([userShowReturn isKindOfClass:[NSDictionary class]]) {\n        NSString *url = [userShowReturn objectForKey:@\"profile_image_url\"]; // normal\n        \n        if (size == 0) { // mini\n            url = [url stringByReplacingOccurrencesOfString:@\"_normal\" withString:@\"_mini\"];\n        } else if (size == 2) { // bigger\n            url = [url stringByReplacingOccurrencesOfString:@\"_normal\" withString:@\"_bigger\"];\n        } else if (size == 3) { // original\n            url = [url stringByReplacingOccurrencesOfString:@\"_normal\" withString:@\"\"];\n        }\n        \n        id ret = [self sendRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];\n        \n        if ([ret isKindOfClass:[NSData class]]) {\n            return [UIImage imageWithData:(NSData *)ret];\n        }\n\n        return ret;\n    }\n    \n    return [NSError errorWithDomain:@\"Bad Request: The request you attempted to make messed up royally.\" code:400 userInfo:nil];\n}\n\n- (id)authenticatedUserIsBlocking:(NSString *)user isID:(BOOL)isID {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_blocks_exists];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    OARequestParameter *skipstatusP = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    \n    id obj = [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:skipstatusP, userP, nil]];\n    \n    if ([obj isKindOfClass:[NSError class]]) {\n        return obj;\n    } else if ([obj isKindOfClass:[NSDictionary class]]) {\n        if ([[obj objectForKey:@\"error\"]isEqualToString:@\"You are not blocking this user.\"]) {\n            return @\"NO\";\n        } else {\n            return @\"YES\";\n        }\n    }\n    \n    return getBadRequestError();\n}\n\n- (id)listBlockedUsers {\n    NSURL *baseURL = [NSURL URLWithString:url_blocks_blocking];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *skipstatusP = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:skipstatusP, nil]];\n}\n\n- (id)listBlockedIDs {\n    NSURL *baseURL = [NSURL URLWithString:url_blocks_blocking_ids];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *stringifyIDsP = [OARequestParameter requestParameterWithName:@\"stringify_ids\" value:@\"true\"];\n    \n    id object = [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:stringifyIDsP, nil]];\n    \n    if ([object isKindOfClass:[NSDictionary class]]) {\n        return [(NSDictionary *)object objectForKey:@\"ids\"];\n    }\n    return object;\n}\n\n- (id)getLanguages {\n    NSURL *baseURL = [NSURL URLWithString:url_help_languages];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    return [self sendGETRequest:request withParameters:nil];\n}\n\n- (id)getConfiguration {\n    NSURL *baseURL = [NSURL URLWithString:url_help_configuration];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    return [self sendGETRequest:request withParameters:nil];\n}\n\n- (NSError *)reportUserAsSpam:(NSString *)user isID:(BOOL)isID {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_users_report_spam];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:userP, nil]];\n}\n\n- (id)showDirectMessage:(NSString *)messageID {\n    \n    if (messageID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_direct_messages_show];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *id_ = [OARequestParameter requestParameterWithName:@\"id\" value:messageID];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:id_, nil]];\n}\n\n- (NSError *)sendDirectMessage:(NSString *)body toUser:(NSString *)user isID:(BOOL)isID {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (body.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_direct_messages_new];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *bodyP = [OARequestParameter requestParameterWithName:@\"text\" value:[body fhs_trimForTwitter]];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:userP, bodyP, nil]];\n}\n\n- (id)getSentDirectMessages:(int)count {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_direct_messages_sent];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:countP, nil]];\n}\n\n- (NSError *)deleteDirectMessage:(NSString *)messageID {\n    \n    if (messageID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_direct_messages_destroy];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *identitifierP = [OARequestParameter requestParameterWithName:@\"id\" value:messageID];\n    OARequestParameter *includeEntitiesP = [OARequestParameter requestParameterWithName:@\"include_entities\" value:self.includeEntities?@\"true\":@\"false\"];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:identitifierP, includeEntitiesP, nil]];\n}\n\n- (id)getDirectMessages:(int)count {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_direct_messages];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *skipStatusP = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:countP, skipStatusP, nil]];\n}\n\n- (id)getPrivacyPolicy {\n    NSURL *baseURL = [NSURL URLWithString:url_help_privacy];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    \n    id object = [self sendGETRequest:request withParameters:nil];\n    \n    if ([object isKindOfClass:[NSDictionary class]]) {\n        NSDictionary *dict = (NSDictionary *)object;\n        if ([dict.allKeys containsObject:@\"privacy\"]) {\n            return [dict objectForKey:@\"privacy\"];\n        }\n    }\n    return object;\n}\n\n- (id)getTermsOfService {\n    NSURL *baseURL = [NSURL URLWithString:url_help_tos];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    \n    id object = [self sendGETRequest:request withParameters:nil];\n    \n    if ([object isKindOfClass:[NSDictionary class]]) {\n        NSDictionary *dict = (NSDictionary *)object;\n        if ([dict.allKeys containsObject:@\"tos\"]) {\n            return [dict objectForKey:@\"tos\"];\n        }\n    }\n    return object;\n}\n\n- (id)getNoRetweetIDs {\n    NSURL *baseURL = [NSURL URLWithString:url_friendships_no_retweets_ids];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *stringifyIDsP = [OARequestParameter requestParameterWithName:@\"stringify_ids\" value:@\"true\"];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:stringifyIDsP, nil]];\n}\n\n- (NSError *)enableRetweets:(BOOL)enableRTs andDeviceNotifs:(BOOL)devNotifs forUser:(NSString *)user isID:(BOOL)isID {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_friendships_update];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    OARequestParameter *retweetsP = [OARequestParameter requestParameterWithName:@\"retweets\" value:enableRTs?@\"true\":@\"false\"];\n    OARequestParameter *deviceP = [OARequestParameter requestParameterWithName:@\"device\" value:devNotifs?@\"true\":@\"false\"];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:userP, retweetsP, deviceP, nil]];\n}\n\n- (id)getPendingOutgoingFollowers {\n    NSURL *baseURL = [NSURL URLWithString:url_friendships_outgoing];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *stringifyIDsP = [OARequestParameter requestParameterWithName:@\"stringify_ids\" value:@\"true\"];\n    \n    id object = [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:stringifyIDsP, nil]];\n    \n    if ([object isKindOfClass:[NSDictionary class]]) {\n        NSDictionary *dict = (NSDictionary *)object;\n        if ([dict.allKeys containsObject:@\"ids\"]) {\n            return [dict objectForKey:@\"ids\"];\n        }\n    }\n    return object;\n}\n\n- (id)getPendingIncomingFollowers {\n    NSURL *baseURL = [NSURL URLWithString:url_friendships_incoming];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *stringifyIDsP = [OARequestParameter requestParameterWithName:@\"stringify_ids\" value:@\"true\"];\n    \n    id object = [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:stringifyIDsP, nil]];\n    \n    if ([object isKindOfClass:[NSDictionary class]]) {\n        NSDictionary *dict = (NSDictionary *)object;\n        if ([dict.allKeys containsObject:@\"ids\"]) {\n            return [dict objectForKey:@\"ids\"];\n        }\n    }\n    return object;\n}\n\n- (id)lookupFriendshipStatusForUsers:(NSArray *)users areIDs:(BOOL)areIDs {\n    \n    if (users.count == 0) {\n        return nil;\n    }\n    \n    NSMutableArray *returnedDictionaries = [NSMutableArray array];\n    NSArray *reqStrings = [self generateRequestStringsFromArray:users];\n    \n    NSURL *baseURL = [NSURL URLWithString:url_friendships_lookup];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    \n    for (NSString *reqString in reqStrings) {\n        OARequestParameter *userP = [OARequestParameter requestParameterWithName:areIDs?@\"user_id\":@\"screen_name\" value:reqString];\n        \n        id retObj = [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:userP, nil]];\n        \n        if ([retObj isKindOfClass:[NSArray class]]) {\n            [returnedDictionaries addObjectsFromArray:(NSArray *)retObj];\n        } else if ([retObj isKindOfClass:[NSError class]]) {\n            return retObj;\n        }\n    }\n    return returnedDictionaries;\n}\n\n- (NSError *)unfollowUser:(NSString *)user isID:(BOOL)isID {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_friendships_destroy];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:userP, nil]];\n}\n\n- (NSError *)followUser:(NSString *)user isID:(BOOL)isID {\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_friendships_create];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:userP, nil]];\n}\n\n- (id)verifyCredentials {\n    NSURL *baseURL = [NSURL URLWithString:url_account_verify_credentials];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    return [self sendGETRequest:request withParameters:nil];\n}\n\n- (id)getFavoritesForUser:(NSString *)user isID:(BOOL)isID andCount:(int)count {\n    return [self getFavoritesForUser:user isID:isID andCount:count sinceID:nil maxID:nil];\n}\n\n- (id)getFavoritesForUser:(NSString *)user isID:(BOOL)isID andCount:(int)count sinceID:(NSString *)sinceID maxID:(NSString *)maxID {\n    if (count == 0) {\n        return nil;\n    }\n    \n    if (user.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_favorites_list];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countP = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\",count]];\n    OARequestParameter *userP = [OARequestParameter requestParameterWithName:isID?@\"user_id\":@\"screen_name\" value:user];\n    OARequestParameter *includeEntitiesP = [OARequestParameter requestParameterWithName:@\"include_entities\" value:self.includeEntities?@\"true\":@\"false\"];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:countP, userP, includeEntitiesP, nil];\n    \n    if (sinceID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"since_id\" value:sinceID]];\n    }\n    \n    if (maxID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"max_id\" value:maxID]];\n    }\n    \n    return [self sendGETRequest:request withParameters:params];\n}\n\n- (NSError *)markTweet:(NSString *)tweetID asFavorite:(BOOL)flag {\n    \n    if (tweetID.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:flag?url_favorites_create:url_favorites_destroy];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *idP = [OARequestParameter requestParameterWithName:@\"id\" value:tweetID];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:idP, nil]];\n}\n\n- (id)getRateLimitStatus {\n    NSURL *baseURL = [NSURL URLWithString:url_application_rate_limit_status];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    return [self sendGETRequest:request withParameters:nil];\n}\n\n- (NSError *)updateProfileColorsWithDictionary:(NSDictionary *)dictionary {\n    \n    // profile_background_color - hex color\n    // profile_link_color - hex color\n    // profile_sidebar_border_color - hex color\n    // profile_sidebar_fill_color - hex color\n    // profile_text_color - hex color\n    \n    NSString *profile_background_color = nil;\n    NSString *profile_link_color = nil;\n    NSString *profile_sidebar_border_color = nil;\n    NSString *profile_sidebar_fill_color = nil;\n    NSString *profile_text_color = nil;\n    \n    if (!dictionary) {\n        profile_background_color = @\"C0DEED\";\n        profile_link_color = @\"0084B4\";\n        profile_sidebar_border_color = @\"C0DEED\";\n        profile_sidebar_fill_color = @\"DDEEF6\";\n        profile_text_color = @\"333333\";\n    } else {\n        profile_background_color = [dictionary objectForKey:FHSProfileBackgroundColorKey];\n        profile_link_color = [dictionary objectForKey:FHSProfileLinkColorKey];\n        profile_sidebar_border_color = [dictionary objectForKey:FHSProfileSidebarBorderColorKey];\n        profile_sidebar_fill_color = [dictionary objectForKey:FHSProfileSidebarFillColorKey];\n        profile_text_color = [dictionary objectForKey:FHSProfileTextColorKey];\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_account_update_profile_colors];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *skipStatus = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:skipStatus, nil];\n    \n    if (profile_background_color.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"profile_background_color\" value:profile_background_color]];\n    }\n    \n    if (profile_link_color.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"profile_link_color\" value:profile_link_color]];\n    }\n    \n    if (profile_sidebar_border_color.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"profile_sidebar_border_color\" value:profile_sidebar_border_color]];\n    }\n    \n    if (profile_sidebar_fill_color.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"profile_sidebar_fill_color\" value:profile_sidebar_fill_color]];\n    }\n    \n    if (profile_text_color.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"profile_text_color\" value:profile_text_color]];\n    }\n    \n    return [self sendPOSTRequest:request withParameters:params];\n}\n\n- (NSError *)setUseProfileBackgroundImage:(BOOL)shouldUseBGImg {\n    NSURL *baseURL = [NSURL URLWithString:url_account_update_profile_background_image];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *skipStatus = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    OARequestParameter *useImage = [OARequestParameter requestParameterWithName:@\"profile_use_background_image\" value:shouldUseBGImg?@\"true\":@\"false\"];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:skipStatus, useImage, nil]];\n}\n\n- (NSError *)setProfileBackgroundImageWithImageData:(NSData *)data tiled:(BOOL)isTiled {\n    if (data.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (data.length >= 800000) {\n        return [NSError errorWithDomain:@\"The image you are trying to upload is too large.\" code:422 userInfo:nil];\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_account_update_profile_background_image];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *tiled = [OARequestParameter requestParameterWithName:@\"tiled\" value:isTiled?@\"true\":@\"false\"];\n    OARequestParameter *skipStatus = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    OARequestParameter *useImage = [OARequestParameter requestParameterWithName:@\"profile_use_background_image\" value:@\"true\"];\n    OARequestParameter *image = [OARequestParameter requestParameterWithName:@\"image\" value:[data base64EncodingWithLineLength:0]];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:tiled, skipStatus, useImage, image, nil]];\n}\n\n- (NSError *)setProfileBackgroundImageWithImageAtPath:(NSString *)file tiled:(BOOL)isTiled {\n    return [self setProfileBackgroundImageWithImageData:[NSData dataWithContentsOfFile:file] tiled:isTiled];\n}\n\n- (NSError *)setProfileImageWithImageData:(NSData *)data {\n    if (data.length == 0) {\n        return getBadRequestError();\n    }\n    \n    if (data.length >= 700000) {\n        return [NSError errorWithDomain:@\"The image you are trying to upload is too large.\" code:422 userInfo:nil];\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_account_update_profile_image];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *skipStatus = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    OARequestParameter *image = [OARequestParameter requestParameterWithName:@\"image\" value:[data base64EncodingWithLineLength:0]];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:image, skipStatus, nil]];\n}\n\n- (NSError *)setProfileImageWithImageAtPath:(NSString *)file {\n    return [self setProfileImageWithImageData:[NSData dataWithContentsOfFile:file]];\n}\n\n- (id)getUserSettings {\n    NSURL *baseURL = [NSURL URLWithString:url_account_settings];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    return [self sendGETRequest:request withParameters:nil];\n}\n\n- (NSError *)updateUserProfileWithDictionary:(NSDictionary *)settings {\n    \n    if (!settings) {\n        return getBadRequestError();\n    }\n    \n    // all of the values are just non-normalized strings. They appear:\n    \n    //   setting   - length in characters\n    // name        -        20\n    // url         -        100\n    // location    -        30\n    // description -        160\n    \n    NSString *name = [settings objectForKey:FHSProfileNameKey];\n    NSString *url = [settings objectForKey:FHSProfileURLKey];\n    NSString *location = [settings objectForKey:FHSProfileLocationKey];\n    NSString *description = [settings objectForKey:FHSProfileDescriptionKey];\n    \n    NSURL *baseURL = [NSURL URLWithString:url_account_update_profile];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *skipStatus = [OARequestParameter requestParameterWithName:@\"skip_status\" value:@\"true\"];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:skipStatus, nil];\n    \n    if (name.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"name\" value:name]];\n    }\n    \n    if (url.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"url\" value:url]];\n    }\n    \n    if (location.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"location\" value:location]];\n    }\n    \n    if (description.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"description\" value:description]];\n    }\n    \n    return [self sendPOSTRequest:request withParameters:params];\n}\n\n- (NSError *)updateSettingsWithDictionary:(NSDictionary *)settings {\n    \n    if (!settings) {\n        return getBadRequestError();\n    }\n    \n    // Dictionary with keys:\n    // All strings... You could have guessed that.\n    // sleep_time_enabled - true/false\n    // start_sleep_time - UTC time\n    // end_sleep_time - UTC time\n    // time_zone - Europe/Copenhagen, Pacific/Tongatapu\n    // lang - en, it, es\n    \n    NSString *sleep_time_enabled = [settings objectForKey:@\"sleep_time_enabled\"];\n    NSString *start_sleep_time = [settings objectForKey:@\"start_sleep_time\"];\n    NSString *end_sleep_time = [settings objectForKey:@\"end_sleep_time\"];\n    NSString *time_zone = [settings objectForKey:@\"time_zone\"];\n    NSString *lang = [settings objectForKey:@\"lang\"];\n    \n    NSURL *baseURL = [NSURL URLWithString:url_account_settings];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    \n    NSMutableArray *params = [NSMutableArray array];\n    \n    if (sleep_time_enabled.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"sleep_time_enabled\" value:sleep_time_enabled]];\n    }\n    \n    if (start_sleep_time.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"start_sleep_time\" value:start_sleep_time]];\n    }\n    \n    if (end_sleep_time.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"end_sleep_time\" value:end_sleep_time]];\n    }\n    \n    if (time_zone.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"time_zone\" value:time_zone]];\n    }\n    \n    if (lang.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"lang\" value:lang]];\n    }\n    \n    return [self sendPOSTRequest:request withParameters:params];\n}\n\n- (id)lookupUsers:(NSArray *)users areIDs:(BOOL)areIDs {\n    \n    if (users.count == 0) {\n        return nil;\n    }\n    \n    if (users.count > 100) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_users_lookup];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *usernames = [OARequestParameter requestParameterWithName:areIDs?@\"user_id\":@\"screen_name\" value:[users componentsJoinedByString:@\",\"]];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:usernames, nil]];\n}\n\n- (NSError *)unblock:(NSString *)username {\n\n    if (username.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_blocks_destroy];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *usernameP = [OARequestParameter requestParameterWithName:@\"screen_name\" value:username];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:usernameP, nil]];\n}\n\n- (NSError *)block:(NSString *)username {\n    \n    if (username.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_blocks_create];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *usernameP = [OARequestParameter requestParameterWithName:@\"screen_name\" value:username];\n    return [self sendPOSTRequest:request withParameters:[NSArray arrayWithObjects:usernameP, nil]];\n}\n\n- (id)testService {\n    NSURL *baseURL = [NSURL URLWithString:url_help_test];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    \n    id retValue = [self sendGETRequest:request withParameters:nil];\n    \n    if ([retValue isKindOfClass:[NSString class]]) {\n        if ([(NSString *)retValue isEqualToString:@\"ok\"]) {\n            return @\"YES\";\n        } else {\n            return @\"NO\";\n        }\n    } else if ([retValue isKindOfClass:[NSError class]]) {\n        return retValue;\n    }\n    \n    return getBadRequestError();\n}\n\n- (id)getHomeTimelineSinceID:(NSString *)sinceID count:(int)count {\n    \n    if (count == 0) {\n        return nil;\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_home_timeline];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *countParam = [OARequestParameter requestParameterWithName:@\"count\" value:[NSString stringWithFormat:@\"%d\", count]];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:countParam, nil];\n    \n    if (sinceID.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"since_id\" value:sinceID]];\n    }\n    \n    return [self sendGETRequest:request withParameters:params];\n}\n\n- (NSError *)postTweet:(NSString *)tweetString inReplyTo:(NSString *)inReplyToString {\n    \n    if (tweetString.length == 0) {\n        return getBadRequestError();\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:url_statuses_update];\n    OARequestParameter *status = [OARequestParameter requestParameterWithName:@\"status\" value:[tweetString fhs_trimForTwitter]];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    \n    NSMutableArray *params = [NSMutableArray arrayWithObjects:status, nil];\n    \n    if (inReplyToString.length > 0) {\n        [params addObject:[OARequestParameter requestParameterWithName:@\"in_reply_to_status_id\" value:inReplyToString]];\n    }\n    \n    return [self sendPOSTRequest:request withParameters:params];\n}\n\n- (NSError *)postTweet:(NSString *)tweetString {\n    return [self postTweet:tweetString inReplyTo:nil];\n}\n\n- (id)getFollowersIDs {\n    NSURL *baseURL = [NSURL URLWithString:url_followers_ids];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *param = [OARequestParameter requestParameterWithName:@\"screen_name\" value:self.loggedInUsername];\n    OARequestParameter *stringify_ids = [OARequestParameter requestParameterWithName:@\"stringify_ids\" value:@\"true\"];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:param, stringify_ids, nil]];\n}\n\n- (id)getFriendsIDs {\n    NSURL *baseURL = [NSURL URLWithString:url_friends_ids];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:self.accessToken];\n    OARequestParameter *param = [OARequestParameter requestParameterWithName:@\"screen_name\" value:self.loggedInUsername];\n    OARequestParameter *stringify_ids = [OARequestParameter requestParameterWithName:@\"stringify_ids\" value:@\"true\"];\n    return [self sendGETRequest:request withParameters:[NSArray arrayWithObjects:param, stringify_ids, nil]];\n}\n\n- (id)init {\n    self = [super init];\n    if (self) {\n        // Twitter API datestamps are UTC\n        // Don't question this code.\n        self.dateFormatter = [[[NSDateFormatter alloc]init]autorelease];\n        _dateFormatter.locale = [[[NSLocale alloc]initWithLocaleIdentifier:@\"en_US\"]autorelease];\n        _dateFormatter.dateStyle = NSDateFormatterLongStyle;\n        _dateFormatter.formatterBehavior = NSDateFormatterBehavior10_4;\n        _dateFormatter.dateFormat = @\"EEE MMM dd HH:mm:ss ZZZZ yyyy\";\n    }\n    return self;\n}\n\n// The shared* class method\n+ (FHSTwitterEngine *)sharedEngine {\n    @synchronized (self) {\n        if (sharedInstance == nil) {\n            [[self alloc]init];\n        }\n    }\n    return sharedInstance;\n}\n\n// Override stuff to make sure that the singleton is never dealloc'd. Fun.\n+ (id)allocWithZone:(NSZone *)zone {\n    @synchronized(self) {\n        if (sharedInstance == nil) {\n            sharedInstance = [super allocWithZone:zone];\n            return sharedInstance;\n        }\n    }\n    return nil;\n}\n\n- (id)retain {\n    return self;\n}\n\n- (oneway void)release {\n    // Do nothing\n}\n\n- (id)autorelease {\n    return self;\n}\n\n- (NSUInteger)retainCount {\n    return NSUIntegerMax;\n}\n\n- (NSArray *)generateRequestStringsFromArray:(NSArray *)array {\n    \n    NSString *initialString = [array componentsJoinedByString:@\",\"];\n    \n    if (array.count <= 100) {\n        return [NSArray arrayWithObjects:initialString, nil];\n    }\n    \n    int offset = 0;\n    int remainder = fmod(array.count, 100);\n    int numberOfStrings = (array.count-remainder)/100;\n    \n    NSMutableArray *reqStrs = [NSMutableArray array];\n    \n    for (int i = 1; i <= numberOfStrings; ++i) {\n        NSString *ninetyNinththItem = (NSString *)[array objectAtIndex:(i*100)-1];\n        NSRange range = [initialString rangeOfString:ninetyNinththItem];\n        int endOffset = range.location+range.length;\n        NSRange rangeOfAString = NSMakeRange(offset, endOffset-offset);\n        offset = endOffset;\n        NSString *endResult = [initialString fhs_stringWithRange:rangeOfAString];\n        \n        if ([[endResult substringToIndex:1]isEqualToString:@\",\"]) {\n            endResult = [endResult substringFromIndex:1];\n        }\n        \n        [reqStrs addObject:endResult];\n    }\n    \n    NSString *remainderString = [initialString stringByReplacingOccurrencesOfString:[reqStrs componentsJoinedByString:@\",\"] withString:@\"\"];\n    \n    if ([[remainderString substringToIndex:1]isEqualToString:@\",\"]) {\n        remainderString = [remainderString substringFromIndex:1];\n    }\n    \n    [reqStrs addObject:remainderString];\n    \n    return reqStrs;\n}\n\n//\n// XAuth\n//\n\n- (NSError *)getXAuthAccessTokenForUsername:(NSString *)username password:(NSString *)password {\n    \n    if (password.length == 0) {\n        return [NSError errorWithDomain:@\"Bad Request: The request you are trying to make is missing parameters.\" code:400 userInfo:nil];\n    }\n    \n    if (username.length == 0) {\n        return [NSError errorWithDomain:@\"Bad Request: The request you are trying to make is missing parameters.\" code:400 userInfo:nil];\n    }\n    \n    NSURL *baseURL = [NSURL URLWithString:@\"https://api.twitter.com/oauth/access_token\"];\n\tOAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:baseURL consumer:self.consumer token:nil];\n    OARequestParameter *x_auth_mode = [OARequestParameter requestParameterWithName:@\"x_auth_mode\" value:@\"client_auth\"];\n    OARequestParameter *x_auth_username = [OARequestParameter requestParameterWithName:@\"x_auth_username\" value:username];\n    OARequestParameter *x_auth_password = [OARequestParameter requestParameterWithName:@\"x_auth_password\" value:password];\n\t[request setHTTPMethod:@\"POST\"];\n    \n\t[request setParameters:[NSArray arrayWithObjects:x_auth_mode, x_auth_username, x_auth_password, nil]];\n    [request prepare];\n    \n    if (self.shouldClearConsumer) {\n        self.shouldClearConsumer = NO;\n        self.consumer = nil;\n    }\n    \n    id ret = [self sendRequest:request];\n    \n    if ([ret isKindOfClass:[NSError class]]) {\n        return ret;\n    }\n    \n    NSString *httpBody = [[[NSString alloc]initWithData:(NSData *)ret encoding:NSUTF8StringEncoding]autorelease];\n    \n    if (httpBody.length > 0) {\n        [self storeAccessToken:httpBody];\n    } else {\n        [self storeAccessToken:nil];\n        return [NSError errorWithDomain:@\"Twitter messed up and did not return anything for some reason. Please try again later.\" code:500 userInfo:nil];\n    }\n    return nil;\n}\n\n//\n// sendRequest:\n//\n\n- (id)sendRequest:(NSURLRequest *)request {\n    \n    NSHTTPURLResponse *response = nil;\n    NSError *error = nil;\n    \n    NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];\n    \n    if (error) {\n        return error;\n    }\n    \n    if (response == nil) {\n        return error;\n    }\n    \n    if (response.statusCode >= 304) {\n        return error;\n    }\n    \n    if (data.length == 0) {\n        return error;\n    }\n    \n    return data;\n}\n\n\n- (NSError *)sendPOSTRequest:(OAMutableURLRequest *)request withParameters:(NSArray *)params {\n    \n    if (![self isAuthorized]) {\n        [self loadAccessToken];\n        if (![self isAuthorized]) {\n            return [NSError errorWithDomain:@\"You are not authorized via OAuth\" code:401 userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n        }\n    }\n    \n    [request setHTTPMethod:@\"POST\"];\n    [request setParameters:params];\n    [request prepare];\n    \n    if (_shouldClearConsumer) {\n        self.shouldClearConsumer = NO;\n        self.consumer = nil;\n    }\n    \n    id retobj = [self sendRequest:request];\n    \n    if (retobj == nil) {\n        return getNilReturnLengthError();\n    }\n    \n    if ([retobj isKindOfClass:[NSError class]]) {\n        return retobj;\n    }\n    \n    id parsedJSONResponse = removeNull([NSJSONSerialization JSONObjectWithData:(NSData *)retobj options:NSJSONReadingMutableContainers error:nil]);\n    \n    if ([parsedJSONResponse isKindOfClass:[NSDictionary class]]) {\n        NSString *errorMessage = [parsedJSONResponse objectForKey:@\"error\"];\n        NSArray *errorArray = [parsedJSONResponse objectForKey:@\"errors\"];\n        if (errorMessage.length > 0) {\n            return [NSError errorWithDomain:errorMessage code:[[parsedJSONResponse objectForKey:@\"code\"]intValue] userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n        } else if (errorArray.count > 0) {\n            if (errorArray.count > 1) {\n                return [NSError errorWithDomain:@\"Multiple Errors\" code:1337 userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n            } else {\n                NSDictionary *theError = [errorArray objectAtIndex:0];\n                return [NSError errorWithDomain:[theError objectForKey:@\"message\"] code:[[theError objectForKey:@\"code\"]integerValue] userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n            }\n        }\n    }\n    \n    return nil;\n}\n\n- (id)sendGETRequest:(OAMutableURLRequest *)request withParameters:(NSArray *)params {\n    \n    if (![self isAuthorized]) {\n        [self loadAccessToken];\n        if (![self isAuthorized]) {\n            return [NSError errorWithDomain:@\"You are not authorized via OAuth\" code:401 userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n        }\n    }\n    \n    [request setHTTPMethod:@\"GET\"];\n    [request setParameters:params];\n    [request prepare];\n    \n    if (_shouldClearConsumer) {\n        self.shouldClearConsumer = NO;\n        self.consumer = nil;\n    }\n    \n    id retobj = [self sendRequest:request];\n    \n    if (retobj == nil) {\n        return getNilReturnLengthError();\n    }\n    \n    if ([retobj isKindOfClass:[NSError class]]) {\n        return retobj;\n    }\n    \n    id parsedJSONResponse = removeNull([NSJSONSerialization JSONObjectWithData:(NSData *)retobj options:NSJSONReadingMutableContainers error:nil]);\n    \n    if ([parsedJSONResponse isKindOfClass:[NSDictionary class]]) {\n        NSString *errorMessage = [parsedJSONResponse objectForKey:@\"error\"];\n        NSArray *errorArray = [parsedJSONResponse objectForKey:@\"errors\"];\n        if (errorMessage.length > 0) {\n            return [NSError errorWithDomain:errorMessage code:[[parsedJSONResponse objectForKey:@\"code\"]intValue] userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n        } else if (errorArray.count > 0) {\n            if (errorArray.count > 1) {\n                return [NSError errorWithDomain:@\"Multiple Errors\" code:1337 userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n            } else {\n                NSDictionary *theError = [errorArray objectAtIndex:0];\n                return [NSError errorWithDomain:[theError objectForKey:@\"message\"] code:[[theError objectForKey:@\"code\"]integerValue] userInfo:[NSDictionary dictionaryWithObject:request forKey:@\"request\"]];\n            }\n        }\n    }\n    \n    return parsedJSONResponse;\n}\n\n\n//\n// OAuth\n//\n\n- (NSString *)getRequestTokenString {\n    NSURL *url = [NSURL URLWithString:@\"https://api.twitter.com/oauth/request_token\"];\n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:url consumer:self.consumer token:nil];\n    [request setHTTPMethod:@\"POST\"];\n    [request prepare];\n    \n    id retobj = [self sendRequest:request];\n    \n    if ([retobj isKindOfClass:[NSData class]]) {\n        return [[[NSString alloc]initWithData:(NSData *)retobj encoding:NSUTF8StringEncoding]autorelease];\n    }\n    \n    return nil;\n}\n\n- (BOOL)finishAuthWithRequestToken:(OAToken *)reqToken {\n\n    NSURL *url = [NSURL URLWithString:@\"https://api.twitter.com/oauth/access_token\"];\n    \n    OAMutableURLRequest *request = [OAMutableURLRequest requestWithURL:url consumer:self.consumer token:reqToken];\n    [request setHTTPMethod:@\"POST\"];\n    [request prepare];\n    \n    if (_shouldClearConsumer) {\n        self.shouldClearConsumer = NO;\n        self.consumer = nil;\n    }\n    \n    id retobj = [self sendRequest:request];\n    \n    if ([retobj isKindOfClass:[NSError class]]) {\n        return NO;\n    }\n    \n    NSString *response = [[[NSString alloc]initWithData:(NSData *)retobj encoding:NSUTF8StringEncoding]autorelease];\n    \n    if (response.length == 0) {\n        return NO;\n    }\n    \n    [self storeAccessToken:response];\n    \n    return YES;\n}\n\n//\n// Access Token Management\n//\n\n- (void)loadAccessToken {\n    \n    NSString *savedHttpBody = nil;\n    \n    if (self.delegate && [self.delegate respondsToSelector:@selector(loadAccessToken)]) {\n        savedHttpBody = [self.delegate loadAccessToken];\n    } else {\n        savedHttpBody = [[NSUserDefaults standardUserDefaults]objectForKey:@\"SavedAccessHTTPBody\"];\n    }\n    \n    self.accessToken = [OAToken tokenWithHTTPResponseBody:savedHttpBody];\n    self.loggedInUsername = [self extractValueForKey:@\"screen_name\" fromHTTPBody:savedHttpBody];\n    self.loggedInID = [self extractValueForKey:@\"user_id\" fromHTTPBody:savedHttpBody];\n}\n\n- (void)storeAccessToken:(NSString *)accessTokenZ {\n    self.accessToken = [OAToken tokenWithHTTPResponseBody:accessTokenZ];\n    self.loggedInUsername = [self extractValueForKey:@\"screen_name\" fromHTTPBody:accessTokenZ];\n    self.loggedInID = [self extractValueForKey:@\"user_id\" fromHTTPBody:accessTokenZ];\n    \n    if ([self.delegate respondsToSelector:@selector(storeAccessToken:)]) {\n        [self.delegate storeAccessToken:accessTokenZ];\n    } else {\n        [[NSUserDefaults standardUserDefaults]setObject:accessTokenZ forKey:@\"SavedAccessHTTPBody\"];\n    }\n}\n\n- (NSString *)extractValueForKey:(NSString *)target fromHTTPBody:(NSString *)body {\n    if (body.length == 0) {\n        return nil;\n    }\n    \n    if (target.length == 0) {\n        return nil;\n    }\n\t\n\tNSArray *tuples = [body componentsSeparatedByString:@\"&\"];\n\tif (tuples.count < 1) {\n        return nil;\n    }\n\t\n\tfor (NSString *tuple in tuples) {\n\t\tNSArray *keyValueArray = [tuple componentsSeparatedByString:@\"=\"];\n\t\t\n\t\tif (keyValueArray.count >= 2) {\n\t\t\tNSString *key = [keyValueArray objectAtIndex:0];\n\t\t\tNSString *value = [keyValueArray objectAtIndex:1];\n\t\t\t\n\t\t\tif ([key isEqualToString:target]) {\n                return value;\n            }\n\t\t}\n\t}\n\t\n\treturn nil;\n}\n\n- (BOOL)isAuthorized {\n    if (!self.consumer) {\n        return NO;\n    }\n    \n\tif (self.accessToken.key && self.accessToken.secret) {\n        if (self.accessToken.key.length > 0 && self.accessToken.secret.length > 0) {\n            return YES;\n        }\n    }\n    \n\treturn NO;\n}\n\n- (void)clearAccessToken {\n    [self storeAccessToken:@\"\"];\n\tself.accessToken = nil;\n    self.loggedInUsername = nil;\n}\n\n- (NSDate *)getDateFromTwitterCreatedAt:(NSString *)twitterDate {\n    return [self.dateFormatter dateFromString:twitterDate];\n}\n\n- (void)clearConsumer {\n    self.consumer = nil;\n}\n\n- (void)permanentlySetConsumerKey:(NSString *)consumerKey andSecret:(NSString *)consumerSecret {\n    self.shouldClearConsumer = NO;\n    self.consumer = [OAConsumer consumerWithKey:consumerKey secret:consumerSecret];\n}\n\n- (void)temporarilySetConsumerKey:(NSString *)consumerKey andSecret:(NSString *)consumerSecret {\n    self.shouldClearConsumer = YES;\n    self.consumer = [OAConsumer consumerWithKey:consumerKey secret:consumerSecret];\n}\n\n- (void)showOAuthLoginControllerFromViewController:(UIViewController *)sender {\n    [self showOAuthLoginControllerFromViewController:sender withCompletion:nil];\n}\n\n- (void)showOAuthLoginControllerFromViewController:(UIViewController *)sender withCompletion:(void(^)(BOOL success))block {\n    FHSTwitterEngineController *vc = [[[FHSTwitterEngineController alloc]init]autorelease];\n    vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;\n    objc_setAssociatedObject(authBlockKey, \"FHSTwitterEngineOAuthCompletion\", block, OBJC_ASSOCIATION_COPY_NONATOMIC);\n    [sender presentModalViewController:vc animated:YES];\n}\n\n+ (BOOL)isConnectedToInternet {\n    struct sockaddr_in zeroAddress;\n    bzero(&zeroAddress, sizeof(zeroAddress));\n    zeroAddress.sin_len = sizeof(zeroAddress);\n    zeroAddress.sin_family = AF_INET;\n    \n    SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)&zeroAddress);\n    if (reachability) {\n        SCNetworkReachabilityFlags flags;\n        BOOL worked = SCNetworkReachabilityGetFlags(reachability, &flags);\n        CFRelease(reachability);\n        \n        if (worked) {\n            \n            if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) {\n                return NO;\n            }\n            \n            if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) {\n                return YES;\n            }\n            \n            \n            if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand) != 0) || (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) {\n                if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) {\n                    return YES;\n                }\n            }\n            \n            if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) {\n                return YES;\n            }\n        }\n        \n    }\n    return NO;\n}\n\n- (void)dealloc {\n    [self setConsumer:nil];\n    [self setDateFormatter:nil];\n    [self setLoggedInUsername:nil];\n    [self setLoggedInID:nil];\n    [self setDelegate:nil];\n    [self setAccessToken:nil];\n    [super dealloc];\n}\n\n@end\n\n@implementation FHSTwitterEngineController\n\nstatic NSString * const newPinJS = @\"var d = document.getElementById('oauth-pin'); if (d == null) d = document.getElementById('oauth_pin'); if (d) { var d2 = d.getElementsByTagName('code'); if (d2.length > 0) d2[0].innerHTML; }\";\nstatic NSString * const oldPinJS = @\"var d = document.getElementById('oauth-pin'); if (d == null) d = document.getElementById('oauth_pin'); if (d) d = d.innerHTML; d;\";\n\n- (void)loadView {\n    [super loadView];\n    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(pasteboardChanged:) name:UIPasteboardChangedNotification object:nil];\n    \n    self.view = [[[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 460)]autorelease];\n    self.view.backgroundColor = [UIColor grayColor];\n    self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n    \n    self.theWebView = [[[UIWebView alloc]initWithFrame:CGRectMake(0, 44, 320, 416)]autorelease];\n    _theWebView.hidden = YES;\n    _theWebView.delegate = self;\n    _theWebView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n    _theWebView.dataDetectorTypes = UIDataDetectorTypeNone;\n    _theWebView.backgroundColor = [UIColor darkGrayColor];\n    \n    self.navBar = [[[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, 320, 44)]autorelease];\n    _navBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;\n\t\n\t[self.view addSubview:_theWebView];\n\t[self.view addSubview:_navBar];\n    \n\tself.blockerView = [[[UIView alloc]initWithFrame:CGRectMake(0, 0, 200, 60)]autorelease];\n\t_blockerView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.8];\n\t_blockerView.center = CGPointMake(self.view.bounds.size.width/2, self.view.bounds.size.height/2);\n\t_blockerView.clipsToBounds = YES;\n    _blockerView.layer.cornerRadius = 10;\n    \n    self.pinCopyBar = [[[UIToolbar alloc]initWithFrame:CGRectMake(0, 44, self.view.bounds.size.width, 44)]autorelease];\n    _pinCopyBar.barStyle = UIBarStyleBlackTranslucent;\n    _pinCopyBar.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin;\n    _pinCopyBar.items = [NSArray arrayWithObjects:[[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]autorelease], [[[UIBarButtonItem alloc]initWithTitle:@\"Select and Copy the PIN\" style: UIBarButtonItemStylePlain target:nil action: nil]autorelease], [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]autorelease], nil];\n\t\n\tUILabel\t*label = [[UILabel alloc]initWithFrame:CGRectMake(0, 5, _blockerView.bounds.size.width, 15)];\n\tlabel.text = @\"Please Wait...\";\n\tlabel.backgroundColor = [UIColor clearColor];\n\tlabel.textColor = [UIColor whiteColor];\n\tlabel.textAlignment = UITextAlignmentCenter;\n\tlabel.font = [UIFont boldSystemFontOfSize:15];\n\t[_blockerView addSubview:label];\n    [label release];\n\t\n\tUIActivityIndicatorView\t*spinner = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];\n\tspinner.center = CGPointMake(_blockerView.bounds.size.width/2, (_blockerView.bounds.size.height/2)+10);\n\t[_blockerView addSubview:spinner];\n\t[self.view addSubview:_blockerView];\n\t[spinner startAnimating];\n    [spinner release];\n\t\n\tUINavigationItem *navItem = [[[UINavigationItem alloc]initWithTitle:@\"Twitter Login\"]autorelease];\n\tnavItem.leftBarButtonItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(close)]autorelease];\n\t[_navBar pushNavigationItem:navItem animated:NO];\n    \n    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;\n    \n    dispatch_async(GCDBackgroundThread, ^{\n        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];\n        \n        NSString *reqString = [[FHSTwitterEngine sharedEngine]getRequestTokenString];\n        \n        if (reqString.length == 0) {\n            [self dismissModalViewControllerAnimated:YES];\n            [pool release];\n            return;\n        }\n        \n        self.requestToken = [OAToken tokenWithHTTPResponseBody:reqString];\n        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@\"https://api.twitter.com/oauth/authorize?oauth_token=%@\",_requestToken.key]]];\n        \n        dispatch_sync(GCDMainThread, ^{\n            NSAutoreleasePool *poolTwo = [[NSAutoreleasePool alloc]init];\n            [_theWebView loadRequest:request];\n            [poolTwo release];\n        });\n        \n        [pool release];\n    });\n}\n\n- (void)gotPin:(NSString *)pin {\n    _requestToken.verifier = pin;\n    BOOL ret = [[FHSTwitterEngine sharedEngine]finishAuthWithRequestToken:_requestToken];\n    \n    void(^block)(BOOL success) = objc_getAssociatedObject(authBlockKey, \"FHSTwitterEngineOAuthCompletion\");\n    objc_removeAssociatedObjects(authBlockKey);\n    \n    if (block) {\n        block(ret);\n    }\n    \n    [self dismissModalViewControllerAnimated:YES];\n}\n\n- (void)pasteboardChanged:(NSNotification *)note {\n\t\n\tif (![note.userInfo objectForKey:UIPasteboardChangedTypesAddedKey]) {\n        return;\n    }\n    \n    NSString *string = [[UIPasteboard generalPasteboard]string];\n\t\n\tif (string.length != 7 || !string.fhs_isNumeric) {\n        return;\n    }\n\t\n\t[self gotPin:string];\n}\n\n- (NSString *)locatePin {\n\tNSString *pin = [[_theWebView stringByEvaluatingJavaScriptFromString:newPinJS]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n\t\n\tif (pin.length == 7) {\n\t\treturn pin;\n\t} else {\n\t\tpin = [[_theWebView stringByEvaluatingJavaScriptFromString:oldPinJS]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];\n\t\t\n\t\tif (pin.length == 7) {\n\t\t\treturn pin;\n\t\t}\n\t}\n\t\n\treturn nil;\n}\n\n- (void)webViewDidFinishLoad:(UIWebView *)webView {\n    _theWebView.userInteractionEnabled = YES;\n    NSString *authPin = [self locatePin];\n    \n    if (authPin.length > 0) {\n        [self gotPin:authPin];\n        return;\n    }\n    \n    NSString *formCount = [webView stringByEvaluatingJavaScriptFromString:@\"document.forms.length\"];\n    \n    if ([formCount isEqualToString:@\"0\"]) {\n        [self showPinCopyPrompt];\n    }\n\t\n\t[UIView beginAnimations:nil context:nil];\n\t_blockerView.hidden = YES;\n\t[UIView commitAnimations];\n\t\n    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;\n    \n    _theWebView.hidden = NO;\n}\n\n- (void)showPinCopyPrompt {\n\tif (_pinCopyBar.superview) {\n        return;\n    }\n    \n\t_pinCopyBar.center = CGPointMake(_pinCopyBar.bounds.size.width/2, _pinCopyBar.bounds.size.height/2);\n\t[self.view insertSubview:_pinCopyBar belowSubview:_navBar];\n\t\n\t[UIView beginAnimations:nil context:nil];\n    _pinCopyBar.center = CGPointMake(_pinCopyBar.bounds.size.width/2, _navBar.bounds.size.height+_pinCopyBar.bounds.size.height/2);\n\t[UIView commitAnimations];\n}\n\n- (void)webViewDidStartLoad:(UIWebView *)webView {\n    _theWebView.userInteractionEnabled = NO;\n    [_theWebView setHidden:YES];\n    [_blockerView setHidden:NO];\n    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;\n}\n\n- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {\n    \n    if (strstr([request.URL.absoluteString UTF8String], \"denied=\")) {\n        [self dismissModalViewControllerAnimated:YES];\n        return NO;\n    }\n    \n    NSData *data = request.HTTPBody;\n\tchar *raw = data?(char *)[data bytes]:\"\";\n\t\n\tif (raw && (strstr(raw, \"cancel=\") || strstr(raw, \"deny=\"))) {\n\t\t[self dismissModalViewControllerAnimated:YES];\n\t\treturn NO;\n\t}\n    \n\treturn YES;\n}\n\n- (void)close {\n    [self dismissModalViewControllerAnimated:YES];\n}\n\n- (void)dismissModalViewControllerAnimated:(BOOL)animated {\n    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;\n    [[NSNotificationCenter defaultCenter]removeObserver:self];\n    [_theWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@\"\"]]];\n    [super dismissModalViewControllerAnimated:animated];\n}\n\n- (void)dealloc {\n    [self setNavBar:nil];\n    [self setBlockerView:nil];\n    [self setPinCopyBar:nil];\n    [self setTheWebView:nil];\n    [self setRequestToken:nil];\n    [super dealloc];\n}\n\n@end\n\n\nstatic char const encodingTable[64] = {\n    'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',\n    'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',\n    'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',\n    'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/' };\n\n@implementation NSData (Base64)\n\n+ (NSData *)dataWithBase64EncodedString:(NSString *)string {\n\treturn [[[NSData alloc]initWithBase64EncodedString:string]autorelease];\n}\n\n- (id)initWithBase64EncodedString:(NSString *)string {\n\tNSMutableData *mutableData = nil;\n    \n\tif (string) {\n\t\tunsigned long ixtext = 0;\n\t\tunsigned char ch = 0;\n        unsigned char inbuf[4] = {0,0,0,0};\n        unsigned char outbuf[3] = {0,0,0};\n\t\tshort ixinbuf = 0;\n\t\tBOOL flignore = NO;\n\t\tBOOL flendtext = NO;\n        \n\t\tNSData *base64Data = [string dataUsingEncoding:NSASCIIStringEncoding];\n\t\tconst unsigned char *base64Bytes = [base64Data bytes];\n\t\tmutableData = [NSMutableData dataWithCapacity:base64Data.length];\n\t\tunsigned long lentext = [base64Data length];\n        \n        while (!(ixtext >= lentext)) {\n            \n\t\t\tch = base64Bytes[ixtext++];\n\t\t\tflignore = NO;\n            \n\t\t\tif ((ch >= 'A') && (ch <= 'Z')) {\n                ch = ch - 'A';\n            } else if ((ch >= 'a') && (ch <= 'z')) {\n                ch = ch - 'a' + 26;\n            } else if ((ch >= '0') && (ch <= '9')) {\n                ch = ch - '0' + 52;\n            } else if (ch == '+') {\n                ch = 62;\n            } else if (ch == '=') {\n                flendtext = YES;\n            } else if (ch == '/') {\n                ch = 63;\n            } else {\n                flignore = YES;\n            }\n            \n\t\t\tif (!flignore) {\n\t\t\t\tshort ctcharsinbuf = 3;\n\t\t\t\tBOOL flbreak = NO;\n                \n\t\t\t\tif (flendtext) {\n\t\t\t\t\tif (!ixinbuf) {\n                        break;\n                    }\n                    \n\t\t\t\t\tif (ixinbuf == 1 || ixinbuf == 2) {\n                        ctcharsinbuf = 1;\n                    } else {\n                        ctcharsinbuf = 2;\n                    }\n                    \n\t\t\t\t\tixinbuf = 3;\n\t\t\t\t\tflbreak = YES;\n\t\t\t\t}\n                \n\t\t\t\tinbuf[ixinbuf++] = ch;\n                \n\t\t\t\tif (ixinbuf == 4) {\n\t\t\t\t\tixinbuf = 0;\n\t\t\t\t\toutbuf[0] = (inbuf[0] << 2) | ((inbuf[1] & 0x30) >> 4);\n\t\t\t\t\toutbuf[1] = ((inbuf[1] & 0x0F) << 4) | ((inbuf[2] & 0x3C) >> 2);\n\t\t\t\t\toutbuf[2] = ((inbuf[2] & 0x03) << 6) | (inbuf[3] & 0x3F);\n                    \n\t\t\t\t\tfor (int i = 0; i < ctcharsinbuf; i++) {\n\t\t\t\t\t\t[mutableData appendBytes:&outbuf[i] length:1];\n                    }\n\t\t\t\t}\n                \n\t\t\t\tif (flbreak)  {\n                    break;\n                }\n\t\t\t}\n\t\t}\n\t}\n    \n\tself = [self initWithData:mutableData];\n\treturn self;\n}\n\n- (NSString *)base64EncodingWithLineLength:(unsigned int)lineLength {\n    \n\tconst unsigned char\t*bytes = [self bytes];\n\tunsigned long ixtext = 0;\n\tunsigned long lentext = [self length];\n\tlong ctremaining = 0;\n    unsigned char inbuf[3] = {0,0,0};\n    unsigned char outbuf[4] = {0,0,0,0};\n    \n\tshort charsonline = 0;\n    short ctcopy = 0;\n\tunsigned long ix = 0;\n    \n    NSMutableString *result = [NSMutableString stringWithCapacity:lentext];\n    \n\twhile (YES) {\n\t\tctremaining = lentext-ixtext;\n        \n\t\tif (ctremaining <= 0) {\n            break;\n        }\n        \n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tix = ixtext + i;\n            inbuf[i] = (ix < lentext)?bytes[ix]:0;\n\t\t}\n        \n\t\toutbuf[0] = (inbuf[0] & 0xFC) >> 2;\n\t\toutbuf[1] = ((inbuf[0] & 0x03) << 4) | ((inbuf[1] & 0xF0) >> 4);\n\t\toutbuf[2] = ((inbuf[1] & 0x0F) << 2) | ((inbuf[2] & 0xC0) >> 6);\n\t\toutbuf[3] = inbuf[2] & 0x3F;\n        \n\t\tswitch (ctremaining) {\n            case 1:\n                ctcopy = 2;\n                break;\n            case 2:\n                ctcopy = 3;\n                break;\n            default:\n                ctcopy = 4;\n                break;\n\t\t}\n        \n\t\tfor (int i = 0; i < ctcopy; i++) {\n\t\t\t[result appendFormat:@\"%c\",encodingTable[outbuf[i]]];\n        }\n        \n\t\tfor (int i = ctcopy; i < 4; i++) {\n            [result appendString:@\"=\"];\n        }\n        \n\t\tixtext += 3;\n\t\tcharsonline += 4;\n        \n\t\tif (lineLength > 0) {\n\t\t\tif (charsonline >= lineLength) {\n\t\t\t\tcharsonline = 0;\n\t\t\t\t[result appendString:@\"\\n\"];\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Categories/NSString+URLEncoding.h",
    "content": "//\n//  NSString+URLEncoding.h\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import <Foundation/Foundation.h>\n\n\n@interface NSString (OAURLEncodingAdditions)\n\n- (NSString *)URLEncodedString;\n- (NSString *)URLDecodedString;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Categories/NSString+URLEncoding.m",
    "content": "//\n//  NSString+URLEncoding.m\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import \"NSString+URLEncoding.h\"\n\n@implementation NSString (OAURLEncodingAdditions)\n\n- (NSString *)URLEncodedString {\n    CFStringRef url = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)self, NULL, CFSTR(\"!*'();:@&=+$,/?%#[]\"), kCFStringEncodingUTF8); // for some reason, releasing this is disasterous\n    NSString *result = (NSString *)url;\n    [result autorelease];\n\treturn result;\n}\n\n- (NSString *)URLDecodedString {\n    CFStringRef url = CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, (CFStringRef)self, CFSTR(\"\"), kCFStringEncodingUTF8);\n\tNSString *result = (NSString *)url;\n\t[result autorelease];\n    return result;\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Crytpo/Base64TranscoderFHS.c",
    "content": "/*\n *  Base64Transcoder.c\n *  Base64Test\n *\n *  Created by Jonathan Wight on Tue Mar 18 2003.\n *  Copyright (c) 2003 Toxic Software. All rights reserved.\n *\n *  Permission is hereby granted, free of charge, to any person obtaining a copy\n *  of this software and associated documentation files (the \"Software\"), to deal\n *  in the Software without restriction, including without limitation the rights\n *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *  copies of the Software, and to permit persons to whom the Software is\n *  furnished to do so, subject to the following conditions:\n *\n *  The above copyright notice and this permission notice shall be included in\n *  all copies or substantial portions of the Software.\n *\n *  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n *  THE SOFTWARE.\n *\n */\n\n#include \"Base64TranscoderFHS.h\"\n\n#include <math.h>\n#include <string.h>\n\nconst u_int8_t kBase64EncodeTable_[64] = {\n\t/*  0 */ 'A',\t/*  1 */ 'B',\t/*  2 */ 'C',\t/*  3 */ 'D', \n\t/*  4 */ 'E',\t/*  5 */ 'F',\t/*  6 */ 'G',\t/*  7 */ 'H', \n\t/*  8 */ 'I',\t/*  9 */ 'J',\t/* 10 */ 'K',\t/* 11 */ 'L', \n\t/* 12 */ 'M',\t/* 13 */ 'N',\t/* 14 */ 'O',\t/* 15 */ 'P', \n\t/* 16 */ 'Q',\t/* 17 */ 'R',\t/* 18 */ 'S',\t/* 19 */ 'T', \n\t/* 20 */ 'U',\t/* 21 */ 'V',\t/* 22 */ 'W',\t/* 23 */ 'X', \n\t/* 24 */ 'Y',\t/* 25 */ 'Z',\t/* 26 */ 'a',\t/* 27 */ 'b', \n\t/* 28 */ 'c',\t/* 29 */ 'd',\t/* 30 */ 'e',\t/* 31 */ 'f', \n\t/* 32 */ 'g',\t/* 33 */ 'h',\t/* 34 */ 'i',\t/* 35 */ 'j', \n\t/* 36 */ 'k',\t/* 37 */ 'l',\t/* 38 */ 'm',\t/* 39 */ 'n', \n\t/* 40 */ 'o',\t/* 41 */ 'p',\t/* 42 */ 'q',\t/* 43 */ 'r', \n\t/* 44 */ 's',\t/* 45 */ 't',\t/* 46 */ 'u',\t/* 47 */ 'v', \n\t/* 48 */ 'w',\t/* 49 */ 'x',\t/* 50 */ 'y',\t/* 51 */ 'z', \n\t/* 52 */ '0',\t/* 53 */ '1',\t/* 54 */ '2',\t/* 55 */ '3', \n\t/* 56 */ '4',\t/* 57 */ '5',\t/* 58 */ '6',\t/* 59 */ '7', \n\t/* 60 */ '8',\t/* 61 */ '9',\t/* 62 */ '+',\t/* 63 */ '/'\n};\n\n/*\n-1 = Base64 end of data marker.\n-2 = White space (tabs, cr, lf, space)\n-3 = Noise (all non whitespace, non-base64 characters) \n-4 = Dangerous noise\n-5 = Illegal noise (null byte)\n*/\n\nconst int8_t kBase64DecodeTable_[128] = {\n\t/* 0x00 */ -5, \t/* 0x01 */ -3, \t/* 0x02 */ -3, \t/* 0x03 */ -3,\n\t/* 0x04 */ -3, \t/* 0x05 */ -3, \t/* 0x06 */ -3, \t/* 0x07 */ -3,\n\t/* 0x08 */ -3, \t/* 0x09 */ -2, \t/* 0x0a */ -2, \t/* 0x0b */ -2,\n\t/* 0x0c */ -2, \t/* 0x0d */ -2, \t/* 0x0e */ -3, \t/* 0x0f */ -3,\n\t/* 0x10 */ -3, \t/* 0x11 */ -3, \t/* 0x12 */ -3, \t/* 0x13 */ -3,\n\t/* 0x14 */ -3, \t/* 0x15 */ -3, \t/* 0x16 */ -3, \t/* 0x17 */ -3,\n\t/* 0x18 */ -3, \t/* 0x19 */ -3, \t/* 0x1a */ -3, \t/* 0x1b */ -3,\n\t/* 0x1c */ -3, \t/* 0x1d */ -3, \t/* 0x1e */ -3, \t/* 0x1f */ -3,\n\t/* ' ' */ -2,\t/* '!' */ -3,\t/* '\"' */ -3,\t/* '#' */ -3,\n\t/* '$' */ -3,\t/* '%' */ -3,\t/* '&' */ -3,\t/* ''' */ -3,\n\t/* '(' */ -3,\t/* ')' */ -3,\t/* '*' */ -3,\t/* '+' */ 62,\n\t/* ',' */ -3,\t/* '-' */ -3,\t/* '.' */ -3,\t/* '/' */ 63,\n\t/* '0' */ 52,\t/* '1' */ 53,\t/* '2' */ 54,\t/* '3' */ 55,\n\t/* '4' */ 56,\t/* '5' */ 57,\t/* '6' */ 58,\t/* '7' */ 59,\n\t/* '8' */ 60,\t/* '9' */ 61,\t/* ':' */ -3,\t/* ';' */ -3,\n\t/* '<' */ -3,\t/* '=' */ -1,\t/* '>' */ -3,\t/* '?' */ -3,\n\t/* '@' */ -3,\t/* 'A' */ 0,\t/* 'B' */  1,\t/* 'C' */  2,\n\t/* 'D' */  3,\t/* 'E' */  4,\t/* 'F' */  5,\t/* 'G' */  6,\n\t/* 'H' */  7,\t/* 'I' */  8,\t/* 'J' */  9,\t/* 'K' */ 10,\n\t/* 'L' */ 11,\t/* 'M' */ 12,\t/* 'N' */ 13,\t/* 'O' */ 14,\n\t/* 'P' */ 15,\t/* 'Q' */ 16,\t/* 'R' */ 17,\t/* 'S' */ 18,\n\t/* 'T' */ 19,\t/* 'U' */ 20,\t/* 'V' */ 21,\t/* 'W' */ 22,\n\t/* 'X' */ 23,\t/* 'Y' */ 24,\t/* 'Z' */ 25,\t/* '[' */ -3,\n\t/* '\\' */ -3,\t/* ']' */ -3,\t/* '^' */ -3,\t/* '_' */ -3,\n\t/* '`' */ -3,\t/* 'a' */ 26,\t/* 'b' */ 27,\t/* 'c' */ 28,\n\t/* 'd' */ 29,\t/* 'e' */ 30,\t/* 'f' */ 31,\t/* 'g' */ 32,\n\t/* 'h' */ 33,\t/* 'i' */ 34,\t/* 'j' */ 35,\t/* 'k' */ 36,\n\t/* 'l' */ 37,\t/* 'm' */ 38,\t/* 'n' */ 39,\t/* 'o' */ 40,\n\t/* 'p' */ 41,\t/* 'q' */ 42,\t/* 'r' */ 43,\t/* 's' */ 44,\n\t/* 't' */ 45,\t/* 'u' */ 46,\t/* 'v' */ 47,\t/* 'w' */ 48,\n\t/* 'x' */ 49,\t/* 'y' */ 50,\t/* 'z' */ 51,\t/* '{' */ -3,\n\t/* '|' */ -3,\t/* '}' */ -3,\t/* '~' */ -3,\t/* 0x7f */ -3\n};\n\nconst u_int8_t kBits_00000011_ = 0x03;\nconst u_int8_t kBits_00001111_ = 0x0F;\nconst u_int8_t kBits_00110000_ = 0x30;\nconst u_int8_t kBits_00111100_ = 0x3C;\nconst u_int8_t kBits_00111111_ = 0x3F;\nconst u_int8_t kBits_11000000_ = 0xC0;\nconst u_int8_t kBits_11110000_ = 0xF0;\nconst u_int8_t kBits_11111100_ = 0xFC;\n\nsize_t EstimateBas64EncodedDataSizeFHS(size_t inDataSize) {\n    size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4;\n    theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72;\n    return(theEncodedDataSize);\n}\n\nsize_t EstimateBas64DecodedDataSizeFHS(size_t inDataSize)   {\n    size_t theDecodedDataSize = (int)ceil(inDataSize / 4.0) * 3;\n    //theDecodedDataSize = theDecodedDataSize / 72 * 74 + theDecodedDataSize % 72;\n    return(theDecodedDataSize);\n}\n\nbool Base64EncodeDataFHS(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize) {\n    \n    size_t theEncodedDataSize = EstimateBas64EncodedDataSizeFHS(inInputDataSize);\n    if (*ioOutputDataSize < theEncodedDataSize) {\n        return false;\n    }\n    \n    *ioOutputDataSize = theEncodedDataSize;\n    const u_int8_t *theInPtr = (const u_int8_t *)inInputData;\n    u_int32_t theInIndex = 0, theOutIndex = 0;\n    for (; theInIndex < (inInputDataSize / 3) * 3; theInIndex += 3) {\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex] & kBits_11111100_) >> 2];\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex] & kBits_00000011_) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000_) >> 4];\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex + 1] & kBits_00001111_) << 2 | (theInPtr[theInIndex + 2] & kBits_11000000_) >> 6];\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex + 2] & kBits_00111111_) >> 0];\n        \n        if (theOutIndex % 74 == 72) {\n            outOutputData[theOutIndex++] = '\\r';\n            outOutputData[theOutIndex++] = '\\n';\n\t\t}\n\t}\n    \n    const size_t theRemainingBytes = inInputDataSize - theInIndex;\n    \n    if (theRemainingBytes == 1) {\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex] & kBits_11111100_) >> 2];\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex] & kBits_00000011_) << 4 | (0 & kBits_11110000_) >> 4];\n        outOutputData[theOutIndex++] = '=';\n        outOutputData[theOutIndex++] = '=';\n        \n        if (theOutIndex % 74 == 72) {\n            outOutputData[theOutIndex++] = '\\r';\n            outOutputData[theOutIndex++] = '\\n';\n\t\t}\n\t} else if (theRemainingBytes == 2) {\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex] & kBits_11111100_) >> 2];\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex] & kBits_00000011_) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000_) >> 4];\n        outOutputData[theOutIndex++] = kBase64EncodeTable_[(theInPtr[theInIndex + 1] & kBits_00001111_) << 2 | (0 & kBits_11000000_) >> 6];\n        outOutputData[theOutIndex++] = '=';\n        \n        if (theOutIndex % 74 == 72) {\n            outOutputData[theOutIndex++] = '\\r';\n            outOutputData[theOutIndex++] = '\\n';\n\t\t}\n\t}\n    \n    return true;\n}\n\nbool Base64DecodeData_(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize) {\n    \n    memset(ioOutputData, '.', *ioOutputDataSize);\n\n    size_t theDecodedDataSize = EstimateBas64DecodedDataSizeFHS(inInputDataSize);\n    if (*ioOutputDataSize < theDecodedDataSize) {\n        return false;\n    }\n\n    *ioOutputDataSize = 0;\n    const u_int8_t *theInPtr = (const u_int8_t *)inInputData;\n    u_int8_t *theOutPtr = (u_int8_t *)ioOutputData;\n    size_t theInIndex = 0, theOutIndex = 0;\n    u_int8_t theOutputOctet;\n    size_t theSequence = 0;\n    for (; theInIndex < inInputDataSize; ) {\n        int8_t theSextet = 0;\n\t\n        int8_t theCurrentInputOctet = theInPtr[theInIndex];\n        theSextet = kBase64DecodeTable_[theCurrentInputOctet];\n        \n        if (theSextet == -1) {\n            break;\n        }\n        \n        while (theSextet == -2) {\n            theCurrentInputOctet = theInPtr[++theInIndex];\n            theSextet = kBase64DecodeTable_[theCurrentInputOctet];\n\t\t}\n        \n        while (theSextet == -3) {\n            theCurrentInputOctet = theInPtr[++theInIndex];\n            theSextet = kBase64DecodeTable_[theCurrentInputOctet];\n\t\t}\n        \n        if (theSequence == 0) {\n            theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 2 & kBits_11111100_;\n\t\t} else if (theSequence == 1) {\n            theOutputOctet |= (theSextet >- 0 ? theSextet : 0) >> 4 & kBits_00000011_;\n            theOutPtr[theOutIndex++] = theOutputOctet;\n\t\t} else if (theSequence == 2) {\n            theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 4 & kBits_11110000_;\n\t\t} else if (theSequence == 3) {\n            theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 2 & kBits_00001111_;\n            theOutPtr[theOutIndex++] = theOutputOctet;\n\t\t} else if (theSequence == 4) {\n            theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 6 & kBits_11000000_;\n\t\t} else if (theSequence == 5) {\n            theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 0 & kBits_00111111_;\n            theOutPtr[theOutIndex++] = theOutputOctet;\n\t\t}\n        \n        theSequence = (theSequence+1)%6;\n        \n        if (theSequence != 2 && theSequence != 4) {\n            theInIndex++;\n        }\n    }\n    *ioOutputDataSize = theOutIndex;\n    return true;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Crytpo/Base64TranscoderFHS.h",
    "content": "/*\n *  Base64Transcoder.h\n *  Base64Test\n *\n *  Created by Jonathan Wight on Tue Mar 18 2003.\n *  Copyright (c) 2003 Toxic Software. All rights reserved.\n *\n *  Permission is hereby granted, free of charge, to any person obtaining a copy\n *  of this software and associated documentation files (the \"Software\"), to deal\n *  in the Software without restriction, including without limitation the rights\n *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n *  copies of the Software, and to permit persons to whom the Software is\n *  furnished to do so, subject to the following conditions:\n *\n *  The above copyright notice and this permission notice shall be included in\n *  all copies or substantial portions of the Software.\n *\n *  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n *  THE SOFTWARE.\n *\n */\n\n#include <stdlib.h>\n#include <stdbool.h>\n\nextern size_t EstimateBas64EncodedDataSizeFHS(size_t inDataSize);\nextern size_t EstimateBas64DecodedDataSizeFHS(size_t inDataSize);\n\nextern bool Base64EncodeDataFHS(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize);\nextern bool Base64DecodeDataFHS(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize);\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAConsumer.h",
    "content": "//\n//  OAConsumer.h\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import <Foundation/Foundation.h>\n\n@interface OAConsumer : NSObject\n\n@property (nonatomic, retain) NSString *key;\n@property (nonatomic, retain) NSString *secret;\n\n- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret;\n\n+ (OAConsumer *)consumerWithKey:(NSString *)aKey secret:(NSString *)aSecret;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAConsumer.m",
    "content": "//\n//  OAConsumer.m\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n#import \"OAConsumer.h\"\n\n@implementation OAConsumer\n\n+ (OAConsumer *)consumerWithKey:(NSString *)aKey secret:(NSString *)aSecret {\n    return [[[[self class]alloc]initWithKey:aKey secret:aSecret]autorelease];\n}\n\n- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret {\n\tif (self = [super init]) {\n\t\tself.key = aKey;\n\t\tself.secret = aSecret;\n\t}\n\treturn self;\n}\n\n- (void)dealloc {\n    [self setKey:nil];\n    [self setSecret:nil];\n\t[super dealloc];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAHMAC_SHA1SignatureProvider.h",
    "content": "//\n//  OAHMAC_SHA1SignatureProvider.h\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import <Foundation/Foundation.h>\n\n@protocol OASignatureProviding <NSObject>\n- (NSString *)name;\n- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret;\n@end\n\n@interface OAHMAC_SHA1SignatureProvider : NSObject <OASignatureProviding>\n\n+ (OAHMAC_SHA1SignatureProvider *)OAHMAC_SHA1SignatureProvider;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAHMAC_SHA1SignatureProvider.m",
    "content": "//\n//  OAHMAC_SHA1SignatureProvider.m\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import \"OAHMAC_SHA1SignatureProvider.h\"\n#import <CommonCrypto/CommonHMAC.h>\n#include \"Base64TranscoderFHS.h\"\n\n@implementation OAHMAC_SHA1SignatureProvider\n\n+ (OAHMAC_SHA1SignatureProvider *)OAHMAC_SHA1SignatureProvider {\n    return [[[[self class]alloc]init]autorelease];\n}\n\n- (NSString *)name {\n    return @\"HMAC-SHA1\";\n}\n\n- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret {\n    \n    NSData *secretData = [secret dataUsingEncoding:NSUTF8StringEncoding];\n    NSData *clearTextData = [text dataUsingEncoding:NSUTF8StringEncoding];\n    unsigned char result[20];\n\tCCHmac(kCCHmacAlgSHA1, [secretData bytes], [secretData length], [clearTextData bytes], [clearTextData length], result);\n    \n    // Base64 Encoding\n    \n    char base64Result[32];\n    size_t theResultLength = 32;\n    Base64EncodeDataFHS(result, 20, base64Result, &theResultLength);\n    NSData *theData = [NSData dataWithBytes:base64Result length:theResultLength];\n    \n    NSString *base64EncodedResult = [[NSString alloc]initWithData:theData encoding:NSUTF8StringEncoding];\n    \n    return [base64EncodedResult autorelease];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAMutableURLRequest.h",
    "content": "//\n//  OAMutableURLRequest.h\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import <Foundation/Foundation.h>\n#import \"OAConsumer.h\"\n#import \"OAToken.h\"\n#import \"OAHMAC_SHA1SignatureProvider.h\"\n\n@class OAServiceTicket;\n\n@interface OAMutableURLRequest : NSMutableURLRequest\n\n@property (nonatomic, assign) NSString *signature;\n@property (nonatomic, assign) NSString *nonce;\n@property (nonatomic, assign) NSString *timestamp;\n\n+ (void)fetchDataForRequest:(OAMutableURLRequest *)request withCompletionHandler:(void(^)(OAServiceTicket *, NSData *, NSError *))block;\n\n+ (OAMutableURLRequest *)requestWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken realm:(NSString *)aRealm signatureProvider:(id<OASignatureProviding, NSObject>)aProvider;\n\n+ (OAMutableURLRequest *)requestWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken;\n\n- (id)initWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken realm:(NSString *)aRealm signatureProvider:(id<OASignatureProviding, NSObject>)aProvider;\n\n- (id)initWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken realm:(NSString *)aRealm signatureProvider:(id<OASignatureProviding, NSObject>)aProvider nonce:(NSString *)aNonce timestamp:(NSString *)aTimestamp;\n\n- (void)prepare;\n- (void)setOAuthParameterName:(NSString*)parameterName withValue:(NSString*)parameterValue;\n- (NSArray *)parameters;\n- (void)setParameters:(NSArray *)parameters;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAMutableURLRequest.m",
    "content": "//\n//  OAMutableURLRequest.m\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import \"OAMutableURLRequest.h\"\n#import \"OARequestParameter.h\"\n#import \"OAServiceTicket.h\"\n\n@interface OAMutableURLRequest ()\n- (void)_generateTimestamp;\n- (void)_generateNonce;\n- (NSString *)_signatureBaseString;\n\n@property (nonatomic, retain) OAConsumer *consumer;\n@property (nonatomic, retain) OAToken *token;\n@property (nonatomic, retain) NSString *realm;\n@property (nonatomic, retain) id <OASignatureProviding> signatureProvider;\n@property (nonatomic, retain) NSMutableDictionary *extraOAuthParameters;\n\n@end\n\n@interface NSURL (OABaseAdditions)\n- (NSString *)URLStringWithoutQuery;\n@end\n\n@implementation NSURL (OABaseAdditions)\n\n- (NSString *)URLStringWithoutQuery {\n    if (self.absoluteString.length == 0) {\n        return nil;\n    }\n    \n    NSArray *parts = [self.absoluteString componentsSeparatedByString:@\"?\"];\n    return (parts.count == 0)?nil:[parts objectAtIndex:0];\n}\n\n@end\n\n@implementation OAMutableURLRequest\n\n+ (void)fetchDataForRequest:(OAMutableURLRequest *)request withCompletionHandler:(void(^)(OAServiceTicket *, NSData *, NSError *))block {\n    [request prepare];\n    \n    [NSURLConnection sendAsynchronousRequest:request queue:[[[NSOperationQueue alloc]init]autorelease] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {\n        OAServiceTicket *ticket = [[[OAServiceTicket alloc]initWithRequest:request response:response didSucceed:(error == nil)]autorelease];\n        block(ticket, data, error);\n    }];\n}\n\n+ (OAMutableURLRequest *)requestWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken {\n    return [[[[self class]alloc]initWithURL:aUrl consumer:aConsumer token:aToken realm:nil signatureProvider:nil]autorelease];\n}\n\n+ (OAMutableURLRequest *)requestWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken realm:(NSString *)aRealm signatureProvider:(id<OASignatureProviding, NSObject>)aProvider {\n    return [[[[self class]alloc]initWithURL:aUrl consumer:aConsumer token:aToken realm:aRealm signatureProvider:aProvider]autorelease];\n}\n\n- (id)initWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken realm:(NSString *)aRealm signatureProvider:(id<OASignatureProviding, NSObject>)aProvider {\n    \n    self = [super initWithURL:aUrl cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:25];\n    \n    if (self) {\n        [self setConsumer:aConsumer];\n\t\t\n\t\t// empty token for Unauthorized Request Token transaction\n\t\tif (aToken == nil) {\n            [self setToken:[OAToken token]];\n\t\t} else {\n            [self setToken:aToken];\n        }\n        \n\t\tif (aRealm == nil) {\n            [self setRealm:@\"\"];\n\t\t} else {\n            [self setRealm:aRealm];\n        }\n\t\t\n\t\t// default to HMAC-SHA1\n\t\tif (aProvider == nil) {\n            [self setSignatureProvider:[OAHMAC_SHA1SignatureProvider OAHMAC_SHA1SignatureProvider]];\n\t\t} else {\n            [self setSignatureProvider:aProvider];\n        }\n\t\t\n\t\t[self _generateTimestamp];\n\t\t[self _generateNonce];\n\t}\n    return self;\n}\n\n// Setting a timestamp and nonce to known values. Can be helpful for testing\n- (id)initWithURL:(NSURL *)aUrl consumer:(OAConsumer *)aConsumer token:(OAToken *)aToken realm:(NSString *)aRealm signatureProvider:(id<OASignatureProviding, NSObject>)aProvider nonce:(NSString *)aNonce timestamp:(NSString *)aTimestamp {\n\t\n    self = [super initWithURL:aUrl cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10.0];\n    \n    if (self) {    \n\t\t[self setConsumer:aConsumer];\n\t\t\n\t\t// empty token for Unauthorized Request Token transaction\n\t\tif (aToken == nil) {\n            [self setToken:[OAToken token]];\n\t\t} else {\n            [self setToken:aToken];\n        }\n        \n\t\tif (aRealm == nil) {\n            [self setRealm:@\"\"];\n\t\t} else {\n            [self setRealm:aRealm];\n        }\n\t\t\n\t\t// default to HMAC-SHA1\n\t\tif (aProvider == nil) {\n            [self setSignatureProvider:[OAHMAC_SHA1SignatureProvider OAHMAC_SHA1SignatureProvider]];\n\t\t} else {\n            [self setSignatureProvider:aProvider];\n        }\n\n        [self setTimestamp:aTimestamp];\n        [self setNonce:aNonce];\n\t}\n    return self;\n}\n\n- (void)setOAuthParameterName:(NSString*)parameterName withValue:(NSString*)parameterValue {\n    \n    if (!parameterName && !parameterValue) {\n        NSLog(@\"%s There was not parameter name nor value specified.\", __PRETTY_FUNCTION__);\n        return;\n    }\n    \n\tif (self.extraOAuthParameters == nil) {\n        [self setExtraOAuthParameters:[NSMutableDictionary dictionary]];\n\t}\n\t\n\t[self.extraOAuthParameters setObject:parameterValue forKey:parameterName];\n}\n\n- (void)prepare {\n    // sign\n\t// Secrets must be urlencoded before concatenated with '&'\n\t// TODO: if later RSA-SHA1 support is added then a little code redesign is needed\n    self.signature = [self.signatureProvider signClearText:[self _signatureBaseString] withSecret:[NSString stringWithFormat:@\"%@&%@\", [self.consumer.secret URLEncodedString], [self.token.secret URLEncodedString]]];\n    \n    // set OAuth headers\n\tNSString *oauthToken;\n    \n\tif ([self.token.key isEqualToString:@\"\"]) {\n\t\toauthToken = @\"oauth_callback=\\\"oob\\\", \";\n    } else if (self.token.verifier.length == 0) {\n\t\toauthToken = [NSString stringWithFormat:@\"oauth_token=\\\"%@\\\", \", [self.token.key URLEncodedString]];\n\t} else {\n\t\toauthToken = [NSString stringWithFormat:@\"oauth_token=\\\"%@\\\", oauth_verifier=\\\"%@\\\", \", [self.token.key URLEncodedString], [self.token.verifier URLEncodedString]];\n    }\n    \n\tNSMutableString *extraParameters = [NSMutableString string];\n\t\n\t// Adding the optional parameters in sorted order isn't required by the OAuth spec, but it makes it possible to hard-code expected values in the unit tests.\n\tfor (NSString *parameterName in [[self.extraOAuthParameters allKeys]sortedArrayUsingSelector:@selector(compare:)]) {\n\t\t[extraParameters appendFormat:@\", %@=\\\"%@\\\"\",[parameterName URLEncodedString],[[self.extraOAuthParameters objectForKey:parameterName]URLEncodedString]];\n\t}\t\n    \n    NSString *oauthHeader = [NSString stringWithFormat:@\"OAuth realm=\\\"%@\\\", oauth_consumer_key=\\\"%@\\\", %@oauth_signature_method=\\\"%@\\\", oauth_signature=\\\"%@\\\", oauth_timestamp=\\\"%@\\\", oauth_nonce=\\\"%@\\\", oauth_version=\\\"1.0\\\"%@\", [self.realm URLEncodedString], [self.consumer.key URLEncodedString], oauthToken, [[self.signatureProvider name] URLEncodedString], [self.signature URLEncodedString], self.timestamp, self.nonce, extraParameters];\n\t\n    [self setValue:oauthHeader forHTTPHeaderField:@\"Authorization\"];\n}\n\n- (NSArray *)parameters {\n    \n    NSString *encodedParameters = nil;\n\n    if ([self.HTTPMethod isEqualToString:@\"GET\"] || [self.HTTPMethod isEqualToString:@\"DELETE\"]) {\n        encodedParameters = self.URL.query;\n\t} else if ([self.HTTPMethod isEqualToString:@\"POST\"] || [self.HTTPMethod isEqualToString:@\"PUT\"]) {\n        encodedParameters = [[[NSString alloc]initWithData:self.HTTPBody encoding:NSASCIIStringEncoding]autorelease];\n    }\n\n    if (encodedParameters.length == 0) {\n        return nil;\n    }\n    \n    NSArray *encodedParameterPairs = [encodedParameters componentsSeparatedByString:@\"&\"];\n    NSMutableArray *requestParameters = [NSMutableArray arrayWithCapacity:16];\n    \n    for (NSString *encodedPair in encodedParameterPairs) {\n        NSArray *encodedPairElements = [encodedPair componentsSeparatedByString:@\"=\"];\n        OARequestParameter *parameter = [OARequestParameter requestParameterWithName:[[encodedPairElements objectAtIndex:0] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] value:[[encodedPairElements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];\n        [requestParameters addObject:parameter];\n    }\n\n    return requestParameters;\n}\n\n- (void)setParameters:(NSArray *)parameters {\n    NSMutableString *encodedParameterPairs = [NSMutableString stringWithCapacity:256];\n    \n    int position = 1;\n    for (OARequestParameter *requestParameter in parameters) {\n        [encodedParameterPairs appendString:[requestParameter URLEncodedNameValuePair]];\n        if (position < parameters.count) {\n            [encodedParameterPairs appendString:@\"&\"];\n        }\n        position++;\n    }\n    \n    if ([self.HTTPMethod isEqualToString:@\"GET\"] || [self.HTTPMethod isEqualToString:@\"DELETE\"]) {\n        [self setURL:[NSURL URLWithString:[NSString stringWithFormat:@\"%@?%@\", [self.URL URLStringWithoutQuery], encodedParameterPairs]]];\n    } else if ([self.HTTPMethod isEqualToString:@\"POST\"] || [self.HTTPMethod isEqualToString:@\"PUT\"]) {\n        NSData *postData = [encodedParameterPairs dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];\n        [self setHTTPBody:postData];\n        [self setValue:[NSString stringWithFormat:@\"%d\",postData.length] forHTTPHeaderField:@\"Content-Length\"];\n        [self setValue:@\"application/x-www-form-urlencoded\" forHTTPHeaderField:@\"Content-Type\"];\n    }\n}\n\n- (void)_generateTimestamp {\n    [self setTimestamp:[NSString stringWithFormat:@\"%ld\", time(nil)]];\n}\n\n- (void)_generateNonce {\n    CFUUIDRef theUUID = CFUUIDCreate(nil);\n    CFStringRef string = CFUUIDCreateString(nil, theUUID);\n    CFRelease(theUUID);\n    [self setNonce:[NSString stringWithString:(NSString *)string]];\n    CFRelease(string);\n}\n\n- (NSString *)_signatureBaseString {\n    // OAuth Spec, Section 9.1.1 \"Normalize Request Parameters\"\n    // build a sorted array of both request parameters and OAuth header parameters\n    NSArray *parameters = [self parameters];\n    \n    NSMutableArray *parameterPairs = [NSMutableArray  arrayWithCapacity:(6+parameters.count)]; // 6 being the number of OAuth params in the Signature Base String\n    \n\t[parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_consumer_key\" value:self.consumer.key]URLEncodedNameValuePair]];\n\t[parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_signature_method\" value:[self.signatureProvider name]] URLEncodedNameValuePair]];\n\t[parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_timestamp\" value:self.timestamp]URLEncodedNameValuePair]];\n\t[parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_nonce\" value:self.nonce]URLEncodedNameValuePair]];\n\t[parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_version\" value:@\"1.0\"]URLEncodedNameValuePair]];\n\n    if (self.token.key.length > 0) {\n        [parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_token\" value:self.token.key]URLEncodedNameValuePair]];\n        if (self.token.verifier.length > 0) {\n\t\t\t[parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_verifier\" value:self.token.verifier]URLEncodedNameValuePair]];\n\t\t}\n    } else {\n\t\t[parameterPairs addObject:[[OARequestParameter requestParameterWithName:@\"oauth_callback\" value:@\"oob\"]URLEncodedNameValuePair]];\n\t}\n\n    for (OARequestParameter *param in parameters) {\n        [parameterPairs addObject:[param URLEncodedNameValuePair]];\n    }\n\n    NSArray *sortedPairs = [parameterPairs sortedArrayUsingSelector:@selector(compare:)];\n    NSString *normalizedRequestParameters = [sortedPairs componentsJoinedByString:@\"&\"];\n    \n    // OAuth Spec, Section 9.1.2 \"Concatenate Request Elements\"\n    NSString *ret = [NSString stringWithFormat:@\"%@&%@&%@\", self.HTTPMethod, [[self.URL URLStringWithoutQuery]URLEncodedString], [normalizedRequestParameters URLEncodedString]];\n\treturn ret;\n}\n\n- (void)dealloc {\n    [self setExtraOAuthParameters:nil];\n    [self setConsumer:nil];\n    [self setToken:nil];\n    [self setRealm:nil];\n    [self setSignatureProvider:nil];\n    [self setTimestamp:nil];\n    [self setNonce:nil];\n    [self setSignature:nil];\n\t[super dealloc];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OARequestParameter.h",
    "content": "//\n//  OARequestParameter.h\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import <Foundation/Foundation.h>\n#import \"NSString+URLEncoding.h\"\n\n@interface OARequestParameter : NSObject\n\n@property (nonatomic, retain) NSString *name;\n@property (nonatomic, retain) NSString *value;\n\n+ (id)requestParameterWithName:(NSString *)aName value:(NSString *)aValue;\n- (id)initWithName:(NSString *)aName value:(NSString *)aValue;\n- (NSString *)URLEncodedName;\n- (NSString *)URLEncodedValue;\n- (NSString *)URLEncodedNameValuePair;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OARequestParameter.m",
    "content": "//\n//  OARequestParameter.m\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import \"OARequestParameter.h\"\n\n\n@implementation OARequestParameter\n\n+ (id)requestParameterWithName:(NSString *)aName value:(NSString *)aValue {\n\treturn [[[[self class]alloc]initWithName:aName value:aValue]autorelease];\n}\n\n- (id)initWithName:(NSString *)aName value:(NSString *)aValue {\n    if (self = [super init]) {\n\t\tself.name = aName;\n\t\tself.value = aValue;\n\t}\n    return self;\n}\n\n- (NSString *)URLEncodedName {\n\treturn [self.name URLEncodedString];\n}\n\n- (NSString *)URLEncodedValue {\n    return [self.value URLEncodedString];\n}\n\n- (NSString *)URLEncodedNameValuePair {\n    return [NSString stringWithFormat:@\"%@=%@\", [self URLEncodedName], [self URLEncodedValue]];\n}\n\n- (void)dealloc {\n    [self setName:nil];\n    [self setValue:nil];\n\t[super dealloc];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAServiceTicket.h",
    "content": "//\n//  OAServiceTicket.h\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 11/5/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import <Foundation/Foundation.h>\n#import \"OAMutableURLRequest.h\"\n\n\n@interface OAServiceTicket : NSObject\n\n@property (nonatomic, retain) OAMutableURLRequest *request;\n@property (nonatomic, retain) NSURLResponse *response;\n@property (nonatomic, assign) BOOL didSucceed;\n\n- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSURLResponse *)aResponse didSucceed:(BOOL)success;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAServiceTicket.m",
    "content": "//\n//  OAServiceTicket.m\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 11/5/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import \"OAServiceTicket.h\"\n\n\n@implementation OAServiceTicket\n\n- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSURLResponse *)aResponse didSucceed:(BOOL)success {\n    if (self = [super init]) {\n\t\tself.request = aRequest;\n\t\tself.response = aResponse;\n\t\tself.didSucceed = success;\n\t}\n    return self;\n}\n\n- (void)dealloc {\n    [self setRequest:nil];\n    [self setResponse:nil];\n\t[super dealloc];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAToken.h",
    "content": "//\n//  OAToken.h\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n#import <Foundation/Foundation.h>\n\n@interface OAToken : NSObject\n\n@property (nonatomic, retain) NSString *verifier;\n@property (nonatomic, retain) NSString *key;\n@property (nonatomic, retain) NSString *secret;\n\n- (NSString *)pin;\n- (void)setPin:(NSString *)aPin;\n\n- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret;\n- (id)initWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix;\n- (id)initWithHTTPResponseBody:(NSString *)body;\n\n+ (OAToken *)token;\n+ (OAToken *)tokenWithKey:(NSString *)aKey secret:(NSString *)aSecret;\n+ (OAToken *)tokenWithHTTPResponseBody:(NSString *)body;\n+ (OAToken *)tokenWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix;\n\n- (void)storeInUserDefaultsWithServiceProviderName:(NSString *)provider prefix:(NSString *)prefix;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAToken.m",
    "content": "//\n//  OAToken.m\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n#import \"OAToken.h\"\n\n@implementation OAToken\n\n+ (OAToken *)token {\n    return [[[[self class]alloc]init]autorelease];\n}\n\n+ (OAToken *)tokenWithKey:(NSString *)aKey secret:(NSString *)aSecret {\n    return [[[[self class]alloc]initWithKey:aKey secret:aSecret]autorelease];\n}\n\n+ (OAToken *)tokenWithHTTPResponseBody:(NSString *)body {\n    return [[[[self class]alloc]initWithHTTPResponseBody:body]autorelease];\n}\n\n+ (OAToken *)tokenWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix {\n    return [[[[self class]alloc]initWithUserDefaultsUsingServiceProviderName:provider prefix:prefix]autorelease];\n}\n\n- (NSString *)pin {\n    return self.verifier;\n}\n\n- (void)setPin:(NSString *)aPin {\n    [self setVerifier:aPin];\n}\n\n- (id)init {\n\tif (self = [super init]) {\n\t\tself.key = @\"\";\n\t\tself.secret = @\"\";\n\t\tself.verifier = @\"\";\n\t}\n    return self;\n}\n\n- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret  {\n\tif (self = [super init]) {\n\t\tself.key = aKey;\n\t\tself.secret = aSecret;\n        self.verifier = @\"\";\n\t}\n\treturn self;\n}\n\n- (id)initWithHTTPResponseBody:(NSString *)body {\n\tif (self = [super init]) {\n        \n        if (body == nil) {\n            body = @\"\";\n        }\n    \n\t\tNSArray *pairs = [body componentsSeparatedByString:@\"&\"];\n\t\t\n\t\tfor (NSString *pair in pairs) {\n\t\t\tNSArray *elements = [pair componentsSeparatedByString:@\"=\"];\n\t\t\tif ([[elements objectAtIndex:0] isEqualToString:@\"oauth_token\"]) {\n\t\t\t\tself.key = [[elements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n\t\t\t} else if ([[elements objectAtIndex:0] isEqualToString:@\"oauth_token_secret\"]) {\n\t\t\t\tself.secret = [[elements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n\t\t\t}\n\t\t}\n        self.verifier = @\"\";\n\t}\n    \n    return self;\n}\n\n- (id)initWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix {\n    self = [super init];\n\tif (self) {\n\t\tNSString *theKey = [[NSUserDefaults standardUserDefaults]stringForKey:[NSString stringWithFormat:@\"OAUTH_%@_%@_KEY\", prefix, provider]];\n\t\tNSString *theSecret = [[NSUserDefaults standardUserDefaults]stringForKey:[NSString stringWithFormat:@\"OAUTH_%@_%@_SECRET\", prefix, provider]];\n        \n        BOOL nokey = (theKey.length == 0);\n        BOOL nosecret = (theSecret.length == 0);\n        \n        if ((nokey && nosecret) || (nokey || nosecret)) {\n            return nil;\n        }\n        \n\t\tself.key = theKey;\n\t\tself.secret = theSecret;\n        self.verifier = @\"\";\n\t}\n\treturn self;\n}\n\n- (void)dealloc {\n    [self setVerifier:nil];\n    [self setKey:nil];\n    [self setSecret:nil];\n\t[super dealloc];\n}\n\n- (void)storeInUserDefaultsWithServiceProviderName:(NSString *)provider prefix:(NSString *)prefix {\n\t[[NSUserDefaults standardUserDefaults]setObject:self.key forKey:[NSString stringWithFormat:@\"OAUTH_%@_%@_KEY\", prefix, provider]];\n\t[[NSUserDefaults standardUserDefaults]setObject:self.secret forKey:[NSString stringWithFormat:@\"OAUTH_%@_%@_SECRET\", prefix, provider]];\n\t[[NSUserDefaults standardUserDefaults]synchronize];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAuthConsumer.h",
    "content": "//\n//  OAuthConsumer.h\n//  OAuthConsumer\n//\n//  Created by Jon Crosby on 10/19/07.\n//  Copyright 2007 Kaboomerang LLC. All rights reserved.\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions:\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\n\n//\n//  FHSTwitterEngine OAuthConsumer Version 1.2.2\n//  As modified by Nate Symer (@natesymer)\n//\n\n#import <Foundation/Foundation.h>\n#import \"OAToken.h\"\n#import \"OAConsumer.h\"\n#import \"OAMutableURLRequest.h\"\n#import \"OARequestParameter.h\"\n#import \"OAServiceTicket.h\""
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/PluginTwitter.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tFAC2A8001777F9D400035D22 /* ShareTwitter.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC2A7FF1777F9D400035D22 /* ShareTwitter.m */; };\n\t\tFACAD88C1762C1B500D75ADE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FACAD88B1762C1B500D75ADE /* Foundation.framework */; };\n\t\tFACAD8BA1762C61A00D75ADE /* FHSTwitterEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8A51762C61A00D75ADE /* FHSTwitterEngine.m */; };\n\t\tFACAD8BB1762C61A00D75ADE /* NSString+URLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8A91762C61A00D75ADE /* NSString+URLEncoding.m */; };\n\t\tFACAD8BC1762C61A00D75ADE /* Base64TranscoderFHS.c in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8AB1762C61A00D75ADE /* Base64TranscoderFHS.c */; };\n\t\tFACAD8BD1762C61A00D75ADE /* OAConsumer.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8AE1762C61A00D75ADE /* OAConsumer.m */; };\n\t\tFACAD8BE1762C61A00D75ADE /* OAHMAC_SHA1SignatureProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8B01762C61A00D75ADE /* OAHMAC_SHA1SignatureProvider.m */; };\n\t\tFACAD8BF1762C61A00D75ADE /* OAMutableURLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8B21762C61A00D75ADE /* OAMutableURLRequest.m */; };\n\t\tFACAD8C01762C61A00D75ADE /* OARequestParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8B41762C61A00D75ADE /* OARequestParameter.m */; };\n\t\tFACAD8C11762C61A00D75ADE /* OAServiceTicket.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8B61762C61A00D75ADE /* OAServiceTicket.m */; };\n\t\tFACAD8C21762C61A00D75ADE /* OAToken.m in Sources */ = {isa = PBXBuildFile; fileRef = FACAD8B81762C61A00D75ADE /* OAToken.m */; };\n\t\tFACAD8C41762C64100D75ADE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FACAD8C31762C64100D75ADE /* UIKit.framework */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tFACAD8861762C1B500D75ADE /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/${PRODUCT_NAME}\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\tFAC2A7FE1777F9D400035D22 /* ShareTwitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareTwitter.h; sourceTree = \"<group>\"; };\n\t\tFAC2A7FF1777F9D400035D22 /* ShareTwitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShareTwitter.m; sourceTree = \"<group>\"; };\n\t\tFACAD8881762C1B500D75ADE /* libPluginTwitter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPluginTwitter.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFACAD88B1762C1B500D75ADE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\tFACAD8A41762C61A00D75ADE /* FHSTwitterEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FHSTwitterEngine.h; sourceTree = \"<group>\"; };\n\t\tFACAD8A51762C61A00D75ADE /* FHSTwitterEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FHSTwitterEngine.m; sourceTree = \"<group>\"; };\n\t\tFACAD8A81762C61A00D75ADE /* NSString+URLEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"NSString+URLEncoding.h\"; sourceTree = \"<group>\"; };\n\t\tFACAD8A91762C61A00D75ADE /* NSString+URLEncoding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = \"NSString+URLEncoding.m\"; sourceTree = \"<group>\"; };\n\t\tFACAD8AB1762C61A00D75ADE /* Base64TranscoderFHS.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Base64TranscoderFHS.c; sourceTree = \"<group>\"; };\n\t\tFACAD8AC1762C61A00D75ADE /* Base64TranscoderFHS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64TranscoderFHS.h; sourceTree = \"<group>\"; };\n\t\tFACAD8AD1762C61A00D75ADE /* OAConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAConsumer.h; sourceTree = \"<group>\"; };\n\t\tFACAD8AE1762C61A00D75ADE /* OAConsumer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAConsumer.m; sourceTree = \"<group>\"; };\n\t\tFACAD8AF1762C61A00D75ADE /* OAHMAC_SHA1SignatureProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAHMAC_SHA1SignatureProvider.h; sourceTree = \"<group>\"; };\n\t\tFACAD8B01762C61A00D75ADE /* OAHMAC_SHA1SignatureProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAHMAC_SHA1SignatureProvider.m; sourceTree = \"<group>\"; };\n\t\tFACAD8B11762C61A00D75ADE /* OAMutableURLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAMutableURLRequest.h; sourceTree = \"<group>\"; };\n\t\tFACAD8B21762C61A00D75ADE /* OAMutableURLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAMutableURLRequest.m; sourceTree = \"<group>\"; };\n\t\tFACAD8B31762C61A00D75ADE /* OARequestParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OARequestParameter.h; sourceTree = \"<group>\"; };\n\t\tFACAD8B41762C61A00D75ADE /* OARequestParameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OARequestParameter.m; sourceTree = \"<group>\"; };\n\t\tFACAD8B51762C61A00D75ADE /* OAServiceTicket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAServiceTicket.h; sourceTree = \"<group>\"; };\n\t\tFACAD8B61762C61A00D75ADE /* OAServiceTicket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAServiceTicket.m; sourceTree = \"<group>\"; };\n\t\tFACAD8B71762C61A00D75ADE /* OAToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAToken.h; sourceTree = \"<group>\"; };\n\t\tFACAD8B81762C61A00D75ADE /* OAToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAToken.m; sourceTree = \"<group>\"; };\n\t\tFACAD8B91762C61A00D75ADE /* OAuthConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAuthConsumer.h; sourceTree = \"<group>\"; };\n\t\tFACAD8C31762C64100D75ADE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };\n\t\tFACAD8CB1762C76800D75ADE /* PluginTwitter-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"PluginTwitter-Prefix.pch\"; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tFACAD8851762C1B500D75ADE /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFACAD8C41762C64100D75ADE /* UIKit.framework in Frameworks */,\n\t\t\t\tFACAD88C1762C1B500D75ADE /* Foundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tFACAD87D1762C1B500D75ADE = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAC2A7FE1777F9D400035D22 /* ShareTwitter.h */,\n\t\t\t\tFAC2A7FF1777F9D400035D22 /* ShareTwitter.m */,\n\t\t\t\tFACAD8CB1762C76800D75ADE /* PluginTwitter-Prefix.pch */,\n\t\t\t\tFACAD8A31762C61A00D75ADE /* FHSTwitterEngine */,\n\t\t\t\tFACAD88A1762C1B500D75ADE /* Frameworks */,\n\t\t\t\tFACAD8891762C1B500D75ADE /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFACAD8891762C1B500D75ADE /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFACAD8881762C1B500D75ADE /* libPluginTwitter.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFACAD88A1762C1B500D75ADE /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFACAD8C31762C64100D75ADE /* UIKit.framework */,\n\t\t\t\tFACAD88B1762C1B500D75ADE /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFACAD8A31762C61A00D75ADE /* FHSTwitterEngine */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFACAD8A41762C61A00D75ADE /* FHSTwitterEngine.h */,\n\t\t\t\tFACAD8A51762C61A00D75ADE /* FHSTwitterEngine.m */,\n\t\t\t\tFACAD8A61762C61A00D75ADE /* OAuthConsumer */,\n\t\t\t);\n\t\t\tpath = FHSTwitterEngine;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFACAD8A61762C61A00D75ADE /* OAuthConsumer */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFACAD8A71762C61A00D75ADE /* Categories */,\n\t\t\t\tFACAD8AA1762C61A00D75ADE /* Crytpo */,\n\t\t\t\tFACAD8AD1762C61A00D75ADE /* OAConsumer.h */,\n\t\t\t\tFACAD8AE1762C61A00D75ADE /* OAConsumer.m */,\n\t\t\t\tFACAD8AF1762C61A00D75ADE /* OAHMAC_SHA1SignatureProvider.h */,\n\t\t\t\tFACAD8B01762C61A00D75ADE /* OAHMAC_SHA1SignatureProvider.m */,\n\t\t\t\tFACAD8B11762C61A00D75ADE /* OAMutableURLRequest.h */,\n\t\t\t\tFACAD8B21762C61A00D75ADE /* OAMutableURLRequest.m */,\n\t\t\t\tFACAD8B31762C61A00D75ADE /* OARequestParameter.h */,\n\t\t\t\tFACAD8B41762C61A00D75ADE /* OARequestParameter.m */,\n\t\t\t\tFACAD8B51762C61A00D75ADE /* OAServiceTicket.h */,\n\t\t\t\tFACAD8B61762C61A00D75ADE /* OAServiceTicket.m */,\n\t\t\t\tFACAD8B71762C61A00D75ADE /* OAToken.h */,\n\t\t\t\tFACAD8B81762C61A00D75ADE /* OAToken.m */,\n\t\t\t\tFACAD8B91762C61A00D75ADE /* OAuthConsumer.h */,\n\t\t\t);\n\t\t\tpath = OAuthConsumer;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFACAD8A71762C61A00D75ADE /* Categories */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFACAD8A81762C61A00D75ADE /* NSString+URLEncoding.h */,\n\t\t\t\tFACAD8A91762C61A00D75ADE /* NSString+URLEncoding.m */,\n\t\t\t);\n\t\t\tpath = Categories;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFACAD8AA1762C61A00D75ADE /* Crytpo */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFACAD8AB1762C61A00D75ADE /* Base64TranscoderFHS.c */,\n\t\t\t\tFACAD8AC1762C61A00D75ADE /* Base64TranscoderFHS.h */,\n\t\t\t);\n\t\t\tpath = Crytpo;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tFACAD8871762C1B500D75ADE /* PluginTwitter */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = FACAD8961762C1B500D75ADE /* Build configuration list for PBXNativeTarget \"PluginTwitter\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tFACAD8841762C1B500D75ADE /* Sources */,\n\t\t\t\tFACAD8851762C1B500D75ADE /* Frameworks */,\n\t\t\t\tFACAD8861762C1B500D75ADE /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = PluginTwitter;\n\t\t\tproductName = PluginTwitter;\n\t\t\tproductReference = FACAD8881762C1B500D75ADE /* libPluginTwitter.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tFACAD87F1762C1B500D75ADE /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0460;\n\t\t\t\tORGANIZATIONNAME = zhangbin;\n\t\t\t};\n\t\t\tbuildConfigurationList = FACAD8821762C1B500D75ADE /* Build configuration list for PBXProject \"PluginTwitter\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = FACAD87D1762C1B500D75ADE;\n\t\t\tproductRefGroup = FACAD8891762C1B500D75ADE /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tFACAD8871762C1B500D75ADE /* PluginTwitter */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tFACAD8841762C1B500D75ADE /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFACAD8BA1762C61A00D75ADE /* FHSTwitterEngine.m in Sources */,\n\t\t\t\tFACAD8BB1762C61A00D75ADE /* NSString+URLEncoding.m in Sources */,\n\t\t\t\tFACAD8BC1762C61A00D75ADE /* Base64TranscoderFHS.c in Sources */,\n\t\t\t\tFACAD8BD1762C61A00D75ADE /* OAConsumer.m in Sources */,\n\t\t\t\tFACAD8BE1762C61A00D75ADE /* OAHMAC_SHA1SignatureProvider.m in Sources */,\n\t\t\t\tFACAD8BF1762C61A00D75ADE /* OAMutableURLRequest.m in Sources */,\n\t\t\t\tFACAD8C01762C61A00D75ADE /* OARequestParameter.m in Sources */,\n\t\t\t\tFACAD8C11762C61A00D75ADE /* OAServiceTicket.m in Sources */,\n\t\t\t\tFACAD8C21762C61A00D75ADE /* OAToken.m in Sources */,\n\t\t\t\tFAC2A8001777F9D400035D22 /* ShareTwitter.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\tFACAD8941762C1B500D75ADE /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFACAD8951762C1B500D75ADE /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tFACAD8971762C1B500D75ADE /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/PluginTwitter.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginTwitter-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFACAD8981762C1B500D75ADE /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/PluginTwitter.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginTwitter-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tFACAD8821762C1B500D75ADE /* Build configuration list for PBXProject \"PluginTwitter\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFACAD8941762C1B500D75ADE /* Debug */,\n\t\t\t\tFACAD8951762C1B500D75ADE /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tFACAD8961762C1B500D75ADE /* Build configuration list for PBXNativeTarget \"PluginTwitter\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFACAD8971762C1B500D75ADE /* Debug */,\n\t\t\t\tFACAD8981762C1B500D75ADE /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = FACAD87F1762C1B500D75ADE /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/ShareTwitter.h",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"InterfaceShare.h\"\n\n@interface ShareTwitter : NSObject <InterfaceShare>\n{\n    \n}\n\n@property BOOL debug;\n@property (copy, nonatomic) NSMutableDictionary* mShareInfo;\n\n/**\n * @brief interfaces of protocol : InterfaceShare\n */\n- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;\n- (void) share: (NSMutableDictionary*) shareInfo;\n- (void) setDebugMode: (BOOL) debug;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/twitter/proj.ios/ShareTwitter.m",
    "content": "/****************************************************************************\n Copyright (c) 2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"ShareTwitter.h\"\n#import \"FHSTwitterEngine.h\"\n#import \"ShareWrapper.h\"\n\n#define OUTPUT_LOG(...)     if (self.debug) NSLog(__VA_ARGS__);\n\n@implementation ShareTwitter\n\n@synthesize mShareInfo;\n@synthesize debug = __debug;\n\n- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo\n{\n    NSString* appKey = [cpInfo objectForKey:@\"TwitterKey\"];\n    NSString* appSecret = [cpInfo objectForKey:@\"TwitterSecret\"];\n\n    if (nil == appKey || nil == appSecret) {\n        return;\n    }\n\n    [[FHSTwitterEngine sharedEngine]permanentlySetConsumerKey:appKey andSecret:appSecret];\n}\n\n- (void) share: (NSMutableDictionary*) shareInfo\n{\n    self.mShareInfo = shareInfo;\n    if ([[FHSTwitterEngine sharedEngine]isAuthorized])\n    {\n        [self doShare];\n    } else {\n        UIViewController* controller = [self getCurrentRootViewController];\n        [[FHSTwitterEngine sharedEngine]showOAuthLoginControllerFromViewController:controller withCompletion:^(BOOL success) {\n            if (success) {\n                [self doShare];\n            } else {\n                [ShareWrapper onShareResult:self withRet:kShareFail withMsg:@\"Login Failed\"];\n            }\n        }];\n    }\n}\n\n- (void) setDebugMode: (BOOL) debug\n{\n    self.debug = debug;\n}\n\n- (NSString*) getSDKVersion\n{\n    return @\"20130607\";\n}\n\n- (NSString*) getPluginVersion\n{\n    return @\"0.2.0\";\n}\n\n- (void) doShare\n{\n    if (nil == mShareInfo) {\n        [ShareWrapper onShareResult:self withRet:kShareFail withMsg:@\"Shared info error\"];\n        return;\n    }\n\n    NSString* strText = [mShareInfo objectForKey:@\"SharedText\"];\n    NSString* strImagePath = [mShareInfo objectForKey:@\"SharedImagePath\"];\n\n    BOOL oldConfig = [UIApplication sharedApplication].networkActivityIndicatorVisible;\n    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;\n    \n    NSError* returnCode = nil;\n    if (nil != strImagePath) {\n        NSData* data = [NSData dataWithContentsOfFile:strImagePath];\n        returnCode = [[FHSTwitterEngine sharedEngine] postTweet:strText withImageData:data];\n    } else {\n        returnCode = [[FHSTwitterEngine sharedEngine]postTweet:strText];\n    }\n    [UIApplication sharedApplication].networkActivityIndicatorVisible = oldConfig;\n\n    if (returnCode) {\n        NSString* strErrorCode = [NSString stringWithFormat:@\"ErrorCode %d\", returnCode.code];\n        [ShareWrapper onShareResult:self withRet:kShareFail withMsg:strErrorCode];\n    } else {\n        [ShareWrapper onShareResult:self withRet:kShareSuccess withMsg:@\"Share Succeed\"];\n    }\n}\n\n- (UIViewController *)getCurrentRootViewController {\n\n    UIViewController *result = nil;\n\n    // Try to find the root view controller programmically\n\n    // Find the top window (that is not an alert view or other window)\n    UIWindow *topWindow = [[UIApplication sharedApplication] keyWindow];\n    if (topWindow.windowLevel != UIWindowLevelNormal)\n    {\n        NSArray *windows = [[UIApplication sharedApplication] windows];\n        for(topWindow in windows)\n        {\n            if (topWindow.windowLevel == UIWindowLevelNormal)\n                break;\n        }\n    }\n\n    UIView *rootView = [[topWindow subviews] objectAtIndex:0];\n    id nextResponder = [rootView nextResponder];\n\n    if ([nextResponder isKindOfClass:[UIViewController class]])\n        result = nextResponder;\n    else if ([topWindow respondsToSelector:@selector(rootViewController)] && topWindow.rootViewController != nil)\n        result = topWindow.rootViewController;\n    else\n        NSAssert(NO, @\"Could not find a root view controller.\");\n\n    return result;\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/alipay_msp.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/UCGameSDK.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginUC</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.plugin\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <applicationCfg keyword=\"cn.uc.gamesdk.view.SdkWebActivity\">\n       <activity\n            android:name=\"cn.uc.gamesdk.view.SdkWebActivity\"\n            android:configChanges=\"keyboardHidden|orientation|screenSize\"\n            android:theme=\"@android:style/Theme.Translucent\"\n            android:windowSoftInputMode=\"adjustResize\" >\n            <intent-filter>\n                <action android:name=\"cn.uc.gamesdk.sdkweb\" />\n                <category android:name=\"android.intent.category.DEFAULT\" />\n            </intent-filter>\n        </activity>\n    </applicationCfg>\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n        <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n        <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\" />\n        <uses-permission android:name=\"android.permission.INTERNET\" />\n        <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n        <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n        <uses-permission android:name=\"android.permission.GET_TASKS\" />\n    </permissionCfg>\n</manifestConfig>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginUC\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-17\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/IAPOnlineUC.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\nimport cn.uc.gamesdk.UCCallbackListener;\nimport cn.uc.gamesdk.UCGameSDK;\nimport cn.uc.gamesdk.UCGameSDKStatusCode;\nimport cn.uc.gamesdk.info.OrderInfo;\nimport cn.uc.gamesdk.info.PaymentInfo;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.text.TextUtils;\nimport android.util.Log;\n\npublic class IAPOnlineUC implements InterfaceIAP {\n\n    private static final String LOG_TAG = \"IAPOnlineUC\";\n    private static Activity mContext = null;\n    private static IAPOnlineUC mAdapter = null;\n    private static boolean bDebug = false;\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(LOG_TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    protected static void LogD(String msg) {\n        if (bDebug) {\n            Log.d(LOG_TAG, msg);\n        }\n    }\n\n    public IAPOnlineUC(Context context) {\n        mContext = (Activity) context;\n        mAdapter = this;\n    }\n\n    @Override\n    public void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n        final Hashtable<String, String> curInfo = cpInfo;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                UCWrapper.initSDK(mContext, curInfo, bDebug, null);\n            }\n        });\n    }\n\n    @Override\n    public void payForProduct(Hashtable<String, String> info) {\n        LogD(\"payForProduct invoked \" + info.toString());\n        final Hashtable<String, String> curInfo = info;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                if (UCWrapper.isLogined()) {\n                    addPayment(curInfo);\n                } else {\n                    UCWrapper.userLogin(mContext, new UCCallbackListener<String>() {\n                        @Override\n                        public void callback(int code, String msg) {\n                            switch(code) {\n                            case UCGameSDKStatusCode.SUCCESS:\n                                addPayment(curInfo);\n                                break;\n                            default:\n                                payResult(IAPWrapper.PAYRESULT_FAIL, msg);\n                                break;\n                            }\n                        }\n                    });\n                }\n            }\n        });\n    }\n\n    @Override\n    public void setDebugMode(boolean debug) {\n        bDebug = debug;\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return UCWrapper.getSDKVersion();\n    }\n\n    private static void payResult(int ret, String msg) {\n        IAPWrapper.onPayResult(mAdapter, ret, msg);\n        LogD(\"IAPOnlineUC result : \" + ret + \" msg : \" + msg);\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return \"0.2.0\";\n    }\n\n    private static boolean paying = false;\n    private void addPayment(Hashtable<String, String> curInfo) {\n        try {\n            paying = true;\n            PaymentInfo payInfo = new PaymentInfo();\n\n            String customInfo = curInfo.get(\"UCCustomInfo\");\n            if (null != customInfo && ! TextUtils.isEmpty(customInfo)) {\n                payInfo.setCustomInfo(customInfo);\n            }\n\n            String strServerID = curInfo.get(\"UCServerID\");\n            if (null != strServerID && ! TextUtils.isEmpty(strServerID)) {\n                int serverID = Integer.parseInt(strServerID);\n                payInfo.setServerId(serverID);\n            }\n\n            String roleID = curInfo.get(\"UCRoleID\");\n            if (null != roleID && ! TextUtils.isEmpty(roleID)) {\n                payInfo.setRoleId(roleID);\n            }\n\n            String strRoleName = curInfo.get(\"UCRoleName\");\n            if (null != strRoleName && ! TextUtils.isEmpty(strRoleName)) {\n                payInfo.setRoleName(strRoleName);\n            }\n\n            String strRoleLevel = curInfo.get(\"UCRoleLevel\");\n            if (null != strRoleLevel && ! TextUtils.isEmpty(strRoleLevel)) {\n                payInfo.setGrade(strRoleLevel);\n            }\n\n            String strPrice = curInfo.get(\"productPrice\");\n            float fPrice = Float.parseFloat(strPrice);\n            payInfo.setAmount(fPrice);\n\n            UCGameSDK.defaultSDK().pay(mContext, payInfo, new UCCallbackListener<OrderInfo>(){\n                @Override\n                public void callback(int arg0, OrderInfo arg1) {\n                    if (! paying) {\n                        return;\n                    }\n\n                    switch (arg0) {\n                    case UCGameSDKStatusCode.SUCCESS:\n                        IAPOnlineUC.payResult(IAPWrapper.PAYRESULT_SUCCESS, \"Pay Succeed\");\n                        break;\n                    default:\n                        IAPOnlineUC.payResult(IAPWrapper.PAYRESULT_FAIL, \"Unknown Error\");\n                        break;\n                    }\n\n                    paying = false;\n                }\n            });\n        } catch (Exception e) {\n            paying = false;\n            IAPOnlineUC.payResult(IAPWrapper.PAYRESULT_FAIL, \"Unknown Error\");\n            LogE(\"Unknown Error\", e);\n        }\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\nimport cn.uc.gamesdk.UCCallbackListener;\nimport cn.uc.gamesdk.UCGameSDK;\nimport cn.uc.gamesdk.UCGameSDKStatusCode;\nimport cn.uc.gamesdk.UCLogLevel;\nimport cn.uc.gamesdk.UCOrientation;\nimport cn.uc.gamesdk.info.GameParamInfo;\nimport android.content.Context;\nimport android.content.pm.ActivityInfo;\nimport android.content.res.Configuration;\n\npublic class UCWrapper {\n\n    private static boolean isInited = false;\n\n    public static void initSDK(Context ctx, Hashtable<String, String> cpInfo, boolean isDebug, UCCallbackListener<String> listener) {\n        if (isInited) {\n            return;\n        }\n\n        try {\n            final UCCallbackListener<String> curListener = listener;\n            UCGameSDK.defaultSDK().setLogoutNotifyListener(new UCCallbackListener<String>() {\n                @Override\n                public void callback(int statuscode, String data) {\n                    switch (statuscode) {\n                    case UCGameSDKStatusCode.SUCCESS:\n                        mLogined = false;\n                        break;\n                    default:\n                        break;\n                    }\n                    \n                    if (null != curListener) {\n                        curListener.callback(statuscode, data);\n                    }\n                }\n            });\n\n            String strCpId = cpInfo.get(\"UCCpID\");\n            String strGameId = cpInfo.get(\"UCGameID\");\n            String strServerId = cpInfo.get(\"UCServerID\");\n\n            int cpId = Integer.parseInt(strCpId);\n            int gameId = Integer.parseInt(strGameId);\n            int serverId = Integer.parseInt(strServerId);\n\n            GameParamInfo gpi = new GameParamInfo();\n            gpi.setCpId(cpId);\n            gpi.setGameId(gameId);\n            gpi.setServerId(serverId);\n\n            if (isLandscape(ctx)) {\n                UCGameSDK.defaultSDK().setOrientation(UCOrientation.LANDSCAPE);\n            }\n\n            UCGameSDK.defaultSDK().initSDK(ctx, UCLogLevel.ERROR, isDebug, gpi, new UCCallbackListener<String>() {\n                @Override\n                public void callback(int code, String msg) {\n                    System.out.println(\"msg:\" + msg); \n                    switch (code) {\n                        case UCGameSDKStatusCode.SUCCESS:\n                            isInited = true;\n                            break;\n                        case UCGameSDKStatusCode.INIT_FAIL:\n                        default:\n                            isInited = false;\n                            break;\n                    }\n                }\n            });\n        } catch (Exception e) {\n            isInited = false;\n        }\n    }\n\n    public static boolean SDKInited() {\n        return isInited;\n    }\n\n    public static boolean isLandscape(Context ctx)\n    {\n        Configuration config = ctx.getResources().getConfiguration();\n        int orientation = config.orientation;\n\n        if (orientation != Configuration.ORIENTATION_LANDSCAPE &&\n            orientation != Configuration.ORIENTATION_PORTRAIT)\n        {\n            orientation = Configuration.ORIENTATION_PORTRAIT;\n        }\n\n        return (orientation == Configuration.ORIENTATION_LANDSCAPE);\n    }\n\n    public static String getSDKVersion() {\n        return \"2.3.4\";\n    }\n\n    private static boolean mLogined = false;\n    private static boolean waitHandle = false;\n    public static void userLogin(Context ctx, UCCallbackListener<String> listener) {\n        try {\n            waitHandle = true;\n            final UCCallbackListener<String> curListener = listener;\n            UCGameSDK.defaultSDK().login(ctx, new UCCallbackListener<String>() {\n                @Override\n                public void callback(int code, String msg) {\n                    if (! waitHandle) {\n                        return;\n                    }\n\n                    switch(code) {\n                    case UCGameSDKStatusCode.SUCCESS:\n                        mLogined = true;\n                        break;\n                    default:\n                        mLogined = false;\n                        break;\n                    }\n                    waitHandle = false;\n                    curListener.callback(code, msg);\n                }\n            });\n        } catch (Exception e) {\n            mLogined = false;\n            waitHandle = false;\n            listener.callback(UCGameSDKStatusCode.FAIL, \"Login Failed\");\n        }\n    }\n\n    public static void userLogout() {\n        try {\n            UCGameSDK.defaultSDK().logout();\n            mLogined = false;\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n\n    public static boolean isLogined() {\n        return mLogined;\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UserUC.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\nimport cn.uc.gamesdk.UCCallbackListener;\nimport cn.uc.gamesdk.UCGameSDK;\nimport cn.uc.gamesdk.UCGameSDKStatusCode;\nimport android.content.Context;\nimport android.util.Log;\n\npublic class UserUC implements InterfaceUser {\n\n    private static Context mContext = null;\n    protected static String TAG = \"UserUC\";\n    private static InterfaceUser mAdapter = null;\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    private static boolean isDebug = false;\n    protected static void LogD(String msg) {\n        if (isDebug) {\n            Log.d(TAG, msg);\n        }\n    }\n\n    public UserUC(Context context) {\n        mContext = context;\n        mAdapter = this;\n    }\n\n    @Override\n    public void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n        final Hashtable<String, String> curInfo = cpInfo;\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                UCWrapper.initSDK(mContext, curInfo, isDebug, new UCCallbackListener<String>() {\n                    @Override\n                    public void callback(int statuscode, String data) {\n                        switch (statuscode) {\n                        case UCGameSDKStatusCode.SUCCESS:\n                            UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGOUT_SUCCEED, \"User Logout!\");\n                            break;\n                        default:\n                            break;\n                        }\n                    }\n                });\n            }\n        });\n    }\n\n    @Override\n    public void login() {\n        if (! UCWrapper.SDKInited()) {\n            UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_FAILED, \"SDK init failed\");\n            return;\n        }\n\n        if (isLogined()) {\n            UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_SUCCEED, \"Already logined!\");\n            return;\n        }\n\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                UCWrapper.userLogin(mContext, new UCCallbackListener<String>() {\n                    @Override\n                    public void callback(int code, String msg) {\n                        switch(code) {\n                        case UCGameSDKStatusCode.SUCCESS:\n                            UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_SUCCEED, msg);\n                            break;\n                        default:\n                            UserWrapper.onActionResult(mAdapter, UserWrapper.ACTION_RET_LOGIN_FAILED, msg);\n                            break;\n                        }\n                    }\n                });\n            }\n        });\n    }\n\n    @Override\n    public void logout() {\n        if (! isLogined()) {\n            LogD(\"User not logined!\");\n            return;\n        }\n\n        PluginWrapper.runOnMainThread(new Runnable() {\n            @Override\n            public void run() {\n                UCWrapper.userLogout();\n            }\n        });\n    }\n\n    @Override\n    public boolean isLogined() {\n        return UCWrapper.isLogined();\n    }\n\n    @Override\n    public String getSessionID() {\n        LogD(\"getSessionID() invoked!\");\n        return UCGameSDK.defaultSDK().getSid();\n    }\n\n    @Override\n    public void setDebugMode(boolean debug) {\n        isDebug = debug;\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return \"0.2.0\";\n    }\n\n    @Override\n    public String getSDKVersion() {\n        return UCWrapper.getSDKVersion();\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/umeng_sdk.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginUmeng</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libAnalyticsUmeng\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n        <uses-permission android:name=\"android.permission.INTERNET\" />\n        <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n    </permissionCfg>\n</manifestConfig> \n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginUmeng\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.android/src/org/cocos2dx/plugin/AnalyticsUmeng.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.HashMap;\nimport java.util.Hashtable;\nimport java.util.Iterator;\n\nimport org.json.JSONObject;\n\nimport android.content.Context;\nimport android.util.Log;\n\nimport com.umeng.analytics.MobclickAgent;\n\npublic class AnalyticsUmeng implements InterfaceAnalytics{\n    \n    private Context mContext = null;\n    \n    protected static String TAG = \"AnalyticsUmeng\";\n\n    protected static void LogE(String msg, Exception e) {\n        Log.e(TAG, msg, e);\n        e.printStackTrace();\n    }\n\n    private static boolean isDebug = true;\n    protected static void LogD(String msg) {\n        if (isDebug) {\n            Log.d(TAG, msg);\n        }\n    }\n\n    public AnalyticsUmeng(Context context) {\n        mContext = context;\n        MobclickAgent.setWrapper(\"Cocos2d-x\", \"1.0\");\n    }\n    \n    public boolean isValid() {\n        return mContext != null;\n    }\n    @Override\n    public void startSession(String appKey) {\n        LogD(\"startSession invoked!\");\n        MobclickAgent.onResume(mContext);\n    }\n\n    @Override\n    public void stopSession() {\n        LogD(\"stopSession invoked!\");\n        MobclickAgent.onPause(mContext);\n    }\n\n    @Override\n    public void setSessionContinueMillis(int millis) {\n        LogD(\"setSessionContinueMillis invoked!\");\n        MobclickAgent.setSessionContinueMillis(millis);\n    }\n\n    @Override\n    public void setCaptureUncaughtException(boolean isEnabled) {\n        LogD(\"setCaptureUncaughtException invoked!\");\n        if (isEnabled) {\n            MobclickAgent.onError(mContext);\n        }\n    }\n\n    @Override\n    public void setDebugMode(boolean isDebugMode) {\n        isDebug = isDebugMode;\n        MobclickAgent.setDebugMode(isDebugMode);\n    }\n\n    @Override\n    public void logError(String errorId, String message) {\n        LogD(\"logError invoked!\");\n        MobclickAgent.reportError(mContext, message);\n    }\n\n    @Override\n    public void logEvent(String eventId) {\n        LogD(\"logEvent(\" + eventId + \") invoked!\");\n        MobclickAgent.onEvent(mContext, eventId);\n    }\n\n    @Override\n    public void logEvent(String eventId, Hashtable<String, String> paramMap) {\n        LogD(\"logEvent(\" + eventId + \",\" + paramMap.toString() + \") invoked!\");\n        HashMap<String, String> curParam = changeTableToMap(paramMap);\n        MobclickAgent.onEvent(mContext, eventId, curParam);\n    }\n\n    @Override\n    public void logTimedEventBegin(String eventId) {\n        LogD(\"logTimedEventBegin(\" + eventId + \") invoked!\");\n        MobclickAgent.onEventBegin(mContext, eventId);\n    }\n\n    @Override\n    public void logTimedEventEnd(String eventId) {\n        LogD(\"logTimedEventEnd(\" + eventId + \") invoked!\");\n        MobclickAgent.onEventEnd(mContext, eventId);\n    }\n\n    @Override\n    public String getSDKVersion() {\n        LogD(\"getSDKVersion invoked!\");\n        return \"UMeng no version info\";\n    }\n\n    protected String getConfigParams(String key) {\n        LogD(\"getConfigParams(\" + key + \") invoked!\");\n        if (!isValid()) return null;\n        String ret = \"\";\n        try{\n            ret = MobclickAgent.getConfigParams(mContext, key);\n        } catch(Exception e){\n            LogE(\"Exception in logTimedEventBegin\", e);\n        }\n        LogD(\"get config : \" + ret);\n        return ret;\n    }\n    \n    protected void updateOnlineConfig() {\n        LogD(\"updateOnlineConfig invoked!\");\n        if (!isValid()) return;\n        try{\n            MobclickAgent.updateOnlineConfig(mContext);\n        } catch(Exception e){\n            LogE(\"Exception in updateOnlineConfig\", e);\n        }\n    }\n\n    protected void logEventWithLabel(JSONObject eventInfo) {\n        LogD(\"logEventWithLabel invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try{\n            String eventId = eventInfo.getString(\"Param1\");\n            String label = eventInfo.getString(\"Param2\");\n            MobclickAgent.onEvent(mContext, eventId, label);\n        } catch(Exception e){\n            LogE(\"Exception in logEventWithLabel\", e);\n        }\n    }\n    \n    protected void logEventWithDurationLabel(JSONObject eventInfo) {\n        LogD(\"logEventWithDurationLabel invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try {\n            String eventId = eventInfo.getString(\"Param1\");\n            int duration = eventInfo.getInt(\"Param2\");\n            if (eventInfo.has(\"Param3\")) {\n                String label = eventInfo.getString(\"Param3\");\n                MobclickAgent.onEventDuration(mContext, eventId, label, duration);\n            } else {\n                MobclickAgent.onEventDuration(mContext, eventId, duration);\n            }\n        } catch (Exception e) {\n            LogE(\"Exception in logEventWithDurationLabel\", e);\n        }\n    }\n\n    protected void logEventWithDurationParams(JSONObject eventInfo) {\n        LogD(\"logEventWithDurationParams invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try {\n            String eventId = eventInfo.getString(\"Param1\");\n            int duration = eventInfo.getInt(\"Param2\");\n            if (eventInfo.has(\"Param3\")) {\n                JSONObject params = eventInfo.getJSONObject(\"Param3\");\n                HashMap<String, String> curMap = getMapFromJson(params);\n                MobclickAgent.onEventDuration(mContext, eventId, curMap, duration);\n            } else {\n                MobclickAgent.onEventDuration(mContext, eventId, duration);\n            }\n        } catch (Exception e) {\n            LogE(\"Exception in logEventWithDurationParams\", e);\n        }\n    }\n\n    protected void logEventWithDuration(JSONObject eventInfo) {\n        LogD(\"logEventWithDuration invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try{\n            String eventId = eventInfo.getString(\"Param1\");\n            int duration = eventInfo.getInt(\"Param2\");\n            MobclickAgent.onEventDuration(mContext, eventId, duration);\n        } catch(Exception e){\n            LogE(\"Exception in logEventWithDuration\", e);\n        }\n    }\n\n    protected void logTimedEventWithLabelBegin(JSONObject eventInfo) {\n        LogD(\"logTimedEventWithLabelBegin invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try{\n            String eventId = eventInfo.getString(\"Param1\");\n            String label = eventInfo.getString(\"Param2\");\n            MobclickAgent.onEventBegin(mContext, eventId, label);\n        } catch(Exception e){\n            LogE(\"Exception in logTimedEventWithLabelBegin\", e);\n        }\n    }\n    \n    protected void logTimedEventWithLabelEnd(JSONObject eventInfo) {\n        LogD(\"logTimedEventWithLabelEnd invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try{\n            String eventId = eventInfo.getString(\"Param1\");\n            String label = eventInfo.getString(\"Param2\");\n            MobclickAgent.onEventEnd(mContext, eventId, label);\n        } catch(Exception e){\n            LogE(\"Exception in logTimedEventWithLabelEnd\", e);\n        }\n    }\n    \n    protected void logTimedKVEventBegin(JSONObject eventInfo) {\n        LogD(\"logTimedKVEventBegin invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try{\n            String eventId = eventInfo.getString(\"Param1\");\n            String label = eventInfo.getString(\"Param2\");\n            JSONObject params = eventInfo.getJSONObject(\"Param3\");\n            \n            if (params != null) {\n                HashMap<String, String> curMap = getMapFromJson(params);\n                MobclickAgent.onKVEventBegin(mContext, eventId, curMap, label);\n            }\n        } catch(Exception e){\n            LogE(\"Exception in logTimedKVEventBegin\", e);\n        }\n    }\n    \n    protected void logTimedKVEventEnd(JSONObject eventInfo) {\n        LogD(\"logTimedKVEventEnd invoked! event : \" + eventInfo.toString());\n        if (!isValid()) return;\n        try{\n            String eventId = eventInfo.getString(\"Param1\");\n            String label = eventInfo.getString(\"Param2\");\n            MobclickAgent.onKVEventEnd(mContext, eventId, label);\n        } catch(Exception e){\n            LogE(\"Exception in logTimedKVEventEnd\", e);\n        }\n    }\n\n    private HashMap<String, String> changeTableToMap(Hashtable<String, String> param) {\n        HashMap<String, String> retParam = new HashMap<String, String>();\n        for(Iterator<String> it = param.keySet().iterator(); it.hasNext(); ) {   \n            String key = it.next();\n            String value = param.get(key);\n\n            retParam.put(key, value);\n        }\n\n        return retParam;\n    }\n\n    private HashMap<String, String> getMapFromJson(JSONObject json) {\n        HashMap<String, String> curMap = new HashMap<String, String>();\n        try {\n            @SuppressWarnings(\"rawtypes\")\n            Iterator it = json.keys();\n            while (it.hasNext()) {\n                String key = (String) it.next();\n                String value = json.getString(key);\n                curMap.put(key, value);\n            }\n        } catch (Exception e) {\n            LogE(\"Error when get HashMap from JSONObject\", e);\n        }\n\n        return curMap;\n    }\n\n    @Override\n    public String getPluginVersion() {\n        return \"0.2.0\";\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.ios/AnalyticsUmeng.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import \"InterfaceAnalytics.h\"\n\n@interface AnalyticsUmeng : NSObject <InterfaceAnalytics>\n{\n}\n\n@property BOOL debug;\n\n/**\n interfaces of protocol : InterfaceAnalytics\n */\n- (void) startSession: (NSString*) appKey;\n- (void) stopSession;\n- (void) setSessionContinueMillis: (long) millis;\n- (void) setCaptureUncaughtException: (BOOL) isEnabled;\n- (void) setDebugMode: (BOOL) isDebugMode;\n- (void) logError: (NSString*) errorId withMsg:(NSString*) message;\n- (void) logEvent: (NSString*) eventId;\n- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap;\n- (void) logTimedEventBegin: (NSString*) eventId;\n- (void) logTimedEventEnd: (NSString*) eventId;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n/**\n interfaces of umeng SDK\n */\n- (void) updateOnlineConfig;\n- (NSString*) getConfigParams: (NSString*) key;\n\n/**\n @brief logEvent with label. \n @param params The dictionary include eventId & label\n                get eventId with key 'Param1' from dictionary\n                get label with key 'Param2' from dictionary\n */\n- (void) logEventWithLabel: (NSMutableDictionary*) params;\n\n/**\n @brief logEvent with duration.\n @param params The dictionary include eventId & duration\n                 get eventId with key 'Param1' from dictionary\n                 get duration with key 'Param2' from dictionary\n */\n- (void) logEventWithDuration: (NSMutableDictionary*) params;\n\n/**\n @brief logEvent with duration & label.\n @param params The dictionary include eventId & duration & label\n                 get eventId with key 'Param1' from dictionary\n                 get duration with key 'Param2' from dictionary\n                 get label with key 'Param3' from dictionary\n */\n- (void) logEventWithDurationLabel: (NSMutableDictionary*) params;\n\n/**\n @brief logEvent with duration & attributes.\n @param params The dictionary include eventId & duration & attributes\n                 get eventId with key 'Param1' from dictionary\n                 get duration with key 'Param2' from dictionary\n                 get attributes with key 'Param3' from dictionary\n */\n- (void) logEventWithDurationParams: (NSMutableDictionary*) params;\n\n/**\n @brief log timed event begin with label.\n @param params The dictionary include eventId & label\n                 get eventId with key 'Param1' from dictionary\n                 get label with key 'Param2' from dictionary\n */\n- (void) logTimedEventWithLabelBegin: (NSMutableDictionary*) params;\n\n/**\n @brief log timed event end with label.\n @param params The dictionary include eventId & label\n                 get eventId with key 'Param1' from dictionary\n                 get label with key 'Param2' from dictionary\n */\n- (void) logTimedEventWithLabelEnd: (NSMutableDictionary*) params;\n\n/**\n @brief log timed KV event with label & attributes.\n @param params The dictionary include eventId & label & attributes\n                 get eventId with key 'Param1' from dictionary\n                 get label with key 'Param2' from dictionary\n                 get attributes with key 'Param3' from dictionary\n */\n- (void) logTimedKVEventBegin: (NSMutableDictionary*) params;\n\n/**\n @brief log timed KV event end with label.\n @param params The dictionary include eventId & label\n                 get eventId with key 'Param1' from dictionary\n                 get label with key 'Param2' from dictionary\n */\n- (void) logTimedKVEventEnd: (NSMutableDictionary*) params;\n\n/**\n @brief start session with policy & channelId.\n @param params The dictionary include appKey & policy & channelId\n                 get appKey with key 'Param1' from dictionary\n                 get policy(NSNumber*) with key 'Param2' from dictionary\n                 get channelId with key 'Param3' from dictionary\n */\n- (void) startSessionWithParams: (NSMutableDictionary*) params;\n- (void) checkUpdate;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.ios/AnalyticsUmeng.m",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#import \"AnalyticsUmeng.h\"\n#import \"MobClick.h\"\n\n#define OUTPUT_LOG(...)     if (self.debug) NSLog(__VA_ARGS__);\n\n@implementation AnalyticsUmeng\n\n@synthesize debug = __debug;\n\n- (void) startSession: (NSString*) appKey\n{\n    OUTPUT_LOG(@\"Umeng startSession invoked\");\n    [[MobClick class] performSelector:@selector(setWrapperType:wrapperVersion:) withObject:@\"Cocos2d-x\" withObject:@\"1.0\"];\n    [MobClick startWithAppkey:appKey];\n}\n\n- (void) stopSession\n{\n    OUTPUT_LOG(@\"Umeng stopSession in umeng not available on iOS\");\n}\n\n- (void) setSessionContinueMillis: (long) millis\n{\n    OUTPUT_LOG(@\"Umeng setSessionContinueMillis in umeng not available on iOS\");\n}\n\n- (void) setCaptureUncaughtException: (BOOL) isEnabled\n{\n    OUTPUT_LOG(@\"Umeng setCaptureUncaughtException invoked\");\n    [MobClick setCrashReportEnabled:isEnabled];\n}\n\n- (void) setDebugMode: (BOOL) isDebugMode\n{\n    OUTPUT_LOG(@\"Umeng setDebugMode invoked\");\n    self.debug = isDebugMode;\n    [MobClick setLogEnabled:isDebugMode];\n}\n\n- (void) logError: (NSString*) errorId withMsg:(NSString*) message\n{\n    OUTPUT_LOG(@\"logError in umeng not available on iOS\");\n}\n\n- (void) logEvent: (NSString*) eventId\n{\n    OUTPUT_LOG(@\"Umeng logEvent invoked\");\n    [MobClick event:eventId];\n}\n\n- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap\n{\n    OUTPUT_LOG(@\"Umeng logEventWithParam invoked\");\n    if (paramMap != nil) {\n        [MobClick event:eventId attributes:paramMap];\n    } else {\n        [MobClick event:eventId];\n    }\n}\n\n- (void) logTimedEventBegin: (NSString*) eventId\n{\n    OUTPUT_LOG(@\"Umeng logTimedEventBegin invoked\");\n    [MobClick beginEvent:eventId];\n}\n\n- (void) logTimedEventEnd: (NSString*) eventId\n{\n    OUTPUT_LOG(@\"Umeng logTimedEventEnd invoked\");\n    [MobClick endEvent:eventId];\n}\n\n- (NSString*) getSDKVersion\n{\n    return @\"2.2.0\";\n}\n\n- (NSString*) getPluginVersion\n{\n    return @\"0.2.0\";\n}\n\n- (void) updateOnlineConfig\n{\n    OUTPUT_LOG(@\"Umeng updateOnlineConfig invoked\");\n    [MobClick updateOnlineConfig];\n}\n\n- (NSString*) getConfigParams: (NSString*) key\n{\n    OUTPUT_LOG(@\"Umeng getConfigParams invoked (%@)\", key);\n    return [MobClick getConfigParams:key];\n}\n\n- (void) logEventWithLabel: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logEventWithLabel invoked (%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSString* label = (NSString*) [params objectForKey:@\"Param2\"];\n    if (label) {\n        [MobClick event:eventId label:label];\n    } else {\n        [MobClick event:eventId];\n    }\n}\n\n- (void) logEventWithDuration: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logEventWithDuration invoked(%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSNumber* duration = (NSNumber*) [params objectForKey:@\"Param2\"];\n    long numDur = [duration longValue];\n    [MobClick event:eventId durations:numDur];\n}\n\n- (void) logEventWithDurationLabel:(NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logEventWithDurationLabel invoked(%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSNumber* duration = (NSNumber*) [params objectForKey:@\"Param2\"];\n    NSString* label = (NSString*) [params objectForKey:@\"Param3\"];\n    long numDur = [duration longValue];\n\n    if (! label) {\n        [MobClick event:eventId durations:numDur];\n    } else {\n        [MobClick event:eventId label:label durations:numDur];\n    }\n}\n\n- (void) logEventWithDurationParams: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logEventWithDurationParams invoked(%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSNumber* duration = (NSNumber*) [params objectForKey:@\"Param2\"];\n    NSMutableDictionary* paramMap = (NSMutableDictionary*) [params objectForKey:@\"Param3\"];\n    long numDur = [duration longValue];\n\n    if (! paramMap) {\n        [MobClick event:eventId durations:numDur];\n    } else {\n        [MobClick event:eventId attributes:paramMap durations:numDur];\n    }\n}\n\n- (void) logTimedEventWithLabelBegin: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logTimedEventWithLabelBegin invoked(%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSString* label = (NSString*) [params objectForKey:@\"Param2\"];\n\n    if (! label) {\n        [MobClick beginEvent:eventId];\n    } else {\n        [MobClick beginEvent:eventId label:label];\n    }\n}\n\n- (void) logTimedEventWithLabelEnd: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logTimedEventWithLabelEnd invoked(%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSString* label = (NSString*) [params objectForKey:@\"Param2\"];\n\n    if (! label) {\n        [MobClick endEvent:eventId];\n    } else {\n        [MobClick endEvent:eventId label:label];\n    }\n}\n\n- (void) logTimedKVEventBegin: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logTimedKVEventBegin invoked(%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSString* label = (NSString*) [params objectForKey:@\"Param2\"];\n    NSMutableDictionary* paramMap = (NSMutableDictionary*) [params objectForKey:@\"Param3\"];\n\n    if (! label || ! paramMap) {\n        [MobClick beginEvent:eventId];\n    } else {\n        [MobClick beginEvent:eventId primarykey:label attributes:paramMap];\n    }\n}\n\n- (void) logTimedKVEventEnd: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng logTimedKVEventEnd invoked(%@)\", [params debugDescription]);\n    NSString* eventId = (NSString*) [params objectForKey:@\"Param1\"];\n    NSString* label = (NSString*) [params objectForKey:@\"Param2\"];\n\n    if (! label) {\n        [MobClick endEvent:eventId];\n    } else {\n        [MobClick endEvent:eventId primarykey:label];\n    }\n}\n\n- (void) startSessionWithParams: (NSMutableDictionary*) params\n{\n    OUTPUT_LOG(@\"Umeng startSessionWithParams invoked(%@)\", [params debugDescription]);\n    NSString* appKey = (NSString*) [params objectForKey:@\"Param1\"];\n    NSNumber* policy = (NSNumber*) [params objectForKey:@\"Param2\"];\n    NSString* channelId = (NSString*) [params objectForKey:@\"Param3\"];\n\n    int nPolicy = [policy intValue];\n    [[MobClick class] performSelector:@selector(setWrapperType:wrapperVersion:) withObject:@\"Cocos2d-x\" withObject:@\"1.0\"];\n    [MobClick startWithAppkey:appKey reportPolicy:(ReportPolicy)nPolicy channelId:channelId];\n}\n\n- (void) checkUpdate\n{\n    OUTPUT_LOG(@\"Umeng checkUpdate invoked\");\n    [MobClick checkUpdate];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.ios/MobClick.h",
    "content": "//\n//  MobClick.h\n//  MobClick\n//\n//  Created by Aladdin on 2010-03-25.\n//  Updated by Minghua on 2013-04-01.\n//  Copyright 2010-2012 Umeng.com . All rights reserved.\n//  Version 2.2.0.OpenUDID, updated_at 2013-04-01.\n\n#import <UIKit/UIKit.h>\n#import <Foundation/Foundation.h>\n\n#define UMOnlineConfigDidFinishedNotification @\"OnlineConfigDidFinishedNotification\"\n#define XcodeAppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@\"CFBundleShortVersionString\"]\n\ntypedef enum {\n    REALTIME = 0,       //实时发送\n    BATCH = 1,          //启动发送\n    SENDDAILY = 4,      //每日发送\n    SENDWIFIONLY = 5,   //仅在WIFI下启动时发送\n    SEND_INTERVAL = 6,   //按最小间隔发送\n    SEND_ON_EXIT = 7        //退出或进入后台时发送\n} ReportPolicy;\n\n@protocol MobClickDelegate;\n@class CLLocation;\n\n/** MobClick是统计的核心类，本身不需要实例化，所有方法以类方法的形式提供.\n    目前发送策略有REALTIME,BATCH,SENDDAILY,SENDWIFIONLY,SEND_INTERVAL,SEND_ON_EXIT。\n    其中REALTIME,SENDWIFIONLY 只在模拟器和DEBUG模式下生效，真机release模式会自动改成BATCH。\n    关于发送策略的调整，请参见关于发送策略及发送策略变更的说明\n    http://blog.umeng.com/index.php/2012/12/0601/\n    SEND_INTERVAL 为按最小间隔发送,默认为10秒,取值范围为10 到 86400(一天)， 如果不在这个区间的话，会按10设置。\n    SEND_ON_EXIT 为退出或进入后台时发送,这种发送策略在App运行过程中不发送，对开发者和用户的影响最小。\n    不过这种发送策略只在iOS > 4.0时才会生效, iOS < 4.0 会被自动调整为BATCH。\n\n */\n@interface MobClick : NSObject <UIAlertViewDelegate> {\n@private\n    id _internal;\n}\n#pragma mark basics\n\n///---------------------------------------------------------------------------------------\n/// @name  设置\n///---------------------------------------------------------------------------------------\n\n/** 设置app版本号。由于历史原因需要和xcode3工程兼容,友盟提取的是Build号(CFBundleVersion),如果需要和App Store上的版本一致,需要调用此方法。\n \n @param appVersion 版本号，例如设置成`XcodeAppVersion`.\n @return void.\n*/\n+ (void)setAppVersion:(NSString *)appVersion;\n\n\n/** 开启CrashReport收集, 默认是开启状态.\n \n @param value 设置成NO,就可以关闭友盟CrashReport收集.\n @return void.\n*/\n+ (void)setCrashReportEnabled:(BOOL)value;\n\n\n/** 设置是否打印sdk的log信息,默认不开启\n @param value 设置为YES,umeng SDK 会输出log信息,记得release产品时要设置回NO.\n @return .\n @exception .\n */\n\n+ (void)setLogEnabled:(BOOL)value;\n\n\n///---------------------------------------------------------------------------------------\n/// @name  开启统计\n///---------------------------------------------------------------------------------------\n\n\n/** 开启友盟统计,默认以BATCH方式发送log.\n \n @param appKey 友盟appKey.\n @param reportPolicy 发送策略.\n @param channelId 渠道名称,为nil或@\"\"时,默认会被被当作@\"App Store\"渠道\n @return void\n*/\n+ (void)startWithAppkey:(NSString *)appKey;\n+ (void)startWithAppkey:(NSString *)appKey reportPolicy:(ReportPolicy)rp channelId:(NSString *)cid;\n\n/** 当reportPolicy == SEND_INTERVAL 时设定log发送间隔\n \n @param second 单位为秒,最小为10,最大为86400(一天).\n @return void.\n*/\n\n+ (void)setLogSendInterval:(double)second;\n\n\n///---------------------------------------------------------------------------------------\n/// @name  页面计时\n///---------------------------------------------------------------------------------------\n\n\n/** 页面时长统计,记录某个view被打开多长时间,可以自己计时也可以调用beginLogPageView,endLogPageView自动计时\n \n @param pageName 需要记录时长的view名称.\n @param seconds 秒数，int型.\n @return void.\n*/\n\n+ (void)logPageView:(NSString *)pageName seconds:(int)seconds;\n+ (void)beginLogPageView:(NSString *)pageName;\n+ (void)endLogPageView:(NSString *)pageName;\n\n#pragma mark event logs\n\n\n///---------------------------------------------------------------------------------------\n/// @name  事件统计\n///---------------------------------------------------------------------------------------\n\n\n/** 自定义事件,数量统计.\n    使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID\n \n @param  eventId 网站上注册的事件Id.\n @param  label 分类标签。不同的标签会分别进行统计，方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签.\n @param  accumulation 累加值。为减少网络交互，可以自行对某一事件ID的某一分类标签进行累加，再传入次数作为参数。\n @return void.\n */\n+ (void)event:(NSString *)eventId; //等同于 event:eventId label:eventId;\n/** 自定义事件,数量统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID\n */\n+ (void)event:(NSString *)eventId label:(NSString *)label; // label为nil或@\"\"时，等同于 event:eventId label:eventId;\n/** 自定义事件,数量统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID\n */\n+ (void)event:(NSString *)eventId acc:(NSInteger)accumulation;\n/** 自定义事件,数量统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID\n */\n+ (void)event:(NSString *)eventId label:(NSString *)label acc:(NSInteger)accumulation;\n/** 自定义事件,数量统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID\n */\n+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes;\n\n/** 自定义事件,时长统计.\n    使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n    beginEvent,endEvent要配对使用,也可以自己计时后通过durations参数传递进来\n \n @param  eventId 网站上注册的事件Id.\n @param  label 分类标签。不同的标签会分别进行统计，方便同一事件的不同标签的对比,为nil或空字符串时后台会生成和eventId同名的标签.\n @param  primarykey 这个参数用于和event_id一起标示一个唯一事件，并不会被统计；对于同一个事件在beginEvent和endEvent 中要传递相同的eventId 和 primarykey\n @param millisecond 自己计时需要的话需要传毫秒进来\n @return void.\n \n \n @warning 每个event的attributes不能超过10个\n    eventId、attributes中key和value都不能使用空格和特殊字符，eventId、attributes的key最大为128个bytes(128个英文及数字或42个左右汉字)。label、attributes的value最大为256个bytes(256个英文及数字或84个左右汉字),\n       超过后将被截短。其中eventId超过的将抛弃不再发送。\n    id， ts， du是保留字段，不能作为eventId及key的名称\n\n*/\n+ (void)beginEvent:(NSString *)eventId;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n+ (void)endEvent:(NSString *)eventId;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n\n+ (void)beginEvent:(NSString *)eventId label:(NSString *)label;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n\n+ (void)endEvent:(NSString *)eventId label:(NSString *)label;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n\n+ (void)beginEvent:(NSString *)eventId primarykey :(NSString *)keyName attributes:(NSDictionary *)attributes;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n\n+ (void)endEvent:(NSString *)eventId primarykey:(NSString *)keyName;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n\n+ (void)event:(NSString *)eventId durations:(int)millisecond;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n\n+ (void)event:(NSString *)eventId label:(NSString *)label durations:(int)millisecond;\n/** 自定义事件,时长统计.\n 使用前，请先到友盟App管理后台的设置->编辑自定义事件 中添加相应的事件ID，然后在工程中传入相应的事件ID.\n */\n\n+ (void)event:(NSString *)eventId attributes:(NSDictionary *)attributes durations:(int)millisecond;\n\n\n///---------------------------------------------------------------------------------------\n/// @name  按渠道自动更新\n///---------------------------------------------------------------------------------------\n\n\n/** 按渠道自动更新检测\n    检查当前app是否有更新，有更新弹出UIAlertView提示用户,当用户点击升级按钮时app会跳转到您预先设置的网址。\n    无更新不做任何操作。\n    您需要先在服务器端设置app版本信息，默认渠道是App Store.\n    如果您想自己控制自动更新操作流程，请实现MobClickDelegate的appUpdate方法。\n \n @param title 对应UIAlertView的title.\n @param cancelTitle 对应UIAlertView的cancelTitle.\n @param otherTitle 对应UIAlertView的otherTitle.\n @param delegate 需要自定义checkUpdate的对象.\n @param callBackSelectorWithDictionary 当checkUpdate事件完成时此方法会被调用,同时标记app更新信息的字典被传回.\n @return void.\n */\n\n+ (void)checkUpdate;\n/** 按渠道自动更新检测\n */\n\n+ (void)checkUpdate:(NSString *)title cancelButtonTitle:(NSString *)cancelTitle otherButtonTitles:(NSString *)otherTitle;\n/** 按渠道自动更新检测\n */\n\n+ (void)checkUpdateWithDelegate:(id)delegate selector:(SEL)callBackSelectorWithDictionary;\n\n\n///---------------------------------------------------------------------------------------\n/// @name  在线参数\n///---------------------------------------------------------------------------------------\n\n\n/** 使用在线参数功能，可以让你动态修改应用中的参数值,\n    检查并更新服务器端配置的在线参数,缓存在[NSUserDefaults standardUserDefaults]里,\n    调用此方法您将自动拥有在线更改SDK端发送策略的功能,您需要先在服务器端设置好在线参数.\n    请在[MobClick startWithAppkey:]方法之后调用;\n    如果想知道在线参数是否完成完成，请监听UMOnlineConfigDidFinishedNotification\n @param 无.\n @return void.\n */\n\n+ (void)updateOnlineConfig;\n\n/** 从[NSUserDefaults standardUserDefaults]获取缓存的在线参数的数值\n    带参数的方法获取某个key的值，不带参数的获取所有的在线参数.\n    需要先调用updateOnlineConfig才能使用,如果想知道在线参数是否完成完成，请监听UMOnlineConfigDidFinishedNotification\n \n @param key\n @return (NSString *) .\n */\n\n+ (NSString *)getConfigParams:(NSString *)key;\n\n/** 从[NSUserDefaults standardUserDefaults]获取缓存的在线参数\n  @return (NSDictionary *).\n */\n\n+ (NSDictionary *)getConfigParams;\n\n\n///---------------------------------------------------------------------------------------\n/// @name 地理位置设置\n///---------------------------------------------------------------------------------------\n\n\n/** 为了更精确的统计用户地理位置，可以调用此方法传入经纬度信息\n    需要链接 CoreLocation.framework 并且 #import <CoreLocation/CoreLocation.h>\n @param latitude 纬度.\n @param longitude 经度.\n @param location CLLocation *型的地理信息\n @return void\n */\n\n+ (void)setLatitude:(double)latitude longitude:(double)longitude;\n/** 为了更精确的统计用户地理位置，可以调用此方法传入经纬度信息\n */\n\n+ (void)setLocation:(CLLocation *)location;\n\n\n///---------------------------------------------------------------------------------------\n/// @name helper方法\n///---------------------------------------------------------------------------------------\n\n\n/** 判断设备是否越狱，判断方法根据 apt和Cydia.app的path来判断\n */\n+ (BOOL)isJailbroken;\n/** 判断你的App是否被破解\n */\n+ (BOOL)isPirated;\n\n#pragma mark DEPRECATED methods from version 1.7\n\n\n/** 设置MobClick代理,已经startWithAppkey:所取代,不要再使用，原有代码可以删除\n*/\n\n+ (void)setDelegate:(id)delegate;\n+ (void)setDelegate:(id)delegate reportPolicy:(ReportPolicy)rp;\n\n/** 记录启动时间，模块开始启用,不要再使用，原有代码可以删除\n*/\n\n+ (void)appLaunched;\n\n/** 记录软件终止时间，模块终止,不要再使用，原有代码可以删除\n */\n\n+ (void)appTerminated;\n\n/** 友盟模块启动\n [MobClick startWithAppkey:]通常在application:didFinishLaunchingWithOptions:里被调用监听\n App启动和退出事件，如果你没法在application:didFinishLaunchingWithOptions:里添加友盟的[MobClick startWithAppkey:]\n 方法，App的启动事件可能会无法监听，此时你就可以手动调用[MobClick startSession:nil]来启动友盟的session。\n 通常发生在某些第三方框架生成的app里，普通app使用不到.\n \n */\n\n+ (void)startSession:(NSNotification *)notification;\n\n\n/** 获取友盟sdk 版本号,目前友盟模块启动时自动调用,不要再使用，原有代码可以删除\n */\n\n+ (NSString *)getAgentVersion;  //\n@end\n\n/** MobClickDelegate protocol\n    此协议的三个方法不再建议使用，建议用新方法代替\n    + (void)startWithAppkey:(NSString *)appKey reportPolicy:(ReportPolicy)rp channelId:(NSString *)cid;\n    + (void)checkUpdate:(id)delegate selector:(SEL)callBackSelector;\n\n */\n\n\n@protocol MobClickDelegate <NSObject>\n@optional\n- (NSString *)appKey;\n- (NSString *)channelId;\n- (void)appUpdate:(NSDictionary *)appUpdateInfo;\n\n@end"
  },
  {
    "path": "cocos2d/plugin/plugins/umeng/proj.ios/PluginUmeng.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tFA09A305168ADAEC008C1C7B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA09A304168ADAEC008C1C7B /* Foundation.framework */; };\n\t\tFAB6DFE91756F3B600C90D89 /* AnalyticsUmeng.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB6DFE61756F3B600C90D89 /* AnalyticsUmeng.m */; };\n\t\tFAB6DFEA1756F3B600C90D89 /* libMobClickLibrary.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAB6DFE71756F3B600C90D89 /* libMobClickLibrary.a */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tFA09A2FF168ADAEC008C1C7B /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/${PRODUCT_NAME}\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\tFA09A301168ADAEC008C1C7B /* libPluginUmeng.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPluginUmeng.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFA09A304168ADAEC008C1C7B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\tFAB6DFE51756F3B600C90D89 /* AnalyticsUmeng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnalyticsUmeng.h; sourceTree = \"<group>\"; };\n\t\tFAB6DFE61756F3B600C90D89 /* AnalyticsUmeng.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnalyticsUmeng.m; sourceTree = \"<group>\"; };\n\t\tFAB6DFE71756F3B600C90D89 /* libMobClickLibrary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libMobClickLibrary.a; sourceTree = \"<group>\"; };\n\t\tFAB6DFE81756F3B600C90D89 /* MobClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobClick.h; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tFA09A2FE168ADAEC008C1C7B /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFA09A305168ADAEC008C1C7B /* Foundation.framework in Frameworks */,\n\t\t\t\tFAB6DFEA1756F3B600C90D89 /* libMobClickLibrary.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tFA09A2F6168ADAEC008C1C7B = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAB6DFE51756F3B600C90D89 /* AnalyticsUmeng.h */,\n\t\t\t\tFAB6DFE61756F3B600C90D89 /* AnalyticsUmeng.m */,\n\t\t\t\tFAB6DFE71756F3B600C90D89 /* libMobClickLibrary.a */,\n\t\t\t\tFAB6DFE81756F3B600C90D89 /* MobClick.h */,\n\t\t\t\tFA09A303168ADAEC008C1C7B /* Frameworks */,\n\t\t\t\tFA09A302168ADAEC008C1C7B /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA09A302168ADAEC008C1C7B /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA09A301168ADAEC008C1C7B /* libPluginUmeng.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA09A303168ADAEC008C1C7B /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA09A304168ADAEC008C1C7B /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tFA09A300168ADAEC008C1C7B /* PluginUmeng */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = FA09A30F168ADAEC008C1C7B /* Build configuration list for PBXNativeTarget \"PluginUmeng\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tFA09A2FD168ADAEC008C1C7B /* Sources */,\n\t\t\t\tFA09A2FE168ADAEC008C1C7B /* Frameworks */,\n\t\t\t\tFA09A2FF168ADAEC008C1C7B /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = PluginUmeng;\n\t\t\tproductName = libPluginUmeng;\n\t\t\tproductReference = FA09A301168ADAEC008C1C7B /* libPluginUmeng.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tFA09A2F8168ADAEC008C1C7B /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0460;\n\t\t\t\tORGANIZATIONNAME = zhangbin;\n\t\t\t};\n\t\t\tbuildConfigurationList = FA09A2FB168ADAEC008C1C7B /* Build configuration list for PBXProject \"PluginUmeng\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = FA09A2F6168ADAEC008C1C7B;\n\t\t\tproductRefGroup = FA09A302168ADAEC008C1C7B /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tFA09A300168ADAEC008C1C7B /* PluginUmeng */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tFA09A2FD168ADAEC008C1C7B /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFAB6DFE91756F3B600C90D89 /* AnalyticsUmeng.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\tFA09A30D168ADAEC008C1C7B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFA09A30E168ADAEC008C1C7B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tFA09A310168ADAEC008C1C7B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/libPluginUmeng.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginUmeng-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../platform/ios\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = PluginUmeng;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFA09A311168ADAEC008C1C7B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/libPluginUmeng.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginUmeng-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../platform/ios\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = PluginUmeng;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tFA09A2FB168ADAEC008C1C7B /* Build configuration list for PBXProject \"PluginUmeng\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFA09A30D168ADAEC008C1C7B /* Debug */,\n\t\t\t\tFA09A30E168ADAEC008C1C7B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tFA09A30F168ADAEC008C1C7B /* Build configuration list for PBXNativeTarget \"PluginUmeng\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFA09A310168ADAEC008C1C7B /* Debug */,\n\t\t\t\tFA09A311168ADAEC008C1C7B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = FA09A2F8168ADAEC008C1C7B /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"sdk/weibosdk.jar\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginWeibo</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libSocialWeibo\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/ForManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifestConfig xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <permissionCfg>\n        <uses-permission android:name=\"android.permission.INTERNET\" />\n        <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n    </permissionCfg>\n</manifestConfig> \n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginSocialWeibo\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\nandroid.library.reference.1=../../../protocols/proj.android\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/src/org/cocos2dx/plugin/AccessTokenKeeper.java",
    "content": "package org.cocos2dx.plugin;\n\nimport com.weibo.sdk.android.Oauth2AccessToken;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.content.SharedPreferences.Editor;\n/**\n * 该类用于保存Oauth2AccessToken到sharepreference，并提供读取功能\n * @author xiaowei6@staff.sina.com.cn\n *\n */\npublic class AccessTokenKeeper {\n\tprivate static final String PREFERENCES_NAME = \"com_weibo_sdk_android\";\n\t/**\n\t * 保存accesstoken到SharedPreferences\n\t * @param context Activity 上下文环境\n\t * @param token Oauth2AccessToken\n\t */\n\tpublic static void keepAccessToken(Context context, Oauth2AccessToken token) {\n\t\tSharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_APPEND);\n\t\tEditor editor = pref.edit();\n\t\teditor.putString(\"token\", token.getToken());\n\t\teditor.putLong(\"expiresTime\", token.getExpiresTime());\n\t\teditor.commit();\n\t}\n\t/**\n\t * 清空sharepreference\n\t * @param context\n\t */\n\tpublic static void clear(Context context){\n\t    SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_APPEND);\n\t    Editor editor = pref.edit();\n\t    editor.clear();\n\t    editor.commit();\n\t}\n\n\t/**\n\t * 从SharedPreferences读取accessstoken\n\t * @param context\n\t * @return Oauth2AccessToken\n\t */\n\tpublic static Oauth2AccessToken readAccessToken(Context context){\n\t\tOauth2AccessToken token = new Oauth2AccessToken();\n\t\tSharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_APPEND);\n\t\ttoken.setToken(pref.getString(\"token\", \"\"));\n\t\ttoken.setExpiresTime(pref.getLong(\"expiresTime\", 0));\n\t\treturn token;\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.android/src/org/cocos2dx/plugin/ShareWeibo.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.io.IOException;\nimport java.util.Hashtable;\n\n\nimport com.weibo.sdk.android.Oauth2AccessToken;\nimport com.weibo.sdk.android.Weibo;\nimport com.weibo.sdk.android.WeiboAuthListener;\nimport com.weibo.sdk.android.WeiboDialogError;\nimport com.weibo.sdk.android.WeiboException;\nimport com.weibo.sdk.android.api.StatusesAPI;\nimport com.weibo.sdk.android.net.RequestListener;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.net.ConnectivityManager;\nimport android.net.NetworkInfo;\nimport android.os.Bundle;\nimport android.util.Log;\n\npublic class ShareWeibo implements InterfaceShare {\n\n\tprivate static final String LOG_TAG = \"ShareWeibo\";\n\tprivate static Activity mContext = null;\n\tprivate static ShareWeibo mShareAdapter = null;\n\tprotected static boolean bDebug = false;\n\n\tprivate String APP_KEY = \"\";\n\tprivate String REDIRECT_URL = \"\";\n\n\tprivate boolean isInitialized = false;\n\tprivate Hashtable<String, String> mShareInfo = null;\n\n\tpublic static final String KEY_TEXT=\"SharedText\";\n\tpublic static final String KEY_IMAGE_PATH = \"SharedImagePath\";\n\n\tprivate Weibo mWeibo = null;\n\tprivate Oauth2AccessToken accessToken = null;\n\n\tprotected static void LogE(String msg, Exception e) {\n\t\tLog.e(LOG_TAG, msg, e);\n\t\te.printStackTrace();\n\t}\n\n\tprotected static void LogD(String msg) {\n\t\tif (bDebug) {\n\t\t\tLog.d(LOG_TAG, msg);\n\t\t}\n\t}\n\n\tpublic ShareWeibo(Context context) {\n\t\tmContext = (Activity) context;\n\t\tmShareAdapter = this;\n\t}\n\n\t@Override\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo) {\n\t\tLogD(\"configDeveloperInfo invoked \" + cpInfo.toString());\n\t\ttry {\n\t\t\tmShareAdapter.APP_KEY = cpInfo.get(\"WeiboAppKey\");\n\t\t\tmShareAdapter.REDIRECT_URL = cpInfo.get(\"WeiboRedirectUrl\");\n\n\t\t\tLogD(\"app key : \" + mShareAdapter.APP_KEY);\n\t\t\tLogD(\"redirect url : \" + mShareAdapter.REDIRECT_URL);\n\t\t\tif(isInitialized){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tisInitialized = true;\n\t\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tmShareAdapter.mWeibo = Weibo.getInstance(APP_KEY, REDIRECT_URL);\n\t\t\t\t\tmShareAdapter.accessToken = AccessTokenKeeper.readAccessToken(mContext);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Developer info is wrong!\", e);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void share(Hashtable<String, String> info) {\n\t\tLogD(\"share invoked \" + info.toString());\n\t\tmShareInfo =  info;\n\t\tif (! networkReachable()) {\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"Network error!\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (! isInitialized) {\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"Initialize failed!\");\n\t\t\treturn;\n\t\t}\n\n\t\tPluginWrapper.runOnMainThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tif (mShareAdapter.accessToken.isSessionValid()) {\n\t\t\t\t\tmShareAdapter.shareToWeibo();\n\t\t\t\t} else {\n\t\t\t\t\tmShareAdapter.mWeibo.authorize(mContext, new WeiboAuthDialogListener());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void setDebugMode(boolean debug) {\n\t\tbDebug = debug;\n\t}\n\n\t@Override\n\tpublic String getSDKVersion() {\n\t\treturn \"Unknown version\";\n\t}\n\n\tprivate boolean networkReachable() {\n\t\tboolean bRet = false;\n\t\ttry {\n\t\t\tConnectivityManager conn = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\tNetworkInfo netInfo = conn.getActiveNetworkInfo();\n\t\t\tbRet = (null == netInfo) ? false : netInfo.isAvailable();\n\t\t} catch (Exception e) {\n\t\t\tLogE(\"Fail to check network status\", e);\n\t\t}\n\t\tLogD(\"NetWork reachable : \" + bRet);\n\t\treturn bRet;\n\t}\n\n\tpublic static void shareResult(int ret, String msg) {\n\t\tShareWrapper.onShareResult(mShareAdapter, ret, msg);\n\t\tLogD(\"ShareWeibo result : \" + ret + \" msg : \" + msg);\n\t}\n\n\tclass WeiboAuthDialogListener implements WeiboAuthListener {\n\n        @Override\n        public void onComplete(Bundle values) {\n        \ttry {\n                String token = values.getString(\"access_token\");\n                String expires_in = values.getString(\"expires_in\");\n                mShareAdapter.accessToken = new Oauth2AccessToken(token, expires_in);\n                AccessTokenKeeper.keepAccessToken(mContext, accessToken);\n\n                mShareAdapter.shareToWeibo();\n        \t} catch (Exception e) {\n        \t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"认证失败!\");\n        \t\tLogE(\"anthorize failed\", e);\n        \t}\n        }\n\n        @Override\n        public void onError(WeiboDialogError e) {\n        \tshareResult(ShareWrapper.SHARERESULT_FAIL, e.getMessage());\n        }\n\n        @Override\n        public void onCancel() {\n        \tshareResult(ShareWrapper.SHARERESULT_FAIL, \"取消认证!\");\n        }\n\n        @Override\n        public void onWeiboException(WeiboException e) {\n        \tshareResult(ShareWrapper.SHARERESULT_FAIL, e.getMessage());\n        }\n    }\n\n\tprivate void shareToWeibo() {\n\t\tString text = mShareInfo.get(KEY_TEXT);\n\t\tString imagePath = mShareInfo.get(KEY_IMAGE_PATH);\n\t\tStatusesAPI api = new StatusesAPI(accessToken);\n\t\tif (imagePath != null && imagePath.length() > 0) {\n\t\t\tapi.upload(text, imagePath, \"90.0\", \"90.0\", new WeiboRequestListener());\n\t\t} else {\n\t\t\tapi.update(text, \"90.0\", \"90.0\", new WeiboRequestListener());\n\t\t}\n\t}\n\n\tclass WeiboRequestListener implements RequestListener {\n\n\t\t@Override\n\t\tpublic void onComplete(String arg0) {\n\t\t\tshareResult(ShareWrapper.SHARERESULT_SUCCESS, \"分享成功!\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onError(WeiboException arg0) {\n\t\t\tLogE(\"Share onError\", arg0);\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"分享失败!\");\n\t\t}\n\n\t\t@Override\n\t\tpublic void onIOException(IOException arg0) {\n\t\t\tLogE(\"Share onIOException\", arg0);\n\t\t\tshareResult(ShareWrapper.SHARERESULT_FAIL, \"分享失败!\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic String getPluginVersion() {\n\t\treturn \"0.2.0\";\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/JSONKit/JSONKit.h",
    "content": "//\n//  JSONKit.h\n//  http://github.com/johnezang/JSONKit\n//  Dual licensed under either the terms of the BSD License, or alternatively\n//  under the terms of the Apache License, Version 2.0, as specified below.\n//\n\n/*\n Copyright (c) 2011, John Engelhart\n \n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n \n * Neither the name of the Zang Industries nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*\n Copyright 2011 John Engelhart\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n#include <stddef.h>\n#include <stdint.h>\n#include <limits.h>\n#include <TargetConditionals.h>\n#include <AvailabilityMacros.h>\n\n#ifdef    __OBJC__\n#import <Foundation/NSArray.h>\n#import <Foundation/NSData.h>\n#import <Foundation/NSDictionary.h>\n#import <Foundation/NSError.h>\n#import <Foundation/NSObjCRuntime.h>\n#import <Foundation/NSString.h>\n#endif // __OBJC__\n \n#ifdef __cplusplus\nextern \"C\" {\n#endif\n  \n\n// For Mac OS X < 10.5.\n#ifndef   NSINTEGER_DEFINED\n#define   NSINTEGER_DEFINED\n#if       defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)\ntypedef long           NSInteger;\ntypedef unsigned long  NSUInteger;\n#define NSIntegerMin   LONG_MIN\n#define NSIntegerMax   LONG_MAX\n#define NSUIntegerMax  ULONG_MAX\n#else  // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)\ntypedef int            NSInteger;\ntypedef unsigned int   NSUInteger;\n#define NSIntegerMin   INT_MIN\n#define NSIntegerMax   INT_MAX\n#define NSUIntegerMax  UINT_MAX\n#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)\n#endif // NSINTEGER_DEFINED\n\n\n#ifndef _JSONKIT_H_\n#define _JSONKIT_H_\n\n#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)\n#define JK_DEPRECATED_ATTRIBUTE __attribute__((deprecated))\n#else\n#define JK_DEPRECATED_ATTRIBUTE\n#endif\n  \n#define JSONKIT_VERSION_MAJOR 1\n#define JSONKIT_VERSION_MINOR 4\n\ntypedef NSUInteger JKFlags;\n\n/*\n  JKParseOptionComments        : Allow C style // and /_* ... *_/ (without a _, obviously) comments in JSON.\n  JKParseOptionUnicodeNewlines : Allow Unicode recommended (?:\\r\\n|[\\n\\v\\f\\r\\x85\\p{Zl}\\p{Zp}]) newlines.\n  JKParseOptionLooseUnicode    : Normally the decoder will stop with an error at any malformed Unicode.\n                                 This option allows JSON with malformed Unicode to be parsed without reporting an error.\n                                 Any malformed Unicode is replaced with \\uFFFD, or \"REPLACEMENT CHARACTER\".\n */\n\nenum {\n  JKParseOptionNone                     = 0,\n  JKParseOptionStrict                   = 0,\n  JKParseOptionComments                 = (1 << 0),\n  JKParseOptionUnicodeNewlines          = (1 << 1),\n  JKParseOptionLooseUnicode             = (1 << 2),\n  JKParseOptionPermitTextAfterValidJSON = (1 << 3),\n  JKParseOptionValidFlags               = (JKParseOptionComments | JKParseOptionUnicodeNewlines | JKParseOptionLooseUnicode | JKParseOptionPermitTextAfterValidJSON),\n};\ntypedef JKFlags JKParseOptionFlags;\n\nenum {\n  JKSerializeOptionNone                 = 0,\n  JKSerializeOptionPretty               = (1 << 0),\n  JKSerializeOptionEscapeUnicode        = (1 << 1),\n  JKSerializeOptionEscapeForwardSlashes = (1 << 4),\n  JKSerializeOptionValidFlags           = (JKSerializeOptionPretty | JKSerializeOptionEscapeUnicode | JKSerializeOptionEscapeForwardSlashes),\n};\ntypedef JKFlags JKSerializeOptionFlags;\n\n#ifdef    __OBJC__\n\ntypedef struct JKParseState JKParseState; // Opaque internal, private type.\n\n// As a general rule of thumb, if you use a method that doesn't accept a JKParseOptionFlags argument, it defaults to JKParseOptionStrict\n\n@interface JSONDecoder : NSObject {\n  JKParseState *parseState;\n}\n+ (id)decoder;\n+ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags;\n- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags;\n- (void)clearCache;\n\n// The parse... methods were deprecated in v1.4 in favor of the v1.4 objectWith... methods.\n- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length                         JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithUTF8String:length:        instead.\n- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length error:(NSError **)error JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithUTF8String:length:error:  instead.\n// The NSData MUST be UTF8 encoded JSON.\n- (id)parseJSONData:(NSData *)jsonData                                                            JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithData:                     instead.\n- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error                                    JK_DEPRECATED_ATTRIBUTE; // Deprecated in JSONKit v1.4.  Use objectWithData:error:               instead.\n\n// Methods that return immutable collection objects.\n- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;\n- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;\n// The NSData MUST be UTF8 encoded JSON.\n- (id)objectWithData:(NSData *)jsonData;\n- (id)objectWithData:(NSData *)jsonData error:(NSError **)error;\n\n// Methods that return mutable collection objects.\n- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length;\n- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error;\n// The NSData MUST be UTF8 encoded JSON.\n- (id)mutableObjectWithData:(NSData *)jsonData;\n- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error;\n\n@end\n\n////////////\n#pragma mark Deserializing methods\n////////////\n\n@interface NSString (JSONKitDeserializing)\n- (id)objectFromJSONString;\n- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;\n- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;\n- (id)mutableObjectFromJSONString;\n- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags;\n- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;\n@end\n\n@interface NSData (JSONKitDeserializing)\n// The NSData MUST be UTF8 encoded JSON.\n- (id)objectFromJSONData;\n- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;\n- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;\n- (id)mutableObjectFromJSONData;\n- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags;\n- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error;\n@end\n\n////////////\n#pragma mark Serializing methods\n////////////\n  \n@interface NSString (JSONKitSerializing)\n// Convenience methods for those that need to serialize the receiving NSString (i.e., instead of having to serialize a NSArray with a single NSString, you can \"serialize to JSON\" just the NSString).\n// Normally, a string that is serialized to JSON has quotation marks surrounding it, which you may or may not want when serializing a single string, and can be controlled with includeQuotes:\n// includeQuotes:YES `a \"test\"...` -> `\"a \\\"test\\\"...\"`\n// includeQuotes:NO  `a \"test\"...` -> `a \\\"test\\\"...`\n- (NSData *)JSONData;     // Invokes JSONDataWithOptions:JKSerializeOptionNone   includeQuotes:YES\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;\n- (NSString *)JSONString; // Invokes JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error;\n@end\n\n@interface NSArray (JSONKitSerializing)\n- (NSData *)JSONData;\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;\n- (NSString *)JSONString;\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;\n@end\n\n@interface NSDictionary (JSONKitSerializing)\n- (NSData *)JSONData;\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;\n- (NSString *)JSONString;\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error;\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error;\n@end\n\n#ifdef __BLOCKS__\n\n@interface NSArray (JSONKitSerializingBlockAdditions)\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;\n@end\n\n@interface NSDictionary (JSONKitSerializingBlockAdditions)\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error;\n@end\n  \n#endif\n\n\n#endif // __OBJC__\n\n#endif // _JSONKIT_H_\n\n#ifdef __cplusplus\n}  // extern \"C\"\n#endif\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/JSONKit/JSONKit.m",
    "content": "//\n//  JSONKit.m\n//  http://github.com/johnezang/JSONKit\n//  Dual licensed under either the terms of the BSD License, or alternatively\n//  under the terms of the Apache License, Version 2.0, as specified below.\n//\n\n/*\n Copyright (c) 2011, John Engelhart\n \n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n \n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n \n * Neither the name of the Zang Industries nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*\n Copyright 2011 John Engelhart\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n*/\n\n\n/*\n  Acknowledgments:\n\n  The bulk of the UTF8 / UTF32 conversion and verification comes\n  from ConvertUTF.[hc].  It has been modified from the original sources.\n\n  The original sources were obtained from http://www.unicode.org/.\n  However, the web site no longer seems to host the files.  Instead,\n  the Unicode FAQ http://www.unicode.org/faq//utf_bom.html#gen4\n  points to International Components for Unicode (ICU)\n  http://site.icu-project.org/ as an example of how to write a UTF\n  converter.\n\n  The decision to use the ConvertUTF.[ch] code was made to leverage\n  \"proven\" code.  Hopefully the local modifications are bug free.\n\n  The code in isValidCodePoint() is derived from the ICU code in\n  utf.h for the macros U_IS_UNICODE_NONCHAR and U_IS_UNICODE_CHAR.\n\n  From the original ConvertUTF.[ch]:\n\n * Copyright 2001-2004 Unicode, Inc.\n * \n * Disclaimer\n * \n * This source code is provided as is by Unicode, Inc. No claims are\n * made as to fitness for any particular purpose. No warranties of any\n * kind are expressed or implied. The recipient agrees to determine\n * applicability of information provided. If this file has been\n * purchased on magnetic or optical media from Unicode, Inc., the\n * sole remedy for any claim will be exchange of defective media\n * within 90 days of receipt.\n * \n * Limitations on Rights to Redistribute This Code\n * \n * Unicode, Inc. hereby grants the right to freely use the information\n * supplied in this file in the creation of products supporting the\n * Unicode Standard, and to make copies of this file in any form\n * for internal or external distribution as long as this notice\n * remains attached.\n\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n#include <assert.h>\n#include <sys/errno.h>\n#include <math.h>\n#include <limits.h>\n#include <objc/runtime.h>\n\n#import \"JSONKit.h\"\n\n//#include <CoreFoundation/CoreFoundation.h>\n#include <CoreFoundation/CFString.h>\n#include <CoreFoundation/CFArray.h>\n#include <CoreFoundation/CFDictionary.h>\n#include <CoreFoundation/CFNumber.h>\n\n//#import <Foundation/Foundation.h>\n#import <Foundation/NSArray.h>\n#import <Foundation/NSAutoreleasePool.h>\n#import <Foundation/NSData.h>\n#import <Foundation/NSDictionary.h>\n#import <Foundation/NSException.h>\n#import <Foundation/NSNull.h>\n#import <Foundation/NSObjCRuntime.h>\n\n#ifndef __has_feature\n#define __has_feature(x) 0\n#endif\n\n#ifdef JK_ENABLE_CF_TRANSFER_OWNERSHIP_CALLBACKS\n#warning As of JSONKit v1.4, JK_ENABLE_CF_TRANSFER_OWNERSHIP_CALLBACKS is no longer required.  It is no longer a valid option.\n#endif\n\n#ifdef __OBJC_GC__\n#error JSONKit does not support Objective-C Garbage Collection\n#endif\n\n#if __has_feature(objc_arc)\n#error JSONKit does not support Objective-C Automatic Reference Counting (ARC)\n#endif\n\n// The following checks are really nothing more than sanity checks.\n// JSONKit technically has a few problems from a \"strictly C99 conforming\" standpoint, though they are of the pedantic nitpicking variety.\n// In practice, though, for the compilers and architectures we can reasonably expect this code to be compiled for, these pedantic nitpicks aren't really a problem.\n// Since we're limited as to what we can do with pre-processor #if checks, these checks are not nearly as through as they should be.\n\n#if (UINT_MAX != 0xffffffffU) || (INT_MIN != (-0x7fffffff-1)) || (ULLONG_MAX != 0xffffffffffffffffULL) || (LLONG_MIN != (-0x7fffffffffffffffLL-1LL))\n#error JSONKit requires the C 'int' and 'long long' types to be 32 and 64 bits respectively.\n#endif\n\n#if !defined(__LP64__) && ((UINT_MAX != ULONG_MAX) || (INT_MAX != LONG_MAX) || (INT_MIN != LONG_MIN) || (WORD_BIT != LONG_BIT))\n#error JSONKit requires the C 'int' and 'long' types to be the same on 32-bit architectures.\n#endif\n\n// Cocoa / Foundation uses NS*Integer as the type for a lot of arguments.  We make sure that NS*Integer is something we are expecting and is reasonably compatible with size_t / ssize_t\n\n#if (NSUIntegerMax != ULONG_MAX) || (NSIntegerMax != LONG_MAX) || (NSIntegerMin != LONG_MIN)\n#error JSONKit requires NSInteger and NSUInteger to be the same size as the C 'long' type.\n#endif\n\n#if (NSUIntegerMax != SIZE_MAX) || (NSIntegerMax != SSIZE_MAX)\n#error JSONKit requires NSInteger and NSUInteger to be the same size as the C 'size_t' type.\n#endif\n\n\n// For DJB hash.\n#define JK_HASH_INIT           (1402737925UL)\n\n// Use __builtin_clz() instead of trailingBytesForUTF8[] table lookup.\n#define JK_FAST_TRAILING_BYTES\n\n// JK_CACHE_SLOTS must be a power of 2.  Default size is 1024 slots.\n#define JK_CACHE_SLOTS_BITS    (10)\n#define JK_CACHE_SLOTS         (1UL << JK_CACHE_SLOTS_BITS)\n// JK_CACHE_PROBES is the number of probe attempts.\n#define JK_CACHE_PROBES        (4UL)\n// JK_INIT_CACHE_AGE must be (1 << AGE) - 1\n#define JK_INIT_CACHE_AGE      (0)\n\n// JK_TOKENBUFFER_SIZE is the default stack size for the temporary buffer used to hold \"non-simple\" strings (i.e., contains \\ escapes)\n#define JK_TOKENBUFFER_SIZE    (1024UL * 2UL)\n\n// JK_STACK_OBJS is the default number of spaces reserved on the stack for temporarily storing pointers to Obj-C objects before they can be transferred to a NSArray / NSDictionary.\n#define JK_STACK_OBJS          (1024UL * 1UL)\n\n#define JK_JSONBUFFER_SIZE     (1024UL * 4UL)\n#define JK_UTF8BUFFER_SIZE     (1024UL * 16UL)\n\n#define JK_ENCODE_CACHE_SLOTS  (1024UL)\n\n\n#if       defined (__GNUC__) && (__GNUC__ >= 4)\n#define JK_ATTRIBUTES(attr, ...)        __attribute__((attr, ##__VA_ARGS__))\n#define JK_EXPECTED(cond, expect)       __builtin_expect((long)(cond), (expect))\n#define JK_EXPECT_T(cond)               JK_EXPECTED(cond, 1U)\n#define JK_EXPECT_F(cond)               JK_EXPECTED(cond, 0U)\n#define JK_PREFETCH(ptr)                __builtin_prefetch(ptr)\n#else  // defined (__GNUC__) && (__GNUC__ >= 4) \n#define JK_ATTRIBUTES(attr, ...)\n#define JK_EXPECTED(cond, expect)       (cond)\n#define JK_EXPECT_T(cond)               (cond)\n#define JK_EXPECT_F(cond)               (cond)\n#define JK_PREFETCH(ptr)\n#endif // defined (__GNUC__) && (__GNUC__ >= 4) \n\n#define JK_STATIC_INLINE                         static __inline__ JK_ATTRIBUTES(always_inline)\n#define JK_ALIGNED(arg)                                            JK_ATTRIBUTES(aligned(arg))\n#define JK_UNUSED_ARG                                              JK_ATTRIBUTES(unused)\n#define JK_WARN_UNUSED                                             JK_ATTRIBUTES(warn_unused_result)\n#define JK_WARN_UNUSED_CONST                                       JK_ATTRIBUTES(warn_unused_result, const)\n#define JK_WARN_UNUSED_PURE                                        JK_ATTRIBUTES(warn_unused_result, pure)\n#define JK_WARN_UNUSED_SENTINEL                                    JK_ATTRIBUTES(warn_unused_result, sentinel)\n#define JK_NONNULL_ARGS(arg, ...)                                  JK_ATTRIBUTES(nonnull(arg, ##__VA_ARGS__))\n#define JK_WARN_UNUSED_NONNULL_ARGS(arg, ...)                      JK_ATTRIBUTES(warn_unused_result, nonnull(arg, ##__VA_ARGS__))\n#define JK_WARN_UNUSED_CONST_NONNULL_ARGS(arg, ...)                JK_ATTRIBUTES(warn_unused_result, const, nonnull(arg, ##__VA_ARGS__))\n#define JK_WARN_UNUSED_PURE_NONNULL_ARGS(arg, ...)                 JK_ATTRIBUTES(warn_unused_result, pure, nonnull(arg, ##__VA_ARGS__))\n\n#if       defined (__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3)\n#define JK_ALLOC_SIZE_NON_NULL_ARGS_WARN_UNUSED(as, nn, ...) JK_ATTRIBUTES(warn_unused_result, nonnull(nn, ##__VA_ARGS__), alloc_size(as))\n#else  // defined (__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3)\n#define JK_ALLOC_SIZE_NON_NULL_ARGS_WARN_UNUSED(as, nn, ...) JK_ATTRIBUTES(warn_unused_result, nonnull(nn, ##__VA_ARGS__))\n#endif // defined (__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3)\n\n\n@class JKArray, JKDictionaryEnumerator, JKDictionary;\n\nenum {\n  JSONNumberStateStart                 = 0,\n  JSONNumberStateFinished              = 1,\n  JSONNumberStateError                 = 2,\n  JSONNumberStateWholeNumberStart      = 3,\n  JSONNumberStateWholeNumberMinus      = 4,\n  JSONNumberStateWholeNumberZero       = 5,\n  JSONNumberStateWholeNumber           = 6,\n  JSONNumberStatePeriod                = 7,\n  JSONNumberStateFractionalNumberStart = 8,\n  JSONNumberStateFractionalNumber      = 9,\n  JSONNumberStateExponentStart         = 10,\n  JSONNumberStateExponentPlusMinus     = 11,\n  JSONNumberStateExponent              = 12,\n};\n\nenum {\n  JSONStringStateStart                           = 0,\n  JSONStringStateParsing                         = 1,\n  JSONStringStateFinished                        = 2,\n  JSONStringStateError                           = 3,\n  JSONStringStateEscape                          = 4,\n  JSONStringStateEscapedUnicode1                 = 5,\n  JSONStringStateEscapedUnicode2                 = 6,\n  JSONStringStateEscapedUnicode3                 = 7,\n  JSONStringStateEscapedUnicode4                 = 8,\n  JSONStringStateEscapedUnicodeSurrogate1        = 9,\n  JSONStringStateEscapedUnicodeSurrogate2        = 10,\n  JSONStringStateEscapedUnicodeSurrogate3        = 11,\n  JSONStringStateEscapedUnicodeSurrogate4        = 12,\n  JSONStringStateEscapedNeedEscapeForSurrogate   = 13,\n  JSONStringStateEscapedNeedEscapedUForSurrogate = 14,\n};\n\nenum {\n  JKParseAcceptValue      = (1 << 0),\n  JKParseAcceptComma      = (1 << 1),\n  JKParseAcceptEnd        = (1 << 2),\n  JKParseAcceptValueOrEnd = (JKParseAcceptValue | JKParseAcceptEnd),\n  JKParseAcceptCommaOrEnd = (JKParseAcceptComma | JKParseAcceptEnd),\n};\n\nenum {\n  JKClassUnknown    = 0,\n  JKClassString     = 1,\n  JKClassNumber     = 2,\n  JKClassArray      = 3,\n  JKClassDictionary = 4,\n  JKClassNull       = 5,\n};\n\nenum {\n  JKManagedBufferOnStack        = 1,\n  JKManagedBufferOnHeap         = 2,\n  JKManagedBufferLocationMask   = (0x3),\n  JKManagedBufferLocationShift  = (0),\n  \n  JKManagedBufferMustFree       = (1 << 2),\n};\ntypedef JKFlags JKManagedBufferFlags;\n\nenum {\n  JKObjectStackOnStack        = 1,\n  JKObjectStackOnHeap         = 2,\n  JKObjectStackLocationMask   = (0x3),\n  JKObjectStackLocationShift  = (0),\n  \n  JKObjectStackMustFree       = (1 << 2),\n};\ntypedef JKFlags JKObjectStackFlags;\n\nenum {\n  JKTokenTypeInvalid     = 0,\n  JKTokenTypeNumber      = 1,\n  JKTokenTypeString      = 2,\n  JKTokenTypeObjectBegin = 3,\n  JKTokenTypeObjectEnd   = 4,\n  JKTokenTypeArrayBegin  = 5,\n  JKTokenTypeArrayEnd    = 6,\n  JKTokenTypeSeparator   = 7,\n  JKTokenTypeComma       = 8,\n  JKTokenTypeTrue        = 9,\n  JKTokenTypeFalse       = 10,\n  JKTokenTypeNull        = 11,\n  JKTokenTypeWhiteSpace  = 12,\n};\ntypedef NSUInteger JKTokenType;\n\n// These are prime numbers to assist with hash slot probing.\nenum {\n  JKValueTypeNone             = 0,\n  JKValueTypeString           = 5,\n  JKValueTypeLongLong         = 7,\n  JKValueTypeUnsignedLongLong = 11,\n  JKValueTypeDouble           = 13,\n};\ntypedef NSUInteger JKValueType;\n\nenum {\n  JKEncodeOptionAsData              = 1,\n  JKEncodeOptionAsString            = 2,\n  JKEncodeOptionAsTypeMask          = 0x7,\n  JKEncodeOptionCollectionObj       = (1 << 3),\n  JKEncodeOptionStringObj           = (1 << 4),\n  JKEncodeOptionStringObjTrimQuotes = (1 << 5),\n  \n};\ntypedef NSUInteger JKEncodeOptionType;\n\ntypedef NSUInteger JKHash;\n\ntypedef struct JKTokenCacheItem  JKTokenCacheItem;\ntypedef struct JKTokenCache      JKTokenCache;\ntypedef struct JKTokenValue      JKTokenValue;\ntypedef struct JKParseToken      JKParseToken;\ntypedef struct JKPtrRange        JKPtrRange;\ntypedef struct JKObjectStack     JKObjectStack;\ntypedef struct JKBuffer          JKBuffer;\ntypedef struct JKConstBuffer     JKConstBuffer;\ntypedef struct JKConstPtrRange   JKConstPtrRange;\ntypedef struct JKRange           JKRange;\ntypedef struct JKManagedBuffer   JKManagedBuffer;\ntypedef struct JKFastClassLookup JKFastClassLookup;\ntypedef struct JKEncodeCache     JKEncodeCache;\ntypedef struct JKEncodeState     JKEncodeState;\ntypedef struct JKObjCImpCache    JKObjCImpCache;\ntypedef struct JKHashTableEntry  JKHashTableEntry;\n\ntypedef id (*NSNumberAllocImp)(id receiver, SEL selector);\ntypedef id (*NSNumberInitWithUnsignedLongLongImp)(id receiver, SEL selector, unsigned long long value);\ntypedef id (*JKClassFormatterIMP)(id receiver, SEL selector, id object);\n#ifdef __BLOCKS__\ntypedef id (^JKClassFormatterBlock)(id formatObject);\n#endif\n\n\nstruct JKPtrRange {\n  unsigned char *ptr;\n  size_t         length;\n};\n\nstruct JKConstPtrRange {\n  const unsigned char *ptr;\n  size_t               length;\n};\n\nstruct JKRange {\n  size_t location, length;\n};\n\nstruct JKManagedBuffer {\n  JKPtrRange           bytes;\n  JKManagedBufferFlags flags;\n  size_t               roundSizeUpToMultipleOf;\n};\n\nstruct JKObjectStack {\n  void               **objects, **keys;\n  CFHashCode          *cfHashes;\n  size_t               count, index, roundSizeUpToMultipleOf;\n  JKObjectStackFlags   flags;\n};\n\nstruct JKBuffer {\n  JKPtrRange bytes;\n};\n\nstruct JKConstBuffer {\n  JKConstPtrRange bytes;\n};\n\nstruct JKTokenValue {\n  JKConstPtrRange   ptrRange;\n  JKValueType       type;\n  JKHash            hash;\n  union {\n    long long          longLongValue;\n    unsigned long long unsignedLongLongValue;\n    double             doubleValue;\n  } number;\n  JKTokenCacheItem *cacheItem;\n};\n\nstruct JKParseToken {\n  JKConstPtrRange tokenPtrRange;\n  JKTokenType     type;\n  JKTokenValue    value;\n  JKManagedBuffer tokenBuffer;\n};\n\nstruct JKTokenCacheItem {\n  void          *object;\n  JKHash         hash;\n  CFHashCode     cfHash;\n  size_t         size;\n  unsigned char *bytes;\n  JKValueType    type;\n};\n\nstruct JKTokenCache {\n  JKTokenCacheItem *items;\n  size_t            count;\n  unsigned int      prng_lfsr;\n  unsigned char     age[JK_CACHE_SLOTS];\n};\n\nstruct JKObjCImpCache {\n  Class                               NSNumberClass;\n  NSNumberAllocImp                    NSNumberAlloc;\n  NSNumberInitWithUnsignedLongLongImp NSNumberInitWithUnsignedLongLong;\n};\n\nstruct JKParseState {\n  JKParseOptionFlags  parseOptionFlags;\n  JKConstBuffer       stringBuffer;\n  size_t              atIndex, lineNumber, lineStartIndex;\n  size_t              prev_atIndex, prev_lineNumber, prev_lineStartIndex;\n  JKParseToken        token;\n  JKObjectStack       objectStack;\n  JKTokenCache        cache;\n  JKObjCImpCache      objCImpCache;\n  NSError            *error;\n  int                 errorIsPrev;\n  BOOL                mutableCollections;\n};\n\nstruct JKFastClassLookup {\n  void *stringClass;\n  void *numberClass;\n  void *arrayClass;\n  void *dictionaryClass;\n  void *nullClass;\n};\n\nstruct JKEncodeCache {\n  id object;\n  size_t offset;\n  size_t length;\n};\n\nstruct JKEncodeState {\n  JKManagedBuffer         utf8ConversionBuffer;\n  JKManagedBuffer         stringBuffer;\n  size_t                  atIndex;\n  JKFastClassLookup       fastClassLookup;\n  JKEncodeCache           cache[JK_ENCODE_CACHE_SLOTS];\n  JKSerializeOptionFlags  serializeOptionFlags;\n  JKEncodeOptionType      encodeOption;\n  size_t                  depth;\n  NSError                *error;\n  id                      classFormatterDelegate;\n  SEL                     classFormatterSelector;\n  JKClassFormatterIMP     classFormatterIMP;\n#ifdef __BLOCKS__\n  JKClassFormatterBlock   classFormatterBlock;\n#endif\n};\n\n// This is a JSONKit private class.\n@interface JKSerializer : NSObject {\n  JKEncodeState *encodeState;\n}\n\n#ifdef __BLOCKS__\n#define JKSERIALIZER_BLOCKS_PROTO id(^)(id object)\n#else\n#define JKSERIALIZER_BLOCKS_PROTO id\n#endif\n\n+ (id)serializeObject:(id)object options:(JKSerializeOptionFlags)optionFlags encodeOption:(JKEncodeOptionType)encodeOption block:(JKSERIALIZER_BLOCKS_PROTO)block delegate:(id)delegate selector:(SEL)selector error:(NSError **)error;\n- (id)serializeObject:(id)object options:(JKSerializeOptionFlags)optionFlags encodeOption:(JKEncodeOptionType)encodeOption block:(JKSERIALIZER_BLOCKS_PROTO)block delegate:(id)delegate selector:(SEL)selector error:(NSError **)error;\n- (void)releaseState;\n\n@end\n\nstruct JKHashTableEntry {\n  NSUInteger keyHash;\n  id key, object;\n};\n\n\ntypedef uint32_t UTF32; /* at least 32 bits */\ntypedef uint16_t UTF16; /* at least 16 bits */\ntypedef uint8_t  UTF8;  /* typically 8 bits */\n\ntypedef enum {\n  conversionOK,           /* conversion successful */\n  sourceExhausted,        /* partial character in source, but hit end */\n  targetExhausted,        /* insuff. room in target for conversion */\n  sourceIllegal           /* source sequence is illegal/malformed */\n} ConversionResult;\n\n#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD\n#define UNI_MAX_BMP          (UTF32)0x0000FFFF\n#define UNI_MAX_UTF16        (UTF32)0x0010FFFF\n#define UNI_MAX_UTF32        (UTF32)0x7FFFFFFF\n#define UNI_MAX_LEGAL_UTF32  (UTF32)0x0010FFFF\n#define UNI_SUR_HIGH_START   (UTF32)0xD800\n#define UNI_SUR_HIGH_END     (UTF32)0xDBFF\n#define UNI_SUR_LOW_START    (UTF32)0xDC00\n#define UNI_SUR_LOW_END      (UTF32)0xDFFF\n\n\n#if !defined(JK_FAST_TRAILING_BYTES)\nstatic const char trailingBytesForUTF8[256] = {\n    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\n    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5\n};\n#endif\n\nstatic const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL };\nstatic const UTF8  firstByteMark[7]   = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };\n\n#define JK_AT_STRING_PTR(x)  (&((x)->stringBuffer.bytes.ptr[(x)->atIndex]))\n#define JK_END_STRING_PTR(x) (&((x)->stringBuffer.bytes.ptr[(x)->stringBuffer.bytes.length]))\n\n\nstatic JKArray          *_JKArrayCreate(id *objects, NSUInteger count, BOOL mutableCollection);\nstatic void              _JKArrayInsertObjectAtIndex(JKArray *array, id newObject, NSUInteger objectIndex);\nstatic void              _JKArrayReplaceObjectAtIndexWithObject(JKArray *array, NSUInteger objectIndex, id newObject);\nstatic void              _JKArrayRemoveObjectAtIndex(JKArray *array, NSUInteger objectIndex);\n\n\nstatic NSUInteger        _JKDictionaryCapacityForCount(NSUInteger count);\nstatic JKDictionary     *_JKDictionaryCreate(id *keys, NSUInteger *keyHashes, id *objects, NSUInteger count, BOOL mutableCollection);\nstatic JKHashTableEntry *_JKDictionaryHashEntry(JKDictionary *dictionary);\nstatic NSUInteger        _JKDictionaryCapacity(JKDictionary *dictionary);\nstatic void              _JKDictionaryResizeIfNeccessary(JKDictionary *dictionary);\nstatic void              _JKDictionaryRemoveObjectWithEntry(JKDictionary *dictionary, JKHashTableEntry *entry);\nstatic void              _JKDictionaryAddObject(JKDictionary *dictionary, NSUInteger keyHash, id key, id object);\nstatic JKHashTableEntry *_JKDictionaryHashTableEntryForKey(JKDictionary *dictionary, id aKey);\n\n\nstatic void _JSONDecoderCleanup(JSONDecoder *decoder);\n\nstatic id _NSStringObjectFromJSONString(NSString *jsonString, JKParseOptionFlags parseOptionFlags, NSError **error, BOOL mutableCollection);\n\n\nstatic void jk_managedBuffer_release(JKManagedBuffer *managedBuffer);\nstatic void jk_managedBuffer_setToStackBuffer(JKManagedBuffer *managedBuffer, unsigned char *ptr, size_t length);\nstatic unsigned char *jk_managedBuffer_resize(JKManagedBuffer *managedBuffer, size_t newSize);\nstatic void jk_objectStack_release(JKObjectStack *objectStack);\nstatic void jk_objectStack_setToStackBuffer(JKObjectStack *objectStack, void **objects, void **keys, CFHashCode *cfHashes, size_t count);\nstatic int  jk_objectStack_resize(JKObjectStack *objectStack, size_t newCount);\n\nstatic void   jk_error(JKParseState *parseState, NSString *format, ...);\nstatic int    jk_parse_string(JKParseState *parseState);\nstatic int    jk_parse_number(JKParseState *parseState);\nstatic size_t jk_parse_is_newline(JKParseState *parseState, const unsigned char *atCharacterPtr);\nJK_STATIC_INLINE int jk_parse_skip_newline(JKParseState *parseState);\nJK_STATIC_INLINE void jk_parse_skip_whitespace(JKParseState *parseState);\nstatic int    jk_parse_next_token(JKParseState *parseState);\nstatic void   jk_error_parse_accept_or3(JKParseState *parseState, int state, NSString *or1String, NSString *or2String, NSString *or3String);\nstatic void  *jk_create_dictionary(JKParseState *parseState, size_t startingObjectIndex);\nstatic void  *jk_parse_dictionary(JKParseState *parseState);\nstatic void  *jk_parse_array(JKParseState *parseState);\nstatic void  *jk_object_for_token(JKParseState *parseState);\nstatic void  *jk_cachedObjects(JKParseState *parseState);\nJK_STATIC_INLINE void jk_cache_age(JKParseState *parseState);\nJK_STATIC_INLINE void jk_set_parsed_token(JKParseState *parseState, const unsigned char *ptr, size_t length, JKTokenType type, size_t advanceBy);\n\n\nstatic void jk_encode_error(JKEncodeState *encodeState, NSString *format, ...);\nstatic int jk_encode_printf(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object, const char *format, ...);\nstatic int jk_encode_write(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object, const char *format);\nstatic int jk_encode_writePrettyPrintWhiteSpace(JKEncodeState *encodeState);\nstatic int jk_encode_write1slow(JKEncodeState *encodeState, ssize_t depthChange, const char *format);\nstatic int jk_encode_write1fast(JKEncodeState *encodeState, ssize_t depthChange JK_UNUSED_ARG, const char *format);\nstatic int jk_encode_writen(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object, const char *format, size_t length);\nJK_STATIC_INLINE JKHash jk_encode_object_hash(void *objectPtr);\nJK_STATIC_INLINE void jk_encode_updateCache(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object);\nstatic int jk_encode_add_atom_to_buffer(JKEncodeState *encodeState, void *objectPtr);\n\n#define jk_encode_write1(es, dc, f)  (JK_EXPECT_F(_jk_encode_prettyPrint) ? jk_encode_write1slow(es, dc, f) : jk_encode_write1fast(es, dc, f))\n\n\nJK_STATIC_INLINE size_t jk_min(size_t a, size_t b);\nJK_STATIC_INLINE size_t jk_max(size_t a, size_t b);\nJK_STATIC_INLINE JKHash calculateHash(JKHash currentHash, unsigned char c);\n\n// JSONKit v1.4 used both a JKArray : NSArray and JKMutableArray : NSMutableArray, and the same for the dictionary collection type.\n// However, Louis Gerbarg (via cocoa-dev) pointed out that Cocoa / Core Foundation actually implements only a single class that inherits from the \n// mutable version, and keeps an ivar bit for whether or not that instance is mutable.  This means that the immutable versions of the collection\n// classes receive the mutating methods, but this is handled by having those methods throw an exception when the ivar bit is set to immutable.\n// We adopt the same strategy here.  It's both cleaner and gets rid of the method swizzling hackery used in JSONKit v1.4.\n\n\n// This is a workaround for issue #23 https://github.com/johnezang/JSONKit/pull/23\n// Basically, there seem to be a problem with using +load in static libraries on iOS.  However, __attribute__ ((constructor)) does work correctly.\n// Since we do not require anything \"special\" that +load provides, and we can accomplish the same thing using __attribute__ ((constructor)), the +load logic was moved here.\n\nstatic Class                               _JKArrayClass                           = NULL;\nstatic size_t                              _JKArrayInstanceSize                    = 0UL;\nstatic Class                               _JKDictionaryClass                      = NULL;\nstatic size_t                              _JKDictionaryInstanceSize               = 0UL;\n\n// For JSONDecoder...\nstatic Class                               _jk_NSNumberClass                       = NULL;\nstatic NSNumberAllocImp                    _jk_NSNumberAllocImp                    = NULL;\nstatic NSNumberInitWithUnsignedLongLongImp _jk_NSNumberInitWithUnsignedLongLongImp = NULL;\n\nextern void jk_collectionClassLoadTimeInitialization(void) __attribute__ ((constructor));\n\nvoid jk_collectionClassLoadTimeInitialization(void) {\n  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Though technically not required, the run time environment at load time initialization may be less than ideal.\n  \n  _JKArrayClass             = objc_getClass(\"JKArray\");\n  _JKArrayInstanceSize      = jk_max(16UL, class_getInstanceSize(_JKArrayClass));\n  \n  _JKDictionaryClass        = objc_getClass(\"JKDictionary\");\n  _JKDictionaryInstanceSize = jk_max(16UL, class_getInstanceSize(_JKDictionaryClass));\n  \n  // For JSONDecoder...\n  _jk_NSNumberClass = [NSNumber class];\n  _jk_NSNumberAllocImp = (NSNumberAllocImp)[NSNumber methodForSelector:@selector(alloc)];\n  \n  // Hacktacular.  Need to do it this way due to the nature of class clusters.\n  id temp_NSNumber = [NSNumber alloc];\n  _jk_NSNumberInitWithUnsignedLongLongImp = (NSNumberInitWithUnsignedLongLongImp)[temp_NSNumber methodForSelector:@selector(initWithUnsignedLongLong:)];\n  [[temp_NSNumber init] release];\n  temp_NSNumber = NULL;\n  \n  [pool release]; pool = NULL;\n}\n\n\n#pragma mark -\n@interface JKArray : NSMutableArray <NSCopying, NSMutableCopying, NSFastEnumeration> {\n  id         *objects;\n  NSUInteger  count, capacity, mutations;\n}\n@end\n\n@implementation JKArray\n\n+ (id)allocWithZone:(NSZone *)zone\n{\n#pragma unused(zone)\n  [NSException raise:NSInvalidArgumentException format:@\"*** - [%@ %@]: The %@ class is private to JSONKit and should not be used in this fashion.\", NSStringFromClass([self class]), NSStringFromSelector(_cmd), NSStringFromClass([self class])];\n  return(NULL);\n}\n\nstatic JKArray *_JKArrayCreate(id *objects, NSUInteger count, BOOL mutableCollection) {\n  NSCParameterAssert((objects != NULL) && (_JKArrayClass != NULL) && (_JKArrayInstanceSize > 0UL));\n  JKArray *array = NULL;\n  if(JK_EXPECT_T((array = (JKArray *)calloc(1UL, _JKArrayInstanceSize)) != NULL)) { // Directly allocate the JKArray instance via calloc.\n    array->isa      = _JKArrayClass;\n    if((array = [array init]) == NULL) { return(NULL); }\n    array->capacity = count;\n    array->count    = count;\n    if(JK_EXPECT_F((array->objects = (id *)malloc(sizeof(id) * array->capacity)) == NULL)) { [array autorelease]; return(NULL); }\n    memcpy(array->objects, objects, array->capacity * sizeof(id));\n    array->mutations = (mutableCollection == NO) ? 0UL : 1UL;\n  }\n  return(array);\n}\n\n// Note: The caller is responsible for -retaining the object that is to be added.\nstatic void _JKArrayInsertObjectAtIndex(JKArray *array, id newObject, NSUInteger objectIndex) {\n  NSCParameterAssert((array != NULL) && (array->objects != NULL) && (array->count <= array->capacity) && (objectIndex <= array->count) && (newObject != NULL));\n  if(!((array != NULL) && (array->objects != NULL) && (objectIndex <= array->count) && (newObject != NULL))) { [newObject autorelease]; return; }\n  if((array->count + 1UL) >= array->capacity) {\n    id *newObjects = NULL;\n    if((newObjects = (id *)realloc(array->objects, sizeof(id) * (array->capacity + 16UL))) == NULL) { [NSException raise:NSMallocException format:@\"Unable to resize objects array.\"]; }\n    array->objects = newObjects;\n    array->capacity += 16UL;\n    memset(&array->objects[array->count], 0, sizeof(id) * (array->capacity - array->count));\n  }\n  array->count++;\n  if((objectIndex + 1UL) < array->count) { memmove(&array->objects[objectIndex + 1UL], &array->objects[objectIndex], sizeof(id) * ((array->count - 1UL) - objectIndex)); array->objects[objectIndex] = NULL; }\n  array->objects[objectIndex] = newObject;\n}\n\n// Note: The caller is responsible for -retaining the object that is to be added.\nstatic void _JKArrayReplaceObjectAtIndexWithObject(JKArray *array, NSUInteger objectIndex, id newObject) {\n  NSCParameterAssert((array != NULL) && (array->objects != NULL) && (array->count <= array->capacity) && (objectIndex < array->count) && (array->objects[objectIndex] != NULL) && (newObject != NULL));\n  if(!((array != NULL) && (array->objects != NULL) && (objectIndex < array->count) && (array->objects[objectIndex] != NULL) && (newObject != NULL))) { [newObject autorelease]; return; }\n  CFRelease(array->objects[objectIndex]);\n  array->objects[objectIndex] = NULL;\n  array->objects[objectIndex] = newObject;\n}\n\nstatic void _JKArrayRemoveObjectAtIndex(JKArray *array, NSUInteger objectIndex) {\n  NSCParameterAssert((array != NULL) && (array->objects != NULL) && (array->count > 0UL) && (array->count <= array->capacity) && (objectIndex < array->count) && (array->objects[objectIndex] != NULL));\n  if(!((array != NULL) && (array->objects != NULL) && (array->count > 0UL) && (array->count <= array->capacity) && (objectIndex < array->count) && (array->objects[objectIndex] != NULL))) { return; }\n  CFRelease(array->objects[objectIndex]);\n  array->objects[objectIndex] = NULL;\n  if((objectIndex + 1UL) < array->count) { memmove(&array->objects[objectIndex], &array->objects[objectIndex + 1UL], sizeof(id) * ((array->count - 1UL) - objectIndex)); array->objects[array->count - 1UL] = NULL; }\n  array->count--;\n}\n\n- (void)dealloc\n{\n  if(JK_EXPECT_T(objects != NULL)) {\n    NSUInteger atObject = 0UL;\n    for(atObject = 0UL; atObject < count; atObject++) { if(JK_EXPECT_T(objects[atObject] != NULL)) { CFRelease(objects[atObject]); objects[atObject] = NULL; } }\n    free(objects); objects = NULL;\n  }\n  \n  [super dealloc];\n}\n\n- (NSUInteger)count\n{\n  NSParameterAssert((objects != NULL) && (count <= capacity));\n  return(count);\n}\n\n- (void)getObjects:(id *)objectsPtr range:(NSRange)range\n{\n  NSParameterAssert((objects != NULL) && (count <= capacity));\n  if((objectsPtr     == NULL)  && (NSMaxRange(range) > 0UL))   { [NSException raise:NSRangeException format:@\"*** -[%@ %@]: pointer to objects array is NULL but range length is %lu\", NSStringFromClass([self class]), NSStringFromSelector(_cmd), NSMaxRange(range)];        }\n  if((range.location >  count) || (NSMaxRange(range) > count)) { [NSException raise:NSRangeException format:@\"*** -[%@ %@]: index (%lu) beyond bounds (%lu)\",                          NSStringFromClass([self class]), NSStringFromSelector(_cmd), NSMaxRange(range), count]; }\n  memcpy(objectsPtr, objects + range.location, range.length * sizeof(id));\n}\n\n- (id)objectAtIndex:(NSUInteger)objectIndex\n{\n  if(objectIndex >= count) { [NSException raise:NSRangeException format:@\"*** -[%@ %@]: index (%lu) beyond bounds (%lu)\", NSStringFromClass([self class]), NSStringFromSelector(_cmd), objectIndex, count]; }\n  NSParameterAssert((objects != NULL) && (count <= capacity) && (objects[objectIndex] != NULL));\n  return(objects[objectIndex]);\n}\n\n- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len\n{\n  NSParameterAssert((state != NULL) && (stackbuf != NULL) && (len > 0UL) && (objects != NULL) && (count <= capacity));\n  if(JK_EXPECT_F(state->state == 0UL))   { state->mutationsPtr = (unsigned long *)&mutations; state->itemsPtr = stackbuf; }\n  if(JK_EXPECT_F(state->state >= count)) { return(0UL); }\n  \n  NSUInteger enumeratedCount  = 0UL;\n  while(JK_EXPECT_T(enumeratedCount < len) && JK_EXPECT_T(state->state < count)) { NSParameterAssert(objects[state->state] != NULL); stackbuf[enumeratedCount++] = objects[state->state++]; }\n  \n  return(enumeratedCount);\n}\n\n- (void)insertObject:(id)anObject atIndex:(NSUInteger)objectIndex\n{\n  if(mutations   == 0UL)   { [NSException raise:NSInternalInconsistencyException format:@\"*** -[%@ %@]: mutating method sent to immutable object\", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }\n  if(anObject    == NULL)  { [NSException raise:NSInvalidArgumentException       format:@\"*** -[%@ %@]: attempt to insert nil\",                    NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }\n  if(objectIndex >  count) { [NSException raise:NSRangeException                 format:@\"*** -[%@ %@]: index (%lu) beyond bounds (%lu)\",          NSStringFromClass([self class]), NSStringFromSelector(_cmd), objectIndex, count + 1UL]; }\n#ifdef __clang_analyzer__\n  [anObject retain]; // Stupid clang analyzer...  Issue #19.\n#else\n  anObject = [anObject retain];\n#endif\n  _JKArrayInsertObjectAtIndex(self, anObject, objectIndex);\n  mutations = (mutations == NSUIntegerMax) ? 1UL : mutations + 1UL;\n}\n\n- (void)removeObjectAtIndex:(NSUInteger)objectIndex\n{\n  if(mutations   == 0UL)   { [NSException raise:NSInternalInconsistencyException format:@\"*** -[%@ %@]: mutating method sent to immutable object\", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }\n  if(objectIndex >= count) { [NSException raise:NSRangeException                 format:@\"*** -[%@ %@]: index (%lu) beyond bounds (%lu)\",          NSStringFromClass([self class]), NSStringFromSelector(_cmd), objectIndex, count]; }\n  _JKArrayRemoveObjectAtIndex(self, objectIndex);\n  mutations = (mutations == NSUIntegerMax) ? 1UL : mutations + 1UL;\n}\n\n- (void)replaceObjectAtIndex:(NSUInteger)objectIndex withObject:(id)anObject\n{\n  if(mutations   == 0UL)   { [NSException raise:NSInternalInconsistencyException format:@\"*** -[%@ %@]: mutating method sent to immutable object\", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }\n  if(anObject    == NULL)  { [NSException raise:NSInvalidArgumentException       format:@\"*** -[%@ %@]: attempt to insert nil\",                    NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }\n  if(objectIndex >= count) { [NSException raise:NSRangeException                 format:@\"*** -[%@ %@]: index (%lu) beyond bounds (%lu)\",          NSStringFromClass([self class]), NSStringFromSelector(_cmd), objectIndex, count]; }\n#ifdef __clang_analyzer__\n  [anObject retain]; // Stupid clang analyzer...  Issue #19.\n#else\n  anObject = [anObject retain];\n#endif\n  _JKArrayReplaceObjectAtIndexWithObject(self, objectIndex, anObject);\n  mutations = (mutations == NSUIntegerMax) ? 1UL : mutations + 1UL;\n}\n\n- (id)copyWithZone:(NSZone *)zone\n{\n  NSParameterAssert((objects != NULL) && (count <= capacity));\n  return((mutations == 0UL) ? [self retain] : [(NSArray *)[NSArray allocWithZone:zone] initWithObjects:objects count:count]);\n}\n\n- (id)mutableCopyWithZone:(NSZone *)zone\n{\n  NSParameterAssert((objects != NULL) && (count <= capacity));\n  return([(NSMutableArray *)[NSMutableArray allocWithZone:zone] initWithObjects:objects count:count]);\n}\n\n@end\n\n\n#pragma mark -\n@interface JKDictionaryEnumerator : NSEnumerator {\n  id         collection;\n  NSUInteger nextObject;\n}\n\n- (id)initWithJKDictionary:(JKDictionary *)initDictionary;\n- (NSArray *)allObjects;\n- (id)nextObject;\n\n@end\n\n@implementation JKDictionaryEnumerator\n\n- (id)initWithJKDictionary:(JKDictionary *)initDictionary\n{\n  NSParameterAssert(initDictionary != NULL);\n  if((self = [super init]) == NULL) { return(NULL); }\n  if((collection = (id)CFRetain(initDictionary)) == NULL) { [self autorelease]; return(NULL); }\n  return(self);\n}\n\n- (void)dealloc\n{\n  if(collection != NULL) { CFRelease(collection); collection = NULL; }\n  [super dealloc];\n}\n\n- (NSArray *)allObjects\n{\n  NSParameterAssert(collection != NULL);\n  NSUInteger count = [(NSDictionary *)collection count], atObject = 0UL;\n  id         objects[count];\n\n  while((objects[atObject] = [self nextObject]) != NULL) { NSParameterAssert(atObject < count); atObject++; }\n\n  return([NSArray arrayWithObjects:objects count:atObject]);\n}\n\n- (id)nextObject\n{\n  NSParameterAssert((collection != NULL) && (_JKDictionaryHashEntry(collection) != NULL));\n  JKHashTableEntry *entry        = _JKDictionaryHashEntry(collection);\n  NSUInteger        capacity     = _JKDictionaryCapacity(collection);\n  id                returnObject = NULL;\n\n  if(entry != NULL) { while((nextObject < capacity) && ((returnObject = entry[nextObject++].key) == NULL)) { /* ... */ } }\n  \n  return(returnObject);\n}\n\n@end\n\n#pragma mark -\n@interface JKDictionary : NSMutableDictionary <NSCopying, NSMutableCopying, NSFastEnumeration> {\n  NSUInteger count, capacity, mutations;\n  JKHashTableEntry *entry;\n}\n@end\n\n@implementation JKDictionary\n\n+ (id)allocWithZone:(NSZone *)zone\n{\n#pragma unused(zone)\n  [NSException raise:NSInvalidArgumentException format:@\"*** - [%@ %@]: The %@ class is private to JSONKit and should not be used in this fashion.\", NSStringFromClass([self class]), NSStringFromSelector(_cmd), NSStringFromClass([self class])];\n  return(NULL);\n}\n\n// These values are taken from Core Foundation CF-550 CFBasicHash.m.  As a bonus, they align very well with our JKHashTableEntry struct too.\nstatic const NSUInteger jk_dictionaryCapacities[] = {\n  0UL, 3UL, 7UL, 13UL, 23UL, 41UL, 71UL, 127UL, 191UL, 251UL, 383UL, 631UL, 1087UL, 1723UL,\n  2803UL, 4523UL, 7351UL, 11959UL, 19447UL, 31231UL, 50683UL, 81919UL, 132607UL,\n  214519UL, 346607UL, 561109UL, 907759UL, 1468927UL, 2376191UL, 3845119UL,\n  6221311UL, 10066421UL, 16287743UL, 26354171UL, 42641881UL, 68996069UL,\n  111638519UL, 180634607UL, 292272623UL, 472907251UL\n};\n\nstatic NSUInteger _JKDictionaryCapacityForCount(NSUInteger count) {\n  NSUInteger bottom = 0UL, top = sizeof(jk_dictionaryCapacities) / sizeof(NSUInteger), mid = 0UL, tableSize = lround(floor((count) * 1.33));\n  while(top > bottom) { mid = (top + bottom) / 2UL; if(jk_dictionaryCapacities[mid] < tableSize) { bottom = mid + 1UL; } else { top = mid; } }\n  return(jk_dictionaryCapacities[bottom]);\n}\n\nstatic void _JKDictionaryResizeIfNeccessary(JKDictionary *dictionary) {\n  NSCParameterAssert((dictionary != NULL) && (dictionary->entry != NULL) && (dictionary->count <= dictionary->capacity));\n\n  NSUInteger capacityForCount = 0UL;\n  if(dictionary->capacity < (capacityForCount = _JKDictionaryCapacityForCount(dictionary->count + 1UL))) { // resize\n    NSUInteger        oldCapacity = dictionary->capacity;\n#ifndef NS_BLOCK_ASSERTIONS\n    NSUInteger oldCount = dictionary->count;\n#endif\n    JKHashTableEntry *oldEntry    = dictionary->entry;\n    if(JK_EXPECT_F((dictionary->entry = (JKHashTableEntry *)calloc(1UL, sizeof(JKHashTableEntry) * capacityForCount)) == NULL)) { [NSException raise:NSMallocException format:@\"Unable to allocate memory for hash table.\"]; }\n    dictionary->capacity = capacityForCount;\n    dictionary->count    = 0UL;\n    \n    NSUInteger idx = 0UL;\n    for(idx = 0UL; idx < oldCapacity; idx++) { if(oldEntry[idx].key != NULL) { _JKDictionaryAddObject(dictionary, oldEntry[idx].keyHash, oldEntry[idx].key, oldEntry[idx].object); oldEntry[idx].keyHash = 0UL; oldEntry[idx].key = NULL; oldEntry[idx].object = NULL; } }\n    NSCParameterAssert((oldCount == dictionary->count));\n    free(oldEntry); oldEntry = NULL;\n  }\n}\n\nstatic JKDictionary *_JKDictionaryCreate(id *keys, NSUInteger *keyHashes, id *objects, NSUInteger count, BOOL mutableCollection) {\n  NSCParameterAssert((keys != NULL) && (keyHashes != NULL) && (objects != NULL) && (_JKDictionaryClass != NULL) && (_JKDictionaryInstanceSize > 0UL));\n  JKDictionary *dictionary = NULL;\n  if(JK_EXPECT_T((dictionary = (JKDictionary *)calloc(1UL, _JKDictionaryInstanceSize)) != NULL)) { // Directly allocate the JKDictionary instance via calloc.\n    dictionary->isa      = _JKDictionaryClass;\n    if((dictionary = [dictionary init]) == NULL) { return(NULL); }\n    dictionary->capacity = _JKDictionaryCapacityForCount(count);\n    dictionary->count    = 0UL;\n    \n    if(JK_EXPECT_F((dictionary->entry = (JKHashTableEntry *)calloc(1UL, sizeof(JKHashTableEntry) * dictionary->capacity)) == NULL)) { [dictionary autorelease]; return(NULL); }\n\n    NSUInteger idx = 0UL;\n    for(idx = 0UL; idx < count; idx++) { _JKDictionaryAddObject(dictionary, keyHashes[idx], keys[idx], objects[idx]); }\n\n    dictionary->mutations = (mutableCollection == NO) ? 0UL : 1UL;\n  }\n  return(dictionary);\n}\n\n- (void)dealloc\n{\n  if(JK_EXPECT_T(entry != NULL)) {\n    NSUInteger atEntry = 0UL;\n    for(atEntry = 0UL; atEntry < capacity; atEntry++) {\n      if(JK_EXPECT_T(entry[atEntry].key    != NULL)) { CFRelease(entry[atEntry].key);    entry[atEntry].key    = NULL; }\n      if(JK_EXPECT_T(entry[atEntry].object != NULL)) { CFRelease(entry[atEntry].object); entry[atEntry].object = NULL; }\n    }\n  \n    free(entry); entry = NULL;\n  }\n\n  [super dealloc];\n}\n\nstatic JKHashTableEntry *_JKDictionaryHashEntry(JKDictionary *dictionary) {\n  NSCParameterAssert(dictionary != NULL);\n  return(dictionary->entry);\n}\n\nstatic NSUInteger _JKDictionaryCapacity(JKDictionary *dictionary) {\n  NSCParameterAssert(dictionary != NULL);\n  return(dictionary->capacity);\n}\n\nstatic void _JKDictionaryRemoveObjectWithEntry(JKDictionary *dictionary, JKHashTableEntry *entry) {\n  NSCParameterAssert((dictionary != NULL) && (entry != NULL) && (entry->key != NULL) && (entry->object != NULL) && (dictionary->count > 0UL) && (dictionary->count <= dictionary->capacity));\n  CFRelease(entry->key);    entry->key    = NULL;\n  CFRelease(entry->object); entry->object = NULL;\n  entry->keyHash = 0UL;\n  dictionary->count--;\n  // In order for certain invariants that are used to speed up the search for a particular key, we need to \"re-add\" all the entries in the hash table following this entry until we hit a NULL entry.\n  NSUInteger removeIdx = entry - dictionary->entry, idx = 0UL;\n  NSCParameterAssert((removeIdx < dictionary->capacity));\n  for(idx = 0UL; idx < dictionary->capacity; idx++) {\n    NSUInteger entryIdx = (removeIdx + idx + 1UL) % dictionary->capacity;\n    JKHashTableEntry *atEntry = &dictionary->entry[entryIdx];\n    if(atEntry->key == NULL) { break; }\n    NSUInteger keyHash = atEntry->keyHash;\n    id key = atEntry->key, object = atEntry->object;\n    NSCParameterAssert(object != NULL);\n    atEntry->keyHash = 0UL;\n    atEntry->key     = NULL;\n    atEntry->object  = NULL;\n    NSUInteger addKeyEntry = keyHash % dictionary->capacity, addIdx = 0UL;\n    for(addIdx = 0UL; addIdx < dictionary->capacity; addIdx++) {\n      JKHashTableEntry *atAddEntry = &dictionary->entry[((addKeyEntry + addIdx) % dictionary->capacity)];\n      if(JK_EXPECT_T(atAddEntry->key == NULL)) { NSCParameterAssert((atAddEntry->keyHash == 0UL) && (atAddEntry->object == NULL)); atAddEntry->key = key; atAddEntry->object = object; atAddEntry->keyHash = keyHash; break; }\n    }\n  }\n}\n\nstatic void _JKDictionaryAddObject(JKDictionary *dictionary, NSUInteger keyHash, id key, id object) {\n  NSCParameterAssert((dictionary != NULL) && (key != NULL) && (object != NULL) && (dictionary->count < dictionary->capacity) && (dictionary->entry != NULL));\n  NSUInteger keyEntry = keyHash % dictionary->capacity, idx = 0UL;\n  for(idx = 0UL; idx < dictionary->capacity; idx++) {\n    NSUInteger entryIdx = (keyEntry + idx) % dictionary->capacity;\n    JKHashTableEntry *atEntry = &dictionary->entry[entryIdx];\n    if(JK_EXPECT_F(atEntry->keyHash == keyHash) && JK_EXPECT_T(atEntry->key != NULL) && (JK_EXPECT_F(key == atEntry->key) || JK_EXPECT_F(CFEqual(atEntry->key, key)))) { _JKDictionaryRemoveObjectWithEntry(dictionary, atEntry); }\n    if(JK_EXPECT_T(atEntry->key == NULL)) { NSCParameterAssert((atEntry->keyHash == 0UL) && (atEntry->object == NULL)); atEntry->key = key; atEntry->object = object; atEntry->keyHash = keyHash; dictionary->count++; return; }\n  }\n\n  // We should never get here.  If we do, we -release the key / object because it's our responsibility.\n  CFRelease(key);\n  CFRelease(object);\n}\n\n- (NSUInteger)count\n{\n  return(count);\n}\n\nstatic JKHashTableEntry *_JKDictionaryHashTableEntryForKey(JKDictionary *dictionary, id aKey) {\n  NSCParameterAssert((dictionary != NULL) && (dictionary->entry != NULL) && (dictionary->count <= dictionary->capacity));\n  if((aKey == NULL) || (dictionary->capacity == 0UL)) { return(NULL); }\n  NSUInteger        keyHash = CFHash(aKey), keyEntry = (keyHash % dictionary->capacity), idx = 0UL;\n  JKHashTableEntry *atEntry = NULL;\n  for(idx = 0UL; idx < dictionary->capacity; idx++) {\n    atEntry = &dictionary->entry[(keyEntry + idx) % dictionary->capacity];\n    if(JK_EXPECT_T(atEntry->keyHash == keyHash) && JK_EXPECT_T(atEntry->key != NULL) && ((atEntry->key == aKey) || CFEqual(atEntry->key, aKey))) { NSCParameterAssert(atEntry->object != NULL); return(atEntry); break; }\n    if(JK_EXPECT_F(atEntry->key == NULL)) { NSCParameterAssert(atEntry->object == NULL); return(NULL); break; } // If the key was in the table, we would have found it by now.\n  }\n  return(NULL);\n}\n\n- (id)objectForKey:(id)aKey\n{\n  NSParameterAssert((entry != NULL) && (count <= capacity));\n  JKHashTableEntry *entryForKey = _JKDictionaryHashTableEntryForKey(self, aKey);\n  return((entryForKey != NULL) ? entryForKey->object : NULL);\n}\n\n- (void)getObjects:(id *)objects andKeys:(id *)keys\n{\n  NSParameterAssert((entry != NULL) && (count <= capacity));\n  NSUInteger atEntry = 0UL; NSUInteger arrayIdx = 0UL;\n  for(atEntry = 0UL; atEntry < capacity; atEntry++) {\n    if(JK_EXPECT_T(entry[atEntry].key != NULL)) {\n      NSCParameterAssert((entry[atEntry].object != NULL) && (arrayIdx < count));\n      if(JK_EXPECT_T(keys    != NULL)) { keys[arrayIdx]    = entry[atEntry].key;    }\n      if(JK_EXPECT_T(objects != NULL)) { objects[arrayIdx] = entry[atEntry].object; }\n      arrayIdx++;\n    }\n  }\n}\n\n- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len\n{\n  NSParameterAssert((state != NULL) && (stackbuf != NULL) && (len > 0UL) && (entry != NULL) && (count <= capacity));\n  if(JK_EXPECT_F(state->state == 0UL))      { state->mutationsPtr = (unsigned long *)&mutations; state->itemsPtr = stackbuf; }\n  if(JK_EXPECT_F(state->state >= capacity)) { return(0UL); }\n  \n  NSUInteger enumeratedCount  = 0UL;\n  while(JK_EXPECT_T(enumeratedCount < len) && JK_EXPECT_T(state->state < capacity)) { if(JK_EXPECT_T(entry[state->state].key != NULL)) { stackbuf[enumeratedCount++] = entry[state->state].key; } state->state++; }\n    \n  return(enumeratedCount);\n}\n\n- (NSEnumerator *)keyEnumerator\n{\n  return([[[JKDictionaryEnumerator alloc] initWithJKDictionary:self] autorelease]);\n}\n\n- (void)setObject:(id)anObject forKey:(id)aKey\n{\n  if(mutations == 0UL)  { [NSException raise:NSInternalInconsistencyException format:@\"*** -[%@ %@]: mutating method sent to immutable object\", NSStringFromClass([self class]), NSStringFromSelector(_cmd)];       }\n  if(aKey      == NULL) { [NSException raise:NSInvalidArgumentException       format:@\"*** -[%@ %@]: attempt to insert nil key\",                NSStringFromClass([self class]), NSStringFromSelector(_cmd)];       }\n  if(anObject  == NULL) { [NSException raise:NSInvalidArgumentException       format:@\"*** -[%@ %@]: attempt to insert nil value (key: %@)\",    NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey]; }\n  \n  _JKDictionaryResizeIfNeccessary(self);\n#ifndef __clang_analyzer__\n  aKey     = [aKey     copy];   // Why on earth would clang complain that this -copy \"might leak\", \n  anObject = [anObject retain]; // but this -retain doesn't!?\n#endif // __clang_analyzer__\n  _JKDictionaryAddObject(self, CFHash(aKey), aKey, anObject);\n  mutations = (mutations == NSUIntegerMax) ? 1UL : mutations + 1UL;\n}\n\n- (void)removeObjectForKey:(id)aKey\n{\n  if(mutations == 0UL)  { [NSException raise:NSInternalInconsistencyException format:@\"*** -[%@ %@]: mutating method sent to immutable object\", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }\n  if(aKey      == NULL) { [NSException raise:NSInvalidArgumentException       format:@\"*** -[%@ %@]: attempt to remove nil key\",                NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; }\n  JKHashTableEntry *entryForKey = _JKDictionaryHashTableEntryForKey(self, aKey);\n  if(entryForKey != NULL) {\n    _JKDictionaryRemoveObjectWithEntry(self, entryForKey);\n    mutations = (mutations == NSUIntegerMax) ? 1UL : mutations + 1UL;\n  }\n}\n\n- (id)copyWithZone:(NSZone *)zone\n{\n  NSParameterAssert((entry != NULL) && (count <= capacity));\n  return((mutations == 0UL) ? [self retain] : [[NSDictionary allocWithZone:zone] initWithDictionary:self]);\n}\n\n- (id)mutableCopyWithZone:(NSZone *)zone\n{\n  NSParameterAssert((entry != NULL) && (count <= capacity));\n  return([[NSMutableDictionary allocWithZone:zone] initWithDictionary:self]);\n}\n\n@end\n\n\n\n#pragma mark -\n\nJK_STATIC_INLINE size_t jk_min(size_t a, size_t b) { return((a < b) ? a : b); }\nJK_STATIC_INLINE size_t jk_max(size_t a, size_t b) { return((a > b) ? a : b); }\n\nJK_STATIC_INLINE JKHash calculateHash(JKHash currentHash, unsigned char c) { return(((currentHash << 5) + currentHash) + c); }\n\nstatic void jk_error(JKParseState *parseState, NSString *format, ...) {\n  NSCParameterAssert((parseState != NULL) && (format != NULL));\n\n  va_list varArgsList;\n  va_start(varArgsList, format);\n  NSString *formatString = [[[NSString alloc] initWithFormat:format arguments:varArgsList] autorelease];\n  va_end(varArgsList);\n\n#if 0\n  const unsigned char *lineStart      = parseState->stringBuffer.bytes.ptr + parseState->lineStartIndex;\n  const unsigned char *lineEnd        = lineStart;\n  const unsigned char *atCharacterPtr = NULL;\n\n  for(atCharacterPtr = lineStart; atCharacterPtr < JK_END_STRING_PTR(parseState); atCharacterPtr++) { lineEnd = atCharacterPtr; if(jk_parse_is_newline(parseState, atCharacterPtr)) { break; } }\n\n  NSString *lineString = @\"\", *carretString = @\"\";\n  if(lineStart < JK_END_STRING_PTR(parseState)) {\n    lineString   = [[[NSString alloc] initWithBytes:lineStart length:(lineEnd - lineStart) encoding:NSUTF8StringEncoding] autorelease];\n    carretString = [NSString stringWithFormat:@\"%*.*s^\", (int)(parseState->atIndex - parseState->lineStartIndex), (int)(parseState->atIndex - parseState->lineStartIndex), \" \"];\n  }\n#endif\n\n  if(parseState->error == NULL) {\n    parseState->error = [NSError errorWithDomain:@\"JKErrorDomain\" code:-1L userInfo:\n                                   [NSDictionary dictionaryWithObjectsAndKeys:\n                                                                              formatString,                                             NSLocalizedDescriptionKey,\n                                                                              [NSNumber numberWithUnsignedLong:parseState->atIndex],    @\"JKAtIndexKey\",\n                                                                              [NSNumber numberWithUnsignedLong:parseState->lineNumber], @\"JKLineNumberKey\",\n                                                 //lineString,   @\"JKErrorLine0Key\",\n                                                 //carretString, @\"JKErrorLine1Key\",\n                                                                              NULL]];\n  }\n}\n\n#pragma mark -\n#pragma mark Buffer and Object Stack management functions\n\nstatic void jk_managedBuffer_release(JKManagedBuffer *managedBuffer) {\n  if((managedBuffer->flags & JKManagedBufferMustFree)) {\n    if(managedBuffer->bytes.ptr != NULL) { free(managedBuffer->bytes.ptr); managedBuffer->bytes.ptr = NULL; }\n    managedBuffer->flags &= ~JKManagedBufferMustFree;\n  }\n\n  managedBuffer->bytes.ptr     = NULL;\n  managedBuffer->bytes.length  = 0UL;\n  managedBuffer->flags        &= ~JKManagedBufferLocationMask;\n}\n\nstatic void jk_managedBuffer_setToStackBuffer(JKManagedBuffer *managedBuffer, unsigned char *ptr, size_t length) {\n  jk_managedBuffer_release(managedBuffer);\n  managedBuffer->bytes.ptr     = ptr;\n  managedBuffer->bytes.length  = length;\n  managedBuffer->flags         = (managedBuffer->flags & ~JKManagedBufferLocationMask) | JKManagedBufferOnStack;\n}\n\nstatic unsigned char *jk_managedBuffer_resize(JKManagedBuffer *managedBuffer, size_t newSize) {\n  size_t roundedUpNewSize = newSize;\n\n  if(managedBuffer->roundSizeUpToMultipleOf > 0UL) { roundedUpNewSize = newSize + ((managedBuffer->roundSizeUpToMultipleOf - (newSize % managedBuffer->roundSizeUpToMultipleOf)) % managedBuffer->roundSizeUpToMultipleOf); }\n\n  if((roundedUpNewSize != managedBuffer->bytes.length) && (roundedUpNewSize > managedBuffer->bytes.length)) {\n    if((managedBuffer->flags & JKManagedBufferLocationMask) == JKManagedBufferOnStack) {\n      NSCParameterAssert((managedBuffer->flags & JKManagedBufferMustFree) == 0);\n      unsigned char *newBuffer = NULL, *oldBuffer = managedBuffer->bytes.ptr;\n      \n      if((newBuffer = (unsigned char *)malloc(roundedUpNewSize)) == NULL) { return(NULL); }\n      memcpy(newBuffer, oldBuffer, jk_min(managedBuffer->bytes.length, roundedUpNewSize));\n      managedBuffer->flags        = (managedBuffer->flags & ~JKManagedBufferLocationMask) | (JKManagedBufferOnHeap | JKManagedBufferMustFree);\n      managedBuffer->bytes.ptr    = newBuffer;\n      managedBuffer->bytes.length = roundedUpNewSize;\n    } else {\n      NSCParameterAssert(((managedBuffer->flags & JKManagedBufferMustFree) != 0) && ((managedBuffer->flags & JKManagedBufferLocationMask) == JKManagedBufferOnHeap));\n      if((managedBuffer->bytes.ptr = (unsigned char *)reallocf(managedBuffer->bytes.ptr, roundedUpNewSize)) == NULL) { return(NULL); }\n      managedBuffer->bytes.length = roundedUpNewSize;\n    }\n  }\n\n  return(managedBuffer->bytes.ptr);\n}\n\n\n\nstatic void jk_objectStack_release(JKObjectStack *objectStack) {\n  NSCParameterAssert(objectStack != NULL);\n\n  NSCParameterAssert(objectStack->index <= objectStack->count);\n  size_t atIndex = 0UL;\n  for(atIndex = 0UL; atIndex < objectStack->index; atIndex++) {\n    if(objectStack->objects[atIndex] != NULL) { CFRelease(objectStack->objects[atIndex]); objectStack->objects[atIndex] = NULL; }\n    if(objectStack->keys[atIndex]    != NULL) { CFRelease(objectStack->keys[atIndex]);    objectStack->keys[atIndex]    = NULL; }\n  }\n  objectStack->index = 0UL;\n\n  if(objectStack->flags & JKObjectStackMustFree) {\n    NSCParameterAssert((objectStack->flags & JKObjectStackLocationMask) == JKObjectStackOnHeap);\n    if(objectStack->objects  != NULL) { free(objectStack->objects);  objectStack->objects  = NULL; }\n    if(objectStack->keys     != NULL) { free(objectStack->keys);     objectStack->keys     = NULL; }\n    if(objectStack->cfHashes != NULL) { free(objectStack->cfHashes); objectStack->cfHashes = NULL; }\n    objectStack->flags &= ~JKObjectStackMustFree;\n  }\n\n  objectStack->objects  = NULL;\n  objectStack->keys     = NULL;\n  objectStack->cfHashes = NULL;\n\n  objectStack->count    = 0UL;\n  objectStack->flags   &= ~JKObjectStackLocationMask;\n}\n\nstatic void jk_objectStack_setToStackBuffer(JKObjectStack *objectStack, void **objects, void **keys, CFHashCode *cfHashes, size_t count) {\n  NSCParameterAssert((objectStack != NULL) && (objects != NULL) && (keys != NULL) && (cfHashes != NULL) && (count > 0UL));\n  jk_objectStack_release(objectStack);\n  objectStack->objects  = objects;\n  objectStack->keys     = keys;\n  objectStack->cfHashes = cfHashes;\n  objectStack->count    = count;\n  objectStack->flags    = (objectStack->flags & ~JKObjectStackLocationMask) | JKObjectStackOnStack;\n#ifndef NS_BLOCK_ASSERTIONS\n  size_t idx;\n  for(idx = 0UL; idx < objectStack->count; idx++) { objectStack->objects[idx] = NULL; objectStack->keys[idx] = NULL; objectStack->cfHashes[idx] = 0UL; }\n#endif\n}\n\nstatic int jk_objectStack_resize(JKObjectStack *objectStack, size_t newCount) {\n  size_t roundedUpNewCount = newCount;\n  int    returnCode = 0;\n\n  void       **newObjects  = NULL, **newKeys = NULL;\n  CFHashCode  *newCFHashes = NULL;\n\n  if(objectStack->roundSizeUpToMultipleOf > 0UL) { roundedUpNewCount = newCount + ((objectStack->roundSizeUpToMultipleOf - (newCount % objectStack->roundSizeUpToMultipleOf)) % objectStack->roundSizeUpToMultipleOf); }\n\n  if((roundedUpNewCount != objectStack->count) && (roundedUpNewCount > objectStack->count)) {\n    if((objectStack->flags & JKObjectStackLocationMask) == JKObjectStackOnStack) {\n      NSCParameterAssert((objectStack->flags & JKObjectStackMustFree) == 0);\n\n      if((newObjects  = (void **     )calloc(1UL, roundedUpNewCount * sizeof(void *    ))) == NULL) { returnCode = 1; goto errorExit; }\n      memcpy(newObjects, objectStack->objects,   jk_min(objectStack->count, roundedUpNewCount) * sizeof(void *));\n      if((newKeys     = (void **     )calloc(1UL, roundedUpNewCount * sizeof(void *    ))) == NULL) { returnCode = 1; goto errorExit; }\n      memcpy(newKeys,     objectStack->keys,     jk_min(objectStack->count, roundedUpNewCount) * sizeof(void *));\n\n      if((newCFHashes = (CFHashCode *)calloc(1UL, roundedUpNewCount * sizeof(CFHashCode))) == NULL) { returnCode = 1; goto errorExit; }\n      memcpy(newCFHashes, objectStack->cfHashes, jk_min(objectStack->count, roundedUpNewCount) * sizeof(CFHashCode));\n\n      objectStack->flags    = (objectStack->flags & ~JKObjectStackLocationMask) | (JKObjectStackOnHeap | JKObjectStackMustFree);\n      objectStack->objects  = newObjects;  newObjects  = NULL;\n      objectStack->keys     = newKeys;     newKeys     = NULL;\n      objectStack->cfHashes = newCFHashes; newCFHashes = NULL;\n      objectStack->count    = roundedUpNewCount;\n    } else {\n      NSCParameterAssert(((objectStack->flags & JKObjectStackMustFree) != 0) && ((objectStack->flags & JKObjectStackLocationMask) == JKObjectStackOnHeap));\n      if((newObjects  = (void  **    )realloc(objectStack->objects,  roundedUpNewCount * sizeof(void *    ))) != NULL) { objectStack->objects  = newObjects;  newObjects  = NULL; } else { returnCode = 1; goto errorExit; }\n      if((newKeys     = (void  **    )realloc(objectStack->keys,     roundedUpNewCount * sizeof(void *    ))) != NULL) { objectStack->keys     = newKeys;     newKeys     = NULL; } else { returnCode = 1; goto errorExit; }\n      if((newCFHashes = (CFHashCode *)realloc(objectStack->cfHashes, roundedUpNewCount * sizeof(CFHashCode))) != NULL) { objectStack->cfHashes = newCFHashes; newCFHashes = NULL; } else { returnCode = 1; goto errorExit; }\n\n#ifndef NS_BLOCK_ASSERTIONS\n      size_t idx;\n      for(idx = objectStack->count; idx < roundedUpNewCount; idx++) { objectStack->objects[idx] = NULL; objectStack->keys[idx] = NULL; objectStack->cfHashes[idx] = 0UL; }\n#endif\n      objectStack->count = roundedUpNewCount;\n    }\n  }\n\n errorExit:\n  if(newObjects  != NULL) { free(newObjects);  newObjects  = NULL; }\n  if(newKeys     != NULL) { free(newKeys);     newKeys     = NULL; }\n  if(newCFHashes != NULL) { free(newCFHashes); newCFHashes = NULL; }\n\n  return(returnCode);\n}\n\n////////////\n#pragma mark -\n#pragma mark Unicode related functions\n\nJK_STATIC_INLINE ConversionResult isValidCodePoint(UTF32 *u32CodePoint) {\n  ConversionResult result = conversionOK;\n  UTF32            ch     = *u32CodePoint;\n\n  if(JK_EXPECT_F(ch >= UNI_SUR_HIGH_START) && (JK_EXPECT_T(ch <= UNI_SUR_LOW_END)))                                                        { result = sourceIllegal; ch = UNI_REPLACEMENT_CHAR; goto finished; }\n  if(JK_EXPECT_F(ch >= 0xFDD0U) && (JK_EXPECT_F(ch <= 0xFDEFU) || JK_EXPECT_F((ch & 0xFFFEU) == 0xFFFEU)) && JK_EXPECT_T(ch <= 0x10FFFFU)) { result = sourceIllegal; ch = UNI_REPLACEMENT_CHAR; goto finished; }\n  if(JK_EXPECT_F(ch == 0U))                                                                                                                { result = sourceIllegal; ch = UNI_REPLACEMENT_CHAR; goto finished; }\n\n finished:\n  *u32CodePoint = ch;\n  return(result);\n}\n\n\nstatic int isLegalUTF8(const UTF8 *source, size_t length) {\n  const UTF8 *srcptr = source + length;\n  UTF8 a;\n\n  switch(length) {\n    default: return(0); // Everything else falls through when \"true\"...\n    case 4: if(JK_EXPECT_F(((a = (*--srcptr)) < 0x80) || (a > 0xBF))) { return(0); }\n    case 3: if(JK_EXPECT_F(((a = (*--srcptr)) < 0x80) || (a > 0xBF))) { return(0); }\n    case 2: if(JK_EXPECT_F( (a = (*--srcptr)) > 0xBF               )) { return(0); }\n      \n      switch(*source) { // no fall-through in this inner switch\n        case 0xE0: if(JK_EXPECT_F(a < 0xA0)) { return(0); } break;\n        case 0xED: if(JK_EXPECT_F(a > 0x9F)) { return(0); } break;\n        case 0xF0: if(JK_EXPECT_F(a < 0x90)) { return(0); } break;\n        case 0xF4: if(JK_EXPECT_F(a > 0x8F)) { return(0); } break;\n        default:   if(JK_EXPECT_F(a < 0x80)) { return(0); }\n      }\n      \n    case 1: if(JK_EXPECT_F((JK_EXPECT_T(*source < 0xC2)) && JK_EXPECT_F(*source >= 0x80))) { return(0); }\n  }\n\n  if(JK_EXPECT_F(*source > 0xF4)) { return(0); }\n\n  return(1);\n}\n\nstatic ConversionResult ConvertSingleCodePointInUTF8(const UTF8 *sourceStart, const UTF8 *sourceEnd, UTF8 const **nextUTF8, UTF32 *convertedUTF32) {\n  ConversionResult result = conversionOK;\n  const UTF8 *source = sourceStart;\n  UTF32 ch = 0UL;\n\n#if !defined(JK_FAST_TRAILING_BYTES)\n  unsigned short extraBytesToRead = trailingBytesForUTF8[*source];\n#else\n  unsigned short extraBytesToRead = __builtin_clz(((*source)^0xff) << 25);\n#endif\n\n  if(JK_EXPECT_F((source + extraBytesToRead + 1) > sourceEnd) || JK_EXPECT_F(!isLegalUTF8(source, extraBytesToRead + 1))) {\n    source++;\n    while((source < sourceEnd) && (((*source) & 0xc0) == 0x80) && ((source - sourceStart) < (extraBytesToRead + 1))) { source++; } \n    NSCParameterAssert(source <= sourceEnd);\n    result = ((source < sourceEnd) && (((*source) & 0xc0) != 0x80)) ? sourceIllegal : ((sourceStart + extraBytesToRead + 1) > sourceEnd) ? sourceExhausted : sourceIllegal;\n    ch = UNI_REPLACEMENT_CHAR;\n    goto finished;\n  }\n\n  switch(extraBytesToRead) { // The cases all fall through.\n    case 5: ch += *source++; ch <<= 6;\n    case 4: ch += *source++; ch <<= 6;\n    case 3: ch += *source++; ch <<= 6;\n    case 2: ch += *source++; ch <<= 6;\n    case 1: ch += *source++; ch <<= 6;\n    case 0: ch += *source++;\n  }\n  ch -= offsetsFromUTF8[extraBytesToRead];\n\n  result = isValidCodePoint(&ch);\n  \n finished:\n  *nextUTF8       = source;\n  *convertedUTF32 = ch;\n  \n  return(result);\n}\n\n\nstatic ConversionResult ConvertUTF32toUTF8 (UTF32 u32CodePoint, UTF8 **targetStart, UTF8 *targetEnd) {\n  const UTF32       byteMask     = 0xBF, byteMark = 0x80;\n  ConversionResult  result       = conversionOK;\n  UTF8             *target       = *targetStart;\n  UTF32             ch           = u32CodePoint;\n  unsigned short    bytesToWrite = 0;\n\n  result = isValidCodePoint(&ch);\n\n  // Figure out how many bytes the result will require. Turn any illegally large UTF32 things (> Plane 17) into replacement chars.\n       if(ch < (UTF32)0x80)          { bytesToWrite = 1; }\n  else if(ch < (UTF32)0x800)         { bytesToWrite = 2; }\n  else if(ch < (UTF32)0x10000)       { bytesToWrite = 3; }\n  else if(ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; }\n  else {                               bytesToWrite = 3; ch = UNI_REPLACEMENT_CHAR; result = sourceIllegal; }\n        \n  target += bytesToWrite;\n  if (target > targetEnd) { target -= bytesToWrite; result = targetExhausted; goto finished; }\n\n  switch (bytesToWrite) { // note: everything falls through.\n    case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;\n    case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;\n    case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;\n    case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);\n  }\n\n  target += bytesToWrite;\n\n finished:\n  *targetStart = target;\n  return(result);\n}\n\nJK_STATIC_INLINE int jk_string_add_unicodeCodePoint(JKParseState *parseState, uint32_t unicodeCodePoint, size_t *tokenBufferIdx, JKHash *stringHash) {\n  UTF8             *u8s = &parseState->token.tokenBuffer.bytes.ptr[*tokenBufferIdx];\n  ConversionResult  result;\n\n  if((result = ConvertUTF32toUTF8(unicodeCodePoint, &u8s, (parseState->token.tokenBuffer.bytes.ptr + parseState->token.tokenBuffer.bytes.length))) != conversionOK) { if(result == targetExhausted) { return(1); } }\n  size_t utf8len = u8s - &parseState->token.tokenBuffer.bytes.ptr[*tokenBufferIdx], nextIdx = (*tokenBufferIdx) + utf8len;\n  \n  while(*tokenBufferIdx < nextIdx) { *stringHash = calculateHash(*stringHash, parseState->token.tokenBuffer.bytes.ptr[(*tokenBufferIdx)++]); }\n\n  return(0);\n}\n\n////////////\n#pragma mark -\n#pragma mark Decoding / parsing / deserializing functions\n\nstatic int jk_parse_string(JKParseState *parseState) {\n  NSCParameterAssert((parseState != NULL) && (JK_AT_STRING_PTR(parseState) <= JK_END_STRING_PTR(parseState)));\n  const unsigned char *stringStart       = JK_AT_STRING_PTR(parseState) + 1;\n  const unsigned char *endOfBuffer       = JK_END_STRING_PTR(parseState);\n  const unsigned char *atStringCharacter = stringStart;\n  unsigned char       *tokenBuffer       = parseState->token.tokenBuffer.bytes.ptr;\n  size_t               tokenStartIndex   = parseState->atIndex;\n  size_t               tokenBufferIdx    = 0UL;\n\n  int      onlySimpleString        = 1,  stringState     = JSONStringStateStart;\n  uint16_t escapedUnicode1         = 0U, escapedUnicode2 = 0U;\n  uint32_t escapedUnicodeCodePoint = 0U;\n  JKHash   stringHash              = JK_HASH_INIT;\n    \n  while(1) {\n    unsigned long currentChar;\n\n    if(JK_EXPECT_F(atStringCharacter == endOfBuffer)) { /* XXX Add error message */ stringState = JSONStringStateError; goto finishedParsing; }\n    \n    if(JK_EXPECT_F((currentChar = *atStringCharacter++) >= 0x80UL)) {\n      const unsigned char *nextValidCharacter = NULL;\n      UTF32                u32ch              = 0U;\n      ConversionResult     result;\n\n      if(JK_EXPECT_F((result = ConvertSingleCodePointInUTF8(atStringCharacter - 1, endOfBuffer, (UTF8 const **)&nextValidCharacter, &u32ch)) != conversionOK)) { goto switchToSlowPath; }\n      stringHash = calculateHash(stringHash, currentChar);\n      while(atStringCharacter < nextValidCharacter) { NSCParameterAssert(JK_AT_STRING_PTR(parseState) <= JK_END_STRING_PTR(parseState)); stringHash = calculateHash(stringHash, *atStringCharacter++); }\n      continue;\n    } else {\n      if(JK_EXPECT_F(currentChar == (unsigned long)'\"')) { stringState = JSONStringStateFinished; goto finishedParsing; }\n\n      if(JK_EXPECT_F(currentChar == (unsigned long)'\\\\')) {\n      switchToSlowPath:\n        onlySimpleString = 0;\n        stringState      = JSONStringStateParsing;\n        tokenBufferIdx   = (atStringCharacter - stringStart) - 1L;\n        if(JK_EXPECT_F((tokenBufferIdx + 16UL) > parseState->token.tokenBuffer.bytes.length)) { if((tokenBuffer = jk_managedBuffer_resize(&parseState->token.tokenBuffer, tokenBufferIdx + 1024UL)) == NULL) { jk_error(parseState, @\"Internal error: Unable to resize temporary buffer. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); stringState = JSONStringStateError; goto finishedParsing; } }\n        memcpy(tokenBuffer, stringStart, tokenBufferIdx);\n        goto slowMatch;\n      }\n\n      if(JK_EXPECT_F(currentChar < 0x20UL)) { jk_error(parseState, @\"Invalid character < 0x20 found in string: 0x%2.2x.\", currentChar); stringState = JSONStringStateError; goto finishedParsing; }\n\n      stringHash = calculateHash(stringHash, currentChar);\n    }\n  }\n\n slowMatch:\n\n  for(atStringCharacter = (stringStart + ((atStringCharacter - stringStart) - 1L)); (atStringCharacter < endOfBuffer) && (tokenBufferIdx < parseState->token.tokenBuffer.bytes.length); atStringCharacter++) {\n    if((tokenBufferIdx + 16UL) > parseState->token.tokenBuffer.bytes.length) { if((tokenBuffer = jk_managedBuffer_resize(&parseState->token.tokenBuffer, tokenBufferIdx + 1024UL)) == NULL) { jk_error(parseState, @\"Internal error: Unable to resize temporary buffer. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); stringState = JSONStringStateError; goto finishedParsing; } }\n\n    NSCParameterAssert(tokenBufferIdx < parseState->token.tokenBuffer.bytes.length);\n\n    unsigned long currentChar = (*atStringCharacter), escapedChar;\n\n    if(JK_EXPECT_T(stringState == JSONStringStateParsing)) {\n      if(JK_EXPECT_T(currentChar >= 0x20UL)) {\n        if(JK_EXPECT_T(currentChar < (unsigned long)0x80)) { // Not a UTF8 sequence\n          if(JK_EXPECT_F(currentChar == (unsigned long)'\"'))  { stringState = JSONStringStateFinished; atStringCharacter++; goto finishedParsing; }\n          if(JK_EXPECT_F(currentChar == (unsigned long)'\\\\')) { stringState = JSONStringStateEscape; continue; }\n          stringHash = calculateHash(stringHash, currentChar);\n          tokenBuffer[tokenBufferIdx++] = currentChar;\n          continue;\n        } else { // UTF8 sequence\n          const unsigned char *nextValidCharacter = NULL;\n          UTF32                u32ch              = 0U;\n          ConversionResult     result;\n          \n          if(JK_EXPECT_F((result = ConvertSingleCodePointInUTF8(atStringCharacter, endOfBuffer, (UTF8 const **)&nextValidCharacter, &u32ch)) != conversionOK)) {\n            if((result == sourceIllegal) && ((parseState->parseOptionFlags & JKParseOptionLooseUnicode) == 0)) { jk_error(parseState, @\"Illegal UTF8 sequence found in \\\"\\\" string.\");              stringState = JSONStringStateError; goto finishedParsing; }\n            if(result == sourceExhausted)                                                                      { jk_error(parseState, @\"End of buffer reached while parsing UTF8 in \\\"\\\" string.\"); stringState = JSONStringStateError; goto finishedParsing; }\n            if(jk_string_add_unicodeCodePoint(parseState, u32ch, &tokenBufferIdx, &stringHash))                { jk_error(parseState, @\"Internal error: Unable to add UTF8 sequence to internal string buffer. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); stringState = JSONStringStateError; goto finishedParsing; }\n            atStringCharacter = nextValidCharacter - 1;\n            continue;\n          } else {\n            while(atStringCharacter < nextValidCharacter) { tokenBuffer[tokenBufferIdx++] = *atStringCharacter; stringHash = calculateHash(stringHash, *atStringCharacter++); }\n            atStringCharacter--;\n            continue;\n          }\n        }\n      } else { // currentChar < 0x20\n        jk_error(parseState, @\"Invalid character < 0x20 found in string: 0x%2.2x.\", currentChar); stringState = JSONStringStateError; goto finishedParsing;\n      }\n\n    } else { // stringState != JSONStringStateParsing\n      int isSurrogate = 1;\n\n      switch(stringState) {\n        case JSONStringStateEscape:\n          switch(currentChar) {\n            case 'u': escapedUnicode1 = 0U; escapedUnicode2 = 0U; escapedUnicodeCodePoint = 0U; stringState = JSONStringStateEscapedUnicode1; break;\n\n            case 'b':  escapedChar = '\\b'; goto parsedEscapedChar;\n            case 'f':  escapedChar = '\\f'; goto parsedEscapedChar;\n            case 'n':  escapedChar = '\\n'; goto parsedEscapedChar;\n            case 'r':  escapedChar = '\\r'; goto parsedEscapedChar;\n            case 't':  escapedChar = '\\t'; goto parsedEscapedChar;\n            case '\\\\': escapedChar = '\\\\'; goto parsedEscapedChar;\n            case '/':  escapedChar = '/';  goto parsedEscapedChar;\n            case '\"':  escapedChar = '\"';  goto parsedEscapedChar;\n              \n            parsedEscapedChar:\n              stringState = JSONStringStateParsing;\n              stringHash  = calculateHash(stringHash, escapedChar);\n              tokenBuffer[tokenBufferIdx++] = escapedChar;\n              break;\n              \n            default: jk_error(parseState, @\"Invalid escape sequence found in \\\"\\\" string.\"); stringState = JSONStringStateError; goto finishedParsing; break;\n          }\n          break;\n\n        case JSONStringStateEscapedUnicode1:\n        case JSONStringStateEscapedUnicode2:\n        case JSONStringStateEscapedUnicode3:\n        case JSONStringStateEscapedUnicode4:           isSurrogate = 0;\n        case JSONStringStateEscapedUnicodeSurrogate1:\n        case JSONStringStateEscapedUnicodeSurrogate2:\n        case JSONStringStateEscapedUnicodeSurrogate3:\n        case JSONStringStateEscapedUnicodeSurrogate4:\n          {\n            uint16_t hexValue = 0U;\n\n            switch(currentChar) {\n              case '0' ... '9': hexValue =  currentChar - '0';        goto parsedHex;\n              case 'a' ... 'f': hexValue = (currentChar - 'a') + 10U; goto parsedHex;\n              case 'A' ... 'F': hexValue = (currentChar - 'A') + 10U; goto parsedHex;\n                \n              parsedHex:\n              if(!isSurrogate) { escapedUnicode1 = (escapedUnicode1 << 4) | hexValue; } else { escapedUnicode2 = (escapedUnicode2 << 4) | hexValue; }\n                \n              if(stringState == JSONStringStateEscapedUnicode4) {\n                if(((escapedUnicode1 >= 0xD800U) && (escapedUnicode1 < 0xE000U))) {\n                  if((escapedUnicode1 >= 0xD800U) && (escapedUnicode1 < 0xDC00U)) { stringState = JSONStringStateEscapedNeedEscapeForSurrogate; }\n                  else if((escapedUnicode1 >= 0xDC00U) && (escapedUnicode1 < 0xE000U)) { \n                    if((parseState->parseOptionFlags & JKParseOptionLooseUnicode)) { escapedUnicodeCodePoint = UNI_REPLACEMENT_CHAR; }\n                    else { jk_error(parseState, @\"Illegal \\\\u Unicode escape sequence.\"); stringState = JSONStringStateError; goto finishedParsing; }\n                  }\n                }\n                else { escapedUnicodeCodePoint = escapedUnicode1; }\n              }\n\n              if(stringState == JSONStringStateEscapedUnicodeSurrogate4) {\n                if((escapedUnicode2 < 0xdc00) || (escapedUnicode2 > 0xdfff)) {\n                  if((parseState->parseOptionFlags & JKParseOptionLooseUnicode)) { escapedUnicodeCodePoint = UNI_REPLACEMENT_CHAR; }\n                  else { jk_error(parseState, @\"Illegal \\\\u Unicode escape sequence.\"); stringState = JSONStringStateError; goto finishedParsing; }\n                }\n                else { escapedUnicodeCodePoint = ((escapedUnicode1 - 0xd800) * 0x400) + (escapedUnicode2 - 0xdc00) + 0x10000; }\n              }\n                \n              if((stringState == JSONStringStateEscapedUnicode4) || (stringState == JSONStringStateEscapedUnicodeSurrogate4)) { \n                if((isValidCodePoint(&escapedUnicodeCodePoint) == sourceIllegal) && ((parseState->parseOptionFlags & JKParseOptionLooseUnicode) == 0)) { jk_error(parseState, @\"Illegal \\\\u Unicode escape sequence.\"); stringState = JSONStringStateError; goto finishedParsing; }\n                stringState = JSONStringStateParsing;\n                if(jk_string_add_unicodeCodePoint(parseState, escapedUnicodeCodePoint, &tokenBufferIdx, &stringHash)) { jk_error(parseState, @\"Internal error: Unable to add UTF8 sequence to internal string buffer. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); stringState = JSONStringStateError; goto finishedParsing; }\n              }\n              else if((stringState >= JSONStringStateEscapedUnicode1) && (stringState <= JSONStringStateEscapedUnicodeSurrogate4)) { stringState++; }\n              break;\n\n              default: jk_error(parseState, @\"Unexpected character found in \\\\u Unicode escape sequence.  Found '%c', expected [0-9a-fA-F].\", currentChar); stringState = JSONStringStateError; goto finishedParsing; break;\n            }\n          }\n          break;\n\n        case JSONStringStateEscapedNeedEscapeForSurrogate:\n          if(currentChar == '\\\\') { stringState = JSONStringStateEscapedNeedEscapedUForSurrogate; }\n          else { \n            if((parseState->parseOptionFlags & JKParseOptionLooseUnicode) == 0) { jk_error(parseState, @\"Required a second \\\\u Unicode escape sequence following a surrogate \\\\u Unicode escape sequence.\"); stringState = JSONStringStateError; goto finishedParsing; }\n            else { stringState = JSONStringStateParsing; atStringCharacter--;    if(jk_string_add_unicodeCodePoint(parseState, UNI_REPLACEMENT_CHAR, &tokenBufferIdx, &stringHash)) { jk_error(parseState, @\"Internal error: Unable to add UTF8 sequence to internal string buffer. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); stringState = JSONStringStateError; goto finishedParsing; } }\n          }\n          break;\n\n        case JSONStringStateEscapedNeedEscapedUForSurrogate:\n          if(currentChar == 'u') { stringState = JSONStringStateEscapedUnicodeSurrogate1; }\n          else { \n            if((parseState->parseOptionFlags & JKParseOptionLooseUnicode) == 0) { jk_error(parseState, @\"Required a second \\\\u Unicode escape sequence following a surrogate \\\\u Unicode escape sequence.\"); stringState = JSONStringStateError; goto finishedParsing; }\n            else { stringState = JSONStringStateParsing; atStringCharacter -= 2; if(jk_string_add_unicodeCodePoint(parseState, UNI_REPLACEMENT_CHAR, &tokenBufferIdx, &stringHash)) { jk_error(parseState, @\"Internal error: Unable to add UTF8 sequence to internal string buffer. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); stringState = JSONStringStateError; goto finishedParsing; } }\n          }\n          break;\n\n        default: jk_error(parseState, @\"Internal error: Unknown stringState. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); stringState = JSONStringStateError; goto finishedParsing; break;\n      }\n    }\n  }\n\nfinishedParsing:\n\n  if(JK_EXPECT_T(stringState == JSONStringStateFinished)) {\n    NSCParameterAssert((parseState->stringBuffer.bytes.ptr + tokenStartIndex) < atStringCharacter);\n\n    parseState->token.tokenPtrRange.ptr    = parseState->stringBuffer.bytes.ptr + tokenStartIndex;\n    parseState->token.tokenPtrRange.length = (atStringCharacter - parseState->token.tokenPtrRange.ptr);\n\n    if(JK_EXPECT_T(onlySimpleString)) {\n      NSCParameterAssert(((parseState->token.tokenPtrRange.ptr + 1) < endOfBuffer) && (parseState->token.tokenPtrRange.length >= 2UL) && (((parseState->token.tokenPtrRange.ptr + 1) + (parseState->token.tokenPtrRange.length - 2)) < endOfBuffer));\n      parseState->token.value.ptrRange.ptr    = parseState->token.tokenPtrRange.ptr    + 1;\n      parseState->token.value.ptrRange.length = parseState->token.tokenPtrRange.length - 2UL;\n    } else {\n      parseState->token.value.ptrRange.ptr    = parseState->token.tokenBuffer.bytes.ptr;\n      parseState->token.value.ptrRange.length = tokenBufferIdx;\n    }\n    \n    parseState->token.value.hash = stringHash;\n    parseState->token.value.type = JKValueTypeString;\n    parseState->atIndex          = (atStringCharacter - parseState->stringBuffer.bytes.ptr);\n  }\n\n  if(JK_EXPECT_F(stringState != JSONStringStateFinished)) { jk_error(parseState, @\"Invalid string.\"); }\n  return(JK_EXPECT_T(stringState == JSONStringStateFinished) ? 0 : 1);\n}\n\nstatic int jk_parse_number(JKParseState *parseState) {\n  NSCParameterAssert((parseState != NULL) && (JK_AT_STRING_PTR(parseState) <= JK_END_STRING_PTR(parseState)));\n  const unsigned char *numberStart       = JK_AT_STRING_PTR(parseState);\n  const unsigned char *endOfBuffer       = JK_END_STRING_PTR(parseState);\n  const unsigned char *atNumberCharacter = NULL;\n  int                  numberState       = JSONNumberStateWholeNumberStart, isFloatingPoint = 0, isNegative = 0, backup = 0;\n  size_t               startingIndex     = parseState->atIndex;\n  \n  for(atNumberCharacter = numberStart; (JK_EXPECT_T(atNumberCharacter < endOfBuffer)) && (JK_EXPECT_T(!(JK_EXPECT_F(numberState == JSONNumberStateFinished) || JK_EXPECT_F(numberState == JSONNumberStateError)))); atNumberCharacter++) {\n    unsigned long currentChar = (unsigned long)(*atNumberCharacter), lowerCaseCC = currentChar | 0x20UL;\n    \n    switch(numberState) {\n      case JSONNumberStateWholeNumberStart: if   (currentChar == '-')                                                                              { numberState = JSONNumberStateWholeNumberMinus;      isNegative      = 1; break; }\n      case JSONNumberStateWholeNumberMinus: if   (currentChar == '0')                                                                              { numberState = JSONNumberStateWholeNumberZero;                            break; }\n                                       else if(  (currentChar >= '1') && (currentChar <= '9'))                                                     { numberState = JSONNumberStateWholeNumber;                                break; }\n                                       else                                                     { /* XXX Add error message */                        numberState = JSONNumberStateError;                                      break; }\n      case JSONNumberStateExponentStart:    if(  (currentChar == '+') || (currentChar == '-'))                                                     { numberState = JSONNumberStateExponentPlusMinus;                          break; }\n      case JSONNumberStateFractionalNumberStart:\n      case JSONNumberStateExponentPlusMinus:if(!((currentChar >= '0') && (currentChar <= '9'))) { /* XXX Add error message */                        numberState = JSONNumberStateError;                                      break; }\n                                       else {                                              if(numberState == JSONNumberStateFractionalNumberStart) { numberState = JSONNumberStateFractionalNumber; }\n                                                                                           else                                                    { numberState = JSONNumberStateExponent;         }                         break; }\n      case JSONNumberStateWholeNumberZero:\n      case JSONNumberStateWholeNumber:      if   (currentChar == '.')                                                                              { numberState = JSONNumberStateFractionalNumberStart; isFloatingPoint = 1; break; }\n      case JSONNumberStateFractionalNumber: if   (lowerCaseCC == 'e')                                                                              { numberState = JSONNumberStateExponentStart;         isFloatingPoint = 1; break; }\n      case JSONNumberStateExponent:         if(!((currentChar >= '0') && (currentChar <= '9')) || (numberState == JSONNumberStateWholeNumberZero)) { numberState = JSONNumberStateFinished;              backup          = 1; break; }\n        break;\n      default:                                                                                    /* XXX Add error message */                        numberState = JSONNumberStateError;                                      break;\n    }\n  }\n  \n  parseState->token.tokenPtrRange.ptr    = parseState->stringBuffer.bytes.ptr + startingIndex;\n  parseState->token.tokenPtrRange.length = (atNumberCharacter - parseState->token.tokenPtrRange.ptr) - backup;\n  parseState->atIndex                    = (parseState->token.tokenPtrRange.ptr + parseState->token.tokenPtrRange.length) - parseState->stringBuffer.bytes.ptr;\n\n  if(JK_EXPECT_T(numberState == JSONNumberStateFinished)) {\n    unsigned char  numberTempBuf[parseState->token.tokenPtrRange.length + 4UL];\n    unsigned char *endOfNumber = NULL;\n\n    memcpy(numberTempBuf, parseState->token.tokenPtrRange.ptr, parseState->token.tokenPtrRange.length);\n    numberTempBuf[parseState->token.tokenPtrRange.length] = 0;\n\n    errno = 0;\n    \n    // Treat \"-0\" as a floating point number, which is capable of representing negative zeros.\n    if(JK_EXPECT_F(parseState->token.tokenPtrRange.length == 2UL) && JK_EXPECT_F(numberTempBuf[1] == '0') && JK_EXPECT_F(isNegative)) { isFloatingPoint = 1; }\n\n    if(isFloatingPoint) {\n      parseState->token.value.number.doubleValue = strtod((const char *)numberTempBuf, (char **)&endOfNumber); // strtod is documented to return U+2261 (identical to) 0.0 on an underflow error (along with setting errno to ERANGE).\n      parseState->token.value.type               = JKValueTypeDouble;\n      parseState->token.value.ptrRange.ptr       = (const unsigned char *)&parseState->token.value.number.doubleValue;\n      parseState->token.value.ptrRange.length    = sizeof(double);\n      parseState->token.value.hash               = (JK_HASH_INIT + parseState->token.value.type);\n    } else {\n      if(isNegative) {\n        parseState->token.value.number.longLongValue = strtoll((const char *)numberTempBuf, (char **)&endOfNumber, 10);\n        parseState->token.value.type                 = JKValueTypeLongLong;\n        parseState->token.value.ptrRange.ptr         = (const unsigned char *)&parseState->token.value.number.longLongValue;\n        parseState->token.value.ptrRange.length      = sizeof(long long);\n        parseState->token.value.hash                 = (JK_HASH_INIT + parseState->token.value.type) + (JKHash)parseState->token.value.number.longLongValue;\n      } else {\n        parseState->token.value.number.unsignedLongLongValue = strtoull((const char *)numberTempBuf, (char **)&endOfNumber, 10);\n        parseState->token.value.type                         = JKValueTypeUnsignedLongLong;\n        parseState->token.value.ptrRange.ptr                 = (const unsigned char *)&parseState->token.value.number.unsignedLongLongValue;\n        parseState->token.value.ptrRange.length              = sizeof(unsigned long long);\n        parseState->token.value.hash                         = (JK_HASH_INIT + parseState->token.value.type) + (JKHash)parseState->token.value.number.unsignedLongLongValue;\n      }\n    }\n\n    if(JK_EXPECT_F(errno != 0)) {\n      numberState = JSONNumberStateError;\n      if(errno == ERANGE) {\n        switch(parseState->token.value.type) {\n          case JKValueTypeDouble:           jk_error(parseState, @\"The value '%s' could not be represented as a 'double' due to %s.\",           numberTempBuf, (parseState->token.value.number.doubleValue == 0.0) ? \"underflow\" : \"overflow\"); break; // see above for == 0.0.\n          case JKValueTypeLongLong:         jk_error(parseState, @\"The value '%s' exceeded the minimum value that could be represented: %lld.\", numberTempBuf, parseState->token.value.number.longLongValue);                                   break;\n          case JKValueTypeUnsignedLongLong: jk_error(parseState, @\"The value '%s' exceeded the maximum value that could be represented: %llu.\", numberTempBuf, parseState->token.value.number.unsignedLongLongValue);                           break;\n          default:                          jk_error(parseState, @\"Internal error: Unknown token value type. %@ line #%ld\",                     [NSString stringWithUTF8String:__FILE__], (long)__LINE__);                                      break;\n        }\n      }\n    }\n    if(JK_EXPECT_F(endOfNumber != &numberTempBuf[parseState->token.tokenPtrRange.length]) && JK_EXPECT_F(numberState != JSONNumberStateError)) { numberState = JSONNumberStateError; jk_error(parseState, @\"The conversion function did not consume all of the number tokens characters.\"); }\n\n    size_t hashIndex = 0UL;\n    for(hashIndex = 0UL; hashIndex < parseState->token.value.ptrRange.length; hashIndex++) { parseState->token.value.hash = calculateHash(parseState->token.value.hash, parseState->token.value.ptrRange.ptr[hashIndex]); }\n  }\n\n  if(JK_EXPECT_F(numberState != JSONNumberStateFinished)) { jk_error(parseState, @\"Invalid number.\"); }\n  return(JK_EXPECT_T((numberState == JSONNumberStateFinished)) ? 0 : 1);\n}\n\nJK_STATIC_INLINE void jk_set_parsed_token(JKParseState *parseState, const unsigned char *ptr, size_t length, JKTokenType type, size_t advanceBy) {\n  parseState->token.tokenPtrRange.ptr     = ptr;\n  parseState->token.tokenPtrRange.length  = length;\n  parseState->token.type                  = type;\n  parseState->atIndex                    += advanceBy;\n}\n\nstatic size_t jk_parse_is_newline(JKParseState *parseState, const unsigned char *atCharacterPtr) {\n  NSCParameterAssert((parseState != NULL) && (atCharacterPtr != NULL) && (atCharacterPtr >= parseState->stringBuffer.bytes.ptr) && (atCharacterPtr < JK_END_STRING_PTR(parseState)));\n  const unsigned char *endOfStringPtr = JK_END_STRING_PTR(parseState);\n\n  if(JK_EXPECT_F(atCharacterPtr >= endOfStringPtr)) { return(0UL); }\n\n  if(JK_EXPECT_F((*(atCharacterPtr + 0)) == '\\n')) { return(1UL); }\n  if(JK_EXPECT_F((*(atCharacterPtr + 0)) == '\\r')) { if((JK_EXPECT_T((atCharacterPtr + 1) < endOfStringPtr)) && ((*(atCharacterPtr + 1)) == '\\n')) { return(2UL); } return(1UL); }\n  if(parseState->parseOptionFlags & JKParseOptionUnicodeNewlines) {\n    if((JK_EXPECT_F((*(atCharacterPtr + 0)) == 0xc2)) && (((atCharacterPtr + 1) < endOfStringPtr) && ((*(atCharacterPtr + 1)) == 0x85))) { return(2UL); }\n    if((JK_EXPECT_F((*(atCharacterPtr + 0)) == 0xe2)) && (((atCharacterPtr + 2) < endOfStringPtr) && ((*(atCharacterPtr + 1)) == 0x80) && (((*(atCharacterPtr + 2)) == 0xa8) || ((*(atCharacterPtr + 2)) == 0xa9)))) { return(3UL); }\n  }\n\n  return(0UL);\n}\n\nJK_STATIC_INLINE int jk_parse_skip_newline(JKParseState *parseState) {\n  size_t newlineAdvanceAtIndex = 0UL;\n  if(JK_EXPECT_F((newlineAdvanceAtIndex = jk_parse_is_newline(parseState, JK_AT_STRING_PTR(parseState))) > 0UL)) { parseState->lineNumber++; parseState->atIndex += (newlineAdvanceAtIndex - 1UL); parseState->lineStartIndex = parseState->atIndex + 1UL; return(1); }\n  return(0);\n}\n\nJK_STATIC_INLINE void jk_parse_skip_whitespace(JKParseState *parseState) {\n#ifndef __clang_analyzer__\n  NSCParameterAssert((parseState != NULL) && (JK_AT_STRING_PTR(parseState) <= JK_END_STRING_PTR(parseState)));\n  const unsigned char *atCharacterPtr   = NULL;\n  const unsigned char *endOfStringPtr   = JK_END_STRING_PTR(parseState);\n\n  for(atCharacterPtr = JK_AT_STRING_PTR(parseState); (JK_EXPECT_T((atCharacterPtr = JK_AT_STRING_PTR(parseState)) < endOfStringPtr)); parseState->atIndex++) {\n    if(((*(atCharacterPtr + 0)) == ' ') || ((*(atCharacterPtr + 0)) == '\\t')) { continue; }\n    if(jk_parse_skip_newline(parseState)) { continue; }\n    if(parseState->parseOptionFlags & JKParseOptionComments) {\n      if((JK_EXPECT_F((*(atCharacterPtr + 0)) == '/')) && (JK_EXPECT_T((atCharacterPtr + 1) < endOfStringPtr))) {\n        if((*(atCharacterPtr + 1)) == '/') {\n          parseState->atIndex++;\n          for(atCharacterPtr = JK_AT_STRING_PTR(parseState); (JK_EXPECT_T((atCharacterPtr = JK_AT_STRING_PTR(parseState)) < endOfStringPtr)); parseState->atIndex++) { if(jk_parse_skip_newline(parseState)) { break; } }\n          continue;\n        }\n        if((*(atCharacterPtr + 1)) == '*') {\n          parseState->atIndex++;\n          for(atCharacterPtr = JK_AT_STRING_PTR(parseState); (JK_EXPECT_T((atCharacterPtr = JK_AT_STRING_PTR(parseState)) < endOfStringPtr)); parseState->atIndex++) {\n            if(jk_parse_skip_newline(parseState)) { continue; }\n            if(((*(atCharacterPtr + 0)) == '*') && (((atCharacterPtr + 1) < endOfStringPtr) && ((*(atCharacterPtr + 1)) == '/'))) { parseState->atIndex++; break; }\n          }\n          continue;\n        }\n      }\n    }\n    break;\n  }\n#endif\n}\n\nstatic int jk_parse_next_token(JKParseState *parseState) {\n  NSCParameterAssert((parseState != NULL) && (JK_AT_STRING_PTR(parseState) <= JK_END_STRING_PTR(parseState)));\n  const unsigned char *atCharacterPtr   = NULL;\n  const unsigned char *endOfStringPtr   = JK_END_STRING_PTR(parseState);\n  unsigned char        currentCharacter = 0U;\n  int                  stopParsing      = 0;\n\n  parseState->prev_atIndex        = parseState->atIndex;\n  parseState->prev_lineNumber     = parseState->lineNumber;\n  parseState->prev_lineStartIndex = parseState->lineStartIndex;\n\n  jk_parse_skip_whitespace(parseState);\n\n  if((JK_AT_STRING_PTR(parseState) == endOfStringPtr)) { stopParsing = 1; }\n\n  if((JK_EXPECT_T(stopParsing == 0)) && (JK_EXPECT_T((atCharacterPtr = JK_AT_STRING_PTR(parseState)) < endOfStringPtr))) {\n    currentCharacter = *atCharacterPtr;\n\n         if(JK_EXPECT_T(currentCharacter == '\"')) { if(JK_EXPECT_T((stopParsing = jk_parse_string(parseState)) == 0)) { jk_set_parsed_token(parseState, parseState->token.tokenPtrRange.ptr, parseState->token.tokenPtrRange.length, JKTokenTypeString, 0UL); } }\n    else if(JK_EXPECT_T(currentCharacter == ':')) { jk_set_parsed_token(parseState, atCharacterPtr, 1UL, JKTokenTypeSeparator,   1UL); }\n    else if(JK_EXPECT_T(currentCharacter == ',')) { jk_set_parsed_token(parseState, atCharacterPtr, 1UL, JKTokenTypeComma,       1UL); }\n    else if((JK_EXPECT_T(currentCharacter >= '0') && JK_EXPECT_T(currentCharacter <= '9')) || JK_EXPECT_T(currentCharacter == '-')) { if(JK_EXPECT_T((stopParsing = jk_parse_number(parseState)) == 0)) { jk_set_parsed_token(parseState, parseState->token.tokenPtrRange.ptr, parseState->token.tokenPtrRange.length, JKTokenTypeNumber, 0UL); } }\n    else if(JK_EXPECT_T(currentCharacter == '{')) { jk_set_parsed_token(parseState, atCharacterPtr, 1UL, JKTokenTypeObjectBegin, 1UL); }\n    else if(JK_EXPECT_T(currentCharacter == '}')) { jk_set_parsed_token(parseState, atCharacterPtr, 1UL, JKTokenTypeObjectEnd,   1UL); }\n    else if(JK_EXPECT_T(currentCharacter == '[')) { jk_set_parsed_token(parseState, atCharacterPtr, 1UL, JKTokenTypeArrayBegin,  1UL); }\n    else if(JK_EXPECT_T(currentCharacter == ']')) { jk_set_parsed_token(parseState, atCharacterPtr, 1UL, JKTokenTypeArrayEnd,    1UL); }\n    \n    else if(JK_EXPECT_T(currentCharacter == 't')) { if(!((JK_EXPECT_T((atCharacterPtr + 4UL) < endOfStringPtr)) && (JK_EXPECT_T(atCharacterPtr[1] == 'r')) && (JK_EXPECT_T(atCharacterPtr[2] == 'u')) && (JK_EXPECT_T(atCharacterPtr[3] == 'e'))))                                            { stopParsing = 1; /* XXX Add error message */ } else { jk_set_parsed_token(parseState, atCharacterPtr, 4UL, JKTokenTypeTrue,  4UL); } }\n    else if(JK_EXPECT_T(currentCharacter == 'f')) { if(!((JK_EXPECT_T((atCharacterPtr + 5UL) < endOfStringPtr)) && (JK_EXPECT_T(atCharacterPtr[1] == 'a')) && (JK_EXPECT_T(atCharacterPtr[2] == 'l')) && (JK_EXPECT_T(atCharacterPtr[3] == 's')) && (JK_EXPECT_T(atCharacterPtr[4] == 'e')))) { stopParsing = 1; /* XXX Add error message */ } else { jk_set_parsed_token(parseState, atCharacterPtr, 5UL, JKTokenTypeFalse, 5UL); } }\n    else if(JK_EXPECT_T(currentCharacter == 'n')) { if(!((JK_EXPECT_T((atCharacterPtr + 4UL) < endOfStringPtr)) && (JK_EXPECT_T(atCharacterPtr[1] == 'u')) && (JK_EXPECT_T(atCharacterPtr[2] == 'l')) && (JK_EXPECT_T(atCharacterPtr[3] == 'l'))))                                            { stopParsing = 1; /* XXX Add error message */ } else { jk_set_parsed_token(parseState, atCharacterPtr, 4UL, JKTokenTypeNull,  4UL); } }\n    else { stopParsing = 1; /* XXX Add error message */ }    \n  }\n\n  if(JK_EXPECT_F(stopParsing)) { jk_error(parseState, @\"Unexpected token, wanted '{', '}', '[', ']', ',', ':', 'true', 'false', 'null', '\\\"STRING\\\"', 'NUMBER'.\"); }\n  return(stopParsing);\n}\n\nstatic void jk_error_parse_accept_or3(JKParseState *parseState, int state, NSString *or1String, NSString *or2String, NSString *or3String) {\n  NSString *acceptStrings[16];\n  int acceptIdx = 0;\n  if(state & JKParseAcceptValue) { acceptStrings[acceptIdx++] = or1String; }\n  if(state & JKParseAcceptComma) { acceptStrings[acceptIdx++] = or2String; }\n  if(state & JKParseAcceptEnd)   { acceptStrings[acceptIdx++] = or3String; }\n       if(acceptIdx == 1) { jk_error(parseState, @\"Expected %@, not '%*.*s'\",           acceptStrings[0],                                     (int)parseState->token.tokenPtrRange.length, (int)parseState->token.tokenPtrRange.length, parseState->token.tokenPtrRange.ptr); }\n  else if(acceptIdx == 2) { jk_error(parseState, @\"Expected %@ or %@, not '%*.*s'\",     acceptStrings[0], acceptStrings[1],                   (int)parseState->token.tokenPtrRange.length, (int)parseState->token.tokenPtrRange.length, parseState->token.tokenPtrRange.ptr); }\n  else if(acceptIdx == 3) { jk_error(parseState, @\"Expected %@, %@, or %@, not '%*.*s\", acceptStrings[0], acceptStrings[1], acceptStrings[2], (int)parseState->token.tokenPtrRange.length, (int)parseState->token.tokenPtrRange.length, parseState->token.tokenPtrRange.ptr); }\n}\n\nstatic void *jk_parse_array(JKParseState *parseState) {\n  size_t  startingObjectIndex = parseState->objectStack.index;\n  int     arrayState          = JKParseAcceptValueOrEnd, stopParsing = 0;\n  void   *parsedArray         = NULL;\n\n  while(JK_EXPECT_T((JK_EXPECT_T(stopParsing == 0)) && (JK_EXPECT_T(parseState->atIndex < parseState->stringBuffer.bytes.length)))) {\n    if(JK_EXPECT_F(parseState->objectStack.index > (parseState->objectStack.count - 4UL))) { if(jk_objectStack_resize(&parseState->objectStack, parseState->objectStack.count + 128UL)) { jk_error(parseState, @\"Internal error: [array] objectsIndex > %zu, resize failed? %@ line %#ld\", (parseState->objectStack.count - 4UL), [NSString stringWithUTF8String:__FILE__], (long)__LINE__); break; } }\n\n    if(JK_EXPECT_T((stopParsing = jk_parse_next_token(parseState)) == 0)) {\n      void *object = NULL;\n#ifndef NS_BLOCK_ASSERTIONS\n      parseState->objectStack.objects[parseState->objectStack.index] = NULL;\n      parseState->objectStack.keys   [parseState->objectStack.index] = NULL;\n#endif\n      switch(parseState->token.type) {\n        case JKTokenTypeNumber:\n        case JKTokenTypeString:\n        case JKTokenTypeTrue:\n        case JKTokenTypeFalse:\n        case JKTokenTypeNull:\n        case JKTokenTypeArrayBegin:\n        case JKTokenTypeObjectBegin:\n          if(JK_EXPECT_F((arrayState & JKParseAcceptValue)          == 0))    { parseState->errorIsPrev = 1; jk_error(parseState, @\"Unexpected value.\");              stopParsing = 1; break; }\n          if(JK_EXPECT_F((object = jk_object_for_token(parseState)) == NULL)) {                              jk_error(parseState, @\"Internal error: Object == NULL\"); stopParsing = 1; break; } else { parseState->objectStack.objects[parseState->objectStack.index++] = object; arrayState = JKParseAcceptCommaOrEnd; }\n          break;\n        case JKTokenTypeArrayEnd: if(JK_EXPECT_T(arrayState & JKParseAcceptEnd)) { NSCParameterAssert(parseState->objectStack.index >= startingObjectIndex); parsedArray = (void *)_JKArrayCreate((id *)&parseState->objectStack.objects[startingObjectIndex], (parseState->objectStack.index - startingObjectIndex), parseState->mutableCollections); } else { parseState->errorIsPrev = 1; jk_error(parseState, @\"Unexpected ']'.\"); } stopParsing = 1; break;\n        case JKTokenTypeComma:    if(JK_EXPECT_T(arrayState & JKParseAcceptComma)) { arrayState = JKParseAcceptValue; } else { parseState->errorIsPrev = 1; jk_error(parseState, @\"Unexpected ','.\"); stopParsing = 1; } break;\n        default: parseState->errorIsPrev = 1; jk_error_parse_accept_or3(parseState, arrayState, @\"a value\", @\"a comma\", @\"a ']'\"); stopParsing = 1; break;\n      }\n    }\n  }\n\n  if(JK_EXPECT_F(parsedArray == NULL)) { size_t idx = 0UL; for(idx = startingObjectIndex; idx < parseState->objectStack.index; idx++) { if(parseState->objectStack.objects[idx] != NULL) { CFRelease(parseState->objectStack.objects[idx]); parseState->objectStack.objects[idx] = NULL; } } }\n#if !defined(NS_BLOCK_ASSERTIONS)\n  else { size_t idx = 0UL; for(idx = startingObjectIndex; idx < parseState->objectStack.index; idx++) { parseState->objectStack.objects[idx] = NULL; parseState->objectStack.keys[idx] = NULL; } }\n#endif\n  \n  parseState->objectStack.index = startingObjectIndex;\n  return(parsedArray);\n}\n\nstatic void *jk_create_dictionary(JKParseState *parseState, size_t startingObjectIndex) {\n  void *parsedDictionary = NULL;\n\n  parseState->objectStack.index--;\n\n  parsedDictionary = _JKDictionaryCreate((id *)&parseState->objectStack.keys[startingObjectIndex], (NSUInteger *)&parseState->objectStack.cfHashes[startingObjectIndex], (id *)&parseState->objectStack.objects[startingObjectIndex], (parseState->objectStack.index - startingObjectIndex), parseState->mutableCollections);\n\n  return(parsedDictionary);\n}\n\nstatic void *jk_parse_dictionary(JKParseState *parseState) {\n  size_t  startingObjectIndex = parseState->objectStack.index;\n  int     dictState           = JKParseAcceptValueOrEnd, stopParsing = 0;\n  void   *parsedDictionary    = NULL;\n\n  while(JK_EXPECT_T((JK_EXPECT_T(stopParsing == 0)) && (JK_EXPECT_T(parseState->atIndex < parseState->stringBuffer.bytes.length)))) {\n    if(JK_EXPECT_F(parseState->objectStack.index > (parseState->objectStack.count - 4UL))) { if(jk_objectStack_resize(&parseState->objectStack, parseState->objectStack.count + 128UL)) { jk_error(parseState, @\"Internal error: [dictionary] objectsIndex > %zu, resize failed? %@ line #%ld\", (parseState->objectStack.count - 4UL), [NSString stringWithUTF8String:__FILE__], (long)__LINE__); break; } }\n\n    size_t objectStackIndex = parseState->objectStack.index++;\n    parseState->objectStack.keys[objectStackIndex]    = NULL;\n    parseState->objectStack.objects[objectStackIndex] = NULL;\n    void *key = NULL, *object = NULL;\n\n    if(JK_EXPECT_T((JK_EXPECT_T(stopParsing == 0)) && (JK_EXPECT_T((stopParsing = jk_parse_next_token(parseState)) == 0)))) {\n      switch(parseState->token.type) {\n        case JKTokenTypeString:\n          if(JK_EXPECT_F((dictState & JKParseAcceptValue)        == 0))    { parseState->errorIsPrev = 1; jk_error(parseState, @\"Unexpected string.\");           stopParsing = 1; break; }\n          if(JK_EXPECT_F((key = jk_object_for_token(parseState)) == NULL)) {                              jk_error(parseState, @\"Internal error: Key == NULL.\"); stopParsing = 1; break; }\n          else {\n            parseState->objectStack.keys[objectStackIndex] = key;\n            if(JK_EXPECT_T(parseState->token.value.cacheItem != NULL)) { if(JK_EXPECT_F(parseState->token.value.cacheItem->cfHash == 0UL)) { parseState->token.value.cacheItem->cfHash = CFHash(key); } parseState->objectStack.cfHashes[objectStackIndex] = parseState->token.value.cacheItem->cfHash; }\n            else { parseState->objectStack.cfHashes[objectStackIndex] = CFHash(key); }\n          }\n          break;\n\n        case JKTokenTypeObjectEnd: if((JK_EXPECT_T(dictState & JKParseAcceptEnd)))   { NSCParameterAssert(parseState->objectStack.index >= startingObjectIndex); parsedDictionary = jk_create_dictionary(parseState, startingObjectIndex); } else { parseState->errorIsPrev = 1; jk_error(parseState, @\"Unexpected '}'.\"); } stopParsing = 1; break;\n        case JKTokenTypeComma:     if((JK_EXPECT_T(dictState & JKParseAcceptComma))) { dictState = JKParseAcceptValue; parseState->objectStack.index--; continue; } else { parseState->errorIsPrev = 1; jk_error(parseState, @\"Unexpected ','.\"); stopParsing = 1; } break;\n\n        default: parseState->errorIsPrev = 1; jk_error_parse_accept_or3(parseState, dictState, @\"a \\\"STRING\\\"\", @\"a comma\", @\"a '}'\"); stopParsing = 1; break;\n      }\n    }\n\n    if(JK_EXPECT_T(stopParsing == 0)) {\n      if(JK_EXPECT_T((stopParsing = jk_parse_next_token(parseState)) == 0)) { if(JK_EXPECT_F(parseState->token.type != JKTokenTypeSeparator)) { parseState->errorIsPrev = 1; jk_error(parseState, @\"Expected ':'.\"); stopParsing = 1; } }\n    }\n\n    if((JK_EXPECT_T(stopParsing == 0)) && (JK_EXPECT_T((stopParsing = jk_parse_next_token(parseState)) == 0))) {\n      switch(parseState->token.type) {\n        case JKTokenTypeNumber:\n        case JKTokenTypeString:\n        case JKTokenTypeTrue:\n        case JKTokenTypeFalse:\n        case JKTokenTypeNull:\n        case JKTokenTypeArrayBegin:\n        case JKTokenTypeObjectBegin:\n          if(JK_EXPECT_F((dictState & JKParseAcceptValue)           == 0))    { parseState->errorIsPrev = 1; jk_error(parseState, @\"Unexpected value.\");               stopParsing = 1; break; }\n          if(JK_EXPECT_F((object = jk_object_for_token(parseState)) == NULL)) {                              jk_error(parseState, @\"Internal error: Object == NULL.\"); stopParsing = 1; break; } else { parseState->objectStack.objects[objectStackIndex] = object; dictState = JKParseAcceptCommaOrEnd; }\n          break;\n        default: parseState->errorIsPrev = 1; jk_error_parse_accept_or3(parseState, dictState, @\"a value\", @\"a comma\", @\"a '}'\"); stopParsing = 1; break;\n      }\n    }\n  }\n\n  if(JK_EXPECT_F(parsedDictionary == NULL)) { size_t idx = 0UL; for(idx = startingObjectIndex; idx < parseState->objectStack.index; idx++) { if(parseState->objectStack.keys[idx] != NULL) { CFRelease(parseState->objectStack.keys[idx]); parseState->objectStack.keys[idx] = NULL; } if(parseState->objectStack.objects[idx] != NULL) { CFRelease(parseState->objectStack.objects[idx]); parseState->objectStack.objects[idx] = NULL; } } }\n#if !defined(NS_BLOCK_ASSERTIONS)\n  else { size_t idx = 0UL; for(idx = startingObjectIndex; idx < parseState->objectStack.index; idx++) { parseState->objectStack.objects[idx] = NULL; parseState->objectStack.keys[idx] = NULL; } }\n#endif\n\n  parseState->objectStack.index = startingObjectIndex;\n  return(parsedDictionary);\n}\n\nstatic id json_parse_it(JKParseState *parseState) {\n  id  parsedObject = NULL;\n  int stopParsing  = 0;\n\n  while((JK_EXPECT_T(stopParsing == 0)) && (JK_EXPECT_T(parseState->atIndex < parseState->stringBuffer.bytes.length))) {\n    if((JK_EXPECT_T(stopParsing == 0)) && (JK_EXPECT_T((stopParsing = jk_parse_next_token(parseState)) == 0))) {\n      switch(parseState->token.type) {\n        case JKTokenTypeArrayBegin:\n        case JKTokenTypeObjectBegin: parsedObject = [(id)jk_object_for_token(parseState) autorelease]; stopParsing = 1; break;\n        default:                     jk_error(parseState, @\"Expected either '[' or '{'.\");             stopParsing = 1; break;\n      }\n    }\n  }\n\n  NSCParameterAssert((parseState->objectStack.index == 0) && (JK_AT_STRING_PTR(parseState) <= JK_END_STRING_PTR(parseState)));\n\n  if((parsedObject == NULL) && (JK_AT_STRING_PTR(parseState) == JK_END_STRING_PTR(parseState))) { jk_error(parseState, @\"Reached the end of the buffer.\"); }\n  if(parsedObject == NULL) { jk_error(parseState, @\"Unable to parse JSON.\"); }\n\n  if((parsedObject != NULL) && (JK_AT_STRING_PTR(parseState) < JK_END_STRING_PTR(parseState))) {\n    jk_parse_skip_whitespace(parseState);\n    if((parsedObject != NULL) && ((parseState->parseOptionFlags & JKParseOptionPermitTextAfterValidJSON) == 0) && (JK_AT_STRING_PTR(parseState) < JK_END_STRING_PTR(parseState))) {\n      jk_error(parseState, @\"A valid JSON object was parsed but there were additional non-white-space characters remaining.\");\n      parsedObject = NULL;\n    }\n  }\n\n  return(parsedObject);\n}\n\n////////////\n#pragma mark -\n#pragma mark Object cache\n\n// This uses a Galois Linear Feedback Shift Register (LFSR) PRNG to pick which item in the cache to age. It has a period of (2^32)-1.\n// NOTE: A LFSR *MUST* be initialized to a non-zero value and must always have a non-zero value.\nJK_STATIC_INLINE void jk_cache_age(JKParseState *parseState) {\n  NSCParameterAssert((parseState != NULL) && (parseState->cache.prng_lfsr != 0U));\n  parseState->cache.prng_lfsr = (parseState->cache.prng_lfsr >> 1) ^ ((0U - (parseState->cache.prng_lfsr & 1U)) & 0x80200003U);\n  parseState->cache.age[parseState->cache.prng_lfsr & (parseState->cache.count - 1UL)] >>= 1;\n}\n\n// The object cache is nothing more than a hash table with open addressing collision resolution that is bounded by JK_CACHE_PROBES attempts.\n//\n// The hash table is a linear C array of JKTokenCacheItem.  The terms \"item\" and \"bucket\" are synonymous with the index in to the cache array, i.e. cache.items[bucket].\n//\n// Items in the cache have an age associated with them.  The age is the number of rightmost 1 bits, i.e. 0000 = 0, 0001 = 1, 0011 = 2, 0111 = 3, 1111 = 4.\n// This allows us to use left and right shifts to add or subtract from an items age.  Add = (age << 1) | 1.  Subtract = age >> 0.  Subtract is synonymous with \"age\" (i.e., age an item).\n// The reason for this is it allows us to perform saturated adds and subtractions and is branchless.\n// The primitive C type MUST be unsigned.  It is currently a \"char\", which allows (at a minimum and in practice) 8 bits.\n//\n// A \"useable bucket\" is a bucket that is not in use (never populated), or has an age == 0.\n//\n// When an item is found in the cache, it's age is incremented.\n// If a useable bucket hasn't been found, the current item (bucket) is aged along with two random items.\n//\n// If a value is not found in the cache, and no useable bucket has been found, that value is not added to the cache.\n\nstatic void *jk_cachedObjects(JKParseState *parseState) {\n  unsigned long  bucket     = parseState->token.value.hash & (parseState->cache.count - 1UL), setBucket = 0UL, useableBucket = 0UL, x = 0UL;\n  void          *parsedAtom = NULL;\n    \n  if(JK_EXPECT_F(parseState->token.value.ptrRange.length == 0UL) && JK_EXPECT_T(parseState->token.value.type == JKValueTypeString)) { return(@\"\"); }\n  \n  for(x = 0UL; x < JK_CACHE_PROBES; x++) {\n    if(JK_EXPECT_F(parseState->cache.items[bucket].object == NULL)) { setBucket = 1UL; useableBucket = bucket; break; }\n    \n    if((JK_EXPECT_T(parseState->cache.items[bucket].hash == parseState->token.value.hash)) && (JK_EXPECT_T(parseState->cache.items[bucket].size == parseState->token.value.ptrRange.length)) && (JK_EXPECT_T(parseState->cache.items[bucket].type == parseState->token.value.type)) && (JK_EXPECT_T(parseState->cache.items[bucket].bytes != NULL)) && (JK_EXPECT_T(memcmp(parseState->cache.items[bucket].bytes, parseState->token.value.ptrRange.ptr, parseState->token.value.ptrRange.length) == 0U))) {\n      parseState->cache.age[bucket]     = (parseState->cache.age[bucket] << 1) | 1U;\n      parseState->token.value.cacheItem = &parseState->cache.items[bucket];\n      NSCParameterAssert(parseState->cache.items[bucket].object != NULL);\n      return((void *)CFRetain(parseState->cache.items[bucket].object));\n    } else {\n      if(JK_EXPECT_F(setBucket == 0UL) && JK_EXPECT_F(parseState->cache.age[bucket] == 0U)) { setBucket = 1UL; useableBucket = bucket; }\n      if(JK_EXPECT_F(setBucket == 0UL))                                                     { parseState->cache.age[bucket] >>= 1; jk_cache_age(parseState); jk_cache_age(parseState); }\n      // This is the open addressing function.  The values length and type are used as a form of \"double hashing\" to distribute values with the same effective value hash across different object cache buckets.\n      // The values type is a prime number that is relatively coprime to the other primes in the set of value types and the number of hash table buckets.\n      bucket = (parseState->token.value.hash + (parseState->token.value.ptrRange.length * (x + 1UL)) + (parseState->token.value.type * (x + 1UL)) + (3UL * (x + 1UL))) & (parseState->cache.count - 1UL);\n    }\n  }\n  \n  switch(parseState->token.value.type) {\n    case JKValueTypeString:           parsedAtom = (void *)CFStringCreateWithBytes(NULL, parseState->token.value.ptrRange.ptr, parseState->token.value.ptrRange.length, kCFStringEncodingUTF8, 0); break;\n    case JKValueTypeLongLong:         parsedAtom = (void *)CFNumberCreate(NULL, kCFNumberLongLongType, &parseState->token.value.number.longLongValue);                                             break;\n    case JKValueTypeUnsignedLongLong:\n      if(parseState->token.value.number.unsignedLongLongValue <= LLONG_MAX) { parsedAtom = (void *)CFNumberCreate(NULL, kCFNumberLongLongType, &parseState->token.value.number.unsignedLongLongValue); }\n      else { parsedAtom = (void *)parseState->objCImpCache.NSNumberInitWithUnsignedLongLong(parseState->objCImpCache.NSNumberAlloc(parseState->objCImpCache.NSNumberClass, @selector(alloc)), @selector(initWithUnsignedLongLong:), parseState->token.value.number.unsignedLongLongValue); }\n      break;\n    case JKValueTypeDouble:           parsedAtom = (void *)CFNumberCreate(NULL, kCFNumberDoubleType,   &parseState->token.value.number.doubleValue);                                               break;\n    default: jk_error(parseState, @\"Internal error: Unknown token value type. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); break;\n  }\n  \n  if(JK_EXPECT_T(setBucket) && (JK_EXPECT_T(parsedAtom != NULL))) {\n    bucket = useableBucket;\n    if(JK_EXPECT_T((parseState->cache.items[bucket].object != NULL))) { CFRelease(parseState->cache.items[bucket].object); parseState->cache.items[bucket].object = NULL; }\n    \n    if(JK_EXPECT_T((parseState->cache.items[bucket].bytes = (unsigned char *)reallocf(parseState->cache.items[bucket].bytes, parseState->token.value.ptrRange.length)) != NULL)) {\n      memcpy(parseState->cache.items[bucket].bytes, parseState->token.value.ptrRange.ptr, parseState->token.value.ptrRange.length);\n      parseState->cache.items[bucket].object = (void *)CFRetain(parsedAtom);\n      parseState->cache.items[bucket].hash   = parseState->token.value.hash;\n      parseState->cache.items[bucket].cfHash = 0UL;\n      parseState->cache.items[bucket].size   = parseState->token.value.ptrRange.length;\n      parseState->cache.items[bucket].type   = parseState->token.value.type;\n      parseState->token.value.cacheItem      = &parseState->cache.items[bucket];\n      parseState->cache.age[bucket]          = JK_INIT_CACHE_AGE;\n    } else { // The realloc failed, so clear the appropriate fields.\n      parseState->cache.items[bucket].hash   = 0UL;\n      parseState->cache.items[bucket].cfHash = 0UL;\n      parseState->cache.items[bucket].size   = 0UL;\n      parseState->cache.items[bucket].type   = 0UL;\n    }\n  }\n  \n  return(parsedAtom);\n}\n\n\nstatic void *jk_object_for_token(JKParseState *parseState) {\n  void *parsedAtom = NULL;\n  \n  parseState->token.value.cacheItem = NULL;\n  switch(parseState->token.type) {\n    case JKTokenTypeString:      parsedAtom = jk_cachedObjects(parseState);    break;\n    case JKTokenTypeNumber:      parsedAtom = jk_cachedObjects(parseState);    break;\n    case JKTokenTypeObjectBegin: parsedAtom = jk_parse_dictionary(parseState); break;\n    case JKTokenTypeArrayBegin:  parsedAtom = jk_parse_array(parseState);      break;\n    case JKTokenTypeTrue:        parsedAtom = (void *)kCFBooleanTrue;          break;\n    case JKTokenTypeFalse:       parsedAtom = (void *)kCFBooleanFalse;         break;\n    case JKTokenTypeNull:        parsedAtom = (void *)kCFNull;                 break;\n    default: jk_error(parseState, @\"Internal error: Unknown token type. %@ line #%ld\", [NSString stringWithUTF8String:__FILE__], (long)__LINE__); break;\n  }\n  \n  return(parsedAtom);\n}\n\n#pragma mark -\n@implementation JSONDecoder\n\n+ (id)decoder\n{\n  return([self decoderWithParseOptions:JKParseOptionStrict]);\n}\n\n+ (id)decoderWithParseOptions:(JKParseOptionFlags)parseOptionFlags\n{\n  return([[[self alloc] initWithParseOptions:parseOptionFlags] autorelease]);\n}\n\n- (id)init\n{\n  return([self initWithParseOptions:JKParseOptionStrict]);\n}\n\n- (id)initWithParseOptions:(JKParseOptionFlags)parseOptionFlags\n{\n  if((self = [super init]) == NULL) { return(NULL); }\n\n  if(parseOptionFlags & ~JKParseOptionValidFlags) { [self autorelease]; [NSException raise:NSInvalidArgumentException format:@\"Invalid parse options.\"]; }\n\n  if((parseState = (JKParseState *)calloc(1UL, sizeof(JKParseState))) == NULL) { goto errorExit; }\n\n  parseState->parseOptionFlags = parseOptionFlags;\n  \n  parseState->token.tokenBuffer.roundSizeUpToMultipleOf = 4096UL;\n  parseState->objectStack.roundSizeUpToMultipleOf       = 2048UL;\n\n  parseState->objCImpCache.NSNumberClass                    = _jk_NSNumberClass;\n  parseState->objCImpCache.NSNumberAlloc                    = _jk_NSNumberAllocImp;\n  parseState->objCImpCache.NSNumberInitWithUnsignedLongLong = _jk_NSNumberInitWithUnsignedLongLongImp;\n  \n  parseState->cache.prng_lfsr = 1U;\n  parseState->cache.count     = JK_CACHE_SLOTS;\n  if((parseState->cache.items = (JKTokenCacheItem *)calloc(1UL, sizeof(JKTokenCacheItem) * parseState->cache.count)) == NULL) { goto errorExit; }\n\n  return(self);\n\n errorExit:\n  if(self) { [self autorelease]; self = NULL; }\n  return(NULL);\n}\n\n// This is here primarily to support the NSString and NSData convenience functions so the autoreleased JSONDecoder can release most of its resources before the pool pops.\nstatic void _JSONDecoderCleanup(JSONDecoder *decoder) {\n  if((decoder != NULL) && (decoder->parseState != NULL)) {\n    jk_managedBuffer_release(&decoder->parseState->token.tokenBuffer);\n    jk_objectStack_release(&decoder->parseState->objectStack);\n    \n    [decoder clearCache];\n    if(decoder->parseState->cache.items != NULL) { free(decoder->parseState->cache.items); decoder->parseState->cache.items = NULL; }\n    \n    free(decoder->parseState); decoder->parseState = NULL;\n  }\n}\n\n- (void)dealloc\n{\n  _JSONDecoderCleanup(self);\n  [super dealloc];\n}\n\n- (void)clearCache\n{\n  if(JK_EXPECT_T(parseState != NULL)) {\n    if(JK_EXPECT_T(parseState->cache.items != NULL)) {\n      size_t idx = 0UL;\n      for(idx = 0UL; idx < parseState->cache.count; idx++) {\n        if(JK_EXPECT_T(parseState->cache.items[idx].object != NULL)) { CFRelease(parseState->cache.items[idx].object); parseState->cache.items[idx].object = NULL; }\n        if(JK_EXPECT_T(parseState->cache.items[idx].bytes  != NULL)) { free(parseState->cache.items[idx].bytes);       parseState->cache.items[idx].bytes  = NULL; }\n        memset(&parseState->cache.items[idx], 0, sizeof(JKTokenCacheItem));\n        parseState->cache.age[idx] = 0U;\n      }\n    }\n  }\n}\n\n// This needs to be completely rewritten.\nstatic id _JKParseUTF8String(JKParseState *parseState, BOOL mutableCollections, const unsigned char *string, size_t length, NSError **error) {\n  NSCParameterAssert((parseState != NULL) && (string != NULL) && (parseState->cache.prng_lfsr != 0U));\n  parseState->stringBuffer.bytes.ptr    = string;\n  parseState->stringBuffer.bytes.length = length;\n  parseState->atIndex                   = 0UL;\n  parseState->lineNumber                = 1UL;\n  parseState->lineStartIndex            = 0UL;\n  parseState->prev_atIndex              = 0UL;\n  parseState->prev_lineNumber           = 1UL;\n  parseState->prev_lineStartIndex       = 0UL;\n  parseState->error                     = NULL;\n  parseState->errorIsPrev               = 0;\n  parseState->mutableCollections        = (mutableCollections == NO) ? NO : YES;\n  \n  unsigned char stackTokenBuffer[JK_TOKENBUFFER_SIZE] JK_ALIGNED(64);\n  jk_managedBuffer_setToStackBuffer(&parseState->token.tokenBuffer, stackTokenBuffer, sizeof(stackTokenBuffer));\n  \n  void       *stackObjects [JK_STACK_OBJS] JK_ALIGNED(64);\n  void       *stackKeys    [JK_STACK_OBJS] JK_ALIGNED(64);\n  CFHashCode  stackCFHashes[JK_STACK_OBJS] JK_ALIGNED(64);\n  jk_objectStack_setToStackBuffer(&parseState->objectStack, stackObjects, stackKeys, stackCFHashes, JK_STACK_OBJS);\n  \n  id parsedJSON = json_parse_it(parseState);\n  \n  if((error != NULL) && (parseState->error != NULL)) { *error = parseState->error; }\n  \n  jk_managedBuffer_release(&parseState->token.tokenBuffer);\n  jk_objectStack_release(&parseState->objectStack);\n  \n  parseState->stringBuffer.bytes.ptr    = NULL;\n  parseState->stringBuffer.bytes.length = 0UL;\n  parseState->atIndex                   = 0UL;\n  parseState->lineNumber                = 1UL;\n  parseState->lineStartIndex            = 0UL;\n  parseState->prev_atIndex              = 0UL;\n  parseState->prev_lineNumber           = 1UL;\n  parseState->prev_lineStartIndex       = 0UL;\n  parseState->error                     = NULL;\n  parseState->errorIsPrev               = 0;\n  parseState->mutableCollections        = NO;\n  \n  return(parsedJSON);\n}\n\n////////////\n#pragma mark Deprecated as of v1.4\n////////////\n\n// Deprecated in JSONKit v1.4.  Use objectWithUTF8String:length: instead.\n- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length\n{\n  return([self objectWithUTF8String:string length:length error:NULL]);\n}\n\n// Deprecated in JSONKit v1.4.  Use objectWithUTF8String:length:error: instead.\n- (id)parseUTF8String:(const unsigned char *)string length:(size_t)length error:(NSError **)error\n{\n  return([self objectWithUTF8String:string length:length error:error]);\n}\n\n// Deprecated in JSONKit v1.4.  Use objectWithData: instead.\n- (id)parseJSONData:(NSData *)jsonData\n{\n  return([self objectWithData:jsonData error:NULL]);\n}\n\n// Deprecated in JSONKit v1.4.  Use objectWithData:error: instead.\n- (id)parseJSONData:(NSData *)jsonData error:(NSError **)error\n{\n  return([self objectWithData:jsonData error:error]);\n}\n\n////////////\n#pragma mark Methods that return immutable collection objects\n////////////\n\n- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length\n{\n  return([self objectWithUTF8String:string length:length error:NULL]);\n}\n\n- (id)objectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error\n{\n  if(parseState == NULL) { [NSException raise:NSInternalInconsistencyException format:@\"parseState is NULL.\"];          }\n  if(string     == NULL) { [NSException raise:NSInvalidArgumentException       format:@\"The string argument is NULL.\"]; }\n  \n  return(_JKParseUTF8String(parseState, NO, string, (size_t)length, error));\n}\n\n- (id)objectWithData:(NSData *)jsonData\n{\n  return([self objectWithData:jsonData error:NULL]);\n}\n\n- (id)objectWithData:(NSData *)jsonData error:(NSError **)error\n{\n  if(jsonData == NULL) { [NSException raise:NSInvalidArgumentException format:@\"The jsonData argument is NULL.\"]; }\n  return([self objectWithUTF8String:(const unsigned char *)[jsonData bytes] length:[jsonData length] error:error]);\n}\n\n////////////\n#pragma mark Methods that return mutable collection objects\n////////////\n\n- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length\n{\n  return([self mutableObjectWithUTF8String:string length:length error:NULL]);\n}\n\n- (id)mutableObjectWithUTF8String:(const unsigned char *)string length:(NSUInteger)length error:(NSError **)error\n{\n  if(parseState == NULL) { [NSException raise:NSInternalInconsistencyException format:@\"parseState is NULL.\"];          }\n  if(string     == NULL) { [NSException raise:NSInvalidArgumentException       format:@\"The string argument is NULL.\"]; }\n  \n  return(_JKParseUTF8String(parseState, YES, string, (size_t)length, error));\n}\n\n- (id)mutableObjectWithData:(NSData *)jsonData\n{\n  return([self mutableObjectWithData:jsonData error:NULL]);\n}\n\n- (id)mutableObjectWithData:(NSData *)jsonData error:(NSError **)error\n{\n  if(jsonData == NULL) { [NSException raise:NSInvalidArgumentException format:@\"The jsonData argument is NULL.\"]; }\n  return([self mutableObjectWithUTF8String:(const unsigned char *)[jsonData bytes] length:[jsonData length] error:error]);\n}\n\n@end\n\n/*\n The NSString and NSData convenience methods need a little bit of explanation.\n \n Prior to JSONKit v1.4, the NSString -objectFromJSONStringWithParseOptions:error: method looked like\n \n const unsigned char *utf8String = (const unsigned char *)[self UTF8String];\n if(utf8String == NULL) { return(NULL); }\n size_t               utf8Length = strlen((const char *)utf8String); \n return([[JSONDecoder decoderWithParseOptions:parseOptionFlags] parseUTF8String:utf8String length:utf8Length error:error]);\n \n This changed with v1.4 to a more complicated method.  The reason for this is to keep the amount of memory that is\n allocated, but not yet freed because it is dependent on the autorelease pool to pop before it can be reclaimed.\n \n In the simpler v1.3 code, this included all the bytes used to store the -UTF8String along with the JSONDecoder and all its overhead.\n \n Now we use an autoreleased CFMutableData that is sized to the UTF8 length of the NSString in question and is used to hold the UTF8\n conversion of said string.\n \n Once parsed, the CFMutableData has its length set to 0.  This should, hopefully, allow the CFMutableData to realloc and/or free\n the buffer.\n \n Another change made was a slight modification to JSONDecoder so that most of the cleanup work that was done in -dealloc was moved\n to a private, internal function.  These convenience routines keep the pointer to the autoreleased JSONDecoder and calls\n _JSONDecoderCleanup() to early release the decoders resources since we already know that particular decoder is not going to be used\n again.  \n \n If everything goes smoothly, this will most likely result in perhaps a few hundred bytes that are allocated but waiting for the\n autorelease pool to pop.  This is compared to the thousands and easily hundreds of thousands of bytes that would have been in\n autorelease limbo.  It's more complicated for us, but a win for the user.\n \n Autorelease objects are used in case things don't go smoothly.  By having them autoreleased, we effectively guarantee that our\n requirement to -release the object is always met, not matter what goes wrong.  The downside is having a an object or two in\n autorelease limbo, but we've done our best to minimize that impact, so it all balances out.\n */\n\n@implementation NSString (JSONKitDeserializing)\n\nstatic id _NSStringObjectFromJSONString(NSString *jsonString, JKParseOptionFlags parseOptionFlags, NSError **error, BOOL mutableCollection) {\n  id                returnObject = NULL;\n  CFMutableDataRef  mutableData  = NULL;\n  JSONDecoder      *decoder      = NULL;\n  \n  CFIndex    stringLength     = CFStringGetLength((CFStringRef)jsonString);\n  NSUInteger stringUTF8Length = [jsonString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];\n  \n  if((mutableData = (CFMutableDataRef)[(id)CFDataCreateMutable(NULL, (NSUInteger)stringUTF8Length) autorelease]) != NULL) {\n    UInt8   *utf8String = CFDataGetMutableBytePtr(mutableData);\n    CFIndex  usedBytes  = 0L, convertedCount = 0L;\n    \n    convertedCount = CFStringGetBytes((CFStringRef)jsonString, CFRangeMake(0L, stringLength), kCFStringEncodingUTF8, '?', NO, utf8String, (NSUInteger)stringUTF8Length, &usedBytes);\n    if(JK_EXPECT_F(convertedCount != stringLength) || JK_EXPECT_F(usedBytes < 0L)) { if(error != NULL) { *error = [NSError errorWithDomain:@\"JKErrorDomain\" code:-1L userInfo:[NSDictionary dictionaryWithObject:@\"An error occurred converting the contents of a NSString to UTF8.\" forKey:NSLocalizedDescriptionKey]]; } goto exitNow; }\n    \n    if(mutableCollection == NO) { returnObject = [(decoder = [JSONDecoder decoderWithParseOptions:parseOptionFlags])        objectWithUTF8String:(const unsigned char *)utf8String length:(size_t)usedBytes error:error]; }\n    else                        { returnObject = [(decoder = [JSONDecoder decoderWithParseOptions:parseOptionFlags]) mutableObjectWithUTF8String:(const unsigned char *)utf8String length:(size_t)usedBytes error:error]; }\n  }\n  \nexitNow:\n  if(mutableData != NULL) { CFDataSetLength(mutableData, 0L); }\n  if(decoder     != NULL) { _JSONDecoderCleanup(decoder);     }\n  return(returnObject);\n}\n\n- (id)objectFromJSONString\n{\n  return([self objectFromJSONStringWithParseOptions:JKParseOptionStrict error:NULL]);\n}\n\n- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags\n{\n  return([self objectFromJSONStringWithParseOptions:parseOptionFlags error:NULL]);\n}\n\n- (id)objectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error\n{\n  return(_NSStringObjectFromJSONString(self, parseOptionFlags, error, NO));\n}\n\n\n- (id)mutableObjectFromJSONString\n{\n  return([self mutableObjectFromJSONStringWithParseOptions:JKParseOptionStrict error:NULL]);\n}\n\n- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags\n{\n  return([self mutableObjectFromJSONStringWithParseOptions:parseOptionFlags error:NULL]);\n}\n\n- (id)mutableObjectFromJSONStringWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error\n{\n  return(_NSStringObjectFromJSONString(self, parseOptionFlags, error, YES));\n}\n\n@end\n\n@implementation NSData (JSONKitDeserializing)\n\n- (id)objectFromJSONData\n{\n  return([self objectFromJSONDataWithParseOptions:JKParseOptionStrict error:NULL]);\n}\n\n- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags\n{\n  return([self objectFromJSONDataWithParseOptions:parseOptionFlags error:NULL]);\n}\n\n- (id)objectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error\n{\n  JSONDecoder *decoder = NULL;\n  id returnObject = [(decoder = [JSONDecoder decoderWithParseOptions:parseOptionFlags]) objectWithData:self error:error];\n  if(decoder != NULL) { _JSONDecoderCleanup(decoder); }\n  return(returnObject);\n}\n\n- (id)mutableObjectFromJSONData\n{\n  return([self mutableObjectFromJSONDataWithParseOptions:JKParseOptionStrict error:NULL]);\n}\n\n- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags\n{\n  return([self mutableObjectFromJSONDataWithParseOptions:parseOptionFlags error:NULL]);\n}\n\n- (id)mutableObjectFromJSONDataWithParseOptions:(JKParseOptionFlags)parseOptionFlags error:(NSError **)error\n{\n  JSONDecoder *decoder = NULL;\n  id returnObject = [(decoder = [JSONDecoder decoderWithParseOptions:parseOptionFlags]) mutableObjectWithData:self error:error];\n  if(decoder != NULL) { _JSONDecoderCleanup(decoder); }\n  return(returnObject);\n}\n\n\n@end\n\n////////////\n#pragma mark -\n#pragma mark Encoding / deserializing functions\n\nstatic void jk_encode_error(JKEncodeState *encodeState, NSString *format, ...) {\n  NSCParameterAssert((encodeState != NULL) && (format != NULL));\n\n  va_list varArgsList;\n  va_start(varArgsList, format);\n  NSString *formatString = [[[NSString alloc] initWithFormat:format arguments:varArgsList] autorelease];\n  va_end(varArgsList);\n\n  if(encodeState->error == NULL) {\n    encodeState->error = [NSError errorWithDomain:@\"JKErrorDomain\" code:-1L userInfo:\n                                   [NSDictionary dictionaryWithObjectsAndKeys:\n                                                                              formatString, NSLocalizedDescriptionKey,\n                                                                              NULL]];\n  }\n}\n\nJK_STATIC_INLINE void jk_encode_updateCache(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object) {\n  NSCParameterAssert(encodeState != NULL);\n  if(JK_EXPECT_T(cacheSlot != NULL)) {\n    NSCParameterAssert((object != NULL) && (startingAtIndex <= encodeState->atIndex));\n    cacheSlot->object = object;\n    cacheSlot->offset = startingAtIndex;\n    cacheSlot->length = (size_t)(encodeState->atIndex - startingAtIndex);  \n  }\n}\n\nstatic int jk_encode_printf(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object, const char *format, ...) {\n  va_list varArgsList, varArgsListCopy;\n  va_start(varArgsList, format);\n  va_copy(varArgsListCopy, varArgsList);\n\n  NSCParameterAssert((encodeState != NULL) && (encodeState->atIndex < encodeState->stringBuffer.bytes.length) && (startingAtIndex <= encodeState->atIndex) && (format != NULL));\n\n  ssize_t  formattedStringLength = 0L;\n  int      returnValue           = 0;\n\n  if(JK_EXPECT_T((formattedStringLength = vsnprintf((char *)&encodeState->stringBuffer.bytes.ptr[encodeState->atIndex], (encodeState->stringBuffer.bytes.length - encodeState->atIndex), format, varArgsList)) >= (ssize_t)(encodeState->stringBuffer.bytes.length - encodeState->atIndex))) {\n    NSCParameterAssert(((encodeState->atIndex + (formattedStringLength * 2UL) + 256UL) > encodeState->stringBuffer.bytes.length));\n    if(JK_EXPECT_F(((encodeState->atIndex + (formattedStringLength * 2UL) + 256UL) > encodeState->stringBuffer.bytes.length)) && JK_EXPECT_F((jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + (formattedStringLength * 2UL)+ 4096UL) == NULL))) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); returnValue = 1; goto exitNow; }\n    if(JK_EXPECT_F((formattedStringLength = vsnprintf((char *)&encodeState->stringBuffer.bytes.ptr[encodeState->atIndex], (encodeState->stringBuffer.bytes.length - encodeState->atIndex), format, varArgsListCopy)) >= (ssize_t)(encodeState->stringBuffer.bytes.length - encodeState->atIndex))) { jk_encode_error(encodeState, @\"vsnprintf failed unexpectedly.\"); returnValue = 1; goto exitNow; }\n  }\n  \nexitNow:\n  va_end(varArgsList);\n  va_end(varArgsListCopy);\n  if(JK_EXPECT_T(returnValue == 0)) { encodeState->atIndex += formattedStringLength; jk_encode_updateCache(encodeState, cacheSlot, startingAtIndex, object); }\n  return(returnValue);\n}\n\nstatic int jk_encode_write(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object, const char *format) {\n  NSCParameterAssert((encodeState != NULL) && (encodeState->atIndex < encodeState->stringBuffer.bytes.length) && (startingAtIndex <= encodeState->atIndex) && (format != NULL));\n  if(JK_EXPECT_F(((encodeState->atIndex + strlen(format) + 256UL) > encodeState->stringBuffer.bytes.length)) && JK_EXPECT_F((jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + strlen(format) + 1024UL) == NULL))) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); }\n\n  size_t formatIdx = 0UL;\n  for(formatIdx = 0UL; format[formatIdx] != 0; formatIdx++) { NSCParameterAssert(encodeState->atIndex < encodeState->stringBuffer.bytes.length); encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = format[formatIdx]; }\n  jk_encode_updateCache(encodeState, cacheSlot, startingAtIndex, object);\n  return(0);\n}\n\nstatic int jk_encode_writePrettyPrintWhiteSpace(JKEncodeState *encodeState) {\n  NSCParameterAssert((encodeState != NULL) && ((encodeState->serializeOptionFlags & JKSerializeOptionPretty) != 0UL));\n  if(JK_EXPECT_F((encodeState->atIndex + ((encodeState->depth + 1UL) * 2UL) + 16UL) > encodeState->stringBuffer.bytes.length) && JK_EXPECT_T(jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + ((encodeState->depth + 1UL) * 2UL) + 4096UL) == NULL)) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); }\n  encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\n';\n  size_t depthWhiteSpace = 0UL;\n  for(depthWhiteSpace = 0UL; depthWhiteSpace < (encodeState->depth * 2UL); depthWhiteSpace++) { NSCParameterAssert(encodeState->atIndex < encodeState->stringBuffer.bytes.length); encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = ' '; }\n  return(0);\n}  \n\nstatic int jk_encode_write1slow(JKEncodeState *encodeState, ssize_t depthChange, const char *format) {\n  NSCParameterAssert((encodeState != NULL) && (encodeState->atIndex < encodeState->stringBuffer.bytes.length) && (format != NULL) && ((depthChange >= -1L) && (depthChange <= 1L)) && ((encodeState->depth == 0UL) ? (depthChange >= 0L) : 1) && ((encodeState->serializeOptionFlags & JKSerializeOptionPretty) != 0UL));\n  if(JK_EXPECT_F((encodeState->atIndex + ((encodeState->depth + 1UL) * 2UL) + 16UL) > encodeState->stringBuffer.bytes.length) && JK_EXPECT_F(jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + ((encodeState->depth + 1UL) * 2UL) + 4096UL) == NULL)) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); }\n  encodeState->depth += depthChange;\n  if(JK_EXPECT_T(format[0] == ':')) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = format[0]; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = ' '; }\n  else {\n    if(JK_EXPECT_F(depthChange == -1L)) { if(JK_EXPECT_F(jk_encode_writePrettyPrintWhiteSpace(encodeState))) { return(1); } }\n    encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = format[0];\n    if(JK_EXPECT_T(depthChange != -1L)) { if(JK_EXPECT_F(jk_encode_writePrettyPrintWhiteSpace(encodeState))) { return(1); } }\n  }\n  NSCParameterAssert(encodeState->atIndex < encodeState->stringBuffer.bytes.length);\n  return(0);\n}\n\nstatic int jk_encode_write1fast(JKEncodeState *encodeState, ssize_t depthChange JK_UNUSED_ARG, const char *format) {\n  NSCParameterAssert((encodeState != NULL) && (encodeState->atIndex < encodeState->stringBuffer.bytes.length) && ((encodeState->serializeOptionFlags & JKSerializeOptionPretty) == 0UL));\n  if(JK_EXPECT_T((encodeState->atIndex + 4UL) < encodeState->stringBuffer.bytes.length)) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = format[0]; }\n  else { return(jk_encode_write(encodeState, NULL, 0UL, NULL, format)); }\n  return(0);\n}\n\nstatic int jk_encode_writen(JKEncodeState *encodeState, JKEncodeCache *cacheSlot, size_t startingAtIndex, id object, const char *format, size_t length) {\n  NSCParameterAssert((encodeState != NULL) && (encodeState->atIndex < encodeState->stringBuffer.bytes.length) && (startingAtIndex <= encodeState->atIndex));\n  if(JK_EXPECT_F((encodeState->stringBuffer.bytes.length - encodeState->atIndex) < (length + 4UL))) { if(jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + 4096UL + length) == NULL) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); } }\n  memcpy(encodeState->stringBuffer.bytes.ptr + encodeState->atIndex, format, length);\n  encodeState->atIndex += length;\n  jk_encode_updateCache(encodeState, cacheSlot, startingAtIndex, object);\n  return(0);\n}\n\nJK_STATIC_INLINE JKHash jk_encode_object_hash(void *objectPtr) {\n  return( ( (((JKHash)objectPtr) >> 21) ^ (((JKHash)objectPtr) >> 9)   ) + (((JKHash)objectPtr) >> 4) );\n}\n\nstatic int jk_encode_add_atom_to_buffer(JKEncodeState *encodeState, void *objectPtr) {\n  NSCParameterAssert((encodeState != NULL) && (encodeState->atIndex < encodeState->stringBuffer.bytes.length) && (objectPtr != NULL));\n\n  id     object          = (id)objectPtr, encodeCacheObject = object;\n  int    isClass         = JKClassUnknown;\n  size_t startingAtIndex = encodeState->atIndex;\n\n  JKHash         objectHash = jk_encode_object_hash(objectPtr);\n  JKEncodeCache *cacheSlot  = &encodeState->cache[objectHash % JK_ENCODE_CACHE_SLOTS];\n\n  if(JK_EXPECT_T(cacheSlot->object == object)) {\n    NSCParameterAssert((cacheSlot->object != NULL) &&\n                       (cacheSlot->offset < encodeState->atIndex)                   && ((cacheSlot->offset + cacheSlot->length) < encodeState->atIndex)                                    &&\n                       (cacheSlot->offset < encodeState->stringBuffer.bytes.length) && ((cacheSlot->offset + cacheSlot->length) < encodeState->stringBuffer.bytes.length)                  &&\n                       ((encodeState->stringBuffer.bytes.ptr + encodeState->atIndex)                     < (encodeState->stringBuffer.bytes.ptr + encodeState->stringBuffer.bytes.length)) &&\n                       ((encodeState->stringBuffer.bytes.ptr + cacheSlot->offset)                        < (encodeState->stringBuffer.bytes.ptr + encodeState->stringBuffer.bytes.length)) &&\n                       ((encodeState->stringBuffer.bytes.ptr + cacheSlot->offset + cacheSlot->length)    < (encodeState->stringBuffer.bytes.ptr + encodeState->stringBuffer.bytes.length)));\n    if(JK_EXPECT_F(((encodeState->atIndex + cacheSlot->length + 256UL) > encodeState->stringBuffer.bytes.length)) && JK_EXPECT_F((jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + cacheSlot->length + 1024UL) == NULL))) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); }\n    NSCParameterAssert(((encodeState->atIndex + cacheSlot->length) < encodeState->stringBuffer.bytes.length) &&\n                       ((encodeState->stringBuffer.bytes.ptr + encodeState->atIndex)                     < (encodeState->stringBuffer.bytes.ptr + encodeState->stringBuffer.bytes.length)) &&\n                       ((encodeState->stringBuffer.bytes.ptr + encodeState->atIndex + cacheSlot->length) < (encodeState->stringBuffer.bytes.ptr + encodeState->stringBuffer.bytes.length)) &&\n                       ((encodeState->stringBuffer.bytes.ptr + cacheSlot->offset)                        < (encodeState->stringBuffer.bytes.ptr + encodeState->stringBuffer.bytes.length)) &&\n                       ((encodeState->stringBuffer.bytes.ptr + cacheSlot->offset + cacheSlot->length)    < (encodeState->stringBuffer.bytes.ptr + encodeState->stringBuffer.bytes.length)) &&\n                       ((encodeState->stringBuffer.bytes.ptr + cacheSlot->offset + cacheSlot->length)    < (encodeState->stringBuffer.bytes.ptr + encodeState->atIndex)));\n    memcpy(encodeState->stringBuffer.bytes.ptr + encodeState->atIndex, encodeState->stringBuffer.bytes.ptr + cacheSlot->offset, cacheSlot->length);\n    encodeState->atIndex += cacheSlot->length;\n    return(0);\n  }\n\n  // When we encounter a class that we do not handle, and we have either a delegate or block that the user supplied to format unsupported classes,\n  // we \"re-run\" the object check.  However, we re-run the object check exactly ONCE.  If the user supplies an object that isn't one of the\n  // supported classes, we fail the second time (i.e., double fault error).\n  BOOL rerunningAfterClassFormatter = NO;\n rerunAfterClassFormatter:;\n\n  // XXX XXX XXX XXX\n  //     \n  //     We need to work around a bug in 10.7, which breaks ABI compatibility with Objective-C going back not just to 10.0, but OpenStep and even NextStep.\n  //     \n  //     It has long been documented that \"the very first thing that a pointer to an Objective-C object \"points to\" is a pointer to that objects class\".\n  //     \n  //     This is euphemistically called \"tagged pointers\".  There are a number of highly technical problems with this, most involving long passages from\n  //     the C standard(s).  In short, one can make a strong case, couched from the perspective of the C standard(s), that that 10.7 \"tagged pointers\" are\n  //     fundamentally Wrong and Broken, and should have never been implemented.  Assuming those points are glossed over, because the change is very clearly\n  //     breaking ABI compatibility, this should have resulted in a minimum of a \"minimum version required\" bump in various shared libraries to prevent\n  //     causes code that used to work just fine to suddenly break without warning.\n  //\n  //     In fact, the C standard says that the hack below is \"undefined behavior\"- there is no requirement that the 10.7 tagged pointer hack of setting the\n  //     \"lower, unused bits\" must be preserved when casting the result to an integer type, but this \"works\" because for most architectures\n  //     `sizeof(long) == sizeof(void *)` and the compiler uses the same representation for both.  (note: this is informal, not meant to be\n  //     normative or pedantically correct).\n  //     \n  //     In other words, while this \"works\" for now, technically the compiler is not obligated to do \"what we want\", and a later version of the compiler\n  //     is not required in any way to produce the same results or behavior that earlier versions of the compiler did for the statement below.\n  //\n  //     Fan-fucking-tastic.\n  //     \n  //     Why not just use `object_getClass()`?  Because `object->isa` reduces to (typically) a *single* instruction.  Calling `object_getClass()` requires\n  //     that the compiler potentially spill registers, establish a function call frame / environment, and finally execute a \"jump subroutine\" instruction.\n  //     Then, the called subroutine must spend half a dozen instructions in its prolog, however many instructions doing whatever it does, then half a dozen\n  //     instructions in its prolog.  One instruction compared to dozens, maybe a hundred instructions.\n  //     \n  //     Yes, that's one to two orders of magnitude difference.  Which is compelling in its own right.  When going for performance, you're often happy with\n  //     gains in the two to three percent range.\n  //     \n  // XXX XXX XXX XXX\n\n  BOOL workAroundMacOSXABIBreakingBug = NO;\n  if(JK_EXPECT_F(((NSUInteger)object) & 0x1)) { workAroundMacOSXABIBreakingBug = YES; goto slowClassLookup; }\n\n       if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.stringClass))     { isClass = JKClassString;     }\n  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.numberClass))     { isClass = JKClassNumber;     }\n  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.dictionaryClass)) { isClass = JKClassDictionary; }\n  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.arrayClass))      { isClass = JKClassArray;      }\n  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.nullClass))       { isClass = JKClassNull;       }\n  else {\n  slowClassLookup:\n         if(JK_EXPECT_T([object isKindOfClass:[NSString     class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.stringClass     = object->isa; } isClass = JKClassString;     }\n    else if(JK_EXPECT_T([object isKindOfClass:[NSNumber     class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.numberClass     = object->isa; } isClass = JKClassNumber;     }\n    else if(JK_EXPECT_T([object isKindOfClass:[NSDictionary class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.dictionaryClass = object->isa; } isClass = JKClassDictionary; }\n    else if(JK_EXPECT_T([object isKindOfClass:[NSArray      class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.arrayClass      = object->isa; } isClass = JKClassArray;      }\n    else if(JK_EXPECT_T([object isKindOfClass:[NSNull       class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.nullClass       = object->isa; } isClass = JKClassNull;       }\n    else {\n      if((rerunningAfterClassFormatter == NO) && (\n#ifdef __BLOCKS__\n           ((encodeState->classFormatterBlock) && ((object = encodeState->classFormatterBlock(object))                                                                         != NULL)) ||\n#endif\n           ((encodeState->classFormatterIMP)   && ((object = encodeState->classFormatterIMP(encodeState->classFormatterDelegate, encodeState->classFormatterSelector, object)) != NULL))    )) { rerunningAfterClassFormatter = YES; goto rerunAfterClassFormatter; }\n      \n      if(rerunningAfterClassFormatter == NO) { jk_encode_error(encodeState, @\"Unable to serialize object class %@.\", NSStringFromClass([encodeCacheObject class])); return(1); }\n      else { jk_encode_error(encodeState, @\"Unable to serialize object class %@ that was returned by the unsupported class formatter.  Original object class was %@.\", (object == NULL) ? @\"NULL\" : NSStringFromClass([object class]), NSStringFromClass([encodeCacheObject class])); return(1); }\n    }\n  }\n\n  // This is here for the benefit of the optimizer.  It allows the optimizer to do loop invariant code motion for the JKClassArray\n  // and JKClassDictionary cases when printing simple, single characters via jk_encode_write(), which is actually a macro:\n  // #define jk_encode_write1(es, dc, f) (_jk_encode_prettyPrint ? jk_encode_write1slow(es, dc, f) : jk_encode_write1fast(es, dc, f))\n  int _jk_encode_prettyPrint = JK_EXPECT_T((encodeState->serializeOptionFlags & JKSerializeOptionPretty) == 0) ? 0 : 1;\n  \n  switch(isClass) {\n    case JKClassString:\n      {\n        {\n          const unsigned char *cStringPtr = (const unsigned char *)CFStringGetCStringPtr((CFStringRef)object, kCFStringEncodingMacRoman);\n          if(cStringPtr != NULL) {\n            const unsigned char *utf8String = cStringPtr;\n            size_t               utf8Idx    = 0UL;\n\n            CFIndex stringLength = CFStringGetLength((CFStringRef)object);\n            if(JK_EXPECT_F(((encodeState->atIndex + (stringLength * 2UL) + 256UL) > encodeState->stringBuffer.bytes.length)) && JK_EXPECT_F((jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + (stringLength * 2UL) + 1024UL) == NULL))) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); }\n\n            if(JK_EXPECT_T((encodeState->encodeOption & JKEncodeOptionStringObjTrimQuotes) == 0UL)) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\"'; }\n            for(utf8Idx = 0UL; utf8String[utf8Idx] != 0U; utf8Idx++) {\n              NSCParameterAssert(((&encodeState->stringBuffer.bytes.ptr[encodeState->atIndex]) - encodeState->stringBuffer.bytes.ptr) < (ssize_t)encodeState->stringBuffer.bytes.length);\n              NSCParameterAssert(encodeState->atIndex < encodeState->stringBuffer.bytes.length);\n              if(JK_EXPECT_F(utf8String[utf8Idx] >= 0x80U)) { encodeState->atIndex = startingAtIndex; goto slowUTF8Path; }\n              if(JK_EXPECT_F(utf8String[utf8Idx] <  0x20U)) {\n                switch(utf8String[utf8Idx]) {\n                  case '\\b': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'b'; break;\n                  case '\\f': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'f'; break;\n                  case '\\n': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'n'; break;\n                  case '\\r': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'r'; break;\n                  case '\\t': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 't'; break;\n                  default: if(JK_EXPECT_F(jk_encode_printf(encodeState, NULL, 0UL, NULL, \"\\\\u%4.4x\", utf8String[utf8Idx]))) { return(1); } break;\n                }\n              } else {\n                if(JK_EXPECT_F(utf8String[utf8Idx] == '\\\"') || JK_EXPECT_F(utf8String[utf8Idx] == '\\\\') || (JK_EXPECT_F(encodeState->serializeOptionFlags & JKSerializeOptionEscapeForwardSlashes) && JK_EXPECT_F(utf8String[utf8Idx] == '/'))) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; }\n                encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = utf8String[utf8Idx];\n              }\n            }\n            NSCParameterAssert((encodeState->atIndex + 1UL) < encodeState->stringBuffer.bytes.length);\n            if(JK_EXPECT_T((encodeState->encodeOption & JKEncodeOptionStringObjTrimQuotes) == 0UL)) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\"'; }\n            jk_encode_updateCache(encodeState, cacheSlot, startingAtIndex, encodeCacheObject);\n            return(0);\n          }\n        }\n\n      slowUTF8Path:\n        {\n          CFIndex stringLength        = CFStringGetLength((CFStringRef)object);\n          CFIndex maxStringUTF8Length = CFStringGetMaximumSizeForEncoding(stringLength, kCFStringEncodingUTF8) + 32L;\n        \n          if(JK_EXPECT_F((size_t)maxStringUTF8Length > encodeState->utf8ConversionBuffer.bytes.length) && JK_EXPECT_F(jk_managedBuffer_resize(&encodeState->utf8ConversionBuffer, maxStringUTF8Length + 1024UL) == NULL)) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); }\n        \n          CFIndex usedBytes = 0L, convertedCount = 0L;\n          convertedCount = CFStringGetBytes((CFStringRef)object, CFRangeMake(0L, stringLength), kCFStringEncodingUTF8, '?', NO, encodeState->utf8ConversionBuffer.bytes.ptr, encodeState->utf8ConversionBuffer.bytes.length - 16L, &usedBytes);\n          if(JK_EXPECT_F(convertedCount != stringLength) || JK_EXPECT_F(usedBytes < 0L)) { jk_encode_error(encodeState, @\"An error occurred converting the contents of a NSString to UTF8.\"); return(1); }\n        \n          if(JK_EXPECT_F((encodeState->atIndex + (maxStringUTF8Length * 2UL) + 256UL) > encodeState->stringBuffer.bytes.length) && JK_EXPECT_F(jk_managedBuffer_resize(&encodeState->stringBuffer, encodeState->atIndex + (maxStringUTF8Length * 2UL) + 1024UL) == NULL)) { jk_encode_error(encodeState, @\"Unable to resize temporary buffer.\"); return(1); }\n        \n          const unsigned char *utf8String = encodeState->utf8ConversionBuffer.bytes.ptr;\n        \n          size_t utf8Idx = 0UL;\n          if(JK_EXPECT_T((encodeState->encodeOption & JKEncodeOptionStringObjTrimQuotes) == 0UL)) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\"'; }\n          for(utf8Idx = 0UL; utf8Idx < (size_t)usedBytes; utf8Idx++) {\n            NSCParameterAssert(((&encodeState->stringBuffer.bytes.ptr[encodeState->atIndex]) - encodeState->stringBuffer.bytes.ptr) < (ssize_t)encodeState->stringBuffer.bytes.length);\n            NSCParameterAssert(encodeState->atIndex < encodeState->stringBuffer.bytes.length);\n            NSCParameterAssert((CFIndex)utf8Idx < usedBytes);\n            if(JK_EXPECT_F(utf8String[utf8Idx] < 0x20U)) {\n              switch(utf8String[utf8Idx]) {\n                case '\\b': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'b'; break;\n                case '\\f': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'f'; break;\n                case '\\n': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'n'; break;\n                case '\\r': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 'r'; break;\n                case '\\t': encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = 't'; break;\n                default: if(JK_EXPECT_F(jk_encode_printf(encodeState, NULL, 0UL, NULL, \"\\\\u%4.4x\", utf8String[utf8Idx]))) { return(1); } break;\n              }\n            } else {\n              if(JK_EXPECT_F(utf8String[utf8Idx] >= 0x80U) && (encodeState->serializeOptionFlags & JKSerializeOptionEscapeUnicode)) {\n                const unsigned char *nextValidCharacter = NULL;\n                UTF32                u32ch              = 0U;\n                ConversionResult     result;\n\n                if(JK_EXPECT_F((result = ConvertSingleCodePointInUTF8(&utf8String[utf8Idx], &utf8String[usedBytes], (UTF8 const **)&nextValidCharacter, &u32ch)) != conversionOK)) { jk_encode_error(encodeState, @\"Error converting UTF8.\"); return(1); }\n                else {\n                  utf8Idx = (nextValidCharacter - utf8String) - 1UL;\n                  if(JK_EXPECT_T(u32ch <= 0xffffU)) { if(JK_EXPECT_F(jk_encode_printf(encodeState, NULL, 0UL, NULL, \"\\\\u%4.4x\", u32ch)))                                                           { return(1); } }\n                  else                              { if(JK_EXPECT_F(jk_encode_printf(encodeState, NULL, 0UL, NULL, \"\\\\u%4.4x\\\\u%4.4x\", (0xd7c0U + (u32ch >> 10)), (0xdc00U + (u32ch & 0x3ffU))))) { return(1); } }\n                }\n              } else {\n                if(JK_EXPECT_F(utf8String[utf8Idx] == '\\\"') || JK_EXPECT_F(utf8String[utf8Idx] == '\\\\') || (JK_EXPECT_F(encodeState->serializeOptionFlags & JKSerializeOptionEscapeForwardSlashes) && JK_EXPECT_F(utf8String[utf8Idx] == '/'))) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\\'; }\n                encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = utf8String[utf8Idx];\n              }\n            }\n          }\n          NSCParameterAssert((encodeState->atIndex + 1UL) < encodeState->stringBuffer.bytes.length);\n          if(JK_EXPECT_T((encodeState->encodeOption & JKEncodeOptionStringObjTrimQuotes) == 0UL)) { encodeState->stringBuffer.bytes.ptr[encodeState->atIndex++] = '\\\"'; }\n          jk_encode_updateCache(encodeState, cacheSlot, startingAtIndex, encodeCacheObject);\n          return(0);\n        }\n      }\n      break;\n\n    case JKClassNumber:\n      {\n             if(object == (id)kCFBooleanTrue)  { return(jk_encode_writen(encodeState, cacheSlot, startingAtIndex, encodeCacheObject, \"true\",  4UL)); }\n        else if(object == (id)kCFBooleanFalse) { return(jk_encode_writen(encodeState, cacheSlot, startingAtIndex, encodeCacheObject, \"false\", 5UL)); }\n        \n        const char         *objCType = [object objCType];\n        char                anum[256], *aptr = &anum[255];\n        int                 isNegative = 0;\n        unsigned long long  ullv;\n        long long           llv;\n        \n        if(JK_EXPECT_F(objCType == NULL) || JK_EXPECT_F(objCType[0] == 0) || JK_EXPECT_F(objCType[1] != 0)) { jk_encode_error(encodeState, @\"NSNumber conversion error, unknown type.  Type: '%s'\", (objCType == NULL) ? \"<NULL>\" : objCType); return(1); }\n        \n        switch(objCType[0]) {\n          case 'c': case 'i': case 's': case 'l': case 'q':\n            if(JK_EXPECT_T(CFNumberGetValue((CFNumberRef)object, kCFNumberLongLongType, &llv)))  {\n              if(llv < 0LL)  { ullv = -llv; isNegative = 1; } else { ullv = llv; isNegative = 0; }\n              goto convertNumber;\n            } else { jk_encode_error(encodeState, @\"Unable to get scalar value from number object.\"); return(1); }\n            break;\n          case 'C': case 'I': case 'S': case 'L': case 'Q': case 'B':\n            if(JK_EXPECT_T(CFNumberGetValue((CFNumberRef)object, kCFNumberLongLongType, &ullv))) {\n            convertNumber:\n              if(JK_EXPECT_F(ullv < 10ULL)) { *--aptr = ullv + '0'; } else { while(JK_EXPECT_T(ullv > 0ULL)) { *--aptr = (ullv % 10ULL) + '0'; ullv /= 10ULL; NSCParameterAssert(aptr > anum); } }\n              if(isNegative) { *--aptr = '-'; }\n              NSCParameterAssert(aptr > anum);\n              return(jk_encode_writen(encodeState, cacheSlot, startingAtIndex, encodeCacheObject, aptr, &anum[255] - aptr));\n            } else { jk_encode_error(encodeState, @\"Unable to get scalar value from number object.\"); return(1); }\n            break;\n          case 'f': case 'd':\n            {\n              double dv;\n              if(JK_EXPECT_T(CFNumberGetValue((CFNumberRef)object, kCFNumberDoubleType, &dv))) {\n                if(JK_EXPECT_F(!isfinite(dv))) { jk_encode_error(encodeState, @\"Floating point values must be finite.  JSON does not support NaN or Infinity.\"); return(1); }\n                return(jk_encode_printf(encodeState, cacheSlot, startingAtIndex, encodeCacheObject, \"%.17g\", dv));\n              } else { jk_encode_error(encodeState, @\"Unable to get floating point value from number object.\"); return(1); }\n            }\n            break;\n          default: jk_encode_error(encodeState, @\"NSNumber conversion error, unknown type.  Type: '%c' / 0x%2.2x\", objCType[0], objCType[0]); return(1); break;\n        }\n      }\n      break;\n    \n    case JKClassArray:\n      {\n        int     printComma = 0;\n        CFIndex arrayCount = CFArrayGetCount((CFArrayRef)object), idx = 0L;\n        if(JK_EXPECT_F(jk_encode_write1(encodeState, 1L, \"[\"))) { return(1); }\n        if(JK_EXPECT_F(arrayCount > 1020L)) {\n          for(id arrayObject in object)          { if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, \",\"))) { return(1); } } printComma = 1; if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, arrayObject)))  { return(1); } }\n        } else {\n          void *objects[1024];\n          CFArrayGetValues((CFArrayRef)object, CFRangeMake(0L, arrayCount), (const void **)objects);\n          for(idx = 0L; idx < arrayCount; idx++) { if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, \",\"))) { return(1); } } printComma = 1; if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, objects[idx]))) { return(1); } }\n        }\n        return(jk_encode_write1(encodeState, -1L, \"]\"));\n      }\n      break;\n\n    case JKClassDictionary:\n      {\n        int     printComma      = 0;\n        CFIndex dictionaryCount = CFDictionaryGetCount((CFDictionaryRef)object), idx = 0L;\n        id      enumerateObject = JK_EXPECT_F(_jk_encode_prettyPrint) ? [[object allKeys] sortedArrayUsingSelector:@selector(compare:)] : object;\n\n        if(JK_EXPECT_F(jk_encode_write1(encodeState, 1L, \"{\"))) { return(1); }\n        if(JK_EXPECT_F(_jk_encode_prettyPrint) || JK_EXPECT_F(dictionaryCount > 1020L)) {\n          for(id keyObject in enumerateObject) {\n            if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, \",\"))) { return(1); } }\n            printComma = 1;\n            if(JK_EXPECT_F((keyObject->isa      != encodeState->fastClassLookup.stringClass)) && JK_EXPECT_F(([keyObject   isKindOfClass:[NSString class]] == NO))) { jk_encode_error(encodeState, @\"Key must be a string object.\"); return(1); }\n            if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, keyObject)))                                                        { return(1); }\n            if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, \":\")))                                                                      { return(1); }\n            if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, (void *)CFDictionaryGetValue((CFDictionaryRef)object, keyObject)))) { return(1); }\n          }\n        } else {\n          void *keys[1024], *objects[1024];\n          CFDictionaryGetKeysAndValues((CFDictionaryRef)object, (const void **)keys, (const void **)objects);\n          for(idx = 0L; idx < dictionaryCount; idx++) {\n            if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, \",\"))) { return(1); } }\n            printComma = 1;\n            if(JK_EXPECT_F(((id)keys[idx])->isa != encodeState->fastClassLookup.stringClass) && JK_EXPECT_F([(id)keys[idx] isKindOfClass:[NSString class]] == NO)) { jk_encode_error(encodeState, @\"Key must be a string object.\"); return(1); }\n            if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, keys[idx])))    { return(1); }\n            if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, \":\")))                  { return(1); }\n            if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, objects[idx]))) { return(1); }\n          }\n        }\n        return(jk_encode_write1(encodeState, -1L, \"}\"));\n      }\n      break;\n\n    case JKClassNull: return(jk_encode_writen(encodeState, cacheSlot, startingAtIndex, encodeCacheObject, \"null\", 4UL)); break;\n\n    default: jk_encode_error(encodeState, @\"Unable to serialize object class %@.\", NSStringFromClass([object class])); return(1); break;\n  }\n\n  return(0);\n}\n\n\n@implementation JKSerializer\n\n+ (id)serializeObject:(id)object options:(JKSerializeOptionFlags)optionFlags encodeOption:(JKEncodeOptionType)encodeOption block:(JKSERIALIZER_BLOCKS_PROTO)block delegate:(id)delegate selector:(SEL)selector error:(NSError **)error\n{\n  return([[[[self alloc] init] autorelease] serializeObject:object options:optionFlags encodeOption:encodeOption block:block delegate:delegate selector:selector error:error]);\n}\n\n- (id)serializeObject:(id)object options:(JKSerializeOptionFlags)optionFlags encodeOption:(JKEncodeOptionType)encodeOption block:(JKSERIALIZER_BLOCKS_PROTO)block delegate:(id)delegate selector:(SEL)selector error:(NSError **)error\n{\n#ifndef __BLOCKS__\n#pragma unused(block)\n#endif\n  NSParameterAssert((object != NULL) && (encodeState == NULL) && ((delegate != NULL) ? (block == NULL) : 1) && ((block != NULL) ? (delegate == NULL) : 1) &&\n                    (((encodeOption & JKEncodeOptionCollectionObj) != 0UL) ? (((encodeOption & JKEncodeOptionStringObj)     == 0UL) && ((encodeOption & JKEncodeOptionStringObjTrimQuotes) == 0UL)) : 1) &&\n                    (((encodeOption & JKEncodeOptionStringObj)     != 0UL) ?  ((encodeOption & JKEncodeOptionCollectionObj) == 0UL)                                                                 : 1));\n\n  id returnObject = NULL;\n\n  if(encodeState != NULL) { [self releaseState]; }\n  if((encodeState = (struct JKEncodeState *)calloc(1UL, sizeof(JKEncodeState))) == NULL) { [NSException raise:NSMallocException format:@\"Unable to allocate state structure.\"]; return(NULL); }\n\n  if((error != NULL) && (*error != NULL)) { *error = NULL; }\n\n  if(delegate != NULL) {\n    if(selector                               == NULL) { [NSException raise:NSInvalidArgumentException format:@\"The delegate argument is not NULL, but the selector argument is NULL.\"]; }\n    if([delegate respondsToSelector:selector] == NO)   { [NSException raise:NSInvalidArgumentException format:@\"The serializeUnsupportedClassesUsingDelegate: delegate does not respond to the selector argument.\"]; }\n    encodeState->classFormatterDelegate = delegate;\n    encodeState->classFormatterSelector = selector;\n    encodeState->classFormatterIMP      = (JKClassFormatterIMP)[delegate methodForSelector:selector];\n    NSCParameterAssert(encodeState->classFormatterIMP != NULL);\n  }\n\n#ifdef __BLOCKS__\n  encodeState->classFormatterBlock                          = block;\n#endif\n  encodeState->serializeOptionFlags                         = optionFlags;\n  encodeState->encodeOption                                 = encodeOption;\n  encodeState->stringBuffer.roundSizeUpToMultipleOf         = (1024UL * 32UL);\n  encodeState->utf8ConversionBuffer.roundSizeUpToMultipleOf = 4096UL;\n    \n  unsigned char stackJSONBuffer[JK_JSONBUFFER_SIZE] JK_ALIGNED(64);\n  jk_managedBuffer_setToStackBuffer(&encodeState->stringBuffer,         stackJSONBuffer, sizeof(stackJSONBuffer));\n\n  unsigned char stackUTF8Buffer[JK_UTF8BUFFER_SIZE] JK_ALIGNED(64);\n  jk_managedBuffer_setToStackBuffer(&encodeState->utf8ConversionBuffer, stackUTF8Buffer, sizeof(stackUTF8Buffer));\n\n  if(((encodeOption & JKEncodeOptionCollectionObj) != 0UL) && (([object isKindOfClass:[NSArray  class]] == NO) && ([object isKindOfClass:[NSDictionary class]] == NO))) { jk_encode_error(encodeState, @\"Unable to serialize object class %@, expected a NSArray or NSDictionary.\", NSStringFromClass([object class])); goto errorExit; }\n  if(((encodeOption & JKEncodeOptionStringObj)     != 0UL) &&  ([object isKindOfClass:[NSString class]] == NO))                                                         { jk_encode_error(encodeState, @\"Unable to serialize object class %@, expected a NSString.\", NSStringFromClass([object class])); goto errorExit; }\n\n  if(jk_encode_add_atom_to_buffer(encodeState, object) == 0) {\n    BOOL stackBuffer = ((encodeState->stringBuffer.flags & JKManagedBufferMustFree) == 0UL) ? YES : NO;\n    \n    if((encodeState->atIndex < 2UL))\n    if((stackBuffer == NO) && ((encodeState->stringBuffer.bytes.ptr = (unsigned char *)reallocf(encodeState->stringBuffer.bytes.ptr, encodeState->atIndex + 16UL)) == NULL)) { jk_encode_error(encodeState, @\"Unable to realloc buffer\"); goto errorExit; }\n\n    switch((encodeOption & JKEncodeOptionAsTypeMask)) {\n      case JKEncodeOptionAsData:\n        if(stackBuffer == YES) { if((returnObject = [(id)CFDataCreate(                 NULL,                encodeState->stringBuffer.bytes.ptr, (CFIndex)encodeState->atIndex)                                  autorelease]) == NULL) { jk_encode_error(encodeState, @\"Unable to create NSData object\"); } }\n        else                   { if((returnObject = [(id)CFDataCreateWithBytesNoCopy(  NULL,                encodeState->stringBuffer.bytes.ptr, (CFIndex)encodeState->atIndex, NULL)                            autorelease]) == NULL) { jk_encode_error(encodeState, @\"Unable to create NSData object\"); } }\n        break;\n\n      case JKEncodeOptionAsString:\n        if(stackBuffer == YES) { if((returnObject = [(id)CFStringCreateWithBytes(      NULL, (const UInt8 *)encodeState->stringBuffer.bytes.ptr, (CFIndex)encodeState->atIndex, kCFStringEncodingUTF8, NO)       autorelease]) == NULL) { jk_encode_error(encodeState, @\"Unable to create NSString object\"); } }\n        else                   { if((returnObject = [(id)CFStringCreateWithBytesNoCopy(NULL, (const UInt8 *)encodeState->stringBuffer.bytes.ptr, (CFIndex)encodeState->atIndex, kCFStringEncodingUTF8, NO, NULL) autorelease]) == NULL) { jk_encode_error(encodeState, @\"Unable to create NSString object\"); } }\n        break;\n\n      default: jk_encode_error(encodeState, @\"Unknown encode as type.\"); break;\n    }\n\n    if((returnObject != NULL) && (stackBuffer == NO)) { encodeState->stringBuffer.flags &= ~JKManagedBufferMustFree; encodeState->stringBuffer.bytes.ptr = NULL; encodeState->stringBuffer.bytes.length = 0UL; }\n  }\n\nerrorExit:\n  if((encodeState != NULL) && (error != NULL) && (encodeState->error != NULL)) { *error = encodeState->error; encodeState->error = NULL; }\n  [self releaseState];\n\n  return(returnObject);\n}\n\n- (void)releaseState\n{\n  if(encodeState != NULL) {\n    jk_managedBuffer_release(&encodeState->stringBuffer);\n    jk_managedBuffer_release(&encodeState->utf8ConversionBuffer);\n    free(encodeState); encodeState = NULL;\n  }  \n}\n\n- (void)dealloc\n{\n  [self releaseState];\n  [super dealloc];\n}\n\n@end\n\n@implementation NSString (JSONKitSerializing)\n\n////////////\n#pragma mark Methods for serializing a single NSString.\n////////////\n\n// Useful for those who need to serialize just a NSString.  Otherwise you would have to do something like [NSArray arrayWithObject:stringToBeJSONSerialized], serializing the array, and then chopping of the extra ^\\[.*\\]$ square brackets.\n\n// NSData returning methods...\n\n- (NSData *)JSONData\n{\n  return([self JSONDataWithOptions:JKSerializeOptionNone includeQuotes:YES error:NULL]);\n}\n\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsData | ((includeQuotes == NO) ? JKEncodeOptionStringObjTrimQuotes : 0UL) | JKEncodeOptionStringObj) block:NULL delegate:NULL selector:NULL error:error]);\n}\n\n// NSString returning methods...\n\n- (NSString *)JSONString\n{\n  return([self JSONStringWithOptions:JKSerializeOptionNone includeQuotes:YES error:NULL]);\n}\n\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions includeQuotes:(BOOL)includeQuotes error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsString | ((includeQuotes == NO) ? JKEncodeOptionStringObjTrimQuotes : 0UL) | JKEncodeOptionStringObj) block:NULL delegate:NULL selector:NULL error:error]);\n}\n\n@end\n\n@implementation NSArray (JSONKitSerializing)\n\n// NSData returning methods...\n\n- (NSData *)JSONData\n{\n  return([JKSerializer serializeObject:self options:JKSerializeOptionNone encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:NULL]);\n}\n\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:error]);\n}\n\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:NULL delegate:delegate selector:selector error:error]);\n}\n\n// NSString returning methods...\n\n- (NSString *)JSONString\n{\n  return([JKSerializer serializeObject:self options:JKSerializeOptionNone encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:NULL]);\n}\n\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:error]);\n}\n\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:NULL delegate:delegate selector:selector error:error]);\n}\n\n@end\n\n@implementation NSDictionary (JSONKitSerializing)\n\n// NSData returning methods...\n\n- (NSData *)JSONData\n{\n  return([JKSerializer serializeObject:self options:JKSerializeOptionNone encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:NULL]);\n}\n\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:error]);\n}\n\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:NULL delegate:delegate selector:selector error:error]);\n}\n\n// NSString returning methods...\n\n- (NSString *)JSONString\n{\n  return([JKSerializer serializeObject:self options:JKSerializeOptionNone encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:NULL]);\n}\n\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:NULL delegate:NULL selector:NULL error:error]);\n}\n\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingDelegate:(id)delegate selector:(SEL)selector error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:NULL delegate:delegate selector:selector error:error]);\n}\n\n@end\n\n\n#ifdef __BLOCKS__\n\n@implementation NSArray (JSONKitSerializingBlockAdditions)\n\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:block delegate:NULL selector:NULL error:error]);\n}\n\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:block delegate:NULL selector:NULL error:error]);\n}\n\n@end\n\n@implementation NSDictionary (JSONKitSerializingBlockAdditions)\n\n- (NSData *)JSONDataWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsData | JKEncodeOptionCollectionObj) block:block delegate:NULL selector:NULL error:error]);\n}\n\n- (NSString *)JSONStringWithOptions:(JKSerializeOptionFlags)serializeOptions serializeUnsupportedClassesUsingBlock:(id(^)(id object))block error:(NSError **)error\n{\n  return([JKSerializer serializeObject:self options:serializeOptions encodeOption:(JKEncodeOptionAsString | JKEncodeOptionCollectionObj) block:block delegate:NULL selector:NULL error:error]);\n}\n\n@end\n\n#endif // __BLOCKS__\n\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/PluginWeibo.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tFAC2A7FD1777F99900035D22 /* ShareWeibo.m in Sources */ = {isa = PBXBuildFile; fileRef = FAC2A7FC1777F99900035D22 /* ShareWeibo.m */; };\n\t\tFAE27534175D9D2900F5DA8E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE27533175D9D2900F5DA8E /* Foundation.framework */; };\n\t\tFAE27561175DC52900F5DA8E /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE27557175DC52900F5DA8E /* JSONKit.m */; };\n\t\tFAE27562175DC52900F5DA8E /* SinaWeibo.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE2755B175DC52900F5DA8E /* SinaWeibo.m */; };\n\t\tFAE27563175DC52900F5DA8E /* SinaWeiboAuthorizeView.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE2755D175DC52900F5DA8E /* SinaWeiboAuthorizeView.m */; };\n\t\tFAE27564175DC52900F5DA8E /* SinaWeiboRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = FAE27560175DC52900F5DA8E /* SinaWeiboRequest.m */; };\n\t\tFAE2756E175DD1E700F5DA8E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE2756D175DD1E700F5DA8E /* UIKit.framework */; };\n\t\tFAE27570175DD1F500F5DA8E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE2756F175DD1F500F5DA8E /* CoreGraphics.framework */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tFAE2752E175D9D2900F5DA8E /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/${PRODUCT_NAME}\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\tFAC2A7FB1777F99900035D22 /* ShareWeibo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareWeibo.h; sourceTree = \"<group>\"; };\n\t\tFAC2A7FC1777F99900035D22 /* ShareWeibo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShareWeibo.m; sourceTree = \"<group>\"; };\n\t\tFAE27530175D9D2900F5DA8E /* libPluginWeibo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPluginWeibo.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFAE27533175D9D2900F5DA8E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\tFAE27556175DC52900F5DA8E /* JSONKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSONKit.h; sourceTree = \"<group>\"; };\n\t\tFAE27557175DC52900F5DA8E /* JSONKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSONKit.m; sourceTree = \"<group>\"; };\n\t\tFAE27559175DC52900F5DA8E /* SinaWeibo.bundle */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.plug-in\"; path = SinaWeibo.bundle; sourceTree = \"<group>\"; };\n\t\tFAE2755A175DC52900F5DA8E /* SinaWeibo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SinaWeibo.h; sourceTree = \"<group>\"; };\n\t\tFAE2755B175DC52900F5DA8E /* SinaWeibo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SinaWeibo.m; sourceTree = \"<group>\"; };\n\t\tFAE2755C175DC52900F5DA8E /* SinaWeiboAuthorizeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SinaWeiboAuthorizeView.h; sourceTree = \"<group>\"; };\n\t\tFAE2755D175DC52900F5DA8E /* SinaWeiboAuthorizeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SinaWeiboAuthorizeView.m; sourceTree = \"<group>\"; };\n\t\tFAE2755E175DC52900F5DA8E /* SinaWeiboConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SinaWeiboConstants.h; sourceTree = \"<group>\"; };\n\t\tFAE2755F175DC52900F5DA8E /* SinaWeiboRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SinaWeiboRequest.h; sourceTree = \"<group>\"; };\n\t\tFAE27560175DC52900F5DA8E /* SinaWeiboRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SinaWeiboRequest.m; sourceTree = \"<group>\"; };\n\t\tFAE2756D175DD1E700F5DA8E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };\n\t\tFAE2756F175DD1F500F5DA8E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tFAE2752D175D9D2900F5DA8E /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFAE27570175DD1F500F5DA8E /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tFAE2756E175DD1E700F5DA8E /* UIKit.framework in Frameworks */,\n\t\t\t\tFAE27534175D9D2900F5DA8E /* Foundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tFAE27525175D9D2900F5DA8E = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAC2A7FB1777F99900035D22 /* ShareWeibo.h */,\n\t\t\t\tFAC2A7FC1777F99900035D22 /* ShareWeibo.m */,\n\t\t\t\tFAE27555175DC52900F5DA8E /* JSONKit */,\n\t\t\t\tFAE27558175DC52900F5DA8E /* SinaWeibo */,\n\t\t\t\tFAE27532175D9D2900F5DA8E /* Frameworks */,\n\t\t\t\tFAE27531175D9D2900F5DA8E /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAE27531175D9D2900F5DA8E /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAE27530175D9D2900F5DA8E /* libPluginWeibo.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAE27532175D9D2900F5DA8E /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAE2756F175DD1F500F5DA8E /* CoreGraphics.framework */,\n\t\t\t\tFAE2756D175DD1E700F5DA8E /* UIKit.framework */,\n\t\t\t\tFAE27533175D9D2900F5DA8E /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAE27555175DC52900F5DA8E /* JSONKit */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAE27556175DC52900F5DA8E /* JSONKit.h */,\n\t\t\t\tFAE27557175DC52900F5DA8E /* JSONKit.m */,\n\t\t\t);\n\t\t\tpath = JSONKit;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAE27558175DC52900F5DA8E /* SinaWeibo */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAE27559175DC52900F5DA8E /* SinaWeibo.bundle */,\n\t\t\t\tFAE2755A175DC52900F5DA8E /* SinaWeibo.h */,\n\t\t\t\tFAE2755B175DC52900F5DA8E /* SinaWeibo.m */,\n\t\t\t\tFAE2755C175DC52900F5DA8E /* SinaWeiboAuthorizeView.h */,\n\t\t\t\tFAE2755D175DC52900F5DA8E /* SinaWeiboAuthorizeView.m */,\n\t\t\t\tFAE2755E175DC52900F5DA8E /* SinaWeiboConstants.h */,\n\t\t\t\tFAE2755F175DC52900F5DA8E /* SinaWeiboRequest.h */,\n\t\t\t\tFAE27560175DC52900F5DA8E /* SinaWeiboRequest.m */,\n\t\t\t);\n\t\t\tpath = SinaWeibo;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tFAE2752F175D9D2900F5DA8E /* PluginWeibo */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = FAE2753E175D9D2B00F5DA8E /* Build configuration list for PBXNativeTarget \"PluginWeibo\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tFAE2752C175D9D2900F5DA8E /* Sources */,\n\t\t\t\tFAE2752D175D9D2900F5DA8E /* Frameworks */,\n\t\t\t\tFAE2752E175D9D2900F5DA8E /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = PluginWeibo;\n\t\t\tproductName = PluginWeibo;\n\t\t\tproductReference = FAE27530175D9D2900F5DA8E /* libPluginWeibo.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tFAE27527175D9D2900F5DA8E /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0460;\n\t\t\t\tORGANIZATIONNAME = zhangbin;\n\t\t\t};\n\t\t\tbuildConfigurationList = FAE2752A175D9D2900F5DA8E /* Build configuration list for PBXProject \"PluginWeibo\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = FAE27525175D9D2900F5DA8E;\n\t\t\tproductRefGroup = FAE27531175D9D2900F5DA8E /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tFAE2752F175D9D2900F5DA8E /* PluginWeibo */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tFAE2752C175D9D2900F5DA8E /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFAE27561175DC52900F5DA8E /* JSONKit.m in Sources */,\n\t\t\t\tFAE27562175DC52900F5DA8E /* SinaWeibo.m in Sources */,\n\t\t\t\tFAE27563175DC52900F5DA8E /* SinaWeiboAuthorizeView.m in Sources */,\n\t\t\t\tFAE27564175DC52900F5DA8E /* SinaWeiboRequest.m in Sources */,\n\t\t\t\tFAC2A7FD1777F99900035D22 /* ShareWeibo.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\tFAE2753C175D9D2B00F5DA8E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFAE2753D175D9D2B00F5DA8E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tFAE2753F175D9D2B00F5DA8E /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/PluginWeibo.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginWeibo-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFAE27540175D9D2B00F5DA8E /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"compiler-default\";\n\t\t\t\tDSTROOT = /tmp/PluginWeibo.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = \"compiler-default\";\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginWeibo-Prefix.pch\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"$(SRCROOT)/../../../protocols/platform/ios\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tFAE2752A175D9D2900F5DA8E /* Build configuration list for PBXProject \"PluginWeibo\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFAE2753C175D9D2B00F5DA8E /* Debug */,\n\t\t\t\tFAE2753D175D9D2B00F5DA8E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tFAE2753E175D9D2B00F5DA8E /* Build configuration list for PBXNativeTarget \"PluginWeibo\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFAE2753F175D9D2B00F5DA8E /* Debug */,\n\t\t\t\tFAE27540175D9D2B00F5DA8E /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = FAE27527175D9D2900F5DA8E /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/ShareWeibo.h",
    "content": "/****************************************************************************\n Copyright (c) 2012-2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"InterfaceShare.h\"\n#import \"SinaWeibo.h\"\n#import \"SinaWeiboRequest.h\"\n\n@interface ShareWeibo : NSObject <InterfaceShare, SinaWeiboDelegate, SinaWeiboRequestDelegate>\n{\n    SinaWeibo *sinaweibo;\n}\n\n@property (copy, nonatomic) NSMutableDictionary* mShareInfo;\n@property (readonly, nonatomic) SinaWeibo *sinaweibo;\n@property BOOL debug;\n\n/**\n methods of protocol : InterfaceShare\n */\n- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;\n- (void) share: (NSMutableDictionary*) shareInfo;\n- (void) setDebugMode: (BOOL) debug;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n/**\n methods of protocol : SinaWeiboDelegate\n */\n- (void)sinaweiboDidLogIn:(SinaWeibo *)sinaweibo;\n- (void)sinaweiboDidLogOut:(SinaWeibo *)sinaweibo;\n- (void)sinaweiboLogInDidCancel:(SinaWeibo *)sinaweibo;\n- (void)sinaweibo:(SinaWeibo *)sinaweibo logInDidFailWithError:(NSError *)error;\n- (void)sinaweibo:(SinaWeibo *)sinaweibo accessTokenInvalidOrExpired:(NSError *)error;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/ShareWeibo.m",
    "content": "/****************************************************************************\n Copyright (c) 2012-2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"ShareWeibo.h\"\n#import \"ShareWrapper.h\"\n#import \"SinaWeibo/SinaWeiboConstants.h\"\n\n#define OUTPUT_LOG(...)     if (self.debug) NSLog(__VA_ARGS__);\n\n@implementation ShareWeibo\n\n@synthesize mShareInfo;\n@synthesize sinaweibo;\n@synthesize debug = __debug;\n\n- (void)dealloc\n{\n    if (sinaweibo) {\n        [sinaweibo release];\n        sinaweibo = nil;\n    }\n\n    [super dealloc];\n}\n\n#pragma mark - InterfaceShare \n\n- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo\n{\n    OUTPUT_LOG(@\"configDeveloperInfo invoked (%@)\", [cpInfo description]);\n    \n    if (! sinaweibo) {\n        NSString* appKey = (NSString*) [cpInfo objectForKey:@\"WeiboAppKey\"];\n        NSString* appSecret = (NSString*) [cpInfo objectForKey:@\"WeiboAppSecret\"];\n        NSString* appUrl = (NSString*) [cpInfo objectForKey:@\"WeiboRedirectUrl\"];\n\n        sinaweibo = [[SinaWeibo alloc] initWithAppKey:appKey appSecret:appSecret appRedirectURI:appUrl andDelegate: self];\n    }\n}\n\n- (void) share: (NSMutableDictionary*) shareInfo\n{\n    OUTPUT_LOG(@\"share invoked (%@)\", [shareInfo description]);\n    assert(sinaweibo != nil);\n\n    self.mShareInfo = shareInfo;\n    BOOL authValid = sinaweibo.isAuthValid;\n    if (! authValid) {\n        [sinaweibo logIn];\n    } else {\n        [self doShare];\n    }\n}\n\n- (void) doShare\n{\n    NSString* strText = [mShareInfo objectForKey:@\"SharedText\"];\n    NSString* strImgPath = [mShareInfo objectForKey:@\"SharedImagePath\"];\n\n    if (nil == strImgPath) {\n        [sinaweibo requestWithURL:@\"statuses/update.json\"\n                           params:[NSMutableDictionary dictionaryWithObjectsAndKeys:strText, @\"status\", nil]\n                       httpMethod:@\"POST\"\n                         delegate:self];\n    } else {\n        [sinaweibo requestWithURL:@\"statuses/upload.json\"\n                           params:[NSMutableDictionary dictionaryWithObjectsAndKeys:\n                                   strText, @\"status\",\n                                   [UIImage imageNamed:strImgPath], @\"pic\", nil]\n                       httpMethod:@\"POST\"\n                         delegate:self];\n    }\n}\n\n- (void) setDebugMode: (BOOL) debug\n{\n    self.debug = debug;\n}\n\n- (NSString*) getSDKVersion\n{\n    return SinaWeiboSdkVersion;\n}\n\n- (NSString*) getPluginVersion\n{\n    return @\"0.2.0\";\n}\n\n#pragma mark - SinaWeibo Delegate\n\n- (void)storeAuthData\n{\n    NSDictionary *authData = [NSDictionary dictionaryWithObjectsAndKeys:\n                              sinaweibo.accessToken, @\"AccessTokenKey\",\n                              sinaweibo.expirationDate, @\"ExpirationDateKey\",\n                              sinaweibo.userID, @\"UserIDKey\",\n                              sinaweibo.refreshToken, @\"refresh_token\", nil];\n    [[NSUserDefaults standardUserDefaults] setObject:authData forKey:@\"SinaWeiboAuthData\"];\n    [[NSUserDefaults standardUserDefaults] synchronize];\n}\n\n- (void)removeAuthData\n{\n    [[NSUserDefaults standardUserDefaults] removeObjectForKey:@\"SinaWeiboAuthData\"];\n}\n\n- (void)sinaweiboDidLogIn:(SinaWeibo *)weibo\n{\n    OUTPUT_LOG(@\"sinaweiboDidLogIn userID = %@ accesstoken = %@ expirationDate = %@ refresh_token = %@\",\n               weibo.userID, weibo.accessToken, weibo.expirationDate,weibo.refreshToken);\n\n    [self storeAuthData];\n\n    if (nil != mShareInfo) {\n        [self doShare];\n    }\n}\n\n- (void)sinaweiboDidLogOut:(SinaWeibo *)sinaweibo\n{\n    OUTPUT_LOG(@\"sinaweiboDidLogOut\");\n    [self removeAuthData];\n}\n\n- (void)sinaweiboLogInDidCancel:(SinaWeibo *)sinaweibo\n{\n    OUTPUT_LOG(@\"sinaweiboLogInDidCancel\");\n    [ShareWrapper onShareResult:self withRet:kShareCancel withMsg:@\"User Canceled\"];\n}\n\n- (void)sinaweibo:(SinaWeibo *)sinaweibo logInDidFailWithError:(NSError *)error\n{\n    OUTPUT_LOG(@\"sinaweibo logInDidFailWithError %@\", error);\n    [ShareWrapper onShareResult:self withRet:kShareFail withMsg:[error description]];\n}\n\n- (void)sinaweibo:(SinaWeibo *)sinaweibo accessTokenInvalidOrExpired:(NSError *)error\n{\n    OUTPUT_LOG(@\"sinaweiboAccessTokenInvalidOrExpired %@\", error);\n    [self removeAuthData];\n    [ShareWrapper onShareResult:self withRet:kShareFail withMsg:[error description]];\n}\n\n#pragma mark - SinaWeiboRequest Delegate\n\n- (void)request:(SinaWeiboRequest *)request didFailWithError:(NSError *)error\n{\n    if ([request.url hasSuffix:@\"statuses/update.json\"] ||\n        [request.url hasSuffix:@\"statuses/upload.json\"])\n    {\n        [ShareWrapper onShareResult:self withRet:kShareFail withMsg:[error description]];\n    }\n}\n\n- (void)request:(SinaWeiboRequest *)request didFinishLoadingWithResult:(id)result\n{\n    if ([request.url hasSuffix:@\"statuses/update.json\"] ||\n        [request.url hasSuffix:@\"statuses/upload.json\"])\n    {\n        [ShareWrapper onShareResult:self withRet:kShareSuccess withMsg:@\"Share Success\"];\n    }\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeibo.h",
    "content": "//\n//  SinaWeibo.h\n//  sinaweibo_ios_sdk\n//\n//  Created by Wade Cheng on 4/19/12.\n//  Copyright (c) 2012 SINA. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import \"SinaWeiboAuthorizeView.h\"\n#import \"SinaWeiboRequest.h\"\n\n@protocol SinaWeiboDelegate;\n\n@interface SinaWeibo : NSObject <SinaWeiboAuthorizeViewDelegate, SinaWeiboRequestDelegate>\n{\n    NSString *userID;\n    NSString *accessToken;\n    NSDate *expirationDate;\n    id<SinaWeiboDelegate> delegate;\n    \n    NSString *appKey;\n    NSString *appSecret;\n    NSString *appRedirectURI;\n    NSString *ssoCallbackScheme;\n    \n    SinaWeiboRequest *request;\n    NSMutableSet *requests;\n    BOOL ssoLoggingIn;\n}\n\n@property (nonatomic, copy) NSString *userID;\n@property (nonatomic, copy) NSString *accessToken;\n@property (nonatomic, copy) NSDate *expirationDate;\n@property (nonatomic, copy) NSString *refreshToken;\n@property (nonatomic, copy) NSString *ssoCallbackScheme;\n@property (nonatomic, assign) id<SinaWeiboDelegate> delegate;\n\n- (id)initWithAppKey:(NSString *)appKey appSecret:(NSString *)appSecrect\n      appRedirectURI:(NSString *)appRedirectURI\n         andDelegate:(id<SinaWeiboDelegate>)delegate;\n\n- (id)initWithAppKey:(NSString *)appKey appSecret:(NSString *)appSecrect\n      appRedirectURI:(NSString *)appRedirectURI\n   ssoCallbackScheme:(NSString *)ssoCallbackScheme\n         andDelegate:(id<SinaWeiboDelegate>)delegate;\n\n- (void)applicationDidBecomeActive;\n- (BOOL)handleOpenURL:(NSURL *)url;\n\n// Log in using OAuth Web authorization.\n// If succeed, sinaweiboDidLogIn will be called.\n- (void)logIn;\n\n// Log out.\n// If succeed, sinaweiboDidLogOut will be called.\n- (void)logOut;\n\n// Check if user has logged in, or the authorization is expired.\n- (BOOL)isLoggedIn;\n- (BOOL)isAuthorizeExpired;\n\n\n// isLoggedIn && isAuthorizeExpired\n- (BOOL)isAuthValid;\n\n- (SinaWeiboRequest*)requestWithURL:(NSString *)url\n                             params:(NSMutableDictionary *)params\n                         httpMethod:(NSString *)httpMethod\n                           delegate:(id<SinaWeiboRequestDelegate>)delegate;\n\n@end\n\n\n/**\n * @description 第三方应用需实现此协议，登录时传入此类对象，用于完成登录结果的回调\n */\n@protocol SinaWeiboDelegate <NSObject>\n\n@optional\n\n- (void)sinaweiboDidLogIn:(SinaWeibo *)sinaweibo;\n- (void)sinaweiboDidLogOut:(SinaWeibo *)sinaweibo;\n- (void)sinaweiboLogInDidCancel:(SinaWeibo *)sinaweibo;\n- (void)sinaweibo:(SinaWeibo *)sinaweibo logInDidFailWithError:(NSError *)error;\n- (void)sinaweibo:(SinaWeibo *)sinaweibo accessTokenInvalidOrExpired:(NSError *)error;\n\n@end\n\nextern BOOL SinaWeiboIsDeviceIPad();\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeibo.m",
    "content": "//\n//  SinaWeibo.m\n//  sinaweibo_ios_sdk\n//\n//  Created by Wade Cheng on 4/19/12.\n//  Copyright (c) 2012 SINA. All rights reserved.\n//\n\n#import \"SinaWeibo.h\"\n#import \"SinaWeiboRequest.h\"\n#import \"SinaWeiboAuthorizeView.h\"\n#import \"SinaWeiboConstants.h\"\n\n@interface SinaWeibo ()\n\n@property (nonatomic, copy) NSString *appKey;\n@property (nonatomic, copy) NSString *appSecret;\n@property (nonatomic, copy) NSString *appRedirectURI;\n\n@end\n\n@implementation SinaWeibo\n\n@synthesize userID;\n@synthesize accessToken;\n@synthesize expirationDate;\n@synthesize refreshToken;\n@synthesize ssoCallbackScheme;\n@synthesize delegate;\n@synthesize appKey;\n@synthesize appSecret;\n@synthesize appRedirectURI;\n\n#pragma mark - Memory management\n\n/**\n * @description 初始化构造函数，返回采用默认sso回调地址构造的SinaWeibo对象\n * @param _appKey: 分配给第三方应用的appkey\n * @param _appSecrect: 分配给第三方应用的appsecrect\n * @param _appRedirectURI: 微博开放平台中授权设置的应用回调页\n * @return SinaWeibo对象\n */\n- (id)initWithAppKey:(NSString *)_appKey appSecret:(NSString *)_appSecrect\n      appRedirectURI:(NSString *)_appRedirectURI\n         andDelegate:(id<SinaWeiboDelegate>)_delegate\n{\n    return [self initWithAppKey:_appKey appSecret:_appSecrect appRedirectURI:_appRedirectURI ssoCallbackScheme:nil andDelegate:_delegate];\n}\n\n\n/**\n * @description 初始化构造函数，返回采用默认sso回调地址构造的SinaWeibo对象\n * @param _appKey: 分配给第三方应用的appkey\n * @param _appSecrect: 分配给第三方应用的appsecrect\n * @param _ssoCallbackScheme: sso回调地址，此值应与URL Types中定义的保持一致\n *            若为nil,则初始化为默认格式 sinaweibosso.your_app_key;\n * @param _appRedirectURI: 微博开放平台中授权设置的应用回调页\n * @return SinaWeibo对象\n */\n- (id)initWithAppKey:(NSString *)_appKey appSecret:(NSString *)_appSecrect\n      appRedirectURI:(NSString *)_appRedirectURI\n   ssoCallbackScheme:(NSString *)_ssoCallbackScheme\n         andDelegate:(id<SinaWeiboDelegate>)_delegate\n{\n    if ((self = [super init]))\n    {\n        self.appKey = _appKey;\n        self.appSecret = _appSecrect;\n        self.appRedirectURI = _appRedirectURI;\n        self.delegate = _delegate;\n        \n        if (!_ssoCallbackScheme)\n        {\n            _ssoCallbackScheme = [NSString stringWithFormat:@\"sinaweibosso.%@://\", self.appKey];\n        }\n        self.ssoCallbackScheme = _ssoCallbackScheme;\n        \n        requests = [[NSMutableSet alloc] init];\n    }\n    \n    return self;\n}\n\n- (void)dealloc\n{\n    delegate = nil;\n    \n    for (SinaWeiboRequest* _request in requests)\n    {\n        _request.sinaweibo = nil;\n    }\n    \n    [request disconnect];\n    [request release], request = nil;\n    [userID release], userID = nil;\n    [accessToken release], accessToken = nil;\n    [expirationDate release], expirationDate = nil;\n    [appKey release], appKey = nil;\n    [appSecret release], appSecret = nil;\n    [appRedirectURI release], appRedirectURI = nil;\n    [ssoCallbackScheme release], ssoCallbackScheme = nil;\n    \n    [super dealloc];\n}\n\n/**\n * @description 清空认证信息\n */\n- (void)removeAuthData\n{\n    self.accessToken = nil;\n    self.userID = nil;\n    self.expirationDate = nil;\n    \n    NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];\n    NSArray* sinaweiboCookies = [cookies cookiesForURL:\n                                [NSURL URLWithString:@\"https://open.weibo.cn\"]];\n    \n    for (NSHTTPCookie* cookie in sinaweiboCookies)\n    {\n        [cookies deleteCookie:cookie];\n    }\n}\n\n#pragma mark - Private methods\n\n- (void)requestAccessTokenWithAuthorizationCode:(NSString *)code\n{\n    NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:\n                            self.appKey, @\"client_id\",\n                            self.appSecret, @\"client_secret\",\n                            @\"authorization_code\", @\"grant_type\",\n                            self.appRedirectURI, @\"redirect_uri\",\n                            code, @\"code\", nil];\n    [request disconnect];\n    [request release], request = nil;\n    \n    request = [[SinaWeiboRequest requestWithURL:kSinaWeiboWebAccessTokenURL\n                                     httpMethod:@\"POST\"\n                                         params:params\n                                       delegate:self] retain];\n    \n    [request connect];\n}\n\n- (void)requestDidFinish:(SinaWeiboRequest *)_request\n{\n    [requests removeObject:_request];\n    _request.sinaweibo = nil;\n}\n\n- (void)requestDidFailWithInvalidToken:(NSError *)error\n{\n    if ([delegate respondsToSelector:@selector(sinaweibo:accessTokenInvalidOrExpired:)])\n    {\n        [delegate sinaweibo:self accessTokenInvalidOrExpired:error];\n    }\n}\n\n- (void)notifyTokenExpired:(id<SinaWeiboRequestDelegate>)requestDelegate\n{\n    NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:\n                              @\"Token expired\", NSLocalizedDescriptionKey, nil];\n    \n    NSError *error = [NSError errorWithDomain:kSinaWeiboSDKErrorDomain\n                                         code:21315\n                                     userInfo:userInfo];\n    \n    if ([delegate respondsToSelector:@selector(sinaweibo:accessTokenInvalidOrExpired:)])\n    {\n        [delegate sinaweibo:self accessTokenInvalidOrExpired:error];\n    }\n    \n    if ([requestDelegate respondsToSelector:@selector(request:didFailWithError:)]) \n\t{\n\t\t[requestDelegate request:nil didFailWithError:error];\n\t}\n}\n\n- (void)logInDidCancel\n{\n    if ([delegate respondsToSelector:@selector(sinaweiboLogInDidCancel:)])\n    {\n        [delegate sinaweiboLogInDidCancel:self];\n    }\n}\n\n- (void)logInDidFinishWithAuthInfo:(NSDictionary *)authInfo\n{\n    NSString *access_token = [authInfo objectForKey:@\"access_token\"];\n    NSString *uid = [authInfo objectForKey:@\"uid\"];\n    NSString *remind_in = [authInfo objectForKey:@\"remind_in\"];\n    NSString *refresh_token = [authInfo objectForKey:@\"refresh_token\"];\n    if (access_token && uid)\n    {\n        if (remind_in != nil)\n        {\n            int expVal = [remind_in intValue];\n            if (expVal == 0)\n            {\n                self.expirationDate = [NSDate distantFuture];\n            }\n            else\n            {\n                self.expirationDate = [NSDate dateWithTimeIntervalSinceNow:expVal];\n            } \n        } \n        \n        self.accessToken = access_token;\n        self.userID = uid;\n        self.refreshToken = refresh_token;\n        \n        if ([delegate respondsToSelector:@selector(sinaweiboDidLogIn:)])\n        {\n            [delegate sinaweiboDidLogIn:self];\n        }\n    }\n}\n\n- (void)logInDidFailWithErrorInfo:(NSDictionary *)errorInfo\n{\n    NSString *error_code = [errorInfo objectForKey:@\"error_code\"];\n    if ([error_code isEqualToString:@\"21330\"])\n    {\n        [self logInDidCancel];\n    }\n    else\n    {\n        if ([delegate respondsToSelector:@selector(sinaweibo:logInDidFailWithError:)])\n        {\n            NSString *error_description = [errorInfo objectForKey:@\"error_description\"];\n            NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:\n                                      errorInfo, @\"error\",\n                                      error_description, NSLocalizedDescriptionKey, nil];\n            NSError *error = [NSError errorWithDomain:kSinaWeiboSDKErrorDomain \n                                                 code:[error_code intValue]\n                                             userInfo:userInfo];\n            [delegate sinaweibo:self logInDidFailWithError:error];\n        }\n        \n    }\n}\n\n#pragma mark - Validation\n\n/**\n * @description 判断是否登录\n * @return YES为已登录；NO为未登录\n */\n- (BOOL)isLoggedIn\n{\n    return userID && accessToken && expirationDate;\n}\n\n/**\n * @description 判断登录是否过期\n * @return YES为已过期；NO为未为期\n */\n- (BOOL)isAuthorizeExpired\n{\n    NSDate *now = [NSDate date];\n    return ([now compare:expirationDate] == NSOrderedDescending);\n}\n\n\n/**\n * @description 判断登录是否有效，当已登录并且登录未过期时为有效状态\n * @return YES为有效；NO为无效\n */\n- (BOOL)isAuthValid\n{\n    return ([self isLoggedIn] && ![self isAuthorizeExpired]);\n}\n\n#pragma mark - LogIn / LogOut\n\n/**\n * @description 登录入口，当初始化SinaWeibo对象完成后直接调用此方法完成登录\n */\n- (void)logIn\n{\n    if ([self isAuthValid])\n    {\n        if ([delegate respondsToSelector:@selector(sinaweiboDidLogIn:)])\n        {\n            [delegate sinaweiboDidLogIn:self];\n        }\n    }\n    else\n    {\n        [self removeAuthData];\n        \n        ssoLoggingIn = NO;\n        \n        // open sina weibo app\n        UIDevice *device = [UIDevice currentDevice];\n        if ([device respondsToSelector:@selector(isMultitaskingSupported)] &&\n            [device isMultitaskingSupported])\n        {\n            NSDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:\n                                    self.appKey, @\"client_id\",\n                                    self.appRedirectURI, @\"redirect_uri\",\n                                    self.ssoCallbackScheme, @\"callback_uri\", nil];\n            \n            // 先用iPad微博打开\n            NSString *appAuthBaseURL = kSinaWeiboAppAuthURL_iPad;\n            if (SinaWeiboIsDeviceIPad())\n            {\n                NSString *appAuthURL = [SinaWeiboRequest serializeURL:appAuthBaseURL\n                                                               params:params httpMethod:@\"GET\"];\n                ssoLoggingIn = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appAuthURL]];\n            }\n            \n            // 在用iPhone微博打开\n            if (!ssoLoggingIn)\n            {\n                appAuthBaseURL = kSinaWeiboAppAuthURL_iPhone;\n                NSString *appAuthURL = [SinaWeiboRequest serializeURL:appAuthBaseURL\n                                                               params:params httpMethod:@\"GET\"];\n                ssoLoggingIn = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appAuthURL]];\n            }\n        }\n        \n        if (!ssoLoggingIn)\n        {\n            // open authorize view\n            \n            NSDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:\n                                    self.appKey, @\"client_id\",\n                                    @\"code\", @\"response_type\",\n                                    self.appRedirectURI, @\"redirect_uri\", \n                                    @\"mobile\", @\"display\", nil];\n            \n            SinaWeiboAuthorizeView *authorizeView = \\\n            [[SinaWeiboAuthorizeView alloc] initWithAuthParams:params\n                                                      delegate:self];\n            [authorizeView show];\n            [authorizeView release];\n        }\n    }\n}\n\n/**\n * @description 退出方法，需要退出时直接调用此方法\n */\n- (void)logOut\n{\n    [self removeAuthData];\n    \n    if ([delegate respondsToSelector:@selector(sinaweiboDidLogOut:)])\n    {\n        [delegate sinaweiboDidLogOut:self];\n    }\n}\n\n#pragma mark - Send request with token\n\n/**\n * @description 微博API的请求接口，方法中自动完成token信息的拼接\n * @param url: 请求的接口\n * @param params: 请求的参数，如发微博所带的文字内容等\n * @param httpMethod: http类型，GET或POST\n * @param _delegate: 处理请求结果的回调的对象，SinaweiboRequestDelegate类\n * @return 完成实际请求操作的SinaWeiboRequest对象\n */\n\n- (SinaWeiboRequest *)requestWithURL:(NSString *)url\n                             params:(NSMutableDictionary *)params\n                         httpMethod:(NSString *)httpMethod\n                           delegate:(id<SinaWeiboRequestDelegate>)_delegate\n{\n    if (params == nil)\n    {\n        params = [NSMutableDictionary dictionary];\n    }\n    \n    if ([self isAuthValid])\n    {\n        [params setValue:self.accessToken forKey:@\"access_token\"];\n        NSString *fullURL = [kSinaWeiboSDKAPIDomain stringByAppendingString:url];\n        \n        SinaWeiboRequest *_request = [SinaWeiboRequest requestWithURL:fullURL\n                                                           httpMethod:httpMethod\n                                                               params:params\n                                                             delegate:_delegate];\n        _request.sinaweibo = self;\n        [requests addObject:_request];\n        [_request connect];\n        return _request;\n    }\n    else\n    {\n        //notify token expired in next runloop\n        [self performSelectorOnMainThread:@selector(notifyTokenExpired:)\n                               withObject:_delegate\n                            waitUntilDone:NO];\n        \n        return nil;\n    }\n}\n\n#pragma mark - SinaWeiboAuthorizeView Delegate\n\n- (void)authorizeView:(SinaWeiboAuthorizeView *)authView didRecieveAuthorizationCode:(NSString *)code\n{\n    [self requestAccessTokenWithAuthorizationCode:code];\n}\n\n- (void)authorizeView:(SinaWeiboAuthorizeView *)authView didFailWithErrorInfo:(NSDictionary *)errorInfo\n{\n    [self logInDidFailWithErrorInfo:errorInfo];\n}\n\n- (void)authorizeViewDidCancel:(SinaWeiboAuthorizeView *)authView\n{\n    [self logInDidCancel];\n}\n\n#pragma mark - SinaWeiboRequest Delegate\n\n- (void)request:(SinaWeiboRequest *)_request didFailWithError:(NSError *)error\n{\n    if (_request == request)\n    {\n        if ([delegate respondsToSelector:@selector(sinaweibo:logInDidFailWithError:)])\n        {\n            [delegate sinaweibo:self logInDidFailWithError:error];\n        }\n        \n        [request release], request = nil;\n    }\n}\n\n- (void)request:(SinaWeiboRequest *)_request didFinishLoadingWithResult:(id)result\n{\n    if (_request == request)\n    {\n        NSLog(@\"access token result = %@\", result);\n        \n        [self logInDidFinishWithAuthInfo:result];\n        [request release], request = nil;\n    }\n}\n\n#pragma mark - Application life cycle\n\n/**\n * @description 当应用从后台唤起时，应调用此方法，需要完成退出当前登录状态的功能\n */\n- (void)applicationDidBecomeActive\n{\n    if (ssoLoggingIn)\n    {\n        // user open the app manually\n        // clean sso login state\n        ssoLoggingIn = NO;\n        \n        if ([delegate respondsToSelector:@selector(sinaweiboLogInDidCancel:)])\n        {\n            [delegate sinaweiboLogInDidCancel:self];\n        }\n    }\n}\n\n/**\n * @description sso回调方法，官方客户端完成sso授权后，回调唤起应用，应用中应调用此方法完成sso登录\n * @param url: 官方客户端回调给应用时传回的参数，包含认证信息等\n * @return YES\n */\n- (BOOL)handleOpenURL:(NSURL *)url\n{\n    NSString *urlString = [url absoluteString];\n    if ([urlString hasPrefix:self.ssoCallbackScheme])\n    {\n        if (!ssoLoggingIn)\n        {\n            // sso callback after user have manually opened the app\n            // ignore the request\n        }\n        else\n        {\n            ssoLoggingIn = NO;\n            \n            if ([SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"sso_error_user_cancelled\"])\n            {\n                if ([delegate respondsToSelector:@selector(sinaweiboLogInDidCancel:)])\n                {\n                    [delegate sinaweiboLogInDidCancel:self];\n                }\n            }\n            else if ([SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"sso_error_invalid_params\"])\n            {\n                if ([delegate respondsToSelector:@selector(sinaweibo:logInDidFailWithError:)])\n                {\n                    NSString *error_description = @\"Invalid sso params\";\n                    NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:\n                                              error_description, NSLocalizedDescriptionKey, nil];\n                    NSError *error = [NSError errorWithDomain:kSinaWeiboSDKErrorDomain \n                                                         code:kSinaWeiboSDKErrorCodeSSOParamsError\n                                                     userInfo:userInfo];\n                    [delegate sinaweibo:self logInDidFailWithError:error];\n                }\n            }\n            else if ([SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"error_code\"])\n            {\n                NSString *error_code = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"error_code\"];\n                NSString *error = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"error\"];\n                NSString *error_uri = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"error_uri\"];\n                NSString *error_description = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"error_description\"];\n                \n                NSDictionary *errorInfo = [NSDictionary dictionaryWithObjectsAndKeys:\n                                           error, @\"error\",\n                                           error_uri, @\"error_uri\",\n                                           error_code, @\"error_code\",\n                                           error_description, @\"error_description\", nil];\n                \n                [self logInDidFailWithErrorInfo:errorInfo];\n            }\n            else\n            {\n                NSString *access_token = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"access_token\"];\n                NSString *expires_in = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"expires_in\"];\n                NSString *remind_in = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"remind_in\"];\n                NSString *uid = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"uid\"];\n                NSString *refresh_token = [SinaWeiboRequest getParamValueFromUrl:urlString paramName:@\"refresh_token\"];\n                \n                NSMutableDictionary *authInfo = [NSMutableDictionary dictionary];\n                if (access_token) [authInfo setObject:access_token forKey:@\"access_token\"];\n                if (expires_in) [authInfo setObject:expires_in forKey:@\"expires_in\"];\n                if (remind_in) [authInfo setObject:remind_in forKey:@\"remind_in\"];\n                if (refresh_token) [authInfo setObject:refresh_token forKey:@\"refresh_token\"];\n                if (uid) [authInfo setObject:uid forKey:@\"uid\"];\n                \n                [self logInDidFinishWithAuthInfo:authInfo];\n            }\n        }\n    }\n    return YES;\n}\n\n@end\n\nBOOL SinaWeiboIsDeviceIPad()\n{\n#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200\n    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)\n    {\n        return YES;\n    }\n#endif\n    return NO;\n}\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboAuthorizeView.h",
    "content": "//\n//  SinaWeiboAuthorizeView.h\n//  sinaweibo_ios_sdk\n//\n//  Created by Wade Cheng on 4/19/12.\n//  Copyright (c) 2012 SINA. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n\n@protocol SinaWeiboAuthorizeViewDelegate;\n\n@interface SinaWeiboAuthorizeView : UIView <UIWebViewDelegate>\n{\n    UIWebView *webView;\n    UIButton *closeButton;\n    UIView *modalBackgroundView;\n    UIActivityIndicatorView *indicatorView;\n    UIInterfaceOrientation previousOrientation;\n    \n    id<SinaWeiboAuthorizeViewDelegate> delegate;\n    \n    NSString *appRedirectURI;\n    NSDictionary *authParams;\n}\n\n@property (nonatomic, assign) id<SinaWeiboAuthorizeViewDelegate> delegate;\n\n- (id)initWithAuthParams:(NSDictionary *)params\n                delegate:(id<SinaWeiboAuthorizeViewDelegate>)delegate;\n\n- (void)show;\n- (void)hide;\n\n@end\n\n@protocol SinaWeiboAuthorizeViewDelegate <NSObject>\n\n- (void)authorizeView:(SinaWeiboAuthorizeView *)authView\n        didRecieveAuthorizationCode:(NSString *)code;\n- (void)authorizeView:(SinaWeiboAuthorizeView *)authView\n        didFailWithErrorInfo:(NSDictionary *)errorInfo;\n- (void)authorizeViewDidCancel:(SinaWeiboAuthorizeView *)authView;\n\n@end"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboAuthorizeView.m",
    "content": "//\n//  SinaWeiboAuthorizeView.m\n//  sinaweibo_ios_sdk\n//\n//  Created by Wade Cheng on 4/19/12.\n//  Copyright (c) 2012 SINA. All rights reserved.\n//\n\n#import \"SinaWeiboAuthorizeView.h\"\n#import \"SinaWeiboRequest.h\"\n#import \"SinaWeibo.h\"\n#import \"SinaWeiboConstants.h\"\n#import <QuartzCore/QuartzCore.h>\n\nstatic CGFloat kBorderGray[4] = {0.3, 0.3, 0.3, 0.8};\nstatic CGFloat kBorderBlack[4] = {0.3, 0.3, 0.3, 1};\nstatic CGFloat kTransitionDuration = 0.3;\nstatic CGFloat kPadding = 0;\nstatic CGFloat kBorderWidth = 10;\n\n@implementation SinaWeiboAuthorizeView\n\n@synthesize delegate;\n\n#pragma mark - Drawing\n\n- (void)addRoundedRectToPath:(CGContextRef)context rect:(CGRect)rect radius:(float)radius\n{\n    CGContextBeginPath(context);\n    CGContextSaveGState(context);\n    \n    if (radius == 0)\n    {\n        CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect));\n        CGContextAddRect(context, rect);\n    }\n    else\n    {\n        rect = CGRectOffset(CGRectInset(rect, 0.5, 0.5), 0.5, 0.5);\n        CGContextTranslateCTM(context, CGRectGetMinX(rect)-0.5, CGRectGetMinY(rect)-0.5);\n        CGContextScaleCTM(context, radius, radius);\n        float fw = CGRectGetWidth(rect) / radius;\n        float fh = CGRectGetHeight(rect) / radius;\n        \n        CGContextMoveToPoint(context, fw, fh/2);\n        CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1);\n        CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1);\n        CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1);\n        CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1);\n    }\n    \n    CGContextClosePath(context);\n    CGContextRestoreGState(context);\n}\n\n- (void)drawRect:(CGRect)rect fill:(const CGFloat*)fillColors radius:(CGFloat)radius\n{\n    CGContextRef context = UIGraphicsGetCurrentContext();\n    CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();\n    \n    if (fillColors)\n    {\n        CGContextSaveGState(context);\n        CGContextSetFillColor(context, fillColors);\n        if (radius)\n        {\n            [self addRoundedRectToPath:context rect:rect radius:radius];\n            CGContextFillPath(context);\n        }\n        else\n        {\n            CGContextFillRect(context, rect);\n        }\n        CGContextRestoreGState(context);\n    }\n    \n    CGColorSpaceRelease(space);\n}\n\n- (void)strokeLines:(CGRect)rect stroke:(const CGFloat*)strokeColor\n{\n    CGContextRef context = UIGraphicsGetCurrentContext();\n    CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();\n    \n    CGContextSaveGState(context);\n    CGContextSetStrokeColorSpace(context, space);\n    CGContextSetStrokeColor(context, strokeColor);\n    CGContextSetLineWidth(context, 1.0);\n    \n    {\n        CGPoint points[] = {{rect.origin.x+0.5, rect.origin.y-0.5},\n            {rect.origin.x+rect.size.width, rect.origin.y-0.5}};\n        CGContextStrokeLineSegments(context, points, 2);\n    }\n    {\n        CGPoint points[] = {{rect.origin.x+0.5, rect.origin.y+rect.size.height-0.5},\n            {rect.origin.x+rect.size.width-0.5, rect.origin.y+rect.size.height-0.5}};\n        CGContextStrokeLineSegments(context, points, 2);\n    }\n    {\n        CGPoint points[] = {{rect.origin.x+rect.size.width-0.5, rect.origin.y},\n            {rect.origin.x+rect.size.width-0.5, rect.origin.y+rect.size.height}};\n        CGContextStrokeLineSegments(context, points, 2);\n    }\n    {\n        CGPoint points[] = {{rect.origin.x+0.5, rect.origin.y},\n            {rect.origin.x+0.5, rect.origin.y+rect.size.height}};\n        CGContextStrokeLineSegments(context, points, 2);\n    }\n    \n    CGContextRestoreGState(context);\n    \n    CGColorSpaceRelease(space);\n}\n\n- (void)drawRect:(CGRect)rect\n{\n    [self drawRect:rect fill:kBorderGray radius:0];\n    \n    CGRect webRect = CGRectMake(\n                                ceil(rect.origin.x+kBorderWidth), ceil(rect.origin.y+kBorderWidth)+1,\n                                rect.size.width-kBorderWidth*2, rect.size.height-(1+kBorderWidth*2));\n    \n    [self strokeLines:webRect stroke:kBorderBlack];\n}\n\n#pragma mark - Memory management\n\n- (id)init\n{\n    if ((self = [super init]))\n    {\n        self.backgroundColor = [UIColor clearColor];\n        self.autoresizesSubviews = YES;\n        self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n        self.contentMode = UIViewContentModeRedraw;\n            \n        webView = [[UIWebView alloc] init];\n        webView.delegate = self;\n        webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;\n        [self addSubview:webView];\n        [webView release];\n        \n        UIImage* closeImage = [UIImage imageNamed:@\"SinaWeibo.bundle/images/close.png\"];\n        UIColor* color = [UIColor colorWithRed:167.0/255 green:184.0/255 blue:216.0/255 alpha:1];\n        closeButton = [UIButton buttonWithType:UIButtonTypeCustom];\n        [closeButton setImage:closeImage forState:UIControlStateNormal];\n        [closeButton setTitleColor:color forState:UIControlStateNormal];\n        [closeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];\n        [closeButton addTarget:self action:@selector(cancel)\n              forControlEvents:UIControlEventTouchUpInside];\n        closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12];\n        closeButton.showsTouchWhenHighlighted = YES;\n        closeButton.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;\n        [self addSubview:closeButton];\n        \n        indicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:\n                    UIActivityIndicatorViewStyleGray];\n        indicatorView.autoresizingMask =\n            UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin\n            | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;\n        [self addSubview:indicatorView];\n        \n        modalBackgroundView = [[UIView alloc] init];\n    }\n    \n    return self;\n}\n\n- (void)dealloc\n{\n    [authParams release], authParams = nil;\n    [appRedirectURI release], appRedirectURI = nil;\n    [modalBackgroundView release], modalBackgroundView = nil;\n    \n    [super dealloc];\n}\n\n- (id)initWithAuthParams:(NSDictionary *)params\n                delegate:(id<SinaWeiboAuthorizeViewDelegate>)_delegate\n{\n    if ((self = [self init]))\n    {\n        self.delegate = _delegate;\n        authParams = [params copy];\n        appRedirectURI = [[authParams objectForKey:@\"redirect_uri\"] retain];\n    }\n    return self;\n}\n\n#pragma mark - View orientation\n\n- (BOOL)shouldRotateToOrientation:(UIInterfaceOrientation)orientation\n{\n    if (orientation == previousOrientation)\n    {\n        return NO;\n    }\n    else\n    {\n        return orientation == UIInterfaceOrientationPortrait\n        || orientation == UIInterfaceOrientationPortraitUpsideDown\n        || orientation == UIInterfaceOrientationLandscapeLeft\n        || orientation == UIInterfaceOrientationLandscapeRight;\n    }\n}\n\n- (CGAffineTransform)transformForOrientation\n{\n    UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;\n    if (orientation == UIInterfaceOrientationLandscapeLeft)\n    {\n        return CGAffineTransformMakeRotation(M_PI*1.5);\n    }\n    else if (orientation == UIInterfaceOrientationLandscapeRight)\n    {\n        return CGAffineTransformMakeRotation(M_PI/2);\n    }\n    else if (orientation == UIInterfaceOrientationPortraitUpsideDown)\n    {\n        return CGAffineTransformMakeRotation(-M_PI);\n    }\n    else\n    {\n        return CGAffineTransformIdentity;\n    }\n}\n\n- (void)sizeToFitOrientation:(BOOL)transform\n{\n    if (transform)\n    {\n        self.transform = CGAffineTransformIdentity;\n    }\n    \n    CGRect frame = [UIScreen mainScreen].applicationFrame;\n    CGPoint center = CGPointMake(frame.origin.x + ceil(frame.size.width/2),\n                                 frame.origin.y + ceil(frame.size.height/2));\n    \n    CGFloat scaleFactor = SinaWeiboIsDeviceIPad() ? 0.6f : 1.0f;\n    \n    CGFloat width = floor(scaleFactor * frame.size.width) - kPadding * 2;\n    CGFloat height = floor(scaleFactor * frame.size.height) - kPadding * 2;\n    \n    previousOrientation = [UIApplication sharedApplication].statusBarOrientation;\n    if (UIInterfaceOrientationIsLandscape(previousOrientation))\n    {\n        self.frame = CGRectMake(kPadding, kPadding, height, width);\n    }\n    else\n    {\n        self.frame = CGRectMake(kPadding, kPadding, width, height);\n    }\n    self.center = center;\n    \n    if (transform)\n    {\n        self.transform = [self transformForOrientation];\n    }\n}\n\n- (void)updateWebOrientation\n{\n    UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;\n    if (UIInterfaceOrientationIsLandscape(orientation))\n    {\n        [webView stringByEvaluatingJavaScriptFromString:\n         @\"document.body.setAttribute('orientation', 90);\"];\n    }\n    else\n    {\n        [webView stringByEvaluatingJavaScriptFromString:\n         @\"document.body.removeAttribute('orientation');\"];\n    }\n}\n\n#pragma mark - UIDeviceOrientationDidChangeNotification Methods\n\n- (void)deviceOrientationDidChange:(id)object\n{\n\tUIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;\n\tif ([self shouldRotateToOrientation:orientation])\n    {\n        NSTimeInterval duration = [UIApplication sharedApplication].statusBarOrientationAnimationDuration;\n\t\t\n\t\t[UIView beginAnimations:nil context:nil];\n\t\t[UIView setAnimationDuration:duration];\n        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];\n\t\t[self sizeToFitOrientation:orientation];\n\t\t[UIView commitAnimations];\n\t}\n}\n\n#pragma mark - Animation\n\n- (void)bounce1AnimationStopped\n{\n    [UIView beginAnimations:nil context:nil];\n    [UIView setAnimationDuration:kTransitionDuration/2];\n    [UIView setAnimationDelegate:self];\n    [UIView setAnimationDidStopSelector:@selector(bounce2AnimationStopped)];\n    self.transform = CGAffineTransformScale([self transformForOrientation], 0.9, 0.9);\n    [UIView commitAnimations];\n}\n\n- (void)bounce2AnimationStopped\n{\n    [UIView beginAnimations:nil context:nil];\n    [UIView setAnimationDuration:kTransitionDuration/2];\n    self.transform = [self transformForOrientation];\n    [UIView commitAnimations];\n}\n\n#pragma mark Obeservers\n\n- (void)addObservers\n{\n\t[[NSNotificationCenter defaultCenter] addObserver:self\n\t\t\t\t\t\t\t\t\t\t\t selector:@selector(deviceOrientationDidChange:)\n\t\t\t\t\t\t\t\t\t\t\t\t name:@\"UIDeviceOrientationDidChangeNotification\" object:nil];\n}\n\n- (void)removeObservers\n{\n\t[[NSNotificationCenter defaultCenter] removeObserver:self\n\t\t\t\t\t\t\t\t\t\t\t\t\tname:@\"UIDeviceOrientationDidChangeNotification\" object:nil];\n}\n\n#pragma mark - Activity Indicator\n\n- (void)showIndicator\n{\n    [indicatorView sizeToFit];\n    [indicatorView startAnimating];\n    indicatorView.center = webView.center;\t\n}\n\n- (void)hideIndicator\n{\n    [indicatorView stopAnimating];\n}\n\n#pragma mark - Show / Hide\n\n- (void)load\n{\n    NSString *authPagePath = [SinaWeiboRequest serializeURL:kSinaWeiboWebAuthURL\n                                                     params:authParams httpMethod:@\"GET\"];\n    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:authPagePath]]];\n}\n\n- (void)showWebView\n{\n    UIWindow* window = [UIApplication sharedApplication].keyWindow;\t\n    if (!window)\n    {\t\n        window = [[UIApplication sharedApplication].windows objectAtIndex:0];\t\n    }\t\n    modalBackgroundView.frame = window.frame;\t\n    [modalBackgroundView addSubview:self];\t\n    [window addSubview:modalBackgroundView];\t\n    \n    self.transform = CGAffineTransformScale([self transformForOrientation], 0.001, 0.001);\t\n    [UIView beginAnimations:nil context:nil];\t\n    [UIView setAnimationDuration:kTransitionDuration/1.5];\t\n    [UIView setAnimationDelegate:self];\t\n    [UIView setAnimationDidStopSelector:@selector(bounce1AnimationStopped)];\t\n    self.transform = CGAffineTransformScale([self transformForOrientation], 1.1, 1.1);\t\n    [UIView commitAnimations];\t\n}\n\n- (void)show\n{\n    [self load];\n    [self sizeToFitOrientation:NO];\n    \n    CGFloat innerWidth = self.frame.size.width - (kBorderWidth+1)*2;\n    [closeButton sizeToFit];\n    closeButton.frame = CGRectMake(2, 2, 29, 29);\n    \n    webView.frame = CGRectMake(kBorderWidth+1, kBorderWidth+1, innerWidth,\n                               self.frame.size.height - (1 + kBorderWidth*2));\n    \n    [self showWebView];\n    [self showIndicator];\n    \n    [self addObservers];\n}\n\n- (void)_hide\n{\n    [self removeFromSuperview];\n    [modalBackgroundView removeFromSuperview];\n}\n\n- (void)hide\n{\n    [self removeObservers];\n    \n    [webView stopLoading];\n    \n    [self performSelectorOnMainThread:@selector(_hide) withObject:nil waitUntilDone:NO];\n}\n\n- (void)cancel\n{\n    [self hide];\n    [delegate authorizeViewDidCancel:self];\n}\n\n#pragma mark - UIWebView Delegate\n\n- (void)webViewDidFinishLoad:(UIWebView *)aWebView\n{\n\t[self hideIndicator];\n}\n\n- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error\n{\n    [self hideIndicator];\n}\n\n- (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType\n{\n    NSString *url = request.URL.absoluteString;\n    NSLog(@\"url = %@\", url);\n    \n    NSString *siteRedirectURI = [NSString stringWithFormat:@\"%@%@\", kSinaWeiboSDKOAuth2APIDomain, appRedirectURI];\n    \n    if ([url hasPrefix:appRedirectURI] || [url hasPrefix:siteRedirectURI])\n    {\n        NSString *error_code = [SinaWeiboRequest getParamValueFromUrl:url paramName:@\"error_code\"];\n        \n        if (error_code)\n        {\n            NSString *error = [SinaWeiboRequest getParamValueFromUrl:url paramName:@\"error\"];\n            NSString *error_uri = [SinaWeiboRequest getParamValueFromUrl:url paramName:@\"error_uri\"];\n            NSString *error_description = [SinaWeiboRequest getParamValueFromUrl:url paramName:@\"error_description\"];\n            \n            NSDictionary *errorInfo = [NSDictionary dictionaryWithObjectsAndKeys:\n                                       error, @\"error\",\n                                       error_uri, @\"error_uri\",\n                                       error_code, @\"error_code\",\n                                       error_description, @\"error_description\", nil];\n            \n            [self hide];\n            [delegate authorizeView:self didFailWithErrorInfo:errorInfo];\n        }\n        else\n        {\n            NSString *code = [SinaWeiboRequest getParamValueFromUrl:url paramName:@\"code\"];\n            if (code)\n            {\n                [self hide];\n                [delegate authorizeView:self didRecieveAuthorizationCode:code];\n            }\n        }\n        \n        return NO;\n    }\n    \n    return YES;\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboConstants.h",
    "content": "//\n//  SinaWeiboConstants.h\n//  sinaweibo_ios_sdk\n//\n//  Created by Wade Cheng on 4/22/12.\n//  Copyright (c) 2012 SINA. All rights reserved.\n//\n\n#ifndef sinaweibo_ios_sdk_SinaWeiboConstants_h\n#define sinaweibo_ios_sdk_SinaWeiboConstants_h\n\n#define SinaWeiboSdkVersion                @\"2.0\"\n\n#define kSinaWeiboSDKErrorDomain           @\"SinaWeiboSDKErrorDomain\"\n#define kSinaWeiboSDKErrorCodeKey          @\"SinaWeiboSDKErrorCodeKey\"\n\n#define kSinaWeiboSDKAPIDomain             @\"https://open.weibo.cn/2/\"\n#define kSinaWeiboSDKOAuth2APIDomain       @\"https://open.weibo.cn/2/oauth2/\"\n#define kSinaWeiboWebAuthURL               @\"https://open.weibo.cn/2/oauth2/authorize\"\n#define kSinaWeiboWebAccessTokenURL        @\"https://open.weibo.cn/2/oauth2/access_token\"\n\n#define kSinaWeiboAppAuthURL_iPhone        @\"sinaweibosso://login\"\n#define kSinaWeiboAppAuthURL_iPad          @\"sinaweibohdsso://login\"\n\ntypedef enum\n{\n\tkSinaWeiboSDKErrorCodeParseError       = 200,\n\tkSinaWeiboSDKErrorCodeSSOParamsError   = 202,\n} SinaWeiboSDKErrorCode;\n\n#endif\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboRequest.h",
    "content": "//\n//  SinaWeiboRequest.h\n//  sinaweibo_ios_sdk\n//  Based on OAuth 2.0\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n//  OTHER DEALINGS IN THE SOFTWARE.\n//\n//  Copyright 2011 Sina. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n@class SinaWeiboRequest;\n@class SinaWeibo;\n\n\n/**\n * @description 第三方应用访问微博API时实现此此协议，当sdk完成api的访问后通过传入的此类对象完成接口访问结果的回调，应用在协议实现的相应方法中接收访问结果并做对应处理。\n */\n@protocol SinaWeiboRequestDelegate <NSObject>\n@optional\n- (void)request:(SinaWeiboRequest *)request didReceiveResponse:(NSURLResponse *)response;\n- (void)request:(SinaWeiboRequest *)request didReceiveRawData:(NSData *)data;\n- (void)request:(SinaWeiboRequest *)request didFailWithError:(NSError *)error;\n- (void)request:(SinaWeiboRequest *)request didFinishLoadingWithResult:(id)result;\n@end\n\n@interface SinaWeiboRequest : NSObject\n{\n    SinaWeibo                       *sinaweibo;//weak reference\n    \n    NSString                        *url;\n    NSString                        *httpMethod;\n    NSDictionary                    *params;\n    \n    NSURLConnection                 *connection;\n    NSMutableData                   *responseData;\n    \n    id<SinaWeiboRequestDelegate>    delegate;\n}\n\n@property (nonatomic, assign) SinaWeibo *sinaweibo;\n@property (nonatomic, retain) NSString *url;\n@property (nonatomic, retain) NSString *httpMethod;\n@property (nonatomic, retain) NSDictionary *params;\n@property (nonatomic, assign) id<SinaWeiboRequestDelegate> delegate;\n\n+ (SinaWeiboRequest *)requestWithURL:(NSString *)url \n                          httpMethod:(NSString *)httpMethod \n                              params:(NSDictionary *)params\n                            delegate:(id<SinaWeiboRequestDelegate>)delegate;\n\n+ (SinaWeiboRequest *)requestWithAccessToken:(NSString *)accessToken\n                                         url:(NSString *)url\n                                  httpMethod:(NSString *)httpMethod \n                                      params:(NSDictionary *)params\n                                    delegate:(id<SinaWeiboRequestDelegate>)delegate;\n\n+ (NSString *)getParamValueFromUrl:(NSString*)url paramName:(NSString *)paramName;\n+ (NSString *)serializeURL:(NSString *)baseURL params:(NSDictionary *)params httpMethod:(NSString *)httpMethod;\n\n- (void)connect;\n- (void)disconnect;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboRequest.m",
    "content": "//\n//  SinaWeiboRequest.m\n//  sinaweibo_ios_sdk\n//  Based on OAuth 2.0\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n//  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n//  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n//  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n//  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n//  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n//  OTHER DEALINGS IN THE SOFTWARE.\n//\n//  Copyright 2011 Sina. All rights reserved.\n//\n\n#import \"SinaWeiboRequest.h\"\n#import \"SinaWeiboConstants.h\"\n#import \"JSONKit.h\"\n#import \"SinaWeibo.h\"\n\n#define kSinaWeiboRequestTimeOutInterval   180.0\n#define kSinaWeiboRequestStringBoundary    @\"293iosfksdfkiowjksdf31jsiuwq003s02dsaffafass3qw\"\n\n@interface NSString (SinaWeiboEncode)\n- (NSString *)URLEncodedString;\n@end\n\n@implementation NSString (SinaWeiboEncode)\n\n- (NSString *)URLEncodedStringWithCFStringEncoding:(CFStringEncoding)encoding\n{\n    return [(NSString *) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)[[self mutableCopy] autorelease], NULL, CFSTR(\"￼=,!$&'()*+;@?\\n\\\"<>#\\t :/\"), encoding) autorelease];\n}\n\n- (NSString *)URLEncodedString\n{\n\treturn [self URLEncodedStringWithCFStringEncoding:kCFStringEncodingUTF8];\n}\n\n@end\n\n@interface SinaWeibo (SinaWeiboRequest)\n- (void)requestDidFinish:(SinaWeiboRequest *)request;\n- (void)requestDidFailWithInvalidToken:(NSError *)error;\n@end\n\n@interface SinaWeiboRequest (Private)\n\n- (void)appendUTF8Body:(NSMutableData *)body dataString:(NSString *)dataString;\n- (NSMutableData *)postBodyHasRawData:(BOOL*)hasRawData;\n\n- (void)handleResponseData:(NSData *)data;\n- (id)parseJSONData:(NSData *)data error:(NSError **)error;\n\n- (id)errorWithCode:(NSInteger)code userInfo:(NSDictionary *)userInfo;\n- (void)failedWithError:(NSError *)error;\n\n@end\n\n\n@implementation SinaWeiboRequest\n\n@synthesize sinaweibo;\n@synthesize url;\n@synthesize httpMethod;\n@synthesize params;\n@synthesize delegate;\n\n#pragma mark - SinaWeiboRequest Life Circle\n\n- (void)dealloc\n{\n    sinaweibo = nil;\n    \n    [url release], url = nil;\n    [httpMethod release], httpMethod = nil;\n    [params release], params = nil;\n    \n    [responseData release];\n\tresponseData = nil;\n    \n    [connection cancel];\n    [connection release], connection = nil;\n    \n    [super dealloc];\n}\n\n#pragma mark - SinaWeiboRequest Private Methods\n\n- (void)appendUTF8Body:(NSMutableData *)body dataString:(NSString *)dataString\n{\n    [body appendData:[dataString dataUsingEncoding:NSUTF8StringEncoding]];\n}\n\n- (NSMutableData *)postBodyHasRawData:(BOOL*)hasRawData\n{\n    NSString *bodyPrefixString = [NSString stringWithFormat:@\"--%@\\r\\n\", kSinaWeiboRequestStringBoundary];\n    NSString *bodySuffixString = [NSString stringWithFormat:@\"\\r\\n--%@--\\r\\n\", kSinaWeiboRequestStringBoundary];\n    \n    NSMutableDictionary *dataDictionary = [NSMutableDictionary dictionary];\n    \n    NSMutableData *body = [NSMutableData data];\n    [self appendUTF8Body:body dataString:bodyPrefixString];\n    \n    for (id key in [params keyEnumerator]) \n    {\n        if (([[params valueForKey:key] isKindOfClass:[UIImage class]]) || ([[params valueForKey:key] isKindOfClass:[NSData class]]))\n        {\n            [dataDictionary setObject:[params valueForKey:key] forKey:key];\n            continue;\n        }\n        \n        [self appendUTF8Body:body dataString:[NSString stringWithFormat:@\"Content-Disposition: form-data; name=\\\"%@\\\"\\r\\n\\r\\n%@\\r\\n\", key, [params valueForKey:key]]];\n        [self appendUTF8Body:body dataString:bodyPrefixString];\n    }\n    \n    if ([dataDictionary count] > 0) \n    {\n        *hasRawData = YES;\n        for (id key in dataDictionary) \n        {\n            NSObject *dataParam = [dataDictionary valueForKey:key];\n            \n            if ([dataParam isKindOfClass:[UIImage class]]) \n            {\n                NSData* imageData = UIImagePNGRepresentation((UIImage *)dataParam);\n                [self appendUTF8Body:body dataString:[NSString stringWithFormat:@\"Content-Disposition: form-data; name=\\\"%@\\\"; filename=\\\"file\\\"\\r\\n\", key]];\n                [self appendUTF8Body:body dataString:[NSString stringWithString:@\"Content-Type: image/png\\r\\nContent-Transfer-Encoding: binary\\r\\n\\r\\n\"]];\n                [body appendData:imageData];\n            } \n            else if ([dataParam isKindOfClass:[NSData class]]) \n            {\n                [self appendUTF8Body:body dataString:[NSString stringWithFormat:@\"Content-Disposition: form-data; name=\\\"%@\\\"; filename=\\\"file\\\"\\r\\n\", key]];\n                [self appendUTF8Body:body dataString:[NSString stringWithString:@\"Content-Type: content/unknown\\r\\nContent-Transfer-Encoding: binary\\r\\n\\r\\n\"]];\n                [body appendData:(NSData*)dataParam];\n            }\n            [self appendUTF8Body:body dataString:bodySuffixString];\n        }\n    }\n    \n    return body;\n}\n\n- (void)handleResponseData:(NSData *)data \n{\n    if ([delegate respondsToSelector:@selector(request:didReceiveRawData:)])\n    {\n        [delegate request:self didReceiveRawData:data];\n    }\n\t\n\tNSError *error = nil;\n\tid result = [self parseJSONData:data error:&error];\n\t\n\tif (error) \n\t{\n\t\t[self failedWithError:error];\n\t} \n\telse \n\t{\n        NSInteger error_code = 0;\n        if([result isKindOfClass:[NSDictionary class]])\n        {\n            [[result objectForKey:@\"error_code\"] intValue];\n        }\n        \n        if (error_code != 0)\n        {\n            NSString *error_description = [result objectForKey:@\"error\"];\n            NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:\n                                      result, @\"error\",\n                                      error_description, NSLocalizedDescriptionKey, nil];\n            NSError *error = [NSError errorWithDomain:kSinaWeiboSDKErrorDomain\n                                                 code:[[result objectForKey:@\"error_code\"] intValue]\n                                             userInfo:userInfo];\n            \n            if (error_code == 21314     //Token已经被使用\n                || error_code == 21315  //Token已经过期\n                || error_code == 21316  //Token不合法\n                || error_code == 21317  //Token不合法\n                || error_code == 21327  //token过期\n                || error_code == 21332) //access_token 无效\n            {\n                [sinaweibo requestDidFailWithInvalidToken:error];\n            }\n            else\n            {\n                [self failedWithError:error];\n            }\n        }\n        else\n        {\n            if ([delegate respondsToSelector:@selector(request:didFinishLoadingWithResult:)])\n            {\n                [delegate request:self didFinishLoadingWithResult:(result == nil ? data : result)];\n            }\n        }\n\t}\n}\n\n- (id)parseJSONData:(NSData *)data error:(NSError **)error\n{\n    NSError *parseError = nil;\n\tid result =[data objectFromJSONDataWithParseOptions:JKParseOptionStrict error:&parseError];\n\t\n\tif (parseError && (error != nil))\n    {\n        NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:\n                                  parseError, @\"error\",\n                                  @\"Data parse error\", NSLocalizedDescriptionKey, nil];\n        *error = [self errorWithCode:kSinaWeiboSDKErrorCodeParseError\n                            userInfo:userInfo];\n\t}\n\t\n\treturn result;\n}\n\n- (id)errorWithCode:(NSInteger)code userInfo:(NSDictionary *)userInfo\n{\n    return [NSError errorWithDomain:kSinaWeiboSDKErrorDomain code:code userInfo:userInfo];\n}\n\n- (void)failedWithError:(NSError *)error \n{\n\tif ([delegate respondsToSelector:@selector(request:didFailWithError:)]) \n\t{\n\t\t[delegate request:self didFailWithError:error];\n\t}\n}\n\n#pragma mark - SinaWeiboRequest Public Methods\n\n+ (NSString *)getParamValueFromUrl:(NSString*)url paramName:(NSString *)paramName\n{\n    if (![paramName hasSuffix:@\"=\"])\n    {\n        paramName = [NSString stringWithFormat:@\"%@=\", paramName];\n    }\n    \n    NSString * str = nil;\n    NSRange start = [url rangeOfString:paramName];\n    if (start.location != NSNotFound)\n    {\n        // confirm that the parameter is not a partial name match\n        unichar c = '?';\n        if (start.location != 0)\n        {\n            c = [url characterAtIndex:start.location - 1];\n        }\n        if (c == '?' || c == '&' || c == '#')\n        {        \n            NSRange end = [[url substringFromIndex:start.location+start.length] rangeOfString:@\"&\"];\n            NSUInteger offset = start.location+start.length;\n            str = end.location == NSNotFound ?\n            [url substringFromIndex:offset] : \n            [url substringWithRange:NSMakeRange(offset, end.location)];\n            str = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];\n        }\n    }    \n    return str;\n}\n\n+ (NSString *)serializeURL:(NSString *)baseURL params:(NSDictionary *)params httpMethod:(NSString *)httpMethod\n{\n    NSURL* parsedURL = [NSURL URLWithString:baseURL];\n    NSString* queryPrefix = parsedURL.query ? @\"&\" : @\"?\";\n    \n    NSMutableArray* pairs = [NSMutableArray array];\n    for (NSString* key in [params keyEnumerator])\n    {\n        if (([[params objectForKey:key] isKindOfClass:[UIImage class]])\n            ||([[params objectForKey:key] isKindOfClass:[NSData class]]))\n        {\n            if ([httpMethod isEqualToString:@\"GET\"])\n            {\n                NSLog(@\"can not use GET to upload a file\");\n            }\n            continue;\n        }\n        \n        NSString* escaped_value = (NSString *)CFURLCreateStringByAddingPercentEscapes(\n                                                                                      NULL, /* allocator */\n                                                                                      (CFStringRef)[params objectForKey:key],\n                                                                                      NULL, /* charactersToLeaveUnescaped */\n                                                                                      (CFStringRef)@\"!*'();:@&=+$,/?%#[]\",\n                                                                                      kCFStringEncodingUTF8);\n        \n        [pairs addObject:[NSString stringWithFormat:@\"%@=%@\", key, escaped_value]];\n        [escaped_value release];\n    }\n    NSString* query = [pairs componentsJoinedByString:@\"&\"];\n    \n    return [NSString stringWithFormat:@\"%@%@%@\", baseURL, queryPrefix, query];\n}\n\n+ (SinaWeiboRequest *)requestWithURL:(NSString *)url \n                          httpMethod:(NSString *)httpMethod \n                              params:(NSDictionary *)params\n                            delegate:(id<SinaWeiboRequestDelegate>)delegate\n{\n    SinaWeiboRequest *request = [[[SinaWeiboRequest alloc] init] autorelease];\n    \n    request.url = url;\n    request.httpMethod = httpMethod;\n    request.params = params;\n    request.delegate = delegate;\n    \n    return request;\n}\n\n+ (SinaWeiboRequest *)requestWithAccessToken:(NSString *)accessToken\n                                         url:(NSString *)url\n                                  httpMethod:(NSString *)httpMethod \n                                      params:(NSDictionary *)params\n                                    delegate:(id<SinaWeiboRequestDelegate>)delegate\n{\n    // add the access token field\n    NSMutableDictionary *mutableParams = [NSMutableDictionary dictionaryWithDictionary:params];\n    [mutableParams setObject:accessToken forKey:@\"access_token\"];\n    return [SinaWeiboRequest requestWithURL:url\n                                 httpMethod:httpMethod\n                                     params:mutableParams\n                                   delegate:delegate];\n}\n\n- (void)connect\n{\n    NSString* urlString = [[self class] serializeURL:url params:params httpMethod:httpMethod];\n    NSMutableURLRequest* request =\n    [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]\n                            cachePolicy:NSURLRequestReloadIgnoringLocalCacheData\n                        timeoutInterval:kSinaWeiboRequestTimeOutInterval];\n    \n    [request setHTTPMethod:self.httpMethod];\n    if ([self.httpMethod isEqualToString: @\"POST\"])\n    {\n        BOOL hasRawData = NO;\n        [request setHTTPBody:[self postBodyHasRawData:&hasRawData]];\n        \n        if (hasRawData)\n        {\n            NSString* contentType = [NSString\n                                     stringWithFormat:@\"multipart/form-data; boundary=%@\", kSinaWeiboRequestStringBoundary];\n            [request setValue:contentType forHTTPHeaderField:@\"Content-Type\"];\n        }\n    }\n    \n    connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];\n}\n\n- (void)disconnect\n{\n    [responseData release];\n\tresponseData = nil;\n    \n    [connection cancel];\n    [connection release], connection = nil;\n}\n\n#pragma mark - NSURLConnection Delegate Methods\n\n- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response\n{\n\tresponseData = [[NSMutableData alloc] init];\n\t\n\tif ([delegate respondsToSelector:@selector(request:didReceiveResponse:)])\n    {\n\t\t[delegate request:self didReceiveResponse:response];\n\t}\n}\n\n- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data\n{\n\t[responseData appendData:data];\n}\n\n- (NSCachedURLResponse *)connection:(NSURLConnection *)connection\n\t\t\t\t  willCacheResponse:(NSCachedURLResponse*)cachedResponse \n{\n\treturn nil;\n}\n\n- (void)connectionDidFinishLoading:(NSURLConnection *)theConnection \n{\n\t[self handleResponseData:responseData];\n    \n\t[responseData release];\n\tresponseData = nil;\n    \n    [connection cancel];\n\t[connection release];\n\tconnection = nil;\n    \n    [sinaweibo requestDidFinish:self];\n}\n\n- (void)connection:(NSURLConnection *)theConnection didFailWithError:(NSError *)error\n{\n\t[self failedWithError:error];\n\t\n\t[responseData release];\n\tresponseData = nil;\n    \n    [connection cancel];\n\t[connection release];\n\tconnection = nil;\n    \n    [sinaweibo requestDidFinish:self];\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/PluginManager.cpp",
    "content": "﻿/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"PluginManager.h\"\n#include \"PluginFactory.h\"\n\nnamespace cocos2d { namespace plugin {\n\nstatic PluginManager* s_pPluginManager = NULL;\n\nPluginManager::PluginManager(void)\n{\n}\n\nPluginManager::~PluginManager()\n{\n\tstd::map<std::string, PluginProtocol*>::iterator it = _pluginsMap.begin();\n    for (;it != _pluginsMap.end();++it)\n    {\n        if (it->second != NULL) {\n            delete it->second;\n            it->second = NULL;\n        }\n    }\n    _pluginsMap.clear();\n}\n\nPluginManager* PluginManager::getInstance()\n{\n    if (s_pPluginManager == NULL)\n    {\n        s_pPluginManager = new PluginManager();\n    }\n    return s_pPluginManager;\n}\n\nvoid PluginManager::end()\n{\n    if (s_pPluginManager != NULL)\n    {\n        delete s_pPluginManager;\n        s_pPluginManager = NULL;\n    }\n\n    PluginFactory::purgeFactory();\n}\n\nPluginProtocol* PluginManager::loadPlugin(const char* name)\n{\n    PluginProtocol* pRet = NULL;\n    do {\n        if (name == NULL || strlen(name) == 0) break;\n        std::map<std::string, PluginProtocol*>::iterator it = _pluginsMap.find(name);\n        if (it != _pluginsMap.end())\n        {\n            if (it->second == NULL) {\n                it->second = PluginFactory::getInstance()->createPlugin(name);\n            }\n            pRet = it->second;\n        } else\n        {\n        \tpRet = PluginFactory::getInstance()->createPlugin(name);\n        \t_pluginsMap[name] = pRet;\n        }\n    } while (false);\n\n    return pRet;\n}\n\nvoid PluginManager::unloadPlugin(const char* name)\n{\n    do {\n        if (name == NULL || strlen(name) == 0) break;\n        std::map<std::string, PluginProtocol*>::iterator it = _pluginsMap.find(name);\n\t\tif (it != _pluginsMap.end())\n        {\n            if (it->second != NULL) {\n                delete it->second;\n                it->second = NULL;\n            }\n        }\n    } while (false);\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/PluginParam.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"PluginParam.h\"\n\nnamespace cocos2d { namespace plugin {\n\nPluginParam::PluginParam()\n{\n    _type = kParamTypeNull;\n}\n\nPluginParam::PluginParam(int nValue)\n: _intValue(nValue)\n{\n\t_type = kParamTypeInt;\n}\n\nPluginParam::PluginParam(float fValue)\n: _floatValue(fValue)\n{\n\t_type = kParamTypeFloat;\n}\n\nPluginParam::PluginParam(bool bValue)\n: _boolValue(bValue)\n{\n\t_type = kParamTypeBool;\n}\n\nPluginParam::PluginParam(const char* strValue)\n: _strValue(strValue)\n{\n\t_type = kParamTypeString;\n}\n\nPluginParam::PluginParam(std::map<std::string, PluginParam*> mapValue)\n: _mapValue(mapValue)\n{\n\t_type = kParamTypeMap;\n}\n\nPluginParam::PluginParam(StringMap strMapValue)\n: _strMapValue(strMapValue)\n{\n    _type = kParamTypeStringMap;\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/PluginFactory.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_PLUGIN_FACTORY_H__\n#define __CCX_PLUGIN_FACTORY_H__\n\nnamespace cocos2d { namespace plugin {\n\nclass PluginProtocol;\nclass PluginManager;\nclass PluginFactory\n{\npublic:\n\tvirtual ~PluginFactory();\n\t/** Get singleton of PluginFactory */\n    static PluginFactory* getInstance();\n\n    /** Destory the instance of PluginFactory */\n    static void purgeFactory();\n\nprivate:\n    friend class PluginManager;\n    PluginFactory(void);\n\n    /** create the plugin by name */\n    PluginProtocol* createPlugin(const char* name);\n};\n\n}} //namespace cocos2d { namespace plugin {\n\n#endif /* __CCX_PLUGIN_FACTORY_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/PluginManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_PLUGINMANAGER_H__\n#define __CCX_PLUGINMANAGER_H__\n\n#include \"PluginProtocol.h\"\n#include <map>\n#include <string>\n\nnamespace cocos2d { namespace plugin {\n\nclass PluginManager\n{\npublic:\n\tvirtual ~PluginManager();\n\t/** Get singleton of PluginManager */\n    static PluginManager* getInstance();\n    /** Destory the instance of PluginManager */\n    static void end();\n    \n    /** load the plugin by name */\n    PluginProtocol* loadPlugin(const char* name);\n    /** unload the plugin by name */\n    void unloadPlugin(const char* name);\n\nprivate:\n    PluginManager(void);\n    std::map<std::string, PluginProtocol*> _pluginsMap;\n};\n\n}} //namespace cocos2d { namespace plugin {\n\n#endif /* __CCX_PLUGINMANAGER_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/PluginParam.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_PLUGIN_PARAM_H__\n#define __CCX_PLUGIN_PARAM_H__\n\n#include <map>\n#include <string>\n\ntypedef std::map<std::string, std::string>   StringMap;\n\nnamespace cocos2d { namespace plugin {\n\nclass PluginProtocol;\nclass PluginParam\n{\npublic:\n    PluginParam();\n\tPluginParam(int nValue);\n\tPluginParam(float fValue);\n\tPluginParam(bool bValue);\n\tPluginParam(const char* strValue);\n\tPluginParam(StringMap strMapValue);\n\n\ttypedef enum{\n\t\tkParamTypeNull = 0,\n\t\tkParamTypeInt,\n\t\tkParamTypeFloat,\n\t\tkParamTypeBool,\n\t\tkParamTypeString,\n        kParamTypeStringMap,\n\t\tkParamTypeMap,\n\t} ParamType;\n\n\tinline ParamType getCurrentType() {\n\t\treturn _type;\n\t}\n\n\tinline int getIntValue() {\n\t\treturn _intValue;\n\t}\n\n\tinline float getFloatValue() {\n\t\treturn _floatValue;\n\t}\n\n\tinline bool getBoolValue() {\n\t\treturn _boolValue;\n\t}\n\n\tinline const char* getStringValue() {\n\t\treturn _strValue.c_str();\n\t}\n\n\tinline std::map<std::string, PluginParam*> getMapValue() {\n\t\treturn _mapValue;\n\t}\n\n\tinline StringMap getStrMapValue() {\n        return _strMapValue;\n    }\n\nprivate:\n\tfriend class PluginProtocol;\n    PluginParam(std::map<std::string, PluginParam*> mapValue);\n\nprivate:\n\tParamType _type;\n\n\tint _intValue;\n\tfloat _floatValue;\n\tbool _boolValue;\n\tstd::string _strValue;\n\tstd::map<std::string, PluginParam*> _mapValue;\n\tStringMap _strMapValue;\n};\n\n}} //namespace cocos2d { namespace plugin {\n\n#endif /* __CCX_PLUGIN_PARAM_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/PluginProtocol.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_IPLUGIN_H__\n#define __CCX_IPLUGIN_H__\n\n#include \"PluginParam.h\"\n#include <vector>\n\nnamespace cocos2d { namespace plugin {\n\n/**\n\tThe super class for all plugins.\n*/\nclass PluginFactory;\nclass PluginProtocol\n{\npublic:\n    virtual ~PluginProtocol();\n\n    /**\n    @brief plug-in info methods(name, version, SDK version)\n    */\n    inline const char* getPluginName() { return _pluginName.c_str(); }\n    std::string getPluginVersion();\n    std::string getSDKVersion();\n\n    /**\n    @brief switch debug plug-in on/off\n    */\n    void setDebugMode(bool bDebug);\n\n    /**\n     * @brief methods for reflections\n     */\n    void callFuncWithParam(const char* funcName, PluginParam* param, ...);\n    void callFuncWithParam(const char* funcName, std::vector<PluginParam*> params);\n\n    std::string callStringFuncWithParam(const char* funcName, PluginParam* param, ...);\n    std::string callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params);\n\n    int callIntFuncWithParam(const char* funcName, PluginParam* param, ...);\n    int callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params);\n\n    bool callBoolFuncWithParam(const char* funcName, PluginParam* param, ...);\n    bool callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params);\n\n    float callFloatFuncWithParam(const char* funcName, PluginParam* param, ...);\n    float callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params);\n\nprotected:\n    PluginProtocol() {}\n\nprivate:\n    friend class PluginFactory;\n    inline void setPluginName(const char* name) {\n    \t_pluginName = name;\n    }\n    std::string _pluginName;\n};\n\n}} //namespace cocos2d { namespace plugin {\n\n#endif /* __CCX_IPLUGIN_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/ProtocolAds.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_PROTOCOL_ADS_H__\n#define __CCX_PROTOCOL_ADS_H__\n\n#include \"PluginProtocol.h\"\n#include <map>\n#include <string>\n\nnamespace cocos2d { namespace plugin {\n\ntypedef std::map<std::string, std::string> TAdsDeveloperInfo;\ntypedef std::map<std::string, std::string> TAdsInfo;\n\ntypedef enum\n{\n    kAdsReceived = 0,            // The ad is received\n\n    kAdsShown,                  // The advertisement shown\n    kAdsDismissed,              // The advertisement dismissed\n\n    kPointsSpendSucceed,        // The points spend succeed\n    kPointsSpendFailed,         // The points spend failed\n\n    kNetworkError,              // Network error\n    kUnknownError,              // Unknown error\n} AdsResultCode;\n\nclass ProtocolAds;\nclass AdsListener\n{\npublic:\n    /**\n    @brief The advertisement request result\n    */\n    virtual void onAdsResult(AdsResultCode code, const char* msg) = 0;\n    \n    /**\n    @brief Player get points from advertisement(For example: Tapjoy)\n    @param points The point number player has got.\n    @param pAdsPlugin  The plugin which the player get points. Used to spend the points.\n    */\n    virtual void onPlayerGetPoints(ProtocolAds* pAdsPlugin, int points) {}\n};\n\nclass ProtocolAds : public PluginProtocol\n{\npublic:\n\tProtocolAds();\n\tvirtual ~ProtocolAds();\n\n    typedef enum {\n        kPosCenter = 0,\n        kPosTop,\n        kPosTopLeft,\n        kPosTopRight,\n        kPosBottom,\n        kPosBottomLeft,\n        kPosBottomRight,\n    } AdsPos;\n\n    /**\n    @brief config the application info\n    @param devInfo This parameter is the info of aplication,\n           different plugin have different format\n    @warning Must invoke this interface before other interfaces.\n             And invoked only once.\n    */\n    void configDeveloperInfo(TAdsDeveloperInfo devInfo);\n\n    /**\n    @brief show adview\n    @param info The information of adview will be shown\n                Pay attention to the subclass definition\n    @param pos The position where the adview be shown.\n    */\n    void showAds(TAdsInfo info, AdsPos pos = kPosCenter);\n\n    /**\n    @brief Hide the adview\n    @param info The information of adview will be hided\n    */\n    void hideAds(TAdsInfo info);\n\n    /**\n    @brief Query the points of player\n    */\n    void queryPoints();\n\n    /**\n    @brief Spend the points.\n           Use this method to notify server spend points.\n    @param points Need spend number of points\n    */\n    void spendPoints(int points);\n\n    /**\n     @brief set the Ads listener\n    */\n    inline void setAdsListener(AdsListener* listener)\n    {\n        _listener = listener;\n    }\n\n    inline AdsListener* getAdsListener()\n    {\n        return _listener;\n    }\n\nprotected:\n    AdsListener* _listener;\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n#endif /* __CCX_PROTOCOL_ADS_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/ProtocolAnalytics.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_PROTOCOL_ANALYTICS_H__\n#define __CCX_PROTOCOL_ANALYTICS_H__\n\n#include \"PluginProtocol.h\"\n#include <map>\n#include <string>\n\nnamespace cocos2d { namespace plugin {\n\ntypedef std::pair< std::string, std::string >   LogEventParamPair;\ntypedef std::map< std::string, std::string >    LogEventParamMap;\n\nclass ProtocolAnalytics : public PluginProtocol\n{\npublic:\n\tProtocolAnalytics();\n\tvirtual ~ProtocolAnalytics();\n\n\t/**\n     @brief Start a new session.\n     @param appKey The identity of the application.\n     */\n\tvoid startSession(const char* appKey);\n    \n\t/**\n     @brief Stop a session.\n     @warning This interface only worked on android\n     */\n\tvoid stopSession();\n\n    /**\n     @brief Set the timeout for expiring a session.\n     @param millis In milliseconds as the unit of time.\n     @note It must be invoked before calling startSession.\n     */\n\tvoid setSessionContinueMillis(long millis);\n    \n    /**\n     @brief log an error\n     @param errorId The identity of error\n     @param message Extern message for the error\n     */\n\tvoid logError(const char* errorId, const char* message);\n    \n\t/**\n     @brief log an event.\n     @param eventId The identity of event\n     @param paramMap Extern parameters of the event, use NULL if not needed.\n     */\n\tvoid logEvent(const char* eventId, LogEventParamMap* paramMap = NULL);\n    \n    /**\n     @brief Track an event begin.\n     @param eventId The identity of event\n     */\n    void logTimedEventBegin(const char* eventId);\n    \n    /**\n     @brief Track an event end.\n     @param eventId The identity of event\n     */\n\tvoid logTimedEventEnd(const char* eventId);\n    \n\t/**\n     @brief Whether to catch uncaught exceptions to server.\n     @warning This interface only worked on android.\n     */\n\tvoid setCaptureUncaughtException(bool enabled);\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n\n#endif /* __CCX_PROTOCOL_ANALYTICS_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/ProtocolIAP.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_PROTOCOL_IAP_H__\n#define __CCX_PROTOCOL_IAP_H__\n\n#include \"PluginProtocol.h\"\n#include <map>\n#include <string>\n\nnamespace cocos2d { namespace plugin {\n\ntypedef std::map<std::string, std::string> TIAPDeveloperInfo;\ntypedef std::map<std::string, std::string> TProductInfo;\n\ntypedef enum \n{\n    kPaySuccess = 0,\n    kPayFail,\n    kPayCancel,\n    kPayTimeOut,\n} PayResultCode;\n\nclass PayResultListener\n{\npublic:\n    virtual void onPayResult(PayResultCode ret, const char* msg, TProductInfo info) = 0;\n};\n\nclass ProtocolIAP : public PluginProtocol\n{\npublic:\n\tProtocolIAP();\n\tvirtual ~ProtocolIAP();\n\n    /**\n    @brief config the developer info\n    @param devInfo This parameter is the info of developer,\n           different plugin have different format\n    @warning Must invoke this interface before other interfaces.\n             And invoked only once.\n    */\n    void configDeveloperInfo(TIAPDeveloperInfo devInfo);\n\n    /**\n    @brief pay for product\n    @param info The info of product, must contains key:\n            productName         The name of product\n            productPrice        The price of product(must can be parse to float)\n            productDesc         The description of product\n    @warning For different plugin, the parameter should have other keys to pay.\n             Look at the manual of plugins.\n    */\n    void payForProduct(TProductInfo info);\n\n    /**\n    @breif set the result listener\n    @param pListener The callback object for pay result\n    @wraning Must invoke this interface before payForProduct.\n    */\n    void setResultListener(PayResultListener* pListener);\n\n    /**\n    @brief pay result callback\n    */\n    void onPayResult(PayResultCode ret, const char* msg);\n\nprotected:\n    static bool _paying;\n\n    TProductInfo _curInfo;\n    PayResultListener* _listener;\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n#endif /* __CCX_PROTOCOL_IAP_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/ProtocolShare.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef  __CCX_PROTOCOL_SHARE_H__\n#define  __CCX_PROTOCOL_SHARE_H__\n\n#include \"PluginProtocol.h\"\n#include <map>\n#include <string>\n\nnamespace cocos2d { namespace plugin {\n\ntypedef std::map<std::string, std::string> TShareDeveloperInfo;\ntypedef std::map<std::string, std::string> TShareInfo;\n\ntypedef enum \n{\n    kShareSuccess = 0,\n    kShareFail,\n    kShareCancel,\n    kShareTimeOut,\n} ShareResultCode;\n\nclass ShareResultListener\n{\npublic:\n    virtual void onShareResult(ShareResultCode ret, const char* msg) = 0;\n};\n\nclass ProtocolShare : public PluginProtocol\n{\npublic:\n\tProtocolShare();\n\tvirtual ~ProtocolShare();\n\n    /**\n    @brief config the share developer info\n    @param devInfo This parameter is the info of developer,\n           different plugin have different format\n    @warning Must invoke this interface before other interfaces.\n             And invoked only once.\n    */\n    void configDeveloperInfo(TShareDeveloperInfo devInfo);\n\n    /**\n    @brief share information\n    @param info The info of share, contains key:\n            SharedText                \tThe text need to share\n            SharedImagePath\t\t\t\tThe full path of image file need to share (optinal)\n    @warning For different plugin, the parameter should have other keys to share.\n             Look at the manual of plugins.\n    */\n    void share(TShareInfo info);\n\n    /**\n    @breif set the result listener\n    @param pListener The callback object for share result\n    @wraning Must invoke this interface before share\n    */\n    void setResultListener(ShareResultListener* pListener);\n\n    /**\n    @brief share result callback\n    */\n    void onShareResult(ShareResultCode ret, const char* msg);\n\nprotected:\n    ShareResultListener* _listener;\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n#endif   /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/ProtocolSocial.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef  __CCX_PROTOCOL_SOCIAL_H__\n#define  __CCX_PROTOCOL_SOCIAL_H__\n\n#include \"PluginProtocol.h\"\n#include <map>\n#include <string>\n\nnamespace cocos2d { namespace plugin {\n\ntypedef std::map<std::string, std::string> TSocialDeveloperInfo;\ntypedef std::map<std::string, std::string> TAchievementInfo;\n\ntypedef enum\n{\n    // code for leaderboard feature\n    SCORE_SUBMIT_SUCCESS = 1,\n    SCORE_SUBMIT_FAILED,\n\n    // code for achievement feature\n    ACH_UNLOCK_SUCCESS,\n    ACH_UNLOCK_FAILED,\n\n} SocialRetCode;\n\nclass SocialListener\n{\npublic:\n    virtual void onSocialResult(SocialRetCode code, const char* msg) = 0;\n};\n\nclass ProtocolSocial : public PluginProtocol\n{\npublic:\n    ProtocolSocial();\n    virtual ~ProtocolSocial();\n\n    /**\n    @brief config the share developer info\n    @param devInfo This parameter is the info of developer,\n           different plugin have different format\n    @warning Must invoke this interface before other interfaces.\n             And invoked only once.\n    */\n    void configDeveloperInfo(TSocialDeveloperInfo devInfo);\n\n    /**\n     * @brief methods of leaderboard feature\n     */\n    void submitScore(const char* leadboardID, long score);\n    void showLeaderboard(const char* leaderboardID);\n\n    /**\n     * @brief methods of achievement feature\n     */\n    void unlockAchievement(TAchievementInfo achInfo);\n    void showAchievements();\n\n    inline void setListener(SocialListener* listener) {\n        _listener = listener;\n    }\n\n    inline SocialListener* getListener()\n    {\n        return _listener;\n    }\n\nprotected:\n    SocialListener* _listener;\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n#endif   /* ----- #ifndef __CCX_PROTOCOL_SOCIAL_H__ ----- */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/include/ProtocolUser.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __CCX_PROTOCOL_USER_H__\n#define __CCX_PROTOCOL_USER_H__\n\n#include \"PluginProtocol.h\"\n#include <map>\n#include <string>\n\nnamespace cocos2d { namespace plugin {\n\ntypedef std::map<std::string, std::string> TUserDeveloperInfo;\n\ntypedef enum\n{\n    kLoginSucceed = 0,\n    kLoginFailed,\n\n    kLogoutSucceed,\n} UserActionResultCode;\n\nclass ProtocolUser;\nclass UserActionListener\n{\npublic:\n    virtual void onActionResult(ProtocolUser* pPlugin, UserActionResultCode code, const char* msg) = 0;\n};\n\nclass ProtocolUser : public PluginProtocol\n{\npublic:\n    ProtocolUser();\n    virtual ~ProtocolUser();\n\n    /**\n    @brief config the application info\n    @param devInfo This parameter is the info of aplication,\n           different plugin have different format\n    @warning Must invoke this interface before other interfaces.\n             And invoked only once.\n    */\n    void configDeveloperInfo(TUserDeveloperInfo devInfo);\n\n    /**\n     @brief User login\n     */\n    void login();\n\n    /**\n     @brief User logout\n     */\n    void logout();\n\n    /**\n     @brief Check whether the user logined or not\n     */\n    bool isLogined();\n\n    /**\n     @brief Get session ID\n     @return If user logined, return value is session ID;\n             else return value is empty string.\n     */\n    std::string getSessionID();\n\n    inline void setActionListener(UserActionListener* listener)\n    {\n        _listener = listener;\n    }\n\n    inline UserActionListener* getActionListener()\n    {\n        return _listener;\n    }\n\nprotected:\n    UserActionListener* _listener;\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n#endif /* __CCX_PROTOCOL_USER_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/protocols/jsb_protocols.ini",
    "content": "[protocols]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = pluginx_protocols\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = plugin\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include \nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(pluginxdir)s/protocols/include \n\ncocos_flags = -DANDROID \n\ncxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common\n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s \n\n# what headers to parse\nheaders = %(pluginxdir)s/protocols/include/PluginManager.h %(pluginxdir)s/protocols/include/ProtocolAnalytics.h %(pluginxdir)s/protocols/include/ProtocolIAP.h %(pluginxdir)s/protocols/include/ProtocolAds.h %(pluginxdir)s/protocols/include/ProtocolShare.h %(pluginxdir)s/protocols/include/ProtocolSocial.h %(pluginxdir)s/protocols/include/ProtocolUser.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^CCMenu*$\".\nclasses = PluginProtocol PluginManager ProtocolIAP ProtocolAnalytics ProtocolAds ProtocolShare ProtocolSocial ProtocolUser\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = ProtocolIAP::[setResultListener],\n       ProtocolAds::[setAdsListener],\n       ProtocolShare::[setResultListener],\n       ProtocolSocial::[setListener getListener],\n       ProtocolUser::[setActionListener getActionListener],\n       PluginProtocol::[callFuncWithParam callStringFuncWithParam callIntFuncWithParam callBoolFuncWithParam callFloatFuncWithParam]\n\nrename_functions = \n\nrename_classes = \n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix =\n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = \n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = \n\n# classes that create no constructor\n# CCSet is special and we will use a hand-written constructor\nabstract_classes = PluginProtocol ProtocolIAP ProtocolAnalytics PluginManager ProtocolAds ProtocolShare ProtocolUser ProtocolSocial\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = yes\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginFactory.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"PluginFactory.h\"\n#include \"PluginUtils.h\"\n#include \"PluginJniHelper.h\"\n#include \"ProtocolAds.h\"\n#include \"ProtocolAnalytics.h\"\n#include \"ProtocolIAP.h\"\n#include \"ProtocolShare.h\"\n#include \"ProtocolUser.h\"\n#include \"ProtocolSocial.h\"\n\nnamespace cocos2d { namespace plugin {\n\nenum {\n\tkPluginAds = 1,\n\tkPluginAnalytics,\n\tkPluginIAP,\n\tkPluginShare,\n\tkPluginUser,\n\tkPluginSocial,\n};\n\n#define ANDROID_PLUGIN_PACKAGE_PREFIX\t\t\t\"org/cocos2dx/plugin/\"\n\nstatic PluginFactory* s_pFactory = NULL;\n\nPluginFactory::PluginFactory()\n{\n\n}\n\nPluginFactory::~PluginFactory()\n{\n\n}\n\nPluginFactory* PluginFactory::getInstance()\n{\n\tif (NULL == s_pFactory)\n\t{\n\t\ts_pFactory = new PluginFactory();\n\t}\n\n\treturn s_pFactory;\n}\n\nvoid PluginFactory::purgeFactory()\n{\n\tif (NULL != s_pFactory)\n\t{\n\t\tdelete s_pFactory;\n\t\ts_pFactory = NULL;\n\t}\n}\n\n/** create the plugin by name */\nPluginProtocol* PluginFactory::createPlugin(const char* name)\n{\n\tPluginProtocol* pRet = NULL;\n\tdo\n\t{\n\t\tif (name == NULL || strlen(name) == 0) break;\n\n\t\tstd::string jClassName = ANDROID_PLUGIN_PACKAGE_PREFIX;\n\t\tjClassName.append(name);\n\t\tPluginUtils::outputLog(\"PluginFactory\", \"Java class name of plugin %s is : %s\", name, jClassName.c_str());\n\n\t\tPluginJniMethodInfo t;\n\t\tif (! PluginJniHelper::getStaticMethodInfo(t\n\t\t\t, \"org/cocos2dx/plugin/PluginWrapper\"\n\t\t\t, \"initPlugin\"\n\t\t\t, \"(Ljava/lang/String;)Ljava/lang/Object;\"))\n\t\t{\n\t\t\tPluginUtils::outputLog(\"PluginFactory\", \"Can't find method initPlugin in class org.cocos2dx.plugin.PluginWrapper\");\n\t\t\tbreak;\n\t\t}\n\n\t\tjstring clsName = t.env->NewStringUTF(jClassName.c_str());\n\t\tjobject jObj = t.env->CallStaticObjectMethod(t.classID, t.methodID, clsName);\n\t\tt.env->DeleteLocalRef(clsName);\n\t\tt.env->DeleteLocalRef(t.classID);\n\t\tif (jObj == NULL)\n\t\t{\n\t\t\tPluginUtils::outputLog(\"PluginFactory\", \"Can't find java class %s\", jClassName.c_str());\n\t\t\tbreak;\n\t\t}\n\n\t\tif (! PluginJniHelper::getStaticMethodInfo(t\n\t\t\t, \"org/cocos2dx/plugin/PluginWrapper\"\n\t\t\t, \"getPluginType\"\n\t\t\t, \"(Ljava/lang/Object;)I\"))\n\t\t{\n\t\t\tPluginUtils::outputLog(\"PluginFactory\", \"Can't find method getPluginType in class org.cocos2dx.plugin.PluginWrapper\");\n\t\t\tbreak;\n\t\t}\n\t\tint curType = t.env->CallStaticIntMethod(t.classID, t.methodID, jObj);\n\t\tt.env->DeleteLocalRef(t.classID);\n\t\tPluginUtils::outputLog(\"PluginFactory\", \"The type of plugin %s is : %d\", name, curType);\n\n\t\tswitch (curType)\n\t\t{\n\t\tcase kPluginAds:\n\t\t\tpRet = new ProtocolAds();\n\t\t\tbreak;\n\t\tcase kPluginAnalytics:\n\t\t\tpRet = new ProtocolAnalytics();\n\t\t\tbreak;\n\t\tcase kPluginIAP:\n\t\t\tpRet = new ProtocolIAP();\n\t\t\tbreak;\n\t\tcase kPluginShare:\n\t\t\tpRet = new ProtocolShare();\n\t\t\tbreak;\n\t\tcase kPluginUser:\n\t\t    pRet = new ProtocolUser();\n\t\t    break;\n\t\tcase kPluginSocial:\n\t\t    pRet = new ProtocolSocial();\n\t\t    break;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\tif (pRet != NULL)\n\t\t{\n\t\t\tpRet->setPluginName(name);\n\t\t\tPluginUtils::initJavaPlugin(pRet, jObj, jClassName.c_str());\n\t\t}\n\t} while(0);\n\n\treturn pRet;\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginJavaData.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __PLUGIN_JAVA_DATA_H__\n#define __PLUGIN_JAVA_DATA_H__\n\n#include <string>\n#include <jni.h>\n\nnamespace cocos2d { namespace plugin {\n\ntypedef struct _PluginJavaData_\n{\n\tjobject jobj;\n\tstd::string  jclassName;\n} PluginJavaData;\n\n}} //namespace cocos2d { namespace plugin {\n\n#endif // __PLUGIN_JAVA_DATA_H__\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginJniHelper.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"PluginJniHelper.h\"\n#include <android/log.h>\n#include <string.h>\n\n#if 1\n#define  LOG_TAG    \"PluginJniHelper\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n#else\n#define  LOGD(...) \n#endif\n\n#define JAVAVM    cocos2d::PluginJniHelper::getJavaVM()\n\nusing namespace std;\n\nextern \"C\"\n{\n    static bool _getEnv(JNIEnv **env)\n    {\n\n        bool bRet = false;\n\n        do \n        {\n            if(!JAVAVM)\n            {\n                LOGD(\"JavaVM is NULL\");\n                break;\n            }\n\n            if (JAVAVM->GetEnv((void**)env, JNI_VERSION_1_4) != JNI_OK)\n            {\n                LOGD(\"Failed to get the environment using GetEnv()\");\n                break;\n            }\n\n            if (JAVAVM->AttachCurrentThread(env, 0) < 0)\n            {\n                LOGD(\"Failed to get the environment using AttachCurrentThread()\");\n                break;\n            }\n            bRet = true;\n        } while (0);\n\n        return bRet;\n    }\n\n    //////////////////////////////////////////////////////////////////////////\n    // java vm helper function\n    //////////////////////////////////////////////////////////////////////////\n\n    static jclass _getClassIDByLoader(const char *className) {\n        if (NULL == className) {\n            return NULL;\n        }\n\n        JNIEnv* env = cocos2d::PluginJniHelper::getEnv();\n\n        jstring _jstrClassName = env->NewStringUTF(className);\n\n        jclass _clazz = (jclass) env->CallObjectMethod(cocos2d::PluginJniHelper::classloader,\n                                                       cocos2d::PluginJniHelper::loadclassMethod_methodID,\n                                                       _jstrClassName);\n\n        if (NULL == _clazz) {\n            LOGD(\"Classloader failed to find class of %s\", className);\n        }\n\n        env->DeleteLocalRef(_jstrClassName);\n\n        return _clazz;\n    }\n\n    static jclass _getClassID(const char *className, JNIEnv *env)\n    {\n        JNIEnv *pEnv = env;\n        jclass ret = 0;\n\n        do \n        {\n            if (cocos2d::PluginJniHelper::classloader)\n            {\n                ret = _getClassIDByLoader(className);\n                break;\n            }\n\n            if (! pEnv)\n            {\n                pEnv = cocos2d::PluginJniHelper::getEnv();\n                if (! pEnv)\n                {\n                    break;\n                }\n            }\n\n            ret = pEnv->FindClass(className);\n            if (! ret)\n            {\n                 LOGD(\"Failed to find class of %s\", className);\n                break;\n            }\n        } while (0);\n\n        return ret;\n    }\n}\n\nnamespace cocos2d {\n\nJavaVM* PluginJniHelper::_psJavaVM = NULL;\njmethodID PluginJniHelper::loadclassMethod_methodID = NULL;\njobject PluginJniHelper::classloader = NULL;\n\nJavaVM* PluginJniHelper::getJavaVM()\n{\n    return _psJavaVM;\n}\n\nvoid PluginJniHelper::setJavaVM(JavaVM *javaVM)\n{\n    _psJavaVM = javaVM;\n}\n\nJNIEnv* PluginJniHelper::getEnv()\n{\n    JNIEnv* ret = NULL;\n    bool bRet = _getEnv(&ret);\n\n    if (! bRet)\n        ret = NULL;\n\n    return ret;\n}\n\nbool PluginJniHelper::getStaticMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode)\n{\n    if ((NULL == className) ||\n        (NULL == methodName) ||\n        (NULL == paramCode)) {\n        return false;\n    }\n\n    JNIEnv *pEnv = PluginJniHelper::getEnv();\n    if (!pEnv) {\n        LOGD(\"Failed to get JNIEnv\");\n        return false;\n    }\n\n    jclass classID = _getClassID(className, pEnv);\n    if (! classID) {\n        LOGD(\"Failed to find class %s\", className);\n        return false;\n    }\n\n    jmethodID methodID = pEnv->GetStaticMethodID(classID, methodName, paramCode);\n    if (! methodID) {\n        if(pEnv->ExceptionCheck())\n        {\n            pEnv->ExceptionClear();\n        }\n        LOGD(\"Failed to find static method id of %s\", methodName);\n        return false;\n    }\n\n    methodinfo.classID = classID;\n    methodinfo.env = pEnv;\n    methodinfo.methodID = methodID;\n    return true;\n}\n\nbool PluginJniHelper::getMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode)\n{\n    if ((NULL == className) ||\n        (NULL == methodName) ||\n        (NULL == paramCode)) {\n        return false;\n    }\n\n    JNIEnv *pEnv = PluginJniHelper::getEnv();\n    if (!pEnv) {\n        return false;\n    }\n\n    jclass classID = _getClassID(className, pEnv);\n    if (! classID) {\n        LOGD(\"Failed to find class %s\", className);\n        return false;\n    }\n\n    jmethodID methodID = pEnv->GetMethodID(classID, methodName, paramCode);\n    if (! methodID) {\n        if(pEnv->ExceptionCheck())\n        {\n            pEnv->ExceptionClear();\n        }\n        LOGD(\"Failed to find method id of %s\", methodName);\n        return false;\n    }\n\n    methodinfo.classID = classID;\n    methodinfo.env = pEnv;\n    methodinfo.methodID = methodID;\n\n    return true;\n}\n\nstring PluginJniHelper::jstring2string(jstring jstr)\n{\n    if (jstr == NULL) {\n        return \"\";\n    }\n\n    JNIEnv *pEnv = PluginJniHelper::getEnv();\n    if (! pEnv) {\n        return NULL;\n    }\n\n    const char* chars = pEnv->GetStringUTFChars(jstr, NULL);\n    std::string ret(chars);\n    pEnv->ReleaseStringUTFChars(jstr, chars);\n\n    return ret;\n}\n\nbool PluginJniHelper::setClassLoaderFrom(jobject nativeactivityinstance) {\n    PluginJniMethodInfo _getclassloaderMethod;\n    if (!PluginJniHelper::getMethodInfo_DefaultClassLoader(_getclassloaderMethod,\n                                                     \"android/app/NativeActivity\",\n                                                     \"getClassLoader\",\n                                                     \"()Ljava/lang/ClassLoader;\")) {\n        return false;\n    }\n\n    jobject _c = cocos2d::PluginJniHelper::getEnv()->CallObjectMethod(nativeactivityinstance,\n                                                                _getclassloaderMethod.methodID);\n\n    if (NULL == _c) {\n        return false;\n    }\n\n    PluginJniMethodInfo _m;\n    if (!PluginJniHelper::getMethodInfo_DefaultClassLoader(_m,\n                                                     \"java/lang/ClassLoader\",\n                                                     \"loadClass\",\n                                                     \"(Ljava/lang/String;)Ljava/lang/Class;\")) {\n        return false;\n    }\n\n    PluginJniHelper::classloader = _c;\n    PluginJniHelper::loadclassMethod_methodID = _m.methodID;\n\n    return true;\n}\n\nbool PluginJniHelper::getMethodInfo_DefaultClassLoader(PluginJniMethodInfo &methodinfo,\n                                                     const char *className,\n                                                     const char *methodName,\n                                                     const char *paramCode)\n{\n    if ((NULL == className) ||\n        (NULL == methodName) ||\n        (NULL == paramCode)) {\n        return false;\n    }\n\n    JNIEnv *pEnv = PluginJniHelper::getEnv();\n    if (!pEnv) {\n        return false;\n    }\n\n    jclass classID = pEnv->FindClass(className);\n    if (! classID) {\n        LOGD(\"Failed to find class %s\", className);\n        return false;\n    }\n\n    jmethodID methodID = pEnv->GetMethodID(classID, methodName, paramCode);\n    if (! methodID) {\n        LOGD(\"Failed to find method id of %s\", methodName);\n        return false;\n    }\n\n    methodinfo.classID = classID;\n    methodinfo.env = pEnv;\n    methodinfo.methodID = methodID;\n\n    return true;\n}\n\n} // end of namespace cocos2d\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginJniHelper.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __PLUGIN_JNI_HELPER_H__\n#define __PLUGIN_JNI_HELPER_H__\n\n#include <jni.h>\n#include <string>\n\nnamespace cocos2d {\n\ntypedef struct PluginJniMethodInfo_\n{\n    JNIEnv *    env;\n    jclass      classID;\n    jmethodID   methodID;\n} PluginJniMethodInfo;\n\nclass PluginJniHelper\n{\npublic:\n    static JavaVM* getJavaVM();\n    static void setJavaVM(JavaVM *javaVM);\n    static JNIEnv* getEnv();\n\n    static bool getStaticMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);\n    static bool getMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);\n    static std::string jstring2string(jstring jstr);\n\n    static bool setClassLoaderFrom(jobject nativeActivityInstance);\n\n    static jmethodID loadclassMethod_methodID;\n    static jobject classloader;\n\nprivate:\n    static JavaVM *_psJavaVM;\n    static bool getMethodInfo_DefaultClassLoader(PluginJniMethodInfo &methodinfo,\n                                                 const char *className,\n                                                 const char *methodName,\n                                                 const char *paramCode);\n};\n\n}\n\n#endif // __PLUGIN_JNI_HELPER_H__\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginJniMacros.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __PLUGIN_JNI_MACROS_H__\n#define __PLUGIN_JNI_MACROS_H__\n\n#define return_if_fails(cond) if (!(cond)) return;\n#define return_val_if_fails(cond, ret) if(!(cond)) return (ret);\n\n#define CALL_BASERET_JAVA_FUNC_WITH_PARAM(retType, paramCode, param, retCode, defaultRet)     \\\nretType ret = defaultRet;                                        \\\nreturn_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);       \\\nreturn_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret);     \\\nPluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);    \\\nreturn_val_if_fails(pData != NULL, ret);                         \\\n                                                                 \\\nPluginJniMethodInfo t;                                           \\\nif (PluginJniHelper::getMethodInfo(t                             \\\n    , pData->jclassName.c_str()                                  \\\n    , funcName                                                   \\\n    , paramCode))                                                \\\n{                                                                \\\n    ret = t.env->Call##retCode##Method(pData->jobj, t.methodID, param);  \\\n    t.env->DeleteLocalRef(t.classID);                            \\\n}                                                                \\\nreturn ret;                                                      \\\n\n\n#define CALL_BASERET_JAVA_FUNC(retType, paramCode, retCode, defaultRet)   \\\nretType ret = defaultRet;                                        \\\nreturn_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);       \\\nPluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);    \\\nreturn_val_if_fails(pData != NULL, ret);                         \\\n                                                                 \\\nPluginJniMethodInfo t;                                           \\\nif (PluginJniHelper::getMethodInfo(t                             \\\n    , pData->jclassName.c_str()                                  \\\n    , funcName                                                   \\\n    , paramCode))                                                \\\n{                                                                \\\n    ret = t.env->Call##retCode##Method(pData->jobj, t.methodID); \\\n    t.env->DeleteLocalRef(t.classID);                            \\\n}                                                                \\\nreturn ret;                                                      \\\n\n\n#define CALL_JAVA_FUNC_WITH_VALIST(retCode)                  \\\nstd::vector<PluginParam*> allParams;                         \\\nif (NULL != param)                                           \\\n{                                                            \\\n    allParams.push_back(param);                              \\\n                                                             \\\n    va_list argp;                                            \\\n    PluginParam* pArg = NULL;                                \\\n    va_start( argp, param );                                 \\\n    while (1)                                                \\\n    {                                                        \\\n        pArg = va_arg(argp, PluginParam*);                   \\\n        if (pArg == NULL)                                    \\\n            break;                                           \\\n                                                             \\\n        allParams.push_back(pArg);                           \\\n    }                                                        \\\n    va_end(argp);                                            \\\n}                                                            \\\n                                                             \\\nreturn call##retCode##FuncWithParam(funcName, allParams);    \\\n\n\n#define CALL_JAVA_FUNC(retType, retCode, defaultRet, jRetCode)    \\\nretType ret = defaultRet;                                                                                     \\\nPluginJavaData* pData = PluginUtils::getPluginJavaData(this);                                                 \\\nif (NULL == pData) {                                                                                          \\\n    PluginUtils::outputLog(\"PluginProtocol\", \"Can't find java data for plugin : %s\", this->getPluginName());  \\\n    return ret;                                                                                               \\\n}                                                                                                             \\\n                                                                                                              \\\nstd::string paramCode;                                                                                        \\\nint nParamNum = params.size();                                                                                \\\nif (0 == nParamNum)                                                                                           \\\n{                                                                                                             \\\n    paramCode = \"()\";                                                                                         \\\n    paramCode.append(jRetCode);                                                                               \\\n    ret = PluginUtils::callJava##retCode##FuncWithName(this, funcName);                                       \\\n} else                                                                                                        \\\n{                                                                                                             \\\n    PluginParam* pRetParam = NULL;                                                                            \\\n    bool needDel = false;                                                                                     \\\n    if (nParamNum == 1) {                                                                                     \\\n        pRetParam = params[0];                                                                                \\\n    } else {                                                                                                  \\\n        std::map<std::string, PluginParam*> allParams;                                                        \\\n        for (int i = 0; i < nParamNum; i++)                                                                   \\\n        {                                                                                                     \\\n            PluginParam* pArg = params[i];                                                                    \\\n            if (pArg == NULL)                                                                                 \\\n            {                                                                                                 \\\n                break;                                                                                        \\\n            }                                                                                                 \\\n                                                                                                              \\\n            char strKey[8] = { 0 };                                                                           \\\n            sprintf(strKey, \"Param%d\", i + 1);                                                                \\\n            allParams[strKey] = pArg;                                                                         \\\n        }                                                                                                     \\\n                                                                                                              \\\n        pRetParam = new PluginParam(allParams);                                                               \\\n        needDel = true;                                                                                       \\\n    }                                                                                                         \\\n                                                                                                              \\\n    switch(pRetParam->getCurrentType())                                                                       \\\n    {                                                                                                         \\\n    case PluginParam::kParamTypeInt:                                                                          \\\n        paramCode = \"(I)\";                                                                                    \\\n        paramCode.append(jRetCode);                                                                           \\\n        ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getIntValue());         \\\n        break;                                                                                                \\\n    case PluginParam::kParamTypeFloat:                                                                        \\\n        paramCode = \"(F)\";                                                                                    \\\n        paramCode.append(jRetCode);                                                                           \\\n        ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getFloatValue());       \\\n        break;                                                                                                \\\n    case PluginParam::kParamTypeBool:                                                                         \\\n        paramCode = \"(Z)\";                                                                                    \\\n        paramCode.append(jRetCode);                                                                           \\\n        ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getBoolValue());        \\\n        break;                                                                                                \\\n    case PluginParam::kParamTypeString:                                                                       \\\n        {                                                                                                     \\\n            jstring jstr = PluginUtils::getEnv()->NewStringUTF(pRetParam->getStringValue());                  \\\n            paramCode = \"(Ljava/lang/String;)\";                                                               \\\n            paramCode.append(jRetCode);                                                                      \\\n            ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jstr);    \\\n            PluginUtils::getEnv()->DeleteLocalRef(jstr);                                                      \\\n        }                                                                                                     \\\n        break;                                                                                                \\\n    case PluginParam::kParamTypeStringMap:                                                                    \\\n    case PluginParam::kParamTypeMap:                                                                          \\\n        {                                                                                                     \\\n            jobject jMap = PluginUtils::getJObjFromParam(pRetParam);                                          \\\n            paramCode = \"(Lorg/json/JSONObject;)\";                                                            \\\n            paramCode.append(jRetCode);                                                                       \\\n            ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jMap); \\\n            PluginUtils::getEnv()->DeleteLocalRef(jMap);                                                      \\\n        }                                                                                                     \\\n        break;                                                                                                \\\n    default:                                                                                                  \\\n        break;                                                                                                \\\n    }                                                                                                         \\\n                                                                                                              \\\n    if (needDel && pRetParam != NULL)                                                                         \\\n    {                                                                                                         \\\n        delete pRetParam;                                                                                     \\\n        pRetParam = NULL;                                                                                     \\\n    }                                                                                                         \\\n}                                                                                                             \\\nreturn ret;                                                                                                   \\\n\n\n#endif // __PLUGIN_JNI_MACROS_H__\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginProtocol.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"PluginProtocol.h\"\n#include \"PluginUtils.h\"\n\n#define LOG_TAG     \"PluginProtocol\"\n\nnamespace cocos2d { namespace plugin {\n\nPluginProtocol::~PluginProtocol()\n{\n    PluginUtils::erasePluginJavaData(this);\n}\n\nstd::string PluginProtocol::getPluginVersion()\n{\n    return PluginUtils::callJavaStringFuncWithName(this, \"getPluginVersion\");\n}\n\nstd::string PluginProtocol::getSDKVersion()\n{\n    return PluginUtils::callJavaStringFuncWithName(this, \"getSDKVersion\");\n}\n\nvoid PluginProtocol::setDebugMode(bool isDebugMode)\n{\n    PluginUtils::callJavaFunctionWithName_oneParam(this, \"setDebugMode\", \"(Z)V\", isDebugMode);\n}\n\nvoid PluginProtocol::callFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    std::vector<PluginParam*> allParams;\n    if (NULL != param)\n    {\n        allParams.push_back(param);\n\n        va_list argp;\n        PluginParam* pArg = NULL;\n        va_start( argp, param );\n        while (1)\n        {\n            pArg = va_arg(argp, PluginParam*);\n            if (pArg == NULL)\n                break;\n\n            allParams.push_back(pArg);\n        }\n        va_end(argp);\n    }\n\n    callFuncWithParam(funcName, allParams);\n}\n\nvoid PluginProtocol::callFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    if (NULL == pData) {\n        PluginUtils::outputLog(LOG_TAG, \"Can't find java data for plugin : %s\", this->getPluginName());\n        return;\n    }\n\n    int nParamNum = params.size();\n    if (nParamNum == 0)\n    {\n        PluginUtils::callJavaFunctionWithName(this, funcName);\n    } else\n    {\n        PluginParam* pRetParam = NULL;\n        bool needDel = false;\n        if (nParamNum == 1) {\n            pRetParam = params[0];\n        } else {\n            std::map<std::string, PluginParam*> allParams;\n            for (int i = 0; i < nParamNum; i++)\n            {\n                PluginParam* pArg = params[i];\n                if (pArg == NULL)\n                {\n                    break;\n                }\n\n                char strKey[8] = { 0 };\n                sprintf(strKey, \"Param%d\", i + 1);\n                allParams[strKey] = pArg;\n            }\n\n            pRetParam = new PluginParam(allParams);\n            needDel = true;\n        }\n\n        switch(pRetParam->getCurrentType())\n        {\n        case PluginParam::kParamTypeInt:\n            PluginUtils::callJavaFunctionWithName_oneParam(this, funcName, \"(I)V\", pRetParam->getIntValue());\n            break;\n        case PluginParam::kParamTypeFloat:\n            PluginUtils::callJavaFunctionWithName_oneParam(this, funcName, \"(F)V\", pRetParam->getFloatValue());\n            break;\n        case PluginParam::kParamTypeBool:\n            PluginUtils::callJavaFunctionWithName_oneParam(this, funcName, \"(Z)V\", pRetParam->getBoolValue());\n            break;\n        case PluginParam::kParamTypeString:\n            {\n                jstring jstr = PluginUtils::getEnv()->NewStringUTF(pRetParam->getStringValue());\n                PluginUtils::callJavaFunctionWithName_oneParam(this, funcName, \"(Ljava/lang/String;)V\", jstr);\n                PluginUtils::getEnv()->DeleteLocalRef(jstr);\n            }\n            break;\n        case PluginParam::kParamTypeStringMap:\n        case PluginParam::kParamTypeMap:\n            {\n                jobject jMap = PluginUtils::getJObjFromParam(pRetParam);\n                PluginUtils::callJavaFunctionWithName_oneParam(this, funcName, \"(Lorg/json/JSONObject;)V\", jMap);\n                PluginUtils::getEnv()->DeleteLocalRef(jMap);\n            }\n            break;\n        default:\n            break;\n        }\n\n        if (needDel && pRetParam != NULL)\n        {\n            delete pRetParam;\n            pRetParam = NULL;\n        }\n    }\n}\n\nstd::string PluginProtocol::callStringFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_JAVA_FUNC_WITH_VALIST(String)\n}\n\nstd::string PluginProtocol::callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_JAVA_FUNC(std::string, String, \"\", \"Ljava/lang/String;\")\n}\n\nint PluginProtocol::callIntFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_JAVA_FUNC_WITH_VALIST(Int)\n}\n\nint PluginProtocol::callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_JAVA_FUNC(int, Int, 0, \"I\")\n}\n\nbool PluginProtocol::callBoolFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_JAVA_FUNC_WITH_VALIST(Bool)\n}\n\nbool PluginProtocol::callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_JAVA_FUNC(bool, Bool, false, \"Z\")\n}\n\nfloat PluginProtocol::callFloatFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_JAVA_FUNC_WITH_VALIST(Float)\n}\n\nfloat PluginProtocol::callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_JAVA_FUNC(float, Float, 0.0f, \"F\")\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginUtils.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"PluginUtils.h\"\n#include <android/log.h>\n#include <map>\n\n#define MAX_LOG_LEN\t\t\t256\n\nnamespace cocos2d { namespace plugin {\n\n#define JAVAVM    cocos2d::PluginJniHelper::getJavaVM()\n\nvoid PluginUtils::initPluginWrapper(android_app* app)\n{\n    PluginJniMethodInfo t;\n    if (! PluginJniHelper::getStaticMethodInfo(t\n        , \"org/cocos2dx/plugin/PluginWrapper\"\n        , \"initFromNativeActivity\"\n        , \"(Landroid/app/Activity;)V\"))\n    {\n        outputLog(\"PluginUtils\", \"Failed to init context of plugin\");\n        return;\n    }\n\n    t.env->CallStaticVoidMethod(t.classID, t.methodID, app->activity->clazz);\n    t.env->DeleteLocalRef(t.classID);\n}\n\njobject PluginUtils::createJavaMapObject(std::map<std::string, std::string>* paramMap)\n{\n    JNIEnv* env = getEnv();\n\tjclass class_Hashtable = env->FindClass(\"java/util/Hashtable\");\n\tjmethodID construct_method = env->GetMethodID( class_Hashtable, \"<init>\",\"()V\");\n\tjobject obj_Map = env->NewObject( class_Hashtable, construct_method, \"\");\n\tif (paramMap != NULL)\n\t{\n\t\tjmethodID add_method= env->GetMethodID( class_Hashtable,\"put\",\"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;\");\n\t\tfor (std::map<std::string, std::string>::const_iterator it = paramMap->begin(); it != paramMap->end(); ++it)\n\t\t{\n\t\t\tenv->CallObjectMethod(obj_Map, add_method, env->NewStringUTF(it->first.c_str()), env->NewStringUTF(it->second.c_str()));\n\t\t}\n\t}\n    env->DeleteLocalRef(class_Hashtable);\n    return obj_Map;\n}\n\nvoid PluginUtils::initJavaPlugin(PluginProtocol* pPlugin, jobject jObj, const char* className)\n{\n\tcocos2d::plugin::PluginJavaData* pUserData = new cocos2d::plugin::PluginJavaData();\n\tpUserData->jobj = PluginUtils::getEnv()->NewGlobalRef(jObj);\n\tpUserData->jclassName = className;\n\tcocos2d::plugin::PluginUtils::setPluginJavaData(pPlugin, pUserData);\n}\n\nJNIEnv* PluginUtils::getEnv()\n{\n    bool bRet = false;\n    JNIEnv* env = NULL;\n    do \n    {\n        if (JAVAVM->GetEnv((void**)&env, JNI_VERSION_1_4) != JNI_OK)\n        {\n        \toutputLog(\"PluginUtils\", \"Failed to get the environment using GetEnv()\");\n            break;\n        }\n\n        if (JAVAVM->AttachCurrentThread(&env, 0) < 0)\n        {\n            outputLog(\"PluginUtils\", \"Failed to get the environment using AttachCurrentThread()\");\n            break;\n        }\n\n        bRet = true;\n    } while (0);        \n\n    if (!bRet) {\n    \tenv = NULL; \n    }\n\n    return env;\n}\n\nstd::map<PluginProtocol*, PluginJavaData*> s_PluginObjMap;\nstd::map<std::string, PluginProtocol*> s_JObjPluginMap;\n\ntypedef std::map<PluginProtocol*, PluginJavaData*>::iterator ObjMapIter;\ntypedef std::map<std::string, PluginProtocol*>::iterator JObjPluginMapIter;\n\nPluginJavaData* PluginUtils::getPluginJavaData(PluginProtocol* pKeyObj)\n{\n    PluginJavaData* ret = NULL;\n    ObjMapIter it = s_PluginObjMap.find(pKeyObj);\n    if (it != s_PluginObjMap.end()) {\n        ret = it->second;\n    }\n\n    return ret;\n}\n\nPluginProtocol* PluginUtils::getPluginPtr(std::string className)\n{\n\tPluginProtocol* ret = NULL;\n\tJObjPluginMapIter it = s_JObjPluginMap.find(className);\n\tif (it != s_JObjPluginMap.end()) {\n\t\tret = it->second;\n\t}\n\n\treturn ret;\n}\n\nvoid PluginUtils::setPluginJavaData(PluginProtocol* pKeyObj, PluginJavaData* pData)\n{\n    erasePluginJavaData(pKeyObj);\n    s_PluginObjMap.insert(std::pair<PluginProtocol*, PluginJavaData*>(pKeyObj, pData));\n    s_JObjPluginMap.insert(std::pair<std::string, PluginProtocol*>(pData->jclassName, pKeyObj));\n}\n\nvoid PluginUtils::erasePluginJavaData(PluginProtocol* pKeyObj)\n{\n    ObjMapIter it = s_PluginObjMap.find(pKeyObj);\n    if (it != s_PluginObjMap.end()) {\n        PluginJavaData* pData = it->second;\n        if (pData != NULL)\n        {\n            jobject jobj = pData->jobj;\n\n            JObjPluginMapIter pluginIt = s_JObjPluginMap.find(pData->jclassName);\n            if (pluginIt != s_JObjPluginMap.end())\n            {\n            \ts_JObjPluginMap.erase(pluginIt);\n            }\n\n            JNIEnv* pEnv = getEnv();\n            outputLog(\"PluginUtils\", \"Delete global reference.\");\n            pEnv->DeleteGlobalRef(jobj);\n            delete pData;\n        }\n        s_PluginObjMap.erase(it);\n    }\n}\n\nvoid PluginUtils::outputLog(const char* logTag, const char* pFormat, ...)\n{\n\tchar buf[MAX_LOG_LEN + 1];\n\n\tva_list args;\n\tva_start(args, pFormat);\n\tvsnprintf(buf, MAX_LOG_LEN, pFormat, args);\n\tva_end(args);\n\n\t__android_log_print(ANDROID_LOG_DEBUG, logTag, \"%s\", buf);\n}\n\njobject PluginUtils::getJObjFromParam(PluginParam* param)\n{\n\tif (NULL == param)\n\t{\n\t\treturn NULL;\n\t}\n\n\tjobject obj = NULL;\n\tPluginJniMethodInfo t;\n\tJNIEnv* env = PluginUtils::getEnv();\n\n\tswitch(param->getCurrentType())\n\t{\n\tcase PluginParam::kParamTypeInt:\n\t\tif (PluginJniHelper::getStaticMethodInfo(t, \"java/lang/Integer\", \"valueOf\", \"(I)Ljava/lang/Integer;\"))\n\t\t{\n\t\t\tobj = t.env->CallStaticObjectMethod(t.classID, t.methodID, param->getIntValue());\n\t\t}\n\t\tbreak;\n\tcase PluginParam::kParamTypeFloat:\n\t\tif (PluginJniHelper::getStaticMethodInfo(t, \"java/lang/Float\", \"valueOf\", \"(F)Ljava/lang/Float;\"))\n\t\t{\n\t\t\tobj = t.env->CallStaticObjectMethod(t.classID, t.methodID, param->getFloatValue());\n\t\t}\n\t\tbreak;\n\tcase PluginParam::kParamTypeBool:\n\t\tif (PluginJniHelper::getStaticMethodInfo(t, \"java/lang/Boolean\", \"valueOf\", \"(Z)Ljava/lang/Boolean;\"))\n\t\t{\n\t\t\tobj = t.env->CallStaticObjectMethod(t.classID, t.methodID, param->getBoolValue());\n\t\t}\n\t\tbreak;\n\tcase PluginParam::kParamTypeString:\n\t\tobj = env->NewStringUTF(param->getStringValue());\n\t\tbreak;\n\tcase PluginParam::kParamTypeStringMap:\n\t    {\n\t        jclass cls = env->FindClass(\"org/json/JSONObject\");\n            jmethodID mid = env->GetMethodID(cls,\"<init>\",\"()V\");\n            obj = env->NewObject(cls,mid);\n            std::map<std::string, std::string>::iterator it;\n            std::map<std::string, std::string> mapParam = param->getStrMapValue();\n            for (it = mapParam.begin(); it != mapParam.end(); it++)\n            {\n                PluginJniMethodInfo tInfo;\n                if (PluginJniHelper::getMethodInfo(tInfo, \"org/json/JSONObject\", \"put\", \"(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;\"))\n                {\n                    jstring strKey = tInfo.env->NewStringUTF(it->first.c_str());\n                    jstring strValue = tInfo.env->NewStringUTF(it->second.c_str());\n\n                    tInfo.env->CallObjectMethod(obj, tInfo.methodID, strKey, strValue);\n                    tInfo.env->DeleteLocalRef(tInfo.classID);\n\n                    tInfo.env->DeleteLocalRef(strKey);\n                    tInfo.env->DeleteLocalRef(strValue);\n                }\n            }\n        }\n\t    break;\n\tcase PluginParam::kParamTypeMap:\n\t\t{\n\t\t\tjclass cls = env->FindClass(\"org/json/JSONObject\");\n\t\t\tjmethodID mid = env->GetMethodID(cls,\"<init>\",\"()V\");\n\t\t\tobj = env->NewObject(cls,mid);\n\n\t\t\tstd::map<std::string, PluginParam*>::iterator it;\n\t\t\tstd::map<std::string, PluginParam*> mapParam = param->getMapValue();\n\t\t\tfor (it = mapParam.begin(); it != mapParam.end(); it++)\n\t\t\t{\n\t\t\t\tPluginJniMethodInfo tInfo;\n\t\t\t\tif (PluginJniHelper::getMethodInfo(tInfo, \"org/json/JSONObject\", \"put\", \"(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;\"))\n\t\t\t\t{\n\t\t\t\t\tjstring strKey = tInfo.env->NewStringUTF(it->first.c_str());\n\t\t\t\t\tjobject objValue = PluginUtils::getJObjFromParam(it->second);\n\n\t\t\t\t\ttInfo.env->CallObjectMethod(obj, tInfo.methodID, strKey, objValue);\n\t\t\t\t\ttInfo.env->DeleteLocalRef(tInfo.classID);\n\n\t\t\t\t\ttInfo.env->DeleteLocalRef(strKey);\n\t\t\t\t\tPluginUtils::getEnv()->DeleteLocalRef(objValue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\treturn obj;\n}\n\n}}// namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/PluginUtils.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __PLUGIN_UTILS_H__\n#define __PLUGIN_UTILS_H__\n\n#include \"PluginJniHelper.h\"\n#include \"PluginJavaData.h\"\n#include <map>\n#include \"PluginParam.h\"\n#include \"PluginJniMacros.h\"\n#include <android_native_app_glue.h>\n\nnamespace cocos2d { namespace plugin {\n\nclass PluginProtocol;\nclass PluginUtils\n{\npublic:\n    static void initPluginWrapper(android_app* app);\n    static jobject createJavaMapObject(std::map<std::string, std::string>* paramMap);\n    static void initJavaPlugin(PluginProtocol* pPlugin, jobject jObj, const char* className);\n    static JNIEnv* getEnv();\n\n    static PluginJavaData* getPluginJavaData(PluginProtocol* pKeyObj);\n    static void setPluginJavaData(PluginProtocol* pKeyObj, PluginJavaData* pData);\n    static void erasePluginJavaData(PluginProtocol* pKeyObj);\n\n    static PluginProtocol* getPluginPtr(std::string className);\n\n    static jobject getJObjFromParam(PluginParam* param);\n\n    // methods have no return value\n    template <typename T>\n    static void callJavaFunctionWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)\n    {\n        return_if_fails(funcName != NULL && strlen(funcName) > 0);\n        return_if_fails(paramCode != NULL && strlen(paramCode) > 0);\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);\n        return_if_fails(pData != NULL);\n\n        PluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n            , pData->jclassName.c_str()\n            , funcName\n            , paramCode))\n        {\n            t.env->CallVoidMethod(pData->jobj, t.methodID, param);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n    static void callJavaFunctionWithName(PluginProtocol* thiz, const char* funcName)\n    {\n        return_if_fails(funcName != NULL && strlen(funcName) > 0);\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);\n        return_if_fails(pData != NULL);\n\n        PluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n            , pData->jclassName.c_str()\n            , funcName\n            , \"()V\"))\n        {\n            t.env->CallVoidMethod(pData->jobj, t.methodID);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n\n    // methods return value is string\n    template <typename T>\n    static std::string callJavaStringFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)\n    {\n        std::string ret = \"\";\n        return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);\n        return_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret);\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);\n        return_val_if_fails(pData != NULL, ret);\n\n        PluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n            , pData->jclassName.c_str()\n            , funcName\n            , paramCode))\n        {\n            jstring strRet = (jstring)t.env->CallObjectMethod(pData->jobj, t.methodID, param);\n            ret = PluginJniHelper::jstring2string(strRet);\n            t.env->DeleteLocalRef(t.classID);\n        }\n        return ret;\n    }\n    static std::string callJavaStringFuncWithName(PluginProtocol* thiz, const char* funcName)\n    {\n        std::string ret = \"\";\n        return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);\n        return_val_if_fails(pData != NULL, ret);\n\n        PluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n            , pData->jclassName.c_str()\n            , funcName\n            , \"()Ljava/lang/String;\"))\n        {\n            jstring strRet = (jstring) t.env->CallObjectMethod(pData->jobj, t.methodID);\n            ret = PluginJniHelper::jstring2string(strRet);\n            t.env->DeleteLocalRef(t.classID);\n        }\n        return ret;\n    }\n\n    // methods return value is int\n    template <typename T>\n    static int callJavaIntFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)\n    {\n        CALL_BASERET_JAVA_FUNC_WITH_PARAM(int, paramCode, param, Int, 0)\n    }\n    static int callJavaIntFuncWithName(PluginProtocol* thiz, const char* funcName)\n    {\n        CALL_BASERET_JAVA_FUNC(int, \"()I\", Int, 0)\n    }\n\n    // methods return value is float\n    template <typename T>\n    static float callJavaFloatFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)\n    {\n        CALL_BASERET_JAVA_FUNC_WITH_PARAM(float, paramCode, param, Float, 0.0f)\n    }\n    static float callJavaFloatFuncWithName(PluginProtocol* thiz, const char* funcName)\n    {\n        CALL_BASERET_JAVA_FUNC(float, \"()F\", Float, 0.0f);\n    }\n\n    // methods return value is bool\n    template <typename T>\n    static bool callJavaBoolFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)\n    {\n        CALL_BASERET_JAVA_FUNC_WITH_PARAM(bool, paramCode, param, Boolean, false)\n    }\n    static bool callJavaBoolFuncWithName(PluginProtocol* thiz, const char* funcName)\n    {\n        CALL_BASERET_JAVA_FUNC(bool, \"()Z\", Boolean, false)\n    }\n\n    static void outputLog(const char* logTag, const char* pFormat, ...);\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n#endif //__PLUGIN_UTILS_H__\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/ProtocolAds.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolAds.h\"\n#include \"PluginJniHelper.h\"\n#include <android/log.h>\n#include \"PluginUtils.h\"\n#include \"PluginJavaData.h\"\n\nnamespace cocos2d { namespace plugin {\n\nextern \"C\" {\n\tJNIEXPORT void JNICALL Java_org_cocos2dx_plugin_AdsWrapper_nativeOnAdsResult(JNIEnv*  env, jobject thiz, jstring className, jint ret, jstring msg) {\n\t\tstd::string strMsg = PluginJniHelper::jstring2string(msg);\n\t\tstd::string strClassName = PluginJniHelper::jstring2string(className);\n\t\tPluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);\n\t\tPluginUtils::outputLog(\"ProtocolAds\", \"nativeOnAdsResult(), Get plugin ptr : %p\", pPlugin);\n\t\tif (pPlugin != NULL)\n\t\t{\n\t\t\tPluginUtils::outputLog(\"ProtocolAds\", \"nativeOnAdsResult(), Get plugin name : %s\", pPlugin->getPluginName());\n\t\t\tProtocolAds* pAds = dynamic_cast<ProtocolAds*>(pPlugin);\n\t\t\tif (pAds != NULL)\n\t\t\t{\n\t\t\t    AdsListener* listener = pAds->getAdsListener();\n\t\t\t    if (listener)\n\t\t\t\t{\n\t\t\t        listener->onAdsResult((AdsResultCode) ret, strMsg.c_str());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tJNIEXPORT void JNICALL Java_org_cocos2dx_plugin_AdsWrapper_nativeOnPlayerGetPoints(JNIEnv*  env, jobject thiz, jstring className, jint points) {\n\t\tstd::string strClassName = PluginJniHelper::jstring2string(className);\n\t\tPluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);\n\t\tPluginUtils::outputLog(\"ProtocolAds\", \"nativeOnPlayerGetPoints(), Get plugin ptr : %p\", pPlugin);\n\t\tif (pPlugin != NULL)\n\t\t{\n\t\t\tPluginUtils::outputLog(\"ProtocolAds\", \"nativeOnPlayerGetPoints(), Get plugin name : %s\", pPlugin->getPluginName());\n\t\t\tProtocolAds* pAds = dynamic_cast<ProtocolAds*>(pPlugin);\n\t\t\tif (pAds != NULL)\n\t\t\t{\n\t\t\t    AdsListener* listener = pAds->getAdsListener();\n                if (listener)\n                {\n                    listener->onPlayerGetPoints(pAds, points);\n                }\n\t\t\t}\n\t\t}\n\t}\n}\n\nProtocolAds::ProtocolAds()\n: _listener(NULL)\n{\n}\n\nProtocolAds::~ProtocolAds()\n{\n}\n\nvoid ProtocolAds::configDeveloperInfo(TAdsDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtils::outputLog(\"ProtocolAds\", \"The application info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    \tPluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n    \t\t, pData->jclassName.c_str()\n    \t\t, \"configDeveloperInfo\"\n    \t\t, \"(Ljava/util/Hashtable;)V\"))\n    \t{\n        \t// generate the hashtable from map\n        \tjobject obj_Map = PluginUtils::createJavaMapObject(&devInfo);\n\n            // invoke java method\n            t.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n            t.env->DeleteLocalRef(obj_Map);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n}\n\nvoid ProtocolAds::showAds(TAdsInfo info, AdsPos pos)\n{\n\tPluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n\tPluginJniMethodInfo t;\n\n\tPluginUtils::outputLog(\"ProtocolAds\", \"Class name : %s\", pData->jclassName.c_str());\n\tif (PluginJniHelper::getMethodInfo(t\n\t\t, pData->jclassName.c_str()\n\t\t, \"showAds\"\n\t\t, \"(Ljava/util/Hashtable;I)V\"))\n\t{\n\t    jobject obj_Map = PluginUtils::createJavaMapObject(&info);\n\t\tt.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map, pos);\n\t\tt.env->DeleteLocalRef(obj_Map);\n\t\tt.env->DeleteLocalRef(t.classID);\n\t}\n}\n\nvoid ProtocolAds::hideAds(TAdsInfo info)\n{\n    PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    PluginJniMethodInfo t;\n\n    PluginUtils::outputLog(\"ProtocolAds\", \"Class name : %s\", pData->jclassName.c_str());\n    if (PluginJniHelper::getMethodInfo(t\n        , pData->jclassName.c_str()\n        , \"hideAds\"\n        , \"(Ljava/util/Hashtable;)V\"))\n    {\n        jobject obj_Map = PluginUtils::createJavaMapObject(&info);\n        t.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n        t.env->DeleteLocalRef(obj_Map);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\nvoid ProtocolAds::queryPoints()\n{\n    PluginUtils::callJavaFunctionWithName(this, \"queryPoints\");\n}\n\nvoid ProtocolAds::spendPoints(int points)\n{\n\tPluginUtils::callJavaFunctionWithName_oneParam(this, \"spendPoints\", \"(I)V\", points);\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/ProtocolAnalytics.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolAnalytics.h\"\n#include \"PluginJniHelper.h\"\n#include <android/log.h>\n#include \"PluginUtils.h\"\n#include \"PluginJavaData.h\"\n\nnamespace cocos2d { namespace plugin {\n\nstatic void callJavaFunctionWithName_string_map(ProtocolAnalytics* thiz, const char* funcName, const char* keyParam, LogEventParamMap* paramMap)\n{\n\treturn_if_fails(funcName != NULL && strlen(funcName) > 0);\n\treturn_if_fails(keyParam != NULL);\n\n    PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);\n\n\tPluginJniMethodInfo t;\n    if (NULL == paramMap)\n    {\n    \tif (PluginJniHelper::getMethodInfo(t\n    \t\t, pData->jclassName.c_str()\n    \t\t, funcName\n    \t\t, \"(Ljava/lang/String;)V\"))\n    \t{\n    \t\tjstring jeventId = t.env->NewStringUTF(keyParam);\n    \t\tt.env->CallVoidMethod(pData->jobj, t.methodID, jeventId);\n    \t\tt.env->DeleteLocalRef(jeventId);\n    \t\tt.env->DeleteLocalRef(t.classID);\n    \t}\n    }\n    else\n    {\n    \tif (PluginJniHelper::getMethodInfo(t\n    \t\t, pData->jclassName.c_str()\n    \t\t, funcName\n    \t\t, \"(Ljava/lang/String;Ljava/util/Hashtable;)V\"))\n    \t{\n    \t\tjstring jeventId = t.env->NewStringUTF(keyParam);\n    \t\tjobject obj_Map = PluginUtils::createJavaMapObject(paramMap);\n    \t\tt.env->CallVoidMethod(pData->jobj, t.methodID, jeventId, obj_Map);\n    \t\tt.env->DeleteLocalRef(jeventId);\n    \t\tt.env->DeleteLocalRef(obj_Map);\n            t.env->DeleteLocalRef(t.classID);\n    \t}\n    }\n}\n\nProtocolAnalytics::ProtocolAnalytics()\n{\n}\n\nProtocolAnalytics::~ProtocolAnalytics()\n{\n}\n\nvoid ProtocolAnalytics::startSession(const char* appKey)\n{\n\tcallJavaFunctionWithName_string_map(this, \"startSession\", appKey, NULL);\n}\n\nvoid ProtocolAnalytics::stopSession()\n{\n    PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    PluginJniMethodInfo t;\n    if (PluginJniHelper::getMethodInfo(t\n        , pData->jclassName.c_str()\n        , \"stopSession\"\n        , \"()V\"))\n    {\n        t.env->CallVoidMethod(pData->jobj, t.methodID);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\nvoid ProtocolAnalytics::setSessionContinueMillis(long millis)\n{\n\tPluginUtils::callJavaFunctionWithName_oneParam(this, \"setSessionContinueMillis\", \"(I)V\", millis);\n}\n\nvoid ProtocolAnalytics::setCaptureUncaughtException(bool isEnabled)\n{\n\tPluginUtils::callJavaFunctionWithName_oneParam(this, \"setCaptureUncaughtException\", \"(Z)V\", isEnabled);\n}\n\nvoid ProtocolAnalytics::logError(const char* errorId, const char* message)\n{\n\treturn_if_fails(errorId != NULL && strlen(errorId) > 0);\n\treturn_if_fails(message != NULL && strlen(message) > 0);\n\n    PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    PluginJniMethodInfo t;\n\tif (PluginJniHelper::getMethodInfo(t\n\t\t, pData->jclassName.c_str()\n\t\t, \"logError\"\n\t\t, \"(Ljava/lang/String;Ljava/lang/String;)V\"))\n\t{\n\t\tjstring jerrorId = t.env->NewStringUTF(errorId);\n\t\tjstring jmessage = t.env->NewStringUTF(message);\n\n\t\tt.env->CallVoidMethod(pData->jobj, t.methodID, jerrorId, jmessage);\n\t\tt.env->DeleteLocalRef(jerrorId);\n\t\tt.env->DeleteLocalRef(jmessage);\n\t\tt.env->DeleteLocalRef(t.classID);\n\t}\n}\n\nvoid ProtocolAnalytics::logEvent(const char* eventId, LogEventParamMap* pParams/* = NULL */)\n{\n\tcallJavaFunctionWithName_string_map(this, \"logEvent\", eventId, pParams);\n}\n\nvoid ProtocolAnalytics::logTimedEventBegin(const char* eventId)\n{\n\tcallJavaFunctionWithName_string_map(this, \"logTimedEventBegin\", eventId, NULL);\n}\n\nvoid ProtocolAnalytics::logTimedEventEnd(const char* eventId)\n{\n\tcallJavaFunctionWithName_string_map(this, \"logTimedEventEnd\", eventId, NULL);\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/ProtocolIAP.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolIAP.h\"\n#include \"PluginJniHelper.h\"\n#include <android/log.h>\n#include \"PluginUtils.h\"\n#include \"PluginJavaData.h\"\n\nnamespace cocos2d { namespace plugin {\n\nextern \"C\" {\n\tJNIEXPORT void JNICALL Java_org_cocos2dx_plugin_IAPWrapper_nativeOnPayResult(JNIEnv*  env, jobject thiz, jstring className, jint ret, jstring msg)\n\t{\n\t\tstd::string strMsg = PluginJniHelper::jstring2string(msg);\n\t\tstd::string strClassName = PluginJniHelper::jstring2string(className);\n\t\tPluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);\n\t\tPluginUtils::outputLog(\"ProtocolIAP\", \"nativeOnPayResult(), Get plugin ptr : %p\", pPlugin);\n\t\tif (pPlugin != NULL)\n\t\t{\n\t\t\tPluginUtils::outputLog(\"ProtocolIAP\", \"nativeOnPayResult(), Get plugin name : %s\", pPlugin->getPluginName());\n\t\t\tProtocolIAP* pIAP = dynamic_cast<ProtocolIAP*>(pPlugin);\n\t\t\tif (pIAP != NULL)\n\t\t\t{\n\t\t\t\tpIAP->onPayResult((PayResultCode) ret, strMsg.c_str());\n\t\t\t}\n\t\t}\n\t}\n}\n\nbool ProtocolIAP::_paying = false;\n\nProtocolIAP::ProtocolIAP()\n: _listener(NULL)\n{\n}\n\nProtocolIAP::~ProtocolIAP()\n{\n}\n\nvoid ProtocolIAP::configDeveloperInfo(TIAPDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtils::outputLog(\"ProtocolIAP\", \"The developer info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    \tPluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n    \t\t, pData->jclassName.c_str()\n    \t\t, \"configDeveloperInfo\"\n    \t\t, \"(Ljava/util/Hashtable;)V\"))\n    \t{\n        \t// generate the hashtable from map\n        \tjobject obj_Map = PluginUtils::createJavaMapObject(&devInfo);\n\n            // invoke java method\n            t.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n            t.env->DeleteLocalRef(obj_Map);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n}\n\nvoid ProtocolIAP::payForProduct(TProductInfo info)\n{\n    if (_paying)\n    {\n        PluginUtils::outputLog(\"ProtocolIAP\", \"Now is paying\");\n        return;\n    }\n\n    if (info.empty())\n    {\n        if (NULL != _listener)\n        {\n            onPayResult(kPayFail, \"Product info error\");\n        }\n        PluginUtils::outputLog(\"ProtocolIAP\", \"The product info is empty!\");\n        return;\n    }\n    else\n    {\n        _paying = true;\n        _curInfo = info;\n\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n\t\tPluginJniMethodInfo t;\n\t\tif (PluginJniHelper::getMethodInfo(t\n\t\t\t, pData->jclassName.c_str()\n\t\t\t, \"payForProduct\"\n\t\t\t, \"(Ljava/util/Hashtable;)V\"))\n\t\t{\n\t\t\t// generate the hashtable from map\n\t\t\tjobject obj_Map = PluginUtils::createJavaMapObject(&info);\n\n\t\t\t// invoke java method\n\t\t\tt.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n\t\t\tt.env->DeleteLocalRef(obj_Map);\n\t\t\tt.env->DeleteLocalRef(t.classID);\n\t\t}\n    }\n}\n\nvoid ProtocolIAP::setResultListener(PayResultListener* pListener)\n{\n\t_listener = pListener;\n}\n\nvoid ProtocolIAP::onPayResult(PayResultCode ret, const char* msg)\n{\n    _paying = false;\n    if (_listener)\n    {\n    \t_listener->onPayResult(ret, msg, _curInfo);\n    }\n    else\n    {\n        PluginUtils::outputLog(\"ProtocolIAP\", \"Result listener is null!\");\n    }\n    _curInfo.clear();\n    PluginUtils::outputLog(\"ProtocolIAP\", \"Pay result is : %d(%s)\", (int) ret, msg);\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/ProtocolShare.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolShare.h\"\n#include \"PluginJniHelper.h\"\n#include <android/log.h>\n#include \"PluginUtils.h\"\n#include \"PluginJavaData.h\"\n\nnamespace cocos2d { namespace plugin {\n\nextern \"C\" {\n\tJNIEXPORT void JNICALL Java_org_cocos2dx_plugin_ShareWrapper_nativeOnShareResult(JNIEnv*  env, jobject thiz, jstring className, jint ret, jstring msg)\n\t{\n\t\tstd::string strMsg = PluginJniHelper::jstring2string(msg);\n\t\tstd::string strClassName = PluginJniHelper::jstring2string(className);\n\t\tPluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);\n\t\tPluginUtils::outputLog(\"ProtocolShare\", \"nativeOnShareResult(), Get plugin ptr : %p\", pPlugin);\n\t\tif (pPlugin != NULL)\n\t\t{\n\t\t\tPluginUtils::outputLog(\"ProtocolShare\", \"nativeOnShareResult(), Get plugin name : %s\", pPlugin->getPluginName());\n\t\t\tProtocolShare* pShare = dynamic_cast<ProtocolShare*>(pPlugin);\n\t\t\tif (pShare != NULL)\n\t\t\t{\n\t\t\t\tpShare->onShareResult((ShareResultCode) ret, strMsg.c_str());\n\t\t\t}\n\t\t}\n\t}\n}\n\nProtocolShare::ProtocolShare()\n: _listener(NULL)\n{\n}\n\nProtocolShare::~ProtocolShare()\n{\n}\n\nvoid ProtocolShare::configDeveloperInfo(TShareDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtils::outputLog(\"ProtocolShare\", \"The developer info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    \tPluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n    \t\t, pData->jclassName.c_str()\n    \t\t, \"configDeveloperInfo\"\n    \t\t, \"(Ljava/util/Hashtable;)V\"))\n    \t{\n        \t// generate the hashtable from map\n        \tjobject obj_Map = PluginUtils::createJavaMapObject(&devInfo);\n\n            // invoke java method\n            t.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n            t.env->DeleteLocalRef(obj_Map);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n}\n\nvoid ProtocolShare::share(TShareInfo info)\n{\n    if (info.empty())\n    {\n        if (NULL != _listener)\n        {\n            onShareResult(kShareFail, \"Share info error\");\n        }\n        PluginUtils::outputLog(\"ProtocolShare\", \"The Share info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n\t\tPluginJniMethodInfo t;\n\t\tif (PluginJniHelper::getMethodInfo(t\n\t\t\t, pData->jclassName.c_str()\n\t\t\t, \"share\"\n\t\t\t, \"(Ljava/util/Hashtable;)V\"))\n\t\t{\n\t\t\t// generate the hashtable from map\n\t\t\tjobject obj_Map = PluginUtils::createJavaMapObject(&info);\n\n\t\t\t// invoke java method\n\t\t\tt.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n\t\t\tt.env->DeleteLocalRef(obj_Map);\n\t\t\tt.env->DeleteLocalRef(t.classID);\n\t\t}\n    }\n}\n\nvoid ProtocolShare::setResultListener(ShareResultListener* pListener)\n{\n\t_listener = pListener;\n}\n\nvoid ProtocolShare::onShareResult(ShareResultCode ret, const char* msg)\n{\n    if (_listener)\n    {\n    \t_listener->onShareResult(ret, msg);\n    }\n    else\n    {\n        PluginUtils::outputLog(\"ProtocolShare\", \"Result listener is null!\");\n    }\n    PluginUtils::outputLog(\"ProtocolShare\", \"Share result is : %d(%s)\", (int) ret, msg);\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/ProtocolSocial.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolSocial.h\"\n#include \"PluginJniHelper.h\"\n#include <android/log.h>\n#include \"PluginUtils.h\"\n#include \"PluginJavaData.h\"\n\nnamespace cocos2d { namespace plugin {\n\nextern \"C\" {\n    JNIEXPORT void JNICALL Java_org_cocos2dx_plugin_SocialWrapper_nativeOnSocialResult(JNIEnv*  env, jobject thiz, jstring className, jint ret, jstring msg)\n    {\n        std::string strMsg = PluginJniHelper::jstring2string(msg);\n        std::string strClassName = PluginJniHelper::jstring2string(className);\n        PluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);\n        PluginUtils::outputLog(\"ProtocolSocial\", \"nativeOnSocialResult(), Get plugin ptr : %p\", pPlugin);\n        if (pPlugin != NULL)\n        {\n            PluginUtils::outputLog(\"ProtocolSocial\", \"nativeOnSocialResult(), Get plugin name : %s\", pPlugin->getPluginName());\n            ProtocolSocial* pSocial = dynamic_cast<ProtocolSocial*>(pPlugin);\n            if (pSocial != NULL)\n            {\n                SocialListener* pListener = pSocial->getListener();\n                if (NULL != pListener)\n                {\n                    pListener->onSocialResult((SocialRetCode) ret, strMsg.c_str());\n                }\n            }\n        }\n    }\n}\n\nProtocolSocial::ProtocolSocial()\n: _listener(NULL)\n{\n}\n\nProtocolSocial::~ProtocolSocial()\n{\n}\n\nvoid ProtocolSocial::configDeveloperInfo(TSocialDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtils::outputLog(\"ProtocolSocial\", \"The developer info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n        PluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n            , pData->jclassName.c_str()\n            , \"configDeveloperInfo\"\n            , \"(Ljava/util/Hashtable;)V\"))\n        {\n            // generate the hashtable from map\n            jobject obj_Map = PluginUtils::createJavaMapObject(&devInfo);\n\n            // invoke java method\n            t.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n            t.env->DeleteLocalRef(obj_Map);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n}\n\nvoid ProtocolSocial::submitScore(const char* leadboardID, long score)\n{\n    PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    PluginJniMethodInfo t;\n    if (PluginJniHelper::getMethodInfo(t\n        , pData->jclassName.c_str()\n        , \"submitScore\"\n        , \"(Ljava/lang/String;J)V\"))\n    {\n        jstring strID = PluginUtils::getEnv()->NewStringUTF(leadboardID);\n\n        // invoke java method\n        t.env->CallVoidMethod(pData->jobj, t.methodID, strID, score);\n        t.env->DeleteLocalRef(strID);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\nvoid ProtocolSocial::showLeaderboard(const char* leaderboardID)\n{\n    PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    PluginJniMethodInfo t;\n    if (PluginJniHelper::getMethodInfo(t\n        , pData->jclassName.c_str()\n        , \"showLeaderboard\"\n        , \"(Ljava/lang/String;)V\"))\n    {\n        jstring strID = PluginUtils::getEnv()->NewStringUTF(leaderboardID);\n\n        // invoke java method\n        t.env->CallVoidMethod(pData->jobj, t.methodID, strID);\n        t.env->DeleteLocalRef(strID);\n        t.env->DeleteLocalRef(t.classID);\n    }\n}\n\nvoid ProtocolSocial::unlockAchievement(TAchievementInfo achInfo)\n{\n    if (achInfo.empty())\n    {\n        PluginUtils::outputLog(\"ProtocolSocial\", \"The achievement info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n        PluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n            , pData->jclassName.c_str()\n            , \"unlockAchievement\"\n            , \"(Ljava/util/Hashtable;)V\"))\n        {\n            // generate the hashtable from map\n            jobject obj_Map = PluginUtils::createJavaMapObject(&achInfo);\n\n            // invoke java method\n            t.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n            t.env->DeleteLocalRef(obj_Map);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n}\n\nvoid ProtocolSocial::showAchievements()\n{\n    PluginUtils::callJavaFunctionWithName(this, \"showAchievements\");\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/android/ProtocolUser.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolUser.h\"\n#include \"PluginJniHelper.h\"\n#include <android/log.h>\n#include \"PluginUtils.h\"\n#include \"PluginJavaData.h\"\n\nnamespace cocos2d { namespace plugin {\n\nextern \"C\" {\n\tJNIEXPORT void JNICALL Java_org_cocos2dx_plugin_UserWrapper_nativeOnActionResult(JNIEnv*  env, jobject thiz, jstring className, jint ret, jstring msg)\n\t{\n\t\tstd::string strMsg = PluginJniHelper::jstring2string(msg);\n\t\tstd::string strClassName = PluginJniHelper::jstring2string(className);\n\t\tPluginProtocol* pPlugin = PluginUtils::getPluginPtr(strClassName);\n\t\tPluginUtils::outputLog(\"ProtocolUser\", \"nativeOnActionResult(), Get plugin ptr : %p\", pPlugin);\n\t\tif (pPlugin != NULL)\n\t\t{\n\t\t\tPluginUtils::outputLog(\"ProtocolUser\", \"nativeOnActionResult(), Get plugin name : %s\", pPlugin->getPluginName());\n\t\t\tProtocolUser* pUser = dynamic_cast<ProtocolUser*>(pPlugin);\n\t\t\tif (pUser != NULL)\n\t\t\t{\n\t\t\t    UserActionListener* listener = pUser->getActionListener();\n\t\t\t    if (NULL != listener)\n\t\t\t    {\n\t\t\t        listener->onActionResult(pUser, (UserActionResultCode) ret, strMsg.c_str());\n\t\t\t    }\n\t\t\t    else\n\t\t\t    {\n\t\t\t        PluginUtils::outputLog(\"Listener of plugin %s not set correctly\", pPlugin->getPluginName());\n\t\t\t    }\n\t\t\t}\n\t\t}\n\t}\n}\n\nProtocolUser::ProtocolUser()\n: _listener(NULL)\n{\n}\n\nProtocolUser::~ProtocolUser()\n{\n}\n\nvoid ProtocolUser::configDeveloperInfo(TUserDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtils::outputLog(\"ProtocolUser\", \"The developer info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginJavaData* pData = PluginUtils::getPluginJavaData(this);\n    \tPluginJniMethodInfo t;\n        if (PluginJniHelper::getMethodInfo(t\n    \t\t, pData->jclassName.c_str()\n    \t\t, \"configDeveloperInfo\"\n    \t\t, \"(Ljava/util/Hashtable;)V\"))\n    \t{\n        \t// generate the hashtable from map\n        \tjobject obj_Map = PluginUtils::createJavaMapObject(&devInfo);\n\n            // invoke java method\n            t.env->CallVoidMethod(pData->jobj, t.methodID, obj_Map);\n            t.env->DeleteLocalRef(obj_Map);\n            t.env->DeleteLocalRef(t.classID);\n        }\n    }\n}\n\nvoid ProtocolUser::login()\n{\n    PluginUtils::callJavaFunctionWithName(this, \"login\");\n}\n\nvoid ProtocolUser::logout()\n{\n    PluginUtils::callJavaFunctionWithName(this, \"logout\");\n}\n\nbool ProtocolUser::isLogined()\n{\n    return PluginUtils::callJavaBoolFuncWithName(this, \"isLogined\");\n}\n\nstd::string ProtocolUser::getSessionID()\n{\n    return PluginUtils::callJavaStringFuncWithName(this, \"getSessionID\");\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/AdsWrapper.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n\ntypedef enum {\n    kAdsReceived = 0,\n    \n    kAdsShown,\n    kAdsDismissed,\n    \n    kPointsSpendSucceed,\n    kPointsSpendFailed,\n    \n    kNetworkError,\n    kUnknownError,\n} AdsResult;\n\ntypedef enum {\n    kPosCenter = 0,\n\tkPosTop,\n\tkPosTopLeft,\n\tkPosTopRight,\n\tkPosBottom,\n\tkPosBottomLeft,\n\tkPosBottomRight,\n} AdsPosEnum;\n\n@interface AdsWrapper : NSObject\n{\n    \n}\n\n+ (void) onAdsResult:(id) obj withRet:(AdsResult) ret withMsg:(NSString*) msg;\n+ (void) onPlayerGetPoints:(id) obj withPoints: (int) points;\n+ (void) addAdView:(UIView*) view atPos:(AdsPosEnum) pos;\n+ (UIViewController *) getCurrentRootViewController;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/AdsWrapper.mm",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import \"AdsWrapper.h\"\n#include \"PluginUtilsIOS.h\"\n#include \"ProtocolAds.h\"\n\nusing namespace cocos2d::plugin;\n\n@implementation AdsWrapper\n\n+ (void) onAdsResult:(id) obj withRet:(AdsResult) ret withMsg:(NSString*) msg\n{\n    PluginProtocol* plugin = PluginUtilsIOS::getPluginPtr(obj);\n    ProtocolAds* adsPlugin = dynamic_cast<ProtocolAds*>(plugin);\n    if (adsPlugin) {\n        const char* chMsg = [msg UTF8String];\n        AdsResultCode cRet = (AdsResultCode) ret;\n        AdsListener* listener = adsPlugin->getAdsListener();\n        if (listener)\n        {\n            listener->onAdsResult(cRet, chMsg);\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Can't find the C++ object of the ads plugin\");\n    }\n}\n\n+ (void) onPlayerGetPoints:(id) obj withPoints: (int) points\n{\n    PluginProtocol* plugin = PluginUtilsIOS::getPluginPtr(obj);\n    ProtocolAds* adsPlugin = dynamic_cast<ProtocolAds*>(plugin);\n    if (adsPlugin) {\n        AdsListener* listener = adsPlugin->getAdsListener();\n        if (listener)\n        {\n            listener->onPlayerGetPoints(adsPlugin, points);\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Can't find the C++ object of the ads plugin\");\n    }\n}\n\n+ (void) addAdView:(UIView*) view atPos:(AdsPosEnum) pos\n{\n    UIViewController* controller = [AdsWrapper getCurrentRootViewController];\n\n    if (nil == controller) {\n        PluginUtilsIOS::outputLog(\"Can't get the UIViewController object\");\n        return;\n    }\n\n    CGSize rootSize = controller.view.frame.size;\n    CGSize viewSize = view.frame.size;\n    CGPoint viewOrigin;\n\n    if (UIInterfaceOrientationIsLandscape(controller.interfaceOrientation)){\n        CGFloat temp = rootSize.width;\n        rootSize.width = rootSize.height;\n        rootSize.height = temp;\n    }\n\n    switch (pos) {\n    case kPosTop:\n        viewOrigin.x = (rootSize.width - viewSize.width) / 2;\n        viewOrigin.y = 0.0f;\n        break;\n    case kPosTopLeft:\n        viewOrigin.x = 0.0f;\n        viewOrigin.y = 0.0f;\n        break;\n    case kPosTopRight:\n        viewOrigin.x = rootSize.width - viewSize.width;\n        viewOrigin.y = 0.0f;\n        break;\n    case kPosBottom:\n        viewOrigin.x = (rootSize.width - viewSize.width) / 2;\n        viewOrigin.y = rootSize.height - viewSize.height;\n        break;\n    case kPosBottomLeft:\n        viewOrigin.x = 0.0f;\n        viewOrigin.y = rootSize.height - viewSize.height;\n        break;\n    case kPosBottomRight:\n        viewOrigin.x = rootSize.width - viewSize.width;\n        viewOrigin.y = rootSize.height - viewSize.height;\n        break;\n    case kPosCenter:\n    default:\n        viewOrigin.x = (rootSize.width - viewSize.width) / 2;\n        viewOrigin.y = (rootSize.height - viewSize.height) / 2;\n        break;\n    }\n\n    CGRect rect = CGRectMake(viewOrigin.x, viewOrigin.y, viewSize.width, viewSize.height);\n    view.frame = rect;\n    [controller.view addSubview:view];\n}\n\n+ (UIViewController *)getCurrentRootViewController {\n    \n    UIViewController *result = nil;\n    \n    // Try to find the root view controller programmically\n    \n    // Find the top window (that is not an alert view or other window)\n    UIWindow *topWindow = [[UIApplication sharedApplication] keyWindow];\n    if (topWindow.windowLevel != UIWindowLevelNormal)\n    {\n        NSArray *windows = [[UIApplication sharedApplication] windows];\n        for(topWindow in windows)\n        {\n            if (topWindow.windowLevel == UIWindowLevelNormal)\n                break;\n        }\n    }\n    \n    UIView *rootView = [[topWindow subviews] objectAtIndex:0];\n    id nextResponder = [rootView nextResponder];\n    \n    if ([nextResponder isKindOfClass:[UIViewController class]])\n        result = nextResponder;\n    else if ([topWindow respondsToSelector:@selector(rootViewController)] && topWindow.rootViewController != nil)\n        result = topWindow.rootViewController;\n    else\n        NSAssert(NO, @\"Could not find a root view controller.\");\n    \n    return result;\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/InterfaceAds.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import <Foundation/Foundation.h>\n\n@protocol InterfaceAds <NSObject>\n\n- (void) configDeveloperInfo: (NSMutableDictionary*) devInfo;\n- (void) showAds: (NSMutableDictionary*) info position:(int) pos;\n- (void) hideAds: (NSMutableDictionary*) info;\n- (void) queryPoints;\n- (void) spendPoints: (int) points;\n- (void) setDebugMode: (BOOL) debug;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/InterfaceAnalytics.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import <Foundation/Foundation.h>\n\n@protocol InterfaceAnalytics <NSObject>\n\n- (void) startSession: (NSString*) appKey;\n- (void) stopSession;\n- (void) setSessionContinueMillis: (long) millis;\n- (void) setCaptureUncaughtException: (BOOL) isEnabled;\n- (void) setDebugMode: (BOOL) debug;\n- (void) logError: (NSString*) errorId withMsg:(NSString*) message;\n- (void) logEvent: (NSString*) eventId;\n- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap;\n- (void) logTimedEventBegin: (NSString*) eventId;\n- (void) logTimedEventEnd: (NSString*) eventId;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/InterfaceIAP.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import <Foundation/Foundation.h>\n\n@protocol InterfaceIAP <NSObject>\n\n- (void) configDeveloperInfo: (NSMutableDictionary*) cpInfo;\n- (void) payForProduct: (NSMutableDictionary*) profuctInfo;\n- (void) setDebugMode: (BOOL) debug;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/InterfaceShare.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n@protocol InterfaceShare <NSObject>\n\n- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;\n- (void) share: (NSMutableDictionary*) shareInfo;\n- (void) setDebugMode: (BOOL) debug;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/InterfaceSocial.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n@protocol InterfaceSocial <NSObject>\n\n- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;\n- (void) submitScore: (NSString*) leaderboardID withScore: (long) score;\n- (void) showLeaderboard: (NSString*) leaderboardID;\n- (void) unlockAchievement: (NSMutableDictionary*) achInfo;\n- (void) showAchievements;\n- (void) setDebugMode: (BOOL) debug;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/InterfaceUser.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n@protocol InterfaceUser <NSObject>\n\n- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;\n- (void) login;\n- (void) logout;\n- (BOOL) isLogined;\n- (NSString*) getSessionID;\n- (void) setDebugMode: (BOOL) debug;\n- (NSString*) getSDKVersion;\n- (NSString*) getPluginVersion;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/PluginFactory.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"PluginFactory.h\"\n#include \"ProtocolAds.h\"\n#include \"ProtocolAnalytics.h\"\n#include \"ProtocolIAP.h\"\n#include \"ProtocolShare.h\"\n#include \"PluginUtilsIOS.h\"\n\n#import <Foundation/Foundation.h>\n#import \"InterfaceAds.h\"\n#import \"InterfaceAnalytics.h\"\n#import \"InterfaceIAP.h\"\n#import \"InterfaceShare.h\"\n\nnamespace cocos2d { namespace plugin {\n\nstatic PluginFactory* s_pFactory = NULL;\n\nPluginFactory::PluginFactory()\n{\n\n}\n\nPluginFactory::~PluginFactory()\n{\n\n}\n\nPluginFactory* PluginFactory::getInstance()\n{\n\tif (NULL == s_pFactory)\n\t{\n\t\ts_pFactory = new PluginFactory();\n\t}\n\n\treturn s_pFactory;\n}\n\nvoid PluginFactory::purgeFactory()\n{\n\tif (NULL != s_pFactory)\n\t{\n\t\tdelete s_pFactory;\n\t\ts_pFactory = NULL;\n\t}\n}\n\n/** create the plugin by name */\nPluginProtocol* PluginFactory::createPlugin(const char* name)\n{\n\tPluginProtocol* pRet = NULL;\n\tdo\n\t{\n\t\tif (name == NULL || strlen(name) == 0) break;\n\n        NSString* className = [NSString stringWithUTF8String:name];\n        id obj = [[NSClassFromString(className) alloc] init];\n        if (obj == nil) break;\n\n        if ([obj conformsToProtocol:@protocol(InterfaceAds)]) {\n            pRet = new ProtocolAds();\n        } else\n        if ([obj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n            pRet = new ProtocolAnalytics();\n        } else\n        if ([obj conformsToProtocol:@protocol(InterfaceIAP)]) {\n            pRet = new ProtocolIAP();\n        } else\n        if ([obj conformsToProtocol:@protocol(InterfaceShare)]) {\n            pRet = new ProtocolShare();\n        } else {\n            PluginUtilsIOS::outputLog(\"Plugin %s not implements a right protocol\", name);\n        }\n\n\t\tif (pRet != NULL)\n\t\t{\n\t\t\tpRet->setPluginName(name);\n\t\t\tPluginUtilsIOS::initOCPlugin(pRet, obj, name);\n\t\t}\n\t} while(0);\n\n\treturn pRet;\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/PluginOCMacros.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __PLUGIN_OC_MACROS_H__\n#define __PLUGIN_OC_MACROS_H__\n\n#define return_if_fails(cond) if (!(cond)) return;\n#define return_val_if_fails(cond, ret) if(!(cond)) return (ret);\n\n#define CALL_OC_FUNC_WITH_VALIST(retCode)                                                       \\\nstd::vector<PluginParam*> allParams;                                                            \\\nif (NULL != param)                                                                              \\\n{                                                                                               \\\n    allParams.push_back(param);                                                                 \\\n                                                                                                \\\n    va_list argp;                                                                               \\\n    PluginParam* pArg = NULL;                                                                   \\\n    va_start( argp, param );                                                                    \\\n    while (1)                                                                                   \\\n    {                                                                                           \\\n        pArg = va_arg(argp, PluginParam*);                                                      \\\n        if (pArg == NULL)                                                                       \\\n            break;                                                                              \\\n                                                                                                \\\n        allParams.push_back(pArg);                                                              \\\n    }                                                                                           \\\n    va_end(argp);                                                                               \\\n}                                                                                               \\\n                                                                                                \\\nreturn call##retCode##FuncWithParam(funcName, allParams);                                       \\\n\n\n#define CALL_OC_FUNC(retType, defaultRet, retCode)                                              \\\nretType ret = defaultRet;                                                                       \\\nPluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);                                    \\\nif (NULL == pData) {                                                                            \\\n    PluginUtilsIOS::outputLog(\"Can't find OC data for plugin : %s\", this->getPluginName());     \\\n    return ret;                                                                                 \\\n}                                                                                               \\\n                                                                                                \\\nint nParamNum = params.size();                                                                  \\\nif (0 == nParamNum)                                                                             \\\n{                                                                                               \\\n    ret = PluginUtilsIOS::callOC##retCode##FunctionWithName(this, funcName);                    \\\n} else                                                                                          \\\n{                                                                                               \\\n    PluginParam* pRetParam = NULL;                                                              \\\n    bool needDel = false;                                                                       \\\n    if (nParamNum == 1) {                                                                       \\\n        pRetParam = params[0];                                                                  \\\n    } else {                                                                                    \\\n        std::map<std::string, PluginParam*> allParams;                                          \\\n        for (int i = 0; i < nParamNum; i++)                                                     \\\n        {                                                                                       \\\n            PluginParam* pArg = params[i];                                                      \\\n            if (pArg == NULL)                                                                   \\\n            {                                                                                   \\\n                break;                                                                          \\\n            }                                                                                   \\\n                                                                                                \\\n            char strKey[8] = { 0 };                                                             \\\n            sprintf(strKey, \"Param%d\", i + 1);                                                  \\\n            allParams[strKey] = pArg;                                                           \\\n        }                                                                                       \\\n                                                                                                \\\n        pRetParam = new PluginParam(allParams);                                                 \\\n        needDel = true;                                                                         \\\n    }                                                                                           \\\n                                                                                                \\\n    id ocParam = PluginUtilsIOS::getOCObjFromParam(pRetParam);                                  \\\n    ret = PluginUtilsIOS::callOC##retCode##FunctionWithName_oneParam(this, funcName, ocParam);  \\\n                                                                                                \\\n    if (needDel && NULL != pRetParam) {                                                         \\\n        delete pRetParam;                                                                       \\\n        pRetParam = NULL;                                                                       \\\n    }                                                                                           \\\n}                                                                                               \\\nreturn ret;                                                                                     \\\n\n\n#endif // __PLUGIN_OC_MACROS_H__\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/PluginProtocol.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"PluginProtocol.h\"\n#include \"PluginUtilsIOS.h\"\n#include \"PluginOCMacros.h\"\n\nnamespace cocos2d { namespace plugin {\n\nPluginProtocol::~PluginProtocol()\n{\n    PluginUtilsIOS::erasePluginOCData(this);\n}\n\nstd::string PluginProtocol::getPluginVersion()\n{\n    std::string verName;\n    \n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    if (pData) {\n        id pOCObj = pData->obj;\n        SEL selector = NSSelectorFromString(@\"getPluginVersion\");\n        \n        if ([pOCObj respondsToSelector:selector]) {\n            NSString* strRet = (NSString*)[pOCObj performSelector:selector];\n            verName = [strRet UTF8String];\n        } else {\n            PluginUtilsIOS::outputLog(\"Can't find function 'getPluginVersion' in class '%s'\", pData->className.c_str());\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Plugin %p not right initilized\", this);\n    }\n    \n    return verName;\n}\n\nstd::string PluginProtocol::getSDKVersion()\n{\n    std::string verName;\n\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    if (pData) {\n        id pOCObj = pData->obj;\n        SEL selector = NSSelectorFromString(@\"getSDKVersion\");\n\n        if ([pOCObj respondsToSelector:selector]) {\n            NSString* strRet = (NSString*)[pOCObj performSelector:selector];\n            verName = [strRet UTF8String];\n        } else {\n            PluginUtilsIOS::outputLog(\"Can't find function 'getSDKVersion' in class '%s'\", pData->className.c_str());\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Plugin %s not right initilized\", this->getPluginName());\n    }\n\n    return verName;\n}\n\nvoid PluginProtocol::setDebugMode(bool isDebugMode)\n{\n    NSNumber* bDebug = [NSNumber numberWithBool:isDebugMode];\n    PluginUtilsIOS::callOCFunctionWithName_oneParam(this, \"setDebugMode\", bDebug);\n}\n\nvoid PluginProtocol::callFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    std::vector<PluginParam*> allParams;\n    if (NULL != param)\n    {\n        allParams.push_back(param);\n        \n        va_list argp;\n        PluginParam* pArg = NULL;\n        va_start( argp, param );\n        while (1)\n        {\n            pArg = va_arg(argp, PluginParam*);\n            if (pArg == NULL)\n                break;\n            \n            allParams.push_back(pArg);\n        }\n        va_end(argp);\n    }\n    \n    callFuncWithParam(funcName, allParams);\n}\n    \nvoid PluginProtocol::callFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    if (NULL == pData) {\n        PluginUtilsIOS::outputLog(\"Can't find OC data for plugin : %s\", this->getPluginName());\n        return;\n    }\n\n    int nParamNum = params.size();\n    if (0 == nParamNum)\n    {\n        PluginUtilsIOS::callOCFunctionWithName(this, funcName);\n    } else\n    {\n        PluginParam* pRetParam = NULL;\n        bool needDel = false;\n        if (nParamNum == 1) {\n            pRetParam = params[0];\n        } else {\n            std::map<std::string, PluginParam*> allParams;\n            for (int i = 0; i < nParamNum; i++)\n            {\n                PluginParam* pArg = params[i];\n                if (pArg == NULL)\n                {\n                    break;\n                }\n                \n                char strKey[8] = { 0 };\n                sprintf(strKey, \"Param%d\", i + 1);\n                allParams[strKey] = pArg;\n            }\n            \n            pRetParam = new PluginParam(allParams);\n            needDel = true;\n        }\n\n        id ocParam = PluginUtilsIOS::getOCObjFromParam(pRetParam);\n        PluginUtilsIOS::callOCFunctionWithName_oneParam(this, funcName, ocParam);\n\n        if (needDel && NULL != pRetParam) {\n            delete pRetParam;\n            pRetParam = NULL;\n        }\n    }\n}\n\nstd::string PluginProtocol::callStringFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_OC_FUNC_WITH_VALIST(String)\n}\n    \nstd::string PluginProtocol::callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_OC_FUNC(std::string, \"\", String)\n}\n\nint PluginProtocol::callIntFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_OC_FUNC_WITH_VALIST(Int)\n}\n\nint PluginProtocol::callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_OC_FUNC(int, 0, Int)\n}\n\nbool PluginProtocol::callBoolFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_OC_FUNC_WITH_VALIST(Bool)\n}\n\nbool PluginProtocol::callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_OC_FUNC(bool, false, Bool)\n}\n\nfloat PluginProtocol::callFloatFuncWithParam(const char* funcName, PluginParam* param, ...)\n{\n    CALL_OC_FUNC_WITH_VALIST(Float)\n}\n\nfloat PluginProtocol::callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params)\n{\n    CALL_OC_FUNC(float, 0.0f, Float)\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/PluginUtilsIOS.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __PLUGIN_UTILS_IOS_H__\n#define __PLUGIN_UTILS_IOS_H__\n\n#include \"PluginProtocol.h\"\n#include <string>\n#include <map>\n#include \"PluginParam.h\"\n\nnamespace cocos2d { namespace plugin {\n\ntypedef struct _PluginOCData\n{\n    id obj;\n    std::string className;\n} PluginOCData;\n\nclass PluginUtilsIOS\n{\npublic:\n    static void initOCPlugin(PluginProtocol* pPlugin, id ocObj, const char* className);\n\n    static PluginOCData* getPluginOCData(PluginProtocol* pKeyObj);\n    static void setPluginOCData(PluginProtocol* pKeyObj, PluginOCData* pData);\n    static void erasePluginOCData(PluginProtocol* pKeyObj);\n\n    static PluginProtocol* getPluginPtr(id obj);\n\n    static id getOCObjFromParam(PluginParam* param);\n\n    static NSMutableDictionary* createDictFromMap(std::map<std::string, std::string>* paramMap);\n\n    /**\n     @brief method don't have return value\n     */\n    static void callOCFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param);\n    static void callOCFunctionWithName(PluginProtocol* pPlugin, const char* funcName);\n\n    /**\n     @brief method return int value\n     */\n    static int callOCIntFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param);\n    static int callOCIntFunctionWithName(PluginProtocol* pPlugin, const char* funcName);\n    \n    /**\n     @brief method return float value\n     */\n    static float callOCFloatFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param);\n    static float callOCFloatFunctionWithName(PluginProtocol* pPlugin, const char* funcName);\n\n    /**\n     @brief method return bool value\n     */\n    static bool callOCBoolFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param);\n    static bool callOCBoolFunctionWithName(PluginProtocol* pPlugin, const char* funcName);\n    \n    /**\n     @brief method return string value\n     */\n    static std::string callOCStringFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param);\n    static std::string callOCStringFunctionWithName(PluginProtocol* pPlugin, const char* funcName);\n\n    static void outputLog(const char* pFormat, ...);\n\nprivate:\n    static id callRetFunctionWithParam(PluginProtocol* pPlugin, const char* funcName, id param);\n    static id callRetFunction(PluginProtocol* pPlugin, const char* funcName);\n};\n\n}} // namespace cocos2d { namespace plugin {\n\n#endif //__PLUGIN_UTILS_IOS_H__\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/PluginUtilsIOS.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#include \"PluginUtilsIOS.h\"\n#include <map>\n#import <objc/runtime.h>\n#include \"PluginOCMacros.h\"\n\n#define MAX_LOG_LEN         256\n\nnamespace cocos2d { namespace plugin {\n\nvoid PluginUtilsIOS::initOCPlugin(PluginProtocol* pPlugin, id ocObj, const char* className)\n{\n    PluginOCData* pData = new PluginOCData();\n    pData->obj = ocObj;\n    pData->className = className;\n    PluginUtilsIOS::setPluginOCData(pPlugin, pData);\n}\n\nstd::map<PluginProtocol*, PluginOCData*> s_PluginOCObjMap;\nstd::map<id, PluginProtocol*> s_OCObjPluginMap;\n\ntypedef std::map<PluginProtocol*, PluginOCData*>::iterator OCObjMapIter;\ntypedef std::map<id, PluginProtocol*>::iterator OCObjPluginMapIter;\n\nPluginOCData* PluginUtilsIOS::getPluginOCData(PluginProtocol* pKeyObj)\n{\n    PluginOCData* ret = NULL;\n    OCObjMapIter it = s_PluginOCObjMap.find(pKeyObj);\n    if (it != s_PluginOCObjMap.end()) {\n        ret = it->second;\n    }\n\n    return ret;\n}\n\nPluginProtocol* PluginUtilsIOS::getPluginPtr(id obj)\n{\n\tPluginProtocol* ret = NULL;\n\tOCObjPluginMapIter it = s_OCObjPluginMap.find(obj);\n\tif (it != s_OCObjPluginMap.end()) {\n\t\tret = it->second;\n\t}\n\n\treturn ret;\n}\n\nid PluginUtilsIOS::getOCObjFromParam(PluginParam* param)\n{\n    if (NULL == param)\n\t{\n\t\treturn nil;\n\t}\n    \n\tid obj = nil;\n\tswitch(param->getCurrentType())\n\t{\n        case PluginParam::kParamTypeInt:\n            obj = [NSNumber numberWithInt:param->getIntValue()];\n            break;\n        case PluginParam::kParamTypeFloat:\n            obj = [NSNumber numberWithFloat:param->getFloatValue()];\n            break;\n        case PluginParam::kParamTypeBool:\n            obj = [NSNumber numberWithBool:param->getBoolValue()];\n            break;\n        case PluginParam::kParamTypeString:\n            obj = [NSString stringWithUTF8String:param->getStringValue()];\n            break;\n        case PluginParam::kParamTypeStringMap:\n            {\n                std::map<std::string, std::string> mapValue = param->getStrMapValue();\n                obj = createDictFromMap(&mapValue);\n            }\n            break;\n        case PluginParam::kParamTypeMap:\n            {\n                obj = [NSMutableDictionary dictionary];\n                std::map<std::string, PluginParam*> paramMap = param->getMapValue();\n                std::map<std::string, PluginParam*>::const_iterator it;\n                for (it = paramMap.begin(); it != paramMap.end(); ++it)\n                {\n                    NSString* pKey = [NSString stringWithUTF8String:it->first.c_str()];\n                    id objValue = PluginUtilsIOS::getOCObjFromParam(it->second);\n                    [obj setValue:objValue forKey:pKey];\n                }\n            }\n            break;\n        default:\n            break;\n\t}\n    \n\treturn obj;\n}\n\nvoid PluginUtilsIOS::setPluginOCData(PluginProtocol* pKeyObj, PluginOCData* pData)\n{\n    erasePluginOCData(pKeyObj);\n    s_PluginOCObjMap.insert(std::pair<PluginProtocol*, PluginOCData*>(pKeyObj, pData));\n    s_OCObjPluginMap.insert(std::pair<id, PluginProtocol*>(pData->obj, pKeyObj));\n}\n\nvoid PluginUtilsIOS::erasePluginOCData(PluginProtocol* pKeyObj)\n{\n    OCObjMapIter it = s_PluginOCObjMap.find(pKeyObj);\n    if (it != s_PluginOCObjMap.end()) {\n        PluginOCData* pData = it->second;\n        if (pData != NULL)\n        {\n            id jobj = pData->obj;\n\n            OCObjPluginMapIter pluginIt = s_OCObjPluginMap.find(jobj);\n            if (pluginIt != s_OCObjPluginMap.end())\n            {\n            \ts_OCObjPluginMap.erase(pluginIt);\n            }\n\n            [jobj release];\n            delete pData;\n        }\n        s_PluginOCObjMap.erase(it);\n    }\n}\n\nNSMutableDictionary* PluginUtilsIOS::createDictFromMap(std::map<std::string, std::string>* paramMap)\n{\n    if (NULL == paramMap)\n    {\n        return nil;\n    }\n\n    NSMutableDictionary* dict = [NSMutableDictionary dictionary];\n    std::map<std::string, std::string>::const_iterator it;\n    for (it = paramMap->begin(); it != paramMap->end(); ++it)\n    {\n        NSString* pKey = [NSString stringWithUTF8String:it->first.c_str()];\n        NSString* pValue = [NSString stringWithUTF8String:it->second.c_str()];\n        [dict setValue:pValue forKey:pKey];\n    }\n    \n    return dict;\n}\n\nvoid PluginUtilsIOS::callOCFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param)\n{\n    return_if_fails(funcName != NULL && strlen(funcName) > 0);\n    \n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(pPlugin);\n    if (pData) {\n        id pOCObj = pData->obj;\n\n        NSString* strFuncName = [NSString stringWithUTF8String:funcName];\n        strFuncName = [strFuncName stringByAppendingString:@\":\"];\n\n        SEL selector = NSSelectorFromString(strFuncName);\n        if ([pOCObj respondsToSelector:selector]) {\n            [pOCObj performSelector:selector withObject:param];\n        } else {\n            outputLog(\"Can't find function '%s' in class '%s'\", [strFuncName UTF8String], pData->className.c_str());\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Plugin %s not right initilized\", pPlugin->getPluginName());\n    }\n}\n    \nvoid PluginUtilsIOS::callOCFunctionWithName(PluginProtocol* pPlugin, const char* funcName)\n{\n    return_if_fails(funcName != NULL && strlen(funcName) > 0);\n    \n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(pPlugin);\n    if (pData) {\n        id pOCObj = pData->obj;\n        \n        NSString* strFuncName = [NSString stringWithUTF8String:funcName];\n        SEL selector = NSSelectorFromString(strFuncName);\n        if ([pOCObj respondsToSelector:selector]) {\n            [pOCObj performSelector:selector];\n        } else {\n            outputLog(\"Can't find function '%s' in class '%s'\", [strFuncName UTF8String], pData->className.c_str());\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Plugin %s not right initilized\", pPlugin->getPluginName());\n    }\n}\n\nint PluginUtilsIOS::callOCIntFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param)\n{\n    NSNumber* num = (NSNumber*) callRetFunctionWithParam(pPlugin, funcName, param);\n    int ret = [num integerValue];\n    return ret;\n}\n\nint PluginUtilsIOS::callOCIntFunctionWithName(PluginProtocol* pPlugin, const char* funcName)\n{\n    NSNumber* num = (NSNumber*) callRetFunction(pPlugin, funcName);\n    int ret = [num integerValue];\n    return ret;\n}\n\nfloat PluginUtilsIOS::callOCFloatFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param)\n{\n    float ret = 0.0f;\n    NSNumber* pRet = (NSNumber*)callRetFunctionWithParam(pPlugin, funcName, param);\n    if (nil != pRet) {\n        ret = [pRet floatValue];\n    }\n    \n    return ret;\n}\n\nfloat PluginUtilsIOS::callOCFloatFunctionWithName(PluginProtocol* pPlugin, const char* funcName)\n{\n    float ret = 0.0f;\n    NSNumber* pRet = (NSNumber*)callRetFunction(pPlugin, funcName);\n    if (nil != pRet) {\n        ret = [pRet floatValue];\n    }\n    \n    return ret;\n}\n\nbool PluginUtilsIOS::callOCBoolFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param)\n{\n    bool ret = false;\n    NSNumber* pRet = (NSNumber*)callRetFunctionWithParam(pPlugin, funcName, param);\n    if (nil != pRet) {\n        ret = [pRet boolValue];\n    }\n\n    return ret;\n}\n\nbool PluginUtilsIOS::callOCBoolFunctionWithName(PluginProtocol* pPlugin, const char* funcName)\n{\n    bool ret = false;\n    NSNumber* pRet = (NSNumber*)callRetFunction(pPlugin, funcName);\n    if (nil != pRet) {\n        ret = [pRet boolValue];\n    }\n    \n    return ret;\n}\n\nstd::string PluginUtilsIOS::callOCStringFunctionWithName_oneParam(PluginProtocol* pPlugin, const char* funcName, id param)\n{\n    std::string ret = \"\";\n    NSString* pRet = (NSString*)callRetFunctionWithParam(pPlugin, funcName, param);\n    if (nil != pRet) {\n        ret = [pRet UTF8String];\n    }\n\n    return ret;\n}\n    \nstd::string PluginUtilsIOS::callOCStringFunctionWithName(PluginProtocol* pPlugin, const char* funcName)\n{\n    std::string ret = \"\";\n    NSString* pRet = (NSString*)callRetFunction(pPlugin, funcName);\n    if (nil != pRet) {\n        ret = [pRet UTF8String];\n    }\n    \n    return ret;\n}\n\nid PluginUtilsIOS::callRetFunction(PluginProtocol* pPlugin, const char* funcName)\n{\n    id ret = nil;\n    return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);\n    \n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(pPlugin);\n    if (pData) {\n        id pOCObj = pData->obj;\n        \n        NSString* strFuncName = [NSString stringWithUTF8String:funcName];\n        SEL selector = NSSelectorFromString(strFuncName);\n        if ([pOCObj respondsToSelector:selector]) {\n            ret = [pOCObj performSelector:selector];\n        } else {\n            outputLog(\"Can't find function '%s' in class '%s'\", [strFuncName UTF8String], pData->className.c_str());\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Plugin %s not right initilized\", pPlugin->getPluginName());\n    }\n    \n    return ret;\n}\n\nid PluginUtilsIOS::callRetFunctionWithParam(PluginProtocol* pPlugin, const char* funcName, id param)\n{\n    id ret = nil;\n    return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);\n    \n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(pPlugin);\n    if (pData) {\n        id pOCObj = pData->obj;\n        \n        NSString* strFuncName = [NSString stringWithUTF8String:funcName];\n        strFuncName = [strFuncName stringByAppendingString:@\":\"];\n        SEL selector = NSSelectorFromString(strFuncName);\n        if ([pOCObj respondsToSelector:selector]) {\n            ret = [pOCObj performSelector:selector withObject:param];\n        } else {\n            outputLog(\"Can't find function '%s' in class '%s'\", [strFuncName UTF8String], pData->className.c_str());\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Plugin %s not right initilized\", pPlugin->getPluginName());\n    }\n\n    return ret;\n}\n\nvoid PluginUtilsIOS::outputLog(const char* pFormat, ...)\n{\n    printf(\"Plugin-x: \");\n    char szBuf[MAX_LOG_LEN+1] = {0};\n    va_list ap;\n    va_start(ap, pFormat);\n    vsnprintf(szBuf, MAX_LOG_LEN, pFormat, ap);\n    va_end(ap);\n    printf(\"%s\", szBuf);\n    printf(\"\\n\");\n}\n\n}}// namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ProtocolAds.mm",
    "content": "/****************************************************************************\n Copyright (c) 2012+2013 cocos2d+x.org\n \n http://www.cocos2d+x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"ProtocolAds.h\"\n#include \"PluginUtilsIOS.h\"\n#import \"InterfaceAds.h\"\n\nnamespace cocos2d { namespace plugin {\n\nProtocolAds::ProtocolAds()\n: _listener(NULL)\n{\n}\n\nProtocolAds::~ProtocolAds()\n{\n}\n\nvoid ProtocolAds::configDeveloperInfo(TAdsDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtilsIOS::outputLog(\"The developer info is empty for %s!\", this->getPluginName());\n        return;\n    }\n    else\n    {\n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceAds)]) {\n            NSObject<InterfaceAds>* curObj = ocObj;\n            NSMutableDictionary* dict = PluginUtilsIOS::createDictFromMap(&devInfo);\n            [curObj configDeveloperInfo:dict];\n        }\n    }\n}\n\nvoid ProtocolAds::showAds(TAdsInfo info, AdsPos pos)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n\n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAds)]) {\n        NSObject<InterfaceAds>* curObj = ocObj;\n        NSMutableDictionary* dict = PluginUtilsIOS::createDictFromMap(&info);\n        [curObj showAds:dict position:pos];\n    }\n}\n\nvoid ProtocolAds::hideAds(TAdsInfo info)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAds)]) {\n        NSObject<InterfaceAds>* curObj = ocObj;\n        NSMutableDictionary* dict = PluginUtilsIOS::createDictFromMap(&info);\n        [curObj hideAds:dict];\n    }\n}\n\nvoid ProtocolAds::queryPoints()\n{\n    PluginUtilsIOS::callOCFunctionWithName(this, \"queryPoints\");\n}\n\nvoid ProtocolAds::spendPoints(int points)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAds)]) {\n        NSObject<InterfaceAds>* curObj = ocObj;\n        [curObj spendPoints:points];\n    }\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ProtocolAnalytics.mm",
    "content": "/****************************************************************************\n Copyright (c) 2012+2013 cocos2d+x.org\n \n http://www.cocos2d+x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"ProtocolAnalytics.h\"\n#import  \"InterfaceAnalytics.h\"\n#include \"PluginUtilsIOS.h\"\n\nnamespace cocos2d { namespace plugin {\n\nProtocolAnalytics::ProtocolAnalytics()\n{\n}\n\nProtocolAnalytics::~ProtocolAnalytics()\n{\n    PluginUtilsIOS::erasePluginOCData(this);\n}\n\n/**\n @brief Start a new session.\n @param appKey The identity of the application.\n */\nvoid ProtocolAnalytics::startSession(const char* appKey)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        NSString* pStrKey = [NSString stringWithUTF8String:appKey];\n        [curObj startSession:pStrKey];\n    }\n}\n\n/**\n @brief Stop a session.\n @warning This interface only worked on android\n */\nvoid ProtocolAnalytics::stopSession()\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        [curObj stopSession];\n    }\n}\n\n/**\n @brief Set the timeout for expiring a session.\n @param millis In milliseconds as the unit of time.\n @note It must be invoked before calling startSession.\n */\nvoid ProtocolAnalytics::setSessionContinueMillis(long millis)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        [curObj setSessionContinueMillis:millis];\n    }\n}\n\n/**\n @brief log an error\n @param errorId The identity of error\n @param message Extern message for the error\n */\nvoid ProtocolAnalytics::logError(const char* errorId, const char* message)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        NSString* pError = [NSString stringWithUTF8String:errorId];\n        NSString* pMsg = [NSString stringWithUTF8String:message];\n        [curObj logError:pError withMsg:pMsg];\n    }\n}\n\n/**\n @brief log an event.\n @param eventId The identity of event\n @param paramMap Extern parameters of the event, use NULL if not needed.\n */\nvoid ProtocolAnalytics::logEvent(const char* eventId, LogEventParamMap* paramMap)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        NSString* pId = [NSString stringWithUTF8String:eventId];\n        NSMutableDictionary* dict = PluginUtilsIOS::createDictFromMap(paramMap);\n        [curObj logEvent:pId withParam:dict];\n    }\n}\n\n/**\n @brief Track an event begin.\n @param eventId The identity of event\n */\nvoid ProtocolAnalytics::logTimedEventBegin(const char* eventId)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        NSString* pEvent = [NSString stringWithUTF8String:eventId];\n        [curObj logTimedEventBegin:pEvent];\n    }\n}\n\n/**\n @brief Track an event end.\n @param eventId The identity of event\n */\nvoid ProtocolAnalytics::logTimedEventEnd(const char* eventId)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        NSString* pEvent = [NSString stringWithUTF8String:eventId];\n        [curObj logTimedEventEnd:pEvent];\n    }\n}\n\n/**\n @brief Whether to catch uncaught exceptions to server.\n @warning This interface only worked on android.\n */\nvoid ProtocolAnalytics::setCaptureUncaughtException(bool enabled)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceAnalytics)]) {\n        NSObject<InterfaceAnalytics>* curObj = ocObj;\n        [curObj setCaptureUncaughtException:enabled];\n    }\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ProtocolIAP.mm",
    "content": "/****************************************************************************\n Copyright (c) 2012-2013 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#include \"ProtocolIAP.h\"\n#include \"PluginUtilsIOS.h\"\n#import \"InterfaceIAP.h\"\n\nnamespace cocos2d { namespace plugin {\n\nbool ProtocolIAP::_paying = false;\n\nProtocolIAP::ProtocolIAP()\n: _listener(NULL)\n{\n}\n\nProtocolIAP::~ProtocolIAP()\n{\n    PluginUtilsIOS::erasePluginOCData(this);\n}\n\nvoid ProtocolIAP::configDeveloperInfo(TIAPDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtilsIOS::outputLog(\"The developer info is empty for %s!\", this->getPluginName());\n        return;\n    }\n    else\n    {\n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceIAP)]) {\n            NSObject<InterfaceIAP>* curObj = ocObj;\n            NSMutableDictionary* pDict = PluginUtilsIOS::createDictFromMap(&devInfo);\n            [curObj configDeveloperInfo:pDict];\n        }\n    }\n}\n\nvoid ProtocolIAP::payForProduct(TProductInfo info)\n{\n    if (_paying)\n    {\n        PluginUtilsIOS::outputLog(\"Now is paying\");\n        return;\n    }\n\n    if (info.empty())\n    {\n        if (NULL != _listener)\n        {\n            onPayResult(kPayFail, \"Product info error\");\n        }\n        PluginUtilsIOS::outputLog(\"The product info is empty for %s!\", this->getPluginName());\n        return;\n    }\n    else\n    {\n        _paying = true;\n        _curInfo = info;\n        \n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceIAP)]) {\n            NSObject<InterfaceIAP>* curObj = ocObj;\n            NSMutableDictionary* dict = PluginUtilsIOS::createDictFromMap(&info);\n            [curObj payForProduct:dict];\n        }\n    }\n}\n\nvoid ProtocolIAP::setResultListener(PayResultListener* pListener)\n{\n    _listener = pListener;\n}\n\nvoid ProtocolIAP::onPayResult(PayResultCode ret, const char* msg)\n{\n    _paying = false;\n    if (_listener)\n    {\n        _listener->onPayResult(ret, msg, _curInfo);\n    }\n    else\n    {\n        PluginUtilsIOS::outputLog(\"Pay result listener of %s is null!\", this->getPluginName());\n    }\n\n    _curInfo.clear();\n    PluginUtilsIOS::outputLog(\"Pay result of %s is : %d(%s)\", this->getPluginName(), (int) ret, msg);\n}\n\n}} //namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ProtocolShare.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolShare.h\"\n#include \"PluginUtilsIOS.h\"\n#import \"InterfaceShare.h\"\n\nnamespace cocos2d { namespace plugin {\n\nProtocolShare::ProtocolShare()\n: _listener(NULL)\n{\n}\n\nProtocolShare::~ProtocolShare()\n{\n}\n\nvoid ProtocolShare::configDeveloperInfo(TShareDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtilsIOS::outputLog(\"The developer info is empty for %s!\", this->getPluginName());\n        return;\n    }\n    else\n    {\n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceShare)]) {\n            NSObject<InterfaceShare>* curObj = ocObj;\n            NSMutableDictionary* pDict = PluginUtilsIOS::createDictFromMap(&devInfo);\n            [curObj configDeveloperInfo:pDict];\n        }\n    }\n}\n\nvoid ProtocolShare::share(TShareInfo info)\n{\n    if (info.empty())\n    {\n        if (NULL != _listener)\n        {\n            onShareResult(kShareFail, \"Share info error\");\n        }\n        PluginUtilsIOS::outputLog(\"The Share info of %s is empty!\", this->getPluginName());\n        return;\n    }\n    else\n    {\n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceShare)]) {\n            NSObject<InterfaceShare>* curObj = ocObj;\n            NSMutableDictionary* pDict = PluginUtilsIOS::createDictFromMap(&info);\n            [curObj share:pDict];\n        }\n    }\n}\n\nvoid ProtocolShare::setResultListener(ShareResultListener* pListener)\n{\n\t_listener = pListener;\n}\n\nvoid ProtocolShare::onShareResult(ShareResultCode ret, const char* msg)\n{\n    if (_listener)\n    {\n    \t_listener->onShareResult(ret, msg);\n    }\n    else\n    {\n        PluginUtilsIOS::outputLog(\"Share result listener of %s is null!\", this->getPluginName());\n    }\n    PluginUtilsIOS::outputLog(\"Share result of %s is : %d(%s)\", this->getPluginName(), (int) ret, msg);\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ProtocolSocial.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolSocial.h\"\n#include \"PluginUtilsIOS.h\"\n#import \"InterfaceSocial.h\"\n\nnamespace cocos2d { namespace plugin {\n\nProtocolSocial::ProtocolSocial()\n: _listener(NULL)\n{\n}\n\nProtocolSocial::~ProtocolSocial()\n{\n}\n\nvoid ProtocolSocial::configDeveloperInfo(TSocialDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtilsIOS::outputLog(\"The developer info is empty for %s!\", this->getPluginName());\n        return;\n    }\n    else\n    {\n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceSocial)]) {\n            NSObject<InterfaceSocial>* curObj = ocObj;\n            NSMutableDictionary* pDict = PluginUtilsIOS::createDictFromMap(&devInfo);\n            [curObj configDeveloperInfo:pDict];\n        }\n    }\n}\n    \nvoid ProtocolSocial::submitScore(const char* leadboardID, long score)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n\n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceSocial)]) {\n        NSObject<InterfaceSocial>* curObj = ocObj;\n        \n        NSString* pID = [NSString stringWithUTF8String:leadboardID];\n        [curObj submitScore:pID withScore:score];\n    }\n}\n\nvoid ProtocolSocial::showLeaderboard(const char* leaderboardID)\n{\n    PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n    assert(pData != NULL);\n    \n    id ocObj = pData->obj;\n    if ([ocObj conformsToProtocol:@protocol(InterfaceSocial)]) {\n        NSObject<InterfaceSocial>* curObj = ocObj;\n        \n        NSString* pID = [NSString stringWithUTF8String:leaderboardID];\n        [curObj showLeaderboard:pID];\n    }\n}\n\nvoid ProtocolSocial::unlockAchievement(TAchievementInfo achInfo)\n{\n    if (achInfo.empty())\n    {\n        PluginUtilsIOS::outputLog(\"ProtocolSocial\", \"The achievement info is empty!\");\n        return;\n    }\n    else\n    {\n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceSocial)]) {\n            NSObject<InterfaceSocial>* curObj = ocObj;\n            \n            NSMutableDictionary* pDict = PluginUtilsIOS::createDictFromMap(&achInfo);\n            [curObj unlockAchievement:pDict];\n        }\n    }\n}\n\nvoid ProtocolSocial::showAchievements()\n{\n    PluginUtilsIOS::callOCFunctionWithName(this, \"showAchievements\");\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ProtocolUser.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"ProtocolUser.h\"\n#include \"PluginUtilsIOS.h\"\n#import \"InterfaceUser.h\"\n\nnamespace cocos2d { namespace plugin {\n\nProtocolUser::ProtocolUser()\n: _listener(NULL)\n{\n}\n\nProtocolUser::~ProtocolUser()\n{\n}\n\nvoid ProtocolUser::configDeveloperInfo(TUserDeveloperInfo devInfo)\n{\n    if (devInfo.empty())\n    {\n        PluginUtilsIOS::outputLog(\"The developer info is empty for %s!\", this->getPluginName());\n        return;\n    }\n    else\n    {\n        PluginOCData* pData = PluginUtilsIOS::getPluginOCData(this);\n        assert(pData != NULL);\n        \n        id ocObj = pData->obj;\n        if ([ocObj conformsToProtocol:@protocol(InterfaceUser)]) {\n            NSObject<InterfaceUser>* curObj = ocObj;\n            NSMutableDictionary* pDict = PluginUtilsIOS::createDictFromMap(&devInfo);\n            [curObj configDeveloperInfo:pDict];\n        }\n    }\n}\n\nvoid ProtocolUser::login()\n{\n    PluginUtilsIOS::callOCFunctionWithName(this, \"login\");\n}\n    \nvoid ProtocolUser::logout()\n{\n    PluginUtilsIOS::callOCFunctionWithName(this, \"logout\");\n}\n    \nbool ProtocolUser::isLogined()\n{\n    return PluginUtilsIOS::callOCBoolFunctionWithName(this, \"isLogined\");\n}\n\nstd::string ProtocolUser::getSessionID()\n{\n    return PluginUtilsIOS::callOCStringFunctionWithName(this, \"getSessionID\");\n}\n\n}} // namespace cocos2d { namespace plugin {\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ShareWrapper.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import <Foundation/Foundation.h>\n\ntypedef enum {\n    kShareSuccess = 0,\n    kShareFail,\n    kShareCancel,\n    kShareTimeOut,\n} ShareResult;\n\n@interface ShareWrapper : NSObject\n{\n    \n}\n\n+ (void) onShareResult:(id) obj withRet:(ShareResult) ret withMsg:(NSString*) msg;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/ShareWrapper.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import \"ShareWrapper.h\"\n#include \"PluginUtilsIOS.h\"\n#include \"ProtocolShare.h\"\n\nusing namespace cocos2d::plugin;\n\n@implementation ShareWrapper\n\n+ (void) onShareResult:(id) obj withRet:(ShareResult) ret withMsg:(NSString*) msg\n{\n    PluginProtocol* pPlugin = PluginUtilsIOS::getPluginPtr(obj);\n    ProtocolShare* pShare = dynamic_cast<ProtocolShare*>(pPlugin);\n    if (pShare) {\n        const char* chMsg = [msg UTF8String];\n        ShareResultCode cRet = (ShareResultCode) ret;\n        pShare->onShareResult(cRet, chMsg);\n    } else {\n        PluginUtilsIOS::outputLog(\"Can't find the C++ object of the Share plugin\");\n    }\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/SocialWrapper.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import <Foundation/Foundation.h>\n\ntypedef enum {\n    kSubmitScoreSuccess = 1,\n    kSubmitScoreFailed,\n\n    kUnlockAchiSuccess,\n    kUnlockAchiFailed,\n} SocialResult;\n\n@interface SocialWrapper : NSObject\n{\n    \n}\n\n+ (void) onSocialResult:(id) obj withRet:(SocialResult) ret withMsg:(NSString*) msg;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/SocialWrapper.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import \"SocialWrapper.h\"\n#include \"PluginUtilsIOS.h\"\n#include \"ProtocolSocial.h\"\n\nusing namespace cocos2d::plugin;\n\n@implementation SocialWrapper\n\n+ (void) onSocialResult:(id) obj withRet:(SocialResult) ret withMsg:(NSString*) msg\n{\n    PluginProtocol* pPlugin = PluginUtilsIOS::getPluginPtr(obj);\n    ProtocolSocial* pSocial = dynamic_cast<ProtocolSocial*>(pPlugin);\n    if (pSocial) {\n        SocialListener* pListener = pSocial->getListener();\n        if (NULL != pListener)\n        {\n            const char* chMsg = [msg UTF8String];\n            SocialRetCode cRet = (SocialRetCode) ret;\n            pListener->onSocialResult(cRet, chMsg);\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Can't find the C++ object of the Social plugin\");\n    }\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/UserWrapper.h",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import <Foundation/Foundation.h>\n\ntypedef enum {\n    kLoginSucceed = 0,\n    kLoginFailed,\n    kLogoutSucceed,\n} UserActionResult;\n\n@interface UserWrapper : NSObject\n{\n    \n}\n\n+ (void) onActionResult:(id) obj withRet:(UserActionResult) ret withMsg:(NSString*) msg;\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/platform/ios/UserWrapper.mm",
    "content": "/****************************************************************************\nCopyright (c) 2012+2013 cocos2d+x.org\n\nhttp://www.cocos2d+x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#import \"UserWrapper.h\"\n#include \"PluginUtilsIOS.h\"\n#include \"ProtocolUser.h\"\n\nusing namespace cocos2d::plugin;\n\n@implementation UserWrapper\n\n+ (void) onActionResult:(id) obj withRet:(UserActionResult) ret withMsg:(NSString*) msg\n{\n    PluginProtocol* pPlugin = PluginUtilsIOS::getPluginPtr(obj);\n    ProtocolUser* pUser = dynamic_cast<ProtocolUser*>(pPlugin);\n    if (pUser) {\n        UserActionListener* listener = pUser->getActionListener();\n        if (NULL != listener)\n        {\n            const char* chMsg = [msg UTF8String];\n            listener->onActionResult(pUser, (UserActionResultCode) ret, chMsg);\n        }\n        else\n        {\n            PluginUtilsIOS::outputLog(\"Listener of plugin %s not set correctly\", pPlugin->getPluginName());\n        }\n    } else {\n        PluginUtilsIOS::outputLog(\"Can't find the C++ object of the User plugin\");\n    }\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>libPluginProtocol</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n\t<linkedResources>\n\t\t<link>\n\t\t\t<name>android</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-1-PROJECT_LOC/platform/android</locationURI>\n\t\t</link>\n\t\t<link>\n\t\t\t<name>include</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-1-PROJECT_LOC/include</locationURI>\n\t\t</link>\n\t</linkedResources>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"org.cocos2dx.libAnalyticsCommon\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"7\" android:targetSdkVersion=\"15\" />\n\n\n</manifest>\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"libPluginProtocol\" default=\"plugin-publish\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${plugin.dir}/tools/android/build_common.xml\" />\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/build_native.sh",
    "content": "# set params\nPLUGIN_ANDROID_ROOT=$(cd \"$(dirname \"$0\")\"; pwd)\n\nif [ ! \"${PLUGIN_ROOT}\" ]; then\n    PLUGIN_ROOT=\"$PLUGIN_ANDROID_ROOT\"/../..\nfi\n\n${PLUGIN_ROOT}/tools/toolsForPublish/checkEnvironment.sh\nsource ${PLUGIN_ROOT}/tools/toolsForPublish/environment.sh\n\n# build\n\"$ANDROID_NDK_ROOT\"/ndk-build -C \"$PLUGIN_ANDROID_ROOT\"\n\necho\nif [ \"0\" != \"$?\" ]; then\n    echo \"Build error occoured!!!\"\n    exit 1\nfi\n\necho\necho \"Native build action success.\"\nexit 0"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/jni/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := PluginProtocolStatic\n\nLOCAL_MODULE_FILENAME := libPluginProtocolStatic\n\nLOCAL_SRC_FILES :=\\\n$(addprefix ../../platform/android/, \\\n\tPluginFactory.cpp \\\n    PluginJniHelper.cpp \\\n    PluginUtils.cpp \\\n    PluginProtocol.cpp \\\n    ProtocolAnalytics.cpp \\\n    ProtocolIAP.cpp \\\n    ProtocolAds.cpp \\\n    ProtocolShare.cpp \\\n    ProtocolUser.cpp \\\n    ProtocolSocial.cpp \\\n) \\\n../../PluginManager.cpp \\\n../../PluginParam.cpp\n\nLOCAL_CFLAGS := -Wno-psabi\nLOCAL_EXPORT_CFLAGS := -Wno-psabi\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../include $(LOCAL_PATH)/../../platform/android\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../include $(LOCAL_PATH)/../../platform/android\n\nLOCAL_LDLIBS := -landroid\nLOCAL_LDLIBS += -llog\nLOCAL_STATIC_LIBRARIES := android_native_app_glue\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,android/native_app_glue)\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/jni/Application.mk",
    "content": "# it is needed for ndk-r5\nAPP_PLATFORM := android-10\nAPP_STL := gnustl_static\nAPP_CPPFLAGS += -frtti\nAPP_MODULES := PluginProtocolStatic\nAPP_ABI :=armeabi armeabi-v7a\n#APP_ABI :=x86\n#APP_ABI :=mips mips-r2 mips-r2-sf armeabi\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-7\nandroid.library=true\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/res/.gitignore",
    "content": ""
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/AdsWrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport android.view.Gravity;\nimport android.view.View;\nimport android.view.WindowManager;\n\npublic class AdsWrapper {\n\n\tpublic static final int RESULT_CODE_AdsReceived = 0;               // The ad is received\n\tpublic static final int RESULT_CODE_AdsShown = 1;                  // The advertisement shown\n    public static final int RESULT_CODE_AdsDismissed = 2;              // The advertisement dismissed\n    public static final int RESULT_CODE_PointsSpendSucceed = 3;        // The points spend succeed\n    public static final int RESULT_CODE_PointsSpendFailed = 4;         // The points spend failed\n    public static final int RESULT_CODE_NetworkError = 5;              // Network error\n    public static final int RESULT_CODE_UnknownError = 6;              // Unknown error\n\n\tpublic static final int POS_CENTER \t     = 0;\n\tpublic static final int POS_TOP\t\t     = 1;\n\tpublic static final int POS_TOP_LEFT     = 2;\n\tpublic static final int POS_TOP_RIGHT    = 3;\n\tpublic static final int POS_BOTTOM       = 4;\n\tpublic static final int POS_BOTTOM_LEFT  = 5;\n\tpublic static final int POS_BOTTOM_RIGHT = 6;\n\n\tpublic static void addAdView(WindowManager mWm, View adView, int pos) {\n\t\tWindowManager.LayoutParams mLayoutParams = new WindowManager.LayoutParams();\n\t\tmLayoutParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;\n\t\tmLayoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT;\n\t\tmLayoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;\n\t\tmLayoutParams.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;\n\t\t\n\t\tswitch (pos) {\n\t\tcase POS_CENTER:\n\t\t\tmLayoutParams.gravity = Gravity.CENTER;\n\t\t\tbreak;\n\t\tcase POS_TOP:\n\t\t\tmLayoutParams.gravity = Gravity.TOP;\n\t\t\tbreak;\n\t\tcase POS_TOP_LEFT:\n\t\t\tmLayoutParams.gravity = Gravity.TOP | Gravity.LEFT;\n\t\t\tbreak;\n\t\tcase POS_TOP_RIGHT:\n\t\t\tmLayoutParams.gravity = Gravity.TOP | Gravity.RIGHT;\n\t\t\tbreak;\n\t\tcase POS_BOTTOM:\n\t\t\tmLayoutParams.gravity = Gravity.BOTTOM;\n\t\t\tbreak;\n\t\tcase POS_BOTTOM_LEFT:\n\t\t\tmLayoutParams.gravity = Gravity.BOTTOM | Gravity.LEFT;\n\t\t\tbreak;\n\t\tcase POS_BOTTOM_RIGHT:\n\t\t\tmLayoutParams.gravity = Gravity.BOTTOM | Gravity.RIGHT;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\tmWm.addView(adView, mLayoutParams);\n\t}\n\n\tpublic static void onAdsResult(InterfaceAds adapter, int code, String msg) {\n\t\tfinal int curCode = code;\n\t\tfinal String curMsg = msg;\n\t\tfinal InterfaceAds curObj = adapter;\n\t\tPluginWrapper.runOnGLThread(new Runnable(){\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString name = curObj.getClass().getName();\n\t\t\t\tname = name.replace('.', '/');\n\t\t\t\tAdsWrapper.nativeOnAdsResult(name, curCode, curMsg);\n\t\t\t}\n\t\t});\n\t}\n\tprivate native static void nativeOnAdsResult(String className, int code, String msg);\n\n\tpublic static void onPlayerGetPoints(InterfaceAds adapter, int points) {\n\t\tfinal int curPoints = points;\n\t\tfinal InterfaceAds curAdapter = adapter;\n\t\tPluginWrapper.runOnGLThread(new Runnable(){\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString name = curAdapter.getClass().getName();\n\t\t\t\tname = name.replace('.', '/');\n\t\t\t\tAdsWrapper.nativeOnPlayerGetPoints(name, curPoints);\n\t\t\t}\n\t\t});\n\t}\n\tprivate native static void nativeOnPlayerGetPoints(String className, int points);\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/IAPWrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\npublic class IAPWrapper {\n\tpublic static final int PAYRESULT_SUCCESS = 0;\n\tpublic static final int PAYRESULT_FAIL    = 1;\n\tpublic static final int PAYRESULT_CANCEL  = 2;\n\tpublic static final int PAYRESULT_TIMEOUT = 3;\n\n\tpublic static void onPayResult(InterfaceIAP obj, int ret, String msg) {\n\t\tfinal int curRet = ret;\n\t\tfinal String curMsg = msg;\n\t\tfinal InterfaceIAP curObj = obj;\n\t\tPluginWrapper.runOnGLThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString name = curObj.getClass().getName();\n\t\t\t\tname = name.replace('.', '/');\n\t\t\t\tnativeOnPayResult(name, curRet, curMsg);\n\t\t\t}\n\t\t});\n\t}\n\tprivate static native void nativeOnPayResult(String className, int ret, String msg);\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceAds.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\npublic interface InterfaceAds {\n\n\tpublic final int PluginType = 1;\n\n\tpublic void configDeveloperInfo(Hashtable<String, String> devInfo);\n\tpublic void showAds(Hashtable<String, String> adsInfo, int pos);\n\tpublic void hideAds(Hashtable<String, String> adsInfo);\n\tpublic void queryPoints();\n\tpublic void spendPoints(int points);\n\tpublic void setDebugMode(boolean debug);\n\tpublic String getSDKVersion();\n\tpublic String getPluginVersion();\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceAnalytics.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\npublic interface InterfaceAnalytics {\n\n\tpublic final int PluginType = 2;\n\n\tpublic void startSession(String appKey);\n\tpublic void stopSession();\n\tpublic void setSessionContinueMillis(int millis);\n\tpublic void setCaptureUncaughtException(boolean isEnabled);\n\tpublic void setDebugMode(boolean isDebugMode);\n\tpublic void logError(String errorId, String message);\n\tpublic void logEvent(String eventId);\n\tpublic void logEvent(String eventId, Hashtable<String, String> paramMap);\n\tpublic void logTimedEventBegin(String eventId);\n\tpublic void logTimedEventEnd(String eventId);\n\tpublic String getSDKVersion();\n\tpublic String getPluginVersion();\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceIAP.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\npublic interface InterfaceIAP {\n\tpublic final int PluginType = 3;\n\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo);\n\tpublic void payForProduct(Hashtable<String, String> cpInfo);\n\tpublic void setDebugMode(boolean debug);\n\tpublic String getSDKVersion();\n\tpublic String getPluginVersion();\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceShare.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\npublic interface InterfaceShare {\n\tpublic final int PluginType = 4;\n\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo);\n\tpublic void share(Hashtable<String, String> cpInfo);\n\tpublic void setDebugMode(boolean debug);\n\tpublic String getSDKVersion();\n\tpublic String getPluginVersion();\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceSocial.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\npublic interface InterfaceSocial {\n    public final int PluginType = 6;\n\n    public void configDeveloperInfo(Hashtable<String, String> cpInfo);\n    public void submitScore(String leaderboardID, long score);\n    public void showLeaderboard(String leaderboardID);\n    public void unlockAchievement(Hashtable<String, String> achInfo);\n    public void showAchievements();\n    public void setDebugMode(boolean debug);\n    public String getSDKVersion();\n    public String getPluginVersion();\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceUser.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.util.Hashtable;\n\npublic interface InterfaceUser {\n\tpublic final int PluginType = 5;\n\n\tpublic void configDeveloperInfo(Hashtable<String, String> cpInfo);\n\tpublic void login();\n\tpublic void logout();\n\tpublic boolean isLogined();\n\tpublic String getSessionID();\n\tpublic void setDebugMode(boolean debug);\n\tpublic String getSDKVersion();\n\tpublic String getPluginVersion();\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/PluginWrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\nimport java.lang.reflect.Field;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.opengl.GLSurfaceView;\nimport android.os.Handler;\nimport android.util.Log;\n\n\npublic class PluginWrapper {\n\n\tprotected static Context sContext = null;\n\tprotected static GLSurfaceView sGLSurfaceView = null; \n\tprotected static Handler sMainThreadHandler = null;\n\tprotected static Handler sGLThreadHandler = null;\n\tprivate static final String TAG = \"PluginWrapper\";\n\t\n\tpublic static void init(Context context)\n\t{\n\t\tsContext = context;\n\t\tif (null == sMainThreadHandler) {\n\t\t\tsMainThreadHandler = new Handler();\n\t\t}\n\t}\n\n\tpublic static void setGLSurfaceView(GLSurfaceView value) {\n\t\tsGLSurfaceView = value;\n\t}\n\n    protected static void initFromNativeActivity(Activity act) {\n        sContext = act;\n        // @warning These lines will cause crash.\n//        if (null == sGLThreadHandler) {\n//            sGLThreadHandler = new Handler();\n//        }\n    }\n\t\n\tprotected static Object initPlugin(String classFullName)\n\t{\n\t\tLog.i(TAG, \"class name : ----\" + classFullName + \"----\");\n        Class<?> c = null;\n        try {\n        \tString fullName = classFullName.replace('/', '.');\n            c = Class.forName(fullName);\n        } catch (ClassNotFoundException e) {  \n            Log.e(TAG, \"Class \" + classFullName + \" not found.\");\n            e.printStackTrace();\n            return null;\n        }\n\n        try {\n        \tContext ctx = getContext();\n\t\t\tif (ctx != null) {\n\t        \tObject o = c.getDeclaredConstructor(Context.class).newInstance(ctx);\n\t\t\t\treturn o;\n\t\t\t} else {\n\t\t\t\tLog.e(TAG, \"Plugin \" + classFullName + \" wasn't initialized.\");\n\t\t\t}\n        } catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n        return null;\n\t}\n\n\tprotected static int getPluginType(Object obj) {\n\t\tint nRet = -1;\n\t\ttry\n\t\t{\n\t\t\tField filedID = obj.getClass().getField(\"PluginType\");\n\t\t\tInteger nObj = (Integer) filedID.get(obj);\n\t\t\tnRet = nObj.intValue();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn nRet;\n\t}\n\n\tpublic static Context getContext() {\n\t\treturn sContext;\n\t}\n\t\n\tpublic static void runOnGLThread(Runnable r) {\n\t\tif (null != sGLSurfaceView) {\n\t\t\tsGLSurfaceView.queueEvent(r);\n\t\t} else\n\t\tif (null != sGLThreadHandler) {\n\t\t    sGLThreadHandler.post(r);\n\t\t} else {\n\t\t\tLog.i(TAG, \"call back invoked on main thread\");\n\t\t\tr.run();\n\t\t}\n\t}\n\n\tpublic static void runOnMainThread(Runnable r) {\n        if (null != sMainThreadHandler) {\n            sMainThreadHandler.post(r);\n        } else\n        if (null != sContext && sContext instanceof Activity) {\n            Activity act = (Activity) sContext;\n            act.runOnUiThread(r);\n        }\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/ShareWrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\npublic class ShareWrapper {\n\tpublic static final int SHARERESULT_SUCCESS = 0;\n\tpublic static final int SHARERESULT_FAIL    = 1;\n\tpublic static final int SHARERESULT_CANCEL  = 2;\n\tpublic static final int SHARERESULT_TIMEOUT = 3;\n\n\tpublic static void onShareResult(InterfaceShare obj, int ret, String msg) {\n\t\tfinal int curRet = ret;\n\t\tfinal String curMsg = msg;\n\t\tfinal InterfaceShare curAdapter = obj;\n\t\tPluginWrapper.runOnGLThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString name = curAdapter.getClass().getName();\n\t\t\t\tname = name.replace('.', '/');\n\t\t\t\tnativeOnShareResult(name, curRet, curMsg);\n\t\t\t}\n\t\t});\n\t}\n\tprivate static native void nativeOnShareResult(String className, int ret, String msg);\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/SocialWrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\npublic class SocialWrapper {\n    public static final int SOCIAL_SUBMITSCORE_SUCCESS = 1;\n    public static final int SOCIAL_SUBMITSCORE_FAILED = 2;\n    public static final int SOCIAL_UNLOCKACH_SUCCESS = 3;\n    public static final int SOCIAL_UNLOCKACH_FAILED = 4;\n\n    public static void onSocialResult(InterfaceSocial obj, int ret, String msg) {\n        final int curRet = ret;\n        final String curMsg = msg;\n        final InterfaceSocial curAdapter = obj;\n        PluginWrapper.runOnGLThread(new Runnable() {\n            @Override\n            public void run() {\n                String name = curAdapter.getClass().getName();\n                name = name.replace('.', '/');\n                nativeOnSocialResult(name, curRet, curMsg);\n            }\n        });\n    }\n    private static native void nativeOnSocialResult(String className, int ret, String msg);\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.android/src/org/cocos2dx/plugin/UserWrapper.java",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\npackage org.cocos2dx.plugin;\n\npublic class UserWrapper {\n\tpublic static final int ACTION_RET_LOGIN_SUCCEED = 0;\n    public static final int ACTION_RET_LOGIN_FAILED = 1;\n    public static final int ACTION_RET_LOGOUT_SUCCEED = 2;\n\n\tpublic static void onActionResult(InterfaceUser obj, int ret, String msg) {\n\t\tfinal int curRet = ret;\n\t\tfinal String curMsg = msg;\n\t\tfinal InterfaceUser curAdapter = obj;\n\t\tPluginWrapper.runOnGLThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString name = curAdapter.getClass().getName();\n\t\t\t\tname = name.replace('.', '/');\n\t\t\t\tnativeOnActionResult(name, curRet, curMsg);\n\t\t\t}\n\t\t});\n\t}\n\tprivate static native void nativeOnActionResult(String className, int ret, String msg);\n}\n"
  },
  {
    "path": "cocos2d/plugin/protocols/proj.ios/PluginProtocol.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\tFA09A325168ADBC2008C1C7B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA09A324168ADBC2008C1C7B /* Foundation.framework */; };\n\t\tFA09A33E168ADC1F008C1C7B /* PluginManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA09A33C168ADC1F008C1C7B /* PluginManager.cpp */; };\n\t\tFA8CC1E6173754CF00464206 /* PluginUtilsIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA8CC1E5173754CF00464206 /* PluginUtilsIOS.mm */; };\n\t\tFA8CC2041737A3CE00464206 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8CC2031737A3CE00464206 /* CoreFoundation.framework */; };\n\t\tFA8CC208173894F000464206 /* ProtocolAds.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA8CC205173894F000464206 /* ProtocolAds.mm */; };\n\t\tFA8CC209173894F000464206 /* ProtocolAnalytics.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA8CC206173894F000464206 /* ProtocolAnalytics.mm */; };\n\t\tFA8CC20A173894F000464206 /* ProtocolIAP.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA8CC207173894F000464206 /* ProtocolIAP.mm */; };\n\t\tFAB6DF961755D7E500C90D89 /* PluginParam.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAB6DF951755D7E500C90D89 /* PluginParam.cpp */; };\n\t\tFAB6DF981755D82F00C90D89 /* PluginFactory.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAB6DF971755D82F00C90D89 /* PluginFactory.mm */; };\n\t\tFAB6DF9A1755D93600C90D89 /* PluginProtocol.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAB6DF991755D93600C90D89 /* PluginProtocol.mm */; };\n\t\tFAC2A7F91777F8C200035D22 /* ProtocolShare.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAC2A7F61777F8C200035D22 /* ProtocolShare.mm */; };\n\t\tFAC2A7FA1777F8C200035D22 /* ShareWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAC2A7F81777F8C200035D22 /* ShareWrapper.mm */; };\n\t\tFAD55520177D1FA900968F54 /* ProtocolUser.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAD5551D177D1FA900968F54 /* ProtocolUser.mm */; };\n\t\tFAD55521177D1FA900968F54 /* UserWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = FAD5551F177D1FA900968F54 /* UserWrapper.mm */; };\n\t\tFADBF89B179E509500F59B1D /* ProtocolSocial.mm in Sources */ = {isa = PBXBuildFile; fileRef = FADBF898179E509500F59B1D /* ProtocolSocial.mm */; };\n\t\tFADBF89C179E509500F59B1D /* SocialWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = FADBF89A179E509500F59B1D /* SocialWrapper.mm */; };\n\t\tFADC44CA176EABCF00B2D5ED /* AdsWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = FADC44C9176EABCF00B2D5ED /* AdsWrapper.mm */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\tFA09A31F168ADBC2008C1C7B /* CopyFiles */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"include/${PRODUCT_NAME}\";\n\t\t\tdstSubfolderSpec = 16;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\tFA09A321168ADBC2008C1C7B /* libPluginProtocol.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPluginProtocol.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFA09A324168ADBC2008C1C7B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\tFA09A337168ADC05008C1C7B /* PluginManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginManager.h; sourceTree = \"<group>\"; };\n\t\tFA09A338168ADC05008C1C7B /* PluginProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProtocol.h; sourceTree = \"<group>\"; };\n\t\tFA09A339168ADC05008C1C7B /* ProtocolAnalytics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtocolAnalytics.h; sourceTree = \"<group>\"; };\n\t\tFA09A33A168ADC05008C1C7B /* ProtocolIAP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtocolIAP.h; sourceTree = \"<group>\"; };\n\t\tFA09A33C168ADC1F008C1C7B /* PluginManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginManager.cpp; path = ../PluginManager.cpp; sourceTree = \"<group>\"; };\n\t\tFA7C6C971724E4DD008A0ECC /* ProtocolAds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtocolAds.h; sourceTree = \"<group>\"; };\n\t\tFA8CC1E4173754CF00464206 /* PluginUtilsIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginUtilsIOS.h; sourceTree = \"<group>\"; };\n\t\tFA8CC1E5173754CF00464206 /* PluginUtilsIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginUtilsIOS.mm; sourceTree = \"<group>\"; };\n\t\tFA8CC2031737A3CE00464206 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };\n\t\tFA8CC205173894F000464206 /* ProtocolAds.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProtocolAds.mm; sourceTree = \"<group>\"; };\n\t\tFA8CC206173894F000464206 /* ProtocolAnalytics.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProtocolAnalytics.mm; sourceTree = \"<group>\"; };\n\t\tFA8CC207173894F000464206 /* ProtocolIAP.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProtocolIAP.mm; sourceTree = \"<group>\"; };\n\t\tFA8CC21B1739E86E00464206 /* InterfaceAds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterfaceAds.h; sourceTree = \"<group>\"; };\n\t\tFA8CC21C1739E86E00464206 /* InterfaceAnalytics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterfaceAnalytics.h; sourceTree = \"<group>\"; };\n\t\tFA8CC21D1739E86E00464206 /* InterfaceIAP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterfaceIAP.h; sourceTree = \"<group>\"; };\n\t\tFAB6DF931755D7D100C90D89 /* PluginFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginFactory.h; sourceTree = \"<group>\"; };\n\t\tFAB6DF941755D7D100C90D89 /* PluginParam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginParam.h; sourceTree = \"<group>\"; };\n\t\tFAB6DF951755D7E500C90D89 /* PluginParam.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginParam.cpp; path = ../PluginParam.cpp; sourceTree = \"<group>\"; };\n\t\tFAB6DF971755D82F00C90D89 /* PluginFactory.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginFactory.mm; sourceTree = \"<group>\"; };\n\t\tFAB6DF991755D93600C90D89 /* PluginProtocol.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProtocol.mm; sourceTree = \"<group>\"; };\n\t\tFAB6DFCD1755EF8E00C90D89 /* PluginOCMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginOCMacros.h; sourceTree = \"<group>\"; };\n\t\tFAC2A7F41777F88700035D22 /* ProtocolShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtocolShare.h; sourceTree = \"<group>\"; };\n\t\tFAC2A7F51777F8C200035D22 /* InterfaceShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterfaceShare.h; sourceTree = \"<group>\"; };\n\t\tFAC2A7F61777F8C200035D22 /* ProtocolShare.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProtocolShare.mm; sourceTree = \"<group>\"; };\n\t\tFAC2A7F71777F8C200035D22 /* ShareWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareWrapper.h; sourceTree = \"<group>\"; };\n\t\tFAC2A7F81777F8C200035D22 /* ShareWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShareWrapper.mm; sourceTree = \"<group>\"; };\n\t\tFAD5551C177D1FA900968F54 /* InterfaceUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterfaceUser.h; sourceTree = \"<group>\"; };\n\t\tFAD5551D177D1FA900968F54 /* ProtocolUser.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProtocolUser.mm; sourceTree = \"<group>\"; };\n\t\tFAD5551E177D1FA900968F54 /* UserWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserWrapper.h; sourceTree = \"<group>\"; };\n\t\tFAD5551F177D1FA900968F54 /* UserWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserWrapper.mm; sourceTree = \"<group>\"; };\n\t\tFAD55522177D213F00968F54 /* ProtocolUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtocolUser.h; sourceTree = \"<group>\"; };\n\t\tFADBF896179E504B00F59B1D /* ProtocolSocial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtocolSocial.h; sourceTree = \"<group>\"; };\n\t\tFADBF897179E509500F59B1D /* InterfaceSocial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InterfaceSocial.h; sourceTree = \"<group>\"; };\n\t\tFADBF898179E509500F59B1D /* ProtocolSocial.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProtocolSocial.mm; sourceTree = \"<group>\"; };\n\t\tFADBF899179E509500F59B1D /* SocialWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocialWrapper.h; sourceTree = \"<group>\"; };\n\t\tFADBF89A179E509500F59B1D /* SocialWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SocialWrapper.mm; sourceTree = \"<group>\"; };\n\t\tFADC44C8176EABCF00B2D5ED /* AdsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdsWrapper.h; sourceTree = \"<group>\"; };\n\t\tFADC44C9176EABCF00B2D5ED /* AdsWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AdsWrapper.mm; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tFA09A31E168ADBC2008C1C7B /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFA8CC2041737A3CE00464206 /* CoreFoundation.framework in Frameworks */,\n\t\t\t\tFA09A325168ADBC2008C1C7B /* Foundation.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\tFA09A316168ADBC2008C1C7B = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAB6DF951755D7E500C90D89 /* PluginParam.cpp */,\n\t\t\t\tFA0CB8B5168D3CC200E36B11 /* ios */,\n\t\t\t\tFA09A33C168ADC1F008C1C7B /* PluginManager.cpp */,\n\t\t\t\tFA09A336168ADC05008C1C7B /* include */,\n\t\t\t\tFA09A323168ADBC2008C1C7B /* Frameworks */,\n\t\t\t\tFA09A322168ADBC2008C1C7B /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA09A322168ADBC2008C1C7B /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA09A321168ADBC2008C1C7B /* libPluginProtocol.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA09A323168ADBC2008C1C7B /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA8CC2031737A3CE00464206 /* CoreFoundation.framework */,\n\t\t\t\tFA09A324168ADBC2008C1C7B /* Foundation.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA09A336168ADC05008C1C7B /* include */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADBF896179E504B00F59B1D /* ProtocolSocial.h */,\n\t\t\t\tFAD55522177D213F00968F54 /* ProtocolUser.h */,\n\t\t\t\tFAC2A7F41777F88700035D22 /* ProtocolShare.h */,\n\t\t\t\tFAB6DF931755D7D100C90D89 /* PluginFactory.h */,\n\t\t\t\tFAB6DF941755D7D100C90D89 /* PluginParam.h */,\n\t\t\t\tFA09A337168ADC05008C1C7B /* PluginManager.h */,\n\t\t\t\tFA09A338168ADC05008C1C7B /* PluginProtocol.h */,\n\t\t\t\tFA7C6C971724E4DD008A0ECC /* ProtocolAds.h */,\n\t\t\t\tFA09A339168ADC05008C1C7B /* ProtocolAnalytics.h */,\n\t\t\t\tFA09A33A168ADC05008C1C7B /* ProtocolIAP.h */,\n\t\t\t);\n\t\t\tname = include;\n\t\t\tpath = ../include;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA0CB8B5168D3CC200E36B11 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADBF897179E509500F59B1D /* InterfaceSocial.h */,\n\t\t\t\tFADBF898179E509500F59B1D /* ProtocolSocial.mm */,\n\t\t\t\tFADBF899179E509500F59B1D /* SocialWrapper.h */,\n\t\t\t\tFADBF89A179E509500F59B1D /* SocialWrapper.mm */,\n\t\t\t\tFAD5551C177D1FA900968F54 /* InterfaceUser.h */,\n\t\t\t\tFAD5551D177D1FA900968F54 /* ProtocolUser.mm */,\n\t\t\t\tFAD5551E177D1FA900968F54 /* UserWrapper.h */,\n\t\t\t\tFAD5551F177D1FA900968F54 /* UserWrapper.mm */,\n\t\t\t\tFAC2A7F51777F8C200035D22 /* InterfaceShare.h */,\n\t\t\t\tFAC2A7F61777F8C200035D22 /* ProtocolShare.mm */,\n\t\t\t\tFAC2A7F71777F8C200035D22 /* ShareWrapper.h */,\n\t\t\t\tFAC2A7F81777F8C200035D22 /* ShareWrapper.mm */,\n\t\t\t\tFADC44C8176EABCF00B2D5ED /* AdsWrapper.h */,\n\t\t\t\tFADC44C9176EABCF00B2D5ED /* AdsWrapper.mm */,\n\t\t\t\tFAB6DFCD1755EF8E00C90D89 /* PluginOCMacros.h */,\n\t\t\t\tFAB6DF991755D93600C90D89 /* PluginProtocol.mm */,\n\t\t\t\tFAB6DF971755D82F00C90D89 /* PluginFactory.mm */,\n\t\t\t\tFA8CC21B1739E86E00464206 /* InterfaceAds.h */,\n\t\t\t\tFA8CC21C1739E86E00464206 /* InterfaceAnalytics.h */,\n\t\t\t\tFA8CC21D1739E86E00464206 /* InterfaceIAP.h */,\n\t\t\t\tFA8CC205173894F000464206 /* ProtocolAds.mm */,\n\t\t\t\tFA8CC206173894F000464206 /* ProtocolAnalytics.mm */,\n\t\t\t\tFA8CC207173894F000464206 /* ProtocolIAP.mm */,\n\t\t\t\tFA8CC1E4173754CF00464206 /* PluginUtilsIOS.h */,\n\t\t\t\tFA8CC1E5173754CF00464206 /* PluginUtilsIOS.mm */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = ../platform/ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\tFA09A320168ADBC2008C1C7B /* PluginProtocol */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = FA09A32F168ADBC2008C1C7B /* Build configuration list for PBXNativeTarget \"PluginProtocol\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tFA09A31D168ADBC2008C1C7B /* Sources */,\n\t\t\t\tFA09A31E168ADBC2008C1C7B /* Frameworks */,\n\t\t\t\tFA09A31F168ADBC2008C1C7B /* CopyFiles */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = PluginProtocol;\n\t\t\tproductName = PluginProtocol;\n\t\t\tproductReference = FA09A321168ADBC2008C1C7B /* libPluginProtocol.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tFA09A318168ADBC2008C1C7B /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0460;\n\t\t\t\tORGANIZATIONNAME = zhangbin;\n\t\t\t};\n\t\t\tbuildConfigurationList = FA09A31B168ADBC2008C1C7B /* Build configuration list for PBXProject \"PluginProtocol\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = FA09A316168ADBC2008C1C7B;\n\t\t\tproductRefGroup = FA09A322168ADBC2008C1C7B /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tFA09A320168ADBC2008C1C7B /* PluginProtocol */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\tFA09A31D168ADBC2008C1C7B /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFA09A33E168ADC1F008C1C7B /* PluginManager.cpp in Sources */,\n\t\t\t\tFA8CC1E6173754CF00464206 /* PluginUtilsIOS.mm in Sources */,\n\t\t\t\tFA8CC208173894F000464206 /* ProtocolAds.mm in Sources */,\n\t\t\t\tFA8CC209173894F000464206 /* ProtocolAnalytics.mm in Sources */,\n\t\t\t\tFA8CC20A173894F000464206 /* ProtocolIAP.mm in Sources */,\n\t\t\t\tFAB6DF961755D7E500C90D89 /* PluginParam.cpp in Sources */,\n\t\t\t\tFAB6DF981755D82F00C90D89 /* PluginFactory.mm in Sources */,\n\t\t\t\tFAB6DF9A1755D93600C90D89 /* PluginProtocol.mm in Sources */,\n\t\t\t\tFADC44CA176EABCF00B2D5ED /* AdsWrapper.mm in Sources */,\n\t\t\t\tFAC2A7F91777F8C200035D22 /* ProtocolShare.mm in Sources */,\n\t\t\t\tFAC2A7FA1777F8C200035D22 /* ShareWrapper.mm in Sources */,\n\t\t\t\tFAD55520177D1FA900968F54 /* ProtocolUser.mm in Sources */,\n\t\t\t\tFAD55521177D1FA900968F54 /* UserWrapper.mm in Sources */,\n\t\t\t\tFADBF89B179E509500F59B1D /* ProtocolSocial.mm in Sources */,\n\t\t\t\tFADBF89C179E509500F59B1D /* SocialWrapper.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\tFA09A32D168ADBC2008C1C7B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFA09A32E168ADBC2008C1C7B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_VERSION = com.apple.compilers.llvm.clang.1_0;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.1;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tFA09A330168ADBC2008C1C7B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tDSTROOT = /tmp/PluginProtocol.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginProtocol-Prefix.pch\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tFA09A331168ADBC2008C1C7B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tDSTROOT = /tmp/PluginProtocol.dst;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"PluginProtocol-Prefix.pch\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\tFA09A31B168ADBC2008C1C7B /* Build configuration list for PBXProject \"PluginProtocol\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFA09A32D168ADBC2008C1C7B /* Debug */,\n\t\t\t\tFA09A32E168ADBC2008C1C7B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tFA09A32F168ADBC2008C1C7B /* Build configuration list for PBXNativeTarget \"PluginProtocol\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tFA09A330168ADBC2008C1C7B /* Debug */,\n\t\t\t\tFA09A331168ADBC2008C1C7B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = FA09A318168ADBC2008C1C7B /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.cpp",
    "content": "#include \"AppDelegate.h\"\n\n#include \"cocos2d.h\"\n#include \"SimpleAudioEngine.h\"\n#include \"ScriptingCore.h\"\n#include \"jsb_cocos2dx_auto.hpp\"\n#include \"jsb_cocos2dx_extension_auto.hpp\"\n#include \"extension/jsb_cocos2dx_extension_manual.h\"\n#include \"cocos2d_specifics.hpp\"\n#include \"jsb_opengl_registration.h\"\n#include \"localstorage/js_bindings_system_registration.h\"\n#include \"chipmunk/js_bindings_chipmunk_registration.h\"\n\n#include \"jsb_pluginx_protocols_auto.hpp\"\n#include \"jsb_pluginx_extension_registration.h\"\n\nUSING_NS_CC;\nusing namespace CocosDenshion;\n\nAppDelegate::AppDelegate()\n{\n}\n\nAppDelegate::~AppDelegate()\n{\n    ScriptEngineManager::destroyInstance();\n}\n\nbool AppDelegate::applicationDidFinishLaunching()\n{\n    // initialize director\n    auto pDirector = Director::getInstance();\n    pDirector->setOpenGLView(EGLView::getInstance());\n    pDirector->setProjection(Director::Projection::_2D);\n\n    auto designSize = Size(640, 960);\n    EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL);\n\n    // turn on display FPS\n    pDirector->setDisplayStats(true);\n\n    // set FPS. the default value is 1.0/60 if you don't call this\n    pDirector->setAnimationInterval(1.0 / 60);\n\n    ScriptingCore* sc = ScriptingCore::getInstance();\n    sc->addRegisterCallback(register_all_cocos2dx);\n    sc->addRegisterCallback(register_all_cocos2dx_extension);\n    sc->addRegisterCallback(register_cocos2dx_js_extensions);\n    sc->addRegisterCallback(jsb_register_chipmunk);\n    sc->addRegisterCallback(register_all_cocos2dx_extension_manual);\n    sc->addRegisterCallback(jsb_register_system);\n    sc->addRegisterCallback(JSB_register_opengl);\n\n    sc->addRegisterCallback(register_all_pluginx_protocols);\n    sc->addRegisterCallback(register_pluginx_js_extensions);\n    sc->start();\n\n    ScriptEngineProtocol *pEngine = ScriptingCore::getInstance();\n    ScriptEngineManager::getInstance()->setScriptEngine(pEngine);\n    ScriptingCore::getInstance()->runScript(\"main.js\");\n\n    return true;\n}\n\n// This function will be called when the app is inactive. When comes a phone call,it's be invoked too\nvoid AppDelegate::applicationDidEnterBackground()\n{\n    Director::getInstance()->stopAnimation();\n    SimpleAudioEngine::getInstance()->pauseBackgroundMusic();\n    SimpleAudioEngine::getInstance()->pauseAllEffects();\n}\n\n// this function will be called when the app is active again\nvoid AppDelegate::applicationWillEnterForeground()\n{\n    Director::getInstance()->startAnimation();\n    SimpleAudioEngine::getInstance()->resumeBackgroundMusic();\n    SimpleAudioEngine::getInstance()->resumeAllEffects();\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.h",
    "content": "#ifndef  _APP_DELEGATE_H_\n#define  _APP_DELEGATE_H_\n\n#include \"CCApplication.h\"\n/**\n @brief    The cocos2d Application.\n \n The reason for implement as private inheritance is to hide some interface call by Director.\n */\nclass  AppDelegate : private cocos2d::Application\n{\npublic:\n    AppDelegate();\n    virtual ~AppDelegate();\n    \n    /**\n     @brief    Implement Director and Scene init code here.\n     @return true    Initialize success, app continue.\n     @return false   Initialize failed, app terminate.\n     */\n    virtual bool applicationDidFinishLaunching();\n    \n    /**\n     @brief  The function be called when the application enter background\n     @param  the pointer of the application\n     */\n    virtual void applicationDidEnterBackground();\n    \n    /**\n     @brief  The function be called when the application enter foreground\n     @param  the pointer of the application\n     */\n    virtual void applicationWillEnterForeground();\n};\n\n#endif // _APP_DELEGATE_H_\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/Resources/main.js",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n\n http://www.cocos2d-x.org\n\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n// boot code needed for cocos2d + JS bindings.\n// Not needed by cocos2d-html5\nrequire(\"jsb.js\");\nrequire(\"jsb_pluginx.js\");\nvar appFiles = [\n    'src/resource.js',\n    'src/myApp.js'\n];\ncc.dumpConfig();\n\nfor( var i=0; i < appFiles.length; i++) {\n    require( appFiles[i] );\n}\nvar director = cc.Director.getInstance();\ndirector.setDisplayStats(true);\n\n// set FPS. the default value is 1.0/60 if you don't call this\ndirector.setAnimationInterval(1.0 / 60);\n\n// create a scene. it's an autorelease object\nvar myScene = new MyScene();\n\n// run\ndirector.runWithScene(myScene);\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/Resources/src/myApp.js",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2011      Zynga Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n\n\nvar g_pAnalytics = null;\nvar s_strAppKey = \"\";\n// The app key of flurry\nvar FLURRY_KEY_IOS      =    \"KMGG7CD9WPK2TW4X9VR8\";\nvar FLURRY_KEY_ANDROID  =    \"SPKFH8KMPGHMMBWRBT5W\";\nvar UMENG_KEY_IOS       =    \"50d2b18c5270152187000097\";\nvar UMENG_KEY_ANDROID   =    \"\";          // umeng key for android is setted in AndroidManifest.xml\n\n\nplugin.onApplicationDidEnterBackground = function() {\n    if (g_pAnalytics != null) {\n        cc.log(\"plugin.onApplicationDidEnterBackground.\");\n        g_pAnalytics.stopSession();\n    }\n};\n\n\nplugin.onApplicationWillEnterForeground = function() {\n    if (g_pAnalytics != null) {\n        cc.log(\"plugin.onApplicationWillEnterForeground.\");\n        g_pAnalytics.startSession(s_strAppKey);\n    }\n};\n\nvar loadAnalyticsPlugin = function() {\n    var langType = cc.Application.getInstance().getCurrentLanguage();\n\n    var umengKey  = \"\";\n    var flurryKey = \"\";\n\n    var targetDevice = cc.Application.getInstance().getTargetPlatform();\n    if (targetDevice == 1)\n    {\n        umengKey  = UMENG_KEY_IOS;\n        flurryKey = FLURRY_KEY_IOS;\n    }\n    else if (targetDevice == 2)\n    {\n        umengKey  = UMENG_KEY_ANDROID;\n        flurryKey = FLURRY_KEY_ANDROID;\n    }\n\n\n    if (cc.LANGUAGE_CHINESE == langType)\n    {\n        g_pAnalytics = plugin.PluginManager.getInstance().loadPlugin(\"AnalyticsUmeng\");\n        s_strAppKey = umengKey;\n    }\n    else\n    {\n        g_pAnalytics = plugin.PluginManager.getInstance().loadPlugin(\"AnalyticsFlurry\");\n        s_strAppKey = flurryKey;\n    }\n\n    g_pAnalytics.setDebugMode(true);\n    g_pAnalytics.startSession(s_strAppKey);\n    g_pAnalytics.setCaptureUncaughtException(true);\n\n    g_pAnalytics.callFuncWithParam(\"updateOnlineConfig\", null);\n\n    g_pAnalytics.callFuncWithParam(\"setReportLocation\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeBool, true));\n    g_pAnalytics.callFuncWithParam(\"logPageView\", null);\n    g_pAnalytics.callFuncWithParam(\"setVersionName\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"1.1\"));\n    g_pAnalytics.callFuncWithParam(\"setAge\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeInt, 20));\n    g_pAnalytics.callFuncWithParam(\"setGender\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeInt, 1));\n    g_pAnalytics.callFuncWithParam(\"setUserId\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"123456\"));\n    g_pAnalytics.callFuncWithParam(\"setUseHttps\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeBool, false));\n}\n\n\nTAG_LOG_EVENT_ID = 0;\nTAG_LOG_EVENT_ID_KV = 1;\nTAG_LOG_ONLINE_CONFIG = 2;\nTAG_LOG_EVENT_ID_DURATION = 3;\nTAG_LOG_EVENT_BEGIN = 4;\nTAG_LOG_EVENT_END = 5;\nTAG_MAKE_ME_CRASH = 6;\n\nvar s_EventMenuItem = [\n    {id: \"OnlineConfig\",     tag: TAG_LOG_ONLINE_CONFIG},\n    {id: \"LogEvent-eventId\", tag:  TAG_LOG_EVENT_ID},\n    {id: \"LogEvent-eventId-kv\", tag: TAG_LOG_EVENT_ID_KV},\n    {id: \"LogEvent-eventId-Duration\", tag: TAG_LOG_EVENT_ID_DURATION},\n    {id: \"LogEvent-Begin\", tag: TAG_LOG_EVENT_BEGIN},\n    {id: \"LogEvent-End\", tag: TAG_LOG_EVENT_END},\n    {id: \"MakeMeCrash\", tag: TAG_MAKE_ME_CRASH}\n];\n\nvar HelloWorld = cc.Layer.extend({\n    ctor:function() {\n        this._super();\n        cc.associateWithNative( this, cc.Layer );\n    },\n\n    onEnter: function() {\n        this._super();\n        var size = cc.Director.getInstance().getWinSize();\n\n        /////////////////////////////\n        // 2. add a menu item with \"X\" image, which is clicked to quit the program\n        //    you may modify it.\n\n        // add a \"close\" icon to exit the progress. it's an autorelease object\n        var pCloseItem = cc.MenuItemImage.create(\n                                            \"CloseNormal.png\",\n                                            \"CloseSelected.png\",\n                                            this.menuCloseCallback, \n                                            this);\n        pCloseItem.setPosition( cc.p(size.width - 20, 20) );\n\n        // create menu, it's an autorelease object\n        var pMenu = cc.Menu.create(pCloseItem);\n        pMenu.setPosition( cc.p(0, 0) );\n        this.addChild(pMenu, 1);\n\n        var yPos = 0;\n        for (var i = 0; i < s_EventMenuItem.length; i++) {\n            var label = cc.LabelTTF.create(s_EventMenuItem[i].id, \"Arial\", 24);\n            var pMenuItem = cc.MenuItemLabel.create(label, this.eventMenuCallback, this);\n            pMenu.addChild(pMenuItem, 0, s_EventMenuItem[i].tag);\n            yPos = size.height - 50*i - 100;\n            pMenuItem.setPosition( cc.p(size.width / 2, yPos));\n        }\n\n        var strName = g_pAnalytics.getPluginName();\n        var strVer = g_pAnalytics.getPluginVersion();\n        var ret = \"Plugin : \"+strName+\", Ver : \"+ strVer;\n        var pLabel = cc.LabelTTF.create(ret, \"Arial\", 24, cc.size(size.width, 0), cc.TEXT_ALIGNMENT_CENTER);\n        pLabel.setPosition(cc.p(size.width / 2, yPos - 100));\n        this.addChild(pLabel);\n\n        var label = cc.LabelTTF.create(\"reload all plugins\", \"Arial\", 24);\n        var pMenuItem = cc.MenuItemLabel.create(label, this.reloadPluginMenuCallback, this);\n        pMenuItem.setAnchorPoint(cc.p(0.5, 0));\n        pMenu.addChild(pMenuItem, 0);\n        pMenuItem.setPosition( cc.p(size.width / 2, 0));\n    },\n\n    reloadPluginMenuCallback: function(pSender) {\n        cc.log(\"reloadPluginMenuCallback\");\n        plugin.PluginManager.getInstance().unloadPlugin(\"AnalyticsFlurry\");\n        plugin.PluginManager.getInstance().unloadPlugin(\"AnalyticsUmeng\");\n\n        loadAnalyticsPlugin();\n    },\n\n    eventMenuCallback: function(pSender) {\n        switch (pSender.getTag())\n        {\n        case TAG_LOG_EVENT_ID:\n            {\n                g_pAnalytics.logEvent(\"click\");\n                g_pAnalytics.logEvent(\"music\");\n            }\n            break;\n        case TAG_LOG_EVENT_ID_KV:\n            {\n                var paramMap = {};\n                paramMap[\"type\"] = \"popular\";\n                paramMap[\"artist\"] = \"JJLin\";\n                g_pAnalytics.logEvent(\"music\", paramMap);\n            }\n            break;\n        case TAG_LOG_ONLINE_CONFIG:\n            {\n                cc.log(\"Online config = \" + g_pAnalytics.callStringFuncWithParam(\"getConfigParams\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"abc\")));\n            }\n            break;\n        case TAG_LOG_EVENT_ID_DURATION:\n            {\n                g_pAnalytics.callFuncWithParam(\"logEventWithDuration\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"book\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeInt, 12000));\n                g_pAnalytics.callFuncWithParam(\"logEventWithDurationLabel\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"book\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeInt, 23000),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"chapter1\"));\n                var paramMap = {};\n                paramMap[\"type\"] = \"popular\";\n                paramMap[\"artist\"] = \"JJLin\";\n                g_pAnalytics.callFuncWithParam(\"logEventWithDurationParams\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"music\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeInt, 2330000),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeStringMap, paramMap));\n            }\n            break;\n        case TAG_LOG_EVENT_BEGIN:\n            {\n                g_pAnalytics.logTimedEventBegin(\"music\");\n\n                var paramMap = {};\n                paramMap[\"type\"] = \"popular\";\n                paramMap[\"artist\"] = \"JJLin\";\n\n                g_pAnalytics.callFuncWithParam(\"logTimedEventWithLabelBegin\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"music\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"one\"));\n                g_pAnalytics.callFuncWithParam(\"logTimedKVEventBegin\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"music\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"flag0\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeStringMap, paramMap));\n\n                g_pAnalytics.callFuncWithParam(\"logTimedEventBeginWithParams\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"music-kv\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeStringMap, paramMap));\n            }\n            break;\n        case TAG_LOG_EVENT_END:\n            {\n                g_pAnalytics.logTimedEventEnd(\"music\");\n\n                g_pAnalytics.callFuncWithParam(\"logTimedEventWithLabelEnd\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"music\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"one\"));\n                g_pAnalytics.callFuncWithParam(\"logTimedKVEventEnd\",\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"music\"),\n                        new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"flag0\"));\n\n                g_pAnalytics.callFuncWithParam(\"logTimedEventEnd\", new plugin.PluginParam(plugin.PluginParam.ParamType.TypeString, \"music-kv\"));\n            }\n            break;\n        case TAG_MAKE_ME_CRASH:\n            {\n\n            }\n            break;\n        default:\n            break;\n        }\n    },\n\n    menuCloseCallback: function() {\n        cc.log(\"menuCloseCallback\");\n    }\n\n});\n\nvar MyScene = cc.Scene.extend({\n    ctor:function() {\n        this._super();\n        cc.associateWithNative( this, cc.Scene );\n    },\n\n    onEnter:function () {\n        this._super();\n        loadAnalyticsPlugin();\n\n        var layer = new HelloWorld();\n        layer.init();\n        this.addChild(layer);\n    }\n});\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/Resources/src/resource.js",
    "content": "var s_HelloWorld = \"res/HelloWorld.png\";\nvar s_CloseNormal = \"res/CloseNormal.png\";\nvar s_CloseSelected = \"res/CloseSelected.png\";\n\nvar g_ressources = [\n    //image\n    {src:s_HelloWorld},\n    {src:s_CloseNormal},\n    {src:s_CloseSelected}\n\n    //plist\n\n    //fnt\n\n    //tmx\n\n    //bgm\n\n    //effect\n];"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/protocols/android/libPluginProtocol.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/flurry/android/FlurryAgent.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/flurry/android/libPluginFlurry.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/umeng/android/libPluginUmeng.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/umeng/android/umeng_sdk.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>HelloAnalytics-JS</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n\t<linkedResources>\n\t\t<link>\n\t\t\t<name>Classes</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-1-PROJECT_LOC/Classes</locationURI>\n\t\t</link>\n\t\t<link>\n\t\t\t<name>publish</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-3-PROJECT_LOC/publish</locationURI>\n\t\t</link>\n\t</linkedResources>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      package=\"org.cocos2dx.helloanalyticsjs\"\n      android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"9\"/>\n\n    <application android:label=\"@string/app_name\"\n        android:debuggable=\"true\"\n        android:icon=\"@drawable/icon\">\n\n        <activity android:name=\"android.app.NativeActivity\"\n                  android:label=\"@string/app_name\"\n                  android:screenOrientation=\"portrait\"\n                  android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n                  android:configChanges=\"orientation|screenSize|smallestScreenSize\">\n\n            <!-- Tell NativeActivity the name of our .so -->\n            <meta-data android:name=\"android.app.lib_name\"\n                       android:value=\"game\" />\n\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n\n        <!-- Caution! Do not change this app key. It is only for demo usage.  -->\n\t\t<meta-data android:value=\"50d2af93527015338b000052\" android:name=\"UMENG_APPKEY\"></meta-data>\n\n        <meta-data\n            android:name=\"UMENG_CHANNEL\"\n            android:value=\"Umeng\" >\n        </meta-data>\n           \n        <service\n            android:name=\"com.umeng.common.net.DownloadingService\"\n            android:exported=\"true\"\n            android:process=\":DownloadingService\" >\n        </service>\n        \n    </application>\n    <supports-screens android:largeScreens=\"true\"\n                      android:smallScreens=\"true\"\n                      android:anyDensity=\"true\"\n                      android:normalScreens=\"true\"/>\n    \n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n    <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <uses-permission android:name=\"android.permission.READ_LOGS\" />\n    <uses-permission android:name=\"android.permission.CALL_PHONE\" />\n\t<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>\n\t<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>\n    <!-- Permission for Unit Test -->\n    <uses-permission android:name=\"android.permission.GET_TASKS\" />\n</manifest> \n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/ant.properties",
    "content": "# This file is used to override default values used by the Ant build system.\n#\n# This file must be checked into Version Control Systems, as it is\n# integral to the build system of your project.\n\n# This file is only used by the Ant script.\n\n# You can use this to override default values such as\n#  'source.dir' for the location of your java source folder and\n#  'out.dir' for the location of your output folder.\n\n# You can also use it define how the release builds are signed by declaring\n# the following properties:\n#  'key.store' for the location of your keystore and\n#  'key.alias' for the name of the key to use.\n# The password will be asked during the build when you use the 'release' target.\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"HelloAnalytics-JS\" default=\"help\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${sdk.dir}/tools/ant/build.xml\" />\n\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/jni/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := game\n\nLOCAL_MODULE_FILENAME := libgame\n\nLOCAL_SRC_FILES := hellocpp/main.cpp \\\n                   ../../Classes/AppDelegate.cpp \\\n                   ../../../../jsbindings/auto/jsb_pluginx_protocols_auto.cpp \\\n                   ../../../../jsbindings/manual/pluginxUTF8.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_basic_conversions.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_manual_protocols.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_manual_callback.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_extension_registration.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_spidermonkey_specifics.cpp \n                   \nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \\\n                    $(LOCAL_PATH)/../../../../jsbindings \\\n                    $(LOCAL_PATH)/../../../../jsbindings/auto \\\n                    $(LOCAL_PATH)/../../../../jsbindings/manual \n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static \\\n        jsb_extension_static \\\n        jsb_localstorage_static \\\n        jsb_chipmunk_static \\\n        PluginProtocolStatic\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,scripting/javascript/bindings/extension)\n$(call import-module,scripting/javascript/bindings/localstorage)\n$(call import-module,scripting/javascript/bindings/chipmunk)\n$(call import-module,protocols/android)\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/jni/Application.mk",
    "content": "APP_STL := gnustl_static\nAPP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 -std=c++11 -Wno-literal-suffix -fsigned-char\nAPP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/jni/hellocpp/main.cpp",
    "content": "#include \"AppDelegate.h\"\n#include \"platform/android/jni/JniHelper.h\"\n#include <jni.h>\n#include <android/log.h>\n#include \"PluginJniHelper.h\"\n#include <android_native_app_glue.h>\n#include \"PluginUtils.h\"\n\n#include \"cocos2d.h\"\n\n#define  LOG_TAG    \"main\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nusing namespace cocos2d;\n\nvoid cocos_android_app_init (struct android_app* app) {\n    LOGD(\"cocos_android_app_init\");\n    AppDelegate *pAppDelegate = new AppDelegate();\n    PluginJniHelper::setJavaVM(app->activity->vm);\n    PluginJniHelper::setClassLoaderFrom(app->activity->clazz);\n    cocos2d::plugin::PluginUtils::initPluginWrapper(app);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/ndkgdb.sh",
    "content": "APPNAME=\"HelloAnalytics-JS\"\nAPP_ANDROID_NAME=\"org.cocos2dx.helloanalytics\"\n\nif [ -z \"${SDK_ROOT+aaa}\" ]; then\n# ... if SDK_ROOT is not set, use \"$HOME/bin/android-sdk\"\n    SDK_ROOT=\"$HOME/bin/android-sdk\"\nfi\n\nif [ -z \"${NDK_ROOT+aaa}\" ]; then\n# ... if NDK_ROOT is not set, use \"$HOME/bin/android-ndk\"\n    NDK_ROOT=\"$HOME/bin/android-ndk\"\nfi\n\nif [ -z \"${COCOS2DX_ROOT+aaa}\" ]; then\n# ... if COCOS2DX_ROOT is not set\n# ... find current working directory\n    DIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n# ... use paths relative to current directory\n    COCOS2DX_ROOT=\"$DIR/../..\"\n    APP_ROOT=\"$DIR/..\"\n    APP_ANDROID_ROOT=\"$DIR\"\nelse\n    APP_ROOT=\"$COCOS2DX_ROOT/$APPNAME\"\n    APP_ANDROID_ROOT=\"$COCOS2DX_ROOT/$APPNAME/proj.android\"\nfi\n\necho \"NDK_ROOT = $NDK_ROOT\"\necho \"SDK_ROOT = $SDK_ROOT\"\necho \"COCOS2DX_ROOT = $COCOS2DX_ROOT\"\necho \"APP_ROOT = $APP_ROOT\"\necho \"APP_ANDROID_ROOT = $APP_ANDROID_ROOT\"\necho \"APP_ANDROID_NAME = $APP_ANDROID_NAME\"\n\necho\necho \"Killing and restarting ${APP_ANDROID_NAME}\"\necho\n\nset -x\n\n\"${SDK_ROOT}\"/platform-tools/adb shell am force-stop \"${APP_ANDROID_NAME}\"\n\nNDK_MODULE_PATH=\"${COCOS2DX_ROOT}\":\"${COCOS2DX_ROOT}\"/cocos2dx/platform/third_party/android/prebuilt \\\n    \"${NDK_ROOT}\"/ndk-gdb \\\n    --adb=\"${SDK_ROOT}\"/platform-tools/adb \\\n    --verbose \\\n    --start \\\n    --force\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-13\nandroid.library.reference.1=../../../../cocos/2d/platform/android/java\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">HelloAnalytics-JS</string>\n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloAnalytics-JS/proj.android/src/nojava.txt",
    "content": "No Java files\nsrc/ is required for Android's build.xml to operate correctly.\ngit does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/Classes/AppDelegate.cpp",
    "content": "#include \"AppDelegate.h\"\n\n#include \"cocos2d.h\"\n#include \"SimpleAudioEngine.h\"\n#include \"ScriptingCore.h\"\n#include \"jsb_cocos2dx_auto.hpp\"\n#include \"jsb_cocos2dx_extension_auto.hpp\"\n#include \"extension/jsb_cocos2dx_extension_manual.h\"\n#include \"cocos2d_specifics.hpp\"\n#include \"jsb_opengl_registration.h\"\n#include \"localstorage/js_bindings_system_registration.h\"\n#include \"chipmunk/js_bindings_chipmunk_registration.h\"\n\n#include \"jsb_pluginx_protocols_auto.hpp\"\n#include \"jsb_pluginx_extension_registration.h\"\n\nUSING_NS_CC;\nusing namespace CocosDenshion;\n\nAppDelegate::AppDelegate()\n{\n}\n\nAppDelegate::~AppDelegate()\n{\n    ScriptEngineManager::destroyInstance();\n}\n\nbool AppDelegate::applicationDidFinishLaunching()\n{\n    // initialize director\n    auto pDirector = Director::getInstance();\n    pDirector->setOpenGLView(EGLView::getInstance());\n    pDirector->setProjection(Director::Projection::_2D);\n\n    auto designSize = Size(960, 640);\n    EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, ResolutionPolicy::SHOW_ALL);\n\n    // turn on display FPS\n    pDirector->setDisplayStats(true);\n\n    // set FPS. the default value is 1.0/60 if you don't call this\n    pDirector->setAnimationInterval(1.0 / 60);\n\n    ScriptingCore* sc = ScriptingCore::getInstance();\n    sc->addRegisterCallback(register_all_cocos2dx);\n    sc->addRegisterCallback(register_all_cocos2dx_extension);\n    sc->addRegisterCallback(register_cocos2dx_js_extensions);\n    sc->addRegisterCallback(jsb_register_chipmunk);\n    sc->addRegisterCallback(register_all_cocos2dx_extension_manual);\n    sc->addRegisterCallback(jsb_register_system);\n    sc->addRegisterCallback(JSB_register_opengl);\n\n    sc->addRegisterCallback(register_all_pluginx_protocols);\n    sc->addRegisterCallback(register_pluginx_js_extensions);\n    sc->start();\n\n    ScriptEngineProtocol *pEngine = ScriptingCore::getInstance();\n    ScriptEngineManager::getInstance()->setScriptEngine(pEngine);\n    ScriptingCore::getInstance()->runScript(\"main.js\");\n\n    return true;\n}\n\n// This function will be called when the app is inactive. When comes a phone call,it's be invoked too\nvoid AppDelegate::applicationDidEnterBackground()\n{\n    Director::getInstance()->stopAnimation();\n    SimpleAudioEngine::getInstance()->pauseBackgroundMusic();\n    SimpleAudioEngine::getInstance()->pauseAllEffects();\n}\n\n// this function will be called when the app is active again\nvoid AppDelegate::applicationWillEnterForeground()\n{\n    Director::getInstance()->startAnimation();\n    SimpleAudioEngine::getInstance()->resumeBackgroundMusic();\n    SimpleAudioEngine::getInstance()->resumeAllEffects();\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/Classes/AppDelegate.h",
    "content": "#ifndef  _APP_DELEGATE_H_\n#define  _APP_DELEGATE_H_\n\n#include \"CCApplication.h\"\n/**\n @brief    The cocos2d Application.\n \n The reason for implement as private inheritance is to hide some interface call by Director.\n */\nclass  AppDelegate : private cocos2d::Application\n{\npublic:\n    AppDelegate();\n    virtual ~AppDelegate();\n    \n    /**\n     @brief    Implement Director and Scene init code here.\n     @return true    Initialize success, app continue.\n     @return false   Initialize failed, app terminate.\n     */\n    virtual bool applicationDidFinishLaunching();\n    \n    /**\n     @brief  The function be called when the application enter background\n     @param  the pointer of the application\n     */\n    virtual void applicationDidEnterBackground();\n    \n    /**\n     @brief  The function be called when the application enter foreground\n     @param  the pointer of the application\n     */\n    virtual void applicationWillEnterForeground();\n};\n\n#endif // _APP_DELEGATE_H_\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/Resources/main.js",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n\n http://www.cocos2d-x.org\n\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n// boot code needed for cocos2d + JS bindings.\n// Not needed by cocos2d-html5\n\nrequire(\"jsb.js\");\nrequire(\"jsb_pluginx.js\");\n\nvar appFiles = [\n    'src/resource.js',\n    'src/myApp.js'\n];\n\ncc.dumpConfig();\n\nfor( var i=0; i < appFiles.length; i++) {\n    require( appFiles[i] );\n}\n\nvar director = cc.Director.getInstance();\ndirector.setDisplayStats(true);\n\n// set FPS. the default value is 1.0/60 if you don't call this\ndirector.setAnimationInterval(1.0 / 60);\n\n// create a scene. it's an autorelease object\nvar myScene = new MyScene();\n\n// run\ndirector.runWithScene(myScene);\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/Resources/src/myApp.js",
    "content": "/****************************************************************************\n Copyright (c) 2010-2012 cocos2d-x.org\n Copyright (c) 2008-2010 Ricardo Quesada\n Copyright (c) 2011      Zynga Inc.\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\neNoneMode = 0;\neAlipay = 1;\neND91 = 2;\n\n\nvar __iapInstance = null;\n\nvar MyPurchase = cc.Class.extend({\n    _pAlipay: null,\n    _pRetListener: null,\n    _pNd91: null,\n\n    loadIAPPlugin: function() {\n\n        // init alipay plugin\n        this._pAlipay = plugin.PluginManager.getInstance().loadPlugin(\"IAPAlipay\");\n        var pAlipayInfo = {};\n\n        if (Object.keys(pAlipayInfo).length == 0)\n        {\n            cc.log(\"Alipay Warning: Developer info is empty. PLZ fill your alipay info to pAlipayInfo)\");\n        }\n\n        this._pAlipay.setDebugMode(true);\n        this._pAlipay.configDeveloperInfo(pAlipayInfo);\n        this._pAlipay.setResultListener(this);\n\n        var pNdInfo = {};\n        pNdInfo[\"Nd91AppId\"] = \"100010\";\n        pNdInfo[\"Nd91AppKey\"] = \"C28454605B9312157C2F76F27A9BCA2349434E546A6E9C75\";\n        pNdInfo[\"Nd91Orientation\"] = \"landscape\";\n        if (Object.keys(pNdInfo).length == 0) {\n            cc.log(\"Nd91 Warning: Developer info is empty. PLZ fill your alipay info to pAlipayInfo)\");\n        }\n        this._pNd91 = plugin.PluginManager.getInstance().loadPlugin(\"IAPNd91\");\n        this._pNd91.setDebugMode(true);\n        this._pNd91.configDeveloperInfo(pNdInfo);\n        this._pNd91.setResultListener(this);\n    },\n\n    unloadIAPPlugin: function() {\n        if (this._pAlipay)\n        {\n            plugin.PluginManager.getInstance().unloadPlugin(\"IAPAlipay\");\n            this._pAlipay = null;\n        }\n\n        if (this._pNd91)\n        {\n            plugin.PluginManager.getInstance().unloadPlugin(\"IAPNd91\");\n            this._pNd91 = null;\n        }\n    },\n\n    payByMode:function(info, mode) {\n        var pIAP = null;\n        switch(mode)\n        {\n        case eAlipay:\n            pIAP = this._pAlipay;\n            break;\n        case eND91:\n            pIAP = this._pNd91;\n            break;\n        default:\n            break;\n        }\n\n        if (pIAP) {\n            pIAP.payForProduct(info);\n        }\n    },\n\n    onPayResult: function(ret, msg, productInfo) {\n        cc.log(\"---------onPayResult callback begin-----------------\");\n        cc.log(\"onPayResult=\"+ ret + \";msg=\" +msg + \";productinfo=\"+productInfo);\n        cc.log(\"---------onPayResult callback end-----------------\");\n    },\n});\n\nMyPurchase.getInstance = function() {\n    if (__iapInstance == null) {\n        __iapInstance = new MyPurchase();\n    }\n    return __iapInstance;\n}\n\nTAG_PAY_BY_ALIPAY = 100;\nTAG_PAY_BY_ND91 = 101;\n\nvar _EventMenuItem = [\n    {id: \"BtnAlipay.png\", tag: TAG_PAY_BY_ALIPAY},\n    {id: \"BtnND91.png\", tag: TAG_PAY_BY_ND91}\n];\n\nvar IAPTestLayer = cc.Layer.extend({\n\n    ctor:function() {\n        this._super();\n        cc.associateWithNative( this, cc.Layer );\n    },\n\n    menuCloseCallback: function() {\n        cc.log(\"menuCloseCallback\");\n        __jsc__.garbageCollect();\n    },\n\n    eventMenuCallback: function(pSender) {\n        var pMenuItem = pSender;\n        var pInfo = {};\n        var mode = 0;\n        \n        switch (pMenuItem.getTag())\n        {\n            case TAG_PAY_BY_ALIPAY:\n                pInfo[\"productName\"] = \"100金币\";\n                pInfo[\"productPrice\"] = \"0.1\";\n                pInfo[\"productDesc\"] = \"100个金灿灿的游戏币哦\";\n                mode = eAlipay;\n                break;\n            case TAG_PAY_BY_ND91:\n                pInfo[\"productName\"] = \"100金币\";\n                pInfo[\"productPrice\"] = \"0.01\";\n                pInfo[\"productDesc\"] = \"100个金灿灿的游戏币哦\";\n                pInfo[\"Nd91ProductId\"] = \"685994\";\n                mode = eND91;\n                break;\n            default:\n                break;\n        }\n        cc.log(\"eventMenuCallback, item tag = \"+pMenuItem.getTag());\n        MyPurchase.getInstance().payByMode(pInfo, mode);\n    },\n\n    reloadPluginMenuCallback: function() {\n        MyPurchase.getInstance().unloadIAPPlugin();\n        MyPurchase.getInstance().loadIAPPlugin();\n        cc.log(\"reloadPluginMenuCallback\");\n    },\n\n    onEnter:function () {\n        this._super();\n        MyPurchase.getInstance().loadIAPPlugin();\n\n        var director = cc.Director.getInstance();\n        var size = director.getWinSize();\n        \n        var background = cc.Sprite.create(\"res/background.png\");\n        background.setPosition(cc.p(size.width / 2, size.height / 2));\n        this.addChild(background);\n\n        var posBR = cc.p(director.getVisibleOrigin().x + director.getVisibleSize().width, director.getVisibleOrigin().y);\n        var posTL = cc.p(director.getVisibleOrigin().x, director.getVisibleOrigin().y + director.getVisibleSize().height);\n        \n        var pCloseItem = cc.MenuItemImage.create(\n                              \"res/CloseNormal.png\",\n                              \"res/CloseSelected.png\",\n                              this.menuCloseCallback,\n                              this );\n        pCloseItem.setPosition( cc.p(posBR.x - 20, posBR.y + 20) );\n        \n        // create menu, it's an autorelease object\n        var pMenu = cc.Menu.create(pCloseItem);\n        pMenu.setPosition( cc.p(0, 0) );\n        this.addChild(pMenu, 1);\n        \n        var posStep = cc.p(220, -150);\n        var beginPos = cc.pAdd(posTL, cc.pMult(posStep, 0.5));\n        var line = 0;\n        var row = 0;\n        for (var i = 0; i < _EventMenuItem.length; i++) {\n            var pMenuItem = cc.MenuItemImage.create(_EventMenuItem[i].id, _EventMenuItem[i].id,\n                                                this.eventMenuCallback, this);\n\n            pMenu.addChild(pMenuItem, 0, _EventMenuItem[i].tag);\n            \n            var pos = cc.pAdd(beginPos, cc.p(posStep.x * row, posStep.y * line));\n            var itemSize = pMenuItem.getContentSize();\n            if ((pos.x + itemSize.width / 2) > posBR.x)\n            {\n                line += 1;\n                row = 0;\n                pos = cc.pAdd(beginPos, cc.p(posStep.x * row, posStep.y * line));\n            }\n            row += 1;\n            pMenuItem.setPosition(pos);\n        }\n        \n        var label = cc.LabelTTF.create(\"reload all plugins\", \"Arial\", 24);\n        var pMenuItem = cc.MenuItemLabel.create(label, this.reloadPluginMenuCallback, this);\n        pMenuItem.setAnchorPoint(cc.p(0.5, 0));\n        pMenu.addChild(pMenuItem, 0);\n        pMenuItem.setPosition( cc.p(size.width / 2, 0));\n    },\n});\n\nvar MyScene = cc.Scene.extend({\n    ctor:function() {\n        this._super();\n        cc.associateWithNative( this, cc.Scene );\n    },\n\n    onEnter:function () {\n        this._super();\n        var layer = new IAPTestLayer();\n        layer.init();\n        this.addChild(layer);\n    }\n});\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/Resources/src/resource.js",
    "content": "var s_HelloWorld = \"res/HelloWorld.png\";\nvar s_CloseNormal = \"res/CloseNormal.png\";\nvar s_CloseSelected = \"res/CloseSelected.png\";\n\nvar g_ressources = [\n    //image\n    {src:s_HelloWorld},\n    {src:s_CloseNormal},\n    {src:s_CloseSelected}\n\n    //plist\n\n    //fnt\n\n    //tmx\n\n    //bgm\n\n    //effect\n];"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/protocols/android/libPluginProtocol.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/alipay/android/alipay_plugin.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/alipay/android/libPluginAlipay.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/nd91/android/libPluginNd91.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"publish/plugins/nd91/android/NdComPlatform.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>HelloIAP-JS</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n\t<linkedResources>\n\t\t<link>\n\t\t\t<name>Classes</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-1-PROJECT_LOC/Classes</locationURI>\n\t\t</link>\n\t\t<link>\n\t\t\t<name>publish</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-3-PROJECT_LOC/publish</locationURI>\n\t\t</link>\n\t</linkedResources>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      package=\"org.cocos2dx.helloIAPJS\"\n      android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"9\"/>\n\n    <application android:label=\"@string/app_name\"\n        android:debuggable=\"true\"\n        android:icon=\"@drawable/icon\">\n\n        <activity android:name=\"android.app.NativeActivity\"\n                  android:label=\"@string/app_name\"\n                  android:screenOrientation=\"landscape\"\n                  android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n                  android:configChanges=\"orientation|screenSize|smallestScreenSize\">\n\n            <!-- Tell NativeActivity the name of our .so -->\n            <meta-data android:name=\"android.app.lib_name\"\n                       android:value=\"game\" />\n\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n\n        <!-- Activity info for cmgc -->\n        <activity android:name=\"cn.emagsoftware.gamebilling.activity.BillingActivity\"\n\t\t\tandroid:windowSoftInputMode=\"stateHidden\"\n            android:screenOrientation=\"landscape\"\n\t\t\tandroid:configChanges=\"orientation|keyboardHidden\">\n\t\t</activity>\n\t\t\n        <!-- Activity info for Telecom -->\n        <activity\n            android:name=\"com.egamefei.sdk.uis.EgamefeeWebActivity\"\n            android:configChanges=\"keyboardHidden\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@android:style/Theme.NoTitleBar\"\n            android:windowSoftInputMode=\"adjustPan\" >\n        </activity>\n        <activity\n            android:name=\"cn.game189.sms.SMS\"\n            android:theme=\"@android:style/Theme.Dialog\" >\n        </activity>\n        \n        <!-- sms id for telecom -->\n        <meta-data android:name=\"gameId\" android:value=\"226602\" ></meta-data>\n        <meta-data android:name=\"toolName_39696\" android:value=\"原地复活\" />\n        <meta-data android:name=\"toolPrice_39696\" android:value=\"1元\" />\n        <meta-data android:name=\"feeCode_39696\" android:value=\"0111C001741102210073711102210072550115174000000000000000000000000000\" />\n\n        <!-- cpinfo for unicom -->\n        <meta-data android:value=\"cpid:86001651\" android:name=\"cpId\"></meta-data>\n        <meta-data android:value=\"appid:90543208420120925564600\" android:name=\"AppId\"></meta-data>\n        <meta-data android:value=\"fidsms:00012269\" android:name=\"fidsms\"></meta-data>\n        \n        <!-- activity info for punchbox -->\n        <activity\n            android:name=\"com.chukong.usercenter.CKYeePayActivity\"\n            android:screenOrientation=\"landscape\"\n            android:configChanges=\"keyboardHidden|orientation\"\n            android:theme=\"@android:style/Theme.Translucent.NoTitleBar.Fullscreen\">\n        </activity>\n        <activity android:name=\"com.yeepay.android.plugin.YeepayPlugin\"\n            android:screenOrientation=\"landscape\"\n            android:configChanges=\"keyboardHidden|orientation\"\n            android:theme=\"@android:style/Theme.Translucent.NoTitleBar\">\n        </activity>\n        \n        <!-- activity info for nd91 -->\n        <activity android:name=\"com.nd.commplatform.activity.SNSControlCenterActivity\"\n\t        android:configChanges=\"orientation|keyboardHidden|navigation\"\n\t        android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n\t        android:windowSoftInputMode=\"adjustPan\"\n\t        android:windowBackground=\"@null\"\n\t        android:launchMode=\"singleTask\"/>\n\t\n\t    <activity android:name=\"com.nd.commplatform.activity.SNSLoginActivity\"\n\t        android:configChanges=\"orientation|keyboardHidden|navigation\"\n\t        android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n\t        android:windowSoftInputMode=\"adjustPan\"\n\t        android:windowBackground=\"@null\"\n\t        android:launchMode=\"singleTask\"/>\n\t\n\t    <activity android:name=\"com.nd.commplatform.activity.SNSAppPromotionActivity\"\n\t        android:configChanges=\"orientation|keyboardHidden|navigation\"\n\t        android:windowSoftInputMode=\"adjustPan\"\n\t        android:theme=\"@android:style/Theme.NoTitleBar\"\n\t        android:windowBackground=\"@null\"/>\n\t\n\t\n\t    <service  android:name=\"com.nd.commplatform.service.NdDownloadService\"\n\t        android:process=\":com.nd.commplatform.download\"\n\t        android:enabled=\"true\"\n\t        android:exported=\"false\"/>\n\t\n\t    <receiver android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateNotify\"\n\t        android:process=\"android.intent.nd.sns.commplatform.versionupdate\"\n\t        android:exported=\"false\"/>\n\t\n\t    <service android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateService\"\n\t        android:process=\"android.intent.nd.sns.commplatform.versionupdate\"\n\t\t\tandroid:exported=\"false\"/>\n\t\n\t    <service  android:name=\"com.nd.commplatform.service.NdNewMessageNotification\"\n\t        android:enabled=\"true\"\n\t        android:exported=\"false\"/>\n    </application>\n    <supports-screens android:largeScreens=\"true\"\n                      android:smallScreens=\"true\"\n                      android:anyDensity=\"true\"\n                      android:normalScreens=\"true\"/>\n\n    <!-- Alipay permission -->\n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n    <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n\n    <!-- cmgc permission -->\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n\t<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"></uses-permission>\n\t<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n\t<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"></uses-permission>\n\t<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"></uses-permission>\n\t<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n\t<uses-permission android:name=\"android.permission.SEND_SMS\" />\n\t<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>\n\t<uses-permission android:name=\"android.permission.READ_CONTACTS\" />\n\t<uses-permission android:name=\"android.permission.WRITE_APN_SETTINGS\"></uses-permission>\n\t\n    <!-- telecom permission -->\n    <uses-permission android:name=\"android.permission.SEND_SMS\" />\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n    <uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />\n    <uses-permission android:name=\"android.permission.VIBRATE\" />\n\n    <!-- nd91 permission -->\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n\t<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>\n\t<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n\t<uses-permission android:name=\"android.permission.SEND_SMS\"/>\n\t<uses-permission android:name=\"android.permission.INTERNET\" />\n\t<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n\t<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>\n\t<uses-permission android:name=\"android.permission.CALL_PHONE\" />   \n    <uses-permission android:name=\"android.permission.GET_TASKS\" />\n    <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n</manifest> \n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/ant.properties",
    "content": "# This file is used to override default values used by the Ant build system.\n#\n# This file must be checked into Version Control Systems, as it is\n# integral to the build system of your project.\n\n# This file is only used by the Ant script.\n\n# You can use this to override default values such as\n#  'source.dir' for the location of your java source folder and\n#  'out.dir' for the location of your output folder.\n\n# You can also use it define how the release builds are signed by declaring\n# the following properties:\n#  'key.store' for the location of your keystore and\n#  'key.alias' for the name of the key to use.\n# The password will be asked during the build when you use the 'release' target.\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"HelloAnalytics\" default=\"help\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${sdk.dir}/tools/ant/build.xml\" />\n\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/jni/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := game_shared\n\nLOCAL_MODULE_FILENAME := libgame\n\nLOCAL_SRC_FILES := hellocpp/main.cpp \\\n                   ../../Classes/AppDelegate.cpp \\\n                   ../../../../jsbindings/auto/jsb_pluginx_protocols_auto.cpp \\\n                   ../../../../jsbindings/manual/pluginxUTF8.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_basic_conversions.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_manual_protocols.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_manual_callback.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_extension_registration.cpp \\\n                   ../../../../jsbindings/manual/jsb_pluginx_spidermonkey_specifics.cpp\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \\\n                    $(LOCAL_PATH)/../../../../jsbindings \\\n                    $(LOCAL_PATH)/../../../../jsbindings/auto \\\n                    $(LOCAL_PATH)/../../../../jsbindings/manual \n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos_jsb_static \\\n        jsb_extension_static \\\n        jsb_localstorage_static \\\n        jsb_chipmunk_static \\\n        PluginProtocolStatic\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,scripting/javascript/bindings)\n$(call import-module,scripting/javascript/bindings/extension)\n$(call import-module,scripting/javascript/bindings/localstorage)\n$(call import-module,scripting/javascript/bindings/chipmunk)\n$(call import-module,protocols/android)\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/jni/Application.mk",
    "content": "APP_STL := gnustl_static\nAPP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 -std=c++11 -Wno-literal-suffix -fsigned-char\nAPP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/jni/hellocpp/main.cpp",
    "content": "#include \"AppDelegate.h\"\n#include \"platform/android/jni/JniHelper.h\"\n#include <jni.h>\n#include <android/log.h>\n#include \"PluginJniHelper.h\"\n#include <android_native_app_glue.h>\n#include \"PluginUtils.h\"\n\n#include \"cocos2d.h\"\n\n#define  LOG_TAG    \"main\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nusing namespace cocos2d;\n\nvoid cocos_android_app_init (struct android_app* app) {\n    LOGD(\"cocos_android_app_init\");\n    AppDelegate *pAppDelegate = new AppDelegate();\n    PluginJniHelper::setJavaVM(app->activity->vm);\n    PluginJniHelper::setClassLoaderFrom(app->activity->clazz);\n    cocos2d::plugin::PluginUtils::initPluginWrapper(app);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-13\nandroid.library.reference.1=../../../publish/plugins/nd91/android/DependProject\nandroid.library.reference.2=../../../../cocos/2d/platform/android/java\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/res/values/g_strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<!-- Class name of game entry -->\n    <string name=\"g_class_name\">cn.emagsoftware.sdk.example.BillingDemo</string>\n    \n\t<!-- Billing -->\n\t<string name=\"gc_billing_package_id\"></string>\n\t<string name=\"gc_billing_package_name\"></string>\n\t<string name=\"gc_billing_islow_version\">false</string>\n\t<string name=\"gc_billing_is_no_sound\">false</string>\n\t<string name=\"gc_billing_title\">中国移动手机游戏</string>\n\t<string name=\"gc_billing_title_2\">感谢您支持正版游戏</string>\n\t<string name=\"gc_billing_sending\">正在发送激活短信！</string>\n\t<string name=\"gc_billing_info_sms_1\">尊敬的{0}用户，您即将购买：</string>\n\t<string name=\"gc_billing_info_sms_2\">\\r\\n游戏名称：{0}</string>\n\t<string name=\"gc_billing_info_sms_3\">游戏提供商：{0}</string>\n\t<string name=\"gc_billing_info_sms_4\">客服电话：{0}</string>\n\t<string name=\"gc_billing_info_sms_6\">{0}</string>\n\t<string name=\"gc_billing_info_sms_7\">共需支付话费{0}元（折合{1}点）</string>\n\t<string name=\"gc_billing_info_sms_8\">请点击《确定》发送短信确认购买。</string>\n\t<string name=\"gc_billing_info_sms_9\">请点击《确定》确认购买。</string>\n\t<string name=\"gc_billing_info_sms_a\">* 该道具不属于{0}权益，您可以选择取消购买并免费继续游戏，或确认购买该道具以获得更好的游戏体验。</string>\n\t<string name=\"gc_billing_error_network\">网络连接失败！\\r\\n尊敬的用户，您正在使用中国移动{0}业务中的游戏，需要通过移动网络进行订购关系验证，如果您是中国移动{0}的订购用户，将可免费使用该游戏，如果不是，则需要付费后方可继续使用，请检查您的移动网络是否可用！</string>\n\t<string name=\"gc_billing_ok\">付费成功！</string>\n\t<string name=\"gc_billing_ok_history\">已付费成功！</string>\n\t<string name=\"gc_billing_fail\">您的付费操作失败了，请稍后重试！</string>\n\t<string name=\"gc_billing_require\">不进行付费，您将无法获得更好的游戏体验，是否确认？\\r\\n\\r\\n点击《不购买》不进行付费，点击《返回》回到付费界面</string>\n\t<string name=\"gc_billing_no_simcard\">短信激活失败，请检查SIM卡！</string>\n\t<string name=\"gc_billing_simcard_unavailable\">没有可用中国移动SIM卡！</string>\n\t<string name=\"gc_billing_check_network\">找不到可用网络，请检查您当前的网络设置！</string>\n\t<string name=\"gc_billing_network_airplane\">当前设备处于飞行模式，无可用网络！</string>\n\t<string name=\"gc_billing_network_multi\">当前设备存在重复网络，无可用网络！</string>\n\t<string name=\"gc_billing_cmgc_game_tag\">此游戏没有配置中国移动标识信息，不能继续使用！</string>\n\t<string name=\"gc_billing_dialog_charging\">正在处理付费请求...</string>\n\t<string name=\"gc_billing_invalid_china_mobile_card\">请输入有效的手机号码！</string>\n\t<string name=\"gc_billing_fail_phone\">您的计费请求失败啦，请尝试输入手机号码进行计费！</string>\n\t<string name=\"gc_billing_fail_vericode\">短信验证码获取失败</string>\n\t<string name=\"gc_billing_no_charge\">未找到计费信息！</string>\n\t<string name=\"gc_billing_no_vericode\">请输入您收到的短信验证码！</string>\n\t<string name=\"gc_billing_no_phone_number\">未找到手机号码，请重试！</string>\n\t<string name=\"gc_billing_info_title\">感谢您支持正版游戏</string>\n\t<string name=\"gc_billing_info_title_2\">游戏付费确认</string>\n\t<string name=\"gc_billing_net_info\">您需要输入手机号码，以获取短信验证码，在进入确认界面输入正确验证码之前，不会产生费用。</string>\n\t<string name=\"gc_billing_net_verifycode\">短信验证码：</string>\n\t<string name=\"gc_billing_net_verifycode_1\">请在确认游戏付费前，正确输入您手机上收到的随机短信验证码。</string>\n\t<string name=\"gc_billing_net_verifycode_2\">短信验证码在5分钟内有效，超过时间内仍未收到验证码，建议您稍后重试。</string>\n\t<string name=\"gc_billing_net_phone\">手机号码：（请输入正确的{0}）</string>\n\t<string name=\"gc_billing_net_phone_2\">移动手机号码</string>\n\t<string name=\"gc_billing_more_time_error\">您的付费请求太频繁，请稍后重试！</string>\n\t<string name=\"gc_billing_net_contacts\">好友代付</string>\n\t<string name=\"gc_billing_net_contacts_error\">没有找到联系人，您可以手动输入付费手机号码</string>\n\n\t<!-- Dialog -->\n\t<string name=\"gc_billing_dialog_sure_space\">　确定　</string>\n\t<string name=\"gc_billing_dialog_clear_space\">　取消　</string>\n\t<string name=\"gc_billing_dialog_continue\">　继续　</string>\n\t<string name=\"gc_billing_dialog_exit\">　退出　</string>\n\t<string name=\"gc_billing_dialog_information\">提示</string>\n\t<string name=\"gc_billing_dialog_sure\">确定</string>\n\t<string name=\"gc_billing_dialog_clear\">取消</string>\n\t<string name=\"gc_billing_dialog_reject\">不购买</string>\n\t<string name=\"gc_billing_dialog_positive\">继续</string>\n\t<string name=\"gc_billing_dialog_neutral\">结束</string>\n\t<string name=\"gc_billing_dialog_cancel\">返回</string>\n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">HelloIAP-JS</string>\n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloIAP-JS/proj.android/src/nojava.txt",
    "content": "No Java files\nsrc/ is required for Android's build.xml to operate correctly.\ngit does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/AppDelegate.cpp",
    "content": "#include \"AppDelegate.h\"\n\n#include <vector>\n#include <string>\n\n#include \"HelloWorldScene.h\"\n#include \"AppMacros.h\"\n\nUSING_NS_CC;\nusing namespace std;\n\nAppDelegate::AppDelegate() {\n\n}\n\nAppDelegate::~AppDelegate() \n{\n}\n\nbool AppDelegate::applicationDidFinishLaunching() {\n    // initialize director\n    auto director = Director::getInstance();\n    auto glView = EGLView::getInstance();\n\n    director->setOpenGLView(glView);\n    \n    auto size = director->getWinSize();\n\n    // Set the design resolution\n    glView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);\n\n\tSize frameSize = glView->getFrameSize();\n    \n    vector<string> searchPath;\n\n    // In this demo, we select resource according to the frame's height.\n    // If the resource size is different from design resolution size, you need to set contentScaleFactor.\n    // We use the ratio of resource's height to the height of design resolution,\n    // this can make sure that the resource's height could fit for the height of design resolution.\n\n    // if the frame's height is larger than the height of medium resource size, select large resource.\n\tif (frameSize.height > mediumResource.size.height)\n\t{\n        searchPath.push_back(largeResource.directory);\n\n        director->setContentScaleFactor(MIN(largeResource.size.height/designResolutionSize.height, largeResource.size.width/designResolutionSize.width));\n\t}\n    // if the frame's height is larger than the height of small resource size, select medium resource.\n    else if (frameSize.height > smallResource.size.height)\n    {\n        searchPath.push_back(mediumResource.directory);\n        \n        director->setContentScaleFactor(MIN(mediumResource.size.height/designResolutionSize.height, mediumResource.size.width/designResolutionSize.width));\n    }\n    // if the frame's height is smaller than the height of medium resource size, select small resource.\n\telse\n    {\n        searchPath.push_back(smallResource.directory);\n\n        director->setContentScaleFactor(MIN(smallResource.size.height/designResolutionSize.height, smallResource.size.width/designResolutionSize.width));\n    }\n    \n    // set searching path\n    FileUtils::getInstance()->setSearchPaths(searchPath);\n\t\n    // turn on display FPS\n    director->setDisplayStats(true);\n\n    // set FPS. the default value is 1.0/60 if you don't call this\n    director->setAnimationInterval(1.0 / 60);\n\n    // create a scene. it's an autorelease object\n    auto scene = HelloWorld::scene();\n\n    // run\n    director->runWithScene(scene);\n\n    return true;\n}\n\n// This function will be called when the app is inactive. When comes a phone call,it's be invoked too\nvoid AppDelegate::applicationDidEnterBackground() {\n    Director::getInstance()->stopAnimation();\n\n    // if you use SimpleAudioEngine, it must be pause\n    // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();\n}\n\n// this function will be called when the app is active again\nvoid AppDelegate::applicationWillEnterForeground() {\n    Director::getInstance()->startAnimation();\n\n    // if you use SimpleAudioEngine, it must resume here\n    // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/AppDelegate.h",
    "content": "#ifndef  _APP_DELEGATE_H_\n#define  _APP_DELEGATE_H_\n\n#include \"cocos2d.h\"\n\n/**\n@brief    The cocos2d Application.\n\nThe reason for implement as private inheritance is to hide some interface call by Director.\n*/\nclass  AppDelegate : private cocos2d::Application\n{\npublic:\n    AppDelegate();\n    virtual ~AppDelegate();\n\n    /**\n    @brief    Implement Director and Scene init code here.\n    @return true    Initialize success, app continue.\n    @return false   Initialize failed, app terminate.\n    */\n    virtual bool applicationDidFinishLaunching();\n\n    /**\n    @brief  The function be called when the application enter background\n    @param  the pointer of the application\n    */\n    virtual void applicationDidEnterBackground();\n\n    /**\n    @brief  The function be called when the application enter foreground\n    @param  the pointer of the application\n    */\n    virtual void applicationWillEnterForeground();\n};\n\n#endif // _APP_DELEGATE_H_\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/AppMacros.h",
    "content": "#ifndef __APPMACROS_H__\n#define __APPMACROS_H__\n\n#include \"cocos2d.h\"\n\n/* For demonstrating using one design resolution to match different resources,\n   or one resource to match different design resolutions.\n\n   [Situation 1] Using one design resolution to match different resources.\n     Please look into Appdelegate::applicationDidFinishLaunching.\n     We check current device frame size to decide which resource need to be selected.\n     So if you want to test this situation which said in title '[Situation 1]',\n     you should change ios simulator to different device(e.g. iphone, iphone-retina3.5, iphone-retina4.0, ipad, ipad-retina),\n     or change the window size in \"proj.XXX/main.cpp\" by \"CCEGLView::setFrameSize\" if you are using win32 or linux plaform\n     and modify \"proj.mac/AppController.mm\" by changing the window rectangle.\n\n   [Situation 2] Using one resource to match different design resolutions.\n     The coordinates in your codes is based on your current design resolution rather than resource size.\n     Therefore, your design resolution could be very large and your resource size could be small.\n     To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536'\n     and open iphone simulator or create a window of 480x320 size.\n\n   [Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources.\n */\n\n#define DESIGN_RESOLUTION_480X320    0\n#define DESIGN_RESOLUTION_1024X768   1\n#define DESIGN_RESOLUTION_2048X1536  2\n\n/* If you want to switch design resolution, change next line */\n#define TARGET_DESIGN_RESOLUTION_SIZE  DESIGN_RESOLUTION_1024X768\n\ntypedef struct tagResource\n{\n    cocos2d::Size size;\n    char directory[100];\n}Resource;\n\nstatic Resource smallResource  =  { cocos2d::Size(480, 320),   \"iphone\" };\nstatic Resource mediumResource =  { cocos2d::Size(1024, 768),  \"ipad\"   };\nstatic Resource largeResource  =  { cocos2d::Size(2048, 1536), \"ipadhd\" };\n\n#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320)\nstatic cocos2d::Size designResolutionSize = cocos2d::Size(480, 320);\n#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768)\nstatic cocos2d::Size designResolutionSize = cocos2d::Size(1024, 768);\n#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536)\nstatic cocos2d::Size designResolutionSize = cocos2d::Size(2048, 1536);\n#else\n#error unknown target design resolution!\n#endif\n\n// The font size 24 is designed for small resolution, so we should change it to fit for current design resolution\n#define TITLE_FONT_SIZE  (cocos2d::EGLView::getInstance()->getDesignResolutionSize().width / smallResource.size.width * 24)\n\n#endif /* __APPMACROS_H__ */\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/Configs.h",
    "content": "#ifndef __CONFIGS_H__\n#define __CONFIGS_H__\n\n/** @warning\n * The file UCGameSDK.jar conflicts with weiboSDK.jar\n * if you want test the login/logout of UC,\n * modify the android project config: remove the weiboSDK.jar, and add UCGameSDK.jar\n*/\n#define TEST_UC             0\n\n#define APP_NAME                \"HelloPlugins\"\n\n/**\n @brief Developer information of flurry\n */\n#define FLURRY_KEY_IOS          \"KMGG7CD9WPK2TW4X9VR8\"\n#define FLURRY_KEY_ANDROID      \"SPKFH8KMPGHMMBWRBT5W\"\n\n/**\n @brief Developer information of Umeng\n */\n#define UMENG_KEY_IOS           \"50d2b18c5270152187000097\"\n#define UMENG_KEY_ANDROID       \"\"          // umeng key for android is setted in AndroidManifest.xml\n\n/**\n @brief Developer information of Admob\n */\n#define ADMOB_ID_IOS            \"a1517500cc8f794\"\n#define ADMOB_ID_ANDROID        \"a1516fb6b16b12f\"\n\n/**\n @brief Developer information of Nd91\n */\n#define ND91_APPID              \"100010\"\n#define ND91_APPKEY             \"C28454605B9312157C2F76F27A9BCA2349434E546A6E9C75\";\n#define ND91_ORIENTATION        \"landscape\"\n\n/**\n @brief Developer information of QH360\n */\n#define QH360_EXCHANGE_RATE     \"1\"\n\n/**\n @brief Developer information of UC\n */\n#define UC_CPID                 \"20087\"\n#define UC_GAME_ID              \"119474\"\n#define UC_SERVER_ID            \"1333\"\n\n#endif // __CONFIGS_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/HelloWorldScene.cpp",
    "content": "#include \"HelloWorldScene.h\"\n#include \"TestAdsScene.h\"\n#include \"TestAnalyticsScene.h\"\n#include \"TestShareScene.h\"\n#include \"TestIAPScene.h\"\n#include \"TestIAPOnlineScene.h\"\n#include \"TestUserScene.h\"\n#include \"TestSocialScene.h\"\n\nUSING_NS_CC;\n\nstd::string g_testCases[] = {\n    \"Test Ads\",\n    \"Test Analytics\",\n    \"Test Share\",\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n    \"Test IAP\",\n    \"Test IAP Online\",\n    \"Test User\",\n    \"Test Social\",\n#endif\n};\n\nScene* HelloWorld::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    HelloWorld *layer = HelloWorld::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool HelloWorld::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n    \n    Size visibleSize = Director::getInstance()->getVisibleSize();\n    Point origin = Director::getInstance()->getVisibleOrigin();\n\n    /////////////////////////////\n    // 2. add a menu item with \"X\" image, which is clicked to quit the program\n    //    you may modify it.\n\n    // add a \"close\" icon to exit the progress. it's an autorelease object\n    MenuItemImage *pCloseItem = MenuItemImage::create(\n                                        \"CloseNormal.png\",\n                                        \"CloseSelected.png\",\n                                        CC_CALLBACK_1(HelloWorld::menuCloseCallback, this));\n    \n\tpCloseItem->setPosition(Point(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,\n                                origin.y + pCloseItem->getContentSize().height/2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pCloseItem, NULL);\n    pMenu->setPosition(Point::ZERO);\n    this->addChild(pMenu, 1);\n\n    Point beginPos = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height - 50);\n    float step = 60.0f;\n    int nCaseCount = sizeof(g_testCases) / sizeof(std::string);\n    for (int i = 0; i < nCaseCount; ++i) {\n        std::string caseName = g_testCases[i];\n        MenuItemFont *pItem = MenuItemFont::create(caseName.c_str(), CC_CALLBACK_1(HelloWorld::menuCallback, this));\n        pItem->setTag(i);\n        pItem->setPosition(Point(beginPos.x, beginPos.y - i * step));\n        pMenu->addChild(pItem);\n    }\n    return true;\n}\n\nvoid HelloWorld::menuCallback(Object* pSender)\n{\n    MenuItemFont *pItem = (MenuItemFont*) pSender;\n    Scene* newScene = NULL;\n    switch (pItem->getTag()) {\n    case 0:\n        newScene = TestAds::scene();\n        break;\n    case 1:\n        newScene = TestAnalytics::scene();\n        break;\n    case 2:\n        newScene = TestShare::scene();\n        break;\n    case 3:\n        newScene = TestIAP::scene();\n        break;\n    case 4:\n        newScene = TestIAPOnline::scene();\n        break;\n    case 5:\n        newScene = TestUser::scene();\n        break;\n    case 6:\n        newScene = TestSocial::scene();\n    default:\n        break;\n    }\n\n    if (newScene) {\n        Director::getInstance()->replaceScene(newScene);\n    }\n}\n\nvoid HelloWorld::menuCloseCallback(Object* pSender)\n{\n    Director::getInstance()->end();\n\n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    exit(0);\n#endif\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/HelloWorldScene.h",
    "content": "#ifndef __HELLOWORLD_SCENE_H__\n#define __HELLOWORLD_SCENE_H__\n\n#include \"cocos2d.h\"\n\nclass HelloWorld : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();  \n\n    // there's no 'id' in cpp, so we recommend returning the class instance pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuCloseCallback(Object* pSender);\n    void menuCallback(Object* pSender);\n    \n    // implement the \"static node()\" method manually\n    CREATE_FUNC(HelloWorld);\n};\n\n#endif // __HELLOWORLD_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TestAdsScene.h\"\n#include \"PluginManager.h\"\n#include \"HelloWorldScene.h\"\n#include \"Configs.h\"\n\nUSING_NS_CC;\nusing namespace cocos2d::plugin;\n\nconst std::string s_aTestCases[] = {\n\t\"Admob\",\n    \"Flurry\",\n};\n\nconst std::string s_aTestPoses[] = {\n\t\"Pos: Center\",\n\t\"Pos: Top\",\n\t\"Pos: TopLeft\",\n\t\"Pos: TopRight\",\n\t\"Pos: Bottom\",\n\t\"Pos: BottomLeft\",\n\t\"Pos: BottomRight\",\n};\n\nScene* TestAds::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    TestAds *layer = TestAds::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool TestAds::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n\n    _listener = new MyAdsListener();\n    _admob = dynamic_cast<ProtocolAds*>(PluginManager::getInstance()->loadPlugin(\"AdsAdmob\"));\n    _flurryAds = dynamic_cast<ProtocolAds*>(PluginManager::getInstance()->loadPlugin(\"AdsFlurry\"));\n    TAdsDeveloperInfo devInfo;\n    \n#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS\n    devInfo[\"AdmobID\"] = ADMOB_ID_IOS;\n    devInfo[\"FlurryAppKey\"] = FLURRY_KEY_IOS;\n#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID\n    devInfo[\"AdmobID\"] = ADMOB_ID_ANDROID;\n    devInfo[\"FlurryAppKey\"] = FLURRY_KEY_ANDROID;\n#endif\n    \n    _admob->configDeveloperInfo(devInfo);\n    _admob->setAdsListener(_listener);\n    _admob->setDebugMode(true);\n\n    _flurryAds->configDeveloperInfo(devInfo);\n    _flurryAds->setAdsListener(_listener);\n    _flurryAds->setDebugMode(true);\n\n    Size visibleSize = Director::getInstance()->getVisibleSize();\n    Point origin = Director::getInstance()->getVisibleOrigin();\n    Point posMid = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2);\n    Point posBR = Point(origin.x + visibleSize.width, origin.y);\n\n    /////////////////////////////\n    // 2. add a menu item with \"X\" image, which is clicked to quit the program\n    //    you may modify it.\n\n    // add a \"close\" icon to exit the progress. it's an autorelease object\n    MenuItemFont *pBackItem = MenuItemFont::create(\"Back\", CC_CALLBACK_1(TestAds::menuBackCallback, this));\n    Size backSize = pBackItem->getContentSize();\n    pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pBackItem, NULL);\n    pMenu->setPosition( Point::ZERO );\n\n\tLabelTTF* label1 = LabelTTF::create(\"ShowAds\", \"Arial\", 24);\n\tMenuItemLabel* pItemShow = MenuItemLabel::create(label1, CC_CALLBACK_1(TestAds::testShow, this));\n\tpItemShow->setAnchorPoint(Point(0.5f, 0));\n\tpMenu->addChild(pItemShow, 0);\n\tpItemShow->setPosition(posMid + Point(-100, -120));\n\n\tLabelTTF* label2 = LabelTTF::create(\"HideAds\", \"Arial\", 24);\n\tMenuItemLabel* pItemHide = MenuItemLabel::create(label2, CC_CALLBACK_1(TestAds::testHide, this));\n\tpItemHide->setAnchorPoint(Point(0.5f, 0));\n\tpMenu->addChild(pItemHide, 0);\n\tpItemHide->setPosition(posMid + Point(100, -120));\n\n\t// create optional menu\n\t// cases item\n\t_caseItem = MenuItemToggle::createWithCallback(CC_CALLBACK_1(TestAds::caseChanged, this),\n\t\t\t\t\t\t\t\t\t\t\t\tMenuItemFont::create( s_aTestCases[0].c_str() ),\n\t\t\t\t\t\t\t\t\t\t\t\tNULL );\n\tint caseLen = sizeof(s_aTestCases) / sizeof(std::string);\n\tfor (int i = 1; i < caseLen; ++i)\n\t{\n\t\t_caseItem->getSubItems().pushBack(MenuItemFont::create( s_aTestCases[i].c_str() ) );\n\t}\n\t_caseItem->setPosition(posMid + Point(-200, 120));\n\tpMenu->addChild(_caseItem);\n\n\t// poses item\n\t_posItem = MenuItemToggle::createWithCallback(CC_CALLBACK_1(TestAds::posChanged, this),\n\t\t\t\t\t\t\t\t\t\t\t\tMenuItemFont::create( s_aTestPoses[0].c_str() ),\n\t\t\t\t\t\t\t\t\t\t\t\tNULL );\n\tint posLen = sizeof(s_aTestPoses) / sizeof(std::string);\n\tfor (int i = 1; i < posLen; ++i)\n\t{\n\t\t_posItem->getSubItems().pushBack( MenuItemFont::create( s_aTestPoses[i].c_str() ) );\n\t}\n\t_posItem->setPosition(posMid + Point(200, 120));\n\tpMenu->addChild(_posItem);\n\n\t// init options\n\t_ads = _admob;\n\t_pos = ProtocolAds::kPosCenter;\n\n    // init the AdsInfo\n    adInfo[\"AdmobType\"] = \"1\";\n    adInfo[\"AdmobSizeEnum\"] = \"1\";\n    adInfo[\"FlurryAdsID\"] = \"BANNER_MAIN_VC\";\n    adInfo[\"FlurryAdsSize\"] = \"2\";\n\n    this->addChild(pMenu, 1);\n\n    return true;\n}\n\nvoid TestAds::testShow(Object* pSender)\n{\n    if (_ads)\n\t{\n        _ads->showAds(adInfo, _pos);\n\t}\n}\n\nvoid TestAds::testHide(Object* pSender)\n{\n\t_ads->hideAds(adInfo);\n}\n\nvoid TestAds::menuBackCallback(Object* pSender)\n{\n    if (_admob != NULL)\n    {\n        _admob->hideAds(adInfo);\n    \tPluginManager::getInstance()->unloadPlugin(\"AdsAdmob\");\n    \t_admob = NULL;\n    }\n\n    if (NULL != _listener)\n    {\n    \tdelete _listener;\n    \t_listener = NULL;\n    }\n\n    Scene* newScene = HelloWorld::scene();\n    Director::getInstance()->replaceScene(newScene);\n}\n\nvoid TestAds::caseChanged(Object* pSender)\n{\n\tstd::string strLog = \"\";\n\tswitch (_caseItem->getSelectedIndex())\n\t{\n\tcase 0:\n\t\t_ads = _admob;\n\t\tstrLog = \"Admob\";\n\t\tbreak;\n    case 1:\n        _ads = _flurryAds;\n        strLog = \"Flurry Ads\";\n        break;\n\tdefault:\n\t\tbreak;\n\t}\n\tlog(\"case selected change to : %s\", strLog.c_str());\n}\n\nvoid TestAds::posChanged(Object* pSender)\n{\n\tint selectIndex = _posItem->getSelectedIndex();\n\t_pos = (ProtocolAds::AdsPos) selectIndex;\n\tlog(\"pos selected change to : %d\", _pos);\n}\n\nvoid MyAdsListener::onAdsResult(AdsResultCode code, const char* msg)\n{\n\tlog(\"OnAdsResult, code : %d, msg : %s\", code, msg);\n}\n\nvoid MyAdsListener::onPlayerGetPoints(cocos2d::plugin::ProtocolAds* pAdsPlugin, int points)\n{\n\tlog(\"Player get points : %d\", points);\n\n\t// @warning should add code to give game-money to player here\n\n\t// spend the points of player\n\tif (pAdsPlugin != NULL) {\n\t\tpAdsPlugin->spendPoints(points);\n\t}\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TEST_ADS_SCENE_H__\n#define __TEST_ADS_SCENE_H__\n\n#include \"cocos2d.h\"\n#include \"ProtocolAds.h\"\n\nclass MyAdsListener : public cocos2d::plugin::AdsListener\n{\npublic:\n\tvirtual void onAdsResult(cocos2d::plugin::AdsResultCode code, const char* msg);\n\tvirtual void onPlayerGetPoints(cocos2d::plugin::ProtocolAds* pAdsPlugin, int points);\n};\n\nclass TestAds : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();  \n\n    // there's no 'id' in cpp, so we recommend returning the class instance pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuBackCallback(Object* pSender);\n    void testShow(Object* pSender);\n\tvoid testHide(Object* pSender);\n\n\t// option changed callback\n\tvoid caseChanged(Object* pSender);\n\tvoid posChanged(Object* pSender);\n\tvoid typeChanged(Object* pSender);\n\n    // implement the \"static node()\" method manually\n    CREATE_FUNC(TestAds);\n\nprivate:\n    cocos2d::plugin::ProtocolAds* _admob;\n    cocos2d::plugin::ProtocolAds* _flurryAds;\n    MyAdsListener* _listener;\n\n    cocos2d::MenuItemToggle* _caseItem;\n    cocos2d::MenuItemToggle* _posItem;\n\n    cocos2d::plugin::ProtocolAds* _ads;\n    cocos2d::plugin::ProtocolAds::AdsPos _pos;\n    \n    cocos2d::plugin::TAdsInfo adInfo;\n};\n\n#endif // __TEST_ADS_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TestAnalyticsScene.h\"\n#include \"PluginManager.h\"\n#include \"HelloWorldScene.h\"\n#include \"Configs.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::plugin;\n\nenum {\n    TAG_LOG_EVENT_ID = 0,\n    TAG_LOG_EVENT_ID_KV,\n    TAG_LOG_ONLINE_CONFIG,\n    TAG_LOG_EVENT_ID_DURATION,\n    TAG_LOG_EVENT_BEGIN,\n    TAG_LOG_EVENT_END,\n    TAG_MAKE_ME_CRASH\n};\n\ntypedef struct tagEventMenuItem {\n    std::string id;\n    int tag;\n}EventMenuItem;\n\nstatic EventMenuItem s_EventMenuItem[] = {\n    {\"OnlineConfig\",        TAG_LOG_ONLINE_CONFIG},\n    {\"LogEvent-eventId\"   , TAG_LOG_EVENT_ID},\n    {\"LogEvent-eventId-kv\", TAG_LOG_EVENT_ID_KV},\n    {\"LogEvent-eventId-Duration\", TAG_LOG_EVENT_ID_DURATION},\n    {\"LogEvent-Begin\", TAG_LOG_EVENT_BEGIN},\n    {\"LogEvent-End\", TAG_LOG_EVENT_END},\n    {\"MakeMeCrash\", TAG_MAKE_ME_CRASH}\n};\n\nScene* TestAnalytics::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    TestAnalytics *layer = TestAnalytics::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool TestAnalytics::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n\n    _pluginAnalytics = NULL;\n    loadPlugins();\n\n    Size visibleSize = Director::getInstance()->getVisibleSize();\n    Point origin = Director::getInstance()->getVisibleOrigin();\n    Point posBR = Point(origin.x + visibleSize.width, origin.y);\n\n    /////////////////////////////\n    // 2. add a menu item with \"X\" image, which is clicked to quit the program\n    //    you may modify it.\n\n    // add a \"close\" icon to exit the progress. it's an autorelease object\n    MenuItemFont *pBackItem = MenuItemFont::create(\"Back\", CC_CALLBACK_1(TestAnalytics::menuBackCallback, this));\n    Size backSize = pBackItem->getContentSize();\n    pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pBackItem, NULL);\n    pMenu->setPosition( Point::ZERO );\n    this->addChild(pMenu, 1);\n\n    float yPos = 0;\n    for (int i = 0; i < sizeof(s_EventMenuItem)/sizeof(s_EventMenuItem[0]); i++) {\n        LabelTTF* label = LabelTTF::create(s_EventMenuItem[i].id.c_str(), \"Arial\", 24);\n        MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(TestAnalytics::eventMenuCallback, this));\n        pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag);\n        yPos = visibleSize.height - 35*i - 100;\n        pMenuItem->setPosition( Point(visibleSize.width / 2, yPos));\n    }\n\n    std::string strName = _pluginAnalytics->getPluginName();\n    std::string strVer = _pluginAnalytics->getSDKVersion();\n    char ret[256] = { 0 };\n    sprintf(ret, \"Plugin : %s, Ver : %s\", strName.c_str(), strVer.c_str());\n    LabelTTF* pLabel = LabelTTF::create(ret, \"Arial\", 18, Size(visibleSize.width, 0), TextHAlignment::CENTER);\n    pLabel->setPosition(Point(visibleSize.width / 2, yPos - 80));\n    addChild(pLabel);\n\n    return true;\n}\n\nvoid TestAnalytics::onExit()\n{\n    unloadPlugins();\n}\n\nvoid TestAnalytics::eventMenuCallback(Object* pSender)\n{\n    MenuItemLabel* pMenuItem = (MenuItemLabel*)pSender;\n\n    switch (pMenuItem->getTag())\n    {\n    case TAG_LOG_EVENT_ID:\n        {\n            _pluginAnalytics->logEvent(\"click\");\n            _pluginAnalytics->logEvent(\"music\");\n        }\n        break;\n    case TAG_LOG_EVENT_ID_KV:\n        {\n            LogEventParamMap paramMap;\n            paramMap.insert(LogEventParamPair(\"type\", \"popular\"));\n            paramMap.insert(LogEventParamPair(\"artist\", \"JJLin\"));\n            _pluginAnalytics->logEvent(\"music\", &paramMap);\n        }\n        break;\n    case TAG_LOG_ONLINE_CONFIG:\n        {\n            PluginParam param(\"abc\");\n            log(\"Online config = %s\", _pluginAnalytics->callStringFuncWithParam(\"getConfigParams\", &param, NULL).c_str());\n        }\n        break;\n    case TAG_LOG_EVENT_ID_DURATION:\n        {\n            PluginParam event1(\"book\");\n            PluginParam dura1(12000);\n            _pluginAnalytics->callFuncWithParam(\"logEventWithDuration\", &event1, &dura1, NULL);\n\n            PluginParam event2(\"book\");\n            PluginParam dura2(12000);\n            PluginParam label(\"chapter1\");\n            _pluginAnalytics->callFuncWithParam(\"logEventWithDurationLabel\", &event2, &dura2, &label, NULL);\n\n            PluginParam event3(\"music\");\n            PluginParam dura3(2330000);\n            LogEventParamMap paramMap;\n            paramMap.insert(LogEventParamPair(\"type\", \"popular\"));\n            paramMap.insert(LogEventParamPair(\"artist\", \"JJLin\"));\n            PluginParam mapValue(paramMap);\n            _pluginAnalytics->callFuncWithParam(\"logEventWithDurationParams\", &event3, &dura3, &mapValue, NULL);\n        }\n        break;\n    case TAG_LOG_EVENT_BEGIN:\n        {\n            _pluginAnalytics->logTimedEventBegin(\"music\");\n\n            PluginParam event1(\"music\");\n            PluginParam label1(\"one\");\n            _pluginAnalytics->callFuncWithParam(\"logTimedEventWithLabelBegin\", &event1, &label1, NULL);\n\n            PluginParam event2(\"music\");\n            PluginParam label2(\"flag0\");\n            LogEventParamMap paramMap;\n            paramMap.insert(LogEventParamPair(\"type\", \"popular\"));\n            paramMap.insert(LogEventParamPair(\"artist\", \"JJLin\"));\n            PluginParam mapValue(paramMap);\n            _pluginAnalytics->callFuncWithParam(\"logTimedKVEventBegin\", &event2, &label2, &mapValue, NULL);\n\n            PluginParam event3(\"music-kv\");\n            _pluginAnalytics->callFuncWithParam(\"logTimedEventBeginWithParams\", &event3, &mapValue, NULL);\n        }\n        break;\n    case TAG_LOG_EVENT_END:\n        {\n            _pluginAnalytics->logTimedEventEnd(\"music\");\n\n            PluginParam event1(\"music\");\n            PluginParam label1(\"one\");\n            _pluginAnalytics->callFuncWithParam(\"logTimedEventWithLabelEnd\", &event1, &label1, NULL);\n\n            PluginParam event2(\"music\");\n            PluginParam label2(\"flag0\");\n            _pluginAnalytics->callFuncWithParam(\"logTimedKVEventEnd\", &event2, &label2, NULL);\n\n            PluginParam event3(\"music-kv\");\n            _pluginAnalytics->callFuncWithParam(\"logTimedEventEnd\", &event3, NULL);\n        }\n        break;\n    case TAG_MAKE_ME_CRASH:\n        {\n            char* pNull = NULL;\n            *pNull = 0;\n        }\n        break;\n    default:\n        break;\n    }\n}\n\nvoid TestAnalytics::loadPlugins()\n{\n    LanguageType langType = Application::getInstance()->getCurrentLanguage();\n    \n    std::string umengKey  = \"\";\n    std::string flurryKey = \"\";\n    std::string pluginName = \"\";\n    std::string strAppKey = \"\";\n    \n#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)\n    umengKey  = UMENG_KEY_IOS;\n    flurryKey = FLURRY_KEY_IOS;\n#elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)\n    umengKey  = UMENG_KEY_ANDROID;\n    flurryKey = FLURRY_KEY_ANDROID;\n#endif\n    \n    if (LanguageType::CHINESE == langType)\n    {\n        pluginName = \"AnalyticsUmeng\";\n        strAppKey = umengKey;\n    }\n    else\n    {\n        pluginName = \"AnalyticsFlurry\";\n        strAppKey = flurryKey;\n    }\n    \n    _pluginAnalytics = dynamic_cast<ProtocolAnalytics*> (PluginManager::getInstance()->loadPlugin(pluginName.c_str()));\n\n    _pluginAnalytics->setDebugMode(true);\n    _pluginAnalytics->startSession(strAppKey.c_str());\n    _pluginAnalytics->setCaptureUncaughtException(true);\n    _pluginAnalytics->setSessionContinueMillis(10000);\n    \n    const char* sdkVer = _pluginAnalytics->getSDKVersion().c_str();\n    log(\"SDK version : %s\", sdkVer);\n    \n    _pluginAnalytics->callFuncWithParam(\"updateOnlineConfig\", NULL);\n    \n    PluginParam pParam1(true);\n    _pluginAnalytics->callFuncWithParam(\"setReportLocation\", &pParam1, NULL);\n    \n\t_pluginAnalytics->callFuncWithParam(\"logPageView\", NULL);\n    \n\tPluginParam pParam2(\"1.1\");\n\t_pluginAnalytics->callFuncWithParam(\"setVersionName\", &pParam2, NULL);\n    \n\tPluginParam pParam3(20);\n\t_pluginAnalytics->callFuncWithParam(\"setAge\", &pParam3, NULL);\n    \n\tPluginParam pParam4(1);\n\t_pluginAnalytics->callFuncWithParam(\"setGender\", &pParam4, NULL);\n    \n\tPluginParam pParam5(\"123456\");\n\t_pluginAnalytics->callFuncWithParam(\"setUserId\", &pParam5, NULL);\n    \n\tPluginParam pParam6(false);\n\t_pluginAnalytics->callFuncWithParam(\"setUseHttps\", &pParam6, NULL);\n\n}\n\nvoid TestAnalytics::unloadPlugins()\n{\n    if (NULL != _pluginAnalytics) {\n        _pluginAnalytics->stopSession();\n\n        std::string pluginName = _pluginAnalytics->getPluginName();\n        PluginManager::getInstance()->unloadPlugin(pluginName.c_str());\n        _pluginAnalytics = NULL;\n    }\n}\n\nvoid TestAnalytics::menuBackCallback(Object* pSender)\n{\n    Scene* newScene = HelloWorld::scene();\n    Director::getInstance()->replaceScene(newScene);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TEST_ANALYTICS_SCENE_H__\n#define __TEST_ANALYTICS_SCENE_H__\n\n#include \"cocos2d.h\"\n#include \"ProtocolAnalytics.h\"\n\nclass TestAnalytics : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();\n    virtual void onExit();\n\n    // there's no 'id' in cpp, so we recommand to return the exactly class pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuBackCallback(Object* pSender);\n    void eventMenuCallback(Object* pSender);\n\n    void loadPlugins();\n    void unloadPlugins();\n\n    // implement the \"static node()\" method manually\n    CREATE_FUNC(TestAnalytics);\n\nprivate:\n    cocos2d::plugin::ProtocolAnalytics* _pluginAnalytics;\n};\n\n#endif // __TEST_ANALYTICS_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"MyPurchase.h\"\n#include \"PluginManager.h\"\n#include \"cocos2d.h\"\n#include \"Configs.h\"\n\nusing namespace cocos2d::plugin;\nusing namespace cocos2d;\n\nMyPurchase* MyPurchase::s_pPurchase = NULL;\n\nMyPurchase::MyPurchase()\n: s_pAlipay(NULL)\n, s_pRetListener(NULL)\n, s_pNd91(NULL)\n{\n\n}\n\nMyPurchase::~MyPurchase()\n{\n\tunloadIAPPlugin();\n\tif (s_pRetListener)\n\t{\n\t\tdelete s_pRetListener;\n\t\ts_pRetListener = NULL;\n\t}\n}\n\nMyPurchase* MyPurchase::getInstance()\n{\n\tif (s_pPurchase == NULL) {\n\t\ts_pPurchase = new MyPurchase();\n\t}\n\treturn s_pPurchase;\n}\n\nvoid MyPurchase::purgePurchase()\n{\n\tif (s_pPurchase)\n\t{\n\t\tdelete s_pPurchase;\n\t\ts_pPurchase = NULL;\n\t}\n\tPluginManager::end();\n}\n\nvoid MyPurchase::loadIAPPlugin()\n{\n\tif (s_pRetListener == NULL)\n\t{\n\t\ts_pRetListener = new MyPurchaseResult();\n\t}\n\n\t{\n\t\t// init alipay plugin\n\t\ts_pAlipay = dynamic_cast<ProtocolIAP*>(PluginManager::getInstance()->loadPlugin(\"IAPAlipay\"));\n\t\tTIAPDeveloperInfo pAlipayInfo;\n\t\tif (pAlipayInfo.empty())\n\t\t{\n\t\t\tchar msg[256] = { 0 };\n\t\t\tsprintf(msg, \"Developer info is empty. PLZ fill your alipay info in %s(nearby line %d)\", __FILE__, __LINE__);\n\t\t\tMessageBox(msg, \"Alipay Warning\");\n\t\t}\n\t\ts_pAlipay->setDebugMode(true);\n\t\ts_pAlipay->configDeveloperInfo(pAlipayInfo);\n\t\ts_pAlipay->setResultListener(s_pRetListener);\n\t}\n\n\t{\n\t\tTIAPDeveloperInfo pNdInfo;\n\t\tpNdInfo[\"Nd91AppId\"] = ND91_APPID;\n\t\tpNdInfo[\"Nd91AppKey\"] = ND91_APPKEY;\n\t\tpNdInfo[\"Nd91Orientation\"] = ND91_ORIENTATION;\n\t\tif (pNdInfo.empty()) {\n\t\t\tchar msg[256] = { 0 };\n\t\t\tsprintf(msg, \"Developer info is empty. PLZ fill your Nd91 info in %s(nearby line %d)\", __FILE__, __LINE__);\n\t\t\tMessageBox(msg, \"Nd91 Warning\");\n\t\t}\n\t\ts_pNd91 = dynamic_cast<ProtocolIAP*>(PluginManager::getInstance()->loadPlugin(\"IAPNd91\"));\n\t\ts_pNd91->setDebugMode(true);\n\t\ts_pNd91->configDeveloperInfo(pNdInfo);\n\t\ts_pNd91->setResultListener(s_pRetListener);\n\t}\n}\n\nvoid MyPurchase::unloadIAPPlugin()\n{\n\tif (s_pAlipay)\n\t{\n\t\tPluginManager::getInstance()->unloadPlugin(\"IAPAlipay\");\n\t\ts_pAlipay = NULL;\n\t}\n\n\tif (s_pNd91)\n\t{\n\t\tPluginManager::getInstance()->unloadPlugin(\"IAPNd91\");\n\t\ts_pNd91 = NULL;\n\t}\n}\n\nvoid MyPurchase::payByMode(TProductInfo info, MyPayMode mode)\n{\n\tProtocolIAP* pIAP = NULL;\n\tswitch(mode)\n\t{\n\tcase eAlipay:\n\t\tpIAP = s_pAlipay;\n\t\tbreak;\n\tcase eND91:\n\t\tpIAP = s_pNd91;\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\tif (pIAP) {\n\t\tpIAP->payForProduct(info);\n\t}\n}\n\nvoid MyPurchaseResult::onPayResult(PayResultCode ret, const char* msg, TProductInfo info)\n{\n\tchar goodInfo[1024] = { 0 };\n\tsprintf(goodInfo, \"商品名称:%s\\n商品价格:%s\\n商品描述:%s\",\n\t\t\tinfo.find(\"productName\")->second.c_str(),\n\t\t\tinfo.find(\"productPrice\")->second.c_str(),\n\t\t\tinfo.find(\"productDesc\")->second.c_str());\n\tMessageBox(goodInfo , msg);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __MY_PURCHASE_H__\n#define __MY_PURCHASE_H__\n\n#include \"ProtocolIAP.h\"\n\nclass MyPurchaseResult : public cocos2d::plugin::PayResultListener\n{\npublic:\n\tvirtual void onPayResult(cocos2d::plugin::PayResultCode ret, const char* msg, cocos2d::plugin::TProductInfo info);\n};\n\nclass MyPurchase\n{\npublic:\n\tstatic MyPurchase* getInstance();\n    static void purgePurchase();\n\n    typedef enum {\n    \teNoneMode = 0,\n    \teAlipay,\n    \teND91,\n    } MyPayMode;\n\n\tvoid unloadIAPPlugin();\n    void loadIAPPlugin();\n    void payByMode(cocos2d::plugin::TProductInfo info, MyPayMode mode);\n\nprivate:\n    MyPurchase();\n    virtual ~MyPurchase();\n\n    static MyPurchase* s_pPurchase;\n\n    cocos2d::plugin::ProtocolIAP* s_pAlipay;\n    cocos2d::plugin::ProtocolIAP* s_pNd91;\n    MyPurchaseResult* s_pRetListener;\n};\n\n#endif // __MY_PURCHASE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TestIAPScene.h\"\n#include \"PluginManager.h\"\n#include \"AppDelegate.h\"\n#include \"MyPurchase.h\"\n#include \"HelloWorldScene.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::plugin;\n\nenum {\n\tTAG_PAY_BY_ALIPAY = 100,\n\tTAG_PAY_BY_ND91,\n};\n\ntypedef struct tagEventMenuItem {\n    std::string id;\n    int tag;\n}EventMenuItem;\n\nstatic EventMenuItem s_EventMenuItem[] = {\n    {\"BtnAlipay.png\", TAG_PAY_BY_ALIPAY},\n\t{\"BtnND91.png\", TAG_PAY_BY_ND91},\n};\n\nScene* TestIAP::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    TestIAP *layer = TestIAP::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool TestIAP::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n\n    MyPurchase::getInstance()->loadIAPPlugin();\n\n    /////////////////////////////\n    // 2. add a menu item with \"X\" image, which is clicked to quit the program\n    //    you may modify it.\n\n    EGLView* pEGLView = EGLView::getInstance();\n    Point posBR = Point(pEGLView->getVisibleOrigin().x + pEGLView->getVisibleSize().width, pEGLView->getVisibleOrigin().y);\n    Point posTL = Point(pEGLView->getVisibleOrigin().x, pEGLView->getVisibleOrigin().y + pEGLView->getVisibleSize().height);\n\n    // add a \"close\" icon to exit the progress. it's an autorelease object\n    MenuItemFont *pBackItem = MenuItemFont::create(\"Back\", CC_CALLBACK_1(TestIAP::menuBackCallback, this));\n    Size backSize = pBackItem->getContentSize();\n    pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pBackItem, NULL);\n    pMenu->setPosition( Point::ZERO );\n    this->addChild(pMenu, 1);\n\n    Point posStep = Point(220, -150);\n    Point beginPos = posTL + (posStep * 0.5f);\n    int line = 0;\n    int row = 0;\n    for (int i = 0; i < sizeof(s_EventMenuItem)/sizeof(s_EventMenuItem[0]); i++) {\n    \tMenuItemImage* pMenuItem = MenuItemImage::create(s_EventMenuItem[i].id.c_str(), s_EventMenuItem[i].id.c_str(),\n    \t\t\tCC_CALLBACK_1(TestIAP::eventMenuCallback, this));\n        pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag);\n\n        Point pos = beginPos + Point(posStep.x * row, posStep.y * line);\n        Size itemSize = pMenuItem->getContentSize();\n        if ((pos.x + itemSize.width / 2) > posBR.x)\n\t\t{\n\t\t\tline += 1;\n\t\t\trow = 0;\n\t\t\tpos = beginPos + Point(posStep.x * row, posStep.y * line);\n\t\t}\n        row += 1;\n        pMenuItem->setPosition(pos);\n    }\n\n    return true;\n}\n\nvoid TestIAP::eventMenuCallback(Object* pSender)\n{\n    MenuItemLabel* pMenuItem = (MenuItemLabel*)pSender;\n    TProductInfo pInfo;\n    MyPurchase::MyPayMode mode = (MyPurchase::MyPayMode) (pMenuItem->getTag() - TAG_PAY_BY_ALIPAY + 1);\n    pInfo[\"productName\"] = \"100金币\";\n\tpInfo[\"productPrice\"] = \"0.01\";\n\tpInfo[\"productDesc\"] = \"100个金灿灿的游戏币哦\";\n\tpInfo[\"Nd91ProductId\"] = \"685994\";\n    MyPurchase::getInstance()->payByMode(pInfo, mode);\n}\n\nvoid TestIAP::menuBackCallback(Object* pSender)\n{\n\tMyPurchase::purgePurchase();\n\n\tScene* newScene = HelloWorld::scene();\n    Director::getInstance()->replaceScene(newScene);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TEST_IAP_SCENE_H__\n#define __TEST_IAP_SCENE_H__\n\n#include \"cocos2d.h\"\n\nclass TestIAP : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();  \n\n    // there's no 'id' in cpp, so we recommand to return the exactly class pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuBackCallback(Object* pSender);\n    void eventMenuCallback(Object* pSender);\n\n    // implement the \"static node()\" method manually\n    CREATE_FUNC(TestIAP);\n};\n\n#endif // __TEST_IAP_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"MyIAPOLManager.h\"\n#include \"PluginManager.h\"\n#include \"cocos2d.h\"\n\nusing namespace cocos2d::plugin;\nusing namespace cocos2d;\n\nMyIAPOLManager* MyIAPOLManager::s_pIAPOnline = NULL;\n\nMyIAPOLManager::MyIAPOLManager()\n: s_pQH360(NULL)\n, s_pRetListener(NULL)\n, s_pNd91(NULL)\n, s_pUC(NULL)\n{\n\n}\n\nMyIAPOLManager::~MyIAPOLManager()\n{\n    unloadPlugins();\n    if (s_pRetListener)\n    {\n        delete s_pRetListener;\n        s_pRetListener = NULL;\n    }\n}\n\nMyIAPOLManager* MyIAPOLManager::getInstance()\n{\n    if (s_pIAPOnline == NULL) {\n        s_pIAPOnline = new MyIAPOLManager();\n    }\n    return s_pIAPOnline;\n}\n\nvoid MyIAPOLManager::purge()\n{\n    if (s_pIAPOnline)\n    {\n        delete s_pIAPOnline;\n        s_pIAPOnline = NULL;\n    }\n    PluginManager::end();\n}\n\nvoid MyIAPOLManager::loadPlugins()\n{\n    if (s_pRetListener == NULL)\n    {\n        s_pRetListener = new MyIAPOnlineResult();\n    }\n\n    {\n        // init qh360 plugin\n        s_pQH360 = dynamic_cast<ProtocolIAP*>(PluginManager::getInstance()->loadPlugin(\"IAPOnlineQH360\"));\n        TIAPDeveloperInfo pQH360Info;\n        pQH360Info[\"QHAppName\"] = APP_NAME;\n        pQH360Info[\"QHExchangeRate\"] = QH360_EXCHANGE_RATE;\n\n        s_pQH360->setDebugMode(true);\n        s_pQH360->configDeveloperInfo(pQH360Info);\n        s_pQH360->setResultListener(s_pRetListener);\n    }\n\n    {\n        TIAPDeveloperInfo pNdInfo;\n        pNdInfo[\"Nd91AppId\"] = ND91_APPID;\n        pNdInfo[\"Nd91AppKey\"] = ND91_APPKEY;\n        pNdInfo[\"Nd91Orientation\"] = ND91_ORIENTATION;\n        s_pNd91 = dynamic_cast<ProtocolIAP*>(PluginManager::getInstance()->loadPlugin(\"IAPOnlineNd91\"));\n        s_pNd91->setDebugMode(true);\n        s_pNd91->configDeveloperInfo(pNdInfo);\n        s_pNd91->setResultListener(s_pRetListener);\n    }\n\n#if TEST_UC\n    {\n        s_pUC = dynamic_cast<ProtocolIAP*>(PluginManager::getInstance()->loadPlugin(\"IAPOnlineUC\"));\n        if (NULL != s_pUC)\n        {\n            TIAPDeveloperInfo pUCInfo;\n            pUCInfo[\"UCCpID\"] = UC_CPID;\n            pUCInfo[\"UCGameID\"] = UC_GAME_ID;\n            pUCInfo[\"UCServerID\"] = UC_SERVER_ID;\n            s_pUC->setDebugMode(true);\n            s_pUC->configDeveloperInfo(pUCInfo);\n            s_pUC->setResultListener(s_pRetListener);\n        }\n    }\n#endif\n}\n\nvoid MyIAPOLManager::unloadPlugins()\n{\n    if (s_pQH360)\n    {\n        PluginManager::getInstance()->unloadPlugin(\"IAPOnlineQH360\");\n        s_pQH360 = NULL;\n    }\n\n    if (s_pNd91)\n    {\n        PluginManager::getInstance()->unloadPlugin(\"IAPOnlineNd91\");\n        s_pNd91 = NULL;\n    }\n\n    if (s_pUC)\n    {\n        PluginManager::getInstance()->unloadPlugin(\"IAPOnlineUC\");\n        s_pUC = NULL;\n    }\n}\n\nvoid MyIAPOLManager::payByMode(TProductInfo info, MyPayMode mode)\n{\n    ProtocolIAP* pIAP = NULL;\n    switch(mode)\n    {\n    case eQH360:\n        pIAP = s_pQH360;\n        break;\n    case eND91:\n        pIAP = s_pNd91;\n        break;\n#if TEST_UC\n    case eUC:\n        pIAP = s_pUC;\n        break;\n#endif\n    default:\n        break;\n    }\n\n    if (pIAP) {\n        pIAP->payForProduct(info);\n    }\n}\n\nvoid MyIAPOnlineResult::onPayResult(PayResultCode ret, const char* msg, TProductInfo info)\n{\n    char goodInfo[1024] = { 0 };\n    sprintf(goodInfo, \"商品名称:%s\\n商品价格:%s\\n商品描述:%s\",\n            info.find(\"productName\")->second.c_str(),\n            info.find(\"productPrice\")->second.c_str(),\n            info.find(\"productDesc\")->second.c_str());\n    MessageBox(goodInfo , msg);\n\n    if (ret == kPaySuccess) {\n        log(\"Pay success locally, should check the real result by game server!\");\n    }\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __MY_IAPOL_MANAGER_H__\n#define __MY_IAPOL_MANAGER_H__\n\n#include \"ProtocolIAP.h\"\n#include \"Configs.h\"\n\nclass MyIAPOnlineResult : public cocos2d::plugin::PayResultListener\n{\npublic:\n    virtual void onPayResult(cocos2d::plugin::PayResultCode ret, const char* msg, cocos2d::plugin::TProductInfo info);\n};\n\nclass MyIAPOLManager\n{\npublic:\n    static MyIAPOLManager* getInstance();\n    static void purge();\n\n    typedef enum {\n        eNoneMode = 0,\n        eQH360,\n        eND91,\n#if TEST_UC\n        eUC,\n#endif\n    } MyPayMode;\n\n    void unloadPlugins();\n    void loadPlugins();\n    void payByMode(cocos2d::plugin::TProductInfo info, MyPayMode mode);\n\nprivate:\n    MyIAPOLManager();\n    virtual ~MyIAPOLManager();\n\n    static MyIAPOLManager* s_pIAPOnline;\n\n    cocos2d::plugin::ProtocolIAP* s_pQH360;\n    cocos2d::plugin::ProtocolIAP* s_pNd91;\n    cocos2d::plugin::ProtocolIAP* s_pUC;\n    MyIAPOnlineResult* s_pRetListener;\n};\n\n#endif // __MY_IAPOL_MANAGER_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TestIAPOnlineScene.h\"\n#include \"PluginManager.h\"\n#include \"AppDelegate.h\"\n#include \"MyIAPOLManager.h\"\n#include \"HelloWorldScene.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::plugin;\n\nenum {\n\tTAG_PAY_BY_QH360 = 100,\n\tTAG_PAY_BY_ND91,\n\tTAG_PAY_BY_UC,\n};\n\ntypedef struct tagEventMenuItem {\n    std::string id;\n    int tag;\n}EventMenuItem;\n\nstatic EventMenuItem s_EventMenuItem[] = {\n    {\"BtnQH360.png\", TAG_PAY_BY_QH360},\n\t{\"BtnND91.png\", TAG_PAY_BY_ND91},\n#if TEST_UC\n\t{\"BtnUC.png\", TAG_PAY_BY_UC},\n#endif\n};\n\nScene* TestIAPOnline::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    TestIAPOnline *layer = TestIAPOnline::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool TestIAPOnline::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n\n    MyIAPOLManager::getInstance()->loadPlugins();\n\n    /////////////////////////////\n    // 2. add a menu item with \"X\" image, which is clicked to quit the program\n    //    you may modify it.\n\n    EGLView* pEGLView = EGLView::getInstance();\n    Point posBR = Point(pEGLView->getVisibleOrigin().x + pEGLView->getVisibleSize().width, pEGLView->getVisibleOrigin().y);\n    Point posTL = Point(pEGLView->getVisibleOrigin().x, pEGLView->getVisibleOrigin().y + pEGLView->getVisibleSize().height);\n\n    // add a \"close\" icon to exit the progress. it's an autorelease object\n    MenuItemFont *pBackItem = MenuItemFont::create(\"Back\", CC_CALLBACK_1(TestIAPOnline::menuBackCallback, this));\n    Size backSize = pBackItem->getContentSize();\n    pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pBackItem, NULL);\n    pMenu->setPosition( Point::ZERO );\n    this->addChild(pMenu, 1);\n\n    Point posStep = Point(220, -150);\n    Point beginPos = posTL + (posStep * 0.5f);\n    int line = 0;\n    int row = 0;\n    for (int i = 0; i < sizeof(s_EventMenuItem)/sizeof(s_EventMenuItem[0]); i++) {\n    \tMenuItemImage* pMenuItem = MenuItemImage::create(s_EventMenuItem[i].id.c_str(), s_EventMenuItem[i].id.c_str(),\n    \t\t\tCC_CALLBACK_1(TestIAPOnline::eventMenuCallback, this));\n        pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag);\n\n        Point pos = beginPos + Point(posStep.x * row, posStep.y * line);\n        Size itemSize = pMenuItem->getContentSize();\n        if ((pos.x + itemSize.width / 2) > posBR.x)\n\t\t{\n\t\t\tline += 1;\n\t\t\trow = 0;\n\t\t\tpos = beginPos + Point(posStep.x * row, posStep.y * line);\n\t\t}\n        row += 1;\n        pMenuItem->setPosition(pos);\n    }\n\n    return true;\n}\n\nvoid TestIAPOnline::eventMenuCallback(Object* pSender)\n{\n    MenuItemLabel* pMenuItem = (MenuItemLabel*)pSender;\n    MyIAPOLManager::MyPayMode mode = (MyIAPOLManager::MyPayMode) (pMenuItem->getTag() - TAG_PAY_BY_QH360 + 1);\n\n    TProductInfo pInfo;\n    pInfo[\"productName\"] = \"100金币\";\n    pInfo[\"productPrice\"] = \"0.01\";\n    pInfo[\"productDesc\"] = \"100个金灿灿的游戏币哦\";\n    pInfo[\"Nd91ProductId\"] = \"685994\";\n\n    if (mode == MyIAPOLManager::eQH360) {\n        log(\"To test the IAP online in plugin qh360, you should do this:\");\n        log(\"1. Login by UserQH360\");\n        log(\"2. Get QH360 user info by your game server (userID, AccessToken)\");\n        log(\"3. Fill the product info\");\n\n        /**\n         * @warning ProductInfo you need filled\n         */\n        // pInfo[\"QHAccessToken\"] = \"User Access Token\";    // The access token of user (Get from game server)\n        // pInfo[\"QHUserId\"] = \"User ID on QH360 server\";   // The user ID on QH360 server (Get from game server)\n        // pInfo[\"QHProductID\"] = \"Product ID\";             // The product ID (Game defined this)\n        // pInfo[\"QHNotifyUri\"] = \"Notify uri\";             // The uri which will receive the pay result\n        // pInfo[\"QHUserName\"] = \"User name in game\";       // The user name in game\n        // pInfo[\"QHAppUserID\"] = \"User ID on game server\"; // The user ID on game server\n\n        /**\n         * Optional data\n         */\n        // pInfo[\"QHExtra1\"] = \"Extra data 1\";              // The extra data will be passed to game server\n        // pInfo[\"QHExtra2\"] = \"Extra data 2\";              // The extra data will be passed to game server\n        // pInfo[\"QHAppOrderID\"] = \"Order ID in game\";      // The order ID in game (Game defined this)\n    }\n\n    MyIAPOLManager::getInstance()->payByMode(pInfo, mode);\n}\n\nvoid TestIAPOnline::menuBackCallback(Object* pSender)\n{\n\tMyIAPOLManager::purge();\n\n\tScene* newScene = HelloWorld::scene();\n    Director::getInstance()->replaceScene(newScene);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TEST_IAP_ONLINE_SCENE_H__\n#define __TEST_IAP_ONLINE_SCENE_H__\n\n#include \"cocos2d.h\"\n\nclass TestIAPOnline : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();  \n\n    // there's no 'id' in cpp, so we recommand to return the exactly class pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuBackCallback(Object* pSender);\n    void eventMenuCallback(Object* pSender);\n\n    // implement the \"static node()\" method manually\n    CREATE_FUNC(TestIAPOnline);\n};\n\n#endif // __TEST_IAP_ONLINE_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"MyShareManager.h\"\n#include \"PluginManager.h\"\n#include \"cocos2d.h\"\n\nusing namespace cocos2d::plugin;\nusing namespace cocos2d;\n\nMyShareManager* MyShareManager::s_pManager = NULL;\n\nMyShareManager::MyShareManager()\n: s_pRetListener(NULL)\n, s_pTwitter(NULL)\n, s_pWeibo(NULL)\n{\n\n}\n\nMyShareManager::~MyShareManager()\n{\n\tunloadSharePlugin();\n\tif (s_pRetListener)\n\t{\n\t\tdelete s_pRetListener;\n\t\ts_pRetListener = NULL;\n\t}\n}\n\nMyShareManager* MyShareManager::getInstance()\n{\n\tif (s_pManager == NULL) {\n\t\ts_pManager = new MyShareManager();\n\t}\n\treturn s_pManager;\n}\n\nvoid MyShareManager::purgeManager()\n{\n\tif (s_pManager)\n\t{\n\t\tdelete s_pManager;\n\t\ts_pManager = NULL;\n\t}\n\tPluginManager::end();\n}\n\nvoid MyShareManager::loadSharePlugin()\n{\n\tif (s_pRetListener == NULL)\n\t{\n\t\ts_pRetListener = new MyShareResult();\n\t}\n\n\t{\n\t\t// init twitter plugin\n\t\ts_pTwitter = dynamic_cast<ProtocolShare*>(PluginManager::getInstance()->loadPlugin(\"ShareTwitter\"));\n\t\tif (NULL != s_pTwitter)\n\t\t{\n\t\t\tTShareDeveloperInfo pTwitterInfo;\n\n\t\t\t/* Warning: must set your twiiter dev info here */\n\t\t\t// pTwitterInfo[\"TwitterKey\"] = \"your consumerkey\";\n\t\t\t// pTwitterInfo[\"TwitterSecret\"] = \"your consumersecret\";\n\n\t\t\tif (pTwitterInfo.empty())\n\t\t\t{\n\t\t\t\tchar msg[256] = { 0 };\n\t\t\t\tsprintf(msg, \"Developer info is empty. PLZ fill your twitter info in %s(nearby line %d)\", __FILE__, __LINE__);\n\t\t\t\tMessageBox(msg, \"Twitter Warning\");\n\t\t\t}\n\t\t\ts_pTwitter->setDebugMode(true);\n\t\t\ts_pTwitter->configDeveloperInfo(pTwitterInfo);\n\t\t\ts_pTwitter->setResultListener(s_pRetListener);\n\t\t}\n\t}\n\n\t{\n\t\ts_pWeibo = dynamic_cast<ProtocolShare*>(PluginManager::getInstance()->loadPlugin(\"ShareWeibo\"));\n\t\tif (NULL != s_pWeibo)\n\t\t{\n\t\t\tTShareDeveloperInfo pWeiboInfo;\n\t\t\t// pWeiboInfo[\"WeiboAppKey\"] = \"your app key\";\n            // pWeiboInfo[\"WeiboAppSecret\"] = \"your app secret\";\n\t\t\t// pWeiboInfo[\"WeiboRedirectUrl\"] = \"your redirect url\";\n\n\t\t\tif (pWeiboInfo.empty())\n\t\t\t{\n\t\t\t\tchar msg[256] = { 0 };\n\t\t\t\tsprintf(msg, \"Developer info is empty. PLZ fill your weibo info in %s(nearby line %d)\", __FILE__, __LINE__);\n\t\t\t\tMessageBox(msg, \"Weibo Warning\");\n\t\t\t}\n\n\t\t\ts_pWeibo->setDebugMode(true);\n\t\t\ts_pWeibo->configDeveloperInfo(pWeiboInfo);\n\t\t\ts_pWeibo->setResultListener(s_pRetListener);\n\t\t}\n\t}\n}\n\nvoid MyShareManager::unloadSharePlugin()\n{\n\tif (s_pTwitter)\n\t{\n\t\tPluginManager::getInstance()->unloadPlugin(\"ShareTwitter\");\n\t\ts_pTwitter = NULL;\n\t}\n\n\tif (s_pWeibo)\n\t{\n\t\tPluginManager::getInstance()->unloadPlugin(\"ShareWeibo\");\n\t\ts_pWeibo = NULL;\n\t}\n}\n\nvoid MyShareManager::shareByMode(TShareInfo info, MyShareMode mode)\n{\n\tProtocolShare* pShare = NULL;\n\tswitch(mode)\n\t{\n\tcase eTwitter:\n\t\tpShare = s_pTwitter;\n\t\tbreak;\n\tcase eWeibo:\n\t\tpShare = s_pWeibo;\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\tif (pShare) {\n\t\tpShare->share(info);\n\t}\n}\n\nvoid MyShareResult::onShareResult(ShareResultCode ret, const char* msg)\n{\n    char shareStatus[1024] = { 0 };\n    sprintf(shareStatus, \"Share %s\", (ret == kShareSuccess)? \"Successed\" : \"Failed\");\n    MessageBox(msg, shareStatus);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __MY_Share_MANAGER_H__\n#define __MY_Share_MANAGER_H__\n\n#include \"ProtocolShare.h\"\n\nclass MyShareResult : public cocos2d::plugin::ShareResultListener\n{\npublic:\n\tvirtual void onShareResult(cocos2d::plugin::ShareResultCode ret, const char* msg);\n};\n\nclass MyShareManager\n{\npublic:\n\tstatic MyShareManager* getInstance();\n    static void purgeManager();\n\n    typedef enum {\n    \teNoneMode = 0,\n    \teTwitter,\n    \teWeibo,\n    } MyShareMode;\n\n\tvoid unloadSharePlugin();\n    void loadSharePlugin();\n    void shareByMode(cocos2d::plugin::TShareInfo info, MyShareMode mode);\n\nprivate:\n    MyShareManager();\n    virtual ~MyShareManager();\n\n    static MyShareManager* s_pManager;\n\n    cocos2d::plugin::ProtocolShare* s_pTwitter;\n    cocos2d::plugin::ProtocolShare* s_pWeibo;\n    MyShareResult* s_pRetListener;\n};\n\n#endif // __MY_Share_MANAGER_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TestShareScene.h\"\n#include \"PluginManager.h\"\n#include \"AppDelegate.h\"\n#include \"MyShareManager.h\"\n#include \"HelloWorldScene.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::plugin;\n\nenum {\n\tTAG_SHARE_BY_TWWITER = 100,\n\tTAG_SHARE_BY_WEIBO = 101,\n};\n\ntypedef struct tagEventMenuItem {\n    std::string id;\n    int tag;\n}EventMenuItem;\n\nstatic EventMenuItem s_EventMenuItem[] = {\n    {\"twitter.jpeg\", TAG_SHARE_BY_TWWITER},\n    {\"weibo.png\", TAG_SHARE_BY_WEIBO}\n};\n\nScene* TestShare::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    TestShare *layer = TestShare::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool TestShare::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n\n    MyShareManager::getInstance()->loadSharePlugin();\n\n    /////////////////////////////\n    // 2. add a menu item with \"X\" image, which is clicked to quit the program\n    //    you may modify it.\n\n    EGLView* pEGLView = EGLView::getInstance();\n    Point posBR = Point(pEGLView->getVisibleOrigin().x + pEGLView->getVisibleSize().width, pEGLView->getVisibleOrigin().y);\n    Point posTL = Point(pEGLView->getVisibleOrigin().x, pEGLView->getVisibleOrigin().y + pEGLView->getVisibleSize().height);\n\n    // add a \"close\" icon to exit the progress. it's an autorelease object\n    MenuItemFont *pBackItem = MenuItemFont::create(\"Back\", CC_CALLBACK_1(TestShare::menuBackCallback, this));\n    Size backSize = pBackItem->getContentSize();\n    pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pBackItem, NULL);\n    pMenu->setPosition( Point::ZERO );\n    this->addChild(pMenu, 1);\n\n    Point posStep = Point(150, -150);\n    Point beginPos = posTL + (posStep * 0.5f);\n    int line = 0;\n    int row = 0;\n    for (int i = 0; i < sizeof(s_EventMenuItem)/sizeof(s_EventMenuItem[0]); i++) {\n    \tMenuItemImage* pMenuItem = MenuItemImage::create(s_EventMenuItem[i].id.c_str(), s_EventMenuItem[i].id.c_str(), CC_CALLBACK_1(TestShare::eventMenuCallback, this));\n        pMenu->addChild(pMenuItem, 0, s_EventMenuItem[i].tag);\n\n        Point pos = beginPos + Point(posStep.x * row, posStep.y * line);\n        Size itemSize = pMenuItem->getContentSize();\n        if ((pos.x + itemSize.width / 2) > posBR.x)\n\t\t{\n\t\t\tline += 1;\n\t\t\trow = 0;\n\t\t\tpos = beginPos + Point(posStep.x * row, posStep.y * line);\n\t\t}\n        row += 1;\n        pMenuItem->setPosition(pos);\n    }\n\n    return true;\n}\n\nvoid TestShare::eventMenuCallback(Object* pSender)\n{\n\tMenuItemLabel* pMenuItem = (MenuItemLabel*)pSender;\n    TShareInfo pInfo;\n    pInfo[\"SharedText\"] = \"Share message : HelloShare!\";\n    // pInfo[\"SharedImagePath\"] = \"Full/path/to/image\";\n    MyShareManager::MyShareMode mode = (MyShareManager::MyShareMode) (pMenuItem->getTag() - TAG_SHARE_BY_TWWITER + 1);\n    MyShareManager::getInstance()->shareByMode(pInfo, mode);\n}\n\nvoid TestShare::menuBackCallback(Object* pSender)\n{\n    MyShareManager::purgeManager();\n    Scene* newScene = HelloWorld::scene();\n    Director::getInstance()->replaceScene(newScene);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TEST_SHARE_SCENE_H__\n#define __TEST_SHARE_SCENE_H__\n\n#include \"cocos2d.h\"\n\nclass TestShare : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();  \n\n    // there's no 'id' in cpp, so we recommand to return the exactly class pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuBackCallback(Object* pSender);\n    void eventMenuCallback(Object* pSender);\n\n    // implement the \"static node()\" method manually\n    CREATE_FUNC(TestShare);\n};\n\n#endif // __TEST_SHARE_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"MySocialManager.h\"\n#include \"PluginManager.h\"\n#include \"cocos2d.h\"\n#include \"Configs.h\"\n\nusing namespace cocos2d::plugin;\nusing namespace cocos2d;\n\nMySocialManager* MySocialManager::s_pManager = NULL;\n\nMySocialManager::MySocialManager()\n: _pNd91(NULL)\n{\n\n}\n\nMySocialManager::~MySocialManager()\n{\n    unloadPlugins();\n}\n\nMySocialManager* MySocialManager::getInstance()\n{\n    if (s_pManager == NULL) {\n        s_pManager = new MySocialManager();\n    }\n    return s_pManager;\n}\n\nvoid MySocialManager::purgeManager()\n{\n    if (s_pManager)\n    {\n        delete s_pManager;\n        s_pManager = NULL;\n    }\n    PluginManager::end();\n}\n\nvoid MySocialManager::loadPlugins()\n{\n    {\n        _pNd91 = dynamic_cast<ProtocolSocial*>(PluginManager::getInstance()->loadPlugin(\"SocialNd91\"));\n        if (NULL != _pNd91)\n        {\n            TSocialDeveloperInfo pNdInfo;\n            pNdInfo[\"Nd91AppId\"] = ND91_APPID;\n            pNdInfo[\"Nd91AppKey\"] = ND91_APPKEY;\n            pNdInfo[\"Nd91Orientation\"] = ND91_ORIENTATION;\n            if (pNdInfo.empty()) {\n                char msg[256] = { 0 };\n                sprintf(msg, \"Developer info is empty. PLZ fill your Nd91 info in %s(nearby line %d)\", __FILE__, __LINE__);\n                MessageBox(msg, \"Nd91 Warning\");\n            }\n            _pNd91->configDeveloperInfo(pNdInfo);\n            _pNd91->setDebugMode(true);\n            _pNd91->setListener(this);\n        }\n    }\n}\n\nvoid MySocialManager::submitScore(MySocialMode mode, const char* leaderboardID, long score)\n{\n    ProtocolSocial* pSocial = NULL;\n    switch (mode)\n    {\n    case eNd91:\n        pSocial = _pNd91;\n        break;\n    default:\n        break;\n    }\n\n    if (NULL != pSocial)\n    {\n        pSocial->submitScore(leaderboardID, score);\n    }\n}\n\nvoid MySocialManager::showLeaderboard(MySocialMode mode, const char* leaderboardID)\n{\n    ProtocolSocial* pSocial = NULL;\n    switch (mode)\n    {\n    case eNd91:\n        pSocial = _pNd91;\n        break;\n    default:\n        break;\n    }\n\n    if (NULL != pSocial)\n    {\n        pSocial->showLeaderboard(leaderboardID);\n    }\n}\n\nvoid MySocialManager::unlockAchievement(MySocialMode mode, TAchievementInfo info)\n{\n    ProtocolSocial* pSocial = NULL;\n    switch (mode)\n    {\n    case eNd91:\n        pSocial = _pNd91;\n        break;\n    default:\n        break;\n    }\n\n    if (NULL != pSocial)\n    {\n        pSocial->unlockAchievement(info);\n    }\n}\n\nvoid MySocialManager::showAchievement(MySocialMode mode)\n{\n    ProtocolSocial* pSocial = NULL;\n    switch (mode)\n    {\n    case eNd91:\n        pSocial = _pNd91;\n        break;\n    default:\n        break;\n    }\n\n    if (NULL != pSocial)\n    {\n        pSocial->showAchievements();\n    }\n}\n\nvoid MySocialManager::unloadPlugins()\n{\n    if (_pNd91)\n    {\n        PluginManager::getInstance()->unloadPlugin(\"SocialNd91\");\n        _pNd91 = NULL;\n    }\n}\n\nvoid MySocialManager::onSocialResult(SocialRetCode code, const char* msg)\n{\n    char socialStatus[1024] = { 0 };\n    sprintf(socialStatus, \"Social code %d\", code);\n    MessageBox(msg, socialStatus);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __MY_SOCIAL_MANAGER_H__\n#define __MY_SOCIAL_MANAGER_H__\n\n#include \"ProtocolSocial.h\"\n\nclass MySocialManager : public cocos2d::plugin::SocialListener\n{\npublic:\n    static MySocialManager* getInstance();\n    static void purgeManager();\n\n    typedef enum {\n        eNoneMode = 0,\n        eNd91,\n    } MySocialMode;\n\n    void unloadPlugins();\n    void loadPlugins();\n\n    void submitScore(MySocialMode mode, const char* leaderboardID, long score);\n    void showLeaderboard(MySocialMode mode, const char* leaderboardID);\n    void unlockAchievement(MySocialMode mode, cocos2d::plugin::TAchievementInfo info);\n    void showAchievement(MySocialMode mode);\n\n    virtual void onSocialResult(cocos2d::plugin::SocialRetCode code, const char* msg);\n\nprivate:\n    MySocialManager();\n    virtual ~MySocialManager();\n\n    static MySocialManager* s_pManager;\n\n    cocos2d::plugin::ProtocolSocial* _pNd91;\n};\n\n#endif // __MY_SOCIAL_MANAGER_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TestSocialScene.h\"\n#include \"PluginManager.h\"\n#include \"AppDelegate.h\"\n#include \"MySocialManager.h\"\n#include \"HelloWorldScene.h\"\n\nusing namespace cocos2d;\nusing namespace cocos2d::plugin;\n\nconst std::string s_aTestCases[] = {\n    \"Nd91\",\n};\n\nScene* TestSocial::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    TestSocial *layer = TestSocial::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool TestSocial::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n\n    MySocialManager::getInstance()->loadPlugins();\n\n    Size visibleSize = Director::getInstance()->getVisibleSize();\n    Point origin = Director::getInstance()->getVisibleOrigin();\n    Point posMid = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2);\n    Point posBR = Point(origin.x + visibleSize.width, origin.y);\n\n    MenuItemFont *pBackItem = MenuItemFont::create(\"Back\", CC_CALLBACK_1(TestSocial::menuBackCallback, this));\n    Size backSize = pBackItem->getContentSize();\n    pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pBackItem, NULL);\n    pMenu->setPosition( Point::ZERO );\n\n    LabelTTF* label1 = LabelTTF::create(\"Submit Score\", \"Arial\", 28);\n    MenuItemLabel* pItemSubmit = MenuItemLabel::create(label1, CC_CALLBACK_1(TestSocial::testSubmit, this));\n    pItemSubmit->setAnchorPoint(Point(0.5f, 0));\n    pMenu->addChild(pItemSubmit, 0);\n    pItemSubmit->setPosition(posMid + Point(-140, -60));\n\n    LabelTTF* label2 = LabelTTF::create(\"Unlock Achievement\", \"Arial\", 28);\n    MenuItemLabel* pItemUnlock = MenuItemLabel::create(label2, CC_CALLBACK_1(TestSocial::testUnlock, this));\n    pItemUnlock->setAnchorPoint(Point(0.5f, 0));\n    pMenu->addChild(pItemUnlock, 0);\n    pItemUnlock->setPosition(posMid + Point(140, -60));\n\n    LabelTTF* label3 = LabelTTF::create(\"Show Leaderboard\", \"Arial\", 28);\n    MenuItemLabel* pItemLeader = MenuItemLabel::create(label3, CC_CALLBACK_1(TestSocial::testLeaderboard, this));\n    pItemLeader->setAnchorPoint(Point(0.5f, 0));\n    pMenu->addChild(pItemLeader, 0);\n    pItemLeader->setPosition(posMid + Point(-140, -120));\n\n    LabelTTF* label4 = LabelTTF::create(\"Show Achievement\", \"Arial\", 28);\n    MenuItemLabel* pItemAchi = MenuItemLabel::create(label4, CC_CALLBACK_1(TestSocial::testAchievement, this));\n    pItemAchi->setAnchorPoint(Point(0.5f, 0));\n    pMenu->addChild(pItemAchi, 0);\n    pItemAchi->setPosition(posMid + Point(140, -120));\n\n    // create optional menu\n    // cases item\n    _caseItem = MenuItemToggle::createWithCallback(NULL,\n                                                MenuItemFont::create( s_aTestCases[0].c_str() ),\n                                                NULL );\n    int caseLen = sizeof(s_aTestCases) / sizeof(std::string);\n    for (int i = 1; i < caseLen; ++i)\n    {\n        _caseItem->getSubItems().pushBack( MenuItemFont::create( s_aTestCases[i].c_str() ) );\n    }\n    _caseItem->setPosition(posMid + Point(0, 120));\n    pMenu->addChild(_caseItem);\n\n    this->addChild(pMenu, 1);\n\n    return true;\n}\n\nvoid TestSocial::testSubmit(Object* pSender)\n{\n    int nIdx = _caseItem->getSelectedIndex();\n    MySocialManager::getInstance()->submitScore((MySocialManager::MySocialMode)(nIdx + 1), \"0\", 30000);\n}\n\nvoid TestSocial::testUnlock(Object* pSender)\n{\n    int nIdx = _caseItem->getSelectedIndex();\n    TAchievementInfo info;\n    info[\"AchievementID\"] = \"MyAchiID\";\n    info[\"NDDisplayText\"] = \"Fighter\";\n    info[\"NDScore\"] = \"100\";\n    MySocialManager::getInstance()->unlockAchievement((MySocialManager::MySocialMode)(nIdx + 1), info);\n}\n\nvoid TestSocial::testLeaderboard(Object* pSender)\n{\n    int nIdx = _caseItem->getSelectedIndex();\n    MySocialManager::getInstance()->showLeaderboard((MySocialManager::MySocialMode)(nIdx + 1), \"0\");\n}\n\nvoid TestSocial::testAchievement(Object* pSender)\n{\n    int nIdx = _caseItem->getSelectedIndex();\n    MySocialManager::getInstance()->showAchievement((MySocialManager::MySocialMode)(nIdx + 1));\n}\n\nvoid TestSocial::menuBackCallback(Object* pSender)\n{\n    MySocialManager::purgeManager();\n    Scene* newScene = HelloWorld::scene();\n    Director::getInstance()->replaceScene(newScene);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TEST_SOCIAL_SCENE_H__\n#define __TEST_SOCIAL_SCENE_H__\n\n#include \"cocos2d.h\"\n\nclass TestSocial : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();  \n\n    // there's no 'id' in cpp, so we recommand to return the exactly class pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuBackCallback(Object* pSender);\n    void testSubmit(Object* pSender);\n    void testUnlock(Object* pSender);\n    void testLeaderboard(Object* pSender);\n    void testAchievement(Object* pSender);\n\n    // implement the \"static node()\" method manually\n    CREATE_FUNC(TestSocial);\n\nprivate:\n    cocos2d::MenuItemToggle* _caseItem;\n};\n\n#endif // __TEST_SOCIAL_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"MyUserManager.h\"\n#include \"PluginManager.h\"\n#include \"cocos2d.h\"\n#include \"Configs.h\"\n\nusing namespace cocos2d::plugin;\nusing namespace cocos2d;\n\nMyUserManager* MyUserManager::s_pManager = NULL;\n\nMyUserManager::MyUserManager()\n: _retListener(NULL)\n, _qh360(NULL)\n, _nd91(NULL)\n, _uc(NULL)\n{\n\n}\n\nMyUserManager::~MyUserManager()\n{\n\tunloadPlugin();\n\tif (_retListener)\n\t{\n\t\tdelete _retListener;\n\t\t_retListener = NULL;\n\t}\n}\n\nMyUserManager* MyUserManager::getInstance()\n{\n\tif (s_pManager == NULL) {\n\t\ts_pManager = new MyUserManager();\n\t}\n\treturn s_pManager;\n}\n\nvoid MyUserManager::purgeManager()\n{\n\tif (s_pManager)\n\t{\n\t\tdelete s_pManager;\n\t\ts_pManager = NULL;\n\t}\n\tPluginManager::end();\n}\n\nvoid MyUserManager::loadPlugin()\n{\n\tif (_retListener == NULL)\n\t{\n\t\t_retListener = new MyUserActionResult();\n\t}\n\n\t{\n\t\t// init qh360 plugin\n\t\t_qh360 = dynamic_cast<ProtocolUser*>(PluginManager::getInstance()->loadPlugin(\"UserQH360\"));\n\t\tif (NULL != _qh360)\n\t\t{\n\t\t    _qh360->setDebugMode(true);\n\t\t\t_qh360->setActionListener(_retListener);\n\t\t}\n\t}\n\n\t{\n\t    _nd91 = dynamic_cast<ProtocolUser*>(PluginManager::getInstance()->loadPlugin(\"UserNd91\"));\n        if (NULL != _nd91)\n        {\n            TUserDeveloperInfo pNdInfo;\n            pNdInfo[\"Nd91AppId\"] = ND91_APPID;\n            pNdInfo[\"Nd91AppKey\"] = ND91_APPKEY;\n            pNdInfo[\"Nd91Orientation\"] = ND91_ORIENTATION;\n            if (pNdInfo.empty()) {\n                char msg[256] = { 0 };\n                sprintf(msg, \"Developer info is empty. PLZ fill your Nd91 info in %s(nearby line %d)\", __FILE__, __LINE__);\n                MessageBox(msg, \"Nd91 Warning\");\n            }\n            _nd91->configDeveloperInfo(pNdInfo);\n            _nd91->setDebugMode(true);\n            _nd91->setActionListener(_retListener);\n        }\n\t}\n\n#if TEST_UC\n\t{\n        _uc = dynamic_cast<ProtocolUser*>(PluginManager::getInstance()->loadPlugin(\"UserUC\"));\n        if (NULL != _uc)\n        {\n            TUserDeveloperInfo pUCInfo;\n            pUCInfo[\"UCCpID\"] = UC_CPID;\n            pUCInfo[\"UCGameID\"] = UC_GAME_ID;\n            pUCInfo[\"UCServerID\"] = UC_SERVER_ID;\n            if (pUCInfo.empty()) {\n                char msg[256] = { 0 };\n                sprintf(msg, \"Developer info is empty. PLZ fill your UC info in %s(nearby line %d)\", __FILE__, __LINE__);\n                MessageBox(msg, \"UC Warning\");\n            }\n            _uc->setDebugMode(true);\n            _uc->configDeveloperInfo(pUCInfo);\n            _uc->setActionListener(_retListener);\n        }\n    }\n#endif\n}\n\nvoid MyUserManager::unloadPlugin()\n{\n\tif (_qh360)\n\t{\n\t\tPluginManager::getInstance()->unloadPlugin(\"UserQH360\");\n\t\t_qh360 = NULL;\n\t}\n\n\tif (_nd91)\n    {\n        PluginManager::getInstance()->unloadPlugin(\"UserNd91\");\n        _nd91 = NULL;\n    }\n\n\tif (_uc)\n    {\n        PluginManager::getInstance()->unloadPlugin(\"UserUC\");\n        _uc = NULL;\n    }\n}\n\nvoid MyUserManager::loginByMode(MyUserMode mode)\n{\n\tProtocolUser* pUser = NULL;\n\tswitch(mode)\n\t{\n\tcase kQH360:\n\t\tpUser = _qh360;\n\t\tbreak;\n\tcase kND91:\n\t    pUser = _nd91;\n\t    break;\n#if TEST_UC\n\tcase kUC:\n\t    pUser = _uc;\n\t    break;\n#endif\n\tdefault:\n\t\tbreak;\n\t}\n\n\tif (pUser) {\n\t    pUser->login();\n\t}\n}\n\nvoid MyUserManager::logoutByMode(MyUserMode mode)\n{\n    ProtocolUser* pUser = NULL;\n    switch(mode)\n    {\n    case kQH360:\n        pUser = _qh360;\n        break;\n    case kND91:\n        pUser = _nd91;\n        break;\n#if TEST_UC\n    case kUC:\n        pUser = _uc;\n        break;\n#endif\n    default:\n        break;\n    }\n\n    if (pUser) {\n        pUser->logout();\n    }\n}\n\nvoid MyUserActionResult::onActionResult(ProtocolUser* pPlugin, UserActionResultCode code, const char* msg)\n{\n    char userStatus[1024] = { 0 };\n    switch (code)\n    {\n    case kLoginSucceed:\n    case kLoginFailed:\n        sprintf(userStatus, \"User of \\\"%s\\\" login %s\", pPlugin->getPluginName(), (code == kLoginSucceed)? \"Successed\" : \"Failed\");\n        break;\n    case kLogoutSucceed:\n        sprintf(userStatus, \"User of \\\"%s\\\" logout\", pPlugin->getPluginName());\n        break;\n    default:\n        break;\n    }\n    MessageBox(msg, userStatus);\n\n    // get session ID\n    std::string sessionID = pPlugin->getSessionID();\n    log(\"User Session ID of plugin %s is : %s\", pPlugin->getPluginName(), sessionID.c_str());\n\n    std::string strStatus = pPlugin->isLogined() ? \"online\" : \"offline\";\n    log(\"User status of plugin %s is : %s\", pPlugin->getPluginName(), strStatus.c_str());\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h",
    "content": "/****************************************************************************\nCopyright (c) 2012-2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __MY_USER_MANAGER_H__\n#define __MY_USER_MANAGER_H__\n\n#include \"ProtocolUser.h\"\n#include \"Configs.h\"\n\nclass MyUserActionResult : public cocos2d::plugin::UserActionListener\n{\npublic:\n    virtual void onActionResult(cocos2d::plugin::ProtocolUser* pPlugin, cocos2d::plugin::UserActionResultCode code, const char* msg);\n};\n\nclass MyUserManager\n{\npublic:\n\tstatic MyUserManager* getInstance();\n    static void purgeManager();\n\n    typedef enum {\n    \tkNoneMode = 0,\n    \tkQH360,\n    \tkND91,\n#if TEST_UC\n    \tkUC,\n#endif\n    } MyUserMode;\n\n\tvoid unloadPlugin();\n    void loadPlugin();\n    void loginByMode(MyUserMode mode);\n    void logoutByMode(MyUserMode mode);\n\nprivate:\n    MyUserManager();\n    virtual ~MyUserManager();\n\n    static MyUserManager* s_pManager;\n\n    cocos2d::plugin::ProtocolUser* _qh360;\n    cocos2d::plugin::ProtocolUser* _nd91;\n    cocos2d::plugin::ProtocolUser* _uc;\n    MyUserActionResult* _retListener;\n};\n\n#endif // __MY_USER_MANAGER_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#include \"TestUserScene.h\"\n#include \"MyUserManager.h\"\n#include \"HelloWorldScene.h\"\n\nUSING_NS_CC;\n\nconst std::string s_aTestCases[] = {\n    \"QH360\",\n    \"ND91\",\n#if TEST_UC\n    \"UC\",\n#endif\n};\n\nScene* TestUser::scene()\n{\n    // 'scene' is an autorelease object\n    Scene *scene = Scene::create();\n    \n    // 'layer' is an autorelease object\n    TestUser *layer = TestUser::create();\n\n    // add layer as a child to scene\n    scene->addChild(layer);\n\n    // return the scene\n    return scene;\n}\n\n// on \"init\" you need to initialize your instance\nbool TestUser::init()\n{\n    //////////////////////////////\n    // 1. super init first\n    if ( !Layer::init() )\n    {\n        return false;\n    }\n\n    MyUserManager::getInstance()->loadPlugin();\n    Size visibleSize = Director::getInstance()->getVisibleSize();\n    Point origin = Director::getInstance()->getVisibleOrigin();\n    Point posMid = Point(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2);\n    Point posBR = Point(origin.x + visibleSize.width, origin.y);\n\n    /////////////////////////////\n    // 2. add a menu item with \"X\" image, which is clicked to quit the program\n    //    you may modify it.\n\n    // add a \"close\" icon to exit the progress. it's an autorelease object\n    MenuItemFont *pBackItem = MenuItemFont::create(\"Back\", CC_CALLBACK_1(TestUser::menuBackCallback, this));\n    Size backSize = pBackItem->getContentSize();\n    pBackItem->setPosition(posBR + Point(- backSize.width / 2, backSize.height / 2));\n\n    // create menu, it's an autorelease object\n    Menu* pMenu = Menu::create(pBackItem, NULL);\n    pMenu->setPosition(Point::ZERO);\n\n    LabelTTF* label1 = LabelTTF::create(\"Login\", \"Arial\", 32);\n    MenuItemLabel* pItemLogin = MenuItemLabel::create(label1, CC_CALLBACK_1(TestUser::testLogin, this));\n    pItemLogin->setAnchorPoint(Point(0.5f, 0));\n    pMenu->addChild(pItemLogin, 0);\n    pItemLogin->setPosition(posMid + Point(-100, -120));\n\n    LabelTTF* label2 = LabelTTF::create(\"Logout\", \"Arial\", 32);\n    MenuItemLabel* pItemLogout = MenuItemLabel::create(label2, CC_CALLBACK_1(TestUser::testLogout, this));\n    pItemLogout->setAnchorPoint(Point(0.5f, 0));\n    pMenu->addChild(pItemLogout, 0);\n    pItemLogout->setPosition(posMid + Point(100, -120));\n\n    // create optional menu\n    // cases item\n    _caseItem = MenuItemToggle::createWithCallback(CC_CALLBACK_1(TestUser::caseChanged, this),\n                                                MenuItemFont::create( s_aTestCases[0].c_str() ),\n                                                NULL );\n    int caseLen = sizeof(s_aTestCases) / sizeof(std::string);\n    for (int i = 1; i < caseLen; ++i)\n    {\n        _caseItem->getSubItems().pushBack( MenuItemFont::create( s_aTestCases[i].c_str() ) );\n    }\n    _caseItem->setPosition(posMid + Point(0, 120));\n    pMenu->addChild(_caseItem);\n\n    _selectedCase = 0;\n\n    this->addChild(pMenu, 1);\n    return true;\n}\n\nvoid TestUser::caseChanged(Object* pSender)\n{\n    _selectedCase = _caseItem->getSelectedIndex();\n}\n\nvoid TestUser::testLogin(Object* pSender)\n{\n    MyUserManager::getInstance()->loginByMode((MyUserManager::MyUserMode) (_selectedCase + 1));\n}\n\nvoid TestUser::testLogout(Object* pSender)\n{\n    MyUserManager::getInstance()->logoutByMode((MyUserManager::MyUserMode) (_selectedCase + 1));\n}\n\nvoid TestUser::menuBackCallback(Object* pSender)\n{\n    MyUserManager::purgeManager();\n\n    Scene* newScene = HelloWorld::scene();\n    Director::getInstance()->replaceScene(newScene);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.h",
    "content": "/****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n#ifndef __TEST_USER_SCENE_H__\n#define __TEST_USER_SCENE_H__\n\n#include \"cocos2d.h\"\n\nclass TestUser : public cocos2d::Layer\n{\npublic:\n    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone\n    virtual bool init();  \n\n    // there's no 'id' in cpp, so we recommend returning the class instance pointer\n    static cocos2d::Scene* scene();\n    \n    // a selector callback\n    void menuBackCallback(Object* pSender);\n    void testLogin(Object* pSender);\n    void testLogout(Object* pSender);\n    \n    void caseChanged(Object* pSender);\n\n    // implement the \"static node()\" method manually\n    CREATE_FUNC(TestUser);\n\nprivate:\n    cocos2d::MenuItemToggle* _caseItem;\n    int _selectedCase;\n};\n\n#endif // __TEST_USER_SCENE_H__\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/protocols/android/libPluginProtocol.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/flurry/android/FlurryAgent.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/flurry/android/libPluginFlurry.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/umeng/android/libPluginUmeng.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/umeng/android/umeng_sdk.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/alipay/android/alipay_plugin.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/alipay/android/libPluginAlipay.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/nd91/android/libPluginNd91.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/nd91/android/NdComPlatform.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/admob/android/GoogleAdMobAdsSdk.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/admob/android/libPluginAdmob.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/twitter/android/libPluginSocialTwitter.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/twitter/android/signpost-commonshttp4-1.2.1.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/twitter/android/signpost-core-1.2.1.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/twitter/android/signpost-jetty6-1.2.1.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/twitter/android/twitter4j-core-android-3.0.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/weibo/android/libPluginSocialWeibo.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/weibo/android/weibosdk.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/qh360/android/360SDK.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/qh360/android/libPluginQH360.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"plugin-x/plugins/uc/android/libPluginUC.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/.project",
    "content": "<?xml version='1.0' encoding='UTF-8'?>\n<projectDescription>\n\t<name>HelloPlugins</name>\n\t<comment />\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n\t<linkedResources>\n\t\t<link>\n\t\t\t<name>Classes</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-1-PROJECT_LOC/Classes</locationURI>\n\t\t</link>\n\t\t<link>\n\t\t\t<name>plugin-x</name>\n\t\t\t<type>2</type>\n\t\t\t<locationURI>PARENT-3-PROJECT_LOC/publish</locationURI>\n\t\t</link>\n\t</linkedResources>\n</projectDescription>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/AndroidManifest.xml",
    "content": "<?xml version='1.0' encoding='UTF-8'?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" package=\"org.cocos2dx.HelloPlugins\" android:versionCode=\"1\" android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"9\" />\n    <uses-feature android:glEsVersion=\"0x00020000\" />\n\n    <application android:icon=\"@drawable/icon\" android:label=\"@string/app_name\">\n\n        <activity android:name=\"android.app.NativeActivity\"\n                  android:label=\"@string/app_name\"\n                  android:screenOrientation=\"landscape\"\n                  android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n                  android:configChanges=\"orientation|screenSize|smallestScreenSize\">\n\n            <!-- Tell NativeActivity the name of our .so -->\n            <meta-data android:name=\"android.app.lib_name\"\n                       android:value=\"cocos2dcpp\" />\n\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n\n        <meta-data android:value=\"50d2af93527015338b000052\" android:name=\"UMENG_APPKEY\"></meta-data>\n\n    <activity android:configChanges=\"orientation|keyboardHidden|navigation\" android:launchMode=\"singleTask\" android:name=\"com.nd.commplatform.activity.SNSControlCenterActivity\" android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\" android:windowBackground=\"@null\" android:windowSoftInputMode=\"adjustPan\" />\n        \n        <activity android:configChanges=\"orientation|keyboardHidden|navigation\" android:launchMode=\"singleTask\" android:name=\"com.nd.commplatform.activity.SNSLoginActivity\" android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\" android:windowBackground=\"@null\" android:windowSoftInputMode=\"adjustPan\" />\n        \n        <activity android:configChanges=\"orientation|keyboardHidden|navigation\" android:name=\"com.nd.commplatform.activity.SNSAppPromotionActivity\" android:theme=\"@android:style/Theme.NoTitleBar\" android:windowBackground=\"@null\" android:windowSoftInputMode=\"adjustPan\" />\n        \n        \n        <service android:enabled=\"true\" android:exported=\"false\" android:name=\"com.nd.commplatform.service.NdDownloadService\" android:process=\":com.nd.commplatform.download\" />\n        \n        <receiver android:exported=\"false\" android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateNotify\" android:process=\"android.intent.nd.sns.commplatform.versionupdate\" />\n        \n        <service android:exported=\"false\" android:name=\"com.nd.commplatform.versionupdate.ND2VersionUpdateService\" android:process=\"android.intent.nd.sns.commplatform.versionupdate\" />\n        \n        <service android:enabled=\"true\" android:exported=\"false\" android:name=\"com.nd.commplatform.service.NdNewMessageNotification\" />\n    <activity android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\" android:name=\"com.google.ads.AdActivity\" />\n    <activity android:configChanges=\"orientation|keyboardHidden|navigation\" android:name=\"com.qihoopay.insdk.activity.ContainerActivity\" android:theme=\"@android:style/Theme.Translucent.NoTitleBar\">\n        </activity>\n        <activity android:configChanges=\"orientation|keyboardHidden|navigation|screenSize\" android:name=\"com.qihoopay.insdk.activity.RemoteContainerActivity\" android:process=\":remote\" android:theme=\"@android:style/Theme.Translucent.NoTitleBar\">\n        </activity>\n\n        <activity android:name=\"com.flurry.android.FlurryFullscreenTakeoverActivity\"\n             android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode\"\n             android:hardwareAccelerated=\"false\" >\n        </activity>\n\n        <meta-data android:name=\"QHOPENSDK_APPID\" android:value=\"102094835\" />\n        <meta-data android:name=\"QHOPENSDK_APPKEY\" android:value=\"8689e00460eabb1e66277eb4232fde6f\" />\n        <meta-data android:name=\"QHOPENSDK_PRIVATEKEY\" android:value=\"4e04fe9ac8e2a73cbb27ba52ac076eb9\" />\n        <meta-data android:name=\"QHOPENSDK_CHANNEL\" android:value=\"360PayDebug\" />\n        <activity\n            android:name=\"cn.uc.gamesdk.view.SdkWebActivity\"\n            android:configChanges=\"keyboardHidden|orientation|screenSize\"\n            android:theme=\"@android:style/Theme.Translucent\"\n            android:windowSoftInputMode=\"adjustResize\" >\n            <intent-filter>\n                <action android:name=\"cn.uc.gamesdk.sdkweb\" />\n                <category android:name=\"android.intent.category.DEFAULT\" />\n            </intent-filter>\n        </activity>\n    </application>\n    <supports-screens android:anyDensity=\"true\" android:largeScreens=\"true\" android:normalScreens=\"true\" android:smallScreens=\"true\" />\n                         \n    <uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n        <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n        <uses-permission android:name=\"android.permission.SEND_SMS\" />\n        <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n        <uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\" />\n        <uses-permission android:name=\"android.permission.CALL_PHONE\" />   \n        <uses-permission android:name=\"android.permission.GET_TASKS\" />\n        <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\" />\n    <uses-permission android:name=\"android.permission.RECEIVE_SMS\" />\n        <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n        <uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\" />\n        <uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\" />\n        <uses-permission android:name=\"android.permission.READ_SMS\" />\n        <uses-permission android:name=\"android.permission.WAKE_LOCK\" />\n    </manifest>"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/README.md",
    "content": "## Prerequisites:\n\n* Android NDK\n* Android SDK **OR** Eclipse ADT Bundle\n* Android AVD target installed\n\n## Building project\n\nThere are two ways of building Android projects.\n\n1. Eclipse\n2. Command Line\n\n### Import Project in Eclipse\n\n#### Features:\n\n1. Complete workflow from Eclipse, including:\n\t* Build C++.\n\t* Clean C++.\n\t* Build and Run whole project.\n\t* Logcat view.\n\t* Debug Java code.\n\t* Javascript editor.\n\t* Project management.\n2. True C++ editing, including:\n\t* Code completion. \n\t* Jump to definition.\n\t* Refactoring tools etc. \n\t* Quick open C++ files.\n\n\n#### Setup Eclipse Environment (only once)\n\n\n**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before.\n\n1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html)\n\n   **OR**\n\n   Install Eclipse with Java. Add ADT and CDT plugins.\n\n2. Only for Windows\n    1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install).\n    2. Add `Cygwin\\bin` directory to system PATH variable.\n    3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\\etc\\fstab` file.\n   \n3. Set up Variables: \n\t1. Path Variable `COCOS2DX`: \n\t\t* Eclipse->Preferences->General->Workspace->**Linked Resources**\n\t\t* Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory.\n\t\t![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png)\n\n\t2. C/C++ Environment Variable `NDK_ROOT`: \n\t\t* Eclipse->Preferences->C/C++->Build->**Environment**.\n\t\t* Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory.\n\t\t![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png)\n\t\t* Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr`\n\t\t\n4. Import libcocos2dx library project:\n\t1. File->New->Project->Android Project From Existing Code.\n\t2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory.\n\t3. Click **Finish** to add project.\n\t\n#### Adding and running from Eclipse\n\n![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png)\n\n1. File->New->Project->Android Project From Existing Code\n2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/`\n3. Add the project \n4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator.\n\n\n### Running project from Command Line\n\n    $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/\n    $ export NDK_ROOT=/path/to/ndk\n    $ ./build_native.sh\n    $ ant debug install\n\nIf the last command results in sdk.dir missing error then do: \n\n    $ android list target\n    $ android update project -p . -t (id from step 6)\n    $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/ant.properties",
    "content": "# This file is used to override default values used by the Ant build system.\n#\n# This file must be checked into Version Control Systems, as it is\n# integral to the build system of your project.\n\n# This file is only used by the Ant script.\n\n# You can use this to override default values such as\n#  'source.dir' for the location of your java source folder and\n#  'out.dir' for the location of your output folder.\n\n# You can also use it define how the release builds are signed by declaring\n# the following properties:\n#  'key.store' for the location of your keystore and\n#  'key.alias' for the name of the key to use.\n# The password will be asked during the build when you use the 'release' target.\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"HelloPlugins\" default=\"help\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${sdk.dir}/tools/ant/build.xml\" />\n\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/jni/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos2dcpp_shared\n\nLOCAL_MODULE_FILENAME := libcocos2dcpp\n\nLOCAL_SRC_FILES := hellocpp/main.cpp \\\n                   ../../Classes/AppDelegate.cpp \\\n                   ../../Classes/HelloWorldScene.cpp \\\n                   ../../Classes/TestAds/TestAdsScene.cpp \\\n                   ../../Classes/TestAnalytics/TestAnalyticsScene.cpp \\\n                   ../../Classes/TestIAP/TestIAPScene.cpp \\\n                   ../../Classes/TestIAP/MyPurchase.cpp \\\n                   ../../Classes/TestShare/TestShareScene.cpp \\\n                   ../../Classes/TestShare/MyShareManager.cpp \\\n                   ../../Classes/TestUser/TestUserScene.cpp \\\n                   ../../Classes/TestUser/MyUserManager.cpp \\\n                   ../../Classes/TestIAPOnline/TestIAPOnlineScene.cpp \\\n                   ../../Classes/TestIAPOnline/MyIAPOLManager.cpp \\\n                   ../../Classes/TestSocial/TestSocialScene.cpp \\\n                   ../../Classes/TestSocial/MySocialManager.cpp\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \\\n    $(LOCAL_PATH)/../../Classes/TestAds \\\n    $(LOCAL_PATH)/../../Classes/TestAnalytics \\\n    $(LOCAL_PATH)/../../Classes/TestIAP \\\n    $(LOCAL_PATH)/../../Classes/TestShare \\\n    $(LOCAL_PATH)/../../Classes/TestUser \\\n    $(LOCAL_PATH)/../../Classes/TestIAPOnline \\\n    $(LOCAL_PATH)/../../Classes/TestSocial\n\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static \\\nPluginProtocolStatic\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,2d)\n$(call import-module,protocols/android)\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/jni/Application.mk",
    "content": "APP_STL := gnustl_static\nAPP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix -fsigned-char\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/jni/hellocpp/main.cpp",
    "content": "#include \"AppDelegate.h\"\n#include \"platform/android/jni/JniHelper.h\"\n#include <jni.h>\n#include <android/log.h>\n#include \"PluginJniHelper.h\"\n#include <android_native_app_glue.h>\n#include \"PluginUtils.h\"\n\n#include \"cocos2d.h\"\n\n#define  LOG_TAG    \"main\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nusing namespace cocos2d;\n\nvoid cocos_android_app_init (struct android_app* app) {\n    LOGD(\"cocos_android_app_init\");\n    AppDelegate *pAppDelegate = new AppDelegate();\n    PluginJniHelper::setJavaVM(app->activity->vm);\n    PluginJniHelper::setClassLoaderFrom(app->activity->clazz);\n    cocos2d::plugin::PluginUtils::initPluginWrapper(app);\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system use,\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n\n# Project target.\ntarget=android-14\n\nandroid.library.reference.1=../../../publish/plugins/nd91/android/DependProject\nandroid.library.reference.2=../../../../cocos/2d/platform/android/java\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">HelloPlugins</string>\n</resources>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.android/src/nojava.txt",
    "content": "No Java files\nsrc/ is required for Android's build.xml to operate correctly.\ngit does not allow empty directories in revision control so this file is added to src/ both as a readme and to keep git happy.\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.ios/AppController.h",
    "content": "#import <UIKit/UIKit.h>\n\n@class RootViewController;\n\n@interface AppController : NSObject <UIApplicationDelegate> {\n    UIWindow *window;\n    RootViewController    *viewController;\n}\n\n@end\n\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.ios/AppController.mm",
    "content": "#import \"AppController.h\"\n#import \"EAGLView.h\"\n#import \"cocos2d.h\"\n#import \"AppDelegate.h\"\n#import \"RootViewController.h\"\n\n@implementation AppController\n\n#pragma mark -\n#pragma mark Application lifecycle\n\n// cocos2d application instance\nstatic AppDelegate s_sharedApplication;\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    \n    \n    // Override point for customization after application launch.\n\n    // Add the view controller's view to the window and display.\n    window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];\n    \n    // Init the CCEAGLView\n    CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds]\n                                     pixelFormat: kEAGLColorFormatRGB565\n                                     depthFormat: GL_DEPTH24_STENCIL8_OES\n                              preserveBackbuffer: NO\n                                      sharegroup: nil\n                                   multiSampling: NO\n                                 numberOfSamples: 0];\n\n    // Use RootViewController manage CCEAGLView \n    viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];\n    viewController.wantsFullScreenLayout = YES;\n    viewController.view = __glView;\n\n    // Set RootViewController to window\n    if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)\n    {\n        // warning: addSubView doesn't work on iOS6\n        [window addSubview: viewController.view];\n    }\n    else\n    {\n        // use this method on ios6\n        [window setRootViewController:viewController];\n    }\n    \n    [window makeKeyAndVisible];\n    \n    [[UIApplication sharedApplication] setStatusBarHidden:true];\n    \n    cocos2d::Application::getInstance()->run();\n\n    return YES;\n}\n\n\n- (void)applicationWillResignActive:(UIApplication *)application {\n    /*\n     Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.\n     Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.\n     */\n    cocos2d::Director::getInstance()->pause();\n}\n\n- (void)applicationDidBecomeActive:(UIApplication *)application {\n    /*\n     Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.\n     */\n    cocos2d::Director::getInstance()->resume();\n}\n\n- (void)applicationDidEnterBackground:(UIApplication *)application {\n    /*\n     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. \n     If your application supports background execution, called instead of applicationWillTerminate: when the user quits.\n     */\n    cocos2d::Application::getInstance()->applicationDidEnterBackground();\n}\n\n- (void)applicationWillEnterForeground:(UIApplication *)application {\n    /*\n     Called as part of  transition from the background to the inactive state: here you can undo many of the changes made on entering the background.\n     */\n    cocos2d::Application::getInstance()->applicationWillEnterForeground();\n}\n\n- (void)applicationWillTerminate:(UIApplication *)application {\n    /*\n     Called when the application is about to terminate.\n     See also applicationDidEnterBackground:.\n     */\n}\n\n\n#pragma mark -\n#pragma mark Memory management\n\n- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {\n    /*\n     Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.\n     */\n}\n\n\n- (void)dealloc {\n    [window release];\n    [super dealloc];\n}\n\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.ios/HelloPlugins.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t1AC3624916D4A1E8000847F2 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3624316D4A1E8000847F2 /* AppController.mm */; };\n\t\t1AC3624B16D4A1E8000847F2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AC3624516D4A1E8000847F2 /* main.m */; };\n\t\t1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; };\n\t\t1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; };\n\t\t1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; };\n\t\t1AFAF8BD16D35E4900DB1158 /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; };\n\t\t1AFCDA8216D4A25900906EA6 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AFCDA8116D4A25900906EA6 /* RootViewController.mm */; };\n\t\t1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };\n\t\t1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };\n\t\t288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };\n\t\t7855E0E1153FEF240059DD9A /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 7855E0DF153FEF240059DD9A /* Default.png */; };\n\t\tBF171245129291EC00B8313A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB012928DE900B8313A /* OpenGLES.framework */; };\n\t\tBF1712461292920000B8313A /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB212928DE900B8313A /* libxml2.dylib */; };\n\t\tBF1712471292920000B8313A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB412928DE900B8313A /* libz.dylib */; };\n\t\tBF1C47F01293687400B63C5D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF1C47EA1293683800B63C5D /* QuartzCore.framework */; };\n\t\tD41A0AD1160F154A004552AE /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D41A0AD0160F154A004552AE /* Default-568h@2x.png */; };\n\t\tD446FD6E16102124000ADA7B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D446FD6D16102124000ADA7B /* Default@2x.png */; };\n\t\tD44C620C132DFF330009C878 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620B132DFF330009C878 /* OpenAL.framework */; };\n\t\tD44C620E132DFF430009C878 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620D132DFF430009C878 /* AVFoundation.framework */; };\n\t\tD44C6210132DFF4E0009C878 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D44C620F132DFF4E0009C878 /* AudioToolbox.framework */; };\n\t\tD4EF949A15BD2D8B00D803EB /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949915BD2D8B00D803EB /* Icon-57.png */; };\n\t\tD4EF949C15BD2D8E00D803EB /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949B15BD2D8E00D803EB /* Icon-114.png */; };\n\t\tD4EF949E15BD2D9600D803EB /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949D15BD2D9600D803EB /* Icon-72.png */; };\n\t\tD4EF94A015BD2D9800D803EB /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = D4EF949F15BD2D9800D803EB /* Icon-144.png */; };\n\t\tFA3D264D17867219009B234A /* MyIAPOLManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA3D264817867219009B234A /* MyIAPOLManager.cpp */; };\n\t\tFA3D264E17867219009B234A /* TestIAPOnlineScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA3D264A17867219009B234A /* TestIAPOnlineScene.cpp */; };\n\t\tFA848860182B3D8F00858BDD /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA848852182B3AE400858BDD /* libcocos2dx iOS.a */; };\n\t\tFA848862182B3DEB00858BDD /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA848861182B3DEB00858BDD /* CoreMotion.framework */; };\n\t\tFAD554E5177C131500968F54 /* TestAdsScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD554D1177C131500968F54 /* TestAdsScene.cpp */; };\n\t\tFAD554E6177C131500968F54 /* TestAnalyticsScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD554D4177C131500968F54 /* TestAnalyticsScene.cpp */; };\n\t\tFAD554E9177C131500968F54 /* MyShareManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD554DC177C131500968F54 /* MyShareManager.cpp */; };\n\t\tFAD554EA177C131500968F54 /* TestShareScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD554DE177C131500968F54 /* TestShareScene.cpp */; };\n\t\tFAD554F3177C16A100968F54 /* libPluginAdmob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554ED177C16A100968F54 /* libPluginAdmob.a */; };\n\t\tFAD554F4177C16A100968F54 /* libPluginFlurry.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554EE177C16A100968F54 /* libPluginFlurry.a */; };\n\t\tFAD554F5177C16A100968F54 /* libPluginProtocol.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554EF177C16A100968F54 /* libPluginProtocol.a */; };\n\t\tFAD554F6177C16A100968F54 /* libPluginTwitter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554F0177C16A100968F54 /* libPluginTwitter.a */; };\n\t\tFAD554F7177C16A100968F54 /* libPluginUmeng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554F1177C16A100968F54 /* libPluginUmeng.a */; };\n\t\tFAD554F8177C16A100968F54 /* libPluginWeibo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554F2177C16A100968F54 /* libPluginWeibo.a */; };\n\t\tFAD554FD177C16DF00968F54 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554FC177C16DF00968F54 /* MessageUI.framework */; };\n\t\tFAD554FF177C16E700968F54 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD554FE177C16E700968F54 /* MediaPlayer.framework */; };\n\t\tFAD55501177C16F100968F54 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD55500177C16F100968F54 /* SystemConfiguration.framework */; };\n\t\tFAD55503177C16FA00968F54 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD55502177C16FA00968F54 /* StoreKit.framework */; };\n\t\tFAD55505177C170300968F54 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAD55504177C170200968F54 /* AdSupport.framework */; };\n\t\tFAD55518177D1EE900968F54 /* MyPurchase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD5550F177D1EE900968F54 /* MyPurchase.cpp */; };\n\t\tFAD55519177D1EE900968F54 /* TestIAPScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD55511177D1EE900968F54 /* TestIAPScene.cpp */; };\n\t\tFAD5551A177D1EE900968F54 /* MyUserManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD55514177D1EE900968F54 /* MyUserManager.cpp */; };\n\t\tFAD5551B177D1EE900968F54 /* TestUserScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAD55516177D1EE900968F54 /* TestUserScene.cpp */; };\n\t\tFAD55527177D2C2000968F54 /* BtnAlipay.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD55523177D2C2000968F54 /* BtnAlipay.png */; };\n\t\tFAD55528177D2C2000968F54 /* BtnND91.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD55524177D2C2000968F54 /* BtnND91.png */; };\n\t\tFAD55529177D2C2000968F54 /* twitter.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = FAD55525177D2C2000968F54 /* twitter.jpeg */; };\n\t\tFAD5552A177D2C2000968F54 /* weibo.png in Resources */ = {isa = PBXBuildFile; fileRef = FAD55526177D2C2000968F54 /* weibo.png */; };\n\t\tFADBF8A2179E559900F59B1D /* MySocialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FADBF89E179E559900F59B1D /* MySocialManager.cpp */; };\n\t\tFADBF8A3179E559900F59B1D /* TestSocialScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FADBF8A0179E559900F59B1D /* TestSocialScene.cpp */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\tFA848843182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1551A33F158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\tFA848845182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2FD617814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\tFA848847182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2CB81780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\tFA848849182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2D9B1780BDF7006731B9;\n\t\t\tremoteInfo = \"box2d Mac\";\n\t\t};\n\t\tFA84884B182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2ED617814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\tFA84884D182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F31FD1781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\tFA84884F182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1A6FB53017854BC300CDF010;\n\t\t\tremoteInfo = \"luabindings Mac\";\n\t\t};\n\t\tFA848851182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4D641783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\tFA848853182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4EFC1783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\tFA848855182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4F3B178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\tFA848857182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4F9E1783876B0073F6A7;\n\t\t\tremoteInfo = \"box2d iOS\";\n\t\t};\n\t\tFA848859182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4FB4178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\tFA84885B182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A5030178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\tFA84885D182B3AE400858BDD /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1A119791178526AA00D62A44;\n\t\t\tremoteInfo = \"luabindings iOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t1AC3624216D4A1E8000847F2 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = SOURCE_ROOT; };\n\t\t1AC3624316D4A1E8000847F2 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = SOURCE_ROOT; };\n\t\t1AC3624516D4A1E8000847F2 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; };\n\t\t1AC3624616D4A1E8000847F2 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = SOURCE_ROOT; };\n\t\t1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\t1AFAF8B416D35DE700DB1158 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = \"<group>\"; };\n\t\t1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../Classes/HelloWorldScene.h; sourceTree = \"<group>\"; };\n\t\t1AFAF8B916D35E4900DB1158 /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = \"<group>\"; };\n\t\t1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = \"<group>\"; };\n\t\t1AFCDA8016D4A25900906EA6 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = SOURCE_ROOT; };\n\t\t1AFCDA8116D4A25900906EA6 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = SOURCE_ROOT; };\n\t\t1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\t1D6058910D05DD3D006BFB54 /* HelloPlugins.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloPlugins.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };\n\t\t288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };\n\t\t7855E0DF153FEF240059DD9A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = SOURCE_ROOT; };\n\t\tBF170DB012928DE900B8313A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };\n\t\tBF170DB212928DE900B8313A /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };\n\t\tBF170DB412928DE900B8313A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };\n\t\tBF1C47EA1293683800B63C5D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };\n\t\tD41A0AD0160F154A004552AE /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"Default-568h@2x.png\"; path = \"../proj.ios/Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\tD446FD6D16102124000ADA7B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"Default@2x.png\"; path = \"../proj.ios/Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\tD44C620B132DFF330009C878 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };\n\t\tD44C620D132DFF430009C878 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };\n\t\tD44C620F132DFF4E0009C878 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };\n\t\tD4EF949915BD2D8B00D803EB /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"Icon-57.png\"; path = \"../proj.ios/Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\tD4EF949B15BD2D8E00D803EB /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"Icon-114.png\"; path = \"../proj.ios/Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\tD4EF949D15BD2D9600D803EB /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"Icon-72.png\"; path = \"../proj.ios/Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\tD4EF949F15BD2D9800D803EB /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = \"Icon-144.png\"; path = \"../proj.ios/Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\tD4F9F37B12E54555005CA6D2 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; };\n\t\tFA3D264817867219009B234A /* MyIAPOLManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MyIAPOLManager.cpp; sourceTree = \"<group>\"; };\n\t\tFA3D264917867219009B234A /* MyIAPOLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyIAPOLManager.h; sourceTree = \"<group>\"; };\n\t\tFA3D264A17867219009B234A /* TestIAPOnlineScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestIAPOnlineScene.cpp; sourceTree = \"<group>\"; };\n\t\tFA3D264B17867219009B234A /* TestIAPOnlineScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestIAPOnlineScene.h; sourceTree = \"<group>\"; };\n\t\tFA3D264C17867219009B234A /* Configs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Configs.h; path = ../Classes/Configs.h; sourceTree = \"<group>\"; };\n\t\tFA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = cocos2d_libs.xcodeproj; path = ../../../../build/cocos2d_libs.xcodeproj; sourceTree = \"<group>\"; };\n\t\tFA848861182B3DEB00858BDD /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };\n\t\tFAD554D1177C131500968F54 /* TestAdsScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestAdsScene.cpp; sourceTree = \"<group>\"; };\n\t\tFAD554D2177C131500968F54 /* TestAdsScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestAdsScene.h; sourceTree = \"<group>\"; };\n\t\tFAD554D4177C131500968F54 /* TestAnalyticsScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestAnalyticsScene.cpp; sourceTree = \"<group>\"; };\n\t\tFAD554D5177C131500968F54 /* TestAnalyticsScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestAnalyticsScene.h; sourceTree = \"<group>\"; };\n\t\tFAD554DC177C131500968F54 /* MyShareManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MyShareManager.cpp; sourceTree = \"<group>\"; };\n\t\tFAD554DD177C131500968F54 /* MyShareManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyShareManager.h; sourceTree = \"<group>\"; };\n\t\tFAD554DE177C131500968F54 /* TestShareScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestShareScene.cpp; sourceTree = \"<group>\"; };\n\t\tFAD554DF177C131500968F54 /* TestShareScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestShareScene.h; sourceTree = \"<group>\"; };\n\t\tFAD554ED177C16A100968F54 /* libPluginAdmob.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPluginAdmob.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFAD554EE177C16A100968F54 /* libPluginFlurry.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPluginFlurry.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFAD554EF177C16A100968F54 /* libPluginProtocol.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPluginProtocol.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFAD554F0177C16A100968F54 /* libPluginTwitter.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPluginTwitter.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFAD554F1177C16A100968F54 /* libPluginUmeng.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPluginUmeng.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFAD554F2177C16A100968F54 /* libPluginWeibo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPluginWeibo.a; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tFAD554FC177C16DF00968F54 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };\n\t\tFAD554FE177C16E700968F54 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };\n\t\tFAD55500177C16F100968F54 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };\n\t\tFAD55502177C16FA00968F54 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };\n\t\tFAD55504177C170200968F54 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };\n\t\tFAD5550F177D1EE900968F54 /* MyPurchase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MyPurchase.cpp; sourceTree = \"<group>\"; };\n\t\tFAD55510177D1EE900968F54 /* MyPurchase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyPurchase.h; sourceTree = \"<group>\"; };\n\t\tFAD55511177D1EE900968F54 /* TestIAPScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestIAPScene.cpp; sourceTree = \"<group>\"; };\n\t\tFAD55512177D1EE900968F54 /* TestIAPScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestIAPScene.h; sourceTree = \"<group>\"; };\n\t\tFAD55514177D1EE900968F54 /* MyUserManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MyUserManager.cpp; sourceTree = \"<group>\"; };\n\t\tFAD55515177D1EE900968F54 /* MyUserManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyUserManager.h; sourceTree = \"<group>\"; };\n\t\tFAD55516177D1EE900968F54 /* TestUserScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestUserScene.cpp; sourceTree = \"<group>\"; };\n\t\tFAD55517177D1EE900968F54 /* TestUserScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestUserScene.h; sourceTree = \"<group>\"; };\n\t\tFAD55523177D2C2000968F54 /* BtnAlipay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = BtnAlipay.png; sourceTree = \"<group>\"; };\n\t\tFAD55524177D2C2000968F54 /* BtnND91.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = BtnND91.png; sourceTree = \"<group>\"; };\n\t\tFAD55525177D2C2000968F54 /* twitter.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = twitter.jpeg; sourceTree = \"<group>\"; };\n\t\tFAD55526177D2C2000968F54 /* weibo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = weibo.png; sourceTree = \"<group>\"; };\n\t\tFADBF89E179E559900F59B1D /* MySocialManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MySocialManager.cpp; sourceTree = \"<group>\"; };\n\t\tFADBF89F179E559900F59B1D /* MySocialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MySocialManager.h; sourceTree = \"<group>\"; };\n\t\tFADBF8A0179E559900F59B1D /* TestSocialScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestSocialScene.cpp; sourceTree = \"<group>\"; };\n\t\tFADBF8A1179E559900F59B1D /* TestSocialScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestSocialScene.h; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t1D60588F0D05DD3D006BFB54 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\tFA848862182B3DEB00858BDD /* CoreMotion.framework in Frameworks */,\n\t\t\t\tFA848860182B3D8F00858BDD /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\tFAD55505177C170300968F54 /* AdSupport.framework in Frameworks */,\n\t\t\t\tFAD55503177C16FA00968F54 /* StoreKit.framework in Frameworks */,\n\t\t\t\tFAD55501177C16F100968F54 /* SystemConfiguration.framework in Frameworks */,\n\t\t\t\tFAD554FF177C16E700968F54 /* MediaPlayer.framework in Frameworks */,\n\t\t\t\tFAD554FD177C16DF00968F54 /* MessageUI.framework in Frameworks */,\n\t\t\t\tFAD554F3177C16A100968F54 /* libPluginAdmob.a in Frameworks */,\n\t\t\t\tFAD554F4177C16A100968F54 /* libPluginFlurry.a in Frameworks */,\n\t\t\t\tFAD554F5177C16A100968F54 /* libPluginProtocol.a in Frameworks */,\n\t\t\t\tFAD554F6177C16A100968F54 /* libPluginTwitter.a in Frameworks */,\n\t\t\t\tFAD554F7177C16A100968F54 /* libPluginUmeng.a in Frameworks */,\n\t\t\t\tFAD554F8177C16A100968F54 /* libPluginWeibo.a in Frameworks */,\n\t\t\t\t1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */,\n\t\t\t\t1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */,\n\t\t\t\t288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */,\n\t\t\t\tBF171245129291EC00B8313A /* OpenGLES.framework in Frameworks */,\n\t\t\t\tBF1712461292920000B8313A /* libxml2.dylib in Frameworks */,\n\t\t\t\tBF1712471292920000B8313A /* libz.dylib in Frameworks */,\n\t\t\t\tBF1C47F01293687400B63C5D /* QuartzCore.framework in Frameworks */,\n\t\t\t\tD44C620C132DFF330009C878 /* OpenAL.framework in Frameworks */,\n\t\t\t\tD44C620E132DFF430009C878 /* AVFoundation.framework in Frameworks */,\n\t\t\t\tD44C6210132DFF4E0009C878 /* AudioToolbox.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t080E96DDFE201D6D7F000001 /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1AC3624216D4A1E8000847F2 /* AppController.h */,\n\t\t\t\t1AC3624316D4A1E8000847F2 /* AppController.mm */,\n\t\t\t\tD4F9F37B12E54555005CA6D2 /* Info.plist */,\n\t\t\t\t1AC3624516D4A1E8000847F2 /* main.m */,\n\t\t\t\t1AC3624616D4A1E8000847F2 /* Prefix.pch */,\n\t\t\t\t1AFCDA8016D4A25900906EA6 /* RootViewController.h */,\n\t\t\t\t1AFCDA8116D4A25900906EA6 /* RootViewController.mm */,\n\t\t\t);\n\t\t\tname = ios;\n\t\t\tpath = Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t15AA9C4015B7EC450033D6C2 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADBF89D179E559900F59B1D /* TestSocial */,\n\t\t\t\tFA3D264717867219009B234A /* TestIAPOnline */,\n\t\t\t\tFAD5550E177D1EE900968F54 /* TestIAP */,\n\t\t\t\tFAD55513177D1EE900968F54 /* TestUser */,\n\t\t\t\tFAD554D0177C131500968F54 /* TestAds */,\n\t\t\t\tFAD554D3177C131500968F54 /* TestAnalytics */,\n\t\t\t\tFAD554DB177C131500968F54 /* TestShare */,\n\t\t\t\tFA3D264C17867219009B234A /* Configs.h */,\n\t\t\t\t1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */,\n\t\t\t\t1AFAF8B416D35DE700DB1158 /* AppDelegate.h */,\n\t\t\t\t1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */,\n\t\t\t\t1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tpath = ../classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t19C28FACFE9D520D11CA2CBB /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1D6058910D05DD3D006BFB54 /* HelloPlugins.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */,\n\t\t\t\t15AA9C4015B7EC450033D6C2 /* Classes */,\n\t\t\t\t29B97323FDCFA39411CA2CEA /* Frameworks */,\n\t\t\t\t080E96DDFE201D6D7F000001 /* ios */,\n\t\t\t\t19C28FACFE9D520D11CA2CBB /* Products */,\n\t\t\t\t78C7DDAA14EBA5050085D0C2 /* Resources */,\n\t\t\t);\n\t\t\tname = CustomTemplate;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t29B97323FDCFA39411CA2CEA /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA848861182B3DEB00858BDD /* CoreMotion.framework */,\n\t\t\t\tFAD55504177C170200968F54 /* AdSupport.framework */,\n\t\t\t\tFAD55502177C16FA00968F54 /* StoreKit.framework */,\n\t\t\t\tFAD55500177C16F100968F54 /* SystemConfiguration.framework */,\n\t\t\t\tFAD554FE177C16E700968F54 /* MediaPlayer.framework */,\n\t\t\t\tFAD554FC177C16DF00968F54 /* MessageUI.framework */,\n\t\t\t\tFAD554ED177C16A100968F54 /* libPluginAdmob.a */,\n\t\t\t\tFAD554EE177C16A100968F54 /* libPluginFlurry.a */,\n\t\t\t\tFAD554EF177C16A100968F54 /* libPluginProtocol.a */,\n\t\t\t\tFAD554F0177C16A100968F54 /* libPluginTwitter.a */,\n\t\t\t\tFAD554F1177C16A100968F54 /* libPluginUmeng.a */,\n\t\t\t\tFAD554F2177C16A100968F54 /* libPluginWeibo.a */,\n\t\t\t\tBF170DB212928DE900B8313A /* libxml2.dylib */,\n\t\t\t\tBF170DB412928DE900B8313A /* libz.dylib */,\n\t\t\t\tD44C620F132DFF4E0009C878 /* AudioToolbox.framework */,\n\t\t\t\tD44C620D132DFF430009C878 /* AVFoundation.framework */,\n\t\t\t\t288765A40DF7441C002DB57D /* CoreGraphics.framework */,\n\t\t\t\t1D30AB110D05D00D00671497 /* Foundation.framework */,\n\t\t\t\tD44C620B132DFF330009C878 /* OpenAL.framework */,\n\t\t\t\tBF170DB012928DE900B8313A /* OpenGLES.framework */,\n\t\t\t\tBF1C47EA1293683800B63C5D /* QuartzCore.framework */,\n\t\t\t\t1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t78C7DDAA14EBA5050085D0C2 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAD55523177D2C2000968F54 /* BtnAlipay.png */,\n\t\t\t\tFAD55524177D2C2000968F54 /* BtnND91.png */,\n\t\t\t\tFAD55525177D2C2000968F54 /* twitter.jpeg */,\n\t\t\t\tFAD55526177D2C2000968F54 /* weibo.png */,\n\t\t\t\t1AFAF8B916D35E4900DB1158 /* CloseNormal.png */,\n\t\t\t\t1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */,\n\t\t\t\tD41A0AD0160F154A004552AE /* Default-568h@2x.png */,\n\t\t\t\t7855E0DF153FEF240059DD9A /* Default.png */,\n\t\t\t\tD446FD6D16102124000ADA7B /* Default@2x.png */,\n\t\t\t\tD4EF949B15BD2D8E00D803EB /* Icon-114.png */,\n\t\t\t\tD4EF949F15BD2D9800D803EB /* Icon-144.png */,\n\t\t\t\tD4EF949915BD2D8B00D803EB /* Icon-57.png */,\n\t\t\t\tD4EF949D15BD2D9600D803EB /* Icon-72.png */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tpath = ../Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA3D264717867219009B234A /* TestIAPOnline */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA3D264817867219009B234A /* MyIAPOLManager.cpp */,\n\t\t\t\tFA3D264917867219009B234A /* MyIAPOLManager.h */,\n\t\t\t\tFA3D264A17867219009B234A /* TestIAPOnlineScene.cpp */,\n\t\t\t\tFA3D264B17867219009B234A /* TestIAPOnlineScene.h */,\n\t\t\t);\n\t\t\tname = TestIAPOnline;\n\t\t\tpath = ../Classes/TestIAPOnline;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFA848831182B3AE300858BDD /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFA848844182B3AE400858BDD /* libcocos2dx Mac.a */,\n\t\t\t\tFA848846182B3AE400858BDD /* libcocos2dx-extensions Mac.a */,\n\t\t\t\tFA848848182B3AE400858BDD /* libchipmunk Mac.a */,\n\t\t\t\tFA84884A182B3AE400858BDD /* libbox2d Mac.a */,\n\t\t\t\tFA84884C182B3AE400858BDD /* libCocosDenshion Mac.a */,\n\t\t\t\tFA84884E182B3AE400858BDD /* libjsbindings Mac.a */,\n\t\t\t\tFA848850182B3AE400858BDD /* libluabindings Mac.a */,\n\t\t\t\tFA848852182B3AE400858BDD /* libcocos2dx iOS.a */,\n\t\t\t\tFA848854182B3AE400858BDD /* libcocos2dx-extensions iOS.a */,\n\t\t\t\tFA848856182B3AE400858BDD /* libchipmunk iOS.a */,\n\t\t\t\tFA848858182B3AE400858BDD /* libbox2d iOS.a */,\n\t\t\t\tFA84885A182B3AE400858BDD /* libCocosDenshion iOS.a */,\n\t\t\t\tFA84885C182B3AE400858BDD /* libjsbindings iOS.a */,\n\t\t\t\tFA84885E182B3AE400858BDD /* libluabindings iOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAD554D0177C131500968F54 /* TestAds */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAD554D1177C131500968F54 /* TestAdsScene.cpp */,\n\t\t\t\tFAD554D2177C131500968F54 /* TestAdsScene.h */,\n\t\t\t);\n\t\t\tname = TestAds;\n\t\t\tpath = ../Classes/TestAds;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAD554D3177C131500968F54 /* TestAnalytics */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAD554D4177C131500968F54 /* TestAnalyticsScene.cpp */,\n\t\t\t\tFAD554D5177C131500968F54 /* TestAnalyticsScene.h */,\n\t\t\t);\n\t\t\tname = TestAnalytics;\n\t\t\tpath = ../Classes/TestAnalytics;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAD554DB177C131500968F54 /* TestShare */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAD554DC177C131500968F54 /* MyShareManager.cpp */,\n\t\t\t\tFAD554DD177C131500968F54 /* MyShareManager.h */,\n\t\t\t\tFAD554DE177C131500968F54 /* TestShareScene.cpp */,\n\t\t\t\tFAD554DF177C131500968F54 /* TestShareScene.h */,\n\t\t\t);\n\t\t\tname = TestShare;\n\t\t\tpath = ../Classes/TestShare;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAD5550E177D1EE900968F54 /* TestIAP */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAD5550F177D1EE900968F54 /* MyPurchase.cpp */,\n\t\t\t\tFAD55510177D1EE900968F54 /* MyPurchase.h */,\n\t\t\t\tFAD55511177D1EE900968F54 /* TestIAPScene.cpp */,\n\t\t\t\tFAD55512177D1EE900968F54 /* TestIAPScene.h */,\n\t\t\t);\n\t\t\tname = TestIAP;\n\t\t\tpath = ../Classes/TestIAP;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFAD55513177D1EE900968F54 /* TestUser */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFAD55514177D1EE900968F54 /* MyUserManager.cpp */,\n\t\t\t\tFAD55515177D1EE900968F54 /* MyUserManager.h */,\n\t\t\t\tFAD55516177D1EE900968F54 /* TestUserScene.cpp */,\n\t\t\t\tFAD55517177D1EE900968F54 /* TestUserScene.h */,\n\t\t\t);\n\t\t\tname = TestUser;\n\t\t\tpath = ../Classes/TestUser;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tFADBF89D179E559900F59B1D /* TestSocial */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tFADBF89E179E559900F59B1D /* MySocialManager.cpp */,\n\t\t\t\tFADBF89F179E559900F59B1D /* MySocialManager.h */,\n\t\t\t\tFADBF8A0179E559900F59B1D /* TestSocialScene.cpp */,\n\t\t\t\tFADBF8A1179E559900F59B1D /* TestSocialScene.h */,\n\t\t\t);\n\t\t\tname = TestSocial;\n\t\t\tpath = ../Classes/TestSocial;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t1D6058900D05DD3D006BFB54 /* HelloPlugins */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget \"HelloPlugins\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1D60588D0D05DD3D006BFB54 /* Resources */,\n\t\t\t\t1D60588E0D05DD3D006BFB54 /* Sources */,\n\t\t\t\t1D60588F0D05DD3D006BFB54 /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = HelloPlugins;\n\t\t\tproductName = iphone;\n\t\t\tproductReference = 1D6058910D05DD3D006BFB54 /* HelloPlugins.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t29B97313FDCFA39411CA2CEA /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0430;\n\t\t\t};\n\t\t\tbuildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject \"HelloPlugins\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 1;\n\t\t\tknownRegions = (\n\t\t\t\tEnglish,\n\t\t\t\tJapanese,\n\t\t\t\tFrench,\n\t\t\t\tGerman,\n\t\t\t);\n\t\t\tmainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = FA848831182B3AE300858BDD /* Products */;\n\t\t\t\t\tProjectRef = FA848830182B3AE300858BDD /* cocos2d_libs.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t1D6058900D05DD3D006BFB54 /* HelloPlugins */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\tFA848844182B3AE400858BDD /* libcocos2dx Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx Mac.a\";\n\t\t\tremoteRef = FA848843182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA848846182B3AE400858BDD /* libcocos2dx-extensions Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx-extensions Mac.a\";\n\t\t\tremoteRef = FA848845182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA848848182B3AE400858BDD /* libchipmunk Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libchipmunk Mac.a\";\n\t\t\tremoteRef = FA848847182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA84884A182B3AE400858BDD /* libbox2d Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libbox2d Mac.a\";\n\t\t\tremoteRef = FA848849182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA84884C182B3AE400858BDD /* libCocosDenshion Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libCocosDenshion Mac.a\";\n\t\t\tremoteRef = FA84884B182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA84884E182B3AE400858BDD /* libjsbindings Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsbindings Mac.a\";\n\t\t\tremoteRef = FA84884D182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA848850182B3AE400858BDD /* libluabindings Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libluabindings Mac.a\";\n\t\t\tremoteRef = FA84884F182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA848852182B3AE400858BDD /* libcocos2dx iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx iOS.a\";\n\t\t\tremoteRef = FA848851182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA848854182B3AE400858BDD /* libcocos2dx-extensions iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx-extensions iOS.a\";\n\t\t\tremoteRef = FA848853182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA848856182B3AE400858BDD /* libchipmunk iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libchipmunk iOS.a\";\n\t\t\tremoteRef = FA848855182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA848858182B3AE400858BDD /* libbox2d iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libbox2d iOS.a\";\n\t\t\tremoteRef = FA848857182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA84885A182B3AE400858BDD /* libCocosDenshion iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libCocosDenshion iOS.a\";\n\t\t\tremoteRef = FA848859182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA84885C182B3AE400858BDD /* libjsbindings iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsbindings iOS.a\";\n\t\t\tremoteRef = FA84885B182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\tFA84885E182B3AE400858BDD /* libluabindings iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libluabindings iOS.a\";\n\t\t\tremoteRef = FA84885D182B3AE400858BDD /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t1D60588D0D05DD3D006BFB54 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t7855E0E1153FEF240059DD9A /* Default.png in Resources */,\n\t\t\t\tD4EF949A15BD2D8B00D803EB /* Icon-57.png in Resources */,\n\t\t\t\tD4EF949C15BD2D8E00D803EB /* Icon-114.png in Resources */,\n\t\t\t\tD4EF949E15BD2D9600D803EB /* Icon-72.png in Resources */,\n\t\t\t\tD4EF94A015BD2D9800D803EB /* Icon-144.png in Resources */,\n\t\t\t\tD41A0AD1160F154A004552AE /* Default-568h@2x.png in Resources */,\n\t\t\t\tD446FD6E16102124000ADA7B /* Default@2x.png in Resources */,\n\t\t\t\t1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */,\n\t\t\t\t1AFAF8BD16D35E4900DB1158 /* CloseSelected.png in Resources */,\n\t\t\t\tFAD55527177D2C2000968F54 /* BtnAlipay.png in Resources */,\n\t\t\t\tFAD55528177D2C2000968F54 /* BtnND91.png in Resources */,\n\t\t\t\tFAD55529177D2C2000968F54 /* twitter.jpeg in Resources */,\n\t\t\t\tFAD5552A177D2C2000968F54 /* weibo.png in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t1D60588E0D05DD3D006BFB54 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */,\n\t\t\t\t1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */,\n\t\t\t\t1AC3624916D4A1E8000847F2 /* AppController.mm in Sources */,\n\t\t\t\t1AC3624B16D4A1E8000847F2 /* main.m in Sources */,\n\t\t\t\t1AFCDA8216D4A25900906EA6 /* RootViewController.mm in Sources */,\n\t\t\t\tFAD554E5177C131500968F54 /* TestAdsScene.cpp in Sources */,\n\t\t\t\tFAD554E6177C131500968F54 /* TestAnalyticsScene.cpp in Sources */,\n\t\t\t\tFAD554E9177C131500968F54 /* MyShareManager.cpp in Sources */,\n\t\t\t\tFAD554EA177C131500968F54 /* TestShareScene.cpp in Sources */,\n\t\t\t\tFAD55518177D1EE900968F54 /* MyPurchase.cpp in Sources */,\n\t\t\t\tFAD55519177D1EE900968F54 /* TestIAPScene.cpp in Sources */,\n\t\t\t\tFAD5551A177D1EE900968F54 /* MyUserManager.cpp in Sources */,\n\t\t\t\tFAD5551B177D1EE900968F54 /* TestUserScene.cpp in Sources */,\n\t\t\t\tFA3D264D17867219009B234A /* MyIAPOLManager.cpp in Sources */,\n\t\t\t\tFA3D264E17867219009B234A /* TestIAPOnlineScene.cpp in Sources */,\n\t\t\t\tFADBF8A2179E559900F59B1D /* MySocialManager.cpp in Sources */,\n\t\t\t\tFADBF8A3179E559900F59B1D /* TestSocialScene.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t1D6058940D05DD3E006BFB54 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = Prefix.pch;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\t\"COCOS2D_DEBUG=1\",\n\t\t\t\t\tCC_ENABLE_CHIPMUNK_INTEGRATION,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = \"\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\tOTHER_CFLAGS = \"-O2\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = HelloPlugins;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\\\"$(SRCROOT)/../../../../cocos/math/kazmath/include\\\" \\\"$(SRCROOT)/../../../../cocos/base\\\" \\\"$(SRCROOT)/../../../../cocos\\\" \\\"$(SRCROOT)/../../../../cocos/2d\\\" \\\"$(SRCROOT)/../../../../cocos/2d/platform/ios\\\" \\\"$(SRCROOT)/../../../../cocos/physics\\\" \\\"$(SRCROOT)/../../../protocols/include\\\"\";\n\t\t\t\tVALID_ARCHS = \"armv6 armv7 i386\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t1D6058950D05DD3E006BFB54 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCODE_SIGN_IDENTITY = \"\";\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"\";\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tGCC_INLINES_ARE_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = Prefix.pch;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\tCC_ENABLE_CHIPMUNK_INTEGRATION,\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_VERSION = \"\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tPRODUCT_NAME = HelloPlugins;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\\\"$(SRCROOT)/../../../../cocos/math/kazmath/include\\\" \\\"$(SRCROOT)/../../../../cocos/base\\\" \\\"$(SRCROOT)/../../../../cocos\\\" \\\"$(SRCROOT)/../../../../cocos/2d\\\" \\\"$(SRCROOT)/../../../../cocos/2d/platform/ios\\\" \\\"$(SRCROOT)/../../../../cocos/physics\\\" \\\"$(SRCROOT)/../../../protocols/include\\\"\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tC01FCF4F08A954540054247B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_VERSION = \"\";\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALID_ARCHS = \"armv6 armv7 i386\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tC01FCF5008A954540054247B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_VERSION = \"\";\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tOTHER_CFLAGS = \"-DNS_BLOCK_ASSERTIONS=1\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tVALID_ARCHS = \"armv6 armv7 i386\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget \"HelloPlugins\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t1D6058940D05DD3E006BFB54 /* Debug */,\n\t\t\t\t1D6058950D05DD3E006BFB54 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n\t\tC01FCF4E08A954540054247B /* Build configuration list for PBXProject \"HelloPlugins\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tC01FCF4F08A954540054247B /* Debug */,\n\t\t\t\tC01FCF5008A954540054247B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Debug;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 29B97313FDCFA39411CA2CEA /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.ios/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleDisplayName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleIconFile</key>\n\t<string>Icon-57.png</string>\n\t<key>CFBundleIconFiles</key>\n\t<array>\n\t\t<string>Icon.png</string>\n\t\t<string>Icon@2x.png</string>\n\t\t<string>Icon-57.png</string>\n\t\t<string>Icon-114.png</string>\n\t\t<string>Icon-72.png</string>\n\t\t<string>Icon-144.png</string>\n\t</array>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.cocos2dx.HelloPlugins</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string></string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UIAppFonts</key>\n\t<array/>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.ios/RootViewController.h",
    "content": "#import <UIKit/UIKit.h>\n\n\n@interface RootViewController : UIViewController {\n\n}\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.ios/RootViewController.mm",
    "content": "#import \"RootViewController.h\"\n\n\n@implementation RootViewController\n\n/*\n // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.\n- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {\n    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {\n        // Custom initialization\n    }\n    return self;\n}\n*/\n\n/*\n// Implement loadView to create a view hierarchy programmatically, without using a nib.\n- (void)loadView {\n}\n*/\n\n/*\n// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.\n- (void)viewDidLoad {\n    [super viewDidLoad];\n}\n \n*/\n// Override to allow orientations other than the default portrait orientation.\n// This method is deprecated on ios6\n- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {\n    return UIInterfaceOrientationIsLandscape( interfaceOrientation );\n}\n\n// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead\n- (NSUInteger) supportedInterfaceOrientations{\n#ifdef __IPHONE_6_0\n    return UIInterfaceOrientationMaskAllButUpsideDown;\n#endif\n}\n\n- (BOOL) shouldAutorotate {\n    return YES;\n}\n\n- (void)didReceiveMemoryWarning {\n    // Releases the view if it doesn't have a superview.\n    [super didReceiveMemoryWarning];\n    \n    // Release any cached data, images, etc that aren't in use.\n}\n\n- (void)viewDidUnload {\n    [super viewDidUnload];\n    // Release any retained subviews of the main view.\n    // e.g. self.myOutlet = nil;\n}\n\n\n- (void)dealloc {\n    [super dealloc];\n}\n\n\n@end\n"
  },
  {
    "path": "cocos2d/plugin/samples/HelloPlugins/proj.ios/main.m",
    "content": "#import <UIKit/UIKit.h>\n\nint main(int argc, char *argv[]) {\n    \n    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];\n    int retVal = UIApplicationMain(argc, argv, nil, @\"AppController\");\n    [pool release];\n    return retVal;\n}\n"
  },
  {
    "path": "cocos2d/plugin/tools/android/build_common.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"\" default=\"debug\">\n\n    <!-- link jar files -->\n    <property name=\"myjar.libs.dir\" value=\"./sdk\" />\n    <target name=\"-pre-compile\" depends=\"check-dependens\">\n        \n        <path id=\"depend.projects.jar\">\n            <fileset file=\"${project.jar.1}\" />\n            <fileset file=\"${project.jar.2}\" />\n        </path>\n        \n        <if condition=\"${jarExisted}\">\n            <then>\n                <path id=\"project.all.jars.path\">\n                    <path refid=\"depend.projects.jar\" />\n                    <fileset dir=\"${myjar.libs.dir}\" includes=\"*.jar\" />\n                </path>\n            </then>\n        </if>\n    </target>\n\n    <import file=\"${sdk.dir}/tools/ant/build.xml\" />\n\n    <!-- rename the jar file -->\n    <target name=\"plugin-publish\" depends=\"release\">\n\t\t<copy file=\"${out.absolute.dir}/classes.jar\" tofile=\"${out.absolute.dir}/${ant.project.name}.jar\" />\n\n\t\t<!-- delete temp files -->\n        <delete>\n\t\t\t<fileset dir=\"${out.absolute.dir}\" includes=\"build.prop AndroidManifest.xml.d jarlist.cache classes.jar\"/>\n\t\t</delete>\n    </target>\n\n    <!-- check the project & jars which current project dependents --> \n    <target name=\"check-dependens\">\n\n        <!-- check the sdk dir is existed or not -->\n        <condition property=\"jarExisted\">\n            <and>\n                <available file=\"${myjar.libs.dir}\" /> \n            </and>\n        </condition>\n\n        <!-- check the projects dependents -->\n        <condition property=\"have.proj.1\">\n            <isset property=\"android.library.reference.1\" />   \n        </condition>\n        <if condition=\"${have.proj.1}\">\n            <then>\n                <property name=\"project.jar.1\" value=\"${android.library.reference.1}/bin/classes.jar\" />\n            </then>\n        </if>\n\n        <condition property=\"have.proj.2\">\n            <isset property=\"android.library.reference.2\" />   \n        </condition>\n        <if condition=\"${have.proj.2}\">\n            <then>\n                <property name=\"project.jar.2\" value=\"${android.library.reference.2}/bin/classes.jar\" />\n            </then>\n        </if>\n    </target>\n</project>\n"
  },
  {
    "path": "cocos2d/plugin/tools/android-build.py",
    "content": "#!/usr/bin/python\n# android-build.py\n# Build android samples\n\nimport sys\nimport os, os.path\nimport shutil\nfrom optparse import OptionParser\n\nCPP_SAMPLES = [\"HelloPlugins\"]\nJSB_SAMPLES = [\"HelloIAP-JS\", \"HelloAnalytics-JS\"]\nALL_SAMPLES = CPP_SAMPLES + JSB_SAMPLES\n\ndef check_environment_variables():\n    ''' Checking the environment NDK_ROOT, which will be used for building\n    '''\n\n    try:\n        NDK_ROOT = os.environ['NDK_ROOT']\n    except Exception:\n        print \"NDK_ROOT not defined. Please define NDK_ROOT in your environment\"\n        sys.exit(1)\n\n    return NDK_ROOT\n\ndef select_toolchain_version():\n    '''Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select gcc4.7 when\n    using ndk-r8e. But gcc4.7 is removed in ndk-r9, so we should determine whether gcc4.7 exist.\n    Conclution:\n    ndk-r8e  -> use gcc4.7\n    ndk-r9   -> use gcc4.8\n    '''\n\n    ndk_root = check_environment_variables()\n    if os.path.isdir(os.path.join(ndk_root,\"toolchains/arm-linux-androideabi-4.8\")):\n        os.environ['NDK_TOOLCHAIN_VERSION'] = '4.8'\n        print \"The Selected NDK toolchain version was 4.8 !\"\n    elif os.path.isdir(os.path.join(ndk_root,\"toolchains/arm-linux-androideabi-4.7\")):\n        os.environ['NDK_TOOLCHAIN_VERSION'] = '4.7'\n        print \"The Selected NDK toolchain version was 4.7 !\"\n    else:\n        print \"Couldn't find the gcc toolchain.\"\n        exit(1)\n\ndef caculate_built_samples(args):\n    ''' Compute the sampels to be built\n    'cpp' for short of all cpp samples\n    'jsb' for short of all javascript samples\n    '''\n\n    if 'all' in args:\n        return ALL_SAMPLES\n\n    if 'jsb' in args:\n        return JSB_SAMPLES\n\n    if 'cpp' in args:\n        return CPP_SAMPLES\n\n    targets = []\n    targets += args\n\n    # remove duplicate elements, for example\n    # python android-build.py cpp hellocpp\n    targets = set(targets)\n    return list(targets)\n\ndef do_build(plugin_root, cocos_root, ndk_root, app_android_root, ndk_build_param):\n\n    ndk_path = os.path.join(ndk_root, \"ndk-build\")\n\n    # windows should use \";\" to seperate module paths\n    platform = sys.platform\n    if platform == 'win32':\n        ndk_module_path = 'NDK_MODULE_PATH=%s/publish;%s;%s/external;%s/cocos' % (plugin_root, cocos_root, cocos_root, cocos_root)\n    else:\n        ndk_module_path = 'NDK_MODULE_PATH=%s/publish:%s:%s/external:%s/cocos' % (plugin_root, cocos_root, cocos_root, cocos_root)\n\n    if ndk_build_param == None:\n        command = '%s -C %s %s' % (ndk_path, app_android_root, ndk_module_path)\n    else:\n        command = '%s -C %s %s %s' % (ndk_path, app_android_root, ndk_build_param, ndk_module_path)\n    os.system(command)\n\ndef copy_files(src, dst):\n\n    for item in os.listdir(src):\n        path = os.path.join(src, item)\n        # Android can not package the file that ends with \".gz\"\n        if not item.startswith('.') and not item.endswith('.gz') and os.path.isfile(path):\n            shutil.copy(path, dst)\n        if os.path.isdir(path):\n            new_dst = os.path.join(dst, item)\n            if not os.path.exists(new_dst):\n                os.mkdir(new_dst)\n            copy_files(path, new_dst)\n\ndef copy_resources(target, app_android_root, plugin_root):\n\n    # remove app_android_root/assets if it exists\n    assets_dir = os.path.join(app_android_root, \"assets\")\n    if os.path.isdir(assets_dir):\n        shutil.rmtree(assets_dir)\n\n    # copy resources(cpp samples and lua samples)\n    os.mkdir(assets_dir)\n    resources_dir = os.path.join(app_android_root, \"../Resources\")\n    if os.path.isdir(resources_dir):\n        copy_files(resources_dir, assets_dir)\n\n    # jsb samples should copy javascript files and resources(shared with cocos2d-html5)\n    if target in JSB_SAMPLES:\n        resources_dir = os.path.join(app_android_root, \"../../../../cocos/scripting/javascript/script\")\n        copy_files(resources_dir, assets_dir)\n        resources_dir = os.path.join(plugin_root, \"jsbindings/js\")\n        copy_files(resources_dir, assets_dir)\n\n    # copy plugin resources to the assets\n    plugins_dir = os.path.join(plugin_root, \"publish\" + os.path.sep + \"plugins\")\n    for item in os.listdir(plugins_dir):\n        src = os.path.join(plugins_dir, item + os.path.sep + \"android\" + os.path.sep + \"ForAssets\")\n        if os.path.isdir(src):\n            copy_files(src, assets_dir)\n\ndef copy_clibs(app_android_root, plugin_root):\n    target_cpath = os.path.join(app_android_root, \"libs\")\n    plugins_dir = os.path.join(plugin_root, \"publish\" + os.path.sep + \"plugins\")\n    for item in os.listdir(plugins_dir):\n        src = os.path.join(plugins_dir, item + os.path.sep + \"android\" + os.path.sep + \"CLibs\")\n        if os.path.isdir(src):\n            if not os.path.exists(target_cpath):\n                os.mkdir(target_cpath)\n            copy_files(src, target_cpath)\n\ndef build_samples(target,ndk_build_param):\n\n    ndk_root = check_environment_variables()\n    select_toolchain_version()\n    build_targets = caculate_built_samples(target)\n\n    current_dir = os.path.dirname(os.path.realpath(__file__))\n    cocos_root = os.path.join(current_dir, \"../../\")\n    plugin_root = os.path.join(current_dir, \"..\")\n\n    app_android_root = ''\n    for target in build_targets:\n        app_android_root = os.path.join(plugin_root, \"samples\" + os.path.sep + target + os.path.sep + \"proj.android\")\n\n        copy_resources(target, app_android_root, plugin_root)\n        do_build(plugin_root, cocos_root, ndk_root, app_android_root, ndk_build_param)\n        copy_clibs(app_android_root, plugin_root)\n\n# -------------- main --------------\nif __name__ == '__main__':\n\n    usage = \"\"\"usage: %prog [options] target\n    \n    Valid targets are: [HelloPlugins|HelloIAP-JS|HelloAnalytics-JS]\n\n    You can use [all|cpp|jsb], to build all, or all the C++, or all the JavaScript samples respectevely.\"\"\"\n\n    #parse the params\n    parser = OptionParser(usage=usage)\n    parser.add_option(\"-n\", \"--ndk\", dest=\"ndk_build_param\", \n    help='parameter for ndk-build')\n    (opts, args) = parser.parse_args()\n\n    if len(args) == 0:\n        parser.print_help()\n    else:\n        build_samples(args, opts.ndk_build_param)\n"
  },
  {
    "path": "cocos2d/plugin/tools/config.sh",
    "content": "#define plugins array \nexport ALL_PLUGINS=(\"flurry\" \"umeng\" \\\n\"alipay\" \"nd91\" \\\n\"admob\" \\\n\"twitter\" \"weibo\" \\\n\"qh360\" \"uc\")\n\n# define the plugin root directory & publish target directory\nexport TARGET_DIR_NAME=\"publish\"\nif [ ! ${PLUGIN_ROOT} ]; then\n    pushd ../\n    export PLUGIN_ROOT=`pwd`\n    popd\nfi\nexport TARGET_ROOT=${PLUGIN_ROOT}/${TARGET_DIR_NAME}\necho PLUGIN_ROOT = ${PLUGIN_ROOT}\necho TARGET_ROOT = ${TARGET_ROOT}\n\n# get a string include all plugins name(separate with ':')\nexport PLUGINS_CAN_SELECT=\"\"\nPLUGIN_NUM=${#ALL_PLUGINS[@]}\nfor ((i=0; i<${PLUGIN_NUM}; i++))\ndo\n    plugin_name=${ALL_PLUGINS[$i]}\n    PLUGINS_CAN_SELECT=${PLUGINS_CAN_SELECT}${plugin_name}\n    if [ $i -ne $((${PLUGIN_NUM}-1)) ]; then\n        PLUGINS_CAN_SELECT=${PLUGINS_CAN_SELECT}\":\"\n    fi\ndone\n"
  },
  {
    "path": "cocos2d/plugin/tools/gameDevGuide.sh",
    "content": "SHELL_DIR=$(cd \"$(dirname \"$0\")\"; pwd)\n\ntype gawk >/dev/null 2>&1 || { echo >&2 \"gawk is required, PLZ install it first.\"; exit 1; }\n\npushd ${SHELL_DIR}\n\n# include the config\nsource ./config.sh\n\n# show dialog for continue\npython ./toolsForGame/main.py ${PLUGINS_CAN_SELECT}\n\npopd\n"
  },
  {
    "path": "cocos2d/plugin/tools/publish.sh",
    "content": "SHELL_DIR=$(cd \"$(dirname \"$0\")\"; pwd)\n\npushd ${SHELL_DIR}\n\nsource ./config.sh\n\nif [ -d ${TARGET_ROOT} ]; then\n    rm -rf ${TARGET_ROOT}\nfi\nmkdir -p ${TARGET_ROOT}\n\n#check the environment\n./toolsForPublish/checkEnvironment.sh\nsource ./toolsForPublish/environment.sh\n\n# output the number of plugins\nif [ $1 ]; then\n    plugins=(${1//:/ })\nelse\n    plugins=(`echo ${ALL_PLUGINS[@]}`)\nfi\n\nlength=${#plugins[@]}\necho\necho Now have ${length} plugins\necho\n\n#publish protocols\necho\necho Now publish protocols\necho ---------------------------------\n./toolsForPublish/publishPlugin.sh \"protocols\" ${TARGET_ROOT} ${PLUGIN_ROOT}\necho ---------------------------------\n\n#publish plugins\nfor plugin_name in ${plugins[@]}\ndo\n    echo\n    echo Now publish ${plugin_name}\n    echo ---------------------------------\n    ./toolsForPublish/publishPlugin.sh \"plugins/\"${plugin_name} ${TARGET_ROOT} ${PLUGIN_ROOT}\n    echo ---------------------------------\ndone\n\necho\n\npopd\n"
  },
  {
    "path": "cocos2d/plugin/tools/tojs/.gitignore",
    "content": ".DS_Store\ngen/\n*.pyc\nuser.cfg\nuserconf.ini\n"
  },
  {
    "path": "cocos2d/plugin/tools/tojs/conversions.yaml",
    "content": "definitions:\n  # the names of the functions - we use this to generate the code and to register the functions in\n  # the javascript class\n  ifunction: \"js_${generator.prefix}_${class_name}_${func_name}\"\n  sfunction: \"js_${generator.prefix}_${class_name}_${func_name}\"\n  constructor: \"js_${generator.prefix}_${class_name}_constructor\"\nconversions:\n  # some times you want to use a special native type when converting from spidermonkey to native\n  # the most common case would be from JS-boolean to bool. Using \"bool\" will fail here since we\n  # pass the address to the conversion method, and a JSBool is defined as an integer in spidermonkey\n  native_types:\n    bool: \"JSBool\"\n    float: \"double\"\n    short: \"int32_t\"\n    \"unsigned char\": \"uint16_t\"\n    \"char\": \"int32_t\"\n  to_native:\n    # jsval to int\n    int: \"ok &= jsval_to_int32(cx, ${in_value}, (int32_t *)&${out_value})\"\n    \"unsigned int\": \"ok &= jsval_to_uint32(cx, ${in_value}, &${out_value})\"\n    \"unsigned char\": \"ok &= jsval_to_uint16(cx, ${in_value}, &${out_value})\"\n    short: \"ok &= jsval_to_int32(cx, ${in_value}, &${out_value})\"\n    char: \"ok &= jsval_to_int32(cx, ${in_value}, &${out_value})\"\n    bool: \"ok &= JS_ValueToBoolean(cx, ${in_value}, &${out_value})\"\n    float: \"ok &= JS_ValueToNumber(cx, ${in_value}, &${out_value})\"\n    double: \"ok &= JS_ValueToNumber(cx, ${in_value}, &${out_value})\"\n    # jsval has to be a TypedArray, a UInt32Array with 2 elements\n    \"long long\": \"ok &= jsval_to_long_long(cx, ${in_value}, &${out_value})\"\n    \"std::string\": \"ok &= jsval_to_std_string(cx, ${in_value}, &${out_value})\"\n    \"char*\": \"std::string ${out_value}_tmp; ok &= jsval_to_std_string(cx, ${in_value}, &${out_value}_tmp); ${out_value} = ${out_value}_tmp.c_str()\"\n    object: |\n      do {\n      ${($level + 1) * '\\t'}js_proxy_t *proxy;\n      ${($level + 1) * '\\t'}JSObject *tmpObj = JSVAL_TO_OBJECT(${in_value});\n      ${($level + 1) * '\\t'}JS_GET_NATIVE_PROXY(proxy, tmpObj);\n      ${($level + 1) * '\\t'}${out_value} = (${ntype})(proxy ? proxy->ptr : NULL);\n      ${($level + 1) * '\\t'}JSB_PRECONDITION2( ${out_value}, cx, JS_FALSE, \"Invalid Native Object\");\n      ${($level + 0) * '\\t'}} while (0)\n    TProductInfo: \"ok &= jsval_to_TProductInfo(cx, ${in_value}, &${out_value})\"\n    TIAPDeveloperInfo: \"ok &= jsval_to_TIAPDeveloperInfo(cx, ${in_value}, &${out_value})\"\n    TPaymentInfo: \"ok &= jsval_to_TPaymentInfo(cx, ${in_value}, &${out_value})\"\n    TAdsDeveloperInfo: \"ok &= jsval_to_TAdsDeveloperInfo(cx, ${in_value}, &${out_value})\"\n    TAdsInfo: \"ok &= jsval_to_TAdsInfo(cx, ${in_value}, &${out_value})\"\n    TShareDeveloperInfo: \"ok &= jsval_to_TShareDeveloperInfo(cx, ${in_value}, &${out_value})\"\n    TShareInfo: \"ok &= jsval_to_TShareInfo(cx, ${in_value}, &${out_value})\"\n    TUserDeveloperInfo: \"ok &= jsval_to_TUserDeveloperInfo(cx, ${in_value}, &${out_value})\"\n    TSocialDeveloperInfo: \"ok &= jsval_to_TSocialDeveloperInfo(cx, ${in_value}, &${out_value})\"\n    TAchievementInfo: \"ok &= jsval_to_TAchievementInfo(cx, ${in_value}, &${out_value})\"\n    LogEventParamMap*: |\n      LogEventParamMap ${out_value}_tmp;\n      ${($level + 0) * '\\t'}do {\n      ${($level + 1) * '\\t'}ok &= jsval_to_LogEventParamMap(cx, ${in_value}, &${out_value});\n      ${($level + 1) * '\\t'}if (ok) { ${out_value}_tmp = *${out_value}; delete ${out_value}; ${out_value} = &${out_value}_tmp; } else { ${out_value} = NULL; }\n      ${($level + 0) * '\\t'}} while(0)\n    long: \"ok &= jsval_to_long(cx, ${in_value}, (long *)&${out_value})\"\n\n  from_native:\n    # int to jsval\n    int: \"${out_value} = int32_to_jsval(cx, ${in_value})\"\n    \"unsigned int\": \"${out_value} = uint32_to_jsval(cx, ${in_value})\"\n    \"unsigned char\": \"${out_value} = uint32_to_jsval(cx, ${in_value})\"\n    \"long long\": \"${out_value} = long_long_to_jsval(cx, ${in_value})\"\n    \"std::string\": \"${out_value} = std_string_to_jsval(cx, ${in_value})\"\n    \"char*\": \"${out_value} = c_string_to_jsval(cx, ${in_value})\"\n    bool: \"${out_value} = BOOLEAN_TO_JSVAL(${in_value})\"\n    float: \"${out_value} = DOUBLE_TO_JSVAL(${in_value})\"\n    double: \"${out_value} = DOUBLE_TO_JSVAL(${in_value})\"\n    TProductInfo: \"${out_value} = TProductInfo_to_jsval(cx, ${in_value})\"\n    LogEventParamMap*: \"${out_value} = LogEventParamMap_to_jsval(cx, ${in_value})\"\n    long: \"${out_value} = long_to_jsval(cx, ${in_value})\"\n\n    object: |\n      do {\n      ${($level + 1) * '\\t'}if (${in_value}) {\n      ${($level + 2) * '\\t'}js_proxy_t *proxy = js_get_or_create_proxy<${ntype.replace(\"*\", \"\")}>(cx, ${in_value});\n      ${($level + 2) * '\\t'}${out_value} = OBJECT_TO_JSVAL(proxy->obj);\n      ${($level + 1) * '\\t'}} else {\n      ${($level + 2) * '\\t'}${out_value} = JSVAL_NULL;\n      ${($level + 1) * '\\t'}}\n      ${($level) * '\\t'}} while (0)\n\n"
  },
  {
    "path": "cocos2d/plugin/tools/tojs/genbindings-all.sh",
    "content": "#!/bin/bash\n\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n# ... use paths relative to current directory\nPLUGIN_ROOT=\"$DIR/../..\"\nCXX_GENERATOR_ROOT=\"$DIR/../../../tools/bindings-generator\"\n# Delete the output directory\nif [ -d $PLUGIN_ROOT/jsbindings/auto ]; then\n    echo \"Delete the output directory.\"\n    rm -r $PLUGIN_ROOT/jsbindings/auto\nelse\n    echo \"Output directory doesn't exist.\"\nfi\n\ncheck_return_value()\n{\n    if [ $? -ne 0 ]; then\n        echo \"*** genbindings plugin ( $1 ) jsbindings fails. ***\"\n        if [ -e $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup ]; then\n            echo \"Restoring conversions.yaml ...\"\n            mv $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml\n        fi\n        exit 1\n    else\n        echo \"--- genbindings plugin ( $1 ) jsbindings succeed. ---\"\n    fi\n}\n\n./genbindings.sh \"protocols\"\ncheck_return_value \"protocols\"\n\necho \"--- Generating all jsbindings glue codes for pluginx succeed. :) --- \"\n"
  },
  {
    "path": "cocos2d/plugin/tools/tojs/genbindings.sh",
    "content": "#!/bin/bash\n\nif [ -z $1 ]; then\n    echo \"*** Please pass an argument which means plugin name. ***\"\n    exit 1\nfi\n\nSUB_DIR=\"$2\"\nPLUGIN_NAME=\"$1\"\nINI_NAME=\"jsb_$PLUGIN_NAME.ini\"\nOUTPUT_FILENAME=\"jsb_pluginx_\"$PLUGIN_NAME\"_auto\"\n\necho \"--------------\"\necho \"plugin name: $PLUGIN_NAME\"\necho \"ini filename: $INI_NAME\"\necho \"output filename: $OUTPUT_FILENAME\"\necho \"--------------\"\n\n# exit this script if any commmand fails\nset -e\n\n# read user.cfg if it exists and is readable\n\n_CFG_FILE=$(dirname \"$0\")\"/user.cfg\"\nif [ -f \"$_CFG_FILE\" ]\nthen\n    [ -r \"$_CFG_FILE\" ] || die \"Fatal Error: $_CFG_FILE exists but is unreadable\"\n    . \"$_CFG_FILE\"\nfi\n\n# paths\n\nif [ -z \"${NDK_ROOT+aaa}\" ]; then\n# ... if NDK_ROOT is not set, use \"$HOME/bin/android-ndk\"\n    NDK_ROOT=\"$HOME/bin/android-ndk\"\nfi\n\nif [ -z \"${CLANG_ROOT+aaa}\" ]; then\n# ... if CLANG_ROOT is not set, use \"$HOME/bin/clang+llvm-3.1\"\n    CLANG_ROOT=\"$HOME/bin/clang+llvm-3.1\"\nfi\n\nif [ -z \"${PYTHON_BIN+aaa}\" ]; then\n# ... if PYTHON_BIN is not set, use \"/usr/bin/python2.7\"\n    PYTHON_BIN=\"/usr/bin/python2.7\"\nfi\n\n# find current dir\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\n# paths with defaults hardcoded to relative paths\n\nif [ -z \"${PLUGINX_ROOT+aaa}\" ]; then\n    PLUGINX_ROOT=\"$DIR/../..\"\nfi\n\nif [ -z \"${CXX_GENERATOR_ROOT+aaa}\" ]; then\n    CXX_GENERATOR_ROOT=\"$PLUGINX_ROOT/../tools/bindings-generator\"\nfi\n\nif [ -z \"${TOJS_ROOT+aaa}\" ]; then\n    TO_JS_ROOT=\"$PLUGINX_ROOT/tools/tojs\"\nfi\n\necho \"Paths\"\necho \"    NDK_ROOT: $NDK_ROOT\"\necho \"    CLANG_ROOT: $CLANG_ROOT\"\necho \"    PYTHON_BIN: $PYTHON_BIN\"\necho \"    PLUGINX_ROOT: $PLUGINX_ROOT\"\necho \"    CXX_GENERATOR_ROOT: $CXX_GENERATOR_ROOT\"\necho \"    TO_JS_ROOT: $TO_JS_ROOT\"\n\n# write userconf.ini\n\n_CONF_INI_FILE=\"$PWD/userconf.ini\"\nif [ -f \"$_CONF_INI_FILE\" ]\nthen\n    rm \"$_CONF_INI_FILE\"\nfi\n\n_CONTENTS=\"\"\n_CONTENTS+=\"[DEFAULT]\"'\\n'\n_CONTENTS+=\"androidndkdir=$NDK_ROOT\"'\\n'\n_CONTENTS+=\"clangllvmdir=$CLANG_ROOT\"'\\n'\n_CONTENTS+=\"pluginxdir=$PLUGINX_ROOT\"'\\n'\n_CONTENTS+=\"cxxgeneratordir=$CXX_GENERATOR_ROOT\"'\\n'\necho \necho \"generating userconf.ini...\"\necho ---\necho -e \"$_CONTENTS\"\necho -e \"$_CONTENTS\" > \"$_CONF_INI_FILE\"\necho ---\n\n# Generate bindings for plugin-x $PLUGIN_NAME\necho \"Generating bindings for plugin-x $PLUGIN_NAME...\"\nset -x\nmv $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup\ncp conversions.yaml $CXX_GENERATOR_ROOT/targets/spidermonkey\n\nLD_LIBRARY_PATH=${CLANG_ROOT}/lib \\\n$PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py -t spidermonkey ${PLUGINX_ROOT}/${SUB_DIR}$PLUGIN_NAME/$INI_NAME -s $PLUGIN_NAME -o $PLUGINX_ROOT/jsbindings/auto -n $OUTPUT_FILENAME\n\nmv $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml\n\n# modify the include file \n# #include \"cocos2d_specifics.hpp\" -->\n# #include \"jsb_pluginx_spidermonkey_specifics.h\"\n# #include \"jsb_pluginx_basic_conversions.h\"\n\n./modify_include.sed $PLUGINX_ROOT/jsbindings/auto/$OUTPUT_FILENAME.cpp > $PLUGINX_ROOT/jsbindings/auto/$OUTPUT_FILENAME.cpp.origin\nmv $PLUGINX_ROOT/jsbindings/auto/$OUTPUT_FILENAME.cpp.origin $PLUGINX_ROOT/jsbindings/auto/$OUTPUT_FILENAME.cpp\n"
  },
  {
    "path": "cocos2d/plugin/tools/tojs/modify_include.sed",
    "content": "#!/usr/bin/sed -f\n/#include \"cocos2d_specifics.hpp\"/c\\\n#include \"jsb_pluginx_spidermonkey_specifics.h\"\\\n#include \"jsb_pluginx_basic_conversions.h\"\\\nusing namespace pluginx;\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/addPluginForGame.sh",
    "content": "SHELL_DIR=$(cd \"$(dirname \"$0\")\"; pwd)\n\nGAME_PROJECT_DIR=$1\nSELECTED_PLUGINS=(${2//:/ })\n\n# if project path is end with '/', delete it\nEND_CHAR=${GAME_PROJECT_DIR:$((${#GAME_PROJECT_DIR}-1)):1}\nif [ ${END_CHAR} = \"/\" ]; then\n    GAME_PROJECT_DIR=${GAME_PROJECT_DIR%/}\nfi\n\n# check the game project path\nif [ -d \"${GAME_PROJECT_DIR}\" -a -f \"${GAME_PROJECT_DIR}/AndroidManifest.xml\" ]; then\n    echo \"Game project path : ${GAME_PROJECT_DIR}\"\n    echo \"selected plugins  : ${SELECTED_PLUGINS[@]}\"\nelse\n    echo \"Game project path is wrong.(Not an android project directory)\"\n    exit 1\nfi\n\ngetPathForSystem()\n{\n    START_WITH_CYGWIN=`echo $1 | grep '^/cygdrive/'`\n    if [ -z \"${START_WITH_CYGWIN}\" ]; then\n        echo \"$1\"\n    else\n        RET=${START_WITH_CYGWIN#/cygdrive/}\n        RET=${RET/\\//:/}\n        echo \"${RET}\"\n    fi\n}\n\npushd ${SHELL_DIR}/../\n\nsource ./config.sh\n\n# check publish directory \nif [ -d \"${TARGET_ROOT}\" ]; then\n    # add protocols name to build\n    export NEED_PUBLISH=\"protocols\":$2\n    \n    # Modify mk file\n    MK_FILE_PATH=\"${GAME_PROJECT_DIR}\"/jni/Android.mk\n    ${SHELL_DIR}/modifyMK.sh \"${MK_FILE_PATH}\"\n    \n    # Modify Application.mk file (add stl & rtti configuration)\n    APP_MK_FILE_PATH=\"${GAME_PROJECT_DIR}\"/jni/Application.mk\n    ${SHELL_DIR}/modifyAppMK.sh \"${APP_MK_FILE_PATH}\"\n    \n    # Combin ForRes directory to the res directory of game project\n    GAME_RES_DIR=\"${GAME_PROJECT_DIR}\"/res\n    ${SHELL_DIR}/modifyRes.sh \"${GAME_RES_DIR}\"\n    \n    # get system dir\n    SYS_TARGET_ROOT=$(getPathForSystem ${TARGET_ROOT})\n    SYS_SHELL_DIR=$(getPathForSystem ${SHELL_DIR})\n    SYS_PROJ_DIR=$(getPathForSystem ${GAME_PROJECT_DIR})\n    \n    # Modify .project file (link publish directory to the game project)\n    PROJECT_FILE_PATH=\"${SYS_PROJ_DIR}\"/.project\n    python ${SYS_SHELL_DIR}/modifyProject.py \"${PROJECT_FILE_PATH}\" \"${SYS_TARGET_ROOT}\"\n    \n    # Modify .classpath file (link jar files for game project)\n    CLASSPATH_FILE=\"${SYS_PROJ_DIR}\"/.classpath\n    python ${SYS_SHELL_DIR}/modifyClassPath.py \"${CLASSPATH_FILE}\" \"${NEED_PUBLISH}\" \"${SYS_TARGET_ROOT}\"\n    \n    # Modify AndroidManifest.xml file (add permission & add activity info)\n    MANIFEST_FILE=\"${SYS_PROJ_DIR}\"/AndroidManifest.xml\n    python ${SYS_SHELL_DIR}/modifyManifest.py \"${MANIFEST_FILE}\" \"$2\" \"${SYS_TARGET_ROOT}\"\nelse\n    echo \"PLZ run the publish.sh script first\"\n    popd\n    exit 1\nfi\n\npopd\n\nexit 0\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/main.py",
    "content": "import sys, string, os\nfrom Tkinter import *\nimport steps\n\nPlugins = sys.argv[1]\n\nprint Plugins\n\npluginList = Plugins.split(':')\nmaxStep = 2\ncurStep = 1\n\nstepList = []\n\n# functions\n# show step on the num index\ndef showStep(num):\n    global stepList\n    stepNum = len(stepList)\n    if num >= stepNum or num <= 0 :\n        pass\n    \n    i = 0\n    while i < stepNum:\n        if i == num:\n            stepList[i].stepFrame.pack(fill=BOTH, anchor='nw')\n        else:\n            stepList[i].stepFrame.pack_forget()\n        i += 1\n\n# update the pre & next buttons status\ndef updateBtnState():\n    global curStep\n    global btnNextStep\n    global btnPreStep\n    if curStep == 1:\n        btnPreStep['state'] = DISABLED\n        btnNextStep['state'] = NORMAL\n        btnNextStep['text'] = 'Next'\n    elif curStep == maxStep:\n        btnPreStep['state'] = NORMAL\n        btnNextStep['state'] = NORMAL\n        btnNextStep['text'] = 'Finish'\n    else:\n        btnPreStep['state'] = NORMAL\n        btnNextStep['state'] = NORMAL\n        btnNextStep['text'] = 'Next'\n\n# next button clicked\ndef nextStep():\n    if btnNextStep['text'] == 'close':\n        root.quit()\n        return\n    \n    global curStep\n    nowStepObj = stepList[curStep - 1]\n    bRet = nowStepObj.checkStep()\n    if bRet != None:\n        stepError['text'] = bRet\n        return\n    else:\n        stepError['text'] = ''\n    \n    if curStep < maxStep:\n        curStep += 1\n        showStep(curStep - 1)\n        updateBtnState()\n    elif curStep == maxStep:\n        # disable buttons when process\n        btnPreStep['state'] = DISABLED\n        btnNextStep['state'] = DISABLED\n        \n        # get user input arguments\n        projPath = stepList[0].getPath()\n        plugins = stepList[1].getSelectedPlugins()\n        strPlugins = ''\n        i = 0\n        while i < len(plugins):\n            strPlugins += \"plugins/\"\n            strPlugins += plugins[i]\n            if i != (len(plugins) - 1):\n                strPlugins += ':'\n            i += 1\n        \n        # process shell script to modify the game project\n        ret = os.system('bash ./toolsForGame/addPluginForGame.sh ' + projPath + ' ' + strPlugins)\n        \n        if ret != 0:\n            # enable buttons after process\n            btnPreStep['state'] = NORMAL\n            btnNextStep['state'] = NORMAL\n            stepError['text'] = 'Error during process'\n        else:\n            # enable next button & change text to close\n            btnNextStep['state'] = NORMAL\n            btnNextStep['text'] = 'close'\n            stepError['text'] = 'Process Successful!'\n\n# pre button clicked\ndef preStep():\n    global curStep\n    global stepError\n    stepError['text'] = ''\n    if curStep > 1:\n        curStep -= 1\n        showStep(curStep - 1)\n    \n    updateBtnState()\n\n# init root view\nroot = Tk()\nroot.title('Plugin-x Integration Guide')\nroot.geometry(\"600x400\")\nrootFrame = Frame(root)\nrootFrame.pack(fill=BOTH)\n\n# steps view\nMyStep1 = steps.step1()\nMyStep1.initStep(rootFrame)\nMyStep2 = steps.step2()\nMyStep2.initStep(rootFrame, pluginList)\nstepList.append(MyStep1)\nstepList.append(MyStep2)\n\nMyStep1.stepFrame.pack(fill=BOTH, anchor='nw')\n\n# add step error message\ncontrolFrame = Frame(root)\ncontrolFrame.pack(side=BOTTOM, fill=X, anchor='s')\nstepError = Label(controlFrame)\nstepError.pack(side=LEFT, padx=30)\n\n# add step button\nbtnNextStep = Button(controlFrame, text='Next', command=nextStep)\nbtnPreStep = Button(controlFrame, text='Back', command=preStep, state=DISABLED)\nbtnNextStep.pack(side=RIGHT, padx=30)\nbtnPreStep.pack(side=RIGHT)\n\nroot.mainloop()\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/modifyAppMK.sh",
    "content": "# Modify mk file\nMK_FILE_PATH=$1\nTEMP_FILE_PATH=$(dirname ${MK_FILE_PATH})/tempAppMK.txt\n\nSTL_CFG=\"gnustl_static\"\nCPP_FLAG=\"-frtti\"\n\n# check if mk file existed or not\nif [ -f ${MK_FILE_PATH} ]; then\n    gawk '\n    BEGIN { addSTL = 1; addRTTI = 1; }\n    {\n        if (match($0, /^([\\s]*[^#]*)APP_STL[\\s]*/))\n        {\n            printf \"APP_STL := gnustl_static\\n\";\n            addSTL = 0;\n        } else\n        if (match($0, /^([\\s]*[^#]*)-frtti/))\n        {\n            printf \"%s\\n\",$0;\n            addRTTI = 0;\n        } else\n        {\n            printf \"%s\\n\",$0;\n        }\n    }\n    END {\n        if (addSTL)\n        {\n            printf \"APP_STL := gnustl_static\\n\";\n        }\n        \n        if (addRTTI)\n        {\n            printf \"APP_CPPFLAGS += -frtti\\n\";\n        }\n    }' \"${MK_FILE_PATH}\" > \"${TEMP_FILE_PATH}\"\n    cp -rf ${TEMP_FILE_PATH} ${MK_FILE_PATH}\n    rm -rf ${TEMP_FILE_PATH}\nelse\n    echo \"APP_STL := ${STL_CFG}\" > ${MK_FILE_PATH}\n    echo \"APP_CPPFLAGS += ${CPP_FLAG}\" >> ${MK_FILE_PATH}\nfi\n\nexit 0\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/modifyClassPath.py",
    "content": "import sys, string, os\nfrom xml.etree import ElementTree as ET\nfrom xml.dom import minidom\n\nclassPathFile = sys.argv[1]\npluginStr = sys.argv[2]\npluginsDir = sys.argv[3]\n\ndef getLibElement(pathAttr):\n    ret = ET.Element('classpathentry')\n    ret.set('exported', 'true')\n    ret.set('kind', 'lib')\n    ret.set('path', pathAttr)\n    return ret\n\ndef fomatTree(elem):\n    root_str = ET.tostring(elem, 'UTF-8')\n    reparse = minidom.parseString(root_str)\n    return reparse\n\ntree = ET.parse(classPathFile)\nroot = tree.getroot()\nentryNodes = root.findall('classpathentry')\nlinkedLibs = []\nfor node in entryNodes:\n    entryKind = node.get('kind')\n    entryPath = node.get('path')\n    entryKind = entryKind.strip(' \\n\\r\\t')\n    entryPath = entryPath.strip(' \\n\\r\\t')\n    if entryKind == 'lib' and entryPath.endswith('.jar'):\n        linkedLibs.append(entryPath)\n\nplugins = pluginStr.split(':')\nmodified = False\nfor pluginName in plugins:\n    pluginAndroidDir = pluginsDir + '/' + pluginName + '/android'\n    \n    for fileName in os.listdir(pluginAndroidDir):\n        if os.path.splitext(fileName)[1] == '.jar':\n            needAdd = True\n            for linkedJar in linkedLibs:\n                jarName = os.path.basename(linkedJar)\n                if fileName == jarName:\n                    needAdd = False\n                    break\n            \n            if needAdd:\n                modified = True\n                pathAttr = 'plugin-x/' + pluginName + '/android/' + fileName\n                root.append(getLibElement(pathAttr))\n                linkedLibs.append(pathAttr)\n\nif modified:\n    f = open(classPathFile, 'w')\n    fomatDom = fomatTree(root)\n    fomatDom.writexml(f, '', '\\t', '\\n', 'UTF-8')\n    f.close()\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/modifyMK.sh",
    "content": "# Modify mk file\nMK_FILE_PATH=$1\nTEMP_FILE_PATH=$(dirname ${MK_FILE_PATH})/temp.txt\nSELECTED_PLUGINS=(${NEED_PUBLISH//:/ })\n\n###############################\n# functions used\n###############################\ngetStaticModuleName()\n{\n    #get the library file name created by ndk build\n    #find line with LOCAL_MODULE\n    _FUN_DEFINED_LINE=`grep 'LOCAL_MODULE[ :]' ${TARGET_ROOT}/$1/android/Android.mk`\n    \n    if [ -n \"${_FUN_DEFINED_LINE}\" ]; then\n        _FUN_LIB_FILENAME=${_FUN_DEFINED_LINE#*\\=}\n    fi\n    \n    _FUN_LIB_FILENAME=`echo ${_FUN_LIB_FILENAME} | sed 's/ //g'`\n    echo ${_FUN_LIB_FILENAME}\n}\n\n# check if mk file existed or not\nif [ -f ${MK_FILE_PATH} ]; then\n    ADD_MODULE_STR=\"\"\n    ADD_IMPORT_STR=\"\"\n    for plugin_name in ${SELECTED_PLUGINS[@]}\n    do\n        PLUGIN_MK_FILE=${TARGET_ROOT}/${plugin_name}/android/Android.mk\n        if [ ! -f \"${PLUGIN_MK_FILE}\" ]; then\n            continue\n        fi\n\n        PLUGIN_MODULE_NAME=\"$(getStaticModuleName ${plugin_name})\"\n        HAVE_PLUGIN=`grep \"^\\([\\s]*[^#]*\\)${PLUGIN_MODULE_NAME}\" ${MK_FILE_PATH}`\n        if [ \"${HAVE_PLUGIN}\" ]; then\n            # already have this plugin\n            echo \"Plugin ${plugin_name} have added in Android.mk\"\n            continue\n        else\n            if [ -z \"${ADD_MODULE_STR}\" ]; then\n                ADD_MODULE_STR=${PLUGIN_MODULE_NAME}\n            else\n                ADD_MODULE_STR=\"${ADD_MODULE_STR} ${PLUGIN_MODULE_NAME}\"\n            fi\n            \n            NEW_LINE=\"\\$(call import-module,${plugin_name}/android)\"\n            if [ -z \"${ADD_IMPORT_STR}\" ]; then\n                ADD_IMPORT_STR=${NEW_LINE}\n            else\n                ADD_IMPORT_STR=\"${ADD_IMPORT_STR}:${NEW_LINE}\"\n            fi\n        fi\n    done\n\n    # Modify the mk file if necessary\n    if [ \"${ADD_MODULE_STR}\" ]; then\n        gawk '\n            {\n                ModuleStr=\"'\"$ADD_MODULE_STR\"'\";\n                ImportStr=\"'\"$ADD_IMPORT_STR\"'\";\n                if (match($0, /^([\\s]*[^#]*)LOCAL_WHOLE_STATIC_LIBRARIES/) && ! PROC1)\n                {\n                    PROC1 = 1;\n                    if (match($0, /\\\\$/))\n                    {\n                        printf \"%s\\n\",$0;\n                        printf \"%s \\\\\\n\",ModuleStr;\n                    } else\n                    {\n                        printf \"%s \\\\\\n\",$0;\n                        printf \"%s\\n\",ModuleStr;\n                    }\n                } else\n                if (match($0, /^([\\s]*[^#]*)call[\\s]*import-module/) && ! PROC2)\n                {\n                    printf $0;\n                    split(ImportStr,arr,\":\")\n                    for (j=0; j<length(arr); j++)\n                    {\n                        oneStr=arr[j];\n                        printf \"%s\\n\",oneStr;\n                    }\n                    PROC2 = 1;\n                } else\n                if (match($0, /^([\\s]*[^#]*)include[ \\t]+\\$\\(BUILD_(SHARED|STATIC)_LIBRARY\\)/) && ! PROC1)\n                {\n                    PROC1 = 1;\n                    printf \"\\nLOCAL_WHOLE_STATIC_LIBRARIES := %s\\n\\n\",ModuleStr;\n                    printf \"%s\\n\",$0;\n                } else {\n                    printf \"%s\\n\",$0;\n                }\n            }\n            END {\n                if (! PROC1)\n                {\n                    printf \"\\nLOCAL_WHOLE_STATIC_LIBRARIES := %s\\n\",ModuleStr;\n                }\n                \n                if (! PROC2)\n                {\n                    split(ImportStr,arr,\":\")\n                    for (j=0; j<length(arr); j++)\n                    {\n                        oneStr=arr[j];\n                        printf \"%s\\n\",oneStr;\n                    }\n                }\n            }' ${MK_FILE_PATH} > ${TEMP_FILE_PATH}\n        cp -rf ${TEMP_FILE_PATH} ${MK_FILE_PATH}\n        rm -rf ${TEMP_FILE_PATH}\n    fi\nelse\n    echo \"Can't find Android.mk file\"\nfi\n\nexit 0\n\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/modifyManifest.py",
    "content": "import sys, string, os\nfrom xml.etree import ElementTree as ET\n\nmanifestFile = sys.argv[1]\npluginStr = sys.argv[2]\npluginsDir = sys.argv[3]\n\nandroidNS = 'http://schemas.android.com/apk/res/android'\nsourceCfgFile = '/android/ForManifest.xml'\n\ndef doModify(sourceFile, root):\n    bRet = False\n    sourceTree = ET.parse(sourceFile)\n    sourceRoot = sourceTree.getroot()\n    \n    # get target content\n    f = open(manifestFile)\n    targetContent = f.read()\n    f.close()\n    \n    # check config for application\n    appCfgNode = sourceRoot.find('applicationCfg')\n    if appCfgNode is not None and len(appCfgNode) > 0:\n        appKeyWord = appCfgNode.get('keyword')\n        \n        if appKeyWord != None and len(appKeyWord) > 0:\n            keyIndex = targetContent.find(appKeyWord)\n            if -1 == keyIndex:\n                bRet = True\n                for node in list(appCfgNode):\n                    root.find('application').append(node)\n    \n    # check permission config\n    perCfgNode = sourceRoot.find('permissionCfg')\n    if perCfgNode is not None and len(perCfgNode) > 0:\n        for oneNode in list(perCfgNode):\n            key = '{' + androidNS + '}name'\n            perAttr = oneNode.get(key)\n            if perAttr != None and len(perAttr) > 0:\n                attrIndex = targetContent.find(perAttr)\n                if -1 == attrIndex:\n                    bRet = True\n                    root.append(oneNode)\n    \n    return bRet\n\n# parse file AndroidManifest.xml of game project\nET.register_namespace(\"android\", androidNS)\ntargetTree = ET.parse(manifestFile)\ntargetRoot = targetTree.getroot()\n\n# traverse all plugins\nplugins = pluginStr.split(':')\nfor pluginName in plugins:\n    # find the file 'ForManifest.xml'\n    sourceXml = pluginsDir + '/' + pluginName + sourceCfgFile\n    if not os.path.exists(sourceXml):\n        continue\n    \n    # check & modify target xml\n    haveChanged = doModify(sourceXml, targetRoot)\n    if haveChanged:\n        print 'Modify AndroidManifest.xml for plugin ' + pluginName\n        targetTree.write(manifestFile, 'UTF-8')\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/modifyProject.py",
    "content": "import sys, string, os\nfrom xml.etree import ElementTree as ET\nfrom xml.dom import minidom\n\nprojFile = sys.argv[1]\ntargetPath = sys.argv[2]\n\ndef getLinkElement():\n    global targetPath\n    ret = ET.Element('link')\n    nameEle = ET.Element('name')\n    nameEle.text = 'plugin-x'\n    typeEle = ET.Element('type')\n    typeEle.text = '2'\n    locEle = ET.Element('locationURI')\n    locEle.text = targetPath\n    ret.append(nameEle)\n    ret.append(typeEle)\n    ret.append(locEle)\n    \n    return ret\n\ntree = ET.parse(projFile)\nroot = tree.getroot()\nnodeLinkRes = root.find('linkedResources')\nif nodeLinkRes != None:\n    linkNodes = nodeLinkRes.findall('link')\n    haveTarget = False\n    if linkNodes != None and len(linkNodes) > 0:\n        for node in linkNodes:\n            locNode = node.find('locationURI')\n            if locNode == None:\n                continue\n            tempText = locNode.text\n            tempText = tempText.strip(' \\n\\r\\t')\n            if tempText == targetPath:\n                haveTarget = True\n                break\n    if not haveTarget:\n        nodeLinkRes.append(getLinkElement())\n        tree.write(projFile, 'UTF-8')\nelse:\n    linkResEle = ET.Element('linkedResources')\n    linkResEle.append(getLinkElement())\n    root.append(linkResEle)\n    tree.write(projFile, 'UTF-8')\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/modifyRes.sh",
    "content": "SELECTED_PLUGINS=(${NEED_PUBLISH//:/ })\nfor plugin_name in ${SELECTED_PLUGINS[@]}\ndo\n    SRC_RES_DIR=${TARGET_ROOT}/${plugin_name}/android/ForRes\n    if [ -d \"${SRC_RES_DIR}\" ]; then\n        cp -rf \"${SRC_RES_DIR}\"/* $1\n    fi\ndone\n\nexit 0\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForGame/steps.py",
    "content": "import sys, string, os\nfrom Tkinter import *\n\n# define class step\nclass step:\n    stepFrame = None\n    def initStep(self, root):\n        return\n\n    def checkStep(self):\n        return None\n\n# define class step1\nclass step1(step):\n    step_entry = None\n    def initStep(self, root):\n        self.stepFrame = Frame(root)\n        \n        step_tip = Label(self.stepFrame, text=\"Input the android project path of your game:\")\n        step_tip.pack(anchor='nw', padx=30)\n        step_tip2 = Label(self.stepFrame, text=\"(Pleasd avoid using spaces in your project path)\")\n        step_tip2.pack(anchor='nw', padx=30)\n        self.step_entry = Entry(self.stepFrame)\n        self.step_entry.pack(anchor='nw', fill=X, padx=30)\n        return\n    \n    def checkStep(self):\n        tipStr = None\n        projPath = self.step_entry.get()\n        haveDir = os.path.exists(projPath)\n        isPorj = os.path.exists(projPath + '/AndroidManifest.xml')\n        if projPath == None or len(projPath) == 0 or haveDir == False or isPorj == False:\n            tipStr = 'The project path is wrong'\n        return tipStr\n    \n    def getPath(self):\n        return self.step_entry.get()\n\n# define class step2\nclass step2(step):\n    checkBtns = []\n    checkValues = []\n    def initStep(self, root, pluginList):\n        self.stepFrame = Frame(root)\n        \n        step_tip = Label(self.stepFrame, text=\"Select plugins you needed:\")\n        step_tip.pack(anchor='nw', padx=30)\n        \n        for plugin in pluginList:\n            var = StringVar()\n            self.checkValues.append(var)\n            btn = Checkbutton(self.stepFrame, text=plugin, variable=var, onvalue=plugin, offvalue='')\n            btn.pack(anchor='nw', padx=50)\n            self.checkBtns.append(btn)\n        return\n    \n    def checkStep(self):\n        tipStr = None\n        num = 0\n        for var in self.checkValues:\n            if len(var.get()) != 0:\n                num += 1\n                break\n        \n        if num == 0:\n            tipStr = 'At least select one plugin'\n        return tipStr\n    \n    def getSelectedPlugins(self):\n        selectPlugins = []\n        for var in self.checkValues:\n            if len(var.get()) != 0:\n                plugin = var.get()\n                selectPlugins.append(plugin)\n        return selectPlugins\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForPublish/checkEnvironment.sh",
    "content": "#set android_build_path.sh 's path\nBUILD_PATH_FILE_DIR=$(cd \"$(dirname \"$0\")\"; pwd)\nBUILD_PATH_FILE_NAME=\"environment.sh\"\nBUILD_PATH_FILE_PATH=$BUILD_PATH_FILE_DIR$BUILD_PATH_FILE_NAME\n\nchangeDirFormat()\n{\n    TEMP=\"${1/:/}\"\n    if [ $1 != $TEMP ]; then\n        RET=/cygdrive/$TEMP\n    else\n        RET=$1\n    fi\n    \n    RET=\"${RET//\\\\//}\"\n    END_CHAR=${RET:$((${#RET}-1)):1}\n    if [ ${END_CHAR} = \"/\" ]; then\n        RET=${RET%/}\n    fi\n    \n    echo \"${RET}\"\n}\n\npushd $BUILD_PATH_FILE_DIR\necho\n\n# if $BUILD_PATH_FILE is not exist, then create it.\nif [ ! -f $BUILD_PATH_FILE_NAME ];then\n\n    # read android ndk path from user input\n    while true\n    do\n        echo \"Please input the android-ndk path:\"\n        read ANDROID_NDK_PATH\n        ANDROID_NDK_PATH=\"$(changeDirFormat ${ANDROID_NDK_PATH})\"\n        if [ -d \"$ANDROID_NDK_PATH\" ];then\n            echo \"Get ANDROID_NDK_ROOT=$ANDROID_NDK_PATH\"\n            echo\n            break\n        fi\n        echo \"$ANDROID_NDK_PATH is not exist!!!\"\n    done\n\n    # read android sdk path from user input\n    while true\n    do\n        echo \"Please input the andoid-sdk path:\"\n        read ANDROID_SDK_PATH\n        INPUT_SDK_PATH=${ANDROID_SDK_PATH}\n        ANDROID_SDK_PATH=\"$(changeDirFormat ${ANDROID_SDK_PATH})\"\n        if [ -d \"$ANDROID_SDK_PATH\" ];then\n            echo \"Get ANDROID_SDK_ROOT=$ANDROID_SDK_PATH\"\n            echo\n            break\n        fi\n        echo \"$ANDROID_SDK_PATH is not exist!!!\"\n    done\n\n    while true\n    do\n        echo \"Please input the ant tool path(such as '/Users/MyAccount/tools/ant/bin'):\"\n        read ANT_PATH\n        ANT_PATH=\"$(changeDirFormat ${ANT_PATH})\"\n        if [ -d \"$ANT_PATH\" ];then\n            echo \"Get ANT_PATH=$ANT_PATH\"\n            echo\n            break\n        fi\n        echo \"$ANT_PATH is not exist!!!\"\n    done\n\n    echo export ANDROID_NDK_ROOT=$ANDROID_NDK_PATH > $BUILD_PATH_FILE_NAME\n    echo export ANDROID_SDK_ROOT=$ANDROID_SDK_PATH >> $BUILD_PATH_FILE_NAME\n    echo export ANT_PATH=$ANT_PATH >> $BUILD_PATH_FILE_NAME\n    echo export INPUT_SDK_PATH=$INPUT_SDK_PATH >> $BUILD_PATH_FILE_NAME\nfi\n\npopd\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForPublish/genPrebuildMK.sh",
    "content": "SOURCE_FILE_NAME=$1\nTARGET_FILE_NAME=$2\n\necho \"LOCAL_PATH := \\$(call my-dir)\" > ${TARGET_FILE_NAME}\necho \"\" >> ${TARGET_FILE_NAME}\necho \"include \\$(CLEAR_VARS)\" >> ${TARGET_FILE_NAME}\n\nMODULE_NAME=`cat ${SOURCE_FILE_NAME} | grep LOCAL_MODULE[^_]`\nMODULE_FILENAME=`cat ${SOURCE_FILE_NAME} | grep LOCAL_MODULE_FILENAME`\n\nif [ -n \"${MODULE_NAME}\" ]; then\necho ${MODULE_NAME} >> ${TARGET_FILE_NAME}\nfi\n\nif [ -n \"${MODULE_FILENAME}\" ]; then\necho ${MODULE_FILENAME} >> ${TARGET_FILE_NAME}\nLIB_FILENAME=${MODULE_FILENAME#*\\=}\nelse\nLIB_FILENAME=${MODULE_NAME#*\\=}\nfi\nLIB_FILENAME=`echo ${LIB_FILENAME} | sed 's/ //g'`\nLIB_FILENAME=${LIB_FILENAME}.a\n\necho \"\" >> ${TARGET_FILE_NAME}\n\necho \"LOCAL_SRC_FILES := ./lib/\"\\$\\(TARGET_ARCH_ABI\\)/${LIB_FILENAME} >> ${TARGET_FILE_NAME}\necho \"LOCAL_EXPORT_C_INCLUDES := \\$(LOCAL_PATH)/../include \\$(LOCAL_PATH)\" >> ${TARGET_FILE_NAME}\necho \"LOCAL_EXPORT_LDLIBS := -llog\" >> ${TARGET_FILE_NAME}\n\necho \"\" >> ${TARGET_FILE_NAME}\necho \"include \\$(PREBUILT_STATIC_LIBRARY)\" >> ${TARGET_FILE_NAME}\n"
  },
  {
    "path": "cocos2d/plugin/tools/toolsForPublish/publishPlugin.sh",
    "content": "plugin_name=$1\nTARGET_DIR=$2/${plugin_name}\nPLUGIN_ROOT=$3\n\nANDROID_PROJ_DIR=${PLUGIN_ROOT}/${plugin_name}/proj.android\necho target dir is ${TARGET_DIR}\necho android project dir is ${ANDROID_PROJ_DIR}\n\n#create directory for plugin\nmkdir -p ${TARGET_DIR}\n\n###############################\n# functions used\n###############################\ngetLibraryFileName()\n{\n    #get the library file name created by ndk build\n    #fine line with LOCAL_MODULE_FILENAME\n    DEFINED_FILENAME_LINE=`cat ./jni/Android.mk | grep LOCAL_MODULE_FILENAME`\n    \n    if [ -n \"${DEFINED_FILENAME_LINE}\" ]; then\n        LIB_FILENAME=${DEFINED_FILENAME_LINE#*\\=}\n    else\n        DEFINED_MODULE_LINE=`cat ./jni/Android.mk | grep LOCAL_MODULE `\n        LIB_FILENAME=${DEFINED_MODULE_LINE#*\\=}\n        LIB_FILENAME=lib${LIB_FILENAME}\n    fi\n    \n    LIB_FILENAME=`echo ${LIB_FILENAME} | sed 's/ //g'`\n    LIB_FILENAME=${LIB_FILENAME}.a\n    echo ${LIB_FILENAME}\n}\n\ngetPathForAnt()\n{\n    START_WITH_CYGWIN=`echo $1 | grep '^/cygdrive/'`\n    if [ -z \"${START_WITH_CYGWIN}\" ]; then\n        echo \"$1\"\n    else\n        RET=${START_WITH_CYGWIN#/cygdrive/}\n        RET=${RET/\\//:/}\n        echo \"${RET}\"\n    fi\n}\n\necho\necho \"Publish plugin for android\"\n\npushd ${ANDROID_PROJ_DIR}\n\n#check local.properties file\nLOACL_FILE_NAME=local.properties\nif [ -f ${LOACL_FILE_NAME} ]; then\n    DEFINED_SDK_DIR=`grep sdk.dir= ./${LOACL_FILE_NAME}`\n    if [ -z \"${DEFINED_SDK_DIR}\" ]; then\n        ANT_SDK_DIR=\"$(getPathForAnt ${INPUT_SDK_PATH})\"\n        echo \"sdk.dir=${ANT_SDK_DIR}\" >> ${LOACL_FILE_NAME}\n    fi\n    \n    DEFINED_PLUGIN_DIR=`grep plugin.dir= ./${LOACL_FILE_NAME}`\n    if [ -z \"${DEFINED_PLUGIN_DIR}\" ]; then\n        ANT_PLUGIN_ROOT_DIR=\"$(getPathForAnt ${PLUGIN_ROOT})\"\n        echo \"plugin.dir=${ANT_PLUGIN_ROOT_DIR}\" >> ${LOACL_FILE_NAME}\n    fi\nelse\n    ANT_SDK_DIR=\"$(getPathForAnt ${INPUT_SDK_PATH})\"\n    echo \"sdk.dir=${ANT_SDK_DIR}\" > ${LOACL_FILE_NAME}\n    ANT_PLUGIN_ROOT_DIR=\"$(getPathForAnt ${PLUGIN_ROOT})\"\n    echo \"plugin.dir=${ANT_PLUGIN_ROOT_DIR}\" >> ${LOACL_FILE_NAME}\nfi\n\n#invoke ant build of plugin\n${ANT_PATH}/ant -q clean\n${ANT_PATH}/ant -q plugin-publish\n\n#copy .jar files to target directory\nmkdir -p ${TARGET_DIR}/android\ncp -rf ${ANDROID_PROJ_DIR}/bin/*.jar ${TARGET_DIR}/android\nif [ -d ${ANDROID_PROJ_DIR}/sdk ]; then\n    cp -rf ${ANDROID_PROJ_DIR}/sdk/*.jar ${TARGET_DIR}/android\nfi\n\n#copy android depend on project to publish directory\nif [ -d \"${ANDROID_PROJ_DIR}/DependProject\" ]; then\n    cp -rf \"${ANDROID_PROJ_DIR}/DependProject\" \"${TARGET_DIR}/android\"\nfi\n\n#copy ForManifest.xml file to publish directory\nif [ -f \"${ANDROID_PROJ_DIR}/ForManifest.xml\" ]; then\n    cp -rf \"${ANDROID_PROJ_DIR}/ForManifest.xml\" \"${TARGET_DIR}/android\"\nfi\n\n#copy ForRes directory to publish directory\nif [ -d \"${ANDROID_PROJ_DIR}/ForRes\" ]; then\n    cp -rf \"${ANDROID_PROJ_DIR}/ForRes\" \"${TARGET_DIR}/android\"\nfi\n\n#copy ForAssets directory to publish directory\nif [ -d \"${ANDROID_PROJ_DIR}/ForAssets\" ]; then\n    cp -rf \"${ANDROID_PROJ_DIR}/ForAssets\" \"${TARGET_DIR}/android\"\nfi\n\n#copy CLibs directory to publish directory\nif [ -d \"${ANDROID_PROJ_DIR}/CLibs\" ]; then\n    cp -rf \"${ANDROID_PROJ_DIR}/CLibs\" \"${TARGET_DIR}/android\"\nfi\n\n#Build C++ code\nBUILD_NATIVE_SCRIPT=${ANDROID_PROJ_DIR}/build_native.sh\nif [ -f $BUILD_NATIVE_SCRIPT ]; then\n\n    echo \"Build C++ code\"\n\n    #create include directory\n    mkdir -p ${TARGET_DIR}/include\n    cp -rf ${PLUGIN_ROOT}/${plugin_name}/include/* ${TARGET_DIR}/include\n\n    #copy android include files\n    ADNROID_SOURCE_DIR=${PLUGIN_ROOT}/${plugin_name}/platform/android\n    if [ -d ${ADNROID_SOURCE_DIR} ]; then\n        HAVE_HEADER_FILE=`find ${ADNROID_SOURCE_DIR} -name \"*.h\"`\n        if [ -n \"${HAVE_HEADER_FILE}\" ]; then\n            cp -rf ${ADNROID_SOURCE_DIR}/*.h \"${TARGET_DIR}/android\"\n        fi\n    fi\n\n    #invoke ndk build for plugin project\n    ./build_native.sh\n    LIB_FILE=\"$(getLibraryFileName)\"\n    for File in ${ANDROID_PROJ_DIR}/obj/local/*\n    do\n        if [ -d $File ]; then\n            if [ -f \"${File}\"/${LIB_FILE} ]; then\n                ABI_NAME=`basename \"${File}\"`\n                mkdir -p \"${TARGET_DIR}/android/lib/${ABI_NAME}\"\n                cp -rf \"${File}/${LIB_FILE}\" \"${TARGET_DIR}/android/lib/${ABI_NAME}\"\n            fi\n        fi\n    done\n\n    #generate mk file for prebuild\n    ${PLUGIN_ROOT}/tools/toolsForPublish/genPrebuildMK.sh ${ANDROID_PROJ_DIR}/jni/Android.mk ${TARGET_DIR}/android/Android.mk\nfi\n\npopd\n"
  },
  {
    "path": "cocos2d/tools/__init__.py",
    "content": ""
  },
  {
    "path": "cocos2d/tools/android-emulator-README.md",
    "content": "# Run cocos2d-x successfully on the Android emulator\n\n## Problem and solution\n\nFor a few years the only option was to run the Android emulator by emulating the ARM instruction set on a x86 host machine. While this is still possible, it has two problems\n * it is very, very slow\n * GPU support and OpenGL ES 2.0 is not well supported\n\nSo cocos2d-x does not run correctly.\n\nThe fix is to use virtualization with the x86 version of Android and enable GPU acceleration. With these options enabled, you can successfully use the emulator to develop with cocos2d-x!\n\n## How-to\n\n 1. Download and create an Android emulator using the x86 system image\n 2. Enable virtualization (with CPU's that support VT-X) on  Windows/Linux/OSX\n 3. Build cocos2d-x libraries for the x86 architecture too\n 4. Run the emulator with the correct library path and options\n 5. Success!\n\n### Download and create an Android emulator using the x86 system image\n\n * Run the android emulator manager :\n\n`\n<android-sdk>/tools/android\n`\n\nEnsure that \"Intel x86 Atom System Image\" is selected, downloaded and installed for the Android version you are using.\n\n * Open the menu item\n\n    \"Tools\"->\"Manage AVDs\"\n\n * Create a new Android Virtual Device\n * Make sure to select the \"x86\" option in the CPU/ABI dropdown\n * Make sure to select the \"Use Host GPU\" checkbox\n\n### Enable virtualization (with CPU's that support VT-X) on  Windows/Linux/OSX\n\nPlease follow intel's instructions here on downloading/enabling virtualization for the Android emulator\nhttp://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/\n\n### Build cocos2d-x libraries for the x86 architecture too\n\nIn your app's Application.mk, add x86 to the supported ABI's by adding/editing this line\n\n`\nAPP_ABI := armeabi x86\n`\n\n### Run the emulator with the correct library path and options\n\nMake sure to \n * Set the library path to the directory containing the Open GL library for the emulator (LD_LIBRARY_PATH=...)\n * Run the x86 version of the emulator (run <android-sdk>/tools/emulator-x86)\n * Enable GPU use (Use the option \"-gpu on\")\n * Also, you need to specify the name of the Android Virtual Device to use (Use the option \"-avd <android virtual device name>\")\n\nOn OS X the command line looks like this\n\n`\nLD_LIBRARY_PATH=~/bin/android-sdk/tools/lib ~/bin/android-sdk/tools/emulator-x86 -verbose -avd android17x86 -gpu on\n`\n"
  },
  {
    "path": "cocos2d/tools/android-mk-generator/android_mk_generator.py",
    "content": "#!/usr/bin/python\n\nimport sys\nimport os\nimport os.path\nimport cStringIO\nimport re\n\ndef get_cur_dir():\n    path = sys.path[0]\n    if os.path.isdir(path):\n        return path\n    elif os.path.isfile(path):\n        return os.path.dirname(path)\n\nCUR_DIR = get_cur_dir()\nCOCOS_ROOT = os.path.abspath(os.path.join(CUR_DIR, \"../../\"))\nCONFIG = os.path.abspath(os.path.join(CUR_DIR, \"./config.py\"))\n# print 'CONFIG:' + CONFIG\n# print 'COCOS_ROOT:' + COCOS_ROOT\n\ntry:\n    import PathUtils\nexcept ImportError, e:\n    sys.path.append(os.path.abspath(os.path.join(CUR_DIR, \"../pylib\")))\n    import PathUtils\n\n\n\ndef gen_android_mk(mkfile, pathes, suffix = (\"c\", \"cpp\",), exclude = ()):\n    utils = PathUtils.PathUtils(COCOS_ROOT)\n    filelst = utils.find_files(pathes, suffix, exclude)\n\n    # generate file list string\n    filestrio = cStringIO.StringIO()\n    mkfilepath = os.path.dirname(os.path.join(COCOS_ROOT, mkfile))\n    for filename in filelst:\n        filestrio.write(' \\\\\\n')\n        filepath = os.path.relpath(filename, mkfilepath)\n        filestrio.write(filepath.replace('\\\\', '/'))\n    filestrio.write('\\n')\n    \n    # read mk file\n    file = open(os.path.join(COCOS_ROOT, mkfile))\n    mkstrio = cStringIO.StringIO()\n    rep = re.compile(\"\\s*LOCAL_SRC_FILES\\s*:=\")\n    try:\n        # read lines before encounter \"LOCAL_EXPORT_C_INCLUDES\"\n        for line in file:\n            if rep.match(line):\n                mkstrio.write(\"LOCAL_SRC_FILES :=\")\n                break\n            else:\n                mkstrio.write(line)\n    #mkstrio.write('\\n')\n\n        # write file list\n        mkstrio.write(filestrio.getvalue())\n\n        # write remaining lines\n        delete = True if line[len(line) - 2] == '\\\\' else False\n        for line in file:\n            if delete:\n                delete = True if line[len(line) - 2] == '\\\\' else False\n            else:\n                mkstrio.write(line)\n#mkstrio.write('\\n')\n    finally:\n        file.close()\n\n\n\n    file = open(os.path.join(COCOS_ROOT, mkfile), \"w\")\n    file.write(mkstrio.getvalue())\n    file.close()\n\n    filestrio.close()\n    mkstrio.close()\n\ndef main():\n    config = open(CONFIG)\n    params = eval(config.read())\n    config.close()\n    \n    for param in params:\n        gen_android_mk(**param)\n\nif __name__ == \"__main__\":\n    from optparse import OptionParser\n\n    parser = OptionParser()\n\n    parser.add_option('-c', '--config',\n                      type='string',\n                      dest='config',\n                      help=\"config file path.\")\n\n    parser.add_option('-r', '--rootpath',\n                      action='store',\n                      dest='rootpath',\n                      help='class root path for mkfile, pathes, exclude.')\n\n    options, args = parser.parse_args()\n\n    if options.config:\n        CONFIG = os.path.abspath(os.path.join(os.curdir, options.config))\n\n    if options.rootpath:\n        COCOS_ROOT = os.path.abspath(os.path.join(os.curdir, options.rootpath))\n\n    # print 'CONFIG:', CONFIG\n    # print 'COCOS_ROOT:', COCOS_ROOT\n\n    error = ''\n    if not os.path.isfile(CONFIG):\n        error+='config must be file.\\n'\n\n    if not os.path.isdir(COCOS_ROOT):\n        error+='rootpath must be directory.\\n'\n\n    if error != '':\n        parser.exit(2, \"{exception}\".format(exception=error))\n    \n    sys.exit(main())\n"
  },
  {
    "path": "cocos2d/tools/android-mk-generator/config.py",
    "content": "[\n{\n    'mkfile' : 'cocos/2d/Android.mk',\n    'pathes' : (\"cocos/2d/\",\"cocos/base\",\"cocos/math\",\"cocos/physics\",\"external/tinyxml2\",\"external/unzip\"),\n    'exclude' : (\"cocos/2d/platform/android\", \"cocos/2d/platform/emscripten\", \"cocos/2d/platform/ios\", \"cocos/2d/platform/apple\", \"cocos/2d/platform/linux\", \"cocos/2d/platform/mac\", \"cocos/2d/platform/win32\")\n},\n{\n    'mkfile' : 'samples/Cpp/TestCpp/Android.mk',\n    'pathes' : (\"samples/Cpp/TestCpp/Classes\",),\n},\n{\n    'mkfile' : 'extensions/Android.mk',\n    'pathes' : (\"extensions/\",),\n    'exclude' : (\"extensions/proj.win32\", \"extensions/proj.emscripten\", \"extensions/proj.ios\", \"extensions/proj.linux\", \"extensions/proj.mac\", \"extensions/proj.nacl\", \"extensions/proj.qt5\", \"extensions/proj.tizen\")\n},\n{\n    'mkfile' : 'external/Box2D/Android.mk',\n    'pathes' : (\"external/Box2D/\",),\n},\n{\n    'mkfile' : 'external/chipmunk/Android.mk',\n    'pathes' : (\"external/chipmunk/\",),\n}\n]"
  },
  {
    "path": "cocos2d/tools/bindings-generator/.gitignore",
    "content": ".DS_Store\ngen/\n*.pyc\ntest/user.cfg\ntest/userconf.ini\ntest/simple_test_bindings/\n.idea\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/README.md",
    "content": "# What's new\n* Add a prebuilt libclang3.4 in `libclang/`for mac, linux and windows.\n* If you want use the prebuilt licbclang3.4 work with Android NDK, then `only the NDK r9b is can work corrently` with it.\n\n# Requirements\n\n* python2.7\n* py-yaml\n* cheetah (for target language templates)\n* libclang, from clang 3.3 or later\n\n# Usage\n\n    Usage: generator.py [options] {configfile}\n    \n    Options:\n      -h, --help   show this help message and exit\n      -s SECTION   sets a specific section to be converted\n      -t TARGET    specifies the target vm. Will search for TARGET.yaml\n\nBasically, you specify a target vm (spidermonkey is the only current target vm) and the section from\nthe `.ini` file you want to generate code for.\n\n## Run the simple test with prebuilt libclang3.4\n\nIncluded in this repository is a simple test. Use this to confirm the generator is working and that your environment is set up correctly.\n\n#### NOTE\n\n* The test uses the prebuilt 3.4 libclang, so you should use `Android NDK r9b`.\n* The test uses &lt;string&gt; and &lt;stdint.h&gt; so you need a C++ implementation that provides these\n* Currently, the test script is setup to use the Android NDK's GNU libstdc++\n\n### Mac OS X\n\n* The OSX 10.9 has a built-in python2.7 and if your os don't have python2.7 then use [Homebrew](http://brew.sh/) to install the python and use pip install the python dependencies.\n<pre>\n\tbrew install python\n</pre>\n\n* Install python dependices by pip.\n<pre>\n    sudo easy_install pip\n    sudo pip install PyYAML\n\tsudo pip install Cheetah\n</pre>\n    \n* Download [64bit ndk-r9b-x86_64](http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86_64.tar.bz2) from [google](http://developer.android.com/tools/sdk/ndk/index.html)\n* If you are using python installed from other way, copy user.cfg.sample and rename it as `user.cfg` then set the absolute path to  python `PYTHON_BIN` in `user.cfg`\n* Run follow command, it will generate a `userconf.ini`, and check the values in it if it occorus any error.\n<pre>\n\texport NDK_ROOT=/path/to/android-ndk-r9b\n    ./test.sh\n</pre>\n\n### Ubuntu Linux 12.04 64bit\n* Install python\n<pre>\n\tsudo apt-get install python2.7\n</pre>\n* Install python dependices by pip.\n<pre>\n\tsudo apt-get install python-pip\n\tsudo pip install PyYAML\n\tsudo pip install Cheetah\n</pre>\n* Download [64bit ndk-r9b-x86_64]( https://dl.google.com/android/ndk/android-ndk-r9b-linux-x86_64.tar.bz2) from [google](http://developer.android.com/tools/sdk/ndk/index.html)\n* If you are using python installed from other way, copy user.cfg.sample and rename it as `user.cfg` then set the absolute path to  python `PYTHON_BIN` in `user.cfg`\n* Run follow command, it will generate a `userconf.ini`, and check the values in it if it occorus any error.\n<pre>\n\texport NDK_ROOT=/path/to/android-ndk-r9b\n    ./test.sh\n</pre>\n\n### Windows 7 64bit\n* Download python2.7.3 (`32bit`) from (http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi).\n* Add the installed path of python (e.g. C:\\Python27) to windows environment variable named 'PATH'.\n* Download pyyaml from http://pyyaml.org/download/pyyaml/PyYAML-3.10.win32-py2.7.exe and install it.\n* Download pyCheetah from https://raw.github.com/dumganhar/cocos2d-x/download/downloads/Cheetah.zip, unzip it to \"C:\\Python27\\Lib\\site-packages\"\n* Download [64bit NDK-r9b](http://dl.google.com/android/ndk/android-ndk-r9b-windows-x86_64.zip) from [google](http://developer.android.com/tools/sdk/ndk/index.html)\n* Set the environment variables (`PYTHON_ROOT` and `NDK_ROOT`) or just them in `test.bat`.\n* Run \"test.bat\". The generated codes will be under \"simple_test_bindings\".\n\n\n\n### Expected output\n\nUpon running the test you might see some warnings but should not see any errors.\n\nThe test will create a directory named simple_test_bindings that contains 3 files\n\n* A .hpp header file for the bindings class\n* A .cpp file implementing the bindings class\n* A .js file that documents how to call (from JavaScript) the methods the C++ class exposes\n\n# The `.ini` file\n\nThe `.ini` file is a simple text file specifying the settings for the code generator. Here's the\ndefault one, used for cocos2d-x\n\n    [cocos2d-x]\n    prefix = cocos2dx\n    events  = CCNode#onEnter CCNode#onExit\n    extra_arguments = -I../../cocos2dx/include -I../../cocos2dx/platform -I../../cocos2dx/platform/ios -I../../cocos2dx -I../../cocos2dx/kazmath/include -arch i386 -DTARGET_OS_IPHONE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -x c++\n    headers = ../../cocos2dx/include/cocos2d.h\n    classes = CCSprite\n    functions = my_free_function\n\n## Required sections\n\n* prefix: the prefix for the project. Must be a valid identifier for the language of the target vm.\n  Most of the time, the name will be intermixed between the class name and the function name, since\n  all generated (probably) will be free functions, we do that in order to avoid name collition. The\n  script will generate ${prefix}.cpp and ${prefix}.hpp as a result.\n* events: a list of identifiers in the form of ClassName#functionName that are events to be called\n  from the native world to the target vm.\n* extra_arguments: extra arguments to pass to the clang interface. Basically you can think of this\n  as the arguments to pass to the \"compiler\", so add as many as you need here. If you're targetting\n  C++, make sure you add \"-x c++\" as the last argument to force C++ mode on a \".h\" file. Otherwise,\n  name your header files as \".hpp\".\n* headers: list of headers to parse. Usually you add a single header that in turn `#include`s the\n  rest of the files.\n* classes: the classes that will be parsed. Right not is just a string, but it will accept regular\n  expressions\n* functions: space-separated list of free functions to be binded. Same as with classes, it will\n  support regular expressions.\n* skip: a space-separated list of `Classes::functions` or just `functions` to not generate any code.\n\n# The templates\n\nThe generator is using [Cheetah templates](http://www.cheetahtemplate.org/) to create a more\nflexible generator. The way it was thought, is that for every target environment, you should provide\nwith a way to generate the same C/C++ functionality. Every template has access to the proper meta\ninformation for the code or generator (function, classes, etc.)\n\nRight now it's separated in the following set of templates:\n\n* prelude.c/.h: The header of the generated files.\n* ifunction.c/.h: The template for an instance function\n* ifunction_overloaded.c: The template for the implementation of an overloaded function. An\n  overloaded function is exactly the same as a function, but it has an array of functions sharing\n  the same name. The current implementation for spidermonkey only works if the overloading is with\n  different number of arguments.\n* sfunction.c/.h: The template for a static function\n* sfunction_overloaded.c: The template for an overloaded static function\n* register.c: Here you should add the constructor/finalizer, the registration function (if needed)\n  and the footer of the header file. This is the last chunk being generated\n\nTemplates are stored in the `templates/${target}` directory and follow the naming specified above.\n\nOne final part of the puzzle is the `${target}.yaml` file, that contains specific type conversion\nsnippets to be used by the templates. For instance, for spidermonkey, this is the place where we\nspecify the conversion routines for the native types (to and from int, float, string, etc.)\n\n# Limitations\n\nCurrently the generator is leveraging clang in order to get information about the C/C++ code, so we\ncan only get as much information as clang give us. Known list of things that won't work:\n\n* variable number of arguments. Solution: write a manual wrapper\n* default arguments. Solution: write another function that actually calls the real function with the\n  default argument.\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/__init__.py",
    "content": "#===- __init__.py - Clang Python Bindings --------------------*- python -*--===#\n#\n#                     The LLVM Compiler Infrastructure\n#\n# This file is distributed under the University of Illinois Open Source\n# License. See LICENSE.TXT for details.\n#\n#===------------------------------------------------------------------------===#\n\nr\"\"\"\nClang Library Bindings\n======================\n\nThis package provides access to the Clang compiler and libraries.\n\nThe available modules are:\n\n  cindex\n\n    Bindings for the Clang indexing library.\n\"\"\"\n\n__all__ = ['cindex']\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py",
    "content": "#===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===#\n#\n#                     The LLVM Compiler Infrastructure\n#\n# This file is distributed under the University of Illinois Open Source\n# License. See LICENSE.TXT for details.\n#\n#===------------------------------------------------------------------------===#\n\nr\"\"\"\nClang Indexing Library Bindings\n===============================\n\nThis module provides an interface to the Clang indexing library. It is a\nlow-level interface to the indexing library which attempts to match the Clang\nAPI directly while also being \"pythonic\". Notable differences from the C API\nare:\n\n * string results are returned as Python strings, not CXString objects.\n\n * null cursors are translated to None.\n\n * access to child cursors is done via iteration, not visitation.\n\nThe major indexing objects are:\n\n  Index\n\n    The top-level object which manages some global library state.\n\n  TranslationUnit\n\n    High-level object encapsulating the AST for a single translation unit. These\n    can be loaded from .ast files or parsed on the fly.\n\n  Cursor\n\n    Generic object for representing a node in the AST.\n\n  SourceRange, SourceLocation, and File\n\n    Objects representing information about the input source.\n\nMost object information is exposed using properties, when the underlying API\ncall is efficient.\n\"\"\"\n\n# TODO\n# ====\n#\n# o API support for invalid translation units. Currently we can't even get the\n#   diagnostics on failure because they refer to locations in an object that\n#   will have been invalidated.\n#\n# o fix memory management issues (currently client must hold on to index and\n#   translation unit, or risk crashes).\n#\n# o expose code completion APIs.\n#\n# o cleanup ctypes wrapping, would be nice to separate the ctypes details more\n#   clearly, and hide from the external interface (i.e., help(cindex)).\n#\n# o implement additional SourceLocation, SourceRange, and File methods.\n\nfrom ctypes import *\nimport collections\n\nimport clang.enumerations\n\n# ctypes doesn't implicitly convert c_void_p to the appropriate wrapper\n# object. This is a problem, because it means that from_parameter will see an\n# integer and pass the wrong value on platforms where int != void*. Work around\n# this by marshalling object arguments as void**.\nc_object_p = POINTER(c_void_p)\n\ncallbacks = {}\n\n### Exception Classes ###\n\nclass TranslationUnitLoadError(Exception):\n    \"\"\"Represents an error that occurred when loading a TranslationUnit.\n\n    This is raised in the case where a TranslationUnit could not be\n    instantiated due to failure in the libclang library.\n\n    FIXME: Make libclang expose additional error information in this scenario.\n    \"\"\"\n    pass\n\nclass TranslationUnitSaveError(Exception):\n    \"\"\"Represents an error that occurred when saving a TranslationUnit.\n\n    Each error has associated with it an enumerated value, accessible under\n    e.save_error. Consumers can compare the value with one of the ERROR_\n    constants in this class.\n    \"\"\"\n\n    # Indicates that an unknown error occurred. This typically indicates that\n    # I/O failed during save.\n    ERROR_UNKNOWN = 1\n\n    # Indicates that errors during translation prevented saving. The errors\n    # should be available via the TranslationUnit's diagnostics.\n    ERROR_TRANSLATION_ERRORS = 2\n\n    # Indicates that the translation unit was somehow invalid.\n    ERROR_INVALID_TU = 3\n\n    def __init__(self, enumeration, message):\n        assert isinstance(enumeration, int)\n\n        if enumeration < 1 or enumeration > 3:\n            raise Exception(\"Encountered undefined TranslationUnit save error \"\n                            \"constant: %d. Please file a bug to have this \"\n                            \"value supported.\" % enumeration)\n\n        self.save_error = enumeration\n        Exception.__init__(self, 'Error %d: %s' % (enumeration, message))\n\n### Structures and Utility Classes ###\n\nclass CachedProperty(object):\n    \"\"\"Decorator that lazy-loads the value of a property.\n\n    The first time the property is accessed, the original property function is\n    executed. The value it returns is set as the new value of that instance's\n    property, replacing the original method.\n    \"\"\"\n\n    def __init__(self, wrapped):\n        self.wrapped = wrapped\n        try:\n            self.__doc__ = wrapped.__doc__\n        except:\n            pass\n\n    def __get__(self, instance, instance_type=None):\n        if instance is None:\n            return self\n\n        value = self.wrapped(instance)\n        setattr(instance, self.wrapped.__name__, value)\n\n        return value\n\n\nclass _CXString(Structure):\n    \"\"\"Helper for transforming CXString results.\"\"\"\n\n    _fields_ = [(\"spelling\", c_char_p), (\"free\", c_int)]\n\n    def __del__(self):\n        conf.lib.clang_disposeString(self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        assert isinstance(res, _CXString)\n        return conf.lib.clang_getCString(res)\n\nclass SourceLocation(Structure):\n    \"\"\"\n    A SourceLocation represents a particular location within a source file.\n    \"\"\"\n    _fields_ = [(\"ptr_data\", c_void_p * 2), (\"int_data\", c_uint)]\n    _data = None\n\n    def _get_instantiation(self):\n        if self._data is None:\n            f, l, c, o = c_object_p(), c_uint(), c_uint(), c_uint()\n            conf.lib.clang_getInstantiationLocation(self, byref(f), byref(l),\n                    byref(c), byref(o))\n            if f:\n                f = File(f)\n            else:\n                f = None\n            self._data = (f, int(l.value), int(c.value), int(o.value))\n        return self._data\n\n    @staticmethod\n    def from_position(tu, file, line, column):\n        \"\"\"\n        Retrieve the source location associated with a given file/line/column in\n        a particular translation unit.\n        \"\"\"\n        return conf.lib.clang_getLocation(tu, file, line, column)\n\n    @staticmethod\n    def from_offset(tu, file, offset):\n        \"\"\"Retrieve a SourceLocation from a given character offset.\n\n        tu -- TranslationUnit file belongs to\n        file -- File instance to obtain offset from\n        offset -- Integer character offset within file\n        \"\"\"\n        return conf.lib.clang_getLocationForOffset(tu, file, offset)\n\n    @property\n    def file(self):\n        \"\"\"Get the file represented by this source location.\"\"\"\n        return self._get_instantiation()[0]\n\n    @property\n    def line(self):\n        \"\"\"Get the line represented by this source location.\"\"\"\n        return self._get_instantiation()[1]\n\n    @property\n    def column(self):\n        \"\"\"Get the column represented by this source location.\"\"\"\n        return self._get_instantiation()[2]\n\n    @property\n    def offset(self):\n        \"\"\"Get the file offset represented by this source location.\"\"\"\n        return self._get_instantiation()[3]\n\n    def __eq__(self, other):\n        return conf.lib.clang_equalLocations(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def __repr__(self):\n        if self.file:\n            filename = self.file.name\n        else:\n            filename = None\n        return \"<SourceLocation file %r, line %r, column %r>\" % (\n            filename, self.line, self.column)\n\nclass SourceRange(Structure):\n    \"\"\"\n    A SourceRange describes a range of source locations within the source\n    code.\n    \"\"\"\n    _fields_ = [\n        (\"ptr_data\", c_void_p * 2),\n        (\"begin_int_data\", c_uint),\n        (\"end_int_data\", c_uint)]\n\n    # FIXME: Eliminate this and make normal constructor? Requires hiding ctypes\n    # object.\n    @staticmethod\n    def from_locations(start, end):\n        return conf.lib.clang_getRange(start, end)\n\n    @property\n    def start(self):\n        \"\"\"\n        Return a SourceLocation representing the first character within a\n        source range.\n        \"\"\"\n        return conf.lib.clang_getRangeStart(self)\n\n    @property\n    def end(self):\n        \"\"\"\n        Return a SourceLocation representing the last character within a\n        source range.\n        \"\"\"\n        return conf.lib.clang_getRangeEnd(self)\n\n    def __eq__(self, other):\n        return conf.lib.clang_equalRanges(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def __repr__(self):\n        return \"<SourceRange start %r, end %r>\" % (self.start, self.end)\n\nclass Diagnostic(object):\n    \"\"\"\n    A Diagnostic is a single instance of a Clang diagnostic. It includes the\n    diagnostic severity, the message, the location the diagnostic occurred, as\n    well as additional source ranges and associated fix-it hints.\n    \"\"\"\n\n    Ignored = 0\n    Note    = 1\n    Warning = 2\n    Error   = 3\n    Fatal   = 4\n\n    def __init__(self, ptr):\n        self.ptr = ptr\n\n    def __del__(self):\n        conf.lib.clang_disposeDiagnostic(self)\n\n    @property\n    def severity(self):\n        return conf.lib.clang_getDiagnosticSeverity(self)\n\n    @property\n    def location(self):\n        return conf.lib.clang_getDiagnosticLocation(self)\n\n    @property\n    def spelling(self):\n        return conf.lib.clang_getDiagnosticSpelling(self)\n\n    @property\n    def ranges(self):\n        class RangeIterator:\n            def __init__(self, diag):\n                self.diag = diag\n\n            def __len__(self):\n                return int(conf.lib.clang_getDiagnosticNumRanges(self.diag))\n\n            def __getitem__(self, key):\n                if (key >= len(self)):\n                    raise IndexError\n                return conf.lib.clang_getDiagnosticRange(self.diag, key)\n\n        return RangeIterator(self)\n\n    @property\n    def fixits(self):\n        class FixItIterator:\n            def __init__(self, diag):\n                self.diag = diag\n\n            def __len__(self):\n                return int(conf.lib.clang_getDiagnosticNumFixIts(self.diag))\n\n            def __getitem__(self, key):\n                range = SourceRange()\n                value = conf.lib.clang_getDiagnosticFixIt(self.diag, key,\n                        byref(range))\n                if len(value) == 0:\n                    raise IndexError\n\n                return FixIt(range, value)\n\n        return FixItIterator(self)\n\n    @property\n    def category_number(self):\n        \"\"\"The category number for this diagnostic.\"\"\"\n        return conf.lib.clang_getDiagnosticCategory(self)\n\n    @property\n    def category_name(self):\n        \"\"\"The string name of the category for this diagnostic.\"\"\"\n        return conf.lib.clang_getDiagnosticCategoryName(self.category_number)\n\n    @property\n    def option(self):\n        \"\"\"The command-line option that enables this diagnostic.\"\"\"\n        return conf.lib.clang_getDiagnosticOption(self, None)\n\n    @property\n    def disable_option(self):\n        \"\"\"The command-line option that disables this diagnostic.\"\"\"\n        disable = _CXString()\n        conf.lib.clang_getDiagnosticOption(self, byref(disable))\n\n        return conf.lib.clang_getCString(disable)\n\n    def __repr__(self):\n        return \"<Diagnostic severity %r, location %r, spelling %r>\" % (\n            self.severity, self.location, self.spelling)\n\n    def from_param(self):\n      return self.ptr\n\nclass FixIt(object):\n    \"\"\"\n    A FixIt represents a transformation to be applied to the source to\n    \"fix-it\". The fix-it shouldbe applied by replacing the given source range\n    with the given value.\n    \"\"\"\n\n    def __init__(self, range, value):\n        self.range = range\n        self.value = value\n\n    def __repr__(self):\n        return \"<FixIt range %r, value %r>\" % (self.range, self.value)\n\nclass TokenGroup(object):\n    \"\"\"Helper class to facilitate token management.\n\n    Tokens are allocated from libclang in chunks. They must be disposed of as a\n    collective group.\n\n    One purpose of this class is for instances to represent groups of allocated\n    tokens. Each token in a group contains a reference back to an instance of\n    this class. When all tokens from a group are garbage collected, it allows\n    this class to be garbage collected. When this class is garbage collected,\n    it calls the libclang destructor which invalidates all tokens in the group.\n\n    You should not instantiate this class outside of this module.\n    \"\"\"\n    def __init__(self, tu, memory, count):\n        self._tu = tu\n        self._memory = memory\n        self._count = count\n\n    def __del__(self):\n        conf.lib.clang_disposeTokens(self._tu, self._memory, self._count)\n\n    @staticmethod\n    def get_tokens(tu, extent):\n        \"\"\"Helper method to return all tokens in an extent.\n\n        This functionality is needed multiple places in this module. We define\n        it here because it seems like a logical place.\n        \"\"\"\n        tokens_memory = POINTER(Token)()\n        tokens_count = c_uint()\n\n        conf.lib.clang_tokenize(tu, extent, byref(tokens_memory),\n                byref(tokens_count))\n\n        count = int(tokens_count.value)\n\n        # If we get no tokens, no memory was allocated. Be sure not to return\n        # anything and potentially call a destructor on nothing.\n        if count < 1:\n            return\n\n        tokens_array = cast(tokens_memory, POINTER(Token * count)).contents\n\n        token_group = TokenGroup(tu, tokens_memory, tokens_count)\n\n        for i in xrange(0, count):\n            token = Token()\n            token.int_data = tokens_array[i].int_data\n            token.ptr_data = tokens_array[i].ptr_data\n            token._tu = tu\n            token._group = token_group\n\n            yield token\n\nclass TokenKind(object):\n    \"\"\"Describes a specific type of a Token.\"\"\"\n\n    _value_map = {} # int -> TokenKind\n\n    def __init__(self, value, name):\n        \"\"\"Create a new TokenKind instance from a numeric value and a name.\"\"\"\n        self.value = value\n        self.name = name\n\n    def __repr__(self):\n        return 'TokenKind.%s' % (self.name,)\n\n    @staticmethod\n    def from_value(value):\n        \"\"\"Obtain a registered TokenKind instance from its value.\"\"\"\n        result = TokenKind._value_map.get(value, None)\n\n        if result is None:\n            raise ValueError('Unknown TokenKind: %d' % value)\n\n        return result\n\n    @staticmethod\n    def register(value, name):\n        \"\"\"Register a new TokenKind enumeration.\n\n        This should only be called at module load time by code within this\n        package.\n        \"\"\"\n        if value in TokenKind._value_map:\n            raise ValueError('TokenKind already registered: %d' % value)\n\n        kind = TokenKind(value, name)\n        TokenKind._value_map[value] = kind\n        setattr(TokenKind, name, kind)\n\n### Cursor Kinds ###\n\nclass CursorKind(object):\n    \"\"\"\n    A CursorKind describes the kind of entity that a cursor points to.\n    \"\"\"\n\n    # The unique kind objects, indexed by id.\n    _kinds = []\n    _name_map = None\n\n    def __init__(self, value):\n        if value >= len(CursorKind._kinds):\n            CursorKind._kinds += [None] * (value - len(CursorKind._kinds) + 1)\n        if CursorKind._kinds[value] is not None:\n            raise ValueError,'CursorKind already loaded'\n        self.value = value\n        CursorKind._kinds[value] = self\n        CursorKind._name_map = None\n\n    def from_param(self):\n        return self.value\n\n    @property\n    def name(self):\n        \"\"\"Get the enumeration name of this cursor kind.\"\"\"\n        if self._name_map is None:\n            self._name_map = {}\n            for key,value in CursorKind.__dict__.items():\n                if isinstance(value,CursorKind):\n                    self._name_map[value] = key\n        return self._name_map[self]\n\n    @staticmethod\n    def from_id(id):\n        if id >= len(CursorKind._kinds) or CursorKind._kinds[id] is None:\n            raise ValueError,'Unknown cursor kind'\n        return CursorKind._kinds[id]\n\n    @staticmethod\n    def get_all_kinds():\n        \"\"\"Return all CursorKind enumeration instances.\"\"\"\n        return filter(None, CursorKind._kinds)\n\n    def is_declaration(self):\n        \"\"\"Test if this is a declaration kind.\"\"\"\n        return conf.lib.clang_isDeclaration(self)\n\n    def is_reference(self):\n        \"\"\"Test if this is a reference kind.\"\"\"\n        return conf.lib.clang_isReference(self)\n\n    def is_expression(self):\n        \"\"\"Test if this is an expression kind.\"\"\"\n        return conf.lib.clang_isExpression(self)\n\n    def is_statement(self):\n        \"\"\"Test if this is a statement kind.\"\"\"\n        return conf.lib.clang_isStatement(self)\n\n    def is_attribute(self):\n        \"\"\"Test if this is an attribute kind.\"\"\"\n        return conf.lib.clang_isAttribute(self)\n\n    def is_invalid(self):\n        \"\"\"Test if this is an invalid kind.\"\"\"\n        return conf.lib.clang_isInvalid(self)\n\n    def is_translation_unit(self):\n        \"\"\"Test if this is a translation unit kind.\"\"\"\n        return conf.lib.clang_isTranslationUnit(self)\n\n    def is_preprocessing(self):\n        \"\"\"Test if this is a preprocessing kind.\"\"\"\n        return conf.lib.clang_isPreprocessing(self)\n\n    def is_unexposed(self):\n        \"\"\"Test if this is an unexposed kind.\"\"\"\n        return conf.lib.clang_isUnexposed(self)\n\n    def __repr__(self):\n        return 'CursorKind.%s' % (self.name,)\n\n# FIXME: Is there a nicer way to expose this enumeration? We could potentially\n# represent the nested structure, or even build a class hierarchy. The main\n# things we want for sure are (a) simple external access to kinds, (b) a place\n# to hang a description and name, (c) easy to keep in sync with Index.h.\n\n###\n# Declaration Kinds\n\n# A declaration whose specific kind is not exposed via this interface.\n#\n# Unexposed declarations have the same operations as any other kind of\n# declaration; one can extract their location information, spelling, find their\n# definitions, etc. However, the specific kind of the declaration is not\n# reported.\nCursorKind.UNEXPOSED_DECL = CursorKind(1)\n\n# A C or C++ struct.\nCursorKind.STRUCT_DECL = CursorKind(2)\n\n# A C or C++ union.\nCursorKind.UNION_DECL = CursorKind(3)\n\n# A C++ class.\nCursorKind.CLASS_DECL = CursorKind(4)\n\n# An enumeration.\nCursorKind.ENUM_DECL = CursorKind(5)\n\n# A field (in C) or non-static data member (in C++) in a struct, union, or C++\n# class.\nCursorKind.FIELD_DECL = CursorKind(6)\n\n# An enumerator constant.\nCursorKind.ENUM_CONSTANT_DECL = CursorKind(7)\n\n# A function.\nCursorKind.FUNCTION_DECL = CursorKind(8)\n\n# A variable.\nCursorKind.VAR_DECL = CursorKind(9)\n\n# A function or method parameter.\nCursorKind.PARM_DECL = CursorKind(10)\n\n# An Objective-C @interface.\nCursorKind.OBJC_INTERFACE_DECL = CursorKind(11)\n\n# An Objective-C @interface for a category.\nCursorKind.OBJC_CATEGORY_DECL = CursorKind(12)\n\n# An Objective-C @protocol declaration.\nCursorKind.OBJC_PROTOCOL_DECL = CursorKind(13)\n\n# An Objective-C @property declaration.\nCursorKind.OBJC_PROPERTY_DECL = CursorKind(14)\n\n# An Objective-C instance variable.\nCursorKind.OBJC_IVAR_DECL = CursorKind(15)\n\n# An Objective-C instance method.\nCursorKind.OBJC_INSTANCE_METHOD_DECL = CursorKind(16)\n\n# An Objective-C class method.\nCursorKind.OBJC_CLASS_METHOD_DECL = CursorKind(17)\n\n# An Objective-C @implementation.\nCursorKind.OBJC_IMPLEMENTATION_DECL = CursorKind(18)\n\n# An Objective-C @implementation for a category.\nCursorKind.OBJC_CATEGORY_IMPL_DECL = CursorKind(19)\n\n# A typedef.\nCursorKind.TYPEDEF_DECL = CursorKind(20)\n\n# A C++ class method.\nCursorKind.CXX_METHOD = CursorKind(21)\n\n# A C++ namespace.\nCursorKind.NAMESPACE = CursorKind(22)\n\n# A linkage specification, e.g. 'extern \"C\"'.\nCursorKind.LINKAGE_SPEC = CursorKind(23)\n\n# A C++ constructor.\nCursorKind.CONSTRUCTOR = CursorKind(24)\n\n# A C++ destructor.\nCursorKind.DESTRUCTOR = CursorKind(25)\n\n# A C++ conversion function.\nCursorKind.CONVERSION_FUNCTION = CursorKind(26)\n\n# A C++ template type parameter\nCursorKind.TEMPLATE_TYPE_PARAMETER = CursorKind(27)\n\n# A C++ non-type template paramater.\nCursorKind.TEMPLATE_NON_TYPE_PARAMETER = CursorKind(28)\n\n# A C++ template template parameter.\nCursorKind.TEMPLATE_TEMPLATE_PARAMETER = CursorKind(29)\n\n# A C++ function template.\nCursorKind.FUNCTION_TEMPLATE = CursorKind(30)\n\n# A C++ class template.\nCursorKind.CLASS_TEMPLATE = CursorKind(31)\n\n# A C++ class template partial specialization.\nCursorKind.CLASS_TEMPLATE_PARTIAL_SPECIALIZATION = CursorKind(32)\n\n# A C++ namespace alias declaration.\nCursorKind.NAMESPACE_ALIAS = CursorKind(33)\n\n# A C++ using directive\nCursorKind.USING_DIRECTIVE = CursorKind(34)\n\n# A C++ using declaration\nCursorKind.USING_DECLARATION = CursorKind(35)\n\n# A Type alias decl.\nCursorKind.TYPE_ALIAS_DECL = CursorKind(36)\n\n# A Objective-C synthesize decl\nCursorKind.OBJC_SYNTHESIZE_DECL = CursorKind(37)\n\n# A Objective-C dynamic decl\nCursorKind.OBJC_DYNAMIC_DECL = CursorKind(38)\n\n# A C++ access specifier decl.\nCursorKind.CXX_ACCESS_SPEC_DECL = CursorKind(39)\n\n\n###\n# Reference Kinds\n\nCursorKind.OBJC_SUPER_CLASS_REF = CursorKind(40)\nCursorKind.OBJC_PROTOCOL_REF = CursorKind(41)\nCursorKind.OBJC_CLASS_REF = CursorKind(42)\n\n# A reference to a type declaration.\n#\n# A type reference occurs anywhere where a type is named but not\n# declared. For example, given:\n#   typedef unsigned size_type;\n#   size_type size;\n#\n# The typedef is a declaration of size_type (CXCursor_TypedefDecl),\n# while the type of the variable \"size\" is referenced. The cursor\n# referenced by the type of size is the typedef for size_type.\nCursorKind.TYPE_REF = CursorKind(43)\nCursorKind.CXX_BASE_SPECIFIER = CursorKind(44)\n\n# A reference to a class template, function template, template\n# template parameter, or class template partial specialization.\nCursorKind.TEMPLATE_REF = CursorKind(45)\n\n# A reference to a namespace or namepsace alias.\nCursorKind.NAMESPACE_REF = CursorKind(46)\n\n# A reference to a member of a struct, union, or class that occurs in\n# some non-expression context, e.g., a designated initializer.\nCursorKind.MEMBER_REF = CursorKind(47)\n\n# A reference to a labeled statement.\nCursorKind.LABEL_REF = CursorKind(48)\n\n# A reference toa a set of overloaded functions or function templates\n# that has not yet been resolved to a specific function or function template.\nCursorKind.OVERLOADED_DECL_REF = CursorKind(49)\n\n###\n# Invalid/Error Kinds\n\nCursorKind.INVALID_FILE = CursorKind(70)\nCursorKind.NO_DECL_FOUND = CursorKind(71)\nCursorKind.NOT_IMPLEMENTED = CursorKind(72)\nCursorKind.INVALID_CODE = CursorKind(73)\n\n###\n# Expression Kinds\n\n# An expression whose specific kind is not exposed via this interface.\n#\n# Unexposed expressions have the same operations as any other kind of\n# expression; one can extract their location information, spelling, children,\n# etc. However, the specific kind of the expression is not reported.\nCursorKind.UNEXPOSED_EXPR = CursorKind(100)\n\n# An expression that refers to some value declaration, such as a function,\n# varible, or enumerator.\nCursorKind.DECL_REF_EXPR = CursorKind(101)\n\n# An expression that refers to a member of a struct, union, class, Objective-C\n# class, etc.\nCursorKind.MEMBER_REF_EXPR = CursorKind(102)\n\n# An expression that calls a function.\nCursorKind.CALL_EXPR = CursorKind(103)\n\n# An expression that sends a message to an Objective-C object or class.\nCursorKind.OBJC_MESSAGE_EXPR = CursorKind(104)\n\n# An expression that represents a block literal.\nCursorKind.BLOCK_EXPR = CursorKind(105)\n\n# An integer literal.\nCursorKind.INTEGER_LITERAL = CursorKind(106)\n\n# A floating point number literal.\nCursorKind.FLOATING_LITERAL = CursorKind(107)\n\n# An imaginary number literal.\nCursorKind.IMAGINARY_LITERAL = CursorKind(108)\n\n# A string literal.\nCursorKind.STRING_LITERAL = CursorKind(109)\n\n# A character literal.\nCursorKind.CHARACTER_LITERAL = CursorKind(110)\n\n# A parenthesized expression, e.g. \"(1)\".\n#\n# This AST node is only formed if full location information is requested.\nCursorKind.PAREN_EXPR = CursorKind(111)\n\n# This represents the unary-expression's (except sizeof and\n# alignof).\nCursorKind.UNARY_OPERATOR = CursorKind(112)\n\n# [C99 6.5.2.1] Array Subscripting.\nCursorKind.ARRAY_SUBSCRIPT_EXPR = CursorKind(113)\n\n# A builtin binary operation expression such as \"x + y\" or\n# \"x <= y\".\nCursorKind.BINARY_OPERATOR = CursorKind(114)\n\n# Compound assignment such as \"+=\".\nCursorKind.COMPOUND_ASSIGNMENT_OPERATOR = CursorKind(115)\n\n# The ?: ternary operator.\nCursorKind.CONDITIONAL_OPERATOR = CursorKind(116)\n\n# An explicit cast in C (C99 6.5.4) or a C-style cast in C++\n# (C++ [expr.cast]), which uses the syntax (Type)expr.\n#\n# For example: (int)f.\nCursorKind.CSTYLE_CAST_EXPR = CursorKind(117)\n\n# [C99 6.5.2.5]\nCursorKind.COMPOUND_LITERAL_EXPR = CursorKind(118)\n\n# Describes an C or C++ initializer list.\nCursorKind.INIT_LIST_EXPR = CursorKind(119)\n\n# The GNU address of label extension, representing &&label.\nCursorKind.ADDR_LABEL_EXPR = CursorKind(120)\n\n# This is the GNU Statement Expression extension: ({int X=4; X;})\nCursorKind.StmtExpr = CursorKind(121)\n\n# Represents a C11 generic selection.\nCursorKind.GENERIC_SELECTION_EXPR = CursorKind(122)\n\n# Implements the GNU __null extension, which is a name for a null\n# pointer constant that has integral type (e.g., int or long) and is the same\n# size and alignment as a pointer.\n#\n# The __null extension is typically only used by system headers, which define\n# NULL as __null in C++ rather than using 0 (which is an integer that may not\n# match the size of a pointer).\nCursorKind.GNU_NULL_EXPR = CursorKind(123)\n\n# C++'s static_cast<> expression.\nCursorKind.CXX_STATIC_CAST_EXPR = CursorKind(124)\n\n# C++'s dynamic_cast<> expression.\nCursorKind.CXX_DYNAMIC_CAST_EXPR = CursorKind(125)\n\n# C++'s reinterpret_cast<> expression.\nCursorKind.CXX_REINTERPRET_CAST_EXPR = CursorKind(126)\n\n# C++'s const_cast<> expression.\nCursorKind.CXX_CONST_CAST_EXPR = CursorKind(127)\n\n# Represents an explicit C++ type conversion that uses \"functional\"\n# notion (C++ [expr.type.conv]).\n#\n# Example:\n# \\code\n#   x = int(0.5);\n# \\endcode\nCursorKind.CXX_FUNCTIONAL_CAST_EXPR = CursorKind(128)\n\n# A C++ typeid expression (C++ [expr.typeid]).\nCursorKind.CXX_TYPEID_EXPR = CursorKind(129)\n\n# [C++ 2.13.5] C++ Boolean Literal.\nCursorKind.CXX_BOOL_LITERAL_EXPR = CursorKind(130)\n\n# [C++0x 2.14.7] C++ Pointer Literal.\nCursorKind.CXX_NULL_PTR_LITERAL_EXPR = CursorKind(131)\n\n# Represents the \"this\" expression in C++\nCursorKind.CXX_THIS_EXPR = CursorKind(132)\n\n# [C++ 15] C++ Throw Expression.\n#\n# This handles 'throw' and 'throw' assignment-expression. When\n# assignment-expression isn't present, Op will be null.\nCursorKind.CXX_THROW_EXPR = CursorKind(133)\n\n# A new expression for memory allocation and constructor calls, e.g:\n# \"new CXXNewExpr(foo)\".\nCursorKind.CXX_NEW_EXPR = CursorKind(134)\n\n# A delete expression for memory deallocation and destructor calls,\n# e.g. \"delete[] pArray\".\nCursorKind.CXX_DELETE_EXPR = CursorKind(135)\n\n# Represents a unary expression.\nCursorKind.CXX_UNARY_EXPR = CursorKind(136)\n\n# ObjCStringLiteral, used for Objective-C string literals i.e. \"foo\".\nCursorKind.OBJC_STRING_LITERAL = CursorKind(137)\n\n# ObjCEncodeExpr, used for in Objective-C.\nCursorKind.OBJC_ENCODE_EXPR = CursorKind(138)\n\n# ObjCSelectorExpr used for in Objective-C.\nCursorKind.OBJC_SELECTOR_EXPR = CursorKind(139)\n\n# Objective-C's protocol expression.\nCursorKind.OBJC_PROTOCOL_EXPR = CursorKind(140)\n\n# An Objective-C \"bridged\" cast expression, which casts between\n# Objective-C pointers and C pointers, transferring ownership in the process.\n#\n# \\code\n#   NSString *str = (__bridge_transfer NSString *)CFCreateString();\n# \\endcode\nCursorKind.OBJC_BRIDGE_CAST_EXPR = CursorKind(141)\n\n# Represents a C++0x pack expansion that produces a sequence of\n# expressions.\n#\n# A pack expansion expression contains a pattern (which itself is an\n# expression) followed by an ellipsis. For example:\nCursorKind.PACK_EXPANSION_EXPR = CursorKind(142)\n\n# Represents an expression that computes the length of a parameter\n# pack.\nCursorKind.SIZE_OF_PACK_EXPR = CursorKind(143)\n\n# A statement whose specific kind is not exposed via this interface.\n#\n# Unexposed statements have the same operations as any other kind of statement;\n# one can extract their location information, spelling, children, etc. However,\n# the specific kind of the statement is not reported.\nCursorKind.UNEXPOSED_STMT = CursorKind(200)\n\n# A labelled statement in a function.\nCursorKind.LABEL_STMT = CursorKind(201)\n\n# A compound statement\nCursorKind.COMPOUND_STMT = CursorKind(202)\n\n# A case statement.\nCursorKind.CASE_STMT = CursorKind(203)\n\n# A default statement.\nCursorKind.DEFAULT_STMT = CursorKind(204)\n\n# An if statement.\nCursorKind.IF_STMT = CursorKind(205)\n\n# A switch statement.\nCursorKind.SWITCH_STMT = CursorKind(206)\n\n# A while statement.\nCursorKind.WHILE_STMT = CursorKind(207)\n\n# A do statement.\nCursorKind.DO_STMT = CursorKind(208)\n\n# A for statement.\nCursorKind.FOR_STMT = CursorKind(209)\n\n# A goto statement.\nCursorKind.GOTO_STMT = CursorKind(210)\n\n# An indirect goto statement.\nCursorKind.INDIRECT_GOTO_STMT = CursorKind(211)\n\n# A continue statement.\nCursorKind.CONTINUE_STMT = CursorKind(212)\n\n# A break statement.\nCursorKind.BREAK_STMT = CursorKind(213)\n\n# A return statement.\nCursorKind.RETURN_STMT = CursorKind(214)\n\n# A GNU-style inline assembler statement.\nCursorKind.ASM_STMT = CursorKind(215)\n\n# Objective-C's overall @try-@catch-@finally statement.\nCursorKind.OBJC_AT_TRY_STMT = CursorKind(216)\n\n# Objective-C's @catch statement.\nCursorKind.OBJC_AT_CATCH_STMT = CursorKind(217)\n\n# Objective-C's @finally statement.\nCursorKind.OBJC_AT_FINALLY_STMT = CursorKind(218)\n\n# Objective-C's @throw statement.\nCursorKind.OBJC_AT_THROW_STMT = CursorKind(219)\n\n# Objective-C's @synchronized statement.\nCursorKind.OBJC_AT_SYNCHRONIZED_STMT = CursorKind(220)\n\n# Objective-C's autorealease pool statement.\nCursorKind.OBJC_AUTORELEASE_POOL_STMT = CursorKind(221)\n\n# Objective-C's for collection statement.\nCursorKind.OBJC_FOR_COLLECTION_STMT = CursorKind(222)\n\n# C++'s catch statement.\nCursorKind.CXX_CATCH_STMT = CursorKind(223)\n\n# C++'s try statement.\nCursorKind.CXX_TRY_STMT = CursorKind(224)\n\n# C++'s for (* : *) statement.\nCursorKind.CXX_FOR_RANGE_STMT = CursorKind(225)\n\n# Windows Structured Exception Handling's try statement.\nCursorKind.SEH_TRY_STMT = CursorKind(226)\n\n# Windows Structured Exception Handling's except statement.\nCursorKind.SEH_EXCEPT_STMT = CursorKind(227)\n\n# Windows Structured Exception Handling's finally statement.\nCursorKind.SEH_FINALLY_STMT = CursorKind(228)\n\n# The null statement.\nCursorKind.NULL_STMT = CursorKind(230)\n\n# Adaptor class for mixing declarations with statements and expressions.\nCursorKind.DECL_STMT = CursorKind(231)\n\n###\n# Other Kinds\n\n# Cursor that represents the translation unit itself.\n#\n# The translation unit cursor exists primarily to act as the root cursor for\n# traversing the contents of a translation unit.\nCursorKind.TRANSLATION_UNIT = CursorKind(300)\n\n###\n# Attributes\n\n# An attribute whoe specific kind is note exposed via this interface\nCursorKind.UNEXPOSED_ATTR = CursorKind(400)\n\nCursorKind.IB_ACTION_ATTR = CursorKind(401)\nCursorKind.IB_OUTLET_ATTR = CursorKind(402)\nCursorKind.IB_OUTLET_COLLECTION_ATTR = CursorKind(403)\n\nCursorKind.CXX_FINAL_ATTR = CursorKind(404)\nCursorKind.CXX_OVERRIDE_ATTR = CursorKind(405)\nCursorKind.ANNOTATE_ATTR = CursorKind(406)\nCursorKind.ASM_LABEL_ATTR = CursorKind(407)\n\n###\n# Preprocessing\nCursorKind.PREPROCESSING_DIRECTIVE = CursorKind(500)\nCursorKind.MACRO_DEFINITION = CursorKind(501)\nCursorKind.MACRO_INSTANTIATION = CursorKind(502)\nCursorKind.INCLUSION_DIRECTIVE = CursorKind(503)\n\n### Cursors ###\n\nclass Cursor(Structure):\n    \"\"\"\n    The Cursor class represents a reference to an element within the AST. It\n    acts as a kind of iterator.\n    \"\"\"\n    _fields_ = [(\"_kind_id\", c_int), (\"xdata\", c_int), (\"data\", c_void_p * 3)]\n\n    @staticmethod\n    def from_location(tu, location):\n        # We store a reference to the TU in the instance so the TU won't get\n        # collected before the cursor.\n        cursor = conf.lib.clang_getCursor(tu, location)\n        cursor._tu = tu\n\n        return cursor\n\n    def __eq__(self, other):\n        return conf.lib.clang_equalCursors(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def is_definition(self):\n        \"\"\"\n        Returns true if the declaration pointed at by the cursor is also a\n        definition of that entity.\n        \"\"\"\n        return conf.lib.clang_isCursorDefinition(self)\n\n    def is_static_method(self):\n        \"\"\"Returns True if the cursor refers to a C++ member function or member\n        function template that is declared 'static'.\n        \"\"\"\n        return conf.lib.clang_CXXMethod_isStatic(self)\n\n    def get_definition(self):\n        \"\"\"\n        If the cursor is a reference to a declaration or a declaration of\n        some entity, return a cursor that points to the definition of that\n        entity.\n        \"\"\"\n        # TODO: Should probably check that this is either a reference or\n        # declaration prior to issuing the lookup.\n        return conf.lib.clang_getCursorDefinition(self)\n\n    def get_usr(self):\n        \"\"\"Return the Unified Symbol Resultion (USR) for the entity referenced\n        by the given cursor (or None).\n\n        A Unified Symbol Resolution (USR) is a string that identifies a\n        particular entity (function, class, variable, etc.) within a\n        program. USRs can be compared across translation units to determine,\n        e.g., when references in one translation refer to an entity defined in\n        another translation unit.\"\"\"\n        return conf.lib.clang_getCursorUSR(self)\n\n    @property\n    def kind(self):\n        \"\"\"Return the kind of this cursor.\"\"\"\n        return CursorKind.from_id(self._kind_id)\n\n    @property\n    def spelling(self):\n        \"\"\"Return the spelling of the entity pointed at by the cursor.\"\"\"\n        if not self.kind.is_declaration():\n            # FIXME: clang_getCursorSpelling should be fixed to not assert on\n            # this, for consistency with clang_getCursorUSR.\n            return None\n        if not hasattr(self, '_spelling'):\n            self._spelling = conf.lib.clang_getCursorSpelling(self)\n\n        return self._spelling\n\n    @property\n    def displayname(self):\n        \"\"\"\n        Return the display name for the entity referenced by this cursor.\n\n        The display name contains extra information that helps identify the cursor,\n        such as the parameters of a function or template or the arguments of a\n        class template specialization.\n        \"\"\"\n        if not hasattr(self, '_displayname'):\n            self._displayname = conf.lib.clang_getCursorDisplayName(self)\n\n        return self._displayname\n\n    @property\n    def location(self):\n        \"\"\"\n        Return the source location (the starting character) of the entity\n        pointed at by the cursor.\n        \"\"\"\n        if not hasattr(self, '_loc'):\n            self._loc = conf.lib.clang_getCursorLocation(self)\n\n        return self._loc\n\n    @property\n    def extent(self):\n        \"\"\"\n        Return the source range (the range of text) occupied by the entity\n        pointed at by the cursor.\n        \"\"\"\n        if not hasattr(self, '_extent'):\n            self._extent = conf.lib.clang_getCursorExtent(self)\n\n        return self._extent\n\n    @property\n    def type(self):\n        \"\"\"\n        Retrieve the Type (if any) of the entity pointed at by the cursor.\n        \"\"\"\n        if not hasattr(self, '_type'):\n            self._type = conf.lib.clang_getCursorType(self)\n\n        return self._type\n\n    @property\n    def canonical(self):\n        \"\"\"Return the canonical Cursor corresponding to this Cursor.\n\n        The canonical cursor is the cursor which is representative for the\n        underlying entity. For example, if you have multiple forward\n        declarations for the same class, the canonical cursor for the forward\n        declarations will be identical.\n        \"\"\"\n        if not hasattr(self, '_canonical'):\n            self._canonical = conf.lib.clang_getCanonicalCursor(self)\n\n        return self._canonical\n\n    @property\n    def result_type(self):\n        \"\"\"Retrieve the Type of the result for this Cursor.\"\"\"\n        if not hasattr(self, '_result_type'):\n            self._result_type = conf.lib.clang_getResultType(self.type)\n\n        return self._result_type\n\n    @property\n    def underlying_typedef_type(self):\n        \"\"\"Return the underlying type of a typedef declaration.\n\n        Returns a Type for the typedef this cursor is a declaration for. If\n        the current cursor is not a typedef, this raises.\n        \"\"\"\n        if not hasattr(self, '_underlying_type'):\n            assert self.kind.is_declaration()\n            self._underlying_type = \\\n              conf.lib.clang_getTypedefDeclUnderlyingType(self)\n\n        return self._underlying_type\n\n    @property\n    def enum_type(self):\n        \"\"\"Return the integer type of an enum declaration.\n\n        Returns a Type corresponding to an integer. If the cursor is not for an\n        enum, this raises.\n        \"\"\"\n        if not hasattr(self, '_enum_type'):\n            assert self.kind == CursorKind.ENUM_DECL\n            self._enum_type = conf.lib.clang_getEnumDeclIntegerType(self)\n\n        return self._enum_type\n\n    @property\n    def enum_value(self):\n        \"\"\"Return the value of an enum constant.\"\"\"\n        if not hasattr(self, '_enum_value'):\n            assert self.kind == CursorKind.ENUM_CONSTANT_DECL\n            # Figure out the underlying type of the enum to know if it\n            # is a signed or unsigned quantity.\n            underlying_type = self.type\n            if underlying_type.kind == TypeKind.ENUM:\n                underlying_type = underlying_type.get_declaration().enum_type\n            if underlying_type.kind in (TypeKind.CHAR_U,\n                                        TypeKind.UCHAR,\n                                        TypeKind.CHAR16,\n                                        TypeKind.CHAR32,\n                                        TypeKind.USHORT,\n                                        TypeKind.UINT,\n                                        TypeKind.ULONG,\n                                        TypeKind.ULONGLONG,\n                                        TypeKind.UINT128):\n                self._enum_value = \\\n                  conf.lib.clang_getEnumConstantDeclUnsignedValue(self)\n            else:\n                self._enum_value = conf.lib.clang_getEnumConstantDeclValue(self)\n        return self._enum_value\n\n    @property\n    def objc_type_encoding(self):\n        \"\"\"Return the Objective-C type encoding as a str.\"\"\"\n        if not hasattr(self, '_objc_type_encoding'):\n            self._objc_type_encoding = \\\n              conf.lib.clang_getDeclObjCTypeEncoding(self)\n\n        return self._objc_type_encoding\n\n    @property\n    def hash(self):\n        \"\"\"Returns a hash of the cursor as an int.\"\"\"\n        if not hasattr(self, '_hash'):\n            self._hash = conf.lib.clang_hashCursor(self)\n\n        return self._hash\n\n    @property\n    def semantic_parent(self):\n        \"\"\"Return the semantic parent for this cursor.\"\"\"\n        if not hasattr(self, '_semantic_parent'):\n            self._semantic_parent = conf.lib.clang_getCursorSemanticParent(self)\n\n        return self._semantic_parent\n\n    @property\n    def lexical_parent(self):\n        \"\"\"Return the lexical parent for this cursor.\"\"\"\n        if not hasattr(self, '_lexical_parent'):\n            self._lexical_parent = conf.lib.clang_getCursorLexicalParent(self)\n\n        return self._lexical_parent\n\n    @property\n    def translation_unit(self):\n        \"\"\"Returns the TranslationUnit to which this Cursor belongs.\"\"\"\n        # If this triggers an AttributeError, the instance was not properly\n        # created.\n        return self._tu\n\n    @property\n    def referenced(self):\n        \"\"\"\n        For a cursor that is a reference, returns a cursor \n        representing the entity that it references.\n        \"\"\"\n        if not hasattr(self, '_referenced'):\n            self._referenced = conf.lib.clang_getCursorReferenced(self)\n\n        return self._referenced\n\n    def get_arguments(self):\n        \"\"\"Return an iterator for accessing the arguments of this cursor.\"\"\"\n        num_args = conf.lib.clang_Cursor_getNumArguments(self)\n        for i in range(0, num_args):\n            yield conf.lib.clang_Cursor_getArgument(self, i)\n\n    def get_children(self):\n        \"\"\"Return an iterator for accessing the children of this cursor.\"\"\"\n\n        # FIXME: Expose iteration from CIndex, PR6125.\n        def visitor(child, parent, children):\n            # FIXME: Document this assertion in API.\n            # FIXME: There should just be an isNull method.\n            assert child != conf.lib.clang_getNullCursor()\n\n            # Create reference to TU so it isn't GC'd before Cursor.\n            child._tu = self._tu\n            children.append(child)\n            return 1 # continue\n        children = []\n        conf.lib.clang_visitChildren(self, callbacks['cursor_visit'](visitor),\n            children)\n        return iter(children)\n\n    def get_tokens(self):\n        \"\"\"Obtain Token instances formulating that compose this Cursor.\n\n        This is a generator for Token instances. It returns all tokens which\n        occupy the extent this cursor occupies.\n        \"\"\"\n        return TokenGroup.get_tokens(self._tu, self.extent)\n\n    def is_bitfield(self):\n        \"\"\"\n        Check if the field is a bitfield.\n        \"\"\"\n        return conf.lib.clang_Cursor_isBitField(self)\n\n    def get_bitfield_width(self):\n        \"\"\"\n        Retrieve the width of a bitfield.\n        \"\"\"\n        return conf.lib.clang_getFieldDeclBitWidth(self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        assert isinstance(res, Cursor)\n        # FIXME: There should just be an isNull method.\n        if res == conf.lib.clang_getNullCursor():\n            return None\n\n        # Store a reference to the TU in the Python object so it won't get GC'd\n        # before the Cursor.\n        tu = None\n        for arg in args:\n            if isinstance(arg, TranslationUnit):\n                tu = arg\n                break\n\n            if hasattr(arg, 'translation_unit'):\n                tu = arg.translation_unit\n                break\n\n        assert tu is not None\n\n        res._tu = tu\n        return res\n\n    @staticmethod\n    def from_cursor_result(res, fn, args):\n        assert isinstance(res, Cursor)\n        if res == conf.lib.clang_getNullCursor():\n            return None\n\n        res._tu = args[0]._tu\n        return res\n\n### Type Kinds ###\n\nclass TypeKind(object):\n    \"\"\"\n    Describes the kind of type.\n    \"\"\"\n\n    # The unique kind objects, indexed by id.\n    _kinds = []\n    _name_map = None\n\n    def __init__(self, value):\n        if value >= len(TypeKind._kinds):\n            TypeKind._kinds += [None] * (value - len(TypeKind._kinds) + 1)\n        if TypeKind._kinds[value] is not None:\n            raise ValueError,'TypeKind already loaded'\n        self.value = value\n        TypeKind._kinds[value] = self\n        TypeKind._name_map = None\n\n    def from_param(self):\n        return self.value\n\n    @property\n    def name(self):\n        \"\"\"Get the enumeration name of this cursor kind.\"\"\"\n        if self._name_map is None:\n            self._name_map = {}\n            for key,value in TypeKind.__dict__.items():\n                if isinstance(value,TypeKind):\n                    self._name_map[value] = key\n        return self._name_map[self]\n\n    @property\n    def spelling(self):\n        \"\"\"Retrieve the spelling of this TypeKind.\"\"\"\n        return conf.lib.clang_getTypeKindSpelling(self.value)\n\n    @staticmethod\n    def from_id(id):\n        if id >= len(TypeKind._kinds) or TypeKind._kinds[id] is None:\n            raise ValueError,'Unknown type kind %d' % id\n        return TypeKind._kinds[id]\n\n    def __repr__(self):\n        return 'TypeKind.%s' % (self.name,)\n\nTypeKind.INVALID = TypeKind(0)\nTypeKind.UNEXPOSED = TypeKind(1)\nTypeKind.VOID = TypeKind(2)\nTypeKind.BOOL = TypeKind(3)\nTypeKind.CHAR_U = TypeKind(4)\nTypeKind.UCHAR = TypeKind(5)\nTypeKind.CHAR16 = TypeKind(6)\nTypeKind.CHAR32 = TypeKind(7)\nTypeKind.USHORT = TypeKind(8)\nTypeKind.UINT = TypeKind(9)\nTypeKind.ULONG = TypeKind(10)\nTypeKind.ULONGLONG = TypeKind(11)\nTypeKind.UINT128 = TypeKind(12)\nTypeKind.CHAR_S = TypeKind(13)\nTypeKind.SCHAR = TypeKind(14)\nTypeKind.WCHAR = TypeKind(15)\nTypeKind.SHORT = TypeKind(16)\nTypeKind.INT = TypeKind(17)\nTypeKind.LONG = TypeKind(18)\nTypeKind.LONGLONG = TypeKind(19)\nTypeKind.INT128 = TypeKind(20)\nTypeKind.FLOAT = TypeKind(21)\nTypeKind.DOUBLE = TypeKind(22)\nTypeKind.LONGDOUBLE = TypeKind(23)\nTypeKind.NULLPTR = TypeKind(24)\nTypeKind.OVERLOAD = TypeKind(25)\nTypeKind.DEPENDENT = TypeKind(26)\nTypeKind.OBJCID = TypeKind(27)\nTypeKind.OBJCCLASS = TypeKind(28)\nTypeKind.OBJCSEL = TypeKind(29)\nTypeKind.COMPLEX = TypeKind(100)\nTypeKind.POINTER = TypeKind(101)\nTypeKind.BLOCKPOINTER = TypeKind(102)\nTypeKind.LVALUEREFERENCE = TypeKind(103)\nTypeKind.RVALUEREFERENCE = TypeKind(104)\nTypeKind.RECORD = TypeKind(105)\nTypeKind.ENUM = TypeKind(106)\nTypeKind.TYPEDEF = TypeKind(107)\nTypeKind.OBJCINTERFACE = TypeKind(108)\nTypeKind.OBJCOBJECTPOINTER = TypeKind(109)\nTypeKind.FUNCTIONNOPROTO = TypeKind(110)\nTypeKind.FUNCTIONPROTO = TypeKind(111)\nTypeKind.CONSTANTARRAY = TypeKind(112)\nTypeKind.VECTOR = TypeKind(113)\n\nclass Type(Structure):\n    \"\"\"\n    The type of an element in the abstract syntax tree.\n    \"\"\"\n    _fields_ = [(\"_kind_id\", c_int), (\"data\", c_void_p * 2)]\n\n    @property\n    def kind(self):\n        \"\"\"Return the kind of this type.\"\"\"\n        return TypeKind.from_id(self._kind_id)\n\n    def argument_types(self):\n        \"\"\"Retrieve a container for the non-variadic arguments for this type.\n\n        The returned object is iterable and indexable. Each item in the\n        container is a Type instance.\n        \"\"\"\n        class ArgumentsIterator(collections.Sequence):\n            def __init__(self, parent):\n                self.parent = parent\n                self.length = None\n\n            def __len__(self):\n                if self.length is None:\n                    self.length = conf.lib.clang_getNumArgTypes(self.parent)\n\n                return self.length\n\n            def __getitem__(self, key):\n                # FIXME Support slice objects.\n                if not isinstance(key, int):\n                    raise TypeError(\"Must supply a non-negative int.\")\n\n                if key < 0:\n                    raise IndexError(\"Only non-negative indexes are accepted.\")\n\n                if key >= len(self):\n                    raise IndexError(\"Index greater than container length: \"\n                                     \"%d > %d\" % ( key, len(self) ))\n\n                result = conf.lib.clang_getArgType(self.parent, key)\n                if result.kind == TypeKind.INVALID:\n                    raise IndexError(\"Argument could not be retrieved.\")\n\n                return result\n\n        assert self.kind == TypeKind.FUNCTIONPROTO\n        return ArgumentsIterator(self)\n\n    @property\n    def element_type(self):\n        \"\"\"Retrieve the Type of elements within this Type.\n\n        If accessed on a type that is not an array, complex, or vector type, an\n        exception will be raised.\n        \"\"\"\n        result = conf.lib.clang_getElementType(self)\n        if result.kind == TypeKind.INVALID:\n            raise Exception('Element type not available on this type.')\n\n        return result\n\n    @property\n    def element_count(self):\n        \"\"\"Retrieve the number of elements in this type.\n\n        Returns an int.\n\n        If the Type is not an array or vector, this raises.\n        \"\"\"\n        result = conf.lib.clang_getNumElements(self)\n        if result < 0:\n            raise Exception('Type does not have elements.')\n\n        return result\n\n    @property\n    def translation_unit(self):\n        \"\"\"The TranslationUnit to which this Type is associated.\"\"\"\n        # If this triggers an AttributeError, the instance was not properly\n        # instantiated.\n        return self._tu\n\n    @staticmethod\n    def from_result(res, fn, args):\n        assert isinstance(res, Type)\n\n        tu = None\n        for arg in args:\n            if hasattr(arg, 'translation_unit'):\n                tu = arg.translation_unit\n                break\n\n        assert tu is not None\n        res._tu = tu\n\n        return res\n\n    def get_canonical(self):\n        \"\"\"\n        Return the canonical type for a Type.\n\n        Clang's type system explicitly models typedefs and all the\n        ways a specific type can be represented.  The canonical type\n        is the underlying type with all the \"sugar\" removed.  For\n        example, if 'T' is a typedef for 'int', the canonical type for\n        'T' would be 'int'.\n        \"\"\"\n        return conf.lib.clang_getCanonicalType(self)\n\n    def is_const_qualified(self):\n        \"\"\"Determine whether a Type has the \"const\" qualifier set.\n\n        This does not look through typedefs that may have added \"const\"\n        at a different level.\n        \"\"\"\n        return conf.lib.clang_isConstQualifiedType(self)\n\n    def is_volatile_qualified(self):\n        \"\"\"Determine whether a Type has the \"volatile\" qualifier set.\n\n        This does not look through typedefs that may have added \"volatile\"\n        at a different level.\n        \"\"\"\n        return conf.lib.clang_isVolatileQualifiedType(self)\n\n    def is_restrict_qualified(self):\n        \"\"\"Determine whether a Type has the \"restrict\" qualifier set.\n\n        This does not look through typedefs that may have added \"restrict\" at\n        a different level.\n        \"\"\"\n        return conf.lib.clang_isRestrictQualifiedType(self)\n\n    def is_function_variadic(self):\n        \"\"\"Determine whether this function Type is a variadic function type.\"\"\"\n        assert self.kind == TypeKind.FUNCTIONPROTO\n\n        return conf.lib.clang_isFunctionTypeVariadic(self)\n\n    def is_pod(self):\n        \"\"\"Determine whether this Type represents plain old data (POD).\"\"\"\n        return conf.lib.clang_isPODType(self)\n\n    def get_pointee(self):\n        \"\"\"\n        For pointer types, returns the type of the pointee.\n        \"\"\"\n        return conf.lib.clang_getPointeeType(self)\n\n    def get_declaration(self):\n        \"\"\"\n        Return the cursor for the declaration of the given type.\n        \"\"\"\n        return conf.lib.clang_getTypeDeclaration(self)\n\n    def get_result(self):\n        \"\"\"\n        Retrieve the result type associated with a function type.\n        \"\"\"\n        return conf.lib.clang_getResultType(self)\n\n    def get_array_element_type(self):\n        \"\"\"\n        Retrieve the type of the elements of the array type.\n        \"\"\"\n        return conf.lib.clang_getArrayElementType(self)\n\n    def get_array_size(self):\n        \"\"\"\n        Retrieve the size of the constant array.\n        \"\"\"\n        return conf.lib.clang_getArraySize(self)\n\n    def get_align(self):\n        \"\"\"\n        Retrieve the alignment of the record.\n        \"\"\"\n        return conf.lib.clang_Type_getAlignOf(self)\n\n    def get_size(self):\n        \"\"\"\n        Retrieve the size of the record.\n        \"\"\"\n        return conf.lib.clang_Type_getSizeOf(self)\n\n    def get_offset(self, fieldname):\n        \"\"\"\n        Retrieve the offset of a field in the record.\n        \"\"\"\n        return conf.lib.clang_Type_getOffsetOf(self, c_char_p(fieldname))\n\n    def __eq__(self, other):\n        if type(other) != type(self):\n            return False\n\n        return conf.lib.clang_equalTypes(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n## CIndex Objects ##\n\n# CIndex objects (derived from ClangObject) are essentially lightweight\n# wrappers attached to some underlying object, which is exposed via CIndex as\n# a void*.\n\nclass ClangObject(object):\n    \"\"\"\n    A helper for Clang objects. This class helps act as an intermediary for\n    the ctypes library and the Clang CIndex library.\n    \"\"\"\n    def __init__(self, obj):\n        assert isinstance(obj, c_object_p) and obj\n        self.obj = self._as_parameter_ = obj\n\n    def from_param(self):\n        return self._as_parameter_\n\n\nclass _CXUnsavedFile(Structure):\n    \"\"\"Helper for passing unsaved file arguments.\"\"\"\n    _fields_ = [(\"name\", c_char_p), (\"contents\", c_char_p), ('length', c_ulong)]\n\n# Functions calls through the python interface are rather slow. Fortunately,\n# for most symboles, we do not need to perform a function call. Their spelling\n# never changes and is consequently provided by this spelling cache.\nSpellingCache = {\n            # 0: CompletionChunk.Kind(\"Optional\"),\n            # 1: CompletionChunk.Kind(\"TypedText\"),\n            # 2: CompletionChunk.Kind(\"Text\"),\n            # 3: CompletionChunk.Kind(\"Placeholder\"),\n            # 4: CompletionChunk.Kind(\"Informative\"),\n            # 5 : CompletionChunk.Kind(\"CurrentParameter\"),\n            6: '(',   # CompletionChunk.Kind(\"LeftParen\"),\n            7: ')',   # CompletionChunk.Kind(\"RightParen\"),\n            8: ']',   # CompletionChunk.Kind(\"LeftBracket\"),\n            9: ']',   # CompletionChunk.Kind(\"RightBracket\"),\n            10: '{',  # CompletionChunk.Kind(\"LeftBrace\"),\n            11: '}',  # CompletionChunk.Kind(\"RightBrace\"),\n            12: '<',  # CompletionChunk.Kind(\"LeftAngle\"),\n            13: '>',  # CompletionChunk.Kind(\"RightAngle\"),\n            14: ', ', # CompletionChunk.Kind(\"Comma\"),\n            # 15: CompletionChunk.Kind(\"ResultType\"),\n            16: ':',  # CompletionChunk.Kind(\"Colon\"),\n            17: ';',  # CompletionChunk.Kind(\"SemiColon\"),\n            18: '=',  # CompletionChunk.Kind(\"Equal\"),\n            19: ' ',  # CompletionChunk.Kind(\"HorizontalSpace\"),\n            # 20: CompletionChunk.Kind(\"VerticalSpace\")\n}\n\nclass CompletionChunk:\n    class Kind:\n        def __init__(self, name):\n            self.name = name\n\n        def __str__(self):\n            return self.name\n\n        def __repr__(self):\n            return \"<ChunkKind: %s>\" % self\n\n    def __init__(self, completionString, key):\n        self.cs = completionString\n        self.key = key\n        self.__kindNumberCache = -1\n\n    def __repr__(self):\n        return \"{'\" + self.spelling + \"', \" + str(self.kind) + \"}\"\n\n    @CachedProperty\n    def spelling(self):\n        if self.__kindNumber in SpellingCache:\n                return SpellingCache[self.__kindNumber]\n        return conf.lib.clang_getCompletionChunkText(self.cs, self.key).spelling\n\n    # We do not use @CachedProperty here, as the manual implementation is\n    # apparently still significantly faster. Please profile carefully if you\n    # would like to add CachedProperty back.\n    @property\n    def __kindNumber(self):\n        if self.__kindNumberCache == -1:\n            self.__kindNumberCache = \\\n                conf.lib.clang_getCompletionChunkKind(self.cs, self.key)\n        return self.__kindNumberCache\n\n    @CachedProperty\n    def kind(self):\n        return completionChunkKindMap[self.__kindNumber]\n\n    @CachedProperty\n    def string(self):\n        res = conf.lib.clang_getCompletionChunkCompletionString(self.cs,\n                                                                self.key)\n\n        if (res):\n          return CompletionString(res)\n        else:\n          None\n\n    def isKindOptional(self):\n      return self.__kindNumber == 0\n\n    def isKindTypedText(self):\n      return self.__kindNumber == 1\n\n    def isKindPlaceHolder(self):\n      return self.__kindNumber == 3\n\n    def isKindInformative(self):\n      return self.__kindNumber == 4\n\n    def isKindResultType(self):\n      return self.__kindNumber == 15\n\ncompletionChunkKindMap = {\n            0: CompletionChunk.Kind(\"Optional\"),\n            1: CompletionChunk.Kind(\"TypedText\"),\n            2: CompletionChunk.Kind(\"Text\"),\n            3: CompletionChunk.Kind(\"Placeholder\"),\n            4: CompletionChunk.Kind(\"Informative\"),\n            5: CompletionChunk.Kind(\"CurrentParameter\"),\n            6: CompletionChunk.Kind(\"LeftParen\"),\n            7: CompletionChunk.Kind(\"RightParen\"),\n            8: CompletionChunk.Kind(\"LeftBracket\"),\n            9: CompletionChunk.Kind(\"RightBracket\"),\n            10: CompletionChunk.Kind(\"LeftBrace\"),\n            11: CompletionChunk.Kind(\"RightBrace\"),\n            12: CompletionChunk.Kind(\"LeftAngle\"),\n            13: CompletionChunk.Kind(\"RightAngle\"),\n            14: CompletionChunk.Kind(\"Comma\"),\n            15: CompletionChunk.Kind(\"ResultType\"),\n            16: CompletionChunk.Kind(\"Colon\"),\n            17: CompletionChunk.Kind(\"SemiColon\"),\n            18: CompletionChunk.Kind(\"Equal\"),\n            19: CompletionChunk.Kind(\"HorizontalSpace\"),\n            20: CompletionChunk.Kind(\"VerticalSpace\")}\n\nclass CompletionString(ClangObject):\n    class Availability:\n        def __init__(self, name):\n            self.name = name\n\n        def __str__(self):\n            return self.name\n\n        def __repr__(self):\n            return \"<Availability: %s>\" % self\n\n    def __len__(self):\n        self.num_chunks\n\n    @CachedProperty\n    def num_chunks(self):\n        return conf.lib.clang_getNumCompletionChunks(self.obj)\n\n    def __getitem__(self, key):\n        if self.num_chunks <= key:\n            raise IndexError\n        return CompletionChunk(self.obj, key)\n\n    @property\n    def priority(self):\n        return conf.lib.clang_getCompletionPriority(self.obj)\n\n    @property\n    def availability(self):\n        res = conf.lib.clang_getCompletionAvailability(self.obj)\n        return availabilityKinds[res]\n\n    @property\n    def briefComment(self):\n        if conf.function_exists(\"clang_getCompletionBriefComment\"):\n            return conf.lib.clang_getCompletionBriefComment(self.obj)\n        return _CXString()\n\n    def __repr__(self):\n        return \" | \".join([str(a) for a in self]) \\\n               + \" || Priority: \" + str(self.priority) \\\n               + \" || Availability: \" + str(self.availability) \\\n               + \" || Brief comment: \" + str(self.briefComment.spelling)\n\navailabilityKinds = {\n            0: CompletionChunk.Kind(\"Available\"),\n            1: CompletionChunk.Kind(\"Deprecated\"),\n            2: CompletionChunk.Kind(\"NotAvailable\"),\n            3: CompletionChunk.Kind(\"NotAccessible\")}\n\nclass CodeCompletionResult(Structure):\n    _fields_ = [('cursorKind', c_int), ('completionString', c_object_p)]\n\n    def __repr__(self):\n        return str(CompletionString(self.completionString))\n\n    @property\n    def kind(self):\n        return CursorKind.from_id(self.cursorKind)\n\n    @property\n    def string(self):\n        return CompletionString(self.completionString)\n\nclass CCRStructure(Structure):\n    _fields_ = [('results', POINTER(CodeCompletionResult)),\n                ('numResults', c_int)]\n\n    def __len__(self):\n        return self.numResults\n\n    def __getitem__(self, key):\n        if len(self) <= key:\n            raise IndexError\n\n        return self.results[key]\n\nclass CodeCompletionResults(ClangObject):\n    def __init__(self, ptr):\n        assert isinstance(ptr, POINTER(CCRStructure)) and ptr\n        self.ptr = self._as_parameter_ = ptr\n\n    def from_param(self):\n        return self._as_parameter_\n\n    def __del__(self):\n        conf.lib.clang_disposeCodeCompleteResults(self)\n\n    @property\n    def results(self):\n        return self.ptr.contents\n\n    @property\n    def diagnostics(self):\n        class DiagnosticsItr:\n            def __init__(self, ccr):\n                self.ccr= ccr\n\n            def __len__(self):\n                return int(\\\n                  conf.lib.clang_codeCompleteGetNumDiagnostics(self.ccr))\n\n            def __getitem__(self, key):\n                return conf.lib.clang_codeCompleteGetDiagnostic(self.ccr, key)\n\n        return DiagnosticsItr(self)\n\n\nclass Index(ClangObject):\n    \"\"\"\n    The Index type provides the primary interface to the Clang CIndex library,\n    primarily by providing an interface for reading and parsing translation\n    units.\n    \"\"\"\n\n    @staticmethod\n    def create(excludeDecls=False):\n        \"\"\"\n        Create a new Index.\n        Parameters:\n        excludeDecls -- Exclude local declarations from translation units.\n        \"\"\"\n        return Index(conf.lib.clang_createIndex(excludeDecls, 0))\n\n    def __del__(self):\n        conf.lib.clang_disposeIndex(self)\n\n    def read(self, path):\n        \"\"\"Load a TranslationUnit from the given AST file.\"\"\"\n        return TranslationUnit.from_ast(path, self)\n\n    def parse(self, path, args=None, unsaved_files=None, options = 0):\n        \"\"\"Load the translation unit from the given source code file by running\n        clang and generating the AST before loading. Additional command line\n        parameters can be passed to clang via the args parameter.\n\n        In-memory contents for files can be provided by passing a list of pairs\n        to as unsaved_files, the first item should be the filenames to be mapped\n        and the second should be the contents to be substituted for the\n        file. The contents may be passed as strings or file objects.\n\n        If an error was encountered during parsing, a TranslationUnitLoadError\n        will be raised.\n        \"\"\"\n        return TranslationUnit.from_source(path, args, unsaved_files, options,\n                                           self)\n\nclass TranslationUnit(ClangObject):\n    \"\"\"Represents a source code translation unit.\n\n    This is one of the main types in the API. Any time you wish to interact\n    with Clang's representation of a source file, you typically start with a\n    translation unit.\n    \"\"\"\n\n    # Default parsing mode.\n    PARSE_NONE = 0\n\n    # Instruct the parser to create a detailed processing record containing\n    # metadata not normally retained.\n    PARSE_DETAILED_PROCESSING_RECORD = 1\n\n    # Indicates that the translation unit is incomplete. This is typically used\n    # when parsing headers.\n    PARSE_INCOMPLETE = 2\n\n    # Instruct the parser to create a pre-compiled preamble for the translation\n    # unit. This caches the preamble (included files at top of source file).\n    # This is useful if the translation unit will be reparsed and you don't\n    # want to incur the overhead of reparsing the preamble.\n    PARSE_PRECOMPILED_PREAMBLE = 4\n\n    # Cache code completion information on parse. This adds time to parsing but\n    # speeds up code completion.\n    PARSE_CACHE_COMPLETION_RESULTS = 8\n\n    # Flags with values 16 and 32 are deprecated and intentionally omitted.\n\n    # Do not parse function bodies. This is useful if you only care about\n    # searching for declarations/definitions.\n    PARSE_SKIP_FUNCTION_BODIES = 64\n\n    # Used to indicate that brief documentation comments should be included\n    # into the set of code completions returned from this translation unit.\n    PARSE_INCLUDE_BRIEF_COMMENTS_IN_CODE_COMPLETION = 128\n\n    @classmethod\n    def from_source(cls, filename, args=None, unsaved_files=None, options=0,\n                    index=None):\n        \"\"\"Create a TranslationUnit by parsing source.\n\n        This is capable of processing source code both from files on the\n        filesystem as well as in-memory contents.\n\n        Command-line arguments that would be passed to clang are specified as\n        a list via args. These can be used to specify include paths, warnings,\n        etc. e.g. [\"-Wall\", \"-I/path/to/include\"].\n\n        In-memory file content can be provided via unsaved_files. This is an\n        iterable of 2-tuples. The first element is the str filename. The\n        second element defines the content. Content can be provided as str\n        source code or as file objects (anything with a read() method). If\n        a file object is being used, content will be read until EOF and the\n        read cursor will not be reset to its original position.\n\n        options is a bitwise or of TranslationUnit.PARSE_XXX flags which will\n        control parsing behavior.\n\n        index is an Index instance to utilize. If not provided, a new Index\n        will be created for this TranslationUnit.\n\n        To parse source from the filesystem, the filename of the file to parse\n        is specified by the filename argument. Or, filename could be None and\n        the args list would contain the filename(s) to parse.\n\n        To parse source from an in-memory buffer, set filename to the virtual\n        filename you wish to associate with this source (e.g. \"test.c\"). The\n        contents of that file are then provided in unsaved_files.\n\n        If an error occurs, a TranslationUnitLoadError is raised.\n\n        Please note that a TranslationUnit with parser errors may be returned.\n        It is the caller's responsibility to check tu.diagnostics for errors.\n\n        Also note that Clang infers the source language from the extension of\n        the input filename. If you pass in source code containing a C++ class\n        declaration with the filename \"test.c\" parsing will fail.\n        \"\"\"\n        if args is None:\n            args = []\n\n        if unsaved_files is None:\n            unsaved_files = []\n\n        if index is None:\n            index = Index.create()\n\n        args_array = None\n        if len(args) > 0:\n            args_array = (c_char_p * len(args))(* args)\n\n        unsaved_array = None\n        if len(unsaved_files) > 0:\n            unsaved_array = (_CXUnsavedFile * len(unsaved_files))()\n            for i, (name, contents) in enumerate(unsaved_files):\n                if hasattr(contents, \"read\"):\n                    contents = contents.read()\n\n                unsaved_array[i].name = name\n                unsaved_array[i].contents = contents\n                unsaved_array[i].length = len(contents)\n\n        ptr = conf.lib.clang_parseTranslationUnit(index, filename, args_array,\n                                    len(args), unsaved_array,\n                                    len(unsaved_files), options)\n\n        if not ptr:\n            raise TranslationUnitLoadError(\"Error parsing translation unit.\")\n\n        return cls(ptr, index=index)\n\n    @classmethod\n    def from_ast_file(cls, filename, index=None):\n        \"\"\"Create a TranslationUnit instance from a saved AST file.\n\n        A previously-saved AST file (provided with -emit-ast or\n        TranslationUnit.save()) is loaded from the filename specified.\n\n        If the file cannot be loaded, a TranslationUnitLoadError will be\n        raised.\n\n        index is optional and is the Index instance to use. If not provided,\n        a default Index will be created.\n        \"\"\"\n        if index is None:\n            index = Index.create()\n\n        ptr = conf.lib.clang_createTranslationUnit(index, filename)\n        if not ptr:\n            raise TranslationUnitLoadError(filename)\n\n        return cls(ptr=ptr, index=index)\n\n    def __init__(self, ptr, index):\n        \"\"\"Create a TranslationUnit instance.\n\n        TranslationUnits should be created using one of the from_* @classmethod\n        functions above. __init__ is only called internally.\n        \"\"\"\n        assert isinstance(index, Index)\n\n        ClangObject.__init__(self, ptr)\n\n    def __del__(self):\n        conf.lib.clang_disposeTranslationUnit(self)\n\n    @property\n    def cursor(self):\n        \"\"\"Retrieve the cursor that represents the given translation unit.\"\"\"\n        return conf.lib.clang_getTranslationUnitCursor(self)\n\n    @property\n    def spelling(self):\n        \"\"\"Get the original translation unit source file name.\"\"\"\n        return conf.lib.clang_getTranslationUnitSpelling(self)\n\n    def get_includes(self):\n        \"\"\"\n        Return an iterable sequence of FileInclusion objects that describe the\n        sequence of inclusions in a translation unit. The first object in\n        this sequence is always the input file. Note that this method will not\n        recursively iterate over header files included through precompiled\n        headers.\n        \"\"\"\n        def visitor(fobj, lptr, depth, includes):\n            if depth > 0:\n                loc = lptr.contents\n                includes.append(FileInclusion(loc.file, File(fobj), loc, depth))\n\n        # Automatically adapt CIndex/ctype pointers to python objects\n        includes = []\n        conf.lib.clang_getInclusions(self,\n                callbacks['translation_unit_includes'](visitor), includes)\n\n        return iter(includes)\n\n    def get_file(self, filename):\n        \"\"\"Obtain a File from this translation unit.\"\"\"\n\n        return File.from_name(self, filename)\n\n    def get_location(self, filename, position):\n        \"\"\"Obtain a SourceLocation for a file in this translation unit.\n\n        The position can be specified by passing:\n\n          - Integer file offset. Initial file offset is 0.\n          - 2-tuple of (line number, column number). Initial file position is\n            (0, 0)\n        \"\"\"\n        f = self.get_file(filename)\n\n        if isinstance(position, int):\n            return SourceLocation.from_offset(self, f, position)\n\n        return SourceLocation.from_position(self, f, position[0], position[1])\n\n    def get_extent(self, filename, locations):\n        \"\"\"Obtain a SourceRange from this translation unit.\n\n        The bounds of the SourceRange must ultimately be defined by a start and\n        end SourceLocation. For the locations argument, you can pass:\n\n          - 2 SourceLocation instances in a 2-tuple or list.\n          - 2 int file offsets via a 2-tuple or list.\n          - 2 2-tuple or lists of (line, column) pairs in a 2-tuple or list.\n\n        e.g.\n\n        get_extent('foo.c', (5, 10))\n        get_extent('foo.c', ((1, 1), (1, 15)))\n        \"\"\"\n        f = self.get_file(filename)\n\n        if len(locations) < 2:\n            raise Exception('Must pass object with at least 2 elements')\n\n        start_location, end_location = locations\n\n        if hasattr(start_location, '__len__'):\n            start_location = SourceLocation.from_position(self, f,\n                start_location[0], start_location[1])\n        elif isinstance(start_location, int):\n            start_location = SourceLocation.from_offset(self, f,\n                start_location)\n\n        if hasattr(end_location, '__len__'):\n            end_location = SourceLocation.from_position(self, f,\n                end_location[0], end_location[1])\n        elif isinstance(end_location, int):\n            end_location = SourceLocation.from_offset(self, f, end_location)\n\n        assert isinstance(start_location, SourceLocation)\n        assert isinstance(end_location, SourceLocation)\n\n        return SourceRange.from_locations(start_location, end_location)\n\n    @property\n    def diagnostics(self):\n        \"\"\"\n        Return an iterable (and indexable) object containing the diagnostics.\n        \"\"\"\n        class DiagIterator:\n            def __init__(self, tu):\n                self.tu = tu\n\n            def __len__(self):\n                return int(conf.lib.clang_getNumDiagnostics(self.tu))\n\n            def __getitem__(self, key):\n                diag = conf.lib.clang_getDiagnostic(self.tu, key)\n                if not diag:\n                    raise IndexError\n                return Diagnostic(diag)\n\n        return DiagIterator(self)\n\n    def reparse(self, unsaved_files=None, options=0):\n        \"\"\"\n        Reparse an already parsed translation unit.\n\n        In-memory contents for files can be provided by passing a list of pairs\n        as unsaved_files, the first items should be the filenames to be mapped\n        and the second should be the contents to be substituted for the\n        file. The contents may be passed as strings or file objects.\n        \"\"\"\n        if unsaved_files is None:\n            unsaved_files = []\n\n        unsaved_files_array = 0\n        if len(unsaved_files):\n            unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))()\n            for i,(name,value) in enumerate(unsaved_files):\n                if not isinstance(value, str):\n                    # FIXME: It would be great to support an efficient version\n                    # of this, one day.\n                    value = value.read()\n                    print value\n                if not isinstance(value, str):\n                    raise TypeError,'Unexpected unsaved file contents.'\n                unsaved_files_array[i].name = name\n                unsaved_files_array[i].contents = value\n                unsaved_files_array[i].length = len(value)\n        ptr = conf.lib.clang_reparseTranslationUnit(self, len(unsaved_files),\n                unsaved_files_array, options)\n\n    def save(self, filename):\n        \"\"\"Saves the TranslationUnit to a file.\n\n        This is equivalent to passing -emit-ast to the clang frontend. The\n        saved file can be loaded back into a TranslationUnit. Or, if it\n        corresponds to a header, it can be used as a pre-compiled header file.\n\n        If an error occurs while saving, a TranslationUnitSaveError is raised.\n        If the error was TranslationUnitSaveError.ERROR_INVALID_TU, this means\n        the constructed TranslationUnit was not valid at time of save. In this\n        case, the reason(s) why should be available via\n        TranslationUnit.diagnostics().\n\n        filename -- The path to save the translation unit to.\n        \"\"\"\n        options = conf.lib.clang_defaultSaveOptions(self)\n        result = int(conf.lib.clang_saveTranslationUnit(self, filename,\n                                                        options))\n        if result != 0:\n            raise TranslationUnitSaveError(result,\n                'Error saving TranslationUnit.')\n\n    def codeComplete(self, path, line, column, unsaved_files=None,\n                     include_macros=False, include_code_patterns=False,\n                     include_brief_comments=False):\n        \"\"\"\n        Code complete in this translation unit.\n\n        In-memory contents for files can be provided by passing a list of pairs\n        as unsaved_files, the first items should be the filenames to be mapped\n        and the second should be the contents to be substituted for the\n        file. The contents may be passed as strings or file objects.\n        \"\"\"\n        options = 0\n\n        if include_macros:\n            options += 1\n\n        if include_code_patterns:\n            options += 2\n\n        if include_brief_comments:\n            options += 4\n\n        if unsaved_files is None:\n            unsaved_files = []\n\n        unsaved_files_array = 0\n        if len(unsaved_files):\n            unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))()\n            for i,(name,value) in enumerate(unsaved_files):\n                if not isinstance(value, str):\n                    # FIXME: It would be great to support an efficient version\n                    # of this, one day.\n                    value = value.read()\n                    print value\n                if not isinstance(value, str):\n                    raise TypeError,'Unexpected unsaved file contents.'\n                unsaved_files_array[i].name = name\n                unsaved_files_array[i].contents = value\n                unsaved_files_array[i].length = len(value)\n        ptr = conf.lib.clang_codeCompleteAt(self, path, line, column,\n                unsaved_files_array, len(unsaved_files), options)\n        if ptr:\n            return CodeCompletionResults(ptr)\n        return None\n\n    def get_tokens(self, locations=None, extent=None):\n        \"\"\"Obtain tokens in this translation unit.\n\n        This is a generator for Token instances. The caller specifies a range\n        of source code to obtain tokens for. The range can be specified as a\n        2-tuple of SourceLocation or as a SourceRange. If both are defined,\n        behavior is undefined.\n        \"\"\"\n        if locations is not None:\n            extent = SourceRange(start=locations[0], end=locations[1])\n\n        return TokenGroup.get_tokens(self, extent)\n\nclass File(ClangObject):\n    \"\"\"\n    The File class represents a particular source file that is part of a\n    translation unit.\n    \"\"\"\n\n    @staticmethod\n    def from_name(translation_unit, file_name):\n        \"\"\"Retrieve a file handle within the given translation unit.\"\"\"\n        return File(conf.lib.clang_getFile(translation_unit, file_name))\n\n    @property\n    def name(self):\n        \"\"\"Return the complete file and path name of the file.\"\"\"\n        return conf.lib.clang_getCString(conf.lib.clang_getFileName(self))\n\n    @property\n    def time(self):\n        \"\"\"Return the last modification time of the file.\"\"\"\n        return conf.lib.clang_getFileTime(self)\n\n    def __str__(self):\n        return self.name\n\n    def __repr__(self):\n        return \"<File: %s>\" % (self.name)\n\n    @staticmethod\n    def from_cursor_result(res, fn, args):\n        assert isinstance(res, File)\n\n        # Copy a reference to the TranslationUnit to prevent premature GC.\n        res._tu = args[0]._tu\n        return res\n\nclass FileInclusion(object):\n    \"\"\"\n    The FileInclusion class represents the inclusion of one source file by\n    another via a '#include' directive or as the input file for the translation\n    unit. This class provides information about the included file, the including\n    file, the location of the '#include' directive and the depth of the included\n    file in the stack. Note that the input file has depth 0.\n    \"\"\"\n\n    def __init__(self, src, tgt, loc, depth):\n        self.source = src\n        self.include = tgt\n        self.location = loc\n        self.depth = depth\n\n    @property\n    def is_input_file(self):\n        \"\"\"True if the included file is the input file.\"\"\"\n        return self.depth == 0\n\nclass CompilationDatabaseError(Exception):\n    \"\"\"Represents an error that occurred when working with a CompilationDatabase\n\n    Each error is associated to an enumerated value, accessible under\n    e.cdb_error. Consumers can compare the value with one of the ERROR_\n    constants in this class.\n    \"\"\"\n\n    # An unknown error occured\n    ERROR_UNKNOWN = 0\n\n    # The database could not be loaded\n    ERROR_CANNOTLOADDATABASE = 1\n\n    def __init__(self, enumeration, message):\n        assert isinstance(enumeration, int)\n\n        if enumeration > 1:\n            raise Exception(\"Encountered undefined CompilationDatabase error \"\n                            \"constant: %d. Please file a bug to have this \"\n                            \"value supported.\" % enumeration)\n\n        self.cdb_error = enumeration\n        Exception.__init__(self, 'Error %d: %s' % (enumeration, message))\n\nclass CompileCommand(object):\n    \"\"\"Represents the compile command used to build a file\"\"\"\n    def __init__(self, cmd, ccmds):\n        self.cmd = cmd\n        # Keep a reference to the originating CompileCommands\n        # to prevent garbage collection\n        self.ccmds = ccmds\n\n    @property\n    def directory(self):\n        \"\"\"Get the working directory for this CompileCommand\"\"\"\n        return conf.lib.clang_CompileCommand_getDirectory(self.cmd)\n\n    @property\n    def arguments(self):\n        \"\"\"\n        Get an iterable object providing each argument in the\n        command line for the compiler invocation as a _CXString.\n\n        Invariant : the first argument is the compiler executable\n        \"\"\"\n        length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd)\n        for i in xrange(length):\n            yield conf.lib.clang_CompileCommand_getArg(self.cmd, i)\n\nclass CompileCommands(object):\n    \"\"\"\n    CompileCommands is an iterable object containing all CompileCommand\n    that can be used for building a specific file.\n    \"\"\"\n    def __init__(self, ccmds):\n        self.ccmds = ccmds\n\n    def __del__(self):\n        conf.lib.clang_CompileCommands_dispose(self.ccmds)\n\n    def __len__(self):\n        return int(conf.lib.clang_CompileCommands_getSize(self.ccmds))\n\n    def __getitem__(self, i):\n        cc = conf.lib.clang_CompileCommands_getCommand(self.ccmds, i)\n        if not cc:\n            raise IndexError\n        return CompileCommand(cc, self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        if not res:\n            return None\n        return CompileCommands(res)\n\nclass CompilationDatabase(ClangObject):\n    \"\"\"\n    The CompilationDatabase is a wrapper class around\n    clang::tooling::CompilationDatabase\n\n    It enables querying how a specific source file can be built.\n    \"\"\"\n\n    def __del__(self):\n        conf.lib.clang_CompilationDatabase_dispose(self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        if not res:\n            raise CompilationDatabaseError(0,\n                                           \"CompilationDatabase loading failed\")\n        return CompilationDatabase(res)\n\n    @staticmethod\n    def fromDirectory(buildDir):\n        \"\"\"Builds a CompilationDatabase from the database found in buildDir\"\"\"\n        errorCode = c_uint()\n        try:\n            cdb = conf.lib.clang_CompilationDatabase_fromDirectory(buildDir,\n                byref(errorCode))\n        except CompilationDatabaseError as e:\n            raise CompilationDatabaseError(int(errorCode.value),\n                                           \"CompilationDatabase loading failed\")\n        return cdb\n\n    def getCompileCommands(self, filename):\n        \"\"\"\n        Get an iterable object providing all the CompileCommands available to\n        build filename. Returns None if filename is not found in the database.\n        \"\"\"\n        return conf.lib.clang_CompilationDatabase_getCompileCommands(self,\n                                                                     filename)\n\nclass Token(Structure):\n    \"\"\"Represents a single token from the preprocessor.\n\n    Tokens are effectively segments of source code. Source code is first parsed\n    into tokens before being converted into the AST and Cursors.\n\n    Tokens are obtained from parsed TranslationUnit instances. You currently\n    can't create tokens manually.\n    \"\"\"\n    _fields_ = [\n        ('int_data', c_uint * 4),\n        ('ptr_data', c_void_p)\n    ]\n\n    @property\n    def spelling(self):\n        \"\"\"The spelling of this token.\n\n        This is the textual representation of the token in source.\n        \"\"\"\n        return conf.lib.clang_getTokenSpelling(self._tu, self)\n\n    @property\n    def kind(self):\n        \"\"\"Obtain the TokenKind of the current token.\"\"\"\n        return TokenKind.from_value(conf.lib.clang_getTokenKind(self))\n\n    @property\n    def location(self):\n        \"\"\"The SourceLocation this Token occurs at.\"\"\"\n        return conf.lib.clang_getTokenLocation(self._tu, self)\n\n    @property\n    def extent(self):\n        \"\"\"The SourceRange this Token occupies.\"\"\"\n        return conf.lib.clang_getTokenExtent(self._tu, self)\n\n    @property\n    def cursor(self):\n        \"\"\"The Cursor this Token corresponds to.\"\"\"\n        cursor = Cursor()\n\n        conf.lib.clang_annotateTokens(self._tu, byref(self), 1, byref(cursor))\n\n        return cursor\n\n# Now comes the plumbing to hook up the C library.\n\n# Register callback types in common container.\ncallbacks['translation_unit_includes'] = CFUNCTYPE(None, c_object_p,\n        POINTER(SourceLocation), c_uint, py_object)\ncallbacks['cursor_visit'] = CFUNCTYPE(c_int, Cursor, Cursor, py_object)\n\n# Functions strictly alphabetical order.\nfunctionList = [\n  (\"clang_annotateTokens\",\n   [TranslationUnit, POINTER(Token), c_uint, POINTER(Cursor)]),\n\n  (\"clang_CompilationDatabase_dispose\",\n   [c_object_p]),\n\n  (\"clang_CompilationDatabase_fromDirectory\",\n   [c_char_p, POINTER(c_uint)],\n   c_object_p,\n   CompilationDatabase.from_result),\n\n  (\"clang_CompilationDatabase_getCompileCommands\",\n   [c_object_p, c_char_p],\n   c_object_p,\n   CompileCommands.from_result),\n\n  (\"clang_CompileCommands_dispose\",\n   [c_object_p]),\n\n  (\"clang_CompileCommands_getCommand\",\n   [c_object_p, c_uint],\n   c_object_p),\n\n  (\"clang_CompileCommands_getSize\",\n   [c_object_p],\n   c_uint),\n\n  (\"clang_CompileCommand_getArg\",\n   [c_object_p, c_uint],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_CompileCommand_getDirectory\",\n   [c_object_p],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_CompileCommand_getNumArgs\",\n   [c_object_p],\n   c_uint),\n\n  (\"clang_codeCompleteAt\",\n   [TranslationUnit, c_char_p, c_int, c_int, c_void_p, c_int, c_int],\n   POINTER(CCRStructure)),\n\n  (\"clang_codeCompleteGetDiagnostic\",\n   [CodeCompletionResults, c_int],\n   Diagnostic),\n\n  (\"clang_codeCompleteGetNumDiagnostics\",\n   [CodeCompletionResults],\n   c_int),\n\n  (\"clang_createIndex\",\n   [c_int, c_int],\n   c_object_p),\n\n  (\"clang_createTranslationUnit\",\n   [Index, c_char_p],\n   c_object_p),\n\n  (\"clang_CXXMethod_isStatic\",\n   [Cursor],\n   bool),\n\n  (\"clang_CXXMethod_isVirtual\",\n   [Cursor],\n   bool),\n\n  (\"clang_defaultSaveOptions\",\n   [TranslationUnit],\n   c_uint),\n\n  (\"clang_disposeCodeCompleteResults\",\n   [CodeCompletionResults]),\n\n# (\"clang_disposeCXTUResourceUsage\",\n#  [CXTUResourceUsage]),\n\n  (\"clang_disposeDiagnostic\",\n   [Diagnostic]),\n\n  (\"clang_disposeIndex\",\n   [Index]),\n\n  (\"clang_disposeString\",\n   [_CXString]),\n\n  (\"clang_disposeTokens\",\n   [TranslationUnit, POINTER(Token), c_uint]),\n\n  (\"clang_disposeTranslationUnit\",\n   [TranslationUnit]),\n\n  (\"clang_equalCursors\",\n   [Cursor, Cursor],\n   bool),\n\n  (\"clang_equalLocations\",\n   [SourceLocation, SourceLocation],\n   bool),\n\n  (\"clang_equalRanges\",\n   [SourceRange, SourceRange],\n   bool),\n\n  (\"clang_equalTypes\",\n   [Type, Type],\n   bool),\n\n  (\"clang_getArgType\",\n   [Type, c_uint],\n   Type,\n   Type.from_result),\n\n  (\"clang_getArrayElementType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getArraySize\",\n   [Type],\n   c_longlong),\n\n  (\"clang_getFieldDeclBitWidth\",\n   [Cursor],\n   c_int),\n\n  (\"clang_getCanonicalCursor\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getCanonicalType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getCompletionAvailability\",\n   [c_void_p],\n   c_int),\n\n  (\"clang_getCompletionBriefComment\",\n   [c_void_p],\n   _CXString),\n\n  (\"clang_getCompletionChunkCompletionString\",\n   [c_void_p, c_int],\n   c_object_p),\n\n  (\"clang_getCompletionChunkKind\",\n   [c_void_p, c_int],\n   c_int),\n\n  (\"clang_getCompletionChunkText\",\n   [c_void_p, c_int],\n   _CXString),\n\n  (\"clang_getCompletionPriority\",\n   [c_void_p],\n   c_int),\n\n  (\"clang_getCString\",\n   [_CXString],\n   c_char_p),\n\n  (\"clang_getCursor\",\n   [TranslationUnit, SourceLocation],\n   Cursor),\n\n  (\"clang_getCursorDefinition\",\n   [Cursor],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getCursorDisplayName\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getCursorExtent\",\n   [Cursor],\n   SourceRange),\n\n  (\"clang_getCursorLexicalParent\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getCursorLocation\",\n   [Cursor],\n   SourceLocation),\n\n  (\"clang_getCursorReferenced\",\n   [Cursor],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getCursorReferenceNameRange\",\n   [Cursor, c_uint, c_uint],\n   SourceRange),\n\n  (\"clang_getCursorSemanticParent\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getCursorSpelling\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getCursorType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getCursorUSR\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n# (\"clang_getCXTUResourceUsage\",\n#  [TranslationUnit],\n#  CXTUResourceUsage),\n\n  (\"clang_getCXXAccessSpecifier\",\n   [Cursor],\n   c_uint),\n\n  (\"clang_getDeclObjCTypeEncoding\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnostic\",\n   [c_object_p, c_uint],\n   c_object_p),\n\n  (\"clang_getDiagnosticCategory\",\n   [Diagnostic],\n   c_uint),\n\n  (\"clang_getDiagnosticCategoryName\",\n   [c_uint],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnosticFixIt\",\n   [Diagnostic, c_uint, POINTER(SourceRange)],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnosticLocation\",\n   [Diagnostic],\n   SourceLocation),\n\n  (\"clang_getDiagnosticNumFixIts\",\n   [Diagnostic],\n   c_uint),\n\n  (\"clang_getDiagnosticNumRanges\",\n   [Diagnostic],\n   c_uint),\n\n  (\"clang_getDiagnosticOption\",\n   [Diagnostic, POINTER(_CXString)],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnosticRange\",\n   [Diagnostic, c_uint],\n   SourceRange),\n\n  (\"clang_getDiagnosticSeverity\",\n   [Diagnostic],\n   c_int),\n\n  (\"clang_getDiagnosticSpelling\",\n   [Diagnostic],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getElementType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getEnumConstantDeclUnsignedValue\",\n   [Cursor],\n   c_ulonglong),\n\n  (\"clang_getEnumConstantDeclValue\",\n   [Cursor],\n   c_longlong),\n\n  (\"clang_getEnumDeclIntegerType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getFile\",\n   [TranslationUnit, c_char_p],\n   c_object_p),\n\n  (\"clang_getFileName\",\n   [File],\n   _CXString), # TODO go through _CXString.from_result?\n\n  (\"clang_getFileTime\",\n   [File],\n   c_uint),\n\n  (\"clang_getIBOutletCollectionType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getIncludedFile\",\n   [Cursor],\n   File,\n   File.from_cursor_result),\n\n  (\"clang_getInclusions\",\n   [TranslationUnit, callbacks['translation_unit_includes'], py_object]),\n\n  (\"clang_getInstantiationLocation\",\n   [SourceLocation, POINTER(c_object_p), POINTER(c_uint), POINTER(c_uint),\n    POINTER(c_uint)]),\n\n  (\"clang_getLocation\",\n   [TranslationUnit, File, c_uint, c_uint],\n   SourceLocation),\n\n  (\"clang_getLocationForOffset\",\n   [TranslationUnit, File, c_uint],\n   SourceLocation),\n\n  (\"clang_getNullCursor\",\n   None,\n   Cursor),\n\n  (\"clang_getNumArgTypes\",\n   [Type],\n   c_uint),\n\n  (\"clang_getNumCompletionChunks\",\n   [c_void_p],\n   c_int),\n\n  (\"clang_getNumDiagnostics\",\n   [c_object_p],\n   c_uint),\n\n  (\"clang_getNumElements\",\n   [Type],\n   c_longlong),\n\n  (\"clang_getNumOverloadedDecls\",\n   [Cursor],\n   c_uint),\n\n  (\"clang_getOverloadedDecl\",\n   [Cursor, c_uint],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getPointeeType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getRange\",\n   [SourceLocation, SourceLocation],\n   SourceRange),\n\n  (\"clang_getRangeEnd\",\n   [SourceRange],\n   SourceLocation),\n\n  (\"clang_getRangeStart\",\n   [SourceRange],\n   SourceLocation),\n\n  (\"clang_getResultType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getSpecializedCursorTemplate\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getTemplateCursorKind\",\n   [Cursor],\n   c_uint),\n\n  (\"clang_getTokenExtent\",\n   [TranslationUnit, Token],\n   SourceRange),\n\n  (\"clang_getTokenKind\",\n   [Token],\n   c_uint),\n\n  (\"clang_getTokenLocation\",\n   [TranslationUnit, Token],\n   SourceLocation),\n\n  (\"clang_getTokenSpelling\",\n   [TranslationUnit, Token],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getTranslationUnitCursor\",\n   [TranslationUnit],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getTranslationUnitSpelling\",\n   [TranslationUnit],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getTUResourceUsageName\",\n   [c_uint],\n   c_char_p),\n\n  (\"clang_getTypeDeclaration\",\n   [Type],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getTypedefDeclUnderlyingType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getTypeKindSpelling\",\n   [c_uint],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_hashCursor\",\n   [Cursor],\n   c_uint),\n\n  (\"clang_isAttribute\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isConstQualifiedType\",\n   [Type],\n   bool),\n\n  (\"clang_isCursorDefinition\",\n   [Cursor],\n   bool),\n\n  (\"clang_isDeclaration\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isExpression\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isFileMultipleIncludeGuarded\",\n   [TranslationUnit, File],\n   bool),\n\n  (\"clang_isFunctionTypeVariadic\",\n   [Type],\n   bool),\n\n  (\"clang_isInvalid\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isPODType\",\n   [Type],\n   bool),\n\n  (\"clang_isPreprocessing\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isReference\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isRestrictQualifiedType\",\n   [Type],\n   bool),\n\n  (\"clang_isStatement\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isTranslationUnit\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isUnexposed\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isVirtualBase\",\n   [Cursor],\n   bool),\n\n  (\"clang_isVolatileQualifiedType\",\n   [Type],\n   bool),\n\n  (\"clang_parseTranslationUnit\",\n   [Index, c_char_p, c_void_p, c_int, c_void_p, c_int, c_int],\n   c_object_p),\n\n  (\"clang_reparseTranslationUnit\",\n   [TranslationUnit, c_int, c_void_p, c_int],\n   c_int),\n\n  (\"clang_saveTranslationUnit\",\n   [TranslationUnit, c_char_p, c_uint],\n   c_int),\n\n  (\"clang_tokenize\",\n   [TranslationUnit, SourceRange, POINTER(POINTER(Token)), POINTER(c_uint)]),\n\n  (\"clang_visitChildren\",\n   [Cursor, callbacks['cursor_visit'], py_object],\n   c_uint),\n\n  (\"clang_Cursor_getNumArguments\",\n   [Cursor],\n   c_int),\n\n  (\"clang_Cursor_getArgument\",\n   [Cursor, c_uint],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_Cursor_isBitField\",\n   [Cursor],\n   bool),\n\n  (\"clang_Type_getAlignOf\",\n   [Type],\n   c_longlong),\n\n  (\"clang_Type_getOffsetOf\",\n   [Type, c_char_p],\n   c_longlong),\n\n  (\"clang_Type_getSizeOf\",\n   [Type],\n   c_ulonglong),\n]\n\nclass LibclangError(Exception):\n    def __init__(self, message):\n        self.m = message\n\n    def __str__(self):\n        return self.m\n\ndef register_function(lib, item, ignore_errors):\n    # A function may not exist, if these bindings are used with an older or\n    # incompatible version of libclang.so.\n    try:\n        func = getattr(lib, item[0])\n    except AttributeError as e:\n        msg = str(e) + \". Please ensure that your python bindings are \"\\\n                       \"compatible with your libclang.so version.\"\n        if ignore_errors:\n            return\n        raise LibclangError(msg)\n\n    if len(item) >= 2:\n        func.argtypes = item[1]\n\n    if len(item) >= 3:\n        func.restype = item[2]\n\n    if len(item) == 4:\n        func.errcheck = item[3]\n\ndef register_functions(lib, ignore_errors):\n    \"\"\"Register function prototypes with a libclang library instance.\n\n    This must be called as part of library instantiation so Python knows how\n    to call out to the shared library.\n    \"\"\"\n\n    def register(item):\n        return register_function(lib, item, ignore_errors)\n\n    map(register, functionList)\n\nclass Config:\n    library_path = None\n    library_file = None\n    compatibility_check = True\n    loaded = False\n\n    @staticmethod\n    def set_library_path(path):\n        \"\"\"Set the path in which to search for libclang\"\"\"\n        if Config.loaded:\n            raise Exception(\"library path must be set before before using \" \\\n                            \"any other functionalities in libclang.\")\n\n        Config.library_path = path\n\n    @staticmethod\n    def set_library_file(filename):\n        \"\"\"Set the exact location of libclang\"\"\"\n        if Config.loaded:\n            raise Exception(\"library file must be set before before using \" \\\n                            \"any other functionalities in libclang.\")\n\n        Config.library_file = filename\n\n    @staticmethod\n    def set_compatibility_check(check_status):\n        \"\"\" Perform compatibility check when loading libclang\n\n        The python bindings are only tested and evaluated with the version of\n        libclang they are provided with. To ensure correct behavior a (limited)\n        compatibility check is performed when loading the bindings. This check\n        will throw an exception, as soon as it fails.\n\n        In case these bindings are used with an older version of libclang, parts\n        that have been stable between releases may still work. Users of the\n        python bindings can disable the compatibility check. This will cause\n        the python bindings to load, even though they are written for a newer\n        version of libclang. Failures now arise if unsupported or incompatible\n        features are accessed. The user is required to test himself if the\n        features he is using are available and compatible between different\n        libclang versions.\n        \"\"\"\n        if Config.loaded:\n            raise Exception(\"compatibility_check must be set before before \" \\\n                            \"using any other functionalities in libclang.\")\n\n        Config.compatibility_check = check_status\n\n    @CachedProperty\n    def lib(self):\n        lib = self.get_cindex_library()\n        register_functions(lib, not Config.compatibility_check)\n        Config.loaded = True\n        return lib\n\n    def get_filename(self):\n        if Config.library_file:\n            return Config.library_file\n\n        import platform\n        name = platform.system()\n\n        if name == 'Darwin':\n            file = 'libclang.dylib'\n        elif name == 'Windows':\n            file = 'libclang.dll'\n        else:\n            file = 'libclang.so'\n\n        if Config.library_path:\n            file = Config.library_path + '/' + file\n\n        return file\n\n    def get_cindex_library(self):\n        try:\n            library = cdll.LoadLibrary(self.get_filename())\n        except OSError as e:\n            msg = str(e) + \". To provide a path to libclang use \" \\\n                           \"Config.set_library_path() or \" \\\n                           \"Config.set_library_file().\"\n            raise LibclangError(msg)\n\n        return library\n\n    def function_exists(self, name):\n        try:\n            getattr(self.lib, name)\n        except AttributeError:\n            return False\n\n        return True\n\ndef register_enumerations():\n    for name, value in clang.enumerations.TokenKinds:\n        TokenKind.register(value, name)\n\nconf = Config()\nregister_enumerations()\n\n__all__ = [\n    'Config',\n    'CodeCompletionResults',\n    'CompilationDatabase',\n    'CompileCommands',\n    'CompileCommand',\n    'CursorKind',\n    'Cursor',\n    'Diagnostic',\n    'File',\n    'FixIt',\n    'Index',\n    'SourceLocation',\n    'SourceRange',\n    'TokenKind',\n    'Token',\n    'TranslationUnitLoadError',\n    'TranslationUnit',\n    'TypeKind',\n    'Type',\n]\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/enumerations.py",
    "content": "#===- enumerations.py - Python Enumerations ------------------*- python -*--===#\n#\n#                     The LLVM Compiler Infrastructure\n#\n# This file is distributed under the University of Illinois Open Source\n# License. See LICENSE.TXT for details.\n#\n#===------------------------------------------------------------------------===#\n\n\"\"\"\nClang Enumerations\n==================\n\nThis module provides static definitions of enumerations that exist in libclang.\n\nEnumerations are typically defined as a list of tuples. The exported values are\ntypically munged into other types or classes at module load time.\n\nAll enumerations are centrally defined in this file so they are all grouped\ntogether and easier to audit. And, maybe even one day this file will be\nautomatically generated by scanning the libclang headers!\n\"\"\"\n\n# Maps to CXTokenKind. Note that libclang maintains a separate set of token\n# enumerations from the C++ API.\nTokenKinds = [\n    ('PUNCTUATION', 0),\n    ('KEYWORD', 1),\n    ('IDENTIFIER', 2),\n    ('LITERAL', 3),\n    ('COMMENT', 4),\n]\n\n__all__ = ['TokenKinds']\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/clang/__init__.py",
    "content": "#===- __init__.py - Clang Python Bindings --------------------*- python -*--===#\n#\n#                     The LLVM Compiler Infrastructure\n#\n# This file is distributed under the University of Illinois Open Source\n# License. See LICENSE.TXT for details.\n#\n#===------------------------------------------------------------------------===#\n\nr\"\"\"\nClang Library Bindings\n======================\n\nThis package provides access to the Clang compiler and libraries.\n\nThe available modules are:\n\n  cindex\n\n    Bindings for the Clang indexing library.\n\"\"\"\n\n__all__ = ['cindex']\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/clang/cindex.py",
    "content": "#===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===#\n#\n#                     The LLVM Compiler Infrastructure\n#\n# This file is distributed under the University of Illinois Open Source\n# License. See LICENSE.TXT for details.\n#\n#===------------------------------------------------------------------------===#\n\nr\"\"\"\nClang Indexing Library Bindings\n===============================\n\nThis module provides an interface to the Clang indexing library. It is a\nlow-level interface to the indexing library which attempts to match the Clang\nAPI directly while also being \"pythonic\". Notable differences from the C API\nare:\n\n * string results are returned as Python strings, not CXString objects.\n\n * null cursors are translated to None.\n\n * access to child cursors is done via iteration, not visitation.\n\nThe major indexing objects are:\n\n  Index\n\n    The top-level object which manages some global library state.\n\n  TranslationUnit\n\n    High-level object encapsulating the AST for a single translation unit. These\n    can be loaded from .ast files or parsed on the fly.\n\n  Cursor\n\n    Generic object for representing a node in the AST.\n\n  SourceRange, SourceLocation, and File\n\n    Objects representing information about the input source.\n\nMost object information is exposed using properties, when the underlying API\ncall is efficient.\n\"\"\"\n\n# TODO\n# ====\n#\n# o API support for invalid translation units. Currently we can't even get the\n#   diagnostics on failure because they refer to locations in an object that\n#   will have been invalidated.\n#\n# o fix memory management issues (currently client must hold on to index and\n#   translation unit, or risk crashes).\n#\n# o expose code completion APIs.\n#\n# o cleanup ctypes wrapping, would be nice to separate the ctypes details more\n#   clearly, and hide from the external interface (i.e., help(cindex)).\n#\n# o implement additional SourceLocation, SourceRange, and File methods.\n\nfrom ctypes import *\nimport collections\n\nimport clang.enumerations\n\n# ctypes doesn't implicitly convert c_void_p to the appropriate wrapper\n# object. This is a problem, because it means that from_parameter will see an\n# integer and pass the wrong value on platforms where int != void*. Work around\n# this by marshalling object arguments as void**.\nc_object_p = POINTER(c_void_p)\n\ncallbacks = {}\n\n### Exception Classes ###\n\nclass TranslationUnitLoadError(Exception):\n    \"\"\"Represents an error that occurred when loading a TranslationUnit.\n\n    This is raised in the case where a TranslationUnit could not be\n    instantiated due to failure in the libclang library.\n\n    FIXME: Make libclang expose additional error information in this scenario.\n    \"\"\"\n    pass\n\nclass TranslationUnitSaveError(Exception):\n    \"\"\"Represents an error that occurred when saving a TranslationUnit.\n\n    Each error has associated with it an enumerated value, accessible under\n    e.save_error. Consumers can compare the value with one of the ERROR_\n    constants in this class.\n    \"\"\"\n\n    # Indicates that an unknown error occurred. This typically indicates that\n    # I/O failed during save.\n    ERROR_UNKNOWN = 1\n\n    # Indicates that errors during translation prevented saving. The errors\n    # should be available via the TranslationUnit's diagnostics.\n    ERROR_TRANSLATION_ERRORS = 2\n\n    # Indicates that the translation unit was somehow invalid.\n    ERROR_INVALID_TU = 3\n\n    def __init__(self, enumeration, message):\n        assert isinstance(enumeration, int)\n\n        if enumeration < 1 or enumeration > 3:\n            raise Exception(\"Encountered undefined TranslationUnit save error \"\n                            \"constant: %d. Please file a bug to have this \"\n                            \"value supported.\" % enumeration)\n\n        self.save_error = enumeration\n        Exception.__init__(self, 'Error %d: %s' % (enumeration, message))\n\n### Structures and Utility Classes ###\n\nclass CachedProperty(object):\n    \"\"\"Decorator that lazy-loads the value of a property.\n\n    The first time the property is accessed, the original property function is\n    executed. The value it returns is set as the new value of that instance's\n    property, replacing the original method.\n    \"\"\"\n\n    def __init__(self, wrapped):\n        self.wrapped = wrapped\n        try:\n            self.__doc__ = wrapped.__doc__\n        except:\n            pass\n\n    def __get__(self, instance, instance_type=None):\n        if instance is None:\n            return self\n\n        value = self.wrapped(instance)\n        setattr(instance, self.wrapped.__name__, value)\n\n        return value\n\n\nclass _CXString(Structure):\n    \"\"\"Helper for transforming CXString results.\"\"\"\n\n    _fields_ = [(\"spelling\", c_char_p), (\"free\", c_int)]\n\n    def __del__(self):\n        conf.lib.clang_disposeString(self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        assert isinstance(res, _CXString)\n        return conf.lib.clang_getCString(res)\n\nclass SourceLocation(Structure):\n    \"\"\"\n    A SourceLocation represents a particular location within a source file.\n    \"\"\"\n    _fields_ = [(\"ptr_data\", c_void_p * 2), (\"int_data\", c_uint)]\n    _data = None\n\n    def _get_instantiation(self):\n        if self._data is None:\n            f, l, c, o = c_object_p(), c_uint(), c_uint(), c_uint()\n            conf.lib.clang_getInstantiationLocation(self, byref(f), byref(l),\n                    byref(c), byref(o))\n            if f:\n                f = File(f)\n            else:\n                f = None\n            self._data = (f, int(l.value), int(c.value), int(o.value))\n        return self._data\n\n    @staticmethod\n    def from_position(tu, file, line, column):\n        \"\"\"\n        Retrieve the source location associated with a given file/line/column in\n        a particular translation unit.\n        \"\"\"\n        return conf.lib.clang_getLocation(tu, file, line, column)\n\n    @staticmethod\n    def from_offset(tu, file, offset):\n        \"\"\"Retrieve a SourceLocation from a given character offset.\n\n        tu -- TranslationUnit file belongs to\n        file -- File instance to obtain offset from\n        offset -- Integer character offset within file\n        \"\"\"\n        return conf.lib.clang_getLocationForOffset(tu, file, offset)\n\n    @property\n    def file(self):\n        \"\"\"Get the file represented by this source location.\"\"\"\n        return self._get_instantiation()[0]\n\n    @property\n    def line(self):\n        \"\"\"Get the line represented by this source location.\"\"\"\n        return self._get_instantiation()[1]\n\n    @property\n    def column(self):\n        \"\"\"Get the column represented by this source location.\"\"\"\n        return self._get_instantiation()[2]\n\n    @property\n    def offset(self):\n        \"\"\"Get the file offset represented by this source location.\"\"\"\n        return self._get_instantiation()[3]\n\n    def __eq__(self, other):\n        return conf.lib.clang_equalLocations(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def __repr__(self):\n        if self.file:\n            filename = self.file.name\n        else:\n            filename = None\n        return \"<SourceLocation file %r, line %r, column %r>\" % (\n            filename, self.line, self.column)\n\nclass SourceRange(Structure):\n    \"\"\"\n    A SourceRange describes a range of source locations within the source\n    code.\n    \"\"\"\n    _fields_ = [\n        (\"ptr_data\", c_void_p * 2),\n        (\"begin_int_data\", c_uint),\n        (\"end_int_data\", c_uint)]\n\n    # FIXME: Eliminate this and make normal constructor? Requires hiding ctypes\n    # object.\n    @staticmethod\n    def from_locations(start, end):\n        return conf.lib.clang_getRange(start, end)\n\n    @property\n    def start(self):\n        \"\"\"\n        Return a SourceLocation representing the first character within a\n        source range.\n        \"\"\"\n        return conf.lib.clang_getRangeStart(self)\n\n    @property\n    def end(self):\n        \"\"\"\n        Return a SourceLocation representing the last character within a\n        source range.\n        \"\"\"\n        return conf.lib.clang_getRangeEnd(self)\n\n    def __eq__(self, other):\n        return conf.lib.clang_equalRanges(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def __repr__(self):\n        return \"<SourceRange start %r, end %r>\" % (self.start, self.end)\n\nclass Diagnostic(object):\n    \"\"\"\n    A Diagnostic is a single instance of a Clang diagnostic. It includes the\n    diagnostic severity, the message, the location the diagnostic occurred, as\n    well as additional source ranges and associated fix-it hints.\n    \"\"\"\n\n    Ignored = 0\n    Note    = 1\n    Warning = 2\n    Error   = 3\n    Fatal   = 4\n\n    def __init__(self, ptr):\n        self.ptr = ptr\n\n    def __del__(self):\n        conf.lib.clang_disposeDiagnostic(self)\n\n    @property\n    def severity(self):\n        return conf.lib.clang_getDiagnosticSeverity(self)\n\n    @property\n    def location(self):\n        return conf.lib.clang_getDiagnosticLocation(self)\n\n    @property\n    def spelling(self):\n        return conf.lib.clang_getDiagnosticSpelling(self)\n\n    @property\n    def ranges(self):\n        class RangeIterator:\n            def __init__(self, diag):\n                self.diag = diag\n\n            def __len__(self):\n                return int(conf.lib.clang_getDiagnosticNumRanges(self.diag))\n\n            def __getitem__(self, key):\n                if (key >= len(self)):\n                    raise IndexError\n                return conf.lib.clang_getDiagnosticRange(self.diag, key)\n\n        return RangeIterator(self)\n\n    @property\n    def fixits(self):\n        class FixItIterator:\n            def __init__(self, diag):\n                self.diag = diag\n\n            def __len__(self):\n                return int(conf.lib.clang_getDiagnosticNumFixIts(self.diag))\n\n            def __getitem__(self, key):\n                range = SourceRange()\n                value = conf.lib.clang_getDiagnosticFixIt(self.diag, key,\n                        byref(range))\n                if len(value) == 0:\n                    raise IndexError\n\n                return FixIt(range, value)\n\n        return FixItIterator(self)\n\n    @property\n    def category_number(self):\n        \"\"\"The category number for this diagnostic.\"\"\"\n        return conf.lib.clang_getDiagnosticCategory(self)\n\n    @property\n    def category_name(self):\n        \"\"\"The string name of the category for this diagnostic.\"\"\"\n        return conf.lib.clang_getDiagnosticCategoryName(self.category_number)\n\n    @property\n    def option(self):\n        \"\"\"The command-line option that enables this diagnostic.\"\"\"\n        return conf.lib.clang_getDiagnosticOption(self, None)\n\n    @property\n    def disable_option(self):\n        \"\"\"The command-line option that disables this diagnostic.\"\"\"\n        disable = _CXString()\n        conf.lib.clang_getDiagnosticOption(self, byref(disable))\n\n        return conf.lib.clang_getCString(disable)\n\n    def __repr__(self):\n        return \"<Diagnostic severity %r, location %r, spelling %r>\" % (\n            self.severity, self.location, self.spelling)\n\n    def from_param(self):\n      return self.ptr\n\nclass FixIt(object):\n    \"\"\"\n    A FixIt represents a transformation to be applied to the source to\n    \"fix-it\". The fix-it shouldbe applied by replacing the given source range\n    with the given value.\n    \"\"\"\n\n    def __init__(self, range, value):\n        self.range = range\n        self.value = value\n\n    def __repr__(self):\n        return \"<FixIt range %r, value %r>\" % (self.range, self.value)\n\n\n### Access Specifier Kinds ###\n\nclass AccessSpecifierKind(object):\n    \"\"\"\n    An AccessSpecifierKind describes the kind of access specifier a cursor\n    points to.\n    \"\"\"\n\n    _kinds = []\n    _name_map = None\n\n    def __init__(self, value):\n        if value >= len(AccessSpecifierKind._kinds):\n            AccessSpecifierKind._kinds += [None] * (value - len(AccessSpecifierKind._kinds) + 1)\n        if AccessSpecifierKind._kinds[value] is not None:\n            raise ValueError,'AccessSpecifierKind already loaded'\n        self.value = value\n        AccessSpecifierKind._kinds[value] = self\n        AccessSpecifierKind._name_map = None\n\n    def from_param(self):\n        return self.value\n\n    @property\n    def name(self):\n        \"\"\"Get the enumeration name of this access specifier kind\"\"\"\n        if self._name_map is None:\n            self._name_map = {}\n            for key,value in AccessSpecifierKind.__dict__.items():\n                if isinstance(value,AccessSpecifierKind):\n                    self._name_map[value] = key\n        return self._name_map[self]\n\n    @staticmethod\n    def from_id(id):\n        if id >= len(AccessSpecifierKind._kinds) or AccessSpecifierKind._kinds[id] is None:\n            raise ValueError,'Unknown access specifier kind'\n        return AccessSpecifierKind._kinds[id]\n\n    @staticmethod\n    def get_all_kinds():\n        \"\"\"Return all AccessSpecifierKind enumeration instances.\"\"\"\n        return filter(None, AccessSpecifierKind._kinds)\n\n    def __repr__(self):\n        return 'AccessSpecifierKind.%s' % (self.name,)\n\n###\n# Declaration Kinds\n\nAccessSpecifierKind.INVALID = AccessSpecifierKind(0)\nAccessSpecifierKind.PUBLIC = AccessSpecifierKind(1)\nAccessSpecifierKind.PROTECTED = AccessSpecifierKind(2)\nAccessSpecifierKind.PRIVATE = AccessSpecifierKind(3)\n\n\n### Availability Kinds ###\n\nclass AvailabilityKind(object):\n    \"\"\"\n    An AvailabilityKind describes the kind of availability a cursor\n    points to.\n    \"\"\"\n\n    _kinds = []\n    _name_map = None\n\n    def __init__(self, value):\n        if value >= len(AvailabilityKind._kinds):\n            AvailabilityKind._kinds += [None] * (value - len(AvailabilityKind._kinds) + 1)\n        if AvailabilityKind._kinds[value] is not None:\n            raise ValueError,'AvailabilityKind already loaded'\n        self.value = value\n        AvailabilityKind._kinds[value] = self\n        AvailabilityKind._name_map = None\n\n    def from_param(self):\n        return self.value\n\n    @property\n    def name(self):\n        \"\"\"Get the enumeration name of this availability kind\"\"\"\n        if self._name_map is None:\n            self._name_map = {}\n            for key,value in AvailabilityKind.__dict__.items():\n                if isinstance(value,AvailabilityKind):\n                    self._name_map[value] = key\n        return self._name_map[self]\n\n    @staticmethod\n    def from_id(id):\n        if id >= len(AvailabilityKind._kinds) or AvailabilityKind._kinds[id] is None:\n            raise ValueError,'Unknown availability kind'\n        return AvailabilityKind._kinds[id]\n\n    @staticmethod\n    def get_all_kinds():\n        \"\"\"Return all AvailabilityKind enumeration instances.\"\"\"\n        return filter(None, AvailabilityKind._kinds)\n\n    def __repr__(self):\n        return 'AvailabilityKind.%s' % (self.name,)\n\n###\n# Declaration Kinds\n\nAvailabilityKind.AVAILABLE = AvailabilityKind(0)\nAvailabilityKind.DEPRECATED = AvailabilityKind(1)\nAvailabilityKind.NOTAVAILABLE = AvailabilityKind(2)\nAvailabilityKind.NOTACCESSIBLE = AvailabilityKind(3)\n\n\nclass TokenGroup(object):\n    \"\"\"Helper class to facilitate token management.\n\n    Tokens are allocated from libclang in chunks. They must be disposed of as a\n    collective group.\n\n    One purpose of this class is for instances to represent groups of allocated\n    tokens. Each token in a group contains a reference back to an instance of\n    this class. When all tokens from a group are garbage collected, it allows\n    this class to be garbage collected. When this class is garbage collected,\n    it calls the libclang destructor which invalidates all tokens in the group.\n\n    You should not instantiate this class outside of this module.\n    \"\"\"\n    def __init__(self, tu, memory, count):\n        self._tu = tu\n        self._memory = memory\n        self._count = count\n\n    def __del__(self):\n        conf.lib.clang_disposeTokens(self._tu, self._memory, self._count)\n\n    @staticmethod\n    def get_tokens(tu, extent):\n        \"\"\"Helper method to return all tokens in an extent.\n\n        This functionality is needed multiple places in this module. We define\n        it here because it seems like a logical place.\n        \"\"\"\n        tokens_memory = POINTER(Token)()\n        tokens_count = c_uint()\n\n        conf.lib.clang_tokenize(tu, extent, byref(tokens_memory),\n                byref(tokens_count))\n\n        count = int(tokens_count.value)\n\n        # If we get no tokens, no memory was allocated. Be sure not to return\n        # anything and potentially call a destructor on nothing.\n        if count < 1:\n            return\n\n        tokens_array = cast(tokens_memory, POINTER(Token * count)).contents\n\n        token_group = TokenGroup(tu, tokens_memory, tokens_count)\n\n        for i in xrange(0, count):\n            token = Token()\n            token.int_data = tokens_array[i].int_data\n            token.ptr_data = tokens_array[i].ptr_data\n            token._tu = tu\n            token._group = token_group\n\n            yield token\n\nclass TokenKind(object):\n    \"\"\"Describes a specific type of a Token.\"\"\"\n\n    _value_map = {} # int -> TokenKind\n\n    def __init__(self, value, name):\n        \"\"\"Create a new TokenKind instance from a numeric value and a name.\"\"\"\n        self.value = value\n        self.name = name\n\n    def __repr__(self):\n        return 'TokenKind.%s' % (self.name,)\n\n    @staticmethod\n    def from_value(value):\n        \"\"\"Obtain a registered TokenKind instance from its value.\"\"\"\n        result = TokenKind._value_map.get(value, None)\n\n        if result is None:\n            raise ValueError('Unknown TokenKind: %d' % value)\n\n        return result\n\n    @staticmethod\n    def register(value, name):\n        \"\"\"Register a new TokenKind enumeration.\n\n        This should only be called at module load time by code within this\n        package.\n        \"\"\"\n        if value in TokenKind._value_map:\n            raise ValueError('TokenKind already registered: %d' % value)\n\n        kind = TokenKind(value, name)\n        TokenKind._value_map[value] = kind\n        setattr(TokenKind, name, kind)\n\n### Cursor Kinds ###\n\nclass CursorKind(object):\n    \"\"\"\n    A CursorKind describes the kind of entity that a cursor points to.\n    \"\"\"\n\n    # The unique kind objects, indexed by id.\n    _kinds = []\n    _name_map = None\n\n    def __init__(self, value):\n        if value >= len(CursorKind._kinds):\n            CursorKind._kinds += [None] * (value - len(CursorKind._kinds) + 1)\n        if CursorKind._kinds[value] is not None:\n            raise ValueError,'CursorKind already loaded'\n        self.value = value\n        CursorKind._kinds[value] = self\n        CursorKind._name_map = None\n\n    def from_param(self):\n        return self.value\n\n    @property\n    def name(self):\n        \"\"\"Get the enumeration name of this cursor kind.\"\"\"\n        if self._name_map is None:\n            self._name_map = {}\n            for key,value in CursorKind.__dict__.items():\n                if isinstance(value,CursorKind):\n                    self._name_map[value] = key\n        return self._name_map[self]\n\n    @staticmethod\n    def from_id(id):\n        if id >= len(CursorKind._kinds) or CursorKind._kinds[id] is None:\n            raise ValueError,'Unknown cursor kind'\n        return CursorKind._kinds[id]\n\n    @staticmethod\n    def get_all_kinds():\n        \"\"\"Return all CursorKind enumeration instances.\"\"\"\n        return filter(None, CursorKind._kinds)\n\n    def is_declaration(self):\n        \"\"\"Test if this is a declaration kind.\"\"\"\n        return conf.lib.clang_isDeclaration(self)\n\n    def is_reference(self):\n        \"\"\"Test if this is a reference kind.\"\"\"\n        return conf.lib.clang_isReference(self)\n\n    def is_expression(self):\n        \"\"\"Test if this is an expression kind.\"\"\"\n        return conf.lib.clang_isExpression(self)\n\n    def is_statement(self):\n        \"\"\"Test if this is a statement kind.\"\"\"\n        return conf.lib.clang_isStatement(self)\n\n    def is_attribute(self):\n        \"\"\"Test if this is an attribute kind.\"\"\"\n        return conf.lib.clang_isAttribute(self)\n\n    def is_invalid(self):\n        \"\"\"Test if this is an invalid kind.\"\"\"\n        return conf.lib.clang_isInvalid(self)\n\n    def is_translation_unit(self):\n        \"\"\"Test if this is a translation unit kind.\"\"\"\n        return conf.lib.clang_isTranslationUnit(self)\n\n    def is_preprocessing(self):\n        \"\"\"Test if this is a preprocessing kind.\"\"\"\n        return conf.lib.clang_isPreprocessing(self)\n\n    def is_unexposed(self):\n        \"\"\"Test if this is an unexposed kind.\"\"\"\n        return conf.lib.clang_isUnexposed(self)\n\n    def __repr__(self):\n        return 'CursorKind.%s' % (self.name,)\n\n# FIXME: Is there a nicer way to expose this enumeration? We could potentially\n# represent the nested structure, or even build a class hierarchy. The main\n# things we want for sure are (a) simple external access to kinds, (b) a place\n# to hang a description and name, (c) easy to keep in sync with Index.h.\n\n###\n# Declaration Kinds\n\n# A declaration whose specific kind is not exposed via this interface.\n#\n# Unexposed declarations have the same operations as any other kind of\n# declaration; one can extract their location information, spelling, find their\n# definitions, etc. However, the specific kind of the declaration is not\n# reported.\nCursorKind.UNEXPOSED_DECL = CursorKind(1)\n\n# A C or C++ struct.\nCursorKind.STRUCT_DECL = CursorKind(2)\n\n# A C or C++ union.\nCursorKind.UNION_DECL = CursorKind(3)\n\n# A C++ class.\nCursorKind.CLASS_DECL = CursorKind(4)\n\n# An enumeration.\nCursorKind.ENUM_DECL = CursorKind(5)\n\n# A field (in C) or non-static data member (in C++) in a struct, union, or C++\n# class.\nCursorKind.FIELD_DECL = CursorKind(6)\n\n# An enumerator constant.\nCursorKind.ENUM_CONSTANT_DECL = CursorKind(7)\n\n# A function.\nCursorKind.FUNCTION_DECL = CursorKind(8)\n\n# A variable.\nCursorKind.VAR_DECL = CursorKind(9)\n\n# A function or method parameter.\nCursorKind.PARM_DECL = CursorKind(10)\n\n# An Objective-C @interface.\nCursorKind.OBJC_INTERFACE_DECL = CursorKind(11)\n\n# An Objective-C @interface for a category.\nCursorKind.OBJC_CATEGORY_DECL = CursorKind(12)\n\n# An Objective-C @protocol declaration.\nCursorKind.OBJC_PROTOCOL_DECL = CursorKind(13)\n\n# An Objective-C @property declaration.\nCursorKind.OBJC_PROPERTY_DECL = CursorKind(14)\n\n# An Objective-C instance variable.\nCursorKind.OBJC_IVAR_DECL = CursorKind(15)\n\n# An Objective-C instance method.\nCursorKind.OBJC_INSTANCE_METHOD_DECL = CursorKind(16)\n\n# An Objective-C class method.\nCursorKind.OBJC_CLASS_METHOD_DECL = CursorKind(17)\n\n# An Objective-C @implementation.\nCursorKind.OBJC_IMPLEMENTATION_DECL = CursorKind(18)\n\n# An Objective-C @implementation for a category.\nCursorKind.OBJC_CATEGORY_IMPL_DECL = CursorKind(19)\n\n# A typedef.\nCursorKind.TYPEDEF_DECL = CursorKind(20)\n\n# A C++ class method.\nCursorKind.CXX_METHOD = CursorKind(21)\n\n# A C++ namespace.\nCursorKind.NAMESPACE = CursorKind(22)\n\n# A linkage specification, e.g. 'extern \"C\"'.\nCursorKind.LINKAGE_SPEC = CursorKind(23)\n\n# A C++ constructor.\nCursorKind.CONSTRUCTOR = CursorKind(24)\n\n# A C++ destructor.\nCursorKind.DESTRUCTOR = CursorKind(25)\n\n# A C++ conversion function.\nCursorKind.CONVERSION_FUNCTION = CursorKind(26)\n\n# A C++ template type parameter\nCursorKind.TEMPLATE_TYPE_PARAMETER = CursorKind(27)\n\n# A C++ non-type template paramater.\nCursorKind.TEMPLATE_NON_TYPE_PARAMETER = CursorKind(28)\n\n# A C++ template template parameter.\nCursorKind.TEMPLATE_TEMPLATE_PARAMETER = CursorKind(29)\n\n# A C++ function template.\nCursorKind.FUNCTION_TEMPLATE = CursorKind(30)\n\n# A C++ class template.\nCursorKind.CLASS_TEMPLATE = CursorKind(31)\n\n# A C++ class template partial specialization.\nCursorKind.CLASS_TEMPLATE_PARTIAL_SPECIALIZATION = CursorKind(32)\n\n# A C++ namespace alias declaration.\nCursorKind.NAMESPACE_ALIAS = CursorKind(33)\n\n# A C++ using directive\nCursorKind.USING_DIRECTIVE = CursorKind(34)\n\n# A C++ using declaration\nCursorKind.USING_DECLARATION = CursorKind(35)\n\n# A Type alias decl.\nCursorKind.TYPE_ALIAS_DECL = CursorKind(36)\n\n# A Objective-C synthesize decl\nCursorKind.OBJC_SYNTHESIZE_DECL = CursorKind(37)\n\n# A Objective-C dynamic decl\nCursorKind.OBJC_DYNAMIC_DECL = CursorKind(38)\n\n# A C++ access specifier decl.\nCursorKind.CXX_ACCESS_SPEC_DECL = CursorKind(39)\n\n\n###\n# Reference Kinds\n\nCursorKind.OBJC_SUPER_CLASS_REF = CursorKind(40)\nCursorKind.OBJC_PROTOCOL_REF = CursorKind(41)\nCursorKind.OBJC_CLASS_REF = CursorKind(42)\n\n# A reference to a type declaration.\n#\n# A type reference occurs anywhere where a type is named but not\n# declared. For example, given:\n#   typedef unsigned size_type;\n#   size_type size;\n#\n# The typedef is a declaration of size_type (CXCursor_TypedefDecl),\n# while the type of the variable \"size\" is referenced. The cursor\n# referenced by the type of size is the typedef for size_type.\nCursorKind.TYPE_REF = CursorKind(43)\nCursorKind.CXX_BASE_SPECIFIER = CursorKind(44)\n\n# A reference to a class template, function template, template\n# template parameter, or class template partial specialization.\nCursorKind.TEMPLATE_REF = CursorKind(45)\n\n# A reference to a namespace or namepsace alias.\nCursorKind.NAMESPACE_REF = CursorKind(46)\n\n# A reference to a member of a struct, union, or class that occurs in\n# some non-expression context, e.g., a designated initializer.\nCursorKind.MEMBER_REF = CursorKind(47)\n\n# A reference to a labeled statement.\nCursorKind.LABEL_REF = CursorKind(48)\n\n# A reference toa a set of overloaded functions or function templates\n# that has not yet been resolved to a specific function or function template.\nCursorKind.OVERLOADED_DECL_REF = CursorKind(49)\n\n  # /**\n  #  * \\brief A reference to a variable that occurs in some non-expression \n  #  * context, e.g., a C++ lambda capture list.\n  #  */\nCursorKind.VARIABLE_REF = CursorKind(50)\n  \n###\n# Invalid/Error Kinds\nCursorKind.INVALID_FILE = CursorKind(70)\nCursorKind.NO_DECL_FOUND = CursorKind(71)\nCursorKind.NOT_IMPLEMENTED = CursorKind(72)\nCursorKind.INVALID_CODE = CursorKind(73)\n\n###\n# Expression Kinds\n\n# An expression whose specific kind is not exposed via this interface.\n#\n# Unexposed expressions have the same operations as any other kind of\n# expression; one can extract their location information, spelling, children,\n# etc. However, the specific kind of the expression is not reported.\nCursorKind.UNEXPOSED_EXPR = CursorKind(100)\n\n# An expression that refers to some value declaration, such as a function,\n# varible, or enumerator.\nCursorKind.DECL_REF_EXPR = CursorKind(101)\n\n# An expression that refers to a member of a struct, union, class, Objective-C\n# class, etc.\nCursorKind.MEMBER_REF_EXPR = CursorKind(102)\n\n# An expression that calls a function.\nCursorKind.CALL_EXPR = CursorKind(103)\n\n# An expression that sends a message to an Objective-C object or class.\nCursorKind.OBJC_MESSAGE_EXPR = CursorKind(104)\n\n# An expression that represents a block literal.\nCursorKind.BLOCK_EXPR = CursorKind(105)\n\n# An integer literal.\nCursorKind.INTEGER_LITERAL = CursorKind(106)\n\n# A floating point number literal.\nCursorKind.FLOATING_LITERAL = CursorKind(107)\n\n# An imaginary number literal.\nCursorKind.IMAGINARY_LITERAL = CursorKind(108)\n\n# A string literal.\nCursorKind.STRING_LITERAL = CursorKind(109)\n\n# A character literal.\nCursorKind.CHARACTER_LITERAL = CursorKind(110)\n\n# A parenthesized expression, e.g. \"(1)\".\n#\n# This AST node is only formed if full location information is requested.\nCursorKind.PAREN_EXPR = CursorKind(111)\n\n# This represents the unary-expression's (except sizeof and\n# alignof).\nCursorKind.UNARY_OPERATOR = CursorKind(112)\n\n# [C99 6.5.2.1] Array Subscripting.\nCursorKind.ARRAY_SUBSCRIPT_EXPR = CursorKind(113)\n\n# A builtin binary operation expression such as \"x + y\" or\n# \"x <= y\".\nCursorKind.BINARY_OPERATOR = CursorKind(114)\n\n# Compound assignment such as \"+=\".\nCursorKind.COMPOUND_ASSIGNMENT_OPERATOR = CursorKind(115)\n\n# The ?: ternary operator.\nCursorKind.CONDITIONAL_OPERATOR = CursorKind(116)\n\n# An explicit cast in C (C99 6.5.4) or a C-style cast in C++\n# (C++ [expr.cast]), which uses the syntax (Type)expr.\n#\n# For example: (int)f.\nCursorKind.CSTYLE_CAST_EXPR = CursorKind(117)\n\n# [C99 6.5.2.5]\nCursorKind.COMPOUND_LITERAL_EXPR = CursorKind(118)\n\n# Describes an C or C++ initializer list.\nCursorKind.INIT_LIST_EXPR = CursorKind(119)\n\n# The GNU address of label extension, representing &&label.\nCursorKind.ADDR_LABEL_EXPR = CursorKind(120)\n\n# This is the GNU Statement Expression extension: ({int X=4; X;})\nCursorKind.StmtExpr = CursorKind(121)\n\n# Represents a C11 generic selection.\nCursorKind.GENERIC_SELECTION_EXPR = CursorKind(122)\n\n# Implements the GNU __null extension, which is a name for a null\n# pointer constant that has integral type (e.g., int or long) and is the same\n# size and alignment as a pointer.\n#\n# The __null extension is typically only used by system headers, which define\n# NULL as __null in C++ rather than using 0 (which is an integer that may not\n# match the size of a pointer).\nCursorKind.GNU_NULL_EXPR = CursorKind(123)\n\n# C++'s static_cast<> expression.\nCursorKind.CXX_STATIC_CAST_EXPR = CursorKind(124)\n\n# C++'s dynamic_cast<> expression.\nCursorKind.CXX_DYNAMIC_CAST_EXPR = CursorKind(125)\n\n# C++'s reinterpret_cast<> expression.\nCursorKind.CXX_REINTERPRET_CAST_EXPR = CursorKind(126)\n\n# C++'s const_cast<> expression.\nCursorKind.CXX_CONST_CAST_EXPR = CursorKind(127)\n\n# Represents an explicit C++ type conversion that uses \"functional\"\n# notion (C++ [expr.type.conv]).\n#\n# Example:\n# \\code\n#   x = int(0.5);\n# \\endcode\nCursorKind.CXX_FUNCTIONAL_CAST_EXPR = CursorKind(128)\n\n# A C++ typeid expression (C++ [expr.typeid]).\nCursorKind.CXX_TYPEID_EXPR = CursorKind(129)\n\n# [C++ 2.13.5] C++ Boolean Literal.\nCursorKind.CXX_BOOL_LITERAL_EXPR = CursorKind(130)\n\n# [C++0x 2.14.7] C++ Pointer Literal.\nCursorKind.CXX_NULL_PTR_LITERAL_EXPR = CursorKind(131)\n\n# Represents the \"this\" expression in C++\nCursorKind.CXX_THIS_EXPR = CursorKind(132)\n\n# [C++ 15] C++ Throw Expression.\n#\n# This handles 'throw' and 'throw' assignment-expression. When\n# assignment-expression isn't present, Op will be null.\nCursorKind.CXX_THROW_EXPR = CursorKind(133)\n\n# A new expression for memory allocation and constructor calls, e.g:\n# \"new CXXNewExpr(foo)\".\nCursorKind.CXX_NEW_EXPR = CursorKind(134)\n\n# A delete expression for memory deallocation and destructor calls,\n# e.g. \"delete[] pArray\".\nCursorKind.CXX_DELETE_EXPR = CursorKind(135)\n\n# Represents a unary expression.\nCursorKind.CXX_UNARY_EXPR = CursorKind(136)\n\n# ObjCStringLiteral, used for Objective-C string literals i.e. \"foo\".\nCursorKind.OBJC_STRING_LITERAL = CursorKind(137)\n\n# ObjCEncodeExpr, used for in Objective-C.\nCursorKind.OBJC_ENCODE_EXPR = CursorKind(138)\n\n# ObjCSelectorExpr used for in Objective-C.\nCursorKind.OBJC_SELECTOR_EXPR = CursorKind(139)\n\n# Objective-C's protocol expression.\nCursorKind.OBJC_PROTOCOL_EXPR = CursorKind(140)\n\n# An Objective-C \"bridged\" cast expression, which casts between\n# Objective-C pointers and C pointers, transferring ownership in the process.\n#\n# \\code\n#   NSString *str = (__bridge_transfer NSString *)CFCreateString();\n# \\endcode\nCursorKind.OBJC_BRIDGE_CAST_EXPR = CursorKind(141)\n\n# Represents a C++0x pack expansion that produces a sequence of\n# expressions.\n#\n# A pack expansion expression contains a pattern (which itself is an\n# expression) followed by an ellipsis. For example:\nCursorKind.PACK_EXPANSION_EXPR = CursorKind(142)\n\n# Represents an expression that computes the length of a parameter\n# pack.\nCursorKind.SIZE_OF_PACK_EXPR = CursorKind(143)\n\n# Represents a C++ lambda expression that produces a local function object.\n# void abssort(float *x, unsigned N) {\n#   std::sort(x, x + N,\n#             [](float a, float b) {\n#               return std::abs(a) < std::abs(b);\n#             });\n# }\n\nCursorKind.LAMBDA_EXPR = CursorKind(144)\n\n# Objective-c Boolean Literal.\nCursorKind.OBJC_BOOL_LITERAL_EXPR = CursorKind(145)\n\n# Represents the \"self\" expression in a ObjC method.\nCursorKind.OBJC_SELF_EXPR = CursorKind(146)\n\n# A statement whose specific kind is not exposed via this interface.\n#\n# Unexposed statements have the same operations as any other kind of statement;\n# one can extract their location information, spelling, children, etc. However,\n# the specific kind of the statement is not reported.\nCursorKind.UNEXPOSED_STMT = CursorKind(200)\n\n# A labelled statement in a function.\nCursorKind.LABEL_STMT = CursorKind(201)\n\n# A compound statement\nCursorKind.COMPOUND_STMT = CursorKind(202)\n\n# A case statement.\nCursorKind.CASE_STMT = CursorKind(203)\n\n# A default statement.\nCursorKind.DEFAULT_STMT = CursorKind(204)\n\n# An if statement.\nCursorKind.IF_STMT = CursorKind(205)\n\n# A switch statement.\nCursorKind.SWITCH_STMT = CursorKind(206)\n\n# A while statement.\nCursorKind.WHILE_STMT = CursorKind(207)\n\n# A do statement.\nCursorKind.DO_STMT = CursorKind(208)\n\n# A for statement.\nCursorKind.FOR_STMT = CursorKind(209)\n\n# A goto statement.\nCursorKind.GOTO_STMT = CursorKind(210)\n\n# An indirect goto statement.\nCursorKind.INDIRECT_GOTO_STMT = CursorKind(211)\n\n# A continue statement.\nCursorKind.CONTINUE_STMT = CursorKind(212)\n\n# A break statement.\nCursorKind.BREAK_STMT = CursorKind(213)\n\n# A return statement.\nCursorKind.RETURN_STMT = CursorKind(214)\n\n# A GNU-style inline assembler statement.\nCursorKind.ASM_STMT = CursorKind(215)\n\n# Objective-C's overall @try-@catch-@finally statement.\nCursorKind.OBJC_AT_TRY_STMT = CursorKind(216)\n\n# Objective-C's @catch statement.\nCursorKind.OBJC_AT_CATCH_STMT = CursorKind(217)\n\n# Objective-C's @finally statement.\nCursorKind.OBJC_AT_FINALLY_STMT = CursorKind(218)\n\n# Objective-C's @throw statement.\nCursorKind.OBJC_AT_THROW_STMT = CursorKind(219)\n\n# Objective-C's @synchronized statement.\nCursorKind.OBJC_AT_SYNCHRONIZED_STMT = CursorKind(220)\n\n# Objective-C's autorealease pool statement.\nCursorKind.OBJC_AUTORELEASE_POOL_STMT = CursorKind(221)\n\n# Objective-C's for collection statement.\nCursorKind.OBJC_FOR_COLLECTION_STMT = CursorKind(222)\n\n# C++'s catch statement.\nCursorKind.CXX_CATCH_STMT = CursorKind(223)\n\n# C++'s try statement.\nCursorKind.CXX_TRY_STMT = CursorKind(224)\n\n# C++'s for (* : *) statement.\nCursorKind.CXX_FOR_RANGE_STMT = CursorKind(225)\n\n# Windows Structured Exception Handling's try statement.\nCursorKind.SEH_TRY_STMT = CursorKind(226)\n\n# Windows Structured Exception Handling's except statement.\nCursorKind.SEH_EXCEPT_STMT = CursorKind(227)\n\n# Windows Structured Exception Handling's finally statement.\nCursorKind.SEH_FINALLY_STMT = CursorKind(228)\n\n# The null statement.\nCursorKind.NULL_STMT = CursorKind(230)\n\n# Adaptor class for mixing declarations with statements and expressions.\nCursorKind.DECL_STMT = CursorKind(231)\n\n###\n# Other Kinds\n\n# Cursor that represents the translation unit itself.\n#\n# The translation unit cursor exists primarily to act as the root cursor for\n# traversing the contents of a translation unit.\nCursorKind.TRANSLATION_UNIT = CursorKind(300)\n\n###\n# Attributes\n\n# An attribute whoe specific kind is note exposed via this interface\nCursorKind.UNEXPOSED_ATTR = CursorKind(400)\n\nCursorKind.IB_ACTION_ATTR = CursorKind(401)\nCursorKind.IB_OUTLET_ATTR = CursorKind(402)\nCursorKind.IB_OUTLET_COLLECTION_ATTR = CursorKind(403)\n\nCursorKind.CXX_FINAL_ATTR = CursorKind(404)\nCursorKind.CXX_OVERRIDE_ATTR = CursorKind(405)\nCursorKind.ANNOTATE_ATTR = CursorKind(406)\nCursorKind.ASM_LABEL_ATTR = CursorKind(407)\n\n###\n# Preprocessing\nCursorKind.PREPROCESSING_DIRECTIVE = CursorKind(500)\nCursorKind.MACRO_DEFINITION = CursorKind(501)\nCursorKind.MACRO_INSTANTIATION = CursorKind(502)\nCursorKind.INCLUSION_DIRECTIVE = CursorKind(503)\n\n# Extra Declarations\n\n# A module import declaration.\nCursorKind.MODULE_IMPORT_DECL = CursorKind(600)\n\n### Cursors ###\n\nclass Cursor(Structure):\n    \"\"\"\n    The Cursor class represents a reference to an element within the AST. It\n    acts as a kind of iterator.\n    \"\"\"\n    _fields_ = [(\"_kind_id\", c_int), (\"xdata\", c_int), (\"data\", c_void_p * 3)]\n\n    @staticmethod\n    def from_location(tu, location):\n        # We store a reference to the TU in the instance so the TU won't get\n        # collected before the cursor.\n        cursor = conf.lib.clang_getCursor(tu, location)\n        cursor._tu = tu\n\n        return cursor\n\n    def __eq__(self, other):\n        return conf.lib.clang_equalCursors(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n    def is_definition(self):\n        \"\"\"\n        Returns true if the declaration pointed at by the cursor is also a\n        definition of that entity.\n        \"\"\"\n        return conf.lib.clang_isCursorDefinition(self)\n\n        \"\"\"\n        Determine the availability of the entity that this cursor refers to,\n        taking the current target platform into account.\n        returns The availability of the cursor.\n        \"\"\"\n    def get_availability(self):\n        res = conf.lib.clang_getCursorAvailability(self)\n        return res\n\n    def is_static_method(self):\n        \"\"\"Returns True if the cursor refers to a C++ member function or member\n        function template that is declared 'static'.\n        \"\"\"\n        return conf.lib.clang_CXXMethod_isStatic(self)\n\n    def get_definition(self):\n        \"\"\"\n        If the cursor is a reference to a declaration or a declaration of\n        some entity, return a cursor that points to the definition of that\n        entity.\n        \"\"\"\n        # TODO: Should probably check that this is either a reference or\n        # declaration prior to issuing the lookup.\n        return conf.lib.clang_getCursorDefinition(self)\n\n    def get_usr(self):\n        \"\"\"Return the Unified Symbol Resultion (USR) for the entity referenced\n        by the given cursor (or None).\n\n        A Unified Symbol Resolution (USR) is a string that identifies a\n        particular entity (function, class, variable, etc.) within a\n        program. USRs can be compared across translation units to determine,\n        e.g., when references in one translation refer to an entity defined in\n        another translation unit.\"\"\"\n        return conf.lib.clang_getCursorUSR(self)\n\n    @property\n    def kind(self):\n        \"\"\"Return the kind of this cursor.\"\"\"\n        return CursorKind.from_id(self._kind_id)\n\n    @property\n    def spelling(self):\n        \"\"\"Return the spelling of the entity pointed at by the cursor.\"\"\"\n        if not self.kind.is_declaration():\n            # FIXME: clang_getCursorSpelling should be fixed to not assert on\n            # this, for consistency with clang_getCursorUSR.\n            return None\n        if not hasattr(self, '_spelling'):\n            self._spelling = conf.lib.clang_getCursorSpelling(self)\n\n        return self._spelling\n\n    @property\n    def displayname(self):\n        \"\"\"\n        Return the display name for the entity referenced by this cursor.\n\n        The display name contains extra information that helps identify the cursor,\n        such as the parameters of a function or template or the arguments of a\n        class template specialization.\n        \"\"\"\n        if not hasattr(self, '_displayname'):\n            self._displayname = conf.lib.clang_getCursorDisplayName(self)\n\n        return self._displayname\n\n    @property\n    def location(self):\n        \"\"\"\n        Return the source location (the starting character) of the entity\n        pointed at by the cursor.\n        \"\"\"\n        if not hasattr(self, '_loc'):\n            self._loc = conf.lib.clang_getCursorLocation(self)\n\n        return self._loc\n\n    @property\n    def extent(self):\n        \"\"\"\n        Return the source range (the range of text) occupied by the entity\n        pointed at by the cursor.\n        \"\"\"\n        if not hasattr(self, '_extent'):\n            self._extent = conf.lib.clang_getCursorExtent(self)\n\n        return self._extent\n\n    @property\n    def type(self):\n        \"\"\"\n        Retrieve the Type (if any) of the entity pointed at by the cursor.\n        \"\"\"\n        if not hasattr(self, '_type'):\n            self._type = conf.lib.clang_getCursorType(self)\n\n        return self._type\n\n    @property\n    def canonical(self):\n        \"\"\"Return the canonical Cursor corresponding to this Cursor.\n\n        The canonical cursor is the cursor which is representative for the\n        underlying entity. For example, if you have multiple forward\n        declarations for the same class, the canonical cursor for the forward\n        declarations will be identical.\n        \"\"\"\n        if not hasattr(self, '_canonical'):\n            self._canonical = conf.lib.clang_getCanonicalCursor(self)\n\n        return self._canonical\n\n    @property\n    def result_type(self):\n        \"\"\"Retrieve the Type of the result for this Cursor.\"\"\"\n        if not hasattr(self, '_result_type'):\n            self._result_type = conf.lib.clang_getResultType(self.type)\n\n        return self._result_type\n\n    @property\n    def underlying_typedef_type(self):\n        \"\"\"Return the underlying type of a typedef declaration.\n\n        Returns a Type for the typedef this cursor is a declaration for. If\n        the current cursor is not a typedef, this raises.\n        \"\"\"\n        if not hasattr(self, '_underlying_type'):\n            assert self.kind.is_declaration()\n            self._underlying_type = \\\n              conf.lib.clang_getTypedefDeclUnderlyingType(self)\n\n        return self._underlying_type\n\n    @property\n    def enum_type(self):\n        \"\"\"Return the integer type of an enum declaration.\n\n        Returns a Type corresponding to an integer. If the cursor is not for an\n        enum, this raises.\n        \"\"\"\n        if not hasattr(self, '_enum_type'):\n            assert self.kind == CursorKind.ENUM_DECL\n            self._enum_type = conf.lib.clang_getEnumDeclIntegerType(self)\n\n        return self._enum_type\n\n    @property\n    def enum_value(self):\n        \"\"\"Return the value of an enum constant.\"\"\"\n        if not hasattr(self, '_enum_value'):\n            assert self.kind == CursorKind.ENUM_CONSTANT_DECL\n            # Figure out the underlying type of the enum to know if it\n            # is a signed or unsigned quantity.\n            underlying_type = self.type\n            if underlying_type.kind == TypeKind.ENUM:\n                underlying_type = underlying_type.get_declaration().enum_type\n            if underlying_type.kind in (TypeKind.CHAR_U,\n                                        TypeKind.UCHAR,\n                                        TypeKind.CHAR16,\n                                        TypeKind.CHAR32,\n                                        TypeKind.USHORT,\n                                        TypeKind.UINT,\n                                        TypeKind.ULONG,\n                                        TypeKind.ULONGLONG,\n                                        TypeKind.UINT128):\n                self._enum_value = \\\n                  conf.lib.clang_getEnumConstantDeclUnsignedValue(self)\n            else:\n                self._enum_value = conf.lib.clang_getEnumConstantDeclValue(self)\n        return self._enum_value\n\n    @property\n    def objc_type_encoding(self):\n        \"\"\"Return the Objective-C type encoding as a str.\"\"\"\n        if not hasattr(self, '_objc_type_encoding'):\n            self._objc_type_encoding = \\\n              conf.lib.clang_getDeclObjCTypeEncoding(self)\n\n        return self._objc_type_encoding\n\n    @property\n    def hash(self):\n        \"\"\"Returns a hash of the cursor as an int.\"\"\"\n        if not hasattr(self, '_hash'):\n            self._hash = conf.lib.clang_hashCursor(self)\n\n        return self._hash\n\n    @property\n    def semantic_parent(self):\n        \"\"\"Return the semantic parent for this cursor.\"\"\"\n        if not hasattr(self, '_semantic_parent'):\n            self._semantic_parent = conf.lib.clang_getCursorSemanticParent(self)\n\n        return self._semantic_parent\n\n    @property\n    def lexical_parent(self):\n        \"\"\"Return the lexical parent for this cursor.\"\"\"\n        if not hasattr(self, '_lexical_parent'):\n            self._lexical_parent = conf.lib.clang_getCursorLexicalParent(self)\n\n        return self._lexical_parent\n\n    @property\n    def translation_unit(self):\n        \"\"\"Returns the TranslationUnit to which this Cursor belongs.\"\"\"\n        # If this triggers an AttributeError, the instance was not properly\n        # created.\n        return self._tu\n\n    @property\n    def referenced(self):\n        \"\"\"\n        For a cursor that is a reference, returns a cursor \n        representing the entity that it references.\n        \"\"\"\n        if not hasattr(self, '_referenced'):\n            self._referenced = conf.lib.clang_getCursorReferenced(self)\n\n        return self._referenced\n\n    def get_arguments(self):\n        \"\"\"Return an iterator for accessing the arguments of this cursor.\"\"\"\n        num_args = conf.lib.clang_Cursor_getNumArguments(self)\n        for i in range(0, num_args):\n            yield conf.lib.clang_Cursor_getArgument(self, i)\n\n    def get_children(self):\n        \"\"\"Return an iterator for accessing the children of this cursor.\"\"\"\n\n        # FIXME: Expose iteration from CIndex, PR6125.\n        def visitor(child, parent, children):\n            # FIXME: Document this assertion in API.\n            # FIXME: There should just be an isNull method.\n            assert child != conf.lib.clang_getNullCursor()\n\n            # Create reference to TU so it isn't GC'd before Cursor.\n            child._tu = self._tu\n            children.append(child)\n            return 1 # continue\n        children = []\n        conf.lib.clang_visitChildren(self, callbacks['cursor_visit'](visitor),\n            children)\n        return iter(children)\n\n    def get_children_array(self):\n        \"\"\"Return an iterator for accessing the children of this cursor.\"\"\"\n\n        # FIXME: Expose iteration from CIndex, PR6125.\n        def visitor(child, parent, children):\n            # FIXME: Document this assertion in API.\n            # FIXME: There should just be an isNull method.\n            assert child != conf.lib.clang_getNullCursor()\n\n            # Create reference to TU so it isn't GC'd before Cursor.\n            child._tu = self._tu\n            children.append(child)\n            return 1 # continue\n        children = []\n        conf.lib.clang_visitChildren(self, callbacks['cursor_visit'](visitor),\n            children)\n        return children\n\n    def get_tokens(self):\n        \"\"\"Obtain Token instances formulating that compose this Cursor.\n\n        This is a generator for Token instances. It returns all tokens which\n        occupy the extent this cursor occupies.\n        \"\"\"\n        return TokenGroup.get_tokens(self._tu, self.extent)\n\n    def is_bitfield(self):\n        \"\"\"\n        Check if the field is a bitfield.\n        \"\"\"\n        return conf.lib.clang_Cursor_isBitField(self)\n\n    def get_bitfield_width(self):\n        \"\"\"\n        Retrieve the width of a bitfield.\n        \"\"\"\n        return conf.lib.clang_getFieldDeclBitWidth(self)\n\n    def get_access_specifier(self):\n        assert self.kind == CursorKind.CXX_ACCESS_SPEC_DECL\n        return conf.lib.clang_getCXXAccessSpecifier(self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        assert isinstance(res, Cursor)\n        # FIXME: There should just be an isNull method.\n        if res == conf.lib.clang_getNullCursor():\n            return None\n\n        # Store a reference to the TU in the Python object so it won't get GC'd\n        # before the Cursor.\n        tu = None\n        for arg in args:\n            if isinstance(arg, TranslationUnit):\n                tu = arg\n                break\n\n            if hasattr(arg, 'translation_unit'):\n                tu = arg.translation_unit\n                break\n\n        assert tu is not None\n\n        res._tu = tu\n        return res\n\n    @staticmethod\n    def from_cursor_result(res, fn, args):\n        assert isinstance(res, Cursor)\n        if res == conf.lib.clang_getNullCursor():\n            return None\n\n        res._tu = args[0]._tu\n        return res\n\n### Type Kinds ###\n\nclass TypeKind(object):\n    \"\"\"\n    Describes the kind of type.\n    \"\"\"\n\n    # The unique kind objects, indexed by id.\n    _kinds = []\n    _name_map = None\n\n    def __init__(self, value):\n        if value >= len(TypeKind._kinds):\n            TypeKind._kinds += [None] * (value - len(TypeKind._kinds) + 1)\n        if TypeKind._kinds[value] is not None:\n            raise ValueError,'TypeKind already loaded'\n        self.value = value\n        TypeKind._kinds[value] = self\n        TypeKind._name_map = None\n\n    def from_param(self):\n        return self.value\n\n    @property\n    def name(self):\n        \"\"\"Get the enumeration name of this cursor kind.\"\"\"\n        if self._name_map is None:\n            self._name_map = {}\n            for key,value in TypeKind.__dict__.items():\n                if isinstance(value,TypeKind):\n                    self._name_map[value] = key\n        return self._name_map[self]\n\n    @property\n    def spelling(self):\n        \"\"\"Retrieve the spelling of this TypeKind.\"\"\"\n        return conf.lib.clang_getTypeKindSpelling(self.value)\n\n    @staticmethod\n    def from_id(id):\n        if id >= len(TypeKind._kinds) or TypeKind._kinds[id] is None:\n            raise ValueError,'Unknown type kind %d' % id\n        return TypeKind._kinds[id]\n\n    def __repr__(self):\n        return 'TypeKind.%s' % (self.name,)\n\nTypeKind.INVALID = TypeKind(0)\nTypeKind.UNEXPOSED = TypeKind(1)\nTypeKind.VOID = TypeKind(2)\nTypeKind.BOOL = TypeKind(3)\nTypeKind.CHAR_U = TypeKind(4)\nTypeKind.UCHAR = TypeKind(5)\nTypeKind.CHAR16 = TypeKind(6)\nTypeKind.CHAR32 = TypeKind(7)\nTypeKind.USHORT = TypeKind(8)\nTypeKind.UINT = TypeKind(9)\nTypeKind.ULONG = TypeKind(10)\nTypeKind.ULONGLONG = TypeKind(11)\nTypeKind.UINT128 = TypeKind(12)\nTypeKind.CHAR_S = TypeKind(13)\nTypeKind.SCHAR = TypeKind(14)\nTypeKind.WCHAR = TypeKind(15)\nTypeKind.SHORT = TypeKind(16)\nTypeKind.INT = TypeKind(17)\nTypeKind.LONG = TypeKind(18)\nTypeKind.LONGLONG = TypeKind(19)\nTypeKind.INT128 = TypeKind(20)\nTypeKind.FLOAT = TypeKind(21)\nTypeKind.DOUBLE = TypeKind(22)\nTypeKind.LONGDOUBLE = TypeKind(23)\nTypeKind.NULLPTR = TypeKind(24)\nTypeKind.OVERLOAD = TypeKind(25)\nTypeKind.DEPENDENT = TypeKind(26)\nTypeKind.OBJCID = TypeKind(27)\nTypeKind.OBJCCLASS = TypeKind(28)\nTypeKind.OBJCSEL = TypeKind(29)\nTypeKind.COMPLEX = TypeKind(100)\nTypeKind.POINTER = TypeKind(101)\nTypeKind.BLOCKPOINTER = TypeKind(102)\nTypeKind.LVALUEREFERENCE = TypeKind(103)\nTypeKind.RVALUEREFERENCE = TypeKind(104)\nTypeKind.RECORD = TypeKind(105)\nTypeKind.ENUM = TypeKind(106)\nTypeKind.TYPEDEF = TypeKind(107)\nTypeKind.OBJCINTERFACE = TypeKind(108)\nTypeKind.OBJCOBJECTPOINTER = TypeKind(109)\nTypeKind.FUNCTIONNOPROTO = TypeKind(110)\nTypeKind.FUNCTIONPROTO = TypeKind(111)\nTypeKind.CONSTANTARRAY = TypeKind(112)\nTypeKind.VECTOR = TypeKind(113)\nTypeKind.INCOMPLETEARRAY = TypeKind(114)\nTypeKind.MEMBERPOINTER = TypeKind(117)\n\nclass Type(Structure):\n    \"\"\"\n    The type of an element in the abstract syntax tree.\n    \"\"\"\n    _fields_ = [(\"_kind_id\", c_int), (\"data\", c_void_p * 2)]\n\n    @property\n    def kind(self):\n        \"\"\"Return the kind of this type.\"\"\"\n        return TypeKind.from_id(self._kind_id)\n\n    def argument_types(self):\n        \"\"\"Retrieve a container for the non-variadic arguments for this type.\n\n        The returned object is iterable and indexable. Each item in the\n        container is a Type instance.\n        \"\"\"\n        class ArgumentsIterator(collections.Sequence):\n            def __init__(self, parent):\n                self.parent = parent\n                self.length = None\n\n            def __len__(self):\n                if self.length is None:\n                    self.length = conf.lib.clang_getNumArgTypes(self.parent)\n\n                return self.length\n\n            def __getitem__(self, key):\n                # FIXME Support slice objects.\n                if not isinstance(key, int):\n                    raise TypeError(\"Must supply a non-negative int.\")\n\n                if key < 0:\n                    raise IndexError(\"Only non-negative indexes are accepted.\")\n\n                if key >= len(self):\n                    raise IndexError(\"Index greater than container length: \"\n                                     \"%d > %d\" % ( key, len(self) ))\n\n                result = conf.lib.clang_getArgType(self.parent, key)\n                if result.kind == TypeKind.INVALID:\n                    raise IndexError(\"Argument could not be retrieved.\")\n\n                return result\n\n        assert self.kind == TypeKind.FUNCTIONPROTO\n        return ArgumentsIterator(self)\n\n    @property\n    def element_type(self):\n        \"\"\"Retrieve the Type of elements within this Type.\n\n        If accessed on a type that is not an array, complex, or vector type, an\n        exception will be raised.\n        \"\"\"\n        result = conf.lib.clang_getElementType(self)\n        if result.kind == TypeKind.INVALID:\n            raise Exception('Element type not available on this type.')\n\n        return result\n\n    @property\n    def element_count(self):\n        \"\"\"Retrieve the number of elements in this type.\n\n        Returns an int.\n\n        If the Type is not an array or vector, this raises.\n        \"\"\"\n        result = conf.lib.clang_getNumElements(self)\n        if result < 0:\n            raise Exception('Type does not have elements.')\n\n        return result\n\n    @property\n    def translation_unit(self):\n        \"\"\"The TranslationUnit to which this Type is associated.\"\"\"\n        # If this triggers an AttributeError, the instance was not properly\n        # instantiated.\n        return self._tu\n\n    @staticmethod\n    def from_result(res, fn, args):\n        assert isinstance(res, Type)\n\n        tu = None\n        for arg in args:\n            if hasattr(arg, 'translation_unit'):\n                tu = arg.translation_unit\n                break\n\n        assert tu is not None\n        res._tu = tu\n\n        return res\n\n    def get_canonical(self):\n        \"\"\"\n        Return the canonical type for a Type.\n\n        Clang's type system explicitly models typedefs and all the\n        ways a specific type can be represented.  The canonical type\n        is the underlying type with all the \"sugar\" removed.  For\n        example, if 'T' is a typedef for 'int', the canonical type for\n        'T' would be 'int'.\n        \"\"\"\n        return conf.lib.clang_getCanonicalType(self)\n\n    def is_const_qualified(self):\n        \"\"\"Determine whether a Type has the \"const\" qualifier set.\n\n        This does not look through typedefs that may have added \"const\"\n        at a different level.\n        \"\"\"\n        return conf.lib.clang_isConstQualifiedType(self)\n\n    def is_volatile_qualified(self):\n        \"\"\"Determine whether a Type has the \"volatile\" qualifier set.\n\n        This does not look through typedefs that may have added \"volatile\"\n        at a different level.\n        \"\"\"\n        return conf.lib.clang_isVolatileQualifiedType(self)\n\n    def is_restrict_qualified(self):\n        \"\"\"Determine whether a Type has the \"restrict\" qualifier set.\n\n        This does not look through typedefs that may have added \"restrict\" at\n        a different level.\n        \"\"\"\n        return conf.lib.clang_isRestrictQualifiedType(self)\n\n    def is_function_variadic(self):\n        \"\"\"Determine whether this function Type is a variadic function type.\"\"\"\n        assert self.kind == TypeKind.FUNCTIONPROTO\n\n        return conf.lib.clang_isFunctionTypeVariadic(self)\n\n    def is_pod(self):\n        \"\"\"Determine whether this Type represents plain old data (POD).\"\"\"\n        return conf.lib.clang_isPODType(self)\n\n    def get_pointee(self):\n        \"\"\"\n        For pointer types, returns the type of the pointee.\n        \"\"\"\n        return conf.lib.clang_getPointeeType(self)\n\n    def get_declaration(self):\n        \"\"\"\n        Return the cursor for the declaration of the given type.\n        \"\"\"\n        return conf.lib.clang_getTypeDeclaration(self)\n\n    def get_result(self):\n        \"\"\"\n        Retrieve the result type associated with a function type.\n        \"\"\"\n        return conf.lib.clang_getResultType(self)\n\n    def get_array_element_type(self):\n        \"\"\"\n        Retrieve the type of the elements of the array type.\n        \"\"\"\n        return conf.lib.clang_getArrayElementType(self)\n\n    def get_array_size(self):\n        \"\"\"\n        Retrieve the size of the constant array.\n        \"\"\"\n        return conf.lib.clang_getArraySize(self)\n\n    def get_align(self):\n        \"\"\"\n        Retrieve the alignment of the record.\n        \"\"\"\n        return conf.lib.clang_Type_getAlignOf(self)\n\n    def get_size(self):\n        \"\"\"\n        Retrieve the size of the record.\n        \"\"\"\n        return conf.lib.clang_Type_getSizeOf(self)\n\n    def get_offset(self, fieldname):\n        \"\"\"\n        Retrieve the offset of a field in the record.\n        \"\"\"\n        return conf.lib.clang_Type_getOffsetOf(self, c_char_p(fieldname))\n\n    def __eq__(self, other):\n        if type(other) != type(self):\n            return False\n\n        return conf.lib.clang_equalTypes(self, other)\n\n    def __ne__(self, other):\n        return not self.__eq__(other)\n\n## CIndex Objects ##\n\n# CIndex objects (derived from ClangObject) are essentially lightweight\n# wrappers attached to some underlying object, which is exposed via CIndex as\n# a void*.\n\nclass ClangObject(object):\n    \"\"\"\n    A helper for Clang objects. This class helps act as an intermediary for\n    the ctypes library and the Clang CIndex library.\n    \"\"\"\n    def __init__(self, obj):\n        assert isinstance(obj, c_object_p) and obj\n        self.obj = self._as_parameter_ = obj\n\n    def from_param(self):\n        return self._as_parameter_\n\n\nclass _CXUnsavedFile(Structure):\n    \"\"\"Helper for passing unsaved file arguments.\"\"\"\n    _fields_ = [(\"name\", c_char_p), (\"contents\", c_char_p), ('length', c_ulong)]\n\n# Functions calls through the python interface are rather slow. Fortunately,\n# for most symboles, we do not need to perform a function call. Their spelling\n# never changes and is consequently provided by this spelling cache.\nSpellingCache = {\n            # 0: CompletionChunk.Kind(\"Optional\"),\n            # 1: CompletionChunk.Kind(\"TypedText\"),\n            # 2: CompletionChunk.Kind(\"Text\"),\n            # 3: CompletionChunk.Kind(\"Placeholder\"),\n            # 4: CompletionChunk.Kind(\"Informative\"),\n            # 5 : CompletionChunk.Kind(\"CurrentParameter\"),\n            6: '(',   # CompletionChunk.Kind(\"LeftParen\"),\n            7: ')',   # CompletionChunk.Kind(\"RightParen\"),\n            8: ']',   # CompletionChunk.Kind(\"LeftBracket\"),\n            9: ']',   # CompletionChunk.Kind(\"RightBracket\"),\n            10: '{',  # CompletionChunk.Kind(\"LeftBrace\"),\n            11: '}',  # CompletionChunk.Kind(\"RightBrace\"),\n            12: '<',  # CompletionChunk.Kind(\"LeftAngle\"),\n            13: '>',  # CompletionChunk.Kind(\"RightAngle\"),\n            14: ', ', # CompletionChunk.Kind(\"Comma\"),\n            # 15: CompletionChunk.Kind(\"ResultType\"),\n            16: ':',  # CompletionChunk.Kind(\"Colon\"),\n            17: ';',  # CompletionChunk.Kind(\"SemiColon\"),\n            18: '=',  # CompletionChunk.Kind(\"Equal\"),\n            19: ' ',  # CompletionChunk.Kind(\"HorizontalSpace\"),\n            # 20: CompletionChunk.Kind(\"VerticalSpace\")\n}\n\nclass CompletionChunk:\n    class Kind:\n        def __init__(self, name):\n            self.name = name\n\n        def __str__(self):\n            return self.name\n\n        def __repr__(self):\n            return \"<ChunkKind: %s>\" % self\n\n    def __init__(self, completionString, key):\n        self.cs = completionString\n        self.key = key\n        self.__kindNumberCache = -1\n\n    def __repr__(self):\n        return \"{'\" + self.spelling + \"', \" + str(self.kind) + \"}\"\n\n    @CachedProperty\n    def spelling(self):\n        if self.__kindNumber in SpellingCache:\n                return SpellingCache[self.__kindNumber]\n        return conf.lib.clang_getCompletionChunkText(self.cs, self.key).spelling\n\n    # We do not use @CachedProperty here, as the manual implementation is\n    # apparently still significantly faster. Please profile carefully if you\n    # would like to add CachedProperty back.\n    @property\n    def __kindNumber(self):\n        if self.__kindNumberCache == -1:\n            self.__kindNumberCache = \\\n                conf.lib.clang_getCompletionChunkKind(self.cs, self.key)\n        return self.__kindNumberCache\n\n    @CachedProperty\n    def kind(self):\n        return completionChunkKindMap[self.__kindNumber]\n\n    @CachedProperty\n    def string(self):\n        res = conf.lib.clang_getCompletionChunkCompletionString(self.cs,\n                                                                self.key)\n\n        if (res):\n          return CompletionString(res)\n        else:\n          None\n\n    def isKindOptional(self):\n      return self.__kindNumber == 0\n\n    def isKindTypedText(self):\n      return self.__kindNumber == 1\n\n    def isKindPlaceHolder(self):\n      return self.__kindNumber == 3\n\n    def isKindInformative(self):\n      return self.__kindNumber == 4\n\n    def isKindResultType(self):\n      return self.__kindNumber == 15\n\ncompletionChunkKindMap = {\n            0: CompletionChunk.Kind(\"Optional\"),\n            1: CompletionChunk.Kind(\"TypedText\"),\n            2: CompletionChunk.Kind(\"Text\"),\n            3: CompletionChunk.Kind(\"Placeholder\"),\n            4: CompletionChunk.Kind(\"Informative\"),\n            5: CompletionChunk.Kind(\"CurrentParameter\"),\n            6: CompletionChunk.Kind(\"LeftParen\"),\n            7: CompletionChunk.Kind(\"RightParen\"),\n            8: CompletionChunk.Kind(\"LeftBracket\"),\n            9: CompletionChunk.Kind(\"RightBracket\"),\n            10: CompletionChunk.Kind(\"LeftBrace\"),\n            11: CompletionChunk.Kind(\"RightBrace\"),\n            12: CompletionChunk.Kind(\"LeftAngle\"),\n            13: CompletionChunk.Kind(\"RightAngle\"),\n            14: CompletionChunk.Kind(\"Comma\"),\n            15: CompletionChunk.Kind(\"ResultType\"),\n            16: CompletionChunk.Kind(\"Colon\"),\n            17: CompletionChunk.Kind(\"SemiColon\"),\n            18: CompletionChunk.Kind(\"Equal\"),\n            19: CompletionChunk.Kind(\"HorizontalSpace\"),\n            20: CompletionChunk.Kind(\"VerticalSpace\")}\n\nclass CompletionString(ClangObject):\n    class Availability:\n        def __init__(self, name):\n            self.name = name\n\n        def __str__(self):\n            return self.name\n\n        def __repr__(self):\n            return \"<Availability: %s>\" % self\n\n    def __len__(self):\n        self.num_chunks\n\n    @CachedProperty\n    def num_chunks(self):\n        return conf.lib.clang_getNumCompletionChunks(self.obj)\n\n    def __getitem__(self, key):\n        if self.num_chunks <= key:\n            raise IndexError\n        return CompletionChunk(self.obj, key)\n\n    @property\n    def priority(self):\n        return conf.lib.clang_getCompletionPriority(self.obj)\n\n    @property\n    def availability(self):\n        res = conf.lib.clang_getCompletionAvailability(self.obj)\n        return availabilityKinds[res]\n\n    @property\n    def briefComment(self):\n        if conf.function_exists(\"clang_getCompletionBriefComment\"):\n            return conf.lib.clang_getCompletionBriefComment(self.obj)\n        return _CXString()\n\n    def __repr__(self):\n        return \" | \".join([str(a) for a in self]) \\\n               + \" || Priority: \" + str(self.priority) \\\n               + \" || Availability: \" + str(self.availability) \\\n               + \" || Brief comment: \" + str(self.briefComment.spelling)\n\navailabilityKinds = {\n            0: CompletionChunk.Kind(\"Available\"),\n            1: CompletionChunk.Kind(\"Deprecated\"),\n            2: CompletionChunk.Kind(\"NotAvailable\"),\n            3: CompletionChunk.Kind(\"NotAccessible\")}\n\nclass CodeCompletionResult(Structure):\n    _fields_ = [('cursorKind', c_int), ('completionString', c_object_p)]\n\n    def __repr__(self):\n        return str(CompletionString(self.completionString))\n\n    @property\n    def kind(self):\n        return CursorKind.from_id(self.cursorKind)\n\n    @property\n    def string(self):\n        return CompletionString(self.completionString)\n\nclass CCRStructure(Structure):\n    _fields_ = [('results', POINTER(CodeCompletionResult)),\n                ('numResults', c_int)]\n\n    def __len__(self):\n        return self.numResults\n\n    def __getitem__(self, key):\n        if len(self) <= key:\n            raise IndexError\n\n        return self.results[key]\n\nclass CodeCompletionResults(ClangObject):\n    def __init__(self, ptr):\n        assert isinstance(ptr, POINTER(CCRStructure)) and ptr\n        self.ptr = self._as_parameter_ = ptr\n\n    def from_param(self):\n        return self._as_parameter_\n\n    def __del__(self):\n        conf.lib.clang_disposeCodeCompleteResults(self)\n\n    @property\n    def results(self):\n        return self.ptr.contents\n\n    @property\n    def diagnostics(self):\n        class DiagnosticsItr:\n            def __init__(self, ccr):\n                self.ccr= ccr\n\n            def __len__(self):\n                return int(\\\n                  conf.lib.clang_codeCompleteGetNumDiagnostics(self.ccr))\n\n            def __getitem__(self, key):\n                return conf.lib.clang_codeCompleteGetDiagnostic(self.ccr, key)\n\n        return DiagnosticsItr(self)\n\n\nclass Index(ClangObject):\n    \"\"\"\n    The Index type provides the primary interface to the Clang CIndex library,\n    primarily by providing an interface for reading and parsing translation\n    units.\n    \"\"\"\n\n    @staticmethod\n    def create(excludeDecls=False):\n        \"\"\"\n        Create a new Index.\n        Parameters:\n        excludeDecls -- Exclude local declarations from translation units.\n        \"\"\"\n        return Index(conf.lib.clang_createIndex(excludeDecls, 0))\n\n    def __del__(self):\n        conf.lib.clang_disposeIndex(self)\n\n    def read(self, path):\n        \"\"\"Load a TranslationUnit from the given AST file.\"\"\"\n        return TranslationUnit.from_ast(path, self)\n\n    def parse(self, path, args=None, unsaved_files=None, options = 0):\n        \"\"\"Load the translation unit from the given source code file by running\n        clang and generating the AST before loading. Additional command line\n        parameters can be passed to clang via the args parameter.\n\n        In-memory contents for files can be provided by passing a list of pairs\n        to as unsaved_files, the first item should be the filenames to be mapped\n        and the second should be the contents to be substituted for the\n        file. The contents may be passed as strings or file objects.\n\n        If an error was encountered during parsing, a TranslationUnitLoadError\n        will be raised.\n        \"\"\"\n        return TranslationUnit.from_source(path, args, unsaved_files, options,\n                                           self)\n\nclass TranslationUnit(ClangObject):\n    \"\"\"Represents a source code translation unit.\n\n    This is one of the main types in the API. Any time you wish to interact\n    with Clang's representation of a source file, you typically start with a\n    translation unit.\n    \"\"\"\n\n    # Default parsing mode.\n    PARSE_NONE = 0\n\n    # Instruct the parser to create a detailed processing record containing\n    # metadata not normally retained.\n    PARSE_DETAILED_PROCESSING_RECORD = 1\n\n    # Indicates that the translation unit is incomplete. This is typically used\n    # when parsing headers.\n    PARSE_INCOMPLETE = 2\n\n    # Instruct the parser to create a pre-compiled preamble for the translation\n    # unit. This caches the preamble (included files at top of source file).\n    # This is useful if the translation unit will be reparsed and you don't\n    # want to incur the overhead of reparsing the preamble.\n    PARSE_PRECOMPILED_PREAMBLE = 4\n\n    # Cache code completion information on parse. This adds time to parsing but\n    # speeds up code completion.\n    PARSE_CACHE_COMPLETION_RESULTS = 8\n\n    # Flags with values 16 and 32 are deprecated and intentionally omitted.\n\n    # Do not parse function bodies. This is useful if you only care about\n    # searching for declarations/definitions.\n    PARSE_SKIP_FUNCTION_BODIES = 64\n\n    # Used to indicate that brief documentation comments should be included\n    # into the set of code completions returned from this translation unit.\n    PARSE_INCLUDE_BRIEF_COMMENTS_IN_CODE_COMPLETION = 128\n\n    @classmethod\n    def from_source(cls, filename, args=None, unsaved_files=None, options=0,\n                    index=None):\n        \"\"\"Create a TranslationUnit by parsing source.\n\n        This is capable of processing source code both from files on the\n        filesystem as well as in-memory contents.\n\n        Command-line arguments that would be passed to clang are specified as\n        a list via args. These can be used to specify include paths, warnings,\n        etc. e.g. [\"-Wall\", \"-I/path/to/include\"].\n\n        In-memory file content can be provided via unsaved_files. This is an\n        iterable of 2-tuples. The first element is the str filename. The\n        second element defines the content. Content can be provided as str\n        source code or as file objects (anything with a read() method). If\n        a file object is being used, content will be read until EOF and the\n        read cursor will not be reset to its original position.\n\n        options is a bitwise or of TranslationUnit.PARSE_XXX flags which will\n        control parsing behavior.\n\n        index is an Index instance to utilize. If not provided, a new Index\n        will be created for this TranslationUnit.\n\n        To parse source from the filesystem, the filename of the file to parse\n        is specified by the filename argument. Or, filename could be None and\n        the args list would contain the filename(s) to parse.\n\n        To parse source from an in-memory buffer, set filename to the virtual\n        filename you wish to associate with this source (e.g. \"test.c\"). The\n        contents of that file are then provided in unsaved_files.\n\n        If an error occurs, a TranslationUnitLoadError is raised.\n\n        Please note that a TranslationUnit with parser errors may be returned.\n        It is the caller's responsibility to check tu.diagnostics for errors.\n\n        Also note that Clang infers the source language from the extension of\n        the input filename. If you pass in source code containing a C++ class\n        declaration with the filename \"test.c\" parsing will fail.\n        \"\"\"\n        if args is None:\n            args = []\n\n        if unsaved_files is None:\n            unsaved_files = []\n\n        if index is None:\n            index = Index.create()\n\n        args_array = None\n        if len(args) > 0:\n            args_array = (c_char_p * len(args))(* args)\n\n        unsaved_array = None\n        if len(unsaved_files) > 0:\n            unsaved_array = (_CXUnsavedFile * len(unsaved_files))()\n            for i, (name, contents) in enumerate(unsaved_files):\n                if hasattr(contents, \"read\"):\n                    contents = contents.read()\n\n                unsaved_array[i].name = name\n                unsaved_array[i].contents = contents\n                unsaved_array[i].length = len(contents)\n\n        ptr = conf.lib.clang_parseTranslationUnit(index, filename, args_array,\n                                    len(args), unsaved_array,\n                                    len(unsaved_files), options)\n\n        if not ptr:\n            raise TranslationUnitLoadError(\"Error parsing translation unit.\")\n\n        return cls(ptr, index=index)\n\n    @classmethod\n    def from_ast_file(cls, filename, index=None):\n        \"\"\"Create a TranslationUnit instance from a saved AST file.\n\n        A previously-saved AST file (provided with -emit-ast or\n        TranslationUnit.save()) is loaded from the filename specified.\n\n        If the file cannot be loaded, a TranslationUnitLoadError will be\n        raised.\n\n        index is optional and is the Index instance to use. If not provided,\n        a default Index will be created.\n        \"\"\"\n        if index is None:\n            index = Index.create()\n\n        ptr = conf.lib.clang_createTranslationUnit(index, filename)\n        if not ptr:\n            raise TranslationUnitLoadError(filename)\n\n        return cls(ptr=ptr, index=index)\n\n    def __init__(self, ptr, index):\n        \"\"\"Create a TranslationUnit instance.\n\n        TranslationUnits should be created using one of the from_* @classmethod\n        functions above. __init__ is only called internally.\n        \"\"\"\n        assert isinstance(index, Index)\n\n        ClangObject.__init__(self, ptr)\n\n    def __del__(self):\n        conf.lib.clang_disposeTranslationUnit(self)\n\n    @property\n    def cursor(self):\n        \"\"\"Retrieve the cursor that represents the given translation unit.\"\"\"\n        return conf.lib.clang_getTranslationUnitCursor(self)\n\n    @property\n    def spelling(self):\n        \"\"\"Get the original translation unit source file name.\"\"\"\n        return conf.lib.clang_getTranslationUnitSpelling(self)\n\n    def get_includes(self):\n        \"\"\"\n        Return an iterable sequence of FileInclusion objects that describe the\n        sequence of inclusions in a translation unit. The first object in\n        this sequence is always the input file. Note that this method will not\n        recursively iterate over header files included through precompiled\n        headers.\n        \"\"\"\n        def visitor(fobj, lptr, depth, includes):\n            if depth > 0:\n                loc = lptr.contents\n                includes.append(FileInclusion(loc.file, File(fobj), loc, depth))\n\n        # Automatically adapt CIndex/ctype pointers to python objects\n        includes = []\n        conf.lib.clang_getInclusions(self,\n                callbacks['translation_unit_includes'](visitor), includes)\n\n        return iter(includes)\n\n    def get_file(self, filename):\n        \"\"\"Obtain a File from this translation unit.\"\"\"\n\n        return File.from_name(self, filename)\n\n    def get_location(self, filename, position):\n        \"\"\"Obtain a SourceLocation for a file in this translation unit.\n\n        The position can be specified by passing:\n\n          - Integer file offset. Initial file offset is 0.\n          - 2-tuple of (line number, column number). Initial file position is\n            (0, 0)\n        \"\"\"\n        f = self.get_file(filename)\n\n        if isinstance(position, int):\n            return SourceLocation.from_offset(self, f, position)\n\n        return SourceLocation.from_position(self, f, position[0], position[1])\n\n    def get_extent(self, filename, locations):\n        \"\"\"Obtain a SourceRange from this translation unit.\n\n        The bounds of the SourceRange must ultimately be defined by a start and\n        end SourceLocation. For the locations argument, you can pass:\n\n          - 2 SourceLocation instances in a 2-tuple or list.\n          - 2 int file offsets via a 2-tuple or list.\n          - 2 2-tuple or lists of (line, column) pairs in a 2-tuple or list.\n\n        e.g.\n\n        get_extent('foo.c', (5, 10))\n        get_extent('foo.c', ((1, 1), (1, 15)))\n        \"\"\"\n        f = self.get_file(filename)\n\n        if len(locations) < 2:\n            raise Exception('Must pass object with at least 2 elements')\n\n        start_location, end_location = locations\n\n        if hasattr(start_location, '__len__'):\n            start_location = SourceLocation.from_position(self, f,\n                start_location[0], start_location[1])\n        elif isinstance(start_location, int):\n            start_location = SourceLocation.from_offset(self, f,\n                start_location)\n\n        if hasattr(end_location, '__len__'):\n            end_location = SourceLocation.from_position(self, f,\n                end_location[0], end_location[1])\n        elif isinstance(end_location, int):\n            end_location = SourceLocation.from_offset(self, f, end_location)\n\n        assert isinstance(start_location, SourceLocation)\n        assert isinstance(end_location, SourceLocation)\n\n        return SourceRange.from_locations(start_location, end_location)\n\n    @property\n    def diagnostics(self):\n        \"\"\"\n        Return an iterable (and indexable) object containing the diagnostics.\n        \"\"\"\n        class DiagIterator:\n            def __init__(self, tu):\n                self.tu = tu\n\n            def __len__(self):\n                return int(conf.lib.clang_getNumDiagnostics(self.tu))\n\n            def __getitem__(self, key):\n                diag = conf.lib.clang_getDiagnostic(self.tu, key)\n                if not diag:\n                    raise IndexError\n                return Diagnostic(diag)\n\n        return DiagIterator(self)\n\n    def reparse(self, unsaved_files=None, options=0):\n        \"\"\"\n        Reparse an already parsed translation unit.\n\n        In-memory contents for files can be provided by passing a list of pairs\n        as unsaved_files, the first items should be the filenames to be mapped\n        and the second should be the contents to be substituted for the\n        file. The contents may be passed as strings or file objects.\n        \"\"\"\n        if unsaved_files is None:\n            unsaved_files = []\n\n        unsaved_files_array = 0\n        if len(unsaved_files):\n            unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))()\n            for i,(name,value) in enumerate(unsaved_files):\n                if not isinstance(value, str):\n                    # FIXME: It would be great to support an efficient version\n                    # of this, one day.\n                    value = value.read()\n                    print value\n                if not isinstance(value, str):\n                    raise TypeError,'Unexpected unsaved file contents.'\n                unsaved_files_array[i].name = name\n                unsaved_files_array[i].contents = value\n                unsaved_files_array[i].length = len(value)\n        ptr = conf.lib.clang_reparseTranslationUnit(self, len(unsaved_files),\n                unsaved_files_array, options)\n\n    def save(self, filename):\n        \"\"\"Saves the TranslationUnit to a file.\n\n        This is equivalent to passing -emit-ast to the clang frontend. The\n        saved file can be loaded back into a TranslationUnit. Or, if it\n        corresponds to a header, it can be used as a pre-compiled header file.\n\n        If an error occurs while saving, a TranslationUnitSaveError is raised.\n        If the error was TranslationUnitSaveError.ERROR_INVALID_TU, this means\n        the constructed TranslationUnit was not valid at time of save. In this\n        case, the reason(s) why should be available via\n        TranslationUnit.diagnostics().\n\n        filename -- The path to save the translation unit to.\n        \"\"\"\n        options = conf.lib.clang_defaultSaveOptions(self)\n        result = int(conf.lib.clang_saveTranslationUnit(self, filename,\n                                                        options))\n        if result != 0:\n            raise TranslationUnitSaveError(result,\n                'Error saving TranslationUnit.')\n\n    def codeComplete(self, path, line, column, unsaved_files=None,\n                     include_macros=False, include_code_patterns=False,\n                     include_brief_comments=False):\n        \"\"\"\n        Code complete in this translation unit.\n\n        In-memory contents for files can be provided by passing a list of pairs\n        as unsaved_files, the first items should be the filenames to be mapped\n        and the second should be the contents to be substituted for the\n        file. The contents may be passed as strings or file objects.\n        \"\"\"\n        options = 0\n\n        if include_macros:\n            options += 1\n\n        if include_code_patterns:\n            options += 2\n\n        if include_brief_comments:\n            options += 4\n\n        if unsaved_files is None:\n            unsaved_files = []\n\n        unsaved_files_array = 0\n        if len(unsaved_files):\n            unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))()\n            for i,(name,value) in enumerate(unsaved_files):\n                if not isinstance(value, str):\n                    # FIXME: It would be great to support an efficient version\n                    # of this, one day.\n                    value = value.read()\n                    print value\n                if not isinstance(value, str):\n                    raise TypeError,'Unexpected unsaved file contents.'\n                unsaved_files_array[i].name = name\n                unsaved_files_array[i].contents = value\n                unsaved_files_array[i].length = len(value)\n        ptr = conf.lib.clang_codeCompleteAt(self, path, line, column,\n                unsaved_files_array, len(unsaved_files), options)\n        if ptr:\n            return CodeCompletionResults(ptr)\n        return None\n\n    def get_tokens(self, locations=None, extent=None):\n        \"\"\"Obtain tokens in this translation unit.\n\n        This is a generator for Token instances. The caller specifies a range\n        of source code to obtain tokens for. The range can be specified as a\n        2-tuple of SourceLocation or as a SourceRange. If both are defined,\n        behavior is undefined.\n        \"\"\"\n        if locations is not None:\n            extent = SourceRange(start=locations[0], end=locations[1])\n\n        return TokenGroup.get_tokens(self, extent)\n\nclass File(ClangObject):\n    \"\"\"\n    The File class represents a particular source file that is part of a\n    translation unit.\n    \"\"\"\n\n    @staticmethod\n    def from_name(translation_unit, file_name):\n        \"\"\"Retrieve a file handle within the given translation unit.\"\"\"\n        return File(conf.lib.clang_getFile(translation_unit, file_name))\n\n    @property\n    def name(self):\n        \"\"\"Return the complete file and path name of the file.\"\"\"\n        return conf.lib.clang_getCString(conf.lib.clang_getFileName(self))\n\n    @property\n    def time(self):\n        \"\"\"Return the last modification time of the file.\"\"\"\n        return conf.lib.clang_getFileTime(self)\n\n    def __str__(self):\n        return self.name\n\n    def __repr__(self):\n        return \"<File: %s>\" % (self.name)\n\n    @staticmethod\n    def from_cursor_result(res, fn, args):\n        assert isinstance(res, File)\n\n        # Copy a reference to the TranslationUnit to prevent premature GC.\n        res._tu = args[0]._tu\n        return res\n\nclass FileInclusion(object):\n    \"\"\"\n    The FileInclusion class represents the inclusion of one source file by\n    another via a '#include' directive or as the input file for the translation\n    unit. This class provides information about the included file, the including\n    file, the location of the '#include' directive and the depth of the included\n    file in the stack. Note that the input file has depth 0.\n    \"\"\"\n\n    def __init__(self, src, tgt, loc, depth):\n        self.source = src\n        self.include = tgt\n        self.location = loc\n        self.depth = depth\n\n    @property\n    def is_input_file(self):\n        \"\"\"True if the included file is the input file.\"\"\"\n        return self.depth == 0\n\nclass CompilationDatabaseError(Exception):\n    \"\"\"Represents an error that occurred when working with a CompilationDatabase\n\n    Each error is associated to an enumerated value, accessible under\n    e.cdb_error. Consumers can compare the value with one of the ERROR_\n    constants in this class.\n    \"\"\"\n\n    # An unknown error occured\n    ERROR_UNKNOWN = 0\n\n    # The database could not be loaded\n    ERROR_CANNOTLOADDATABASE = 1\n\n    def __init__(self, enumeration, message):\n        assert isinstance(enumeration, int)\n\n        if enumeration > 1:\n            raise Exception(\"Encountered undefined CompilationDatabase error \"\n                            \"constant: %d. Please file a bug to have this \"\n                            \"value supported.\" % enumeration)\n\n        self.cdb_error = enumeration\n        Exception.__init__(self, 'Error %d: %s' % (enumeration, message))\n\nclass CompileCommand(object):\n    \"\"\"Represents the compile command used to build a file\"\"\"\n    def __init__(self, cmd, ccmds):\n        self.cmd = cmd\n        # Keep a reference to the originating CompileCommands\n        # to prevent garbage collection\n        self.ccmds = ccmds\n\n    @property\n    def directory(self):\n        \"\"\"Get the working directory for this CompileCommand\"\"\"\n        return conf.lib.clang_CompileCommand_getDirectory(self.cmd)\n\n    @property\n    def arguments(self):\n        \"\"\"\n        Get an iterable object providing each argument in the\n        command line for the compiler invocation as a _CXString.\n\n        Invariant : the first argument is the compiler executable\n        \"\"\"\n        length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd)\n        for i in xrange(length):\n            yield conf.lib.clang_CompileCommand_getArg(self.cmd, i)\n\nclass CompileCommands(object):\n    \"\"\"\n    CompileCommands is an iterable object containing all CompileCommand\n    that can be used for building a specific file.\n    \"\"\"\n    def __init__(self, ccmds):\n        self.ccmds = ccmds\n\n    def __del__(self):\n        conf.lib.clang_CompileCommands_dispose(self.ccmds)\n\n    def __len__(self):\n        return int(conf.lib.clang_CompileCommands_getSize(self.ccmds))\n\n    def __getitem__(self, i):\n        cc = conf.lib.clang_CompileCommands_getCommand(self.ccmds, i)\n        if not cc:\n            raise IndexError\n        return CompileCommand(cc, self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        if not res:\n            return None\n        return CompileCommands(res)\n\nclass CompilationDatabase(ClangObject):\n    \"\"\"\n    The CompilationDatabase is a wrapper class around\n    clang::tooling::CompilationDatabase\n\n    It enables querying how a specific source file can be built.\n    \"\"\"\n\n    def __del__(self):\n        conf.lib.clang_CompilationDatabase_dispose(self)\n\n    @staticmethod\n    def from_result(res, fn, args):\n        if not res:\n            raise CompilationDatabaseError(0,\n                                           \"CompilationDatabase loading failed\")\n        return CompilationDatabase(res)\n\n    @staticmethod\n    def fromDirectory(buildDir):\n        \"\"\"Builds a CompilationDatabase from the database found in buildDir\"\"\"\n        errorCode = c_uint()\n        try:\n            cdb = conf.lib.clang_CompilationDatabase_fromDirectory(buildDir,\n                byref(errorCode))\n        except CompilationDatabaseError as e:\n            raise CompilationDatabaseError(int(errorCode.value),\n                                           \"CompilationDatabase loading failed\")\n        return cdb\n\n    def getCompileCommands(self, filename):\n        \"\"\"\n        Get an iterable object providing all the CompileCommands available to\n        build filename. Returns None if filename is not found in the database.\n        \"\"\"\n        return conf.lib.clang_CompilationDatabase_getCompileCommands(self,\n                                                                     filename)\n\nclass Token(Structure):\n    \"\"\"Represents a single token from the preprocessor.\n\n    Tokens are effectively segments of source code. Source code is first parsed\n    into tokens before being converted into the AST and Cursors.\n\n    Tokens are obtained from parsed TranslationUnit instances. You currently\n    can't create tokens manually.\n    \"\"\"\n    _fields_ = [\n        ('int_data', c_uint * 4),\n        ('ptr_data', c_void_p)\n    ]\n\n    @property\n    def spelling(self):\n        \"\"\"The spelling of this token.\n\n        This is the textual representation of the token in source.\n        \"\"\"\n        return conf.lib.clang_getTokenSpelling(self._tu, self)\n\n    @property\n    def kind(self):\n        \"\"\"Obtain the TokenKind of the current token.\"\"\"\n        return TokenKind.from_value(conf.lib.clang_getTokenKind(self))\n\n    @property\n    def location(self):\n        \"\"\"The SourceLocation this Token occurs at.\"\"\"\n        return conf.lib.clang_getTokenLocation(self._tu, self)\n\n    @property\n    def extent(self):\n        \"\"\"The SourceRange this Token occupies.\"\"\"\n        return conf.lib.clang_getTokenExtent(self._tu, self)\n\n    @property\n    def cursor(self):\n        \"\"\"The Cursor this Token corresponds to.\"\"\"\n        cursor = Cursor()\n\n        conf.lib.clang_annotateTokens(self._tu, byref(self), 1, byref(cursor))\n\n        return cursor\n\n# Now comes the plumbing to hook up the C library.\n\n# Register callback types in common container.\ncallbacks['translation_unit_includes'] = CFUNCTYPE(None, c_object_p,\n        POINTER(SourceLocation), c_uint, py_object)\ncallbacks['cursor_visit'] = CFUNCTYPE(c_int, Cursor, Cursor, py_object)\n\n# Functions strictly alphabetical order.\nfunctionList = [\n  (\"clang_annotateTokens\",\n   [TranslationUnit, POINTER(Token), c_uint, POINTER(Cursor)]),\n\n  (\"clang_CompilationDatabase_dispose\",\n   [c_object_p]),\n\n  (\"clang_CompilationDatabase_fromDirectory\",\n   [c_char_p, POINTER(c_uint)],\n   c_object_p,\n   CompilationDatabase.from_result),\n\n  (\"clang_CompilationDatabase_getCompileCommands\",\n   [c_object_p, c_char_p],\n   c_object_p,\n   CompileCommands.from_result),\n\n  (\"clang_CompileCommands_dispose\",\n   [c_object_p]),\n\n  (\"clang_CompileCommands_getCommand\",\n   [c_object_p, c_uint],\n   c_object_p),\n\n  (\"clang_CompileCommands_getSize\",\n   [c_object_p],\n   c_uint),\n\n  (\"clang_CompileCommand_getArg\",\n   [c_object_p, c_uint],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_CompileCommand_getDirectory\",\n   [c_object_p],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_CompileCommand_getNumArgs\",\n   [c_object_p],\n   c_uint),\n\n  (\"clang_codeCompleteAt\",\n   [TranslationUnit, c_char_p, c_int, c_int, c_void_p, c_int, c_int],\n   POINTER(CCRStructure)),\n\n  (\"clang_codeCompleteGetDiagnostic\",\n   [CodeCompletionResults, c_int],\n   Diagnostic),\n\n  (\"clang_codeCompleteGetNumDiagnostics\",\n   [CodeCompletionResults],\n   c_int),\n\n  (\"clang_createIndex\",\n   [c_int, c_int],\n   c_object_p),\n\n  (\"clang_createTranslationUnit\",\n   [Index, c_char_p],\n   c_object_p),\n\n  (\"clang_CXXMethod_isStatic\",\n   [Cursor],\n   bool),\n\n  (\"clang_CXXMethod_isVirtual\",\n   [Cursor],\n   bool),\n\n  (\"clang_defaultSaveOptions\",\n   [TranslationUnit],\n   c_uint),\n\n  (\"clang_disposeCodeCompleteResults\",\n   [CodeCompletionResults]),\n\n# (\"clang_disposeCXTUResourceUsage\",\n#  [CXTUResourceUsage]),\n\n  (\"clang_disposeDiagnostic\",\n   [Diagnostic]),\n\n  (\"clang_disposeIndex\",\n   [Index]),\n\n  (\"clang_disposeString\",\n   [_CXString]),\n\n  (\"clang_disposeTokens\",\n   [TranslationUnit, POINTER(Token), c_uint]),\n\n  (\"clang_disposeTranslationUnit\",\n   [TranslationUnit]),\n\n  (\"clang_equalCursors\",\n   [Cursor, Cursor],\n   bool),\n\n  (\"clang_equalLocations\",\n   [SourceLocation, SourceLocation],\n   bool),\n\n  (\"clang_equalRanges\",\n   [SourceRange, SourceRange],\n   bool),\n\n  (\"clang_equalTypes\",\n   [Type, Type],\n   bool),\n\n  (\"clang_getArgType\",\n   [Type, c_uint],\n   Type,\n   Type.from_result),\n\n  (\"clang_getArrayElementType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getArraySize\",\n   [Type],\n   c_longlong),\n\n  (\"clang_getFieldDeclBitWidth\",\n   [Cursor],\n   c_int),\n\n  (\"clang_getCanonicalCursor\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getCanonicalType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getCompletionAvailability\",\n   [c_void_p],\n   c_int),\n\n  (\"clang_getCompletionBriefComment\",\n   [c_void_p],\n   _CXString),\n\n  (\"clang_getCompletionChunkCompletionString\",\n   [c_void_p, c_int],\n   c_object_p),\n\n  (\"clang_getCompletionChunkKind\",\n   [c_void_p, c_int],\n   c_int),\n\n  (\"clang_getCompletionChunkText\",\n   [c_void_p, c_int],\n   _CXString),\n\n  (\"clang_getCompletionPriority\",\n   [c_void_p],\n   c_int),\n\n  (\"clang_getCursorAvailability\",\n   [Cursor],\n   AvailabilityKind.from_id),\n\n  (\"clang_getCString\",\n   [_CXString],\n   c_char_p),\n\n  (\"clang_getCursor\",\n   [TranslationUnit, SourceLocation],\n   Cursor),\n\n  (\"clang_getCursorDefinition\",\n   [Cursor],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getCursorDisplayName\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getCursorExtent\",\n   [Cursor],\n   SourceRange),\n\n  (\"clang_getCursorLexicalParent\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getCursorLocation\",\n   [Cursor],\n   SourceLocation),\n\n  (\"clang_getCursorReferenced\",\n   [Cursor],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getCursorReferenceNameRange\",\n   [Cursor, c_uint, c_uint],\n   SourceRange),\n\n  (\"clang_getCursorSemanticParent\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getCursorSpelling\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getCursorType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getCursorUSR\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n# (\"clang_getCXTUResourceUsage\",\n#  [TranslationUnit],\n#  CXTUResourceUsage),\n\n  (\"clang_getCXXAccessSpecifier\",\n   [Cursor],\n   AccessSpecifierKind.from_id),\n\n  (\"clang_getDeclObjCTypeEncoding\",\n   [Cursor],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnostic\",\n   [c_object_p, c_uint],\n   c_object_p),\n\n  (\"clang_getDiagnosticCategory\",\n   [Diagnostic],\n   c_uint),\n\n  (\"clang_getDiagnosticCategoryName\",\n   [c_uint],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnosticFixIt\",\n   [Diagnostic, c_uint, POINTER(SourceRange)],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnosticLocation\",\n   [Diagnostic],\n   SourceLocation),\n\n  (\"clang_getDiagnosticNumFixIts\",\n   [Diagnostic],\n   c_uint),\n\n  (\"clang_getDiagnosticNumRanges\",\n   [Diagnostic],\n   c_uint),\n\n  (\"clang_getDiagnosticOption\",\n   [Diagnostic, POINTER(_CXString)],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getDiagnosticRange\",\n   [Diagnostic, c_uint],\n   SourceRange),\n\n  (\"clang_getDiagnosticSeverity\",\n   [Diagnostic],\n   c_int),\n\n  (\"clang_getDiagnosticSpelling\",\n   [Diagnostic],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getElementType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getEnumConstantDeclUnsignedValue\",\n   [Cursor],\n   c_ulonglong),\n\n  (\"clang_getEnumConstantDeclValue\",\n   [Cursor],\n   c_longlong),\n\n  (\"clang_getEnumDeclIntegerType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getFile\",\n   [TranslationUnit, c_char_p],\n   c_object_p),\n\n  (\"clang_getFileName\",\n   [File],\n   _CXString), # TODO go through _CXString.from_result?\n\n  (\"clang_getFileTime\",\n   [File],\n   c_uint),\n\n  (\"clang_getIBOutletCollectionType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getIncludedFile\",\n   [Cursor],\n   File,\n   File.from_cursor_result),\n\n  (\"clang_getInclusions\",\n   [TranslationUnit, callbacks['translation_unit_includes'], py_object]),\n\n  (\"clang_getInstantiationLocation\",\n   [SourceLocation, POINTER(c_object_p), POINTER(c_uint), POINTER(c_uint),\n    POINTER(c_uint)]),\n\n  (\"clang_getLocation\",\n   [TranslationUnit, File, c_uint, c_uint],\n   SourceLocation),\n\n  (\"clang_getLocationForOffset\",\n   [TranslationUnit, File, c_uint],\n   SourceLocation),\n\n  (\"clang_getNullCursor\",\n   None,\n   Cursor),\n\n  (\"clang_getNumArgTypes\",\n   [Type],\n   c_uint),\n\n  (\"clang_getNumCompletionChunks\",\n   [c_void_p],\n   c_int),\n\n  (\"clang_getNumDiagnostics\",\n   [c_object_p],\n   c_uint),\n\n  (\"clang_getNumElements\",\n   [Type],\n   c_longlong),\n\n  (\"clang_getNumOverloadedDecls\",\n   [Cursor],\n   c_uint),\n\n  (\"clang_getOverloadedDecl\",\n   [Cursor, c_uint],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getPointeeType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getRange\",\n   [SourceLocation, SourceLocation],\n   SourceRange),\n\n  (\"clang_getRangeEnd\",\n   [SourceRange],\n   SourceLocation),\n\n  (\"clang_getRangeStart\",\n   [SourceRange],\n   SourceLocation),\n\n  (\"clang_getResultType\",\n   [Type],\n   Type,\n   Type.from_result),\n\n  (\"clang_getSpecializedCursorTemplate\",\n   [Cursor],\n   Cursor,\n   Cursor.from_cursor_result),\n\n  (\"clang_getTemplateCursorKind\",\n   [Cursor],\n   c_uint),\n\n  (\"clang_getTokenExtent\",\n   [TranslationUnit, Token],\n   SourceRange),\n\n  (\"clang_getTokenKind\",\n   [Token],\n   c_uint),\n\n  (\"clang_getTokenLocation\",\n   [TranslationUnit, Token],\n   SourceLocation),\n\n  (\"clang_getTokenSpelling\",\n   [TranslationUnit, Token],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getTranslationUnitCursor\",\n   [TranslationUnit],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getTranslationUnitSpelling\",\n   [TranslationUnit],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_getTUResourceUsageName\",\n   [c_uint],\n   c_char_p),\n\n  (\"clang_getTypeDeclaration\",\n   [Type],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_getTypedefDeclUnderlyingType\",\n   [Cursor],\n   Type,\n   Type.from_result),\n\n  (\"clang_getTypeKindSpelling\",\n   [c_uint],\n   _CXString,\n   _CXString.from_result),\n\n  (\"clang_hashCursor\",\n   [Cursor],\n   c_uint),\n\n  (\"clang_isAttribute\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isConstQualifiedType\",\n   [Type],\n   bool),\n\n  (\"clang_isCursorDefinition\",\n   [Cursor],\n   bool),\n\n  (\"clang_isDeclaration\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isExpression\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isFileMultipleIncludeGuarded\",\n   [TranslationUnit, File],\n   bool),\n\n  (\"clang_isFunctionTypeVariadic\",\n   [Type],\n   bool),\n\n  (\"clang_isInvalid\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isPODType\",\n   [Type],\n   bool),\n\n  (\"clang_isPreprocessing\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isReference\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isRestrictQualifiedType\",\n   [Type],\n   bool),\n\n  (\"clang_isStatement\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isTranslationUnit\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isUnexposed\",\n   [CursorKind],\n   bool),\n\n  (\"clang_isVirtualBase\",\n   [Cursor],\n   bool),\n\n  (\"clang_isVolatileQualifiedType\",\n   [Type],\n   bool),\n\n  (\"clang_parseTranslationUnit\",\n   [Index, c_char_p, c_void_p, c_int, c_void_p, c_int, c_int],\n   c_object_p),\n\n  (\"clang_reparseTranslationUnit\",\n   [TranslationUnit, c_int, c_void_p, c_int],\n   c_int),\n\n  (\"clang_saveTranslationUnit\",\n   [TranslationUnit, c_char_p, c_uint],\n   c_int),\n\n  (\"clang_tokenize\",\n   [TranslationUnit, SourceRange, POINTER(POINTER(Token)), POINTER(c_uint)]),\n\n  (\"clang_visitChildren\",\n   [Cursor, callbacks['cursor_visit'], py_object],\n   c_uint),\n\n  (\"clang_Cursor_getNumArguments\",\n   [Cursor],\n   c_int),\n\n  (\"clang_Cursor_getArgument\",\n   [Cursor, c_uint],\n   Cursor,\n   Cursor.from_result),\n\n  (\"clang_Cursor_isBitField\",\n   [Cursor],\n   bool),\n\n  (\"clang_Type_getAlignOf\",\n   [Type],\n   c_longlong),\n\n  (\"clang_Type_getOffsetOf\",\n   [Type, c_char_p],\n   c_longlong),\n\n  (\"clang_Type_getSizeOf\",\n   [Type],\n   c_ulonglong),\n]\n\nclass LibclangError(Exception):\n    def __init__(self, message):\n        self.m = message\n\n    def __str__(self):\n        return self.m\n\ndef register_function(lib, item, ignore_errors):\n    # A function may not exist, if these bindings are used with an older or\n    # incompatible version of libclang.so.\n    try:\n        func = getattr(lib, item[0])\n    except AttributeError as e:\n        msg = str(e) + \". Please ensure that your python bindings are \"\\\n                       \"compatible with your libclang.so version.\"\n        if ignore_errors:\n            return\n        raise LibclangError(msg)\n\n    if len(item) >= 2:\n        func.argtypes = item[1]\n\n    if len(item) >= 3:\n        func.restype = item[2]\n\n    if len(item) == 4:\n        func.errcheck = item[3]\n\ndef register_functions(lib, ignore_errors):\n    \"\"\"Register function prototypes with a libclang library instance.\n\n    This must be called as part of library instantiation so Python knows how\n    to call out to the shared library.\n    \"\"\"\n\n    def register(item):\n        return register_function(lib, item, ignore_errors)\n\n    map(register, functionList)\n\nclass Config:\n    library_path = None\n    library_file = None\n    compatibility_check = True\n    loaded = False\n\n    @staticmethod\n    def set_library_path(path):\n        \"\"\"Set the path in which to search for libclang\"\"\"\n        if Config.loaded:\n            raise Exception(\"library path must be set before before using \" \\\n                            \"any other functionalities in libclang.\")\n\n        Config.library_path = path\n\n    @staticmethod\n    def set_library_file(filename):\n        \"\"\"Set the exact location of libclang\"\"\"\n        if Config.loaded:\n            raise Exception(\"library file must be set before before using \" \\\n                            \"any other functionalities in libclang.\")\n\n        Config.library_file = filename\n\n    @staticmethod\n    def set_compatibility_check(check_status):\n        \"\"\" Perform compatibility check when loading libclang\n\n        The python bindings are only tested and evaluated with the version of\n        libclang they are provided with. To ensure correct behavior a (limited)\n        compatibility check is performed when loading the bindings. This check\n        will throw an exception, as soon as it fails.\n\n        In case these bindings are used with an older version of libclang, parts\n        that have been stable between releases may still work. Users of the\n        python bindings can disable the compatibility check. This will cause\n        the python bindings to load, even though they are written for a newer\n        version of libclang. Failures now arise if unsupported or incompatible\n        features are accessed. The user is required to test himself if the\n        features he is using are available and compatible between different\n        libclang versions.\n        \"\"\"\n        if Config.loaded:\n            raise Exception(\"compatibility_check must be set before before \" \\\n                            \"using any other functionalities in libclang.\")\n\n        Config.compatibility_check = check_status\n\n    @CachedProperty\n    def lib(self):\n        lib = self.get_cindex_library()\n        register_functions(lib, not Config.compatibility_check)\n        Config.loaded = True\n        return lib\n\n    def get_filename(self):\n        if Config.library_file:\n            return Config.library_file\n\n        import platform\n        name = platform.system()\n\n        if name == 'Darwin':\n            file = 'libclang.dylib'\n        elif name == 'Windows':\n            file = 'libclang.dll'\n        else:\n            file = 'libclang.so'\n\n        if Config.library_path:\n            file = Config.library_path + '/' + file\n\n        return file\n\n    def get_cindex_library(self):\n        try:\n            library = cdll.LoadLibrary(self.get_filename())\n        except OSError as e:\n            msg = str(e) + \". To provide a path to libclang use \" \\\n                           \"Config.set_library_path() or \" \\\n                           \"Config.set_library_file().\"\n            raise LibclangError(msg)\n\n        return library\n\n    def function_exists(self, name):\n        try:\n            getattr(self.lib, name)\n        except AttributeError:\n            return False\n\n        return True\n\ndef register_enumerations():\n    for name, value in clang.enumerations.TokenKinds:\n        TokenKind.register(value, name)\n\nconf = Config()\nregister_enumerations()\n\n__all__ = [\n    'Config',\n    'CodeCompletionResults',\n    'CompilationDatabase',\n    'CompileCommands',\n    'CompileCommand',\n    'CursorKind',\n    'Cursor',\n    'Diagnostic',\n    'File',\n    'FixIt',\n    'Index',\n    'SourceLocation',\n    'SourceRange',\n    'TokenKind',\n    'Token',\n    'TranslationUnitLoadError',\n    'TranslationUnit',\n    'TypeKind',\n    'Type',\n]\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/clang/enumerations.py",
    "content": "#===- enumerations.py - Python Enumerations ------------------*- python -*--===#\n#\n#                     The LLVM Compiler Infrastructure\n#\n# This file is distributed under the University of Illinois Open Source\n# License. See LICENSE.TXT for details.\n#\n#===------------------------------------------------------------------------===#\n\n\"\"\"\nClang Enumerations\n==================\n\nThis module provides static definitions of enumerations that exist in libclang.\n\nEnumerations are typically defined as a list of tuples. The exported values are\ntypically munged into other types or classes at module load time.\n\nAll enumerations are centrally defined in this file so they are all grouped\ntogether and easier to audit. And, maybe even one day this file will be\nautomatically generated by scanning the libclang headers!\n\"\"\"\n\n# Maps to CXTokenKind. Note that libclang maintains a separate set of token\n# enumerations from the C++ API.\nTokenKinds = [\n    ('PUNCTUATION', 0),\n    ('KEYWORD', 1),\n    ('IDENTIFIER', 2),\n    ('LITERAL', 3),\n    ('COMMENT', 4),\n]\n\n__all__ = ['TokenKinds']\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/generator",
    "content": "#!/bin/sh\n\nPYTHON=/opt/local/bin/python2.7\nDYLD_LIBRARY_PATH=\"/opt/local/libexec/llvm-3.1/lib\" $PYTHON generator.py $*\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/generator.py",
    "content": "#!/usr/bin/env python\n# generator.py\n# simple C++ generator, originally targetted for Spidermonkey bindings\n#\n# Copyright (c) 2011 - Zynga Inc.\n\nfrom clang import cindex\nimport sys\nimport pdb\nimport ConfigParser\nimport yaml\nimport re\nimport os\nimport inspect\nimport traceback\nfrom Cheetah.Template import Template\n\ntype_map = {\n    cindex.TypeKind.VOID        : \"void\",\n    cindex.TypeKind.BOOL        : \"bool\",\n    cindex.TypeKind.CHAR_U      : \"unsigned char\",\n    cindex.TypeKind.UCHAR       : \"unsigned char\",\n    cindex.TypeKind.CHAR16      : \"char\",\n    cindex.TypeKind.CHAR32      : \"char\",\n    cindex.TypeKind.USHORT      : \"unsigned short\",\n    cindex.TypeKind.UINT        : \"unsigned int\",\n    cindex.TypeKind.ULONG       : \"unsigned long\",\n    cindex.TypeKind.ULONGLONG   : \"unsigned long long\",\n    cindex.TypeKind.CHAR_S      : \"char\",\n    cindex.TypeKind.SCHAR       : \"char\",\n    cindex.TypeKind.WCHAR       : \"wchar_t\",\n    cindex.TypeKind.SHORT       : \"short\",\n    cindex.TypeKind.INT         : \"int\",\n    cindex.TypeKind.LONG        : \"long\",\n    cindex.TypeKind.LONGLONG    : \"long long\",\n    cindex.TypeKind.FLOAT       : \"float\",\n    cindex.TypeKind.DOUBLE      : \"double\",\n    cindex.TypeKind.LONGDOUBLE  : \"long double\",\n    cindex.TypeKind.NULLPTR     : \"NULL\",\n    cindex.TypeKind.OBJCID      : \"id\",\n    cindex.TypeKind.OBJCCLASS   : \"class\",\n    cindex.TypeKind.OBJCSEL     : \"SEL\",\n    # cindex.TypeKind.ENUM        : \"int\"\n}\n\nINVALID_NATIVE_TYPE = \"??\"\n\ndefault_arg_type_arr = [\n\n# An integer literal.\ncindex.CursorKind.INTEGER_LITERAL,\n\n# A floating point number literal.\ncindex.CursorKind.FLOATING_LITERAL,\n\n# An imaginary number literal.\ncindex.CursorKind.IMAGINARY_LITERAL,\n\n# A string literal.\ncindex.CursorKind.STRING_LITERAL,\n\n# A character literal.\ncindex.CursorKind.CHARACTER_LITERAL,\n\n# [C++ 2.13.5] C++ Boolean Literal.\ncindex.CursorKind.CXX_BOOL_LITERAL_EXPR,\n\n# [C++0x 2.14.7] C++ Pointer Literal.\ncindex.CursorKind.CXX_NULL_PTR_LITERAL_EXPR,\n\n# An expression that refers to some value declaration, such as a function,\n# varible, or enumerator.\ncindex.CursorKind.DECL_REF_EXPR\n]\n\ndef native_name_from_type(ntype, underlying=False):\n    kind = ntype.kind #get_canonical().kind\n    const = \"\" #\"const \" if ntype.is_const_qualified() else \"\"\n    if not underlying and kind == cindex.TypeKind.ENUM:\n        decl = ntype.get_declaration()\n        return get_namespaced_name(decl)\n    elif kind in type_map:\n        return const + type_map[kind]\n    elif kind == cindex.TypeKind.RECORD:\n        # might be an std::string\n        decl = ntype.get_declaration()\n        parent = decl.semantic_parent\n        cdecl = ntype.get_canonical().get_declaration()\n        cparent = cdecl.semantic_parent\n        if decl.spelling == \"string\" and parent and parent.spelling == \"std\":\n            return \"std::string\"\n        elif cdecl.spelling == \"function\" and cparent and cparent.spelling == \"std\":\n            return \"std::function\"\n        else:\n            # print >> sys.stderr, \"probably a function pointer: \" + str(decl.spelling)\n            return const + decl.spelling\n    else:\n        # name = ntype.get_declaration().spelling\n        # print >> sys.stderr, \"Unknown type: \" + str(kind) + \" \" + str(name)\n        return INVALID_NATIVE_TYPE\n        # pdb.set_trace()\n\n\ndef build_namespace(cursor, namespaces=[]):\n    '''\n    build the full namespace for a specific cursor\n    '''\n    if cursor:\n        parent = cursor.semantic_parent\n        if parent:\n            if parent.kind == cindex.CursorKind.NAMESPACE or parent.kind == cindex.CursorKind.CLASS_DECL:\n                namespaces.append(parent.displayname)\n                build_namespace(parent, namespaces)\n\n    return namespaces\n\n\ndef get_namespaced_name(declaration_cursor):\n    ns_list = build_namespace(declaration_cursor, [])\n    ns_list.reverse()\n    ns = \"::\".join(ns_list)\n    if len(ns) > 0:\n        return ns + \"::\" + declaration_cursor.displayname\n    return declaration_cursor.displayname\n\n\nclass NativeType(object):\n    def __init__(self):\n        self.is_object = False\n        self.is_function = False\n        self.is_enum = False\n        self.not_supported = False\n        self.param_types = []\n        self.ret_type = None\n        self.namespaced_name = \"\"\n        self.name = \"\"\n        self.whole_name = None\n        self.is_const = False\n        self.is_pointer = False\n        self.canonical_type = None\n\n    @staticmethod\n    def from_type(ntype):\n        if ntype.kind == cindex.TypeKind.POINTER:\n            nt = NativeType.from_type(ntype.get_pointee())\n\n            if None != nt.canonical_type:\n                nt.canonical_type.name += \"*\"\n                nt.canonical_type.namespaced_name += \"*\"\n                nt.canonical_type.whole_name += \"*\"\n\n            nt.name += \"*\"\n            nt.namespaced_name += \"*\"\n            nt.whole_name = nt.namespaced_name\n            nt.is_enum = False\n            nt.is_const = ntype.get_pointee().is_const_qualified()\n            nt.is_pointer = True\n            if nt.is_const:\n                nt.whole_name = \"const \" + nt.whole_name\n        elif ntype.kind == cindex.TypeKind.LVALUEREFERENCE:\n            nt = NativeType.from_type(ntype.get_pointee())\n            nt.is_const = ntype.get_pointee().is_const_qualified()\n            nt.whole_name = nt.namespaced_name + \"&\"\n\n            if nt.is_const:\n                nt.whole_name = \"const \" + nt.whole_name\n\n            if None != nt.canonical_type:\n                nt.canonical_type.whole_name += \"&\"\n        else:\n            nt = NativeType()\n            decl = ntype.get_declaration()\n\n            if ntype.kind == cindex.TypeKind.RECORD:\n                if decl.kind == cindex.CursorKind.CLASS_DECL:\n                    nt.is_object = True\n                nt.name = decl.displayname\n                nt.namespaced_name = get_namespaced_name(decl)\n                nt.whole_name = nt.namespaced_name\n            else:\n                if decl.kind == cindex.CursorKind.NO_DECL_FOUND:\n                    nt.name = native_name_from_type(ntype)\n                else:\n                    nt.name = decl.spelling\n                nt.namespaced_name = get_namespaced_name(decl)\n\n                if nt.namespaced_name == \"std::string\":\n                    nt.name = nt.namespaced_name\n\n                if nt.namespaced_name.startswith(\"std::function\"):\n                    nt.name = \"std::function\"\n\n                if len(nt.namespaced_name) == 0 or nt.namespaced_name.find(\"::\") == -1:\n                    nt.namespaced_name = nt.name\n\n                nt.whole_name = nt.namespaced_name\n                nt.is_const = ntype.is_const_qualified()\n                if nt.is_const:\n                    nt.whole_name = \"const \" + nt.whole_name\n\n                # Check whether it's a std::function typedef\n                cdecl = ntype.get_canonical().get_declaration()\n                if None != cdecl.spelling and 0 == cmp(cdecl.spelling, \"function\"):\n                    nt.name = \"std::function\"\n\n                if nt.name != INVALID_NATIVE_TYPE and nt.name != \"std::string\" and nt.name != \"std::function\":\n                    if ntype.kind == cindex.TypeKind.UNEXPOSED or ntype.kind == cindex.TypeKind.TYPEDEF:\n                        ret = NativeType.from_type(ntype.get_canonical())\n                        if ret.name != \"\":\n                            if decl.kind == cindex.CursorKind.TYPEDEF_DECL:\n                                ret.canonical_type = nt\n                            return ret\n\n                nt.is_enum = ntype.get_canonical().kind == cindex.TypeKind.ENUM\n\n                if nt.name == \"std::function\":\n                    nt.namespaced_name = get_namespaced_name(cdecl)\n\n                    r = re.compile('function<(\\S+) \\((.*)\\)>').search(cdecl.displayname)\n                    (ret_type, params) = r.groups()\n                    params = filter(None, params.split(\", \"))\n\n                    nt.is_function = True\n                    nt.ret_type = NativeType.from_string(ret_type)\n                    nt.param_types = [NativeType.from_string(string) for string in params]\n\n        # mark argument as not supported\n        if nt.name == INVALID_NATIVE_TYPE:\n            nt.not_supported = True\n\n        return nt\n\n    @staticmethod\n    def from_string(displayname):\n        displayname = displayname.replace(\"cocos2d::\", \"\")\n        displayname = displayname.replace(\" *\", \"*\")\n\n        nt = NativeType()\n        nt.name = displayname\n        nt.namespaced_name = displayname\n        nt.whole_name = nt.namespaced_name\n        nt.is_object = True\n        return nt\n\n    @property\n    def lambda_parameters(self):\n        params = [\"%s larg%d\" % (str(nt), i) for i, nt in enumerate(self.param_types)]\n        return \", \".join(params)\n\n    @staticmethod\n    def dict_has_key_re(dict, real_key_list):\n        for real_key in real_key_list:\n            for (k, v) in dict.items():\n                if k.startswith('@'):\n                    k = k[1:]\n                    match = re.match(\"^\" + k + \"$\", real_key)\n                    if match:\n                        return True\n                else:\n                    if k == real_key:\n                        return True\n        return False\n\n    @staticmethod\n    def dict_get_value_re(dict, real_key_list):\n        for real_key in real_key_list:\n            for (k, v) in dict.items():\n                if k.startswith('@'):\n                    k = k[1:]\n                    match = re.match(\"^\" + k + \"$\", real_key)\n                    if match:\n                        return v\n                else:\n                    if k == real_key:\n                        return v\n        return None\n\n    @staticmethod\n    def dict_replace_value_re(dict, real_key_list):\n        for real_key in real_key_list:\n            for (k, v) in dict.items():\n                if k.startswith('@'):\n                    k = k[1:]\n                    match = re.match('.*' + k, real_key)\n                    if match:\n                        return re.sub(k, v, real_key)\n                else:\n                    if k == real_key:\n                        return v\n        return None\n\n    def from_native(self, convert_opts):\n        assert(convert_opts.has_key('generator'))\n        generator = convert_opts['generator']\n        keys = []\n\n        if self.canonical_type != None:\n            keys.append(self.canonical_type.name)\n        keys.append(self.name)\n\n        from_native_dict = generator.config['conversions']['from_native']\n\n        if self.is_object:\n            if not NativeType.dict_has_key_re(from_native_dict, keys):\n                keys.append(\"object\")\n        elif self.is_enum:\n            keys.append(\"int\")\n\n        if NativeType.dict_has_key_re(from_native_dict, keys):\n            tpl = NativeType.dict_get_value_re(from_native_dict, keys)\n            tpl = Template(tpl, searchList=[convert_opts])\n            return str(tpl).rstrip()\n\n        return \"#pragma warning NO CONVERSION FROM NATIVE FOR \" + self.name\n\n    def to_native(self, convert_opts):\n        assert('generator' in convert_opts)\n        generator = convert_opts['generator']\n        keys = []\n\n        if self.canonical_type != None:\n            keys.append(self.canonical_type.name)\n        keys.append(self.name)\n\n        to_native_dict = generator.config['conversions']['to_native']\n        if self.is_object:\n            if not NativeType.dict_has_key_re(to_native_dict, keys):\n                keys.append(\"object\")\n        elif self.is_enum:\n            keys.append(\"int\")\n\n        if self.is_function:\n            tpl = Template(file=os.path.join(generator.target, \"templates\", \"lambda.c\"),\n                searchList=[convert_opts, self])\n            indent = convert_opts['level'] * \"\\t\"\n            return str(tpl).replace(\"\\n\", \"\\n\" + indent)\n\n\n        if NativeType.dict_has_key_re(to_native_dict, keys):\n            tpl = NativeType.dict_get_value_re(to_native_dict, keys)\n            tpl = Template(tpl, searchList=[convert_opts])\n            return str(tpl).rstrip()\n        return \"#pragma warning NO CONVERSION TO NATIVE FOR \" + self.name\n\n    def to_string(self, generator):\n        conversions = generator.config['conversions']\n        if conversions.has_key('native_types'):\n            native_types_dict = conversions['native_types']\n            if NativeType.dict_has_key_re(native_types_dict, [self.namespaced_name]):\n                return NativeType.dict_get_value_re(native_types_dict, [self.namespaced_name])\n\n        name = self.namespaced_name\n\n        to_native_dict = generator.config['conversions']['to_native']\n        from_native_dict = generator.config['conversions']['from_native']\n        use_typedef = False\n\n        typedef_name = self.canonical_type.name if None != self.canonical_type else None\n\n        if None != typedef_name:\n            if NativeType.dict_has_key_re(to_native_dict, [typedef_name]) or NativeType.dict_has_key_re(from_native_dict, [typedef_name]):\n                use_typedef = True\n\n        if use_typedef and self.canonical_type:\n            name = self.canonical_type.namespaced_name\n        return \"const \" + name if (self.is_pointer and self.is_const) else name\n\n    def get_whole_name(self, generator):\n        conversions = generator.config['conversions']\n        to_native_dict = conversions['to_native']\n        from_native_dict = conversions['from_native']\n        use_typedef = False\n        name = self.whole_name\n        typedef_name = self.canonical_type.name if None != self.canonical_type else None\n\n        if None != typedef_name:\n            if NativeType.dict_has_key_re(to_native_dict, [typedef_name]) or NativeType.dict_has_key_re(from_native_dict, [typedef_name]):\n                use_typedef = True\n\n        if use_typedef and self.canonical_type:\n            name = self.canonical_type.whole_name\n\n        to_replace = None\n        if conversions.has_key('native_types'):\n            native_types_dict = conversions['native_types']\n            to_replace = NativeType.dict_replace_value_re(native_types_dict, [name])\n\n        if to_replace:\n            name = to_replace\n\n        return name\n\n    def __str__(self):\n        return  self.canonical_type.whole_name if None != self.canonical_type else self.whole_name\n\nclass NativeField(object):\n    def __init__(self, cursor):\n        cursor = cursor.canonical\n        self.cursor = cursor\n        self.name = cursor.displayname\n        self.kind = cursor.type.kind\n        self.location = cursor.location\n        member_field_re = re.compile('m_(\\w+)')\n        match = member_field_re.match(self.name)\n        if match:\n            self.pretty_name = match.group(1)\n        else:\n            self.pretty_name = self.name\n\n# return True if found default argument.\ndef iterate_param_node(param_node, depth=1):\n    for node in param_node.get_children():\n        # print(\">\"*depth+\" \"+str(node.kind))\n        if node.kind in default_arg_type_arr:\n            return True\n\n        if iterate_param_node(node, depth + 1):\n            return True\n\n    return False\n\nclass NativeFunction(object):\n    def __init__(self, cursor):\n        self.cursor = cursor\n        self.func_name = cursor.spelling\n        self.signature_name = self.func_name\n        self.arguments = []\n        self.static = cursor.kind == cindex.CursorKind.CXX_METHOD and cursor.is_static_method()\n        self.implementations = []\n        self.is_constructor = False\n        self.not_supported = False\n        self.is_override = False\n\n        self.ret_type = NativeType.from_type(cursor.result_type)\n\n        # parse the arguments\n        # if self.func_name == \"spriteWithFile\":\n        #   pdb.set_trace()\n        for arg in cursor.type.argument_types():\n            nt = NativeType.from_type(arg)\n            self.arguments.append(nt)\n            # mark the function as not supported if at least one argument is not supported\n            if nt.not_supported:\n                self.not_supported = True\n\n        found_default_arg = False\n        index = -1\n\n        for arg_node in self.cursor.get_children():\n            if arg_node.kind == cindex.CursorKind.CXX_OVERRIDE_ATTR:\n                self.is_override = True\n            if arg_node.kind == cindex.CursorKind.PARM_DECL:\n                index += 1\n                if iterate_param_node(arg_node):\n                    found_default_arg = True\n                    break\n\n        self.min_args = index if found_default_arg else len(self.arguments)\n\n    def generate_code(self, current_class=None, generator=None):\n        gen = current_class.generator if current_class else generator\n        config = gen.config\n        tpl = Template(file=os.path.join(gen.target, \"templates\", \"function.h\"),\n                        searchList=[current_class, self])\n        gen.head_file.write(str(tpl))\n        if self.static:\n            if config['definitions'].has_key('sfunction'):\n                tpl = Template(config['definitions']['sfunction'],\n                                    searchList=[current_class, self])\n                self.signature_name = str(tpl)\n            tpl = Template(file=os.path.join(gen.target, \"templates\", \"sfunction.c\"),\n                            searchList=[current_class, self])\n        else:\n            if not self.is_constructor:\n                if config['definitions'].has_key('ifunction'):\n                    tpl = Template(config['definitions']['ifunction'],\n                                    searchList=[current_class, self])\n                    self.signature_name = str(tpl)\n            else:\n                if config['definitions'].has_key('constructor'):\n                    tpl = Template(config['definitions']['constructor'],\n                                    searchList=[current_class, self])\n                    self.signature_name = str(tpl)\n            tpl = Template(file=os.path.join(gen.target, \"templates\", \"ifunction.c\"),\n                            searchList=[current_class, self])\n\n        gen.impl_file.write(str(tpl))\n        apidoc_function_js = Template(file=os.path.join(gen.target,\n                                                        \"templates\",\n                                                        \"apidoc_function.js\"),\n                                      searchList=[current_class, self])\n        gen.doc_file.write(str(apidoc_function_js))\n\nclass NativeOverloadedFunction(object):\n    def __init__(self, func_array):\n        self.implementations = func_array\n        self.func_name = func_array[0].func_name\n        self.signature_name = self.func_name\n        self.min_args = 100\n        self.is_constructor = False\n        for m in func_array:\n            self.min_args = min(self.min_args, m.min_args)\n\n    def append(self, func):\n        self.min_args = min(self.min_args, func.min_args)\n        self.implementations.append(func)\n\n    def generate_code(self, current_class=None):\n        gen = current_class.generator\n        config = gen.config\n        static = self.implementations[0].static\n        tpl = Template(file=os.path.join(gen.target, \"templates\", \"function.h\"),\n                        searchList=[current_class, self])\n        gen.head_file.write(str(tpl))\n        if static:\n            if config['definitions'].has_key('sfunction'):\n                tpl = Template(config['definitions']['sfunction'],\n                                searchList=[current_class, self])\n                self.signature_name = str(tpl)\n            tpl = Template(file=os.path.join(gen.target, \"templates\", \"sfunction_overloaded.c\"),\n                            searchList=[current_class, self])\n        else:\n            if not self.is_constructor:\n                if config['definitions'].has_key('ifunction'):\n                    tpl = Template(config['definitions']['ifunction'],\n                                    searchList=[current_class, self])\n                    self.signature_name = str(tpl)\n            else:\n                if config['definitions'].has_key('constructor'):\n                    tpl = Template(config['definitions']['constructor'],\n                                    searchList=[current_class, self])\n                    self.signature_name = str(tpl)\n            tpl = Template(file=os.path.join(gen.target, \"templates\", \"ifunction_overloaded.c\"),\n                            searchList=[current_class, self])\n        gen.impl_file.write(str(tpl))\n\n\nclass NativeClass(object):\n    def __init__(self, cursor, generator):\n        # the cursor to the implementation\n        self.cursor = cursor\n        self.class_name = cursor.displayname\n        self.namespaced_class_name = self.class_name\n        self.parents = []\n        self.fields = []\n        self.methods = {}\n        self.static_methods = {}\n        self.generator = generator\n        self.is_abstract = self.class_name in generator.abstract_classes\n        self._current_visibility = cindex.AccessSpecifierKind.PRIVATE\n\n        registration_name = generator.get_class_or_rename_class(self.class_name)\n        if generator.remove_prefix:\n            self.target_class_name = re.sub('^' + generator.remove_prefix, '', registration_name)\n        else:\n            self.target_class_name = registration_name\n        self.namespaced_class_name = get_namespaced_name(cursor)\n        self.parse()\n\n    @property\n    def underlined_class_name(self):\n        return self.namespaced_class_name.replace(\"::\", \"_\")\n\n    def parse(self):\n        '''\n        parse the current cursor, getting all the necesary information\n        '''\n        self._deep_iterate(self.cursor)\n\n    def methods_clean(self):\n        '''\n        clean list of methods (without the ones that should be skipped)\n        '''\n        ret = []\n        for name, impl in self.methods.iteritems():\n            should_skip = False\n            if name == 'constructor':\n                should_skip = True\n            else:\n                if self.generator.should_skip(self.class_name, name):\n                    should_skip = True\n            if not should_skip:\n                ret.append({\"name\": name, \"impl\": impl})\n        return ret\n\n    def static_methods_clean(self):\n        '''\n        clean list of static methods (without the ones that should be skipped)\n        '''\n        ret = []\n        for name, impl in self.static_methods.iteritems():\n            should_skip = self.generator.should_skip(self.class_name, name)\n            if not should_skip:\n                ret.append({\"name\": name, \"impl\": impl})\n        return ret\n\n    def generate_code(self):\n        '''\n        actually generate the code. it uses the current target templates/rules in order to\n        generate the right code\n        '''\n        config = self.generator.config\n        prelude_h = Template(file=os.path.join(self.generator.target, \"templates\", \"prelude.h\"),\n                            searchList=[{\"current_class\": self}])\n        prelude_c = Template(file=os.path.join(self.generator.target, \"templates\", \"prelude.c\"),\n                            searchList=[{\"current_class\": self}])\n        apidoc_classhead_js = Template(file=os.path.join(self.generator.target,\n                                                         \"templates\",\n                                                         \"apidoc_classhead.js\"),\n                                       searchList=[{\"current_class\": self}])\n        self.generator.head_file.write(str(prelude_h))\n        self.generator.impl_file.write(str(prelude_c))\n        self.generator.doc_file.write(str(apidoc_classhead_js))\n        for m in self.methods_clean():\n            m['impl'].generate_code(self)\n        for m in self.static_methods_clean():\n            m['impl'].generate_code(self)\n        # generate register section\n        register = Template(file=os.path.join(self.generator.target, \"templates\", \"register.c\"),\n                            searchList=[{\"current_class\": self}])\n        apidoc_classfoot_js = Template(file=os.path.join(self.generator.target,\n                                                         \"templates\",\n                                                         \"apidoc_classfoot.js\"),\n                                       searchList=[{\"current_class\": self}])\n        self.generator.impl_file.write(str(register))\n        self.generator.doc_file.write(str(apidoc_classfoot_js))\n\n    def _deep_iterate(self, cursor=None, depth=0):\n        for node in cursor.get_children():\n            # print(\"%s%s - %s\" % (\"> \" * depth, node.displayname, node.kind))\n            if self._process_node(node):\n                self._deep_iterate(node, depth + 1)\n\n    @staticmethod\n    def _is_method_in_parents(current_class, method_name):\n        if len(current_class.parents) > 0:\n            if method_name in current_class.parents[0].methods:\n                return True\n            return NativeClass._is_method_in_parents(current_class.parents[0], method_name)\n        return False\n\n    def _process_node(self, cursor):\n        '''\n        process the node, depending on the type. If returns true, then it will perform a deep\n        iteration on its children. Otherwise it will continue with its siblings (if any)\n\n        @param: cursor the cursor to analyze\n        '''\n        if cursor.kind == cindex.CursorKind.CXX_BASE_SPECIFIER and not self.class_name in self.generator.classes_have_no_parents:\n            parent = cursor.get_definition()\n            if parent.displayname not in self.generator.base_classes_to_skip:\n                #if parent and self.generator.in_listed_classes(parent.displayname):\n                if not self.generator.generated_classes.has_key(parent.displayname):\n                    parent = NativeClass(parent, self.generator)\n                    self.generator.generated_classes[parent.class_name] = parent\n                else:\n                    parent = self.generator.generated_classes[parent.displayname]\n                self.parents.append(parent)\n        elif cursor.kind == cindex.CursorKind.FIELD_DECL:\n            self.fields.append(NativeField(cursor))\n        elif cursor.kind == cindex.CursorKind.CXX_ACCESS_SPEC_DECL:\n            self._current_visibility = cursor.get_access_specifier()\n        elif cursor.kind == cindex.CursorKind.CXX_METHOD and cursor.get_availability() != cindex.AvailabilityKind.DEPRECATED:\n            # skip if variadic\n            if self._current_visibility == cindex.AccessSpecifierKind.PUBLIC and not cursor.type.is_function_variadic():\n                m = NativeFunction(cursor)\n                registration_name = self.generator.should_rename_function(self.class_name, m.func_name) or m.func_name\n                # bail if the function is not supported (at least one arg not supported)\n                if m.not_supported:\n                    return False\n                if m.is_override:\n                    if NativeClass._is_method_in_parents(self, registration_name):\n                        return False\n\n                if m.static:\n                    if not self.static_methods.has_key(registration_name):\n                        self.static_methods[registration_name] = m\n                    else:\n                        previous_m = self.static_methods[registration_name]\n                        if isinstance(previous_m, NativeOverloadedFunction):\n                            previous_m.append(m)\n                        else:\n                            self.static_methods[registration_name] = NativeOverloadedFunction([m, previous_m])\n                else:\n                    if not self.methods.has_key(registration_name):\n                        self.methods[registration_name] = m\n                    else:\n                        previous_m = self.methods[registration_name]\n                        if isinstance(previous_m, NativeOverloadedFunction):\n                            previous_m.append(m)\n                        else:\n                            self.methods[registration_name] = NativeOverloadedFunction([m, previous_m])\n            return True\n\n        elif self._current_visibility == cindex.AccessSpecifierKind.PUBLIC and cursor.kind == cindex.CursorKind.CONSTRUCTOR and not self.is_abstract:\n            # Skip copy constructor\n            if cursor.displayname == self.class_name + \"(const \" + self.namespaced_class_name + \" &)\":\n                # print \"Skip copy constructor: \" + cursor.displayname\n                return True\n\n            m = NativeFunction(cursor)\n            m.is_constructor = True\n            if not self.methods.has_key('constructor'):\n                self.methods['constructor'] = m\n            else:\n                previous_m = self.methods['constructor']\n                if isinstance(previous_m, NativeOverloadedFunction):\n                    previous_m.append(m)\n                else:\n                    m = NativeOverloadedFunction([m, previous_m])\n                    m.is_constructor = True\n                    self.methods['constructor'] = m\n            return True\n        # else:\n            # print >> sys.stderr, \"unknown cursor: %s - %s\" % (cursor.kind, cursor.displayname)\n        return False\n\nclass Generator(object):\n    def __init__(self, opts):\n        self.index = cindex.Index.create()\n        self.outdir = opts['outdir']\n        self.prefix = opts['prefix']\n        self.headers = opts['headers'].split(' ')\n        self.classes = opts['classes']\n        self.classes_need_extend = opts['classes_need_extend']\n        self.classes_have_no_parents = opts['classes_have_no_parents'].split(' ')\n        self.base_classes_to_skip = opts['base_classes_to_skip'].split(' ')\n        self.abstract_classes = opts['abstract_classes'].split(' ')\n        self.clang_args = opts['clang_args']\n        self.target = opts['target']\n        self.remove_prefix = opts['remove_prefix']\n        self.target_ns = opts['target_ns']\n        self.cpp_ns = opts['cpp_ns']\n        self.impl_file = None\n        self.head_file = None\n        self.skip_classes = {}\n        self.generated_classes = {}\n        self.rename_functions = {}\n        self.rename_classes = {}\n        self.out_file = opts['out_file']\n        self.script_control_cpp = opts['script_control_cpp'] == \"yes\"\n\n        if opts['skip']:\n            list_of_skips = re.split(\",\\n?\", opts['skip'])\n            for skip in list_of_skips:\n                class_name, methods = skip.split(\"::\")\n                self.skip_classes[class_name] = []\n                match = re.match(\"\\[([^]]+)\\]\", methods)\n                if match:\n                    self.skip_classes[class_name] = match.group(1).split(\" \")\n                else:\n                    raise Exception(\"invalid list of skip methods\")\n        if opts['rename_functions']:\n            list_of_function_renames = re.split(\",\\n?\", opts['rename_functions'])\n            for rename in list_of_function_renames:\n                class_name, methods = rename.split(\"::\")\n                self.rename_functions[class_name] = {}\n                match = re.match(\"\\[([^]]+)\\]\", methods)\n                if match:\n                    list_of_methods = match.group(1).split(\" \")\n                    for pair in list_of_methods:\n                        k, v = pair.split(\"=\")\n                        self.rename_functions[class_name][k] = v\n                else:\n                    raise Exception(\"invalid list of rename methods\")\n\n        if opts['rename_classes']:\n            list_of_class_renames = re.split(\",\\n?\", opts['rename_classes'])\n            for rename in list_of_class_renames:\n                class_name, renamed_class_name = rename.split(\"::\")\n                self.rename_classes[class_name] = renamed_class_name\n\n\n    def should_rename_function(self, class_name, method_name):\n        if self.rename_functions.has_key(class_name) and self.rename_functions[class_name].has_key(method_name):\n            # print >> sys.stderr, \"will rename %s to %s\" % (method_name, self.rename_functions[class_name][method_name])\n            return self.rename_functions[class_name][method_name]\n        return None\n\n    def get_class_or_rename_class(self, class_name):\n        if self.rename_classes.has_key(class_name):\n            # print >> sys.stderr, \"will rename %s to %s\" % (method_name, self.rename_functions[class_name][method_name])\n            return self.rename_classes[class_name]\n        return class_name\n\n    def should_skip(self, class_name, method_name, verbose=False):\n        if class_name == \"*\" and self.skip_classes.has_key(\"*\"):\n            for func in self.skip_classes[\"*\"]:\n                if re.match(func, method_name):\n                    return True\n        else:\n            for key in self.skip_classes.iterkeys():\n                if key == \"*\" or re.match(\"^\" + key + \"$\", class_name):\n                    if verbose:\n                        print \"%s in skip_classes\" % (class_name)\n                    if len(self.skip_classes[key]) == 1 and self.skip_classes[key][0] == \"*\":\n                        if verbose:\n                            print \"%s will be skipped completely\" % (class_name)\n                        return True\n                    if method_name != None:\n                        for func in self.skip_classes[key]:\n                            if re.match(func, method_name):\n                                if verbose:\n                                    print \"%s will skip method %s\" % (class_name, method_name)\n                                return True\n        if verbose:\n            print \"%s will be accepted (%s, %s)\" % (class_name, key, self.skip_classes[key])\n        return False\n\n    def in_listed_classes(self, class_name):\n        \"\"\"\n        returns True if the class is in the list of required classes and it's not in the skip list\n        \"\"\"\n        for key in self.classes:\n            md = re.match(\"^\" + key + \"$\", class_name)\n            if md and not self.should_skip(class_name, None):\n                return True\n        return False\n\n    def in_listed_extend_classed(self, class_name):\n        \"\"\"\n        returns True if the class is in the list of required classes that need to extend\n        \"\"\"\n        for key in self.classes_need_extend:\n            md = re.match(\"^\" + key + \"$\", class_name)\n            if md:\n                return True\n        return False\n\n    def sorted_classes(self):\n        '''\n        sorted classes in order of inheritance\n        '''\n        sorted_list = []\n        for class_name in self.generated_classes.iterkeys():\n            nclass = self.generated_classes[class_name]\n            sorted_list += self._sorted_parents(nclass)\n        # remove dupes from the list\n        no_dupes = []\n        [no_dupes.append(i) for i in sorted_list if not no_dupes.count(i)]\n        return no_dupes\n\n    def _sorted_parents(self, nclass):\n        '''\n        returns the sorted list of parents for a native class\n        '''\n        sorted_parents = []\n        for p in nclass.parents:\n            if p.class_name in self.generated_classes.keys():\n                sorted_parents += self._sorted_parents(p)\n        if nclass.class_name in self.generated_classes.keys():\n            sorted_parents.append(nclass.class_name)\n        return sorted_parents\n\n    def generate_code(self):\n        # must read the yaml file first\n        stream = file(os.path.join(self.target, \"conversions.yaml\"), \"r\")\n        data = yaml.load(stream)\n        self.config = data\n        implfilepath = os.path.join(self.outdir, self.out_file + \".cpp\")\n        headfilepath = os.path.join(self.outdir, self.out_file + \".hpp\")\n        docfilepath = os.path.join(self.outdir, self.out_file + \"_api.js\")\n        self.impl_file = open(implfilepath, \"w+\")\n        self.head_file = open(headfilepath, \"w+\")\n        self.doc_file = open(docfilepath, \"w+\")\n\n        layout_h = Template(file=os.path.join(self.target, \"templates\", \"layout_head.h\"),\n                            searchList=[self])\n        layout_c = Template(file=os.path.join(self.target, \"templates\", \"layout_head.c\"),\n                            searchList=[self])\n        apidoc_ns_js = Template(file=os.path.join(self.target, \"templates\", \"apidoc_ns.js\"),\n                                searchList=[self])\n        self.head_file.write(str(layout_h))\n        self.impl_file.write(str(layout_c))\n        self.doc_file.write(str(apidoc_ns_js))\n\n        self._parse_headers()\n\n        layout_h = Template(file=os.path.join(self.target, \"templates\", \"layout_foot.h\"),\n                            searchList=[self])\n        layout_c = Template(file=os.path.join(self.target, \"templates\", \"layout_foot.c\"),\n                            searchList=[self])\n        self.head_file.write(str(layout_h))\n        self.impl_file.write(str(layout_c))\n\n        self.impl_file.close()\n        self.head_file.close()\n        self.doc_file.close()\n\n    def _pretty_print(self, diagnostics):\n        print(\"====\\nErrors in parsing headers:\")\n        severities=['Ignored', 'Note', 'Warning', 'Error', 'Fatal']\n        for idx, d in enumerate(diagnostics):\n            print \"%s. <severity = %s,\\n    location = %r,\\n    details = %r>\" % (\n                idx+1, severities[d.severity], d.location, d.spelling)\n        print(\"====\\n\")\n        \n    def _parse_headers(self):\n        for header in self.headers:\n            tu = self.index.parse(header, self.clang_args)\n            if len(tu.diagnostics) > 0:\n                self._pretty_print(tu.diagnostics)\n                is_fatal = False\n                for d in tu.diagnostics:\n                    if d.severity >= cindex.Diagnostic.Error:\n                        is_fatal = True\n                if is_fatal:\n                    print(\"*** Found errors - can not continue\")\n                    raise Exception(\"Fatal error in parsing headers\")\n            self._deep_iterate(tu.cursor)\n\n    def _deep_iterate(self, cursor, depth=0):\n        # get the canonical type\n        if cursor.kind == cindex.CursorKind.CLASS_DECL:\n            if cursor == cursor.type.get_declaration() and len(cursor.get_children_array()) > 0:\n                is_targeted_class = True\n                if self.cpp_ns:\n                    is_targeted_class = False\n                    namespaced_name = get_namespaced_name(cursor)\n                    for ns in self.cpp_ns:\n                        if namespaced_name.startswith(ns):\n                            is_targeted_class = True\n                            break\n\n                if is_targeted_class and self.in_listed_classes(cursor.displayname):\n                    if not self.generated_classes.has_key(cursor.displayname):\n                        nclass = NativeClass(cursor, self)\n                        nclass.generate_code()\n                        self.generated_classes[cursor.displayname] = nclass\n                    return\n\n        for node in cursor.get_children():\n            # print(\"%s %s - %s\" % (\">\" * depth, node.displayname, node.kind))\n            self._deep_iterate(node, depth + 1)\n    def scriptname_from_native(self, namespace_class_name):\n        script_ns_dict = self.config['conversions']['ns_map']\n        for (k, v) in script_ns_dict.items():\n            if namespace_class_name.find(k) >= 0:\n                return namespace_class_name.replace(\"*\",\"\").replace(\"const \", \"\").replace(k,v)\n        if namespace_class_name.find(\"::\") >= 0:\n            if namespace_class_name.find(\"std::\") == 0:\n                return namespace_class_name\n            else:\n                raise Exception(\"The namespace (%s) conversion wasn't set in 'ns_map' section of the conversions.yaml\" % namespace_class_name)\n        else:\n           return namespace_class_name\ndef main():\n    from optparse import OptionParser\n\n    parser = OptionParser(\"usage: %prog [options] {configfile}\")\n    parser.add_option(\"-s\", action=\"store\", type=\"string\", dest=\"section\",\n                        help=\"sets a specific section to be converted\")\n    parser.add_option(\"-t\", action=\"store\", type=\"string\", dest=\"target\",\n                        help=\"specifies the target vm. Will search for TARGET.yaml\")\n    parser.add_option(\"-o\", action=\"store\", type=\"string\", dest=\"outdir\",\n                        help=\"specifies the output directory for generated C++ code\")\n    parser.add_option(\"-n\", action=\"store\", type=\"string\", dest=\"out_file\",\n                        help=\"specifcies the name of the output file, defaults to the prefix in the .ini file\")\n\n    (opts, args) = parser.parse_args()\n\n    # script directory\n    workingdir = os.path.dirname(inspect.getfile(inspect.currentframe()))\n\n    if len(args) == 0:\n        parser.error('invalid number of arguments')\n\n    userconfig = ConfigParser.SafeConfigParser()\n    userconfig.read('userconf.ini')\n    print 'Using userconfig \\n ', userconfig.items('DEFAULT')\n\n    config = ConfigParser.SafeConfigParser()\n    config.read(args[0])\n\n    if (0 == len(config.sections())):\n        raise Exception(\"No sections defined in config file\")\n\n    sections = []\n    if opts.section:\n        if (opts.section in config.sections()):\n            sections = []\n            sections.append(opts.section)\n        else:\n            raise Exception(\"Section not found in config file\")\n    else:\n        print(\"processing all sections\")\n        sections = config.sections()\n\n    # find available targets\n    targetdir = os.path.join(workingdir, \"targets\")\n    targets = []\n    if (os.path.isdir(targetdir)):\n        targets = [entry for entry in os.listdir(targetdir)\n                    if (os.path.isdir(os.path.join(targetdir, entry)))]\n    if 0 == len(targets):\n        raise Exception(\"No targets defined\")\n\n    if opts.target:\n        if (opts.target in targets):\n            targets = []\n            targets.append(opts.target)\n\n    if opts.outdir:\n        outdir = opts.outdir\n    else:\n        outdir = os.path.join(workingdir, \"gen\")\n    if not os.path.exists(outdir):\n        os.makedirs(outdir)\n\n    for t in targets:\n        # Fix for hidden '.svn', '.cvs' and '.git' etc. folders - these must be ignored or otherwise they will be interpreted as a target.\n        if t == \".svn\" or t == \".cvs\" or t == \".git\" or t == \".gitignore\":\n            continue\n\n        print \"\\n.... Generating bindings for target\", t\n        for s in sections:\n            print \"\\n.... .... Processing section\", s, \"\\n\"\n            gen_opts = {\n                'prefix': config.get(s, 'prefix'),\n                'headers':    (config.get(s, 'headers'        , 0, dict(userconfig.items('DEFAULT')))),\n                'classes': config.get(s, 'classes').split(' '),\n                'classes_need_extend': config.get(s, 'classes_need_extend').split(' ') if config.has_option(s, 'classes_need_extend') else [],\n                'clang_args': (config.get(s, 'extra_arguments', 0, dict(userconfig.items('DEFAULT'))) or \"\").split(\" \"),\n                'target': os.path.join(workingdir, \"targets\", t),\n                'outdir': outdir,\n                'remove_prefix': config.get(s, 'remove_prefix'),\n                'target_ns': config.get(s, 'target_namespace'),\n                'cpp_ns': config.get(s, 'cpp_namespace').split(' ') if config.has_option(s, 'cpp_namespace') else None,\n                'classes_have_no_parents': config.get(s, 'classes_have_no_parents'),\n                'base_classes_to_skip': config.get(s, 'base_classes_to_skip'),\n                'abstract_classes': config.get(s, 'abstract_classes'),\n                'skip': config.get(s, 'skip'),\n                'rename_functions': config.get(s, 'rename_functions'),\n                'rename_classes': config.get(s, 'rename_classes'),\n                'out_file': opts.out_file or config.get(s, 'prefix'),\n                'script_control_cpp': config.get(s, 'script_control_cpp') if config.has_option(s, 'script_control_cpp') else 'no'\n                }\n            generator = Generator(gen_opts)\n            generator.generate_code()\n\nif __name__ == '__main__':\n    try:\n        main()\n    except Exception as e:\n        traceback.print_exc()\n        sys.exit(1)\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/libclang/VERSION.txt",
    "content": "3.4\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/conversions.yaml",
    "content": "definitions:\n  # the names of the functions - we use this to generate the code and to register the functions in\n  # the javascript class\n  ifunction: \"lua_${generator.prefix}_${class_name}_${func_name}\"\n  sfunction: \"lua_${generator.prefix}_${class_name}_${func_name}\"\n  constructor: \"lua_${generator.prefix}_${class_name}_constructor\"\nconversions:\n  # some times you want to use a special native type when converting from spidermonkey to native\n  # the most common case would be from JS-boolean to bool. Using \"bool\" will fail here since we\n  # pass the address to the conversion method, and a JSBool is defined as an integer in spidermonkey\n  native_types:\n    float: \"double\"\n    short: \"int32_t\"\n    \"unsigned char\": \"uint16_t\"\n    \"char\": \"int32_t\"\n    \"@std::vector<std::basic_string.*>.>.>\": \"std::vector<std::string>\"\n    \"@std::vector<int.*>.>\": \"std::vector<int>\"\n    \"@cocos2d::Map<std::basic_string.*,\": \"cocos2d::Map<std::string,\"\n  ns_map:\n    \"cocos2d::extension::\": \"cc.\"\n    \"cocos2d::gui::\": \"ccui.\"\n    \"cocos2d::\": \"cc.\"\n    \"spine::\": \"sp.\"\n    \"cocostudio::\": \"ccs.\"\n    \"cocosbuilder::\": \"cc.\"\n    \"CocosDenshion::\": \"cc.\"\n\n  to_native:\n    # lua to native\n    int: \"ok &= luaval_to_int32(tolua_S, ${arg_idx},(int *)&${out_value})\"\n    \"unsigned int\": \"ok &= luaval_to_uint32(tolua_S, ${arg_idx},&${out_value})\"\n    \"unsigned char\": \"ok &= luaval_to_uint16(tolua_S, ${arg_idx},&${out_value})\"\n    short: \"ok &= luaval_to_int32(tolua_S, ${arg_idx},&${out_value})\"\n    \"unsigned short\": \"ok &= luaval_to_ushort(tolua_S, ${arg_idx}, &${out_value})\"\n    char: \"ok &= luaval_to_int32(tolua_S, ${arg_idx},&${out_value})\"\n    bool: \"ok &= luaval_to_boolean(tolua_S, ${arg_idx},&${out_value})\" \n    float: \"ok &= luaval_to_number(tolua_S, ${arg_idx},&${out_value})\"\n    double: \"ok &= luaval_to_number(tolua_S, ${arg_idx},&${out_value})\"\n    long: \"ok &= luaval_to_long(tolua_S, ${arg_idx}, &${out_value})\"\n    ssize_t: \"ok &= luaval_to_ssize(tolua_S, ${arg_idx}, &${out_value})\"\n    \"unsigned long\": \"ok &= luaval_to_ulong(tolua_S, ${arg_idx}, &${out_value})\"\n    \"long long\": \"ok &= luaval_to_long_long(tolua_S, ${arg_idx},&${out_value})\"\n    \"std::string\": \"ok &= luaval_to_std_string(tolua_S, ${arg_idx},&${out_value})\"\n    \"String*\": \"std::string ${out_value}_tmp; ok &= luaval_to_std_string(tolua_S, ${arg_idx}, &${out_value}_tmp); ${out_value} = cocos2d::String::create(${out_value}_tmp)\"\n    \"char*\": \"std::string ${out_value}_tmp; ok &= luaval_to_std_string(tolua_S, ${arg_idx}, &${out_value}_tmp); ${out_value} = ${out_value}_tmp.c_str()\"\n    \"Point\": \"ok &= luaval_to_point(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Rect\": \"ok &= luaval_to_rect(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Size\": \"ok &= luaval_to_size(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Color4B\": \"ok &=luaval_to_color4b(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Color4F\": \"ok &=luaval_to_color4f(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Color3B\": \"ok &= luaval_to_color3b(tolua_S, ${arg_idx}, &${out_value})\"\n    \"PhysicsMaterial\": \"ok &= luaval_to_physics_material(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Array*\": \"ok &= luaval_to_array(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Dictionary*\": \"ok &= luaval_to_dictionary(tolua_S, ${arg_idx}, &${out_value})\"\n    \"AffineTransform\": \"ok &= luaval_to_affinetransform(tolua_S, ${arg_idx}, &${out_value})\"\n    \"FontDefinition\":  \"ok &= luaval_to_fontdefinition(tolua_S, ${arg_idx}, &${out_value})\"\n    \"@Vector<.*>\": \"ok &= luaval_to_ccvector(tolua_S, ${arg_idx}, &${out_value})\"\n    \"@Map<std::basic_string.*>\": \"ok &= luaval_to_ccmap_string_key(tolua_S, ${arg_idx}, &${out_value})\"\n    \"Value\": \"ok &= luaval_to_ccvalue(tolua_S, ${arg_idx}, &${out_value})\"\n    \"ValueMap\": \"ok &= luaval_to_ccvaluemap(tolua_S, ${arg_idx}, &${out_value})\"\n    \"ValueMapIntKey\": \"ok &= luaval_to_ccvaluemapintkey(tolua_S, ${arg_idx}, &${out_value})\"\n    \"ValueVector\": \"ok &= luaval_to_ccvaluevector(tolua_S, ${arg_idx}, &${out_value})\"\n    \"@vector<std::basic_string.*>\": \"ok &= luaval_to_std_vector_string(tolua_S, ${arg_idx}, &${out_value})\"\n    \"@vector<int.*>\": \"ok &= luaval_to_std_vector_int(tolua_S, ${arg_idx}, &${out_value})\"\n\n    object: |\n      do {\n      ${($level + 2) * '\\t'}if (!luaval_is_usertype(tolua_S,${arg_idx},\"${scriptname}\",0)){\n      ${($level + 3) * '\\t'}ok = false;\n      ${($level + 3) * '\\t'}break;\n      ${($level + 2) * '\\t'}}\n      ${($level + 2) * '\\t'}if (ok){\n      ${($level + 3) * '\\t'}${out_value} = (${arg})tolua_tousertype(tolua_S,${arg_idx},0);\n      ${($level + 3) * '\\t'}if (nullptr == ${out_value}){\n      ${($level + 4) * '\\t'}LUA_PRECONDITION( ${out_value}, \"Invalid Native Object\");\n      ${($level + 1) * '\\t'}}}} while (0)\n  from_native:\n    # native to lua\n    int: \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    \"unsigned int\": \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    \"unsigned short\": \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    \"unsigned char\": \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    short: \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    char: \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    \"long long\": \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    \"std::string\": \"tolua_pushcppstring(tolua_S,${in_value})\"\n    \"char*\": \"tolua_pushstring(tolua_S,(const char*)${in_value})\"\n    \"String*\": \"tolua_pushstring(tolua_S, ${in_value}->getCString())\"\n    bool: \"tolua_pushboolean(tolua_S,(bool)${in_value})\"\n    float: \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    double: \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    long: \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    ssize_t: \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    \"unsigned long\": \"tolua_pushnumber(tolua_S,(lua_Number)${in_value})\"\n    \"Point\": \"point_to_luaval(tolua_S, ${in_value})\"\n    \"Rect\": \"rect_to_luaval(tolua_S, ${in_value})\"\n    \"Size\": \"size_to_luaval(tolua_S, ${in_value})\"\n    \"Color4B\": \"color4b_to_luaval(tolua_S, ${in_value})\"\n    \"Color4F\": \"color4f_to_luaval(tolua_S, ${in_value})\"\n    \"Color3B\": \"color3b_to_luaval(tolua_S, ${in_value})\"\n    \"PhysicsMaterial\": \"physics_material_to_luaval(tolua_S, ${in_value})\"\n    \"PhysicsContactData*\": \"physics_contactdata_to_luaval(tolua_S, ${in_value})\"\n    \"PhysicsRayCastInfo\": \"physics_raycastinfo_to_luaval(tolua_S, ${in_value})\"\n    \"Array*\": \"array_to_luaval(tolua_S,${in_value})\"\n    \"Dictionary*\": \"dictionary_to_luaval(tolua_S, ${in_value})\"\n    \"AffineTransform\": \"affinetransform_to_luaval(tolua_S, ${in_value})\"\n    \"FontDefinition\": \"fontdefinition_to_luaval(tolua_S, ${in_value})\"\n    \"@Vector<.*>\": \"ccvector_to_luaval(tolua_S, ${in_value})\"\n    \"@Map<std::basic_string.*>\": \"ccmap_string_key_to_luaval(tolua_S, ${in_value})\"\n    \"Value\": \"ccvalue_to_luaval(tolua_S, ${in_value})\"\n    \"ValueMap\": \"ccvaluemap_to_luaval(tolua_S, ${in_value})\"\n    \"ValueMapIntKey\": \"ccvaluemapintkey_to_luaval(tolua_S, ${in_value})\"\n    \"ValueVector\": \"ccvaluevector_to_luaval(tolua_S, ${in_value})\"\n    \"@vector<std::basic_string.*>\": \"ccvector_std_string_to_luaval(tolua_S, ${in_value})\"\n    \"@vector<int.*>\": \"ccvector_int_to_luaval(tolua_S, ${in_value})\"\n    object:  |\n      do {\n      ${($level + 1) * '\\t'}if (NULL != ${in_value}){\n      ${($level + 2) * '\\t'}std::string hashName = typeid(*${in_value}).name();\n      ${($level + 2) * '\\t'}auto iter = g_luaType.find(hashName);\n      ${($level + 2) * '\\t'}std::string className = \"\";\n      ${($level + 2) * '\\t'}if(iter != g_luaType.end()){\n      ${($level + 3) * '\\t'}className = iter->second.c_str();\n      ${($level + 2) * '\\t'}} else {\n      ${($level + 3) * '\\t'}className = \"${scriptname}\";\n      ${($level + 2) * '\\t'}}\n      ${($level + 2) * '\\t'}cocos2d::Object *dynObject = dynamic_cast<cocos2d::Object *>((${ntype.replace(\"const \", \"\")})${in_value});\n      ${($level + 2) * '\\t'}if (NULL != dynObject) {\n      ${($level + 3) * '\\t'}int ID = ${in_value} ? (int)(dynObject->_ID) : -1;\n      ${($level + 3) * '\\t'}int* luaID = ${in_value} ? &(dynObject->_luaID) : NULL;\n      ${($level + 3) * '\\t'}toluafix_pushusertype_ccobject(tolua_S,ID, luaID, (void*)${in_value},className.c_str());\n      ${($level + 2) * '\\t'}} else {\n      ${($level + 3) * '\\t'} tolua_pushusertype(tolua_S,(void*)${in_value},className.c_str());\n      ${($level + 1) * '\\t'}}} else {\n      ${($level + 2) * '\\t'}lua_pushnil(tolua_S);\n      ${($level + 1) * '\\t'}}\n      ${($level) * '\\t'}} while (0)\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/apidoc_classfoot.js",
    "content": "};\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/apidoc_classhead.js",
    "content": "#set generator = $current_class.generator\n\n/**\n * @class ${current_class.class_name}\n */\n#if $generator.target_ns\n${generator.target_ns}.${current_class.target_class_name} = {\n#else\n${current_class.target_class_name} = {\n#end if\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/apidoc_function.js",
    "content": "/**\n * @method ${func_name}\n#if $is_constructor\n * @constructor\n#end if\n#if str($ret_type) != \"void\"\n * @return A value converted from C/C++ \"${ret_type}\"\n#end if\n#if $min_args > 0\n\t#for $arg in $arguments\n * @param {$arg}\n\t#end for\n#end if\n */\n${func_name} : function () {},\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/apidoc_ns.js",
    "content": "#if $target_ns\n#if $prefix\n/**\n * @module ${prefix}\n */\n#else\n/**\n * @module ${target_ns}\n */\n#end if\nvar ${target_ns} = ${target_ns} || {};\n#end if\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/function.h",
    "content": "\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/ifunction.c",
    "content": "## ===== instance function implementation template\nint ${signature_name}(lua_State* tolua_S)\n{\n    int argc = 0;\n    ${namespaced_class_name}* cobj = nullptr;\n    bool ok  = true;\n\n\\#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\\#endif\n\n\n#if not $is_constructor\n\\#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"${generator.scriptname_from_native($namespaced_class_name)}\",0,&tolua_err)) goto tolua_lerror;\n\\#endif\n\n    cobj = (${namespaced_class_name}*)tolua_tousertype(tolua_S,1,0);\n\n\\#if COCOS2D_DEBUG >= 1\n    if (!cobj) \n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function '${signature_name}'\", NULL);\n        return 0;\n    }\n\\#endif\n#end if\n\n    argc = lua_gettop(tolua_S)-1;\n#if len($arguments) >= $min_args\n    #set arg_count = len($arguments)\n    #set arg_idx = $min_args\n    #while $arg_idx <= $arg_count\n    if (argc == ${arg_idx}) \n    {\n        #set $count = 0\n        #while $count < $arg_idx\n            #set $arg = $arguments[$count]\n        ${arg.to_string($generator)} arg${count};\n            #set $count = $count + 1\n        #end while\n        #set $count = 0\n        #set arg_list = \"\"\n        #set arg_array = []\n        #while $count < $arg_idx\n            #set $arg = $arguments[$count]\n\n        ${arg.to_native({\"generator\": $generator,\n                                      \"in_value\": \"argv[\" + str(count) + \"]\",\n                                      \"out_value\": \"arg\" + str(count),\n                                      \"arg_idx\": $count+2,\n                                      \"class_name\": $class_name,\n                                      \"level\": 2,\n                                      \"arg\":$arg,\n                                      \"ntype\": $arg.namespaced_name.replace(\"*\", \"\"),\n                                      \"scriptname\": $generator.scriptname_from_native($arg.namespaced_name)})};\n            #set $arg_array += [\"arg\"+str(count)]\n            #set $count = $count + 1\n        #end while\n        #if $arg_idx >= 0\n        if(!ok)\n            return 0;\n        #end if\n        #set $arg_list = \", \".join($arg_array)\n        #if $is_constructor\n        cobj = new ${namespaced_class_name}($arg_list);\n#if not $generator.script_control_cpp\n        cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n        if (nullptr != dynObject) \n        {\n            dynObject->autorelease();\n            int ID =  (int)dynObject->_ID ;\n            int* luaID =  &dynObject->_luaID ;\n            toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"${generator.scriptname_from_native($namespaced_class_name)}\");\n        }\n        else\n        {\n            tolua_pushusertype(tolua_S,(void*)cobj,\"${generator.scriptname_from_native($namespaced_class_name)}\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n        }\n#else\n        tolua_pushusertype(tolua_S,(void*)cobj,\"${generator.scriptname_from_native($namespaced_class_name)}\");\n        tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n#end if\n        return 1;\n        #else\n            #if $ret_type.name != \"void\"\n                #if $ret_type.is_enum\n        int ret = (int)cobj->${func_name}($arg_list);\n                #else\n        ${ret_type.get_whole_name($generator)} ret = cobj->${func_name}($arg_list);\n                #end if\n        ${ret_type.from_native({\"generator\": $generator,\n                                \"in_value\": \"ret\",\n                                \"out_value\": \"ret\",\n                                \"type_name\": $ret_type.namespaced_name.replace(\"*\", \"\"),\n                                \"ntype\": $ret_type.get_whole_name($generator),\n                                \"class_name\": $class_name,\n                                \"level\": 2,\n                                \"scriptname\": $generator.scriptname_from_native($ret_type.namespaced_name)})};\n        return 1;\n                #else\n        cobj->${func_name}($arg_list);\n        return 0;\n                #end if\n        #end if         \n    }\n        #set $arg_idx = $arg_idx + 1\n    #end while\n#end if\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"${func_name}\",argc, ${min_args});\n    return 0;\n\n\\#if COCOS2D_DEBUG >= 1\n#if not $is_constructor\n    tolua_lerror:\n#end if\n    tolua_error(tolua_S,\"#ferror in function '${signature_name}'.\",&tolua_err);\n\\#endif\n\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/ifunction_overloaded.c",
    "content": "## ===== instance function implementation template - for overloaded functions\nint ${signature_name}(lua_State* tolua_S)\n{\n    int argc = 0;\n    ${namespaced_class_name}* cobj = NULL;\n    bool ok  = true;\n\\#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\\#endif\n\n#if not $is_constructor\n\\#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertype(tolua_S,1,\"${generator.scriptname_from_native($namespaced_class_name)}\",0,&tolua_err)) goto tolua_lerror;\n\\#endif\n    cobj = (${namespaced_class_name}*)tolua_tousertype(tolua_S,1,0);\n\\#if COCOS2D_DEBUG >= 1\n    if (!cobj)\n    {\n        tolua_error(tolua_S,\"invalid 'cobj' in function '${signature_name}'\", NULL);\n        return 0;\n    }\n\\#endif\n#end if\n    argc = lua_gettop(tolua_S)-1;\n#for func in $implementations\n#if len($func.arguments) >= $func.min_args\n    #set arg_count = len($func.arguments)\n    #set arg_idx = $func.min_args\n    #while $arg_idx <= $arg_count\n    #set arg_list = \"\"\n    #set arg_array = []\n    do{\n        #if $func.min_args >= 0\n        if (argc == ${arg_idx}) {\n            #set $count = 0\n            #while $count < $arg_idx\n            #set $arg = $func.arguments[$count]\n            ${arg.to_string($generator)} arg${count};\n            ${arg.to_native({\"generator\": $generator,\n                             \"in_value\": \"argv[\" + str(count) + \"]\",\n                             \"out_value\": \"arg\" + str(count),\n                             \"arg_idx\": $count+2,\n                             \"class_name\": $class_name,\n                             \"level\": 2,\n                             \"arg\":$arg,\n                             \"ntype\": $arg.namespaced_name.replace(\"*\", \"\"),\n                             \"scriptname\": $generator.scriptname_from_native($arg.namespaced_name)})};\n                #set $arg_array += [\"arg\"+str(count)]\n                #set $count = $count + 1\n\n            #if $arg_idx >= 0 \n            if (!ok) { break; }\n            #end if\n            #end while\n            #set $arg_list = \", \".join($arg_array)\n        #end if\n        #if $is_constructor\n            cobj = new ${namespaced_class_name}($arg_list);\n#if not $generator.script_control_cpp\n            cocos2d::Object* dynObject = dynamic_cast<cocos2d::Object *>(cobj);\n            if (NULL != dynObject) \n            {\n                dynObject->autorelease();\n                int ID =  (int)dynObject->_ID ;\n                int* luaID =  &dynObject->_luaID ;\n                toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,\"${generator.scriptname_from_native($namespaced_class_name)}\");\n            }\n            else\n            {\n                tolua_pushusertype(tolua_S,(void*)cobj,\"${generator.scriptname_from_native($namespaced_class_name)}\");\n                tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n            }\n#else\n            tolua_pushusertype(tolua_S,(void*)cobj,\"${generator.scriptname_from_native($namespaced_class_name)}\");\n            tolua_register_gc(tolua_S,lua_gettop(tolua_S));\n#end if\n            return 1;\n        #else\n            #if $func.ret_type.name != \"void\"\n                #if $func.ret_type.is_enum\n            int ret = (int)cobj->${func.func_name}($arg_list);\n                #else\n            ${func.ret_type.get_whole_name($generator)} ret = cobj->${func.func_name}($arg_list);\n                #end if\n            ${func.ret_type.from_native({\"generator\": $generator,\n                                                      \"in_value\": \"ret\",\n                                                      \"out_value\": \"ret\",\n                                                      \"type_name\": $func.ret_type.namespaced_name.replace(\"*\", \"\"),\n                                                      \"ntype\": $func.ret_type.get_whole_name($generator),\n                                                      \"class_name\": $class_name,\n                                                      \"level\": 2,\n                                                      \"scriptname\": $generator.scriptname_from_native($func.ret_type.namespaced_name)})};\n            return 1;\n            #else\n            cobj->${func.func_name}($arg_list);\n            return 0;\n            #end if\n        #end if\n        }\n    }while(0);\n    #set $arg_idx = $arg_idx + 1\n    ok  = true;\n    #end while\n#end if\n#end for\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d \\n\", \"${func.func_name}\",argc, ${func.min_args});\n    return 0;\n\n\\#if COCOS2D_DEBUG >= 1\n#if not $is_constructor\n    tolua_lerror:\n#end if\n    tolua_error(tolua_S,\"#ferror in function '${signature_name}'.\",&tolua_err);\n\\#endif\n\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/lambda.c",
    "content": "do {\n\t// Lambda binding for lua is not supported.\n\tassert(false);\n} while(0)\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/layout_foot.c",
    "content": "TOLUA_API int register_all_${prefix}(lua_State* tolua_S)\n{\n\ttolua_open(tolua_S);\n\t\n\t#if $target_ns\n\ttolua_module(tolua_S,\"${target_ns}\",0);\n\ttolua_beginmodule(tolua_S,\"${target_ns}\");\n\t#else\n\ttolua_module(tolua_S,NULL,0);\n\ttolua_beginmodule(tolua_S,NULL);\n\t#end if\n\n\t#for jsclass in $sorted_classes\n\t#if $in_listed_classes(jsclass)\n\tlua_register_${prefix}_${jsclass}(tolua_S);\n\t#end if\n\t#end for\n\n\ttolua_endmodule(tolua_S);\n\treturn 1;\n}\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/layout_foot.h",
    "content": "\n\\#endif // __${prefix}_h__\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/layout_head.c",
    "content": "\\#include \"${out_file}.hpp\"\n#for header in $headers\n\\#include \"${os.path.basename(header)}\"\n#end for\n\\#include \"tolua_fix.h\"\n\\#include \"LuaBasicConversions.h\"\n\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/layout_head.h",
    "content": "\\#ifndef __${prefix}_h__\n\\#define __${prefix}_h__\n\n\\#ifdef __cplusplus\nextern \"C\" {\n\\#endif\n\\#include \"tolua++.h\"\n\\#ifdef __cplusplus\n}\n\\#endif\n\nint register_all_${prefix}(lua_State* tolua_S);"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/prelude.c",
    "content": "\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/prelude.h",
    "content": "\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/register.c",
    "content": "#set has_constructor = False\n#if $current_class.methods.has_key('constructor')\n#set has_constructor = True\n${current_class.methods.constructor.generate_code($current_class)}\n#end if\n#\n#set generator = $current_class.generator\n#set methods = $current_class.methods_clean()\n#set st_methods = $current_class.static_methods_clean()\n#\nstatic int lua_${generator.prefix}_${current_class.class_name}_finalize(lua_State* tolua_S)\n{\n    printf(\"luabindings: finalizing LUA object (${current_class.class_name})\");\n#if $generator.script_control_cpp\n\\#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n    if (\n    !tolua_isusertype(tolua_S,1,\"${current_class.class_name}\",0,&tolua_err) ||\n    !tolua_isnoobj(tolua_S,2,&tolua_err)\n    )\n        goto tolua_lerror;\n    else\n\\#endif\n    {\n        ${current_class.namespaced_class_name}* self = (${current_class.namespaced_class_name}*)  tolua_tousertype(tolua_S,1,0);\n\\#if COCOS2D_DEBUG >= 1\n        if (!self) tolua_error(tolua_S,\"invalid 'self' in function 'delete'\", NULL);\n\\#endif\n        delete self;\n    }\n    return 0;\n\\#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function 'delete'.\",&tolua_err);\n    return 0;\n\\#endif\n#end if\n    return 0;\n}\n\nint lua_register_${generator.prefix}_${current_class.class_name}(lua_State* tolua_S)\n{\n    tolua_usertype(tolua_S,\"${generator.scriptname_from_native($current_class.namespaced_class_name)}\");\n    #if len($current_class.parents) > 0\n    tolua_cclass(tolua_S,\"${current_class.class_name}\",\"${generator.scriptname_from_native($current_class.namespaced_class_name)}\",\"${generator.scriptname_from_native($current_class.parents[0].namespaced_class_name)}\",NULL);\n    #else\n    tolua_cclass(tolua_S,\"${current_class.class_name}\",\"${generator.scriptname_from_native($current_class.namespaced_class_name)}\",\"\",NULL);\n    #end if\n\n    tolua_beginmodule(tolua_S,\"${current_class.class_name}\");\n    #if len(methods) > 0\n        #for m in methods\n        #set fn = m['impl']\n        tolua_function(tolua_S,\"${m['name']}\",${fn.signature_name});\n        #end for\n#if has_constructor\n        tolua_function(tolua_S,\"new\",lua_${generator.prefix}_${current_class.class_name}_constructor);\n#end if\n        #end if\n    #if len(st_methods) > 0\n        #for m in st_methods\n        #set fn = m['impl']\n        tolua_function(tolua_S,\"${m['name']}\", ${fn.signature_name});\n        #end for\n    #end if\n    tolua_endmodule(tolua_S);\n    std::string typeName = typeid(${current_class.namespaced_class_name}).name();\n    g_luaType[typeName] = \"${generator.scriptname_from_native($current_class.namespaced_class_name)}\";\n    g_typeCast[\"${current_class.class_name}\"] = \"${generator.scriptname_from_native($current_class.namespaced_class_name)}\";\n    return 1;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/sfunction.c",
    "content": "## ===== static function implementation template\nint ${signature_name}(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\n\\#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\\#endif\n\n\\#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"${generator.scriptname_from_native($namespaced_class_name)}\",0,&tolua_err)) goto tolua_lerror;\n\\#endif\n\n    argc = lua_gettop(tolua_S) - 1;\n\n#if len($arguments) >= $min_args\n    #set arg_count = len($arguments)\n    #set arg_idx = $min_args\n    #while $arg_idx <= $arg_count\n    if (argc == ${arg_idx})\n    {\n        #set arg_list = \"\"\n        #set arg_array = []\n        #set $count = 0\n        #while $count < $arg_idx\n            #set $arg = $arguments[$count]\n        ${arg.to_string($generator)} arg${count};\n            #set $count = $count + 1\n        #end while\n        #set $count = 0\n        #while $count < $arg_idx\n            #set $arg = $arguments[$count]\n        ${arg.to_native({\"generator\": $generator,\n                         \"in_value\": \"argv[\" + str(count) + \"]\",\n                         \"out_value\": \"arg\" + str(count),\n                         \"arg_idx\": $count+2,\n                         \"class_name\": $class_name,\n                         \"level\": 2,\n                         \"arg\":$arg,\n                         \"ntype\": $arg.namespaced_name.replace(\"*\", \"\"),\n                         \"scriptname\": $generator.scriptname_from_native($arg.namespaced_name)})};\n                #set $arg_array += [\"arg\"+str($count)]\n                #set $count = $count + 1\n        #end while\n        #if $arg_idx >= 0\n        if(!ok)\n            return 0;\n        #end if\n            #set $arg_list = \", \".join($arg_array)\n        #if $ret_type.name != \"void\"\n            #if $ret_type.is_enum\n        int ret = (int)${namespaced_class_name}::${func_name}($arg_list);\n            #else\n        ${ret_type.get_whole_name($generator)} ret = ${namespaced_class_name}::${func_name}($arg_list);\n        #end if\n        ${ret_type.from_native({\"generator\": $generator,\n                                \"in_value\": \"ret\",\n                                \"out_value\": \"ret\",\n                                \"type_name\": $ret_type.namespaced_name.replace(\"*\", \"\"),\n                                \"ntype\": $ret_type.get_whole_name($generator),\n                                \"class_name\": $class_name,\n                                \"level\": 2,\n                                \"scriptname\": $generator.scriptname_from_native($ret_type.namespaced_name)})};\n        return 1;\n        #else\n        ${namespaced_class_name}::${func_name}($arg_list);\n        return 0;\n        #end if\n    }\n        #set $arg_idx = $arg_idx + 1\n    #end while\n#end if\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\\n \", \"${func_name}\",argc, ${min_args});\n    return 0;\n\\#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function '${signature_name}'.\",&tolua_err);\n\\#endif\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/lua/templates/sfunction_overloaded.c",
    "content": "## ===== static function implementation template - for overloaded functions\nint ${signature_name}(lua_State* tolua_S)\n{\n    int argc = 0;\n    bool ok  = true;\n\\#if COCOS2D_DEBUG >= 1\n    tolua_Error tolua_err;\n\\#endif\n\n\\#if COCOS2D_DEBUG >= 1\n    if (!tolua_isusertable(tolua_S,1,\"${generator.scriptname_from_native($namespaced_class_name)}\",0,&tolua_err)) goto tolua_lerror;\n\\#endif\n\n    argc = lua_gettop(tolua_S)-1;\n\n    #for func in $implementations   \n    #if len($func.arguments) >= $func.min_args\n    #set arg_count = len($func.arguments)\n    #set arg_idx = $func.min_args\n    #while $arg_idx <= $arg_count\n    do \n    {\n        if (argc == ${arg_idx})\n        {\n            #set arg_list = \"\"\n            #set arg_array = []\n            #set count = 0\n            #while $count < $arg_idx\n            #set $arg = $func.arguments[$count]\n            ${arg.to_string($generator)} arg${count};\n            ${arg.to_native({\"generator\": $generator,\n                             \"in_value\": \"argv[\" + str(count) + \"]\",\n                             \"out_value\": \"arg\" + str(count),\n                             \"arg_idx\": $count+2,\n                             \"class_name\": $class_name,\n                             \"level\": 2,\n                             \"arg\":$arg,\n                             \"ntype\": $arg.namespaced_name.replace(\"*\", \"\"),\n                             \"scriptname\": $generator.scriptname_from_native($arg.namespaced_name)})};\n            #set $arg_array += [\"arg\"+str(count)]\n            #set $count = $count + 1\n            #if $arg_idx >= 0\n            if (!ok) { break; }\n            #end if\n            #end while\n            #set $arg_list = \", \".join($arg_array)\n            #if str($func.ret_type) != \"void\"\n                #if $func.ret_type.is_enum\n            int ret = (int)${namespaced_class_name}::${func.func_name}($arg_list);\n                #else\n            ${func.ret_type.get_whole_name($generator)} ret = ${namespaced_class_name}::${func.func_name}($arg_list);\n                #end if\n            ${func.ret_type.from_native({\"generator\": $generator,\n                                         \"in_value\": \"ret\",\n                                         \"out_value\": \"jsret\",\n                                         \"type_name\": $func.ret_type.namespaced_name.replace(\"*\", \"\"),\n                                         \"ntype\": $func.ret_type.get_whole_name($generator),\n                                         \"class_name\": $class_name,\n                                         \"level\": 2,\n                                         \"scriptname\": $generator.scriptname_from_native($func.ret_type.namespaced_name)})};\n            return 1;\n            #else\n            ${namespaced_class_name}::${func.func_name}($arg_list);\n            return 0;\n            #end if\n        }\n    } while (0);\n    #set $arg_idx = $arg_idx + 1\n    ok  = true;\n    #end while\n    #end if\n    #end for\n    CCLOG(\"%s has wrong number of arguments: %d, was expecting %d\", \"${func.func_name}\",argc, ${func.min_args});\n    return 0;\n\\#if COCOS2D_DEBUG >= 1\n    tolua_lerror:\n    tolua_error(tolua_S,\"#ferror in function '${signature_name}'.\",&tolua_err);\n\\#endif\n    return 0;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/Android.mk.example",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := scriptingcore-spidermonkey\n\nLOCAL_MODULE_FILENAME := libscriptingcore-spidermonkey\n\nLOCAL_SRC_FILES := ScriptingCore.cpp \\\n                   cocos2d_specifics.cpp\n\nLOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)\n\nLOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static\nLOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static\n\nLOCAL_LDLIBS := -landroid\nLOCAL_LDLIBS += -llog\n\ninclude $(BUILD_STATIC_LIBRARY)\n\n$(call import-module,spidermonkey/android)\n$(call import-module,cocos2dx)\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/Debugger.md",
    "content": "# JavaScript Debugger\n\nThe JavaScript debugger allows the developer to connect to a\nJavaScript application running on either a device or simulator, set\nbreakpoints, execute code step by step and inspect the running\napplication's environment.\n\nWhen enabled the debugger will listen for incoming commands on a TCP\nsocket. Commands are issued as plaintext with responses available\neither in human-readable plaintext or in JSON.\n\n## Setup\n\nAfter setting up the JavaScript bindings project make sure to call\nenableDebugger() before running the scene.\n\nThe first thing you need to do if you want to debug, is to add the debugger.js file to your project,\nthen call enableDebugger() before your main entrypoint.\n\n```c++\nbool AppDelegate::applicationDidFinishLaunching()\n{\n\t...\n    ScriptingCore::getInstance()->enableDebugger();\n    ScriptingCore::getInstance()->runScript(\"main.js\");\n}\n```\n\n## A debugging session\n\nOnce you start your game with a debugger session to be attached, the debugger will stop execution\nevery time it loads a script, and it will also open a TCP socket on port 5086 (you can change that\nport by setting JSB_DEBUGGER_PORT) that will remain listening until your app dies.\n\nThe basic commands supported by the debugger are the following:\n\n* `break file.js:NN`: set a breakpoint on file.js at line NN. **CURRENTLY NOT WORKING PROPERLY**\n* `step`: if you are in a breakpoint (or if you got into the debugger due to a `debugger` statement\n  in your code), you can step into the next line.\n* `continue`: resume execution.\n* `eval <valid js code>`: will evaluate the passed string as javascript code, in the current\n  execution frame. Note that with this command you can actually modify the content of variables if\n  you wish. The debugger client will print the result of the evaluation, so you can also use this\n  to inspect objects. If the result is not an object, it will return the string representation,\n  otherwise, it will iterate over all the public keys of the object and print the result. The\n  inspection is non-recursive.\n* `line`: prints the line of code where the debugger is currently at (the line of the current\n  execution offset).\n* `bt`: prints the backtrace (how did we get here).\n* `help` : prints all available commands\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/ScriptingCore.cpp.example",
    "content": "//\n//  ScriptingCore.cpp\n//  testmonkey\n//\n//  Created by Rolando Abarca on 3/14/12.\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n#include <iostream>\n#include <stdio.h>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#include <vector>\n#include \"ScriptingCore.h\"\n#include \"cocos2d.h\"\n\n#ifdef ANDROID\n#include <android/log.h>\n#include <android/asset_manager.h>\n#include <jni/JniHelper.h>\n#endif\n\n#ifdef ANDROID\n#define  LOG_TAG    \"ScriptingCore.cpp\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n#else\n#define  LOGD(...) js_log(__VA_ARGS__)\n#endif\n\njs_proxy_t *_native_js_global_ht = NULL;\njs_proxy_t *_js_native_global_ht = NULL;\njs_type_class_t *_js_global_type_ht = NULL;\nchar *_js_log_buf = NULL;\n\nstd::vector<sc_register_sth> registrationList;\nstd::map<std::string name, JSScript* script> filename_scripts_map;\nstd::map<std::string, js::RootedObject*> globals;\n\nstatic void executeJSFunctionFromReservedSpot(JSContext *cx, JSObject *obj,\n                                              jsval &dataVal, jsval &retval) {\n\n    //  if(p->jsclass->JSCLASS_HAS_RESERVED_SLOTS(1)) {\n    jsval func = JS_GetReservedSlot(obj, 0);\n\n    if(func == JSVAL_VOID) { return; }\n    jsval thisObj = JS_GetReservedSlot(obj, 1);\n    if(thisObj == JSVAL_VOID) {\n        JS_CallFunctionValue(cx, obj, func, 1, &dataVal, &retval);\n    } else {\n        assert(!JSVAL_IS_PRIMITIVE(thisObj));\n        JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(thisObj), func, 1, &dataVal, &retval);\n    }\n    //  }\n}\n\nvoid ScriptingCore::executeJSFunctionWithThisObj(jsval thisObj, jsval callback,\n                                                 jsval data) {\n    jsval retval;\n    if(callback != JSVAL_VOID || thisObj != JSVAL_VOID) {\n        JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(thisObj), callback, 1, &data, &retval);\n    }\n}\n\n\nstatic void executeJSFunctionWithName(JSContext *cx, JSObject *obj,\n                                      const char *funcName, jsval &dataVal,\n                                      jsval &retval) {\n    JSBool hasAction;\n    jsval temp_retval;\n\n    if (JS_HasProperty(cx, obj, funcName, &hasAction) && hasAction) {\n        if(!JS_GetProperty(cx, obj, funcName, &temp_retval)) {\n            return;\n        }\n        if(temp_retval == JSVAL_VOID) {\n            return;\n        }\n        JS_CallFunctionName(cx, obj, funcName,\n                            1, &dataVal, &retval);\n    }\n\n}\n\nvoid js_log(const char *format, ...) {\n    if (_js_log_buf == NULL) {\n        _js_log_buf = (char *)calloc(sizeof(char), 257);\n    }\n    va_list vl;\n    va_start(vl, format);\n    int len = vsnprintf(_js_log_buf, 256, format, vl);\n    va_end(vl);\n    if (len) {\n#ifdef ANDROID\n        __android_log_print(ANDROID_LOG_DEBUG, \"js_log\", _js_log_buf);\n#else\n        fprintf(stderr, \"JS: %s\\n\", _js_log_buf);\n#endif\n    }\n}\n\nvoid registerDefaultClasses(JSContext* cx, JSObject* global) {\n    if (!JS_InitStandardClasses(cx, global)) {\n        js_log(\"error initializing the standard classes\");\n    }\n\n    //\n    // Javascript controller (__jsc__)\n    //\n    JSObject *jsc = JS_NewObject(cx, NULL, NULL, NULL);\n    jsval jscVal = OBJECT_TO_JSVAL(jsc);\n    JS_SetProperty(cx, global, \"__jsc__\", &jscVal);\n\n    JS_DefineFunction(cx, jsc, \"garbageCollect\", ScriptingCore::forceGC, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(cx, jsc, \"dumpRoot\", ScriptingCore::dumpRoot, 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(cx, jsc, \"addGCRootObject\", ScriptingCore::addRootJS, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n    JS_DefineFunction(cx, jsc, \"removeGCRootObject\", ScriptingCore::removeRootJS, 1, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_ENUMERATE );\n\n    // register some global functions\n    JS_DefineFunction(cx, global, \"require\", ScriptingCore::executeScript, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"log\", ScriptingCore::log, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, global, \"forceGC\", ScriptingCore::forceGC, 0, JSPROP_READONLY | JSPROP_PERMANENT);\n    // should be used only for debug\n    JS_DefineFunction(cx, global, \"newGlobal\", jsNewGlobal, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n\n    // register the server socket\n    JS_DefineFunction(cx, glob, \"_socketOpen\", jsSocketOpen, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, glob, \"_socketWrite\", jsSocketWrite, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, glob, \"_socketRead\", jsSocketRead, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n    JS_DefineFunction(cx, glob, \"_socketClose\", jsSocketClose, 1, JSPROP_READONLY | JSPROP_PERMANENT);\n}\n\nvoid sc_finalize(JSFreeOp *freeOp, JSObject *obj) {\n    return;\n}\n\nstatic JSClass global_class = {\n    \"global\", JSCLASS_GLOBAL_FLAGS,\n    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,\n    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, sc_finalize,\n    JSCLASS_NO_OPTIONAL_MEMBERS\n};\n\nScriptingCore::ScriptingCore()\n{\n    // set utf8 strings internally (we don't need utf16)\n    JS_SetCStringsAreUTF8();\n    this->addRegisterCallback(registerDefaultClasses);\n}\n\nvoid ScriptingCore::string_report(jsval val) {\n    if (JSVAL_IS_NULL(val)) {\n        LOGD(\"val : (JSVAL_IS_NULL(val)\");\n        // return 1;\n    } else if ((JSVAL_IS_BOOLEAN(val)) &&\n               (JS_FALSE == (JSVAL_TO_BOOLEAN(val)))) {\n        LOGD(\"val : (return value is JS_FALSE\");\n        // return 1;\n    } else if (JSVAL_IS_STRING(val)) {\n        JSString *str = JS_ValueToString(this->getGlobalContext(), val);\n        if (NULL == str) {\n            LOGD(\"val : return string is NULL\");\n        } else {\n            LOGD(\"val : return string =\\n%s\\n\",\n                 JS_EncodeString(this->getGlobalContext(), str));\n        }\n    } else if (JSVAL_IS_NUMBER(val)) {\n        double number;\n        if (JS_FALSE ==\n            JS_ValueToNumber(this->getGlobalContext(), val, &number)) {\n            LOGD(\"val : return number could not be converted\");\n        } else {\n            LOGD(\"val : return number =\\n%f\", number);\n        }\n    }\n}\n\nJSBool ScriptingCore::evalString(const char *string, jsval *outVal, const char *filename)\n{\n    jsval rval;\n    JSScript* script = JS_CompileScript(cx, global, string, strlen(string), filename, 1);\n    if (script) {\n        filename_script[filename] = script;\n        JSBool evaluatedOK = JS_ExecuteScript(_cx, global, script, &rval);\n        if (JS_FALSE == evaluatedOK) {\n            LOGD(stderr, \"(evaluatedOK == JS_FALSE)\");\n        }\n        return evaluatedOK;\n    }\n    return false;\n}\n\nvoid ScriptingCore::start() {\n    // for now just this\n    this->createGlobalContext();\n}\n\nvoid ScriptingCore::addRegisterCallback(sc_register_sth callback) {\n    registrationList.push_back(callback);\n}\n\nvoid ScriptingCore::removeAllRoots(JSContext *cx) {\n    js_proxy_t *current, *tmp;\n    HASH_ITER(hh, _js_native_global_ht, current, tmp) {\n        JS_RemoveObjectRoot(cx, &current->obj);\n    }\n    HASH_CLEAR(hh, _js_native_global_ht);\n    HASH_CLEAR(hh, _native_js_global_ht);\n    HASH_CLEAR(hh, _js_global_type_ht);\n}\n\nJSObject* NewGlobalObject(JSContext* cx)\n{\n    JSObject* glob = JS_NewGlobalObject(cx, &global_class, NULL);\n    if (!glob) {\n        return NULL;\n    }\n    JSAutoCompartment ac(cx, glob);\n    if (!JS_InitStandardClasses(cx, glob))\n        return NULL;\n    if (!JS_InitReflect(cx, glob))\n        return NULL;\n    if (!JS_DefineDebuggerObject(cx, glob))\n        return NULL;\n\n    return glob;\n}\n\nJSBool jsNewGlobal(JSContext* cx, unsigned argc, jsval* vp)\n{\n    if (argc == 1) {\n        jsval *argv = JS_ARGV(cx, vp);\n        JSString *jsstr = JS_ValueToString(cx, argv[0]);\n        std::string key = JS_EncodeString(cx, jsstr);\n        js::RootedObject *global = globals[key];\n        if (!global) {\n            global = new js::RootedObject(cx, NewGlobalObject(cx));\n            JS_WrapObject(cx, global->address());\n            globals[key] = global;\n        }\n        JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(*global));\n        return JS_TRUE;\n    }\n    return JS_FALSE;\n}\n\nvoid ScriptingCore::createGlobalContext() {\n    if (this->cx && this->rt) {\n        ScriptingCore::removeAllRoots(this->cx);\n        JS_DestroyContext(this->cx);\n        JS_DestroyRuntime(this->rt);\n        this->cx = NULL;\n        this->rt = NULL;\n    }\n    this->rt = JS_NewRuntime(10 * 1024 * 1024);\n    this->cx = JS_NewContext(rt, 10240);\n    JS_SetOptions(this->cx, JSOPTION_TYPE_INFERENCE);\n    JS_SetVersion(this->cx, JSVERSION_LATEST);\n    JS_SetOptions(this->cx, JS_GetOptions(this->cx) & ~JSOPTION_METHODJIT);\n    JS_SetOptions(this->cx, JS_GetOptions(this->cx) & ~JSOPTION_METHODJIT_ALWAYS);\n    JS_SetErrorReporter(this->cx, ScriptingCore::reportError);\n    this->global = NewGlobalObject(this->cx);//JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL);\n    for (std::vector<sc_register_sth>::iterator it = registrationList.begin(); it != registrationList.end(); it++) {\n        sc_register_sth callback = *it;\n        callback(this->cx, this->global);\n    }\n}\n\n\n#ifdef ANDROID\n\nstatic unsigned long\nfileutils_read_into_new_memory(const char* relativepath,\n                               unsigned char** content) {\n    *content = NULL;\n\n    AAssetManager* assetmanager =\n        JniHelper::getAssetManager();\n    if (NULL == assetmanager) {\n        LOGD(\"assetmanager : is NULL\");\n        return 0;\n    }\n\n    // read asset data\n    AAsset* asset =\n        AAssetManager_open(assetmanager,\n                           relativepath,\n                           AASSET_MODE_UNKNOWN);\n    if (NULL == asset) {\n        LOGD(\"asset : is NULL\");\n        return 0;\n    }\n\n    off_t size = AAsset_getLength(asset);\n    LOGD(\"size = %d \", size);\n\n    unsigned char* buf =\n        (unsigned char*) malloc((sizeof(unsigned char)) * (size+1));\n    if (NULL == buf) {\n        LOGD(\"memory allocation failed\");\n        AAsset_close(asset);\n        return 0;\n    }\n\n    int bytesread = AAsset_read(asset, buf, size);\n    LOGD(\"bytesread = %d \", bytesread);\n    buf[bytesread] = '\\0';\n\n    AAsset_close(asset);\n\n    *content = (unsigned char*) buf;\n    return bytesread;\n}\n\nJSBool ScriptingCore::runScript(const char *path)\n{\n    LOGD(\"ScriptingCore::runScript(%s)\", path);\n\n    if (NULL == path) {\n        return JS_FALSE;\n    }\n\n    unsigned char* content = NULL;\n    unsigned long contentsize = 0;\n\n    contentsize = fileutils_read_into_new_memory(path, &content);\n\n    if (NULL == content) {\n        LOGD(\"(NULL == content)\");\n        return JS_FALSE;\n    }\n\n    if (contentsize <= 0) {\n        LOGD(\"(contentsize <= 0)\");\n        free(content);\n        return JS_FALSE;\n    }\n\n    jsval rval;\n    JSBool ret = this->evalString((const char *)content, &rval, path);\n    free(content);\n\n    LOGD(\"... ScriptingCore::runScript(%s) done successfully.\", path);\n\n    return ret;\n}\n\n#else\n\nstatic size_t readFileInMemory(const char *path, unsigned char **buff) {\n    struct stat buf;\n    int file = open(path, O_RDONLY);\n    long readBytes = -1;\n    if (file) {\n        if (fstat(file, &buf) == 0) {\n            *buff = (unsigned char *)calloc(buf.st_size + 1, 1);\n            if (*buff) {\n                readBytes = read(file, *buff, buf.st_size);\n            }\n        }\n    }\n    close(file);\n    return readBytes;\n}\n\nJSBool ScriptingCore::runScript(const char *path, JSObject* glob, JSContext* cx_)\n{\n    cocos2d::CCFileUtils *futil = cocos2d::CCFileUtils::sharedFileUtils();\n    if (!path) {\n        return false;\n    }\n    std::string rpath;\n    if (path[0] == '/') {\n        rpath = path;\n    } else {\n        rpath = futil->fullPathFromRelativePath(path);\n    }\n    if (glob == NULL) {\n        glob = global;\n    }\n    if (cx_ == NULL) {\n        cx_ = cx;\n    }\n    JSScript* script = JS_CompileUTF8File(cx, glob, rpath.c_str());\n    jsval rval;\n    JSBool evaluatedOK = false;\n    if (script) {\n        filename_script[path] = script;\n        JSAutoCompartment ac(cx, glob);\n        evaluatedOK = JS_ExecuteScript(cx, glob, script, &rval);\n        if (JS_FALSE == evaluatedOK) {\n            fprintf(stderr, \"(evaluatedOK == JS_FALSE)\\n\");\n        }\n    }\n    return evaluatedOK;\n}\n\n#endif\n\nScriptingCore::~ScriptingCore()\n{\n    JS_DestroyContext(cx);\n    JS_DestroyRuntime(rt);\n    JS_ShutDown();\n    if (_js_log_buf) {\n        free(_js_log_buf);\n        _js_log_buf = NULL;\n    }\n}\n\nvoid ScriptingCore::reportError(JSContext *cx, const char *message, JSErrorReport *report)\n{\n\tjs_log(\"%s:%u:%s\\n\",\n\t\t\treport->filename ? report->filename : \"<no filename=\\\"filename\\\">\",\n\t\t\t(unsigned int) report->lineno,\n\t\t\tmessage);\n};\n\n\nJSBool ScriptingCore::log(JSContext* cx, uint32_t argc, jsval *vp)\n{\n\tif (argc > 0) {\n\t\tJSString *string = NULL;\n\t\tJS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"S\", &string);\n\t\tif (string) {\n\t\t\tchar *cstr = JS_EncodeString(cx, string);\n\t\t\tjs_log(cstr);\n\t\t}\n\t}\n\treturn JS_TRUE;\n}\n\n\nvoid ScriptingCore::removeJSObjectByCCObject(void* cobj) {\n\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    void *ptr = cobj;\n    JS_GET_PROXY(nproxy, ptr);\n    if (nproxy) {\n        JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();\n        JS_GET_NATIVE_PROXY(jsproxy, nproxy->obj);\n        JS_RemoveObjectRoot(cx, &jsproxy->obj);\n        JS_REMOVE_PROXY(nproxy, jsproxy);\n    }\n}\n\n\nJSBool ScriptingCore::setReservedSpot(uint32_t i, JSObject *obj, jsval value) {\n\tJS_SetReservedSlot(obj, i, value);\n\treturn JS_TRUE;\n}\n\nJSBool ScriptingCore::executeScript(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc >= 1) {\n        jsval* argv = JS_ARGV(cx, vp);\n        JSString* str = JS_ValueToString(cx, argv[0]);\n        const char* path = JS_EncodeString(cx, str);\n        JSBool res = false;\n        if (argc == 2 && argv[1].isString()) {\n            JSString* globalName = JSVAL_TO_STRING(argv[1]);\n            const char* name = JS_EncodeString(cx, globalName);\n            js::RootedObject* rootedGlobal = globals[name];\n            if (rootedGlobal) {\n                JS_free(cx, (void*)name);\n                res = ScriptingCore::getInstance()->runScript(path, rootedGlobal->get());\n            } else {\n                JS_ReportError(cx, \"Invalid global object: %s\", name);\n                return JS_FALSE;\n            }\n        } else {\n            res = ScriptingCore::getInstance()->runScript(path);\n        }\n        JS_free(cx, (void*)path);\n        return res;\n    }\n    return JS_TRUE;\n}\n\nJSBool ScriptingCore::forceGC(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSRuntime *rt = JS_GetRuntime(cx);\n\tJS_GC(rt);\n\treturn JS_TRUE;\n}\n\nstatic void dumpNamedRoot(const char *name, void *addr,  JSGCRootType type, void *data)\n{\n    printf(\"There is a root named '%s' at %p\\n\", name, addr);\n}\nJSBool ScriptingCore::dumpRoot(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    // JS_DumpNamedRoots is only available on DEBUG versions of SpiderMonkey.\n    // Mac and Simulator versions were compiled with DEBUG.\n#if DEBUG\n    JSContext *_cx = ScriptingCore::getInstance()->getGlobalContext();\n    JSRuntime *rt = JS_GetRuntime(_cx);\n    JS_DumpNamedRoots(rt, dumpNamedRoot, NULL);\n#endif\n    return JS_TRUE;\n}\n\nJSBool ScriptingCore::addRootJS(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc == 1) {\n        JSObject *o = NULL;\n        if (JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"o\", &o) == JS_TRUE) {\n            if (JS_AddNamedObjectRoot(cx, &o, \"from-js\") == JS_FALSE) {\n                LOGD(\"something went wrong when setting an object to the root\");\n            }\n        }\n        return JS_TRUE;\n    }\n    return JS_FALSE;\n}\n\nJSBool ScriptingCore::removeRootJS(JSContext *cx, uint32_t argc, jsval *vp)\n{\n    if (argc == 1) {\n        JSObject *o = NULL;\n        if (JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), \"o\", &o) == JS_TRUE) {\n            JS_RemoveObjectRoot(cx, &o);\n        }\n        return JS_TRUE;\n    }\n    return JS_FALSE;\n}\n\nint ScriptingCore::executeFunctionWithIntegerData(int nHandler, int data, CCNode *self) {\n    js_proxy_t * p;\n    JS_GET_PROXY(p, self);\n\n    if (!p) return 0;\n\n    jsval retval;\n    jsval dataVal = INT_TO_JSVAL(1);\n    js_proxy_t *proxy;\n    JS_GET_PROXY(proxy, self);\n\n    std::string funcName = \"\";\n    if(data == kCCNodeOnEnter) {\n        executeJSFunctionWithName(this->cx, p->obj, \"onEnter\", dataVal, retval);\n    } else if(data == kCCNodeOnExit) {\n        executeJSFunctionWithName(this->cx, p->obj, \"onExit\", dataVal, retval);\n    } else if(data == kCCMenuItemActivated) {\n        dataVal = (proxy ? OBJECT_TO_JSVAL(proxy->obj) : JSVAL_NULL);\n        executeJSFunctionFromReservedSpot(this->cx, p->obj, dataVal, retval);\n    } else if(data == kCCNodeOnEnterTransitionDidFinish) {\n        executeJSFunctionWithName(this->cx, p->obj, \"onEnterTransitionDidFinish\", dataVal, retval);\n    } else if(data == kCCNodeOnExitTransitionDidStart) {\n        executeJSFunctionWithName(this->cx, p->obj, \"onExitTransitionDidStart\", dataVal, retval);\n    }\n    return 1;\n}\n\n\nint ScriptingCore::executeFunctionWithObjectData(int nHandler, const char *name, JSObject *obj, CCNode *self) {\n\n    js_proxy_t * p;\n    JS_GET_PROXY(p, self);\n    if (!p) return 0;\n\n    jsval retval;\n    jsval dataVal = OBJECT_TO_JSVAL(obj);\n\n    executeJSFunctionWithName(this->cx, p->obj, name, dataVal, retval);\n\n    return 1;\n}\n\n\nint ScriptingCore::executeFunctionWithFloatData(int nHandler, float data, CCNode *self) {\n\n\n    js_proxy_t * p;\n    JS_GET_PROXY(p, self);\n\n    if (!p) return 0;\n\n    jsval retval;\n    jsval dataVal = DOUBLE_TO_JSVAL(data);\n\n    std::string funcName = \"\";\n\n    executeJSFunctionWithName(this->cx, p->obj, \"update\", dataVal, retval);\n\n    return 1;\n}\n\nstatic void getTouchesFuncName(int eventType, std::string &funcName) {\n    switch(eventType) {\n        case CCTOUCHBEGAN:\n            funcName = \"onTouchesBegan\";\n            break;\n        case CCTOUCHENDED:\n            funcName = \"onTouchesEnded\";\n            break;\n        case CCTOUCHMOVED:\n            funcName = \"onTouchesMoved\";\n            break;\n        case CCTOUCHCANCELLED:\n            funcName = \"onTouchesCancelled\";\n            break;\n    }\n\n}\n\nstatic void getTouchFuncName(int eventType, std::string &funcName) {\n    switch(eventType) {\n        case CCTOUCHBEGAN:\n            funcName = \"onTouchBegan\";\n            break;\n        case CCTOUCHENDED:\n            funcName = \"onTouchEnded\";\n            break;\n        case CCTOUCHMOVED:\n            funcName = \"onTouchMoved\";\n            break;\n        case CCTOUCHCANCELLED:\n            funcName = \"onTouchCancelled\";\n            break;\n    }\n\n}\n\nstatic void rootObject(JSContext *cx, JSObject *obj) {\n    JS_AddNamedObjectRoot(cx, &obj, \"unnamed\");\n}\n\n\nstatic void unRootObject(JSContext *cx, JSObject *obj) {\n    JS_RemoveObjectRoot(cx, &obj);\n}\n\n\n\n\nstatic void getJSTouchObject(JSContext *cx, CCTouch *x, jsval &jsret) {\n    js_type_class_t *classType;\n    TypeTest<cocos2d::CCTouch> t;\n    uint32_t typeId = t.s_id();\n    HASH_FIND_INT(_js_global_type_ht, &typeId, classType);\n    assert(classType);\n    JSObject *_tmp = JS_NewObject(cx, classType->jsclass, classType->proto, classType->parentProto);\n    js_proxy_t *proxy, *nproxy;\n    JS_NEW_PROXY(proxy, x, _tmp);\n    void *ptr = x;\n    JS_GET_PROXY(nproxy, ptr);\n    JS_AddNamedObjectRoot(cx, &nproxy->obj, \"CCTouch\");\n    jsret = OBJECT_TO_JSVAL(_tmp);\n}\n\n\nstatic void removeJSTouchObject(JSContext *cx, CCTouch *x, jsval &jsret) {\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    void *ptr = x;\n    JS_GET_PROXY(nproxy, ptr);\n    if (nproxy) {\n        JS_RemoveObjectRoot(cx, &nproxy->obj);\n        JS_GET_NATIVE_PROXY(jsproxy, nproxy->obj);\n        JS_REMOVE_PROXY(nproxy, jsproxy);\n    }\n}\n\n\nint ScriptingCore::executeTouchesEvent(int nHandler, int eventType,\n                                       CCSet *pTouches, CCNode *self) {\n\n    std::string funcName = \"\";\n    getTouchesFuncName(eventType, funcName);\n\n    JSObject *jsretArr = JS_NewArrayObject(this->cx, 0, NULL);\n\n    JS_AddNamedObjectRoot(this->cx, &jsretArr, \"touchArray\");\n    int count = 0;\n    for(CCSetIterator it = pTouches->begin(); it != pTouches->end(); ++it, ++count) {\n        jsval jsret;\n        getJSTouchObject(this->cx, (CCTouch *) *it, jsret);\n        if(!JS_SetElement(this->cx, jsretArr, count, &jsret)) {\n            break;\n        }\n    }\n\n    executeFunctionWithObjectData(1,  funcName.c_str(), jsretArr, self);\n\n    JS_RemoveObjectRoot(this->cx, &jsretArr);\n\n    for(CCSetIterator it = pTouches->begin(); it != pTouches->end(); ++it, ++count) {\n        jsval jsret;\n        removeJSTouchObject(this->cx, (CCTouch *) *it, jsret);\n    }\n\n\n    return 1;\n}\n\nint ScriptingCore::executeCustomTouchesEvent(int eventType,\n                                       CCSet *pTouches, JSObject *obj)\n{\n\n    jsval retval;\n    std::string funcName;\n    getTouchesFuncName(eventType, funcName);\n\n    JSObject *jsretArr = JS_NewArrayObject(this->cx, 0, NULL);\n    JS_AddNamedObjectRoot(this->cx, &jsretArr, \"touchArray\");\n    int count = 0;\n    for(CCSetIterator it = pTouches->begin(); it != pTouches->end(); ++it, ++count) {\n        jsval jsret;\n        getJSTouchObject(this->cx, (CCTouch *) *it, jsret);\n        if(!JS_SetElement(this->cx, jsretArr, count, &jsret)) {\n            break;\n        }\n    }\n\n    jsval jsretArrVal = OBJECT_TO_JSVAL(jsretArr);\n    executeJSFunctionWithName(this->cx, obj, funcName.c_str(), jsretArrVal, retval);\n    JS_RemoveObjectRoot(this->cx, &jsretArr);\n\n    for(CCSetIterator it = pTouches->begin(); it != pTouches->end(); ++it, ++count) {\n        jsval jsret;\n        removeJSTouchObject(this->cx, (CCTouch *) *it, jsret);\n    }\n\n    return 1;\n}\n\n\nint ScriptingCore::executeCustomTouchEvent(int eventType,\n                                           CCTouch *pTouch, JSObject *obj) {\n    jsval retval;\n    std::string funcName;\n    getTouchFuncName(eventType, funcName);\n\n    jsval jsTouch;\n    getJSTouchObject(this->cx, pTouch, jsTouch);\n\n    executeJSFunctionWithName(this->cx, obj, funcName.c_str(), jsTouch, retval);\n    return 1;\n\n}\n\n\nint ScriptingCore::executeCustomTouchEvent(int eventType,\n                                           CCTouch *pTouch, JSObject *obj,\n                                           jsval &retval) {\n\n    std::string funcName;\n    getTouchFuncName(eventType, funcName);\n\n    jsval jsTouch;\n    getJSTouchObject(this->cx, pTouch, jsTouch);\n\n    executeJSFunctionWithName(this->cx, obj, funcName.c_str(), jsTouch, retval);\n    return 1;\n\n}\n\n\nint ScriptingCore::executeSchedule(int nHandler, float dt, CCNode *self) {\n\n    executeFunctionWithFloatData(nHandler, dt, self);\n    return 1;\n}\n\nlong long jsval_to_long_long(JSContext *cx, jsval v) {\n    JSObject *tmp = JSVAL_TO_OBJECT(v);\n    if (JS_IsTypedArrayObject(tmp, cx) && JS_GetTypedArrayByteLength(tmp, cx) == 8) {\n        uint32_t *data = (uint32_t *)JS_GetUint32ArrayData(tmp, cx);\n        long long r = (long long)(*data);\n        return r;\n    }\n    return 0;\n}\n\nstd::string jsval_to_std_string(JSContext *cx, jsval v) {\n    JSString *tmp = JS_ValueToString(cx, v);\n    char *rawStr = JS_EncodeString(cx, tmp);\n    std::string ret = std::string(rawStr);\n    JS_free(cx, rawStr);\n    return ret;\n}\n\nconst char* jsval_to_c_string(JSContext *cx, jsval v) {\n    JSString *tmp = JS_ValueToString(cx, v);\n    return JS_EncodeString(cx, tmp);\n}\n\nCCPoint jsval_to_ccpoint(JSContext *cx, jsval v) {\n    JSObject *tmp;\n    jsval jsx, jsy;\n    double x, y;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"x\", &jsx) &&\n        JS_GetProperty(cx, tmp, \"y\", &jsy) &&\n        JS_ValueToNumber(cx, jsx, &x) &&\n        JS_ValueToNumber(cx, jsy, &y);\n    assert(ok == JS_TRUE);\n    return cocos2d::CCPoint(x, y);\n}\n\nCCRect jsval_to_ccrect(JSContext *cx, jsval v) {\n    JSObject *tmp;\n    jsval jsx, jsy, jswidth, jsheight;\n    double x, y, width, height;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"x\", &jsx) &&\n        JS_GetProperty(cx, tmp, \"y\", &jsy) &&\n        JS_GetProperty(cx, tmp, \"width\", &jswidth) &&\n        JS_GetProperty(cx, tmp, \"height\", &jsheight) &&\n        JS_ValueToNumber(cx, jsx, &x) &&\n        JS_ValueToNumber(cx, jsy, &y) &&\n        JS_ValueToNumber(cx, jswidth, &width) &&\n        JS_ValueToNumber(cx, jsheight, &height);\n    assert(ok == JS_TRUE);\n    return cocos2d::CCRect(x, y, width, height);\n}\n\nCCSize jsval_to_ccsize(JSContext *cx, jsval v) {\n    JSObject *tmp;\n    jsval jsw, jsh;\n    double w, h;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"width\", &jsw) &&\n        JS_GetProperty(cx, tmp, \"height\", &jsh) &&\n        JS_ValueToNumber(cx, jsw, &w) &&\n        JS_ValueToNumber(cx, jsh, &h);\n    assert(ok == JS_TRUE);\n    return cocos2d::CCSize(w, h);\n}\n\nccGridSize jsval_to_ccgridsize(JSContext *cx, jsval v) {\n    JSObject *tmp;\n    jsval jsx, jsy;\n    double x, y;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"x\", &jsx) &&\n        JS_GetProperty(cx, tmp, \"y\", &jsy) &&\n        JS_ValueToNumber(cx, jsx, &x) &&\n        JS_ValueToNumber(cx, jsy, &y);\n    assert(ok == JS_TRUE);\n    return cocos2d::ccg(x, y);\n}\n\nccColor4B jsval_to_cccolor4b(JSContext *cx, jsval v) {\n    JSObject *tmp;\n    jsval jsr, jsg, jsb, jsa;\n    double r, g, b, a;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"r\", &jsr) &&\n        JS_GetProperty(cx, tmp, \"g\", &jsg) &&\n        JS_GetProperty(cx, tmp, \"b\", &jsb) &&\n        JS_GetProperty(cx, tmp, \"a\", &jsa) &&\n        JS_ValueToNumber(cx, jsr, &r) &&\n        JS_ValueToNumber(cx, jsg, &g) &&\n        JS_ValueToNumber(cx, jsb, &b) &&\n        JS_ValueToNumber(cx, jsa, &a);\n    assert(ok == JS_TRUE);\n    return cocos2d::ccc4(r, g, b, a);\n}\n\nccColor4F jsval_to_cccolor4f(JSContext *cx, jsval v) {\n    JSObject *tmp;\n    jsval jsr, jsg, jsb, jsa;\n    double r, g, b, a;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"r\", &jsr) &&\n        JS_GetProperty(cx, tmp, \"g\", &jsg) &&\n        JS_GetProperty(cx, tmp, \"b\", &jsb) &&\n        JS_GetProperty(cx, tmp, \"a\", &jsa) &&\n        JS_ValueToNumber(cx, jsr, &r) &&\n        JS_ValueToNumber(cx, jsg, &g) &&\n        JS_ValueToNumber(cx, jsb, &b) &&\n        JS_ValueToNumber(cx, jsa, &a);\n    assert(ok == JS_TRUE);\n    return cocos2d::ccc4f(r, g, b, a);\n}\n\nccColor3B jsval_to_cccolor3b(JSContext *cx, jsval v) {\n    JSObject *tmp;\n    jsval jsr, jsg, jsb;\n    double r, g, b;\n    JSBool ok = JS_ValueToObject(cx, v, &tmp) &&\n        JS_GetProperty(cx, tmp, \"r\", &jsr) &&\n        JS_GetProperty(cx, tmp, \"g\", &jsg) &&\n        JS_GetProperty(cx, tmp, \"b\", &jsb) &&\n        JS_ValueToNumber(cx, jsr, &r) &&\n        JS_ValueToNumber(cx, jsg, &g) &&\n        JS_ValueToNumber(cx, jsb, &b);\n    assert(ok == JS_TRUE);\n    return cocos2d::ccc3(r, g, b);\n}\n\nCCArray* jsval_to_ccarray(JSContext* cx, jsval v) {\n    JSObject *arr;\n    if (JS_ValueToObject(cx, v, &arr) && JS_IsArrayObject(cx, arr)) {\n        uint32_t len = 0;\n        JS_GetArrayLength(cx, arr, &len);\n        CCArray* ret = CCArray::createWithCapacity(len);\n        for (int i=0; i < len; i++) {\n            jsval elt;\n            JSObject *elto;\n            if (JS_GetElement(cx, arr, i, &elt) && JS_ValueToObject(cx, elt, &elto)) {\n                js_proxy_t *proxy;\n                JS_GET_NATIVE_PROXY(proxy, elto);\n                if (proxy) {\n                    ret->addObject((CCObject *)proxy->ptr);\n                }\n            }\n        }\n        return ret;\n    }\n    return NULL;\n}\n\n\njsval ccarray_to_jsval(JSContext* cx, CCArray *arr) {\n\n  JSObject *jsretArr = JS_NewArrayObject(cx, 0, NULL);\n\n  for(int i = 0; i < arr->count(); ++i) {\n\n    CCObject *obj = arr->objectAtIndex(i);\n    js_proxy_t *proxy = js_get_or_create_proxy<cocos2d::CCObject>(cx, obj);\n    jsval arrElement = OBJECT_TO_JSVAL(proxy->obj);\n\n    if(!JS_SetElement(cx, jsretArr, i, &arrElement)) {\n      break;\n    }\n  }\n  return OBJECT_TO_JSVAL(jsretArr);\n}\n\njsval long_long_to_jsval(JSContext* cx, long long v) {\n    JSObject *tmp = JS_NewUint32Array(cx, 2);\n    uint32_t *data = (uint32_t *)JS_GetArrayBufferViewData(tmp, cx);\n    data[0] = ((uint32_t *)(&v))[0];\n    data[1] = ((uint32_t *)(&v))[1];\n    return OBJECT_TO_JSVAL(tmp);\n}\n\njsval std_string_to_jsval(JSContext* cx, std::string& v) {\n    JSString *str = JS_NewStringCopyZ(cx, v.c_str());\n    return STRING_TO_JSVAL(str);\n}\n\njsval c_string_to_jsval(JSContext* cx, const char* v) {\n    JSString *str = JS_NewStringCopyZ(cx, v);\n    return STRING_TO_JSVAL(str);\n}\n\njsval ccpoint_to_jsval(JSContext* cx, CCPoint& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(v.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(v.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval ccrect_to_jsval(JSContext* cx, CCRect& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(v.origin.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(v.origin.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"width\", DOUBLE_TO_JSVAL(v.size.width), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"height\", DOUBLE_TO_JSVAL(v.size.height), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval ccsize_to_jsval(JSContext* cx, CCSize& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"width\", DOUBLE_TO_JSVAL(v.width), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"height\", DOUBLE_TO_JSVAL(v.height), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval ccgridsize_to_jsval(JSContext* cx, ccGridSize& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"x\", DOUBLE_TO_JSVAL(v.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"y\", DOUBLE_TO_JSVAL(v.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval cccolor4b_to_jsval(JSContext* cx, ccColor4B& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"r\", INT_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"g\", INT_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"b\", INT_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"a\", INT_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval cccolor4f_to_jsval(JSContext* cx, ccColor4F& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"r\", DOUBLE_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"g\", DOUBLE_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"b\", DOUBLE_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"a\", DOUBLE_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\njsval cccolor3b_to_jsval(JSContext* cx, ccColor3B& v) {\n    JSObject *tmp = JS_NewObject(cx, NULL, NULL, NULL);\n    if (!tmp) return JSVAL_NULL;\n    JSBool ok = JS_DefineProperty(cx, tmp, \"r\", INT_TO_JSVAL(v.r), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"g\", INT_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) &&\n                JS_DefineProperty(cx, tmp, \"b\", INT_TO_JSVAL(v.g), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT);\n    if (ok) {\n        return OBJECT_TO_JSVAL(tmp);\n    }\n    return JSVAL_NULL;\n}\n\n// socket code\n// open a socket, bind it to a port and start listening, all at once :)\nJSBool jsSocketOpen(JSContext* cx, unsigned argc, jsval* vp)\n{\n    if (argc == 2) {\n        jsval* argv = JS_ARGV(cx, vp);\n        int port = JSVAL_TO_INT(argv[0]);\n        JSObject* callback = JSVAL_TO_OBJECT(argv[1]);\n\n        int s;\n        s = ports_sockets[port];\n        if (!s) {\n            char myname[256];\n            struct sockaddr_in sa;\n            struct hostent *hp;\n            memset(&sa, 0, sizeof(struct sockaddr_in));\n            gethostname(myname, 256);\n            hp = gethostbyname(myname);\n            sa.sin_family = hp->h_addrtype;\n            sa.sin_port = htons(port);\n            if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) {\n                JS_ReportError(cx, \"error opening socket\");\n                return JS_FALSE;\n            }\n            int optval = 1;\n            if ((setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) < 0) {\n                close(s);\n                JS_ReportError(cx, \"error setting socket options\");\n                return JS_FALSE;\n            }\n            if ((bind(s, (const struct sockaddr *)&sa, sizeof(struct sockaddr_in))) < 0) {\n                close(s);\n                JS_ReportError(cx, \"error binding socket\");\n                return JS_FALSE;\n            }\n            listen(s, 1);\n            int clientSocket;\n            if ((clientSocket = accept(s, NULL, NULL)) > 0) {\n                ports_sockets[port] = clientSocket;\n                jsval fval = OBJECT_TO_JSVAL(callback);\n                jsval jsSocket = INT_TO_JSVAL(clientSocket);\n                jsval outVal;\n                JS_CallFunctionValue(cx, NULL, fval, 1, &jsSocket, &outVal);\n            }\n        } else {\n            // just call the callback with the client socket\n            jsval fval = OBJECT_TO_JSVAL(callback);\n            jsval jsSocket = INT_TO_JSVAL(s);\n            jsval outVal;\n            JS_CallFunctionValue(cx, NULL, fval, 1, &jsSocket, &outVal);\n        }\n        JS_SET_RVAL(cx, vp, INT_TO_JSVAL(s));\n    }\n    return JS_TRUE;\n}\n\nJSBool jsSocketRead(JSContext* cx, unsigned argc, jsval* vp)\n{\n    if (argc == 1) {\n        jsval* argv = JS_ARGV(cx, vp);\n        int s = JSVAL_TO_INT(argv[0]);\n        char buff[1024];\n        JSString* outStr = JS_NewStringCopyZ(cx, \"\");\n\n        size_t bytesRead;\n        while ((bytesRead = read(s, buff, 1024)) > 0) {\n            JSString* newStr = JS_NewStringCopyN(cx, buff, bytesRead);\n            outStr = JS_ConcatStrings(cx, outStr, newStr);\n            // break on new line\n            if (buff[bytesRead-1] == '\\n') {\n                break;\n            }\n        }\n        JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(outStr));\n    } else {\n        JS_SET_RVAL(cx, vp, JSVAL_NULL);\n    }\n    return JS_TRUE;\n}\n\nJSBool jsSocketWrite(JSContext* cx, unsigned argc, jsval* vp)\n{\n    if (argc == 2) {\n        jsval* argv = JS_ARGV(cx, vp);\n        int s;\n        const char* str;\n\n        s = JSVAL_TO_INT(argv[0]);\n        JSString* jsstr = JS_ValueToString(cx, argv[1]);\n        str = JS_EncodeString(cx, jsstr);\n\n        write(s, str, strlen(str));\n\n        JS_free(cx, (void*)str);\n    }\n    return JS_TRUE;\n}\n\nJSBool jsSocketClose(JSContext* cx, unsigned argc, jsval* vp)\n{\n    if (argc == 1) {\n        jsval* argv = JS_ARGV(cx, vp);\n        int s = JSVAL_TO_INT(argv[0]);\n        close(s);\n    }\n    return JS_TRUE;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/ScriptingCore.h.example",
    "content": "//\n//  ScriptingCore.h\n//  testmonkey\n//\n//  Created by Rolando Abarca on 3/14/12.\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n#ifndef __SCRIPTING_CORE_H__\n#define __SCRIPTING_CORE_H__\n\n#include <assert.h>\n#include \"cocos2d.h\"\n#include \"uthash.h\"\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n#include \"spidermonkey_specifics.h\"\n\nvoid js_log(const char *format, ...);\n\nusing namespace cocos2d;\n\ntypedef void (*sc_register_sth)(JSContext* cx, JSObject* global);\n\nvoid registerDefaultClasses(JSContext* cx, JSObject* global);\n\nclass ScriptingCore : public CCScriptEngineProtocol\n{\n\tJSRuntime *rt;\n\tJSContext *cx;\n\tJSObject  *global;\n\n\tScriptingCore();\npublic:\n\t~ScriptingCore();\n\n\tstatic ScriptingCore *getInstance() {\n\t\tstatic ScriptingCore instance;\n\t\treturn &instance;\n\t};\n\n\tlua_State* getLuaState(void) {}\n\n    /**\n     @brief Remove CCObject from lua state\n     @param object to remove\n     */\n\tvirtual void removeCCObjectByID(int n) {}\n    virtual void removeJSObjectByCCObject(void * cobj);\n\n    /**\n     @brief Remove Lua function handler\n     */\n\tvirtual void removeLuaHandler(int nHandler) {}\n\n    /**\n     @brief Add a path to find lua files in\n     @param path to be added to the Lua path\n     */\n\tvirtual void addSearchPath(const char* path) {}\n\n    /**\n     @brief Execute script code contained in the given string.\n     @param codes holding the valid script code that should be executed.\n     @return 0 if the string is excuted correctly.\n     @return other if the string is excuted wrongly.\n     */\n\tvirtual int executeString(const char* codes) {}\n\n    /**\n     @brief Execute a script file.\n     @param filename String object holding the filename of the script file that is to be executed\n     */\n    virtual  int executeScriptFile(const char* filename) {}\n\n    /**\n     @brief Execute a scripted global function.\n     @brief The function should not take any parameters and should return an integer.\n     @param functionName String object holding the name of the function, in the global script environment, that is to be executed.\n     @return The integer value returned from the script function.\n     */\n\tvirtual int executeGlobalFunction(const char* functionName) {}\n\n    /**\n     @brief Execute a function by handler\n     @param The function handler\n     @param Number of parameters\n     @return The integer value returned from the script function.\n     */\n\tvirtual int executeFunctionByHandler(int nHandler, int numArgs = 0) {}\n    virtual int executeFunctionWithIntegerData(int nHandler, int data, CCNode *self);\n    int executeFunctionWithObjectData(int nHandler, const char *name, JSObject *obj, CCNode *self);\n    virtual int executeFunctionWithFloatData(int nHandler, float data, CCNode *self);\n    virtual int executeFunctionWithBooleanData(int nHandler, bool data) {}\n    virtual int executeFunctionWithCCObject(int nHandler, CCObject* pObject, const char* typeName) {}\n    virtual int pushIntegerToLuaStack(int data) {}\n    virtual int pushFloatToLuaStack(int data) {}\n    virtual int pushBooleanToLuaStack(int data) {}\n    virtual int pushCCObjectToLuaStack(CCObject* pObject, const char* typeName) {}\n\n    // functions for excute touch event\n\tvirtual int executeTouchEvent(int nHandler, int eventType, CCTouch *pTouch) {}\n    virtual int executeTouchesEvent(int nHandler, int eventType, CCSet *pTouches, CCNode *self);\n\n    // execute a schedule function\n    virtual int executeSchedule(int nHandler, float dt, CCNode *self);\n\n    void executeJSFunctionWithThisObj(jsval thisObj, jsval callback, jsval data);\n\n\t/**\n\t * will eval the specified string\n\t * @param string The string with the javascript code to be evaluated\n\t * @param outVal The jsval that will hold the return value of the evaluation.\n\t * Can be NULL.\n\t */\n\tJSBool evalString(const char *string, jsval *outVal, const char *filename = NULL);\n\n\t/**\n\t * will run the specified string\n\t * @param string The path of the script to be run\n\t */\n\tJSBool runScript(const char *path, JSObject* glob = NULL, JSContext* cx_ = NULL);\n\n\t/**\n\t * initialize everything\n\t */\n\tvoid start();\n\n\t/**\n\t * will add the register_sth callback to the list of functions that need to be called\n\t * after the creation of the context\n\t */\n\tvoid addRegisterCallback(sc_register_sth callback);\n\n\t/**\n\t * Will create a new context. If one is already there, it will destroy the old context\n\t * and create a new one.\n\t */\n\tvoid createGlobalContext();\n\n    static void removeAllRoots(JSContext *cx);\n\n\n    int executeCustomTouchEvent(int eventType,\n                                CCTouch *pTouch, JSObject *obj, jsval &retval);\n    int executeCustomTouchEvent(int eventType,\n                                CCTouch *pTouch, JSObject *obj);\n    int executeCustomTouchesEvent(int eventType,\n                                  CCSet *pTouches, JSObject *obj);\n\t/**\n\t * @return the global context\n\t */\n\tJSContext* getGlobalContext() {\n\t\treturn cx;\n\t};\n\n\t/**\n\t * @param cx\n\t * @param message\n\t * @param report\n\t */\n\tstatic void reportError(JSContext *cx, const char *message, JSErrorReport *report);\n\n\t/**\n\t * Log something using CCLog\n\t * @param cx\n\t * @param argc\n\t * @param vp\n\t */\n\tstatic JSBool log(JSContext *cx, uint32_t argc, jsval *vp);\n\n\tJSBool setReservedSpot(uint32_t i, JSObject *obj, jsval value);\n\n\t/**\n\t * run a script from script :)\n\t */\n\tstatic JSBool executeScript(JSContext *cx, uint32_t argc, jsval *vp);\n\n\t/**\n\t * Force a cycle of GC\n\t * @param cx\n\t * @param argc\n\t * @param vp\n\t */\n\tstatic JSBool forceGC(JSContext *cx, uint32_t argc, jsval *vp);\n\tstatic JSBool dumpRoot(JSContext *cx, uint32_t argc, jsval *vp);\n\tstatic JSBool addRootJS(JSContext *cx, uint32_t argc, jsval *vp);\n\tstatic JSBool removeRootJS(JSContext *cx, uint32_t argc, jsval *vp);\n\n private:\n    void string_report(jsval val);\n};\n\n// some utility functions\n// to native\nlong long jsval_to_long_long(JSContext *cx, jsval v);\nstd::string jsval_to_std_string(JSContext *cx, jsval v);\n// you should free this pointer after you're done with it\nconst char* jsval_to_c_string(JSContext *cx, jsval v);\nCCPoint jsval_to_ccpoint(JSContext *cx, jsval v);\nCCRect jsval_to_ccrect(JSContext *cx, jsval v);\nCCSize jsval_to_ccsize(JSContext *cx, jsval v);\nccGridSize jsval_to_ccgridsize(JSContext *cx, jsval v);\nccColor4B jsval_to_cccolor4b(JSContext *cx, jsval v);\nccColor4F jsval_to_cccolor4f(JSContext *cx, jsval v);\nccColor3B jsval_to_cccolor3b(JSContext *cx, jsval v);\nCCArray* jsval_to_ccarray(JSContext* cx, jsval v);\njsval ccarray_to_jsval(JSContext* cx, CCArray *arr);\n// from native\njsval long_long_to_jsval(JSContext* cx, long long v);\njsval std_string_to_jsval(JSContext* cx, std::string& v);\njsval c_string_to_jsval(JSContext* cx, const char* v);\njsval ccpoint_to_jsval(JSContext* cx, CCPoint& v);\njsval ccrect_to_jsval(JSContext* cx, CCRect& v);\njsval ccsize_to_jsval(JSContext* cx, CCSize& v);\njsval ccgridsize_to_jsval(JSContext* cx, ccGridSize& v);\njsval cccolor4b_to_jsval(JSContext* cx, ccColor4B& v);\njsval cccolor4f_to_jsval(JSContext* cx, ccColor4F& v);\njsval cccolor3b_to_jsval(JSContext* cx, ccColor3B& v);\n\n// this is a server socket\nJSBool jsSocketOpen(JSContext* cx, unsigned argc, jsval* vp);\nJSBool jsSocketRead(JSContext* cx, unsigned argc, jsval* vp);\nJSBool jsSocketWrite(JSContext* cx, unsigned argc, jsval* vp);\nJSBool jsSocketClose(JSContext* cx, unsigned argc, jsval* vp);\n\n#endif\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/debugger.js.example",
    "content": "dbg = {};\ndbg.log = log;\n\nvar textCommandProcessor = {};\n\ntextCommandProcessor.break = function (str) {\n    var md = str.match(/^b(reak)?\\s+([^:]+):(\\d+)/);\n\n    if (!md) {\n        return ({commandname : \"break\",\n                 success : false,\n                 stringResult : \"command could not be parsed\"});\n    }\n\n\tvar scripts = dbg.scripts[md[2]],\n\ttmpScript = null;\n\tif (scripts) {\n\t\tvar breakLine = parseInt(md[3], 10),\n\t\toff = -1;\n\t\tfor (var n=0; n < scripts.length; n++) {\n\t\t\toffsets = scripts[n].getLineOffsets(breakLine);\n\t\t\tif (offsets.length > 0) {\n\t\t\t\toff = offsets[0];\n\t\t\t\ttmpScript = scripts[n];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (off >= 0) {\n\t\t\ttmpScript.setBreakpoint(off, breakpointHandler);\n            return ({commandname : \"break\",\n                     success : true,\n                     jsfilename : md[2],\n                     breakpointlinenumber : breakLine});\n\t\t} else {\n            return ({commandname : \"break\",\n                     success : false,\n                     stringResult : \"no valid offsets at that line\"});\n\t\t}\n\t} else {\n        return ({commandname : \"break\",\n                 success : false,\n                 jsfilename : md[2],\n                 stringResult : \"Invalid script name\"});\n\t}\n}\n\ntextCommandProcessor.info = function (str) {\n    var report = \"\";\n\n    var md = str.match(/^info\\s+(\\S+)/);\n\tif (md) {\n        report += \"info - NYI\";\n        report += \"\\nmd[0] = \" + md[0];\n        report += \"\\nmd[1] = \" + md[1];\n\n        return ({commandname : \"info\",\n                 success : true,\n                 stringResult : report});\n\t} else {\n        return ({commandname : \"info\",\n                 success : false,\n                 stringResult : report});\n    }\n}\n\ntextCommandProcessor.clear = function (str) {\n    var report = \"\";\n\n    report += \"clearing all breakpoints\";\n\n    dbg.dbg.clearAllBreakpoints();\n    return ({commandname : \"clear\",\n             success : true,\n             stringResult : report});\n}\n\ntextCommandProcessor.scripts = function (str) {\n\tvar report = \"List of available scripts\\n\";\n\treport += Object.keys(dbg.scripts).join(\"\\n\");\n\n    return ({commandname : \"scripts\",\n             success : true,\n             stringResult : report});\n}\n\ntextCommandProcessor.step = function (str, frame, script) {\n\tif (frame) {\n\t\tdbg.breakLine = script.getOffsetLine(frame.offset) + 1;\n\t\tframe.onStep = function () {\n\t\t\tstepFunction(frame, frame.script);\n\t\t\treturn undefined;\n\t\t};\n\t\tstop = true;\n\t\t_unlockVM();\n\n        return ({commandname : \"step\",\n                 success : true,\n                 stringResult : \"\"});\n\t} else {\n        return ({commandname : \"step\",\n                 success : false,\n                 stringResult : \"\"});\n    }\n}\n\ntextCommandProcessor.continue = function (str, frame, script) {\n\tif (frame) {\n\t\tframe.onStep = undefined;\n\t\tdbg.breakLine = 0;\n\t}\n\tstop = true;\n\t_unlockVM();\n\n    return ({commandname : \"continue\",\n             success : true,\n             stringResult : \"\"});\n}\n\ntextCommandProcessor.deval = function (str, frame, script) {\n\t// debugger eval\n\tvar md = str.match(/^deval\\s+(.+)/);\n\tif (md[1]) {\n\t\ttry {\n\t\t\tvar devalReturn = eval(md[1]);\n\t\t\tif (devalReturn) {\n                var stringreport = debugObject(devalReturn, true);\n                return ({commandname : \"deval\",\n                         success : true,\n                         stringResult : stringreport});\n\t\t\t}\n\t\t} catch (e) {\n            return ({commandname : \"deval\",\n                     success : false,\n                     stringResult : \"exception:\\n\" + e.message});\n\t\t}\n\t} else {\n        return ({commandname : \"deval\",\n                 success : false,\n                 stringResult : \"could not parse script to evaluate\"});\n    }\n\n}\n\ntextCommandProcessor.eval = function (str, frame, script) {\n    if (!frame) {\n        return ({commandname : \"eval\",\n                 success : false,\n                 stringResult : \"no frame to eval in\"});\n    }\n\n    var stringToEval = str.substring(4);\n\n\tif (stringToEval) {\n        try {\n\t\t    var evalResult = frame['eval'](\"JSON.stringify(eval(\" + stringToEval + \"));\");\n\t\t    if (evalResult && evalResult['return']) {\n                var stringreport = evalResult['return'];\n                // var stringreport = debugObject(evalResult['return']);\n                return ({commandname : \"eval\",\n                         success : true,\n                         stringResult : stringreport});\n            } else if (evalResult && evalResult['throw']) {\n                return ({commandname : \"eval\",\n                         success : false,\n                         stringResult : \"got exception: \" + evalResult['throw'].message});\n\t\t    } else {\n                return ({commandname : \"eval\",\n                         success : false,\n                         stringResult : \"invalid return from eval\"});\n\t\t    }\n        } catch (e) {\n            dbg.log(\"exception = \" + e);\n            return ({commandname : \"eval\",\n                     success : false,\n                     stringResult : \"Exception : \" + e});\n        }\n\t}\n}\n\ntextCommandProcessor.line = function (str, frame, script) {\n\tif (frame) {\n        try {\n            return ({commandname : \"line\",\n                     success : true,\n                     stringResult : script.getOffsetLine(frame.offset)});\n        } catch (e) {\n            return ({commandname : \"line\",\n                     success : false,\n                     stringResult : \"exception \" + e});\n        }\n\t}\n\n    return ({commandname : \"line\",\n             success : false,\n             // probably entering script\n             stringResult : \"NOLINE\"});\n}\n\ntextCommandProcessor.backtrace = function (str, frame, script) {\n\tif (!frame) {\n        return ({commandname : \"backtrace\",\n                 success : false,\n                 stringResult : \"no valid frame\"});\n    }\n\n    var result = \"\";\n\tvar cur = frame,\n\tstack = [cur.script.url + \":\" + cur.script.getOffsetLine(cur.offset)];\n\twhile ((cur = cur.older)) {\n\t\tstack.push(cur.script.url + \":\" + cur.script.getOffsetLine(cur.offset));\n\t}\n\tresult += stack.join(\"\\n\");\n\n    return ({commandname : \"backtrace\",\n             success : true,\n             stringResult : result});\n}\n\ntextCommandProcessor.uiresponse = function (str) {\n    var subcommandstring = (str.substring(\"uiresponse\".length)).replace(/\\s+/g, '');\n    var response = \"\";\n    switch (subcommandstring) {\n    case \"json\":\n        dbg.responder = jsonResponder;\n        response += \"DEBUGGER UI : responding with json messages\";\n        break;\n    case \"plaintext\":\n        dbg.responder = textResponder;\n        response += \"DEBUGGER UI : responding with plaintext messages\";\n        break;\n    }\n\n    // note : we return an empty string\n    // dbg.log(response);\n    return ({commandname : \"uiresponse\",\n             success : true,\n             stringResult : \"\"});\n}\n\ntextCommandProcessor.help = function () {\n    _printHelp();\n\n    return ({commandname : \"help\",\n             success : true,\n             stringResult : \"\"});\n}\n\ntextCommandProcessor.getCommandProcessor = function (str) {\n\t// break\n\tvar md = str.match(/[a-z]*/);\n    if (!md) {\n        return null;\n    }\n    switch (md[0]) {\n    case \"b\" :\n    case \"break\" :\n        return textCommandProcessor.break;\n    case \"info\" :\n        return textCommandProcessor.info;\n    case \"clear\" :\n        return textCommandProcessor.clear;\n    case \"scripts\" :\n        return textCommandProcessor.scripts;\n    case \"s\" :\n    case \"step\" :\n        return textCommandProcessor.step;\n    case \"c\" :\n    case \"continue\" :\n        return textCommandProcessor.continue;\n    case \"deval\" :\n        return textCommandProcessor.deval;\n    case \"eval\" :\n        return textCommandProcessor.eval;\n    case \"line\" :\n        return textCommandProcessor.line;\n    case \"bt\" :\n        return textCommandProcessor.backtrace;\n    case \"uiresponse\" :\n        return textCommandProcessor.uiresponse;\n    case \"help\" :\n        return textCommandProcessor.help;\n    default :\n        return null;\n    }\n}\n\n// JSON output\nvar jsonResponder = {};\n\njsonResponder.write = function (str) {\n    _bufferWrite(str);\n    _bufferWrite(\"\\n\");\n    _bufferWrite(String.fromCharCode(23));\n}\n\njsonResponder.onBreakpoint = function (filename, linenumber) {\n    var response = {\"from\" : \"server\",\n                    \"why\" : \"onBreakpoint\",\n                    \"data\" : {\"jsfilename\" : filename,\n                              \"linenumber\" : linenumber}};\n\n    this.write(JSON.stringify(response));\n}\n\njsonResponder.onStep = function (filename, linenumber) {\n    var response = {\"from\" : \"server\",\n                    \"why\" : \"onStep\",\n                    \"data\" : {\"jsfilename\" : filename,\n                              \"linenumber\" : linenumber}};\n\n    this.write(JSON.stringify(response));\n}\n\njsonResponder.commandResponse = function (commandresult) {\n    var response = {\"from\" : \"server\",\n                    \"why\" : \"commandresponse\",\n                    \"data\" : commandresult};\n\n    this.write(JSON.stringify(response));\n}\n\njsonResponder.commandNotFound = function () {\n    // do nothing\n}\n\n// Plain Old Text output\nvar textResponder = {};\n\ntextResponder.write = function (str) {\n    _bufferWrite(str);\n    _bufferWrite(\"\\n\");\n    _bufferWrite(String.fromCharCode(23));\n}\n\ntextResponder.onBreakpoint = function (filename, linenumber) {\n    var shortFilename = filename.substring(filename.lastIndexOf(\"/\") + 1);\n    var response = \"Breakpoint hit at \" + shortFilename + \" line number : \" + linenumber;\n    this.write(response);\n}\n\ntextResponder.onStep = function (filename, linenumber) {\n    var shortFilename = filename.substring(filename.lastIndexOf(\"/\") + 1);\n    var response = \"Stopped at \" + shortFilename + \" line number : \" + linenumber;\n    this.write(response);\n}\n\ntextResponder.commandResponse = function (commandresult) {\n    var response = \"\";\n\n    try {\n        switch (commandresult.commandname) {\n        case \"break\" :\n            if (!commandresult.success) {\n                response += \"ERROR : \" + commandresult.stringResult;\n            }\n            break;\n        case \"info\" :\n            if (!commandresult.success) {\n                response += \"ERROR : \" + commandresult.stringResult;\n            }\n            break;\n        case \"clear\" :\n            break;\n        case \"scripts\" :\n            if (true === commandresult.success) {\n                response += commandresult.stringResult;\n            }\n            break;\n        case \"step\" :\n            if (!commandresult.success) {\n                response += \"ERROR : step failed \" + commandresult.stringResult;\n            }\n            break;\n        case \"continue\" :\n            if (!commandresult.success) {\n                response += \"ERROR : continue failed \" + commandresult.stringResult;\n            }\n            break;\n        case \"deval\" :\n            if (true === commandresult.success) {\n                response += commandresult.stringResult;\n            } else {\n                response += \"ERROR : deval failed \" + commandresult.stringResult;\n            } \n            break;\n        case \"eval\" :\n            if (true === commandresult.success) {\n                response += commandresult.stringResult;\n            } else {\n                response += \"ERROR : eval failed \" + commandresult.stringResult;\n            } \n            break;\n        case \"line\" :\n            if (true === commandresult.success) {\n                response += commandresult.stringResult;\n            } else {\n                response += \"ERROR : \" + commandresult.stringResult;\n            } \n            break;\n        case \"backtrace\" :\n            if (true === commandresult.success) {\n                response += commandresult.stringResult;\n            } else {\n                response += \"ERROR : \" + commandresult.stringResult;\n            } \n            break;\n        case \"help\" :\n            break;\n        }\n    } catch (e) {\n        response += \"\\nException logging response \" + e;\n    }\n\n    this.write(response);\n}\n\ntextResponder.commandNotFound = function () {\n    _printCommandNotFound();\n}\n\nvar breakpointHandler = {\n\thit: function (frame) {\n        try {\n            dbg.responder.onBreakpoint(frame.script.url, frame.script.getOffsetLine(frame.offset));\n        } catch (e) {\n            dbg.log(\"exception \" + e);\n        }\n\n\t\tvar script = frame.script;\n\t\t_lockVM(frame, frame.script);\n\t}\n};\n\nvar stepFunction = function (frame, script) {\n\tif (dbg.breakLine > 0) {\n\t\tvar curLine = script.getOffsetLine(frame.offset);\n\t\tif (curLine < dbg.breakLine) {\n\t\t\treturn;\n\t\t} else {\n            try {\n                dbg.responder.onStep(frame.script.url, frame.script.getOffsetLine(frame.offset));\n            } catch (e) {\n                dbg.log(\"exception \" + e);\n            }\n\n\t\t\t_lockVM(frame, script);\n\t\t\t// dbg.breakLine = 0;\n\t\t\t// frame.onStep = undefined;\n\t\t}\n\t} else {\n\t\tdbg.log(\"invalid state onStep\");\n\t}\n};\n\nvar debugObject = function (r, isNormal) {\n    var stringres = \"\";\n    try {\n\t    stringres += \"* \" + (typeof r) + \"\\n\";\n\t    if (typeof r != \"object\") {\n\t\t    stringres += \"~> \" + r + \"\\n\";\n\t    } else {\n\t\t    var props;\n\t\t    if (isNormal) {\n\t\t\t    props = Object.keys(r);\n\t\t    } else {\n\t\t\t    props = r.getOwnPropertyNames();\n\t\t    }\n\t\t    for (k in props) {\n\t\t\t    var desc = r.getOwnPropertyDescriptor(props[k]);\n\t\t\t    stringres += \"~> \" + props[k] + \" = \";\n\t\t\t    if (desc.value) {\n\t\t\t\t    stringres += \"\" + desc.value;\n\t\t\t    } else if (desc.get) {\n\t\t\t\t    stringres += \"\" + desc.get();\n\t\t\t    } else {\n\t\t\t\t    stringres += \"undefined (no value or getter)\";\n\t\t\t    }\n\t\t\t    stringres += \"\\n\";\n\t\t    }\n        }\n\n        return stringres;\n\t} catch (e) {\n        return (\"Exception when accessing object properties = \" + e);\n    }\n}\n\ndbg.breakLine = 0;\n\nthis.processInput = function (inputstr, frame, script) {\n    var command_func;\n    var command_return;\n\tvar commands_array = [];\n    var _command;\n    var i;\n\n    if (!inputstr) {\n        return;\n    }\n\n    // remove Carriage Return's\n\tinputstr = inputstr.replace(/\\r+/, \"\");\n\n    // split into an array using Line Feed as the delimiter\n    commands_array = inputstr.split(\"\\n\");\n\n    // trace the commands received\n    // dbg.log(\"received \" + commands_array.length + \" commands:\");\n    // for (i = 0; i < commands_array.length; i++) {\n    //     if (i in commands_array) {\n    //         dbg.log(\"~~~ commandstring =\" + commands_array[i]);\n    //         dbg.log(\"    commandstring.length = \" + commands_array[i].length);\n    //     }\n    // }\n\n    for (i = 0; i < commands_array.length; i++) {\n        if (i in commands_array) {\n            _command = commands_array[i];\n\n\t        if (_command === \"\") {\n                // dbg.log(\"Empty input. Ignoring.\");\n\t        } else {\n                // dbg.log(_command);\n\n                command_func = dbg.getCommandProcessor(_command);\n\n                if (!command_func) {\n                    dbg.log(\"did not find a command processor!\");\n                    dbg.responder.commandNotFound();\n                } else {\n                    try {\n                        command_return = command_func(_command, frame, script);\n                        if (true === command_return.success) {\n                            dbg.responder.commandResponse(command_return);\n                        } else {\n                            dbg.log(\"command failed. return value = \" + command_return.stringResult);\n                            dbg.responder.commandResponse(command_return);\n                        }\n                    } catch (e) {\n                        dbg.log(\"Exception in command processing. e =\\n\" + e  + \"\\n\");\n                        var _output = {success : false,\n                                       commandname : command_func.name,\n                                       stringResult : e};\n                        dbg.responder.commandResponse(_output);\n                    }\n                }\n            }\n        }\n    }\n};\n\n_printCommandNotFound = function() {\n\tvar str = \"ERROR : command not found!\\n\";\n\t_bufferWrite(str);\n};\n\n_printHelp = function() {\n\tvar help = \"break filename:numer\\tAdds a breakpoint at a given filename and line number\\n\" +\n\t\t\"clear\\tClear all breakpoints\\n\" +\n\t\t\"c / continue\\tContinues the execution\\n\" +\n\t\t\"s / step\\tStep\\n\" +\n\t\t\"bt\\tBacktrace\\n\" +\n\t\t\"scripts\\tShow the scripts\\n\" +\n\t\t\"line\\tShows current line\\n\" +\n\t\t\"eval js_command\\tEvaluates JS code\\n\" +\n\t\t\"deval js_command\\tEvaluates JS Debugger command\\n\" +\n\t\t\"uiresponse [json|plaintext] Switch between JSON and plaintext output from the debugger\\n\";\n\t_bufferWrite(help);\n};\n\ndbg.scripts = [];\n\ndbg.onNewScript = function (script) {\n\t// skip if the url is this script\n\tvar last = script.url.split(\"/\").pop();\n\n\tvar children = script.getChildScripts(),\n\tarr = [script].concat(children);\n\t/**\n\t * just dumping all the offsets from the scripts\n\t for (var i in arr) {\n\t dbg.log(\"script: \" + arr[i].url);\n\t for (var start=arr[i].startLine, j=start; j < start+arr[i].lineCount; j++) {\n\t var offsets = arr[i].getLineOffsets(j);\n\t dbg.log(\"  off: \" + offsets.join(\",\") + \"; line: \" + j);\n\t }\n\t }\n\t*/\n\tdbg.scripts[last] = arr;\n};\n\ndbg.onError = function (frame, report) {\n\tif (dbg.socket && report) {\n\t\t_socketWrite(dbg.socket, \"!! exception @ \" + report.file + \":\" + report.line);\n\t}\n\tdbg.log(\"!! exception\");\n};\n\nthis._prepareDebugger = function (global) {\n\tvar tmp = new Debugger(global);\n\ttmp.onNewScript = dbg.onNewScript;\n\ttmp.onDebuggerStatement = dbg.onDebuggerStatement;\n\ttmp.onError = dbg.onError;\n\tdbg.dbg = tmp;\n\n    // use the text command processor at startup\n    dbg.getCommandProcessor = textCommandProcessor.getCommandProcessor;\n\n    // use the text responder at startup\n    dbg.responder = textResponder;\n};\n\nthis._startDebugger = function (global, files, startFunc) {\n\t// dbg.log(\"[DBG] starting debug session\");\n\tfor (var i in files) {\n\t\ttry {\n\t\t\tglobal['eval'](\"require('\" + files[i] + \"');\");\n\t\t} catch (e) {\n\t\t\tdbg.log(\"[DBG] error evaluating file: \" + files[i]);\n\t\t}\n\t}\n\t// dbg.log(\"[DBG] all files required\");\n\tif (startFunc) {\n\t\t// dbg.log(\"executing start func: \" + startFunc);\n\t\tglobal['eval'](startFunc);\n\t}\n\t// beginDebug();\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/helper.js.example",
    "content": "// cocos2d Helper\n\ncc.c3 = cc.c3 || function (r, g, b) {\n\treturn {r: r, g: g, b: b};\n};\n\ncc.c4 = cc.c4 || function (r, g, b, o) {\n\treturn {r: r, g: g, b: b, a: o};\n};\n\ncc.c4f = cc.c4f || function (r, g, b, o) {\n\treturn {r: r, g: g, b: b, a: o};\n};\n\ncc.p = cc.p || function( x, y )\n{\n    return {x:x, y:y};\n};\n\ncc.g = cc.g || cc.p;\ncc.log = cc.log || log;\n\n//\n// cocos2d constants\n//\ncc.TEXTURE_PIXELFORMAT_RGBA8888 = 0;\ncc.TEXTURE_PIXELFORMAT_RGB888 = 1;\ncc.TEXTURE_PIXELFORMAT_RGB565 = 2;\ncc.TEXTURE_PIXELFORMAT_A8 = 3;\ncc.TEXTURE_PIXELFORMAT_I8 = 4;\ncc.TEXTURE_PIXELFORMAT_AI88 = 5;\ncc.TEXTURE_PIXELFORMAT_RGBA4444 = 6;\ncc.TEXTURE_PIXELFORMAT_RGB5A1 = 7;\ncc.TEXTURE_PIXELFORMAT_PVRTC4 = 8;\ncc.TEXTURE_PIXELFORMAT_PVRTC4 = 9;\ncc.TEXTURE_PIXELFORMAT_DEFAULT = cc.TEXTURE_PIXELFORMAT_RGBA8888;\n\ncc.TEXT_ALIGNMENT_LEFT  = 0;\ncc.TEXT_ALIGNMENT_CENTER = 1;\ncc.TEXT_ALIGNMENT_RIGHT = 2;\n\ncc.VERTICAL_TEXT_ALIGNMENT_TOP = 0;\ncc.VERTICAL_TEXT_ALIGNMENT_CENTER = 1;\ncc.VERTICAL_TEXT_ALIGNMENT_BOTTOM = 2;\n\ncc.IMAGE_FORMAT_JPEG = 0;\ncc.IMAGE_FORMAT_PNG = 0;\n\ncc.PROGRESS_TIMER_TYPE_RADIAL = 0;\ncc.PROGRESS_TIMER_TYPE_BAR = 1;\n\ncc.PARTICLE_TYPE_FREE = 0;\ncc.PARTICLE_TYPE_RELATIVE = 1;\ncc.PARTICLE_TYPE_GROUPED = 2;\ncc.PARTICLE_DURATION_INFINITY = -1;\ncc.PARTICLE_MODE_GRAVITY = 0;\ncc.PARTICLE_MODE_RADIUS = 1;\ncc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE = -1;\ncc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS = -1;\n\ncc.RED = cc.c3(255,0,0);\ncc.GREEN = cc.c3(0,255,0);\ncc.BLUE = cc.c3(0,0,255);\ncc.BLACK = cc.c3(0,0,0);\ncc.WHITE = cc.c3(255,255,255);\n\ncc.POINT_ZERO = {x:0, y:0};\n\ncc._reuse_p0 = {x:0, y:0};\ncc._reuse_p1 = {x:0, y:0};\ncc._reuse_p_index = 0;\ncc._reuse_color3b = cc.c3(255, 255, 255 );\ncc._reuse_color4b = cc.c4(255, 255, 255, 255 );\ncc._reuse_grid = cc.g(0,0);\n\n// dump config info, but only in debug mode\ncc.dumpConfig = function()\n{\n    if( cc.config.debug ) {\n        for(var i in cc.config)\n            cc.log( i + \" = \" + cc.config[i] );\n    }\n};\n\n//\n// Point\n//\ncc._p = function( x, y )\n{\n    if( cc._reuse_p_index === 0 ) {\n        cc._reuse_p0.x = x;\n        cc._reuse_p0.y = y;\n        cc._reuse_p_index = 1;\n        return cc._reuse_p0;\n    } else {\n        cc._reuse_p1.x = x;\n        cc._reuse_p1.y = y;\n        cc._reuse_p_index = 0;\n        return cc._reuse_p1;\n    }\n};\n\ncc._to_p = function( point )\n{\n    return point;\n};\n\ncc._from_p = function( size )\n{\n    return size;\n};\n\n//\n// Grid \n//\ncc._g = function( x, y )\n{\n    cc._reuse_grid.x = x;\n    cc._reuse_grid.y = y;\n    return cc._reuse_grid;\n}\n\n//\n// Color\n//\ncc._c3 = function( r, g, b )\n{\n    cc._reuse_color3b[0] = r;\n    cc._reuse_color3b[1] = g;\n    cc._reuse_color3b[2] = b;\n    return cc._reuse_color3b;\n}\n\ncc._c4 = function( r, g, b, a )\n{\n    cc._reuse_color4b[0] = r;\n    cc._reuse_color4b[1] = g;\n    cc._reuse_color4b[2] = b;\n    cc._reuse_color4b[3] = a;\n    return cc._reuse_color4b;\n}\n\n//\n// Size\n//\ncc.size = function(w,h)\n{\n    return {width:w, height:h};\n}\n\ncc._to_size = function( size )\n{\n    return size;\n}\n\ncc._from_size = function( size )\n{\n    return size;\n}\n\n//\n// Rect\n//\ncc.rect = function(x,y,w,h)\n{\n    return {x:x, y:y, width:w, height:h};\n}\n\ncc._to_rect = function( rect )\n{\n    return rect;\n}\n\ncc._from_rect = function( rect )\n{\n    return rect;\n}\n\n// XXX Should be done in native\ncc.rectIntersectsRect = function( rectA, rectB )\n{\n    var bool = ! (  rectA.x > rectB.x + rectB.width ||\n                    rectA.x + rectA.width < rectB.x ||\n                    rectA.y > rectB.y +rectB.height ||\n                    rectA.y + rectA.height < rectB.y );\n\n    return bool;\n}\n\n// point functions\ncc.pAdd = cc.pAdd || function (p1, p2) {\n    return {x: p1.x + p2.x, y: p1.y + p2.y};\n};\n\ncc.pSub = cc.pSub || function (p1, p2) {\n    return {x: p1.x - p2.x, y: p1.y - p2.y};\n}\n\ncc.pMult = cc.pMult || function (p1, s) {\n    return {x: p1.x * s, y: p1.y * s};\n};\n\n//\n// Array: for cocos2d-hmtl5 compatibility\n//\ncc.ArrayRemoveObject = function (arr, delObj) {\n    for (var i = 0; i < arr.length; i++) {\n        if (arr[i] == delObj) {\n            arr.splice(i, 1);\n        }\n    }\n};\n\n//\n// Google \"subclasses\"\n// borrowed from closure library\n//\nvar goog = goog || {}; // Check to see if already defined in current scope\ngoog.inherits = function (childCtor, parentCtor) {\n\t/** @constructor */\n\tfunction tempCtor() {};\n\ttempCtor.prototype = parentCtor.prototype;\n\tchildCtor.superClass_ = parentCtor.prototype;\n\tchildCtor.prototype = new tempCtor();\n\tchildCtor.prototype.constructor = childCtor;\n\n\t// Copy \"static\" method, but doesn't generate subclasses.\n//\tfor( var i in parentCtor ) {\n//\t\tchildCtor[ i ] = parentCtor[ i ];\n//\t}\n};\ngoog.base = function(me, opt_methodName, var_args) {\n\tvar caller = arguments.callee.caller;\n\tif (caller.superClass_) {\n\t\t// This is a constructor. Call the superclass constructor.\n\t\tret =  caller.superClass_.constructor.apply( me, Array.prototype.slice.call(arguments, 1));\n\n\t\t// XXX: SpiderMonkey bindings extensions\n//\t\t__associateObjWithNative( me, ret );\n\t\treturn ret;\n\t}\n\n\tvar args = Array.prototype.slice.call(arguments, 2);\n\tvar foundCaller = false;\n\tfor (var ctor = me.constructor;\n\t\t ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) {\n\t\tif (ctor.prototype[opt_methodName] === caller) {\n\t\t\tfoundCaller = true;\n\t\t} else if (foundCaller) {\n\t\t\treturn ctor.prototype[opt_methodName].apply(me, args);\n\t\t}\n\t}\n\n\t// If we did not find the caller in the prototype chain,\n\t// then one of two things happened:\n\t// 1) The caller is an instance method.\n\t// 2) This method was not called by the right caller.\n\tif (me[opt_methodName] === caller) {\n\t\treturn me.constructor.prototype[opt_methodName].apply(me, args);\n\t} else {\n\t\tthrow Error(\n\t\t\t\t\t'goog.base called from a method of one name ' +\n\t\t\t\t\t'to a method of a different name');\n\t}\n};\n\n\n//\n// Simple subclass\n//\n\ncc.Class = function(){};\n\ncc.Class.extend = function (prop) {\n    var _super = this.prototype;\n\n    // Instantiate a base class (but only create the instance,\n    // don't run the init constructor)\n    initializing = true;\n    var prototype = new this();\n    initializing = false;\n    fnTest = /xyz/.test(function(){xyz;}) ? /\\b_super\\b/ : /.*/;\n\n    // Copy the properties over onto the new prototype\n    for (var name in prop) {\n        // Check if we're overwriting an existing function\n        prototype[name] = typeof prop[name] == \"function\" &&\n            typeof _super[name] == \"function\" && fnTest.test(prop[name]) ?\n            (function (name, fn) {\n                return function () {\n                    var tmp = this._super;\n\n                    // Add a new ._super() method that is the same method\n                    // but on the super-class\n                    this._super = _super[name];\n\n                    // The method only need to be bound temporarily, so we\n                    // remove it when we're done executing\n                    var ret = fn.apply(this, arguments);\n                    this._super = tmp;\n\n                    return ret;\n                };\n            })(name, prop[name]) :\n            prop[name];\n    }\n\n    // The dummy class constructor\n    function Class() {\n        // All construction is actually done in the init method\n        if (!initializing && this.ctor)\n            this.ctor.apply(this, arguments);\n    }\n\n    // Populate our constructed prototype object\n    Class.prototype = prototype;\n\n    // Enforce the constructor to be what we expect\n    Class.prototype.constructor = Class;\n\n    // And make this class extendable\n    Class.extend = arguments.callee;\n\n    return Class;\n};\n\ncc.Layer.extend = cc.Class.extend;\ncc.LayerGradient.extend = cc.Class.extend;\ncc.Sprite.extend = cc.Class.extend;\ncc.MenuItemFont.extend = cc.Class.extend;\n\n//\n// Chipmunk helpers\n//\nvar cp = cp || {};\n\ncp.v = cc.p;\ncp._v = cc._p;\ncp.vzero  = cp.v(0,0);\n\n//\n// OpenGL Helpers\n//\nvar gl = gl || {};\ngl.NEAREST                      = 0x2600;\ngl.LINEAR                       = 0x2601;\ngl.REPEAT                       = 0x2901;\ngl.CLAMP_TO_EDGE                = 0x812F;\ngl.CLAMP_TO_BORDER              = 0x812D;\ngl.LINEAR_MIPMAP_NEAREST        = 0x2701;\ngl.NEAREST_MIPMAP_NEAREST       = 0x2700;\ngl.ZERO                         = 0;\ngl.ONE                          = 1;\ngl.SRC_COLOR                    = 0x0300;\ngl.ONE_MINUS_SRC_COLOR          = 0x0301;\ngl.SRC_ALPHA                    = 0x0302;\ngl.ONE_MINUS_SRC_ALPHA          = 0x0303;\ngl.DST_ALPHA                    = 0x0304;\ngl.ONE_MINUS_DST_ALPHA          = 0x0305;\ngl.DST_COLOR                    = 0x0306;\ngl.ONE_MINUS_DST_COLOR          = 0x0307;\ngl.SRC_ALPHA_SATURATE           = 0x0308;\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/js_bindings_config.h.example",
    "content": "//\n//  Created by Rohan Kuruvilla\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n\n#ifndef __JS_BINDINGS_CONFIG_H\n#define __JS_BINDINGS_CONFIG_H\n\n\n/** @def JSB_ASSERT_ON_FAIL\n */\n#ifndef JSB_ASSERT_ON_FAIL\n#define JSB_ASSERT_ON_FAIL 0\n#endif\n\n\n#if JSB_ASSERT_ON_FAIL\n#define JSB_PRECONDITION( condition, error_msg) do { assert( condition, error_msg ) } while(0)\n#else\n#define JSB_PRECONDITION(condition, error_msg) do {\t\t\t\t\t\t\t\\\n\tif( ! (condition) ) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\tCCLOG(\"jsb: ERROR in %s: %s\", __FUNCTION__, error_msg);\t\t\t\t\\\n\t\treturn JS_FALSE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n} while(0)\n#endif\n\n#endif // __JS_BINDINGS_CONFIG_H\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/js_manual_conversions.cpp.example",
    "content": "//\n//  Created by Rohan Kuruvilla\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n#include <inttypes.h>\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n#include \"ScriptingCore.h\"\n#include \"js_bindings_config.h\"\n#include \"js_manual_conversions.h\"\n//#include \"android/log.h\"\n\n#define APPNAME \"jstest\"\n#define JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n\n//#include \"js_bindings_NS_manual.h\"\n\n\nJSBool jsval_to_CCPoint( JSContext *cx, jsval vp, CCPoint *ret )\n{\n#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *jsobj;\n\tif( ! JS_ValueToObject( cx, vp, &jsobj ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( jsobj, \"Not a valid JS object\");\n    \n\tjsval valx, valy;\n\tJSBool ok = JS_TRUE;\n\tok &= JS_GetProperty(cx, jsobj, \"x\", &valx);\n\tok &= JS_GetProperty(cx, jsobj, \"y\", &valy);\n    \n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tdouble x, y;\n\tok &= JS_ValueToNumber(cx, valx, &x);\n\tok &= JS_ValueToNumber(cx, valy, &y);\n\t\n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tret->x = x;\n\tret->y = y;\n    \n\treturn JS_TRUE;\n    \n#else // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *tmp_arg;\n\tif( ! JS_ValueToObject( cx, vp, &tmp_arg ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( tmp_arg && JS_IsTypedArrayObject( tmp_arg, cx ), \"Not a TypedArray object\");\n\t\n\tJSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg, cx ) == sizeof(CGPoint), \"Invalid length\");\n\t\n\t*ret = *(CCPoint*)JS_GetArrayBufferViewData( tmp_arg, cx );\n\t\n\treturn JS_TRUE;\n#endif // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n}\n\n\nJSBool jsval_to_CGPoint( JSContext *cx, jsval vp, CGPoint *ret )\n{\n#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *jsobj;\n\tif( ! JS_ValueToObject( cx, vp, &jsobj ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( jsobj, \"Not a valid JS object\");\n    \n\tjsval valx, valy;\n\tJSBool ok = JS_TRUE;\n\tok &= JS_GetProperty(cx, jsobj, \"x\", &valx);\n\tok &= JS_GetProperty(cx, jsobj, \"y\", &valy);\n    \n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tdouble x, y;\n\tok &= JS_ValueToNumber(cx, valx, &x);\n\tok &= JS_ValueToNumber(cx, valy, &y);\n\t\n\tif( ! ok )\n\t\treturn JS_FALSE;\n\t\n\tret->x = x;\n\tret->y = y;\n    \n\treturn JS_TRUE;\n    \n#else // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *tmp_arg;\n\tif( ! JS_ValueToObject( cx, vp, &tmp_arg ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( tmp_arg && JS_IsTypedArrayObject( tmp_arg, cx ), \"Not a TypedArray object\");\n\t\n\tJSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg, cx ) == sizeof(CGPoint), \"Invalid length\");\n\t\n\t*ret = *(CGPoint*)JS_GetArrayBufferViewData( tmp_arg, cx );\n\t\n\treturn JS_TRUE;\n#endif // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n}\n\n\njsval CGPoint_to_jsval( JSContext *cx, CGPoint p)\n{\n\t\n#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n    \n\tJSObject *object = JS_NewObject(cx, NULL, NULL, NULL );\n\tif (!object)\n\t\treturn JSVAL_VOID;\n    \n\tif (!JS_DefineProperty(cx, object, \"x\", DOUBLE_TO_JSVAL(p.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||\n\t\t!JS_DefineProperty(cx, object, \"y\", DOUBLE_TO_JSVAL(p.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) )\n\t\treturn JSVAL_VOID;\n\t\n\treturn OBJECT_TO_JSVAL(object);\n    \n#else // JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n\t\n#ifdef __LP64__\n\tJSObject *typedArray = JS_NewFloat64Array( cx, 2 );\n#else\n\tJSObject *typedArray = JS_NewFloat32Array( cx, 2 );\n#endif\n    \n\tCGPoint *buffer = (CGPoint*)JS_GetArrayBufferViewData(typedArray, cx );\n\t*buffer = p;\n\treturn OBJECT_TO_JSVAL(typedArray);\n#endif // ! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES\n}\n\n\nJSBool jsval_to_opaque( JSContext *cx, jsval vp, void **r)\n{\n#ifdef __LP64__\n\tJSObject *tmp_arg;\n\tif( ! JS_ValueToObject( cx, vp, &tmp_arg ) )\n\t\treturn JS_FALSE;\n\n\tJSB_PRECONDITION( js_IsTypedArray( tmp_arg ), \"jsb: Not a TypedArray object\");\n\n\tJSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(void*), \"jsb: Invalid Typed Array lenght\");\n\t\n\tint32_t* arg_array = (int32_t*)JS_GetTypedArrayData( tmp_arg );\n\tuint64 ret =  arg_array[0];\n\tret = ret << 32;\n\tret |= arg_array[1];\n\t\n#else\n\tassert( sizeof(int)==4);\n\tint32_t ret;\n\tif( ! JS_ValueToInt32(cx, vp, &ret ) )\n\t  return JS_FALSE;\n#endif\n\t*r = (void*)ret;\n\treturn JS_TRUE;\n}\n\nJSBool jsval_to_int( JSContext *cx, jsval vp, int *ret )\n{\n\t// Since this is called to cast uint64 to uint32,\n\t// it is needed to initialize the value to 0 first\n#ifdef __LP64__\n\tlong *tmp = (long*)ret;\n\t*tmp = 0;\n#endif\n\treturn JS_ValueToInt32(cx, vp, (int32_t*)ret);\n}\n\n// XXX: sizeof(long) == 8 in 64 bits on OS X... apparently on Windows it is 32 bits (???)\nJSBool jsval_to_long( JSContext *cx, jsval vp, long *r )\n{\n#ifdef __LP64__\n\t// compatibility check\n\tassert( sizeof(long)==8);\n\tJSObject *tmp_arg;\n\tif( ! JS_ValueToObject( cx, vp, &tmp_arg ) )\n\t\treturn JS_FALSE;\n\n\tJSB_PRECONDITION( js_IsTypedArray( tmp_arg ), \"jsb: Not a TypedArray object\");\n\n\tJSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg ) == sizeof(long), \"jsb: Invalid Typed Array lenght\");\n\t\n\tint32_t* arg_array = (int32_t*)JS_GetTypedArrayData( tmp_arg );\n\tlong ret =  arg_array[0];\n\tret = ret << 32;\n\tret |= arg_array[1];\n\t\n#else\n\t// compatibility check\n\tassert( sizeof(int)==4);\n\tlong ret = JSVAL_TO_INT(vp);\n#endif\n\t\n\t*r = ret;\n\treturn JS_TRUE;\n}\n\nJSBool jsval_to_longlong( JSContext *cx, jsval vp, long long *r )\n{\n\tJSString *jsstring = JS_ValueToString(cx, vp);\n\tJSB_PRECONDITION(jsstr, \"Error converting value to string\");\n\n\tchar *cstr = JS_EncodeString(cx, jsstring);\n\tJSB_PRECONDITION(cstr, \"Error encoding string\");\n\t\n\tlong long ret = stroll(cstr, NULL, 10);\n\t\n\t*r = ret;\n\treturn JS_TRUE;\n}\n\n\njsval opaque_to_jsval( JSContext *cx, void *opaque )\n{\n#ifdef __LP64__\n\tuint64_t number = (uint64_t)opaque;\n\tJSObject *typedArray = js_CreateTypedArray(cx, js::TypedArray::TYPE_UINT32, 2);\n\tint32_t *buffer = (int32_t*)JS_GetTypedArrayData(typedArray);\n\tbuffer[0] = number >> 32;\n\tbuffer[1] = number & 0xffffffff;\n\treturn OBJECT_TO_JSVAL(typedArray);\t\t\n#else\n\tassert(sizeof(int)==4);\n\tint32_t number = (int32_t) opaque;\n\treturn INT_TO_JSVAL(number);\n#endif\n}\n\njsval int_to_jsval( JSContext *cx, int number )\n{\n\treturn INT_TO_JSVAL(number);\n}\n\njsval long_to_jsval( JSContext *cx, long number )\n{\n#ifdef __LP64__\n\tassert( sizeof(long)==8);\n\n\tJSObject *typedArray = js_CreateTypedArray(cx, js::TypedArray::TYPE_UINT32, 2);\n\tint32_t *buffer = (int32_t*)JS_GetTypedArrayData(typedArray);\n\tbuffer[0] = number >> 32;\n\tbuffer[1] = number & 0xffffffff;\n\treturn OBJECT_TO_JSVAL(typedArray);\t\t\n#else\n\tassert( sizeof(int)==4);\n\treturn INT_TO_JSVAL(number);\n#endif\n}\n\n//#ifdef JSB_USE_CHIPMUNK\n\nJSBool jsval_to_cpBB( JSContext *cx, jsval vp, cpBB *ret )\n{\n\tJSObject *tmp_arg;\n\tif( ! JS_ValueToObject( cx, vp, &tmp_arg ) )\n\t\treturn JS_FALSE;\n\t\n\tJSB_PRECONDITION( JS_IsTypedArrayObject( tmp_arg, cx ), \"Not a TypedArray object\");\n\t\n\tJSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg, cx ) == sizeof(cpFloat)*4, \"Invalid length\");\n\t\n\t*ret = *(cpBB*)JS_GetArrayBufferViewData( tmp_arg, cx);\n    \n\treturn JS_TRUE;\n}\n\njsval cpBB_to_jsval(JSContext *cx, cpBB bb )\n{\n#ifdef __LP64__\n\tJSObject *typedArray = JS_NewFloat64Array( cx, 4 );\n#else\n\tJSObject *typedArray = JS_NewFloat32Array( cx, 4 );\n#endif\n\tcpBB *buffer = (cpBB*)JS_GetArrayBufferViewData(typedArray, cx);\n\t\n\t*buffer = bb;\n\treturn OBJECT_TO_JSVAL(typedArray);\n}\n\n//#endif\n\njsval longlong_to_jsval( JSContext *cx, long long number )\n{\n\tchar chr[128];\n\tsnprintf(chr, sizeof(chr)-1, \"%lld\", number);\n\tJSString *ret_obj = JS_NewStringCopyZ(cx, chr);\n\treturn STRING_TO_JSVAL(ret_obj);\n}\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/js_manual_conversions.h.example",
    "content": "//\n//  Created by Rohan Kuruvilla\n//  Copyright (c) 2012 Zynga Inc. All rights reserved.\n//\n\n#include \"chipmunk.h\"\n#include \"cocos2d.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n  \nJSBool jsval_to_opaque( JSContext *cx, jsval vp, void **out );\nJSBool jsval_to_int( JSContext *cx, jsval vp, int *out);\nJSBool jsval_to_long( JSContext *cx, jsval vp, long *out);\nJSBool jsval_to_longlong( JSContext *cx, jsval vp, long long *out);\t\n\t\nJSBool jsval_to_CGPoint( JSContext *cx, jsval vp, cpVect *out );\n\njsval CGPoint_to_jsval( JSContext *cx, cpVect p );\nJSBool jsval_to_CCPoint( JSContext *cx, jsval vp, CCPoint *ret );\n\njsval int_to_jsval( JSContext *cx, int l);\njsval long_to_jsval( JSContext *cx, long l);\njsval longlong_to_jsval( JSContext *cx, long long l);\njsval opaque_to_jsval( JSContext *cx, void* opaque);\n\t\n\t\n    JSBool jsval_to_cpBB( JSContext *cx, jsval vp, cpBB *ret );\n    jsval cpBB_to_jsval(JSContext *cx, cpBB bb );\n    \n#ifdef __cplusplus\n}\n#endif\n\n#define cpVect_to_jsval CGPoint_to_jsval\n#define jsval_to_cpVect jsval_to_CGPoint\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/sample.js",
    "content": "var cc = cc || {}\n\ncc.p = function (x, y) {\n\tvar tmp = new Float32Array(2);\n\ttmp[0] = x;\n\ttmp[1] = y;\n\treturn tmp;\n}\n\ncc.c3 = function (r, g, b) {\n\tvar tmp = new Uint8Array(3);\n\ttmp[0] = r;\n\ttmp[1] = g;\n\ttmp[2] = b;\n\treturn tmp;\n}\n\ncc.c4 = function (r, g, b, o) {\n\tvar tmp = new Uint8Array(4);\n\ttmp[0] = r;\n\ttmp[1] = g;\n\ttmp[2] = b;\n\ttmp[3] = o;\n\treturn tmp;\n};\n\nvar randColorComp = function () {\n\treturn Math.round(Math.random() * 255);\n};\n\nvar director = cc.Director.sharedDirector();\nvar audioEngine = cc.SimpleAudioEngine.sharedEngine();\nvar winSize = director.getWinSize();\n\nlog(\"size: \" + winSize[0] + \",\" + winSize[1]);\n\nvar scene = cc.Scene.create();\nvar layer = cc.LayerGradient.create(cc.c4(0, 0, 0, 255), cc.c4(0, 128, 255, 255));\nscene.addChild(layer);\n\nfor (var i=0; i < 30; i++) {\n\tvar sprite = cc.Sprite.create(\"Icon.png\");\n\tvar pos = cc.p(Math.random() * 480, Math.random() * 320);\n\tsprite.setPosition(pos);\n\tsprite.setColor(cc.c3(randColorComp(), randColorComp(), randColorComp()));\n\tlayer.addChild(sprite);\n}\n\nvar label = cc.LabelTTF.create(\"Testing Label TTF\", \"Marker Felt\", 18.0);\nlabel.setPosition(cc.p(240, 300));\n\nlayer.addChild(label);\n\naudioEngine.setBackgroundMusicVolume(0.5);\naudioEngine.playBackgroundMusic(\"bgmusic.mp3\", true);\n\ndirector.runWithScene(scene);\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/spidermonkey_specifics.h.example",
    "content": "#ifndef __SPIDERMONKEY_SPECIFICS_H__\n#define __SPIDERMONKEY_SPECIFICS_H__\n\n#include \"jsapi.h\"\n#include \"uthash.h\"\n\ntypedef struct js_proxy {\n\tvoid *ptr;\n\tJSObject *obj;\n\tUT_hash_handle hh;\n} js_proxy_t;\n\nextern js_proxy_t *_native_js_global_ht;\nextern js_proxy_t *_js_native_global_ht;\n\ntypedef struct js_type_class {\n\tuint32_t type;\n\tJSClass *jsclass;\n\tJSObject *proto;\n\tJSObject *parentProto;\n\tUT_hash_handle hh;\n} js_type_class_t;\n\nextern js_type_class_t *_js_global_type_ht;\n\ntemplate< typename DERIVED >\nclass TypeTest\n{\n\tpublic:\n\tstatic int s_id()\n\t{\n\t\t// return id unique for DERIVED\n\t\t// NOT SURE IT WILL BE REALLY UNIQUE FOR EACH CLASS!!\n\t\tstatic const long id = reinterpret_cast<long>(typeid( DERIVED ).name());\n\t\treturn id;\n\t}\n\n\tstatic const char* s_name()\n\t{\n\t\t// return id unique for DERIVED\n\t\t// ALWAYS VALID BUT STRING, NOT INT - BUT VALID AND CROSS-PLATFORM/CROSS-VERSION COMPATBLE\n\t\t// AS FAR AS YOU KEEP THE CLASS NAME\n\t\treturn typeid( DERIVED ).name();\n\t}\n};\n\n\n#define JS_NEW_PROXY(p, native_obj, js_obj) \\\ndo { \\\n\tp = (js_proxy_t *)malloc(sizeof(js_proxy_t)); \\\n\tassert(p); \\\n\tp->ptr = native_obj; \\\n\tp->obj = js_obj; \\\n\tHASH_ADD_PTR(_native_js_global_ht, ptr, p); \\\n\tp = (js_proxy_t *)malloc(sizeof(js_proxy_t)); \\\n\tassert(p); \\\n\tp->ptr = native_obj; \\\n\tp->obj = js_obj; \\\n\tHASH_ADD_PTR(_js_native_global_ht, obj, p); \\\n} while(0) \\\n\n#define JS_GET_PROXY(p, native_obj) \\\ndo { \\\n\tHASH_FIND_PTR(_native_js_global_ht, &native_obj, p); \\\n} while (0)\n\n#define JS_GET_NATIVE_PROXY(p, js_obj) \\\ndo { \\\n\tHASH_FIND_PTR(_js_native_global_ht, &js_obj, p); \\\n} while (0)\n\n// Removing proxy from hash. Added freeing of proxies, as suggested by James Chen.\n#define JS_REMOVE_PROXY(nproxy, jsproxy) \\\ndo { \\\n\tif (nproxy) { HASH_DEL(_native_js_global_ht, nproxy); free(nproxy); } \\\n\tif (jsproxy) { HASH_DEL(_js_native_global_ht, jsproxy); free(jsproxy); } \\\n} while (0)\n\n#define TEST_NATIVE_OBJECT(cx, native_obj) \\\nif (!native_obj) { \\\n\tJS_ReportError(cx, \"Invalid Native Object\"); \\\n\treturn JS_FALSE; \\\n}\n\n#endif\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/common/uthash.h",
    "content": "/*\nCopyright (c) 2003-2010, Troy D. Hanson     http://uthash.sourceforge.net\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER\nOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef __SUPPORT_DATA_SUPPORT_UTHASH_H__\n#define __SUPPORT_DATA_SUPPORT_UTHASH_H__\n\n#include <string.h>   /* memcmp,strlen */\n#include <stddef.h>   /* ptrdiff_t */\n#include <stdlib.h>   /* exit() */\n\n/* These macros use decltype or the earlier __typeof GNU extension.\n   As decltype is only available in newer compilers (VS2010 or gcc 4.3+\n   when compiling c++ source) this code uses whatever method is needed\n   or, for VS2008 where neither is available, uses casting workarounds. */\n#ifdef _MSC_VER         /* MS compiler */\n#if _MSC_VER >= 1600 && defined(__cplusplus)  /* VS2010 or newer in C++ mode */\n#define DECLTYPE(x) (decltype(x))\n#else                   /* VS2008 or older (or VS2010 in C mode) */\n#define NO_DECLTYPE\n#define DECLTYPE(x)\n#endif\n#else                   /* GNU, Sun and other compilers */\n#define DECLTYPE(x) (__typeof(x))\n#endif\n\n#ifdef ANDROID\n#define NO_DECLTYPE\n#undef  DECLTYPE\n#define DECLTYPE(x)\n#endif\n\n#ifdef NO_DECLTYPE\n#define DECLTYPE_ASSIGN(dst,src)                                                 \\\ndo {                                                                             \\\n  char **_da_dst = (char**)(&(dst));                                             \\\n  *_da_dst = (char*)(src);                                                       \\\n} while(0)\n#else \n#define DECLTYPE_ASSIGN(dst,src)                                                 \\\ndo {                                                                             \\\n  (dst) = DECLTYPE(dst)(src);                                                    \\\n} while(0)\n#endif\n\n/* uint32_t next definded will conflict with other libraries and an \"error C2872: 'uint32_t' : ambiguous symbol\" will appear.\n   so we replace all uint32_t with 'unsigned int'.\n*/\n/* a number of the hash function use uint32_t which isn't defined on win32 */\n\n// #ifdef _MSC_VER\n//     typedef unsigned int uint32_t;\n// #else\n//     #ifndef __QNX__\n//     #include <inttypes.h>   /* uint32_t */\n//     #endif /* __QNX__ */\n// #endif /* _MSC_VER */\n\n#define UTHASH_VERSION 1.9.3\n\n#define uthash_fatal(msg) exit(-1)        /* fatal error (out of memory,etc) */\n#define uthash_malloc(sz) malloc(sz)      /* malloc fcn                      */\n#define uthash_free(ptr,sz) free(ptr)        /* free fcn                        */\n\n#define uthash_noexpand_fyi(tbl)          /* can be defined to log noexpand  */\n#define uthash_expand_fyi(tbl)            /* can be defined to log expands   */\n\n/* initial number of buckets */\n#define HASH_INITIAL_NUM_BUCKETS 32      /* initial number of buckets        */\n#define HASH_INITIAL_NUM_BUCKETS_LOG2 5  /* lg2 of initial number of buckets */\n#define HASH_BKT_CAPACITY_THRESH 10      /* expand when bucket count reaches */\n\n/* calculate the element whose hash handle address is hhe */\n#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))\n\n#define HASH_FIND(hh,head,keyptr,keylen,out)                                     \\\ndo {                                                                             \\\n  unsigned _hf_bkt,_hf_hashv;                                                    \\\n  out=NULL;                                                                      \\\n  if (head) {                                                                    \\\n     HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \\\n     if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) {                           \\\n       HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ],  \\\n                        keyptr,keylen,out);                                      \\\n     }                                                                           \\\n  }                                                                              \\\n} while (0)\n\n#ifdef HASH_BLOOM\n#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM)\n#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0)\n#define HASH_BLOOM_MAKE(tbl)                                                     \\\ndo {                                                                             \\\n  (tbl)->bloom_nbits = HASH_BLOOM;                                               \\\n  (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN);                 \\\n  if (!((tbl)->bloom_bv))  { uthash_fatal( \"out of memory\"); }                   \\\n  memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN);                                \\\n  (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE;                                       \\\n} while (0);\n\n#define HASH_BLOOM_FREE(tbl)                                                     \\\ndo {                                                                             \\\n  uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN);                              \\\n} while (0);\n\n#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8)))\n#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8)))\n\n#define HASH_BLOOM_ADD(tbl,hashv)                                                \\\n  HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (unsigned int)((1ULL << (tbl)->bloom_nbits) - 1)))\n\n#define HASH_BLOOM_TEST(tbl,hashv)                                               \\\n  HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (unsigned int)((1ULL << (tbl)->bloom_nbits) - 1)))\n\n#else\n#define HASH_BLOOM_MAKE(tbl) \n#define HASH_BLOOM_FREE(tbl) \n#define HASH_BLOOM_ADD(tbl,hashv) \n#define HASH_BLOOM_TEST(tbl,hashv) (1)\n#endif\n\n#define HASH_MAKE_TABLE(hh,head)                                                 \\\ndo {                                                                             \\\n  (head)->hh.tbl = (UT_hash_table*)uthash_malloc(                                \\\n                  sizeof(UT_hash_table));                                        \\\n  if (!((head)->hh.tbl))  { uthash_fatal( \"out of memory\"); }                    \\\n  memset((head)->hh.tbl, 0, sizeof(UT_hash_table));                              \\\n  (head)->hh.tbl->tail = &((head)->hh);                                          \\\n  (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS;                        \\\n  (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2;              \\\n  (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head);                    \\\n  (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc(                      \\\n          HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \\\n  if (! (head)->hh.tbl->buckets) { uthash_fatal( \"out of memory\"); }             \\\n  memset((head)->hh.tbl->buckets, 0,                                             \\\n          HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket));               \\\n  HASH_BLOOM_MAKE((head)->hh.tbl);                                               \\\n  (head)->hh.tbl->signature = HASH_SIGNATURE;                                    \\\n} while(0)\n\n#define HASH_ADD(hh,head,fieldname,keylen_in,add)                                \\\n        HASH_ADD_KEYPTR(hh,head,&add->fieldname,keylen_in,add)\n \n#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)                            \\\ndo {                                                                             \\\n unsigned _ha_bkt;                                                               \\\n (add)->hh.next = NULL;                                                          \\\n (add)->hh.key = (char*)keyptr;                                                  \\\n (add)->hh.keylen = keylen_in;                                                   \\\n if (!(head)) {                                                                  \\\n    head = (add);                                                                \\\n    (head)->hh.prev = NULL;                                                      \\\n    HASH_MAKE_TABLE(hh,head);                                                    \\\n } else {                                                                        \\\n    (head)->hh.tbl->tail->next = (add);                                          \\\n    (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail);         \\\n    (head)->hh.tbl->tail = &((add)->hh);                                         \\\n }                                                                               \\\n (head)->hh.tbl->num_items++;                                                    \\\n (add)->hh.tbl = (head)->hh.tbl;                                                 \\\n HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets,                         \\\n         (add)->hh.hashv, _ha_bkt);                                              \\\n HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh);                   \\\n HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv);                                 \\\n HASH_EMIT_KEY(hh,head,keyptr,keylen_in);                                        \\\n HASH_FSCK(hh,head);                                                             \\\n} while(0)\n\n#define HASH_TO_BKT( hashv, num_bkts, bkt )                                      \\\ndo {                                                                             \\\n  bkt = ((hashv) & ((num_bkts) - 1));                                            \\\n} while(0)\n\n/* delete \"delptr\" from the hash table.\n * \"the usual\" patch-up process for the app-order doubly-linked-list.\n * The use of _hd_hh_del below deserves special explanation.\n * These used to be expressed using (delptr) but that led to a bug\n * if someone used the same symbol for the head and deletee, like\n *  HASH_DELETE(hh,users,users);\n * We want that to work, but by changing the head (users) below\n * we were forfeiting our ability to further refer to the deletee (users)\n * in the patch-up process. Solution: use scratch space to\n * copy the deletee pointer, then the latter references are via that\n * scratch pointer rather than through the repointed (users) symbol.\n */\n#define HASH_DELETE(hh,head,delptr)                                              \\\ndo {                                                                             \\\n    unsigned _hd_bkt;                                                            \\\n    struct UT_hash_handle *_hd_hh_del;                                           \\\n    if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) )  {         \\\n        uthash_free((head)->hh.tbl->buckets,                                     \\\n                    (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \\\n        HASH_BLOOM_FREE((head)->hh.tbl);                                         \\\n        uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                      \\\n        head = NULL;                                                             \\\n    } else {                                                                     \\\n        _hd_hh_del = &((delptr)->hh);                                            \\\n        if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) {     \\\n            (head)->hh.tbl->tail =                                               \\\n                (UT_hash_handle*)((char*)((delptr)->hh.prev) +                   \\\n                (head)->hh.tbl->hho);                                            \\\n        }                                                                        \\\n        if ((delptr)->hh.prev) {                                                 \\\n            ((UT_hash_handle*)((char*)((delptr)->hh.prev) +                      \\\n                    (head)->hh.tbl->hho))->next = (delptr)->hh.next;             \\\n        } else {                                                                 \\\n            DECLTYPE_ASSIGN(head,(delptr)->hh.next);                             \\\n        }                                                                        \\\n        if (_hd_hh_del->next) {                                                  \\\n            ((UT_hash_handle*)((char*)_hd_hh_del->next +                         \\\n                    (head)->hh.tbl->hho))->prev =                                \\\n                    _hd_hh_del->prev;                                            \\\n        }                                                                        \\\n        HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt);   \\\n        HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del);        \\\n        (head)->hh.tbl->num_items--;                                             \\\n    }                                                                            \\\n    HASH_FSCK(hh,head);                                                          \\\n} while (0)\n\n\n/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */\n#define HASH_FIND_STR(head,findstr,out)                                          \\\n    HASH_FIND(hh,head,findstr,strlen(findstr),out)\n#define HASH_ADD_STR(head,strfield,add)                                          \\\n    HASH_ADD(hh,head,strfield,strlen(add->strfield),add)\n#define HASH_FIND_INT(head,findint,out)                                          \\\n    HASH_FIND(hh,head,findint,sizeof(int),out)\n#define HASH_ADD_INT(head,intfield,add)                                          \\\n    HASH_ADD(hh,head,intfield,sizeof(int),add)\n#define HASH_FIND_PTR(head,findptr,out)                                          \\\n    HASH_FIND(hh,head,findptr,sizeof(void *),out)\n#define HASH_ADD_PTR(head,ptrfield,add)                                          \\\n    HASH_ADD(hh,head,ptrfield,sizeof(void *),add)\n#define HASH_DEL(head,delptr)                                                    \\\n    HASH_DELETE(hh,head,delptr)\n\n/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined.\n * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined.\n */\n#ifdef HASH_DEBUG\n#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)\n#define HASH_FSCK(hh,head)                                                       \\\ndo {                                                                             \\\n    unsigned _bkt_i;                                                             \\\n    unsigned _count, _bkt_count;                                                 \\\n    char *_prev;                                                                 \\\n    struct UT_hash_handle *_thh;                                                 \\\n    if (head) {                                                                  \\\n        _count = 0;                                                              \\\n        for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) {       \\\n            _bkt_count = 0;                                                      \\\n            _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head;                      \\\n            _prev = NULL;                                                        \\\n            while (_thh) {                                                       \\\n               if (_prev != (char*)(_thh->hh_prev)) {                            \\\n                   HASH_OOPS(\"invalid hh_prev %p, actual %p\\n\",                  \\\n                    _thh->hh_prev, _prev );                                      \\\n               }                                                                 \\\n               _bkt_count++;                                                     \\\n               _prev = (char*)(_thh);                                            \\\n               _thh = _thh->hh_next;                                             \\\n            }                                                                    \\\n            _count += _bkt_count;                                                \\\n            if ((head)->hh.tbl->buckets[_bkt_i].count !=  _bkt_count) {          \\\n               HASH_OOPS(\"invalid bucket count %d, actual %d\\n\",                 \\\n                (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count);              \\\n            }                                                                    \\\n        }                                                                        \\\n        if (_count != (head)->hh.tbl->num_items) {                               \\\n            HASH_OOPS(\"invalid hh item count %d, actual %d\\n\",                   \\\n                (head)->hh.tbl->num_items, _count );                             \\\n        }                                                                        \\\n        /* traverse hh in app order; check next/prev integrity, count */         \\\n        _count = 0;                                                              \\\n        _prev = NULL;                                                            \\\n        _thh =  &(head)->hh;                                                     \\\n        while (_thh) {                                                           \\\n           _count++;                                                             \\\n           if (_prev !=(char*)(_thh->prev)) {                                    \\\n              HASH_OOPS(\"invalid prev %p, actual %p\\n\",                          \\\n                    _thh->prev, _prev );                                         \\\n           }                                                                     \\\n           _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh);                    \\\n           _thh = ( _thh->next ?  (UT_hash_handle*)((char*)(_thh->next) +        \\\n                                  (head)->hh.tbl->hho) : NULL );                 \\\n        }                                                                        \\\n        if (_count != (head)->hh.tbl->num_items) {                               \\\n            HASH_OOPS(\"invalid app item count %d, actual %d\\n\",                  \\\n                (head)->hh.tbl->num_items, _count );                             \\\n        }                                                                        \\\n    }                                                                            \\\n} while (0)\n#else\n#define HASH_FSCK(hh,head) \n#endif\n\n/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to \n * the descriptor to which this macro is defined for tuning the hash function.\n * The app can #include <unistd.h> to get the prototype for write(2). */\n#ifdef HASH_EMIT_KEYS\n#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                                   \\\ndo {                                                                             \\\n    unsigned _klen = fieldlen;                                                   \\\n    write(HASH_EMIT_KEYS, &_klen, sizeof(_klen));                                \\\n    write(HASH_EMIT_KEYS, keyptr, fieldlen);                                     \\\n} while (0)\n#else \n#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                    \n#endif\n\n/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */\n#ifdef HASH_FUNCTION \n#define HASH_FCN HASH_FUNCTION\n#else\n#define HASH_FCN HASH_JEN\n#endif\n\n/* The Bernstein hash function, used in Perl prior to v5.6 */\n#define HASH_BER(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _hb_keylen=keylen;                                                    \\\n  char *_hb_key=(char*)(key);                                                      \\\n  (hashv) = 0;                                                                   \\\n  while (_hb_keylen--)  { (hashv) = ((hashv) * 33) + *_hb_key++; }               \\\n  bkt = (hashv) & (num_bkts-1);                                                  \\\n} while (0)\n\n\n/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at \n * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */\n#define HASH_SAX(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _sx_i;                                                                \\\n  char *_hs_key=(char*)(key);                                                      \\\n  hashv = 0;                                                                     \\\n  for(_sx_i=0; _sx_i < keylen; _sx_i++)                                          \\\n      hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i];                     \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while (0)\n\n#define HASH_FNV(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _fn_i;                                                                \\\n  char *_hf_key=(char*)(key);                                                      \\\n  hashv = 2166136261UL;                                                          \\\n  for(_fn_i=0; _fn_i < keylen; _fn_i++)                                          \\\n      hashv = (hashv * 16777619) ^ _hf_key[_fn_i];                               \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0);\n \n#define HASH_OAT(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _ho_i;                                                                \\\n  char *_ho_key=(char*)(key);                                                      \\\n  hashv = 0;                                                                     \\\n  for(_ho_i=0; _ho_i < keylen; _ho_i++) {                                        \\\n      hashv += _ho_key[_ho_i];                                                   \\\n      hashv += (hashv << 10);                                                    \\\n      hashv ^= (hashv >> 6);                                                     \\\n  }                                                                              \\\n  hashv += (hashv << 3);                                                         \\\n  hashv ^= (hashv >> 11);                                                        \\\n  hashv += (hashv << 15);                                                        \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n\n#define HASH_JEN_MIX(a,b,c)                                                      \\\ndo {                                                                             \\\n  a -= b; a -= c; a ^= ( c >> 13 );                                              \\\n  b -= c; b -= a; b ^= ( a << 8 );                                               \\\n  c -= a; c -= b; c ^= ( b >> 13 );                                              \\\n  a -= b; a -= c; a ^= ( c >> 12 );                                              \\\n  b -= c; b -= a; b ^= ( a << 16 );                                              \\\n  c -= a; c -= b; c ^= ( b >> 5 );                                               \\\n  a -= b; a -= c; a ^= ( c >> 3 );                                               \\\n  b -= c; b -= a; b ^= ( a << 10 );                                              \\\n  c -= a; c -= b; c ^= ( b >> 15 );                                              \\\n} while (0)\n\n#define HASH_JEN(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  unsigned _hj_i,_hj_j,_hj_k;                                                    \\\n  char *_hj_key=(char*)(key);                                                      \\\n  hashv = 0xfeedbeef;                                                            \\\n  _hj_i = _hj_j = 0x9e3779b9;                                                    \\\n  _hj_k = keylen;                                                                \\\n  while (_hj_k >= 12) {                                                          \\\n    _hj_i +=    (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 )                      \\\n        + ( (unsigned)_hj_key[2] << 16 )                                         \\\n        + ( (unsigned)_hj_key[3] << 24 ) );                                      \\\n    _hj_j +=    (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 )                      \\\n        + ( (unsigned)_hj_key[6] << 16 )                                         \\\n        + ( (unsigned)_hj_key[7] << 24 ) );                                      \\\n    hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 )                         \\\n        + ( (unsigned)_hj_key[10] << 16 )                                        \\\n        + ( (unsigned)_hj_key[11] << 24 ) );                                     \\\n                                                                                 \\\n     HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                          \\\n                                                                                 \\\n     _hj_key += 12;                                                              \\\n     _hj_k -= 12;                                                                \\\n  }                                                                              \\\n  hashv += keylen;                                                               \\\n  switch ( _hj_k ) {                                                             \\\n     case 11: hashv += ( (unsigned)_hj_key[10] << 24 );                          \\\n     case 10: hashv += ( (unsigned)_hj_key[9] << 16 );                           \\\n     case 9:  hashv += ( (unsigned)_hj_key[8] << 8 );                            \\\n     case 8:  _hj_j += ( (unsigned)_hj_key[7] << 24 );                           \\\n     case 7:  _hj_j += ( (unsigned)_hj_key[6] << 16 );                           \\\n     case 6:  _hj_j += ( (unsigned)_hj_key[5] << 8 );                            \\\n     case 5:  _hj_j += _hj_key[4];                                               \\\n     case 4:  _hj_i += ( (unsigned)_hj_key[3] << 24 );                           \\\n     case 3:  _hj_i += ( (unsigned)_hj_key[2] << 16 );                           \\\n     case 2:  _hj_i += ( (unsigned)_hj_key[1] << 8 );                            \\\n     case 1:  _hj_i += _hj_key[0];                                               \\\n  }                                                                              \\\n  HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                             \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n\n/* The Paul Hsieh hash function */\n#undef get16bits\n#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__)             \\\n  || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__)\n#define get16bits(d) (*((const uint16_t *) (d)))\n#endif\n\n#if !defined (get16bits)\n#define get16bits(d) ((((unsigned int)(((const uint8_t *)(d))[1])) << 8)             \\\n                       +(unsigned int)(((const uint8_t *)(d))[0]) )\n#endif\n#define HASH_SFH(key,keylen,num_bkts,hashv,bkt)                                  \\\ndo {                                                                             \\\n  char *_sfh_key=(char*)(key);                                                     \\\n  unsigned int _sfh_tmp, _sfh_len = keylen;                                          \\\n                                                                                 \\\n  int _sfh_rem = _sfh_len & 3;                                                   \\\n  _sfh_len >>= 2;                                                                \\\n  hashv = 0xcafebabe;                                                            \\\n                                                                                 \\\n  /* Main loop */                                                                \\\n  for (;_sfh_len > 0; _sfh_len--) {                                              \\\n    hashv    += get16bits (_sfh_key);                                            \\\n    _sfh_tmp       = (get16bits (_sfh_key+2) << 11) ^ hashv;                     \\\n    hashv     = (hashv << 16) ^ _sfh_tmp;                                        \\\n    _sfh_key += 2*sizeof (uint16_t);                                             \\\n    hashv    += hashv >> 11;                                                     \\\n  }                                                                              \\\n                                                                                 \\\n  /* Handle end cases */                                                         \\\n  switch (_sfh_rem) {                                                            \\\n    case 3: hashv += get16bits (_sfh_key);                                       \\\n            hashv ^= hashv << 16;                                                \\\n            hashv ^= _sfh_key[sizeof (uint16_t)] << 18;                          \\\n            hashv += hashv >> 11;                                                \\\n            break;                                                               \\\n    case 2: hashv += get16bits (_sfh_key);                                       \\\n            hashv ^= hashv << 11;                                                \\\n            hashv += hashv >> 17;                                                \\\n            break;                                                               \\\n    case 1: hashv += *_sfh_key;                                                  \\\n            hashv ^= hashv << 10;                                                \\\n            hashv += hashv >> 1;                                                 \\\n  }                                                                              \\\n                                                                                 \\\n    /* Force \"avalanching\" of final 127 bits */                                  \\\n    hashv ^= hashv << 3;                                                         \\\n    hashv += hashv >> 5;                                                         \\\n    hashv ^= hashv << 4;                                                         \\\n    hashv += hashv >> 17;                                                        \\\n    hashv ^= hashv << 25;                                                        \\\n    hashv += hashv >> 6;                                                         \\\n    bkt = hashv & (num_bkts-1);                                                  \\\n} while(0);\n\n#ifdef HASH_USING_NO_STRICT_ALIASING\n/* The MurmurHash exploits some CPU's (e.g. x86) tolerance for unaligned reads.\n * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error.\n * So MurmurHash comes in two versions, the faster unaligned one and the slower\n * aligned one. We only use the faster one on CPU's where we know it's safe. \n *\n * Note the preprocessor built-in defines can be emitted using:\n *\n *   gcc -m64 -dM -E - < /dev/null                  (on gcc)\n *   cc -## a.c (where a.c is a simple test file)   (Sun Studio)\n */\n#if (defined(__i386__) || defined(__x86_64__)) \n#define HASH_MUR HASH_MUR_UNALIGNED\n#else\n#define HASH_MUR HASH_MUR_ALIGNED\n#endif\n\n/* Appleby's MurmurHash fast version for unaligned-tolerant archs like i386 */\n#define HASH_MUR_UNALIGNED(key,keylen,num_bkts,hashv,bkt)                        \\\ndo {                                                                             \\\n  const unsigned int _mur_m = 0x5bd1e995;                                        \\\n  const int _mur_r = 24;                                                         \\\n  hashv = 0xcafebabe ^ keylen;                                                   \\\n  char *_mur_key = (char *)(key);                                                  \\\n  unsigned int _mur_tmp, _mur_len = keylen;                                          \\\n                                                                                 \\\n  for (;_mur_len >= 4; _mur_len-=4) {                                            \\\n    _mur_tmp = *(unsigned int *)_mur_key;                                            \\\n    _mur_tmp *= _mur_m;                                                          \\\n    _mur_tmp ^= _mur_tmp >> _mur_r;                                              \\\n    _mur_tmp *= _mur_m;                                                          \\\n    hashv *= _mur_m;                                                             \\\n    hashv ^= _mur_tmp;                                                           \\\n    _mur_key += 4;                                                               \\\n  }                                                                              \\\n                                                                                 \\\n  switch(_mur_len)                                                               \\\n  {                                                                              \\\n    case 3: hashv ^= _mur_key[2] << 16;                                          \\\n    case 2: hashv ^= _mur_key[1] << 8;                                           \\\n    case 1: hashv ^= _mur_key[0];                                                \\\n            hashv *= _mur_m;                                                     \\\n  };                                                                             \\\n                                                                                 \\\n  hashv ^= hashv >> 13;                                                          \\\n  hashv *= _mur_m;                                                               \\\n  hashv ^= hashv >> 15;                                                          \\\n                                                                                 \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n\n/* Appleby's MurmurHash version for alignment-sensitive archs like Sparc */\n#define HASH_MUR_ALIGNED(key,keylen,num_bkts,hashv,bkt)                          \\\ndo {                                                                             \\\n  const unsigned int _mur_m = 0x5bd1e995;                                        \\\n  const int _mur_r = 24;                                                         \\\n  hashv = 0xcafebabe ^ (keylen);                                                   \\\n  char *_mur_key = (char *)(key);                                                  \\\n  unsigned int _mur_len = keylen;                                                    \\\n  int _mur_align = (int)_mur_key & 3;                                            \\\n                                                                                 \\\n  if (_mur_align && (_mur_len >= 4)) {                                           \\\n    unsigned _mur_t = 0, _mur_d = 0;                                             \\\n    switch(_mur_align) {                                                         \\\n      case 1: _mur_t |= _mur_key[2] << 16;                                       \\\n      case 2: _mur_t |= _mur_key[1] << 8;                                        \\\n      case 3: _mur_t |= _mur_key[0];                                             \\\n    }                                                                            \\\n    _mur_t <<= (8 * _mur_align);                                                 \\\n    _mur_key += 4-_mur_align;                                                    \\\n    _mur_len -= 4-_mur_align;                                                    \\\n    int _mur_sl = 8 * (4-_mur_align);                                            \\\n    int _mur_sr = 8 * _mur_align;                                                \\\n                                                                                 \\\n    for (;_mur_len >= 4; _mur_len-=4) {                                          \\\n      _mur_d = *(unsigned *)_mur_key;                                            \\\n      _mur_t = (_mur_t >> _mur_sr) | (_mur_d << _mur_sl);                        \\\n      unsigned _mur_k = _mur_t;                                                  \\\n      _mur_k *= _mur_m;                                                          \\\n      _mur_k ^= _mur_k >> _mur_r;                                                \\\n      _mur_k *= _mur_m;                                                          \\\n      hashv *= _mur_m;                                                           \\\n      hashv ^= _mur_k;                                                           \\\n      _mur_t = _mur_d;                                                           \\\n      _mur_key += 4;                                                             \\\n    }                                                                            \\\n    _mur_d = 0;                                                                  \\\n    if(_mur_len >= _mur_align) {                                                 \\\n      switch(_mur_align) {                                                       \\\n        case 3: _mur_d |= _mur_key[2] << 16;                                     \\\n        case 2: _mur_d |= _mur_key[1] << 8;                                      \\\n        case 1: _mur_d |= _mur_key[0];                                           \\\n      }                                                                          \\\n      unsigned _mur_k = (_mur_t >> _mur_sr) | (_mur_d << _mur_sl);               \\\n      _mur_k *= _mur_m;                                                          \\\n      _mur_k ^= _mur_k >> _mur_r;                                                \\\n      _mur_k *= _mur_m;                                                          \\\n      hashv *= _mur_m;                                                           \\\n      hashv ^= _mur_k;                                                           \\\n      _mur_k += _mur_align;                                                      \\\n      _mur_len -= _mur_align;                                                    \\\n                                                                                 \\\n      switch(_mur_len)                                                           \\\n      {                                                                          \\\n        case 3: hashv ^= _mur_key[2] << 16;                                      \\\n        case 2: hashv ^= _mur_key[1] << 8;                                       \\\n        case 1: hashv ^= _mur_key[0];                                            \\\n                hashv *= _mur_m;                                                 \\\n      }                                                                          \\\n    } else {                                                                     \\\n      switch(_mur_len)                                                           \\\n      {                                                                          \\\n        case 3: _mur_d ^= _mur_key[2] << 16;                                     \\\n        case 2: _mur_d ^= _mur_key[1] << 8;                                      \\\n        case 1: _mur_d ^= _mur_key[0];                                           \\\n        case 0: hashv ^= (_mur_t >> _mur_sr) | (_mur_d << _mur_sl);              \\\n        hashv *= _mur_m;                                                         \\\n      }                                                                          \\\n    }                                                                            \\\n                                                                                 \\\n    hashv ^= hashv >> 13;                                                        \\\n    hashv *= _mur_m;                                                             \\\n    hashv ^= hashv >> 15;                                                        \\\n  } else {                                                                       \\\n    for (;_mur_len >= 4; _mur_len-=4) {                                          \\\n      unsigned _mur_k = *(unsigned*)_mur_key;                                    \\\n      _mur_k *= _mur_m;                                                          \\\n      _mur_k ^= _mur_k >> _mur_r;                                                \\\n      _mur_k *= _mur_m;                                                          \\\n      hashv *= _mur_m;                                                           \\\n      hashv ^= _mur_k;                                                           \\\n      _mur_key += 4;                                                             \\\n    }                                                                            \\\n    switch(_mur_len)                                                             \\\n    {                                                                            \\\n      case 3: hashv ^= _mur_key[2] << 16;                                        \\\n      case 2: hashv ^= _mur_key[1] << 8;                                         \\\n      case 1: hashv ^= _mur_key[0];                                              \\\n      hashv *= _mur_m;                                                           \\\n    }                                                                            \\\n                                                                                 \\\n    hashv ^= hashv >> 13;                                                        \\\n    hashv *= _mur_m;                                                             \\\n    hashv ^= hashv >> 15;                                                        \\\n  }                                                                              \\\n  bkt = hashv & (num_bkts-1);                                                    \\\n} while(0)\n#endif  /* HASH_USING_NO_STRICT_ALIASING */\n\n/* key comparison function; return 0 if keys equal */\n#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) \n\n/* iterate over items in a known bucket to find desired item */\n#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out)                       \\\ndo {                                                                             \\\n if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head));          \\\n else out=NULL;                                                                  \\\n while (out) {                                                                   \\\n    if (out->hh.keylen == keylen_in) {                                           \\\n        if ((HASH_KEYCMP(out->hh.key,keyptr,keylen_in)) == 0) break;             \\\n    }                                                                            \\\n    if (out->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,out->hh.hh_next)); \\\n    else out = NULL;                                                             \\\n }                                                                               \\\n} while(0)\n\n/* add an item to a bucket  */\n#define HASH_ADD_TO_BKT(head,addhh)                                              \\\ndo {                                                                             \\\n head.count++;                                                                   \\\n (addhh)->hh_next = head.hh_head;                                                \\\n (addhh)->hh_prev = NULL;                                                        \\\n if (head.hh_head) { (head).hh_head->hh_prev = (addhh); }                        \\\n (head).hh_head=addhh;                                                           \\\n if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH)             \\\n     && (addhh)->tbl->noexpand != 1) {                                           \\\n       HASH_EXPAND_BUCKETS((addhh)->tbl);                                        \\\n }                                                                               \\\n} while(0)\n\n/* remove an item from a given bucket */\n#define HASH_DEL_IN_BKT(hh,head,hh_del)                                          \\\n    (head).count--;                                                              \\\n    if ((head).hh_head == hh_del) {                                              \\\n      (head).hh_head = hh_del->hh_next;                                          \\\n    }                                                                            \\\n    if (hh_del->hh_prev) {                                                       \\\n        hh_del->hh_prev->hh_next = hh_del->hh_next;                              \\\n    }                                                                            \\\n    if (hh_del->hh_next) {                                                       \\\n        hh_del->hh_next->hh_prev = hh_del->hh_prev;                              \\\n    }                                                                \n\n/* Bucket expansion has the effect of doubling the number of buckets\n * and redistributing the items into the new buckets. Ideally the\n * items will distribute more or less evenly into the new buckets\n * (the extent to which this is true is a measure of the quality of\n * the hash function as it applies to the key domain). \n * \n * With the items distributed into more buckets, the chain length\n * (item count) in each bucket is reduced. Thus by expanding buckets\n * the hash keeps a bound on the chain length. This bounded chain \n * length is the essence of how a hash provides constant time lookup.\n * \n * The calculation of tbl->ideal_chain_maxlen below deserves some\n * explanation. First, keep in mind that we're calculating the ideal\n * maximum chain length based on the *new* (doubled) bucket count.\n * In fractions this is just n/b (n=number of items,b=new num buckets).\n * Since the ideal chain length is an integer, we want to calculate \n * ceil(n/b). We don't depend on floating point arithmetic in this\n * hash, so to calculate ceil(n/b) with integers we could write\n * \n *      ceil(n/b) = (n/b) + ((n%b)?1:0)\n * \n * and in fact a previous version of this hash did just that.\n * But now we have improved things a bit by recognizing that b is\n * always a power of two. We keep its base 2 log handy (call it lb),\n * so now we can write this with a bit shift and logical AND:\n * \n *      ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)\n * \n */\n#define HASH_EXPAND_BUCKETS(tbl)                                                 \\\ndo {                                                                             \\\n    unsigned _he_bkt;                                                            \\\n    unsigned _he_bkt_i;                                                          \\\n    struct UT_hash_handle *_he_thh, *_he_hh_nxt;                                 \\\n    UT_hash_bucket *_he_new_buckets, *_he_newbkt;                                \\\n    _he_new_buckets = (UT_hash_bucket*)uthash_malloc(                            \\\n             2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));              \\\n    if (!_he_new_buckets) { uthash_fatal( \"out of memory\"); }                    \\\n    memset(_he_new_buckets, 0,                                                   \\\n            2 * tbl->num_buckets * sizeof(struct UT_hash_bucket));               \\\n    tbl->ideal_chain_maxlen =                                                    \\\n       (tbl->num_items >> (tbl->log2_num_buckets+1)) +                           \\\n       ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0);                    \\\n    tbl->nonideal_items = 0;                                                     \\\n    for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++)                \\\n    {                                                                            \\\n        _he_thh = tbl->buckets[ _he_bkt_i ].hh_head;                             \\\n        while (_he_thh) {                                                        \\\n           _he_hh_nxt = _he_thh->hh_next;                                        \\\n           HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt);            \\\n           _he_newbkt = &(_he_new_buckets[ _he_bkt ]);                           \\\n           if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) {                \\\n             tbl->nonideal_items++;                                              \\\n             _he_newbkt->expand_mult = _he_newbkt->count /                       \\\n                                        tbl->ideal_chain_maxlen;                 \\\n           }                                                                     \\\n           _he_thh->hh_prev = NULL;                                              \\\n           _he_thh->hh_next = _he_newbkt->hh_head;                               \\\n           if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev =               \\\n                _he_thh;                                                         \\\n           _he_newbkt->hh_head = _he_thh;                                        \\\n           _he_thh = _he_hh_nxt;                                                 \\\n        }                                                                        \\\n    }                                                                            \\\n    uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \\\n    tbl->num_buckets *= 2;                                                       \\\n    tbl->log2_num_buckets++;                                                     \\\n    tbl->buckets = _he_new_buckets;                                              \\\n    tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ?         \\\n        (tbl->ineff_expands+1) : 0;                                              \\\n    if (tbl->ineff_expands > 1) {                                                \\\n        tbl->noexpand=1;                                                         \\\n        uthash_noexpand_fyi(tbl);                                                \\\n    }                                                                            \\\n    uthash_expand_fyi(tbl);                                                      \\\n} while(0)\n\n\n/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */\n/* Note that HASH_SORT assumes the hash handle name to be hh. \n * HASH_SRT was added to allow the hash handle name to be passed in. */\n#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn)\n#define HASH_SRT(hh,head,cmpfcn)                                                 \\\ndo {                                                                             \\\n  unsigned _hs_i;                                                                \\\n  unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize;               \\\n  struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail;            \\\n  if (head) {                                                                    \\\n      _hs_insize = 1;                                                            \\\n      _hs_looping = 1;                                                           \\\n      _hs_list = &((head)->hh);                                                  \\\n      while (_hs_looping) {                                                      \\\n          _hs_p = _hs_list;                                                      \\\n          _hs_list = NULL;                                                       \\\n          _hs_tail = NULL;                                                       \\\n          _hs_nmerges = 0;                                                       \\\n          while (_hs_p) {                                                        \\\n              _hs_nmerges++;                                                     \\\n              _hs_q = _hs_p;                                                     \\\n              _hs_psize = 0;                                                     \\\n              for ( _hs_i = 0; _hs_i  < _hs_insize; _hs_i++ ) {                  \\\n                  _hs_psize++;                                                   \\\n                  _hs_q = (UT_hash_handle*)((_hs_q->next) ?                      \\\n                          ((void*)((char*)(_hs_q->next) +                        \\\n                          (head)->hh.tbl->hho)) : NULL);                         \\\n                  if (! (_hs_q) ) break;                                         \\\n              }                                                                  \\\n              _hs_qsize = _hs_insize;                                            \\\n              while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) {           \\\n                  if (_hs_psize == 0) {                                          \\\n                      _hs_e = _hs_q;                                             \\\n                      _hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \\\n                              ((void*)((char*)(_hs_q->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_qsize--;                                               \\\n                  } else if ( (_hs_qsize == 0) || !(_hs_q) ) {                   \\\n                      _hs_e = _hs_p;                                             \\\n                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \\\n                              ((void*)((char*)(_hs_p->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_psize--;                                               \\\n                  } else if ((                                                   \\\n                      cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \\\n                             DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \\\n                             ) <= 0) {                                           \\\n                      _hs_e = _hs_p;                                             \\\n                      _hs_p = (UT_hash_handle*)((_hs_p->next) ?                  \\\n                              ((void*)((char*)(_hs_p->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_psize--;                                               \\\n                  } else {                                                       \\\n                      _hs_e = _hs_q;                                             \\\n                      _hs_q = (UT_hash_handle*)((_hs_q->next) ?                  \\\n                              ((void*)((char*)(_hs_q->next) +                    \\\n                              (head)->hh.tbl->hho)) : NULL);                     \\\n                      _hs_qsize--;                                               \\\n                  }                                                              \\\n                  if ( _hs_tail ) {                                              \\\n                      _hs_tail->next = ((_hs_e) ?                                \\\n                            ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL);          \\\n                  } else {                                                       \\\n                      _hs_list = _hs_e;                                          \\\n                  }                                                              \\\n                  _hs_e->prev = ((_hs_tail) ?                                    \\\n                     ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL);              \\\n                  _hs_tail = _hs_e;                                              \\\n              }                                                                  \\\n              _hs_p = _hs_q;                                                     \\\n          }                                                                      \\\n          _hs_tail->next = NULL;                                                 \\\n          if ( _hs_nmerges <= 1 ) {                                              \\\n              _hs_looping=0;                                                     \\\n              (head)->hh.tbl->tail = _hs_tail;                                   \\\n              DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list));      \\\n          }                                                                      \\\n          _hs_insize *= 2;                                                       \\\n      }                                                                          \\\n      HASH_FSCK(hh,head);                                                        \\\n }                                                                               \\\n} while (0)\n\n/* This function selects items from one hash into another hash. \n * The end result is that the selected items have dual presence \n * in both hashes. There is no copy of the items made; rather \n * they are added into the new hash through a secondary hash \n * hash handle that must be present in the structure. */\n#define HASH_SELECT(hh_dst, dst, hh_src, src, cond)                              \\\ndo {                                                                             \\\n  unsigned _src_bkt, _dst_bkt;                                                   \\\n  void *_last_elt=NULL, *_elt;                                                   \\\n  UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL;                         \\\n  ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst));                 \\\n  if (src) {                                                                     \\\n    for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) {     \\\n      for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head;                \\\n          _src_hh;                                                               \\\n          _src_hh = _src_hh->hh_next) {                                          \\\n          _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh);                       \\\n          if (cond(_elt)) {                                                      \\\n            _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho);               \\\n            _dst_hh->key = _src_hh->key;                                         \\\n            _dst_hh->keylen = _src_hh->keylen;                                   \\\n            _dst_hh->hashv = _src_hh->hashv;                                     \\\n            _dst_hh->prev = _last_elt;                                           \\\n            _dst_hh->next = NULL;                                                \\\n            if (_last_elt_hh) { _last_elt_hh->next = _elt; }                     \\\n            if (!dst) {                                                          \\\n              DECLTYPE_ASSIGN(dst,_elt);                                         \\\n              HASH_MAKE_TABLE(hh_dst,dst);                                       \\\n            } else {                                                             \\\n              _dst_hh->tbl = (dst)->hh_dst.tbl;                                  \\\n            }                                                                    \\\n            HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt);    \\\n            HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh);            \\\n            (dst)->hh_dst.tbl->num_items++;                                      \\\n            _last_elt = _elt;                                                    \\\n            _last_elt_hh = _dst_hh;                                              \\\n          }                                                                      \\\n      }                                                                          \\\n    }                                                                            \\\n  }                                                                              \\\n  HASH_FSCK(hh_dst,dst);                                                         \\\n} while (0)\n\n#define HASH_CLEAR(hh,head)                                                      \\\ndo {                                                                             \\\n  if (head) {                                                                    \\\n    uthash_free((head)->hh.tbl->buckets,                                         \\\n                (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket));      \\\n    uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                          \\\n    (head)=NULL;                                                                 \\\n  }                                                                              \\\n} while(0)\n\n#ifdef NO_DECLTYPE\n#define HASH_ITER(hh,head,el,tmp)                                                \\\nfor((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL);       \\\n    el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) \n#else\n#define HASH_ITER(hh,head,el,tmp)                                                \\\nfor((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL);                 \\\n    el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL))\n#endif\n\n/* obtain a count of items in the hash */\n#define HASH_COUNT(head) HASH_CNT(hh,head) \n#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0)\n\ntypedef struct UT_hash_bucket {\n   struct UT_hash_handle *hh_head;\n   unsigned count;\n\n   /* expand_mult is normally set to 0. In this situation, the max chain length\n    * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If\n    * the bucket's chain exceeds this length, bucket expansion is triggered). \n    * However, setting expand_mult to a non-zero value delays bucket expansion\n    * (that would be triggered by additions to this particular bucket)\n    * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.\n    * (The multiplier is simply expand_mult+1). The whole idea of this\n    * multiplier is to reduce bucket expansions, since they are expensive, in\n    * situations where we know that a particular bucket tends to be overused.\n    * It is better to let its chain length grow to a longer yet-still-bounded\n    * value, than to do an O(n) bucket expansion too often. \n    */\n   unsigned expand_mult;\n\n} UT_hash_bucket;\n\n/* random signature used only to find hash tables in external analysis */\n#define HASH_SIGNATURE 0xa0111fe1\n#define HASH_BLOOM_SIGNATURE 0xb12220f2\n\ntypedef struct UT_hash_table {\n   UT_hash_bucket *buckets;\n   unsigned num_buckets, log2_num_buckets;\n   unsigned num_items;\n   struct UT_hash_handle *tail; /* tail hh in app order, for fast append    */\n   ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */\n\n   /* in an ideal situation (all buckets used equally), no bucket would have\n    * more than ceil(#items/#buckets) items. that's the ideal chain length. */\n   unsigned ideal_chain_maxlen;\n\n   /* nonideal_items is the number of items in the hash whose chain position\n    * exceeds the ideal chain maxlen. these items pay the penalty for an uneven\n    * hash distribution; reaching them in a chain traversal takes >ideal steps */\n   unsigned nonideal_items;\n\n   /* ineffective expands occur when a bucket doubling was performed, but \n    * afterward, more than half the items in the hash had nonideal chain\n    * positions. If this happens on two consecutive expansions we inhibit any\n    * further expansion, as it's not helping; this happens when the hash\n    * function isn't a good fit for the key domain. When expansion is inhibited\n    * the hash will still work, albeit no longer in constant time. */\n   unsigned ineff_expands, noexpand;\n\n   unsigned int signature; /* used only to find hash tables in external analysis */\n#ifdef HASH_BLOOM\n   unsigned int bloom_sig; /* used only to test bloom exists in external analysis */\n   uint8_t *bloom_bv;\n   char bloom_nbits;\n#endif\n\n} UT_hash_table;\n\ntypedef struct UT_hash_handle {\n   struct UT_hash_table *tbl;\n   void *prev;                       /* prev element in app order      */\n   void *next;                       /* next element in app order      */\n   struct UT_hash_handle *hh_prev;   /* previous hh in bucket order    */\n   struct UT_hash_handle *hh_next;   /* next hh in bucket order        */\n   void *key;                        /* ptr to enclosing struct's key  */\n   unsigned keylen;                  /* enclosing struct's key len     */\n   unsigned hashv;                   /* result of hash-fcn(key)        */\n} UT_hash_handle;\n\n#endif /* __SUPPORT_DATA_SUPPORT_UTHASH_H__*/\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/conversions.yaml",
    "content": "definitions:\n  # the names of the functions - we use this to generate the code and to register the functions in\n  # the javascript class\n  ifunction: \"js_${generator.prefix}_${class_name}_${func_name}\"\n  sfunction: \"js_${generator.prefix}_${class_name}_${func_name}\"\n  constructor: \"js_${generator.prefix}_${class_name}_constructor\"\nconversions:\n  # some times you want to use a special native type when converting from spidermonkey to native\n  # the most common case would be from JS-boolean to bool. Using \"bool\" will fail here since we\n  # pass the address to the conversion method, and a JSBool is defined as an integer in spidermonkey\n  native_types:\n    bool: \"JSBool\"\n    float: \"double\"\n    short: \"int32_t\"\n    \"unsigned char\": \"uint16_t\"\n    \"char\": \"int32_t\"\n    \"@std::vector<std::basic_string.*>.>.>\": \"std::vector<std::string>\"\n    \"@std::vector<int.*>.>\": \"std::vector<int>\"\n    \"@cocos2d::Map<std::basic_string.*,\": \"cocos2d::Map<std::string,\"\n  to_native:\n    # jsval to int\n    int: \"ok &= jsval_to_int32(cx, ${in_value}, (int32_t *)&${out_value})\"\n    \"unsigned int\": \"ok &= jsval_to_uint32(cx, ${in_value}, &${out_value})\"\n    \"unsigned char\": \"ok &= jsval_to_uint16(cx, ${in_value}, &${out_value})\"\n    short: \"ok &= jsval_to_int32(cx, ${in_value}, &${out_value})\"\n    \"unsigned short\": \"ok &= jsval_to_ushort(cx, ${in_value}, &${out_value})\"\n    char: \"ok &= jsval_to_int32(cx, ${in_value}, &${out_value})\"\n    bool: \"ok &= JS_ValueToBoolean(cx, ${in_value}, &${out_value})\"\n    float: \"ok &= JS_ValueToNumber(cx, ${in_value}, &${out_value})\"\n    double: \"ok &= JS_ValueToNumber(cx, ${in_value}, &${out_value})\"\n    long: \"ok &= jsval_to_long(cx, ${in_value}, &${out_value})\"\n    \"unsigned long\": \"ok &= jsval_to_ulong(cx, ${in_value}, &${out_value})\"\n    \"ssize_t\": \"ok &= jsval_to_ssize(cx, ${in_value}, &${out_value})\"\n    # jsval has to be a TypedArray, a UInt32Array with 2 elements\n    \"long long\": \"ok &= jsval_to_long_long(cx, ${in_value}, &${out_value})\"\n    \"std::string\": \"ok &= jsval_to_std_string(cx, ${in_value}, &${out_value})\"\n    \"char*\": \"std::string ${out_value}_tmp; ok &= jsval_to_std_string(cx, ${in_value}, &${out_value}_tmp); ${out_value} = ${out_value}_tmp.c_str()\"\n    \"Point\": \"ok &= jsval_to_ccpoint(cx, ${in_value}, &${out_value})\"\n    \"Rect\": \"ok &= jsval_to_ccrect(cx, ${in_value}, &${out_value})\"\n    \"Size\": \"ok &= jsval_to_ccsize(cx, ${in_value}, &${out_value})\"\n    \"Color4B\": \"ok &= jsval_to_cccolor4b(cx, ${in_value}, &${out_value})\"\n    \"Color4F\": \"ok &= jsval_to_cccolor4f(cx, ${in_value}, &${out_value})\"\n    \"Color3B\": \"ok &= jsval_to_cccolor3b(cx, ${in_value}, &${out_value})\"\n    \"Array*\": \"ok &= jsval_to_ccarray(cx, ${in_value}, &${out_value})\"\n    \"Dictionary*\": \"ok &= jsval_to_ccdictionary(cx, ${in_value}, &${out_value})\"\n    \"AffineTransform\": \"ok &= jsval_to_ccaffinetransform(cx, ${in_value}, &${out_value})\"\n    \"FontDefinition\":  \"ok &= jsval_to_FontDefinition(cx, ${in_value}, &${out_value})\"\n    \"String*\": \"std::string ${out_value}_tmp; ok &= jsval_to_std_string(cx, ${in_value}, &${out_value}_tmp); ${out_value} = cocos2d::String::create(${out_value}_tmp)\"\n    \"@Vector<.*>\": \"ok &= jsval_to_ccvector(cx, ${in_value}, &${out_value})\"\n    \"@Map<std::basic_string.*>\": \"ok &= jsval_to_ccmap_string_key(cx, ${in_value}, &${out_value})\"\n    \"Value\": \"ok &= jsval_to_ccvalue(cx, ${in_value}, &${out_value})\"\n    \"ValueMap\": \"ok &= jsval_to_ccvaluemap(cx, ${in_value}, &${out_value})\"\n    \"ValueMapIntKey\": \"ok &= jsval_to_ccvaluemapintkey(cx, ${in_value}, &${out_value})\"\n    \"ValueVector\": \"ok &= jsval_to_ccvaluevector(cx, ${in_value}, &${out_value})\"\n    \"@vector<std::basic_string.*>\": \"ok &= jsval_to_std_vector_string(cx, ${in_value}, &${out_value})\"\n    \"@vector<int.*>\": \"ok &= jsval_to_std_vector_int(cx, ${in_value}, &${out_value})\"\n    object: |\n      do {\n      ${($level + 1) * '\\t'}if (!${in_value}.isObject()) { ok = JS_FALSE; break; }\n      ${($level + 1) * '\\t'}js_proxy_t *proxy;\n      ${($level + 1) * '\\t'}JSObject *tmpObj = JSVAL_TO_OBJECT(${in_value});\n      ${($level + 1) * '\\t'}proxy = jsb_get_js_proxy(tmpObj);\n      ${($level + 1) * '\\t'}${out_value} = (${ntype})(proxy ? proxy->ptr : NULL);\n      ${($level + 1) * '\\t'}JSB_PRECONDITION2( ${out_value}, cx, JS_FALSE, \"Invalid Native Object\");\n      ${($level + 0) * '\\t'}} while (0)\n\n  from_native:\n    # int to jsval\n    int: \"${out_value} = int32_to_jsval(cx, ${in_value})\"\n    \"unsigned int\": \"${out_value} = uint32_to_jsval(cx, ${in_value})\"\n    \"unsigned short\": \"${out_value} = ushort_to_jsval(cx, ${in_value})\"\n    \"unsigned char\": \"${out_value} = uint32_to_jsval(cx, ${in_value})\"\n    \"long long\": \"${out_value} = long_long_to_jsval(cx, ${in_value})\"\n    \"std::string\": \"${out_value} = std_string_to_jsval(cx, ${in_value})\"\n    \"char*\": \"${out_value} = c_string_to_jsval(cx, ${in_value})\"\n    bool: \"${out_value} = BOOLEAN_TO_JSVAL(${in_value})\"\n    float: \"${out_value} = DOUBLE_TO_JSVAL(${in_value})\"\n    double: \"${out_value} = DOUBLE_TO_JSVAL(${in_value})\"\n    long: \"${out_value} = long_to_jsval(cx, ${in_value})\"\n    \"unsigned long\": \"${out_value} = ulong_to_jsval(cx, ${in_value})\"\n    \"ssize_t\": \"${out_value} = ssize_to_jsval(cx, ${in_value})\"\n    \"Point\": \"${out_value} = ccpoint_to_jsval(cx, ${in_value})\"\n    \"Rect\": \"${out_value} = ccrect_to_jsval(cx, ${in_value})\"\n    \"Size\": \"${out_value} = ccsize_to_jsval(cx, ${in_value})\"\n    \"Color4B\": \"${out_value} = cccolor4b_to_jsval(cx, ${in_value})\"\n    \"Color4F\": \"${out_value} = cccolor4f_to_jsval(cx, ${in_value})\"\n    \"Color3B\": \"${out_value} = cccolor3b_to_jsval(cx, ${in_value})\"\n    \"Array*\": \"${out_value} = ccarray_to_jsval(cx, ${in_value})\"\n    \"Dictionary*\": \"${out_value} = ccdictionary_to_jsval(cx, ${in_value})\"\n    \"AffineTransform\": \"${out_value} = ccaffinetransform_to_jsval(cx, ${in_value})\"\n    \"FontDefinition\": \"${out_value} = FontDefinition_to_jsval(cx, ${in_value})\"\n    \"String*\": \"${out_value} = std_string_to_jsval(cx, ${in_value}->getCString())\"\n    \"@Vector<.*>\": \"${out_value} = ccvector_to_jsval(cx, ${in_value})\"\n    \"@Map<std::basic_string.*>\": \"${out_value} = ccmap_string_key_to_jsval(cx, ${in_value})\"\n    \"Value\": \"${out_value} = ccvalue_to_jsval(cx, ${in_value})\"\n    \"ValueMap\": \"${out_value} = ccvaluemap_to_jsval(cx, ${in_value})\"\n    \"ValueMapIntKey\": \"${out_value} = ccvaluemapintkey_to_jsval(cx, ${in_value})\"\n    \"ValueVector\": \"${out_value} = ccvaluevector_to_jsval(cx, ${in_value})\"\n    \"@vector<std::basic_string.*>\": \"${out_value} = ccvector_std_string_to_jsval(cx, ${in_value})\"\n    \"@vector<int.*>\": \"${out_value} = ccvector_int_to_jsval(cx, ${in_value})\"\n    object: |\n      do {\n      ${($level + 1) * '\\t'}if (${in_value}) {\n      ${($level + 2) * '\\t'}js_proxy_t *proxy = js_get_or_create_proxy<${ntype.replace(\"*\", \"\").replace(\"const \", \"\")}>(cx, (${ntype.replace(\"const \", \"\")})${in_value});\n      ${($level + 2) * '\\t'}${out_value} = OBJECT_TO_JSVAL(proxy->obj);\n      ${($level + 1) * '\\t'}} else {\n      ${($level + 2) * '\\t'}${out_value} = JSVAL_NULL;\n      ${($level + 1) * '\\t'}}\n      ${($level) * '\\t'}} while (0)\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/apidoc_classfoot.js",
    "content": "};\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/apidoc_classhead.js",
    "content": "#set generator = $current_class.generator\n\n/**\n * @class ${current_class.class_name}\n */\n#if $generator.target_ns\n${generator.target_ns}.${current_class.target_class_name} = {\n#else\n${current_class.target_class_name} = {\n#end if\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/apidoc_function.js",
    "content": "/**\n * @method ${func_name}\n#if $is_constructor\n * @constructor\n#end if\n#if str($ret_type) != \"void\"\n * @return A value converted from C/C++ \"${ret_type}\"\n#end if\n#if $min_args > 0\n\t#for $arg in $arguments\n * @param {$arg}\n\t#end for\n#end if\n */\n${func_name} : function () {},\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/apidoc_ns.js",
    "content": "#if $target_ns\n#if $prefix\n/**\n * @module ${prefix}\n */\n#else\n/**\n * @module ${target_ns}\n */\n#end if\nvar ${target_ns} = ${target_ns} || {};\n#end if\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/function.h",
    "content": "JSBool js_${generator.prefix}_${class_name}_${func_name}(JSContext *cx, uint32_t argc, jsval *vp);\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/ifunction.c",
    "content": "## ===== instance function implementation template\nJSBool ${signature_name}(JSContext *cx, uint32_t argc, jsval *vp)\n{\n#if len($arguments) > 0\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n#end if\n#if not $is_constructor\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\t${namespaced_class_name}* cobj = (${namespaced_class_name} *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"${signature_name} : Invalid Native Object\");\n#end if\n#if len($arguments) >= $min_args\n\t#set arg_count = len($arguments)\n\t#set arg_idx = $min_args\n\t#while $arg_idx <= $arg_count\n\tif (argc == ${arg_idx}) {\n\t\t#set $count = 0\n\t\t#while $count < $arg_idx\n\t\t\t#set $arg = $arguments[$count]\n\t\t${arg.to_string($generator)} arg${count};\n\t\t\t#set $count = $count + 1\n\t\t#end while\n\t\t#set $count = 0\n\t\t#set arg_list = \"\"\n\t\t#set arg_array = []\n\t\t#while $count < $arg_idx\n\t\t\t#set $arg = $arguments[$count]\n\t\t${arg.to_native({\"generator\": $generator,\n\t\t\t\t\t\t\t \"in_value\": \"argv[\" + str(count) + \"]\",\n\t\t\t\t\t\t\t \"out_value\": \"arg\" + str(count),\n\t\t\t\t\t\t\t \"class_name\": $class_name,\n\t\t\t\t\t\t\t \"level\": 2,\n\t\t\t\t\t\t\t \"ntype\": str($arg)})};\n\t\t\t#set $arg_array += [\"arg\"+str(count)]\n\t\t\t#set $count = $count + 1\n\t\t#end while\n\t\t#if $arg_idx > 0\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"${signature_name} : Error processing arguments\");\n\t\t#end if\n\t\t#set $arg_list = \", \".join($arg_array)\n\t\t#if $is_constructor\n\t\t${namespaced_class_name}* cobj = new ${namespaced_class_name}($arg_list);\n#if not $generator.script_control_cpp\n\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\tif (_ccobj) {\n\t\t\t_ccobj->autorelease();\n\t\t}\n#end if\n\t\tTypeTest<${namespaced_class_name}> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\tJSObject *obj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\t// link the native object with the javascript object\n\t\tjs_proxy_t* p = jsb_new_proxy(cobj, obj);\n#if not $generator.script_control_cpp\n\t\tJS_AddNamedObjectRoot(cx, &p->obj, \"${namespaced_class_name}\");\n#end if\n\t\t#else\n\t\t\t#if $ret_type.name != \"void\"\n\t\t\t\t#if $ret_type.is_enum\n\t\tint ret = (int)cobj->${func_name}($arg_list);\n\t\t\t\t#else\n\t\t${ret_type.get_whole_name($generator)} ret = cobj->${func_name}($arg_list);\n\t\t\t\t#end if\n\t\tjsval jsret = JSVAL_NULL;\n\t\t${ret_type.from_native({\"generator\": $generator,\n\t\t\t\t\t\t\t\t\t\"in_value\": \"ret\",\n\t\t\t\t\t\t\t\t\t\"out_value\": \"jsret\",\n\t\t\t\t\t\t\t\t\t\"ntype\": str($ret_type),\n\t\t\t\t\t\t\t\t\t\"level\": 2})};\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\t#else\n\t\tcobj->${func_name}($arg_list);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\t#end if\n\t\t#end if\n\t\treturn JS_TRUE;\n\t}\n\t\t#set $arg_idx = $arg_idx + 1\n\t#end while\n#end if\n\n\tJS_ReportError(cx, \"${signature_name} : wrong number of arguments: %d, was expecting %d\", argc, ${min_args});\n\treturn JS_FALSE;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/ifunction_overloaded.c",
    "content": "## ===== instance function implementation template - for overloaded functions\nJSBool ${signature_name}(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\n\tJSObject *obj = NULL;\n\t${namespaced_class_name}* cobj = NULL;\n#if not $is_constructor\n\tobj = JS_THIS_OBJECT(cx, vp);\n\tjs_proxy_t *proxy = jsb_get_js_proxy(obj);\n\tcobj = (${namespaced_class_name} *)(proxy ? proxy->ptr : NULL);\n\tJSB_PRECONDITION2( cobj, cx, JS_FALSE, \"${signature_name} : Invalid Native Object\");\n#end if\n#for func in $implementations\n#if len($func.arguments) >= $func.min_args\n\t#set arg_count = len($func.arguments)\n\t#set arg_idx = $func.min_args\n\t#while $arg_idx <= $arg_count\n\t#set arg_list = \"\"\n\t#set arg_array = []\n\tdo {\n\t\t#if $func.min_args >= 0\n\t\tif (argc == $arg_idx) {\n\t\t\t#set $count = 0\n\t\t\t#while $count < $arg_idx\n\t\t\t#set $arg = $func.arguments[$count]\n\t\t\t${arg.to_string($generator)} arg${count};\n\t\t\t${arg.to_native({\"generator\": $generator,\n\t\t\t\t\t\t\t \"in_value\": \"argv[\" + str(count) + \"]\",\n\t\t\t\t\t\t\t \"out_value\": \"arg\" + str(count),\n\t\t\t\t\t\t\t \"class_name\": $class_name,\n\t\t\t\t\t\t\t \"level\": 3,\n\t\t\t\t\t\t\t \"ntype\": str($arg)})};\n\t\t\t\t#set $arg_array += [\"arg\"+str(count)]\n\t\t\t\t#set $count = $count + 1\n\t\t\t#if $arg_idx > 0\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\t#end if\n\t\t\t#end while\n\t\t\t#set $arg_list = \", \".join($arg_array)\n\t\t#end if\n\t\t#if $is_constructor\n\t\t\tcobj = new ${namespaced_class_name}(${arg_list});\n#if not $generator.script_control_cpp\n\t\t\tcocos2d::Object *_ccobj = dynamic_cast<cocos2d::Object *>(cobj);\n\t\t\tif (_ccobj) {\n\t\t\t\t_ccobj->autorelease();\n\t\t\t}\n#end if\n\t\t\tTypeTest<${namespaced_class_name}> t;\n\t\t\tjs_type_class_t *typeClass = nullptr;\n\t\t\tstd::string typeName = t.s_name();\n\t\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\t\ttypeClass = typeMapIter->second;\n\t\t\tCCASSERT(typeClass, \"The value is null.\");\n\t\t\tobj = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t\t\tjs_proxy_t* proxy = jsb_new_proxy(cobj, obj);\n#if not $generator.script_control_cpp\n\t\t\tJS_AddNamedObjectRoot(cx, &proxy->obj, \"${namespaced_class_name}\");\n#end if\n\t\t#else\n\t\t\t#if str($func.ret_type) != \"void\"\n\t\t\t\t#if $func.ret_type.is_enum\n\t\t\tint ret = (int)cobj->${func.func_name}($arg_list);\n\t\t\t\t#else\n\t\t\t${func.ret_type.get_whole_name($generator)} ret = cobj->${func.func_name}($arg_list);\n\t\t\t\t#end if\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\t${func.ret_type.from_native({\"generator\": $generator,\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \"in_value\": \"ret\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \"out_value\": \"jsret\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \"ntype\": str($func.ret_type),\n\t\t\t\t\t\t\t\t\t\t\t\t\t  \"level\": 2})};\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\t#else\n\t\t\tcobj->${func.func_name}($arg_list);\n\t\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t\t\t#end if\n\t\t\treturn JS_TRUE;\n\t\t#end if\n\t\t}\n\t} while(0);\n\n\t#set $arg_idx = $arg_idx + 1\n\t#end while\n#end if\n#end for\n#if $is_constructor\n\tif (cobj) {\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj));\n\t\treturn JS_TRUE;\n\t}\n#end if\n\tJS_ReportError(cx, \"${signature_name} : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/lambda.c",
    "content": "do {\n\tstd::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, JS_THIS_OBJECT(cx, vp), ${in_value}));\n\tauto lambda = [=](${lambda_parameters}) -> ${ret_type.name} {\n\t\t#set arg_count = len($param_types)\n\t\t#if $arg_count > 0\n\t\tjsval largv[${arg_count}];\n\t\t#end if\n\t\t#set $count = 0\n\t\t#while $count < $arg_count\n\t\t\t#set $arg = $param_types[$count]\n\t\t${arg.from_native({\"generator\": $generator,\n\t\t\t\t\t\t\t \"in_value\": \"larg\" + str(count),\n\t\t\t\t\t\t\t \"out_value\": \"largv[\" + str(count) + \"]\",\n\t\t\t\t\t\t\t \"class_name\": $class_name,\n\t\t\t\t\t\t\t \"level\": 2,\n\t\t\t\t\t\t\t \"ntype\": str($arg)})};\n\t\t\t#set $count = $count + 1\n\t\t#end while\n\t\tjsval rval;\n\t\t#if $arg_count > 0\n\t\tJSBool ok = func->invoke(${arg_count}, &largv[0], rval);\n\t\t#else\n\t\tJSBool ok = func->invoke(${arg_count}, nullptr, rval);\n\t\t#end if\n\t\tif (!ok && JS_IsExceptionPending(cx)) {\n\t\t\tJS_ReportPendingException(cx);\n\t\t}\n\t\t#if $ret_type.name != \"void\"\n\t\t${ret_type.get_whole_name($generator)} ret;\n\t\t${ret_type.to_native({\"generator\": $generator,\n\t\t\t\t\t\t\t \"in_value\": \"rval\",\n\t\t\t\t\t\t\t \"out_value\": \"ret\",\n\t\t\t\t\t\t\t \"ntype\": str($ret_type),\n\t\t\t\t\t\t\t \"level\": 2})};\n\t\treturn ret;\n\t\t#end if\n\t};\n\t${out_value} = lambda;\n} while(0)\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/layout_foot.c",
    "content": "void register_all_${prefix}(JSContext* cx, JSObject* obj) {\n\t#if $target_ns\n\t// first, try to get the ns\n\tJS::RootedValue nsval(cx);\n\tJSObject *ns;\n\tJS_GetProperty(cx, obj, \"${target_ns}\", &nsval);\n\tif (nsval == JSVAL_VOID) {\n\t\tns = JS_NewObject(cx, NULL, NULL, NULL);\n\t\tnsval = OBJECT_TO_JSVAL(ns);\n\t\tJS_SetProperty(cx, obj, \"${target_ns}\", nsval);\n\t} else {\n\t\tJS_ValueToObject(cx, nsval, &ns);\n\t}\n\tobj = ns;\n\t#end if\n\n\t#for jsclass in $sorted_classes\n\t#if $in_listed_classes(jsclass)\n\tjs_register_${prefix}_${jsclass}(cx, obj);\n\t#end if\n\t#end for\n}\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/layout_foot.h",
    "content": "\\#endif\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/layout_head.c",
    "content": "\\#include \"${out_file}.hpp\"\n\\#include \"cocos2d_specifics.hpp\"\n#for header in $headers\n\\#include \"${os.path.basename(header)}\"\n#end for\n\ntemplate<class T>\nstatic JSBool dummy_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n    JS::RootedValue initializing(cx);\n    JSBool isNewValid = JS_TRUE;\n#if not $script_control_cpp\n    JSObject* global = ScriptingCore::getInstance()->getGlobalObject();\n\tisNewValid = JS_GetProperty(cx, global, \"initializing\", &initializing) && JSVAL_TO_BOOLEAN(initializing);\n#end if\n\tif (isNewValid)\n\t{\n\t\tTypeTest<T> t;\n\t\tjs_type_class_t *typeClass = nullptr;\n\t\tstd::string typeName = t.s_name();\n\t\tauto typeMapIter = _js_global_type_map.find(typeName);\n\t\tCCASSERT(typeMapIter != _js_global_type_map.end(), \"Can't find the class type!\");\n\t\ttypeClass = typeMapIter->second;\n\t\tCCASSERT(typeClass, \"The value is null.\");\n\n\t\tJSObject *_tmp = JS_NewObject(cx, typeClass->jsclass, typeClass->proto, typeClass->parentProto);\n\t#if $script_control_cpp\n\t\tT* cobj = new T();\n\t\tjs_proxy_t *pp = jsb_new_proxy(cobj, _tmp);\n\t\tJS_AddObjectRoot(cx, &pp->obj);\n\t#end if\n\t\tJS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(_tmp));\n\t\treturn JS_TRUE;\n\t}\n\n#if not $script_control_cpp\n    JS_ReportError(cx, \"Don't use `new cc.XXX`, please use `cc.XXX.create` instead! \");\n#end if\n    return JS_FALSE;\n}\n\nstatic JSBool empty_constructor(JSContext *cx, uint32_t argc, jsval *vp) {\n\treturn JS_FALSE;\n}\n\nstatic JSBool js_is_native_obj(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHandleValue vp)\n{\n\tvp.set(BOOLEAN_TO_JSVAL(JS_TRUE));\n\treturn JS_TRUE;\t\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/layout_head.h",
    "content": "\\#ifndef __${prefix}_h__\n\\#define __${prefix}_h__\n\n\\#include \"jsapi.h\"\n\\#include \"jsfriendapi.h\"\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/prelude.c",
    "content": "#set generator = $current_class.generator\nJSClass  *jsb_${current_class.underlined_class_name}_class;\nJSObject *jsb_${current_class.underlined_class_name}_prototype;\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/prelude.h",
    "content": "#set generator = $current_class.generator\n\nextern JSClass  *jsb_${current_class.underlined_class_name}_class;\nextern JSObject *jsb_${current_class.underlined_class_name}_prototype;\n\nJSBool js_${generator.prefix}_${current_class.class_name}_constructor(JSContext *cx, uint32_t argc, jsval *vp);\nvoid js_${generator.prefix}_${current_class.class_name}_finalize(JSContext *cx, JSObject *obj);\nvoid js_register_${generator.prefix}_${current_class.class_name}(JSContext *cx, JSObject *global);\nvoid register_all_${generator.prefix}(JSContext* cx, JSObject* obj);\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/register.c",
    "content": "#set has_constructor = False\n#if $current_class.methods.has_key('constructor')\n#set has_constructor = True\n${current_class.methods.constructor.generate_code($current_class)}\n#end if\n\n#set generator = $current_class.generator\n#set methods = $current_class.methods_clean()\n#set st_methods = $current_class.static_methods_clean()\n#if len($current_class.parents) > 0\nextern JSObject *jsb_${current_class.parents[0].underlined_class_name}_prototype;\n#end if\n\nvoid js_${current_class.underlined_class_name}_finalize(JSFreeOp *fop, JSObject *obj) {\n    CCLOGINFO(\"jsbindings: finalizing JS object %p (${current_class.class_name})\", obj);\n#if $generator.script_control_cpp\n    js_proxy_t* nproxy;\n    js_proxy_t* jsproxy;\n    jsproxy = jsb_get_js_proxy(obj);\n    if (jsproxy) {\n        nproxy = jsb_get_native_proxy(jsproxy->ptr);\n\n        ${current_class.namespaced_class_name} *nobj = static_cast<${current_class.namespaced_class_name} *>(nproxy->ptr);\n        if (nobj)\n            delete nobj;\n        \n        jsb_remove_proxy(nproxy, jsproxy);\n    }\n#end if\n}\n\n#if $generator.in_listed_extend_classed($current_class.class_name) and not $current_class.is_abstract\nstatic JSBool js_${current_class.underlined_class_name}_ctor(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tJSObject *obj = JS_THIS_OBJECT(cx, vp);\n    ${current_class.namespaced_class_name} *nobj = ${current_class.namespaced_class_name}::create();\n    js_proxy_t* p = jsb_new_proxy(nobj, obj);\n#if not $generator.script_control_cpp\n    JS_AddNamedObjectRoot(cx, &p->obj, \"${current_class.namespaced_class_name}\");\n#end if \n    JS_SET_RVAL(cx, vp, JSVAL_VOID);\n    return JS_TRUE;\n}\n#end if\nvoid js_register_${generator.prefix}_${current_class.class_name}(JSContext *cx, JSObject *global) {\n\tjsb_${current_class.underlined_class_name}_class = (JSClass *)calloc(1, sizeof(JSClass));\n\tjsb_${current_class.underlined_class_name}_class->name = \"${current_class.target_class_name}\";\n\tjsb_${current_class.underlined_class_name}_class->addProperty = JS_PropertyStub;\n\tjsb_${current_class.underlined_class_name}_class->delProperty = JS_DeletePropertyStub;\n\tjsb_${current_class.underlined_class_name}_class->getProperty = JS_PropertyStub;\n\tjsb_${current_class.underlined_class_name}_class->setProperty = JS_StrictPropertyStub;\n\tjsb_${current_class.underlined_class_name}_class->enumerate = JS_EnumerateStub;\n\tjsb_${current_class.underlined_class_name}_class->resolve = JS_ResolveStub;\n\tjsb_${current_class.underlined_class_name}_class->convert = JS_ConvertStub;\n\tjsb_${current_class.underlined_class_name}_class->finalize = js_${current_class.underlined_class_name}_finalize;\n\tjsb_${current_class.underlined_class_name}_class->flags = JSCLASS_HAS_RESERVED_SLOTS(2);\n\n\tstatic JSPropertySpec properties[] = {\n\t\t{\"__nativeObj\", 0, JSPROP_ENUMERATE | JSPROP_PERMANENT, JSOP_WRAPPER(js_is_native_obj), JSOP_NULLWRAPPER},\n\t\t{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\t};\n\n\tstatic JSFunctionSpec funcs[] = {\n\t\t#for m in methods\n\t\t#set fn = m['impl']\n\t\tJS_FN(\"${m['name']}\", ${fn.signature_name}, ${fn.min_args}, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\t#end for\n#if $generator.in_listed_extend_classed($current_class.class_name) and not $current_class.is_abstract\n        JS_FN(\"ctor\", js_${current_class.underlined_class_name}_ctor, 0, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n#end if\n        JS_FS_END\n\t};\n\n\t#if len(st_methods) > 0\n\tstatic JSFunctionSpec st_funcs[] = {\n\t\t#for m in st_methods\n\t\t#set fn = m['impl']\n\t\tJS_FN(\"${m['name']}\", ${fn.signature_name}, ${fn.min_args}, JSPROP_PERMANENT | JSPROP_ENUMERATE),\n\t\t#end for\n\t\tJS_FS_END\n\t};\n\t#else\n\tJSFunctionSpec *st_funcs = NULL;\n\t#end if\n\n\tjsb_${current_class.underlined_class_name}_prototype = JS_InitClass(\n\t\tcx, global,\n#if len($current_class.parents) > 0\n\t\tjsb_${current_class.parents[0].underlined_class_name}_prototype,\n#else\n\t\tNULL, // parent proto\n#end if\n\t\tjsb_${current_class.underlined_class_name}_class,\n#if has_constructor\n\t\tjs_${generator.prefix}_${current_class.class_name}_constructor, 0, // constructor\n#else if $current_class.is_abstract\n\t\tempty_constructor, 0,\n#else\n\t\tdummy_constructor<${current_class.namespaced_class_name}>, 0, // no constructor\n#end if\n\t\tproperties,\n\t\tfuncs,\n\t\tNULL, // no static properties\n\t\tst_funcs);\n\t// make the class enumerable in the registered namespace\n\tJSBool found;\n\tJS_SetPropertyAttributes(cx, global, \"${current_class.target_class_name}\", JSPROP_ENUMERATE | JSPROP_READONLY, &found);\n\n\t// add the proto and JSClass to the type->js info hash table\n\tTypeTest<${current_class.namespaced_class_name}> t;\n\tjs_type_class_t *p;\n\tstd::string typeName = t.s_name();\n\tif (_js_global_type_map.find(typeName) == _js_global_type_map.end())\n\t{\n\t\tp = (js_type_class_t *)malloc(sizeof(js_type_class_t));\n\t\tp->jsclass = jsb_${current_class.underlined_class_name}_class;\n\t\tp->proto = jsb_${current_class.underlined_class_name}_prototype;\n#if len($current_class.parents) > 0\n\t\tp->parentProto = jsb_${current_class.parents[0].underlined_class_name}_prototype;\n#else\n\t\tp->parentProto = NULL;\n#end if\n\t\t_js_global_type_map.insert(std::make_pair(typeName, p));\n\t}\n}\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/sfunction.c",
    "content": "## ===== static function implementation template\nJSBool ${signature_name}(JSContext *cx, uint32_t argc, jsval *vp)\n{\n#if len($arguments) > 0\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n#end if\n#if len($arguments) >= $min_args\n\t#set arg_count = len($arguments)\n\t#set arg_idx = $min_args\n\t#while $arg_idx <= $arg_count\n\tif (argc == ${arg_idx}) {\n\t\t#set arg_list = \"\"\n\t\t#set arg_array = []\n\t\t#set $count = 0\n\t\t#while $count < $arg_idx\n\t\t\t#set $arg = $arguments[$count]\n\t\t${arg.to_string($generator)} arg${count};\n\t\t\t#set $count = $count + 1\n\t\t#end while\n\t\t#set $count = 0\n\t\t#while $count < $arg_idx\n\t\t\t#set $arg = $arguments[$count]\n\t\t${arg.to_native({\"generator\": $generator,\n\t\t\t\"in_value\": \"argv[\" + str(count) + \"]\",\n\t\t\t\"out_value\": \"arg\" + str(count),\n\t\t\t\"class_name\": $class_name,\n\t\t\t\"level\": 2,\n\t\t\t\"ntype\": str($arg)})};\n\t        #set $arg_array += [\"arg\"+str($count)]\n\t        #set $count = $count + 1\n\t\t#end while\n\t\t#if $arg_idx > 0\n\t\tJSB_PRECONDITION2(ok, cx, JS_FALSE, \"${signature_name} : Error processing arguments\");\n\t\t#end if\n\t\t#set $arg_list = \", \".join($arg_array)\n\t#if str($ret_type) != \"void\"\n\t\t#if $ret_type.is_enum\n\t\tint ret = (int)${namespaced_class_name}::${func_name}($arg_list);\n\t\t#else\n\t\t${ret_type.get_whole_name($generator)} ret = ${namespaced_class_name}::${func_name}($arg_list);\n\t\t#end if\n\t\tjsval jsret = JSVAL_NULL;\n\t\t${ret_type.from_native({\"generator\": $generator,\n\t\t\t\t\t\t\t\t\"in_value\": \"ret\",\n\t\t\t\t\t\t\t\t\"out_value\": \"jsret\",\n\t\t\t\t\t\t\t\t\"ntype\": str($ret_type),\n\t\t\t\t\t\t\t\t\"level\": 1})};\n\t\tJS_SET_RVAL(cx, vp, jsret);\n\t#else\n\t\t${namespaced_class_name}::${func_name}($arg_list);\n\t\tJS_SET_RVAL(cx, vp, JSVAL_VOID);\n\t#end if\n\t\treturn JS_TRUE;\n\t}\n\t\t#set $arg_idx = $arg_idx + 1\n\t#end while\n#end if\n\tJS_ReportError(cx, \"${signature_name} : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/targets/spidermonkey/templates/sfunction_overloaded.c",
    "content": "## ===== static function implementation template - for overloaded functions\nJSBool ${signature_name}(JSContext *cx, uint32_t argc, jsval *vp)\n{\n\tjsval *argv = JS_ARGV(cx, vp);\n\tJSBool ok = JS_TRUE;\n\t#for func in $implementations\n\t\n\t#if len($func.arguments) >= $func.min_args\n\t#set arg_count = len($func.arguments)\n\t#set arg_idx = $func.min_args\n\t#while $arg_idx <= $arg_count\n\tdo {\n\t\tif (argc == ${arg_idx}) {\n\t\t\t#set arg_list = \"\"\n\t\t\t#set arg_array = []\n\t\t\t#set count = 0\n\t\t\t#while $count < $arg_idx\n\t\t\t\t#set $arg = $func.arguments[$count]\n\t\t\t${arg.to_string($generator)} arg${count};\n\t\t\t${arg.to_native({\"generator\": $generator,\n\t\t\t\t\t\t\t \"in_value\": \"argv[\" + str(count) + \"]\",\n\t\t\t\t\t\t\t \"out_value\": \"arg\" + str(count),\n\t\t\t\t\t\t\t \"class_name\": $class_name,\n\t\t\t\t\t\t\t \"level\": 3,\n\t\t\t\t\t\t\t \"ntype\": str($arg)})};\n\t\t\t#set $arg_array += [\"arg\"+str(count)]\n\t\t\t#set $count = $count + 1\n\t\t\t#if $arg_idx > 0\n\t\t\tif (!ok) { ok = JS_TRUE; break; }\n\t\t\t#end if\n\t\t\t#end while\n\t\t\t#set $arg_list = \", \".join($arg_array)\n\t\t\t#if str($func.ret_type) != \"void\"\n\t\t\t\t#if $func.ret_type.is_enum\n\t\t\tint ret = (int)${namespaced_class_name}::${func.func_name}($arg_list);\n\t\t\t\t#else\n\t\t\t${func.ret_type.get_whole_name($generator)} ret = ${namespaced_class_name}::${func.func_name}($arg_list);\n\t\t\t\t#end if\n\t\t\tjsval jsret = JSVAL_NULL;\n\t\t\t${func.ret_type.from_native({\"generator\": $generator,\n\t\t\t\t\t\t\t\t\t\t \"in_value\": \"ret\",\n\t\t\t\t\t\t\t\t\t\t \"out_value\": \"jsret\",\n\t\t\t\t\t\t\t\t\t\t \"ntype\": str($func.ret_type),\n\t\t\t\t\t\t\t\t\t\t \"level\": 3})};\n\t\t\tJS_SET_RVAL(cx, vp, jsret);\n\t\t\t#else\n\t\t\t${namespaced_class_name}::${func.func_name}($arg_list);\n\t\t\t#end if\n\t\t\treturn JS_TRUE;\n\t\t}\n\t\t#set $arg_idx = $arg_idx + 1\n\t} while (0);\n\t#end while\n\t#end if\n\t#end for\n\tJS_ReportError(cx, \"${signature_name} : wrong number of arguments\");\n\treturn JS_FALSE;\n}\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/test/simple_test/simple_class.cpp",
    "content": "/**\n * Simple example of a C++ class that can be binded using the\n * automatic script generator\n */\n\n#include \"simple_class.h\"\n\nSimpleNativeClass::SimpleNativeClass()\n{\n\t// just set some fields\n\tm_someField = 0;\n\tm_someOtherField = 10;\n\tm_anotherMoreComplexField = NULL;\n}\n\n// empty destructor\nSimpleNativeClass::~SimpleNativeClass()\n{\n}\n\nlong long SimpleNativeClass::thisReturnsALongLong() {\n\tstatic long long __id = 0;\n\treturn __id++;\n}\n\nvoid SimpleNativeClass::func() {\n}\n\nvoid SimpleNativeClass::func(int a) {\n}\n\nvoid SimpleNativeClass::func(int a, float b) {\n}\n\nlong long SimpleNativeClass::receivesLongLong(long long someId) {\n\treturn someId + 1;\n}\n\nstd::string SimpleNativeClass::returnsAString() {\n\tstd::string myString = \"my std::string\";\n\treturn myString;\n}\n\nconst char *SimpleNativeClass::returnsACString() {\n\treturn \"this is a c-string\";\n}\n\n// just a very simple function :)\nint SimpleNativeClass::doSomeProcessing(std::string arg1, std::string arg2)\n{\n\treturn arg1.length() + arg2.length();\n}\n\nvoid SimpleNativeClass::setAnotherMoreComplexField(const char *str)\n{\n\tif (m_anotherMoreComplexField) {\n\t\tfree(m_anotherMoreComplexField);\n\t}\n\tsize_t len = strlen(str);\n\tm_anotherMoreComplexField = (char *)malloc(len);\n\tmemcpy(m_anotherMoreComplexField, str, len);\n}\n\nnamespace SomeNamespace\n{\nAnotherClass::AnotherClass()\n{\n\tjustOneField = 1313;\n\taPublicField = 1337;\n}\n// empty destructor\nAnotherClass::~AnotherClass()\n{\n}\n\nvoid AnotherClass::doSomethingSimple() {\n\tfprintf(stderr, \"just doing something simple\\n\");\n}\n};\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/test/simple_test/simple_class.h",
    "content": "#ifndef __SIMPLE_CLASS_H__\n#define __SIMPLE_CLASS_H__\n\n#include <string>\n#include <stdint.h>\n\nenum someThingEnumerated {\n\tkValue1 = 1,\n\tkValue2,\n\tkValue3,\n\tkValue4\n};\n\nclass SimpleNativeClass\n{\nprotected:\n\tint m_someField;\n\tint m_someOtherField;\n\tchar* m_anotherMoreComplexField;\n\npublic:\n    static const uint32_t OBJECT_TYPE = 0x777;\n    virtual uint32_t getObjectType() {\n        return SimpleNativeClass::OBJECT_TYPE;\n    };\n\n    SimpleNativeClass();\n\tSimpleNativeClass(int m) : m_someField(m) {};\n\tSimpleNativeClass(int m1, int m2) : m_someField(m1), m_someOtherField(m2) {};\n\t~SimpleNativeClass();\n\n\t// these methods are simple, can be defined inline\n\tint getSomeField() {\n\t\treturn m_someField;\n\t}\n\tint getSomeOtherField() {\n\t\treturn m_someOtherField;\n\t}\n\tconst char *getAnotherMoreComplexField() {\n\t\treturn m_anotherMoreComplexField;\n\t}\n\tvoid setSomeField(int f) {\n\t\tm_someField = f;\n\t}\n\tvoid setSomeField() {\n\n\t}\n\tvoid setSomeOtherField(int f) {\n\t\tm_someOtherField = f;\n\t}\n\tvoid setAnotherMoreComplexField(const char *str);\n\n\tlong long thisReturnsALongLong();\n\n\tstatic void func();\n\tstatic void func(int a);\n\tstatic void func(int a, float b);\n\n\tlong long receivesLongLong(long long someId);\n\tstd::string returnsAString();\n\tconst char *returnsACString();\n\n\tint doSomeProcessing(std::string arg1, std::string arg2);\n};\n\nnamespace SomeNamespace {\nclass AnotherClass {\nprotected:\n\tint justOneField;\n\npublic:\n    static const uint32_t OBJECT_TYPE = 0x778;\n    virtual uint32_t getObjectType() {\n        return AnotherClass::OBJECT_TYPE;\n    };\n\tint aPublicField;\n\n\tAnotherClass();\n\t~AnotherClass();\n\n\t// also simple methods, can be defined inline\n\tint getJustOneField() {\n\t\treturn justOneField;\n\t}\n\t// wrong setter - won't work (needs ONLY one parameter in order to work)\n\tvoid setJustOneField() {\n\t\tjustOneField = 999;\n\t}\n\n\tvoid doSomethingSimple();\n};\n};\n\n#endif\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/test/test.bat",
    "content": "@echo off\n\n:: This script is used to generate jsbinding glue codes.\n:: Android ndk version must be ndk-r9b.\n\nsetlocal\n:: You should modify PYTHON_ROOT and NDK_ROOT to work under your environment.\n:: or just uncomment the follow 2 lines and set them.\n\n:: set PYTHON_ROOT=C:/Python27\n:: set NDK_ROOT=G:/android/android-ndk-r9b\n\nsetlocal ENABLEEXTENSIONS\nif %errorlevel% neq 0 (\n    echo Unable to enable extensions\n    exit /b 1\n    )\n\nif defined PYTHON_ROOT (echo PYTHON_ROOT is defined.) else (\n    echo PYTHON_ROOT is NOT defined!\n    exit /b 1\n    )\n\nif defined NDK_ROOT (echo NDK_ROOT is defined.) else (\n    echo NDK_ROOT is NOT defined!\n    exit /b 1\n    )\n\n:: Check use 32-bit or 64-bit\n:: Assume 64-bit\nset TEMP=windows-x86_64\nif not exist \"%NDK_ROOT%/toolchains/llvm-3.3/prebuilt/%TEMP%\" set TEMP=\n:: Otherwise fall back to 32-bit make\nif \"%TEMP%\"==\"\" set TEMP=windows\n\nset NDK_LLVM_ROOT=%NDK_ROOT%/toolchains/llvm-3.3/prebuilt/%TEMP%\n\nset CXX_GENERATOR_ROOT=%cd%/..\nset \"CXX_GENERATOR_ROOT=%CXX_GENERATOR_ROOT:\\=/%\"\nset OUTPUT_DIR=%CXX_GENERATOR_ROOT%/test/simple_test_bindings\nset \"OUTPUT_DIR=%OUTPUT_DIR:/=\\%\"\n\n:: set the tools path into PATH\nset PATH=%PATH%;%CXX_GENERATOR_ROOT%/libclang;%CXX_GENERATOR_ROOT%/tools/win32;%PYTHON_ROOT%\n\n:: write userconf.ini\nset _CONF_INI_FILE=%cd%\\userconf.ini\nif exist %_CONF_INI_FILE% del /Q %_CONF_INI_FILE%\n\n\necho\necho generating userconf.ini...\necho ---\necho [DEFAULT] > %_CONF_INI_FILE%\necho androidndkdir=%NDK_ROOT% >> %_CONF_INI_FILE%\necho clangllvmdir=%NDK_LLVM_ROOT% >> %_CONF_INI_FILE%\necho cxxgeneratordir=%CXX_GENERATOR_ROOT% >> %_CONF_INI_FILE%\n:: fixme: to fix parse error, we must difine __WCHAR_MAX__ here.\necho extra_flags=-D__WCHAR_MAX__=0x7fffffff >> %_CONF_INI_FILE%\necho ---\n\n\n\n:: Generate bindings for cocos2dx\necho \"Generating bindings for simpletest with Android headers...\"\npython %CXX_GENERATOR_ROOT%/generator.py %CXX_GENERATOR_ROOT%/test/test.ini -t spidermonkey -s testandroid -o %OUTPUT_DIR%\nif %errorlevel% neq 0 goto ERROR\n\n:: Change the generated file format from DOS to UNIX.\npushd \"%OUTPUT_DIR%\"\ndos2unix *\npopd\n\ngoto PASS\n\n:PASS\necho ---------------------------------\necho Generating bindings succeeds.\necho ---------------------------------\nendlocal\nexit /b 0\n\n:ERROR\necho ---------------------------------\necho Generating bindings fails.\necho ---------------------------------\nendlocal\nexit /b 1\n\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/test/test.ini",
    "content": "[testandroid]\nname = simple_test\nprefix = autogentestbindings\nclasses = SimpleNativeClass\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_\n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include\nclang_flags = -nostdinc -x c++ -std=c++11\n\nsimple_test_headers = -I%(cxxgeneratordir)s/test/simple_tes\n\nextra_arguments = %(android_headers)s %(clang_headers)s %(android_flags)s %(clang_flags)s %(simple_test_headers)s %(extra_flags)s\n\nheaders = %(cxxgeneratordir)s/test/simple_test/simple_class.h\n\ntarget_namespace =\nremove_prefix =\nskip = \nbase_objects =\nabstract_classes =\nclasses_have_type_info = no\nrename =\nrename_functions =\nrename_classes =\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents =\n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip =\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = yes\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/test/test.sh",
    "content": "#!/bin/bash\n# \n# Usage:\n#   export NDK_ROOT=/path/to/NDK-r9b\n#   ./test.sh\n\n# exit this script if any commmand fails\nset -e\n\n# read user.cfg if it exists and is readable\n\n_CFG_FILE=$(dirname \"$0\")\"/user.cfg\"\nif [ -f \"$_CFG_FILE\" ];\nthen\n    if [ ! -r \"$_CFG_FILE\" ]; then\n       echo \"Fatal Error: $_CFG_FILE exists but is unreadable\"\n       exit 1\n    fi\nfi\n\n# paths\n\nif [ -z \"${NDK_ROOT+aaa}\" ]; then\n# ... if NDK_ROOT is not set, use \"$HOME/bin/android-ndk\"\n    NDK_ROOT=\"$HOME/bin/android-ndk\"\nfi\n\nif [ -z \"${PYTHON_BIN+aaa}\" ]; then\n# ... if PYTHON_BIN is not set, use \"/usr/bin/python2.7\"\n    PYTHON_BIN=\"/usr/bin/python2.7\"\nfi\n\n# find current dir\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\n# paths with defaults hardcoded to relative paths\n\nif [ -z \"${CXX_GENERATOR_ROOT+aaa}\" ]; then\n    CXX_GENERATOR_ROOT=\"$DIR/..\"\nfi\n\n\necho \"Paths\"\necho \"    NDK_ROOT: $NDK_ROOT\"\necho \"    PYTHON_BIN: $PYTHON_BIN\"\necho \"    CXX_GENERATOR_ROOT: $CXX_GENERATOR_ROOT\"\necho \"    TO_JS_ROOT: $TO_JS_ROOT\"\n\n# check NDK version, must be r9b\nif ! grep -q r9b $NDK_ROOT/RELEASE.TXT\nthen\n    echo \" Fatal Error: NDK r9b must be required!\"\n    exit 1\nfi\n\n# check clang include path\nOS_NAME=$('uname')\nNDK_LLVM_ROOT=$NDK_ROOT/toolchains/llvm-3.3/prebuilt\ncase \"$OS_NAME\" in\n    Darwin | darwin)\n        echo \"in darwin\"\n        if [ -d \"$NDK_LLVM_ROOT/darwin-x86_64\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/darwin-x86_64\n        elif [ -d \"$NDK_LLVM_ROOT/darwin-x86\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/darwin-x86\n        else\n            echo $NDK_LLVM_ROOT\n            echo \" Fatal Error: $NDK_LLVM_ROOT doesn't contains prebuilt llvm 3.3\"\n            exit 1\n        fi\n        ;;\n    Linux | linux)\n        echo \"in linux\"\n        if [ -d \"$NDK_LLVM_ROOT/linux-x86_64\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/linux-x86_64\n        elif [ -d \"$NDK_LLVM_ROOT/linux-x86\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/linux-x86\n        else\n            echo \" Fatal Error: $NDK_LLVM_ROOT doesn't contains prebuilt llvm 3.3\"\n            exit 1\n        fi\n        ;;\n    *)\n        echo \" Fatal Error: Please run this script in linux or mac osx.\"\n        exit 1\n        ;;\nesac\n\n\n# write userconf.ini\n\n_CONF_INI_FILE=\"$PWD/userconf.ini\"\nif [ -f \"$_CONF_INI_FILE\" ]\nthen\n    rm \"$_CONF_INI_FILE\"\nfi\n\n_CONTENTS=\"\"\n_CONTENTS+=\"[DEFAULT]\"'\\n'\n_CONTENTS+=\"androidndkdir=$NDK_ROOT\"'\\n'\n_CONTENTS+=\"clangllvmdir=$NDK_LLVM_ROOT\"'\\n'\n_CONTENTS+=\"cxxgeneratordir=$CXX_GENERATOR_ROOT\"'\\n'\n_CONTENTS+=\"extra_flags=\"'\\n'\n\necho \necho \"generating userconf.ini...\"\necho ---\necho -e \"$_CONTENTS\"\necho -e \"$_CONTENTS\" > \"$_CONF_INI_FILE\"\necho ---\n\n# Generate bindings for cocos2dx\necho \"Generating bindings for cocos2dx...\"\nset -x\n\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${CXX_GENERATOR_ROOT}/test/test.ini -t spidermonkey -s testandroid -o ./simple_test_bindings\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/test/user.cfg.sample",
    "content": "PYTHON_BIN=/opt/local/bin/python\n"
  },
  {
    "path": "cocos2d/tools/bindings-generator/test/userconf.ini.sample",
    "content": "[DEFAULT]\nandroidndkdir=/path/to/android-ndk\nclangllvmdir=/path/to/clang+llvm-3.3\ncxxgeneratordir=/path/to/bindings-generator\n"
  },
  {
    "path": "cocos2d/tools/closure-compiler/obfuscate.py",
    "content": "#!/usr/bin/python\n# obfuscate.py\n# Create Ant buildfile to obfuscate game source code\n# Copyright (c) 2012 cocos2d-x.org\n# Author: WangZhe\n\n# define global variables\ncontext = {\n    \"input\"        : \"undefined\",\n    \"output\"       : \"undefined\",\n    \"cocos2d\"      : \"undefined\",\n}\n\n# begin\nimport sys\nimport os, os.path\n\ndef dumpUsage():\n    print \"Usage: %s -input INPUT_PATH -output OUTPUT_PATH -cocos2d COCOS2D_ROOT_PATH\" % (os.path.basename(__file__))\n    print \"Options:\"\n    print \"  -input     INPUT_PATH            The path to javascript files directory\"\n    print \"  -output    OUTPUT_PATH           The path to the obfuscated javascript file\"\n    print \"  -cocos2d   COCOS2D_ROOT_PATH     The root path of cocos2d-x, e.g. /workspace/cocos2d-x\"\n    print \"\"\n\ndef checkParams():\n    # generate our internal params\n    context[\"script_path\"] = os.getcwd() + \"/\"\n    \n    if len(sys.argv) < 4:\n        dumpUsage()\n        sys.exit()\n        \n    # fine params\n    for i in range(1, len(sys.argv)):\n        if \"-input\" == sys.argv[i]:\n            context[\"input\"] = sys.argv[i+1]\n        elif \"-output\" == sys.argv[i]:\n            context[\"output\"] = os.getcwd() + \"/\" + sys.argv[i+1] \n        elif \"-cocos2d\" == sys.argv[i]:\n            context[\"cocos2d\"] = sys.argv[i+1]\n            \n    # pinrt error log our required paramters are not ready\n    raise_error = False\n    if context[\"input\"] == \"undefined\":\n        print \"Invalid -input parameter\"\n        raise_error = True\n    if context[\"output\"] == \"undefined\":\n        print \"Invalid -output parameter\"\n        raise_error = True\n    if context[\"cocos2d\"] == \"undefined\":\n        print \"Invalid -cocos2d parameter\"\n        raise_error = True\n    if raise_error != False:\n        sys.exit()\n# end of checkParams\n\nclass FileInfo:\n    def __init__(self, filename, filepath):\n        self.filename = filename\n        self.filepath = filepath\n\ndef getFiles(currentDir):\n    files = {\n        \"js\"    : [],\n        \"other\" : [],\n    }\n    for root, dirs, file_list in os.walk(currentDir): # Walk directory tree\n        for f in file_list:\n            if f.find(\".js\") != -1:\n                files[\"js\"].append(FileInfo(f, root))\n            else:\n                files[\"other\"].append(FileInfo(f, root))\n    return files\n# end of getInfos\n\ndef prepareConfigs():\n    config = {\n        \"path_to_cocos2d\": context[\"cocos2d\"],\n        \"path_to_output\": context[\"output\"] + \"game.js\",\n        \"path_to_js_sources\": context[\"input\"],\n        \"js_sources\": \"\",\n    }\n        \n    files = getFiles( context[\"input\"] )\n            \n    for item in files[\"js\"]:\n        # use item.filepath and item.filename\n        fullpath = item.filepath.replace(config[\"path_to_js_sources\"], \"\")\n        if (len(fullpath) != 0):\n            fullpath += \"/\"\n        # end of if len(tmp)\n        fullpath += item.filename\n        config[\"js_sources\"] += \"<file name=\\\"\" + fullpath + \"\\\"/>\" + \"\\n\\t\\t\\t\\t\" \n    \n    return config\n# end of prepareConfigs\n\ndef generateXmlForCompiler():    \n    print \"preparing configs...\"\n    config = prepareConfigs()\n    print \"generating obfuscate.xml for google closure compiler\"\n    f1 = open(context[\"cocos2d\"] + \"tools/closure-compiler/template.xml\", \"rb\")\n    tmp = f1.read()\n    f1.close()\n    from string import Template\n    s = Template(tmp)\n    content = s.substitute( PATH_TO_COCOS2D      = config[\"path_to_cocos2d\"],\n                            PATH_TO_COMPILER     = \"${basedir}/tools/closure-compiler/compiler.jar\",\n                            PATH_TO_OUTPUT       = config[\"path_to_output\"],\n                            PATH_TO_EXCLUSIONS   = \"${basedir}/scripting/javascript/bindings/obfuscate\",\n                            PATH_TO_JS_FRAMEWORK = \"${basedir}/scripting/javascript/bindings/js/\",\n                            PATH_TO_JS_SOURCES   = os.getcwd() + \"/\" + config[\"path_to_js_sources\"],\n                            JS_SOURCES           = config[\"js_sources\"] )\n\n    f2 = open(context[\"output\"] + \"obfuscate.xml\", \"wb\")\n    f2.write(content)\n    f2.close()\n# end of generateXmlForCompiler\n\n# main\ncheckParams()\ngenerateXmlForCompiler()\n# print \"running ant to generate obfuscated main.js\"\n# os.popen(\"ant -buildfile obfuscate.xml\")\nprint \"Successful! obfuscate.xml generated.\"\nprint \"Note: Please reorder the file's sequence in obfuscate.xml, keep it the same order as javascript \\\"require\\\" instruction,\"\nprint \"then call \\\"ant -buildfile obfuscate.xml\\\" to obfuscate your js code.\"\n\n"
  },
  {
    "path": "cocos2d/tools/closure-compiler/template.xml",
    "content": "<?xml version=\"1.0\"?>\n<project name=\"Javascript compress project\" basedir=\"$PATH_TO_COCOS2D\" default=\"compile\">\n\n    <taskdef name=\"jscomp\" classname=\"com.google.javascript.jscomp.ant.CompileTask\"\n             classpath=\"$PATH_TO_COMPILER\"/>\n\n    <target name=\"compile\">\n        <!--advanced / simple-->\n        <jscomp compilationLevel=\"advanced\" warning=\"quiet\"\n                debug=\"false\" output=\"$PATH_TO_OUTPUT\">\n            <externs dir=\"$PATH_TO_EXCLUSIONS\">\n                <file name=\"obfuscate_exclude_cocos2d.js\"/>\n                <file name=\"obfuscate_exclude_chipmunk.js\"/>\n            </externs>\n            <sources dir=\"$PATH_TO_JS_FRAMEWORK\">\n                <file name=\"jsb_cocos2d_constants.js\"/>\n                <file name=\"jsb_cocos2d.js\"/>\n                <file name=\"jsb_cocos2d_extension.js\"/>\n                <file name=\"jsb_chipmunk_constants.js\"/>\n                <file name=\"jsb_chipmunk.js\"/>\n                <file name=\"jsb_opengl_constants.js\"/>\n                <file name=\"jsb_opengl.js\"/>\n                <file name=\"jsb_cocosbuilder.js\"/>\n                <file name=\"jsb_sys.js\"/>\n            </sources>\n            <sources dir=\"$PATH_TO_JS_SOURCES\">\n                $JS_SOURCES\n            </sources>\n        </jscomp>\n    </target>\n</project>"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/.gitignore",
    "content": "*.py[cod]\n\n# C extensions\n*.so\n\n# Packages\n*.egg\n*.egg-info\ndist\nbuild\neggs\nparts\nvar\nsdist\ndevelop-eggs\n.installed.cfg\n\n# Installer logs\npip-log.txt\n\n# Unit test / coverage reports\n.coverage\n.tox\nnosetests.xml\n\n# Translations\n*.mo\n\n# Mr Developer\n.mr.developer.cfg\n.project\n.pydevproject\n\n# Ignore files build by xcode\n*.mode*v*\n*.pbxuser\n*.xcbkptlist\n*.xcscheme\n*.xcworkspacedata\n*.xcuserstate\nxcschememanagement.plist\nbuild/\n.DS_Store\n._.*\nxcuserdata/\nDerivedData/\n\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/README.md",
    "content": "# cocos2d-console\n\n\n\n## Download\n\n```sh\n$ NOT DONE YET\n```\n\n## Install\n\n```sh\n$ NOT DONE YET\n```\n\n## Vision of cocos2d-console\n\n\nA command line tool that lets you create, run, publish, debug, etc… your game. It is the swiss-army knife for cocos2d.\n\nThis command line tool is in its early stages.\n\nExamples:\n\n```\n# starts a new project called \"My Game\" for iOS and Android with JS Bindigns\n$ cocos2d new \"My Game\" --mobile --js\n\n$ cd \"My Game\"\n\n# Will compile the source code, publish the assests, and then it will send the binary to the simulator\n$ cocos2d run --ios\n\n\n# Will generate a distribution .ipa file ready to be summitted to the App Store\n$ cocos2d dist --ios\n\n\n# Will generate published files\n$ cocos2d.py publish --ios\n\n# Will generate bytecode files\n$ cocos2d jscompile -d output_dir -s cocos2dx_root/scripting/javascript/bindings/js -s cocos2dx_root/samples/Javascript/Shared/tests -o game.min.js -j compiler_config_sample.json -c\n\n```\n\n# Devel Info\n\n## Internals\n\n`cocos2d.py` is an script whose only responsability is to call its plugins.\n\neg:\n```\n// It will just print all the registered plugins\n$ python cocos2d.py\n```\n\n```\n// It will call the \"new\" plugin \n$ python cocos2d.py new\n``` \n\n```\n// It will call the \"dist\" plugin with the --help argument \n$ python cocos2d.py dist --help\n``` \n\n\n## Adding new plugin to the console\n\nYou have to edit the `cocos2d.ini` file, and add your new plugin there.\n\nLet's say that you want to add a plugin that minifies JS code.\n\n```\n# Adds the minify_js plugin\n[plugin \"minify_js\"]\n# should be a subclass of CCPlugin\nclass = cocos2d_minify_js.CCPluginMinifyJS\n``` \n\nAnd now you have to create a file called `cocos2d_minify_js.py` with the following structure.\n\n```python\nimport cocos2d\n\n# Plugins should be a sublass of CCPlugin\nclass CCPluginMinifyJS(cocos2d.CCPlugin):\n\n    @staticmethod\n    def brief_description():\n        return \"minify_js\\t\\tminifies JS code\"\n\n    def run(self, argv):\n        print \"plugin called!\"\n        print argv\n```\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/console/cocos2d.ini",
    "content": "#\n# cocos2d command line tool configuration file\n#\n\n[plugin \"new\"]\n# should be a subclass of CCPlugin\nclass = cocos2d_new.CCPluginNew\n\n[plugin \"version\"]\n# should be a subclass of CCPlugin\nclass = cocos2d_version.CCPluginVersion\n\n[plugin \"jscompile\"]\n# should be a subclass of CCPlugin\nclass = cocos2d_jscompile.CCPluginJSCompile\n\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/console/cocos2d.py",
    "content": "#!/usr/bin/python\n# ----------------------------------------------------------------------------\n# cocos2d-console: command line tool manager for cocos2d\n#\n# Author: Ricardo Quesada\n# Copyright 2013 (C) Zynga, Inc\n#\n# License: MIT\n# ----------------------------------------------------------------------------\n'''\nCommand line tool manager for cocos2d\n'''\n\n__docformat__ = 'restructuredtext'\n\n\n# python\nimport sys\nimport re\nimport ConfigParser\nimport os\n\nCOCOS2D_CONSOLE_VERSION = '0.1'\n\n\n#\n# Plugins should be a sublass of CCJSPlugin\n#\nclass CCPlugin(object):\n\n    # returns help\n    @staticmethod\n    def brief_description(self):\n        pass\n\n    # Constructor\n    def __init__(self):\n        pass\n\n    # Run it\n    def run(self, argv):\n        pass\n\n\n# get_class from: http://stackoverflow.com/a/452981\ndef get_class(kls):\n    parts = kls.split('.')\n    module = \".\".join(parts[:-1])\n    if len(parts) == 1:\n        m = sys.modules[__name__]\n        m = getattr(m, parts[0])\n    else:\n        m = __import__(module)\n        for comp in parts[1:]:\n            m = getattr(m, comp)\n    return m\n\n\ndef parse_plugins():\n    classes = {}\n    cp = ConfigParser.ConfigParser()\n\n    # read global config file\n    cocos2d_path = os.path.dirname(os.path.abspath(sys.argv[0]))\n    cp.read(os.path.join(cocos2d_path, \"cocos2d.ini\"))\n\n    # override it with local config\n    cp.read(\"~/.cocos2d-js/cocos2d.ini\")\n\n    for s in cp.sections():\n        if s.startswith('plugin '):\n            pluginname = re.match('plugin\\s+\"?(\\w+)\"?', s)\n            if pluginname:\n                key = pluginname.group(1)\n                for o in cp.options(s):\n                    classname = cp.get(s, o)\n                    classes[key] = get_class(classname)\n    return classes\n\n\ndef help():\n    print \"\\n%s %s - cocos2d console: A command line tool for cocos2d\" % (sys.argv[0], COCOS2D_CONSOLE_VERSION)\n    print \"\\nAvailable commands:\"\n    classes = parse_plugins()\n    for key in classes.keys():\n        print \"\\t%s\" % classes[key].brief_description()\n    print \"\\t\"\n    print \"\\nExample:\"\n    print \"\\t%s new --help\" % sys.argv[0]\n    print \"\\t%s jscompile --help\" % sys.argv[0]\n    sys.exit(-1)\n\nif __name__ == \"__main__\":\n    if len(sys.argv) == 1 or sys.argv[1] == '-h':\n        help()\n\n    command = sys.argv[1]\n    argv = sys.argv[2:]\n    plugins = parse_plugins()\n    if command in plugins:\n        plugin = plugins[command]\n        plugin().run(argv)\n    else:\n        print \"Error: argument '%s' not found\" % command\n        print \"Try with %s -h\" % sys.argv[0]\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/console/cocos2d_jscompile.py",
    "content": "#!/usr/bin/python\n# ----------------------------------------------------------------------------\n# cocos2d \"jscompile\" plugin\n#\n# Copyright 2013 (C) Intel\n#\n# License: MIT\n# ----------------------------------------------------------------------------\n'''\n\"jscompile\" plugin for cocos2d command line tool\n'''\n\n__docformat__ = 'restructuredtext'\n\nimport sys\nimport subprocess\nimport os\nimport json\nimport inspect\n\nimport cocos2d\n\nclass CCPluginJSCompile(cocos2d.CCPlugin):\n    \"\"\"\n    compiles (encodes) and minifies JS files\n    \"\"\"\n\n    @staticmethod\n    def brief_description():\n        # returns a short description of this module\n        return \"jscompile\\tminifies and/or compiles js files\"\n\n    # This is not the constructor, just an initializator\n    def init(self, options, workingdir):\n        \"\"\"\n        Arguments:\n        - `options`:\n        \"\"\"\n        self._current_src_dir = None\n        self._src_dir_arr = self.normalize_path_in_list(options.src_dir_arr)\n        self._dst_dir = options.dst_dir\n        self._use_closure_compiler = options.use_closure_compiler\n        self._config = None\n        self._workingdir = workingdir\n        if options.compiler_config != None:\n            f = open(options.compiler_config)\n            self._config = json.load(f)\n            f.close()\n\n            self.normalize_path_in_list(self._config[\"pre_order\"])\n            self.normalize_path_in_list(self._config[\"post_order\"])\n            self.normalize_path_in_list(self._config[\"skip\"])\n\n        self._success = []\n        self._failure = []\n        self._js_files = {}\n        self._compressed_js_path = os.path.join(self._dst_dir, options.compressed_filename)\n        self._compressed_jsc_path = os.path.join(self._dst_dir, options.compressed_filename+\"c\")\n\n    def normalize_path_in_list(self, list):\n        for i in list:\n            tmp = os.path.normpath(i)\n            list[list.index(i)] = tmp\n        return list\n\n    def get_relative_path(self, jsfile):\n        try:\n            # print \"current src dir: \"+self._current_src_dir\n            pos = jsfile.index(self._current_src_dir)\n            if pos != 0:\n                raise Exception(\"cannot find src directory in file path.\")\n            # print \"origin js path: \"+ jsfile\n            # print \"relative path: \"+jsfile[len(self._current_src_dir)+1:]\n            return jsfile[len(self._current_src_dir)+1:]\n        except ValueError:\n            raise Exception(\"cannot find src directory in file path.\")\n\n    def get_output_file_path(self, jsfile):\n        \"\"\"\n        Gets output file path by source js file\n        \"\"\"\n        # create folder for generated file\n        jsc_filepath = \"\"\n        relative_path = self.get_relative_path(jsfile)+\"c\"\n        jsc_filepath = os.path.join(self._dst_dir, relative_path)\n\n        dst_rootpath = os.path.split(jsc_filepath)[0]\n        try:\n            # print \"creating dir (%s)\" % (dst_rootpath)\n            os.makedirs(dst_rootpath)\n        except OSError:\n            if os.path.exists(dst_rootpath) == False:\n                # There was an error on creation, so make sure we know about it\n                raise Exception(\"Error: cannot create folder in \"+dst_rootpath)\n\n        # print \"return jsc path: \"+jsc_filepath\n        return jsc_filepath\n\n    def compile_js(self, jsfile, output_file):\n        \"\"\"\n        Compiles js file\n        \"\"\"\n        print \"compiling js (%s) to bytecode...\" % (jsfile)\n        jsbcc_exe_path = os.path.join(self._workingdir, \"bin\", \"jsbcc\");\n\n        ret = subprocess.call(jsbcc_exe_path + \" \" + jsfile+\" \"+output_file, shell=True)\n        if ret == 0:\n            self._success.append(jsfile)\n        else:\n            self._failure.append(jsfile)\n        print \"----------------------------------------\"\n\n    def compress_js(self):\n        \"\"\"\n        Compress all js files into one big file.\n        \"\"\"\n        jsfiles = \"\"\n        for src_dir in self._src_dir_arr:\n            # print \"\\n----------src:\"+src_dir\n            jsfiles = jsfiles + \" --js \".join(self._js_files[src_dir]) + \" \"\n\n        compiler_jar_path = os.path.join(self._workingdir, \"bin\", \"compiler.jar\")\n        command = \"java -jar %s --js %s --js_output_file %s\" % (compiler_jar_path, jsfiles, self._compressed_js_path)\n        print \"\\ncommand:\"+command+\"\\n\"\n\n        ret = subprocess.call(command, shell=True)\n        if ret == 0:\n            print \"js files were compressed successfully...\"\n        else:\n            print \"js files were compressed unsuccessfully...\"\n\n    def deep_iterate_dir(self, rootDir):\n        for lists in os.listdir(rootDir):\n            path = os.path.join(rootDir, lists)\n            if os.path.isdir(path):\n                self.deep_iterate_dir(path)\n            elif os.path.isfile(path):\n                if os.path.splitext(path)[1] == \".js\":\n                    self._js_files[self._current_src_dir].append(path)\n\n\n    def index_in_list(self, jsfile, l):\n        \"\"\"\n        Arguments:\n        - `self`:\n        - `jsfile`:\n        - `l`:\n        \"\"\"\n        index = -1\n\n        for el in l:\n            if jsfile.rfind(el) != -1:\n                # print \"index:\"+str(index+1)+\", el:\"+el\n                return index+1\n            index = index + 1\n        return -1\n\n    def js_filename_pre_order_compare(self, a, b):\n        \"\"\"\n        \"\"\"\n        pre_order = self._config[\"pre_order\"]\n        index_a = self.index_in_list(a, pre_order)\n        index_b = self.index_in_list(b, pre_order)\n        is_a_in_list = index_a != -1\n        is_b_in_list = index_b != -1\n\n        if is_a_in_list and not is_b_in_list:\n            return -1\n        elif not is_a_in_list and is_b_in_list:\n            return 1\n        elif is_a_in_list and is_b_in_list:\n            if index_a > index_b:\n                return 1\n            elif index_a < index_b:\n                return -1\n            else:\n                return 0\n        else:\n            return 0\n\n\n    def js_filename_post_order_compare(self, a, b):\n        \"\"\"\n        \"\"\"\n        post_order = self._config[\"post_order\"]\n        index_a = self.index_in_list(a, post_order)\n        index_b = self.index_in_list(b, post_order)\n        is_a_in_list = index_a != -1\n        is_b_in_list = index_b != -1\n\n        if is_a_in_list and not is_b_in_list:\n            return 1\n        elif not is_a_in_list and is_b_in_list:\n            return -1\n        elif is_a_in_list and is_b_in_list:\n            if index_a > index_b:\n                return 1\n            elif index_a < index_b:\n                return -1\n            else:\n                return 0\n        else:\n            return 0\n\n    def reorder_js_files(self):\n        if self._config == None:\n            return\n\n        # print \"before:\"+str(self._js_files)\n\n        for src_dir in self._js_files:\n            # Remove file in exclude list\n            need_remove_arr = []\n            for jsfile in self._js_files[src_dir]:\n                for exclude_file in self._config[\"skip\"]:\n                    if jsfile.rfind(exclude_file) != -1:\n                        # print \"remove:\" + jsfile\n                        need_remove_arr.append(jsfile)\n\n            for need_remove in need_remove_arr:\n                self._js_files[src_dir].remove(need_remove)\n\n            if (self._config != None):\n                pre_order = self._config[\"pre_order\"]\n                self._js_files[src_dir].sort(cmp=self.js_filename_pre_order_compare)\n                self._js_files[src_dir].sort(cmp=self.js_filename_post_order_compare)\n\n        # print '-------------------'\n        # print \"after:\" + str(self._js_files)\n\n    def handle_all_js_files(self):\n        \"\"\"\n        Arguments:\n        - `self`:\n        \"\"\"\n        if self._use_closure_compiler == True:\n            self.compress_js()\n            self.compile_js(self._compressed_js_path, self._compressed_jsc_path)\n            # remove tmp compressed file\n            os.remove(self._compressed_js_path)\n        else:\n            for src_dir in self._src_dir_arr:\n                for jsfile in self._js_files[src_dir]:\n                    self._current_src_dir = src_dir\n                    self.compile_js(jsfile, self.get_output_file_path(jsfile))\n\n    # will be called from the cocos2d.py script\n    def run(self, argv):\n        \"\"\"\n        \"\"\"\n        self.parse_args(argv)\n\n        # create output directory\n        try:\n            os.makedirs(self._dst_dir)\n        except OSError:\n            if os.path.exists(self._dst_dir) == False:\n                raise Exception(\"Error: cannot create folder in \"+self._dst_dir)\n\n        # deep iterate the src directory\n        for src_dir in self._src_dir_arr:\n            self._current_src_dir = src_dir\n            self._js_files[self._current_src_dir] = []\n            self.deep_iterate_dir(src_dir)\n\n        self.reorder_js_files()\n        self.handle_all_js_files()\n        print \"\\nCompilation finished, (%d) files succeed, (%d) files fail.\" % (len(self._success), len(self._failure))\n        if len(self._failure) > 0:\n            print \"Failure files are:\"\n            print self._failure\n        print \"------------------------------\"\n\n    def parse_args(self, argv):\n        \"\"\"\n        \"\"\"\n        from optparse import OptionParser\n\n        parser = OptionParser(\"usage: %prog jscompile -s src_dir -d dst_dir [-c -o COMPRESSED_FILENAME -j COMPILER_CONFIG]\")\n        parser.add_option(\"-s\", \"--src\",\n                          action=\"append\", type=\"string\", dest=\"src_dir_arr\",\n                          help=\"source directory of js files needed to be compiled, supports mutiple source directory\")\n\n        parser.add_option(\"-d\", \"--dst\",\n                          action=\"store\", type=\"string\", dest=\"dst_dir\",\n                          help=\"destination directory of js bytecode files to be stored\")\n\n        parser.add_option(\"-c\", \"--use_closure_compiler\",\n                          action=\"store_true\", dest=\"use_closure_compiler\", default=False,\n                          help=\"Whether to use closure compiler to compress all js files into just a big file\")\n\n        parser.add_option(\"-o\", \"--output_compressed_filename\",\n                          action=\"store\", dest=\"compressed_filename\", default=\"game.min.js\",\n                          help=\"Only available when '-c' option was True\")\n\n        parser.add_option(\"-j\", \"--compiler_config\",\n                          action=\"store\", dest=\"compiler_config\",\n                          help=\"The configuration for closure compiler by using JSON, please refer to compiler_config_sample.json\")\n\n        (options, args) = parser.parse_args(argv)\n\n        # print options\n\n        if options.src_dir_arr == None:\n            raise Exception(\"Please set source folder by \\\"-s\\\" or \\\"-src\\\", run ./jscompile.py -h for the usage \")\n        elif options.dst_dir == None:\n            raise Exception(\"Please set destination folder by \\\"-d\\\" or \\\"-dst\\\", run ./jscompile.py -h for the usage \")\n        else:\n            for src_dir in options.src_dir_arr:\n                if os.path.exists(src_dir) == False:\n                    raise Exception(\"Error: dir (%s) doesn't exist...\" % (src_dir))\n\n\n        # script directory\n        workingdir = os.path.dirname(inspect.getfile(inspect.currentframe()))\n\n        self.init(options, workingdir)\n\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/console/cocos2d_new.py",
    "content": "#!/usr/bin/python\n# ----------------------------------------------------------------------------\n# cocos2d \"new\" plugin\n#\n# Author: Ricardo Quesada\n# Copyright 2013 (C) Zynga, Inc\n#\n# License: MIT\n# ----------------------------------------------------------------------------\n'''\n\"new\" plugin for cocos2d command line tool\n'''\n\n__docformat__ = 'restructuredtext'\n\n# python\nimport os\nimport sys\nimport getopt\nimport ConfigParser\n\nimport cocos2d\n\n\ndef help():\n    sys.exit(-1)\n\n\n#\n# Plugins should be a sublass of CCJSPlugin\n#\nclass CCPluginNew(cocos2d.CCPlugin):\n\n    @staticmethod\n    def brief_description():\n        return \"new\\t\\tcreates a new project\"\n\n    # parse arguments\n    def parse_args(self, argv):\n        name = directory = argv[0]\n        try:\n            opts, args = getopt.getopt(argv, \"d:h\", [\"dir=\", \"help\"])\n\n            for opt, arg in opts:\n                if opt in (\"-d\", \"--dir\"):\n                    directory = arg\n                elif opt in (\"h\", \"--help\"):\n                    help()\n        except getopt.GetoptError, e:\n            print e\n            opts, args = getopt.getopt(argv, \"\", [])\n\n        return {\"dir\": directory, \"name\": name}\n\n    # create the project\n    def create_project(self, args):\n        #1st: create directory\n        d = os.path.join(os.path.abspath('.'), args[\"dir\"])\n        if os.path.exists(d):\n            raise Exception(\"Error: Can't create project. Directory already exists: %s\" % d)\n        print '*****: %s' % args[\"dir\"]\n        os.makedirs(d)\n\n        # 2nd create ini file\n        config = ConfigParser.RawConfigParser()\n        project_name = 'project \"%s\"' % args[\"name\"]\n        config.add_section(project_name)\n        config.set(project_name, 'res_path', 'res')\n        config.set(project_name, 'js_path', 'js')\n\n        # Writing our configuration file to 'example.cfg'\n        with open(os.path.join(d, 'config.ini'), 'wb') as configfile:\n            config.write(configfile)\n\n        # 3rd create default directories\n\n    # main entry point\n    def run(self, argv):\n        args = self.parse_args(argv)\n        self.create_project(args)\n\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/console/cocos2d_version.py",
    "content": "#!/usr/bin/python\n# ----------------------------------------------------------------------------\n# cocos2d \"version\" plugin\n#\n# Author: Ricardo Quesada\n# Copyright 2013 (C) Zynga, Inc\n#\n# License: MIT\n# ----------------------------------------------------------------------------\n'''\n\"version\" plugin for cocos2d command line tool\n'''\n\n__docformat__ = 'restructuredtext'\n\n\n# python\nimport cocos2d\n\n\n#\n# Plugins should be a sublass of CCJSPlugin\n#\nclass CCPluginVersion(cocos2d.CCPlugin):\n\n    @staticmethod\n    def brief_description():\n        return \"version\\t\\tprints the version of the installed components\"\n\n    def run(self, argv):\n        print \"version called!\"\n        print argv\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/README",
    "content": "jsbcc stands for JavasSript Byte Code Compiler. \nIt compiles javascript files to SpiderMonkey byte code files. It supports Mac and win32 now.\nUsage:\n\tjsbcc input_js_file [byte_code_file]\n\n\t"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/jsbcc-vc2012.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 11.00\n# Visual Studio 2010\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"jsbcc\", \"jsbcc-vc2012.vcxproj\", \"{BD6738AE-6468-4881-B32B-5749DCF95511}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{BD6738AE-6468-4881-B32B-5749DCF95511}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{BD6738AE-6468-4881-B32B-5749DCF95511}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{BD6738AE-6468-4881-B32B-5749DCF95511}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{BD6738AE-6468-4881-B32B-5749DCF95511}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/jsbcc-vc2012.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{BD6738AE-6468-4881-B32B-5749DCF95511}</ProjectGuid>\n    <Keyword>Win32Proj</Keyword>\n    <RootNamespace>jsbcc</RootNamespace>\n    <ProjectName>jsbcc</ProjectName>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset>v110</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LinkIncremental>true</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LinkIncremental>false</LinkIncremental>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;XP_WIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>spidermonkey-win32\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalLibraryDirectories>spidermonkey-win32\\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>Ws2_32.lib;mozjs-23.0.lib</AdditionalDependencies>\n    </Link>\n    <PostBuildEvent>\n      <Command>\n      </Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <Optimization>MaxSpeed</Optimization>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;XP_WIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <AdditionalIncludeDirectories>spidermonkey-win32\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n    </ClCompile>\n    <Link>\n      <SubSystem>Console</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <AdditionalLibraryDirectories>spidermonkey-win32\\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>Ws2_32.lib;mozjs-23.0.lib</AdditionalDependencies>\n    </Link>\n    <PostBuildEvent>\n      <Command>\n      </Command>\n    </PostBuildEvent>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClCompile Include=\"src\\main.cpp\" />\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/jsbcc-vc2012.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"src\\main.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/jsbcc.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t1ABA286D174CC9FD007A6C10 /* libjs_static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ABA286C174CC9FD007A6C10 /* libjs_static.a */; };\n\t\t6579750B172D6EBE000DDA7A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6579750A172D6EBE000DDA7A /* main.cpp */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t1ABA2828174CC9FD007A6C10 /* Anchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Anchor.h; sourceTree = \"<group>\"; };\n\t\t1ABA2829174CC9FD007A6C10 /* CharacterEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterEncoding.h; sourceTree = \"<group>\"; };\n\t\t1ABA282A174CC9FD007A6C10 /* GCAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCAPI.h; sourceTree = \"<group>\"; };\n\t\t1ABA282B174CC9FD007A6C10 /* HashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashTable.h; sourceTree = \"<group>\"; };\n\t\t1ABA282C174CC9FD007A6C10 /* HeapAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapAPI.h; sourceTree = \"<group>\"; };\n\t\t1ABA282D174CC9FD007A6C10 /* LegacyIntTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyIntTypes.h; sourceTree = \"<group>\"; };\n\t\t1ABA282E174CC9FD007A6C10 /* MemoryMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryMetrics.h; sourceTree = \"<group>\"; };\n\t\t1ABA282F174CC9FD007A6C10 /* PropertyKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyKey.h; sourceTree = \"<group>\"; };\n\t\t1ABA2830174CC9FD007A6C10 /* RequiredDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequiredDefines.h; sourceTree = \"<group>\"; };\n\t\t1ABA2831174CC9FD007A6C10 /* TemplateLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateLib.h; sourceTree = \"<group>\"; };\n\t\t1ABA2832174CC9FD007A6C10 /* Utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utility.h; sourceTree = \"<group>\"; };\n\t\t1ABA2833174CC9FD007A6C10 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Value.h; sourceTree = \"<group>\"; };\n\t\t1ABA2834174CC9FD007A6C10 /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Vector.h; sourceTree = \"<group>\"; };\n\t\t1ABA2835174CC9FD007A6C10 /* js-config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = \"js-config.h\"; sourceTree = \"<group>\"; };\n\t\t1ABA2836174CC9FD007A6C10 /* js.msg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = js.msg; sourceTree = \"<group>\"; };\n\t\t1ABA2837174CC9FD007A6C10 /* jsalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsalloc.h; sourceTree = \"<group>\"; };\n\t\t1ABA2838174CC9FD007A6C10 /* jsapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsapi.h; sourceTree = \"<group>\"; };\n\t\t1ABA2839174CC9FD007A6C10 /* jsclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclass.h; sourceTree = \"<group>\"; };\n\t\t1ABA283A174CC9FD007A6C10 /* jsclist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsclist.h; sourceTree = \"<group>\"; };\n\t\t1ABA283B174CC9FD007A6C10 /* jscpucfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jscpucfg.h; sourceTree = \"<group>\"; };\n\t\t1ABA283C174CC9FD007A6C10 /* jsdbgapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdbgapi.h; sourceTree = \"<group>\"; };\n\t\t1ABA283D174CC9FD007A6C10 /* jsdhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsdhash.h; sourceTree = \"<group>\"; };\n\t\t1ABA283E174CC9FD007A6C10 /* jsfriendapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsfriendapi.h; sourceTree = \"<group>\"; };\n\t\t1ABA283F174CC9FD007A6C10 /* jslock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jslock.h; sourceTree = \"<group>\"; };\n\t\t1ABA2840174CC9FD007A6C10 /* json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json.h; sourceTree = \"<group>\"; };\n\t\t1ABA2841174CC9FD007A6C10 /* jsperf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsperf.h; sourceTree = \"<group>\"; };\n\t\t1ABA2842174CC9FD007A6C10 /* jsprf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprf.h; sourceTree = \"<group>\"; };\n\t\t1ABA2843174CC9FD007A6C10 /* jsprototypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprototypes.h; sourceTree = \"<group>\"; };\n\t\t1ABA2844174CC9FD007A6C10 /* jsproxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsproxy.h; sourceTree = \"<group>\"; };\n\t\t1ABA2845174CC9FD007A6C10 /* jsprvtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsprvtd.h; sourceTree = \"<group>\"; };\n\t\t1ABA2846174CC9FD007A6C10 /* jspubtd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jspubtd.h; sourceTree = \"<group>\"; };\n\t\t1ABA2847174CC9FD007A6C10 /* jstypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jstypes.h; sourceTree = \"<group>\"; };\n\t\t1ABA2848174CC9FD007A6C10 /* jsutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsutil.h; sourceTree = \"<group>\"; };\n\t\t1ABA2849174CC9FD007A6C10 /* jsversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsversion.h; sourceTree = \"<group>\"; };\n\t\t1ABA284A174CC9FD007A6C10 /* jswrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jswrapper.h; sourceTree = \"<group>\"; };\n\t\t1ABA284C174CC9FD007A6C10 /* Assertions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Assertions.h; sourceTree = \"<group>\"; };\n\t\t1ABA284D174CC9FD007A6C10 /* Attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attributes.h; sourceTree = \"<group>\"; };\n\t\t1ABA284E174CC9FD007A6C10 /* BloomFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BloomFilter.h; sourceTree = \"<group>\"; };\n\t\t1ABA284F174CC9FD007A6C10 /* Char16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Char16.h; sourceTree = \"<group>\"; };\n\t\t1ABA2850174CC9FD007A6C10 /* CheckedInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckedInt.h; sourceTree = \"<group>\"; };\n\t\t1ABA2851174CC9FD007A6C10 /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = \"<group>\"; };\n\t\t1ABA2852174CC9FD007A6C10 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = \"<group>\"; };\n\t\t1ABA2853174CC9FD007A6C10 /* DebugOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugOnly.h; sourceTree = \"<group>\"; };\n\t\t1ABA2854174CC9FD007A6C10 /* EnumSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnumSet.h; sourceTree = \"<group>\"; };\n\t\t1ABA2855174CC9FD007A6C10 /* FloatingPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingPoint.h; sourceTree = \"<group>\"; };\n\t\t1ABA2856174CC9FD007A6C10 /* GuardObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GuardObjects.h; sourceTree = \"<group>\"; };\n\t\t1ABA2857174CC9FD007A6C10 /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = \"<group>\"; };\n\t\t1ABA2858174CC9FD007A6C10 /* Likely.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Likely.h; sourceTree = \"<group>\"; };\n\t\t1ABA2859174CC9FD007A6C10 /* LinkedList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkedList.h; sourceTree = \"<group>\"; };\n\t\t1ABA285A174CC9FD007A6C10 /* MathAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathAlgorithms.h; sourceTree = \"<group>\"; };\n\t\t1ABA285B174CC9FD007A6C10 /* MemoryChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryChecking.h; sourceTree = \"<group>\"; };\n\t\t1ABA285C174CC9FD007A6C10 /* MSStdInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSStdInt.h; sourceTree = \"<group>\"; };\n\t\t1ABA285D174CC9FD007A6C10 /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = \"<group>\"; };\n\t\t1ABA285E174CC9FD007A6C10 /* Range.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = \"<group>\"; };\n\t\t1ABA285F174CC9FD007A6C10 /* RangedPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangedPtr.h; sourceTree = \"<group>\"; };\n\t\t1ABA2860174CC9FD007A6C10 /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = \"<group>\"; };\n\t\t1ABA2861174CC9FD007A6C10 /* Scoped.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scoped.h; sourceTree = \"<group>\"; };\n\t\t1ABA2862174CC9FD007A6C10 /* SHA1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHA1.h; sourceTree = \"<group>\"; };\n\t\t1ABA2863174CC9FD007A6C10 /* SplayTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplayTree.h; sourceTree = \"<group>\"; };\n\t\t1ABA2864174CC9FD007A6C10 /* StandardInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StandardInteger.h; sourceTree = \"<group>\"; };\n\t\t1ABA2865174CC9FD007A6C10 /* ThreadLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadLocal.h; sourceTree = \"<group>\"; };\n\t\t1ABA2866174CC9FD007A6C10 /* TypedEnum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedEnum.h; sourceTree = \"<group>\"; };\n\t\t1ABA2867174CC9FD007A6C10 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = \"<group>\"; };\n\t\t1ABA2868174CC9FD007A6C10 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = \"<group>\"; };\n\t\t1ABA2869174CC9FD007A6C10 /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Util.h; sourceTree = \"<group>\"; };\n\t\t1ABA286A174CC9FD007A6C10 /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = \"<group>\"; };\n\t\t1ABA286C174CC9FD007A6C10 /* libjs_static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libjs_static.a; sourceTree = \"<group>\"; };\n\t\t65797507172D6EBE000DDA7A /* jsbcc */ = {isa = PBXFileReference; explicitFileType = \"compiled.mach-o.executable\"; includeInIndex = 0; path = jsbcc; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t6579750A172D6EBE000DDA7A /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t65797504172D6EBE000DDA7A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t1ABA286D174CC9FD007A6C10 /* libjs_static.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t1ABA2821174CC9FD007A6C10 /* spidermonkey-ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1ABA2822174CC9FD007A6C10 /* include */,\n\t\t\t\t1ABA286B174CC9FD007A6C10 /* lib */,\n\t\t\t);\n\t\t\tpath = \"spidermonkey-ios\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1ABA2822174CC9FD007A6C10 /* include */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1ABA2827174CC9FD007A6C10 /* js */,\n\t\t\t\t1ABA2835174CC9FD007A6C10 /* js-config.h */,\n\t\t\t\t1ABA2836174CC9FD007A6C10 /* js.msg */,\n\t\t\t\t1ABA2837174CC9FD007A6C10 /* jsalloc.h */,\n\t\t\t\t1ABA2838174CC9FD007A6C10 /* jsapi.h */,\n\t\t\t\t1ABA2839174CC9FD007A6C10 /* jsclass.h */,\n\t\t\t\t1ABA283A174CC9FD007A6C10 /* jsclist.h */,\n\t\t\t\t1ABA283B174CC9FD007A6C10 /* jscpucfg.h */,\n\t\t\t\t1ABA283C174CC9FD007A6C10 /* jsdbgapi.h */,\n\t\t\t\t1ABA283D174CC9FD007A6C10 /* jsdhash.h */,\n\t\t\t\t1ABA283E174CC9FD007A6C10 /* jsfriendapi.h */,\n\t\t\t\t1ABA283F174CC9FD007A6C10 /* jslock.h */,\n\t\t\t\t1ABA2840174CC9FD007A6C10 /* json.h */,\n\t\t\t\t1ABA2841174CC9FD007A6C10 /* jsperf.h */,\n\t\t\t\t1ABA2842174CC9FD007A6C10 /* jsprf.h */,\n\t\t\t\t1ABA2843174CC9FD007A6C10 /* jsprototypes.h */,\n\t\t\t\t1ABA2844174CC9FD007A6C10 /* jsproxy.h */,\n\t\t\t\t1ABA2845174CC9FD007A6C10 /* jsprvtd.h */,\n\t\t\t\t1ABA2846174CC9FD007A6C10 /* jspubtd.h */,\n\t\t\t\t1ABA2847174CC9FD007A6C10 /* jstypes.h */,\n\t\t\t\t1ABA2848174CC9FD007A6C10 /* jsutil.h */,\n\t\t\t\t1ABA2849174CC9FD007A6C10 /* jsversion.h */,\n\t\t\t\t1ABA284A174CC9FD007A6C10 /* jswrapper.h */,\n\t\t\t\t1ABA284B174CC9FD007A6C10 /* mozilla */,\n\t\t\t);\n\t\t\tpath = include;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1ABA2827174CC9FD007A6C10 /* js */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1ABA2828174CC9FD007A6C10 /* Anchor.h */,\n\t\t\t\t1ABA2829174CC9FD007A6C10 /* CharacterEncoding.h */,\n\t\t\t\t1ABA282A174CC9FD007A6C10 /* GCAPI.h */,\n\t\t\t\t1ABA282B174CC9FD007A6C10 /* HashTable.h */,\n\t\t\t\t1ABA282C174CC9FD007A6C10 /* HeapAPI.h */,\n\t\t\t\t1ABA282D174CC9FD007A6C10 /* LegacyIntTypes.h */,\n\t\t\t\t1ABA282E174CC9FD007A6C10 /* MemoryMetrics.h */,\n\t\t\t\t1ABA282F174CC9FD007A6C10 /* PropertyKey.h */,\n\t\t\t\t1ABA2830174CC9FD007A6C10 /* RequiredDefines.h */,\n\t\t\t\t1ABA2831174CC9FD007A6C10 /* TemplateLib.h */,\n\t\t\t\t1ABA2832174CC9FD007A6C10 /* Utility.h */,\n\t\t\t\t1ABA2833174CC9FD007A6C10 /* Value.h */,\n\t\t\t\t1ABA2834174CC9FD007A6C10 /* Vector.h */,\n\t\t\t);\n\t\t\tpath = js;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1ABA284B174CC9FD007A6C10 /* mozilla */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1ABA284C174CC9FD007A6C10 /* Assertions.h */,\n\t\t\t\t1ABA284D174CC9FD007A6C10 /* Attributes.h */,\n\t\t\t\t1ABA284E174CC9FD007A6C10 /* BloomFilter.h */,\n\t\t\t\t1ABA284F174CC9FD007A6C10 /* Char16.h */,\n\t\t\t\t1ABA2850174CC9FD007A6C10 /* CheckedInt.h */,\n\t\t\t\t1ABA2851174CC9FD007A6C10 /* Compiler.h */,\n\t\t\t\t1ABA2852174CC9FD007A6C10 /* Constants.h */,\n\t\t\t\t1ABA2853174CC9FD007A6C10 /* DebugOnly.h */,\n\t\t\t\t1ABA2854174CC9FD007A6C10 /* EnumSet.h */,\n\t\t\t\t1ABA2855174CC9FD007A6C10 /* FloatingPoint.h */,\n\t\t\t\t1ABA2856174CC9FD007A6C10 /* GuardObjects.h */,\n\t\t\t\t1ABA2857174CC9FD007A6C10 /* HashFunctions.h */,\n\t\t\t\t1ABA2858174CC9FD007A6C10 /* Likely.h */,\n\t\t\t\t1ABA2859174CC9FD007A6C10 /* LinkedList.h */,\n\t\t\t\t1ABA285A174CC9FD007A6C10 /* MathAlgorithms.h */,\n\t\t\t\t1ABA285B174CC9FD007A6C10 /* MemoryChecking.h */,\n\t\t\t\t1ABA285C174CC9FD007A6C10 /* MSStdInt.h */,\n\t\t\t\t1ABA285D174CC9FD007A6C10 /* NullPtr.h */,\n\t\t\t\t1ABA285E174CC9FD007A6C10 /* Range.h */,\n\t\t\t\t1ABA285F174CC9FD007A6C10 /* RangedPtr.h */,\n\t\t\t\t1ABA2860174CC9FD007A6C10 /* RefPtr.h */,\n\t\t\t\t1ABA2861174CC9FD007A6C10 /* Scoped.h */,\n\t\t\t\t1ABA2862174CC9FD007A6C10 /* SHA1.h */,\n\t\t\t\t1ABA2863174CC9FD007A6C10 /* SplayTree.h */,\n\t\t\t\t1ABA2864174CC9FD007A6C10 /* StandardInteger.h */,\n\t\t\t\t1ABA2865174CC9FD007A6C10 /* ThreadLocal.h */,\n\t\t\t\t1ABA2866174CC9FD007A6C10 /* TypedEnum.h */,\n\t\t\t\t1ABA2867174CC9FD007A6C10 /* Types.h */,\n\t\t\t\t1ABA2868174CC9FD007A6C10 /* TypeTraits.h */,\n\t\t\t\t1ABA2869174CC9FD007A6C10 /* Util.h */,\n\t\t\t\t1ABA286A174CC9FD007A6C10 /* WeakPtr.h */,\n\t\t\t);\n\t\t\tpath = mozilla;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1ABA286B174CC9FD007A6C10 /* lib */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1ABA286C174CC9FD007A6C10 /* libjs_static.a */,\n\t\t\t);\n\t\t\tpath = lib;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t657974FE172D6EBD000DDA7A = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1ABA2821174CC9FD007A6C10 /* spidermonkey-ios */,\n\t\t\t\t65797509172D6EBE000DDA7A /* src */,\n\t\t\t\t65797508172D6EBE000DDA7A /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t65797508172D6EBE000DDA7A /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t65797507172D6EBE000DDA7A /* jsbcc */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t65797509172D6EBE000DDA7A /* src */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t6579750A172D6EBE000DDA7A /* main.cpp */,\n\t\t\t);\n\t\t\tpath = src;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t65797506172D6EBE000DDA7A /* jsbcc */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 65797510172D6EBE000DDA7A /* Build configuration list for PBXNativeTarget \"jsbcc\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t65797503172D6EBE000DDA7A /* Sources */,\n\t\t\t\t65797504172D6EBE000DDA7A /* Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = jsbcc;\n\t\t\tproductName = jsbcc;\n\t\t\tproductReference = 65797507172D6EBE000DDA7A /* jsbcc */;\n\t\t\tproductType = \"com.apple.product-type.tool\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t657974FF172D6EBD000DDA7A /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0460;\n\t\t\t\tORGANIZATIONNAME = sunzhuoshi;\n\t\t\t};\n\t\t\tbuildConfigurationList = 65797502172D6EBD000DDA7A /* Build configuration list for PBXProject \"jsbcc\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 657974FE172D6EBD000DDA7A;\n\t\t\tproductRefGroup = 65797508172D6EBE000DDA7A /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t65797506172D6EBE000DDA7A /* jsbcc */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t65797503172D6EBE000DDA7A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t6579750B172D6EBE000DDA7A /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t6579750E172D6EBE000DDA7A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_ENABLE_OBJC_EXCEPTIONS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.7;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t6579750F172D6EBE000DDA7A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_ENABLE_OBJC_EXCEPTIONS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.7;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t65797511172D6EBE000DDA7A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../scripting/javascript/spidermonkey-ios/lib\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/spidermonkey-ios/lib\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-lz\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\\\"$(SRCROOT)/spidermonkey-ios/include\\\"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t65797512172D6EBE000DDA7A /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_32_BIT)\";\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../scripting/javascript/spidermonkey-ios/lib\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/spidermonkey-ios/lib\\\"\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = \"-lz\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"\\\"$(SRCROOT)/spidermonkey-ios/include\\\"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t65797502172D6EBD000DDA7A /* Build configuration list for PBXProject \"jsbcc\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t6579750E172D6EBE000DDA7A /* Debug */,\n\t\t\t\t6579750F172D6EBE000DDA7A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t65797510172D6EBE000DDA7A /* Build configuration list for PBXNativeTarget \"jsbcc\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t65797511172D6EBE000DDA7A /* Debug */,\n\t\t\t\t65797512172D6EBE000DDA7A /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 657974FF172D6EBD000DDA7A /* Project object */;\n}\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Anchor.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Anchor implementation. */\n\n#ifndef js_Anchor_h\n#define js_Anchor_h\n\n#include \"mozilla/Attributes.h\"\n\nclass JSFunction;\nclass JSObject;\nclass JSScript;\nclass JSString;\n\nnamespace JS { class Value; }\n\nnamespace JS {\n\n/*\n * Protecting non-Value, non-JSObject *, non-JSString * values from collection\n *\n * Most of the time, the garbage collector's conservative stack scanner works\n * behind the scenes, finding all live values and protecting them from being\n * collected. However, when JSAPI client code obtains a pointer to data the\n * scanner does not know about, owned by an object the scanner does know about,\n * Care Must Be Taken.\n *\n * The scanner recognizes only a select set of types: pointers to JSObjects and\n * similar things (JSFunctions, and so on), pointers to JSStrings, and Values.\n * So while the scanner finds all live |JSString| pointers, it does not notice\n * |jschar| pointers.\n *\n * So suppose we have:\n *\n *   void f(JSString *str) {\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * After the call to |JS_GetStringCharsZ|, there are no further uses of\n * |str|, which means that the compiler is within its rights to not store\n * it anywhere. But because the stack scanner will not notice |ch|, there\n * is no longer any live value in this frame that would keep the string\n * alive. If |str| is the last reference to that |JSString|, and the\n * collector runs while we are using |ch|, the string's array of |jschar|s\n * may be freed out from under us.\n *\n * Note that there is only an issue when 1) we extract a thing X the scanner\n * doesn't recognize from 2) a thing Y the scanner does recognize, and 3) if Y\n * gets garbage-collected, then X gets freed. If we have code like this:\n *\n *   void g(JSObject *obj) {\n *     JS::Value x;\n *     JS_GetProperty(obj, \"x\", &x);\n *     ... do stuff with x ...\n *   }\n *\n * there's no problem, because the value we've extracted, x, is a Value, a\n * type that the conservative scanner recognizes.\n *\n * Conservative GC frees us from the obligation to explicitly root the types it\n * knows about, but when we work with derived values like |ch|, we must root\n * their owners, as the derived value alone won't keep them alive.\n *\n * A JS::Anchor is a kind of GC root that allows us to keep the owners of\n * derived values like |ch| alive throughout the Anchor's lifetime. We could\n * fix the above code as follows:\n *\n *   void f(JSString *str) {\n *     JS::Anchor<JSString *> a_str(str);\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * This simply ensures that |str| will be live until |a_str| goes out of scope.\n * As long as we don't retain a pointer to the string's characters for longer\n * than that, we have avoided all garbage collection hazards.\n */\ntemplate<typename T> class AnchorPermitted;\ntemplate<> class AnchorPermitted<JSObject *> { };\ntemplate<> class AnchorPermitted<const JSObject *> { };\ntemplate<> class AnchorPermitted<JSFunction *> { };\ntemplate<> class AnchorPermitted<const JSFunction *> { };\ntemplate<> class AnchorPermitted<JSString *> { };\ntemplate<> class AnchorPermitted<const JSString *> { };\ntemplate<> class AnchorPermitted<Value> { };\ntemplate<> class AnchorPermitted<const JSScript *> { };\ntemplate<> class AnchorPermitted<JSScript *> { };\n\ntemplate<typename T>\nclass Anchor : AnchorPermitted<T>\n{\n  public:\n    Anchor() { }\n    explicit Anchor(T t) { hold = t; }\n    inline ~Anchor();\n    T &get() { return hold; }\n    const T &get() const { return hold; }\n    void set(const T &t) { hold = t; }\n    void operator=(const T &t) { hold = t; }\n    void clear() { hold = 0; }\n\n  private:\n    T hold;\n    Anchor(const Anchor &other) MOZ_DELETE;\n    void operator=(const Anchor &other) MOZ_DELETE;\n};\n\ntemplate<typename T>\ninline Anchor<T>::~Anchor()\n{\n#ifdef __GNUC__\n    /*\n     * No code is generated for this. But because this is marked 'volatile', G++ will\n     * assume it has important side-effects, and won't delete it. (G++ never looks at\n     * the actual text and notices it's empty.) And because we have passed |hold| to\n     * it, GCC will keep |hold| alive until this point.\n     *\n     * The \"memory\" clobber operand ensures that G++ will not move prior memory\n     * accesses after the asm --- it's a barrier. Unfortunately, it also means that\n     * G++ will assume that all memory has changed after the asm, as it would for a\n     * call to an unknown function. I don't know of a way to avoid that consequence.\n     */\n    asm volatile(\"\":: \"g\" (hold) : \"memory\");\n#else\n    /*\n     * An adequate portable substitute, for non-structure types.\n     *\n     * The compiler promises that, by the end of an expression statement, the\n     * last-stored value to a volatile object is the same as it would be in an\n     * unoptimized, direct implementation (the \"abstract machine\" whose behavior the\n     * language spec describes). However, the compiler is still free to reorder\n     * non-volatile accesses across this store --- which is what we must prevent. So\n     * assigning the held value to a volatile variable, as we do here, is not enough.\n     *\n     * In our case, however, garbage collection only occurs at function calls, so it\n     * is sufficient to ensure that the destructor's store isn't moved earlier across\n     * any function calls that could collect. It is hard to imagine the compiler\n     * analyzing the program so thoroughly that it could prove that such motion was\n     * safe. In practice, compilers treat calls to the collector as opaque operations\n     * --- in particular, as operations which could access volatile variables, across\n     * which this destructor must not be moved.\n     *\n     * (\"Objection, your honor!  *Alleged* killer whale!\")\n     *\n     * The disadvantage of this approach is that it does generate code for the store.\n     * We do need to use Anchors in some cases where cycles are tight.\n     *\n     * Note that there is a Anchor<Value>::~Anchor() specialization in Value.h.\n     */\n    volatile T sink;\n    sink = hold;\n#endif  /* defined(__GNUC__) */\n}\n\n} // namespace JS\n\n#endif /* js_Anchor_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/CallArgs.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Helper classes encapsulating access to the callee, |this| value, arguments,\n * and argument count for a function call.\n *\n * The intent of JS::CallArgs and JS::CallReceiver is that they be used to\n * encapsulate access to the un-abstracted |unsigned argc, Value *vp| arguments\n * to a function.  It's possible (albeit deprecated) to manually index into\n * |vp| to access the callee, |this|, and arguments of a function, and to set\n * its return value.  It's also possible to use the supported API of JS_CALLEE,\n * JS_THIS, JS_ARGV, JS_RVAL and JS_SET_RVAL to the same ends.  But neither API\n * has the error-handling or moving-GC correctness of CallArgs or CallReceiver.\n * New code should use CallArgs and CallReceiver instead whenever possible.\n *\n * The eventual plan is to change JSNative to take |const CallArgs&| directly,\n * for automatic assertion of correct use and to make calling functions more\n * efficient.  Embedders should start internally switching away from using\n * |argc| and |vp| directly, except to create a |CallArgs|.  Then, when an\n * eventual release making that change occurs, porting efforts will require\n * changing methods' signatures but won't require invasive changes to the\n * methods' implementations, potentially under time pressure.\n */\n\n#ifndef js_CallArgs_h\n#define js_CallArgs_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"jstypes.h\"\n\n#include \"js/RootingAPI.h\"\n#include \"js/Value.h\"\n\nstruct JSContext;\nclass JSObject;\n\n/* Typedef for native functions called by the JS VM. */\ntypedef JSBool\n(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);\n\n/* Typedef for native functions that may be called in parallel. */\ntypedef js::ParallelResult\n(* JSParallelNative)(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Typedef for native functions that may be called either in parallel or\n * sequential execution.\n */\ntypedef JSBool\n(* JSThreadSafeNative)(js::ThreadSafeContext *cx, unsigned argc, JS::Value *vp);\n\n/*\n * Convenience wrappers for passing in ThreadSafeNative to places that expect\n * a JSNative or a JSParallelNative.\n */\ntemplate <JSThreadSafeNative threadSafeNative>\ninline JSBool\nJSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp);\n\ntemplate <JSThreadSafeNative threadSafeNative>\ninline js::ParallelResult\nJSParallelNativeThreadSafeWrapper(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Compute |this| for the |vp| inside a JSNative, either boxing primitives or\n * replacing with the global object as necessary.\n *\n * This method will go away at some point: instead use |args.thisv()|.  If the\n * value is an object, no further work is required.  If that value is |null| or\n * |undefined|, use |JS_GetGlobalForObject| to compute the global object.  If\n * the value is some other primitive, use |JS_ValueToObject| to box it.\n */\nextern JS_PUBLIC_API(JS::Value)\nJS_ComputeThis(JSContext *cx, JS::Value *vp);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\n/*\n * JS::CallReceiver encapsulates access to the callee, |this|, and eventual\n * return value for a function call.  The principal way to create a\n * CallReceiver is using JS::CallReceiverFromVp:\n *\n *   static JSBool\n *   FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallReceiver rec = JS::CallReceiverFromVp(vp);\n *\n *       // Access to the callee must occur before accessing/setting\n *       // the return value.\n *       JSObject &callee = rec.callee();\n *       rec.rval().set(JS::ObjectValue(callee));\n *\n *       // callee() and calleev() will now assert.\n *\n *       // It's always fine to access thisv().\n *       HandleValue thisv = rec.thisv();\n *       rec.rval().set(thisv);\n *\n *       // As the return value was last set to |this|, returns |this|.\n *       return true;\n *   }\n *\n * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't\n * part of the CallReceiver interface.  We will likely add them at some point.\n * Until then, you should probably continue using |vp| directly for these two\n * cases.\n *\n * CallReceiver is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\n\nnamespace detail {\n\n#ifdef DEBUG\nextern JS_PUBLIC_API(void)\nCheckIsValidConstructible(Value v);\n#endif\n\nenum UsedRval { IncludeUsedRval, NoUsedRval };\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS UsedRvalBase;\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<IncludeUsedRval>\n{\n  protected:\n    mutable bool usedRval_;\n    void setUsedRval() const { usedRval_ = true; }\n    void clearUsedRval() const { usedRval_ = false; }\n};\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>\n{\n  protected:\n    void setUsedRval() const {}\n    void clearUsedRval() const {}\n};\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<\n#ifdef DEBUG\n        WantUsedRval\n#else\n        NoUsedRval\n#endif\n    >\n{\n  protected:\n    Value *argv_;\n\n  public:\n    /*\n     * Returns the function being called, as an object.  Must not be called\n     * after rval() has been used!\n     */\n    JSObject &callee() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return argv_[-2].toObject();\n    }\n\n    /*\n     * Returns the function being called, as a value.  Must not be called after\n     * rval() has been used!\n     */\n    HandleValue calleev() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return HandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n    /*\n     * Returns the |this| value passed to the function.  This method must not\n     * be called when the function is being called as a constructor via |new|.\n     * The value may or may not be an object: it is the individual function's\n     * responsibility to box the value if needed.\n     */\n    HandleValue thisv() const {\n        // Some internal code uses thisv() in constructing cases, so don't do\n        // this yet.\n        // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING));\n        return HandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n\n    Value computeThis(JSContext *cx) const {\n        if (thisv().isObject())\n            return thisv();\n\n        return JS_ComputeThis(cx, base());\n    }\n\n    bool isConstructing() const {\n#ifdef DEBUG\n        if (this->usedRval_)\n            CheckIsValidConstructible(calleev());\n#endif\n        return argv_[-1].isMagic();\n    }\n\n    /*\n     * Returns the currently-set return value.  The initial contents of this\n     * value are unspecified.  Once this method has been called, callee() and\n     * calleev() can no longer be used.  (If you're compiling against a debug\n     * build of SpiderMonkey, these methods will assert to aid debugging.)\n     *\n     * If the method you're implementing succeeds by returning true, you *must*\n     * set this.  (SpiderMonkey doesn't currently assert this, but it will do\n     * so eventually.)  You don't need to use or change this if your method\n     * fails.\n     */\n    MutableHandleValue rval() const {\n        this->setUsedRval();\n        return MutableHandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n  public:\n    // These methods are only intended for internal use.  Embedders shouldn't\n    // use them!\n\n    Value *base() const { return argv_ - 2; }\n\n    Value *spAfterCall() const {\n        this->setUsedRval();\n        return argv_ - 1;\n    }\n\n  public:\n    // These methods are publicly exposed, but they are *not* to be used when\n    // implementing a JSNative method and encapsulating access to |vp| within\n    // it.  You probably don't want to use these!\n\n    void setCallee(Value aCalleev) const {\n        this->clearUsedRval();\n        argv_[-2] = aCalleev;\n    }\n\n    void setThis(Value aThisv) const {\n        argv_[-1] = aThisv;\n    }\n\n    MutableHandleValue mutableThisv() const {\n        return MutableHandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallReceiver : public detail::CallReceiverBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallReceiver CallReceiverFromVp(Value *vp);\n    friend CallReceiver CallReceiverFromArgv(Value *argv);\n};\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromArgv(Value *argv)\n{\n    CallReceiver receiver;\n    receiver.clearUsedRval();\n    receiver.argv_ = argv;\n    return receiver;\n}\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromVp(Value *vp)\n{\n    return CallReceiverFromArgv(vp + 2);\n}\n\n/*\n * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to\n * the function call's arguments.  The principal way to create a CallArgs is\n * like so, using JS::CallArgsFromVp:\n *\n *   static JSBool\n *   FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *\n *       // Guard against no arguments or a non-numeric arg0.\n *       if (args.length() == 0 || !args[0].isNumber()) {\n *           args.rval().setInt32(0);\n *           return true;\n *       }\n *\n *       args.rval().set(JS::NumberValue(args.length() * args[0].toNumber()));\n *       return true;\n *   }\n *\n * CallArgs is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\nnamespace detail {\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallArgsBase :\n        public mozilla::Conditional<WantUsedRval == detail::IncludeUsedRval,\n                                    CallReceiver,\n                                    CallReceiverBase<NoUsedRval> >::Type\n{\n  protected:\n    unsigned argc_;\n\n  public:\n    /* Returns the number of arguments. */\n    unsigned length() const { return argc_; }\n\n    /* Returns the i-th zero-indexed argument. */\n    MutableHandleValue operator[](unsigned i) const {\n        MOZ_ASSERT(i < argc_);\n        return MutableHandleValue::fromMarkedLocation(&this->argv_[i]);\n    }\n\n    /*\n     * Returns the i-th zero-indexed argument, or |undefined| if there's no\n     * such argument.\n     */\n    HandleValue get(unsigned i) const {\n        return i < length()\n               ? HandleValue::fromMarkedLocation(&this->argv_[i])\n               : UndefinedHandleValue;\n    }\n\n    /*\n     * Returns true if the i-th zero-indexed argument is present and is not\n     * |undefined|.\n     */\n    bool hasDefined(unsigned i) const {\n        return i < argc_ && !this->argv_[i].isUndefined();\n    }\n\n  public:\n    // These methods are publicly exposed, but we're less sure of the interface\n    // here than we'd like (because they're hackish and drop assertions).  Try\n    // to avoid using these if you can.\n\n    Value *array() const { return this->argv_; }\n    Value *end() const { return this->argv_ + argc_; }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);\n    friend CallArgs CallArgsFromSp(unsigned argc, Value *sp);\n\n    static CallArgs create(unsigned argc, Value *argv) {\n        CallArgs args;\n        args.clearUsedRval();\n        args.argv_ = argv;\n        args.argc_ = argc;\n        return args;\n    }\n\n};\n\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromVp(unsigned argc, Value *vp)\n{\n    return CallArgs::create(argc, vp + 2);\n}\n\n// This method is only intended for internal use in SpiderMonkey.  We may\n// eventually move it to an internal header.  Embedders should use\n// JS::CallArgsFromVp!\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromSp(unsigned argc, Value *sp)\n{\n    return CallArgs::create(argc, sp - argc);\n}\n\n} // namespace JS\n\n/*\n * Macros to hide interpreter stack layout details from a JSNative using its\n * JS::Value *vp parameter.  DO NOT USE THESE!  Instead use JS::CallArgs and\n * friends, above.  These macros will be removed when we change JSNative to\n * take a const JS::CallArgs&.\n */\n\n#define JS_CALLEE(cx,vp)        ((vp)[0])\n#define JS_THIS_OBJECT(cx,vp)   (JSVAL_TO_OBJECT(JS_THIS(cx,vp)))\n#define JS_ARGV(cx,vp)          ((vp) + 2)\n#define JS_RVAL(cx,vp)          (*(vp))\n#define JS_SET_RVAL(cx,vp,v)    (*(vp) = (v))\n\n/*\n * Note: if this method returns null, an error has occurred and must be\n * propagated or caught.\n */\nMOZ_ALWAYS_INLINE JS::Value\nJS_THIS(JSContext *cx, JS::Value *vp)\n{\n    return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1];\n}\n\n/*\n * |this| is passed to functions in ES5 without change.  Functions themselves\n * do any post-processing they desire to box |this|, compute the global object,\n * &c.  This macro retrieves a function's unboxed |this| value.\n *\n * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT,\n * or vice versa.  Either use the provided this value with this macro, or\n * compute the boxed |this| value using those.  JS_THIS_VALUE must not be used\n * if the function is being called as a constructor.\n *\n * But: DO NOT USE THIS!  Instead use JS::CallArgs::thisv(), above.\n *\n */\n#define JS_THIS_VALUE(cx,vp)    ((vp)[1])\n\n#endif /* js_CallArgs_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/CharacterEncoding.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_CharacterEncoding_h\n#define js_CharacterEncoding_h\n\n#include \"mozilla/Range.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\nnamespace JS {\n\n/*\n * By default, all C/C++ 1-byte-per-character strings passed into the JSAPI\n * are treated as ISO/IEC 8859-1, also known as Latin-1. That is, each\n * byte is treated as a 2-byte character, and there is no way to pass in a\n * string containing characters beyond U+00FF.\n */\nclass Latin1Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    Latin1Chars() : Base() {}\n    Latin1Chars(char *aBytes, size_t aLength) : Base(reinterpret_cast<unsigned char *>(aBytes), aLength) {}\n    Latin1Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * A Latin1Chars, but with \\0 termination for C compatibility.\n */\nclass Latin1CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    Latin1CharsZ() : Base(NULL, 0) {}\n\n    Latin1CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    Latin1CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\nclass UTF8Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    UTF8Chars() : Base() {}\n    UTF8Chars(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {}\n    UTF8Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * SpiderMonkey also deals directly with UTF-8 encoded text in some places.\n */\nclass UTF8CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    UTF8CharsZ() : Base(NULL, 0) {}\n\n    UTF8CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    UTF8CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\n/*\n * SpiderMonkey uses a 2-byte character representation: it is a\n * 2-byte-at-a-time view of a UTF-16 byte stream. This is similar to UCS-2,\n * but unlike UCS-2, we do not strip UTF-16 extension bytes. This allows a\n * sufficiently dedicated JavaScript program to be fully unicode-aware by\n * manually interpreting UTF-16 extension characters embedded in the JS\n * string.\n */\nclass TwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    TwoByteChars() : Base() {}\n    TwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    TwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A non-convertible variant of TwoByteChars that does not refer to characters\n * inlined inside a JSShortString or a JSInlineString. StableTwoByteChars are\n * thus safe to hold across a GC.\n */\nclass StableTwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    StableTwoByteChars() : Base() {}\n    StableTwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    StableTwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A TwoByteChars, but \\0 terminated for compatibility with JSFlatString.\n */\nclass TwoByteCharsZ : public mozilla::RangedPtr<jschar>\n{\n    typedef mozilla::RangedPtr<jschar> Base;\n\n  public:\n    TwoByteCharsZ() : Base(NULL, 0) {}\n\n    TwoByteCharsZ(jschar *chars, size_t length)\n      : Base(chars, length)\n    {\n        JS_ASSERT(chars[length] == '\\0');\n    }\n};\n\n/*\n * Convert a 2-byte character sequence to \"ISO-Latin-1\". This works by\n * truncating each 2-byte pair in the sequence to a 1-byte pair. If the source\n * contains any UTF-16 extension characters, then this may give invalid Latin1\n * output. The returned string is zero terminated. The returned string or the\n * returned string's |start()| must be freed with JS_free or js_free,\n * respectively. If allocation fails, an OOM error will be set and the method\n * will return a NULL chars (which can be tested for with the ! operator).\n * This method cannot trigger GC.\n */\nextern Latin1CharsZ\nLossyTwoByteCharsToNewLatin1CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nextern UTF8CharsZ\nTwoByteCharsToNewUTF8CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nuint32_t\nUtf8ToOneUcs4Char(const uint8_t *utf8Buffer, int utf8Length);\n\n/*\n * Inflate bytes in UTF-8 encoding to jschars.\n * - On error, returns an empty TwoByteCharsZ.\n * - On success, returns a malloc'd TwoByteCharsZ, and updates |outlen| to hold\n *   its length;  the length value excludes the trailing null.\n */\nextern TwoByteCharsZ\nUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n/*\n * The same as UTF8CharsToNewTwoByteCharsZ(), except that any malformed UTF-8 characters\n * will be replaced by \\uFFFD. No exception will be thrown for malformed UTF-8\n * input.\n */\nextern TwoByteCharsZ\nLossyUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n} // namespace JS\n\ninline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); }\ninline void JS_free(JS::UTF8CharsZ &ptr) { js_free((void*)ptr.get()); }\n\n#endif /* js_CharacterEncoding_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Date.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Date_h\n#define js_Date_h\n\n#include \"jstypes.h\"\n\nnamespace JS {\n\n// Year is a year, month is 0-11, day is 1-based.  The return value is\n// a number of milliseconds since the epoch.  Can return NaN.\nJS_PUBLIC_API(double)\nMakeDate(double year, unsigned month, unsigned day);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// year.  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nYearFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// month (0-11).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nMonthFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// day (1-based).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nDayFromTime(double time);\n\n} // namespace JS\n\n#endif /* js_Date_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/GCAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_GCAPI_h\n#define js_GCAPI_h\n\n#include \"js/HeapAPI.h\"\n\nnamespace JS {\n\n#define GCREASONS(D)                            \\\n    /* Reasons internal to the JS engine */     \\\n    D(API)                                      \\\n    D(MAYBEGC)                                  \\\n    D(LAST_CONTEXT)                             \\\n    D(DESTROY_CONTEXT)                          \\\n    D(LAST_DITCH)                               \\\n    D(TOO_MUCH_MALLOC)                          \\\n    D(ALLOC_TRIGGER)                            \\\n    D(DEBUG_GC)                                 \\\n    D(DEBUG_MODE_GC)                            \\\n    D(TRANSPLANT)                               \\\n    D(RESET)                                    \\\n    D(OUT_OF_NURSERY)                           \\\n    D(EVICT_NURSERY)                            \\\n    D(FULL_STORE_BUFFER)                        \\\n                                                \\\n    /* These are reserved for future use. */    \\\n    D(RESERVED0)                                \\\n    D(RESERVED1)                                \\\n    D(RESERVED2)                                \\\n    D(RESERVED3)                                \\\n    D(RESERVED4)                                \\\n    D(RESERVED5)                                \\\n    D(RESERVED6)                                \\\n    D(RESERVED7)                                \\\n    D(RESERVED8)                                \\\n    D(RESERVED9)                                \\\n    D(RESERVED10)                               \\\n    D(RESERVED11)                               \\\n    D(RESERVED12)                               \\\n    D(RESERVED13)                               \\\n    D(RESERVED14)                               \\\n    D(RESERVED15)                               \\\n    D(RESERVED16)                               \\\n    D(RESERVED17)                               \\\n    D(RESERVED18)                               \\\n    D(RESERVED19)                               \\\n                                                \\\n    /* Reasons from Firefox */                  \\\n    D(DOM_WINDOW_UTILS)                         \\\n    D(COMPONENT_UTILS)                          \\\n    D(MEM_PRESSURE)                             \\\n    D(CC_WAITING)                               \\\n    D(CC_FORCED)                                \\\n    D(LOAD_END)                                 \\\n    D(POST_COMPARTMENT)                         \\\n    D(PAGE_HIDE)                                \\\n    D(NSJSCONTEXT_DESTROY)                      \\\n    D(SET_NEW_DOCUMENT)                         \\\n    D(SET_DOC_SHELL)                            \\\n    D(DOM_UTILS)                                \\\n    D(DOM_IPC)                                  \\\n    D(DOM_WORKER)                               \\\n    D(INTER_SLICE_GC)                           \\\n    D(REFRESH_FRAME)                            \\\n    D(FULL_GC_TIMER)                            \\\n    D(SHUTDOWN_CC)                              \\\n    D(FINISH_LARGE_EVALUTE)\n\nnamespace gcreason {\n\n/* GCReasons will end up looking like JSGC_MAYBEGC */\nenum Reason {\n#define MAKE_REASON(name) name,\n    GCREASONS(MAKE_REASON)\n#undef MAKE_REASON\n    NO_REASON,\n    NUM_REASONS,\n\n    /*\n     * For telemetry, we want to keep a fixed max bucket size over time so we\n     * don't have to switch histograms. 100 is conservative; as of this writing\n     * there are 26. But the cost of extra buckets seems to be low while the\n     * cost of switching histograms is high.\n     */\n    NUM_TELEMETRY_REASONS = 100\n};\n\n} /* namespace gcreason */\n\nextern JS_FRIEND_API(void)\nPrepareZoneForGC(Zone *zone);\n\nextern JS_FRIEND_API(void)\nPrepareForFullGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nPrepareForIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsGCScheduled(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nSkipZoneForGC(Zone *zone);\n\n/*\n * When triggering a GC using one of the functions below, it is first necessary\n * to select the compartments to be collected. To do this, you can call\n * PrepareZoneForGC on each compartment, or you can call PrepareForFullGC\n * to select all compartments. Failing to select any compartment is an error.\n */\n\nextern JS_FRIEND_API(void)\nGCForReason(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkingGC(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkGCBuffers(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nIncrementalGC(JSRuntime *rt, gcreason::Reason reason, int64_t millis = 0);\n\nextern JS_FRIEND_API(void)\nFinishIncrementalGC(JSRuntime *rt, gcreason::Reason reason);\n\nenum GCProgress {\n    /*\n     * During non-incremental GC, the GC is bracketed by JSGC_CYCLE_BEGIN/END\n     * callbacks. During an incremental GC, the sequence of callbacks is as\n     * follows:\n     *   JSGC_CYCLE_BEGIN, JSGC_SLICE_END  (first slice)\n     *   JSGC_SLICE_BEGIN, JSGC_SLICE_END  (second slice)\n     *   ...\n     *   JSGC_SLICE_BEGIN, JSGC_CYCLE_END  (last slice)\n     */\n\n    GC_CYCLE_BEGIN,\n    GC_SLICE_BEGIN,\n    GC_SLICE_END,\n    GC_CYCLE_END\n};\n\nstruct JS_FRIEND_API(GCDescription) {\n    bool isCompartment_;\n\n    GCDescription(bool isCompartment)\n      : isCompartment_(isCompartment) {}\n\n    jschar *formatMessage(JSRuntime *rt) const;\n    jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;\n};\n\ntypedef void\n(* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);\n\nextern JS_FRIEND_API(GCSliceCallback)\nSetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback);\n\n/*\n * Signals a good place to do an incremental slice, because the browser is\n * drawing a frame.\n */\nextern JS_FRIEND_API(void)\nNotifyDidPaint(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalGCEnabled(JSRuntime *rt);\n\nJS_FRIEND_API(bool)\nIsIncrementalGCInProgress(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nEnableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSContext *cx);\n\nextern JS_FRIEND_API(void)\nIncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind);\n\nextern JS_FRIEND_API(void)\nIncrementalValueBarrier(const Value &v);\n\nextern JS_FRIEND_API(void)\nIncrementalObjectBarrier(JSObject *obj);\n\nextern JS_FRIEND_API(void)\nPokeGC(JSRuntime *rt);\n\n/* Was the most recent GC run incrementally? */\nextern JS_FRIEND_API(bool)\nWasIncrementalGC(JSRuntime *rt);\n\nclass ObjectPtr\n{\n    Heap<JSObject *> value;\n\n  public:\n    ObjectPtr() : value(NULL) {}\n\n    ObjectPtr(JSObject *obj) : value(obj) {}\n\n    /* Always call finalize before the destructor. */\n    ~ObjectPtr() { JS_ASSERT(!value); }\n\n    void finalize(JSRuntime *rt) {\n        if (IsIncrementalBarrierNeeded(rt))\n            IncrementalObjectBarrier(value);\n        value = NULL;\n    }\n\n    void init(JSObject *obj) { value = obj; }\n\n    JSObject *get() const { return value; }\n\n    void writeBarrierPre(JSRuntime *rt) {\n        IncrementalObjectBarrier(value);\n    }\n\n    bool isAboutToBeFinalized() {\n        return JS_IsAboutToBeFinalized(&value);\n    }\n\n    ObjectPtr &operator=(JSObject *obj) {\n        IncrementalObjectBarrier(value);\n        value = obj;\n        return *this;\n    }\n\n    void trace(JSTracer *trc, const char *name) {\n        JS_CallHeapObjectTracer(trc, &value, name);\n    }\n\n    JSObject &operator*() const { return *value; }\n    JSObject *operator->() const { return value; }\n    operator JSObject *() const { return value; }\n};\n\n/*\n * Unsets the gray bit for anything reachable from |thing|. |kind| should not be\n * JSTRACE_SHAPE. |thing| should be non-null.\n */\nextern JS_FRIEND_API(void)\nUnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);\n\n/*\n * This should be called when an object that is marked gray is exposed to the JS\n * engine (by handing it to running JS code or writing it into live JS\n * data). During incremental GC, since the gray bits haven't been computed yet,\n * we conservatively mark the object black.\n */\nstatic JS_ALWAYS_INLINE void\nExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)\n{\n    JS_ASSERT(kind != JSTRACE_SHAPE);\n\n    shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);\n#ifdef JSGC_GENERATIONAL\n    /*\n     * GC things residing in the nursery cannot be gray: they have no mark bits.\n     * All live objects in the nursery are moved to tenured at the beginning of\n     * each GC slice, so the gray marker never sees nursery things.\n     */\n    if (uintptr_t(thing) >= rt->gcNurseryStart_ && uintptr_t(thing) < rt->gcNurseryEnd_)\n        return;\n#endif\n    if (IsIncrementalBarrierNeededOnGCThing(rt, thing, kind))\n        IncrementalReferenceBarrier(thing, kind);\n    else if (GCThingIsMarkedGray(thing))\n        UnmarkGrayGCThingRecursively(thing, kind);\n}\n\nstatic JS_ALWAYS_INLINE void\nExposeValueToActiveJS(const Value &v)\n{\n    if (v.isMarkable())\n        ExposeGCThingToActiveJS(v.toGCThing(), v.gcKind());\n}\n\n} /* namespace JS */\n\n#endif /* js_GCAPI_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/HashTable.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HashTable_h\n#define js_HashTable_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/PodOperations.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js/Utility.h\"\n\nnamespace js {\n\nclass TempAllocPolicy;\ntemplate <class> struct DefaultHasher;\ntemplate <class, class> class HashMapEntry;\nnamespace detail {\n    template <class T> class HashTableEntry;\n    template <class T, class HashPolicy, class AllocPolicy> class HashTable;\n}\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based map from keys to\n// values. In particular, HashMap calls constructors and destructors of all\n// objects added so non-PODs may be used safely.\n//\n// Key/Value requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members\n//   called by HashMap must not call back into the same HashMap object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class Key,\n          class Value,\n          class HashPolicy = DefaultHasher<Key>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashMap\n{\n    typedef HashMapEntry<Key, Value> TableEntry;\n\n    struct MapHashPolicy : HashPolicy\n    {\n        typedef Key KeyType;\n        static const Key &getKey(TableEntry &e) { return e.key; }\n        static void setKey(TableEntry &e, Key &k) { const_cast<Key &>(e.key) = k; }\n    };\n\n    typedef detail::HashTable<TableEntry, MapHashPolicy, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef TableEntry Entry;\n\n    // HashMap construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashMap and check the return value.\n    HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   if (HM::Ptr p = h.lookup(3)) {\n    //     const HM::Entry &e = *p; // p acts like a pointer to Entry\n    //     assert(p->key == 3);     // Entry contains the key\n    //     char val = p->value;     // and value\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above (with T = Entry).\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Like lookup, but does not assert if two threads call lookup at the same\n    // time. Only use this method when none of the threads will modify the map.\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const { return impl.readonlyThreadsafeLookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of Key |k| (where |HashPolicy::match(k,l) == true|) using\n    // |add(p,k,v)|. After |add(p,k,v)|, |p| points to the new Entry. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   HM::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3, 'a'))\n    //       return false;\n    //   }\n    //   const HM::Entry &e = *p;   // p acts like a pointer to Entry\n    //   assert(p->key == 3);       // Entry contains the key\n    //   char val = p->value;       // and value\n    //\n    // Also see the definition of AddPtr in HashTable above (with T = Entry).\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HM::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 'a'))\n    //        return false;\n    //    }\n    //    const HM::Entry &e = *p;\n    //    assert(p->key == 3);\n    //    char val = p->value;\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return impl.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        Entry e(k, Value());\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.relookupOrAdd(p, k, mozilla::Move(e));\n    }\n\n    // |all()| returns a Range containing |count()| elements. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   for (HM::Range r = h.all(); !r.empty(); r.popFront())\n    //     char c = r.front().value;\n    //\n    // Also see the definition of Range in HashTable above (with T = Entry).\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM s;\n    //   for (HM::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front().value == 'l')\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above (with T = Entry).\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all entries without triggering destructors. This method is unsafe.\n    void clearWithoutCallingDestructors()             { impl.clearWithoutCallingDestructors(); }\n\n    // Remove all the entries and release all internal buffers. The map must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashMap.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashMap operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        AddPtr p = lookupForAdd(k);\n        if (p) {\n            p->value = v;\n            return true;\n        }\n        return add(p, k, v);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.putNew(k, mozilla::Move(e));\n    }\n\n    // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom.\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        AddPtr p = lookupForAdd(k);\n        if (p)\n            return p;\n        (void)add(p, k, defaultValue);  // p is left false-y on oom.\n        return p;\n    }\n\n    // Remove if present.\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const Key &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashMap is movable\n    HashMap(mozilla::MoveRef<HashMap> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashMap> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashMap is not copyable or assignable\n    HashMap(const HashMap &hm) MOZ_DELETE;\n    HashMap &operator=(const HashMap &hm) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based set of values. In\n// particular, HashSet calls constructors and destructors of all objects added\n// so non-PODs may be used safely.\n//\n// T requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashSet is not reentrant: T/HashPolicy/AllocPolicy members called by\n//   HashSet must not call back into the same HashSet object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class T,\n          class HashPolicy = DefaultHasher<T>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashSet\n{\n    struct SetOps : HashPolicy\n    {\n        typedef T KeyType;\n        static const KeyType &getKey(const T &t) { return t; }\n        static void setKey(T &t, KeyType &k) { t = k; }\n    };\n\n    typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef T Entry;\n\n    // HashSet construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashSet and check the return value.\n    HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   if (HS::Ptr p = h.lookup(3)) {\n    //     assert(*p == 3);   // p acts like a pointer to int\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above.\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of T value |t| (where |HashPolicy::match(t,l) == true|) using\n    // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   HS::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3))\n    //       return false;\n    //   }\n    //   assert(*p == 3);   // p acts like a pointer to int\n    //\n    // Also see the definition of AddPtr in HashTable above.\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HS::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 3))\n    //        return false;\n    //    }\n    //    assert(*p == 3);\n    //\n    // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the\n    // entry |t|, where the caller ensures match(l,t).\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const        { return impl.lookupForAdd(l); }\n\n    bool add(AddPtr &p, const T &t)                   { return impl.add(p, t); }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return impl.relookupOrAdd(p, l, t);\n    }\n\n    // |all()| returns a Range containing |count()| elements:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   for (HS::Range r = h.all(); !r.empty(); r.popFront())\n    //     int i = r.front();\n    //\n    // Also see the definition of Range in HashTable above.\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS s;\n    //   for (HS::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front() == 42)\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above.\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all the entries and release all internal buffers. The set must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashSet.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashSet operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    bool put(const T &t) {\n        AddPtr p = lookupForAdd(t);\n        return p ? true : add(p, t);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    bool putNew(const T &t) {\n        return impl.putNew(t, t);\n    }\n\n    bool putNew(const Lookup &l, const T &t) {\n        return impl.putNew(l, t);\n    }\n\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const T &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashSet is movable\n    HashSet(mozilla::MoveRef<HashSet> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashSet> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashSet is not copyable or assignable\n    HashSet(const HashSet &hs) MOZ_DELETE;\n    HashSet &operator=(const HashSet &hs) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// Hash Policy\n//\n// A hash policy P for a hash table with key-type Key must provide:\n//  - a type |P::Lookup| to use to lookup table entries;\n//  - a static member function |P::hash| with signature\n//\n//      static js::HashNumber hash(Lookup)\n//\n//    to use to hash the lookup type; and\n//  - a static member function |P::match| with signature\n//\n//      static bool match(Key, Lookup)\n//\n//    to use to test equality of key and lookup values.\n//\n// Normally, Lookup = Key. In general, though, different values and types of\n// values can be used to lookup and store. If a Lookup value |l| is != to the\n// added Key value |k|, the user must ensure that |P::match(k,l)|. E.g.:\n//\n//   js::HashSet<Key, P>::AddPtr p = h.lookup(l);\n//   if (!p) {\n//     assert(P::match(k, l));  // must hold\n//     h.add(p, k);\n//   }\n\n// Pointer hashing policy that strips the lowest zeroBits when calculating the\n// hash to improve key distribution.\ntemplate <typename Key, size_t zeroBits>\nstruct PointerHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        size_t word = reinterpret_cast<size_t>(l) >> zeroBits;\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n#if JS_BYTES_PER_WORD == 4\n        return HashNumber(word);\n#else\n        JS_STATIC_ASSERT(sizeof word == 8);\n        return HashNumber((word >> 32) ^ word);\n#endif\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(k));\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        return k == l;\n    }\n};\n\n// Default hash policy: just use the 'lookup' value. This of course only\n// works if the lookup value is integral. HashTable applies ScrambleHashCode to\n// the result of the 'hash' which means that it is 'ok' if the lookup value is\n// not well distributed over the HashNumber domain.\ntemplate <class Key>\nstruct DefaultHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        // Hash if can implicitly cast to hash number type.\n        return l;\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        // Use builtin or overloaded operator==.\n        return k == l;\n    }\n};\n\n// Specialize hashing policy for pointer types. It assumes that the type is\n// at least word-aligned. For types with smaller size use PointerHasher.\ntemplate <class T>\nstruct DefaultHasher<T *> : PointerHasher<T *, mozilla::tl::FloorLog2<sizeof(void *)>::value>\n{};\n\n// For doubles, we can xor the two uint32s.\ntemplate <>\nstruct DefaultHasher<double>\n{\n    typedef double Lookup;\n    static HashNumber hash(double d) {\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n        uint64_t u = mozilla::BitwiseCast<uint64_t>(d);\n        return HashNumber(u ^ (u >> 32));\n    }\n    static bool match(double lhs, double rhs) {\n        return mozilla::BitwiseCast<uint64_t>(lhs) == mozilla::BitwiseCast<uint64_t>(rhs);\n    }\n};\n\n/*****************************************************************************/\n\n// Both HashMap and HashSet are implemented by a single HashTable that is even\n// more heavily parameterized than the other two. This leaves HashTable gnarly\n// and extremely coupled to HashMap and HashSet; thus code should not use\n// HashTable directly.\n\ntemplate <class Key, class Value>\nclass HashMapEntry\n{\n    template <class, class, class> friend class detail::HashTable;\n    template <class> friend class detail::HashTableEntry;\n\n    HashMapEntry(const HashMapEntry &) MOZ_DELETE;\n    void operator=(const HashMapEntry &) MOZ_DELETE;\n\n  public:\n    template<typename KeyInput, typename ValueInput>\n    HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {}\n\n    HashMapEntry(mozilla::MoveRef<HashMapEntry> rhs)\n      : key(mozilla::Move(rhs->key)), value(mozilla::Move(rhs->value)) { }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n\n    const Key key;\n    Value value;\n};\n\n} // namespace js\n\nnamespace mozilla {\n\ntemplate <typename T>\nstruct IsPod<js::detail::HashTableEntry<T> > : IsPod<T> {};\n\ntemplate <typename K, typename V>\nstruct IsPod<js::HashMapEntry<K, V> >\n  : IntegralConstant<bool, IsPod<K>::value && IsPod<V>::value>\n{};\n\n} // namespace mozilla\n\nnamespace js {\n\nnamespace detail {\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable;\n\ntemplate <class T>\nclass HashTableEntry\n{\n    template <class, class, class> friend class HashTable;\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n\n    HashNumber keyHash;\n    mozilla::AlignedStorage2<NonConstT> mem;\n\n    static const HashNumber sFreeKey = 0;\n    static const HashNumber sRemovedKey = 1;\n    static const HashNumber sCollisionBit = 1;\n\n    // Assumed by calloc in createTable.\n    JS_STATIC_ASSERT(sFreeKey == 0);\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return hash > sRemovedKey;\n    }\n\n    HashTableEntry(const HashTableEntry &) MOZ_DELETE;\n    void operator=(const HashTableEntry &) MOZ_DELETE;\n    ~HashTableEntry() MOZ_DELETE;\n\n  public:\n    // NB: HashTableEntry is treated as a POD: no constructor or destructor calls.\n\n    void destroyIfLive() {\n        if (isLive())\n            mem.addr()->~T();\n    }\n\n    void destroy() {\n        JS_ASSERT(isLive());\n        mem.addr()->~T();\n    }\n\n    void swap(HashTableEntry *other) {\n        mozilla::Swap(keyHash, other->keyHash);\n        mozilla::Swap(mem, other->mem);\n    }\n\n    T &get() { JS_ASSERT(isLive()); return *mem.addr(); }\n\n    bool isFree() const    { return keyHash == sFreeKey; }\n    void clearLive()       { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }\n    void clear()           { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }\n    bool isRemoved() const { return keyHash == sRemovedKey; }\n    void removeLive()      { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }\n    bool isLive() const    { return isLiveHash(keyHash); }\n    void setCollision()               { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }\n    void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }\n    void unsetCollision()             { keyHash &= ~sCollisionBit; }\n    bool hasCollision() const         { return keyHash & sCollisionBit; }\n    bool matchHash(HashNumber hn)     { return (keyHash & ~sCollisionBit) == hn; }\n    HashNumber getKeyHash() const     { return keyHash & ~sCollisionBit; }\n\n    template <class U>\n    void setLive(HashNumber hn, const U &u)\n    {\n        JS_ASSERT(!isLive());\n        keyHash = hn;\n        new(mem.addr()) T(u);\n        JS_ASSERT(isLive());\n    }\n};\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable : private AllocPolicy\n{\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n    typedef typename HashPolicy::KeyType Key;\n    typedef typename HashPolicy::Lookup Lookup;\n\n  public:\n    typedef HashTableEntry<T> Entry;\n\n    // A nullable pointer to a hash table element. A Ptr |p| can be tested\n    // either explicitly |if (p.found()) p->...| or using boolean conversion\n    // |if (p) p->...|. Ptr objects must not be used after any mutating hash\n    // table operations unless |generation()| is tested.\n    class Ptr\n    {\n        friend class HashTable;\n        typedef void (Ptr::* ConvertibleToBool)();\n        void nonNull() {}\n\n        Entry *entry_;\n\n      protected:\n        Ptr(Entry &entry) : entry_(&entry) {}\n\n      public:\n        // Leaves Ptr uninitialized.\n        Ptr() {\n#ifdef DEBUG\n            entry_ = (Entry *)0xbad;\n#endif\n        }\n\n        bool found() const                    { return entry_->isLive(); }\n        operator ConvertibleToBool() const    { return found() ? &Ptr::nonNull : 0; }\n        bool operator==(const Ptr &rhs) const { JS_ASSERT(found() && rhs.found()); return entry_ == rhs.entry_; }\n        bool operator!=(const Ptr &rhs) const { return !(*this == rhs); }\n\n        T &operator*() const                  { return entry_->get(); }\n        T *operator->() const                 { return &entry_->get(); }\n    };\n\n    // A Ptr that can be used to add a key after a failed lookup.\n    class AddPtr : public Ptr\n    {\n        friend class HashTable;\n        HashNumber keyHash;\n        mozilla::DebugOnly<uint64_t> mutationCount;\n\n        AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}\n      public:\n        // Leaves AddPtr uninitialized.\n        AddPtr() {}\n    };\n\n    // A collection of hash table entries. The collection is enumerated by\n    // calling |front()| followed by |popFront()| as long as |!empty()|. As\n    // with Ptr/AddPtr, Range objects must not be used after any mutating hash\n    // table operation unless the |generation()| is tested.\n    class Range\n    {\n      protected:\n        friend class HashTable;\n\n        Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) {\n            while (cur < end && !cur->isLive())\n                ++cur;\n        }\n\n        Entry *cur, *end;\n        mozilla::DebugOnly<bool> validEntry;\n\n      public:\n        Range() : cur(NULL), end(NULL), validEntry(false) {}\n\n        bool empty() const {\n            return cur == end;\n        }\n\n        T &front() const {\n            JS_ASSERT(validEntry);\n            JS_ASSERT(!empty());\n            return cur->get();\n        }\n\n        void popFront() {\n            JS_ASSERT(!empty());\n            while (++cur < end && !cur->isLive())\n                continue;\n            validEntry = true;\n        }\n    };\n\n    // A Range whose lifetime delimits a mutating enumeration of a hash table.\n    // Since rehashing when elements were removed during enumeration would be\n    // bad, it is postponed until the Enum is destructed.  Since the Enum's\n    // destructor touches the hash table, the user must ensure that the hash\n    // table is still alive when the destructor runs.\n    class Enum : public Range\n    {\n        friend class HashTable;\n\n        HashTable &table;\n        bool rekeyed;\n        bool removed;\n\n        /* Not copyable. */\n        Enum(const Enum &);\n        void operator=(const Enum &);\n\n      public:\n        template<class Map> explicit\n        Enum(Map &map) : Range(map.all()), table(map.impl), rekeyed(false), removed(false) {}\n\n        // Removes the |front()| element from the table, leaving |front()|\n        // invalid until the next call to |popFront()|. For example:\n        //\n        //   HashSet<int> s;\n        //   for (HashSet<int>::Enum e(s); !e.empty(); e.popFront())\n        //     if (e.front() == 42)\n        //       e.removeFront();\n        void removeFront() {\n            table.remove(*this->cur);\n            removed = true;\n            this->validEntry = false;\n        }\n\n        // Removes the |front()| element and re-inserts it into the table with\n        // a new key at the new Lookup position.  |front()| is invalid after\n        // this operation until the next call to |popFront()|.\n        void rekeyFront(const Lookup &l, const Key &k) {\n            table.rekey(*this->cur, l, k);\n            rekeyed = true;\n            this->validEntry = false;\n        }\n\n        void rekeyFront(const Key &k) {\n            rekeyFront(k, k);\n        }\n\n        // Potentially rehashes the table.\n        ~Enum() {\n            if (rekeyed) {\n                table.gen++;\n                table.checkOverRemoved();\n            }\n\n            if (removed)\n                table.compactIfUnderloaded();\n        }\n    };\n\n    // HashTable is movable\n    HashTable(mozilla::MoveRef<HashTable> rhs)\n      : AllocPolicy(*rhs)\n    {\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n    void operator=(mozilla::MoveRef<HashTable> rhs) {\n        if (table)\n            destroyTable(*this, table, capacity());\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n\n  private:\n    // HashTable is not copyable or assignable\n    HashTable(const HashTable &) MOZ_DELETE;\n    void operator=(const HashTable &) MOZ_DELETE;\n\n  private:\n    uint32_t    hashShift;      // multiplicative hash shift\n    uint32_t    entryCount;     // number of entries in table\n    uint32_t    gen;            // entry storage generation number\n    uint32_t    removedCount;   // removed entry sentinels in table\n    Entry       *table;         // entry storage\n\n    void setTableSizeLog2(unsigned sizeLog2)\n    {\n        hashShift = sHashBits - sizeLog2;\n    }\n\n#ifdef DEBUG\n    mutable struct Stats\n    {\n        uint32_t        searches;       // total number of table searches\n        uint32_t        steps;          // hash chain links traversed\n        uint32_t        hits;           // searches that found key\n        uint32_t        misses;         // searches that didn't find key\n        uint32_t        addOverRemoved; // adds that recycled a removed entry\n        uint32_t        removes;        // calls to remove\n        uint32_t        removeFrees;    // calls to remove that freed the entry\n        uint32_t        grows;          // table expansions\n        uint32_t        shrinks;        // table contractions\n        uint32_t        compresses;     // table compressions\n        uint32_t        rehashes;       // tombstone decontaminations\n    } stats;\n#   define METER(x) x\n#else\n#   define METER(x)\n#endif\n\n    friend class mozilla::ReentrancyGuard;\n    mutable mozilla::DebugOnly<bool> entered;\n    mozilla::DebugOnly<uint64_t>     mutationCount;\n\n    // The default initial capacity is 32 (enough to hold 16 elements), but it\n    // can be as low as 4.\n    static const unsigned sMinCapacityLog2 = 2;\n    static const unsigned sMinCapacity  = 1 << sMinCapacityLog2;\n    static const unsigned sMaxInit      = JS_BIT(23);\n    static const unsigned sMaxCapacity  = JS_BIT(24);\n    static const unsigned sHashBits     = mozilla::tl::BitSize<HashNumber>::value;\n    static const uint8_t  sMinAlphaFrac = 64;  // (0x100 * .25)\n    static const uint8_t  sMaxAlphaFrac = 192; // (0x100 * .75)\n    static const uint8_t  sInvMaxAlpha  = 171; // (ceil(0x100 / .75) >> 1)\n    static const HashNumber sFreeKey = Entry::sFreeKey;\n    static const HashNumber sRemovedKey = Entry::sRemovedKey;\n    static const HashNumber sCollisionBit = Entry::sCollisionBit;\n\n    static void staticAsserts()\n    {\n        // Rely on compiler \"constant overflow warnings\".\n        JS_STATIC_ASSERT(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity);\n        JS_STATIC_ASSERT((sMaxCapacity * sInvMaxAlpha) <= UINT32_MAX);\n        JS_STATIC_ASSERT((sMaxCapacity * sizeof(Entry)) <= UINT32_MAX);\n    }\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return Entry::isLiveHash(hash);\n    }\n\n    static HashNumber prepareHash(const Lookup& l)\n    {\n        HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l));\n\n        // Avoid reserved hash codes.\n        if (!isLiveHash(keyHash))\n            keyHash -= (sRemovedKey + 1);\n        return keyHash & ~sCollisionBit;\n    }\n\n    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)\n    {\n        // See JS_STATIC_ASSERT(sFreeKey == 0) in HashTableEntry.\n        return (Entry *)alloc.calloc_(capacity * sizeof(Entry));\n    }\n\n    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)\n    {\n        for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)\n            e->destroyIfLive();\n        alloc.free_(oldTable);\n    }\n\n  public:\n    HashTable(AllocPolicy ap)\n      : AllocPolicy(ap),\n        hashShift(sHashBits),\n        entryCount(0),\n        gen(0),\n        removedCount(0),\n        table(NULL),\n        entered(false),\n        mutationCount(0)\n    {}\n\n    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)\n    {\n        JS_ASSERT(!initialized());\n\n        // Correct for sMaxAlphaFrac such that the table will not resize\n        // when adding 'length' entries.\n        if (length > sMaxInit) {\n            this->reportAllocOverflow();\n            return false;\n        }\n        uint32_t newCapacity = (length * sInvMaxAlpha) >> 7;\n\n        if (newCapacity < sMinCapacity)\n            newCapacity = sMinCapacity;\n\n        // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034).\n        uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2;\n        while (roundUp < newCapacity) {\n            roundUp <<= 1;\n            ++roundUpLog2;\n        }\n\n        newCapacity = roundUp;\n        JS_ASSERT(newCapacity <= sMaxCapacity);\n\n        table = createTable(*this, newCapacity);\n        if (!table)\n            return false;\n\n        setTableSizeLog2(roundUpLog2);\n        METER(memset(&stats, 0, sizeof(stats)));\n        return true;\n    }\n\n    bool initialized() const\n    {\n        return !!table;\n    }\n\n    ~HashTable()\n    {\n        if (table)\n            destroyTable(*this, table, capacity());\n    }\n\n  private:\n    HashNumber hash1(HashNumber hash0) const\n    {\n        return hash0 >> hashShift;\n    }\n\n    struct DoubleHash\n    {\n        HashNumber h2;\n        HashNumber sizeMask;\n    };\n\n    DoubleHash hash2(HashNumber curKeyHash) const\n    {\n        unsigned sizeLog2 = sHashBits - hashShift;\n        DoubleHash dh = {\n            ((curKeyHash << sizeLog2) >> hashShift) | 1,\n            (HashNumber(1) << sizeLog2) - 1\n        };\n        return dh;\n    }\n\n    static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh)\n    {\n        return (h1 - dh.h2) & dh.sizeMask;\n    }\n\n    bool overloaded()\n    {\n        return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);\n    }\n\n    // Would the table be underloaded if it had the given capacity and entryCount?\n    static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount)\n    {\n        return capacity > sMinCapacity && entryCount <= ((sMinAlphaFrac * capacity) >> 8);\n    }\n\n    bool underloaded()\n    {\n        return wouldBeUnderloaded(capacity(), entryCount);\n    }\n\n    static bool match(Entry &e, const Lookup &l)\n    {\n        return HashPolicy::match(HashPolicy::getKey(e.get()), l);\n    }\n\n    Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const\n    {\n        JS_ASSERT(isLiveHash(keyHash));\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (entry->isFree()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Hit: return entry.\n        if (entry->matchHash(keyHash) && match(*entry, l)) {\n            METER(stats.hits++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        // Save the first removed entry pointer so we can recycle later.\n        Entry *firstRemoved = NULL;\n\n        while(true) {\n            if (JS_UNLIKELY(entry->isRemoved())) {\n                if (!firstRemoved)\n                    firstRemoved = entry;\n            } else {\n                entry->setCollision(collisionBit);\n            }\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (entry->isFree()) {\n                METER(stats.misses++);\n                return firstRemoved ? *firstRemoved : *entry;\n            }\n\n            if (entry->matchHash(keyHash) && match(*entry, l)) {\n                METER(stats.hits++);\n                return *entry;\n            }\n        }\n    }\n\n    // This is a copy of lookup hardcoded to the assumptions:\n    //   1. the lookup is a lookupForAdd\n    //   2. the key, whose |keyHash| has been passed is not in the table,\n    //   3. no entries have been removed from the table.\n    // This specialized search avoids the need for recovering lookup values\n    // from entries, which allows more flexible Lookup/Key types.\n    Entry &findFreeEntry(HashNumber keyHash)\n    {\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // We assume 'keyHash' has already been distributed.\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (!entry->isLive()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        while(true) {\n            JS_ASSERT(!entry->isRemoved());\n            entry->setCollision();\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (!entry->isLive()) {\n                METER(stats.misses++);\n                return *entry;\n            }\n        }\n    }\n\n    enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed };\n\n    RebuildStatus changeTableSize(int deltaLog2)\n    {\n        // Look, but don't touch, until we succeed in getting new entry store.\n        Entry *oldTable = table;\n        uint32_t oldCap = capacity();\n        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;\n        uint32_t newCapacity = JS_BIT(newLog2);\n        if (newCapacity > sMaxCapacity) {\n            this->reportAllocOverflow();\n            return RehashFailed;\n        }\n\n        Entry *newTable = createTable(*this, newCapacity);\n        if (!newTable)\n            return RehashFailed;\n\n        // We can't fail from here on, so update table parameters.\n        setTableSizeLog2(newLog2);\n        removedCount = 0;\n        gen++;\n        table = newTable;\n\n        // Copy only live entries, leaving removed ones behind.\n        for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {\n            if (src->isLive()) {\n                HashNumber hn = src->getKeyHash();\n                findFreeEntry(hn).setLive(hn, mozilla::Move(src->get()));\n                src->destroy();\n            }\n        }\n\n        // All entries have been destroyed, no need to destroyTable.\n        this->free_(oldTable);\n        return Rehashed;\n    }\n\n    RebuildStatus checkOverloaded()\n    {\n        if (!overloaded())\n            return NotOverloaded;\n\n        // Compress if a quarter or more of all entries are removed.\n        int deltaLog2;\n        if (removedCount >= (capacity() >> 2)) {\n            METER(stats.compresses++);\n            deltaLog2 = 0;\n        } else {\n            METER(stats.grows++);\n            deltaLog2 = 1;\n        }\n\n        return changeTableSize(deltaLog2);\n    }\n\n    // Infallibly rehash the table if we are overloaded with removals.\n    void checkOverRemoved()\n    {\n        if (overloaded()) {\n            if (checkOverloaded() == RehashFailed)\n                rehashTableInPlace();\n        }\n    }\n\n    void remove(Entry &e)\n    {\n        JS_ASSERT(table);\n        METER(stats.removes++);\n\n        if (e.hasCollision()) {\n            e.removeLive();\n            removedCount++;\n        } else {\n            METER(stats.removeFrees++);\n            e.clearLive();\n        }\n        entryCount--;\n        mutationCount++;\n    }\n\n    void checkUnderloaded()\n    {\n        if (underloaded()) {\n            METER(stats.shrinks++);\n            (void) changeTableSize(-1);\n        }\n    }\n\n    // Resize the table down to the largest capacity which doesn't underload the\n    // table.  Since we call checkUnderloaded() on every remove, you only need\n    // to call this after a bulk removal of items done without calling remove().\n    void compactIfUnderloaded()\n    {\n        int32_t resizeLog2 = 0;\n        uint32_t newCapacity = capacity();\n        while (wouldBeUnderloaded(newCapacity, entryCount)) {\n            newCapacity = newCapacity >> 1;\n            resizeLog2--;\n        }\n\n        if (resizeLog2 != 0) {\n            changeTableSize(resizeLog2);\n        }\n    }\n\n    // This is identical to changeTableSize(currentSize), but without requiring\n    // a second table.  We do this by recycling the collision bits to tell us if\n    // the element is already inserted or still waiting to be inserted.  Since\n    // already-inserted elements win any conflicts, we get the same table as we\n    // would have gotten through random insertion order.\n    void rehashTableInPlace()\n    {\n        METER(stats.rehashes++);\n        removedCount = 0;\n        for (size_t i = 0; i < capacity(); ++i)\n            table[i].unsetCollision();\n\n        for (size_t i = 0; i < capacity();) {\n            Entry *src = &table[i];\n\n            if (!src->isLive() || src->hasCollision()) {\n                ++i;\n                continue;\n            }\n\n            HashNumber keyHash = src->getKeyHash();\n            HashNumber h1 = hash1(keyHash);\n            DoubleHash dh = hash2(keyHash);\n            Entry *tgt = &table[h1];\n            while (true) {\n                if (!tgt->hasCollision()) {\n                    src->swap(tgt);\n                    tgt->setCollision();\n                    break;\n                }\n\n                h1 = applyDoubleHash(h1, dh);\n                tgt = &table[h1];\n            }\n        }\n\n        // TODO: this algorithm leaves collision bits on *all* elements, even if\n        // they are on no collision path. We have the option of setting the\n        // collision bits correctly on a subsequent pass or skipping the rehash\n        // unless we are totally filled with tombstones: benchmark to find out\n        // which approach is best.\n    }\n\n  public:\n    void clear()\n    {\n        if (mozilla::IsPod<Entry>::value) {\n            memset(table, 0, sizeof(*table) * capacity());\n        } else {\n            uint32_t tableCapacity = capacity();\n            for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)\n                e->clear();\n        }\n        removedCount = 0;\n        entryCount = 0;\n        mutationCount++;\n    }\n\n    void finish()\n    {\n        JS_ASSERT(!entered);\n\n        if (!table)\n            return;\n\n        destroyTable(*this, table, capacity());\n        table = NULL;\n        gen++;\n        entryCount = 0;\n        removedCount = 0;\n        mutationCount++;\n    }\n\n    Range all() const\n    {\n        JS_ASSERT(table);\n        return Range(table, table + capacity());\n    }\n\n    bool empty() const\n    {\n        JS_ASSERT(table);\n        return !entryCount;\n    }\n\n    uint32_t count() const\n    {\n        JS_ASSERT(table);\n        return entryCount;\n    }\n\n    uint32_t capacity() const\n    {\n        JS_ASSERT(table);\n        return JS_BIT(sHashBits - hashShift);\n    }\n\n    uint32_t generation() const\n    {\n        JS_ASSERT(table);\n        return gen;\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(table);\n    }\n\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    Ptr lookup(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const\n    {\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    AddPtr lookupForAdd(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        Entry &entry = lookup(l, keyHash, sCollisionBit);\n        AddPtr p(entry, keyHash);\n        p.mutationCount = mutationCount;\n        return p;\n    }\n\n    template <class U>\n    bool add(AddPtr &p, const U &rhs)\n    {\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(mutationCount == p.mutationCount);\n        JS_ASSERT(table);\n        JS_ASSERT(!p.found());\n        JS_ASSERT(!(p.keyHash & sCollisionBit));\n\n        // Changing an entry from removed to live does not affect whether we\n        // are overloaded and can be handled separately.\n        if (p.entry_->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            p.keyHash |= sCollisionBit;\n        } else {\n            // Preserve the validity of |p.entry_|.\n            RebuildStatus status = checkOverloaded();\n            if (status == RehashFailed)\n                return false;\n            if (status == Rehashed)\n                p.entry_ = &findFreeEntry(p.keyHash);\n        }\n\n        p.entry_->setLive(p.keyHash, rhs);\n        entryCount++;\n        mutationCount++;\n        return true;\n    }\n\n    template <class U>\n    void putNewInfallible(const Lookup &l, const U &u)\n    {\n        JS_ASSERT(table);\n\n        HashNumber keyHash = prepareHash(l);\n        Entry *entry = &findFreeEntry(keyHash);\n\n        if (entry->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            keyHash |= sCollisionBit;\n        }\n\n        entry->setLive(keyHash, u);\n        entryCount++;\n        mutationCount++;\n    }\n\n    template <class U>\n    bool putNew(const Lookup &l, const U &u)\n    {\n        if (checkOverloaded() == RehashFailed)\n            return false;\n\n        putNewInfallible(l, u);\n        return true;\n    }\n\n    template <class U>\n    bool relookupOrAdd(AddPtr& p, const Lookup &l, const U &u)\n    {\n        p.mutationCount = mutationCount;\n        {\n            mozilla::ReentrancyGuard g(*this);\n            p.entry_ = &lookup(l, p.keyHash, sCollisionBit);\n        }\n        return p.found() || add(p, u);\n    }\n\n    void remove(Ptr p)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        remove(*p.entry_);\n        checkUnderloaded();\n    }\n\n    void rekey(Ptr p, const Lookup &l, const Key &k)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));\n        HashPolicy::setKey(t, const_cast<Key &>(k));\n        remove(*p.entry_);\n        putNewInfallible(l, mozilla::Move(t));\n    }\n\n#undef METER\n};\n\n}  // namespace detail\n}  // namespace js\n\n#endif  /* js_HashTable_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/HeapAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HeapAPI_h\n#define js_HeapAPI_h\n\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n\n/* These values are private to the JS engine. */\nnamespace js {\nnamespace gc {\n\nconst size_t ArenaShift = 12;\nconst size_t ArenaSize = size_t(1) << ArenaShift;\nconst size_t ArenaMask = ArenaSize - 1;\n\nconst size_t ChunkShift = 20;\nconst size_t ChunkSize = size_t(1) << ChunkShift;\nconst size_t ChunkMask = ChunkSize - 1;\n\nconst size_t CellShift = 3;\nconst size_t CellSize = size_t(1) << CellShift;\nconst size_t CellMask = CellSize - 1;\n\n/* These are magic constants derived from actual offsets in gc/Heap.h. */\nconst size_t ChunkMarkBitmapOffset = 1032368;\nconst size_t ChunkMarkBitmapBits = 129024;\nconst size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);\n\n/*\n * Live objects are marked black. How many other additional colors are available\n * depends on the size of the GCThing. Objects marked gray are eligible for\n * cycle collection.\n */\nstatic const uint32_t BLACK = 0;\nstatic const uint32_t GRAY = 1;\n\n} /* namespace gc */\n} /* namespace js */\n\nnamespace JS {\nstruct Zone;\n} /* namespace JS */\n\nnamespace JS {\nnamespace shadow {\n\nstruct ArenaHeader\n{\n    JS::Zone *zone;\n};\n\nstruct Zone\n{\n    bool needsBarrier_;\n\n    Zone() : needsBarrier_(false) {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\nnamespace gc {\n\nstatic JS_ALWAYS_INLINE uintptr_t *\nGetGCThingMarkBitmap(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkMarkBitmapOffset;\n    return reinterpret_cast<uintptr_t *>(addr);\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::Runtime *\nGetGCThingRuntime(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkRuntimeOffset;\n    return *reinterpret_cast<JS::shadow::Runtime **>(addr);\n}\n\nstatic JS_ALWAYS_INLINE void\nGetGCThingMarkWordAndMask(const void *thing, uint32_t color,\n                          uintptr_t **wordp, uintptr_t *maskp)\n{\n    uintptr_t addr = uintptr_t(thing);\n    size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;\n    JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);\n    uintptr_t *bitmap = GetGCThingMarkBitmap(thing);\n    *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD);\n    *wordp = &bitmap[bit / JS_BITS_PER_WORD];\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::ArenaHeader *\nGetGCThingArena(void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ArenaMask;\n    return reinterpret_cast<JS::shadow::ArenaHeader *>(addr);\n}\n\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\nstatic JS_ALWAYS_INLINE Zone *\nGetGCThingZone(void *thing)\n{\n    JS_ASSERT(thing);\n    return js::gc::GetGCThingArena(thing)->zone;\n}\n\nstatic JS_ALWAYS_INLINE Zone *\nGetObjectZone(JSObject *obj)\n{\n    return GetGCThingZone(obj);\n}\n\nstatic JS_ALWAYS_INLINE bool\nGCThingIsMarkedGray(void *thing)\n{\n    uintptr_t *word, mask;\n    js::gc::GetGCThingMarkWordAndMask(thing, js::gc::GRAY, &word, &mask);\n    return *word & mask;\n}\n\nstatic JS_ALWAYS_INLINE bool\nIsIncrementalBarrierNeededOnGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind)\n{\n    if (!rt->needsBarrier_)\n        return false;\n    JS::Zone *zone = GetGCThingZone(thing);\n    return reinterpret_cast<shadow::Zone *>(zone)->needsBarrier_;\n}\n\n} /* namespace JS */\n\n#endif /* js_HeapAPI_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/LegacyIntTypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This section typedefs the old 'native' types to the new <stdint.h> types.\n * These redefinitions are provided solely to allow JSAPI users to more easily\n * transition to <stdint.h> types.  They are not to be used in the JSAPI, and\n * new JSAPI user code should not use them.  This mapping file may eventually\n * be removed from SpiderMonkey, so don't depend on it in the long run.\n */\n\n/*\n * BEWARE: Comity with other implementers of these types is not guaranteed.\n *         Indeed, if you use this header and third-party code defining these\n *         types, *expect* to encounter either compile errors or link errors,\n *         depending how these types are used and on the order of inclusion.\n *         It is safest to use only the <stdint.h> types.\n */\n#ifndef js_LegacyIntTypes_h\n#define js_LegacyIntTypes_h\n\n#include <stdint.h>\n\n#include \"js-config.h\"\n\ntypedef uint8_t uint8;\ntypedef uint16_t uint16;\ntypedef uint32_t uint32;\ntypedef uint64_t uint64;\n\n/*\n * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very\n * common header file) defines the types int8, int16, int32, and int64.\n * So we don't define these four types here to avoid conflicts in case\n * the code also includes sys/types.h.\n */\n#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)\n#include <sys/inttypes.h>\n#else\ntypedef int8_t int8;\ntypedef int16_t int16;\ntypedef int32_t int32;\ntypedef int64_t int64;\n#endif /* AIX && HAVE_SYS_INTTYPES_H */\n\ntypedef uint8_t JSUint8;\ntypedef uint16_t JSUint16;\ntypedef uint32_t JSUint32;\ntypedef uint64_t JSUint64;\n\ntypedef int8_t JSInt8;\ntypedef int16_t JSInt16;\ntypedef int32_t JSInt32;\ntypedef int64_t JSInt64;\n\n#endif /* js_LegacyIntTypes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/MemoryMetrics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_MemoryMetrics_h\n#define js_MemoryMetrics_h\n\n// These declarations are not within jsapi.h because they are highly likely to\n// change in the future. Depend on them at your own risk.\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include <string.h>\n\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n#include \"js/Vector.h\"\n\nclass nsISupports;      // This is needed for ObjectPrivateVisitor.\n\nnamespace js {\n\n// In memory reporting, we have concept of \"sundries\", line items which are too\n// small to be worth reporting individually.  Under some circumstances, a memory\n// reporter gets tossed into the sundries bucket if it's smaller than\n// MemoryReportingSundriesThreshold() bytes.\n//\n// We need to define this value here, rather than in the code which actually\n// generates the memory reports, because HugeStringInfo uses this value.\nJS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();\n\n} // namespace js\n\nnamespace JS {\n\n// Data for tracking memory usage of things hanging off objects.\nstruct ObjectsExtraSizes\n{\n    size_t slots;\n    size_t elementsNonAsmJS;\n    size_t elementsAsmJSHeap;\n    size_t elementsAsmJSNonHeap;\n    size_t argumentsData;\n    size_t regExpStatics;\n    size_t propertyIteratorData;\n    size_t ctypesData;\n    size_t private_;    // The '_' suffix is required because |private| is a keyword.\n                        // Note that this field is measured separately from the others.\n\n    ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); }\n\n    void add(ObjectsExtraSizes &sizes) {\n        this->slots                += sizes.slots;\n        this->elementsNonAsmJS     += sizes.elementsNonAsmJS;\n        this->elementsAsmJSHeap    += sizes.elementsAsmJSHeap;\n        this->elementsAsmJSNonHeap += sizes.elementsAsmJSNonHeap;\n        this->argumentsData        += sizes.argumentsData;\n        this->regExpStatics        += sizes.regExpStatics;\n        this->propertyIteratorData += sizes.propertyIteratorData;\n        this->ctypesData           += sizes.ctypesData;\n        this->private_             += sizes.private_;\n    }\n};\n\n// Data for tracking analysis/inference memory usage.\nstruct TypeInferenceSizes\n{\n    size_t typeScripts;\n    size_t typeResults;\n    size_t analysisPool;\n    size_t pendingArrays;\n    size_t allocationSiteTables;\n    size_t arrayTypeTables;\n    size_t objectTypeTables;\n\n    TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); }\n\n    void add(TypeInferenceSizes &sizes) {\n        this->typeScripts          += sizes.typeScripts;\n        this->typeResults          += sizes.typeResults;\n        this->analysisPool         += sizes.analysisPool;\n        this->pendingArrays        += sizes.pendingArrays;\n        this->allocationSiteTables += sizes.allocationSiteTables;\n        this->arrayTypeTables      += sizes.arrayTypeTables;\n        this->objectTypeTables     += sizes.objectTypeTables;\n    }\n};\n\n// Data for tracking JIT-code memory usage.\nstruct CodeSizes\n{\n    size_t ion;\n    size_t asmJS;\n    size_t baseline;\n    size_t regexp;\n    size_t other;\n    size_t unused;\n\n    CodeSizes() { memset(this, 0, sizeof(CodeSizes)); }\n};\n\n// Holds data about a huge string (one which uses more HugeStringInfo::MinSize\n// bytes of memory), so we can report it individually.\nstruct HugeStringInfo\n{\n    HugeStringInfo() : length(0), size(0) { memset(&buffer, 0, sizeof(buffer)); }\n\n    // A string needs to take up this many bytes of storage before we consider\n    // it to be \"huge\".\n    static size_t MinSize() {\n        return js::MemoryReportingSundriesThreshold();\n    }\n\n    // A string's size in memory is not necessarily equal to twice its length\n    // because the allocator and the JS engine both may round up.\n    size_t length;\n    size_t size;\n\n    // We record the first 32 chars of the escaped string here.  (We escape the\n    // string so we can use a char[] instead of a jschar[] here.\n    char buffer[32];\n};\n\n// These measurements relate directly to the JSRuntime, and not to\n// compartments within it.\nstruct RuntimeSizes\n{\n    RuntimeSizes() { memset(this, 0, sizeof(RuntimeSizes)); }\n\n    size_t object;\n    size_t atomsTable;\n    size_t contexts;\n    size_t dtoa;\n    size_t temporary;\n    size_t regexpData;\n    size_t interpreterStack;\n    size_t gcMarker;\n    size_t mathCache;\n    size_t scriptData;\n    size_t scriptSources;\n\n    CodeSizes code;\n};\n\nstruct ZoneStats\n{\n    ZoneStats()\n      : extra(NULL),\n        gcHeapArenaAdmin(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapStringsNormal(0),\n        gcHeapStringsShort(0),\n        gcHeapLazyScripts(0),\n        gcHeapTypeObjects(0),\n        gcHeapIonCodes(0),\n        stringCharsNonHuge(0),\n        lazyScripts(0),\n        typeObjects(0),\n        typePool(0),\n        hugeStrings()\n    {}\n\n    ZoneStats(const ZoneStats &other)\n      : extra(other.extra),\n        gcHeapArenaAdmin(other.gcHeapArenaAdmin),\n        gcHeapUnusedGcThings(other.gcHeapUnusedGcThings),\n        gcHeapStringsNormal(other.gcHeapStringsNormal),\n        gcHeapStringsShort(other.gcHeapStringsShort),\n        gcHeapLazyScripts(other.gcHeapLazyScripts),\n        gcHeapTypeObjects(other.gcHeapTypeObjects),\n        gcHeapIonCodes(other.gcHeapIonCodes),\n        stringCharsNonHuge(other.stringCharsNonHuge),\n        lazyScripts(other.lazyScripts),\n        typeObjects(other.typeObjects),\n        typePool(other.typePool),\n        hugeStrings()\n    {\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // Add other's numbers to this object's numbers.\n    void add(ZoneStats &other) {\n        #define ADD(x)  this->x += other.x\n\n        ADD(gcHeapArenaAdmin);\n        ADD(gcHeapUnusedGcThings);\n\n        ADD(gcHeapStringsNormal);\n        ADD(gcHeapStringsShort);\n        ADD(gcHeapLazyScripts);\n        ADD(gcHeapTypeObjects);\n        ADD(gcHeapIonCodes);\n\n        ADD(stringCharsNonHuge);\n        ADD(lazyScripts);\n        ADD(typeObjects);\n        ADD(typePool);\n\n        #undef ADD\n\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    size_t gcHeapArenaAdmin;\n    size_t gcHeapUnusedGcThings;\n\n    size_t gcHeapStringsNormal;\n    size_t gcHeapStringsShort;\n\n    size_t gcHeapLazyScripts;\n    size_t gcHeapTypeObjects;\n    size_t gcHeapIonCodes;\n\n    size_t stringCharsNonHuge;\n    size_t lazyScripts;\n    size_t typeObjects;\n    size_t typePool;\n\n    js::Vector<HugeStringInfo, 0, js::SystemAllocPolicy> hugeStrings;\n\n    // The size of all the live things in the GC heap that don't belong to any\n    // compartment.\n    size_t GCHeapThingsSize();\n};\n\nstruct CompartmentStats\n{\n    CompartmentStats()\n      : extra(NULL),\n        gcHeapObjectsOrdinary(0),\n        gcHeapObjectsFunction(0),\n        gcHeapObjectsDenseArray(0),\n        gcHeapObjectsSlowArray(0),\n        gcHeapObjectsCrossCompartmentWrapper(0),\n        gcHeapShapesTreeGlobalParented(0),\n        gcHeapShapesTreeNonGlobalParented(0),\n        gcHeapShapesDict(0),\n        gcHeapShapesBase(0),\n        gcHeapScripts(0),\n        objectsExtra(),\n        shapesExtraTreeTables(0),\n        shapesExtraDictTables(0),\n        shapesExtraTreeShapeKids(0),\n        shapesCompartmentTables(0),\n        scriptData(0),\n        baselineData(0),\n        baselineStubsFallback(0),\n        baselineStubsOptimized(0),\n        ionData(0),\n        compartmentObject(0),\n        crossCompartmentWrappersTable(0),\n        regexpCompartment(0),\n        debuggeesSet(0),\n        typeInference()\n    {}\n\n    CompartmentStats(const CompartmentStats &other)\n      : extra(other.extra),\n        gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary),\n        gcHeapObjectsFunction(other.gcHeapObjectsFunction),\n        gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray),\n        gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray),\n        gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper),\n        gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented),\n        gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented),\n        gcHeapShapesDict(other.gcHeapShapesDict),\n        gcHeapShapesBase(other.gcHeapShapesBase),\n        gcHeapScripts(other.gcHeapScripts),\n        objectsExtra(other.objectsExtra),\n        shapesExtraTreeTables(other.shapesExtraTreeTables),\n        shapesExtraDictTables(other.shapesExtraDictTables),\n        shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids),\n        shapesCompartmentTables(other.shapesCompartmentTables),\n        scriptData(other.scriptData),\n        baselineData(other.baselineData),\n        baselineStubsFallback(other.baselineStubsFallback),\n        baselineStubsOptimized(other.baselineStubsOptimized),\n        ionData(other.ionData),\n        compartmentObject(other.compartmentObject),\n        crossCompartmentWrappersTable(other.crossCompartmentWrappersTable),\n        regexpCompartment(other.regexpCompartment),\n        debuggeesSet(other.debuggeesSet),\n        typeInference(other.typeInference)\n    {\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    // If you add a new number, remember to update the constructors, add(), and\n    // maybe gcHeapThingsSize()!\n    size_t gcHeapObjectsOrdinary;\n    size_t gcHeapObjectsFunction;\n    size_t gcHeapObjectsDenseArray;\n    size_t gcHeapObjectsSlowArray;\n    size_t gcHeapObjectsCrossCompartmentWrapper;\n    size_t gcHeapShapesTreeGlobalParented;\n    size_t gcHeapShapesTreeNonGlobalParented;\n    size_t gcHeapShapesDict;\n    size_t gcHeapShapesBase;\n    size_t gcHeapScripts;\n    ObjectsExtraSizes objectsExtra;\n\n    size_t shapesExtraTreeTables;\n    size_t shapesExtraDictTables;\n    size_t shapesExtraTreeShapeKids;\n    size_t shapesCompartmentTables;\n    size_t scriptData;\n    size_t baselineData;\n    size_t baselineStubsFallback;\n    size_t baselineStubsOptimized;\n    size_t ionData;\n    size_t compartmentObject;\n    size_t crossCompartmentWrappersTable;\n    size_t regexpCompartment;\n    size_t debuggeesSet;\n\n    TypeInferenceSizes typeInference;\n\n    // Add cStats's numbers to this object's numbers.\n    void add(CompartmentStats &cStats) {\n        #define ADD(x)  this->x += cStats.x\n\n        ADD(gcHeapObjectsOrdinary);\n        ADD(gcHeapObjectsFunction);\n        ADD(gcHeapObjectsDenseArray);\n        ADD(gcHeapObjectsSlowArray);\n        ADD(gcHeapObjectsCrossCompartmentWrapper);\n        ADD(gcHeapShapesTreeGlobalParented);\n        ADD(gcHeapShapesTreeNonGlobalParented);\n        ADD(gcHeapShapesDict);\n        ADD(gcHeapShapesBase);\n        ADD(gcHeapScripts);\n        objectsExtra.add(cStats.objectsExtra);\n\n        ADD(shapesExtraTreeTables);\n        ADD(shapesExtraDictTables);\n        ADD(shapesExtraTreeShapeKids);\n        ADD(shapesCompartmentTables);\n        ADD(scriptData);\n        ADD(baselineData);\n        ADD(baselineStubsFallback);\n        ADD(baselineStubsOptimized);\n        ADD(ionData);\n        ADD(compartmentObject);\n        ADD(crossCompartmentWrappersTable);\n        ADD(regexpCompartment);\n        ADD(debuggeesSet);\n\n        #undef ADD\n\n        typeInference.add(cStats.typeInference);\n    }\n\n    // The size of all the live things in the GC heap.\n    size_t GCHeapThingsSize();\n};\n\nstruct RuntimeStats\n{\n    RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)\n      : runtime(),\n        gcHeapChunkTotal(0),\n        gcHeapDecommittedArenas(0),\n        gcHeapUnusedChunks(0),\n        gcHeapUnusedArenas(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapChunkAdmin(0),\n        gcHeapGcThings(0),\n        cTotals(),\n        zTotals(),\n        compartmentStatsVector(),\n        zoneStatsVector(),\n        currZoneStats(NULL),\n        mallocSizeOf_(mallocSizeOf)\n    {}\n\n    RuntimeSizes runtime;\n\n    // If you add a new number, remember to update the constructor!\n\n    // Here's a useful breakdown of the GC heap.\n    //\n    // - rtStats.gcHeapChunkTotal\n    //   - decommitted bytes\n    //     - rtStats.gcHeapDecommittedArenas (decommitted arenas in non-empty chunks)\n    //   - unused bytes\n    //     - rtStats.gcHeapUnusedChunks (empty chunks)\n    //     - rtStats.gcHeapUnusedArenas (empty arenas within non-empty chunks)\n    //     - rtStats.total.gcHeapUnusedGcThings (empty GC thing slots within non-empty arenas)\n    //   - used bytes\n    //     - rtStats.gcHeapChunkAdmin\n    //     - rtStats.total.gcHeapArenaAdmin\n    //     - rtStats.gcHeapGcThings (in-use GC things)\n    //\n    // It's possible that some arenas in empty chunks may be decommitted, but\n    // we don't count those under rtStats.gcHeapDecommittedArenas because (a)\n    // it's rare, and (b) this means that rtStats.gcHeapUnusedChunks is a\n    // multiple of the chunk size, which is good.\n\n    size_t gcHeapChunkTotal;\n    size_t gcHeapDecommittedArenas;\n    size_t gcHeapUnusedChunks;\n    size_t gcHeapUnusedArenas;\n    size_t gcHeapUnusedGcThings;\n    size_t gcHeapChunkAdmin;\n    size_t gcHeapGcThings;\n\n    // The sum of all compartment's measurements.\n    CompartmentStats cTotals;\n    ZoneStats zTotals;\n\n    js::Vector<CompartmentStats, 0, js::SystemAllocPolicy> compartmentStatsVector;\n    js::Vector<ZoneStats, 0, js::SystemAllocPolicy> zoneStatsVector;\n\n    ZoneStats *currZoneStats;\n\n    mozilla::MallocSizeOf mallocSizeOf_;\n\n    virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;\n    virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;\n};\n\nclass ObjectPrivateVisitor\n{\n  public:\n    // Within CollectRuntimeStats, this method is called for each JS object\n    // that has an nsISupports pointer.\n    virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0;\n\n    // A callback that gets a JSObject's nsISupports pointer, if it has one.\n    // Note: this function does *not* addref |iface|.\n    typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface);\n    GetISupportsFun getISupports_;\n\n    ObjectPrivateVisitor(GetISupportsFun getISupports)\n      : getISupports_(getISupports)\n    {}\n};\n\nextern JS_PUBLIC_API(bool)\nCollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv);\n\nextern JS_PUBLIC_API(size_t)\nSystemCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nUserCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nPeakSizeOfTemporary(const JSRuntime *rt);\n\n} // namespace JS\n\n#endif /* js_MemoryMetrics_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/PropertyKey.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::PropertyKey implementation. */\n\n#ifndef js_PropertyKey_h\n#define js_PropertyKey_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"js/Value.h\"\n\nstruct JSContext;\n\nnamespace JS {\n\nclass PropertyKey;\n\nnamespace detail {\n\nextern JS_PUBLIC_API(bool)\nToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n} // namespace detail\n\n/*\n * A PropertyKey is a key used to access some property on an object.  It is a\n * natural way to represent a property accessed using a JavaScript value.\n *\n * PropertyKey can represent indexes, named properties, and ES6 symbols.  The\n * latter aren't implemented in SpiderMonkey yet, but PropertyKey carves out\n * space for them.\n */\nclass PropertyKey\n{\n    Value v;\n    friend JS_PUBLIC_API(bool) detail::ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n  public:\n    explicit PropertyKey(uint32_t index) : v(PrivateUint32Value(index)) {}\n\n    /*\n     * An index is a string property name whose characters exactly spell out an\n     * unsigned 32-bit integer in decimal: \"0\", \"1\", \"2\", ...., \"4294967294\",\n     * \"4294967295\".\n     */\n    bool isIndex(uint32_t *index) {\n        // The implementation here assumes that private uint32_t are stored\n        // using the int32_t representation.  This is purely an implementation\n        // detail: embedders must not rely upon this!\n        if (!v.isInt32())\n            return false;\n        *index = v.toPrivateUint32();\n        return true;\n    }\n\n    /*\n     * A name is a string property name which is *not* an index.  Note that by\n     * the ECMAScript language grammar, any dotted property access |obj.prop|\n     * will access a named property.\n     */\n    bool isName(JSString **str) {\n        uint32_t dummy;\n        if (isIndex(&dummy))\n            return false;\n        *str = v.toString();\n        return true;\n    }\n\n    /*\n     * A symbol is a property name that's a Symbol, a particular kind of object\n     * in ES6.  It is the only kind of property name that's not a string.\n     *\n     * SpiderMonkey doesn't yet implement symbols, but we're carving out API\n     * space for them in advance.\n     */\n    bool isSymbol() {\n        return false;\n    }\n};\n\ninline bool\nToPropertyKey(JSContext *cx, HandleValue v, PropertyKey *key)\n{\n    if (v.isInt32() && v.toInt32() >= 0) {\n        *key = PropertyKey(uint32_t(v.toInt32()));\n        return true;\n    }\n\n    return detail::ToPropertyKeySlow(cx, v, key);\n}\n\n} // namespace JS\n\n#endif /* js_PropertyKey_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/RequiredDefines.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Various #defines required to build SpiderMonkey.  Embedders should add this\n * file to the start of the command line via -include or a similar mechanism,\n * or SpiderMonkey public headers may not work correctly.\n */\n\n#ifndef js_RequiredDefines_h\n#define js_RequiredDefines_h\n\n/*\n * The c99 defining the limit macros (UINT32_MAX for example), says:\n * C++ implementations should define these macros only when __STDC_LIMIT_MACROS\n * is defined before <stdint.h> is included.\n */\n#define __STDC_LIMIT_MACROS\n\n#endif /* js_RequiredDefines_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/RootingAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_RootingAPI_h\n#define js_RootingAPI_h\n\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\n/*\n * Moving GC Stack Rooting\n *\n * A moving GC may change the physical location of GC allocated things, even\n * when they are rooted, updating all pointers to the thing to refer to its new\n * location. The GC must therefore know about all live pointers to a thing,\n * not just one of them, in order to behave correctly.\n *\n * The |Rooted| and |Handle| classes below are used to root stack locations\n * whose value may be held live across a call that can trigger GC. For a\n * code fragment such as:\n *\n * JSObject *obj = NewObject(cx);\n * DoSomething(cx);\n * ... = obj->lastProperty();\n *\n * If |DoSomething()| can trigger a GC, the stack location of |obj| must be\n * rooted to ensure that the GC does not move the JSObject referred to by\n * |obj| without updating |obj|'s location itself. This rooting must happen\n * regardless of whether there are other roots which ensure that the object\n * itself will not be collected.\n *\n * If |DoSomething()| cannot trigger a GC, and the same holds for all other\n * calls made between |obj|'s definitions and its last uses, then no rooting\n * is required.\n *\n * SpiderMonkey can trigger a GC at almost any time and in ways that are not\n * always clear. For example, the following innocuous-looking actions can\n * cause a GC: allocation of any new GC thing; JSObject::hasProperty;\n * JS_ReportError and friends; and ToNumber, among many others. The following\n * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_,\n * rt->malloc_, and friends and JS_ReportOutOfMemory.\n *\n * The following family of three classes will exactly root a stack location.\n * Incorrect usage of these classes will result in a compile error in almost\n * all cases. Therefore, it is very hard to be incorrectly rooted if you use\n * these classes exclusively. These classes are all templated on the type T of\n * the value being rooted.\n *\n * - Rooted<T> declares a variable of type T, whose value is always rooted.\n *   Rooted<T> may be automatically coerced to a Handle<T>, below. Rooted<T>\n *   should be used whenever a local variable's value may be held live across a\n *   call which can trigger a GC.\n *\n * - Handle<T> is a const reference to a Rooted<T>. Functions which take GC\n *   things or values as arguments and need to root those arguments should\n *   generally use handles for those arguments and avoid any explicit rooting.\n *   This has two benefits. First, when several such functions call each other\n *   then redundant rooting of multiple copies of the GC thing can be avoided.\n *   Second, if the caller does not pass a rooted value a compile error will be\n *   generated, which is quicker and easier to fix than when relying on a\n *   separate rooting analysis.\n *\n * - MutableHandle<T> is a non-const reference to Rooted<T>. It is used in the\n *   same way as Handle<T> and includes a |set(const T &v)| method to allow\n *   updating the value of the referenced Rooted<T>. A MutableHandle<T> can be\n *   created from a Rooted<T> by using |Rooted<T>::operator&()|.\n *\n * In some cases the small performance overhead of exact rooting (measured to\n * be a few nanoseconds on desktop) is too much. In these cases, try the\n * following:\n *\n * - Move all Rooted<T> above inner loops: this allows you to re-use the root\n *   on each iteration of the loop.\n *\n * - Pass Handle<T> through your hot call stack to avoid re-rooting costs at\n *   every invocation.\n *\n * The following diagram explains the list of supported, implicit type\n * conversions between classes of this family:\n *\n *  Rooted<T> ----> Handle<T>\n *     |               ^\n *     |               |\n *     |               |\n *     +---> MutableHandle<T>\n *     (via &)\n *\n * All of these types have an implicit conversion to raw pointers.\n */\n\nnamespace js {\n\nclass Module;\nclass ScriptSourceObject;\n\ntemplate <typename T>\nstruct GCMethods {};\n\ntemplate <typename T>\nclass RootedBase {};\n\ntemplate <typename T>\nclass HandleBase {};\n\ntemplate <typename T>\nclass MutableHandleBase {};\n\ntemplate <typename T>\nclass HeapBase {};\n\n/*\n * js::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for js::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(js::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n *\n * This is the SpiderMonkey internal variant. js::NullPtr should be used in\n * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API\n * symbols.\n */\nstruct NullPtr\n{\n    static void * const constNullValue;\n};\n\nnamespace gc {\nstruct Cell;\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> class Rooted;\n\ntemplate <typename T> class Handle;\ntemplate <typename T> class MutableHandle;\n\n/* This is exposing internal state of the GC for inlining purposes. */\nJS_FRIEND_API(bool) isGCEnabled();\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\nextern void\nCheckStackRoots(JSContext *cx);\n#endif\n\n/*\n * JS::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for JS::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(JS::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n */\nstruct JS_PUBLIC_API(NullPtr)\n{\n    static void * const constNullValue;\n};\n\n/*\n * The Heap<T> class is a C/C++ heap-stored reference to a JS GC thing.  All\n * members of heap classes that refer to GC thing should use Heap<T> (or\n * possibly TenuredHeap<T>, described below).\n *\n * Heap<T> wraps the complex mechanisms required to ensure GC safety for the\n * contained reference into a C++ class that behaves similarly to a normal\n * pointer.\n *\n * GC references stored on the C/C++ stack must use Rooted/Handle/MutableHandle\n * instead.\n *\n * Requirements for type T:\n *  - Must be one of: Value, jsid, JSObject*, JSString*, JSScript*\n */\ntemplate <typename T>\nclass Heap : public js::HeapBase<T>\n{\n  public:\n    Heap() {\n        static_assert(sizeof(T) == sizeof(Heap<T>),\n                      \"Heap<T> must be binary compatible with T.\");\n        init(js::GCMethods<T>::initial());\n    }\n    explicit Heap(T p) { init(p); }\n    explicit Heap(const Heap<T> &p) { init(p.ptr); }\n\n    ~Heap() {\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            relocate();\n    }\n\n    bool operator==(const Heap<T> &other) { return ptr == other.ptr; }\n    bool operator!=(const Heap<T> &other) { return ptr != other.ptr; }\n\n    bool operator==(const T &other) const { return ptr == other; }\n    bool operator!=(const T &other) const { return ptr != other; }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    const T *address() const { return &ptr; }\n    const T &get() const { return ptr; }\n\n    T *unsafeGet() { return &ptr; }\n\n    Heap<T> &operator=(T p) {\n        set(p);\n        return *this;\n    }\n\n    void set(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (js::GCMethods<T>::needsPostBarrier(newPtr)) {\n            ptr = newPtr;\n            post();\n        } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {\n            relocate();  /* Called before overwriting ptr. */\n            ptr = newPtr;\n        } else {\n            ptr = newPtr;\n        }\n    }\n\n  private:\n    void init(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        ptr = newPtr;\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            post();\n    }\n\n    void post() {\n#ifdef JSGC_GENERATIONAL\n        JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));\n        js::GCMethods<T>::postBarrier(&ptr);\n#endif\n    }\n\n    void relocate() {\n#ifdef JSGC_GENERATIONAL\n        js::GCMethods<T>::relocate(&ptr);\n#endif\n    }\n\n    T ptr;\n};\n\n#ifdef DEBUG\n/*\n * For generational GC, assert that an object is in the tenured generation as\n * opposed to being in the nursery.\n */\nextern JS_FRIEND_API(void)\nAssertGCThingMustBeTenured(JSObject* obj);\n#else\ninline void\nAssertGCThingMustBeTenured(JSObject *obj) {}\n#endif\n\n/*\n * The TenuredHeap<T> class is similar to the Heap<T> class above in that it\n * encapsulates the GC concerns of an on-heap reference to a JS object. However,\n * it has two important differences:\n *\n *  1) Pointers which are statically known to only reference \"tenured\" objects\n *     can avoid the extra overhead of SpiderMonkey's write barriers.\n *\n *  2) Objects in the \"tenured\" heap have stronger alignment restrictions than\n *     those in the \"nursery\", so it is possible to store flags in the lower\n *     bits of pointers known to be tenured. TenuredHeap wraps a normal tagged\n *     pointer with a nice API for accessing the flag bits and adds various\n *     assertions to ensure that it is not mis-used.\n *\n * GC things are said to be \"tenured\" when they are located in the long-lived\n * heap: e.g. they have gained tenure as an object by surviving past at least\n * one GC. For performance, SpiderMonkey allocates some things which are known\n * to normally be long lived directly into the tenured generation; for example,\n * global objects. Additionally, SpiderMonkey does not visit individual objects\n * when deleting non-tenured objects, so object with finalizers are also always\n * tenured; for instance, this includes most DOM objects.\n *\n * The considerations to keep in mind when using a TenuredHeap<T> vs a normal\n * Heap<T> are:\n *\n *  - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing.\n *  - It is however valid for a Heap<T> to refer to a tenured thing.\n *  - It is not possible to store flag bits in a Heap<T>.\n */\ntemplate <typename T>\nclass TenuredHeap : public js::HeapBase<T>\n{\n  public:\n    TenuredHeap() : bits(0) {\n        static_assert(sizeof(T) == sizeof(TenuredHeap<T>),\n                      \"TenuredHeap<T> must be binary compatible with T.\");\n    }\n    explicit TenuredHeap(T p) : bits(0) { setPtr(p); }\n    explicit TenuredHeap(const TenuredHeap<T> &p) : bits(0) { setPtr(p.ptr); }\n\n    bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }\n    bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }\n\n    void setPtr(T newPtr) {\n        JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (newPtr)\n            AssertGCThingMustBeTenured(newPtr);\n        bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);\n    }\n\n    void setFlags(uintptr_t flagsToSet) {\n        JS_ASSERT((flagsToSet & ~flagsMask) == 0);\n        bits |= flagsToSet;\n    }\n\n    void unsetFlags(uintptr_t flagsToUnset) {\n        JS_ASSERT((flagsToUnset & ~flagsMask) == 0);\n        bits &= ~flagsToUnset;\n    }\n\n    bool hasFlag(uintptr_t flag) const {\n        JS_ASSERT((flag & ~flagsMask) == 0);\n        return (bits & flag) != 0;\n    }\n\n    T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }\n    uintptr_t getFlags() const { return bits & flagsMask; }\n\n    operator T() const { return getPtr(); }\n    T operator->() const { return getPtr(); }\n\n    TenuredHeap<T> &operator=(T p) {\n        setPtr(p);\n        return *this;\n    }\n\n    /*\n     * Set the pointer to a value which will cause a crash if it is\n     * dereferenced.\n     */\n    void setToCrashOnTouch() {\n        bits = (bits & flagsMask) | crashOnTouchPointer;\n    }\n\n    bool isSetToCrashOnTouch() {\n        return (bits & ~flagsMask) == crashOnTouchPointer;\n    }\n\n  private:\n    enum {\n        maskBits = 3,\n        flagsMask = (1 << maskBits) - 1,\n        crashOnTouchPointer = 1 << maskBits\n    };\n\n    uintptr_t bits;\n};\n\n/*\n * Reference to a T that has been rooted elsewhere. This is most useful\n * as a parameter type, which guarantees that the T lvalue is properly\n * rooted. See \"Move GC Stack Rooting\" above.\n *\n * If you want to add additional methods to Handle for a specific\n * specialization, define a HandleBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>\n{\n    friend class MutableHandle<T>;\n\n  public:\n    /* Creates a handle from a handle of a type convertible to T. */\n    template <typename S>\n    Handle(Handle<S> handle,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)\n    {\n        static_assert(sizeof(Handle<T>) == sizeof(T *),\n                      \"Handle must be binary compatible with T*.\");\n        ptr = reinterpret_cast<const T *>(handle.address());\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(js::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"js::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&js::NullPtr::constNullValue);\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(JS::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"JS::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&JS::NullPtr::constNullValue);\n    }\n\n    Handle(MutableHandle<T> handle) {\n        ptr = handle.address();\n    }\n\n    /*\n     * Take care when calling this method!\n     *\n     * This creates a Handle from the raw location of a T.\n     *\n     * It should be called only if the following conditions hold:\n     *\n     *  1) the location of the T is guaranteed to be marked (for some reason\n     *     other than being a Rooted), e.g., if it is guaranteed to be reachable\n     *     from an implicit root.\n     *\n     *  2) the contents of the location are immutable, or at least cannot change\n     *     for the lifetime of the handle, as its users may not expect its value\n     *     to change underneath them.\n     */\n    static Handle fromMarkedLocation(const T *p) {\n        Handle h;\n        h.ptr = p;\n        return h;\n    }\n\n    /*\n     * Construct a handle from an explicitly rooted location. This is the\n     * normal way to create a handle, and normally happens implicitly.\n     */\n    template <typename S>\n    inline\n    Handle(const Rooted<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    /* Construct a read only handle from a mutable handle. */\n    template <typename S>\n    inline\n    Handle(MutableHandle<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    const T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a Handle<T> to something that\n     * takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n    bool operator!=(const T &other) const { return *ptr != other; }\n    bool operator==(const T &other) const { return *ptr == other; }\n\n  private:\n    Handle() {}\n\n    const T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\ntypedef Handle<JSObject*>                   HandleObject;\ntypedef Handle<js::Module*>                 HandleModule;\ntypedef Handle<js::ScriptSourceObject *>    HandleScriptSource;\ntypedef Handle<JSFunction*>                 HandleFunction;\ntypedef Handle<JSScript*>                   HandleScript;\ntypedef Handle<JSString*>                   HandleString;\ntypedef Handle<jsid>                        HandleId;\ntypedef Handle<Value>                       HandleValue;\n\n/*\n * Similar to a handle, but the underlying storage can be changed. This is\n * useful for outparams.\n *\n * If you want to add additional methods to MutableHandle for a specific\n * specialization, define a MutableHandleBase<T> specialization containing\n * them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    inline MutableHandle(Rooted<T> *root);\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    /*\n     * This may be called only if the location of the T is guaranteed\n     * to be marked (for some reason other than being a Rooted),\n     * e.g., if it is guaranteed to be reachable from an implicit root.\n     *\n     * Create a MutableHandle from a raw location of a T.\n     */\n    static MutableHandle fromMarkedLocation(T *p) {\n        MutableHandle h;\n        h.ptr = p;\n        return h;\n    }\n\n    T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a MutableHandle<T> to something that takes\n     * a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    MutableHandle() {}\n\n    T *ptr;\n\n    template <typename S> void operator=(S v) MOZ_DELETE;\n    void operator=(MutableHandle other) MOZ_DELETE;\n};\n\ntypedef MutableHandle<JSObject*>   MutableHandleObject;\ntypedef MutableHandle<JSFunction*> MutableHandleFunction;\ntypedef MutableHandle<JSScript*>   MutableHandleScript;\ntypedef MutableHandle<JSString*>   MutableHandleString;\ntypedef MutableHandle<jsid>        MutableHandleId;\ntypedef MutableHandle<Value>       MutableHandleValue;\n\n#ifdef JSGC_GENERATIONAL\nJS_PUBLIC_API(void) HeapCellPostBarrier(js::gc::Cell **cellp);\nJS_PUBLIC_API(void) HeapCellRelocate(js::gc::Cell **cellp);\n#endif\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * InternalHandle is a handle to an internal pointer into a gcthing. Use\n * InternalHandle when you have a pointer to a direct field of a gcthing, or\n * when you need a parameter type for something that *may* be a pointer to a\n * direct field of a gcthing.\n */\ntemplate <typename T>\nclass InternalHandle {};\n\ntemplate <typename T>\nclass InternalHandle<T*>\n{\n    void * const *holder;\n    size_t offset;\n\n  public:\n    /*\n     * Create an InternalHandle using a Handle to the gcthing containing the\n     * field in question, and a pointer to the field.\n     */\n    template<typename H>\n    InternalHandle(const JS::Handle<H> &handle, T *field)\n      : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get()))\n    {}\n\n    /*\n     * Create an InternalHandle to a field within a Rooted<>.\n     */\n    template<typename R>\n    InternalHandle(const JS::Rooted<R> &root, T *field)\n      : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get()))\n    {}\n\n    T *get() const { return reinterpret_cast<T*>(uintptr_t(*holder) + offset); }\n\n    const T &operator*() const { return *get(); }\n    T *operator->() const { return get(); }\n\n    static InternalHandle<T*> fromMarkedLocation(T *fieldPtr) {\n        return InternalHandle(fieldPtr);\n    }\n\n  private:\n    /*\n     * Create an InternalHandle to something that is not a pointer to a\n     * gcthing, and so does not need to be rooted in the first place. Use these\n     * InternalHandles to pass pointers into functions that also need to accept\n     * regular InternalHandles to gcthing fields.\n     *\n     * Make this private to prevent accidental misuse; this is only for\n     * fromMarkedLocation().\n     */\n    InternalHandle(T *field)\n      : holder(reinterpret_cast<void * const *>(&js::NullPtr::constNullValue)),\n        offset(uintptr_t(field))\n    {}\n};\n\n/*\n * By default, pointers should use the inheritance hierarchy to find their\n * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that\n * Rooted<T> may be used without the class definition being available.\n */\ntemplate <typename T>\nstruct RootKind<T *>\n{\n    static ThingRootKind rootKind() { return T::rootKind(); }\n};\n\ntemplate <typename T>\nstruct GCMethods<T *>\n{\n    static T *initial() { return NULL; }\n    static ThingRootKind kind() { return RootKind<T *>::rootKind(); }\n    static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }\n    static bool needsPostBarrier(T *v) { return v; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(T **vp) {\n        JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n    static void relocate(T **vp) {\n        JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n#endif\n};\n\n#if defined(DEBUG)\n/* This helper allows us to assert that Rooted<T> is scoped within a request. */\nextern JS_PUBLIC_API(bool)\nIsInRequest(JSContext *cx);\n#endif\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Local variable of type T whose value is always rooted. This is typically\n * used for local variables, or for non-rooted values being passed to a\n * function that requires a handle, e.g. Foo(Root<T>(cx, x)).\n *\n * If you want to add additional methods to Rooted for a specific\n * specialization, define a RootedBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS Rooted : public js::RootedBase<T>\n{\n    /* Note: CX is a subclass of either ContextFriendFields or PerThreadDataFriendFields. */\n    template <typename CX>\n    void init(CX *cx) {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        js::ThingRootKind kind = js::GCMethods<T>::kind();\n        this->stack = &cx->thingGCRooters[kind];\n        this->prev = *stack;\n        *stack = reinterpret_cast<Rooted<void*>*>(this);\n\n        JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));\n#endif\n    }\n\n  public:\n    Rooted(JSContext *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(JSContext *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(js::ContextFriendFields *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::ContextFriendFields *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(JSRuntime *rt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    Rooted(JSRuntime *rt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    ~Rooted() {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));\n        *stack = prev;\n#endif\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<T> *previous() { return prev; }\n#endif\n\n    /*\n     * Important: Return a reference here so passing a Rooted<T> to\n     * something that takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    T &operator=(const Rooted &value) {\n        ptr = value;\n        return ptr;\n    }\n\n    void set(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<void*> **stack, *prev;\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /* Has the rooting analysis ever scanned this Rooted's stack location? */\n    friend void JS::CheckStackRoots(JSContext*);\n#endif\n\n#ifdef JSGC_ROOT_ANALYSIS\n    bool scanned;\n#endif\n\n    /*\n     * |ptr| must be the last field in Rooted because the analysis treats all\n     * Rooted as Rooted<void*> during the analysis. See bug 829372.\n     */\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    Rooted(const Rooted &) MOZ_DELETE;\n};\n\n#if !(defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING))\n// Defined in vm/String.h.\ntemplate <>\nclass Rooted<JSStableString *>;\n#endif\n\ntypedef Rooted<JSObject*>                   RootedObject;\ntypedef Rooted<js::Module*>                 RootedModule;\ntypedef Rooted<js::ScriptSourceObject *>    RootedScriptSource;\ntypedef Rooted<JSFunction*>                 RootedFunction;\ntypedef Rooted<JSScript*>                   RootedScript;\ntypedef Rooted<JSString*>                   RootedString;\ntypedef Rooted<jsid>                        RootedId;\ntypedef Rooted<JS::Value>                   RootedValue;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Mark a stack location as a root for the rooting analysis, without actually\n * rooting it in release builds. This should only be used for stack locations\n * of GC things that cannot be relocated by a garbage collection, and that\n * are definitely reachable via another path.\n */\nclass SkipRoot\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n\n    SkipRoot **stack, *prev;\n    const uint8_t *start;\n    const uint8_t *end;\n\n    template <typename CX, typename T>\n    void init(CX *cx, const T *ptr, size_t count) {\n        SkipRoot **head = &cx->skipGCRooters;\n        this->stack = head;\n        this->prev = *stack;\n        *stack = this;\n        this->start = (const uint8_t *) ptr;\n        this->end = this->start + (sizeof(T) * count);\n    }\n\n  public:\n    ~SkipRoot() {\n        JS_ASSERT(*stack == this);\n        *stack = prev;\n    }\n\n    SkipRoot *previous() { return prev; }\n\n    bool contains(const uint8_t *v, size_t len) {\n        return v >= start && v + len <= end;\n    }\n\n#else /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {}\n\n  public:\n\n#endif /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    SkipRoot(JSContext *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(ContextFriendFields::get(cx), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(ContextFriendFields *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(cx, ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(PerThreadData *pt, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(PerThreadDataFriendFields::get(pt), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Interface substitute for Rooted<T> which does not root the variable's memory. */\ntemplate <typename T>\nclass FakeRooted : public RootedBase<T>\n{\n  public:\n    template <typename CX>\n    FakeRooted(CX *cx\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename CX>\n    FakeRooted(CX *cx, T initial\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    FakeRooted(const FakeRooted &) MOZ_DELETE;\n};\n\n/* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */\ntemplate <typename T>\nclass FakeMutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    FakeMutableHandle(T *t) {\n        ptr = t;\n    }\n\n    FakeMutableHandle(FakeRooted<T> *root) {\n        ptr = root->address();\n    }\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    T *address() const { return ptr; }\n    T get() const { return *ptr; }\n\n    operator T() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    FakeMutableHandle() {}\n\n    T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\n/*\n * Types for a variable that either should or shouldn't be rooted, depending on\n * the template parameter Rooted. Used for implementing functions that can\n * operate on either rooted or unrooted data.\n *\n * The toHandle() and toMutableHandle() functions are for calling functions\n * which require handle types and are only called in the CanGC case. These\n * allow the calling code to type check.\n */\nenum AllowGC {\n    NoGC = 0,\n    CanGC = 1\n};\ntemplate <typename T, AllowGC allowGC>\nclass MaybeRooted\n{\n};\n\ntemplate <typename T> class MaybeRooted<T, CanGC>\n{\n  public:\n    typedef JS::Handle<T> HandleType;\n    typedef JS::Rooted<T> RootType;\n    typedef JS::MutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        return v;\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        return v;\n    }\n};\n\ntemplate <typename T> class MaybeRooted<T, NoGC>\n{\n  public:\n    typedef T HandleType;\n    typedef FakeRooted<T> RootType;\n    typedef FakeMutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n};\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(const Rooted<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(MutableHandle<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T>\ninline\nMutableHandle<T>::MutableHandle(Rooted<T> *root)\n{\n    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),\n                  \"MutableHandle must be binary compatible with T*.\");\n    ptr = root->address();\n}\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Hook for dynamic root analysis. Checks the native stack and poisons\n * references to GC things which have not been rooted.\n */\ninline void MaybeCheckStackRoots(JSContext *cx)\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    JS::CheckStackRoots(cx);\n#endif\n}\n\n/* Base class for automatic read-only object rooting during compilation. */\nclass CompilerRootNode\n{\n  protected:\n    CompilerRootNode(js::gc::Cell *ptr) : next(NULL), ptr_(ptr) {}\n\n  public:\n    void **address() { return (void **)&ptr_; }\n\n  public:\n    CompilerRootNode *next;\n\n  protected:\n    js::gc::Cell *ptr_;\n};\n\n}  /* namespace js */\n\n#endif  /* js_RootingAPI_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Utility.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Utility_h\n#define js_Utility_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/Scoped.h\"\n#include \"mozilla/TemplateLib.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef JS_OOM_DO_BACKTRACES\n#include <stdio.h>\n#include <execinfo.h>\n#endif\n\n#include \"jstypes.h\"\n\n/* The public JS engine namespace. */\nnamespace JS {}\n\n/* The mozilla-shared reusable template/utility namespace. */\nnamespace mozilla {}\n\n/* The private JS engine namespace. */\nnamespace js {}\n\n/*\n * Pattern used to overwrite freed memory. If you are accessing an object with\n * this pattern, you probably have a dangling pointer.\n */\n#define JS_FREE_PATTERN 0xDA\n\n#define JS_ASSERT(expr)           MOZ_ASSERT(expr)\n#define JS_ASSERT_IF(cond, expr)  MOZ_ASSERT_IF(cond, expr)\n#define JS_ALWAYS_TRUE(expr)      MOZ_ALWAYS_TRUE(expr)\n#define JS_ALWAYS_FALSE(expr)     MOZ_ALWAYS_FALSE(expr)\n\n#ifdef DEBUG\n# ifdef JS_THREADSAFE\n#  define JS_THREADSAFE_ASSERT(expr) JS_ASSERT(expr)\n# else\n#  define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n# endif\n#else\n# define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n#endif\n\n#if defined(DEBUG)\n# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)\n#elif defined(JS_CRASH_DIAGNOSTICS)\n# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)\n#else\n# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)\n#endif\n\n#define JS_STATIC_ASSERT(cond)           static_assert(cond, \"JS_STATIC_ASSERT\")\n#define JS_STATIC_ASSERT_IF(cond, expr)  MOZ_STATIC_ASSERT_IF(cond, expr, \"JS_STATIC_ASSERT_IF\")\n\nextern MOZ_NORETURN JS_PUBLIC_API(void)\nJS_Assert(const char *s, const char *file, int ln);\n\n/*\n * Abort the process in a non-graceful manner. This will cause a core file,\n * call to the debugger or other moral equivalent as well as causing the\n * entire process to stop.\n */\nextern JS_PUBLIC_API(void) JS_Abort(void);\n\n/*\n * Custom allocator support for SpiderMonkey\n */\n#if defined JS_USE_CUSTOM_ALLOCATOR\n# include \"jscustomallocator.h\"\n#else\n# ifdef DEBUG\n/*\n * In order to test OOM conditions, when the testing function\n * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th\n * allocation from now.\n */\nextern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtins/TestingFunctions.cpp */\nextern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */\n\n#ifdef JS_OOM_DO_BACKTRACES\n#define JS_OOM_BACKTRACE_SIZE 32\nstatic JS_ALWAYS_INLINE void\nPrintBacktrace()\n{\n    void* OOM_trace[JS_OOM_BACKTRACE_SIZE];\n    char** OOM_traceSymbols = NULL;\n    int32_t OOM_traceSize = 0;\n    int32_t OOM_traceIdx = 0;\n    OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE);\n    OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize);\n\n    if (!OOM_traceSymbols)\n        return;\n\n    for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) {\n        fprintf(stderr, \"#%d %s\\n\", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]);\n    }\n\n    free(OOM_traceSymbols);\n}\n\n#define JS_OOM_EMIT_BACKTRACE() \\\n    do {\\\n        fprintf(stderr, \"Forcing artificial memory allocation function failure:\\n\");\\\n\tPrintBacktrace();\\\n    } while (0)\n# else\n#  define JS_OOM_EMIT_BACKTRACE() do {} while(0)\n#endif /* JS_OOM_DO_BACKTRACES */\n\n#  define JS_OOM_POSSIBLY_FAIL() \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            js_ReportOutOfMemory(cx);\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n# else\n#  define JS_OOM_POSSIBLY_FAIL() do {} while(0)\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)\n# endif /* DEBUG */\n\nstatic JS_INLINE void* js_malloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return malloc(bytes);\n}\n\nstatic JS_INLINE void* js_calloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(bytes, 1);\n}\n\nstatic JS_INLINE void* js_calloc(size_t nmemb, size_t size)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(nmemb, size);\n}\n\nstatic JS_INLINE void* js_realloc(void* p, size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return realloc(p, bytes);\n}\n\nstatic JS_INLINE void js_free(void* p)\n{\n    free(p);\n}\n#endif/* JS_USE_CUSTOM_ALLOCATOR */\n\n/*\n * JS_ROTATE_LEFT32\n *\n * There is no rotate operation in the C Language so the construct (a << 4) |\n * (a >> 28) is used instead. Most compilers convert this to a rotate\n * instruction but some versions of MSVC don't without a little help.  To get\n * MSVC to generate a rotate instruction, we have to use the _rotl intrinsic\n * and use a pragma to make _rotl inline.\n *\n * MSVC in VS2005 will do an inline rotate instruction on the above construct.\n */\n#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \\\n    defined(_M_X64))\n#include <stdlib.h>\n#pragma intrinsic(_rotl)\n#define JS_ROTATE_LEFT32(a, bits) _rotl(a, bits)\n#else\n#define JS_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))\n#endif\n\n#include <new>\n\n/*\n * Low-level memory management in SpiderMonkey:\n *\n *  ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these\n *     to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's\n *     these symbols.\n *\n *  ** Do not use the builtin C++ operator new and delete: these throw on\n *     error and we cannot override them not to.\n *\n * Allocation:\n *\n * - If the lifetime of the allocation is tied to the lifetime of a GC-thing\n *   (that is, finalizing the GC-thing will free the allocation), call one of\n *   the following functions:\n *\n *     JSContext::{malloc_,realloc_,calloc_,new_}\n *     JSRuntime::{malloc_,realloc_,calloc_,new_}\n *\n *   These functions accumulate the number of bytes allocated which is used as\n *   part of the GC-triggering heuristic.\n *\n *   The difference between the JSContext and JSRuntime versions is that the\n *   cx version reports an out-of-memory error on OOM. (This follows from the\n *   general SpiderMonkey idiom that a JSContext-taking function reports its\n *   own errors.)\n *\n * - Otherwise, use js_malloc/js_realloc/js_calloc/js_free/js_new\n *\n * Deallocation:\n *\n * - Ordinarily, use js_free/js_delete.\n *\n * - For deallocations during GC finalization, use one of the following\n *   operations on the FreeOp provided to the finalizer:\n *\n *     FreeOp::{free_,delete_}\n *\n *   The advantage of these operations is that the memory is batched and freed\n *   on another thread.\n */\n\n#define JS_NEW_BODY(allocator, t, parms)                                       \\\n    void *memory = allocator(sizeof(t));                                       \\\n    return memory ? new(memory) t parms : NULL;\n\n/*\n * Given a class which should provide 'new' methods, add\n * JS_DECLARE_NEW_METHODS (see JSContext for a usage example). This\n * adds news with up to 12 parameters. Add more versions of new below if\n * you need more than 12 parameters.\n *\n * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,\n * or the build will break.\n */\n#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\\\n    template <class T>\\\n    QUALIFIERS T *NEWNAME() {\\\n        JS_NEW_BODY(ALLOCATOR, T, ())\\\n    }\\\n\\\n    template <class T, class P1>\\\n    QUALIFIERS T *NEWNAME(P1 p1) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1))\\\n    }\\\n\\\n    template <class T, class P1, class P2>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\\\n    }\\\n\nJS_DECLARE_NEW_METHODS(js_new, js_malloc, static JS_ALWAYS_INLINE)\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE void\njs_delete(T *p)\n{\n    if (p) {\n        p->~T();\n        js_free(p);\n    }\n}\n\ntemplate<class T>\nstatic JS_ALWAYS_INLINE void\njs_delete_poison(T *p)\n{\n    if (p) {\n        p->~T();\n        memset(p, 0x3B, sizeof(T));\n        js_free(p);\n    }\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc()\n{\n    return (T *)js_malloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc()\n{\n    return (T *)js_calloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_malloc(numElems * sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_calloc(numElems * sizeof(T));\n}\n\nnamespace js {\n\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return NULL; }\n    static void release(T* ptr) { js_free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits)\n\ntemplate <typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { js_delete(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits)\n\ntemplate <typename T>\nstruct ScopedReleasePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { if (ptr) ptr->release(); }\n};\nSCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits)\n\n} /* namespace js */\n\nnamespace js {\n\n/* Integral types for all hash functions. */\ntypedef uint32_t HashNumber;\nconst unsigned HashNumberSizeBits = 32;\n\nnamespace detail {\n\n/*\n * Given a raw hash code, h, return a number that can be used to select a hash\n * bucket.\n *\n * This function aims to produce as uniform an output distribution as possible,\n * especially in the most significant (leftmost) bits, even though the input\n * distribution may be highly nonrandom, given the constraints that this must\n * be deterministic and quick to compute.\n *\n * Since the leftmost bits of the result are best, the hash bucket index is\n * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent\n * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask.\n *\n * FIXME: OrderedHashTable uses a bit-mask; see bug 775896.\n */\ninline HashNumber\nScrambleHashCode(HashNumber h)\n{\n    /*\n     * Simply returning h would not cause any hash tables to produce wrong\n     * answers. But it can produce pathologically bad performance: The caller\n     * right-shifts the result, keeping only the highest bits. The high bits of\n     * hash codes are very often completely entropy-free. (So are the lowest\n     * bits.)\n     *\n     * So we use Fibonacci hashing, as described in Knuth, The Art of Computer\n     * Programming, 6.4. This mixes all the bits of the input hash code h.\n     * \n     * The value of goldenRatio is taken from the hex\n     * expansion of the golden ratio, which starts 1.9E3779B9....\n     * This value is especially good if values with consecutive hash codes\n     * are stored in a hash table; see Knuth for details.\n     */\n    static const HashNumber goldenRatio = 0x9E3779B9U;\n    return h * goldenRatio;\n}\n\n} /* namespace detail */\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Methods for poisoning GC heap pointer words and checking for poisoned words.\n * These are in this file for use in Value methods and so forth.\n *\n * If the moving GC hazard analysis is in use and detects a non-rooted stack\n * pointer to a GC thing, one byte of that pointer is poisoned to refer to an\n * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the\n * pointer is overwritten, to reduce the likelihood of accidentally changing\n * a live integer value.\n */\n\ninline void PoisonPtr(void *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint8_t *ptr = (uint8_t *) v + 3;\n    *ptr = JS_FREE_PATTERN;\n#endif\n}\n\ntemplate <typename T>\ninline bool IsPoisonedPtr(T *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint32_t mask = uintptr_t(v) & 0xff000000;\n    return mask == uint32_t(JS_FREE_PATTERN << 24);\n#else\n    return false;\n#endif\n}\n\n}\n\n/* sixgill annotation defines */\n#ifndef HAVE_STATIC_ANNOTATIONS\n# define HAVE_STATIC_ANNOTATIONS\n# ifdef XGILL_PLUGIN\n#  define STATIC_PRECONDITION(COND)         __attribute__((precondition(#COND)))\n#  define STATIC_PRECONDITION_ASSUME(COND)  __attribute__((precondition_assume(#COND)))\n#  define STATIC_POSTCONDITION(COND)        __attribute__((postcondition(#COND)))\n#  define STATIC_POSTCONDITION_ASSUME(COND) __attribute__((postcondition_assume(#COND)))\n#  define STATIC_INVARIANT(COND)            __attribute__((invariant(#COND)))\n#  define STATIC_INVARIANT_ASSUME(COND)     __attribute__((invariant_assume(#COND)))\n#  define STATIC_PASTE2(X,Y) X ## Y\n#  define STATIC_PASTE1(X,Y) STATIC_PASTE2(X,Y)\n#  define STATIC_ASSERT(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assert_static(#COND), unused))    \\\n    int STATIC_PASTE1(assert_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSUME(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assume_static(#COND), unused))    \\\n    int STATIC_PASTE1(assume_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)                       \\\n  JS_BEGIN_MACRO                                            \\\n    __attribute__((assert_static_runtime(#COND), unused))   \\\n    int STATIC_PASTE1(assert_static_runtime_, __COUNTER__); \\\n  JS_END_MACRO\n# else /* XGILL_PLUGIN */\n#  define STATIC_PRECONDITION(COND)          /* nothing */\n#  define STATIC_PRECONDITION_ASSUME(COND)   /* nothing */\n#  define STATIC_POSTCONDITION(COND)         /* nothing */\n#  define STATIC_POSTCONDITION_ASSUME(COND)  /* nothing */\n#  define STATIC_INVARIANT(COND)             /* nothing */\n#  define STATIC_INVARIANT_ASSUME(COND)      /* nothing */\n#  define STATIC_ASSERT(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSUME(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)  JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n# endif /* XGILL_PLUGIN */\n# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())\n#endif /* HAVE_STATIC_ANNOTATIONS */\n\n#endif /* js_Utility_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Value.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Value implementation. */\n\n#ifndef js_Value_h\n#define js_Value_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/Likely.h\"\n\n#include <limits> /* for std::numeric_limits */\n\n#include \"js/Anchor.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n\nnamespace JS { class Value; }\n\n/* JS::Value can store a full int32_t. */\n#define JSVAL_INT_BITS          32\n#define JSVAL_INT_MIN           ((int32_t)0x80000000)\n#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)\n\n/*\n * Try to get jsvals 64-bit aligned. We could almost assert that all values are\n * aligned, but MSVC and GCC occasionally break alignment.\n */\n#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__)\n# define JSVAL_ALIGNMENT        __attribute__((aligned (8)))\n#elif defined(_MSC_VER)\n  /*\n   * Structs can be aligned with MSVC, but not if they are used as parameters,\n   * so we just don't try to align.\n   */\n# define JSVAL_ALIGNMENT\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n# define JSVAL_ALIGNMENT\n#elif defined(__HP_cc) || defined(__HP_aCC)\n# define JSVAL_ALIGNMENT\n#endif\n\n#if JS_BITS_PER_WORD == 64\n# define JSVAL_TAG_SHIFT 47\n#endif\n\n/*\n * We try to use enums so that printing a jsval_layout in the debugger shows\n * nice symbolic type tags, however we can only do this when we can force the\n * underlying type of the enum to be the desired size.\n */\n#if !defined(__SUNPRO_CC) && !defined(__xlC__)\n\n#if defined(_MSC_VER)\n# define JS_ENUM_HEADER(id, type)              enum id : type\n# define JS_ENUM_FOOTER(id)\n#else\n# define JS_ENUM_HEADER(id, type)              enum id\n# define JS_ENUM_FOOTER(id)                    __attribute__((packed))\n#endif\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueType, uint8_t)\n{\n    JSVAL_TYPE_DOUBLE              = 0x00,\n    JSVAL_TYPE_INT32               = 0x01,\n    JSVAL_TYPE_UNDEFINED           = 0x02,\n    JSVAL_TYPE_BOOLEAN             = 0x03,\n    JSVAL_TYPE_MAGIC               = 0x04,\n    JSVAL_TYPE_STRING              = 0x05,\n    JSVAL_TYPE_NULL                = 0x06,\n    JSVAL_TYPE_OBJECT              = 0x07,\n\n    /* These never appear in a jsval; they are only provided as an out-of-band value. */\n    JSVAL_TYPE_UNKNOWN             = 0x20,\n    JSVAL_TYPE_MISSING             = 0x21\n} JS_ENUM_FOOTER(JSValueType);\n\nJS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n\n#if JS_BITS_PER_WORD == 32\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_CLEAR                = 0xFFFFFF80,\n    JSVAL_TAG_INT32                = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n\n#elif JS_BITS_PER_WORD == 64\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_MAX_DOUBLE           = 0x1FFF0,\n    JSVAL_TAG_INT32                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32_t));\n\nJS_ENUM_HEADER(JSValueShiftedTag, uint64_t)\n{\n    JSVAL_SHIFTED_TAG_MAX_DOUBLE   = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),\n    JSVAL_SHIFTED_TAG_INT32        = (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_UNDEFINED    = (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_STRING       = (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_BOOLEAN      = (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_MAGIC        = (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_NULL         = (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_OBJECT       = (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n} JS_ENUM_FOOTER(JSValueShiftedTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t));\n\n#endif\n\n#else  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\ntypedef uint8_t JSValueType;\n#define JSVAL_TYPE_DOUBLE            ((uint8_t)0x00)\n#define JSVAL_TYPE_INT32             ((uint8_t)0x01)\n#define JSVAL_TYPE_UNDEFINED         ((uint8_t)0x02)\n#define JSVAL_TYPE_BOOLEAN           ((uint8_t)0x03)\n#define JSVAL_TYPE_MAGIC             ((uint8_t)0x04)\n#define JSVAL_TYPE_STRING            ((uint8_t)0x05)\n#define JSVAL_TYPE_NULL              ((uint8_t)0x06)\n#define JSVAL_TYPE_OBJECT            ((uint8_t)0x07)\n#define JSVAL_TYPE_UNKNOWN           ((uint8_t)0x20)\n\n#if JS_BITS_PER_WORD == 32\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_CLEAR              ((uint32_t)(0xFFFFFF80))\n#define JSVAL_TAG_INT32              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32))\n#define JSVAL_TAG_UNDEFINED          ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED))\n#define JSVAL_TAG_STRING             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING))\n#define JSVAL_TAG_BOOLEAN            ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN))\n#define JSVAL_TAG_MAGIC              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC))\n#define JSVAL_TAG_NULL               ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL))\n#define JSVAL_TAG_OBJECT             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT))\n\n#elif JS_BITS_PER_WORD == 64\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_MAX_DOUBLE         ((uint32_t)(0x1FFF0))\n#define JSVAL_TAG_INT32              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32)\n#define JSVAL_TAG_UNDEFINED          (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED)\n#define JSVAL_TAG_STRING             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING)\n#define JSVAL_TAG_BOOLEAN            (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN)\n#define JSVAL_TAG_MAGIC              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC)\n#define JSVAL_TAG_NULL               (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL)\n#define JSVAL_TAG_OBJECT             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT)\n\ntypedef uint64_t JSValueShiftedTag;\n#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF)\n#define JSVAL_SHIFTED_TAG_INT32      (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_UNDEFINED  (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_STRING     (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_BOOLEAN    (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_MAGIC      (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_NULL       (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_OBJECT     (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n\n#endif  /* JS_BITS_PER_WORD */\n#endif  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\n#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET        JSVAL_TYPE_NULL\n#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET          JSVAL_TYPE_OBJECT\n#define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET             JSVAL_TYPE_INT32\n#define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET        JSVAL_TYPE_MAGIC\n\n#if JS_BITS_PER_WORD == 32\n\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_CLEAR | (type)))\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#elif JS_BITS_PER_WORD == 64\n\n#define JSVAL_PAYLOAD_MASK           0x00007FFFFFFFFFFFLL\n#define JSVAL_TAG_MASK               0xFFFF800000000000LL\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))\n#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET  JSVAL_SHIFTED_TAG_NULL\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET    JSVAL_SHIFTED_TAG_OBJECT\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET       JSVAL_SHIFTED_TAG_UNDEFINED\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET      JSVAL_SHIFTED_TAG_STRING\n\n#endif /* JS_BITS_PER_WORD */\n\ntypedef enum JSWhyMagic\n{\n    JS_ELEMENTS_HOLE,            /* a hole in a native object's elements */\n    JS_NATIVE_ENUMERATE,         /* indicates that a custom enumerate hook forwarded\n                                  * to JS_EnumerateState, which really means the object can be\n                                  * enumerated like a native object. */\n    JS_NO_ITER_VALUE,            /* there is not a pending iterator value */\n    JS_GENERATOR_CLOSING,        /* exception value thrown when closing a generator */\n    JS_NO_CONSTANT,              /* compiler sentinel value */\n    JS_THIS_POISON,              /* used in debug builds to catch tracing errors */\n    JS_ARG_POISON,               /* used in debug builds to catch tracing errors */\n    JS_SERIALIZE_NO_NODE,        /* an empty subnode in the AST serializer */\n    JS_LAZY_ARGUMENTS,           /* lazy arguments value on the stack */\n    JS_OPTIMIZED_ARGUMENTS,      /* optimized-away 'arguments' value */\n    JS_IS_CONSTRUCTING,          /* magic value passed to natives to indicate construction */\n    JS_OVERWRITTEN_CALLEE,       /* arguments.callee has been overwritten */\n    JS_FORWARD_TO_CALL_OBJECT,   /* args object element stored in call object */\n    JS_BLOCK_NEEDS_CLONE,        /* value of static block object slot */\n    JS_HASH_KEY_EMPTY,           /* see class js::HashableValue */\n    JS_ION_ERROR,                /* error while running Ion code */\n    JS_ION_BAILOUT,              /* status code to signal EnterIon will OSR into Interpret */\n    JS_GENERIC_MAGIC             /* for local use */\n} JSWhyMagic;\n\n#if defined(IS_LITTLE_ENDIAN)\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n        JSValueTag tag;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n#if !defined(_WIN64)\n    /* MSVC does not pack these correctly :-( */\n    struct {\n        uint64_t           payload47 : 47;\n        JSValueTag         tag : 17;\n    } debugView;\n#endif\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif  /* JS_BITS_PER_WORD */\n#else   /* defined(IS_LITTLE_ENDIAN) */\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag tag;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag         tag : 17;\n        uint64_t           payload47 : 47;\n    } debugView;\n    struct {\n        uint32_t           padding;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif /* JS_BITS_PER_WORD */\n#endif  /* defined(IS_LITTLE_ENDIAN) */\n\nJS_STATIC_ASSERT(sizeof(jsval_layout) == 8);\n\n#if JS_BITS_PER_WORD == 32\n\n/*\n * N.B. GCC, in some but not all cases, chooses to emit signed comparison of\n * JSValueTag even though its underlying type has been forced to be uint32_t.\n * Thus, all comparisons should explicitly cast operands to uint32_t.\n */\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint32_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return l.s.payload.i32;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_INT32;\n    l.s.payload.i32 = i;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    JSValueTag tag = l.s.tag;\n    MOZ_ASSERT(tag != JSVAL_TAG_CLEAR);\n    return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    MOZ_ASSERT(str);\n    l.s.tag = JSVAL_TAG_STRING;\n    l.s.payload.str = str;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return l.s.payload.str;\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.payload.boo;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.s.tag = JSVAL_TAG_BOOLEAN;\n    l.s.payload.boo = b;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT);\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.payload.obj;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    MOZ_ASSERT(obj);\n    l.s.tag = JSVAL_TAG_OBJECT;\n    l.s.payload.obj = obj;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_NULL;\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    MOZ_ASSERT(((uint32_t)ptr & 1) == 0);\n    l.s.tag = (JSValueTag)0;\n    l.s.payload.ptr = ptr;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    /* gcc sometimes generates signed < without explicit casts. */\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_MAGIC;\n    l.s.payload.why = why;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag;\n    return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n    uint32_t type = l.s.tag & 0xF;\n    MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n    return (JSValueType)type;\n}\n\n#elif JS_BITS_PER_WORD == 64\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint64_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE);\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return (int32_t)l.asBits;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i32)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    uint64_t strBits = (uint64_t)str;\n    MOZ_ASSERT(str);\n    MOZ_ASSERT((strBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = strBits | JSVAL_SHIFTED_TAG_STRING;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK);\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (JSBool)l.asBits;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT);\n    return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT);\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (JSObject *)ptrBits;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    uint64_t objBits = (uint64_t)obj;\n    MOZ_ASSERT(obj);\n    MOZ_ASSERT((objBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = objBits | JSVAL_SHIFTED_TAG_OBJECT;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_NULL;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (void *)ptrBits;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l);\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l));\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    uint64_t ptrBits = (uint64_t)ptr;\n    MOZ_ASSERT((ptrBits & 1) == 0);\n    l.asBits = ptrBits >> 1;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0);\n    return (void *)(l.asBits << 1);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)why) | JSVAL_SHIFTED_TAG_MAGIC;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    uint64_t lbits = lhs.asBits, rbits = rhs.asBits;\n    return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) ||\n           (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n   uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF;\n   MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n   return (JSValueType)type;\n}\n\n#endif  /* JS_BITS_PER_WORD */\n\nstatic inline jsval_layout JSVAL_TO_IMPL(JS::Value v);\nstatic inline JS::Value IMPL_TO_JSVAL(jsval_layout l);\n\nnamespace JS {\n\n/**\n * Returns a generic quiet NaN value, with all payload bits set to zero.\n *\n * Among other properties, this NaN's bit pattern conforms to JS::Value's\n * bit pattern restrictions.\n */\nstatic MOZ_ALWAYS_INLINE double\nGenericNaN()\n{\n    return mozilla::SpecificNaN(0, 0x8000000000000ULL);\n}\n\nstatic inline double\nCanonicalizeNaN(double d)\n{\n    if (MOZ_UNLIKELY(mozilla::IsNaN(d)))\n        return GenericNaN();\n    return d;\n}\n\n/*\n * JS::Value is the interface for a single JavaScript Engine value.  A few\n * general notes on JS::Value:\n *\n * - JS::Value has setX() and isX() members for X in\n *\n *     { Int32, Double, String, Boolean, Undefined, Null, Object, Magic }\n *\n *   JS::Value also contains toX() for each of the non-singleton types.\n *\n * - Magic is a singleton type whose payload contains a JSWhyMagic \"reason\" for\n *   the magic value. By providing JSWhyMagic values when creating and checking\n *   for magic values, it is possible to assert, at runtime, that only magic\n *   values with the expected reason flow through a particular value. For\n *   example, if cx->exception has a magic value, the reason must be\n *   JS_GENERATOR_CLOSING.\n *\n * - The JS::Value operations are preferred.  The JSVAL_* operations remain for\n *   compatibility; they may be removed at some point.  These operations mostly\n *   provide similar functionality.  But there are a few key differences.  One\n *   is that JS::Value gives null a separate type. Thus\n *\n *           JSVAL_IS_OBJECT(v) === v.isObjectOrNull()\n *       !JSVAL_IS_PRIMITIVE(v) === v.isObject()\n *\n *   Also, to help prevent mistakenly boxing a nullable JSObject* as an object,\n *   Value::setObject takes a JSObject&. (Conversely, Value::asObject returns a\n *   JSObject&.)  A convenience member Value::setObjectOrNull is provided.\n *\n * - JSVAL_VOID is the same as the singleton value of the Undefined type.\n *\n * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on\n *   32-bit user code should avoid copying jsval/JS::Value as much as possible,\n *   preferring to pass by const Value &.\n */\nclass Value\n{\n  public:\n    /*\n     * N.B. the default constructor leaves Value unitialized. Adding a default\n     * constructor prevents Value from being stored in a union.\n     */\n\n    /*** Mutators ***/\n\n    void setNull() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;\n    }\n\n    void setUndefined() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;\n    }\n\n    void setInt32(int32_t i) {\n        data = INT32_TO_JSVAL_IMPL(i);\n    }\n\n    int32_t &getInt32Ref() {\n        MOZ_ASSERT(isInt32());\n        return data.s.payload.i32;\n    }\n\n    void setDouble(double d) {\n        data = DOUBLE_TO_JSVAL_IMPL(d);\n    }\n\n    double &getDoubleRef() {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    void setString(JSString *str) {\n        MOZ_ASSERT(!IsPoisonedPtr(str));\n        data = STRING_TO_JSVAL_IMPL(str);\n    }\n\n    void setString(const JS::Anchor<JSString *> &str) {\n        setString(str.get());\n    }\n\n    void setObject(JSObject &obj) {\n        MOZ_ASSERT(!IsPoisonedPtr(&obj));\n        data = OBJECT_TO_JSVAL_IMPL(&obj);\n    }\n\n    void setBoolean(bool b) {\n        data = BOOLEAN_TO_JSVAL_IMPL(b);\n    }\n\n    void setMagic(JSWhyMagic why) {\n        data = MAGIC_TO_JSVAL_IMPL(why);\n    }\n\n    bool setNumber(uint32_t ui) {\n        if (ui > JSVAL_INT_MAX) {\n            setDouble((double)ui);\n            return false;\n        } else {\n            setInt32((int32_t)ui);\n            return true;\n        }\n    }\n\n    bool setNumber(double d) {\n        int32_t i;\n        if (mozilla::DoubleIsInt32(d, &i)) {\n            setInt32(i);\n            return true;\n        }\n\n        setDouble(d);\n        return false;\n    }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n\n    void swap(Value &rhs) {\n        uint64_t tmp = rhs.data.asBits;\n        rhs.data.asBits = data.asBits;\n        data.asBits = tmp;\n    }\n\n    /*** Value type queries ***/\n\n    bool isUndefined() const {\n        return JSVAL_IS_UNDEFINED_IMPL(data);\n    }\n\n    bool isNull() const {\n        return JSVAL_IS_NULL_IMPL(data);\n    }\n\n    bool isNullOrUndefined() const {\n        return isNull() || isUndefined();\n    }\n\n    bool isInt32() const {\n        return JSVAL_IS_INT32_IMPL(data);\n    }\n\n    bool isInt32(int32_t i32) const {\n        return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);\n    }\n\n    bool isDouble() const {\n        return JSVAL_IS_DOUBLE_IMPL(data);\n    }\n\n    bool isNumber() const {\n        return JSVAL_IS_NUMBER_IMPL(data);\n    }\n\n    bool isString() const {\n        return JSVAL_IS_STRING_IMPL(data);\n    }\n\n    bool isObject() const {\n        return JSVAL_IS_OBJECT_IMPL(data);\n    }\n\n    bool isPrimitive() const {\n        return JSVAL_IS_PRIMITIVE_IMPL(data);\n    }\n\n    bool isObjectOrNull() const {\n        return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);\n    }\n\n    bool isGCThing() const {\n        return JSVAL_IS_GCTHING_IMPL(data);\n    }\n\n    bool isBoolean() const {\n        return JSVAL_IS_BOOLEAN_IMPL(data);\n    }\n\n    bool isTrue() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, true);\n    }\n\n    bool isFalse() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, false);\n    }\n\n    bool isMagic() const {\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMagic(JSWhyMagic why) const {\n        MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMarkable() const {\n        return JSVAL_IS_TRACEABLE_IMPL(data);\n    }\n\n    JSGCTraceKind gcKind() const {\n        MOZ_ASSERT(isMarkable());\n        return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));\n    }\n\n    JSWhyMagic whyMagic() const {\n        MOZ_ASSERT(isMagic());\n        return data.s.payload.why;\n    }\n\n    /*** Comparison ***/\n\n    bool operator==(const Value &rhs) const {\n        return data.asBits == rhs.data.asBits;\n    }\n\n    bool operator!=(const Value &rhs) const {\n        return data.asBits != rhs.data.asBits;\n    }\n\n    friend inline bool SameType(const Value &lhs, const Value &rhs);\n\n    /*** Extract the value's typed payload ***/\n\n    int32_t toInt32() const {\n        MOZ_ASSERT(isInt32());\n        return JSVAL_TO_INT32_IMPL(data);\n    }\n\n    double toDouble() const {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    double toNumber() const {\n        MOZ_ASSERT(isNumber());\n        return isDouble() ? toDouble() : double(toInt32());\n    }\n\n    JSString *toString() const {\n        MOZ_ASSERT(isString());\n        return JSVAL_TO_STRING_IMPL(data);\n    }\n\n    JSObject &toObject() const {\n        MOZ_ASSERT(isObject());\n        return *JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    JSObject *toObjectOrNull() const {\n        MOZ_ASSERT(isObjectOrNull());\n        return JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    void *toGCThing() const {\n        MOZ_ASSERT(isGCThing());\n        return JSVAL_TO_GCTHING_IMPL(data);\n    }\n\n    bool toBoolean() const {\n        MOZ_ASSERT(isBoolean());\n        return JSVAL_TO_BOOLEAN_IMPL(data);\n    }\n\n    uint32_t payloadAsRawUint32() const {\n        MOZ_ASSERT(!isDouble());\n        return data.s.payload.u32;\n    }\n\n    uint64_t asRawBits() const {\n        return data.asBits;\n    }\n\n    JSValueType extractNonDoubleType() const {\n        return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data);\n    }\n\n    /*\n     * Private API\n     *\n     * Private setters/getters allow the caller to read/write arbitrary types\n     * that fit in the 64-bit payload. It is the caller's responsibility, after\n     * storing to a value with setPrivateX to read only using getPrivateX.\n     * Privates values are given a type which ensures they are not marked.\n     */\n\n    void setPrivate(void *ptr) {\n        data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);\n    }\n\n    void *toPrivate() const {\n        MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));\n        return JSVAL_TO_PRIVATE_PTR_IMPL(data);\n    }\n\n    void setPrivateUint32(uint32_t ui) {\n        MOZ_ASSERT(uint32_t(int32_t(ui)) == ui);\n        setInt32(int32_t(ui));\n    }\n\n    uint32_t toPrivateUint32() const {\n        return uint32_t(toInt32());\n    }\n\n    /*\n     * An unmarked value is just a void* cast as a Value. Thus, the Value is\n     * not safe for GC and must not be marked. This API avoids raw casts\n     * and the ensuing strict-aliasing warnings.\n     */\n\n    void setUnmarkedPtr(void *ptr) {\n        data.asPtr = ptr;\n    }\n\n    void *toUnmarkedPtr() const {\n        return data.asPtr;\n    }\n\n    const size_t *payloadWord() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.word;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asWord;\n#endif\n    }\n\n    const uintptr_t *payloadUIntPtr() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.uintptr;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asUIntPtr;\n#endif\n    }\n\n#if !defined(_MSC_VER) && !defined(__sparc)\n  // Value must be POD so that MSVC will pass it by value and not in memory\n  // (bug 689101); the same is true for SPARC as well (bug 737344).  More\n  // precisely, we don't want Value return values compiled as out params.\n  private:\n#endif\n\n    jsval_layout data;\n\n  private:\n    void staticAssertions() {\n        JS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n        JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n        JS_STATIC_ASSERT(sizeof(JSBool) == 4);\n        JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4);\n        JS_STATIC_ASSERT(sizeof(Value) == 8);\n    }\n\n    friend jsval_layout (::JSVAL_TO_IMPL)(Value);\n    friend Value (::IMPL_TO_JSVAL)(jsval_layout l);\n};\n\ninline bool\nIsPoisonedValue(const Value &v)\n{\n    if (v.isString())\n        return IsPoisonedPtr(v.toString());\n    if (v.isObject())\n        return IsPoisonedPtr(&v.toObject());\n    return false;\n}\n\n/************************************************************************/\n\nstatic inline Value\nNullValue()\n{\n    Value v;\n    v.setNull();\n    return v;\n}\n\nstatic inline Value\nUndefinedValue()\n{\n    Value v;\n    v.setUndefined();\n    return v;\n}\n\nstatic inline Value\nInt32Value(int32_t i32)\n{\n    Value v;\n    v.setInt32(i32);\n    return v;\n}\n\nstatic inline Value\nDoubleValue(double dbl)\n{\n    Value v;\n    v.setDouble(dbl);\n    return v;\n}\n\nstatic inline Value\nStringValue(JSString *str)\n{\n    Value v;\n    v.setString(str);\n    return v;\n}\n\nstatic inline Value\nBooleanValue(bool boo)\n{\n    Value v;\n    v.setBoolean(boo);\n    return v;\n}\n\nstatic inline Value\nObjectValue(JSObject &obj)\n{\n    Value v;\n    v.setObject(obj);\n    return v;\n}\n\nstatic inline Value\nObjectValueCrashOnTouch()\n{\n    Value v;\n    v.setObject(*reinterpret_cast<JSObject *>(0x42));\n    return v;\n}\n\nstatic inline Value\nMagicValue(JSWhyMagic why)\n{\n    Value v;\n    v.setMagic(why);\n    return v;\n}\n\nstatic inline Value\nNumberValue(float f)\n{\n    Value v;\n    v.setNumber(f);\n    return v;\n}\n\nstatic inline Value\nNumberValue(double dbl)\n{\n    Value v;\n    v.setNumber(dbl);\n    return v;\n}\n\nstatic inline Value\nNumberValue(int8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int32_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint32_t i)\n{\n    Value v;\n    v.setNumber(i);\n    return v;\n}\n\nnamespace detail {\n\ntemplate <bool Signed>\nclass MakeNumberValue\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (JSVAL_INT_MIN <= t && t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\ntemplate <>\nclass MakeNumberValue<false>\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\n} // namespace detail\n\ntemplate <typename T>\nstatic inline Value\nNumberValue(const T t)\n{\n    MOZ_ASSERT(T(double(t)) == t, \"value creation would be lossy\");\n    return detail::MakeNumberValue<std::numeric_limits<T>::is_signed>::create(t);\n}\n\nstatic inline Value\nObjectOrNullValue(JSObject *obj)\n{\n    Value v;\n    v.setObjectOrNull(obj);\n    return v;\n}\n\nstatic inline Value\nPrivateValue(void *ptr)\n{\n    Value v;\n    v.setPrivate(ptr);\n    return v;\n}\n\nstatic inline Value\nPrivateUint32Value(uint32_t ui)\n{\n    Value v;\n    v.setPrivateUint32(ui);\n    return v;\n}\n\ninline bool\nSameType(const Value &lhs, const Value &rhs)\n{\n    return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);\n}\n\n} // namespace JS\n\n/************************************************************************/\n\n#ifdef JSGC_GENERATIONAL\nnamespace JS {\nJS_PUBLIC_API(void) HeapValuePostBarrier(Value *valuep);\nJS_PUBLIC_API(void) HeapValueRelocate(Value *valuep);\n}\n#endif\n\nnamespace js {\n\ntemplate <> struct GCMethods<const JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n};\n\ntemplate <> struct GCMethods<JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n    static bool needsPostBarrier(const JS::Value &v) { return v.isMarkable(); }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }\n    static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }\n#endif\n};\n\ntemplate <class Outer> class UnbarrieredMutableValueOperations;\ntemplate <class Outer> class MutableValueOperations;\n\n/*\n * A class designed for CRTP use in implementing the non-mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * ValueOperations<Outer> with a visible extract() method returning the\n * const Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass ValueOperations\n{\n    friend class UnbarrieredMutableValueOperations<Outer>;\n    friend class MutableValueOperations<Outer>;\n\n    const JS::Value * value() const { return static_cast<const Outer*>(this)->extract(); }\n\n  public:\n    bool isUndefined() const { return value()->isUndefined(); }\n    bool isNull() const { return value()->isNull(); }\n    bool isBoolean() const { return value()->isBoolean(); }\n    bool isTrue() const { return value()->isTrue(); }\n    bool isFalse() const { return value()->isFalse(); }\n    bool isNumber() const { return value()->isNumber(); }\n    bool isInt32() const { return value()->isInt32(); }\n    bool isDouble() const { return value()->isDouble(); }\n    bool isString() const { return value()->isString(); }\n    bool isObject() const { return value()->isObject(); }\n    bool isMagic() const { return value()->isMagic(); }\n    bool isMagic(JSWhyMagic why) const { return value()->isMagic(why); }\n    bool isMarkable() const { return value()->isMarkable(); }\n    bool isPrimitive() const { return value()->isPrimitive(); }\n    bool isGCThing() const { return value()->isGCThing(); }\n\n    bool isNullOrUndefined() const { return value()->isNullOrUndefined(); }\n    bool isObjectOrNull() const { return value()->isObjectOrNull(); }\n\n    bool toBoolean() const { return value()->toBoolean(); }\n    double toNumber() const { return value()->toNumber(); }\n    int32_t toInt32() const { return value()->toInt32(); }\n    double toDouble() const { return value()->toDouble(); }\n    JSString *toString() const { return value()->toString(); }\n    JSObject &toObject() const { return value()->toObject(); }\n    JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); }\n    void *toGCThing() const { return value()->toGCThing(); }\n\n    JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); }\n    uint32_t toPrivateUint32() const { return value()->toPrivateUint32(); }\n\n    JSWhyMagic whyMagic() const { return value()->whyMagic(); }\n};\n\n/*\n * A class designed for CRTP use in implementing the mutating parts of the Value\n * interface in Value-like classes that don't need post barriers.  Outer must be\n * a class inheriting UnbarrieredMutableValueOperations<Outer> with visible\n * extractMutable() and extract() methods returning the const Value* and Value*\n * abstracted by Outer.\n */\ntemplate <class Outer>\nclass UnbarrieredMutableValueOperations : public ValueOperations<Outer>\n{\n    friend class MutableValueOperations<Outer>;\n    JS::Value * value() { return static_cast<Outer*>(this)->extractMutable(); }\n\n  public:\n    void setNull() { value()->setNull(); }\n    void setUndefined() { value()->setUndefined(); }\n    void setInt32(int32_t i) { value()->setInt32(i); }\n    void setDouble(double d) { value()->setDouble(d); }\n    void setBoolean(bool b) { value()->setBoolean(b); }\n    void setMagic(JSWhyMagic why) { value()->setMagic(why); }\n    bool setNumber(uint32_t ui) { return value()->setNumber(ui); }\n    bool setNumber(double d) { return value()->setNumber(d); }\n};\n\n/*\n * A class designed for CRTP use in implementing all the mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * MutableValueOperations<Outer> with visible extractMutable() and extract()\n * methods returning the const Value* and Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass MutableValueOperations : public UnbarrieredMutableValueOperations<Outer>\n{\n  public:\n    void setString(JSString *str) { this->value()->setString(str); }\n    void setString(const JS::Anchor<JSString *> &str) { this->value()->setString(str); }\n    void setObject(JSObject &obj) { this->value()->setObject(obj); }\n    void setObjectOrNull(JSObject *arg) { this->value()->setObjectOrNull(arg); }\n};\n\n/*\n * Augment the generic Heap<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass HeapBase<JS::Value> : public UnbarrieredMutableValueOperations<JS::Heap<JS::Value> >\n{\n    typedef JS::Heap<JS::Value> Outer;\n\n    friend class ValueOperations<Outer>;\n    friend class UnbarrieredMutableValueOperations<Outer>;\n\n    const JS::Value * extract() const { return static_cast<const Outer*>(this)->address(); }\n    JS::Value * extractMutable() { return static_cast<Outer*>(this)->unsafeGet(); }\n\n    /*\n     * Setters that potentially change the value to a GC thing from a non-GC\n     * thing must call JS::Heap::set() to trigger the post barrier.\n     *\n     * Changing from a GC thing to a non-GC thing value will leave the heap\n     * value in the store buffer, but it will be ingored so this is not a\n     * problem.\n     */\n    void setBarriered(const JS::Value &v) {\n        static_cast<JS::Heap<JS::Value> *>(this)->set(v);\n    }\n\n  public:\n    void setString(JSString *str) { setBarriered(JS::StringValue(str)); }\n    void setString(const JS::Anchor<JSString *> &str) { setBarriered(JS::StringValue(str.get())); }\n    void setObject(JSObject &obj) { setBarriered(JS::ObjectValue(obj)); }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n};\n\n/*\n * Augment the generic Handle<T> interface when T = Value with type-querying\n * and value-extracting operations.\n */\ntemplate <>\nclass HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> >\n{\n    friend class ValueOperations<JS::Handle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Handle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic MutableHandle<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass MutableHandleBase<JS::Value> : public MutableValueOperations<JS::MutableHandle<JS::Value> >\n{\n    friend class ValueOperations<JS::MutableHandle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::MutableHandle<JS::Value> >;\n    friend class MutableValueOperations<JS::MutableHandle<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic Rooted<T> interface when T = Value with type-querying,\n * value-extracting, and mutating operations.\n */\ntemplate <>\nclass RootedBase<JS::Value> : public MutableValueOperations<JS::Rooted<JS::Value> >\n{\n    friend class ValueOperations<JS::Rooted<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Rooted<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::Rooted<JS::Value> >;\n    friend class MutableValueOperations<JS::Rooted<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::Rooted<JS::Value>*>(this)->address();\n    }\n};\n\n} // namespace js\n\ninline jsval_layout\nJSVAL_TO_IMPL(JS::Value v)\n{\n    return v.data;\n}\n\ninline JS::Value\nIMPL_TO_JSVAL(jsval_layout l)\n{\n    JS::Value v;\n    v.data = l;\n    return v;\n}\n\nnamespace JS {\n\n#ifndef __GNUC__\n/*\n * The default assignment operator for |struct C| has the signature:\n *\n *   C& C::operator=(const C&)\n *\n * And in particular requires implicit conversion of |this| to type |C| for the\n * return value. But |volatile C| cannot thus be converted to |C|, so just\n * doing |sink = hold| as in the non-specialized version would fail to compile.\n * Do the assignment on asBits instead, since I don't think we want to give\n * jsval_layout an assignment operator returning |volatile jsval_layout|.\n */\ntemplate<>\ninline Anchor<Value>::~Anchor()\n{\n    volatile uint64_t bits;\n    bits = JSVAL_TO_IMPL(hold).asBits;\n}\n#endif\n\n#ifdef DEBUG\nnamespace detail {\n\nstruct ValueAlignmentTester { char c; JS::Value v; };\nstatic_assert(sizeof(ValueAlignmentTester) == 16,\n              \"JS::Value must be 16-byte-aligned\");\n\nstruct LayoutAlignmentTester { char c; jsval_layout l; };\nstatic_assert(sizeof(LayoutAlignmentTester) == 16,\n              \"jsval_layout must be 16-byte-aligned\");\n\n} // namespace detail\n#endif /* DEBUG */\n\n} // namespace JS\n\n/*\n * JS::Value and jsval are the same type; jsval is the old name, kept around\n * for backwards compatibility along with all the JSVAL_* operations below.\n * jsval_layout is an implementation detail and should not be used externally.\n */\ntypedef JS::Value jsval;\n\nstatic_assert(sizeof(jsval_layout) == sizeof(JS::Value),\n              \"jsval_layout and JS::Value must have identical layouts\");\n\n/************************************************************************/\n\nstatic inline JSBool\nJSVAL_IS_NULL(jsval v)\n{\n    return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_VOID(jsval v)\n{\n    return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_INT(jsval v)\n{\n    return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline int32_t\nJSVAL_TO_INT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_INT(v));\n    return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nINT_TO_JSVAL(int32_t i)\n{\n    return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE(jsval v)\n{\n    return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline double\nJSVAL_TO_DOUBLE(jsval v)\n{\n    jsval_layout l;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    l = JSVAL_TO_IMPL(v);\n    return l.asDouble;\n}\n\nstatic inline jsval\nDOUBLE_TO_JSVAL(double d)\n{\n    /*\n     * This is a manually inlined version of:\n     *    d = JS_CANONICALIZE_NAN(d);\n     *    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));\n     * because GCC from XCode 3.1.4 miscompiles the above code.\n     */\n    jsval_layout l;\n    if (MOZ_UNLIKELY(d != d))\n        l.asBits = 0x7FF8000000000000LL;\n    else\n        l.asDouble = d;\n    return IMPL_TO_JSVAL(l);\n}\n\nstatic inline jsval\nUINT_TO_JSVAL(uint32_t i)\n{\n    if (i <= JSVAL_INT_MAX)\n        return INT_TO_JSVAL((int32_t)i);\n    return DOUBLE_TO_JSVAL((double)i);\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER(jsval v)\n{\n    return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING(jsval v)\n{\n    return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_STRING(v));\n    return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nSTRING_TO_JSVAL(JSString *str)\n{\n    return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str));\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v)));\n    return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nOBJECT_TO_JSVAL(JSObject *obj)\n{\n    if (obj)\n        return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj));\n    return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0));\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN(jsval v)\n{\n    return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_BOOLEAN(v));\n    return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nBOOLEAN_TO_JSVAL(JSBool b)\n{\n    return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE(jsval v)\n{\n    return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING(jsval v)\n{\n    return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_GCTHING(v));\n    return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/* To be GC-safe, privates are tagged as doubles. */\n\nstatic inline jsval\nPRIVATE_TO_JSVAL(void *ptr)\n{\n    return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));\n}\n\n#endif /* js_Value_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Vector_h\n#define js_Vector_h\n\n#include \"mozilla/Vector.h\"\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace js {\n\nclass TempAllocPolicy;\n\n// If we had C++11 template aliases, we could just use this:\n//\n//   template <typename T,\n//             size_t MinInlineCapacity = 0,\n//             class AllocPolicy = TempAllocPolicy>\n//   using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;\n//\n// ...and get rid of all the CRTP madness in mozilla::Vector(Base).  But we\n// can't because compiler support's not up to snuff.  (Template aliases are in\n// gcc 4.7 and clang 3.0 and are expected to be in MSVC 2013.)  Instead, have a\n// completely separate class inheriting from mozilla::Vector, and throw CRTP at\n// the problem til things work.\n//\n// This workaround presents a couple issues.  First, because js::Vector is a\n// distinct type from mozilla::Vector, overload resolution, method calls, etc.\n// are affected.  *Hopefully* this won't be too bad in practice.  (A bunch of\n// places had to be fixed when mozilla::Vector was introduced, but it wasn't a\n// crazy number.)  Second, mozilla::Vector's interface has to be made subclass-\n// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one\n// should use.  :-)  Third, we have to redefine the constructors and the non-\n// inherited operators.  Blech.  Happily there aren't too many of these, so it\n// isn't the end of the world.\n\ntemplate <typename T,\n          size_t MinInlineCapacity = 0,\n          class AllocPolicy = TempAllocPolicy>\nclass Vector\n  : public mozilla::VectorBase<T,\n                               MinInlineCapacity,\n                               AllocPolicy,\n                               Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector &operator=(mozilla::MoveRef<Vector> vec) {\n        return Base::operator=(vec);\n    }\n};\n\n} // namespace js\n\n#endif /* js_Vector_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js-config.h",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sw=4 et tw=78:\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_config_h___\n#define js_config_h___\n\n/* Definitions set at build time that affect SpiderMonkey's public API.\n   This header file is generated by the SpiderMonkey configure script,\n   and installed along with jsapi.h.  */\n\n/* Define to 1 if SpiderMonkey should support multi-threaded clients.  */\n/* #undef JS_THREADSAFE */\n\n/* Define to 1 if SpiderMonkey should include ctypes support.  */\n/* #undef JS_HAS_CTYPES */\n\n/* Define to 1 if SpiderMonkey should support the ability to perform\n   entirely too much GC.  */\n/* #undef JS_GC_ZEAL */\n\n/* Define to 1 if the <endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n#define JS_HAVE_ENDIAN_H 1\n\n/* Define to 1 if the <machine/endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n#define JS_HAVE_MACHINE_ENDIAN_H 1\n\n/* Define to 1 if the <sys/isa_defs.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_SYS_ISA_DEFS_H */\n\n/* The configure script defines these if it doesn't #define\n   JS_HAVE_STDINT_H.  */\n#define JS_BYTES_PER_WORD 4\n\n/* MOZILLA JSAPI version number components */\n#define MOZJS_MAJOR_VERSION 25\n#define MOZJS_MINOR_VERSION 0\n\n#endif /* js_config_h___ */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js.msg",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This is the JavaScript error message file.\n *\n * The format for each JS error message is:\n *\n * MSG_DEF(<SYMBOLIC_NAME>, <ERROR_NUMBER>, <ARGUMENT_COUNT>, <EXCEPTION_NAME>,\n *         <FORMAT_STRING>)\n *\n * where ;\n * <SYMBOLIC_NAME> is a legal C identifer that will be used in the\n * JS engine source.\n *\n * <ERROR_NUMBER> is an unique integral value identifying this error.\n *\n * <ARGUMENT_COUNT> is an integer literal specifying the total number of\n * replaceable arguments in the following format string.\n *\n * <EXCEPTION_NAME> is an exception index from the enum in jsexn.c;\n * JSEXN_NONE for none.  The given exception index will be raised by the\n * engine when the corresponding error occurs.\n *\n * <FORMAT_STRING> is a string literal, optionally containing sequences\n * {X} where X  is an integer representing the argument number that will\n * be replaced with a string value when the error is reported.\n *\n * e.g.\n *\n * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 73, JSEXN_NONE, 2,\n *         \"{0} is not a member of the {1} family\")\n *\n * can be used:\n *\n * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, \"Rhino\", \"Monkey\");\n *\n * to report:\n *\n * \"Rhino is not a member of the Monkey family\"\n *\n * When removing MSG_DEFs, convert them to JSMSG_UNUSED<n> placeholders:\n *\n *    MSG_DEF(JSMSG_UNUSED7,                  7, 0, JSEXN_NONE, \"\")\n *\n * Before adding a new MSG_DEF at the end, look for existing JSMSG_UNUSED<n>\n * free index placeholders in the middle of the list.\n */\n\nMSG_DEF(JSMSG_NOT_AN_ERROR,             0, 0, JSEXN_NONE, \"<Error #0 is reserved>\")\nMSG_DEF(JSMSG_NOT_DEFINED,              1, 1, JSEXN_REFERENCEERR, \"{0} is not defined\")\nMSG_DEF(JSMSG_INACTIVE,                 2, 0, JSEXN_INTERNALERR, \"nothing active on context\")\nMSG_DEF(JSMSG_MORE_ARGS_NEEDED,         3, 3, JSEXN_TYPEERR, \"{0} requires more than {1} argument{2}\")\nMSG_DEF(JSMSG_BAD_CHAR,                 4, 1, JSEXN_INTERNALERR, \"invalid format character {0}\")\nMSG_DEF(JSMSG_BAD_TYPE,                 5, 1, JSEXN_TYPEERR, \"unknown type {0}\")\nMSG_DEF(JSMSG_ALLOC_OVERFLOW,           6, 0, JSEXN_INTERNALERR, \"allocation size overflow\")\nMSG_DEF(JSMSG_MISSING_HEXDIGITS,        7, 0, JSEXN_SYNTAXERR, \"missing hexadecimal digits after '0x'\")\nMSG_DEF(JSMSG_INCOMPATIBLE_PROTO,       8, 3, JSEXN_TYPEERR, \"{0}.prototype.{1} called on incompatible {2}\")\nMSG_DEF(JSMSG_NO_CONSTRUCTOR,           9, 1, JSEXN_TYPEERR, \"{0} has no constructor\")\nMSG_DEF(JSMSG_CANT_ALIAS,              10, 3, JSEXN_TYPEERR, \"can't alias {0} to {1} in class {2}\")\nMSG_DEF(JSMSG_NOT_SCRIPTED_FUNCTION,   11, 1, JSEXN_TYPEERR, \"{0} is not a scripted function\")\nMSG_DEF(JSMSG_BAD_SORT_ARG,            12, 0, JSEXN_TYPEERR, \"invalid Array.prototype.sort argument\")\nMSG_DEF(JSMSG_BAD_ATOMIC_NUMBER,       13, 1, JSEXN_INTERNALERR, \"internal error: no index for atom {0}\")\nMSG_DEF(JSMSG_TOO_MANY_LITERALS,       14, 0, JSEXN_INTERNALERR, \"too many literals\")\nMSG_DEF(JSMSG_CANT_WATCH,              15, 1, JSEXN_TYPEERR, \"can't watch non-native objects of class {0}\")\nMSG_DEF(JSMSG_STACK_UNDERFLOW,         16, 2, JSEXN_INTERNALERR, \"internal error compiling {0}: stack underflow at pc {1}\")\nMSG_DEF(JSMSG_NEED_DIET,               17, 1, JSEXN_INTERNALERR, \"{0} too large\")\nMSG_DEF(JSMSG_TOO_MANY_LOCAL_ROOTS,    18, 0, JSEXN_ERR, \"out of local root space\")\nMSG_DEF(JSMSG_READ_ONLY,               19, 1, JSEXN_TYPEERR, \"{0} is read-only\")\nMSG_DEF(JSMSG_BAD_FORMAL,              20, 0, JSEXN_SYNTAXERR, \"malformed formal parameter\")\nMSG_DEF(JSMSG_CANT_DELETE,             21, 1, JSEXN_TYPEERR, \"property {0} is non-configurable and can't be deleted\")\nMSG_DEF(JSMSG_NOT_FUNCTION,            22, 1, JSEXN_TYPEERR, \"{0} is not a function\")\nMSG_DEF(JSMSG_NOT_CONSTRUCTOR,         23, 1, JSEXN_TYPEERR, \"{0} is not a constructor\")\nMSG_DEF(JSMSG_INVALID_DATE,            24, 0, JSEXN_RANGEERR, \"invalid date\")\nMSG_DEF(JSMSG_TOO_DEEP,                25, 1, JSEXN_INTERNALERR, \"{0} nested too deeply\")\nMSG_DEF(JSMSG_OVER_RECURSED,           26, 0, JSEXN_INTERNALERR, \"too much recursion\")\nMSG_DEF(JSMSG_IN_NOT_OBJECT,           27, 1, JSEXN_TYPEERR, \"invalid 'in' operand {0}\")\nMSG_DEF(JSMSG_BAD_NEW_RESULT,          28, 1, JSEXN_TYPEERR, \"invalid new expression result {0}\")\nMSG_DEF(JSMSG_OBJECT_ACCESS_DENIED,    29, 0, JSEXN_ERR, \"Permission denied to access object\")\nMSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED,  30, 1, JSEXN_ERR, \"Permission denied to access property '{0}'\")\nMSG_DEF(JSMSG_BAD_INSTANCEOF_RHS,      31, 1, JSEXN_TYPEERR, \"invalid 'instanceof' operand {0}\")\nMSG_DEF(JSMSG_BAD_BYTECODE,            32, 1, JSEXN_INTERNALERR, \"unimplemented JavaScript bytecode {0}\")\nMSG_DEF(JSMSG_BAD_RADIX,               33, 0, JSEXN_RANGEERR, \"radix must be an integer at least 2 and no greater than 36\")\nMSG_DEF(JSMSG_PAREN_BEFORE_LET,        34, 0, JSEXN_SYNTAXERR, \"missing ( before let head\")\nMSG_DEF(JSMSG_CANT_CONVERT,            35, 1, JSEXN_ERR, \"can't convert {0} to an integer\")\nMSG_DEF(JSMSG_CYCLIC_VALUE,            36, 1, JSEXN_TYPEERR, \"cyclic {0} value\")\nMSG_DEF(JSMSG_COMPILE_EXECED_SCRIPT,   37, 0, JSEXN_TYPEERR, \"can't compile over a script that is currently executing\")\nMSG_DEF(JSMSG_CANT_CONVERT_TO,         38, 2, JSEXN_TYPEERR, \"can't convert {0} to {1}\")\nMSG_DEF(JSMSG_NO_PROPERTIES,           39, 1, JSEXN_TYPEERR, \"{0} has no properties\")\nMSG_DEF(JSMSG_CANT_FIND_CLASS,         40, 1, JSEXN_TYPEERR, \"can't find class id {0}\")\nMSG_DEF(JSMSG_DEAD_OBJECT,             41, 0, JSEXN_TYPEERR, \"can't access dead object\")\nMSG_DEF(JSMSG_BYTECODE_TOO_BIG,        42, 2, JSEXN_INTERNALERR, \"bytecode {0} too large (limit {1})\")\nMSG_DEF(JSMSG_UNKNOWN_FORMAT,          43, 1, JSEXN_INTERNALERR, \"unknown bytecode format {0}\")\nMSG_DEF(JSMSG_TOO_MANY_CON_ARGS,       44, 0, JSEXN_SYNTAXERR, \"too many constructor arguments\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_ARGS,       45, 0, JSEXN_SYNTAXERR, \"too many function arguments\")\nMSG_DEF(JSMSG_BAD_QUANTIFIER,          46, 0, JSEXN_SYNTAXERR, \"invalid quantifier\")\nMSG_DEF(JSMSG_MIN_TOO_BIG,             47, 1, JSEXN_SYNTAXERR, \"overlarge minimum {0}\")\nMSG_DEF(JSMSG_MAX_TOO_BIG,             48, 1, JSEXN_SYNTAXERR, \"overlarge maximum {0}\")\nMSG_DEF(JSMSG_OUT_OF_ORDER,            49, 1, JSEXN_SYNTAXERR, \"maximum {0} less than minimum\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_DECL,       50, 0, JSEXN_SYNTAXERR, \"missing = in destructuring declaration\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASS,        51, 0, JSEXN_REFERENCEERR, \"invalid destructuring assignment operator\")\nMSG_DEF(JSMSG_PAREN_AFTER_LET,         52, 0, JSEXN_SYNTAXERR, \"missing ) after let head\")\nMSG_DEF(JSMSG_CURLY_AFTER_LET,         53, 0, JSEXN_SYNTAXERR, \"missing } after let block\")\nMSG_DEF(JSMSG_MISSING_PAREN,           54, 0, JSEXN_SYNTAXERR, \"unterminated parenthetical\")\nMSG_DEF(JSMSG_UNTERM_CLASS,            55, 1, JSEXN_SYNTAXERR, \"unterminated character class {0}\")\nMSG_DEF(JSMSG_TRAILING_SLASH,          56, 0, JSEXN_SYNTAXERR, \"trailing \\\\ in regular expression\")\nMSG_DEF(JSMSG_BAD_CLASS_RANGE,         57, 0, JSEXN_SYNTAXERR, \"invalid range in character class\")\nMSG_DEF(JSMSG_BAD_REGEXP_FLAG,         58, 1, JSEXN_SYNTAXERR, \"invalid regular expression flag {0}\")\nMSG_DEF(JSMSG_NO_INPUT,                59, 5, JSEXN_SYNTAXERR, \"no input for /{0}/{1}{2}{3}{4}\")\nMSG_DEF(JSMSG_CANT_OPEN,               60, 2, JSEXN_ERR, \"can't open {0}: {1}\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_APPLY_ARGS, 61, 0, JSEXN_RANGEERR, \"arguments array passed to Function.prototype.apply is too large\")\nMSG_DEF(JSMSG_UNMATCHED_RIGHT_PAREN,   62, 0, JSEXN_SYNTAXERR, \"unmatched ) in regular expression\")\nMSG_DEF(JSMSG_TOO_BIG_TO_ENCODE,       63, 0, JSEXN_INTERNALERR, \"data are to big to encode\")\nMSG_DEF(JSMSG_ARG_INDEX_OUT_OF_RANGE,  64, 1, JSEXN_RANGEERR, \"argument {0} accesses an index that is out of range\")\nMSG_DEF(JSMSG_SPREAD_TOO_LARGE,        65, 0, JSEXN_RANGEERR, \"array too large due to spread operand(s)\")\nMSG_DEF(JSMSG_SOURCE_TOO_LONG,         66, 0, JSEXN_RANGEERR, \"source is too long\")\nMSG_DEF(JSMSG_BAD_WEAKMAP_KEY,         67, 0, JSEXN_TYPEERR, \"cannot use the given object as a weak map key\")\nMSG_DEF(JSMSG_BAD_SCRIPT_MAGIC,        68, 0, JSEXN_INTERNALERR, \"bad script XDR magic number\")\nMSG_DEF(JSMSG_PAREN_BEFORE_FORMAL,     69, 0, JSEXN_SYNTAXERR, \"missing ( before formal parameters\")\nMSG_DEF(JSMSG_MISSING_FORMAL,          70, 0, JSEXN_SYNTAXERR, \"missing formal parameter\")\nMSG_DEF(JSMSG_PAREN_AFTER_FORMAL,      71, 0, JSEXN_SYNTAXERR, \"missing ) after formal parameters\")\nMSG_DEF(JSMSG_CURLY_BEFORE_BODY,       72, 0, JSEXN_SYNTAXERR, \"missing { before function body\")\nMSG_DEF(JSMSG_CURLY_AFTER_BODY,        73, 0, JSEXN_SYNTAXERR, \"missing } after function body\")\nMSG_DEF(JSMSG_PAREN_BEFORE_COND,       74, 0, JSEXN_SYNTAXERR, \"missing ( before condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_COND,        75, 0, JSEXN_SYNTAXERR, \"missing ) after condition\")\nMSG_DEF(JSMSG_BAD_DUP_ARGS,            76, 0, JSEXN_SYNTAXERR, \"duplicate argument names not allowed in this context\")\nMSG_DEF(JSMSG_NAME_AFTER_DOT,          77, 0, JSEXN_SYNTAXERR, \"missing name after . operator\")\nMSG_DEF(JSMSG_BRACKET_IN_INDEX,        78, 0, JSEXN_SYNTAXERR, \"missing ] in index expression\")\nMSG_DEF(JSMSG_ACCESSOR_DEF_DENIED,     79, 1, JSEXN_ERR, \"Permission denied to define accessor property '{0}'\")\nMSG_DEF(JSMSG_PAREN_BEFORE_SWITCH,     80, 0, JSEXN_SYNTAXERR, \"missing ( before switch expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_SWITCH,      81, 0, JSEXN_SYNTAXERR, \"missing ) after switch expression\")\nMSG_DEF(JSMSG_CURLY_BEFORE_SWITCH,     82, 0, JSEXN_SYNTAXERR, \"missing { before switch body\")\nMSG_DEF(JSMSG_COLON_AFTER_CASE,        83, 0, JSEXN_SYNTAXERR, \"missing : after case label\")\nMSG_DEF(JSMSG_WHILE_AFTER_DO,          84, 0, JSEXN_SYNTAXERR, \"missing while after do-loop body\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR,         85, 0, JSEXN_SYNTAXERR, \"missing ( after for\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT,     86, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop initializer\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_COND,     87, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR_CTRL,    88, 0, JSEXN_SYNTAXERR, \"missing ) after for-loop control\")\nMSG_DEF(JSMSG_CURLY_BEFORE_TRY,        89, 0, JSEXN_SYNTAXERR, \"missing { before try block\")\nMSG_DEF(JSMSG_CURLY_AFTER_TRY,         90, 0, JSEXN_SYNTAXERR, \"missing } after try block\")\nMSG_DEF(JSMSG_PAREN_BEFORE_CATCH,      91, 0, JSEXN_SYNTAXERR, \"missing ( before catch\")\nMSG_DEF(JSMSG_CATCH_IDENTIFIER,        92, 0, JSEXN_SYNTAXERR, \"missing identifier in catch\")\nMSG_DEF(JSMSG_PAREN_AFTER_CATCH,       93, 0, JSEXN_SYNTAXERR, \"missing ) after catch\")\nMSG_DEF(JSMSG_CURLY_BEFORE_CATCH,      94, 0, JSEXN_SYNTAXERR, \"missing { before catch block\")\nMSG_DEF(JSMSG_CURLY_AFTER_CATCH,       95, 0, JSEXN_SYNTAXERR, \"missing } after catch block\")\nMSG_DEF(JSMSG_CURLY_BEFORE_FINALLY,    96, 0, JSEXN_SYNTAXERR, \"missing { before finally block\")\nMSG_DEF(JSMSG_CURLY_AFTER_FINALLY,     97, 0, JSEXN_SYNTAXERR, \"missing } after finally block\")\nMSG_DEF(JSMSG_CATCH_OR_FINALLY,        98, 0, JSEXN_SYNTAXERR, \"missing catch or finally after try\")\nMSG_DEF(JSMSG_PAREN_BEFORE_WITH,       99, 0, JSEXN_SYNTAXERR, \"missing ( before with-statement object\")\nMSG_DEF(JSMSG_PAREN_AFTER_WITH,       100, 0, JSEXN_SYNTAXERR, \"missing ) after with-statement object\")\nMSG_DEF(JSMSG_CURLY_IN_COMPOUND,      101, 0, JSEXN_SYNTAXERR, \"missing } in compound statement\")\nMSG_DEF(JSMSG_NO_VARIABLE_NAME,       102, 0, JSEXN_SYNTAXERR, \"missing variable name\")\nMSG_DEF(JSMSG_COLON_IN_COND,          103, 0, JSEXN_SYNTAXERR, \"missing : in conditional expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_ARGS,       104, 0, JSEXN_SYNTAXERR, \"missing ) after argument list\")\nMSG_DEF(JSMSG_BRACKET_AFTER_LIST,     105, 0, JSEXN_SYNTAXERR, \"missing ] after element list\")\nMSG_DEF(JSMSG_COLON_AFTER_ID,         106, 0, JSEXN_SYNTAXERR, \"missing : after property id\")\nMSG_DEF(JSMSG_CURLY_AFTER_LIST,       107, 0, JSEXN_SYNTAXERR, \"missing } after property list\")\nMSG_DEF(JSMSG_PAREN_IN_PAREN,         108, 0, JSEXN_SYNTAXERR, \"missing ) in parenthetical\")\nMSG_DEF(JSMSG_SEMI_BEFORE_STMNT,      109, 0, JSEXN_SYNTAXERR, \"missing ; before statement\")\nMSG_DEF(JSMSG_NO_RETURN_VALUE,        110, 1, JSEXN_TYPEERR, \"function {0} does not always return a value\")\nMSG_DEF(JSMSG_DUPLICATE_FORMAL,       111, 1, JSEXN_SYNTAXERR, \"duplicate formal argument {0}\")\nMSG_DEF(JSMSG_EQUAL_AS_ASSIGN,        112, 0, JSEXN_SYNTAXERR, \"test for equality (==) mistyped as assignment (=)?\")\nMSG_DEF(JSMSG_OPTIMIZED_CLOSURE_LEAK, 113, 0, JSEXN_INTERNALERR, \"can't access optimized closure\")\nMSG_DEF(JSMSG_TOO_MANY_DEFAULTS,      114, 0, JSEXN_SYNTAXERR, \"more than one switch default\")\nMSG_DEF(JSMSG_TOO_MANY_CASES,         115, 0, JSEXN_INTERNALERR, \"too many switch cases\")\nMSG_DEF(JSMSG_BAD_SWITCH,             116, 0, JSEXN_SYNTAXERR, \"invalid switch statement\")\nMSG_DEF(JSMSG_BAD_FOR_LEFTSIDE,       117, 0, JSEXN_SYNTAXERR, \"invalid for/in left-hand side\")\nMSG_DEF(JSMSG_CATCH_AFTER_GENERAL,    118, 0, JSEXN_SYNTAXERR, \"catch after unconditional catch\")\nMSG_DEF(JSMSG_CATCH_WITHOUT_TRY,      119, 0, JSEXN_SYNTAXERR, \"catch without try\")\nMSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,    120, 0, JSEXN_SYNTAXERR, \"finally without try\")\nMSG_DEF(JSMSG_LABEL_NOT_FOUND,        121, 0, JSEXN_SYNTAXERR, \"label not found\")\nMSG_DEF(JSMSG_TOUGH_BREAK,            122, 0, JSEXN_SYNTAXERR, \"unlabeled break must be inside loop or switch\")\nMSG_DEF(JSMSG_BAD_CONTINUE,           123, 0, JSEXN_SYNTAXERR, \"continue must be inside loop\")\nMSG_DEF(JSMSG_BAD_RETURN_OR_YIELD,    124, 1, JSEXN_SYNTAXERR, \"{0} not in function\")\nMSG_DEF(JSMSG_BAD_LABEL,              125, 0, JSEXN_SYNTAXERR, \"invalid label\")\nMSG_DEF(JSMSG_DUPLICATE_LABEL,        126, 0, JSEXN_SYNTAXERR, \"duplicate label\")\nMSG_DEF(JSMSG_VAR_HIDES_ARG,          127, 1, JSEXN_TYPEERR, \"variable {0} redeclares argument\")\nMSG_DEF(JSMSG_BAD_VAR_INIT,           128, 0, JSEXN_SYNTAXERR, \"invalid variable initialization\")\nMSG_DEF(JSMSG_BAD_LEFTSIDE_OF_ASS,    129, 0, JSEXN_REFERENCEERR, \"invalid assignment left-hand side\")\nMSG_DEF(JSMSG_BAD_OPERAND,            130, 1, JSEXN_SYNTAXERR, \"invalid {0} operand\")\nMSG_DEF(JSMSG_BAD_PROP_ID,            131, 0, JSEXN_SYNTAXERR, \"invalid property id\")\nMSG_DEF(JSMSG_RESERVED_ID,            132, 1, JSEXN_SYNTAXERR, \"{0} is a reserved identifier\")\nMSG_DEF(JSMSG_SYNTAX_ERROR,           133, 0, JSEXN_SYNTAXERR, \"syntax error\")\nMSG_DEF(JSMSG_MISSING_BINARY_DIGITS,  134, 0, JSEXN_SYNTAXERR, \"missing binary digits after '0b'\")\nMSG_DEF(JSMSG_BAD_PROTOTYPE,          135, 1, JSEXN_TYPEERR,   \"'prototype' property of {0} is not an object\")\nMSG_DEF(JSMSG_MISSING_EXPONENT,       136, 0, JSEXN_SYNTAXERR, \"missing exponent\")\nMSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, \"out of memory\")\nMSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, \"unterminated string literal\")\nMSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, \"too many parentheses in regular expression\")\nMSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, \"unterminated comment\")\nMSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, \"unterminated regular expression literal\")\nMSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, \"bad cloned function scope chain\")\nMSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, \"missing octal digits after '0o'\")\nMSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, \"illegal character\")\nMSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, \"{0} is not a legal ECMA-262 octal constant\")\nMSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, \"repeat count must be less than infinity and not overflow maximum string size\")\nMSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, \"uncaught exception: {0}\")\nMSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, \"non-octal digit in an escape sequence that doesn't match a back-reference\")\nMSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, \"back-reference exceeds number of capturing parentheses\")\nMSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, \"precision {0} out of range\")\nMSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, \"invalid {0} usage\")\nMSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, \"invalid array length\")\nMSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, \"can't describe non-native properties of class {0}\")\nMSG_DEF(JSMSG_BAD_APPLY_ARGS,         154, 1, JSEXN_TYPEERR, \"second argument to Function.prototype.{0} must be an array\")\nMSG_DEF(JSMSG_REDECLARED_VAR,         155, 2, JSEXN_TYPEERR, \"redeclaration of {0} {1}\")\nMSG_DEF(JSMSG_UNDECLARED_VAR,         156, 1, JSEXN_REFERENCEERR, \"assignment to undeclared variable {0}\")\nMSG_DEF(JSMSG_ANON_NO_RETURN_VALUE,   157, 0, JSEXN_TYPEERR, \"anonymous function does not always return a value\")\nMSG_DEF(JSMSG_DEPRECATED_USAGE,       158, 1, JSEXN_REFERENCEERR, \"deprecated {0} usage\")\nMSG_DEF(JSMSG_BAD_URI,                159, 0, JSEXN_URIERR, \"malformed URI sequence\")\nMSG_DEF(JSMSG_GETTER_ONLY,            160, 0, JSEXN_TYPEERR, \"setting a property that has only a getter\")\nMSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,   161, 0, JSEXN_SYNTAXERR, \"identifier starts immediately after numeric literal\")\nMSG_DEF(JSMSG_UNDEFINED_PROP,         162, 1, JSEXN_REFERENCEERR, \"reference to undefined property {0}\")\nMSG_DEF(JSMSG_USELESS_EXPR,           163, 0, JSEXN_TYPEERR, \"useless expression\")\nMSG_DEF(JSMSG_REDECLARED_PARAM,       164, 1, JSEXN_TYPEERR, \"redeclaration of formal parameter {0}\")\nMSG_DEF(JSMSG_NEWREGEXP_FLAGGED,      165, 0, JSEXN_TYPEERR, \"can't supply flags when constructing one RegExp from another\")\nMSG_DEF(JSMSG_RESERVED_SLOT_RANGE,    166, 0, JSEXN_RANGEERR, \"reserved slot index out of range\")\nMSG_DEF(JSMSG_CANT_DECODE_PRINCIPALS, 167, 0, JSEXN_INTERNALERR, \"can't decode JSPrincipals\")\nMSG_DEF(JSMSG_CANT_SEAL_OBJECT,       168, 1, JSEXN_ERR, \"can't seal {0} objects\")\nMSG_DEF(JSMSG_TOO_MANY_CATCH_VARS,    169, 0, JSEXN_SYNTAXERR, \"too many catch variables\")\nMSG_DEF(JSMSG_NEGATIVE_REPETITION_COUNT, 170, 0, JSEXN_RANGEERR, \"repeat count must be non-negative\")\nMSG_DEF(JSMSG_UNUSED171,              171, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED172,              172, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED173,              173, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED174,              174, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_NESTING_GENERATOR,      175, 0, JSEXN_TYPEERR, \"already executing generator\")\nMSG_DEF(JSMSG_UNUSED176,              176, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED177,              177, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED178,              178, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED179,              179, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED180,              180, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED181,              181, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SEND,     182, 1, JSEXN_TYPEERR, \"attempt to send {0} to newborn generator\")\nMSG_DEF(JSMSG_UNUSED183,              183, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED184,              184, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE, 185, 0, JSEXN_TYPEERR, \"proxy can't report an extensible object as non-extensible\")\nMSG_DEF(JSMSG_UNUSED186,              186, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED187,              187, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INCOMPATIBLE_METHOD,    188, 3, JSEXN_TYPEERR, \"{0} {1} called on incompatible {2}\")\nMSG_DEF(JSMSG_UNUSED189,              189, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED190,              190, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED191,              191, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED192,              192, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_FOR_EACH_LOOP,      193, 0, JSEXN_SYNTAXERR, \"invalid for each loop\")\nMSG_DEF(JSMSG_UNUSED194,              194, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED195,              195, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED196,              196, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INTERNAL_INTL_ERROR,    197, 0, JSEXN_ERR, \"internal error while computing Intl data\")\nMSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR,   198, 0, JSEXN_ERR, \"internal error getting the default locale\")\nMSG_DEF(JSMSG_TOO_MANY_LOCALS,        199, 0, JSEXN_SYNTAXERR, \"too many local variables\")\nMSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG,     200, 0, JSEXN_INTERNALERR, \"array initialiser too large\")\nMSG_DEF(JSMSG_REGEXP_TOO_COMPLEX,     201, 0, JSEXN_INTERNALERR, \"regular expression too complex\")\nMSG_DEF(JSMSG_BUFFER_TOO_SMALL,       202, 0, JSEXN_INTERNALERR, \"buffer too small\")\nMSG_DEF(JSMSG_BAD_SURROGATE_CHAR,     203, 1, JSEXN_TYPEERR, \"bad surrogate character {0}\")\nMSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE,    204, 1, JSEXN_TYPEERR, \"UTF-8 character {0} too large\")\nMSG_DEF(JSMSG_MALFORMED_UTF8_CHAR,    205, 1, JSEXN_TYPEERR, \"malformed UTF-8 character sequence at offset {0}\")\nMSG_DEF(JSMSG_USER_DEFINED_ERROR,     206, 0, JSEXN_ERR, \"JS_ReportError was called\")\nMSG_DEF(JSMSG_WRONG_CONSTRUCTOR,      207, 1, JSEXN_TYPEERR, \"wrong constructor called for {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_RETURN,   208, 1, JSEXN_TYPEERR, \"generator function {0} returns a value\")\nMSG_DEF(JSMSG_BAD_ANON_GENERATOR_RETURN, 209, 0, JSEXN_TYPEERR, \"anonymous generator function returns a value\")\nMSG_DEF(JSMSG_NAME_AFTER_FOR_PAREN,   210, 0, JSEXN_SYNTAXERR, \"missing name after for (\")\nMSG_DEF(JSMSG_IN_AFTER_FOR_NAME,      211, 0, JSEXN_SYNTAXERR, \"missing 'in' or 'of' after for\")\nMSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE,  212, 2, JSEXN_TYPEERR,\"trap {1} for {0} returned a primitive value\")\nMSG_DEF(JSMSG_UNUSED213,              213, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_YIELD,    214, 1, JSEXN_TYPEERR, \"yield from closing generator {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SYNTAX,   215, 1, JSEXN_SYNTAXERR, \"{0} expression must be parenthesized\")\nMSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE,    216, 0, JSEXN_SYNTAXERR, \"invalid array comprehension left-hand side\")\nMSG_DEF(JSMSG_UNUSED217,              217, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE,     218, 0, JSEXN_TYPEERR, \"reduce of empty array with no initial value\")\nMSG_DEF(JSMSG_UNUSED219,              219, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_DELETE_OPERAND,     220, 0, JSEXN_REFERENCEERR, \"invalid delete operand\")\nMSG_DEF(JSMSG_BAD_INCOP_OPERAND,      221, 0, JSEXN_REFERENCEERR, \"invalid increment/decrement operand\")\nMSG_DEF(JSMSG_UNEXPECTED_TYPE,        222, 2, JSEXN_TYPEERR, \"{0} is {1}\")\nMSG_DEF(JSMSG_LET_DECL_NOT_IN_BLOCK,  223, 0, JSEXN_SYNTAXERR, \"let declaration not directly within block\")\nMSG_DEF(JSMSG_BAD_OBJECT_INIT,        224, 0, JSEXN_SYNTAXERR, \"invalid object initializer\")\nMSG_DEF(JSMSG_CANT_SET_ARRAY_ATTRS,   225, 0, JSEXN_INTERNALERR, \"can't set attributes on indexed array properties\")\nMSG_DEF(JSMSG_EVAL_ARITY,             226, 0, JSEXN_TYPEERR, \"eval accepts only one parameter\")\nMSG_DEF(JSMSG_MISSING_FUN_ARG,        227, 2, JSEXN_TYPEERR, \"missing argument {0} when calling function {1}\")\nMSG_DEF(JSMSG_JSON_BAD_PARSE,         228, 1, JSEXN_SYNTAXERR, \"JSON.parse: {0}\")\nMSG_DEF(JSMSG_JSON_BAD_STRINGIFY,     229, 0, JSEXN_ERR, \"JSON.stringify\")\nMSG_DEF(JSMSG_NOT_CALLABLE_OR_UNDEFINED, 230, 0, JSEXN_TYPEERR, \"value is not a function or undefined\")\nMSG_DEF(JSMSG_NOT_NONNULL_OBJECT,     231, 0, JSEXN_TYPEERR, \"value is not a non-null object\")\nMSG_DEF(JSMSG_DEPRECATED_OCTAL,       232, 0, JSEXN_SYNTAXERR, \"octal literals and octal escape sequences are deprecated\")\nMSG_DEF(JSMSG_STRICT_CODE_WITH,       233, 0, JSEXN_SYNTAXERR, \"strict mode code may not contain 'with' statements\")\nMSG_DEF(JSMSG_DUPLICATE_PROPERTY,     234, 1, JSEXN_SYNTAXERR, \"property name {0} appears more than once in object literal\")\nMSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 235, 0, JSEXN_SYNTAXERR, \"applying the 'delete' operator to an unqualified name is deprecated\")\nMSG_DEF(JSMSG_BAD_STRICT_ASSIGN,      236, 1, JSEXN_SYNTAXERR, \"can't assign to {0} in strict mode\")\nMSG_DEF(JSMSG_BAD_BINDING,            237, 1, JSEXN_SYNTAXERR, \"redefining {0} is deprecated\")\nMSG_DEF(JSMSG_INVALID_DESCRIPTOR,     238, 0, JSEXN_TYPEERR, \"property descriptors must not specify a value or be writable when a getter or setter has been specified\")\nMSG_DEF(JSMSG_OBJECT_NOT_EXTENSIBLE,  239, 1, JSEXN_TYPEERR, \"{0} is not extensible\")\nMSG_DEF(JSMSG_CANT_REDEFINE_PROP,     240, 1, JSEXN_TYPEERR, \"can't redefine non-configurable property '{0}'\")\nMSG_DEF(JSMSG_CANT_APPEND_TO_ARRAY,   241, 0, JSEXN_TYPEERR, \"can't add elements past the end of an array if its length property is unwritable\")\nMSG_DEF(JSMSG_CANT_REDEFINE_ARRAY_LENGTH,242, 0, JSEXN_TYPEERR, \"can't redefine array length\")\nMSG_DEF(JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH,243, 0, JSEXN_TYPEERR, \"can't define array index property past the end of an array with non-writable length\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_INDEX,  244, 0, JSEXN_ERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG, 245, 1, JSEXN_ERR, \"argument {0} must be >= 0\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS,   246, 0, JSEXN_ERR, \"invalid arguments\")\nMSG_DEF(JSMSG_CSP_BLOCKED_FUNCTION,   247, 0, JSEXN_ERR, \"call to Function() blocked by CSP\")\nMSG_DEF(JSMSG_BAD_GET_SET_FIELD,      248, 1, JSEXN_TYPEERR, \"property descriptor's {0} field is neither undefined nor a function\")\nMSG_DEF(JSMSG_BAD_PROXY_FIX,          249, 0, JSEXN_TYPEERR, \"proxy was fixed while executing the handler\")\nMSG_DEF(JSMSG_INVALID_EVAL_SCOPE_ARG, 250, 0, JSEXN_EVALERR, \"invalid eval scope argument\")\nMSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS,    251, 3, JSEXN_SYNTAXERR, \"{0} functions must have {1} argument{2}\")\nMSG_DEF(JSMSG_THROW_TYPE_ERROR,       252, 0, JSEXN_TYPEERR, \"'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them\")\nMSG_DEF(JSMSG_BAD_TOISOSTRING_PROP,   253, 0, JSEXN_TYPEERR, \"toISOString property is not callable\")\nMSG_DEF(JSMSG_BAD_PARSE_NODE,         254, 0, JSEXN_INTERNALERR, \"bad parse node\")\nMSG_DEF(JSMSG_NOT_EXPECTED_TYPE,      255, 3, JSEXN_TYPEERR, \"{0}: expected {1}, got {2}\")\nMSG_DEF(JSMSG_CALLER_IS_STRICT,       256, 0, JSEXN_TYPEERR, \"access to strict mode caller function is censored\")\nMSG_DEF(JSMSG_NEED_DEBUG_MODE,        257, 0, JSEXN_ERR, \"function can be called only in debug mode\")\nMSG_DEF(JSMSG_STRICT_CODE_LET_EXPR_STMT, 258, 0, JSEXN_ERR, \"strict mode code may not contain unparenthesized let expression statements\")\nMSG_DEF(JSMSG_CANT_CHANGE_EXTENSIBILITY, 259, 0, JSEXN_TYPEERR, \"can't change object's extensibility\")\nMSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA, 260, 1, JSEXN_INTERNALERR, \"bad serialized structured data ({0})\")\nMSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE,    261, 0, JSEXN_TYPEERR, \"unsupported type for structured data\")\nMSG_DEF(JSMSG_SC_RECURSION,           262, 0, JSEXN_INTERNALERR, \"recursive object\")\nMSG_DEF(JSMSG_DEBUG_CANT_DEBUG_GLOBAL, 263, 0, JSEXN_ERR, \"passing non-debuggable global to addDebuggee\")\nMSG_DEF(JSMSG_BAD_CLONE_VERSION,      264, 0, JSEXN_ERR, \"unsupported structured clone version\")\nMSG_DEF(JSMSG_CANT_CLONE_OBJECT,      265, 0, JSEXN_TYPEERR, \"can't clone object\")\nMSG_DEF(JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED, 266, 0, JSEXN_TYPEERR, \"resumption values are disallowed in this hook\")\nMSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, \"in strict mode code, functions may be declared only at top level or immediately within another function\")\nMSG_DEF(JSMSG_INVALID_FOR_IN_INIT,    268, 0, JSEXN_SYNTAXERR, \"for-in loop let declaration may not have an initializer\")\nMSG_DEF(JSMSG_CLEARED_SCOPE,          269, 0, JSEXN_TYPEERR, \"attempt to run compile-and-go script on a cleared scope\")\nMSG_DEF(JSMSG_MALFORMED_ESCAPE,       270, 1, JSEXN_SYNTAXERR, \"malformed {0} character escape sequence\")\nMSG_DEF(JSMSG_BAD_GENEXP_BODY,        271, 1, JSEXN_SYNTAXERR, \"illegal use of {0} in generator expression\")\nMSG_DEF(JSMSG_YIELD_WITHOUT_OPERAND,  272, 0, JSEXN_SYNTAXERR, \"yield without a value is deprecated, and illegal in ES6 (use 'yield undefined' instead)\")\nMSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT,  273, 0, JSEXN_SYNTAXERR, \"function statement requires a name\")\nMSG_DEF(JSMSG_CCW_REQUIRED,           274, 1, JSEXN_TYPEERR, \"{0}: argument must be an object from a different compartment\")\nMSG_DEF(JSMSG_DEBUG_BAD_RESUMPTION,   275, 0, JSEXN_TYPEERR, \"debugger resumption value must be undefined, {throw: val}, {return: val}, or null\")\nMSG_DEF(JSMSG_ASSIGN_FUNCTION_OR_NULL, 276, 1, JSEXN_TYPEERR, \"value assigned to {0} must be a function or null\")\nMSG_DEF(JSMSG_DEBUG_NOT_LIVE,         277, 1, JSEXN_ERR, \"{0} is not live\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_WRONG_OWNER, 278, 0, JSEXN_TYPEERR, \"Debugger.Object belongs to a different Debugger\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_PROTO,     279, 0, JSEXN_TYPEERR, \"Debugger.Object.prototype is not a valid Debugger.Object\")\nMSG_DEF(JSMSG_DEBUG_LOOP,             280, 0, JSEXN_TYPEERR, \"cannot debug an object in same compartment as debugger or a compartment that is already debugging the debugger\")\nMSG_DEF(JSMSG_DEBUG_NOT_IDLE,         281, 0, JSEXN_ERR, \"can't start debugging: a debuggee script is on the stack\")\nMSG_DEF(JSMSG_DEBUG_BAD_OFFSET,       282, 0, JSEXN_TYPEERR, \"invalid script offset\")\nMSG_DEF(JSMSG_DEBUG_BAD_LINE,         283, 0, JSEXN_TYPEERR, \"invalid line number\")\nMSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING,    284, 0, JSEXN_ERR, \"can't set breakpoint: script global is not a debuggee\")\nMSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, \"{0}: descriptor .{1} property is an object in a different compartment than the target object\")\nMSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, \"stack frame is not running JavaScript code\")\nMSG_DEF(JSMSG_CANT_WATCH_PROP,        287, 0, JSEXN_TYPEERR, \"properties whose names are objects can't be watched\")\nMSG_DEF(JSMSG_CSP_BLOCKED_EVAL,       288, 0, JSEXN_ERR, \"call to eval() blocked by CSP\")\nMSG_DEF(JSMSG_DEBUG_NO_SCOPE_OBJECT,  289, 0, JSEXN_TYPEERR, \"declarative Environments don't have binding objects\")\nMSG_DEF(JSMSG_EMPTY_CONSEQUENT,       290, 0, JSEXN_SYNTAXERR, \"mistyped ; after conditional?\")\nMSG_DEF(JSMSG_NOT_ITERABLE,           291, 1, JSEXN_TYPEERR, \"{0} is not iterable\")\nMSG_DEF(JSMSG_QUERY_LINE_WITHOUT_URL, 292, 0, JSEXN_TYPEERR, \"findScripts query object has 'line' property, but no 'url' property\")\nMSG_DEF(JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL, 293, 0, JSEXN_TYPEERR, \"findScripts query object has 'innermost' property without both 'url' and 'line' properties\")\nMSG_DEF(JSMSG_DEBUG_VARIABLE_NOT_FOUND, 294, 0, JSEXN_TYPEERR, \"variable not found in environment\")\nMSG_DEF(JSMSG_PARAMETER_AFTER_REST,   295, 0, JSEXN_SYNTAXERR, \"parameter after rest parameter\")\nMSG_DEF(JSMSG_NO_REST_NAME,           296, 0, JSEXN_SYNTAXERR, \"no parameter name after ...\")\nMSG_DEF(JSMSG_ARGUMENTS_AND_REST,     297, 0, JSEXN_SYNTAXERR, \"'arguments' object may not be used in conjunction with a rest parameter\")\nMSG_DEF(JSMSG_FUNCTION_ARGUMENTS_AND_REST, 298, 0, JSEXN_ERR, \"the 'arguments' property of a function with a rest parameter may not be used\")\nMSG_DEF(JSMSG_REST_WITH_DEFAULT,      299, 0, JSEXN_SYNTAXERR, \"rest parameter may not have a default\")\nMSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, \"parameter(s) with default followed by parameter without default\")\nMSG_DEF(JSMSG_YIELD_IN_DEFAULT,       301, 0, JSEXN_SYNTAXERR, \"yield in default expression\")\nMSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED,  302, 1, JSEXN_REFERENCEERR, \"no intrinsic function {0}\")\nMSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP,  303, 1, JSEXN_ERR,      \"{0} is being assigned a source map, yet already has one\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG,      304, 1, JSEXN_RANGEERR, \"invalid ParallelArray{0} argument\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, \"argument must be divisible by outermost dimension\")\nMSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, \"cannot reduce ParallelArray object whose outermost dimension is empty\")\nMSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, \"cannot flatten 1-dimensional ParallelArray object\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, \"no conflict resolution function provided\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, \"index in scatter vector out of bounds\")\nMSG_DEF(JSMSG_CANT_REPORT_NC_AS_NE,   310, 0, JSEXN_TYPEERR, \"proxy can't report a non-configurable own property as non-existent\")\nMSG_DEF(JSMSG_CANT_REPORT_E_AS_NE,    311, 0, JSEXN_TYPEERR, \"proxy can't report an existing own property as non-existent on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_NEW,        312, 0, JSEXN_TYPEERR, \"proxy can't report a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_INVALID,    313, 0, JSEXN_TYPEERR, \"proxy can't report an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_REPORT_NE_AS_NC,   314, 0, JSEXN_TYPEERR, \"proxy can't report a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_CANT_DEFINE_NEW,        315, 0, JSEXN_TYPEERR, \"proxy can't define a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_DEFINE_INVALID,    316, 0, JSEXN_TYPEERR, \"proxy can't define an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_DEFINE_NE_AS_NC,   317, 0, JSEXN_TYPEERR, \"proxy can't define a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_INVALID_TRAP_RESULT,    318, 2, JSEXN_TYPEERR, \"trap {1} for {0} returned an invalid result\")\nMSG_DEF(JSMSG_CANT_SKIP_NC,           319, 0, JSEXN_TYPEERR, \"proxy can't skip a non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_SAME_VALUE, 320, 0, JSEXN_TYPEERR, \"proxy must report the same value for a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_UNDEFINED,  321, 0, JSEXN_TYPEERR, \"proxy must report undefined for a non-configurable accessor property without a getter\")\nMSG_DEF(JSMSG_CANT_SET_NW_NC,         322, 0, JSEXN_TYPEERR, \"proxy can't successfully set a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_CANT_SET_WO_SETTER,     323, 0, JSEXN_TYPEERR, \"proxy can't succesfully set an accessor property without a setter\")\nMSG_DEF(JSMSG_DEBUG_BAD_REFERENT,     324, 2, JSEXN_TYPEERR, \"{0} does not refer to {1}\")\nMSG_DEF(JSMSG_DEBUG_WRAPPER_IN_WAY,   325, 2, JSEXN_TYPEERR, \"{0} is a wrapper around {1}, but a direct reference is required\")\nMSG_DEF(JSMSG_UNWRAP_DENIED,          326, 0, JSEXN_ERR, \"permission denied to unwrap object\")\nMSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 327, 3, JSEXN_TYPEERR, \"Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}\")\nMSG_DEF(JSMSG_INVALID_LOCALES_ELEMENT,328, 0, JSEXN_TYPEERR, \"invalid element in locales argument\")\nMSG_DEF(JSMSG_INVALID_LANGUAGE_TAG,   329, 1, JSEXN_RANGEERR, \"invalid language tag: {0}\")\nMSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, \"invalid locale matcher in supportedLocalesOf(): {0}\")\nMSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, \"invalid value {1} for option {0}\")\nMSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, \"invalid digits value: {0}\")\nMSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, \"can't initialize object twice as an object of an Intl constructor\")\nMSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, \"invalid currency code in NumberFormat(): {0}\")\nMSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, \"undefined currency in NumberFormat() with currency style\")\nMSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, \"invalid time zone in DateTimeFormat(): {0}\")\nMSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, \"date value is not finite in DateTimeFormat.format()\")\nMSG_DEF(JSMSG_MODULE_STATEMENT,       338, 0, JSEXN_SYNTAXERR, \"module declarations may only appear at the top level of a program or module body\")\nMSG_DEF(JSMSG_CURLY_BEFORE_MODULE,    339, 0, JSEXN_SYNTAXERR, \"missing { before module body\")\nMSG_DEF(JSMSG_CURLY_AFTER_MODULE,     340, 0, JSEXN_SYNTAXERR, \"missing } after module body\")\nMSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 341, 0, JSEXN_SYNTAXERR, \"\\\"use asm\\\" is only meaningful in the Directive Prologue of a function body\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_FAIL,      342, 1, JSEXN_TYPEERR, \"asm.js type error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_LINK_FAIL,      343, 1, JSEXN_TYPEERR, \"asm.js link error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_OK,        344, 1, JSEXN_ERR,     \"successfully compiled asm.js code ({0})\")\nMSG_DEF(JSMSG_BAD_ARROW_ARGS,         345, 0, JSEXN_SYNTAXERR, \"invalid arrow-function arguments (parentheses around the arrow-function may help)\")\nMSG_DEF(JSMSG_YIELD_IN_ARROW,         346, 0, JSEXN_SYNTAXERR, \"arrow function may not contain yield\")\nMSG_DEF(JSMSG_WRONG_VALUE,            347, 2, JSEXN_ERR, \"expected {0} but found {1}\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, \"target for index {0} is not an integer\")\nMSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME,349, 0, JSEXN_TYPEERR, \"self-hosted code may not contain unbound name lookups\")\nMSG_DEF(JSMSG_DEPRECATED_SOURCE_MAP,  350, 0, JSEXN_SYNTAXERR, \"Using //@ to indicate source map URL pragmas is deprecated. Use //# instead\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASSIGN,    351, 1, JSEXN_SYNTAXERR, \"can't assign to {0} using destructuring assignment\")\nMSG_DEF(JSMSG_BINARYDATA_ARRAYTYPE_BAD_ARGS, 352, 0, JSEXN_ERR, \"Invalid arguments\")\nMSG_DEF(JSMSG_BINARYDATA_BINARYARRAY_BAD_INDEX, 353, 0, JSEXN_RANGEERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_ARGS, 354, 0, JSEXN_RANGEERR, \"invalid field descriptor\")\nMSG_DEF(JSMSG_BINARYDATA_NOT_BINARYSTRUCT,   355, 1, JSEXN_TYPEERR, \"{0} is not a BinaryStruct\")\nMSG_DEF(JSMSG_BINARYDATA_SUBARRAY_INTEGER_ARG, 356, 1, JSEXN_ERR, \"argument {0} must be an integer\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_EMPTY_DESCRIPTOR, 357, 0, JSEXN_ERR, \"field descriptor cannot be empty\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_FIELD, 358, 1, JSEXN_ERR, \"field {0} is not a valid BinaryData Type descriptor\")\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsalloc.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS allocation policies. */\n\n#ifndef jsalloc_h\n#define jsalloc_h\n\n#include \"mozilla/AllocPolicy.h\"\n\n#include \"js/Utility.h\"\n\nstruct JSContext;\n\nnamespace js {\n\nclass ContextFriendFields;\n\n/* Policy for using system memory functions and doing no error reporting. */\nclass SystemAllocPolicy\n{\n  public:\n    void *malloc_(size_t bytes) { return js_malloc(bytes); }\n    void *calloc_(size_t bytes) { return js_calloc(bytes); }\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }\n    void free_(void *p) { js_free(p); }\n    void reportAllocOverflow() const {}\n};\n\n/*\n * Allocation policy that calls the system memory functions and reports errors\n * to the context. Since the JSContext given on construction is stored for\n * the lifetime of the container, this policy may only be used for containers\n * whose lifetime is a shorter than the given JSContext.\n *\n * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,\n * not the system ones.\n */\nclass TempAllocPolicy\n{\n    ContextFriendFields *const cx_;\n\n    /*\n     * Non-inline helper to call JSRuntime::onOutOfMemory with minimal\n     * code bloat.\n     */\n    JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);\n\n  public:\n    TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(\n    TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}\n\n    void *malloc_(size_t bytes) {\n        void *p = js_malloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *calloc_(size_t bytes) {\n        void *p = js_calloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) {\n        void *p2 = js_realloc(p, bytes);\n        if (JS_UNLIKELY(!p2))\n            p2 = onOutOfMemory(p2, bytes);\n        return p2;\n    }\n\n    void free_(void *p) {\n        js_free(p);\n    }\n\n    JS_FRIEND_API(void) reportAllocOverflow() const;\n};\n\n} /* namespace js */\n\n#endif /* jsalloc_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JavaScript API. */\n\n#ifndef jsapi_h\n#define jsapi_h\n\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/RangedPtr.h\"\n#include \"mozilla/ThreadLocal.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"js-config.h\"\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n#include \"js/CharacterEncoding.h\"\n#include \"js/HashTable.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n#include \"js/Value.h\"\n#include \"js/Vector.h\"\n\n/************************************************************************/\n\nnamespace JS {\n\ntypedef mozilla::RangedPtr<const jschar> CharPtr;\n\nclass StableCharPtr : public CharPtr {\n  public:\n    StableCharPtr(const StableCharPtr &s) : CharPtr(s) {}\n    StableCharPtr(const mozilla::RangedPtr<const jschar> &s) : CharPtr(s) {}\n    StableCharPtr(const jschar *s, size_t len) : CharPtr(s, len) {}\n    StableCharPtr(const jschar *pos, const jschar *start, size_t len)\n      : CharPtr(pos, start, len)\n    {}\n};\n\n#if defined JS_THREADSAFE && defined DEBUG\n\nclass JS_PUBLIC_API(AutoCheckRequestDepth)\n{\n    JSContext *cx;\n  public:\n    AutoCheckRequestDepth(JSContext *cx);\n    AutoCheckRequestDepth(js::ContextFriendFields *cx);\n    ~AutoCheckRequestDepth();\n};\n\n# define CHECK_REQUEST(cx) \\\n    JS::AutoCheckRequestDepth _autoCheckRequestDepth(cx)\n\n#else\n\n# define CHECK_REQUEST(cx) \\\n    ((void) 0)\n\n#endif /* JS_THREADSAFE && DEBUG */\n\n#ifdef DEBUG\n/*\n * Assert that we're not doing GC on cx, that we're in a request as\n * needed, and that the compartments for cx and v are correct.\n * Also check that GC would be safe at this point.\n */\nJS_PUBLIC_API(void)\nAssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v);\n#else\ninline void AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v) {\n    /* Do nothing */\n}\n#endif /* DEBUG */\n\nclass JS_PUBLIC_API(AutoGCRooter) {\n  public:\n    AutoGCRooter(JSContext *cx, ptrdiff_t tag);\n    AutoGCRooter(js::ContextFriendFields *cx, ptrdiff_t tag);\n\n    ~AutoGCRooter() {\n        JS_ASSERT(this == *stackTop);\n        *stackTop = down;\n    }\n\n    /* Implemented in gc/RootMarking.cpp. */\n    inline void trace(JSTracer *trc);\n    static void traceAll(JSTracer *trc);\n    static void traceAllWrappers(JSTracer *trc);\n\n  protected:\n    AutoGCRooter * const down;\n\n    /*\n     * Discriminates actual subclass of this being used.  If non-negative, the\n     * subclass roots an array of values of the length stored in this field.\n     * If negative, meaning is indicated by the corresponding value in the enum\n     * below.  Any other negative value indicates some deeper problem such as\n     * memory corruption.\n     */\n    ptrdiff_t tag_;\n\n    enum {\n        VALARRAY =     -2, /* js::AutoValueArray */\n        PARSER =       -3, /* js::frontend::Parser */\n        SHAPEVECTOR =  -4, /* js::AutoShapeVector */\n        IDARRAY =      -6, /* js::AutoIdArray */\n        DESCRIPTORS =  -7, /* js::AutoPropDescArrayRooter */\n        ID =           -9, /* js::AutoIdRooter */\n        VALVECTOR =   -10, /* js::AutoValueVector */\n        DESCRIPTOR =  -11, /* js::AutoPropertyDescriptorRooter */\n        STRING =      -12, /* js::AutoStringRooter */\n        IDVECTOR =    -13, /* js::AutoIdVector */\n        OBJVECTOR =   -14, /* js::AutoObjectVector */\n        STRINGVECTOR =-15, /* js::AutoStringVector */\n        SCRIPTVECTOR =-16, /* js::AutoScriptVector */\n        NAMEVECTOR =  -17, /* js::AutoNameVector */\n        HASHABLEVALUE=-18, /* js::HashableValue */\n        IONMASM =     -19, /* js::jit::MacroAssembler */\n        IONALLOC =    -20, /* js::jit::AutoTempAllocatorRooter */\n        WRAPVECTOR =  -21, /* js::AutoWrapperVector */\n        WRAPPER =     -22, /* js::AutoWrapperRooter */\n        OBJOBJHASHMAP=-23, /* js::AutoObjectObjectHashMap */\n        OBJU32HASHMAP=-24, /* js::AutoObjectUnsigned32HashMap */\n        OBJHASHSET =  -25, /* js::AutoObjectHashSet */\n        JSONPARSER =  -26, /* js::JSONParser */\n        CUSTOM =      -27, /* js::CustomAutoRooter */\n        FUNVECTOR =   -28  /* js::AutoFunctionVector */\n    };\n\n  private:\n    AutoGCRooter ** const stackTop;\n\n    /* No copy or assignment semantics. */\n    AutoGCRooter(AutoGCRooter &ida) MOZ_DELETE;\n    void operator=(AutoGCRooter &ida) MOZ_DELETE;\n};\n\nclass AutoStringRooter : private AutoGCRooter {\n  public:\n    AutoStringRooter(JSContext *cx, JSString *str = NULL\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, STRING), str_(str)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    void setString(JSString *str) {\n        str_ = str;\n    }\n\n    JSString * string() const {\n        return str_;\n    }\n\n    JSString ** addr() {\n        return &str_;\n    }\n\n    JSString * const * addr() const {\n        return &str_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    JSString *str_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoArrayRooter : private AutoGCRooter {\n  public:\n    AutoArrayRooter(JSContext *cx, size_t len, Value *vec\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, len), array(vec), skip(cx, array, len)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeLength(size_t newLength) {\n        tag_ = ptrdiff_t(newLength);\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeArray(Value *newArray, size_t newLength) {\n        changeLength(newLength);\n        array = newArray;\n    }\n\n    Value *array;\n\n    MutableHandleValue handleAt(size_t i)\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return MutableHandleValue::fromMarkedLocation(&array[i]);\n    }\n    HandleValue handleAt(size_t i) const\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return HandleValue::fromMarkedLocation(&array[i]);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    js::SkipRoot skip;\n};\n\ntemplate<class T>\nclass AutoVectorRooter : protected AutoGCRooter\n{\n  public:\n    explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoVectorRooter(js::ContextFriendFields *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef T ElementType;\n\n    size_t length() const { return vector.length(); }\n    bool empty() const { return vector.empty(); }\n\n    bool append(const T &v) { return vector.append(v); }\n    bool appendAll(const AutoVectorRooter<T> &other) {\n        return vector.appendAll(other.vector);\n    }\n\n    bool insert(T *p, const T &val) { return vector.insert(p, val); }\n\n    /* For use when space has already been reserved. */\n    void infallibleAppend(const T &v) { vector.infallibleAppend(v); }\n\n    void popBack() { vector.popBack(); }\n    T popCopy() { return vector.popCopy(); }\n\n    bool growBy(size_t inc) {\n        size_t oldLength = vector.length();\n        if (!vector.growByUninitialized(inc))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    bool resize(size_t newLength) {\n        size_t oldLength = vector.length();\n        if (newLength <= oldLength) {\n            vector.shrinkBy(oldLength - newLength);\n            return true;\n        }\n        if (!vector.growByUninitialized(newLength - oldLength))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    void clear() { vector.clear(); }\n\n    bool reserve(size_t newLength) {\n        return vector.reserve(newLength);\n    }\n\n    T &operator[](size_t i) { return vector[i]; }\n    const T &operator[](size_t i) const { return vector[i]; }\n\n    JS::MutableHandle<T> handleAt(size_t i) { return JS::MutableHandle<T>::fromMarkedLocation(&vector[i]); }\n    JS::Handle<T> handleAt(size_t i) const { return JS::Handle<T>::fromMarkedLocation(&vector[i]); }\n\n    const T *begin() const { return vector.begin(); }\n    T *begin() { return vector.begin(); }\n\n    const T *end() const { return vector.end(); }\n    T *end() { return vector.end(); }\n\n    const T &back() const { return vector.back(); }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    void makeRangeGCSafe(size_t oldLength) {\n        T *t = vector.begin() + oldLength;\n        for (size_t i = oldLength; i < vector.length(); ++i, ++t)\n            memset(t, 0, sizeof(T));\n    }\n\n    typedef js::Vector<T, 8> VectorImpl;\n    VectorImpl vector;\n\n    /* Prevent overwriting of inline elements in vector. */\n    js::SkipRoot vectorRoot;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class Key, class Value>\nclass AutoHashMapRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashMap<Key, Value> HashMapImpl;\n\n  public:\n    explicit AutoHashMapRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), map(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n    typedef typename HashMapImpl::Lookup Lookup;\n    typedef typename HashMapImpl::Ptr Ptr;\n    typedef typename HashMapImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return map.init(len);\n    }\n    bool initialized() const {\n        return map.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return map.lookup(l);\n    }\n    void remove(Ptr p) {\n        map.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return map.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.add(p, k, v);\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        return map.add(p, k);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.relookupOrAdd(p, k, v);\n    }\n\n    typedef typename HashMapImpl::Range Range;\n    Range all() const {\n        return map.all();\n    }\n\n    typedef typename HashMapImpl::Enum Enum;\n\n    void clear() {\n        map.clear();\n    }\n\n    void finish() {\n        map.finish();\n    }\n\n    bool empty() const {\n        return map.empty();\n    }\n\n    uint32_t count() const {\n        return map.count();\n    }\n\n    size_t capacity() const {\n        return map.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return map.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return map.has(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        return map.put(k, v);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        return map.putNew(k, v);\n    }\n\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        return map.lookupWithDefault(k, defaultValue);\n    }\n\n    void remove(const Lookup &l) {\n        map.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashMapRooter(const AutoHashMapRooter &hmr) MOZ_DELETE;\n    AutoHashMapRooter &operator=(const AutoHashMapRooter &hmr) MOZ_DELETE;\n\n    HashMapImpl map;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class T>\nclass AutoHashSetRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashSet<T> HashSetImpl;\n\n  public:\n    explicit AutoHashSetRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), set(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef typename HashSetImpl::Lookup Lookup;\n    typedef typename HashSetImpl::Ptr Ptr;\n    typedef typename HashSetImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return set.init(len);\n    }\n    bool initialized() const {\n        return set.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return set.lookup(l);\n    }\n    void remove(Ptr p) {\n        set.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return set.lookupForAdd(l);\n    }\n\n    bool add(AddPtr &p, const T &t) {\n        return set.add(p, t);\n    }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return set.relookupOrAdd(p, l, t);\n    }\n\n    typedef typename HashSetImpl::Range Range;\n    Range all() const {\n        return set.all();\n    }\n\n    typedef typename HashSetImpl::Enum Enum;\n\n    void clear() {\n        set.clear();\n    }\n\n    void finish() {\n        set.finish();\n    }\n\n    bool empty() const {\n        return set.empty();\n    }\n\n    uint32_t count() const {\n        return set.count();\n    }\n\n    size_t capacity() const {\n        return set.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return set.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return set.has(l);\n    }\n\n    bool put(const T &t) {\n        return set.put(t);\n    }\n\n    bool putNew(const T &t) {\n        return set.putNew(t);\n    }\n\n    void remove(const Lookup &l) {\n        set.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashSetRooter(const AutoHashSetRooter &hmr) MOZ_DELETE;\n    AutoHashSetRooter &operator=(const AutoHashSetRooter &hmr) MOZ_DELETE;\n\n    HashSetImpl set;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoValueVector : public AutoVectorRooter<Value>\n{\n  public:\n    explicit AutoValueVector(JSContext *cx\n                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<Value>(cx, VALVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoIdVector : public AutoVectorRooter<jsid>\n{\n  public:\n    explicit AutoIdVector(JSContext *cx\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<jsid>(cx, IDVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoObjectVector : public AutoVectorRooter<JSObject *>\n{\n  public:\n    explicit AutoObjectVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoFunctionVector : public AutoVectorRooter<JSFunction *>\n{\n  public:\n    explicit AutoFunctionVector(JSContext *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoFunctionVector(js::ContextFriendFields *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoScriptVector : public AutoVectorRooter<JSScript *>\n{\n  public:\n    explicit AutoScriptVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * Cutsom rooting behavior for internal and external clients.\n */\nclass JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter\n{\n  public:\n    template <typename CX>\n    explicit CustomAutoRooter(CX *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, CUSTOM)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  protected:\n    /* Supplied by derived class to trace roots. */\n    virtual void trace(JSTracer *trc) = 0;\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Returns true if |v| is considered an acceptable this-value. */\ntypedef bool (*IsAcceptableThis)(const Value &v);\n\n/*\n * Implements the guts of a method; guaranteed to be provided an acceptable\n * this-value, as determined by a corresponding IsAcceptableThis method.\n */\ntypedef bool (*NativeImpl)(JSContext *cx, CallArgs args);\n\nnamespace detail {\n\n/* DON'T CALL THIS DIRECTLY.  It's for use only by CallNonGenericMethod! */\nextern JS_PUBLIC_API(bool)\nCallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n\n} /* namespace detail */\n\n/*\n * Methods usually act upon |this| objects only from a single global object and\n * compartment.  Sometimes, however, a method must act upon |this| values from\n * multiple global objects or compartments.  In such cases the |this| value a\n * method might see will be wrapped, such that various access to the object --\n * to its class, its private data, its reserved slots, and so on -- will not\n * work properly without entering that object's compartment.  This method\n * implements a solution to this problem.\n *\n * To implement a method that accepts |this| values from multiple compartments,\n * define two functions.  The first function matches the IsAcceptableThis type\n * and indicates whether the provided value is an acceptable |this| for the\n * method; it must be a pure function only of its argument.\n *\n *   static JSClass AnswerClass = { ... };\n *\n *   static bool\n *   IsAnswerObject(const Value &v)\n *   {\n *       if (!v.isObject())\n *           return false;\n *       return JS_GetClass(&v.toObject()) == &AnswerClass;\n *   }\n *\n * The second function implements the NativeImpl signature and defines the\n * behavior of the method when it is provided an acceptable |this| value.\n * Aside from some typing niceties -- see the CallArgs interface for details --\n * its interface is the same as that of JSNative.\n *\n *   static bool\n *   answer_getAnswer_impl(JSContext *cx, JS::CallArgs args)\n *   {\n *       args.rval().setInt32(42);\n *       return true;\n *   }\n *\n * The implementation function is guaranteed to be called *only* with a |this|\n * value which is considered acceptable.\n *\n * Now to implement the actual method, write a JSNative that calls the method\n * declared below, passing the appropriate template and runtime arguments.\n *\n *   static JSBool\n *   answer_getAnswer(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *       return JS::CallNonGenericMethod<IsAnswerObject, answer_getAnswer_impl>(cx, args);\n *   }\n *\n * Note that, because they are used as template arguments, the predicate\n * and implementation functions must have external linkage. (This is\n * unfortunate, but GCC wasn't inlining things as one would hope when we\n * passed them as function arguments.)\n *\n * JS::CallNonGenericMethod will test whether |args.thisv()| is acceptable.  If\n * it is, it will call the provided implementation function, which will return\n * a value and indicate success.  If it is not, it will attempt to unwrap\n * |this| and call the implementation function on the unwrapped |this|.  If\n * that succeeds, all well and good.  If it doesn't succeed, a TypeError will\n * be thrown.\n *\n * Note: JS::CallNonGenericMethod will only work correctly if it's called in\n *       tail position in a JSNative.  Do not call it from any other place.\n */\ntemplate<IsAcceptableThis Test, NativeImpl Impl>\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\n}  /* namespace JS */\n\n/************************************************************************/\n\n/* JSClass operation signatures. */\n\n/*\n * Add or get a property named by id in obj.  Note the jsid id type -- id may\n * be a string (Unicode property identifier) or an int (element index).  The\n * *vp out parameter, on success, is the new property value after the action.\n */\ntypedef JSBool\n(* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Set a property named by id in obj, treating the assignment as strict\n * mode code if strict is true. Note the jsid id type -- id may be a string\n * (Unicode property identifier) or an int (element index). The *vp out\n * parameter, on success, is the new property value after the\n * set.\n */\ntypedef JSBool\n(* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Delete a property named by id in obj.\n *\n * If an error occurred, return false as per normal JSAPI error practice.\n *\n * If no error occurred, but the deletion attempt wasn't allowed (perhaps\n * because the property was non-configurable), set *succeeded to false and\n * return true.  This will cause |delete obj[id]| to evaluate to false in\n * non-strict mode code, and to throw a TypeError in strict mode code.\n *\n * If no error occurred and the deletion wasn't disallowed (this is *not* the\n * same as saying that a deletion actually occurred -- deleting a non-existent\n * property, or an inherited property, is allowed -- it's just pointless),\n * set *succeeded to true and return true.\n */\ntypedef JSBool\n(* JSDeletePropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);\n\n/*\n * This function type is used for callbacks that enumerate the properties of\n * a JSObject.  The behavior depends on the value of enum_op:\n *\n *  JSENUMERATE_INIT\n *    A new, opaque iterator state should be allocated and stored in *statep.\n *    (You can use PRIVATE_TO_JSVAL() to tag the pointer to be stored).\n *\n *    The number of properties that will be enumerated should be returned as\n *    an integer jsval in *idp, if idp is non-null, and provided the number of\n *    enumerable properties is known.  If idp is non-null and the number of\n *    enumerable properties can't be computed in advance, *idp should be set\n *    to JSVAL_ZERO.\n *\n *  JSENUMERATE_INIT_ALL\n *    Used identically to JSENUMERATE_INIT, but exposes all properties of the\n *    object regardless of enumerability.\n *\n *  JSENUMERATE_NEXT\n *    A previously allocated opaque iterator state is passed in via statep.\n *    Return the next jsid in the iteration using *idp.  The opaque iterator\n *    state pointed at by statep is destroyed and *statep is set to JSVAL_NULL\n *    if there are no properties left to enumerate.\n *\n *  JSENUMERATE_DESTROY\n *    Destroy the opaque iterator state previously allocated in *statep by a\n *    call to this function when enum_op was JSENUMERATE_INIT or\n *    JSENUMERATE_INIT_ALL.\n *\n * The return value is used to indicate success, with a value of JS_FALSE\n * indicating failure.\n */\ntypedef JSBool\n(* JSNewEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,\n                     JS::MutableHandle<JS::Value> statep, JS::MutableHandleId idp);\n\n/*\n * The old-style JSClass.enumerate op should define all lazy properties not\n * yet reflected in obj.\n */\ntypedef JSBool\n(* JSEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/*\n * Resolve a lazy property named by id in obj by defining it directly in obj.\n * Lazy properties are those reflected from some peer native property space\n * (e.g., the DOM attributes for a given node reflected as obj) on demand.\n *\n * JS looks for a property in an object, and if not found, tries to resolve\n * the given id.  If resolve succeeds, the engine looks again in case resolve\n * defined obj[id].  If no such property exists directly in obj, the process\n * is repeated with obj's prototype, etc.\n *\n * NB: JSNewResolveOp provides a cheaper way to resolve lazy properties.\n */\ntypedef JSBool\n(* JSResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\n/*\n * Like JSResolveOp, but flags provide contextual information as follows:\n *\n *  JSRESOLVE_ASSIGNING   obj[id] is on the left-hand side of an assignment\n *\n * The *objp out parameter, on success, should be null to indicate that id\n * was not resolved; and non-null, referring to obj or one of its prototypes,\n * if id was resolved.  The hook may assume *objp is null on entry.\n *\n * This hook instead of JSResolveOp is called via the JSClass.resolve member\n * if JSCLASS_NEW_RESOLVE is set in JSClass.flags.\n */\ntypedef JSBool\n(* JSNewResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,\n                   JS::MutableHandleObject objp);\n\n/*\n * Convert obj to the given type, returning true with the resulting value in\n * *vp on success, and returning false on error or exception.\n */\ntypedef JSBool\n(* JSConvertOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n                JS::MutableHandle<JS::Value> vp);\n\ntypedef struct JSFreeOp JSFreeOp;\n\nstruct JSFreeOp {\n  private:\n    JSRuntime   *runtime_;\n\n  protected:\n    JSFreeOp(JSRuntime *rt)\n      : runtime_(rt) { }\n\n  public:\n    JSRuntime *runtime() const {\n        return runtime_;\n    }\n};\n\n/*\n * Finalize obj, which the garbage collector has determined to be unreachable\n * from other live objects or from GC roots.  Obviously, finalizers must never\n * store a reference to obj.\n */\ntypedef void\n(* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);\n\n/*\n * Finalizes external strings created by JS_NewExternalString.\n */\ntypedef struct JSStringFinalizer JSStringFinalizer;\n\nstruct JSStringFinalizer {\n    void (*finalize)(const JSStringFinalizer *fin, jschar *chars);\n};\n\n/*\n * JSClass.checkAccess type: check whether obj[id] may be accessed per mode,\n * returning false on error/exception, true on success with obj[id]'s last-got\n * value in *vp, and its attributes in *attrsp.  As for JSPropertyOp above, id\n * is either a string or an int jsval.\n */\ntypedef JSBool\n(* JSCheckAccessOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                    JSAccessMode mode, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Check whether v is an instance of obj.  Return false on error or exception,\n * true on success with JS_TRUE in *bp if v is an instance of obj, JS_FALSE in\n * *bp otherwise.\n */\ntypedef JSBool\n(* JSHasInstanceOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,\n                    JSBool *bp);\n\n/*\n * Function type for trace operation of the class called to enumerate all\n * traceable things reachable from obj's private data structure. For each such\n * thing, a trace implementation must call one of the JS_Call*Tracer variants\n * on the thing.\n *\n * JSTraceOp implementation can assume that no other threads mutates object\n * state. It must not change state of the object or corresponding native\n * structures. The only exception for this rule is the case when the embedding\n * needs a tight integration with GC. In that case the embedding can check if\n * the traversal is a part of the marking phase through calling\n * JS_IsGCMarkingTracer and apply a special code like emptying caches or\n * marking its native structures.\n */\ntypedef void\n(* JSTraceOp)(JSTracer *trc, JSObject *obj);\n\n/*\n * Callback that JSTraceOp implementation can provide to return a string\n * describing the reference traced with JS_CallTracer.\n */\ntypedef void\n(* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);\n\ntypedef JSObject *\n(* JSWeakmapKeyDelegateOp)(JSObject *obj);\n\n/* Callbacks and their arguments. */\n\ntypedef enum JSContextOp {\n    JSCONTEXT_NEW,\n    JSCONTEXT_DESTROY\n} JSContextOp;\n\n/*\n * The possible values for contextOp when the runtime calls the callback are:\n *   JSCONTEXT_NEW      JS_NewContext successfully created a new JSContext\n *                      instance. The callback can initialize the instance as\n *                      required. If the callback returns false, the instance\n *                      will be destroyed and JS_NewContext returns null. In\n *                      this case the callback is not called again.\n *   JSCONTEXT_DESTROY  One of JS_DestroyContext* methods is called. The\n *                      callback may perform its own cleanup and must always\n *                      return true.\n *   Any other value    For future compatibility the callback must do nothing\n *                      and return true in this case.\n */\ntypedef JSBool\n(* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data);\n\ntypedef enum JSGCStatus {\n    JSGC_BEGIN,\n    JSGC_END\n} JSGCStatus;\n\ntypedef void\n(* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data);\n\ntypedef enum JSFinalizeStatus {\n    /*\n     * Called when preparing to sweep a group of compartments, before anything\n     * has been swept.  The collector will not yield to the mutator before\n     * calling the callback with JSFINALIZE_GROUP_END status.\n     */\n    JSFINALIZE_GROUP_START,\n\n    /*\n     * Called when preparing to sweep a group of compartments. Weak references\n     * to unmarked things have been removed and things that are not swept\n     * incrementally have been finalized at this point.  The collector may yield\n     * to the mutator after this point.\n     */\n    JSFINALIZE_GROUP_END,\n\n    /*\n     * Called at the end of collection when everything has been swept.\n     */\n    JSFINALIZE_COLLECTION_END\n} JSFinalizeStatus;\n\ntypedef void\n(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment);\n\n/*\n * Generic trace operation that calls JS_CallTracer on each traceable thing\n * stored in data.\n */\ntypedef void\n(* JSTraceDataOp)(JSTracer *trc, void *data);\n\ntypedef JSBool\n(* JSOperationCallback)(JSContext *cx);\n\ntypedef void\n(* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);\n\n#ifdef MOZ_TRACE_JSCALLS\ntypedef void\n(* JSFunctionCallback)(const JSFunction *fun,\n                       const JSScript *scr,\n                       const JSContext *cx,\n                       int entering);\n#endif\n\n/*\n * Possible exception types. These types are part of a JSErrorFormatString\n * structure. They define which error to throw in case of a runtime error.\n * JSEXN_NONE marks an unthrowable error.\n */\ntypedef enum JSExnType {\n    JSEXN_NONE = -1,\n      JSEXN_ERR,\n        JSEXN_INTERNALERR,\n        JSEXN_EVALERR,\n        JSEXN_RANGEERR,\n        JSEXN_REFERENCEERR,\n        JSEXN_SYNTAXERR,\n        JSEXN_TYPEERR,\n        JSEXN_URIERR,\n        JSEXN_LIMIT\n} JSExnType;\n\ntypedef struct JSErrorFormatString {\n    /* The error format string in ASCII. */\n    const char *format;\n\n    /* The number of arguments to expand in the formatted error message. */\n    uint16_t argCount;\n\n    /* One of the JSExnType constants above. */\n    int16_t exnType;\n} JSErrorFormatString;\n\ntypedef const JSErrorFormatString *\n(* JSErrorCallback)(void *userRef, const char *locale,\n                    const unsigned errorNumber);\n\ntypedef JSBool\n(* JSLocaleToUpperCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToLowerCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleCompare)(JSContext *cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,\n                    JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandle<JS::Value> rval);\n\n/*\n * Security protocol types.\n */\n\ntypedef void\n(* JSDestroyPrincipalsOp)(JSPrincipals *principals);\n\n/*\n * Used to check if a CSP instance wants to disable eval() and friends.\n * See js_CheckCSPPermitsJSAction() in jsobj.\n */\ntypedef JSBool\n(* JSCSPEvalChecker)(JSContext *cx);\n\n/*\n * Callback used to ask the embedding for the cross compartment wrapper handler\n * that implements the desired prolicy for this kind of object in the\n * destination compartment. |obj| is the object to be wrapped. If |existing| is\n * non-NULL, it will point to an existing wrapper object that should be re-used\n * if possible. |existing| is guaranteed to be a cross-compartment wrapper with\n * a lazily-defined prototype and the correct global. It is guaranteed not to\n * wrap a function.\n */\ntypedef JSObject *\n(* JSWrapObjectCallback)(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj,\n                         JS::HandleObject proto, JS::HandleObject parent,\n                         unsigned flags);\n\n/*\n * Callback used by the wrap hook to ask the embedding to prepare an object\n * for wrapping in a context. This might include unwrapping other wrappers\n * or even finding a more suitable object for the new compartment.\n */\ntypedef JSObject *\n(* JSPreWrapCallback)(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj,\n                      unsigned flags);\n\n/*\n * Callback used when wrapping determines that the underlying object is already\n * in the compartment for which it is being wrapped. This allows consumers to\n * maintain same-compartment wrapping invariants.\n *\n * |obj| is guaranteed to be same-compartment as |cx|, but it may (or may not)\n * be a security or cross-compartment wrapper. This is an unfortunate contract,\n * but is important for to avoid unnecessarily recomputing every cross-\n * compartment wrapper that gets passed to wrap.\n */\ntypedef JSObject *\n(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JS::HandleObject obj);\n\ntypedef void\n(* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);\n\ntypedef void\n(* JSCompartmentNameCallback)(JSRuntime *rt, JSCompartment *compartment,\n                              char *buf, size_t bufsize);\n\n/*\n * Read structured data from the reader r. This hook is used to read a value\n * previously serialized by a call to the WriteStructuredCloneOp hook.\n *\n * tag and data are the pair of uint32_t values from the header. The callback\n * may use the JS_Read* APIs to read any other relevant parts of the object\n * from the reader r. closure is any value passed to the JS_ReadStructuredClone\n * function. Return the new object on success, NULL on error/exception.\n */\ntypedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,\n                                           uint32_t tag, uint32_t data, void *closure);\n\n/*\n * Structured data serialization hook. The engine can write primitive values,\n * Objects, Arrays, Dates, RegExps, TypedArrays, and ArrayBuffers. Any other\n * type of object requires application support. This callback must first use\n * the JS_WriteUint32Pair API to write an object header, passing a value\n * greater than JS_SCTAG_USER to the tag parameter. Then it can use the\n * JS_Write* APIs to write any other relevant parts of the value v to the\n * writer w. closure is any value passed to the JS_WriteStructuredCLone function.\n *\n * Return true on success, false on error/exception.\n */\ntypedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,\n                                         JS::Handle<JSObject*> obj, void *closure);\n\n/*\n * This is called when JS_WriteStructuredClone is given an invalid transferable.\n * To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException\n * with error set to one of the JS_SCERR_* values.\n */\ntypedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);\n\n/************************************************************************/\n\n/*\n * JS constants. For efficiency, prefer predicates (e.g. v.isNull()) and\n * constructing values from scratch (e.g. Int32Value(0)).  These constants are\n * stored in memory and initialized at startup, so testing against them and\n * using them requires memory loads and will be correspondingly slow.\n */\nextern JS_PUBLIC_DATA(const jsval) JSVAL_NULL;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ZERO;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ONE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_FALSE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_TRUE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_VOID;\n\nstatic JS_ALWAYS_INLINE jsval\nJS_NumberValue(double d)\n{\n    int32_t i;\n    d = JS::CanonicalizeNaN(d);\n    if (mozilla::DoubleIsInt32(d, &i))\n        return INT_TO_JSVAL(i);\n    return DOUBLE_TO_JSVAL(d);\n}\n\n/************************************************************************/\n\n/*\n * A jsid is an identifier for a property or method of an object which is\n * either a 31-bit signed integer, interned string or object.  Also, there is\n * an additional jsid value, JSID_VOID, which does not occur in JS scripts but\n * may be used to indicate the absence of a valid jsid.\n *\n * A jsid is not implicitly convertible to or from a jsval; JS_ValueToId or\n * JS_IdToValue must be used instead.\n */\n\n#define JSID_TYPE_STRING                 0x0\n#define JSID_TYPE_INT                    0x1\n#define JSID_TYPE_VOID                   0x2\n#define JSID_TYPE_OBJECT                 0x4\n#define JSID_TYPE_MASK                   0x7\n\n/*\n * Avoid using canonical 'id' for jsid parameters since this is a magic word in\n * Objective-C++ which, apparently, wants to be able to #include jsapi.h.\n */\n#define id iden\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_STRING(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJSID_TO_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSString *)JSID_BITS(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ZERO(jsid id)\n{\n    return JSID_BITS(id) == 0;\n}\n\nJS_PUBLIC_API(JSBool)\nJS_StringHasBeenInterned(JSContext *cx, JSString *str);\n\n/*\n * Only JSStrings that have been interned via the JSAPI can be turned into\n * jsids by API clients.\n *\n * N.B. if a jsid is backed by a string which has not been interned, that\n * string must be appropriately rooted to avoid being collected by the GC.\n */\nJS_PUBLIC_API(jsid)\nINTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_INT(jsid id)\n{\n    return !!(JSID_BITS(id) & JSID_TYPE_INT);\n}\n\nstatic JS_ALWAYS_INLINE int32_t\nJSID_TO_INT(jsid id)\n{\n    JS_ASSERT(JSID_IS_INT(id));\n    return ((uint32_t)JSID_BITS(id)) >> 1;\n}\n\n#define JSID_INT_MIN  0\n#define JSID_INT_MAX  INT32_MAX\n\nstatic JS_ALWAYS_INLINE JSBool\nINT_FITS_IN_JSID(int32_t i)\n{\n    return i >= 0;\n}\n\nstatic JS_ALWAYS_INLINE jsid\nINT_TO_JSID(int32_t i)\n{\n    jsid id;\n    JS_ASSERT(INT_FITS_IN_JSID(i));\n    JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_OBJECT(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT &&\n           (size_t)JSID_BITS(id) != JSID_TYPE_OBJECT;\n}\n\nstatic JS_ALWAYS_INLINE JSObject *\nJSID_TO_OBJECT(jsid id)\n{\n    JS_ASSERT(JSID_IS_OBJECT(id));\n    return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\nstatic JS_ALWAYS_INLINE jsid\nOBJECT_TO_JSID(JSObject *obj)\n{\n    jsid id;\n    JS_ASSERT(obj != NULL);\n    JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);\n    JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_GCTHING(jsid id)\n{\n    return JSID_IS_STRING(id) || JSID_IS_OBJECT(id);\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSID_TO_GCTHING(jsid id)\n{\n    return (void *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\n/*\n * A void jsid is not a valid id and only arises as an exceptional API return\n * value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into\n * JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in\n * hooks receiving a jsid except when explicitly noted in the API contract.\n */\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_VOID(const jsid id)\n{\n    JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,\n                 JSID_BITS(id) == JSID_TYPE_VOID);\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_EMPTY(const jsid id)\n{\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);\n}\n\n#undef id\n\n#ifdef JS_USE_JSID_STRUCT_TYPES\nextern JS_PUBLIC_DATA(const jsid) JSID_VOID;\nextern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;\n#else\n# define JSID_VOID ((jsid)JSID_TYPE_VOID)\n# define JSID_EMPTY ((jsid)JSID_TYPE_OBJECT)\n#endif\n\n/*\n * Returns true iff the given jsval is immune to GC and can be used across\n * multiple JSRuntimes without requiring any conversion API.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_UNIVERSAL(jsval v)\n{\n    return !JSVAL_IS_GCTHING(v);\n}\n\nnamespace JS {\n\nclass AutoIdRooter : private AutoGCRooter\n{\n  public:\n    explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, ID), id_(aId)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    jsid id() {\n        return id_;\n    }\n\n    jsid * addr() {\n        return &id_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    jsid id_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n} /* namespace JS */\n\n/************************************************************************/\n\n/* Property attributes, set in JSPropertySpec and passed to API functions. */\n#define JSPROP_ENUMERATE        0x01    /* property is visible to for/in loop */\n#define JSPROP_READONLY         0x02    /* not settable: assignment is no-op.\n                                           This flag is only valid when neither\n                                           JSPROP_GETTER nor JSPROP_SETTER is\n                                           set. */\n#define JSPROP_PERMANENT        0x04    /* property cannot be deleted */\n#define JSPROP_NATIVE_ACCESSORS 0x08    /* set in JSPropertyDescriptor.flags\n                                           if getters/setters are JSNatives */\n#define JSPROP_GETTER           0x10    /* property holds getter function */\n#define JSPROP_SETTER           0x20    /* property holds setter function */\n#define JSPROP_SHARED           0x40    /* don't allocate a value slot for this\n                                           property; don't copy the property on\n                                           set of the same-named property in an\n                                           object that delegates to a prototype\n                                           containing this property */\n#define JSPROP_INDEX            0x80    /* name is actually (int) index */\n#define JSPROP_SHORTID         0x100    /* set in JS_DefineProperty attrs\n                                           if getters/setters use a shortid */\n\n#define JSFUN_STUB_GSOPS       0x200    /* use JS_PropertyStub getter/setter\n                                           instead of defaulting to class gsops\n                                           for property holding function */\n\n#define JSFUN_CONSTRUCTOR      0x400    /* native that can be called as a ctor */\n\n\n/*\n * Specify a generic native prototype methods, i.e., methods of a class\n * prototype that are exposed as static methods taking an extra leading\n * argument: the generic |this| parameter.\n *\n * If you set this flag in a JSFunctionSpec struct's flags initializer, then\n * that struct must live at least as long as the native static method object\n * created due to this flag by JS_DefineFunctions or JS_InitClass.  Typically\n * JSFunctionSpec structs are allocated in static arrays.\n */\n#define JSFUN_GENERIC_NATIVE   0x800\n\n#define JSFUN_FLAGS_MASK       0xe00    /* | of all the JSFUN_* flags */\n\n/*\n * The first call to JS_CallOnce by any thread in a process will call 'func'.\n * Later calls to JS_CallOnce with the same JSCallOnceType object will be\n * suppressed.\n *\n * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce\n * to invoke its JSInitCallback.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CallOnce(JSCallOnceType *once, JSInitCallback func);\n\n/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */\nextern JS_PUBLIC_API(int64_t)\nJS_Now(void);\n\n/* Don't want to export data, so provide accessors for non-inline jsvals. */\nextern JS_PUBLIC_API(jsval)\nJS_GetNaNValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetNegativeInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetPositiveInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetEmptyStringValue(JSContext *cx);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetEmptyString(JSRuntime *rt);\n\n/*\n * Format is a string of the following characters (spaces are insignificant),\n * specifying the tabulated type conversions:\n *\n *   b      JSBool          Boolean\n *   c      uint16_t/jschar ECMA uint16_t, Unicode char\n *   i      int32_t         ECMA int32_t\n *   u      uint32_t        ECMA uint32_t\n *   j      int32_t         Rounded int32_t (coordinate)\n *   d      double          IEEE double\n *   I      double          Integral IEEE double\n *   S      JSString *      Unicode string, accessed by a JSString pointer\n *   W      jschar *        Unicode character vector, 0-terminated (W for wide)\n *   o      JSObject *      Object reference\n *   f      JSFunction *    Function private\n *   v      jsval           Argument value (no conversion)\n *   *      N/A             Skip this argument (no vararg)\n *   /      N/A             End of required arguments\n *\n * The variable argument list after format must consist of &b, &c, &s, e.g.,\n * where those variables have the types given above.  For the pointer types\n * char *, JSString *, and JSObject *, the pointed-at memory returned belongs\n * to the JS runtime, not to the calling native code.  The runtime promises\n * to keep this memory valid so long as argv refers to allocated stack space\n * (so long as the native function is active).\n *\n * Fewer arguments than format specifies may be passed only if there is a /\n * in format after the last required argument specifier and argc is at least\n * the number of required arguments.  More arguments than format specifies\n * may be passed without error; it is up to the caller to deal with trailing\n * unconverted arguments.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format,\n                    ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv,\n                      const char *format, va_list ap);\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToObject(JSContext *cx, jsval v, JSObject **objp);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToFunction(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToConstructor(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToString(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToSource(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToNumber(JSContext *cx, jsval v, double *dp);\n\nnamespace js {\n/*\n * DO NOT CALL THIS.  Use JS::ToNumber\n */\nextern JS_PUBLIC_API(bool)\nToNumberSlow(JSContext *cx, JS::Value v, double *dp);\n\n/*\n * DO NOT CALL THIS. Use JS::ToBoolean\n */\nextern JS_PUBLIC_API(bool)\nToBooleanSlow(const JS::Value &v);\n} /* namespace js */\n\nnamespace JS {\n\n/* ES5 9.3 ToNumber. */\nJS_ALWAYS_INLINE bool\nToNumber(JSContext *cx, HandleValue v, double *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    {\n        js::SkipRoot root(cx, &v);\n        js::MaybeCheckStackRoots(cx);\n    }\n\n    if (v.isNumber()) {\n        *out = v.toNumber();\n        return true;\n    }\n    return js::ToNumberSlow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToBoolean(const Value &v)\n{\n    if (v.isBoolean())\n        return v.toBoolean();\n    if (v.isInt32())\n        return v.toInt32() != 0;\n    if (v.isNullOrUndefined())\n        return false;\n    if (v.isDouble()) {\n        double d = v.toDouble();\n        return !mozilla::IsNaN(d) && d != 0;\n    }\n\n    /* The slow path handles strings and objects. */\n    return js::ToBooleanSlow(v);\n}\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_DoubleIsInt32(double d, int32_t *ip);\n\nextern JS_PUBLIC_API(int32_t)\nJS_DoubleToInt32(double d);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_DoubleToUint32(double d);\n\n/*\n * Convert a value to a number, then to an int32_t, according to the ECMA rules\n * for ToInt32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * Convert a value to a number, then to an int64_t, according to the WebIDL\n * rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt64(JSContext *cx, jsval v, int64_t *ip);\n\n/*\n * Convert a value to a number, then to an uint64_t, according to the WebIDL\n * rules for ToUint64: http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint64(JSContext *cx, jsval v, uint64_t *ip);\n\nnamespace js {\n/* DO NOT CALL THIS.  Use JS::ToInt16. */\nextern JS_PUBLIC_API(bool)\nToUint16Slow(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToInt32. */\nextern JS_PUBLIC_API(bool)\nToInt32Slow(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToUint32. */\nextern JS_PUBLIC_API(bool)\nToUint32Slow(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToInt64. */\nextern JS_PUBLIC_API(bool)\nToInt64Slow(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToUint64. */\nextern JS_PUBLIC_API(bool)\nToUint64Slow(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out);\n} /* namespace js */\n\nnamespace JS {\n\nJS_ALWAYS_INLINE bool\nToUint16(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint16_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint16Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt32(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = v.toInt32();\n        return true;\n    }\n    return js::ToInt32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint32(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint32_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt64(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = int64_t(v.toInt32());\n        return true;\n    }\n\n    return js::ToInt64Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint64(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        /* Account for sign extension of negatives into the longer 64bit space. */\n        *out = uint64_t(int64_t(v.toInt32()));\n        return true;\n    }\n\n    return js::ToUint64Slow(cx, v, out);\n}\n\n\n} /* namespace JS */\n\n/*\n * Convert a value to a number, then to a uint32_t, according to the ECMA rules\n * for ToUint32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);\n\n/*\n * Convert a value to a number, then to an int32_t if it fits by rounding to\n * nearest; but failing with an error report if the double is out of range\n * or unordered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * ECMA ToUint16, for mapping a jsval to a Unicode point.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(JSType)\nJS_TypeOfValue(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTypeName(JSContext *cx, JSType type);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same);\n\n/* True iff fun is the global eval function. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinEvalFunction(JSFunction *fun);\n\n/* True iff fun is the Function constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinFunctionConstructor(JSFunction *fun);\n\n/************************************************************************/\n\n/*\n * Initialization, locking, contexts, and memory allocation.\n *\n * It is important that the first runtime and first context be created in a\n * single-threaded fashion, otherwise the behavior of the library is undefined.\n * See: http://developer.mozilla.org/en/docs/Category:JSAPI_Reference\n */\n\ntypedef enum JSUseHelperThreads\n{\n    JS_NO_HELPER_THREADS,\n    JS_USE_HELPER_THREADS\n} JSUseHelperThreads;\n\n/**\n * Initialize SpiderMonkey, returning true only if initialization succeeded.\n * Once this method has succeeded, it is safe to call JS_NewRuntime and other\n * JSAPI methods.\n *\n * This method must be called before any other JSAPI method is used on any\n * thread.  Once it has been used, it is safe to call any JSAPI method, and it\n * remains safe to do so until JS_ShutDown is correctly called.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_Init(void);\n\n/**\n * Destroy free-standing resources allocated by SpiderMonkey, not associated\n * with any runtime, context, or other structure.\n *\n * This method should be called after all other JSAPI data has been properly\n * cleaned up: every new runtime must have been destroyed, every new context\n * must have been destroyed, and so on.  Calling this method before all other\n * resources have been destroyed has undefined behavior.\n *\n * Failure to call this method, at present, has no adverse effects other than\n * leaking memory.  This may not always be the case; it's recommended that all\n * embedders call this method when all other JSAPI operations have completed.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(void)\nJS_ShutDown(void);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_NewRuntime(uint32_t maxbytes, JSUseHelperThreads useHelperThreads);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyRuntime(JSRuntime *rt);\n\n// These are equivalent to ICU's |UMemAllocFn|, |UMemReallocFn|, and\n// |UMemFreeFn| types.  The first argument (called |context| in the ICU docs)\n// will always be NULL, and should be ignored.\ntypedef void *(*JS_ICUAllocFn)(const void *, size_t size);\ntypedef void *(*JS_ICUReallocFn)(const void *, void *p, size_t size);\ntypedef void (*JS_ICUFreeFn)(const void *, void *p);\n\n// This function can be used to track memory used by ICU.\n// Do not use it unless you know what you are doing!\nextern JS_PUBLIC_API(bool)\nJS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn, JS_ICUReallocFn reallocFn, JS_ICUFreeFn freeFn);\n\nJS_PUBLIC_API(void *)\nJS_GetRuntimePrivate(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nJS_PUBLIC_API(void)\nJS_SetRuntimePrivate(JSRuntime *rt, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_BeginRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_EndRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsInRequest(JSRuntime *rt);\n\nnamespace JS {\n\ninline bool\nIsPoisonedId(jsid iden)\n{\n    if (JSID_IS_STRING(iden))\n        return JS::IsPoisonedPtr(JSID_TO_STRING(iden));\n    if (JSID_IS_OBJECT(iden))\n        return JS::IsPoisonedPtr(JSID_TO_OBJECT(iden));\n    return false;\n}\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <> struct GCMethods<jsid>\n{\n    static jsid initial() { return JSID_VOID; }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(jsid id) { return JS::IsPoisonedId(id); }\n    static bool needsPostBarrier(jsid id) { return false; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(jsid *idp) {}\n    static void relocate(jsid *idp) {}\n#endif\n};\n\n} /* namespace js */\n\nclass JSAutoRequest\n{\n  public:\n    JSAutoRequest(JSContext *cx\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mContext(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_BeginRequest(mContext);\n    }\n    ~JSAutoRequest() {\n        JS_EndRequest(mContext);\n    }\n\n  protected:\n    JSContext *mContext;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n#if 0\n  private:\n    static void *operator new(size_t) CPP_THROW_NEW { return 0; };\n    static void operator delete(void *, size_t) { };\n#endif\n};\n\nclass JSAutoCheckRequest\n{\n  public:\n    JSAutoCheckRequest(JSContext *cx\n                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n#if defined JS_THREADSAFE && defined DEBUG\n        mContext = cx;\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));\n#endif\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoCheckRequest() {\n#if defined JS_THREADSAFE && defined DEBUG\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(mContext)));\n#endif\n    }\n\n\n  private:\n#if defined JS_THREADSAFE && defined DEBUG\n    JSContext *mContext;\n#endif\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback, void *data);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_NewContext(JSRuntime *rt, size_t stackChunkSize);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContext(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContextNoGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void *)\nJS_GetContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetSecondContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetSecondContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_ContextIterator(JSRuntime *rt, JSContext **iterp);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetVersion(JSContext *cx);\n\n// Mutate the version on the compartment. This is generally discouraged, but\n// necessary to support the version mutation in the js and xpc shell command\n// set.\n//\n// It would be nice to put this in jsfriendapi, but the linkage requirements\n// of the shells make that impossible.\nJS_PUBLIC_API(void)\nJS_SetVersionForCompartment(JSCompartment *compartment, JSVersion version);\n\nextern JS_PUBLIC_API(const char *)\nJS_VersionToString(JSVersion version);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_StringToVersion(const char *string);\n\n/*\n * JS options are orthogonal to version, and may be freely composed with one\n * another as well as with version.\n *\n * JSOPTION_VAROBJFIX is recommended -- see the comments associated with the\n * prototypes for JS_ExecuteScript, JS_EvaluateScript, etc.\n */\n#define JSOPTION_EXTRA_WARNINGS JS_BIT(0)       /* warn on dubious practices */\n#define JSOPTION_WERROR         JS_BIT(1)       /* convert warning to error */\n#define JSOPTION_VAROBJFIX      JS_BIT(2)       /* make JS_EvaluateScript use\n                                                   the last object on its 'obj'\n                                                   param's scope chain as the\n                                                   ECMA 'variables object' */\n#define JSOPTION_PRIVATE_IS_NSISUPPORTS \\\n                                JS_BIT(3)       /* context private data points\n                                                   to an nsISupports subclass */\n#define JSOPTION_COMPILE_N_GO   JS_BIT(4)       /* caller of JS_Compile*Script\n                                                   promises to execute compiled\n                                                   script once only; enables\n                                                   compile-time scope chain\n                                                   resolution of consts. */\n\n/* JS_BIT(5) is currently unused. */\n\n/* JS_BIT(6) is currently unused. */\n\n/* JS_BIT(7) is currently unused. */\n\n#define JSOPTION_DONT_REPORT_UNCAUGHT                                   \\\n                                JS_BIT(8)       /* When returning from the\n                                                   outermost API call, prevent\n                                                   uncaught exceptions from\n                                                   being converted to error\n                                                   reports */\n\n/* JS_BIT(9) is currently unused. */\n\n/* JS_BIT(10) is currently unused. */\n\n/* JS_BIT(11) is currently unused. */\n\n#define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12)      /* A promise to the compiler\n                                                   that a null rval out-param\n                                                   will be passed to each call\n                                                   to JS_ExecuteScript. */\n#define JSOPTION_UNROOTED_GLOBAL JS_BIT(13)     /* The GC will not root the\n                                                   contexts' default compartment\n                                                   object, leaving that up to the\n                                                   embedding. */\n\n#define JSOPTION_BASELINE       JS_BIT(14)      /* Baseline compiler. */\n\n#define JSOPTION_TYPE_INFERENCE JS_BIT(16)      /* Perform type inference. */\n#define JSOPTION_STRICT_MODE    JS_BIT(17)      /* Provides a way to force\n                                                   strict mode for all code\n                                                   without requiring\n                                                   \"use strict\" annotations. */\n\n#define JSOPTION_ION            JS_BIT(18)      /* IonMonkey */\n\n#define JSOPTION_ASMJS          JS_BIT(19)      /* optimizingasm.js compiler */\n\n#define JSOPTION_MASK           JS_BITMASK(20)\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetOptions(JSContext *cx);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_SetOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_ToggleOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(void)\nJS_SetJitHardening(JSRuntime *rt, JSBool enabled);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetImplementationVersion(void);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentNameCallback(JSRuntime *rt, JSCompartmentNameCallback callback);\n\nextern JS_PUBLIC_API(JSWrapObjectCallback)\nJS_SetWrapObjectCallbacks(JSRuntime *rt,\n                          JSWrapObjectCallback callback,\n                          JSSameCompartmentWrapObjectCallback sccallback,\n                          JSPreWrapCallback precallback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentPrivate(JSCompartment *compartment, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetCompartmentPrivate(JSCompartment *compartment);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapObject(JSContext *cx, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapValue(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapId(JSContext *cx, jsid *idp);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_TransplantObject(JSContext *cx, JS::HandleObject origobj, JS::HandleObject target);\n\nextern JS_FRIEND_API(JSObject *)\njs_TransplantObjectWithWrapper(JSContext *cx,\n                               JS::HandleObject origobj,\n                               JS::HandleObject origwrapper,\n                               JS::HandleObject targetobj,\n                               JS::HandleObject targetwrapper);\n\nextern JS_PUBLIC_API(JSBool)\nJS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob);\n\n/*\n * At any time, a JSContext has a current (possibly-NULL) compartment.\n * Compartments are described in:\n *\n *   developer.mozilla.org/en-US/docs/SpiderMonkey/SpiderMonkey_compartments\n *\n * The current compartment of a context may be changed. The preferred way to do\n * this is with JSAutoCompartment:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in some compartment 'c'\n *     {\n *       JSAutoCompartment ac(cx, obj);  // constructor enters\n *       // in the compartment of 'obj'\n *     }                                 // destructor leaves\n *     // back in compartment 'c'\n *   }\n *\n * For more complicated uses that don't neatly fit in a C++ stack frame, the\n * compartment can entered and left using separate function calls:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in 'oldCompartment'\n *     JSCompartment *oldCompartment = JS_EnterCompartment(cx, obj);\n *     // in the compartment of 'obj'\n *     JS_LeaveCompartment(cx, oldCompartment);\n *     // back in 'oldCompartment'\n *   }\n *\n * Note: these calls must still execute in a LIFO manner w.r.t all other\n * enter/leave calls on the context. Furthermore, only the return value of a\n * JS_EnterCompartment call may be passed as the 'oldCompartment' argument of\n * the corresponding JS_LeaveCompartment call.\n */\n\nclass JS_PUBLIC_API(JSAutoCompartment)\n{\n    JSContext *cx_;\n    JSCompartment *oldCompartment_;\n  public:\n    JSAutoCompartment(JSContext *cx, JSObject *target);\n    JSAutoCompartment(JSContext *cx, JSScript *target);\n    ~JSAutoCompartment();\n};\n\n/* NB: This API is infallible; a NULL return value does not indicate error. */\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartment(JSContext *cx, JSObject *target);\n\nextern JS_PUBLIC_API(void)\nJS_LeaveCompartment(JSContext *cx, JSCompartment *oldCompartment);\n\ntypedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);\n\n/*\n * This function calls |compartmentCallback| on every compartment.  Beware that\n * there is no guarantee that the compartment will survive after the callback\n * returns.\n */\nextern JS_PUBLIC_API(void)\nJS_IterateCompartments(JSRuntime *rt, void *data,\n                       JSIterateCompartmentCallback compartmentCallback);\n\n/*\n * Initialize standard JS class constructors, prototypes, and any top-level\n * functions and constants associated with the standard classes (e.g. isNaN\n * for Number).\n *\n * NB: This sets cx's global object to obj if it was null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitStandardClasses(JSContext *cx, JSObject *obj);\n\n/*\n * Resolve id, which must contain either a string or an int, to a standard\n * class name in obj if possible, defining the class's constructor and/or\n * prototype and storing true in *resolved.  If id does not name a standard\n * class or a top-level property induced by initializing a standard class,\n * store false in *resolved and just return true.  Return false on error,\n * as usual for JSBool result-typed API entry points.\n *\n * This API can be called directly from a global object class's resolve op,\n * to define standard classes lazily.  The class's enumerate op should call\n * JS_EnumerateStandardClasses(cx, obj), to define eagerly during for..in\n * loops any classes not yet resolved lazily.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStandardClass(JSContext *cx, JS::HandleObject obj, JS::HandleId id,\n                        JSBool *resolved);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStandardClasses(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSProtoKey)\nJS_IdentifyClassPrototype(JSContext *cx, JSObject *obj);\n\n/*\n * Returns the original value of |Function.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Object.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetObjectPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Array.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetArrayPrototype(JSContext *cx, JSObject *forObj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGlobalObject(JSObject *obj);\n\n/*\n * May return NULL, if |c| never had a global (e.g. the atoms compartment), or\n * if |c|'s global has been collected.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForCompartmentOrNull(JSContext *cx, JSCompartment *c);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(JSObject *)\nCurrentGlobalOrNull(JSContext *cx);\n\n}\n\n/*\n * This method returns the global corresponding to the most recent scripted\n * frame, which may not match the cx's current compartment. This is extremely\n * dangerous, because it can bypass compartment security invariants in subtle\n * ways. To use it safely, the caller must perform a subsequent security\n * check. There is currently only one consumer of this function in Gecko, and\n * it should probably stay that way. If you'd like to use it, please consult\n * the XPConnect module owner first.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetScriptedGlobal(JSContext *cx);\n\n/*\n * Initialize the 'Reflect' object on a global object.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_InitReflect(JSContext *cx, JSObject *global);\n\n#ifdef JS_HAS_CTYPES\n/*\n * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'\n * object will be sealed.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitCTypesClass(JSContext *cx, JSObject *global);\n\n/*\n * Convert a unicode string 'source' of length 'slen' to the platform native\n * charset, returning a null-terminated string allocated with JS_malloc. On\n * failure, this function should report an error.\n */\ntypedef char *\n(* JSCTypesUnicodeToNativeFun)(JSContext *cx, const jschar *source, size_t slen);\n\n/*\n * Set of function pointers that ctypes can use for various internal functions.\n * See JS_SetCTypesCallbacks below. Providing NULL for a function is safe,\n * and will result in the applicable ctypes functionality not being available.\n */\nstruct JSCTypesCallbacks {\n    JSCTypesUnicodeToNativeFun unicodeToNative;\n};\n\ntypedef struct JSCTypesCallbacks JSCTypesCallbacks;\n\n/*\n * Set the callbacks on the provided 'ctypesObj' object. 'callbacks' should be a\n * pointer to static data that exists for the lifetime of 'ctypesObj', but it\n * may safely be altered after calling this function and without having\n * to call this function again.\n */\nextern JS_PUBLIC_API(void)\nJS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);\n#endif\n\ntypedef JSBool\n(* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);\n\n/*\n * Enumerate memory regions that contain diagnostic information\n * intended to be included in crash report minidumps.\n */\nextern JS_PUBLIC_API(void)\nJS_EnumerateDiagnosticMemoryRegions(JSEnumerateDiagnosticMemoryCallback callback);\n\nextern JS_PUBLIC_API(void *)\nJS_malloc(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(void *)\nJS_realloc(JSContext *cx, void *p, size_t nbytes);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization.\n * cx may be NULL.\n */\nextern JS_PUBLIC_API(void)\nJS_free(JSContext *cx, void *p);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization as specified by the given JSFreeOp instance.\n */\nextern JS_PUBLIC_API(void)\nJS_freeop(JSFreeOp *fop, void *p);\n\nextern JS_PUBLIC_API(JSFreeOp *)\nJS_GetDefaultFreeOp(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_updateMallocCounter(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSContext *cx, const char *s);\n\n/* Duplicate a string.  Does not report an error on failure. */\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSRuntime *rt, const char *s);\n\n\n/*\n * A GC root is a pointer to a jsval, JSObject * or JSString * that itself\n * points into the GC heap. JS_AddValueRoot takes a pointer to a jsval and\n * JS_AddGCThingRoot takes a pointer to a JSObject * or JString *.\n *\n * Note that, since JS_Add*Root stores the address of a variable (of type\n * jsval, JSString *, or JSObject *), that variable must live until\n * JS_Remove*Root is called to remove that variable. For example, after:\n *\n *   void some_function() {\n *     jsval v;\n *     JS_AddNamedValueRoot(cx, &v, \"name\");\n *\n * the caller must perform\n *\n *     JS_RemoveValueRoot(cx, &v);\n *\n * before some_function() returns.\n *\n * Also, use JS_AddNamed*Root(cx, &structPtr->memberObj, \"structPtr->memberObj\")\n * in preference to JS_Add*Root(cx, &structPtr->memberObj), in order to identify\n * roots by their source callsites.  This way, you can find the callsite while\n * debugging if you should fail to do JS_Remove*Root(cx, &structPtr->memberObj)\n * before freeing structPtr's memory.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddObjectRoot(JSContext *cx, JSObject **rp);\n\n#ifdef NAME_ALL_GC_ROOTS\n#define JS_DEFINE_TO_TOKEN(def) #def\n#define JS_DEFINE_TO_STRING(def) JS_DEFINE_TO_TOKEN(def)\n#define JS_AddValueRoot(cx,vp) JS_AddNamedValueRoot((cx), (vp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddStringRoot(cx,rp) JS_AddNamedStringRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddObjectRoot(cx,rp) JS_AddNamedObjectRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRoot(JSContext *cx, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRoot(JSContext *cx, JSScript **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRootRT(JSRuntime *rt, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRootRT(JSRuntime *rt, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);\n\n/* TODO: remove these APIs */\n\nextern JS_FRIEND_API(void)\njs_RemoveRoot(JSRuntime *rt, void *rp);\n\n/*\n * C-compatible version of the Anchor class. It should be called after the last\n * use of the variable it protects.\n */\nextern JS_NEVER_INLINE JS_PUBLIC_API(void)\nJS_AnchorPtr(void *p);\n\n/*\n * Register externally maintained GC roots.\n *\n * traceOp: the trace operation. For each root the implementation should call\n *          JS_CallTracer whenever the root contains a traceable thing.\n * data:    the data argument to pass to each invocation of traceOp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/* Undo a call to JS_AddExtraGCRootsTracer. */\nextern JS_PUBLIC_API(void)\nJS_RemoveExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/*\n * JS_CallTracer API and related macros for implementors of JSTraceOp, to\n * enumerate all references to traceable things reachable via a property or\n * other strong ref identified for debugging purposes by name or index or\n * a naming callback.\n *\n * See the JSTraceOp typedef.\n */\n\n/*\n * Use the following macros to check if a particular jsval is a traceable\n * thing and to extract the thing and its kind to pass to JS_CallTracer.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_TRACEABLE(jsval v)\n{\n    return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSVAL_TO_TRACEABLE(jsval v)\n{\n    return JSVAL_TO_GCTHING(v);\n}\n\nstatic JS_ALWAYS_INLINE JSGCTraceKind\nJSVAL_TRACE_KIND(jsval v)\n{\n    JS_ASSERT(JSVAL_IS_GCTHING(v));\n    return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/*\n * Tracer callback, called for each traceable thing directly referenced by a\n * particular object or runtime structure. It is the callback responsibility\n * to ensure the traversal of the full object graph via calling eventually\n * JS_TraceChildren on the passed thing. In this case the callback must be\n * prepared to deal with cycles in the traversal graph.\n *\n * kind argument is one of JSTRACE_OBJECT, JSTRACE_STRING or a tag denoting\n * internal implementation-specific traversal kind. In the latter case the only\n * operations on thing that the callback can do is to call JS_TraceChildren or\n * JS_GetTraceThingInfo.\n *\n * If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all\n * of its mappings.  This should be used in cases where the tracer\n * wants to use the existing liveness of entries.\n */\ntypedef void\n(* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);\n\nenum WeakMapTraceKind {\n    DoNotTraceWeakMaps = 0,\n    TraceWeakMapValues = 1,\n    TraceWeakMapKeysValues = 2\n};\n\nstruct JSTracer {\n    JSRuntime           *runtime;\n    JSTraceCallback     callback;\n    JSTraceNamePrinter  debugPrinter;\n    const void          *debugPrintArg;\n    size_t              debugPrintIndex;\n    WeakMapTraceKind    eagerlyTraceWeakMaps;\n#ifdef JS_GC_ZEAL\n    void                *realLocation;\n#endif\n};\n\n/*\n * Set debugging information about a reference to a traceable thing to prepare\n * for the following call to JS_CallTracer.\n *\n * When printer is null, arg must be const char * or char * C string naming\n * the reference and index must be either (size_t)-1 indicating that the name\n * alone describes the reference or it must be an index into some array vector\n * that stores the reference.\n *\n * When printer callback is not null, the arg and index arguments are\n * available to the callback as debugPrintArg and debugPrintIndex fields\n * of JSTracer.\n *\n * The storage for name or callback's arguments needs to live only until\n * the following call to JS_CallTracer returns.\n */\n# define JS_SET_TRACING_DETAILS(trc, printer, arg, index)                     \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->debugPrinter = (printer);                                      \\\n        (trc)->debugPrintArg = (arg);                                         \\\n        (trc)->debugPrintIndex = (index);                                     \\\n    JS_END_MACRO\n\n/*\n * Sets the real location for a marked reference, when passing the address\n * directly is not feasable.\n *\n * FIXME: This is currently overcomplicated by our need to nest calls for Values\n * stored as keys in hash tables, but will get simplified once we can rekey\n * in-place.\n */\n#ifdef JS_GC_ZEAL\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n        if (!(trc)->realLocation || !(location))                              \\\n            (trc)->realLocation = (location);                                 \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->realLocation = NULL;                                           \\\n    JS_END_MACRO\n#else\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n#endif\n\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string\n * and index.\n */\n# define JS_SET_TRACING_INDEX(trc, name, index)                               \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, index)\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string.\n */\n# define JS_SET_TRACING_NAME(trc, name)                                       \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, (size_t)-1)\n\n/*\n * The JS_Call*Tracer family of functions traces the given GC thing reference.\n * This performs the tracing action configured on the given JSTracer:\n * typically calling the JSTracer::callback or marking the thing as live.\n *\n * The argument to JS_Call*Tracer is an in-out param: when the function\n * returns, the garbage collector might have moved the GC thing. In this case,\n * the reference passed to JS_Call*Tracer will be updated to the object's new\n * location. Callers of this method are responsible for updating any state\n * that is dependent on the object's address. For example, if the object's\n * address is used as a key in a hashtable, then the object must be removed\n * and re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(void)\nJS_CallValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);\n\ntemplate <typename HashSetEnum>\ninline void\nJS_CallHashSetObjectTracer(JSTracer *trc, HashSetEnum &e, JSObject *const &key, const char *name)\n{\n    JSObject *updated = key;\n    JS_SET_TRACING_LOCATION(trc, reinterpret_cast<void *>(&const_cast<JSObject *&>(key)));\n    JS_CallObjectTracer(trc, &updated, name);\n    if (updated != key)\n        e.rekeyFront(key, updated);\n}\n\n/*\n * Trace an object that is known to always be tenured.  No post barriers are\n * required in this case.\n */\nextern JS_PUBLIC_API(void)\nJS_CallTenuredObjectTracer(JSTracer *trc, JS::TenuredHeap<JSObject *> *objp, const char *name);\n\n/*\n * API for JSTraceCallback implementations.\n */\nextern JS_PUBLIC_API(void)\nJS_TracerInit(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);\n\nextern JS_PUBLIC_API(void)\nJS_TraceRuntime(JSTracer *trc);\n\nextern JS_PUBLIC_API(void)\nJS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc,\n                     void *thing, JSGCTraceKind kind, JSBool includeDetails);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize);\n\n#ifdef DEBUG\n\n/*\n * DEBUG-only method to dump the object graph of heap-allocated things.\n *\n * fp:              file for the dump output.\n * start:           when non-null, dump only things reachable from start\n *                  thing. Otherwise dump all things reachable from the\n *                  runtime roots.\n * startKind:       trace kind of start if start is not null. Must be\n *                  JSTRACE_OBJECT when start is null.\n * thingToFind:     dump only paths in the object graph leading to thingToFind\n *                  when non-null.\n * maxDepth:        the upper bound on the number of edges to descend from the\n *                  graph roots.\n * thingToIgnore:   thing to ignore during the graph traversal when non-null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind,\n            void *thingToFind, size_t maxDepth, void *thingToIgnore);\n\n#endif\n\n/*\n * Garbage collector API.\n */\nextern JS_PUBLIC_API(void)\nJS_GC(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_MaybeGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCCallback(JSRuntime *rt, JSGCCallback cb, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGCMarkingTracer(JSTracer *trc);\n\n/*\n * JS_IsAboutToBeFinalized checks if the given object is going to be finalized\n * at the end of the current GC. When called outside of the context of a GC,\n * this function will return false. Typically this function is used on weak\n * references, where the reference should be nulled out or destroyed if the\n * given object is about to be finalized.\n *\n * The argument to JS_IsAboutToBeFinalized is an in-out param: when the\n * function returns false, the object being referenced is still alive, but the\n * garbage collector might have moved it. In this case, the reference passed\n * to JS_IsAboutToBeFinalized will be updated to the object's new location.\n * Callers of this method are responsible for updating any state that is\n * dependent on the object's address. For example, if the object's address is\n * used as a key in a hashtable, then the object must be removed and\n * re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalized(JS::Heap<JSObject *> *objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalizedUnbarriered(JSObject **objp);\n\ntypedef enum JSGCParamKey {\n    /* Maximum nominal heap before last ditch GC. */\n    JSGC_MAX_BYTES          = 0,\n\n    /* Number of JS_malloc bytes before last ditch GC. */\n    JSGC_MAX_MALLOC_BYTES   = 1,\n\n    /* Amount of bytes allocated by the GC. */\n    JSGC_BYTES = 3,\n\n    /* Number of times when GC was invoked. */\n    JSGC_NUMBER = 4,\n\n    /* Max size of the code cache in bytes. */\n    JSGC_MAX_CODE_CACHE_BYTES = 5,\n\n    /* Select GC mode. */\n    JSGC_MODE = 6,\n\n    /* Number of cached empty GC chunks. */\n    JSGC_UNUSED_CHUNKS = 7,\n\n    /* Total number of allocated GC chunks. */\n    JSGC_TOTAL_CHUNKS = 8,\n\n    /* Max milliseconds to spend in an incremental GC slice. */\n    JSGC_SLICE_TIME_BUDGET = 9,\n\n    /* Maximum size the GC mark stack can grow to. */\n    JSGC_MARK_STACK_LIMIT = 10,\n\n    /*\n     * GCs less than this far apart in time will be considered 'high-frequency GCs'.\n     * See setGCLastBytes in jsgc.cpp.\n     */\n    JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11,\n\n    /* Start of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_LOW_LIMIT = 12,\n\n    /* End of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_HIGH_LIMIT = 13,\n\n    /* Upper bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX = 14,\n\n    /* Lower bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN = 15,\n\n    /* Heap growth for low frequency GCs. */\n    JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16,\n\n    /*\n     * If false, the heap growth factor is fixed at 3. If true, it is determined\n     * based on whether GCs are high- or low- frequency.\n     */\n    JSGC_DYNAMIC_HEAP_GROWTH = 17,\n\n    /* If true, high-frequency GCs will use a longer mark slice. */\n    JSGC_DYNAMIC_MARK_SLICE = 18,\n\n    /* Number of megabytes of analysis data to allocate before purging. */\n    JSGC_ANALYSIS_PURGE_TRIGGER = 19,\n\n    /* Lower limit after which we limit the heap growth. */\n    JSGC_ALLOCATION_THRESHOLD = 20,\n\n    /*\n     * We decommit memory lazily. If more than this number of megabytes is\n     * available to be decommitted, then JS_MaybeGC will trigger a shrinking GC\n     * to decommit it.\n     */\n    JSGC_DECOMMIT_THRESHOLD = 21\n} JSGCParamKey;\n\ntypedef enum JSGCMode {\n    /* Perform only global GCs. */\n    JSGC_MODE_GLOBAL = 0,\n\n    /* Perform per-compartment GCs until too much garbage has accumulated. */\n    JSGC_MODE_COMPARTMENT = 1,\n\n    /*\n     * Collect in short time slices rather than all at once. Implies\n     * JSGC_MODE_COMPARTMENT.\n     */\n    JSGC_MODE_INCREMENTAL = 2\n} JSGCMode;\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);\n\n/*\n * Create a new JSString whose chars member refers to external memory, i.e.,\n * memory requiring application-specific finalization.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewExternalString(JSContext *cx, const jschar *chars, size_t length,\n                     const JSStringFinalizer *fin);\n\n/*\n * Return whether 'str' was created with JS_NewExternalString or\n * JS_NewExternalStringWithClosure.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExternalString(JSString *str);\n\n/*\n * Return the 'closure' arg passed to JS_NewExternalStringWithClosure or NULL\n * if the external string was created via JS_NewExternalString.\n */\nextern JS_PUBLIC_API(const JSStringFinalizer *)\nJS_GetExternalStringFinalizer(JSString *str);\n\n/*\n * Set the size of the native stack that should not be exceed. To disable\n * stack size checking pass 0.\n */\nextern JS_PUBLIC_API(void)\nJS_SetNativeStackQuota(JSRuntime *cx, size_t stackSize);\n\n/************************************************************************/\n\n/*\n * Classes, objects, and properties.\n */\ntypedef void (*JSClassInternal)();\n\nstruct JSClass {\n    const char          *name;\n    uint32_t            flags;\n\n    /* Mandatory function pointer members. */\n    JSPropertyOp        addProperty;\n    JSDeletePropertyOp  delProperty;\n    JSPropertyOp        getProperty;\n    JSStrictPropertyOp  setProperty;\n    JSEnumerateOp       enumerate;\n    JSResolveOp         resolve;\n    JSConvertOp         convert;\n\n    /* Optional members (may be null). */\n    JSFinalizeOp        finalize;\n    JSCheckAccessOp     checkAccess;\n    JSNative            call;\n    JSHasInstanceOp     hasInstance;\n    JSNative            construct;\n    JSTraceOp           trace;\n\n    void                *reserved[40];\n};\n\n#define JSCLASS_HAS_PRIVATE             (1<<0)  /* objects have private slot */\n#define JSCLASS_NEW_ENUMERATE           (1<<1)  /* has JSNewEnumerateOp hook */\n#define JSCLASS_NEW_RESOLVE             (1<<2)  /* has JSNewResolveOp hook */\n#define JSCLASS_PRIVATE_IS_NSISUPPORTS  (1<<3)  /* private is (nsISupports *) */\n#define JSCLASS_IS_DOMJSCLASS           (1<<4)  /* objects are DOM */\n#define JSCLASS_IMPLEMENTS_BARRIERS     (1<<5)  /* Correctly implements GC read\n                                                   and write barriers */\n#define JSCLASS_EMULATES_UNDEFINED      (1<<6)  /* objects of this class act\n                                                   like the value undefined,\n                                                   in some contexts */\n#define JSCLASS_USERBIT1                (1<<7)  /* Reserved for embeddings. */\n\n/*\n * To reserve slots fetched and stored via JS_Get/SetReservedSlot, bitwise-or\n * JSCLASS_HAS_RESERVED_SLOTS(n) into the initializer for JSClass.flags, where\n * n is a constant in [1, 255].  Reserved slots are indexed from 0 to n-1.\n */\n#define JSCLASS_RESERVED_SLOTS_SHIFT    8       /* room for 8 flags below */\n#define JSCLASS_RESERVED_SLOTS_WIDTH    8       /* and 16 above this field */\n#define JSCLASS_RESERVED_SLOTS_MASK     JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)\n#define JSCLASS_HAS_RESERVED_SLOTS(n)   (((n) & JSCLASS_RESERVED_SLOTS_MASK)  \\\n                                         << JSCLASS_RESERVED_SLOTS_SHIFT)\n#define JSCLASS_RESERVED_SLOTS(clasp)   (((clasp)->flags                      \\\n                                          >> JSCLASS_RESERVED_SLOTS_SHIFT)    \\\n                                         & JSCLASS_RESERVED_SLOTS_MASK)\n\n#define JSCLASS_HIGH_FLAGS_SHIFT        (JSCLASS_RESERVED_SLOTS_SHIFT +       \\\n                                         JSCLASS_RESERVED_SLOTS_WIDTH)\n\n#define JSCLASS_IS_ANONYMOUS            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))\n#define JSCLASS_IS_GLOBAL               (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))\n#define JSCLASS_INTERNAL_FLAG2          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))\n#define JSCLASS_INTERNAL_FLAG3          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))\n\n/* Indicate whether the proto or ctor should be frozen. */\n#define JSCLASS_FREEZE_PROTO            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))\n#define JSCLASS_FREEZE_CTOR             (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))\n\n/* Reserved for embeddings. */\n#define JSCLASS_USERBIT2                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))\n#define JSCLASS_USERBIT3                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))\n\n#define JSCLASS_BACKGROUND_FINALIZE     (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))\n\n/*\n * Bits 26 through 31 are reserved for the CACHED_PROTO_KEY mechanism, see\n * below.\n */\n\n/* Global flags. */\n#define JSGLOBAL_FLAGS_CLEARED          0x1\n\n/*\n * ECMA-262 requires that most constructors used internally create objects\n * with \"the original Foo.prototype value\" as their [[Prototype]] (__proto__)\n * member initial value.  The \"original ... value\" verbiage is there because\n * in ECMA-262, global properties naming class objects are read/write and\n * deleteable, for the most part.\n *\n * Implementing this efficiently requires that global objects have classes\n * with the following flags. Failure to use JSCLASS_GLOBAL_FLAGS was\n * prevously allowed, but is now an ES5 violation and thus unsupported.\n */\n#define JSCLASS_GLOBAL_SLOT_COUNT      (JSProto_LIMIT * 3 + 25)\n#define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n)                                    \\\n    (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))\n#define JSCLASS_GLOBAL_FLAGS                                                  \\\n    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)\n#define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp)                              \\\n  (((clasp)->flags & JSCLASS_IS_GLOBAL)                                       \\\n   && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)\n\n/* Fast access to the original value of each standard class's prototype. */\n#define JSCLASS_CACHED_PROTO_SHIFT      (JSCLASS_HIGH_FLAGS_SHIFT + 10)\n#define JSCLASS_CACHED_PROTO_WIDTH      6\n#define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)\n#define JSCLASS_HAS_CACHED_PROTO(key)   (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)\n#define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey)                         \\\n                                         (((clasp)->flags                     \\\n                                           >> JSCLASS_CACHED_PROTO_SHIFT)     \\\n                                          & JSCLASS_CACHED_PROTO_MASK))\n\n/* Initializer for unused members of statically initialized JSClass structs. */\n#define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n#define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS\n\nextern JS_PUBLIC_API(int)\nJS_IdArrayLength(JSContext *cx, JSIdArray *ida);\n\nextern JS_PUBLIC_API(jsid)\nJS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyIdArray(JSContext *cx, JSIdArray *ida);\n\nnamespace JS {\n\nclass AutoIdArray : private AutoGCRooter\n{\n  public:\n    AutoIdArray(JSContext *cx, JSIdArray *ida\n                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, IDARRAY), context(cx), idArray(ida)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~AutoIdArray() {\n        if (idArray)\n            JS_DestroyIdArray(context, idArray);\n    }\n    bool operator!() {\n        return !idArray;\n    }\n    jsid operator[](size_t i) const {\n        JS_ASSERT(idArray);\n        JS_ASSERT(i < length());\n        return JS_IdArrayGet(context, idArray, i);\n    }\n    size_t length() const {\n        return JS_IdArrayLength(context, idArray);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n    JSIdArray *steal() {\n        JSIdArray *copy = idArray;\n        idArray = NULL;\n        return copy;\n    }\n\n  protected:\n    inline void trace(JSTracer *trc);\n\n  private:\n    JSContext *context;\n    JSIdArray *idArray;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* No copy or assignment semantics. */\n    AutoIdArray(AutoIdArray &ida) MOZ_DELETE;\n    void operator=(AutoIdArray &ida) MOZ_DELETE;\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToId(JSContext *cx, jsval v, jsid *idp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IdToValue(JSContext *cx, jsid id, jsval *vp);\n\n/*\n * JSNewResolveOp flag bits.\n */\n#define JSRESOLVE_ASSIGNING     0x01    /* resolve on the left of assignment */\n\n/*\n * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on\n * the specified object, computing a primitive default value for the object.\n * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On\n * success the resulting value is stored in *vp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictPropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                      JSBool *succeeded);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStub(JSContext *cx, JS::Handle<JSObject*> obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertStub(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n               JS::MutableHandle<JS::Value> vp);\n\nstruct JSConstDoubleSpec {\n    double          dval;\n    const char      *name;\n    uint8_t         flags;\n    uint8_t         spare[3];\n};\n\ntypedef struct JSJitInfo JSJitInfo;\n\n/*\n * Wrappers to replace {Strict,}PropertyOp for JSPropertySpecs. This will allow\n * us to pass one JSJitInfo per function with the property spec, without\n * additional field overhead.\n */\ntypedef struct JSStrictPropertyOpWrapper {\n    JSStrictPropertyOp  op;\n    const JSJitInfo     *info;\n} JSStrictPropertyOpWrapper;\n\ntypedef struct JSPropertyOpWrapper {\n    JSPropertyOp        op;\n    const JSJitInfo     *info;\n} JSPropertyOpWrapper;\n\n/*\n * Wrapper to do as above, but for JSNatives for JSFunctionSpecs.\n */\ntypedef struct JSNativeWrapper {\n    JSNative        op;\n    const JSJitInfo *info;\n} JSNativeWrapper;\n\n/*\n * Macro static initializers which make it easy to pass no JSJitInfo as part of a\n * JSPropertySpec or JSFunctionSpec.\n */\n#define JSOP_WRAPPER(op) {op, NULL}\n#define JSOP_NULLWRAPPER JSOP_WRAPPER(NULL)\n\n/*\n * To define an array element rather than a named property member, cast the\n * element's index to (const char *) and initialize name with it, and set the\n * JSPROP_INDEX bit in flags.\n */\nstruct JSPropertySpec {\n    const char                  *name;\n    int8_t                      tinyid;\n    uint8_t                     flags;\n    JSPropertyOpWrapper         getter;\n    JSStrictPropertyOpWrapper   setter;\n};\n\nnamespace JS {\nnamespace detail {\n\n/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_NATIVE_TO only. */\ninline int CheckIsNative(JSNative native);\n\n} // namespace detail\n} // namespace JS\n\n#define JS_CAST_NATIVE_TO(v, To) \\\n  (static_cast<void>(sizeof(JS::detail::CheckIsNative(v))), \\\n   reinterpret_cast<To>(v))\n\n/*\n * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function\n * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be\n * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform\n * type-safe casts.\n */\n#define JS_PSG(name, getter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_NULLWRAPPER}\n#define JS_PSGS(name, getter, setter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(setter, JSStrictPropertyOp))}\n#define JS_PS_END {0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\n/*\n * To define a native function, set call to a JSNativeWrapper. To define a\n * self-hosted function, set selfHostedName to the name of a function\n * compiled during JSRuntime::initSelfHosting.\n */\nstruct JSFunctionSpec {\n    const char      *name;\n    JSNativeWrapper call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *selfHostedName;\n};\n\n/*\n * Terminating sentinel initializer to put at the end of a JSFunctionSpec array\n * that's passed to JS_DefineFunctions or JS_InitClass.\n */\n#define JS_FS_END JS_FS(NULL,NULL,0,0)\n\n/*\n * Initializer macros for a JSFunctionSpec array element. JS_FN (whose name\n * pays homage to the old JSNative/JSFastNative split) simply adds the flag\n * JSFUN_STUB_GSOPS. JS_FNINFO allows the simple adding of JSJitInfos.\n */\n#define JS_FS(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, flags}\n#define JS_FN(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, (flags) | JSFUN_STUB_GSOPS}\n#define JS_FNINFO(name,call,info,nargs,flags)                                 \\\n    {name,{call,info},nargs,flags}\n\nextern JS_PUBLIC_API(JSObject *)\nJS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n             JSClass *clasp, JSNative constructor, unsigned nargs,\n             const JSPropertySpec *ps, const JSFunctionSpec *fs,\n             const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\n/*\n * Set up ctor.prototype = proto and proto.constructor = ctor with the\n * right property flags.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);\n\nextern JS_PUBLIC_API(JSClass *)\nJS_GetClass(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(void *)\nJS_GetPrivate(JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_SetPrivate(JSObject *obj, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp,\n                      jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> protop);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<JSObject*> proto);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParent(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetConstructor(JSContext *cx, JSObject *proto);\n\n/*\n * Get a unique identifier for obj, good for the lifetime of obj (even if it\n * is moved by a copying GC).  Return false on failure (likely out of memory),\n * and true with *idp containing the unique id on success.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);\n\nnamespace JS {\n\nenum {\n    FreshZone,\n    SystemZone,\n    SpecificZones\n};\n\ntypedef uintptr_t ZoneSpecifier;\n\ninline ZoneSpecifier\nSameZoneAs(JSObject *obj)\n{\n    JS_ASSERT(uintptr_t(obj) > SpecificZones);\n    return ZoneSpecifier(obj);\n}\n\nstruct JS_PUBLIC_API(CompartmentOptions) {\n    ZoneSpecifier zoneSpec;\n    JSVersion version;\n    bool invisibleToDebugger;\n\n    explicit CompartmentOptions() : zoneSpec(JS::FreshZone)\n                                  , version(JSVERSION_UNKNOWN)\n                                  , invisibleToDebugger(false)\n    {}\n\n    CompartmentOptions &setZone(ZoneSpecifier spec) { zoneSpec = spec; return *this; }\n    CompartmentOptions &setVersion(JSVersion version_) {\n        JS_ASSERT(version_ != JSVERSION_UNKNOWN);\n        version = version_;\n        return *this;\n    }\n\n    // Certain scopes (i.e. XBL compilation scopes) are implementation details\n    // of the embedding, and references to them should never leak out to script.\n    // This flag causes the this compartment to skip firing onNewGlobalObject\n    // and makes addDebuggee a no-op for this global.\n    CompartmentOptions &setInvisibleToDebugger(bool invisible) {\n        invisibleToDebugger = invisible;\n        return *this;\n    }\n};\n\n// During global creation, we fire notifications to callbacks registered\n// via the Debugger API. These callbacks are arbitrary script, and can touch\n// the global in arbitrary ways. When that happens, the global should not be\n// in a half-baked state. But this creates a problem for consumers that need\n// to set slots on the global to put it in a consistent state.\n//\n// This API provides a way for consumers to set slots atomically (immediately\n// after the global is created), before any debugger hooks are fired. It's\n// unfortunately on the clunky side, but that's the way the cookie crumbles.\n//\n// If callers have no additional state on the global to set up, they may pass\n// |FireOnNewGlobalHook| to JS_NewGlobalObject, which causes that function to\n// fire the hook as its final act before returning. Otherwise, callers should\n// pass |DontFireOnNewGlobalHook|, which means that they are responsible for\n// invoking JS_FireOnNewGlobalObject upon successfully creating the global. If\n// an error occurs and the operation aborts, callers should skip firing the\n// hook. But otherwise, callers must take care to fire the hook exactly once\n// before compiling any script in the global's scope (we have assertions in\n// place to enforce this). This lets us be sure that debugger clients never miss\n// breakpoints.\nenum OnNewGlobalHookOption {\n    FireOnNewGlobalHook,\n    DontFireOnNewGlobalHook\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals,\n                   JS::OnNewGlobalHookOption hookOption,\n                   const JS::CompartmentOptions &options = JS::CompartmentOptions());\n\nextern JS_PUBLIC_API(void)\nJS_FireOnNewGlobalObject(JSContext *cx, JS::HandleObject global);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\n/* Queries the [[Extensible]] property of the object. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExtensible(JSContext *cx, JS::HandleObject obj, JSBool *extensible);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNative(JSObject *obj);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetObjectRuntime(JSObject *obj);\n\n/*\n * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default\n * proto if proto's actual parameter value is null.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,\n                           JSObject *parent);\n\n/*\n * Freeze obj, and all objects it refers to, recursively. This will not recurse\n * through non-extensible objects, on the assumption that those are already\n * deep-frozen.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DeepFreezeObject(JSContext *cx, JSObject *obj);\n\n/*\n * Freezes an object; see ES5's Object.freeze(obj) method.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_FreezeObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PreventExtensions(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_New(JSContext *cx, JSObject *ctor, unsigned argc, jsval *argv);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp,\n                JSObject *proto, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineConstDoubles(JSContext *cx, JSObject *obj, const JSConstDoubleSpec *cds);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,\n                  JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,\n                      JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                   const char *name,\n                                   unsigned *attrsp, JSBool *foundp,\n                                   JSPropertyOp *getterp,\n                                   JSStrictPropertyOp *setterp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,\n                                       jsid id,\n                                       unsigned *attrsp, JSBool *foundp,\n                                       JSPropertyOp *getterp,\n                                       JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned attrs, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,\n                            int8_t tinyid, jsval value,\n                            JSPropertyOp getter, JSStrictPropertyOp setter,\n                            unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,\n                         JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id,\n                             JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name,\n                           unsigned flags, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,\n                               unsigned flags, JSObject **objp, JS::MutableHandle<JS::Value> vp);\n\nstruct JSPropertyDescriptor {\n    JSObject           *obj;\n    unsigned           attrs;\n    unsigned           shortid;\n    JSPropertyOp       getter;\n    JSStrictPropertyOp setter;\n    JS::Value          value;\n\n    JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL),\n                             setter(NULL), value(JSVAL_VOID)\n    {}\n\n    void trace(JSTracer *trc);\n};\n\nnamespace JS {\n\ntemplate <typename Outer>\nclass PropertyDescriptorOperations\n{\n    const JSPropertyDescriptor * desc() const { return static_cast<const Outer*>(this)->extract(); }\n    JSPropertyDescriptor * desc() { return static_cast<Outer*>(this)->extract(); }\n\n  public:\n    bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; }\n    bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; }\n    bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; }\n    bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; }\n    bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; }\n    bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; }\n    bool isShared() const { return desc()->attrs & JSPROP_SHARED; }\n    bool isIndex() const { return desc()->attrs & JSPROP_INDEX; }\n    bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; }\n    bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; }\n\n    JS::MutableHandleObject object() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); }\n    unsigned attributes() const { return desc()->attrs; }\n    unsigned shortid() const {\n        MOZ_ASSERT(hasShortId());\n        return desc()->shortid;\n    }\n    JSPropertyOp getter() const { return desc()->getter; }\n    JSStrictPropertyOp setter() const { return desc()->setter; }\n    JS::HandleObject getterObject() const {\n        MOZ_ASSERT(hasGetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->getter));\n    }\n    JS::HandleObject setterObject() const {\n        MOZ_ASSERT(hasSetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->setter));\n    }\n    JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); }\n\n    void setAttributes(unsigned attrs) { desc()->attrs = attrs; }\n    void setShortId(unsigned id) { desc()->shortid = id; }\n    void setGetter(JSPropertyOp op) { desc()->getter = op; }\n    void setSetter(JSStrictPropertyOp op) { desc()->setter = op; }\n    void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast<JSPropertyOp>(obj); }\n    void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast<JSStrictPropertyOp>(obj); }\n};\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <>\nstruct GCMethods<JSPropertyDescriptor> {\n    static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); }\n    static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; }\n    static bool poisoned(const JSPropertyDescriptor &desc) {\n        return (desc.obj && JS::IsPoisonedPtr(desc.obj)) ||\n               (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) ||\n               (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) ||\n               (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing()));\n    }\n};\n\ntemplate <>\nclass RootedBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\ntemplate <>\nclass HandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Handle<JSPropertyDescriptor>*>(this)->address();\n    }\n  public:\n    JS::HandleValue value() const { return JS::HandleValue::fromMarkedLocation(&extract()->value); }\n    JS::HandleObject obj() const { return JS::HandleObject::fromMarkedLocation(&extract()->obj); }\n};\n\ntemplate <>\nclass MutableHandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\n} /* namespace js */\n\n/*\n * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on\n * an object on the prototype chain (returned in objp). If data->obj is null,\n * then this property was not found on the prototype chain.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags,\n                             JSPropertyDescriptor *desc);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def,\n                          JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf,\n                        JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name,\n                   JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, jsval value,\n                    JSPropertyOp getter, JSStrictPropertyOp setter,\n                    unsigned attrs);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                     const jschar *name, size_t namelen,\n                                     unsigned *attrsp, JSBool *foundp,\n                                     JSPropertyOp *getterp,\n                                     JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned attrs, JSBool *foundp);\n\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,\n                              const jschar *name, size_t namelen,\n                              int8_t tinyid, jsval value,\n                              JSPropertyOp getter, JSStrictPropertyOp setter,\n                              unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,\n                           size_t namelen, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JSBool *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen,\n                    JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteUCProperty2(JSContext *cx, JSObject *obj,\n                     const jschar *name, size_t namelen,\n                     JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayObject(JSContext *cx, int length, jsval *vector);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsArrayObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,\n                 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp);\n\n/*\n * Get the property with name given by |index|, if it has one.  If\n * not, |*present| will be set to false and the value of |vp| must not\n * be relied on.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp, JSBool* present);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);\n\n/*\n * Remove all configurable properties from the given (non-global) object and\n * assign undefined to all writable data properties.\n */\nJS_PUBLIC_API(void)\nJS_ClearNonGlobalObject(JSContext *cx, JSObject *objArg);\n\n/*\n * Assign 'undefined' to all of the object's non-reserved slots. Note: this is\n * done for all slots, regardless of the associated property descriptor.\n */\nJS_PUBLIC_API(void)\nJS_SetAllNonReservedSlotsToUndefined(JSContext *cx, JSObject *objArg);\n\n/*\n * Create a new array buffer with the given contents, which must have been\n * returned by JS_AllocateArrayBufferContents or JS_StealArrayBufferContents.\n * The new array buffer takes ownership. After calling this function, do not\n * free |contents| or use |contents| from another thread.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayBufferWithContents(JSContext *cx, void *contents);\n\n/*\n * Steal the contents of the given array buffer. The array buffer has its\n * length set to 0 and its contents array cleared. The caller takes ownership\n * of |*contents| and must free it or transfer ownership via\n * JS_NewArrayBufferWithContents when done using it.\n * To free |*contents|, call free().\n * A pointer to the buffer's data is returned in |*data|. This pointer can\n * be used until |*contents| is freed or has its ownership transferred.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents,\n                            uint8_t **data);\n\n/*\n * Allocate memory that may be eventually passed to\n * JS_NewArrayBufferWithContents. |nbytes| is the number of payload bytes\n * required. The pointer to pass to JS_NewArrayBufferWithContents is returned\n * in |contents|. The pointer to the |nbytes| of usable memory is returned in\n * |data|. (*|contents| will contain a header before |data|.) The only legal\n * operations on *|contents| is to free it, or pass it to\n * JS_NewArrayBufferWithContents or JS_ReallocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\n/*\n * Reallocate memory allocated by JS_AllocateArrayBufferContents, growing or shrinking it\n * as appropriate.  The new data pointer will be returned in data.  If *contents is NULL,\n * behaves like JS_AllocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\nextern JS_PUBLIC_API(JSIdArray *)\nJS_Enumerate(JSContext *cx, JSObject *obj);\n\n/*\n * Create an object to iterate over enumerable properties of obj, in arbitrary\n * property definition order.  NB: This differs from longstanding for..in loop\n * order, which uses order of property definition in obj.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewPropertyIterator(JSContext *cx, JSObject *obj);\n\n/*\n * Return true on success with *idp containing the id of the next enumerable\n * property to visit using iterobj, or JSID_IS_VOID if there is no such property\n * left to visit.  Return false on error.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);\n\n/*\n * A JSNative that creates and returns a new iterator that iterates over the\n * elements of |this|, up to |this.length|, in index order. This can be used to\n * make any array-like object iterable. Just give the object an obj.iterator()\n * method using this JSNative as the implementation.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,\n               jsval *vp, unsigned *attrsp);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetReservedSlot(JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(void)\nJS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v);\n\n/************************************************************************/\n\n/*\n * Security protocol.\n */\nstruct JSPrincipals {\n    /* Don't call \"destroy\"; use reference counting macros below. */\n    int refcount;\n\n#ifdef DEBUG\n    /* A helper to facilitate principals debugging. */\n    uint32_t    debugToken;\n#endif\n\n    void setDebugToken(uint32_t token) {\n# ifdef DEBUG\n        debugToken = token;\n# endif\n    }\n\n    /*\n     * This is not defined by the JS engine but should be provided by the\n     * embedding.\n     */\n    JS_PUBLIC_API(void) dump();\n};\n\nextern JS_PUBLIC_API(void)\nJS_HoldPrincipals(JSPrincipals *principals);\n\nextern JS_PUBLIC_API(void)\nJS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);\n\nstruct JSSecurityCallbacks {\n    JSCheckAccessOp            checkObjectAccess;\n    JSCSPEvalChecker           contentSecurityPolicyAllows;\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetSecurityCallbacks(JSRuntime *rt, const JSSecurityCallbacks *callbacks);\n\nextern JS_PUBLIC_API(const JSSecurityCallbacks *)\nJS_GetSecurityCallbacks(JSRuntime *rt);\n\n/*\n * Code running with \"trusted\" principals will be given a deeper stack\n * allocation than ordinary scripts. This allows trusted script to run after\n * untrusted script has exhausted the stack. This function sets the\n * runtime-wide trusted principal.\n *\n * This principals is not held (via JS_HoldPrincipals/JS_DropPrincipals) since\n * there is no available JSContext. Instead, the caller must ensure that the\n * given principals stays valid for as long as 'rt' may point to it. If the\n * principals would be destroyed before 'rt', JS_SetTrustedPrincipals must be\n * called again, passing NULL for 'prin'.\n */\nextern JS_PUBLIC_API(void)\nJS_SetTrustedPrincipals(JSRuntime *rt, JSPrincipals *prin);\n\n/*\n * Initialize the callback that is called to destroy JSPrincipals instance\n * when its reference counter drops to zero. The initialization can be done\n * only once per JS runtime.\n */\nextern JS_PUBLIC_API(void)\nJS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPrincipals);\n\n/************************************************************************/\n\n/*\n * Functions and scripts.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n               JSObject *parent, const char *name);\n\n/*\n * Create the function with the name given by the id. JSID_IS_STRING(id) must\n * be true.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                   JSObject *parent, jsid id);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionObject(JSFunction *fun);\n\n/*\n * Return the function's identifier as a JSString, or null if fun is unnamed.\n * The returned string lives as long as fun, so you don't need to root a saved\n * reference to it if fun is well-connected or rooted, and provided you bound\n * the use of the saved reference by fun's lifetime.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionId(JSFunction *fun);\n\n/*\n * Return a function's display name. This is the defined name if one was given\n * where the function was defined, or it could be an inferred name by the JS\n * engine in the case that the function was defined to be anonymous. This can\n * still return NULL if a useful display name could not be inferred. The same\n * restrictions on rooting as those in JS_GetFunctionId apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionDisplayId(JSFunction *fun);\n\n/*\n * Return the arity (length) of fun.\n */\nextern JS_PUBLIC_API(uint16_t)\nJS_GetFunctionArity(JSFunction *fun);\n\n/*\n * Infallible predicate to test whether obj is a function object (faster than\n * comparing obj's class name to \"Function\", but equivalent unless someone has\n * overwritten the \"Function\" identifier with a different constructor and then\n * created instances using that constructor that might be passed in as obj).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsFunction(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsCallable(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNativeFunction(JSObject *funobj, JSNative call);\n\n/* Return whether the given function is a valid constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsConstructor(JSFunction *fun);\n\n/*\n * Bind the given callable to use the given object as \"this\".\n *\n * If |callable| is not callable, will throw and return NULL.\n */\nextern JS_PUBLIC_API(JSObject*)\nJS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                  unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineUCFunction(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, JSNative call,\n                    unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,\n                      unsigned nargs, unsigned attrs);\n\n/*\n * Clone a top-level function into a new scope. This function will dynamically\n * fail if funobj was lexically nested inside some other function.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);\n\n/*\n * Given a buffer, return JS_FALSE if the buffer might become a valid\n * javascript statement with the addition of more lines.  Otherwise return\n * JS_TRUE.  The intent is to support interactive compilation - accumulate\n * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to\n * the compiler.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScript(JSContext *cx, JSObject *obj,\n                 const char *ascii, size_t length,\n                 const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,\n                              JSPrincipals *principals,\n                              const char *ascii, size_t length,\n                              const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScript(JSContext *cx, JSObject *obj,\n                   const jschar *chars, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals,\n                                const jschar *chars, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalFromScript(JSScript *script);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,\n                   unsigned nargs, const char **argnames,\n                   const char *bytes, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals, const char *name,\n                                unsigned nargs, const char **argnames,\n                                const char *bytes, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileUCFunction(JSContext *cx, JSObject *obj, const char *name,\n                     unsigned nargs, const char **argnames,\n                     const jschar *chars, size_t length,\n                     const char *filename, unsigned lineno);\n\nnamespace JS {\n\n/* Options for JavaScript compilation. */\nclass JS_PUBLIC_API(CompileOptions)\n{\n    JSPrincipals *principals_;\n    JSPrincipals *originPrincipals_;\n\n  public:\n    JSPrincipals *principals() const { return principals_; }\n    JSPrincipals *originPrincipals() const;\n\n    JSVersion version;\n    bool versionSet;\n    bool utf8;\n    const char *filename;\n    unsigned lineno;\n    unsigned column;\n    HandleObject element;\n    bool compileAndGo;\n    bool forEval;\n    bool noScriptRval;\n    bool selfHostingMode;\n    bool canLazilyParse;\n    bool strictOption;\n    bool extraWarningsOption;\n    bool werrorOption;\n    bool asmJSOption;\n    enum SourcePolicy {\n        NO_SOURCE,\n        LAZY_SOURCE,\n        SAVE_SOURCE\n    } sourcePolicy;\n\n    explicit CompileOptions(JSContext *cx, JSVersion version = JSVERSION_UNKNOWN);\n    CompileOptions &setPrincipals(JSPrincipals *p) { principals_ = p; return *this; }\n    CompileOptions &setOriginPrincipals(JSPrincipals *p) { originPrincipals_ = p; return *this; }\n    CompileOptions &setVersion(JSVersion v) { version = v; versionSet = true; return *this; }\n    CompileOptions &setUTF8(bool u) { utf8 = u; return *this; }\n    CompileOptions &setFileAndLine(const char *f, unsigned l) {\n        filename = f; lineno = l; return *this;\n    }\n    CompileOptions &setColumn(unsigned c) { column = c; return *this; }\n    CompileOptions &setElement(HandleObject e) { element = e; return *this; }\n    CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }\n    CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }\n    CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }\n    CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }\n    CompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }\n    CompileOptions &setSourcePolicy(SourcePolicy sp) { sourcePolicy = sp; return *this; }\n};\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, FILE *file);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, const char *filename);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const jschar *chars, size_t length);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * API extension: OR this into indent to avoid pretty-printing the decompiled\n * source resulting from JS_DecompileFunction{,Body}.\n */\n#define JS_DONT_PRETTY_PRINT    ((unsigned)0x8000)\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);\n\n/*\n * NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj\n * parameter as the initial scope chain header, the 'this' keyword value, and\n * the variables object (ECMA parlance for where 'var' and 'function' bind\n * names) of the execution context for script.\n *\n * Using obj as the variables object is problematic if obj's parent (which is\n * the scope chain link; see JS_SetParent and JS_NewObject) is not null: in\n * this case, variables created by 'var x = 0', e.g., go in obj, but variables\n * created by assignment to an unbound id, 'x = 0', go in the last object on\n * the scope chain linked by parent.\n *\n * ECMA calls that last scoping object the \"global object\", but note that many\n * embeddings have several such objects.  ECMA requires that \"global code\" be\n * executed with the variables object equal to this global object.  But these\n * JS API entry points provide freedom to execute code against a \"sub-global\",\n * i.e., a parented or scoped object, in which case the variables object will\n * differ from the last object on the scope chain, resulting in confusing and\n * non-ECMA explicit vs. implicit variable creation.\n *\n * Caveat embedders: unless you already depend on this buggy variables object\n * binding behavior, you should call JS_SetOptions(cx, JSOPTION_VAROBJFIX) or\n * JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_VAROBJFIX) -- the latter if\n * someone may have set other options on cx already -- for each context in the\n * application, if you pass parented objects as the obj parameter, or may ever\n * pass such objects in the future.\n *\n * Why a runtime option?  The alternative is to add six or so new API entry\n * points with signatures matching the following six, and that doesn't seem\n * worth the code bloat cost.  Such new entry points would probably have less\n * obvious names, too, so would not tend to be used.  The JS_SetOption call,\n * OTOH, can be more easily hacked into existing code that does not depend on\n * the bug; such code can continue to use the familiar JS_EvaluateScript,\n * etc., entry points.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,\n                        JSVersion version);\n\n/*\n * Execute either the function-defining prolog of a script, or the script's\n * main body, but not both.\n */\ntypedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart;\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScript(JSContext *cx, JSObject *obj,\n                  const char *bytes, unsigned length,\n                  const char *filename, unsigned lineno,\n                  jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,\n                               JSPrincipals *principals,\n                               const char *bytes, unsigned length,\n                               const char *filename, unsigned lineno,\n                               jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                      JSPrincipals *principals,\n                                      const char *bytes, unsigned length,\n                                      const char *filename, unsigned lineno,\n                                      jsval *rval, JSVersion version);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScript(JSContext *cx, JSObject *obj,\n                    const jschar *chars, unsigned length,\n                    const char *filename, unsigned lineno,\n                    jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                 JSPrincipals *principals,\n                                 const jschar *chars, unsigned length,\n                                 const char *filename, unsigned lineno,\n                                 jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                        JSPrincipals *principals,\n                                        const jschar *chars, unsigned length,\n                                        const char *filename, unsigned lineno,\n                                        jsval *rval, JSVersion version);\n\n/*\n * JSAPI clients may optionally specify the 'originPrincipals' of a script.\n * A script's originPrincipals may be retrieved through the debug API (via\n * JS_GetScriptOriginPrincipals) and the originPrincipals are transitively\n * assigned to any nested scripts (including scripts dynamically created via\n * eval and the Function constructor). If originPrincipals is null, then the\n * value of principals is used as origin principals for the script.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,\n                                              JSPrincipals *principals,\n                                              JSPrincipals *originPrincipals,\n                                              const jschar *chars, unsigned length,\n                                              const char *filename, unsigned lineno,\n                                              jsval *rval, JSVersion version);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const jschar *chars, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *bytes, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *filename, jsval *rval);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc,\n                jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc,\n                    jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc,\n                     jsval *argv, jsval *rval);\n\nnamespace JS {\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, JSFunction *fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunction(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, const char *name, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionName(cx, thisObj, name, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, jsval fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionValue(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nextern JS_PUBLIC_API(bool)\nCall(JSContext *cx, jsval thisv, jsval fun, unsigned argc, jsval *argv, MutableHandle<Value> rval);\n\nstatic inline bool\nCall(JSContext *cx, jsval thisv, JSObject *funObj, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return Call(cx, thisv, OBJECT_TO_JSVAL(funObj), argc, argv, rval);\n}\n\n} /* namespace JS */\n\n/*\n * These functions allow setting an operation callback that will be called\n * from the JS thread some time after any thread triggered the callback using\n * JS_TriggerOperationCallback(rt).\n *\n * To schedule the GC and for other activities the engine internally triggers\n * operation callbacks. The embedding should thus not rely on callbacks being\n * triggered through the external API only.\n *\n * Important note: Additional callbacks can occur inside the callback handler\n * if it re-enters the JS engine. The embedding must ensure that the callback\n * is disconnected before attempting such re-entry.\n */\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_SetOperationCallback(JSContext *cx, JSOperationCallback callback);\n\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_GetOperationCallback(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_TriggerOperationCallback(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsRunning(JSContext *cx);\n\n/*\n * Saving and restoring frame chains.\n *\n * These two functions are used to set aside cx's call stack while that stack\n * is inactive. After a call to JS_SaveFrameChain, it looks as if there is no\n * code running on cx. Before calling JS_RestoreFrameChain, cx's call stack\n * must be balanced and all nested calls to JS_SaveFrameChain must have had\n * matching JS_RestoreFrameChain calls.\n *\n * JS_SaveFrameChain deals with cx not having any code running on it.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SaveFrameChain(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreFrameChain(JSContext *cx);\n\n#ifdef MOZ_TRACE_JSCALLS\n/*\n * The callback is expected to be quick and noninvasive. It should not\n * trigger interrupts, turn on debugging, or produce uncaught JS\n * exceptions. The state of the stack and registers in the context\n * cannot be relied upon, since this callback may be invoked directly\n * from either JIT. The 'entering' field means we are entering a\n * function if it is positive, leaving a function if it is zero or\n * negative.\n */\nextern JS_PUBLIC_API(void)\nJS_SetFunctionCallback(JSContext *cx, JSFunctionCallback fcb);\n\nextern JS_PUBLIC_API(JSFunctionCallback)\nJS_GetFunctionCallback(JSContext *cx);\n#endif /* MOZ_TRACE_JSCALLS */\n\n/************************************************************************/\n\n/*\n * Strings.\n *\n * NB: JS_NewUCString takes ownership of bytes on success, avoiding a copy;\n * but on error (signified by null return), it leaves chars owned by the\n * caller. So the caller must free bytes in the error case, if it has no use\n * for them. In contrast, all the JS_New*StringCopy* functions do not take\n * ownership of the character memory passed to them -- they copy it.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyN(JSContext *cx, const char *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyZ(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternJSString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternStringN(JSContext *cx, const char *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternString(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCString(JSContext *cx, jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyN(JSContext *cx, const jschar *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyZ(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCString(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FileEscapedString(FILE *fp, JSString *str, char quote);\n\n/*\n * Extracting string characters and length.\n *\n * While getting the length of a string is infallible, getting the chars can\n * fail. As indicated by the lack of a JSContext parameter, there are two\n * special cases where getting the chars is infallible:\n *\n * The first case is interned strings, i.e., strings from JS_InternString or\n * JSID_TO_STRING(id), using JS_GetInternedStringChars*.\n *\n * The second case is \"flat\" strings that have been explicitly prepared in a\n * fallible context by JS_FlattenString. To catch errors, a separate opaque\n * JSFlatString type is returned by JS_FlattenString and expected by\n * JS_GetFlatStringChars. Note, though, that this is purely a syntactic\n * distinction: the input and output of JS_FlattenString are the same actual\n * GC-thing so only one needs to be rooted. If a JSString is known to be flat,\n * JS_ASSERT_STRING_IS_FLAT can be used to make a debug-checked cast. Example:\n *\n *   // in a fallible context\n *   JSFlatString *fstr = JS_FlattenString(cx, str);\n *   if (!fstr)\n *     return JS_FALSE;\n *   JS_ASSERT(fstr == JS_ASSERT_STRING_IS_FLAT(str));\n *\n *   // in an infallible context, for the same 'str'\n *   const jschar *chars = JS_GetFlatStringChars(fstr)\n *   JS_ASSERT(chars);\n *\n * The CharsZ APIs guarantee that the returned array has a null character at\n * chars[length]. This can require additional copying so clients should prefer\n * APIs without CharsZ if possible. The infallible functions also return\n * null-terminated arrays. (There is no additional cost or non-Z alternative\n * for the infallible functions, so 'Z' is left out of the identifier.)\n */\n\nextern JS_PUBLIC_API(size_t)\nJS_GetStringLength(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringChars(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringCharsAndLength(JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZ(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(JSFlatString *)\nJS_FlattenString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetFlatStringChars(JSFlatString *str);\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJSID_TO_FLAT_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSFlatString *)(JSID_BITS(id));\n}\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJS_ASSERT_STRING_IS_FLAT(JSString *str)\n{\n    JS_ASSERT(JS_GetFlatStringChars((JSFlatString *)str));\n    return (JSFlatString *)str;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJS_FORGET_STRING_FLATNESS(JSFlatString *fstr)\n{\n    return (JSString *)fstr;\n}\n\n/*\n * Additional APIs that avoid fallibility when given a flat string.\n */\n\nextern JS_PUBLIC_API(JSBool)\nJS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedFlatString(char *buffer, size_t size, JSFlatString *str, char quote);\n\n/*\n * This function is now obsolete and behaves the same as JS_NewUCString.  Use\n * JS_NewUCString instead.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewGrowableString(JSContext *cx, jschar *chars, size_t length);\n\n/*\n * Create a dependent string, i.e., a string that owns no character storage,\n * but that refers to a slice of another string's chars.  Dependent strings\n * are mutable by definition, so the thread safety comments above apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewDependentString(JSContext *cx, JSString *str, size_t start,\n                      size_t length);\n\n/*\n * Concatenate two strings, possibly resulting in a rope.\n * See above for thread safety comments.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_ConcatStrings(JSContext *cx, JSString *left, JSString *right);\n\n/*\n * For JS_DecodeBytes, set *dstlenp to the size of the destination buffer before\n * the call; on return, *dstlenp contains the number of jschars actually stored.\n * To determine the necessary destination buffer size, make a sizing call that\n * passes NULL for dst.\n *\n * On errors, the functions report the error. In that case, *dstlenp contains\n * the number of characters or bytes transferred so far.  If cx is NULL, no\n * error is reported on failure, and the functions simply return JS_FALSE.\n *\n * NB: This function does not store an additional zero byte or jschar after the\n * transcoded string.\n */\nJS_PUBLIC_API(JSBool)\nJS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst,\n               size_t *dstlenp);\n\n/*\n * A variation on JS_EncodeCharacters where a null terminated string is\n * returned that you are expected to call JS_free on when done.\n */\nJS_PUBLIC_API(char *)\nJS_EncodeString(JSContext *cx, JSString *str);\n\n/*\n * Same behavior as JS_EncodeString(), but encode into UTF-8 string\n */\nJS_PUBLIC_API(char *)\nJS_EncodeStringToUTF8(JSContext *cx, JSString *str);\n\n/*\n * Get number of bytes in the string encoding (without accounting for a\n * terminating zero bytes. The function returns (size_t) -1 if the string\n * can not be encoded into bytes and reports an error using cx accordingly.\n */\nJS_PUBLIC_API(size_t)\nJS_GetStringEncodingLength(JSContext *cx, JSString *str);\n\n/*\n * Encode string into a buffer. The function does not stores an additional\n * zero byte. The function returns (size_t) -1 if the string can not be\n * encoded into bytes with no error reported. Otherwise it returns the number\n * of bytes that are necessary to encode the string. If that exceeds the\n * length parameter, the string will be cut and only length bytes will be\n * written into the buffer.\n */\nJS_PUBLIC_API(size_t)\nJS_EncodeStringToBuffer(JSContext *cx, JSString *str, char *buffer, size_t length);\n\nclass JSAutoByteString\n{\n  public:\n    JSAutoByteString(JSContext *cx, JSString *str\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mBytes(JS_EncodeString(cx, str))\n    {\n        JS_ASSERT(cx);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    JSAutoByteString(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : mBytes(NULL)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoByteString() {\n        js_free(mBytes);\n    }\n\n    /* Take ownership of the given byte array. */\n    void initBytes(char *bytes) {\n        JS_ASSERT(!mBytes);\n        mBytes = bytes;\n    }\n\n    char *encodeLatin1(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeString(cx, str);\n        return mBytes;\n    }\n\n    char *encodeLatin1(js::ContextFriendFields *cx, JSString *str);\n\n    char *encodeUtf8(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeStringToUTF8(cx, str);\n        return mBytes;\n    }\n\n    void clear() {\n        js_free(mBytes);\n        mBytes = NULL;\n    }\n\n    char *ptr() const {\n        return mBytes;\n    }\n\n    bool operator!() const {\n        return !mBytes;\n    }\n\n    size_t length() const {\n        if (!mBytes)\n            return 0;\n        return strlen(mBytes);\n    }\n\n  private:\n    char        *mBytes;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* Copy and assignment are not supported. */\n    JSAutoByteString(const JSAutoByteString &another);\n    JSAutoByteString &operator=(const JSAutoByteString &another);\n};\n\n/************************************************************************/\n/*\n * JSON functions\n */\ntypedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);\n\n/*\n * JSON.stringify as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,\n             JSONWriteCallback callback, void *data);\n\n/*\n * JSON.parse as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle<JS::Value> vp);\n\nJS_PUBLIC_API(JSBool)\nJS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,\n                        jsval *vp);\n\n/************************************************************************/\n\n/* API for the HTML5 internal structured cloning algorithm. */\n\n/* The maximum supported structured-clone serialization format version. */\n#define JS_STRUCTURED_CLONE_VERSION 2\n\nstruct JSStructuredCloneCallbacks {\n    ReadStructuredCloneOp read;\n    WriteStructuredCloneOp write;\n    StructuredCloneErrorOp reportError;\n};\n\n/* Note: if the *data contains transferable objects, it can be read\n * only once */\nJS_PUBLIC_API(JSBool)\nJS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes,\n                       uint32_t version, jsval *vp,\n                       const JSStructuredCloneCallbacks *optionalCallbacks,\n                       void *closure);\n\n/* Note: On success, the caller is responsible for calling\n * JS_ClearStructuredClone(*datap, nbytesp). */\nJS_PUBLIC_API(JSBool)\nJS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,\n                        const JSStructuredCloneCallbacks *optionalCallbacks,\n                        void *closure, jsval transferable);\n\nJS_PUBLIC_API(JSBool)\nJS_ClearStructuredClone(const uint64_t *data, size_t nbytes);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes,\n                                   JSBool *hasTransferable);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredClone(JSContext *cx, jsval v, jsval *vp,\n                   const JSStructuredCloneCallbacks *optionalCallbacks,\n                   void *closure);\n\n/* RAII sugar for JS_WriteStructuredClone. */\nclass JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {\n    uint64_t *data_;\n    size_t nbytes_;\n    uint32_t version_;\n\n  public:\n    JSAutoStructuredCloneBuffer()\n        : data_(NULL), nbytes_(0), version_(JS_STRUCTURED_CLONE_VERSION) {}\n\n    ~JSAutoStructuredCloneBuffer() { clear(); }\n\n    uint64_t *data() const { return data_; }\n    size_t nbytes() const { return nbytes_; }\n\n    void clear();\n\n    /* Copy some memory. It will be automatically freed by the destructor. */\n    bool copy(const uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Adopt some memory. It will be automatically freed by the destructor.\n     * data must have been allocated by the JS engine (e.g., extracted via\n     * JSAutoStructuredCloneBuffer::steal).\n     */\n    void adopt(uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Remove the buffer so that it will not be automatically freed.\n     * After this, the caller is responsible for feeding the memory back to\n     * JSAutoStructuredCloneBuffer::adopt.\n     */\n    void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=NULL);\n\n    bool read(JSContext *cx, jsval *vp,\n              const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n              void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               jsval transferable,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    /**\n     * Swap ownership with another JSAutoStructuredCloneBuffer.\n     */\n    void swap(JSAutoStructuredCloneBuffer &other);\n\n  private:\n    /* Copy and assignment are not supported. */\n    JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other);\n    JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other);\n};\n\n/* API for implementing custom serialization behavior (for ImageData, File, etc.) */\n\n/* The range of tag values the application may use for its own custom object types. */\n#define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)\n#define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)\n\n#define JS_SCERR_RECURSION 0\n#define JS_SCERR_TRANSFERABLE 1\n\nJS_PUBLIC_API(void)\nJS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);\n\n/************************************************************************/\n\n/*\n * The default locale for the ECMAScript Internationalization API\n * (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).\n * Note that the Internationalization API encourages clients to\n * specify their own locales.\n * The locale string remains owned by the caller.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetDefaultLocale(JSRuntime *rt, const char *locale);\n\n/*\n * Reset the default locale to OS defaults.\n */\nextern JS_PUBLIC_API(void)\nJS_ResetDefaultLocale(JSRuntime *rt);\n\n/*\n * Locale specific string conversion and error message callbacks.\n */\nstruct JSLocaleCallbacks {\n    JSLocaleToUpperCase     localeToUpperCase;\n    JSLocaleToLowerCase     localeToLowerCase;\n    JSLocaleCompare         localeCompare; // not used #if ENABLE_INTL_API\n    JSLocaleToUnicode       localeToUnicode;\n    JSErrorCallback         localeGetErrorMessage;\n};\n\n/*\n * Establish locale callbacks. The pointer must persist as long as the\n * JSRuntime.  Passing NULL restores the default behaviour.\n */\nextern JS_PUBLIC_API(void)\nJS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks);\n\n/*\n * Return the address of the current locale callbacks struct, which may\n * be NULL.\n */\nextern JS_PUBLIC_API(JSLocaleCallbacks *)\nJS_GetLocaleCallbacks(JSRuntime *rt);\n\n/************************************************************************/\n\n/*\n * Error reporting.\n */\n\n/*\n * Report an exception represented by the sprintf-like conversion of format\n * and its arguments.  This exception message string is passed to a pre-set\n * JSErrorReporter function (set by JS_SetErrorReporter).\n */\nextern JS_PUBLIC_API(void)\nJS_ReportError(JSContext *cx, const char *format, ...);\n\n/*\n * Use an errorNumber to retrieve the format string, args are char *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,\n                       void *userRef, const unsigned errorNumber, va_list ap);\n#endif\n\n/*\n * Use an errorNumber to retrieve the format string, args are jschar *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUC(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback,\n                            void *userRef, const unsigned errorNumber,\n                            const jschar **args);\n\n/*\n * As above, but report a warning instead (JSREPORT_IS_WARNING(report.flags)).\n * Return true if there was no error trying to issue the warning, and if the\n * warning was not converted into an error due to the JSOPTION_WERROR option\n * being set, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReportWarning(JSContext *cx, const char *format, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags,\n                             JSErrorCallback errorCallback, void *userRef,\n                             const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags,\n                               JSErrorCallback errorCallback, void *userRef,\n                               const unsigned errorNumber, ...);\n\n/*\n * Complain when out of memory.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportOutOfMemory(JSContext *cx);\n\n/*\n * Complain when an allocation size overflows the maximum supported limit.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportAllocationOverflow(JSContext *cx);\n\nstruct JSErrorReport {\n    const char      *filename;      /* source file name, URL, etc., or null */\n    JSPrincipals    *originPrincipals; /* see 'originPrincipals' comment above */\n    unsigned        lineno;         /* source line number */\n    const char      *linebuf;       /* offending source line without final \\n */\n    const char      *tokenptr;      /* pointer to error token in linebuf */\n    const jschar    *uclinebuf;     /* unicode (original) line buffer */\n    const jschar    *uctokenptr;    /* unicode (original) token pointer */\n    unsigned        flags;          /* error/warning, etc. */\n    unsigned        errorNumber;    /* the error number, e.g. see js.msg */\n    const jschar    *ucmessage;     /* the (default) error message */\n    const jschar    **messageArgs;  /* arguments for the error message */\n    int16_t         exnType;        /* One of the JSExnType constants */\n    unsigned        column;         /* zero-based column index in line */\n};\n\n/*\n * JSErrorReport flag values.  These may be freely composed.\n */\n#define JSREPORT_ERROR      0x0     /* pseudo-flag for default case */\n#define JSREPORT_WARNING    0x1     /* reported via JS_ReportWarning */\n#define JSREPORT_EXCEPTION  0x2     /* exception was thrown */\n#define JSREPORT_STRICT     0x4     /* error or warning due to strict option */\n\n/*\n * This condition is an error in strict mode code, a warning if\n * JS_HAS_STRICT_OPTION(cx), and otherwise should not be reported at\n * all.  We check the strictness of the context's top frame's script;\n * where that isn't appropriate, the caller should do the right checks\n * itself instead of using this flag.\n */\n#define JSREPORT_STRICT_MODE_ERROR 0x8\n\n/*\n * If JSREPORT_EXCEPTION is set, then a JavaScript-catchable exception\n * has been thrown for this runtime error, and the host should ignore it.\n * Exception-aware hosts should also check for JS_IsExceptionPending if\n * JS_ExecuteScript returns failure, and signal or propagate the exception, as\n * appropriate.\n */\n#define JSREPORT_IS_WARNING(flags)      (((flags) & JSREPORT_WARNING) != 0)\n#define JSREPORT_IS_EXCEPTION(flags)    (((flags) & JSREPORT_EXCEPTION) != 0)\n#define JSREPORT_IS_STRICT(flags)       (((flags) & JSREPORT_STRICT) != 0)\n#define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) &                      \\\n                                              JSREPORT_STRICT_MODE_ERROR) != 0)\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_GetErrorReporter(JSContext *cx);\n\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_SetErrorReporter(JSContext *cx, JSErrorReporter er);\n\n/************************************************************************/\n\n/*\n * Dates.\n */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObjectMsec(JSContext *cx, double msec);\n\n/*\n * Infallible predicate to test whether obj is a date object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsDate(JSContext *cx, JSObject *obj);\n\n/*\n * Clears the cache of calculated local time from each Date object.\n * Call to propagate a system timezone change.\n */\nextern JS_PUBLIC_API(void)\nJS_ClearDateCaches(JSContext *cx);\n\n/************************************************************************/\n\n/*\n * Regular Expressions.\n */\n#define JSREG_FOLD      0x01    /* fold uppercase to lowercase */\n#define JSREG_GLOB      0x02    /* global exec, creates array of matches */\n#define JSREG_MULTILINE 0x04    /* treat ^ and $ as begin and end of line */\n#define JSREG_STICKY    0x08    /* only match starting at lastIndex */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObject(JSContext *cx, JSObject *obj, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(void)\nJS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRegExpStatics(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length,\n                 size_t *indexp, JSBool test, jsval *rval);\n\n/* RegExp interface for clients without a global object. */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length,\n                          size_t *indexp, JSBool test, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsRegExp(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetRegExpFlags(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetRegExpSource(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsExceptionPending(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPendingException(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_SetPendingException(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(void)\nJS_ClearPendingException(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportPendingException(JSContext *cx);\n\n/*\n * Save the current exception state.  This takes a snapshot of cx's current\n * exception state without making any change to that state.\n *\n * The returned state pointer MUST be passed later to JS_RestoreExceptionState\n * (to restore that saved state, overriding any more recent state) or else to\n * JS_DropExceptionState (to free the state struct in case it is not correct\n * or desirable to restore it).  Both Restore and Drop free the state struct,\n * so callers must stop using the pointer returned from Save after calling the\n * Release or Drop API.\n */\nextern JS_PUBLIC_API(JSExceptionState *)\nJS_SaveExceptionState(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreExceptionState(JSContext *cx, JSExceptionState *state);\n\nextern JS_PUBLIC_API(void)\nJS_DropExceptionState(JSContext *cx, JSExceptionState *state);\n\n/*\n * If the given value is an exception object that originated from an error,\n * the exception will contain an error report struct, and this API will return\n * the address of that struct.  Otherwise, it returns NULL.  The lifetime of\n * the error report struct that might be returned is the same as the lifetime\n * of the exception object.\n */\nextern JS_PUBLIC_API(JSErrorReport *)\nJS_ErrorFromException(JSContext *cx, jsval v);\n\n/*\n * Given a reported error's message and JSErrorReport struct pointer, throw\n * the corresponding exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowReportedError(JSContext *cx, const char *message,\n                      JSErrorReport *reportp);\n\n/*\n * Throws a StopIteration exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowStopIteration(JSContext *cx);\n\nextern JS_PUBLIC_API(intptr_t)\nJS_GetCurrentThread();\n\n/*\n * A JS runtime always has an \"owner thread\". The owner thread is set when the\n * runtime is created (to the current thread) and practically all entry points\n * into the JS engine check that a runtime (or anything contained in the\n * runtime: context, compartment, object, etc) is only touched by its owner\n * thread. Embeddings may check this invariant outside the JS engine by calling\n * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for\n * non-debug builds).\n *\n * It is possible to \"move\" a runtime between threads. This is accomplished by\n * calling JS_ClearRuntimeThread on a runtime's owner thread and then calling\n * JS_SetRuntimeThread on the new owner thread. The runtime must not be\n * accessed between JS_ClearRuntimeThread and JS_SetRuntimeThread. Also, the\n * caller is responsible for synchronizing the calls to Set/Clear.\n */\n\nextern JS_PUBLIC_API(void)\nJS_AbortIfWrongThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRuntimeThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeThread(JSRuntime *rt);\n\nclass JSAutoSetRuntimeThread\n{\n    JSRuntime *runtime_;\n\n  public:\n    JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime_(runtime) {\n        JS_SetRuntimeThread(runtime_);\n    }\n\n    ~JSAutoSetRuntimeThread() {\n        JS_ClearRuntimeThread(runtime_);\n    }\n};\n\n/************************************************************************/\n\n/*\n * JS_IsConstructing must be called from within a native given the\n * native's original cx and vp arguments. If JS_IsConstructing is true,\n * JS_THIS must not be used; the constructor should construct and return a\n * new object. Otherwise, the native is called as an ordinary function and\n * JS_THIS may be used.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJS_IsConstructing(JSContext *cx, const jsval *vp)\n{\n#ifdef DEBUG\n    JSObject *callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n    if (JS_ObjectIsFunction(cx, callee)) {\n        JSFunction *fun = JS_ValueToFunction(cx, JS_CALLEE(cx, vp));\n        JS_ASSERT(JS_IsConstructor(fun));\n    } else {\n        JS_ASSERT(JS_GetClass(callee)->construct != NULL);\n    }\n#else\n    (void)cx;\n#endif\n\n    return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));\n}\n\n/*\n * A constructor can request that the JS engine create a default new 'this'\n * object of the given class, using the callee to determine parentage and\n * [[Prototype]].\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp);\n\n/************************************************************************/\n\n#ifdef JS_GC_ZEAL\n#define JS_DEFAULT_ZEAL_FREQ 100\n\nextern JS_PUBLIC_API(void)\nJS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency);\n\nextern JS_PUBLIC_API(void)\nJS_ScheduleGC(JSContext *cx, uint32_t count);\n#endif\n\nextern JS_PUBLIC_API(void)\nJS_SetParallelCompilationEnabled(JSContext *cx, bool enabled);\n\ntypedef enum JSCompilerOption {\n    JSCOMPILER_BASELINE_USECOUNT_TRIGGER,\n    JSCOMPILER_ION_USECOUNT_TRIGGER,\n    JSCOMPILER_PJS_ENABLE\n} JSCompilerOption;\n\nextern JS_PUBLIC_API(void)\nJS_SetGlobalCompilerOption(JSContext *cx, JSCompilerOption opt, uint32_t value);\n\n/*\n * Convert a uint32_t index into a jsid.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IndexToId(JSContext *cx, uint32_t index, jsid *id);\n\n/*\n * Convert chars into a jsid.\n *\n * |chars| may not be an index.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp);\n\n/*\n *  Test if the given string is a valid ECMAScript identifier\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);\n\n/*\n * Return the current script and line number of the most currently running\n * frame. Returns true if a scripted frame was found, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno);\n\n\n/*\n * Encode/Decode interpreted scripts and functions to/from memory.\n */\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeScript(JSContext *cx, JSScript *script, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeInterpretedFunction(JSContext *cx, JSObject *funobj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_DecodeScript(JSContext *cx, const void *data, uint32_t length,\n                JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,\n                             JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\nextern JS_PUBLIC_DATA(const HandleId) JSID_VOIDHANDLE;\nextern JS_PUBLIC_DATA(const HandleId) JSID_EMPTYHANDLE;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Import some JS:: names into the js namespace so we can make unqualified\n * references to them.\n */\n\nusing JS::Value;\nusing JS::IsPoisonedValue;\nusing JS::NullValue;\nusing JS::UndefinedValue;\nusing JS::Int32Value;\nusing JS::DoubleValue;\nusing JS::StringValue;\nusing JS::BooleanValue;\nusing JS::ObjectValue;\nusing JS::MagicValue;\nusing JS::NumberValue;\nusing JS::ObjectOrNullValue;\nusing JS::PrivateValue;\nusing JS::PrivateUint32Value;\n\nusing JS::IsPoisonedPtr;\nusing JS::IsPoisonedId;\n\nusing JS::StableCharPtr;\nusing JS::TwoByteChars;\nusing JS::Latin1CharsZ;\n\nusing JS::AutoIdVector;\nusing JS::AutoValueVector;\nusing JS::AutoObjectVector;\nusing JS::AutoFunctionVector;\nusing JS::AutoScriptVector;\nusing JS::AutoIdArray;\n\nusing JS::AutoGCRooter;\nusing JS::AutoArrayRooter;\nusing JS::AutoVectorRooter;\nusing JS::AutoHashMapRooter;\nusing JS::AutoHashSetRooter;\n\nusing JS::CallArgs;\nusing JS::IsAcceptableThis;\nusing JS::NativeImpl;\nusing JS::CallReceiver;\nusing JS::CompileOptions;\nusing JS::CallNonGenericMethod;\n\nusing JS::Rooted;\nusing JS::RootedObject;\nusing JS::RootedModule;\nusing JS::RootedFunction;\nusing JS::RootedScript;\nusing JS::RootedString;\nusing JS::RootedId;\nusing JS::RootedValue;\n\nusing JS::Handle;\nusing JS::HandleObject;\nusing JS::HandleModule;\nusing JS::HandleFunction;\nusing JS::HandleScript;\nusing JS::HandleString;\nusing JS::HandleId;\nusing JS::HandleValue;\n\nusing JS::MutableHandle;\nusing JS::MutableHandleObject;\nusing JS::MutableHandleFunction;\nusing JS::MutableHandleScript;\nusing JS::MutableHandleString;\nusing JS::MutableHandleId;\nusing JS::MutableHandleValue;\n\nusing JS::Zone;\n\n} /* namespace js */\n\n#endif /* jsapi_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsclass.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclass_h\n#define jsclass_h\n/*\n * A JSClass acts as a vtable for JS objects that allows JSAPI clients to\n * control various aspects of the behavior of an object like property lookup.\n * js::Class is an engine-private extension that allows more control over\n * object behavior and, e.g., allows custom slow layout.\n */\n\n#include \"jsapi.h\"\n#include \"jsprvtd.h\"\n\nnamespace js {\n\nclass PropertyName;\nclass SpecialId;\nclass PropertyId;\n\n// This is equal to JSFunction::class_.  Use it in places where you don't want\n// to #include jsfun.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionClassPtr;\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid);\n\n/*\n * We partition the ways to refer to a property into three: by an index\n * (uint32_t); by a string whose characters do not represent an index\n * (PropertyName, see vm/String.h); and by various special values.\n *\n * Special values are encoded using SpecialId, which is layout-compatible but\n * non-interconvertible with jsid.  A SpecialId is used for JSID_VOID, which\n * does not occur in JS scripts but may be used to indicate the absence of a\n * valid identifier.  In the future, a SpecialId may also be an object used by\n * Harmony-proposed private names.\n */\nclass SpecialId\n{\n    uintptr_t bits_;\n\n    /* Needs access to raw bits. */\n    friend JS_ALWAYS_INLINE jsid SPECIALID_TO_JSID(const SpecialId &sid);\n    friend class PropertyId;\n\n    static const uintptr_t TYPE_VOID = JSID_TYPE_VOID;\n    static const uintptr_t TYPE_OBJECT = JSID_TYPE_OBJECT;\n    static const uintptr_t TYPE_MASK = JSID_TYPE_MASK;\n\n    SpecialId(uintptr_t bits) : bits_(bits) { }\n\n  public:\n    SpecialId() : bits_(TYPE_VOID) { }\n\n    /* Object-valued */\n\n    SpecialId(JSObject &obj)\n      : bits_(uintptr_t(&obj) | TYPE_OBJECT)\n    {\n        JS_ASSERT(&obj != NULL);\n        JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);\n    }\n\n    bool isObject() const {\n        return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT;\n    }\n\n    JSObject *toObject() const {\n        JS_ASSERT(isObject());\n        return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);\n    }\n\n    /* Empty */\n\n    static SpecialId empty() {\n        SpecialId sid(TYPE_OBJECT);\n        JS_ASSERT(sid.isEmpty());\n        return sid;\n    }\n\n    bool isEmpty() const {\n        return bits_ == TYPE_OBJECT;\n    }\n\n    /* Void */\n\n    static SpecialId voidId() {\n        SpecialId sid(TYPE_VOID);\n        JS_ASSERT(sid.isVoid());\n        return sid;\n    }\n\n    bool isVoid() const {\n        return bits_ == TYPE_VOID;\n    }\n};\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid)\n{\n    jsid id;\n    JSID_BITS(id) = sid.bits_;\n    JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());\n    JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));\n    JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE bool\nJSID_IS_SPECIAL(jsid id)\n{\n    return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id);\n}\n\nstatic JS_ALWAYS_INLINE SpecialId\nJSID_TO_SPECIALID(jsid id)\n{\n    JS_ASSERT(JSID_IS_SPECIAL(id));\n    if (JSID_IS_OBJECT(id))\n        return SpecialId(*JSID_TO_OBJECT(id));\n    if (JSID_IS_EMPTY(id))\n        return SpecialId::empty();\n    JS_ASSERT(JSID_IS_VOID(id));\n    return SpecialId::voidId();\n}\n\ntypedef JS::Handle<SpecialId> HandleSpecialId;\n\n/* js::Class operation signatures. */\n\ntypedef JSBool\n(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name,\n                 MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value,\n                 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);\ntypedef JSBool\n(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present);\ntypedef JSBool\n(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);\ntypedef JSBool\n(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);\ntypedef JSBool\n(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);\ntypedef JSBool\n(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);\ntypedef JSBool\n(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);\ntypedef JSBool\n(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded);\ntypedef JSBool\n(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded);\ntypedef JSBool\n(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded);\n\n\ntypedef JSObject *\n(* ObjectOp)(JSContext *cx, HandleObject obj);\ntypedef void\n(* FinalizeOp)(FreeOp *fop, JSObject *obj);\n\n#define JS_CLASS_MEMBERS                                                      \\\n    const char          *name;                                                \\\n    uint32_t            flags;                                                \\\n                                                                              \\\n    /* Mandatory function pointer members. */                                 \\\n    JSPropertyOp        addProperty;                                          \\\n    JSDeletePropertyOp  delProperty;                                          \\\n    JSPropertyOp        getProperty;                                          \\\n    JSStrictPropertyOp  setProperty;                                          \\\n    JSEnumerateOp       enumerate;                                            \\\n    JSResolveOp         resolve;                                              \\\n    JSConvertOp         convert;                                              \\\n                                                                              \\\n    /* Optional members (may be null). */                                     \\\n    FinalizeOp          finalize;                                             \\\n    JSCheckAccessOp     checkAccess;                                          \\\n    JSNative            call;                                                 \\\n    JSHasInstanceOp     hasInstance;                                          \\\n    JSNative            construct;                                            \\\n    JSTraceOp           trace\n\n/*\n * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much\n * we have to pad js::Class to match the size of JSClass.\n */\nstruct ClassSizeMeasurement\n{\n    JS_CLASS_MEMBERS;\n};\n\nstruct ClassExtension\n{\n    JSObjectOp          outerObject;\n    JSObjectOp          innerObject;\n    JSIteratorOp        iteratorObject;\n\n    /*\n     * isWrappedNative is true only if the class is an XPCWrappedNative.\n     * WeakMaps use this to override the wrapper disposal optimization.\n     */\n    bool                isWrappedNative;\n\n    /*\n     * If an object is used as a key in a weakmap, it may be desirable for the\n     * garbage collector to keep that object around longer than it otherwise\n     * would. A common case is when the key is a wrapper around an object in\n     * another compartment, and we want to avoid collecting the wrapper (and\n     * removing the weakmap entry) as long as the wrapped object is alive. In\n     * that case, the wrapped object is returned by the wrapper's\n     * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap\n     * key, it will not be collected (and remain in the weakmap) until the\n     * wrapped object is collected.\n     */\n    JSWeakmapKeyDelegateOp weakmapKeyDelegateOp;\n};\n\n#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,false,NULL}\n\nstruct ObjectOps\n{\n    LookupGenericOp     lookupGeneric;\n    LookupPropOp        lookupProperty;\n    LookupElementOp     lookupElement;\n    LookupSpecialOp     lookupSpecial;\n    DefineGenericOp     defineGeneric;\n    DefinePropOp        defineProperty;\n    DefineElementOp     defineElement;\n    DefineSpecialOp     defineSpecial;\n    GenericIdOp         getGeneric;\n    PropertyIdOp        getProperty;\n    ElementIdOp         getElement;\n    ElementIfPresentOp  getElementIfPresent; /* can be null */\n    SpecialIdOp         getSpecial;\n    StrictGenericIdOp   setGeneric;\n    StrictPropertyIdOp  setProperty;\n    StrictElementIdOp   setElement;\n    StrictSpecialIdOp   setSpecial;\n    GenericAttributesOp getGenericAttributes;\n    PropertyAttributesOp getPropertyAttributes;\n    ElementAttributesOp getElementAttributes;\n    SpecialAttributesOp getSpecialAttributes;\n    GenericAttributesOp setGenericAttributes;\n    PropertyAttributesOp setPropertyAttributes;\n    ElementAttributesOp setElementAttributes;\n    SpecialAttributesOp setSpecialAttributes;\n    DeletePropertyOp    deleteProperty;\n    DeleteElementOp     deleteElement;\n    DeleteSpecialOp     deleteSpecial;\n\n    JSNewEnumerateOp    enumerate;\n    ObjectOp            thisObject;\n};\n\n#define JS_NULL_OBJECT_OPS                                                    \\\n    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \\\n     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,        \\\n     NULL,NULL,NULL}\n\nstruct Class\n{\n    JS_CLASS_MEMBERS;\n    ClassExtension      ext;\n    ObjectOps           ops;\n    uint8_t             pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -\n                            sizeof(ClassExtension) - sizeof(ObjectOps)];\n\n    /* Class is not native and its map is not a scope. */\n    static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;\n\n    bool isNative() const {\n        return !(flags & NON_NATIVE);\n    }\n\n    bool hasPrivate() const {\n        return !!(flags & JSCLASS_HAS_PRIVATE);\n    }\n\n    bool emulatesUndefined() const {\n        return flags & JSCLASS_EMULATES_UNDEFINED;\n    }\n\n    bool isCallable() const {\n        return this == js::FunctionClassPtr || call;\n    }\n\n    static size_t offsetOfFlags() { return offsetof(Class, flags); }\n};\n\nJS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));\nJS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));\nJS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));\nJS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));\nJS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));\nJS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));\nJS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));\nJS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));\nJS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));\nJS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));\nJS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));\nJS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));\n\nstatic JS_ALWAYS_INLINE JSClass *\nJsvalify(Class *c)\n{\n    return (JSClass *)c;\n}\nstatic JS_ALWAYS_INLINE const JSClass *\nJsvalify(const Class *c)\n{\n    return (const JSClass *)c;\n}\n\nstatic JS_ALWAYS_INLINE Class *\nValueify(JSClass *c)\n{\n    return (Class *)c;\n}\nstatic JS_ALWAYS_INLINE const Class *\nValueify(const JSClass *c)\n{\n    return (const Class *)c;\n}\n\n/*\n * Enumeration describing possible values of the [[Class]] internal property\n * value of objects.\n */\nenum ESClassValue {\n    ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean,\n    ESClass_RegExp, ESClass_ArrayBuffer, ESClass_Date\n};\n\n/*\n * Return whether the given object has the given [[Class]] internal property\n * value. Beware, this query says nothing about the js::Class of the JSObject\n * so the caller must not assume anything about obj's representation (e.g., obj\n * may be a proxy).\n */\ninline bool\nObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx);\n\n/* Just a helper that checks v.isObject before calling ObjectClassIs. */\ninline bool\nIsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx);\n\ninline bool\nIsPoisonedSpecialId(js::SpecialId iden)\n{\n    if (iden.isObject())\n        return IsPoisonedPtr(iden.toObject());\n    return false;\n}\n\ntemplate <> struct GCMethods<SpecialId>\n{\n    static SpecialId initial() { return SpecialId(); }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(SpecialId id) { return IsPoisonedSpecialId(id); }\n};\n\n}  /* namespace js */\n\n#endif  /* jsclass_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsclist.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclist_h\n#define jsclist_h\n\n#include \"jstypes.h\"\n\n/*\n** Circular linked list\n*/\ntypedef struct JSCListStr {\n    struct JSCListStr *next;\n    struct JSCListStr *prev;\n} JSCList;\n\n/*\n** Insert element \"_e\" into the list, before \"_l\".\n*/\n#define JS_INSERT_BEFORE(_e,_l)  \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l);       \\\n        (_e)->prev = (_l)->prev; \\\n        (_l)->prev->next = (_e); \\\n        (_l)->prev = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Insert element \"_e\" into the list, after \"_l\".\n*/\n#define JS_INSERT_AFTER(_e,_l)   \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l)->next; \\\n        (_e)->prev = (_l);       \\\n        (_l)->next->prev = (_e); \\\n        (_l)->next = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Return the element following element \"_e\"\n*/\n#define JS_NEXT_LINK(_e)         \\\n        ((_e)->next)\n/*\n** Return the element preceding element \"_e\"\n*/\n#define JS_PREV_LINK(_e)         \\\n        ((_e)->prev)\n\n/*\n** Append an element \"_e\" to the end of the list \"_l\"\n*/\n#define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l)\n\n/*\n** Insert an element \"_e\" at the head of the list \"_l\"\n*/\n#define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l)\n\n/* Return the head/tail of the list */\n#define JS_LIST_HEAD(_l) (_l)->next\n#define JS_LIST_TAIL(_l) (_l)->prev\n\n/*\n** Remove the element \"_e\" from it's circular list.\n*/\n#define JS_REMOVE_LINK(_e)             \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n    JS_END_MACRO\n\n/*\n** Remove the element \"_e\" from it's circular list. Also initializes the\n** linkage.\n*/\n#define JS_REMOVE_AND_INIT_LINK(_e)    \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n        (_e)->next = (_e);             \\\n        (_e)->prev = (_e);             \\\n    JS_END_MACRO\n\n/*\n** Return non-zero if the given circular list \"_l\" is empty, zero if the\n** circular list is not empty\n*/\n#define JS_CLIST_IS_EMPTY(_l) \\\n    ((_l)->next == (_l))\n\n/*\n** Initialize a circular list\n*/\n#define JS_INIT_CLIST(_l)  \\\n    JS_BEGIN_MACRO         \\\n        (_l)->next = (_l); \\\n        (_l)->prev = (_l); \\\n    JS_END_MACRO\n\n#define JS_INIT_STATIC_CLIST(_l) \\\n    {(_l), (_l)}\n\n#endif /* jsclist_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jscpucfg.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jscpucfg_h\n#define jscpucfg_h\n\n#define JS_HAVE_LONG_LONG\n\n#if defined(_WIN64)\n\n# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n#  define JS_BYTES_PER_WORD   8\n#  define JS_BITS_PER_WORD_LOG2   6\n# else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n#  error \"CPU type is unknown\"\n# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n\n#elif defined(_WIN32) || defined(XP_OS2)\n\n# ifdef __WATCOMC__\n#  define HAVE_VA_LIST_AS_ARRAY 1\n# endif\n\n# define IS_LITTLE_ENDIAN 1\n# undef  IS_BIG_ENDIAN\n# define JS_BYTES_PER_WORD   4\n# define JS_BITS_PER_WORD_LOG2   5\n\n#elif defined(__APPLE__)\n# if __LITTLE_ENDIAN__\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n# elif __BIG_ENDIAN__\n#  undef  IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# endif\n\n#elif defined(JS_HAVE_ENDIAN_H)\n# include <endian.h>\n\n# if defined(__BYTE_ORDER)\n#  if __BYTE_ORDER == __LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif __BYTE_ORDER == __BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(__BYTE_ORDER) */\n#  error \"endian.h does not define __BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n/* BSDs */\n#elif defined(JS_HAVE_MACHINE_ENDIAN_H)\n# include <sys/types.h>\n# include <machine/endian.h>\n\n# if defined(_BYTE_ORDER)\n#  if _BYTE_ORDER == _LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif _BYTE_ORDER == _BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(_BYTE_ORDER) */\n#  error \"machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n#elif defined(JS_HAVE_SYS_ISA_DEFS_H)\n# include <sys/isa_defs.h>\n\n# if defined(_BIG_ENDIAN)\n#  undef IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# elif defined(_LITTLE_ENDIAN)\n#  define IS_LITTLE_ENDIAN 1\n#  undef IS_BIG_ENDIAN\n# else /* !defined(_LITTLE_ENDIAN) */\n#  error \"sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness.\"\n# endif\n# if !defined(JS_STACK_GROWTH_DIRECTION)\n#  if defined(_STACK_GROWS_UPWARD)\n#   define JS_STACK_GROWTH_DIRECTION (1)\n#  elif defined(_STACK_GROWS_DOWNWARD)\n#   define JS_STACK_GROWTH_DIRECTION (-1)\n#  endif\n# endif\n\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(_BIG_ENDIAN)\n/* IA64 running HP-UX will have _BIG_ENDIAN defined.\n * IA64 running Linux will have endian.h and be handled above.\n */\n# undef IS_LITTLE_ENDIAN\n# define IS_BIG_ENDIAN 1\n\n#else /* !defined(__sparc) && !defined(__sparc__) && ... */\n# error \"Cannot determine endianness of your platform. Please add support to jscpucfg.h.\"\n#endif\n\n#ifndef JS_STACK_GROWTH_DIRECTION\n# ifdef __hppa\n#  define JS_STACK_GROWTH_DIRECTION (1)\n# else\n#  define JS_STACK_GROWTH_DIRECTION (-1)\n# endif\n#endif\n\n#endif /* jscpucfg_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsdbgapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsdbgapi_h\n#define jsdbgapi_h\n/*\n * JS debugger API.\n */\n\n#include \"jsprvtd.h\"\n\nnamespace JS {\n\nstruct FrameDescription\n{\n    JSScript *script;\n    unsigned lineno;\n    JSFunction *fun;\n};\n\nstruct StackDescription\n{\n    unsigned nframes;\n    FrameDescription *frames;\n};\n\nextern JS_PUBLIC_API(StackDescription *)\nDescribeStack(JSContext *cx, unsigned maxFrames);\n\nextern JS_PUBLIC_API(void)\nFreeStackDescription(JSContext *cx, StackDescription *desc);\n\nextern JS_PUBLIC_API(char *)\nFormatStackDump(JSContext *cx, char *buf,\n                    JSBool showArgs, JSBool showLocals,\n                    JSBool showThisProps);\n\n}\n\n# ifdef DEBUG\nJS_FRIEND_API(void) js_DumpValue(const js::Value &val);\nJS_FRIEND_API(void) js_DumpId(jsid id);\nJS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);\n# endif\n\nJS_FRIEND_API(void)\njs_DumpBacktrace(JSContext *cx);\n\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * Currently, we only support runtime-wide debugging. In the future, we should\n * be able to support compartment-wide debugging.\n */\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);\n\n/*\n * Debug mode is a compartment-wide mode that enables a debugger to attach\n * to and interact with running methodjit-ed frames. In particular, it causes\n * every function to be compiled as if an eval was present (so eval-in-frame)\n * can work, and it ensures that functions can be re-JITed for other debug\n * features. In general, it is not safe to interact with frames that were live\n * before debug mode was enabled. For this reason, it is also not safe to\n * enable debug mode while frames are live.\n */\n\n/* Get current state of debugging mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_GetDebugMode(JSContext *cx);\n\n/*\n * Turn on/off debugging mode for all compartments. This returns false if any code\n * from any of the runtime's compartments is running or on the stack.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a single compartment. This should only be\n * used when no code from this compartment is running or on the stack in any\n * thread.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a context's compartment.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugMode(JSContext *cx, JSBool debug);\n\n/* Turn on single step mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);\n\n/* The closure argument will be marked. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n           JSTrapHandler handler, jsval closure);\n\nextern JS_PUBLIC_API(void)\nJS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n             JSTrapHandler *handlerp, jsval *closurep);\n\nextern JS_PUBLIC_API(void)\nJS_ClearScriptTraps(JSRuntime *rt, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_ClearAllTrapsForCompartment(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                 JSWatchPointHandler handler, JSObject *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                   JSWatchPointHandler *handlerp, JSObject **closurep);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearAllWatchPoints(JSContext *cx);\n\n/************************************************************************/\n\n// Raw JSScript* because this needs to be callable from a signal handler.\nextern JS_PUBLIC_API(unsigned)\nJS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_EndPC(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetLinePCs(JSContext *cx, JSScript *script,\n              unsigned startLine, unsigned maxLines,\n              unsigned* count, unsigned** lines, jsbytecode*** pcs);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);\n\n/*\n * N.B. The mark is in the context temp pool and thus the caller must take care\n * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other\n * call that may use the temp pool.\n */\nextern JS_PUBLIC_API(uintptr_t *)\nJS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);\n\nextern JS_PUBLIC_API(JSAtom *)\nJS_LocalNameToAtom(uintptr_t w);\n\nextern JS_PUBLIC_API(JSString *)\nJS_AtomKey(JSAtom *atom);\n\nextern JS_PUBLIC_API(void)\nJS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_GetFunctionScript(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSNative)\nJS_GetFunctionNative(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptPrincipals(JSScript *script);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptOriginPrincipals(JSScript *script);\n\nJS_PUBLIC_API(JSFunction *)\nJS_GetScriptFunction(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\n/*\n * This is almost JS_GetClass(obj)->name except that certain debug-only\n * proxies are made transparent. In particular, this function turns the class\n * of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject)\n * from \"Proxy\" to \"Call\", \"Block\", \"With\" etc.\n */\nextern JS_PUBLIC_API(const char *)\nJS_GetDebugClassName(JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const char *)\nJS_GetScriptFilename(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetScriptSourceMap(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptLineExtent(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetScriptVersion(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(bool)\nJS_GetScriptIsSelfHosted(JSScript *script);\n\n/************************************************************************/\n\n/*\n * Hook setters for script creation and destruction, see jsprvtd.h for the\n * typedefs.  These macros provide binary compatibility and newer, shorter\n * synonyms.\n */\n#define JS_SetNewScriptHook     JS_SetNewScriptHookProc\n#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc\n\nextern JS_PUBLIC_API(void)\nJS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,\n                        void *callerdata);\n\n/************************************************************************/\n\ntypedef struct JSPropertyDesc {\n    jsval           id;         /* primary id, atomized string, or int */\n    jsval           value;      /* property value */\n    uint8_t         flags;      /* flags, see below */\n    uint8_t         spare;      /* unused */\n    jsval           alias;      /* alias id if JSPD_ALIAS flag */\n} JSPropertyDesc;\n\n#define JSPD_ENUMERATE  0x01    /* visible to for/in loop */\n#define JSPD_READONLY   0x02    /* assignment is error */\n#define JSPD_PERMANENT  0x04    /* property cannot be deleted */\n#define JSPD_ALIAS      0x08    /* property has an alias id */\n#define JSPD_EXCEPTION  0x40    /* exception occurred fetching the property, */\n                                /* value is exception */\n#define JSPD_ERROR      0x80    /* native getter returned JS_FALSE without */\n                                /* throwing an exception */\n\ntypedef struct JSPropertyDescArray {\n    uint32_t        length;     /* number of elements in array */\n    JSPropertyDesc  *array;     /* alloc'd by Get, freed by Put */\n} JSPropertyDescArray;\n\ntypedef struct JSScopeProperty JSScopeProperty;\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);\n\nextern JS_PUBLIC_API(void)\nJS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);\n\n/************************************************************************/\n\n/*\n * JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a\n * StackFrame or baseline JIT frame.\n */\nclass JS_PUBLIC_API(JSAbstractFramePtr)\n{\n    uintptr_t ptr_;\n\n  protected:\n    JSAbstractFramePtr()\n      : ptr_(0)\n    { }\n\n  public:\n    explicit JSAbstractFramePtr(void *raw);\n\n    uintptr_t raw() const { return ptr_; }\n\n    operator bool() const { return !!ptr_; }\n\n    JSObject *scopeChain(JSContext *cx);\n    JSObject *callObject(JSContext *cx);\n\n    JSFunction *maybeFun();\n    JSScript *script();\n\n    bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv);\n\n    bool isDebuggerFrame();\n\n    bool evaluateInStackFrame(JSContext *cx,\n                              const char *bytes, unsigned length,\n                              const char *filename, unsigned lineno,\n                              JS::MutableHandleValue rval);\n\n    bool evaluateUCInStackFrame(JSContext *cx,\n                                const jschar *chars, unsigned length,\n                                const char *filename, unsigned lineno,\n                                JS::MutableHandleValue rval);\n};\n\nclass JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr\n{\n  public:\n    JSNullFramePtr()\n      : JSAbstractFramePtr()\n    {}\n};\n\n/*\n * This class does not work when IonMonkey is active. It's only used by jsd,\n * which can only be used when IonMonkey is disabled.\n *\n * To find the calling script and line number, use JS_DescribeSciptedCaller.\n * To summarize the call stack, use JS::DescribeStack.\n */\nclass JS_PUBLIC_API(JSBrokenFrameIterator)\n{\n    void *data_;\n\n  public:\n    JSBrokenFrameIterator(JSContext *cx);\n    ~JSBrokenFrameIterator();\n\n    bool done() const;\n    JSBrokenFrameIterator& operator++();\n\n    JSAbstractFramePtr abstractFramePtr() const;\n    jsbytecode *pc() const;\n\n    bool isConstructing() const;\n};\n\n/*\n * This hook captures high level script execution and function calls (JS or\n * native).  It is used by JS_SetExecuteHook to hook top level scripts and by\n * JS_SetCallHook to hook function calls.  It will get called twice per script\n * or function call: just before execution begins and just after it finishes.\n * In both cases the 'current' frame is that of the executing code.\n *\n * The 'before' param is JS_TRUE for the hook invocation before the execution\n * and JS_FALSE for the invocation after the code has run.\n *\n * The 'ok' param is significant only on the post execution invocation to\n * signify whether or not the code completed 'normally'.\n *\n * The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook\n * for the 'before'invocation, but is whatever value is returned from that\n * invocation for the 'after' invocation. Thus, the hook implementor *could*\n * allocate a structure in the 'before' invocation and return a pointer to that\n * structure. The pointer would then be handed to the hook for the 'after'\n * invocation. Alternately, the 'before' could just return the same value as\n * in 'closure' to cause the 'after' invocation to be called with the same\n * 'closure' value as the 'before'.\n *\n * Returning NULL in the 'before' hook will cause the 'after' hook *not* to\n * be called.\n */\ntypedef void *\n(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,\n                      JSBool before, JSBool *ok, void *closure);\n\ntypedef JSBool\n(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,\n                     void *closure);\n\ntypedef struct JSDebugHooks {\n    JSInterruptHook     interruptHook;\n    void                *interruptHookData;\n    JSNewScriptHook     newScriptHook;\n    void                *newScriptHookData;\n    JSDestroyScriptHook destroyScriptHook;\n    void                *destroyScriptHookData;\n    JSDebuggerHandler   debuggerHandler;\n    void                *debuggerHandlerData;\n    JSSourceHandler     sourceHandler;\n    void                *sourceHandlerData;\n    JSInterpreterHook   executeHook;\n    void                *executeHookData;\n    JSInterpreterHook   callHook;\n    void                *callHookData;\n    JSThrowHook         throwHook;\n    void                *throwHookData;\n    JSDebugErrorHook    debugErrorHook;\n    void                *debugErrorHookData;\n} JSDebugHooks;\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const JSDebugHooks *)\nJS_GetGlobalDebugHooks(JSRuntime *rt);\n\n/**\n * Add various profiling-related functions as properties of the given object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);\n\n/* Defined in vm/Debugger.cpp. */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineDebuggerObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_DumpBytecode(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentBytecode(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DumpPCCounts(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentPCCounts(JSContext *cx);\n\n/* Call the context debug handler on the topmost scripted frame. */\nextern JS_FRIEND_API(JSBool)\njs_CallContextDebugHandler(JSContext *cx);\n\n#endif /* jsdbgapi_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsfriendapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsfriendapi_h\n#define jsfriendapi_h\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include \"jsclass.h\"\n#include \"jsprvtd.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n\n/*\n * This macro checks if the stack pointer has exceeded a given limit. If\n * |tolerance| is non-zero, it returns true only if the stack pointer has\n * exceeded the limit by more than |tolerance| bytes.\n */\n#if JS_STACK_GROWTH_DIRECTION > 0\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) < (limit)+(tolerance))\n#else\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) > (limit)-(tolerance))\n#endif\n\n#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)\n\nnamespace JS {\ntemplate <class T>\nclass Heap;\n} /* namespace JS */\n\nextern JS_FRIEND_API(void)\nJS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\nextern JS_FRIEND_API(JSString *)\nJS_GetAnonymousString(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nJS_FindCompilationScope(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSFunction *)\nJS_GetObjectFunction(JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(uint32_t)\nJS_ObjectCountDynamicSlots(JS::HandleObject obj);\n\nextern JS_FRIEND_API(size_t)\nJS_SetProtoCalled(JSContext *cx);\n\nextern JS_FRIEND_API(size_t)\nJS_GetCustomIteratorCount(JSContext *cx);\n\nextern JS_FRIEND_API(JSBool)\nJS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret);\n\n/*\n * Determine whether the given object is backed by a DeadObjectProxy.\n *\n * Such objects hold no other objects (they have no outgoing reference edges)\n * and will throw if you touch them (e.g. by reading/writing a property).\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsDeadWrapper(JSObject *obj);\n\n/*\n * Used by the cycle collector to trace through the shape and all\n * shapes it reaches, marking all non-shape children found in the\n * process. Uses bounded stack space.\n */\nextern JS_FRIEND_API(void)\nJS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape);\n\nenum {\n    JS_TELEMETRY_GC_REASON,\n    JS_TELEMETRY_GC_IS_COMPARTMENTAL,\n    JS_TELEMETRY_GC_MS,\n    JS_TELEMETRY_GC_MAX_PAUSE_MS,\n    JS_TELEMETRY_GC_MARK_MS,\n    JS_TELEMETRY_GC_SWEEP_MS,\n    JS_TELEMETRY_GC_MARK_ROOTS_MS,\n    JS_TELEMETRY_GC_MARK_GRAY_MS,\n    JS_TELEMETRY_GC_SLICE_MS,\n    JS_TELEMETRY_GC_MMU_50,\n    JS_TELEMETRY_GC_RESET,\n    JS_TELEMETRY_GC_INCREMENTAL_DISABLED,\n    JS_TELEMETRY_GC_NON_INCREMENTAL,\n    JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS,\n    JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS\n};\n\ntypedef void\n(* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample);\n\nextern JS_FRIEND_API(void)\nJS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback);\n\nextern JS_FRIEND_API(JSPrincipals *)\nJS_GetCompartmentPrincipals(JSCompartment *compartment);\n\nextern JS_FRIEND_API(void)\nJS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);\n\n/* Safe to call with input obj == NULL. Returns non-NULL iff obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToInnerObject(JSContext *cx, JSObject *obj);\n\n/* Requires obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToOuterObject(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSObject *)\nJS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(JSString *)\nJS_BasicObjectToString(JSContext *cx, JS::HandleObject obj);\n\nextern JS_FRIEND_API(JSBool)\njs_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,\n                          JS::MutableHandleValue vp);\n\nJS_FRIEND_API(void)\njs_ReportOverRecursed(JSContext *maybecx);\n\nJS_FRIEND_API(bool)\njs_ObjectClassIs(JSContext *cx, JS::HandleObject obj, js::ESClassValue classValue);\n\nJS_FRIEND_API(const char *)\njs_ObjectClassName(JSContext *cx, JS::HandleObject obj);\n\nJS_FRIEND_API(bool)\njs_AddObjectRoot(JSRuntime *rt, JSObject **objp);\n\nJS_FRIEND_API(void)\njs_RemoveObjectRoot(JSRuntime *rt, JSObject **objp);\n\n#ifdef DEBUG\n\n/*\n * Routines to print out values during debugging.  These are FRIEND_API to help\n * the debugger find them and to support temporarily hacking js_Dump* calls\n * into other code.\n */\n\nextern JS_FRIEND_API(void)\njs_DumpString(JSString *str);\n\nextern JS_FRIEND_API(void)\njs_DumpAtom(JSAtom *atom);\n\nextern JS_FRIEND_API(void)\njs_DumpObject(JSObject *obj);\n\nextern JS_FRIEND_API(void)\njs_DumpChars(const jschar *s, size_t n);\n#endif\n\nextern JS_FRIEND_API(bool)\nJS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);\n\nextern JS_FRIEND_API(JSBool)\nJS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,\n                  js::MutableHandleValue statep, js::MutableHandleId idp);\n\nstruct JSFunctionSpecWithHelp {\n    const char      *name;\n    JSNative        call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *usage;\n    const char      *help;\n};\n\n#define JS_FN_HELP(name,call,nargs,flags,usage,help)                          \\\n    {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}\n#define JS_FS_HELP_END                                                        \\\n    {NULL, NULL, 0, 0, NULL, NULL}\n\nextern JS_FRIEND_API(bool)\nJS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);\n\ntypedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,\n                               jschar **src, uint32_t *length);\n\nextern JS_FRIEND_API(void)\nJS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);\n\nnamespace js {\n\ninline JSRuntime *\nGetRuntime(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->runtime_;\n}\n\ninline JSCompartment *\nGetContextCompartment(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->compartment_;\n}\n\ninline JS::Zone *\nGetContextZone(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->zone_;\n}\n\nextern JS_FRIEND_API(JS::Zone *)\nGetCompartmentZone(JSCompartment *comp);\n\ntypedef bool\n(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);\n\n /*\n  * Dump the complete object graph of heap-allocated things.\n  * fp is the file for the dump output.\n  */\nextern JS_FRIEND_API(void)\nDumpHeapComplete(JSRuntime *rt, FILE *fp);\n\n#ifdef OLD_GETTER_SETTER_METHODS\nJS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);\nJS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);\n#endif\n\nextern JS_FRIEND_API(bool)\nIsSystemCompartment(JSCompartment *comp);\n\nextern JS_FRIEND_API(bool)\nIsSystemZone(JS::Zone *zone);\n\nextern JS_FRIEND_API(bool)\nIsAtomsCompartment(JSCompartment *comp);\n\n/*\n * Check whether it is OK to assign an undeclared variable with the name\n * |propname| at the current location in script.  It is not an error if there is\n * no current script location, or if that location is not an assignment to an\n * undeclared variable.  Reports an error if one needs to be reported (and,\n * particularly, always reports when it returns false).\n */\nextern JS_FRIEND_API(bool)\nReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname);\n\n/*\n * Returns whether we're in a non-strict property set (in that we're in a\n * non-strict script and the bytecode we're on is a property set).  The return\n * value does NOT indicate any sort of exception was thrown: it's just a\n * boolean.\n */\nextern JS_FRIEND_API(bool)\nIsInNonStrictPropertySet(JSContext *cx);\n\nstruct WeakMapTracer;\n\n/*\n * Weak map tracer callback, called once for every binding of every\n * weak map that was live at the time of the last garbage collection.\n *\n * m will be NULL if the weak map is not contained in a JS Object.\n */\ntypedef void\n(* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m,\n                         void *k, JSGCTraceKind kkind,\n                         void *v, JSGCTraceKind vkind);\n\nstruct WeakMapTracer {\n    JSRuntime            *runtime;\n    WeakMapTraceCallback callback;\n\n    WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb)\n        : runtime(rt), callback(cb) {}\n};\n\nextern JS_FRIEND_API(void)\nTraceWeakMaps(WeakMapTracer *trc);\n\nextern JS_FRIEND_API(bool)\nAreGCGrayBitsValid(JSRuntime *rt);\n\ntypedef void\n(*GCThingCallback)(void *closure, void *gcthing);\n\nextern JS_FRIEND_API(void)\nVisitGrayWrapperTargets(JS::Zone *zone, GCThingCallback callback, void *closure);\n\nextern JS_FRIEND_API(JSObject *)\nGetWeakmapKeyDelegate(JSObject *key);\n\nJS_FRIEND_API(JSGCTraceKind)\nGCThingTraceKind(void *thing);\n\n/*\n * Invoke cellCallback on every gray JS_OBJECT in the given zone.\n */\nextern JS_FRIEND_API(void)\nIterateGrayObjects(JS::Zone *zone, GCThingCallback cellCallback, void *data);\n\n#ifdef JS_HAS_CTYPES\nextern JS_FRIEND_API(size_t)\nSizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj);\n#endif\n\nextern JS_FRIEND_API(JSCompartment *)\nGetAnyCompartmentInZone(JS::Zone *zone);\n\n/*\n * Shadow declarations of JS internal structures, for access by inline access\n * functions below. Do not use these structures in any other way. When adding\n * new fields for access by inline methods, make sure to add static asserts to\n * the original header file to ensure that offsets are consistent.\n */\nnamespace shadow {\n\nstruct TypeObject {\n    Class       *clasp;\n    JSObject    *proto;\n};\n\nstruct BaseShape {\n    js::Class *clasp;\n    JSObject *parent;\n    JSObject *_1;\n    JSCompartment *compartment;\n};\n\nclass Shape {\npublic:\n    shadow::BaseShape *base;\n    jsid              _1;\n    uint32_t          slotInfo;\n\n    static const uint32_t FIXED_SLOTS_SHIFT = 27;\n};\n\nstruct Object {\n    shadow::Shape      *shape;\n    shadow::TypeObject *type;\n    js::Value          *slots;\n    js::Value          *_1;\n\n    size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }\n    Value *fixedSlots() const {\n        return (Value *)(uintptr_t(this) + sizeof(shadow::Object));\n    }\n\n    js::Value &slotRef(size_t slot) const {\n        size_t nfixed = numFixedSlots();\n        if (slot < nfixed)\n            return fixedSlots()[slot];\n        return slots[slot - nfixed];\n    }\n};\n\nstruct Function {\n    Object base;\n    uint16_t nargs;\n    uint16_t flags;\n    /* Used only for natives */\n    Native native;\n    const JSJitInfo *jitinfo;\n    void *_1;\n};\n\nstruct Atom {\n    static const size_t LENGTH_SHIFT = 4;\n    size_t lengthAndFlags;\n    const jschar *chars;\n};\n\n} /* namespace shadow */\n\n// These are equal to |&{Function,Object,OuterWindow}ProxyObject::class_|.  Use\n// them in places where you don't want to #include vm/ProxyObject.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) ObjectProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) OuterWindowProxyClassPtr;\n\n// This is equal to |&JSObject::class_|.  Use it in places where you don't want\n// to #include jsobj.h.\nextern JS_FRIEND_DATA(js::Class* const) ObjectClassPtr;\n\ninline js::Class *\nGetObjectClass(JSObject *obj)\n{\n    return reinterpret_cast<const shadow::Object*>(obj)->type->clasp;\n}\n\ninline JSClass *\nGetObjectJSClass(JSObject *obj)\n{\n    return js::Jsvalify(GetObjectClass(obj));\n}\n\ninline bool\nIsInnerObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.outerObject;\n}\n\ninline bool\nIsOuterObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.innerObject;\n}\n\nJS_FRIEND_API(bool)\nIsFunctionObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsScopeObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsCallObject(JSObject *obj);\n\ninline JSObject *\nGetObjectParent(JSObject *obj)\n{\n    JS_ASSERT(!IsScopeObject(obj));\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->parent;\n}\n\nstatic JS_ALWAYS_INLINE JSCompartment *\nGetObjectCompartment(JSObject *obj)\n{\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->compartment;\n}\n\nJS_FRIEND_API(JSObject *)\nGetObjectParentMaybeScope(JSObject *obj);\n\nJS_FRIEND_API(JSObject *)\nGetGlobalForObjectCrossCompartment(JSObject *obj);\n\n// For legacy consumers only. This whole concept is going away soon.\nJS_FRIEND_API(JSObject *)\nDefaultObjectForContextOrNull(JSContext *cx);\n\nJS_FRIEND_API(void)\nSetDefaultObjectForContext(JSContext *cx, JSObject *obj);\n\nJS_FRIEND_API(void)\nNotifyAnimationActivity(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsOriginalScriptFunction(JSFunction *fun);\n\n/*\n * Return the outermost enclosing function (script) of the scripted caller.\n * This function returns NULL in several cases:\n *  - no script is running on the context\n *  - the caller is in global or eval code\n * In particular, this function will \"stop\" its outermost search at eval() and\n * thus it will really return the outermost enclosing function *since the\n * innermost eval*.\n */\nJS_FRIEND_API(JSScript *)\nGetOutermostEnclosingFunctionOfScriptedCaller(JSContext *cx);\n\nJS_FRIEND_API(JSFunction *)\nDefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                           unsigned nargs, unsigned attrs);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                        JSObject *parent, const char *name);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,\n                            JSObject *parent, jsid id);\n\nJS_FRIEND_API(JSObject *)\nInitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n                      JSClass *clasp, JSNative constructor, unsigned nargs,\n                      const JSPropertySpec *ps, const JSFunctionSpec *fs,\n                      const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\nJS_FRIEND_API(const Value &)\nGetFunctionNativeReserved(JSObject *fun, size_t which);\n\nJS_FRIEND_API(void)\nSetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val);\n\ninline bool\nGetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)\n{\n    js::Class *clasp = GetObjectClass(obj);\n    if (clasp == js::ObjectProxyClassPtr ||\n        clasp == js::OuterWindowProxyClassPtr ||\n        clasp == js::FunctionProxyClassPtr)\n    {\n        return JS_GetPrototype(cx, obj, proto);\n    }\n\n    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);\n    return true;\n}\n\ninline void *\nGetObjectPrivate(JSObject *obj)\n{\n    const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);\n    void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);\n    return *addr;\n}\n\n/*\n * Get a slot that is both reserved for object's clasp *and* is fixed (fits\n * within the maximum capacity for the object's fixed slots).\n */\ninline const Value &\nGetReservedSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\nJS_FRIEND_API(void)\nSetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);\n\ninline void\nSetReservedSlot(JSObject *obj, size_t slot, const Value &value)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);\n    if (sobj->slotRef(slot).isMarkable()\n#ifdef JSGC_GENERATIONAL\n        || value.isMarkable()\n#endif\n       )\n    {\n        SetReservedSlotWithBarrier(obj, slot, value);\n    } else {\n        sobj->slotRef(slot) = value;\n    }\n}\n\nJS_FRIEND_API(uint32_t)\nGetObjectSlotSpan(JSObject *obj);\n\ninline const Value &\nGetObjectSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < GetObjectSlotSpan(obj));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\ninline const jschar *\nGetAtomChars(JSAtom *atom)\n{\n    return reinterpret_cast<shadow::Atom *>(atom)->chars;\n}\n\ninline size_t\nGetAtomLength(JSAtom *atom)\n{\n    using shadow::Atom;\n    return reinterpret_cast<Atom*>(atom)->lengthAndFlags >> Atom::LENGTH_SHIFT;\n}\n\ninline JSLinearString *\nAtomToLinearString(JSAtom *atom)\n{\n    return reinterpret_cast<JSLinearString *>(atom);\n}\n\nstatic inline js::PropertyOp\nCastAsJSPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object);\n}\n\nstatic inline js::StrictPropertyOp\nCastAsJSStrictPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object);\n}\n\nJS_FRIEND_API(bool)\nGetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);\n\nJS_FRIEND_API(bool)\nAppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others);\n\nJS_FRIEND_API(bool)\nGetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);\n\nJS_FRIEND_API(bool)\nStringIsArrayIndex(JSLinearString *str, uint32_t *indexp);\n\nJS_FRIEND_API(void)\nSetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);\n\nJS_FRIEND_API(bool)\nIsObjectInContextCompartment(JSObject *obj, const JSContext *cx);\n\n/*\n * NB: these flag bits are encoded into the bytecode stream in the immediate\n * operand of JSOP_ITER, so don't change them without advancing vm/Xdr.h's\n * XDR_BYTECODE_VERSION.\n */\n#define JSITER_ENUMERATE  0x1   /* for-in compatible hidden default iterator */\n#define JSITER_FOREACH    0x2   /* return [key, value] pair rather than key */\n#define JSITER_KEYVALUE   0x4   /* destructuring for-in wants [key, value] */\n#define JSITER_OWNONLY    0x8   /* iterate over obj's own properties only */\n#define JSITER_HIDDEN     0x10  /* also enumerate non-enumerable properties */\n#define JSITER_FOR_OF     0x20  /* harmony for-of loop */\n\ninline uintptr_t\nGetNativeStackLimit(const JSRuntime *rt)\n{\n    return PerThreadDataFriendFields::getMainThread(rt)->nativeStackLimit;\n}\n\ninline uintptr_t\nGetNativeStackLimit(JSContext *cx)\n{\n    return GetNativeStackLimit(GetRuntime(cx));\n}\n\n/*\n * These macros report a stack overflow and run |onerror| if we are close to\n * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a little\n * extra space so that we can ensure that crucial code is able to run.\n */\n\n#define JS_CHECK_RECURSION(cx, onerror)                              \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), &stackDummy_)) {  \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, sp, onerror)                 \\\n    JS_BEGIN_MACRO                                                              \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), sp)) {            \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_CHROME_RECURSION(cx, onerror)                                  \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE_WITH_TOLERANCE(js::GetNativeStackLimit(cx),    \\\n                                                &stackDummy_,                   \\\n                                                1024 * sizeof(size_t)))         \\\n        {                                                                       \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\nJS_FRIEND_API(void)\nStartPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nStopPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nPurgePCCounts(JSContext *cx);\n\nJS_FRIEND_API(size_t)\nGetPCCountScriptCount(JSContext *cx);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptSummary(JSContext *cx, size_t script);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptContents(JSContext *cx, size_t script);\n\n/*\n * A call stack can be specified to the JS engine such that all JS entry/exits\n * to functions push/pop an entry to/from the specified stack.\n *\n * For more detailed information, see vm/SPSProfiler.h\n */\nclass ProfileEntry\n{\n    /*\n     * All fields are marked volatile to prevent the compiler from re-ordering\n     * instructions. Namely this sequence:\n     *\n     *    entry[size] = ...;\n     *    size++;\n     *\n     * If the size modification were somehow reordered before the stores, then\n     * if a sample were taken it would be examining bogus information.\n     *\n     * A ProfileEntry represents both a C++ profile entry and a JS one. Both use\n     * the string as a description, but JS uses the sp as NULL to indicate that\n     * it is a JS entry. The script_ is then only ever examined for a JS entry,\n     * and the idx is used by both, but with different meanings.\n     */\n    const char * volatile string; // Descriptive string of this entry\n    void * volatile sp;           // Relevant stack pointer for the entry\n    JSScript * volatile script_;  // if js(), non-null script which is running\n    int32_t volatile idx;         // if js(), idx of pc, otherwise line number\n\n  public:\n    /*\n     * All of these methods are marked with the 'volatile' keyword because SPS's\n     * representation of the stack is stored such that all ProfileEntry\n     * instances are volatile. These methods would not be available unless they\n     * were marked as volatile as well\n     */\n\n    bool js() volatile {\n        JS_ASSERT_IF(sp == NULL, script_ != NULL);\n        return sp == NULL;\n    }\n\n    uint32_t line() volatile { JS_ASSERT(!js()); return idx; }\n    JSScript *script() volatile { JS_ASSERT(js()); return script_; }\n    void *stackAddress() volatile { return sp; }\n    const char *label() volatile { return string; }\n\n    void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }\n    void setLabel(const char *aString) volatile { string = aString; }\n    void setStackAddress(void *aSp) volatile { sp = aSp; }\n    void setScript(JSScript *aScript) volatile { script_ = aScript; }\n\n    /* we can't know the layout of JSScript, so look in vm/SPSProfiler.cpp */\n    JS_FRIEND_API(jsbytecode *) pc() volatile;\n    JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile;\n\n    static size_t offsetOfString() { return offsetof(ProfileEntry, string); }\n    static size_t offsetOfStackAddress() { return offsetof(ProfileEntry, sp); }\n    static size_t offsetOfPCIdx() { return offsetof(ProfileEntry, idx); }\n    static size_t offsetOfScript() { return offsetof(ProfileEntry, script_); }\n\n    /*\n     * The index used in the entry can either be a line number or the offset of\n     * a pc into a script's code. To signify a NULL pc, use a -1 index. This is\n     * checked against in pc() and setPC() to set/get the right pc.\n     */\n    static const int32_t NullPCIndex = -1;\n};\n\nJS_FRIEND_API(void)\nSetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,\n                         uint32_t max);\n\nJS_FRIEND_API(void)\nEnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);\n\nJS_FRIEND_API(jsbytecode*)\nProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);\n\n#ifdef JS_THREADSAFE\nJS_FRIEND_API(bool)\nContextHasOutstandingRequests(const JSContext *cx);\n#endif\n\nJS_FRIEND_API(bool)\nHasUnrootedGlobal(const JSContext *cx);\n\ntypedef void\n(* ActivityCallback)(void *arg, JSBool active);\n\n/*\n * Sets a callback that is run whenever the runtime goes idle - the\n * last active request ceases - and begins activity - when it was\n * idle and a request begins.\n */\nJS_FRIEND_API(void)\nSetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg);\n\nextern JS_FRIEND_API(const JSStructuredCloneCallbacks *)\nGetContextStructuredCloneCallbacks(JSContext *cx);\n\nextern JS_FRIEND_API(bool)\nCanCallContextDebugHandler(JSContext *cx);\n\nextern JS_FRIEND_API(JSTrapStatus)\nCallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);\n\nextern JS_FRIEND_API(bool)\nIsContextRunningJS(JSContext *cx);\n\ntypedef void\n(* AnalysisPurgeCallback)(JSRuntime *rt, JS::Handle<JSFlatString*> desc);\n\nextern JS_FRIEND_API(AnalysisPurgeCallback)\nSetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback);\n\ntypedef JSBool\n(* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID,\n                                 uint32_t depth);\nstruct JSDOMCallbacks {\n    DOMInstanceClassMatchesProto instanceClassMatchesProto;\n};\ntypedef struct JSDOMCallbacks DOMCallbacks;\n\nextern JS_FRIEND_API(void)\nSetDOMCallbacks(JSRuntime *rt, const DOMCallbacks *callbacks);\n\nextern JS_FRIEND_API(const DOMCallbacks *)\nGetDOMCallbacks(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nGetTestingFunctions(JSContext *cx);\n\n/*\n * Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not\n * available and the compiler does not know that FreeOp inherits from\n * JSFreeOp.\n */\ninline JSFreeOp *\nCastToJSFreeOp(FreeOp *fop)\n{\n    return reinterpret_cast<JSFreeOp *>(fop);\n}\n\n/* Implemented in jsexn.cpp. */\n\n/*\n * Get an error type name from a JSExnType constant.\n * Returns NULL for invalid arguments and JSEXN_INTERNALERR\n */\nextern JS_FRIEND_API(const jschar*)\nGetErrorTypeName(JSContext* cx, int16_t exnType);\n\n#ifdef DEBUG\nextern JS_FRIEND_API(unsigned)\nGetEnterCompartmentDepth(JSContext* cx);\n#endif\n\n/* Implemented in jswrapper.cpp. */\ntypedef enum NukeReferencesToWindow {\n    NukeWindowReferences,\n    DontNukeWindowReferences\n} NukeReferencesToWindow;\n\n/*\n * These filters are designed to be ephemeral stack classes, and thus don't\n * do any rooting or holding of their members.\n */\nstruct CompartmentFilter {\n    virtual bool match(JSCompartment *c) const = 0;\n};\n\nstruct AllCompartments : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const { return true; }\n};\n\nstruct ContentCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return !IsSystemCompartment(c);\n    }\n};\n\nstruct ChromeCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return IsSystemCompartment(c);\n    }\n};\n\nstruct SingleCompartment : public CompartmentFilter {\n    JSCompartment *ours;\n    SingleCompartment(JSCompartment *c) : ours(c) {}\n    virtual bool match(JSCompartment *c) const { return c == ours; }\n};\n\nstruct CompartmentsWithPrincipals : public CompartmentFilter {\n    JSPrincipals *principals;\n    CompartmentsWithPrincipals(JSPrincipals *p) : principals(p) {}\n    virtual bool match(JSCompartment *c) const {\n        return JS_GetCompartmentPrincipals(c) == principals;\n    }\n};\n\nextern JS_FRIEND_API(JSBool)\nNukeCrossCompartmentWrappers(JSContext* cx,\n                             const CompartmentFilter& sourceFilter,\n                             const CompartmentFilter& targetFilter,\n                             NukeReferencesToWindow nukeReferencesToWindow);\n\n/* Specify information about DOMProxy proxies in the DOM, for use by ICs. */\n\n/*\n * The DOMProxyShadowsCheck function will be called to check if the property for\n * id should be gotten from the prototype, or if there is an own property that\n * shadows it.\n * If DoesntShadow is returned then the slot at listBaseExpandoSlot should\n * either be undefined or point to an expando object that would contain the own\n * property.\n * If DoesntShadowUnique is returned then the slot at listBaseExpandoSlot should\n * contain a private pointer to a ExpandoAndGeneration, which contains a\n * JS::Value that should either be undefined or point to an expando object, and\n * a uint32 value. If that value changes then the IC for getting a property will\n * be invalidated.\n */\n\nstruct ExpandoAndGeneration {\n  ExpandoAndGeneration()\n    : expando(UndefinedValue()),\n      generation(0)\n  {}\n\n  void Unlink()\n  {\n      ++generation;\n      expando.setUndefined();\n  }\n\n  JS::Heap<JS::Value> expando;\n  uint32_t generation;\n};\n\ntypedef enum DOMProxyShadowsResult {\n  ShadowCheckFailed,\n  Shadows,\n  DoesntShadow,\n  DoesntShadowUnique\n} DOMProxyShadowsResult;\ntypedef DOMProxyShadowsResult\n(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);\nJS_FRIEND_API(void)\nSetDOMProxyInformation(void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,\n                       DOMProxyShadowsCheck domProxyShadowsCheck);\n\nvoid *GetDOMProxyHandlerFamily();\nuint32_t GetDOMProxyExpandoSlot();\nDOMProxyShadowsCheck GetDOMProxyShadowsCheck();\n\n} /* namespace js */\n\n/* Implemented in jsdate.cpp. */\n\n/*\n * Detect whether the internal date value is NaN.  (Because failure is\n * out-of-band for js_DateGet*)\n */\nextern JS_FRIEND_API(JSBool)\njs_DateIsValid(JSObject* obj);\n\nextern JS_FRIEND_API(double)\njs_DateGetMsecSinceEpoch(JSObject *obj);\n\n/* Implemented in jscntxt.cpp. */\n\n/*\n * Report an exception, which is currently realized as a printf-style format\n * string and its arguments.\n */\ntypedef enum JSErrNum {\n#define MSG_DEF(name, number, count, exception, format) \\\n    name = number,\n#include \"js.msg\"\n#undef MSG_DEF\n    JSErr_Limit\n} JSErrNum;\n\nextern JS_FRIEND_API(const JSErrorFormatString *)\njs_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);\n\n/* Implemented in jsclone.cpp. */\n\nextern JS_FRIEND_API(uint64_t)\njs_GetSCOffset(JSStructuredCloneWriter* writer);\n\n/* Typed Array functions, implemented in jstypedarray.cpp */\n\nnamespace js {\nnamespace ArrayBufferView {\n\nenum ViewType {\n    TYPE_INT8 = 0,\n    TYPE_UINT8,\n    TYPE_INT16,\n    TYPE_UINT16,\n    TYPE_INT32,\n    TYPE_UINT32,\n    TYPE_FLOAT32,\n    TYPE_FLOAT64,\n\n    /*\n     * Special type that is a uint8_t, but assignments are clamped to [0, 256).\n     * Treat the raw data type as a uint8_t.\n     */\n    TYPE_UINT8_CLAMPED,\n\n    /*\n     * Type returned for a DataView. Note that there is no single element type\n     * in this case.\n     */\n    TYPE_DATAVIEW,\n\n    TYPE_MAX\n};\n\n} /* namespace ArrayBufferView */\n\n/*\n * A helper for building up an ArrayBuffer object's data\n * before creating the ArrayBuffer itself.  Will do doubling\n * based reallocation, up to an optional maximum growth given.\n *\n * When all the data has been appended, call getArrayBuffer,\n * passing in the JSContext* for which the ArrayBuffer object\n * is to be created.  This also implicitly resets the builder,\n * or it can be reset explicitly at any point by calling reset().\n */\nclass ArrayBufferBuilder\n{\n    void *rawcontents_;\n    uint8_t *dataptr_;\n    uint32_t capacity_;\n    uint32_t length_;\n  public:\n    ArrayBufferBuilder()\n        : rawcontents_(NULL),\n          dataptr_(NULL),\n          capacity_(0),\n          length_(0)\n    {\n    }\n\n    ~ArrayBufferBuilder() {\n        reset();\n    }\n\n    void reset() {\n        if (rawcontents_)\n            JS_free(NULL, rawcontents_);\n        rawcontents_ = dataptr_ = NULL;\n        capacity_ = length_ = 0;\n    }\n\n    // will truncate if newcap is < length()\n    bool setCapacity(uint32_t newcap) {\n        if (!JS_ReallocateArrayBufferContents(NULL, newcap, &rawcontents_, &dataptr_))\n            return false;\n\n        capacity_ = newcap;\n        if (length_ > newcap)\n            length_ = newcap;\n\n        return true;\n    }\n\n    // Append datalen bytes from data to the current buffer.  If we\n    // need to grow the buffer, grow by doubling the size up to a\n    // maximum of maxgrowth (if given).  If datalen is greater than\n    // what the new capacity would end up as, then grow by datalen.\n    //\n    // The data parameter must not overlap with anything beyond the\n    // builder's current valid contents [0..length)\n    bool append(const uint8_t *newdata, uint32_t datalen, uint32_t maxgrowth = 0) {\n        if (length_ + datalen > capacity_) {\n            uint32_t newcap;\n            // double while under maxgrowth or if not specified\n            if (!maxgrowth || capacity_ < maxgrowth)\n                newcap = capacity_ * 2;\n            else\n                newcap = capacity_ + maxgrowth;\n\n            // but make sure there's always enough to satisfy our request\n            if (newcap < length_ + datalen)\n                newcap = length_ + datalen;\n\n            // did we overflow?\n            if (newcap < capacity_)\n                return false;\n\n            if (!setCapacity(newcap))\n                return false;\n        }\n\n        // assert that the region isn't overlapping so we can memcpy;\n        JS_ASSERT(!areOverlappingRegions(newdata, datalen, dataptr_ + length_, datalen));\n\n        memcpy(dataptr_ + length_, newdata, datalen);\n        length_ += datalen;\n\n        return true;\n    }\n\n    uint8_t *data() {\n        return dataptr_;\n    }\n\n    uint32_t length() {\n        return length_;\n    }\n\n    uint32_t capacity() {\n        return capacity_;\n    }\n\n    JSObject* getArrayBuffer(JSContext *cx) {\n        // we need to check for length_ == 0, because nothing may have been\n        // added\n        if (capacity_ > length_ || length_ == 0) {\n            if (!setCapacity(length_))\n                return NULL;\n        }\n\n        JSObject* obj = JS_NewArrayBufferWithContents(cx, rawcontents_);\n        if (!obj)\n            return NULL;\n\n        rawcontents_ = dataptr_ = NULL;\n        length_ = capacity_ = 0;\n\n        return obj;\n    }\n\nprotected:\n\n    static bool areOverlappingRegions(const uint8_t *start1, uint32_t length1,\n                                      const uint8_t *start2, uint32_t length2)\n    {\n        const uint8_t *end1 = start1 + length1;\n        const uint8_t *end2 = start2 + length2;\n\n        const uint8_t *max_start = start1 > start2 ? start1 : start2;\n        const uint8_t *min_end   = end1 < end2 ? end1 : end2;\n\n        return max_start < min_end;\n    }\n};\n\n} /* namespace js */\n\ntypedef js::ArrayBufferView::ViewType JSArrayBufferViewType;\n\n/*\n * Create a new typed array with nelements elements.\n *\n * These functions (except the WithBuffer variants) fill in the array with zeros.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64Array(JSContext *cx, uint32_t nelements);\n\n/*\n * Create a new typed array and copy in values from the given object. The\n * object is used as if it were an array; that is, the new array (if\n * successfully created) will have length given by array.length, and its\n * elements will be those specified by array[0], array[1], and so on, after\n * conversion to the typed array element type.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array);\n\n/*\n * Create a new typed array using the given ArrayBuffer for storage.  The\n * length value is optional; if -1 is passed, enough elements to use up the\n * remainder of the byte array is used as the default value.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                          uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                                  uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\n\n/*\n * Create a new ArrayBuffer with the given byte length.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);\n\n/*\n * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return\n * false if a security wrapper is encountered that denies the unwrapping. If\n * this test or one of the JS_Is*Array tests succeeds, then it is safe to call\n * the various accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsTypedArrayObject(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test or one of the more specific tests succeeds, then it\n * is safe to call the various ArrayBufferView accessor JSAPI calls defined\n * below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * Test for specific typed array types (ArrayBufferView subtypes)\n */\n\nextern JS_FRIEND_API(JSBool)\nJS_IsInt8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8ClampedArray(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat64Array(JSObject *obj);\n\n/*\n * Unwrap Typed arrays all at once. Return NULL without throwing if the object\n * cannot be viewed as the correct typed array, or the typed array object on\n * success, filling both outparameters.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt8Array(JSObject *obj, uint32_t *length, int8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8Array(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8ClampedArray(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt16Array(JSObject *obj, uint32_t *length, int16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint16Array(JSObject *obj, uint32_t *length, uint16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt32Array(JSObject *obj, uint32_t *length, int32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint32Array(JSObject *obj, uint32_t *length, uint32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat32Array(JSObject *obj, uint32_t *length, float **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat64Array(JSObject *obj, uint32_t *length, double **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBufferView(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBuffer(JSObject *obj, uint32_t *length, uint8_t **data);\n\n/*\n * Get the type of elements in a typed array, or TYPE_DATAVIEW if a DataView.\n *\n * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is an ArrayBufferView or a\n * wrapper of an ArrayBufferView, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(JSArrayBufferViewType)\nJS_GetArrayBufferViewType(JSObject *obj);\n\n/*\n * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test succeeds, then it is safe to call the various\n * accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferObject(JSObject *obj);\n\n/*\n * Return the available byte length of an array buffer.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferByteLength(JSObject *obj);\n\n/*\n * Return a pointer to an array buffer's data. The buffer is still owned by the\n * array buffer object, and should not be modified on another thread. The\n * returned pointer is stable across GCs.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint8_t *)\nJS_GetArrayBufferData(JSObject *obj);\n\n/*\n * Return the number of elements in a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayLength(JSObject *obj);\n\n/*\n * Return the byte offset from the start of an array buffer to the start of a\n * typed array view.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteLength(JSObject *obj);\n\n/*\n * Check whether obj supports JS_ArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * More generic name for JS_GetTypedArrayByteLength to cover DataViews as well\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the start of the data referenced by a typed array. The\n * data is still owned by the typed array, and should not be modified on\n * another thread.\n *\n * |obj| must have passed a JS_Is*Array test, or somehow be known that it would\n * pass such a test: it is a typed array or a wrapper of a typed array, and the\n * unwrapping will succeed.\n */\n\nextern JS_FRIEND_API(int8_t *)\nJS_GetInt8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ClampedArrayData(JSObject *obj);\nextern JS_FRIEND_API(int16_t *)\nJS_GetInt16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint16_t *)\nJS_GetUint16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(int32_t *)\nJS_GetInt32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint32_t *)\nJS_GetUint32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(float *)\nJS_GetFloat32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(double *)\nJS_GetFloat64ArrayData(JSObject *obj);\n\n/*\n * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific\n * versions when possible.\n */\nextern JS_FRIEND_API(void *)\nJS_GetArrayBufferViewData(JSObject *obj);\n\n/*\n * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been\n * neutered, this will still return the neutered buffer. |obj| must be an\n * object that would return true for JS_IsArrayBufferViewObject().\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetArrayBufferViewBuffer(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetDataView* APIs.\n */\nJS_FRIEND_API(JSBool)\nJS_IsDataViewObject(JSObject *obj);\n\n/*\n * Return the byte offset of a data view into its array buffer. |obj| must be a\n * DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a data view.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the beginning of the data referenced by a DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(void *)\nJS_GetDataViewData(JSObject *obj);\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitGetterOp.\n */\nclass JSJitGetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitGetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args.rval())\n    {}\n\n    explicit JSJitGetterCallArgs(JS::Rooted<JS::Value>* rooted)\n      : JS::MutableHandleValue(rooted)\n    {}\n\n    JS::MutableHandleValue rval() {\n        return *this;\n    }\n};\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitSetterOp.\n */\nclass JSJitSetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitSetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args[0])\n    {}\n\n    JS::MutableHandleValue operator[](unsigned i) {\n        MOZ_ASSERT(i == 0);\n        return *this;\n    }\n\n    unsigned length() const { return 1; }\n\n    // Add get() or maybe hasDefined() as needed\n};\n\nstruct JSJitMethodCallArgsTraits;\n\n/*\n * A class, expected to be passed by reference, which represents the CallArgs\n * for a JSJitMethodOp.\n */\nclass JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUsedRval>\n{\n  private:\n    typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;\n    friend struct JSJitMethodCallArgsTraits;\n\n  public:\n    explicit JSJitMethodCallArgs(const JS::CallArgs& args) {\n        argv_ = args.array();\n        argc_ = args.length();\n    }\n\n    JS::MutableHandleValue rval() const {\n        return Base::rval();\n    }\n\n    unsigned length() const { return Base::length(); }\n\n    JS::MutableHandleValue operator[](unsigned i) const {\n        return Base::operator[](i);\n    }\n\n    bool hasDefined(unsigned i) const {\n        return Base::hasDefined(i);\n    }\n\n    // Add get() as needed\n};\n\nstruct JSJitMethodCallArgsTraits\n{\n    static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);\n    static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);\n};\n\n/*\n * This struct contains metadata passed from the DOM to the JS Engine for JIT\n * optimizations on DOM property accessors. Eventually, this should be made\n * available to general JSAPI users, but we are not currently ready to do so.\n */\ntypedef bool\n(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitGetterCallArgs args);\ntypedef bool\n(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitSetterCallArgs args);\ntypedef bool\n(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, const JSJitMethodCallArgs& args);\n\nstruct JSJitInfo {\n    enum OpType {\n        Getter,\n        Setter,\n        Method,\n        OpType_None\n    };\n\n    union {\n        JSJitGetterOp getter;\n        JSJitSetterOp setter;\n        JSJitMethodOp method;\n    };\n    uint32_t protoID;\n    uint32_t depth;\n    OpType type;\n    bool isInfallible;      /* Is op fallible? False in setters. */\n    bool isConstant;        /* Getting a construction-time constant? */\n    bool isPure;            /* As long as no non-pure DOM things happen, will\n                               keep returning the same value for the given\n                               \"this\" object\" */\n    JSValueType returnType; /* The return type tag.  Might be JSVAL_TYPE_UNKNOWN */\n\n    /* An alternative native that's safe to call in parallel mode. */\n    JSParallelNative parallelNative;\n};\n\n#define JS_JITINFO_NATIVE_PARALLEL(op)                                         \\\n    {{NULL},0,0,JSJitInfo::OpType_None,false,false,false,JSVAL_TYPE_MISSING,op}\n\nstatic JS_ALWAYS_INLINE const JSJitInfo *\nFUNCTION_VALUE_TO_JITINFO(const JS::Value& v)\n{\n    JS_ASSERT(js::GetObjectClass(&v.toObject()) == js::FunctionClassPtr);\n    return reinterpret_cast<js::shadow::Function *>(&v.toObject())->jitinfo;\n}\n\n/* Statically asserted in jsfun.h. */\nstatic const unsigned JS_FUNCTION_INTERPRETED_BIT = 0x1;\n\nstatic JS_ALWAYS_INLINE void\nSET_JITINFO(JSFunction * func, const JSJitInfo *info)\n{\n    js::shadow::Function *fun = reinterpret_cast<js::shadow::Function *>(func);\n    JS_ASSERT(!(fun->flags & JS_FUNCTION_INTERPRETED_BIT));\n    fun->jitinfo = info;\n}\n\n/*\n * Engine-internal extensions of jsid.  This code is here only until we\n * eliminate Gecko's dependencies on it!\n */\n\nstatic JS_ALWAYS_INLINE jsid\nJSID_FROM_BITS(size_t bits)\n{\n    jsid id;\n    JSID_BITS(id) = bits;\n    return id;\n}\n\n/*\n * Must not be used on atoms that are representable as integer jsids.\n * Prefer NameToId or AtomToId over this function:\n *\n * A PropertyName is an atom that does not contain an integer in the range\n * [0, UINT32_MAX]. However, jsid can only hold an integer in the range\n * [0, JSID_INT_MAX] (where JSID_INT_MAX == 2^31-1).  Thus, for the range of\n * integers (JSID_INT_MAX, UINT32_MAX], to represent as a jsid 'id', it must be\n * the case JSID_IS_ATOM(id) and !JSID_TO_ATOM(id)->isPropertyName().  In most\n * cases when creating a jsid, code does not have to care about this corner\n * case because:\n *\n * - When given an arbitrary JSAtom*, AtomToId must be used, which checks for\n *   integer atoms representable as integer jsids, and does this conversion.\n *\n * - When given a PropertyName*, NameToId can be used which which does not need\n *   to do any dynamic checks.\n *\n * Thus, it is only the rare third case which needs this function, which\n * handles any JSAtom* that is known not to be representable with an int jsid.\n */\nstatic JS_ALWAYS_INLINE jsid\nNON_INTEGER_ATOM_TO_JSID(JSAtom *atom)\n{\n    JS_ASSERT(((size_t)atom & 0x7) == 0);\n    jsid id = JSID_FROM_BITS((size_t)atom);\n    JS_ASSERT(id == INTERNED_STRING_TO_JSID(NULL, (JSString*)atom));\n    return id;\n}\n\n/* All strings stored in jsids are atomized, but are not necessarily property names. */\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id)\n{\n    return JSID_IS_STRING(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id, JSAtom *atom)\n{\n    return id == JSID_FROM_BITS((size_t)atom);\n}\n\nstatic JS_ALWAYS_INLINE JSAtom *\nJSID_TO_ATOM(jsid id)\n{\n    return (JSAtom *)JSID_TO_STRING(id);\n}\n\nJS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD);\n\nnamespace js {\n\nstatic JS_ALWAYS_INLINE Value\nIdToValue(jsid id)\n{\n    if (JSID_IS_STRING(id))\n        return StringValue(JSID_TO_STRING(id));\n    if (JS_LIKELY(JSID_IS_INT(id)))\n        return Int32Value(JSID_TO_INT(id));\n    if (JS_LIKELY(JSID_IS_OBJECT(id)))\n        return ObjectValue(*JSID_TO_OBJECT(id));\n    JS_ASSERT(JSID_IS_VOID(id));\n    return UndefinedValue();\n}\n\nstatic JS_ALWAYS_INLINE jsval\nIdToJsval(jsid id)\n{\n    return IdToValue(id);\n}\n\nextern JS_FRIEND_API(bool)\nIsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method);\n\nextern JS_FRIEND_API(bool)\nIsTypedArrayThisCheck(JS::IsAcceptableThis test);\n\nenum CTypesActivityType {\n    CTYPES_CALL_BEGIN,\n    CTYPES_CALL_END,\n    CTYPES_CALLBACK_BEGIN,\n    CTYPES_CALLBACK_END\n};\n\ntypedef void\n(* CTypesActivityCallback)(JSContext *cx, CTypesActivityType type);\n\n/*\n * Sets a callback that is run whenever js-ctypes is about to be used when\n * calling into C.\n */\nJS_FRIEND_API(void)\nSetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);\n\nclass JS_FRIEND_API(AutoCTypesActivityCallback) {\n  private:\n    JSContext *cx;\n    CTypesActivityCallback callback;\n    CTypesActivityType endType;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n  public:\n    AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,\n                               CTypesActivityType endType\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM);\n    ~AutoCTypesActivityCallback() {\n        DoEndCallback();\n    }\n    void DoEndCallback() {\n        if (callback) {\n            callback(cx, endType);\n            callback = NULL;\n        }\n    }\n};\n\n#ifdef DEBUG\nextern JS_FRIEND_API(void)\nassertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);\n#else\ninline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {};\n#endif\n\ntypedef bool\n(* ObjectMetadataCallback)(JSContext *cx, JSObject **pmetadata);\n\n/*\n * Specify a callback to invoke when creating each JS object in the current\n * compartment, which may return a metadata object to associate with the\n * object. Objects with different metadata have different shape hierarchies,\n * so for efficiency, objects should generally try to share metadata objects.\n */\nJS_FRIEND_API(void)\nSetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback);\n\n/* Manipulate the metadata associated with an object. */\n\nJS_FRIEND_API(bool)\nSetObjectMetadata(JSContext *cx, JS::HandleObject obj, JS::HandleObject metadata);\n\nJS_FRIEND_API(JSObject *)\nGetObjectMetadata(JSObject *obj);\n\n/* ES5 8.12.8. */\nextern JS_FRIEND_API(JSBool)\nDefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp);\n\n/*\n * Helper function. To approximate a call to the [[DefineOwnProperty]] internal\n * method described in ES5, first call this, then call JS_DefinePropertyById.\n *\n * JS_DefinePropertyById by itself does not enforce the invariants on\n * non-configurable properties when obj->isNative(). This function performs the\n * relevant checks (specified in ES5 8.12.9 [[DefineOwnProperty]] steps 1-11),\n * but only if obj is native.\n *\n * The reason for the messiness here is that ES5 uses [[DefineOwnProperty]] as\n * a sort of extension point, but there is no hook in js::Class,\n * js::ProxyHandler, or the JSAPI with precisely the right semantics for it.\n */\nextern JS_FRIEND_API(bool)\nCheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSBool)\njs_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,\n                     const js::PropertyDescriptor& descriptor, JSBool *bp);\n\nextern JS_FRIEND_API(JSBool)\njs_ReportIsNotFunction(JSContext *cx, const JS::Value& v);\n\n#ifdef JSGC_GENERATIONAL\nextern JS_FRIEND_API(void)\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data);\n\nextern JS_FRIEND_API(void)\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data);\n#else\ninline void\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data) {}\n\ninline void\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data) {}\n#endif /* JSGC_GENERATIONAL */\n\n#endif /* jsfriendapi_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jslock.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jslock_h\n#define jslock_h\n\n#ifdef JS_THREADSAFE\n\n# include \"jsapi.h\"\n# include \"pratom.h\"\n# include \"prcvar.h\"\n# include \"prinit.h\"\n# include \"prlock.h\"\n# include \"prthread.h\"\n\n# define JS_ATOMIC_INCREMENT(p)      PR_ATOMIC_INCREMENT((int32_t *)(p))\n# define JS_ATOMIC_DECREMENT(p)      PR_ATOMIC_DECREMENT((int32_t *)(p))\n# define JS_ATOMIC_ADD(p,v)          PR_ATOMIC_ADD((int32_t *)(p), (int32_t)(v))\n# define JS_ATOMIC_SET(p,v)          PR_ATOMIC_SET((int32_t *)(p), (int32_t)(v))\n\nnamespace js {\n    // Defined in jsgc.cpp.\n    unsigned GetCPUCount();\n}\n\n#else  /* JS_THREADSAFE */\n\ntypedef struct PRThread PRThread;\ntypedef struct PRCondVar PRCondVar;\ntypedef struct PRLock PRLock;\n\n# define JS_ATOMIC_INCREMENT(p)      (++*(p))\n# define JS_ATOMIC_DECREMENT(p)      (--*(p))\n# define JS_ATOMIC_ADD(p,v)          (*(p) += (v))\n# define JS_ATOMIC_SET(p,v)          (*(p) = (v))\n\n#endif /* JS_THREADSAFE */\n\n#endif /* jslock_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsperf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef perf_jsperf_h\n#define perf_jsperf_h\n\n#include \"jsapi.h\"\n\nnamespace JS {\n\n/*\n * JS::PerfMeasurement is a generic way to access detailed performance\n * measurement APIs provided by your operating system.  The details of\n * exactly how this works and what can be measured are highly\n * system-specific, but this interface is (one hopes) implementable\n * on top of all of them.\n *\n * To use this API, create a PerfMeasurement object, passing its\n * constructor a bitmask indicating which events you are interested\n * in.  Thereafter, Start() zeroes all counters and starts timing;\n * Stop() stops timing again; and the counters for the events you\n * requested are available as data values after calling Stop().  The\n * object may be reused for many measurements.\n */\nclass JS_FRIEND_API(PerfMeasurement)\n{\n  protected:\n    // Implementation-specific data, if any.\n    void* impl;\n\n  public:\n    /*\n     * Events that may be measured.  Taken directly from the list of\n     * \"generalized hardware performance event types\" in the Linux\n     * perf_event API, plus some of the \"software events\".\n     */\n    enum EventMask {\n        CPU_CYCLES          = 0x00000001,\n        INSTRUCTIONS        = 0x00000002,\n        CACHE_REFERENCES    = 0x00000004,\n        CACHE_MISSES        = 0x00000008,\n        BRANCH_INSTRUCTIONS = 0x00000010,\n        BRANCH_MISSES       = 0x00000020,\n        BUS_CYCLES          = 0x00000040,\n        PAGE_FAULTS         = 0x00000080,\n        MAJOR_PAGE_FAULTS   = 0x00000100,\n        CONTEXT_SWITCHES    = 0x00000200,\n        CPU_MIGRATIONS      = 0x00000400,\n\n        ALL                 = 0x000007ff,\n        NUM_MEASURABLE_EVENTS  = 11\n    };\n\n    /*\n     * Bitmask of events that will be measured when this object is\n     * active (between Start() and Stop()).  This may differ from the\n     * bitmask passed to the constructor if the platform does not\n     * support measuring all of the requested events.\n     */\n    const EventMask eventsMeasured;\n\n    /*\n     * Counters for each measurable event.\n     * Immediately after one of these objects is created, all of the\n     * counters for enabled events will be zero, and all of the\n     * counters for disabled events will be uint64_t(-1).\n     */\n    uint64_t cpu_cycles;\n    uint64_t instructions;\n    uint64_t cache_references;\n    uint64_t cache_misses;\n    uint64_t branch_instructions;\n    uint64_t branch_misses;\n    uint64_t bus_cycles;\n    uint64_t page_faults;\n    uint64_t major_page_faults;\n    uint64_t context_switches;\n    uint64_t cpu_migrations;\n\n    /*\n     * Prepare to measure the indicated set of events.  If not all of\n     * the requested events can be measured on the current platform,\n     * then the eventsMeasured bitmask will only include the subset of\n     * |toMeasure| corresponding to the events that can be measured.\n     */\n    PerfMeasurement(EventMask toMeasure);\n\n    /* Done with this set of measurements, tear down OS-level state. */\n    ~PerfMeasurement();\n\n    /* Start a measurement cycle. */\n    void start();\n\n    /*\n     * End a measurement cycle, and for each enabled counter, add the\n     * number of measured events of that type to the appropriate\n     * visible variable.\n     */\n    void stop();\n\n    /* Reset all enabled counters to zero. */\n    void reset();\n\n    /*\n     * True if this platform supports measuring _something_, i.e. it's\n     * not using the stub implementation.\n     */\n    static bool canMeasureSomething();\n};\n\n/* Inject a Javascript wrapper around the above C++ class into the\n * Javascript object passed as an argument (this will normally be a\n * global object).  The JS-visible API is identical to the C++ API.\n */\nextern JS_FRIEND_API(JSObject*)\n    RegisterPerfMeasurement(JSContext *cx, JSObject *global);\n\n/*\n * Given a jsval which contains an instance of the aforementioned\n * wrapper class, extract the C++ object.  Returns NULL if the\n * jsval is not an instance of the wrapper.\n */\nextern JS_FRIEND_API(PerfMeasurement*)\n    ExtractPerfMeasurement(jsval wrapper);\n\n} // namespace JS\n\n#endif /* perf_jsperf_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsprf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprf_h\n#define jsprf_h\n\n/*\n** API for PR printf like routines. Supports the following formats\n**      %d - decimal\n**      %u - unsigned decimal\n**      %x - unsigned hex\n**      %X - unsigned uppercase hex\n**      %o - unsigned octal\n**      %hd, %hu, %hx, %hX, %ho - 16-bit versions of above\n**      %ld, %lu, %lx, %lX, %lo - 32-bit versions of above\n**      %lld, %llu, %llx, %llX, %llo - 64 bit versions of above\n**      %s - ascii string\n**      %hs - ucs2 string\n**      %c - character\n**      %p - pointer (deals with machine dependent pointer size)\n**      %f - float\n**      %g - float\n*/\n\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"jstypes.h\"\n\n/*\n** sprintf into a fixed size buffer. Guarantees that a NUL is at the end\n** of the buffer. Returns the length of the written output, NOT including\n** the NUL, or (uint32_t)-1 if an error occurs.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);\n\n/*\n** sprintf into a malloc'd buffer. Return a pointer to the malloc'd\n** buffer on success, NULL on failure. Call \"JS_smprintf_free\" to release\n** the memory returned.\n*/\nextern JS_PUBLIC_API(char*) JS_smprintf(const char *fmt, ...);\n\n/*\n** Free the memory allocated, for the caller, by JS_smprintf\n*/\nextern JS_PUBLIC_API(void) JS_smprintf_free(char *mem);\n\n/*\n** \"append\" sprintf into a malloc'd buffer. \"last\" is the last value of\n** the malloc'd buffer. sprintf will append data to the end of last,\n** growing it as necessary using realloc. If last is NULL, JS_sprintf_append\n** will allocate the initial string. The return value is the new value of\n** last for subsequent calls, or NULL if there is a malloc failure.\n*/\nextern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...);\n\n/*\n** sprintf into a function. The function \"f\" is called with a string to\n** place into the output. \"arg\" is an opaque pointer used by the stuff\n** function to hold any state needed to do the storage of the output\n** data. The return value is a count of the number of characters fed to\n** the stuff function, or (uint32_t)-1 if an error occurs.\n*/\ntypedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);\n\nextern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);\n\n/*\n** va_list forms of the above.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsmprintf(const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsprintf_append(char *last, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(uint32_t) JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap);\n\n#endif /* jsprf_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsprototypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A higher-order macro for enumerating all JSProtoKey values. */\n\n#ifndef jsprototypes_h\n#define jsprototypes_h\n\n#include \"jsversion.h\"\n\n/*\n * Enumerator codes in the second column must not change -- they are part of\n * the JS XDR API.  Also note the symbols in the third column are extern \"C\";\n * clients should use extern \"C\" {} as appropriate when using this macro.\n */\n\n#define JS_FOR_EACH_PROTOTYPE(macro) \\\n    macro(Null,                   0,     js_InitNullClass) \\\n    macro(Object,                 1,     js_InitObjectClass) \\\n    macro(Function,               2,     js_InitFunctionClass) \\\n    macro(Array,                  3,     js_InitArrayClass) \\\n    macro(Boolean,                4,     js_InitBooleanClass) \\\n    macro(JSON,                   5,     js_InitJSONClass) \\\n    macro(Date,                   6,     js_InitDateClass) \\\n    macro(Math,                   7,     js_InitMathClass) \\\n    macro(Number,                 8,     js_InitNumberClass) \\\n    macro(String,                 9,     js_InitStringClass) \\\n    macro(RegExp,                10,     js_InitRegExpClass) \\\n    macro(Error,                 11,     js_InitExceptionClasses) \\\n    macro(InternalError,         12,     js_InitExceptionClasses) \\\n    macro(EvalError,             13,     js_InitExceptionClasses) \\\n    macro(RangeError,            14,     js_InitExceptionClasses) \\\n    macro(ReferenceError,        15,     js_InitExceptionClasses) \\\n    macro(SyntaxError,           16,     js_InitExceptionClasses) \\\n    macro(TypeError,             17,     js_InitExceptionClasses) \\\n    macro(URIError,              18,     js_InitExceptionClasses) \\\n    macro(Iterator,              19,     js_InitIteratorClasses) \\\n    macro(StopIteration,         20,     js_InitIteratorClasses) \\\n    macro(ArrayBuffer,           21,     js_InitTypedArrayClasses) \\\n    macro(Int8Array,             22,     js_InitTypedArrayClasses) \\\n    macro(Uint8Array,            23,     js_InitTypedArrayClasses) \\\n    macro(Int16Array,            24,     js_InitTypedArrayClasses) \\\n    macro(Uint16Array,           25,     js_InitTypedArrayClasses) \\\n    macro(Int32Array,            26,     js_InitTypedArrayClasses) \\\n    macro(Uint32Array,           27,     js_InitTypedArrayClasses) \\\n    macro(Float32Array,          28,     js_InitTypedArrayClasses) \\\n    macro(Float64Array,          29,     js_InitTypedArrayClasses) \\\n    macro(Uint8ClampedArray,     30,     js_InitTypedArrayClasses) \\\n    macro(Proxy,                 31,     js_InitProxyClass) \\\n    macro(WeakMap,               32,     js_InitWeakMapClass) \\\n    macro(Map,                   33,     js_InitMapClass) \\\n    macro(Set,                   34,     js_InitSetClass) \\\n    macro(DataView,              35,     js_InitTypedArrayClasses) \\\n    macro(ParallelArray,         36,     js_InitParallelArrayClass) \\\n    macro(Intl,                  37,     js_InitIntlClass) \\\n    macro(Type,                  38,     js_InitBinaryDataClasses) \\\n    macro(Data,                  39,     js_InitBinaryDataClasses) \\\n    macro(uint8,                 40,     js_InitBinaryDataClasses) \\\n    macro(uint16,                41,     js_InitBinaryDataClasses) \\\n    macro(uint32,                42,     js_InitBinaryDataClasses) \\\n    macro(uint64,                43,     js_InitBinaryDataClasses) \\\n    macro(int8,                  44,     js_InitBinaryDataClasses) \\\n    macro(int16,                 45,     js_InitBinaryDataClasses) \\\n    macro(int32,                 46,     js_InitBinaryDataClasses) \\\n    macro(int64,                 47,     js_InitBinaryDataClasses) \\\n    macro(float32,               48,     js_InitBinaryDataClasses) \\\n    macro(float64,               49,     js_InitBinaryDataClasses) \\\n    macro(ArrayType,             50,     js_InitBinaryDataClasses) \\\n    macro(StructType,            51,     js_InitBinaryDataClasses) \\\n    macro(ArrayTypeObject,       52,     js_InitBinaryDataClasses) \\\n\n#endif /* jsprototypes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsproxy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsproxy_h\n#define jsproxy_h\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nnamespace js {\n\nclass JS_FRIEND_API(Wrapper);\n\n/*\n * A proxy is a JSObject that implements generic behavior by providing custom\n * implementations for each object trap. The implementation for each trap is\n * provided by a C++ object stored on the proxy, known as its handler.\n *\n * A major use case for proxies is to forward each trap to another object,\n * known as its target. The target can be an arbitrary C++ object. Not every\n * proxy has the notion of a target, however.\n *\n * Proxy traps are grouped into fundamental and derived traps. Every proxy has\n * to at least provide implementations for the fundamental traps, but the\n * derived traps can be implemented in terms of the fundamental ones\n * BaseProxyHandler provides implementations of the derived traps in terms of\n * the (pure virtual) fundamental traps.\n *\n * To minimize code duplication, a set of abstract proxy handler classes is\n * provided, from which other handlers may inherit. These abstract classes\n * are organized in the following hierarchy:\n *\n * BaseProxyHandler\n * |\n * DirectProxyHandler\n * |\n * Wrapper\n */\n\n/*\n * BaseProxyHandler is the most generic kind of proxy handler. It does not make\n * any assumptions about the target. Consequently, it does not provide any\n * default implementation for the fundamental traps. It does, however, implement\n * the derived traps in terms of the fundamental ones. This allows consumers of\n * this class to define any custom behavior they want.\n */\nclass JS_FRIEND_API(BaseProxyHandler)\n{\n    void *mFamily;\n    bool mHasPrototype;\n    bool mHasPolicy;\n  protected:\n    // Subclasses may set this in their constructor.\n    void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }\n    void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; }\n\n  public:\n    explicit BaseProxyHandler(void *family);\n    virtual ~BaseProxyHandler();\n\n    bool hasPrototype() {\n        return mHasPrototype;\n    }\n\n    bool hasPolicy() {\n        return mHasPolicy;\n    }\n\n    inline void *family() {\n        return mFamily;\n    }\n\n    virtual bool isOuterWindow() {\n        return false;\n    }\n\n    virtual bool finalizeInBackground(Value priv) {\n        /*\n         * Called on creation of a proxy to determine whether its finalize\n         * method can be finalized on the background thread.\n         */\n        return true;\n    }\n\n    /* Policy enforcement traps.\n     *\n     * enter() allows the policy to specify whether the caller may perform |act|\n     * on the proxy's |id| property. In the case when |act| is CALL, |id| is\n     * generally JSID_VOID.\n     *\n     * The |act| parameter to enter() specifies the action being performed.\n     * If |bp| is false, the trap suggests that the caller throw (though it\n     * may still decide to squelch the error).\n     */\n    enum Action {\n        GET,\n        SET,\n        CALL\n    };\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,\n                       bool *bp);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) = 0;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) = 0;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) = 0;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) = 0;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp);\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp);\n    virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) = 0;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    virtual const char *className(JSContext *cx, HandleObject proxy);\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    virtual void finalize(JSFreeOp *fop, JSObject *proxy);\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp, bool *present);\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    /* See comment for weakmapKeyDelegateOp in jsclass.h. */\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/*\n * DirectProxyHandler includes a notion of a target object. All traps are\n * reimplemented such that they forward their behavior to the target. This\n * allows consumers of this class to forward to another object as transparently\n * and efficiently as possible.\n */\nclass JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler\n{\n  public:\n    explicit DirectProxyHandler(void *family);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,\n                         bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy,\n                           AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id,\n                     bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id,\n                        bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject proxy,\n                      AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy,\n                                 RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */\nclass Proxy\n{\n  public:\n    /* ES5 Harmony fundamental proxy traps. */\n    static bool preventExtensions(JSContext *cx, HandleObject proxy);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                      PropertyDescriptor *desc, unsigned flags);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                      MutableHandleValue vp);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                         PropertyDescriptor *desc, unsigned flags);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                         MutableHandleValue vp);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v);\n    static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n\n    /* ES5 Harmony derived proxy traps. */\n    static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    MutableHandleValue vp);\n    static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                                    uint32_t index, MutableHandleValue vp, bool *present);\n    static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    bool strict, MutableHandleValue vp);\n    static bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    static bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible);\n    static bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    static bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    static const char *className(JSContext *cx, HandleObject proxy);\n    static JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    static bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    static bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    static bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static JSObject * const LazyProto;\n};\n\ninline bool IsObjectProxyClass(const Class *clasp)\n{\n    return clasp == js::ObjectProxyClassPtr || clasp == js::OuterWindowProxyClassPtr;\n}\n\ninline bool IsFunctionProxyClass(const Class *clasp)\n{\n    return clasp == js::FunctionProxyClassPtr;\n}\n\ninline bool IsProxyClass(const Class *clasp)\n{\n    return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp);\n}\n\ninline bool IsObjectProxy(JSObject *obj)\n{\n    return IsObjectProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsFunctionProxy(JSObject *obj)\n{\n    return IsFunctionProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsProxy(JSObject *obj)\n{\n    return IsProxyClass(GetObjectClass(obj));\n}\n\n/*\n * These are part of the API.\n *\n * NOTE: PROXY_PRIVATE_SLOT is 0 because that way slot 0 is usable by API\n * clients for both proxy and non-proxy objects.  So an API client that only\n * needs to store one slot's worth of data doesn't need to branch on what sort\n * of object it has.\n */\nconst uint32_t PROXY_PRIVATE_SLOT = 0;\nconst uint32_t PROXY_HANDLER_SLOT = 1;\nconst uint32_t PROXY_EXTRA_SLOT   = 2;\n\ninline BaseProxyHandler *\nGetProxyHandler(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return (BaseProxyHandler *) GetReservedSlot(obj, PROXY_HANDLER_SLOT).toPrivate();\n}\n\ninline const Value &\nGetProxyPrivate(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_PRIVATE_SLOT);\n}\n\ninline JSObject *\nGetProxyTargetObject(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetProxyPrivate(obj).toObjectOrNull();\n}\n\ninline const Value &\nGetProxyExtra(JSObject *obj, size_t n)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_EXTRA_SLOT + n);\n}\n\ninline void\nSetProxyHandler(JSObject *obj, BaseProxyHandler *handler)\n{\n    JS_ASSERT(IsProxy(obj));\n    SetReservedSlot(obj, PROXY_HANDLER_SLOT, PrivateValue(handler));\n}\n\ninline void\nSetProxyExtra(JSObject *obj, size_t n, const Value &extra)\n{\n    JS_ASSERT(IsProxy(obj));\n    JS_ASSERT(n <= 1);\n    SetReservedSlot(obj, PROXY_EXTRA_SLOT + n, extra);\n}\n\nenum ProxyCallable {\n    ProxyNotCallable = false,\n    ProxyIsCallable = true\n};\n\nJS_FRIEND_API(JSObject *)\nNewProxyObject(JSContext *cx, BaseProxyHandler *handler, HandleValue priv,\n               JSObject *proto, JSObject *parent, ProxyCallable callable = ProxyNotCallable);\n\nJSObject *\nRenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv);\n\nclass JS_FRIEND_API(AutoEnterPolicy)\n{\n  public:\n    typedef BaseProxyHandler::Action Action;\n    AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler,\n                    HandleObject wrapper, HandleId id, Action act, bool mayThrow)\n#ifdef DEBUG\n        : context(NULL)\n#endif\n    {\n        allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv)\n                                     : true;\n        recordEnter(cx, wrapper, id);\n        // We want to throw an exception if all of the following are true:\n        // * The policy disallowed access.\n        // * The policy set rv to false, indicating that we should throw.\n        // * The caller did not instruct us to ignore exceptions.\n        // * The policy did not throw itself.\n        if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx))\n            reportError(cx, id);\n    }\n\n    virtual ~AutoEnterPolicy() { recordLeave(); }\n    inline bool allowed() { return allow; }\n    inline bool returnValue() { JS_ASSERT(!allowed()); return rv; }\n\n  protected:\n    // no-op constructor for subclass\n    AutoEnterPolicy()\n#ifdef DEBUG\n        : context(NULL)\n#endif\n        {};\n    void reportError(JSContext *cx, jsid id);\n    bool allow;\n    bool rv;\n\n#ifdef DEBUG\n    JSContext *context;\n    mozilla::Maybe<HandleObject> enteredProxy;\n    mozilla::Maybe<HandleId> enteredId;\n    // NB: We explicitly don't track the entered action here, because sometimes\n    // SET traps do an implicit GET during their implementation, leading to\n    // spurious assertions.\n    AutoEnterPolicy *prev;\n    void recordEnter(JSContext *cx, HandleObject proxy, HandleId id);\n    void recordLeave();\n\n    friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id);\n#else\n    inline void recordEnter(JSContext *cx, JSObject *proxy, jsid id) {}\n    inline void recordLeave() {}\n#endif\n\n};\n\n#ifdef DEBUG\nclass JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {\npublic:\n    AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id)\n    {\n        allow = true;\n        recordEnter(cx, proxy, id);\n    }\n};\n#else\nclass JS_FRIEND_API(AutoWaivePolicy) {\n    public: AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) {};\n};\n#endif\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSObject *)\njs_InitProxyClass(JSContext *cx, JS::HandleObject obj);\n\n#endif /* jsproxy_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsprvtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprvtd_h\n#define jsprvtd_h\n/*\n * JS private typename definitions.\n *\n * This header is included only in other .h files, for convenience and for\n * simplicity of type naming.  The alternative for structures is to use tags,\n * which are named the same as their typedef names (legal in C/C++, and less\n * noisy than suffixing the typedef name with \"Struct\" or \"Str\").  Instead,\n * all .h files that include this file may use the same typedef name, whether\n * declaring a pointer to struct type, or defining a member of struct type.\n *\n * A few fundamental scalar types are defined here too.  Neither the scalar\n * nor the struct typedefs should change much, therefore the nearly-global\n * make dependency induced by this file should not prove painful.\n */\n\n#include \"jsapi.h\"\n#include \"jsutil.h\"\n\n#include \"js/HashTable.h\"\n#include \"js/Vector.h\"\n\n/*\n * Convenience constants.\n */\n#define JS_BITS_PER_UINT32_LOG2 5\n#define JS_BITS_PER_UINT32      32\n\n/* The alignment required of objects stored in GC arenas. */\nstatic const unsigned JS_GCTHING_ALIGN = 8;\nstatic const unsigned JS_GCTHING_ZEROBITS = 3;\n\n/* Scalar typedefs. */\ntypedef uint8_t     jsbytecode;\ntypedef uint8_t     jssrcnote;\ntypedef uintptr_t   jsatomid;\n\n/* Struct typedefs. */\ntypedef struct JSGCThing            JSGCThing;\ntypedef struct JSGenerator          JSGenerator;\ntypedef struct JSNativeEnumerator   JSNativeEnumerator;\ntypedef struct JSTryNote            JSTryNote;\n\n/* Friend \"Advanced API\" typedefs. */\ntypedef struct JSAtomState          JSAtomState;\ntypedef struct JSCodeSpec           JSCodeSpec;\ntypedef struct JSPrinter            JSPrinter;\ntypedef struct JSStackHeader        JSStackHeader;\ntypedef struct JSSubString          JSSubString;\ntypedef struct JSSpecializedNative  JSSpecializedNative;\n\n/* String typedefs. */\nclass JSDependentString;\nclass JSExtensibleString;\nclass JSExternalString;\nclass JSLinearString;\nclass JSRope;\nclass JSAtom;\nclass JSWrapper;\n\nnamespace js {\n\nstruct ArgumentsData;\nstruct Class;\n\nclass AutoNameVector;\nclass RegExpGuard;\nclass RegExpObject;\nclass RegExpObjectBuilder;\nclass RegExpShared;\nclass RegExpStatics;\nclass MatchPairs;\nclass PropertyName;\nclass LazyScript;\n\nenum RegExpFlag\n{\n    IgnoreCaseFlag  = 0x01,\n    GlobalFlag      = 0x02,\n    MultilineFlag   = 0x04,\n    StickyFlag      = 0x08,\n\n    NoFlags         = 0x00,\n    AllFlags        = 0x0f\n};\n\nclass StringBuffer;\n\nclass FrameRegs;\nclass StackFrame;\nclass ScriptFrameIter;\n\nclass Proxy;\nclass JS_FRIEND_API(AutoEnterPolicy);\nclass JS_FRIEND_API(BaseProxyHandler);\nclass JS_FRIEND_API(Wrapper);\nclass JS_FRIEND_API(CrossCompartmentWrapper);\n\nclass TempAllocPolicy;\nclass RuntimeAllocPolicy;\n\nclass GlobalObject;\n\ntemplate <typename K,\n          typename V,\n          size_t InlineElems>\nclass InlineMap;\n\nclass LifoAlloc;\n\nclass Shape;\n\nclass Breakpoint;\nclass BreakpointSite;\nclass Debugger;\nclass WatchpointMap;\n\n/*\n * Env is the type of what ES5 calls \"lexical environments\" (runtime\n * activations of lexical scopes). This is currently just JSObject, and is\n * implemented by Call, Block, With, and DeclEnv objects, among others--but\n * environments and objects are really two different concepts.\n */\ntypedef JSObject Env;\n\ntypedef JSNative             Native;\ntypedef JSParallelNative     ParallelNative;\ntypedef JSThreadSafeNative   ThreadSafeNative;\ntypedef JSPropertyOp         PropertyOp;\ntypedef JSStrictPropertyOp   StrictPropertyOp;\ntypedef JSPropertyDescriptor PropertyDescriptor;\n\nstruct SourceCompressionToken;\n\nnamespace frontend {\n\nstruct BytecodeEmitter;\nstruct Definition;\nclass FullParseHandler;\nclass FunctionBox;\nclass ObjectBox;\nstruct Token;\nstruct TokenPos;\nclass TokenStream;\nclass ParseMapPool;\nclass ParseNode;\n\ntemplate <typename ParseHandler>\nclass Parser;\n\n} /* namespace frontend */\n\nnamespace analyze {\n\nstruct LifetimeVariable;\nclass LoopAnalysis;\nclass ScriptAnalysis;\nclass SlotValue;\nclass SSAValue;\nclass SSAUseChain;\n\n} /* namespace analyze */\n\nnamespace types {\n\nclass TypeSet;\nstruct TypeCallsite;\nstruct TypeObject;\nstruct TypeCompartment;\n\n} /* namespace types */\n\ntypedef JS::Handle<Shape*>             HandleShape;\ntypedef JS::Handle<types::TypeObject*> HandleTypeObject;\ntypedef JS::Handle<JSAtom*>            HandleAtom;\ntypedef JS::Handle<PropertyName*>      HandlePropertyName;\n\ntypedef JS::MutableHandle<Shape*>      MutableHandleShape;\ntypedef JS::MutableHandle<JSAtom*>     MutableHandleAtom;\n\ntypedef JS::Rooted<Shape*>             RootedShape;\ntypedef JS::Rooted<types::TypeObject*> RootedTypeObject;\ntypedef JS::Rooted<JSAtom*>            RootedAtom;\ntypedef JS::Rooted<PropertyName*>      RootedPropertyName;\n\nenum XDRMode {\n    XDR_ENCODE,\n    XDR_DECODE\n};\n\ntemplate <XDRMode mode>\nclass XDRState;\n\nclass FreeOp;\n\nstruct IdValuePair\n{\n    jsid id;\n    Value value;\n\n    IdValuePair() {}\n    IdValuePair(jsid idArg)\n      : id(idArg), value(UndefinedValue())\n    {}\n};\n\n} /* namespace js */\n\nnamespace JSC {\n\nclass ExecutableAllocator;\n\n} /* namespace JSC */\n\nnamespace WTF {\n\nclass BumpPointerAllocator;\n\n} /* namespace WTF */\n\n/* \"Friend\" types used by jscntxt.h and jsdbgapi.h. */\ntypedef enum JSTrapStatus {\n    JSTRAP_ERROR,\n    JSTRAP_CONTINUE,\n    JSTRAP_RETURN,\n    JSTRAP_THROW,\n    JSTRAP_LIMIT\n} JSTrapStatus;\n\ntypedef JSTrapStatus\n(* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                  jsval closure);\n\ntypedef JSTrapStatus\n(* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                    void *closure);\n\ntypedef JSTrapStatus\n(* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                      void *closure);\n\ntypedef JSTrapStatus\n(* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                void *closure);\n\ntypedef JSBool\n(* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old,\n                        jsval *newp, void *closure);\n\n/* called just after script creation */\ntypedef void\n(* JSNewScriptHook)(JSContext  *cx,\n                    const char *filename,  /* URL of script */\n                    unsigned   lineno,     /* first line */\n                    JSScript   *script,\n                    JSFunction *fun,\n                    void       *callerdata);\n\n/* called just before script destruction */\ntypedef void\n(* JSDestroyScriptHook)(JSFreeOp *fop,\n                        JSScript *script,\n                        void     *callerdata);\n\ntypedef void\n(* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str,\n                    size_t length, void **listenerTSData, void *closure);\n\n/* js::ObjectOps function pointer typedefs. */\n\n/*\n * A generic type for functions mapping an object to another object, or null\n * if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSObjectOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/* Signature for class initialization ops. */\ntypedef JSObject *\n(* JSClassInitializerOp)(JSContext *cx, JS::HandleObject obj);\n\n/*\n * Hook that creates an iterator object for a given object. Returns the\n * iterator object or null if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, JSBool keysonly);\n\n\n#endif /* jsprvtd_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jspubtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jspubtd_h\n#define jspubtd_h\n\n/*\n * JS public API typedefs.\n */\n\n#include \"mozilla/PodOperations.h\"\n\n#include \"jsprototypes.h\"\n#include \"jstypes.h\"\n\n#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || defined(DEBUG)\n# define JSGC_TRACK_EXACT_ROOTS\n#endif\n\nnamespace JS {\n\n/*\n * Allow headers to reference JS::Value without #including the whole jsapi.h.\n * Unfortunately, typedefs (hence jsval) cannot be declared.\n */\nclass Value;\n\ntemplate <typename T>\nclass Rooted;\n\nclass JS_PUBLIC_API(AutoGCRooter);\n\nstruct Zone;\n\n} /* namespace JS */\n\n/*\n * In release builds, jsid is defined to be an integral type. This\n * prevents many bugs from being caught at compile time. E.g.:\n *\n *  jsid id = ...\n *  if (id == JS_TRUE)  // error\n *    ...\n *\n *  size_t n = id;      // error\n *\n * To catch more errors, jsid is given a struct type in C++ debug builds.\n * Struct assignment and (in C++) operator== allow correct code to be mostly\n * oblivious to the change. This feature can be explicitly disabled in debug\n * builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES.\n */\n// Needed for cocos2d-js\n#define JS_NO_JSVAL_JSID_STRUCT_TYPES\n# if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)\n#  define JS_USE_JSID_STRUCT_TYPES\n# endif\n\n# ifdef JS_USE_JSID_STRUCT_TYPES\nstruct jsid\n{\n    size_t asBits;\n    bool operator==(jsid rhs) const { return asBits == rhs.asBits; }\n    bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }\n};\n#  define JSID_BITS(id) (id.asBits)\n# else  /* defined(JS_USE_JSID_STRUCT_TYPES) */\ntypedef ptrdiff_t jsid;\n#  define JSID_BITS(id) (id)\n# endif  /* defined(JS_USE_JSID_STRUCT_TYPES) */\n\n#ifdef WIN32\ntypedef wchar_t   jschar;\n#else\ntypedef uint16_t  jschar;\n#endif\n\n/*\n * Run-time version enumeration.  For compile-time version checking, please use\n * the JS_HAS_* macros in jsversion.h, or use MOZJS_MAJOR_VERSION,\n * MOZJS_MINOR_VERSION, MOZJS_PATCH_VERSION, and MOZJS_ALPHA definitions.\n */\ntypedef enum JSVersion {\n    JSVERSION_ECMA_3  = 148,\n    JSVERSION_1_6     = 160,\n    JSVERSION_1_7     = 170,\n    JSVERSION_1_8     = 180,\n    JSVERSION_ECMA_5  = 185,\n    JSVERSION_DEFAULT = 0,\n    JSVERSION_UNKNOWN = -1,\n    JSVERSION_LATEST  = JSVERSION_ECMA_5\n} JSVersion;\n\n/* Result of typeof operator enumeration. */\ntypedef enum JSType {\n    JSTYPE_VOID,                /* undefined */\n    JSTYPE_OBJECT,              /* object */\n    JSTYPE_FUNCTION,            /* function */\n    JSTYPE_STRING,              /* string */\n    JSTYPE_NUMBER,              /* number */\n    JSTYPE_BOOLEAN,             /* boolean */\n    JSTYPE_NULL,                /* null */\n    JSTYPE_LIMIT\n} JSType;\n\n/* Dense index into cached prototypes and class atoms for standard objects. */\ntypedef enum JSProtoKey {\n#define PROTOKEY_AND_INITIALIZER(name,code,init) JSProto_##name = code,\n    JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)\n#undef JS_PROTO\n    JSProto_LIMIT\n} JSProtoKey;\n\n/* js_CheckAccess mode enumeration. */\ntypedef enum JSAccessMode {\n    JSACC_PROTO  = 0,           /* XXXbe redundant w.r.t. id */\n\n                                /*\n                                 * enum value #1 formerly called JSACC_PARENT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n                                /*\n                                 * enum value #2 formerly called JSACC_IMPORT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n    JSACC_WATCH  = 3,           /* a watchpoint on object foo for id 'bar' */\n    JSACC_READ   = 4,           /* a \"get\" of foo.bar */\n    JSACC_WRITE  = 8,           /* a \"set\" of foo.bar = baz */\n    JSACC_LIMIT\n} JSAccessMode;\n\n#define JSACC_TYPEMASK          (JSACC_WRITE - 1)\n\n/*\n * This enum type is used to control the behavior of a JSObject property\n * iterator function that has type JSNewEnumerate.\n */\ntypedef enum JSIterateOp {\n    /* Create new iterator state over enumerable properties. */\n    JSENUMERATE_INIT,\n\n    /* Create new iterator state over all properties. */\n    JSENUMERATE_INIT_ALL,\n\n    /* Iterate once. */\n    JSENUMERATE_NEXT,\n\n    /* Destroy iterator state. */\n    JSENUMERATE_DESTROY\n} JSIterateOp;\n\n/* See JSVAL_TRACE_KIND and JSTraceCallback in jsapi.h. */\ntypedef enum {\n    JSTRACE_OBJECT,\n    JSTRACE_STRING,\n    JSTRACE_SCRIPT,\n\n    /*\n     * Trace kinds internal to the engine. The embedding can only see them if\n     * it implements JSTraceCallback.\n     */\n    JSTRACE_LAZY_SCRIPT,\n    JSTRACE_IONCODE,\n    JSTRACE_SHAPE,\n    JSTRACE_BASE_SHAPE,\n    JSTRACE_TYPE_OBJECT,\n    JSTRACE_LAST = JSTRACE_TYPE_OBJECT\n} JSGCTraceKind;\n\n/* Struct typedefs and class forward declarations. */\ntypedef struct JSClass                      JSClass;\ntypedef struct JSCompartment                JSCompartment;\ntypedef struct JSConstDoubleSpec            JSConstDoubleSpec;\ntypedef struct JSContext                    JSContext;\ntypedef struct JSCrossCompartmentCall       JSCrossCompartmentCall;\ntypedef struct JSErrorReport                JSErrorReport;\ntypedef struct JSExceptionState             JSExceptionState;\ntypedef struct JSFunctionSpec               JSFunctionSpec;\ntypedef struct JSIdArray                    JSIdArray;\ntypedef struct JSLocaleCallbacks            JSLocaleCallbacks;\ntypedef struct JSObjectMap                  JSObjectMap;\ntypedef struct JSPrincipals                 JSPrincipals;\ntypedef struct JSPropertyDescriptor         JSPropertyDescriptor;\ntypedef struct JSPropertyName               JSPropertyName;\ntypedef struct JSPropertySpec               JSPropertySpec;\ntypedef struct JSRuntime                    JSRuntime;\ntypedef struct JSSecurityCallbacks          JSSecurityCallbacks;\ntypedef struct JSStructuredCloneCallbacks   JSStructuredCloneCallbacks;\ntypedef struct JSStructuredCloneReader      JSStructuredCloneReader;\ntypedef struct JSStructuredCloneWriter      JSStructuredCloneWriter;\ntypedef struct JSTracer                     JSTracer;\n\nclass                                       JSFlatString;\nclass                                       JSFunction;\nclass                                       JSObject;\nclass                                       JSScript;\nclass                                       JSStableString;  // long story\nclass                                       JSString;\n\n#ifdef JS_THREADSAFE\ntypedef struct PRCallOnceType    JSCallOnceType;\n#else\ntypedef JSBool                   JSCallOnceType;\n#endif\ntypedef JSBool                 (*JSInitCallback)(void);\n\nnamespace JS {\nnamespace shadow {\n\nstruct Runtime\n{\n    /* Restrict zone access during Minor GC. */\n    bool needsBarrier_;\n\n#ifdef JSGC_GENERATIONAL\n    /* Allow inlining of Nursery::isInside. */\n    uintptr_t gcNurseryStart_;\n    uintptr_t gcNurseryEnd_;\n#endif\n\n    Runtime()\n      : needsBarrier_(false)\n#ifdef JSGC_GENERATIONAL\n      , gcNurseryStart_(0)\n      , gcNurseryEnd_(0)\n#endif\n    {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Parallel operations in general can have one of three states. They may\n * succeed, fail, or \"bail\", where bail indicates that the code encountered an\n * unexpected condition and should be re-run sequentially. Different\n * subcategories of the \"bail\" state are encoded as variants of TP_RETRY_*.\n */\nenum ParallelResult { TP_SUCCESS, TP_RETRY_SEQUENTIALLY, TP_RETRY_AFTER_GC, TP_FATAL };\n\nstruct ThreadSafeContext;\nstruct ForkJoinSlice;\nclass ExclusiveContext;\n\nclass Allocator;\n\nclass SkipRoot;\n\nenum ThingRootKind\n{\n    THING_ROOT_OBJECT,\n    THING_ROOT_SHAPE,\n    THING_ROOT_BASE_SHAPE,\n    THING_ROOT_TYPE_OBJECT,\n    THING_ROOT_STRING,\n    THING_ROOT_ION_CODE,\n    THING_ROOT_SCRIPT,\n    THING_ROOT_ID,\n    THING_ROOT_PROPERTY_ID,\n    THING_ROOT_VALUE,\n    THING_ROOT_TYPE,\n    THING_ROOT_BINDINGS,\n    THING_ROOT_PROPERTY_DESCRIPTOR,\n    THING_ROOT_LIMIT\n};\n\ntemplate <typename T>\nstruct RootKind;\n\n/*\n * Specifically mark the ThingRootKind of externally visible types, so that\n * JSAPI users may use JSRooted... types without having the class definition\n * available.\n */\ntemplate<typename T, ThingRootKind Kind>\nstruct SpecificRootKind\n{\n    static ThingRootKind rootKind() { return Kind; }\n};\n\ntemplate <> struct RootKind<JSObject *> : SpecificRootKind<JSObject *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSFlatString *> : SpecificRootKind<JSFlatString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSFunction *> : SpecificRootKind<JSFunction *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSString *> : SpecificRootKind<JSString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSScript *> : SpecificRootKind<JSScript *, THING_ROOT_SCRIPT> {};\ntemplate <> struct RootKind<jsid> : SpecificRootKind<jsid, THING_ROOT_ID> {};\ntemplate <> struct RootKind<JS::Value> : SpecificRootKind<JS::Value, THING_ROOT_VALUE> {};\n\nstruct ContextFriendFields\n{\n  protected:\n    JSRuntime *const     runtime_;\n\n    /* The current compartment. */\n    JSCompartment       *compartment_;\n\n    /* The current zone. */\n    JS::Zone            *zone_;\n\n  public:\n    explicit ContextFriendFields(JSRuntime *rt)\n      : runtime_(rt), compartment_(NULL), zone_(NULL), autoGCRooters(NULL)\n    {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        mozilla::PodArrayZero(thingGCRooters);\n#endif\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n        skipGCRooters = NULL;\n#endif\n    }\n\n    static const ContextFriendFields *get(const JSContext *cx) {\n        return reinterpret_cast<const ContextFriendFields *>(cx);\n    }\n\n    static ContextFriendFields *get(JSContext *cx) {\n        return reinterpret_cast<ContextFriendFields *>(cx);\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Stack of thread-stack-allocated GC roots. */\n    JS::AutoGCRooter   *autoGCRooters;\n\n    friend JSRuntime *GetRuntime(const JSContext *cx);\n    friend JSCompartment *GetContextCompartment(const JSContext *cx);\n    friend JS::Zone *GetContextZone(const JSContext *cx);\n};\n\nclass PerThreadData;\n\nstruct PerThreadDataFriendFields\n{\n  private:\n    // Note: this type only exists to permit us to derive the offset of\n    // the perThread data within the real JSRuntime* type in a portable\n    // way.\n    struct RuntimeDummy : JS::shadow::Runtime\n    {\n        struct PerThreadDummy {\n            void *field1;\n            uintptr_t field2;\n#ifdef DEBUG\n            uint64_t field3;\n#endif\n        } mainThread;\n    };\n\n  public:\n\n    PerThreadDataFriendFields();\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Limit pointer for checking native stack consumption. */\n    uintptr_t nativeStackLimit;\n\n    static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);\n\n    static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) {\n        return reinterpret_cast<PerThreadDataFriendFields *>(pt);\n    }\n\n    static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<PerThreadDataFriendFields *>(\n            reinterpret_cast<char*>(rt) + RuntimeMainThreadOffset);\n    }\n\n    static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<const PerThreadDataFriendFields *>(\n            reinterpret_cast<const char*>(rt) + RuntimeMainThreadOffset);\n    }\n};\n\n} /* namespace js */\n\n#endif /* jspubtd_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jstypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n** File:                jstypes.h\n** Description: Definitions of NSPR's basic types\n**\n** Prototypes and macros used to make up for deficiencies in ANSI environments\n** that we have found.\n**\n** Since we do not wrap <stdlib.h> and all the other standard headers, authors\n** of portable code will not know in general that they need these definitions.\n** Instead of requiring these authors to find the dependent uses in their code\n** and take the following steps only in those C files, we take steps once here\n** for all C files.\n**/\n\n#ifndef jstypes_h\n#define jstypes_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js-config.h\"\n\n/***********************************************************************\n** MACROS:      JS_EXTERN_API\n**              JS_EXPORT_API\n** DESCRIPTION:\n**      These are only for externally visible routines and globals.  For\n**      internal routines, just use \"extern\" for type checking and that\n**      will not export internal cross-file or forward-declared symbols.\n**      Define a macro for declaring procedures return types. We use this to\n**      deal with windoze specific type hackery for DLL definitions. Use\n**      JS_EXTERN_API when the prototype for the method is declared. Use\n**      JS_EXPORT_API for the implementation of the method.\n**\n** Example:\n**   in dowhim.h\n**     JS_EXTERN_API( void ) DoWhatIMean( void );\n**   in dowhim.c\n**     JS_EXPORT_API( void ) DoWhatIMean( void ) { return; }\n**\n**\n***********************************************************************/\n\n#define JS_EXTERN_API(type)  extern MOZ_EXPORT type\n#define JS_EXPORT_API(type)  MOZ_EXPORT type\n#define JS_EXPORT_DATA(type) MOZ_EXPORT type\n#define JS_IMPORT_API(type)  MOZ_IMPORT_API type\n#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type\n\n/*\n * The linkage of JS API functions differs depending on whether the file is\n * used within the JS library or not. Any source file within the JS\n * interpreter should define EXPORT_JS_API whereas any client of the library\n * should not. STATIC_JS_API is used to build JS as a static library.\n */\n#if defined(STATIC_JS_API)\n#  define JS_PUBLIC_API(t)   t\n#  define JS_PUBLIC_DATA(t)  t\n#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)\n#  define JS_PUBLIC_API(t)   MOZ_EXPORT t\n#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t\n#else\n#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t\n#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t\n#endif\n\n#define JS_FRIEND_API(t)    JS_PUBLIC_API(t)\n#define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)\n\n#if defined(_MSC_VER) && defined(_M_IX86)\n#define JS_FASTCALL __fastcall\n#elif defined(__GNUC__) && defined(__i386__)\n#define JS_FASTCALL __attribute__((fastcall))\n#else\n#define JS_FASTCALL\n#define JS_NO_FASTCALL\n#endif\n\n#ifndef JS_INLINE\n#define JS_INLINE MOZ_INLINE\n#endif\n\n#ifndef JS_ALWAYS_INLINE\n#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE\n#endif\n\n#ifndef JS_NEVER_INLINE\n#define JS_NEVER_INLINE MOZ_NEVER_INLINE\n#endif\n\n#ifndef JS_WARN_UNUSED_RESULT\n# if defined __GNUC__\n#  define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n# else\n#  define JS_WARN_UNUSED_RESULT\n# endif\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_MACRO\n**              JS_END_MACRO\n** DESCRIPTION:\n**      Macro body brackets so that macros with compound statement definitions\n**      behave syntactically more like functions when called.\n***********************************************************************/\n#define JS_BEGIN_MACRO  do {\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n# define JS_END_MACRO                                                         \\\n    } __pragma(warning(push)) __pragma(warning(disable:4127))                 \\\n    while (0) __pragma(warning(pop))\n#else\n# define JS_END_MACRO   } while (0)\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_EXTERN_C\n**              JS_END_EXTERN_C\n** DESCRIPTION:\n**      Macro shorthands for conditional C++ extern block delimiters.\n***********************************************************************/\n#define JS_BEGIN_EXTERN_C      MOZ_BEGIN_EXTERN_C\n#define JS_END_EXTERN_C        MOZ_END_EXTERN_C\n\n/***********************************************************************\n** MACROS:      JS_BIT\n**              JS_BITMASK\n** DESCRIPTION:\n** Bit masking macros.  XXX n must be <= 31 to be portable\n***********************************************************************/\n#define JS_BIT(n)       ((uint32_t)1 << (n))\n#define JS_BITMASK(n)   (JS_BIT(n) - 1)\n\n/***********************************************************************\n** MACROS:      JS_HOWMANY\n**              JS_ROUNDUP\n**              JS_MIN\n**              JS_MAX\n** DESCRIPTION:\n**      Commonly used macros for operations on compatible types.\n***********************************************************************/\n#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))\n#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))\n\n#include \"jscpucfg.h\"\n\n/*\n * Define JS_64BIT iff we are building in an environment with 64-bit\n * addresses.\n */\n#ifdef _MSC_VER\n# if defined(_M_X64) || defined(_M_AMD64)\n#  define JS_64BIT\n# endif\n#elif defined(__GNUC__)\n/* Additional GCC defines are when running on Solaris, AIX, and HPUX */\n# if defined(__x86_64__) || defined(__sparcv9) || \\\n        defined(__64BIT__) || defined(__LP64__)\n#  define JS_64BIT\n# endif\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */\n# if defined(__x86_64) || defined(__sparcv9)\n#  define JS_64BIT\n# endif\n#elif defined(__xlc__) || defined(__xlC__)        /* IBM XL C/C++ */\n# if defined(__64BIT__)\n#  define JS_64BIT\n# endif\n#elif defined(__HP_cc) || defined(__HP_aCC)       /* HP-UX cc/aCC */\n# if defined(__LP64__)\n#  define JS_64BIT\n# endif\n#else\n# error \"Implement me\"\n#endif\n\n\n/************************************************************************\n** TYPES:       JSBool\n** DESCRIPTION:\n**  Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE\n**      for clarity of target type in assignments and actual arguments. Use\n**      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans\n**      just as you would C int-valued conditions.\n************************************************************************/\ntypedef int JSBool;\n#define JS_TRUE (int)1\n#define JS_FALSE (int)0\n\n/***********************************************************************\n** MACROS:      JS_LIKELY\n**              JS_UNLIKELY\n** DESCRIPTION:\n**      These macros allow you to give a hint to the compiler about branch\n**      probability so that it can better optimize.  Use them like this:\n**\n**      if (JS_LIKELY(v == 1)) {\n**          ... expected code path ...\n**      }\n**\n**      if (JS_UNLIKELY(v == 0)) {\n**          ... non-expected code path ...\n**      }\n**\n***********************************************************************/\n#ifdef __GNUC__\n\n# define JS_LIKELY(x)   (__builtin_expect((x), 1))\n# define JS_UNLIKELY(x) (__builtin_expect((x), 0))\n\n#else\n\n# define JS_LIKELY(x)   (x)\n# define JS_UNLIKELY(x) (x)\n\n#endif\n\n/***********************************************************************\n** MACROS:      JS_ARRAY_LENGTH\n**              JS_ARRAY_END\n** DESCRIPTION:\n**      Macros to get the number of elements and the pointer to one past the\n**      last element of a C array. Use them like this:\n**\n**      jschar buf[10], *s;\n**      JSString *str;\n**      ...\n**      for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;\n**      ...\n**      str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));\n**      ...\n**\n***********************************************************************/\n\n#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])\n#define JS_ARRAY_END(array)    ((array) + JS_ARRAY_LENGTH(array))\n\n#define JS_BITS_PER_BYTE 8\n#define JS_BITS_PER_BYTE_LOG2 3\n\n#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)\n\n/***********************************************************************\n** MACROS:      JS_FUNC_TO_DATA_PTR\n**              JS_DATA_TO_FUNC_PTR\n** DESCRIPTION:\n**      Macros to convert between function and data pointers assuming that\n**      they have the same size. Use them like this:\n**\n**      JSPropertyOp nativeGetter;\n**      JSObject *scriptedGetter;\n**      ...\n**      scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter);\n**      ...\n**      nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter);\n**\n***********************************************************************/\n\n#ifdef __GNUC__\n# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (size_t) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (size_t) (ptr))\n#else\n/* Use an extra (void *) cast for MSVC. */\n# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))\n#endif\n\n#ifdef __GNUC__\n# define JS_EXTENSION __extension__\n# define JS_EXTENSION_(s) __extension__ ({ s; })\n#else\n# define JS_EXTENSION\n# define JS_EXTENSION_(s) s\n#endif\n\n#endif /* jstypes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsutil.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * PR assertion checker.\n */\n\n#ifndef jsutil_h\n#define jsutil_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/GuardObjects.h\"\n\n#ifdef USE_ZLIB\n#include <zlib.h>\n#endif\n\n#include \"js/Utility.h\"\n\n/* Forward declarations. */\nstruct JSContext;\n\nstatic JS_ALWAYS_INLINE void *\njs_memcpy(void *dst_, const void *src_, size_t len)\n{\n    char *dst = (char *) dst_;\n    const char *src = (const char *) src_;\n    JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len);\n    JS_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len);\n\n    return memcpy(dst, src, len);\n}\n\nnamespace js {\n\ntemplate <class T>\nstruct AlignmentTestStruct\n{\n    char c;\n    T t;\n};\n\n/* This macro determines the alignment requirements of a type. */\n#define JS_ALIGNMENT_OF(t_) \\\n  (sizeof(js::AlignmentTestStruct<t_>) - sizeof(t_))\n\ntemplate <class T>\nclass AlignedPtrAndFlag\n{\n    uintptr_t bits;\n\n  public:\n    AlignedPtrAndFlag(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(aFlag);\n    }\n\n    T *ptr() const {\n        return (T *)(bits & ~uintptr_t(1));\n    }\n\n    bool flag() const {\n        return (bits & 1) != 0;\n    }\n\n    void setPtr(T *t) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(flag());\n    }\n\n    void setFlag() {\n        bits |= 1;\n    }\n\n    void unsetFlag() {\n        bits &= ~uintptr_t(1);\n    }\n\n    void set(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | aFlag;\n    }\n};\n\ntemplate <class T>\nstatic inline void\nReverse(T *beg, T *end)\n{\n    while (beg != end) {\n        if (--end == beg)\n            return;\n        T tmp = *beg;\n        *beg = *end;\n        *end = tmp;\n        ++beg;\n    }\n}\n\ntemplate <class T>\nstatic inline T *\nFind(T *beg, T *end, const T &v)\n{\n    for (T *p = beg; p != end; ++p) {\n        if (*p == v)\n            return p;\n    }\n    return end;\n}\n\ntemplate <class Container>\nstatic inline typename Container::ElementType *\nFind(Container &c, const typename Container::ElementType &v)\n{\n    return Find(c.begin(), c.end(), v);\n}\n\ntemplate <typename InputIterT, typename CallableT>\nvoid\nForEach(InputIterT begin, InputIterT end, CallableT f)\n{\n    for (; begin != end; ++begin)\n        f(*begin);\n}\n\ntemplate <class T>\nstatic inline T\nMin(T t1, T t2)\n{\n    return t1 < t2 ? t1 : t2;\n}\n\ntemplate <class T>\nstatic inline T\nMax(T t1, T t2)\n{\n    return t1 > t2 ? t1 : t2;\n}\n\n/* Allows a const variable to be initialized after its declaration. */\ntemplate <class T>\nstatic T&\nInitConst(const T &t)\n{\n    return const_cast<T &>(t);\n}\n\ntemplate <class T, class U>\nJS_ALWAYS_INLINE T &\nImplicitCast(U &u)\n{\n    T &t = u;\n    return t;\n}\n\ntemplate<typename T>\nclass AutoScopedAssign\n{\n  public:\n    AutoScopedAssign(T *addr, const T &value\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : addr_(addr), old(*addr_)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        *addr_ = value;\n    }\n\n    ~AutoScopedAssign() { *addr_ = old; }\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n    T *addr_;\n    T old;\n};\n\ntemplate <typename T>\nstatic inline bool\nIsPowerOfTwo(T t)\n{\n    return t && !(t & (t - 1));\n}\n\ntemplate <typename T, typename U>\nstatic inline U\nComputeByteAlignment(T bytes, U alignment)\n{\n    JS_ASSERT(IsPowerOfTwo(alignment));\n    return (alignment - (bytes % alignment)) % alignment;\n}\n\ntemplate <typename T, typename U>\nstatic inline T\nAlignBytes(T bytes, U alignment)\n{\n    return bytes + ComputeByteAlignment(bytes, alignment);\n}\n\nJS_ALWAYS_INLINE static size_t\nUnsignedPtrDiff(const void *bigger, const void *smaller)\n{\n    return size_t(bigger) - size_t(smaller);\n}\n\n/*****************************************************************************/\n\n/* A bit array is an array of bits represented by an array of words (size_t). */\n\nstatic inline unsigned\nNumWordsForBitArrayOfLength(size_t length)\n{\n    return (length + (JS_BITS_PER_WORD - 1)) / JS_BITS_PER_WORD;\n}\n\nstatic inline unsigned\nBitArrayIndexToWordIndex(size_t length, size_t bitIndex)\n{\n    unsigned wordIndex = bitIndex / JS_BITS_PER_WORD;\n    JS_ASSERT(wordIndex < length);\n    return wordIndex;\n}\n\nstatic inline size_t\nBitArrayIndexToWordMask(size_t i)\n{\n    return size_t(1) << (i % JS_BITS_PER_WORD);\n}\n\nstatic inline bool\nIsBitArrayElementSet(size_t *array, size_t length, size_t i)\n{\n    return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i);\n}\n\nstatic inline bool\nIsAnyBitArrayElementSet(size_t *array, size_t length)\n{\n    unsigned numWords = NumWordsForBitArrayOfLength(length);\n    for (unsigned i = 0; i < numWords; ++i) {\n        if (array[i])\n            return true;\n    }\n    return false;\n}\n\nstatic inline void\nSetBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearAllBitArrayElements(size_t *array, size_t length)\n{\n    for (unsigned i = 0; i < length; ++i)\n        array[i] = 0;\n}\n\n#ifdef USE_ZLIB\nclass Compressor\n{\n    /* Number of bytes we should hand to zlib each compressMore() call. */\n    static const size_t CHUNKSIZE = 2048;\n    z_stream zs;\n    const unsigned char *inp;\n    size_t inplen;\n    size_t outbytes;\n\n  public:\n    enum Status {\n        MOREOUTPUT,\n        DONE,\n        CONTINUE,\n        OOM\n    };\n\n    Compressor(const unsigned char *inp, size_t inplen);\n    ~Compressor();\n    bool init();\n    void setOutput(unsigned char *out, size_t outlen);\n    size_t outWritten() const { return outbytes; }\n    /* Compress some of the input. Return true if it should be called again. */\n    Status compressMore();\n};\n\n/*\n * Decompress a string. The caller must know the length of the output and\n * allocate |out| to a string of that length.\n */\nbool DecompressString(const unsigned char *inp, size_t inplen,\n                      unsigned char *out, size_t outlen);\n#endif\n\n}  /* namespace js */\n\n/* Crash diagnostics */\n#ifdef DEBUG\n# define JS_CRASH_DIAGNOSTICS 1\n#endif\n#ifdef JS_CRASH_DIAGNOSTICS\n# define JS_POISON(p, val, size) memset((p), (val), (size))\n#else\n# define JS_POISON(p, val, size) ((void) 0)\n#endif\n\n/* Basic stats */\n#ifdef DEBUG\n# define JS_BASIC_STATS 1\n#endif\n#ifdef JS_BASIC_STATS\n# include <stdio.h>\ntypedef struct JSBasicStats {\n    uint32_t    num;\n    uint32_t    max;\n    double      sum;\n    double      sqsum;\n    uint32_t    logscale;           /* logarithmic scale: 0 (linear), 2, 10 */\n    uint32_t    hist[11];\n} JSBasicStats;\n# define JS_INIT_STATIC_BASIC_STATS  {0,0,0,0,0,{0,0,0,0,0,0,0,0,0,0,0}}\n# define JS_BASIC_STATS_INIT(bs)     memset((bs), 0, sizeof(JSBasicStats))\n# define JS_BASIC_STATS_ACCUM(bs,val)                                         \\\n    JS_BasicStatsAccum(bs, val)\n# define JS_MeanAndStdDevBS(bs,sigma)                                         \\\n    JS_MeanAndStdDev((bs)->num, (bs)->sum, (bs)->sqsum, sigma)\nextern void\nJS_BasicStatsAccum(JSBasicStats *bs, uint32_t val);\nextern double\nJS_MeanAndStdDev(uint32_t num, double sum, double sqsum, double *sigma);\nextern void\nJS_DumpBasicStats(JSBasicStats *bs, const char *title, FILE *fp);\nextern void\nJS_DumpHistogram(JSBasicStats *bs, FILE *fp);\n#else\n# define JS_BASIC_STATS_ACCUM(bs,val)\n#endif\n\n/* A jsbitmap_t is a long integer that can be used for bitmaps. */\ntypedef size_t jsbitmap;\n#define JS_TEST_BIT(_map,_bit)  ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &      \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_SET_BIT(_map,_bit)   ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |=     \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &=     \\\n                                 ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n\n/* Wrapper for various macros to stop warnings coming from their expansions. */\n#if defined(__clang__)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"clang diagnostic push\")                                      \\\n        /* If these _Pragmas cause warnings for you, try disabling ccache. */ \\\n        _Pragma(\"clang diagnostic ignored \\\"-Wunused-value\\\"\")                \\\n        { expr; }                                                             \\\n        _Pragma(\"clang diagnostic pop\")                                       \\\n    JS_END_MACRO\n#elif MOZ_IS_GCC\n\n#if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"GCC diagnostic push\")                                        \\\n        _Pragma(\"GCC diagnostic ignored \\\"-Wunused-but-set-variable\\\"\")       \\\n        expr;                                                                 \\\n        _Pragma(\"GCC diagnostic pop\")                                         \\\n    JS_END_MACRO\n#endif\n#endif\n\n#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        expr;                                                                 \\\n    JS_END_MACRO\n#endif\n\n#endif /* jsutil_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsversion.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsversion_h\n#define jsversion_h\n\n/*\n * Deprecated JS_VERSION handler.\n */\n#ifdef JS_VERSION\n# if JS_VERSION == 185\n#  warning \"JS_VERSION defined but unsupported (legacy)\"\n# elif JS_VERSION < 185\n#  error \"Unsupported JS_VERSION\"\n# else\n#  error \"Unknown JS_VERSION\"\n# endif\n#endif\n\n/*\n * JS Capability Macros.\n */\n#define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */\n#define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */\n#define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */\n#define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */\n#define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */\n#define JS_HAS_UNEVAL           1       /* has uneval() top-level function */\n#define JS_HAS_CONST            1       /* has JS2 const as alternative var */\n#define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */\n#define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */\n#define JS_HAS_FOR_EACH_IN      1       /* has for each (lhs in iterable) */\n#define JS_HAS_GENERATORS       1       /* has yield in generator function */\n#define JS_HAS_BLOCK_SCOPE      1       /* has block scope via let/arraycomp */\n#define JS_HAS_DESTRUCTURING    2       /* has [a,b] = ... or {p:a,q:b} = ... */\n#define JS_HAS_GENERATOR_EXPRS  1       /* has (expr for (lhs in iterable)) */\n#define JS_HAS_EXPR_CLOSURES    1       /* has function (formals) listexpr */\n\n/* Support for JS_NewGlobalObject. */\n#define JS_HAS_NEW_GLOBAL_OBJECT        1\n\n/* Support for JS_MakeSystemObject. */\n#define JS_HAS_MAKE_SYSTEM_OBJECT       1\n\n/* Feature-test macro for evolving destructuring support. */\n#define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)\n\n/*\n * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support;\n * support likely to be made opt-in at some future time.\n */\n#define OLD_GETTER_SETTER_METHODS       1\n\n/* A kill-switch for bug 586842.  Embedders shouldn't touch this! */\n#define USE_NEW_OBJECT_REPRESENTATION 0\n\n#if USE_NEW_OBJECT_REPRESENTATION\n#  define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0)\n#else\n#  define NEW_OBJECT_REPRESENTATION_ONLY() \\\n     MOZ_ASSUME_UNREACHABLE(\"don't call this!  to be used in the new object representation\")\n#endif\n\n#endif /* jsversion_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jswrapper.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jswrapper_h\n#define jswrapper_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"jsapi.h\"\n#include \"jsproxy.h\"\n\nnamespace js {\n\nclass DummyFrameGuard;\n\n/*\n * A wrapper is a proxy with a target object to which it generally forwards\n * operations, but may restrict access to certain operations or instrument\n * the trap operations in various ways. A wrapper is distinct from a Direct Proxy\n * Handler in the sense that it can be \"unwrapped\" in C++, exposing the underlying\n * object (Direct Proxy Handlers have an underlying target object, but don't\n * expect to expose this object via any kind of unwrapping operation). Callers\n * should be careful to avoid unwrapping security wrappers in the wrong context.\n */\nclass JS_FRIEND_API(Wrapper) : public DirectProxyHandler\n{\n    unsigned mFlags;\n    bool mSafeToUnwrap;\n\n  public:\n    using BaseProxyHandler::Action;\n\n    enum Flags {\n        CROSS_COMPARTMENT = 1 << 0,\n        LAST_USED_FLAG = CROSS_COMPARTMENT\n    };\n\n    /*\n     * Wrappers can explicitly specify that they are unsafe to unwrap from a\n     * security perspective (as is the case for SecurityWrappers). If a wrapper\n     * is not safe to unwrap, operations requiring full access to the underlying\n     * object (via CheckedUnwrap) will throw. Otherwise, they will succeed.\n     */\n    void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; }\n    bool isSafeToUnwrap() { return mSafeToUnwrap; }\n\n    static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto,\n                         JSObject *parent, Wrapper *handler);\n\n    static JSObject *Renew(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *handler);\n\n    static Wrapper *wrapperHandler(JSObject *wrapper);\n\n    static JSObject *wrappedObject(JSObject *wrapper);\n\n    unsigned flags() const {\n        return mFlags;\n    }\n\n    explicit Wrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~Wrapper();\n\n    static Wrapper singleton;\n    static Wrapper singletonWithPrototype;\n};\n\n/* Base class for all cross compartment wrapper handlers. */\nclass JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper\n{\n  public:\n    CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~CrossCompartmentWrapper();\n\n    virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE;\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived wrapper traps. */\n    virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject wrapper, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject wrapper,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static CrossCompartmentWrapper singleton;\n    static CrossCompartmentWrapper singletonWithPrototype;\n};\n\n/*\n * Base class for security wrappers. A security wrapper is potentially hiding\n * all or part of some wrapped object thus SecurityWrapper defaults to denying\n * access to the wrappee. This is the opposite of Wrapper which tries to be\n * completely transparent.\n *\n * NB: Currently, only a few ProxyHandler operations are overridden to deny\n * access, relying on derived SecurityWrapper to block access when necessary.\n */\ntemplate <class Base>\nclass JS_FRIEND_API(SecurityWrapper) : public Base\n{\n  public:\n    SecurityWrapper(unsigned flags);\n\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act,\n                       bool *bp) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n\n    /*\n     * Allow our subclasses to select the superclass behavior they want without\n     * needing to specify an exact superclass.\n     */\n    typedef Base Permissive;\n    typedef SecurityWrapper<Base> Restrictive;\n};\n\ntypedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;\ntypedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;\n\nclass JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler\n{\n  public:\n    static int sDeadObjectFamily;\n\n    explicit DeadObjectProxy();\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp,\n                                     bool *present) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy,\n                                MutableHandleObject protop) MOZ_OVERRIDE;\n\n    static DeadObjectProxy singleton;\n};\n\nextern JSObject *\nTransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj,\n                         HandleObject wrappedProto, HandleObject parent,\n                         unsigned flags);\n\n// Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by\n// jsfriendapi users.\nextern JS_FRIEND_DATA(int) sWrapperFamily;\n\ninline bool\nIsWrapper(JSObject *obj)\n{\n    return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily;\n}\n\n// Given a JSObject, returns that object stripped of wrappers. If\n// stopAtOuter is true, then this returns the outer window if it was\n// previously wrapped. Otherwise, this returns the first object for\n// which JSObject::isWrapper returns false.\nJS_FRIEND_API(JSObject *)\nUncheckedUnwrap(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = NULL);\n\n// Given a JSObject, returns that object stripped of wrappers. At each stage,\n// the security wrapper has the opportunity to veto the unwrap. Since checked\n// code should never be unwrapping outer window wrappers, we always stop at\n// outer windows.\nJS_FRIEND_API(JSObject *)\nCheckedUnwrap(JSObject *obj, bool stopAtOuter = true);\n\n// Unwrap only the outermost security wrapper, with the same semantics as\n// above. This is the checked version of Wrapper::wrappedObject.\nJS_FRIEND_API(JSObject *)\nUnwrapOneChecked(JSObject *obj, bool stopAtOuter = true);\n\nJS_FRIEND_API(bool)\nIsCrossCompartmentWrapper(JSObject *obj);\n\nbool\nIsDeadProxyObject(JSObject *obj);\n\nJSObject *\nNewDeadProxyObject(JSContext *cx, JSObject *parent);\n\nvoid\nNukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper);\n\nbool\nRemapWrapper(JSContext *cx, JSObject *wobj, JSObject *newTarget);\n\nJS_FRIEND_API(bool)\nRemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget,\n                          JSObject *newTarget);\n\n// API to recompute all cross-compartment wrappers whose source and target\n// match the given filters.\nJS_FRIEND_API(bool)\nRecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,\n                  const CompartmentFilter &targetFilter);\n\n/*\n * This auto class should be used around any code, such as brain transplants,\n * that may touch dead zones. Brain transplants can cause problems\n * because they operate on all compartments, whether live or dead. A brain\n * transplant can cause a formerly dead object to be \"reanimated\" by causing a\n * read or write barrier to be invoked on it during the transplant. In this way,\n * a zone becomes a zombie, kept alive by repeatedly consuming\n * (transplanted) brains.\n *\n * To work around this issue, we observe when mark bits are set on objects in\n * dead zones. If this happens during a brain transplant, we do a full,\n * non-incremental GC at the end of the brain transplant. This will clean up any\n * objects that were improperly marked.\n */\nstruct JS_FRIEND_API(AutoMaybeTouchDeadZones)\n{\n    // The version that takes an object just uses it for its runtime.\n    AutoMaybeTouchDeadZones(JSContext *cx);\n    AutoMaybeTouchDeadZones(JSObject *obj);\n    ~AutoMaybeTouchDeadZones();\n\n  private:\n    JSRuntime *runtime;\n    unsigned markCount;\n    bool inIncremental;\n    bool manipulatingDeadZones;\n};\n\n} /* namespace js */\n\n#endif /* jswrapper_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/AllocPolicy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * An allocation policy concept, usable for structures and algorithms to\n * control how memory is allocated and how failures are handled.\n */\n\n#ifndef mozilla_AllocPolicy_h\n#define mozilla_AllocPolicy_h\n\n#include <stddef.h>\n#include <stdlib.h>\n\nnamespace mozilla {\n\n/*\n * Allocation policies are used to implement the standard allocation behaviors\n * in a customizable way.  Additionally, custom behaviors may be added to these\n * behaviors, such as additionally reporting an error through an out-of-band\n * mechanism when OOM occurs.  The concept modeled here is as follows:\n *\n *  - public copy constructor, assignment, destructor\n *  - void* malloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* calloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* realloc_(void*, size_t, size_t)\n *      Responsible for OOM reporting when null is returned.  The *used* bytes\n *      of the previous buffer is passed in (rather than the old allocation\n *      size), in addition to the *new* allocation size requested.\n *  - void free_(void*)\n *  - void reportAllocOverflow() const\n *      Called on allocation overflow (that is, an allocation implicitly tried\n *      to allocate more than the available memory space -- think allocating an\n *      array of large-size objects, where N * size overflows) before null is\n *      returned.\n *\n * mfbt provides (and typically uses by default) only MallocAllocPolicy, which\n * does nothing more than delegate to the malloc/alloc/free functions.\n */\n\n/*\n * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no\n * extra behaviors.\n */\nclass MallocAllocPolicy\n{\n  public:\n    void* malloc_(size_t bytes) { return malloc(bytes); }\n    void* calloc_(size_t bytes) { return calloc(bytes, 1); }\n    void* realloc_(void* p, size_t oldBytes, size_t bytes) { return realloc(p, bytes); }\n    void free_(void* p) { free(p); }\n    void reportAllocOverflow() const {}\n};\n\n\n} // namespace mozilla\n\n#endif /* mozilla_AllocPolicy_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Array.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A compile-time constant-length array with bounds-checking assertions. */\n\n#ifndef mozilla_Array_h\n#define mozilla_Array_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\ntemplate<typename T, size_t Length>\nclass Array\n{\n    T arr[Length];\n\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n};\n\ntemplate<typename T>\nclass Array<T, 0>\n{\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_Array_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Assertions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of runtime and static assertion macros for C and C++. */\n\n#ifndef mozilla_Assertions_h\n#define mozilla_Assertions_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Likely.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef WIN32\n   /*\n    * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which\n    * further depends on <windef.h>.  We hardcode these few definitions manually\n    * because those headers clutter the global namespace with a significant\n    * number of undesired macros and symbols.\n    */\n#  ifdef __cplusplus\n   extern \"C\" {\n#  endif\n   __declspec(dllimport) int __stdcall\n   TerminateProcess(void* hProcess, unsigned int uExitCode);\n   __declspec(dllimport) void* __stdcall GetCurrentProcess(void);\n#  ifdef __cplusplus\n   }\n#  endif\n#else\n#  include <signal.h>\n#endif\n#ifdef ANDROID\n#  include <android/log.h>\n#endif\n\n/*\n * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.\n * In C++11, static_assert is provided by the compiler to the same effect.\n * This can be useful when you make certain assumptions about what must hold for\n * optimal, or even correct, behavior.  For example, you might assert that the\n * size of a struct is a multiple of the target architecture's word size:\n *\n *   struct S { ... };\n *   // C\n *   MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,\n *                     \"S should be a multiple of word size for efficiency\");\n *   // C++11\n *   static_assert(sizeof(S) % sizeof(size_t) == 0,\n *                 \"S should be a multiple of word size for efficiency\");\n *\n * This macro can be used in any location where both an extern declaration and a\n * typedef could be used.\n */\n#ifndef __cplusplus\n   /*\n    * Some of the definitions below create an otherwise-unused typedef.  This\n    * triggers compiler warnings with some versions of gcc, so mark the typedefs\n    * as permissibly-unused to disable the warnings.\n    */\n#  if defined(__GNUC__)\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))\n#  else\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */\n#  endif\n#  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y\n#  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)\n#  if defined(__SUNPRO_CC)\n     /*\n      * The Sun Studio C++ compiler is buggy when declaring, inside a function,\n      * another extern'd function with an array argument whose length contains a\n      * sizeof, triggering the error message \"sizeof expression not accepted as\n      * size of array parameter\".  This bug (6688515, not public yet) would hit\n      * defining moz_static_assert as a function, so we always define an extern\n      * array for Sun Studio.\n      *\n      * We include the line number in the symbol name in a best-effort attempt\n      * to avoid conflicts (see below).\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond) ? 1 : -1]\n#  elif defined(__COUNTER__)\n     /*\n      * If there was no preferred alternative, use a compiler-agnostic version.\n      *\n      * Note that the non-__COUNTER__ version has a bug in C++: it can't be used\n      * in both |extern \"C\"| and normal C++ in the same translation unit.  (Alas\n      * |extern \"C\"| isn't allowed in a function.)  The only affected compiler\n      * we really care about is gcc 4.2.  For that compiler and others like it,\n      * we include the line number in the function name to do the best we can to\n      * avoid conflicts.  These should be rare: a conflict would require use of\n      * MOZ_STATIC_ASSERT on the same line in separate files in the same\n      * translation unit, *and* the uses would have to be in code with\n      * different linkage, *and* the first observed use must be in C++-linkage\n      * code.\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  else\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  endif\n\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)\n#else\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Prints |s| as an assertion failure (using file and ln as the location of the\n * assertion) to the standard debug-output channel.\n *\n * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This\n * method is primarily for internal use in this header, and only secondarily\n * for use in implementing release-build assertions.\n */\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportAssertionFailure(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n  __android_log_print(ANDROID_LOG_FATAL, \"MOZ_Assert\",\n                      \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportCrash(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n    __android_log_print(ANDROID_LOG_FATAL, \"MOZ_CRASH\",\n                        \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\n/**\n * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH().  You should\n * call MOZ_CRASH instead.\n */\n#if defined(_MSC_VER)\n   /*\n    * On MSVC use the __debugbreak compiler intrinsic, which produces an inline\n    * (not nested in a system function) breakpoint.  This distinctively invokes\n    * Breakpad without requiring system library symbols on all stack-processing\n    * machines, as a nested breakpoint would require.\n    *\n    * We use TerminateProcess with the exit code aborting would generate\n    * because we don't want to invoke atexit handlers, destructors, library\n    * unload handlers, and so on when our process might be in a compromised\n    * state.\n    *\n    * We don't use abort() because it'd cause Windows to annoyingly pop up the\n    * process error dialog multiple times.  See bug 345118 and bug 426163.\n    *\n    * We follow TerminateProcess() with a call to MOZ_NoReturn() so that the\n    * compiler doesn't hassle us to provide a return statement after a\n    * MOZ_REALLY_CRASH() call.\n    *\n    * (Technically these are Windows requirements, not MSVC requirements.  But\n    * practically you need MSVC for debugging, and we only ship builds created\n    * by MSVC, so doing it this way reduces complexity.)\n    */\n\n__declspec(noreturn) __inline void MOZ_NoReturn() {}\n\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         ::TerminateProcess(::GetCurrentProcess(), 3); \\\n         ::MOZ_NoReturn(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         TerminateProcess(GetCurrentProcess(), 3); \\\n         MOZ_NoReturn(); \\\n       } while (0)\n#  endif\n#else\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         ::abort(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         abort(); \\\n       } while (0)\n#  endif\n#endif\n\n/*\n * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a\n * Breakpad-compatible way, in both debug and release builds.\n *\n * MOZ_CRASH is a good solution for \"handling\" failure cases when you're\n * unwilling or unable to handle them more cleanly -- for OOM, for likely memory\n * corruption, and so on.  It's also a good solution if you need safe behavior\n * in release builds as well as debug builds.  But if the failure is one that\n * should be debugged and fixed, MOZ_ASSERT is generally preferable.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining why we're crashing.  This argument is intended for use with\n * MOZ_CRASH() calls whose rationale is non-obvious; don't use it if it's\n * obvious why we're crashing.\n *\n * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an\n * explanation-string, we print the string to stderr.  Otherwise, we don't\n * print anything; this is because we want MOZ_CRASH to be 100% safe in release\n * builds, and it's hard to print to stderr safely when memory might have been\n * corrupted.\n */\n#ifndef DEBUG\n#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()\n#else\n#  define MOZ_CRASH(...) \\\n     do { \\\n       MOZ_ReportCrash(\"\" __VA_ARGS__, __FILE__, __LINE__); \\\n       MOZ_REALLY_CRASH(); \\\n     } while(0)\n#endif\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n/*\n * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in\n * debug builds.  If it is, execution continues.  Otherwise, an error message\n * including the expression and the explanation-string (if provided) is printed,\n * an attempt is made to invoke any existing debugger, and execution halts.\n * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition\n * which can correctly be falsy.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining the assertion.  It is intended for use with assertions whose\n * correctness or rationale is non-obvious, and for assertions where the \"real\"\n * condition being tested is best described prosaically.  Don't provide an\n * explanation if it's not actually helpful.\n *\n *   // No explanation needed: pointer arguments often must not be NULL.\n *   MOZ_ASSERT(arg);\n *\n *   // An explanation can be helpful to explain exactly how we know an\n *   // assertion is valid.\n *   MOZ_ASSERT(state == WAITING_FOR_RESPONSE,\n *              \"given that <thingA> and <thingB>, we must have...\");\n *\n *   // Or it might disambiguate multiple identical (save for their location)\n *   // assertions of the same expression.\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this Boolean object\");\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this String object\");\n *\n * MOZ_ASSERT has no effect in non-debug builds.  It is designed to catch bugs\n * *only* during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n   /* First the single-argument form. */\n#  define MOZ_ASSERT_HELPER1(expr) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* Now the two-argument form. */\n#  define MOZ_ASSERT_HELPER2(expr, explain) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr \" (\" explain \")\", __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* And now, helper macrology up the wazoo. */\n   /*\n    * Count the number of arguments passed to MOZ_ASSERT, very carefully\n    * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a\n    * single token in argument lists.  See these URLs for details:\n    *\n    *   http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement\n    *   http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644\n    */\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL2(_1, _2, count, ...) \\\n     count\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL(args) \\\n\t MOZ_COUNT_ASSERT_ARGS_IMPL2 args\n#  define MOZ_COUNT_ASSERT_ARGS(...) \\\n     MOZ_COUNT_ASSERT_ARGS_IMPL((__VA_ARGS__, 2, 1, 0))\n   /* Pick the right helper macro to invoke. */\n#  define MOZ_ASSERT_CHOOSE_HELPER2(count) MOZ_ASSERT_HELPER##count\n#  define MOZ_ASSERT_CHOOSE_HELPER1(count) MOZ_ASSERT_CHOOSE_HELPER2(count)\n#  define MOZ_ASSERT_CHOOSE_HELPER(count) MOZ_ASSERT_CHOOSE_HELPER1(count)\n   /* The actual macro. */\n#  define MOZ_ASSERT_GLUE(x, y) x y\n#  define MOZ_ASSERT(...) \\\n     MOZ_ASSERT_GLUE(MOZ_ASSERT_CHOOSE_HELPER(MOZ_COUNT_ASSERT_ARGS(__VA_ARGS__)), \\\n                     (__VA_ARGS__))\n#else\n#  define MOZ_ASSERT(...) do { } while(0)\n#endif /* DEBUG */\n\n/*\n * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is\n * true.\n *\n *   MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));\n *\n * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds.  It is\n * designed to catch bugs during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n#  define MOZ_ASSERT_IF(cond, expr) \\\n     do { \\\n       if (cond) \\\n         MOZ_ASSERT(expr); \\\n     } while (0)\n#else\n#  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that it is\n * undefined behavior for execution to reach this point.  No guarantees are made\n * about what will happen if this is reached at runtime.  Most code should\n * probably use the higher level MOZ_ASSUME_UNREACHABLE, which uses this when\n * appropriate.\n */\n#if defined(__clang__)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#elif defined(__GNUC__)\n   /*\n    * __builtin_unreachable() was implemented in gcc 4.5.  If we don't have\n    * that, call a noreturn function; abort() will do nicely.  Qualify the call\n    * in C++ in case there's another abort() visible in local scope.\n    */\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0)\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#  else\n#    ifdef __cplusplus\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#    else\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __assume(0)\n#else\n#  ifdef __cplusplus\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#  else\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#  endif\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE([reason]) tells the compiler that it can assume that\n * the macro call cannot be reached during execution.  This lets the compiler\n * generate better-optimized code under some circumstances, at the expense of\n * the program's behavior being undefined if control reaches the\n * MOZ_ASSUME_UNREACHABLE.\n *\n * In Gecko, you probably should not use this macro outside of performance- or\n * size-critical code, because it's unsafe.  If you don't care about code size\n * or performance, you should probably use MOZ_ASSERT or MOZ_CRASH.\n *\n * SpiderMonkey is a different beast, and there it's acceptable to use\n * MOZ_ASSUME_UNREACHABLE more widely.\n *\n * Note that MOZ_ASSUME_UNREACHABLE is noreturn, so it's valid not to return a\n * value following a MOZ_ASSUME_UNREACHABLE call.\n *\n * Example usage:\n *\n *   enum ValueType {\n *     VALUE_STRING,\n *     VALUE_INT,\n *     VALUE_FLOAT\n *   };\n *\n *   int ptrToInt(ValueType type, void* value) {\n *   {\n *     // We know for sure that type is either INT or FLOAT, and we want this\n *     // code to run as quickly as possible.\n *     switch (type) {\n *     case VALUE_INT:\n *       return *(int*) value;\n *     case VALUE_FLOAT:\n *       return (int) *(float*) value;\n *     default:\n *       MOZ_ASSUME_UNREACHABLE(\"can only handle VALUE_INT and VALUE_FLOAT\");\n *     }\n *   }\n */\n#if defined(DEBUG)\n#  define MOZ_ASSUME_UNREACHABLE(...) \\\n     do { \\\n       MOZ_ASSERT(false, \"MOZ_ASSUME_UNREACHABLE(\" __VA_ARGS__ \")\"); \\\n       MOZ_ASSUME_UNREACHABLE_MARKER(); \\\n     } while (0)\n#else\n#  define MOZ_ASSUME_UNREACHABLE(reason)  MOZ_ASSUME_UNREACHABLE_MARKER()\n#endif\n\n/*\n * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided\n * expression, in debug builds and in release builds both.  Then, in debug\n * builds only, the value of the expression is asserted either true or false\n * using MOZ_ASSERT.\n */\n#ifdef DEBUG\n#  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))\n#  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))\n#else\n#  define MOZ_ALWAYS_TRUE(expr)      ((void)(expr))\n#  define MOZ_ALWAYS_FALSE(expr)     ((void)(expr))\n#endif\n\n#endif /* mozilla_Assertions_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Atomics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements (almost always) lock-free atomic operations. The operations here\n * are a subset of that which can be found in C++11's <atomic> header, with a\n * different API to enforce consistent memory ordering constraints.\n *\n * Anyone caught using |volatile| for inter-thread memory safety needs to be\n * sent a copy of this header and the C++11 standard.\n */\n\n#ifndef mozilla_Atomics_h\n#define mozilla_Atomics_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n\n/*\n * Our minimum deployment target on clang/OS X is OS X 10.6, whose SDK\n * does not have <atomic>.  So be sure to check for <atomic> support\n * along with C++0x support.\n */\n#if defined(__clang__)\n   /*\n    * clang doesn't like libstdc++'s version of <atomic> before GCC 4.7,\n    * due to the loose typing of the __sync_* family of functions done by\n    * GCC.  We do not have a particularly good way to detect this sort of\n    * case at this point, so just assume that if we're on a Linux system,\n    * we can't use the system's <atomic>.\n    *\n    * OpenBSD uses an old libstdc++ 4.2.1 and thus doesnt have <atomic>.\n    */\n#  if !defined(__linux__) && !defined(__OpenBSD__) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \\\n      __has_include(<atomic>)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n/*\n * Android uses a different C++ standard library that does not provide\n * support for <atomic>.\n *\n * GCC 4.5.x and 4.6.x's unspecialized std::atomic template doesn't include\n * inline definitions for the functions declared therein.  This oversight\n * leads to linking errors when using atomic enums.  We therefore require\n * GCC 4.7 or higher.\n */\n#elif defined(__GNUC__) && !defined(__ANDROID__)\n#  include \"mozilla/Compiler.h\"\n#  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \\\n      MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n#elif defined(_MSC_VER) && _MSC_VER >= 1700\n#  define MOZ_HAVE_CXX11_ATOMICS\n#endif\n\nnamespace mozilla {\n\n/**\n * An enum of memory ordering possibilities for atomics.\n *\n * Memory ordering is the observable state of distinct values in memory.\n * (It's a separate concept from atomicity, which concerns whether an\n * operation can ever be observed in an intermediate state.  Don't\n * conflate the two!)  Given a sequence of operations in source code on\n * memory, it is *not* always the case that, at all times and on all\n * cores, those operations will appear to have occurred in that exact\n * sequence.  First, the compiler might reorder that sequence, if it\n * thinks another ordering will be more efficient.  Second, the CPU may\n * not expose so consistent a view of memory.  CPUs will often perform\n * their own instruction reordering, above and beyond that performed by\n * the compiler.  And each core has its own memory caches, and accesses\n * (reads and writes both) to \"memory\" may only resolve to out-of-date\n * cache entries -- not to the \"most recently\" performed operation in\n * some global sense.  Any access to a value that may be used by\n * multiple threads, potentially across multiple cores, must therefore\n * have a memory ordering imposed on it, for all code on all\n * threads/cores to have a sufficiently coherent worldview.\n *\n * http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync and\n * http://en.cppreference.com/w/cpp/atomic/memory_order go into more\n * detail on all this, including examples of how each mode works.\n *\n * Note that for simplicity and practicality, not all of the modes in\n * C++11 are supported.  The missing C++11 modes are either subsumed by\n * the modes we provide below, or not relevant for the CPUs we support\n * in Gecko.  These three modes are confusing enough as it is!\n */\nenum MemoryOrdering {\n  /*\n   * Relaxed ordering is the simplest memory ordering: none at all.\n   * When the result of a write is observed, nothing may be inferred\n   * about other memory.  Writes ostensibly performed \"before\" on the\n   * writing thread may not yet be visible.  Writes performed \"after\" on\n   * the writing thread may already be visible, if the compiler or CPU\n   * reordered them.  (The latter can happen if reads and/or writes get\n   * held up in per-processor caches.)  Relaxed ordering means\n   * operations can always use cached values (as long as the actual\n   * updates to atomic values actually occur, correctly, eventually), so\n   * it's usually the fastest sort of atomic access.  For this reason,\n   * *it's also the most dangerous kind of access*.\n   *\n   * Relaxed ordering is good for things like process-wide statistics\n   * counters that don't need to be consistent with anything else, so\n   * long as updates themselves are atomic.  (And so long as any\n   * observations of that value can tolerate being out-of-date -- if you\n   * need some sort of up-to-date value, you need some sort of other\n   * synchronizing operation.)  It's *not* good for locks, mutexes,\n   * reference counts, etc. that mediate access to other memory, or must\n   * be observably consistent with other memory.\n   *\n   * x86 architectures don't take advantage of the optimization\n   * opportunities that relaxed ordering permits.  Thus it's possible\n   * that using relaxed ordering will \"work\" on x86 but fail elsewhere\n   * (ARM, say, which *does* implement non-sequentially-consistent\n   * relaxed ordering semantics).  Be extra-careful using relaxed\n   * ordering if you can't easily test non-x86 architectures!\n   */\n  Relaxed,\n  /*\n   * When an atomic value is updated with ReleaseAcquire ordering, and\n   * that new value is observed with ReleaseAcquire ordering, prior\n   * writes (atomic or not) are also observable.  What ReleaseAcquire\n   * *doesn't* give you is any observable ordering guarantees for\n   * ReleaseAcquire-ordered operations on different objects.  For\n   * example, if there are two cores that each perform ReleaseAcquire\n   * operations on separate objects, each core may or may not observe\n   * the operations made by the other core.  The only way the cores can\n   * be synchronized with ReleaseAcquire is if they both\n   * ReleaseAcquire-access the same object.  This implies that you can't\n   * necessarily describe some global total ordering of ReleaseAcquire\n   * operations.\n   *\n   * ReleaseAcquire ordering is good for (as the name implies) atomic\n   * operations on values controlling ownership of things: reference\n   * counts, mutexes, and the like.  However, if you are thinking about\n   * using these to implement your own locks or mutexes, you should take\n   * a good, hard look at actual lock or mutex primitives first.\n   */\n  ReleaseAcquire,\n  /*\n   * When an atomic value is updated with SequentiallyConsistent\n   * ordering, all writes observable when the update is observed, just\n   * as with ReleaseAcquire ordering.  But, furthermore, a global total\n   * ordering of SequentiallyConsistent operations *can* be described.\n   * For example, if two cores perform SequentiallyConsistent operations\n   * on separate objects, one core will observably perform its update\n   * (and all previous operations will have completed), then the other\n   * core will observably perform its update (and all previous\n   * operations will have completed).  (Although those previous\n   * operations aren't themselves ordered -- they could be intermixed,\n   * or ordered if they occur on atomic values with ordering\n   * requirements.)  SequentiallyConsistent is the *simplest and safest*\n   * ordering of atomic operations -- it's always as if one operation\n   * happens, then another, then another, in some order -- and every\n   * core observes updates to happen in that single order.  Because it\n   * has the most synchronization requirements, operations ordered this\n   * way also tend to be slowest.\n   *\n   * SequentiallyConsistent ordering can be desirable when multiple\n   * threads observe objects, and they all have to agree on the\n   * observable order of changes to them.  People expect\n   * SequentiallyConsistent ordering, even if they shouldn't, when\n   * writing code, atomic or otherwise.  SequentiallyConsistent is also\n   * the ordering of choice when designing lockless data structures.  If\n   * you don't know what order to use, use this one.\n   */\n  SequentiallyConsistent,\n};\n\n} // namespace mozilla\n\n// Build up the underlying intrinsics.\n#ifdef MOZ_HAVE_CXX11_ATOMICS\n\n#  include <atomic>\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * We provide CompareExchangeFailureOrder to work around a bug in some\n * versions of GCC's <atomic> header.  See bug 898491.\n */\ntemplate<MemoryOrdering Order> struct AtomicOrderConstraints;\n\ntemplate<>\nstruct AtomicOrderConstraints<Relaxed>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;\n    static const std::memory_order LoadOrder = std::memory_order_relaxed;\n    static const std::memory_order StoreOrder = std::memory_order_relaxed;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_relaxed;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<ReleaseAcquire>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;\n    static const std::memory_order LoadOrder = std::memory_order_acquire;\n    static const std::memory_order StoreOrder = std::memory_order_release;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_acquire;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<SequentiallyConsistent>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;\n    static const std::memory_order LoadOrder = std::memory_order_seq_cst;\n    static const std::memory_order StoreOrder = std::memory_order_seq_cst;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_seq_cst;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicBase\n{\n    typedef std::atomic<T> ValueType;\n    typedef AtomicOrderConstraints<Order> OrderedOp;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T load(const typename Base::ValueType& ptr) {\n      return ptr.load(Base::OrderedOp::LoadOrder);\n    }\n    static void store(typename Base::ValueType& ptr, T val) {\n      ptr.store(val, Base::OrderedOp::StoreOrder);\n    }\n    static T exchange(typename Base::ValueType& ptr, T val) {\n      return ptr.exchange(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static bool compareExchange(typename Base::ValueType& ptr, T oldVal, T newVal) {\n      return ptr.compare_exchange_strong(oldVal, newVal,\n                                         Base::OrderedOp::AtomicRMWOrder,\n                                         Base::OrderedOp::CompareExchangeFailureOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T add(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_add(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T sub(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_sub(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>\n{\n    typedef IntrinsicBase<T*, Order> Base;\n    static T* add(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_add(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T* sub(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_sub(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n  private:\n    /*\n     * GCC 4.6's <atomic> header has a bug where adding X to an\n     * atomic<T*> is not the same as adding X to a T*.  Hence the need\n     * for this function to provide the correct addend.\n     */\n    static ptrdiff_t fixupAddend(ptrdiff_t val) {\n#if defined(__clang__) || defined(_MSC_VER)\n      return val;\n#elif defined(__GNUC__) && MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) && \\\n      !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n      return val * sizeof(T);\n#else\n      return val;\n#endif\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T inc(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::add(ptr, 1);\n    }\n    static T dec(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::sub(ptr, 1);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T or_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_or(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T xor_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_xor(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T and_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_and(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order>\n  : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(__GNUC__)\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The __sync_* family of intrinsics is documented here:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Atomic-Builtins.html\n *\n * While these intrinsics are deprecated in favor of the newer __atomic_*\n * family of intrincs:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/_005f_005fatomic-Builtins.html\n *\n * any GCC version that supports the __atomic_* intrinsics will also support\n * the <atomic> header and so will be handled above.  We provide a version of\n * atomics using the __sync_* intrinsics to support older versions of GCC.\n *\n * All __sync_* intrinsics that we use below act as full memory barriers, for\n * both compiler and hardware reordering, except for __sync_lock_test_and_set,\n * which is a only an acquire barrier.  When we call __sync_lock_test_and_set,\n * we add a barrier above it as appropriate.\n */\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * Some processors (in particular, x86) don't require quite so many calls to\n * __sync_sychronize as our specializations of Barrier produce.  If\n * performance turns out to be an issue, defining these specializations\n * on a per-processor basis would be a good first tuning step.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { __sync_synchronize(); }\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() { __sync_synchronize(); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps\n{\n    static T load(const T& ptr) {\n      Barrier<Order>::beforeLoad();\n      T val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(T& ptr, T val) {\n      Barrier<Order>::beforeStore();\n      ptr = val;\n      Barrier<Order>::afterStore();\n    }\n    static T exchange(T& ptr, T val) {\n      // __sync_lock_test_and_set is only an acquire barrier; loads and stores\n      // can't be moved up from after to before it, but they can be moved down\n      // from before to after it.  We may want a stricter ordering, so we need\n      // an explicit barrier.\n\n      Barrier<Order>::beforeStore();\n      return __sync_lock_test_and_set(&ptr, val);\n    }\n    static bool compareExchange(T& ptr, T oldVal, T newVal) {\n      return __sync_bool_compare_and_swap(&ptr, oldVal, newVal);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub\n{\n    typedef T ValueType;\n    static T add(T& ptr, T val) {\n      return __sync_fetch_and_add(&ptr, val);\n    }\n    static T sub(T& ptr, T val) {\n      return __sync_fetch_and_sub(&ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*>\n{\n    typedef T* ValueType;\n    /*\n     * The reinterpret_casts are needed so that\n     * __sync_fetch_and_{add,sub} will properly type-check.\n     *\n     * Also, these functions do not provide standard semantics for\n     * pointer types, so we need to adjust the addend.\n     */\n    static ValueType add(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_add(&ptr, amount);\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_sub(&ptr, amount);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static T inc(T& ptr) { return IntrinsicAddSub<T>::add(ptr, 1); }\n    static T dec(T& ptr) { return IntrinsicAddSub<T>::sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static T or_(T& ptr, T val) {\n      return __sync_fetch_and_or(&ptr, val);\n    }\n    static T xor_(T& ptr, T val) {\n      return __sync_fetch_and_xor(&ptr, val);\n    }\n    static T and_(T& ptr, T val) {\n      return __sync_fetch_and_and(&ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(_MSC_VER)\n\n/*\n * Windows comes with a full complement of atomic operations.\n * Unfortunately, most of those aren't available for Windows XP (even if\n * the compiler supports intrinsics for them), which is the oldest\n * version of Windows we support.  Therefore, we only provide operations\n * on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows\n * versions, we support 64-bit datatypes as well.\n *\n * To avoid namespace pollution issues, we declare whatever functions we\n * need ourselves.\n */\n\nextern \"C\" {\nlong __cdecl _InterlockedExchangeAdd(long volatile* dst, long value);\nlong __cdecl _InterlockedOr(long volatile* dst, long value);\nlong __cdecl _InterlockedXor(long volatile* dst, long value);\nlong __cdecl _InterlockedAnd(long volatile* dst, long value);\nlong __cdecl _InterlockedExchange(long volatile *dst, long value);\nlong __cdecl _InterlockedCompareExchange(long volatile *dst, long newVal, long oldVal);\n}\n\n#  pragma intrinsic(_InterlockedExchangeAdd)\n#  pragma intrinsic(_InterlockedOr)\n#  pragma intrinsic(_InterlockedXor)\n#  pragma intrinsic(_InterlockedAnd)\n#  pragma intrinsic(_InterlockedExchange)\n#  pragma intrinsic(_InterlockedCompareExchange)\n\nnamespace mozilla {\nnamespace detail {\n\n#  if !defined(_M_IX86) && !defined(_M_X64)\n     /*\n      * The implementations below are optimized for x86ish systems.  You\n      * will have to modify them if you are porting to Windows on a\n      * different architecture.\n      */\n#    error \"Unknown CPU type\"\n#  endif\n\n/*\n * The PrimitiveIntrinsics template should define |Type|, the datatype of size\n * DataSize upon which we operate, and the following eight functions.\n *\n * static Type add(Type* ptr, Type val);\n * static Type sub(Type* ptr, Type val);\n * static Type or_(Type* ptr, Type val);\n * static Type xor_(Type* ptr, Type val);\n * static Type and_(Type* ptr, Type val);\n *\n *   These functions perform the obvious operation on the value contained in\n *   |*ptr| combined with |val| and return the value previously stored in\n *   |*ptr|.\n *\n * static void store(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and must provide a full\n *   memory fence after the store to prevent compiler and hardware instruction\n *   reordering.  It should also act as a compiler barrier to prevent reads and\n *   writes from moving to after the store.\n *\n * static Type exchange(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and returns the previous\n *   contents of *ptr;\n *\n * static bool compareExchange(Type* ptr, Type oldVal, Type newVal);\n *\n *   This function atomically performs the following operation:\n *\n *     if (*ptr == oldVal) {\n *       *ptr = newVal;\n *       return true;\n *     } else {\n *       return false;\n *     }\n *\n */\ntemplate<size_t DataSize> struct PrimitiveIntrinsics;\n\ntemplate<>\nstruct PrimitiveIntrinsics<4>\n{\n    typedef long Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * _InterlockedExchangeSubtract isn't available before Windows 7,\n       * and we must support Windows XP.\n       */\n      return _InterlockedExchangeAdd(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  if defined(_M_X64)\n\nextern \"C\" {\nlong long __cdecl _InterlockedExchangeAdd64(long long volatile* dst,\n                                            long long value);\nlong long __cdecl _InterlockedOr64(long long volatile* dst,\n                                   long long value);\nlong long __cdecl _InterlockedXor64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedAnd64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedExchange64(long long volatile* dst,\n                                         long long value);\nlong long __cdecl _InterlockedCompareExchange64(long long volatile* dst,\n                                                long long newVal,\n                                                long long oldVal);\n}\n\n#    pragma intrinsic(_InterlockedExchangeAdd64)\n#    pragma intrinsic(_InterlockedOr64)\n#    pragma intrinsic(_InterlockedXor64)\n#    pragma intrinsic(_InterlockedAnd64)\n#    pragma intrinsic(_InterlockedExchange64)\n#    pragma intrinsic(_InterlockedCompareExchange64)\n\ntemplate <>\nstruct PrimitiveIntrinsics<8>\n{\n    typedef __int64 Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd64(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * There is no _InterlockedExchangeSubtract64.\n       */\n      return _InterlockedExchangeAdd64(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr64(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor64(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd64(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange64(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange64(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange64(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  endif\n\nextern \"C\" { void _ReadWriteBarrier(); }\n\n#  pragma intrinsic(_ReadWriteBarrier)\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * We do not provide an afterStore method in Barrier, as Relaxed and\n * ReleaseAcquire orderings do not require one, and the required barrier\n * for SequentiallyConsistent is handled by PrimitiveIntrinsics.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { _ReadWriteBarrier(); }\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper\n{\n  static PrimType toPrimType(T val) { return static_cast<PrimType>(val); }\n  static T fromPrimType(PrimType val) { return static_cast<T>(val); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper<PrimType, T*>\n{\n  static PrimType toPrimType(T* val) { return reinterpret_cast<PrimType>(val); }\n  static T* fromPrimType(PrimType val) { return reinterpret_cast<T*>(val); }\n};\n\ntemplate<typename T>\nstruct IntrinsicBase\n{\n    typedef T ValueType;\n    typedef PrimitiveIntrinsics<sizeof(T)> Primitives;\n    typedef typename Primitives::Type PrimType;\n    static_assert(sizeof(PrimType) == sizeof(T),\n                  \"Selection of PrimitiveIntrinsics was wrong\");\n    typedef CastHelper<PrimType, T> Cast;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T>\n{\n    static ValueType load(const ValueType& ptr) {\n      Barrier<Order>::beforeLoad();\n      ValueType val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(ValueType& ptr, ValueType val) {\n      // For SequentiallyConsistent, Primitives::store() will generate the\n      // proper memory fence.  Everything else just needs a barrier before\n      // the store.\n      if (Order == SequentiallyConsistent) {\n        Primitives::store(reinterpret_cast<PrimType*>(&ptr),\n                          Cast::toPrimType(val));\n      } else {\n        Barrier<Order>::beforeStore();\n        ptr = val;\n      }\n    }\n    static ValueType exchange(ValueType& ptr, ValueType val) {\n      PrimType oldval =\n        Primitives::exchange(reinterpret_cast<PrimType*>(&ptr),\n                             Cast::toPrimType(val));\n      return Cast::fromPrimType(oldval);\n    }\n    static bool compareExchange(ValueType& ptr, ValueType oldVal, ValueType newVal) {\n      return Primitives::compareExchange(reinterpret_cast<PrimType*>(&ptr),\n                                         Cast::toPrimType(oldVal),\n                                         Cast::toPrimType(newVal));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicApplyHelper : public IntrinsicBase<T>\n{\n    typedef PrimType (*BinaryOp)(PrimType*, PrimType);\n    typedef PrimType (*UnaryOp)(PrimType*);\n\n    static ValueType applyBinaryFunction(BinaryOp op, ValueType& ptr,\n                                         ValueType val) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      PrimType primTypeVal = Cast::toPrimType(val);\n      return Cast::fromPrimType(op(primTypePtr, primTypeVal));\n    }\n\n    static ValueType applyUnaryFunction(UnaryOp op, ValueType& ptr) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      return Cast::fromPrimType(op(primTypePtr));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub : public IntrinsicApplyHelper<T>\n{\n    static ValueType add(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::add, ptr, val);\n    }\n    static ValueType sub(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::sub, ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*> : public IntrinsicApplyHelper<T*>\n{\n    static ValueType add(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::add, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::sub, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static ValueType inc(ValueType& ptr) { return add(ptr, 1); }\n    static ValueType dec(ValueType& ptr) { return sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static ValueType or_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::or_, ptr, val);\n    }\n    static ValueType xor_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::xor_, ptr, val);\n    }\n    static ValueType and_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::and_, ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#else\n# error \"Atomic compiler intrinsics are not supported on your platform\"\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBase\n{\n    // We only support 32-bit types on 32-bit Windows, which constrains our\n    // implementation elsewhere.  But we support pointer-sized types everywhere.\n    static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),\n                  \"mozilla/Atomics.h only supports 32-bit and pointer-sized types\");\n\n  protected:\n    typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;\n    typename Intrinsics::ValueType mValue;\n\n  public:\n    AtomicBase() : mValue() {}\n    AtomicBase(T aInit) { Intrinsics::store(mValue, aInit); }\n\n    operator T() const { return Intrinsics::load(mValue); }\n\n    T operator=(T aValue) {\n      Intrinsics::store(mValue, aValue);\n      return aValue;\n    }\n\n    /**\n     * Performs an atomic swap operation.  aValue is stored and the previous\n     * value of this variable is returned.\n     */\n    T exchange(T aValue) {\n      return Intrinsics::exchange(mValue, aValue);\n    }\n\n    /**\n     * Performs an atomic compare-and-swap operation and returns true if it\n     * succeeded. This is equivalent to atomically doing\n     *\n     *   if (mValue == aOldValue) {\n     *     mValue = aNewValue;\n     *     return true;\n     *   } else {\n     *     return false;\n     *   }\n     */\n    bool compareExchange(T aOldValue, T aNewValue) {\n      return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);\n    }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBaseIncDec : public AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    AtomicBaseIncDec() : Base() {}\n    AtomicBaseIncDec(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }\n    T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }\n    T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }\n    T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\n} // namespace detail\n\n/**\n * A wrapper for a type that enforces that all memory accesses are atomic.\n *\n * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in\n * its place.  Implementations for integral and pointer types are provided\n * below.\n *\n * Atomic accesses are sequentially consistent by default.  You should\n * use the default unless you are tall enough to ride the\n * memory-ordering roller coaster (if you're not sure, you aren't) and\n * you have a compelling reason to do otherwise.\n *\n * There is one exception to the case of atomic memory accesses: providing an\n * initial value of the atomic value is not guaranteed to be atomic.  This is a\n * deliberate design choice that enables static atomic variables to be declared\n * without introducing extra static constructors.\n */\ntemplate<typename T,\n         MemoryOrdering Order = SequentiallyConsistent,\n         typename Enable = void>\nclass Atomic;\n\n/**\n * Atomic<T> implementation for integral types.\n *\n * In addition to atomic store and load operations, compound assignment and\n * increment/decrement operators are implemented which perform the\n * corresponding read-modify-write operation atomically.  Finally, an atomic\n * swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsIntegral<T>::value>::Type>\n  : public detail::AtomicBaseIncDec<T, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator+=(T delta) { return Base::Intrinsics::add(Base::mValue, delta) + delta; }\n    T operator-=(T delta) { return Base::Intrinsics::sub(Base::mValue, delta) - delta; }\n    T operator|=(T val) { return Base::Intrinsics::or_(Base::mValue, val) | val; }\n    T operator^=(T val) { return Base::Intrinsics::xor_(Base::mValue, val) ^ val; }\n    T operator&=(T val) { return Base::Intrinsics::and_(Base::mValue, val) & val; }\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for pointer types.\n *\n * An atomic compare-and-swap primitive for pointer variables is provided, as\n * are atomic increment and decement operators.  Also provided are the compound\n * assignment operators for addition and subtraction. Atomic swap (via\n * exchange()) is included as well.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T*, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T* aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T* operator+=(ptrdiff_t delta) {\n      return Base::Intrinsics::add(Base::mValue, delta) + delta;\n    }\n    T* operator-=(ptrdiff_t delta) {\n      return Base::Intrinsics::sub(Base::mValue, delta) - delta;\n    }\n\n  private:\n    Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for enum types.\n *\n * The atomic store and load operations and the atomic swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>\n  : public detail::AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Atomics_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Attributes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of various class and method modifier attributes. */\n\n#ifndef mozilla_Attributes_h\n#define mozilla_Attributes_h\n\n#include \"mozilla/Compiler.h\"\n\n/*\n * MOZ_INLINE is a macro which expands to tell the compiler that the method\n * decorated with it should be inlined.  This macro is usable from C and C++\n * code, even though C89 does not support the |inline| keyword.  The compiler\n * may ignore this directive if it chooses.\n */\n#if defined(__cplusplus)\n#  define MOZ_INLINE            inline\n#elif defined(_MSC_VER)\n#  define MOZ_INLINE            __inline\n#elif defined(__GNUC__)\n#  define MOZ_INLINE            __inline__\n#else\n#  define MOZ_INLINE            inline\n#endif\n\n/*\n * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must be inlined, even if the compiler thinks\n * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:\n * compilers are not guaranteed to respect it (although they're much more likely\n * to do so).\n *\n * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the\n * compiler to inline even in DEBUG builds. It should be used very rarely.\n */\n#if defined(_MSC_VER)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __forceinline\n#elif defined(__GNUC__)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     MOZ_INLINE\n#endif\n\n#if defined(DEBUG)\n#  define MOZ_ALWAYS_INLINE     MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG\n#endif\n\n/*\n * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality\n * without warnings (functionality used by the macros below).  These modes are\n * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more\n * standardly, by checking whether __cplusplus has a C++11 or greater value.\n * Current versions of g++ do not correctly set __cplusplus, so we check both\n * for forward compatibility.\n */\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_constexpr)\n#    define MOZ_HAVE_CXX11_CONSTEXPR\n#  endif\n#  if __has_extension(cxx_deleted_functions)\n#    define MOZ_HAVE_CXX11_DELETE\n#  endif\n#  if __has_extension(cxx_override_control)\n#    define MOZ_HAVE_CXX11_OVERRIDE\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  endif\n#  if __has_attribute(noinline)\n#    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))\n#  endif\n#  if __has_attribute(noreturn)\n#    define MOZ_HAVE_NORETURN            __attribute__((noreturn))\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_OVERRIDE\n#      define MOZ_HAVE_CXX11_FINAL       final\n#    endif\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_CONSTEXPR\n#    endif\n#    define MOZ_HAVE_CXX11_DELETE\n#  else\n     /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_FINAL       __final\n#    endif\n#  endif\n#  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))\n#  define MOZ_HAVE_NORETURN              __attribute__((noreturn))\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  else\n     /* MSVC <= 10 used to spell \"final\" as \"sealed\". */\n#    define MOZ_HAVE_CXX11_FINAL         sealed\n#  endif\n#  define MOZ_HAVE_CXX11_OVERRIDE\n#  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)\n#  define MOZ_HAVE_NORETURN              __declspec(noreturn)\n#endif\n\n/*\n * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a\n * function at compile time. A constexpr function cannot examine any values\n * except its arguments and can have no side effects except its return value.\n * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's\n * value may be computed at compile time.  It should be prefered to just\n * marking variables as MOZ_CONSTEXPR because if the compiler does not support\n * constexpr it will fall back to making the variable const, and some compilers\n * do not accept variables being marked both const and constexpr.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_CONSTEXPR         constexpr\n#  define MOZ_CONSTEXPR_VAR     constexpr\n#else\n#  define MOZ_CONSTEXPR         /* no support */\n#  define MOZ_CONSTEXPR_VAR     const\n#endif\n\n/*\n * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must never be inlined, even if the compiler would\n * otherwise choose to inline the method.  Compilers aren't absolutely\n * guaranteed to support this, but most do.\n */\n#if defined(MOZ_HAVE_NEVER_INLINE)\n#  define MOZ_NEVER_INLINE      MOZ_HAVE_NEVER_INLINE\n#else\n#  define MOZ_NEVER_INLINE      /* no support */\n#endif\n\n/*\n * MOZ_NORETURN, specified at the start of a function declaration, indicates\n * that the given function does not return.  (The function definition does not\n * need to be annotated.)\n *\n *   MOZ_NORETURN void abort(const char* msg);\n *\n * This modifier permits the compiler to optimize code assuming a call to such a\n * function will never return.  It also enables the compiler to avoid spurious\n * warnings about not initializing variables, or about any other seemingly-dodgy\n * operations performed after the function returns.\n *\n * This modifier does not affect the corresponding function's linking behavior.\n */\n#if defined(MOZ_HAVE_NORETURN)\n#  define MOZ_NORETURN          MOZ_HAVE_NORETURN\n#else\n#  define MOZ_NORETURN          /* no support */\n#endif\n\n/*\n * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time\n * instrumentation shipped with Clang) to not instrument the annotated function.\n * Furthermore, it will prevent the compiler from inlining the function because\n * inlining currently breaks the blacklisting mechanism of AddressSanitizer.\n */\n#if defined(MOZ_ASAN)\n#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis))\n# else\n#  define MOZ_ASAN_BLACKLIST\n#endif\n\n\n#ifdef __cplusplus\n\n/*\n * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-\n * method declaration, attempts to delete that method from the corresponding\n * class.  An attempt to use the method will always produce an error *at compile\n * time* (instead of sometimes as late as link time) when this macro can be\n * implemented.  For example, you can use MOZ_DELETE to produce classes with no\n * implicit copy constructor or assignment operator:\n *\n *   struct NonCopyable\n *   {\n *     private:\n *       NonCopyable(const NonCopyable& other) MOZ_DELETE;\n *       void operator=(const NonCopyable& other) MOZ_DELETE;\n *   };\n *\n * If MOZ_DELETE can't be implemented for the current compiler, use of the\n * annotated method will still cause an error, but the error might occur at link\n * time in some cases rather than at compile time.\n *\n * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a\n * backstop, method declarations using MOZ_DELETE should be private.\n */\n#if defined(MOZ_HAVE_CXX11_DELETE)\n#  define MOZ_DELETE            = delete\n#else\n#  define MOZ_DELETE            /* no support */\n#endif\n\n/*\n * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class\n * overrides a member function of a base class, rather than potentially being a\n * new member function.  MOZ_OVERRIDE should be placed immediately before the\n * ';' terminating the member function's declaration, or before '= 0;' if the\n * member function is pure.  If the member function is defined in the class\n * definition, it should appear before the opening brace of the function body.\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() = 0;\n *   };\n *   class Derived1 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE;\n *   };\n *   class Derived2 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE = 0;\n *   };\n *   class Derived3 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE { }\n *   };\n *\n * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that\n * the function marked with it override a member function of a base class: it\n * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect\n * semantics and merely documents the override relationship to the reader (but\n * of course must still be used correctly to not break C++11 compilers).\n */\n#if defined(MOZ_HAVE_CXX11_OVERRIDE)\n#  define MOZ_OVERRIDE          override\n#else\n#  define MOZ_OVERRIDE          /* no support */\n#endif\n\n/*\n * MOZ_FINAL indicates that some functionality cannot be overridden through\n * inheritance.  It can be used to annotate either classes/structs or virtual\n * member functions.\n *\n * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after\n * the name of the class, before the list of classes from which it derives (if\n * any) and before its opening brace.  MOZ_FINAL must not be used to annotate\n * unnamed classes or structs.  (With some compilers, and with C++11 proper, the\n * underlying expansion is ambiguous with specifying a class name.)\n *\n *   class Base MOZ_FINAL\n *   {\n *     public:\n *       Base();\n *       ~Base();\n *       virtual void f() { }\n *   };\n *   // This will be an error in some compilers:\n *   class Derived : public Base\n *   {\n *     public:\n *       ~Derived() { }\n *   };\n *\n * One particularly common reason to specify MOZ_FINAL upon a class is to tell\n * the compiler that it's not dangerous for it to have a non-virtual destructor\n * yet have one or more virtual functions, silencing the warning it might emit\n * in this case.  Suppose Base above weren't annotated with MOZ_FINAL.  Because\n * ~Base() is non-virtual, an attempt to delete a Derived* through a Base*\n * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen.\n * (Formally C++ says behavior is undefined, but compilers will likely just call\n * ~Base() and not ~Derived().)  Specifying MOZ_FINAL tells the compiler that\n * it's safe for the destructor to be non-virtual.\n *\n * In compilers implementing final controls, it is an error to inherit from a\n * class annotated with MOZ_FINAL.  In other compilers it serves only as\n * documentation.\n *\n * To annotate a virtual member function with MOZ_FINAL, place MOZ_FINAL\n * immediately before the ';' terminating the member function's declaration, or\n * before '= 0;' if the member function is pure.  If the member function is\n * defined in the class definition, it should appear before the opening brace of\n * the function body.  (This placement is identical to that for MOZ_OVERRIDE.\n * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE'\n * for consistency.)\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() MOZ_FINAL;\n *   };\n *   class Derived\n *   {\n *     public:\n *       // This will be an error in some compilers:\n *       virtual void f();\n *   };\n *\n * In compilers implementing final controls, it is an error for a derived class\n * to override a method annotated with MOZ_FINAL.  In other compilers it serves\n * only as documentation.\n */\n#if defined(MOZ_HAVE_CXX11_FINAL)\n#  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL\n#else\n#  define MOZ_FINAL             /* no support */\n#endif\n\n/**\n * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's\n * return value is not used by the caller.\n *\n * Place this attribute at the very beginning of a function definition. For\n * example, write\n *\n *   MOZ_WARN_UNUSED_RESULT int foo();\n *\n * or\n *\n *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }\n */\n#if defined(__GNUC__) || defined(__clang__)\n#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))\n#else\n#  define MOZ_WARN_UNUSED_RESULT\n#endif\n\n/*\n * The following macros are attributes that support the static analysis plugin\n * included with Mozilla, and will be implemented (when such support is enabled)\n * as C++11 attributes. Since such attributes are legal pretty much everywhere\n * and have subtly different semantics depending on their placement, the\n * following is a guide on where to place the attributes.\n *\n * Attributes that apply to a struct or class precede the name of the class:\n * (Note that this is different from the placement of MOZ_FINAL for classes!)\n *\n *   class MOZ_CLASS_ATTRIBUTE SomeClass {};\n *\n * Attributes that apply to functions follow the parentheses and const\n * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body:\n *\n *   void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE;\n *   void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {}\n *   void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0;\n *   void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE;\n *\n * Attributes that apply to variables or parameters follow the variable's name:\n *\n *   int variable MOZ_VARIABLE_ATTRIBUTE;\n *\n * Attributes that apply to types follow the type name:\n *\n *   typedef int MOZ_TYPE_ATTRIBUTE MagicInt;\n *   int MOZ_TYPE_ATTRIBUTE someVariable;\n *   int * MOZ_TYPE_ATTRIBUTE magicPtrInt;\n *   int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt;\n *\n * Attributes that apply to statements precede the statement:\n *\n *   MOZ_IF_ATTRIBUTE if (x == 0)\n *   MOZ_DO_ATTRIBUTE do { } while(0);\n *\n * Attributes that apply to labels precede the label:\n *\n *   MOZ_LABEL_ATTRIBUTE target:\n *     goto target;\n *   MOZ_CASE_ATTRIBUTE case 5:\n *   MOZ_DEFAULT_ATTRIBUTE default:\n *\n * The static analyses that are performed by the plugin are as follows:\n *\n * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate\n *   subclasses must provide an exact override of this method; if a subclass\n *   does not override this method, the compiler will emit an error. This\n *   attribute is not limited to virtual methods, so if it is applied to a\n *   nonvirtual method and the subclass does not provide an equivalent\n *   definition, the compiler will emit an error.\n * MOZ_STACK_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack, so it is a compile-time error to use it, or\n *   an array of such objects, as a global or static variable, or as the type of\n *   a new expression (unless placement new is being used). If a member of\n *   another class uses this class, or if another class inherits from this\n *   class, then it is considered to be a stack class as well, although this\n *   attribute need not be provided in such cases.\n * MOZ_NONHEAP_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack or in static storage, so it is a compile-time\n *   error to use it, or an array of such objects, as the type of a new\n *   expression (unless placement new is being used). If a member of another\n *   class uses this class, or if another class inherits from this class, then\n *   it is considered to be a non-heap class as well, although this attribute\n *   need not be provided in such cases.\n */\n#ifdef MOZ_CLANG_PLUGIN\n# define MOZ_MUST_OVERRIDE __attribute__((annotate(\"moz_must_override\")))\n# define MOZ_STACK_CLASS __attribute__((annotate(\"moz_stack_class\")))\n# define MOZ_NONHEAP_CLASS __attribute__((annotate(\"moz_nonheap_class\")))\n#else\n# define MOZ_MUST_OVERRIDE /* nothing */\n# define MOZ_STACK_CLASS /* nothing */\n# define MOZ_NONHEAP_CLASS /* nothing */\n#endif /* MOZ_CLANG_PLUGIN */\n\n/*\n * MOZ_THIS_IN_INITIALIZER_LIST is used to avoid a warning when we know that\n * it's safe to use 'this' in an initializer list.\n */\n#ifdef _MSC_VER\n#  define MOZ_THIS_IN_INITIALIZER_LIST() \\\n     __pragma(warning(push)) \\\n     __pragma(warning(disable:4355)) \\\n     this \\\n     __pragma(warning(pop))\n#else\n#  define MOZ_THIS_IN_INITIALIZER_LIST() this\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_Attributes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/BloomFilter.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A counting Bloom filter implementation.  This allows consumers to\n * do fast probabilistic \"is item X in set Y?\" testing which will\n * never answer \"no\" when the correct answer is \"yes\" (but might\n * incorrectly answer \"yes\" when the correct answer is \"no\").\n */\n\n#ifndef mozilla_BloomFilter_h\n#define mozilla_BloomFilter_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Likely.h\"\n#include \"mozilla/Util.h\"\n\n#include <stdint.h>\n#include <string.h>\n\nnamespace mozilla {\n\n/*\n * This class implements a counting Bloom filter as described at\n * <http://en.wikipedia.org/wiki/Bloom_filter#Counting_filters>, with\n * 8-bit counters.  This allows quick probabilistic answers to the\n * question \"is object X in set Y?\" where the contents of Y might not\n * be time-invariant.  The probabilistic nature of the test means that\n * sometimes the answer will be \"yes\" when it should be \"no\".  If the\n * answer is \"no\", then X is guaranteed not to be in Y.\n *\n * The filter is parametrized on KeySize, which is the size of the key\n * generated by each of hash functions used by the filter, in bits,\n * and the type of object T being added and removed.  T must implement\n * a |uint32_t hash() const| method which returns a uint32_t hash key\n * that will be used to generate the two separate hash functions for\n * the Bloom filter.  This hash key MUST be well-distributed for good\n * results!  KeySize is not allowed to be larger than 16.\n *\n * The filter uses exactly 2**KeySize bytes of memory.  From now on we\n * will refer to the memory used by the filter as M.\n *\n * The expected rate of incorrect \"yes\" answers depends on M and on\n * the number N of objects in set Y.  As long as N is small compared\n * to M, the rate of such answers is expected to be approximately\n * 4*(N/M)**2 for this filter.  In practice, if Y has a few hundred\n * elements then using a KeySize of 12 gives a reasonably low\n * incorrect answer rate.  A KeySize of 12 has the additional benefit\n * of using exactly one page for the filter in typical hardware\n * configurations.\n */\n\ntemplate<unsigned KeySize, class T>\nclass BloomFilter\n{\n    /*\n     * A counting Bloom filter with 8-bit counters.  For now we assume\n     * that having two hash functions is enough, but we may revisit that\n     * decision later.\n     *\n     * The filter uses an array with 2**KeySize entries.\n     *\n     * Assuming a well-distributed hash function, a Bloom filter with\n     * array size M containing N elements and\n     * using k hash function has expected false positive rate exactly\n     *\n     * $  (1 - (1 - 1/M)^{kN})^k  $\n     *\n     * because each array slot has a\n     *\n     * $  (1 - 1/M)^{kN}  $\n     *\n     * chance of being 0, and the expected false positive rate is the\n     * probability that all of the k hash functions will hit a nonzero\n     * slot.\n     *\n     * For reasonable assumptions (M large, kN large, which should both\n     * hold if we're worried about false positives) about M and kN this\n     * becomes approximately\n     *\n     * $$  (1 - \\exp(-kN/M))^k   $$\n     *\n     * For our special case of k == 2, that's $(1 - \\exp(-2N/M))^2$,\n     * or in other words\n     *\n     * $$    N/M = -0.5 * \\ln(1 - \\sqrt(r))   $$\n     *\n     * where r is the false positive rate.  This can be used to compute\n     * the desired KeySize for a given load N and false positive rate r.\n     *\n     * If N/M is assumed small, then the false positive rate can\n     * further be approximated as 4*N^2/M^2.  So increasing KeySize by\n     * 1, which doubles M, reduces the false positive rate by about a\n     * factor of 4, and a false positive rate of 1% corresponds to\n     * about M/N == 20.\n     *\n     * What this means in practice is that for a few hundred keys using a\n     * KeySize of 12 gives false positive rates on the order of 0.25-4%.\n     *\n     * Similarly, using a KeySize of 10 would lead to a 4% false\n     * positive rate for N == 100 and to quite bad false positive\n     * rates for larger N.\n     */\n  public:\n    BloomFilter() {\n        static_assert(KeySize <= keyShift, \"KeySize too big\");\n\n        // Should we have a custom operator new using calloc instead and\n        // require that we're allocated via the operator?\n        clear();\n    }\n\n    /*\n     * Clear the filter.  This should be done before reusing it, because\n     * just removing all items doesn't clear counters that hit the upper\n     * bound.\n     */\n    void clear();\n\n    /*\n     * Add an item to the filter.\n     */\n    void add(const T* t);\n\n    /*\n     * Remove an item from the filter.\n     */\n    void remove(const T* t);\n\n    /*\n     * Check whether the filter might contain an item.  This can\n     * sometimes return true even if the item is not in the filter,\n     * but will never return false for items that are actually in the\n     * filter.\n     */\n    bool mightContain(const T* t) const;\n\n    /*\n     * Methods for add/remove/contain when we already have a hash computed\n     */\n    void add(uint32_t hash);\n    void remove(uint32_t hash);\n    bool mightContain(uint32_t hash) const;\n\n  private:\n    static const size_t arraySize = (1 << KeySize);\n    static const uint32_t keyMask = (1 << KeySize) - 1;\n    static const uint32_t keyShift = 16;\n\n    static uint32_t hash1(uint32_t hash) { return hash & keyMask; }\n    static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; }\n\n    uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; }\n    uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; }\n    const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; }\n    const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; }\n\n    static bool full(const uint8_t& slot) { return slot == UINT8_MAX; }\n\n    uint8_t counters[arraySize];\n};\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::clear()\n{\n  memset(counters, 0, arraySize);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::add(uint32_t hash)\n{\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    ++slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    ++slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::add(const T* t)\n{\n  uint32_t hash = t->hash();\n  return add(hash);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::remove(uint32_t hash)\n{\n  // If the slots are full, we don't know whether we bumped them to be\n  // there when we added or not, so just leave them full.\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    --slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    --slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::remove(const T* t)\n{\n  uint32_t hash = t->hash();\n  remove(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(uint32_t hash) const\n{\n  // Check that all the slots for this hash contain something\n  return firstSlot(hash) && secondSlot(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(const T* t) const\n{\n  uint32_t hash = t->hash();\n  return mightContain(hash);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_BloomFilter_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Casting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cast operations to supplement the built-in casting operations. */\n\n#ifndef mozilla_Casting_h\n#define mozilla_Casting_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <limits.h>\n\nnamespace mozilla {\n\n/**\n * Return a value of type |To|, containing the underlying bit pattern of |from|.\n *\n * |To| and |From| must be types of the same size; be careful of cross-platform\n * size differences, or this might fail to compile on some but not all\n * platforms.\n */\ntemplate<typename To, typename From>\ninline To\nBitwiseCast(const From from)\n{\n  static_assert(sizeof(From) == sizeof(To),\n                \"To and From must have the same size\");\n  union {\n    From from;\n    To to;\n  } u;\n  u.from = from;\n  return u.to;\n}\n\nnamespace detail {\n\nenum ToSignedness { ToIsSigned, ToIsUnsigned };\nenum FromSignedness { FromIsSigned, FromIsUnsigned };\n\ntemplate<typename From,\n         typename To,\n         FromSignedness = IsSigned<From>::value ? FromIsSigned : FromIsUnsigned,\n         ToSignedness = IsSigned<To>::value ? ToIsSigned : ToIsUnsigned>\nstruct BoundsCheckImpl;\n\n// Implicit conversions on operands to binary operations make this all a bit\n// hard to verify.  Attempt to ease the pain below by *only* comparing values\n// that are obviously the same type (and will undergo no further conversions),\n// even when it's not strictly necessary, for explicitness.\n\nenum UUComparison { FromIsBigger, FromIsNotBigger };\n\n// Unsigned-to-unsigned range check\n\ntemplate<typename From, typename To,\n         UUComparison = (sizeof(From) > sizeof(To)) ? FromIsBigger : FromIsNotBigger>\nstruct UnsignedUnsignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return from <= From(To(-1));\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsNotBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedUnsignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-unsigned range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (from < 0)\n        return false;\n      if (sizeof(To) >= sizeof(From))\n        return true;\n      return from <= From(To(-1));\n    }\n};\n\n// Unsigned-to-signed range check\n\nenum USComparison { FromIsSmaller, FromIsNotSmaller };\n\ntemplate<typename From, typename To,\n         USComparison = (sizeof(From) < sizeof(To)) ? FromIsSmaller : FromIsNotSmaller>\nstruct UnsignedSignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsNotSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      return from <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedSignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-signed range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (sizeof(From) <= sizeof(To))\n        return true;\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      const To MinValue = -MaxValue - To(1);\n      return From(MinValue) <= from &&\n             From(from) <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To,\n         bool TypesAreIntegral = IsIntegral<From>::value && IsIntegral<To>::value>\nclass BoundsChecker;\n\ntemplate<typename From>\nclass BoundsChecker<From, From, true>\n{\n  public:\n    static bool checkBounds(const From from) { return true; }\n};\n\ntemplate<typename From, typename To>\nclass BoundsChecker<From, To, true>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return BoundsCheckImpl<From, To>::checkBounds(from);\n    }\n};\n\ntemplate<typename From, typename To>\ninline bool\nIsInBounds(const From from)\n{\n  return BoundsChecker<From, To>::checkBounds(from);\n}\n\n} // namespace detail\n\n/**\n * Cast a value of integral type |From| to a value of integral type |To|,\n * asserting that the cast will be a safe cast per C++ (that is, that |to| is in\n * the range of values permitted for the type |From|).\n */\ntemplate<typename To, typename From>\ninline To\nSafeCast(const From from)\n{\n  MOZ_ASSERT((detail::IsInBounds<From, To>(from)));\n  return static_cast<To>(from);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Casting_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Char16.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implements a UTF-16 character type. */\n\n#ifndef mozilla_Char16_h\n#define mozilla_Char16_h\n\n#include \"mozilla/Assertions.h\"\n\n/*\n * C11 and C++11 introduce a char16_t type and support for UTF-16 string and\n * character literals. C++11's char16_t is a distinct builtin type. C11's\n * char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit\n * code unit of a Unicode code point, not a \"character\".\n *\n * For now, Char16.h only supports C++ because we don't want mix different C\n * and C++ definitions of char16_t in the same code base.\n */\n\n#ifdef _MSC_VER\n   /*\n    * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h\n    * typedefs char16_t as an unsigned short. We would like to alias char16_t\n    * to Windows's 16-bit wchar_t so we can declare UTF-16 literals as constant\n    * expressions (and pass char16_t pointers to Windows APIs). We #define our\n    * char16_t as a macro to override yval.h's typedef of the same name.\n    */\n#  define MOZ_UTF16_HELPER(s) L##s\n#  include <yvals.h>\n#  define char16_t wchar_t\n#elif defined(__cplusplus) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))\n   /* C++11 has a builtin char16_t type. */\n#  define MOZ_UTF16_HELPER(s) u##s\n#else\n#  error \"Char16.h requires C++11 (or something like it) for UTF-16 support.\"\n#endif\n\n/*\n * Macro arguments used in concatenation or stringification won't be expanded.\n * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to\n * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper\n * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro\n * argument to expand. See \"3.10.6 Separate Expansion of Macro Arguments\" of the\n * CPP manual for a more accurate and precise explanation.\n */\n#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)\n\nstatic_assert(sizeof(char16_t) == 2, \"Is char16_t type 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16('A')) == 2, \"Is char literal 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16(\"\")[0]) == 2, \"Is string char 16 bits?\");\n\n#endif /* mozilla_Char16_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/CheckedInt.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Provides checked integers, detecting integer overflow and divide-by-0. */\n\n#ifndef mozilla_CheckedInt_h\n#define mozilla_CheckedInt_h\n\n// Enable relying of Mozilla's MFBT for possibly-available C++11 features\n#define MOZ_CHECKEDINT_USE_MFBT\n\n#include <stdint.h>\n\n#ifdef MOZ_CHECKEDINT_USE_MFBT\n#  include \"mozilla/Assertions.h\"\n#else\n#  include <cassert>\n#  define MOZ_ASSERT(cond, reason) assert((cond) && reason)\n#  define MOZ_DELETE\n#endif\n\n#include <climits>\n#include <cstddef>\n\nnamespace mozilla {\n\ntemplate<typename T> class CheckedInt;\n\nnamespace detail {\n\n/*\n * Step 1: manually record supported types\n *\n * What's nontrivial here is that there are different families of integer\n * types: basic integer types and stdint types. It is merrily undefined which\n * types from one family may be just typedefs for a type from another family.\n *\n * For example, on GCC 4.6, aside from the basic integer types, the only other\n * type that isn't just a typedef for some of them, is int8_t.\n */\n\nstruct UnsupportedType {};\n\ntemplate<typename IntegerType>\nstruct IsSupportedPass2\n{\n    static const bool value = false;\n};\n\ntemplate<typename IntegerType>\nstruct IsSupported\n{\n    static const bool value = IsSupportedPass2<IntegerType>::value;\n};\n\ntemplate<>\nstruct IsSupported<int8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int64_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint64_t>\n{ static const bool value = true; };\n\n\ntemplate<>\nstruct IsSupportedPass2<char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<signed char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long long>\n{ static const bool value = true; };\n\n/*\n * Step 2: some integer-traits kind of stuff.\n */\n\ntemplate<size_t Size, bool Signedness>\nstruct StdintTypeForSizeAndSignedness\n{};\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, true>\n{ typedef int8_t   Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, false>\n{ typedef uint8_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, true>\n{ typedef int16_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, false>\n{ typedef uint16_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, true>\n{ typedef int32_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, false>\n{ typedef uint32_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, true>\n{ typedef int64_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, false>\n{ typedef uint64_t Type; };\n\ntemplate<typename IntegerType>\nstruct UnsignedType\n{\n    typedef typename StdintTypeForSizeAndSignedness<sizeof(IntegerType),\n                                                    false>::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct IsSigned\n{\n    static const bool value = IntegerType(-1) <= IntegerType(0);\n};\n\ntemplate<typename IntegerType, size_t Size = sizeof(IntegerType)>\nstruct TwiceBiggerType\n{\n    typedef typename StdintTypeForSizeAndSignedness<\n                       sizeof(IntegerType) * 2,\n                       IsSigned<IntegerType>::value\n                     >::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct TwiceBiggerType<IntegerType, 8>\n{\n    typedef UnsupportedType Type;\n};\n\ntemplate<typename IntegerType>\nstruct PositionOfSignBit\n{\n    static const size_t value = CHAR_BIT * sizeof(IntegerType) - 1;\n};\n\ntemplate<typename IntegerType>\nstruct MinValue\n{\n  private:\n    typedef typename UnsignedType<IntegerType>::Type UnsignedIntegerType;\n    static const size_t PosOfSignBit = PositionOfSignBit<IntegerType>::value;\n\n  public:\n    // Bitwise ops may return a larger type, that's why we cast explicitly.\n    // In C++, left bit shifts on signed values is undefined by the standard\n    // unless the shifted value is representable.\n    // Notice that signed-to-unsigned conversions are always well-defined in\n    // the standard as the value congruent to 2**n, as expected. By contrast,\n    // unsigned-to-signed is only well-defined if the value is representable.\n    static const IntegerType value =\n        IsSigned<IntegerType>::value\n        ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit)\n        : IntegerType(0);\n};\n\ntemplate<typename IntegerType>\nstruct MaxValue\n{\n    // Tricksy, but covered by the unit test.\n    // Relies heavily on the type of MinValue<IntegerType>::value\n    // being IntegerType.\n    static const IntegerType value = ~MinValue<IntegerType>::value;\n};\n\n/*\n * Step 3: Implement the actual validity checks.\n *\n * Ideas taken from IntegerLib, code different.\n */\n\ntemplate<typename T>\ninline bool\nHasSignBit(T x)\n{\n  // In C++, right bit shifts on negative values is undefined by the standard.\n  // Notice that signed-to-unsigned conversions are always well-defined in the\n  // standard, as the value congruent modulo 2**n as expected. By contrast,\n  // unsigned-to-signed is only well-defined if the value is representable.\n  return bool(typename UnsignedType<T>::Type(x)\n                >> PositionOfSignBit<T>::value);\n}\n\n// Bitwise ops may return a larger type, so it's good to use this inline\n// helper guaranteeing that the result is really of type T.\ntemplate<typename T>\ninline T\nBinaryComplement(T x)\n{\n  return ~x;\n}\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value>\nstruct DoesRangeContainRange\n{\n};\n\ntemplate<typename T, typename U, bool Signedness>\nstruct DoesRangeContainRange<T, U, Signedness, Signedness>\n{\n    static const bool value = sizeof(T) >= sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, true, false>\n{\n    static const bool value = sizeof(T) > sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, false, true>\n{\n    static const bool value = false;\n};\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value,\n         bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>\nstruct IsInRangeImpl {};\n\ntemplate<typename T, typename U, bool IsTSigned, bool IsUSigned>\nstruct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>\n{\n    static bool run(U)\n    {\n       return true;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, true, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value && x >= MinValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, false, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, false, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) > sizeof(U) || x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, true, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) >= sizeof(U)\n             ? x >= 0\n             : x >= 0 && x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\ninline bool\nIsInRange(U x)\n{\n  return IsInRangeImpl<T, U>::run(x);\n}\n\ntemplate<typename T>\ninline bool\nIsAddValid(T x, T y)\n{\n  // Addition is valid if the sign of x+y is equal to either that of x or that\n  // of y. Since the value of x+y is undefined if we have a signed type, we\n  // compute it using the unsigned type of the same size.\n  // Beware! These bitwise operations can return a larger integer type,\n  // if T was a small type like int8_t, so we explicitly cast to T.\n\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux + uy;\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y))))\n         : BinaryComplement(x) >= y;\n}\n\ntemplate<typename T>\ninline bool\nIsSubValid(T x, T y)\n{\n  // Subtraction is valid if either x and y have same sign, or x-y and x have\n  // same sign. Since the value of x-y is undefined if we have a signed type,\n  // we compute it using the unsigned type of the same size.\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux - uy;\n\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y))))\n         : x >= y;\n}\n\ntemplate<typename T,\n         bool IsTSigned = IsSigned<T>::value,\n         bool TwiceBiggerTypeIsSupported =\n           IsSupported<typename TwiceBiggerType<T>::Type>::value>\nstruct IsMulValidImpl {};\n\ntemplate<typename T, bool IsTSigned>\nstruct IsMulValidImpl<T, IsTSigned, true>\n{\n    static bool run(T x, T y)\n    {\n      typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;\n      TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y);\n      return IsInRange<T>(product);\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, true, false>\n{\n    static bool run(T x, T y)\n    {\n      const T max = MaxValue<T>::value;\n      const T min = MinValue<T>::value;\n\n      if (x == 0 || y == 0)\n        return true;\n\n      if (x > 0) {\n        return y > 0\n               ? x <= max / y\n               : y >= min / x;\n      }\n\n      // If we reach this point, we know that x < 0.\n      return y > 0\n             ? x >= min / y\n             : y >= max / x;\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, false, false>\n{\n    static bool run(T x, T y)\n    {\n      return y == 0 ||  x <= MaxValue<T>::value / y;\n    }\n};\n\ntemplate<typename T>\ninline bool\nIsMulValid(T x, T y)\n{\n  return IsMulValidImpl<T>::run(x, y);\n}\n\ntemplate<typename T>\ninline bool\nIsDivValid(T x, T y)\n{\n  // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max.\n  return y != 0 &&\n         !(IsSigned<T>::value && x == MinValue<T>::value && y == T(-1));\n}\n\ntemplate<typename T, bool IsTSigned = IsSigned<T>::value>\nstruct IsModValidImpl;\n\ntemplate<typename T>\ninline bool\nIsModValid(T x, T y)\n{\n  return IsModValidImpl<T>::run(x, y);\n}\n\n/*\n * Mod is pretty simple.\n * For now, let's just use the ANSI C definition:\n * If x or y are negative, the results are implementation defined.\n *   Consider these invalid.\n * Undefined for y=0.\n * The result will never exceed either x or y.\n *\n * Checking that x>=0 is a warning when T is unsigned.\n */\n\ntemplate<typename T>\nstruct IsModValidImpl<T, false> {\n  static inline bool run(T x, T y) {\n    return y >= 1;\n  }\n};\n\ntemplate<typename T>\nstruct IsModValidImpl<T, true> {\n  static inline bool run(T x, T y) {\n    if (x < 0)\n      return false;\n\n    return y >= 1;\n  }\n};\n\ntemplate<typename T, bool IsSigned = IsSigned<T>::value>\nstruct NegateImpl;\n\ntemplate<typename T>\nstruct NegateImpl<T, false>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Handle negation separately for signed/unsigned, for simpler code and to\n      // avoid an MSVC warning negating an unsigned value.\n      return CheckedInt<T>(0, val.isValid() && val.mValue == 0);\n    }\n};\n\ntemplate<typename T>\nstruct NegateImpl<T, true>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Watch out for the min-value, which (with twos-complement) can't be\n      // negated as -min-value is then (max-value + 1).\n      if (!val.isValid() || val.mValue == MinValue<T>::value)\n        return CheckedInt<T>(val.mValue, false);\n      return CheckedInt<T>(-val.mValue, true);\n    }\n};\n\n} // namespace detail\n\n\n/*\n * Step 4: Now define the CheckedInt class.\n */\n\n/**\n * @class CheckedInt\n * @brief Integer wrapper class checking for integer overflow and other errors\n * @param T the integer type to wrap. Can be any type among the following:\n *            - any basic integer type such as |int|\n *            - any stdint type such as |int8_t|\n *\n * This class implements guarded integer arithmetic. Do a computation, check\n * that isValid() returns true, you then have a guarantee that no problem, such\n * as integer overflow, happened during this computation, and you can call\n * value() to get the plain integer value.\n *\n * The arithmetic operators in this class are guaranteed not to raise a signal\n * (e.g. in case of a division by zero).\n *\n * For example, suppose that you want to implement a function that computes\n * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by\n * zero or integer overflow). You could code it as follows:\n   @code\n   bool computeXPlusYOverZ(int x, int y, int z, int *result)\n   {\n       CheckedInt<int> checkedResult = (CheckedInt<int>(x) + y) / z;\n       if (checkedResult.isValid()) {\n           *result = checkedResult.value();\n           return true;\n       } else {\n           return false;\n       }\n   }\n   @endcode\n *\n * Implicit conversion from plain integers to checked integers is allowed. The\n * plain integer is checked to be in range before being casted to the\n * destination type. This means that the following lines all compile, and the\n * resulting CheckedInts are correctly detected as valid or invalid:\n * @code\n   // 1 is of type int, is found to be in range for uint8_t, x is valid\n   CheckedInt<uint8_t> x(1);\n   // -1 is of type int, is found not to be in range for uint8_t, x is invalid\n   CheckedInt<uint8_t> x(-1);\n   // -1 is of type int, is found to be in range for int8_t, x is valid\n   CheckedInt<int8_t> x(-1);\n   // 1000 is of type int16_t, is found not to be in range for int8_t,\n   // x is invalid\n   CheckedInt<int8_t> x(int16_t(1000));\n   // 3123456789 is of type uint32_t, is found not to be in range for int32_t,\n   // x is invalid\n   CheckedInt<int32_t> x(uint32_t(3123456789));\n * @endcode\n * Implicit conversion from\n * checked integers to plain integers is not allowed. As shown in the\n * above example, to get the value of a checked integer as a normal integer,\n * call value().\n *\n * Arithmetic operations between checked and plain integers is allowed; the\n * result type is the type of the checked integer.\n *\n * Checked integers of different types cannot be used in the same arithmetic\n * expression.\n *\n * There are convenience typedefs for all stdint types, of the following form\n * (these are just 2 examples):\n   @code\n   typedef CheckedInt<int32_t> CheckedInt32;\n   typedef CheckedInt<uint16_t> CheckedUint16;\n   @endcode\n */\ntemplate<typename T>\nclass CheckedInt\n{\n  protected:\n    T mValue;\n    bool mIsValid;\n\n    template<typename U>\n    CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid)\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    friend struct detail::NegateImpl<T>;\n\n  public:\n    /**\n     * Constructs a checked integer with given @a value. The checked integer is\n     * initialized as valid or invalid depending on whether the @a value\n     * is in range.\n     *\n     * This constructor is not explicit. Instead, the type of its argument is a\n     * separate template parameter, ensuring that no conversion is performed\n     * before this constructor is actually called. As explained in the above\n     * documentation for class CheckedInt, this constructor checks that its\n     * argument is valid.\n     */\n    template<typename U>\n    CheckedInt(U value)\n      : mValue(T(value)),\n        mIsValid(detail::IsInRange<T>(value))\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    template<typename U>\n    friend class CheckedInt;\n\n    template<typename U>\n    CheckedInt<U> toChecked() const\n    {\n      CheckedInt<U> ret(mValue);\n      ret.mIsValid = ret.mIsValid && mIsValid;\n      return ret;\n    }\n\n    /** Constructs a valid checked integer with initial value 0 */\n    CheckedInt() : mValue(0), mIsValid(true)\n    {\n      static_assert(detail::IsSupported<T>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    /** @returns the actual value */\n    T value() const\n    {\n      MOZ_ASSERT(mIsValid, \"Invalid checked integer (division by zero or integer overflow)\");\n      return mValue;\n    }\n\n    /**\n     * @returns true if the checked integer is valid, i.e. is not the result\n     * of an invalid operation or of an operation involving an invalid checked\n     * integer\n     */\n    bool isValid() const\n    {\n      return mIsValid;\n    }\n\n    template<typename U>\n    friend CheckedInt<U> operator +(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator +=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator -(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator -=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator *(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator *=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator /(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator /=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator %(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator %=(U rhs);\n\n    CheckedInt operator -() const\n    {\n      return detail::NegateImpl<T>::negate(*this);\n    }\n\n    /**\n     * @returns true if the left and right hand sides are valid\n     * and have the same value.\n     *\n     * Note that these semantics are the reason why we don't offer\n     * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)\n     * but that would mean that whenever a or b is invalid, a!=b\n     * is always true, which would be very confusing.\n     *\n     * For similar reasons, operators <, >, <=, >= would be very tricky to\n     * specify, so we just avoid offering them.\n     *\n     * Notice that these == semantics are made more reasonable by these facts:\n     *  1. a==b implies equality at the raw data level\n     *     (the converse is false, as a==b is never true among invalids)\n     *  2. This is similar to the behavior of IEEE floats, where a==b\n     *     means that a and b have the same value *and* neither is NaN.\n     */\n    bool operator ==(const CheckedInt& other) const\n    {\n      return mIsValid && other.mIsValid && mValue == other.mValue;\n    }\n\n    /** prefix ++ */\n    CheckedInt& operator++()\n    {\n      *this += 1;\n      return *this;\n    }\n\n    /** postfix ++ */\n    CheckedInt operator++(int)\n    {\n      CheckedInt tmp = *this;\n      *this += 1;\n      return tmp;\n    }\n\n    /** prefix -- */\n    CheckedInt& operator--()\n    {\n      *this -= 1;\n      return *this;\n    }\n\n    /** postfix -- */\n    CheckedInt operator--(int)\n    {\n      CheckedInt tmp = *this;\n      *this -= 1;\n      return tmp;\n    }\n\n  private:\n    /**\n     * The !=, <, <=, >, >= operators are disabled:\n     * see the comment on operator==.\n     */\n    template<typename U>\n    bool operator !=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >=(U other) const MOZ_DELETE;\n};\n\n#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                \\\ntemplate<typename T>                                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs,            \\\n                                 const CheckedInt<T> &rhs)            \\\n{                                                                     \\\n  if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue))               \\\n    return CheckedInt<T>(0, false);                                   \\\n                                                                      \\\n  return CheckedInt<T>(lhs.mValue OP rhs.mValue,                      \\\n                       lhs.mIsValid && rhs.mIsValid);                 \\\n}\n\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)\n\n#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR\n\n// Implement castToCheckedInt<T>(x), making sure that\n//  - it allows x to be either a CheckedInt<T> or any integer type\n//    that can be casted to T\n//  - if x is already a CheckedInt<T>, we just return a reference to it,\n//    instead of copying it (optimization)\n\nnamespace detail {\n\ntemplate<typename T, typename U>\nstruct CastToCheckedIntImpl\n{\n    typedef CheckedInt<T> ReturnType;\n    static CheckedInt<T> run(U u) { return u; }\n};\n\ntemplate<typename T>\nstruct CastToCheckedIntImpl<T, CheckedInt<T> >\n{\n    typedef const CheckedInt<T>& ReturnType;\n    static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }\n};\n\n} // namespace detail\n\ntemplate<typename T, typename U>\ninline typename detail::CastToCheckedIntImpl<T, U>::ReturnType\ncastToCheckedInt(U u)\n{\n  static_assert(detail::IsSupported<T>::value &&\n                detail::IsSupported<U>::value,\n                \"This type is not supported by CheckedInt\");\n  return detail::CastToCheckedIntImpl<T, U>::run(u);\n}\n\n#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)  \\\ntemplate<typename T>                                              \\\ntemplate<typename U>                                              \\\nCheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U rhs)         \\\n{                                                                 \\\n  *this = *this OP castToCheckedInt<T>(rhs);                      \\\n  return *this;                                                   \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs, U rhs) \\\n{                                                                 \\\n  return lhs OP castToCheckedInt<T>(rhs);                         \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(U lhs, const CheckedInt<T> &rhs) \\\n{                                                                 \\\n  return castToCheckedInt<T>(lhs) OP rhs;                         \\\n}\n\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)\n\n#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(const CheckedInt<T> &lhs, U rhs)\n{\n  return lhs == castToCheckedInt<T>(rhs);\n}\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(U  lhs, const CheckedInt<T> &rhs)\n{\n  return castToCheckedInt<T>(lhs) == rhs;\n}\n\n// Convenience typedefs.\ntypedef CheckedInt<int8_t>   CheckedInt8;\ntypedef CheckedInt<uint8_t>  CheckedUint8;\ntypedef CheckedInt<int16_t>  CheckedInt16;\ntypedef CheckedInt<uint16_t> CheckedUint16;\ntypedef CheckedInt<int32_t>  CheckedInt32;\ntypedef CheckedInt<uint32_t> CheckedUint32;\ntypedef CheckedInt<int64_t>  CheckedInt64;\ntypedef CheckedInt<uint64_t> CheckedUint64;\n\n} // namespace mozilla\n\n#endif /* mozilla_CheckedInt_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Compiler.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various compiler checks. */\n\n#ifndef mozilla_Compiler_h\n#define mozilla_Compiler_h\n\n#if !defined(__clang__) && defined(__GNUC__)\n\n#define MOZ_IS_GCC 1\n   /*\n    * This macro should simplify gcc version checking. For example, to check\n    * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`.\n    */\n#  define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel)          \\\n     ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \\\n      >= ((major) * 10000 + (minor) * 100 + (patchlevel)))\n#if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0)\n#  error \"mfbt (and Gecko) require at least gcc 4.4 to build.\"\n#endif\n\n#else\n\n#define MOZ_IS_GCC 0\n\n#endif\n\n#endif /* mozilla_Compiler_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Constants.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt math constants. */\n\n#ifndef mozilla_Constants_h\n#define mozilla_Constants_h\n\n#ifndef M_PI\n#  define M_PI 3.14159265358979323846\n#endif\n\n#endif /* mozilla_Constants_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/DebugOnly.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides DebugOnly, a type for variables used only in debug builds (i.e. by\n * assertions).\n */\n\n#ifndef mozilla_DebugOnly_h\n#define mozilla_DebugOnly_h\n\nnamespace mozilla {\n\n/**\n * DebugOnly contains a value of type T, but only in debug builds.  In release\n * builds, it does not contain a value.  This helper is intended to be used with\n * MOZ_ASSERT()-style macros, allowing one to write:\n *\n *   DebugOnly<bool> check = func();\n *   MOZ_ASSERT(check);\n *\n * more concisely than declaring |check| conditional on #ifdef DEBUG, but also\n * without allocating storage space for |check| in release builds.\n *\n * DebugOnly instances can only be coerced to T in debug builds.  In release\n * builds they don't have a value, so type coercion is not well defined.\n */\ntemplate<typename T>\nclass DebugOnly\n{\n  public:\n#ifdef DEBUG\n    T value;\n\n    DebugOnly() { }\n    DebugOnly(const T& other) : value(other) { }\n    DebugOnly(const DebugOnly& other) : value(other.value) { }\n    DebugOnly& operator=(const T& rhs) {\n      value = rhs;\n      return *this;\n    }\n    void operator++(int) {\n      value++;\n    }\n    void operator--(int) {\n      value--;\n    }\n\n    T* operator&() { return &value; }\n\n    operator T&() { return value; }\n    operator const T&() const { return value; }\n\n    T& operator->() { return value; }\n\n#else\n    DebugOnly() { }\n    DebugOnly(const T&) { }\n    DebugOnly(const DebugOnly&) { }\n    DebugOnly& operator=(const T&) { return *this; }\n    void operator++(int) { }\n    void operator--(int) { }\n#endif\n\n    /*\n     * DebugOnly must always have a destructor or else it will\n     * generate \"unused variable\" warnings, exactly what it's intended\n     * to avoid!\n     */\n    ~DebugOnly() {}\n};\n\n}\n\n#endif /* mozilla_DebugOnly_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Decimal.h",
    "content": "/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * Imported from:\n * http://src.chromium.org/viewvc/blink/trunk/Source/core/platform/Decimal.h\n * Check hg log for the svn rev of the last update from Blink core.\n */\n\n#ifndef Decimal_h\n#define Decimal_h\n\n#include \"mozilla/Assertions.h\"\n#include <stdint.h>\n#include \"mozilla/Types.h\"\n\n#include <string>\n\n#ifndef ASSERT\n#define DEFINED_ASSERT_FOR_DECIMAL_H 1\n#define ASSERT MOZ_ASSERT\n#endif\n\n// To use WTF_MAKE_FAST_ALLOCATED we'd need:\n// http://src.chromium.org/viewvc/blink/trunk/Source/wtf/FastMalloc.h\n// Since we don't allocate Decimal objects, no need.\n#define WTF_MAKE_FAST_ALLOCATED \\\n  void ignore_this_dummy_method() MOZ_DELETE\n\nnamespace WebCore {\n\nnamespace DecimalPrivate {\nclass SpecialValueHandler;\n}\n\n// This class represents decimal base floating point number.\n//\n// FIXME: Once all C++ compiler support decimal type, we should replace this\n// class to compiler supported one. See below URI for current status of decimal\n// type for C++: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1977.html\nclass Decimal {\n    WTF_MAKE_FAST_ALLOCATED;\npublic:\n    enum Sign {\n        Positive,\n        Negative,\n    };\n\n    // You should not use EncodedData other than unit testing.\n    class EncodedData {\n        // For accessing FormatClass.\n        friend class Decimal;\n        friend class DecimalPrivate::SpecialValueHandler;\n    public:\n        EncodedData(Sign, int exponent, uint64_t coefficient);\n\n        bool operator==(const EncodedData&) const;\n        bool operator!=(const EncodedData& another) const { return !operator==(another); }\n\n        uint64_t coefficient() const { return m_coefficient; }\n        int countDigits() const;\n        int exponent() const { return m_exponent; }\n        bool isFinite() const { return !isSpecial(); }\n        bool isInfinity() const { return m_formatClass == ClassInfinity; }\n        bool isNaN() const { return m_formatClass == ClassNaN; }\n        bool isSpecial() const { return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; }\n        bool isZero() const { return m_formatClass == ClassZero; }\n        Sign sign() const { return m_sign; }\n        void setSign(Sign sign) { m_sign = sign; }\n\n    private:\n        enum FormatClass {\n            ClassInfinity,\n            ClassNormal,\n            ClassNaN,\n            ClassZero,\n        };\n\n        EncodedData(Sign, FormatClass);\n        FormatClass formatClass() const { return m_formatClass; }\n\n        uint64_t m_coefficient;\n        int16_t m_exponent;\n        FormatClass m_formatClass;\n        Sign m_sign;\n    };\n\n    MFBT_API Decimal(int32_t = 0);\n    MFBT_API Decimal(Sign, int exponent, uint64_t coefficient);\n    MFBT_API Decimal(const Decimal&);\n\n    MFBT_API Decimal& operator=(const Decimal&);\n    MFBT_API Decimal& operator+=(const Decimal&);\n    MFBT_API Decimal& operator-=(const Decimal&);\n    MFBT_API Decimal& operator*=(const Decimal&);\n    MFBT_API Decimal& operator/=(const Decimal&);\n\n    MFBT_API Decimal operator-() const;\n\n    MFBT_API bool operator==(const Decimal&) const;\n    MFBT_API bool operator!=(const Decimal&) const;\n    MFBT_API bool operator<(const Decimal&) const;\n    MFBT_API bool operator<=(const Decimal&) const;\n    MFBT_API bool operator>(const Decimal&) const;\n    MFBT_API bool operator>=(const Decimal&) const;\n\n    MFBT_API Decimal operator+(const Decimal&) const;\n    MFBT_API Decimal operator-(const Decimal&) const;\n    MFBT_API Decimal operator*(const Decimal&) const;\n    MFBT_API Decimal operator/(const Decimal&) const;\n\n    int exponent() const\n    {\n        ASSERT(isFinite());\n        return m_data.exponent();\n    }\n\n    bool isFinite() const { return m_data.isFinite(); }\n    bool isInfinity() const { return m_data.isInfinity(); }\n    bool isNaN() const { return m_data.isNaN(); }\n    bool isNegative() const { return sign() == Negative; }\n    bool isPositive() const { return sign() == Positive; }\n    bool isSpecial() const { return m_data.isSpecial(); }\n    bool isZero() const { return m_data.isZero(); }\n\n    MFBT_API Decimal abs() const;\n    MFBT_API Decimal ceiling() const;\n    MFBT_API Decimal floor() const;\n    MFBT_API Decimal remainder(const Decimal&) const;\n    MFBT_API Decimal round() const;\n\n    MFBT_API double toDouble() const;\n    // Note: toString method supports infinity and nan but fromString not.\n    MFBT_API std::string toString() const;\n    MFBT_API bool toString(char* strBuf, size_t bufLength) const;\n\n    static MFBT_API Decimal fromDouble(double);\n    // fromString supports following syntax EBNF:\n    //  number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?\n    //          | sign? '.' digit+ (exponent-marker sign? digit+)?\n    //  sign ::= '+' | '-'\n    //  exponent-marker ::= 'e' | 'E'\n    //  digit ::= '0' | '1' | ... | '9'\n    // Note: fromString doesn't support \"infinity\" and \"nan\".\n    static MFBT_API Decimal fromString(const std::string& aValue);\n    static MFBT_API Decimal infinity(Sign);\n    static MFBT_API Decimal nan();\n    static MFBT_API Decimal zero(Sign);\n\n    // You should not use below methods. We expose them for unit testing.\n    MFBT_API explicit Decimal(const EncodedData&);\n    const EncodedData& value() const { return m_data; }\n\nprivate:\n    struct AlignedOperands {\n        uint64_t lhsCoefficient;\n        uint64_t rhsCoefficient;\n        int exponent;\n    };\n\n    MFBT_API Decimal(double);\n    MFBT_API Decimal compareTo(const Decimal&) const;\n\n    static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);\n    static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; }\n\n    Sign sign() const { return m_data.sign(); }\n\n    EncodedData m_data;\n};\n\n} // namespace WebCore\n\nnamespace mozilla {\n  typedef WebCore::Decimal Decimal;\n}\n\n#undef WTF_MAKE_FAST_ALLOCATED\n\n#ifdef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef ASSERT\n#endif\n\n#endif // Decimal_h\n\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Endian.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Functions for reading and writing integers in various endiannesses. */\n\n/*\n * The classes LittleEndian and BigEndian expose static methods for\n * reading and writing 16-, 32-, and 64-bit signed and unsigned integers\n * in their respective endianness.  The naming scheme is:\n *\n * {Little,Big}Endian::{read,write}{Uint,Int}<bitsize>\n *\n * For instance, LittleEndian::readInt32 will read a 32-bit signed\n * integer from memory in little endian format.  Similarly,\n * BigEndian::writeUint16 will write a 16-bit unsigned integer to memory\n * in big-endian format.\n *\n * The class NativeEndian exposes methods for conversion of existing\n * data to and from the native endianness.  These methods are intended\n * for cases where data needs to be transferred, serialized, etc.\n * swap{To,From}{Little,Big}Endian byteswap a single value if necessary.\n * Bulk conversion functions are also provided which optimize the\n * no-conversion-needed case:\n *\n * - copyAndSwap{To,From}{Little,Big}Endian;\n * - swap{To,From}{Little,Big}EndianInPlace.\n *\n * The *From* variants are intended to be used for reading data and the\n * *To* variants for writing data.\n *\n * Methods on NativeEndian work with integer data of any type.\n * Floating-point data is not supported.\n *\n * For clarity in networking code, \"Network\" may be used as a synonym\n * for \"Big\" in any of the above methods or class names.\n *\n * As an example, reading a file format header whose fields are stored\n * in big-endian format might look like:\n *\n * class ExampleHeader\n * {\n *   private:\n *     uint32_t magic;\n *     uint32_t length;\n *     uint32_t totalRecords;\n *     uint64_t checksum;\n *\n *   public:\n *     ExampleHeader(const void* data) {\n *       const uint8_t* ptr = static_cast<const uint8_t*>(data);\n *       magic = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       length = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       totalRecords = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       checksum = BigEndian::readUint64(ptr);\n *     }\n *     ...\n * };\n */\n\n#ifndef mozilla_Endian_h\n#define mozilla_Endian_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n#include <string.h>\n\n#if defined(_MSC_VER) && _MSC_VER >= 1300\n#  include <stdlib.h>\n#  pragma intrinsic(_byteswap_ushort)\n#  pragma intrinsic(_byteswap_ulong)\n#  pragma intrinsic(_byteswap_uint64)\n#endif\n\n#if defined(_WIN64)\n#  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(_WIN32)\n#  if defined(_M_IX86)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(__APPLE__)\n#  if __LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  endif\n#elif defined(__GNUC__) && \\\n      defined(__BYTE_ORDER__) && \\\n      defined(__ORDER_LITTLE_ENDIAN__) && \\\n      defined(__ORDER_BIG_ENDIAN__)\n   /*\n    * Some versions of GCC provide architecture-independent macros for\n    * this.  Yes, there are more than two values for __BYTE_ORDER__.\n    */\n#  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  else\n#    error \"Can't handle mixed-endian architectures\"\n#  endif\n/*\n * We can't include useful headers like <endian.h> or <sys/isa_defs.h>\n * here because they're not present on all platforms.  Instead we have\n * this big conditional that ideally will catch all the interesting\n * cases.\n */\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(__ARMEB__) || \\\n      defined(__s390__) || \\\n      (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \\\n      (defined(__ia64) && defined(__BIG_ENDIAN__))\n#  define MOZ_BIG_ENDIAN 1\n#elif defined(__i386) || defined(__i386__) || \\\n      defined(__x86_64) || defined(__x86_64__) || \\\n      defined(_MIPSEL) || defined(__ARMEL__) || \\\n      defined(__alpha__) || \\\n      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \\\n      (defined(__ia64) && !defined(__BIG_ENDIAN__))\n#  define MOZ_LITTLE_ENDIAN 1\n#endif\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_LITTLE_ENDIAN 0\n#elif MOZ_LITTLE_ENDIAN\n#  define MOZ_BIG_ENDIAN 0\n#else\n#  error \"Cannot determine endianness\"\n#endif\n\n#if defined(__clang__)\n#  if __has_builtin(__builtin_bswap16)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(__GNUC__)\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(_MSC_VER)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n/*\n * We need wrappers here because free functions with default template\n * arguments and/or partial specialization of function templates are not\n * supported by all the compilers we use.\n */\ntemplate<typename T, size_t Size = sizeof(T)>\nstruct Swapper;\n\ntemplate<typename T>\nstruct Swapper<T, 2>\n{\n  static T swap(T value)\n  {\n#if defined(MOZ_HAVE_BUILTIN_BYTESWAP16)\n    return MOZ_HAVE_BUILTIN_BYTESWAP16(value);\n#else\n    return T(((value & 0x00ff) << 8) | ((value & 0xff00) >> 8));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 4>\n{\n  static T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap32(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_ulong(value));\n#else\n    return T(((value & 0x000000ffU) << 24) |\n             ((value & 0x0000ff00U) << 8) |\n             ((value & 0x00ff0000U) >> 8) |\n             ((value & 0xff000000U) >> 24));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 8>\n{\n  static inline T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap64(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_uint64(value));\n#else\n    return T(((value & 0x00000000000000ffULL) << 56) |\n             ((value & 0x000000000000ff00ULL) << 40) |\n             ((value & 0x0000000000ff0000ULL) << 24) |\n             ((value & 0x00000000ff000000ULL) << 8) |\n             ((value & 0x000000ff00000000ULL) >> 8) |\n             ((value & 0x0000ff0000000000ULL) >> 24) |\n             ((value & 0x00ff000000000000ULL) >> 40) |\n             ((value & 0xff00000000000000ULL) >> 56));\n#endif\n  }\n};\n\nenum Endianness { Little, Big };\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_NATIVE_ENDIANNESS detail::Big\n#else\n#  define MOZ_NATIVE_ENDIANNESS detail::Little\n#endif\n\nclass EndianUtils\n{\n    /**\n     * Assert that the memory regions [dest, dest+count) and [src, src+count]\n     * do not overlap.  count is given in bytes.\n     */\n    static void assertNoOverlap(const void* dest, const void* src, size_t count)\n    {\n      DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(dest);\n      DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(src);\n      MOZ_ASSERT((byteDestPtr < byteSrcPtr &&\n                  byteDestPtr + count <= byteSrcPtr) ||\n                 (byteSrcPtr < byteDestPtr &&\n                  byteSrcPtr + count <= byteDestPtr));\n    }\n\n    template<typename T>\n    static void assertAligned(T* ptr)\n    {\n      MOZ_ASSERT((uintptr_t(ptr) % sizeof(T)) == 0, \"Unaligned pointer!\");\n    }\n\n  protected:\n    /**\n     * Return |value| converted from SourceEndian encoding to DestEndian\n     * encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline T maybeSwap(T value)\n    {\n      if (SourceEndian == DestEndian)\n        return value;\n\n      return Swapper<T>::swap(value);\n    }\n\n    /**\n     * Convert |count| elements at |ptr| from SourceEndian encoding to\n     * DestEndian encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline void maybeSwapInPlace(T* ptr, size_t count)\n    {\n      assertAligned(ptr);\n\n      if (SourceEndian == DestEndian)\n        return;\n\n      for (size_t i = 0; i < count; i++)\n        ptr[i] = Swapper<T>::swap(ptr[i]);\n    }\n\n    /**\n     * Write |count| elements to the unaligned address |dest| in DestEndian\n     * format, using elements found at |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapTo(void* dest, const T* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(src);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      uint8_t* byteDestPtr = static_cast<uint8_t*>(dest);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        u.val = maybeSwap<SourceEndian, DestEndian>(src[i]);\n        memcpy(byteDestPtr, u.buffer, sizeof(T));\n        byteDestPtr += sizeof(T);\n      }\n    }\n\n    /**\n     * Write |count| elements to |dest| in DestEndian format, using elements\n     * found at the unaligned address |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapFrom(T* dest, const void* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(dest);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      const uint8_t* byteSrcPtr = static_cast<const uint8_t*>(src);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        memcpy(u.buffer, byteSrcPtr, sizeof(T));\n        dest[i] = maybeSwap<SourceEndian, DestEndian>(u.val);\n        byteSrcPtr += sizeof(T);\n      }\n    }\n};\n\ntemplate<Endianness ThisEndian>\nclass Endian : private EndianUtils\n{\n  protected:\n    /** Read a uint16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* p) {\n      return read<uint16_t>(p);\n    }\n\n    /** Read a uint32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read a uint64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* p) {\n      return read<uint64_t>(p);\n    }\n\n    /** Read an int16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* p) {\n      return read<int16_t>(p);\n    }\n\n    /** Read an int32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read an int64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* p) {\n      return read<int64_t>(p);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint16(void* p, uint16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint32(void* p, uint32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint64(void* p, uint64_t val) {\n      write(p, val);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt16(void* p, int16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt32(void* p, int32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt64(void* p, int64_t val) {\n      write(p, val);\n    }\n\n    /*\n     * Converts a value of type T to little-endian format.\n     *\n     * This function is intended for cases where you have data in your\n     * native-endian format and you need it to appear in little-endian\n     * format for transmission.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T value) {\n      return maybeSwap<ThisEndian, Little>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToLittleEndian(void* dest, const T* src,\n                                          size_t count) {\n      copyAndSwapTo<ThisEndian, Little>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Little>(p, count);\n    }\n\n    /*\n     * Converts a value of type T to big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T value) {\n      return maybeSwap<ThisEndian, Big>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToBigEndian(void* dest, const T* src, size_t count) {\n      copyAndSwapTo<ThisEndian, Big>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Big>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T value) {\n      return swapToBigEndian(value);\n    }\n    template<typename T>\n    static void\n    copyAndSwapToNetworkOrder(void* dest, const T* src, size_t count) {\n      copyAndSwapToBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void\n    swapToNetworkOrderInPlace(T* p, size_t count) {\n      swapToBigEndianInPlace(p, count);\n    }\n\n    /*\n     * Converts a value of type T from little-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T value) {\n      return maybeSwap<Little, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromLittleEndian(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFrom<Little, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Little, ThisEndian>(p, count);\n    }\n\n    /*\n     * Converts a value of type T from big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T value) {\n      return maybeSwap<Big, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromBigEndian(T* dest, const void* src,\n                                         size_t count) {\n      copyAndSwapFrom<Big, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Big, ThisEndian>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T value) {\n      return swapFromBigEndian(value);\n    }\n    template<typename T>\n    static void copyAndSwapFromNetworkOrder(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFromBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void swapFromNetworkOrderInPlace(T* p, size_t count) {\n      swapFromBigEndianInPlace(p, count);\n    }\n\n  private:\n    /**\n     * Read a value of type T, encoded in endianness ThisEndian from |p|.\n     * Return that value encoded in native endianness.\n     */\n    template<typename T>\n    static T read(const void* p) {\n      union {\n        T val;\n        uint8_t buffer[sizeof(T)];\n      } u;\n      memcpy(u.buffer, p, sizeof(T));\n      return maybeSwap<ThisEndian, MOZ_NATIVE_ENDIANNESS>(u.val);\n    }\n\n    /**\n     * Write a value of type T, in native endianness, to |p|, in ThisEndian\n     * endianness.\n     */\n    template<typename T>\n    static void write(void* p, T value) {\n      T tmp = maybeSwap<MOZ_NATIVE_ENDIANNESS, ThisEndian>(value);\n      memcpy(p, &tmp, sizeof(T));\n    }\n\n    Endian() MOZ_DELETE;\n    Endian(const Endian& other) MOZ_DELETE;\n    void operator=(const Endian& other) MOZ_DELETE;\n};\n\ntemplate<Endianness ThisEndian>\nclass EndianReadWrite : public Endian<ThisEndian>\n{\n  private:\n    typedef Endian<ThisEndian> super;\n\n  public:\n    using super::readUint16;\n    using super::readUint32;\n    using super::readUint64;\n    using super::readInt16;\n    using super::readInt32;\n    using super::readInt64;\n    using super::writeUint16;\n    using super::writeUint32;\n    using super::writeUint64;\n    using super::writeInt16;\n    using super::writeInt32;\n    using super::writeInt64;\n};\n\n} /* namespace detail */\n\nclass LittleEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Little>\n{};\n\nclass BigEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Big>\n{};\n\ntypedef BigEndian NetworkEndian;\n\nclass NativeEndian MOZ_FINAL : public detail::Endian<MOZ_NATIVE_ENDIANNESS>\n{\n  private:\n    typedef detail::Endian<MOZ_NATIVE_ENDIANNESS> super;\n\n  public:\n    /*\n     * These functions are intended for cases where you have data in your\n     * native-endian format and you need the data to appear in the appropriate\n     * endianness for transmission, serialization, etc.\n     */\n    using super::swapToLittleEndian;\n    using super::copyAndSwapToLittleEndian;\n    using super::swapToLittleEndianInPlace;\n    using super::swapToBigEndian;\n    using super::copyAndSwapToBigEndian;\n    using super::swapToBigEndianInPlace;\n    using super::swapToNetworkOrder;\n    using super::copyAndSwapToNetworkOrder;\n    using super::swapToNetworkOrderInPlace;\n\n    /*\n     * These functions are intended for cases where you have data in the\n     * given endianness (e.g. reading from disk or a file-format) and you\n     * need the data to appear in native-endian format for processing.\n     */\n    using super::swapFromLittleEndian;\n    using super::copyAndSwapFromLittleEndian;\n    using super::swapFromLittleEndianInPlace;\n    using super::swapFromBigEndian;\n    using super::copyAndSwapFromBigEndian;\n    using super::swapFromBigEndianInPlace;\n    using super::swapFromNetworkOrder;\n    using super::copyAndSwapFromNetworkOrder;\n    using super::swapFromNetworkOrderInPlace;\n};\n\n#undef MOZ_NATIVE_ENDIANNESS\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Endian_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/EnumSet.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A set abstraction for enumeration values. */\n\n#ifndef mozilla_EnumSet_h\n#define mozilla_EnumSet_h\n\n#include \"mozilla/Assertions.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * EnumSet<T> is a set of values defined by an enumeration. It is implemented\n * using a 32 bit mask for each value so it will only work for enums with an int\n * representation less than 32. It works both for enum and enum class types.\n */\ntemplate<typename T>\nclass EnumSet\n{\n  public:\n    EnumSet()\n      : mBitField(0)\n    { }\n\n    EnumSet(T aEnum)\n      : mBitField(aEnum)\n    { }\n\n    EnumSet(T aEnum1, T aEnum2)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2) |\n                  bitFor(aEnum3))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3, T aEnum4)\n     : mBitField(bitFor(aEnum1) |\n                 bitFor(aEnum2) |\n                 bitFor(aEnum3) |\n                 bitFor(aEnum4))\n    { }\n\n    EnumSet(const EnumSet& aEnumSet)\n     : mBitField(aEnumSet.mBitField)\n    { }\n\n    /**\n     * Add an element\n     */\n    void operator+=(T aEnum) {\n      mBitField |= bitFor(aEnum);\n    }\n\n    /**\n     * Add an element\n     */\n    EnumSet<T> operator+(T aEnum) const {\n      EnumSet<T> result(*this);\n      result += aEnum;\n      return result;\n    }\n\n    /**\n     * Union\n     */\n    void operator+=(const EnumSet<T> aEnumSet) {\n      mBitField |= aEnumSet.mBitField;\n    }\n\n    /**\n     * Union\n     */\n    EnumSet<T> operator+(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result += aEnumSet;\n      return result;\n    }\n\n    /**\n     * Remove an element\n     */\n    void operator-=(T aEnum) {\n      mBitField &= ~(bitFor(aEnum));\n    }\n\n    /**\n     * Remove an element\n     */\n    EnumSet<T> operator-(T aEnum) const {\n      EnumSet<T> result(*this);\n      result -= aEnum;\n      return result;\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    void operator-=(const EnumSet<T> aEnumSet) {\n      mBitField &= ~(aEnumSet.mBitField);\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    EnumSet<T> operator-(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result -= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Intersection\n     */\n    void operator&=(const EnumSet<T> aEnumSet) {\n      mBitField &= aEnumSet.mBitField;\n    }\n\n    /**\n     * Intersection\n     */\n    EnumSet<T> operator&(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result &= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Equality\n     */\n\n    bool operator==(const EnumSet<T> aEnumSet) const {\n      return mBitField == aEnumSet.mBitField;\n    }\n\n    /**\n     * Test is an element is contained in the set\n     */\n    bool contains(T aEnum) const {\n      return mBitField & bitFor(aEnum);\n    }\n\n    /**\n     * Return the number of elements in the set\n     */\n\n    uint8_t size() {\n      uint8_t count = 0;\n      for (uint32_t bitField = mBitField; bitField; bitField >>= 1) {\n        if (bitField & 1)\n          count++;\n      }\n      return count;\n    }\n\n  private:\n    static uint32_t bitFor(T aEnum) {\n      uint32_t bitNumber(aEnum);\n      MOZ_ASSERT(bitNumber < 32);\n      return 1U << bitNumber;\n    }\n\n    uint32_t mBitField;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_EnumSet_h_*/\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/FloatingPoint.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various predicates and operations on IEEE-754 floating point types. */\n\n#ifndef mozilla_FloatingPoint_h\n#define mozilla_FloatingPoint_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/*\n * It's reasonable to ask why we have this header at all.  Don't isnan,\n * copysign, the built-in comparison operators, and the like solve these\n * problems?  Unfortunately, they don't.  We've found that various compilers\n * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile\n * the standard methods in various situations, so we can't use them.  Some of\n * these compilers even have problems compiling seemingly reasonable bitwise\n * algorithms!  But with some care we've found algorithms that seem to not\n * trigger those compiler bugs.\n *\n * For the aforementioned reasons, be very wary of making changes to any of\n * these algorithms.  If you must make changes, keep a careful eye out for\n * compiler bustage, particularly PGO-specific bustage.\n */\n\n/*\n * These implementations all assume |double| is a 64-bit double format number\n * type, compatible with the IEEE-754 standard.  C/C++ don't require this to be\n * the case.  But we required this in implementations of these algorithms that\n * preceded this header, so we shouldn't break anything if we continue doing so.\n */\nstatic_assert(sizeof(double) == sizeof(uint64_t), \"double must be 64 bits\");\n\nconst unsigned DoubleExponentBias = 1023;\nconst unsigned DoubleExponentShift = 52;\n\nconst uint64_t DoubleSignBit         = 0x8000000000000000ULL;\nconst uint64_t DoubleExponentBits    = 0x7ff0000000000000ULL;\nconst uint64_t DoubleSignificandBits = 0x000fffffffffffffULL;\n\nstatic_assert((DoubleSignBit & DoubleExponentBits) == 0,\n              \"sign bit doesn't overlap exponent bits\");\nstatic_assert((DoubleSignBit & DoubleSignificandBits) == 0,\n              \"sign bit doesn't overlap significand bits\");\nstatic_assert((DoubleExponentBits & DoubleSignificandBits) == 0,\n              \"exponent bits don't overlap significand bits\");\n\nstatic_assert((DoubleSignBit | DoubleExponentBits | DoubleSignificandBits) ==\n              ~uint64_t(0),\n              \"all bits accounted for\");\n\n/** Determines whether a double is NaN. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNaN(double d)\n{\n  /*\n   * A double is NaN if all exponent bits are 1 and the significand contains at\n   * least one non-zero bit.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) == DoubleExponentBits &&\n         (bits & DoubleSignificandBits) != 0;\n}\n\n/** Determines whether a double is +Infinity or -Infinity. */\nstatic MOZ_ALWAYS_INLINE bool\nIsInfinite(double d)\n{\n  /* Infinities have all exponent bits set to 1 and an all-0 significand. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & ~DoubleSignBit) == DoubleExponentBits;\n}\n\n/** Determines whether a double is not NaN or infinite. */\nstatic MOZ_ALWAYS_INLINE bool\nIsFinite(double d)\n{\n  /*\n   * NaN and Infinities are the only non-finite doubles, and both have all\n   * exponent bits set to 1.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) != DoubleExponentBits;\n}\n\n/**\n * Determines whether a double is negative.  It is an error to call this method\n * on a double which is NaN.\n */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegative(double d)\n{\n  MOZ_ASSERT(!IsNaN(d), \"NaN does not have a sign\");\n\n  /* The sign bit is set if the double is negative. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleSignBit) != 0;\n}\n\n/** Determines whether a double represents -0. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegativeZero(double d)\n{\n  /* Only the sign bit is set if the double is -0. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return bits == DoubleSignBit;\n}\n\n/** Returns the exponent portion of the double. */\nstatic MOZ_ALWAYS_INLINE int_fast16_t\nExponentComponent(double d)\n{\n  /*\n   * The exponent component of a double is an unsigned number, biased from its\n   * actual value.  Subtract the bias to retrieve the actual exponent.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return int_fast16_t((bits & DoubleExponentBits) >> DoubleExponentShift) -\n         int_fast16_t(DoubleExponentBias);\n}\n\n/** Returns +Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nPositiveInfinity()\n{\n  /*\n   * Positive infinity has all exponent bits set, sign bit set to 0, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleExponentBits);\n}\n\n/** Returns -Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nNegativeInfinity()\n{\n  /*\n   * Negative infinity has all exponent bits set, sign bit set to 1, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleSignBit | DoubleExponentBits);\n}\n\n/** Constructs a NaN value with the specified sign bit and significand bits. */\nstatic MOZ_ALWAYS_INLINE double\nSpecificNaN(int signbit, uint64_t significand)\n{\n  MOZ_ASSERT(signbit == 0 || signbit == 1);\n  MOZ_ASSERT((significand & ~DoubleSignificandBits) == 0);\n  MOZ_ASSERT(significand & DoubleSignificandBits);\n\n  double d = BitwiseCast<double>((signbit ? DoubleSignBit : 0) |\n                                 DoubleExponentBits |\n                                 significand);\n  MOZ_ASSERT(IsNaN(d));\n  return d;\n}\n\n/** Computes the smallest non-zero positive double value. */\nstatic MOZ_ALWAYS_INLINE double\nMinDoubleValue()\n{\n  return BitwiseCast<double>(uint64_t(1));\n}\n\nstatic MOZ_ALWAYS_INLINE bool\nDoubleIsInt32(double d, int32_t* i)\n{\n  /*\n   * XXX Casting a double that doesn't truncate to int32_t, to int32_t, induces\n   *     undefined behavior.  We should definitely fix this (bug 744965), but as\n   *     apparently it \"works\" in practice, it's not a pressing concern now.\n   */\n  return !IsNegativeZero(d) && d == (*i = int32_t(d));\n}\n\n/**\n * Computes a NaN value.  Do not use this method if you depend upon a particular\n * NaN value being returned.\n */\nstatic MOZ_ALWAYS_INLINE double\nUnspecifiedNaN()\n{\n  return SpecificNaN(0, 0xfffffffffffffULL);\n}\n\n/**\n * Compare two doubles for equality, *without* equating -0 to +0, and equating\n * any NaN value to any other NaN value.  (The normal equality operators equate\n * -0 with +0, and they equate NaN to no other value.)\n */\nstatic inline bool\nDoublesAreIdentical(double d1, double d2)\n{\n  if (IsNaN(d1))\n    return IsNaN(d2);\n  return BitwiseCast<uint64_t>(d1) == BitwiseCast<uint64_t>(d2);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_FloatingPoint_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/GuardObjects.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementation of macros to ensure correct use of RAII Auto* objects. */\n\n#ifndef mozilla_GuardObjects_h\n#define mozilla_GuardObjects_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\n#ifdef DEBUG\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The following classes are designed to cause assertions to detect\n * inadvertent use of guard objects as temporaries. In other words,\n * when we have a guard object whose only purpose is its constructor and\n * destructor (and is never otherwise referenced), the intended use\n * might be:\n *\n *   AutoRestore savePainting(mIsPainting);\n *\n * but is is easy to accidentally write:\n *\n *   AutoRestore(mIsPainting);\n *\n * which compiles just fine, but runs the destructor well before the\n * intended time.\n *\n * They work by adding (#ifdef DEBUG) an additional parameter to the\n * guard object's constructor, with a default value, so that users of\n * the guard object's API do not need to do anything. The default value\n * of this parameter is a temporary object. C++ (ISO/IEC 14882:1998),\n * section 12.2 [class.temporary], clauses 4 and 5 seem to assume a\n * guarantee that temporaries are destroyed in the reverse of their\n * construction order, but I actually can't find a statement that that\n * is true in the general case (beyond the two specific cases mentioned\n * there). However, it seems to be true.\n *\n * These classes are intended to be used only via the macros immediately\n * below them:\n *\n *   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member\n *     variable, and should be put where a declaration of a private\n *     member variable would be placed.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the\n *     parameters to each constructor of the guard object; it declares\n *     (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM\n *     variant for constructors that take no other parameters.)\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in\n *     the implementation of such constructors when they are not inline.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in\n *     the implementation of such constructors to pass the parameter to\n *     a base class that also uses these macros\n *   MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each\n *     constructor. It uses the parameter declared by\n *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.\n *\n * For more details, and examples of using these macros, see\n * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla\n */\nclass MOZ_EXPORT GuardObjectNotifier\n{\n  private:\n    bool* statementDone;\n\n  public:\n    GuardObjectNotifier() : statementDone(nullptr) { }\n\n    ~GuardObjectNotifier() {\n      *statementDone = true;\n    }\n\n    void setStatementDone(bool* statementIsDone) {\n      statementDone = statementIsDone;\n    }\n};\n\nclass MOZ_EXPORT GuardObjectNotificationReceiver\n{\n  private:\n    bool statementDone;\n\n  public:\n    GuardObjectNotificationReceiver() : statementDone(false) { }\n\n    ~GuardObjectNotificationReceiver() {\n      /*\n       * Assert that the guard object was not used as a temporary.  (Note that\n       * this assert might also fire if init is not called because the guard\n       * object's implementation is not using the above macros correctly.)\n       */\n      MOZ_ASSERT(statementDone);\n    }\n\n    void init(const GuardObjectNotifier& constNotifier) {\n      /*\n       * constNotifier is passed as a const reference so that we can pass a\n       * temporary, but we really intend it as non-const.\n       */\n      GuardObjectNotifier& notifier = const_cast<GuardObjectNotifier&>(constNotifier);\n      notifier.setStatementDone(&statementDone);\n    }\n};\n\n} /* namespace detail */\n} /* namespace mozilla */\n\n#endif /* DEBUG */\n\n#ifdef DEBUG\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \\\n     mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary;\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \\\n     const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \\\n     const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \\\n     , _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \\\n       _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT \\\n     do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0)\n#else\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_GuardObjects_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/HashFunctions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Utilities for hashing. */\n\n/*\n * This file exports functions for hashing data down to a 32-bit value,\n * including:\n *\n *  - HashString    Hash a char* or uint16_t/wchar_t* of known or unknown\n *                  length.\n *\n *  - HashBytes     Hash a byte array of known length.\n *\n *  - HashGeneric   Hash one or more values.  Currently, we support uint32_t,\n *                  types which can be implicitly cast to uint32_t, data\n *                  pointers, and function pointers.\n *\n *  - AddToHash     Add one or more values to the given hash.  This supports the\n *                  same list of types as HashGeneric.\n *\n *\n * You can chain these functions together to hash complex objects.  For example:\n *\n *  class ComplexObject\n *  {\n *      char* str;\n *      uint32_t uint1, uint2;\n *      void (*callbackFn)();\n *\n *    public:\n *      uint32_t hash() {\n *        uint32_t hash = HashString(str);\n *        hash = AddToHash(hash, uint1, uint2);\n *        return AddToHash(hash, callbackFn);\n *      }\n *  };\n *\n * If you want to hash an nsAString or nsACString, use the HashString functions\n * in nsHashKeys.h.\n */\n\n#ifndef mozilla_HashFunctions_h\n#define mozilla_HashFunctions_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\n#ifdef __cplusplus\nnamespace mozilla {\n\n/**\n * The golden ratio as a 32-bit fixed-point value.\n */\nstatic const uint32_t GoldenRatioU32 = 0x9E3779B9U;\n\ninline uint32_t\nRotateBitsLeft32(uint32_t value, uint8_t bits)\n{\n  MOZ_ASSERT(bits < 32);\n  return (value << bits) | (value >> (32 - bits));\n}\n\nnamespace detail {\n\ninline uint32_t\nAddU32ToHash(uint32_t hash, uint32_t value)\n{\n  /*\n   * This is the meat of all our hash routines.  This hash function is not\n   * particularly sophisticated, but it seems to work well for our mostly\n   * plain-text inputs.  Implementation notes follow.\n   *\n   * Our use of the golden ratio here is arbitrary; we could pick almost any\n   * number which:\n   *\n   *  * is odd (because otherwise, all our hash values will be even)\n   *\n   *  * has a reasonably-even mix of 1's and 0's (consider the extreme case\n   *    where we multiply by 0x3 or 0xeffffff -- this will not produce good\n   *    mixing across all bits of the hash).\n   *\n   * The rotation length of 5 is also arbitrary, although an odd number is again\n   * preferable so our hash explores the whole universe of possible rotations.\n   *\n   * Finally, we multiply by the golden ratio *after* xor'ing, not before.\n   * Otherwise, if |hash| is 0 (as it often is for the beginning of a message),\n   * the expression\n   *\n   *   (GoldenRatioU32 * RotateBitsLeft(hash, 5)) |xor| value\n   *\n   * evaluates to |value|.\n   *\n   * (Number-theoretic aside: Because any odd number |m| is relatively prime to\n   * our modulus (2^32), the list\n   *\n   *    [x * m (mod 2^32) for 0 <= x < 2^32]\n   *\n   * has no duplicate elements.  This means that multiplying by |m| does not\n   * cause us to skip any possible hash values.\n   *\n   * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the\n   * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely\n   * multiply our hash value by |m| a few times without negating the\n   * multiplicative effect.  Our golden ratio constant has order 2^29, which is\n   * more than enough for our purposes.)\n   */\n  return GoldenRatioU32 * (RotateBitsLeft32(hash, 5) ^ value);\n}\n\n/**\n * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter.\n */\ntemplate<size_t PtrSize>\ninline uint32_t\nAddUintptrToHash(uint32_t hash, uintptr_t value);\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<4>(uint32_t hash, uintptr_t value)\n{\n  return AddU32ToHash(hash, static_cast<uint32_t>(value));\n}\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<8>(uint32_t hash, uintptr_t value)\n{\n  /*\n   * The static cast to uint64_t below is necessary because this function\n   * sometimes gets compiled on 32-bit platforms (yes, even though it's a\n   * template and we never call this particular override in a 32-bit build).  If\n   * we do value >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t\n   * right 32 bits, and the compiler throws an error.\n   */\n  uint32_t v1 = static_cast<uint32_t>(value);\n  uint32_t v2 = static_cast<uint32_t>(static_cast<uint64_t>(value) >> 32);\n  return AddU32ToHash(AddU32ToHash(hash, v1), v2);\n}\n\n} /* namespace detail */\n\n/**\n * AddToHash takes a hash and some values and returns a new hash based on the\n * inputs.\n *\n * Currently, we support hashing uint32_t's, values which we can implicitly\n * convert to uint32_t, data pointers, and function pointers.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A a)\n{\n  /*\n   * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,\n   * we'll error out.\n   */\n  return detail::AddU32ToHash(hash, a);\n}\n\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A* a)\n{\n  /*\n   * You might think this function should just take a void*.  But then we'd only\n   * catch data pointers and couldn't handle function pointers.\n   */\n\n  static_assert(sizeof(a) == sizeof(uintptr_t),\n                \"Strange pointer!\");\n\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, uintptr_t(a));\n}\n\ntemplate<>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, uintptr_t a)\n{\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b)\n{\n  return AddToHash(AddToHash(hash, a), b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c)\n{\n  return AddToHash(AddToHash(hash, a, b), c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d)\n{\n  return AddToHash(AddToHash(hash, a, b, c), d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d, E e)\n{\n  return AddToHash(AddToHash(hash, a, b, c, d), e);\n}\n\n/**\n * The HashGeneric class of functions let you hash one or more values.\n *\n * If you want to hash together two values x and y, calling HashGeneric(x, y) is\n * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes\n * that x has already been hashed.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a)\n{\n  return AddToHash(0, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b)\n{\n  return AddToHash(0, a, b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c)\n{\n  return AddToHash(0, a, b, c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d)\n{\n  return AddToHash(0, a, b, c, d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d, E e)\n{\n  return AddToHash(0, a, b, c, d, e);\n}\n\nnamespace detail {\n\ntemplate<typename T>\nuint32_t\nHashUntilZero(const T* str)\n{\n  uint32_t hash = 0;\n  for (T c; (c = *str); str++)\n    hash = AddToHash(hash, c);\n  return hash;\n}\n\ntemplate<typename T>\nuint32_t\nHashKnownLength(const T* str, size_t length)\n{\n  uint32_t hash = 0;\n  for (size_t i = 0; i < length; i++)\n    hash = AddToHash(hash, str[i]);\n  return hash;\n}\n\n} /* namespace detail */\n\n/**\n * The HashString overloads below do just what you'd expect.\n *\n * If you have the string's length, you might as well call the overload which\n * includes the length.  It may be marginally faster.\n */\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\n/*\n * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's\n * the same width!\n */\n#ifdef WIN32\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n#endif\n\n/**\n * Hash some number of bytes.\n *\n * This hash walks word-by-word, rather than byte-by-byte, so you won't get the\n * same result out of HashBytes as you would out of HashString.\n */\nMOZ_WARN_UNUSED_RESULT\nextern MFBT_API uint32_t\nHashBytes(const void* bytes, size_t length);\n\n} /* namespace mozilla */\n#endif /* __cplusplus */\n\n#endif /* mozilla_HashFunctions_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Likely.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a\n * boolean predicate should be branch-predicted.\n */\n\n#ifndef mozilla_Likely_h\n#define mozilla_Likely_h\n\n#if defined(__clang__) || defined(__GNUC__)\n#  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))\n#  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))\n#else\n#  define MOZ_LIKELY(x)   (!!(x))\n#  define MOZ_UNLIKELY(x) (!!(x))\n#endif\n\n#endif /* mozilla_Likely_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/LinkedList.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type-safe doubly-linked list class. */\n\n/*\n * The classes LinkedList<T> and LinkedListElement<T> together form a\n * convenient, type-safe doubly-linked list implementation.\n *\n * The class T which will be inserted into the linked list must inherit from\n * LinkedListElement<T>.  A given object may be in only one linked list at a\n * time.\n *\n * A LinkedListElement automatically removes itself from the list upon\n * destruction, and a LinkedList will fatally assert in debug builds if it's\n * non-empty when it's destructed.\n *\n * For example, you might use LinkedList in a simple observer list class as\n * follows.\n *\n *   class Observer : public LinkedListElement<Observer>\n *   {\n *     public:\n *       void observe(char* topic) { ... }\n *   };\n *\n *   class ObserverContainer\n *   {\n *     private:\n *       LinkedList<Observer> list;\n *\n *     public:\n *       void addObserver(Observer* observer) {\n *         // Will assert if |observer| is part of another list.\n *         list.insertBack(observer);\n *       }\n *\n *       void removeObserver(Observer* observer) {\n *         // Will assert if |observer| is not part of some list.\n *         observer.remove();\n *         // Or, will assert if |observer| is not part of |list| specifically.\n *         // observer.removeFrom(list);\n *       }\n *\n *       void notifyObservers(char* topic) {\n *         for (Observer* o = list.getFirst(); o != nullptr; o = o->getNext())\n *           o->observe(topic);\n *       }\n *   };\n *\n */\n\n#ifndef mozilla_LinkedList_h\n#define mozilla_LinkedList_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\ntemplate<typename T>\nclass LinkedList;\n\ntemplate<typename T>\nclass LinkedListElement\n{\n    /*\n     * It's convenient that we return nullptr when getNext() or getPrevious()\n     * hits the end of the list, but doing so costs an extra word of storage in\n     * each linked list node (to keep track of whether |this| is the sentinel\n     * node) and a branch on this value in getNext/getPrevious.\n     *\n     * We could get rid of the extra word of storage by shoving the \"is\n     * sentinel\" bit into one of the pointers, although this would, of course,\n     * have performance implications of its own.\n     *\n     * But the goal here isn't to win an award for the fastest or slimmest\n     * linked list; rather, we want a *convenient* linked list.  So we won't\n     * waste time guessing which micro-optimization strategy is best.\n     *\n     *\n     * Speaking of unnecessary work, it's worth addressing here why we wrote\n     * mozilla::LinkedList in the first place, instead of using stl::list.\n     *\n     * The key difference between mozilla::LinkedList and stl::list is that\n     * mozilla::LinkedList stores the prev/next pointers in the object itself,\n     * while stl::list stores the prev/next pointers in a list element which\n     * itself points to the object being stored.\n     *\n     * mozilla::LinkedList's approach makes it harder to store an object in more\n     * than one list.  But the upside is that you can call next() / prev() /\n     * remove() directly on the object.  With stl::list, you'd need to store a\n     * pointer to its iterator in the object in order to accomplish this.  Not\n     * only would this waste space, but you'd have to remember to update that\n     * pointer every time you added or removed the object from a list.\n     *\n     * In-place, constant-time removal is a killer feature of doubly-linked\n     * lists, and supporting this painlessly was a key design criterion.\n     */\n\n  private:\n    LinkedListElement* next;\n    LinkedListElement* prev;\n    const bool isSentinel;\n\n  public:\n    LinkedListElement()\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(false)\n    { }\n\n    ~LinkedListElement() {\n      if (!isSentinel && isInList())\n        remove();\n    }\n\n    /*\n     * Get the next element in the list, or nullptr if this is the last element\n     * in the list.\n     */\n    T* getNext() {\n      return next->asT();\n    }\n    const T* getNext() const {\n      return next->asT();\n    }\n\n    /*\n     * Get the previous element in the list, or nullptr if this is the first\n     * element in the list.\n     */\n    T* getPrevious() {\n      return prev->asT();\n    }\n    const T* getPrevious() const {\n      return prev->asT();\n    }\n\n    /*\n     * Insert elem after this element in the list.  |this| must be part of a\n     * linked list when you call setNext(); otherwise, this method will assert.\n     */\n    void setNext(T* elem) {\n        MOZ_ASSERT(isInList());\n        setNextUnsafe(elem);\n    }\n\n    /*\n     * Insert elem before this element in the list.  |this| must be part of a\n     * linked list when you call setPrevious(); otherwise, this method will\n     * assert.\n     */\n    void setPrevious(T* elem) {\n      MOZ_ASSERT(isInList());\n      setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Remove this element from the list which contains it.  If this element is\n     * not currently part of a linked list, this method asserts.\n     */\n    void remove() {\n      MOZ_ASSERT(isInList());\n\n      prev->next = next;\n      next->prev = prev;\n      next = this;\n      prev = this;\n    }\n\n    /*\n     * Identical to remove(), but also asserts in debug builds that this element\n     * is in list.\n     */\n    void removeFrom(const LinkedList<T>& list) {\n      list.assertContains(asT());\n      remove();\n    }\n\n    /*\n     * Return true if |this| part is of a linked list, and false otherwise.\n     */\n    bool isInList() const {\n      MOZ_ASSERT((next == this) == (prev == this));\n      return next != this;\n    }\n\n  private:\n    friend class LinkedList<T>;\n\n    enum NodeKind {\n      NODE_KIND_NORMAL,\n      NODE_KIND_SENTINEL\n    };\n\n    LinkedListElement(NodeKind nodeKind)\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(nodeKind == NODE_KIND_SENTINEL)\n    { }\n\n    /*\n     * Return |this| cast to T* if we're a normal node, or return nullptr if\n     * we're a sentinel node.\n     */\n    T* asT() {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<T*>(this);\n    }\n    const T* asT() const {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<const T*>(this);\n    }\n\n    /*\n     * Insert elem after this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertFront().\n     */\n    void setNextUnsafe(T* elem) {\n      LinkedListElement *listElem = static_cast<LinkedListElement*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this->next;\n      listElem->prev = this;\n      this->next->prev = listElem;\n      this->next = listElem;\n    }\n\n    /*\n     * Insert elem before this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertBack().\n     */\n    void setPreviousUnsafe(T* elem) {\n      LinkedListElement<T>* listElem = static_cast<LinkedListElement<T>*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this;\n      listElem->prev = this->prev;\n      this->prev->next = listElem;\n      this->prev = listElem;\n    }\n\n  private:\n    LinkedListElement& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedListElement(const LinkedList<T>& other) MOZ_DELETE;\n};\n\ntemplate<typename T>\nclass LinkedList\n{\n  private:\n    LinkedListElement<T> sentinel;\n\n  public:\n    LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }\n\n    ~LinkedList() {\n      MOZ_ASSERT(isEmpty());\n    }\n\n    /*\n     * Add elem to the front of the list.\n     */\n    void insertFront(T* elem) {\n      /* Bypass setNext()'s this->isInList() assertion. */\n      sentinel.setNextUnsafe(elem);\n    }\n\n    /*\n     * Add elem to the back of the list.\n     */\n    void insertBack(T* elem) {\n      sentinel.setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Get the first element of the list, or nullptr if the list is empty.\n     */\n    T* getFirst() {\n      return sentinel.getNext();\n    }\n    const T* getFirst() const {\n      return sentinel.getNext();\n    }\n\n    /*\n     * Get the last element of the list, or nullptr if the list is empty.\n     */\n    T* getLast() {\n      return sentinel.getPrevious();\n    }\n    const T* getLast() const {\n      return sentinel.getPrevious();\n    }\n\n    /*\n     * Get and remove the first element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popFirst() {\n      T* ret = sentinel.getNext();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Get and remove the last element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popLast() {\n      T* ret = sentinel.getPrevious();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Return true if the list is empty, or false otherwise.\n     */\n    bool isEmpty() const {\n      return !sentinel.isInList();\n    }\n\n    /*\n     * Remove all the elements from the list.\n     *\n     * This runs in time linear to the list's length, because we have to mark\n     * each element as not in the list.\n     */\n    void clear() {\n      while (popFirst())\n        continue;\n    }\n\n    /*\n     * In a debug build, make sure that the list is sane (no cycles, consistent\n     * next/prev pointers, only one sentinel).  Has no effect in release builds.\n     */\n    void debugAssertIsSane() const {\n#ifdef DEBUG\n      const LinkedListElement<T>* slow;\n      const LinkedListElement<T>* fast1;\n      const LinkedListElement<T>* fast2;\n\n      /*\n       * Check for cycles in the forward singly-linked list using the\n       * tortoise/hare algorithm.\n       */\n      for (slow = sentinel.next,\n           fast1 = sentinel.next->next,\n           fast2 = sentinel.next->next->next;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->next, fast1 = fast2->next, fast2 = fast1->next)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /* Check for cycles in the backward singly-linked list. */\n      for (slow = sentinel.prev,\n           fast1 = sentinel.prev->prev,\n           fast2 = sentinel.prev->prev->prev;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /*\n       * Check that |sentinel| is the only node in the list with\n       * isSentinel == true.\n       */\n      for (const LinkedListElement<T>* elem = sentinel.next;\n           elem != sentinel;\n           elem = elem->next)\n      {\n        MOZ_ASSERT(!elem->isSentinel);\n      }\n\n      /* Check that the next/prev pointers match up. */\n      const LinkedListElement<T>* prev = sentinel;\n      const LinkedListElement<T>* cur = sentinel.next;\n      do {\n          MOZ_ASSERT(cur->prev == prev);\n          MOZ_ASSERT(prev->next == cur);\n\n          prev = cur;\n          cur = cur->next;\n      } while (cur != sentinel);\n#endif /* ifdef DEBUG */\n    }\n\n  private:\n    friend class LinkedListElement<T>;\n\n    void assertContains(const T* t) const {\n#ifdef DEBUG\n      for (const T* elem = getFirst();\n           elem;\n           elem = elem->getNext())\n      {\n        if (elem == t)\n          return;\n      }\n      MOZ_CRASH(\"element wasn't found in this list!\");\n#endif\n    }\n\n    LinkedList& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedList(const LinkedList<T>& other) MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_LinkedList_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/MathAlgorithms.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt maths algorithms. */\n\n#ifndef mozilla_MathAlgorithms_h\n#define mozilla_MathAlgorithms_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <cmath>\n#include <limits.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n// Greatest Common Divisor\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidGCD(IntegerType a, IntegerType b)\n{\n  // Euclid's algorithm; O(N) in the worst case.  (There are better\n  // ways, but we don't need them for the current use of this algo.)\n  MOZ_ASSERT(a > 0);\n  MOZ_ASSERT(b > 0);\n\n  while (a != b) {\n    if (a > b) {\n      a = a - b;\n    } else {\n      b = b - a;\n    }\n  }\n\n  return a;\n}\n\n// Least Common Multiple\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidLCM(IntegerType a, IntegerType b)\n{\n  // Divide first to reduce overflow risk.\n  return (a / EuclidGCD(a, b)) * b;\n}\n\nnamespace detail {\n\ntemplate<typename T>\nstruct AllowDeprecatedAbsFixed : FalseType {};\n\ntemplate<> struct AllowDeprecatedAbsFixed<int32_t> : TrueType {};\ntemplate<> struct AllowDeprecatedAbsFixed<int64_t> : TrueType {};\n\ntemplate<typename T>\nstruct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};\n\ntemplate<> struct AllowDeprecatedAbs<int> : TrueType {};\ntemplate<> struct AllowDeprecatedAbs<long> : TrueType {};\n\n} // namespace detail\n\n// DO NOT USE DeprecatedAbs.  It exists only until its callers can be converted\n// to Abs below, and it will be removed when all callers have been changed.\ntemplate<typename T>\ninline typename mozilla::EnableIf<detail::AllowDeprecatedAbs<T>::value, T>::Type\nDeprecatedAbs(const T t)\n{\n  // The absolute value of the smallest possible value of a signed-integer type\n  // won't fit in that type (on twos-complement systems -- and we're blithely\n  // assuming we're on such systems, for the non-<stdint.h> types listed above),\n  // so assert that the input isn't that value.\n  //\n  // This is the case if: the value is non-negative; or if adding one (giving a\n  // value in the range [-maxvalue, 0]), then negating (giving a value in the\n  // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement,\n  // (minvalue + 1) == -maxvalue).\n  MOZ_ASSERT(t >= 0 ||\n             -(t + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1),\n             \"You can't negate the smallest possible negative integer!\");\n  return t >= 0 ? t : -t;\n}\n\nnamespace detail {\n\n// For now mozilla::Abs only takes intN_T, the signed natural types, and\n// float/double/long double.  Feel free to add overloads for other standard,\n// signed types if you need them.\n\ntemplate<typename T>\nstruct AbsReturnTypeFixed;\n\ntemplate<> struct AbsReturnTypeFixed<int8_t> { typedef uint8_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int16_t> { typedef uint16_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int32_t> { typedef uint32_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int64_t> { typedef uint64_t Type; };\n\ntemplate<typename T>\nstruct AbsReturnType : AbsReturnTypeFixed<T> {};\n\ntemplate<> struct AbsReturnType<char> : EnableIf<char(-1) < char(0), unsigned char> {};\ntemplate<> struct AbsReturnType<signed char> { typedef unsigned char Type; };\ntemplate<> struct AbsReturnType<short> { typedef unsigned short Type; };\ntemplate<> struct AbsReturnType<int> { typedef unsigned int Type; };\ntemplate<> struct AbsReturnType<long> { typedef unsigned long Type; };\ntemplate<> struct AbsReturnType<long long> { typedef unsigned long long Type; };\ntemplate<> struct AbsReturnType<float> { typedef float Type; };\ntemplate<> struct AbsReturnType<double> { typedef double Type; };\ntemplate<> struct AbsReturnType<long double> { typedef long double Type; };\n\n} // namespace detail\n\ntemplate<typename T>\ninline typename detail::AbsReturnType<T>::Type\nAbs(const T t)\n{\n  typedef typename detail::AbsReturnType<T>::Type ReturnType;\n  return t >= 0 ? ReturnType(t) : ~ReturnType(t) + 1;\n}\n\ntemplate<>\ninline float\nAbs<float>(const float f)\n{\n  return std::fabs(f);\n}\n\ntemplate<>\ninline double\nAbs<double>(const double d)\n{\n  return std::fabs(d);\n}\n\ntemplate<>\ninline long double\nAbs<long double>(const long double d)\n{\n  return std::fabs(d);\n}\n\n} // namespace mozilla\n\n#if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))\n#  define MOZ_BITSCAN_WINDOWS\n\n  extern \"C\" {\n    unsigned char _BitScanForward(unsigned long* Index, unsigned long mask);\n    unsigned char _BitScanReverse(unsigned long* Index, unsigned long mask);\n#  pragma intrinsic(_BitScanForward, _BitScanReverse)\n\n#  if defined(_M_AMD64) || defined(_M_X64)\n#    define MOZ_BITSCAN_WINDOWS64\n    unsigned char _BitScanForward64(unsigned long* index, unsigned __int64 mask);\n    unsigned char _BitScanReverse64(unsigned long* index, unsigned __int64 mask);\n#   pragma intrinsic(_BitScanForward64, _BitScanReverse64)\n#  endif\n  } // extern \"C\"\n\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n#if defined(MOZ_BITSCAN_WINDOWS)\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanReverse(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(31 - index);\n  }\n\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanForward(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(index);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanReverse64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(63 - index);\n#  else\n    uint32_t hi = uint32_t(u >> 32);\n    if (hi != 0)\n      return CountLeadingZeroes32(hi);\n    return 32 + CountLeadingZeroes32(uint32_t(u));\n#  endif\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanForward64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(index);\n#  else\n    uint32_t lo = uint32_t(u);\n    if (lo != 0)\n      return CountTrailingZeroes32(lo);\n    return 32 + CountTrailingZeroes32(uint32_t(u >> 32));\n#  endif\n  }\n\n#  ifdef MOZ_HAVE_BITSCAN64\n#    undef MOZ_HAVE_BITSCAN64\n#  endif\n\n#elif defined(__clang__) || defined(__GNUC__)\n\n#  if defined(__clang__)\n#    if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz)\n#      error \"A clang providing __builtin_c[lt]z is required to build\"\n#    endif\n#  else\n     // gcc has had __builtin_clz and friends since 3.4: no need to check.\n#  endif\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    return __builtin_clz(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    return __builtin_ctz(u);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n    return __builtin_clzll(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n    return __builtin_ctzll(u);\n  }\n\n#else\n#  error \"Implement these!\"\n  inline uint_fast8_t CountLeadingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountLeadingZeroes64(uint64_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes64(uint64_t u) MOZ_DELETE;\n#endif\n\n} // namespace detail\n\n/**\n * Compute the number of high-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the highest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountLeadingZeroes32(0xF0FF1000) is 0;\n * CountLeadingZeroes32(0x7F8F0001) is 1;\n * CountLeadingZeroes32(0x3FFF0100) is 2;\n * CountLeadingZeroes32(0x1FF50010) is 3; and so on.\n */\ninline uint_fast8_t\nCountLeadingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes32(u);\n}\n\n/**\n * Compute the number of low-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the lowest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountTrailingZeroes32(0x0100FFFF) is 0;\n * CountTrailingZeroes32(0x7000FFFE) is 1;\n * CountTrailingZeroes32(0x0080FFFC) is 2;\n * CountTrailingZeroes32(0x0080FFF8) is 3; and so on.\n */\ninline uint_fast8_t\nCountTrailingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes32(u);\n}\n\n/** Analogous to CountLeadingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountLeadingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes64(u);\n}\n\n/** Analogous to CountTrailingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountTrailingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes64(u);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass CeilingLog2;\n\ntemplate<typename T>\nclass CeilingLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 32 - CountLeadingZeroes32(t - 1);\n    }\n};\n\ntemplate<typename T>\nclass CeilingLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 64 - CountLeadingZeroes64(t - 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the least power of 2 greater than or equal to |t|.\n *\n * CeilingLog2(0..1) is 0;\n * CeilingLog2(2) is 1;\n * CeilingLog2(3..4) is 2;\n * CeilingLog2(5..8) is 3;\n * CeilingLog2(9..16) is 4; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nCeilingLog2(const T t)\n{\n  return detail::CeilingLog2<T>::compute(t);\n}\n\n/** A CeilingLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nCeilingLog2Size(size_t n)\n{\n  return CeilingLog2(n);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass FloorLog2;\n\ntemplate<typename T>\nclass FloorLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 31 - CountLeadingZeroes32(t | 1);\n    }\n};\n\ntemplate<typename T>\nclass FloorLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 63 - CountLeadingZeroes64(t | 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the greatest power of 2 less than or equal to |t|.\n *\n * FloorLog2(0..1) is 0;\n * FloorLog2(2..3) is 1;\n * FloorLog2(4..7) is 2;\n * FloorLog2(8..15) is 3; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nFloorLog2(const T t)\n{\n  return detail::FloorLog2<T>::compute(t);\n}\n\n/** A FloorLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nFloorLog2Size(size_t n)\n{\n  return FloorLog2(n);\n}\n\n/*\n * Compute the smallest power of 2 greater than or equal to |x|.  |x| must not\n * be so great that the computed value would overflow |size_t|.\n */\ninline size_t\nRoundUpPow2(size_t x)\n{\n  MOZ_ASSERT(x <= (size_t(1) << (sizeof(size_t) * CHAR_BIT - 1)),\n             \"can't round up -- will overflow!\");\n  return size_t(1) << CeilingLog2(x);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_MathAlgorithms_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/MemoryChecking.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides a common interface to the ASan (AddressSanitizer) and Valgrind \n * functions used to mark memory in certain ways. In detail, the following\n * three macros are provided:\n *\n *   MOZ_MAKE_MEM_NOACCESS  - Mark memory as unsafe to access (e.g. freed)\n *   MOZ_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined\n *   MOZ_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined\n *\n * With Valgrind in use, these directly map to the three respective Valgrind\n * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory,\n * while the UNDEFINED/DEFINED macros unpoison memory.\n *\n * With no memory checker available, all macros expand to the empty statement.\n */\n\n#ifndef mozilla_MemoryChecking_h\n#define mozilla_MemoryChecking_h\n\n#if defined(MOZ_VALGRIND)\n#include \"valgrind/memcheck.h\"\n#endif\n\n#if defined(MOZ_ASAN) || defined(MOZ_VALGRIND)\n#define MOZ_HAVE_MEM_CHECKS 1\n#endif\n\n#if defined(MOZ_ASAN)\n#include <stddef.h>\n\nextern \"C\" {\n  /* These definitions are usually provided through the \n   * sanitizer/asan_interface.h header installed by ASan.\n   */\n  void __asan_poison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n  void __asan_unpoison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  __asan_poison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n}\n#elif defined(MOZ_VALGRIND)\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  VALGRIND_MAKE_MEM_NOACCESS((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_UNDEFINED((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_DEFINED((addr), (size))\n#else\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_DEFINED(addr, size) do {} while(0)\n\n#endif\n\n#endif /* mozilla_MemoryChecking_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/MemoryReporting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Memory reporting infrastructure. */\n\n#ifndef mozilla_MemoryReporting_h\n#define mozilla_MemoryReporting_h\n\n#include <stddef.h>\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This is for functions that are like malloc_usable_size.  Such functions are\n * used for measuring the size of data structures.\n */\ntypedef size_t (*MallocSizeOf)(const void* p);\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\ntypedef size_t (*MozMallocSizeOf)(const void* p);\n\n#endif /* mozilla_MemoryReporting_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Move.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* C++11-style, but C++98-usable, \"move references\" implementation. */\n\n#ifndef mozilla_Move_h\n#define mozilla_Move_h\n\nnamespace mozilla {\n\n/*\n * \"Move\" References\n *\n * Some types can be copied much more efficiently if we know the original's\n * value need not be preserved --- that is, if we are doing a \"move\", not a\n * \"copy\". For example, if we have:\n *\n *   Vector<T> u;\n *   Vector<T> v(u);\n *\n * the constructor for v must apply a copy constructor to each element of u ---\n * taking time linear in the length of u. However, if we know we will not need u\n * any more once v has been initialized, then we could initialize v very\n * efficiently simply by stealing u's dynamically allocated buffer and giving it\n * to v --- a constant-time operation, regardless of the size of u.\n *\n * Moves often appear in container implementations. For example, when we append\n * to a vector, we may need to resize its buffer. This entails moving each of\n * its extant elements from the old, smaller buffer to the new, larger buffer.\n * But once the elements have been migrated, we're just going to throw away the\n * old buffer; we don't care if they still have their values. So if the vector's\n * element type can implement \"move\" more efficiently than \"copy\", the vector\n * resizing should by all means use a \"move\" operation. Hash tables also need to\n * be resized.\n *\n * The details of the optimization, and whether it's worth applying, vary from\n * one type to the next. And while some constructor calls are moves, many really\n * are copies, and can't be optimized this way. So we need:\n *\n * 1) a way for a particular invocation of a copy constructor to say that it's\n *    really a move, and that the value of the original isn't important\n *    afterwards (although it must still be safe to destroy); and\n *\n * 2) a way for a type (like Vector) to announce that it can be moved more\n *    efficiently than it can be copied, and provide an implementation of that\n *    move operation.\n *\n * The Move(T&) function takes a reference to a T, and returns a MoveRef<T>\n * referring to the same value; that's 1). A MoveRef<T> is simply a reference\n * to a T, annotated to say that a copy constructor applied to it may move that\n * T, instead of copying it. Finally, a constructor that accepts an MoveRef<T>\n * should perform a more efficient move, instead of a copy, providing 2).\n *\n * So, where we might define a copy constructor for a class C like this:\n *\n *   C(const C& rhs) { ... copy rhs to this ... }\n *\n * we would declare a move constructor like this:\n *\n *   C(MoveRef<C> rhs) { ... move rhs to this ... }\n *\n * And where we might perform a copy like this:\n *\n *   C c2(c1);\n *\n * we would perform a move like this:\n *\n *   C c2(Move(c1))\n *\n * Note that MoveRef<T> implicitly converts to T&, so you can pass a MoveRef<T>\n * to an ordinary copy constructor for a type that doesn't support a special\n * move constructor, and you'll just get a copy.  This means that templates can\n * use Move whenever they know they won't use the original value any more, even\n * if they're not sure whether the type at hand has a specialized move\n * constructor.  If it doesn't, the MoveRef<T> will just convert to a T&, and\n * the ordinary copy constructor will apply.\n *\n * A class with a move constructor can also provide a move assignment operator,\n * which runs this's destructor, and then applies the move constructor to\n * *this's memory. A typical definition:\n *\n *   C& operator=(MoveRef<C> rhs) {\n *     this->~C();\n *     new(this) C(rhs);\n *     return *this;\n *   }\n *\n * With that in place, one can write move assignments like this:\n *\n *   c2 = Move(c1);\n *\n * This destroys c1, moves c1's value to c2, and leaves c1 in an undefined but\n * destructible state.\n *\n * This header file defines MoveRef and Move in the mozilla namespace.  It's up\n * to individual containers to annotate moves as such, by calling Move; and it's\n * up to individual types to define move constructors.\n *\n * One hint: if you're writing a move constructor where the type has members\n * that should be moved themselves, it's much nicer to write this:\n *\n *   C(MoveRef<C> c) : x(Move(c->x)), y(Move(c->y)) { }\n *\n * than the equivalent:\n *\n *   C(MoveRef<C> c) { new(&x) X(Move(c->x)); new(&y) Y(Move(c->y)); }\n *\n * especially since GNU C++ fails to notice that this does indeed initialize x\n * and y, which may matter if they're const.\n */\ntemplate<typename T>\nclass MoveRef\n{\n    T* pointer;\n\n  public:\n    explicit MoveRef(T& t) : pointer(&t) { }\n    T& operator*() const { return *pointer; }\n    T* operator->() const { return pointer; }\n    operator T& () const { return *pointer; }\n};\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(T& t)\n{\n  return MoveRef<T>(t);\n}\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(const T& t)\n{\n  // With some versions of gcc, for a class C, there's an (incorrect) ambiguity\n  // between the C(const C&) constructor and the default C(C&&) C++11 move\n  // constructor, when the constructor is called with a const C& argument.\n  //\n  // This ambiguity manifests with the Move implementation above when Move is\n  // passed const U& for some class U.  Calling Move(const U&) returns a\n  // MoveRef<const U&>, which is then commonly passed to the U constructor,\n  // triggering an implicit conversion to const U&.  gcc doesn't know whether to\n  // call U(const U&) or U(U&&), so it wrongly reports a compile error.\n  //\n  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50442 has since been fixed, so\n  // this is no longer an issue for up-to-date compilers.  But there's no harm\n  // in keeping it around for older compilers, so we might as well.  See also\n  // bug 686280.\n  return MoveRef<T>(const_cast<T&>(t));\n}\n\n/** Swap |t| and |u| using move-construction if possible. */\ntemplate<typename T>\ninline void\nSwap(T& t, T& u)\n{\n  T tmp(Move(t));\n  t = Move(u);\n  u = Move(tmp);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Move_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/NullPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a workaround for compilers which do not support the C++11 nullptr\n * constant.\n */\n\n#ifndef mozilla_NullPtr_h\n#define mozilla_NullPtr_h\n\n#include \"mozilla/Compiler.h\"\n\n#if defined(__clang__)\n#  ifndef __has_extension\n#    define __has_extension __has_feature\n#  endif\n#  if __has_extension(cxx_nullptr)\n#    define MOZ_HAVE_CXX11_NULLPTR\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_NULLPTR\n#    endif\n#  endif\n#elif _MSC_VER >= 1600\n# define MOZ_HAVE_CXX11_NULLPTR\n#endif\n\n/**\n * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal\n * with the correct size to match the size of a pointer on a given platform.\n */\n\n#ifndef MOZ_HAVE_CXX11_NULLPTR\n#  if defined(__GNUC__)\n#    define nullptr __null\n#  elif defined(_WIN64)\n#    define nullptr 0LL\n#  else\n#    define nullptr 0L\n#  endif\n#endif\n\n#endif /* mozilla_NullPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/PodOperations.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Operations for zeroing POD types, arrays, and so on.\n *\n * These operations are preferable to memset, memcmp, and the like because they\n * don't require remembering to multiply by sizeof(T), array lengths, and so on\n * everywhere.\n */\n\n#ifndef mozilla_PodOperations_h\n#define mozilla_PodOperations_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include <string.h>\n\nnamespace mozilla {\n\n/** Set the contents of |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t)\n{\n  memset(t, 0, sizeof(T));\n}\n\n/** Set the contents of |nelem| elements starting at |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t, size_t nelem)\n{\n  /*\n   * This function is often called with 'nelem' small; we use an inline loop\n   * instead of calling 'memset' with a non-constant length.  The compiler\n   * should inline the memset call with constant size, though.\n   */\n  for (T* end = t + nelem; t < end; t++)\n    memset(t, 0, sizeof(T));\n}\n\n/*\n * Arrays implicitly convert to pointers to their first element, which is\n * dangerous when combined with the above PodZero definitions.  Adding an\n * overload for arrays is ambiguous, so we need another identifier.  The\n * ambiguous overload is left to catch mistaken uses of PodZero; if you get a\n * compile error involving PodZero and array types, use PodArrayZero instead.\n */\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N]) MOZ_DELETE;\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N], size_t nelem) MOZ_DELETE;\n\n/** Set the contents of the array |t| to zero. */\ntemplate <class T, size_t N>\nstatic void\nPodArrayZero(T (&t)[N])\n{\n  memset(t, 0, N * sizeof(T));\n}\n\n/**\n * Assign |*src| to |*dst|.  The locations must not be the same and must not\n * overlap.\n */\ntemplate<typename T>\nstatic void\nPodAssign(T* dst, const T* src)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= 1);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= 1);\n  memcpy(reinterpret_cast<char*>(dst), reinterpret_cast<const char*>(src), sizeof(T));\n}\n\n/**\n * Copy |nelem| T elements from |src| to |dst|.  The two memory ranges must not\n * overlap!\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(T* dst, const T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= nelem);\n\n  if (nelem < 128) {\n    /*\n     * Avoid using operator= in this loop, as it may have been\n     * intentionally deleted by the POD type.\n     */\n    for (const T* srcend = src + nelem; src < srcend; src++, dst++)\n      PodAssign(dst, src);\n  } else {\n    memcpy(dst, src, nelem * sizeof(T));\n  }\n}\n\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(volatile T* dst, const volatile T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst,\n                PointerRangeSize(src, static_cast<const volatile T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src,\n                PointerRangeSize(static_cast<const volatile T*>(dst), src) >= nelem);\n\n  /*\n   * Volatile |dst| requires extra work, because it's undefined behavior to\n   * modify volatile objects using the mem* functions.  Just write out the\n   * loops manually, using operator= rather than memcpy for the same reason,\n   * and let the compiler optimize to the extent it can.\n   */\n  for (const volatile T* srcend = src + nelem; src < srcend; src++, dst++)\n    *dst = *src;\n}\n\n/*\n * Copy the contents of the array |src| into the array |dst|, both of size N.\n * The arrays must not overlap!\n */\ntemplate <class T, size_t N>\nstatic void\nPodArrayCopy(T (&dst)[N], const T (&src)[N])\n{\n  PodCopy(dst, src, N);\n}\n\n/**\n * Determine whether the |len| elements at |one| are memory-identical to the\n * |len| elements at |two|.\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static bool\nPodEqual(const T* one, const T* two, size_t len)\n{\n  if (len < 128) {\n    const T* p1end = one + len;\n    const T* p1 = one;\n    const T* p2 = two;\n    for (; p1 < p1end; p1++, p2++) {\n      if (*p1 != *p2)\n        return false;\n    }\n    return true;\n  }\n\n  return !memcmp(one, two, len * sizeof(T));\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_PodOperations_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Poison.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A poison value that can be used to fill a memory space with\n * an address that leads to a safe crash when dereferenced.\n */\n\n#ifndef mozilla_Poison_h\n#define mozilla_Poison_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\nMOZ_BEGIN_EXTERN_C\n\nextern MFBT_DATA uintptr_t gMozillaPoisonValue;\n\n/**\n * @return the poison value.\n */\ninline uintptr_t mozPoisonValue()\n{\n  return gMozillaPoisonValue;\n}\n\n/**\n * Overwrite the memory block of aSize bytes at aPtr with the poison value.\n * aPtr MUST be aligned at a sizeof(uintptr_t) boundary.\n * Only an even number of sizeof(uintptr_t) bytes are overwritten, the last\n * few bytes (if any) is not overwritten.\n */\ninline void mozWritePoison(void* aPtr, size_t aSize)\n{\n  const uintptr_t POISON = mozPoisonValue();\n  char* p = (char*)aPtr;\n  char* limit = p + aSize;\n  MOZ_ASSERT((uintptr_t)aPtr % sizeof(uintptr_t) == 0, \"bad alignment\");\n  MOZ_ASSERT(aSize >= sizeof(uintptr_t), \"poisoning this object has no effect\");\n  for (; p < limit; p += sizeof(uintptr_t)) {\n    *((uintptr_t*)p) = POISON;\n  }\n}\n\n/**\n * Initialize the poison value.\n * This should only be called once.\n */\nextern MFBT_API void mozPoisonValueInit();\n\n/* Values annotated by CrashReporter */\nextern MFBT_DATA uintptr_t gMozillaPoisonBase;\nextern MFBT_DATA uintptr_t gMozillaPoisonSize;\n\nMOZ_END_EXTERN_C\n\n#endif /* mozilla_Poison_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Range.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef mozilla_Range_h\n#define mozilla_Range_h\n\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RangedPtr.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\n// Range<T> is a tuple containing a pointer and a length.\ntemplate <typename T>\nclass Range\n{\n    RangedPtr<T> mStart;\n    RangedPtr<T> mEnd;\n\n    typedef void (Range::* ConvertibleToBool)();\n    void nonNull() {}\n\n  public:\n    Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {}\n    Range(T* p, size_t len)\n      : mStart(p, p, p + len),\n        mEnd(p + len, p, p + len)\n    {}\n\n    RangedPtr<T> start() const { return mStart; }\n    RangedPtr<T> end() const { return mEnd; }\n    size_t length() const { return mEnd - mStart; }\n\n    T& operator[](size_t offset) {\n      return mStart[offset];\n    }\n\n    const T& operator[](size_t offset) const {\n      return mStart[offset];\n    }\n\n    operator ConvertibleToBool() const { return mStart ? &Range::nonNull : 0; }\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Range_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/RangedPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a smart pointer asserted to remain within a range specified at\n * construction.\n */\n\n#ifndef mozilla_RangedPtr_h\n#define mozilla_RangedPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Util.h\"\n\nnamespace mozilla {\n\n/*\n * RangedPtr is a smart pointer restricted to an address range specified at\n * creation.  The pointer (and any smart pointers derived from it) must remain\n * within the range [start, end] (inclusive of end to facilitate use as\n * sentinels).  Dereferencing or indexing into the pointer (or pointers derived\n * from it) must remain within the range [start, end).  All the standard pointer\n * operators are defined on it; in debug builds these operations assert that the\n * range specified at construction is respected.\n *\n * In theory passing a smart pointer instance as an argument can be slightly\n * slower than passing a T* (due to ABI requirements for passing structs versus\n * passing pointers), if the method being called isn't inlined.  If you are in\n * extremely performance-critical code, you may want to be careful using this\n * smart pointer as an argument type.\n *\n * RangedPtr<T> intentionally does not implicitly convert to T*.  Use get() to\n * explicitly convert to T*.  Keep in mind that the raw pointer of course won't\n * implement bounds checking in debug builds.\n */\ntemplate<typename T>\nclass RangedPtr\n{\n    T* ptr;\n\n#ifdef DEBUG\n    T* const rangeStart;\n    T* const rangeEnd;\n#endif\n\n    typedef void (RangedPtr::* ConvertibleToBool)();\n    void nonNull() {}\n\n    void checkSanity() {\n      MOZ_ASSERT(rangeStart <= ptr);\n      MOZ_ASSERT(ptr <= rangeEnd);\n    }\n\n    /* Creates a new pointer for |p|, restricted to this pointer's range. */\n    RangedPtr<T> create(T *p) const {\n#ifdef DEBUG\n      return RangedPtr<T>(p, rangeStart, rangeEnd);\n#else\n      return RangedPtr<T>(p, nullptr, size_t(0));\n#endif\n    }\n\n    uintptr_t asUintptr() const { return uintptr_t(ptr); }\n\n  public:\n    RangedPtr(T* p, T* start, T* end)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(end)\n#endif\n    {\n      MOZ_ASSERT(rangeStart <= rangeEnd);\n      checkSanity();\n    }\n    RangedPtr(T* p, T* start, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(start + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(p, p, length). */\n    RangedPtr(T* p, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(p), rangeEnd(p + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(arr, arr, N). */\n    template<size_t N>\n    RangedPtr(T (&arr)[N])\n      : ptr(arr)\n#ifdef DEBUG\n      , rangeStart(arr), rangeEnd(arr + N)\n#endif\n    {\n      checkSanity();\n    }\n\n    T* get() const {\n      return ptr;\n    }\n\n    operator ConvertibleToBool() const { return ptr ? &RangedPtr::nonNull : 0; }\n\n    /*\n     * You can only assign one RangedPtr into another if the two pointers have\n     * the same valid range:\n     *\n     *   char arr1[] = \"hi\";\n     *   char arr2[] = \"bye\";\n     *   RangedPtr<char> p1(arr1, 2);\n     *   p1 = RangedPtr<char>(arr1 + 1, arr1, arr1 + 2); // works\n     *   p1 = RangedPtr<char>(arr2, 3);                  // asserts\n     */\n    RangedPtr<T>& operator=(const RangedPtr<T>& other) {\n      MOZ_ASSERT(rangeStart == other.rangeStart);\n      MOZ_ASSERT(rangeEnd == other.rangeEnd);\n      ptr = other.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T> operator+(size_t inc) {\n      MOZ_ASSERT(inc <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() + inc * sizeof(T) >= asUintptr());\n      return create(ptr + inc);\n    }\n\n    RangedPtr<T> operator-(size_t dec) {\n      MOZ_ASSERT(dec <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() - dec * sizeof(T) <= asUintptr());\n      return create(ptr - dec);\n    }\n\n    /*\n     * You can assign a raw pointer into a RangedPtr if the raw pointer is\n     * within the range specified at creation.\n     */\n    template <typename U>\n    RangedPtr<T>& operator=(U* p) {\n      *this = create(p);\n      return *this;\n    }\n\n    template <typename U>\n    RangedPtr<T>& operator=(const RangedPtr<U>& p) {\n      MOZ_ASSERT(rangeStart <= p.ptr);\n      MOZ_ASSERT(p.ptr <= rangeEnd);\n      ptr = p.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T>& operator++() {\n      return (*this += 1);\n    }\n\n    RangedPtr<T> operator++(int) {\n      RangedPtr<T> rcp = *this;\n      ++*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator--() {\n      return (*this -= 1);\n    }\n\n    RangedPtr<T> operator--(int) {\n      RangedPtr<T> rcp = *this;\n      --*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator+=(size_t inc) {\n      *this = *this + inc;\n      return *this;\n    }\n\n    RangedPtr<T>& operator-=(size_t dec) {\n      *this = *this - dec;\n      return *this;\n    }\n\n    T& operator[](int index) const {\n      MOZ_ASSERT(size_t(index > 0 ? index : -index) <= size_t(-1) / sizeof(T));\n      return *create(ptr + index);\n    }\n\n    T& operator*() const {\n      return *ptr;\n    }\n\n    template <typename U>\n    bool operator==(const RangedPtr<U>& other) const {\n      return ptr == other.ptr;\n    }\n    template <typename U>\n    bool operator!=(const RangedPtr<U>& other) const {\n      return !(*this == other);\n    }\n\n    template<typename U>\n    bool operator==(const U* u) const {\n      return ptr == u;\n    }\n    template<typename U>\n    bool operator!=(const U* u) const {\n      return !(*this == u);\n    }\n\n    template <typename U>\n    bool operator<(const RangedPtr<U>& other) const {\n      return ptr < other.ptr;\n    }\n    template <typename U>\n    bool operator<=(const RangedPtr<U>& other) const {\n      return ptr <= other.ptr;\n    }\n\n    template <typename U>\n    bool operator>(const RangedPtr<U>& other) const {\n      return ptr > other.ptr;\n    }\n    template <typename U>\n    bool operator>=(const RangedPtr<U>& other) const {\n      return ptr >= other.ptr;\n    }\n\n    size_t operator-(const RangedPtr<T>& other) const {\n      MOZ_ASSERT(ptr >= other.ptr);\n      return PointerRangeSize(other.ptr, ptr);\n    }\n\n  private:\n    RangedPtr() MOZ_DELETE;\n    T* operator&() MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_RangedPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/ReentrancyGuard.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Small helper class for asserting uses of a class are non-reentrant. */\n\n#ifndef mozilla_ReentrancyGuard_h\n#define mozilla_ReentrancyGuard_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n\nnamespace mozilla {\n\n/* Useful for implementing containers that assert non-reentrancy */\nclass ReentrancyGuard\n{\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#ifdef DEBUG\n    bool& entered;\n#endif\n\n  public:\n    template<class T>\n#ifdef DEBUG\n    ReentrancyGuard(T& obj\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : entered(obj.entered)\n#else\n    ReentrancyGuard(T&\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n#endif\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n#ifdef DEBUG\n      MOZ_ASSERT(!entered);\n      entered = true;\n#endif\n    }\n    ~ReentrancyGuard()\n    {\n#ifdef DEBUG\n      entered = false;\n#endif\n    }\n\n  private:\n    ReentrancyGuard(const ReentrancyGuard&) MOZ_DELETE;\n    void operator=(const ReentrancyGuard&) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_ReentrancyGuard_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/RefPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Helpers for defining and using refcounted objects. */\n\n#ifndef mozilla_RefPtr_h\n#define mozilla_RefPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate<typename T> class RefCounted;\ntemplate<typename T> class RefPtr;\ntemplate<typename T> class TemporaryRef;\ntemplate<typename T> class OutParamRef;\ntemplate<typename T> OutParamRef<T> byRef(RefPtr<T>&);\n\n/**\n * RefCounted<T> is a sort of a \"mixin\" for a class T.  RefCounted\n * manages, well, refcounting for T, and because RefCounted is\n * parameterized on T, RefCounted<T> can call T's destructor directly.\n * This means T doesn't need to have a virtual dtor and so doesn't\n * need a vtable.\n *\n * RefCounted<T> is created with refcount == 0.  Newly-allocated\n * RefCounted<T> must immediately be assigned to a RefPtr to make the\n * refcount > 0.  It's an error to allocate and free a bare\n * RefCounted<T>, i.e. outside of the RefPtr machinery.  Attempts to\n * do so will abort DEBUG builds.\n *\n * Live RefCounted<T> have refcount > 0.  The lifetime (refcounts) of\n * live RefCounted<T> are controlled by RefPtr<T> and\n * RefPtr<super/subclass of T>.  Upon a transition from refcounted==1\n * to 0, the RefCounted<T> \"dies\" and is destroyed.  The \"destroyed\"\n * state is represented in DEBUG builds by refcount==0xffffdead.  This\n * state distinguishes use-before-ref (refcount==0) from\n * use-after-destroy (refcount==0xffffdead).\n */\nnamespace detail {\n#ifdef DEBUG\nstatic const int DEAD = 0xffffdead;\n#endif\n\n// This is used WeakPtr.h as well as this file.\nenum RefCountAtomicity\n{\n  AtomicRefCount,\n  NonAtomicRefCount\n};\n\ntemplate<typename T, RefCountAtomicity Atomicity>\nclass RefCounted\n{\n    friend class RefPtr<T>;\n\n  protected:\n    RefCounted() : refCnt(0) { }\n    ~RefCounted() {\n      MOZ_ASSERT(refCnt == detail::DEAD);\n    }\n\n  public:\n    // Compatibility with nsRefPtr.\n    void AddRef() {\n      MOZ_ASSERT(refCnt >= 0);\n      ++refCnt;\n    }\n\n    void Release() {\n      MOZ_ASSERT(refCnt > 0);\n      if (0 == --refCnt) {\n#ifdef DEBUG\n        refCnt = detail::DEAD;\n#endif\n        delete static_cast<T*>(this);\n      }\n    }\n\n    // Compatibility with wtf::RefPtr.\n    void ref() { AddRef(); }\n    void deref() { Release(); }\n    int refCount() const { return refCnt; }\n    bool hasOneRef() const {\n      MOZ_ASSERT(refCnt > 0);\n      return refCnt == 1;\n    }\n\n  private:\n    typename Conditional<Atomicity == AtomicRefCount, Atomic<int>, int>::Type refCnt;\n};\n\n}\n\ntemplate<typename T>\nclass RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>\n{\n  public:\n    ~RefCounted() {\n      static_assert(IsBaseOf<RefCounted, T>::value,\n                    \"T must derive from RefCounted<T>\");\n    }\n};\n\n/**\n * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated\n * reference counter.\n */\ntemplate<typename T>\nclass AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>\n{\n  public:\n    ~AtomicRefCounted() {\n      static_assert(IsBaseOf<AtomicRefCounted, T>::value,\n                    \"T must derive from AtomicRefCounted<T>\");\n    }\n};\n\n/**\n * RefPtr points to a refcounted thing that has AddRef and Release\n * methods to increase/decrease the refcount, respectively.  After a\n * RefPtr<T> is assigned a T*, the T* can be used through the RefPtr\n * as if it were a T*.\n *\n * A RefPtr can forget its underlying T*, which results in the T*\n * being wrapped in a temporary object until the T* is either\n * re-adopted from or released by the temporary.\n */\ntemplate<typename T>\nclass RefPtr\n{\n    // To allow them to use unref()\n    friend class TemporaryRef<T>;\n    friend class OutParamRef<T>;\n\n    struct DontRef {};\n\n  public:\n    RefPtr() : ptr(0) { }\n    RefPtr(const RefPtr& o) : ptr(ref(o.ptr)) {}\n    RefPtr(const TemporaryRef<T>& o) : ptr(o.drop()) {}\n    RefPtr(T* t) : ptr(ref(t)) {}\n\n    template<typename U>\n    RefPtr(const RefPtr<U>& o) : ptr(ref(o.get())) {}\n\n    ~RefPtr() { unref(ptr); }\n\n    RefPtr& operator=(const RefPtr& o) {\n      assign(ref(o.ptr));\n      return *this;\n    }\n    RefPtr& operator=(const TemporaryRef<T>& o) {\n      assign(o.drop());\n      return *this;\n    }\n    RefPtr& operator=(T* t) {\n      assign(ref(t));\n      return *this;\n    }\n\n    template<typename U>\n    RefPtr& operator=(const RefPtr<U>& o) {\n      assign(ref(o.get()));\n      return *this;\n    }\n\n    TemporaryRef<T> forget() {\n      T* tmp = ptr;\n      ptr = 0;\n      return TemporaryRef<T>(tmp, DontRef());\n    }\n\n    T* get() const { return ptr; }\n    operator T*() const { return ptr; }\n    T* operator->() const { return ptr; }\n    T& operator*() const { return *ptr; }\n    template<typename U>\n    operator TemporaryRef<U>() { return TemporaryRef<U>(ptr); }\n\n  private:\n    void assign(T* t) {\n      unref(ptr);\n      ptr = t;\n    }\n\n    T* ptr;\n\n    static MOZ_ALWAYS_INLINE T* ref(T* t) {\n      if (t)\n        t->AddRef();\n      return t;\n    }\n\n    static MOZ_ALWAYS_INLINE void unref(T* t) {\n      if (t)\n        t->Release();\n    }\n};\n\n/**\n * TemporaryRef<T> represents an object that holds a temporary\n * reference to a T.  TemporaryRef objects can't be manually ref'd or\n * unref'd (being temporaries, not lvalues), so can only relinquish\n * references to other objects, or unref on destruction.\n */\ntemplate<typename T>\nclass TemporaryRef\n{\n    // To allow it to construct TemporaryRef from a bare T*\n    friend class RefPtr<T>;\n\n    typedef typename RefPtr<T>::DontRef DontRef;\n\n  public:\n    TemporaryRef(T* t) : ptr(RefPtr<T>::ref(t)) {}\n    TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {}\n\n    template<typename U>\n    TemporaryRef(const TemporaryRef<U>& o) : ptr(o.drop()) {}\n\n    ~TemporaryRef() { RefPtr<T>::unref(ptr); }\n\n    T* drop() const {\n      T* tmp = ptr;\n      ptr = 0;\n      return tmp;\n    }\n\n  private:\n    TemporaryRef(T* t, const DontRef&) : ptr(t) {}\n\n    mutable T* ptr;\n\n    TemporaryRef() MOZ_DELETE;\n    void operator=(const TemporaryRef&) MOZ_DELETE;\n};\n\n/**\n * OutParamRef is a wrapper that tracks a refcounted pointer passed as\n * an outparam argument to a function.  OutParamRef implements COM T**\n * outparam semantics: this requires the callee to AddRef() the T*\n * returned through the T** outparam on behalf of the caller.  This\n * means the caller (through OutParamRef) must Release() the old\n * object contained in the tracked RefPtr.  It's OK if the callee\n * returns the same T* passed to it through the T** outparam, as long\n * as the callee obeys the COM discipline.\n *\n * Prefer returning TemporaryRef<T> from functions over creating T**\n * outparams and passing OutParamRef<T> to T**.  Prefer RefPtr<T>*\n * outparams over T** outparams.\n */\ntemplate<typename T>\nclass OutParamRef\n{\n    friend OutParamRef byRef<T>(RefPtr<T>&);\n\n  public:\n    ~OutParamRef() {\n      RefPtr<T>::unref(refPtr.ptr);\n      refPtr.ptr = tmp;\n    }\n\n    operator T**() { return &tmp; }\n\n  private:\n    OutParamRef(RefPtr<T>& p) : refPtr(p), tmp(p.get()) {}\n\n    RefPtr<T>& refPtr;\n    T* tmp;\n\n    OutParamRef() MOZ_DELETE;\n    OutParamRef& operator=(const OutParamRef&) MOZ_DELETE;\n};\n\n/**\n * byRef cooperates with OutParamRef to implement COM outparam semantics.\n */\ntemplate<typename T>\nOutParamRef<T>\nbyRef(RefPtr<T>& ptr)\n{\n  return OutParamRef<T>(ptr);\n}\n\n} // namespace mozilla\n\n#if 0\n\n// Command line that builds these tests\n//\n//   cp RefPtr.h test.cc && g++ -g -Wall -pedantic -DDEBUG -o test test.cc && ./test\n\nusing namespace mozilla;\n\nstruct Foo : public RefCounted<Foo>\n{\n  Foo() : dead(false) { }\n  ~Foo() {\n    MOZ_ASSERT(!dead);\n    dead = true;\n    numDestroyed++;\n  }\n\n  bool dead;\n  static int numDestroyed;\n};\nint Foo::numDestroyed;\n\nstruct Bar : public Foo { };\n\nTemporaryRef<Foo>\nNewFoo()\n{\n  return RefPtr<Foo>(new Foo());\n}\n\nTemporaryRef<Foo>\nNewBar()\n{\n  return new Bar();\n}\n\nvoid\nGetNewFoo(Foo** f)\n{\n  *f = new Bar();\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetPassedFoo(Foo** f)\n{\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetNewFoo(RefPtr<Foo>* f)\n{\n  *f = new Bar();\n}\n\nvoid\nGetPassedFoo(RefPtr<Foo>* f)\n{}\n\nTemporaryRef<Foo>\nGetNullFoo()\n{\n  return 0;\n}\n\nint\nmain(int argc, char** argv)\n{\n  // This should blow up\n//    Foo* f = new Foo(); delete f;\n\n  MOZ_ASSERT(0 == Foo::numDestroyed);\n  {\n    RefPtr<Foo> f = new Foo();\n    MOZ_ASSERT(f->refCount() == 1);\n  }\n  MOZ_ASSERT(1 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = NewFoo();\n    RefPtr<Foo> f2(NewFoo());\n    MOZ_ASSERT(1 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(3 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> b = NewBar();\n    MOZ_ASSERT(3 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(4 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1;\n    {\n      f1 = new Foo();\n      RefPtr<Foo> f2(f1);\n      RefPtr<Foo> f3 = f2;\n      MOZ_ASSERT(4 == Foo::numDestroyed);\n    }\n    MOZ_ASSERT(4 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(5 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    f.forget();\n    MOZ_ASSERT(6 == Foo::numDestroyed);\n  }\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(byRef(f));\n    MOZ_ASSERT(7 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(8 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(byRef(f));\n    MOZ_ASSERT(8 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(9 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(&f);\n    MOZ_ASSERT(10 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(11 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(&f);\n    MOZ_ASSERT(11 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(12 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = new Bar();\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = GetNullFoo();\n    MOZ_ASSERT(13 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  return 0;\n}\n\n#endif\n\n#endif /* mozilla_RefPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/SHA1.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Simple class for computing SHA1. */\n\n#ifndef mozilla_SHA1_h\n#define mozilla_SHA1_h\n\n#include \"mozilla/Types.h\"\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * This class computes the SHA1 hash of a byte sequence, or of the concatenation\n * of multiple sequences.  For example, computing the SHA1 of two sequences of\n * bytes could be done as follows:\n *\n *   void SHA1(const uint8_t* buf1, uint32_t size1,\n *             const uint8_t* buf2, uint32_t size2,\n *             SHA1Sum::Hash& hash)\n *   {\n *     SHA1Sum s;\n *     s.update(buf1, size1);\n *     s.update(buf2, size2);\n *     s.finish(hash);\n *   }\n *\n * The finish method may only be called once and cannot be followed by calls\n * to update.\n */\nclass SHA1Sum\n{\n    union {\n        uint32_t w[16]; /* input buffer */\n        uint8_t b[64];\n    } u;\n    uint64_t size; /* count of hashed bytes. */\n    unsigned H[22]; /* 5 state variables, 16 tmp values, 1 extra */\n    bool mDone;\n\n  public:\n    MFBT_API SHA1Sum();\n\n    static const size_t HashSize = 20;\n    typedef uint8_t Hash[HashSize];\n\n    /* Add len bytes of dataIn to the data sequence being hashed. */\n    MFBT_API void update(const void* dataIn, uint32_t len);\n\n    /* Compute the final hash of all data into hashOut. */\n    MFBT_API void finish(SHA1Sum::Hash& hashOut);\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_SHA1_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Scoped.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A number of structures to simplify scope-based RAII management. */\n\n#ifndef mozilla_Scoped_h\n#define mozilla_Scoped_h\n\n/*\n * Resource Acquisition Is Initialization is a programming idiom used\n * to write robust code that is able to deallocate resources properly,\n * even in presence of execution errors or exceptions that need to be\n * propagated.  The Scoped* classes defined in this header perform the\n * deallocation of the resource they hold once program execution\n * reaches the end of the scope for which they have been defined.\n *\n * This header provides the following RAII classes:\n *\n * - |ScopedFreePtr| - a container for a pointer, that automatically calls\n *   |free()| at the end of the scope;\n * - |ScopedDeletePtr| - a container for a pointer, that automatically calls\n *   |delete| at the end of the scope;\n * - |ScopedDeleteArray| - a container for a pointer to an array, that\n *   automatically calls |delete[]| at the end of the scope.\n *\n * The general scenario for each of the RAII classes is the following:\n *\n * ScopedClass foo(create_value());\n * // ... In this scope, |foo| is defined. Use |foo.get()| or |foo.rwget()|\n *        to access the value.\n * // ... In case of |return| or |throw|, |foo| is deallocated automatically.\n * // ... If |foo| needs to be returned or stored, use |foo.forget()|\n *\n * Note that the RAII classes defined in this header do _not_ perform any form\n * of reference-counting or garbage-collection. These classes have exactly two\n * behaviors:\n *\n * - if |forget()| has not been called, the resource is always deallocated at\n *   the end of the scope;\n * - if |forget()| has been called, any control on the resource is unbound\n *   and the resource is not deallocated by the class.\n *\n * Extension:\n *\n * In addition, this header provides class |Scoped| and macros |SCOPED_TEMPLATE|\n * and |MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE|  to simplify the definition\n * of RAII classes for other scenarios. These macros have been used to\n * automatically close file descriptors/file handles when reaching the end of\n * the scope, graphics contexts, etc.\n */\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n/*\n * Scoped is a helper to create RAII wrappers\n * Type argument |Traits| is expected to have the following structure:\n *\n *   struct Traits {\n *     // Define the type of the value stored in the wrapper\n *     typedef value_type type;\n *     // Returns the value corresponding to the uninitialized or freed state\n *     const static type empty();\n *     // Release resources corresponding to the wrapped value\n *     // This function is responsible for not releasing an |empty| value\n *     const static void release(type);\n *   }\n */\ntemplate<typename Traits>\nclass Scoped\n{\n  public:\n    typedef typename Traits::type Resource;\n\n    explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : value(Traits::empty())\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    explicit Scoped(const Resource& v\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : value(v)\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~Scoped() {\n      Traits::release(value);\n    }\n\n    // Constant getter\n    operator const Resource&() const { return value; }\n    const Resource& operator->() const { return value; }\n    const Resource& get() const { return value; }\n    // Non-constant getter.\n    Resource& rwget() { return value; }\n\n    /*\n     * Forget the resource.\n     *\n     * Once |forget| has been called, the |Scoped| is neutralized, i.e. it will\n     * have no effect at destruction (unless it is reset to another resource by\n     * |operator=|).\n     *\n     * @return The original resource.\n     */\n    Resource forget() {\n      Resource tmp = value;\n      value = Traits::empty();\n      return tmp;\n    }\n\n    /*\n     * Perform immediate clean-up of this |Scoped|.\n     *\n     * If this |Scoped| is currently empty, this method has no effect.\n     */\n    void dispose() {\n      Traits::release(value);\n      value = Traits::empty();\n    }\n\n    bool operator==(const Resource& other) const {\n      return value == other;\n    }\n\n    /*\n     * Replace the resource with another resource.\n     *\n     * Calling |operator=| has the side-effect of triggering clean-up. If you do\n     * not want to trigger clean-up, you should first invoke |forget|.\n     *\n     * @return this\n     */\n    Scoped<Traits>& operator=(const Resource& other) {\n      return reset(other);\n    }\n    Scoped<Traits>& reset(const Resource& other) {\n      Traits::release(value);\n      value = other;\n      return *this;\n    }\n\n  private:\n    explicit Scoped(const Scoped<Traits>& value) MOZ_DELETE;\n    Scoped<Traits>& operator=(const Scoped<Traits>& value) MOZ_DELETE;\n\n  private:\n    Resource value;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * SCOPED_TEMPLATE defines a templated class derived from Scoped\n * This allows to implement templates such as ScopedFreePtr.\n *\n * @param name The name of the class to define.\n * @param Traits A struct implementing clean-up. See the implementations\n * for more details.\n */\n#define SCOPED_TEMPLATE(name, Traits)                          \\\ntemplate<typename Type>                                        \\\nstruct name : public mozilla::Scoped<Traits<Type> >            \\\n{                                                              \\\n    typedef mozilla::Scoped<Traits<Type> > Super;              \\\n    typedef typename Super::Resource Resource;                 \\\n    name& operator=(Resource ptr) {                            \\\n      Super::operator=(ptr);                                   \\\n      return *this;                                            \\\n    }                                                          \\\n    explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)        \\\n      : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)  \\\n    {}                                                         \\\n    explicit name(Resource ptr                                 \\\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)             \\\n      : Super(ptr MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)   \\\n    {}                                                         \\\n  private:                                                     \\\n    explicit name(name& source) MOZ_DELETE;                    \\\n    name& operator=(name& source) MOZ_DELETE;                  \\\n};\n\n/*\n * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d.\n *\n *   struct S { ... };\n *   ScopedFreePtr<S> foo = malloc(sizeof(S));\n *   ScopedFreePtr<char> bar = strdup(str);\n */\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return nullptr; }\n    static void release(T* ptr) { free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)\n\n/*\n * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.\n *\n *   struct S { ... };\n *   ScopedDeletePtr<S> foo = new S();\n */\ntemplate<typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)\n\n/*\n * ScopedDeleteArray is a RAII wrapper for pointers that need to be delete[]ed.\n *\n *   struct S { ... };\n *   ScopedDeleteArray<S> foo = new S[42];\n */\ntemplate<typename T>\nstruct ScopedDeleteArrayTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete [] ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeleteArray, ScopedDeleteArrayTraits)\n\n/*\n * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped\n * pointers for types with custom deleters; just overload\n * TypeSpecificDelete(T*) in the same namespace as T to call the deleter for\n * type T.\n *\n * @param name The name of the class to define.\n * @param Type A struct implementing clean-up. See the implementations\n * for more details.\n * *param Deleter The function that is used to delete/destroy/free a\n *        non-null value of Type*.\n *\n * Example:\n *\n *   MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \\\n *                                             PR_Close)\n *   ...\n *   {\n *       ScopedPRFileDesc file(PR_OpenFile(...));\n *       ...\n *   } // file is closed with PR_Close here\n */\n#define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \\\ntemplate <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \\\ntypedef ::mozilla::TypeSpecificScopedPointer<Type> name;\n\ntemplate <typename T> void TypeSpecificDelete(T * value);\n\ntemplate <typename T>\nstruct TypeSpecificScopedPointerTraits\n{\n    typedef T* type;\n    const static type empty() { return nullptr; }\n    const static void release(type value)\n    {\n      if (value)\n        TypeSpecificDelete(value);\n    }\n};\n\nSCOPED_TEMPLATE(TypeSpecificScopedPointer, TypeSpecificScopedPointerTraits)\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Scoped_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/SplayTree.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/**\n * A sorted tree with optimal access times, where recently-accessed elements\n * are faster to access again.\n */\n\n#ifndef mozilla_SplayTree_h\n#define mozilla_SplayTree_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\ntemplate<class T, class C>\nclass SplayTree;\n\ntemplate<typename T>\nclass SplayTreeNode\n{\n  public:\n    template<class A, class B>\n    friend class SplayTree;\n\n    SplayTreeNode()\n      : left(nullptr), right(nullptr), parent(nullptr)\n    {}\n\n  private:\n    T* left;\n    T* right;\n    T* parent;\n};\n\n\n/**\n * Class which represents a splay tree.\n * Splay trees are balanced binary search trees for which search, insert and\n * remove are all amortized O(log n), but where accessing a node makes it\n * faster to access that node in the future.\n *\n * T indicates the type of tree elements, Comparator must have a static\n * compare(const T&, const T&) method ordering the elements. The compare\n * method must be free from side effects.\n */\ntemplate<typename T, class Comparator>\nclass SplayTree\n{\n    T* root;\n    T* freeList;\n\n  public:\n    SplayTree()\n      : root(nullptr), freeList(nullptr)\n    {}\n\n    bool empty() const {\n      return !root;\n    }\n\n    bool contains(const T& v)\n    {\n      if (empty())\n        return false;\n\n      T* last = lookup(v);\n      splay(last);\n      checkCoherency(root, nullptr);\n      return Comparator::compare(v, *last) == 0;\n    }\n\n    bool insert(T* v)\n    {\n      MOZ_ASSERT(!contains(*v), \"Duplicate elements are not allowed.\");\n\n      if (!root) {\n        root = v;\n        return true;\n      }\n      T* last = lookup(*v);\n      int cmp = Comparator::compare(*v, *last);\n\n      T** parentPointer = (cmp < 0) ? &last->left : &last->right;\n      MOZ_ASSERT(!*parentPointer);\n      *parentPointer = v;\n      v->parent = last;\n\n      splay(v);\n      checkCoherency(root, nullptr);\n      return true;\n    }\n\n    T* remove(const T& v)\n    {\n      T* last = lookup(v);\n      MOZ_ASSERT(last, \"This tree must contain the element being removed.\");\n      MOZ_ASSERT(Comparator::compare(v, *last) == 0);\n\n      // Splay the tree so that the item to remove is the root.\n      splay(last);\n      MOZ_ASSERT(last == root);\n\n      // Find another node which can be swapped in for the root: either the\n      // rightmost child of the root's left, or the leftmost child of the\n      // root's right.\n      T* swap;\n      T* swapChild;\n      if (root->left) {\n        swap = root->left;\n        while (swap->right)\n          swap = swap->right;\n        swapChild = swap->left;\n      } else if (root->right) {\n        swap = root->right;\n        while (swap->left)\n          swap = swap->left;\n        swapChild = swap->right;\n      } else {\n        T* result = root;\n        root = nullptr;\n        return result;\n      }\n\n      // The selected node has at most one child, in swapChild. Detach it\n      // from the subtree by replacing it with that child.\n      if (swap == swap->parent->left)\n        swap->parent->left = swapChild;\n      else\n        swap->parent->right = swapChild;\n      if (swapChild)\n        swapChild->parent = swap->parent;\n\n      // Make the selected node the new root.\n      root = swap;\n      root->parent = nullptr;\n      root->left = last->left;\n      root->right = last->right;\n      if (root->left) {\n        root->left->parent = root;\n      }\n      if (root->right) {\n        root->right->parent = root;\n      }\n\n      checkCoherency(root, nullptr);\n      return last;\n    }\n\n    T* removeMin()\n    {\n      MOZ_ASSERT(root, \"No min to remove!\");\n\n      T* min = root;\n      while (min->left)\n        min = min->left;\n      return remove(*min);\n    }\n\n  private:\n    /**\n     * Returns the node in this comparing equal to |v|, or a node just greater or\n     * just less than |v| if there is no such node.\n     */\n    T* lookup(const T& v)\n    {\n      MOZ_ASSERT(!empty());\n\n      T* node = root;\n      T* parent;\n      do {\n        parent = node;\n        int c = Comparator::compare(v, *node);\n        if (c == 0)\n          return node;\n        else if (c < 0)\n          node = node->left;\n        else\n          node = node->right;\n      } while (node);\n      return parent;\n    }\n\n    /**\n     * Rotate the tree until |node| is at the root of the tree. Performing\n     * the rotations in this fashion preserves the amortized balancing of\n     * the tree.\n     */\n    void splay(T* node)\n    {\n      MOZ_ASSERT(node);\n\n      while (node != root) {\n        T* parent = node->parent;\n        if (parent == root) {\n          // Zig rotation.\n          rotate(node);\n          MOZ_ASSERT(node == root);\n          return;\n        }\n        T* grandparent = parent->parent;\n        if ((parent->left == node) == (grandparent->left == parent)) {\n          // Zig-zig rotation.\n          rotate(parent);\n          rotate(node);\n        } else {\n          // Zig-zag rotation.\n          rotate(node);\n          rotate(node);\n        }\n      }\n    }\n\n    void rotate(T* node)\n    {\n      // Rearrange nodes so that node becomes the parent of its current\n      // parent, while preserving the sortedness of the tree.\n      T* parent = node->parent;\n      if (parent->left == node) {\n        //     x          y\n        //   y  c  ==>  a  x\n        //  a b           b c\n        parent->left = node->right;\n        if (node->right)\n          node->right->parent = parent;\n        node->right = parent;\n      } else {\n        MOZ_ASSERT(parent->right == node);\n        //   x             y\n        //  a  y   ==>   x  c\n        //    b c       a b\n        parent->right = node->left;\n        if (node->left)\n          node->left->parent = parent;\n        node->left = parent;\n      }\n      node->parent = parent->parent;\n      parent->parent = node;\n      if (T* grandparent = node->parent) {\n        if (grandparent->left == parent)\n          grandparent->left = node;\n        else\n          grandparent->right = node;\n      } else {\n        root = node;\n      }\n    }\n\n    T* checkCoherency(T* node, T* minimum)\n    {\n#ifdef DEBUG\n      MOZ_ASSERT_IF(root, !root->parent);\n      if (!node) {\n        MOZ_ASSERT(!root);\n        return nullptr;\n      }\n      MOZ_ASSERT_IF(!node->parent, node == root);\n      MOZ_ASSERT_IF(minimum, Comparator::compare(*minimum, *node) < 0);\n      if (node->left) {\n        MOZ_ASSERT(node->left->parent == node);\n        T* leftMaximum = checkCoherency(node->left, minimum);\n        MOZ_ASSERT(Comparator::compare(*leftMaximum, *node) < 0);\n      }\n      if (node->right) {\n        MOZ_ASSERT(node->right->parent == node);\n        return checkCoherency(node->right, node);\n      }\n      return node;\n#else\n      return nullptr;\n#endif\n    }\n\n    SplayTree(const SplayTree&) MOZ_DELETE;\n    void operator=(const SplayTree&) MOZ_DELETE;\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_SplayTree_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/TemplateLib.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Reusable template meta-functions on types and compile-time values.  Meta-\n * functions are placed inside the 'tl' namespace to avoid conflict with non-\n * meta functions of the same name (e.g., mozilla::tl::FloorLog2 vs.\n * mozilla::FloorLog2).\n *\n * When constexpr support becomes universal, we should probably use that instead\n * of some of these templates, for simplicity.\n */\n\n#ifndef mozilla_TemplateLib_h\n#define mozilla_TemplateLib_h\n\n#include <limits.h>\n#include <stddef.h>\n\nnamespace mozilla {\n\nnamespace tl {\n\n/** Compute min/max. */\ntemplate<size_t I, size_t J>\nstruct Min\n{\n    static const size_t value = I < J ? I : J;\n};\ntemplate<size_t I, size_t J>\nstruct Max\n{\n    static const size_t value = I > J ? I : J;\n};\n\n/** Compute floor(log2(i)). */\ntemplate<size_t I>\nstruct FloorLog2\n{\n    static const size_t value = 1 + FloorLog2<I / 2>::value;\n};\ntemplate<> struct FloorLog2<0> { /* Error */ };\ntemplate<> struct FloorLog2<1> { static const size_t value = 0; };\n\n/** Compute ceiling(log2(i)). */\ntemplate<size_t I>\nstruct CeilingLog2\n{\n    static const size_t value = FloorLog2<2 * I - 1>::value;\n};\n\n/** Round up to the nearest power of 2. */\ntemplate<size_t I>\nstruct RoundUpPow2\n{\n    static const size_t value = size_t(1) << CeilingLog2<I>::value;\n};\ntemplate<>\nstruct RoundUpPow2<0>\n{\n    static const size_t value = 1;\n};\n\n/** Compute the number of bits in the given unsigned type. */\ntemplate<typename T>\nstruct BitSize\n{\n    static const size_t value = sizeof(T) * CHAR_BIT;\n};\n\n/**\n * Produce an N-bit mask, where N <= BitSize<size_t>::value.  Handle the\n * language-undefined edge case when N = BitSize<size_t>::value.\n */\ntemplate<size_t N>\nstruct NBitMask\n{\n    // Assert the precondition.  On success this evaluates to 0.  Otherwise it\n    // triggers divide-by-zero at compile time: a guaranteed compile error in\n    // C++11, and usually one in C++98.  Add this value to |value| to assure\n    // its computation.\n    static const size_t checkPrecondition = 0 / size_t(N < BitSize<size_t>::value);\n    static const size_t value = (size_t(1) << N) - 1 + checkPrecondition;\n};\ntemplate<>\nstruct NBitMask<BitSize<size_t>::value>\n{\n    static const size_t value = size_t(-1);\n};\n\n/**\n * For the unsigned integral type size_t, compute a mask M for N such that\n * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t)\n */\ntemplate<size_t N>\nstruct MulOverflowMask\n{\n    static const size_t value =\n      ~NBitMask<BitSize<size_t>::value - CeilingLog2<N>::value>::value;\n};\ntemplate<> struct MulOverflowMask<0> { /* Error */ };\ntemplate<> struct MulOverflowMask<1> { static const size_t value = 0; };\n\n} // namespace tl\n\n} // namespace mozilla\n\n#endif /* mozilla_TemplateLib_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/ThreadLocal.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cross-platform lightweight thread local data wrappers. */\n\n#ifndef mozilla_ThreadLocal_h\n#define mozilla_ThreadLocal_h\n\n#if defined(XP_WIN)\n// This file will get included in any file that wants to add a profiler mark.\n// In order to not bring <windows.h> together we could include windef.h and\n// winbase.h which are sufficient to get the prototypes for the Tls* functions.\n// # include <windef.h>\n// # include <winbase.h>\n// Unfortunately, even including these headers causes us to add a bunch of ugly\n// stuff to our namespace e.g #define CreateEvent CreateEventW\nextern \"C\" {\n__declspec(dllimport) void* __stdcall TlsGetValue(unsigned long);\n__declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void*);\n__declspec(dllimport) unsigned long __stdcall TlsAlloc();\n}\n#else\n#  include <pthread.h>\n#  include <signal.h>\n#endif\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n// sig_safe_t denotes an atomic type which can be read or stored in a single\n// instruction.  This means that data of this type is safe to be manipulated\n// from a signal handler, or other similar asynchronous execution contexts.\n#if defined(XP_WIN)\ntypedef unsigned long sig_safe_t;\n#else\ntypedef sig_atomic_t sig_safe_t;\n#endif\n\n/*\n * Thread Local Storage helpers.\n *\n * Usage:\n *\n * Only static-storage-duration (e.g. global variables, or static class members)\n * objects of this class should be instantiated. This class relies on\n * zero-initialization, which is implicit for static-storage-duration objects.\n * It doesn't have a custom default constructor, to avoid static initializers.\n *\n * API usage:\n *\n * // Create a TLS item\n * mozilla::ThreadLocal<int> tlsKey;\n * if (!tlsKey.init()) {\n *   // deal with the error\n * }\n *\n * // Set the TLS value\n * tlsKey.set(123);\n *\n * // Get the TLS value\n * int value = tlsKey.get();\n */\ntemplate<typename T>\nclass ThreadLocal\n{\n#if defined(XP_WIN)\n    typedef unsigned long key_t;\n#else\n    typedef pthread_key_t key_t;\n#endif\n\n    union Helper {\n      void* ptr;\n      T value;\n    };\n\n  public:\n    MOZ_WARN_UNUSED_RESULT inline bool init();\n\n    inline T get() const;\n\n    inline void set(const T value);\n\n    bool initialized() const {\n      return inited;\n    }\n\n  private:\n    key_t key;\n    bool inited;\n};\n\ntemplate<typename T>\ninline bool\nThreadLocal<T>::init()\n{\n  static_assert(sizeof(T) <= sizeof(void*),\n                \"mozilla::ThreadLocal can't be used for types larger than \"\n                \"a pointer\");\n  MOZ_ASSERT(!initialized());\n#ifdef XP_WIN\n  key = TlsAlloc();\n  inited = key != 0xFFFFFFFFUL; // TLS_OUT_OF_INDEXES\n#else\n  inited = !pthread_key_create(&key, nullptr);\n#endif\n  return inited;\n}\n\ntemplate<typename T>\ninline T\nThreadLocal<T>::get() const\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n#ifdef XP_WIN\n  h.ptr = TlsGetValue(key);\n#else\n  h.ptr = pthread_getspecific(key);\n#endif\n  return h.value;\n}\n\ntemplate<typename T>\ninline void\nThreadLocal<T>::set(const T value)\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n  h.value = value;\n  bool succeeded;\n#ifdef XP_WIN\n  succeeded = TlsSetValue(key, h.ptr);\n#else\n  succeeded = !pthread_setspecific(key, h.ptr);\n#endif\n  if (!succeeded)\n    MOZ_CRASH();\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_ThreadLocal_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/TypeTraits.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Template-based metaprogramming and type-testing facilities. */\n\n#ifndef mozilla_TypeTraits_h\n#define mozilla_TypeTraits_h\n\n/*\n * These traits are approximate copies of the traits and semantics from C++11's\n * <type_traits> header.  Don't add traits not in that header!  When all\n * platforms provide that header, we can convert all users and remove this one.\n */\n\n#include <wchar.h>\n\nnamespace mozilla {\n\n/* Forward declarations. */\n\ntemplate<typename> struct RemoveCV;\n\n/* 20.9.3 Helper classes [meta.help] */\n\n/**\n * Helper class used as a base for various type traits, exposed publicly\n * because <type_traits> exposes it as well.\n */\ntemplate<typename T, T Value>\nstruct IntegralConstant\n{\n    static const T value = Value;\n    typedef T ValueType;\n    typedef IntegralConstant<T, Value> Type;\n};\n\n/** Convenient aliases. */\ntypedef IntegralConstant<bool, true> TrueType;\ntypedef IntegralConstant<bool, false> FalseType;\n\n/* 20.9.4 Unary type traits [meta.unary] */\n\n/* 20.9.4.1 Primary type categories [meta.unary.cat] */\n\nnamespace detail {\n\ntemplate <typename T>\nstruct IsIntegralHelper : FalseType {};\n\ntemplate<> struct IsIntegralHelper<char>               : TrueType {};\ntemplate<> struct IsIntegralHelper<signed char>        : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned char>      : TrueType {};\ntemplate<> struct IsIntegralHelper<short>              : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned short>     : TrueType {};\ntemplate<> struct IsIntegralHelper<int>                : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned int>       : TrueType {};\ntemplate<> struct IsIntegralHelper<long>               : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long>      : TrueType {};\ntemplate<> struct IsIntegralHelper<long long>          : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long long> : TrueType {};\ntemplate<> struct IsIntegralHelper<bool>               : TrueType {};\ntemplate<> struct IsIntegralHelper<wchar_t>            : TrueType {};\n\n} /* namespace detail */\n\n/**\n * IsIntegral determines whether a type is an integral type.\n *\n * mozilla::IsIntegral<int>::value is true;\n * mozilla::IsIntegral<unsigned short>::value is true;\n * mozilla::IsIntegral<const long>::value is true;\n * mozilla::IsIntegral<int*>::value is false;\n * mozilla::IsIntegral<double>::value is false;\n *\n * Note that the behavior of IsIntegral on char16_t and char32_t is\n * unspecified.\n */\ntemplate<typename T>\nstruct IsIntegral : detail::IsIntegralHelper<typename RemoveCV<T>::Type>\n{};\n\ntemplate<typename T, typename U>\nstruct IsSame;\n\nnamespace detail {\n\ntemplate<typename T>\nstruct IsFloatingPointHelper\n  : IntegralConstant<bool,\n                     IsSame<T, float>::value ||\n                     IsSame<T, double>::value ||\n                     IsSame<T, long double>::value>\n{};\n\n} // namespace detail\n\n/**\n * IsFloatingPoint determines whether a type is a floating point type (float,\n * double, long double).\n *\n * mozilla::IsFloatingPoint<int>::value is false;\n * mozilla::IsFloatingPoint<const float>::value is true;\n * mozilla::IsFloatingPoint<long double>::value is true;\n * mozilla::IsFloatingPoint<double*>::value is false.\n */\ntemplate<typename T>\nstruct IsFloatingPoint\n  : detail::IsFloatingPointHelper<typename RemoveCV<T>::Type>\n{};\n\n/**\n * IsPointer determines whether a type is a pointer type (but not a pointer-to-\n * member type).\n *\n * mozilla::IsPointer<struct S*>::value is true;\n * mozilla::IsPointer<int**>::value is true;\n * mozilla::IsPointer<void (*)(void)>::value is true;\n * mozilla::IsPointer<int>::value is false;\n * mozilla::IsPointer<struct S>::value is false.\n */\ntemplate<typename T>\nstruct IsPointer : FalseType {};\n\ntemplate<typename T>\nstruct IsPointer<T*> : TrueType {};\n\nnamespace detail {\n\n// __is_enum is a supported extension across all of our supported compilers.\ntemplate<typename T>\nstruct IsEnumHelper\n  : IntegralConstant<bool, __is_enum(T)>\n{};\n\n} // namespace detail\n\n/**\n * IsEnum determines whether a type is an enum type.\n *\n * mozilla::IsEnum<enum S>::value is true;\n * mozilla::IsEnum<enum S*>::value is false;\n * mozilla::IsEnum<int>::value is false;\n */\ntemplate<typename T>\nstruct IsEnum\n  : detail::IsEnumHelper<typename RemoveCV<T>::Type>\n{};\n\n/* 20.9.4.2 Composite type traits [meta.unary.comp] */\n\n/**\n * IsArithmetic determines whether a type is arithmetic.  A type is arithmetic\n * iff it is an integral type or a floating point type.\n *\n * mozilla::IsArithmetic<int>::value is true;\n * mozilla::IsArithmetic<double>::value is true;\n * mozilla::IsArithmetic<long double*>::value is false.\n */\ntemplate<typename T>\nstruct IsArithmetic\n  : IntegralConstant<bool, IsIntegral<T>::value || IsFloatingPoint<T>::value>\n{};\n\n/* 20.9.4.3 Type properties [meta.unary.prop] */\n\n/**\n * IsConst determines whether a type is const or not.\n *\n * mozilla::IsConst<int>::value is false;\n * mozilla::IsConst<void* const>::value is true;\n * mozilla::IsConst<const char*>::value is false.\n */\ntemplate<typename T>\nstruct IsConst : FalseType {};\n\ntemplate<typename T>\nstruct IsConst<const T> : TrueType {};\n\n/**\n * IsVolatile determines whether a type is volatile or not.\n *\n * mozilla::IsVolatile<int>::value is false;\n * mozilla::IsVolatile<void* volatile>::value is true;\n * mozilla::IsVolatile<volatile char*>::value is false.\n */\ntemplate<typename T>\nstruct IsVolatile : FalseType {};\n\ntemplate<typename T>\nstruct IsVolatile<volatile T> : TrueType {};\n\n/**\n * Traits class for identifying POD types.  Until C++11 there's no automatic\n * way to detect PODs, so for the moment this is done manually.  Users may\n * define specializations of this class that inherit from mozilla::TrueType and\n * mozilla::FalseType (or equivalently mozilla::IntegralConstant<bool, true or\n * false>, or conveniently from mozilla::IsPod for composite types) as needed to\n * ensure correct IsPod behavior.\n */\ntemplate<typename T>\nstruct IsPod : public FalseType {};\n\ntemplate<> struct IsPod<char>               : TrueType {};\ntemplate<> struct IsPod<signed char>        : TrueType {};\ntemplate<> struct IsPod<unsigned char>      : TrueType {};\ntemplate<> struct IsPod<short>              : TrueType {};\ntemplate<> struct IsPod<unsigned short>     : TrueType {};\ntemplate<> struct IsPod<int>                : TrueType {};\ntemplate<> struct IsPod<unsigned int>       : TrueType {};\ntemplate<> struct IsPod<long>               : TrueType {};\ntemplate<> struct IsPod<unsigned long>      : TrueType {};\ntemplate<> struct IsPod<long long>          : TrueType {};\ntemplate<> struct IsPod<unsigned long long> : TrueType {};\ntemplate<> struct IsPod<bool>               : TrueType {};\ntemplate<> struct IsPod<float>              : TrueType {};\ntemplate<> struct IsPod<double>             : TrueType {};\ntemplate<> struct IsPod<wchar_t>            : TrueType {};\ntemplate<typename T> struct IsPod<T*>       : TrueType {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsSignedHelper;\n\ntemplate<typename T>\nstruct IsSignedHelper<T, true> : TrueType {};\n\ntemplate<typename T>\nstruct IsSignedHelper<T, false>\n  : IntegralConstant<bool, IsArithmetic<T>::value && T(-1) < T(1)>\n{};\n\n} // namespace detail\n\n/**\n * IsSigned determines whether a type is a signed arithmetic type.  |char| is\n * considered a signed type if it has the same representation as |signed char|.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsSigned<int>::value is true;\n * mozilla::IsSigned<const unsigned int>::value is false;\n * mozilla::IsSigned<unsigned char>::value is false;\n * mozilla::IsSigned<float>::value is true.\n */\ntemplate<typename T>\nstruct IsSigned : detail::IsSignedHelper<T> {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsUnsignedHelper;\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, true> : FalseType {};\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, false>\n  : IntegralConstant<bool,\n                     IsArithmetic<T>::value &&\n                     (IsSame<typename RemoveCV<T>::Type, bool>::value ||\n                      T(1) < T(-1))>\n{};\n\n} // namespace detail\n\n/**\n * IsUnsigned determines whether a type is an unsigned arithmetic type.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsUnsigned<int>::value is false;\n * mozilla::IsUnsigned<const unsigned int>::value is true;\n * mozilla::IsUnsigned<unsigned char>::value is true;\n * mozilla::IsUnsigned<float>::value is false.\n */\ntemplate<typename T>\nstruct IsUnsigned : detail::IsUnsignedHelper<T> {};\n\n/* 20.9.5 Type property queries [meta.unary.prop.query] */\n\n/* 20.9.6 Relationships between types [meta.rel] */\n\n/**\n * IsSame tests whether two types are the same type.\n *\n * mozilla::IsSame<int, int>::value is true;\n * mozilla::IsSame<int*, int*>::value is true;\n * mozilla::IsSame<int, unsigned int>::value is false;\n * mozilla::IsSame<void, void>::value is true;\n * mozilla::IsSame<const int, int>::value is false;\n * mozilla::IsSame<struct S, struct S>::value is true.\n */\ntemplate<typename T, typename U>\nstruct IsSame : FalseType {};\n\ntemplate<typename T>\nstruct IsSame<T, T> : TrueType {};\n\nnamespace detail {\n\n// The trickery used to implement IsBaseOf here makes it possible to use it for\n// the cases of private and multiple inheritance.  This code was inspired by the\n// sample code here:\n//\n// http://stackoverflow.com/questions/2910979/how-is-base-of-works\ntemplate<class Base, class Derived>\nstruct BaseOfHelper\n{\n  public:\n    operator Base*() const;\n    operator Derived*();\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base, const Derived>\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base&, Derived&> : FalseType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, Type> : TrueType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, const Type> : TrueType {};\n\n} /* namespace detail */\n\n/*\n * IsBaseOf allows to know whether a given class is derived from another.\n *\n * Consider the following class definitions:\n *\n *   class A {};\n *   class B : public A {};\n *   class C {};\n *\n * mozilla::IsBaseOf<A, B>::value is true;\n * mozilla::IsBaseOf<A, C>::value is false;\n */\ntemplate<class Base, class Derived>\nstruct IsBaseOf\n  : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>\n{};\n\nnamespace detail {\n\ntemplate<typename From, typename To>\nstruct ConvertibleTester\n{\n  private:\n    static From create();\n\n    template<typename From1, typename To1>\n    static char test(To to);\n\n    template<typename From1, typename To1>\n    static int test(...);\n\n  public:\n    static const bool value =\n      sizeof(test<From, To>(create())) == sizeof(char);\n};\n\n} // namespace detail\n\n/**\n * IsConvertible determines whether a value of type From will implicitly convert\n * to a value of type To.  For example:\n *\n *   struct A {};\n *   struct B : public A {};\n *   struct C {};\n *\n * mozilla::IsConvertible<A, A>::value is true;\n * mozilla::IsConvertible<A*, A*>::value is true;\n * mozilla::IsConvertible<B, A>::value is true;\n * mozilla::IsConvertible<B*, A*>::value is true;\n * mozilla::IsConvertible<C, A>::value is false;\n * mozilla::IsConvertible<A, C>::value is false;\n * mozilla::IsConvertible<A*, C*>::value is false;\n * mozilla::IsConvertible<C*, A*>::value is false.\n *\n * For obscure reasons, you can't use IsConvertible when the types being tested\n * are related through private inheritance, and you'll get a compile error if\n * you try.  Just don't do it!\n */\ntemplate<typename From, typename To>\nstruct IsConvertible\n  : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>\n{};\n\n/* 20.9.7 Transformations between types [meta.trans] */\n\n/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */\n\n/**\n * RemoveConst removes top-level const qualifications on a type.\n *\n * mozilla::RemoveConst<int>::Type is int;\n * mozilla::RemoveConst<const int>::Type is int;\n * mozilla::RemoveConst<const int*>::Type is const int*;\n * mozilla::RemoveConst<int* const>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveConst\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveConst<const T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveVolatile removes top-level volatile qualifications on a type.\n *\n * mozilla::RemoveVolatile<int>::Type is int;\n * mozilla::RemoveVolatile<volatile int>::Type is int;\n * mozilla::RemoveVolatile<volatile int*>::Type is volatile int*;\n * mozilla::RemoveVolatile<int* volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveVolatile\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveVolatile<volatile T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveCV removes top-level const and volatile qualifications on a type.\n *\n * mozilla::RemoveCV<int>::Type is int;\n * mozilla::RemoveCV<const int>::Type is int;\n * mozilla::RemoveCV<volatile int>::Type is int;\n * mozilla::RemoveCV<int* const volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveCV\n{\n    typedef typename RemoveConst<typename RemoveVolatile<T>::Type>::Type Type;\n};\n\n/* 20.9.7.2 Reference modifications [meta.trans.ref] */\n\n/* 20.9.7.3 Sign modifications [meta.trans.sign] */\n\ntemplate<bool B, typename T = void>\nstruct EnableIf;\n\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional;\n\nnamespace detail {\n\ntemplate<bool MakeConst, typename T>\nstruct WithC : Conditional<MakeConst, const T, T>\n{};\n\ntemplate<bool MakeVolatile, typename T>\nstruct WithV : Conditional<MakeVolatile, volatile T, T>\n{};\n\n\ntemplate<bool MakeConst, bool MakeVolatile, typename T>\nstruct WithCV : WithC<MakeConst, typename WithV<MakeVolatile, T>::Type>\n{};\n\ntemplate<typename T>\nstruct CorrespondingSigned;\n\ntemplate<>\nstruct CorrespondingSigned<char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned short> { typedef short Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned int> { typedef int Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long> { typedef long Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long long> { typedef long long Type; };\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsSignedIntegerType = IsSigned<CVRemoved>::value &&\n                                    !IsSame<char, CVRemoved>::value>\nstruct MakeSigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingSigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeSigned produces the corresponding signed integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already a signed integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an unsigned integer type, the signed variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the integral type of the same size as T, with the lowest rank,\n * with T's const/volatile qualifiers, is produced.  (This basically only acts\n * to produce signed char when T = char.)\n *\n * mozilla::MakeSigned<unsigned long>::Type is signed long;\n * mozilla::MakeSigned<volatile int>::Type is volatile int;\n * mozilla::MakeSigned<const unsigned short>::Type is const signed short;\n * mozilla::MakeSigned<const char>::Type is const signed char;\n * mozilla::MakeSigned<bool> is an error;\n * mozilla::MakeSigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeSigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeSigned<T>\n            >::Type\n{};\n\nnamespace detail {\n\ntemplate<typename T>\nstruct CorrespondingUnsigned;\n\ntemplate<>\nstruct CorrespondingUnsigned<char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<signed char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<short> { typedef unsigned short Type; };\ntemplate<>\nstruct CorrespondingUnsigned<int> { typedef unsigned int Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long> { typedef unsigned long Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long long> { typedef unsigned long long Type; };\n\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsUnsignedIntegerType = IsUnsigned<CVRemoved>::value &&\n                                      !IsSame<char, CVRemoved>::value>\nstruct MakeUnsigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingUnsigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeUnsigned produces the corresponding unsigned integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already an unsigned integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an signed integer type, the unsigned variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the unsigned integral type of the same size as T, with the lowest\n * rank, with T's const/volatile qualifiers, is produced.  (This basically only\n * acts to produce unsigned char when T = char.)\n *\n * mozilla::MakeUnsigned<signed long>::Type is unsigned long;\n * mozilla::MakeUnsigned<volatile unsigned int>::Type is volatile unsigned int;\n * mozilla::MakeUnsigned<const signed short>::Type is const unsigned short;\n * mozilla::MakeUnsigned<const char>::Type is const unsigned char;\n * mozilla::MakeUnsigned<bool> is an error;\n * mozilla::MakeUnsigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeUnsigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeUnsigned<T>\n            >::Type\n{};\n\n/* 20.9.7.4 Array modifications [meta.trans.arr] */\n\n/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */\n\n/* 20.9.7.6 Other transformations [meta.trans.other] */\n\n/**\n * EnableIf is a struct containing a typedef of T if and only if B is true.\n *\n * mozilla::EnableIf<true, int>::Type is int;\n * mozilla::EnableIf<false, int>::Type is a compile-time error.\n *\n * Use this template to implement SFINAE-style (Substitution Failure Is not An\n * Error) requirements.  For example, you might use it to impose a restriction\n * on a template parameter:\n *\n *   template<typename T>\n *   class PodVector // vector optimized to store POD (memcpy-able) types\n *   {\n *      EnableIf<IsPod<T>::value, T>::Type* vector;\n *      size_t length;\n *      ...\n *   };\n */\ntemplate<bool B, typename T>\nstruct EnableIf\n{};\n\ntemplate<typename T>\nstruct EnableIf<true, T>\n{\n    typedef T Type;\n};\n\n/**\n * Conditional selects a class between two, depending on a given boolean value.\n *\n * mozilla::Conditional<true, A, B>::Type is A;\n * mozilla::Conditional<false, A, B>::Type is B;\n */\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional\n{\n    typedef A Type;\n};\n\ntemplate<class A, class B>\nstruct Conditional<false, A, B>\n{\n    typedef B Type;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_TypeTraits_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/TypedEnum.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Macros to emulate C++11 typed enums and enum classes. */\n\n#ifndef mozilla_TypedEnum_h\n#define mozilla_TypedEnum_h\n\n#include \"mozilla/Attributes.h\"\n\n#if defined(__cplusplus)\n\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_strong_enums)\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)\n#      define MOZ_HAVE_CXX11_ENUM_TYPE\n#      define MOZ_HAVE_CXX11_STRONG_ENUMS\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1400\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#  endif\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#endif\n\n/**\n * MOZ_ENUM_TYPE specifies the underlying numeric type for an enum.  It's\n * specified by placing MOZ_ENUM_TYPE(type) immediately after the enum name in\n * its declaration, and before the opening curly brace, like\n *\n *   enum MyEnum MOZ_ENUM_TYPE(uint16_t)\n *   {\n *     A,\n *     B = 7,\n *     C\n *   };\n *\n * In supporting compilers, the macro will expand to \": uint16_t\".  The\n * compiler will allocate exactly two bytes for MyEnum and will require all\n * enumerators to have values between 0 and 65535.  (Thus specifying \"B =\n * 100000\" instead of \"B = 7\" would fail to compile.)  In old compilers the\n * macro expands to the empty string, and the underlying type is generally\n * undefined.\n */\n#ifdef MOZ_HAVE_CXX11_ENUM_TYPE\n#  define MOZ_ENUM_TYPE(type)   : type\n#else\n#  define MOZ_ENUM_TYPE(type)   /* no support */\n#endif\n\n/**\n * MOZ_BEGIN_ENUM_CLASS and MOZ_END_ENUM_CLASS provide access to the\n * strongly-typed enumeration feature of C++11 (\"enum class\").  If supported\n * by the compiler, an enum defined using these macros will not be implicitly\n * converted to any other type, and its enumerators will be scoped using the\n * enumeration name.  Place MOZ_BEGIN_ENUM_CLASS(EnumName, type) in place of\n * \"enum EnumName {\", and MOZ_END_ENUM_CLASS(EnumName) in place of the closing\n * \"};\".  For example,\n *\n *   MOZ_BEGIN_ENUM_CLASS(Enum, int32_t)\n *     A,\n *     B = 6\n *   MOZ_END_ENUM_CLASS(Enum)\n *\n * This will make \"Enum::A\" and \"Enum::B\" appear in the global scope, but \"A\"\n * and \"B\" will not.  In compilers that support C++11 strongly-typed\n * enumerations, implicit conversions of Enum values to numeric types will\n * fail.  In other compilers, Enum itself will actually be defined as a class,\n * and some implicit conversions will fail while others will succeed.\n *\n * The type argument specifies the underlying type for the enum where\n * supported, as with MOZ_ENUM_TYPE().  For simplicity, it is currently\n * mandatory.  As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do\n * not support it.\n *\n * MOZ_{BEGIN,END}_ENUM_CLASS doesn't work for defining enum classes nested\n * inside classes.  To define an enum class nested inside another class, use\n * MOZ_{BEGIN,END}_NESTED_ENUM_CLASS, and place a MOZ_FINISH_NESTED_ENUM_CLASS\n * in namespace scope to handle bits that can only be implemented with\n * namespace-scoped code.  For example:\n *\n *   class FooBar {\n *\n *     MOZ_BEGIN_NESTED_ENUM_CLASS(Enum, int32_t)\n *       A,\n *       B = 6\n *     MOZ_END_NESTED_ENUM_CLASS(Enum)\n *\n *   };\n *\n *   MOZ_FINISH_NESTED_ENUM_CLASS(FooBar::Enum)\n */\n#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS)\n  /*\n   * All compilers that support strong enums also support an explicit\n   * underlying type, so no extra check is needed.\n   */\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     enum class Name : type {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) /* nothing */\n#else\n   /**\n    * We need Name to both name a type, and scope the provided enumerator\n    * names.  Namespaces and classes both provide scoping, but namespaces\n    * aren't types, so we need to use a class that wraps the enum values.  We\n    * have an implicit conversion from the inner enum type to the class, so\n    * statements like\n    *\n    *   Enum x = Enum::A;\n    *\n    * will still work.  We need to define an implicit conversion from the class\n    * to the inner enum as well, so that (for instance) switch statements will\n    * work.  This means that the class can be implicitly converted to a numeric\n    * value as well via the enum type, since C++ allows an implicit\n    * user-defined conversion followed by a standard conversion to still be\n    * implicit.\n    *\n    * We have an explicit constructor from int defined, so that casts like\n    * (Enum)7 will still work.  We also have a zero-argument constructor with\n    * no arguments, so declaration without initialization (like \"Enum foo;\")\n    * will work.\n    *\n    * Additionally, we'll delete as many operators as possible for the inner\n    * enum type, so statements like this will still fail:\n    *\n    *   f(5 + Enum::B); // deleted operator+\n    *\n    * But we can't prevent things like this, because C++ doesn't allow\n    * overriding conversions or assignment operators for enums:\n    *\n    *   int x = Enum::A;\n    *   int f()\n    *   {\n    *     return Enum::A;\n    *   }\n    */\\\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     class Name \\\n     { \\\n       public: \\\n         enum Enum MOZ_ENUM_TYPE(type) \\\n         {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n         }; \\\n         Name() {} \\\n         Name(Enum aEnum) : mEnum(aEnum) {} \\\n         explicit Name(int num) : mEnum((Enum)num) {} \\\n         operator Enum() const { return mEnum; } \\\n       private: \\\n         Enum mEnum; \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) \\\n     inline int operator+(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator-(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator*(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator*(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator/(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator/(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator%(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator%(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator++(Name::Enum&) MOZ_DELETE; \\\n     inline int operator++(Name::Enum&, int) MOZ_DELETE; \\\n     inline int& operator--(Name::Enum&) MOZ_DELETE; \\\n     inline int operator--(Name::Enum&, int) MOZ_DELETE; \\\n     inline bool operator==(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator==(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator!=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!(const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline bool operator||(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator||(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline int operator~(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator|(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator|(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator^(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator^(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator<<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator<<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator>>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator>>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int& operator+=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator-=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator*=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator/=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator%=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator&=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator|=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator^=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator<<=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator>>=(int&, const Name::Enum&) MOZ_DELETE;\n#endif\n#  define MOZ_BEGIN_ENUM_CLASS(Name, type) MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type)\n#  define MOZ_END_ENUM_CLASS(Name) \\\n     MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     MOZ_FINISH_NESTED_ENUM_CLASS(Name)\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_TypedEnum_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Types.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt foundational types and macros. */\n\n#ifndef mozilla_Types_h\n#define mozilla_Types_h\n\n/*\n * This header must be valid C and C++, includable by code embedding either\n * SpiderMonkey or Gecko.\n */\n\n/* Expose all <stdint.h> types and size_t. */\n#include <stddef.h>\n#include <stdint.h>\n\n/* Implement compiler and linker macros needed for APIs. */\n\n/*\n * MOZ_EXPORT is used to declare and define a symbol or type which is externally\n * visible to users of the current library.  It encapsulates various decorations\n * needed to properly export the method's symbol.\n *\n *   api.h:\n *     extern MOZ_EXPORT int MeaningOfLife(void);\n *     extern MOZ_EXPORT int LuggageCombination;\n *\n *   api.c:\n *     int MeaningOfLife(void) { return 42; }\n *     int LuggageCombination = 12345;\n *\n * If you are merely sharing a method across files, just use plain |extern|.\n * These macros are designed for use by library interfaces -- not for normal\n * methods or data used cross-file.\n */\n#if defined(WIN32) || defined(XP_OS2)\n#  define MOZ_EXPORT   __declspec(dllexport)\n#else /* Unix */\n#  ifdef HAVE_VISIBILITY_ATTRIBUTE\n#    define MOZ_EXPORT       __attribute__((visibility(\"default\")))\n#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n#    define MOZ_EXPORT      __global\n#  else\n#    define MOZ_EXPORT /* nothing */\n#  endif\n#endif\n\n\n/*\n * Whereas implementers use MOZ_EXPORT to declare and define library symbols,\n * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the\n * implementer of the library will expose an API macro which expands to either\n * the export or import version of the macro, depending upon the compilation\n * mode.\n */\n#ifdef _WIN32\n#  if defined(__MWERKS__)\n#    define MOZ_IMPORT_API /* nothing */\n#  else\n#    define MOZ_IMPORT_API __declspec(dllimport)\n#  endif\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_API  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_API MOZ_EXPORT\n#endif\n\n#if defined(_WIN32) && !defined(__MWERKS__)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_DATA  MOZ_EXPORT\n#endif\n\n/*\n * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose\n * export mfbt declarations when building mfbt, and they expose import mfbt\n * declarations when using mfbt.\n */\n#if defined(IMPL_MFBT)\n#  define MFBT_API     MOZ_EXPORT\n#  define MFBT_DATA    MOZ_EXPORT\n#else\n  /*\n   * On linux mozglue is linked in the program and we link libxul.so with\n   * -z,defs. Normally that causes the linker to reject undefined references in\n   * libxul.so, but as a loophole it allows undefined references to weak\n   * symbols. We add the weak attribute to the import version of the MFBT API\n   * macros to exploit this.\n   */\n#  if defined(MOZ_GLUE_IN_PROGRAM)\n#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API\n#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA\n#  else\n#    define MFBT_API   MOZ_IMPORT_API\n#    define MFBT_DATA  MOZ_IMPORT_DATA\n#  endif\n#endif\n\n/*\n * C symbols in C++ code must be declared immediately within |extern \"C\"|\n * blocks.  However, in C code, they need not be declared specially.  This\n * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C\n * macros, so that the user need not know whether he is being used in C or C++\n * code.\n *\n *   MOZ_BEGIN_EXTERN_C\n *\n *   extern MOZ_EXPORT int MostRandomNumber(void);\n *   ...other declarations...\n *\n *   MOZ_END_EXTERN_C\n *\n * This said, it is preferable to just use |extern \"C\"| in C++ header files for\n * its greater clarity.\n */\n#ifdef __cplusplus\n#  define MOZ_BEGIN_EXTERN_C    extern \"C\" {\n#  define MOZ_END_EXTERN_C      }\n#else\n#  define MOZ_BEGIN_EXTERN_C\n#  define MOZ_END_EXTERN_C\n#endif\n\n/*\n * GCC's typeof is available when decltype is not.\n */\n#if defined(__GNUC__) && defined(__cplusplus) && \\\n  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L\n#  define decltype __typeof__\n#endif\n\n#endif /* mozilla_Types_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Util.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Miscellaneous uncategorized functionality.  Please add new functionality to\n * new headers, or to other appropriate existing headers, not here.\n */\n\n#ifndef mozilla_Util_h\n#define mozilla_Util_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many \n * bytes of alignment a given type needs.\n */\ntemplate<class T>\nclass AlignmentFinder\n{\n    struct Aligner\n    {\n        char c;\n        T t;\n    };\n\n  public:\n    static const size_t alignment = sizeof(Aligner) - sizeof(T);\n};\n\n#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment\n\n/*\n * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.\n *\n * For instance,\n *\n *   MOZ_ALIGNED_DECL(char arr[2], 8);\n *\n * will declare a two-character array |arr| aligned to 8 bytes.\n */\n\n#if defined(__GNUC__)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     _type __attribute__((aligned(_align)))\n#elif defined(_MSC_VER)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     __declspec(align(_align)) _type\n#else\n#  warning \"We don't know how to align variables on this compiler.\"\n#  define MOZ_ALIGNED_DECL(_type, _align) _type\n#endif\n\n/*\n * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N\n * bytes.\n *\n * We support 1, 2, 4, 8, and 16-bit alignment.\n */\ntemplate<size_t align>\nstruct AlignedElem;\n\n/*\n * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where\n * foo is a template parameter.\n */\n\ntemplate<>\nstruct AlignedElem<1>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 1);\n};\n\ntemplate<>\nstruct AlignedElem<2>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 2);\n};\n\ntemplate<>\nstruct AlignedElem<4>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 4);\n};\n\ntemplate<>\nstruct AlignedElem<8>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 8);\n};\n\ntemplate<>\nstruct AlignedElem<16>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 16);\n};\n\n/*\n * This utility pales in comparison to Boost's aligned_storage. The utility\n * simply assumes that uint64_t is enough alignment for anyone. This may need\n * to be extended one day...\n *\n * As an important side effect, pulling the storage into this template is\n * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving\n * false negatives when we cast from the char buffer to whatever type we've\n * constructed using the bytes.\n */\ntemplate<size_t nbytes>\nstruct AlignedStorage\n{\n    union U {\n      char bytes[nbytes];\n      uint64_t _;\n    } u;\n\n    const void* addr() const { return u.bytes; }\n    void* addr() { return u.bytes; }\n};\n\ntemplate<class T>\nstruct AlignedStorage2\n{\n    union U {\n      char bytes[sizeof(T)];\n      uint64_t _;\n    } u;\n\n    const T* addr() const { return reinterpret_cast<const T*>(u.bytes); }\n    T* addr() { return static_cast<T*>(static_cast<void*>(u.bytes)); }\n};\n\n/*\n * Small utility for lazily constructing objects without using dynamic storage.\n * When a Maybe<T> is constructed, it is |empty()|, i.e., no value of T has\n * been constructed and no T destructor will be called when the Maybe<T> is\n * destroyed. Upon calling |construct|, a T object will be constructed with the\n * given arguments and that object will be destroyed when the owning Maybe<T>\n * is destroyed.\n *\n * N.B. GCC seems to miss some optimizations with Maybe and may generate extra\n * branches/loads/stores. Use with caution on hot paths.\n */\ntemplate<class T>\nclass Maybe\n{\n    AlignedStorage2<T> storage;\n    bool constructed;\n\n    T& asT() { return *storage.addr(); }\n\n  public:\n    Maybe() { constructed = false; }\n    ~Maybe() { if (constructed) asT().~T(); }\n\n    bool empty() const { return !constructed; }\n\n    void construct() {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T();\n      constructed = true;\n    }\n\n    template<class T1>\n    void construct(const T1& t1) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1);\n      constructed = true;\n    }\n\n    template<class T1, class T2>\n    void construct(const T1& t1, const T2& t2) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3>\n    void construct(const T1& t1, const T2& t2, const T3& t3) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9, class T10>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);\n      constructed = true;\n    }\n\n    T* addr() {\n      MOZ_ASSERT(constructed);\n      return &asT();\n    }\n\n    T& ref() {\n      MOZ_ASSERT(constructed);\n      return asT();\n    }\n\n    const T& ref() const {\n      MOZ_ASSERT(constructed);\n      return const_cast<Maybe*>(this)->asT();\n    }\n\n    void destroy() {\n      ref().~T();\n      constructed = false;\n    }\n\n    void destroyIfConstructed() {\n      if (!empty())\n        destroy();\n    }\n\n  private:\n    Maybe(const Maybe& other) MOZ_DELETE;\n    const Maybe& operator=(const Maybe& other) MOZ_DELETE;\n};\n\n/*\n * Safely subtract two pointers when it is known that end >= begin.  This avoids\n * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB\n * set, the unsigned subtraction followed by right shift will produce -1, or\n * size_t(-1), instead of the real difference.\n */\ntemplate<class T>\nMOZ_ALWAYS_INLINE size_t\nPointerRangeSize(T* begin, T* end)\n{\n  MOZ_ASSERT(end >= begin);\n  return (size_t(end) - size_t(begin)) / sizeof(T);\n}\n\n/*\n * Compute the length of an array with constant length.  (Use of this method\n * with a non-array pointer will not compile.)\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR size_t\nArrayLength(T (&arr)[N])\n{\n  return N;\n}\n\n/*\n * Compute the address one past the last element of a constant-length array.\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR T*\nArrayEnd(T (&arr)[N])\n{\n  return arr + ArrayLength(arr);\n}\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n/*\n * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files\n * that can't use C++ template functions and for static_assert() calls that\n * can't call ArrayLength() when it is not a C++11 constexpr function.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_ARRAY_LENGTH(array)   mozilla::ArrayLength(array)\n#else\n#  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))\n#endif\n\n#endif /* mozilla_Util_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type/length-parametrized vector class. */\n\n#ifndef mozilla_Vector_h\n#define mozilla_Vector_h\n\n#include \"mozilla/AllocPolicy.h\"\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/MathAlgorithms.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include <new> // for placement new\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace mozilla {\n\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase;\n\nnamespace detail {\n\n/*\n * Check that the given capacity wastes the minimal amount of space if\n * allocated on the heap.  This means that cap*sizeof(T) is as close to a\n * power-of-two as possible.  growStorageBy() is responsible for ensuring\n * this.\n */\ntemplate<typename T>\nstatic bool CapacityHasExcessSpace(size_t cap)\n{\n  size_t size = cap * sizeof(T);\n  return RoundUpPow2(size) - size >= sizeof(T);\n}\n\n/*\n * This template class provides a default implementation for vector operations\n * when the element type is not known to be a POD, as judged by IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector, bool IsPod>\nstruct VectorImpl\n{\n    /* Destroys constructed objects in the range [begin, end). */\n    static inline void destroy(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        p->~T();\n    }\n\n    /* Constructs objects in the uninitialized range [begin, end). */\n    static inline void initialize(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(*p);\n    }\n\n    /*\n     * Move-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(Move(*p));\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range [dst, dst+n) from the\n     * same object u.\n     */\n    template<typename U>\n    static inline void copyConstructN(T* dst, size_t n, const U& u) {\n      for (T* end = dst + n; dst < end; ++dst)\n        new(dst) T(u);\n    }\n\n    /*\n     * Grows the given buffer to have capacity newCap, preserving the objects\n     * constructed in the range [begin, end) and updating v. Assumes that (1)\n     * newCap has not overflowed, and (2) multiplying newCap by sizeof(T) will\n     * not overflow.\n     */\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      T* newbuf = reinterpret_cast<T*>(v.malloc_(newCap * sizeof(T)));\n      if (!newbuf)\n        return false;\n      T* dst = newbuf;\n      T* src = v.beginNoCheck();\n      for (; src < v.endNoCheck(); ++dst, ++src)\n        new(dst) T(Move(*src));\n      VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck());\n      v.free_(v.mBegin);\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n/*\n * This partial template specialization provides a default implementation for\n * vector operations when the element type is known to be a POD, as judged by\n * IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector>\nstruct VectorImpl<T, N, AP, ThisVector, true>\n{\n    static inline void destroy(T*, T*) {}\n\n    static inline void initialize(T* begin, T* end) {\n      /*\n       * You would think that memset would be a big win (or even break even)\n       * when we know T is a POD. But currently it's not. This is probably\n       * because |append| tends to be given small ranges and memset requires\n       * a function call that doesn't get inlined.\n       *\n       * memset(begin, 0, sizeof(T) * (end-begin));\n       */\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      /*\n       * See above memset comment. Also, notice that copyConstruct is\n       * currently templated (T != U), so memcpy won't work without\n       * requiring T == U.\n       *\n       * memcpy(dst, srcbeg, sizeof(T) * (srcend - srcbeg));\n       */\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        *dst = *p;\n    }\n\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      copyConstruct(dst, srcbeg, srcend);\n    }\n\n    static inline void copyConstructN(T* dst, size_t n, const T& t) {\n      for (T* end = dst + n; dst < end; ++dst)\n        *dst = t;\n    }\n\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      size_t oldSize = sizeof(T) * v.mCapacity;\n      size_t newSize = sizeof(T) * newCap;\n      T* newbuf = reinterpret_cast<T*>(v.realloc_(v.mBegin, oldSize, newSize));\n      if (!newbuf)\n        return false;\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n} // namespace detail\n\n/*\n * A CRTP base class for vector-like classes.  Unless you really really want\n * your own vector class -- and you almost certainly don't -- you should use\n * mozilla::Vector instead!\n *\n * See mozilla::Vector for interface requirements.\n */\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase : private AllocPolicy\n{\n    /* utilities */\n\n    static const bool sElemIsPod = IsPod<T>::value;\n    typedef detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod> Impl;\n    friend struct detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod>;\n\n    bool growStorageBy(size_t incr);\n    bool convertToHeapStorage(size_t newCap);\n\n    /* magic constants */\n\n    static const int sMaxInlineBytes = 1024;\n\n    /* compute constants */\n\n    /*\n     * Consider element size to be 1 for buffer sizing if there are 0 inline\n     * elements.  This allows us to compile when the definition of the element\n     * type is not visible here.\n     *\n     * Explicit specialization is only allowed at namespace scope, so in order\n     * to keep everything here, we use a dummy template parameter with partial\n     * specialization.\n     */\n    template<int M, int Dummy>\n    struct ElemSize\n    {\n        static const size_t value = sizeof(T);\n    };\n    template<int Dummy>\n    struct ElemSize<0, Dummy>\n    {\n        static const size_t value = 1;\n    };\n\n    static const size_t sInlineCapacity =\n      tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::value>::value;\n\n    /* Calculate inline buffer size; avoid 0-sized array. */\n    static const size_t sInlineBytes =\n      tl::Max<1, sInlineCapacity * ElemSize<N, 0>::value>::value;\n\n    /* member data */\n\n    /*\n     * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,\n     * mBegin + mLength) hold valid constructed T objects. The range [mBegin +\n     * mLength, mBegin + mCapacity) holds uninitialized memory. The range\n     * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory\n     * previously allocated by a call to reserve().\n     */\n    T* mBegin;\n\n    /* Number of elements in the vector. */\n    size_t mLength;\n\n    /* Max number of elements storable in the vector without resizing. */\n    size_t mCapacity;\n\n#ifdef DEBUG\n    /* Max elements of reserved or used space in this vector. */\n    size_t mReserved;\n#endif\n\n    /* Memory used for inline storage. */\n    AlignedStorage<sInlineBytes> storage;\n\n#ifdef DEBUG\n    friend class ReentrancyGuard;\n    bool entered;\n#endif\n\n    /* private accessors */\n\n    bool usingInlineStorage() const {\n      return mBegin == const_cast<VectorBase*>(this)->inlineStorage();\n    }\n\n    T* inlineStorage() {\n      return static_cast<T*>(storage.addr());\n    }\n\n    T* beginNoCheck() const {\n      return mBegin;\n    }\n\n    T* endNoCheck() {\n      return mBegin + mLength;\n    }\n\n    const T* endNoCheck() const {\n      return mBegin + mLength;\n    }\n\n#ifdef DEBUG\n    size_t reserved() const {\n      MOZ_ASSERT(mReserved <= mCapacity);\n      MOZ_ASSERT(mLength <= mReserved);\n      return mReserved;\n    }\n#endif\n\n    /* Append operations guaranteed to succeed due to pre-reserved space. */\n    template<typename U> void internalAppend(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    void internalAppendAll(const VectorBase<U, O, BP, UV>& u);\n    void internalAppendN(const T& t, size_t n);\n    template<typename U> void internalAppend(const U* begin, size_t length);\n\n  public:\n    static const size_t sMaxInlineStorage = N;\n\n    typedef T ElementType;\n\n    VectorBase(AllocPolicy = AllocPolicy());\n    VectorBase(MoveRef<ThisVector>); /* Move constructor. */\n    ThisVector& operator=(MoveRef<ThisVector>); /* Move assignment. */\n    ~VectorBase();\n\n    /* accessors */\n\n    const AllocPolicy& allocPolicy() const {\n      return *this;\n    }\n\n    AllocPolicy& allocPolicy() {\n      return *this;\n    }\n\n    enum { InlineLength = N };\n\n    size_t length() const {\n      return mLength;\n    }\n\n    bool empty() const {\n      return mLength == 0;\n    }\n\n    size_t capacity() const {\n      return mCapacity;\n    }\n\n    T* begin() {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    const T* begin() const {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    T* end() {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    const T* end() const {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    T& operator[](size_t i) {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    T& back() {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    const T& back() const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    class Range\n    {\n        friend class VectorBase;\n        T* cur_;\n        T* end_;\n        Range(T* cur, T* end) : cur_(cur), end_(end) {}\n\n      public:\n        Range() {}\n        bool empty() const { return cur_ == end_; }\n        size_t remain() const { return end_ - cur_; }\n        T& front() const { return *cur_; }\n        void popFront() { MOZ_ASSERT(!empty()); ++cur_; }\n        T popCopyFront() { MOZ_ASSERT(!empty()); return *cur_++; }\n    };\n\n    Range all() {\n      return Range(begin(), end());\n    }\n\n    /* mutators */\n\n    /**\n     * Given that the vector is empty and has no inline storage, grow to\n     * |capacity|.\n     */\n    bool initCapacity(size_t request);\n\n    /**\n     * If reserve(length() + N) succeeds, the N next appends are guaranteed to\n     * succeed.\n     */\n    bool reserve(size_t request);\n\n    /**\n     * Destroy elements in the range [end() - incr, end()). Does not deallocate\n     * or unreserve storage for those elements.\n     */\n    void shrinkBy(size_t incr);\n\n    /** Grow the vector by incr elements. */\n    bool growBy(size_t incr);\n\n    /** Call shrinkBy or growBy based on whether newSize > length(). */\n    bool resize(size_t newLength);\n\n    /**\n     * Increase the length of the vector, but don't initialize the new elements\n     * -- leave them as uninitialized memory.\n     */\n    bool growByUninitialized(size_t incr);\n    bool resizeUninitialized(size_t newLength);\n\n    /** Shorthand for shrinkBy(length()). */\n    void clear();\n\n    /** Clears and releases any heap-allocated storage. */\n    void clearAndFree();\n\n    /**\n     * If true, appending |needed| elements won't reallocate elements storage.\n     * This *doesn't* mean that infallibleAppend may be used!  You still must\n     * reserve the extra space, even if this method indicates that appends won't\n     * need to reallocate elements storage.\n     */\n    bool canAppendWithoutRealloc(size_t needed) const;\n\n    /**\n     * Potentially fallible append operations.\n     *\n     * The function templates that take an unspecified type U require a const T&\n     * or a MoveRef<T>.  The MoveRef<T> variants move their operands into the\n     * vector, instead of copying them.  If they fail, the operand is left\n     * unmoved.\n     */\n    template<typename U> bool append(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    bool appendAll(const VectorBase<U, O, BP, UV>& u);\n    bool appendN(const T& t, size_t n);\n    template<typename U> bool append(const U* begin, const U* end);\n    template<typename U> bool append(const U* begin, size_t length);\n\n    /*\n     * Guaranteed-infallible append operations for use upon vectors whose\n     * memory has been pre-reserved.  Don't use this if you haven't reserved the\n     * memory!\n     */\n    template<typename U> void infallibleAppend(const U& u) {\n      internalAppend(u);\n    }\n    void infallibleAppendN(const T& t, size_t n) {\n      internalAppendN(t, n);\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) {\n      internalAppend(aBegin, PointerRangeSize(aBegin, aEnd));\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, size_t aLength) {\n      internalAppend(aBegin, aLength);\n    }\n\n    void popBack();\n\n    T popCopy();\n\n    /**\n     * Transfers ownership of the internal buffer used by this vector to the\n     * caller.  (It's the caller's responsibility to properly deallocate this\n     * buffer, in accordance with this vector's AllocPolicy.)  After this call,\n     * the vector is empty.  Since the returned buffer may need to be allocated\n     * (if the elements are currently stored in-place), the call can fail,\n     * returning nullptr.\n     *\n     * N.B. Although a T*, only the range [0, length()) is constructed.\n     */\n    T* extractRawBuffer();\n\n    /**\n     * Transfer ownership of an array of objects into the vector.  The caller\n     * must have allocated the array in accordance with this vector's\n     * AllocPolicy.\n     *\n     * N.B. This call assumes that there are no uninitialized elements in the\n     *      passed array.\n     */\n    void replaceRawBuffer(T* p, size_t length);\n\n    /**\n     * Places |val| at position |p|, shifting existing elements from |p| onward\n     * one position higher.  On success, |p| should not be reused because it'll\n     * be a dangling pointer if reallocation of the vector storage occurred; the\n     * return value should be used instead.  On failure, nullptr is returned.\n     *\n     * Example usage:\n     *\n     *   if (!(p = vec.insert(p, val)))\n     *     <handle failure>\n     *   <keep working with p>\n     *\n     * This is inherently a linear-time operation.  Be careful!\n     */\n    T* insert(T* p, const T& val);\n\n    /**\n     * Removes the element |t|, which must fall in the bounds [begin, end),\n     * shifting existing elements from |t + 1| onward one position lower.\n     */\n    void erase(T* t);\n\n    /**\n     * Measure the size of the vector's heap-allocated storage.\n     */\n    size_t sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const;\n\n    /**\n     * Like sizeOfExcludingThis, but also measures the size of the vector\n     * object (which must be heap-allocated) itself.\n     */\n    size_t sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const;\n\n    void swap(ThisVector& other);\n\n  private:\n    VectorBase(const ThisVector&) MOZ_DELETE;\n    void operator=(const ThisVector&) MOZ_DELETE;\n};\n\n/* This does the re-entrancy check plus several other sanity checks. */\n#define MOZ_REENTRANCY_GUARD_ET_AL \\\n  ReentrancyGuard g(*this); \\\n  MOZ_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); \\\n  MOZ_ASSERT(reserved() <= mCapacity); \\\n  MOZ_ASSERT(mLength <= reserved()); \\\n  MOZ_ASSERT(mLength <= mCapacity)\n\n/* Vector Implementation */\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::VectorBase(AP ap)\n  : AP(ap),\n    mBegin(static_cast<T*>(storage.addr())),\n    mLength(0),\n    mCapacity(sInlineCapacity)\n#ifdef DEBUG\n  , mReserved(sInlineCapacity),\n    entered(false)\n#endif\n{}\n\n/* Move constructor. */\ntemplate<typename T, size_t N, class AllocPolicy, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AllocPolicy, TV>::VectorBase(MoveRef<TV> rhs)\n  : AllocPolicy(rhs)\n#ifdef DEBUG\n    , entered(false)\n#endif\n{\n  mLength = rhs->mLength;\n  mCapacity = rhs->mCapacity;\n#ifdef DEBUG\n  mReserved = rhs->mReserved;\n#endif\n\n  if (rhs->usingInlineStorage()) {\n    /* We can't move the buffer over in this case, so copy elements. */\n    mBegin = static_cast<T*>(storage.addr());\n    Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck());\n    /*\n     * Leave rhs's mLength, mBegin, mCapacity, and mReserved as they are.\n     * The elements in its in-line storage still need to be destroyed.\n     */\n  } else {\n    /*\n     * Take src's buffer, and turn src into an empty vector using\n     * in-line storage.\n     */\n    mBegin = rhs->mBegin;\n    rhs->mBegin = static_cast<T*>(rhs->storage.addr());\n    rhs->mCapacity = sInlineCapacity;\n    rhs->mLength = 0;\n#ifdef DEBUG\n    rhs->mReserved = sInlineCapacity;\n#endif\n  }\n}\n\n/* Move assignment. */\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nTV&\nVectorBase<T, N, AP, TV>::operator=(MoveRef<TV> rhs)\n{\n  TV* tv = static_cast<TV*>(this);\n  tv->~TV();\n  new(tv) TV(rhs);\n  return *tv;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::~VectorBase()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n}\n\n/*\n * This function will create a new heap buffer with capacity newCap,\n * move all elements in the inline buffer to this new buffer,\n * and fail on OOM.\n */\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::convertToHeapStorage(size_t newCap)\n{\n  MOZ_ASSERT(usingInlineStorage());\n\n  /* Allocate buffer. */\n  MOZ_ASSERT(!detail::CapacityHasExcessSpace<T>(newCap));\n  T* newBuf = reinterpret_cast<T*>(this->malloc_(newCap * sizeof(T)));\n  if (!newBuf)\n    return false;\n\n  /* Copy inline elements into heap buffer. */\n  Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());\n  Impl::destroy(beginNoCheck(), endNoCheck());\n\n  /* Switch in heap buffer. */\n  mBegin = newBuf;\n  /* mLength is unchanged. */\n  mCapacity = newCap;\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_NEVER_INLINE bool\nVectorBase<T, N, AP, TV>::growStorageBy(size_t incr)\n{\n  MOZ_ASSERT(mLength + incr > mCapacity);\n  MOZ_ASSERT_IF(!usingInlineStorage(),\n                !detail::CapacityHasExcessSpace<T>(mCapacity));\n\n  /*\n   * When choosing a new capacity, its size should is as close to 2**N bytes\n   * as possible.  2**N-sized requests are best because they are unlikely to\n   * be rounded up by the allocator.  Asking for a 2**N number of elements\n   * isn't as good, because if sizeof(T) is not a power-of-two that would\n   * result in a non-2**N request size.\n   */\n\n  size_t newCap;\n\n  if (incr == 1) {\n    if (usingInlineStorage()) {\n      /* This case occurs in ~70--80% of the calls to this function. */\n      size_t newSize =\n        tl::RoundUpPow2<(sInlineCapacity + 1) * sizeof(T)>::value;\n      newCap = newSize / sizeof(T);\n      goto convert;\n    }\n\n    if (mLength == 0) {\n      /* This case occurs in ~0--10% of the calls to this function. */\n      newCap = 1;\n      goto grow;\n    }\n\n    /* This case occurs in ~15--20% of the calls to this function. */\n\n    /*\n     * Will mLength * 4 *sizeof(T) overflow?  This condition limits a vector\n     * to 1GB of memory on a 32-bit system, which is a reasonable limit.  It\n     * also ensures that\n     *\n     *   static_cast<char*>(end()) - static_cast<char*>(begin())\n     *\n     * doesn't overflow ptrdiff_t (see bug 510319).\n     */\n    if (mLength & tl::MulOverflowMask<4 * sizeof(T)>::value) {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    /*\n     * If we reach here, the existing capacity will have a size that is already\n     * as close to 2^N as sizeof(T) will allow.  Just double the capacity, and\n     * then there might be space for one more element.\n     */\n    newCap = mLength * 2;\n    if (detail::CapacityHasExcessSpace<T>(newCap))\n      newCap += 1;\n  } else {\n    /* This case occurs in ~2% of the calls to this function. */\n    size_t newMinCap = mLength + incr;\n\n    /* Did mLength + incr overflow?  Will newCap * sizeof(T) overflow? */\n    if (newMinCap < mLength ||\n        newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::value)\n    {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    size_t newMinSize = newMinCap * sizeof(T);\n    size_t newSize = RoundUpPow2(newMinSize);\n    newCap = newSize / sizeof(T);\n  }\n\n  if (usingInlineStorage()) {\n  convert:\n    return convertToHeapStorage(newCap);\n  }\n\ngrow:\n  return Impl::growTo(*this, newCap);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::initCapacity(size_t request)\n{\n  MOZ_ASSERT(empty());\n  MOZ_ASSERT(usingInlineStorage());\n  if (request == 0)\n    return true;\n  T* newbuf = reinterpret_cast<T*>(this->malloc_(request * sizeof(T)));\n  if (!newbuf)\n    return false;\n  mBegin = newbuf;\n  mCapacity = request;\n#ifdef DEBUG\n  mReserved = request;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::reserve(size_t request)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (request > mCapacity && !growStorageBy(request - mLength))\n    return false;\n\n#ifdef DEBUG\n  if (request > mReserved)\n    mReserved = request;\n  MOZ_ASSERT(mLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::shrinkBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(incr <= mLength);\n  Impl::destroy(endNoCheck() - incr, endNoCheck());\n  mLength -= incr;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  T* newend = endNoCheck() + incr;\n  Impl::initialize(endNoCheck(), newend);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growByUninitialized(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::resize(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growBy(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::resizeUninitialized(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growByUninitialized(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clear()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  mLength = 0;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clearAndFree()\n{\n  clear();\n\n  if (usingInlineStorage())\n    return;\n\n  this->free_(beginNoCheck());\n  mBegin = static_cast<T*>(storage.addr());\n  mCapacity = sInlineCapacity;\n#ifdef DEBUG\n  mReserved = sInlineCapacity;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::canAppendWithoutRealloc(size_t needed) const\n{\n  return mLength + needed <= mCapacity;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  internalAppend(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U& u)\n{\n  MOZ_ASSERT(mLength + 1 <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  new(endNoCheck()) T(u);\n  ++mLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendN(const T& t, size_t needed)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppendN(t, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendN(const T& t, size_t needed)\n{\n  MOZ_ASSERT(mLength + needed <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstructN(endNoCheck(), needed, t);\n  mLength += needed;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::insert(T* p, const T& val)\n{\n  MOZ_ASSERT(begin() <= p);\n  MOZ_ASSERT(p <= end());\n  size_t pos = p - begin();\n  MOZ_ASSERT(pos <= mLength);\n  size_t oldLength = mLength;\n  if (pos == oldLength) {\n    if (!append(val))\n      return nullptr;\n  } else {\n    T oldBack = back();\n    if (!append(oldBack)) /* Dup the last element. */\n      return nullptr;\n    for (size_t i = oldLength; i > pos; --i)\n      (*this)[i] = (*this)[i - 1];\n    (*this)[pos] = val;\n  }\n  return begin() + pos;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::erase(T* it)\n{\n  MOZ_ASSERT(begin() <= it);\n  MOZ_ASSERT(it < end());\n  while (it + 1 < end()) {\n    *it = *(it + 1);\n    ++it;\n  }\n  popBack();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U* insBegin, const U* insEnd)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  size_t needed = PointerRangeSize(insBegin, insEnd);\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppend(insBegin, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U* insBegin, size_t insLength)\n{\n  MOZ_ASSERT(mLength + insLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstruct(endNoCheck(), insBegin, insBegin + insLength);\n  mLength += insLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U& u)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength == mCapacity && !growStorageBy(1))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + 1 > mReserved)\n    mReserved = mLength + 1;\n#endif\n  internalAppend(u);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  return append(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<class U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U *insBegin, size_t insLength)\n{\n  return append(insBegin, insBegin + insLength);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::popBack()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(!empty());\n  --mLength;\n  endNoCheck()->~T();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE T\nVectorBase<T, N, AP, TV>::popCopy()\n{\n  T ret = back();\n  popBack();\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::extractRawBuffer()\n{\n  T* ret;\n  if (usingInlineStorage()) {\n    ret = reinterpret_cast<T*>(this->malloc_(mLength * sizeof(T)));\n    if (!ret)\n      return nullptr;\n    Impl::copyConstruct(ret, beginNoCheck(), endNoCheck());\n    Impl::destroy(beginNoCheck(), endNoCheck());\n    /* mBegin, mCapacity are unchanged. */\n    mLength = 0;\n  } else {\n    ret = mBegin;\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = 0;\n    mCapacity = sInlineCapacity;\n#ifdef DEBUG\n    mReserved = sInlineCapacity;\n#endif\n  }\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::replaceRawBuffer(T* p, size_t aLength)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n\n  /* Destroy what we have. */\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n\n  /* Take in the new buffer. */\n  if (aLength <= sInlineCapacity) {\n    /*\n     * We convert to inline storage if possible, even though p might\n     * otherwise be acceptable.  Maybe this behaviour should be\n     * specifiable with an argument to this function.\n     */\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = aLength;\n    mCapacity = sInlineCapacity;\n    Impl::moveConstruct(mBegin, p, p + aLength);\n    Impl::destroy(p, p + aLength);\n    this->free_(p);\n  } else {\n    mBegin = p;\n    mLength = aLength;\n    mCapacity = aLength;\n  }\n#ifdef DEBUG\n  mReserved = aLength;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::swap(TV& other)\n{\n  static_assert(N == 0,\n                \"still need to implement this for N != 0\");\n\n  // This only works when inline storage is always empty.\n  if (!usingInlineStorage() && other.usingInlineStorage()) {\n    other.mBegin = mBegin;\n    mBegin = inlineStorage();\n  } else if (usingInlineStorage() && !other.usingInlineStorage()) {\n    mBegin = other.mBegin;\n    other.mBegin = other.inlineStorage();\n  } else if (!usingInlineStorage() && !other.usingInlineStorage()) {\n    Swap(mBegin, other.mBegin);\n  } else {\n    // This case is a no-op, since we'd set both to use their inline storage.\n  }\n\n  Swap(mLength, other.mLength);\n  Swap(mCapacity, other.mCapacity);\n#ifdef DEBUG\n  Swap(mReserved, other.mReserved);\n#endif\n}\n\n/*\n * STL-like container providing a short-lived, dynamic buffer.  Vector calls the\n * constructors/destructors of all elements stored in its internal buffer, so\n * non-PODs may be safely used.  Additionally, Vector will store the first N\n * elements in-place before resorting to dynamic allocation.\n *\n * T requirements:\n *  - default and copy constructible, assignable, destructible\n *  - operations do not throw\n * N requirements:\n *  - any value, however, N is clamped to min/max values\n * AllocPolicy:\n *  - see \"Allocation policies\" in AllocPolicy.h (defaults to\n *    mozilla::MallocAllocPolicy)\n *\n * Vector is not reentrant: T member functions called during Vector member\n * functions must not call back into the same object!\n */\ntemplate<typename T,\n         size_t MinInlineCapacity = 0,\n         class AllocPolicy = MallocAllocPolicy>\nclass Vector\n  : public VectorBase<T,\n                      MinInlineCapacity,\n                      AllocPolicy,\n                      Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector& operator=(mozilla::MoveRef<Vector> vec) {\n      return Base::operator=(vec);\n    }\n};\n\n} // namespace mozilla\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif /* mozilla_Vector_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/WeakPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Weak pointer functionality, implemented as a mixin for use with any class. */\n\n/**\n * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting\n * its lifetime. It works by creating a single shared reference counted object\n * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo'\n * clear the pointer in the WeakReference without having to know about all of\n * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime\n * of 'Foo'.\n *\n * AtomicSupportsWeakPtr can be used for a variant with an atomically updated\n * reference counter.\n *\n * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional\n * dereference, and an additional heap allocated pointer sized object shared\n * between all of the WeakPtrs.\n *\n * Example of usage:\n *\n *   // To have a class C support weak pointers, inherit from SupportsWeakPtr<C>.\n *   class C : public SupportsWeakPtr<C>\n *   {\n *    public:\n *      int num;\n *      void act();\n *   };\n *\n *   C* ptr =  new C();\n *\n *   // Get weak pointers to ptr. The first time asWeakPtr is called\n *   // a reference counted WeakReference object is created that\n *   // can live beyond the lifetime of 'ptr'. The WeakReference\n *   // object will be notified of 'ptr's destruction.\n *   WeakPtr<C> weak = ptr->asWeakPtr();\n *   WeakPtr<C> other = ptr->asWeakPtr();\n *\n *   // Test a weak pointer for validity before using it.\n *   if (weak) {\n *     weak->num = 17;\n *     weak->act();\n *   }\n *\n *   // Destroying the underlying object clears weak pointers to it.\n *   delete ptr;\n *\n *   MOZ_ASSERT(!weak, \"Deleting |ptr| clears weak pointers to it.\");\n *   MOZ_ASSERT(!other, \"Deleting |ptr| clears all weak pointers to it.\");\n *\n * WeakPtr is typesafe and may be used with any class. It is not required that\n * the class be reference-counted or allocated in any particular way.\n *\n * The API was loosely inspired by Chromium's weak_ptr.h:\n * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h\n */\n\n#ifndef mozilla_WeakPtr_h\n#define mozilla_WeakPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RefPtr.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate <typename T, class WeakReference> class WeakPtrBase;\ntemplate <typename T, class WeakReference> class SupportsWeakPtrBase;\n\nnamespace detail {\n\n// This can live beyond the lifetime of the class derived from SupportsWeakPtrBase.\ntemplate<class T, RefCountAtomicity Atomicity>\nclass WeakReference : public RefCounted<WeakReference<T, Atomicity>, Atomicity>\n{\n  public:\n    explicit WeakReference(T* p) : ptr(p) {}\n    T* get() const {\n      return ptr;\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n    void detach() {\n      ptr = nullptr;\n    }\n    T* ptr;\n};\n\n} // namespace detail\n\ntemplate <typename T, class WeakReference>\nclass SupportsWeakPtrBase\n{\n  public:\n    WeakPtrBase<T, WeakReference> asWeakPtr() {\n      if (!weakRef)\n        weakRef = new WeakReference(static_cast<T*>(this));\n      return WeakPtrBase<T, WeakReference>(weakRef);\n    }\n\n  protected:\n    ~SupportsWeakPtrBase() {\n      static_assert(IsBaseOf<SupportsWeakPtrBase<T, WeakReference>, T>::value,\n                    \"T must derive from SupportsWeakPtrBase<T, WeakReference>\");\n      if (weakRef)\n        weakRef->detach();\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n\n    RefPtr<WeakReference> weakRef;\n};\n\ntemplate <typename T>\nclass SupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::NonAtomicRefCount> >\n{\n};\n\ntemplate <typename T>\nclass AtomicSupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::AtomicRefCount> >\n{\n};\n\nnamespace detail {\n\ntemplate <typename T>\nstruct WeakReferenceCount\n{\n  static const RefCountAtomicity atomicity =\n    IsBaseOf<AtomicSupportsWeakPtr<T>, T>::value\n    ? AtomicRefCount\n    : NonAtomicRefCount;\n};\n\n}\n\ntemplate <typename T, class WeakReference>\nclass WeakPtrBase\n{\n  public:\n    WeakPtrBase(const WeakPtrBase<T, WeakReference>& o) : ref(o.ref) {}\n    // Ensure that ref is dereferenceable in the uninitialized state\n    WeakPtrBase() : ref(new WeakReference(nullptr)) {}\n\n    operator T*() const {\n      return ref->get();\n    }\n    T& operator*() const {\n      return *ref->get();\n    }\n\n    T* operator->() const {\n      return ref->get();\n    }\n\n    T* get() const {\n      return ref->get();\n    }\n\n  private:\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n\n    explicit WeakPtrBase(const RefPtr<WeakReference> &o) : ref(o) {}\n\n    RefPtr<WeakReference> ref;\n};\n\ntemplate <typename T>\nclass WeakPtr : public WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> >\n{\n    typedef WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> > Base;\n  public:\n    WeakPtr(const WeakPtr<T>& o) : Base(o) {}\n    WeakPtr(const Base& o) : Base(o) {}\n    WeakPtr() {}\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_WeakPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Anchor.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Anchor implementation. */\n\n#ifndef js_Anchor_h\n#define js_Anchor_h\n\n#include \"mozilla/Attributes.h\"\n\nclass JSFunction;\nclass JSObject;\nclass JSScript;\nclass JSString;\n\nnamespace JS { class Value; }\n\nnamespace JS {\n\n/*\n * Protecting non-Value, non-JSObject *, non-JSString * values from collection\n *\n * Most of the time, the garbage collector's conservative stack scanner works\n * behind the scenes, finding all live values and protecting them from being\n * collected. However, when JSAPI client code obtains a pointer to data the\n * scanner does not know about, owned by an object the scanner does know about,\n * Care Must Be Taken.\n *\n * The scanner recognizes only a select set of types: pointers to JSObjects and\n * similar things (JSFunctions, and so on), pointers to JSStrings, and Values.\n * So while the scanner finds all live |JSString| pointers, it does not notice\n * |jschar| pointers.\n *\n * So suppose we have:\n *\n *   void f(JSString *str) {\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * After the call to |JS_GetStringCharsZ|, there are no further uses of\n * |str|, which means that the compiler is within its rights to not store\n * it anywhere. But because the stack scanner will not notice |ch|, there\n * is no longer any live value in this frame that would keep the string\n * alive. If |str| is the last reference to that |JSString|, and the\n * collector runs while we are using |ch|, the string's array of |jschar|s\n * may be freed out from under us.\n *\n * Note that there is only an issue when 1) we extract a thing X the scanner\n * doesn't recognize from 2) a thing Y the scanner does recognize, and 3) if Y\n * gets garbage-collected, then X gets freed. If we have code like this:\n *\n *   void g(JSObject *obj) {\n *     JS::Value x;\n *     JS_GetProperty(obj, \"x\", &x);\n *     ... do stuff with x ...\n *   }\n *\n * there's no problem, because the value we've extracted, x, is a Value, a\n * type that the conservative scanner recognizes.\n *\n * Conservative GC frees us from the obligation to explicitly root the types it\n * knows about, but when we work with derived values like |ch|, we must root\n * their owners, as the derived value alone won't keep them alive.\n *\n * A JS::Anchor is a kind of GC root that allows us to keep the owners of\n * derived values like |ch| alive throughout the Anchor's lifetime. We could\n * fix the above code as follows:\n *\n *   void f(JSString *str) {\n *     JS::Anchor<JSString *> a_str(str);\n *     const jschar *ch = JS_GetStringCharsZ(str);\n *     ... do stuff with ch, but no uses of str ...;\n *   }\n *\n * This simply ensures that |str| will be live until |a_str| goes out of scope.\n * As long as we don't retain a pointer to the string's characters for longer\n * than that, we have avoided all garbage collection hazards.\n */\ntemplate<typename T> class AnchorPermitted;\ntemplate<> class AnchorPermitted<JSObject *> { };\ntemplate<> class AnchorPermitted<const JSObject *> { };\ntemplate<> class AnchorPermitted<JSFunction *> { };\ntemplate<> class AnchorPermitted<const JSFunction *> { };\ntemplate<> class AnchorPermitted<JSString *> { };\ntemplate<> class AnchorPermitted<const JSString *> { };\ntemplate<> class AnchorPermitted<Value> { };\ntemplate<> class AnchorPermitted<const JSScript *> { };\ntemplate<> class AnchorPermitted<JSScript *> { };\n\ntemplate<typename T>\nclass Anchor : AnchorPermitted<T>\n{\n  public:\n    Anchor() { }\n    explicit Anchor(T t) { hold = t; }\n    inline ~Anchor();\n    T &get() { return hold; }\n    const T &get() const { return hold; }\n    void set(const T &t) { hold = t; }\n    void operator=(const T &t) { hold = t; }\n    void clear() { hold = 0; }\n\n  private:\n    T hold;\n    Anchor(const Anchor &other) MOZ_DELETE;\n    void operator=(const Anchor &other) MOZ_DELETE;\n};\n\ntemplate<typename T>\ninline Anchor<T>::~Anchor()\n{\n#ifdef __GNUC__\n    /*\n     * No code is generated for this. But because this is marked 'volatile', G++ will\n     * assume it has important side-effects, and won't delete it. (G++ never looks at\n     * the actual text and notices it's empty.) And because we have passed |hold| to\n     * it, GCC will keep |hold| alive until this point.\n     *\n     * The \"memory\" clobber operand ensures that G++ will not move prior memory\n     * accesses after the asm --- it's a barrier. Unfortunately, it also means that\n     * G++ will assume that all memory has changed after the asm, as it would for a\n     * call to an unknown function. I don't know of a way to avoid that consequence.\n     */\n    asm volatile(\"\":: \"g\" (hold) : \"memory\");\n#else\n    /*\n     * An adequate portable substitute, for non-structure types.\n     *\n     * The compiler promises that, by the end of an expression statement, the\n     * last-stored value to a volatile object is the same as it would be in an\n     * unoptimized, direct implementation (the \"abstract machine\" whose behavior the\n     * language spec describes). However, the compiler is still free to reorder\n     * non-volatile accesses across this store --- which is what we must prevent. So\n     * assigning the held value to a volatile variable, as we do here, is not enough.\n     *\n     * In our case, however, garbage collection only occurs at function calls, so it\n     * is sufficient to ensure that the destructor's store isn't moved earlier across\n     * any function calls that could collect. It is hard to imagine the compiler\n     * analyzing the program so thoroughly that it could prove that such motion was\n     * safe. In practice, compilers treat calls to the collector as opaque operations\n     * --- in particular, as operations which could access volatile variables, across\n     * which this destructor must not be moved.\n     *\n     * (\"Objection, your honor!  *Alleged* killer whale!\")\n     *\n     * The disadvantage of this approach is that it does generate code for the store.\n     * We do need to use Anchors in some cases where cycles are tight.\n     *\n     * Note that there is a Anchor<Value>::~Anchor() specialization in Value.h.\n     */\n    volatile T sink;\n    sink = hold;\n#endif  /* defined(__GNUC__) */\n}\n\n} // namespace JS\n\n#endif /* js_Anchor_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/CallArgs.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Helper classes encapsulating access to the callee, |this| value, arguments,\n * and argument count for a function call.\n *\n * The intent of JS::CallArgs and JS::CallReceiver is that they be used to\n * encapsulate access to the un-abstracted |unsigned argc, Value *vp| arguments\n * to a function.  It's possible (albeit deprecated) to manually index into\n * |vp| to access the callee, |this|, and arguments of a function, and to set\n * its return value.  It's also possible to use the supported API of JS_CALLEE,\n * JS_THIS, JS_ARGV, JS_RVAL and JS_SET_RVAL to the same ends.  But neither API\n * has the error-handling or moving-GC correctness of CallArgs or CallReceiver.\n * New code should use CallArgs and CallReceiver instead whenever possible.\n *\n * The eventual plan is to change JSNative to take |const CallArgs&| directly,\n * for automatic assertion of correct use and to make calling functions more\n * efficient.  Embedders should start internally switching away from using\n * |argc| and |vp| directly, except to create a |CallArgs|.  Then, when an\n * eventual release making that change occurs, porting efforts will require\n * changing methods' signatures but won't require invasive changes to the\n * methods' implementations, potentially under time pressure.\n */\n\n#ifndef js_CallArgs_h\n#define js_CallArgs_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"jstypes.h\"\n\n#include \"js/RootingAPI.h\"\n#include \"js/Value.h\"\n\nstruct JSContext;\nclass JSObject;\n\n/* Typedef for native functions called by the JS VM. */\ntypedef JSBool\n(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);\n\n/* Typedef for native functions that may be called in parallel. */\ntypedef js::ParallelResult\n(* JSParallelNative)(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Typedef for native functions that may be called either in parallel or\n * sequential execution.\n */\ntypedef JSBool\n(* JSThreadSafeNative)(js::ThreadSafeContext *cx, unsigned argc, JS::Value *vp);\n\n/*\n * Convenience wrappers for passing in ThreadSafeNative to places that expect\n * a JSNative or a JSParallelNative.\n */\ntemplate <JSThreadSafeNative threadSafeNative>\ninline JSBool\nJSNativeThreadSafeWrapper(JSContext *cx, unsigned argc, JS::Value *vp);\n\ntemplate <JSThreadSafeNative threadSafeNative>\ninline js::ParallelResult\nJSParallelNativeThreadSafeWrapper(js::ForkJoinSlice *slice, unsigned argc, JS::Value *vp);\n\n/*\n * Compute |this| for the |vp| inside a JSNative, either boxing primitives or\n * replacing with the global object as necessary.\n *\n * This method will go away at some point: instead use |args.thisv()|.  If the\n * value is an object, no further work is required.  If that value is |null| or\n * |undefined|, use |JS_GetGlobalForObject| to compute the global object.  If\n * the value is some other primitive, use |JS_ValueToObject| to box it.\n */\nextern JS_PUBLIC_API(JS::Value)\nJS_ComputeThis(JSContext *cx, JS::Value *vp);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\n/*\n * JS::CallReceiver encapsulates access to the callee, |this|, and eventual\n * return value for a function call.  The principal way to create a\n * CallReceiver is using JS::CallReceiverFromVp:\n *\n *   static JSBool\n *   FunctionReturningThis(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallReceiver rec = JS::CallReceiverFromVp(vp);\n *\n *       // Access to the callee must occur before accessing/setting\n *       // the return value.\n *       JSObject &callee = rec.callee();\n *       rec.rval().set(JS::ObjectValue(callee));\n *\n *       // callee() and calleev() will now assert.\n *\n *       // It's always fine to access thisv().\n *       HandleValue thisv = rec.thisv();\n *       rec.rval().set(thisv);\n *\n *       // As the return value was last set to |this|, returns |this|.\n *       return true;\n *   }\n *\n * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't\n * part of the CallReceiver interface.  We will likely add them at some point.\n * Until then, you should probably continue using |vp| directly for these two\n * cases.\n *\n * CallReceiver is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\n\nnamespace detail {\n\n#ifdef DEBUG\nextern JS_PUBLIC_API(void)\nCheckIsValidConstructible(Value v);\n#endif\n\nenum UsedRval { IncludeUsedRval, NoUsedRval };\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS UsedRvalBase;\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<IncludeUsedRval>\n{\n  protected:\n    mutable bool usedRval_;\n    void setUsedRval() const { usedRval_ = true; }\n    void clearUsedRval() const { usedRval_ = false; }\n};\n\ntemplate<>\nclass MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>\n{\n  protected:\n    void setUsedRval() const {}\n    void clearUsedRval() const {}\n};\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<\n#ifdef DEBUG\n        WantUsedRval\n#else\n        NoUsedRval\n#endif\n    >\n{\n  protected:\n    Value *argv_;\n\n  public:\n    /*\n     * Returns the function being called, as an object.  Must not be called\n     * after rval() has been used!\n     */\n    JSObject &callee() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return argv_[-2].toObject();\n    }\n\n    /*\n     * Returns the function being called, as a value.  Must not be called after\n     * rval() has been used!\n     */\n    HandleValue calleev() const {\n        MOZ_ASSERT(!this->usedRval_);\n        return HandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n    /*\n     * Returns the |this| value passed to the function.  This method must not\n     * be called when the function is being called as a constructor via |new|.\n     * The value may or may not be an object: it is the individual function's\n     * responsibility to box the value if needed.\n     */\n    HandleValue thisv() const {\n        // Some internal code uses thisv() in constructing cases, so don't do\n        // this yet.\n        // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING));\n        return HandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n\n    Value computeThis(JSContext *cx) const {\n        if (thisv().isObject())\n            return thisv();\n\n        return JS_ComputeThis(cx, base());\n    }\n\n    bool isConstructing() const {\n#ifdef DEBUG\n        if (this->usedRval_)\n            CheckIsValidConstructible(calleev());\n#endif\n        return argv_[-1].isMagic();\n    }\n\n    /*\n     * Returns the currently-set return value.  The initial contents of this\n     * value are unspecified.  Once this method has been called, callee() and\n     * calleev() can no longer be used.  (If you're compiling against a debug\n     * build of SpiderMonkey, these methods will assert to aid debugging.)\n     *\n     * If the method you're implementing succeeds by returning true, you *must*\n     * set this.  (SpiderMonkey doesn't currently assert this, but it will do\n     * so eventually.)  You don't need to use or change this if your method\n     * fails.\n     */\n    MutableHandleValue rval() const {\n        this->setUsedRval();\n        return MutableHandleValue::fromMarkedLocation(&argv_[-2]);\n    }\n\n  public:\n    // These methods are only intended for internal use.  Embedders shouldn't\n    // use them!\n\n    Value *base() const { return argv_ - 2; }\n\n    Value *spAfterCall() const {\n        this->setUsedRval();\n        return argv_ - 1;\n    }\n\n  public:\n    // These methods are publicly exposed, but they are *not* to be used when\n    // implementing a JSNative method and encapsulating access to |vp| within\n    // it.  You probably don't want to use these!\n\n    void setCallee(Value aCalleev) const {\n        this->clearUsedRval();\n        argv_[-2] = aCalleev;\n    }\n\n    void setThis(Value aThisv) const {\n        argv_[-1] = aThisv;\n    }\n\n    MutableHandleValue mutableThisv() const {\n        return MutableHandleValue::fromMarkedLocation(&argv_[-1]);\n    }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallReceiver : public detail::CallReceiverBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallReceiver CallReceiverFromVp(Value *vp);\n    friend CallReceiver CallReceiverFromArgv(Value *argv);\n};\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromArgv(Value *argv)\n{\n    CallReceiver receiver;\n    receiver.clearUsedRval();\n    receiver.argv_ = argv;\n    return receiver;\n}\n\nMOZ_ALWAYS_INLINE CallReceiver\nCallReceiverFromVp(Value *vp)\n{\n    return CallReceiverFromArgv(vp + 2);\n}\n\n/*\n * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to\n * the function call's arguments.  The principal way to create a CallArgs is\n * like so, using JS::CallArgsFromVp:\n *\n *   static JSBool\n *   FunctionReturningArgcTimesArg0(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *\n *       // Guard against no arguments or a non-numeric arg0.\n *       if (args.length() == 0 || !args[0].isNumber()) {\n *           args.rval().setInt32(0);\n *           return true;\n *       }\n *\n *       args.rval().set(JS::NumberValue(args.length() * args[0].toNumber()));\n *       return true;\n *   }\n *\n * CallArgs is exposed publicly and used internally.  Not all parts of its\n * public interface are meant to be used by embedders!  See inline comments to\n * for details.\n */\nnamespace detail {\n\ntemplate<UsedRval WantUsedRval>\nclass MOZ_STACK_CLASS CallArgsBase :\n        public mozilla::Conditional<WantUsedRval == detail::IncludeUsedRval,\n                                    CallReceiver,\n                                    CallReceiverBase<NoUsedRval> >::Type\n{\n  protected:\n    unsigned argc_;\n\n  public:\n    /* Returns the number of arguments. */\n    unsigned length() const { return argc_; }\n\n    /* Returns the i-th zero-indexed argument. */\n    MutableHandleValue operator[](unsigned i) const {\n        MOZ_ASSERT(i < argc_);\n        return MutableHandleValue::fromMarkedLocation(&this->argv_[i]);\n    }\n\n    /*\n     * Returns the i-th zero-indexed argument, or |undefined| if there's no\n     * such argument.\n     */\n    HandleValue get(unsigned i) const {\n        return i < length()\n               ? HandleValue::fromMarkedLocation(&this->argv_[i])\n               : UndefinedHandleValue;\n    }\n\n    /*\n     * Returns true if the i-th zero-indexed argument is present and is not\n     * |undefined|.\n     */\n    bool hasDefined(unsigned i) const {\n        return i < argc_ && !this->argv_[i].isUndefined();\n    }\n\n  public:\n    // These methods are publicly exposed, but we're less sure of the interface\n    // here than we'd like (because they're hackish and drop assertions).  Try\n    // to avoid using these if you can.\n\n    Value *array() const { return this->argv_; }\n    Value *end() const { return this->argv_ + argc_; }\n};\n\n} // namespace detail\n\nclass MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsedRval>\n{\n  private:\n    friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);\n    friend CallArgs CallArgsFromSp(unsigned argc, Value *sp);\n\n    static CallArgs create(unsigned argc, Value *argv) {\n        CallArgs args;\n        args.clearUsedRval();\n        args.argv_ = argv;\n        args.argc_ = argc;\n        return args;\n    }\n\n};\n\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromVp(unsigned argc, Value *vp)\n{\n    return CallArgs::create(argc, vp + 2);\n}\n\n// This method is only intended for internal use in SpiderMonkey.  We may\n// eventually move it to an internal header.  Embedders should use\n// JS::CallArgsFromVp!\nMOZ_ALWAYS_INLINE CallArgs\nCallArgsFromSp(unsigned argc, Value *sp)\n{\n    return CallArgs::create(argc, sp - argc);\n}\n\n} // namespace JS\n\n/*\n * Macros to hide interpreter stack layout details from a JSNative using its\n * JS::Value *vp parameter.  DO NOT USE THESE!  Instead use JS::CallArgs and\n * friends, above.  These macros will be removed when we change JSNative to\n * take a const JS::CallArgs&.\n */\n\n#define JS_CALLEE(cx,vp)        ((vp)[0])\n#define JS_THIS_OBJECT(cx,vp)   (JSVAL_TO_OBJECT(JS_THIS(cx,vp)))\n#define JS_ARGV(cx,vp)          ((vp) + 2)\n#define JS_RVAL(cx,vp)          (*(vp))\n#define JS_SET_RVAL(cx,vp,v)    (*(vp) = (v))\n\n/*\n * Note: if this method returns null, an error has occurred and must be\n * propagated or caught.\n */\nMOZ_ALWAYS_INLINE JS::Value\nJS_THIS(JSContext *cx, JS::Value *vp)\n{\n    return JSVAL_IS_PRIMITIVE(vp[1]) ? JS_ComputeThis(cx, vp) : vp[1];\n}\n\n/*\n * |this| is passed to functions in ES5 without change.  Functions themselves\n * do any post-processing they desire to box |this|, compute the global object,\n * &c.  This macro retrieves a function's unboxed |this| value.\n *\n * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT,\n * or vice versa.  Either use the provided this value with this macro, or\n * compute the boxed |this| value using those.  JS_THIS_VALUE must not be used\n * if the function is being called as a constructor.\n *\n * But: DO NOT USE THIS!  Instead use JS::CallArgs::thisv(), above.\n *\n */\n#define JS_THIS_VALUE(cx,vp)    ((vp)[1])\n\n#endif /* js_CallArgs_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/CharacterEncoding.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_CharacterEncoding_h\n#define js_CharacterEncoding_h\n\n#include \"mozilla/Range.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\nnamespace JS {\n\n/*\n * By default, all C/C++ 1-byte-per-character strings passed into the JSAPI\n * are treated as ISO/IEC 8859-1, also known as Latin-1. That is, each\n * byte is treated as a 2-byte character, and there is no way to pass in a\n * string containing characters beyond U+00FF.\n */\nclass Latin1Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    Latin1Chars() : Base() {}\n    Latin1Chars(char *aBytes, size_t aLength) : Base(reinterpret_cast<unsigned char *>(aBytes), aLength) {}\n    Latin1Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * A Latin1Chars, but with \\0 termination for C compatibility.\n */\nclass Latin1CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    Latin1CharsZ() : Base(NULL, 0) {}\n\n    Latin1CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    Latin1CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\nclass UTF8Chars : public mozilla::Range<unsigned char>\n{\n    typedef mozilla::Range<unsigned char> Base;\n\n  public:\n    UTF8Chars() : Base() {}\n    UTF8Chars(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {}\n    UTF8Chars(const char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(const_cast<char *>(aBytes)), aLength)\n    {}\n};\n\n/*\n * SpiderMonkey also deals directly with UTF-8 encoded text in some places.\n */\nclass UTF8CharsZ : public mozilla::RangedPtr<unsigned char>\n{\n    typedef mozilla::RangedPtr<unsigned char> Base;\n\n  public:\n    UTF8CharsZ() : Base(NULL, 0) {}\n\n    UTF8CharsZ(char *aBytes, size_t aLength)\n      : Base(reinterpret_cast<unsigned char *>(aBytes), aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    UTF8CharsZ(unsigned char *aBytes, size_t aLength)\n      : Base(aBytes, aLength)\n    {\n        JS_ASSERT(aBytes[aLength] == '\\0');\n    }\n\n    char *c_str() { return reinterpret_cast<char *>(get()); }\n};\n\n/*\n * SpiderMonkey uses a 2-byte character representation: it is a\n * 2-byte-at-a-time view of a UTF-16 byte stream. This is similar to UCS-2,\n * but unlike UCS-2, we do not strip UTF-16 extension bytes. This allows a\n * sufficiently dedicated JavaScript program to be fully unicode-aware by\n * manually interpreting UTF-16 extension characters embedded in the JS\n * string.\n */\nclass TwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    TwoByteChars() : Base() {}\n    TwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    TwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A non-convertible variant of TwoByteChars that does not refer to characters\n * inlined inside a JSShortString or a JSInlineString. StableTwoByteChars are\n * thus safe to hold across a GC.\n */\nclass StableTwoByteChars : public mozilla::Range<jschar>\n{\n    typedef mozilla::Range<jschar> Base;\n\n  public:\n    StableTwoByteChars() : Base() {}\n    StableTwoByteChars(jschar *aChars, size_t aLength) : Base(aChars, aLength) {}\n    StableTwoByteChars(const jschar *aChars, size_t aLength) : Base(const_cast<jschar *>(aChars), aLength) {}\n};\n\n/*\n * A TwoByteChars, but \\0 terminated for compatibility with JSFlatString.\n */\nclass TwoByteCharsZ : public mozilla::RangedPtr<jschar>\n{\n    typedef mozilla::RangedPtr<jschar> Base;\n\n  public:\n    TwoByteCharsZ() : Base(NULL, 0) {}\n\n    TwoByteCharsZ(jschar *chars, size_t length)\n      : Base(chars, length)\n    {\n        JS_ASSERT(chars[length] == '\\0');\n    }\n};\n\n/*\n * Convert a 2-byte character sequence to \"ISO-Latin-1\". This works by\n * truncating each 2-byte pair in the sequence to a 1-byte pair. If the source\n * contains any UTF-16 extension characters, then this may give invalid Latin1\n * output. The returned string is zero terminated. The returned string or the\n * returned string's |start()| must be freed with JS_free or js_free,\n * respectively. If allocation fails, an OOM error will be set and the method\n * will return a NULL chars (which can be tested for with the ! operator).\n * This method cannot trigger GC.\n */\nextern Latin1CharsZ\nLossyTwoByteCharsToNewLatin1CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nextern UTF8CharsZ\nTwoByteCharsToNewUTF8CharsZ(js::ThreadSafeContext *cx, TwoByteChars tbchars);\n\nuint32_t\nUtf8ToOneUcs4Char(const uint8_t *utf8Buffer, int utf8Length);\n\n/*\n * Inflate bytes in UTF-8 encoding to jschars.\n * - On error, returns an empty TwoByteCharsZ.\n * - On success, returns a malloc'd TwoByteCharsZ, and updates |outlen| to hold\n *   its length;  the length value excludes the trailing null.\n */\nextern TwoByteCharsZ\nUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n/*\n * The same as UTF8CharsToNewTwoByteCharsZ(), except that any malformed UTF-8 characters\n * will be replaced by \\uFFFD. No exception will be thrown for malformed UTF-8\n * input.\n */\nextern TwoByteCharsZ\nLossyUTF8CharsToNewTwoByteCharsZ(JSContext *cx, const UTF8Chars utf8, size_t *outlen);\n\n} // namespace JS\n\ninline void JS_free(JS::Latin1CharsZ &ptr) { js_free((void*)ptr.get()); }\ninline void JS_free(JS::UTF8CharsZ &ptr) { js_free((void*)ptr.get()); }\n\n#endif /* js_CharacterEncoding_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Date.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Date_h\n#define js_Date_h\n\n#include \"jstypes.h\"\n\nnamespace JS {\n\n// Year is a year, month is 0-11, day is 1-based.  The return value is\n// a number of milliseconds since the epoch.  Can return NaN.\nJS_PUBLIC_API(double)\nMakeDate(double year, unsigned month, unsigned day);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// year.  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nYearFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// month (0-11).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nMonthFromTime(double time);\n\n// Takes an integer number of milliseconds since the epoch and returns the\n// day (1-based).  Can return NaN, and will do so if NaN is passed in.\nJS_PUBLIC_API(double)\nDayFromTime(double time);\n\n} // namespace JS\n\n#endif /* js_Date_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/GCAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_GCAPI_h\n#define js_GCAPI_h\n\n#include \"js/HeapAPI.h\"\n\nnamespace JS {\n\n#define GCREASONS(D)                            \\\n    /* Reasons internal to the JS engine */     \\\n    D(API)                                      \\\n    D(MAYBEGC)                                  \\\n    D(LAST_CONTEXT)                             \\\n    D(DESTROY_CONTEXT)                          \\\n    D(LAST_DITCH)                               \\\n    D(TOO_MUCH_MALLOC)                          \\\n    D(ALLOC_TRIGGER)                            \\\n    D(DEBUG_GC)                                 \\\n    D(DEBUG_MODE_GC)                            \\\n    D(TRANSPLANT)                               \\\n    D(RESET)                                    \\\n    D(OUT_OF_NURSERY)                           \\\n    D(EVICT_NURSERY)                            \\\n    D(FULL_STORE_BUFFER)                        \\\n                                                \\\n    /* These are reserved for future use. */    \\\n    D(RESERVED0)                                \\\n    D(RESERVED1)                                \\\n    D(RESERVED2)                                \\\n    D(RESERVED3)                                \\\n    D(RESERVED4)                                \\\n    D(RESERVED5)                                \\\n    D(RESERVED6)                                \\\n    D(RESERVED7)                                \\\n    D(RESERVED8)                                \\\n    D(RESERVED9)                                \\\n    D(RESERVED10)                               \\\n    D(RESERVED11)                               \\\n    D(RESERVED12)                               \\\n    D(RESERVED13)                               \\\n    D(RESERVED14)                               \\\n    D(RESERVED15)                               \\\n    D(RESERVED16)                               \\\n    D(RESERVED17)                               \\\n    D(RESERVED18)                               \\\n    D(RESERVED19)                               \\\n                                                \\\n    /* Reasons from Firefox */                  \\\n    D(DOM_WINDOW_UTILS)                         \\\n    D(COMPONENT_UTILS)                          \\\n    D(MEM_PRESSURE)                             \\\n    D(CC_WAITING)                               \\\n    D(CC_FORCED)                                \\\n    D(LOAD_END)                                 \\\n    D(POST_COMPARTMENT)                         \\\n    D(PAGE_HIDE)                                \\\n    D(NSJSCONTEXT_DESTROY)                      \\\n    D(SET_NEW_DOCUMENT)                         \\\n    D(SET_DOC_SHELL)                            \\\n    D(DOM_UTILS)                                \\\n    D(DOM_IPC)                                  \\\n    D(DOM_WORKER)                               \\\n    D(INTER_SLICE_GC)                           \\\n    D(REFRESH_FRAME)                            \\\n    D(FULL_GC_TIMER)                            \\\n    D(SHUTDOWN_CC)                              \\\n    D(FINISH_LARGE_EVALUTE)\n\nnamespace gcreason {\n\n/* GCReasons will end up looking like JSGC_MAYBEGC */\nenum Reason {\n#define MAKE_REASON(name) name,\n    GCREASONS(MAKE_REASON)\n#undef MAKE_REASON\n    NO_REASON,\n    NUM_REASONS,\n\n    /*\n     * For telemetry, we want to keep a fixed max bucket size over time so we\n     * don't have to switch histograms. 100 is conservative; as of this writing\n     * there are 26. But the cost of extra buckets seems to be low while the\n     * cost of switching histograms is high.\n     */\n    NUM_TELEMETRY_REASONS = 100\n};\n\n} /* namespace gcreason */\n\nextern JS_FRIEND_API(void)\nPrepareZoneForGC(Zone *zone);\n\nextern JS_FRIEND_API(void)\nPrepareForFullGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nPrepareForIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsGCScheduled(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nSkipZoneForGC(Zone *zone);\n\n/*\n * When triggering a GC using one of the functions below, it is first necessary\n * to select the compartments to be collected. To do this, you can call\n * PrepareZoneForGC on each compartment, or you can call PrepareForFullGC\n * to select all compartments. Failing to select any compartment is an error.\n */\n\nextern JS_FRIEND_API(void)\nGCForReason(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkingGC(JSRuntime *rt, gcreason::Reason reason);\n\nextern JS_FRIEND_API(void)\nShrinkGCBuffers(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nIncrementalGC(JSRuntime *rt, gcreason::Reason reason, int64_t millis = 0);\n\nextern JS_FRIEND_API(void)\nFinishIncrementalGC(JSRuntime *rt, gcreason::Reason reason);\n\nenum GCProgress {\n    /*\n     * During non-incremental GC, the GC is bracketed by JSGC_CYCLE_BEGIN/END\n     * callbacks. During an incremental GC, the sequence of callbacks is as\n     * follows:\n     *   JSGC_CYCLE_BEGIN, JSGC_SLICE_END  (first slice)\n     *   JSGC_SLICE_BEGIN, JSGC_SLICE_END  (second slice)\n     *   ...\n     *   JSGC_SLICE_BEGIN, JSGC_CYCLE_END  (last slice)\n     */\n\n    GC_CYCLE_BEGIN,\n    GC_SLICE_BEGIN,\n    GC_SLICE_END,\n    GC_CYCLE_END\n};\n\nstruct JS_FRIEND_API(GCDescription) {\n    bool isCompartment_;\n\n    GCDescription(bool isCompartment)\n      : isCompartment_(isCompartment) {}\n\n    jschar *formatMessage(JSRuntime *rt) const;\n    jschar *formatJSON(JSRuntime *rt, uint64_t timestamp) const;\n};\n\ntypedef void\n(* GCSliceCallback)(JSRuntime *rt, GCProgress progress, const GCDescription &desc);\n\nextern JS_FRIEND_API(GCSliceCallback)\nSetGCSliceCallback(JSRuntime *rt, GCSliceCallback callback);\n\n/*\n * Signals a good place to do an incremental slice, because the browser is\n * drawing a frame.\n */\nextern JS_FRIEND_API(void)\nNotifyDidPaint(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalGCEnabled(JSRuntime *rt);\n\nJS_FRIEND_API(bool)\nIsIncrementalGCInProgress(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableIncrementalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nDisableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(void)\nEnableGenerationalGC(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSRuntime *rt);\n\nextern JS_FRIEND_API(bool)\nIsIncrementalBarrierNeeded(JSContext *cx);\n\nextern JS_FRIEND_API(void)\nIncrementalReferenceBarrier(void *ptr, JSGCTraceKind kind);\n\nextern JS_FRIEND_API(void)\nIncrementalValueBarrier(const Value &v);\n\nextern JS_FRIEND_API(void)\nIncrementalObjectBarrier(JSObject *obj);\n\nextern JS_FRIEND_API(void)\nPokeGC(JSRuntime *rt);\n\n/* Was the most recent GC run incrementally? */\nextern JS_FRIEND_API(bool)\nWasIncrementalGC(JSRuntime *rt);\n\nclass ObjectPtr\n{\n    Heap<JSObject *> value;\n\n  public:\n    ObjectPtr() : value(NULL) {}\n\n    ObjectPtr(JSObject *obj) : value(obj) {}\n\n    /* Always call finalize before the destructor. */\n    ~ObjectPtr() { JS_ASSERT(!value); }\n\n    void finalize(JSRuntime *rt) {\n        if (IsIncrementalBarrierNeeded(rt))\n            IncrementalObjectBarrier(value);\n        value = NULL;\n    }\n\n    void init(JSObject *obj) { value = obj; }\n\n    JSObject *get() const { return value; }\n\n    void writeBarrierPre(JSRuntime *rt) {\n        IncrementalObjectBarrier(value);\n    }\n\n    bool isAboutToBeFinalized() {\n        return JS_IsAboutToBeFinalized(&value);\n    }\n\n    ObjectPtr &operator=(JSObject *obj) {\n        IncrementalObjectBarrier(value);\n        value = obj;\n        return *this;\n    }\n\n    void trace(JSTracer *trc, const char *name) {\n        JS_CallHeapObjectTracer(trc, &value, name);\n    }\n\n    JSObject &operator*() const { return *value; }\n    JSObject *operator->() const { return value; }\n    operator JSObject *() const { return value; }\n};\n\n/*\n * Unsets the gray bit for anything reachable from |thing|. |kind| should not be\n * JSTRACE_SHAPE. |thing| should be non-null.\n */\nextern JS_FRIEND_API(void)\nUnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);\n\n/*\n * This should be called when an object that is marked gray is exposed to the JS\n * engine (by handing it to running JS code or writing it into live JS\n * data). During incremental GC, since the gray bits haven't been computed yet,\n * we conservatively mark the object black.\n */\nstatic JS_ALWAYS_INLINE void\nExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)\n{\n    JS_ASSERT(kind != JSTRACE_SHAPE);\n\n    shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);\n#ifdef JSGC_GENERATIONAL\n    /*\n     * GC things residing in the nursery cannot be gray: they have no mark bits.\n     * All live objects in the nursery are moved to tenured at the beginning of\n     * each GC slice, so the gray marker never sees nursery things.\n     */\n    if (uintptr_t(thing) >= rt->gcNurseryStart_ && uintptr_t(thing) < rt->gcNurseryEnd_)\n        return;\n#endif\n    if (IsIncrementalBarrierNeededOnGCThing(rt, thing, kind))\n        IncrementalReferenceBarrier(thing, kind);\n    else if (GCThingIsMarkedGray(thing))\n        UnmarkGrayGCThingRecursively(thing, kind);\n}\n\nstatic JS_ALWAYS_INLINE void\nExposeValueToActiveJS(const Value &v)\n{\n    if (v.isMarkable())\n        ExposeGCThingToActiveJS(v.toGCThing(), v.gcKind());\n}\n\n} /* namespace JS */\n\n#endif /* js_GCAPI_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/HashTable.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HashTable_h\n#define js_HashTable_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/PodOperations.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js/Utility.h\"\n\nnamespace js {\n\nclass TempAllocPolicy;\ntemplate <class> struct DefaultHasher;\ntemplate <class, class> class HashMapEntry;\nnamespace detail {\n    template <class T> class HashTableEntry;\n    template <class T, class HashPolicy, class AllocPolicy> class HashTable;\n}\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based map from keys to\n// values. In particular, HashMap calls constructors and destructors of all\n// objects added so non-PODs may be used safely.\n//\n// Key/Value requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members\n//   called by HashMap must not call back into the same HashMap object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class Key,\n          class Value,\n          class HashPolicy = DefaultHasher<Key>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashMap\n{\n    typedef HashMapEntry<Key, Value> TableEntry;\n\n    struct MapHashPolicy : HashPolicy\n    {\n        typedef Key KeyType;\n        static const Key &getKey(TableEntry &e) { return e.key; }\n        static void setKey(TableEntry &e, Key &k) { const_cast<Key &>(e.key) = k; }\n    };\n\n    typedef detail::HashTable<TableEntry, MapHashPolicy, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef TableEntry Entry;\n\n    // HashMap construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashMap and check the return value.\n    HashMap(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   if (HM::Ptr p = h.lookup(3)) {\n    //     const HM::Entry &e = *p; // p acts like a pointer to Entry\n    //     assert(p->key == 3);     // Entry contains the key\n    //     char val = p->value;     // and value\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above (with T = Entry).\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Like lookup, but does not assert if two threads call lookup at the same\n    // time. Only use this method when none of the threads will modify the map.\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const { return impl.readonlyThreadsafeLookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of Key |k| (where |HashPolicy::match(k,l) == true|) using\n    // |add(p,k,v)|. After |add(p,k,v)|, |p| points to the new Entry. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   HM::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3, 'a'))\n    //       return false;\n    //   }\n    //   const HM::Entry &e = *p;   // p acts like a pointer to Entry\n    //   assert(p->key == 3);       // Entry contains the key\n    //   char val = p->value;       // and value\n    //\n    // Also see the definition of AddPtr in HashTable above (with T = Entry).\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HM::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 'a'))\n    //        return false;\n    //    }\n    //    const HM::Entry &e = *p;\n    //    assert(p->key == 3);\n    //    char val = p->value;\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return impl.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        Entry e(k, Value());\n        return impl.add(p, mozilla::Move(e));\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.relookupOrAdd(p, k, mozilla::Move(e));\n    }\n\n    // |all()| returns a Range containing |count()| elements. E.g.:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM h;\n    //   for (HM::Range r = h.all(); !r.empty(); r.popFront())\n    //     char c = r.front().value;\n    //\n    // Also see the definition of Range in HashTable above (with T = Entry).\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashMap<int,char> HM;\n    //   HM s;\n    //   for (HM::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front().value == 'l')\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above (with T = Entry).\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all entries without triggering destructors. This method is unsafe.\n    void clearWithoutCallingDestructors()             { impl.clearWithoutCallingDestructors(); }\n\n    // Remove all the entries and release all internal buffers. The map must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashMap.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashMap operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        AddPtr p = lookupForAdd(k);\n        if (p) {\n            p->value = v;\n            return true;\n        }\n        return add(p, k, v);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        Entry e(k, v);\n        return impl.putNew(k, mozilla::Move(e));\n    }\n\n    // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom.\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        AddPtr p = lookupForAdd(k);\n        if (p)\n            return p;\n        (void)add(p, k, defaultValue);  // p is left false-y on oom.\n        return p;\n    }\n\n    // Remove if present.\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const Key &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashMap is movable\n    HashMap(mozilla::MoveRef<HashMap> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashMap> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashMap is not copyable or assignable\n    HashMap(const HashMap &hm) MOZ_DELETE;\n    HashMap &operator=(const HashMap &hm) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// A JS-friendly, STL-like container providing a hash-based set of values. In\n// particular, HashSet calls constructors and destructors of all objects added\n// so non-PODs may be used safely.\n//\n// T requirements:\n//  - movable, destructible, assignable\n// HashPolicy requirements:\n//  - see Hash Policy section below\n// AllocPolicy:\n//  - see jsalloc.h\n//\n// Note:\n// - HashSet is not reentrant: T/HashPolicy/AllocPolicy members called by\n//   HashSet must not call back into the same HashSet object.\n// - Due to the lack of exception handling, the user must call |init()|.\ntemplate <class T,\n          class HashPolicy = DefaultHasher<T>,\n          class AllocPolicy = TempAllocPolicy>\nclass HashSet\n{\n    struct SetOps : HashPolicy\n    {\n        typedef T KeyType;\n        static const KeyType &getKey(const T &t) { return t; }\n        static void setKey(T &t, KeyType &k) { t = k; }\n    };\n\n    typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;\n    Impl impl;\n\n  public:\n    typedef typename HashPolicy::Lookup Lookup;\n    typedef T Entry;\n\n    // HashSet construction is fallible (due to OOM); thus the user must call\n    // init after constructing a HashSet and check the return value.\n    HashSet(AllocPolicy a = AllocPolicy()) : impl(a)  {}\n    bool init(uint32_t len = 16)                      { return impl.init(len); }\n    bool initialized() const                          { return impl.initialized(); }\n\n    // Return whether the given lookup value is present in the map. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   if (HS::Ptr p = h.lookup(3)) {\n    //     assert(*p == 3);   // p acts like a pointer to int\n    //   }\n    //\n    // Also see the definition of Ptr in HashTable above.\n    typedef typename Impl::Ptr Ptr;\n    Ptr lookup(const Lookup &l) const                 { return impl.lookup(l); }\n\n    // Assuming |p.found()|, remove |*p|.\n    void remove(Ptr p)                                { impl.remove(p); }\n\n    // Like |lookup(l)|, but on miss, |p = lookupForAdd(l)| allows efficient\n    // insertion of T value |t| (where |HashPolicy::match(t,l) == true|) using\n    // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   HS::AddPtr p = h.lookupForAdd(3);\n    //   if (!p) {\n    //     if (!h.add(p, 3))\n    //       return false;\n    //   }\n    //   assert(*p == 3);   // p acts like a pointer to int\n    //\n    // Also see the definition of AddPtr in HashTable above.\n    //\n    // N.B. The caller must ensure that no mutating hash table operations\n    // occur between a pair of |lookupForAdd| and |add| calls. To avoid\n    // looking up the key a second time, the caller may use the more efficient\n    // relookupOrAdd method. This method reuses part of the hashing computation\n    // to more efficiently insert the key if it has not been added. For\n    // example, a mutation-handling version of the previous example:\n    //\n    //    HS::AddPtr p = h.lookupForAdd(3);\n    //    if (!p) {\n    //      call_that_may_mutate_h();\n    //      if (!h.relookupOrAdd(p, 3, 3))\n    //        return false;\n    //    }\n    //    assert(*p == 3);\n    //\n    // Note that relookupOrAdd(p,l,t) performs Lookup using |l| and adds the\n    // entry |t|, where the caller ensures match(l,t).\n    typedef typename Impl::AddPtr AddPtr;\n    AddPtr lookupForAdd(const Lookup &l) const        { return impl.lookupForAdd(l); }\n\n    bool add(AddPtr &p, const T &t)                   { return impl.add(p, t); }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return impl.relookupOrAdd(p, l, t);\n    }\n\n    // |all()| returns a Range containing |count()| elements:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS h;\n    //   for (HS::Range r = h.all(); !r.empty(); r.popFront())\n    //     int i = r.front();\n    //\n    // Also see the definition of Range in HashTable above.\n    typedef typename Impl::Range Range;\n    Range all() const                                 { return impl.all(); }\n\n    // Typedef for the enumeration class. An Enum may be used to examine and\n    // remove table entries:\n    //\n    //   typedef HashSet<int> HS;\n    //   HS s;\n    //   for (HS::Enum e(s); !e.empty(); e.popFront())\n    //     if (e.front() == 42)\n    //       e.removeFront();\n    //\n    // Table resize may occur in Enum's destructor. Also see the definition of\n    // Enum in HashTable above.\n    typedef typename Impl::Enum Enum;\n\n    // Remove all entries. This does not shrink the table. For that consider\n    // using the finish() method.\n    void clear()                                      { impl.clear(); }\n\n    // Remove all the entries and release all internal buffers. The set must\n    // be initialized again before any use.\n    void finish()                                     { impl.finish(); }\n\n    // Does the table contain any entries?\n    bool empty() const                                { return impl.empty(); }\n\n    // Number of live elements in the map.\n    uint32_t count() const                            { return impl.count(); }\n\n    // Total number of allocation in the dynamic table. Note: resize will\n    // happen well before count() == capacity().\n    size_t capacity() const                           { return impl.capacity(); }\n\n    // Don't just call |impl.sizeOfExcludingThis()| because there's no\n    // guarantee that |impl| is the first field in HashSet.\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return mallocSizeOf(this) + impl.sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    // If |generation()| is the same before and after a HashSet operation,\n    // pointers into the table remain valid.\n    unsigned generation() const                       { return impl.generation(); }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return impl.lookup(l) != NULL;\n    }\n\n    // Overwrite existing value with v. Return false on oom.\n    bool put(const T &t) {\n        AddPtr p = lookupForAdd(t);\n        return p ? true : add(p, t);\n    }\n\n    // Like put, but assert that the given key is not already present.\n    bool putNew(const T &t) {\n        return impl.putNew(t, t);\n    }\n\n    bool putNew(const Lookup &l, const T &t) {\n        return impl.putNew(l, t);\n    }\n\n    void remove(const Lookup &l) {\n        if (Ptr p = lookup(l))\n            remove(p);\n    }\n\n    // Infallibly rekey one entry, if present.\n    void rekey(const Lookup &old_key, const T &new_key) {\n        if (old_key != new_key) {\n            if (Ptr p = lookup(old_key))\n                impl.rekey(p, new_key, new_key);\n        }\n    }\n\n    // HashSet is movable\n    HashSet(mozilla::MoveRef<HashSet> rhs) : impl(mozilla::Move(rhs->impl)) {}\n    void operator=(mozilla::MoveRef<HashSet> rhs) { impl = mozilla::Move(rhs->impl); }\n\n  private:\n    // HashSet is not copyable or assignable\n    HashSet(const HashSet &hs) MOZ_DELETE;\n    HashSet &operator=(const HashSet &hs) MOZ_DELETE;\n\n    friend class Impl::Enum;\n};\n\n/*****************************************************************************/\n\n// Hash Policy\n//\n// A hash policy P for a hash table with key-type Key must provide:\n//  - a type |P::Lookup| to use to lookup table entries;\n//  - a static member function |P::hash| with signature\n//\n//      static js::HashNumber hash(Lookup)\n//\n//    to use to hash the lookup type; and\n//  - a static member function |P::match| with signature\n//\n//      static bool match(Key, Lookup)\n//\n//    to use to test equality of key and lookup values.\n//\n// Normally, Lookup = Key. In general, though, different values and types of\n// values can be used to lookup and store. If a Lookup value |l| is != to the\n// added Key value |k|, the user must ensure that |P::match(k,l)|. E.g.:\n//\n//   js::HashSet<Key, P>::AddPtr p = h.lookup(l);\n//   if (!p) {\n//     assert(P::match(k, l));  // must hold\n//     h.add(p, k);\n//   }\n\n// Pointer hashing policy that strips the lowest zeroBits when calculating the\n// hash to improve key distribution.\ntemplate <typename Key, size_t zeroBits>\nstruct PointerHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        size_t word = reinterpret_cast<size_t>(l) >> zeroBits;\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n#if JS_BYTES_PER_WORD == 4\n        return HashNumber(word);\n#else\n        JS_STATIC_ASSERT(sizeof word == 8);\n        return HashNumber((word >> 32) ^ word);\n#endif\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        JS_ASSERT(!JS::IsPoisonedPtr(k));\n        JS_ASSERT(!JS::IsPoisonedPtr(l));\n        return k == l;\n    }\n};\n\n// Default hash policy: just use the 'lookup' value. This of course only\n// works if the lookup value is integral. HashTable applies ScrambleHashCode to\n// the result of the 'hash' which means that it is 'ok' if the lookup value is\n// not well distributed over the HashNumber domain.\ntemplate <class Key>\nstruct DefaultHasher\n{\n    typedef Key Lookup;\n    static HashNumber hash(const Lookup &l) {\n        // Hash if can implicitly cast to hash number type.\n        return l;\n    }\n    static bool match(const Key &k, const Lookup &l) {\n        // Use builtin or overloaded operator==.\n        return k == l;\n    }\n};\n\n// Specialize hashing policy for pointer types. It assumes that the type is\n// at least word-aligned. For types with smaller size use PointerHasher.\ntemplate <class T>\nstruct DefaultHasher<T *> : PointerHasher<T *, mozilla::tl::FloorLog2<sizeof(void *)>::value>\n{};\n\n// For doubles, we can xor the two uint32s.\ntemplate <>\nstruct DefaultHasher<double>\n{\n    typedef double Lookup;\n    static HashNumber hash(double d) {\n        JS_STATIC_ASSERT(sizeof(HashNumber) == 4);\n        uint64_t u = mozilla::BitwiseCast<uint64_t>(d);\n        return HashNumber(u ^ (u >> 32));\n    }\n    static bool match(double lhs, double rhs) {\n        return mozilla::BitwiseCast<uint64_t>(lhs) == mozilla::BitwiseCast<uint64_t>(rhs);\n    }\n};\n\n/*****************************************************************************/\n\n// Both HashMap and HashSet are implemented by a single HashTable that is even\n// more heavily parameterized than the other two. This leaves HashTable gnarly\n// and extremely coupled to HashMap and HashSet; thus code should not use\n// HashTable directly.\n\ntemplate <class Key, class Value>\nclass HashMapEntry\n{\n    template <class, class, class> friend class detail::HashTable;\n    template <class> friend class detail::HashTableEntry;\n\n    HashMapEntry(const HashMapEntry &) MOZ_DELETE;\n    void operator=(const HashMapEntry &) MOZ_DELETE;\n\n  public:\n    template<typename KeyInput, typename ValueInput>\n    HashMapEntry(const KeyInput &k, const ValueInput &v) : key(k), value(v) {}\n\n    HashMapEntry(mozilla::MoveRef<HashMapEntry> rhs)\n      : key(mozilla::Move(rhs->key)), value(mozilla::Move(rhs->value)) { }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n\n    const Key key;\n    Value value;\n};\n\n} // namespace js\n\nnamespace mozilla {\n\ntemplate <typename T>\nstruct IsPod<js::detail::HashTableEntry<T> > : IsPod<T> {};\n\ntemplate <typename K, typename V>\nstruct IsPod<js::HashMapEntry<K, V> >\n  : IntegralConstant<bool, IsPod<K>::value && IsPod<V>::value>\n{};\n\n} // namespace mozilla\n\nnamespace js {\n\nnamespace detail {\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable;\n\ntemplate <class T>\nclass HashTableEntry\n{\n    template <class, class, class> friend class HashTable;\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n\n    HashNumber keyHash;\n    mozilla::AlignedStorage2<NonConstT> mem;\n\n    static const HashNumber sFreeKey = 0;\n    static const HashNumber sRemovedKey = 1;\n    static const HashNumber sCollisionBit = 1;\n\n    // Assumed by calloc in createTable.\n    JS_STATIC_ASSERT(sFreeKey == 0);\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return hash > sRemovedKey;\n    }\n\n    HashTableEntry(const HashTableEntry &) MOZ_DELETE;\n    void operator=(const HashTableEntry &) MOZ_DELETE;\n    ~HashTableEntry() MOZ_DELETE;\n\n  public:\n    // NB: HashTableEntry is treated as a POD: no constructor or destructor calls.\n\n    void destroyIfLive() {\n        if (isLive())\n            mem.addr()->~T();\n    }\n\n    void destroy() {\n        JS_ASSERT(isLive());\n        mem.addr()->~T();\n    }\n\n    void swap(HashTableEntry *other) {\n        mozilla::Swap(keyHash, other->keyHash);\n        mozilla::Swap(mem, other->mem);\n    }\n\n    T &get() { JS_ASSERT(isLive()); return *mem.addr(); }\n\n    bool isFree() const    { return keyHash == sFreeKey; }\n    void clearLive()       { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }\n    void clear()           { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }\n    bool isRemoved() const { return keyHash == sRemovedKey; }\n    void removeLive()      { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }\n    bool isLive() const    { return isLiveHash(keyHash); }\n    void setCollision()               { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }\n    void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }\n    void unsetCollision()             { keyHash &= ~sCollisionBit; }\n    bool hasCollision() const         { return keyHash & sCollisionBit; }\n    bool matchHash(HashNumber hn)     { return (keyHash & ~sCollisionBit) == hn; }\n    HashNumber getKeyHash() const     { return keyHash & ~sCollisionBit; }\n\n    template <class U>\n    void setLive(HashNumber hn, const U &u)\n    {\n        JS_ASSERT(!isLive());\n        keyHash = hn;\n        new(mem.addr()) T(u);\n        JS_ASSERT(isLive());\n    }\n};\n\ntemplate <class T, class HashPolicy, class AllocPolicy>\nclass HashTable : private AllocPolicy\n{\n    typedef typename mozilla::RemoveConst<T>::Type NonConstT;\n    typedef typename HashPolicy::KeyType Key;\n    typedef typename HashPolicy::Lookup Lookup;\n\n  public:\n    typedef HashTableEntry<T> Entry;\n\n    // A nullable pointer to a hash table element. A Ptr |p| can be tested\n    // either explicitly |if (p.found()) p->...| or using boolean conversion\n    // |if (p) p->...|. Ptr objects must not be used after any mutating hash\n    // table operations unless |generation()| is tested.\n    class Ptr\n    {\n        friend class HashTable;\n        typedef void (Ptr::* ConvertibleToBool)();\n        void nonNull() {}\n\n        Entry *entry_;\n\n      protected:\n        Ptr(Entry &entry) : entry_(&entry) {}\n\n      public:\n        // Leaves Ptr uninitialized.\n        Ptr() {\n#ifdef DEBUG\n            entry_ = (Entry *)0xbad;\n#endif\n        }\n\n        bool found() const                    { return entry_->isLive(); }\n        operator ConvertibleToBool() const    { return found() ? &Ptr::nonNull : 0; }\n        bool operator==(const Ptr &rhs) const { JS_ASSERT(found() && rhs.found()); return entry_ == rhs.entry_; }\n        bool operator!=(const Ptr &rhs) const { return !(*this == rhs); }\n\n        T &operator*() const                  { return entry_->get(); }\n        T *operator->() const                 { return &entry_->get(); }\n    };\n\n    // A Ptr that can be used to add a key after a failed lookup.\n    class AddPtr : public Ptr\n    {\n        friend class HashTable;\n        HashNumber keyHash;\n        mozilla::DebugOnly<uint64_t> mutationCount;\n\n        AddPtr(Entry &entry, HashNumber hn) : Ptr(entry), keyHash(hn) {}\n      public:\n        // Leaves AddPtr uninitialized.\n        AddPtr() {}\n    };\n\n    // A collection of hash table entries. The collection is enumerated by\n    // calling |front()| followed by |popFront()| as long as |!empty()|. As\n    // with Ptr/AddPtr, Range objects must not be used after any mutating hash\n    // table operation unless the |generation()| is tested.\n    class Range\n    {\n      protected:\n        friend class HashTable;\n\n        Range(Entry *c, Entry *e) : cur(c), end(e), validEntry(true) {\n            while (cur < end && !cur->isLive())\n                ++cur;\n        }\n\n        Entry *cur, *end;\n        mozilla::DebugOnly<bool> validEntry;\n\n      public:\n        Range() : cur(NULL), end(NULL), validEntry(false) {}\n\n        bool empty() const {\n            return cur == end;\n        }\n\n        T &front() const {\n            JS_ASSERT(validEntry);\n            JS_ASSERT(!empty());\n            return cur->get();\n        }\n\n        void popFront() {\n            JS_ASSERT(!empty());\n            while (++cur < end && !cur->isLive())\n                continue;\n            validEntry = true;\n        }\n    };\n\n    // A Range whose lifetime delimits a mutating enumeration of a hash table.\n    // Since rehashing when elements were removed during enumeration would be\n    // bad, it is postponed until the Enum is destructed.  Since the Enum's\n    // destructor touches the hash table, the user must ensure that the hash\n    // table is still alive when the destructor runs.\n    class Enum : public Range\n    {\n        friend class HashTable;\n\n        HashTable &table;\n        bool rekeyed;\n        bool removed;\n\n        /* Not copyable. */\n        Enum(const Enum &);\n        void operator=(const Enum &);\n\n      public:\n        template<class Map> explicit\n        Enum(Map &map) : Range(map.all()), table(map.impl), rekeyed(false), removed(false) {}\n\n        // Removes the |front()| element from the table, leaving |front()|\n        // invalid until the next call to |popFront()|. For example:\n        //\n        //   HashSet<int> s;\n        //   for (HashSet<int>::Enum e(s); !e.empty(); e.popFront())\n        //     if (e.front() == 42)\n        //       e.removeFront();\n        void removeFront() {\n            table.remove(*this->cur);\n            removed = true;\n            this->validEntry = false;\n        }\n\n        // Removes the |front()| element and re-inserts it into the table with\n        // a new key at the new Lookup position.  |front()| is invalid after\n        // this operation until the next call to |popFront()|.\n        void rekeyFront(const Lookup &l, const Key &k) {\n            table.rekey(*this->cur, l, k);\n            rekeyed = true;\n            this->validEntry = false;\n        }\n\n        void rekeyFront(const Key &k) {\n            rekeyFront(k, k);\n        }\n\n        // Potentially rehashes the table.\n        ~Enum() {\n            if (rekeyed) {\n                table.gen++;\n                table.checkOverRemoved();\n            }\n\n            if (removed)\n                table.compactIfUnderloaded();\n        }\n    };\n\n    // HashTable is movable\n    HashTable(mozilla::MoveRef<HashTable> rhs)\n      : AllocPolicy(*rhs)\n    {\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n    void operator=(mozilla::MoveRef<HashTable> rhs) {\n        if (table)\n            destroyTable(*this, table, capacity());\n        mozilla::PodAssign(this, &*rhs);\n        rhs->table = NULL;\n    }\n\n  private:\n    // HashTable is not copyable or assignable\n    HashTable(const HashTable &) MOZ_DELETE;\n    void operator=(const HashTable &) MOZ_DELETE;\n\n  private:\n    uint32_t    hashShift;      // multiplicative hash shift\n    uint32_t    entryCount;     // number of entries in table\n    uint32_t    gen;            // entry storage generation number\n    uint32_t    removedCount;   // removed entry sentinels in table\n    Entry       *table;         // entry storage\n\n    void setTableSizeLog2(unsigned sizeLog2)\n    {\n        hashShift = sHashBits - sizeLog2;\n    }\n\n#ifdef DEBUG\n    mutable struct Stats\n    {\n        uint32_t        searches;       // total number of table searches\n        uint32_t        steps;          // hash chain links traversed\n        uint32_t        hits;           // searches that found key\n        uint32_t        misses;         // searches that didn't find key\n        uint32_t        addOverRemoved; // adds that recycled a removed entry\n        uint32_t        removes;        // calls to remove\n        uint32_t        removeFrees;    // calls to remove that freed the entry\n        uint32_t        grows;          // table expansions\n        uint32_t        shrinks;        // table contractions\n        uint32_t        compresses;     // table compressions\n        uint32_t        rehashes;       // tombstone decontaminations\n    } stats;\n#   define METER(x) x\n#else\n#   define METER(x)\n#endif\n\n    friend class mozilla::ReentrancyGuard;\n    mutable mozilla::DebugOnly<bool> entered;\n    mozilla::DebugOnly<uint64_t>     mutationCount;\n\n    // The default initial capacity is 32 (enough to hold 16 elements), but it\n    // can be as low as 4.\n    static const unsigned sMinCapacityLog2 = 2;\n    static const unsigned sMinCapacity  = 1 << sMinCapacityLog2;\n    static const unsigned sMaxInit      = JS_BIT(23);\n    static const unsigned sMaxCapacity  = JS_BIT(24);\n    static const unsigned sHashBits     = mozilla::tl::BitSize<HashNumber>::value;\n    static const uint8_t  sMinAlphaFrac = 64;  // (0x100 * .25)\n    static const uint8_t  sMaxAlphaFrac = 192; // (0x100 * .75)\n    static const uint8_t  sInvMaxAlpha  = 171; // (ceil(0x100 / .75) >> 1)\n    static const HashNumber sFreeKey = Entry::sFreeKey;\n    static const HashNumber sRemovedKey = Entry::sRemovedKey;\n    static const HashNumber sCollisionBit = Entry::sCollisionBit;\n\n    static void staticAsserts()\n    {\n        // Rely on compiler \"constant overflow warnings\".\n        JS_STATIC_ASSERT(((sMaxInit * sInvMaxAlpha) >> 7) < sMaxCapacity);\n        JS_STATIC_ASSERT((sMaxCapacity * sInvMaxAlpha) <= UINT32_MAX);\n        JS_STATIC_ASSERT((sMaxCapacity * sizeof(Entry)) <= UINT32_MAX);\n    }\n\n    static bool isLiveHash(HashNumber hash)\n    {\n        return Entry::isLiveHash(hash);\n    }\n\n    static HashNumber prepareHash(const Lookup& l)\n    {\n        HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l));\n\n        // Avoid reserved hash codes.\n        if (!isLiveHash(keyHash))\n            keyHash -= (sRemovedKey + 1);\n        return keyHash & ~sCollisionBit;\n    }\n\n    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)\n    {\n        // See JS_STATIC_ASSERT(sFreeKey == 0) in HashTableEntry.\n        return (Entry *)alloc.calloc_(capacity * sizeof(Entry));\n    }\n\n    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)\n    {\n        for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)\n            e->destroyIfLive();\n        alloc.free_(oldTable);\n    }\n\n  public:\n    HashTable(AllocPolicy ap)\n      : AllocPolicy(ap),\n        hashShift(sHashBits),\n        entryCount(0),\n        gen(0),\n        removedCount(0),\n        table(NULL),\n        entered(false),\n        mutationCount(0)\n    {}\n\n    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)\n    {\n        JS_ASSERT(!initialized());\n\n        // Correct for sMaxAlphaFrac such that the table will not resize\n        // when adding 'length' entries.\n        if (length > sMaxInit) {\n            this->reportAllocOverflow();\n            return false;\n        }\n        uint32_t newCapacity = (length * sInvMaxAlpha) >> 7;\n\n        if (newCapacity < sMinCapacity)\n            newCapacity = sMinCapacity;\n\n        // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034).\n        uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2;\n        while (roundUp < newCapacity) {\n            roundUp <<= 1;\n            ++roundUpLog2;\n        }\n\n        newCapacity = roundUp;\n        JS_ASSERT(newCapacity <= sMaxCapacity);\n\n        table = createTable(*this, newCapacity);\n        if (!table)\n            return false;\n\n        setTableSizeLog2(roundUpLog2);\n        METER(memset(&stats, 0, sizeof(stats)));\n        return true;\n    }\n\n    bool initialized() const\n    {\n        return !!table;\n    }\n\n    ~HashTable()\n    {\n        if (table)\n            destroyTable(*this, table, capacity());\n    }\n\n  private:\n    HashNumber hash1(HashNumber hash0) const\n    {\n        return hash0 >> hashShift;\n    }\n\n    struct DoubleHash\n    {\n        HashNumber h2;\n        HashNumber sizeMask;\n    };\n\n    DoubleHash hash2(HashNumber curKeyHash) const\n    {\n        unsigned sizeLog2 = sHashBits - hashShift;\n        DoubleHash dh = {\n            ((curKeyHash << sizeLog2) >> hashShift) | 1,\n            (HashNumber(1) << sizeLog2) - 1\n        };\n        return dh;\n    }\n\n    static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh)\n    {\n        return (h1 - dh.h2) & dh.sizeMask;\n    }\n\n    bool overloaded()\n    {\n        return entryCount + removedCount >= ((sMaxAlphaFrac * capacity()) >> 8);\n    }\n\n    // Would the table be underloaded if it had the given capacity and entryCount?\n    static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount)\n    {\n        return capacity > sMinCapacity && entryCount <= ((sMinAlphaFrac * capacity) >> 8);\n    }\n\n    bool underloaded()\n    {\n        return wouldBeUnderloaded(capacity(), entryCount);\n    }\n\n    static bool match(Entry &e, const Lookup &l)\n    {\n        return HashPolicy::match(HashPolicy::getKey(e.get()), l);\n    }\n\n    Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const\n    {\n        JS_ASSERT(isLiveHash(keyHash));\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (entry->isFree()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Hit: return entry.\n        if (entry->matchHash(keyHash) && match(*entry, l)) {\n            METER(stats.hits++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        // Save the first removed entry pointer so we can recycle later.\n        Entry *firstRemoved = NULL;\n\n        while(true) {\n            if (JS_UNLIKELY(entry->isRemoved())) {\n                if (!firstRemoved)\n                    firstRemoved = entry;\n            } else {\n                entry->setCollision(collisionBit);\n            }\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (entry->isFree()) {\n                METER(stats.misses++);\n                return firstRemoved ? *firstRemoved : *entry;\n            }\n\n            if (entry->matchHash(keyHash) && match(*entry, l)) {\n                METER(stats.hits++);\n                return *entry;\n            }\n        }\n    }\n\n    // This is a copy of lookup hardcoded to the assumptions:\n    //   1. the lookup is a lookupForAdd\n    //   2. the key, whose |keyHash| has been passed is not in the table,\n    //   3. no entries have been removed from the table.\n    // This specialized search avoids the need for recovering lookup values\n    // from entries, which allows more flexible Lookup/Key types.\n    Entry &findFreeEntry(HashNumber keyHash)\n    {\n        JS_ASSERT(!(keyHash & sCollisionBit));\n        JS_ASSERT(table);\n        METER(stats.searches++);\n\n        // We assume 'keyHash' has already been distributed.\n\n        // Compute the primary hash address.\n        HashNumber h1 = hash1(keyHash);\n        Entry *entry = &table[h1];\n\n        // Miss: return space for a new entry.\n        if (!entry->isLive()) {\n            METER(stats.misses++);\n            return *entry;\n        }\n\n        // Collision: double hash.\n        DoubleHash dh = hash2(keyHash);\n\n        while(true) {\n            JS_ASSERT(!entry->isRemoved());\n            entry->setCollision();\n\n            METER(stats.steps++);\n            h1 = applyDoubleHash(h1, dh);\n\n            entry = &table[h1];\n            if (!entry->isLive()) {\n                METER(stats.misses++);\n                return *entry;\n            }\n        }\n    }\n\n    enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed };\n\n    RebuildStatus changeTableSize(int deltaLog2)\n    {\n        // Look, but don't touch, until we succeed in getting new entry store.\n        Entry *oldTable = table;\n        uint32_t oldCap = capacity();\n        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;\n        uint32_t newCapacity = JS_BIT(newLog2);\n        if (newCapacity > sMaxCapacity) {\n            this->reportAllocOverflow();\n            return RehashFailed;\n        }\n\n        Entry *newTable = createTable(*this, newCapacity);\n        if (!newTable)\n            return RehashFailed;\n\n        // We can't fail from here on, so update table parameters.\n        setTableSizeLog2(newLog2);\n        removedCount = 0;\n        gen++;\n        table = newTable;\n\n        // Copy only live entries, leaving removed ones behind.\n        for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {\n            if (src->isLive()) {\n                HashNumber hn = src->getKeyHash();\n                findFreeEntry(hn).setLive(hn, mozilla::Move(src->get()));\n                src->destroy();\n            }\n        }\n\n        // All entries have been destroyed, no need to destroyTable.\n        this->free_(oldTable);\n        return Rehashed;\n    }\n\n    RebuildStatus checkOverloaded()\n    {\n        if (!overloaded())\n            return NotOverloaded;\n\n        // Compress if a quarter or more of all entries are removed.\n        int deltaLog2;\n        if (removedCount >= (capacity() >> 2)) {\n            METER(stats.compresses++);\n            deltaLog2 = 0;\n        } else {\n            METER(stats.grows++);\n            deltaLog2 = 1;\n        }\n\n        return changeTableSize(deltaLog2);\n    }\n\n    // Infallibly rehash the table if we are overloaded with removals.\n    void checkOverRemoved()\n    {\n        if (overloaded()) {\n            if (checkOverloaded() == RehashFailed)\n                rehashTableInPlace();\n        }\n    }\n\n    void remove(Entry &e)\n    {\n        JS_ASSERT(table);\n        METER(stats.removes++);\n\n        if (e.hasCollision()) {\n            e.removeLive();\n            removedCount++;\n        } else {\n            METER(stats.removeFrees++);\n            e.clearLive();\n        }\n        entryCount--;\n        mutationCount++;\n    }\n\n    void checkUnderloaded()\n    {\n        if (underloaded()) {\n            METER(stats.shrinks++);\n            (void) changeTableSize(-1);\n        }\n    }\n\n    // Resize the table down to the largest capacity which doesn't underload the\n    // table.  Since we call checkUnderloaded() on every remove, you only need\n    // to call this after a bulk removal of items done without calling remove().\n    void compactIfUnderloaded()\n    {\n        int32_t resizeLog2 = 0;\n        uint32_t newCapacity = capacity();\n        while (wouldBeUnderloaded(newCapacity, entryCount)) {\n            newCapacity = newCapacity >> 1;\n            resizeLog2--;\n        }\n\n        if (resizeLog2 != 0) {\n            changeTableSize(resizeLog2);\n        }\n    }\n\n    // This is identical to changeTableSize(currentSize), but without requiring\n    // a second table.  We do this by recycling the collision bits to tell us if\n    // the element is already inserted or still waiting to be inserted.  Since\n    // already-inserted elements win any conflicts, we get the same table as we\n    // would have gotten through random insertion order.\n    void rehashTableInPlace()\n    {\n        METER(stats.rehashes++);\n        removedCount = 0;\n        for (size_t i = 0; i < capacity(); ++i)\n            table[i].unsetCollision();\n\n        for (size_t i = 0; i < capacity();) {\n            Entry *src = &table[i];\n\n            if (!src->isLive() || src->hasCollision()) {\n                ++i;\n                continue;\n            }\n\n            HashNumber keyHash = src->getKeyHash();\n            HashNumber h1 = hash1(keyHash);\n            DoubleHash dh = hash2(keyHash);\n            Entry *tgt = &table[h1];\n            while (true) {\n                if (!tgt->hasCollision()) {\n                    src->swap(tgt);\n                    tgt->setCollision();\n                    break;\n                }\n\n                h1 = applyDoubleHash(h1, dh);\n                tgt = &table[h1];\n            }\n        }\n\n        // TODO: this algorithm leaves collision bits on *all* elements, even if\n        // they are on no collision path. We have the option of setting the\n        // collision bits correctly on a subsequent pass or skipping the rehash\n        // unless we are totally filled with tombstones: benchmark to find out\n        // which approach is best.\n    }\n\n  public:\n    void clear()\n    {\n        if (mozilla::IsPod<Entry>::value) {\n            memset(table, 0, sizeof(*table) * capacity());\n        } else {\n            uint32_t tableCapacity = capacity();\n            for (Entry *e = table, *end = table + tableCapacity; e < end; ++e)\n                e->clear();\n        }\n        removedCount = 0;\n        entryCount = 0;\n        mutationCount++;\n    }\n\n    void finish()\n    {\n        JS_ASSERT(!entered);\n\n        if (!table)\n            return;\n\n        destroyTable(*this, table, capacity());\n        table = NULL;\n        gen++;\n        entryCount = 0;\n        removedCount = 0;\n        mutationCount++;\n    }\n\n    Range all() const\n    {\n        JS_ASSERT(table);\n        return Range(table, table + capacity());\n    }\n\n    bool empty() const\n    {\n        JS_ASSERT(table);\n        return !entryCount;\n    }\n\n    uint32_t count() const\n    {\n        JS_ASSERT(table);\n        return entryCount;\n    }\n\n    uint32_t capacity() const\n    {\n        JS_ASSERT(table);\n        return JS_BIT(sHashBits - hashShift);\n    }\n\n    uint32_t generation() const\n    {\n        JS_ASSERT(table);\n        return gen;\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(table);\n    }\n\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const\n    {\n        return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n    }\n\n    Ptr lookup(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    Ptr readonlyThreadsafeLookup(const Lookup &l) const\n    {\n        HashNumber keyHash = prepareHash(l);\n        return Ptr(lookup(l, keyHash, 0));\n    }\n\n    AddPtr lookupForAdd(const Lookup &l) const\n    {\n        mozilla::ReentrancyGuard g(*this);\n        HashNumber keyHash = prepareHash(l);\n        Entry &entry = lookup(l, keyHash, sCollisionBit);\n        AddPtr p(entry, keyHash);\n        p.mutationCount = mutationCount;\n        return p;\n    }\n\n    template <class U>\n    bool add(AddPtr &p, const U &rhs)\n    {\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(mutationCount == p.mutationCount);\n        JS_ASSERT(table);\n        JS_ASSERT(!p.found());\n        JS_ASSERT(!(p.keyHash & sCollisionBit));\n\n        // Changing an entry from removed to live does not affect whether we\n        // are overloaded and can be handled separately.\n        if (p.entry_->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            p.keyHash |= sCollisionBit;\n        } else {\n            // Preserve the validity of |p.entry_|.\n            RebuildStatus status = checkOverloaded();\n            if (status == RehashFailed)\n                return false;\n            if (status == Rehashed)\n                p.entry_ = &findFreeEntry(p.keyHash);\n        }\n\n        p.entry_->setLive(p.keyHash, rhs);\n        entryCount++;\n        mutationCount++;\n        return true;\n    }\n\n    template <class U>\n    void putNewInfallible(const Lookup &l, const U &u)\n    {\n        JS_ASSERT(table);\n\n        HashNumber keyHash = prepareHash(l);\n        Entry *entry = &findFreeEntry(keyHash);\n\n        if (entry->isRemoved()) {\n            METER(stats.addOverRemoved++);\n            removedCount--;\n            keyHash |= sCollisionBit;\n        }\n\n        entry->setLive(keyHash, u);\n        entryCount++;\n        mutationCount++;\n    }\n\n    template <class U>\n    bool putNew(const Lookup &l, const U &u)\n    {\n        if (checkOverloaded() == RehashFailed)\n            return false;\n\n        putNewInfallible(l, u);\n        return true;\n    }\n\n    template <class U>\n    bool relookupOrAdd(AddPtr& p, const Lookup &l, const U &u)\n    {\n        p.mutationCount = mutationCount;\n        {\n            mozilla::ReentrancyGuard g(*this);\n            p.entry_ = &lookup(l, p.keyHash, sCollisionBit);\n        }\n        return p.found() || add(p, u);\n    }\n\n    void remove(Ptr p)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        remove(*p.entry_);\n        checkUnderloaded();\n    }\n\n    void rekey(Ptr p, const Lookup &l, const Key &k)\n    {\n        JS_ASSERT(table);\n        mozilla::ReentrancyGuard g(*this);\n        JS_ASSERT(p.found());\n        typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));\n        HashPolicy::setKey(t, const_cast<Key &>(k));\n        remove(*p.entry_);\n        putNewInfallible(l, mozilla::Move(t));\n    }\n\n#undef METER\n};\n\n}  // namespace detail\n}  // namespace js\n\n#endif  /* js_HashTable_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/HeapAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_HeapAPI_h\n#define js_HeapAPI_h\n\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n\n/* These values are private to the JS engine. */\nnamespace js {\nnamespace gc {\n\nconst size_t ArenaShift = 12;\nconst size_t ArenaSize = size_t(1) << ArenaShift;\nconst size_t ArenaMask = ArenaSize - 1;\n\nconst size_t ChunkShift = 20;\nconst size_t ChunkSize = size_t(1) << ChunkShift;\nconst size_t ChunkMask = ChunkSize - 1;\n\nconst size_t CellShift = 3;\nconst size_t CellSize = size_t(1) << CellShift;\nconst size_t CellMask = CellSize - 1;\n\n/* These are magic constants derived from actual offsets in gc/Heap.h. */\nconst size_t ChunkMarkBitmapOffset = 1032368;\nconst size_t ChunkMarkBitmapBits = 129024;\nconst size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);\n\n/*\n * Live objects are marked black. How many other additional colors are available\n * depends on the size of the GCThing. Objects marked gray are eligible for\n * cycle collection.\n */\nstatic const uint32_t BLACK = 0;\nstatic const uint32_t GRAY = 1;\n\n} /* namespace gc */\n} /* namespace js */\n\nnamespace JS {\nstruct Zone;\n} /* namespace JS */\n\nnamespace JS {\nnamespace shadow {\n\nstruct ArenaHeader\n{\n    JS::Zone *zone;\n};\n\nstruct Zone\n{\n    bool needsBarrier_;\n\n    Zone() : needsBarrier_(false) {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\nnamespace gc {\n\nstatic JS_ALWAYS_INLINE uintptr_t *\nGetGCThingMarkBitmap(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkMarkBitmapOffset;\n    return reinterpret_cast<uintptr_t *>(addr);\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::Runtime *\nGetGCThingRuntime(const void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ChunkMask;\n    addr |= js::gc::ChunkRuntimeOffset;\n    return *reinterpret_cast<JS::shadow::Runtime **>(addr);\n}\n\nstatic JS_ALWAYS_INLINE void\nGetGCThingMarkWordAndMask(const void *thing, uint32_t color,\n                          uintptr_t **wordp, uintptr_t *maskp)\n{\n    uintptr_t addr = uintptr_t(thing);\n    size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;\n    JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);\n    uintptr_t *bitmap = GetGCThingMarkBitmap(thing);\n    *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD);\n    *wordp = &bitmap[bit / JS_BITS_PER_WORD];\n}\n\nstatic JS_ALWAYS_INLINE JS::shadow::ArenaHeader *\nGetGCThingArena(void *thing)\n{\n    uintptr_t addr = uintptr_t(thing);\n    addr &= ~js::gc::ArenaMask;\n    return reinterpret_cast<JS::shadow::ArenaHeader *>(addr);\n}\n\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\nstatic JS_ALWAYS_INLINE Zone *\nGetGCThingZone(void *thing)\n{\n    JS_ASSERT(thing);\n    return js::gc::GetGCThingArena(thing)->zone;\n}\n\nstatic JS_ALWAYS_INLINE Zone *\nGetObjectZone(JSObject *obj)\n{\n    return GetGCThingZone(obj);\n}\n\nstatic JS_ALWAYS_INLINE bool\nGCThingIsMarkedGray(void *thing)\n{\n    uintptr_t *word, mask;\n    js::gc::GetGCThingMarkWordAndMask(thing, js::gc::GRAY, &word, &mask);\n    return *word & mask;\n}\n\nstatic JS_ALWAYS_INLINE bool\nIsIncrementalBarrierNeededOnGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind)\n{\n    if (!rt->needsBarrier_)\n        return false;\n    JS::Zone *zone = GetGCThingZone(thing);\n    return reinterpret_cast<shadow::Zone *>(zone)->needsBarrier_;\n}\n\n} /* namespace JS */\n\n#endif /* js_HeapAPI_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/LegacyIntTypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This section typedefs the old 'native' types to the new <stdint.h> types.\n * These redefinitions are provided solely to allow JSAPI users to more easily\n * transition to <stdint.h> types.  They are not to be used in the JSAPI, and\n * new JSAPI user code should not use them.  This mapping file may eventually\n * be removed from SpiderMonkey, so don't depend on it in the long run.\n */\n\n/*\n * BEWARE: Comity with other implementers of these types is not guaranteed.\n *         Indeed, if you use this header and third-party code defining these\n *         types, *expect* to encounter either compile errors or link errors,\n *         depending how these types are used and on the order of inclusion.\n *         It is safest to use only the <stdint.h> types.\n */\n#ifndef js_LegacyIntTypes_h\n#define js_LegacyIntTypes_h\n\n#include <stdint.h>\n\n#include \"js-config.h\"\n\ntypedef uint8_t uint8;\ntypedef uint16_t uint16;\ntypedef uint32_t uint32;\ntypedef uint64_t uint64;\n\n/*\n * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very\n * common header file) defines the types int8, int16, int32, and int64.\n * So we don't define these four types here to avoid conflicts in case\n * the code also includes sys/types.h.\n */\n#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)\n#include <sys/inttypes.h>\n#else\ntypedef int8_t int8;\ntypedef int16_t int16;\ntypedef int32_t int32;\ntypedef int64_t int64;\n#endif /* AIX && HAVE_SYS_INTTYPES_H */\n\ntypedef uint8_t JSUint8;\ntypedef uint16_t JSUint16;\ntypedef uint32_t JSUint32;\ntypedef uint64_t JSUint64;\n\ntypedef int8_t JSInt8;\ntypedef int16_t JSInt16;\ntypedef int32_t JSInt32;\ntypedef int64_t JSInt64;\n\n#endif /* js_LegacyIntTypes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/MemoryMetrics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_MemoryMetrics_h\n#define js_MemoryMetrics_h\n\n// These declarations are not within jsapi.h because they are highly likely to\n// change in the future. Depend on them at your own risk.\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include <string.h>\n\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/Utility.h\"\n#include \"js/Vector.h\"\n\nclass nsISupports;      // This is needed for ObjectPrivateVisitor.\n\nnamespace js {\n\n// In memory reporting, we have concept of \"sundries\", line items which are too\n// small to be worth reporting individually.  Under some circumstances, a memory\n// reporter gets tossed into the sundries bucket if it's smaller than\n// MemoryReportingSundriesThreshold() bytes.\n//\n// We need to define this value here, rather than in the code which actually\n// generates the memory reports, because HugeStringInfo uses this value.\nJS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();\n\n} // namespace js\n\nnamespace JS {\n\n// Data for tracking memory usage of things hanging off objects.\nstruct ObjectsExtraSizes\n{\n    size_t slots;\n    size_t elementsNonAsmJS;\n    size_t elementsAsmJSHeap;\n    size_t elementsAsmJSNonHeap;\n    size_t argumentsData;\n    size_t regExpStatics;\n    size_t propertyIteratorData;\n    size_t ctypesData;\n    size_t private_;    // The '_' suffix is required because |private| is a keyword.\n                        // Note that this field is measured separately from the others.\n\n    ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); }\n\n    void add(ObjectsExtraSizes &sizes) {\n        this->slots                += sizes.slots;\n        this->elementsNonAsmJS     += sizes.elementsNonAsmJS;\n        this->elementsAsmJSHeap    += sizes.elementsAsmJSHeap;\n        this->elementsAsmJSNonHeap += sizes.elementsAsmJSNonHeap;\n        this->argumentsData        += sizes.argumentsData;\n        this->regExpStatics        += sizes.regExpStatics;\n        this->propertyIteratorData += sizes.propertyIteratorData;\n        this->ctypesData           += sizes.ctypesData;\n        this->private_             += sizes.private_;\n    }\n};\n\n// Data for tracking analysis/inference memory usage.\nstruct TypeInferenceSizes\n{\n    size_t typeScripts;\n    size_t typeResults;\n    size_t analysisPool;\n    size_t pendingArrays;\n    size_t allocationSiteTables;\n    size_t arrayTypeTables;\n    size_t objectTypeTables;\n\n    TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); }\n\n    void add(TypeInferenceSizes &sizes) {\n        this->typeScripts          += sizes.typeScripts;\n        this->typeResults          += sizes.typeResults;\n        this->analysisPool         += sizes.analysisPool;\n        this->pendingArrays        += sizes.pendingArrays;\n        this->allocationSiteTables += sizes.allocationSiteTables;\n        this->arrayTypeTables      += sizes.arrayTypeTables;\n        this->objectTypeTables     += sizes.objectTypeTables;\n    }\n};\n\n// Data for tracking JIT-code memory usage.\nstruct CodeSizes\n{\n    size_t ion;\n    size_t asmJS;\n    size_t baseline;\n    size_t regexp;\n    size_t other;\n    size_t unused;\n\n    CodeSizes() { memset(this, 0, sizeof(CodeSizes)); }\n};\n\n// Holds data about a huge string (one which uses more HugeStringInfo::MinSize\n// bytes of memory), so we can report it individually.\nstruct HugeStringInfo\n{\n    HugeStringInfo() : length(0), size(0) { memset(&buffer, 0, sizeof(buffer)); }\n\n    // A string needs to take up this many bytes of storage before we consider\n    // it to be \"huge\".\n    static size_t MinSize() {\n        return js::MemoryReportingSundriesThreshold();\n    }\n\n    // A string's size in memory is not necessarily equal to twice its length\n    // because the allocator and the JS engine both may round up.\n    size_t length;\n    size_t size;\n\n    // We record the first 32 chars of the escaped string here.  (We escape the\n    // string so we can use a char[] instead of a jschar[] here.\n    char buffer[32];\n};\n\n// These measurements relate directly to the JSRuntime, and not to\n// compartments within it.\nstruct RuntimeSizes\n{\n    RuntimeSizes() { memset(this, 0, sizeof(RuntimeSizes)); }\n\n    size_t object;\n    size_t atomsTable;\n    size_t contexts;\n    size_t dtoa;\n    size_t temporary;\n    size_t regexpData;\n    size_t interpreterStack;\n    size_t gcMarker;\n    size_t mathCache;\n    size_t scriptData;\n    size_t scriptSources;\n\n    CodeSizes code;\n};\n\nstruct ZoneStats\n{\n    ZoneStats()\n      : extra(NULL),\n        gcHeapArenaAdmin(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapStringsNormal(0),\n        gcHeapStringsShort(0),\n        gcHeapLazyScripts(0),\n        gcHeapTypeObjects(0),\n        gcHeapIonCodes(0),\n        stringCharsNonHuge(0),\n        lazyScripts(0),\n        typeObjects(0),\n        typePool(0),\n        hugeStrings()\n    {}\n\n    ZoneStats(const ZoneStats &other)\n      : extra(other.extra),\n        gcHeapArenaAdmin(other.gcHeapArenaAdmin),\n        gcHeapUnusedGcThings(other.gcHeapUnusedGcThings),\n        gcHeapStringsNormal(other.gcHeapStringsNormal),\n        gcHeapStringsShort(other.gcHeapStringsShort),\n        gcHeapLazyScripts(other.gcHeapLazyScripts),\n        gcHeapTypeObjects(other.gcHeapTypeObjects),\n        gcHeapIonCodes(other.gcHeapIonCodes),\n        stringCharsNonHuge(other.stringCharsNonHuge),\n        lazyScripts(other.lazyScripts),\n        typeObjects(other.typeObjects),\n        typePool(other.typePool),\n        hugeStrings()\n    {\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // Add other's numbers to this object's numbers.\n    void add(ZoneStats &other) {\n        #define ADD(x)  this->x += other.x\n\n        ADD(gcHeapArenaAdmin);\n        ADD(gcHeapUnusedGcThings);\n\n        ADD(gcHeapStringsNormal);\n        ADD(gcHeapStringsShort);\n        ADD(gcHeapLazyScripts);\n        ADD(gcHeapTypeObjects);\n        ADD(gcHeapIonCodes);\n\n        ADD(stringCharsNonHuge);\n        ADD(lazyScripts);\n        ADD(typeObjects);\n        ADD(typePool);\n\n        #undef ADD\n\n        hugeStrings.appendAll(other.hugeStrings);\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    size_t gcHeapArenaAdmin;\n    size_t gcHeapUnusedGcThings;\n\n    size_t gcHeapStringsNormal;\n    size_t gcHeapStringsShort;\n\n    size_t gcHeapLazyScripts;\n    size_t gcHeapTypeObjects;\n    size_t gcHeapIonCodes;\n\n    size_t stringCharsNonHuge;\n    size_t lazyScripts;\n    size_t typeObjects;\n    size_t typePool;\n\n    js::Vector<HugeStringInfo, 0, js::SystemAllocPolicy> hugeStrings;\n\n    // The size of all the live things in the GC heap that don't belong to any\n    // compartment.\n    size_t GCHeapThingsSize();\n};\n\nstruct CompartmentStats\n{\n    CompartmentStats()\n      : extra(NULL),\n        gcHeapObjectsOrdinary(0),\n        gcHeapObjectsFunction(0),\n        gcHeapObjectsDenseArray(0),\n        gcHeapObjectsSlowArray(0),\n        gcHeapObjectsCrossCompartmentWrapper(0),\n        gcHeapShapesTreeGlobalParented(0),\n        gcHeapShapesTreeNonGlobalParented(0),\n        gcHeapShapesDict(0),\n        gcHeapShapesBase(0),\n        gcHeapScripts(0),\n        objectsExtra(),\n        shapesExtraTreeTables(0),\n        shapesExtraDictTables(0),\n        shapesExtraTreeShapeKids(0),\n        shapesCompartmentTables(0),\n        scriptData(0),\n        baselineData(0),\n        baselineStubsFallback(0),\n        baselineStubsOptimized(0),\n        ionData(0),\n        compartmentObject(0),\n        crossCompartmentWrappersTable(0),\n        regexpCompartment(0),\n        debuggeesSet(0),\n        typeInference()\n    {}\n\n    CompartmentStats(const CompartmentStats &other)\n      : extra(other.extra),\n        gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary),\n        gcHeapObjectsFunction(other.gcHeapObjectsFunction),\n        gcHeapObjectsDenseArray(other.gcHeapObjectsDenseArray),\n        gcHeapObjectsSlowArray(other.gcHeapObjectsSlowArray),\n        gcHeapObjectsCrossCompartmentWrapper(other.gcHeapObjectsCrossCompartmentWrapper),\n        gcHeapShapesTreeGlobalParented(other.gcHeapShapesTreeGlobalParented),\n        gcHeapShapesTreeNonGlobalParented(other.gcHeapShapesTreeNonGlobalParented),\n        gcHeapShapesDict(other.gcHeapShapesDict),\n        gcHeapShapesBase(other.gcHeapShapesBase),\n        gcHeapScripts(other.gcHeapScripts),\n        objectsExtra(other.objectsExtra),\n        shapesExtraTreeTables(other.shapesExtraTreeTables),\n        shapesExtraDictTables(other.shapesExtraDictTables),\n        shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids),\n        shapesCompartmentTables(other.shapesCompartmentTables),\n        scriptData(other.scriptData),\n        baselineData(other.baselineData),\n        baselineStubsFallback(other.baselineStubsFallback),\n        baselineStubsOptimized(other.baselineStubsOptimized),\n        ionData(other.ionData),\n        compartmentObject(other.compartmentObject),\n        crossCompartmentWrappersTable(other.crossCompartmentWrappersTable),\n        regexpCompartment(other.regexpCompartment),\n        debuggeesSet(other.debuggeesSet),\n        typeInference(other.typeInference)\n    {\n    }\n\n    // This field can be used by embedders.\n    void   *extra;\n\n    // If you add a new number, remember to update the constructors, add(), and\n    // maybe gcHeapThingsSize()!\n    size_t gcHeapObjectsOrdinary;\n    size_t gcHeapObjectsFunction;\n    size_t gcHeapObjectsDenseArray;\n    size_t gcHeapObjectsSlowArray;\n    size_t gcHeapObjectsCrossCompartmentWrapper;\n    size_t gcHeapShapesTreeGlobalParented;\n    size_t gcHeapShapesTreeNonGlobalParented;\n    size_t gcHeapShapesDict;\n    size_t gcHeapShapesBase;\n    size_t gcHeapScripts;\n    ObjectsExtraSizes objectsExtra;\n\n    size_t shapesExtraTreeTables;\n    size_t shapesExtraDictTables;\n    size_t shapesExtraTreeShapeKids;\n    size_t shapesCompartmentTables;\n    size_t scriptData;\n    size_t baselineData;\n    size_t baselineStubsFallback;\n    size_t baselineStubsOptimized;\n    size_t ionData;\n    size_t compartmentObject;\n    size_t crossCompartmentWrappersTable;\n    size_t regexpCompartment;\n    size_t debuggeesSet;\n\n    TypeInferenceSizes typeInference;\n\n    // Add cStats's numbers to this object's numbers.\n    void add(CompartmentStats &cStats) {\n        #define ADD(x)  this->x += cStats.x\n\n        ADD(gcHeapObjectsOrdinary);\n        ADD(gcHeapObjectsFunction);\n        ADD(gcHeapObjectsDenseArray);\n        ADD(gcHeapObjectsSlowArray);\n        ADD(gcHeapObjectsCrossCompartmentWrapper);\n        ADD(gcHeapShapesTreeGlobalParented);\n        ADD(gcHeapShapesTreeNonGlobalParented);\n        ADD(gcHeapShapesDict);\n        ADD(gcHeapShapesBase);\n        ADD(gcHeapScripts);\n        objectsExtra.add(cStats.objectsExtra);\n\n        ADD(shapesExtraTreeTables);\n        ADD(shapesExtraDictTables);\n        ADD(shapesExtraTreeShapeKids);\n        ADD(shapesCompartmentTables);\n        ADD(scriptData);\n        ADD(baselineData);\n        ADD(baselineStubsFallback);\n        ADD(baselineStubsOptimized);\n        ADD(ionData);\n        ADD(compartmentObject);\n        ADD(crossCompartmentWrappersTable);\n        ADD(regexpCompartment);\n        ADD(debuggeesSet);\n\n        #undef ADD\n\n        typeInference.add(cStats.typeInference);\n    }\n\n    // The size of all the live things in the GC heap.\n    size_t GCHeapThingsSize();\n};\n\nstruct RuntimeStats\n{\n    RuntimeStats(mozilla::MallocSizeOf mallocSizeOf)\n      : runtime(),\n        gcHeapChunkTotal(0),\n        gcHeapDecommittedArenas(0),\n        gcHeapUnusedChunks(0),\n        gcHeapUnusedArenas(0),\n        gcHeapUnusedGcThings(0),\n        gcHeapChunkAdmin(0),\n        gcHeapGcThings(0),\n        cTotals(),\n        zTotals(),\n        compartmentStatsVector(),\n        zoneStatsVector(),\n        currZoneStats(NULL),\n        mallocSizeOf_(mallocSizeOf)\n    {}\n\n    RuntimeSizes runtime;\n\n    // If you add a new number, remember to update the constructor!\n\n    // Here's a useful breakdown of the GC heap.\n    //\n    // - rtStats.gcHeapChunkTotal\n    //   - decommitted bytes\n    //     - rtStats.gcHeapDecommittedArenas (decommitted arenas in non-empty chunks)\n    //   - unused bytes\n    //     - rtStats.gcHeapUnusedChunks (empty chunks)\n    //     - rtStats.gcHeapUnusedArenas (empty arenas within non-empty chunks)\n    //     - rtStats.total.gcHeapUnusedGcThings (empty GC thing slots within non-empty arenas)\n    //   - used bytes\n    //     - rtStats.gcHeapChunkAdmin\n    //     - rtStats.total.gcHeapArenaAdmin\n    //     - rtStats.gcHeapGcThings (in-use GC things)\n    //\n    // It's possible that some arenas in empty chunks may be decommitted, but\n    // we don't count those under rtStats.gcHeapDecommittedArenas because (a)\n    // it's rare, and (b) this means that rtStats.gcHeapUnusedChunks is a\n    // multiple of the chunk size, which is good.\n\n    size_t gcHeapChunkTotal;\n    size_t gcHeapDecommittedArenas;\n    size_t gcHeapUnusedChunks;\n    size_t gcHeapUnusedArenas;\n    size_t gcHeapUnusedGcThings;\n    size_t gcHeapChunkAdmin;\n    size_t gcHeapGcThings;\n\n    // The sum of all compartment's measurements.\n    CompartmentStats cTotals;\n    ZoneStats zTotals;\n\n    js::Vector<CompartmentStats, 0, js::SystemAllocPolicy> compartmentStatsVector;\n    js::Vector<ZoneStats, 0, js::SystemAllocPolicy> zoneStatsVector;\n\n    ZoneStats *currZoneStats;\n\n    mozilla::MallocSizeOf mallocSizeOf_;\n\n    virtual void initExtraCompartmentStats(JSCompartment *c, CompartmentStats *cstats) = 0;\n    virtual void initExtraZoneStats(JS::Zone *zone, ZoneStats *zstats) = 0;\n};\n\nclass ObjectPrivateVisitor\n{\n  public:\n    // Within CollectRuntimeStats, this method is called for each JS object\n    // that has an nsISupports pointer.\n    virtual size_t sizeOfIncludingThis(nsISupports *aSupports) = 0;\n\n    // A callback that gets a JSObject's nsISupports pointer, if it has one.\n    // Note: this function does *not* addref |iface|.\n    typedef JSBool(*GetISupportsFun)(JSObject *obj, nsISupports **iface);\n    GetISupportsFun getISupports_;\n\n    ObjectPrivateVisitor(GetISupportsFun getISupports)\n      : getISupports_(getISupports)\n    {}\n};\n\nextern JS_PUBLIC_API(bool)\nCollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisitor *opv);\n\nextern JS_PUBLIC_API(size_t)\nSystemCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nUserCompartmentCount(JSRuntime *rt);\n\nextern JS_PUBLIC_API(size_t)\nPeakSizeOfTemporary(const JSRuntime *rt);\n\n} // namespace JS\n\n#endif /* js_MemoryMetrics_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/PropertyKey.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::PropertyKey implementation. */\n\n#ifndef js_PropertyKey_h\n#define js_PropertyKey_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"js/Value.h\"\n\nstruct JSContext;\n\nnamespace JS {\n\nclass PropertyKey;\n\nnamespace detail {\n\nextern JS_PUBLIC_API(bool)\nToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n} // namespace detail\n\n/*\n * A PropertyKey is a key used to access some property on an object.  It is a\n * natural way to represent a property accessed using a JavaScript value.\n *\n * PropertyKey can represent indexes, named properties, and ES6 symbols.  The\n * latter aren't implemented in SpiderMonkey yet, but PropertyKey carves out\n * space for them.\n */\nclass PropertyKey\n{\n    Value v;\n    friend JS_PUBLIC_API(bool) detail::ToPropertyKeySlow(JSContext *cx, HandleValue v, PropertyKey *key);\n\n  public:\n    explicit PropertyKey(uint32_t index) : v(PrivateUint32Value(index)) {}\n\n    /*\n     * An index is a string property name whose characters exactly spell out an\n     * unsigned 32-bit integer in decimal: \"0\", \"1\", \"2\", ...., \"4294967294\",\n     * \"4294967295\".\n     */\n    bool isIndex(uint32_t *index) {\n        // The implementation here assumes that private uint32_t are stored\n        // using the int32_t representation.  This is purely an implementation\n        // detail: embedders must not rely upon this!\n        if (!v.isInt32())\n            return false;\n        *index = v.toPrivateUint32();\n        return true;\n    }\n\n    /*\n     * A name is a string property name which is *not* an index.  Note that by\n     * the ECMAScript language grammar, any dotted property access |obj.prop|\n     * will access a named property.\n     */\n    bool isName(JSString **str) {\n        uint32_t dummy;\n        if (isIndex(&dummy))\n            return false;\n        *str = v.toString();\n        return true;\n    }\n\n    /*\n     * A symbol is a property name that's a Symbol, a particular kind of object\n     * in ES6.  It is the only kind of property name that's not a string.\n     *\n     * SpiderMonkey doesn't yet implement symbols, but we're carving out API\n     * space for them in advance.\n     */\n    bool isSymbol() {\n        return false;\n    }\n};\n\ninline bool\nToPropertyKey(JSContext *cx, HandleValue v, PropertyKey *key)\n{\n    if (v.isInt32() && v.toInt32() >= 0) {\n        *key = PropertyKey(uint32_t(v.toInt32()));\n        return true;\n    }\n\n    return detail::ToPropertyKeySlow(cx, v, key);\n}\n\n} // namespace JS\n\n#endif /* js_PropertyKey_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/RequiredDefines.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Various #defines required to build SpiderMonkey.  Embedders should add this\n * file to the start of the command line via -include or a similar mechanism,\n * or SpiderMonkey public headers may not work correctly.\n */\n\n#ifndef js_RequiredDefines_h\n#define js_RequiredDefines_h\n\n/*\n * The c99 defining the limit macros (UINT32_MAX for example), says:\n * C++ implementations should define these macros only when __STDC_LIMIT_MACROS\n * is defined before <stdint.h> is included.\n */\n#define __STDC_LIMIT_MACROS\n\n#endif /* js_RequiredDefines_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/RootingAPI.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_RootingAPI_h\n#define js_RootingAPI_h\n\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include \"js/Utility.h\"\n\n#include \"jspubtd.h\"\n\n/*\n * Moving GC Stack Rooting\n *\n * A moving GC may change the physical location of GC allocated things, even\n * when they are rooted, updating all pointers to the thing to refer to its new\n * location. The GC must therefore know about all live pointers to a thing,\n * not just one of them, in order to behave correctly.\n *\n * The |Rooted| and |Handle| classes below are used to root stack locations\n * whose value may be held live across a call that can trigger GC. For a\n * code fragment such as:\n *\n * JSObject *obj = NewObject(cx);\n * DoSomething(cx);\n * ... = obj->lastProperty();\n *\n * If |DoSomething()| can trigger a GC, the stack location of |obj| must be\n * rooted to ensure that the GC does not move the JSObject referred to by\n * |obj| without updating |obj|'s location itself. This rooting must happen\n * regardless of whether there are other roots which ensure that the object\n * itself will not be collected.\n *\n * If |DoSomething()| cannot trigger a GC, and the same holds for all other\n * calls made between |obj|'s definitions and its last uses, then no rooting\n * is required.\n *\n * SpiderMonkey can trigger a GC at almost any time and in ways that are not\n * always clear. For example, the following innocuous-looking actions can\n * cause a GC: allocation of any new GC thing; JSObject::hasProperty;\n * JS_ReportError and friends; and ToNumber, among many others. The following\n * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_,\n * rt->malloc_, and friends and JS_ReportOutOfMemory.\n *\n * The following family of three classes will exactly root a stack location.\n * Incorrect usage of these classes will result in a compile error in almost\n * all cases. Therefore, it is very hard to be incorrectly rooted if you use\n * these classes exclusively. These classes are all templated on the type T of\n * the value being rooted.\n *\n * - Rooted<T> declares a variable of type T, whose value is always rooted.\n *   Rooted<T> may be automatically coerced to a Handle<T>, below. Rooted<T>\n *   should be used whenever a local variable's value may be held live across a\n *   call which can trigger a GC.\n *\n * - Handle<T> is a const reference to a Rooted<T>. Functions which take GC\n *   things or values as arguments and need to root those arguments should\n *   generally use handles for those arguments and avoid any explicit rooting.\n *   This has two benefits. First, when several such functions call each other\n *   then redundant rooting of multiple copies of the GC thing can be avoided.\n *   Second, if the caller does not pass a rooted value a compile error will be\n *   generated, which is quicker and easier to fix than when relying on a\n *   separate rooting analysis.\n *\n * - MutableHandle<T> is a non-const reference to Rooted<T>. It is used in the\n *   same way as Handle<T> and includes a |set(const T &v)| method to allow\n *   updating the value of the referenced Rooted<T>. A MutableHandle<T> can be\n *   created from a Rooted<T> by using |Rooted<T>::operator&()|.\n *\n * In some cases the small performance overhead of exact rooting (measured to\n * be a few nanoseconds on desktop) is too much. In these cases, try the\n * following:\n *\n * - Move all Rooted<T> above inner loops: this allows you to re-use the root\n *   on each iteration of the loop.\n *\n * - Pass Handle<T> through your hot call stack to avoid re-rooting costs at\n *   every invocation.\n *\n * The following diagram explains the list of supported, implicit type\n * conversions between classes of this family:\n *\n *  Rooted<T> ----> Handle<T>\n *     |               ^\n *     |               |\n *     |               |\n *     +---> MutableHandle<T>\n *     (via &)\n *\n * All of these types have an implicit conversion to raw pointers.\n */\n\nnamespace js {\n\nclass Module;\nclass ScriptSourceObject;\n\ntemplate <typename T>\nstruct GCMethods {};\n\ntemplate <typename T>\nclass RootedBase {};\n\ntemplate <typename T>\nclass HandleBase {};\n\ntemplate <typename T>\nclass MutableHandleBase {};\n\ntemplate <typename T>\nclass HeapBase {};\n\n/*\n * js::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for js::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(js::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n *\n * This is the SpiderMonkey internal variant. js::NullPtr should be used in\n * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API\n * symbols.\n */\nstruct NullPtr\n{\n    static void * const constNullValue;\n};\n\nnamespace gc {\nstruct Cell;\n} /* namespace gc */\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> class Rooted;\n\ntemplate <typename T> class Handle;\ntemplate <typename T> class MutableHandle;\n\n/* This is exposing internal state of the GC for inlining purposes. */\nJS_FRIEND_API(bool) isGCEnabled();\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\nextern void\nCheckStackRoots(JSContext *cx);\n#endif\n\n/*\n * JS::NullPtr acts like a NULL pointer in contexts that require a Handle.\n *\n * Handle provides an implicit constructor for JS::NullPtr so that, given:\n *   foo(Handle<JSObject*> h);\n * callers can simply write:\n *   foo(JS::NullPtr());\n * which avoids creating a Rooted<JSObject*> just to pass NULL.\n */\nstruct JS_PUBLIC_API(NullPtr)\n{\n    static void * const constNullValue;\n};\n\n/*\n * The Heap<T> class is a C/C++ heap-stored reference to a JS GC thing.  All\n * members of heap classes that refer to GC thing should use Heap<T> (or\n * possibly TenuredHeap<T>, described below).\n *\n * Heap<T> wraps the complex mechanisms required to ensure GC safety for the\n * contained reference into a C++ class that behaves similarly to a normal\n * pointer.\n *\n * GC references stored on the C/C++ stack must use Rooted/Handle/MutableHandle\n * instead.\n *\n * Requirements for type T:\n *  - Must be one of: Value, jsid, JSObject*, JSString*, JSScript*\n */\ntemplate <typename T>\nclass Heap : public js::HeapBase<T>\n{\n  public:\n    Heap() {\n        static_assert(sizeof(T) == sizeof(Heap<T>),\n                      \"Heap<T> must be binary compatible with T.\");\n        init(js::GCMethods<T>::initial());\n    }\n    explicit Heap(T p) { init(p); }\n    explicit Heap(const Heap<T> &p) { init(p.ptr); }\n\n    ~Heap() {\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            relocate();\n    }\n\n    bool operator==(const Heap<T> &other) { return ptr == other.ptr; }\n    bool operator!=(const Heap<T> &other) { return ptr != other.ptr; }\n\n    bool operator==(const T &other) const { return ptr == other; }\n    bool operator!=(const T &other) const { return ptr != other; }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    const T *address() const { return &ptr; }\n    const T &get() const { return ptr; }\n\n    T *unsafeGet() { return &ptr; }\n\n    Heap<T> &operator=(T p) {\n        set(p);\n        return *this;\n    }\n\n    void set(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (js::GCMethods<T>::needsPostBarrier(newPtr)) {\n            ptr = newPtr;\n            post();\n        } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {\n            relocate();  /* Called before overwriting ptr. */\n            ptr = newPtr;\n        } else {\n            ptr = newPtr;\n        }\n    }\n\n  private:\n    void init(T newPtr) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        ptr = newPtr;\n        if (js::GCMethods<T>::needsPostBarrier(ptr))\n            post();\n    }\n\n    void post() {\n#ifdef JSGC_GENERATIONAL\n        JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));\n        js::GCMethods<T>::postBarrier(&ptr);\n#endif\n    }\n\n    void relocate() {\n#ifdef JSGC_GENERATIONAL\n        js::GCMethods<T>::relocate(&ptr);\n#endif\n    }\n\n    T ptr;\n};\n\n#ifdef DEBUG\n/*\n * For generational GC, assert that an object is in the tenured generation as\n * opposed to being in the nursery.\n */\nextern JS_FRIEND_API(void)\nAssertGCThingMustBeTenured(JSObject* obj);\n#else\ninline void\nAssertGCThingMustBeTenured(JSObject *obj) {}\n#endif\n\n/*\n * The TenuredHeap<T> class is similar to the Heap<T> class above in that it\n * encapsulates the GC concerns of an on-heap reference to a JS object. However,\n * it has two important differences:\n *\n *  1) Pointers which are statically known to only reference \"tenured\" objects\n *     can avoid the extra overhead of SpiderMonkey's write barriers.\n *\n *  2) Objects in the \"tenured\" heap have stronger alignment restrictions than\n *     those in the \"nursery\", so it is possible to store flags in the lower\n *     bits of pointers known to be tenured. TenuredHeap wraps a normal tagged\n *     pointer with a nice API for accessing the flag bits and adds various\n *     assertions to ensure that it is not mis-used.\n *\n * GC things are said to be \"tenured\" when they are located in the long-lived\n * heap: e.g. they have gained tenure as an object by surviving past at least\n * one GC. For performance, SpiderMonkey allocates some things which are known\n * to normally be long lived directly into the tenured generation; for example,\n * global objects. Additionally, SpiderMonkey does not visit individual objects\n * when deleting non-tenured objects, so object with finalizers are also always\n * tenured; for instance, this includes most DOM objects.\n *\n * The considerations to keep in mind when using a TenuredHeap<T> vs a normal\n * Heap<T> are:\n *\n *  - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing.\n *  - It is however valid for a Heap<T> to refer to a tenured thing.\n *  - It is not possible to store flag bits in a Heap<T>.\n */\ntemplate <typename T>\nclass TenuredHeap : public js::HeapBase<T>\n{\n  public:\n    TenuredHeap() : bits(0) {\n        static_assert(sizeof(T) == sizeof(TenuredHeap<T>),\n                      \"TenuredHeap<T> must be binary compatible with T.\");\n    }\n    explicit TenuredHeap(T p) : bits(0) { setPtr(p); }\n    explicit TenuredHeap(const TenuredHeap<T> &p) : bits(0) { setPtr(p.ptr); }\n\n    bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }\n    bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }\n\n    void setPtr(T newPtr) {\n        JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);\n        JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));\n        if (newPtr)\n            AssertGCThingMustBeTenured(newPtr);\n        bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);\n    }\n\n    void setFlags(uintptr_t flagsToSet) {\n        JS_ASSERT((flagsToSet & ~flagsMask) == 0);\n        bits |= flagsToSet;\n    }\n\n    void unsetFlags(uintptr_t flagsToUnset) {\n        JS_ASSERT((flagsToUnset & ~flagsMask) == 0);\n        bits &= ~flagsToUnset;\n    }\n\n    bool hasFlag(uintptr_t flag) const {\n        JS_ASSERT((flag & ~flagsMask) == 0);\n        return (bits & flag) != 0;\n    }\n\n    T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }\n    uintptr_t getFlags() const { return bits & flagsMask; }\n\n    operator T() const { return getPtr(); }\n    T operator->() const { return getPtr(); }\n\n    TenuredHeap<T> &operator=(T p) {\n        setPtr(p);\n        return *this;\n    }\n\n    /*\n     * Set the pointer to a value which will cause a crash if it is\n     * dereferenced.\n     */\n    void setToCrashOnTouch() {\n        bits = (bits & flagsMask) | crashOnTouchPointer;\n    }\n\n    bool isSetToCrashOnTouch() {\n        return (bits & ~flagsMask) == crashOnTouchPointer;\n    }\n\n  private:\n    enum {\n        maskBits = 3,\n        flagsMask = (1 << maskBits) - 1,\n        crashOnTouchPointer = 1 << maskBits\n    };\n\n    uintptr_t bits;\n};\n\n/*\n * Reference to a T that has been rooted elsewhere. This is most useful\n * as a parameter type, which guarantees that the T lvalue is properly\n * rooted. See \"Move GC Stack Rooting\" above.\n *\n * If you want to add additional methods to Handle for a specific\n * specialization, define a HandleBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>\n{\n    friend class MutableHandle<T>;\n\n  public:\n    /* Creates a handle from a handle of a type convertible to T. */\n    template <typename S>\n    Handle(Handle<S> handle,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)\n    {\n        static_assert(sizeof(Handle<T>) == sizeof(T *),\n                      \"Handle must be binary compatible with T*.\");\n        ptr = reinterpret_cast<const T *>(handle.address());\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(js::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"js::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&js::NullPtr::constNullValue);\n    }\n\n    /* Create a handle for a NULL pointer. */\n    Handle(JS::NullPtr) {\n        static_assert(mozilla::IsPointer<T>::value,\n                      \"JS::NullPtr overload not valid for non-pointer types\");\n        ptr = reinterpret_cast<const T *>(&JS::NullPtr::constNullValue);\n    }\n\n    Handle(MutableHandle<T> handle) {\n        ptr = handle.address();\n    }\n\n    /*\n     * Take care when calling this method!\n     *\n     * This creates a Handle from the raw location of a T.\n     *\n     * It should be called only if the following conditions hold:\n     *\n     *  1) the location of the T is guaranteed to be marked (for some reason\n     *     other than being a Rooted), e.g., if it is guaranteed to be reachable\n     *     from an implicit root.\n     *\n     *  2) the contents of the location are immutable, or at least cannot change\n     *     for the lifetime of the handle, as its users may not expect its value\n     *     to change underneath them.\n     */\n    static Handle fromMarkedLocation(const T *p) {\n        Handle h;\n        h.ptr = p;\n        return h;\n    }\n\n    /*\n     * Construct a handle from an explicitly rooted location. This is the\n     * normal way to create a handle, and normally happens implicitly.\n     */\n    template <typename S>\n    inline\n    Handle(const Rooted<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    /* Construct a read only handle from a mutable handle. */\n    template <typename S>\n    inline\n    Handle(MutableHandle<S> &root,\n           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);\n\n    const T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a Handle<T> to something that\n     * takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n    bool operator!=(const T &other) const { return *ptr != other; }\n    bool operator==(const T &other) const { return *ptr == other; }\n\n  private:\n    Handle() {}\n\n    const T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\ntypedef Handle<JSObject*>                   HandleObject;\ntypedef Handle<js::Module*>                 HandleModule;\ntypedef Handle<js::ScriptSourceObject *>    HandleScriptSource;\ntypedef Handle<JSFunction*>                 HandleFunction;\ntypedef Handle<JSScript*>                   HandleScript;\ntypedef Handle<JSString*>                   HandleString;\ntypedef Handle<jsid>                        HandleId;\ntypedef Handle<Value>                       HandleValue;\n\n/*\n * Similar to a handle, but the underlying storage can be changed. This is\n * useful for outparams.\n *\n * If you want to add additional methods to MutableHandle for a specific\n * specialization, define a MutableHandleBase<T> specialization containing\n * them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    inline MutableHandle(Rooted<T> *root);\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    /*\n     * This may be called only if the location of the T is guaranteed\n     * to be marked (for some reason other than being a Rooted),\n     * e.g., if it is guaranteed to be reachable from an implicit root.\n     *\n     * Create a MutableHandle from a raw location of a T.\n     */\n    static MutableHandle fromMarkedLocation(T *p) {\n        MutableHandle h;\n        h.ptr = p;\n        return h;\n    }\n\n    T *address() const { return ptr; }\n    const T& get() const { return *ptr; }\n\n    /*\n     * Return a reference so passing a MutableHandle<T> to something that takes\n     * a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    MutableHandle() {}\n\n    T *ptr;\n\n    template <typename S> void operator=(S v) MOZ_DELETE;\n    void operator=(MutableHandle other) MOZ_DELETE;\n};\n\ntypedef MutableHandle<JSObject*>   MutableHandleObject;\ntypedef MutableHandle<JSFunction*> MutableHandleFunction;\ntypedef MutableHandle<JSScript*>   MutableHandleScript;\ntypedef MutableHandle<JSString*>   MutableHandleString;\ntypedef MutableHandle<jsid>        MutableHandleId;\ntypedef MutableHandle<Value>       MutableHandleValue;\n\n#ifdef JSGC_GENERATIONAL\nJS_PUBLIC_API(void) HeapCellPostBarrier(js::gc::Cell **cellp);\nJS_PUBLIC_API(void) HeapCellRelocate(js::gc::Cell **cellp);\n#endif\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * InternalHandle is a handle to an internal pointer into a gcthing. Use\n * InternalHandle when you have a pointer to a direct field of a gcthing, or\n * when you need a parameter type for something that *may* be a pointer to a\n * direct field of a gcthing.\n */\ntemplate <typename T>\nclass InternalHandle {};\n\ntemplate <typename T>\nclass InternalHandle<T*>\n{\n    void * const *holder;\n    size_t offset;\n\n  public:\n    /*\n     * Create an InternalHandle using a Handle to the gcthing containing the\n     * field in question, and a pointer to the field.\n     */\n    template<typename H>\n    InternalHandle(const JS::Handle<H> &handle, T *field)\n      : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get()))\n    {}\n\n    /*\n     * Create an InternalHandle to a field within a Rooted<>.\n     */\n    template<typename R>\n    InternalHandle(const JS::Rooted<R> &root, T *field)\n      : holder((void**)root.address()), offset(uintptr_t(field) - uintptr_t(root.get()))\n    {}\n\n    T *get() const { return reinterpret_cast<T*>(uintptr_t(*holder) + offset); }\n\n    const T &operator*() const { return *get(); }\n    T *operator->() const { return get(); }\n\n    static InternalHandle<T*> fromMarkedLocation(T *fieldPtr) {\n        return InternalHandle(fieldPtr);\n    }\n\n  private:\n    /*\n     * Create an InternalHandle to something that is not a pointer to a\n     * gcthing, and so does not need to be rooted in the first place. Use these\n     * InternalHandles to pass pointers into functions that also need to accept\n     * regular InternalHandles to gcthing fields.\n     *\n     * Make this private to prevent accidental misuse; this is only for\n     * fromMarkedLocation().\n     */\n    InternalHandle(T *field)\n      : holder(reinterpret_cast<void * const *>(&js::NullPtr::constNullValue)),\n        offset(uintptr_t(field))\n    {}\n};\n\n/*\n * By default, pointers should use the inheritance hierarchy to find their\n * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that\n * Rooted<T> may be used without the class definition being available.\n */\ntemplate <typename T>\nstruct RootKind<T *>\n{\n    static ThingRootKind rootKind() { return T::rootKind(); }\n};\n\ntemplate <typename T>\nstruct GCMethods<T *>\n{\n    static T *initial() { return NULL; }\n    static ThingRootKind kind() { return RootKind<T *>::rootKind(); }\n    static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }\n    static bool needsPostBarrier(T *v) { return v; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(T **vp) {\n        JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n    static void relocate(T **vp) {\n        JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));\n    }\n#endif\n};\n\n#if defined(DEBUG)\n/* This helper allows us to assert that Rooted<T> is scoped within a request. */\nextern JS_PUBLIC_API(bool)\nIsInRequest(JSContext *cx);\n#endif\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Local variable of type T whose value is always rooted. This is typically\n * used for local variables, or for non-rooted values being passed to a\n * function that requires a handle, e.g. Foo(Root<T>(cx, x)).\n *\n * If you want to add additional methods to Rooted for a specific\n * specialization, define a RootedBase<T> specialization containing them.\n */\ntemplate <typename T>\nclass MOZ_STACK_CLASS Rooted : public js::RootedBase<T>\n{\n    /* Note: CX is a subclass of either ContextFriendFields or PerThreadDataFriendFields. */\n    template <typename CX>\n    void init(CX *cx) {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        js::ThingRootKind kind = js::GCMethods<T>::kind();\n        this->stack = &cx->thingGCRooters[kind];\n        this->prev = *stack;\n        *stack = reinterpret_cast<Rooted<void*>*>(this);\n\n        JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));\n#endif\n    }\n\n  public:\n    Rooted(JSContext *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(JSContext *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        MOZ_ASSERT(js::IsInRequest(cx));\n        init(js::ContextFriendFields::get(cx));\n    }\n\n    Rooted(js::ContextFriendFields *cx\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::ContextFriendFields *cx, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(cx);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(js::PerThreadDataFriendFields *pt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(pt);\n    }\n\n    Rooted(JSRuntime *rt\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(js::GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    Rooted(JSRuntime *rt, T initial\n           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        init(js::PerThreadDataFriendFields::getMainThread(rt));\n    }\n\n    ~Rooted() {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));\n        *stack = prev;\n#endif\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<T> *previous() { return prev; }\n#endif\n\n    /*\n     * Important: Return a reference here so passing a Rooted<T> to\n     * something that takes a |const T&| is not a GC hazard.\n     */\n    operator const T&() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    T &operator=(const Rooted &value) {\n        ptr = value;\n        return ptr;\n    }\n\n    void set(T value) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(value));\n        ptr = value;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    Rooted<void*> **stack, *prev;\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /* Has the rooting analysis ever scanned this Rooted's stack location? */\n    friend void JS::CheckStackRoots(JSContext*);\n#endif\n\n#ifdef JSGC_ROOT_ANALYSIS\n    bool scanned;\n#endif\n\n    /*\n     * |ptr| must be the last field in Rooted because the analysis treats all\n     * Rooted as Rooted<void*> during the analysis. See bug 829372.\n     */\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    Rooted(const Rooted &) MOZ_DELETE;\n};\n\n#if !(defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING))\n// Defined in vm/String.h.\ntemplate <>\nclass Rooted<JSStableString *>;\n#endif\n\ntypedef Rooted<JSObject*>                   RootedObject;\ntypedef Rooted<js::Module*>                 RootedModule;\ntypedef Rooted<js::ScriptSourceObject *>    RootedScriptSource;\ntypedef Rooted<JSFunction*>                 RootedFunction;\ntypedef Rooted<JSScript*>                   RootedScript;\ntypedef Rooted<JSString*>                   RootedString;\ntypedef Rooted<jsid>                        RootedId;\ntypedef Rooted<JS::Value>                   RootedValue;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Mark a stack location as a root for the rooting analysis, without actually\n * rooting it in release builds. This should only be used for stack locations\n * of GC things that cannot be relocated by a garbage collection, and that\n * are definitely reachable via another path.\n */\nclass SkipRoot\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n\n    SkipRoot **stack, *prev;\n    const uint8_t *start;\n    const uint8_t *end;\n\n    template <typename CX, typename T>\n    void init(CX *cx, const T *ptr, size_t count) {\n        SkipRoot **head = &cx->skipGCRooters;\n        this->stack = head;\n        this->prev = *stack;\n        *stack = this;\n        this->start = (const uint8_t *) ptr;\n        this->end = this->start + (sizeof(T) * count);\n    }\n\n  public:\n    ~SkipRoot() {\n        JS_ASSERT(*stack == this);\n        *stack = prev;\n    }\n\n    SkipRoot *previous() { return prev; }\n\n    bool contains(const uint8_t *v, size_t len) {\n        return v >= start && v + len <= end;\n    }\n\n#else /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {}\n\n  public:\n\n#endif /* DEBUG && JSGC_ROOT_ANALYSIS */\n\n    template <typename T>\n    SkipRoot(JSContext *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(ContextFriendFields::get(cx), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(ContextFriendFields *cx, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(cx, ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename T>\n    SkipRoot(PerThreadData *pt, const T *ptr, size_t count = 1\n             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n        init(PerThreadDataFriendFields::get(pt), ptr, count);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Interface substitute for Rooted<T> which does not root the variable's memory. */\ntemplate <typename T>\nclass FakeRooted : public RootedBase<T>\n{\n  public:\n    template <typename CX>\n    FakeRooted(CX *cx\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(GCMethods<T>::initial())\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    template <typename CX>\n    FakeRooted(CX *cx, T initial\n               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : ptr(initial)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    operator T() const { return ptr; }\n    T operator->() const { return ptr; }\n    T *address() { return &ptr; }\n    const T *address() const { return &ptr; }\n    T &get() { return ptr; }\n    const T &get() const { return ptr; }\n\n    T &operator=(T value) {\n        JS_ASSERT(!GCMethods<T>::poisoned(value));\n        ptr = value;\n        return ptr;\n    }\n\n    bool operator!=(const T &other) const { return ptr != other; }\n    bool operator==(const T &other) const { return ptr == other; }\n\n  private:\n    T ptr;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    FakeRooted(const FakeRooted &) MOZ_DELETE;\n};\n\n/* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */\ntemplate <typename T>\nclass FakeMutableHandle : public js::MutableHandleBase<T>\n{\n  public:\n    FakeMutableHandle(T *t) {\n        ptr = t;\n    }\n\n    FakeMutableHandle(FakeRooted<T> *root) {\n        ptr = root->address();\n    }\n\n    void set(T v) {\n        JS_ASSERT(!js::GCMethods<T>::poisoned(v));\n        *ptr = v;\n    }\n\n    T *address() const { return ptr; }\n    T get() const { return *ptr; }\n\n    operator T() const { return get(); }\n    T operator->() const { return get(); }\n\n  private:\n    FakeMutableHandle() {}\n\n    T *ptr;\n\n    template <typename S>\n    void operator=(S v) MOZ_DELETE;\n};\n\n/*\n * Types for a variable that either should or shouldn't be rooted, depending on\n * the template parameter Rooted. Used for implementing functions that can\n * operate on either rooted or unrooted data.\n *\n * The toHandle() and toMutableHandle() functions are for calling functions\n * which require handle types and are only called in the CanGC case. These\n * allow the calling code to type check.\n */\nenum AllowGC {\n    NoGC = 0,\n    CanGC = 1\n};\ntemplate <typename T, AllowGC allowGC>\nclass MaybeRooted\n{\n};\n\ntemplate <typename T> class MaybeRooted<T, CanGC>\n{\n  public:\n    typedef JS::Handle<T> HandleType;\n    typedef JS::Rooted<T> RootType;\n    typedef JS::MutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        return v;\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        return v;\n    }\n};\n\ntemplate <typename T> class MaybeRooted<T, NoGC>\n{\n  public:\n    typedef T HandleType;\n    typedef FakeRooted<T> RootType;\n    typedef FakeMutableHandle<T> MutableHandleType;\n\n    static inline JS::Handle<T> toHandle(HandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n\n    static inline JS::MutableHandle<T> toMutableHandle(MutableHandleType v) {\n        MOZ_ASSUME_UNREACHABLE(\"Bad conversion\");\n    }\n};\n\n} /* namespace js */\n\nnamespace JS {\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(const Rooted<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T> template <typename S>\ninline\nHandle<T>::Handle(MutableHandle<S> &root,\n                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)\n{\n    ptr = reinterpret_cast<const T *>(root.address());\n}\n\ntemplate <typename T>\ninline\nMutableHandle<T>::MutableHandle(Rooted<T> *root)\n{\n    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),\n                  \"MutableHandle must be binary compatible with T*.\");\n    ptr = root->address();\n}\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Hook for dynamic root analysis. Checks the native stack and poisons\n * references to GC things which have not been rooted.\n */\ninline void MaybeCheckStackRoots(JSContext *cx)\n{\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    JS::CheckStackRoots(cx);\n#endif\n}\n\n/* Base class for automatic read-only object rooting during compilation. */\nclass CompilerRootNode\n{\n  protected:\n    CompilerRootNode(js::gc::Cell *ptr) : next(NULL), ptr_(ptr) {}\n\n  public:\n    void **address() { return (void **)&ptr_; }\n\n  public:\n    CompilerRootNode *next;\n\n  protected:\n    js::gc::Cell *ptr_;\n};\n\n}  /* namespace js */\n\n#endif  /* js_RootingAPI_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Utility.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Utility_h\n#define js_Utility_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/Scoped.h\"\n#include \"mozilla/TemplateLib.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef JS_OOM_DO_BACKTRACES\n#include <stdio.h>\n#include <execinfo.h>\n#endif\n\n#include \"jstypes.h\"\n\n/* The public JS engine namespace. */\nnamespace JS {}\n\n/* The mozilla-shared reusable template/utility namespace. */\nnamespace mozilla {}\n\n/* The private JS engine namespace. */\nnamespace js {}\n\n/*\n * Pattern used to overwrite freed memory. If you are accessing an object with\n * this pattern, you probably have a dangling pointer.\n */\n#define JS_FREE_PATTERN 0xDA\n\n#define JS_ASSERT(expr)           MOZ_ASSERT(expr)\n#define JS_ASSERT_IF(cond, expr)  MOZ_ASSERT_IF(cond, expr)\n#define JS_ALWAYS_TRUE(expr)      MOZ_ALWAYS_TRUE(expr)\n#define JS_ALWAYS_FALSE(expr)     MOZ_ALWAYS_FALSE(expr)\n\n#ifdef DEBUG\n# ifdef JS_THREADSAFE\n#  define JS_THREADSAFE_ASSERT(expr) JS_ASSERT(expr)\n# else\n#  define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n# endif\n#else\n# define JS_THREADSAFE_ASSERT(expr) ((void) 0)\n#endif\n\n#if defined(DEBUG)\n# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)\n#elif defined(JS_CRASH_DIAGNOSTICS)\n# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)\n#else\n# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)\n#endif\n\n#define JS_STATIC_ASSERT(cond)           static_assert(cond, \"JS_STATIC_ASSERT\")\n#define JS_STATIC_ASSERT_IF(cond, expr)  MOZ_STATIC_ASSERT_IF(cond, expr, \"JS_STATIC_ASSERT_IF\")\n\nextern MOZ_NORETURN JS_PUBLIC_API(void)\nJS_Assert(const char *s, const char *file, int ln);\n\n/*\n * Abort the process in a non-graceful manner. This will cause a core file,\n * call to the debugger or other moral equivalent as well as causing the\n * entire process to stop.\n */\nextern JS_PUBLIC_API(void) JS_Abort(void);\n\n/*\n * Custom allocator support for SpiderMonkey\n */\n#if defined JS_USE_CUSTOM_ALLOCATOR\n# include \"jscustomallocator.h\"\n#else\n# ifdef DEBUG\n/*\n * In order to test OOM conditions, when the testing function\n * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th\n * allocation from now.\n */\nextern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtins/TestingFunctions.cpp */\nextern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */\n\n#ifdef JS_OOM_DO_BACKTRACES\n#define JS_OOM_BACKTRACE_SIZE 32\nstatic JS_ALWAYS_INLINE void\nPrintBacktrace()\n{\n    void* OOM_trace[JS_OOM_BACKTRACE_SIZE];\n    char** OOM_traceSymbols = NULL;\n    int32_t OOM_traceSize = 0;\n    int32_t OOM_traceIdx = 0;\n    OOM_traceSize = backtrace(OOM_trace, JS_OOM_BACKTRACE_SIZE);\n    OOM_traceSymbols = backtrace_symbols(OOM_trace, OOM_traceSize);\n\n    if (!OOM_traceSymbols)\n        return;\n\n    for (OOM_traceIdx = 0; OOM_traceIdx < OOM_traceSize; ++OOM_traceIdx) {\n        fprintf(stderr, \"#%d %s\\n\", OOM_traceIdx, OOM_traceSymbols[OOM_traceIdx]);\n    }\n\n    free(OOM_traceSymbols);\n}\n\n#define JS_OOM_EMIT_BACKTRACE() \\\n    do {\\\n        fprintf(stderr, \"Forcing artificial memory allocation function failure:\\n\");\\\n\tPrintBacktrace();\\\n    } while (0)\n# else\n#  define JS_OOM_EMIT_BACKTRACE() do {} while(0)\n#endif /* JS_OOM_DO_BACKTRACES */\n\n#  define JS_OOM_POSSIBLY_FAIL() \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \\\n    do \\\n    { \\\n        if (++OOM_counter > OOM_maxAllocations) { \\\n            JS_OOM_EMIT_BACKTRACE();\\\n            js_ReportOutOfMemory(cx);\\\n            return NULL; \\\n        } \\\n    } while (0)\n\n# else\n#  define JS_OOM_POSSIBLY_FAIL() do {} while(0)\n#  define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)\n# endif /* DEBUG */\n\nstatic JS_INLINE void* js_malloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return malloc(bytes);\n}\n\nstatic JS_INLINE void* js_calloc(size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(bytes, 1);\n}\n\nstatic JS_INLINE void* js_calloc(size_t nmemb, size_t size)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return calloc(nmemb, size);\n}\n\nstatic JS_INLINE void* js_realloc(void* p, size_t bytes)\n{\n    JS_OOM_POSSIBLY_FAIL();\n    return realloc(p, bytes);\n}\n\nstatic JS_INLINE void js_free(void* p)\n{\n    free(p);\n}\n#endif/* JS_USE_CUSTOM_ALLOCATOR */\n\n/*\n * JS_ROTATE_LEFT32\n *\n * There is no rotate operation in the C Language so the construct (a << 4) |\n * (a >> 28) is used instead. Most compilers convert this to a rotate\n * instruction but some versions of MSVC don't without a little help.  To get\n * MSVC to generate a rotate instruction, we have to use the _rotl intrinsic\n * and use a pragma to make _rotl inline.\n *\n * MSVC in VS2005 will do an inline rotate instruction on the above construct.\n */\n#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \\\n    defined(_M_X64))\n#include <stdlib.h>\n#pragma intrinsic(_rotl)\n#define JS_ROTATE_LEFT32(a, bits) _rotl(a, bits)\n#else\n#define JS_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))\n#endif\n\n#include <new>\n\n/*\n * Low-level memory management in SpiderMonkey:\n *\n *  ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these\n *     to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's\n *     these symbols.\n *\n *  ** Do not use the builtin C++ operator new and delete: these throw on\n *     error and we cannot override them not to.\n *\n * Allocation:\n *\n * - If the lifetime of the allocation is tied to the lifetime of a GC-thing\n *   (that is, finalizing the GC-thing will free the allocation), call one of\n *   the following functions:\n *\n *     JSContext::{malloc_,realloc_,calloc_,new_}\n *     JSRuntime::{malloc_,realloc_,calloc_,new_}\n *\n *   These functions accumulate the number of bytes allocated which is used as\n *   part of the GC-triggering heuristic.\n *\n *   The difference between the JSContext and JSRuntime versions is that the\n *   cx version reports an out-of-memory error on OOM. (This follows from the\n *   general SpiderMonkey idiom that a JSContext-taking function reports its\n *   own errors.)\n *\n * - Otherwise, use js_malloc/js_realloc/js_calloc/js_free/js_new\n *\n * Deallocation:\n *\n * - Ordinarily, use js_free/js_delete.\n *\n * - For deallocations during GC finalization, use one of the following\n *   operations on the FreeOp provided to the finalizer:\n *\n *     FreeOp::{free_,delete_}\n *\n *   The advantage of these operations is that the memory is batched and freed\n *   on another thread.\n */\n\n#define JS_NEW_BODY(allocator, t, parms)                                       \\\n    void *memory = allocator(sizeof(t));                                       \\\n    return memory ? new(memory) t parms : NULL;\n\n/*\n * Given a class which should provide 'new' methods, add\n * JS_DECLARE_NEW_METHODS (see JSContext for a usage example). This\n * adds news with up to 12 parameters. Add more versions of new below if\n * you need more than 12 parameters.\n *\n * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,\n * or the build will break.\n */\n#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\\\n    template <class T>\\\n    QUALIFIERS T *NEWNAME() {\\\n        JS_NEW_BODY(ALLOCATOR, T, ())\\\n    }\\\n\\\n    template <class T, class P1>\\\n    QUALIFIERS T *NEWNAME(P1 p1) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1))\\\n    }\\\n\\\n    template <class T, class P1, class P2>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11))\\\n    }\\\n\\\n    template <class T, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class P11, class P12>\\\n    QUALIFIERS T *NEWNAME(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12) {\\\n        JS_NEW_BODY(ALLOCATOR, T, (p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12))\\\n    }\\\n\nJS_DECLARE_NEW_METHODS(js_new, js_malloc, static JS_ALWAYS_INLINE)\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE void\njs_delete(T *p)\n{\n    if (p) {\n        p->~T();\n        js_free(p);\n    }\n}\n\ntemplate<class T>\nstatic JS_ALWAYS_INLINE void\njs_delete_poison(T *p)\n{\n    if (p) {\n        p->~T();\n        memset(p, 0x3B, sizeof(T));\n        js_free(p);\n    }\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc()\n{\n    return (T *)js_malloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc()\n{\n    return (T *)js_calloc(sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_malloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_malloc(numElems * sizeof(T));\n}\n\ntemplate <class T>\nstatic JS_ALWAYS_INLINE T *\njs_pod_calloc(size_t numElems)\n{\n    if (numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value)\n        return NULL;\n    return (T *)js_calloc(numElems * sizeof(T));\n}\n\nnamespace js {\n\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return NULL; }\n    static void release(T* ptr) { js_free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits)\n\ntemplate <typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { js_delete(ptr); }\n};\nSCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits)\n\ntemplate <typename T>\nstruct ScopedReleasePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T *ptr) { if (ptr) ptr->release(); }\n};\nSCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits)\n\n} /* namespace js */\n\nnamespace js {\n\n/* Integral types for all hash functions. */\ntypedef uint32_t HashNumber;\nconst unsigned HashNumberSizeBits = 32;\n\nnamespace detail {\n\n/*\n * Given a raw hash code, h, return a number that can be used to select a hash\n * bucket.\n *\n * This function aims to produce as uniform an output distribution as possible,\n * especially in the most significant (leftmost) bits, even though the input\n * distribution may be highly nonrandom, given the constraints that this must\n * be deterministic and quick to compute.\n *\n * Since the leftmost bits of the result are best, the hash bucket index is\n * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent\n * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask.\n *\n * FIXME: OrderedHashTable uses a bit-mask; see bug 775896.\n */\ninline HashNumber\nScrambleHashCode(HashNumber h)\n{\n    /*\n     * Simply returning h would not cause any hash tables to produce wrong\n     * answers. But it can produce pathologically bad performance: The caller\n     * right-shifts the result, keeping only the highest bits. The high bits of\n     * hash codes are very often completely entropy-free. (So are the lowest\n     * bits.)\n     *\n     * So we use Fibonacci hashing, as described in Knuth, The Art of Computer\n     * Programming, 6.4. This mixes all the bits of the input hash code h.\n     * \n     * The value of goldenRatio is taken from the hex\n     * expansion of the golden ratio, which starts 1.9E3779B9....\n     * This value is especially good if values with consecutive hash codes\n     * are stored in a hash table; see Knuth for details.\n     */\n    static const HashNumber goldenRatio = 0x9E3779B9U;\n    return h * goldenRatio;\n}\n\n} /* namespace detail */\n\n} /* namespace js */\n\nnamespace JS {\n\n/*\n * Methods for poisoning GC heap pointer words and checking for poisoned words.\n * These are in this file for use in Value methods and so forth.\n *\n * If the moving GC hazard analysis is in use and detects a non-rooted stack\n * pointer to a GC thing, one byte of that pointer is poisoned to refer to an\n * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the\n * pointer is overwritten, to reduce the likelihood of accidentally changing\n * a live integer value.\n */\n\ninline void PoisonPtr(void *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint8_t *ptr = (uint8_t *) v + 3;\n    *ptr = JS_FREE_PATTERN;\n#endif\n}\n\ntemplate <typename T>\ninline bool IsPoisonedPtr(T *v)\n{\n#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)\n    uint32_t mask = uintptr_t(v) & 0xff000000;\n    return mask == uint32_t(JS_FREE_PATTERN << 24);\n#else\n    return false;\n#endif\n}\n\n}\n\n/* sixgill annotation defines */\n#ifndef HAVE_STATIC_ANNOTATIONS\n# define HAVE_STATIC_ANNOTATIONS\n# ifdef XGILL_PLUGIN\n#  define STATIC_PRECONDITION(COND)         __attribute__((precondition(#COND)))\n#  define STATIC_PRECONDITION_ASSUME(COND)  __attribute__((precondition_assume(#COND)))\n#  define STATIC_POSTCONDITION(COND)        __attribute__((postcondition(#COND)))\n#  define STATIC_POSTCONDITION_ASSUME(COND) __attribute__((postcondition_assume(#COND)))\n#  define STATIC_INVARIANT(COND)            __attribute__((invariant(#COND)))\n#  define STATIC_INVARIANT_ASSUME(COND)     __attribute__((invariant_assume(#COND)))\n#  define STATIC_PASTE2(X,Y) X ## Y\n#  define STATIC_PASTE1(X,Y) STATIC_PASTE2(X,Y)\n#  define STATIC_ASSERT(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assert_static(#COND), unused))    \\\n    int STATIC_PASTE1(assert_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSUME(COND)                        \\\n  JS_BEGIN_MACRO                                     \\\n    __attribute__((assume_static(#COND), unused))    \\\n    int STATIC_PASTE1(assume_static_, __COUNTER__);  \\\n  JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)                       \\\n  JS_BEGIN_MACRO                                            \\\n    __attribute__((assert_static_runtime(#COND), unused))   \\\n    int STATIC_PASTE1(assert_static_runtime_, __COUNTER__); \\\n  JS_END_MACRO\n# else /* XGILL_PLUGIN */\n#  define STATIC_PRECONDITION(COND)          /* nothing */\n#  define STATIC_PRECONDITION_ASSUME(COND)   /* nothing */\n#  define STATIC_POSTCONDITION(COND)         /* nothing */\n#  define STATIC_POSTCONDITION_ASSUME(COND)  /* nothing */\n#  define STATIC_INVARIANT(COND)             /* nothing */\n#  define STATIC_INVARIANT_ASSUME(COND)      /* nothing */\n#  define STATIC_ASSERT(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSUME(COND)          JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n#  define STATIC_ASSERT_RUNTIME(COND)  JS_BEGIN_MACRO /* nothing */ JS_END_MACRO\n# endif /* XGILL_PLUGIN */\n# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())\n#endif /* HAVE_STATIC_ANNOTATIONS */\n\n#endif /* js_Utility_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Value.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS::Value implementation. */\n\n#ifndef js_Value_h\n#define js_Value_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/Likely.h\"\n\n#include <limits> /* for std::numeric_limits */\n\n#include \"js/Anchor.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n\nnamespace JS { class Value; }\n\n/* JS::Value can store a full int32_t. */\n#define JSVAL_INT_BITS          32\n#define JSVAL_INT_MIN           ((int32_t)0x80000000)\n#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)\n\n/*\n * Try to get jsvals 64-bit aligned. We could almost assert that all values are\n * aligned, but MSVC and GCC occasionally break alignment.\n */\n#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__)\n# define JSVAL_ALIGNMENT        __attribute__((aligned (8)))\n#elif defined(_MSC_VER)\n  /*\n   * Structs can be aligned with MSVC, but not if they are used as parameters,\n   * so we just don't try to align.\n   */\n# define JSVAL_ALIGNMENT\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n# define JSVAL_ALIGNMENT\n#elif defined(__HP_cc) || defined(__HP_aCC)\n# define JSVAL_ALIGNMENT\n#endif\n\n#if JS_BITS_PER_WORD == 64\n# define JSVAL_TAG_SHIFT 47\n#endif\n\n/*\n * We try to use enums so that printing a jsval_layout in the debugger shows\n * nice symbolic type tags, however we can only do this when we can force the\n * underlying type of the enum to be the desired size.\n */\n#if !defined(__SUNPRO_CC) && !defined(__xlC__)\n\n#if defined(_MSC_VER)\n# define JS_ENUM_HEADER(id, type)              enum id : type\n# define JS_ENUM_FOOTER(id)\n#else\n# define JS_ENUM_HEADER(id, type)              enum id\n# define JS_ENUM_FOOTER(id)                    __attribute__((packed))\n#endif\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueType, uint8_t)\n{\n    JSVAL_TYPE_DOUBLE              = 0x00,\n    JSVAL_TYPE_INT32               = 0x01,\n    JSVAL_TYPE_UNDEFINED           = 0x02,\n    JSVAL_TYPE_BOOLEAN             = 0x03,\n    JSVAL_TYPE_MAGIC               = 0x04,\n    JSVAL_TYPE_STRING              = 0x05,\n    JSVAL_TYPE_NULL                = 0x06,\n    JSVAL_TYPE_OBJECT              = 0x07,\n\n    /* These never appear in a jsval; they are only provided as an out-of-band value. */\n    JSVAL_TYPE_UNKNOWN             = 0x20,\n    JSVAL_TYPE_MISSING             = 0x21\n} JS_ENUM_FOOTER(JSValueType);\n\nJS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n\n#if JS_BITS_PER_WORD == 32\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_CLEAR                = 0xFFFFFF80,\n    JSVAL_TAG_INT32                = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n\n#elif JS_BITS_PER_WORD == 64\n\n/* Remember to propagate changes to the C defines below. */\nJS_ENUM_HEADER(JSValueTag, uint32_t)\n{\n    JSVAL_TAG_MAX_DOUBLE           = 0x1FFF0,\n    JSVAL_TAG_INT32                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32,\n    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED,\n    JSVAL_TAG_STRING               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING,\n    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN,\n    JSVAL_TAG_MAGIC                = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC,\n    JSVAL_TAG_NULL                 = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL,\n    JSVAL_TAG_OBJECT               = JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT\n} JS_ENUM_FOOTER(JSValueTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueTag) == sizeof(uint32_t));\n\nJS_ENUM_HEADER(JSValueShiftedTag, uint64_t)\n{\n    JSVAL_SHIFTED_TAG_MAX_DOUBLE   = ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF),\n    JSVAL_SHIFTED_TAG_INT32        = (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_UNDEFINED    = (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_STRING       = (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_BOOLEAN      = (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_MAGIC        = (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_NULL         = (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT),\n    JSVAL_SHIFTED_TAG_OBJECT       = (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n} JS_ENUM_FOOTER(JSValueShiftedTag);\n\nJS_STATIC_ASSERT(sizeof(JSValueShiftedTag) == sizeof(uint64_t));\n\n#endif\n\n#else  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\ntypedef uint8_t JSValueType;\n#define JSVAL_TYPE_DOUBLE            ((uint8_t)0x00)\n#define JSVAL_TYPE_INT32             ((uint8_t)0x01)\n#define JSVAL_TYPE_UNDEFINED         ((uint8_t)0x02)\n#define JSVAL_TYPE_BOOLEAN           ((uint8_t)0x03)\n#define JSVAL_TYPE_MAGIC             ((uint8_t)0x04)\n#define JSVAL_TYPE_STRING            ((uint8_t)0x05)\n#define JSVAL_TYPE_NULL              ((uint8_t)0x06)\n#define JSVAL_TYPE_OBJECT            ((uint8_t)0x07)\n#define JSVAL_TYPE_UNKNOWN           ((uint8_t)0x20)\n\n#if JS_BITS_PER_WORD == 32\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_CLEAR              ((uint32_t)(0xFFFFFF80))\n#define JSVAL_TAG_INT32              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32))\n#define JSVAL_TAG_UNDEFINED          ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED))\n#define JSVAL_TAG_STRING             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING))\n#define JSVAL_TAG_BOOLEAN            ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN))\n#define JSVAL_TAG_MAGIC              ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC))\n#define JSVAL_TAG_NULL               ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL))\n#define JSVAL_TAG_OBJECT             ((uint32_t)(JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT))\n\n#elif JS_BITS_PER_WORD == 64\n\ntypedef uint32_t JSValueTag;\n#define JSVAL_TAG_MAX_DOUBLE         ((uint32_t)(0x1FFF0))\n#define JSVAL_TAG_INT32              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_INT32)\n#define JSVAL_TAG_UNDEFINED          (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_UNDEFINED)\n#define JSVAL_TAG_STRING             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_STRING)\n#define JSVAL_TAG_BOOLEAN            (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_BOOLEAN)\n#define JSVAL_TAG_MAGIC              (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_MAGIC)\n#define JSVAL_TAG_NULL               (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_NULL)\n#define JSVAL_TAG_OBJECT             (uint32_t)(JSVAL_TAG_MAX_DOUBLE | JSVAL_TYPE_OBJECT)\n\ntypedef uint64_t JSValueShiftedTag;\n#define JSVAL_SHIFTED_TAG_MAX_DOUBLE ((((uint64_t)JSVAL_TAG_MAX_DOUBLE) << JSVAL_TAG_SHIFT) | 0xFFFFFFFF)\n#define JSVAL_SHIFTED_TAG_INT32      (((uint64_t)JSVAL_TAG_INT32)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_UNDEFINED  (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_STRING     (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_BOOLEAN    (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_MAGIC      (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_NULL       (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT)\n#define JSVAL_SHIFTED_TAG_OBJECT     (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)\n\n#endif  /* JS_BITS_PER_WORD */\n#endif  /* !defined(__SUNPRO_CC) && !defined(__xlC__) */\n\n#define JSVAL_LOWER_INCL_TYPE_OF_OBJ_OR_NULL_SET        JSVAL_TYPE_NULL\n#define JSVAL_UPPER_EXCL_TYPE_OF_PRIMITIVE_SET          JSVAL_TYPE_OBJECT\n#define JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET             JSVAL_TYPE_INT32\n#define JSVAL_LOWER_INCL_TYPE_OF_PTR_PAYLOAD_SET        JSVAL_TYPE_MAGIC\n\n#if JS_BITS_PER_WORD == 32\n\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_CLEAR | (type)))\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#elif JS_BITS_PER_WORD == 64\n\n#define JSVAL_PAYLOAD_MASK           0x00007FFFFFFFFFFFLL\n#define JSVAL_TAG_MASK               0xFFFF800000000000LL\n#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))\n#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)\n\n#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL\n#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT\n#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32\n#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING\n\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET  JSVAL_SHIFTED_TAG_NULL\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET    JSVAL_SHIFTED_TAG_OBJECT\n#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET       JSVAL_SHIFTED_TAG_UNDEFINED\n#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET      JSVAL_SHIFTED_TAG_STRING\n\n#endif /* JS_BITS_PER_WORD */\n\ntypedef enum JSWhyMagic\n{\n    JS_ELEMENTS_HOLE,            /* a hole in a native object's elements */\n    JS_NATIVE_ENUMERATE,         /* indicates that a custom enumerate hook forwarded\n                                  * to JS_EnumerateState, which really means the object can be\n                                  * enumerated like a native object. */\n    JS_NO_ITER_VALUE,            /* there is not a pending iterator value */\n    JS_GENERATOR_CLOSING,        /* exception value thrown when closing a generator */\n    JS_NO_CONSTANT,              /* compiler sentinel value */\n    JS_THIS_POISON,              /* used in debug builds to catch tracing errors */\n    JS_ARG_POISON,               /* used in debug builds to catch tracing errors */\n    JS_SERIALIZE_NO_NODE,        /* an empty subnode in the AST serializer */\n    JS_LAZY_ARGUMENTS,           /* lazy arguments value on the stack */\n    JS_OPTIMIZED_ARGUMENTS,      /* optimized-away 'arguments' value */\n    JS_IS_CONSTRUCTING,          /* magic value passed to natives to indicate construction */\n    JS_OVERWRITTEN_CALLEE,       /* arguments.callee has been overwritten */\n    JS_FORWARD_TO_CALL_OBJECT,   /* args object element stored in call object */\n    JS_BLOCK_NEEDS_CLONE,        /* value of static block object slot */\n    JS_HASH_KEY_EMPTY,           /* see class js::HashableValue */\n    JS_ION_ERROR,                /* error while running Ion code */\n    JS_ION_BAILOUT,              /* status code to signal EnterIon will OSR into Interpret */\n    JS_GENERIC_MAGIC             /* for local use */\n} JSWhyMagic;\n\n#if defined(IS_LITTLE_ENDIAN)\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n        JSValueTag tag;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n#if !defined(_WIN64)\n    /* MSVC does not pack these correctly :-( */\n    struct {\n        uint64_t           payload47 : 47;\n        JSValueTag         tag : 17;\n    } debugView;\n#endif\n    struct {\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif  /* JS_BITS_PER_WORD */\n#else   /* defined(IS_LITTLE_ENDIAN) */\n# if JS_BITS_PER_WORD == 32\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag tag;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSBool         boo;\n            JSString       *str;\n            JSObject       *obj;\n            void           *ptr;\n            JSWhyMagic     why;\n            size_t         word;\n            uintptr_t      uintptr;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# elif JS_BITS_PER_WORD == 64\ntypedef union jsval_layout\n{\n    uint64_t asBits;\n    struct {\n        JSValueTag         tag : 17;\n        uint64_t           payload47 : 47;\n    } debugView;\n    struct {\n        uint32_t           padding;\n        union {\n            int32_t        i32;\n            uint32_t       u32;\n            JSWhyMagic     why;\n        } payload;\n    } s;\n    double asDouble;\n    void *asPtr;\n    size_t asWord;\n    uintptr_t asUIntPtr;\n} JSVAL_ALIGNMENT jsval_layout;\n# endif /* JS_BITS_PER_WORD */\n#endif  /* defined(IS_LITTLE_ENDIAN) */\n\nJS_STATIC_ASSERT(sizeof(jsval_layout) == 8);\n\n#if JS_BITS_PER_WORD == 32\n\n/*\n * N.B. GCC, in some but not all cases, chooses to emit signed comparison of\n * JSValueTag even though its underlying type has been forced to be uint32_t.\n * Thus, all comparisons should explicitly cast operands to uint32_t.\n */\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint32_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << 32) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return l.s.payload.i32;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_INT32;\n    l.s.payload.i32 = i;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    JSValueTag tag = l.s.tag;\n    MOZ_ASSERT(tag != JSVAL_TAG_CLEAR);\n    return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    MOZ_ASSERT(str);\n    l.s.tag = JSVAL_TAG_STRING;\n    l.s.payload.str = str;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return l.s.payload.str;\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return l.s.payload.boo;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.s.tag = JSVAL_TAG_BOOLEAN;\n    l.s.payload.boo = b;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT);\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    return l.s.payload.obj;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    MOZ_ASSERT(obj);\n    l.s.tag = JSVAL_TAG_OBJECT;\n    l.s.payload.obj = obj;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_NULL;\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    MOZ_ASSERT(((uint32_t)ptr & 1) == 0);\n    l.s.tag = (JSValueTag)0;\n    l.s.payload.ptr = ptr;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    /* gcc sometimes generates signed < without explicit casts. */\n    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    return l.s.payload.ptr;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return l.s.tag == JSVAL_TAG_STRING || l.s.tag == JSVAL_TAG_OBJECT;\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)JSVAL_IS_STRING_IMPL(l);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == b);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.s.tag = JSVAL_TAG_MAGIC;\n    l.s.payload.why = why;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    JSValueTag ltag = lhs.s.tag, rtag = rhs.s.tag;\n    return ltag == rtag || (ltag < JSVAL_TAG_CLEAR && rtag < JSVAL_TAG_CLEAR);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n    uint32_t type = l.s.tag & 0xF;\n    MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n    return (JSValueType)type;\n}\n\n#elif JS_BITS_PER_WORD == 64\n\nstatic inline jsval_layout\nBUILD_JSVAL(JSValueTag tag, uint64_t payload)\n{\n    jsval_layout l;\n    l.asBits = (((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE_IMPL(jsval_layout l)\n{\n    return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE;\n}\n\nstatic inline jsval_layout\nDOUBLE_TO_JSVAL_IMPL(double d)\n{\n    jsval_layout l;\n    l.asDouble = d;\n    MOZ_ASSERT(l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE);\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_INT32_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_INT32;\n}\n\nstatic inline int32_t\nJSVAL_TO_INT32_IMPL(jsval_layout l)\n{\n    return (int32_t)l.asBits;\n}\n\nstatic inline jsval_layout\nINT32_TO_JSVAL_IMPL(int32_t i32)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_UNDEFINED_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_UNDEFINED;\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_STRING;\n}\n\nstatic inline jsval_layout\nSTRING_TO_JSVAL_IMPL(JSString *str)\n{\n    jsval_layout l;\n    uint64_t strBits = (uint64_t)str;\n    MOZ_ASSERT(str);\n    MOZ_ASSERT((strBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = strBits | JSVAL_SHIFTED_TAG_STRING;\n    return l;\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING_IMPL(jsval_layout l)\n{\n    return (JSString *)(l.asBits & JSVAL_PAYLOAD_MASK);\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (uint32_t)(l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_BOOLEAN;\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN_IMPL(jsval_layout l)\n{\n    return (JSBool)l.asBits;\n}\n\nstatic inline jsval_layout\nBOOLEAN_TO_JSVAL_IMPL(JSBool b)\n{\n    jsval_layout l;\n    MOZ_ASSERT(b == JS_TRUE || b == JS_FALSE);\n    l.asBits = ((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_MAGIC_IMPL(jsval_layout l)\n{\n    return (l.asBits >> JSVAL_TAG_SHIFT) == JSVAL_TAG_MAGIC;\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)\n{\n    return l.asBits < JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_SHIFTED_TAG_OBJECT);\n    return l.asBits >= JSVAL_SHIFTED_TAG_OBJECT;\n}\n\nstatic inline JSBool\nJSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits >> JSVAL_TAG_SHIFT) <= JSVAL_TAG_OBJECT);\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET;\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (JSObject *)ptrBits;\n}\n\nstatic inline jsval_layout\nOBJECT_TO_JSVAL_IMPL(JSObject *obj)\n{\n    jsval_layout l;\n    uint64_t objBits = (uint64_t)obj;\n    MOZ_ASSERT(obj);\n    MOZ_ASSERT((objBits >> JSVAL_TAG_SHIFT) == 0);\n    l.asBits = objBits | JSVAL_SHIFTED_TAG_OBJECT;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_IS_NULL_IMPL(jsval_layout l)\n{\n    return l.asBits == JSVAL_SHIFTED_TAG_NULL;\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING_IMPL(jsval_layout l)\n{\n    return l.asBits >= JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET;\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING_IMPL(jsval_layout l)\n{\n    uint64_t ptrBits = l.asBits & JSVAL_PAYLOAD_MASK;\n    MOZ_ASSERT((ptrBits & 0x7) == 0);\n    return (void *)ptrBits;\n}\n\nstatic inline JSBool\nJSVAL_IS_TRACEABLE_IMPL(jsval_layout l)\n{\n    return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l);\n}\n\nstatic inline uint32_t\nJSVAL_TRACE_KIND_IMPL(jsval_layout l)\n{\n    return (uint32_t)(JSBool)!(JSVAL_IS_OBJECT_IMPL(l));\n}\n\nstatic inline jsval_layout\nPRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)\n{\n    jsval_layout l;\n    uint64_t ptrBits = (uint64_t)ptr;\n    MOZ_ASSERT((ptrBits & 1) == 0);\n    l.asBits = ptrBits >> 1;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));\n    return l;\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)\n{\n    MOZ_ASSERT((l.asBits & 0x8000000000000000LL) == 0);\n    return (void *)(l.asBits << 1);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)\n{\n    return l.asBits == (((uint64_t)(uint32_t)i32) | JSVAL_SHIFTED_TAG_INT32);\n}\n\nstatic inline JSBool\nJSVAL_IS_SPECIFIC_BOOLEAN(jsval_layout l, JSBool b)\n{\n    return l.asBits == (((uint64_t)(uint32_t)b) | JSVAL_SHIFTED_TAG_BOOLEAN);\n}\n\nstatic inline jsval_layout\nMAGIC_TO_JSVAL_IMPL(JSWhyMagic why)\n{\n    jsval_layout l;\n    l.asBits = ((uint64_t)(uint32_t)why) | JSVAL_SHIFTED_TAG_MAGIC;\n    return l;\n}\n\nstatic inline JSBool\nJSVAL_SAME_TYPE_IMPL(jsval_layout lhs, jsval_layout rhs)\n{\n    uint64_t lbits = lhs.asBits, rbits = rhs.asBits;\n    return (lbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE && rbits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE) ||\n           (((lbits ^ rbits) & 0xFFFF800000000000LL) == 0);\n}\n\nstatic inline JSValueType\nJSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(jsval_layout l)\n{\n   uint64_t type = (l.asBits >> JSVAL_TAG_SHIFT) & 0xF;\n   MOZ_ASSERT(type > JSVAL_TYPE_DOUBLE);\n   return (JSValueType)type;\n}\n\n#endif  /* JS_BITS_PER_WORD */\n\nstatic inline jsval_layout JSVAL_TO_IMPL(JS::Value v);\nstatic inline JS::Value IMPL_TO_JSVAL(jsval_layout l);\n\nnamespace JS {\n\n/**\n * Returns a generic quiet NaN value, with all payload bits set to zero.\n *\n * Among other properties, this NaN's bit pattern conforms to JS::Value's\n * bit pattern restrictions.\n */\nstatic MOZ_ALWAYS_INLINE double\nGenericNaN()\n{\n    return mozilla::SpecificNaN(0, 0x8000000000000ULL);\n}\n\nstatic inline double\nCanonicalizeNaN(double d)\n{\n    if (MOZ_UNLIKELY(mozilla::IsNaN(d)))\n        return GenericNaN();\n    return d;\n}\n\n/*\n * JS::Value is the interface for a single JavaScript Engine value.  A few\n * general notes on JS::Value:\n *\n * - JS::Value has setX() and isX() members for X in\n *\n *     { Int32, Double, String, Boolean, Undefined, Null, Object, Magic }\n *\n *   JS::Value also contains toX() for each of the non-singleton types.\n *\n * - Magic is a singleton type whose payload contains a JSWhyMagic \"reason\" for\n *   the magic value. By providing JSWhyMagic values when creating and checking\n *   for magic values, it is possible to assert, at runtime, that only magic\n *   values with the expected reason flow through a particular value. For\n *   example, if cx->exception has a magic value, the reason must be\n *   JS_GENERATOR_CLOSING.\n *\n * - The JS::Value operations are preferred.  The JSVAL_* operations remain for\n *   compatibility; they may be removed at some point.  These operations mostly\n *   provide similar functionality.  But there are a few key differences.  One\n *   is that JS::Value gives null a separate type. Thus\n *\n *           JSVAL_IS_OBJECT(v) === v.isObjectOrNull()\n *       !JSVAL_IS_PRIMITIVE(v) === v.isObject()\n *\n *   Also, to help prevent mistakenly boxing a nullable JSObject* as an object,\n *   Value::setObject takes a JSObject&. (Conversely, Value::asObject returns a\n *   JSObject&.)  A convenience member Value::setObjectOrNull is provided.\n *\n * - JSVAL_VOID is the same as the singleton value of the Undefined type.\n *\n * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on\n *   32-bit user code should avoid copying jsval/JS::Value as much as possible,\n *   preferring to pass by const Value &.\n */\nclass Value\n{\n  public:\n    /*\n     * N.B. the default constructor leaves Value unitialized. Adding a default\n     * constructor prevents Value from being stored in a union.\n     */\n\n    /*** Mutators ***/\n\n    void setNull() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;\n    }\n\n    void setUndefined() {\n        data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;\n    }\n\n    void setInt32(int32_t i) {\n        data = INT32_TO_JSVAL_IMPL(i);\n    }\n\n    int32_t &getInt32Ref() {\n        MOZ_ASSERT(isInt32());\n        return data.s.payload.i32;\n    }\n\n    void setDouble(double d) {\n        data = DOUBLE_TO_JSVAL_IMPL(d);\n    }\n\n    double &getDoubleRef() {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    void setString(JSString *str) {\n        MOZ_ASSERT(!IsPoisonedPtr(str));\n        data = STRING_TO_JSVAL_IMPL(str);\n    }\n\n    void setString(const JS::Anchor<JSString *> &str) {\n        setString(str.get());\n    }\n\n    void setObject(JSObject &obj) {\n        MOZ_ASSERT(!IsPoisonedPtr(&obj));\n        data = OBJECT_TO_JSVAL_IMPL(&obj);\n    }\n\n    void setBoolean(bool b) {\n        data = BOOLEAN_TO_JSVAL_IMPL(b);\n    }\n\n    void setMagic(JSWhyMagic why) {\n        data = MAGIC_TO_JSVAL_IMPL(why);\n    }\n\n    bool setNumber(uint32_t ui) {\n        if (ui > JSVAL_INT_MAX) {\n            setDouble((double)ui);\n            return false;\n        } else {\n            setInt32((int32_t)ui);\n            return true;\n        }\n    }\n\n    bool setNumber(double d) {\n        int32_t i;\n        if (mozilla::DoubleIsInt32(d, &i)) {\n            setInt32(i);\n            return true;\n        }\n\n        setDouble(d);\n        return false;\n    }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n\n    void swap(Value &rhs) {\n        uint64_t tmp = rhs.data.asBits;\n        rhs.data.asBits = data.asBits;\n        data.asBits = tmp;\n    }\n\n    /*** Value type queries ***/\n\n    bool isUndefined() const {\n        return JSVAL_IS_UNDEFINED_IMPL(data);\n    }\n\n    bool isNull() const {\n        return JSVAL_IS_NULL_IMPL(data);\n    }\n\n    bool isNullOrUndefined() const {\n        return isNull() || isUndefined();\n    }\n\n    bool isInt32() const {\n        return JSVAL_IS_INT32_IMPL(data);\n    }\n\n    bool isInt32(int32_t i32) const {\n        return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);\n    }\n\n    bool isDouble() const {\n        return JSVAL_IS_DOUBLE_IMPL(data);\n    }\n\n    bool isNumber() const {\n        return JSVAL_IS_NUMBER_IMPL(data);\n    }\n\n    bool isString() const {\n        return JSVAL_IS_STRING_IMPL(data);\n    }\n\n    bool isObject() const {\n        return JSVAL_IS_OBJECT_IMPL(data);\n    }\n\n    bool isPrimitive() const {\n        return JSVAL_IS_PRIMITIVE_IMPL(data);\n    }\n\n    bool isObjectOrNull() const {\n        return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);\n    }\n\n    bool isGCThing() const {\n        return JSVAL_IS_GCTHING_IMPL(data);\n    }\n\n    bool isBoolean() const {\n        return JSVAL_IS_BOOLEAN_IMPL(data);\n    }\n\n    bool isTrue() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, true);\n    }\n\n    bool isFalse() const {\n        return JSVAL_IS_SPECIFIC_BOOLEAN(data, false);\n    }\n\n    bool isMagic() const {\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMagic(JSWhyMagic why) const {\n        MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);\n        return JSVAL_IS_MAGIC_IMPL(data);\n    }\n\n    bool isMarkable() const {\n        return JSVAL_IS_TRACEABLE_IMPL(data);\n    }\n\n    JSGCTraceKind gcKind() const {\n        MOZ_ASSERT(isMarkable());\n        return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));\n    }\n\n    JSWhyMagic whyMagic() const {\n        MOZ_ASSERT(isMagic());\n        return data.s.payload.why;\n    }\n\n    /*** Comparison ***/\n\n    bool operator==(const Value &rhs) const {\n        return data.asBits == rhs.data.asBits;\n    }\n\n    bool operator!=(const Value &rhs) const {\n        return data.asBits != rhs.data.asBits;\n    }\n\n    friend inline bool SameType(const Value &lhs, const Value &rhs);\n\n    /*** Extract the value's typed payload ***/\n\n    int32_t toInt32() const {\n        MOZ_ASSERT(isInt32());\n        return JSVAL_TO_INT32_IMPL(data);\n    }\n\n    double toDouble() const {\n        MOZ_ASSERT(isDouble());\n        return data.asDouble;\n    }\n\n    double toNumber() const {\n        MOZ_ASSERT(isNumber());\n        return isDouble() ? toDouble() : double(toInt32());\n    }\n\n    JSString *toString() const {\n        MOZ_ASSERT(isString());\n        return JSVAL_TO_STRING_IMPL(data);\n    }\n\n    JSObject &toObject() const {\n        MOZ_ASSERT(isObject());\n        return *JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    JSObject *toObjectOrNull() const {\n        MOZ_ASSERT(isObjectOrNull());\n        return JSVAL_TO_OBJECT_IMPL(data);\n    }\n\n    void *toGCThing() const {\n        MOZ_ASSERT(isGCThing());\n        return JSVAL_TO_GCTHING_IMPL(data);\n    }\n\n    bool toBoolean() const {\n        MOZ_ASSERT(isBoolean());\n        return JSVAL_TO_BOOLEAN_IMPL(data);\n    }\n\n    uint32_t payloadAsRawUint32() const {\n        MOZ_ASSERT(!isDouble());\n        return data.s.payload.u32;\n    }\n\n    uint64_t asRawBits() const {\n        return data.asBits;\n    }\n\n    JSValueType extractNonDoubleType() const {\n        return JSVAL_EXTRACT_NON_DOUBLE_TYPE_IMPL(data);\n    }\n\n    /*\n     * Private API\n     *\n     * Private setters/getters allow the caller to read/write arbitrary types\n     * that fit in the 64-bit payload. It is the caller's responsibility, after\n     * storing to a value with setPrivateX to read only using getPrivateX.\n     * Privates values are given a type which ensures they are not marked.\n     */\n\n    void setPrivate(void *ptr) {\n        data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);\n    }\n\n    void *toPrivate() const {\n        MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));\n        return JSVAL_TO_PRIVATE_PTR_IMPL(data);\n    }\n\n    void setPrivateUint32(uint32_t ui) {\n        MOZ_ASSERT(uint32_t(int32_t(ui)) == ui);\n        setInt32(int32_t(ui));\n    }\n\n    uint32_t toPrivateUint32() const {\n        return uint32_t(toInt32());\n    }\n\n    /*\n     * An unmarked value is just a void* cast as a Value. Thus, the Value is\n     * not safe for GC and must not be marked. This API avoids raw casts\n     * and the ensuing strict-aliasing warnings.\n     */\n\n    void setUnmarkedPtr(void *ptr) {\n        data.asPtr = ptr;\n    }\n\n    void *toUnmarkedPtr() const {\n        return data.asPtr;\n    }\n\n    const size_t *payloadWord() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.word;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asWord;\n#endif\n    }\n\n    const uintptr_t *payloadUIntPtr() const {\n#if JS_BITS_PER_WORD == 32\n        return &data.s.payload.uintptr;\n#elif JS_BITS_PER_WORD == 64\n        return &data.asUIntPtr;\n#endif\n    }\n\n#if !defined(_MSC_VER) && !defined(__sparc)\n  // Value must be POD so that MSVC will pass it by value and not in memory\n  // (bug 689101); the same is true for SPARC as well (bug 737344).  More\n  // precisely, we don't want Value return values compiled as out params.\n  private:\n#endif\n\n    jsval_layout data;\n\n  private:\n    void staticAssertions() {\n        JS_STATIC_ASSERT(sizeof(JSValueType) == 1);\n        JS_STATIC_ASSERT(sizeof(JSValueTag) == 4);\n        JS_STATIC_ASSERT(sizeof(JSBool) == 4);\n        JS_STATIC_ASSERT(sizeof(JSWhyMagic) <= 4);\n        JS_STATIC_ASSERT(sizeof(Value) == 8);\n    }\n\n    friend jsval_layout (::JSVAL_TO_IMPL)(Value);\n    friend Value (::IMPL_TO_JSVAL)(jsval_layout l);\n};\n\ninline bool\nIsPoisonedValue(const Value &v)\n{\n    if (v.isString())\n        return IsPoisonedPtr(v.toString());\n    if (v.isObject())\n        return IsPoisonedPtr(&v.toObject());\n    return false;\n}\n\n/************************************************************************/\n\nstatic inline Value\nNullValue()\n{\n    Value v;\n    v.setNull();\n    return v;\n}\n\nstatic inline Value\nUndefinedValue()\n{\n    Value v;\n    v.setUndefined();\n    return v;\n}\n\nstatic inline Value\nInt32Value(int32_t i32)\n{\n    Value v;\n    v.setInt32(i32);\n    return v;\n}\n\nstatic inline Value\nDoubleValue(double dbl)\n{\n    Value v;\n    v.setDouble(dbl);\n    return v;\n}\n\nstatic inline Value\nStringValue(JSString *str)\n{\n    Value v;\n    v.setString(str);\n    return v;\n}\n\nstatic inline Value\nBooleanValue(bool boo)\n{\n    Value v;\n    v.setBoolean(boo);\n    return v;\n}\n\nstatic inline Value\nObjectValue(JSObject &obj)\n{\n    Value v;\n    v.setObject(obj);\n    return v;\n}\n\nstatic inline Value\nObjectValueCrashOnTouch()\n{\n    Value v;\n    v.setObject(*reinterpret_cast<JSObject *>(0x42));\n    return v;\n}\n\nstatic inline Value\nMagicValue(JSWhyMagic why)\n{\n    Value v;\n    v.setMagic(why);\n    return v;\n}\n\nstatic inline Value\nNumberValue(float f)\n{\n    Value v;\n    v.setNumber(f);\n    return v;\n}\n\nstatic inline Value\nNumberValue(double dbl)\n{\n    Value v;\n    v.setNumber(dbl);\n    return v;\n}\n\nstatic inline Value\nNumberValue(int8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint8_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint16_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(int32_t i)\n{\n    return Int32Value(i);\n}\n\nstatic inline Value\nNumberValue(uint32_t i)\n{\n    Value v;\n    v.setNumber(i);\n    return v;\n}\n\nnamespace detail {\n\ntemplate <bool Signed>\nclass MakeNumberValue\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (JSVAL_INT_MIN <= t && t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\ntemplate <>\nclass MakeNumberValue<false>\n{\n  public:\n    template<typename T>\n    static inline Value create(const T t)\n    {\n        Value v;\n        if (t <= JSVAL_INT_MAX)\n            v.setInt32(int32_t(t));\n        else\n            v.setDouble(double(t));\n        return v;\n    }\n};\n\n} // namespace detail\n\ntemplate <typename T>\nstatic inline Value\nNumberValue(const T t)\n{\n    MOZ_ASSERT(T(double(t)) == t, \"value creation would be lossy\");\n    return detail::MakeNumberValue<std::numeric_limits<T>::is_signed>::create(t);\n}\n\nstatic inline Value\nObjectOrNullValue(JSObject *obj)\n{\n    Value v;\n    v.setObjectOrNull(obj);\n    return v;\n}\n\nstatic inline Value\nPrivateValue(void *ptr)\n{\n    Value v;\n    v.setPrivate(ptr);\n    return v;\n}\n\nstatic inline Value\nPrivateUint32Value(uint32_t ui)\n{\n    Value v;\n    v.setPrivateUint32(ui);\n    return v;\n}\n\ninline bool\nSameType(const Value &lhs, const Value &rhs)\n{\n    return JSVAL_SAME_TYPE_IMPL(lhs.data, rhs.data);\n}\n\n} // namespace JS\n\n/************************************************************************/\n\n#ifdef JSGC_GENERATIONAL\nnamespace JS {\nJS_PUBLIC_API(void) HeapValuePostBarrier(Value *valuep);\nJS_PUBLIC_API(void) HeapValueRelocate(Value *valuep);\n}\n#endif\n\nnamespace js {\n\ntemplate <> struct GCMethods<const JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n};\n\ntemplate <> struct GCMethods<JS::Value>\n{\n    static JS::Value initial() { return JS::UndefinedValue(); }\n    static ThingRootKind kind() { return THING_ROOT_VALUE; }\n    static bool poisoned(const JS::Value &v) { return JS::IsPoisonedValue(v); }\n    static bool needsPostBarrier(const JS::Value &v) { return v.isMarkable(); }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }\n    static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }\n#endif\n};\n\ntemplate <class Outer> class UnbarrieredMutableValueOperations;\ntemplate <class Outer> class MutableValueOperations;\n\n/*\n * A class designed for CRTP use in implementing the non-mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * ValueOperations<Outer> with a visible extract() method returning the\n * const Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass ValueOperations\n{\n    friend class UnbarrieredMutableValueOperations<Outer>;\n    friend class MutableValueOperations<Outer>;\n\n    const JS::Value * value() const { return static_cast<const Outer*>(this)->extract(); }\n\n  public:\n    bool isUndefined() const { return value()->isUndefined(); }\n    bool isNull() const { return value()->isNull(); }\n    bool isBoolean() const { return value()->isBoolean(); }\n    bool isTrue() const { return value()->isTrue(); }\n    bool isFalse() const { return value()->isFalse(); }\n    bool isNumber() const { return value()->isNumber(); }\n    bool isInt32() const { return value()->isInt32(); }\n    bool isDouble() const { return value()->isDouble(); }\n    bool isString() const { return value()->isString(); }\n    bool isObject() const { return value()->isObject(); }\n    bool isMagic() const { return value()->isMagic(); }\n    bool isMagic(JSWhyMagic why) const { return value()->isMagic(why); }\n    bool isMarkable() const { return value()->isMarkable(); }\n    bool isPrimitive() const { return value()->isPrimitive(); }\n    bool isGCThing() const { return value()->isGCThing(); }\n\n    bool isNullOrUndefined() const { return value()->isNullOrUndefined(); }\n    bool isObjectOrNull() const { return value()->isObjectOrNull(); }\n\n    bool toBoolean() const { return value()->toBoolean(); }\n    double toNumber() const { return value()->toNumber(); }\n    int32_t toInt32() const { return value()->toInt32(); }\n    double toDouble() const { return value()->toDouble(); }\n    JSString *toString() const { return value()->toString(); }\n    JSObject &toObject() const { return value()->toObject(); }\n    JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); }\n    void *toGCThing() const { return value()->toGCThing(); }\n\n    JSValueType extractNonDoubleType() const { return value()->extractNonDoubleType(); }\n    uint32_t toPrivateUint32() const { return value()->toPrivateUint32(); }\n\n    JSWhyMagic whyMagic() const { return value()->whyMagic(); }\n};\n\n/*\n * A class designed for CRTP use in implementing the mutating parts of the Value\n * interface in Value-like classes that don't need post barriers.  Outer must be\n * a class inheriting UnbarrieredMutableValueOperations<Outer> with visible\n * extractMutable() and extract() methods returning the const Value* and Value*\n * abstracted by Outer.\n */\ntemplate <class Outer>\nclass UnbarrieredMutableValueOperations : public ValueOperations<Outer>\n{\n    friend class MutableValueOperations<Outer>;\n    JS::Value * value() { return static_cast<Outer*>(this)->extractMutable(); }\n\n  public:\n    void setNull() { value()->setNull(); }\n    void setUndefined() { value()->setUndefined(); }\n    void setInt32(int32_t i) { value()->setInt32(i); }\n    void setDouble(double d) { value()->setDouble(d); }\n    void setBoolean(bool b) { value()->setBoolean(b); }\n    void setMagic(JSWhyMagic why) { value()->setMagic(why); }\n    bool setNumber(uint32_t ui) { return value()->setNumber(ui); }\n    bool setNumber(double d) { return value()->setNumber(d); }\n};\n\n/*\n * A class designed for CRTP use in implementing all the mutating parts of the\n * Value interface in Value-like classes.  Outer must be a class inheriting\n * MutableValueOperations<Outer> with visible extractMutable() and extract()\n * methods returning the const Value* and Value* abstracted by Outer.\n */\ntemplate <class Outer>\nclass MutableValueOperations : public UnbarrieredMutableValueOperations<Outer>\n{\n  public:\n    void setString(JSString *str) { this->value()->setString(str); }\n    void setString(const JS::Anchor<JSString *> &str) { this->value()->setString(str); }\n    void setObject(JSObject &obj) { this->value()->setObject(obj); }\n    void setObjectOrNull(JSObject *arg) { this->value()->setObjectOrNull(arg); }\n};\n\n/*\n * Augment the generic Heap<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass HeapBase<JS::Value> : public UnbarrieredMutableValueOperations<JS::Heap<JS::Value> >\n{\n    typedef JS::Heap<JS::Value> Outer;\n\n    friend class ValueOperations<Outer>;\n    friend class UnbarrieredMutableValueOperations<Outer>;\n\n    const JS::Value * extract() const { return static_cast<const Outer*>(this)->address(); }\n    JS::Value * extractMutable() { return static_cast<Outer*>(this)->unsafeGet(); }\n\n    /*\n     * Setters that potentially change the value to a GC thing from a non-GC\n     * thing must call JS::Heap::set() to trigger the post barrier.\n     *\n     * Changing from a GC thing to a non-GC thing value will leave the heap\n     * value in the store buffer, but it will be ingored so this is not a\n     * problem.\n     */\n    void setBarriered(const JS::Value &v) {\n        static_cast<JS::Heap<JS::Value> *>(this)->set(v);\n    }\n\n  public:\n    void setString(JSString *str) { setBarriered(JS::StringValue(str)); }\n    void setString(const JS::Anchor<JSString *> &str) { setBarriered(JS::StringValue(str.get())); }\n    void setObject(JSObject &obj) { setBarriered(JS::ObjectValue(obj)); }\n\n    void setObjectOrNull(JSObject *arg) {\n        if (arg)\n            setObject(*arg);\n        else\n            setNull();\n    }\n};\n\n/*\n * Augment the generic Handle<T> interface when T = Value with type-querying\n * and value-extracting operations.\n */\ntemplate <>\nclass HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> >\n{\n    friend class ValueOperations<JS::Handle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Handle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic MutableHandle<T> interface when T = Value with\n * type-querying, value-extracting, and mutating operations.\n */\ntemplate <>\nclass MutableHandleBase<JS::Value> : public MutableValueOperations<JS::MutableHandle<JS::Value> >\n{\n    friend class ValueOperations<JS::MutableHandle<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::MutableHandle<JS::Value> >;\n    friend class MutableValueOperations<JS::MutableHandle<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::MutableHandle<JS::Value>*>(this)->address();\n    }\n};\n\n/*\n * Augment the generic Rooted<T> interface when T = Value with type-querying,\n * value-extracting, and mutating operations.\n */\ntemplate <>\nclass RootedBase<JS::Value> : public MutableValueOperations<JS::Rooted<JS::Value> >\n{\n    friend class ValueOperations<JS::Rooted<JS::Value> >;\n    const JS::Value * extract() const {\n        return static_cast<const JS::Rooted<JS::Value>*>(this)->address();\n    }\n\n    friend class UnbarrieredMutableValueOperations<JS::Rooted<JS::Value> >;\n    friend class MutableValueOperations<JS::Rooted<JS::Value> >;\n    JS::Value * extractMutable() {\n        return static_cast<JS::Rooted<JS::Value>*>(this)->address();\n    }\n};\n\n} // namespace js\n\ninline jsval_layout\nJSVAL_TO_IMPL(JS::Value v)\n{\n    return v.data;\n}\n\ninline JS::Value\nIMPL_TO_JSVAL(jsval_layout l)\n{\n    JS::Value v;\n    v.data = l;\n    return v;\n}\n\nnamespace JS {\n\n#ifndef __GNUC__\n/*\n * The default assignment operator for |struct C| has the signature:\n *\n *   C& C::operator=(const C&)\n *\n * And in particular requires implicit conversion of |this| to type |C| for the\n * return value. But |volatile C| cannot thus be converted to |C|, so just\n * doing |sink = hold| as in the non-specialized version would fail to compile.\n * Do the assignment on asBits instead, since I don't think we want to give\n * jsval_layout an assignment operator returning |volatile jsval_layout|.\n */\ntemplate<>\ninline Anchor<Value>::~Anchor()\n{\n    volatile uint64_t bits;\n    bits = JSVAL_TO_IMPL(hold).asBits;\n}\n#endif\n\n#ifdef DEBUG\nnamespace detail {\n\nstruct ValueAlignmentTester { char c; JS::Value v; };\nstatic_assert(sizeof(ValueAlignmentTester) == 16,\n              \"JS::Value must be 16-byte-aligned\");\n\nstruct LayoutAlignmentTester { char c; jsval_layout l; };\nstatic_assert(sizeof(LayoutAlignmentTester) == 16,\n              \"jsval_layout must be 16-byte-aligned\");\n\n} // namespace detail\n#endif /* DEBUG */\n\n} // namespace JS\n\n/*\n * JS::Value and jsval are the same type; jsval is the old name, kept around\n * for backwards compatibility along with all the JSVAL_* operations below.\n * jsval_layout is an implementation detail and should not be used externally.\n */\ntypedef JS::Value jsval;\n\nstatic_assert(sizeof(jsval_layout) == sizeof(JS::Value),\n              \"jsval_layout and JS::Value must have identical layouts\");\n\n/************************************************************************/\n\nstatic inline JSBool\nJSVAL_IS_NULL(jsval v)\n{\n    return JSVAL_IS_NULL_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_VOID(jsval v)\n{\n    return JSVAL_IS_UNDEFINED_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_INT(jsval v)\n{\n    return JSVAL_IS_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline int32_t\nJSVAL_TO_INT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_INT(v));\n    return JSVAL_TO_INT32_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nINT_TO_JSVAL(int32_t i)\n{\n    return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));\n}\n\nstatic inline JSBool\nJSVAL_IS_DOUBLE(jsval v)\n{\n    return JSVAL_IS_DOUBLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline double\nJSVAL_TO_DOUBLE(jsval v)\n{\n    jsval_layout l;\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    l = JSVAL_TO_IMPL(v);\n    return l.asDouble;\n}\n\nstatic inline jsval\nDOUBLE_TO_JSVAL(double d)\n{\n    /*\n     * This is a manually inlined version of:\n     *    d = JS_CANONICALIZE_NAN(d);\n     *    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));\n     * because GCC from XCode 3.1.4 miscompiles the above code.\n     */\n    jsval_layout l;\n    if (MOZ_UNLIKELY(d != d))\n        l.asBits = 0x7FF8000000000000LL;\n    else\n        l.asDouble = d;\n    return IMPL_TO_JSVAL(l);\n}\n\nstatic inline jsval\nUINT_TO_JSVAL(uint32_t i)\n{\n    if (i <= JSVAL_INT_MAX)\n        return INT_TO_JSVAL((int32_t)i);\n    return DOUBLE_TO_JSVAL((double)i);\n}\n\nstatic inline JSBool\nJSVAL_IS_NUMBER(jsval v)\n{\n    return JSVAL_IS_NUMBER_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_STRING(jsval v)\n{\n    return JSVAL_IS_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSString *\nJSVAL_TO_STRING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_STRING(v));\n    return JSVAL_TO_STRING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nSTRING_TO_JSVAL(JSString *str)\n{\n    return IMPL_TO_JSVAL(STRING_TO_JSVAL_IMPL(str));\n}\n\nstatic inline JSObject *\nJSVAL_TO_OBJECT(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_OBJECT_OR_NULL_IMPL(JSVAL_TO_IMPL(v)));\n    return JSVAL_TO_OBJECT_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nOBJECT_TO_JSVAL(JSObject *obj)\n{\n    if (obj)\n        return IMPL_TO_JSVAL(OBJECT_TO_JSVAL_IMPL(obj));\n    return IMPL_TO_JSVAL(BUILD_JSVAL(JSVAL_TAG_NULL, 0));\n}\n\nstatic inline JSBool\nJSVAL_IS_BOOLEAN(jsval v)\n{\n    return JSVAL_IS_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_TO_BOOLEAN(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_BOOLEAN(v));\n    return JSVAL_TO_BOOLEAN_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline jsval\nBOOLEAN_TO_JSVAL(JSBool b)\n{\n    return IMPL_TO_JSVAL(BOOLEAN_TO_JSVAL_IMPL(b));\n}\n\nstatic inline JSBool\nJSVAL_IS_PRIMITIVE(jsval v)\n{\n    return JSVAL_IS_PRIMITIVE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline JSBool\nJSVAL_IS_GCTHING(jsval v)\n{\n    return JSVAL_IS_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic inline void *\nJSVAL_TO_GCTHING(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_GCTHING(v));\n    return JSVAL_TO_GCTHING_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/* To be GC-safe, privates are tagged as doubles. */\n\nstatic inline jsval\nPRIVATE_TO_JSVAL(void *ptr)\n{\n    return IMPL_TO_JSVAL(PRIVATE_PTR_TO_JSVAL_IMPL(ptr));\n}\n\nstatic inline void *\nJSVAL_TO_PRIVATE(jsval v)\n{\n    MOZ_ASSERT(JSVAL_IS_DOUBLE(v));\n    return JSVAL_TO_PRIVATE_PTR_IMPL(JSVAL_TO_IMPL(v));\n}\n\n#endif /* js_Value_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_Vector_h\n#define js_Vector_h\n\n#include \"mozilla/Vector.h\"\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace js {\n\nclass TempAllocPolicy;\n\n// If we had C++11 template aliases, we could just use this:\n//\n//   template <typename T,\n//             size_t MinInlineCapacity = 0,\n//             class AllocPolicy = TempAllocPolicy>\n//   using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;\n//\n// ...and get rid of all the CRTP madness in mozilla::Vector(Base).  But we\n// can't because compiler support's not up to snuff.  (Template aliases are in\n// gcc 4.7 and clang 3.0 and are expected to be in MSVC 2013.)  Instead, have a\n// completely separate class inheriting from mozilla::Vector, and throw CRTP at\n// the problem til things work.\n//\n// This workaround presents a couple issues.  First, because js::Vector is a\n// distinct type from mozilla::Vector, overload resolution, method calls, etc.\n// are affected.  *Hopefully* this won't be too bad in practice.  (A bunch of\n// places had to be fixed when mozilla::Vector was introduced, but it wasn't a\n// crazy number.)  Second, mozilla::Vector's interface has to be made subclass-\n// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one\n// should use.  :-)  Third, we have to redefine the constructors and the non-\n// inherited operators.  Blech.  Happily there aren't too many of these, so it\n// isn't the end of the world.\n\ntemplate <typename T,\n          size_t MinInlineCapacity = 0,\n          class AllocPolicy = TempAllocPolicy>\nclass Vector\n  : public mozilla::VectorBase<T,\n                               MinInlineCapacity,\n                               AllocPolicy,\n                               Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector &operator=(mozilla::MoveRef<Vector> vec) {\n        return Base::operator=(vec);\n    }\n};\n\n} // namespace js\n\n#endif /* js_Vector_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js-config.h",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sw=4 et tw=78:\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef js_config_h___\n#define js_config_h___\n\n/* Definitions set at build time that affect SpiderMonkey's public API.\n   This header file is generated by the SpiderMonkey configure script,\n   and installed along with jsapi.h.  */\n\n/* Define to 1 if SpiderMonkey should support multi-threaded clients.  */\n/* #undef JS_THREADSAFE */\n\n/* Define to 1 if SpiderMonkey should include ctypes support.  */\n/* #undef JS_HAS_CTYPES */\n\n/* Define to 1 if SpiderMonkey should support the ability to perform\n   entirely too much GC.  */\n/* #undef JS_GC_ZEAL */\n\n/* Define to 1 if the <endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_ENDIAN_H */\n\n/* Define to 1 if the <machine/endian.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_MACHINE_ENDIAN_H */\n\n/* Define to 1 if the <sys/isa_defs.h> header is present and\n   useable.  See jscpucfg.h.  */\n/* #undef JS_HAVE_SYS_ISA_DEFS_H */\n\n/* The configure script defines these if it doesn't #define\n   JS_HAVE_STDINT_H.  */\n/* #undef JS_BYTES_PER_WORD */\n\n/* MOZILLA JSAPI version number components */\n#define MOZJS_MAJOR_VERSION 25\n#define MOZJS_MINOR_VERSION 0\n\n#endif /* js_config_h___ */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js.msg",
    "content": "/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * This is the JavaScript error message file.\n *\n * The format for each JS error message is:\n *\n * MSG_DEF(<SYMBOLIC_NAME>, <ERROR_NUMBER>, <ARGUMENT_COUNT>, <EXCEPTION_NAME>,\n *         <FORMAT_STRING>)\n *\n * where ;\n * <SYMBOLIC_NAME> is a legal C identifer that will be used in the\n * JS engine source.\n *\n * <ERROR_NUMBER> is an unique integral value identifying this error.\n *\n * <ARGUMENT_COUNT> is an integer literal specifying the total number of\n * replaceable arguments in the following format string.\n *\n * <EXCEPTION_NAME> is an exception index from the enum in jsexn.c;\n * JSEXN_NONE for none.  The given exception index will be raised by the\n * engine when the corresponding error occurs.\n *\n * <FORMAT_STRING> is a string literal, optionally containing sequences\n * {X} where X  is an integer representing the argument number that will\n * be replaced with a string value when the error is reported.\n *\n * e.g.\n *\n * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 73, JSEXN_NONE, 2,\n *         \"{0} is not a member of the {1} family\")\n *\n * can be used:\n *\n * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, \"Rhino\", \"Monkey\");\n *\n * to report:\n *\n * \"Rhino is not a member of the Monkey family\"\n *\n * When removing MSG_DEFs, convert them to JSMSG_UNUSED<n> placeholders:\n *\n *    MSG_DEF(JSMSG_UNUSED7,                  7, 0, JSEXN_NONE, \"\")\n *\n * Before adding a new MSG_DEF at the end, look for existing JSMSG_UNUSED<n>\n * free index placeholders in the middle of the list.\n */\n\nMSG_DEF(JSMSG_NOT_AN_ERROR,             0, 0, JSEXN_NONE, \"<Error #0 is reserved>\")\nMSG_DEF(JSMSG_NOT_DEFINED,              1, 1, JSEXN_REFERENCEERR, \"{0} is not defined\")\nMSG_DEF(JSMSG_INACTIVE,                 2, 0, JSEXN_INTERNALERR, \"nothing active on context\")\nMSG_DEF(JSMSG_MORE_ARGS_NEEDED,         3, 3, JSEXN_TYPEERR, \"{0} requires more than {1} argument{2}\")\nMSG_DEF(JSMSG_BAD_CHAR,                 4, 1, JSEXN_INTERNALERR, \"invalid format character {0}\")\nMSG_DEF(JSMSG_BAD_TYPE,                 5, 1, JSEXN_TYPEERR, \"unknown type {0}\")\nMSG_DEF(JSMSG_ALLOC_OVERFLOW,           6, 0, JSEXN_INTERNALERR, \"allocation size overflow\")\nMSG_DEF(JSMSG_MISSING_HEXDIGITS,        7, 0, JSEXN_SYNTAXERR, \"missing hexadecimal digits after '0x'\")\nMSG_DEF(JSMSG_INCOMPATIBLE_PROTO,       8, 3, JSEXN_TYPEERR, \"{0}.prototype.{1} called on incompatible {2}\")\nMSG_DEF(JSMSG_NO_CONSTRUCTOR,           9, 1, JSEXN_TYPEERR, \"{0} has no constructor\")\nMSG_DEF(JSMSG_CANT_ALIAS,              10, 3, JSEXN_TYPEERR, \"can't alias {0} to {1} in class {2}\")\nMSG_DEF(JSMSG_NOT_SCRIPTED_FUNCTION,   11, 1, JSEXN_TYPEERR, \"{0} is not a scripted function\")\nMSG_DEF(JSMSG_BAD_SORT_ARG,            12, 0, JSEXN_TYPEERR, \"invalid Array.prototype.sort argument\")\nMSG_DEF(JSMSG_BAD_ATOMIC_NUMBER,       13, 1, JSEXN_INTERNALERR, \"internal error: no index for atom {0}\")\nMSG_DEF(JSMSG_TOO_MANY_LITERALS,       14, 0, JSEXN_INTERNALERR, \"too many literals\")\nMSG_DEF(JSMSG_CANT_WATCH,              15, 1, JSEXN_TYPEERR, \"can't watch non-native objects of class {0}\")\nMSG_DEF(JSMSG_STACK_UNDERFLOW,         16, 2, JSEXN_INTERNALERR, \"internal error compiling {0}: stack underflow at pc {1}\")\nMSG_DEF(JSMSG_NEED_DIET,               17, 1, JSEXN_INTERNALERR, \"{0} too large\")\nMSG_DEF(JSMSG_TOO_MANY_LOCAL_ROOTS,    18, 0, JSEXN_ERR, \"out of local root space\")\nMSG_DEF(JSMSG_READ_ONLY,               19, 1, JSEXN_TYPEERR, \"{0} is read-only\")\nMSG_DEF(JSMSG_BAD_FORMAL,              20, 0, JSEXN_SYNTAXERR, \"malformed formal parameter\")\nMSG_DEF(JSMSG_CANT_DELETE,             21, 1, JSEXN_TYPEERR, \"property {0} is non-configurable and can't be deleted\")\nMSG_DEF(JSMSG_NOT_FUNCTION,            22, 1, JSEXN_TYPEERR, \"{0} is not a function\")\nMSG_DEF(JSMSG_NOT_CONSTRUCTOR,         23, 1, JSEXN_TYPEERR, \"{0} is not a constructor\")\nMSG_DEF(JSMSG_INVALID_DATE,            24, 0, JSEXN_RANGEERR, \"invalid date\")\nMSG_DEF(JSMSG_TOO_DEEP,                25, 1, JSEXN_INTERNALERR, \"{0} nested too deeply\")\nMSG_DEF(JSMSG_OVER_RECURSED,           26, 0, JSEXN_INTERNALERR, \"too much recursion\")\nMSG_DEF(JSMSG_IN_NOT_OBJECT,           27, 1, JSEXN_TYPEERR, \"invalid 'in' operand {0}\")\nMSG_DEF(JSMSG_BAD_NEW_RESULT,          28, 1, JSEXN_TYPEERR, \"invalid new expression result {0}\")\nMSG_DEF(JSMSG_OBJECT_ACCESS_DENIED,    29, 0, JSEXN_ERR, \"Permission denied to access object\")\nMSG_DEF(JSMSG_PROPERTY_ACCESS_DENIED,  30, 1, JSEXN_ERR, \"Permission denied to access property '{0}'\")\nMSG_DEF(JSMSG_BAD_INSTANCEOF_RHS,      31, 1, JSEXN_TYPEERR, \"invalid 'instanceof' operand {0}\")\nMSG_DEF(JSMSG_BAD_BYTECODE,            32, 1, JSEXN_INTERNALERR, \"unimplemented JavaScript bytecode {0}\")\nMSG_DEF(JSMSG_BAD_RADIX,               33, 0, JSEXN_RANGEERR, \"radix must be an integer at least 2 and no greater than 36\")\nMSG_DEF(JSMSG_PAREN_BEFORE_LET,        34, 0, JSEXN_SYNTAXERR, \"missing ( before let head\")\nMSG_DEF(JSMSG_CANT_CONVERT,            35, 1, JSEXN_ERR, \"can't convert {0} to an integer\")\nMSG_DEF(JSMSG_CYCLIC_VALUE,            36, 1, JSEXN_TYPEERR, \"cyclic {0} value\")\nMSG_DEF(JSMSG_COMPILE_EXECED_SCRIPT,   37, 0, JSEXN_TYPEERR, \"can't compile over a script that is currently executing\")\nMSG_DEF(JSMSG_CANT_CONVERT_TO,         38, 2, JSEXN_TYPEERR, \"can't convert {0} to {1}\")\nMSG_DEF(JSMSG_NO_PROPERTIES,           39, 1, JSEXN_TYPEERR, \"{0} has no properties\")\nMSG_DEF(JSMSG_CANT_FIND_CLASS,         40, 1, JSEXN_TYPEERR, \"can't find class id {0}\")\nMSG_DEF(JSMSG_DEAD_OBJECT,             41, 0, JSEXN_TYPEERR, \"can't access dead object\")\nMSG_DEF(JSMSG_BYTECODE_TOO_BIG,        42, 2, JSEXN_INTERNALERR, \"bytecode {0} too large (limit {1})\")\nMSG_DEF(JSMSG_UNKNOWN_FORMAT,          43, 1, JSEXN_INTERNALERR, \"unknown bytecode format {0}\")\nMSG_DEF(JSMSG_TOO_MANY_CON_ARGS,       44, 0, JSEXN_SYNTAXERR, \"too many constructor arguments\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_ARGS,       45, 0, JSEXN_SYNTAXERR, \"too many function arguments\")\nMSG_DEF(JSMSG_BAD_QUANTIFIER,          46, 0, JSEXN_SYNTAXERR, \"invalid quantifier\")\nMSG_DEF(JSMSG_MIN_TOO_BIG,             47, 1, JSEXN_SYNTAXERR, \"overlarge minimum {0}\")\nMSG_DEF(JSMSG_MAX_TOO_BIG,             48, 1, JSEXN_SYNTAXERR, \"overlarge maximum {0}\")\nMSG_DEF(JSMSG_OUT_OF_ORDER,            49, 1, JSEXN_SYNTAXERR, \"maximum {0} less than minimum\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_DECL,       50, 0, JSEXN_SYNTAXERR, \"missing = in destructuring declaration\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASS,        51, 0, JSEXN_REFERENCEERR, \"invalid destructuring assignment operator\")\nMSG_DEF(JSMSG_PAREN_AFTER_LET,         52, 0, JSEXN_SYNTAXERR, \"missing ) after let head\")\nMSG_DEF(JSMSG_CURLY_AFTER_LET,         53, 0, JSEXN_SYNTAXERR, \"missing } after let block\")\nMSG_DEF(JSMSG_MISSING_PAREN,           54, 0, JSEXN_SYNTAXERR, \"unterminated parenthetical\")\nMSG_DEF(JSMSG_UNTERM_CLASS,            55, 1, JSEXN_SYNTAXERR, \"unterminated character class {0}\")\nMSG_DEF(JSMSG_TRAILING_SLASH,          56, 0, JSEXN_SYNTAXERR, \"trailing \\\\ in regular expression\")\nMSG_DEF(JSMSG_BAD_CLASS_RANGE,         57, 0, JSEXN_SYNTAXERR, \"invalid range in character class\")\nMSG_DEF(JSMSG_BAD_REGEXP_FLAG,         58, 1, JSEXN_SYNTAXERR, \"invalid regular expression flag {0}\")\nMSG_DEF(JSMSG_NO_INPUT,                59, 5, JSEXN_SYNTAXERR, \"no input for /{0}/{1}{2}{3}{4}\")\nMSG_DEF(JSMSG_CANT_OPEN,               60, 2, JSEXN_ERR, \"can't open {0}: {1}\")\nMSG_DEF(JSMSG_TOO_MANY_FUN_APPLY_ARGS, 61, 0, JSEXN_RANGEERR, \"arguments array passed to Function.prototype.apply is too large\")\nMSG_DEF(JSMSG_UNMATCHED_RIGHT_PAREN,   62, 0, JSEXN_SYNTAXERR, \"unmatched ) in regular expression\")\nMSG_DEF(JSMSG_TOO_BIG_TO_ENCODE,       63, 0, JSEXN_INTERNALERR, \"data are to big to encode\")\nMSG_DEF(JSMSG_ARG_INDEX_OUT_OF_RANGE,  64, 1, JSEXN_RANGEERR, \"argument {0} accesses an index that is out of range\")\nMSG_DEF(JSMSG_SPREAD_TOO_LARGE,        65, 0, JSEXN_RANGEERR, \"array too large due to spread operand(s)\")\nMSG_DEF(JSMSG_SOURCE_TOO_LONG,         66, 0, JSEXN_RANGEERR, \"source is too long\")\nMSG_DEF(JSMSG_BAD_WEAKMAP_KEY,         67, 0, JSEXN_TYPEERR, \"cannot use the given object as a weak map key\")\nMSG_DEF(JSMSG_BAD_SCRIPT_MAGIC,        68, 0, JSEXN_INTERNALERR, \"bad script XDR magic number\")\nMSG_DEF(JSMSG_PAREN_BEFORE_FORMAL,     69, 0, JSEXN_SYNTAXERR, \"missing ( before formal parameters\")\nMSG_DEF(JSMSG_MISSING_FORMAL,          70, 0, JSEXN_SYNTAXERR, \"missing formal parameter\")\nMSG_DEF(JSMSG_PAREN_AFTER_FORMAL,      71, 0, JSEXN_SYNTAXERR, \"missing ) after formal parameters\")\nMSG_DEF(JSMSG_CURLY_BEFORE_BODY,       72, 0, JSEXN_SYNTAXERR, \"missing { before function body\")\nMSG_DEF(JSMSG_CURLY_AFTER_BODY,        73, 0, JSEXN_SYNTAXERR, \"missing } after function body\")\nMSG_DEF(JSMSG_PAREN_BEFORE_COND,       74, 0, JSEXN_SYNTAXERR, \"missing ( before condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_COND,        75, 0, JSEXN_SYNTAXERR, \"missing ) after condition\")\nMSG_DEF(JSMSG_BAD_DUP_ARGS,            76, 0, JSEXN_SYNTAXERR, \"duplicate argument names not allowed in this context\")\nMSG_DEF(JSMSG_NAME_AFTER_DOT,          77, 0, JSEXN_SYNTAXERR, \"missing name after . operator\")\nMSG_DEF(JSMSG_BRACKET_IN_INDEX,        78, 0, JSEXN_SYNTAXERR, \"missing ] in index expression\")\nMSG_DEF(JSMSG_ACCESSOR_DEF_DENIED,     79, 1, JSEXN_ERR, \"Permission denied to define accessor property '{0}'\")\nMSG_DEF(JSMSG_PAREN_BEFORE_SWITCH,     80, 0, JSEXN_SYNTAXERR, \"missing ( before switch expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_SWITCH,      81, 0, JSEXN_SYNTAXERR, \"missing ) after switch expression\")\nMSG_DEF(JSMSG_CURLY_BEFORE_SWITCH,     82, 0, JSEXN_SYNTAXERR, \"missing { before switch body\")\nMSG_DEF(JSMSG_COLON_AFTER_CASE,        83, 0, JSEXN_SYNTAXERR, \"missing : after case label\")\nMSG_DEF(JSMSG_WHILE_AFTER_DO,          84, 0, JSEXN_SYNTAXERR, \"missing while after do-loop body\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR,         85, 0, JSEXN_SYNTAXERR, \"missing ( after for\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_INIT,     86, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop initializer\")\nMSG_DEF(JSMSG_SEMI_AFTER_FOR_COND,     87, 0, JSEXN_SYNTAXERR, \"missing ; after for-loop condition\")\nMSG_DEF(JSMSG_PAREN_AFTER_FOR_CTRL,    88, 0, JSEXN_SYNTAXERR, \"missing ) after for-loop control\")\nMSG_DEF(JSMSG_CURLY_BEFORE_TRY,        89, 0, JSEXN_SYNTAXERR, \"missing { before try block\")\nMSG_DEF(JSMSG_CURLY_AFTER_TRY,         90, 0, JSEXN_SYNTAXERR, \"missing } after try block\")\nMSG_DEF(JSMSG_PAREN_BEFORE_CATCH,      91, 0, JSEXN_SYNTAXERR, \"missing ( before catch\")\nMSG_DEF(JSMSG_CATCH_IDENTIFIER,        92, 0, JSEXN_SYNTAXERR, \"missing identifier in catch\")\nMSG_DEF(JSMSG_PAREN_AFTER_CATCH,       93, 0, JSEXN_SYNTAXERR, \"missing ) after catch\")\nMSG_DEF(JSMSG_CURLY_BEFORE_CATCH,      94, 0, JSEXN_SYNTAXERR, \"missing { before catch block\")\nMSG_DEF(JSMSG_CURLY_AFTER_CATCH,       95, 0, JSEXN_SYNTAXERR, \"missing } after catch block\")\nMSG_DEF(JSMSG_CURLY_BEFORE_FINALLY,    96, 0, JSEXN_SYNTAXERR, \"missing { before finally block\")\nMSG_DEF(JSMSG_CURLY_AFTER_FINALLY,     97, 0, JSEXN_SYNTAXERR, \"missing } after finally block\")\nMSG_DEF(JSMSG_CATCH_OR_FINALLY,        98, 0, JSEXN_SYNTAXERR, \"missing catch or finally after try\")\nMSG_DEF(JSMSG_PAREN_BEFORE_WITH,       99, 0, JSEXN_SYNTAXERR, \"missing ( before with-statement object\")\nMSG_DEF(JSMSG_PAREN_AFTER_WITH,       100, 0, JSEXN_SYNTAXERR, \"missing ) after with-statement object\")\nMSG_DEF(JSMSG_CURLY_IN_COMPOUND,      101, 0, JSEXN_SYNTAXERR, \"missing } in compound statement\")\nMSG_DEF(JSMSG_NO_VARIABLE_NAME,       102, 0, JSEXN_SYNTAXERR, \"missing variable name\")\nMSG_DEF(JSMSG_COLON_IN_COND,          103, 0, JSEXN_SYNTAXERR, \"missing : in conditional expression\")\nMSG_DEF(JSMSG_PAREN_AFTER_ARGS,       104, 0, JSEXN_SYNTAXERR, \"missing ) after argument list\")\nMSG_DEF(JSMSG_BRACKET_AFTER_LIST,     105, 0, JSEXN_SYNTAXERR, \"missing ] after element list\")\nMSG_DEF(JSMSG_COLON_AFTER_ID,         106, 0, JSEXN_SYNTAXERR, \"missing : after property id\")\nMSG_DEF(JSMSG_CURLY_AFTER_LIST,       107, 0, JSEXN_SYNTAXERR, \"missing } after property list\")\nMSG_DEF(JSMSG_PAREN_IN_PAREN,         108, 0, JSEXN_SYNTAXERR, \"missing ) in parenthetical\")\nMSG_DEF(JSMSG_SEMI_BEFORE_STMNT,      109, 0, JSEXN_SYNTAXERR, \"missing ; before statement\")\nMSG_DEF(JSMSG_NO_RETURN_VALUE,        110, 1, JSEXN_TYPEERR, \"function {0} does not always return a value\")\nMSG_DEF(JSMSG_DUPLICATE_FORMAL,       111, 1, JSEXN_SYNTAXERR, \"duplicate formal argument {0}\")\nMSG_DEF(JSMSG_EQUAL_AS_ASSIGN,        112, 0, JSEXN_SYNTAXERR, \"test for equality (==) mistyped as assignment (=)?\")\nMSG_DEF(JSMSG_OPTIMIZED_CLOSURE_LEAK, 113, 0, JSEXN_INTERNALERR, \"can't access optimized closure\")\nMSG_DEF(JSMSG_TOO_MANY_DEFAULTS,      114, 0, JSEXN_SYNTAXERR, \"more than one switch default\")\nMSG_DEF(JSMSG_TOO_MANY_CASES,         115, 0, JSEXN_INTERNALERR, \"too many switch cases\")\nMSG_DEF(JSMSG_BAD_SWITCH,             116, 0, JSEXN_SYNTAXERR, \"invalid switch statement\")\nMSG_DEF(JSMSG_BAD_FOR_LEFTSIDE,       117, 0, JSEXN_SYNTAXERR, \"invalid for/in left-hand side\")\nMSG_DEF(JSMSG_CATCH_AFTER_GENERAL,    118, 0, JSEXN_SYNTAXERR, \"catch after unconditional catch\")\nMSG_DEF(JSMSG_CATCH_WITHOUT_TRY,      119, 0, JSEXN_SYNTAXERR, \"catch without try\")\nMSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,    120, 0, JSEXN_SYNTAXERR, \"finally without try\")\nMSG_DEF(JSMSG_LABEL_NOT_FOUND,        121, 0, JSEXN_SYNTAXERR, \"label not found\")\nMSG_DEF(JSMSG_TOUGH_BREAK,            122, 0, JSEXN_SYNTAXERR, \"unlabeled break must be inside loop or switch\")\nMSG_DEF(JSMSG_BAD_CONTINUE,           123, 0, JSEXN_SYNTAXERR, \"continue must be inside loop\")\nMSG_DEF(JSMSG_BAD_RETURN_OR_YIELD,    124, 1, JSEXN_SYNTAXERR, \"{0} not in function\")\nMSG_DEF(JSMSG_BAD_LABEL,              125, 0, JSEXN_SYNTAXERR, \"invalid label\")\nMSG_DEF(JSMSG_DUPLICATE_LABEL,        126, 0, JSEXN_SYNTAXERR, \"duplicate label\")\nMSG_DEF(JSMSG_VAR_HIDES_ARG,          127, 1, JSEXN_TYPEERR, \"variable {0} redeclares argument\")\nMSG_DEF(JSMSG_BAD_VAR_INIT,           128, 0, JSEXN_SYNTAXERR, \"invalid variable initialization\")\nMSG_DEF(JSMSG_BAD_LEFTSIDE_OF_ASS,    129, 0, JSEXN_REFERENCEERR, \"invalid assignment left-hand side\")\nMSG_DEF(JSMSG_BAD_OPERAND,            130, 1, JSEXN_SYNTAXERR, \"invalid {0} operand\")\nMSG_DEF(JSMSG_BAD_PROP_ID,            131, 0, JSEXN_SYNTAXERR, \"invalid property id\")\nMSG_DEF(JSMSG_RESERVED_ID,            132, 1, JSEXN_SYNTAXERR, \"{0} is a reserved identifier\")\nMSG_DEF(JSMSG_SYNTAX_ERROR,           133, 0, JSEXN_SYNTAXERR, \"syntax error\")\nMSG_DEF(JSMSG_MISSING_BINARY_DIGITS,  134, 0, JSEXN_SYNTAXERR, \"missing binary digits after '0b'\")\nMSG_DEF(JSMSG_BAD_PROTOTYPE,          135, 1, JSEXN_TYPEERR,   \"'prototype' property of {0} is not an object\")\nMSG_DEF(JSMSG_MISSING_EXPONENT,       136, 0, JSEXN_SYNTAXERR, \"missing exponent\")\nMSG_DEF(JSMSG_OUT_OF_MEMORY,          137, 0, JSEXN_ERR, \"out of memory\")\nMSG_DEF(JSMSG_UNTERMINATED_STRING,    138, 0, JSEXN_SYNTAXERR, \"unterminated string literal\")\nMSG_DEF(JSMSG_TOO_MANY_PARENS,        139, 0, JSEXN_INTERNALERR, \"too many parentheses in regular expression\")\nMSG_DEF(JSMSG_UNTERMINATED_COMMENT,   140, 0, JSEXN_SYNTAXERR, \"unterminated comment\")\nMSG_DEF(JSMSG_UNTERMINATED_REGEXP,    141, 0, JSEXN_SYNTAXERR, \"unterminated regular expression literal\")\nMSG_DEF(JSMSG_BAD_CLONE_FUNOBJ_SCOPE, 142, 0, JSEXN_TYPEERR, \"bad cloned function scope chain\")\nMSG_DEF(JSMSG_MISSING_OCTAL_DIGITS,   143, 0, JSEXN_SYNTAXERR, \"missing octal digits after '0o'\")\nMSG_DEF(JSMSG_ILLEGAL_CHARACTER,      144, 0, JSEXN_SYNTAXERR, \"illegal character\")\nMSG_DEF(JSMSG_BAD_OCTAL,              145, 1, JSEXN_SYNTAXERR, \"{0} is not a legal ECMA-262 octal constant\")\nMSG_DEF(JSMSG_RESULTING_STRING_TOO_LARGE, 146, 0, JSEXN_RANGEERR, \"repeat count must be less than infinity and not overflow maximum string size\")\nMSG_DEF(JSMSG_UNCAUGHT_EXCEPTION,     147, 1, JSEXN_INTERNALERR, \"uncaught exception: {0}\")\nMSG_DEF(JSMSG_INVALID_BACKREF,        148, 0, JSEXN_SYNTAXERR, \"non-octal digit in an escape sequence that doesn't match a back-reference\")\nMSG_DEF(JSMSG_BAD_BACKREF,            149, 0, JSEXN_SYNTAXERR, \"back-reference exceeds number of capturing parentheses\")\nMSG_DEF(JSMSG_PRECISION_RANGE,        150, 1, JSEXN_RANGEERR, \"precision {0} out of range\")\nMSG_DEF(JSMSG_BAD_GETTER_OR_SETTER,   151, 1, JSEXN_TYPEERR, \"invalid {0} usage\")\nMSG_DEF(JSMSG_BAD_ARRAY_LENGTH,       152, 0, JSEXN_RANGEERR, \"invalid array length\")\nMSG_DEF(JSMSG_CANT_DESCRIBE_PROPS,    153, 1, JSEXN_TYPEERR, \"can't describe non-native properties of class {0}\")\nMSG_DEF(JSMSG_BAD_APPLY_ARGS,         154, 1, JSEXN_TYPEERR, \"second argument to Function.prototype.{0} must be an array\")\nMSG_DEF(JSMSG_REDECLARED_VAR,         155, 2, JSEXN_TYPEERR, \"redeclaration of {0} {1}\")\nMSG_DEF(JSMSG_UNDECLARED_VAR,         156, 1, JSEXN_REFERENCEERR, \"assignment to undeclared variable {0}\")\nMSG_DEF(JSMSG_ANON_NO_RETURN_VALUE,   157, 0, JSEXN_TYPEERR, \"anonymous function does not always return a value\")\nMSG_DEF(JSMSG_DEPRECATED_USAGE,       158, 1, JSEXN_REFERENCEERR, \"deprecated {0} usage\")\nMSG_DEF(JSMSG_BAD_URI,                159, 0, JSEXN_URIERR, \"malformed URI sequence\")\nMSG_DEF(JSMSG_GETTER_ONLY,            160, 0, JSEXN_TYPEERR, \"setting a property that has only a getter\")\nMSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,   161, 0, JSEXN_SYNTAXERR, \"identifier starts immediately after numeric literal\")\nMSG_DEF(JSMSG_UNDEFINED_PROP,         162, 1, JSEXN_REFERENCEERR, \"reference to undefined property {0}\")\nMSG_DEF(JSMSG_USELESS_EXPR,           163, 0, JSEXN_TYPEERR, \"useless expression\")\nMSG_DEF(JSMSG_REDECLARED_PARAM,       164, 1, JSEXN_TYPEERR, \"redeclaration of formal parameter {0}\")\nMSG_DEF(JSMSG_NEWREGEXP_FLAGGED,      165, 0, JSEXN_TYPEERR, \"can't supply flags when constructing one RegExp from another\")\nMSG_DEF(JSMSG_RESERVED_SLOT_RANGE,    166, 0, JSEXN_RANGEERR, \"reserved slot index out of range\")\nMSG_DEF(JSMSG_CANT_DECODE_PRINCIPALS, 167, 0, JSEXN_INTERNALERR, \"can't decode JSPrincipals\")\nMSG_DEF(JSMSG_CANT_SEAL_OBJECT,       168, 1, JSEXN_ERR, \"can't seal {0} objects\")\nMSG_DEF(JSMSG_TOO_MANY_CATCH_VARS,    169, 0, JSEXN_SYNTAXERR, \"too many catch variables\")\nMSG_DEF(JSMSG_NEGATIVE_REPETITION_COUNT, 170, 0, JSEXN_RANGEERR, \"repeat count must be non-negative\")\nMSG_DEF(JSMSG_UNUSED171,              171, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED172,              172, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED173,              173, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED174,              174, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_NESTING_GENERATOR,      175, 0, JSEXN_TYPEERR, \"already executing generator\")\nMSG_DEF(JSMSG_UNUSED176,              176, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED177,              177, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED178,              178, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED179,              179, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED180,              180, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED181,              181, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SEND,     182, 1, JSEXN_TYPEERR, \"attempt to send {0} to newborn generator\")\nMSG_DEF(JSMSG_UNUSED183,              183, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED184,              184, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE, 185, 0, JSEXN_TYPEERR, \"proxy can't report an extensible object as non-extensible\")\nMSG_DEF(JSMSG_UNUSED186,              186, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED187,              187, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INCOMPATIBLE_METHOD,    188, 3, JSEXN_TYPEERR, \"{0} {1} called on incompatible {2}\")\nMSG_DEF(JSMSG_UNUSED189,              189, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED190,              190, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED191,              191, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED192,              192, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_FOR_EACH_LOOP,      193, 0, JSEXN_SYNTAXERR, \"invalid for each loop\")\nMSG_DEF(JSMSG_UNUSED194,              194, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED195,              195, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_UNUSED196,              196, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_INTERNAL_INTL_ERROR,    197, 0, JSEXN_ERR, \"internal error while computing Intl data\")\nMSG_DEF(JSMSG_DEFAULT_LOCALE_ERROR,   198, 0, JSEXN_ERR, \"internal error getting the default locale\")\nMSG_DEF(JSMSG_TOO_MANY_LOCALS,        199, 0, JSEXN_SYNTAXERR, \"too many local variables\")\nMSG_DEF(JSMSG_ARRAY_INIT_TOO_BIG,     200, 0, JSEXN_INTERNALERR, \"array initialiser too large\")\nMSG_DEF(JSMSG_REGEXP_TOO_COMPLEX,     201, 0, JSEXN_INTERNALERR, \"regular expression too complex\")\nMSG_DEF(JSMSG_BUFFER_TOO_SMALL,       202, 0, JSEXN_INTERNALERR, \"buffer too small\")\nMSG_DEF(JSMSG_BAD_SURROGATE_CHAR,     203, 1, JSEXN_TYPEERR, \"bad surrogate character {0}\")\nMSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE,    204, 1, JSEXN_TYPEERR, \"UTF-8 character {0} too large\")\nMSG_DEF(JSMSG_MALFORMED_UTF8_CHAR,    205, 1, JSEXN_TYPEERR, \"malformed UTF-8 character sequence at offset {0}\")\nMSG_DEF(JSMSG_USER_DEFINED_ERROR,     206, 0, JSEXN_ERR, \"JS_ReportError was called\")\nMSG_DEF(JSMSG_WRONG_CONSTRUCTOR,      207, 1, JSEXN_TYPEERR, \"wrong constructor called for {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_RETURN,   208, 1, JSEXN_TYPEERR, \"generator function {0} returns a value\")\nMSG_DEF(JSMSG_BAD_ANON_GENERATOR_RETURN, 209, 0, JSEXN_TYPEERR, \"anonymous generator function returns a value\")\nMSG_DEF(JSMSG_NAME_AFTER_FOR_PAREN,   210, 0, JSEXN_SYNTAXERR, \"missing name after for (\")\nMSG_DEF(JSMSG_IN_AFTER_FOR_NAME,      211, 0, JSEXN_SYNTAXERR, \"missing 'in' or 'of' after for\")\nMSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE,  212, 2, JSEXN_TYPEERR,\"trap {1} for {0} returned a primitive value\")\nMSG_DEF(JSMSG_UNUSED213,              213, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_GENERATOR_YIELD,    214, 1, JSEXN_TYPEERR, \"yield from closing generator {0}\")\nMSG_DEF(JSMSG_BAD_GENERATOR_SYNTAX,   215, 1, JSEXN_SYNTAXERR, \"{0} expression must be parenthesized\")\nMSG_DEF(JSMSG_ARRAY_COMP_LEFTSIDE,    216, 0, JSEXN_SYNTAXERR, \"invalid array comprehension left-hand side\")\nMSG_DEF(JSMSG_UNUSED217,              217, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE,     218, 0, JSEXN_TYPEERR, \"reduce of empty array with no initial value\")\nMSG_DEF(JSMSG_UNUSED219,              219, 0, JSEXN_NONE, \"\")\nMSG_DEF(JSMSG_BAD_DELETE_OPERAND,     220, 0, JSEXN_REFERENCEERR, \"invalid delete operand\")\nMSG_DEF(JSMSG_BAD_INCOP_OPERAND,      221, 0, JSEXN_REFERENCEERR, \"invalid increment/decrement operand\")\nMSG_DEF(JSMSG_UNEXPECTED_TYPE,        222, 2, JSEXN_TYPEERR, \"{0} is {1}\")\nMSG_DEF(JSMSG_LET_DECL_NOT_IN_BLOCK,  223, 0, JSEXN_SYNTAXERR, \"let declaration not directly within block\")\nMSG_DEF(JSMSG_BAD_OBJECT_INIT,        224, 0, JSEXN_SYNTAXERR, \"invalid object initializer\")\nMSG_DEF(JSMSG_CANT_SET_ARRAY_ATTRS,   225, 0, JSEXN_INTERNALERR, \"can't set attributes on indexed array properties\")\nMSG_DEF(JSMSG_EVAL_ARITY,             226, 0, JSEXN_TYPEERR, \"eval accepts only one parameter\")\nMSG_DEF(JSMSG_MISSING_FUN_ARG,        227, 2, JSEXN_TYPEERR, \"missing argument {0} when calling function {1}\")\nMSG_DEF(JSMSG_JSON_BAD_PARSE,         228, 1, JSEXN_SYNTAXERR, \"JSON.parse: {0}\")\nMSG_DEF(JSMSG_JSON_BAD_STRINGIFY,     229, 0, JSEXN_ERR, \"JSON.stringify\")\nMSG_DEF(JSMSG_NOT_CALLABLE_OR_UNDEFINED, 230, 0, JSEXN_TYPEERR, \"value is not a function or undefined\")\nMSG_DEF(JSMSG_NOT_NONNULL_OBJECT,     231, 0, JSEXN_TYPEERR, \"value is not a non-null object\")\nMSG_DEF(JSMSG_DEPRECATED_OCTAL,       232, 0, JSEXN_SYNTAXERR, \"octal literals and octal escape sequences are deprecated\")\nMSG_DEF(JSMSG_STRICT_CODE_WITH,       233, 0, JSEXN_SYNTAXERR, \"strict mode code may not contain 'with' statements\")\nMSG_DEF(JSMSG_DUPLICATE_PROPERTY,     234, 1, JSEXN_SYNTAXERR, \"property name {0} appears more than once in object literal\")\nMSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 235, 0, JSEXN_SYNTAXERR, \"applying the 'delete' operator to an unqualified name is deprecated\")\nMSG_DEF(JSMSG_BAD_STRICT_ASSIGN,      236, 1, JSEXN_SYNTAXERR, \"can't assign to {0} in strict mode\")\nMSG_DEF(JSMSG_BAD_BINDING,            237, 1, JSEXN_SYNTAXERR, \"redefining {0} is deprecated\")\nMSG_DEF(JSMSG_INVALID_DESCRIPTOR,     238, 0, JSEXN_TYPEERR, \"property descriptors must not specify a value or be writable when a getter or setter has been specified\")\nMSG_DEF(JSMSG_OBJECT_NOT_EXTENSIBLE,  239, 1, JSEXN_TYPEERR, \"{0} is not extensible\")\nMSG_DEF(JSMSG_CANT_REDEFINE_PROP,     240, 1, JSEXN_TYPEERR, \"can't redefine non-configurable property '{0}'\")\nMSG_DEF(JSMSG_CANT_APPEND_TO_ARRAY,   241, 0, JSEXN_TYPEERR, \"can't add elements past the end of an array if its length property is unwritable\")\nMSG_DEF(JSMSG_CANT_REDEFINE_ARRAY_LENGTH,242, 0, JSEXN_TYPEERR, \"can't redefine array length\")\nMSG_DEF(JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH,243, 0, JSEXN_TYPEERR, \"can't define array index property past the end of an array with non-writable length\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_INDEX,  244, 0, JSEXN_ERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_TYPED_ARRAY_NEGATIVE_ARG, 245, 1, JSEXN_ERR, \"argument {0} must be >= 0\")\nMSG_DEF(JSMSG_TYPED_ARRAY_BAD_ARGS,   246, 0, JSEXN_ERR, \"invalid arguments\")\nMSG_DEF(JSMSG_CSP_BLOCKED_FUNCTION,   247, 0, JSEXN_ERR, \"call to Function() blocked by CSP\")\nMSG_DEF(JSMSG_BAD_GET_SET_FIELD,      248, 1, JSEXN_TYPEERR, \"property descriptor's {0} field is neither undefined nor a function\")\nMSG_DEF(JSMSG_BAD_PROXY_FIX,          249, 0, JSEXN_TYPEERR, \"proxy was fixed while executing the handler\")\nMSG_DEF(JSMSG_INVALID_EVAL_SCOPE_ARG, 250, 0, JSEXN_EVALERR, \"invalid eval scope argument\")\nMSG_DEF(JSMSG_ACCESSOR_WRONG_ARGS,    251, 3, JSEXN_SYNTAXERR, \"{0} functions must have {1} argument{2}\")\nMSG_DEF(JSMSG_THROW_TYPE_ERROR,       252, 0, JSEXN_TYPEERR, \"'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them\")\nMSG_DEF(JSMSG_BAD_TOISOSTRING_PROP,   253, 0, JSEXN_TYPEERR, \"toISOString property is not callable\")\nMSG_DEF(JSMSG_BAD_PARSE_NODE,         254, 0, JSEXN_INTERNALERR, \"bad parse node\")\nMSG_DEF(JSMSG_NOT_EXPECTED_TYPE,      255, 3, JSEXN_TYPEERR, \"{0}: expected {1}, got {2}\")\nMSG_DEF(JSMSG_CALLER_IS_STRICT,       256, 0, JSEXN_TYPEERR, \"access to strict mode caller function is censored\")\nMSG_DEF(JSMSG_NEED_DEBUG_MODE,        257, 0, JSEXN_ERR, \"function can be called only in debug mode\")\nMSG_DEF(JSMSG_STRICT_CODE_LET_EXPR_STMT, 258, 0, JSEXN_ERR, \"strict mode code may not contain unparenthesized let expression statements\")\nMSG_DEF(JSMSG_CANT_CHANGE_EXTENSIBILITY, 259, 0, JSEXN_TYPEERR, \"can't change object's extensibility\")\nMSG_DEF(JSMSG_SC_BAD_SERIALIZED_DATA, 260, 1, JSEXN_INTERNALERR, \"bad serialized structured data ({0})\")\nMSG_DEF(JSMSG_SC_UNSUPPORTED_TYPE,    261, 0, JSEXN_TYPEERR, \"unsupported type for structured data\")\nMSG_DEF(JSMSG_SC_RECURSION,           262, 0, JSEXN_INTERNALERR, \"recursive object\")\nMSG_DEF(JSMSG_DEBUG_CANT_DEBUG_GLOBAL, 263, 0, JSEXN_ERR, \"passing non-debuggable global to addDebuggee\")\nMSG_DEF(JSMSG_BAD_CLONE_VERSION,      264, 0, JSEXN_ERR, \"unsupported structured clone version\")\nMSG_DEF(JSMSG_CANT_CLONE_OBJECT,      265, 0, JSEXN_TYPEERR, \"can't clone object\")\nMSG_DEF(JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED, 266, 0, JSEXN_TYPEERR, \"resumption values are disallowed in this hook\")\nMSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, \"in strict mode code, functions may be declared only at top level or immediately within another function\")\nMSG_DEF(JSMSG_INVALID_FOR_IN_INIT,    268, 0, JSEXN_SYNTAXERR, \"for-in loop let declaration may not have an initializer\")\nMSG_DEF(JSMSG_CLEARED_SCOPE,          269, 0, JSEXN_TYPEERR, \"attempt to run compile-and-go script on a cleared scope\")\nMSG_DEF(JSMSG_MALFORMED_ESCAPE,       270, 1, JSEXN_SYNTAXERR, \"malformed {0} character escape sequence\")\nMSG_DEF(JSMSG_BAD_GENEXP_BODY,        271, 1, JSEXN_SYNTAXERR, \"illegal use of {0} in generator expression\")\nMSG_DEF(JSMSG_YIELD_WITHOUT_OPERAND,  272, 0, JSEXN_SYNTAXERR, \"yield without a value is deprecated, and illegal in ES6 (use 'yield undefined' instead)\")\nMSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT,  273, 0, JSEXN_SYNTAXERR, \"function statement requires a name\")\nMSG_DEF(JSMSG_CCW_REQUIRED,           274, 1, JSEXN_TYPEERR, \"{0}: argument must be an object from a different compartment\")\nMSG_DEF(JSMSG_DEBUG_BAD_RESUMPTION,   275, 0, JSEXN_TYPEERR, \"debugger resumption value must be undefined, {throw: val}, {return: val}, or null\")\nMSG_DEF(JSMSG_ASSIGN_FUNCTION_OR_NULL, 276, 1, JSEXN_TYPEERR, \"value assigned to {0} must be a function or null\")\nMSG_DEF(JSMSG_DEBUG_NOT_LIVE,         277, 1, JSEXN_ERR, \"{0} is not live\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_WRONG_OWNER, 278, 0, JSEXN_TYPEERR, \"Debugger.Object belongs to a different Debugger\")\nMSG_DEF(JSMSG_DEBUG_OBJECT_PROTO,     279, 0, JSEXN_TYPEERR, \"Debugger.Object.prototype is not a valid Debugger.Object\")\nMSG_DEF(JSMSG_DEBUG_LOOP,             280, 0, JSEXN_TYPEERR, \"cannot debug an object in same compartment as debugger or a compartment that is already debugging the debugger\")\nMSG_DEF(JSMSG_DEBUG_NOT_IDLE,         281, 0, JSEXN_ERR, \"can't start debugging: a debuggee script is on the stack\")\nMSG_DEF(JSMSG_DEBUG_BAD_OFFSET,       282, 0, JSEXN_TYPEERR, \"invalid script offset\")\nMSG_DEF(JSMSG_DEBUG_BAD_LINE,         283, 0, JSEXN_TYPEERR, \"invalid line number\")\nMSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING,    284, 0, JSEXN_ERR, \"can't set breakpoint: script global is not a debuggee\")\nMSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, \"{0}: descriptor .{1} property is an object in a different compartment than the target object\")\nMSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, \"stack frame is not running JavaScript code\")\nMSG_DEF(JSMSG_CANT_WATCH_PROP,        287, 0, JSEXN_TYPEERR, \"properties whose names are objects can't be watched\")\nMSG_DEF(JSMSG_CSP_BLOCKED_EVAL,       288, 0, JSEXN_ERR, \"call to eval() blocked by CSP\")\nMSG_DEF(JSMSG_DEBUG_NO_SCOPE_OBJECT,  289, 0, JSEXN_TYPEERR, \"declarative Environments don't have binding objects\")\nMSG_DEF(JSMSG_EMPTY_CONSEQUENT,       290, 0, JSEXN_SYNTAXERR, \"mistyped ; after conditional?\")\nMSG_DEF(JSMSG_NOT_ITERABLE,           291, 1, JSEXN_TYPEERR, \"{0} is not iterable\")\nMSG_DEF(JSMSG_QUERY_LINE_WITHOUT_URL, 292, 0, JSEXN_TYPEERR, \"findScripts query object has 'line' property, but no 'url' property\")\nMSG_DEF(JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL, 293, 0, JSEXN_TYPEERR, \"findScripts query object has 'innermost' property without both 'url' and 'line' properties\")\nMSG_DEF(JSMSG_DEBUG_VARIABLE_NOT_FOUND, 294, 0, JSEXN_TYPEERR, \"variable not found in environment\")\nMSG_DEF(JSMSG_PARAMETER_AFTER_REST,   295, 0, JSEXN_SYNTAXERR, \"parameter after rest parameter\")\nMSG_DEF(JSMSG_NO_REST_NAME,           296, 0, JSEXN_SYNTAXERR, \"no parameter name after ...\")\nMSG_DEF(JSMSG_ARGUMENTS_AND_REST,     297, 0, JSEXN_SYNTAXERR, \"'arguments' object may not be used in conjunction with a rest parameter\")\nMSG_DEF(JSMSG_FUNCTION_ARGUMENTS_AND_REST, 298, 0, JSEXN_ERR, \"the 'arguments' property of a function with a rest parameter may not be used\")\nMSG_DEF(JSMSG_REST_WITH_DEFAULT,      299, 0, JSEXN_SYNTAXERR, \"rest parameter may not have a default\")\nMSG_DEF(JSMSG_NONDEFAULT_FORMAL_AFTER_DEFAULT, 300, 0, JSEXN_SYNTAXERR, \"parameter(s) with default followed by parameter without default\")\nMSG_DEF(JSMSG_YIELD_IN_DEFAULT,       301, 0, JSEXN_SYNTAXERR, \"yield in default expression\")\nMSG_DEF(JSMSG_INTRINSIC_NOT_DEFINED,  302, 1, JSEXN_REFERENCEERR, \"no intrinsic function {0}\")\nMSG_DEF(JSMSG_ALREADY_HAS_SOURCEMAP,  303, 1, JSEXN_ERR,      \"{0} is being assigned a source map, yet already has one\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_ARG,      304, 1, JSEXN_RANGEERR, \"invalid ParallelArray{0} argument\")\nMSG_DEF(JSMSG_PAR_ARRAY_BAD_PARTITION, 305, 0, JSEXN_ERR, \"argument must be divisible by outermost dimension\")\nMSG_DEF(JSMSG_PAR_ARRAY_REDUCE_EMPTY, 306, 0, JSEXN_ERR, \"cannot reduce ParallelArray object whose outermost dimension is empty\")\nMSG_DEF(JSMSG_PAR_ARRAY_ALREADY_FLAT, 307, 0, JSEXN_ERR, \"cannot flatten 1-dimensional ParallelArray object\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_CONFLICT, 308, 0, JSEXN_ERR, \"no conflict resolution function provided\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BOUNDS, 309, 0, JSEXN_ERR, \"index in scatter vector out of bounds\")\nMSG_DEF(JSMSG_CANT_REPORT_NC_AS_NE,   310, 0, JSEXN_TYPEERR, \"proxy can't report a non-configurable own property as non-existent\")\nMSG_DEF(JSMSG_CANT_REPORT_E_AS_NE,    311, 0, JSEXN_TYPEERR, \"proxy can't report an existing own property as non-existent on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_NEW,        312, 0, JSEXN_TYPEERR, \"proxy can't report a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_REPORT_INVALID,    313, 0, JSEXN_TYPEERR, \"proxy can't report an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_REPORT_NE_AS_NC,   314, 0, JSEXN_TYPEERR, \"proxy can't report a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_CANT_DEFINE_NEW,        315, 0, JSEXN_TYPEERR, \"proxy can't define a new property on a non-extensible object\")\nMSG_DEF(JSMSG_CANT_DEFINE_INVALID,    316, 0, JSEXN_TYPEERR, \"proxy can't define an incompatible property descriptor\")\nMSG_DEF(JSMSG_CANT_DEFINE_NE_AS_NC,   317, 0, JSEXN_TYPEERR, \"proxy can't define a non-existent property as non-configurable\")\nMSG_DEF(JSMSG_INVALID_TRAP_RESULT,    318, 2, JSEXN_TYPEERR, \"trap {1} for {0} returned an invalid result\")\nMSG_DEF(JSMSG_CANT_SKIP_NC,           319, 0, JSEXN_TYPEERR, \"proxy can't skip a non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_SAME_VALUE, 320, 0, JSEXN_TYPEERR, \"proxy must report the same value for a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_MUST_REPORT_UNDEFINED,  321, 0, JSEXN_TYPEERR, \"proxy must report undefined for a non-configurable accessor property without a getter\")\nMSG_DEF(JSMSG_CANT_SET_NW_NC,         322, 0, JSEXN_TYPEERR, \"proxy can't successfully set a non-writable, non-configurable property\")\nMSG_DEF(JSMSG_CANT_SET_WO_SETTER,     323, 0, JSEXN_TYPEERR, \"proxy can't succesfully set an accessor property without a setter\")\nMSG_DEF(JSMSG_DEBUG_BAD_REFERENT,     324, 2, JSEXN_TYPEERR, \"{0} does not refer to {1}\")\nMSG_DEF(JSMSG_DEBUG_WRAPPER_IN_WAY,   325, 2, JSEXN_TYPEERR, \"{0} is a wrapper around {1}, but a direct reference is required\")\nMSG_DEF(JSMSG_UNWRAP_DENIED,          326, 0, JSEXN_ERR, \"permission denied to unwrap object\")\nMSG_DEF(JSMSG_INTL_OBJECT_NOT_INITED, 327, 3, JSEXN_TYPEERR, \"Intl.{0}.prototype.{1} called on value that's not an object initialized as a {2}\")\nMSG_DEF(JSMSG_INVALID_LOCALES_ELEMENT,328, 0, JSEXN_TYPEERR, \"invalid element in locales argument\")\nMSG_DEF(JSMSG_INVALID_LANGUAGE_TAG,   329, 1, JSEXN_RANGEERR, \"invalid language tag: {0}\")\nMSG_DEF(JSMSG_INVALID_LOCALE_MATCHER, 330, 1, JSEXN_RANGEERR, \"invalid locale matcher in supportedLocalesOf(): {0}\")\nMSG_DEF(JSMSG_INVALID_OPTION_VALUE,   331, 2, JSEXN_RANGEERR, \"invalid value {1} for option {0}\")\nMSG_DEF(JSMSG_INVALID_DIGITS_VALUE,   332, 1, JSEXN_RANGEERR, \"invalid digits value: {0}\")\nMSG_DEF(JSMSG_INTL_OBJECT_REINITED,   333, 0, JSEXN_TYPEERR, \"can't initialize object twice as an object of an Intl constructor\")\nMSG_DEF(JSMSG_INVALID_CURRENCY_CODE,  334, 1, JSEXN_RANGEERR, \"invalid currency code in NumberFormat(): {0}\")\nMSG_DEF(JSMSG_UNDEFINED_CURRENCY,     335, 0, JSEXN_TYPEERR, \"undefined currency in NumberFormat() with currency style\")\nMSG_DEF(JSMSG_INVALID_TIME_ZONE,      336, 1, JSEXN_RANGEERR, \"invalid time zone in DateTimeFormat(): {0}\")\nMSG_DEF(JSMSG_DATE_NOT_FINITE,        337, 0, JSEXN_RANGEERR, \"date value is not finite in DateTimeFormat.format()\")\nMSG_DEF(JSMSG_MODULE_STATEMENT,       338, 0, JSEXN_SYNTAXERR, \"module declarations may only appear at the top level of a program or module body\")\nMSG_DEF(JSMSG_CURLY_BEFORE_MODULE,    339, 0, JSEXN_SYNTAXERR, \"missing { before module body\")\nMSG_DEF(JSMSG_CURLY_AFTER_MODULE,     340, 0, JSEXN_SYNTAXERR, \"missing } after module body\")\nMSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 341, 0, JSEXN_SYNTAXERR, \"\\\"use asm\\\" is only meaningful in the Directive Prologue of a function body\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_FAIL,      342, 1, JSEXN_TYPEERR, \"asm.js type error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_LINK_FAIL,      343, 1, JSEXN_TYPEERR, \"asm.js link error: {0}\")\nMSG_DEF(JSMSG_USE_ASM_TYPE_OK,        344, 1, JSEXN_ERR,     \"successfully compiled asm.js code ({0})\")\nMSG_DEF(JSMSG_BAD_ARROW_ARGS,         345, 0, JSEXN_SYNTAXERR, \"invalid arrow-function arguments (parentheses around the arrow-function may help)\")\nMSG_DEF(JSMSG_YIELD_IN_ARROW,         346, 0, JSEXN_SYNTAXERR, \"arrow function may not contain yield\")\nMSG_DEF(JSMSG_WRONG_VALUE,            347, 2, JSEXN_ERR, \"expected {0} but found {1}\")\nMSG_DEF(JSMSG_PAR_ARRAY_SCATTER_BAD_TARGET, 348, 1, JSEXN_ERR, \"target for index {0} is not an integer\")\nMSG_DEF(JSMSG_SELFHOSTED_UNBOUND_NAME,349, 0, JSEXN_TYPEERR, \"self-hosted code may not contain unbound name lookups\")\nMSG_DEF(JSMSG_DEPRECATED_SOURCE_MAP,  350, 0, JSEXN_SYNTAXERR, \"Using //@ to indicate source map URL pragmas is deprecated. Use //# instead\")\nMSG_DEF(JSMSG_BAD_DESTRUCT_ASSIGN,    351, 1, JSEXN_SYNTAXERR, \"can't assign to {0} using destructuring assignment\")\nMSG_DEF(JSMSG_BINARYDATA_ARRAYTYPE_BAD_ARGS, 352, 0, JSEXN_ERR, \"Invalid arguments\")\nMSG_DEF(JSMSG_BINARYDATA_BINARYARRAY_BAD_INDEX, 353, 0, JSEXN_RANGEERR, \"invalid or out-of-range index\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_ARGS, 354, 0, JSEXN_RANGEERR, \"invalid field descriptor\")\nMSG_DEF(JSMSG_BINARYDATA_NOT_BINARYSTRUCT,   355, 1, JSEXN_TYPEERR, \"{0} is not a BinaryStruct\")\nMSG_DEF(JSMSG_BINARYDATA_SUBARRAY_INTEGER_ARG, 356, 1, JSEXN_ERR, \"argument {0} must be an integer\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_EMPTY_DESCRIPTOR, 357, 0, JSEXN_ERR, \"field descriptor cannot be empty\")\nMSG_DEF(JSMSG_BINARYDATA_STRUCTTYPE_BAD_FIELD, 358, 1, JSEXN_ERR, \"field {0} is not a valid BinaryData Type descriptor\")\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsalloc.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JS allocation policies. */\n\n#ifndef jsalloc_h\n#define jsalloc_h\n\n#include \"mozilla/AllocPolicy.h\"\n\n#include \"js/Utility.h\"\n\nstruct JSContext;\n\nnamespace js {\n\nclass ContextFriendFields;\n\n/* Policy for using system memory functions and doing no error reporting. */\nclass SystemAllocPolicy\n{\n  public:\n    void *malloc_(size_t bytes) { return js_malloc(bytes); }\n    void *calloc_(size_t bytes) { return js_calloc(bytes); }\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) { return js_realloc(p, bytes); }\n    void free_(void *p) { js_free(p); }\n    void reportAllocOverflow() const {}\n};\n\n/*\n * Allocation policy that calls the system memory functions and reports errors\n * to the context. Since the JSContext given on construction is stored for\n * the lifetime of the container, this policy may only be used for containers\n * whose lifetime is a shorter than the given JSContext.\n *\n * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,\n * not the system ones.\n */\nclass TempAllocPolicy\n{\n    ContextFriendFields *const cx_;\n\n    /*\n     * Non-inline helper to call JSRuntime::onOutOfMemory with minimal\n     * code bloat.\n     */\n    JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);\n\n  public:\n    TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(\n    TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}\n\n    void *malloc_(size_t bytes) {\n        void *p = js_malloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *calloc_(size_t bytes) {\n        void *p = js_calloc(bytes);\n        if (JS_UNLIKELY(!p))\n            p = onOutOfMemory(NULL, bytes);\n        return p;\n    }\n\n    void *realloc_(void *p, size_t oldBytes, size_t bytes) {\n        void *p2 = js_realloc(p, bytes);\n        if (JS_UNLIKELY(!p2))\n            p2 = onOutOfMemory(p2, bytes);\n        return p2;\n    }\n\n    void free_(void *p) {\n        js_free(p);\n    }\n\n    JS_FRIEND_API(void) reportAllocOverflow() const;\n};\n\n} /* namespace js */\n\n#endif /* jsalloc_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* JavaScript API. */\n\n#ifndef jsapi_h\n#define jsapi_h\n\n#include \"mozilla/FloatingPoint.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/RangedPtr.h\"\n#include \"mozilla/ThreadLocal.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n\n#include \"js-config.h\"\n#include \"jsalloc.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n#include \"js/CharacterEncoding.h\"\n#include \"js/HashTable.h\"\n#include \"js/RootingAPI.h\"\n#include \"js/Utility.h\"\n#include \"js/Value.h\"\n#include \"js/Vector.h\"\n\n/************************************************************************/\n\nnamespace JS {\n\ntypedef mozilla::RangedPtr<const jschar> CharPtr;\n\nclass StableCharPtr : public CharPtr {\n  public:\n    StableCharPtr(const StableCharPtr &s) : CharPtr(s) {}\n    StableCharPtr(const mozilla::RangedPtr<const jschar> &s) : CharPtr(s) {}\n    StableCharPtr(const jschar *s, size_t len) : CharPtr(s, len) {}\n    StableCharPtr(const jschar *pos, const jschar *start, size_t len)\n      : CharPtr(pos, start, len)\n    {}\n};\n\n#if defined JS_THREADSAFE && defined DEBUG\n\nclass JS_PUBLIC_API(AutoCheckRequestDepth)\n{\n    JSContext *cx;\n  public:\n    AutoCheckRequestDepth(JSContext *cx);\n    AutoCheckRequestDepth(js::ContextFriendFields *cx);\n    ~AutoCheckRequestDepth();\n};\n\n# define CHECK_REQUEST(cx) \\\n    JS::AutoCheckRequestDepth _autoCheckRequestDepth(cx)\n\n#else\n\n# define CHECK_REQUEST(cx) \\\n    ((void) 0)\n\n#endif /* JS_THREADSAFE && DEBUG */\n\n#ifdef DEBUG\n/*\n * Assert that we're not doing GC on cx, that we're in a request as\n * needed, and that the compartments for cx and v are correct.\n * Also check that GC would be safe at this point.\n */\nJS_PUBLIC_API(void)\nAssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v);\n#else\ninline void AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v) {\n    /* Do nothing */\n}\n#endif /* DEBUG */\n\nclass JS_PUBLIC_API(AutoGCRooter) {\n  public:\n    AutoGCRooter(JSContext *cx, ptrdiff_t tag);\n    AutoGCRooter(js::ContextFriendFields *cx, ptrdiff_t tag);\n\n    ~AutoGCRooter() {\n        JS_ASSERT(this == *stackTop);\n        *stackTop = down;\n    }\n\n    /* Implemented in gc/RootMarking.cpp. */\n    inline void trace(JSTracer *trc);\n    static void traceAll(JSTracer *trc);\n    static void traceAllWrappers(JSTracer *trc);\n\n  protected:\n    AutoGCRooter * const down;\n\n    /*\n     * Discriminates actual subclass of this being used.  If non-negative, the\n     * subclass roots an array of values of the length stored in this field.\n     * If negative, meaning is indicated by the corresponding value in the enum\n     * below.  Any other negative value indicates some deeper problem such as\n     * memory corruption.\n     */\n    ptrdiff_t tag_;\n\n    enum {\n        VALARRAY =     -2, /* js::AutoValueArray */\n        PARSER =       -3, /* js::frontend::Parser */\n        SHAPEVECTOR =  -4, /* js::AutoShapeVector */\n        IDARRAY =      -6, /* js::AutoIdArray */\n        DESCRIPTORS =  -7, /* js::AutoPropDescArrayRooter */\n        ID =           -9, /* js::AutoIdRooter */\n        VALVECTOR =   -10, /* js::AutoValueVector */\n        DESCRIPTOR =  -11, /* js::AutoPropertyDescriptorRooter */\n        STRING =      -12, /* js::AutoStringRooter */\n        IDVECTOR =    -13, /* js::AutoIdVector */\n        OBJVECTOR =   -14, /* js::AutoObjectVector */\n        STRINGVECTOR =-15, /* js::AutoStringVector */\n        SCRIPTVECTOR =-16, /* js::AutoScriptVector */\n        NAMEVECTOR =  -17, /* js::AutoNameVector */\n        HASHABLEVALUE=-18, /* js::HashableValue */\n        IONMASM =     -19, /* js::jit::MacroAssembler */\n        IONALLOC =    -20, /* js::jit::AutoTempAllocatorRooter */\n        WRAPVECTOR =  -21, /* js::AutoWrapperVector */\n        WRAPPER =     -22, /* js::AutoWrapperRooter */\n        OBJOBJHASHMAP=-23, /* js::AutoObjectObjectHashMap */\n        OBJU32HASHMAP=-24, /* js::AutoObjectUnsigned32HashMap */\n        OBJHASHSET =  -25, /* js::AutoObjectHashSet */\n        JSONPARSER =  -26, /* js::JSONParser */\n        CUSTOM =      -27, /* js::CustomAutoRooter */\n        FUNVECTOR =   -28  /* js::AutoFunctionVector */\n    };\n\n  private:\n    AutoGCRooter ** const stackTop;\n\n    /* No copy or assignment semantics. */\n    AutoGCRooter(AutoGCRooter &ida) MOZ_DELETE;\n    void operator=(AutoGCRooter &ida) MOZ_DELETE;\n};\n\nclass AutoStringRooter : private AutoGCRooter {\n  public:\n    AutoStringRooter(JSContext *cx, JSString *str = NULL\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, STRING), str_(str)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    void setString(JSString *str) {\n        str_ = str;\n    }\n\n    JSString * string() const {\n        return str_;\n    }\n\n    JSString ** addr() {\n        return &str_;\n    }\n\n    JSString * const * addr() const {\n        return &str_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    JSString *str_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoArrayRooter : private AutoGCRooter {\n  public:\n    AutoArrayRooter(JSContext *cx, size_t len, Value *vec\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, len), array(vec), skip(cx, array, len)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeLength(size_t newLength) {\n        tag_ = ptrdiff_t(newLength);\n        JS_ASSERT(tag_ >= 0);\n    }\n\n    void changeArray(Value *newArray, size_t newLength) {\n        changeLength(newLength);\n        array = newArray;\n    }\n\n    Value *array;\n\n    MutableHandleValue handleAt(size_t i)\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return MutableHandleValue::fromMarkedLocation(&array[i]);\n    }\n    HandleValue handleAt(size_t i) const\n    {\n        JS_ASSERT(i < size_t(tag_));\n        return HandleValue::fromMarkedLocation(&array[i]);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    js::SkipRoot skip;\n};\n\ntemplate<class T>\nclass AutoVectorRooter : protected AutoGCRooter\n{\n  public:\n    explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoVectorRooter(js::ContextFriendFields *cx, ptrdiff_t tag\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), vector(cx), vectorRoot(cx, &vector)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef T ElementType;\n\n    size_t length() const { return vector.length(); }\n    bool empty() const { return vector.empty(); }\n\n    bool append(const T &v) { return vector.append(v); }\n    bool appendAll(const AutoVectorRooter<T> &other) {\n        return vector.appendAll(other.vector);\n    }\n\n    bool insert(T *p, const T &val) { return vector.insert(p, val); }\n\n    /* For use when space has already been reserved. */\n    void infallibleAppend(const T &v) { vector.infallibleAppend(v); }\n\n    void popBack() { vector.popBack(); }\n    T popCopy() { return vector.popCopy(); }\n\n    bool growBy(size_t inc) {\n        size_t oldLength = vector.length();\n        if (!vector.growByUninitialized(inc))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    bool resize(size_t newLength) {\n        size_t oldLength = vector.length();\n        if (newLength <= oldLength) {\n            vector.shrinkBy(oldLength - newLength);\n            return true;\n        }\n        if (!vector.growByUninitialized(newLength - oldLength))\n            return false;\n        makeRangeGCSafe(oldLength);\n        return true;\n    }\n\n    void clear() { vector.clear(); }\n\n    bool reserve(size_t newLength) {\n        return vector.reserve(newLength);\n    }\n\n    T &operator[](size_t i) { return vector[i]; }\n    const T &operator[](size_t i) const { return vector[i]; }\n\n    JS::MutableHandle<T> handleAt(size_t i) { return JS::MutableHandle<T>::fromMarkedLocation(&vector[i]); }\n    JS::Handle<T> handleAt(size_t i) const { return JS::Handle<T>::fromMarkedLocation(&vector[i]); }\n\n    const T *begin() const { return vector.begin(); }\n    T *begin() { return vector.begin(); }\n\n    const T *end() const { return vector.end(); }\n    T *end() { return vector.end(); }\n\n    const T &back() const { return vector.back(); }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    void makeRangeGCSafe(size_t oldLength) {\n        T *t = vector.begin() + oldLength;\n        for (size_t i = oldLength; i < vector.length(); ++i, ++t)\n            memset(t, 0, sizeof(T));\n    }\n\n    typedef js::Vector<T, 8> VectorImpl;\n    VectorImpl vector;\n\n    /* Prevent overwriting of inline elements in vector. */\n    js::SkipRoot vectorRoot;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class Key, class Value>\nclass AutoHashMapRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashMap<Key, Value> HashMapImpl;\n\n  public:\n    explicit AutoHashMapRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), map(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef Key KeyType;\n    typedef Value ValueType;\n    typedef typename HashMapImpl::Lookup Lookup;\n    typedef typename HashMapImpl::Ptr Ptr;\n    typedef typename HashMapImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return map.init(len);\n    }\n    bool initialized() const {\n        return map.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return map.lookup(l);\n    }\n    void remove(Ptr p) {\n        map.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return map.lookupForAdd(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool add(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.add(p, k, v);\n    }\n\n    bool add(AddPtr &p, const Key &k) {\n        return map.add(p, k);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool relookupOrAdd(AddPtr &p, const KeyInput &k, const ValueInput &v) {\n        return map.relookupOrAdd(p, k, v);\n    }\n\n    typedef typename HashMapImpl::Range Range;\n    Range all() const {\n        return map.all();\n    }\n\n    typedef typename HashMapImpl::Enum Enum;\n\n    void clear() {\n        map.clear();\n    }\n\n    void finish() {\n        map.finish();\n    }\n\n    bool empty() const {\n        return map.empty();\n    }\n\n    uint32_t count() const {\n        return map.count();\n    }\n\n    size_t capacity() const {\n        return map.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return map.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return map.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return map.has(l);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool put(const KeyInput &k, const ValueInput &v) {\n        return map.put(k, v);\n    }\n\n    template<typename KeyInput, typename ValueInput>\n    bool putNew(const KeyInput &k, const ValueInput &v) {\n        return map.putNew(k, v);\n    }\n\n    Ptr lookupWithDefault(const Key &k, const Value &defaultValue) {\n        return map.lookupWithDefault(k, defaultValue);\n    }\n\n    void remove(const Lookup &l) {\n        map.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashMapRooter(const AutoHashMapRooter &hmr) MOZ_DELETE;\n    AutoHashMapRooter &operator=(const AutoHashMapRooter &hmr) MOZ_DELETE;\n\n    HashMapImpl map;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\ntemplate<class T>\nclass AutoHashSetRooter : protected AutoGCRooter\n{\n  private:\n    typedef js::HashSet<T> HashSetImpl;\n\n  public:\n    explicit AutoHashSetRooter(JSContext *cx, ptrdiff_t tag\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, tag), set(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    typedef typename HashSetImpl::Lookup Lookup;\n    typedef typename HashSetImpl::Ptr Ptr;\n    typedef typename HashSetImpl::AddPtr AddPtr;\n\n    bool init(uint32_t len = 16) {\n        return set.init(len);\n    }\n    bool initialized() const {\n        return set.initialized();\n    }\n    Ptr lookup(const Lookup &l) const {\n        return set.lookup(l);\n    }\n    void remove(Ptr p) {\n        set.remove(p);\n    }\n    AddPtr lookupForAdd(const Lookup &l) const {\n        return set.lookupForAdd(l);\n    }\n\n    bool add(AddPtr &p, const T &t) {\n        return set.add(p, t);\n    }\n\n    bool relookupOrAdd(AddPtr &p, const Lookup &l, const T &t) {\n        return set.relookupOrAdd(p, l, t);\n    }\n\n    typedef typename HashSetImpl::Range Range;\n    Range all() const {\n        return set.all();\n    }\n\n    typedef typename HashSetImpl::Enum Enum;\n\n    void clear() {\n        set.clear();\n    }\n\n    void finish() {\n        set.finish();\n    }\n\n    bool empty() const {\n        return set.empty();\n    }\n\n    uint32_t count() const {\n        return set.count();\n    }\n\n    size_t capacity() const {\n        return set.capacity();\n    }\n\n    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfExcludingThis(mallocSizeOf);\n    }\n    size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const {\n        return set.sizeOfIncludingThis(mallocSizeOf);\n    }\n\n    unsigned generation() const {\n        return set.generation();\n    }\n\n    /************************************************** Shorthand operations */\n\n    bool has(const Lookup &l) const {\n        return set.has(l);\n    }\n\n    bool put(const T &t) {\n        return set.put(t);\n    }\n\n    bool putNew(const T &t) {\n        return set.putNew(t);\n    }\n\n    void remove(const Lookup &l) {\n        set.remove(l);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    AutoHashSetRooter(const AutoHashSetRooter &hmr) MOZ_DELETE;\n    AutoHashSetRooter &operator=(const AutoHashSetRooter &hmr) MOZ_DELETE;\n\n    HashSetImpl set;\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoValueVector : public AutoVectorRooter<Value>\n{\n  public:\n    explicit AutoValueVector(JSContext *cx\n                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<Value>(cx, VALVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoIdVector : public AutoVectorRooter<jsid>\n{\n  public:\n    explicit AutoIdVector(JSContext *cx\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<jsid>(cx, IDVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoObjectVector : public AutoVectorRooter<JSObject *>\n{\n  public:\n    explicit AutoObjectVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoFunctionVector : public AutoVectorRooter<JSFunction *>\n{\n  public:\n    explicit AutoFunctionVector(JSContext *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    explicit AutoFunctionVector(js::ContextFriendFields *cx\n                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nclass AutoScriptVector : public AutoVectorRooter<JSScript *>\n{\n  public:\n    explicit AutoScriptVector(JSContext *cx\n                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * Cutsom rooting behavior for internal and external clients.\n */\nclass JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter\n{\n  public:\n    template <typename CX>\n    explicit CustomAutoRooter(CX *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, CUSTOM)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  protected:\n    /* Supplied by derived class to trace roots. */\n    virtual void trace(JSTracer *trc) = 0;\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/* Returns true if |v| is considered an acceptable this-value. */\ntypedef bool (*IsAcceptableThis)(const Value &v);\n\n/*\n * Implements the guts of a method; guaranteed to be provided an acceptable\n * this-value, as determined by a corresponding IsAcceptableThis method.\n */\ntypedef bool (*NativeImpl)(JSContext *cx, CallArgs args);\n\nnamespace detail {\n\n/* DON'T CALL THIS DIRECTLY.  It's for use only by CallNonGenericMethod! */\nextern JS_PUBLIC_API(bool)\nCallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n\n} /* namespace detail */\n\n/*\n * Methods usually act upon |this| objects only from a single global object and\n * compartment.  Sometimes, however, a method must act upon |this| values from\n * multiple global objects or compartments.  In such cases the |this| value a\n * method might see will be wrapped, such that various access to the object --\n * to its class, its private data, its reserved slots, and so on -- will not\n * work properly without entering that object's compartment.  This method\n * implements a solution to this problem.\n *\n * To implement a method that accepts |this| values from multiple compartments,\n * define two functions.  The first function matches the IsAcceptableThis type\n * and indicates whether the provided value is an acceptable |this| for the\n * method; it must be a pure function only of its argument.\n *\n *   static JSClass AnswerClass = { ... };\n *\n *   static bool\n *   IsAnswerObject(const Value &v)\n *   {\n *       if (!v.isObject())\n *           return false;\n *       return JS_GetClass(&v.toObject()) == &AnswerClass;\n *   }\n *\n * The second function implements the NativeImpl signature and defines the\n * behavior of the method when it is provided an acceptable |this| value.\n * Aside from some typing niceties -- see the CallArgs interface for details --\n * its interface is the same as that of JSNative.\n *\n *   static bool\n *   answer_getAnswer_impl(JSContext *cx, JS::CallArgs args)\n *   {\n *       args.rval().setInt32(42);\n *       return true;\n *   }\n *\n * The implementation function is guaranteed to be called *only* with a |this|\n * value which is considered acceptable.\n *\n * Now to implement the actual method, write a JSNative that calls the method\n * declared below, passing the appropriate template and runtime arguments.\n *\n *   static JSBool\n *   answer_getAnswer(JSContext *cx, unsigned argc, JS::Value *vp)\n *   {\n *       JS::CallArgs args = JS::CallArgsFromVp(argc, vp);\n *       return JS::CallNonGenericMethod<IsAnswerObject, answer_getAnswer_impl>(cx, args);\n *   }\n *\n * Note that, because they are used as template arguments, the predicate\n * and implementation functions must have external linkage. (This is\n * unfortunate, but GCC wasn't inlining things as one would hope when we\n * passed them as function arguments.)\n *\n * JS::CallNonGenericMethod will test whether |args.thisv()| is acceptable.  If\n * it is, it will call the provided implementation function, which will return\n * a value and indicate success.  If it is not, it will attempt to unwrap\n * |this| and call the implementation function on the unwrapped |this|.  If\n * that succeeds, all well and good.  If it doesn't succeed, a TypeError will\n * be thrown.\n *\n * Note: JS::CallNonGenericMethod will only work correctly if it's called in\n *       tail position in a JSNative.  Do not call it from any other place.\n */\ntemplate<IsAcceptableThis Test, NativeImpl Impl>\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\nJS_ALWAYS_INLINE bool\nCallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args)\n{\n    const Value &thisv = args.thisv();\n    if (Test(thisv))\n        return Impl(cx, args);\n\n    return detail::CallMethodIfWrapped(cx, Test, Impl, args);\n}\n\n}  /* namespace JS */\n\n/************************************************************************/\n\n/* JSClass operation signatures. */\n\n/*\n * Add or get a property named by id in obj.  Note the jsid id type -- id may\n * be a string (Unicode property identifier) or an int (element index).  The\n * *vp out parameter, on success, is the new property value after the action.\n */\ntypedef JSBool\n(* JSPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Set a property named by id in obj, treating the assignment as strict\n * mode code if strict is true. Note the jsid id type -- id may be a string\n * (Unicode property identifier) or an int (element index). The *vp out\n * parameter, on success, is the new property value after the\n * set.\n */\ntypedef JSBool\n(* JSStrictPropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Delete a property named by id in obj.\n *\n * If an error occurred, return false as per normal JSAPI error practice.\n *\n * If no error occurred, but the deletion attempt wasn't allowed (perhaps\n * because the property was non-configurable), set *succeeded to false and\n * return true.  This will cause |delete obj[id]| to evaluate to false in\n * non-strict mode code, and to throw a TypeError in strict mode code.\n *\n * If no error occurred and the deletion wasn't disallowed (this is *not* the\n * same as saying that a deletion actually occurred -- deleting a non-existent\n * property, or an inherited property, is allowed -- it's just pointless),\n * set *succeeded to true and return true.\n */\ntypedef JSBool\n(* JSDeletePropertyOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool *succeeded);\n\n/*\n * This function type is used for callbacks that enumerate the properties of\n * a JSObject.  The behavior depends on the value of enum_op:\n *\n *  JSENUMERATE_INIT\n *    A new, opaque iterator state should be allocated and stored in *statep.\n *    (You can use PRIVATE_TO_JSVAL() to tag the pointer to be stored).\n *\n *    The number of properties that will be enumerated should be returned as\n *    an integer jsval in *idp, if idp is non-null, and provided the number of\n *    enumerable properties is known.  If idp is non-null and the number of\n *    enumerable properties can't be computed in advance, *idp should be set\n *    to JSVAL_ZERO.\n *\n *  JSENUMERATE_INIT_ALL\n *    Used identically to JSENUMERATE_INIT, but exposes all properties of the\n *    object regardless of enumerability.\n *\n *  JSENUMERATE_NEXT\n *    A previously allocated opaque iterator state is passed in via statep.\n *    Return the next jsid in the iteration using *idp.  The opaque iterator\n *    state pointed at by statep is destroyed and *statep is set to JSVAL_NULL\n *    if there are no properties left to enumerate.\n *\n *  JSENUMERATE_DESTROY\n *    Destroy the opaque iterator state previously allocated in *statep by a\n *    call to this function when enum_op was JSENUMERATE_INIT or\n *    JSENUMERATE_INIT_ALL.\n *\n * The return value is used to indicate success, with a value of JS_FALSE\n * indicating failure.\n */\ntypedef JSBool\n(* JSNewEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSIterateOp enum_op,\n                     JS::MutableHandle<JS::Value> statep, JS::MutableHandleId idp);\n\n/*\n * The old-style JSClass.enumerate op should define all lazy properties not\n * yet reflected in obj.\n */\ntypedef JSBool\n(* JSEnumerateOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/*\n * Resolve a lazy property named by id in obj by defining it directly in obj.\n * Lazy properties are those reflected from some peer native property space\n * (e.g., the DOM attributes for a given node reflected as obj) on demand.\n *\n * JS looks for a property in an object, and if not found, tries to resolve\n * the given id.  If resolve succeeds, the engine looks again in case resolve\n * defined obj[id].  If no such property exists directly in obj, the process\n * is repeated with obj's prototype, etc.\n *\n * NB: JSNewResolveOp provides a cheaper way to resolve lazy properties.\n */\ntypedef JSBool\n(* JSResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\n/*\n * Like JSResolveOp, but flags provide contextual information as follows:\n *\n *  JSRESOLVE_ASSIGNING   obj[id] is on the left-hand side of an assignment\n *\n * The *objp out parameter, on success, should be null to indicate that id\n * was not resolved; and non-null, referring to obj or one of its prototypes,\n * if id was resolved.  The hook may assume *objp is null on entry.\n *\n * This hook instead of JSResolveOp is called via the JSClass.resolve member\n * if JSCLASS_NEW_RESOLVE is set in JSClass.flags.\n */\ntypedef JSBool\n(* JSNewResolveOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, unsigned flags,\n                   JS::MutableHandleObject objp);\n\n/*\n * Convert obj to the given type, returning true with the resulting value in\n * *vp on success, and returning false on error or exception.\n */\ntypedef JSBool\n(* JSConvertOp)(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n                JS::MutableHandle<JS::Value> vp);\n\ntypedef struct JSFreeOp JSFreeOp;\n\nstruct JSFreeOp {\n  private:\n    JSRuntime   *runtime_;\n\n  protected:\n    JSFreeOp(JSRuntime *rt)\n      : runtime_(rt) { }\n\n  public:\n    JSRuntime *runtime() const {\n        return runtime_;\n    }\n};\n\n/*\n * Finalize obj, which the garbage collector has determined to be unreachable\n * from other live objects or from GC roots.  Obviously, finalizers must never\n * store a reference to obj.\n */\ntypedef void\n(* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);\n\n/*\n * Finalizes external strings created by JS_NewExternalString.\n */\ntypedef struct JSStringFinalizer JSStringFinalizer;\n\nstruct JSStringFinalizer {\n    void (*finalize)(const JSStringFinalizer *fin, jschar *chars);\n};\n\n/*\n * JSClass.checkAccess type: check whether obj[id] may be accessed per mode,\n * returning false on error/exception, true on success with obj[id]'s last-got\n * value in *vp, and its attributes in *attrsp.  As for JSPropertyOp above, id\n * is either a string or an int jsval.\n */\ntypedef JSBool\n(* JSCheckAccessOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                    JSAccessMode mode, JS::MutableHandle<JS::Value> vp);\n\n/*\n * Check whether v is an instance of obj.  Return false on error or exception,\n * true on success with JS_TRUE in *bp if v is an instance of obj, JS_FALSE in\n * *bp otherwise.\n */\ntypedef JSBool\n(* JSHasInstanceOp)(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,\n                    JSBool *bp);\n\n/*\n * Function type for trace operation of the class called to enumerate all\n * traceable things reachable from obj's private data structure. For each such\n * thing, a trace implementation must call one of the JS_Call*Tracer variants\n * on the thing.\n *\n * JSTraceOp implementation can assume that no other threads mutates object\n * state. It must not change state of the object or corresponding native\n * structures. The only exception for this rule is the case when the embedding\n * needs a tight integration with GC. In that case the embedding can check if\n * the traversal is a part of the marking phase through calling\n * JS_IsGCMarkingTracer and apply a special code like emptying caches or\n * marking its native structures.\n */\ntypedef void\n(* JSTraceOp)(JSTracer *trc, JSObject *obj);\n\n/*\n * Callback that JSTraceOp implementation can provide to return a string\n * describing the reference traced with JS_CallTracer.\n */\ntypedef void\n(* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);\n\ntypedef JSObject *\n(* JSWeakmapKeyDelegateOp)(JSObject *obj);\n\n/* Callbacks and their arguments. */\n\ntypedef enum JSContextOp {\n    JSCONTEXT_NEW,\n    JSCONTEXT_DESTROY\n} JSContextOp;\n\n/*\n * The possible values for contextOp when the runtime calls the callback are:\n *   JSCONTEXT_NEW      JS_NewContext successfully created a new JSContext\n *                      instance. The callback can initialize the instance as\n *                      required. If the callback returns false, the instance\n *                      will be destroyed and JS_NewContext returns null. In\n *                      this case the callback is not called again.\n *   JSCONTEXT_DESTROY  One of JS_DestroyContext* methods is called. The\n *                      callback may perform its own cleanup and must always\n *                      return true.\n *   Any other value    For future compatibility the callback must do nothing\n *                      and return true in this case.\n */\ntypedef JSBool\n(* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data);\n\ntypedef enum JSGCStatus {\n    JSGC_BEGIN,\n    JSGC_END\n} JSGCStatus;\n\ntypedef void\n(* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data);\n\ntypedef enum JSFinalizeStatus {\n    /*\n     * Called when preparing to sweep a group of compartments, before anything\n     * has been swept.  The collector will not yield to the mutator before\n     * calling the callback with JSFINALIZE_GROUP_END status.\n     */\n    JSFINALIZE_GROUP_START,\n\n    /*\n     * Called when preparing to sweep a group of compartments. Weak references\n     * to unmarked things have been removed and things that are not swept\n     * incrementally have been finalized at this point.  The collector may yield\n     * to the mutator after this point.\n     */\n    JSFINALIZE_GROUP_END,\n\n    /*\n     * Called at the end of collection when everything has been swept.\n     */\n    JSFINALIZE_COLLECTION_END\n} JSFinalizeStatus;\n\ntypedef void\n(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, JSBool isCompartment);\n\n/*\n * Generic trace operation that calls JS_CallTracer on each traceable thing\n * stored in data.\n */\ntypedef void\n(* JSTraceDataOp)(JSTracer *trc, void *data);\n\ntypedef JSBool\n(* JSOperationCallback)(JSContext *cx);\n\ntypedef void\n(* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);\n\n#ifdef MOZ_TRACE_JSCALLS\ntypedef void\n(* JSFunctionCallback)(const JSFunction *fun,\n                       const JSScript *scr,\n                       const JSContext *cx,\n                       int entering);\n#endif\n\n/*\n * Possible exception types. These types are part of a JSErrorFormatString\n * structure. They define which error to throw in case of a runtime error.\n * JSEXN_NONE marks an unthrowable error.\n */\ntypedef enum JSExnType {\n    JSEXN_NONE = -1,\n      JSEXN_ERR,\n        JSEXN_INTERNALERR,\n        JSEXN_EVALERR,\n        JSEXN_RANGEERR,\n        JSEXN_REFERENCEERR,\n        JSEXN_SYNTAXERR,\n        JSEXN_TYPEERR,\n        JSEXN_URIERR,\n        JSEXN_LIMIT\n} JSExnType;\n\ntypedef struct JSErrorFormatString {\n    /* The error format string in ASCII. */\n    const char *format;\n\n    /* The number of arguments to expand in the formatted error message. */\n    uint16_t argCount;\n\n    /* One of the JSExnType constants above. */\n    int16_t exnType;\n} JSErrorFormatString;\n\ntypedef const JSErrorFormatString *\n(* JSErrorCallback)(void *userRef, const char *locale,\n                    const unsigned errorNumber);\n\ntypedef JSBool\n(* JSLocaleToUpperCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToLowerCase)(JSContext *cx, JS::Handle<JSString*> src,\n                        JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleCompare)(JSContext *cx, JS::Handle<JSString*> src1, JS::Handle<JSString*> src2,\n                    JS::MutableHandle<JS::Value> rval);\n\ntypedef JSBool\n(* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandle<JS::Value> rval);\n\n/*\n * Security protocol types.\n */\n\ntypedef void\n(* JSDestroyPrincipalsOp)(JSPrincipals *principals);\n\n/*\n * Used to check if a CSP instance wants to disable eval() and friends.\n * See js_CheckCSPPermitsJSAction() in jsobj.\n */\ntypedef JSBool\n(* JSCSPEvalChecker)(JSContext *cx);\n\n/*\n * Callback used to ask the embedding for the cross compartment wrapper handler\n * that implements the desired prolicy for this kind of object in the\n * destination compartment. |obj| is the object to be wrapped. If |existing| is\n * non-NULL, it will point to an existing wrapper object that should be re-used\n * if possible. |existing| is guaranteed to be a cross-compartment wrapper with\n * a lazily-defined prototype and the correct global. It is guaranteed not to\n * wrap a function.\n */\ntypedef JSObject *\n(* JSWrapObjectCallback)(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj,\n                         JS::HandleObject proto, JS::HandleObject parent,\n                         unsigned flags);\n\n/*\n * Callback used by the wrap hook to ask the embedding to prepare an object\n * for wrapping in a context. This might include unwrapping other wrappers\n * or even finding a more suitable object for the new compartment.\n */\ntypedef JSObject *\n(* JSPreWrapCallback)(JSContext *cx, JS::HandleObject scope, JS::HandleObject obj,\n                      unsigned flags);\n\n/*\n * Callback used when wrapping determines that the underlying object is already\n * in the compartment for which it is being wrapped. This allows consumers to\n * maintain same-compartment wrapping invariants.\n *\n * |obj| is guaranteed to be same-compartment as |cx|, but it may (or may not)\n * be a security or cross-compartment wrapper. This is an unfortunate contract,\n * but is important for to avoid unnecessarily recomputing every cross-\n * compartment wrapper that gets passed to wrap.\n */\ntypedef JSObject *\n(* JSSameCompartmentWrapObjectCallback)(JSContext *cx, JS::HandleObject obj);\n\ntypedef void\n(* JSDestroyCompartmentCallback)(JSFreeOp *fop, JSCompartment *compartment);\n\ntypedef void\n(* JSCompartmentNameCallback)(JSRuntime *rt, JSCompartment *compartment,\n                              char *buf, size_t bufsize);\n\n/*\n * Read structured data from the reader r. This hook is used to read a value\n * previously serialized by a call to the WriteStructuredCloneOp hook.\n *\n * tag and data are the pair of uint32_t values from the header. The callback\n * may use the JS_Read* APIs to read any other relevant parts of the object\n * from the reader r. closure is any value passed to the JS_ReadStructuredClone\n * function. Return the new object on success, NULL on error/exception.\n */\ntypedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,\n                                           uint32_t tag, uint32_t data, void *closure);\n\n/*\n * Structured data serialization hook. The engine can write primitive values,\n * Objects, Arrays, Dates, RegExps, TypedArrays, and ArrayBuffers. Any other\n * type of object requires application support. This callback must first use\n * the JS_WriteUint32Pair API to write an object header, passing a value\n * greater than JS_SCTAG_USER to the tag parameter. Then it can use the\n * JS_Write* APIs to write any other relevant parts of the value v to the\n * writer w. closure is any value passed to the JS_WriteStructuredCLone function.\n *\n * Return true on success, false on error/exception.\n */\ntypedef JSBool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,\n                                         JS::Handle<JSObject*> obj, void *closure);\n\n/*\n * This is called when JS_WriteStructuredClone is given an invalid transferable.\n * To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException\n * with error set to one of the JS_SCERR_* values.\n */\ntypedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);\n\n/************************************************************************/\n\n/*\n * JS constants. For efficiency, prefer predicates (e.g. v.isNull()) and\n * constructing values from scratch (e.g. Int32Value(0)).  These constants are\n * stored in memory and initialized at startup, so testing against them and\n * using them requires memory loads and will be correspondingly slow.\n */\nextern JS_PUBLIC_DATA(const jsval) JSVAL_NULL;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ZERO;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_ONE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_FALSE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_TRUE;\nextern JS_PUBLIC_DATA(const jsval) JSVAL_VOID;\n\nstatic JS_ALWAYS_INLINE jsval\nJS_NumberValue(double d)\n{\n    int32_t i;\n    d = JS::CanonicalizeNaN(d);\n    if (mozilla::DoubleIsInt32(d, &i))\n        return INT_TO_JSVAL(i);\n    return DOUBLE_TO_JSVAL(d);\n}\n\n/************************************************************************/\n\n/*\n * A jsid is an identifier for a property or method of an object which is\n * either a 31-bit signed integer, interned string or object.  Also, there is\n * an additional jsid value, JSID_VOID, which does not occur in JS scripts but\n * may be used to indicate the absence of a valid jsid.\n *\n * A jsid is not implicitly convertible to or from a jsval; JS_ValueToId or\n * JS_IdToValue must be used instead.\n */\n\n#define JSID_TYPE_STRING                 0x0\n#define JSID_TYPE_INT                    0x1\n#define JSID_TYPE_VOID                   0x2\n#define JSID_TYPE_OBJECT                 0x4\n#define JSID_TYPE_MASK                   0x7\n\n/*\n * Avoid using canonical 'id' for jsid parameters since this is a magic word in\n * Objective-C++ which, apparently, wants to be able to #include jsapi.h.\n */\n#define id iden\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_STRING(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJSID_TO_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSString *)JSID_BITS(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ZERO(jsid id)\n{\n    return JSID_BITS(id) == 0;\n}\n\nJS_PUBLIC_API(JSBool)\nJS_StringHasBeenInterned(JSContext *cx, JSString *str);\n\n/*\n * Only JSStrings that have been interned via the JSAPI can be turned into\n * jsids by API clients.\n *\n * N.B. if a jsid is backed by a string which has not been interned, that\n * string must be appropriately rooted to avoid being collected by the GC.\n */\nJS_PUBLIC_API(jsid)\nINTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_INT(jsid id)\n{\n    return !!(JSID_BITS(id) & JSID_TYPE_INT);\n}\n\nstatic JS_ALWAYS_INLINE int32_t\nJSID_TO_INT(jsid id)\n{\n    JS_ASSERT(JSID_IS_INT(id));\n    return ((uint32_t)JSID_BITS(id)) >> 1;\n}\n\n#define JSID_INT_MIN  0\n#define JSID_INT_MAX  INT32_MAX\n\nstatic JS_ALWAYS_INLINE JSBool\nINT_FITS_IN_JSID(int32_t i)\n{\n    return i >= 0;\n}\n\nstatic JS_ALWAYS_INLINE jsid\nINT_TO_JSID(int32_t i)\n{\n    jsid id;\n    JS_ASSERT(INT_FITS_IN_JSID(i));\n    JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_OBJECT(jsid id)\n{\n    return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_OBJECT &&\n           (size_t)JSID_BITS(id) != JSID_TYPE_OBJECT;\n}\n\nstatic JS_ALWAYS_INLINE JSObject *\nJSID_TO_OBJECT(jsid id)\n{\n    JS_ASSERT(JSID_IS_OBJECT(id));\n    return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\nstatic JS_ALWAYS_INLINE jsid\nOBJECT_TO_JSID(JSObject *obj)\n{\n    jsid id;\n    JS_ASSERT(obj != NULL);\n    JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);\n    JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_GCTHING(jsid id)\n{\n    return JSID_IS_STRING(id) || JSID_IS_OBJECT(id);\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSID_TO_GCTHING(jsid id)\n{\n    return (void *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);\n}\n\n/*\n * A void jsid is not a valid id and only arises as an exceptional API return\n * value, such as in JS_NextProperty. Embeddings must not pass JSID_VOID into\n * JSAPI entry points expecting a jsid and do not need to handle JSID_VOID in\n * hooks receiving a jsid except when explicitly noted in the API contract.\n */\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_VOID(const jsid id)\n{\n    JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,\n                 JSID_BITS(id) == JSID_TYPE_VOID);\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_EMPTY(const jsid id)\n{\n    return ((size_t)JSID_BITS(id) == JSID_TYPE_OBJECT);\n}\n\n#undef id\n\n#ifdef JS_USE_JSID_STRUCT_TYPES\nextern JS_PUBLIC_DATA(const jsid) JSID_VOID;\nextern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;\n#else\n# define JSID_VOID ((jsid)JSID_TYPE_VOID)\n# define JSID_EMPTY ((jsid)JSID_TYPE_OBJECT)\n#endif\n\n/*\n * Returns true iff the given jsval is immune to GC and can be used across\n * multiple JSRuntimes without requiring any conversion API.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_UNIVERSAL(jsval v)\n{\n    return !JSVAL_IS_GCTHING(v);\n}\n\nnamespace JS {\n\nclass AutoIdRooter : private AutoGCRooter\n{\n  public:\n    explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)\n                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, ID), id_(aId)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    jsid id() {\n        return id_;\n    }\n\n    jsid * addr() {\n        return &id_;\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n  private:\n    jsid id_;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n} /* namespace JS */\n\n/************************************************************************/\n\n/* Property attributes, set in JSPropertySpec and passed to API functions. */\n#define JSPROP_ENUMERATE        0x01    /* property is visible to for/in loop */\n#define JSPROP_READONLY         0x02    /* not settable: assignment is no-op.\n                                           This flag is only valid when neither\n                                           JSPROP_GETTER nor JSPROP_SETTER is\n                                           set. */\n#define JSPROP_PERMANENT        0x04    /* property cannot be deleted */\n#define JSPROP_NATIVE_ACCESSORS 0x08    /* set in JSPropertyDescriptor.flags\n                                           if getters/setters are JSNatives */\n#define JSPROP_GETTER           0x10    /* property holds getter function */\n#define JSPROP_SETTER           0x20    /* property holds setter function */\n#define JSPROP_SHARED           0x40    /* don't allocate a value slot for this\n                                           property; don't copy the property on\n                                           set of the same-named property in an\n                                           object that delegates to a prototype\n                                           containing this property */\n#define JSPROP_INDEX            0x80    /* name is actually (int) index */\n#define JSPROP_SHORTID         0x100    /* set in JS_DefineProperty attrs\n                                           if getters/setters use a shortid */\n\n#define JSFUN_STUB_GSOPS       0x200    /* use JS_PropertyStub getter/setter\n                                           instead of defaulting to class gsops\n                                           for property holding function */\n\n#define JSFUN_CONSTRUCTOR      0x400    /* native that can be called as a ctor */\n\n\n/*\n * Specify a generic native prototype methods, i.e., methods of a class\n * prototype that are exposed as static methods taking an extra leading\n * argument: the generic |this| parameter.\n *\n * If you set this flag in a JSFunctionSpec struct's flags initializer, then\n * that struct must live at least as long as the native static method object\n * created due to this flag by JS_DefineFunctions or JS_InitClass.  Typically\n * JSFunctionSpec structs are allocated in static arrays.\n */\n#define JSFUN_GENERIC_NATIVE   0x800\n\n#define JSFUN_FLAGS_MASK       0xe00    /* | of all the JSFUN_* flags */\n\n/*\n * The first call to JS_CallOnce by any thread in a process will call 'func'.\n * Later calls to JS_CallOnce with the same JSCallOnceType object will be\n * suppressed.\n *\n * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce\n * to invoke its JSInitCallback.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CallOnce(JSCallOnceType *once, JSInitCallback func);\n\n/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */\nextern JS_PUBLIC_API(int64_t)\nJS_Now(void);\n\n/* Don't want to export data, so provide accessors for non-inline jsvals. */\nextern JS_PUBLIC_API(jsval)\nJS_GetNaNValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetNegativeInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetPositiveInfinityValue(JSContext *cx);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetEmptyStringValue(JSContext *cx);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetEmptyString(JSRuntime *rt);\n\n/*\n * Format is a string of the following characters (spaces are insignificant),\n * specifying the tabulated type conversions:\n *\n *   b      JSBool          Boolean\n *   c      uint16_t/jschar ECMA uint16_t, Unicode char\n *   i      int32_t         ECMA int32_t\n *   u      uint32_t        ECMA uint32_t\n *   j      int32_t         Rounded int32_t (coordinate)\n *   d      double          IEEE double\n *   I      double          Integral IEEE double\n *   S      JSString *      Unicode string, accessed by a JSString pointer\n *   W      jschar *        Unicode character vector, 0-terminated (W for wide)\n *   o      JSObject *      Object reference\n *   f      JSFunction *    Function private\n *   v      jsval           Argument value (no conversion)\n *   *      N/A             Skip this argument (no vararg)\n *   /      N/A             End of required arguments\n *\n * The variable argument list after format must consist of &b, &c, &s, e.g.,\n * where those variables have the types given above.  For the pointer types\n * char *, JSString *, and JSObject *, the pointed-at memory returned belongs\n * to the JS runtime, not to the calling native code.  The runtime promises\n * to keep this memory valid so long as argv refers to allocated stack space\n * (so long as the native function is active).\n *\n * Fewer arguments than format specifies may be passed only if there is a /\n * in format after the last required argument specifier and argc is at least\n * the number of required arguments.  More arguments than format specifies\n * may be passed without error; it is up to the caller to deal with trailing\n * unconverted arguments.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArguments(JSContext *cx, unsigned argc, jsval *argv, const char *format,\n                    ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertArgumentsVA(JSContext *cx, unsigned argc, jsval *argv,\n                      const char *format, va_list ap);\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertValue(JSContext *cx, jsval v, JSType type, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToObject(JSContext *cx, jsval v, JSObject **objp);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToFunction(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_ValueToConstructor(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToString(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSString *)\nJS_ValueToSource(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToNumber(JSContext *cx, jsval v, double *dp);\n\nnamespace js {\n/*\n * DO NOT CALL THIS.  Use JS::ToNumber\n */\nextern JS_PUBLIC_API(bool)\nToNumberSlow(JSContext *cx, JS::Value v, double *dp);\n\n/*\n * DO NOT CALL THIS. Use JS::ToBoolean\n */\nextern JS_PUBLIC_API(bool)\nToBooleanSlow(const JS::Value &v);\n} /* namespace js */\n\nnamespace JS {\n\n/* ES5 9.3 ToNumber. */\nJS_ALWAYS_INLINE bool\nToNumber(JSContext *cx, HandleValue v, double *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    {\n        js::SkipRoot root(cx, &v);\n        js::MaybeCheckStackRoots(cx);\n    }\n\n    if (v.isNumber()) {\n        *out = v.toNumber();\n        return true;\n    }\n    return js::ToNumberSlow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToBoolean(const Value &v)\n{\n    if (v.isBoolean())\n        return v.toBoolean();\n    if (v.isInt32())\n        return v.toInt32() != 0;\n    if (v.isNullOrUndefined())\n        return false;\n    if (v.isDouble()) {\n        double d = v.toDouble();\n        return !mozilla::IsNaN(d) && d != 0;\n    }\n\n    /* The slow path handles strings and objects. */\n    return js::ToBooleanSlow(v);\n}\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_DoubleIsInt32(double d, int32_t *ip);\n\nextern JS_PUBLIC_API(int32_t)\nJS_DoubleToInt32(double d);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_DoubleToUint32(double d);\n\n/*\n * Convert a value to a number, then to an int32_t, according to the ECMA rules\n * for ToInt32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * Convert a value to a number, then to an int64_t, according to the WebIDL\n * rules for ToInt64: http://dev.w3.org/2006/webapi/WebIDL/#es-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt64(JSContext *cx, jsval v, int64_t *ip);\n\n/*\n * Convert a value to a number, then to an uint64_t, according to the WebIDL\n * rules for ToUint64: http://dev.w3.org/2006/webapi/WebIDL/#es-unsigned-long-long\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint64(JSContext *cx, jsval v, uint64_t *ip);\n\nnamespace js {\n/* DO NOT CALL THIS.  Use JS::ToInt16. */\nextern JS_PUBLIC_API(bool)\nToUint16Slow(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToInt32. */\nextern JS_PUBLIC_API(bool)\nToInt32Slow(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out);\n\n/* DO NOT CALL THIS.  Use JS::ToUint32. */\nextern JS_PUBLIC_API(bool)\nToUint32Slow(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToInt64. */\nextern JS_PUBLIC_API(bool)\nToInt64Slow(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out);\n\n/* DO NOT CALL THIS. Use JS::ToUint64. */\nextern JS_PUBLIC_API(bool)\nToUint64Slow(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out);\n} /* namespace js */\n\nnamespace JS {\n\nJS_ALWAYS_INLINE bool\nToUint16(JSContext *cx, JS::Handle<JS::Value> v, uint16_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint16_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint16Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt32(JSContext *cx, JS::Handle<JS::Value> v, int32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = v.toInt32();\n        return true;\n    }\n    return js::ToInt32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint32(JSContext *cx, JS::Handle<JS::Value> v, uint32_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = uint32_t(v.toInt32());\n        return true;\n    }\n    return js::ToUint32Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToInt64(JSContext *cx, JS::Handle<JS::Value> v, int64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        *out = int64_t(v.toInt32());\n        return true;\n    }\n\n    return js::ToInt64Slow(cx, v, out);\n}\n\nJS_ALWAYS_INLINE bool\nToUint64(JSContext *cx, JS::Handle<JS::Value> v, uint64_t *out)\n{\n    AssertArgumentsAreSane(cx, v);\n    js::MaybeCheckStackRoots(cx);\n\n    if (v.isInt32()) {\n        /* Account for sign extension of negatives into the longer 64bit space. */\n        *out = uint64_t(int64_t(v.toInt32()));\n        return true;\n    }\n\n    return js::ToUint64Slow(cx, v, out);\n}\n\n\n} /* namespace JS */\n\n/*\n * Convert a value to a number, then to a uint32_t, according to the ECMA rules\n * for ToUint32.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToECMAUint32(JSContext *cx, jsval v, uint32_t *ip);\n\n/*\n * Convert a value to a number, then to an int32_t if it fits by rounding to\n * nearest; but failing with an error report if the double is out of range\n * or unordered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToInt32(JSContext *cx, jsval v, int32_t *ip);\n\n/*\n * ECMA ToUint16, for mapping a jsval to a Unicode point.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToUint16(JSContext *cx, jsval v, uint16_t *ip);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToBoolean(JSContext *cx, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(JSType)\nJS_TypeOfValue(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTypeName(JSContext *cx, JSType type);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LooselyEqual(JSContext *cx, jsval v1, jsval v2, JSBool *equal);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SameValue(JSContext *cx, jsval v1, jsval v2, JSBool *same);\n\n/* True iff fun is the global eval function. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinEvalFunction(JSFunction *fun);\n\n/* True iff fun is the Function constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsBuiltinFunctionConstructor(JSFunction *fun);\n\n/************************************************************************/\n\n/*\n * Initialization, locking, contexts, and memory allocation.\n *\n * It is important that the first runtime and first context be created in a\n * single-threaded fashion, otherwise the behavior of the library is undefined.\n * See: http://developer.mozilla.org/en/docs/Category:JSAPI_Reference\n */\n\ntypedef enum JSUseHelperThreads\n{\n    JS_NO_HELPER_THREADS,\n    JS_USE_HELPER_THREADS\n} JSUseHelperThreads;\n\n/**\n * Initialize SpiderMonkey, returning true only if initialization succeeded.\n * Once this method has succeeded, it is safe to call JS_NewRuntime and other\n * JSAPI methods.\n *\n * This method must be called before any other JSAPI method is used on any\n * thread.  Once it has been used, it is safe to call any JSAPI method, and it\n * remains safe to do so until JS_ShutDown is correctly called.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_Init(void);\n\n/**\n * Destroy free-standing resources allocated by SpiderMonkey, not associated\n * with any runtime, context, or other structure.\n *\n * This method should be called after all other JSAPI data has been properly\n * cleaned up: every new runtime must have been destroyed, every new context\n * must have been destroyed, and so on.  Calling this method before all other\n * resources have been destroyed has undefined behavior.\n *\n * Failure to call this method, at present, has no adverse effects other than\n * leaking memory.  This may not always be the case; it's recommended that all\n * embedders call this method when all other JSAPI operations have completed.\n *\n * It is currently not possible to initialize SpiderMonkey multiple times (that\n * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so\n * again).  This restriction may eventually be lifted.\n */\nextern JS_PUBLIC_API(void)\nJS_ShutDown(void);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_NewRuntime(uint32_t maxbytes, JSUseHelperThreads useHelperThreads);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyRuntime(JSRuntime *rt);\n\n// These are equivalent to ICU's |UMemAllocFn|, |UMemReallocFn|, and\n// |UMemFreeFn| types.  The first argument (called |context| in the ICU docs)\n// will always be NULL, and should be ignored.\ntypedef void *(*JS_ICUAllocFn)(const void *, size_t size);\ntypedef void *(*JS_ICUReallocFn)(const void *, void *p, size_t size);\ntypedef void (*JS_ICUFreeFn)(const void *, void *p);\n\n// This function can be used to track memory used by ICU.\n// Do not use it unless you know what you are doing!\nextern JS_PUBLIC_API(bool)\nJS_SetICUMemoryFunctions(JS_ICUAllocFn allocFn, JS_ICUReallocFn reallocFn, JS_ICUFreeFn freeFn);\n\nJS_PUBLIC_API(void *)\nJS_GetRuntimePrivate(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nJS_PUBLIC_API(void)\nJS_SetRuntimePrivate(JSRuntime *rt, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_BeginRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_EndRequest(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsInRequest(JSRuntime *rt);\n\nnamespace JS {\n\ninline bool\nIsPoisonedId(jsid iden)\n{\n    if (JSID_IS_STRING(iden))\n        return JS::IsPoisonedPtr(JSID_TO_STRING(iden));\n    if (JSID_IS_OBJECT(iden))\n        return JS::IsPoisonedPtr(JSID_TO_OBJECT(iden));\n    return false;\n}\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <> struct GCMethods<jsid>\n{\n    static jsid initial() { return JSID_VOID; }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(jsid id) { return JS::IsPoisonedId(id); }\n    static bool needsPostBarrier(jsid id) { return false; }\n#ifdef JSGC_GENERATIONAL\n    static void postBarrier(jsid *idp) {}\n    static void relocate(jsid *idp) {}\n#endif\n};\n\n} /* namespace js */\n\nclass JSAutoRequest\n{\n  public:\n    JSAutoRequest(JSContext *cx\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mContext(cx)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        JS_BeginRequest(mContext);\n    }\n    ~JSAutoRequest() {\n        JS_EndRequest(mContext);\n    }\n\n  protected:\n    JSContext *mContext;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n#if 0\n  private:\n    static void *operator new(size_t) CPP_THROW_NEW { return 0; };\n    static void operator delete(void *, size_t) { };\n#endif\n};\n\nclass JSAutoCheckRequest\n{\n  public:\n    JSAutoCheckRequest(JSContext *cx\n                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n    {\n#if defined JS_THREADSAFE && defined DEBUG\n        mContext = cx;\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));\n#endif\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoCheckRequest() {\n#if defined JS_THREADSAFE && defined DEBUG\n        JS_ASSERT(JS_IsInRequest(JS_GetRuntime(mContext)));\n#endif\n    }\n\n\n  private:\n#if defined JS_THREADSAFE && defined DEBUG\n    JSContext *mContext;\n#endif\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetContextCallback(JSRuntime *rt, JSContextCallback cxCallback, void *data);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_NewContext(JSRuntime *rt, size_t stackChunkSize);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContext(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyContextNoGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void *)\nJS_GetContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetSecondContextPrivate(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetSecondContextPrivate(JSContext *cx, void *data);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetRuntime(JSContext *cx);\n\nextern JS_PUBLIC_API(JSContext *)\nJS_ContextIterator(JSRuntime *rt, JSContext **iterp);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetVersion(JSContext *cx);\n\n// Mutate the version on the compartment. This is generally discouraged, but\n// necessary to support the version mutation in the js and xpc shell command\n// set.\n//\n// It would be nice to put this in jsfriendapi, but the linkage requirements\n// of the shells make that impossible.\nJS_PUBLIC_API(void)\nJS_SetVersionForCompartment(JSCompartment *compartment, JSVersion version);\n\nextern JS_PUBLIC_API(const char *)\nJS_VersionToString(JSVersion version);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_StringToVersion(const char *string);\n\n/*\n * JS options are orthogonal to version, and may be freely composed with one\n * another as well as with version.\n *\n * JSOPTION_VAROBJFIX is recommended -- see the comments associated with the\n * prototypes for JS_ExecuteScript, JS_EvaluateScript, etc.\n */\n#define JSOPTION_EXTRA_WARNINGS JS_BIT(0)       /* warn on dubious practices */\n#define JSOPTION_WERROR         JS_BIT(1)       /* convert warning to error */\n#define JSOPTION_VAROBJFIX      JS_BIT(2)       /* make JS_EvaluateScript use\n                                                   the last object on its 'obj'\n                                                   param's scope chain as the\n                                                   ECMA 'variables object' */\n#define JSOPTION_PRIVATE_IS_NSISUPPORTS \\\n                                JS_BIT(3)       /* context private data points\n                                                   to an nsISupports subclass */\n#define JSOPTION_COMPILE_N_GO   JS_BIT(4)       /* caller of JS_Compile*Script\n                                                   promises to execute compiled\n                                                   script once only; enables\n                                                   compile-time scope chain\n                                                   resolution of consts. */\n\n/* JS_BIT(5) is currently unused. */\n\n/* JS_BIT(6) is currently unused. */\n\n/* JS_BIT(7) is currently unused. */\n\n#define JSOPTION_DONT_REPORT_UNCAUGHT                                   \\\n                                JS_BIT(8)       /* When returning from the\n                                                   outermost API call, prevent\n                                                   uncaught exceptions from\n                                                   being converted to error\n                                                   reports */\n\n/* JS_BIT(9) is currently unused. */\n\n/* JS_BIT(10) is currently unused. */\n\n/* JS_BIT(11) is currently unused. */\n\n#define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12)      /* A promise to the compiler\n                                                   that a null rval out-param\n                                                   will be passed to each call\n                                                   to JS_ExecuteScript. */\n#define JSOPTION_UNROOTED_GLOBAL JS_BIT(13)     /* The GC will not root the\n                                                   contexts' default compartment\n                                                   object, leaving that up to the\n                                                   embedding. */\n\n#define JSOPTION_BASELINE       JS_BIT(14)      /* Baseline compiler. */\n\n#define JSOPTION_TYPE_INFERENCE JS_BIT(16)      /* Perform type inference. */\n#define JSOPTION_STRICT_MODE    JS_BIT(17)      /* Provides a way to force\n                                                   strict mode for all code\n                                                   without requiring\n                                                   \"use strict\" annotations. */\n\n#define JSOPTION_ION            JS_BIT(18)      /* IonMonkey */\n\n#define JSOPTION_ASMJS          JS_BIT(19)      /* optimizingasm.js compiler */\n\n#define JSOPTION_MASK           JS_BITMASK(20)\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetOptions(JSContext *cx);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_SetOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_ToggleOptions(JSContext *cx, uint32_t options);\n\nextern JS_PUBLIC_API(void)\nJS_SetJitHardening(JSRuntime *rt, JSBool enabled);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetImplementationVersion(void);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyCompartmentCallback(JSRuntime *rt, JSDestroyCompartmentCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentNameCallback(JSRuntime *rt, JSCompartmentNameCallback callback);\n\nextern JS_PUBLIC_API(JSWrapObjectCallback)\nJS_SetWrapObjectCallbacks(JSRuntime *rt,\n                          JSWrapObjectCallback callback,\n                          JSSameCompartmentWrapObjectCallback sccallback,\n                          JSPreWrapCallback precallback);\n\nextern JS_PUBLIC_API(void)\nJS_SetCompartmentPrivate(JSCompartment *compartment, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetCompartmentPrivate(JSCompartment *compartment);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapObject(JSContext *cx, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapValue(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_WrapId(JSContext *cx, jsid *idp);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_TransplantObject(JSContext *cx, JS::HandleObject origobj, JS::HandleObject target);\n\nextern JS_FRIEND_API(JSObject *)\njs_TransplantObjectWithWrapper(JSContext *cx,\n                               JS::HandleObject origobj,\n                               JS::HandleObject origwrapper,\n                               JS::HandleObject targetobj,\n                               JS::HandleObject targetwrapper);\n\nextern JS_PUBLIC_API(JSBool)\nJS_RefreshCrossCompartmentWrappers(JSContext *cx, JSObject *ob);\n\n/*\n * At any time, a JSContext has a current (possibly-NULL) compartment.\n * Compartments are described in:\n *\n *   developer.mozilla.org/en-US/docs/SpiderMonkey/SpiderMonkey_compartments\n *\n * The current compartment of a context may be changed. The preferred way to do\n * this is with JSAutoCompartment:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in some compartment 'c'\n *     {\n *       JSAutoCompartment ac(cx, obj);  // constructor enters\n *       // in the compartment of 'obj'\n *     }                                 // destructor leaves\n *     // back in compartment 'c'\n *   }\n *\n * For more complicated uses that don't neatly fit in a C++ stack frame, the\n * compartment can entered and left using separate function calls:\n *\n *   void foo(JSContext *cx, JSObject *obj) {\n *     // in 'oldCompartment'\n *     JSCompartment *oldCompartment = JS_EnterCompartment(cx, obj);\n *     // in the compartment of 'obj'\n *     JS_LeaveCompartment(cx, oldCompartment);\n *     // back in 'oldCompartment'\n *   }\n *\n * Note: these calls must still execute in a LIFO manner w.r.t all other\n * enter/leave calls on the context. Furthermore, only the return value of a\n * JS_EnterCompartment call may be passed as the 'oldCompartment' argument of\n * the corresponding JS_LeaveCompartment call.\n */\n\nclass JS_PUBLIC_API(JSAutoCompartment)\n{\n    JSContext *cx_;\n    JSCompartment *oldCompartment_;\n  public:\n    JSAutoCompartment(JSContext *cx, JSObject *target);\n    JSAutoCompartment(JSContext *cx, JSScript *target);\n    ~JSAutoCompartment();\n};\n\n/* NB: This API is infallible; a NULL return value does not indicate error. */\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartment(JSContext *cx, JSObject *target);\n\nextern JS_PUBLIC_API(void)\nJS_LeaveCompartment(JSContext *cx, JSCompartment *oldCompartment);\n\ntypedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);\n\n/*\n * This function calls |compartmentCallback| on every compartment.  Beware that\n * there is no guarantee that the compartment will survive after the callback\n * returns.\n */\nextern JS_PUBLIC_API(void)\nJS_IterateCompartments(JSRuntime *rt, void *data,\n                       JSIterateCompartmentCallback compartmentCallback);\n\n/*\n * Initialize standard JS class constructors, prototypes, and any top-level\n * functions and constants associated with the standard classes (e.g. isNaN\n * for Number).\n *\n * NB: This sets cx's global object to obj if it was null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitStandardClasses(JSContext *cx, JSObject *obj);\n\n/*\n * Resolve id, which must contain either a string or an int, to a standard\n * class name in obj if possible, defining the class's constructor and/or\n * prototype and storing true in *resolved.  If id does not name a standard\n * class or a top-level property induced by initializing a standard class,\n * store false in *resolved and just return true.  Return false on error,\n * as usual for JSBool result-typed API entry points.\n *\n * This API can be called directly from a global object class's resolve op,\n * to define standard classes lazily.  The class's enumerate op should call\n * JS_EnumerateStandardClasses(cx, obj), to define eagerly during for..in\n * loops any classes not yet resolved lazily.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStandardClass(JSContext *cx, JS::HandleObject obj, JS::HandleId id,\n                        JSBool *resolved);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStandardClasses(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassObject(JSContext *cx, JSObject *obj, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetClassPrototype(JSContext *cx, JSProtoKey key, JSObject **objp);\n\nextern JS_PUBLIC_API(JSProtoKey)\nJS_IdentifyClassPrototype(JSContext *cx, JSObject *obj);\n\n/*\n * Returns the original value of |Function.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Object.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetObjectPrototype(JSContext *cx, JSObject *forObj);\n\n/*\n * Returns the original value of |Array.prototype| from the global object in\n * which |forObj| was created.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetArrayPrototype(JSContext *cx, JSObject *forObj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGlobalObject(JSObject *obj);\n\n/*\n * May return NULL, if |c| never had a global (e.g. the atoms compartment), or\n * if |c|'s global has been collected.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalForCompartmentOrNull(JSContext *cx, JSCompartment *c);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(JSObject *)\nCurrentGlobalOrNull(JSContext *cx);\n\n}\n\n/*\n * This method returns the global corresponding to the most recent scripted\n * frame, which may not match the cx's current compartment. This is extremely\n * dangerous, because it can bypass compartment security invariants in subtle\n * ways. To use it safely, the caller must perform a subsequent security\n * check. There is currently only one consumer of this function in Gecko, and\n * it should probably stay that way. If you'd like to use it, please consult\n * the XPConnect module owner first.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_GetScriptedGlobal(JSContext *cx);\n\n/*\n * Initialize the 'Reflect' object on a global object.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_InitReflect(JSContext *cx, JSObject *global);\n\n#ifdef JS_HAS_CTYPES\n/*\n * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'\n * object will be sealed.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_InitCTypesClass(JSContext *cx, JSObject *global);\n\n/*\n * Convert a unicode string 'source' of length 'slen' to the platform native\n * charset, returning a null-terminated string allocated with JS_malloc. On\n * failure, this function should report an error.\n */\ntypedef char *\n(* JSCTypesUnicodeToNativeFun)(JSContext *cx, const jschar *source, size_t slen);\n\n/*\n * Set of function pointers that ctypes can use for various internal functions.\n * See JS_SetCTypesCallbacks below. Providing NULL for a function is safe,\n * and will result in the applicable ctypes functionality not being available.\n */\nstruct JSCTypesCallbacks {\n    JSCTypesUnicodeToNativeFun unicodeToNative;\n};\n\ntypedef struct JSCTypesCallbacks JSCTypesCallbacks;\n\n/*\n * Set the callbacks on the provided 'ctypesObj' object. 'callbacks' should be a\n * pointer to static data that exists for the lifetime of 'ctypesObj', but it\n * may safely be altered after calling this function and without having\n * to call this function again.\n */\nextern JS_PUBLIC_API(void)\nJS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);\n#endif\n\ntypedef JSBool\n(* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);\n\n/*\n * Enumerate memory regions that contain diagnostic information\n * intended to be included in crash report minidumps.\n */\nextern JS_PUBLIC_API(void)\nJS_EnumerateDiagnosticMemoryRegions(JSEnumerateDiagnosticMemoryCallback callback);\n\nextern JS_PUBLIC_API(void *)\nJS_malloc(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(void *)\nJS_realloc(JSContext *cx, void *p, size_t nbytes);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization.\n * cx may be NULL.\n */\nextern JS_PUBLIC_API(void)\nJS_free(JSContext *cx, void *p);\n\n/*\n * A wrapper for js_free(p) that may delay js_free(p) invocation as a\n * performance optimization as specified by the given JSFreeOp instance.\n */\nextern JS_PUBLIC_API(void)\nJS_freeop(JSFreeOp *fop, void *p);\n\nextern JS_PUBLIC_API(JSFreeOp *)\nJS_GetDefaultFreeOp(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_updateMallocCounter(JSContext *cx, size_t nbytes);\n\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSContext *cx, const char *s);\n\n/* Duplicate a string.  Does not report an error on failure. */\nextern JS_PUBLIC_API(char *)\nJS_strdup(JSRuntime *rt, const char *s);\n\n\n/*\n * A GC root is a pointer to a jsval, JSObject * or JSString * that itself\n * points into the GC heap. JS_AddValueRoot takes a pointer to a jsval and\n * JS_AddGCThingRoot takes a pointer to a JSObject * or JString *.\n *\n * Note that, since JS_Add*Root stores the address of a variable (of type\n * jsval, JSString *, or JSObject *), that variable must live until\n * JS_Remove*Root is called to remove that variable. For example, after:\n *\n *   void some_function() {\n *     jsval v;\n *     JS_AddNamedValueRoot(cx, &v, \"name\");\n *\n * the caller must perform\n *\n *     JS_RemoveValueRoot(cx, &v);\n *\n * before some_function() returns.\n *\n * Also, use JS_AddNamed*Root(cx, &structPtr->memberObj, \"structPtr->memberObj\")\n * in preference to JS_Add*Root(cx, &structPtr->memberObj), in order to identify\n * roots by their source callsites.  This way, you can find the callsite while\n * debugging if you should fail to do JS_Remove*Root(cx, &structPtr->memberObj)\n * before freeing structPtr's memory.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddObjectRoot(JSContext *cx, JSObject **rp);\n\n#ifdef NAME_ALL_GC_ROOTS\n#define JS_DEFINE_TO_TOKEN(def) #def\n#define JS_DEFINE_TO_STRING(def) JS_DEFINE_TO_TOKEN(def)\n#define JS_AddValueRoot(cx,vp) JS_AddNamedValueRoot((cx), (vp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddStringRoot(cx,rp) JS_AddNamedStringRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#define JS_AddObjectRoot(cx,rp) JS_AddNamedObjectRoot((cx), (rp), (__FILE__ \":\" JS_TOKEN_TO_STRING(__LINE__))\n#endif\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRoot(JSContext *cx, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedValueRootRT(JSRuntime *rt, jsval *vp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedStringRoot(JSContext *cx, JSString **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedObjectRoot(JSContext *cx, JSObject **rp, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AddNamedScriptRoot(JSContext *cx, JSScript **rp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRoot(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRoot(JSContext *cx, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRoot(JSContext *cx, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRoot(JSContext *cx, JSScript **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveValueRootRT(JSRuntime *rt, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveStringRootRT(JSRuntime *rt, JSString **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveObjectRootRT(JSRuntime *rt, JSObject **rp);\n\nextern JS_PUBLIC_API(void)\nJS_RemoveScriptRootRT(JSRuntime *rt, JSScript **rp);\n\n/* TODO: remove these APIs */\n\nextern JS_FRIEND_API(void)\njs_RemoveRoot(JSRuntime *rt, void *rp);\n\n/*\n * C-compatible version of the Anchor class. It should be called after the last\n * use of the variable it protects.\n */\nextern JS_NEVER_INLINE JS_PUBLIC_API(void)\nJS_AnchorPtr(void *p);\n\n/*\n * Register externally maintained GC roots.\n *\n * traceOp: the trace operation. For each root the implementation should call\n *          JS_CallTracer whenever the root contains a traceable thing.\n * data:    the data argument to pass to each invocation of traceOp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AddExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/* Undo a call to JS_AddExtraGCRootsTracer. */\nextern JS_PUBLIC_API(void)\nJS_RemoveExtraGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\n/*\n * JS_CallTracer API and related macros for implementors of JSTraceOp, to\n * enumerate all references to traceable things reachable via a property or\n * other strong ref identified for debugging purposes by name or index or\n * a naming callback.\n *\n * See the JSTraceOp typedef.\n */\n\n/*\n * Use the following macros to check if a particular jsval is a traceable\n * thing and to extract the thing and its kind to pass to JS_CallTracer.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJSVAL_IS_TRACEABLE(jsval v)\n{\n    return JSVAL_IS_TRACEABLE_IMPL(JSVAL_TO_IMPL(v));\n}\n\nstatic JS_ALWAYS_INLINE void *\nJSVAL_TO_TRACEABLE(jsval v)\n{\n    return JSVAL_TO_GCTHING(v);\n}\n\nstatic JS_ALWAYS_INLINE JSGCTraceKind\nJSVAL_TRACE_KIND(jsval v)\n{\n    JS_ASSERT(JSVAL_IS_GCTHING(v));\n    return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));\n}\n\n/*\n * Tracer callback, called for each traceable thing directly referenced by a\n * particular object or runtime structure. It is the callback responsibility\n * to ensure the traversal of the full object graph via calling eventually\n * JS_TraceChildren on the passed thing. In this case the callback must be\n * prepared to deal with cycles in the traversal graph.\n *\n * kind argument is one of JSTRACE_OBJECT, JSTRACE_STRING or a tag denoting\n * internal implementation-specific traversal kind. In the latter case the only\n * operations on thing that the callback can do is to call JS_TraceChildren or\n * JS_GetTraceThingInfo.\n *\n * If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all\n * of its mappings.  This should be used in cases where the tracer\n * wants to use the existing liveness of entries.\n */\ntypedef void\n(* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);\n\nenum WeakMapTraceKind {\n    DoNotTraceWeakMaps = 0,\n    TraceWeakMapValues = 1,\n    TraceWeakMapKeysValues = 2\n};\n\nstruct JSTracer {\n    JSRuntime           *runtime;\n    JSTraceCallback     callback;\n    JSTraceNamePrinter  debugPrinter;\n    const void          *debugPrintArg;\n    size_t              debugPrintIndex;\n    WeakMapTraceKind    eagerlyTraceWeakMaps;\n#ifdef JS_GC_ZEAL\n    void                *realLocation;\n#endif\n};\n\n/*\n * Set debugging information about a reference to a traceable thing to prepare\n * for the following call to JS_CallTracer.\n *\n * When printer is null, arg must be const char * or char * C string naming\n * the reference and index must be either (size_t)-1 indicating that the name\n * alone describes the reference or it must be an index into some array vector\n * that stores the reference.\n *\n * When printer callback is not null, the arg and index arguments are\n * available to the callback as debugPrintArg and debugPrintIndex fields\n * of JSTracer.\n *\n * The storage for name or callback's arguments needs to live only until\n * the following call to JS_CallTracer returns.\n */\n# define JS_SET_TRACING_DETAILS(trc, printer, arg, index)                     \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->debugPrinter = (printer);                                      \\\n        (trc)->debugPrintArg = (arg);                                         \\\n        (trc)->debugPrintIndex = (index);                                     \\\n    JS_END_MACRO\n\n/*\n * Sets the real location for a marked reference, when passing the address\n * directly is not feasable.\n *\n * FIXME: This is currently overcomplicated by our need to nest calls for Values\n * stored as keys in hash tables, but will get simplified once we can rekey\n * in-place.\n */\n#ifdef JS_GC_ZEAL\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n        if (!(trc)->realLocation || !(location))                              \\\n            (trc)->realLocation = (location);                                 \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n        (trc)->realLocation = NULL;                                           \\\n    JS_END_MACRO\n#else\n# define JS_SET_TRACING_LOCATION(trc, location)                               \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n# define JS_UNSET_TRACING_LOCATION(trc)                                       \\\n    JS_BEGIN_MACRO                                                            \\\n    JS_END_MACRO\n#endif\n\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string\n * and index.\n */\n# define JS_SET_TRACING_INDEX(trc, name, index)                               \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, index)\n\n/*\n * Convenience macro to describe the argument of JS_CallTracer using C string.\n */\n# define JS_SET_TRACING_NAME(trc, name)                                       \\\n    JS_SET_TRACING_DETAILS(trc, NULL, name, (size_t)-1)\n\n/*\n * The JS_Call*Tracer family of functions traces the given GC thing reference.\n * This performs the tracing action configured on the given JSTracer:\n * typically calling the JSTracer::callback or marking the thing as live.\n *\n * The argument to JS_Call*Tracer is an in-out param: when the function\n * returns, the garbage collector might have moved the GC thing. In this case,\n * the reference passed to JS_Call*Tracer will be updated to the object's new\n * location. Callers of this method are responsible for updating any state\n * that is dependent on the object's address. For example, if the object's\n * address is used as a key in a hashtable, then the object must be removed\n * and re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(void)\nJS_CallValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallIdTracer(JSTracer *trc, jsid *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallObjectTracer(JSTracer *trc, JSObject **objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallStringTracer(JSTracer *trc, JSString **strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallScriptTracer(JSTracer *trc, JSScript **scriptp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapValueTracer(JSTracer *trc, JS::Heap<JS::Value> *valuep, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapIdTracer(JSTracer *trc, JS::Heap<jsid> *idp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapObjectTracer(JSTracer *trc, JS::Heap<JSObject *> *objp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapStringTracer(JSTracer *trc, JS::Heap<JSString *> *strp, const char *name);\n\nextern JS_PUBLIC_API(void)\nJS_CallHeapScriptTracer(JSTracer *trc, JS::Heap<JSScript *> *scriptp, const char *name);\n\ntemplate <typename HashSetEnum>\ninline void\nJS_CallHashSetObjectTracer(JSTracer *trc, HashSetEnum &e, JSObject *const &key, const char *name)\n{\n    JSObject *updated = key;\n    JS_SET_TRACING_LOCATION(trc, reinterpret_cast<void *>(&const_cast<JSObject *&>(key)));\n    JS_CallObjectTracer(trc, &updated, name);\n    if (updated != key)\n        e.rekeyFront(key, updated);\n}\n\n/*\n * Trace an object that is known to always be tenured.  No post barriers are\n * required in this case.\n */\nextern JS_PUBLIC_API(void)\nJS_CallTenuredObjectTracer(JSTracer *trc, JS::TenuredHeap<JSObject *> *objp, const char *name);\n\n/*\n * API for JSTraceCallback implementations.\n */\nextern JS_PUBLIC_API(void)\nJS_TracerInit(JSTracer *trc, JSRuntime *rt, JSTraceCallback callback);\n\nextern JS_PUBLIC_API(void)\nJS_TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind);\n\nextern JS_PUBLIC_API(void)\nJS_TraceRuntime(JSTracer *trc);\n\nextern JS_PUBLIC_API(void)\nJS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc,\n                     void *thing, JSGCTraceKind kind, JSBool includeDetails);\n\nextern JS_PUBLIC_API(const char *)\nJS_GetTraceEdgeName(JSTracer *trc, char *buffer, int bufferSize);\n\n#ifdef DEBUG\n\n/*\n * DEBUG-only method to dump the object graph of heap-allocated things.\n *\n * fp:              file for the dump output.\n * start:           when non-null, dump only things reachable from start\n *                  thing. Otherwise dump all things reachable from the\n *                  runtime roots.\n * startKind:       trace kind of start if start is not null. Must be\n *                  JSTRACE_OBJECT when start is null.\n * thingToFind:     dump only paths in the object graph leading to thingToFind\n *                  when non-null.\n * maxDepth:        the upper bound on the number of edges to descend from the\n *                  graph roots.\n * thingToIgnore:   thing to ignore during the graph traversal when non-null.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DumpHeap(JSRuntime *rt, FILE *fp, void* startThing, JSGCTraceKind kind,\n            void *thingToFind, size_t maxDepth, void *thingToIgnore);\n\n#endif\n\n/*\n * Garbage collector API.\n */\nextern JS_PUBLIC_API(void)\nJS_GC(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_MaybeGC(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCCallback(JSRuntime *rt, JSGCCallback cb, void *data);\n\nextern JS_PUBLIC_API(void)\nJS_SetFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsGCMarkingTracer(JSTracer *trc);\n\n/*\n * JS_IsAboutToBeFinalized checks if the given object is going to be finalized\n * at the end of the current GC. When called outside of the context of a GC,\n * this function will return false. Typically this function is used on weak\n * references, where the reference should be nulled out or destroyed if the\n * given object is about to be finalized.\n *\n * The argument to JS_IsAboutToBeFinalized is an in-out param: when the\n * function returns false, the object being referenced is still alive, but the\n * garbage collector might have moved it. In this case, the reference passed\n * to JS_IsAboutToBeFinalized will be updated to the object's new location.\n * Callers of this method are responsible for updating any state that is\n * dependent on the object's address. For example, if the object's address is\n * used as a key in a hashtable, then the object must be removed and\n * re-inserted with the correct hash.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalized(JS::Heap<JSObject *> *objp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsAboutToBeFinalizedUnbarriered(JSObject **objp);\n\ntypedef enum JSGCParamKey {\n    /* Maximum nominal heap before last ditch GC. */\n    JSGC_MAX_BYTES          = 0,\n\n    /* Number of JS_malloc bytes before last ditch GC. */\n    JSGC_MAX_MALLOC_BYTES   = 1,\n\n    /* Amount of bytes allocated by the GC. */\n    JSGC_BYTES = 3,\n\n    /* Number of times when GC was invoked. */\n    JSGC_NUMBER = 4,\n\n    /* Max size of the code cache in bytes. */\n    JSGC_MAX_CODE_CACHE_BYTES = 5,\n\n    /* Select GC mode. */\n    JSGC_MODE = 6,\n\n    /* Number of cached empty GC chunks. */\n    JSGC_UNUSED_CHUNKS = 7,\n\n    /* Total number of allocated GC chunks. */\n    JSGC_TOTAL_CHUNKS = 8,\n\n    /* Max milliseconds to spend in an incremental GC slice. */\n    JSGC_SLICE_TIME_BUDGET = 9,\n\n    /* Maximum size the GC mark stack can grow to. */\n    JSGC_MARK_STACK_LIMIT = 10,\n\n    /*\n     * GCs less than this far apart in time will be considered 'high-frequency GCs'.\n     * See setGCLastBytes in jsgc.cpp.\n     */\n    JSGC_HIGH_FREQUENCY_TIME_LIMIT = 11,\n\n    /* Start of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_LOW_LIMIT = 12,\n\n    /* End of dynamic heap growth. */\n    JSGC_HIGH_FREQUENCY_HIGH_LIMIT = 13,\n\n    /* Upper bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX = 14,\n\n    /* Lower bound of heap growth. */\n    JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN = 15,\n\n    /* Heap growth for low frequency GCs. */\n    JSGC_LOW_FREQUENCY_HEAP_GROWTH = 16,\n\n    /*\n     * If false, the heap growth factor is fixed at 3. If true, it is determined\n     * based on whether GCs are high- or low- frequency.\n     */\n    JSGC_DYNAMIC_HEAP_GROWTH = 17,\n\n    /* If true, high-frequency GCs will use a longer mark slice. */\n    JSGC_DYNAMIC_MARK_SLICE = 18,\n\n    /* Number of megabytes of analysis data to allocate before purging. */\n    JSGC_ANALYSIS_PURGE_TRIGGER = 19,\n\n    /* Lower limit after which we limit the heap growth. */\n    JSGC_ALLOCATION_THRESHOLD = 20,\n\n    /*\n     * We decommit memory lazily. If more than this number of megabytes is\n     * available to be decommitted, then JS_MaybeGC will trigger a shrinking GC\n     * to decommit it.\n     */\n    JSGC_DECOMMIT_THRESHOLD = 21\n} JSGCParamKey;\n\ntypedef enum JSGCMode {\n    /* Perform only global GCs. */\n    JSGC_MODE_GLOBAL = 0,\n\n    /* Perform per-compartment GCs until too much garbage has accumulated. */\n    JSGC_MODE_COMPARTMENT = 1,\n\n    /*\n     * Collect in short time slices rather than all at once. Implies\n     * JSGC_MODE_COMPARTMENT.\n     */\n    JSGC_MODE_INCREMENTAL = 2\n} JSGCMode;\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameter(JSRuntime *rt, JSGCParamKey key);\n\nextern JS_PUBLIC_API(void)\nJS_SetGCParameterForThread(JSContext *cx, JSGCParamKey key, uint32_t value);\n\nextern JS_PUBLIC_API(uint32_t)\nJS_GetGCParameterForThread(JSContext *cx, JSGCParamKey key);\n\n/*\n * Create a new JSString whose chars member refers to external memory, i.e.,\n * memory requiring application-specific finalization.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewExternalString(JSContext *cx, const jschar *chars, size_t length,\n                     const JSStringFinalizer *fin);\n\n/*\n * Return whether 'str' was created with JS_NewExternalString or\n * JS_NewExternalStringWithClosure.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExternalString(JSString *str);\n\n/*\n * Return the 'closure' arg passed to JS_NewExternalStringWithClosure or NULL\n * if the external string was created via JS_NewExternalString.\n */\nextern JS_PUBLIC_API(const JSStringFinalizer *)\nJS_GetExternalStringFinalizer(JSString *str);\n\n/*\n * Set the size of the native stack that should not be exceed. To disable\n * stack size checking pass 0.\n */\nextern JS_PUBLIC_API(void)\nJS_SetNativeStackQuota(JSRuntime *cx, size_t stackSize);\n\n/************************************************************************/\n\n/*\n * Classes, objects, and properties.\n */\ntypedef void (*JSClassInternal)();\n\nstruct JSClass {\n    const char          *name;\n    uint32_t            flags;\n\n    /* Mandatory function pointer members. */\n    JSPropertyOp        addProperty;\n    JSDeletePropertyOp  delProperty;\n    JSPropertyOp        getProperty;\n    JSStrictPropertyOp  setProperty;\n    JSEnumerateOp       enumerate;\n    JSResolveOp         resolve;\n    JSConvertOp         convert;\n\n    /* Optional members (may be null). */\n    JSFinalizeOp        finalize;\n    JSCheckAccessOp     checkAccess;\n    JSNative            call;\n    JSHasInstanceOp     hasInstance;\n    JSNative            construct;\n    JSTraceOp           trace;\n\n    void                *reserved[40];\n};\n\n#define JSCLASS_HAS_PRIVATE             (1<<0)  /* objects have private slot */\n#define JSCLASS_NEW_ENUMERATE           (1<<1)  /* has JSNewEnumerateOp hook */\n#define JSCLASS_NEW_RESOLVE             (1<<2)  /* has JSNewResolveOp hook */\n#define JSCLASS_PRIVATE_IS_NSISUPPORTS  (1<<3)  /* private is (nsISupports *) */\n#define JSCLASS_IS_DOMJSCLASS           (1<<4)  /* objects are DOM */\n#define JSCLASS_IMPLEMENTS_BARRIERS     (1<<5)  /* Correctly implements GC read\n                                                   and write barriers */\n#define JSCLASS_EMULATES_UNDEFINED      (1<<6)  /* objects of this class act\n                                                   like the value undefined,\n                                                   in some contexts */\n#define JSCLASS_USERBIT1                (1<<7)  /* Reserved for embeddings. */\n\n/*\n * To reserve slots fetched and stored via JS_Get/SetReservedSlot, bitwise-or\n * JSCLASS_HAS_RESERVED_SLOTS(n) into the initializer for JSClass.flags, where\n * n is a constant in [1, 255].  Reserved slots are indexed from 0 to n-1.\n */\n#define JSCLASS_RESERVED_SLOTS_SHIFT    8       /* room for 8 flags below */\n#define JSCLASS_RESERVED_SLOTS_WIDTH    8       /* and 16 above this field */\n#define JSCLASS_RESERVED_SLOTS_MASK     JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)\n#define JSCLASS_HAS_RESERVED_SLOTS(n)   (((n) & JSCLASS_RESERVED_SLOTS_MASK)  \\\n                                         << JSCLASS_RESERVED_SLOTS_SHIFT)\n#define JSCLASS_RESERVED_SLOTS(clasp)   (((clasp)->flags                      \\\n                                          >> JSCLASS_RESERVED_SLOTS_SHIFT)    \\\n                                         & JSCLASS_RESERVED_SLOTS_MASK)\n\n#define JSCLASS_HIGH_FLAGS_SHIFT        (JSCLASS_RESERVED_SLOTS_SHIFT +       \\\n                                         JSCLASS_RESERVED_SLOTS_WIDTH)\n\n#define JSCLASS_IS_ANONYMOUS            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))\n#define JSCLASS_IS_GLOBAL               (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))\n#define JSCLASS_INTERNAL_FLAG2          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))\n#define JSCLASS_INTERNAL_FLAG3          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))\n\n/* Indicate whether the proto or ctor should be frozen. */\n#define JSCLASS_FREEZE_PROTO            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))\n#define JSCLASS_FREEZE_CTOR             (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))\n\n/* Reserved for embeddings. */\n#define JSCLASS_USERBIT2                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))\n#define JSCLASS_USERBIT3                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))\n\n#define JSCLASS_BACKGROUND_FINALIZE     (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))\n\n/*\n * Bits 26 through 31 are reserved for the CACHED_PROTO_KEY mechanism, see\n * below.\n */\n\n/* Global flags. */\n#define JSGLOBAL_FLAGS_CLEARED          0x1\n\n/*\n * ECMA-262 requires that most constructors used internally create objects\n * with \"the original Foo.prototype value\" as their [[Prototype]] (__proto__)\n * member initial value.  The \"original ... value\" verbiage is there because\n * in ECMA-262, global properties naming class objects are read/write and\n * deleteable, for the most part.\n *\n * Implementing this efficiently requires that global objects have classes\n * with the following flags. Failure to use JSCLASS_GLOBAL_FLAGS was\n * prevously allowed, but is now an ES5 violation and thus unsupported.\n */\n#define JSCLASS_GLOBAL_SLOT_COUNT      (JSProto_LIMIT * 3 + 25)\n#define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n)                                    \\\n    (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))\n#define JSCLASS_GLOBAL_FLAGS                                                  \\\n    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)\n#define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp)                              \\\n  (((clasp)->flags & JSCLASS_IS_GLOBAL)                                       \\\n   && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)\n\n/* Fast access to the original value of each standard class's prototype. */\n#define JSCLASS_CACHED_PROTO_SHIFT      (JSCLASS_HIGH_FLAGS_SHIFT + 10)\n#define JSCLASS_CACHED_PROTO_WIDTH      6\n#define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)\n#define JSCLASS_HAS_CACHED_PROTO(key)   (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)\n#define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey)                         \\\n                                         (((clasp)->flags                     \\\n                                           >> JSCLASS_CACHED_PROTO_SHIFT)     \\\n                                          & JSCLASS_CACHED_PROTO_MASK))\n\n/* Initializer for unused members of statically initialized JSClass structs. */\n#define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}\n#define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS\n\nextern JS_PUBLIC_API(int)\nJS_IdArrayLength(JSContext *cx, JSIdArray *ida);\n\nextern JS_PUBLIC_API(jsid)\nJS_IdArrayGet(JSContext *cx, JSIdArray *ida, int index);\n\nextern JS_PUBLIC_API(void)\nJS_DestroyIdArray(JSContext *cx, JSIdArray *ida);\n\nnamespace JS {\n\nclass AutoIdArray : private AutoGCRooter\n{\n  public:\n    AutoIdArray(JSContext *cx, JSIdArray *ida\n                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : AutoGCRooter(cx, IDARRAY), context(cx), idArray(ida)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~AutoIdArray() {\n        if (idArray)\n            JS_DestroyIdArray(context, idArray);\n    }\n    bool operator!() {\n        return !idArray;\n    }\n    jsid operator[](size_t i) const {\n        JS_ASSERT(idArray);\n        JS_ASSERT(i < length());\n        return JS_IdArrayGet(context, idArray, i);\n    }\n    size_t length() const {\n        return JS_IdArrayLength(context, idArray);\n    }\n\n    friend void AutoGCRooter::trace(JSTracer *trc);\n\n    JSIdArray *steal() {\n        JSIdArray *copy = idArray;\n        idArray = NULL;\n        return copy;\n    }\n\n  protected:\n    inline void trace(JSTracer *trc);\n\n  private:\n    JSContext *context;\n    JSIdArray *idArray;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* No copy or assignment semantics. */\n    AutoIdArray(AutoIdArray &ida) MOZ_DELETE;\n    void operator=(AutoIdArray &ida) MOZ_DELETE;\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_ValueToId(JSContext *cx, jsval v, jsid *idp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IdToValue(JSContext *cx, jsid id, jsval *vp);\n\n/*\n * JSNewResolveOp flag bits.\n */\n#define JSRESOLVE_ASSIGNING     0x01    /* resolve on the left of assignment */\n\n/*\n * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on\n * the specified object, computing a primitive default value for the object.\n * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On\n * success the resulting value is stored in *vp.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefaultValue(JSContext *cx, JSObject *obj, JSType hint, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StrictPropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSBool strict,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id,\n                      JSBool *succeeded);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EnumerateStub(JSContext *cx, JS::Handle<JSObject*> obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ResolveStub(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ConvertStub(JSContext *cx, JS::Handle<JSObject*> obj, JSType type,\n               JS::MutableHandle<JS::Value> vp);\n\nstruct JSConstDoubleSpec {\n    double          dval;\n    const char      *name;\n    uint8_t         flags;\n    uint8_t         spare[3];\n};\n\ntypedef struct JSJitInfo JSJitInfo;\n\n/*\n * Wrappers to replace {Strict,}PropertyOp for JSPropertySpecs. This will allow\n * us to pass one JSJitInfo per function with the property spec, without\n * additional field overhead.\n */\ntypedef struct JSStrictPropertyOpWrapper {\n    JSStrictPropertyOp  op;\n    const JSJitInfo     *info;\n} JSStrictPropertyOpWrapper;\n\ntypedef struct JSPropertyOpWrapper {\n    JSPropertyOp        op;\n    const JSJitInfo     *info;\n} JSPropertyOpWrapper;\n\n/*\n * Wrapper to do as above, but for JSNatives for JSFunctionSpecs.\n */\ntypedef struct JSNativeWrapper {\n    JSNative        op;\n    const JSJitInfo *info;\n} JSNativeWrapper;\n\n/*\n * Macro static initializers which make it easy to pass no JSJitInfo as part of a\n * JSPropertySpec or JSFunctionSpec.\n */\n#define JSOP_WRAPPER(op) {op, NULL}\n#define JSOP_NULLWRAPPER JSOP_WRAPPER(NULL)\n\n/*\n * To define an array element rather than a named property member, cast the\n * element's index to (const char *) and initialize name with it, and set the\n * JSPROP_INDEX bit in flags.\n */\nstruct JSPropertySpec {\n    const char                  *name;\n    int8_t                      tinyid;\n    uint8_t                     flags;\n    JSPropertyOpWrapper         getter;\n    JSStrictPropertyOpWrapper   setter;\n};\n\nnamespace JS {\nnamespace detail {\n\n/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_NATIVE_TO only. */\ninline int CheckIsNative(JSNative native);\n\n} // namespace detail\n} // namespace JS\n\n#define JS_CAST_NATIVE_TO(v, To) \\\n  (static_cast<void>(sizeof(JS::detail::CheckIsNative(v))), \\\n   reinterpret_cast<To>(v))\n\n/*\n * JSPropertySpec uses JSAPI JSPropertyOp and JSStrictPropertyOp in function\n * signatures, but with JSPROP_NATIVE_ACCESSORS the actual values must be\n * JSNatives. To avoid widespread casting, have JS_PSG and JS_PSGS perform\n * type-safe casts.\n */\n#define JS_PSG(name, getter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_NULLWRAPPER}\n#define JS_PSGS(name, getter, setter, flags) \\\n    {name, 0, (flags) | JSPROP_SHARED | JSPROP_NATIVE_ACCESSORS, \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(getter, JSPropertyOp)), \\\n     JSOP_WRAPPER(JS_CAST_NATIVE_TO(setter, JSStrictPropertyOp))}\n#define JS_PS_END {0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}\n\n/*\n * To define a native function, set call to a JSNativeWrapper. To define a\n * self-hosted function, set selfHostedName to the name of a function\n * compiled during JSRuntime::initSelfHosting.\n */\nstruct JSFunctionSpec {\n    const char      *name;\n    JSNativeWrapper call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *selfHostedName;\n};\n\n/*\n * Terminating sentinel initializer to put at the end of a JSFunctionSpec array\n * that's passed to JS_DefineFunctions or JS_InitClass.\n */\n#define JS_FS_END JS_FS(NULL,NULL,0,0)\n\n/*\n * Initializer macros for a JSFunctionSpec array element. JS_FN (whose name\n * pays homage to the old JSNative/JSFastNative split) simply adds the flag\n * JSFUN_STUB_GSOPS. JS_FNINFO allows the simple adding of JSJitInfos.\n */\n#define JS_FS(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, flags}\n#define JS_FN(name,call,nargs,flags)                                          \\\n    {name, JSOP_WRAPPER(call), nargs, (flags) | JSFUN_STUB_GSOPS}\n#define JS_FNINFO(name,call,info,nargs,flags)                                 \\\n    {name,{call,info},nargs,flags}\n\nextern JS_PUBLIC_API(JSObject *)\nJS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n             JSClass *clasp, JSNative constructor, unsigned nargs,\n             const JSPropertySpec *ps, const JSFunctionSpec *fs,\n             const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\n/*\n * Set up ctor.prototype = proto and proto.constructor = ctor with the\n * right property flags.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_LinkConstructorAndPrototype(JSContext *cx, JSObject *ctor, JSObject *proto);\n\nextern JS_PUBLIC_API(JSClass *)\nJS_GetClass(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_InstanceOf(JSContext *cx, JSObject *obj, JSClass *clasp, jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasInstance(JSContext *cx, JSObject *obj, jsval v, JSBool *bp);\n\nextern JS_PUBLIC_API(void *)\nJS_GetPrivate(JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_SetPrivate(JSObject *obj, void *data);\n\nextern JS_PUBLIC_API(void *)\nJS_GetInstancePrivate(JSContext *cx, JSObject *obj, JSClass *clasp,\n                      jsval *argv);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> protop);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPrototype(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<JSObject*> proto);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParent(JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetParent(JSContext *cx, JSObject *obj, JSObject *parent);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetConstructor(JSContext *cx, JSObject *proto);\n\n/*\n * Get a unique identifier for obj, good for the lifetime of obj (even if it\n * is moved by a copying GC).  Return false on failure (likely out of memory),\n * and true with *idp containing the unique id on success.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetObjectId(JSContext *cx, JSObject *obj, jsid *idp);\n\nnamespace JS {\n\nenum {\n    FreshZone,\n    SystemZone,\n    SpecificZones\n};\n\ntypedef uintptr_t ZoneSpecifier;\n\ninline ZoneSpecifier\nSameZoneAs(JSObject *obj)\n{\n    JS_ASSERT(uintptr_t(obj) > SpecificZones);\n    return ZoneSpecifier(obj);\n}\n\nstruct JS_PUBLIC_API(CompartmentOptions) {\n    ZoneSpecifier zoneSpec;\n    JSVersion version;\n    bool invisibleToDebugger;\n\n    explicit CompartmentOptions() : zoneSpec(JS::FreshZone)\n                                  , version(JSVERSION_UNKNOWN)\n                                  , invisibleToDebugger(false)\n    {}\n\n    CompartmentOptions &setZone(ZoneSpecifier spec) { zoneSpec = spec; return *this; }\n    CompartmentOptions &setVersion(JSVersion version_) {\n        JS_ASSERT(version_ != JSVERSION_UNKNOWN);\n        version = version_;\n        return *this;\n    }\n\n    // Certain scopes (i.e. XBL compilation scopes) are implementation details\n    // of the embedding, and references to them should never leak out to script.\n    // This flag causes the this compartment to skip firing onNewGlobalObject\n    // and makes addDebuggee a no-op for this global.\n    CompartmentOptions &setInvisibleToDebugger(bool invisible) {\n        invisibleToDebugger = invisible;\n        return *this;\n    }\n};\n\n// During global creation, we fire notifications to callbacks registered\n// via the Debugger API. These callbacks are arbitrary script, and can touch\n// the global in arbitrary ways. When that happens, the global should not be\n// in a half-baked state. But this creates a problem for consumers that need\n// to set slots on the global to put it in a consistent state.\n//\n// This API provides a way for consumers to set slots atomically (immediately\n// after the global is created), before any debugger hooks are fired. It's\n// unfortunately on the clunky side, but that's the way the cookie crumbles.\n//\n// If callers have no additional state on the global to set up, they may pass\n// |FireOnNewGlobalHook| to JS_NewGlobalObject, which causes that function to\n// fire the hook as its final act before returning. Otherwise, callers should\n// pass |DontFireOnNewGlobalHook|, which means that they are responsible for\n// invoking JS_FireOnNewGlobalObject upon successfully creating the global. If\n// an error occurs and the operation aborts, callers should skip firing the\n// hook. But otherwise, callers must take care to fire the hook exactly once\n// before compiling any script in the global's scope (we have assertions in\n// place to enforce this). This lets us be sure that debugger clients never miss\n// breakpoints.\nenum OnNewGlobalHookOption {\n    FireOnNewGlobalHook,\n    DontFireOnNewGlobalHook\n};\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewGlobalObject(JSContext *cx, JSClass *clasp, JSPrincipals *principals,\n                   JS::OnNewGlobalHookOption hookOption,\n                   const JS::CompartmentOptions &options = JS::CompartmentOptions());\n\nextern JS_PUBLIC_API(void)\nJS_FireOnNewGlobalObject(JSContext *cx, JS::HandleObject global);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObject(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\n/* Queries the [[Extensible]] property of the object. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsExtensible(JSContext *cx, JS::HandleObject obj, JSBool *extensible);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNative(JSObject *obj);\n\nextern JS_PUBLIC_API(JSRuntime *)\nJS_GetObjectRuntime(JSObject *obj);\n\n/*\n * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default\n * proto if proto's actual parameter value is null.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,\n                           JSObject *parent);\n\n/*\n * Freeze obj, and all objects it refers to, recursively. This will not recurse\n * through non-extensible objects, on the assumption that those are already\n * deep-frozen.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DeepFreezeObject(JSContext *cx, JSObject *obj);\n\n/*\n * Freezes an object; see ES5's Object.freeze(obj) method.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_FreezeObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_PreventExtensions(JSContext *cx, JS::HandleObject obj);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_New(JSContext *cx, JSObject *ctor, unsigned argc, jsval *argv);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DefineObject(JSContext *cx, JSObject *obj, const char *name, JSClass *clasp,\n                JSObject *proto, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineConstDoubles(JSContext *cx, JSObject *obj, const JSConstDoubleSpec *cds);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperties(JSContext *cx, JSObject *obj, const JSPropertySpec *ps);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,\n                  JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,\n                      JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                   const char *name,\n                                   unsigned *attrsp, JSBool *foundp,\n                                   JSPropertyOp *getterp,\n                                   JSStrictPropertyOp *setterp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,\n                                       jsid id,\n                                       unsigned *attrsp, JSBool *foundp,\n                                       JSPropertyOp *getterp,\n                                       JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyAttributes(JSContext *cx, JSObject *obj, const char *name,\n                         unsigned attrs, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,\n                            int8_t tinyid, jsval value,\n                            JSPropertyOp getter, JSStrictPropertyOp setter,\n                            unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnProperty(JSContext *cx, JSObject *obj, const char *name,\n                         JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnPropertyById(JSContext *cx, JSObject *obj, jsid id,\n                             JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasProperty(JSContext *cx, JSObject *obj, const char *name, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasPropertyById(JSContext *cx, JSObject *obj, jsid id, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlags(JSContext *cx, JSObject *obj, const char *name,\n                           unsigned flags, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupPropertyWithFlagsById(JSContext *cx, JSObject *obj, jsid id,\n                               unsigned flags, JSObject **objp, JS::MutableHandle<JS::Value> vp);\n\nstruct JSPropertyDescriptor {\n    JSObject           *obj;\n    unsigned           attrs;\n    unsigned           shortid;\n    JSPropertyOp       getter;\n    JSStrictPropertyOp setter;\n    JS::Value          value;\n\n    JSPropertyDescriptor() : obj(NULL), attrs(0), shortid(0), getter(NULL),\n                             setter(NULL), value(JSVAL_VOID)\n    {}\n\n    void trace(JSTracer *trc);\n};\n\nnamespace JS {\n\ntemplate <typename Outer>\nclass PropertyDescriptorOperations\n{\n    const JSPropertyDescriptor * desc() const { return static_cast<const Outer*>(this)->extract(); }\n    JSPropertyDescriptor * desc() { return static_cast<Outer*>(this)->extract(); }\n\n  public:\n    bool isEnumerable() const { return desc()->attrs & JSPROP_ENUMERATE; }\n    bool isReadonly() const { return desc()->attrs & JSPROP_READONLY; }\n    bool isPermanent() const { return desc()->attrs & JSPROP_PERMANENT; }\n    bool hasNativeAccessors() const { return desc()->attrs & JSPROP_NATIVE_ACCESSORS; }\n    bool hasGetterObject() const { return desc()->attrs & JSPROP_GETTER; }\n    bool hasSetterObject() const { return desc()->attrs & JSPROP_SETTER; }\n    bool isShared() const { return desc()->attrs & JSPROP_SHARED; }\n    bool isIndex() const { return desc()->attrs & JSPROP_INDEX; }\n    bool hasShortId() const { return desc()->attrs & JSPROP_SHORTID; }\n    bool hasAttributes(unsigned attrs) const { return desc()->attrs & attrs; }\n\n    JS::MutableHandleObject object() { return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); }\n    unsigned attributes() const { return desc()->attrs; }\n    unsigned shortid() const {\n        MOZ_ASSERT(hasShortId());\n        return desc()->shortid;\n    }\n    JSPropertyOp getter() const { return desc()->getter; }\n    JSStrictPropertyOp setter() const { return desc()->setter; }\n    JS::HandleObject getterObject() const {\n        MOZ_ASSERT(hasGetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->getter));\n    }\n    JS::HandleObject setterObject() const {\n        MOZ_ASSERT(hasSetterObject());\n        return JS::HandleObject::fromMarkedLocation(reinterpret_cast<JSObject *const *>(&desc()->setter));\n    }\n    JS::MutableHandleValue value() { return JS::MutableHandleValue::fromMarkedLocation(&desc()->value); }\n\n    void setAttributes(unsigned attrs) { desc()->attrs = attrs; }\n    void setShortId(unsigned id) { desc()->shortid = id; }\n    void setGetter(JSPropertyOp op) { desc()->getter = op; }\n    void setSetter(JSStrictPropertyOp op) { desc()->setter = op; }\n    void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast<JSPropertyOp>(obj); }\n    void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast<JSStrictPropertyOp>(obj); }\n};\n\n} /* namespace JS */\n\nnamespace js {\n\ntemplate <>\nstruct GCMethods<JSPropertyDescriptor> {\n    static JSPropertyDescriptor initial() { return JSPropertyDescriptor(); }\n    static ThingRootKind kind() { return THING_ROOT_PROPERTY_DESCRIPTOR; }\n    static bool poisoned(const JSPropertyDescriptor &desc) {\n        return (desc.obj && JS::IsPoisonedPtr(desc.obj)) ||\n               (desc.attrs & JSPROP_GETTER && desc.getter && JS::IsPoisonedPtr(desc.getter)) ||\n               (desc.attrs & JSPROP_SETTER && desc.setter && JS::IsPoisonedPtr(desc.setter)) ||\n               (desc.value.isGCThing() && JS::IsPoisonedPtr(desc.value.toGCThing()));\n    }\n};\n\ntemplate <>\nclass RootedBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::Rooted<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\ntemplate <>\nclass HandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::Handle<JSPropertyDescriptor>*>(this)->address();\n    }\n  public:\n    JS::HandleValue value() const { return JS::HandleValue::fromMarkedLocation(&extract()->value); }\n    JS::HandleObject obj() const { return JS::HandleObject::fromMarkedLocation(&extract()->obj); }\n};\n\ntemplate <>\nclass MutableHandleBase<JSPropertyDescriptor>\n  : public JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >\n{\n    friend class JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;\n    const JSPropertyDescriptor *extract() const {\n        return static_cast<const JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n    JSPropertyDescriptor *extract() {\n        return static_cast<JS::MutableHandle<JSPropertyDescriptor>*>(this)->address();\n    }\n};\n\n} /* namespace js */\n\n/*\n * Like JS_GetPropertyAttrsGetterAndSetterById but will return a property on\n * an object on the prototype chain (returned in objp). If data->obj is null,\n * then this property was not found on the prototype chain.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescriptorById(JSContext *cx, JSObject *obj, jsid id, unsigned flags,\n                             JSPropertyDescriptor *desc);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetProperty(JSContext *cx, JSObject *obj, const char *name, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDefault(JSContext *cx, JSObject *obj, const char *name, jsval def,\n                      JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def,\n                          JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf,\n                        JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetProperty(JSContext *cx, JSObject *obj, const char *name, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty(JSContext *cx, JSObject *obj, const char *name);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteProperty2(JSContext *cx, JSObject *obj, const char *name,\n                   JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById(JSContext *cx, JSObject *obj, jsid id);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeletePropertyById2(JSContext *cx, JSObject *obj, jsid id, JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, jsval value,\n                    JSPropertyOp getter, JSStrictPropertyOp setter,\n                    unsigned attrs);\n\n/*\n * Determine the attributes (JSPROP_* flags) of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and the value of *attrsp is undefined.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned *attrsp, JSBool *foundp);\n\n/*\n * The same, but if the property is native, return its getter and setter via\n * *getterp and *setterp, respectively (and only if the out parameter pointer\n * is not null).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,\n                                     const jschar *name, size_t namelen,\n                                     unsigned *attrsp, JSBool *foundp,\n                                     JSPropertyOp *getterp,\n                                     JSStrictPropertyOp *setterp);\n\n/*\n * Set the attributes of a property on a given object.\n *\n * If the object does not have a property by that name, *foundp will be\n * JS_FALSE and nothing will be altered.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj,\n                           const jschar *name, size_t namelen,\n                           unsigned attrs, JSBool *foundp);\n\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,\n                              const jschar *name, size_t namelen,\n                              int8_t tinyid, jsval value,\n                              JSPropertyOp getter, JSStrictPropertyOp setter,\n                              unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnUCProperty(JSContext *cx, JSObject *obj, const jschar *name,\n                           size_t namelen, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JSBool *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupUCProperty(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen,\n                    JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::MutableHandle<JS::Value> vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetUCProperty(JSContext *cx, JSObject *obj,\n                 const jschar *name, size_t namelen,\n                 JS::Handle<JS::Value> v);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteUCProperty2(JSContext *cx, JSObject *obj,\n                     const jschar *name, size_t namelen,\n                     JS::MutableHandle<JS::Value> rval);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayObject(JSContext *cx, int length, jsval *vector);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsArrayObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,\n                 JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs);\n\nextern JS_PUBLIC_API(JSBool)\nJS_AlreadyHasOwnElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_HasElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *foundp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_LookupElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp);\n\n/*\n * Get the property with name given by |index|, if it has one.  If\n * not, |*present| will be set to false and the value of |vp| must not\n * be relied on.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32_t index, JSObject *onBehalfOf,\n                       jsval *vp, JSBool* present);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetElement(JSContext *cx, JSObject *obj, uint32_t index, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement(JSContext *cx, JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DeleteElement2(JSContext *cx, JSObject *obj, uint32_t index, jsval *rval);\n\n/*\n * Remove all configurable properties from the given (non-global) object and\n * assign undefined to all writable data properties.\n */\nJS_PUBLIC_API(void)\nJS_ClearNonGlobalObject(JSContext *cx, JSObject *objArg);\n\n/*\n * Assign 'undefined' to all of the object's non-reserved slots. Note: this is\n * done for all slots, regardless of the associated property descriptor.\n */\nJS_PUBLIC_API(void)\nJS_SetAllNonReservedSlotsToUndefined(JSContext *cx, JSObject *objArg);\n\n/*\n * Create a new array buffer with the given contents, which must have been\n * returned by JS_AllocateArrayBufferContents or JS_StealArrayBufferContents.\n * The new array buffer takes ownership. After calling this function, do not\n * free |contents| or use |contents| from another thread.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewArrayBufferWithContents(JSContext *cx, void *contents);\n\n/*\n * Steal the contents of the given array buffer. The array buffer has its\n * length set to 0 and its contents array cleared. The caller takes ownership\n * of |*contents| and must free it or transfer ownership via\n * JS_NewArrayBufferWithContents when done using it.\n * To free |*contents|, call free().\n * A pointer to the buffer's data is returned in |*data|. This pointer can\n * be used until |*contents| is freed or has its ownership transferred.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_StealArrayBufferContents(JSContext *cx, JSObject *obj, void **contents,\n                            uint8_t **data);\n\n/*\n * Allocate memory that may be eventually passed to\n * JS_NewArrayBufferWithContents. |nbytes| is the number of payload bytes\n * required. The pointer to pass to JS_NewArrayBufferWithContents is returned\n * in |contents|. The pointer to the |nbytes| of usable memory is returned in\n * |data|. (*|contents| will contain a header before |data|.) The only legal\n * operations on *|contents| is to free it, or pass it to\n * JS_NewArrayBufferWithContents or JS_ReallocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_AllocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\n/*\n * Reallocate memory allocated by JS_AllocateArrayBufferContents, growing or shrinking it\n * as appropriate.  The new data pointer will be returned in data.  If *contents is NULL,\n * behaves like JS_AllocateArrayBufferContents.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReallocateArrayBufferContents(JSContext *cx, uint32_t nbytes, void **contents, uint8_t **data);\n\nextern JS_PUBLIC_API(JSIdArray *)\nJS_Enumerate(JSContext *cx, JSObject *obj);\n\n/*\n * Create an object to iterate over enumerable properties of obj, in arbitrary\n * property definition order.  NB: This differs from longstanding for..in loop\n * order, which uses order of property definition in obj.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewPropertyIterator(JSContext *cx, JSObject *obj);\n\n/*\n * Return true on success with *idp containing the id of the next enumerable\n * property to visit using iterobj, or JSID_IS_VOID if there is no such property\n * left to visit.  Return false on error.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);\n\n/*\n * A JSNative that creates and returns a new iterator that iterates over the\n * elements of |this|, up to |this.length|, in index order. This can be used to\n * make any array-like object iterable. Just give the object an obj.iterator()\n * method using this JSNative as the implementation.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ArrayIterator(JSContext *cx, unsigned argc, jsval *vp);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,\n               jsval *vp, unsigned *attrsp);\n\nextern JS_PUBLIC_API(jsval)\nJS_GetReservedSlot(JSObject *obj, uint32_t index);\n\nextern JS_PUBLIC_API(void)\nJS_SetReservedSlot(JSObject *obj, uint32_t index, jsval v);\n\n/************************************************************************/\n\n/*\n * Security protocol.\n */\nstruct JSPrincipals {\n    /* Don't call \"destroy\"; use reference counting macros below. */\n    int refcount;\n\n#ifdef DEBUG\n    /* A helper to facilitate principals debugging. */\n    uint32_t    debugToken;\n#endif\n\n    void setDebugToken(uint32_t token) {\n# ifdef DEBUG\n        debugToken = token;\n# endif\n    }\n\n    /*\n     * This is not defined by the JS engine but should be provided by the\n     * embedding.\n     */\n    JS_PUBLIC_API(void) dump();\n};\n\nextern JS_PUBLIC_API(void)\nJS_HoldPrincipals(JSPrincipals *principals);\n\nextern JS_PUBLIC_API(void)\nJS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);\n\nstruct JSSecurityCallbacks {\n    JSCheckAccessOp            checkObjectAccess;\n    JSCSPEvalChecker           contentSecurityPolicyAllows;\n};\n\nextern JS_PUBLIC_API(void)\nJS_SetSecurityCallbacks(JSRuntime *rt, const JSSecurityCallbacks *callbacks);\n\nextern JS_PUBLIC_API(const JSSecurityCallbacks *)\nJS_GetSecurityCallbacks(JSRuntime *rt);\n\n/*\n * Code running with \"trusted\" principals will be given a deeper stack\n * allocation than ordinary scripts. This allows trusted script to run after\n * untrusted script has exhausted the stack. This function sets the\n * runtime-wide trusted principal.\n *\n * This principals is not held (via JS_HoldPrincipals/JS_DropPrincipals) since\n * there is no available JSContext. Instead, the caller must ensure that the\n * given principals stays valid for as long as 'rt' may point to it. If the\n * principals would be destroyed before 'rt', JS_SetTrustedPrincipals must be\n * called again, passing NULL for 'prin'.\n */\nextern JS_PUBLIC_API(void)\nJS_SetTrustedPrincipals(JSRuntime *rt, JSPrincipals *prin);\n\n/*\n * Initialize the callback that is called to destroy JSPrincipals instance\n * when its reference counter drops to zero. The initialization can be done\n * only once per JS runtime.\n */\nextern JS_PUBLIC_API(void)\nJS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPrincipals);\n\n/************************************************************************/\n\n/*\n * Functions and scripts.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n               JSObject *parent, const char *name);\n\n/*\n * Create the function with the name given by the id. JSID_IS_STRING(id) must\n * be true.\n */\nextern JS_PUBLIC_API(JSFunction *)\nJS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                   JSObject *parent, jsid id);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetFunctionObject(JSFunction *fun);\n\n/*\n * Return the function's identifier as a JSString, or null if fun is unnamed.\n * The returned string lives as long as fun, so you don't need to root a saved\n * reference to it if fun is well-connected or rooted, and provided you bound\n * the use of the saved reference by fun's lifetime.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionId(JSFunction *fun);\n\n/*\n * Return a function's display name. This is the defined name if one was given\n * where the function was defined, or it could be an inferred name by the JS\n * engine in the case that the function was defined to be anonymous. This can\n * still return NULL if a useful display name could not be inferred. The same\n * restrictions on rooting as those in JS_GetFunctionId apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_GetFunctionDisplayId(JSFunction *fun);\n\n/*\n * Return the arity (length) of fun.\n */\nextern JS_PUBLIC_API(uint16_t)\nJS_GetFunctionArity(JSFunction *fun);\n\n/*\n * Infallible predicate to test whether obj is a function object (faster than\n * comparing obj's class name to \"Function\", but equivalent unless someone has\n * overwritten the \"Function\" identifier with a different constructor and then\n * created instances using that constructor that might be passed in as obj).\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsFunction(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsCallable(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsNativeFunction(JSObject *funobj, JSNative call);\n\n/* Return whether the given function is a valid constructor. */\nextern JS_PUBLIC_API(JSBool)\nJS_IsConstructor(JSFunction *fun);\n\n/*\n * Bind the given callable to use the given object as \"this\".\n *\n * If |callable| is not callable, will throw and return NULL.\n */\nextern JS_PUBLIC_API(JSObject*)\nJS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);\n\nextern JS_PUBLIC_API(JSBool)\nJS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                  unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineUCFunction(JSContext *cx, JSObject *obj,\n                    const jschar *name, size_t namelen, JSNative call,\n                    unsigned nargs, unsigned attrs);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,\n                      unsigned nargs, unsigned attrs);\n\n/*\n * Clone a top-level function into a new scope. This function will dynamically\n * fail if funobj was lexically nested inside some other function.\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);\n\n/*\n * Given a buffer, return JS_FALSE if the buffer might become a valid\n * javascript statement with the addition of more lines.  Otherwise return\n * JS_TRUE.  The intent is to support interactive compilation - accumulate\n * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to\n * the compiler.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScript(JSContext *cx, JSObject *obj,\n                 const char *ascii, size_t length,\n                 const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,\n                              JSPrincipals *principals,\n                              const char *ascii, size_t length,\n                              const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScript(JSContext *cx, JSObject *obj,\n                   const jschar *chars, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_CompileUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals,\n                                const jschar *chars, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetGlobalFromScript(JSScript *script);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,\n                   unsigned nargs, const char **argnames,\n                   const char *bytes, size_t length,\n                   const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,\n                                JSPrincipals *principals, const char *name,\n                                unsigned nargs, const char **argnames,\n                                const char *bytes, size_t length,\n                                const char *filename, unsigned lineno);\n\nextern JS_PUBLIC_API(JSFunction *)\nJS_CompileUCFunction(JSContext *cx, JSObject *obj, const char *name,\n                     unsigned nargs, const char **argnames,\n                     const jschar *chars, size_t length,\n                     const char *filename, unsigned lineno);\n\nnamespace JS {\n\n/* Options for JavaScript compilation. */\nclass JS_PUBLIC_API(CompileOptions)\n{\n    JSPrincipals *principals_;\n    JSPrincipals *originPrincipals_;\n\n  public:\n    JSPrincipals *principals() const { return principals_; }\n    JSPrincipals *originPrincipals() const;\n\n    JSVersion version;\n    bool versionSet;\n    bool utf8;\n    const char *filename;\n    unsigned lineno;\n    unsigned column;\n    HandleObject element;\n    bool compileAndGo;\n    bool forEval;\n    bool noScriptRval;\n    bool selfHostingMode;\n    bool canLazilyParse;\n    bool strictOption;\n    bool extraWarningsOption;\n    bool werrorOption;\n    bool asmJSOption;\n    enum SourcePolicy {\n        NO_SOURCE,\n        LAZY_SOURCE,\n        SAVE_SOURCE\n    } sourcePolicy;\n\n    explicit CompileOptions(JSContext *cx, JSVersion version = JSVERSION_UNKNOWN);\n    CompileOptions &setPrincipals(JSPrincipals *p) { principals_ = p; return *this; }\n    CompileOptions &setOriginPrincipals(JSPrincipals *p) { originPrincipals_ = p; return *this; }\n    CompileOptions &setVersion(JSVersion v) { version = v; versionSet = true; return *this; }\n    CompileOptions &setUTF8(bool u) { utf8 = u; return *this; }\n    CompileOptions &setFileAndLine(const char *f, unsigned l) {\n        filename = f; lineno = l; return *this;\n    }\n    CompileOptions &setColumn(unsigned c) { column = c; return *this; }\n    CompileOptions &setElement(HandleObject e) { element = e; return *this; }\n    CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }\n    CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }\n    CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }\n    CompileOptions &setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }\n    CompileOptions &setCanLazilyParse(bool clp) { canLazilyParse = clp; return *this; }\n    CompileOptions &setSourcePolicy(SourcePolicy sp) { sourcePolicy = sp; return *this; }\n};\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n        const jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, FILE *file);\n\nextern JS_PUBLIC_API(JSScript *)\nCompile(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options, const char *filename);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const char *bytes, size_t length);\n\nextern JS_PUBLIC_API(JSFunction *)\nCompileFunction(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n                const char *name, unsigned nargs, const char **argnames,\n                const jschar *chars, size_t length);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * API extension: OR this into indent to avoid pretty-printing the decompiled\n * source resulting from JS_DecompileFunction{,Body}.\n */\n#define JS_DONT_PRETTY_PRINT    ((unsigned)0x8000)\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);\n\n/*\n * NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj\n * parameter as the initial scope chain header, the 'this' keyword value, and\n * the variables object (ECMA parlance for where 'var' and 'function' bind\n * names) of the execution context for script.\n *\n * Using obj as the variables object is problematic if obj's parent (which is\n * the scope chain link; see JS_SetParent and JS_NewObject) is not null: in\n * this case, variables created by 'var x = 0', e.g., go in obj, but variables\n * created by assignment to an unbound id, 'x = 0', go in the last object on\n * the scope chain linked by parent.\n *\n * ECMA calls that last scoping object the \"global object\", but note that many\n * embeddings have several such objects.  ECMA requires that \"global code\" be\n * executed with the variables object equal to this global object.  But these\n * JS API entry points provide freedom to execute code against a \"sub-global\",\n * i.e., a parented or scoped object, in which case the variables object will\n * differ from the last object on the scope chain, resulting in confusing and\n * non-ECMA explicit vs. implicit variable creation.\n *\n * Caveat embedders: unless you already depend on this buggy variables object\n * binding behavior, you should call JS_SetOptions(cx, JSOPTION_VAROBJFIX) or\n * JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_VAROBJFIX) -- the latter if\n * someone may have set other options on cx already -- for each context in the\n * application, if you pass parented objects as the obj parameter, or may ever\n * pass such objects in the future.\n *\n * Why a runtime option?  The alternative is to add six or so new API entry\n * points with signatures matching the following six, and that doesn't seem\n * worth the code bloat cost.  Such new entry points would probably have less\n * obvious names, too, so would not tend to be used.  The JS_SetOption call,\n * OTOH, can be more easily hacked into existing code that does not depend on\n * the bug; such code can continue to use the familiar JS_EvaluateScript,\n * etc., entry points.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteScriptVersion(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval,\n                        JSVersion version);\n\n/*\n * Execute either the function-defining prolog of a script, or the script's\n * main body, but not both.\n */\ntypedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart;\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScript(JSContext *cx, JSObject *obj,\n                  const char *bytes, unsigned length,\n                  const char *filename, unsigned lineno,\n                  jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,\n                               JSPrincipals *principals,\n                               const char *bytes, unsigned length,\n                               const char *filename, unsigned lineno,\n                               jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                      JSPrincipals *principals,\n                                      const char *bytes, unsigned length,\n                                      const char *filename, unsigned lineno,\n                                      jsval *rval, JSVersion version);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScript(JSContext *cx, JSObject *obj,\n                    const jschar *chars, unsigned length,\n                    const char *filename, unsigned lineno,\n                    jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipals(JSContext *cx, JSObject *obj,\n                                 JSPrincipals *principals,\n                                 const jschar *chars, unsigned length,\n                                 const char *filename, unsigned lineno,\n                                 jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersion(JSContext *cx, JSObject *obj,\n                                        JSPrincipals *principals,\n                                        const jschar *chars, unsigned length,\n                                        const char *filename, unsigned lineno,\n                                        jsval *rval, JSVersion version);\n\n/*\n * JSAPI clients may optionally specify the 'originPrincipals' of a script.\n * A script's originPrincipals may be retrieved through the debug API (via\n * JS_GetScriptOriginPrincipals) and the originPrincipals are transitively\n * assigned to any nested scripts (including scripts dynamically created via\n * eval and the Function constructor). If originPrincipals is null, then the\n * value of principals is used as origin principals for the script.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_EvaluateUCScriptForPrincipalsVersionOrigin(JSContext *cx, JSObject *obj,\n                                              JSPrincipals *principals,\n                                              JSPrincipals *originPrincipals,\n                                              const jschar *chars, unsigned length,\n                                              const char *filename, unsigned lineno,\n                                              jsval *rval, JSVersion version);\n\nnamespace JS {\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const jschar *chars, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *bytes, size_t length, jsval *rval);\n\nextern JS_PUBLIC_API(bool)\nEvaluate(JSContext *cx, JS::Handle<JSObject*> obj, CompileOptions options,\n         const char *filename, jsval *rval);\n\n} /* namespace JS */\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunction(JSContext *cx, JSObject *obj, JSFunction *fun, unsigned argc,\n                jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionName(JSContext *cx, JSObject *obj, const char *name, unsigned argc,\n                    jsval *argv, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, unsigned argc,\n                     jsval *argv, jsval *rval);\n\nnamespace JS {\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, JSFunction *fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunction(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, const char *name, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionName(cx, thisObj, name, argc, argv, rval.address());\n}\n\nstatic inline bool\nCall(JSContext *cx, JSObject *thisObj, jsval fun, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return !!JS_CallFunctionValue(cx, thisObj, fun, argc, argv, rval.address());\n}\n\nextern JS_PUBLIC_API(bool)\nCall(JSContext *cx, jsval thisv, jsval fun, unsigned argc, jsval *argv, MutableHandle<Value> rval);\n\nstatic inline bool\nCall(JSContext *cx, jsval thisv, JSObject *funObj, unsigned argc, jsval *argv,\n     MutableHandle<Value> rval)\n{\n    return Call(cx, thisv, OBJECT_TO_JSVAL(funObj), argc, argv, rval);\n}\n\n} /* namespace JS */\n\n/*\n * These functions allow setting an operation callback that will be called\n * from the JS thread some time after any thread triggered the callback using\n * JS_TriggerOperationCallback(rt).\n *\n * To schedule the GC and for other activities the engine internally triggers\n * operation callbacks. The embedding should thus not rely on callbacks being\n * triggered through the external API only.\n *\n * Important note: Additional callbacks can occur inside the callback handler\n * if it re-enters the JS engine. The embedding must ensure that the callback\n * is disconnected before attempting such re-entry.\n */\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_SetOperationCallback(JSContext *cx, JSOperationCallback callback);\n\nextern JS_PUBLIC_API(JSOperationCallback)\nJS_GetOperationCallback(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_TriggerOperationCallback(JSRuntime *rt);\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsRunning(JSContext *cx);\n\n/*\n * Saving and restoring frame chains.\n *\n * These two functions are used to set aside cx's call stack while that stack\n * is inactive. After a call to JS_SaveFrameChain, it looks as if there is no\n * code running on cx. Before calling JS_RestoreFrameChain, cx's call stack\n * must be balanced and all nested calls to JS_SaveFrameChain must have had\n * matching JS_RestoreFrameChain calls.\n *\n * JS_SaveFrameChain deals with cx not having any code running on it.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SaveFrameChain(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreFrameChain(JSContext *cx);\n\n#ifdef MOZ_TRACE_JSCALLS\n/*\n * The callback is expected to be quick and noninvasive. It should not\n * trigger interrupts, turn on debugging, or produce uncaught JS\n * exceptions. The state of the stack and registers in the context\n * cannot be relied upon, since this callback may be invoked directly\n * from either JIT. The 'entering' field means we are entering a\n * function if it is positive, leaving a function if it is zero or\n * negative.\n */\nextern JS_PUBLIC_API(void)\nJS_SetFunctionCallback(JSContext *cx, JSFunctionCallback fcb);\n\nextern JS_PUBLIC_API(JSFunctionCallback)\nJS_GetFunctionCallback(JSContext *cx);\n#endif /* MOZ_TRACE_JSCALLS */\n\n/************************************************************************/\n\n/*\n * Strings.\n *\n * NB: JS_NewUCString takes ownership of bytes on success, avoiding a copy;\n * but on error (signified by null return), it leaves chars owned by the\n * caller. So the caller must free bytes in the error case, if it has no use\n * for them. In contrast, all the JS_New*StringCopy* functions do not take\n * ownership of the character memory passed to them -- they copy it.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyN(JSContext *cx, const char *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewStringCopyZ(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternJSString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternStringN(JSContext *cx, const char *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternString(JSContext *cx, const char *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCString(JSContext *cx, jschar *chars, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyN(JSContext *cx, const jschar *s, size_t n);\n\nextern JS_PUBLIC_API(JSString *)\nJS_NewUCStringCopyZ(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCStringN(JSContext *cx, const jschar *s, size_t length);\n\nextern JS_PUBLIC_API(JSString *)\nJS_InternUCString(JSContext *cx, const jschar *s);\n\nextern JS_PUBLIC_API(JSBool)\nJS_CompareStrings(JSContext *cx, JSString *str1, JSString *str2, int32_t *result);\n\nextern JS_PUBLIC_API(JSBool)\nJS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, JSBool *match);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedString(JSContext *cx, char *buffer, size_t size, JSString *str, char quote);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FileEscapedString(FILE *fp, JSString *str, char quote);\n\n/*\n * Extracting string characters and length.\n *\n * While getting the length of a string is infallible, getting the chars can\n * fail. As indicated by the lack of a JSContext parameter, there are two\n * special cases where getting the chars is infallible:\n *\n * The first case is interned strings, i.e., strings from JS_InternString or\n * JSID_TO_STRING(id), using JS_GetInternedStringChars*.\n *\n * The second case is \"flat\" strings that have been explicitly prepared in a\n * fallible context by JS_FlattenString. To catch errors, a separate opaque\n * JSFlatString type is returned by JS_FlattenString and expected by\n * JS_GetFlatStringChars. Note, though, that this is purely a syntactic\n * distinction: the input and output of JS_FlattenString are the same actual\n * GC-thing so only one needs to be rooted. If a JSString is known to be flat,\n * JS_ASSERT_STRING_IS_FLAT can be used to make a debug-checked cast. Example:\n *\n *   // in a fallible context\n *   JSFlatString *fstr = JS_FlattenString(cx, str);\n *   if (!fstr)\n *     return JS_FALSE;\n *   JS_ASSERT(fstr == JS_ASSERT_STRING_IS_FLAT(str));\n *\n *   // in an infallible context, for the same 'str'\n *   const jschar *chars = JS_GetFlatStringChars(fstr)\n *   JS_ASSERT(chars);\n *\n * The CharsZ APIs guarantee that the returned array has a null character at\n * chars[length]. This can require additional copying so clients should prefer\n * APIs without CharsZ if possible. The infallible functions also return\n * null-terminated arrays. (There is no additional cost or non-Z alternative\n * for the infallible functions, so 'Z' is left out of the identifier.)\n */\n\nextern JS_PUBLIC_API(size_t)\nJS_GetStringLength(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringChars(JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetInternedStringCharsAndLength(JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZ(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetStringCharsZAndLength(JSContext *cx, JSString *str, size_t *length);\n\nextern JS_PUBLIC_API(JSFlatString *)\nJS_FlattenString(JSContext *cx, JSString *str);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetFlatStringChars(JSFlatString *str);\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJSID_TO_FLAT_STRING(jsid id)\n{\n    JS_ASSERT(JSID_IS_STRING(id));\n    return (JSFlatString *)(JSID_BITS(id));\n}\n\nstatic JS_ALWAYS_INLINE JSFlatString *\nJS_ASSERT_STRING_IS_FLAT(JSString *str)\n{\n    JS_ASSERT(JS_GetFlatStringChars((JSFlatString *)str));\n    return (JSFlatString *)str;\n}\n\nstatic JS_ALWAYS_INLINE JSString *\nJS_FORGET_STRING_FLATNESS(JSFlatString *fstr)\n{\n    return (JSString *)fstr;\n}\n\n/*\n * Additional APIs that avoid fallibility when given a flat string.\n */\n\nextern JS_PUBLIC_API(JSBool)\nJS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);\n\nextern JS_PUBLIC_API(size_t)\nJS_PutEscapedFlatString(char *buffer, size_t size, JSFlatString *str, char quote);\n\n/*\n * This function is now obsolete and behaves the same as JS_NewUCString.  Use\n * JS_NewUCString instead.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewGrowableString(JSContext *cx, jschar *chars, size_t length);\n\n/*\n * Create a dependent string, i.e., a string that owns no character storage,\n * but that refers to a slice of another string's chars.  Dependent strings\n * are mutable by definition, so the thread safety comments above apply.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_NewDependentString(JSContext *cx, JSString *str, size_t start,\n                      size_t length);\n\n/*\n * Concatenate two strings, possibly resulting in a rope.\n * See above for thread safety comments.\n */\nextern JS_PUBLIC_API(JSString *)\nJS_ConcatStrings(JSContext *cx, JSString *left, JSString *right);\n\n/*\n * For JS_DecodeBytes, set *dstlenp to the size of the destination buffer before\n * the call; on return, *dstlenp contains the number of jschars actually stored.\n * To determine the necessary destination buffer size, make a sizing call that\n * passes NULL for dst.\n *\n * On errors, the functions report the error. In that case, *dstlenp contains\n * the number of characters or bytes transferred so far.  If cx is NULL, no\n * error is reported on failure, and the functions simply return JS_FALSE.\n *\n * NB: This function does not store an additional zero byte or jschar after the\n * transcoded string.\n */\nJS_PUBLIC_API(JSBool)\nJS_DecodeBytes(JSContext *cx, const char *src, size_t srclen, jschar *dst,\n               size_t *dstlenp);\n\n/*\n * A variation on JS_EncodeCharacters where a null terminated string is\n * returned that you are expected to call JS_free on when done.\n */\nJS_PUBLIC_API(char *)\nJS_EncodeString(JSContext *cx, JSString *str);\n\n/*\n * Same behavior as JS_EncodeString(), but encode into UTF-8 string\n */\nJS_PUBLIC_API(char *)\nJS_EncodeStringToUTF8(JSContext *cx, JSString *str);\n\n/*\n * Get number of bytes in the string encoding (without accounting for a\n * terminating zero bytes. The function returns (size_t) -1 if the string\n * can not be encoded into bytes and reports an error using cx accordingly.\n */\nJS_PUBLIC_API(size_t)\nJS_GetStringEncodingLength(JSContext *cx, JSString *str);\n\n/*\n * Encode string into a buffer. The function does not stores an additional\n * zero byte. The function returns (size_t) -1 if the string can not be\n * encoded into bytes with no error reported. Otherwise it returns the number\n * of bytes that are necessary to encode the string. If that exceeds the\n * length parameter, the string will be cut and only length bytes will be\n * written into the buffer.\n */\nJS_PUBLIC_API(size_t)\nJS_EncodeStringToBuffer(JSContext *cx, JSString *str, char *buffer, size_t length);\n\nclass JSAutoByteString\n{\n  public:\n    JSAutoByteString(JSContext *cx, JSString *str\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : mBytes(JS_EncodeString(cx, str))\n    {\n        JS_ASSERT(cx);\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    JSAutoByteString(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : mBytes(NULL)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n\n    ~JSAutoByteString() {\n        js_free(mBytes);\n    }\n\n    /* Take ownership of the given byte array. */\n    void initBytes(char *bytes) {\n        JS_ASSERT(!mBytes);\n        mBytes = bytes;\n    }\n\n    char *encodeLatin1(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeString(cx, str);\n        return mBytes;\n    }\n\n    char *encodeLatin1(js::ContextFriendFields *cx, JSString *str);\n\n    char *encodeUtf8(JSContext *cx, JSString *str) {\n        JS_ASSERT(!mBytes);\n        JS_ASSERT(cx);\n        mBytes = JS_EncodeStringToUTF8(cx, str);\n        return mBytes;\n    }\n\n    void clear() {\n        js_free(mBytes);\n        mBytes = NULL;\n    }\n\n    char *ptr() const {\n        return mBytes;\n    }\n\n    bool operator!() const {\n        return !mBytes;\n    }\n\n    size_t length() const {\n        if (!mBytes)\n            return 0;\n        return strlen(mBytes);\n    }\n\n  private:\n    char        *mBytes;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n    /* Copy and assignment are not supported. */\n    JSAutoByteString(const JSAutoByteString &another);\n    JSAutoByteString &operator=(const JSAutoByteString &another);\n};\n\n/************************************************************************/\n/*\n * JSON functions\n */\ntypedef JSBool (* JSONWriteCallback)(const jschar *buf, uint32_t len, void *data);\n\n/*\n * JSON.stringify as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_Stringify(JSContext *cx, jsval *vp, JSObject *replacer, jsval space,\n             JSONWriteCallback callback, void *data);\n\n/*\n * JSON.parse as specified by ES5.\n */\nJS_PUBLIC_API(JSBool)\nJS_ParseJSON(JSContext *cx, const jschar *chars, uint32_t len, JS::MutableHandle<JS::Value> vp);\n\nJS_PUBLIC_API(JSBool)\nJS_ParseJSONWithReviver(JSContext *cx, const jschar *chars, uint32_t len, jsval reviver,\n                        jsval *vp);\n\n/************************************************************************/\n\n/* API for the HTML5 internal structured cloning algorithm. */\n\n/* The maximum supported structured-clone serialization format version. */\n#define JS_STRUCTURED_CLONE_VERSION 2\n\nstruct JSStructuredCloneCallbacks {\n    ReadStructuredCloneOp read;\n    WriteStructuredCloneOp write;\n    StructuredCloneErrorOp reportError;\n};\n\n/* Note: if the *data contains transferable objects, it can be read\n * only once */\nJS_PUBLIC_API(JSBool)\nJS_ReadStructuredClone(JSContext *cx, uint64_t *data, size_t nbytes,\n                       uint32_t version, jsval *vp,\n                       const JSStructuredCloneCallbacks *optionalCallbacks,\n                       void *closure);\n\n/* Note: On success, the caller is responsible for calling\n * JS_ClearStructuredClone(*datap, nbytesp). */\nJS_PUBLIC_API(JSBool)\nJS_WriteStructuredClone(JSContext *cx, jsval v, uint64_t **datap, size_t *nbytesp,\n                        const JSStructuredCloneCallbacks *optionalCallbacks,\n                        void *closure, jsval transferable);\n\nJS_PUBLIC_API(JSBool)\nJS_ClearStructuredClone(const uint64_t *data, size_t nbytes);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes,\n                                   JSBool *hasTransferable);\n\nJS_PUBLIC_API(JSBool)\nJS_StructuredClone(JSContext *cx, jsval v, jsval *vp,\n                   const JSStructuredCloneCallbacks *optionalCallbacks,\n                   void *closure);\n\n/* RAII sugar for JS_WriteStructuredClone. */\nclass JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {\n    uint64_t *data_;\n    size_t nbytes_;\n    uint32_t version_;\n\n  public:\n    JSAutoStructuredCloneBuffer()\n        : data_(NULL), nbytes_(0), version_(JS_STRUCTURED_CLONE_VERSION) {}\n\n    ~JSAutoStructuredCloneBuffer() { clear(); }\n\n    uint64_t *data() const { return data_; }\n    size_t nbytes() const { return nbytes_; }\n\n    void clear();\n\n    /* Copy some memory. It will be automatically freed by the destructor. */\n    bool copy(const uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Adopt some memory. It will be automatically freed by the destructor.\n     * data must have been allocated by the JS engine (e.g., extracted via\n     * JSAutoStructuredCloneBuffer::steal).\n     */\n    void adopt(uint64_t *data, size_t nbytes, uint32_t version=JS_STRUCTURED_CLONE_VERSION);\n\n    /*\n     * Remove the buffer so that it will not be automatically freed.\n     * After this, the caller is responsible for feeding the memory back to\n     * JSAutoStructuredCloneBuffer::adopt.\n     */\n    void steal(uint64_t **datap, size_t *nbytesp, uint32_t *versionp=NULL);\n\n    bool read(JSContext *cx, jsval *vp,\n              const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n              void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    bool write(JSContext *cx, jsval v,\n               jsval transferable,\n               const JSStructuredCloneCallbacks *optionalCallbacks=NULL,\n               void *closure=NULL);\n\n    /**\n     * Swap ownership with another JSAutoStructuredCloneBuffer.\n     */\n    void swap(JSAutoStructuredCloneBuffer &other);\n\n  private:\n    /* Copy and assignment are not supported. */\n    JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other);\n    JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other);\n};\n\n/* API for implementing custom serialization behavior (for ImageData, File, etc.) */\n\n/* The range of tag values the application may use for its own custom object types. */\n#define JS_SCTAG_USER_MIN  ((uint32_t) 0xFFFF8000)\n#define JS_SCTAG_USER_MAX  ((uint32_t) 0xFFFFFFFF)\n\n#define JS_SCERR_RECURSION 0\n#define JS_SCERR_TRANSFERABLE 1\n\nJS_PUBLIC_API(void)\nJS_SetStructuredCloneCallbacks(JSRuntime *rt, const JSStructuredCloneCallbacks *callbacks);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadUint32Pair(JSStructuredCloneReader *r, uint32_t *p1, uint32_t *p2);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadBytes(JSStructuredCloneReader *r, void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_ReadTypedArray(JSStructuredCloneReader *r, jsval *vp);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);\n\nJS_PUBLIC_API(JSBool)\nJS_WriteTypedArray(JSStructuredCloneWriter *w, jsval v);\n\n/************************************************************************/\n\n/*\n * The default locale for the ECMAScript Internationalization API\n * (Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat).\n * Note that the Internationalization API encourages clients to\n * specify their own locales.\n * The locale string remains owned by the caller.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_SetDefaultLocale(JSRuntime *rt, const char *locale);\n\n/*\n * Reset the default locale to OS defaults.\n */\nextern JS_PUBLIC_API(void)\nJS_ResetDefaultLocale(JSRuntime *rt);\n\n/*\n * Locale specific string conversion and error message callbacks.\n */\nstruct JSLocaleCallbacks {\n    JSLocaleToUpperCase     localeToUpperCase;\n    JSLocaleToLowerCase     localeToLowerCase;\n    JSLocaleCompare         localeCompare; // not used #if ENABLE_INTL_API\n    JSLocaleToUnicode       localeToUnicode;\n    JSErrorCallback         localeGetErrorMessage;\n};\n\n/*\n * Establish locale callbacks. The pointer must persist as long as the\n * JSRuntime.  Passing NULL restores the default behaviour.\n */\nextern JS_PUBLIC_API(void)\nJS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks);\n\n/*\n * Return the address of the current locale callbacks struct, which may\n * be NULL.\n */\nextern JS_PUBLIC_API(JSLocaleCallbacks *)\nJS_GetLocaleCallbacks(JSRuntime *rt);\n\n/************************************************************************/\n\n/*\n * Error reporting.\n */\n\n/*\n * Report an exception represented by the sprintf-like conversion of format\n * and its arguments.  This exception message string is passed to a pre-set\n * JSErrorReporter function (set by JS_SetErrorReporter).\n */\nextern JS_PUBLIC_API(void)\nJS_ReportError(JSContext *cx, const char *format, ...);\n\n/*\n * Use an errorNumber to retrieve the format string, args are char *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\n#ifdef va_start\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,\n                       void *userRef, const unsigned errorNumber, va_list ap);\n#endif\n\n/*\n * Use an errorNumber to retrieve the format string, args are jschar *\n */\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUC(JSContext *cx, JSErrorCallback errorCallback,\n                     void *userRef, const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(void)\nJS_ReportErrorNumberUCArray(JSContext *cx, JSErrorCallback errorCallback,\n                            void *userRef, const unsigned errorNumber,\n                            const jschar **args);\n\n/*\n * As above, but report a warning instead (JSREPORT_IS_WARNING(report.flags)).\n * Return true if there was no error trying to issue the warning, and if the\n * warning was not converted into an error due to the JSOPTION_WERROR option\n * being set, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ReportWarning(JSContext *cx, const char *format, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumber(JSContext *cx, unsigned flags,\n                             JSErrorCallback errorCallback, void *userRef,\n                             const unsigned errorNumber, ...);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportErrorFlagsAndNumberUC(JSContext *cx, unsigned flags,\n                               JSErrorCallback errorCallback, void *userRef,\n                               const unsigned errorNumber, ...);\n\n/*\n * Complain when out of memory.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportOutOfMemory(JSContext *cx);\n\n/*\n * Complain when an allocation size overflows the maximum supported limit.\n */\nextern JS_PUBLIC_API(void)\nJS_ReportAllocationOverflow(JSContext *cx);\n\nstruct JSErrorReport {\n    const char      *filename;      /* source file name, URL, etc., or null */\n    JSPrincipals    *originPrincipals; /* see 'originPrincipals' comment above */\n    unsigned        lineno;         /* source line number */\n    const char      *linebuf;       /* offending source line without final \\n */\n    const char      *tokenptr;      /* pointer to error token in linebuf */\n    const jschar    *uclinebuf;     /* unicode (original) line buffer */\n    const jschar    *uctokenptr;    /* unicode (original) token pointer */\n    unsigned        flags;          /* error/warning, etc. */\n    unsigned        errorNumber;    /* the error number, e.g. see js.msg */\n    const jschar    *ucmessage;     /* the (default) error message */\n    const jschar    **messageArgs;  /* arguments for the error message */\n    int16_t         exnType;        /* One of the JSExnType constants */\n    unsigned        column;         /* zero-based column index in line */\n};\n\n/*\n * JSErrorReport flag values.  These may be freely composed.\n */\n#define JSREPORT_ERROR      0x0     /* pseudo-flag for default case */\n#define JSREPORT_WARNING    0x1     /* reported via JS_ReportWarning */\n#define JSREPORT_EXCEPTION  0x2     /* exception was thrown */\n#define JSREPORT_STRICT     0x4     /* error or warning due to strict option */\n\n/*\n * This condition is an error in strict mode code, a warning if\n * JS_HAS_STRICT_OPTION(cx), and otherwise should not be reported at\n * all.  We check the strictness of the context's top frame's script;\n * where that isn't appropriate, the caller should do the right checks\n * itself instead of using this flag.\n */\n#define JSREPORT_STRICT_MODE_ERROR 0x8\n\n/*\n * If JSREPORT_EXCEPTION is set, then a JavaScript-catchable exception\n * has been thrown for this runtime error, and the host should ignore it.\n * Exception-aware hosts should also check for JS_IsExceptionPending if\n * JS_ExecuteScript returns failure, and signal or propagate the exception, as\n * appropriate.\n */\n#define JSREPORT_IS_WARNING(flags)      (((flags) & JSREPORT_WARNING) != 0)\n#define JSREPORT_IS_EXCEPTION(flags)    (((flags) & JSREPORT_EXCEPTION) != 0)\n#define JSREPORT_IS_STRICT(flags)       (((flags) & JSREPORT_STRICT) != 0)\n#define JSREPORT_IS_STRICT_MODE_ERROR(flags) (((flags) &                      \\\n                                              JSREPORT_STRICT_MODE_ERROR) != 0)\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_GetErrorReporter(JSContext *cx);\n\nextern JS_PUBLIC_API(JSErrorReporter)\nJS_SetErrorReporter(JSContext *cx, JSErrorReporter er);\n\n/************************************************************************/\n\n/*\n * Dates.\n */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObject(JSContext *cx, int year, int mon, int mday, int hour, int min, int sec);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewDateObjectMsec(JSContext *cx, double msec);\n\n/*\n * Infallible predicate to test whether obj is a date object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsDate(JSContext *cx, JSObject *obj);\n\n/*\n * Clears the cache of calculated local time from each Date object.\n * Call to propagate a system timezone change.\n */\nextern JS_PUBLIC_API(void)\nJS_ClearDateCaches(JSContext *cx);\n\n/************************************************************************/\n\n/*\n * Regular Expressions.\n */\n#define JSREG_FOLD      0x01    /* fold uppercase to lowercase */\n#define JSREG_GLOB      0x02    /* global exec, creates array of matches */\n#define JSREG_MULTILINE 0x04    /* treat ^ and $ as begin and end of line */\n#define JSREG_STICKY    0x08    /* only match starting at lastIndex */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObject(JSContext *cx, JSObject *obj, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(void)\nJS_SetRegExpInput(JSContext *cx, JSObject *obj, JSString *input, JSBool multiline);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRegExpStatics(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExp(JSContext *cx, JSObject *obj, JSObject *reobj, jschar *chars, size_t length,\n                 size_t *indexp, JSBool test, jsval *rval);\n\n/* RegExp interface for clients without a global object. */\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewRegExpObjectNoStatics(JSContext *cx, char *bytes, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *chars, size_t length, unsigned flags);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ExecuteRegExpNoStatics(JSContext *cx, JSObject *reobj, jschar *chars, size_t length,\n                          size_t *indexp, JSBool test, jsval *rval);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ObjectIsRegExp(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetRegExpFlags(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSString *)\nJS_GetRegExpSource(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_IsExceptionPending(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPendingException(JSContext *cx, jsval *vp);\n\nextern JS_PUBLIC_API(void)\nJS_SetPendingException(JSContext *cx, jsval v);\n\nextern JS_PUBLIC_API(void)\nJS_ClearPendingException(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ReportPendingException(JSContext *cx);\n\n/*\n * Save the current exception state.  This takes a snapshot of cx's current\n * exception state without making any change to that state.\n *\n * The returned state pointer MUST be passed later to JS_RestoreExceptionState\n * (to restore that saved state, overriding any more recent state) or else to\n * JS_DropExceptionState (to free the state struct in case it is not correct\n * or desirable to restore it).  Both Restore and Drop free the state struct,\n * so callers must stop using the pointer returned from Save after calling the\n * Release or Drop API.\n */\nextern JS_PUBLIC_API(JSExceptionState *)\nJS_SaveExceptionState(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_RestoreExceptionState(JSContext *cx, JSExceptionState *state);\n\nextern JS_PUBLIC_API(void)\nJS_DropExceptionState(JSContext *cx, JSExceptionState *state);\n\n/*\n * If the given value is an exception object that originated from an error,\n * the exception will contain an error report struct, and this API will return\n * the address of that struct.  Otherwise, it returns NULL.  The lifetime of\n * the error report struct that might be returned is the same as the lifetime\n * of the exception object.\n */\nextern JS_PUBLIC_API(JSErrorReport *)\nJS_ErrorFromException(JSContext *cx, jsval v);\n\n/*\n * Given a reported error's message and JSErrorReport struct pointer, throw\n * the corresponding exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowReportedError(JSContext *cx, const char *message,\n                      JSErrorReport *reportp);\n\n/*\n * Throws a StopIteration exception on cx.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_ThrowStopIteration(JSContext *cx);\n\nextern JS_PUBLIC_API(intptr_t)\nJS_GetCurrentThread();\n\n/*\n * A JS runtime always has an \"owner thread\". The owner thread is set when the\n * runtime is created (to the current thread) and practically all entry points\n * into the JS engine check that a runtime (or anything contained in the\n * runtime: context, compartment, object, etc) is only touched by its owner\n * thread. Embeddings may check this invariant outside the JS engine by calling\n * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for\n * non-debug builds).\n *\n * It is possible to \"move\" a runtime between threads. This is accomplished by\n * calling JS_ClearRuntimeThread on a runtime's owner thread and then calling\n * JS_SetRuntimeThread on the new owner thread. The runtime must not be\n * accessed between JS_ClearRuntimeThread and JS_SetRuntimeThread. Also, the\n * caller is responsible for synchronizing the calls to Set/Clear.\n */\n\nextern JS_PUBLIC_API(void)\nJS_AbortIfWrongThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_ClearRuntimeThread(JSRuntime *rt);\n\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeThread(JSRuntime *rt);\n\nclass JSAutoSetRuntimeThread\n{\n    JSRuntime *runtime_;\n\n  public:\n    JSAutoSetRuntimeThread(JSRuntime *runtime) : runtime_(runtime) {\n        JS_SetRuntimeThread(runtime_);\n    }\n\n    ~JSAutoSetRuntimeThread() {\n        JS_ClearRuntimeThread(runtime_);\n    }\n};\n\n/************************************************************************/\n\n/*\n * JS_IsConstructing must be called from within a native given the\n * native's original cx and vp arguments. If JS_IsConstructing is true,\n * JS_THIS must not be used; the constructor should construct and return a\n * new object. Otherwise, the native is called as an ordinary function and\n * JS_THIS may be used.\n */\nstatic JS_ALWAYS_INLINE JSBool\nJS_IsConstructing(JSContext *cx, const jsval *vp)\n{\n#ifdef DEBUG\n    JSObject *callee = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));\n    if (JS_ObjectIsFunction(cx, callee)) {\n        JSFunction *fun = JS_ValueToFunction(cx, JS_CALLEE(cx, vp));\n        JS_ASSERT(JS_IsConstructor(fun));\n    } else {\n        JS_ASSERT(JS_GetClass(callee)->construct != NULL);\n    }\n#else\n    (void)cx;\n#endif\n\n    return JSVAL_IS_MAGIC_IMPL(JSVAL_TO_IMPL(vp[1]));\n}\n\n/*\n * A constructor can request that the JS engine create a default new 'this'\n * object of the given class, using the callee to determine parentage and\n * [[Prototype]].\n */\nextern JS_PUBLIC_API(JSObject *)\nJS_NewObjectForConstructor(JSContext *cx, JSClass *clasp, const jsval *vp);\n\n/************************************************************************/\n\n#ifdef JS_GC_ZEAL\n#define JS_DEFAULT_ZEAL_FREQ 100\n\nextern JS_PUBLIC_API(void)\nJS_SetGCZeal(JSContext *cx, uint8_t zeal, uint32_t frequency);\n\nextern JS_PUBLIC_API(void)\nJS_ScheduleGC(JSContext *cx, uint32_t count);\n#endif\n\nextern JS_PUBLIC_API(void)\nJS_SetParallelCompilationEnabled(JSContext *cx, bool enabled);\n\ntypedef enum JSCompilerOption {\n    JSCOMPILER_BASELINE_USECOUNT_TRIGGER,\n    JSCOMPILER_ION_USECOUNT_TRIGGER,\n    JSCOMPILER_PJS_ENABLE\n} JSCompilerOption;\n\nextern JS_PUBLIC_API(void)\nJS_SetGlobalCompilerOption(JSContext *cx, JSCompilerOption opt, uint32_t value);\n\n/*\n * Convert a uint32_t index into a jsid.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IndexToId(JSContext *cx, uint32_t index, jsid *id);\n\n/*\n * Convert chars into a jsid.\n *\n * |chars| may not be an index.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_CharsToId(JSContext* cx, JS::TwoByteChars chars, jsid *idp);\n\n/*\n *  Test if the given string is a valid ECMAScript identifier\n */\nextern JS_PUBLIC_API(JSBool)\nJS_IsIdentifier(JSContext *cx, JSString *str, JSBool *isIdentifier);\n\n/*\n * Return the current script and line number of the most currently running\n * frame. Returns true if a scripted frame was found, false otherwise.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DescribeScriptedCaller(JSContext *cx, JSScript **script, unsigned *lineno);\n\n\n/*\n * Encode/Decode interpreted scripts and functions to/from memory.\n */\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeScript(JSContext *cx, JSScript *script, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(void *)\nJS_EncodeInterpretedFunction(JSContext *cx, JSObject *funobj, uint32_t *lengthp);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_DecodeScript(JSContext *cx, const void *data, uint32_t length,\n                JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length,\n                             JSPrincipals *principals, JSPrincipals *originPrincipals);\n\nnamespace JS {\n\nextern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;\nextern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;\n\nextern JS_PUBLIC_DATA(const HandleId) JSID_VOIDHANDLE;\nextern JS_PUBLIC_DATA(const HandleId) JSID_EMPTYHANDLE;\n\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Import some JS:: names into the js namespace so we can make unqualified\n * references to them.\n */\n\nusing JS::Value;\nusing JS::IsPoisonedValue;\nusing JS::NullValue;\nusing JS::UndefinedValue;\nusing JS::Int32Value;\nusing JS::DoubleValue;\nusing JS::StringValue;\nusing JS::BooleanValue;\nusing JS::ObjectValue;\nusing JS::MagicValue;\nusing JS::NumberValue;\nusing JS::ObjectOrNullValue;\nusing JS::PrivateValue;\nusing JS::PrivateUint32Value;\n\nusing JS::IsPoisonedPtr;\nusing JS::IsPoisonedId;\n\nusing JS::StableCharPtr;\nusing JS::TwoByteChars;\nusing JS::Latin1CharsZ;\n\nusing JS::AutoIdVector;\nusing JS::AutoValueVector;\nusing JS::AutoObjectVector;\nusing JS::AutoFunctionVector;\nusing JS::AutoScriptVector;\nusing JS::AutoIdArray;\n\nusing JS::AutoGCRooter;\nusing JS::AutoArrayRooter;\nusing JS::AutoVectorRooter;\nusing JS::AutoHashMapRooter;\nusing JS::AutoHashSetRooter;\n\nusing JS::CallArgs;\nusing JS::IsAcceptableThis;\nusing JS::NativeImpl;\nusing JS::CallReceiver;\nusing JS::CompileOptions;\nusing JS::CallNonGenericMethod;\n\nusing JS::Rooted;\nusing JS::RootedObject;\nusing JS::RootedModule;\nusing JS::RootedFunction;\nusing JS::RootedScript;\nusing JS::RootedString;\nusing JS::RootedId;\nusing JS::RootedValue;\n\nusing JS::Handle;\nusing JS::HandleObject;\nusing JS::HandleModule;\nusing JS::HandleFunction;\nusing JS::HandleScript;\nusing JS::HandleString;\nusing JS::HandleId;\nusing JS::HandleValue;\n\nusing JS::MutableHandle;\nusing JS::MutableHandleObject;\nusing JS::MutableHandleFunction;\nusing JS::MutableHandleScript;\nusing JS::MutableHandleString;\nusing JS::MutableHandleId;\nusing JS::MutableHandleValue;\n\nusing JS::Zone;\n\n} /* namespace js */\n\n#endif /* jsapi_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsclass.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclass_h\n#define jsclass_h\n/*\n * A JSClass acts as a vtable for JS objects that allows JSAPI clients to\n * control various aspects of the behavior of an object like property lookup.\n * js::Class is an engine-private extension that allows more control over\n * object behavior and, e.g., allows custom slow layout.\n */\n\n#include \"jsapi.h\"\n#include \"jsprvtd.h\"\n\nnamespace js {\n\nclass PropertyName;\nclass SpecialId;\nclass PropertyId;\n\n// This is equal to JSFunction::class_.  Use it in places where you don't want\n// to #include jsfun.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionClassPtr;\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid);\n\n/*\n * We partition the ways to refer to a property into three: by an index\n * (uint32_t); by a string whose characters do not represent an index\n * (PropertyName, see vm/String.h); and by various special values.\n *\n * Special values are encoded using SpecialId, which is layout-compatible but\n * non-interconvertible with jsid.  A SpecialId is used for JSID_VOID, which\n * does not occur in JS scripts but may be used to indicate the absence of a\n * valid identifier.  In the future, a SpecialId may also be an object used by\n * Harmony-proposed private names.\n */\nclass SpecialId\n{\n    uintptr_t bits_;\n\n    /* Needs access to raw bits. */\n    friend JS_ALWAYS_INLINE jsid SPECIALID_TO_JSID(const SpecialId &sid);\n    friend class PropertyId;\n\n    static const uintptr_t TYPE_VOID = JSID_TYPE_VOID;\n    static const uintptr_t TYPE_OBJECT = JSID_TYPE_OBJECT;\n    static const uintptr_t TYPE_MASK = JSID_TYPE_MASK;\n\n    SpecialId(uintptr_t bits) : bits_(bits) { }\n\n  public:\n    SpecialId() : bits_(TYPE_VOID) { }\n\n    /* Object-valued */\n\n    SpecialId(JSObject &obj)\n      : bits_(uintptr_t(&obj) | TYPE_OBJECT)\n    {\n        JS_ASSERT(&obj != NULL);\n        JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);\n    }\n\n    bool isObject() const {\n        return (bits_ & TYPE_MASK) == TYPE_OBJECT && bits_ != TYPE_OBJECT;\n    }\n\n    JSObject *toObject() const {\n        JS_ASSERT(isObject());\n        return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);\n    }\n\n    /* Empty */\n\n    static SpecialId empty() {\n        SpecialId sid(TYPE_OBJECT);\n        JS_ASSERT(sid.isEmpty());\n        return sid;\n    }\n\n    bool isEmpty() const {\n        return bits_ == TYPE_OBJECT;\n    }\n\n    /* Void */\n\n    static SpecialId voidId() {\n        SpecialId sid(TYPE_VOID);\n        JS_ASSERT(sid.isVoid());\n        return sid;\n    }\n\n    bool isVoid() const {\n        return bits_ == TYPE_VOID;\n    }\n};\n\nstatic JS_ALWAYS_INLINE jsid\nSPECIALID_TO_JSID(const SpecialId &sid)\n{\n    jsid id;\n    JSID_BITS(id) = sid.bits_;\n    JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());\n    JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));\n    JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));\n    return id;\n}\n\nstatic JS_ALWAYS_INLINE bool\nJSID_IS_SPECIAL(jsid id)\n{\n    return JSID_IS_OBJECT(id) || JSID_IS_EMPTY(id) || JSID_IS_VOID(id);\n}\n\nstatic JS_ALWAYS_INLINE SpecialId\nJSID_TO_SPECIALID(jsid id)\n{\n    JS_ASSERT(JSID_IS_SPECIAL(id));\n    if (JSID_IS_OBJECT(id))\n        return SpecialId(*JSID_TO_OBJECT(id));\n    if (JSID_IS_EMPTY(id))\n        return SpecialId::empty();\n    JS_ASSERT(JSID_IS_VOID(id));\n    return SpecialId::voidId();\n}\n\ntypedef JS::Handle<SpecialId> HandleSpecialId;\n\n/* js::Class operation signatures. */\n\ntypedef JSBool\n(* LookupGenericOp)(JSContext *cx, HandleObject obj, HandleId id,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupPropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name,\n                 MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupElementOp)(JSContext *cx, HandleObject obj, uint32_t index,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* LookupSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid,\n                    MutableHandleObject objp, MutableHandleShape propp);\ntypedef JSBool\n(* DefineGenericOp)(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefinePropOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, HandleValue value,\n                 PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineElementOp)(JSContext *cx, HandleObject obj, uint32_t index, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* DefineSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\ntypedef JSBool\n(* GenericIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp);\ntypedef JSBool\n(* PropertyIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandlePropertyName name, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp);\ntypedef JSBool\n(* ElementIfPresentOp)(JSContext *cx, HandleObject obj, HandleObject receiver, uint32_t index, MutableHandleValue vp, bool* present);\ntypedef JSBool\n(* SpecialIdOp)(JSContext *cx, HandleObject obj, HandleObject receiver, HandleSpecialId sid, MutableHandleValue vp);\ntypedef JSBool\n(* StrictGenericIdOp)(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictPropertyIdOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictElementIdOp)(JSContext *cx, HandleObject obj, uint32_t index, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* StrictSpecialIdOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, MutableHandleValue vp, JSBool strict);\ntypedef JSBool\n(* GenericAttributesOp)(JSContext *cx, HandleObject obj, HandleId id, unsigned *attrsp);\ntypedef JSBool\n(* PropertyAttributesOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, unsigned *attrsp);\ntypedef JSBool\n(* ElementAttributesOp)(JSContext *cx, HandleObject obj, uint32_t index, unsigned *attrsp);\ntypedef JSBool\n(* SpecialAttributesOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, unsigned *attrsp);\ntypedef JSBool\n(* DeletePropertyOp)(JSContext *cx, HandleObject obj, HandlePropertyName name, JSBool *succeeded);\ntypedef JSBool\n(* DeleteElementOp)(JSContext *cx, HandleObject obj, uint32_t index, JSBool *succeeded);\ntypedef JSBool\n(* DeleteSpecialOp)(JSContext *cx, HandleObject obj, HandleSpecialId sid, JSBool *succeeded);\n\n\ntypedef JSObject *\n(* ObjectOp)(JSContext *cx, HandleObject obj);\ntypedef void\n(* FinalizeOp)(FreeOp *fop, JSObject *obj);\n\n#define JS_CLASS_MEMBERS                                                      \\\n    const char          *name;                                                \\\n    uint32_t            flags;                                                \\\n                                                                              \\\n    /* Mandatory function pointer members. */                                 \\\n    JSPropertyOp        addProperty;                                          \\\n    JSDeletePropertyOp  delProperty;                                          \\\n    JSPropertyOp        getProperty;                                          \\\n    JSStrictPropertyOp  setProperty;                                          \\\n    JSEnumerateOp       enumerate;                                            \\\n    JSResolveOp         resolve;                                              \\\n    JSConvertOp         convert;                                              \\\n                                                                              \\\n    /* Optional members (may be null). */                                     \\\n    FinalizeOp          finalize;                                             \\\n    JSCheckAccessOp     checkAccess;                                          \\\n    JSNative            call;                                                 \\\n    JSHasInstanceOp     hasInstance;                                          \\\n    JSNative            construct;                                            \\\n    JSTraceOp           trace\n\n/*\n * The helper struct to measure the size of JS_CLASS_MEMBERS to know how much\n * we have to pad js::Class to match the size of JSClass.\n */\nstruct ClassSizeMeasurement\n{\n    JS_CLASS_MEMBERS;\n};\n\nstruct ClassExtension\n{\n    JSObjectOp          outerObject;\n    JSObjectOp          innerObject;\n    JSIteratorOp        iteratorObject;\n\n    /*\n     * isWrappedNative is true only if the class is an XPCWrappedNative.\n     * WeakMaps use this to override the wrapper disposal optimization.\n     */\n    bool                isWrappedNative;\n\n    /*\n     * If an object is used as a key in a weakmap, it may be desirable for the\n     * garbage collector to keep that object around longer than it otherwise\n     * would. A common case is when the key is a wrapper around an object in\n     * another compartment, and we want to avoid collecting the wrapper (and\n     * removing the weakmap entry) as long as the wrapped object is alive. In\n     * that case, the wrapped object is returned by the wrapper's\n     * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap\n     * key, it will not be collected (and remain in the weakmap) until the\n     * wrapped object is collected.\n     */\n    JSWeakmapKeyDelegateOp weakmapKeyDelegateOp;\n};\n\n#define JS_NULL_CLASS_EXT   {NULL,NULL,NULL,false,NULL}\n\nstruct ObjectOps\n{\n    LookupGenericOp     lookupGeneric;\n    LookupPropOp        lookupProperty;\n    LookupElementOp     lookupElement;\n    LookupSpecialOp     lookupSpecial;\n    DefineGenericOp     defineGeneric;\n    DefinePropOp        defineProperty;\n    DefineElementOp     defineElement;\n    DefineSpecialOp     defineSpecial;\n    GenericIdOp         getGeneric;\n    PropertyIdOp        getProperty;\n    ElementIdOp         getElement;\n    ElementIfPresentOp  getElementIfPresent; /* can be null */\n    SpecialIdOp         getSpecial;\n    StrictGenericIdOp   setGeneric;\n    StrictPropertyIdOp  setProperty;\n    StrictElementIdOp   setElement;\n    StrictSpecialIdOp   setSpecial;\n    GenericAttributesOp getGenericAttributes;\n    PropertyAttributesOp getPropertyAttributes;\n    ElementAttributesOp getElementAttributes;\n    SpecialAttributesOp getSpecialAttributes;\n    GenericAttributesOp setGenericAttributes;\n    PropertyAttributesOp setPropertyAttributes;\n    ElementAttributesOp setElementAttributes;\n    SpecialAttributesOp setSpecialAttributes;\n    DeletePropertyOp    deleteProperty;\n    DeleteElementOp     deleteElement;\n    DeleteSpecialOp     deleteSpecial;\n\n    JSNewEnumerateOp    enumerate;\n    ObjectOp            thisObject;\n};\n\n#define JS_NULL_OBJECT_OPS                                                    \\\n    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,   \\\n     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,        \\\n     NULL,NULL,NULL}\n\nstruct Class\n{\n    JS_CLASS_MEMBERS;\n    ClassExtension      ext;\n    ObjectOps           ops;\n    uint8_t             pad[sizeof(JSClass) - sizeof(ClassSizeMeasurement) -\n                            sizeof(ClassExtension) - sizeof(ObjectOps)];\n\n    /* Class is not native and its map is not a scope. */\n    static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;\n\n    bool isNative() const {\n        return !(flags & NON_NATIVE);\n    }\n\n    bool hasPrivate() const {\n        return !!(flags & JSCLASS_HAS_PRIVATE);\n    }\n\n    bool emulatesUndefined() const {\n        return flags & JSCLASS_EMULATES_UNDEFINED;\n    }\n\n    bool isCallable() const {\n        return this == js::FunctionClassPtr || call;\n    }\n\n    static size_t offsetOfFlags() { return offsetof(Class, flags); }\n};\n\nJS_STATIC_ASSERT(offsetof(JSClass, name) == offsetof(Class, name));\nJS_STATIC_ASSERT(offsetof(JSClass, flags) == offsetof(Class, flags));\nJS_STATIC_ASSERT(offsetof(JSClass, addProperty) == offsetof(Class, addProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, delProperty) == offsetof(Class, delProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, getProperty) == offsetof(Class, getProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, setProperty) == offsetof(Class, setProperty));\nJS_STATIC_ASSERT(offsetof(JSClass, enumerate) == offsetof(Class, enumerate));\nJS_STATIC_ASSERT(offsetof(JSClass, resolve) == offsetof(Class, resolve));\nJS_STATIC_ASSERT(offsetof(JSClass, convert) == offsetof(Class, convert));\nJS_STATIC_ASSERT(offsetof(JSClass, finalize) == offsetof(Class, finalize));\nJS_STATIC_ASSERT(offsetof(JSClass, checkAccess) == offsetof(Class, checkAccess));\nJS_STATIC_ASSERT(offsetof(JSClass, call) == offsetof(Class, call));\nJS_STATIC_ASSERT(offsetof(JSClass, construct) == offsetof(Class, construct));\nJS_STATIC_ASSERT(offsetof(JSClass, hasInstance) == offsetof(Class, hasInstance));\nJS_STATIC_ASSERT(offsetof(JSClass, trace) == offsetof(Class, trace));\nJS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));\n\nstatic JS_ALWAYS_INLINE JSClass *\nJsvalify(Class *c)\n{\n    return (JSClass *)c;\n}\nstatic JS_ALWAYS_INLINE const JSClass *\nJsvalify(const Class *c)\n{\n    return (const JSClass *)c;\n}\n\nstatic JS_ALWAYS_INLINE Class *\nValueify(JSClass *c)\n{\n    return (Class *)c;\n}\nstatic JS_ALWAYS_INLINE const Class *\nValueify(const JSClass *c)\n{\n    return (const Class *)c;\n}\n\n/*\n * Enumeration describing possible values of the [[Class]] internal property\n * value of objects.\n */\nenum ESClassValue {\n    ESClass_Array, ESClass_Number, ESClass_String, ESClass_Boolean,\n    ESClass_RegExp, ESClass_ArrayBuffer, ESClass_Date\n};\n\n/*\n * Return whether the given object has the given [[Class]] internal property\n * value. Beware, this query says nothing about the js::Class of the JSObject\n * so the caller must not assume anything about obj's representation (e.g., obj\n * may be a proxy).\n */\ninline bool\nObjectClassIs(JSObject &obj, ESClassValue classValue, JSContext *cx);\n\n/* Just a helper that checks v.isObject before calling ObjectClassIs. */\ninline bool\nIsObjectWithClass(const Value &v, ESClassValue classValue, JSContext *cx);\n\ninline bool\nIsPoisonedSpecialId(js::SpecialId iden)\n{\n    if (iden.isObject())\n        return IsPoisonedPtr(iden.toObject());\n    return false;\n}\n\ntemplate <> struct GCMethods<SpecialId>\n{\n    static SpecialId initial() { return SpecialId(); }\n    static ThingRootKind kind() { return THING_ROOT_ID; }\n    static bool poisoned(SpecialId id) { return IsPoisonedSpecialId(id); }\n};\n\n}  /* namespace js */\n\n#endif  /* jsclass_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsclist.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsclist_h\n#define jsclist_h\n\n#include \"jstypes.h\"\n\n/*\n** Circular linked list\n*/\ntypedef struct JSCListStr {\n    struct JSCListStr *next;\n    struct JSCListStr *prev;\n} JSCList;\n\n/*\n** Insert element \"_e\" into the list, before \"_l\".\n*/\n#define JS_INSERT_BEFORE(_e,_l)  \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l);       \\\n        (_e)->prev = (_l)->prev; \\\n        (_l)->prev->next = (_e); \\\n        (_l)->prev = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Insert element \"_e\" into the list, after \"_l\".\n*/\n#define JS_INSERT_AFTER(_e,_l)   \\\n    JS_BEGIN_MACRO               \\\n        (_e)->next = (_l)->next; \\\n        (_e)->prev = (_l);       \\\n        (_l)->next->prev = (_e); \\\n        (_l)->next = (_e);       \\\n    JS_END_MACRO\n\n/*\n** Return the element following element \"_e\"\n*/\n#define JS_NEXT_LINK(_e)         \\\n        ((_e)->next)\n/*\n** Return the element preceding element \"_e\"\n*/\n#define JS_PREV_LINK(_e)         \\\n        ((_e)->prev)\n\n/*\n** Append an element \"_e\" to the end of the list \"_l\"\n*/\n#define JS_APPEND_LINK(_e,_l) JS_INSERT_BEFORE(_e,_l)\n\n/*\n** Insert an element \"_e\" at the head of the list \"_l\"\n*/\n#define JS_INSERT_LINK(_e,_l) JS_INSERT_AFTER(_e,_l)\n\n/* Return the head/tail of the list */\n#define JS_LIST_HEAD(_l) (_l)->next\n#define JS_LIST_TAIL(_l) (_l)->prev\n\n/*\n** Remove the element \"_e\" from it's circular list.\n*/\n#define JS_REMOVE_LINK(_e)             \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n    JS_END_MACRO\n\n/*\n** Remove the element \"_e\" from it's circular list. Also initializes the\n** linkage.\n*/\n#define JS_REMOVE_AND_INIT_LINK(_e)    \\\n    JS_BEGIN_MACRO                     \\\n        (_e)->prev->next = (_e)->next; \\\n        (_e)->next->prev = (_e)->prev; \\\n        (_e)->next = (_e);             \\\n        (_e)->prev = (_e);             \\\n    JS_END_MACRO\n\n/*\n** Return non-zero if the given circular list \"_l\" is empty, zero if the\n** circular list is not empty\n*/\n#define JS_CLIST_IS_EMPTY(_l) \\\n    ((_l)->next == (_l))\n\n/*\n** Initialize a circular list\n*/\n#define JS_INIT_CLIST(_l)  \\\n    JS_BEGIN_MACRO         \\\n        (_l)->next = (_l); \\\n        (_l)->prev = (_l); \\\n    JS_END_MACRO\n\n#define JS_INIT_STATIC_CLIST(_l) \\\n    {(_l), (_l)}\n\n#endif /* jsclist_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jscpucfg.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jscpucfg_h\n#define jscpucfg_h\n\n#define JS_HAVE_LONG_LONG\n\n#if defined(_WIN64)\n\n# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n#  define JS_BYTES_PER_WORD   8\n#  define JS_BITS_PER_WORD_LOG2   6\n# else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n#  error \"CPU type is unknown\"\n# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */\n\n#elif defined(_WIN32) || defined(XP_OS2)\n\n# ifdef __WATCOMC__\n#  define HAVE_VA_LIST_AS_ARRAY 1\n# endif\n\n# define IS_LITTLE_ENDIAN 1\n# undef  IS_BIG_ENDIAN\n# define JS_BYTES_PER_WORD   4\n# define JS_BITS_PER_WORD_LOG2   5\n\n#elif defined(__APPLE__)\n# if __LITTLE_ENDIAN__\n#  define IS_LITTLE_ENDIAN 1\n#  undef  IS_BIG_ENDIAN\n# elif __BIG_ENDIAN__\n#  undef  IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# endif\n\n#elif defined(JS_HAVE_ENDIAN_H)\n# include <endian.h>\n\n# if defined(__BYTE_ORDER)\n#  if __BYTE_ORDER == __LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif __BYTE_ORDER == __BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(__BYTE_ORDER) */\n#  error \"endian.h does not define __BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n/* BSDs */\n#elif defined(JS_HAVE_MACHINE_ENDIAN_H)\n# include <sys/types.h>\n# include <machine/endian.h>\n\n# if defined(_BYTE_ORDER)\n#  if _BYTE_ORDER == _LITTLE_ENDIAN\n#   define IS_LITTLE_ENDIAN 1\n#   undef  IS_BIG_ENDIAN\n#  elif _BYTE_ORDER == _BIG_ENDIAN\n#   undef  IS_LITTLE_ENDIAN\n#   define IS_BIG_ENDIAN 1\n#  endif\n# else /* !defined(_BYTE_ORDER) */\n#  error \"machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness.\"\n# endif\n\n#elif defined(JS_HAVE_SYS_ISA_DEFS_H)\n# include <sys/isa_defs.h>\n\n# if defined(_BIG_ENDIAN)\n#  undef IS_LITTLE_ENDIAN\n#  define IS_BIG_ENDIAN 1\n# elif defined(_LITTLE_ENDIAN)\n#  define IS_LITTLE_ENDIAN 1\n#  undef IS_BIG_ENDIAN\n# else /* !defined(_LITTLE_ENDIAN) */\n#  error \"sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness.\"\n# endif\n# if !defined(JS_STACK_GROWTH_DIRECTION)\n#  if defined(_STACK_GROWS_UPWARD)\n#   define JS_STACK_GROWTH_DIRECTION (1)\n#  elif defined(_STACK_GROWS_DOWNWARD)\n#   define JS_STACK_GROWTH_DIRECTION (-1)\n#  endif\n# endif\n\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(_BIG_ENDIAN)\n/* IA64 running HP-UX will have _BIG_ENDIAN defined.\n * IA64 running Linux will have endian.h and be handled above.\n */\n# undef IS_LITTLE_ENDIAN\n# define IS_BIG_ENDIAN 1\n\n#else /* !defined(__sparc) && !defined(__sparc__) && ... */\n# error \"Cannot determine endianness of your platform. Please add support to jscpucfg.h.\"\n#endif\n\n#ifndef JS_STACK_GROWTH_DIRECTION\n# ifdef __hppa\n#  define JS_STACK_GROWTH_DIRECTION (1)\n# else\n#  define JS_STACK_GROWTH_DIRECTION (-1)\n# endif\n#endif\n\n#endif /* jscpucfg_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsdbgapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsdbgapi_h\n#define jsdbgapi_h\n/*\n * JS debugger API.\n */\n\n#include \"jsprvtd.h\"\n\nnamespace JS {\n\nstruct FrameDescription\n{\n    JSScript *script;\n    unsigned lineno;\n    JSFunction *fun;\n};\n\nstruct StackDescription\n{\n    unsigned nframes;\n    FrameDescription *frames;\n};\n\nextern JS_PUBLIC_API(StackDescription *)\nDescribeStack(JSContext *cx, unsigned maxFrames);\n\nextern JS_PUBLIC_API(void)\nFreeStackDescription(JSContext *cx, StackDescription *desc);\n\nextern JS_PUBLIC_API(char *)\nFormatStackDump(JSContext *cx, char *buf,\n                    JSBool showArgs, JSBool showLocals,\n                    JSBool showThisProps);\n\n}\n\n# ifdef DEBUG\nJS_FRIEND_API(void) js_DumpValue(const js::Value &val);\nJS_FRIEND_API(void) js_DumpId(jsid id);\nJS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = NULL);\n# endif\n\nJS_FRIEND_API(void)\njs_DumpBacktrace(JSContext *cx);\n\nextern JS_PUBLIC_API(JSCompartment *)\nJS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);\n\nextern JS_PUBLIC_API(JSString *)\nJS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);\n\n/*\n * Currently, we only support runtime-wide debugging. In the future, we should\n * be able to support compartment-wide debugging.\n */\nextern JS_PUBLIC_API(void)\nJS_SetRuntimeDebugMode(JSRuntime *rt, JSBool debug);\n\n/*\n * Debug mode is a compartment-wide mode that enables a debugger to attach\n * to and interact with running methodjit-ed frames. In particular, it causes\n * every function to be compiled as if an eval was present (so eval-in-frame)\n * can work, and it ensures that functions can be re-JITed for other debug\n * features. In general, it is not safe to interact with frames that were live\n * before debug mode was enabled. For this reason, it is also not safe to\n * enable debug mode while frames are live.\n */\n\n/* Get current state of debugging mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_GetDebugMode(JSContext *cx);\n\n/*\n * Turn on/off debugging mode for all compartments. This returns false if any code\n * from any of the runtime's compartments is running or on the stack.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForAllCompartments(JSContext *cx, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a single compartment. This should only be\n * used when no code from this compartment is running or on the stack in any\n * thread.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugModeForCompartment(JSContext *cx, JSCompartment *comp, JSBool debug);\n\n/*\n * Turn on/off debugging mode for a context's compartment.\n */\nJS_FRIEND_API(JSBool)\nJS_SetDebugMode(JSContext *cx, JSBool debug);\n\n/* Turn on single step mode. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetSingleStepMode(JSContext *cx, JSScript *script, JSBool singleStep);\n\n/* The closure argument will be marked. */\nextern JS_PUBLIC_API(JSBool)\nJS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n           JSTrapHandler handler, jsval closure);\n\nextern JS_PUBLIC_API(void)\nJS_ClearTrap(JSContext *cx, JSScript *script, jsbytecode *pc,\n             JSTrapHandler *handlerp, jsval *closurep);\n\nextern JS_PUBLIC_API(void)\nJS_ClearScriptTraps(JSRuntime *rt, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_ClearAllTrapsForCompartment(JSContext *cx);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetInterrupt(JSRuntime *rt, JSInterruptHook handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearInterrupt(JSRuntime *rt, JSInterruptHook *handlerp, void **closurep);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                 JSWatchPointHandler handler, JSObject *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPoint(JSContext *cx, JSObject *obj, jsid id,\n                   JSWatchPointHandler *handlerp, JSObject **closurep);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearWatchPointsForObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(JSBool)\nJS_ClearAllWatchPoints(JSContext *cx);\n\n/************************************************************************/\n\n// Raw JSScript* because this needs to be callable from a signal handler.\nextern JS_PUBLIC_API(unsigned)\nJS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);\n\nextern JS_PUBLIC_API(jsbytecode *)\nJS_EndPC(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetLinePCs(JSContext *cx, JSScript *script,\n              unsigned startLine, unsigned maxLines,\n              unsigned* count, unsigned** lines, jsbytecode*** pcs);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetFunctionArgumentCount(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSBool)\nJS_FunctionHasLocalNames(JSContext *cx, JSFunction *fun);\n\n/*\n * N.B. The mark is in the context temp pool and thus the caller must take care\n * to call JS_ReleaseFunctionLocalNameArray in a LIFO manner (wrt to any other\n * call that may use the temp pool.\n */\nextern JS_PUBLIC_API(uintptr_t *)\nJS_GetFunctionLocalNameArray(JSContext *cx, JSFunction *fun, void **markp);\n\nextern JS_PUBLIC_API(JSAtom *)\nJS_LocalNameToAtom(uintptr_t w);\n\nextern JS_PUBLIC_API(JSString *)\nJS_AtomKey(JSAtom *atom);\n\nextern JS_PUBLIC_API(void)\nJS_ReleaseFunctionLocalNameArray(JSContext *cx, void *mark);\n\nextern JS_PUBLIC_API(JSScript *)\nJS_GetFunctionScript(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSNative)\nJS_GetFunctionNative(JSContext *cx, JSFunction *fun);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptPrincipals(JSScript *script);\n\nextern JS_PUBLIC_API(JSPrincipals *)\nJS_GetScriptOriginPrincipals(JSScript *script);\n\nJS_PUBLIC_API(JSFunction *)\nJS_GetScriptFunction(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSObject *)\nJS_GetParentOrScopeChain(JSContext *cx, JSObject *obj);\n\n/************************************************************************/\n\n/*\n * This is almost JS_GetClass(obj)->name except that certain debug-only\n * proxies are made transparent. In particular, this function turns the class\n * of any scope (returned via JS_GetFrameScopeChain or JS_GetFrameCalleeObject)\n * from \"Proxy\" to \"Call\", \"Block\", \"With\" etc.\n */\nextern JS_PUBLIC_API(const char *)\nJS_GetDebugClassName(JSObject *obj);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const char *)\nJS_GetScriptFilename(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(const jschar *)\nJS_GetScriptSourceMap(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(unsigned)\nJS_GetScriptLineExtent(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(JSVersion)\nJS_GetScriptVersion(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(bool)\nJS_GetScriptIsSelfHosted(JSScript *script);\n\n/************************************************************************/\n\n/*\n * Hook setters for script creation and destruction, see jsprvtd.h for the\n * typedefs.  These macros provide binary compatibility and newer, shorter\n * synonyms.\n */\n#define JS_SetNewScriptHook     JS_SetNewScriptHookProc\n#define JS_SetDestroyScriptHook JS_SetDestroyScriptHookProc\n\nextern JS_PUBLIC_API(void)\nJS_SetNewScriptHook(JSRuntime *rt, JSNewScriptHook hook, void *callerdata);\n\nextern JS_PUBLIC_API(void)\nJS_SetDestroyScriptHook(JSRuntime *rt, JSDestroyScriptHook hook,\n                        void *callerdata);\n\n/************************************************************************/\n\ntypedef struct JSPropertyDesc {\n    jsval           id;         /* primary id, atomized string, or int */\n    jsval           value;      /* property value */\n    uint8_t         flags;      /* flags, see below */\n    uint8_t         spare;      /* unused */\n    jsval           alias;      /* alias id if JSPD_ALIAS flag */\n} JSPropertyDesc;\n\n#define JSPD_ENUMERATE  0x01    /* visible to for/in loop */\n#define JSPD_READONLY   0x02    /* assignment is error */\n#define JSPD_PERMANENT  0x04    /* property cannot be deleted */\n#define JSPD_ALIAS      0x08    /* property has an alias id */\n#define JSPD_EXCEPTION  0x40    /* exception occurred fetching the property, */\n                                /* value is exception */\n#define JSPD_ERROR      0x80    /* native getter returned JS_FALSE without */\n                                /* throwing an exception */\n\ntypedef struct JSPropertyDescArray {\n    uint32_t        length;     /* number of elements in array */\n    JSPropertyDesc  *array;     /* alloc'd by Get, freed by Put */\n} JSPropertyDescArray;\n\ntypedef struct JSScopeProperty JSScopeProperty;\n\nextern JS_PUBLIC_API(JSBool)\nJS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda);\n\nextern JS_PUBLIC_API(void)\nJS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda);\n\n/************************************************************************/\n\n/*\n * JSAbstractFramePtr is the public version of AbstractFramePtr, a pointer to a\n * StackFrame or baseline JIT frame.\n */\nclass JS_PUBLIC_API(JSAbstractFramePtr)\n{\n    uintptr_t ptr_;\n\n  protected:\n    JSAbstractFramePtr()\n      : ptr_(0)\n    { }\n\n  public:\n    explicit JSAbstractFramePtr(void *raw);\n\n    uintptr_t raw() const { return ptr_; }\n\n    operator bool() const { return !!ptr_; }\n\n    JSObject *scopeChain(JSContext *cx);\n    JSObject *callObject(JSContext *cx);\n\n    JSFunction *maybeFun();\n    JSScript *script();\n\n    bool getThisValue(JSContext *cx, JS::MutableHandleValue thisv);\n\n    bool isDebuggerFrame();\n\n    bool evaluateInStackFrame(JSContext *cx,\n                              const char *bytes, unsigned length,\n                              const char *filename, unsigned lineno,\n                              JS::MutableHandleValue rval);\n\n    bool evaluateUCInStackFrame(JSContext *cx,\n                                const jschar *chars, unsigned length,\n                                const char *filename, unsigned lineno,\n                                JS::MutableHandleValue rval);\n};\n\nclass JS_PUBLIC_API(JSNullFramePtr) : public JSAbstractFramePtr\n{\n  public:\n    JSNullFramePtr()\n      : JSAbstractFramePtr()\n    {}\n};\n\n/*\n * This class does not work when IonMonkey is active. It's only used by jsd,\n * which can only be used when IonMonkey is disabled.\n *\n * To find the calling script and line number, use JS_DescribeSciptedCaller.\n * To summarize the call stack, use JS::DescribeStack.\n */\nclass JS_PUBLIC_API(JSBrokenFrameIterator)\n{\n    void *data_;\n\n  public:\n    JSBrokenFrameIterator(JSContext *cx);\n    ~JSBrokenFrameIterator();\n\n    bool done() const;\n    JSBrokenFrameIterator& operator++();\n\n    JSAbstractFramePtr abstractFramePtr() const;\n    jsbytecode *pc() const;\n\n    bool isConstructing() const;\n};\n\n/*\n * This hook captures high level script execution and function calls (JS or\n * native).  It is used by JS_SetExecuteHook to hook top level scripts and by\n * JS_SetCallHook to hook function calls.  It will get called twice per script\n * or function call: just before execution begins and just after it finishes.\n * In both cases the 'current' frame is that of the executing code.\n *\n * The 'before' param is JS_TRUE for the hook invocation before the execution\n * and JS_FALSE for the invocation after the code has run.\n *\n * The 'ok' param is significant only on the post execution invocation to\n * signify whether or not the code completed 'normally'.\n *\n * The 'closure' param is as passed to JS_SetExecuteHook or JS_SetCallHook\n * for the 'before'invocation, but is whatever value is returned from that\n * invocation for the 'after' invocation. Thus, the hook implementor *could*\n * allocate a structure in the 'before' invocation and return a pointer to that\n * structure. The pointer would then be handed to the hook for the 'after'\n * invocation. Alternately, the 'before' could just return the same value as\n * in 'closure' to cause the 'after' invocation to be called with the same\n * 'closure' value as the 'before'.\n *\n * Returning NULL in the 'before' hook will cause the 'after' hook *not* to\n * be called.\n */\ntypedef void *\n(* JSInterpreterHook)(JSContext *cx, JSAbstractFramePtr frame, bool isConstructing,\n                      JSBool before, JSBool *ok, void *closure);\n\ntypedef JSBool\n(* JSDebugErrorHook)(JSContext *cx, const char *message, JSErrorReport *report,\n                     void *closure);\n\ntypedef struct JSDebugHooks {\n    JSInterruptHook     interruptHook;\n    void                *interruptHookData;\n    JSNewScriptHook     newScriptHook;\n    void                *newScriptHookData;\n    JSDestroyScriptHook destroyScriptHook;\n    void                *destroyScriptHookData;\n    JSDebuggerHandler   debuggerHandler;\n    void                *debuggerHandlerData;\n    JSSourceHandler     sourceHandler;\n    void                *sourceHandlerData;\n    JSInterpreterHook   executeHook;\n    void                *executeHookData;\n    JSInterpreterHook   callHook;\n    void                *callHookData;\n    JSThrowHook         throwHook;\n    void                *throwHookData;\n    JSDebugErrorHook    debugErrorHook;\n    void                *debugErrorHookData;\n} JSDebugHooks;\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebuggerHandler(JSRuntime *rt, JSDebuggerHandler hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetSourceHandler(JSRuntime *rt, JSSourceHandler handler, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetExecuteHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetCallHook(JSRuntime *rt, JSInterpreterHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetThrowHook(JSRuntime *rt, JSThrowHook hook, void *closure);\n\nextern JS_PUBLIC_API(JSBool)\nJS_SetDebugErrorHook(JSRuntime *rt, JSDebugErrorHook hook, void *closure);\n\n/************************************************************************/\n\nextern JS_PUBLIC_API(const JSDebugHooks *)\nJS_GetGlobalDebugHooks(JSRuntime *rt);\n\n/**\n * Add various profiling-related functions as properties of the given object.\n */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineProfilingFunctions(JSContext *cx, JSObject *obj);\n\n/* Defined in vm/Debugger.cpp. */\nextern JS_PUBLIC_API(JSBool)\nJS_DefineDebuggerObject(JSContext *cx, JSObject *obj);\n\nextern JS_PUBLIC_API(void)\nJS_DumpBytecode(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentBytecode(JSContext *cx);\n\nextern JS_PUBLIC_API(void)\nJS_DumpPCCounts(JSContext *cx, JSScript *script);\n\nextern JS_PUBLIC_API(void)\nJS_DumpCompartmentPCCounts(JSContext *cx);\n\n/* Call the context debug handler on the topmost scripted frame. */\nextern JS_FRIEND_API(JSBool)\njs_CallContextDebugHandler(JSContext *cx);\n\n#endif /* jsdbgapi_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsfriendapi.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsfriendapi_h\n#define jsfriendapi_h\n\n#include \"mozilla/MemoryReporting.h\"\n\n#include \"jsclass.h\"\n#include \"jsprvtd.h\"\n#include \"jspubtd.h\"\n\n#include \"js/CallArgs.h\"\n\n/*\n * This macro checks if the stack pointer has exceeded a given limit. If\n * |tolerance| is non-zero, it returns true only if the stack pointer has\n * exceeded the limit by more than |tolerance| bytes.\n */\n#if JS_STACK_GROWTH_DIRECTION > 0\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) < (limit)+(tolerance))\n#else\n# define JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, sp, tolerance)  \\\n    ((uintptr_t)(sp) > (limit)-(tolerance))\n#endif\n\n#define JS_CHECK_STACK_SIZE(limit, lval) JS_CHECK_STACK_SIZE_WITH_TOLERANCE(limit, lval, 0)\n\nnamespace JS {\ntemplate <class T>\nclass Heap;\n} /* namespace JS */\n\nextern JS_FRIEND_API(void)\nJS_SetGrayGCRootsTracer(JSRuntime *rt, JSTraceDataOp traceOp, void *data);\n\nextern JS_FRIEND_API(JSString *)\nJS_GetAnonymousString(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nJS_FindCompilationScope(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSFunction *)\nJS_GetObjectFunction(JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_SplicePrototype(JSContext *cx, JSObject *obj, JSObject *proto);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewObjectWithUniqueType(JSContext *cx, JSClass *clasp, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(uint32_t)\nJS_ObjectCountDynamicSlots(JS::HandleObject obj);\n\nextern JS_FRIEND_API(size_t)\nJS_SetProtoCalled(JSContext *cx);\n\nextern JS_FRIEND_API(size_t)\nJS_GetCustomIteratorCount(JSContext *cx);\n\nextern JS_FRIEND_API(JSBool)\nJS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *obj, JSObject **ret);\n\n/*\n * Determine whether the given object is backed by a DeadObjectProxy.\n *\n * Such objects hold no other objects (they have no outgoing reference edges)\n * and will throw if you touch them (e.g. by reading/writing a property).\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsDeadWrapper(JSObject *obj);\n\n/*\n * Used by the cycle collector to trace through the shape and all\n * shapes it reaches, marking all non-shape children found in the\n * process. Uses bounded stack space.\n */\nextern JS_FRIEND_API(void)\nJS_TraceShapeCycleCollectorChildren(JSTracer *trc, void *shape);\n\nenum {\n    JS_TELEMETRY_GC_REASON,\n    JS_TELEMETRY_GC_IS_COMPARTMENTAL,\n    JS_TELEMETRY_GC_MS,\n    JS_TELEMETRY_GC_MAX_PAUSE_MS,\n    JS_TELEMETRY_GC_MARK_MS,\n    JS_TELEMETRY_GC_SWEEP_MS,\n    JS_TELEMETRY_GC_MARK_ROOTS_MS,\n    JS_TELEMETRY_GC_MARK_GRAY_MS,\n    JS_TELEMETRY_GC_SLICE_MS,\n    JS_TELEMETRY_GC_MMU_50,\n    JS_TELEMETRY_GC_RESET,\n    JS_TELEMETRY_GC_INCREMENTAL_DISABLED,\n    JS_TELEMETRY_GC_NON_INCREMENTAL,\n    JS_TELEMETRY_GC_SCC_SWEEP_TOTAL_MS,\n    JS_TELEMETRY_GC_SCC_SWEEP_MAX_PAUSE_MS\n};\n\ntypedef void\n(* JSAccumulateTelemetryDataCallback)(int id, uint32_t sample);\n\nextern JS_FRIEND_API(void)\nJS_SetAccumulateTelemetryCallback(JSRuntime *rt, JSAccumulateTelemetryDataCallback callback);\n\nextern JS_FRIEND_API(JSPrincipals *)\nJS_GetCompartmentPrincipals(JSCompartment *compartment);\n\nextern JS_FRIEND_API(void)\nJS_SetCompartmentPrincipals(JSCompartment *compartment, JSPrincipals *principals);\n\n/* Safe to call with input obj == NULL. Returns non-NULL iff obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToInnerObject(JSContext *cx, JSObject *obj);\n\n/* Requires obj != NULL. */\nextern JS_FRIEND_API(JSObject *)\nJS_ObjectToOuterObject(JSContext *cx, JSObject *obj);\n\nextern JS_FRIEND_API(JSObject *)\nJS_CloneObject(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent);\n\nextern JS_FRIEND_API(JSString *)\nJS_BasicObjectToString(JSContext *cx, JS::HandleObject obj);\n\nextern JS_FRIEND_API(JSBool)\njs_GetterOnlyPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JSBool strict,\n                          JS::MutableHandleValue vp);\n\nJS_FRIEND_API(void)\njs_ReportOverRecursed(JSContext *maybecx);\n\nJS_FRIEND_API(bool)\njs_ObjectClassIs(JSContext *cx, JS::HandleObject obj, js::ESClassValue classValue);\n\nJS_FRIEND_API(const char *)\njs_ObjectClassName(JSContext *cx, JS::HandleObject obj);\n\nJS_FRIEND_API(bool)\njs_AddObjectRoot(JSRuntime *rt, JSObject **objp);\n\nJS_FRIEND_API(void)\njs_RemoveObjectRoot(JSRuntime *rt, JSObject **objp);\n\n#ifdef DEBUG\n\n/*\n * Routines to print out values during debugging.  These are FRIEND_API to help\n * the debugger find them and to support temporarily hacking js_Dump* calls\n * into other code.\n */\n\nextern JS_FRIEND_API(void)\njs_DumpString(JSString *str);\n\nextern JS_FRIEND_API(void)\njs_DumpAtom(JSAtom *atom);\n\nextern JS_FRIEND_API(void)\njs_DumpObject(JSObject *obj);\n\nextern JS_FRIEND_API(void)\njs_DumpChars(const jschar *s, size_t n);\n#endif\n\nextern JS_FRIEND_API(bool)\nJS_CopyPropertiesFrom(JSContext *cx, JSObject *target, JSObject *obj);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapPropertyDescriptor(JSContext *cx, js::PropertyDescriptor *desc);\n\nextern JS_FRIEND_API(JSBool)\nJS_WrapAutoIdVector(JSContext *cx, JS::AutoIdVector &props);\n\nextern JS_FRIEND_API(JSBool)\nJS_EnumerateState(JSContext *cx, JS::HandleObject obj, JSIterateOp enum_op,\n                  js::MutableHandleValue statep, js::MutableHandleId idp);\n\nstruct JSFunctionSpecWithHelp {\n    const char      *name;\n    JSNative        call;\n    uint16_t        nargs;\n    uint16_t        flags;\n    const char      *usage;\n    const char      *help;\n};\n\n#define JS_FN_HELP(name,call,nargs,flags,usage,help)                          \\\n    {name, call, nargs, (flags) | JSPROP_ENUMERATE | JSFUN_STUB_GSOPS, usage, help}\n#define JS_FS_HELP_END                                                        \\\n    {NULL, NULL, 0, 0, NULL, NULL}\n\nextern JS_FRIEND_API(bool)\nJS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWithHelp *fs);\n\ntypedef bool (* JS_SourceHook)(JSContext *cx, JS::Handle<JSScript*> script,\n                               jschar **src, uint32_t *length);\n\nextern JS_FRIEND_API(void)\nJS_SetSourceHook(JSRuntime *rt, JS_SourceHook hook);\n\nnamespace js {\n\ninline JSRuntime *\nGetRuntime(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->runtime_;\n}\n\ninline JSCompartment *\nGetContextCompartment(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->compartment_;\n}\n\ninline JS::Zone *\nGetContextZone(const JSContext *cx)\n{\n    return ContextFriendFields::get(cx)->zone_;\n}\n\nextern JS_FRIEND_API(JS::Zone *)\nGetCompartmentZone(JSCompartment *comp);\n\ntypedef bool\n(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);\n\n /*\n  * Dump the complete object graph of heap-allocated things.\n  * fp is the file for the dump output.\n  */\nextern JS_FRIEND_API(void)\nDumpHeapComplete(JSRuntime *rt, FILE *fp);\n\n#ifdef OLD_GETTER_SETTER_METHODS\nJS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);\nJS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);\n#endif\n\nextern JS_FRIEND_API(bool)\nIsSystemCompartment(JSCompartment *comp);\n\nextern JS_FRIEND_API(bool)\nIsSystemZone(JS::Zone *zone);\n\nextern JS_FRIEND_API(bool)\nIsAtomsCompartment(JSCompartment *comp);\n\n/*\n * Check whether it is OK to assign an undeclared variable with the name\n * |propname| at the current location in script.  It is not an error if there is\n * no current script location, or if that location is not an assignment to an\n * undeclared variable.  Reports an error if one needs to be reported (and,\n * particularly, always reports when it returns false).\n */\nextern JS_FRIEND_API(bool)\nReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname);\n\n/*\n * Returns whether we're in a non-strict property set (in that we're in a\n * non-strict script and the bytecode we're on is a property set).  The return\n * value does NOT indicate any sort of exception was thrown: it's just a\n * boolean.\n */\nextern JS_FRIEND_API(bool)\nIsInNonStrictPropertySet(JSContext *cx);\n\nstruct WeakMapTracer;\n\n/*\n * Weak map tracer callback, called once for every binding of every\n * weak map that was live at the time of the last garbage collection.\n *\n * m will be NULL if the weak map is not contained in a JS Object.\n */\ntypedef void\n(* WeakMapTraceCallback)(WeakMapTracer *trc, JSObject *m,\n                         void *k, JSGCTraceKind kkind,\n                         void *v, JSGCTraceKind vkind);\n\nstruct WeakMapTracer {\n    JSRuntime            *runtime;\n    WeakMapTraceCallback callback;\n\n    WeakMapTracer(JSRuntime *rt, WeakMapTraceCallback cb)\n        : runtime(rt), callback(cb) {}\n};\n\nextern JS_FRIEND_API(void)\nTraceWeakMaps(WeakMapTracer *trc);\n\nextern JS_FRIEND_API(bool)\nAreGCGrayBitsValid(JSRuntime *rt);\n\ntypedef void\n(*GCThingCallback)(void *closure, void *gcthing);\n\nextern JS_FRIEND_API(void)\nVisitGrayWrapperTargets(JS::Zone *zone, GCThingCallback callback, void *closure);\n\nextern JS_FRIEND_API(JSObject *)\nGetWeakmapKeyDelegate(JSObject *key);\n\nJS_FRIEND_API(JSGCTraceKind)\nGCThingTraceKind(void *thing);\n\n/*\n * Invoke cellCallback on every gray JS_OBJECT in the given zone.\n */\nextern JS_FRIEND_API(void)\nIterateGrayObjects(JS::Zone *zone, GCThingCallback cellCallback, void *data);\n\n#ifdef JS_HAS_CTYPES\nextern JS_FRIEND_API(size_t)\nSizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj);\n#endif\n\nextern JS_FRIEND_API(JSCompartment *)\nGetAnyCompartmentInZone(JS::Zone *zone);\n\n/*\n * Shadow declarations of JS internal structures, for access by inline access\n * functions below. Do not use these structures in any other way. When adding\n * new fields for access by inline methods, make sure to add static asserts to\n * the original header file to ensure that offsets are consistent.\n */\nnamespace shadow {\n\nstruct TypeObject {\n    Class       *clasp;\n    JSObject    *proto;\n};\n\nstruct BaseShape {\n    js::Class *clasp;\n    JSObject *parent;\n    JSObject *_1;\n    JSCompartment *compartment;\n};\n\nclass Shape {\npublic:\n    shadow::BaseShape *base;\n    jsid              _1;\n    uint32_t          slotInfo;\n\n    static const uint32_t FIXED_SLOTS_SHIFT = 27;\n};\n\nstruct Object {\n    shadow::Shape      *shape;\n    shadow::TypeObject *type;\n    js::Value          *slots;\n    js::Value          *_1;\n\n    size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }\n    Value *fixedSlots() const {\n        return (Value *)(uintptr_t(this) + sizeof(shadow::Object));\n    }\n\n    js::Value &slotRef(size_t slot) const {\n        size_t nfixed = numFixedSlots();\n        if (slot < nfixed)\n            return fixedSlots()[slot];\n        return slots[slot - nfixed];\n    }\n};\n\nstruct Function {\n    Object base;\n    uint16_t nargs;\n    uint16_t flags;\n    /* Used only for natives */\n    Native native;\n    const JSJitInfo *jitinfo;\n    void *_1;\n};\n\nstruct Atom {\n    static const size_t LENGTH_SHIFT = 4;\n    size_t lengthAndFlags;\n    const jschar *chars;\n};\n\n} /* namespace shadow */\n\n// These are equal to |&{Function,Object,OuterWindow}ProxyObject::class_|.  Use\n// them in places where you don't want to #include vm/ProxyObject.h.\nextern JS_FRIEND_DATA(js::Class* const) FunctionProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) ObjectProxyClassPtr;\nextern JS_FRIEND_DATA(js::Class* const) OuterWindowProxyClassPtr;\n\n// This is equal to |&JSObject::class_|.  Use it in places where you don't want\n// to #include jsobj.h.\nextern JS_FRIEND_DATA(js::Class* const) ObjectClassPtr;\n\ninline js::Class *\nGetObjectClass(JSObject *obj)\n{\n    return reinterpret_cast<const shadow::Object*>(obj)->type->clasp;\n}\n\ninline JSClass *\nGetObjectJSClass(JSObject *obj)\n{\n    return js::Jsvalify(GetObjectClass(obj));\n}\n\ninline bool\nIsInnerObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.outerObject;\n}\n\ninline bool\nIsOuterObject(JSObject *obj) {\n    return !!GetObjectClass(obj)->ext.innerObject;\n}\n\nJS_FRIEND_API(bool)\nIsFunctionObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsScopeObject(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsCallObject(JSObject *obj);\n\ninline JSObject *\nGetObjectParent(JSObject *obj)\n{\n    JS_ASSERT(!IsScopeObject(obj));\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->parent;\n}\n\nstatic JS_ALWAYS_INLINE JSCompartment *\nGetObjectCompartment(JSObject *obj)\n{\n    return reinterpret_cast<shadow::Object*>(obj)->shape->base->compartment;\n}\n\nJS_FRIEND_API(JSObject *)\nGetObjectParentMaybeScope(JSObject *obj);\n\nJS_FRIEND_API(JSObject *)\nGetGlobalForObjectCrossCompartment(JSObject *obj);\n\n// For legacy consumers only. This whole concept is going away soon.\nJS_FRIEND_API(JSObject *)\nDefaultObjectForContextOrNull(JSContext *cx);\n\nJS_FRIEND_API(void)\nSetDefaultObjectForContext(JSContext *cx, JSObject *obj);\n\nJS_FRIEND_API(void)\nNotifyAnimationActivity(JSObject *obj);\n\nJS_FRIEND_API(bool)\nIsOriginalScriptFunction(JSFunction *fun);\n\n/*\n * Return the outermost enclosing function (script) of the scripted caller.\n * This function returns NULL in several cases:\n *  - no script is running on the context\n *  - the caller is in global or eval code\n * In particular, this function will \"stop\" its outermost search at eval() and\n * thus it will really return the outermost enclosing function *since the\n * innermost eval*.\n */\nJS_FRIEND_API(JSScript *)\nGetOutermostEnclosingFunctionOfScriptedCaller(JSContext *cx);\n\nJS_FRIEND_API(JSFunction *)\nDefineFunctionWithReserved(JSContext *cx, JSObject *obj, const char *name, JSNative call,\n                           unsigned nargs, unsigned attrs);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionWithReserved(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,\n                        JSObject *parent, const char *name);\n\nJS_FRIEND_API(JSFunction *)\nNewFunctionByIdWithReserved(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,\n                            JSObject *parent, jsid id);\n\nJS_FRIEND_API(JSObject *)\nInitClassWithReserved(JSContext *cx, JSObject *obj, JSObject *parent_proto,\n                      JSClass *clasp, JSNative constructor, unsigned nargs,\n                      const JSPropertySpec *ps, const JSFunctionSpec *fs,\n                      const JSPropertySpec *static_ps, const JSFunctionSpec *static_fs);\n\nJS_FRIEND_API(const Value &)\nGetFunctionNativeReserved(JSObject *fun, size_t which);\n\nJS_FRIEND_API(void)\nSetFunctionNativeReserved(JSObject *fun, size_t which, const Value &val);\n\ninline bool\nGetObjectProto(JSContext *cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JSObject*> proto)\n{\n    js::Class *clasp = GetObjectClass(obj);\n    if (clasp == js::ObjectProxyClassPtr ||\n        clasp == js::OuterWindowProxyClassPtr ||\n        clasp == js::FunctionProxyClassPtr)\n    {\n        return JS_GetPrototype(cx, obj, proto);\n    }\n\n    proto.set(reinterpret_cast<const shadow::Object*>(obj.get())->type->proto);\n    return true;\n}\n\ninline void *\nGetObjectPrivate(JSObject *obj)\n{\n    const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);\n    void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);\n    return *addr;\n}\n\n/*\n * Get a slot that is both reserved for object's clasp *and* is fixed (fits\n * within the maximum capacity for the object's fixed slots).\n */\ninline const Value &\nGetReservedSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\nJS_FRIEND_API(void)\nSetReservedSlotWithBarrier(JSObject *obj, size_t slot, const Value &value);\n\ninline void\nSetReservedSlot(JSObject *obj, size_t slot, const Value &value)\n{\n    JS_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));\n    shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);\n    if (sobj->slotRef(slot).isMarkable()\n#ifdef JSGC_GENERATIONAL\n        || value.isMarkable()\n#endif\n       )\n    {\n        SetReservedSlotWithBarrier(obj, slot, value);\n    } else {\n        sobj->slotRef(slot) = value;\n    }\n}\n\nJS_FRIEND_API(uint32_t)\nGetObjectSlotSpan(JSObject *obj);\n\ninline const Value &\nGetObjectSlot(JSObject *obj, size_t slot)\n{\n    JS_ASSERT(slot < GetObjectSlotSpan(obj));\n    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);\n}\n\ninline const jschar *\nGetAtomChars(JSAtom *atom)\n{\n    return reinterpret_cast<shadow::Atom *>(atom)->chars;\n}\n\ninline size_t\nGetAtomLength(JSAtom *atom)\n{\n    using shadow::Atom;\n    return reinterpret_cast<Atom*>(atom)->lengthAndFlags >> Atom::LENGTH_SHIFT;\n}\n\ninline JSLinearString *\nAtomToLinearString(JSAtom *atom)\n{\n    return reinterpret_cast<JSLinearString *>(atom);\n}\n\nstatic inline js::PropertyOp\nCastAsJSPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::PropertyOp, object);\n}\n\nstatic inline js::StrictPropertyOp\nCastAsJSStrictPropertyOp(JSObject *object)\n{\n    return JS_DATA_TO_FUNC_PTR(js::StrictPropertyOp, object);\n}\n\nJS_FRIEND_API(bool)\nGetPropertyNames(JSContext *cx, JSObject *obj, unsigned flags, js::AutoIdVector *props);\n\nJS_FRIEND_API(bool)\nAppendUnique(JSContext *cx, AutoIdVector &base, AutoIdVector &others);\n\nJS_FRIEND_API(bool)\nGetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);\n\nJS_FRIEND_API(bool)\nStringIsArrayIndex(JSLinearString *str, uint32_t *indexp);\n\nJS_FRIEND_API(void)\nSetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);\n\nJS_FRIEND_API(bool)\nIsObjectInContextCompartment(JSObject *obj, const JSContext *cx);\n\n/*\n * NB: these flag bits are encoded into the bytecode stream in the immediate\n * operand of JSOP_ITER, so don't change them without advancing vm/Xdr.h's\n * XDR_BYTECODE_VERSION.\n */\n#define JSITER_ENUMERATE  0x1   /* for-in compatible hidden default iterator */\n#define JSITER_FOREACH    0x2   /* return [key, value] pair rather than key */\n#define JSITER_KEYVALUE   0x4   /* destructuring for-in wants [key, value] */\n#define JSITER_OWNONLY    0x8   /* iterate over obj's own properties only */\n#define JSITER_HIDDEN     0x10  /* also enumerate non-enumerable properties */\n#define JSITER_FOR_OF     0x20  /* harmony for-of loop */\n\ninline uintptr_t\nGetNativeStackLimit(const JSRuntime *rt)\n{\n    return PerThreadDataFriendFields::getMainThread(rt)->nativeStackLimit;\n}\n\ninline uintptr_t\nGetNativeStackLimit(JSContext *cx)\n{\n    return GetNativeStackLimit(GetRuntime(cx));\n}\n\n/*\n * These macros report a stack overflow and run |onerror| if we are close to\n * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a little\n * extra space so that we can ensure that crucial code is able to run.\n */\n\n#define JS_CHECK_RECURSION(cx, onerror)                              \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), &stackDummy_)) {  \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, sp, onerror)                 \\\n    JS_BEGIN_MACRO                                                              \\\n        if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), sp)) {            \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\n#define JS_CHECK_CHROME_RECURSION(cx, onerror)                                  \\\n    JS_BEGIN_MACRO                                                              \\\n        int stackDummy_;                                                        \\\n        if (!JS_CHECK_STACK_SIZE_WITH_TOLERANCE(js::GetNativeStackLimit(cx),    \\\n                                                &stackDummy_,                   \\\n                                                1024 * sizeof(size_t)))         \\\n        {                                                                       \\\n            js_ReportOverRecursed(cx);                                          \\\n            onerror;                                                            \\\n        }                                                                       \\\n    JS_END_MACRO\n\nJS_FRIEND_API(void)\nStartPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nStopPCCountProfiling(JSContext *cx);\n\nJS_FRIEND_API(void)\nPurgePCCounts(JSContext *cx);\n\nJS_FRIEND_API(size_t)\nGetPCCountScriptCount(JSContext *cx);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptSummary(JSContext *cx, size_t script);\n\nJS_FRIEND_API(JSString *)\nGetPCCountScriptContents(JSContext *cx, size_t script);\n\n/*\n * A call stack can be specified to the JS engine such that all JS entry/exits\n * to functions push/pop an entry to/from the specified stack.\n *\n * For more detailed information, see vm/SPSProfiler.h\n */\nclass ProfileEntry\n{\n    /*\n     * All fields are marked volatile to prevent the compiler from re-ordering\n     * instructions. Namely this sequence:\n     *\n     *    entry[size] = ...;\n     *    size++;\n     *\n     * If the size modification were somehow reordered before the stores, then\n     * if a sample were taken it would be examining bogus information.\n     *\n     * A ProfileEntry represents both a C++ profile entry and a JS one. Both use\n     * the string as a description, but JS uses the sp as NULL to indicate that\n     * it is a JS entry. The script_ is then only ever examined for a JS entry,\n     * and the idx is used by both, but with different meanings.\n     */\n    const char * volatile string; // Descriptive string of this entry\n    void * volatile sp;           // Relevant stack pointer for the entry\n    JSScript * volatile script_;  // if js(), non-null script which is running\n    int32_t volatile idx;         // if js(), idx of pc, otherwise line number\n\n  public:\n    /*\n     * All of these methods are marked with the 'volatile' keyword because SPS's\n     * representation of the stack is stored such that all ProfileEntry\n     * instances are volatile. These methods would not be available unless they\n     * were marked as volatile as well\n     */\n\n    bool js() volatile {\n        JS_ASSERT_IF(sp == NULL, script_ != NULL);\n        return sp == NULL;\n    }\n\n    uint32_t line() volatile { JS_ASSERT(!js()); return idx; }\n    JSScript *script() volatile { JS_ASSERT(js()); return script_; }\n    void *stackAddress() volatile { return sp; }\n    const char *label() volatile { return string; }\n\n    void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }\n    void setLabel(const char *aString) volatile { string = aString; }\n    void setStackAddress(void *aSp) volatile { sp = aSp; }\n    void setScript(JSScript *aScript) volatile { script_ = aScript; }\n\n    /* we can't know the layout of JSScript, so look in vm/SPSProfiler.cpp */\n    JS_FRIEND_API(jsbytecode *) pc() volatile;\n    JS_FRIEND_API(void) setPC(jsbytecode *pc) volatile;\n\n    static size_t offsetOfString() { return offsetof(ProfileEntry, string); }\n    static size_t offsetOfStackAddress() { return offsetof(ProfileEntry, sp); }\n    static size_t offsetOfPCIdx() { return offsetof(ProfileEntry, idx); }\n    static size_t offsetOfScript() { return offsetof(ProfileEntry, script_); }\n\n    /*\n     * The index used in the entry can either be a line number or the offset of\n     * a pc into a script's code. To signify a NULL pc, use a -1 index. This is\n     * checked against in pc() and setPC() to set/get the right pc.\n     */\n    static const int32_t NullPCIndex = -1;\n};\n\nJS_FRIEND_API(void)\nSetRuntimeProfilingStack(JSRuntime *rt, ProfileEntry *stack, uint32_t *size,\n                         uint32_t max);\n\nJS_FRIEND_API(void)\nEnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);\n\nJS_FRIEND_API(jsbytecode*)\nProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);\n\n#ifdef JS_THREADSAFE\nJS_FRIEND_API(bool)\nContextHasOutstandingRequests(const JSContext *cx);\n#endif\n\nJS_FRIEND_API(bool)\nHasUnrootedGlobal(const JSContext *cx);\n\ntypedef void\n(* ActivityCallback)(void *arg, JSBool active);\n\n/*\n * Sets a callback that is run whenever the runtime goes idle - the\n * last active request ceases - and begins activity - when it was\n * idle and a request begins.\n */\nJS_FRIEND_API(void)\nSetActivityCallback(JSRuntime *rt, ActivityCallback cb, void *arg);\n\nextern JS_FRIEND_API(const JSStructuredCloneCallbacks *)\nGetContextStructuredCloneCallbacks(JSContext *cx);\n\nextern JS_FRIEND_API(bool)\nCanCallContextDebugHandler(JSContext *cx);\n\nextern JS_FRIEND_API(JSTrapStatus)\nCallContextDebugHandler(JSContext *cx, JSScript *script, jsbytecode *bc, Value *rval);\n\nextern JS_FRIEND_API(bool)\nIsContextRunningJS(JSContext *cx);\n\ntypedef void\n(* AnalysisPurgeCallback)(JSRuntime *rt, JS::Handle<JSFlatString*> desc);\n\nextern JS_FRIEND_API(AnalysisPurgeCallback)\nSetAnalysisPurgeCallback(JSRuntime *rt, AnalysisPurgeCallback callback);\n\ntypedef JSBool\n(* DOMInstanceClassMatchesProto)(JS::HandleObject protoObject, uint32_t protoID,\n                                 uint32_t depth);\nstruct JSDOMCallbacks {\n    DOMInstanceClassMatchesProto instanceClassMatchesProto;\n};\ntypedef struct JSDOMCallbacks DOMCallbacks;\n\nextern JS_FRIEND_API(void)\nSetDOMCallbacks(JSRuntime *rt, const DOMCallbacks *callbacks);\n\nextern JS_FRIEND_API(const DOMCallbacks *)\nGetDOMCallbacks(JSRuntime *rt);\n\nextern JS_FRIEND_API(JSObject *)\nGetTestingFunctions(JSContext *cx);\n\n/*\n * Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not\n * available and the compiler does not know that FreeOp inherits from\n * JSFreeOp.\n */\ninline JSFreeOp *\nCastToJSFreeOp(FreeOp *fop)\n{\n    return reinterpret_cast<JSFreeOp *>(fop);\n}\n\n/* Implemented in jsexn.cpp. */\n\n/*\n * Get an error type name from a JSExnType constant.\n * Returns NULL for invalid arguments and JSEXN_INTERNALERR\n */\nextern JS_FRIEND_API(const jschar*)\nGetErrorTypeName(JSContext* cx, int16_t exnType);\n\n#ifdef DEBUG\nextern JS_FRIEND_API(unsigned)\nGetEnterCompartmentDepth(JSContext* cx);\n#endif\n\n/* Implemented in jswrapper.cpp. */\ntypedef enum NukeReferencesToWindow {\n    NukeWindowReferences,\n    DontNukeWindowReferences\n} NukeReferencesToWindow;\n\n/*\n * These filters are designed to be ephemeral stack classes, and thus don't\n * do any rooting or holding of their members.\n */\nstruct CompartmentFilter {\n    virtual bool match(JSCompartment *c) const = 0;\n};\n\nstruct AllCompartments : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const { return true; }\n};\n\nstruct ContentCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return !IsSystemCompartment(c);\n    }\n};\n\nstruct ChromeCompartmentsOnly : public CompartmentFilter {\n    virtual bool match(JSCompartment *c) const {\n        return IsSystemCompartment(c);\n    }\n};\n\nstruct SingleCompartment : public CompartmentFilter {\n    JSCompartment *ours;\n    SingleCompartment(JSCompartment *c) : ours(c) {}\n    virtual bool match(JSCompartment *c) const { return c == ours; }\n};\n\nstruct CompartmentsWithPrincipals : public CompartmentFilter {\n    JSPrincipals *principals;\n    CompartmentsWithPrincipals(JSPrincipals *p) : principals(p) {}\n    virtual bool match(JSCompartment *c) const {\n        return JS_GetCompartmentPrincipals(c) == principals;\n    }\n};\n\nextern JS_FRIEND_API(JSBool)\nNukeCrossCompartmentWrappers(JSContext* cx,\n                             const CompartmentFilter& sourceFilter,\n                             const CompartmentFilter& targetFilter,\n                             NukeReferencesToWindow nukeReferencesToWindow);\n\n/* Specify information about DOMProxy proxies in the DOM, for use by ICs. */\n\n/*\n * The DOMProxyShadowsCheck function will be called to check if the property for\n * id should be gotten from the prototype, or if there is an own property that\n * shadows it.\n * If DoesntShadow is returned then the slot at listBaseExpandoSlot should\n * either be undefined or point to an expando object that would contain the own\n * property.\n * If DoesntShadowUnique is returned then the slot at listBaseExpandoSlot should\n * contain a private pointer to a ExpandoAndGeneration, which contains a\n * JS::Value that should either be undefined or point to an expando object, and\n * a uint32 value. If that value changes then the IC for getting a property will\n * be invalidated.\n */\n\nstruct ExpandoAndGeneration {\n  ExpandoAndGeneration()\n    : expando(UndefinedValue()),\n      generation(0)\n  {}\n\n  void Unlink()\n  {\n      ++generation;\n      expando.setUndefined();\n  }\n\n  JS::Heap<JS::Value> expando;\n  uint32_t generation;\n};\n\ntypedef enum DOMProxyShadowsResult {\n  ShadowCheckFailed,\n  Shadows,\n  DoesntShadow,\n  DoesntShadowUnique\n} DOMProxyShadowsResult;\ntypedef DOMProxyShadowsResult\n(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);\nJS_FRIEND_API(void)\nSetDOMProxyInformation(void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,\n                       DOMProxyShadowsCheck domProxyShadowsCheck);\n\nvoid *GetDOMProxyHandlerFamily();\nuint32_t GetDOMProxyExpandoSlot();\nDOMProxyShadowsCheck GetDOMProxyShadowsCheck();\n\n} /* namespace js */\n\n/* Implemented in jsdate.cpp. */\n\n/*\n * Detect whether the internal date value is NaN.  (Because failure is\n * out-of-band for js_DateGet*)\n */\nextern JS_FRIEND_API(JSBool)\njs_DateIsValid(JSObject* obj);\n\nextern JS_FRIEND_API(double)\njs_DateGetMsecSinceEpoch(JSObject *obj);\n\n/* Implemented in jscntxt.cpp. */\n\n/*\n * Report an exception, which is currently realized as a printf-style format\n * string and its arguments.\n */\ntypedef enum JSErrNum {\n#define MSG_DEF(name, number, count, exception, format) \\\n    name = number,\n#include \"js.msg\"\n#undef MSG_DEF\n    JSErr_Limit\n} JSErrNum;\n\nextern JS_FRIEND_API(const JSErrorFormatString *)\njs_GetErrorMessage(void *userRef, const char *locale, const unsigned errorNumber);\n\n/* Implemented in jsclone.cpp. */\n\nextern JS_FRIEND_API(uint64_t)\njs_GetSCOffset(JSStructuredCloneWriter* writer);\n\n/* Typed Array functions, implemented in jstypedarray.cpp */\n\nnamespace js {\nnamespace ArrayBufferView {\n\nenum ViewType {\n    TYPE_INT8 = 0,\n    TYPE_UINT8,\n    TYPE_INT16,\n    TYPE_UINT16,\n    TYPE_INT32,\n    TYPE_UINT32,\n    TYPE_FLOAT32,\n    TYPE_FLOAT64,\n\n    /*\n     * Special type that is a uint8_t, but assignments are clamped to [0, 256).\n     * Treat the raw data type as a uint8_t.\n     */\n    TYPE_UINT8_CLAMPED,\n\n    /*\n     * Type returned for a DataView. Note that there is no single element type\n     * in this case.\n     */\n    TYPE_DATAVIEW,\n\n    TYPE_MAX\n};\n\n} /* namespace ArrayBufferView */\n\n/*\n * A helper for building up an ArrayBuffer object's data\n * before creating the ArrayBuffer itself.  Will do doubling\n * based reallocation, up to an optional maximum growth given.\n *\n * When all the data has been appended, call getArrayBuffer,\n * passing in the JSContext* for which the ArrayBuffer object\n * is to be created.  This also implicitly resets the builder,\n * or it can be reset explicitly at any point by calling reset().\n */\nclass ArrayBufferBuilder\n{\n    void *rawcontents_;\n    uint8_t *dataptr_;\n    uint32_t capacity_;\n    uint32_t length_;\n  public:\n    ArrayBufferBuilder()\n        : rawcontents_(NULL),\n          dataptr_(NULL),\n          capacity_(0),\n          length_(0)\n    {\n    }\n\n    ~ArrayBufferBuilder() {\n        reset();\n    }\n\n    void reset() {\n        if (rawcontents_)\n            JS_free(NULL, rawcontents_);\n        rawcontents_ = dataptr_ = NULL;\n        capacity_ = length_ = 0;\n    }\n\n    // will truncate if newcap is < length()\n    bool setCapacity(uint32_t newcap) {\n        if (!JS_ReallocateArrayBufferContents(NULL, newcap, &rawcontents_, &dataptr_))\n            return false;\n\n        capacity_ = newcap;\n        if (length_ > newcap)\n            length_ = newcap;\n\n        return true;\n    }\n\n    // Append datalen bytes from data to the current buffer.  If we\n    // need to grow the buffer, grow by doubling the size up to a\n    // maximum of maxgrowth (if given).  If datalen is greater than\n    // what the new capacity would end up as, then grow by datalen.\n    //\n    // The data parameter must not overlap with anything beyond the\n    // builder's current valid contents [0..length)\n    bool append(const uint8_t *newdata, uint32_t datalen, uint32_t maxgrowth = 0) {\n        if (length_ + datalen > capacity_) {\n            uint32_t newcap;\n            // double while under maxgrowth or if not specified\n            if (!maxgrowth || capacity_ < maxgrowth)\n                newcap = capacity_ * 2;\n            else\n                newcap = capacity_ + maxgrowth;\n\n            // but make sure there's always enough to satisfy our request\n            if (newcap < length_ + datalen)\n                newcap = length_ + datalen;\n\n            // did we overflow?\n            if (newcap < capacity_)\n                return false;\n\n            if (!setCapacity(newcap))\n                return false;\n        }\n\n        // assert that the region isn't overlapping so we can memcpy;\n        JS_ASSERT(!areOverlappingRegions(newdata, datalen, dataptr_ + length_, datalen));\n\n        memcpy(dataptr_ + length_, newdata, datalen);\n        length_ += datalen;\n\n        return true;\n    }\n\n    uint8_t *data() {\n        return dataptr_;\n    }\n\n    uint32_t length() {\n        return length_;\n    }\n\n    uint32_t capacity() {\n        return capacity_;\n    }\n\n    JSObject* getArrayBuffer(JSContext *cx) {\n        // we need to check for length_ == 0, because nothing may have been\n        // added\n        if (capacity_ > length_ || length_ == 0) {\n            if (!setCapacity(length_))\n                return NULL;\n        }\n\n        JSObject* obj = JS_NewArrayBufferWithContents(cx, rawcontents_);\n        if (!obj)\n            return NULL;\n\n        rawcontents_ = dataptr_ = NULL;\n        length_ = capacity_ = 0;\n\n        return obj;\n    }\n\nprotected:\n\n    static bool areOverlappingRegions(const uint8_t *start1, uint32_t length1,\n                                      const uint8_t *start2, uint32_t length2)\n    {\n        const uint8_t *end1 = start1 + length1;\n        const uint8_t *end2 = start2 + length2;\n\n        const uint8_t *max_start = start1 > start2 ? start1 : start2;\n        const uint8_t *min_end   = end1 < end2 ? end1 : end2;\n\n        return max_start < min_end;\n    }\n};\n\n} /* namespace js */\n\ntypedef js::ArrayBufferView::ViewType JSArrayBufferViewType;\n\n/*\n * Create a new typed array with nelements elements.\n *\n * These functions (except the WithBuffer variants) fill in the array with zeros.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32Array(JSContext *cx, uint32_t nelements);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64Array(JSContext *cx, uint32_t nelements);\n\n/*\n * Create a new typed array and copy in values from the given object. The\n * object is used as if it were an array; that is, the new array (if\n * successfully created) will have length given by array.length, and its\n * elements will be those specified by array[0], array[1], and so on, after\n * conversion to the typed array element type.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayFromArray(JSContext *cx, JSObject *array);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayFromArray(JSContext *cx, JSObject *array);\n\n/*\n * Create a new typed array using the given ArrayBuffer for storage.  The\n * length value is optional; if -1 is passed, enough elements to use up the\n * remainder of the byte array is used as the default value.\n */\n\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                          uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint8ClampedArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                                  uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint16ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewInt32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                           uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewUint32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                            uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat32ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\nextern JS_FRIEND_API(JSObject *)\nJS_NewFloat64ArrayWithBuffer(JSContext *cx, JSObject *arrayBuffer,\n                             uint32_t byteOffset, int32_t length);\n\n/*\n * Create a new ArrayBuffer with the given byte length.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);\n\n/*\n * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return\n * false if a security wrapper is encountered that denies the unwrapping. If\n * this test or one of the JS_Is*Array tests succeeds, then it is safe to call\n * the various accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsTypedArrayObject(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test or one of the more specific tests succeeds, then it\n * is safe to call the various ArrayBufferView accessor JSAPI calls defined\n * below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * Test for specific typed array types (ArrayBufferView subtypes)\n */\n\nextern JS_FRIEND_API(JSBool)\nJS_IsInt8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint8ClampedArray(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint16Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsInt32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsUint32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat32Array(JSObject *obj);\nextern JS_FRIEND_API(JSBool)\nJS_IsFloat64Array(JSObject *obj);\n\n/*\n * Unwrap Typed arrays all at once. Return NULL without throwing if the object\n * cannot be viewed as the correct typed array, or the typed array object on\n * success, filling both outparameters.\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt8Array(JSObject *obj, uint32_t *length, int8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8Array(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint8ClampedArray(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt16Array(JSObject *obj, uint32_t *length, int16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint16Array(JSObject *obj, uint32_t *length, uint16_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsInt32Array(JSObject *obj, uint32_t *length, int32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsUint32Array(JSObject *obj, uint32_t *length, uint32_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat32Array(JSObject *obj, uint32_t *length, float **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsFloat64Array(JSObject *obj, uint32_t *length, double **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBufferView(JSObject *obj, uint32_t *length, uint8_t **data);\nextern JS_FRIEND_API(JSObject *)\nJS_GetObjectAsArrayBuffer(JSObject *obj, uint32_t *length, uint8_t **data);\n\n/*\n * Get the type of elements in a typed array, or TYPE_DATAVIEW if a DataView.\n *\n * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is an ArrayBufferView or a\n * wrapper of an ArrayBufferView, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(JSArrayBufferViewType)\nJS_GetArrayBufferViewType(JSObject *obj);\n\n/*\n * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping. If this test succeeds, then it is safe to call the various\n * accessor JSAPI calls defined below.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferObject(JSObject *obj);\n\n/*\n * Return the available byte length of an array buffer.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferByteLength(JSObject *obj);\n\n/*\n * Return a pointer to an array buffer's data. The buffer is still owned by the\n * array buffer object, and should not be modified on another thread. The\n * returned pointer is stable across GCs.\n *\n * |obj| must have passed a JS_IsArrayBufferObject test, or somehow be known\n * that it would pass such a test: it is an ArrayBuffer or a wrapper of an\n * ArrayBuffer, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint8_t *)\nJS_GetArrayBufferData(JSObject *obj);\n\n/*\n * Return the number of elements in a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayLength(JSObject *obj);\n\n/*\n * Return the byte offset from the start of an array buffer to the start of a\n * typed array view.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a typed array.\n *\n * |obj| must have passed a JS_IsTypedArrayObject/JS_Is*Array test, or somehow\n * be known that it would pass such a test: it is a typed array or a wrapper of\n * a typed array, and the unwrapping will succeed.\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetTypedArrayByteLength(JSObject *obj);\n\n/*\n * Check whether obj supports JS_ArrayBufferView* APIs. Note that this may\n * return false if a security wrapper is encountered that denies the\n * unwrapping.\n */\nextern JS_FRIEND_API(JSBool)\nJS_IsArrayBufferViewObject(JSObject *obj);\n\n/*\n * More generic name for JS_GetTypedArrayByteLength to cover DataViews as well\n */\nextern JS_FRIEND_API(uint32_t)\nJS_GetArrayBufferViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the start of the data referenced by a typed array. The\n * data is still owned by the typed array, and should not be modified on\n * another thread.\n *\n * |obj| must have passed a JS_Is*Array test, or somehow be known that it would\n * pass such a test: it is a typed array or a wrapper of a typed array, and the\n * unwrapping will succeed.\n */\n\nextern JS_FRIEND_API(int8_t *)\nJS_GetInt8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint8_t *)\nJS_GetUint8ClampedArrayData(JSObject *obj);\nextern JS_FRIEND_API(int16_t *)\nJS_GetInt16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint16_t *)\nJS_GetUint16ArrayData(JSObject *obj);\nextern JS_FRIEND_API(int32_t *)\nJS_GetInt32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(uint32_t *)\nJS_GetUint32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(float *)\nJS_GetFloat32ArrayData(JSObject *obj);\nextern JS_FRIEND_API(double *)\nJS_GetFloat64ArrayData(JSObject *obj);\n\n/*\n * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific\n * versions when possible.\n */\nextern JS_FRIEND_API(void *)\nJS_GetArrayBufferViewData(JSObject *obj);\n\n/*\n * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been\n * neutered, this will still return the neutered buffer. |obj| must be an\n * object that would return true for JS_IsArrayBufferViewObject().\n */\nextern JS_FRIEND_API(JSObject *)\nJS_GetArrayBufferViewBuffer(JSObject *obj);\n\n/*\n * Check whether obj supports JS_GetDataView* APIs.\n */\nJS_FRIEND_API(JSBool)\nJS_IsDataViewObject(JSObject *obj);\n\n/*\n * Return the byte offset of a data view into its array buffer. |obj| must be a\n * DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteOffset(JSObject *obj);\n\n/*\n * Return the byte length of a data view.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(uint32_t)\nJS_GetDataViewByteLength(JSObject *obj);\n\n/*\n * Return a pointer to the beginning of the data referenced by a DataView.\n *\n * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that\n * it would pass such a test: it is a data view or a wrapper of a data view,\n * and the unwrapping will succeed. If cx is NULL, then DEBUG builds may be\n * unable to assert when unwrapping should be disallowed.\n */\nJS_FRIEND_API(void *)\nJS_GetDataViewData(JSObject *obj);\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitGetterOp.\n */\nclass JSJitGetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitGetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args.rval())\n    {}\n\n    explicit JSJitGetterCallArgs(JS::Rooted<JS::Value>* rooted)\n      : JS::MutableHandleValue(rooted)\n    {}\n\n    JS::MutableHandleValue rval() {\n        return *this;\n    }\n};\n\n/*\n * A class, expected to be passed by value, which represents the CallArgs for a\n * JSJitSetterOp.\n */\nclass JSJitSetterCallArgs : protected JS::MutableHandleValue\n{\n  public:\n    explicit JSJitSetterCallArgs(const JS::CallArgs& args)\n      : JS::MutableHandleValue(args[0])\n    {}\n\n    JS::MutableHandleValue operator[](unsigned i) {\n        MOZ_ASSERT(i == 0);\n        return *this;\n    }\n\n    unsigned length() const { return 1; }\n\n    // Add get() or maybe hasDefined() as needed\n};\n\nstruct JSJitMethodCallArgsTraits;\n\n/*\n * A class, expected to be passed by reference, which represents the CallArgs\n * for a JSJitMethodOp.\n */\nclass JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUsedRval>\n{\n  private:\n    typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;\n    friend struct JSJitMethodCallArgsTraits;\n\n  public:\n    explicit JSJitMethodCallArgs(const JS::CallArgs& args) {\n        argv_ = args.array();\n        argc_ = args.length();\n    }\n\n    JS::MutableHandleValue rval() const {\n        return Base::rval();\n    }\n\n    unsigned length() const { return Base::length(); }\n\n    JS::MutableHandleValue operator[](unsigned i) const {\n        return Base::operator[](i);\n    }\n\n    bool hasDefined(unsigned i) const {\n        return Base::hasDefined(i);\n    }\n\n    // Add get() as needed\n};\n\nstruct JSJitMethodCallArgsTraits\n{\n    static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);\n    static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);\n};\n\n/*\n * This struct contains metadata passed from the DOM to the JS Engine for JIT\n * optimizations on DOM property accessors. Eventually, this should be made\n * available to general JSAPI users, but we are not currently ready to do so.\n */\ntypedef bool\n(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitGetterCallArgs args);\ntypedef bool\n(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, JSJitSetterCallArgs args);\ntypedef bool\n(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,\n                  void *specializedThis, const JSJitMethodCallArgs& args);\n\nstruct JSJitInfo {\n    enum OpType {\n        Getter,\n        Setter,\n        Method,\n        OpType_None\n    };\n\n    union {\n        JSJitGetterOp getter;\n        JSJitSetterOp setter;\n        JSJitMethodOp method;\n    };\n    uint32_t protoID;\n    uint32_t depth;\n    OpType type;\n    bool isInfallible;      /* Is op fallible? False in setters. */\n    bool isConstant;        /* Getting a construction-time constant? */\n    bool isPure;            /* As long as no non-pure DOM things happen, will\n                               keep returning the same value for the given\n                               \"this\" object\" */\n    JSValueType returnType; /* The return type tag.  Might be JSVAL_TYPE_UNKNOWN */\n\n    /* An alternative native that's safe to call in parallel mode. */\n    JSParallelNative parallelNative;\n};\n\n#define JS_JITINFO_NATIVE_PARALLEL(op)                                         \\\n    {{NULL},0,0,JSJitInfo::OpType_None,false,false,false,JSVAL_TYPE_MISSING,op}\n\nstatic JS_ALWAYS_INLINE const JSJitInfo *\nFUNCTION_VALUE_TO_JITINFO(const JS::Value& v)\n{\n    JS_ASSERT(js::GetObjectClass(&v.toObject()) == js::FunctionClassPtr);\n    return reinterpret_cast<js::shadow::Function *>(&v.toObject())->jitinfo;\n}\n\n/* Statically asserted in jsfun.h. */\nstatic const unsigned JS_FUNCTION_INTERPRETED_BIT = 0x1;\n\nstatic JS_ALWAYS_INLINE void\nSET_JITINFO(JSFunction * func, const JSJitInfo *info)\n{\n    js::shadow::Function *fun = reinterpret_cast<js::shadow::Function *>(func);\n    JS_ASSERT(!(fun->flags & JS_FUNCTION_INTERPRETED_BIT));\n    fun->jitinfo = info;\n}\n\n/*\n * Engine-internal extensions of jsid.  This code is here only until we\n * eliminate Gecko's dependencies on it!\n */\n\nstatic JS_ALWAYS_INLINE jsid\nJSID_FROM_BITS(size_t bits)\n{\n    jsid id;\n    JSID_BITS(id) = bits;\n    return id;\n}\n\n/*\n * Must not be used on atoms that are representable as integer jsids.\n * Prefer NameToId or AtomToId over this function:\n *\n * A PropertyName is an atom that does not contain an integer in the range\n * [0, UINT32_MAX]. However, jsid can only hold an integer in the range\n * [0, JSID_INT_MAX] (where JSID_INT_MAX == 2^31-1).  Thus, for the range of\n * integers (JSID_INT_MAX, UINT32_MAX], to represent as a jsid 'id', it must be\n * the case JSID_IS_ATOM(id) and !JSID_TO_ATOM(id)->isPropertyName().  In most\n * cases when creating a jsid, code does not have to care about this corner\n * case because:\n *\n * - When given an arbitrary JSAtom*, AtomToId must be used, which checks for\n *   integer atoms representable as integer jsids, and does this conversion.\n *\n * - When given a PropertyName*, NameToId can be used which which does not need\n *   to do any dynamic checks.\n *\n * Thus, it is only the rare third case which needs this function, which\n * handles any JSAtom* that is known not to be representable with an int jsid.\n */\nstatic JS_ALWAYS_INLINE jsid\nNON_INTEGER_ATOM_TO_JSID(JSAtom *atom)\n{\n    JS_ASSERT(((size_t)atom & 0x7) == 0);\n    jsid id = JSID_FROM_BITS((size_t)atom);\n    JS_ASSERT(id == INTERNED_STRING_TO_JSID(NULL, (JSString*)atom));\n    return id;\n}\n\n/* All strings stored in jsids are atomized, but are not necessarily property names. */\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id)\n{\n    return JSID_IS_STRING(id);\n}\n\nstatic JS_ALWAYS_INLINE JSBool\nJSID_IS_ATOM(jsid id, JSAtom *atom)\n{\n    return id == JSID_FROM_BITS((size_t)atom);\n}\n\nstatic JS_ALWAYS_INLINE JSAtom *\nJSID_TO_ATOM(jsid id)\n{\n    return (JSAtom *)JSID_TO_STRING(id);\n}\n\nJS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD);\n\nnamespace js {\n\nstatic JS_ALWAYS_INLINE Value\nIdToValue(jsid id)\n{\n    if (JSID_IS_STRING(id))\n        return StringValue(JSID_TO_STRING(id));\n    if (JS_LIKELY(JSID_IS_INT(id)))\n        return Int32Value(JSID_TO_INT(id));\n    if (JS_LIKELY(JSID_IS_OBJECT(id)))\n        return ObjectValue(*JSID_TO_OBJECT(id));\n    JS_ASSERT(JSID_IS_VOID(id));\n    return UndefinedValue();\n}\n\nstatic JS_ALWAYS_INLINE jsval\nIdToJsval(jsid id)\n{\n    return IdToValue(id);\n}\n\nextern JS_FRIEND_API(bool)\nIsReadOnlyDateMethod(JS::IsAcceptableThis test, JS::NativeImpl method);\n\nextern JS_FRIEND_API(bool)\nIsTypedArrayThisCheck(JS::IsAcceptableThis test);\n\nenum CTypesActivityType {\n    CTYPES_CALL_BEGIN,\n    CTYPES_CALL_END,\n    CTYPES_CALLBACK_BEGIN,\n    CTYPES_CALLBACK_END\n};\n\ntypedef void\n(* CTypesActivityCallback)(JSContext *cx, CTypesActivityType type);\n\n/*\n * Sets a callback that is run whenever js-ctypes is about to be used when\n * calling into C.\n */\nJS_FRIEND_API(void)\nSetCTypesActivityCallback(JSRuntime *rt, CTypesActivityCallback cb);\n\nclass JS_FRIEND_API(AutoCTypesActivityCallback) {\n  private:\n    JSContext *cx;\n    CTypesActivityCallback callback;\n    CTypesActivityType endType;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n\n  public:\n    AutoCTypesActivityCallback(JSContext *cx, CTypesActivityType beginType,\n                               CTypesActivityType endType\n                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM);\n    ~AutoCTypesActivityCallback() {\n        DoEndCallback();\n    }\n    void DoEndCallback() {\n        if (callback) {\n            callback(cx, endType);\n            callback = NULL;\n        }\n    }\n};\n\n#ifdef DEBUG\nextern JS_FRIEND_API(void)\nassertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);\n#else\ninline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id) {};\n#endif\n\ntypedef bool\n(* ObjectMetadataCallback)(JSContext *cx, JSObject **pmetadata);\n\n/*\n * Specify a callback to invoke when creating each JS object in the current\n * compartment, which may return a metadata object to associate with the\n * object. Objects with different metadata have different shape hierarchies,\n * so for efficiency, objects should generally try to share metadata objects.\n */\nJS_FRIEND_API(void)\nSetObjectMetadataCallback(JSContext *cx, ObjectMetadataCallback callback);\n\n/* Manipulate the metadata associated with an object. */\n\nJS_FRIEND_API(bool)\nSetObjectMetadata(JSContext *cx, JS::HandleObject obj, JS::HandleObject metadata);\n\nJS_FRIEND_API(JSObject *)\nGetObjectMetadata(JSObject *obj);\n\n/* ES5 8.12.8. */\nextern JS_FRIEND_API(JSBool)\nDefaultValue(JSContext *cx, JS::HandleObject obj, JSType hint, MutableHandleValue vp);\n\n/*\n * Helper function. To approximate a call to the [[DefineOwnProperty]] internal\n * method described in ES5, first call this, then call JS_DefinePropertyById.\n *\n * JS_DefinePropertyById by itself does not enforce the invariants on\n * non-configurable properties when obj->isNative(). This function performs the\n * relevant checks (specified in ES5 8.12.9 [[DefineOwnProperty]] steps 1-11),\n * but only if obj is native.\n *\n * The reason for the messiness here is that ES5 uses [[DefineOwnProperty]] as\n * a sort of extension point, but there is no hook in js::Class,\n * js::ProxyHandler, or the JSAPI with precisely the right semantics for it.\n */\nextern JS_FRIEND_API(bool)\nCheckDefineProperty(JSContext *cx, HandleObject obj, HandleId id, HandleValue value,\n                    PropertyOp getter, StrictPropertyOp setter, unsigned attrs);\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSBool)\njs_DefineOwnProperty(JSContext *cx, JSObject *objArg, jsid idArg,\n                     const js::PropertyDescriptor& descriptor, JSBool *bp);\n\nextern JS_FRIEND_API(JSBool)\njs_ReportIsNotFunction(JSContext *cx, const JS::Value& v);\n\n#ifdef JSGC_GENERATIONAL\nextern JS_FRIEND_API(void)\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data);\n\nextern JS_FRIEND_API(void)\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data);\n#else\ninline void\nJS_StoreObjectPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSObject *key, void *data) {}\n\ninline void\nJS_StoreStringPostBarrierCallback(JSContext* cx,\n                                  void (*callback)(JSTracer *trc, void *key, void *data),\n                                  JSString *key, void *data) {}\n#endif /* JSGC_GENERATIONAL */\n\n#endif /* jsfriendapi_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jslock.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jslock_h\n#define jslock_h\n\n#ifdef JS_THREADSAFE\n\n# include \"jsapi.h\"\n# include \"pratom.h\"\n# include \"prcvar.h\"\n# include \"prinit.h\"\n# include \"prlock.h\"\n# include \"prthread.h\"\n\n# define JS_ATOMIC_INCREMENT(p)      PR_ATOMIC_INCREMENT((int32_t *)(p))\n# define JS_ATOMIC_DECREMENT(p)      PR_ATOMIC_DECREMENT((int32_t *)(p))\n# define JS_ATOMIC_ADD(p,v)          PR_ATOMIC_ADD((int32_t *)(p), (int32_t)(v))\n# define JS_ATOMIC_SET(p,v)          PR_ATOMIC_SET((int32_t *)(p), (int32_t)(v))\n\nnamespace js {\n    // Defined in jsgc.cpp.\n    unsigned GetCPUCount();\n}\n\n#else  /* JS_THREADSAFE */\n\ntypedef struct PRThread PRThread;\ntypedef struct PRCondVar PRCondVar;\ntypedef struct PRLock PRLock;\n\n# define JS_ATOMIC_INCREMENT(p)      (++*(p))\n# define JS_ATOMIC_DECREMENT(p)      (--*(p))\n# define JS_ATOMIC_ADD(p,v)          (*(p) += (v))\n# define JS_ATOMIC_SET(p,v)          (*(p) = (v))\n\n#endif /* JS_THREADSAFE */\n\n#endif /* jslock_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsperf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef perf_jsperf_h\n#define perf_jsperf_h\n\n#include \"jsapi.h\"\n\nnamespace JS {\n\n/*\n * JS::PerfMeasurement is a generic way to access detailed performance\n * measurement APIs provided by your operating system.  The details of\n * exactly how this works and what can be measured are highly\n * system-specific, but this interface is (one hopes) implementable\n * on top of all of them.\n *\n * To use this API, create a PerfMeasurement object, passing its\n * constructor a bitmask indicating which events you are interested\n * in.  Thereafter, Start() zeroes all counters and starts timing;\n * Stop() stops timing again; and the counters for the events you\n * requested are available as data values after calling Stop().  The\n * object may be reused for many measurements.\n */\nclass JS_FRIEND_API(PerfMeasurement)\n{\n  protected:\n    // Implementation-specific data, if any.\n    void* impl;\n\n  public:\n    /*\n     * Events that may be measured.  Taken directly from the list of\n     * \"generalized hardware performance event types\" in the Linux\n     * perf_event API, plus some of the \"software events\".\n     */\n    enum EventMask {\n        CPU_CYCLES          = 0x00000001,\n        INSTRUCTIONS        = 0x00000002,\n        CACHE_REFERENCES    = 0x00000004,\n        CACHE_MISSES        = 0x00000008,\n        BRANCH_INSTRUCTIONS = 0x00000010,\n        BRANCH_MISSES       = 0x00000020,\n        BUS_CYCLES          = 0x00000040,\n        PAGE_FAULTS         = 0x00000080,\n        MAJOR_PAGE_FAULTS   = 0x00000100,\n        CONTEXT_SWITCHES    = 0x00000200,\n        CPU_MIGRATIONS      = 0x00000400,\n\n        ALL                 = 0x000007ff,\n        NUM_MEASURABLE_EVENTS  = 11\n    };\n\n    /*\n     * Bitmask of events that will be measured when this object is\n     * active (between Start() and Stop()).  This may differ from the\n     * bitmask passed to the constructor if the platform does not\n     * support measuring all of the requested events.\n     */\n    const EventMask eventsMeasured;\n\n    /*\n     * Counters for each measurable event.\n     * Immediately after one of these objects is created, all of the\n     * counters for enabled events will be zero, and all of the\n     * counters for disabled events will be uint64_t(-1).\n     */\n    uint64_t cpu_cycles;\n    uint64_t instructions;\n    uint64_t cache_references;\n    uint64_t cache_misses;\n    uint64_t branch_instructions;\n    uint64_t branch_misses;\n    uint64_t bus_cycles;\n    uint64_t page_faults;\n    uint64_t major_page_faults;\n    uint64_t context_switches;\n    uint64_t cpu_migrations;\n\n    /*\n     * Prepare to measure the indicated set of events.  If not all of\n     * the requested events can be measured on the current platform,\n     * then the eventsMeasured bitmask will only include the subset of\n     * |toMeasure| corresponding to the events that can be measured.\n     */\n    PerfMeasurement(EventMask toMeasure);\n\n    /* Done with this set of measurements, tear down OS-level state. */\n    ~PerfMeasurement();\n\n    /* Start a measurement cycle. */\n    void start();\n\n    /*\n     * End a measurement cycle, and for each enabled counter, add the\n     * number of measured events of that type to the appropriate\n     * visible variable.\n     */\n    void stop();\n\n    /* Reset all enabled counters to zero. */\n    void reset();\n\n    /*\n     * True if this platform supports measuring _something_, i.e. it's\n     * not using the stub implementation.\n     */\n    static bool canMeasureSomething();\n};\n\n/* Inject a Javascript wrapper around the above C++ class into the\n * Javascript object passed as an argument (this will normally be a\n * global object).  The JS-visible API is identical to the C++ API.\n */\nextern JS_FRIEND_API(JSObject*)\n    RegisterPerfMeasurement(JSContext *cx, JSObject *global);\n\n/*\n * Given a jsval which contains an instance of the aforementioned\n * wrapper class, extract the C++ object.  Returns NULL if the\n * jsval is not an instance of the wrapper.\n */\nextern JS_FRIEND_API(PerfMeasurement*)\n    ExtractPerfMeasurement(jsval wrapper);\n\n} // namespace JS\n\n#endif /* perf_jsperf_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsprf.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprf_h\n#define jsprf_h\n\n/*\n** API for PR printf like routines. Supports the following formats\n**      %d - decimal\n**      %u - unsigned decimal\n**      %x - unsigned hex\n**      %X - unsigned uppercase hex\n**      %o - unsigned octal\n**      %hd, %hu, %hx, %hX, %ho - 16-bit versions of above\n**      %ld, %lu, %lx, %lX, %lo - 32-bit versions of above\n**      %lld, %llu, %llx, %llX, %llo - 64 bit versions of above\n**      %s - ascii string\n**      %hs - ucs2 string\n**      %c - character\n**      %p - pointer (deals with machine dependent pointer size)\n**      %f - float\n**      %g - float\n*/\n\n#include <stdarg.h>\n#include <stdio.h>\n\n#include \"jstypes.h\"\n\n/*\n** sprintf into a fixed size buffer. Guarantees that a NUL is at the end\n** of the buffer. Returns the length of the written output, NOT including\n** the NUL, or (uint32_t)-1 if an error occurs.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_snprintf(char *out, uint32_t outlen, const char *fmt, ...);\n\n/*\n** sprintf into a malloc'd buffer. Return a pointer to the malloc'd\n** buffer on success, NULL on failure. Call \"JS_smprintf_free\" to release\n** the memory returned.\n*/\nextern JS_PUBLIC_API(char*) JS_smprintf(const char *fmt, ...);\n\n/*\n** Free the memory allocated, for the caller, by JS_smprintf\n*/\nextern JS_PUBLIC_API(void) JS_smprintf_free(char *mem);\n\n/*\n** \"append\" sprintf into a malloc'd buffer. \"last\" is the last value of\n** the malloc'd buffer. sprintf will append data to the end of last,\n** growing it as necessary using realloc. If last is NULL, JS_sprintf_append\n** will allocate the initial string. The return value is the new value of\n** last for subsequent calls, or NULL if there is a malloc failure.\n*/\nextern JS_PUBLIC_API(char*) JS_sprintf_append(char *last, const char *fmt, ...);\n\n/*\n** sprintf into a function. The function \"f\" is called with a string to\n** place into the output. \"arg\" is an opaque pointer used by the stuff\n** function to hold any state needed to do the storage of the output\n** data. The return value is a count of the number of characters fed to\n** the stuff function, or (uint32_t)-1 if an error occurs.\n*/\ntypedef int (*JSStuffFunc)(void *arg, const char *s, uint32_t slen);\n\nextern JS_PUBLIC_API(uint32_t) JS_sxprintf(JSStuffFunc f, void *arg, const char *fmt, ...);\n\n/*\n** va_list forms of the above.\n*/\nextern JS_PUBLIC_API(uint32_t) JS_vsnprintf(char *out, uint32_t outlen, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsmprintf(const char *fmt, va_list ap);\nextern JS_PUBLIC_API(char*) JS_vsprintf_append(char *last, const char *fmt, va_list ap);\nextern JS_PUBLIC_API(uint32_t) JS_vsxprintf(JSStuffFunc f, void *arg, const char *fmt, va_list ap);\n\n#endif /* jsprf_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsprototypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A higher-order macro for enumerating all JSProtoKey values. */\n\n#ifndef jsprototypes_h\n#define jsprototypes_h\n\n#include \"jsversion.h\"\n\n/*\n * Enumerator codes in the second column must not change -- they are part of\n * the JS XDR API.  Also note the symbols in the third column are extern \"C\";\n * clients should use extern \"C\" {} as appropriate when using this macro.\n */\n\n#define JS_FOR_EACH_PROTOTYPE(macro) \\\n    macro(Null,                   0,     js_InitNullClass) \\\n    macro(Object,                 1,     js_InitObjectClass) \\\n    macro(Function,               2,     js_InitFunctionClass) \\\n    macro(Array,                  3,     js_InitArrayClass) \\\n    macro(Boolean,                4,     js_InitBooleanClass) \\\n    macro(JSON,                   5,     js_InitJSONClass) \\\n    macro(Date,                   6,     js_InitDateClass) \\\n    macro(Math,                   7,     js_InitMathClass) \\\n    macro(Number,                 8,     js_InitNumberClass) \\\n    macro(String,                 9,     js_InitStringClass) \\\n    macro(RegExp,                10,     js_InitRegExpClass) \\\n    macro(Error,                 11,     js_InitExceptionClasses) \\\n    macro(InternalError,         12,     js_InitExceptionClasses) \\\n    macro(EvalError,             13,     js_InitExceptionClasses) \\\n    macro(RangeError,            14,     js_InitExceptionClasses) \\\n    macro(ReferenceError,        15,     js_InitExceptionClasses) \\\n    macro(SyntaxError,           16,     js_InitExceptionClasses) \\\n    macro(TypeError,             17,     js_InitExceptionClasses) \\\n    macro(URIError,              18,     js_InitExceptionClasses) \\\n    macro(Iterator,              19,     js_InitIteratorClasses) \\\n    macro(StopIteration,         20,     js_InitIteratorClasses) \\\n    macro(ArrayBuffer,           21,     js_InitTypedArrayClasses) \\\n    macro(Int8Array,             22,     js_InitTypedArrayClasses) \\\n    macro(Uint8Array,            23,     js_InitTypedArrayClasses) \\\n    macro(Int16Array,            24,     js_InitTypedArrayClasses) \\\n    macro(Uint16Array,           25,     js_InitTypedArrayClasses) \\\n    macro(Int32Array,            26,     js_InitTypedArrayClasses) \\\n    macro(Uint32Array,           27,     js_InitTypedArrayClasses) \\\n    macro(Float32Array,          28,     js_InitTypedArrayClasses) \\\n    macro(Float64Array,          29,     js_InitTypedArrayClasses) \\\n    macro(Uint8ClampedArray,     30,     js_InitTypedArrayClasses) \\\n    macro(Proxy,                 31,     js_InitProxyClass) \\\n    macro(WeakMap,               32,     js_InitWeakMapClass) \\\n    macro(Map,                   33,     js_InitMapClass) \\\n    macro(Set,                   34,     js_InitSetClass) \\\n    macro(DataView,              35,     js_InitTypedArrayClasses) \\\n    macro(ParallelArray,         36,     js_InitParallelArrayClass) \\\n    macro(Intl,                  37,     js_InitIntlClass) \\\n    macro(Type,                  38,     js_InitBinaryDataClasses) \\\n    macro(Data,                  39,     js_InitBinaryDataClasses) \\\n    macro(uint8,                 40,     js_InitBinaryDataClasses) \\\n    macro(uint16,                41,     js_InitBinaryDataClasses) \\\n    macro(uint32,                42,     js_InitBinaryDataClasses) \\\n    macro(uint64,                43,     js_InitBinaryDataClasses) \\\n    macro(int8,                  44,     js_InitBinaryDataClasses) \\\n    macro(int16,                 45,     js_InitBinaryDataClasses) \\\n    macro(int32,                 46,     js_InitBinaryDataClasses) \\\n    macro(int64,                 47,     js_InitBinaryDataClasses) \\\n    macro(float32,               48,     js_InitBinaryDataClasses) \\\n    macro(float64,               49,     js_InitBinaryDataClasses) \\\n    macro(ArrayType,             50,     js_InitBinaryDataClasses) \\\n    macro(StructType,            51,     js_InitBinaryDataClasses) \\\n    macro(ArrayTypeObject,       52,     js_InitBinaryDataClasses) \\\n\n#endif /* jsprototypes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsproxy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsproxy_h\n#define jsproxy_h\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\nnamespace js {\n\nclass JS_FRIEND_API(Wrapper);\n\n/*\n * A proxy is a JSObject that implements generic behavior by providing custom\n * implementations for each object trap. The implementation for each trap is\n * provided by a C++ object stored on the proxy, known as its handler.\n *\n * A major use case for proxies is to forward each trap to another object,\n * known as its target. The target can be an arbitrary C++ object. Not every\n * proxy has the notion of a target, however.\n *\n * Proxy traps are grouped into fundamental and derived traps. Every proxy has\n * to at least provide implementations for the fundamental traps, but the\n * derived traps can be implemented in terms of the fundamental ones\n * BaseProxyHandler provides implementations of the derived traps in terms of\n * the (pure virtual) fundamental traps.\n *\n * To minimize code duplication, a set of abstract proxy handler classes is\n * provided, from which other handlers may inherit. These abstract classes\n * are organized in the following hierarchy:\n *\n * BaseProxyHandler\n * |\n * DirectProxyHandler\n * |\n * Wrapper\n */\n\n/*\n * BaseProxyHandler is the most generic kind of proxy handler. It does not make\n * any assumptions about the target. Consequently, it does not provide any\n * default implementation for the fundamental traps. It does, however, implement\n * the derived traps in terms of the fundamental ones. This allows consumers of\n * this class to define any custom behavior they want.\n */\nclass JS_FRIEND_API(BaseProxyHandler)\n{\n    void *mFamily;\n    bool mHasPrototype;\n    bool mHasPolicy;\n  protected:\n    // Subclasses may set this in their constructor.\n    void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }\n    void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; }\n\n  public:\n    explicit BaseProxyHandler(void *family);\n    virtual ~BaseProxyHandler();\n\n    bool hasPrototype() {\n        return mHasPrototype;\n    }\n\n    bool hasPolicy() {\n        return mHasPolicy;\n    }\n\n    inline void *family() {\n        return mFamily;\n    }\n\n    virtual bool isOuterWindow() {\n        return false;\n    }\n\n    virtual bool finalizeInBackground(Value priv) {\n        /*\n         * Called on creation of a proxy to determine whether its finalize\n         * method can be finalized on the background thread.\n         */\n        return true;\n    }\n\n    /* Policy enforcement traps.\n     *\n     * enter() allows the policy to specify whether the caller may perform |act|\n     * on the proxy's |id| property. In the case when |act| is CALL, |id| is\n     * generally JSID_VOID.\n     *\n     * The |act| parameter to enter() specifies the action being performed.\n     * If |bp| is false, the trap suggests that the caller throw (though it\n     * may still decide to squelch the error).\n     */\n    enum Action {\n        GET,\n        SET,\n        CALL\n    };\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,\n                       bool *bp);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) = 0;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) = 0;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) = 0;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) = 0;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) = 0;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) = 0;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props) = 0;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp);\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp);\n    virtual bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) = 0;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    virtual const char *className(JSContext *cx, HandleObject proxy);\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    virtual void finalize(JSFreeOp *fop, JSObject *proxy);\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp, bool *present);\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    /* See comment for weakmapKeyDelegateOp in jsclass.h. */\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/*\n * DirectProxyHandler includes a notion of a target object. All traps are\n * reimplemented such that they forward their behavior to the target. This\n * allows consumers of this class to forward to another object as transparently\n * and efficiently as possible.\n */\nclass JS_PUBLIC_API(DirectProxyHandler) : public BaseProxyHandler\n{\n  public:\n    explicit DirectProxyHandler(void *family);\n\n    /* ES5 Harmony fundamental proxy traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy,\n                                          HandleId id, PropertyDescriptor *desc,\n                                          unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject proxy,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,\n                         bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject proxy,\n                           AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived proxy traps. */\n    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id,\n                     bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id,\n                        bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject proxy,\n                      AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject proxy, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy,\n                                 RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual JSObject *weakmapKeyDelegate(JSObject *proxy);\n};\n\n/* Dispatch point for handlers that executes the appropriate C++ or scripted traps. */\nclass Proxy\n{\n  public:\n    /* ES5 Harmony fundamental proxy traps. */\n    static bool preventExtensions(JSContext *cx, HandleObject proxy);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                      PropertyDescriptor *desc, unsigned flags);\n    static bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                      MutableHandleValue vp);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,\n                                         PropertyDescriptor *desc, unsigned flags);\n    static bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, unsigned flags, HandleId id,\n                                         MutableHandleValue vp);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, PropertyDescriptor *desc);\n    static bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id, HandleValue v);\n    static bool getOwnPropertyNames(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool delete_(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool enumerate(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n\n    /* ES5 Harmony derived proxy traps. */\n    static bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp);\n    static bool get(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    MutableHandleValue vp);\n    static bool getElementIfPresent(JSContext *cx, HandleObject proxy, HandleObject receiver,\n                                    uint32_t index, MutableHandleValue vp, bool *present);\n    static bool set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id,\n                    bool strict, MutableHandleValue vp);\n    static bool keys(JSContext *cx, HandleObject proxy, AutoIdVector &props);\n    static bool iterate(JSContext *cx, HandleObject proxy, unsigned flags, MutableHandleValue vp);\n\n    /* Spidermonkey extensions. */\n    static bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible);\n    static bool call(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args);\n    static bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);\n    static bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp);\n    static bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx);\n    static const char *className(JSContext *cx, HandleObject proxy);\n    static JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent);\n    static bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g);\n    static bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp);\n    static bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static JSObject * const LazyProto;\n};\n\ninline bool IsObjectProxyClass(const Class *clasp)\n{\n    return clasp == js::ObjectProxyClassPtr || clasp == js::OuterWindowProxyClassPtr;\n}\n\ninline bool IsFunctionProxyClass(const Class *clasp)\n{\n    return clasp == js::FunctionProxyClassPtr;\n}\n\ninline bool IsProxyClass(const Class *clasp)\n{\n    return IsObjectProxyClass(clasp) || IsFunctionProxyClass(clasp);\n}\n\ninline bool IsObjectProxy(JSObject *obj)\n{\n    return IsObjectProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsFunctionProxy(JSObject *obj)\n{\n    return IsFunctionProxyClass(GetObjectClass(obj));\n}\n\ninline bool IsProxy(JSObject *obj)\n{\n    return IsProxyClass(GetObjectClass(obj));\n}\n\n/*\n * These are part of the API.\n *\n * NOTE: PROXY_PRIVATE_SLOT is 0 because that way slot 0 is usable by API\n * clients for both proxy and non-proxy objects.  So an API client that only\n * needs to store one slot's worth of data doesn't need to branch on what sort\n * of object it has.\n */\nconst uint32_t PROXY_PRIVATE_SLOT = 0;\nconst uint32_t PROXY_HANDLER_SLOT = 1;\nconst uint32_t PROXY_EXTRA_SLOT   = 2;\n\ninline BaseProxyHandler *\nGetProxyHandler(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return (BaseProxyHandler *) GetReservedSlot(obj, PROXY_HANDLER_SLOT).toPrivate();\n}\n\ninline const Value &\nGetProxyPrivate(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_PRIVATE_SLOT);\n}\n\ninline JSObject *\nGetProxyTargetObject(JSObject *obj)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetProxyPrivate(obj).toObjectOrNull();\n}\n\ninline const Value &\nGetProxyExtra(JSObject *obj, size_t n)\n{\n    JS_ASSERT(IsProxy(obj));\n    return GetReservedSlot(obj, PROXY_EXTRA_SLOT + n);\n}\n\ninline void\nSetProxyHandler(JSObject *obj, BaseProxyHandler *handler)\n{\n    JS_ASSERT(IsProxy(obj));\n    SetReservedSlot(obj, PROXY_HANDLER_SLOT, PrivateValue(handler));\n}\n\ninline void\nSetProxyExtra(JSObject *obj, size_t n, const Value &extra)\n{\n    JS_ASSERT(IsProxy(obj));\n    JS_ASSERT(n <= 1);\n    SetReservedSlot(obj, PROXY_EXTRA_SLOT + n, extra);\n}\n\nenum ProxyCallable {\n    ProxyNotCallable = false,\n    ProxyIsCallable = true\n};\n\nJS_FRIEND_API(JSObject *)\nNewProxyObject(JSContext *cx, BaseProxyHandler *handler, HandleValue priv,\n               JSObject *proto, JSObject *parent, ProxyCallable callable = ProxyNotCallable);\n\nJSObject *\nRenewProxyObject(JSContext *cx, JSObject *obj, BaseProxyHandler *handler, Value priv);\n\nclass JS_FRIEND_API(AutoEnterPolicy)\n{\n  public:\n    typedef BaseProxyHandler::Action Action;\n    AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler,\n                    HandleObject wrapper, HandleId id, Action act, bool mayThrow)\n#ifdef DEBUG\n        : context(NULL)\n#endif\n    {\n        allow = handler->hasPolicy() ? handler->enter(cx, wrapper, id, act, &rv)\n                                     : true;\n        recordEnter(cx, wrapper, id);\n        // We want to throw an exception if all of the following are true:\n        // * The policy disallowed access.\n        // * The policy set rv to false, indicating that we should throw.\n        // * The caller did not instruct us to ignore exceptions.\n        // * The policy did not throw itself.\n        if (!allow && !rv && mayThrow && !JS_IsExceptionPending(cx))\n            reportError(cx, id);\n    }\n\n    virtual ~AutoEnterPolicy() { recordLeave(); }\n    inline bool allowed() { return allow; }\n    inline bool returnValue() { JS_ASSERT(!allowed()); return rv; }\n\n  protected:\n    // no-op constructor for subclass\n    AutoEnterPolicy()\n#ifdef DEBUG\n        : context(NULL)\n#endif\n        {};\n    void reportError(JSContext *cx, jsid id);\n    bool allow;\n    bool rv;\n\n#ifdef DEBUG\n    JSContext *context;\n    mozilla::Maybe<HandleObject> enteredProxy;\n    mozilla::Maybe<HandleId> enteredId;\n    // NB: We explicitly don't track the entered action here, because sometimes\n    // SET traps do an implicit GET during their implementation, leading to\n    // spurious assertions.\n    AutoEnterPolicy *prev;\n    void recordEnter(JSContext *cx, HandleObject proxy, HandleId id);\n    void recordLeave();\n\n    friend JS_FRIEND_API(void) assertEnteredPolicy(JSContext *cx, JSObject *proxy, jsid id);\n#else\n    inline void recordEnter(JSContext *cx, JSObject *proxy, jsid id) {}\n    inline void recordLeave() {}\n#endif\n\n};\n\n#ifdef DEBUG\nclass JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {\npublic:\n    AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id)\n    {\n        allow = true;\n        recordEnter(cx, proxy, id);\n    }\n};\n#else\nclass JS_FRIEND_API(AutoWaivePolicy) {\n    public: AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id) {};\n};\n#endif\n\n} /* namespace js */\n\nextern JS_FRIEND_API(JSObject *)\njs_InitProxyClass(JSContext *cx, JS::HandleObject obj);\n\n#endif /* jsproxy_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsprvtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsprvtd_h\n#define jsprvtd_h\n/*\n * JS private typename definitions.\n *\n * This header is included only in other .h files, for convenience and for\n * simplicity of type naming.  The alternative for structures is to use tags,\n * which are named the same as their typedef names (legal in C/C++, and less\n * noisy than suffixing the typedef name with \"Struct\" or \"Str\").  Instead,\n * all .h files that include this file may use the same typedef name, whether\n * declaring a pointer to struct type, or defining a member of struct type.\n *\n * A few fundamental scalar types are defined here too.  Neither the scalar\n * nor the struct typedefs should change much, therefore the nearly-global\n * make dependency induced by this file should not prove painful.\n */\n\n#include \"jsapi.h\"\n#include \"jsutil.h\"\n\n#include \"js/HashTable.h\"\n#include \"js/Vector.h\"\n\n/*\n * Convenience constants.\n */\n#define JS_BITS_PER_UINT32_LOG2 5\n#define JS_BITS_PER_UINT32      32\n\n/* The alignment required of objects stored in GC arenas. */\nstatic const unsigned JS_GCTHING_ALIGN = 8;\nstatic const unsigned JS_GCTHING_ZEROBITS = 3;\n\n/* Scalar typedefs. */\ntypedef uint8_t     jsbytecode;\ntypedef uint8_t     jssrcnote;\ntypedef uintptr_t   jsatomid;\n\n/* Struct typedefs. */\ntypedef struct JSGCThing            JSGCThing;\ntypedef struct JSGenerator          JSGenerator;\ntypedef struct JSNativeEnumerator   JSNativeEnumerator;\ntypedef struct JSTryNote            JSTryNote;\n\n/* Friend \"Advanced API\" typedefs. */\ntypedef struct JSAtomState          JSAtomState;\ntypedef struct JSCodeSpec           JSCodeSpec;\ntypedef struct JSPrinter            JSPrinter;\ntypedef struct JSStackHeader        JSStackHeader;\ntypedef struct JSSubString          JSSubString;\ntypedef struct JSSpecializedNative  JSSpecializedNative;\n\n/* String typedefs. */\nclass JSDependentString;\nclass JSExtensibleString;\nclass JSExternalString;\nclass JSLinearString;\nclass JSRope;\nclass JSAtom;\nclass JSWrapper;\n\nnamespace js {\n\nstruct ArgumentsData;\nstruct Class;\n\nclass AutoNameVector;\nclass RegExpGuard;\nclass RegExpObject;\nclass RegExpObjectBuilder;\nclass RegExpShared;\nclass RegExpStatics;\nclass MatchPairs;\nclass PropertyName;\nclass LazyScript;\n\nenum RegExpFlag\n{\n    IgnoreCaseFlag  = 0x01,\n    GlobalFlag      = 0x02,\n    MultilineFlag   = 0x04,\n    StickyFlag      = 0x08,\n\n    NoFlags         = 0x00,\n    AllFlags        = 0x0f\n};\n\nclass StringBuffer;\n\nclass FrameRegs;\nclass StackFrame;\nclass ScriptFrameIter;\n\nclass Proxy;\nclass JS_FRIEND_API(AutoEnterPolicy);\nclass JS_FRIEND_API(BaseProxyHandler);\nclass JS_FRIEND_API(Wrapper);\nclass JS_FRIEND_API(CrossCompartmentWrapper);\n\nclass TempAllocPolicy;\nclass RuntimeAllocPolicy;\n\nclass GlobalObject;\n\ntemplate <typename K,\n          typename V,\n          size_t InlineElems>\nclass InlineMap;\n\nclass LifoAlloc;\n\nclass Shape;\n\nclass Breakpoint;\nclass BreakpointSite;\nclass Debugger;\nclass WatchpointMap;\n\n/*\n * Env is the type of what ES5 calls \"lexical environments\" (runtime\n * activations of lexical scopes). This is currently just JSObject, and is\n * implemented by Call, Block, With, and DeclEnv objects, among others--but\n * environments and objects are really two different concepts.\n */\ntypedef JSObject Env;\n\ntypedef JSNative             Native;\ntypedef JSParallelNative     ParallelNative;\ntypedef JSThreadSafeNative   ThreadSafeNative;\ntypedef JSPropertyOp         PropertyOp;\ntypedef JSStrictPropertyOp   StrictPropertyOp;\ntypedef JSPropertyDescriptor PropertyDescriptor;\n\nstruct SourceCompressionToken;\n\nnamespace frontend {\n\nstruct BytecodeEmitter;\nstruct Definition;\nclass FullParseHandler;\nclass FunctionBox;\nclass ObjectBox;\nstruct Token;\nstruct TokenPos;\nclass TokenStream;\nclass ParseMapPool;\nclass ParseNode;\n\ntemplate <typename ParseHandler>\nclass Parser;\n\n} /* namespace frontend */\n\nnamespace analyze {\n\nstruct LifetimeVariable;\nclass LoopAnalysis;\nclass ScriptAnalysis;\nclass SlotValue;\nclass SSAValue;\nclass SSAUseChain;\n\n} /* namespace analyze */\n\nnamespace types {\n\nclass TypeSet;\nstruct TypeCallsite;\nstruct TypeObject;\nstruct TypeCompartment;\n\n} /* namespace types */\n\ntypedef JS::Handle<Shape*>             HandleShape;\ntypedef JS::Handle<types::TypeObject*> HandleTypeObject;\ntypedef JS::Handle<JSAtom*>            HandleAtom;\ntypedef JS::Handle<PropertyName*>      HandlePropertyName;\n\ntypedef JS::MutableHandle<Shape*>      MutableHandleShape;\ntypedef JS::MutableHandle<JSAtom*>     MutableHandleAtom;\n\ntypedef JS::Rooted<Shape*>             RootedShape;\ntypedef JS::Rooted<types::TypeObject*> RootedTypeObject;\ntypedef JS::Rooted<JSAtom*>            RootedAtom;\ntypedef JS::Rooted<PropertyName*>      RootedPropertyName;\n\nenum XDRMode {\n    XDR_ENCODE,\n    XDR_DECODE\n};\n\ntemplate <XDRMode mode>\nclass XDRState;\n\nclass FreeOp;\n\nstruct IdValuePair\n{\n    jsid id;\n    Value value;\n\n    IdValuePair() {}\n    IdValuePair(jsid idArg)\n      : id(idArg), value(UndefinedValue())\n    {}\n};\n\n} /* namespace js */\n\nnamespace JSC {\n\nclass ExecutableAllocator;\n\n} /* namespace JSC */\n\nnamespace WTF {\n\nclass BumpPointerAllocator;\n\n} /* namespace WTF */\n\n/* \"Friend\" types used by jscntxt.h and jsdbgapi.h. */\ntypedef enum JSTrapStatus {\n    JSTRAP_ERROR,\n    JSTRAP_CONTINUE,\n    JSTRAP_RETURN,\n    JSTRAP_THROW,\n    JSTRAP_LIMIT\n} JSTrapStatus;\n\ntypedef JSTrapStatus\n(* JSTrapHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                  jsval closure);\n\ntypedef JSTrapStatus\n(* JSInterruptHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                    void *closure);\n\ntypedef JSTrapStatus\n(* JSDebuggerHandler)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                      void *closure);\n\ntypedef JSTrapStatus\n(* JSThrowHook)(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,\n                void *closure);\n\ntypedef JSBool\n(* JSWatchPointHandler)(JSContext *cx, JSObject *obj, jsid id, jsval old,\n                        jsval *newp, void *closure);\n\n/* called just after script creation */\ntypedef void\n(* JSNewScriptHook)(JSContext  *cx,\n                    const char *filename,  /* URL of script */\n                    unsigned   lineno,     /* first line */\n                    JSScript   *script,\n                    JSFunction *fun,\n                    void       *callerdata);\n\n/* called just before script destruction */\ntypedef void\n(* JSDestroyScriptHook)(JSFreeOp *fop,\n                        JSScript *script,\n                        void     *callerdata);\n\ntypedef void\n(* JSSourceHandler)(const char *filename, unsigned lineno, const jschar *str,\n                    size_t length, void **listenerTSData, void *closure);\n\n/* js::ObjectOps function pointer typedefs. */\n\n/*\n * A generic type for functions mapping an object to another object, or null\n * if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSObjectOp)(JSContext *cx, JS::Handle<JSObject*> obj);\n\n/* Signature for class initialization ops. */\ntypedef JSObject *\n(* JSClassInitializerOp)(JSContext *cx, JS::HandleObject obj);\n\n/*\n * Hook that creates an iterator object for a given object. Returns the\n * iterator object or null if an error or exception was thrown on cx.\n */\ntypedef JSObject *\n(* JSIteratorOp)(JSContext *cx, JS::HandleObject obj, JSBool keysonly);\n\n\n#endif /* jsprvtd_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jspubtd.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jspubtd_h\n#define jspubtd_h\n\n/*\n * JS public API typedefs.\n */\n\n#include \"mozilla/PodOperations.h\"\n\n#include \"jsprototypes.h\"\n#include \"jstypes.h\"\n\n#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || (defined(DEBUG) && !defined(_WIN32))\n# define JSGC_TRACK_EXACT_ROOTS\n#endif\n\nnamespace JS {\n\n/*\n * Allow headers to reference JS::Value without #including the whole jsapi.h.\n * Unfortunately, typedefs (hence jsval) cannot be declared.\n */\nclass Value;\n\ntemplate <typename T>\nclass Rooted;\n\nclass JS_PUBLIC_API(AutoGCRooter);\n\nstruct Zone;\n\n} /* namespace JS */\n\n/*\n * In release builds, jsid is defined to be an integral type. This\n * prevents many bugs from being caught at compile time. E.g.:\n *\n *  jsid id = ...\n *  if (id == JS_TRUE)  // error\n *    ...\n *\n *  size_t n = id;      // error\n *\n * To catch more errors, jsid is given a struct type in C++ debug builds.\n * Struct assignment and (in C++) operator== allow correct code to be mostly\n * oblivious to the change. This feature can be explicitly disabled in debug\n * builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES.\n */\n// Needed for cocos2d-js\n#define JS_NO_JSVAL_JSID_STRUCT_TYPES\n# if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)\n#  define JS_USE_JSID_STRUCT_TYPES\n# endif\n\n# ifdef JS_USE_JSID_STRUCT_TYPES\nstruct jsid\n{\n    size_t asBits;\n    bool operator==(jsid rhs) const { return asBits == rhs.asBits; }\n    bool operator!=(jsid rhs) const { return asBits != rhs.asBits; }\n};\n#  define JSID_BITS(id) (id.asBits)\n# else  /* defined(JS_USE_JSID_STRUCT_TYPES) */\ntypedef ptrdiff_t jsid;\n#  define JSID_BITS(id) (id)\n# endif  /* defined(JS_USE_JSID_STRUCT_TYPES) */\n\n#ifdef WIN32\ntypedef wchar_t   jschar;\n#else\ntypedef uint16_t  jschar;\n#endif\n\n/*\n * Run-time version enumeration.  For compile-time version checking, please use\n * the JS_HAS_* macros in jsversion.h, or use MOZJS_MAJOR_VERSION,\n * MOZJS_MINOR_VERSION, MOZJS_PATCH_VERSION, and MOZJS_ALPHA definitions.\n */\ntypedef enum JSVersion {\n    JSVERSION_ECMA_3  = 148,\n    JSVERSION_1_6     = 160,\n    JSVERSION_1_7     = 170,\n    JSVERSION_1_8     = 180,\n    JSVERSION_ECMA_5  = 185,\n    JSVERSION_DEFAULT = 0,\n    JSVERSION_UNKNOWN = -1,\n    JSVERSION_LATEST  = JSVERSION_ECMA_5\n} JSVersion;\n\n/* Result of typeof operator enumeration. */\ntypedef enum JSType {\n    JSTYPE_VOID,                /* undefined */\n    JSTYPE_OBJECT,              /* object */\n    JSTYPE_FUNCTION,            /* function */\n    JSTYPE_STRING,              /* string */\n    JSTYPE_NUMBER,              /* number */\n    JSTYPE_BOOLEAN,             /* boolean */\n    JSTYPE_NULL,                /* null */\n    JSTYPE_LIMIT\n} JSType;\n\n/* Dense index into cached prototypes and class atoms for standard objects. */\ntypedef enum JSProtoKey {\n#define PROTOKEY_AND_INITIALIZER(name,code,init) JSProto_##name = code,\n    JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)\n#undef JS_PROTO\n    JSProto_LIMIT\n} JSProtoKey;\n\n/* js_CheckAccess mode enumeration. */\ntypedef enum JSAccessMode {\n    JSACC_PROTO  = 0,           /* XXXbe redundant w.r.t. id */\n\n                                /*\n                                 * enum value #1 formerly called JSACC_PARENT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n                                /*\n                                 * enum value #2 formerly called JSACC_IMPORT,\n                                 * gap preserved for ABI compatibility.\n                                 */\n\n    JSACC_WATCH  = 3,           /* a watchpoint on object foo for id 'bar' */\n    JSACC_READ   = 4,           /* a \"get\" of foo.bar */\n    JSACC_WRITE  = 8,           /* a \"set\" of foo.bar = baz */\n    JSACC_LIMIT\n} JSAccessMode;\n\n#define JSACC_TYPEMASK          (JSACC_WRITE - 1)\n\n/*\n * This enum type is used to control the behavior of a JSObject property\n * iterator function that has type JSNewEnumerate.\n */\ntypedef enum JSIterateOp {\n    /* Create new iterator state over enumerable properties. */\n    JSENUMERATE_INIT,\n\n    /* Create new iterator state over all properties. */\n    JSENUMERATE_INIT_ALL,\n\n    /* Iterate once. */\n    JSENUMERATE_NEXT,\n\n    /* Destroy iterator state. */\n    JSENUMERATE_DESTROY\n} JSIterateOp;\n\n/* See JSVAL_TRACE_KIND and JSTraceCallback in jsapi.h. */\ntypedef enum {\n    JSTRACE_OBJECT,\n    JSTRACE_STRING,\n    JSTRACE_SCRIPT,\n\n    /*\n     * Trace kinds internal to the engine. The embedding can only see them if\n     * it implements JSTraceCallback.\n     */\n    JSTRACE_LAZY_SCRIPT,\n    JSTRACE_IONCODE,\n    JSTRACE_SHAPE,\n    JSTRACE_BASE_SHAPE,\n    JSTRACE_TYPE_OBJECT,\n    JSTRACE_LAST = JSTRACE_TYPE_OBJECT\n} JSGCTraceKind;\n\n/* Struct typedefs and class forward declarations. */\ntypedef struct JSClass                      JSClass;\ntypedef struct JSCompartment                JSCompartment;\ntypedef struct JSConstDoubleSpec            JSConstDoubleSpec;\ntypedef struct JSContext                    JSContext;\ntypedef struct JSCrossCompartmentCall       JSCrossCompartmentCall;\ntypedef struct JSErrorReport                JSErrorReport;\ntypedef struct JSExceptionState             JSExceptionState;\ntypedef struct JSFunctionSpec               JSFunctionSpec;\ntypedef struct JSIdArray                    JSIdArray;\ntypedef struct JSLocaleCallbacks            JSLocaleCallbacks;\ntypedef struct JSObjectMap                  JSObjectMap;\ntypedef struct JSPrincipals                 JSPrincipals;\ntypedef struct JSPropertyDescriptor         JSPropertyDescriptor;\ntypedef struct JSPropertyName               JSPropertyName;\ntypedef struct JSPropertySpec               JSPropertySpec;\ntypedef struct JSRuntime                    JSRuntime;\ntypedef struct JSSecurityCallbacks          JSSecurityCallbacks;\ntypedef struct JSStructuredCloneCallbacks   JSStructuredCloneCallbacks;\ntypedef struct JSStructuredCloneReader      JSStructuredCloneReader;\ntypedef struct JSStructuredCloneWriter      JSStructuredCloneWriter;\ntypedef struct JSTracer                     JSTracer;\n\nclass                                       JSFlatString;\nclass                                       JSFunction;\nclass                                       JSObject;\nclass                                       JSScript;\nclass                                       JSStableString;  // long story\nclass                                       JSString;\n\n#ifdef JS_THREADSAFE\ntypedef struct PRCallOnceType    JSCallOnceType;\n#else\ntypedef JSBool                   JSCallOnceType;\n#endif\ntypedef JSBool                 (*JSInitCallback)(void);\n\nnamespace JS {\nnamespace shadow {\n\nstruct Runtime\n{\n    /* Restrict zone access during Minor GC. */\n    bool needsBarrier_;\n\n#ifdef JSGC_GENERATIONAL\n    /* Allow inlining of Nursery::isInside. */\n    uintptr_t gcNurseryStart_;\n    uintptr_t gcNurseryEnd_;\n#endif\n\n    Runtime()\n      : needsBarrier_(false)\n#ifdef JSGC_GENERATIONAL\n      , gcNurseryStart_(0)\n      , gcNurseryEnd_(0)\n#endif\n    {}\n};\n\n} /* namespace shadow */\n} /* namespace JS */\n\nnamespace js {\n\n/*\n * Parallel operations in general can have one of three states. They may\n * succeed, fail, or \"bail\", where bail indicates that the code encountered an\n * unexpected condition and should be re-run sequentially. Different\n * subcategories of the \"bail\" state are encoded as variants of TP_RETRY_*.\n */\nenum ParallelResult { TP_SUCCESS, TP_RETRY_SEQUENTIALLY, TP_RETRY_AFTER_GC, TP_FATAL };\n\nstruct ThreadSafeContext;\nstruct ForkJoinSlice;\nclass ExclusiveContext;\n\nclass Allocator;\n\nclass SkipRoot;\n\nenum ThingRootKind\n{\n    THING_ROOT_OBJECT,\n    THING_ROOT_SHAPE,\n    THING_ROOT_BASE_SHAPE,\n    THING_ROOT_TYPE_OBJECT,\n    THING_ROOT_STRING,\n    THING_ROOT_ION_CODE,\n    THING_ROOT_SCRIPT,\n    THING_ROOT_ID,\n    THING_ROOT_PROPERTY_ID,\n    THING_ROOT_VALUE,\n    THING_ROOT_TYPE,\n    THING_ROOT_BINDINGS,\n    THING_ROOT_PROPERTY_DESCRIPTOR,\n    THING_ROOT_LIMIT\n};\n\ntemplate <typename T>\nstruct RootKind;\n\n/*\n * Specifically mark the ThingRootKind of externally visible types, so that\n * JSAPI users may use JSRooted... types without having the class definition\n * available.\n */\ntemplate<typename T, ThingRootKind Kind>\nstruct SpecificRootKind\n{\n    static ThingRootKind rootKind() { return Kind; }\n};\n\ntemplate <> struct RootKind<JSObject *> : SpecificRootKind<JSObject *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSFlatString *> : SpecificRootKind<JSFlatString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSFunction *> : SpecificRootKind<JSFunction *, THING_ROOT_OBJECT> {};\ntemplate <> struct RootKind<JSString *> : SpecificRootKind<JSString *, THING_ROOT_STRING> {};\ntemplate <> struct RootKind<JSScript *> : SpecificRootKind<JSScript *, THING_ROOT_SCRIPT> {};\ntemplate <> struct RootKind<jsid> : SpecificRootKind<jsid, THING_ROOT_ID> {};\ntemplate <> struct RootKind<JS::Value> : SpecificRootKind<JS::Value, THING_ROOT_VALUE> {};\n\nstruct ContextFriendFields\n{\n  protected:\n    JSRuntime *const     runtime_;\n\n    /* The current compartment. */\n    JSCompartment       *compartment_;\n\n    /* The current zone. */\n    JS::Zone            *zone_;\n\n  public:\n    explicit ContextFriendFields(JSRuntime *rt)\n      : runtime_(rt), compartment_(NULL), zone_(NULL), autoGCRooters(NULL)\n    {\n#ifdef JSGC_TRACK_EXACT_ROOTS\n        mozilla::PodArrayZero(thingGCRooters);\n#endif\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n        skipGCRooters = NULL;\n#endif\n    }\n\n    static const ContextFriendFields *get(const JSContext *cx) {\n        return reinterpret_cast<const ContextFriendFields *>(cx);\n    }\n\n    static ContextFriendFields *get(JSContext *cx) {\n        return reinterpret_cast<ContextFriendFields *>(cx);\n    }\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Stack of thread-stack-allocated GC roots. */\n    JS::AutoGCRooter   *autoGCRooters;\n\n    friend JSRuntime *GetRuntime(const JSContext *cx);\n    friend JSCompartment *GetContextCompartment(const JSContext *cx);\n    friend JS::Zone *GetContextZone(const JSContext *cx);\n};\n\nclass PerThreadData;\n\nstruct PerThreadDataFriendFields\n{\n  private:\n    // Note: this type only exists to permit us to derive the offset of\n    // the perThread data within the real JSRuntime* type in a portable\n    // way.\n    struct RuntimeDummy : JS::shadow::Runtime\n    {\n        struct PerThreadDummy {\n            void *field1;\n            uintptr_t field2;\n#ifdef DEBUG\n            uint64_t field3;\n#endif\n        } mainThread;\n    };\n\n  public:\n\n    PerThreadDataFriendFields();\n\n#ifdef JSGC_TRACK_EXACT_ROOTS\n    /*\n     * Stack allocated GC roots for stack GC heap pointers, which may be\n     * overwritten if moved during a GC.\n     */\n    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];\n#endif\n\n#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)\n    /*\n     * Stack allocated list of stack locations which hold non-relocatable\n     * GC heap pointers (where the target is rooted somewhere else) or integer\n     * values which may be confused for GC heap pointers. These are used to\n     * suppress false positives which occur when a rooting analysis treats the\n     * location as holding a relocatable pointer, but have no other effect on\n     * GC behavior.\n     */\n    SkipRoot *skipGCRooters;\n#endif\n\n    /* Limit pointer for checking native stack consumption. */\n    uintptr_t nativeStackLimit;\n\n    static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);\n\n    static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) {\n        return reinterpret_cast<PerThreadDataFriendFields *>(pt);\n    }\n\n    static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<PerThreadDataFriendFields *>(\n            reinterpret_cast<char*>(rt) + RuntimeMainThreadOffset);\n    }\n\n    static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) {\n        // mainThread must always appear directly after |JS::shadow::Runtime|.\n        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|\n        return reinterpret_cast<const PerThreadDataFriendFields *>(\n            reinterpret_cast<const char*>(rt) + RuntimeMainThreadOffset);\n    }\n};\n\n} /* namespace js */\n\n#endif /* jspubtd_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jstypes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n** File:                jstypes.h\n** Description: Definitions of NSPR's basic types\n**\n** Prototypes and macros used to make up for deficiencies in ANSI environments\n** that we have found.\n**\n** Since we do not wrap <stdlib.h> and all the other standard headers, authors\n** of portable code will not know in general that they need these definitions.\n** Instead of requiring these authors to find the dependent uses in their code\n** and take the following steps only in those C files, we take steps once here\n** for all C files.\n**/\n\n#ifndef jstypes_h\n#define jstypes_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include \"js-config.h\"\n\n/***********************************************************************\n** MACROS:      JS_EXTERN_API\n**              JS_EXPORT_API\n** DESCRIPTION:\n**      These are only for externally visible routines and globals.  For\n**      internal routines, just use \"extern\" for type checking and that\n**      will not export internal cross-file or forward-declared symbols.\n**      Define a macro for declaring procedures return types. We use this to\n**      deal with windoze specific type hackery for DLL definitions. Use\n**      JS_EXTERN_API when the prototype for the method is declared. Use\n**      JS_EXPORT_API for the implementation of the method.\n**\n** Example:\n**   in dowhim.h\n**     JS_EXTERN_API( void ) DoWhatIMean( void );\n**   in dowhim.c\n**     JS_EXPORT_API( void ) DoWhatIMean( void ) { return; }\n**\n**\n***********************************************************************/\n\n#define JS_EXTERN_API(type)  extern MOZ_EXPORT type\n#define JS_EXPORT_API(type)  MOZ_EXPORT type\n#define JS_EXPORT_DATA(type) MOZ_EXPORT type\n#define JS_IMPORT_API(type)  MOZ_IMPORT_API type\n#define JS_IMPORT_DATA(type) MOZ_IMPORT_DATA type\n\n/*\n * The linkage of JS API functions differs depending on whether the file is\n * used within the JS library or not. Any source file within the JS\n * interpreter should define EXPORT_JS_API whereas any client of the library\n * should not. STATIC_JS_API is used to build JS as a static library.\n */\n#if defined(STATIC_JS_API)\n#  define JS_PUBLIC_API(t)   t\n#  define JS_PUBLIC_DATA(t)  t\n#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)\n#  define JS_PUBLIC_API(t)   MOZ_EXPORT t\n#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t\n#else\n#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t\n#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t\n#endif\n\n#define JS_FRIEND_API(t)    JS_PUBLIC_API(t)\n#define JS_FRIEND_DATA(t)   JS_PUBLIC_DATA(t)\n\n#if defined(_MSC_VER) && defined(_M_IX86)\n#define JS_FASTCALL __fastcall\n#elif defined(__GNUC__) && defined(__i386__)\n#define JS_FASTCALL __attribute__((fastcall))\n#else\n#define JS_FASTCALL\n#define JS_NO_FASTCALL\n#endif\n\n#ifndef JS_INLINE\n#define JS_INLINE MOZ_INLINE\n#endif\n\n#ifndef JS_ALWAYS_INLINE\n#define JS_ALWAYS_INLINE MOZ_ALWAYS_INLINE\n#endif\n\n#ifndef JS_NEVER_INLINE\n#define JS_NEVER_INLINE MOZ_NEVER_INLINE\n#endif\n\n#ifndef JS_WARN_UNUSED_RESULT\n# if defined __GNUC__\n#  define JS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n# else\n#  define JS_WARN_UNUSED_RESULT\n# endif\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_MACRO\n**              JS_END_MACRO\n** DESCRIPTION:\n**      Macro body brackets so that macros with compound statement definitions\n**      behave syntactically more like functions when called.\n***********************************************************************/\n#define JS_BEGIN_MACRO  do {\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n# define JS_END_MACRO                                                         \\\n    } __pragma(warning(push)) __pragma(warning(disable:4127))                 \\\n    while (0) __pragma(warning(pop))\n#else\n# define JS_END_MACRO   } while (0)\n#endif\n\n/***********************************************************************\n** MACROS:      JS_BEGIN_EXTERN_C\n**              JS_END_EXTERN_C\n** DESCRIPTION:\n**      Macro shorthands for conditional C++ extern block delimiters.\n***********************************************************************/\n#define JS_BEGIN_EXTERN_C      MOZ_BEGIN_EXTERN_C\n#define JS_END_EXTERN_C        MOZ_END_EXTERN_C\n\n/***********************************************************************\n** MACROS:      JS_BIT\n**              JS_BITMASK\n** DESCRIPTION:\n** Bit masking macros.  XXX n must be <= 31 to be portable\n***********************************************************************/\n#define JS_BIT(n)       ((uint32_t)1 << (n))\n#define JS_BITMASK(n)   (JS_BIT(n) - 1)\n\n/***********************************************************************\n** MACROS:      JS_HOWMANY\n**              JS_ROUNDUP\n**              JS_MIN\n**              JS_MAX\n** DESCRIPTION:\n**      Commonly used macros for operations on compatible types.\n***********************************************************************/\n#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))\n#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))\n\n#include \"jscpucfg.h\"\n\n/*\n * Define JS_64BIT iff we are building in an environment with 64-bit\n * addresses.\n */\n#ifdef _MSC_VER\n# if defined(_M_X64) || defined(_M_AMD64)\n#  define JS_64BIT\n# endif\n#elif defined(__GNUC__)\n/* Additional GCC defines are when running on Solaris, AIX, and HPUX */\n# if defined(__x86_64__) || defined(__sparcv9) || \\\n        defined(__64BIT__) || defined(__LP64__)\n#  define JS_64BIT\n# endif\n#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */\n# if defined(__x86_64) || defined(__sparcv9)\n#  define JS_64BIT\n# endif\n#elif defined(__xlc__) || defined(__xlC__)        /* IBM XL C/C++ */\n# if defined(__64BIT__)\n#  define JS_64BIT\n# endif\n#elif defined(__HP_cc) || defined(__HP_aCC)       /* HP-UX cc/aCC */\n# if defined(__LP64__)\n#  define JS_64BIT\n# endif\n#else\n# error \"Implement me\"\n#endif\n\n\n/************************************************************************\n** TYPES:       JSBool\n** DESCRIPTION:\n**  Use JSBool for variables and parameter types. Use JS_FALSE and JS_TRUE\n**      for clarity of target type in assignments and actual arguments. Use\n**      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans\n**      just as you would C int-valued conditions.\n************************************************************************/\ntypedef int JSBool;\n#define JS_TRUE (int)1\n#define JS_FALSE (int)0\n\n/***********************************************************************\n** MACROS:      JS_LIKELY\n**              JS_UNLIKELY\n** DESCRIPTION:\n**      These macros allow you to give a hint to the compiler about branch\n**      probability so that it can better optimize.  Use them like this:\n**\n**      if (JS_LIKELY(v == 1)) {\n**          ... expected code path ...\n**      }\n**\n**      if (JS_UNLIKELY(v == 0)) {\n**          ... non-expected code path ...\n**      }\n**\n***********************************************************************/\n#ifdef __GNUC__\n\n# define JS_LIKELY(x)   (__builtin_expect((x), 1))\n# define JS_UNLIKELY(x) (__builtin_expect((x), 0))\n\n#else\n\n# define JS_LIKELY(x)   (x)\n# define JS_UNLIKELY(x) (x)\n\n#endif\n\n/***********************************************************************\n** MACROS:      JS_ARRAY_LENGTH\n**              JS_ARRAY_END\n** DESCRIPTION:\n**      Macros to get the number of elements and the pointer to one past the\n**      last element of a C array. Use them like this:\n**\n**      jschar buf[10], *s;\n**      JSString *str;\n**      ...\n**      for (s = buf; s != JS_ARRAY_END(buf); ++s) *s = ...;\n**      ...\n**      str = JS_NewStringCopyN(cx, buf, JS_ARRAY_LENGTH(buf));\n**      ...\n**\n***********************************************************************/\n\n#define JS_ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])\n#define JS_ARRAY_END(array)    ((array) + JS_ARRAY_LENGTH(array))\n\n#define JS_BITS_PER_BYTE 8\n#define JS_BITS_PER_BYTE_LOG2 3\n\n#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)\n\n/***********************************************************************\n** MACROS:      JS_FUNC_TO_DATA_PTR\n**              JS_DATA_TO_FUNC_PTR\n** DESCRIPTION:\n**      Macros to convert between function and data pointers assuming that\n**      they have the same size. Use them like this:\n**\n**      JSPropertyOp nativeGetter;\n**      JSObject *scriptedGetter;\n**      ...\n**      scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter);\n**      ...\n**      nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter);\n**\n***********************************************************************/\n\n#ifdef __GNUC__\n# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (size_t) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (size_t) (ptr))\n#else\n/* Use an extra (void *) cast for MSVC. */\n# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))\n# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))\n#endif\n\n#ifdef __GNUC__\n# define JS_EXTENSION __extension__\n# define JS_EXTENSION_(s) __extension__ ({ s; })\n#else\n# define JS_EXTENSION\n# define JS_EXTENSION_(s) s\n#endif\n\n#endif /* jstypes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsutil.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * PR assertion checker.\n */\n\n#ifndef jsutil_h\n#define jsutil_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/GuardObjects.h\"\n\n#ifdef USE_ZLIB\n#include <zlib.h>\n#endif\n\n#include \"js/Utility.h\"\n\n/* Forward declarations. */\nstruct JSContext;\n\nstatic JS_ALWAYS_INLINE void *\njs_memcpy(void *dst_, const void *src_, size_t len)\n{\n    char *dst = (char *) dst_;\n    const char *src = (const char *) src_;\n    JS_ASSERT_IF(dst >= src, (size_t) (dst - src) >= len);\n    JS_ASSERT_IF(src >= dst, (size_t) (src - dst) >= len);\n\n    return memcpy(dst, src, len);\n}\n\nnamespace js {\n\ntemplate <class T>\nstruct AlignmentTestStruct\n{\n    char c;\n    T t;\n};\n\n/* This macro determines the alignment requirements of a type. */\n#define JS_ALIGNMENT_OF(t_) \\\n  (sizeof(js::AlignmentTestStruct<t_>) - sizeof(t_))\n\ntemplate <class T>\nclass AlignedPtrAndFlag\n{\n    uintptr_t bits;\n\n  public:\n    AlignedPtrAndFlag(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(aFlag);\n    }\n\n    T *ptr() const {\n        return (T *)(bits & ~uintptr_t(1));\n    }\n\n    bool flag() const {\n        return (bits & 1) != 0;\n    }\n\n    void setPtr(T *t) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | uintptr_t(flag());\n    }\n\n    void setFlag() {\n        bits |= 1;\n    }\n\n    void unsetFlag() {\n        bits &= ~uintptr_t(1);\n    }\n\n    void set(T *t, bool aFlag) {\n        JS_ASSERT((uintptr_t(t) & 1) == 0);\n        bits = uintptr_t(t) | aFlag;\n    }\n};\n\ntemplate <class T>\nstatic inline void\nReverse(T *beg, T *end)\n{\n    while (beg != end) {\n        if (--end == beg)\n            return;\n        T tmp = *beg;\n        *beg = *end;\n        *end = tmp;\n        ++beg;\n    }\n}\n\ntemplate <class T>\nstatic inline T *\nFind(T *beg, T *end, const T &v)\n{\n    for (T *p = beg; p != end; ++p) {\n        if (*p == v)\n            return p;\n    }\n    return end;\n}\n\ntemplate <class Container>\nstatic inline typename Container::ElementType *\nFind(Container &c, const typename Container::ElementType &v)\n{\n    return Find(c.begin(), c.end(), v);\n}\n\ntemplate <typename InputIterT, typename CallableT>\nvoid\nForEach(InputIterT begin, InputIterT end, CallableT f)\n{\n    for (; begin != end; ++begin)\n        f(*begin);\n}\n\ntemplate <class T>\nstatic inline T\nMin(T t1, T t2)\n{\n    return t1 < t2 ? t1 : t2;\n}\n\ntemplate <class T>\nstatic inline T\nMax(T t1, T t2)\n{\n    return t1 > t2 ? t1 : t2;\n}\n\n/* Allows a const variable to be initialized after its declaration. */\ntemplate <class T>\nstatic T&\nInitConst(const T &t)\n{\n    return const_cast<T &>(t);\n}\n\ntemplate <class T, class U>\nJS_ALWAYS_INLINE T &\nImplicitCast(U &u)\n{\n    T &t = u;\n    return t;\n}\n\ntemplate<typename T>\nclass AutoScopedAssign\n{\n  public:\n    AutoScopedAssign(T *addr, const T &value\n                     MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n        : addr_(addr), old(*addr_)\n    {\n        MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n        *addr_ = value;\n    }\n\n    ~AutoScopedAssign() { *addr_ = old; }\n\n  private:\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n    T *addr_;\n    T old;\n};\n\ntemplate <typename T>\nstatic inline bool\nIsPowerOfTwo(T t)\n{\n    return t && !(t & (t - 1));\n}\n\ntemplate <typename T, typename U>\nstatic inline U\nComputeByteAlignment(T bytes, U alignment)\n{\n    JS_ASSERT(IsPowerOfTwo(alignment));\n    return (alignment - (bytes % alignment)) % alignment;\n}\n\ntemplate <typename T, typename U>\nstatic inline T\nAlignBytes(T bytes, U alignment)\n{\n    return bytes + ComputeByteAlignment(bytes, alignment);\n}\n\nJS_ALWAYS_INLINE static size_t\nUnsignedPtrDiff(const void *bigger, const void *smaller)\n{\n    return size_t(bigger) - size_t(smaller);\n}\n\n/*****************************************************************************/\n\n/* A bit array is an array of bits represented by an array of words (size_t). */\n\nstatic inline unsigned\nNumWordsForBitArrayOfLength(size_t length)\n{\n    return (length + (JS_BITS_PER_WORD - 1)) / JS_BITS_PER_WORD;\n}\n\nstatic inline unsigned\nBitArrayIndexToWordIndex(size_t length, size_t bitIndex)\n{\n    unsigned wordIndex = bitIndex / JS_BITS_PER_WORD;\n    JS_ASSERT(wordIndex < length);\n    return wordIndex;\n}\n\nstatic inline size_t\nBitArrayIndexToWordMask(size_t i)\n{\n    return size_t(1) << (i % JS_BITS_PER_WORD);\n}\n\nstatic inline bool\nIsBitArrayElementSet(size_t *array, size_t length, size_t i)\n{\n    return array[BitArrayIndexToWordIndex(length, i)] & BitArrayIndexToWordMask(i);\n}\n\nstatic inline bool\nIsAnyBitArrayElementSet(size_t *array, size_t length)\n{\n    unsigned numWords = NumWordsForBitArrayOfLength(length);\n    for (unsigned i = 0; i < numWords; ++i) {\n        if (array[i])\n            return true;\n    }\n    return false;\n}\n\nstatic inline void\nSetBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] |= BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearBitArrayElement(size_t *array, size_t length, size_t i)\n{\n    array[BitArrayIndexToWordIndex(length, i)] &= ~BitArrayIndexToWordMask(i);\n}\n\nstatic inline void\nClearAllBitArrayElements(size_t *array, size_t length)\n{\n    for (unsigned i = 0; i < length; ++i)\n        array[i] = 0;\n}\n\n#ifdef USE_ZLIB\nclass Compressor\n{\n    /* Number of bytes we should hand to zlib each compressMore() call. */\n    static const size_t CHUNKSIZE = 2048;\n    z_stream zs;\n    const unsigned char *inp;\n    size_t inplen;\n    size_t outbytes;\n\n  public:\n    enum Status {\n        MOREOUTPUT,\n        DONE,\n        CONTINUE,\n        OOM\n    };\n\n    Compressor(const unsigned char *inp, size_t inplen);\n    ~Compressor();\n    bool init();\n    void setOutput(unsigned char *out, size_t outlen);\n    size_t outWritten() const { return outbytes; }\n    /* Compress some of the input. Return true if it should be called again. */\n    Status compressMore();\n};\n\n/*\n * Decompress a string. The caller must know the length of the output and\n * allocate |out| to a string of that length.\n */\nbool DecompressString(const unsigned char *inp, size_t inplen,\n                      unsigned char *out, size_t outlen);\n#endif\n\n}  /* namespace js */\n\n/* Crash diagnostics */\n#ifdef DEBUG\n# define JS_CRASH_DIAGNOSTICS 1\n#endif\n#ifdef JS_CRASH_DIAGNOSTICS\n# define JS_POISON(p, val, size) memset((p), (val), (size))\n#else\n# define JS_POISON(p, val, size) ((void) 0)\n#endif\n\n/* Basic stats */\n#ifdef DEBUG\n# define JS_BASIC_STATS 1\n#endif\n#ifdef JS_BASIC_STATS\n# include <stdio.h>\ntypedef struct JSBasicStats {\n    uint32_t    num;\n    uint32_t    max;\n    double      sum;\n    double      sqsum;\n    uint32_t    logscale;           /* logarithmic scale: 0 (linear), 2, 10 */\n    uint32_t    hist[11];\n} JSBasicStats;\n# define JS_INIT_STATIC_BASIC_STATS  {0,0,0,0,0,{0,0,0,0,0,0,0,0,0,0,0}}\n# define JS_BASIC_STATS_INIT(bs)     memset((bs), 0, sizeof(JSBasicStats))\n# define JS_BASIC_STATS_ACCUM(bs,val)                                         \\\n    JS_BasicStatsAccum(bs, val)\n# define JS_MeanAndStdDevBS(bs,sigma)                                         \\\n    JS_MeanAndStdDev((bs)->num, (bs)->sum, (bs)->sqsum, sigma)\nextern void\nJS_BasicStatsAccum(JSBasicStats *bs, uint32_t val);\nextern double\nJS_MeanAndStdDev(uint32_t num, double sum, double sqsum, double *sigma);\nextern void\nJS_DumpBasicStats(JSBasicStats *bs, const char *title, FILE *fp);\nextern void\nJS_DumpHistogram(JSBasicStats *bs, FILE *fp);\n#else\n# define JS_BASIC_STATS_ACCUM(bs,val)\n#endif\n\n/* A jsbitmap_t is a long integer that can be used for bitmaps. */\ntypedef size_t jsbitmap;\n#define JS_TEST_BIT(_map,_bit)  ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &      \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_SET_BIT(_map,_bit)   ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] |=     \\\n                                 ((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &=     \\\n                                 ~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))\n\n/* Wrapper for various macros to stop warnings coming from their expansions. */\n#if defined(__clang__)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"clang diagnostic push\")                                      \\\n        /* If these _Pragmas cause warnings for you, try disabling ccache. */ \\\n        _Pragma(\"clang diagnostic ignored \\\"-Wunused-value\\\"\")                \\\n        { expr; }                                                             \\\n        _Pragma(\"clang diagnostic pop\")                                       \\\n    JS_END_MACRO\n#elif MOZ_IS_GCC\n\n#if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        _Pragma(\"GCC diagnostic push\")                                        \\\n        _Pragma(\"GCC diagnostic ignored \\\"-Wunused-but-set-variable\\\"\")       \\\n        expr;                                                                 \\\n        _Pragma(\"GCC diagnostic pop\")                                         \\\n    JS_END_MACRO\n#endif\n#endif\n\n#if !defined(JS_SILENCE_UNUSED_VALUE_IN_EXPR)\n# define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr)                                \\\n    JS_BEGIN_MACRO                                                            \\\n        expr;                                                                 \\\n    JS_END_MACRO\n#endif\n\n#endif /* jsutil_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsversion.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jsversion_h\n#define jsversion_h\n\n/*\n * Deprecated JS_VERSION handler.\n */\n#ifdef JS_VERSION\n# if JS_VERSION == 185\n#  warning \"JS_VERSION defined but unsupported (legacy)\"\n# elif JS_VERSION < 185\n#  error \"Unsupported JS_VERSION\"\n# else\n#  error \"Unknown JS_VERSION\"\n# endif\n#endif\n\n/*\n * JS Capability Macros.\n */\n#define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */\n#define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */\n#define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */\n#define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */\n#define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */\n#define JS_HAS_UNEVAL           1       /* has uneval() top-level function */\n#define JS_HAS_CONST            1       /* has JS2 const as alternative var */\n#define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */\n#define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */\n#define JS_HAS_FOR_EACH_IN      1       /* has for each (lhs in iterable) */\n#define JS_HAS_GENERATORS       1       /* has yield in generator function */\n#define JS_HAS_BLOCK_SCOPE      1       /* has block scope via let/arraycomp */\n#define JS_HAS_DESTRUCTURING    2       /* has [a,b] = ... or {p:a,q:b} = ... */\n#define JS_HAS_GENERATOR_EXPRS  1       /* has (expr for (lhs in iterable)) */\n#define JS_HAS_EXPR_CLOSURES    1       /* has function (formals) listexpr */\n\n/* Support for JS_NewGlobalObject. */\n#define JS_HAS_NEW_GLOBAL_OBJECT        1\n\n/* Support for JS_MakeSystemObject. */\n#define JS_HAS_MAKE_SYSTEM_OBJECT       1\n\n/* Feature-test macro for evolving destructuring support. */\n#define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)\n\n/*\n * Feature for Object.prototype.__{define,lookup}{G,S}etter__ legacy support;\n * support likely to be made opt-in at some future time.\n */\n#define OLD_GETTER_SETTER_METHODS       1\n\n/* A kill-switch for bug 586842.  Embedders shouldn't touch this! */\n#define USE_NEW_OBJECT_REPRESENTATION 0\n\n#if USE_NEW_OBJECT_REPRESENTATION\n#  define NEW_OBJECT_REPRESENTATION_ONLY() ((void)0)\n#else\n#  define NEW_OBJECT_REPRESENTATION_ONLY() \\\n     MOZ_ASSUME_UNREACHABLE(\"don't call this!  to be used in the new object representation\")\n#endif\n\n#endif /* jsversion_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jswrapper.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n * vim: set ts=8 sts=4 et sw=4 tw=99:\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef jswrapper_h\n#define jswrapper_h\n\n#include \"mozilla/Attributes.h\"\n\n#include \"jsapi.h\"\n#include \"jsproxy.h\"\n\nnamespace js {\n\nclass DummyFrameGuard;\n\n/*\n * A wrapper is a proxy with a target object to which it generally forwards\n * operations, but may restrict access to certain operations or instrument\n * the trap operations in various ways. A wrapper is distinct from a Direct Proxy\n * Handler in the sense that it can be \"unwrapped\" in C++, exposing the underlying\n * object (Direct Proxy Handlers have an underlying target object, but don't\n * expect to expose this object via any kind of unwrapping operation). Callers\n * should be careful to avoid unwrapping security wrappers in the wrong context.\n */\nclass JS_FRIEND_API(Wrapper) : public DirectProxyHandler\n{\n    unsigned mFlags;\n    bool mSafeToUnwrap;\n\n  public:\n    using BaseProxyHandler::Action;\n\n    enum Flags {\n        CROSS_COMPARTMENT = 1 << 0,\n        LAST_USED_FLAG = CROSS_COMPARTMENT\n    };\n\n    /*\n     * Wrappers can explicitly specify that they are unsafe to unwrap from a\n     * security perspective (as is the case for SecurityWrappers). If a wrapper\n     * is not safe to unwrap, operations requiring full access to the underlying\n     * object (via CheckedUnwrap) will throw. Otherwise, they will succeed.\n     */\n    void setSafeToUnwrap(bool safe) { mSafeToUnwrap = safe; }\n    bool isSafeToUnwrap() { return mSafeToUnwrap; }\n\n    static JSObject *New(JSContext *cx, JSObject *obj, JSObject *proto,\n                         JSObject *parent, Wrapper *handler);\n\n    static JSObject *Renew(JSContext *cx, JSObject *existing, JSObject *obj, Wrapper *handler);\n\n    static Wrapper *wrapperHandler(JSObject *wrapper);\n\n    static JSObject *wrappedObject(JSObject *wrapper);\n\n    unsigned flags() const {\n        return mFlags;\n    }\n\n    explicit Wrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~Wrapper();\n\n    static Wrapper singleton;\n    static Wrapper singletonWithPrototype;\n};\n\n/* Base class for all cross compartment wrapper handlers. */\nclass JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper\n{\n  public:\n    CrossCompartmentWrapper(unsigned flags, bool hasPrototype = false);\n\n    virtual ~CrossCompartmentWrapper();\n\n    virtual bool finalizeInBackground(Value priv) MOZ_OVERRIDE;\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* ES5 Harmony derived wrapper traps. */\n    virtual bool has(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool hasOwn(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool get(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool set(JSContext *cx, HandleObject wrapper, HandleObject receiver,\n                     HandleId id, bool strict, MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool keys(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool iterate(JSContext *cx, HandleObject wrapper, unsigned flags,\n                         MutableHandleValue vp) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject wrapper, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject wrapper, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject wrapper,\n                                   unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop);\n\n    static CrossCompartmentWrapper singleton;\n    static CrossCompartmentWrapper singletonWithPrototype;\n};\n\n/*\n * Base class for security wrappers. A security wrapper is potentially hiding\n * all or part of some wrapped object thus SecurityWrapper defaults to denying\n * access to the wrappee. This is the opposite of Wrapper which tries to be\n * completely transparent.\n *\n * NB: Currently, only a few ProxyHandler operations are overridden to deny\n * access, relying on derived SecurityWrapper to block access when necessary.\n */\ntemplate <class Base>\nclass JS_FRIEND_API(SecurityWrapper) : public Base\n{\n  public:\n    SecurityWrapper(unsigned flags);\n\n    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) MOZ_OVERRIDE;\n    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper) MOZ_OVERRIDE;\n    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act,\n                       bool *bp) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n\n    /*\n     * Allow our subclasses to select the superclass behavior they want without\n     * needing to specify an exact superclass.\n     */\n    typedef Base Permissive;\n    typedef SecurityWrapper<Base> Restrictive;\n};\n\ntypedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;\ntypedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;\n\nclass JS_FRIEND_API(DeadObjectProxy) : public BaseProxyHandler\n{\n  public:\n    static int sDeadObjectFamily;\n\n    explicit DeadObjectProxy();\n\n    /* ES5 Harmony fundamental wrapper traps. */\n    virtual bool preventExtensions(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                       PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,\n                                          PropertyDescriptor *desc, unsigned flags) MOZ_OVERRIDE;\n    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,\n                                PropertyDescriptor *desc) MOZ_OVERRIDE;\n    virtual bool getOwnPropertyNames(JSContext *cx, HandleObject wrapper,\n                                     AutoIdVector &props) MOZ_OVERRIDE;\n    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id, bool *bp) MOZ_OVERRIDE;\n    virtual bool enumerate(JSContext *cx, HandleObject wrapper, AutoIdVector &props) MOZ_OVERRIDE;\n\n    /* Spidermonkey extensions. */\n    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) MOZ_OVERRIDE;\n    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) MOZ_OVERRIDE;\n    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,\n                            CallArgs args) MOZ_OVERRIDE;\n    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,\n                             bool *bp) MOZ_OVERRIDE;\n    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,\n                               JSContext *cx) MOZ_OVERRIDE;\n    virtual const char *className(JSContext *cx, HandleObject proxy) MOZ_OVERRIDE;\n    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) MOZ_OVERRIDE;\n    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) MOZ_OVERRIDE;\n    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,\n                              MutableHandleValue vp) MOZ_OVERRIDE;\n    virtual bool getElementIfPresent(JSContext *cx, HandleObject obj, HandleObject receiver,\n                                     uint32_t index, MutableHandleValue vp,\n                                     bool *present) MOZ_OVERRIDE;\n    virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy,\n                                MutableHandleObject protop) MOZ_OVERRIDE;\n\n    static DeadObjectProxy singleton;\n};\n\nextern JSObject *\nTransparentObjectWrapper(JSContext *cx, HandleObject existing, HandleObject obj,\n                         HandleObject wrappedProto, HandleObject parent,\n                         unsigned flags);\n\n// Proxy family for wrappers. Public so that IsWrapper() can be fully inlined by\n// jsfriendapi users.\nextern JS_FRIEND_DATA(int) sWrapperFamily;\n\ninline bool\nIsWrapper(JSObject *obj)\n{\n    return IsProxy(obj) && GetProxyHandler(obj)->family() == &sWrapperFamily;\n}\n\n// Given a JSObject, returns that object stripped of wrappers. If\n// stopAtOuter is true, then this returns the outer window if it was\n// previously wrapped. Otherwise, this returns the first object for\n// which JSObject::isWrapper returns false.\nJS_FRIEND_API(JSObject *)\nUncheckedUnwrap(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = NULL);\n\n// Given a JSObject, returns that object stripped of wrappers. At each stage,\n// the security wrapper has the opportunity to veto the unwrap. Since checked\n// code should never be unwrapping outer window wrappers, we always stop at\n// outer windows.\nJS_FRIEND_API(JSObject *)\nCheckedUnwrap(JSObject *obj, bool stopAtOuter = true);\n\n// Unwrap only the outermost security wrapper, with the same semantics as\n// above. This is the checked version of Wrapper::wrappedObject.\nJS_FRIEND_API(JSObject *)\nUnwrapOneChecked(JSObject *obj, bool stopAtOuter = true);\n\nJS_FRIEND_API(bool)\nIsCrossCompartmentWrapper(JSObject *obj);\n\nbool\nIsDeadProxyObject(JSObject *obj);\n\nJSObject *\nNewDeadProxyObject(JSContext *cx, JSObject *parent);\n\nvoid\nNukeCrossCompartmentWrapper(JSContext *cx, JSObject *wrapper);\n\nbool\nRemapWrapper(JSContext *cx, JSObject *wobj, JSObject *newTarget);\n\nJS_FRIEND_API(bool)\nRemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget,\n                          JSObject *newTarget);\n\n// API to recompute all cross-compartment wrappers whose source and target\n// match the given filters.\nJS_FRIEND_API(bool)\nRecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,\n                  const CompartmentFilter &targetFilter);\n\n/*\n * This auto class should be used around any code, such as brain transplants,\n * that may touch dead zones. Brain transplants can cause problems\n * because they operate on all compartments, whether live or dead. A brain\n * transplant can cause a formerly dead object to be \"reanimated\" by causing a\n * read or write barrier to be invoked on it during the transplant. In this way,\n * a zone becomes a zombie, kept alive by repeatedly consuming\n * (transplanted) brains.\n *\n * To work around this issue, we observe when mark bits are set on objects in\n * dead zones. If this happens during a brain transplant, we do a full,\n * non-incremental GC at the end of the brain transplant. This will clean up any\n * objects that were improperly marked.\n */\nstruct JS_FRIEND_API(AutoMaybeTouchDeadZones)\n{\n    // The version that takes an object just uses it for its runtime.\n    AutoMaybeTouchDeadZones(JSContext *cx);\n    AutoMaybeTouchDeadZones(JSObject *obj);\n    ~AutoMaybeTouchDeadZones();\n\n  private:\n    JSRuntime *runtime;\n    unsigned markCount;\n    bool inIncremental;\n    bool manipulatingDeadZones;\n};\n\n} /* namespace js */\n\n#endif /* jswrapper_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/AllocPolicy.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * An allocation policy concept, usable for structures and algorithms to\n * control how memory is allocated and how failures are handled.\n */\n\n#ifndef mozilla_AllocPolicy_h\n#define mozilla_AllocPolicy_h\n\n#include <stddef.h>\n#include <stdlib.h>\n\nnamespace mozilla {\n\n/*\n * Allocation policies are used to implement the standard allocation behaviors\n * in a customizable way.  Additionally, custom behaviors may be added to these\n * behaviors, such as additionally reporting an error through an out-of-band\n * mechanism when OOM occurs.  The concept modeled here is as follows:\n *\n *  - public copy constructor, assignment, destructor\n *  - void* malloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* calloc_(size_t)\n *      Responsible for OOM reporting when null is returned.\n *  - void* realloc_(void*, size_t, size_t)\n *      Responsible for OOM reporting when null is returned.  The *used* bytes\n *      of the previous buffer is passed in (rather than the old allocation\n *      size), in addition to the *new* allocation size requested.\n *  - void free_(void*)\n *  - void reportAllocOverflow() const\n *      Called on allocation overflow (that is, an allocation implicitly tried\n *      to allocate more than the available memory space -- think allocating an\n *      array of large-size objects, where N * size overflows) before null is\n *      returned.\n *\n * mfbt provides (and typically uses by default) only MallocAllocPolicy, which\n * does nothing more than delegate to the malloc/alloc/free functions.\n */\n\n/*\n * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no\n * extra behaviors.\n */\nclass MallocAllocPolicy\n{\n  public:\n    void* malloc_(size_t bytes) { return malloc(bytes); }\n    void* calloc_(size_t bytes) { return calloc(bytes, 1); }\n    void* realloc_(void* p, size_t oldBytes, size_t bytes) { return realloc(p, bytes); }\n    void free_(void* p) { free(p); }\n    void reportAllocOverflow() const {}\n};\n\n\n} // namespace mozilla\n\n#endif /* mozilla_AllocPolicy_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Array.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A compile-time constant-length array with bounds-checking assertions. */\n\n#ifndef mozilla_Array_h\n#define mozilla_Array_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\ntemplate<typename T, size_t Length>\nclass Array\n{\n    T arr[Length];\n\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(i < Length);\n      return arr[i];\n    }\n};\n\ntemplate<typename T>\nclass Array<T, 0>\n{\n  public:\n    T& operator[](size_t i) {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSUME_UNREACHABLE(\"indexing into zero-length array\");\n    }\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_Array_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Assertions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of runtime and static assertion macros for C and C++. */\n\n#ifndef mozilla_Assertions_h\n#define mozilla_Assertions_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/Likely.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#ifdef WIN32\n   /*\n    * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which\n    * further depends on <windef.h>.  We hardcode these few definitions manually\n    * because those headers clutter the global namespace with a significant\n    * number of undesired macros and symbols.\n    */\n#  ifdef __cplusplus\n   extern \"C\" {\n#  endif\n   __declspec(dllimport) int __stdcall\n   TerminateProcess(void* hProcess, unsigned int uExitCode);\n   __declspec(dllimport) void* __stdcall GetCurrentProcess(void);\n#  ifdef __cplusplus\n   }\n#  endif\n#else\n#  include <signal.h>\n#endif\n#ifdef ANDROID\n#  include <android/log.h>\n#endif\n\n/*\n * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.\n * In C++11, static_assert is provided by the compiler to the same effect.\n * This can be useful when you make certain assumptions about what must hold for\n * optimal, or even correct, behavior.  For example, you might assert that the\n * size of a struct is a multiple of the target architecture's word size:\n *\n *   struct S { ... };\n *   // C\n *   MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,\n *                     \"S should be a multiple of word size for efficiency\");\n *   // C++11\n *   static_assert(sizeof(S) % sizeof(size_t) == 0,\n *                 \"S should be a multiple of word size for efficiency\");\n *\n * This macro can be used in any location where both an extern declaration and a\n * typedef could be used.\n */\n#ifndef __cplusplus\n   /*\n    * Some of the definitions below create an otherwise-unused typedef.  This\n    * triggers compiler warnings with some versions of gcc, so mark the typedefs\n    * as permissibly-unused to disable the warnings.\n    */\n#  if defined(__GNUC__)\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))\n#  else\n#    define MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE /* nothing */\n#  endif\n#  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y\n#  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)\n#  if defined(__SUNPRO_CC)\n     /*\n      * The Sun Studio C++ compiler is buggy when declaring, inside a function,\n      * another extern'd function with an array argument whose length contains a\n      * sizeof, triggering the error message \"sizeof expression not accepted as\n      * size of array parameter\".  This bug (6688515, not public yet) would hit\n      * defining moz_static_assert as a function, so we always define an extern\n      * array for Sun Studio.\n      *\n      * We include the line number in the symbol name in a best-effort attempt\n      * to avoid conflicts (see below).\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern char MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)[(cond) ? 1 : -1]\n#  elif defined(__COUNTER__)\n     /*\n      * If there was no preferred alternative, use a compiler-agnostic version.\n      *\n      * Note that the non-__COUNTER__ version has a bug in C++: it can't be used\n      * in both |extern \"C\"| and normal C++ in the same translation unit.  (Alas\n      * |extern \"C\"| isn't allowed in a function.)  The only affected compiler\n      * we really care about is gcc 4.2.  For that compiler and others like it,\n      * we include the line number in the function name to do the best we can to\n      * avoid conflicts.  These should be rare: a conflict would require use of\n      * MOZ_STATIC_ASSERT on the same line in separate files in the same\n      * translation unit, *and* the uses would have to be in code with\n      * different linkage, *and* the first observed use must be in C++-linkage\n      * code.\n      */\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  else\n#    define MOZ_STATIC_ASSERT(cond, reason) \\\n       extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE\n#  endif\n\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)\n#else\n#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Prints |s| as an assertion failure (using file and ln as the location of the\n * assertion) to the standard debug-output channel.\n *\n * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This\n * method is primarily for internal use in this header, and only secondarily\n * for use in implementing release-build assertions.\n */\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportAssertionFailure(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n  __android_log_print(ANDROID_LOG_FATAL, \"MOZ_Assert\",\n                      \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Assertion failure: %s, at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\nstatic MOZ_ALWAYS_INLINE void\nMOZ_ReportCrash(const char* s, const char* file, int ln)\n{\n#ifdef ANDROID\n    __android_log_print(ANDROID_LOG_FATAL, \"MOZ_CRASH\",\n                        \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n#else\n  fprintf(stderr, \"Hit MOZ_CRASH(%s) at %s:%d\\n\", s, file, ln);\n  fflush(stderr);\n#endif\n}\n\n/**\n * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH().  You should\n * call MOZ_CRASH instead.\n */\n#if defined(_MSC_VER)\n   /*\n    * On MSVC use the __debugbreak compiler intrinsic, which produces an inline\n    * (not nested in a system function) breakpoint.  This distinctively invokes\n    * Breakpad without requiring system library symbols on all stack-processing\n    * machines, as a nested breakpoint would require.\n    *\n    * We use TerminateProcess with the exit code aborting would generate\n    * because we don't want to invoke atexit handlers, destructors, library\n    * unload handlers, and so on when our process might be in a compromised\n    * state.\n    *\n    * We don't use abort() because it'd cause Windows to annoyingly pop up the\n    * process error dialog multiple times.  See bug 345118 and bug 426163.\n    *\n    * We follow TerminateProcess() with a call to MOZ_NoReturn() so that the\n    * compiler doesn't hassle us to provide a return statement after a\n    * MOZ_REALLY_CRASH() call.\n    *\n    * (Technically these are Windows requirements, not MSVC requirements.  But\n    * practically you need MSVC for debugging, and we only ship builds created\n    * by MSVC, so doing it this way reduces complexity.)\n    */\n\n__declspec(noreturn) __inline void MOZ_NoReturn() {}\n\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         ::TerminateProcess(::GetCurrentProcess(), 3); \\\n         ::MOZ_NoReturn(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         __debugbreak(); \\\n         *((volatile int*) NULL) = 123; \\\n         TerminateProcess(GetCurrentProcess(), 3); \\\n         MOZ_NoReturn(); \\\n       } while (0)\n#  endif\n#else\n#  ifdef __cplusplus\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         ::abort(); \\\n       } while (0)\n#  else\n#    define MOZ_REALLY_CRASH() \\\n       do { \\\n         *((volatile int*) NULL) = 123; \\\n         abort(); \\\n       } while (0)\n#  endif\n#endif\n\n/*\n * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a\n * Breakpad-compatible way, in both debug and release builds.\n *\n * MOZ_CRASH is a good solution for \"handling\" failure cases when you're\n * unwilling or unable to handle them more cleanly -- for OOM, for likely memory\n * corruption, and so on.  It's also a good solution if you need safe behavior\n * in release builds as well as debug builds.  But if the failure is one that\n * should be debugged and fixed, MOZ_ASSERT is generally preferable.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining why we're crashing.  This argument is intended for use with\n * MOZ_CRASH() calls whose rationale is non-obvious; don't use it if it's\n * obvious why we're crashing.\n *\n * If we're a DEBUG build and we crash at a MOZ_CRASH which provides an\n * explanation-string, we print the string to stderr.  Otherwise, we don't\n * print anything; this is because we want MOZ_CRASH to be 100% safe in release\n * builds, and it's hard to print to stderr safely when memory might have been\n * corrupted.\n */\n#ifndef DEBUG\n#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()\n#else\n#  define MOZ_CRASH(...) \\\n     do { \\\n       MOZ_ReportCrash(\"\" __VA_ARGS__, __FILE__, __LINE__); \\\n       MOZ_REALLY_CRASH(); \\\n     } while(0)\n#endif\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n/*\n * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in\n * debug builds.  If it is, execution continues.  Otherwise, an error message\n * including the expression and the explanation-string (if provided) is printed,\n * an attempt is made to invoke any existing debugger, and execution halts.\n * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition\n * which can correctly be falsy.\n *\n * The optional explanation-string, if provided, must be a string literal\n * explaining the assertion.  It is intended for use with assertions whose\n * correctness or rationale is non-obvious, and for assertions where the \"real\"\n * condition being tested is best described prosaically.  Don't provide an\n * explanation if it's not actually helpful.\n *\n *   // No explanation needed: pointer arguments often must not be NULL.\n *   MOZ_ASSERT(arg);\n *\n *   // An explanation can be helpful to explain exactly how we know an\n *   // assertion is valid.\n *   MOZ_ASSERT(state == WAITING_FOR_RESPONSE,\n *              \"given that <thingA> and <thingB>, we must have...\");\n *\n *   // Or it might disambiguate multiple identical (save for their location)\n *   // assertions of the same expression.\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this Boolean object\");\n *   MOZ_ASSERT(getSlot(PRIMITIVE_THIS_SLOT).isUndefined(),\n *              \"we already set [[PrimitiveThis]] for this String object\");\n *\n * MOZ_ASSERT has no effect in non-debug builds.  It is designed to catch bugs\n * *only* during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n   /* First the single-argument form. */\n#  define MOZ_ASSERT_HELPER1(expr) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* Now the two-argument form. */\n#  define MOZ_ASSERT_HELPER2(expr, explain) \\\n     do { \\\n       if (MOZ_UNLIKELY(!(expr))) { \\\n         MOZ_ReportAssertionFailure(#expr \" (\" explain \")\", __FILE__, __LINE__); \\\n         MOZ_REALLY_CRASH(); \\\n       } \\\n     } while (0)\n   /* And now, helper macrology up the wazoo. */\n   /*\n    * Count the number of arguments passed to MOZ_ASSERT, very carefully\n    * tiptoeing around an MSVC bug where it improperly expands __VA_ARGS__ as a\n    * single token in argument lists.  See these URLs for details:\n    *\n    *   http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement\n    *   http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644\n    */\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL2(_1, _2, count, ...) \\\n     count\n#  define MOZ_COUNT_ASSERT_ARGS_IMPL(args) \\\n\t MOZ_COUNT_ASSERT_ARGS_IMPL2 args\n#  define MOZ_COUNT_ASSERT_ARGS(...) \\\n     MOZ_COUNT_ASSERT_ARGS_IMPL((__VA_ARGS__, 2, 1, 0))\n   /* Pick the right helper macro to invoke. */\n#  define MOZ_ASSERT_CHOOSE_HELPER2(count) MOZ_ASSERT_HELPER##count\n#  define MOZ_ASSERT_CHOOSE_HELPER1(count) MOZ_ASSERT_CHOOSE_HELPER2(count)\n#  define MOZ_ASSERT_CHOOSE_HELPER(count) MOZ_ASSERT_CHOOSE_HELPER1(count)\n   /* The actual macro. */\n#  define MOZ_ASSERT_GLUE(x, y) x y\n#  define MOZ_ASSERT(...) \\\n     MOZ_ASSERT_GLUE(MOZ_ASSERT_CHOOSE_HELPER(MOZ_COUNT_ASSERT_ARGS(__VA_ARGS__)), \\\n                     (__VA_ARGS__))\n#else\n#  define MOZ_ASSERT(...) do { } while(0)\n#endif /* DEBUG */\n\n/*\n * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is\n * true.\n *\n *   MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));\n *\n * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds.  It is\n * designed to catch bugs during debugging, not \"in the field\".\n */\n#ifdef DEBUG\n#  define MOZ_ASSERT_IF(cond, expr) \\\n     do { \\\n       if (cond) \\\n         MOZ_ASSERT(expr); \\\n     } while (0)\n#else\n#  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that it is\n * undefined behavior for execution to reach this point.  No guarantees are made\n * about what will happen if this is reached at runtime.  Most code should\n * probably use the higher level MOZ_ASSUME_UNREACHABLE, which uses this when\n * appropriate.\n */\n#if defined(__clang__)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#elif defined(__GNUC__)\n   /*\n    * __builtin_unreachable() was implemented in gcc 4.5.  If we don't have\n    * that, call a noreturn function; abort() will do nicely.  Qualify the call\n    * in C++ in case there's another abort() visible in local scope.\n    */\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 5, 0)\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() __builtin_unreachable()\n#  else\n#    ifdef __cplusplus\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#    else\n#      define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  define MOZ_ASSUME_UNREACHABLE_MARKER() __assume(0)\n#else\n#  ifdef __cplusplus\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() ::abort()\n#  else\n#    define MOZ_ASSUME_UNREACHABLE_MARKER() abort()\n#  endif\n#endif\n\n/*\n * MOZ_ASSUME_UNREACHABLE([reason]) tells the compiler that it can assume that\n * the macro call cannot be reached during execution.  This lets the compiler\n * generate better-optimized code under some circumstances, at the expense of\n * the program's behavior being undefined if control reaches the\n * MOZ_ASSUME_UNREACHABLE.\n *\n * In Gecko, you probably should not use this macro outside of performance- or\n * size-critical code, because it's unsafe.  If you don't care about code size\n * or performance, you should probably use MOZ_ASSERT or MOZ_CRASH.\n *\n * SpiderMonkey is a different beast, and there it's acceptable to use\n * MOZ_ASSUME_UNREACHABLE more widely.\n *\n * Note that MOZ_ASSUME_UNREACHABLE is noreturn, so it's valid not to return a\n * value following a MOZ_ASSUME_UNREACHABLE call.\n *\n * Example usage:\n *\n *   enum ValueType {\n *     VALUE_STRING,\n *     VALUE_INT,\n *     VALUE_FLOAT\n *   };\n *\n *   int ptrToInt(ValueType type, void* value) {\n *   {\n *     // We know for sure that type is either INT or FLOAT, and we want this\n *     // code to run as quickly as possible.\n *     switch (type) {\n *     case VALUE_INT:\n *       return *(int*) value;\n *     case VALUE_FLOAT:\n *       return (int) *(float*) value;\n *     default:\n *       MOZ_ASSUME_UNREACHABLE(\"can only handle VALUE_INT and VALUE_FLOAT\");\n *     }\n *   }\n */\n#if defined(DEBUG)\n#  define MOZ_ASSUME_UNREACHABLE(...) \\\n     do { \\\n       MOZ_ASSERT(false, \"MOZ_ASSUME_UNREACHABLE(\" __VA_ARGS__ \")\"); \\\n       MOZ_ASSUME_UNREACHABLE_MARKER(); \\\n     } while (0)\n#else\n#  define MOZ_ASSUME_UNREACHABLE(reason)  MOZ_ASSUME_UNREACHABLE_MARKER()\n#endif\n\n/*\n * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided\n * expression, in debug builds and in release builds both.  Then, in debug\n * builds only, the value of the expression is asserted either true or false\n * using MOZ_ASSERT.\n */\n#ifdef DEBUG\n#  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))\n#  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))\n#else\n#  define MOZ_ALWAYS_TRUE(expr)      ((void)(expr))\n#  define MOZ_ALWAYS_FALSE(expr)     ((void)(expr))\n#endif\n\n#endif /* mozilla_Assertions_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Atomics.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements (almost always) lock-free atomic operations. The operations here\n * are a subset of that which can be found in C++11's <atomic> header, with a\n * different API to enforce consistent memory ordering constraints.\n *\n * Anyone caught using |volatile| for inter-thread memory safety needs to be\n * sent a copy of this header and the C++11 standard.\n */\n\n#ifndef mozilla_Atomics_h\n#define mozilla_Atomics_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n\n/*\n * Our minimum deployment target on clang/OS X is OS X 10.6, whose SDK\n * does not have <atomic>.  So be sure to check for <atomic> support\n * along with C++0x support.\n */\n#if defined(__clang__)\n   /*\n    * clang doesn't like libstdc++'s version of <atomic> before GCC 4.7,\n    * due to the loose typing of the __sync_* family of functions done by\n    * GCC.  We do not have a particularly good way to detect this sort of\n    * case at this point, so just assume that if we're on a Linux system,\n    * we can't use the system's <atomic>.\n    *\n    * OpenBSD uses an old libstdc++ 4.2.1 and thus doesnt have <atomic>.\n    */\n#  if !defined(__linux__) && !defined(__OpenBSD__) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \\\n      __has_include(<atomic>)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n/*\n * Android uses a different C++ standard library that does not provide\n * support for <atomic>.\n *\n * GCC 4.5.x and 4.6.x's unspecialized std::atomic template doesn't include\n * inline definitions for the functions declared therein.  This oversight\n * leads to linking errors when using atomic enums.  We therefore require\n * GCC 4.7 or higher.\n */\n#elif defined(__GNUC__) && !defined(__ANDROID__)\n#  include \"mozilla/Compiler.h\"\n#  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \\\n      MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#    define MOZ_HAVE_CXX11_ATOMICS\n#  endif\n#elif defined(_MSC_VER) && _MSC_VER >= 1700\n#  define MOZ_HAVE_CXX11_ATOMICS\n#endif\n\nnamespace mozilla {\n\n/**\n * An enum of memory ordering possibilities for atomics.\n *\n * Memory ordering is the observable state of distinct values in memory.\n * (It's a separate concept from atomicity, which concerns whether an\n * operation can ever be observed in an intermediate state.  Don't\n * conflate the two!)  Given a sequence of operations in source code on\n * memory, it is *not* always the case that, at all times and on all\n * cores, those operations will appear to have occurred in that exact\n * sequence.  First, the compiler might reorder that sequence, if it\n * thinks another ordering will be more efficient.  Second, the CPU may\n * not expose so consistent a view of memory.  CPUs will often perform\n * their own instruction reordering, above and beyond that performed by\n * the compiler.  And each core has its own memory caches, and accesses\n * (reads and writes both) to \"memory\" may only resolve to out-of-date\n * cache entries -- not to the \"most recently\" performed operation in\n * some global sense.  Any access to a value that may be used by\n * multiple threads, potentially across multiple cores, must therefore\n * have a memory ordering imposed on it, for all code on all\n * threads/cores to have a sufficiently coherent worldview.\n *\n * http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync and\n * http://en.cppreference.com/w/cpp/atomic/memory_order go into more\n * detail on all this, including examples of how each mode works.\n *\n * Note that for simplicity and practicality, not all of the modes in\n * C++11 are supported.  The missing C++11 modes are either subsumed by\n * the modes we provide below, or not relevant for the CPUs we support\n * in Gecko.  These three modes are confusing enough as it is!\n */\nenum MemoryOrdering {\n  /*\n   * Relaxed ordering is the simplest memory ordering: none at all.\n   * When the result of a write is observed, nothing may be inferred\n   * about other memory.  Writes ostensibly performed \"before\" on the\n   * writing thread may not yet be visible.  Writes performed \"after\" on\n   * the writing thread may already be visible, if the compiler or CPU\n   * reordered them.  (The latter can happen if reads and/or writes get\n   * held up in per-processor caches.)  Relaxed ordering means\n   * operations can always use cached values (as long as the actual\n   * updates to atomic values actually occur, correctly, eventually), so\n   * it's usually the fastest sort of atomic access.  For this reason,\n   * *it's also the most dangerous kind of access*.\n   *\n   * Relaxed ordering is good for things like process-wide statistics\n   * counters that don't need to be consistent with anything else, so\n   * long as updates themselves are atomic.  (And so long as any\n   * observations of that value can tolerate being out-of-date -- if you\n   * need some sort of up-to-date value, you need some sort of other\n   * synchronizing operation.)  It's *not* good for locks, mutexes,\n   * reference counts, etc. that mediate access to other memory, or must\n   * be observably consistent with other memory.\n   *\n   * x86 architectures don't take advantage of the optimization\n   * opportunities that relaxed ordering permits.  Thus it's possible\n   * that using relaxed ordering will \"work\" on x86 but fail elsewhere\n   * (ARM, say, which *does* implement non-sequentially-consistent\n   * relaxed ordering semantics).  Be extra-careful using relaxed\n   * ordering if you can't easily test non-x86 architectures!\n   */\n  Relaxed,\n  /*\n   * When an atomic value is updated with ReleaseAcquire ordering, and\n   * that new value is observed with ReleaseAcquire ordering, prior\n   * writes (atomic or not) are also observable.  What ReleaseAcquire\n   * *doesn't* give you is any observable ordering guarantees for\n   * ReleaseAcquire-ordered operations on different objects.  For\n   * example, if there are two cores that each perform ReleaseAcquire\n   * operations on separate objects, each core may or may not observe\n   * the operations made by the other core.  The only way the cores can\n   * be synchronized with ReleaseAcquire is if they both\n   * ReleaseAcquire-access the same object.  This implies that you can't\n   * necessarily describe some global total ordering of ReleaseAcquire\n   * operations.\n   *\n   * ReleaseAcquire ordering is good for (as the name implies) atomic\n   * operations on values controlling ownership of things: reference\n   * counts, mutexes, and the like.  However, if you are thinking about\n   * using these to implement your own locks or mutexes, you should take\n   * a good, hard look at actual lock or mutex primitives first.\n   */\n  ReleaseAcquire,\n  /*\n   * When an atomic value is updated with SequentiallyConsistent\n   * ordering, all writes observable when the update is observed, just\n   * as with ReleaseAcquire ordering.  But, furthermore, a global total\n   * ordering of SequentiallyConsistent operations *can* be described.\n   * For example, if two cores perform SequentiallyConsistent operations\n   * on separate objects, one core will observably perform its update\n   * (and all previous operations will have completed), then the other\n   * core will observably perform its update (and all previous\n   * operations will have completed).  (Although those previous\n   * operations aren't themselves ordered -- they could be intermixed,\n   * or ordered if they occur on atomic values with ordering\n   * requirements.)  SequentiallyConsistent is the *simplest and safest*\n   * ordering of atomic operations -- it's always as if one operation\n   * happens, then another, then another, in some order -- and every\n   * core observes updates to happen in that single order.  Because it\n   * has the most synchronization requirements, operations ordered this\n   * way also tend to be slowest.\n   *\n   * SequentiallyConsistent ordering can be desirable when multiple\n   * threads observe objects, and they all have to agree on the\n   * observable order of changes to them.  People expect\n   * SequentiallyConsistent ordering, even if they shouldn't, when\n   * writing code, atomic or otherwise.  SequentiallyConsistent is also\n   * the ordering of choice when designing lockless data structures.  If\n   * you don't know what order to use, use this one.\n   */\n  SequentiallyConsistent,\n};\n\n} // namespace mozilla\n\n// Build up the underlying intrinsics.\n#ifdef MOZ_HAVE_CXX11_ATOMICS\n\n#  include <atomic>\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * We provide CompareExchangeFailureOrder to work around a bug in some\n * versions of GCC's <atomic> header.  See bug 898491.\n */\ntemplate<MemoryOrdering Order> struct AtomicOrderConstraints;\n\ntemplate<>\nstruct AtomicOrderConstraints<Relaxed>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;\n    static const std::memory_order LoadOrder = std::memory_order_relaxed;\n    static const std::memory_order StoreOrder = std::memory_order_relaxed;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_relaxed;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<ReleaseAcquire>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;\n    static const std::memory_order LoadOrder = std::memory_order_acquire;\n    static const std::memory_order StoreOrder = std::memory_order_release;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_acquire;\n};\n\ntemplate<>\nstruct AtomicOrderConstraints<SequentiallyConsistent>\n{\n    static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;\n    static const std::memory_order LoadOrder = std::memory_order_seq_cst;\n    static const std::memory_order StoreOrder = std::memory_order_seq_cst;\n    static const std::memory_order CompareExchangeFailureOrder =\n      std::memory_order_seq_cst;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicBase\n{\n    typedef std::atomic<T> ValueType;\n    typedef AtomicOrderConstraints<Order> OrderedOp;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T load(const typename Base::ValueType& ptr) {\n      return ptr.load(Base::OrderedOp::LoadOrder);\n    }\n    static void store(typename Base::ValueType& ptr, T val) {\n      ptr.store(val, Base::OrderedOp::StoreOrder);\n    }\n    static T exchange(typename Base::ValueType& ptr, T val) {\n      return ptr.exchange(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static bool compareExchange(typename Base::ValueType& ptr, T oldVal, T newVal) {\n      return ptr.compare_exchange_strong(oldVal, newVal,\n                                         Base::OrderedOp::AtomicRMWOrder,\n                                         Base::OrderedOp::CompareExchangeFailureOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub : public IntrinsicBase<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T add(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_add(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T sub(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_sub(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>\n{\n    typedef IntrinsicBase<T*, Order> Base;\n    static T* add(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_add(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T* sub(typename Base::ValueType& ptr, ptrdiff_t val) {\n      return ptr.fetch_sub(fixupAddend(val), Base::OrderedOp::AtomicRMWOrder);\n    }\n  private:\n    /*\n     * GCC 4.6's <atomic> header has a bug where adding X to an\n     * atomic<T*> is not the same as adding X to a T*.  Hence the need\n     * for this function to provide the correct addend.\n     */\n    static ptrdiff_t fixupAddend(ptrdiff_t val) {\n#if defined(__clang__) || defined(_MSC_VER)\n      return val;\n#elif defined(__GNUC__) && MOZ_GCC_VERSION_AT_LEAST(4, 6, 0) && \\\n      !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n      return val * sizeof(T);\n#else\n      return val;\n#endif\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T inc(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::add(ptr, 1);\n    }\n    static T dec(typename Base::ValueType& ptr) {\n      return IntrinsicAddSub<T, Order>::sub(ptr, 1);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T, Order>\n{\n    typedef IntrinsicBase<T, Order> Base;\n    static T or_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_or(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T xor_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_xor(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n    static T and_(typename Base::ValueType& ptr, T val) {\n      return ptr.fetch_and(val, Base::OrderedOp::AtomicRMWOrder);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order>\n  : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(__GNUC__)\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The __sync_* family of intrinsics is documented here:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Atomic-Builtins.html\n *\n * While these intrinsics are deprecated in favor of the newer __atomic_*\n * family of intrincs:\n *\n * http://gcc.gnu.org/onlinedocs/gcc-4.7.3/gcc/_005f_005fatomic-Builtins.html\n *\n * any GCC version that supports the __atomic_* intrinsics will also support\n * the <atomic> header and so will be handled above.  We provide a version of\n * atomics using the __sync_* intrinsics to support older versions of GCC.\n *\n * All __sync_* intrinsics that we use below act as full memory barriers, for\n * both compiler and hardware reordering, except for __sync_lock_test_and_set,\n * which is a only an acquire barrier.  When we call __sync_lock_test_and_set,\n * we add a barrier above it as appropriate.\n */\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * Some processors (in particular, x86) don't require quite so many calls to\n * __sync_sychronize as our specializations of Barrier produce.  If\n * performance turns out to be an issue, defining these specializations\n * on a per-processor basis would be a good first tuning step.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() {}\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { __sync_synchronize(); }\n    static void afterLoad() { __sync_synchronize(); }\n    static void beforeStore() { __sync_synchronize(); }\n    static void afterStore() { __sync_synchronize(); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps\n{\n    static T load(const T& ptr) {\n      Barrier<Order>::beforeLoad();\n      T val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(T& ptr, T val) {\n      Barrier<Order>::beforeStore();\n      ptr = val;\n      Barrier<Order>::afterStore();\n    }\n    static T exchange(T& ptr, T val) {\n      // __sync_lock_test_and_set is only an acquire barrier; loads and stores\n      // can't be moved up from after to before it, but they can be moved down\n      // from before to after it.  We may want a stricter ordering, so we need\n      // an explicit barrier.\n\n      Barrier<Order>::beforeStore();\n      return __sync_lock_test_and_set(&ptr, val);\n    }\n    static bool compareExchange(T& ptr, T oldVal, T newVal) {\n      return __sync_bool_compare_and_swap(&ptr, oldVal, newVal);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub\n{\n    typedef T ValueType;\n    static T add(T& ptr, T val) {\n      return __sync_fetch_and_add(&ptr, val);\n    }\n    static T sub(T& ptr, T val) {\n      return __sync_fetch_and_sub(&ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*>\n{\n    typedef T* ValueType;\n    /*\n     * The reinterpret_casts are needed so that\n     * __sync_fetch_and_{add,sub} will properly type-check.\n     *\n     * Also, these functions do not provide standard semantics for\n     * pointer types, so we need to adjust the addend.\n     */\n    static ValueType add(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_add(&ptr, amount);\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t val) {\n      ValueType amount = reinterpret_cast<ValueType>(val * sizeof(T));\n      return __sync_fetch_and_sub(&ptr, amount);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static T inc(T& ptr) { return IntrinsicAddSub<T>::add(ptr, 1); }\n    static T dec(T& ptr) { return IntrinsicAddSub<T>::sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static T or_(T& ptr, T val) {\n      return __sync_fetch_and_or(&ptr, val);\n    }\n    static T xor_(T& ptr, T val) {\n      return __sync_fetch_and_xor(&ptr, val);\n    }\n    static T and_(T& ptr, T val) {\n      return __sync_fetch_and_and(&ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#elif defined(_MSC_VER)\n\n/*\n * Windows comes with a full complement of atomic operations.\n * Unfortunately, most of those aren't available for Windows XP (even if\n * the compiler supports intrinsics for them), which is the oldest\n * version of Windows we support.  Therefore, we only provide operations\n * on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows\n * versions, we support 64-bit datatypes as well.\n *\n * To avoid namespace pollution issues, we declare whatever functions we\n * need ourselves.\n */\n\nextern \"C\" {\nlong __cdecl _InterlockedExchangeAdd(long volatile* dst, long value);\nlong __cdecl _InterlockedOr(long volatile* dst, long value);\nlong __cdecl _InterlockedXor(long volatile* dst, long value);\nlong __cdecl _InterlockedAnd(long volatile* dst, long value);\nlong __cdecl _InterlockedExchange(long volatile *dst, long value);\nlong __cdecl _InterlockedCompareExchange(long volatile *dst, long newVal, long oldVal);\n}\n\n#  pragma intrinsic(_InterlockedExchangeAdd)\n#  pragma intrinsic(_InterlockedOr)\n#  pragma intrinsic(_InterlockedXor)\n#  pragma intrinsic(_InterlockedAnd)\n#  pragma intrinsic(_InterlockedExchange)\n#  pragma intrinsic(_InterlockedCompareExchange)\n\nnamespace mozilla {\nnamespace detail {\n\n#  if !defined(_M_IX86) && !defined(_M_X64)\n     /*\n      * The implementations below are optimized for x86ish systems.  You\n      * will have to modify them if you are porting to Windows on a\n      * different architecture.\n      */\n#    error \"Unknown CPU type\"\n#  endif\n\n/*\n * The PrimitiveIntrinsics template should define |Type|, the datatype of size\n * DataSize upon which we operate, and the following eight functions.\n *\n * static Type add(Type* ptr, Type val);\n * static Type sub(Type* ptr, Type val);\n * static Type or_(Type* ptr, Type val);\n * static Type xor_(Type* ptr, Type val);\n * static Type and_(Type* ptr, Type val);\n *\n *   These functions perform the obvious operation on the value contained in\n *   |*ptr| combined with |val| and return the value previously stored in\n *   |*ptr|.\n *\n * static void store(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and must provide a full\n *   memory fence after the store to prevent compiler and hardware instruction\n *   reordering.  It should also act as a compiler barrier to prevent reads and\n *   writes from moving to after the store.\n *\n * static Type exchange(Type* ptr, Type val);\n *\n *   This function atomically stores |val| into |*ptr| and returns the previous\n *   contents of *ptr;\n *\n * static bool compareExchange(Type* ptr, Type oldVal, Type newVal);\n *\n *   This function atomically performs the following operation:\n *\n *     if (*ptr == oldVal) {\n *       *ptr = newVal;\n *       return true;\n *     } else {\n *       return false;\n *     }\n *\n */\ntemplate<size_t DataSize> struct PrimitiveIntrinsics;\n\ntemplate<>\nstruct PrimitiveIntrinsics<4>\n{\n    typedef long Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * _InterlockedExchangeSubtract isn't available before Windows 7,\n       * and we must support Windows XP.\n       */\n      return _InterlockedExchangeAdd(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  if defined(_M_X64)\n\nextern \"C\" {\nlong long __cdecl _InterlockedExchangeAdd64(long long volatile* dst,\n                                            long long value);\nlong long __cdecl _InterlockedOr64(long long volatile* dst,\n                                   long long value);\nlong long __cdecl _InterlockedXor64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedAnd64(long long volatile* dst,\n                                    long long value);\nlong long __cdecl _InterlockedExchange64(long long volatile* dst,\n                                         long long value);\nlong long __cdecl _InterlockedCompareExchange64(long long volatile* dst,\n                                                long long newVal,\n                                                long long oldVal);\n}\n\n#    pragma intrinsic(_InterlockedExchangeAdd64)\n#    pragma intrinsic(_InterlockedOr64)\n#    pragma intrinsic(_InterlockedXor64)\n#    pragma intrinsic(_InterlockedAnd64)\n#    pragma intrinsic(_InterlockedExchange64)\n#    pragma intrinsic(_InterlockedCompareExchange64)\n\ntemplate <>\nstruct PrimitiveIntrinsics<8>\n{\n    typedef __int64 Type;\n\n    static Type add(Type* ptr, Type val) {\n      return _InterlockedExchangeAdd64(ptr, val);\n    }\n    static Type sub(Type* ptr, Type val) {\n      /*\n       * There is no _InterlockedExchangeSubtract64.\n       */\n      return _InterlockedExchangeAdd64(ptr, -val);\n    }\n    static Type or_(Type* ptr, Type val) {\n      return _InterlockedOr64(ptr, val);\n    }\n    static Type xor_(Type* ptr, Type val) {\n      return _InterlockedXor64(ptr, val);\n    }\n    static Type and_(Type* ptr, Type val) {\n      return _InterlockedAnd64(ptr, val);\n    }\n    static void store(Type* ptr, Type val) {\n      _InterlockedExchange64(ptr, val);\n    }\n    static Type exchange(Type* ptr, Type val) {\n      return _InterlockedExchange64(ptr, val);\n    }\n    static bool compareExchange(Type* ptr, Type oldVal, Type newVal) {\n      return _InterlockedCompareExchange64(ptr, newVal, oldVal) == oldVal;\n    }\n};\n\n#  endif\n\nextern \"C\" { void _ReadWriteBarrier(); }\n\n#  pragma intrinsic(_ReadWriteBarrier)\n\ntemplate<MemoryOrdering Order> struct Barrier;\n\n/*\n * We do not provide an afterStore method in Barrier, as Relaxed and\n * ReleaseAcquire orderings do not require one, and the required barrier\n * for SequentiallyConsistent is handled by PrimitiveIntrinsics.\n */\n\ntemplate<>\nstruct Barrier<Relaxed>\n{\n    static void beforeLoad() {}\n    static void afterLoad() {}\n    static void beforeStore() {}\n};\n\ntemplate<>\nstruct Barrier<ReleaseAcquire>\n{\n    static void beforeLoad() {}\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<>\nstruct Barrier<SequentiallyConsistent>\n{\n    static void beforeLoad() { _ReadWriteBarrier(); }\n    static void afterLoad() { _ReadWriteBarrier(); }\n    static void beforeStore() { _ReadWriteBarrier(); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper\n{\n  static PrimType toPrimType(T val) { return static_cast<PrimType>(val); }\n  static T fromPrimType(PrimType val) { return static_cast<T>(val); }\n};\n\ntemplate<typename PrimType, typename T>\nstruct CastHelper<PrimType, T*>\n{\n  static PrimType toPrimType(T* val) { return reinterpret_cast<PrimType>(val); }\n  static T* fromPrimType(PrimType val) { return reinterpret_cast<T*>(val); }\n};\n\ntemplate<typename T>\nstruct IntrinsicBase\n{\n    typedef T ValueType;\n    typedef PrimitiveIntrinsics<sizeof(T)> Primitives;\n    typedef typename Primitives::Type PrimType;\n    static_assert(sizeof(PrimType) == sizeof(T),\n                  \"Selection of PrimitiveIntrinsics was wrong\");\n    typedef CastHelper<PrimType, T> Cast;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct IntrinsicMemoryOps : public IntrinsicBase<T>\n{\n    static ValueType load(const ValueType& ptr) {\n      Barrier<Order>::beforeLoad();\n      ValueType val = ptr;\n      Barrier<Order>::afterLoad();\n      return val;\n    }\n    static void store(ValueType& ptr, ValueType val) {\n      // For SequentiallyConsistent, Primitives::store() will generate the\n      // proper memory fence.  Everything else just needs a barrier before\n      // the store.\n      if (Order == SequentiallyConsistent) {\n        Primitives::store(reinterpret_cast<PrimType*>(&ptr),\n                          Cast::toPrimType(val));\n      } else {\n        Barrier<Order>::beforeStore();\n        ptr = val;\n      }\n    }\n    static ValueType exchange(ValueType& ptr, ValueType val) {\n      PrimType oldval =\n        Primitives::exchange(reinterpret_cast<PrimType*>(&ptr),\n                             Cast::toPrimType(val));\n      return Cast::fromPrimType(oldval);\n    }\n    static bool compareExchange(ValueType& ptr, ValueType oldVal, ValueType newVal) {\n      return Primitives::compareExchange(reinterpret_cast<PrimType*>(&ptr),\n                                         Cast::toPrimType(oldVal),\n                                         Cast::toPrimType(newVal));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicApplyHelper : public IntrinsicBase<T>\n{\n    typedef PrimType (*BinaryOp)(PrimType*, PrimType);\n    typedef PrimType (*UnaryOp)(PrimType*);\n\n    static ValueType applyBinaryFunction(BinaryOp op, ValueType& ptr,\n                                         ValueType val) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      PrimType primTypeVal = Cast::toPrimType(val);\n      return Cast::fromPrimType(op(primTypePtr, primTypeVal));\n    }\n\n    static ValueType applyUnaryFunction(UnaryOp op, ValueType& ptr) {\n      PrimType* primTypePtr = reinterpret_cast<PrimType*>(&ptr);\n      return Cast::fromPrimType(op(primTypePtr));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub : public IntrinsicApplyHelper<T>\n{\n    static ValueType add(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::add, ptr, val);\n    }\n    static ValueType sub(ValueType& ptr, ValueType val) {\n      return applyBinaryFunction(&Primitives::sub, ptr, val);\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicAddSub<T*> : public IntrinsicApplyHelper<T*>\n{\n    static ValueType add(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::add, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n    static ValueType sub(ValueType& ptr, ptrdiff_t amount) {\n      return applyBinaryFunction(&Primitives::sub, ptr,\n                                 (ValueType)(amount * sizeof(ValueType)));\n    }\n};\n\ntemplate<typename T>\nstruct IntrinsicIncDec : public IntrinsicAddSub<T>\n{\n    static ValueType inc(ValueType& ptr) { return add(ptr, 1); }\n    static ValueType dec(ValueType& ptr) { return sub(ptr, 1); }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,\n                          public IntrinsicIncDec<T>\n{\n    static ValueType or_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::or_, ptr, val);\n    }\n    static ValueType xor_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::xor_, ptr, val);\n    }\n    static ValueType and_(ValueType& ptr, T val) {\n      return applyBinaryFunction(&Primitives::and_, ptr, val);\n    }\n};\n\ntemplate<typename T, MemoryOrdering Order>\nstruct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,\n                                     public IntrinsicIncDec<T*>\n{\n};\n\n} // namespace detail\n} // namespace mozilla\n\n#else\n# error \"Atomic compiler intrinsics are not supported on your platform\"\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBase\n{\n    // We only support 32-bit types on 32-bit Windows, which constrains our\n    // implementation elsewhere.  But we support pointer-sized types everywhere.\n    static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),\n                  \"mozilla/Atomics.h only supports 32-bit and pointer-sized types\");\n\n  protected:\n    typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;\n    typename Intrinsics::ValueType mValue;\n\n  public:\n    AtomicBase() : mValue() {}\n    AtomicBase(T aInit) { Intrinsics::store(mValue, aInit); }\n\n    operator T() const { return Intrinsics::load(mValue); }\n\n    T operator=(T aValue) {\n      Intrinsics::store(mValue, aValue);\n      return aValue;\n    }\n\n    /**\n     * Performs an atomic swap operation.  aValue is stored and the previous\n     * value of this variable is returned.\n     */\n    T exchange(T aValue) {\n      return Intrinsics::exchange(mValue, aValue);\n    }\n\n    /**\n     * Performs an atomic compare-and-swap operation and returns true if it\n     * succeeded. This is equivalent to atomically doing\n     *\n     *   if (mValue == aOldValue) {\n     *     mValue = aNewValue;\n     *     return true;\n     *   } else {\n     *     return false;\n     *   }\n     */\n    bool compareExchange(T aOldValue, T aNewValue) {\n      return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);\n    }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\ntemplate<typename T, MemoryOrdering Order>\nclass AtomicBaseIncDec : public AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    AtomicBaseIncDec() : Base() {}\n    AtomicBaseIncDec(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }\n    T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }\n    T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }\n    T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }\n\n  private:\n    template<MemoryOrdering AnyOrder>\n    AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) MOZ_DELETE;\n};\n\n} // namespace detail\n\n/**\n * A wrapper for a type that enforces that all memory accesses are atomic.\n *\n * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in\n * its place.  Implementations for integral and pointer types are provided\n * below.\n *\n * Atomic accesses are sequentially consistent by default.  You should\n * use the default unless you are tall enough to ride the\n * memory-ordering roller coaster (if you're not sure, you aren't) and\n * you have a compelling reason to do otherwise.\n *\n * There is one exception to the case of atomic memory accesses: providing an\n * initial value of the atomic value is not guaranteed to be atomic.  This is a\n * deliberate design choice that enables static atomic variables to be declared\n * without introducing extra static constructors.\n */\ntemplate<typename T,\n         MemoryOrdering Order = SequentiallyConsistent,\n         typename Enable = void>\nclass Atomic;\n\n/**\n * Atomic<T> implementation for integral types.\n *\n * In addition to atomic store and load operations, compound assignment and\n * increment/decrement operators are implemented which perform the\n * corresponding read-modify-write operation atomically.  Finally, an atomic\n * swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsIntegral<T>::value>::Type>\n  : public detail::AtomicBaseIncDec<T, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T operator+=(T delta) { return Base::Intrinsics::add(Base::mValue, delta) + delta; }\n    T operator-=(T delta) { return Base::Intrinsics::sub(Base::mValue, delta) - delta; }\n    T operator|=(T val) { return Base::Intrinsics::or_(Base::mValue, val) | val; }\n    T operator^=(T val) { return Base::Intrinsics::xor_(Base::mValue, val) ^ val; }\n    T operator&=(T val) { return Base::Intrinsics::and_(Base::mValue, val) & val; }\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for pointer types.\n *\n * An atomic compare-and-swap primitive for pointer variables is provided, as\n * are atomic increment and decement operators.  Also provided are the compound\n * assignment operators for addition and subtraction. Atomic swap (via\n * exchange()) is included as well.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>\n{\n    typedef typename detail::AtomicBaseIncDec<T*, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T* aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n    T* operator+=(ptrdiff_t delta) {\n      return Base::Intrinsics::add(Base::mValue, delta) + delta;\n    }\n    T* operator-=(ptrdiff_t delta) {\n      return Base::Intrinsics::sub(Base::mValue, delta) - delta;\n    }\n\n  private:\n    Atomic(Atomic<T*, Order>& aOther) MOZ_DELETE;\n};\n\n/**\n * Atomic<T> implementation for enum types.\n *\n * The atomic store and load operations and the atomic swap method is provided.\n */\ntemplate<typename T, MemoryOrdering Order>\nclass Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>\n  : public detail::AtomicBase<T, Order>\n{\n    typedef typename detail::AtomicBase<T, Order> Base;\n\n  public:\n    Atomic() : Base() {}\n    Atomic(T aInit) : Base(aInit) {}\n\n    using Base::operator=;\n\n  private:\n    Atomic(Atomic<T, Order>& aOther) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Atomics_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Attributes.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementations of various class and method modifier attributes. */\n\n#ifndef mozilla_Attributes_h\n#define mozilla_Attributes_h\n\n#include \"mozilla/Compiler.h\"\n\n/*\n * MOZ_INLINE is a macro which expands to tell the compiler that the method\n * decorated with it should be inlined.  This macro is usable from C and C++\n * code, even though C89 does not support the |inline| keyword.  The compiler\n * may ignore this directive if it chooses.\n */\n#if defined(__cplusplus)\n#  define MOZ_INLINE            inline\n#elif defined(_MSC_VER)\n#  define MOZ_INLINE            __inline\n#elif defined(__GNUC__)\n#  define MOZ_INLINE            __inline__\n#else\n#  define MOZ_INLINE            inline\n#endif\n\n/*\n * MOZ_ALWAYS_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must be inlined, even if the compiler thinks\n * otherwise.  This is only a (much) stronger version of the MOZ_INLINE hint:\n * compilers are not guaranteed to respect it (although they're much more likely\n * to do so).\n *\n * The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the\n * compiler to inline even in DEBUG builds. It should be used very rarely.\n */\n#if defined(_MSC_VER)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __forceinline\n#elif defined(__GNUC__)\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     __attribute__((always_inline)) MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE_EVEN_DEBUG     MOZ_INLINE\n#endif\n\n#if defined(DEBUG)\n#  define MOZ_ALWAYS_INLINE     MOZ_INLINE\n#else\n#  define MOZ_ALWAYS_INLINE     MOZ_ALWAYS_INLINE_EVEN_DEBUG\n#endif\n\n/*\n * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality\n * without warnings (functionality used by the macros below).  These modes are\n * detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or, more\n * standardly, by checking whether __cplusplus has a C++11 or greater value.\n * Current versions of g++ do not correctly set __cplusplus, so we check both\n * for forward compatibility.\n */\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_constexpr)\n#    define MOZ_HAVE_CXX11_CONSTEXPR\n#  endif\n#  if __has_extension(cxx_deleted_functions)\n#    define MOZ_HAVE_CXX11_DELETE\n#  endif\n#  if __has_extension(cxx_override_control)\n#    define MOZ_HAVE_CXX11_OVERRIDE\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  endif\n#  if __has_attribute(noinline)\n#    define MOZ_HAVE_NEVER_INLINE        __attribute__((noinline))\n#  endif\n#  if __has_attribute(noreturn)\n#    define MOZ_HAVE_NORETURN            __attribute__((noreturn))\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_OVERRIDE\n#      define MOZ_HAVE_CXX11_FINAL       final\n#    endif\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_CONSTEXPR\n#    endif\n#    define MOZ_HAVE_CXX11_DELETE\n#  else\n     /* __final is a non-C++11 GCC synonym for 'final', per GCC r176655. */\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)\n#      define MOZ_HAVE_CXX11_FINAL       __final\n#    endif\n#  endif\n#  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))\n#  define MOZ_HAVE_NORETURN              __attribute__((noreturn))\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_FINAL         final\n#  else\n     /* MSVC <= 10 used to spell \"final\" as \"sealed\". */\n#    define MOZ_HAVE_CXX11_FINAL         sealed\n#  endif\n#  define MOZ_HAVE_CXX11_OVERRIDE\n#  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)\n#  define MOZ_HAVE_NORETURN              __declspec(noreturn)\n#endif\n\n/*\n * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a\n * function at compile time. A constexpr function cannot examine any values\n * except its arguments and can have no side effects except its return value.\n * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's\n * value may be computed at compile time.  It should be prefered to just\n * marking variables as MOZ_CONSTEXPR because if the compiler does not support\n * constexpr it will fall back to making the variable const, and some compilers\n * do not accept variables being marked both const and constexpr.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_CONSTEXPR         constexpr\n#  define MOZ_CONSTEXPR_VAR     constexpr\n#else\n#  define MOZ_CONSTEXPR         /* no support */\n#  define MOZ_CONSTEXPR_VAR     const\n#endif\n\n/*\n * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the\n * method decorated with it must never be inlined, even if the compiler would\n * otherwise choose to inline the method.  Compilers aren't absolutely\n * guaranteed to support this, but most do.\n */\n#if defined(MOZ_HAVE_NEVER_INLINE)\n#  define MOZ_NEVER_INLINE      MOZ_HAVE_NEVER_INLINE\n#else\n#  define MOZ_NEVER_INLINE      /* no support */\n#endif\n\n/*\n * MOZ_NORETURN, specified at the start of a function declaration, indicates\n * that the given function does not return.  (The function definition does not\n * need to be annotated.)\n *\n *   MOZ_NORETURN void abort(const char* msg);\n *\n * This modifier permits the compiler to optimize code assuming a call to such a\n * function will never return.  It also enables the compiler to avoid spurious\n * warnings about not initializing variables, or about any other seemingly-dodgy\n * operations performed after the function returns.\n *\n * This modifier does not affect the corresponding function's linking behavior.\n */\n#if defined(MOZ_HAVE_NORETURN)\n#  define MOZ_NORETURN          MOZ_HAVE_NORETURN\n#else\n#  define MOZ_NORETURN          /* no support */\n#endif\n\n/*\n * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time\n * instrumentation shipped with Clang) to not instrument the annotated function.\n * Furthermore, it will prevent the compiler from inlining the function because\n * inlining currently breaks the blacklisting mechanism of AddressSanitizer.\n */\n#if defined(MOZ_ASAN)\n#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis))\n# else\n#  define MOZ_ASAN_BLACKLIST\n#endif\n\n\n#ifdef __cplusplus\n\n/*\n * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-\n * method declaration, attempts to delete that method from the corresponding\n * class.  An attempt to use the method will always produce an error *at compile\n * time* (instead of sometimes as late as link time) when this macro can be\n * implemented.  For example, you can use MOZ_DELETE to produce classes with no\n * implicit copy constructor or assignment operator:\n *\n *   struct NonCopyable\n *   {\n *     private:\n *       NonCopyable(const NonCopyable& other) MOZ_DELETE;\n *       void operator=(const NonCopyable& other) MOZ_DELETE;\n *   };\n *\n * If MOZ_DELETE can't be implemented for the current compiler, use of the\n * annotated method will still cause an error, but the error might occur at link\n * time in some cases rather than at compile time.\n *\n * MOZ_DELETE relies on C++11 functionality not universally implemented.  As a\n * backstop, method declarations using MOZ_DELETE should be private.\n */\n#if defined(MOZ_HAVE_CXX11_DELETE)\n#  define MOZ_DELETE            = delete\n#else\n#  define MOZ_DELETE            /* no support */\n#endif\n\n/*\n * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class\n * overrides a member function of a base class, rather than potentially being a\n * new member function.  MOZ_OVERRIDE should be placed immediately before the\n * ';' terminating the member function's declaration, or before '= 0;' if the\n * member function is pure.  If the member function is defined in the class\n * definition, it should appear before the opening brace of the function body.\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() = 0;\n *   };\n *   class Derived1 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE;\n *   };\n *   class Derived2 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE = 0;\n *   };\n *   class Derived3 : public Base\n *   {\n *     public:\n *       virtual void f() MOZ_OVERRIDE { }\n *   };\n *\n * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that\n * the function marked with it override a member function of a base class: it\n * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect\n * semantics and merely documents the override relationship to the reader (but\n * of course must still be used correctly to not break C++11 compilers).\n */\n#if defined(MOZ_HAVE_CXX11_OVERRIDE)\n#  define MOZ_OVERRIDE          override\n#else\n#  define MOZ_OVERRIDE          /* no support */\n#endif\n\n/*\n * MOZ_FINAL indicates that some functionality cannot be overridden through\n * inheritance.  It can be used to annotate either classes/structs or virtual\n * member functions.\n *\n * To annotate a class/struct with MOZ_FINAL, place MOZ_FINAL immediately after\n * the name of the class, before the list of classes from which it derives (if\n * any) and before its opening brace.  MOZ_FINAL must not be used to annotate\n * unnamed classes or structs.  (With some compilers, and with C++11 proper, the\n * underlying expansion is ambiguous with specifying a class name.)\n *\n *   class Base MOZ_FINAL\n *   {\n *     public:\n *       Base();\n *       ~Base();\n *       virtual void f() { }\n *   };\n *   // This will be an error in some compilers:\n *   class Derived : public Base\n *   {\n *     public:\n *       ~Derived() { }\n *   };\n *\n * One particularly common reason to specify MOZ_FINAL upon a class is to tell\n * the compiler that it's not dangerous for it to have a non-virtual destructor\n * yet have one or more virtual functions, silencing the warning it might emit\n * in this case.  Suppose Base above weren't annotated with MOZ_FINAL.  Because\n * ~Base() is non-virtual, an attempt to delete a Derived* through a Base*\n * wouldn't call ~Derived(), so any cleanup ~Derived() might do wouldn't happen.\n * (Formally C++ says behavior is undefined, but compilers will likely just call\n * ~Base() and not ~Derived().)  Specifying MOZ_FINAL tells the compiler that\n * it's safe for the destructor to be non-virtual.\n *\n * In compilers implementing final controls, it is an error to inherit from a\n * class annotated with MOZ_FINAL.  In other compilers it serves only as\n * documentation.\n *\n * To annotate a virtual member function with MOZ_FINAL, place MOZ_FINAL\n * immediately before the ';' terminating the member function's declaration, or\n * before '= 0;' if the member function is pure.  If the member function is\n * defined in the class definition, it should appear before the opening brace of\n * the function body.  (This placement is identical to that for MOZ_OVERRIDE.\n * If both are used, they should appear in the order 'MOZ_FINAL MOZ_OVERRIDE'\n * for consistency.)\n *\n *   class Base\n *   {\n *     public:\n *       virtual void f() MOZ_FINAL;\n *   };\n *   class Derived\n *   {\n *     public:\n *       // This will be an error in some compilers:\n *       virtual void f();\n *   };\n *\n * In compilers implementing final controls, it is an error for a derived class\n * to override a method annotated with MOZ_FINAL.  In other compilers it serves\n * only as documentation.\n */\n#if defined(MOZ_HAVE_CXX11_FINAL)\n#  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL\n#else\n#  define MOZ_FINAL             /* no support */\n#endif\n\n/**\n * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's\n * return value is not used by the caller.\n *\n * Place this attribute at the very beginning of a function definition. For\n * example, write\n *\n *   MOZ_WARN_UNUSED_RESULT int foo();\n *\n * or\n *\n *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }\n */\n#if defined(__GNUC__) || defined(__clang__)\n#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))\n#else\n#  define MOZ_WARN_UNUSED_RESULT\n#endif\n\n/*\n * The following macros are attributes that support the static analysis plugin\n * included with Mozilla, and will be implemented (when such support is enabled)\n * as C++11 attributes. Since such attributes are legal pretty much everywhere\n * and have subtly different semantics depending on their placement, the\n * following is a guide on where to place the attributes.\n *\n * Attributes that apply to a struct or class precede the name of the class:\n * (Note that this is different from the placement of MOZ_FINAL for classes!)\n *\n *   class MOZ_CLASS_ATTRIBUTE SomeClass {};\n *\n * Attributes that apply to functions follow the parentheses and const\n * qualifiers but precede MOZ_FINAL, MOZ_OVERRIDE and the function body:\n *\n *   void DeclaredFunction() MOZ_FUNCTION_ATTRIBUTE;\n *   void SomeFunction() MOZ_FUNCTION_ATTRIBUTE {}\n *   void PureFunction() const MOZ_FUNCTION_ATTRIBUTE = 0;\n *   void OverriddenFunction() MOZ_FUNCTION_ATTIRBUTE MOZ_OVERRIDE;\n *\n * Attributes that apply to variables or parameters follow the variable's name:\n *\n *   int variable MOZ_VARIABLE_ATTRIBUTE;\n *\n * Attributes that apply to types follow the type name:\n *\n *   typedef int MOZ_TYPE_ATTRIBUTE MagicInt;\n *   int MOZ_TYPE_ATTRIBUTE someVariable;\n *   int * MOZ_TYPE_ATTRIBUTE magicPtrInt;\n *   int MOZ_TYPE_ATTRIBUTE * ptrToMagicInt;\n *\n * Attributes that apply to statements precede the statement:\n *\n *   MOZ_IF_ATTRIBUTE if (x == 0)\n *   MOZ_DO_ATTRIBUTE do { } while(0);\n *\n * Attributes that apply to labels precede the label:\n *\n *   MOZ_LABEL_ATTRIBUTE target:\n *     goto target;\n *   MOZ_CASE_ATTRIBUTE case 5:\n *   MOZ_DEFAULT_ATTRIBUTE default:\n *\n * The static analyses that are performed by the plugin are as follows:\n *\n * MOZ_MUST_OVERRIDE: Applies to all C++ member functions. All immediate\n *   subclasses must provide an exact override of this method; if a subclass\n *   does not override this method, the compiler will emit an error. This\n *   attribute is not limited to virtual methods, so if it is applied to a\n *   nonvirtual method and the subclass does not provide an equivalent\n *   definition, the compiler will emit an error.\n * MOZ_STACK_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack, so it is a compile-time error to use it, or\n *   an array of such objects, as a global or static variable, or as the type of\n *   a new expression (unless placement new is being used). If a member of\n *   another class uses this class, or if another class inherits from this\n *   class, then it is considered to be a stack class as well, although this\n *   attribute need not be provided in such cases.\n * MOZ_NONHEAP_CLASS: Applies to all classes. Any class with this annotation is\n *   expected to live on the stack or in static storage, so it is a compile-time\n *   error to use it, or an array of such objects, as the type of a new\n *   expression (unless placement new is being used). If a member of another\n *   class uses this class, or if another class inherits from this class, then\n *   it is considered to be a non-heap class as well, although this attribute\n *   need not be provided in such cases.\n */\n#ifdef MOZ_CLANG_PLUGIN\n# define MOZ_MUST_OVERRIDE __attribute__((annotate(\"moz_must_override\")))\n# define MOZ_STACK_CLASS __attribute__((annotate(\"moz_stack_class\")))\n# define MOZ_NONHEAP_CLASS __attribute__((annotate(\"moz_nonheap_class\")))\n#else\n# define MOZ_MUST_OVERRIDE /* nothing */\n# define MOZ_STACK_CLASS /* nothing */\n# define MOZ_NONHEAP_CLASS /* nothing */\n#endif /* MOZ_CLANG_PLUGIN */\n\n/*\n * MOZ_THIS_IN_INITIALIZER_LIST is used to avoid a warning when we know that\n * it's safe to use 'this' in an initializer list.\n */\n#ifdef _MSC_VER\n#  define MOZ_THIS_IN_INITIALIZER_LIST() \\\n     __pragma(warning(push)) \\\n     __pragma(warning(disable:4355)) \\\n     this \\\n     __pragma(warning(pop))\n#else\n#  define MOZ_THIS_IN_INITIALIZER_LIST() this\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_Attributes_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/BloomFilter.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A counting Bloom filter implementation.  This allows consumers to\n * do fast probabilistic \"is item X in set Y?\" testing which will\n * never answer \"no\" when the correct answer is \"yes\" (but might\n * incorrectly answer \"yes\" when the correct answer is \"no\").\n */\n\n#ifndef mozilla_BloomFilter_h\n#define mozilla_BloomFilter_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Likely.h\"\n#include \"mozilla/Util.h\"\n\n#include <stdint.h>\n#include <string.h>\n\nnamespace mozilla {\n\n/*\n * This class implements a counting Bloom filter as described at\n * <http://en.wikipedia.org/wiki/Bloom_filter#Counting_filters>, with\n * 8-bit counters.  This allows quick probabilistic answers to the\n * question \"is object X in set Y?\" where the contents of Y might not\n * be time-invariant.  The probabilistic nature of the test means that\n * sometimes the answer will be \"yes\" when it should be \"no\".  If the\n * answer is \"no\", then X is guaranteed not to be in Y.\n *\n * The filter is parametrized on KeySize, which is the size of the key\n * generated by each of hash functions used by the filter, in bits,\n * and the type of object T being added and removed.  T must implement\n * a |uint32_t hash() const| method which returns a uint32_t hash key\n * that will be used to generate the two separate hash functions for\n * the Bloom filter.  This hash key MUST be well-distributed for good\n * results!  KeySize is not allowed to be larger than 16.\n *\n * The filter uses exactly 2**KeySize bytes of memory.  From now on we\n * will refer to the memory used by the filter as M.\n *\n * The expected rate of incorrect \"yes\" answers depends on M and on\n * the number N of objects in set Y.  As long as N is small compared\n * to M, the rate of such answers is expected to be approximately\n * 4*(N/M)**2 for this filter.  In practice, if Y has a few hundred\n * elements then using a KeySize of 12 gives a reasonably low\n * incorrect answer rate.  A KeySize of 12 has the additional benefit\n * of using exactly one page for the filter in typical hardware\n * configurations.\n */\n\ntemplate<unsigned KeySize, class T>\nclass BloomFilter\n{\n    /*\n     * A counting Bloom filter with 8-bit counters.  For now we assume\n     * that having two hash functions is enough, but we may revisit that\n     * decision later.\n     *\n     * The filter uses an array with 2**KeySize entries.\n     *\n     * Assuming a well-distributed hash function, a Bloom filter with\n     * array size M containing N elements and\n     * using k hash function has expected false positive rate exactly\n     *\n     * $  (1 - (1 - 1/M)^{kN})^k  $\n     *\n     * because each array slot has a\n     *\n     * $  (1 - 1/M)^{kN}  $\n     *\n     * chance of being 0, and the expected false positive rate is the\n     * probability that all of the k hash functions will hit a nonzero\n     * slot.\n     *\n     * For reasonable assumptions (M large, kN large, which should both\n     * hold if we're worried about false positives) about M and kN this\n     * becomes approximately\n     *\n     * $$  (1 - \\exp(-kN/M))^k   $$\n     *\n     * For our special case of k == 2, that's $(1 - \\exp(-2N/M))^2$,\n     * or in other words\n     *\n     * $$    N/M = -0.5 * \\ln(1 - \\sqrt(r))   $$\n     *\n     * where r is the false positive rate.  This can be used to compute\n     * the desired KeySize for a given load N and false positive rate r.\n     *\n     * If N/M is assumed small, then the false positive rate can\n     * further be approximated as 4*N^2/M^2.  So increasing KeySize by\n     * 1, which doubles M, reduces the false positive rate by about a\n     * factor of 4, and a false positive rate of 1% corresponds to\n     * about M/N == 20.\n     *\n     * What this means in practice is that for a few hundred keys using a\n     * KeySize of 12 gives false positive rates on the order of 0.25-4%.\n     *\n     * Similarly, using a KeySize of 10 would lead to a 4% false\n     * positive rate for N == 100 and to quite bad false positive\n     * rates for larger N.\n     */\n  public:\n    BloomFilter() {\n        static_assert(KeySize <= keyShift, \"KeySize too big\");\n\n        // Should we have a custom operator new using calloc instead and\n        // require that we're allocated via the operator?\n        clear();\n    }\n\n    /*\n     * Clear the filter.  This should be done before reusing it, because\n     * just removing all items doesn't clear counters that hit the upper\n     * bound.\n     */\n    void clear();\n\n    /*\n     * Add an item to the filter.\n     */\n    void add(const T* t);\n\n    /*\n     * Remove an item from the filter.\n     */\n    void remove(const T* t);\n\n    /*\n     * Check whether the filter might contain an item.  This can\n     * sometimes return true even if the item is not in the filter,\n     * but will never return false for items that are actually in the\n     * filter.\n     */\n    bool mightContain(const T* t) const;\n\n    /*\n     * Methods for add/remove/contain when we already have a hash computed\n     */\n    void add(uint32_t hash);\n    void remove(uint32_t hash);\n    bool mightContain(uint32_t hash) const;\n\n  private:\n    static const size_t arraySize = (1 << KeySize);\n    static const uint32_t keyMask = (1 << KeySize) - 1;\n    static const uint32_t keyShift = 16;\n\n    static uint32_t hash1(uint32_t hash) { return hash & keyMask; }\n    static uint32_t hash2(uint32_t hash) { return (hash >> keyShift) & keyMask; }\n\n    uint8_t& firstSlot(uint32_t hash) { return counters[hash1(hash)]; }\n    uint8_t& secondSlot(uint32_t hash) { return counters[hash2(hash)]; }\n    const uint8_t& firstSlot(uint32_t hash) const { return counters[hash1(hash)]; }\n    const uint8_t& secondSlot(uint32_t hash) const { return counters[hash2(hash)]; }\n\n    static bool full(const uint8_t& slot) { return slot == UINT8_MAX; }\n\n    uint8_t counters[arraySize];\n};\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::clear()\n{\n  memset(counters, 0, arraySize);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::add(uint32_t hash)\n{\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    ++slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    ++slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::add(const T* t)\n{\n  uint32_t hash = t->hash();\n  return add(hash);\n}\n\ntemplate<unsigned KeySize, class T>\ninline void\nBloomFilter<KeySize, T>::remove(uint32_t hash)\n{\n  // If the slots are full, we don't know whether we bumped them to be\n  // there when we added or not, so just leave them full.\n  uint8_t& slot1 = firstSlot(hash);\n  if (MOZ_LIKELY(!full(slot1)))\n    --slot1;\n\n  uint8_t& slot2 = secondSlot(hash);\n  if (MOZ_LIKELY(!full(slot2)))\n    --slot2;\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE void\nBloomFilter<KeySize, T>::remove(const T* t)\n{\n  uint32_t hash = t->hash();\n  remove(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(uint32_t hash) const\n{\n  // Check that all the slots for this hash contain something\n  return firstSlot(hash) && secondSlot(hash);\n}\n\ntemplate<unsigned KeySize, class T>\nMOZ_ALWAYS_INLINE bool\nBloomFilter<KeySize, T>::mightContain(const T* t) const\n{\n  uint32_t hash = t->hash();\n  return mightContain(hash);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_BloomFilter_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Casting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cast operations to supplement the built-in casting operations. */\n\n#ifndef mozilla_Casting_h\n#define mozilla_Casting_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <limits.h>\n\nnamespace mozilla {\n\n/**\n * Return a value of type |To|, containing the underlying bit pattern of |from|.\n *\n * |To| and |From| must be types of the same size; be careful of cross-platform\n * size differences, or this might fail to compile on some but not all\n * platforms.\n */\ntemplate<typename To, typename From>\ninline To\nBitwiseCast(const From from)\n{\n  static_assert(sizeof(From) == sizeof(To),\n                \"To and From must have the same size\");\n  union {\n    From from;\n    To to;\n  } u;\n  u.from = from;\n  return u.to;\n}\n\nnamespace detail {\n\nenum ToSignedness { ToIsSigned, ToIsUnsigned };\nenum FromSignedness { FromIsSigned, FromIsUnsigned };\n\ntemplate<typename From,\n         typename To,\n         FromSignedness = IsSigned<From>::value ? FromIsSigned : FromIsUnsigned,\n         ToSignedness = IsSigned<To>::value ? ToIsSigned : ToIsUnsigned>\nstruct BoundsCheckImpl;\n\n// Implicit conversions on operands to binary operations make this all a bit\n// hard to verify.  Attempt to ease the pain below by *only* comparing values\n// that are obviously the same type (and will undergo no further conversions),\n// even when it's not strictly necessary, for explicitness.\n\nenum UUComparison { FromIsBigger, FromIsNotBigger };\n\n// Unsigned-to-unsigned range check\n\ntemplate<typename From, typename To,\n         UUComparison = (sizeof(From) > sizeof(To)) ? FromIsBigger : FromIsNotBigger>\nstruct UnsignedUnsignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return from <= From(To(-1));\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedUnsignedCheck<From, To, FromIsNotBigger>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedUnsignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-unsigned range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (from < 0)\n        return false;\n      if (sizeof(To) >= sizeof(From))\n        return true;\n      return from <= From(To(-1));\n    }\n};\n\n// Unsigned-to-signed range check\n\nenum USComparison { FromIsSmaller, FromIsNotSmaller };\n\ntemplate<typename From, typename To,\n         USComparison = (sizeof(From) < sizeof(To)) ? FromIsSmaller : FromIsNotSmaller>\nstruct UnsignedSignedCheck;\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return true;\n    }\n};\n\ntemplate<typename From, typename To>\nstruct UnsignedSignedCheck<From, To, FromIsNotSmaller>\n{\n  public:\n    static bool checkBounds(const From from) {\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      return from <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return UnsignedSignedCheck<From, To>::checkBounds(from);\n    }\n};\n\n// Signed-to-signed range check\n\ntemplate<typename From, typename To>\nstruct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>\n{\n  public:\n    static bool checkBounds(const From from) {\n      if (sizeof(From) <= sizeof(To))\n        return true;\n      const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);\n      const To MinValue = -MaxValue - To(1);\n      return From(MinValue) <= from &&\n             From(from) <= From(MaxValue);\n    }\n};\n\ntemplate<typename From, typename To,\n         bool TypesAreIntegral = IsIntegral<From>::value && IsIntegral<To>::value>\nclass BoundsChecker;\n\ntemplate<typename From>\nclass BoundsChecker<From, From, true>\n{\n  public:\n    static bool checkBounds(const From from) { return true; }\n};\n\ntemplate<typename From, typename To>\nclass BoundsChecker<From, To, true>\n{\n  public:\n    static bool checkBounds(const From from) {\n      return BoundsCheckImpl<From, To>::checkBounds(from);\n    }\n};\n\ntemplate<typename From, typename To>\ninline bool\nIsInBounds(const From from)\n{\n  return BoundsChecker<From, To>::checkBounds(from);\n}\n\n} // namespace detail\n\n/**\n * Cast a value of integral type |From| to a value of integral type |To|,\n * asserting that the cast will be a safe cast per C++ (that is, that |to| is in\n * the range of values permitted for the type |From|).\n */\ntemplate<typename To, typename From>\ninline To\nSafeCast(const From from)\n{\n  MOZ_ASSERT((detail::IsInBounds<From, To>(from)));\n  return static_cast<To>(from);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Casting_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Char16.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implements a UTF-16 character type. */\n\n#ifndef mozilla_Char16_h\n#define mozilla_Char16_h\n\n#include \"mozilla/Assertions.h\"\n\n/*\n * C11 and C++11 introduce a char16_t type and support for UTF-16 string and\n * character literals. C++11's char16_t is a distinct builtin type. C11's\n * char16_t is a typedef for uint_least16_t. Technically, char16_t is a 16-bit\n * code unit of a Unicode code point, not a \"character\".\n *\n * For now, Char16.h only supports C++ because we don't want mix different C\n * and C++ definitions of char16_t in the same code base.\n */\n\n#ifdef _MSC_VER\n   /*\n    * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h\n    * typedefs char16_t as an unsigned short. We would like to alias char16_t\n    * to Windows's 16-bit wchar_t so we can declare UTF-16 literals as constant\n    * expressions (and pass char16_t pointers to Windows APIs). We #define our\n    * char16_t as a macro to override yval.h's typedef of the same name.\n    */\n#  define MOZ_UTF16_HELPER(s) L##s\n#  include <yvals.h>\n#  define char16_t wchar_t\n#elif defined(__cplusplus) && \\\n      (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__))\n   /* C++11 has a builtin char16_t type. */\n#  define MOZ_UTF16_HELPER(s) u##s\n#else\n#  error \"Char16.h requires C++11 (or something like it) for UTF-16 support.\"\n#endif\n\n/*\n * Macro arguments used in concatenation or stringification won't be expanded.\n * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to\n * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper\n * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro\n * argument to expand. See \"3.10.6 Separate Expansion of Macro Arguments\" of the\n * CPP manual for a more accurate and precise explanation.\n */\n#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)\n\nstatic_assert(sizeof(char16_t) == 2, \"Is char16_t type 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16('A')) == 2, \"Is char literal 16 bits?\");\nstatic_assert(sizeof(MOZ_UTF16(\"\")[0]) == 2, \"Is string char 16 bits?\");\n\n#endif /* mozilla_Char16_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/CheckedInt.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Provides checked integers, detecting integer overflow and divide-by-0. */\n\n#ifndef mozilla_CheckedInt_h\n#define mozilla_CheckedInt_h\n\n// Enable relying of Mozilla's MFBT for possibly-available C++11 features\n#define MOZ_CHECKEDINT_USE_MFBT\n\n#include <stdint.h>\n\n#ifdef MOZ_CHECKEDINT_USE_MFBT\n#  include \"mozilla/Assertions.h\"\n#else\n#  include <cassert>\n#  define MOZ_ASSERT(cond, reason) assert((cond) && reason)\n#  define MOZ_DELETE\n#endif\n\n#include <climits>\n#include <cstddef>\n\nnamespace mozilla {\n\ntemplate<typename T> class CheckedInt;\n\nnamespace detail {\n\n/*\n * Step 1: manually record supported types\n *\n * What's nontrivial here is that there are different families of integer\n * types: basic integer types and stdint types. It is merrily undefined which\n * types from one family may be just typedefs for a type from another family.\n *\n * For example, on GCC 4.6, aside from the basic integer types, the only other\n * type that isn't just a typedef for some of them, is int8_t.\n */\n\nstruct UnsupportedType {};\n\ntemplate<typename IntegerType>\nstruct IsSupportedPass2\n{\n    static const bool value = false;\n};\n\ntemplate<typename IntegerType>\nstruct IsSupported\n{\n    static const bool value = IsSupportedPass2<IntegerType>::value;\n};\n\ntemplate<>\nstruct IsSupported<int8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint8_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint16_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint32_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<int64_t>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupported<uint64_t>\n{ static const bool value = true; };\n\n\ntemplate<>\nstruct IsSupportedPass2<char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<signed char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned char>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned short>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned int>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<long long>\n{ static const bool value = true; };\n\ntemplate<>\nstruct IsSupportedPass2<unsigned long long>\n{ static const bool value = true; };\n\n/*\n * Step 2: some integer-traits kind of stuff.\n */\n\ntemplate<size_t Size, bool Signedness>\nstruct StdintTypeForSizeAndSignedness\n{};\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, true>\n{ typedef int8_t   Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<1, false>\n{ typedef uint8_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, true>\n{ typedef int16_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<2, false>\n{ typedef uint16_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, true>\n{ typedef int32_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<4, false>\n{ typedef uint32_t Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, true>\n{ typedef int64_t  Type; };\n\ntemplate<>\nstruct StdintTypeForSizeAndSignedness<8, false>\n{ typedef uint64_t Type; };\n\ntemplate<typename IntegerType>\nstruct UnsignedType\n{\n    typedef typename StdintTypeForSizeAndSignedness<sizeof(IntegerType),\n                                                    false>::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct IsSigned\n{\n    static const bool value = IntegerType(-1) <= IntegerType(0);\n};\n\ntemplate<typename IntegerType, size_t Size = sizeof(IntegerType)>\nstruct TwiceBiggerType\n{\n    typedef typename StdintTypeForSizeAndSignedness<\n                       sizeof(IntegerType) * 2,\n                       IsSigned<IntegerType>::value\n                     >::Type Type;\n};\n\ntemplate<typename IntegerType>\nstruct TwiceBiggerType<IntegerType, 8>\n{\n    typedef UnsupportedType Type;\n};\n\ntemplate<typename IntegerType>\nstruct PositionOfSignBit\n{\n    static const size_t value = CHAR_BIT * sizeof(IntegerType) - 1;\n};\n\ntemplate<typename IntegerType>\nstruct MinValue\n{\n  private:\n    typedef typename UnsignedType<IntegerType>::Type UnsignedIntegerType;\n    static const size_t PosOfSignBit = PositionOfSignBit<IntegerType>::value;\n\n  public:\n    // Bitwise ops may return a larger type, that's why we cast explicitly.\n    // In C++, left bit shifts on signed values is undefined by the standard\n    // unless the shifted value is representable.\n    // Notice that signed-to-unsigned conversions are always well-defined in\n    // the standard as the value congruent to 2**n, as expected. By contrast,\n    // unsigned-to-signed is only well-defined if the value is representable.\n    static const IntegerType value =\n        IsSigned<IntegerType>::value\n        ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit)\n        : IntegerType(0);\n};\n\ntemplate<typename IntegerType>\nstruct MaxValue\n{\n    // Tricksy, but covered by the unit test.\n    // Relies heavily on the type of MinValue<IntegerType>::value\n    // being IntegerType.\n    static const IntegerType value = ~MinValue<IntegerType>::value;\n};\n\n/*\n * Step 3: Implement the actual validity checks.\n *\n * Ideas taken from IntegerLib, code different.\n */\n\ntemplate<typename T>\ninline bool\nHasSignBit(T x)\n{\n  // In C++, right bit shifts on negative values is undefined by the standard.\n  // Notice that signed-to-unsigned conversions are always well-defined in the\n  // standard, as the value congruent modulo 2**n as expected. By contrast,\n  // unsigned-to-signed is only well-defined if the value is representable.\n  return bool(typename UnsignedType<T>::Type(x)\n                >> PositionOfSignBit<T>::value);\n}\n\n// Bitwise ops may return a larger type, so it's good to use this inline\n// helper guaranteeing that the result is really of type T.\ntemplate<typename T>\ninline T\nBinaryComplement(T x)\n{\n  return ~x;\n}\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value>\nstruct DoesRangeContainRange\n{\n};\n\ntemplate<typename T, typename U, bool Signedness>\nstruct DoesRangeContainRange<T, U, Signedness, Signedness>\n{\n    static const bool value = sizeof(T) >= sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, true, false>\n{\n    static const bool value = sizeof(T) > sizeof(U);\n};\n\ntemplate<typename T, typename U>\nstruct DoesRangeContainRange<T, U, false, true>\n{\n    static const bool value = false;\n};\n\ntemplate<typename T,\n         typename U,\n         bool IsTSigned = IsSigned<T>::value,\n         bool IsUSigned = IsSigned<U>::value,\n         bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>\nstruct IsInRangeImpl {};\n\ntemplate<typename T, typename U, bool IsTSigned, bool IsUSigned>\nstruct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>\n{\n    static bool run(U)\n    {\n       return true;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, true, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value && x >= MinValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, false, false>\n{\n    static bool run(U x)\n    {\n      return x <= MaxValue<T>::value;\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, true, false, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) > sizeof(U) || x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\nstruct IsInRangeImpl<T, U, false, true, false>\n{\n    static bool run(U x)\n    {\n      return sizeof(T) >= sizeof(U)\n             ? x >= 0\n             : x >= 0 && x <= U(MaxValue<T>::value);\n    }\n};\n\ntemplate<typename T, typename U>\ninline bool\nIsInRange(U x)\n{\n  return IsInRangeImpl<T, U>::run(x);\n}\n\ntemplate<typename T>\ninline bool\nIsAddValid(T x, T y)\n{\n  // Addition is valid if the sign of x+y is equal to either that of x or that\n  // of y. Since the value of x+y is undefined if we have a signed type, we\n  // compute it using the unsigned type of the same size.\n  // Beware! These bitwise operations can return a larger integer type,\n  // if T was a small type like int8_t, so we explicitly cast to T.\n\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux + uy;\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (result ^ y))))\n         : BinaryComplement(x) >= y;\n}\n\ntemplate<typename T>\ninline bool\nIsSubValid(T x, T y)\n{\n  // Subtraction is valid if either x and y have same sign, or x-y and x have\n  // same sign. Since the value of x-y is undefined if we have a signed type,\n  // we compute it using the unsigned type of the same size.\n  typename UnsignedType<T>::Type ux = x;\n  typename UnsignedType<T>::Type uy = y;\n  typename UnsignedType<T>::Type result = ux - uy;\n\n  return IsSigned<T>::value\n         ? HasSignBit(BinaryComplement(T((result ^ x) & (x ^ y))))\n         : x >= y;\n}\n\ntemplate<typename T,\n         bool IsTSigned = IsSigned<T>::value,\n         bool TwiceBiggerTypeIsSupported =\n           IsSupported<typename TwiceBiggerType<T>::Type>::value>\nstruct IsMulValidImpl {};\n\ntemplate<typename T, bool IsTSigned>\nstruct IsMulValidImpl<T, IsTSigned, true>\n{\n    static bool run(T x, T y)\n    {\n      typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;\n      TwiceBiggerType product = TwiceBiggerType(x) * TwiceBiggerType(y);\n      return IsInRange<T>(product);\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, true, false>\n{\n    static bool run(T x, T y)\n    {\n      const T max = MaxValue<T>::value;\n      const T min = MinValue<T>::value;\n\n      if (x == 0 || y == 0)\n        return true;\n\n      if (x > 0) {\n        return y > 0\n               ? x <= max / y\n               : y >= min / x;\n      }\n\n      // If we reach this point, we know that x < 0.\n      return y > 0\n             ? x >= min / y\n             : y >= max / x;\n    }\n};\n\ntemplate<typename T>\nstruct IsMulValidImpl<T, false, false>\n{\n    static bool run(T x, T y)\n    {\n      return y == 0 ||  x <= MaxValue<T>::value / y;\n    }\n};\n\ntemplate<typename T>\ninline bool\nIsMulValid(T x, T y)\n{\n  return IsMulValidImpl<T>::run(x, y);\n}\n\ntemplate<typename T>\ninline bool\nIsDivValid(T x, T y)\n{\n  // Keep in mind that in the signed case, min/-1 is invalid because abs(min)>max.\n  return y != 0 &&\n         !(IsSigned<T>::value && x == MinValue<T>::value && y == T(-1));\n}\n\ntemplate<typename T, bool IsTSigned = IsSigned<T>::value>\nstruct IsModValidImpl;\n\ntemplate<typename T>\ninline bool\nIsModValid(T x, T y)\n{\n  return IsModValidImpl<T>::run(x, y);\n}\n\n/*\n * Mod is pretty simple.\n * For now, let's just use the ANSI C definition:\n * If x or y are negative, the results are implementation defined.\n *   Consider these invalid.\n * Undefined for y=0.\n * The result will never exceed either x or y.\n *\n * Checking that x>=0 is a warning when T is unsigned.\n */\n\ntemplate<typename T>\nstruct IsModValidImpl<T, false> {\n  static inline bool run(T x, T y) {\n    return y >= 1;\n  }\n};\n\ntemplate<typename T>\nstruct IsModValidImpl<T, true> {\n  static inline bool run(T x, T y) {\n    if (x < 0)\n      return false;\n\n    return y >= 1;\n  }\n};\n\ntemplate<typename T, bool IsSigned = IsSigned<T>::value>\nstruct NegateImpl;\n\ntemplate<typename T>\nstruct NegateImpl<T, false>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Handle negation separately for signed/unsigned, for simpler code and to\n      // avoid an MSVC warning negating an unsigned value.\n      return CheckedInt<T>(0, val.isValid() && val.mValue == 0);\n    }\n};\n\ntemplate<typename T>\nstruct NegateImpl<T, true>\n{\n    static CheckedInt<T> negate(const CheckedInt<T>& val)\n    {\n      // Watch out for the min-value, which (with twos-complement) can't be\n      // negated as -min-value is then (max-value + 1).\n      if (!val.isValid() || val.mValue == MinValue<T>::value)\n        return CheckedInt<T>(val.mValue, false);\n      return CheckedInt<T>(-val.mValue, true);\n    }\n};\n\n} // namespace detail\n\n\n/*\n * Step 4: Now define the CheckedInt class.\n */\n\n/**\n * @class CheckedInt\n * @brief Integer wrapper class checking for integer overflow and other errors\n * @param T the integer type to wrap. Can be any type among the following:\n *            - any basic integer type such as |int|\n *            - any stdint type such as |int8_t|\n *\n * This class implements guarded integer arithmetic. Do a computation, check\n * that isValid() returns true, you then have a guarantee that no problem, such\n * as integer overflow, happened during this computation, and you can call\n * value() to get the plain integer value.\n *\n * The arithmetic operators in this class are guaranteed not to raise a signal\n * (e.g. in case of a division by zero).\n *\n * For example, suppose that you want to implement a function that computes\n * (x+y)/z, that doesn't crash if z==0, and that reports on error (divide by\n * zero or integer overflow). You could code it as follows:\n   @code\n   bool computeXPlusYOverZ(int x, int y, int z, int *result)\n   {\n       CheckedInt<int> checkedResult = (CheckedInt<int>(x) + y) / z;\n       if (checkedResult.isValid()) {\n           *result = checkedResult.value();\n           return true;\n       } else {\n           return false;\n       }\n   }\n   @endcode\n *\n * Implicit conversion from plain integers to checked integers is allowed. The\n * plain integer is checked to be in range before being casted to the\n * destination type. This means that the following lines all compile, and the\n * resulting CheckedInts are correctly detected as valid or invalid:\n * @code\n   // 1 is of type int, is found to be in range for uint8_t, x is valid\n   CheckedInt<uint8_t> x(1);\n   // -1 is of type int, is found not to be in range for uint8_t, x is invalid\n   CheckedInt<uint8_t> x(-1);\n   // -1 is of type int, is found to be in range for int8_t, x is valid\n   CheckedInt<int8_t> x(-1);\n   // 1000 is of type int16_t, is found not to be in range for int8_t,\n   // x is invalid\n   CheckedInt<int8_t> x(int16_t(1000));\n   // 3123456789 is of type uint32_t, is found not to be in range for int32_t,\n   // x is invalid\n   CheckedInt<int32_t> x(uint32_t(3123456789));\n * @endcode\n * Implicit conversion from\n * checked integers to plain integers is not allowed. As shown in the\n * above example, to get the value of a checked integer as a normal integer,\n * call value().\n *\n * Arithmetic operations between checked and plain integers is allowed; the\n * result type is the type of the checked integer.\n *\n * Checked integers of different types cannot be used in the same arithmetic\n * expression.\n *\n * There are convenience typedefs for all stdint types, of the following form\n * (these are just 2 examples):\n   @code\n   typedef CheckedInt<int32_t> CheckedInt32;\n   typedef CheckedInt<uint16_t> CheckedUint16;\n   @endcode\n */\ntemplate<typename T>\nclass CheckedInt\n{\n  protected:\n    T mValue;\n    bool mIsValid;\n\n    template<typename U>\n    CheckedInt(U value, bool isValid) : mValue(value), mIsValid(isValid)\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    friend struct detail::NegateImpl<T>;\n\n  public:\n    /**\n     * Constructs a checked integer with given @a value. The checked integer is\n     * initialized as valid or invalid depending on whether the @a value\n     * is in range.\n     *\n     * This constructor is not explicit. Instead, the type of its argument is a\n     * separate template parameter, ensuring that no conversion is performed\n     * before this constructor is actually called. As explained in the above\n     * documentation for class CheckedInt, this constructor checks that its\n     * argument is valid.\n     */\n    template<typename U>\n    CheckedInt(U value)\n      : mValue(T(value)),\n        mIsValid(detail::IsInRange<T>(value))\n    {\n      static_assert(detail::IsSupported<T>::value &&\n                    detail::IsSupported<U>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    template<typename U>\n    friend class CheckedInt;\n\n    template<typename U>\n    CheckedInt<U> toChecked() const\n    {\n      CheckedInt<U> ret(mValue);\n      ret.mIsValid = ret.mIsValid && mIsValid;\n      return ret;\n    }\n\n    /** Constructs a valid checked integer with initial value 0 */\n    CheckedInt() : mValue(0), mIsValid(true)\n    {\n      static_assert(detail::IsSupported<T>::value,\n                    \"This type is not supported by CheckedInt\");\n    }\n\n    /** @returns the actual value */\n    T value() const\n    {\n      MOZ_ASSERT(mIsValid, \"Invalid checked integer (division by zero or integer overflow)\");\n      return mValue;\n    }\n\n    /**\n     * @returns true if the checked integer is valid, i.e. is not the result\n     * of an invalid operation or of an operation involving an invalid checked\n     * integer\n     */\n    bool isValid() const\n    {\n      return mIsValid;\n    }\n\n    template<typename U>\n    friend CheckedInt<U> operator +(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator +=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator -(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator -=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator *(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator *=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator /(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator /=(U rhs);\n\n    template<typename U>\n    friend CheckedInt<U> operator %(const CheckedInt<U>& lhs,\n                                    const CheckedInt<U>& rhs);\n    template<typename U>\n    CheckedInt& operator %=(U rhs);\n\n    CheckedInt operator -() const\n    {\n      return detail::NegateImpl<T>::negate(*this);\n    }\n\n    /**\n     * @returns true if the left and right hand sides are valid\n     * and have the same value.\n     *\n     * Note that these semantics are the reason why we don't offer\n     * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)\n     * but that would mean that whenever a or b is invalid, a!=b\n     * is always true, which would be very confusing.\n     *\n     * For similar reasons, operators <, >, <=, >= would be very tricky to\n     * specify, so we just avoid offering them.\n     *\n     * Notice that these == semantics are made more reasonable by these facts:\n     *  1. a==b implies equality at the raw data level\n     *     (the converse is false, as a==b is never true among invalids)\n     *  2. This is similar to the behavior of IEEE floats, where a==b\n     *     means that a and b have the same value *and* neither is NaN.\n     */\n    bool operator ==(const CheckedInt& other) const\n    {\n      return mIsValid && other.mIsValid && mValue == other.mValue;\n    }\n\n    /** prefix ++ */\n    CheckedInt& operator++()\n    {\n      *this += 1;\n      return *this;\n    }\n\n    /** postfix ++ */\n    CheckedInt operator++(int)\n    {\n      CheckedInt tmp = *this;\n      *this += 1;\n      return tmp;\n    }\n\n    /** prefix -- */\n    CheckedInt& operator--()\n    {\n      *this -= 1;\n      return *this;\n    }\n\n    /** postfix -- */\n    CheckedInt operator--(int)\n    {\n      CheckedInt tmp = *this;\n      *this -= 1;\n      return tmp;\n    }\n\n  private:\n    /**\n     * The !=, <, <=, >, >= operators are disabled:\n     * see the comment on operator==.\n     */\n    template<typename U>\n    bool operator !=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator <=(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >(U other) const MOZ_DELETE;\n    template<typename U>\n    bool operator >=(U other) const MOZ_DELETE;\n};\n\n#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                \\\ntemplate<typename T>                                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs,            \\\n                                 const CheckedInt<T> &rhs)            \\\n{                                                                     \\\n  if (!detail::Is##NAME##Valid(lhs.mValue, rhs.mValue))               \\\n    return CheckedInt<T>(0, false);                                   \\\n                                                                      \\\n  return CheckedInt<T>(lhs.mValue OP rhs.mValue,                      \\\n                       lhs.mIsValid && rhs.mIsValid);                 \\\n}\n\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)\nMOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)\n\n#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR\n\n// Implement castToCheckedInt<T>(x), making sure that\n//  - it allows x to be either a CheckedInt<T> or any integer type\n//    that can be casted to T\n//  - if x is already a CheckedInt<T>, we just return a reference to it,\n//    instead of copying it (optimization)\n\nnamespace detail {\n\ntemplate<typename T, typename U>\nstruct CastToCheckedIntImpl\n{\n    typedef CheckedInt<T> ReturnType;\n    static CheckedInt<T> run(U u) { return u; }\n};\n\ntemplate<typename T>\nstruct CastToCheckedIntImpl<T, CheckedInt<T> >\n{\n    typedef const CheckedInt<T>& ReturnType;\n    static const CheckedInt<T>& run(const CheckedInt<T>& u) { return u; }\n};\n\n} // namespace detail\n\ntemplate<typename T, typename U>\ninline typename detail::CastToCheckedIntImpl<T, U>::ReturnType\ncastToCheckedInt(U u)\n{\n  static_assert(detail::IsSupported<T>::value &&\n                detail::IsSupported<U>::value,\n                \"This type is not supported by CheckedInt\");\n  return detail::CastToCheckedIntImpl<T, U>::run(u);\n}\n\n#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)  \\\ntemplate<typename T>                                              \\\ntemplate<typename U>                                              \\\nCheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U rhs)         \\\n{                                                                 \\\n  *this = *this OP castToCheckedInt<T>(rhs);                      \\\n  return *this;                                                   \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(const CheckedInt<T> &lhs, U rhs) \\\n{                                                                 \\\n  return lhs OP castToCheckedInt<T>(rhs);                         \\\n}                                                                 \\\ntemplate<typename T, typename U>                                  \\\ninline CheckedInt<T> operator OP(U lhs, const CheckedInt<T> &rhs) \\\n{                                                                 \\\n  return castToCheckedInt<T>(lhs) OP rhs;                         \\\n}\n\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)\nMOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)\n\n#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(const CheckedInt<T> &lhs, U rhs)\n{\n  return lhs == castToCheckedInt<T>(rhs);\n}\n\ntemplate<typename T, typename U>\ninline bool\noperator ==(U  lhs, const CheckedInt<T> &rhs)\n{\n  return castToCheckedInt<T>(lhs) == rhs;\n}\n\n// Convenience typedefs.\ntypedef CheckedInt<int8_t>   CheckedInt8;\ntypedef CheckedInt<uint8_t>  CheckedUint8;\ntypedef CheckedInt<int16_t>  CheckedInt16;\ntypedef CheckedInt<uint16_t> CheckedUint16;\ntypedef CheckedInt<int32_t>  CheckedInt32;\ntypedef CheckedInt<uint32_t> CheckedUint32;\ntypedef CheckedInt<int64_t>  CheckedInt64;\ntypedef CheckedInt<uint64_t> CheckedUint64;\n\n} // namespace mozilla\n\n#endif /* mozilla_CheckedInt_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Compiler.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various compiler checks. */\n\n#ifndef mozilla_Compiler_h\n#define mozilla_Compiler_h\n\n#if !defined(__clang__) && defined(__GNUC__)\n\n#define MOZ_IS_GCC 1\n   /*\n    * This macro should simplify gcc version checking. For example, to check\n    * for gcc 4.5.1 or later, check `#ifdef MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)`.\n    */\n#  define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel)          \\\n     ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \\\n      >= ((major) * 10000 + (minor) * 100 + (patchlevel)))\n#if !MOZ_GCC_VERSION_AT_LEAST(4, 4, 0)\n#  error \"mfbt (and Gecko) require at least gcc 4.4 to build.\"\n#endif\n\n#else\n\n#define MOZ_IS_GCC 0\n\n#endif\n\n#endif /* mozilla_Compiler_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Constants.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt math constants. */\n\n#ifndef mozilla_Constants_h\n#define mozilla_Constants_h\n\n#ifndef M_PI\n#  define M_PI 3.14159265358979323846\n#endif\n\n#endif /* mozilla_Constants_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/DebugOnly.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides DebugOnly, a type for variables used only in debug builds (i.e. by\n * assertions).\n */\n\n#ifndef mozilla_DebugOnly_h\n#define mozilla_DebugOnly_h\n\nnamespace mozilla {\n\n/**\n * DebugOnly contains a value of type T, but only in debug builds.  In release\n * builds, it does not contain a value.  This helper is intended to be used with\n * MOZ_ASSERT()-style macros, allowing one to write:\n *\n *   DebugOnly<bool> check = func();\n *   MOZ_ASSERT(check);\n *\n * more concisely than declaring |check| conditional on #ifdef DEBUG, but also\n * without allocating storage space for |check| in release builds.\n *\n * DebugOnly instances can only be coerced to T in debug builds.  In release\n * builds they don't have a value, so type coercion is not well defined.\n */\ntemplate<typename T>\nclass DebugOnly\n{\n  public:\n#ifdef DEBUG\n    T value;\n\n    DebugOnly() { }\n    DebugOnly(const T& other) : value(other) { }\n    DebugOnly(const DebugOnly& other) : value(other.value) { }\n    DebugOnly& operator=(const T& rhs) {\n      value = rhs;\n      return *this;\n    }\n    void operator++(int) {\n      value++;\n    }\n    void operator--(int) {\n      value--;\n    }\n\n    T* operator&() { return &value; }\n\n    operator T&() { return value; }\n    operator const T&() const { return value; }\n\n    T& operator->() { return value; }\n\n#else\n    DebugOnly() { }\n    DebugOnly(const T&) { }\n    DebugOnly(const DebugOnly&) { }\n    DebugOnly& operator=(const T&) { return *this; }\n    void operator++(int) { }\n    void operator--(int) { }\n#endif\n\n    /*\n     * DebugOnly must always have a destructor or else it will\n     * generate \"unused variable\" warnings, exactly what it's intended\n     * to avoid!\n     */\n    ~DebugOnly() {}\n};\n\n}\n\n#endif /* mozilla_DebugOnly_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Decimal.h",
    "content": "/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n *     * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *     * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *     * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/**\n * Imported from:\n * http://src.chromium.org/viewvc/blink/trunk/Source/core/platform/Decimal.h\n * Check hg log for the svn rev of the last update from Blink core.\n */\n\n#ifndef Decimal_h\n#define Decimal_h\n\n#include \"mozilla/Assertions.h\"\n#include <stdint.h>\n#include \"mozilla/Types.h\"\n\n#include <string>\n\n#ifndef ASSERT\n#define DEFINED_ASSERT_FOR_DECIMAL_H 1\n#define ASSERT MOZ_ASSERT\n#endif\n\n// To use WTF_MAKE_FAST_ALLOCATED we'd need:\n// http://src.chromium.org/viewvc/blink/trunk/Source/wtf/FastMalloc.h\n// Since we don't allocate Decimal objects, no need.\n#define WTF_MAKE_FAST_ALLOCATED \\\n  void ignore_this_dummy_method() MOZ_DELETE\n\nnamespace WebCore {\n\nnamespace DecimalPrivate {\nclass SpecialValueHandler;\n}\n\n// This class represents decimal base floating point number.\n//\n// FIXME: Once all C++ compiler support decimal type, we should replace this\n// class to compiler supported one. See below URI for current status of decimal\n// type for C++: // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1977.html\nclass Decimal {\n    WTF_MAKE_FAST_ALLOCATED;\npublic:\n    enum Sign {\n        Positive,\n        Negative,\n    };\n\n    // You should not use EncodedData other than unit testing.\n    class EncodedData {\n        // For accessing FormatClass.\n        friend class Decimal;\n        friend class DecimalPrivate::SpecialValueHandler;\n    public:\n        EncodedData(Sign, int exponent, uint64_t coefficient);\n\n        bool operator==(const EncodedData&) const;\n        bool operator!=(const EncodedData& another) const { return !operator==(another); }\n\n        uint64_t coefficient() const { return m_coefficient; }\n        int countDigits() const;\n        int exponent() const { return m_exponent; }\n        bool isFinite() const { return !isSpecial(); }\n        bool isInfinity() const { return m_formatClass == ClassInfinity; }\n        bool isNaN() const { return m_formatClass == ClassNaN; }\n        bool isSpecial() const { return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; }\n        bool isZero() const { return m_formatClass == ClassZero; }\n        Sign sign() const { return m_sign; }\n        void setSign(Sign sign) { m_sign = sign; }\n\n    private:\n        enum FormatClass {\n            ClassInfinity,\n            ClassNormal,\n            ClassNaN,\n            ClassZero,\n        };\n\n        EncodedData(Sign, FormatClass);\n        FormatClass formatClass() const { return m_formatClass; }\n\n        uint64_t m_coefficient;\n        int16_t m_exponent;\n        FormatClass m_formatClass;\n        Sign m_sign;\n    };\n\n    MFBT_API Decimal(int32_t = 0);\n    MFBT_API Decimal(Sign, int exponent, uint64_t coefficient);\n    MFBT_API Decimal(const Decimal&);\n\n    MFBT_API Decimal& operator=(const Decimal&);\n    MFBT_API Decimal& operator+=(const Decimal&);\n    MFBT_API Decimal& operator-=(const Decimal&);\n    MFBT_API Decimal& operator*=(const Decimal&);\n    MFBT_API Decimal& operator/=(const Decimal&);\n\n    MFBT_API Decimal operator-() const;\n\n    MFBT_API bool operator==(const Decimal&) const;\n    MFBT_API bool operator!=(const Decimal&) const;\n    MFBT_API bool operator<(const Decimal&) const;\n    MFBT_API bool operator<=(const Decimal&) const;\n    MFBT_API bool operator>(const Decimal&) const;\n    MFBT_API bool operator>=(const Decimal&) const;\n\n    MFBT_API Decimal operator+(const Decimal&) const;\n    MFBT_API Decimal operator-(const Decimal&) const;\n    MFBT_API Decimal operator*(const Decimal&) const;\n    MFBT_API Decimal operator/(const Decimal&) const;\n\n    int exponent() const\n    {\n        ASSERT(isFinite());\n        return m_data.exponent();\n    }\n\n    bool isFinite() const { return m_data.isFinite(); }\n    bool isInfinity() const { return m_data.isInfinity(); }\n    bool isNaN() const { return m_data.isNaN(); }\n    bool isNegative() const { return sign() == Negative; }\n    bool isPositive() const { return sign() == Positive; }\n    bool isSpecial() const { return m_data.isSpecial(); }\n    bool isZero() const { return m_data.isZero(); }\n\n    MFBT_API Decimal abs() const;\n    MFBT_API Decimal ceiling() const;\n    MFBT_API Decimal floor() const;\n    MFBT_API Decimal remainder(const Decimal&) const;\n    MFBT_API Decimal round() const;\n\n    MFBT_API double toDouble() const;\n    // Note: toString method supports infinity and nan but fromString not.\n    MFBT_API std::string toString() const;\n    MFBT_API bool toString(char* strBuf, size_t bufLength) const;\n\n    static MFBT_API Decimal fromDouble(double);\n    // fromString supports following syntax EBNF:\n    //  number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?\n    //          | sign? '.' digit+ (exponent-marker sign? digit+)?\n    //  sign ::= '+' | '-'\n    //  exponent-marker ::= 'e' | 'E'\n    //  digit ::= '0' | '1' | ... | '9'\n    // Note: fromString doesn't support \"infinity\" and \"nan\".\n    static MFBT_API Decimal fromString(const std::string& aValue);\n    static MFBT_API Decimal infinity(Sign);\n    static MFBT_API Decimal nan();\n    static MFBT_API Decimal zero(Sign);\n\n    // You should not use below methods. We expose them for unit testing.\n    MFBT_API explicit Decimal(const EncodedData&);\n    const EncodedData& value() const { return m_data; }\n\nprivate:\n    struct AlignedOperands {\n        uint64_t lhsCoefficient;\n        uint64_t rhsCoefficient;\n        int exponent;\n    };\n\n    MFBT_API Decimal(double);\n    MFBT_API Decimal compareTo(const Decimal&) const;\n\n    static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);\n    static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; }\n\n    Sign sign() const { return m_data.sign(); }\n\n    EncodedData m_data;\n};\n\n} // namespace WebCore\n\nnamespace mozilla {\n  typedef WebCore::Decimal Decimal;\n}\n\n#undef WTF_MAKE_FAST_ALLOCATED\n\n#ifdef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef DEFINED_ASSERT_FOR_DECIMAL_H\n#undef ASSERT\n#endif\n\n#endif // Decimal_h\n\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Endian.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Functions for reading and writing integers in various endiannesses. */\n\n/*\n * The classes LittleEndian and BigEndian expose static methods for\n * reading and writing 16-, 32-, and 64-bit signed and unsigned integers\n * in their respective endianness.  The naming scheme is:\n *\n * {Little,Big}Endian::{read,write}{Uint,Int}<bitsize>\n *\n * For instance, LittleEndian::readInt32 will read a 32-bit signed\n * integer from memory in little endian format.  Similarly,\n * BigEndian::writeUint16 will write a 16-bit unsigned integer to memory\n * in big-endian format.\n *\n * The class NativeEndian exposes methods for conversion of existing\n * data to and from the native endianness.  These methods are intended\n * for cases where data needs to be transferred, serialized, etc.\n * swap{To,From}{Little,Big}Endian byteswap a single value if necessary.\n * Bulk conversion functions are also provided which optimize the\n * no-conversion-needed case:\n *\n * - copyAndSwap{To,From}{Little,Big}Endian;\n * - swap{To,From}{Little,Big}EndianInPlace.\n *\n * The *From* variants are intended to be used for reading data and the\n * *To* variants for writing data.\n *\n * Methods on NativeEndian work with integer data of any type.\n * Floating-point data is not supported.\n *\n * For clarity in networking code, \"Network\" may be used as a synonym\n * for \"Big\" in any of the above methods or class names.\n *\n * As an example, reading a file format header whose fields are stored\n * in big-endian format might look like:\n *\n * class ExampleHeader\n * {\n *   private:\n *     uint32_t magic;\n *     uint32_t length;\n *     uint32_t totalRecords;\n *     uint64_t checksum;\n *\n *   public:\n *     ExampleHeader(const void* data) {\n *       const uint8_t* ptr = static_cast<const uint8_t*>(data);\n *       magic = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       length = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       totalRecords = BigEndian::readUint32(ptr); ptr += sizeof(uint32_t);\n *       checksum = BigEndian::readUint64(ptr);\n *     }\n *     ...\n * };\n */\n\n#ifndef mozilla_Endian_h\n#define mozilla_Endian_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Compiler.h\"\n#include \"mozilla/DebugOnly.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <stdint.h>\n#include <string.h>\n\n#if defined(_MSC_VER) && _MSC_VER >= 1300\n#  include <stdlib.h>\n#  pragma intrinsic(_byteswap_ushort)\n#  pragma intrinsic(_byteswap_ulong)\n#  pragma intrinsic(_byteswap_uint64)\n#endif\n\n#if defined(_WIN64)\n#  if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(_WIN32)\n#  if defined(_M_IX86)\n#    define MOZ_LITTLE_ENDIAN 1\n#  else\n#    error \"CPU type is unknown\"\n#  endif\n#elif defined(__APPLE__)\n#  if __LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  endif\n#elif defined(__GNUC__) && \\\n      defined(__BYTE_ORDER__) && \\\n      defined(__ORDER_LITTLE_ENDIAN__) && \\\n      defined(__ORDER_BIG_ENDIAN__)\n   /*\n    * Some versions of GCC provide architecture-independent macros for\n    * this.  Yes, there are more than two values for __BYTE_ORDER__.\n    */\n#  if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n#    define MOZ_LITTLE_ENDIAN 1\n#  elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#    define MOZ_BIG_ENDIAN 1\n#  else\n#    error \"Can't handle mixed-endian architectures\"\n#  endif\n/*\n * We can't include useful headers like <endian.h> or <sys/isa_defs.h>\n * here because they're not present on all platforms.  Instead we have\n * this big conditional that ideally will catch all the interesting\n * cases.\n */\n#elif defined(__sparc) || defined(__sparc__) || \\\n      defined(_POWER) || defined(__powerpc__) || \\\n      defined(__ppc__) || defined(__hppa) || \\\n      defined(_MIPSEB) || defined(__ARMEB__) || \\\n      defined(__s390__) || \\\n      (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \\\n      (defined(__ia64) && defined(__BIG_ENDIAN__))\n#  define MOZ_BIG_ENDIAN 1\n#elif defined(__i386) || defined(__i386__) || \\\n      defined(__x86_64) || defined(__x86_64__) || \\\n      defined(_MIPSEL) || defined(__ARMEL__) || \\\n      defined(__alpha__) || \\\n      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \\\n      (defined(__ia64) && !defined(__BIG_ENDIAN__))\n#  define MOZ_LITTLE_ENDIAN 1\n#endif\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_LITTLE_ENDIAN 0\n#elif MOZ_LITTLE_ENDIAN\n#  define MOZ_BIG_ENDIAN 0\n#else\n#  error \"Cannot determine endianness\"\n#endif\n\n#if defined(__clang__)\n#  if __has_builtin(__builtin_bswap16)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(__GNUC__)\n#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16\n#  endif\n#elif defined(_MSC_VER)\n#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n/*\n * We need wrappers here because free functions with default template\n * arguments and/or partial specialization of function templates are not\n * supported by all the compilers we use.\n */\ntemplate<typename T, size_t Size = sizeof(T)>\nstruct Swapper;\n\ntemplate<typename T>\nstruct Swapper<T, 2>\n{\n  static T swap(T value)\n  {\n#if defined(MOZ_HAVE_BUILTIN_BYTESWAP16)\n    return MOZ_HAVE_BUILTIN_BYTESWAP16(value);\n#else\n    return T(((value & 0x00ff) << 8) | ((value & 0xff00) >> 8));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 4>\n{\n  static T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap32(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_ulong(value));\n#else\n    return T(((value & 0x000000ffU) << 24) |\n             ((value & 0x0000ff00U) << 8) |\n             ((value & 0x00ff0000U) >> 8) |\n             ((value & 0xff000000U) >> 24));\n#endif\n  }\n};\n\ntemplate<typename T>\nstruct Swapper<T, 8>\n{\n  static inline T swap(T value)\n  {\n#if defined(__clang__) || defined(__GNUC__)\n    return T(__builtin_bswap64(value));\n#elif defined(_MSC_VER)\n    return T(_byteswap_uint64(value));\n#else\n    return T(((value & 0x00000000000000ffULL) << 56) |\n             ((value & 0x000000000000ff00ULL) << 40) |\n             ((value & 0x0000000000ff0000ULL) << 24) |\n             ((value & 0x00000000ff000000ULL) << 8) |\n             ((value & 0x000000ff00000000ULL) >> 8) |\n             ((value & 0x0000ff0000000000ULL) >> 24) |\n             ((value & 0x00ff000000000000ULL) >> 40) |\n             ((value & 0xff00000000000000ULL) >> 56));\n#endif\n  }\n};\n\nenum Endianness { Little, Big };\n\n#if MOZ_BIG_ENDIAN\n#  define MOZ_NATIVE_ENDIANNESS detail::Big\n#else\n#  define MOZ_NATIVE_ENDIANNESS detail::Little\n#endif\n\nclass EndianUtils\n{\n    /**\n     * Assert that the memory regions [dest, dest+count) and [src, src+count]\n     * do not overlap.  count is given in bytes.\n     */\n    static void assertNoOverlap(const void* dest, const void* src, size_t count)\n    {\n      DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(dest);\n      DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(src);\n      MOZ_ASSERT((byteDestPtr < byteSrcPtr &&\n                  byteDestPtr + count <= byteSrcPtr) ||\n                 (byteSrcPtr < byteDestPtr &&\n                  byteSrcPtr + count <= byteDestPtr));\n    }\n\n    template<typename T>\n    static void assertAligned(T* ptr)\n    {\n      MOZ_ASSERT((uintptr_t(ptr) % sizeof(T)) == 0, \"Unaligned pointer!\");\n    }\n\n  protected:\n    /**\n     * Return |value| converted from SourceEndian encoding to DestEndian\n     * encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline T maybeSwap(T value)\n    {\n      if (SourceEndian == DestEndian)\n        return value;\n\n      return Swapper<T>::swap(value);\n    }\n\n    /**\n     * Convert |count| elements at |ptr| from SourceEndian encoding to\n     * DestEndian encoding.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static inline void maybeSwapInPlace(T* ptr, size_t count)\n    {\n      assertAligned(ptr);\n\n      if (SourceEndian == DestEndian)\n        return;\n\n      for (size_t i = 0; i < count; i++)\n        ptr[i] = Swapper<T>::swap(ptr[i]);\n    }\n\n    /**\n     * Write |count| elements to the unaligned address |dest| in DestEndian\n     * format, using elements found at |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapTo(void* dest, const T* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(src);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      uint8_t* byteDestPtr = static_cast<uint8_t*>(dest);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        u.val = maybeSwap<SourceEndian, DestEndian>(src[i]);\n        memcpy(byteDestPtr, u.buffer, sizeof(T));\n        byteDestPtr += sizeof(T);\n      }\n    }\n\n    /**\n     * Write |count| elements to |dest| in DestEndian format, using elements\n     * found at the unaligned address |src| in SourceEndian format.\n     */\n    template<Endianness SourceEndian, Endianness DestEndian, typename T>\n    static void copyAndSwapFrom(T* dest, const void* src, size_t count)\n    {\n      assertNoOverlap(dest, src, count * sizeof(T));\n      assertAligned(dest);\n\n      if (SourceEndian == DestEndian) {\n        memcpy(dest, src, count * sizeof(T));\n        return;\n      }\n\n      const uint8_t* byteSrcPtr = static_cast<const uint8_t*>(src);\n      for (size_t i = 0; i < count; ++i) {\n        union {\n          T val;\n          uint8_t buffer[sizeof(T)];\n        } u;\n        memcpy(u.buffer, byteSrcPtr, sizeof(T));\n        dest[i] = maybeSwap<SourceEndian, DestEndian>(u.val);\n        byteSrcPtr += sizeof(T);\n      }\n    }\n};\n\ntemplate<Endianness ThisEndian>\nclass Endian : private EndianUtils\n{\n  protected:\n    /** Read a uint16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* p) {\n      return read<uint16_t>(p);\n    }\n\n    /** Read a uint32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read a uint64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* p) {\n      return read<uint64_t>(p);\n    }\n\n    /** Read an int16_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* p) {\n      return read<int16_t>(p);\n    }\n\n    /** Read an int32_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* p) {\n      return read<uint32_t>(p);\n    }\n\n    /** Read an int64_t in ThisEndian endianness from |p| and return it. */\n    static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* p) {\n      return read<int64_t>(p);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint16(void* p, uint16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint32(void* p, uint32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeUint64(void* p, uint64_t val) {\n      write(p, val);\n    }\n\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt16(void* p, int16_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt32(void* p, int32_t val) {\n      write(p, val);\n    }\n    /** Write |val| to |p| using ThisEndian endianness. */\n    static void writeInt64(void* p, int64_t val) {\n      write(p, val);\n    }\n\n    /*\n     * Converts a value of type T to little-endian format.\n     *\n     * This function is intended for cases where you have data in your\n     * native-endian format and you need it to appear in little-endian\n     * format for transmission.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T value) {\n      return maybeSwap<ThisEndian, Little>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToLittleEndian(void* dest, const T* src,\n                                          size_t count) {\n      copyAndSwapTo<ThisEndian, Little>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Little>(p, count);\n    }\n\n    /*\n     * Converts a value of type T to big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T value) {\n      return maybeSwap<ThisEndian, Big>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapToBigEndian(void* dest, const T* src, size_t count) {\n      copyAndSwapTo<ThisEndian, Big>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapToBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<ThisEndian, Big>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T value) {\n      return swapToBigEndian(value);\n    }\n    template<typename T>\n    static void\n    copyAndSwapToNetworkOrder(void* dest, const T* src, size_t count) {\n      copyAndSwapToBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void\n    swapToNetworkOrderInPlace(T* p, size_t count) {\n      swapToBigEndianInPlace(p, count);\n    }\n\n    /*\n     * Converts a value of type T from little-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T value) {\n      return maybeSwap<Little, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to little-endian format if ThisEndian is Big.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromLittleEndian(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFrom<Little, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromLittleEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Little, ThisEndian>(p, count);\n    }\n\n    /*\n     * Converts a value of type T from big-endian format.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T value) {\n      return maybeSwap<Big, ThisEndian>(value);\n    }\n    /*\n     * Copies count values of type T starting at src to dest, converting\n     * them to big-endian format if ThisEndian is Little.\n     * As with memcpy, dest and src must not overlap.\n     */\n    template<typename T>\n    static void copyAndSwapFromBigEndian(T* dest, const void* src,\n                                         size_t count) {\n      copyAndSwapFrom<Big, ThisEndian>(dest, src, count);\n    }\n    /*\n     * Likewise, but converts values in place.\n     */\n    template<typename T>\n    static void swapFromBigEndianInPlace(T* p, size_t count) {\n      maybeSwapInPlace<Big, ThisEndian>(p, count);\n    }\n\n    /*\n     * Synonyms for the big-endian functions, for better readability\n     * in network code.\n     */\n    template<typename T>\n    MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T value) {\n      return swapFromBigEndian(value);\n    }\n    template<typename T>\n    static void copyAndSwapFromNetworkOrder(T* dest, const void* src,\n                                            size_t count) {\n      copyAndSwapFromBigEndian(dest, src, count);\n    }\n    template<typename T>\n    static void swapFromNetworkOrderInPlace(T* p, size_t count) {\n      swapFromBigEndianInPlace(p, count);\n    }\n\n  private:\n    /**\n     * Read a value of type T, encoded in endianness ThisEndian from |p|.\n     * Return that value encoded in native endianness.\n     */\n    template<typename T>\n    static T read(const void* p) {\n      union {\n        T val;\n        uint8_t buffer[sizeof(T)];\n      } u;\n      memcpy(u.buffer, p, sizeof(T));\n      return maybeSwap<ThisEndian, MOZ_NATIVE_ENDIANNESS>(u.val);\n    }\n\n    /**\n     * Write a value of type T, in native endianness, to |p|, in ThisEndian\n     * endianness.\n     */\n    template<typename T>\n    static void write(void* p, T value) {\n      T tmp = maybeSwap<MOZ_NATIVE_ENDIANNESS, ThisEndian>(value);\n      memcpy(p, &tmp, sizeof(T));\n    }\n\n    Endian() MOZ_DELETE;\n    Endian(const Endian& other) MOZ_DELETE;\n    void operator=(const Endian& other) MOZ_DELETE;\n};\n\ntemplate<Endianness ThisEndian>\nclass EndianReadWrite : public Endian<ThisEndian>\n{\n  private:\n    typedef Endian<ThisEndian> super;\n\n  public:\n    using super::readUint16;\n    using super::readUint32;\n    using super::readUint64;\n    using super::readInt16;\n    using super::readInt32;\n    using super::readInt64;\n    using super::writeUint16;\n    using super::writeUint32;\n    using super::writeUint64;\n    using super::writeInt16;\n    using super::writeInt32;\n    using super::writeInt64;\n};\n\n} /* namespace detail */\n\nclass LittleEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Little>\n{};\n\nclass BigEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Big>\n{};\n\ntypedef BigEndian NetworkEndian;\n\nclass NativeEndian MOZ_FINAL : public detail::Endian<MOZ_NATIVE_ENDIANNESS>\n{\n  private:\n    typedef detail::Endian<MOZ_NATIVE_ENDIANNESS> super;\n\n  public:\n    /*\n     * These functions are intended for cases where you have data in your\n     * native-endian format and you need the data to appear in the appropriate\n     * endianness for transmission, serialization, etc.\n     */\n    using super::swapToLittleEndian;\n    using super::copyAndSwapToLittleEndian;\n    using super::swapToLittleEndianInPlace;\n    using super::swapToBigEndian;\n    using super::copyAndSwapToBigEndian;\n    using super::swapToBigEndianInPlace;\n    using super::swapToNetworkOrder;\n    using super::copyAndSwapToNetworkOrder;\n    using super::swapToNetworkOrderInPlace;\n\n    /*\n     * These functions are intended for cases where you have data in the\n     * given endianness (e.g. reading from disk or a file-format) and you\n     * need the data to appear in native-endian format for processing.\n     */\n    using super::swapFromLittleEndian;\n    using super::copyAndSwapFromLittleEndian;\n    using super::swapFromLittleEndianInPlace;\n    using super::swapFromBigEndian;\n    using super::copyAndSwapFromBigEndian;\n    using super::swapFromBigEndianInPlace;\n    using super::swapFromNetworkOrder;\n    using super::copyAndSwapFromNetworkOrder;\n    using super::swapFromNetworkOrderInPlace;\n};\n\n#undef MOZ_NATIVE_ENDIANNESS\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Endian_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/EnumSet.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A set abstraction for enumeration values. */\n\n#ifndef mozilla_EnumSet_h\n#define mozilla_EnumSet_h\n\n#include \"mozilla/Assertions.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * EnumSet<T> is a set of values defined by an enumeration. It is implemented\n * using a 32 bit mask for each value so it will only work for enums with an int\n * representation less than 32. It works both for enum and enum class types.\n */\ntemplate<typename T>\nclass EnumSet\n{\n  public:\n    EnumSet()\n      : mBitField(0)\n    { }\n\n    EnumSet(T aEnum)\n      : mBitField(aEnum)\n    { }\n\n    EnumSet(T aEnum1, T aEnum2)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3)\n      : mBitField(bitFor(aEnum1) |\n                  bitFor(aEnum2) |\n                  bitFor(aEnum3))\n    { }\n\n    EnumSet(T aEnum1, T aEnum2, T aEnum3, T aEnum4)\n     : mBitField(bitFor(aEnum1) |\n                 bitFor(aEnum2) |\n                 bitFor(aEnum3) |\n                 bitFor(aEnum4))\n    { }\n\n    EnumSet(const EnumSet& aEnumSet)\n     : mBitField(aEnumSet.mBitField)\n    { }\n\n    /**\n     * Add an element\n     */\n    void operator+=(T aEnum) {\n      mBitField |= bitFor(aEnum);\n    }\n\n    /**\n     * Add an element\n     */\n    EnumSet<T> operator+(T aEnum) const {\n      EnumSet<T> result(*this);\n      result += aEnum;\n      return result;\n    }\n\n    /**\n     * Union\n     */\n    void operator+=(const EnumSet<T> aEnumSet) {\n      mBitField |= aEnumSet.mBitField;\n    }\n\n    /**\n     * Union\n     */\n    EnumSet<T> operator+(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result += aEnumSet;\n      return result;\n    }\n\n    /**\n     * Remove an element\n     */\n    void operator-=(T aEnum) {\n      mBitField &= ~(bitFor(aEnum));\n    }\n\n    /**\n     * Remove an element\n     */\n    EnumSet<T> operator-(T aEnum) const {\n      EnumSet<T> result(*this);\n      result -= aEnum;\n      return result;\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    void operator-=(const EnumSet<T> aEnumSet) {\n      mBitField &= ~(aEnumSet.mBitField);\n    }\n\n    /**\n     * Remove a set of elements\n     */\n    EnumSet<T> operator-(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result -= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Intersection\n     */\n    void operator&=(const EnumSet<T> aEnumSet) {\n      mBitField &= aEnumSet.mBitField;\n    }\n\n    /**\n     * Intersection\n     */\n    EnumSet<T> operator&(const EnumSet<T> aEnumSet) const {\n      EnumSet<T> result(*this);\n      result &= aEnumSet;\n      return result;\n    }\n\n    /**\n     * Equality\n     */\n\n    bool operator==(const EnumSet<T> aEnumSet) const {\n      return mBitField == aEnumSet.mBitField;\n    }\n\n    /**\n     * Test is an element is contained in the set\n     */\n    bool contains(T aEnum) const {\n      return mBitField & bitFor(aEnum);\n    }\n\n    /**\n     * Return the number of elements in the set\n     */\n\n    uint8_t size() {\n      uint8_t count = 0;\n      for (uint32_t bitField = mBitField; bitField; bitField >>= 1) {\n        if (bitField & 1)\n          count++;\n      }\n      return count;\n    }\n\n  private:\n    static uint32_t bitFor(T aEnum) {\n      uint32_t bitNumber(aEnum);\n      MOZ_ASSERT(bitNumber < 32);\n      return 1U << bitNumber;\n    }\n\n    uint32_t mBitField;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_EnumSet_h_*/\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/FloatingPoint.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Various predicates and operations on IEEE-754 floating point types. */\n\n#ifndef mozilla_FloatingPoint_h\n#define mozilla_FloatingPoint_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Casting.h\"\n\n#include <stdint.h>\n\nnamespace mozilla {\n\n/*\n * It's reasonable to ask why we have this header at all.  Don't isnan,\n * copysign, the built-in comparison operators, and the like solve these\n * problems?  Unfortunately, they don't.  We've found that various compilers\n * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile\n * the standard methods in various situations, so we can't use them.  Some of\n * these compilers even have problems compiling seemingly reasonable bitwise\n * algorithms!  But with some care we've found algorithms that seem to not\n * trigger those compiler bugs.\n *\n * For the aforementioned reasons, be very wary of making changes to any of\n * these algorithms.  If you must make changes, keep a careful eye out for\n * compiler bustage, particularly PGO-specific bustage.\n */\n\n/*\n * These implementations all assume |double| is a 64-bit double format number\n * type, compatible with the IEEE-754 standard.  C/C++ don't require this to be\n * the case.  But we required this in implementations of these algorithms that\n * preceded this header, so we shouldn't break anything if we continue doing so.\n */\nstatic_assert(sizeof(double) == sizeof(uint64_t), \"double must be 64 bits\");\n\nconst unsigned DoubleExponentBias = 1023;\nconst unsigned DoubleExponentShift = 52;\n\nconst uint64_t DoubleSignBit         = 0x8000000000000000ULL;\nconst uint64_t DoubleExponentBits    = 0x7ff0000000000000ULL;\nconst uint64_t DoubleSignificandBits = 0x000fffffffffffffULL;\n\nstatic_assert((DoubleSignBit & DoubleExponentBits) == 0,\n              \"sign bit doesn't overlap exponent bits\");\nstatic_assert((DoubleSignBit & DoubleSignificandBits) == 0,\n              \"sign bit doesn't overlap significand bits\");\nstatic_assert((DoubleExponentBits & DoubleSignificandBits) == 0,\n              \"exponent bits don't overlap significand bits\");\n\nstatic_assert((DoubleSignBit | DoubleExponentBits | DoubleSignificandBits) ==\n              ~uint64_t(0),\n              \"all bits accounted for\");\n\n/** Determines whether a double is NaN. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNaN(double d)\n{\n  /*\n   * A double is NaN if all exponent bits are 1 and the significand contains at\n   * least one non-zero bit.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) == DoubleExponentBits &&\n         (bits & DoubleSignificandBits) != 0;\n}\n\n/** Determines whether a double is +Infinity or -Infinity. */\nstatic MOZ_ALWAYS_INLINE bool\nIsInfinite(double d)\n{\n  /* Infinities have all exponent bits set to 1 and an all-0 significand. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & ~DoubleSignBit) == DoubleExponentBits;\n}\n\n/** Determines whether a double is not NaN or infinite. */\nstatic MOZ_ALWAYS_INLINE bool\nIsFinite(double d)\n{\n  /*\n   * NaN and Infinities are the only non-finite doubles, and both have all\n   * exponent bits set to 1.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleExponentBits) != DoubleExponentBits;\n}\n\n/**\n * Determines whether a double is negative.  It is an error to call this method\n * on a double which is NaN.\n */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegative(double d)\n{\n  MOZ_ASSERT(!IsNaN(d), \"NaN does not have a sign\");\n\n  /* The sign bit is set if the double is negative. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return (bits & DoubleSignBit) != 0;\n}\n\n/** Determines whether a double represents -0. */\nstatic MOZ_ALWAYS_INLINE bool\nIsNegativeZero(double d)\n{\n  /* Only the sign bit is set if the double is -0. */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return bits == DoubleSignBit;\n}\n\n/** Returns the exponent portion of the double. */\nstatic MOZ_ALWAYS_INLINE int_fast16_t\nExponentComponent(double d)\n{\n  /*\n   * The exponent component of a double is an unsigned number, biased from its\n   * actual value.  Subtract the bias to retrieve the actual exponent.\n   */\n  uint64_t bits = BitwiseCast<uint64_t>(d);\n  return int_fast16_t((bits & DoubleExponentBits) >> DoubleExponentShift) -\n         int_fast16_t(DoubleExponentBias);\n}\n\n/** Returns +Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nPositiveInfinity()\n{\n  /*\n   * Positive infinity has all exponent bits set, sign bit set to 0, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleExponentBits);\n}\n\n/** Returns -Infinity. */\nstatic MOZ_ALWAYS_INLINE double\nNegativeInfinity()\n{\n  /*\n   * Negative infinity has all exponent bits set, sign bit set to 1, and no\n   * significand.\n   */\n  return BitwiseCast<double>(DoubleSignBit | DoubleExponentBits);\n}\n\n/** Constructs a NaN value with the specified sign bit and significand bits. */\nstatic MOZ_ALWAYS_INLINE double\nSpecificNaN(int signbit, uint64_t significand)\n{\n  MOZ_ASSERT(signbit == 0 || signbit == 1);\n  MOZ_ASSERT((significand & ~DoubleSignificandBits) == 0);\n  MOZ_ASSERT(significand & DoubleSignificandBits);\n\n  double d = BitwiseCast<double>((signbit ? DoubleSignBit : 0) |\n                                 DoubleExponentBits |\n                                 significand);\n  MOZ_ASSERT(IsNaN(d));\n  return d;\n}\n\n/** Computes the smallest non-zero positive double value. */\nstatic MOZ_ALWAYS_INLINE double\nMinDoubleValue()\n{\n  return BitwiseCast<double>(uint64_t(1));\n}\n\nstatic MOZ_ALWAYS_INLINE bool\nDoubleIsInt32(double d, int32_t* i)\n{\n  /*\n   * XXX Casting a double that doesn't truncate to int32_t, to int32_t, induces\n   *     undefined behavior.  We should definitely fix this (bug 744965), but as\n   *     apparently it \"works\" in practice, it's not a pressing concern now.\n   */\n  return !IsNegativeZero(d) && d == (*i = int32_t(d));\n}\n\n/**\n * Computes a NaN value.  Do not use this method if you depend upon a particular\n * NaN value being returned.\n */\nstatic MOZ_ALWAYS_INLINE double\nUnspecifiedNaN()\n{\n  return SpecificNaN(0, 0xfffffffffffffULL);\n}\n\n/**\n * Compare two doubles for equality, *without* equating -0 to +0, and equating\n * any NaN value to any other NaN value.  (The normal equality operators equate\n * -0 with +0, and they equate NaN to no other value.)\n */\nstatic inline bool\nDoublesAreIdentical(double d1, double d2)\n{\n  if (IsNaN(d1))\n    return IsNaN(d2);\n  return BitwiseCast<uint64_t>(d1) == BitwiseCast<uint64_t>(d2);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_FloatingPoint_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/GuardObjects.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Implementation of macros to ensure correct use of RAII Auto* objects. */\n\n#ifndef mozilla_GuardObjects_h\n#define mozilla_GuardObjects_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\n#ifdef DEBUG\n\nnamespace mozilla {\nnamespace detail {\n\n/*\n * The following classes are designed to cause assertions to detect\n * inadvertent use of guard objects as temporaries. In other words,\n * when we have a guard object whose only purpose is its constructor and\n * destructor (and is never otherwise referenced), the intended use\n * might be:\n *\n *   AutoRestore savePainting(mIsPainting);\n *\n * but is is easy to accidentally write:\n *\n *   AutoRestore(mIsPainting);\n *\n * which compiles just fine, but runs the destructor well before the\n * intended time.\n *\n * They work by adding (#ifdef DEBUG) an additional parameter to the\n * guard object's constructor, with a default value, so that users of\n * the guard object's API do not need to do anything. The default value\n * of this parameter is a temporary object. C++ (ISO/IEC 14882:1998),\n * section 12.2 [class.temporary], clauses 4 and 5 seem to assume a\n * guarantee that temporaries are destroyed in the reverse of their\n * construction order, but I actually can't find a statement that that\n * is true in the general case (beyond the two specific cases mentioned\n * there). However, it seems to be true.\n *\n * These classes are intended to be used only via the macros immediately\n * below them:\n *\n *   MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER declares (ifdef DEBUG) a member\n *     variable, and should be put where a declaration of a private\n *     member variable would be placed.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM should be placed at the end of the\n *     parameters to each constructor of the guard object; it declares\n *     (ifdef DEBUG) an additional parameter. (But use the *_ONLY_PARAM\n *     variant for constructors that take no other parameters.)\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL should likewise be used in\n *     the implementation of such constructors when they are not inline.\n *   MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT should be used in\n *     the implementation of such constructors to pass the parameter to\n *     a base class that also uses these macros\n *   MOZ_GUARD_OBJECT_NOTIFIER_INIT is a statement that belongs in each\n *     constructor. It uses the parameter declared by\n *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.\n *\n * For more details, and examples of using these macros, see\n * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla\n */\nclass MOZ_EXPORT GuardObjectNotifier\n{\n  private:\n    bool* statementDone;\n\n  public:\n    GuardObjectNotifier() : statementDone(nullptr) { }\n\n    ~GuardObjectNotifier() {\n      *statementDone = true;\n    }\n\n    void setStatementDone(bool* statementIsDone) {\n      statementDone = statementIsDone;\n    }\n};\n\nclass MOZ_EXPORT GuardObjectNotificationReceiver\n{\n  private:\n    bool statementDone;\n\n  public:\n    GuardObjectNotificationReceiver() : statementDone(false) { }\n\n    ~GuardObjectNotificationReceiver() {\n      /*\n       * Assert that the guard object was not used as a temporary.  (Note that\n       * this assert might also fire if init is not called because the guard\n       * object's implementation is not using the above macros correctly.)\n       */\n      MOZ_ASSERT(statementDone);\n    }\n\n    void init(const GuardObjectNotifier& constNotifier) {\n      /*\n       * constNotifier is passed as a const reference so that we can pass a\n       * temporary, but we really intend it as non-const.\n       */\n      GuardObjectNotifier& notifier = const_cast<GuardObjectNotifier&>(constNotifier);\n      notifier.setStatementDone(&statementDone);\n    }\n};\n\n} /* namespace detail */\n} /* namespace mozilla */\n\n#endif /* DEBUG */\n\n#ifdef DEBUG\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \\\n     mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary;\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \\\n     const mozilla::detail::GuardObjectNotifier& _notifier = \\\n         mozilla::detail::GuardObjectNotifier()\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \\\n     , const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \\\n     const mozilla::detail::GuardObjectNotifier& _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \\\n     , _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \\\n       _notifier\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT \\\n     do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0)\n#else\n#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL\n#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT\n#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)\n#endif\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_GuardObjects_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/HashFunctions.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Utilities for hashing. */\n\n/*\n * This file exports functions for hashing data down to a 32-bit value,\n * including:\n *\n *  - HashString    Hash a char* or uint16_t/wchar_t* of known or unknown\n *                  length.\n *\n *  - HashBytes     Hash a byte array of known length.\n *\n *  - HashGeneric   Hash one or more values.  Currently, we support uint32_t,\n *                  types which can be implicitly cast to uint32_t, data\n *                  pointers, and function pointers.\n *\n *  - AddToHash     Add one or more values to the given hash.  This supports the\n *                  same list of types as HashGeneric.\n *\n *\n * You can chain these functions together to hash complex objects.  For example:\n *\n *  class ComplexObject\n *  {\n *      char* str;\n *      uint32_t uint1, uint2;\n *      void (*callbackFn)();\n *\n *    public:\n *      uint32_t hash() {\n *        uint32_t hash = HashString(str);\n *        hash = AddToHash(hash, uint1, uint2);\n *        return AddToHash(hash, callbackFn);\n *      }\n *  };\n *\n * If you want to hash an nsAString or nsACString, use the HashString functions\n * in nsHashKeys.h.\n */\n\n#ifndef mozilla_HashFunctions_h\n#define mozilla_HashFunctions_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\n#ifdef __cplusplus\nnamespace mozilla {\n\n/**\n * The golden ratio as a 32-bit fixed-point value.\n */\nstatic const uint32_t GoldenRatioU32 = 0x9E3779B9U;\n\ninline uint32_t\nRotateBitsLeft32(uint32_t value, uint8_t bits)\n{\n  MOZ_ASSERT(bits < 32);\n  return (value << bits) | (value >> (32 - bits));\n}\n\nnamespace detail {\n\ninline uint32_t\nAddU32ToHash(uint32_t hash, uint32_t value)\n{\n  /*\n   * This is the meat of all our hash routines.  This hash function is not\n   * particularly sophisticated, but it seems to work well for our mostly\n   * plain-text inputs.  Implementation notes follow.\n   *\n   * Our use of the golden ratio here is arbitrary; we could pick almost any\n   * number which:\n   *\n   *  * is odd (because otherwise, all our hash values will be even)\n   *\n   *  * has a reasonably-even mix of 1's and 0's (consider the extreme case\n   *    where we multiply by 0x3 or 0xeffffff -- this will not produce good\n   *    mixing across all bits of the hash).\n   *\n   * The rotation length of 5 is also arbitrary, although an odd number is again\n   * preferable so our hash explores the whole universe of possible rotations.\n   *\n   * Finally, we multiply by the golden ratio *after* xor'ing, not before.\n   * Otherwise, if |hash| is 0 (as it often is for the beginning of a message),\n   * the expression\n   *\n   *   (GoldenRatioU32 * RotateBitsLeft(hash, 5)) |xor| value\n   *\n   * evaluates to |value|.\n   *\n   * (Number-theoretic aside: Because any odd number |m| is relatively prime to\n   * our modulus (2^32), the list\n   *\n   *    [x * m (mod 2^32) for 0 <= x < 2^32]\n   *\n   * has no duplicate elements.  This means that multiplying by |m| does not\n   * cause us to skip any possible hash values.\n   *\n   * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the\n   * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely\n   * multiply our hash value by |m| a few times without negating the\n   * multiplicative effect.  Our golden ratio constant has order 2^29, which is\n   * more than enough for our purposes.)\n   */\n  return GoldenRatioU32 * (RotateBitsLeft32(hash, 5) ^ value);\n}\n\n/**\n * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter.\n */\ntemplate<size_t PtrSize>\ninline uint32_t\nAddUintptrToHash(uint32_t hash, uintptr_t value);\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<4>(uint32_t hash, uintptr_t value)\n{\n  return AddU32ToHash(hash, static_cast<uint32_t>(value));\n}\n\ntemplate<>\ninline uint32_t\nAddUintptrToHash<8>(uint32_t hash, uintptr_t value)\n{\n  /*\n   * The static cast to uint64_t below is necessary because this function\n   * sometimes gets compiled on 32-bit platforms (yes, even though it's a\n   * template and we never call this particular override in a 32-bit build).  If\n   * we do value >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t\n   * right 32 bits, and the compiler throws an error.\n   */\n  uint32_t v1 = static_cast<uint32_t>(value);\n  uint32_t v2 = static_cast<uint32_t>(static_cast<uint64_t>(value) >> 32);\n  return AddU32ToHash(AddU32ToHash(hash, v1), v2);\n}\n\n} /* namespace detail */\n\n/**\n * AddToHash takes a hash and some values and returns a new hash based on the\n * inputs.\n *\n * Currently, we support hashing uint32_t's, values which we can implicitly\n * convert to uint32_t, data pointers, and function pointers.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A a)\n{\n  /*\n   * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,\n   * we'll error out.\n   */\n  return detail::AddU32ToHash(hash, a);\n}\n\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, A* a)\n{\n  /*\n   * You might think this function should just take a void*.  But then we'd only\n   * catch data pointers and couldn't handle function pointers.\n   */\n\n  static_assert(sizeof(a) == sizeof(uintptr_t),\n                \"Strange pointer!\");\n\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, uintptr_t(a));\n}\n\ntemplate<>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nAddToHash(uint32_t hash, uintptr_t a)\n{\n  return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b)\n{\n  return AddToHash(AddToHash(hash, a), b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c)\n{\n  return AddToHash(AddToHash(hash, a, b), c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d)\n{\n  return AddToHash(AddToHash(hash, a, b, c), d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\nuint32_t\nAddToHash(uint32_t hash, A a, B b, C c, D d, E e)\n{\n  return AddToHash(AddToHash(hash, a, b, c, d), e);\n}\n\n/**\n * The HashGeneric class of functions let you hash one or more values.\n *\n * If you want to hash together two values x and y, calling HashGeneric(x, y) is\n * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes\n * that x has already been hashed.\n */\ntemplate<typename A>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a)\n{\n  return AddToHash(0, a);\n}\n\ntemplate<typename A, typename B>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b)\n{\n  return AddToHash(0, a, b);\n}\n\ntemplate<typename A, typename B, typename C>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c)\n{\n  return AddToHash(0, a, b, c);\n}\n\ntemplate<typename A, typename B, typename C, typename D>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d)\n{\n  return AddToHash(0, a, b, c, d);\n}\n\ntemplate<typename A, typename B, typename C, typename D, typename E>\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashGeneric(A a, B b, C c, D d, E e)\n{\n  return AddToHash(0, a, b, c, d, e);\n}\n\nnamespace detail {\n\ntemplate<typename T>\nuint32_t\nHashUntilZero(const T* str)\n{\n  uint32_t hash = 0;\n  for (T c; (c = *str); str++)\n    hash = AddToHash(hash, c);\n  return hash;\n}\n\ntemplate<typename T>\nuint32_t\nHashKnownLength(const T* str, size_t length)\n{\n  uint32_t hash = 0;\n  for (size_t i = 0; i < length; i++)\n    hash = AddToHash(hash, str[i]);\n  return hash;\n}\n\n} /* namespace detail */\n\n/**\n * The HashString overloads below do just what you'd expect.\n *\n * If you have the string's length, you might as well call the overload which\n * includes the length.  It may be marginally faster.\n */\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const char* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const uint16_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n\n/*\n * On Windows, wchar_t (PRUnichar) is not the same as uint16_t, even though it's\n * the same width!\n */\n#ifdef WIN32\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str)\n{\n  return detail::HashUntilZero(str);\n}\n\nMOZ_WARN_UNUSED_RESULT\ninline uint32_t\nHashString(const wchar_t* str, size_t length)\n{\n  return detail::HashKnownLength(str, length);\n}\n#endif\n\n/**\n * Hash some number of bytes.\n *\n * This hash walks word-by-word, rather than byte-by-byte, so you won't get the\n * same result out of HashBytes as you would out of HashString.\n */\nMOZ_WARN_UNUSED_RESULT\nextern MFBT_API uint32_t\nHashBytes(const void* bytes, size_t length);\n\n} /* namespace mozilla */\n#endif /* __cplusplus */\n\n#endif /* mozilla_HashFunctions_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Likely.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * MOZ_LIKELY and MOZ_UNLIKELY macros to hint to the compiler how a\n * boolean predicate should be branch-predicted.\n */\n\n#ifndef mozilla_Likely_h\n#define mozilla_Likely_h\n\n#if defined(__clang__) || defined(__GNUC__)\n#  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))\n#  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))\n#else\n#  define MOZ_LIKELY(x)   (!!(x))\n#  define MOZ_UNLIKELY(x) (!!(x))\n#endif\n\n#endif /* mozilla_Likely_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/LinkedList.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type-safe doubly-linked list class. */\n\n/*\n * The classes LinkedList<T> and LinkedListElement<T> together form a\n * convenient, type-safe doubly-linked list implementation.\n *\n * The class T which will be inserted into the linked list must inherit from\n * LinkedListElement<T>.  A given object may be in only one linked list at a\n * time.\n *\n * A LinkedListElement automatically removes itself from the list upon\n * destruction, and a LinkedList will fatally assert in debug builds if it's\n * non-empty when it's destructed.\n *\n * For example, you might use LinkedList in a simple observer list class as\n * follows.\n *\n *   class Observer : public LinkedListElement<Observer>\n *   {\n *     public:\n *       void observe(char* topic) { ... }\n *   };\n *\n *   class ObserverContainer\n *   {\n *     private:\n *       LinkedList<Observer> list;\n *\n *     public:\n *       void addObserver(Observer* observer) {\n *         // Will assert if |observer| is part of another list.\n *         list.insertBack(observer);\n *       }\n *\n *       void removeObserver(Observer* observer) {\n *         // Will assert if |observer| is not part of some list.\n *         observer.remove();\n *         // Or, will assert if |observer| is not part of |list| specifically.\n *         // observer.removeFrom(list);\n *       }\n *\n *       void notifyObservers(char* topic) {\n *         for (Observer* o = list.getFirst(); o != nullptr; o = o->getNext())\n *           o->observe(topic);\n *       }\n *   };\n *\n */\n\n#ifndef mozilla_LinkedList_h\n#define mozilla_LinkedList_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\ntemplate<typename T>\nclass LinkedList;\n\ntemplate<typename T>\nclass LinkedListElement\n{\n    /*\n     * It's convenient that we return nullptr when getNext() or getPrevious()\n     * hits the end of the list, but doing so costs an extra word of storage in\n     * each linked list node (to keep track of whether |this| is the sentinel\n     * node) and a branch on this value in getNext/getPrevious.\n     *\n     * We could get rid of the extra word of storage by shoving the \"is\n     * sentinel\" bit into one of the pointers, although this would, of course,\n     * have performance implications of its own.\n     *\n     * But the goal here isn't to win an award for the fastest or slimmest\n     * linked list; rather, we want a *convenient* linked list.  So we won't\n     * waste time guessing which micro-optimization strategy is best.\n     *\n     *\n     * Speaking of unnecessary work, it's worth addressing here why we wrote\n     * mozilla::LinkedList in the first place, instead of using stl::list.\n     *\n     * The key difference between mozilla::LinkedList and stl::list is that\n     * mozilla::LinkedList stores the prev/next pointers in the object itself,\n     * while stl::list stores the prev/next pointers in a list element which\n     * itself points to the object being stored.\n     *\n     * mozilla::LinkedList's approach makes it harder to store an object in more\n     * than one list.  But the upside is that you can call next() / prev() /\n     * remove() directly on the object.  With stl::list, you'd need to store a\n     * pointer to its iterator in the object in order to accomplish this.  Not\n     * only would this waste space, but you'd have to remember to update that\n     * pointer every time you added or removed the object from a list.\n     *\n     * In-place, constant-time removal is a killer feature of doubly-linked\n     * lists, and supporting this painlessly was a key design criterion.\n     */\n\n  private:\n    LinkedListElement* next;\n    LinkedListElement* prev;\n    const bool isSentinel;\n\n  public:\n    LinkedListElement()\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(false)\n    { }\n\n    ~LinkedListElement() {\n      if (!isSentinel && isInList())\n        remove();\n    }\n\n    /*\n     * Get the next element in the list, or nullptr if this is the last element\n     * in the list.\n     */\n    T* getNext() {\n      return next->asT();\n    }\n    const T* getNext() const {\n      return next->asT();\n    }\n\n    /*\n     * Get the previous element in the list, or nullptr if this is the first\n     * element in the list.\n     */\n    T* getPrevious() {\n      return prev->asT();\n    }\n    const T* getPrevious() const {\n      return prev->asT();\n    }\n\n    /*\n     * Insert elem after this element in the list.  |this| must be part of a\n     * linked list when you call setNext(); otherwise, this method will assert.\n     */\n    void setNext(T* elem) {\n        MOZ_ASSERT(isInList());\n        setNextUnsafe(elem);\n    }\n\n    /*\n     * Insert elem before this element in the list.  |this| must be part of a\n     * linked list when you call setPrevious(); otherwise, this method will\n     * assert.\n     */\n    void setPrevious(T* elem) {\n      MOZ_ASSERT(isInList());\n      setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Remove this element from the list which contains it.  If this element is\n     * not currently part of a linked list, this method asserts.\n     */\n    void remove() {\n      MOZ_ASSERT(isInList());\n\n      prev->next = next;\n      next->prev = prev;\n      next = this;\n      prev = this;\n    }\n\n    /*\n     * Identical to remove(), but also asserts in debug builds that this element\n     * is in list.\n     */\n    void removeFrom(const LinkedList<T>& list) {\n      list.assertContains(asT());\n      remove();\n    }\n\n    /*\n     * Return true if |this| part is of a linked list, and false otherwise.\n     */\n    bool isInList() const {\n      MOZ_ASSERT((next == this) == (prev == this));\n      return next != this;\n    }\n\n  private:\n    friend class LinkedList<T>;\n\n    enum NodeKind {\n      NODE_KIND_NORMAL,\n      NODE_KIND_SENTINEL\n    };\n\n    LinkedListElement(NodeKind nodeKind)\n      : next(MOZ_THIS_IN_INITIALIZER_LIST()),\n        prev(MOZ_THIS_IN_INITIALIZER_LIST()),\n        isSentinel(nodeKind == NODE_KIND_SENTINEL)\n    { }\n\n    /*\n     * Return |this| cast to T* if we're a normal node, or return nullptr if\n     * we're a sentinel node.\n     */\n    T* asT() {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<T*>(this);\n    }\n    const T* asT() const {\n      if (isSentinel)\n        return nullptr;\n\n      return static_cast<const T*>(this);\n    }\n\n    /*\n     * Insert elem after this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertFront().\n     */\n    void setNextUnsafe(T* elem) {\n      LinkedListElement *listElem = static_cast<LinkedListElement*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this->next;\n      listElem->prev = this;\n      this->next->prev = listElem;\n      this->next = listElem;\n    }\n\n    /*\n     * Insert elem before this element, but don't check that this element is in\n     * the list.  This is called by LinkedList::insertBack().\n     */\n    void setPreviousUnsafe(T* elem) {\n      LinkedListElement<T>* listElem = static_cast<LinkedListElement<T>*>(elem);\n      MOZ_ASSERT(!listElem->isInList());\n\n      listElem->next = this;\n      listElem->prev = this->prev;\n      this->prev->next = listElem;\n      this->prev = listElem;\n    }\n\n  private:\n    LinkedListElement& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedListElement(const LinkedList<T>& other) MOZ_DELETE;\n};\n\ntemplate<typename T>\nclass LinkedList\n{\n  private:\n    LinkedListElement<T> sentinel;\n\n  public:\n    LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }\n\n    ~LinkedList() {\n      MOZ_ASSERT(isEmpty());\n    }\n\n    /*\n     * Add elem to the front of the list.\n     */\n    void insertFront(T* elem) {\n      /* Bypass setNext()'s this->isInList() assertion. */\n      sentinel.setNextUnsafe(elem);\n    }\n\n    /*\n     * Add elem to the back of the list.\n     */\n    void insertBack(T* elem) {\n      sentinel.setPreviousUnsafe(elem);\n    }\n\n    /*\n     * Get the first element of the list, or nullptr if the list is empty.\n     */\n    T* getFirst() {\n      return sentinel.getNext();\n    }\n    const T* getFirst() const {\n      return sentinel.getNext();\n    }\n\n    /*\n     * Get the last element of the list, or nullptr if the list is empty.\n     */\n    T* getLast() {\n      return sentinel.getPrevious();\n    }\n    const T* getLast() const {\n      return sentinel.getPrevious();\n    }\n\n    /*\n     * Get and remove the first element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popFirst() {\n      T* ret = sentinel.getNext();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Get and remove the last element of the list.  If the list is empty,\n     * return nullptr.\n     */\n    T* popLast() {\n      T* ret = sentinel.getPrevious();\n      if (ret)\n        static_cast<LinkedListElement<T>*>(ret)->remove();\n      return ret;\n    }\n\n    /*\n     * Return true if the list is empty, or false otherwise.\n     */\n    bool isEmpty() const {\n      return !sentinel.isInList();\n    }\n\n    /*\n     * Remove all the elements from the list.\n     *\n     * This runs in time linear to the list's length, because we have to mark\n     * each element as not in the list.\n     */\n    void clear() {\n      while (popFirst())\n        continue;\n    }\n\n    /*\n     * In a debug build, make sure that the list is sane (no cycles, consistent\n     * next/prev pointers, only one sentinel).  Has no effect in release builds.\n     */\n    void debugAssertIsSane() const {\n#ifdef DEBUG\n      const LinkedListElement<T>* slow;\n      const LinkedListElement<T>* fast1;\n      const LinkedListElement<T>* fast2;\n\n      /*\n       * Check for cycles in the forward singly-linked list using the\n       * tortoise/hare algorithm.\n       */\n      for (slow = sentinel.next,\n           fast1 = sentinel.next->next,\n           fast2 = sentinel.next->next->next;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->next, fast1 = fast2->next, fast2 = fast1->next)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /* Check for cycles in the backward singly-linked list. */\n      for (slow = sentinel.prev,\n           fast1 = sentinel.prev->prev,\n           fast2 = sentinel.prev->prev->prev;\n           slow != sentinel && fast1 != sentinel && fast2 != sentinel;\n           slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev)\n      {\n        MOZ_ASSERT(slow != fast1);\n        MOZ_ASSERT(slow != fast2);\n      }\n\n      /*\n       * Check that |sentinel| is the only node in the list with\n       * isSentinel == true.\n       */\n      for (const LinkedListElement<T>* elem = sentinel.next;\n           elem != sentinel;\n           elem = elem->next)\n      {\n        MOZ_ASSERT(!elem->isSentinel);\n      }\n\n      /* Check that the next/prev pointers match up. */\n      const LinkedListElement<T>* prev = sentinel;\n      const LinkedListElement<T>* cur = sentinel.next;\n      do {\n          MOZ_ASSERT(cur->prev == prev);\n          MOZ_ASSERT(prev->next == cur);\n\n          prev = cur;\n          cur = cur->next;\n      } while (cur != sentinel);\n#endif /* ifdef DEBUG */\n    }\n\n  private:\n    friend class LinkedListElement<T>;\n\n    void assertContains(const T* t) const {\n#ifdef DEBUG\n      for (const T* elem = getFirst();\n           elem;\n           elem = elem->getNext())\n      {\n        if (elem == t)\n          return;\n      }\n      MOZ_CRASH(\"element wasn't found in this list!\");\n#endif\n    }\n\n    LinkedList& operator=(const LinkedList<T>& other) MOZ_DELETE;\n    LinkedList(const LinkedList<T>& other) MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_LinkedList_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/MathAlgorithms.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt maths algorithms. */\n\n#ifndef mozilla_MathAlgorithms_h\n#define mozilla_MathAlgorithms_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/TypeTraits.h\"\n\n#include <cmath>\n#include <limits.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n// Greatest Common Divisor\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidGCD(IntegerType a, IntegerType b)\n{\n  // Euclid's algorithm; O(N) in the worst case.  (There are better\n  // ways, but we don't need them for the current use of this algo.)\n  MOZ_ASSERT(a > 0);\n  MOZ_ASSERT(b > 0);\n\n  while (a != b) {\n    if (a > b) {\n      a = a - b;\n    } else {\n      b = b - a;\n    }\n  }\n\n  return a;\n}\n\n// Least Common Multiple\ntemplate<typename IntegerType>\nMOZ_ALWAYS_INLINE IntegerType\nEuclidLCM(IntegerType a, IntegerType b)\n{\n  // Divide first to reduce overflow risk.\n  return (a / EuclidGCD(a, b)) * b;\n}\n\nnamespace detail {\n\ntemplate<typename T>\nstruct AllowDeprecatedAbsFixed : FalseType {};\n\ntemplate<> struct AllowDeprecatedAbsFixed<int32_t> : TrueType {};\ntemplate<> struct AllowDeprecatedAbsFixed<int64_t> : TrueType {};\n\ntemplate<typename T>\nstruct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};\n\ntemplate<> struct AllowDeprecatedAbs<int> : TrueType {};\ntemplate<> struct AllowDeprecatedAbs<long> : TrueType {};\n\n} // namespace detail\n\n// DO NOT USE DeprecatedAbs.  It exists only until its callers can be converted\n// to Abs below, and it will be removed when all callers have been changed.\ntemplate<typename T>\ninline typename mozilla::EnableIf<detail::AllowDeprecatedAbs<T>::value, T>::Type\nDeprecatedAbs(const T t)\n{\n  // The absolute value of the smallest possible value of a signed-integer type\n  // won't fit in that type (on twos-complement systems -- and we're blithely\n  // assuming we're on such systems, for the non-<stdint.h> types listed above),\n  // so assert that the input isn't that value.\n  //\n  // This is the case if: the value is non-negative; or if adding one (giving a\n  // value in the range [-maxvalue, 0]), then negating (giving a value in the\n  // range [0, maxvalue]), doesn't produce maxvalue (because in twos-complement,\n  // (minvalue + 1) == -maxvalue).\n  MOZ_ASSERT(t >= 0 ||\n             -(t + 1) != T((1ULL << (CHAR_BIT * sizeof(T) - 1)) - 1),\n             \"You can't negate the smallest possible negative integer!\");\n  return t >= 0 ? t : -t;\n}\n\nnamespace detail {\n\n// For now mozilla::Abs only takes intN_T, the signed natural types, and\n// float/double/long double.  Feel free to add overloads for other standard,\n// signed types if you need them.\n\ntemplate<typename T>\nstruct AbsReturnTypeFixed;\n\ntemplate<> struct AbsReturnTypeFixed<int8_t> { typedef uint8_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int16_t> { typedef uint16_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int32_t> { typedef uint32_t Type; };\ntemplate<> struct AbsReturnTypeFixed<int64_t> { typedef uint64_t Type; };\n\ntemplate<typename T>\nstruct AbsReturnType : AbsReturnTypeFixed<T> {};\n\ntemplate<> struct AbsReturnType<char> : EnableIf<char(-1) < char(0), unsigned char> {};\ntemplate<> struct AbsReturnType<signed char> { typedef unsigned char Type; };\ntemplate<> struct AbsReturnType<short> { typedef unsigned short Type; };\ntemplate<> struct AbsReturnType<int> { typedef unsigned int Type; };\ntemplate<> struct AbsReturnType<long> { typedef unsigned long Type; };\ntemplate<> struct AbsReturnType<long long> { typedef unsigned long long Type; };\ntemplate<> struct AbsReturnType<float> { typedef float Type; };\ntemplate<> struct AbsReturnType<double> { typedef double Type; };\ntemplate<> struct AbsReturnType<long double> { typedef long double Type; };\n\n} // namespace detail\n\ntemplate<typename T>\ninline typename detail::AbsReturnType<T>::Type\nAbs(const T t)\n{\n  typedef typename detail::AbsReturnType<T>::Type ReturnType;\n  return t >= 0 ? ReturnType(t) : ~ReturnType(t) + 1;\n}\n\ntemplate<>\ninline float\nAbs<float>(const float f)\n{\n  return std::fabs(f);\n}\n\ntemplate<>\ninline double\nAbs<double>(const double d)\n{\n  return std::fabs(d);\n}\n\ntemplate<>\ninline long double\nAbs<long double>(const long double d)\n{\n  return std::fabs(d);\n}\n\n} // namespace mozilla\n\n#if defined(_WIN32) && (_MSC_VER >= 1300) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))\n#  define MOZ_BITSCAN_WINDOWS\n\n  extern \"C\" {\n    unsigned char _BitScanForward(unsigned long* Index, unsigned long mask);\n    unsigned char _BitScanReverse(unsigned long* Index, unsigned long mask);\n#  pragma intrinsic(_BitScanForward, _BitScanReverse)\n\n#  if defined(_M_AMD64) || defined(_M_X64)\n#    define MOZ_BITSCAN_WINDOWS64\n    unsigned char _BitScanForward64(unsigned long* index, unsigned __int64 mask);\n    unsigned char _BitScanReverse64(unsigned long* index, unsigned __int64 mask);\n#   pragma intrinsic(_BitScanForward64, _BitScanReverse64)\n#  endif\n  } // extern \"C\"\n\n#endif\n\nnamespace mozilla {\n\nnamespace detail {\n\n#if defined(MOZ_BITSCAN_WINDOWS)\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanReverse(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(31 - index);\n  }\n\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    unsigned long index;\n    _BitScanForward(&index, static_cast<unsigned long>(u));\n    return uint_fast8_t(index);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanReverse64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(63 - index);\n#  else\n    uint32_t hi = uint32_t(u >> 32);\n    if (hi != 0)\n      return CountLeadingZeroes32(hi);\n    return 32 + CountLeadingZeroes32(uint32_t(u));\n#  endif\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n#  if defined(MOZ_BITSCAN_WINDOWS64)\n    unsigned long index;\n    _BitScanForward64(&index, static_cast<unsigned __int64>(u));\n    return uint_fast8_t(index);\n#  else\n    uint32_t lo = uint32_t(u);\n    if (lo != 0)\n      return CountTrailingZeroes32(lo);\n    return 32 + CountTrailingZeroes32(uint32_t(u >> 32));\n#  endif\n  }\n\n#  ifdef MOZ_HAVE_BITSCAN64\n#    undef MOZ_HAVE_BITSCAN64\n#  endif\n\n#elif defined(__clang__) || defined(__GNUC__)\n\n#  if defined(__clang__)\n#    if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz)\n#      error \"A clang providing __builtin_c[lt]z is required to build\"\n#    endif\n#  else\n     // gcc has had __builtin_clz and friends since 3.4: no need to check.\n#  endif\n\n  inline uint_fast8_t\n  CountLeadingZeroes32(uint32_t u)\n  {\n    return __builtin_clz(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes32(uint32_t u)\n  {\n    return __builtin_ctz(u);\n  }\n\n  inline uint_fast8_t\n  CountLeadingZeroes64(uint64_t u)\n  {\n    return __builtin_clzll(u);\n  }\n\n  inline uint_fast8_t\n  CountTrailingZeroes64(uint64_t u)\n  {\n    return __builtin_ctzll(u);\n  }\n\n#else\n#  error \"Implement these!\"\n  inline uint_fast8_t CountLeadingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes32(uint32_t u) MOZ_DELETE;\n  inline uint_fast8_t CountLeadingZeroes64(uint64_t u) MOZ_DELETE;\n  inline uint_fast8_t CountTrailingZeroes64(uint64_t u) MOZ_DELETE;\n#endif\n\n} // namespace detail\n\n/**\n * Compute the number of high-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the highest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountLeadingZeroes32(0xF0FF1000) is 0;\n * CountLeadingZeroes32(0x7F8F0001) is 1;\n * CountLeadingZeroes32(0x3FFF0100) is 2;\n * CountLeadingZeroes32(0x1FF50010) is 3; and so on.\n */\ninline uint_fast8_t\nCountLeadingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes32(u);\n}\n\n/**\n * Compute the number of low-order zero bits in the NON-ZERO number |u|.  That\n * is, looking at the bitwise representation of the number, with the lowest-\n * valued bits at the start, return the number of zeroes before the first one\n * is observed.\n *\n * CountTrailingZeroes32(0x0100FFFF) is 0;\n * CountTrailingZeroes32(0x7000FFFE) is 1;\n * CountTrailingZeroes32(0x0080FFFC) is 2;\n * CountTrailingZeroes32(0x0080FFF8) is 3; and so on.\n */\ninline uint_fast8_t\nCountTrailingZeroes32(uint32_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes32(u);\n}\n\n/** Analogous to CountLeadingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountLeadingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountLeadingZeroes64(u);\n}\n\n/** Analogous to CountTrailingZeroes32, but for 64-bit numbers. */\ninline uint_fast8_t\nCountTrailingZeroes64(uint64_t u)\n{\n  MOZ_ASSERT(u != 0);\n  return detail::CountTrailingZeroes64(u);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass CeilingLog2;\n\ntemplate<typename T>\nclass CeilingLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 32 - CountLeadingZeroes32(t - 1);\n    }\n};\n\ntemplate<typename T>\nclass CeilingLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      // Check for <= 1 to avoid the == 0 undefined case.\n      return t <= 1 ? 0 : 64 - CountLeadingZeroes64(t - 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the least power of 2 greater than or equal to |t|.\n *\n * CeilingLog2(0..1) is 0;\n * CeilingLog2(2) is 1;\n * CeilingLog2(3..4) is 2;\n * CeilingLog2(5..8) is 3;\n * CeilingLog2(9..16) is 4; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nCeilingLog2(const T t)\n{\n  return detail::CeilingLog2<T>::compute(t);\n}\n\n/** A CeilingLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nCeilingLog2Size(size_t n)\n{\n  return CeilingLog2(n);\n}\n\nnamespace detail {\n\ntemplate<typename T, size_t Size = sizeof(T)>\nclass FloorLog2;\n\ntemplate<typename T>\nclass FloorLog2<T, 4>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 31 - CountLeadingZeroes32(t | 1);\n    }\n};\n\ntemplate<typename T>\nclass FloorLog2<T, 8>\n{\n  public:\n    static uint_fast8_t compute(const T t) {\n      return 63 - CountLeadingZeroes64(t | 1);\n    }\n};\n\n} // namespace detail\n\n/**\n * Compute the log of the greatest power of 2 less than or equal to |t|.\n *\n * FloorLog2(0..1) is 0;\n * FloorLog2(2..3) is 1;\n * FloorLog2(4..7) is 2;\n * FloorLog2(8..15) is 3; and so on.\n */\ntemplate<typename T>\ninline uint_fast8_t\nFloorLog2(const T t)\n{\n  return detail::FloorLog2<T>::compute(t);\n}\n\n/** A FloorLog2 variant that accepts only size_t. */\ninline uint_fast8_t\nFloorLog2Size(size_t n)\n{\n  return FloorLog2(n);\n}\n\n/*\n * Compute the smallest power of 2 greater than or equal to |x|.  |x| must not\n * be so great that the computed value would overflow |size_t|.\n */\ninline size_t\nRoundUpPow2(size_t x)\n{\n  MOZ_ASSERT(x <= (size_t(1) << (sizeof(size_t) * CHAR_BIT - 1)),\n             \"can't round up -- will overflow!\");\n  return size_t(1) << CeilingLog2(x);\n}\n\n} /* namespace mozilla */\n\n#endif /* mozilla_MathAlgorithms_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/MemoryChecking.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Provides a common interface to the ASan (AddressSanitizer) and Valgrind \n * functions used to mark memory in certain ways. In detail, the following\n * three macros are provided:\n *\n *   MOZ_MAKE_MEM_NOACCESS  - Mark memory as unsafe to access (e.g. freed)\n *   MOZ_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined\n *   MOZ_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined\n *\n * With Valgrind in use, these directly map to the three respective Valgrind\n * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory,\n * while the UNDEFINED/DEFINED macros unpoison memory.\n *\n * With no memory checker available, all macros expand to the empty statement.\n */\n\n#ifndef mozilla_MemoryChecking_h\n#define mozilla_MemoryChecking_h\n\n#if defined(MOZ_VALGRIND)\n#include \"valgrind/memcheck.h\"\n#endif\n\n#if defined(MOZ_ASAN) || defined(MOZ_VALGRIND)\n#define MOZ_HAVE_MEM_CHECKS 1\n#endif\n\n#if defined(MOZ_ASAN)\n#include <stddef.h>\n\nextern \"C\" {\n  /* These definitions are usually provided through the \n   * sanitizer/asan_interface.h header installed by ASan.\n   */\n  void __asan_poison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n  void __asan_unpoison_memory_region(void const volatile *addr, size_t size)\n    __attribute__((visibility(\"default\")));\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  __asan_poison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  __asan_unpoison_memory_region((addr), (size))\n}\n#elif defined(MOZ_VALGRIND)\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) \\\n  VALGRIND_MAKE_MEM_NOACCESS((addr), (size))\n\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_UNDEFINED((addr), (size))\n\n#define MOZ_MAKE_MEM_DEFINED(addr, size) \\\n  VALGRIND_MAKE_MEM_DEFINED((addr), (size))\n#else\n\n#define MOZ_MAKE_MEM_NOACCESS(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_UNDEFINED(addr, size) do {} while(0)\n#define MOZ_MAKE_MEM_DEFINED(addr, size) do {} while(0)\n\n#endif\n\n#endif /* mozilla_MemoryChecking_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/MemoryReporting.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Memory reporting infrastructure. */\n\n#ifndef mozilla_MemoryReporting_h\n#define mozilla_MemoryReporting_h\n\n#include <stddef.h>\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This is for functions that are like malloc_usable_size.  Such functions are\n * used for measuring the size of data structures.\n */\ntypedef size_t (*MallocSizeOf)(const void* p);\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\ntypedef size_t (*MozMallocSizeOf)(const void* p);\n\n#endif /* mozilla_MemoryReporting_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Move.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* C++11-style, but C++98-usable, \"move references\" implementation. */\n\n#ifndef mozilla_Move_h\n#define mozilla_Move_h\n\nnamespace mozilla {\n\n/*\n * \"Move\" References\n *\n * Some types can be copied much more efficiently if we know the original's\n * value need not be preserved --- that is, if we are doing a \"move\", not a\n * \"copy\". For example, if we have:\n *\n *   Vector<T> u;\n *   Vector<T> v(u);\n *\n * the constructor for v must apply a copy constructor to each element of u ---\n * taking time linear in the length of u. However, if we know we will not need u\n * any more once v has been initialized, then we could initialize v very\n * efficiently simply by stealing u's dynamically allocated buffer and giving it\n * to v --- a constant-time operation, regardless of the size of u.\n *\n * Moves often appear in container implementations. For example, when we append\n * to a vector, we may need to resize its buffer. This entails moving each of\n * its extant elements from the old, smaller buffer to the new, larger buffer.\n * But once the elements have been migrated, we're just going to throw away the\n * old buffer; we don't care if they still have their values. So if the vector's\n * element type can implement \"move\" more efficiently than \"copy\", the vector\n * resizing should by all means use a \"move\" operation. Hash tables also need to\n * be resized.\n *\n * The details of the optimization, and whether it's worth applying, vary from\n * one type to the next. And while some constructor calls are moves, many really\n * are copies, and can't be optimized this way. So we need:\n *\n * 1) a way for a particular invocation of a copy constructor to say that it's\n *    really a move, and that the value of the original isn't important\n *    afterwards (although it must still be safe to destroy); and\n *\n * 2) a way for a type (like Vector) to announce that it can be moved more\n *    efficiently than it can be copied, and provide an implementation of that\n *    move operation.\n *\n * The Move(T&) function takes a reference to a T, and returns a MoveRef<T>\n * referring to the same value; that's 1). A MoveRef<T> is simply a reference\n * to a T, annotated to say that a copy constructor applied to it may move that\n * T, instead of copying it. Finally, a constructor that accepts an MoveRef<T>\n * should perform a more efficient move, instead of a copy, providing 2).\n *\n * So, where we might define a copy constructor for a class C like this:\n *\n *   C(const C& rhs) { ... copy rhs to this ... }\n *\n * we would declare a move constructor like this:\n *\n *   C(MoveRef<C> rhs) { ... move rhs to this ... }\n *\n * And where we might perform a copy like this:\n *\n *   C c2(c1);\n *\n * we would perform a move like this:\n *\n *   C c2(Move(c1))\n *\n * Note that MoveRef<T> implicitly converts to T&, so you can pass a MoveRef<T>\n * to an ordinary copy constructor for a type that doesn't support a special\n * move constructor, and you'll just get a copy.  This means that templates can\n * use Move whenever they know they won't use the original value any more, even\n * if they're not sure whether the type at hand has a specialized move\n * constructor.  If it doesn't, the MoveRef<T> will just convert to a T&, and\n * the ordinary copy constructor will apply.\n *\n * A class with a move constructor can also provide a move assignment operator,\n * which runs this's destructor, and then applies the move constructor to\n * *this's memory. A typical definition:\n *\n *   C& operator=(MoveRef<C> rhs) {\n *     this->~C();\n *     new(this) C(rhs);\n *     return *this;\n *   }\n *\n * With that in place, one can write move assignments like this:\n *\n *   c2 = Move(c1);\n *\n * This destroys c1, moves c1's value to c2, and leaves c1 in an undefined but\n * destructible state.\n *\n * This header file defines MoveRef and Move in the mozilla namespace.  It's up\n * to individual containers to annotate moves as such, by calling Move; and it's\n * up to individual types to define move constructors.\n *\n * One hint: if you're writing a move constructor where the type has members\n * that should be moved themselves, it's much nicer to write this:\n *\n *   C(MoveRef<C> c) : x(Move(c->x)), y(Move(c->y)) { }\n *\n * than the equivalent:\n *\n *   C(MoveRef<C> c) { new(&x) X(Move(c->x)); new(&y) Y(Move(c->y)); }\n *\n * especially since GNU C++ fails to notice that this does indeed initialize x\n * and y, which may matter if they're const.\n */\ntemplate<typename T>\nclass MoveRef\n{\n    T* pointer;\n\n  public:\n    explicit MoveRef(T& t) : pointer(&t) { }\n    T& operator*() const { return *pointer; }\n    T* operator->() const { return pointer; }\n    operator T& () const { return *pointer; }\n};\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(T& t)\n{\n  return MoveRef<T>(t);\n}\n\ntemplate<typename T>\ninline MoveRef<T>\nMove(const T& t)\n{\n  // With some versions of gcc, for a class C, there's an (incorrect) ambiguity\n  // between the C(const C&) constructor and the default C(C&&) C++11 move\n  // constructor, when the constructor is called with a const C& argument.\n  //\n  // This ambiguity manifests with the Move implementation above when Move is\n  // passed const U& for some class U.  Calling Move(const U&) returns a\n  // MoveRef<const U&>, which is then commonly passed to the U constructor,\n  // triggering an implicit conversion to const U&.  gcc doesn't know whether to\n  // call U(const U&) or U(U&&), so it wrongly reports a compile error.\n  //\n  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50442 has since been fixed, so\n  // this is no longer an issue for up-to-date compilers.  But there's no harm\n  // in keeping it around for older compilers, so we might as well.  See also\n  // bug 686280.\n  return MoveRef<T>(const_cast<T&>(t));\n}\n\n/** Swap |t| and |u| using move-construction if possible. */\ntemplate<typename T>\ninline void\nSwap(T& t, T& u)\n{\n  T tmp(Move(t));\n  t = Move(u);\n  u = Move(tmp);\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_Move_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/NullPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a workaround for compilers which do not support the C++11 nullptr\n * constant.\n */\n\n#ifndef mozilla_NullPtr_h\n#define mozilla_NullPtr_h\n\n#include \"mozilla/Compiler.h\"\n\n#if defined(__clang__)\n#  ifndef __has_extension\n#    define __has_extension __has_feature\n#  endif\n#  if __has_extension(cxx_nullptr)\n#    define MOZ_HAVE_CXX11_NULLPTR\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)\n#      define MOZ_HAVE_CXX11_NULLPTR\n#    endif\n#  endif\n#elif _MSC_VER >= 1600\n# define MOZ_HAVE_CXX11_NULLPTR\n#endif\n\n/**\n * Use C++11 nullptr if available; otherwise use __null for gcc, or a 0 literal\n * with the correct size to match the size of a pointer on a given platform.\n */\n\n#ifndef MOZ_HAVE_CXX11_NULLPTR\n#  if defined(__GNUC__)\n#    define nullptr __null\n#  elif defined(_WIN64)\n#    define nullptr 0LL\n#  else\n#    define nullptr 0L\n#  endif\n#endif\n\n#endif /* mozilla_NullPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/PodOperations.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Operations for zeroing POD types, arrays, and so on.\n *\n * These operations are preferable to memset, memcmp, and the like because they\n * don't require remembering to multiply by sizeof(T), array lengths, and so on\n * everywhere.\n */\n\n#ifndef mozilla_PodOperations_h\n#define mozilla_PodOperations_h\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Util.h\"\n\n#include <string.h>\n\nnamespace mozilla {\n\n/** Set the contents of |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t)\n{\n  memset(t, 0, sizeof(T));\n}\n\n/** Set the contents of |nelem| elements starting at |t| to 0. */\ntemplate<typename T>\nstatic void\nPodZero(T* t, size_t nelem)\n{\n  /*\n   * This function is often called with 'nelem' small; we use an inline loop\n   * instead of calling 'memset' with a non-constant length.  The compiler\n   * should inline the memset call with constant size, though.\n   */\n  for (T* end = t + nelem; t < end; t++)\n    memset(t, 0, sizeof(T));\n}\n\n/*\n * Arrays implicitly convert to pointers to their first element, which is\n * dangerous when combined with the above PodZero definitions.  Adding an\n * overload for arrays is ambiguous, so we need another identifier.  The\n * ambiguous overload is left to catch mistaken uses of PodZero; if you get a\n * compile error involving PodZero and array types, use PodArrayZero instead.\n */\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N]) MOZ_DELETE;\ntemplate<typename T, size_t N>\nstatic void PodZero(T (&t)[N], size_t nelem) MOZ_DELETE;\n\n/** Set the contents of the array |t| to zero. */\ntemplate <class T, size_t N>\nstatic void\nPodArrayZero(T (&t)[N])\n{\n  memset(t, 0, N * sizeof(T));\n}\n\n/**\n * Assign |*src| to |*dst|.  The locations must not be the same and must not\n * overlap.\n */\ntemplate<typename T>\nstatic void\nPodAssign(T* dst, const T* src)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= 1);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= 1);\n  memcpy(reinterpret_cast<char*>(dst), reinterpret_cast<const char*>(src), sizeof(T));\n}\n\n/**\n * Copy |nelem| T elements from |src| to |dst|.  The two memory ranges must not\n * overlap!\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(T* dst, const T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst, PointerRangeSize(src, static_cast<const T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src, PointerRangeSize(static_cast<const T*>(dst), src) >= nelem);\n\n  if (nelem < 128) {\n    /*\n     * Avoid using operator= in this loop, as it may have been\n     * intentionally deleted by the POD type.\n     */\n    for (const T* srcend = src + nelem; src < srcend; src++, dst++)\n      PodAssign(dst, src);\n  } else {\n    memcpy(dst, src, nelem * sizeof(T));\n  }\n}\n\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static void\nPodCopy(volatile T* dst, const volatile T* src, size_t nelem)\n{\n  MOZ_ASSERT(dst != src);\n  MOZ_ASSERT_IF(src < dst,\n                PointerRangeSize(src, static_cast<const volatile T*>(dst)) >= nelem);\n  MOZ_ASSERT_IF(dst < src,\n                PointerRangeSize(static_cast<const volatile T*>(dst), src) >= nelem);\n\n  /*\n   * Volatile |dst| requires extra work, because it's undefined behavior to\n   * modify volatile objects using the mem* functions.  Just write out the\n   * loops manually, using operator= rather than memcpy for the same reason,\n   * and let the compiler optimize to the extent it can.\n   */\n  for (const volatile T* srcend = src + nelem; src < srcend; src++, dst++)\n    *dst = *src;\n}\n\n/*\n * Copy the contents of the array |src| into the array |dst|, both of size N.\n * The arrays must not overlap!\n */\ntemplate <class T, size_t N>\nstatic void\nPodArrayCopy(T (&dst)[N], const T (&src)[N])\n{\n  PodCopy(dst, src, N);\n}\n\n/**\n * Determine whether the |len| elements at |one| are memory-identical to the\n * |len| elements at |two|.\n */\ntemplate<typename T>\nMOZ_ALWAYS_INLINE static bool\nPodEqual(const T* one, const T* two, size_t len)\n{\n  if (len < 128) {\n    const T* p1end = one + len;\n    const T* p1 = one;\n    const T* p2 = two;\n    for (; p1 < p1end; p1++, p2++) {\n      if (*p1 != *p2)\n        return false;\n    }\n    return true;\n  }\n\n  return !memcmp(one, two, len * sizeof(T));\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_PodOperations_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Poison.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * A poison value that can be used to fill a memory space with\n * an address that leads to a safe crash when dereferenced.\n */\n\n#ifndef mozilla_Poison_h\n#define mozilla_Poison_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Types.h\"\n\n#include <stdint.h>\n\nMOZ_BEGIN_EXTERN_C\n\nextern MFBT_DATA uintptr_t gMozillaPoisonValue;\n\n/**\n * @return the poison value.\n */\ninline uintptr_t mozPoisonValue()\n{\n  return gMozillaPoisonValue;\n}\n\n/**\n * Overwrite the memory block of aSize bytes at aPtr with the poison value.\n * aPtr MUST be aligned at a sizeof(uintptr_t) boundary.\n * Only an even number of sizeof(uintptr_t) bytes are overwritten, the last\n * few bytes (if any) is not overwritten.\n */\ninline void mozWritePoison(void* aPtr, size_t aSize)\n{\n  const uintptr_t POISON = mozPoisonValue();\n  char* p = (char*)aPtr;\n  char* limit = p + aSize;\n  MOZ_ASSERT((uintptr_t)aPtr % sizeof(uintptr_t) == 0, \"bad alignment\");\n  MOZ_ASSERT(aSize >= sizeof(uintptr_t), \"poisoning this object has no effect\");\n  for (; p < limit; p += sizeof(uintptr_t)) {\n    *((uintptr_t*)p) = POISON;\n  }\n}\n\n/**\n * Initialize the poison value.\n * This should only be called once.\n */\nextern MFBT_API void mozPoisonValueInit();\n\n/* Values annotated by CrashReporter */\nextern MFBT_DATA uintptr_t gMozillaPoisonBase;\nextern MFBT_DATA uintptr_t gMozillaPoisonSize;\n\nMOZ_END_EXTERN_C\n\n#endif /* mozilla_Poison_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Range.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#ifndef mozilla_Range_h\n#define mozilla_Range_h\n\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RangedPtr.h\"\n\n#include <stddef.h>\n\nnamespace mozilla {\n\n// Range<T> is a tuple containing a pointer and a length.\ntemplate <typename T>\nclass Range\n{\n    RangedPtr<T> mStart;\n    RangedPtr<T> mEnd;\n\n    typedef void (Range::* ConvertibleToBool)();\n    void nonNull() {}\n\n  public:\n    Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {}\n    Range(T* p, size_t len)\n      : mStart(p, p, p + len),\n        mEnd(p + len, p, p + len)\n    {}\n\n    RangedPtr<T> start() const { return mStart; }\n    RangedPtr<T> end() const { return mEnd; }\n    size_t length() const { return mEnd - mStart; }\n\n    T& operator[](size_t offset) {\n      return mStart[offset];\n    }\n\n    const T& operator[](size_t offset) const {\n      return mStart[offset];\n    }\n\n    operator ConvertibleToBool() const { return mStart ? &Range::nonNull : 0; }\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_Range_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/RangedPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Implements a smart pointer asserted to remain within a range specified at\n * construction.\n */\n\n#ifndef mozilla_RangedPtr_h\n#define mozilla_RangedPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/Util.h\"\n\nnamespace mozilla {\n\n/*\n * RangedPtr is a smart pointer restricted to an address range specified at\n * creation.  The pointer (and any smart pointers derived from it) must remain\n * within the range [start, end] (inclusive of end to facilitate use as\n * sentinels).  Dereferencing or indexing into the pointer (or pointers derived\n * from it) must remain within the range [start, end).  All the standard pointer\n * operators are defined on it; in debug builds these operations assert that the\n * range specified at construction is respected.\n *\n * In theory passing a smart pointer instance as an argument can be slightly\n * slower than passing a T* (due to ABI requirements for passing structs versus\n * passing pointers), if the method being called isn't inlined.  If you are in\n * extremely performance-critical code, you may want to be careful using this\n * smart pointer as an argument type.\n *\n * RangedPtr<T> intentionally does not implicitly convert to T*.  Use get() to\n * explicitly convert to T*.  Keep in mind that the raw pointer of course won't\n * implement bounds checking in debug builds.\n */\ntemplate<typename T>\nclass RangedPtr\n{\n    T* ptr;\n\n#ifdef DEBUG\n    T* const rangeStart;\n    T* const rangeEnd;\n#endif\n\n    typedef void (RangedPtr::* ConvertibleToBool)();\n    void nonNull() {}\n\n    void checkSanity() {\n      MOZ_ASSERT(rangeStart <= ptr);\n      MOZ_ASSERT(ptr <= rangeEnd);\n    }\n\n    /* Creates a new pointer for |p|, restricted to this pointer's range. */\n    RangedPtr<T> create(T *p) const {\n#ifdef DEBUG\n      return RangedPtr<T>(p, rangeStart, rangeEnd);\n#else\n      return RangedPtr<T>(p, nullptr, size_t(0));\n#endif\n    }\n\n    uintptr_t asUintptr() const { return uintptr_t(ptr); }\n\n  public:\n    RangedPtr(T* p, T* start, T* end)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(end)\n#endif\n    {\n      MOZ_ASSERT(rangeStart <= rangeEnd);\n      checkSanity();\n    }\n    RangedPtr(T* p, T* start, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(start), rangeEnd(start + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(p, p, length). */\n    RangedPtr(T* p, size_t length)\n      : ptr(p)\n#ifdef DEBUG\n      , rangeStart(p), rangeEnd(p + length)\n#endif\n    {\n      MOZ_ASSERT(length <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(uintptr_t(rangeStart) + length * sizeof(T) >= uintptr_t(rangeStart));\n      checkSanity();\n    }\n\n    /* Equivalent to RangedPtr(arr, arr, N). */\n    template<size_t N>\n    RangedPtr(T (&arr)[N])\n      : ptr(arr)\n#ifdef DEBUG\n      , rangeStart(arr), rangeEnd(arr + N)\n#endif\n    {\n      checkSanity();\n    }\n\n    T* get() const {\n      return ptr;\n    }\n\n    operator ConvertibleToBool() const { return ptr ? &RangedPtr::nonNull : 0; }\n\n    /*\n     * You can only assign one RangedPtr into another if the two pointers have\n     * the same valid range:\n     *\n     *   char arr1[] = \"hi\";\n     *   char arr2[] = \"bye\";\n     *   RangedPtr<char> p1(arr1, 2);\n     *   p1 = RangedPtr<char>(arr1 + 1, arr1, arr1 + 2); // works\n     *   p1 = RangedPtr<char>(arr2, 3);                  // asserts\n     */\n    RangedPtr<T>& operator=(const RangedPtr<T>& other) {\n      MOZ_ASSERT(rangeStart == other.rangeStart);\n      MOZ_ASSERT(rangeEnd == other.rangeEnd);\n      ptr = other.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T> operator+(size_t inc) {\n      MOZ_ASSERT(inc <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() + inc * sizeof(T) >= asUintptr());\n      return create(ptr + inc);\n    }\n\n    RangedPtr<T> operator-(size_t dec) {\n      MOZ_ASSERT(dec <= size_t(-1) / sizeof(T));\n      MOZ_ASSERT(asUintptr() - dec * sizeof(T) <= asUintptr());\n      return create(ptr - dec);\n    }\n\n    /*\n     * You can assign a raw pointer into a RangedPtr if the raw pointer is\n     * within the range specified at creation.\n     */\n    template <typename U>\n    RangedPtr<T>& operator=(U* p) {\n      *this = create(p);\n      return *this;\n    }\n\n    template <typename U>\n    RangedPtr<T>& operator=(const RangedPtr<U>& p) {\n      MOZ_ASSERT(rangeStart <= p.ptr);\n      MOZ_ASSERT(p.ptr <= rangeEnd);\n      ptr = p.ptr;\n      checkSanity();\n      return *this;\n    }\n\n    RangedPtr<T>& operator++() {\n      return (*this += 1);\n    }\n\n    RangedPtr<T> operator++(int) {\n      RangedPtr<T> rcp = *this;\n      ++*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator--() {\n      return (*this -= 1);\n    }\n\n    RangedPtr<T> operator--(int) {\n      RangedPtr<T> rcp = *this;\n      --*this;\n      return rcp;\n    }\n\n    RangedPtr<T>& operator+=(size_t inc) {\n      *this = *this + inc;\n      return *this;\n    }\n\n    RangedPtr<T>& operator-=(size_t dec) {\n      *this = *this - dec;\n      return *this;\n    }\n\n    T& operator[](int index) const {\n      MOZ_ASSERT(size_t(index > 0 ? index : -index) <= size_t(-1) / sizeof(T));\n      return *create(ptr + index);\n    }\n\n    T& operator*() const {\n      return *ptr;\n    }\n\n    template <typename U>\n    bool operator==(const RangedPtr<U>& other) const {\n      return ptr == other.ptr;\n    }\n    template <typename U>\n    bool operator!=(const RangedPtr<U>& other) const {\n      return !(*this == other);\n    }\n\n    template<typename U>\n    bool operator==(const U* u) const {\n      return ptr == u;\n    }\n    template<typename U>\n    bool operator!=(const U* u) const {\n      return !(*this == u);\n    }\n\n    template <typename U>\n    bool operator<(const RangedPtr<U>& other) const {\n      return ptr < other.ptr;\n    }\n    template <typename U>\n    bool operator<=(const RangedPtr<U>& other) const {\n      return ptr <= other.ptr;\n    }\n\n    template <typename U>\n    bool operator>(const RangedPtr<U>& other) const {\n      return ptr > other.ptr;\n    }\n    template <typename U>\n    bool operator>=(const RangedPtr<U>& other) const {\n      return ptr >= other.ptr;\n    }\n\n    size_t operator-(const RangedPtr<T>& other) const {\n      MOZ_ASSERT(ptr >= other.ptr);\n      return PointerRangeSize(other.ptr, ptr);\n    }\n\n  private:\n    RangedPtr() MOZ_DELETE;\n    T* operator&() MOZ_DELETE;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_RangedPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/ReentrancyGuard.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Small helper class for asserting uses of a class are non-reentrant. */\n\n#ifndef mozilla_ReentrancyGuard_h\n#define mozilla_ReentrancyGuard_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n\nnamespace mozilla {\n\n/* Useful for implementing containers that assert non-reentrancy */\nclass ReentrancyGuard\n{\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n#ifdef DEBUG\n    bool& entered;\n#endif\n\n  public:\n    template<class T>\n#ifdef DEBUG\n    ReentrancyGuard(T& obj\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : entered(obj.entered)\n#else\n    ReentrancyGuard(T&\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n#endif\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n#ifdef DEBUG\n      MOZ_ASSERT(!entered);\n      entered = true;\n#endif\n    }\n    ~ReentrancyGuard()\n    {\n#ifdef DEBUG\n      entered = false;\n#endif\n    }\n\n  private:\n    ReentrancyGuard(const ReentrancyGuard&) MOZ_DELETE;\n    void operator=(const ReentrancyGuard&) MOZ_DELETE;\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_ReentrancyGuard_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/RefPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Helpers for defining and using refcounted objects. */\n\n#ifndef mozilla_RefPtr_h\n#define mozilla_RefPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate<typename T> class RefCounted;\ntemplate<typename T> class RefPtr;\ntemplate<typename T> class TemporaryRef;\ntemplate<typename T> class OutParamRef;\ntemplate<typename T> OutParamRef<T> byRef(RefPtr<T>&);\n\n/**\n * RefCounted<T> is a sort of a \"mixin\" for a class T.  RefCounted\n * manages, well, refcounting for T, and because RefCounted is\n * parameterized on T, RefCounted<T> can call T's destructor directly.\n * This means T doesn't need to have a virtual dtor and so doesn't\n * need a vtable.\n *\n * RefCounted<T> is created with refcount == 0.  Newly-allocated\n * RefCounted<T> must immediately be assigned to a RefPtr to make the\n * refcount > 0.  It's an error to allocate and free a bare\n * RefCounted<T>, i.e. outside of the RefPtr machinery.  Attempts to\n * do so will abort DEBUG builds.\n *\n * Live RefCounted<T> have refcount > 0.  The lifetime (refcounts) of\n * live RefCounted<T> are controlled by RefPtr<T> and\n * RefPtr<super/subclass of T>.  Upon a transition from refcounted==1\n * to 0, the RefCounted<T> \"dies\" and is destroyed.  The \"destroyed\"\n * state is represented in DEBUG builds by refcount==0xffffdead.  This\n * state distinguishes use-before-ref (refcount==0) from\n * use-after-destroy (refcount==0xffffdead).\n */\nnamespace detail {\n#ifdef DEBUG\nstatic const int DEAD = 0xffffdead;\n#endif\n\n// This is used WeakPtr.h as well as this file.\nenum RefCountAtomicity\n{\n  AtomicRefCount,\n  NonAtomicRefCount\n};\n\ntemplate<typename T, RefCountAtomicity Atomicity>\nclass RefCounted\n{\n    friend class RefPtr<T>;\n\n  protected:\n    RefCounted() : refCnt(0) { }\n    ~RefCounted() {\n      MOZ_ASSERT(refCnt == detail::DEAD);\n    }\n\n  public:\n    // Compatibility with nsRefPtr.\n    void AddRef() {\n      MOZ_ASSERT(refCnt >= 0);\n      ++refCnt;\n    }\n\n    void Release() {\n      MOZ_ASSERT(refCnt > 0);\n      if (0 == --refCnt) {\n#ifdef DEBUG\n        refCnt = detail::DEAD;\n#endif\n        delete static_cast<T*>(this);\n      }\n    }\n\n    // Compatibility with wtf::RefPtr.\n    void ref() { AddRef(); }\n    void deref() { Release(); }\n    int refCount() const { return refCnt; }\n    bool hasOneRef() const {\n      MOZ_ASSERT(refCnt > 0);\n      return refCnt == 1;\n    }\n\n  private:\n    typename Conditional<Atomicity == AtomicRefCount, Atomic<int>, int>::Type refCnt;\n};\n\n}\n\ntemplate<typename T>\nclass RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>\n{\n  public:\n    ~RefCounted() {\n      static_assert(IsBaseOf<RefCounted, T>::value,\n                    \"T must derive from RefCounted<T>\");\n    }\n};\n\n/**\n * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated\n * reference counter.\n */\ntemplate<typename T>\nclass AtomicRefCounted : public detail::RefCounted<T, detail::AtomicRefCount>\n{\n  public:\n    ~AtomicRefCounted() {\n      static_assert(IsBaseOf<AtomicRefCounted, T>::value,\n                    \"T must derive from AtomicRefCounted<T>\");\n    }\n};\n\n/**\n * RefPtr points to a refcounted thing that has AddRef and Release\n * methods to increase/decrease the refcount, respectively.  After a\n * RefPtr<T> is assigned a T*, the T* can be used through the RefPtr\n * as if it were a T*.\n *\n * A RefPtr can forget its underlying T*, which results in the T*\n * being wrapped in a temporary object until the T* is either\n * re-adopted from or released by the temporary.\n */\ntemplate<typename T>\nclass RefPtr\n{\n    // To allow them to use unref()\n    friend class TemporaryRef<T>;\n    friend class OutParamRef<T>;\n\n    struct DontRef {};\n\n  public:\n    RefPtr() : ptr(0) { }\n    RefPtr(const RefPtr& o) : ptr(ref(o.ptr)) {}\n    RefPtr(const TemporaryRef<T>& o) : ptr(o.drop()) {}\n    RefPtr(T* t) : ptr(ref(t)) {}\n\n    template<typename U>\n    RefPtr(const RefPtr<U>& o) : ptr(ref(o.get())) {}\n\n    ~RefPtr() { unref(ptr); }\n\n    RefPtr& operator=(const RefPtr& o) {\n      assign(ref(o.ptr));\n      return *this;\n    }\n    RefPtr& operator=(const TemporaryRef<T>& o) {\n      assign(o.drop());\n      return *this;\n    }\n    RefPtr& operator=(T* t) {\n      assign(ref(t));\n      return *this;\n    }\n\n    template<typename U>\n    RefPtr& operator=(const RefPtr<U>& o) {\n      assign(ref(o.get()));\n      return *this;\n    }\n\n    TemporaryRef<T> forget() {\n      T* tmp = ptr;\n      ptr = 0;\n      return TemporaryRef<T>(tmp, DontRef());\n    }\n\n    T* get() const { return ptr; }\n    operator T*() const { return ptr; }\n    T* operator->() const { return ptr; }\n    T& operator*() const { return *ptr; }\n    template<typename U>\n    operator TemporaryRef<U>() { return TemporaryRef<U>(ptr); }\n\n  private:\n    void assign(T* t) {\n      unref(ptr);\n      ptr = t;\n    }\n\n    T* ptr;\n\n    static MOZ_ALWAYS_INLINE T* ref(T* t) {\n      if (t)\n        t->AddRef();\n      return t;\n    }\n\n    static MOZ_ALWAYS_INLINE void unref(T* t) {\n      if (t)\n        t->Release();\n    }\n};\n\n/**\n * TemporaryRef<T> represents an object that holds a temporary\n * reference to a T.  TemporaryRef objects can't be manually ref'd or\n * unref'd (being temporaries, not lvalues), so can only relinquish\n * references to other objects, or unref on destruction.\n */\ntemplate<typename T>\nclass TemporaryRef\n{\n    // To allow it to construct TemporaryRef from a bare T*\n    friend class RefPtr<T>;\n\n    typedef typename RefPtr<T>::DontRef DontRef;\n\n  public:\n    TemporaryRef(T* t) : ptr(RefPtr<T>::ref(t)) {}\n    TemporaryRef(const TemporaryRef& o) : ptr(o.drop()) {}\n\n    template<typename U>\n    TemporaryRef(const TemporaryRef<U>& o) : ptr(o.drop()) {}\n\n    ~TemporaryRef() { RefPtr<T>::unref(ptr); }\n\n    T* drop() const {\n      T* tmp = ptr;\n      ptr = 0;\n      return tmp;\n    }\n\n  private:\n    TemporaryRef(T* t, const DontRef&) : ptr(t) {}\n\n    mutable T* ptr;\n\n    TemporaryRef() MOZ_DELETE;\n    void operator=(const TemporaryRef&) MOZ_DELETE;\n};\n\n/**\n * OutParamRef is a wrapper that tracks a refcounted pointer passed as\n * an outparam argument to a function.  OutParamRef implements COM T**\n * outparam semantics: this requires the callee to AddRef() the T*\n * returned through the T** outparam on behalf of the caller.  This\n * means the caller (through OutParamRef) must Release() the old\n * object contained in the tracked RefPtr.  It's OK if the callee\n * returns the same T* passed to it through the T** outparam, as long\n * as the callee obeys the COM discipline.\n *\n * Prefer returning TemporaryRef<T> from functions over creating T**\n * outparams and passing OutParamRef<T> to T**.  Prefer RefPtr<T>*\n * outparams over T** outparams.\n */\ntemplate<typename T>\nclass OutParamRef\n{\n    friend OutParamRef byRef<T>(RefPtr<T>&);\n\n  public:\n    ~OutParamRef() {\n      RefPtr<T>::unref(refPtr.ptr);\n      refPtr.ptr = tmp;\n    }\n\n    operator T**() { return &tmp; }\n\n  private:\n    OutParamRef(RefPtr<T>& p) : refPtr(p), tmp(p.get()) {}\n\n    RefPtr<T>& refPtr;\n    T* tmp;\n\n    OutParamRef() MOZ_DELETE;\n    OutParamRef& operator=(const OutParamRef&) MOZ_DELETE;\n};\n\n/**\n * byRef cooperates with OutParamRef to implement COM outparam semantics.\n */\ntemplate<typename T>\nOutParamRef<T>\nbyRef(RefPtr<T>& ptr)\n{\n  return OutParamRef<T>(ptr);\n}\n\n} // namespace mozilla\n\n#if 0\n\n// Command line that builds these tests\n//\n//   cp RefPtr.h test.cc && g++ -g -Wall -pedantic -DDEBUG -o test test.cc && ./test\n\nusing namespace mozilla;\n\nstruct Foo : public RefCounted<Foo>\n{\n  Foo() : dead(false) { }\n  ~Foo() {\n    MOZ_ASSERT(!dead);\n    dead = true;\n    numDestroyed++;\n  }\n\n  bool dead;\n  static int numDestroyed;\n};\nint Foo::numDestroyed;\n\nstruct Bar : public Foo { };\n\nTemporaryRef<Foo>\nNewFoo()\n{\n  return RefPtr<Foo>(new Foo());\n}\n\nTemporaryRef<Foo>\nNewBar()\n{\n  return new Bar();\n}\n\nvoid\nGetNewFoo(Foo** f)\n{\n  *f = new Bar();\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetPassedFoo(Foo** f)\n{\n  // Kids, don't try this at home\n  (*f)->AddRef();\n}\n\nvoid\nGetNewFoo(RefPtr<Foo>* f)\n{\n  *f = new Bar();\n}\n\nvoid\nGetPassedFoo(RefPtr<Foo>* f)\n{}\n\nTemporaryRef<Foo>\nGetNullFoo()\n{\n  return 0;\n}\n\nint\nmain(int argc, char** argv)\n{\n  // This should blow up\n//    Foo* f = new Foo(); delete f;\n\n  MOZ_ASSERT(0 == Foo::numDestroyed);\n  {\n    RefPtr<Foo> f = new Foo();\n    MOZ_ASSERT(f->refCount() == 1);\n  }\n  MOZ_ASSERT(1 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = NewFoo();\n    RefPtr<Foo> f2(NewFoo());\n    MOZ_ASSERT(1 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(3 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> b = NewBar();\n    MOZ_ASSERT(3 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(4 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1;\n    {\n      f1 = new Foo();\n      RefPtr<Foo> f2(f1);\n      RefPtr<Foo> f3 = f2;\n      MOZ_ASSERT(4 == Foo::numDestroyed);\n    }\n    MOZ_ASSERT(4 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(5 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    f.forget();\n    MOZ_ASSERT(6 == Foo::numDestroyed);\n  }\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(byRef(f));\n    MOZ_ASSERT(7 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(8 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(byRef(f));\n    MOZ_ASSERT(8 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(9 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetNewFoo(&f);\n    MOZ_ASSERT(10 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(11 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = new Foo();\n    GetPassedFoo(&f);\n    MOZ_ASSERT(11 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(12 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f1 = new Bar();\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  {\n    RefPtr<Foo> f = GetNullFoo();\n    MOZ_ASSERT(13 == Foo::numDestroyed);\n  }\n  MOZ_ASSERT(13 == Foo::numDestroyed);\n\n  return 0;\n}\n\n#endif\n\n#endif /* mozilla_RefPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/SHA1.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Simple class for computing SHA1. */\n\n#ifndef mozilla_SHA1_h\n#define mozilla_SHA1_h\n\n#include \"mozilla/Types.h\"\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace mozilla {\n\n/**\n * This class computes the SHA1 hash of a byte sequence, or of the concatenation\n * of multiple sequences.  For example, computing the SHA1 of two sequences of\n * bytes could be done as follows:\n *\n *   void SHA1(const uint8_t* buf1, uint32_t size1,\n *             const uint8_t* buf2, uint32_t size2,\n *             SHA1Sum::Hash& hash)\n *   {\n *     SHA1Sum s;\n *     s.update(buf1, size1);\n *     s.update(buf2, size2);\n *     s.finish(hash);\n *   }\n *\n * The finish method may only be called once and cannot be followed by calls\n * to update.\n */\nclass SHA1Sum\n{\n    union {\n        uint32_t w[16]; /* input buffer */\n        uint8_t b[64];\n    } u;\n    uint64_t size; /* count of hashed bytes. */\n    unsigned H[22]; /* 5 state variables, 16 tmp values, 1 extra */\n    bool mDone;\n\n  public:\n    MFBT_API SHA1Sum();\n\n    static const size_t HashSize = 20;\n    typedef uint8_t Hash[HashSize];\n\n    /* Add len bytes of dataIn to the data sequence being hashed. */\n    MFBT_API void update(const void* dataIn, uint32_t len);\n\n    /* Compute the final hash of all data into hashOut. */\n    MFBT_API void finish(SHA1Sum::Hash& hashOut);\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_SHA1_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Scoped.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A number of structures to simplify scope-based RAII management. */\n\n#ifndef mozilla_Scoped_h\n#define mozilla_Scoped_h\n\n/*\n * Resource Acquisition Is Initialization is a programming idiom used\n * to write robust code that is able to deallocate resources properly,\n * even in presence of execution errors or exceptions that need to be\n * propagated.  The Scoped* classes defined in this header perform the\n * deallocation of the resource they hold once program execution\n * reaches the end of the scope for which they have been defined.\n *\n * This header provides the following RAII classes:\n *\n * - |ScopedFreePtr| - a container for a pointer, that automatically calls\n *   |free()| at the end of the scope;\n * - |ScopedDeletePtr| - a container for a pointer, that automatically calls\n *   |delete| at the end of the scope;\n * - |ScopedDeleteArray| - a container for a pointer to an array, that\n *   automatically calls |delete[]| at the end of the scope.\n *\n * The general scenario for each of the RAII classes is the following:\n *\n * ScopedClass foo(create_value());\n * // ... In this scope, |foo| is defined. Use |foo.get()| or |foo.rwget()|\n *        to access the value.\n * // ... In case of |return| or |throw|, |foo| is deallocated automatically.\n * // ... If |foo| needs to be returned or stored, use |foo.forget()|\n *\n * Note that the RAII classes defined in this header do _not_ perform any form\n * of reference-counting or garbage-collection. These classes have exactly two\n * behaviors:\n *\n * - if |forget()| has not been called, the resource is always deallocated at\n *   the end of the scope;\n * - if |forget()| has been called, any control on the resource is unbound\n *   and the resource is not deallocated by the class.\n *\n * Extension:\n *\n * In addition, this header provides class |Scoped| and macros |SCOPED_TEMPLATE|\n * and |MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE|  to simplify the definition\n * of RAII classes for other scenarios. These macros have been used to\n * automatically close file descriptors/file handles when reaching the end of\n * the scope, graphics contexts, etc.\n */\n\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/GuardObjects.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n/*\n * Scoped is a helper to create RAII wrappers\n * Type argument |Traits| is expected to have the following structure:\n *\n *   struct Traits {\n *     // Define the type of the value stored in the wrapper\n *     typedef value_type type;\n *     // Returns the value corresponding to the uninitialized or freed state\n *     const static type empty();\n *     // Release resources corresponding to the wrapped value\n *     // This function is responsible for not releasing an |empty| value\n *     const static void release(type);\n *   }\n */\ntemplate<typename Traits>\nclass Scoped\n{\n  public:\n    typedef typename Traits::type Resource;\n\n    explicit Scoped(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)\n      : value(Traits::empty())\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    explicit Scoped(const Resource& v\n                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)\n      : value(v)\n    {\n      MOZ_GUARD_OBJECT_NOTIFIER_INIT;\n    }\n    ~Scoped() {\n      Traits::release(value);\n    }\n\n    // Constant getter\n    operator const Resource&() const { return value; }\n    const Resource& operator->() const { return value; }\n    const Resource& get() const { return value; }\n    // Non-constant getter.\n    Resource& rwget() { return value; }\n\n    /*\n     * Forget the resource.\n     *\n     * Once |forget| has been called, the |Scoped| is neutralized, i.e. it will\n     * have no effect at destruction (unless it is reset to another resource by\n     * |operator=|).\n     *\n     * @return The original resource.\n     */\n    Resource forget() {\n      Resource tmp = value;\n      value = Traits::empty();\n      return tmp;\n    }\n\n    /*\n     * Perform immediate clean-up of this |Scoped|.\n     *\n     * If this |Scoped| is currently empty, this method has no effect.\n     */\n    void dispose() {\n      Traits::release(value);\n      value = Traits::empty();\n    }\n\n    bool operator==(const Resource& other) const {\n      return value == other;\n    }\n\n    /*\n     * Replace the resource with another resource.\n     *\n     * Calling |operator=| has the side-effect of triggering clean-up. If you do\n     * not want to trigger clean-up, you should first invoke |forget|.\n     *\n     * @return this\n     */\n    Scoped<Traits>& operator=(const Resource& other) {\n      return reset(other);\n    }\n    Scoped<Traits>& reset(const Resource& other) {\n      Traits::release(value);\n      value = other;\n      return *this;\n    }\n\n  private:\n    explicit Scoped(const Scoped<Traits>& value) MOZ_DELETE;\n    Scoped<Traits>& operator=(const Scoped<Traits>& value) MOZ_DELETE;\n\n  private:\n    Resource value;\n    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER\n};\n\n/*\n * SCOPED_TEMPLATE defines a templated class derived from Scoped\n * This allows to implement templates such as ScopedFreePtr.\n *\n * @param name The name of the class to define.\n * @param Traits A struct implementing clean-up. See the implementations\n * for more details.\n */\n#define SCOPED_TEMPLATE(name, Traits)                          \\\ntemplate<typename Type>                                        \\\nstruct name : public mozilla::Scoped<Traits<Type> >            \\\n{                                                              \\\n    typedef mozilla::Scoped<Traits<Type> > Super;              \\\n    typedef typename Super::Resource Resource;                 \\\n    name& operator=(Resource ptr) {                            \\\n      Super::operator=(ptr);                                   \\\n      return *this;                                            \\\n    }                                                          \\\n    explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)        \\\n      : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)  \\\n    {}                                                         \\\n    explicit name(Resource ptr                                 \\\n                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)             \\\n      : Super(ptr MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)   \\\n    {}                                                         \\\n  private:                                                     \\\n    explicit name(name& source) MOZ_DELETE;                    \\\n    name& operator=(name& source) MOZ_DELETE;                  \\\n};\n\n/*\n * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d.\n *\n *   struct S { ... };\n *   ScopedFreePtr<S> foo = malloc(sizeof(S));\n *   ScopedFreePtr<char> bar = strdup(str);\n */\ntemplate<typename T>\nstruct ScopedFreePtrTraits\n{\n    typedef T* type;\n    static T* empty() { return nullptr; }\n    static void release(T* ptr) { free(ptr); }\n};\nSCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)\n\n/*\n * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.\n *\n *   struct S { ... };\n *   ScopedDeletePtr<S> foo = new S();\n */\ntemplate<typename T>\nstruct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeletePtr, ScopedDeletePtrTraits)\n\n/*\n * ScopedDeleteArray is a RAII wrapper for pointers that need to be delete[]ed.\n *\n *   struct S { ... };\n *   ScopedDeleteArray<S> foo = new S[42];\n */\ntemplate<typename T>\nstruct ScopedDeleteArrayTraits : public ScopedFreePtrTraits<T>\n{\n    static void release(T* ptr) { delete [] ptr; }\n};\nSCOPED_TEMPLATE(ScopedDeleteArray, ScopedDeleteArrayTraits)\n\n/*\n * MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE makes it easy to create scoped\n * pointers for types with custom deleters; just overload\n * TypeSpecificDelete(T*) in the same namespace as T to call the deleter for\n * type T.\n *\n * @param name The name of the class to define.\n * @param Type A struct implementing clean-up. See the implementations\n * for more details.\n * *param Deleter The function that is used to delete/destroy/free a\n *        non-null value of Type*.\n *\n * Example:\n *\n *   MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \\\n *                                             PR_Close)\n *   ...\n *   {\n *       ScopedPRFileDesc file(PR_OpenFile(...));\n *       ...\n *   } // file is closed with PR_Close here\n */\n#define MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(name, Type, Deleter) \\\ntemplate <> inline void TypeSpecificDelete(Type * value) { Deleter(value); } \\\ntypedef ::mozilla::TypeSpecificScopedPointer<Type> name;\n\ntemplate <typename T> void TypeSpecificDelete(T * value);\n\ntemplate <typename T>\nstruct TypeSpecificScopedPointerTraits\n{\n    typedef T* type;\n    const static type empty() { return nullptr; }\n    const static void release(type value)\n    {\n      if (value)\n        TypeSpecificDelete(value);\n    }\n};\n\nSCOPED_TEMPLATE(TypeSpecificScopedPointer, TypeSpecificScopedPointerTraits)\n\n} /* namespace mozilla */\n\n#endif /* mozilla_Scoped_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/SplayTree.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/**\n * A sorted tree with optimal access times, where recently-accessed elements\n * are faster to access again.\n */\n\n#ifndef mozilla_SplayTree_h\n#define mozilla_SplayTree_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\ntemplate<class T, class C>\nclass SplayTree;\n\ntemplate<typename T>\nclass SplayTreeNode\n{\n  public:\n    template<class A, class B>\n    friend class SplayTree;\n\n    SplayTreeNode()\n      : left(nullptr), right(nullptr), parent(nullptr)\n    {}\n\n  private:\n    T* left;\n    T* right;\n    T* parent;\n};\n\n\n/**\n * Class which represents a splay tree.\n * Splay trees are balanced binary search trees for which search, insert and\n * remove are all amortized O(log n), but where accessing a node makes it\n * faster to access that node in the future.\n *\n * T indicates the type of tree elements, Comparator must have a static\n * compare(const T&, const T&) method ordering the elements. The compare\n * method must be free from side effects.\n */\ntemplate<typename T, class Comparator>\nclass SplayTree\n{\n    T* root;\n    T* freeList;\n\n  public:\n    SplayTree()\n      : root(nullptr), freeList(nullptr)\n    {}\n\n    bool empty() const {\n      return !root;\n    }\n\n    bool contains(const T& v)\n    {\n      if (empty())\n        return false;\n\n      T* last = lookup(v);\n      splay(last);\n      checkCoherency(root, nullptr);\n      return Comparator::compare(v, *last) == 0;\n    }\n\n    bool insert(T* v)\n    {\n      MOZ_ASSERT(!contains(*v), \"Duplicate elements are not allowed.\");\n\n      if (!root) {\n        root = v;\n        return true;\n      }\n      T* last = lookup(*v);\n      int cmp = Comparator::compare(*v, *last);\n\n      T** parentPointer = (cmp < 0) ? &last->left : &last->right;\n      MOZ_ASSERT(!*parentPointer);\n      *parentPointer = v;\n      v->parent = last;\n\n      splay(v);\n      checkCoherency(root, nullptr);\n      return true;\n    }\n\n    T* remove(const T& v)\n    {\n      T* last = lookup(v);\n      MOZ_ASSERT(last, \"This tree must contain the element being removed.\");\n      MOZ_ASSERT(Comparator::compare(v, *last) == 0);\n\n      // Splay the tree so that the item to remove is the root.\n      splay(last);\n      MOZ_ASSERT(last == root);\n\n      // Find another node which can be swapped in for the root: either the\n      // rightmost child of the root's left, or the leftmost child of the\n      // root's right.\n      T* swap;\n      T* swapChild;\n      if (root->left) {\n        swap = root->left;\n        while (swap->right)\n          swap = swap->right;\n        swapChild = swap->left;\n      } else if (root->right) {\n        swap = root->right;\n        while (swap->left)\n          swap = swap->left;\n        swapChild = swap->right;\n      } else {\n        T* result = root;\n        root = nullptr;\n        return result;\n      }\n\n      // The selected node has at most one child, in swapChild. Detach it\n      // from the subtree by replacing it with that child.\n      if (swap == swap->parent->left)\n        swap->parent->left = swapChild;\n      else\n        swap->parent->right = swapChild;\n      if (swapChild)\n        swapChild->parent = swap->parent;\n\n      // Make the selected node the new root.\n      root = swap;\n      root->parent = nullptr;\n      root->left = last->left;\n      root->right = last->right;\n      if (root->left) {\n        root->left->parent = root;\n      }\n      if (root->right) {\n        root->right->parent = root;\n      }\n\n      checkCoherency(root, nullptr);\n      return last;\n    }\n\n    T* removeMin()\n    {\n      MOZ_ASSERT(root, \"No min to remove!\");\n\n      T* min = root;\n      while (min->left)\n        min = min->left;\n      return remove(*min);\n    }\n\n  private:\n    /**\n     * Returns the node in this comparing equal to |v|, or a node just greater or\n     * just less than |v| if there is no such node.\n     */\n    T* lookup(const T& v)\n    {\n      MOZ_ASSERT(!empty());\n\n      T* node = root;\n      T* parent;\n      do {\n        parent = node;\n        int c = Comparator::compare(v, *node);\n        if (c == 0)\n          return node;\n        else if (c < 0)\n          node = node->left;\n        else\n          node = node->right;\n      } while (node);\n      return parent;\n    }\n\n    /**\n     * Rotate the tree until |node| is at the root of the tree. Performing\n     * the rotations in this fashion preserves the amortized balancing of\n     * the tree.\n     */\n    void splay(T* node)\n    {\n      MOZ_ASSERT(node);\n\n      while (node != root) {\n        T* parent = node->parent;\n        if (parent == root) {\n          // Zig rotation.\n          rotate(node);\n          MOZ_ASSERT(node == root);\n          return;\n        }\n        T* grandparent = parent->parent;\n        if ((parent->left == node) == (grandparent->left == parent)) {\n          // Zig-zig rotation.\n          rotate(parent);\n          rotate(node);\n        } else {\n          // Zig-zag rotation.\n          rotate(node);\n          rotate(node);\n        }\n      }\n    }\n\n    void rotate(T* node)\n    {\n      // Rearrange nodes so that node becomes the parent of its current\n      // parent, while preserving the sortedness of the tree.\n      T* parent = node->parent;\n      if (parent->left == node) {\n        //     x          y\n        //   y  c  ==>  a  x\n        //  a b           b c\n        parent->left = node->right;\n        if (node->right)\n          node->right->parent = parent;\n        node->right = parent;\n      } else {\n        MOZ_ASSERT(parent->right == node);\n        //   x             y\n        //  a  y   ==>   x  c\n        //    b c       a b\n        parent->right = node->left;\n        if (node->left)\n          node->left->parent = parent;\n        node->left = parent;\n      }\n      node->parent = parent->parent;\n      parent->parent = node;\n      if (T* grandparent = node->parent) {\n        if (grandparent->left == parent)\n          grandparent->left = node;\n        else\n          grandparent->right = node;\n      } else {\n        root = node;\n      }\n    }\n\n    T* checkCoherency(T* node, T* minimum)\n    {\n#ifdef DEBUG\n      MOZ_ASSERT_IF(root, !root->parent);\n      if (!node) {\n        MOZ_ASSERT(!root);\n        return nullptr;\n      }\n      MOZ_ASSERT_IF(!node->parent, node == root);\n      MOZ_ASSERT_IF(minimum, Comparator::compare(*minimum, *node) < 0);\n      if (node->left) {\n        MOZ_ASSERT(node->left->parent == node);\n        T* leftMaximum = checkCoherency(node->left, minimum);\n        MOZ_ASSERT(Comparator::compare(*leftMaximum, *node) < 0);\n      }\n      if (node->right) {\n        MOZ_ASSERT(node->right->parent == node);\n        return checkCoherency(node->right, node);\n      }\n      return node;\n#else\n      return nullptr;\n#endif\n    }\n\n    SplayTree(const SplayTree&) MOZ_DELETE;\n    void operator=(const SplayTree&) MOZ_DELETE;\n};\n\n}  /* namespace mozilla */\n\n#endif /* mozilla_SplayTree_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/TemplateLib.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Reusable template meta-functions on types and compile-time values.  Meta-\n * functions are placed inside the 'tl' namespace to avoid conflict with non-\n * meta functions of the same name (e.g., mozilla::tl::FloorLog2 vs.\n * mozilla::FloorLog2).\n *\n * When constexpr support becomes universal, we should probably use that instead\n * of some of these templates, for simplicity.\n */\n\n#ifndef mozilla_TemplateLib_h\n#define mozilla_TemplateLib_h\n\n#include <limits.h>\n#include <stddef.h>\n\nnamespace mozilla {\n\nnamespace tl {\n\n/** Compute min/max. */\ntemplate<size_t I, size_t J>\nstruct Min\n{\n    static const size_t value = I < J ? I : J;\n};\ntemplate<size_t I, size_t J>\nstruct Max\n{\n    static const size_t value = I > J ? I : J;\n};\n\n/** Compute floor(log2(i)). */\ntemplate<size_t I>\nstruct FloorLog2\n{\n    static const size_t value = 1 + FloorLog2<I / 2>::value;\n};\ntemplate<> struct FloorLog2<0> { /* Error */ };\ntemplate<> struct FloorLog2<1> { static const size_t value = 0; };\n\n/** Compute ceiling(log2(i)). */\ntemplate<size_t I>\nstruct CeilingLog2\n{\n    static const size_t value = FloorLog2<2 * I - 1>::value;\n};\n\n/** Round up to the nearest power of 2. */\ntemplate<size_t I>\nstruct RoundUpPow2\n{\n    static const size_t value = size_t(1) << CeilingLog2<I>::value;\n};\ntemplate<>\nstruct RoundUpPow2<0>\n{\n    static const size_t value = 1;\n};\n\n/** Compute the number of bits in the given unsigned type. */\ntemplate<typename T>\nstruct BitSize\n{\n    static const size_t value = sizeof(T) * CHAR_BIT;\n};\n\n/**\n * Produce an N-bit mask, where N <= BitSize<size_t>::value.  Handle the\n * language-undefined edge case when N = BitSize<size_t>::value.\n */\ntemplate<size_t N>\nstruct NBitMask\n{\n    // Assert the precondition.  On success this evaluates to 0.  Otherwise it\n    // triggers divide-by-zero at compile time: a guaranteed compile error in\n    // C++11, and usually one in C++98.  Add this value to |value| to assure\n    // its computation.\n    static const size_t checkPrecondition = 0 / size_t(N < BitSize<size_t>::value);\n    static const size_t value = (size_t(1) << N) - 1 + checkPrecondition;\n};\ntemplate<>\nstruct NBitMask<BitSize<size_t>::value>\n{\n    static const size_t value = size_t(-1);\n};\n\n/**\n * For the unsigned integral type size_t, compute a mask M for N such that\n * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t)\n */\ntemplate<size_t N>\nstruct MulOverflowMask\n{\n    static const size_t value =\n      ~NBitMask<BitSize<size_t>::value - CeilingLog2<N>::value>::value;\n};\ntemplate<> struct MulOverflowMask<0> { /* Error */ };\ntemplate<> struct MulOverflowMask<1> { static const size_t value = 0; };\n\n} // namespace tl\n\n} // namespace mozilla\n\n#endif /* mozilla_TemplateLib_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/ThreadLocal.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Cross-platform lightweight thread local data wrappers. */\n\n#ifndef mozilla_ThreadLocal_h\n#define mozilla_ThreadLocal_h\n\n#if defined(XP_WIN)\n// This file will get included in any file that wants to add a profiler mark.\n// In order to not bring <windows.h> together we could include windef.h and\n// winbase.h which are sufficient to get the prototypes for the Tls* functions.\n// # include <windef.h>\n// # include <winbase.h>\n// Unfortunately, even including these headers causes us to add a bunch of ugly\n// stuff to our namespace e.g #define CreateEvent CreateEventW\nextern \"C\" {\n__declspec(dllimport) void* __stdcall TlsGetValue(unsigned long);\n__declspec(dllimport) int __stdcall TlsSetValue(unsigned long, void*);\n__declspec(dllimport) unsigned long __stdcall TlsAlloc();\n}\n#else\n#  include <pthread.h>\n#  include <signal.h>\n#endif\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/NullPtr.h\"\n\nnamespace mozilla {\n\n// sig_safe_t denotes an atomic type which can be read or stored in a single\n// instruction.  This means that data of this type is safe to be manipulated\n// from a signal handler, or other similar asynchronous execution contexts.\n#if defined(XP_WIN)\ntypedef unsigned long sig_safe_t;\n#else\ntypedef sig_atomic_t sig_safe_t;\n#endif\n\n/*\n * Thread Local Storage helpers.\n *\n * Usage:\n *\n * Only static-storage-duration (e.g. global variables, or static class members)\n * objects of this class should be instantiated. This class relies on\n * zero-initialization, which is implicit for static-storage-duration objects.\n * It doesn't have a custom default constructor, to avoid static initializers.\n *\n * API usage:\n *\n * // Create a TLS item\n * mozilla::ThreadLocal<int> tlsKey;\n * if (!tlsKey.init()) {\n *   // deal with the error\n * }\n *\n * // Set the TLS value\n * tlsKey.set(123);\n *\n * // Get the TLS value\n * int value = tlsKey.get();\n */\ntemplate<typename T>\nclass ThreadLocal\n{\n#if defined(XP_WIN)\n    typedef unsigned long key_t;\n#else\n    typedef pthread_key_t key_t;\n#endif\n\n    union Helper {\n      void* ptr;\n      T value;\n    };\n\n  public:\n    MOZ_WARN_UNUSED_RESULT inline bool init();\n\n    inline T get() const;\n\n    inline void set(const T value);\n\n    bool initialized() const {\n      return inited;\n    }\n\n  private:\n    key_t key;\n    bool inited;\n};\n\ntemplate<typename T>\ninline bool\nThreadLocal<T>::init()\n{\n  static_assert(sizeof(T) <= sizeof(void*),\n                \"mozilla::ThreadLocal can't be used for types larger than \"\n                \"a pointer\");\n  MOZ_ASSERT(!initialized());\n#ifdef XP_WIN\n  key = TlsAlloc();\n  inited = key != 0xFFFFFFFFUL; // TLS_OUT_OF_INDEXES\n#else\n  inited = !pthread_key_create(&key, nullptr);\n#endif\n  return inited;\n}\n\ntemplate<typename T>\ninline T\nThreadLocal<T>::get() const\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n#ifdef XP_WIN\n  h.ptr = TlsGetValue(key);\n#else\n  h.ptr = pthread_getspecific(key);\n#endif\n  return h.value;\n}\n\ntemplate<typename T>\ninline void\nThreadLocal<T>::set(const T value)\n{\n  MOZ_ASSERT(initialized());\n  Helper h;\n  h.value = value;\n  bool succeeded;\n#ifdef XP_WIN\n  succeeded = TlsSetValue(key, h.ptr);\n#else\n  succeeded = !pthread_setspecific(key, h.ptr);\n#endif\n  if (!succeeded)\n    MOZ_CRASH();\n}\n\n} // namespace mozilla\n\n#endif /* mozilla_ThreadLocal_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/TypeTraits.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Template-based metaprogramming and type-testing facilities. */\n\n#ifndef mozilla_TypeTraits_h\n#define mozilla_TypeTraits_h\n\n/*\n * These traits are approximate copies of the traits and semantics from C++11's\n * <type_traits> header.  Don't add traits not in that header!  When all\n * platforms provide that header, we can convert all users and remove this one.\n */\n\n#include <wchar.h>\n\nnamespace mozilla {\n\n/* Forward declarations. */\n\ntemplate<typename> struct RemoveCV;\n\n/* 20.9.3 Helper classes [meta.help] */\n\n/**\n * Helper class used as a base for various type traits, exposed publicly\n * because <type_traits> exposes it as well.\n */\ntemplate<typename T, T Value>\nstruct IntegralConstant\n{\n    static const T value = Value;\n    typedef T ValueType;\n    typedef IntegralConstant<T, Value> Type;\n};\n\n/** Convenient aliases. */\ntypedef IntegralConstant<bool, true> TrueType;\ntypedef IntegralConstant<bool, false> FalseType;\n\n/* 20.9.4 Unary type traits [meta.unary] */\n\n/* 20.9.4.1 Primary type categories [meta.unary.cat] */\n\nnamespace detail {\n\ntemplate <typename T>\nstruct IsIntegralHelper : FalseType {};\n\ntemplate<> struct IsIntegralHelper<char>               : TrueType {};\ntemplate<> struct IsIntegralHelper<signed char>        : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned char>      : TrueType {};\ntemplate<> struct IsIntegralHelper<short>              : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned short>     : TrueType {};\ntemplate<> struct IsIntegralHelper<int>                : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned int>       : TrueType {};\ntemplate<> struct IsIntegralHelper<long>               : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long>      : TrueType {};\ntemplate<> struct IsIntegralHelper<long long>          : TrueType {};\ntemplate<> struct IsIntegralHelper<unsigned long long> : TrueType {};\ntemplate<> struct IsIntegralHelper<bool>               : TrueType {};\ntemplate<> struct IsIntegralHelper<wchar_t>            : TrueType {};\n\n} /* namespace detail */\n\n/**\n * IsIntegral determines whether a type is an integral type.\n *\n * mozilla::IsIntegral<int>::value is true;\n * mozilla::IsIntegral<unsigned short>::value is true;\n * mozilla::IsIntegral<const long>::value is true;\n * mozilla::IsIntegral<int*>::value is false;\n * mozilla::IsIntegral<double>::value is false;\n *\n * Note that the behavior of IsIntegral on char16_t and char32_t is\n * unspecified.\n */\ntemplate<typename T>\nstruct IsIntegral : detail::IsIntegralHelper<typename RemoveCV<T>::Type>\n{};\n\ntemplate<typename T, typename U>\nstruct IsSame;\n\nnamespace detail {\n\ntemplate<typename T>\nstruct IsFloatingPointHelper\n  : IntegralConstant<bool,\n                     IsSame<T, float>::value ||\n                     IsSame<T, double>::value ||\n                     IsSame<T, long double>::value>\n{};\n\n} // namespace detail\n\n/**\n * IsFloatingPoint determines whether a type is a floating point type (float,\n * double, long double).\n *\n * mozilla::IsFloatingPoint<int>::value is false;\n * mozilla::IsFloatingPoint<const float>::value is true;\n * mozilla::IsFloatingPoint<long double>::value is true;\n * mozilla::IsFloatingPoint<double*>::value is false.\n */\ntemplate<typename T>\nstruct IsFloatingPoint\n  : detail::IsFloatingPointHelper<typename RemoveCV<T>::Type>\n{};\n\n/**\n * IsPointer determines whether a type is a pointer type (but not a pointer-to-\n * member type).\n *\n * mozilla::IsPointer<struct S*>::value is true;\n * mozilla::IsPointer<int**>::value is true;\n * mozilla::IsPointer<void (*)(void)>::value is true;\n * mozilla::IsPointer<int>::value is false;\n * mozilla::IsPointer<struct S>::value is false.\n */\ntemplate<typename T>\nstruct IsPointer : FalseType {};\n\ntemplate<typename T>\nstruct IsPointer<T*> : TrueType {};\n\nnamespace detail {\n\n// __is_enum is a supported extension across all of our supported compilers.\ntemplate<typename T>\nstruct IsEnumHelper\n  : IntegralConstant<bool, __is_enum(T)>\n{};\n\n} // namespace detail\n\n/**\n * IsEnum determines whether a type is an enum type.\n *\n * mozilla::IsEnum<enum S>::value is true;\n * mozilla::IsEnum<enum S*>::value is false;\n * mozilla::IsEnum<int>::value is false;\n */\ntemplate<typename T>\nstruct IsEnum\n  : detail::IsEnumHelper<typename RemoveCV<T>::Type>\n{};\n\n/* 20.9.4.2 Composite type traits [meta.unary.comp] */\n\n/**\n * IsArithmetic determines whether a type is arithmetic.  A type is arithmetic\n * iff it is an integral type or a floating point type.\n *\n * mozilla::IsArithmetic<int>::value is true;\n * mozilla::IsArithmetic<double>::value is true;\n * mozilla::IsArithmetic<long double*>::value is false.\n */\ntemplate<typename T>\nstruct IsArithmetic\n  : IntegralConstant<bool, IsIntegral<T>::value || IsFloatingPoint<T>::value>\n{};\n\n/* 20.9.4.3 Type properties [meta.unary.prop] */\n\n/**\n * IsConst determines whether a type is const or not.\n *\n * mozilla::IsConst<int>::value is false;\n * mozilla::IsConst<void* const>::value is true;\n * mozilla::IsConst<const char*>::value is false.\n */\ntemplate<typename T>\nstruct IsConst : FalseType {};\n\ntemplate<typename T>\nstruct IsConst<const T> : TrueType {};\n\n/**\n * IsVolatile determines whether a type is volatile or not.\n *\n * mozilla::IsVolatile<int>::value is false;\n * mozilla::IsVolatile<void* volatile>::value is true;\n * mozilla::IsVolatile<volatile char*>::value is false.\n */\ntemplate<typename T>\nstruct IsVolatile : FalseType {};\n\ntemplate<typename T>\nstruct IsVolatile<volatile T> : TrueType {};\n\n/**\n * Traits class for identifying POD types.  Until C++11 there's no automatic\n * way to detect PODs, so for the moment this is done manually.  Users may\n * define specializations of this class that inherit from mozilla::TrueType and\n * mozilla::FalseType (or equivalently mozilla::IntegralConstant<bool, true or\n * false>, or conveniently from mozilla::IsPod for composite types) as needed to\n * ensure correct IsPod behavior.\n */\ntemplate<typename T>\nstruct IsPod : public FalseType {};\n\ntemplate<> struct IsPod<char>               : TrueType {};\ntemplate<> struct IsPod<signed char>        : TrueType {};\ntemplate<> struct IsPod<unsigned char>      : TrueType {};\ntemplate<> struct IsPod<short>              : TrueType {};\ntemplate<> struct IsPod<unsigned short>     : TrueType {};\ntemplate<> struct IsPod<int>                : TrueType {};\ntemplate<> struct IsPod<unsigned int>       : TrueType {};\ntemplate<> struct IsPod<long>               : TrueType {};\ntemplate<> struct IsPod<unsigned long>      : TrueType {};\ntemplate<> struct IsPod<long long>          : TrueType {};\ntemplate<> struct IsPod<unsigned long long> : TrueType {};\ntemplate<> struct IsPod<bool>               : TrueType {};\ntemplate<> struct IsPod<float>              : TrueType {};\ntemplate<> struct IsPod<double>             : TrueType {};\ntemplate<> struct IsPod<wchar_t>            : TrueType {};\ntemplate<typename T> struct IsPod<T*>       : TrueType {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsSignedHelper;\n\ntemplate<typename T>\nstruct IsSignedHelper<T, true> : TrueType {};\n\ntemplate<typename T>\nstruct IsSignedHelper<T, false>\n  : IntegralConstant<bool, IsArithmetic<T>::value && T(-1) < T(1)>\n{};\n\n} // namespace detail\n\n/**\n * IsSigned determines whether a type is a signed arithmetic type.  |char| is\n * considered a signed type if it has the same representation as |signed char|.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsSigned<int>::value is true;\n * mozilla::IsSigned<const unsigned int>::value is false;\n * mozilla::IsSigned<unsigned char>::value is false;\n * mozilla::IsSigned<float>::value is true.\n */\ntemplate<typename T>\nstruct IsSigned : detail::IsSignedHelper<T> {};\n\nnamespace detail {\n\ntemplate<typename T, bool = IsFloatingPoint<T>::value>\nstruct IsUnsignedHelper;\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, true> : FalseType {};\n\ntemplate<typename T>\nstruct IsUnsignedHelper<T, false>\n  : IntegralConstant<bool,\n                     IsArithmetic<T>::value &&\n                     (IsSame<typename RemoveCV<T>::Type, bool>::value ||\n                      T(1) < T(-1))>\n{};\n\n} // namespace detail\n\n/**\n * IsUnsigned determines whether a type is an unsigned arithmetic type.\n *\n * Don't use this if the type might be user-defined!  You might or might not get\n * a compile error, depending.\n *\n * mozilla::IsUnsigned<int>::value is false;\n * mozilla::IsUnsigned<const unsigned int>::value is true;\n * mozilla::IsUnsigned<unsigned char>::value is true;\n * mozilla::IsUnsigned<float>::value is false.\n */\ntemplate<typename T>\nstruct IsUnsigned : detail::IsUnsignedHelper<T> {};\n\n/* 20.9.5 Type property queries [meta.unary.prop.query] */\n\n/* 20.9.6 Relationships between types [meta.rel] */\n\n/**\n * IsSame tests whether two types are the same type.\n *\n * mozilla::IsSame<int, int>::value is true;\n * mozilla::IsSame<int*, int*>::value is true;\n * mozilla::IsSame<int, unsigned int>::value is false;\n * mozilla::IsSame<void, void>::value is true;\n * mozilla::IsSame<const int, int>::value is false;\n * mozilla::IsSame<struct S, struct S>::value is true.\n */\ntemplate<typename T, typename U>\nstruct IsSame : FalseType {};\n\ntemplate<typename T>\nstruct IsSame<T, T> : TrueType {};\n\nnamespace detail {\n\n// The trickery used to implement IsBaseOf here makes it possible to use it for\n// the cases of private and multiple inheritance.  This code was inspired by the\n// sample code here:\n//\n// http://stackoverflow.com/questions/2910979/how-is-base-of-works\ntemplate<class Base, class Derived>\nstruct BaseOfHelper\n{\n  public:\n    operator Base*() const;\n    operator Derived*();\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base, const Derived>\n{\n  private:\n    template<class T>\n    static char test(Derived*, T);\n    static int test(Base*, int);\n\n  public:\n    static const bool value =\n      sizeof(test(BaseOfHelper<Base, Derived>(), int())) == sizeof(char);\n};\n\ntemplate<class Base, class Derived>\nstruct BaseOfTester<Base&, Derived&> : FalseType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, Type> : TrueType {};\n\ntemplate<class Type>\nstruct BaseOfTester<Type, const Type> : TrueType {};\n\n} /* namespace detail */\n\n/*\n * IsBaseOf allows to know whether a given class is derived from another.\n *\n * Consider the following class definitions:\n *\n *   class A {};\n *   class B : public A {};\n *   class C {};\n *\n * mozilla::IsBaseOf<A, B>::value is true;\n * mozilla::IsBaseOf<A, C>::value is false;\n */\ntemplate<class Base, class Derived>\nstruct IsBaseOf\n  : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>\n{};\n\nnamespace detail {\n\ntemplate<typename From, typename To>\nstruct ConvertibleTester\n{\n  private:\n    static From create();\n\n    template<typename From1, typename To1>\n    static char test(To to);\n\n    template<typename From1, typename To1>\n    static int test(...);\n\n  public:\n    static const bool value =\n      sizeof(test<From, To>(create())) == sizeof(char);\n};\n\n} // namespace detail\n\n/**\n * IsConvertible determines whether a value of type From will implicitly convert\n * to a value of type To.  For example:\n *\n *   struct A {};\n *   struct B : public A {};\n *   struct C {};\n *\n * mozilla::IsConvertible<A, A>::value is true;\n * mozilla::IsConvertible<A*, A*>::value is true;\n * mozilla::IsConvertible<B, A>::value is true;\n * mozilla::IsConvertible<B*, A*>::value is true;\n * mozilla::IsConvertible<C, A>::value is false;\n * mozilla::IsConvertible<A, C>::value is false;\n * mozilla::IsConvertible<A*, C*>::value is false;\n * mozilla::IsConvertible<C*, A*>::value is false.\n *\n * For obscure reasons, you can't use IsConvertible when the types being tested\n * are related through private inheritance, and you'll get a compile error if\n * you try.  Just don't do it!\n */\ntemplate<typename From, typename To>\nstruct IsConvertible\n  : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>\n{};\n\n/* 20.9.7 Transformations between types [meta.trans] */\n\n/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */\n\n/**\n * RemoveConst removes top-level const qualifications on a type.\n *\n * mozilla::RemoveConst<int>::Type is int;\n * mozilla::RemoveConst<const int>::Type is int;\n * mozilla::RemoveConst<const int*>::Type is const int*;\n * mozilla::RemoveConst<int* const>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveConst\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveConst<const T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveVolatile removes top-level volatile qualifications on a type.\n *\n * mozilla::RemoveVolatile<int>::Type is int;\n * mozilla::RemoveVolatile<volatile int>::Type is int;\n * mozilla::RemoveVolatile<volatile int*>::Type is volatile int*;\n * mozilla::RemoveVolatile<int* volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveVolatile\n{\n    typedef T Type;\n};\n\ntemplate<typename T>\nstruct RemoveVolatile<volatile T>\n{\n    typedef T Type;\n};\n\n/**\n * RemoveCV removes top-level const and volatile qualifications on a type.\n *\n * mozilla::RemoveCV<int>::Type is int;\n * mozilla::RemoveCV<const int>::Type is int;\n * mozilla::RemoveCV<volatile int>::Type is int;\n * mozilla::RemoveCV<int* const volatile>::Type is int*.\n */\ntemplate<typename T>\nstruct RemoveCV\n{\n    typedef typename RemoveConst<typename RemoveVolatile<T>::Type>::Type Type;\n};\n\n/* 20.9.7.2 Reference modifications [meta.trans.ref] */\n\n/* 20.9.7.3 Sign modifications [meta.trans.sign] */\n\ntemplate<bool B, typename T = void>\nstruct EnableIf;\n\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional;\n\nnamespace detail {\n\ntemplate<bool MakeConst, typename T>\nstruct WithC : Conditional<MakeConst, const T, T>\n{};\n\ntemplate<bool MakeVolatile, typename T>\nstruct WithV : Conditional<MakeVolatile, volatile T, T>\n{};\n\n\ntemplate<bool MakeConst, bool MakeVolatile, typename T>\nstruct WithCV : WithC<MakeConst, typename WithV<MakeVolatile, T>::Type>\n{};\n\ntemplate<typename T>\nstruct CorrespondingSigned;\n\ntemplate<>\nstruct CorrespondingSigned<char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned char> { typedef signed char Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned short> { typedef short Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned int> { typedef int Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long> { typedef long Type; };\ntemplate<>\nstruct CorrespondingSigned<unsigned long long> { typedef long long Type; };\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsSignedIntegerType = IsSigned<CVRemoved>::value &&\n                                    !IsSame<char, CVRemoved>::value>\nstruct MakeSigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeSigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingSigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeSigned produces the corresponding signed integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already a signed integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an unsigned integer type, the signed variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the integral type of the same size as T, with the lowest rank,\n * with T's const/volatile qualifiers, is produced.  (This basically only acts\n * to produce signed char when T = char.)\n *\n * mozilla::MakeSigned<unsigned long>::Type is signed long;\n * mozilla::MakeSigned<volatile int>::Type is volatile int;\n * mozilla::MakeSigned<const unsigned short>::Type is const signed short;\n * mozilla::MakeSigned<const char>::Type is const signed char;\n * mozilla::MakeSigned<bool> is an error;\n * mozilla::MakeSigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeSigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeSigned<T>\n            >::Type\n{};\n\nnamespace detail {\n\ntemplate<typename T>\nstruct CorrespondingUnsigned;\n\ntemplate<>\nstruct CorrespondingUnsigned<char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<signed char> { typedef unsigned char Type; };\ntemplate<>\nstruct CorrespondingUnsigned<short> { typedef unsigned short Type; };\ntemplate<>\nstruct CorrespondingUnsigned<int> { typedef unsigned int Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long> { typedef unsigned long Type; };\ntemplate<>\nstruct CorrespondingUnsigned<long long> { typedef unsigned long long Type; };\n\n\ntemplate<typename T,\n         typename CVRemoved = typename RemoveCV<T>::Type,\n         bool IsUnsignedIntegerType = IsUnsigned<CVRemoved>::value &&\n                                      !IsSame<char, CVRemoved>::value>\nstruct MakeUnsigned;\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, true>\n{\n    typedef T Type;\n};\n\ntemplate<typename T, typename CVRemoved>\nstruct MakeUnsigned<T, CVRemoved, false>\n  : WithCV<IsConst<T>::value, IsVolatile<T>::value,\n           typename CorrespondingUnsigned<CVRemoved>::Type>\n{};\n\n} // namespace detail\n\n/**\n * MakeUnsigned produces the corresponding unsigned integer type for a given\n * integral type T, with the const/volatile qualifiers of T.  T must be a\n * possibly-const/volatile-qualified integral type that isn't bool.\n *\n * If T is already an unsigned integer type (not including char!), then T is\n * produced.\n *\n * Otherwise, if T is an signed integer type, the unsigned variety of T, with\n * T's const/volatile qualifiers, is produced.\n *\n * Otherwise, the unsigned integral type of the same size as T, with the lowest\n * rank, with T's const/volatile qualifiers, is produced.  (This basically only\n * acts to produce unsigned char when T = char.)\n *\n * mozilla::MakeUnsigned<signed long>::Type is unsigned long;\n * mozilla::MakeUnsigned<volatile unsigned int>::Type is volatile unsigned int;\n * mozilla::MakeUnsigned<const signed short>::Type is const unsigned short;\n * mozilla::MakeUnsigned<const char>::Type is const unsigned char;\n * mozilla::MakeUnsigned<bool> is an error;\n * mozilla::MakeUnsigned<void*> is an error.\n */\ntemplate<typename T>\nstruct MakeUnsigned\n  : EnableIf<IsIntegral<T>::value && !IsSame<bool, typename RemoveCV<T>::Type>::value,\n             typename detail::MakeUnsigned<T>\n            >::Type\n{};\n\n/* 20.9.7.4 Array modifications [meta.trans.arr] */\n\n/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */\n\n/* 20.9.7.6 Other transformations [meta.trans.other] */\n\n/**\n * EnableIf is a struct containing a typedef of T if and only if B is true.\n *\n * mozilla::EnableIf<true, int>::Type is int;\n * mozilla::EnableIf<false, int>::Type is a compile-time error.\n *\n * Use this template to implement SFINAE-style (Substitution Failure Is not An\n * Error) requirements.  For example, you might use it to impose a restriction\n * on a template parameter:\n *\n *   template<typename T>\n *   class PodVector // vector optimized to store POD (memcpy-able) types\n *   {\n *      EnableIf<IsPod<T>::value, T>::Type* vector;\n *      size_t length;\n *      ...\n *   };\n */\ntemplate<bool B, typename T>\nstruct EnableIf\n{};\n\ntemplate<typename T>\nstruct EnableIf<true, T>\n{\n    typedef T Type;\n};\n\n/**\n * Conditional selects a class between two, depending on a given boolean value.\n *\n * mozilla::Conditional<true, A, B>::Type is A;\n * mozilla::Conditional<false, A, B>::Type is B;\n */\ntemplate<bool Condition, typename A, typename B>\nstruct Conditional\n{\n    typedef A Type;\n};\n\ntemplate<class A, class B>\nstruct Conditional<false, A, B>\n{\n    typedef B Type;\n};\n\n} /* namespace mozilla */\n\n#endif /* mozilla_TypeTraits_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/TypedEnum.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Macros to emulate C++11 typed enums and enum classes. */\n\n#ifndef mozilla_TypedEnum_h\n#define mozilla_TypedEnum_h\n\n#include \"mozilla/Attributes.h\"\n\n#if defined(__cplusplus)\n\n#if defined(__clang__)\n   /*\n    * Per Clang documentation, \"Note that marketing version numbers should not\n    * be used to check for language features, as different vendors use different\n    * numbering schemes. Instead, use the feature checking macros.\"\n    */\n#  ifndef __has_extension\n#    define __has_extension __has_feature /* compatibility, for older versions of clang */\n#  endif\n#  if __has_extension(cxx_strong_enums)\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#elif defined(__GNUC__)\n#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L\n#    if MOZ_GCC_VERSION_AT_LEAST(4, 5, 1)\n#      define MOZ_HAVE_CXX11_ENUM_TYPE\n#      define MOZ_HAVE_CXX11_STRONG_ENUMS\n#    endif\n#  endif\n#elif defined(_MSC_VER)\n#  if _MSC_VER >= 1400\n#    define MOZ_HAVE_CXX11_ENUM_TYPE\n#  endif\n#  if _MSC_VER >= 1700\n#    define MOZ_HAVE_CXX11_STRONG_ENUMS\n#  endif\n#endif\n\n/**\n * MOZ_ENUM_TYPE specifies the underlying numeric type for an enum.  It's\n * specified by placing MOZ_ENUM_TYPE(type) immediately after the enum name in\n * its declaration, and before the opening curly brace, like\n *\n *   enum MyEnum MOZ_ENUM_TYPE(uint16_t)\n *   {\n *     A,\n *     B = 7,\n *     C\n *   };\n *\n * In supporting compilers, the macro will expand to \": uint16_t\".  The\n * compiler will allocate exactly two bytes for MyEnum and will require all\n * enumerators to have values between 0 and 65535.  (Thus specifying \"B =\n * 100000\" instead of \"B = 7\" would fail to compile.)  In old compilers the\n * macro expands to the empty string, and the underlying type is generally\n * undefined.\n */\n#ifdef MOZ_HAVE_CXX11_ENUM_TYPE\n#  define MOZ_ENUM_TYPE(type)   : type\n#else\n#  define MOZ_ENUM_TYPE(type)   /* no support */\n#endif\n\n/**\n * MOZ_BEGIN_ENUM_CLASS and MOZ_END_ENUM_CLASS provide access to the\n * strongly-typed enumeration feature of C++11 (\"enum class\").  If supported\n * by the compiler, an enum defined using these macros will not be implicitly\n * converted to any other type, and its enumerators will be scoped using the\n * enumeration name.  Place MOZ_BEGIN_ENUM_CLASS(EnumName, type) in place of\n * \"enum EnumName {\", and MOZ_END_ENUM_CLASS(EnumName) in place of the closing\n * \"};\".  For example,\n *\n *   MOZ_BEGIN_ENUM_CLASS(Enum, int32_t)\n *     A,\n *     B = 6\n *   MOZ_END_ENUM_CLASS(Enum)\n *\n * This will make \"Enum::A\" and \"Enum::B\" appear in the global scope, but \"A\"\n * and \"B\" will not.  In compilers that support C++11 strongly-typed\n * enumerations, implicit conversions of Enum values to numeric types will\n * fail.  In other compilers, Enum itself will actually be defined as a class,\n * and some implicit conversions will fail while others will succeed.\n *\n * The type argument specifies the underlying type for the enum where\n * supported, as with MOZ_ENUM_TYPE().  For simplicity, it is currently\n * mandatory.  As with MOZ_ENUM_TYPE(), it will do nothing on compilers that do\n * not support it.\n *\n * MOZ_{BEGIN,END}_ENUM_CLASS doesn't work for defining enum classes nested\n * inside classes.  To define an enum class nested inside another class, use\n * MOZ_{BEGIN,END}_NESTED_ENUM_CLASS, and place a MOZ_FINISH_NESTED_ENUM_CLASS\n * in namespace scope to handle bits that can only be implemented with\n * namespace-scoped code.  For example:\n *\n *   class FooBar {\n *\n *     MOZ_BEGIN_NESTED_ENUM_CLASS(Enum, int32_t)\n *       A,\n *       B = 6\n *     MOZ_END_NESTED_ENUM_CLASS(Enum)\n *\n *   };\n *\n *   MOZ_FINISH_NESTED_ENUM_CLASS(FooBar::Enum)\n */\n#if defined(MOZ_HAVE_CXX11_STRONG_ENUMS)\n  /*\n   * All compilers that support strong enums also support an explicit\n   * underlying type, so no extra check is needed.\n   */\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     enum class Name : type {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) /* nothing */\n#else\n   /**\n    * We need Name to both name a type, and scope the provided enumerator\n    * names.  Namespaces and classes both provide scoping, but namespaces\n    * aren't types, so we need to use a class that wraps the enum values.  We\n    * have an implicit conversion from the inner enum type to the class, so\n    * statements like\n    *\n    *   Enum x = Enum::A;\n    *\n    * will still work.  We need to define an implicit conversion from the class\n    * to the inner enum as well, so that (for instance) switch statements will\n    * work.  This means that the class can be implicitly converted to a numeric\n    * value as well via the enum type, since C++ allows an implicit\n    * user-defined conversion followed by a standard conversion to still be\n    * implicit.\n    *\n    * We have an explicit constructor from int defined, so that casts like\n    * (Enum)7 will still work.  We also have a zero-argument constructor with\n    * no arguments, so declaration without initialization (like \"Enum foo;\")\n    * will work.\n    *\n    * Additionally, we'll delete as many operators as possible for the inner\n    * enum type, so statements like this will still fail:\n    *\n    *   f(5 + Enum::B); // deleted operator+\n    *\n    * But we can't prevent things like this, because C++ doesn't allow\n    * overriding conversions or assignment operators for enums:\n    *\n    *   int x = Enum::A;\n    *   int f()\n    *   {\n    *     return Enum::A;\n    *   }\n    */\\\n#  define MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type) \\\n     class Name \\\n     { \\\n       public: \\\n         enum Enum MOZ_ENUM_TYPE(type) \\\n         {\n#  define MOZ_END_NESTED_ENUM_CLASS(Name) \\\n         }; \\\n         Name() {} \\\n         Name(Enum aEnum) : mEnum(aEnum) {} \\\n         explicit Name(int num) : mEnum((Enum)num) {} \\\n         operator Enum() const { return mEnum; } \\\n       private: \\\n         Enum mEnum; \\\n     };\n#  define MOZ_FINISH_NESTED_ENUM_CLASS(Name) \\\n     inline int operator+(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator-(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator*(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator*(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator/(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator/(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator%(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator%(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator+(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator-(const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator++(Name::Enum&) MOZ_DELETE; \\\n     inline int operator++(Name::Enum&, int) MOZ_DELETE; \\\n     inline int& operator--(Name::Enum&) MOZ_DELETE; \\\n     inline int operator--(Name::Enum&, int) MOZ_DELETE; \\\n     inline bool operator==(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator==(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator!=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator>=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator>=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator<=(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator<=(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline bool operator!(const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator&&(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline bool operator||(const bool&, const Name::Enum&) MOZ_DELETE; \\\n     inline bool operator||(const Name::Enum&, const bool&) MOZ_DELETE; \\\n     inline int operator~(const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator&(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator|(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator|(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator^(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator^(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator<<(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator<<(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int operator>>(const int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int operator>>(const Name::Enum&, const int&) MOZ_DELETE; \\\n     inline int& operator+=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator-=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator*=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator/=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator%=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator&=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator|=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator^=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator<<=(int&, const Name::Enum&) MOZ_DELETE; \\\n     inline int& operator>>=(int&, const Name::Enum&) MOZ_DELETE;\n#endif\n#  define MOZ_BEGIN_ENUM_CLASS(Name, type) MOZ_BEGIN_NESTED_ENUM_CLASS(Name, type)\n#  define MOZ_END_ENUM_CLASS(Name) \\\n     MOZ_END_NESTED_ENUM_CLASS(Name) \\\n     MOZ_FINISH_NESTED_ENUM_CLASS(Name)\n\n#endif /* __cplusplus */\n\n#endif /* mozilla_TypedEnum_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Types.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* mfbt foundational types and macros. */\n\n#ifndef mozilla_Types_h\n#define mozilla_Types_h\n\n/*\n * This header must be valid C and C++, includable by code embedding either\n * SpiderMonkey or Gecko.\n */\n\n/* Expose all <stdint.h> types and size_t. */\n#include <stddef.h>\n#include <stdint.h>\n\n/* Implement compiler and linker macros needed for APIs. */\n\n/*\n * MOZ_EXPORT is used to declare and define a symbol or type which is externally\n * visible to users of the current library.  It encapsulates various decorations\n * needed to properly export the method's symbol.\n *\n *   api.h:\n *     extern MOZ_EXPORT int MeaningOfLife(void);\n *     extern MOZ_EXPORT int LuggageCombination;\n *\n *   api.c:\n *     int MeaningOfLife(void) { return 42; }\n *     int LuggageCombination = 12345;\n *\n * If you are merely sharing a method across files, just use plain |extern|.\n * These macros are designed for use by library interfaces -- not for normal\n * methods or data used cross-file.\n */\n#if defined(WIN32) || defined(XP_OS2)\n#  define MOZ_EXPORT   __declspec(dllexport)\n#else /* Unix */\n#  ifdef HAVE_VISIBILITY_ATTRIBUTE\n#    define MOZ_EXPORT       __attribute__((visibility(\"default\")))\n#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n#    define MOZ_EXPORT      __global\n#  else\n#    define MOZ_EXPORT /* nothing */\n#  endif\n#endif\n\n\n/*\n * Whereas implementers use MOZ_EXPORT to declare and define library symbols,\n * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the\n * implementer of the library will expose an API macro which expands to either\n * the export or import version of the macro, depending upon the compilation\n * mode.\n */\n#ifdef _WIN32\n#  if defined(__MWERKS__)\n#    define MOZ_IMPORT_API /* nothing */\n#  else\n#    define MOZ_IMPORT_API __declspec(dllimport)\n#  endif\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_API  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_API MOZ_EXPORT\n#endif\n\n#if defined(_WIN32) && !defined(__MWERKS__)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#elif defined(XP_OS2)\n#  define MOZ_IMPORT_DATA  __declspec(dllimport)\n#else\n#  define MOZ_IMPORT_DATA  MOZ_EXPORT\n#endif\n\n/*\n * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose\n * export mfbt declarations when building mfbt, and they expose import mfbt\n * declarations when using mfbt.\n */\n#if defined(IMPL_MFBT)\n#  define MFBT_API     MOZ_EXPORT\n#  define MFBT_DATA    MOZ_EXPORT\n#else\n  /*\n   * On linux mozglue is linked in the program and we link libxul.so with\n   * -z,defs. Normally that causes the linker to reject undefined references in\n   * libxul.so, but as a loophole it allows undefined references to weak\n   * symbols. We add the weak attribute to the import version of the MFBT API\n   * macros to exploit this.\n   */\n#  if defined(MOZ_GLUE_IN_PROGRAM)\n#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API\n#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA\n#  else\n#    define MFBT_API   MOZ_IMPORT_API\n#    define MFBT_DATA  MOZ_IMPORT_DATA\n#  endif\n#endif\n\n/*\n * C symbols in C++ code must be declared immediately within |extern \"C\"|\n * blocks.  However, in C code, they need not be declared specially.  This\n * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C\n * macros, so that the user need not know whether he is being used in C or C++\n * code.\n *\n *   MOZ_BEGIN_EXTERN_C\n *\n *   extern MOZ_EXPORT int MostRandomNumber(void);\n *   ...other declarations...\n *\n *   MOZ_END_EXTERN_C\n *\n * This said, it is preferable to just use |extern \"C\"| in C++ header files for\n * its greater clarity.\n */\n#ifdef __cplusplus\n#  define MOZ_BEGIN_EXTERN_C    extern \"C\" {\n#  define MOZ_END_EXTERN_C      }\n#else\n#  define MOZ_BEGIN_EXTERN_C\n#  define MOZ_END_EXTERN_C\n#endif\n\n/*\n * GCC's typeof is available when decltype is not.\n */\n#if defined(__GNUC__) && defined(__cplusplus) && \\\n  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L\n#  define decltype __typeof__\n#endif\n\n#endif /* mozilla_Types_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Util.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/*\n * Miscellaneous uncategorized functionality.  Please add new functionality to\n * new headers, or to other appropriate existing headers, not here.\n */\n\n#ifndef mozilla_Util_h\n#define mozilla_Util_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/Types.h\"\n\n#ifdef __cplusplus\n\nnamespace mozilla {\n\n/*\n * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many \n * bytes of alignment a given type needs.\n */\ntemplate<class T>\nclass AlignmentFinder\n{\n    struct Aligner\n    {\n        char c;\n        T t;\n    };\n\n  public:\n    static const size_t alignment = sizeof(Aligner) - sizeof(T);\n};\n\n#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment\n\n/*\n * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.\n *\n * For instance,\n *\n *   MOZ_ALIGNED_DECL(char arr[2], 8);\n *\n * will declare a two-character array |arr| aligned to 8 bytes.\n */\n\n#if defined(__GNUC__)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     _type __attribute__((aligned(_align)))\n#elif defined(_MSC_VER)\n#  define MOZ_ALIGNED_DECL(_type, _align) \\\n     __declspec(align(_align)) _type\n#else\n#  warning \"We don't know how to align variables on this compiler.\"\n#  define MOZ_ALIGNED_DECL(_type, _align) _type\n#endif\n\n/*\n * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N\n * bytes.\n *\n * We support 1, 2, 4, 8, and 16-bit alignment.\n */\ntemplate<size_t align>\nstruct AlignedElem;\n\n/*\n * We have to specialize this template because GCC doesn't like __attribute__((aligned(foo))) where\n * foo is a template parameter.\n */\n\ntemplate<>\nstruct AlignedElem<1>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 1);\n};\n\ntemplate<>\nstruct AlignedElem<2>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 2);\n};\n\ntemplate<>\nstruct AlignedElem<4>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 4);\n};\n\ntemplate<>\nstruct AlignedElem<8>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 8);\n};\n\ntemplate<>\nstruct AlignedElem<16>\n{\n    MOZ_ALIGNED_DECL(uint8_t elem, 16);\n};\n\n/*\n * This utility pales in comparison to Boost's aligned_storage. The utility\n * simply assumes that uint64_t is enough alignment for anyone. This may need\n * to be extended one day...\n *\n * As an important side effect, pulling the storage into this template is\n * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving\n * false negatives when we cast from the char buffer to whatever type we've\n * constructed using the bytes.\n */\ntemplate<size_t nbytes>\nstruct AlignedStorage\n{\n    union U {\n      char bytes[nbytes];\n      uint64_t _;\n    } u;\n\n    const void* addr() const { return u.bytes; }\n    void* addr() { return u.bytes; }\n};\n\ntemplate<class T>\nstruct AlignedStorage2\n{\n    union U {\n      char bytes[sizeof(T)];\n      uint64_t _;\n    } u;\n\n    const T* addr() const { return reinterpret_cast<const T*>(u.bytes); }\n    T* addr() { return static_cast<T*>(static_cast<void*>(u.bytes)); }\n};\n\n/*\n * Small utility for lazily constructing objects without using dynamic storage.\n * When a Maybe<T> is constructed, it is |empty()|, i.e., no value of T has\n * been constructed and no T destructor will be called when the Maybe<T> is\n * destroyed. Upon calling |construct|, a T object will be constructed with the\n * given arguments and that object will be destroyed when the owning Maybe<T>\n * is destroyed.\n *\n * N.B. GCC seems to miss some optimizations with Maybe and may generate extra\n * branches/loads/stores. Use with caution on hot paths.\n */\ntemplate<class T>\nclass Maybe\n{\n    AlignedStorage2<T> storage;\n    bool constructed;\n\n    T& asT() { return *storage.addr(); }\n\n  public:\n    Maybe() { constructed = false; }\n    ~Maybe() { if (constructed) asT().~T(); }\n\n    bool empty() const { return !constructed; }\n\n    void construct() {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T();\n      constructed = true;\n    }\n\n    template<class T1>\n    void construct(const T1& t1) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1);\n      constructed = true;\n    }\n\n    template<class T1, class T2>\n    void construct(const T1& t1, const T2& t2) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3>\n    void construct(const T1& t1, const T2& t2, const T3& t3) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9);\n      constructed = true;\n    }\n\n    template<class T1, class T2, class T3, class T4, class T5,\n             class T6, class T7, class T8, class T9, class T10>\n    void construct(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5,\n                   const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) {\n      MOZ_ASSERT(!constructed);\n      ::new (storage.addr()) T(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);\n      constructed = true;\n    }\n\n    T* addr() {\n      MOZ_ASSERT(constructed);\n      return &asT();\n    }\n\n    T& ref() {\n      MOZ_ASSERT(constructed);\n      return asT();\n    }\n\n    const T& ref() const {\n      MOZ_ASSERT(constructed);\n      return const_cast<Maybe*>(this)->asT();\n    }\n\n    void destroy() {\n      ref().~T();\n      constructed = false;\n    }\n\n    void destroyIfConstructed() {\n      if (!empty())\n        destroy();\n    }\n\n  private:\n    Maybe(const Maybe& other) MOZ_DELETE;\n    const Maybe& operator=(const Maybe& other) MOZ_DELETE;\n};\n\n/*\n * Safely subtract two pointers when it is known that end >= begin.  This avoids\n * the common compiler bug that if (size_t(end) - size_t(begin)) has the MSB\n * set, the unsigned subtraction followed by right shift will produce -1, or\n * size_t(-1), instead of the real difference.\n */\ntemplate<class T>\nMOZ_ALWAYS_INLINE size_t\nPointerRangeSize(T* begin, T* end)\n{\n  MOZ_ASSERT(end >= begin);\n  return (size_t(end) - size_t(begin)) / sizeof(T);\n}\n\n/*\n * Compute the length of an array with constant length.  (Use of this method\n * with a non-array pointer will not compile.)\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR size_t\nArrayLength(T (&arr)[N])\n{\n  return N;\n}\n\n/*\n * Compute the address one past the last element of a constant-length array.\n *\n * Beware of the implicit trailing '\\0' when using this with string constants.\n */\ntemplate<typename T, size_t N>\nMOZ_CONSTEXPR T*\nArrayEnd(T (&arr)[N])\n{\n  return arr + ArrayLength(arr);\n}\n\n} /* namespace mozilla */\n\n#endif /* __cplusplus */\n\n/*\n * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files\n * that can't use C++ template functions and for static_assert() calls that\n * can't call ArrayLength() when it is not a C++11 constexpr function.\n */\n#ifdef MOZ_HAVE_CXX11_CONSTEXPR\n#  define MOZ_ARRAY_LENGTH(array)   mozilla::ArrayLength(array)\n#else\n#  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))\n#endif\n\n#endif /* mozilla_Util_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Vector.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* A type/length-parametrized vector class. */\n\n#ifndef mozilla_Vector_h\n#define mozilla_Vector_h\n\n#include \"mozilla/AllocPolicy.h\"\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Attributes.h\"\n#include \"mozilla/MathAlgorithms.h\"\n#include \"mozilla/MemoryReporting.h\"\n#include \"mozilla/Move.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/ReentrancyGuard.h\"\n#include \"mozilla/TemplateLib.h\"\n#include \"mozilla/TypeTraits.h\"\n#include \"mozilla/Util.h\"\n\n#include <new> // for placement new\n\n/* Silence dire \"bugs in previous versions of MSVC have been fixed\" warnings */\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4345)\n#endif\n\nnamespace mozilla {\n\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase;\n\nnamespace detail {\n\n/*\n * Check that the given capacity wastes the minimal amount of space if\n * allocated on the heap.  This means that cap*sizeof(T) is as close to a\n * power-of-two as possible.  growStorageBy() is responsible for ensuring\n * this.\n */\ntemplate<typename T>\nstatic bool CapacityHasExcessSpace(size_t cap)\n{\n  size_t size = cap * sizeof(T);\n  return RoundUpPow2(size) - size >= sizeof(T);\n}\n\n/*\n * This template class provides a default implementation for vector operations\n * when the element type is not known to be a POD, as judged by IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector, bool IsPod>\nstruct VectorImpl\n{\n    /* Destroys constructed objects in the range [begin, end). */\n    static inline void destroy(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        p->~T();\n    }\n\n    /* Constructs objects in the uninitialized range [begin, end). */\n    static inline void initialize(T* begin, T* end) {\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(*p);\n    }\n\n    /*\n     * Move-constructs objects in the uninitialized range\n     * [dst, dst+(srcend-srcbeg)) from the range [srcbeg, srcend).\n     */\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        new(dst) T(Move(*p));\n    }\n\n    /*\n     * Copy-constructs objects in the uninitialized range [dst, dst+n) from the\n     * same object u.\n     */\n    template<typename U>\n    static inline void copyConstructN(T* dst, size_t n, const U& u) {\n      for (T* end = dst + n; dst < end; ++dst)\n        new(dst) T(u);\n    }\n\n    /*\n     * Grows the given buffer to have capacity newCap, preserving the objects\n     * constructed in the range [begin, end) and updating v. Assumes that (1)\n     * newCap has not overflowed, and (2) multiplying newCap by sizeof(T) will\n     * not overflow.\n     */\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      T* newbuf = reinterpret_cast<T*>(v.malloc_(newCap * sizeof(T)));\n      if (!newbuf)\n        return false;\n      T* dst = newbuf;\n      T* src = v.beginNoCheck();\n      for (; src < v.endNoCheck(); ++dst, ++src)\n        new(dst) T(Move(*src));\n      VectorImpl::destroy(v.beginNoCheck(), v.endNoCheck());\n      v.free_(v.mBegin);\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n/*\n * This partial template specialization provides a default implementation for\n * vector operations when the element type is known to be a POD, as judged by\n * IsPod.\n */\ntemplate<typename T, size_t N, class AP, class ThisVector>\nstruct VectorImpl<T, N, AP, ThisVector, true>\n{\n    static inline void destroy(T*, T*) {}\n\n    static inline void initialize(T* begin, T* end) {\n      /*\n       * You would think that memset would be a big win (or even break even)\n       * when we know T is a POD. But currently it's not. This is probably\n       * because |append| tends to be given small ranges and memset requires\n       * a function call that doesn't get inlined.\n       *\n       * memset(begin, 0, sizeof(T) * (end-begin));\n       */\n      for (T* p = begin; p < end; ++p)\n        new(p) T();\n    }\n\n    template<typename U>\n    static inline void copyConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      /*\n       * See above memset comment. Also, notice that copyConstruct is\n       * currently templated (T != U), so memcpy won't work without\n       * requiring T == U.\n       *\n       * memcpy(dst, srcbeg, sizeof(T) * (srcend - srcbeg));\n       */\n      for (const U* p = srcbeg; p < srcend; ++p, ++dst)\n        *dst = *p;\n    }\n\n    template<typename U>\n    static inline void moveConstruct(T* dst, const U* srcbeg, const U* srcend) {\n      copyConstruct(dst, srcbeg, srcend);\n    }\n\n    static inline void copyConstructN(T* dst, size_t n, const T& t) {\n      for (T* end = dst + n; dst < end; ++dst)\n        *dst = t;\n    }\n\n    static inline bool\n    growTo(VectorBase<T, N, AP, ThisVector>& v, size_t newCap) {\n      MOZ_ASSERT(!v.usingInlineStorage());\n      MOZ_ASSERT(!CapacityHasExcessSpace<T>(newCap));\n      size_t oldSize = sizeof(T) * v.mCapacity;\n      size_t newSize = sizeof(T) * newCap;\n      T* newbuf = reinterpret_cast<T*>(v.realloc_(v.mBegin, oldSize, newSize));\n      if (!newbuf)\n        return false;\n      v.mBegin = newbuf;\n      /* v.mLength is unchanged. */\n      v.mCapacity = newCap;\n      return true;\n    }\n};\n\n} // namespace detail\n\n/*\n * A CRTP base class for vector-like classes.  Unless you really really want\n * your own vector class -- and you almost certainly don't -- you should use\n * mozilla::Vector instead!\n *\n * See mozilla::Vector for interface requirements.\n */\ntemplate<typename T, size_t N, class AllocPolicy, class ThisVector>\nclass VectorBase : private AllocPolicy\n{\n    /* utilities */\n\n    static const bool sElemIsPod = IsPod<T>::value;\n    typedef detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod> Impl;\n    friend struct detail::VectorImpl<T, N, AllocPolicy, ThisVector, sElemIsPod>;\n\n    bool growStorageBy(size_t incr);\n    bool convertToHeapStorage(size_t newCap);\n\n    /* magic constants */\n\n    static const int sMaxInlineBytes = 1024;\n\n    /* compute constants */\n\n    /*\n     * Consider element size to be 1 for buffer sizing if there are 0 inline\n     * elements.  This allows us to compile when the definition of the element\n     * type is not visible here.\n     *\n     * Explicit specialization is only allowed at namespace scope, so in order\n     * to keep everything here, we use a dummy template parameter with partial\n     * specialization.\n     */\n    template<int M, int Dummy>\n    struct ElemSize\n    {\n        static const size_t value = sizeof(T);\n    };\n    template<int Dummy>\n    struct ElemSize<0, Dummy>\n    {\n        static const size_t value = 1;\n    };\n\n    static const size_t sInlineCapacity =\n      tl::Min<N, sMaxInlineBytes / ElemSize<N, 0>::value>::value;\n\n    /* Calculate inline buffer size; avoid 0-sized array. */\n    static const size_t sInlineBytes =\n      tl::Max<1, sInlineCapacity * ElemSize<N, 0>::value>::value;\n\n    /* member data */\n\n    /*\n     * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,\n     * mBegin + mLength) hold valid constructed T objects. The range [mBegin +\n     * mLength, mBegin + mCapacity) holds uninitialized memory. The range\n     * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory\n     * previously allocated by a call to reserve().\n     */\n    T* mBegin;\n\n    /* Number of elements in the vector. */\n    size_t mLength;\n\n    /* Max number of elements storable in the vector without resizing. */\n    size_t mCapacity;\n\n#ifdef DEBUG\n    /* Max elements of reserved or used space in this vector. */\n    size_t mReserved;\n#endif\n\n    /* Memory used for inline storage. */\n    AlignedStorage<sInlineBytes> storage;\n\n#ifdef DEBUG\n    friend class ReentrancyGuard;\n    bool entered;\n#endif\n\n    /* private accessors */\n\n    bool usingInlineStorage() const {\n      return mBegin == const_cast<VectorBase*>(this)->inlineStorage();\n    }\n\n    T* inlineStorage() {\n      return static_cast<T*>(storage.addr());\n    }\n\n    T* beginNoCheck() const {\n      return mBegin;\n    }\n\n    T* endNoCheck() {\n      return mBegin + mLength;\n    }\n\n    const T* endNoCheck() const {\n      return mBegin + mLength;\n    }\n\n#ifdef DEBUG\n    size_t reserved() const {\n      MOZ_ASSERT(mReserved <= mCapacity);\n      MOZ_ASSERT(mLength <= mReserved);\n      return mReserved;\n    }\n#endif\n\n    /* Append operations guaranteed to succeed due to pre-reserved space. */\n    template<typename U> void internalAppend(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    void internalAppendAll(const VectorBase<U, O, BP, UV>& u);\n    void internalAppendN(const T& t, size_t n);\n    template<typename U> void internalAppend(const U* begin, size_t length);\n\n  public:\n    static const size_t sMaxInlineStorage = N;\n\n    typedef T ElementType;\n\n    VectorBase(AllocPolicy = AllocPolicy());\n    VectorBase(MoveRef<ThisVector>); /* Move constructor. */\n    ThisVector& operator=(MoveRef<ThisVector>); /* Move assignment. */\n    ~VectorBase();\n\n    /* accessors */\n\n    const AllocPolicy& allocPolicy() const {\n      return *this;\n    }\n\n    AllocPolicy& allocPolicy() {\n      return *this;\n    }\n\n    enum { InlineLength = N };\n\n    size_t length() const {\n      return mLength;\n    }\n\n    bool empty() const {\n      return mLength == 0;\n    }\n\n    size_t capacity() const {\n      return mCapacity;\n    }\n\n    T* begin() {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    const T* begin() const {\n      MOZ_ASSERT(!entered);\n      return mBegin;\n    }\n\n    T* end() {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    const T* end() const {\n      MOZ_ASSERT(!entered);\n      return mBegin + mLength;\n    }\n\n    T& operator[](size_t i) {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    const T& operator[](size_t i) const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(i < mLength);\n      return begin()[i];\n    }\n\n    T& back() {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    const T& back() const {\n      MOZ_ASSERT(!entered);\n      MOZ_ASSERT(!empty());\n      return *(end() - 1);\n    }\n\n    class Range\n    {\n        friend class VectorBase;\n        T* cur_;\n        T* end_;\n        Range(T* cur, T* end) : cur_(cur), end_(end) {}\n\n      public:\n        Range() {}\n        bool empty() const { return cur_ == end_; }\n        size_t remain() const { return end_ - cur_; }\n        T& front() const { return *cur_; }\n        void popFront() { MOZ_ASSERT(!empty()); ++cur_; }\n        T popCopyFront() { MOZ_ASSERT(!empty()); return *cur_++; }\n    };\n\n    Range all() {\n      return Range(begin(), end());\n    }\n\n    /* mutators */\n\n    /**\n     * Given that the vector is empty and has no inline storage, grow to\n     * |capacity|.\n     */\n    bool initCapacity(size_t request);\n\n    /**\n     * If reserve(length() + N) succeeds, the N next appends are guaranteed to\n     * succeed.\n     */\n    bool reserve(size_t request);\n\n    /**\n     * Destroy elements in the range [end() - incr, end()). Does not deallocate\n     * or unreserve storage for those elements.\n     */\n    void shrinkBy(size_t incr);\n\n    /** Grow the vector by incr elements. */\n    bool growBy(size_t incr);\n\n    /** Call shrinkBy or growBy based on whether newSize > length(). */\n    bool resize(size_t newLength);\n\n    /**\n     * Increase the length of the vector, but don't initialize the new elements\n     * -- leave them as uninitialized memory.\n     */\n    bool growByUninitialized(size_t incr);\n    bool resizeUninitialized(size_t newLength);\n\n    /** Shorthand for shrinkBy(length()). */\n    void clear();\n\n    /** Clears and releases any heap-allocated storage. */\n    void clearAndFree();\n\n    /**\n     * If true, appending |needed| elements won't reallocate elements storage.\n     * This *doesn't* mean that infallibleAppend may be used!  You still must\n     * reserve the extra space, even if this method indicates that appends won't\n     * need to reallocate elements storage.\n     */\n    bool canAppendWithoutRealloc(size_t needed) const;\n\n    /**\n     * Potentially fallible append operations.\n     *\n     * The function templates that take an unspecified type U require a const T&\n     * or a MoveRef<T>.  The MoveRef<T> variants move their operands into the\n     * vector, instead of copying them.  If they fail, the operand is left\n     * unmoved.\n     */\n    template<typename U> bool append(const U& u);\n    template<typename U, size_t O, class BP, class UV>\n    bool appendAll(const VectorBase<U, O, BP, UV>& u);\n    bool appendN(const T& t, size_t n);\n    template<typename U> bool append(const U* begin, const U* end);\n    template<typename U> bool append(const U* begin, size_t length);\n\n    /*\n     * Guaranteed-infallible append operations for use upon vectors whose\n     * memory has been pre-reserved.  Don't use this if you haven't reserved the\n     * memory!\n     */\n    template<typename U> void infallibleAppend(const U& u) {\n      internalAppend(u);\n    }\n    void infallibleAppendN(const T& t, size_t n) {\n      internalAppendN(t, n);\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) {\n      internalAppend(aBegin, PointerRangeSize(aBegin, aEnd));\n    }\n    template<typename U> void infallibleAppend(const U* aBegin, size_t aLength) {\n      internalAppend(aBegin, aLength);\n    }\n\n    void popBack();\n\n    T popCopy();\n\n    /**\n     * Transfers ownership of the internal buffer used by this vector to the\n     * caller.  (It's the caller's responsibility to properly deallocate this\n     * buffer, in accordance with this vector's AllocPolicy.)  After this call,\n     * the vector is empty.  Since the returned buffer may need to be allocated\n     * (if the elements are currently stored in-place), the call can fail,\n     * returning nullptr.\n     *\n     * N.B. Although a T*, only the range [0, length()) is constructed.\n     */\n    T* extractRawBuffer();\n\n    /**\n     * Transfer ownership of an array of objects into the vector.  The caller\n     * must have allocated the array in accordance with this vector's\n     * AllocPolicy.\n     *\n     * N.B. This call assumes that there are no uninitialized elements in the\n     *      passed array.\n     */\n    void replaceRawBuffer(T* p, size_t length);\n\n    /**\n     * Places |val| at position |p|, shifting existing elements from |p| onward\n     * one position higher.  On success, |p| should not be reused because it'll\n     * be a dangling pointer if reallocation of the vector storage occurred; the\n     * return value should be used instead.  On failure, nullptr is returned.\n     *\n     * Example usage:\n     *\n     *   if (!(p = vec.insert(p, val)))\n     *     <handle failure>\n     *   <keep working with p>\n     *\n     * This is inherently a linear-time operation.  Be careful!\n     */\n    T* insert(T* p, const T& val);\n\n    /**\n     * Removes the element |t|, which must fall in the bounds [begin, end),\n     * shifting existing elements from |t + 1| onward one position lower.\n     */\n    void erase(T* t);\n\n    /**\n     * Measure the size of the vector's heap-allocated storage.\n     */\n    size_t sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const;\n\n    /**\n     * Like sizeOfExcludingThis, but also measures the size of the vector\n     * object (which must be heap-allocated) itself.\n     */\n    size_t sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const;\n\n    void swap(ThisVector& other);\n\n  private:\n    VectorBase(const ThisVector&) MOZ_DELETE;\n    void operator=(const ThisVector&) MOZ_DELETE;\n};\n\n/* This does the re-entrancy check plus several other sanity checks. */\n#define MOZ_REENTRANCY_GUARD_ET_AL \\\n  ReentrancyGuard g(*this); \\\n  MOZ_ASSERT_IF(usingInlineStorage(), mCapacity == sInlineCapacity); \\\n  MOZ_ASSERT(reserved() <= mCapacity); \\\n  MOZ_ASSERT(mLength <= reserved()); \\\n  MOZ_ASSERT(mLength <= mCapacity)\n\n/* Vector Implementation */\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::VectorBase(AP ap)\n  : AP(ap),\n    mBegin(static_cast<T*>(storage.addr())),\n    mLength(0),\n    mCapacity(sInlineCapacity)\n#ifdef DEBUG\n  , mReserved(sInlineCapacity),\n    entered(false)\n#endif\n{}\n\n/* Move constructor. */\ntemplate<typename T, size_t N, class AllocPolicy, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AllocPolicy, TV>::VectorBase(MoveRef<TV> rhs)\n  : AllocPolicy(rhs)\n#ifdef DEBUG\n    , entered(false)\n#endif\n{\n  mLength = rhs->mLength;\n  mCapacity = rhs->mCapacity;\n#ifdef DEBUG\n  mReserved = rhs->mReserved;\n#endif\n\n  if (rhs->usingInlineStorage()) {\n    /* We can't move the buffer over in this case, so copy elements. */\n    mBegin = static_cast<T*>(storage.addr());\n    Impl::moveConstruct(mBegin, rhs->beginNoCheck(), rhs->endNoCheck());\n    /*\n     * Leave rhs's mLength, mBegin, mCapacity, and mReserved as they are.\n     * The elements in its in-line storage still need to be destroyed.\n     */\n  } else {\n    /*\n     * Take src's buffer, and turn src into an empty vector using\n     * in-line storage.\n     */\n    mBegin = rhs->mBegin;\n    rhs->mBegin = static_cast<T*>(rhs->storage.addr());\n    rhs->mCapacity = sInlineCapacity;\n    rhs->mLength = 0;\n#ifdef DEBUG\n    rhs->mReserved = sInlineCapacity;\n#endif\n  }\n}\n\n/* Move assignment. */\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nTV&\nVectorBase<T, N, AP, TV>::operator=(MoveRef<TV> rhs)\n{\n  TV* tv = static_cast<TV*>(this);\n  tv->~TV();\n  new(tv) TV(rhs);\n  return *tv;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE\nVectorBase<T, N, AP, TV>::~VectorBase()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n}\n\n/*\n * This function will create a new heap buffer with capacity newCap,\n * move all elements in the inline buffer to this new buffer,\n * and fail on OOM.\n */\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::convertToHeapStorage(size_t newCap)\n{\n  MOZ_ASSERT(usingInlineStorage());\n\n  /* Allocate buffer. */\n  MOZ_ASSERT(!detail::CapacityHasExcessSpace<T>(newCap));\n  T* newBuf = reinterpret_cast<T*>(this->malloc_(newCap * sizeof(T)));\n  if (!newBuf)\n    return false;\n\n  /* Copy inline elements into heap buffer. */\n  Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());\n  Impl::destroy(beginNoCheck(), endNoCheck());\n\n  /* Switch in heap buffer. */\n  mBegin = newBuf;\n  /* mLength is unchanged. */\n  mCapacity = newCap;\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_NEVER_INLINE bool\nVectorBase<T, N, AP, TV>::growStorageBy(size_t incr)\n{\n  MOZ_ASSERT(mLength + incr > mCapacity);\n  MOZ_ASSERT_IF(!usingInlineStorage(),\n                !detail::CapacityHasExcessSpace<T>(mCapacity));\n\n  /*\n   * When choosing a new capacity, its size should is as close to 2**N bytes\n   * as possible.  2**N-sized requests are best because they are unlikely to\n   * be rounded up by the allocator.  Asking for a 2**N number of elements\n   * isn't as good, because if sizeof(T) is not a power-of-two that would\n   * result in a non-2**N request size.\n   */\n\n  size_t newCap;\n\n  if (incr == 1) {\n    if (usingInlineStorage()) {\n      /* This case occurs in ~70--80% of the calls to this function. */\n      size_t newSize =\n        tl::RoundUpPow2<(sInlineCapacity + 1) * sizeof(T)>::value;\n      newCap = newSize / sizeof(T);\n      goto convert;\n    }\n\n    if (mLength == 0) {\n      /* This case occurs in ~0--10% of the calls to this function. */\n      newCap = 1;\n      goto grow;\n    }\n\n    /* This case occurs in ~15--20% of the calls to this function. */\n\n    /*\n     * Will mLength * 4 *sizeof(T) overflow?  This condition limits a vector\n     * to 1GB of memory on a 32-bit system, which is a reasonable limit.  It\n     * also ensures that\n     *\n     *   static_cast<char*>(end()) - static_cast<char*>(begin())\n     *\n     * doesn't overflow ptrdiff_t (see bug 510319).\n     */\n    if (mLength & tl::MulOverflowMask<4 * sizeof(T)>::value) {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    /*\n     * If we reach here, the existing capacity will have a size that is already\n     * as close to 2^N as sizeof(T) will allow.  Just double the capacity, and\n     * then there might be space for one more element.\n     */\n    newCap = mLength * 2;\n    if (detail::CapacityHasExcessSpace<T>(newCap))\n      newCap += 1;\n  } else {\n    /* This case occurs in ~2% of the calls to this function. */\n    size_t newMinCap = mLength + incr;\n\n    /* Did mLength + incr overflow?  Will newCap * sizeof(T) overflow? */\n    if (newMinCap < mLength ||\n        newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::value)\n    {\n      this->reportAllocOverflow();\n      return false;\n    }\n\n    size_t newMinSize = newMinCap * sizeof(T);\n    size_t newSize = RoundUpPow2(newMinSize);\n    newCap = newSize / sizeof(T);\n  }\n\n  if (usingInlineStorage()) {\n  convert:\n    return convertToHeapStorage(newCap);\n  }\n\ngrow:\n  return Impl::growTo(*this, newCap);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::initCapacity(size_t request)\n{\n  MOZ_ASSERT(empty());\n  MOZ_ASSERT(usingInlineStorage());\n  if (request == 0)\n    return true;\n  T* newbuf = reinterpret_cast<T*>(this->malloc_(request * sizeof(T)));\n  if (!newbuf)\n    return false;\n  mBegin = newbuf;\n  mCapacity = request;\n#ifdef DEBUG\n  mReserved = request;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::reserve(size_t request)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (request > mCapacity && !growStorageBy(request - mLength))\n    return false;\n\n#ifdef DEBUG\n  if (request > mReserved)\n    mReserved = request;\n  MOZ_ASSERT(mLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::shrinkBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(incr <= mLength);\n  Impl::destroy(endNoCheck() - incr, endNoCheck());\n  mLength -= incr;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growBy(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  T* newend = endNoCheck() + incr;\n  Impl::initialize(endNoCheck(), newend);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::growByUninitialized(size_t incr)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (incr > mCapacity - mLength && !growStorageBy(incr))\n    return false;\n\n  MOZ_ASSERT(mLength + incr <= mCapacity);\n  mLength += incr;\n#ifdef DEBUG\n  if (mLength > mReserved)\n    mReserved = mLength;\n#endif\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::resize(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growBy(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::resizeUninitialized(size_t newLength)\n{\n  size_t curLength = mLength;\n  if (newLength > curLength)\n    return growByUninitialized(newLength - curLength);\n  shrinkBy(curLength - newLength);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clear()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  mLength = 0;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::clearAndFree()\n{\n  clear();\n\n  if (usingInlineStorage())\n    return;\n\n  this->free_(beginNoCheck());\n  mBegin = static_cast<T*>(storage.addr());\n  mCapacity = sInlineCapacity;\n#ifdef DEBUG\n  mReserved = sInlineCapacity;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline bool\nVectorBase<T, N, AP, TV>::canAppendWithoutRealloc(size_t needed) const\n{\n  return mLength + needed <= mCapacity;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  internalAppend(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U& u)\n{\n  MOZ_ASSERT(mLength + 1 <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  new(endNoCheck()) T(u);\n  ++mLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendN(const T& t, size_t needed)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppendN(t, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppendN(const T& t, size_t needed)\n{\n  MOZ_ASSERT(mLength + needed <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstructN(endNoCheck(), needed, t);\n  mLength += needed;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::insert(T* p, const T& val)\n{\n  MOZ_ASSERT(begin() <= p);\n  MOZ_ASSERT(p <= end());\n  size_t pos = p - begin();\n  MOZ_ASSERT(pos <= mLength);\n  size_t oldLength = mLength;\n  if (pos == oldLength) {\n    if (!append(val))\n      return nullptr;\n  } else {\n    T oldBack = back();\n    if (!append(oldBack)) /* Dup the last element. */\n      return nullptr;\n    for (size_t i = oldLength; i > pos; --i)\n      (*this)[i] = (*this)[i - 1];\n    (*this)[pos] = val;\n  }\n  return begin() + pos;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::erase(T* it)\n{\n  MOZ_ASSERT(begin() <= it);\n  MOZ_ASSERT(it < end());\n  while (it + 1 < end()) {\n    *it = *(it + 1);\n    ++it;\n  }\n  popBack();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U* insBegin, const U* insEnd)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  size_t needed = PointerRangeSize(insBegin, insEnd);\n  if (mLength + needed > mCapacity && !growStorageBy(needed))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + needed > mReserved)\n    mReserved = mLength + needed;\n#endif\n  internalAppend(insBegin, needed);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::internalAppend(const U* insBegin, size_t insLength)\n{\n  MOZ_ASSERT(mLength + insLength <= mReserved);\n  MOZ_ASSERT(mReserved <= mCapacity);\n  Impl::copyConstruct(endNoCheck(), insBegin, insBegin + insLength);\n  mLength += insLength;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U& u)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  if (mLength == mCapacity && !growStorageBy(1))\n    return false;\n\n#ifdef DEBUG\n  if (mLength + 1 > mReserved)\n    mReserved = mLength + 1;\n#endif\n  internalAppend(u);\n  return true;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<typename U, size_t O, class BP, class UV>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::appendAll(const VectorBase<U, O, BP, UV>& other)\n{\n  return append(other.begin(), other.length());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ntemplate<class U>\nMOZ_ALWAYS_INLINE bool\nVectorBase<T, N, AP, TV>::append(const U *insBegin, size_t insLength)\n{\n  return append(insBegin, insBegin + insLength);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE void\nVectorBase<T, N, AP, TV>::popBack()\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n  MOZ_ASSERT(!empty());\n  --mLength;\n  endNoCheck()->~T();\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\nMOZ_ALWAYS_INLINE T\nVectorBase<T, N, AP, TV>::popCopy()\n{\n  T ret = back();\n  popBack();\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline T*\nVectorBase<T, N, AP, TV>::extractRawBuffer()\n{\n  T* ret;\n  if (usingInlineStorage()) {\n    ret = reinterpret_cast<T*>(this->malloc_(mLength * sizeof(T)));\n    if (!ret)\n      return nullptr;\n    Impl::copyConstruct(ret, beginNoCheck(), endNoCheck());\n    Impl::destroy(beginNoCheck(), endNoCheck());\n    /* mBegin, mCapacity are unchanged. */\n    mLength = 0;\n  } else {\n    ret = mBegin;\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = 0;\n    mCapacity = sInlineCapacity;\n#ifdef DEBUG\n    mReserved = sInlineCapacity;\n#endif\n  }\n  return ret;\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::replaceRawBuffer(T* p, size_t aLength)\n{\n  MOZ_REENTRANCY_GUARD_ET_AL;\n\n  /* Destroy what we have. */\n  Impl::destroy(beginNoCheck(), endNoCheck());\n  if (!usingInlineStorage())\n    this->free_(beginNoCheck());\n\n  /* Take in the new buffer. */\n  if (aLength <= sInlineCapacity) {\n    /*\n     * We convert to inline storage if possible, even though p might\n     * otherwise be acceptable.  Maybe this behaviour should be\n     * specifiable with an argument to this function.\n     */\n    mBegin = static_cast<T*>(storage.addr());\n    mLength = aLength;\n    mCapacity = sInlineCapacity;\n    Impl::moveConstruct(mBegin, p, p + aLength);\n    Impl::destroy(p, p + aLength);\n    this->free_(p);\n  } else {\n    mBegin = p;\n    mLength = aLength;\n    mCapacity = aLength;\n  }\n#ifdef DEBUG\n  mReserved = aLength;\n#endif\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfExcludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return usingInlineStorage() ? 0 : mallocSizeOf(beginNoCheck());\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline size_t\nVectorBase<T, N, AP, TV>::sizeOfIncludingThis(MallocSizeOf mallocSizeOf) const\n{\n  return mallocSizeOf(this) + sizeOfExcludingThis(mallocSizeOf);\n}\n\ntemplate<typename T, size_t N, class AP, class TV>\ninline void\nVectorBase<T, N, AP, TV>::swap(TV& other)\n{\n  static_assert(N == 0,\n                \"still need to implement this for N != 0\");\n\n  // This only works when inline storage is always empty.\n  if (!usingInlineStorage() && other.usingInlineStorage()) {\n    other.mBegin = mBegin;\n    mBegin = inlineStorage();\n  } else if (usingInlineStorage() && !other.usingInlineStorage()) {\n    mBegin = other.mBegin;\n    other.mBegin = other.inlineStorage();\n  } else if (!usingInlineStorage() && !other.usingInlineStorage()) {\n    Swap(mBegin, other.mBegin);\n  } else {\n    // This case is a no-op, since we'd set both to use their inline storage.\n  }\n\n  Swap(mLength, other.mLength);\n  Swap(mCapacity, other.mCapacity);\n#ifdef DEBUG\n  Swap(mReserved, other.mReserved);\n#endif\n}\n\n/*\n * STL-like container providing a short-lived, dynamic buffer.  Vector calls the\n * constructors/destructors of all elements stored in its internal buffer, so\n * non-PODs may be safely used.  Additionally, Vector will store the first N\n * elements in-place before resorting to dynamic allocation.\n *\n * T requirements:\n *  - default and copy constructible, assignable, destructible\n *  - operations do not throw\n * N requirements:\n *  - any value, however, N is clamped to min/max values\n * AllocPolicy:\n *  - see \"Allocation policies\" in AllocPolicy.h (defaults to\n *    mozilla::MallocAllocPolicy)\n *\n * Vector is not reentrant: T member functions called during Vector member\n * functions must not call back into the same object!\n */\ntemplate<typename T,\n         size_t MinInlineCapacity = 0,\n         class AllocPolicy = MallocAllocPolicy>\nclass Vector\n  : public VectorBase<T,\n                      MinInlineCapacity,\n                      AllocPolicy,\n                      Vector<T, MinInlineCapacity, AllocPolicy> >\n{\n    typedef VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;\n\n  public:\n    Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}\n    Vector(mozilla::MoveRef<Vector> vec) : Base(vec) {}\n    Vector& operator=(mozilla::MoveRef<Vector> vec) {\n      return Base::operator=(vec);\n    }\n};\n\n} // namespace mozilla\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif /* mozilla_Vector_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/WeakPtr.h",
    "content": "/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set ts=8 sts=2 et sw=2 tw=80: */\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n/* Weak pointer functionality, implemented as a mixin for use with any class. */\n\n/**\n * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting\n * its lifetime. It works by creating a single shared reference counted object\n * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo'\n * clear the pointer in the WeakReference without having to know about all of\n * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime\n * of 'Foo'.\n *\n * AtomicSupportsWeakPtr can be used for a variant with an atomically updated\n * reference counter.\n *\n * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional\n * dereference, and an additional heap allocated pointer sized object shared\n * between all of the WeakPtrs.\n *\n * Example of usage:\n *\n *   // To have a class C support weak pointers, inherit from SupportsWeakPtr<C>.\n *   class C : public SupportsWeakPtr<C>\n *   {\n *    public:\n *      int num;\n *      void act();\n *   };\n *\n *   C* ptr =  new C();\n *\n *   // Get weak pointers to ptr. The first time asWeakPtr is called\n *   // a reference counted WeakReference object is created that\n *   // can live beyond the lifetime of 'ptr'. The WeakReference\n *   // object will be notified of 'ptr's destruction.\n *   WeakPtr<C> weak = ptr->asWeakPtr();\n *   WeakPtr<C> other = ptr->asWeakPtr();\n *\n *   // Test a weak pointer for validity before using it.\n *   if (weak) {\n *     weak->num = 17;\n *     weak->act();\n *   }\n *\n *   // Destroying the underlying object clears weak pointers to it.\n *   delete ptr;\n *\n *   MOZ_ASSERT(!weak, \"Deleting |ptr| clears weak pointers to it.\");\n *   MOZ_ASSERT(!other, \"Deleting |ptr| clears all weak pointers to it.\");\n *\n * WeakPtr is typesafe and may be used with any class. It is not required that\n * the class be reference-counted or allocated in any particular way.\n *\n * The API was loosely inspired by Chromium's weak_ptr.h:\n * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h\n */\n\n#ifndef mozilla_WeakPtr_h\n#define mozilla_WeakPtr_h\n\n#include \"mozilla/Assertions.h\"\n#include \"mozilla/Atomics.h\"\n#include \"mozilla/NullPtr.h\"\n#include \"mozilla/RefPtr.h\"\n#include \"mozilla/TypeTraits.h\"\n\nnamespace mozilla {\n\ntemplate <typename T, class WeakReference> class WeakPtrBase;\ntemplate <typename T, class WeakReference> class SupportsWeakPtrBase;\n\nnamespace detail {\n\n// This can live beyond the lifetime of the class derived from SupportsWeakPtrBase.\ntemplate<class T, RefCountAtomicity Atomicity>\nclass WeakReference : public RefCounted<WeakReference<T, Atomicity>, Atomicity>\n{\n  public:\n    explicit WeakReference(T* p) : ptr(p) {}\n    T* get() const {\n      return ptr;\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n    void detach() {\n      ptr = nullptr;\n    }\n    T* ptr;\n};\n\n} // namespace detail\n\ntemplate <typename T, class WeakReference>\nclass SupportsWeakPtrBase\n{\n  public:\n    WeakPtrBase<T, WeakReference> asWeakPtr() {\n      if (!weakRef)\n        weakRef = new WeakReference(static_cast<T*>(this));\n      return WeakPtrBase<T, WeakReference>(weakRef);\n    }\n\n  protected:\n    ~SupportsWeakPtrBase() {\n      static_assert(IsBaseOf<SupportsWeakPtrBase<T, WeakReference>, T>::value,\n                    \"T must derive from SupportsWeakPtrBase<T, WeakReference>\");\n      if (weakRef)\n        weakRef->detach();\n    }\n\n  private:\n    friend class WeakPtrBase<T, WeakReference>;\n\n    RefPtr<WeakReference> weakRef;\n};\n\ntemplate <typename T>\nclass SupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::NonAtomicRefCount> >\n{\n};\n\ntemplate <typename T>\nclass AtomicSupportsWeakPtr\n  : public SupportsWeakPtrBase<T, detail::WeakReference<T, detail::AtomicRefCount> >\n{\n};\n\nnamespace detail {\n\ntemplate <typename T>\nstruct WeakReferenceCount\n{\n  static const RefCountAtomicity atomicity =\n    IsBaseOf<AtomicSupportsWeakPtr<T>, T>::value\n    ? AtomicRefCount\n    : NonAtomicRefCount;\n};\n\n}\n\ntemplate <typename T, class WeakReference>\nclass WeakPtrBase\n{\n  public:\n    WeakPtrBase(const WeakPtrBase<T, WeakReference>& o) : ref(o.ref) {}\n    // Ensure that ref is dereferenceable in the uninitialized state\n    WeakPtrBase() : ref(new WeakReference(nullptr)) {}\n\n    operator T*() const {\n      return ref->get();\n    }\n    T& operator*() const {\n      return *ref->get();\n    }\n\n    T* operator->() const {\n      return ref->get();\n    }\n\n    T* get() const {\n      return ref->get();\n    }\n\n  private:\n    friend class SupportsWeakPtrBase<T, WeakReference>;\n\n    explicit WeakPtrBase(const RefPtr<WeakReference> &o) : ref(o) {}\n\n    RefPtr<WeakReference> ref;\n};\n\ntemplate <typename T>\nclass WeakPtr : public WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> >\n{\n    typedef WeakPtrBase<T, detail::WeakReference<T, detail::WeakReferenceCount<T>::atomicity> > Base;\n  public:\n    WeakPtr(const WeakPtr<T>& o) : Base(o) {}\n    WeakPtr(const Base& o) : Base(o) {}\n    WeakPtr() {}\n};\n\n} // namespace mozilla\n\n#endif /* mozilla_WeakPtr_h */\n"
  },
  {
    "path": "cocos2d/tools/cocos2d-console/src/jsbcc_source/src/main.cpp",
    "content": "//\n//  main.cpp\n//  jsbcc\n//\n//  Created by sun zhuoshi on 4/28/13.\n//  Copyright (c) 2013 sunzhuoshi. All rights reserved.\n//\n\n#include <iostream>\n#include <sstream>\n\n#include <stdio.h>\n\n#ifdef WIN32\n#include <Winsock2.h>\n#define STDIN_FILENO 0\n#else\n#include <unistd.h>\n#include <sys/select.h>\n#endif\n\n#include \"jsapi.h\"\n#include \"jsfriendapi.h\"\n\n#ifdef WIN32\nconst char *USAGE = \"Usage: jsbcc input_js_file [byte_code_file]\";\n#else\nconst char *USAGE = \"Usage: jsbcc input_js_file [byte_code_file]\\n\"\\\n                    \"       Or\\n\"\\\n                    \"       ls *.js | jsbcc -p\";\n#endif\nconst char *BYTE_CODE_FILE_EXT = \".jsc\";\n\nenum ErrorCode {\n    EC_OK = 0,\n    EC_ERROR = 1\n};\n\nvoid Finalize(JSFreeOp *freeOp, JSObject *obj) {\n}\n\nvoid ReportError(JSContext *cx, const char *message, JSErrorReport *report) {\n    std::cerr << \"Error! \" << message <<  std::endl;\n}\n\nJSClass GlobalClass = {\n    \"global\", JSCLASS_GLOBAL_FLAGS,\n    JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,\n    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,\n    JSCLASS_NO_OPTIONAL_MEMBERS\n};\n\nbool WriteFile(const std::string &filePath, void *data, uint32_t length) {\n    FILE *file = fopen(filePath.c_str(), \"wb\");\n    if (file) {\n        size_t ret = fwrite(data, 1, length, file);\n        fclose(file);\n        if (ret == length) {\n            return true;\n        }\n    }\n    return false;\n}\n\nstd::string RemoveFileExt(const std::string &filePath) {\n    size_t pos = filePath.rfind('.');\n    if (0 < pos) {\n        return filePath.substr(0, pos);\n    }\n    else {\n        return filePath;\n    }\n}\n\nbool CompileFile(const std::string &inputFilePath, const std::string &outputFilePath) {\n    bool result = false;\n    std::string ofp;\n    if (!outputFilePath.empty()) {\n        ofp = outputFilePath;\n    }\n    else {\n        ofp = RemoveFileExt(inputFilePath) + BYTE_CODE_FILE_EXT;\n    }\n    \n    if (!JS_Init())\n        return false;\n    \n    std::cout << \"Input file: \" << inputFilePath << std::endl;\n    JSRuntime * runtime = JS_NewRuntime(10 * 1024 * 1024, JS_NO_HELPER_THREADS);\n\n    JSContext *cx = JS_NewContext(runtime, 10240);\n    JS_SetOptions(cx, JSOPTION_TYPE_INFERENCE);\n    \n    JS::CompartmentOptions options;\n    options.setVersion(JSVERSION_LATEST);\n    \n    JS::RootedObject global(cx, JS_NewGlobalObject(cx, &GlobalClass, NULL, JS::DontFireOnNewGlobalHook, options));\n    \n    JS_SetErrorReporter(cx, &ReportError);\n    \n    {\n        JSAutoCompartment ac(cx, global);\n    \n        if (JS_InitStandardClasses(cx, global)) {\n            \n            JS_InitReflect(cx, global);\n            \n            JS_FireOnNewGlobalObject(cx, global);\n            \n            JS::CompileOptions options(cx);\n            options.setUTF8(true);\n            options.setSourcePolicy(JS::CompileOptions::NO_SOURCE);\n            std::cout << \"Compiling ...\" << std::endl;\n            \n            JS::RootedScript script(cx, JS::Compile(cx, global, options, inputFilePath.c_str()));\n            \n            if (script) {\n                void *data = NULL;\n                uint32_t length = 0;\n                std::cout << \"Encoding ...\" << std::endl;\n                data = JS_EncodeScript(cx, script, &length);\n                \n                if (data) {\n                    if (WriteFile(ofp, data, length)) {\n                        std::cout << \"Done! \" << \"Output file: \" << ofp << std::endl;\n                        result = true;\n                    }\n                }\n            }\n            else\n            {\n                std::cout << \"Compiled \" << inputFilePath << \" fails!\" << std::endl;\n            }\n        }\n        else\n        {\n            std::cout << \"JS_InitStandardClasses failed! \" << std::endl;\n        }\n    }\n    if (cx) {\n        JS_DestroyContext(cx);\n        cx = NULL;\n    }\n    if (runtime) {\n        JS_DestroyRuntime(runtime);\n        runtime = NULL;\n    }\n    \n    JS_ShutDown();\n    \n    return result;\n}\n\nint main(int argc, const char * argv[])\n{\n    std::string inputFilePath, outputFilePath;\n    if (1 == argc) {\n        std::cerr << USAGE << std::endl;\n        return EC_ERROR;\n    }\n    else {\n        if (1 < argc) {            \n            if (std::string(argv[1]) == \"-p\") { // pipe mode\n                fd_set fds;\n                FD_ZERO (&fds);\n                FD_SET (STDIN_FILENO, &fds);\n                int result = select (STDIN_FILENO + 1, &fds, NULL, NULL, NULL); // infinite wait\n                if (result) { // STDIN ready to read\n                    std::string line;\n                    while (std::getline(std::cin, line)) {\n                        if (!line.empty()) {\n                            CompileFile(line, \"\");\n                        }\n                    }\n                    return EC_OK;\n                }\n                else {\n                    std::cerr << \"Failed to read from pipe\" << std::endl;\n                    return EC_ERROR;\n                }\n            }\n            else {\n                inputFilePath = argv[1];\n            }\n        }\n        if (2 < argc) {\n            outputFilePath = argv[2];\n        }\n        if (CompileFile(inputFilePath, outputFilePath)) {\n            return EC_OK;\n        }\n        return EC_ERROR;\n    }\n}\n"
  },
  {
    "path": "cocos2d/tools/cpp-best-practise-formatter/cpp-best-practise-formatter.py",
    "content": "#!/usr/bin/env python\n\nimport os\nimport re\nimport sys\n\n# list of extensions to replace\nreplace_extensions = [\".cpp\", \".h\", \".hpp\", \".cc\", \".mm\"]\nfiles_to_skip = None\nreplace_type = None\nskip_contents = [\"CCPointMake\", \"CCSizeMake\", \"CCRectMake\", \"CCLOG\", \\\n                 \"CCLog\", \"CCAssert\", \"CCSkeleton\"]\n\ndef try_to_replace(fname):\n    if replace_type == \"add_namespace\":\n        if fname.lower().endswith(\".h\"):\n            return True\n        return False\n    else:\n        if replace_extensions:\n            for replace_extension in replace_extensions:\n                if fname.lower().endswith(replace_extension):\n                    return True\n    return False\n\n\ndef replacement_member_variable(m):\n    # print \"group 2: \", m.group(2)\n    name_prefix = m.group(3)\n    first = name_prefix[0]\n    second = \"\"\n\n    if len(name_prefix) > 1:\n        second = name_prefix[1]\n\n    if first.isupper() and second.islower():\n        first = first.lower()\n        name_prefix = first + name_prefix[1:]\n        return m.group(1) + \"_\" + name_prefix\n    elif first.isupper() and second.isupper():\n        return m.group(1) + \"_\" + name_prefix\n    else:\n        print \"don't convert: \", m.group(1) + m.group(2) + m.group(3)\n    if m.group(2) == \"m_\":\n        return m.group(1) + \"_\" + name_prefix\n    return m.group(1) + m.group(2) + m.group(3)\n\n\ndef remove_prefix_callback(m):\n    pos = 0\n    for skip_content in skip_contents:\n        start = 0\n        while True:\n            pos = m.string.find(skip_content, start)\n            if pos == -1:\n                break\n            if pos == m.end(1):\n                return m.group(1) + \"CC\" + m.group(2)\n            start = pos + 1\n    return m.group(1) + m.group(2)\n\n\ndef add_namespace_callback(m):\n    \"\"\"\n\n    Arguments:\n    - `m`:\n    \"\"\"\n    return m.group(1) + \"cocos2d::\" + m.group(2)\n\n\ndef replace_callback(m):\n    if replace_type == \"replace_variable\":\n        return replacement_member_variable(m)\n    elif replace_type == \"remove_prefix\":\n        return remove_prefix_callback(m)\n    elif replace_type == \"add_namespace\":\n        return add_namespace_callback(m)\n    else:\n        raise Exception(\"type error.\")\n\n\ndef file_replace(fname, pat):\n    # first, see if the pattern is even in the file.\n    with open(fname) as f:\n        if not any(re.search(pat, line) for line in f):\n            # print \"can't find the string...\"\n            return # pattern does not occur in file so we are done.\n\n    # pattern is in the file, so perform replace operation.\n    with open(fname) as f:\n        out_fname = fname + \".tmp\"\n        out = open(out_fname, \"w\")\n        for line in f:\n            repl = line\n            m = re.search(pat, line)\n            if m:\n                repl = re.sub(pat, replace_callback, line)\n\n            out.write(repl)\n        out.close()\n        os.rename(out_fname, fname)\n\n\ndef mass_replace(dir_name, s_before):\n    pat = re.compile(s_before)\n    for dirpath, dirnames, filenames in os.walk(dir_name):\n        for fname in filenames:\n            if try_to_replace(fname):\n                fullname = os.path.join(dirpath, fname)\n                need_skip = False\n                if files_to_skip != None:\n                    for skip in files_to_skip:\n                        if fullname.find(skip) != -1:\n                            print \"skip file: \", fullname\n                            need_skip = True\n                            break\n                if not need_skip:\n                    file_replace(fullname, pat)\n\n\nprefix_need_replace = [\n    \"m_pob\",\n    \"m_ob\",\n    \"m_str\",\n    \"m_psz\",\n    \"m_sz\",\n    \"m_pfn\",\n    \"m_pf\",\n    \"m_s\",\n    \"m_p\",\n    \"m_b\",\n    \"m_n\",\n    \"m_h\",\n    \"m_u\",\n    \"m_c\",\n    \"m_e\",\n    \"m_f\",\n    \"m_d\",\n    \"m_t\",\n    \"m_i\",\n    \"m_\"\n]\n\n\ndef do_member_varible_replace(dir):\n    \"\"\"\n\n    Arguments:\n    - `dir`:\n    - `dir_skip`:\n    \"\"\"\n\n    for p in prefix_need_replace:\n        # mass_replace(\".\", p)\n        pat = \"([^\\w])(\" + p + ')(\\w{1,2})'\n        mass_replace(dir, pat)\n        pat = \"(^)(\" + p + ')(\\w{1,2})'\n        mass_replace(dir, pat)\n\n\nremove_prefix_patterns = [\n    \"([^/_\\\"])CC([A-Z][a-z])\", \\\n    \"(^)CC([A-Z][a-z])\", \\\n    \"([^/_\\\"])CC(IME[A-Z][a-z])\", \\\n    \"(^)CC(IME[A-Z][a-z])\", \\\n    \"([^/_\\\"])CC(TMX)\", \\\n    \"(^)CC(TMX)\", \\\n    \"([^/_\\\"])CC(GL\\w)\", \\\n    \"(^)CC(GL\\w)\", \\\n    \"([^/_\\\"])CC(EGL)\", \\\n    \"(^)CC(EGL)\", \\\n    \"([^/_\\\"])CC(EGL)\", \\\n    \"(^)CC(EGL)\", \\\n    \"([^/_\\\"])CC(RGBA)\", \\\n    \"(^)CC(RGBA)\", \\\n    \"([^/_\\\"])CC(SAX)\", \\\n    \"(^)CC(SAX)\"\n]\n\n\ndef do_remove_class_cc_prefix(dir):\n    for pat in remove_prefix_patterns:\n        mass_replace(dir, pat)\n\n\ndef do_add_namespace(dir):\n    \"\"\"\n\n    Arguments:\n    - `dir`:\n    \"\"\"\n    pat = \"([\\s(])(CC[A-Z][a-z])\"\n    mass_replace(dir, pat)\n\n\ndef main():\n    \"\"\"\n    \"\"\"\n    from optparse import OptionParser\n\n    parser = OptionParser(\"usage: %prog cpp-best-practise-formatter -d DIR_NAME [-s FILES_TO_SKIP]\")\n    parser.add_option(\"-t\", \"--type\",\n                      action=\"store\", type=\"string\", dest=\"type\", default=\"all\",\n                      help='''all: Replaces hungary naming of member variables and removing CC prefix for classes.\n                              remove_prefix: Only removes CC prefix for classes.\n                              replace_variable: Replaces hungary naming of member variables.\n                      ''')\n\n    parser.add_option(\"-d\", \"--dir\",\n                      action=\"store\", type=\"string\", dest=\"dir_name\", default=None,\n                      help=\"The directory which contains sources to format\")\n\n    parser.add_option(\"-s\", \"--skip\",\n                      action=\"append\", type=\"string\", dest=\"skips\", default=None,\n                      help=\"Files or directories to skip\")\n\n\n    (options, args) = parser.parse_args(sys.argv)\n\n    if options.dir_name is None:\n        raise Exception(\"Don't set -d at the same time\");\n\n    global replace_type\n    replace_type = options.type\n\n    global files_to_skip\n    files_to_skip = options.skips\n\n    if options.type == \"all\":\n        #replace_type = \"add_namespace\"\n        #do_add_namespace(options.dir_name)\n        replace_type = \"replace_variable\"\n        do_member_varible_replace(options.dir_name)\n        replace_type = \"remove_prefix\"\n        do_remove_class_cc_prefix(options.dir_name)\n    elif options.type == \"replace_variable\":\n        do_member_varible_replace(options.dir_name)\n    elif options.type == \"remove_prefix\":\n        do_remove_class_cc_prefix(options.dir_name)\n    elif options.type == \"add_namespace\":\n        do_add_namespace(options.dir_name)\n    else:\n        raise Exception(\"type error, please use correct -t opinion.\")\n\n\nif __name__ == '__main__':\n    try:\n        main()\n    except Exception as e:\n        print e\n        sys.exit(1)\n"
  },
  {
    "path": "cocos2d/tools/cpp-best-practise-formatter/test/CCDirector.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2011      Zynga Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDIRECTOR_H__\n#define __CCDIRECTOR_H__\n\n#include \"platform/CCPlatformMacros.h\"\n#include \"cocoa/CCObject.h\"\n#include \"ccTypes.h\"\n#include \"cocoa/CCGeometry.h\"\n#include \"cocoa/CCArray.h\"\n#include \"CCGL.h\"\n#include \"kazmath/mat4.h\"\n#include \"label_nodes/CCLabelAtlas.h\"\n#include \"ccTypeInfo.h\"\n\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup base_nodes\n * @{\n */\n\n/** @typedef ccDirectorProjection\n Possible OpenGL projections used by director\n */\ntypedef enum {\n    /// sets a 2D projection (orthogonal projection)\n    kCCDirectorProjection2D,\n    \n    /// sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.\n    kCCDirectorProjection3D,\n    \n    /// it calls \"updateProjection\" on the projection delegate.\n    kCCDirectorProjectionCustom,\n    \n    /// Default projection is 3D projection\n    kCCDirectorProjectionDefault = kCCDirectorProjection3D,\n} ccDirectorProjection;\n\n/* Forward declarations. */\nclass CCLabelAtlas;\nclass CCScene;\nclass CCEGLView;\nclass CCDirectorDelegate;\nclass CCNode;\nclass CCScheduler;\nclass CCActionManager;\nclass CCTouchDispatcher;\n#ifdef KEYBOARD_SUPPORT\nclass CCKeyboardDispatcher;\n#endif\nclass CCKeypadDispatcher;\nclass CCAccelerometer;\n\n/**\n@brief Class that creates and handle the main Window and manages how\nand when to execute the Scenes.\n \n The CCDirector is also responsible for:\n  - initializing the OpenGL context\n  - setting the OpenGL pixel format (default on is RGB565)\n  - setting the OpenGL buffer depth (default one is 0-bit)\n  - setting the projection (default one is 3D)\n  - setting the orientation (default one is Portrait)\n \n Since the CCDirector is a singleton, the standard way to use it is by calling:\n  _ CCDirector::sharedDirector()->methodName();\n \n The CCDirector also sets the default OpenGL context:\n  - GL_TEXTURE_2D is enabled\n  - GL_VERTEX_ARRAY is enabled\n  - GL_COLOR_ARRAY is enabled\n  - GL_TEXTURE_COORD_ARRAY is enabled\n*/\nclass CC_DLL CCDirector : public CCObject, public TypeInfo\n{\npublic:\n    CCDirector(void);\n    virtual ~CCDirector(void);\n    virtual bool init(void);\n    virtual long getClassTypeInfo() {\n\t\tstatic const long id = cocos2d::getHashCodeByString(typeid(cocos2d::CCDirector).name());\n\t\treturn id;\n    }\n\n    // attribute\n\n    /** Get current running Scene. Director can only run one Scene at the time */\n    inline CCScene* getRunningScene(void) { return m_pRunningScene; }\n\n    /** Get the FPS value */\n    inline double getAnimationInterval(void) { return m_dAnimationInterval; }\n    /** Set the FPS value. */\n    virtual void setAnimationInterval(double dValue) = 0;\n\n    /** Whether or not to display the FPS on the bottom-left corner */\n    inline bool isDisplayStats(void) { return m_bDisplayStats; }\n    /** Display the FPS on the bottom-left corner */\n    inline void setDisplayStats(bool bDisplayStats) { m_bDisplayStats = bDisplayStats; }\n    \n    /** seconds per frame */\n    inline float getSecondsPerFrame() { return m_fSecondsPerFrame; }\n\n    /** Get the CCEGLView, where everything is rendered */\n    inline CCEGLView* getOpenGLView(void) { return m_pobOpenGLView; }\n    void setOpenGLView(CCEGLView *pobOpenGLView);\n\n    inline bool isNextDeltaTimeZero(void) { return m_bNextDeltaTimeZero; }\n    void setNextDeltaTimeZero(bool bNextDeltaTimeZero);\n\n    /** Whether or not the Director is paused */\n    inline bool isPaused(void) { return m_bPaused; }\n\n    /** How many frames were called since the director started */\n    inline unsigned int getTotalFrames(void) { return m_uTotalFrames; }\n    \n    /** Sets an OpenGL projection\n     @since v0.8.2\n     */\n    inline ccDirectorProjection getProjection(void) { return m_eProjection; }\n    void setProjection(ccDirectorProjection kProjection);\n    \n    /** Sets the glViewport*/\n    void setViewport();\n\n    /** How many frames were called since the director started */\n    \n    \n    /** Whether or not the replaced scene will receive the cleanup message.\n     If the new scene is pushed, then the old scene won't receive the \"cleanup\" message.\n     If the new scene replaces the old one, the it will receive the \"cleanup\" message.\n     @since v0.99.0\n     */\n    inline bool isSendCleanupToScene(void) { return m_bSendCleanupToScene; }\n\n    /** This object will be visited after the main scene is visited.\n     This object MUST implement the \"visit\" selector.\n     Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications)\n     @since v0.99.5\n     */\n    CCNode* getNotificationNode();\n    void setNotificationNode(CCNode *node);\n    \n    /** CCDirector delegate. It shall implemente the CCDirectorDelegate protocol\n     @since v0.99.5\n     */\n    CCDirectorDelegate* getDelegate() const;\n    void setDelegate(CCDirectorDelegate* pDelegate);\n\n    // window size\n\n    /** returns the size of the OpenGL view in points.\n    */\n    CCSize getWinSize(void);\n\n    /** returns the size of the OpenGL view in pixels.\n    */\n    CCSize getWinSizeInPixels(void);\n    \n    /** returns visible size of the OpenGL view in points.\n     *  the value is equal to getWinSize if don't invoke\n     *  CCEGLView::setDesignResolutionSize()\n     */\n    CCSize getVisibleSize();\n    \n    /** returns visible origin of the OpenGL view in points.\n     */\n    CCPoint getVisibleOrigin();\n\n    /** converts a UIKit coordinate to an OpenGL coordinate\n     Useful to convert (multi) touch coordinates to the current layout (portrait or landscape)\n     */\n    CCPoint convertToGL(const CCPoint& obPoint);\n\n    /** converts an OpenGL coordinate to a UIKit coordinate\n     Useful to convert node points to window points for calls such as glScissor\n     */\n    CCPoint convertToUI(const CCPoint& obPoint);\n\n    /// XXX: missing description \n    float getZEye(void);\n\n    // Scene Management\n\n    /** Enters the Director's main loop with the given Scene.\n     * Call it to run only your FIRST scene.\n     * Don't call it if there is already a running scene.\n     *\n     * It will call pushScene: and then it will call startAnimation\n     */\n    void runWithScene(CCScene *pScene);\n\n    /** Suspends the execution of the running scene, pushing it on the stack of suspended scenes.\n     * The new scene will be executed.\n     * Try to avoid big stacks of pushed scenes to reduce memory allocation. \n     * ONLY call it if there is a running scene.\n     */\n    void pushScene(CCScene *pScene);\n\n    /** Pops out a scene from the queue.\n     * This scene will replace the running one.\n     * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.\n     * ONLY call it if there is a running scene.\n     */\n    void popScene(void);\n\n    /** Pops out all scenes from the queue until the root scene in the queue.\n     * This scene will replace the running one.\n     * Internally it will call `popToSceneStackLevel(1)`\n     */\n    void popToRootScene(void);\n\n    /** Pops out all scenes from the queue until it reaches `level`.\n     If level is 0, it will end the director.\n     If level is 1, it will pop all scenes until it reaches to root scene.\n     If level is <= than the current stack level, it won't do anything.\n     */\n \tvoid popToSceneStackLevel(int level);\n\n    /** Replaces the running scene with a new one. The running scene is terminated.\n     * ONLY call it if there is a running scene.\n     */\n    void replaceScene(CCScene *pScene);\n\n    /** Ends the execution, releases the running scene.\n     It doesn't remove the OpenGL view from its parent. You have to do it manually.\n     */\n    void end(void);\n\n    /** Pauses the running scene.\n     The running scene will be _drawed_ but all scheduled timers will be paused\n     While paused, the draw rate will be 4 FPS to reduce CPU consumption\n     */\n    void pause(void);\n\n    /** Resumes the paused scene\n     The scheduled timers will be activated again.\n     The \"delta time\" will be 0 (as if the game wasn't paused)\n     */\n    void resume(void);\n\n    /** Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore.\n     If you don't want to pause your animation call [pause] instead.\n     */\n    virtual void stopAnimation(void) = 0;\n\n    /** The main loop is triggered again.\n     Call this function only if [stopAnimation] was called earlier\n     @warning Don't call this function to start the main loop. To run the main loop call runWithScene\n     */\n    virtual void startAnimation(void) = 0;\n\n    /** Draw the scene.\n    This method is called every frame. Don't call it manually.\n    */\n    void drawScene(void);\n\n    // Memory Helper\n\n    /** Removes cached all cocos2d cached data.\n     It will purge the CCTextureCache, CCSpriteFrameCache, CCLabelBMFont cache\n     @since v0.99.3\n     */\n    void purgeCachedData(void);\n\n    // OpenGL Helper\n\n    /** sets the OpenGL default values */\n    void setGLDefaultValues(void);\n\n    /** enables/disables OpenGL alpha blending */\n    void setAlphaBlending(bool bOn);\n\n    /** enables/disables OpenGL depth test */\n    void setDepthTest(bool bOn);\n\n    virtual void mainLoop(void) = 0;\n\n    /** The size in pixels of the surface. It could be different than the screen size.\n    High-res devices might have a higher surface size than the screen size.\n    Only available when compiled using SDK >= 4.0.\n    @since v0.99.4\n    */\n    void setContentScaleFactor(float scaleFactor);\n    float getContentScaleFactor(void);\n\npublic:\n    /** CCScheduler associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(CCScheduler*, m_pScheduler, Scheduler);\n\n    /** CCActionManager associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(CCActionManager*, m_pActionManager, ActionManager);\n\n    /** CCTouchDispatcher associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(CCTouchDispatcher*, m_pTouchDispatcher, TouchDispatcher);\n\n#ifdef KEYBOARD_SUPPORT\n    /** CCKeyboardDispatcher associated with this director\n     @since v?.?\n     */\n    CC_PROPERTY(CCKeyboardDispatcher*, m_pKeyboardDispatcher, KeyboardDispatcher);\n#endif\n    /** CCKeypadDispatcher associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(CCKeypadDispatcher*, m_pKeypadDispatcher, KeypadDispatcher);\n\n    /** CCAccelerometer associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(CCAccelerometer*, m_pAccelerometer, Accelerometer);\n\n    /* delta time since last tick to main loop */\n\tCC_PROPERTY_READONLY(float, m_fDeltaTime, DeltaTime);\n\t\npublic:\n    /** returns a shared instance of the director */\n    static CCDirector* sharedDirector(void);\n\nprotected:\n\n    void purgeDirector();\n    bool m_bPurgeDirecotorInNextLoop; // this flag will be set to true in end()\n    \n    void setNextScene(void);\n    \n    void showStats();\n    void createStatsLabel();\n    void calculateMPF();\n    void getFPSImageData(unsigned char** datapointer, unsigned int* length);\n    \n    /** calculates delta time since last time it was called */    \n    void calculateDeltaTime();\nprotected:\n    /* The CCEGLView, where everything is rendered */\n    CCEGLView    *m_pobOpenGLView;\n\n    double m_dAnimationInterval;\n    double m_dOldAnimationInterval;\n\n    /* landscape mode ? */\n    bool m_bLandscape;\n    \n    bool m_bDisplayStats;\n    float m_fAccumDt;\n    float m_fFrameRate;\n    \n    CCLabelAtlas *m_pFPSLabel;\n    CCLabelAtlas *m_pSPFLabel;\n    CCLabelAtlas *m_pDrawsLabel;\n    \n    /** Whether or not the Director is paused */\n    bool m_bPaused;\n\n    /* How many frames were called since the director started */\n    unsigned int m_uTotalFrames;\n    unsigned int m_uFrames;\n    float m_fSecondsPerFrame;\n     \n    /* The running scene */\n    CCScene *m_pRunningScene;\n    \n    /* will be the next 'runningScene' in the next frame\n     nextScene is a weak reference. */\n    CCScene *m_pNextScene;\n    \n    /* If YES, then \"old\" scene will receive the cleanup message */\n    bool    m_bSendCleanupToScene;\n\n    /* scheduled scenes */\n    CCArray* m_pobScenesStack;\n    \n    /* last time the main loop was updated */\n    struct cc_timeval *m_pLastUpdate;\n\n    /* whether or not the next delta time will be zero */\n    bool m_bNextDeltaTimeZero;\n    \n    /* projection used */\n    ccDirectorProjection m_eProjection;\n\n    /* window size in points */\n    CCSize    m_obWinSizeInPoints;\n    \n    /* content scale factor */\n    float    m_fContentScaleFactor;\n\n    /* store the fps string */\n    char *m_pszFPS;\n\n    /* This object will be visited after the scene. Useful to hook a notification node */\n    CCNode *m_pNotificationNode;\n\n    /* Projection protocol delegate */\n    CCDirectorDelegate *m_pProjectionDelegate;\n    \n    // CCEGLViewProtocol will recreate stats labels to fit visible rect\n    friend class CCEGLViewProtocol;\n};\n\n/** \n @brief DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display.\n \n Features and Limitations:\n  - Scheduled timers & drawing are synchronizes with the refresh rate of the display\n  - Only supports animation intervals of 1/60 1/30 & 1/15\n \n @since v0.8.2\n */\nclass CCDisplayLinkDirector : public CCDirector\n{\npublic:\n    CCDisplayLinkDirector(void) \n        : m_bInvalid(false)\n    {}\n\n    virtual void mainLoop(void);\n    virtual void setAnimationInterval(double dValue);\n    virtual void startAnimation(void);\n    virtual void stopAnimation();\n\nprotected:\n    bool m_bInvalid;\n};\n\n// end of base_node group\n/// @}\n\nNS_CC_END\n\n#endif // __CCDIRECTOR_H__\n"
  },
  {
    "path": "cocos2d/tools/cpp-best-practise-formatter/test/dir_skip/test.h",
    "content": "/****************************************************************************\nCopyright (c) 2010-2012 cocos2d-x.org\nCopyright (c) 2008-2010 Ricardo Quesada\nCopyright (c) 2011      Zynga Inc.\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************/\n\n#ifndef __CCDIRECTOR_H__\n#define __CCDIRECTOR_H__\n\n#include \"platform/atformMacros.h\"\n#include \"cocoa/ject.h\"\n#include \"ccTypes.h\"\n#include \"cocoa/ometry.h\"\n#include \"cocoa/ray.h\"\n#include \"CCGL.h\"\n#include \"kazmath/mat4.h\"\n#include \"label_nodes/belAtlas.h\"\n#include \"ccTypeInfo.h\"\n\n\nNS_CC_BEGIN\n\n/**\n * @addtogroup base_nodes\n * @{\n */\n\n/** @typedef ccDirectorProjection\n Possible OpenGL projections used by director\n */\ntypedef enum {\n    /// sets a 2D projection (orthogonal projection)\n    krectorProjection2D,\n    \n    /// sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.\n    krectorProjection3D,\n    \n    /// it calls \"updateProjection\" on the projection delegate.\n    krectorProjectionCustom,\n    \n    /// Default projection is 3D projection\n    krectorProjectionDefault = krectorProjection3D,\n} ccDirectorProjection;\n\n/* Forward declarations. */\nclass belAtlas;\nclass ene;\nclass CCEGLView;\nclass rectorDelegate;\nclass de;\nclass heduler;\nclass tionManager;\nclass uchDispatcher;\n#ifdef KEYBOARD_SUPPORT\nclass yboardDispatcher;\n#endif\nclass ypadDispatcher;\nclass celerometer;\n\n/**\n@brief Class that creates and handle the main Window and manages how\nand when to execute the Scenes.\n \n The rector is also responsible for:\n  - initializing the OpenGL context\n  - setting the OpenGL pixel format (default on is RGB565)\n  - setting the OpenGL buffer depth (default one is 0-bit)\n  - setting the projection (default one is 3D)\n  - setting the orientation (default one is Portrait)\n \n Since the rector is a singleton, the standard way to use it is by calling:\n  _ rector::sharedDirector()->methodName();\n \n The rector also sets the default OpenGL context:\n  - GL_TEXTURE_2D is enabled\n  - GL_VERTEX_ARRAY is enabled\n  - GL_COLOR_ARRAY is enabled\n  - GL_TEXTURE_COORD_ARRAY is enabled\n*/\nclass CC_DLL rector : public ject, public TypeInfo\n{\npublic:\n    rector(void);\n    virtual ~rector(void);\n    virtual bool init(void);\n    virtual long getClassTypeInfo() {\n\t\tstatic const long id = cocos2d::getHashCodeByString(typeid(cocos2d::rector).name());\n\t\treturn id;\n    }\n\n    // attribute\n\n    /** Get current running Scene. Director can only run one Scene at the time */\n    inline ene* getRunningScene(void) { return _runningScene; }\n\n    /** Get the FPS value */\n    inline double getAnimationInterval(void) { return _animationInterval; }\n    /** Set the FPS value. */\n    virtual void setAnimationInterval(double dValue) = 0;\n\n    /** Whether or not to display the FPS on the bottom-left corner */\n    inline bool isDisplayStats(void) { return _displayStats; }\n    /** Display the FPS on the bottom-left corner */\n    inline void setDisplayStats(bool bDisplayStats) { _displayStats = bDisplayStats; }\n    \n    /** seconds per frame */\n    inline float getSecondsPerFrame() { return _secondsPerFrame; }\n\n    /** Get the CCEGLView, where everything is rendered */\n    inline CCEGLView* getOpenGLView(void) { return _openGLView; }\n    void setOpenGLView(CCEGLView *pobOpenGLView);\n\n    inline bool isNextDeltaTimeZero(void) { return _nextDeltaTimeZero; }\n    void setNextDeltaTimeZero(bool bNextDeltaTimeZero);\n\n    /** Whether or not the Director is paused */\n    inline bool isPaused(void) { return _paused; }\n\n    /** How many frames were called since the director started */\n    inline unsigned int getTotalFrames(void) { return _totalFrames; }\n    \n    /** Sets an OpenGL projection\n     @since v0.8.2\n     */\n    inline ccDirectorProjection getProjection(void) { return _projection; }\n    void setProjection(ccDirectorProjection kProjection);\n    \n    /** Sets the glViewport*/\n    void setViewport();\n\n    /** How many frames were called since the director started */\n    \n    \n    /** Whether or not the replaced scene will receive the cleanup message.\n     If the new scene is pushed, then the old scene won't receive the \"cleanup\" message.\n     If the new scene replaces the old one, the it will receive the \"cleanup\" message.\n     @since v0.99.0\n     */\n    inline bool isSendCleanupToScene(void) { return _sendCleanupToScene; }\n\n    /** This object will be visited after the main scene is visited.\n     This object MUST implement the \"visit\" selector.\n     Useful to hook a notification object, like tifications (http://github.com/manucorporat/tifications)\n     @since v0.99.5\n     */\n    de* getNotificationNode();\n    void setNotificationNode(de *node);\n    \n    /** rector delegate. It shall implemente the rectorDelegate protocol\n     @since v0.99.5\n     */\n    rectorDelegate* getDelegate() const;\n    void setDelegate(rectorDelegate* pDelegate);\n\n    // window size\n\n    /** returns the size of the OpenGL view in points.\n    */\n    ze getWinSize(void);\n\n    /** returns the size of the OpenGL view in pixels.\n    */\n    ze getWinSizeInPixels(void);\n    \n    /** returns visible size of the OpenGL view in points.\n     *  the value is equal to getWinSize if don't invoke\n     *  CCEGLView::setDesignResolutionSize()\n     */\n    ze getVisibleSize();\n    \n    /** returns visible origin of the OpenGL view in points.\n     */\n    int getVisibleOrigin();\n\n    /** converts a UIKit coordinate to an OpenGL coordinate\n     Useful to convert (multi) touch coordinates to the current layout (portrait or landscape)\n     */\n    int convertToGL(const int& obPoint);\n\n    /** converts an OpenGL coordinate to a UIKit coordinate\n     Useful to convert node points to window points for calls such as glScissor\n     */\n    int convertToUI(const int& obPoint);\n\n    /// XXX: missing description \n    float getZEye(void);\n\n    // Scene Management\n\n    /** Enters the Director's main loop with the given Scene.\n     * Call it to run only your FIRST scene.\n     * Don't call it if there is already a running scene.\n     *\n     * It will call pushScene: and then it will call startAnimation\n     */\n    void runWithScene(ene *pScene);\n\n    /** Suspends the execution of the running scene, pushing it on the stack of suspended scenes.\n     * The new scene will be executed.\n     * Try to avoid big stacks of pushed scenes to reduce memory allocation. \n     * ONLY call it if there is a running scene.\n     */\n    void pushScene(ene *pScene);\n\n    /** Pops out a scene from the queue.\n     * This scene will replace the running one.\n     * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated.\n     * ONLY call it if there is a running scene.\n     */\n    void popScene(void);\n\n    /** Pops out all scenes from the queue until the root scene in the queue.\n     * This scene will replace the running one.\n     * Internally it will call `popToSceneStackLevel(1)`\n     */\n    void popToRootScene(void);\n\n    /** Pops out all scenes from the queue until it reaches `level`.\n     If level is 0, it will end the director.\n     If level is 1, it will pop all scenes until it reaches to root scene.\n     If level is <= than the current stack level, it won't do anything.\n     */\n \tvoid popToSceneStackLevel(int level);\n\n    /** Replaces the running scene with a new one. The running scene is terminated.\n     * ONLY call it if there is a running scene.\n     */\n    void replaceScene(ene *pScene);\n\n    /** Ends the execution, releases the running scene.\n     It doesn't remove the OpenGL view from its parent. You have to do it manually.\n     */\n    void end(void);\n\n    /** Pauses the running scene.\n     The running scene will be _drawed_ but all scheduled timers will be paused\n     While paused, the draw rate will be 4 FPS to reduce CPU consumption\n     */\n    void pause(void);\n\n    /** Resumes the paused scene\n     The scheduled timers will be activated again.\n     The \"delta time\" will be 0 (as if the game wasn't paused)\n     */\n    void resume(void);\n\n    /** Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore.\n     If you don't want to pause your animation call [pause] instead.\n     */\n    virtual void stopAnimation(void) = 0;\n\n    /** The main loop is triggered again.\n     Call this function only if [stopAnimation] was called earlier\n     @warning Don't call this function to start the main loop. To run the main loop call runWithScene\n     */\n    virtual void startAnimation(void) = 0;\n\n    /** Draw the scene.\n    This method is called every frame. Don't call it manually.\n    */\n    void drawScene(void);\n\n    // Memory Helper\n\n    /** Removes cached all cocos2d cached data.\n     It will purge the xtureCache, riteFrameCache, belBMFont cache\n     @since v0.99.3\n     */\n    void purgeCachedData(void);\n\n    // OpenGL Helper\n\n    /** sets the OpenGL default values */\n    void setGLDefaultValues(void);\n\n    /** enables/disables OpenGL alpha blending */\n    void setAlphaBlending(bool bOn);\n\n    /** enables/disables OpenGL depth test */\n    void setDepthTest(bool bOn);\n\n    virtual void mainLoop(void) = 0;\n\n    /** The size in pixels of the surface. It could be different than the screen size.\n    High-res devices might have a higher surface size than the screen size.\n    Only available when compiled using SDK >= 4.0.\n    @since v0.99.4\n    */\n    void setContentScaleFactor(float scaleFactor);\n    float getContentScaleFactor(void);\n\npublic:\n    /** heduler associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(heduler*, _scheduler, Scheduler);\n\n    /** tionManager associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(tionManager*, _actionManager, ActionManager);\n\n    /** uchDispatcher associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(uchDispatcher*, _touchDispatcher, TouchDispatcher);\n\n#ifdef KEYBOARD_SUPPORT\n    /** yboardDispatcher associated with this director\n     @since v?.?\n     */\n    CC_PROPERTY(yboardDispatcher*, _keyboardDispatcher, KeyboardDispatcher);\n#endif\n    /** ypadDispatcher associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(ypadDispatcher*, _keypadDispatcher, KeypadDispatcher);\n\n    /** celerometer associated with this director\n     @since v2.0\n     */\n    CC_PROPERTY(celerometer*, _accelerometer, Accelerometer);\n\n    /* delta time since last tick to main loop */\n\tCC_PROPERTY_READONLY(float, _deltaTime, DeltaTime);\n\t\npublic:\n    /** returns a shared instance of the director */\n    static rector* sharedDirector(void);\n\nprotected:\n\n    void purgeDirector();\n    bool _purgeDirecotorInNextLoop; // this flag will be set to true in end()\n    \n    void setNextScene(void);\n    \n    void showStats();\n    void createStatsLabel();\n    void calculateMPF();\n    void getFPSImageData(unsigned char** datapointer, unsigned int* length);\n    \n    /** calculates delta time since last time it was called */    \n    void calculateDeltaTime();\nprotected:\n    /* The CCEGLView, where everything is rendered */\n    CCEGLView    *_openGLView;\n\n    double _animationInterval;\n    double _oldAnimationInterval;\n\n    /* landscape mode ? */\n    bool _landscape;\n    \n    bool _displayStats;\n    float _accumDt;\n    float _frameRate;\n    \n    belAtlas *_FPSLabel;\n    belAtlas *_SPFLabel;\n    belAtlas *_drawsLabel;\n    \n    /** Whether or not the Director is paused */\n    bool _paused;\n\n    /* How many frames were called since the director started */\n    unsigned int _totalFrames;\n    unsigned int _frames;\n    float _secondsPerFrame;\n     \n    /* The running scene */\n    ene *_runningScene;\n    \n    /* will be the next 'runningScene' in the next frame\n     nextScene is a weak reference. */\n    ene *_nextScene;\n    \n    /* If YES, then \"old\" scene will receive the cleanup message */\n    bool    _sendCleanupToScene;\n\n    /* scheduled scenes */\n    ray* _scenesStack;\n    \n    /* last time the main loop was updated */\n    struct cc_timeval *_lastUpdate;\n\n    /* whether or not the next delta time will be zero */\n    bool _nextDeltaTimeZero;\n    \n    /* projection used */\n    ccDirectorProjection _projection;\n\n    /* window size in points */\n    ze    _winSizeInPoints;\n    \n    /* content scale factor */\n    float    _contentScaleFactor;\n\n    /* store the fps string */\n    char *_FPS;\n\n    /* This object will be visited after the scene. Useful to hook a notification node */\n    de *_notificationNode;\n\n    /* Projection protocol delegate */\n    rectorDelegate *_projectionDelegate;\n    \n    // CCEGLViewProtocol will recreate stats labels to fit visible rect\n    friend class CCEGLViewProtocol;\n};\n\n/** \n @brief DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display.\n \n Features and Limitations:\n  - Scheduled timers & drawing are synchronizes with the refresh rate of the display\n  - Only supports animation intervals of 1/60 1/30 & 1/15\n \n @since v0.8.2\n */\nclass splayLinkDirector : public rector\n{\npublic:\n    splayLinkDirector(void) \n        : _invalid(false)\n    {}\n\n    virtual void mainLoop(void);\n    virtual void setAnimationInterval(double dValue);\n    virtual void startAnimation(void);\n    virtual void stopAnimation();\n\nprotected:\n    bool _invalid;\n};\n\n// end of base_node group\n/// @}\n\nNS_CC_END\n\n#endif // __CCDIRECTOR_H__\n"
  },
  {
    "path": "cocos2d/tools/jenkins-scripts/create-job.py",
    "content": "#create ghprb job by pr number\n\nimport os\nimport sys\nimport json\nimport requests\n\n#get pr number from cmd\npr_num = sys.argv[1]\n\n#get github access token\n\n\n#get pr data via github api\n\napi_get_pr = \"https://api.github.com/repos/cocos2d/cocos2d-x/pulls/\"+str(pr_num)\n\nr = requests.get(api_get_pr)\npr = r.json()\n\n#forge a payload\npayload = {\"action\":\"opened\",\"number\":\"\",\"pull_request\":\"\"}\npayload['number']=pr_num\npayload['pull_request']=pr\n\njenkins_trigger_url=\"http://115.28.134.83:8000/job/cocos-2dx-pull-request-build/buildWithParameters?token=ced2014\"\n\n#send trigger and payload\npost_data = {'payload':\"\"}\npost_data['payload']=json.dumps(payload)\nrequests.post(jenkins_trigger_url, data=post_data)\n"
  },
  {
    "path": "cocos2d/tools/jenkins-scripts/gen_jsb.sh",
    "content": "#!/bin/bash\n\n# Generate JS and Lua bindings for Cocos2D-X\n# ... using Android NDK system headers\n# ... and automatically update submodule references\n# ... and push these changes to remote repos\n\n# Dependencies\n#\n# For bindings generator:\n# (see ../../../tojs/genbindings.sh and ../../../tolua/genbindings.sh\n# ... for the defaults used if the environment is not customized)\n#\n#  * $PYTHON_BIN\n#  * $CLANG_ROOT\n#  * $NDK_ROOT\n#\necho \"[test]start generate js binding...\"\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nCOCOS2DX_ROOT=\"$DIR\"/../..\nTOJS_ROOT=$COCOS2DX_ROOT/tools/tojs\nTOLUA_ROOT=$COCOS2DX_ROOT/tools/tolua\nGENERATED_WORKTREE=\"$COCOS2DX_ROOT\"/cocos/scripting/auto-generated\n\n\n# Exit on error\nset -e\n\ngenerate_bindings_glue_codes()\n{\n    echo \"Create auto-generated jsbinding glue codes.\"\n    pushd \"$TOJS_ROOT\"\n    ./genbindings.sh\n    popd\n\n    echo \"Create auto-generated luabinding glue codes.\"\n    pushd \"$TOLUA_ROOT\"\n    ./genbindings.sh\n    popd\n}\n\n# Update submodule of auto-gen Binding repo.\npushd \"$GENERATED_WORKTREE\"\n\necho \"Delete all directories and files except '.git' and 'README.md'.\"\nls -a | grep -E -v ^\\[.\\]\\{1,2\\}$ | grep -E -v ^\\.git$ | grep -E -v ^README\\.md$ | xargs -I{} rm -rf {}\npopd\n\n\n\n# 1. Generate JS bindings\ngenerate_bindings_glue_codes\n\necho\necho Bindings generated successfully\necho\n\n\n"
  },
  {
    "path": "cocos2d/tools/jenkins-scripts/job-trigger.py",
    "content": "#Github pull reqest builder for Jenkins \n\nimport json\nimport re\nimport os\nimport requests\nimport sys\nimport traceback\n\ndef main():\n    #get payload from os env\n    payload_str = os.environ['payload']\n    #parse to json obj\n    payload = json.loads(payload_str)\n\n    #get pull number\n    pr_num = payload['number']\n    print 'pr_num:' + str(pr_num)\n\n    #build for pull request action 'open' and 'synchronize', skip 'close'\n    action = payload['action']\n    print 'action: ' + action\n\n    pr = payload['pull_request']\n    \n    url = pr['html_url']\n    print \"url:\" + url\n    \n    #get statuses url\n    statuses_url = pr['statuses_url']\n\n    #get pr target branch\n    branch = pr['base']['ref']\n\n    #set commit status to pending\n    target_url = os.environ['BUILD_URL']\n    \n    if(action == 'closed'):\n        print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered'\n        return(0)\n  \n    r = requests.get(pr['url']+\"/commits\")\n    commits = r.json()\n    last_commit = commits[len(commits)-1]\n    message = last_commit['commit']['message']\n\n    pattern = re.compile(\"\\[ci(\\s+)skip\\]\", re.I)\n    result = pattern.search(message)\n    if result is not None:\n        print 'skip build for pull request #' + str(pr_num)\n        return(0)\n    \n    data = {\"state\":\"pending\", \"target_url\":target_url}\n    access_token = os.environ['GITHUB_ACCESS_TOKEN']\n    Headers = {\"Authorization\":\"token \" + access_token} \n\n    try:\n        requests.post(statuses_url, data=json.dumps(data), headers=Headers)\n    except:\n        traceback.print_exc()\n\n    job_trigger_url = os.environ['JOB_TRIGGER_URL']\n    #send trigger and payload\n    post_data = {'payload':\"\"}\n    post_data['payload']= payload_str\n    requests.post(job_trigger_url, data=post_data)\n\n    return(0)\n\n# -------------- main --------------\nif __name__ == '__main__':\n    sys_ret = 0\n    try:    \n        sys_ret = main()\n    except:\n        traceback.print_exc()\n        sys_ret = 1\n    finally:\n        sys.exit(sys_ret)\n"
  },
  {
    "path": "cocos2d/tools/jenkins-scripts/pull-request-builder.py",
    "content": "#Github pull reqest builder for Jenkins \n\nimport json\nimport os\nimport re\nimport urllib2\nimport urllib\nimport base64\nimport requests\nimport sys\nimport traceback\nimport platform\nimport subprocess\n\n#set Jenkins build description using submitDescription to mock browser behavior\n#TODO: need to set parent build description \ndef set_description(desc, url):\n    req_data = urllib.urlencode({'description': desc})\n    req = urllib2.Request(url + 'submitDescription', req_data)\n    #print(os.environ['BUILD_URL'])\n    req.add_header('Content-Type', 'application/x-www-form-urlencoded') \n    base64string = base64.encodestring(os.environ['JENKINS_ADMIN']+ \":\" + os.environ['JENKINS_ADMIN_PW']).replace('\\n', '')\n    req.add_header(\"Authorization\", \"Basic \" + base64string)\n    try:\n        urllib2.urlopen(req)\n    except:\n        traceback.print_exc()\ndef main():\n    #get payload from os env\n    payload_str = os.environ['payload']\n    payload_str = payload_str.decode('utf-8','ignore')\n    #parse to json obj\n    payload = json.loads(payload_str)\n\n    #get pull number\n    pr_num = payload['number']\n    print 'pr_num:' + str(pr_num)\n\n    #build for pull request action 'open' and 'synchronize', skip 'close'\n    action = payload['action']\n    print 'action: ' + action\n\n    pr = payload['pull_request']\n    \n    url = pr['html_url']\n    print \"url:\" + url\n    pr_desc = '<h3><a href='+ url + '> pr#' + str(pr_num) + ' is '+ action +'</a></h3>'\n    \n\n\n    #get statuses url\n    statuses_url = pr['statuses_url']\n\n    #get pr target branch\n    branch = pr['base']['ref']\n\n    #set commit status to pending\n    #target_url = os.environ['BUILD_URL']\n    jenkins_url = os.environ['JENKINS_URL']\n    job_name = os.environ['JOB_NAME'].split('/')[0]\n    build_number = os.environ['BUILD_NUMBER']\n    target_url = jenkins_url + 'job/' + job_name + '/' + build_number + '/'\n\n    set_description(pr_desc, target_url)\n    \n    if(action == 'closed'):\n        print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered'\n        return(0)\n  \n    r = requests.get(pr['url']+\"/commits\")\n    commits = r.json()\n    last_commit = commits[len(commits)-1]\n    message = last_commit['commit']['message']\n\n    pattern = re.compile(\"\\[ci(\\s+)skip\\]\", re.I)\n    result = pattern.search(message)\n    if result is not None:\n        print 'skip build for pull request #' + str(pr_num)\n        return(0)\n    \n    data = {\"state\":\"pending\", \"target_url\":target_url}\n    access_token = os.environ['GITHUB_ACCESS_TOKEN']\n    Headers = {\"Authorization\":\"token \" + access_token} \n\n    try:\n        requests.post(statuses_url, data=json.dumps(data), headers=Headers)\n    except:\n        traceback.print_exc()\n\n    #reset path to workspace root\n    os.system(\"cd \" + os.environ['WORKSPACE']);\n    os.system(\"git checkout develop\")\n    os.system(\"git branch -D pull\" + str(pr_num))\n    #clean workspace\n    print \"git clean -xdf\"\n    os.system(\"git clean -xdf\")\n    \n   \n    #fetch pull request to local repo\n    git_fetch_pr = \"git fetch origin pull/\" + str(pr_num) + \"/head\"\n    os.system(git_fetch_pr)\n \n    #checkout\n    git_checkout = \"git checkout -b \" + \"pull\" + str(pr_num) + \" FETCH_HEAD\"\n    os.system(git_checkout)\n \n    #update submodule\n    git_update_submodule = \"git submodule update --init --force\"\n    os.system(git_update_submodule)\n\n    # Generate binding glue codes\n    if(branch == 'develop'):\n      if(platform.system() == 'Darwin'):\n        os.system(\"tools/jenkins-scripts/gen_jsb.sh\")\n      elif(platform.system() == 'Windows'):\n        os.chdir(\"tools/jenkins-scripts\")\n        os.system(\"gen_jsb_win32.bat\")\n        os.chdir(\"../..\")\n\n    #make temp dir\n    print \"current dir is\" + os.environ['WORKSPACE']\n    os.system(\"cd \" + os.environ['WORKSPACE']);\n    os.mkdir(\"android_build_objs\")\n    #add symbol link\n    PROJECTS=[\"Cpp/HelloCpp\",\"Cpp/TestCpp\",\"Cpp/SimpleGame\",\"Cpp/AssetsManagerTest\",\n            \"Javascript/TestJavascript\",\"Javascript/CocosDragonJS\",\"Javascript/CrystalCraze\",\n            \"Javascript/MoonWarriors\",\"Javascript/WatermelonWithMe\",\"Lua/HelloLua\",\"Lua/TestLua\"]\n    print platform.system()\n    if(platform.system() == 'Darwin'):\n        for item in PROJECTS:\n          cmd = \"ln -s \" + os.environ['WORKSPACE']+\"/android_build_objs/ \" + os.environ['WORKSPACE']+\"/samples/\"+item+\"/proj.android/obj\"  \n          os.system(cmd)\n    elif(platform.system() == 'Windows'):\n        for item in PROJECTS:\n          p = item.replace(\"/\", os.sep)\n          cmd = \"mklink /J \"+os.environ['WORKSPACE']+os.sep+\"samples\"+os.sep +p+os.sep+\"proj.android\"+os.sep+\"obj \" + os.environ['WORKSPACE']+os.sep+\"android_build_objs\"\n          print cmd\n          os.system(cmd)\n \n    #build\n    #TODO: support android-mac build currently\n    #TODO: add android-windows7 build\n    #TODO: add android-linux build\n    #TODO: add ios build\n    #TODO: add mac build\n    #TODO: add win32 build\n    node_name = os.environ['NODE_NAME']\n    if(branch == 'develop'):\n      if(node_name == 'android_mac') or (node_name == 'android_win7'):\n        ret = os.system(\"python build/android-build.py -n -j10 all\")\n      elif(node_name == 'win32_win7'):\n        ret = subprocess.call('\"%VS110COMNTOOLS%..\\IDE\\devenv.com\" \"build\\cocos2d-win32.vc2012.sln\" /Build \"Debug|Win32\"', shell=True)\n    elif(branch == 'master'):\n      if(platform.system() == 'Darwin'):\n        ret = os.system(\"samples/Cpp/TestCpp/proj.android/build_native.sh\")\n      else:\n        ret = 0\n\n    #get build result\n    print \"build finished and return \" + str(ret)\n    \n    exit_code = 1\n    if ret == 0:\n        exit_code = 0\n    else:\n        exit_code = 1\n    \n    #clean workspace\n    os.system(\"cd \" + os.environ['WORKSPACE']);\n    os.system(\"git checkout develop\")\n    os.system(\"git branch -D pull\" + str(pr_num))\n\n    return(exit_code)\n\n# -------------- main --------------\nif __name__ == '__main__':\n    sys_ret = 0\n    try:    \n        sys_ret = main()\n    except:\n        traceback.print_exc()\n        sys_ret = 1\n    finally:\n        sys.exit(sys_ret)\n"
  },
  {
    "path": "cocos2d/tools/localvartoauto/LocalVarToAuto.py",
    "content": "#!/usr/bin/python\n# LocalVarToAuto.py\n# Change the class name in local variable assignment to auto\n# Copyright (c) 2013 cocos2d-x.org\n# Author: YuBo\n\n# This script is used for change the class name in local variable assignment to auto.\n# Right now there is some poblems you might want notice:\n# To start we will assume we has a class A.\n# \n# 1. If you have classes like this:\n# class B : public A{}; \n# class C : public A{};\n# And you write code like this:\n# A* b = a_bclass_ptr;\n# C* c = new C();\n# ...\n# b = c;\n# We will change it to:\n# auto b = a_bclass_ptr;\n# auto c = new C();\n# It will cause a compile error because you assign pointer with type C to different pointer\n# with type B. You must edit it manually.\n#\n# 2. If your function has default params with class A, we will change it to auto you might\n# unexpected. For example:\n# void f(A* a = new A()){} or void f(A a = A()){}\n#\n# 3. If you have define macro like this:\n# #define ANOTHER_A_NAME A\n# and use it like this:\n# ANOTHER_A_NAME* a = new A();\n# We will not convert it to auto for you.\n\nimport sys\nimport os.path\nimport re\nimport types\nimport fileinput\nimport cStringIO\n\ntry:\n    import PathUtils\nexcept ImportError, e:\n    import os.path\n    sys.path.append(os.path.abspath(\"../pylib\"))\n    import PathUtils\n\n# The cocos root entry. We will aspect it as parent dictionary, all other file or dictionary\n# relative path are base on this.\nCOCOS_ROOT = \"../../\"\n# The class declaration dictionaries, we will search the class declaration with .h files in it.\nH_DIR = (\"cocos2dx\", \"CocosDenshion\", \"extensions\")\n# The src files you want to edit, we will search the .cpp and .mm files in it.\nCXX_DIR = (\"Samples\",)\n# The dictionaries and files with class declaration you don't want to search, you can exclude some third party\n# dictionaries in here\nEXCLUDE = (\"cocos2dx/platform/third_party/\",)\n# The macroes use with declare class, like \"class CC_DLL A{}\"\nMACROES_WITH_CLASS = (\"CC_DLL\",)\n# The strings represent the null pointer, because you set a point to null, we will not change that\n# variable to auto.\nNULL_PTR = (\"0\", \"NULL\", \"nullptr\")\n\n# normalize the path\nCOCOS_ROOT = os.path.abspath(os.path.join(os.curdir, COCOS_ROOT))\n\ndef collect_class_name(filename, st):\n    \"collect all class name appear in the file\"\n\t\n    #generate the rep\n    if not hasattr(collect_class_name, \"rep\"):\n        repString = cStringIO.StringIO()\n        repString.write(\"(?:\\s+|^)class\\s+\")\n        for word in MACROES_WITH_CLASS:\n            repString.write(word + \"\\s+\")\n        repString.write(\"(?P<cls_name>\\w+)\")\n\n        collect_class_name.rep = re.compile(repString.getvalue())\n        repString.close()\n\t\n    f = open(os.path.join(COCOS_ROOT, filename))\n    try:\n        for line in f:\n            res = collect_class_name.rep.match(line)\n            if res:\n                if type(st) == type(set()):\n                    st.add(res.group(\"cls_name\"))\n    finally:\n        f.close()\n\ndef change_local_classvarname_to_auto(filename, rep, change):\n    \"change all local class variable name to auto\"\n    f = open(filename)\n\t\n    content = None\n    changed = False\n    # read the file, change it, and save it to content\n    try:\n        content = cStringIO.StringIO()\n        changed = False\n\n        for line in f:\n            i = 0\n            #start to replace\n            while True:\n                result = rep.match(line, i)\n                # founded\n                if result:\n                    changed = True\n                    #find the matched string where to start\n                    startIndex = line.index(result.group(0))\n                    #replace the change part\n                    line = line.replace(result.group(change), \"auto \", startIndex)\n                    i += 1\n                else:\n                    break\n            #write the result to content\n            content.write(line)\n    finally:\n        f.close()\n        if changed:\n            f = open(filename, \"w\")\n            f.write(content.getvalue())\n            f.close()\n        content.close()\n\ndef main():\n\n    print \".......VARIABLES.......\"\n    print \"COCOS_ROOT:\",\n    print COCOS_ROOT\n    print \"H_DIR:\",\n    print H_DIR\n    print \"CXX_DIR:\",\n    print CXX_DIR\n    print \"EXCLUDE:\",\n    print EXCLUDE\n    print \".......VARIABLES END......\"\n\n    utils = PathUtils.PathUtils(COCOS_ROOT)\n    # save the .h file for search\n    hfiles = utils.find_files(H_DIR, (\"h\",), EXCLUDE)\n    # save the .cpp and .mm file for search\n    cxxfiles = utils.find_files(CXX_DIR, (\"cpp\", \"mm\"))\n\n    print \"search class declarations\"\n    # the class set, ignore the namespace\n    classes = set()\n    for file in hfiles:\n        collect_class_name(file, classes)\n    print \"search end\"\n\n    # generate example rep:\n    # (\\W+|^)(?P<keyWord>\\S*(?:Class1|Class2|class3)\\s*(?:\\*+|\\s+)\\s*)\\w+\\s*=(?!\\s*(?:0|NULL|nullptr)\\s*\\W)\n    # examples:\n    # Class1* c = new Class1() ; //match\n    # Class1* c;                 //not match\n    # Class1* c = nullptr;       //not match\n    # Class1* c = nullptrabc;    //match\n    # Class1 c;                  //not match\n    # Class1 c = Class1();       //match\n    def gen_rep(keyWord):\n        s = cStringIO.StringIO()\n        s.write(\"(?:\\W+|^)(?P<\")\n        s.write(keyWord)\n        s.write(\">(?:\")\n\n        # add classes want to match\n        first = True\n        for cls in classes:\n            if first:\n                first = False\n            else:\n                s.write(\"|\")\n\n            s.write(cls)\n\n        s.write(\")\\s*(?:\\*+|\\s+)\\s*)\\w+\\s*=(?!\\s*(?:\")\n\n        # let nullptr assignment not to convert\n        first = True\n        for nullptr in NULL_PTR:\n            if first:\n                first = False\n            else:\n                s.write(\"|\")\n\n            s.write(nullptr)\n\n        s.write(\")\\s*\\W)\")\n\n        result = s.getvalue()\n        s.close()\n\n        print \"generated regular expression is:\"\n        print result\n        return re.compile(result)\n\t\n    repWord = \"change\"\n    rep = gen_rep(repWord)\n\n\n    print \"scan and edit the .cxx files...\"\n    # scan the cxx files\n    for file in cxxfiles:\n        change_local_classvarname_to_auto(os.path.join(COCOS_ROOT, file), rep, repWord)\n \t\n    print \"success!\"\n\t\n\nif __name__ == \"__main__\":\n    main()\n\n"
  },
  {
    "path": "cocos2d/tools/make-package/Makefile",
    "content": "prefix=/usr/local\nEXEC_FILES=git-archive-all\n\nall:\n\t@echo \"usage: make install\"\n\t@echo \"       make uninstall\"\n\ninstall:\n\tinstall -d -m 0755 $(prefix)/bin\n\tinstall -m 0755 $(EXEC_FILES) $(prefix)/bin\n\nuninstall:\n\ttest -d $(prefix)/bin && \\\n\tcd $(prefix)/bin && \\\n\trm -f ${EXEC_FILES}\n"
  },
  {
    "path": "cocos2d/tools/make-package/README.markdown",
    "content": "Creates archive from the current state using `git ls-files --cached --full-name --no-empty-directory`. Supports for any level of submodules tree. Files from submodules are extracted using the same command.\n\n*License:* MIT\n\n*Usage:* `git-archive-all [-v] [--prefix PREFIX] [--no-exclude] [--force-submodules] [--dry-run] OUTPUT_FILE`\n\n*Options:*\n\n  **--version**             Show program's version number and exit.\n  \n  **-h, --help**            Show this help message and exit.\n  \n  **--prefix=PREFIX**       Prepend PREFIX to each filename in the archive. OUTPUT_FILE name is used by default to avoid tarbomb.\n\n  **--force-submodules**    Force a `git submodule init && git submodule update` at each level before iterating submodules\n  \n  **-v, --verbose**         Enable verbose mode.\n\n  **--no-exclude**          Don't read .gitattributes files for patterns containing export-ignore attributes.\n\n  **--dry-run**             Don't actually archive anything, just show what would be done.\n"
  },
  {
    "path": "cocos2d/tools/make-package/git-archive-all",
    "content": "#! /usr/bin/env python\n# coding=utf-8\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n__version__ = \"1.7\"\n\nimport sys\nfrom os import path, extsep\nfrom subprocess import Popen, PIPE, CalledProcessError\n\n\nclass GitArchiver(object):\n    \"\"\"\n    GitArchiver\n\n    Scan a git repository and export all tracked files, and submodules.\n    Checks for .gitattributes files in each directory and uses 'export-ignore'\n    pattern entries for ignore files in the archive.\n\n    Automatically detects output format extension: zip, tar, bz2, or gz.\n    \"\"\"\n\n    def __init__(self, prefix='', verbose=False, exclude=True, force_sub=False, extra=None, main_repo_abspath=None):\n        \"\"\"\n        @type prefix:   string\n        @param prefix:  Prefix used to prepend all paths in the resulting archive.\n\n        @type verbose:  bool\n        @param verbose: Determines verbosity of the output (stdout).\n\n        @type exclude:  bool\n        @param exclude: Determines whether archiver should follow rules specified in .gitattributes files.\n                        Defaults to True.\n\n        @type force_sub:    bool\n        @param force_sub:   Determines whether submodules are initialized and updated before archiving.\n                            Defaults to False\n\n        @type extra:    list\n        @param extra:   List of extra paths to include in the resulting archive.\n\n        @type main_repo_abspath:    string\n        @param main_repo_abspath:   Absolute path to the main repository (or one of subdirectories).\n                                    If None, current cwd is used.\n                                    If given path is path to a subdirectory (but not a submodule directory!)\n                                    it will be replaced with abspath to toplevel directory of the repository.\n        \"\"\"\n        if extra is None:\n            extra = []\n\n        if main_repo_abspath is None:\n            main_repo_abspath = path.abspath('')\n        elif not path.isabs(main_repo_abspath):\n            raise ValueError(\"You MUST pass absolute path to the main git repository.\")\n\n        # Raises an exception if there is no repo under main_repo_abspath.\n        try:\n            self.run_shell(\"[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1\", main_repo_abspath)\n        except Exception as e:\n            raise ValueError(\"Not a git repository (or any of the parent directories).\".format(path=main_repo_abspath))\n\n        # Detect toplevel directory of the repo.\n        main_repo_abspath = path.abspath(self.read_git_shell('git rev-parse --show-toplevel', main_repo_abspath).rstrip())\n\n        self.prefix = prefix\n        self.verbose = verbose\n        self.exclude = exclude\n        self.extra = extra\n        self.force_sub = force_sub\n        self.main_repo_abspath = main_repo_abspath\n\n    def create(self, output_path, dry_run=False, output_format=None):\n        \"\"\"\n        Creates the archive, written to the given output_file_path\n\n        Type of the archive is determined either by extension of output_file_path or by the format argument.\n        Supported formats are: gz, zip, bz2, tar, tgz\n\n        @type output_path:     string\n        @param output_path:    Output file path.\n\n        @type dry_run:  bool\n        @param dry_run: Determines whether create should do nothing but print what it would archive.\n\n        @type output_format:    string\n        @param output_format:   Determines format of the output archive.\n                                If None, format is determined from extension of output_file_path.\n        \"\"\"\n        if output_format is None:\n            file_name, file_ext = path.splitext(output_path)\n            output_format = file_ext[len(extsep):].lower()\n\n        if output_format == 'zip':\n            from zipfile import ZipFile, ZIP_DEFLATED\n\n            if not dry_run:\n                archive = ZipFile(path.abspath(output_path), 'w')\n                add = lambda file_path, file_name: archive.write(file_path, path.join(self.prefix, file_name), ZIP_DEFLATED)\n        elif output_format in ['tar', 'bz2', 'gz', 'tgz']:\n            import tarfile\n\n            if output_format == 'tar':\n                t_mode = 'w'\n            elif output_format == 'tgz':\n                t_mode = 'w:gz'\n            else:\n                t_mode = 'w:{f}'.format(f=output_format)\n\n            if not dry_run:\n                archive = tarfile.open(path.abspath(output_path), t_mode)\n                add = lambda file_path, file_name: archive.add(file_path, path.join(self.prefix, file_name))\n        else:\n            raise RuntimeError(\"Unknown format: {f}\".format(f=output_format))\n\n        for file_path in self.extra:\n            if not dry_run:\n                if self.verbose:\n                    print(\"Compressing {f} => {a}...\".format(f=file_path,\n                                                             a=path.join(self.prefix, file_path)))\n                add(file_path, file_path)\n            else:\n                print(\"{f} => {a}\".format(f=file_path,\n                                          a=path.join(self.prefix, file_path)))\n\n        for file_path in self.list_files():\n            if not dry_run:\n                if self.verbose:\n                    print(\"Compressing {f} => {a}...\".format(f=path.join(self.main_repo_abspath, file_path),\n                                                             a=path.join(self.prefix, file_path)))\n                add(path.join(self.main_repo_abspath, file_path), file_path)\n            else:\n                print(\"{f} => {a}\".format(f=path.join(self.main_repo_abspath, file_path),\n                                          a=path.join(self.prefix, file_path)))\n\n        if not dry_run:\n            archive.close()\n\n    def get_path_components(self, repo_abspath, abspath):\n        \"\"\"\n        Splits given abspath into components until repo_abspath is reached.\n\n        E.g. if repo_abspath is '/Documents/Hobby/ParaView/' and abspath is\n        '/Documents/Hobby/ParaView/Catalyst/Editions/Base/', function will return:\n        ['.', 'Catalyst', 'Editions', 'Base']\n\n        First element is always '.' (concrete symbol depends on OS).\n\n        @type repo_abspath:     string\n        @param repo_abspath:    Absolute path to the git repository.\n\n        @type abspath:  string\n        @param abspath: Absolute path to within repo_abspath.\n\n        @rtype:     list\n        @return:    List of path components.\n        \"\"\"\n        components = []\n\n        while not path.samefile(abspath, repo_abspath):\n            abspath, tail = path.split(abspath)\n\n            if len(tail):\n                components.insert(0, tail)\n\n        components.insert(0, path.relpath(repo_abspath, repo_abspath))\n        return components\n\n    def get_exclude_patterns(self, repo_abspath, repo_file_paths):\n        \"\"\"\n        Returns exclude patterns for a given repo. It looks for .gitattributes files in repo_file_paths.\n\n        Resulting dictionary will contain exclude patterns per path (relative to the repo_abspath).\n        E.g. {('.', 'Catalyst', 'Editions', 'Base'), ['Foo*', '*Bar']}\n\n        @type repo_abspath:     string\n        @param repo_abspath:    Absolute path to the git repository.\n\n        @type repo_file_paths:  list\n        @param repo_file_paths: List of paths relative to the repo_abspath that are under git control.\n\n        @rtype:         dict\n        @return:    Dictionary representing exclude patterns.\n                    Keys are tuples of strings. Values are lists of strings.\n                    Returns None if self.exclude is not set.\n        \"\"\"\n        if not self.exclude:\n            return None\n\n        def read_attributes(attributes_abspath):\n            patterns = []\n            if path.isfile(attributes_abspath):\n                attributes = open(attributes_abspath, 'r').readlines()\n                patterns = []\n                for line in attributes:\n                    tokens = line.strip().split()\n                    if \"export-ignore\" in tokens[1:]:\n                        patterns.append(tokens[0])\n            return patterns\n\n        exclude_patterns = {(): []}\n\n        # There may be no gitattributes.\n        try:\n            global_attributes_abspath = self.read_shell(\"git config --get core.attributesfile\", repo_abspath).rstrip()\n            exclude_patterns[()] = read_attributes(global_attributes_abspath)\n        except:\n            # And valid to not have them.\n            pass\n\n        for attributes_abspath in [path.join(repo_abspath, f) for f in repo_file_paths if f.endswith(\".gitattributes\")]:\n            # Each .gitattributes affects only files within its directory.\n            key = tuple(self.get_path_components(repo_abspath, path.dirname(attributes_abspath)))\n            exclude_patterns[key] = read_attributes(attributes_abspath)\n\n        local_attributes_abspath = path.join(repo_abspath, \".git\", \"info\", \"attributes\")\n        key = tuple(self.get_path_components(repo_abspath, repo_abspath))\n\n        if key in exclude_patterns:\n            exclude_patterns[key].extend(read_attributes(local_attributes_abspath))\n        else:\n            exclude_patterns[key] = read_attributes(local_attributes_abspath)\n\n        return exclude_patterns\n\n    def is_file_excluded(self, repo_abspath, repo_file_path, exclude_patterns):\n        \"\"\"\n        Checks whether file at a given path is excluded.\n\n        @type repo_abspath: string\n        @param repo_abspath: Absolute path to the git repository.\n\n        @type repo_file_path:   string\n        @param repo_file_path:  Path to a file within repo_abspath.\n\n        @type exclude_patterns:     dict\n        @param exclude_patterns:    Exclude patterns with format specified for get_exclude_patterns.\n\n        @rtype: bool\n        @return: True if file should be excluded. Otherwise False.\n        \"\"\"\n        if exclude_patterns is None or not len(exclude_patterns):\n            return False\n\n        from fnmatch import fnmatch\n\n        file_name = path.basename(repo_file_path)\n        components = self.get_path_components(repo_abspath, path.join(repo_abspath, path.dirname(repo_file_path)))\n\n        is_excluded = False\n        # We should check all patterns specified in intermediate directories to the given file.\n        # At the end we should also check for the global patterns (key '()' or empty tuple).\n        while not is_excluded:\n            key = tuple(components)\n            if key in exclude_patterns:\n                patterns = exclude_patterns[key]\n                for p in patterns:\n                    if fnmatch(file_name, p) or fnmatch(repo_file_path, p):\n                        if self.verbose:\n                            print(\"Exclude pattern matched {pattern}: {path}\".format(pattern=p, path=repo_file_path))\n                        is_excluded = True\n\n            if not len(components):\n                break\n\n            components.pop()\n\n        return is_excluded\n\n    def list_files(self, repo_path=''):\n        \"\"\"\n        An iterator method that yields a file path relative to main_repo_abspath\n        for each file that should be included in the archive.\n        Skips those that match the exclusion patterns found in\n        any discovered .gitattributes files along the way.\n\n        Recurs into submodules as well.\n\n        @type repo_path:    string\n        @param repo_path:   Path to the git submodule repository within the main git repository.\n\n        @rtype:     iterator\n        @return:    Iterator to traverse files under git control relative to main_repo_abspath.\n        \"\"\"\n        repo_abspath = path.join(self.main_repo_abspath, repo_path)\n        repo_file_paths = self.read_git_shell(\"git ls-files --cached --full-name --no-empty-directory\", repo_abspath).splitlines()\n        exclude_patterns = self.get_exclude_patterns(repo_abspath, repo_file_paths)\n\n        for repo_file_path in repo_file_paths:\n            # Git puts path in quotes if file path has unicode characters.\n            repo_file_path = repo_file_path.strip('\"')  # file path relative to current repo\n            file_name = path.basename(repo_file_path)\n\n            # Only list symlinks and files that don't start with git.\n            if (not path.islink(repo_file_path) and path.isdir(repo_file_path)):\n                continue\n\n            main_repo_file_path = path.join(repo_path, repo_file_path)  # file path relative to the main repo\n\n            if self.is_file_excluded(repo_abspath, repo_file_path, exclude_patterns):\n                continue\n\n            # Yield both repo_file_path and main_repo_file_path to preserve structure of the repo.\n            yield main_repo_file_path\n\n        if self.force_sub:\n            self.run_shell(\"git submodule init\", repo_abspath)\n            self.run_shell(\"git submodule update\", repo_abspath)\n\n        # List files of every submodule.\n        for submodule_path in self.read_shell(\"git submodule --quiet foreach 'pwd'\", repo_abspath).splitlines():\n            # In order to get output path we need to exclude repository path from submodule_path.\n            submodule_path = path.relpath(submodule_path, self.main_repo_abspath)\n            for file_path in self.list_files(submodule_path):\n                yield file_path\n\n    @staticmethod\n    def run_shell(cmd, cwd=None):\n        \"\"\"\n        Runs shell command.\n\n        @type cmd:  string\n        @param cmd: Command to be executed.\n\n        @type cwd:  string\n        @param cwd: Working directory.\n\n        @rtype:     int\n        @return:    Return code of the command.\n\n        @raise CalledProcessError:  Raises exception if return code of the command is non-zero.\n        \"\"\"\n        p = Popen(cmd, shell=True, cwd=cwd)\n        p.wait()\n\n        if p.returncode:\n            raise CalledProcessError(returncode=p.returncode, cmd=cmd)\n\n        return p.returncode\n\n    @staticmethod\n    def read_shell(cmd, cwd=None, encoding='utf-8'):\n        \"\"\"\n        Runs shell command and reads output.\n\n        @type cmd:  string\n        @param cmd: Command to be executed.\n\n        @type cwd:  string\n        @param cwd: Working directory.\n\n        @type encoding: string\n        @param encoding: Encoding used to decode bytes returned by Popen into string.\n\n        @rtype:     string\n        @return:    Output of the command.\n\n        @raise CalledProcessError:  Raises exception if return code of the command is non-zero.\n        \"\"\"\n        p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd)\n        output, _ = p.communicate()\n        output = output.decode(encoding)\n\n        if p.returncode:\n            raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output)\n\n        return output\n\n    @staticmethod\n    def read_git_shell(cmd, cwd=None):\n        \"\"\"\n        Runs git shell command, reads output and decodes it into unicode string\n\n        @type cmd:  string\n        @param cmd: Command to be executed.\n\n        @type cwd:  string\n        @param cwd: Working directory.\n\n        @rtype:     string\n        @return:    Output of the command.\n\n        @raise CalledProcessError:  Raises exception if return code of the command is non-zero.\n        \"\"\"\n        p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd)\n        output, _ = p.communicate()\n        output = output.decode('unicode_escape').encode('raw_unicode_escape').decode('utf-8')\n\n        if p.returncode:\n            raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output)\n\n        return output\n\n\nif __name__ == '__main__':\n    from optparse import OptionParser\n\n    parser = OptionParser(usage=\"usage: %prog [-v] [--prefix PREFIX] [--no-exclude] [--force-submodules] [--dry-run] OUTPUT_FILE\",\n                          version=\"%prog {version}\".format(version=__version__))\n\n    parser.add_option('--prefix',\n                      type='string',\n                      dest='prefix',\n                      default='',\n                      help=\"Prepend PREFIX to each filename in the archive. OUTPUT_FILE name is used by default to avoid tarbomb.\")\n\n    parser.add_option('-v', '--verbose',\n                      action='store_true',\n                      dest='verbose',\n                      help='Enable verbose mode.')\n\n    parser.add_option('--no-exclude',\n                      action='store_false',\n                      dest='exclude',\n                      default=True,\n                      help=\"Don't read .gitattributes files for patterns containing export-ignore attrib.\")\n\n    parser.add_option('--force-submodules',\n                      action='store_true',\n                      dest='force_sub',\n                      help=\"Force a git submodule init && git submodule update at each level before iterating submodules.\")\n\n    parser.add_option('--extra',\n                      action='append',\n                      dest='extra',\n                      default=[],\n                      help=\"Any additional files to include in the archive.\")\n    parser.add_option('--dry-run',\n                      action='store_true',\n                      dest='dry_run',\n                      help=\"Don't actually archive anything, just show what would be done.\")\n\n    options, args = parser.parse_args()\n\n    if len(args) != 1:\n        parser.error(\"You must specify exactly one output file\")\n\n    output_file_path = args[0]\n\n    if path.isdir(output_file_path):\n        parser.error(\"You cannot use directory as output\")\n\n    # avoid tarbomb\n    if options.prefix:\n        options.prefix = path.join(options.prefix, '')\n    else:\n        import re\n\n        output_name = path.basename(output_file_path)\n        output_name = re.sub('(\\.zip|\\.tar|\\.tgz|\\.gz|\\.bz2|\\.tar\\.gz|\\.tar\\.bz2)$', '', output_name) or \"Archive\"\n        options.prefix = path.join(output_name, '')\n\n    try:\n        archiver = GitArchiver(options.prefix,\n                               options.verbose,\n                               options.exclude,\n                               options.force_sub,\n                               options.extra)\n        archiver.create(output_file_path, options.dry_run)\n    except Exception as e:\n        parser.exit(2, \"{exception}\\n\".format(exception=e))\n\n    sys.exit(0)\n"
  },
  {
    "path": "cocos2d/tools/project-creator/README.md",
    "content": "#Creating A Project\n\nFirst you need to install the Python environment.\n\nThere are two ways to create a new cocos project.\nNotice: The best project path is an English path without spaces.\n##1.UI\n* Windows: double click the \"create_project.py\" file\n* Mac: use `./create_project.py`\n* Linux: The Tkinter library was not installed automatically in Linux, therefore, in order to use the GUI to operate, you have to install Tkinter manually (see http://tkinter.unpythonic.net/wiki/How_to_install_Tkinter). There is another way to create projects by command line. See below for details.\n\n##2.console\nTo use this, open the terminal and type:\n```\n\t$ cd cocos2d-x/tools/project-creator\n\t$ ./project-creator.py --help\n\t$ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame\n\t$ cd /home/mygame\n```\n"
  },
  {
    "path": "cocos2d/tools/project-creator/config-create/config.gitingore",
    "content": "#This configure file use .gitingore rules.\n#So you can config this file like config .gitingore\n#\n\n# Ignore thumbnails created by windows\nThumbs.db\n.git\n\n# ignore copy files\n/lib\n/linux-build\n/samples\n/template\n\n# Ignore files build by Visual Studio\nwin32-msvc-vs201*-x86\n*.obj\n*.exe\n*.pdb\n*.aps\n*.vcproj.*.user\n*.vspscc\n*_i.c\n*.i\n*.icf\n*_p.c\n*.ncb\n*.suo\n*.tlb\n*.tlh\n*.bak\n*.cache\n*.ilk\n*.log\n[Bb]in\n[Dd]ebug/\n[Dd]ebug.win32/\n*.sbr\n*.sdf\nobj/\n[Rr]elease/\n[Rr]elease.win32/\n_ReSharper*/\n[Tt]est[Rr]esult*\nipch/\n*.opensdf\n\n# Ignore files build by ndk and eclipse\nlibs/\nbin/\nobj/\ngen/\nassets/\nlocal.properties\n\n# Ignore python compiled files\n*.pyc\n\n# Ignore files build by airplay and marmalade\nbuild_*_xcode/\nbuild_*_vc10/\n\n# Ignore files build by xcode\n*.mode*v*\n*.pbxuser\n*.xcbkptlist\n*.xcscheme\n*.xcworkspacedata\n*.xcuserstate\n*.xccheckout\nxcschememanagement.plist\n.DS_Store\n._.*\nxcuserdata/\nDerivedData/\n\n# Ignore files built by AppCode\n.idea/\n\n# Ignore files built by bada\n.Simulator-Debug/\n.Target-Debug/\n.Target-Release/\n\n# Ignore files built by blackberry\nSimulator/\nDevice-Debug/\nDevice-Release/\n\n# Ignore vim swaps\n*.swp\n*.swo\n\n# Ignore files created by create_project.py\n/projects\n\n# CTags\ntags\n\n#include\n!/tools/cocos2d-console/console/bin/\n!/plugin-x/plugin-x_ios.xcworkspace/"
  },
  {
    "path": "cocos2d/tools/project-creator/config-create/create_config.py",
    "content": "#!/usr/bin/python\n#coding=utf-8\n\"\"\"****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************\"\"\"\n\nimport os\nimport sys\nimport re\n\nclass CocosFileList:\n    \"\"\"\n    Function:\n        List cocos engine's files and save to \"../module/cocos_file_list.json\".\n        config \"config.gitingore\" file  can set exclude or include files.\n    \"\"\"\n\n    def __init__(self):\n        self.excludeConfig=[]\n        self.inludeConfig=[]\n        self.rootDir = \"\"\n        self.fileList=[]\n\n    def readIngoreFile(self, fileName):\n        \"\"\"\n            Read configure file which use \".gitingore\"'s rules.\n        \"\"\"\n        pfile = \"\"\n        try:\n            pfile = open(fileName, 'r')\n        except IOError:\n            return\n\n        for line in pfile:\n            line = line.strip()\n            if not line or line[0] == \"#\":\n                continue\n\n            #convert .gitingore regular expression to python's regular expression\n            line=line.replace('.', '\\\\.')\n            line=line.replace('*', '.*')\n            line=\"%s$\" %line\n            if line[0] == \"!\":\n                self.inludeConfig.append(line[1:])\n            else:\n                self.excludeConfig.append(line)\n        pfile.close()\n\n    def parseFileList(self, rootDir):\n        self.rootDir = os.path.abspath(rootDir)\n        self.__parseFileList(rootDir)\n\n    def __parseFileList(self, folderdir):\n        \"\"\"\n        \"\"\"\n        for item in os.listdir(folderdir):\n            path = os.path.join(folderdir, item)\n            relativePath = path[len(self.rootDir)+1:len(path)]\n            relativePath = relativePath.replace('\\\\', '/')\n            if os.path.isdir(path):\n                if (\n                      self.__bInclude(\"/%s\" %relativePath) or\n                      self.__bInclude(\"/%s/\" %relativePath) or\n                      self.__bInclude(item) or\n                      self.__bInclude(\"%s/\" %item)\n                    ):\n                        self.fileList.append(\"%s/\" %relativePath)\n                        continue\n                if (\n                     self.__bExclude(\"/%s\" %relativePath) or\n                     self.__bExclude(\"/%s/\" %relativePath) or\n                     self.__bExclude(item) or\n                     self.__bExclude(\"%s/\" %item)\n                    ):\n                        continue\n                self.__parseFileList(path)\n            else:\n                if (\n                    not self.__bInclude(\"/%s\" %relativePath) and\n                    not self.__bInclude(item)\n                    ):\n                        if (\n                            self.__bExclude(\"/%s\" %relativePath) or\n                            self.__bExclude(item)\n                        ):\n                            continue\n                print(relativePath)\n                self.fileList.append(relativePath)\n\n    def __bExclude(self, item):\n        bexclude = False\n        for index in range(len(self.excludeConfig)):\n            if re.match(self.excludeConfig[index], item):\n                bexclude = True\n                break\n        return bexclude\n\n    def __bInclude(self, item):\n        binclude = False\n        for index in range(len(self.inludeConfig)):\n            if re.match(self.inludeConfig[index], item):\n                binclude = True\n                break\n        return binclude\n\n    def writeFileList(self,fileName):\n        \"\"\"\n            Save content to file with json format.\n        \"\"\"\n        f = open(fileName,\"w\")\n        content = \"[\\n\\\"%s\\\"\\n]\" % (\"\\\",\\n\\\"\".join(self.fileList))\n        f.write(content)\n        f.close()\n        return True\n\n# ------------ main --------------\nif __name__ == '__main__':\n\n    cocos_root =os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"..\"))\n    cocos_file_path =os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\", \"module\", \"cocos_files.json\"))\n    cocos_file_ingore =os.path.abspath(os.path.join(os.path.dirname(__file__), \"config.gitingore\"))\n    print (\"begin list files\")\n    cocosObj = CocosFileList()\n    cocosObj.readIngoreFile(cocos_file_ingore)\n    cocosObj.parseFileList(cocos_root)\n    cocosObj.writeFileList(cocos_file_path)\n    print (\"had list files to cocos_file_list.json\")\n\n"
  },
  {
    "path": "cocos2d/tools/project-creator/create_project.py",
    "content": "#!/usr/bin/python\n#coding=utf-8\n\"\"\"****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************\"\"\"\n\nimport sys\ndef commandCreate():\n        from module.core import CocosProject\n        project = CocosProject()\n        name, package, language, path = project.checkParams()\n        project.createPlatformProjects(name, package, language, path)\n\n\n# ------------ main --------------\nif __name__ == '__main__':\n    \"\"\"\n    There have double ways to create cocos project.\n    1.UI\n    2.console\n        #create_project.py --help\n        #create_project.py -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany\n    \"\"\"\n    if len(sys.argv)==1:\n        try:\n            from module.ui import createTkCocosDialog\n            createTkCocosDialog()\n        except ImportError:\n            commandCreate()\n    else:\n        commandCreate()\n\n\n"
  },
  {
    "path": "cocos2d/tools/project-creator/module/__init__.py",
    "content": ""
  },
  {
    "path": "cocos2d/tools/project-creator/module/android.json",
    "content": "{\n    \"rename\":               [],\n    \"remove\":               [\"assets\",\n                             \"bin\",\n                             \"libs\",\n                             \"gen\",\n                             \"obj\",\n                             \"wsocket.c\",\n                             \"wsocket.h\"],\n    \"replace_package_name\": [\"AndroidManifest.xml\"],\n    \"replace_project_name\": [\".project\",\n                             \".cproject\",\n                             \"AndroidManifest.xml\",\n                             \"build.xml\",\n                             \"build_native.sh\",\n                             \"build_native.cmd\",\n                             \"res/values/strings.xml\"]\n}\n"
  },
  {
    "path": "cocos2d/tools/project-creator/module/cocos_files.json",
    "content": "[\n\".gitattributes\",\n\".gitignore\",\n\".gitmodules\",\n\".travis.yml\",\n\"AUTHORS\",\n\"build/android-build.py\",\n\"build/build-mingw32-gcc-make.sh\",\n\"build/BuildHelpers.CMakeLists.txt\",\n\"build/cocos2d-win32.vc2012.sln\",\n\"build/cocos2d_libs.xcodeproj/project.pbxproj\",\n\"build/cocos2d_samples.xcodeproj/project.pbxproj\",\n\"build/install-deps-linux.sh\",\n\"build/win32-msvc-2010-x86.cmd\",\n\"build/win32-msvc-2012-x86.cmd\",\n\"build/win32-msvc-2013-x86.cmd\",\n\"CHANGELOG\",\n\"CMakeLists.txt\",\n\"cocos/2d/Android.mk\",\n\"cocos/2d/base64.cpp\",\n\"cocos/2d/base64.h\",\n\"cocos/2d/CCAction.cpp\",\n\"cocos/2d/CCAction.h\",\n\"cocos/2d/CCActionCamera.cpp\",\n\"cocos/2d/CCActionCamera.h\",\n\"cocos/2d/CCActionCatmullRom.cpp\",\n\"cocos/2d/CCActionCatmullRom.h\",\n\"cocos/2d/CCActionEase.cpp\",\n\"cocos/2d/CCActionEase.h\",\n\"cocos/2d/CCActionGrid.cpp\",\n\"cocos/2d/CCActionGrid.h\",\n\"cocos/2d/CCActionGrid3D.cpp\",\n\"cocos/2d/CCActionGrid3D.h\",\n\"cocos/2d/CCActionInstant.cpp\",\n\"cocos/2d/CCActionInstant.h\",\n\"cocos/2d/CCActionInterval.cpp\",\n\"cocos/2d/CCActionInterval.h\",\n\"cocos/2d/CCActionManager.cpp\",\n\"cocos/2d/CCActionManager.h\",\n\"cocos/2d/CCActionPageTurn3D.cpp\",\n\"cocos/2d/CCActionPageTurn3D.h\",\n\"cocos/2d/CCActionProgressTimer.cpp\",\n\"cocos/2d/CCActionProgressTimer.h\",\n\"cocos/2d/CCActionTiledGrid.cpp\",\n\"cocos/2d/CCActionTiledGrid.h\",\n\"cocos/2d/CCActionTween.cpp\",\n\"cocos/2d/CCActionTween.h\",\n\"cocos/2d/CCAnimation.cpp\",\n\"cocos/2d/CCAnimation.h\",\n\"cocos/2d/CCAnimationCache.cpp\",\n\"cocos/2d/CCAnimationCache.h\",\n\"cocos/2d/CCAtlasNode.cpp\",\n\"cocos/2d/CCAtlasNode.h\",\n\"cocos/2d/ccCArray.cpp\",\n\"cocos/2d/ccCArray.h\",\n\"cocos/2d/CCClippingNode.cpp\",\n\"cocos/2d/CCClippingNode.h\",\n\"cocos/2d/CCComponent.cpp\",\n\"cocos/2d/CCComponent.h\",\n\"cocos/2d/CCComponentContainer.cpp\",\n\"cocos/2d/CCComponentContainer.h\",\n\"cocos/2d/ccConfig.h\",\n\"cocos/2d/CCConfiguration.cpp\",\n\"cocos/2d/CCConfiguration.h\",\n\"cocos/2d/CCDeprecated.cpp\",\n\"cocos/2d/CCDeprecated.h\",\n\"cocos/2d/CCDirector.cpp\",\n\"cocos/2d/CCDirector.h\",\n\"cocos/2d/CCDrawingPrimitives.cpp\",\n\"cocos/2d/CCDrawingPrimitives.h\",\n\"cocos/2d/CCDrawNode.cpp\",\n\"cocos/2d/CCDrawNode.h\",\n\"cocos/2d/CCEvent.cpp\",\n\"cocos/2d/CCEvent.h\",\n\"cocos/2d/CCEventAcceleration.cpp\",\n\"cocos/2d/CCEventAcceleration.h\",\n\"cocos/2d/CCEventCustom.cpp\",\n\"cocos/2d/CCEventCustom.h\",\n\"cocos/2d/CCEventDispatcher.cpp\",\n\"cocos/2d/CCEventDispatcher.h\",\n\"cocos/2d/CCEventKeyboard.cpp\",\n\"cocos/2d/CCEventKeyboard.h\",\n\"cocos/2d/CCEventListener.cpp\",\n\"cocos/2d/CCEventListener.h\",\n\"cocos/2d/CCEventListenerAcceleration.cpp\",\n\"cocos/2d/CCEventListenerAcceleration.h\",\n\"cocos/2d/CCEventListenerCustom.cpp\",\n\"cocos/2d/CCEventListenerCustom.h\",\n\"cocos/2d/CCEventListenerKeyboard.cpp\",\n\"cocos/2d/CCEventListenerKeyboard.h\",\n\"cocos/2d/CCEventListenerMouse.cpp\",\n\"cocos/2d/CCEventListenerMouse.h\",\n\"cocos/2d/CCEventListenerTouch.cpp\",\n\"cocos/2d/CCEventListenerTouch.h\",\n\"cocos/2d/CCEventMouse.cpp\",\n\"cocos/2d/CCEventMouse.h\",\n\"cocos/2d/CCEventTouch.cpp\",\n\"cocos/2d/CCEventTouch.h\",\n\"cocos/2d/CCEventType.h\",\n\"cocos/2d/CCFont.cpp\",\n\"cocos/2d/CCFont.h\",\n\"cocos/2d/CCFontAtlas.cpp\",\n\"cocos/2d/CCFontAtlas.h\",\n\"cocos/2d/CCFontAtlasCache.cpp\",\n\"cocos/2d/CCFontAtlasCache.h\",\n\"cocos/2d/CCFontCharMap.cpp\",\n\"cocos/2d/CCFontCharMap.h\",\n\"cocos/2d/CCFontFNT.cpp\",\n\"cocos/2d/CCFontFNT.h\",\n\"cocos/2d/CCFontFreeType.cpp\",\n\"cocos/2d/CCFontFreeType.h\",\n\"cocos/2d/ccFPSImages.c\",\n\"cocos/2d/ccFPSImages.h\",\n\"cocos/2d/CCGLBufferedNode.cpp\",\n\"cocos/2d/CCGLBufferedNode.h\",\n\"cocos/2d/CCGLProgram.cpp\",\n\"cocos/2d/CCGLProgram.h\",\n\"cocos/2d/ccGLStateCache.cpp\",\n\"cocos/2d/ccGLStateCache.h\",\n\"cocos/2d/CCGrabber.cpp\",\n\"cocos/2d/CCGrabber.h\",\n\"cocos/2d/CCGrid.cpp\",\n\"cocos/2d/CCGrid.h\",\n\"cocos/2d/CCIMEDelegate.h\",\n\"cocos/2d/CCIMEDispatcher.cpp\",\n\"cocos/2d/CCIMEDispatcher.h\",\n\"cocos/2d/CCLabel.cpp\",\n\"cocos/2d/CCLabel.h\",\n\"cocos/2d/CCLabelAtlas.cpp\",\n\"cocos/2d/CCLabelAtlas.h\",\n\"cocos/2d/CCLabelBMFont.cpp\",\n\"cocos/2d/CCLabelBMFont.h\",\n\"cocos/2d/CCLabelTextFormatter.cpp\",\n\"cocos/2d/CCLabelTextFormatter.h\",\n\"cocos/2d/CCLabelTTF.cpp\",\n\"cocos/2d/CCLabelTTF.h\",\n\"cocos/2d/CCLayer.cpp\",\n\"cocos/2d/CCLayer.h\",\n\"cocos/2d/ccMacros.h\",\n\"cocos/2d/CCMenu.cpp\",\n\"cocos/2d/CCMenu.h\",\n\"cocos/2d/CCMenuItem.cpp\",\n\"cocos/2d/CCMenuItem.h\",\n\"cocos/2d/CCMotionStreak.cpp\",\n\"cocos/2d/CCMotionStreak.h\",\n\"cocos/2d/CCNode.cpp\",\n\"cocos/2d/CCNode.h\",\n\"cocos/2d/CCNodeGrid.cpp\",\n\"cocos/2d/CCNodeGrid.h\",\n\"cocos/2d/CCNotificationCenter.cpp\",\n\"cocos/2d/CCNotificationCenter.h\",\n\"cocos/2d/CCParallaxNode.cpp\",\n\"cocos/2d/CCParallaxNode.h\",\n\"cocos/2d/CCParticleBatchNode.cpp\",\n\"cocos/2d/CCParticleBatchNode.h\",\n\"cocos/2d/CCParticleExamples.cpp\",\n\"cocos/2d/CCParticleExamples.h\",\n\"cocos/2d/CCParticleSystem.cpp\",\n\"cocos/2d/CCParticleSystem.h\",\n\"cocos/2d/CCParticleSystemQuad.cpp\",\n\"cocos/2d/CCParticleSystemQuad.h\",\n\"cocos/2d/CCProfiling.cpp\",\n\"cocos/2d/CCProfiling.h\",\n\"cocos/2d/CCProgressTimer.cpp\",\n\"cocos/2d/CCProgressTimer.h\",\n\"cocos/2d/CCProtocols.h\",\n\"cocos/2d/CCRenderTexture.cpp\",\n\"cocos/2d/CCRenderTexture.h\",\n\"cocos/2d/CCScene.cpp\",\n\"cocos/2d/CCScene.h\",\n\"cocos/2d/CCScheduler.cpp\",\n\"cocos/2d/CCScheduler.h\",\n\"cocos/2d/CCScriptSupport.cpp\",\n\"cocos/2d/CCScriptSupport.h\",\n\"cocos/2d/ccShader_Label_frag.h\",\n\"cocos/2d/ccShader_Label_frag_glow.h\",\n\"cocos/2d/ccShader_Label_frag_outline.h\",\n\"cocos/2d/ccShader_Label_frag_shadow.h\",\n\"cocos/2d/ccShader_Label_vert.h\",\n\"cocos/2d/ccShader_Position_uColor_frag.h\",\n\"cocos/2d/ccShader_Position_uColor_vert.h\",\n\"cocos/2d/ccShader_PositionColor_frag.h\",\n\"cocos/2d/ccShader_PositionColor_vert.h\",\n\"cocos/2d/ccShader_PositionColorLengthTexture_frag.h\",\n\"cocos/2d/ccShader_PositionColorLengthTexture_vert.h\",\n\"cocos/2d/ccShader_PositionTexture_frag.h\",\n\"cocos/2d/ccShader_PositionTexture_uColor_frag.h\",\n\"cocos/2d/ccShader_PositionTexture_uColor_vert.h\",\n\"cocos/2d/ccShader_PositionTexture_vert.h\",\n\"cocos/2d/ccShader_PositionTextureA8Color_frag.h\",\n\"cocos/2d/ccShader_PositionTextureA8Color_vert.h\",\n\"cocos/2d/ccShader_PositionTextureColor_frag.h\",\n\"cocos/2d/ccShader_PositionTextureColor_noMVP_frag.h\",\n\"cocos/2d/ccShader_PositionTextureColor_noMVP_vert.h\",\n\"cocos/2d/ccShader_PositionTextureColor_vert.h\",\n\"cocos/2d/ccShader_PositionTextureColorAlphaTest_frag.h\",\n\"cocos/2d/CCShaderCache.cpp\",\n\"cocos/2d/CCShaderCache.h\",\n\"cocos/2d/ccShaderEx_SwitchMask_frag.h\",\n\"cocos/2d/ccShaders.cpp\",\n\"cocos/2d/ccShaders.h\",\n\"cocos/2d/CCSprite.cpp\",\n\"cocos/2d/CCSprite.h\",\n\"cocos/2d/CCSpriteBatchNode.cpp\",\n\"cocos/2d/CCSpriteBatchNode.h\",\n\"cocos/2d/CCSpriteFrame.cpp\",\n\"cocos/2d/CCSpriteFrame.h\",\n\"cocos/2d/CCSpriteFrameCache.cpp\",\n\"cocos/2d/CCSpriteFrameCache.h\",\n\"cocos/2d/CCTextFieldTTF.cpp\",\n\"cocos/2d/CCTextFieldTTF.h\",\n\"cocos/2d/CCTexture2D.cpp\",\n\"cocos/2d/CCTexture2D.h\",\n\"cocos/2d/CCTextureAtlas.cpp\",\n\"cocos/2d/CCTextureAtlas.h\",\n\"cocos/2d/CCTextureCache.cpp\",\n\"cocos/2d/CCTextureCache.h\",\n\"cocos/2d/CCTileMapAtlas.cpp\",\n\"cocos/2d/CCTileMapAtlas.h\",\n\"cocos/2d/CCTMXLayer.cpp\",\n\"cocos/2d/CCTMXLayer.h\",\n\"cocos/2d/CCTMXObjectGroup.cpp\",\n\"cocos/2d/CCTMXObjectGroup.h\",\n\"cocos/2d/CCTMXTiledMap.cpp\",\n\"cocos/2d/CCTMXTiledMap.h\",\n\"cocos/2d/CCTMXXMLParser.cpp\",\n\"cocos/2d/CCTMXXMLParser.h\",\n\"cocos/2d/CCTouch.cpp\",\n\"cocos/2d/CCTouch.h\",\n\"cocos/2d/CCTransition.cpp\",\n\"cocos/2d/CCTransition.h\",\n\"cocos/2d/CCTransitionPageTurn.cpp\",\n\"cocos/2d/CCTransitionPageTurn.h\",\n\"cocos/2d/CCTransitionProgress.cpp\",\n\"cocos/2d/CCTransitionProgress.h\",\n\"cocos/2d/ccTypes.cpp\",\n\"cocos/2d/ccTypes.h\",\n\"cocos/2d/CCUserDefault.cpp\",\n\"cocos/2d/CCUserDefault.h\",\n\"cocos/2d/CCUserDefault.mm\",\n\"cocos/2d/CCUserDefaultAndroid.cpp\",\n\"cocos/2d/ccUTF8.cpp\",\n\"cocos/2d/ccUTF8.h\",\n\"cocos/2d/ccUtils.cpp\",\n\"cocos/2d/ccUtils.h\",\n\"cocos/2d/CCVertex.cpp\",\n\"cocos/2d/CCVertex.h\",\n\"cocos/2d/CMakeLists.txt\",\n\"cocos/2d/cocos2d.cpp\",\n\"cocos/2d/cocos2d.h\",\n\"cocos/2d/cocos2d.vcxproj\",\n\"cocos/2d/cocos2d.vcxproj.filters\",\n\"cocos/2d/cocos2d.vcxproj.user\",\n\"cocos/2d/cocos2d_headers.props\",\n\"cocos/2d/cocos2dx-Prefix.pch\",\n\"cocos/2d/cocos2dx.mk\",\n\"cocos/2d/cocos2dx.props\",\n\"cocos/2d/firePngData.h\",\n\"cocos/2d/platform/android/Android.mk\",\n\"cocos/2d/platform/android/CCApplication.cpp\",\n\"cocos/2d/platform/android/CCApplication.h\",\n\"cocos/2d/platform/android/CCCommon.cpp\",\n\"cocos/2d/platform/android/CCDevice.cpp\",\n\"cocos/2d/platform/android/CCEGLView.cpp\",\n\"cocos/2d/platform/android/CCEGLView.h\",\n\"cocos/2d/platform/android/CCFileUtilsAndroid.cpp\",\n\"cocos/2d/platform/android/CCFileUtilsAndroid.h\",\n\"cocos/2d/platform/android/CCGL.h\",\n\"cocos/2d/platform/android/CCImage.cpp\",\n\"cocos/2d/platform/android/CCPlatformDefine.h\",\n\"cocos/2d/platform/android/CCStdC.h\",\n\"cocos/2d/platform/android/java/.classpath\",\n\"cocos/2d/platform/android/java/.project\",\n\"cocos/2d/platform/android/java/.settings/org.eclipse.jdt.core.prefs\",\n\"cocos/2d/platform/android/java/AndroidManifest.xml\",\n\"cocos/2d/platform/android/java/ant.properties\",\n\"cocos/2d/platform/android/java/build.xml\",\n\"cocos/2d/platform/android/java/proguard-project.txt\",\n\"cocos/2d/platform/android/java/project.properties\",\n\"cocos/2d/platform/android/java/res/.gitignore\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLocalStorage.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxMusic.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxSound.java\",\n\"cocos/2d/platform/android/java/src/org/cocos2dx/lib/Cocos2dxTypefaces.java\",\n\"cocos/2d/platform/android/jni/DPIJni.cpp\",\n\"cocos/2d/platform/android/jni/DPIJni.h\",\n\"cocos/2d/platform/android/jni/IMEJni.cpp\",\n\"cocos/2d/platform/android/jni/IMEJni.h\",\n\"cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp\",\n\"cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h\",\n\"cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp\",\n\"cocos/2d/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h\",\n\"cocos/2d/platform/android/jni/JniHelper.cpp\",\n\"cocos/2d/platform/android/jni/JniHelper.h\",\n\"cocos/2d/platform/android/nativeactivity.cpp\",\n\"cocos/2d/platform/android/nativeactivity.h\",\n\"cocos/2d/platform/apple/CCFileUtilsApple.h\",\n\"cocos/2d/platform/apple/CCFileUtilsApple.mm\",\n\"cocos/2d/platform/apple/CCLock.cpp\",\n\"cocos/2d/platform/apple/CCLock.h\",\n\"cocos/2d/platform/apple/CCThread.mm\",\n\"cocos/2d/platform/CCApplicationProtocol.h\",\n\"cocos/2d/platform/CCCommon.h\",\n\"cocos/2d/platform/CCDevice.h\",\n\"cocos/2d/platform/CCEGLViewProtocol.cpp\",\n\"cocos/2d/platform/CCEGLViewProtocol.h\",\n\"cocos/2d/platform/CCFileUtils.cpp\",\n\"cocos/2d/platform/CCFileUtils.h\",\n\"cocos/2d/platform/CCImage.h\",\n\"cocos/2d/platform/CCImageCommon_cpp.h\",\n\"cocos/2d/platform/CCSAXParser.cpp\",\n\"cocos/2d/platform/CCSAXParser.h\",\n\"cocos/2d/platform/CCThread.cpp\",\n\"cocos/2d/platform/CCThread.h\",\n\"cocos/2d/platform/desktop/CCEGLView.cpp\",\n\"cocos/2d/platform/desktop/CCEGLView.h\",\n\"cocos/2d/platform/ios/CCApplication.h\",\n\"cocos/2d/platform/ios/CCApplication.mm\",\n\"cocos/2d/platform/ios/CCCommon.mm\",\n\"cocos/2d/platform/ios/CCDevice.mm\",\n\"cocos/2d/platform/ios/CCDirectorCaller.h\",\n\"cocos/2d/platform/ios/CCDirectorCaller.mm\",\n\"cocos/2d/platform/ios/CCEGLView.h\",\n\"cocos/2d/platform/ios/CCEGLView.mm\",\n\"cocos/2d/platform/ios/CCES2Renderer.h\",\n\"cocos/2d/platform/ios/CCES2Renderer.m\",\n\"cocos/2d/platform/ios/CCESRenderer.h\",\n\"cocos/2d/platform/ios/CCGL.h\",\n\"cocos/2d/platform/ios/CCImage.mm\",\n\"cocos/2d/platform/ios/CCPlatformDefine.h\",\n\"cocos/2d/platform/ios/CCStdC.h\",\n\"cocos/2d/platform/ios/EAGLView.h\",\n\"cocos/2d/platform/ios/EAGLView.mm\",\n\"cocos/2d/platform/ios/OpenGL_Internal.h\",\n\"cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h\",\n\"cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m\",\n\"cocos/2d/platform/linux/CCApplication.cpp\",\n\"cocos/2d/platform/linux/CCApplication.h\",\n\"cocos/2d/platform/linux/CCCommon.cpp\",\n\"cocos/2d/platform/linux/CCDevice.cpp\",\n\"cocos/2d/platform/linux/CCFileUtilsLinux.cpp\",\n\"cocos/2d/platform/linux/CCFileUtilsLinux.h\",\n\"cocos/2d/platform/linux/CCGL.h\",\n\"cocos/2d/platform/linux/CCImage.cpp\",\n\"cocos/2d/platform/linux/CCPlatformDefine.h\",\n\"cocos/2d/platform/linux/CCStdC.cpp\",\n\"cocos/2d/platform/linux/CCStdC.h\",\n\"cocos/2d/platform/mac/CCApplication.h\",\n\"cocos/2d/platform/mac/CCApplication.mm\",\n\"cocos/2d/platform/mac/CCCommon.mm\",\n\"cocos/2d/platform/mac/CCDevice.cpp\",\n\"cocos/2d/platform/mac/CCDirectorCaller.h\",\n\"cocos/2d/platform/mac/CCDirectorCaller.mm\",\n\"cocos/2d/platform/mac/CCGL.h\",\n\"cocos/2d/platform/mac/CCImage.mm\",\n\"cocos/2d/platform/mac/CCPlatformDefine.h\",\n\"cocos/2d/platform/mac/CCStdC.h\",\n\"cocos/2d/platform/win32/CCApplication.cpp\",\n\"cocos/2d/platform/win32/CCApplication.h\",\n\"cocos/2d/platform/win32/CCCommon.cpp\",\n\"cocos/2d/platform/win32/CCDevice.cpp\",\n\"cocos/2d/platform/win32/CCFileUtilsWin32.cpp\",\n\"cocos/2d/platform/win32/CCFileUtilsWin32.h\",\n\"cocos/2d/platform/win32/CCGL.h\",\n\"cocos/2d/platform/win32/CCImage.cpp\",\n\"cocos/2d/platform/win32/CCPlatformDefine.h\",\n\"cocos/2d/platform/win32/CCStdC.cpp\",\n\"cocos/2d/platform/win32/CCStdC.h\",\n\"cocos/2d/platform/win32/compat/stdint.h\",\n\"cocos/2d/renderer/CCBatchCommand.cpp\",\n\"cocos/2d/renderer/CCBatchCommand.h\",\n\"cocos/2d/renderer/CCCustomCommand.cpp\",\n\"cocos/2d/renderer/CCCustomCommand.h\",\n\"cocos/2d/renderer/CCFrustum.cpp\",\n\"cocos/2d/renderer/CCFrustum.h\",\n\"cocos/2d/renderer/CCGroupCommand.cpp\",\n\"cocos/2d/renderer/CCGroupCommand.h\",\n\"cocos/2d/renderer/CCMaterialManager.cpp\",\n\"cocos/2d/renderer/CCMaterialManager.h\",\n\"cocos/2d/renderer/CCQuadCommand.cpp\",\n\"cocos/2d/renderer/CCQuadCommand.h\",\n\"cocos/2d/renderer/CCRenderCommand.cpp\",\n\"cocos/2d/renderer/CCRenderCommand.h\",\n\"cocos/2d/renderer/CCRenderCommandPool.h\",\n\"cocos/2d/renderer/CCRenderer.cpp\",\n\"cocos/2d/renderer/CCRenderer.h\",\n\"cocos/2d/renderer/CCRenderMaterial.cpp\",\n\"cocos/2d/renderer/CCRenderMaterial.h\",\n\"cocos/2d/TGAlib.cpp\",\n\"cocos/2d/TGAlib.h\",\n\"cocos/2d/TransformUtils.cpp\",\n\"cocos/2d/TransformUtils.h\",\n\"cocos/2d/uthash.h\",\n\"cocos/2d/utlist.h\",\n\"cocos/2d/ZipUtils.cpp\",\n\"cocos/2d/ZipUtils.h\",\n\"cocos/audio/android/Android.mk\",\n\"cocos/audio/android/ccdandroidUtils.cpp\",\n\"cocos/audio/android/ccdandroidUtils.h\",\n\"cocos/audio/android/cddSimpleAudioEngine.cpp\",\n\"cocos/audio/android/jni/cddandroidAndroidJavaEngine.cpp\",\n\"cocos/audio/android/jni/cddandroidAndroidJavaEngine.h\",\n\"cocos/audio/android/opensl/cddandroidOpenSLEngine.cpp\",\n\"cocos/audio/android/opensl/cddandroidOpenSLEngine.h\",\n\"cocos/audio/android/opensl/OpenSLEngine.cpp\",\n\"cocos/audio/android/opensl/OpenSLEngine.h\",\n\"cocos/audio/android/opensl/SimpleAudioEngineOpenSL.cpp\",\n\"cocos/audio/android/opensl/SimpleAudioEngineOpenSL.h\",\n\"cocos/audio/CMakeLists.txt\",\n\"cocos/audio/include/Export.h\",\n\"cocos/audio/include/SimpleAudioEngine.h\",\n\"cocos/audio/ios/CDAudioManager.h\",\n\"cocos/audio/ios/CDAudioManager.m\",\n\"cocos/audio/ios/CDConfig.h\",\n\"cocos/audio/ios/CDOpenALSupport.h\",\n\"cocos/audio/ios/CDOpenALSupport.m\",\n\"cocos/audio/ios/CocosDenshion.h\",\n\"cocos/audio/ios/CocosDenshion.m\",\n\"cocos/audio/ios/SimpleAudioEngine.mm\",\n\"cocos/audio/ios/SimpleAudioEngine_objc.h\",\n\"cocos/audio/ios/SimpleAudioEngine_objc.m\",\n\"cocos/audio/linux/AudioPlayer.h\",\n\"cocos/audio/linux/FmodAudioPlayer.cpp\",\n\"cocos/audio/linux/FmodAudioPlayer.h\",\n\"cocos/audio/linux/SimpleAudioEngineFMOD.cpp\",\n\"cocos/audio/mac/CDAudioManager.h\",\n\"cocos/audio/mac/CDAudioManager.m\",\n\"cocos/audio/mac/CDConfig.h\",\n\"cocos/audio/mac/CDOpenALSupport.h\",\n\"cocos/audio/mac/CDOpenALSupport.m\",\n\"cocos/audio/mac/CDXMacOSXSupport.h\",\n\"cocos/audio/mac/CDXMacOSXSupport.mm\",\n\"cocos/audio/mac/CocosDenshion.h\",\n\"cocos/audio/mac/CocosDenshion.m\",\n\"cocos/audio/mac/SimpleAudioEngine.mm\",\n\"cocos/audio/mac/SimpleAudioEngine_objc.h\",\n\"cocos/audio/mac/SimpleAudioEngine_objc.m\",\n\"cocos/audio/openal/OpenALDecoder.cpp\",\n\"cocos/audio/openal/OpenALDecoder.h\",\n\"cocos/audio/openal/SimpleAudioEngineOpenAL.cpp\",\n\"cocos/audio/proj.win32/CocosDenshion.vcxproj\",\n\"cocos/audio/proj.win32/CocosDenshion.vcxproj.filters\",\n\"cocos/audio/proj.win32/CocosDenshion.vcxproj.user\",\n\"cocos/audio/win32/MciPlayer.cpp\",\n\"cocos/audio/win32/MciPlayer.h\",\n\"cocos/audio/win32/SimpleAudioEngine.cpp\",\n\"cocos/base/atitc.cpp\",\n\"cocos/base/atitc.h\",\n\"cocos/base/CCAffineTransform.cpp\",\n\"cocos/base/CCAffineTransform.h\",\n\"cocos/base/CCArray.cpp\",\n\"cocos/base/CCArray.h\",\n\"cocos/base/CCAutoreleasePool.cpp\",\n\"cocos/base/CCAutoreleasePool.h\",\n\"cocos/base/CCBool.h\",\n\"cocos/base/CCConsole.cpp\",\n\"cocos/base/CCConsole.h\",\n\"cocos/base/CCData.cpp\",\n\"cocos/base/CCData.h\",\n\"cocos/base/CCDataVisitor.cpp\",\n\"cocos/base/CCDataVisitor.h\",\n\"cocos/base/CCDictionary.cpp\",\n\"cocos/base/CCDictionary.h\",\n\"cocos/base/CCDouble.h\",\n\"cocos/base/CCFloat.h\",\n\"cocos/base/CCGeometry.cpp\",\n\"cocos/base/CCGeometry.h\",\n\"cocos/base/CCInteger.h\",\n\"cocos/base/CCMap.h\",\n\"cocos/base/CCNS.cpp\",\n\"cocos/base/CCNS.h\",\n\"cocos/base/CCObject.cpp\",\n\"cocos/base/CCObject.h\",\n\"cocos/base/CCPlatformConfig.h\",\n\"cocos/base/CCPlatformMacros.h\",\n\"cocos/base/CCSet.cpp\",\n\"cocos/base/CCSet.h\",\n\"cocos/base/CCString.cpp\",\n\"cocos/base/CCString.h\",\n\"cocos/base/CCValue.cpp\",\n\"cocos/base/CCValue.h\",\n\"cocos/base/CCVector.h\",\n\"cocos/base/CMakeLists.txt\",\n\"cocos/base/etc1.cpp\",\n\"cocos/base/etc1.h\",\n\"cocos/base/s3tc.cpp\",\n\"cocos/base/s3tc.h\",\n\"cocos/editor-support/cocosbuilder/Android.mk\",\n\"cocos/editor-support/cocosbuilder/CCBAnimationManager.cpp\",\n\"cocos/editor-support/cocosbuilder/CCBAnimationManager.h\",\n\"cocos/editor-support/cocosbuilder/CCBFileLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCBFileLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCBKeyframe.cpp\",\n\"cocos/editor-support/cocosbuilder/CCBKeyframe.h\",\n\"cocos/editor-support/cocosbuilder/CCBMemberVariableAssigner.h\",\n\"cocos/editor-support/cocosbuilder/CCBReader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCBReader.h\",\n\"cocos/editor-support/cocosbuilder/CCBSelectorResolver.h\",\n\"cocos/editor-support/cocosbuilder/CCBSequence.cpp\",\n\"cocos/editor-support/cocosbuilder/CCBSequence.h\",\n\"cocos/editor-support/cocosbuilder/CCBSequenceProperty.cpp\",\n\"cocos/editor-support/cocosbuilder/CCBSequenceProperty.h\",\n\"cocos/editor-support/cocosbuilder/CCControlButtonLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCControlButtonLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCControlLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCControlLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCLabelBMFontLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCLabelTTFLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCLabelTTFLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCLayerColorLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCLayerColorLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCLayerGradientLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCLayerGradientLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCLayerLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCLayerLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCMenuItemImageLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCMenuItemLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCMenuItemLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCMenuLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.cpp\",\n\"cocos/editor-support/cocosbuilder/CCNode+CCBRelativePositioning.h\",\n\"cocos/editor-support/cocosbuilder/CCNodeLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCNodeLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.cpp\",\n\"cocos/editor-support/cocosbuilder/CCNodeLoaderLibrary.h\",\n\"cocos/editor-support/cocosbuilder/CCNodeLoaderListener.h\",\n\"cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCParticleSystemQuadLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCScrollViewLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCScrollViewLoader.h\",\n\"cocos/editor-support/cocosbuilder/CCSpriteLoader.cpp\",\n\"cocos/editor-support/cocosbuilder/CCSpriteLoader.h\",\n\"cocos/editor-support/cocosbuilder/CMakeLists.txt\",\n\"cocos/editor-support/cocosbuilder/CocosBuilder.h\",\n\"cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj\",\n\"cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj.filters\",\n\"cocos/editor-support/cocosbuilder/proj.win32/libCocosBuilder.vcxproj.user\",\n\"cocos/editor-support/cocostudio/Android.mk\",\n\"cocos/editor-support/cocostudio/CCActionEaseEx.cpp\",\n\"cocos/editor-support/cocostudio/CCActionEaseEx.h\",\n\"cocos/editor-support/cocostudio/CCActionFrame.cpp\",\n\"cocos/editor-support/cocostudio/CCActionFrame.h\",\n\"cocos/editor-support/cocostudio/CCActionFrameEasing.cpp\",\n\"cocos/editor-support/cocostudio/CCActionFrameEasing.h\",\n\"cocos/editor-support/cocostudio/CCActionManagerEx.cpp\",\n\"cocos/editor-support/cocostudio/CCActionManagerEx.h\",\n\"cocos/editor-support/cocostudio/CCActionNode.cpp\",\n\"cocos/editor-support/cocostudio/CCActionNode.h\",\n\"cocos/editor-support/cocostudio/CCActionObject.cpp\",\n\"cocos/editor-support/cocostudio/CCActionObject.h\",\n\"cocos/editor-support/cocostudio/CCArmature.cpp\",\n\"cocos/editor-support/cocostudio/CCArmature.h\",\n\"cocos/editor-support/cocostudio/CCArmatureAnimation.cpp\",\n\"cocos/editor-support/cocostudio/CCArmatureAnimation.h\",\n\"cocos/editor-support/cocostudio/CCArmatureDataManager.cpp\",\n\"cocos/editor-support/cocostudio/CCArmatureDataManager.h\",\n\"cocos/editor-support/cocostudio/CCArmatureDefine.cpp\",\n\"cocos/editor-support/cocostudio/CCArmatureDefine.h\",\n\"cocos/editor-support/cocostudio/CCBatchNode.cpp\",\n\"cocos/editor-support/cocostudio/CCBatchNode.h\",\n\"cocos/editor-support/cocostudio/CCBone.cpp\",\n\"cocos/editor-support/cocostudio/CCBone.h\",\n\"cocos/editor-support/cocostudio/CCColliderDetector.cpp\",\n\"cocos/editor-support/cocostudio/CCColliderDetector.h\",\n\"cocos/editor-support/cocostudio/CCComAttribute.cpp\",\n\"cocos/editor-support/cocostudio/CCComAttribute.h\",\n\"cocos/editor-support/cocostudio/CCComAudio.cpp\",\n\"cocos/editor-support/cocostudio/CCComAudio.h\",\n\"cocos/editor-support/cocostudio/CCComBase.h\",\n\"cocos/editor-support/cocostudio/CCComController.cpp\",\n\"cocos/editor-support/cocostudio/CCComController.h\",\n\"cocos/editor-support/cocostudio/CCComRender.cpp\",\n\"cocos/editor-support/cocostudio/CCComRender.h\",\n\"cocos/editor-support/cocostudio/CCDataReaderHelper.cpp\",\n\"cocos/editor-support/cocostudio/CCDataReaderHelper.h\",\n\"cocos/editor-support/cocostudio/CCDatas.cpp\",\n\"cocos/editor-support/cocostudio/CCDatas.h\",\n\"cocos/editor-support/cocostudio/CCDecorativeDisplay.cpp\",\n\"cocos/editor-support/cocostudio/CCDecorativeDisplay.h\",\n\"cocos/editor-support/cocostudio/CCDisplayFactory.cpp\",\n\"cocos/editor-support/cocostudio/CCDisplayFactory.h\",\n\"cocos/editor-support/cocostudio/CCDisplayManager.cpp\",\n\"cocos/editor-support/cocostudio/CCDisplayManager.h\",\n\"cocos/editor-support/cocostudio/CCInputDelegate.cpp\",\n\"cocos/editor-support/cocostudio/CCInputDelegate.h\",\n\"cocos/editor-support/cocostudio/CCProcessBase.cpp\",\n\"cocos/editor-support/cocostudio/CCProcessBase.h\",\n\"cocos/editor-support/cocostudio/CCSGUIReader.cpp\",\n\"cocos/editor-support/cocostudio/CCSGUIReader.h\",\n\"cocos/editor-support/cocostudio/CCSkin.cpp\",\n\"cocos/editor-support/cocostudio/CCSkin.h\",\n\"cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.cpp\",\n\"cocos/editor-support/cocostudio/CCSpriteFrameCacheHelper.h\",\n\"cocos/editor-support/cocostudio/CCSSceneReader.cpp\",\n\"cocos/editor-support/cocostudio/CCSSceneReader.h\",\n\"cocos/editor-support/cocostudio/CCTransformHelp.cpp\",\n\"cocos/editor-support/cocostudio/CCTransformHelp.h\",\n\"cocos/editor-support/cocostudio/CCTween.cpp\",\n\"cocos/editor-support/cocostudio/CCTween.h\",\n\"cocos/editor-support/cocostudio/CCTweenFunction.cpp\",\n\"cocos/editor-support/cocostudio/CCTweenFunction.h\",\n\"cocos/editor-support/cocostudio/CCUtilMath.cpp\",\n\"cocos/editor-support/cocostudio/CCUtilMath.h\",\n\"cocos/editor-support/cocostudio/CMakeLists.txt\",\n\"cocos/editor-support/cocostudio/CocoStudio.h\",\n\"cocos/editor-support/cocostudio/DictionaryHelper.cpp\",\n\"cocos/editor-support/cocostudio/DictionaryHelper.h\",\n\"cocos/editor-support/cocostudio/ObjectFactory.cpp\",\n\"cocos/editor-support/cocostudio/ObjectFactory.h\",\n\"cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj\",\n\"cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.filters\",\n\"cocos/editor-support/cocostudio/proj.win32/libCocosStudio.vcxproj.user\",\n\"cocos/editor-support/cocostudio/TriggerBase.cpp\",\n\"cocos/editor-support/cocostudio/TriggerBase.h\",\n\"cocos/editor-support/cocostudio/TriggerMng.cpp\",\n\"cocos/editor-support/cocostudio/TriggerMng.h\",\n\"cocos/editor-support/cocostudio/TriggerObj.cpp\",\n\"cocos/editor-support/cocostudio/TriggerObj.h\",\n\"cocos/editor-support/spine/Android.mk\",\n\"cocos/editor-support/spine/Animation.cpp\",\n\"cocos/editor-support/spine/Animation.h\",\n\"cocos/editor-support/spine/AnimationState.cpp\",\n\"cocos/editor-support/spine/AnimationState.h\",\n\"cocos/editor-support/spine/AnimationStateData.cpp\",\n\"cocos/editor-support/spine/AnimationStateData.h\",\n\"cocos/editor-support/spine/Atlas.cpp\",\n\"cocos/editor-support/spine/Atlas.h\",\n\"cocos/editor-support/spine/AtlasAttachmentLoader.cpp\",\n\"cocos/editor-support/spine/AtlasAttachmentLoader.h\",\n\"cocos/editor-support/spine/Attachment.cpp\",\n\"cocos/editor-support/spine/Attachment.h\",\n\"cocos/editor-support/spine/AttachmentLoader.cpp\",\n\"cocos/editor-support/spine/AttachmentLoader.h\",\n\"cocos/editor-support/spine/Bone.cpp\",\n\"cocos/editor-support/spine/Bone.h\",\n\"cocos/editor-support/spine/BoneData.cpp\",\n\"cocos/editor-support/spine/BoneData.h\",\n\"cocos/editor-support/spine/BoundingBoxAttachment.cpp\",\n\"cocos/editor-support/spine/BoundingBoxAttachment.h\",\n\"cocos/editor-support/spine/CCSkeleton.cpp\",\n\"cocos/editor-support/spine/CCSkeleton.h\",\n\"cocos/editor-support/spine/CCSkeletonAnimation.cpp\",\n\"cocos/editor-support/spine/CCSkeletonAnimation.h\",\n\"cocos/editor-support/spine/CMakeLists.txt\",\n\"cocos/editor-support/spine/Event.cpp\",\n\"cocos/editor-support/spine/Event.h\",\n\"cocos/editor-support/spine/EventData.cpp\",\n\"cocos/editor-support/spine/EventData.h\",\n\"cocos/editor-support/spine/extension.cpp\",\n\"cocos/editor-support/spine/extension.h\",\n\"cocos/editor-support/spine/Json.cpp\",\n\"cocos/editor-support/spine/Json.h\",\n\"cocos/editor-support/spine/proj.win32/libSpine.vcxproj\",\n\"cocos/editor-support/spine/proj.win32/libSpine.vcxproj.filters\",\n\"cocos/editor-support/spine/proj.win32/libSpine.vcxproj.user\",\n\"cocos/editor-support/spine/RegionAttachment.cpp\",\n\"cocos/editor-support/spine/RegionAttachment.h\",\n\"cocos/editor-support/spine/Skeleton.cpp\",\n\"cocos/editor-support/spine/Skeleton.h\",\n\"cocos/editor-support/spine/SkeletonBounds.cpp\",\n\"cocos/editor-support/spine/SkeletonBounds.h\",\n\"cocos/editor-support/spine/SkeletonData.cpp\",\n\"cocos/editor-support/spine/SkeletonData.h\",\n\"cocos/editor-support/spine/SkeletonJson.cpp\",\n\"cocos/editor-support/spine/SkeletonJson.h\",\n\"cocos/editor-support/spine/Skin.cpp\",\n\"cocos/editor-support/spine/Skin.h\",\n\"cocos/editor-support/spine/Slot.cpp\",\n\"cocos/editor-support/spine/Slot.h\",\n\"cocos/editor-support/spine/SlotData.cpp\",\n\"cocos/editor-support/spine/SlotData.h\",\n\"cocos/editor-support/spine/spine-cocos2dx.cpp\",\n\"cocos/editor-support/spine/spine-cocos2dx.h\",\n\"cocos/editor-support/spine/spine.h\",\n\"cocos/gui/Android.mk\",\n\"cocos/gui/CMakeLists.txt\",\n\"cocos/gui/CocosGUI.cpp\",\n\"cocos/gui/CocosGUI.h\",\n\"cocos/gui/proj.win32/libGUI.vcxproj\",\n\"cocos/gui/proj.win32/libGUI.vcxproj.filters\",\n\"cocos/gui/proj.win32/libGUI.vcxproj.user\",\n\"cocos/gui/UIButton.cpp\",\n\"cocos/gui/UIButton.h\",\n\"cocos/gui/UICheckBox.cpp\",\n\"cocos/gui/UICheckBox.h\",\n\"cocos/gui/UIHelper.cpp\",\n\"cocos/gui/UIHelper.h\",\n\"cocos/gui/UIImageView.cpp\",\n\"cocos/gui/UIImageView.h\",\n\"cocos/gui/UILayout.cpp\",\n\"cocos/gui/UILayout.h\",\n\"cocos/gui/UILayoutDefine.cpp\",\n\"cocos/gui/UILayoutDefine.h\",\n\"cocos/gui/UILayoutParameter.cpp\",\n\"cocos/gui/UILayoutParameter.h\",\n\"cocos/gui/UIListView.cpp\",\n\"cocos/gui/UIListView.h\",\n\"cocos/gui/UILoadingBar.cpp\",\n\"cocos/gui/UILoadingBar.h\",\n\"cocos/gui/UIPageView.cpp\",\n\"cocos/gui/UIPageView.h\",\n\"cocos/gui/UIScrollInterface.h\",\n\"cocos/gui/UIScrollView.cpp\",\n\"cocos/gui/UIScrollView.h\",\n\"cocos/gui/UISlider.cpp\",\n\"cocos/gui/UISlider.h\",\n\"cocos/gui/UIText.cpp\",\n\"cocos/gui/UIText.h\",\n\"cocos/gui/UITextAtlas.cpp\",\n\"cocos/gui/UITextAtlas.h\",\n\"cocos/gui/UITextBMFont.cpp\",\n\"cocos/gui/UITextBMFont.h\",\n\"cocos/gui/UITextField.cpp\",\n\"cocos/gui/UITextField.h\",\n\"cocos/gui/UIWidget.cpp\",\n\"cocos/gui/UIWidget.h\",\n\"cocos/math/kazmath/CMakeLists.txt\",\n\"cocos/math/kazmath/include/kazmath/aabb.h\",\n\"cocos/math/kazmath/include/kazmath/GL/mat4stack.h\",\n\"cocos/math/kazmath/include/kazmath/GL/matrix.h\",\n\"cocos/math/kazmath/include/kazmath/kazmath.h\",\n\"cocos/math/kazmath/include/kazmath/mat3.h\",\n\"cocos/math/kazmath/include/kazmath/mat4.h\",\n\"cocos/math/kazmath/include/kazmath/neon_matrix_impl.h\",\n\"cocos/math/kazmath/include/kazmath/plane.h\",\n\"cocos/math/kazmath/include/kazmath/quaternion.h\",\n\"cocos/math/kazmath/include/kazmath/ray2.h\",\n\"cocos/math/kazmath/include/kazmath/utility.h\",\n\"cocos/math/kazmath/include/kazmath/vec2.h\",\n\"cocos/math/kazmath/include/kazmath/vec3.h\",\n\"cocos/math/kazmath/include/kazmath/vec4.h\",\n\"cocos/math/kazmath/src/aabb.c\",\n\"cocos/math/kazmath/src/ChangeLog\",\n\"cocos/math/kazmath/src/CMakeLists.txt\",\n\"cocos/math/kazmath/src/GL/mat4stack.c\",\n\"cocos/math/kazmath/src/GL/matrix.c\",\n\"cocos/math/kazmath/src/mat3.c\",\n\"cocos/math/kazmath/src/mat4.c\",\n\"cocos/math/kazmath/src/neon_matrix_impl.c\",\n\"cocos/math/kazmath/src/plane.c\",\n\"cocos/math/kazmath/src/quaternion.c\",\n\"cocos/math/kazmath/src/ray2.c\",\n\"cocos/math/kazmath/src/utility.c\",\n\"cocos/math/kazmath/src/vec2.c\",\n\"cocos/math/kazmath/src/vec3.c\",\n\"cocos/math/kazmath/src/vec4.c\",\n\"cocos/network/Android.mk\",\n\"cocos/network/CMakeLists.txt\",\n\"cocos/network/HttpClient.cpp\",\n\"cocos/network/HttpClient.h\",\n\"cocos/network/HttpRequest.h\",\n\"cocos/network/HttpResponse.h\",\n\"cocos/network/proj.win32/libNetwork.vcxproj\",\n\"cocos/network/proj.win32/libNetwork.vcxproj.filters\",\n\"cocos/network/proj.win32/libNetwork.vcxproj.user\",\n\"cocos/network/SocketIO.cpp\",\n\"cocos/network/SocketIO.h\",\n\"cocos/network/WebSocket.cpp\",\n\"cocos/network/WebSocket.h\",\n\"cocos/physics/CCPhysicsBody.cpp\",\n\"cocos/physics/CCPhysicsBody.h\",\n\"cocos/physics/CCPhysicsContact.cpp\",\n\"cocos/physics/CCPhysicsContact.h\",\n\"cocos/physics/CCPhysicsJoint.cpp\",\n\"cocos/physics/CCPhysicsJoint.h\",\n\"cocos/physics/CCPhysicsShape.cpp\",\n\"cocos/physics/CCPhysicsShape.h\",\n\"cocos/physics/CCPhysicsWorld.cpp\",\n\"cocos/physics/CCPhysicsWorld.h\",\n\"cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.cpp\",\n\"cocos/physics/chipmunk/CCPhysicsBodyInfo_chipmunk.h\",\n\"cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.cpp\",\n\"cocos/physics/chipmunk/CCPhysicsContactInfo_chipmunk.h\",\n\"cocos/physics/chipmunk/CCPhysicsHelper_chipmunk.h\",\n\"cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.cpp\",\n\"cocos/physics/chipmunk/CCPhysicsJointInfo_chipmunk.h\",\n\"cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.cpp\",\n\"cocos/physics/chipmunk/CCPhysicsShapeInfo_chipmunk.h\",\n\"cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.cpp\",\n\"cocos/physics/chipmunk/CCPhysicsWorldInfo_chipmunk.h\",\n\"cocos/physics/CMakeLists.txt\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_auto.cpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_auto.hpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_auto_api.js\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_builder_auto.cpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_builder_auto.hpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_builder_auto_api.js\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_extension_auto.cpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_extension_auto.hpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_extension_auto_api.js\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_gui_auto.cpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_gui_auto.hpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_gui_auto_api.js\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_spine_auto.cpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_spine_auto.hpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_spine_auto_api.js\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_studio_auto.cpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_studio_auto.hpp\",\n\"cocos/scripting/auto-generated/js-bindings/jsb_cocos2dx_studio_auto_api.js\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_auto.cpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_auto.hpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_auto_api.js\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_extension_auto.hpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_extension_auto_api.js\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_gui_auto.cpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_gui_auto.hpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_gui_auto_api.js\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_physics_auto.cpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_physics_auto.hpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_physics_auto_api.js\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_spine_auto.cpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_spine_auto.hpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_spine_auto_api.js\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_studio_auto.cpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_studio_auto.hpp\",\n\"cocos/scripting/auto-generated/lua-bindings/lua_cocos2dx_studio_auto_api.js\",\n\"cocos/scripting/auto-generated/README.md\",\n\"cocos/scripting/CMakeLists.txt\",\n\"cocos/scripting/javascript/bindings/Android.mk\",\n\"cocos/scripting/javascript/bindings/chipmunk/Android.mk\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_auto_classes.cpp\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_auto_classes.h\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_auto_classes_registration.h\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_functions.cpp\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_functions.h\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_functions_registration.h\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_manual.cpp\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_manual.h\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_registration.cpp\",\n\"cocos/scripting/javascript/bindings/chipmunk/js_bindings_chipmunk_registration.h\",\n\"cocos/scripting/javascript/bindings/chipmunk/libJSBindingForChipmunk.vcxproj\",\n\"cocos/scripting/javascript/bindings/chipmunk/libJSBindingForChipmunk.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/chipmunk/libJSBindingForChipmunk.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/cocos2d_specifics.cpp\",\n\"cocos/scripting/javascript/bindings/cocos2d_specifics.hpp\",\n\"cocos/scripting/javascript/bindings/cocosbuilder/Android.mk\",\n\"cocos/scripting/javascript/bindings/cocosbuilder/cocosbuilder_specifics.hpp\",\n\"cocos/scripting/javascript/bindings/cocosbuilder/js_bindings_ccbreader.cpp\",\n\"cocos/scripting/javascript/bindings/cocosbuilder/js_bindings_ccbreader.h\",\n\"cocos/scripting/javascript/bindings/cocosbuilder/libJSBindingForBuilder.vcxproj\",\n\"cocos/scripting/javascript/bindings/cocosbuilder/libJSBindingForBuilder.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/cocosbuilder/libJSBindingForBuilder.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/cocostudio/Android.mk\",\n\"cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.cpp\",\n\"cocos/scripting/javascript/bindings/cocostudio/jsb_cocos2dx_studio_manual.h\",\n\"cocos/scripting/javascript/bindings/cocostudio/libJSBindingForStudio.vcxproj\",\n\"cocos/scripting/javascript/bindings/cocostudio/libJSBindingForStudio.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/cocostudio/libJSBindingForStudio.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/extension/Android.mk\",\n\"cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp\",\n\"cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.h\",\n\"cocos/scripting/javascript/bindings/extension/libJSBindingForExtension.vcxproj\",\n\"cocos/scripting/javascript/bindings/extension/libJSBindingForExtension.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/extension/libJSBindingForExtension.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/gui/Android.mk\",\n\"cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.cpp\",\n\"cocos/scripting/javascript/bindings/gui/jsb_cocos2dx_gui_manual.h\",\n\"cocos/scripting/javascript/bindings/gui/libJSBindingForGui.vcxproj\",\n\"cocos/scripting/javascript/bindings/gui/libJSBindingForGui.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/gui/libJSBindingForGui.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/js_bindings_config.h\",\n\"cocos/scripting/javascript/bindings/js_bindings_core.cpp\",\n\"cocos/scripting/javascript/bindings/js_bindings_core.h\",\n\"cocos/scripting/javascript/bindings/js_bindings_opengl.cpp\",\n\"cocos/scripting/javascript/bindings/js_bindings_opengl.h\",\n\"cocos/scripting/javascript/bindings/js_manual_conversions.cpp\",\n\"cocos/scripting/javascript/bindings/js_manual_conversions.h\",\n\"cocos/scripting/javascript/bindings/jsb_helper.h\",\n\"cocos/scripting/javascript/bindings/jsb_opengl_functions.cpp\",\n\"cocos/scripting/javascript/bindings/jsb_opengl_functions.h\",\n\"cocos/scripting/javascript/bindings/jsb_opengl_manual.cpp\",\n\"cocos/scripting/javascript/bindings/jsb_opengl_manual.h\",\n\"cocos/scripting/javascript/bindings/jsb_opengl_registration.cpp\",\n\"cocos/scripting/javascript/bindings/jsb_opengl_registration.h\",\n\"cocos/scripting/javascript/bindings/localstorage/Android.mk\",\n\"cocos/scripting/javascript/bindings/localstorage/js_bindings_system_functions.cpp\",\n\"cocos/scripting/javascript/bindings/localstorage/js_bindings_system_functions.h\",\n\"cocos/scripting/javascript/bindings/localstorage/js_bindings_system_functions_registration.h\",\n\"cocos/scripting/javascript/bindings/localstorage/js_bindings_system_registration.cpp\",\n\"cocos/scripting/javascript/bindings/localstorage/js_bindings_system_registration.h\",\n\"cocos/scripting/javascript/bindings/localstorage/libJSBindingForLocalStorage.vcxproj\",\n\"cocos/scripting/javascript/bindings/localstorage/libJSBindingForLocalStorage.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/localstorage/libJSBindingForLocalStorage.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/network/Android.mk\",\n\"cocos/scripting/javascript/bindings/network/jsb_websocket.cpp\",\n\"cocos/scripting/javascript/bindings/network/jsb_websocket.h\",\n\"cocos/scripting/javascript/bindings/network/libJSBindingForNetwork.vcxproj\",\n\"cocos/scripting/javascript/bindings/network/libJSBindingForNetwork.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/network/libJSBindingForNetwork.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/network/XMLHTTPRequest.cpp\",\n\"cocos/scripting/javascript/bindings/network/XMLHTTPRequest.h\",\n\"cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj\",\n\"cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/proj.win32/libJSBinding.vcxproj.user\",\n\"cocos/scripting/javascript/bindings/ScriptingCore.cpp\",\n\"cocos/scripting/javascript/bindings/ScriptingCore.h\",\n\"cocos/scripting/javascript/bindings/spidermonkey_specifics.h\",\n\"cocos/scripting/javascript/bindings/spine/Android.mk\",\n\"cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj\",\n\"cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.filters\",\n\"cocos/scripting/javascript/bindings/spine/libJSBindingForSpine.vcxproj.user\",\n\"cocos/scripting/javascript/script/debugger/actors/root.js\",\n\"cocos/scripting/javascript/script/debugger/actors/script.js\",\n\"cocos/scripting/javascript/script/debugger/core/promise.js\",\n\"cocos/scripting/javascript/script/debugger/DevToolsUtils.js\",\n\"cocos/scripting/javascript/script/debugger/main.js\",\n\"cocos/scripting/javascript/script/debugger/README.md\",\n\"cocos/scripting/javascript/script/debugger/transport.js\",\n\"cocos/scripting/javascript/script/jsb.js\",\n\"cocos/scripting/javascript/script/jsb_chipmunk.js\",\n\"cocos/scripting/javascript/script/jsb_chipmunk_constants.js\",\n\"cocos/scripting/javascript/script/jsb_cocos2d.js\",\n\"cocos/scripting/javascript/script/jsb_cocos2d_constants.js\",\n\"cocos/scripting/javascript/script/jsb_cocos2d_extension.js\",\n\"cocos/scripting/javascript/script/jsb_cocos2d_gui.js\",\n\"cocos/scripting/javascript/script/jsb_cocos2d_studio.js\",\n\"cocos/scripting/javascript/script/jsb_cocosbuilder.js\",\n\"cocos/scripting/javascript/script/jsb_debugger.js\",\n\"cocos/scripting/javascript/script/jsb_deprecated.js\",\n\"cocos/scripting/javascript/script/jsb_opengl.js\",\n\"cocos/scripting/javascript/script/jsb_opengl_constants.js\",\n\"cocos/scripting/javascript/script/jsb_sys.js\",\n\"cocos/scripting/lua/bindings/.cproject\",\n\"cocos/scripting/lua/bindings/.project\",\n\"cocos/scripting/lua/bindings/Android.mk\",\n\"cocos/scripting/lua/bindings/CCBProxy.cpp\",\n\"cocos/scripting/lua/bindings/CCBProxy.h\",\n\"cocos/scripting/lua/bindings/CCLuaBridge.cpp\",\n\"cocos/scripting/lua/bindings/CCLuaBridge.h\",\n\"cocos/scripting/lua/bindings/CCLuaEngine.cpp\",\n\"cocos/scripting/lua/bindings/CCLuaEngine.h\",\n\"cocos/scripting/lua/bindings/CCLuaStack.cpp\",\n\"cocos/scripting/lua/bindings/CCLuaStack.h\",\n\"cocos/scripting/lua/bindings/CCLuaValue.cpp\",\n\"cocos/scripting/lua/bindings/CCLuaValue.h\",\n\"cocos/scripting/lua/bindings/Cocos2dxLuaLoader.cpp\",\n\"cocos/scripting/lua/bindings/Cocos2dxLuaLoader.h\",\n\"cocos/scripting/lua/bindings/liblua.vcxproj\",\n\"cocos/scripting/lua/bindings/liblua.vcxproj.filters\",\n\"cocos/scripting/lua/bindings/liblua.vcxproj.user\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.cpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_coco_studio_manual.hpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.h\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.h\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.cpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_gui_manual.hpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_manual.cpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_manual.hpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.hpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.cpp\",\n\"cocos/scripting/lua/bindings/lua_cocos2dx_spine_manual.hpp\",\n\"cocos/scripting/lua/bindings/lua_extensions.c\",\n\"cocos/scripting/lua/bindings/lua_extensions.h\",\n\"cocos/scripting/lua/bindings/Lua_web_socket.cpp\",\n\"cocos/scripting/lua/bindings/Lua_web_socket.h\",\n\"cocos/scripting/lua/bindings/lua_xml_http_request.cpp\",\n\"cocos/scripting/lua/bindings/lua_xml_http_request.h\",\n\"cocos/scripting/lua/bindings/LuaBasicConversions.cpp\",\n\"cocos/scripting/lua/bindings/LuaBasicConversions.h\",\n\"cocos/scripting/lua/bindings/LuaOpengl.cpp\",\n\"cocos/scripting/lua/bindings/LuaOpengl.h\",\n\"cocos/scripting/lua/bindings/LuaScriptHandlerMgr.cpp\",\n\"cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h\",\n\"cocos/scripting/lua/bindings/LuaSkeletonAnimation.cpp\",\n\"cocos/scripting/lua/bindings/LuaSkeletonAnimation.h\",\n\"cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.cpp\",\n\"cocos/scripting/lua/bindings/platform/android/CCLuaJavaBridge.h\",\n\"cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp\",\n\"cocos/scripting/lua/bindings/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.h\",\n\"cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.h\",\n\"cocos/scripting/lua/bindings/platform/ios/CCLuaObjcBridge.mm\",\n\"cocos/scripting/lua/bindings/socket/auxiliar.c\",\n\"cocos/scripting/lua/bindings/socket/auxiliar.h\",\n\"cocos/scripting/lua/bindings/socket/except.c\",\n\"cocos/scripting/lua/bindings/socket/except.h\",\n\"cocos/scripting/lua/bindings/socket/inet.c\",\n\"cocos/scripting/lua/bindings/socket/inet.h\",\n\"cocos/scripting/lua/bindings/socket/luasocket.c\",\n\"cocos/scripting/lua/bindings/socket/luasocket.h\",\n\"cocos/scripting/lua/bindings/socket/luasocket_buffer.c\",\n\"cocos/scripting/lua/bindings/socket/luasocket_buffer.h\",\n\"cocos/scripting/lua/bindings/socket/luasocket_io.c\",\n\"cocos/scripting/lua/bindings/socket/luasocket_io.h\",\n\"cocos/scripting/lua/bindings/socket/mime.c\",\n\"cocos/scripting/lua/bindings/socket/mime.h\",\n\"cocos/scripting/lua/bindings/socket/options.c\",\n\"cocos/scripting/lua/bindings/socket/options.h\",\n\"cocos/scripting/lua/bindings/socket/select.c\",\n\"cocos/scripting/lua/bindings/socket/select.h\",\n\"cocos/scripting/lua/bindings/socket/serial.c\",\n\"cocos/scripting/lua/bindings/socket/socket.h\",\n\"cocos/scripting/lua/bindings/socket/socket_scripts.c\",\n\"cocos/scripting/lua/bindings/socket/socket_scripts.h\",\n\"cocos/scripting/lua/bindings/socket/tcp.c\",\n\"cocos/scripting/lua/bindings/socket/tcp.h\",\n\"cocos/scripting/lua/bindings/socket/timeout.c\",\n\"cocos/scripting/lua/bindings/socket/timeout.h\",\n\"cocos/scripting/lua/bindings/socket/udp.c\",\n\"cocos/scripting/lua/bindings/socket/udp.h\",\n\"cocos/scripting/lua/bindings/socket/unix.c\",\n\"cocos/scripting/lua/bindings/socket/unix.h\",\n\"cocos/scripting/lua/bindings/socket/usocket.c\",\n\"cocos/scripting/lua/bindings/socket/usocket.h\",\n\"cocos/scripting/lua/bindings/socket/wsocket.c\",\n\"cocos/scripting/lua/bindings/socket/wsocket.h\",\n\"cocos/scripting/lua/bindings/tolua_fix.c\",\n\"cocos/scripting/lua/bindings/tolua_fix.h\",\n\"cocos/scripting/lua/script/AudioEngine.lua\",\n\"cocos/scripting/lua/script/CCBReaderLoad.lua\",\n\"cocos/scripting/lua/script/Cocos2d.lua\",\n\"cocos/scripting/lua/script/Cocos2dConstants.lua\",\n\"cocos/scripting/lua/script/CocoStudio.lua\",\n\"cocos/scripting/lua/script/Deprecated.lua\",\n\"cocos/scripting/lua/script/DeprecatedClass.lua\",\n\"cocos/scripting/lua/script/DeprecatedEnum.lua\",\n\"cocos/scripting/lua/script/DeprecatedOpenglEnum.lua\",\n\"cocos/scripting/lua/script/DrawPrimitives.lua\",\n\"cocos/scripting/lua/script/extern.lua\",\n\"cocos/scripting/lua/script/GuiConstants.lua\",\n\"cocos/scripting/lua/script/json.lua\",\n\"cocos/scripting/lua/script/luaj.lua\",\n\"cocos/scripting/lua/script/luaoc.lua\",\n\"cocos/scripting/lua/script/Opengl.lua\",\n\"cocos/scripting/lua/script/OpenglConstants.lua\",\n\"cocos/scripting/lua/script/StudioConstants.lua\",\n\"cocos/storage/local-storage/Android.mk\",\n\"cocos/storage/local-storage/LocalStorage.cpp\",\n\"cocos/storage/local-storage/LocalStorage.h\",\n\"cocos/storage/local-storage/LocalStorageAndroid.cpp\",\n\"cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj\",\n\"cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.filters\",\n\"cocos/storage/local-storage/proj.win32/libLocalStorage.vcxproj.user\",\n\"docs/.gitignore\",\n\"docs/cocos2dx_portrait.png\",\n\"docs/CODING_STYLE.md\",\n\"docs/doxygen.config\",\n\"docs/Groups.h\",\n\"docs/MainPage.h\",\n\"docs/RELEASE_NOTES.md\",\n\"extensions/Android.mk\",\n\"extensions/assets-manager/AssetsManager.cpp\",\n\"extensions/assets-manager/AssetsManager.h\",\n\"extensions/CMakeLists.txt\",\n\"extensions/cocos-ext.h\",\n\"extensions/ExtensionMacros.h\",\n\"extensions/GUI/CCControlExtension/CCControl.cpp\",\n\"extensions/GUI/CCControlExtension/CCControl.h\",\n\"extensions/GUI/CCControlExtension/CCControlButton.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlButton.h\",\n\"extensions/GUI/CCControlExtension/CCControlColourPicker.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlColourPicker.h\",\n\"extensions/GUI/CCControlExtension/CCControlExtensions.h\",\n\"extensions/GUI/CCControlExtension/CCControlHuePicker.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlHuePicker.h\",\n\"extensions/GUI/CCControlExtension/CCControlPotentiometer.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlPotentiometer.h\",\n\"extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h\",\n\"extensions/GUI/CCControlExtension/CCControlSlider.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlSlider.h\",\n\"extensions/GUI/CCControlExtension/CCControlStepper.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlStepper.h\",\n\"extensions/GUI/CCControlExtension/CCControlSwitch.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlSwitch.h\",\n\"extensions/GUI/CCControlExtension/CCControlUtils.cpp\",\n\"extensions/GUI/CCControlExtension/CCControlUtils.h\",\n\"extensions/GUI/CCControlExtension/CCInvocation.cpp\",\n\"extensions/GUI/CCControlExtension/CCInvocation.h\",\n\"extensions/GUI/CCControlExtension/CCScale9Sprite.cpp\",\n\"extensions/GUI/CCControlExtension/CCScale9Sprite.h\",\n\"extensions/GUI/CCEditBox/CCEditBox.cpp\",\n\"extensions/GUI/CCEditBox/CCEditBox.h\",\n\"extensions/GUI/CCEditBox/CCEditBoxImpl.h\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplIOS.h\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplMac.h\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplMac.mm\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplTizen.cpp\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplTizen.h\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp\",\n\"extensions/GUI/CCEditBox/CCEditBoxImplWin.h\",\n\"extensions/GUI/CCScrollView/CCScrollView.cpp\",\n\"extensions/GUI/CCScrollView/CCScrollView.h\",\n\"extensions/GUI/CCScrollView/CCTableView.cpp\",\n\"extensions/GUI/CCScrollView/CCTableView.h\",\n\"extensions/GUI/CCScrollView/CCTableViewCell.cpp\",\n\"extensions/GUI/CCScrollView/CCTableViewCell.h\",\n\"extensions/physics-nodes/CCPhysicsDebugNode.cpp\",\n\"extensions/physics-nodes/CCPhysicsDebugNode.h\",\n\"extensions/physics-nodes/CCPhysicsSprite.cpp\",\n\"extensions/physics-nodes/CCPhysicsSprite.h\",\n\"extensions/proj.win32/libExtensions.vcxproj\",\n\"extensions/proj.win32/libExtensions.vcxproj.filters\",\n\"extensions/proj.win32/libExtensions.vcxproj.user\",\n\"extensions/proj.win32/Win32InputBox.cpp\",\n\"extensions/proj.win32/Win32InputBox.h\",\n\"external/Box2D/Android.mk\",\n\"external/Box2D/Box2D.h\",\n\"external/Box2D/CMakeLists.txt\",\n\"external/Box2D/Collision/b2BroadPhase.cpp\",\n\"external/Box2D/Collision/b2BroadPhase.h\",\n\"external/Box2D/Collision/b2CollideCircle.cpp\",\n\"external/Box2D/Collision/b2CollideEdge.cpp\",\n\"external/Box2D/Collision/b2CollidePolygon.cpp\",\n\"external/Box2D/Collision/b2Collision.cpp\",\n\"external/Box2D/Collision/b2Collision.h\",\n\"external/Box2D/Collision/b2Distance.cpp\",\n\"external/Box2D/Collision/b2Distance.h\",\n\"external/Box2D/Collision/b2DynamicTree.cpp\",\n\"external/Box2D/Collision/b2DynamicTree.h\",\n\"external/Box2D/Collision/b2TimeOfImpact.cpp\",\n\"external/Box2D/Collision/b2TimeOfImpact.h\",\n\"external/Box2D/Collision/Shapes/b2ChainShape.cpp\",\n\"external/Box2D/Collision/Shapes/b2ChainShape.h\",\n\"external/Box2D/Collision/Shapes/b2CircleShape.cpp\",\n\"external/Box2D/Collision/Shapes/b2CircleShape.h\",\n\"external/Box2D/Collision/Shapes/b2EdgeShape.cpp\",\n\"external/Box2D/Collision/Shapes/b2EdgeShape.h\",\n\"external/Box2D/Collision/Shapes/b2PolygonShape.cpp\",\n\"external/Box2D/Collision/Shapes/b2PolygonShape.h\",\n\"external/Box2D/Collision/Shapes/b2Shape.h\",\n\"external/Box2D/Common/b2BlockAllocator.cpp\",\n\"external/Box2D/Common/b2BlockAllocator.h\",\n\"external/Box2D/Common/b2Draw.cpp\",\n\"external/Box2D/Common/b2Draw.h\",\n\"external/Box2D/Common/b2GrowableStack.h\",\n\"external/Box2D/Common/b2Math.cpp\",\n\"external/Box2D/Common/b2Math.h\",\n\"external/Box2D/Common/b2Settings.cpp\",\n\"external/Box2D/Common/b2Settings.h\",\n\"external/Box2D/Common/b2StackAllocator.cpp\",\n\"external/Box2D/Common/b2StackAllocator.h\",\n\"external/Box2D/Common/b2Timer.cpp\",\n\"external/Box2D/Common/b2Timer.h\",\n\"external/Box2D/Dynamics/b2Body.cpp\",\n\"external/Box2D/Dynamics/b2Body.h\",\n\"external/Box2D/Dynamics/b2ContactManager.cpp\",\n\"external/Box2D/Dynamics/b2ContactManager.h\",\n\"external/Box2D/Dynamics/b2Fixture.cpp\",\n\"external/Box2D/Dynamics/b2Fixture.h\",\n\"external/Box2D/Dynamics/b2Island.cpp\",\n\"external/Box2D/Dynamics/b2Island.h\",\n\"external/Box2D/Dynamics/b2TimeStep.h\",\n\"external/Box2D/Dynamics/b2World.cpp\",\n\"external/Box2D/Dynamics/b2World.h\",\n\"external/Box2D/Dynamics/b2WorldCallbacks.cpp\",\n\"external/Box2D/Dynamics/b2WorldCallbacks.h\",\n\"external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h\",\n\"external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h\",\n\"external/Box2D/Dynamics/Contacts/b2CircleContact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2CircleContact.h\",\n\"external/Box2D/Dynamics/Contacts/b2Contact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2Contact.h\",\n\"external/Box2D/Dynamics/Contacts/b2ContactSolver.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2ContactSolver.h\",\n\"external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h\",\n\"external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h\",\n\"external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h\",\n\"external/Box2D/Dynamics/Contacts/b2PolygonContact.cpp\",\n\"external/Box2D/Dynamics/Contacts/b2PolygonContact.h\",\n\"external/Box2D/Dynamics/Joints/b2DistanceJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2DistanceJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2FrictionJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2FrictionJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2GearJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2GearJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2Joint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2Joint.h\",\n\"external/Box2D/Dynamics/Joints/b2MotorJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2MotorJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2MouseJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2MouseJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2PrismaticJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2PulleyJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2PulleyJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2RevoluteJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2RopeJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2RopeJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2WeldJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2WeldJoint.h\",\n\"external/Box2D/Dynamics/Joints/b2WheelJoint.cpp\",\n\"external/Box2D/Dynamics/Joints/b2WheelJoint.h\",\n\"external/Box2D/proj.win32/Box2D.vcxproj\",\n\"external/Box2D/proj.win32/Box2D.vcxproj.filters\",\n\"external/Box2D/proj.win32/Box2D.vcxproj.user\",\n\"external/Box2D/Rope/b2Rope.cpp\",\n\"external/Box2D/Rope/b2Rope.h\",\n\"external/chipmunk/.gitignore\",\n\"external/chipmunk/Android.mk\",\n\"external/chipmunk/chipmunk-docs.html\",\n\"external/chipmunk/include/chipmunk/chipmunk.h\",\n\"external/chipmunk/include/chipmunk/chipmunk_ffi.h\",\n\"external/chipmunk/include/chipmunk/chipmunk_private.h\",\n\"external/chipmunk/include/chipmunk/chipmunk_types.h\",\n\"external/chipmunk/include/chipmunk/chipmunk_unsafe.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpConstraint.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpDampedRotarySpring.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpDampedSpring.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpGearJoint.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpGrooveJoint.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpPinJoint.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpPivotJoint.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpRatchetJoint.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpRotaryLimitJoint.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpSimpleMotor.h\",\n\"external/chipmunk/include/chipmunk/constraints/cpSlideJoint.h\",\n\"external/chipmunk/include/chipmunk/constraints/util.h\",\n\"external/chipmunk/include/chipmunk/cpArbiter.h\",\n\"external/chipmunk/include/chipmunk/cpBB.h\",\n\"external/chipmunk/include/chipmunk/cpBody.h\",\n\"external/chipmunk/include/chipmunk/cpPolyShape.h\",\n\"external/chipmunk/include/chipmunk/cpShape.h\",\n\"external/chipmunk/include/chipmunk/cpSpace.h\",\n\"external/chipmunk/include/chipmunk/cpSpatialIndex.h\",\n\"external/chipmunk/include/chipmunk/cpVect.h\",\n\"external/chipmunk/LICENSE.txt\",\n\"external/chipmunk/proj.win32/chipmunk.vcxproj\",\n\"external/chipmunk/proj.win32/chipmunk.vcxproj.filters\",\n\"external/chipmunk/proj.win32/chipmunk.vcxproj.user\",\n\"external/chipmunk/README.txt\",\n\"external/chipmunk/src/chipmunk.c\",\n\"external/chipmunk/src/CMakeLists.txt\",\n\"external/chipmunk/src/constraints/cpConstraint.c\",\n\"external/chipmunk/src/constraints/cpDampedRotarySpring.c\",\n\"external/chipmunk/src/constraints/cpDampedSpring.c\",\n\"external/chipmunk/src/constraints/cpGearJoint.c\",\n\"external/chipmunk/src/constraints/cpGrooveJoint.c\",\n\"external/chipmunk/src/constraints/cpPinJoint.c\",\n\"external/chipmunk/src/constraints/cpPivotJoint.c\",\n\"external/chipmunk/src/constraints/cpRatchetJoint.c\",\n\"external/chipmunk/src/constraints/cpRotaryLimitJoint.c\",\n\"external/chipmunk/src/constraints/cpSimpleMotor.c\",\n\"external/chipmunk/src/constraints/cpSlideJoint.c\",\n\"external/chipmunk/src/cpArbiter.c\",\n\"external/chipmunk/src/cpArray.c\",\n\"external/chipmunk/src/cpBB.c\",\n\"external/chipmunk/src/cpBBTree.c\",\n\"external/chipmunk/src/cpBody.c\",\n\"external/chipmunk/src/cpCollision.c\",\n\"external/chipmunk/src/cpHashSet.c\",\n\"external/chipmunk/src/cpPolyShape.c\",\n\"external/chipmunk/src/cpShape.c\",\n\"external/chipmunk/src/cpSpace.c\",\n\"external/chipmunk/src/cpSpaceComponent.c\",\n\"external/chipmunk/src/cpSpaceHash.c\",\n\"external/chipmunk/src/cpSpaceQuery.c\",\n\"external/chipmunk/src/cpSpaceStep.c\",\n\"external/chipmunk/src/cpSpatialIndex.c\",\n\"external/chipmunk/src/cpSweep1D.c\",\n\"external/chipmunk/src/cpVect.c\",\n\"external/chipmunk/src/prime.h\",\n\"external/curl/include/android/curl/curl.h\",\n\"external/curl/include/android/curl/curlbuild.h\",\n\"external/curl/include/android/curl/curlrules.h\",\n\"external/curl/include/android/curl/curlver.h\",\n\"external/curl/include/android/curl/easy.h\",\n\"external/curl/include/android/curl/mprintf.h\",\n\"external/curl/include/android/curl/multi.h\",\n\"external/curl/include/android/curl/stdcheaders.h\",\n\"external/curl/include/android/curl/typecheck-gcc.h\",\n\"external/curl/include/android/curl/types.h\",\n\"external/curl/include/ios/curl/curl.h\",\n\"external/curl/include/ios/curl/curlbuild.h\",\n\"external/curl/include/ios/curl/curlrules.h\",\n\"external/curl/include/ios/curl/curlver.h\",\n\"external/curl/include/ios/curl/easy.h\",\n\"external/curl/include/ios/curl/mprintf.h\",\n\"external/curl/include/ios/curl/multi.h\",\n\"external/curl/include/ios/curl/stdcheaders.h\",\n\"external/curl/include/ios/curl/typecheck-gcc.h\",\n\"external/curl/include/linux/32-bit/curl/curl.h\",\n\"external/curl/include/linux/32-bit/curl/curlbuild.h\",\n\"external/curl/include/linux/32-bit/curl/curlrules.h\",\n\"external/curl/include/linux/32-bit/curl/curlver.h\",\n\"external/curl/include/linux/32-bit/curl/easy.h\",\n\"external/curl/include/linux/32-bit/curl/mprintf.h\",\n\"external/curl/include/linux/32-bit/curl/multi.h\",\n\"external/curl/include/linux/32-bit/curl/stdcheaders.h\",\n\"external/curl/include/linux/32-bit/curl/typecheck-gcc.h\",\n\"external/curl/include/linux/64-bit/curl/curl.h\",\n\"external/curl/include/linux/64-bit/curl/curlbuild.h\",\n\"external/curl/include/linux/64-bit/curl/curlrules.h\",\n\"external/curl/include/linux/64-bit/curl/curlver.h\",\n\"external/curl/include/linux/64-bit/curl/easy.h\",\n\"external/curl/include/linux/64-bit/curl/mprintf.h\",\n\"external/curl/include/linux/64-bit/curl/multi.h\",\n\"external/curl/include/linux/64-bit/curl/stdcheaders.h\",\n\"external/curl/include/win32/curl/curl.h\",\n\"external/curl/include/win32/curl/curlbuild.h\",\n\"external/curl/include/win32/curl/curlrules.h\",\n\"external/curl/include/win32/curl/curlver.h\",\n\"external/curl/include/win32/curl/easy.h\",\n\"external/curl/include/win32/curl/mprintf.h\",\n\"external/curl/include/win32/curl/multi.h\",\n\"external/curl/include/win32/curl/stdcheaders.h\",\n\"external/curl/include/win32/curl/typecheck-gcc.h\",\n\"external/curl/prebuilt/android/Android.mk\",\n\"external/curl/prebuilt/android/armeabi/libcurl.a\",\n\"external/curl/prebuilt/android/armeabi-v7a/libcurl.a\",\n\"external/curl/prebuilt/android/x86/libcurl.a\",\n\"external/curl/prebuilt/ios/libcurl.a\",\n\"external/curl/prebuilt/linux/32-bit/libcurl.a\",\n\"external/curl/prebuilt/linux/64-bit/libcurl.a\",\n\"external/curl/prebuilt/win32/libcurl.dll\",\n\"external/curl/prebuilt/win32/libcurl_imp.lib\",\n\"external/edtaa3func/edtaa3func.cpp\",\n\"external/edtaa3func/edtaa3func.h\",\n\"external/freetype2/include/android/freetype2/freetype/config/ftconfig.h\",\n\"external/freetype2/include/android/freetype2/freetype/config/ftheader.h\",\n\"external/freetype2/include/android/freetype2/freetype/config/ftmodule.h\",\n\"external/freetype2/include/android/freetype2/freetype/config/ftoption.h\",\n\"external/freetype2/include/android/freetype2/freetype/config/ftstdlib.h\",\n\"external/freetype2/include/android/freetype2/freetype/freetype.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftadvanc.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftautoh.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftbbox.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftbdf.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftbitmap.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftbzip2.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftcache.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftcffdrv.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftchapters.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftcid.h\",\n\"external/freetype2/include/android/freetype2/freetype/fterrdef.h\",\n\"external/freetype2/include/android/freetype2/freetype/fterrors.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftgasp.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftglyph.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftgxval.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftgzip.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftimage.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftincrem.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftlcdfil.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftlist.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftlzw.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftmac.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftmm.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftmodapi.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftmoderr.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftotval.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftoutln.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftpfr.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftrender.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftsizes.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftsnames.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftstroke.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftsynth.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftsystem.h\",\n\"external/freetype2/include/android/freetype2/freetype/fttrigon.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftttdrv.h\",\n\"external/freetype2/include/android/freetype2/freetype/fttypes.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftwinfnt.h\",\n\"external/freetype2/include/android/freetype2/freetype/ftxf86.h\",\n\"external/freetype2/include/android/freetype2/freetype/t1tables.h\",\n\"external/freetype2/include/android/freetype2/freetype/ttnameid.h\",\n\"external/freetype2/include/android/freetype2/freetype/tttables.h\",\n\"external/freetype2/include/android/freetype2/freetype/tttags.h\",\n\"external/freetype2/include/android/freetype2/freetype/ttunpat.h\",\n\"external/freetype2/include/android/ft2build.h\",\n\"external/freetype2/include/ios/freetype/config/ftconfig.h\",\n\"external/freetype2/include/ios/freetype/config/ftheader.h\",\n\"external/freetype2/include/ios/freetype/config/ftmodule.h\",\n\"external/freetype2/include/ios/freetype/config/ftoption.h\",\n\"external/freetype2/include/ios/freetype/config/ftstdlib.h\",\n\"external/freetype2/include/ios/freetype/freetype.h\",\n\"external/freetype2/include/ios/freetype/ftadvanc.h\",\n\"external/freetype2/include/ios/freetype/ftautoh.h\",\n\"external/freetype2/include/ios/freetype/ftbbox.h\",\n\"external/freetype2/include/ios/freetype/ftbdf.h\",\n\"external/freetype2/include/ios/freetype/ftbitmap.h\",\n\"external/freetype2/include/ios/freetype/ftbzip2.h\",\n\"external/freetype2/include/ios/freetype/ftcache.h\",\n\"external/freetype2/include/ios/freetype/ftcffdrv.h\",\n\"external/freetype2/include/ios/freetype/ftchapters.h\",\n\"external/freetype2/include/ios/freetype/ftcid.h\",\n\"external/freetype2/include/ios/freetype/fterrdef.h\",\n\"external/freetype2/include/ios/freetype/fterrors.h\",\n\"external/freetype2/include/ios/freetype/ftgasp.h\",\n\"external/freetype2/include/ios/freetype/ftglyph.h\",\n\"external/freetype2/include/ios/freetype/ftgxval.h\",\n\"external/freetype2/include/ios/freetype/ftgzip.h\",\n\"external/freetype2/include/ios/freetype/ftimage.h\",\n\"external/freetype2/include/ios/freetype/ftincrem.h\",\n\"external/freetype2/include/ios/freetype/ftlcdfil.h\",\n\"external/freetype2/include/ios/freetype/ftlist.h\",\n\"external/freetype2/include/ios/freetype/ftlzw.h\",\n\"external/freetype2/include/ios/freetype/ftmac.h\",\n\"external/freetype2/include/ios/freetype/ftmm.h\",\n\"external/freetype2/include/ios/freetype/ftmodapi.h\",\n\"external/freetype2/include/ios/freetype/ftmoderr.h\",\n\"external/freetype2/include/ios/freetype/ftotval.h\",\n\"external/freetype2/include/ios/freetype/ftoutln.h\",\n\"external/freetype2/include/ios/freetype/ftpfr.h\",\n\"external/freetype2/include/ios/freetype/ftrender.h\",\n\"external/freetype2/include/ios/freetype/ftsizes.h\",\n\"external/freetype2/include/ios/freetype/ftsnames.h\",\n\"external/freetype2/include/ios/freetype/ftstroke.h\",\n\"external/freetype2/include/ios/freetype/ftsynth.h\",\n\"external/freetype2/include/ios/freetype/ftsystem.h\",\n\"external/freetype2/include/ios/freetype/fttrigon.h\",\n\"external/freetype2/include/ios/freetype/ftttdrv.h\",\n\"external/freetype2/include/ios/freetype/fttypes.h\",\n\"external/freetype2/include/ios/freetype/ftwinfnt.h\",\n\"external/freetype2/include/ios/freetype/ftxf86.h\",\n\"external/freetype2/include/ios/freetype/internal/autohint.h\",\n\"external/freetype2/include/ios/freetype/internal/ftcalc.h\",\n\"external/freetype2/include/ios/freetype/internal/ftdebug.h\",\n\"external/freetype2/include/ios/freetype/internal/ftdriver.h\",\n\"external/freetype2/include/ios/freetype/internal/ftgloadr.h\",\n\"external/freetype2/include/ios/freetype/internal/ftmemory.h\",\n\"external/freetype2/include/ios/freetype/internal/ftobjs.h\",\n\"external/freetype2/include/ios/freetype/internal/ftpic.h\",\n\"external/freetype2/include/ios/freetype/internal/ftrfork.h\",\n\"external/freetype2/include/ios/freetype/internal/ftserv.h\",\n\"external/freetype2/include/ios/freetype/internal/ftstream.h\",\n\"external/freetype2/include/ios/freetype/internal/fttrace.h\",\n\"external/freetype2/include/ios/freetype/internal/ftvalid.h\",\n\"external/freetype2/include/ios/freetype/internal/internal.h\",\n\"external/freetype2/include/ios/freetype/internal/psaux.h\",\n\"external/freetype2/include/ios/freetype/internal/pshints.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svbdf.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svcid.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svgldict.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svgxval.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svkern.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svmm.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svotval.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svpfr.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svpostnm.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svprop.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svpscmap.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svpsinfo.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svsfnt.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svttcmap.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svtteng.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svttglyf.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svwinfnt.h\",\n\"external/freetype2/include/ios/freetype/internal/services/svxf86nm.h\",\n\"external/freetype2/include/ios/freetype/internal/sfnt.h\",\n\"external/freetype2/include/ios/freetype/internal/t1types.h\",\n\"external/freetype2/include/ios/freetype/internal/tttypes.h\",\n\"external/freetype2/include/ios/freetype/t1tables.h\",\n\"external/freetype2/include/ios/freetype/ttnameid.h\",\n\"external/freetype2/include/ios/freetype/tttables.h\",\n\"external/freetype2/include/ios/freetype/tttags.h\",\n\"external/freetype2/include/ios/freetype/ttunpat.h\",\n\"external/freetype2/include/ios/ft2build.h\",\n\"external/freetype2/include/linux/freetype/config/ftconfig.h\",\n\"external/freetype2/include/linux/freetype/config/ftheader.h\",\n\"external/freetype2/include/linux/freetype/config/ftmodule.h\",\n\"external/freetype2/include/linux/freetype/config/ftoption.h\",\n\"external/freetype2/include/linux/freetype/config/ftstdlib.h\",\n\"external/freetype2/include/linux/freetype/freetype.h\",\n\"external/freetype2/include/linux/freetype/ftadvanc.h\",\n\"external/freetype2/include/linux/freetype/ftbbox.h\",\n\"external/freetype2/include/linux/freetype/ftbdf.h\",\n\"external/freetype2/include/linux/freetype/ftbitmap.h\",\n\"external/freetype2/include/linux/freetype/ftbzip2.h\",\n\"external/freetype2/include/linux/freetype/ftcache.h\",\n\"external/freetype2/include/linux/freetype/ftchapters.h\",\n\"external/freetype2/include/linux/freetype/ftcid.h\",\n\"external/freetype2/include/linux/freetype/fterrdef.h\",\n\"external/freetype2/include/linux/freetype/fterrors.h\",\n\"external/freetype2/include/linux/freetype/ftgasp.h\",\n\"external/freetype2/include/linux/freetype/ftglyph.h\",\n\"external/freetype2/include/linux/freetype/ftgxval.h\",\n\"external/freetype2/include/linux/freetype/ftgzip.h\",\n\"external/freetype2/include/linux/freetype/ftimage.h\",\n\"external/freetype2/include/linux/freetype/ftincrem.h\",\n\"external/freetype2/include/linux/freetype/ftlcdfil.h\",\n\"external/freetype2/include/linux/freetype/ftlist.h\",\n\"external/freetype2/include/linux/freetype/ftlzw.h\",\n\"external/freetype2/include/linux/freetype/ftmac.h\",\n\"external/freetype2/include/linux/freetype/ftmm.h\",\n\"external/freetype2/include/linux/freetype/ftmodapi.h\",\n\"external/freetype2/include/linux/freetype/ftmoderr.h\",\n\"external/freetype2/include/linux/freetype/ftotval.h\",\n\"external/freetype2/include/linux/freetype/ftoutln.h\",\n\"external/freetype2/include/linux/freetype/ftpfr.h\",\n\"external/freetype2/include/linux/freetype/ftrender.h\",\n\"external/freetype2/include/linux/freetype/ftsizes.h\",\n\"external/freetype2/include/linux/freetype/ftsnames.h\",\n\"external/freetype2/include/linux/freetype/ftstroke.h\",\n\"external/freetype2/include/linux/freetype/ftsynth.h\",\n\"external/freetype2/include/linux/freetype/ftsystem.h\",\n\"external/freetype2/include/linux/freetype/fttrigon.h\",\n\"external/freetype2/include/linux/freetype/fttypes.h\",\n\"external/freetype2/include/linux/freetype/ftwinfnt.h\",\n\"external/freetype2/include/linux/freetype/ftxf86.h\",\n\"external/freetype2/include/linux/freetype/internal/autohint.h\",\n\"external/freetype2/include/linux/freetype/internal/ftcalc.h\",\n\"external/freetype2/include/linux/freetype/internal/ftdebug.h\",\n\"external/freetype2/include/linux/freetype/internal/ftdriver.h\",\n\"external/freetype2/include/linux/freetype/internal/ftgloadr.h\",\n\"external/freetype2/include/linux/freetype/internal/ftmemory.h\",\n\"external/freetype2/include/linux/freetype/internal/ftobjs.h\",\n\"external/freetype2/include/linux/freetype/internal/ftpic.h\",\n\"external/freetype2/include/linux/freetype/internal/ftrfork.h\",\n\"external/freetype2/include/linux/freetype/internal/ftserv.h\",\n\"external/freetype2/include/linux/freetype/internal/ftstream.h\",\n\"external/freetype2/include/linux/freetype/internal/fttrace.h\",\n\"external/freetype2/include/linux/freetype/internal/ftvalid.h\",\n\"external/freetype2/include/linux/freetype/internal/internal.h\",\n\"external/freetype2/include/linux/freetype/internal/psaux.h\",\n\"external/freetype2/include/linux/freetype/internal/pshints.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svbdf.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svcid.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svgldict.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svgxval.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svkern.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svmm.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svotval.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svpfr.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svpostnm.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svpscmap.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svpsinfo.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svsfnt.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svttcmap.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svtteng.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svttglyf.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svwinfnt.h\",\n\"external/freetype2/include/linux/freetype/internal/services/svxf86nm.h\",\n\"external/freetype2/include/linux/freetype/internal/sfnt.h\",\n\"external/freetype2/include/linux/freetype/internal/t1types.h\",\n\"external/freetype2/include/linux/freetype/internal/tttypes.h\",\n\"external/freetype2/include/linux/freetype/t1tables.h\",\n\"external/freetype2/include/linux/freetype/ttnameid.h\",\n\"external/freetype2/include/linux/freetype/tttables.h\",\n\"external/freetype2/include/linux/freetype/tttags.h\",\n\"external/freetype2/include/linux/freetype/ttunpat.h\",\n\"external/freetype2/include/linux/ft2build.h\",\n\"external/freetype2/include/mac/freetype/config/ftconfig.h\",\n\"external/freetype2/include/mac/freetype/config/ftheader.h\",\n\"external/freetype2/include/mac/freetype/config/ftmodule.h\",\n\"external/freetype2/include/mac/freetype/config/ftoption.h\",\n\"external/freetype2/include/mac/freetype/config/ftstdlib.h\",\n\"external/freetype2/include/mac/freetype/freetype.h\",\n\"external/freetype2/include/mac/freetype/ftadvanc.h\",\n\"external/freetype2/include/mac/freetype/ftautoh.h\",\n\"external/freetype2/include/mac/freetype/ftbbox.h\",\n\"external/freetype2/include/mac/freetype/ftbdf.h\",\n\"external/freetype2/include/mac/freetype/ftbitmap.h\",\n\"external/freetype2/include/mac/freetype/ftbzip2.h\",\n\"external/freetype2/include/mac/freetype/ftcache.h\",\n\"external/freetype2/include/mac/freetype/ftcffdrv.h\",\n\"external/freetype2/include/mac/freetype/ftchapters.h\",\n\"external/freetype2/include/mac/freetype/ftcid.h\",\n\"external/freetype2/include/mac/freetype/fterrdef.h\",\n\"external/freetype2/include/mac/freetype/fterrors.h\",\n\"external/freetype2/include/mac/freetype/ftgasp.h\",\n\"external/freetype2/include/mac/freetype/ftglyph.h\",\n\"external/freetype2/include/mac/freetype/ftgxval.h\",\n\"external/freetype2/include/mac/freetype/ftgzip.h\",\n\"external/freetype2/include/mac/freetype/ftimage.h\",\n\"external/freetype2/include/mac/freetype/ftincrem.h\",\n\"external/freetype2/include/mac/freetype/ftlcdfil.h\",\n\"external/freetype2/include/mac/freetype/ftlist.h\",\n\"external/freetype2/include/mac/freetype/ftlzw.h\",\n\"external/freetype2/include/mac/freetype/ftmac.h\",\n\"external/freetype2/include/mac/freetype/ftmm.h\",\n\"external/freetype2/include/mac/freetype/ftmodapi.h\",\n\"external/freetype2/include/mac/freetype/ftmoderr.h\",\n\"external/freetype2/include/mac/freetype/ftotval.h\",\n\"external/freetype2/include/mac/freetype/ftoutln.h\",\n\"external/freetype2/include/mac/freetype/ftpfr.h\",\n\"external/freetype2/include/mac/freetype/ftrender.h\",\n\"external/freetype2/include/mac/freetype/ftsizes.h\",\n\"external/freetype2/include/mac/freetype/ftsnames.h\",\n\"external/freetype2/include/mac/freetype/ftstroke.h\",\n\"external/freetype2/include/mac/freetype/ftsynth.h\",\n\"external/freetype2/include/mac/freetype/ftsystem.h\",\n\"external/freetype2/include/mac/freetype/fttrigon.h\",\n\"external/freetype2/include/mac/freetype/ftttdrv.h\",\n\"external/freetype2/include/mac/freetype/fttypes.h\",\n\"external/freetype2/include/mac/freetype/ftwinfnt.h\",\n\"external/freetype2/include/mac/freetype/ftxf86.h\",\n\"external/freetype2/include/mac/freetype/internal/autohint.h\",\n\"external/freetype2/include/mac/freetype/internal/ftcalc.h\",\n\"external/freetype2/include/mac/freetype/internal/ftdebug.h\",\n\"external/freetype2/include/mac/freetype/internal/ftdriver.h\",\n\"external/freetype2/include/mac/freetype/internal/ftgloadr.h\",\n\"external/freetype2/include/mac/freetype/internal/ftmemory.h\",\n\"external/freetype2/include/mac/freetype/internal/ftobjs.h\",\n\"external/freetype2/include/mac/freetype/internal/ftpic.h\",\n\"external/freetype2/include/mac/freetype/internal/ftrfork.h\",\n\"external/freetype2/include/mac/freetype/internal/ftserv.h\",\n\"external/freetype2/include/mac/freetype/internal/ftstream.h\",\n\"external/freetype2/include/mac/freetype/internal/fttrace.h\",\n\"external/freetype2/include/mac/freetype/internal/ftvalid.h\",\n\"external/freetype2/include/mac/freetype/internal/internal.h\",\n\"external/freetype2/include/mac/freetype/internal/psaux.h\",\n\"external/freetype2/include/mac/freetype/internal/pshints.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svbdf.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svcid.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svgldict.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svgxval.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svkern.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svmm.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svotval.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svpfr.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svpostnm.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svprop.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svpscmap.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svpsinfo.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svsfnt.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svttcmap.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svtteng.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svttglyf.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svwinfnt.h\",\n\"external/freetype2/include/mac/freetype/internal/services/svxf86nm.h\",\n\"external/freetype2/include/mac/freetype/internal/sfnt.h\",\n\"external/freetype2/include/mac/freetype/internal/t1types.h\",\n\"external/freetype2/include/mac/freetype/internal/tttypes.h\",\n\"external/freetype2/include/mac/freetype/t1tables.h\",\n\"external/freetype2/include/mac/freetype/ttnameid.h\",\n\"external/freetype2/include/mac/freetype/tttables.h\",\n\"external/freetype2/include/mac/freetype/tttags.h\",\n\"external/freetype2/include/mac/freetype/ttunpat.h\",\n\"external/freetype2/include/mac/ft2build.h\",\n\"external/freetype2/include/win32/freetype/config/ftconfig.h\",\n\"external/freetype2/include/win32/freetype/config/ftheader.h\",\n\"external/freetype2/include/win32/freetype/config/ftmodule.h\",\n\"external/freetype2/include/win32/freetype/config/ftoption.h\",\n\"external/freetype2/include/win32/freetype/config/ftstdlib.h\",\n\"external/freetype2/include/win32/freetype/freetype.h\",\n\"external/freetype2/include/win32/freetype/ftadvanc.h\",\n\"external/freetype2/include/win32/freetype/ftautoh.h\",\n\"external/freetype2/include/win32/freetype/ftbbox.h\",\n\"external/freetype2/include/win32/freetype/ftbdf.h\",\n\"external/freetype2/include/win32/freetype/ftbitmap.h\",\n\"external/freetype2/include/win32/freetype/ftbzip2.h\",\n\"external/freetype2/include/win32/freetype/ftcache.h\",\n\"external/freetype2/include/win32/freetype/ftcffdrv.h\",\n\"external/freetype2/include/win32/freetype/ftchapters.h\",\n\"external/freetype2/include/win32/freetype/ftcid.h\",\n\"external/freetype2/include/win32/freetype/fterrdef.h\",\n\"external/freetype2/include/win32/freetype/fterrors.h\",\n\"external/freetype2/include/win32/freetype/ftgasp.h\",\n\"external/freetype2/include/win32/freetype/ftglyph.h\",\n\"external/freetype2/include/win32/freetype/ftgxval.h\",\n\"external/freetype2/include/win32/freetype/ftgzip.h\",\n\"external/freetype2/include/win32/freetype/ftimage.h\",\n\"external/freetype2/include/win32/freetype/ftincrem.h\",\n\"external/freetype2/include/win32/freetype/ftlcdfil.h\",\n\"external/freetype2/include/win32/freetype/ftlist.h\",\n\"external/freetype2/include/win32/freetype/ftlzw.h\",\n\"external/freetype2/include/win32/freetype/ftmac.h\",\n\"external/freetype2/include/win32/freetype/ftmm.h\",\n\"external/freetype2/include/win32/freetype/ftmodapi.h\",\n\"external/freetype2/include/win32/freetype/ftmoderr.h\",\n\"external/freetype2/include/win32/freetype/ftotval.h\",\n\"external/freetype2/include/win32/freetype/ftoutln.h\",\n\"external/freetype2/include/win32/freetype/ftpfr.h\",\n\"external/freetype2/include/win32/freetype/ftrender.h\",\n\"external/freetype2/include/win32/freetype/ftsizes.h\",\n\"external/freetype2/include/win32/freetype/ftsnames.h\",\n\"external/freetype2/include/win32/freetype/ftstroke.h\",\n\"external/freetype2/include/win32/freetype/ftsynth.h\",\n\"external/freetype2/include/win32/freetype/ftsystem.h\",\n\"external/freetype2/include/win32/freetype/fttrigon.h\",\n\"external/freetype2/include/win32/freetype/ftttdrv.h\",\n\"external/freetype2/include/win32/freetype/fttypes.h\",\n\"external/freetype2/include/win32/freetype/ftwinfnt.h\",\n\"external/freetype2/include/win32/freetype/ftxf86.h\",\n\"external/freetype2/include/win32/freetype/internal/autohint.h\",\n\"external/freetype2/include/win32/freetype/internal/ftcalc.h\",\n\"external/freetype2/include/win32/freetype/internal/ftdebug.h\",\n\"external/freetype2/include/win32/freetype/internal/ftdriver.h\",\n\"external/freetype2/include/win32/freetype/internal/ftgloadr.h\",\n\"external/freetype2/include/win32/freetype/internal/ftmemory.h\",\n\"external/freetype2/include/win32/freetype/internal/ftobjs.h\",\n\"external/freetype2/include/win32/freetype/internal/ftpic.h\",\n\"external/freetype2/include/win32/freetype/internal/ftrfork.h\",\n\"external/freetype2/include/win32/freetype/internal/ftserv.h\",\n\"external/freetype2/include/win32/freetype/internal/ftstream.h\",\n\"external/freetype2/include/win32/freetype/internal/fttrace.h\",\n\"external/freetype2/include/win32/freetype/internal/ftvalid.h\",\n\"external/freetype2/include/win32/freetype/internal/internal.h\",\n\"external/freetype2/include/win32/freetype/internal/psaux.h\",\n\"external/freetype2/include/win32/freetype/internal/pshints.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svbdf.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svcid.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svgldict.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svgxval.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svkern.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svmm.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svotval.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svpfr.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svpostnm.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svprop.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svpscmap.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svpsinfo.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svsfnt.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svttcmap.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svtteng.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svttglyf.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svwinfnt.h\",\n\"external/freetype2/include/win32/freetype/internal/services/svxf86nm.h\",\n\"external/freetype2/include/win32/freetype/internal/sfnt.h\",\n\"external/freetype2/include/win32/freetype/internal/t1types.h\",\n\"external/freetype2/include/win32/freetype/internal/tttypes.h\",\n\"external/freetype2/include/win32/freetype/t1tables.h\",\n\"external/freetype2/include/win32/freetype/ttnameid.h\",\n\"external/freetype2/include/win32/freetype/tttables.h\",\n\"external/freetype2/include/win32/freetype/tttags.h\",\n\"external/freetype2/include/win32/freetype/ttunpat.h\",\n\"external/freetype2/include/win32/ft2build.h\",\n\"external/freetype2/prebuilt/android/Android.mk\",\n\"external/freetype2/prebuilt/android/armeabi/libfreetype.a\",\n\"external/freetype2/prebuilt/android/armeabi-v7a/libfreetype.a\",\n\"external/freetype2/prebuilt/android/x86/libfreetype.a\",\n\"external/freetype2/prebuilt/ios/libfreetype.a\",\n\"external/freetype2/prebuilt/linux/32-bit/libfreetype.a\",\n\"external/freetype2/prebuilt/linux/64-bit/libfreetype.a\",\n\"external/freetype2/prebuilt/mac/libfreetype.a\",\n\"external/freetype2/prebuilt/win32/freetype250.lib\",\n\"external/glfw3/include/linux/glfw3.h\",\n\"external/glfw3/include/linux/glfw3native.h\",\n\"external/glfw3/include/mac/glfw3.h\",\n\"external/glfw3/include/mac/glfw3native.h\",\n\"external/glfw3/include/win32/glfw3.h\",\n\"external/glfw3/include/win32/glfw3native.h\",\n\"external/glfw3/prebuilt/mac/libglfw3.a\",\n\"external/glfw3/prebuilt/win32/glfw3.lib\",\n\"external/jpeg/include/android/jconfig.h\",\n\"external/jpeg/include/android/jerror.h\",\n\"external/jpeg/include/android/jmorecfg.h\",\n\"external/jpeg/include/android/jpeglib.h\",\n\"external/jpeg/include/ios/jconfig.h\",\n\"external/jpeg/include/ios/jmorecfg.h\",\n\"external/jpeg/include/ios/jpeglib.h\",\n\"external/jpeg/include/linux/jconfig.h\",\n\"external/jpeg/include/linux/jmorecfg.h\",\n\"external/jpeg/include/linux/jpeglib.h\",\n\"external/jpeg/include/mac/jconfig.h\",\n\"external/jpeg/include/mac/jmorecfg.h\",\n\"external/jpeg/include/mac/jpeglib.h\",\n\"external/jpeg/include/win32/jconfig.h\",\n\"external/jpeg/include/win32/jmorecfg.h\",\n\"external/jpeg/include/win32/jpeglib.h\",\n\"external/jpeg/prebuilt/android/Android.mk\",\n\"external/jpeg/prebuilt/android/armeabi/libjpeg.a\",\n\"external/jpeg/prebuilt/android/armeabi-v7a/libjpeg.a\",\n\"external/jpeg/prebuilt/android/x86/libjpeg.a\",\n\"external/jpeg/prebuilt/ios/libjpeg.a\",\n\"external/jpeg/prebuilt/linux/32-bit/libjpeg.a\",\n\"external/jpeg/prebuilt/linux/64-bit/libjpeg.a\",\n\"external/jpeg/prebuilt/mac/libjpeg.a\",\n\"external/jpeg/prebuilt/win32/libjpeg.lib\",\n\"external/json/document.h\",\n\"external/json/filestream.h\",\n\"external/json/internal/pow10.h\",\n\"external/json/internal/stack.h\",\n\"external/json/internal/strfunc.h\",\n\"external/json/prettywriter.h\",\n\"external/json/rapidjson.h\",\n\"external/json/reader.h\",\n\"external/json/stringbuffer.h\",\n\"external/json/writer.h\",\n\"external/linux-specific/fmod/include/32-bit/fmod.h\",\n\"external/linux-specific/fmod/include/32-bit/fmod.hpp\",\n\"external/linux-specific/fmod/include/32-bit/fmod_codec.h\",\n\"external/linux-specific/fmod/include/32-bit/fmod_dsp.h\",\n\"external/linux-specific/fmod/include/32-bit/fmod_errors.h\",\n\"external/linux-specific/fmod/include/32-bit/fmod_memoryinfo.h\",\n\"external/linux-specific/fmod/include/32-bit/fmod_output.h\",\n\"external/linux-specific/fmod/include/32-bit/fmodlinux.h\",\n\"external/linux-specific/fmod/include/64-bit/fmod.h\",\n\"external/linux-specific/fmod/include/64-bit/fmod.hpp\",\n\"external/linux-specific/fmod/include/64-bit/fmod_codec.h\",\n\"external/linux-specific/fmod/include/64-bit/fmod_dsp.h\",\n\"external/linux-specific/fmod/include/64-bit/fmod_errors.h\",\n\"external/linux-specific/fmod/include/64-bit/fmod_memoryinfo.h\",\n\"external/linux-specific/fmod/include/64-bit/fmod_output.h\",\n\"external/linux-specific/fmod/include/64-bit/fmodlinux.h\",\n\"external/linux-specific/fmod/prebuilt/32-bit/libfmodex-4.36.01.so\",\n\"external/linux-specific/fmod/prebuilt/32-bit/libfmodex.so\",\n\"external/linux-specific/fmod/prebuilt/32-bit/libfmodexL-4.36.01.so\",\n\"external/linux-specific/fmod/prebuilt/32-bit/libfmodexL.so\",\n\"external/linux-specific/fmod/prebuilt/64-bit/libfmodex64-4.38.00.so\",\n\"external/linux-specific/fmod/prebuilt/64-bit/libfmodex64.so\",\n\"external/linux-specific/fmod/prebuilt/64-bit/libfmodexL64-4.38.00.so\",\n\"external/linux-specific/fmod/prebuilt/64-bit/libfmodexL64.so\",\n\"external/lua/lua/CMakeLists.txt\",\n\"external/lua/lua/lapi.c\",\n\"external/lua/lua/lapi.h\",\n\"external/lua/lua/lauxlib.c\",\n\"external/lua/lua/lauxlib.h\",\n\"external/lua/lua/lbaselib.c\",\n\"external/lua/lua/lcode.c\",\n\"external/lua/lua/lcode.h\",\n\"external/lua/lua/ldblib.c\",\n\"external/lua/lua/ldebug.c\",\n\"external/lua/lua/ldebug.h\",\n\"external/lua/lua/ldo.c\",\n\"external/lua/lua/ldo.h\",\n\"external/lua/lua/ldump.c\",\n\"external/lua/lua/lfunc.c\",\n\"external/lua/lua/lfunc.h\",\n\"external/lua/lua/lgc.c\",\n\"external/lua/lua/lgc.h\",\n\"external/lua/lua/linit.c\",\n\"external/lua/lua/liolib.c\",\n\"external/lua/lua/llex.c\",\n\"external/lua/lua/llex.h\",\n\"external/lua/lua/llimits.h\",\n\"external/lua/lua/lmathlib.c\",\n\"external/lua/lua/lmem.c\",\n\"external/lua/lua/lmem.h\",\n\"external/lua/lua/loadlib.c\",\n\"external/lua/lua/lobject.c\",\n\"external/lua/lua/lobject.h\",\n\"external/lua/lua/lopcodes.c\",\n\"external/lua/lua/lopcodes.h\",\n\"external/lua/lua/loslib.c\",\n\"external/lua/lua/lparser.c\",\n\"external/lua/lua/lparser.h\",\n\"external/lua/lua/lstate.c\",\n\"external/lua/lua/lstate.h\",\n\"external/lua/lua/lstring.c\",\n\"external/lua/lua/lstring.h\",\n\"external/lua/lua/lstrlib.c\",\n\"external/lua/lua/ltable.c\",\n\"external/lua/lua/ltable.h\",\n\"external/lua/lua/ltablib.c\",\n\"external/lua/lua/ltm.c\",\n\"external/lua/lua/ltm.h\",\n\"external/lua/lua/lua.c\",\n\"external/lua/lua/lua.h\",\n\"external/lua/lua/luaconf.h\",\n\"external/lua/lua/lualib.h\",\n\"external/lua/lua/lundump.c\",\n\"external/lua/lua/lundump.h\",\n\"external/lua/lua/lvm.c\",\n\"external/lua/lua/lvm.h\",\n\"external/lua/lua/lzio.c\",\n\"external/lua/lua/lzio.h\",\n\"external/lua/lua/print.c\",\n\"external/lua/luajit/build_android.sh\",\n\"external/lua/luajit/build_ios.sh\",\n\"external/lua/luajit/build_mac.sh\",\n\"external/lua/luajit/include/lauxlib.h\",\n\"external/lua/luajit/include/lua.h\",\n\"external/lua/luajit/include/luaconf.h\",\n\"external/lua/luajit/include/lualib.h\",\n\"external/lua/luajit/prebuilt/android/Android.mk\",\n\"external/lua/luajit/prebuilt/android/armeabi/libluajit.a\",\n\"external/lua/luajit/prebuilt/android/armeabi-v7a/libluajit.a\",\n\"external/lua/luajit/prebuilt/android/x86/libluajit.a\",\n\"external/lua/luajit/prebuilt/ios/libluajit.a\",\n\"external/lua/luajit/prebuilt/mac/libluajit.a\",\n\"external/lua/luajit/prebuilt/win32/lua51.dll\",\n\"external/lua/luajit/prebuilt/win32/lua51.lib\",\n\"external/lua/luajit/src/COPYRIGHT\",\n\"external/lua/luajit/src/doc/bluequad-print.css\",\n\"external/lua/luajit/src/doc/bluequad.css\",\n\"external/lua/luajit/src/doc/changes.html\",\n\"external/lua/luajit/src/doc/contact.html\",\n\"external/lua/luajit/src/doc/ext_c_api.html\",\n\"external/lua/luajit/src/doc/ext_ffi.html\",\n\"external/lua/luajit/src/doc/ext_ffi_api.html\",\n\"external/lua/luajit/src/doc/ext_ffi_semantics.html\",\n\"external/lua/luajit/src/doc/ext_ffi_tutorial.html\",\n\"external/lua/luajit/src/doc/ext_jit.html\",\n\"external/lua/luajit/src/doc/extensions.html\",\n\"external/lua/luajit/src/doc/faq.html\",\n\"external/lua/luajit/src/doc/img/contact.png\",\n\"external/lua/luajit/src/doc/install.html\",\n\"external/lua/luajit/src/doc/luajit.html\",\n\"external/lua/luajit/src/doc/running.html\",\n\"external/lua/luajit/src/doc/status.html\",\n\"external/lua/luajit/src/dynasm/dasm_arm.h\",\n\"external/lua/luajit/src/dynasm/dasm_arm.lua\",\n\"external/lua/luajit/src/dynasm/dasm_mips.h\",\n\"external/lua/luajit/src/dynasm/dasm_mips.lua\",\n\"external/lua/luajit/src/dynasm/dasm_ppc.h\",\n\"external/lua/luajit/src/dynasm/dasm_ppc.lua\",\n\"external/lua/luajit/src/dynasm/dasm_proto.h\",\n\"external/lua/luajit/src/dynasm/dasm_x64.lua\",\n\"external/lua/luajit/src/dynasm/dasm_x86.h\",\n\"external/lua/luajit/src/dynasm/dasm_x86.lua\",\n\"external/lua/luajit/src/dynasm/dynasm.lua\",\n\"external/lua/luajit/src/etc/luajit.1\",\n\"external/lua/luajit/src/etc/luajit.pc\",\n\"external/lua/luajit/src/Makefile\",\n\"external/lua/luajit/src/README\",\n\"external/lua/luajit/src/src/host/buildvm.c\",\n\"external/lua/luajit/src/src/host/buildvm.h\",\n\"external/lua/luajit/src/src/host/buildvm_asm.c\",\n\"external/lua/luajit/src/src/host/buildvm_fold.c\",\n\"external/lua/luajit/src/src/host/buildvm_lib.c\",\n\"external/lua/luajit/src/src/host/buildvm_peobj.c\",\n\"external/lua/luajit/src/src/host/genminilua.lua\",\n\"external/lua/luajit/src/src/host/minilua.c\",\n\"external/lua/luajit/src/src/host/README\",\n\"external/lua/luajit/src/src/jit/bc.lua\",\n\"external/lua/luajit/src/src/jit/bcsave.lua\",\n\"external/lua/luajit/src/src/jit/dis_arm.lua\",\n\"external/lua/luajit/src/src/jit/dis_mips.lua\",\n\"external/lua/luajit/src/src/jit/dis_mipsel.lua\",\n\"external/lua/luajit/src/src/jit/dis_ppc.lua\",\n\"external/lua/luajit/src/src/jit/dis_x64.lua\",\n\"external/lua/luajit/src/src/jit/dis_x86.lua\",\n\"external/lua/luajit/src/src/jit/dump.lua\",\n\"external/lua/luajit/src/src/jit/v.lua\",\n\"external/lua/luajit/src/src/lauxlib.h\",\n\"external/lua/luajit/src/src/lib_aux.c\",\n\"external/lua/luajit/src/src/lib_base.c\",\n\"external/lua/luajit/src/src/lib_bit.c\",\n\"external/lua/luajit/src/src/lib_debug.c\",\n\"external/lua/luajit/src/src/lib_ffi.c\",\n\"external/lua/luajit/src/src/lib_init.c\",\n\"external/lua/luajit/src/src/lib_io.c\",\n\"external/lua/luajit/src/src/lib_jit.c\",\n\"external/lua/luajit/src/src/lib_math.c\",\n\"external/lua/luajit/src/src/lib_os.c\",\n\"external/lua/luajit/src/src/lib_package.c\",\n\"external/lua/luajit/src/src/lib_string.c\",\n\"external/lua/luajit/src/src/lib_table.c\",\n\"external/lua/luajit/src/src/lj.supp\",\n\"external/lua/luajit/src/src/lj_alloc.c\",\n\"external/lua/luajit/src/src/lj_alloc.h\",\n\"external/lua/luajit/src/src/lj_api.c\",\n\"external/lua/luajit/src/src/lj_arch.h\",\n\"external/lua/luajit/src/src/lj_asm.c\",\n\"external/lua/luajit/src/src/lj_asm.h\",\n\"external/lua/luajit/src/src/lj_asm_arm.h\",\n\"external/lua/luajit/src/src/lj_asm_mips.h\",\n\"external/lua/luajit/src/src/lj_asm_ppc.h\",\n\"external/lua/luajit/src/src/lj_asm_x86.h\",\n\"external/lua/luajit/src/src/lj_bc.c\",\n\"external/lua/luajit/src/src/lj_bc.h\",\n\"external/lua/luajit/src/src/lj_bcdump.h\",\n\"external/lua/luajit/src/src/lj_bcread.c\",\n\"external/lua/luajit/src/src/lj_bcwrite.c\",\n\"external/lua/luajit/src/src/lj_carith.c\",\n\"external/lua/luajit/src/src/lj_carith.h\",\n\"external/lua/luajit/src/src/lj_ccall.c\",\n\"external/lua/luajit/src/src/lj_ccall.h\",\n\"external/lua/luajit/src/src/lj_ccallback.c\",\n\"external/lua/luajit/src/src/lj_ccallback.h\",\n\"external/lua/luajit/src/src/lj_cconv.c\",\n\"external/lua/luajit/src/src/lj_cconv.h\",\n\"external/lua/luajit/src/src/lj_cdata.c\",\n\"external/lua/luajit/src/src/lj_cdata.h\",\n\"external/lua/luajit/src/src/lj_char.c\",\n\"external/lua/luajit/src/src/lj_char.h\",\n\"external/lua/luajit/src/src/lj_clib.c\",\n\"external/lua/luajit/src/src/lj_clib.h\",\n\"external/lua/luajit/src/src/lj_cparse.c\",\n\"external/lua/luajit/src/src/lj_cparse.h\",\n\"external/lua/luajit/src/src/lj_crecord.c\",\n\"external/lua/luajit/src/src/lj_crecord.h\",\n\"external/lua/luajit/src/src/lj_ctype.c\",\n\"external/lua/luajit/src/src/lj_ctype.h\",\n\"external/lua/luajit/src/src/lj_debug.c\",\n\"external/lua/luajit/src/src/lj_debug.h\",\n\"external/lua/luajit/src/src/lj_def.h\",\n\"external/lua/luajit/src/src/lj_dispatch.c\",\n\"external/lua/luajit/src/src/lj_dispatch.h\",\n\"external/lua/luajit/src/src/lj_emit_arm.h\",\n\"external/lua/luajit/src/src/lj_emit_mips.h\",\n\"external/lua/luajit/src/src/lj_emit_ppc.h\",\n\"external/lua/luajit/src/src/lj_emit_x86.h\",\n\"external/lua/luajit/src/src/lj_err.c\",\n\"external/lua/luajit/src/src/lj_err.h\",\n\"external/lua/luajit/src/src/lj_errmsg.h\",\n\"external/lua/luajit/src/src/lj_ff.h\",\n\"external/lua/luajit/src/src/lj_ffrecord.c\",\n\"external/lua/luajit/src/src/lj_ffrecord.h\",\n\"external/lua/luajit/src/src/lj_frame.h\",\n\"external/lua/luajit/src/src/lj_func.c\",\n\"external/lua/luajit/src/src/lj_func.h\",\n\"external/lua/luajit/src/src/lj_gc.c\",\n\"external/lua/luajit/src/src/lj_gc.h\",\n\"external/lua/luajit/src/src/lj_gdbjit.c\",\n\"external/lua/luajit/src/src/lj_gdbjit.h\",\n\"external/lua/luajit/src/src/lj_ir.c\",\n\"external/lua/luajit/src/src/lj_ir.h\",\n\"external/lua/luajit/src/src/lj_ircall.h\",\n\"external/lua/luajit/src/src/lj_iropt.h\",\n\"external/lua/luajit/src/src/lj_jit.h\",\n\"external/lua/luajit/src/src/lj_lex.c\",\n\"external/lua/luajit/src/src/lj_lex.h\",\n\"external/lua/luajit/src/src/lj_lib.c\",\n\"external/lua/luajit/src/src/lj_lib.h\",\n\"external/lua/luajit/src/src/lj_load.c\",\n\"external/lua/luajit/src/src/lj_mcode.c\",\n\"external/lua/luajit/src/src/lj_mcode.h\",\n\"external/lua/luajit/src/src/lj_meta.c\",\n\"external/lua/luajit/src/src/lj_meta.h\",\n\"external/lua/luajit/src/src/lj_obj.c\",\n\"external/lua/luajit/src/src/lj_obj.h\",\n\"external/lua/luajit/src/src/lj_opt_dce.c\",\n\"external/lua/luajit/src/src/lj_opt_fold.c\",\n\"external/lua/luajit/src/src/lj_opt_loop.c\",\n\"external/lua/luajit/src/src/lj_opt_mem.c\",\n\"external/lua/luajit/src/src/lj_opt_narrow.c\",\n\"external/lua/luajit/src/src/lj_opt_sink.c\",\n\"external/lua/luajit/src/src/lj_opt_split.c\",\n\"external/lua/luajit/src/src/lj_parse.c\",\n\"external/lua/luajit/src/src/lj_parse.h\",\n\"external/lua/luajit/src/src/lj_record.c\",\n\"external/lua/luajit/src/src/lj_record.h\",\n\"external/lua/luajit/src/src/lj_snap.c\",\n\"external/lua/luajit/src/src/lj_snap.h\",\n\"external/lua/luajit/src/src/lj_state.c\",\n\"external/lua/luajit/src/src/lj_state.h\",\n\"external/lua/luajit/src/src/lj_str.c\",\n\"external/lua/luajit/src/src/lj_str.h\",\n\"external/lua/luajit/src/src/lj_strscan.c\",\n\"external/lua/luajit/src/src/lj_strscan.h\",\n\"external/lua/luajit/src/src/lj_tab.c\",\n\"external/lua/luajit/src/src/lj_tab.h\",\n\"external/lua/luajit/src/src/lj_target.h\",\n\"external/lua/luajit/src/src/lj_target_arm.h\",\n\"external/lua/luajit/src/src/lj_target_mips.h\",\n\"external/lua/luajit/src/src/lj_target_ppc.h\",\n\"external/lua/luajit/src/src/lj_target_x86.h\",\n\"external/lua/luajit/src/src/lj_trace.c\",\n\"external/lua/luajit/src/src/lj_trace.h\",\n\"external/lua/luajit/src/src/lj_traceerr.h\",\n\"external/lua/luajit/src/src/lj_udata.c\",\n\"external/lua/luajit/src/src/lj_udata.h\",\n\"external/lua/luajit/src/src/lj_vm.h\",\n\"external/lua/luajit/src/src/lj_vmevent.c\",\n\"external/lua/luajit/src/src/lj_vmevent.h\",\n\"external/lua/luajit/src/src/lj_vmmath.c\",\n\"external/lua/luajit/src/src/ljamalg.c\",\n\"external/lua/luajit/src/src/lua.h\",\n\"external/lua/luajit/src/src/lua.hpp\",\n\"external/lua/luajit/src/src/luaconf.h\",\n\"external/lua/luajit/src/src/luajit.c\",\n\"external/lua/luajit/src/src/luajit.h\",\n\"external/lua/luajit/src/src/lualib.h\",\n\"external/lua/luajit/src/src/Makefile\",\n\"external/lua/luajit/src/src/Makefile.dep\",\n\"external/lua/luajit/src/src/msvcbuild.bat\",\n\"external/lua/luajit/src/src/vm_arm.dasc\",\n\"external/lua/luajit/src/src/vm_mips.dasc\",\n\"external/lua/luajit/src/src/vm_ppc.dasc\",\n\"external/lua/luajit/src/src/vm_ppcspe.dasc\",\n\"external/lua/luajit/src/src/vm_x86.dasc\",\n\"external/lua/luajit/src/src/xedkbuild.bat\",\n\"external/lua/luajit/src/v2.0.1_hotfix1.patch\",\n\"external/lua/tolua/CMakeLists.txt\",\n\"external/lua/tolua/tolua++.h\",\n\"external/lua/tolua/tolua_event.c\",\n\"external/lua/tolua/tolua_event.h\",\n\"external/lua/tolua/tolua_is.c\",\n\"external/lua/tolua/tolua_map.c\",\n\"external/lua/tolua/tolua_push.c\",\n\"external/lua/tolua/tolua_to.c\",\n\"external/png/include/android/png.h\",\n\"external/png/include/android/pngconf.h\",\n\"external/png/include/android/pnglibconf.h\",\n\"external/png/include/ios/png.h\",\n\"external/png/include/ios/pngconf.h\",\n\"external/png/include/ios/pnglibconf.h\",\n\"external/png/include/mac/png.h\",\n\"external/png/include/mac/pngconf.h\",\n\"external/png/include/mac/pnglibconf.h\",\n\"external/png/include/win32/png.h\",\n\"external/png/include/win32/pngconf.h\",\n\"external/png/include/win32/pnglibconf.h\",\n\"external/png/prebuilt/android/Android.mk\",\n\"external/png/prebuilt/android/armeabi/libpng.a\",\n\"external/png/prebuilt/android/armeabi-v7a/libpng.a\",\n\"external/png/prebuilt/android/x86/libpng.a\",\n\"external/png/prebuilt/ios/libpng.a\",\n\"external/png/prebuilt/mac/libpng.a\",\n\"external/png/prebuilt/win32/libpng.lib\",\n\"external/spidermonkey/include/android/js/Anchor.h\",\n\"external/spidermonkey/include/android/js/CallArgs.h\",\n\"external/spidermonkey/include/android/js/CharacterEncoding.h\",\n\"external/spidermonkey/include/android/js/Date.h\",\n\"external/spidermonkey/include/android/js/GCAPI.h\",\n\"external/spidermonkey/include/android/js/HashTable.h\",\n\"external/spidermonkey/include/android/js/HeapAPI.h\",\n\"external/spidermonkey/include/android/js/LegacyIntTypes.h\",\n\"external/spidermonkey/include/android/js/MemoryMetrics.h\",\n\"external/spidermonkey/include/android/js/PropertyKey.h\",\n\"external/spidermonkey/include/android/js/RequiredDefines.h\",\n\"external/spidermonkey/include/android/js/RootingAPI.h\",\n\"external/spidermonkey/include/android/js/Utility.h\",\n\"external/spidermonkey/include/android/js/Value.h\",\n\"external/spidermonkey/include/android/js/Vector.h\",\n\"external/spidermonkey/include/android/js-config.h\",\n\"external/spidermonkey/include/android/js.msg\",\n\"external/spidermonkey/include/android/jsalloc.h\",\n\"external/spidermonkey/include/android/jsapi.h\",\n\"external/spidermonkey/include/android/jsclass.h\",\n\"external/spidermonkey/include/android/jsclist.h\",\n\"external/spidermonkey/include/android/jscpucfg.h\",\n\"external/spidermonkey/include/android/jsdbgapi.h\",\n\"external/spidermonkey/include/android/jsfriendapi.h\",\n\"external/spidermonkey/include/android/jslock.h\",\n\"external/spidermonkey/include/android/jsperf.h\",\n\"external/spidermonkey/include/android/jsprf.h\",\n\"external/spidermonkey/include/android/jsprototypes.h\",\n\"external/spidermonkey/include/android/jsproxy.h\",\n\"external/spidermonkey/include/android/jsprvtd.h\",\n\"external/spidermonkey/include/android/jspubtd.h\",\n\"external/spidermonkey/include/android/jstypes.h\",\n\"external/spidermonkey/include/android/jsutil.h\",\n\"external/spidermonkey/include/android/jsversion.h\",\n\"external/spidermonkey/include/android/jswrapper.h\",\n\"external/spidermonkey/include/android/mozilla/AllocPolicy.h\",\n\"external/spidermonkey/include/android/mozilla/Array.h\",\n\"external/spidermonkey/include/android/mozilla/Assertions.h\",\n\"external/spidermonkey/include/android/mozilla/Atomics.h\",\n\"external/spidermonkey/include/android/mozilla/Attributes.h\",\n\"external/spidermonkey/include/android/mozilla/BloomFilter.h\",\n\"external/spidermonkey/include/android/mozilla/Casting.h\",\n\"external/spidermonkey/include/android/mozilla/Char16.h\",\n\"external/spidermonkey/include/android/mozilla/CheckedInt.h\",\n\"external/spidermonkey/include/android/mozilla/Compiler.h\",\n\"external/spidermonkey/include/android/mozilla/Constants.h\",\n\"external/spidermonkey/include/android/mozilla/DebugOnly.h\",\n\"external/spidermonkey/include/android/mozilla/Decimal.h\",\n\"external/spidermonkey/include/android/mozilla/Endian.h\",\n\"external/spidermonkey/include/android/mozilla/EnumSet.h\",\n\"external/spidermonkey/include/android/mozilla/FloatingPoint.h\",\n\"external/spidermonkey/include/android/mozilla/GuardObjects.h\",\n\"external/spidermonkey/include/android/mozilla/HashFunctions.h\",\n\"external/spidermonkey/include/android/mozilla/Likely.h\",\n\"external/spidermonkey/include/android/mozilla/LinkedList.h\",\n\"external/spidermonkey/include/android/mozilla/MathAlgorithms.h\",\n\"external/spidermonkey/include/android/mozilla/MemoryChecking.h\",\n\"external/spidermonkey/include/android/mozilla/MemoryReporting.h\",\n\"external/spidermonkey/include/android/mozilla/Move.h\",\n\"external/spidermonkey/include/android/mozilla/NullPtr.h\",\n\"external/spidermonkey/include/android/mozilla/PodOperations.h\",\n\"external/spidermonkey/include/android/mozilla/Poison.h\",\n\"external/spidermonkey/include/android/mozilla/Range.h\",\n\"external/spidermonkey/include/android/mozilla/RangedPtr.h\",\n\"external/spidermonkey/include/android/mozilla/ReentrancyGuard.h\",\n\"external/spidermonkey/include/android/mozilla/RefPtr.h\",\n\"external/spidermonkey/include/android/mozilla/Scoped.h\",\n\"external/spidermonkey/include/android/mozilla/SHA1.h\",\n\"external/spidermonkey/include/android/mozilla/SplayTree.h\",\n\"external/spidermonkey/include/android/mozilla/TemplateLib.h\",\n\"external/spidermonkey/include/android/mozilla/ThreadLocal.h\",\n\"external/spidermonkey/include/android/mozilla/TypedEnum.h\",\n\"external/spidermonkey/include/android/mozilla/Types.h\",\n\"external/spidermonkey/include/android/mozilla/TypeTraits.h\",\n\"external/spidermonkey/include/android/mozilla/Util.h\",\n\"external/spidermonkey/include/android/mozilla/Vector.h\",\n\"external/spidermonkey/include/android/mozilla/WeakPtr.h\",\n\"external/spidermonkey/include/ios/js/Anchor.h\",\n\"external/spidermonkey/include/ios/js/CallArgs.h\",\n\"external/spidermonkey/include/ios/js/CharacterEncoding.h\",\n\"external/spidermonkey/include/ios/js/Date.h\",\n\"external/spidermonkey/include/ios/js/GCAPI.h\",\n\"external/spidermonkey/include/ios/js/HashTable.h\",\n\"external/spidermonkey/include/ios/js/HeapAPI.h\",\n\"external/spidermonkey/include/ios/js/LegacyIntTypes.h\",\n\"external/spidermonkey/include/ios/js/MemoryMetrics.h\",\n\"external/spidermonkey/include/ios/js/PropertyKey.h\",\n\"external/spidermonkey/include/ios/js/RequiredDefines.h\",\n\"external/spidermonkey/include/ios/js/RootingAPI.h\",\n\"external/spidermonkey/include/ios/js/Utility.h\",\n\"external/spidermonkey/include/ios/js/Value.h\",\n\"external/spidermonkey/include/ios/js/Vector.h\",\n\"external/spidermonkey/include/ios/js-config.h\",\n\"external/spidermonkey/include/ios/js.msg\",\n\"external/spidermonkey/include/ios/jsalloc.h\",\n\"external/spidermonkey/include/ios/jsapi.h\",\n\"external/spidermonkey/include/ios/jsclass.h\",\n\"external/spidermonkey/include/ios/jsclist.h\",\n\"external/spidermonkey/include/ios/jscpucfg.h\",\n\"external/spidermonkey/include/ios/jsdbgapi.h\",\n\"external/spidermonkey/include/ios/jsfriendapi.h\",\n\"external/spidermonkey/include/ios/jslock.h\",\n\"external/spidermonkey/include/ios/jsperf.h\",\n\"external/spidermonkey/include/ios/jsprf.h\",\n\"external/spidermonkey/include/ios/jsprototypes.h\",\n\"external/spidermonkey/include/ios/jsproxy.h\",\n\"external/spidermonkey/include/ios/jsprvtd.h\",\n\"external/spidermonkey/include/ios/jspubtd.h\",\n\"external/spidermonkey/include/ios/jstypes.h\",\n\"external/spidermonkey/include/ios/jsutil.h\",\n\"external/spidermonkey/include/ios/jsversion.h\",\n\"external/spidermonkey/include/ios/jswrapper.h\",\n\"external/spidermonkey/include/ios/mozilla/AllocPolicy.h\",\n\"external/spidermonkey/include/ios/mozilla/Array.h\",\n\"external/spidermonkey/include/ios/mozilla/Assertions.h\",\n\"external/spidermonkey/include/ios/mozilla/Atomics.h\",\n\"external/spidermonkey/include/ios/mozilla/Attributes.h\",\n\"external/spidermonkey/include/ios/mozilla/BloomFilter.h\",\n\"external/spidermonkey/include/ios/mozilla/Casting.h\",\n\"external/spidermonkey/include/ios/mozilla/Char16.h\",\n\"external/spidermonkey/include/ios/mozilla/CheckedInt.h\",\n\"external/spidermonkey/include/ios/mozilla/Compiler.h\",\n\"external/spidermonkey/include/ios/mozilla/Constants.h\",\n\"external/spidermonkey/include/ios/mozilla/DebugOnly.h\",\n\"external/spidermonkey/include/ios/mozilla/Decimal.h\",\n\"external/spidermonkey/include/ios/mozilla/Endian.h\",\n\"external/spidermonkey/include/ios/mozilla/EnumSet.h\",\n\"external/spidermonkey/include/ios/mozilla/FloatingPoint.h\",\n\"external/spidermonkey/include/ios/mozilla/GuardObjects.h\",\n\"external/spidermonkey/include/ios/mozilla/HashFunctions.h\",\n\"external/spidermonkey/include/ios/mozilla/Likely.h\",\n\"external/spidermonkey/include/ios/mozilla/LinkedList.h\",\n\"external/spidermonkey/include/ios/mozilla/MathAlgorithms.h\",\n\"external/spidermonkey/include/ios/mozilla/MemoryChecking.h\",\n\"external/spidermonkey/include/ios/mozilla/MemoryReporting.h\",\n\"external/spidermonkey/include/ios/mozilla/Move.h\",\n\"external/spidermonkey/include/ios/mozilla/NullPtr.h\",\n\"external/spidermonkey/include/ios/mozilla/PodOperations.h\",\n\"external/spidermonkey/include/ios/mozilla/Poison.h\",\n\"external/spidermonkey/include/ios/mozilla/Range.h\",\n\"external/spidermonkey/include/ios/mozilla/RangedPtr.h\",\n\"external/spidermonkey/include/ios/mozilla/ReentrancyGuard.h\",\n\"external/spidermonkey/include/ios/mozilla/RefPtr.h\",\n\"external/spidermonkey/include/ios/mozilla/Scoped.h\",\n\"external/spidermonkey/include/ios/mozilla/SHA1.h\",\n\"external/spidermonkey/include/ios/mozilla/SplayTree.h\",\n\"external/spidermonkey/include/ios/mozilla/TemplateLib.h\",\n\"external/spidermonkey/include/ios/mozilla/ThreadLocal.h\",\n\"external/spidermonkey/include/ios/mozilla/TypedEnum.h\",\n\"external/spidermonkey/include/ios/mozilla/Types.h\",\n\"external/spidermonkey/include/ios/mozilla/TypeTraits.h\",\n\"external/spidermonkey/include/ios/mozilla/Util.h\",\n\"external/spidermonkey/include/ios/mozilla/Vector.h\",\n\"external/spidermonkey/include/ios/mozilla/WeakPtr.h\",\n\"external/spidermonkey/include/mac/js/Anchor.h\",\n\"external/spidermonkey/include/mac/js/CallArgs.h\",\n\"external/spidermonkey/include/mac/js/CharacterEncoding.h\",\n\"external/spidermonkey/include/mac/js/Date.h\",\n\"external/spidermonkey/include/mac/js/GCAPI.h\",\n\"external/spidermonkey/include/mac/js/HashTable.h\",\n\"external/spidermonkey/include/mac/js/HeapAPI.h\",\n\"external/spidermonkey/include/mac/js/LegacyIntTypes.h\",\n\"external/spidermonkey/include/mac/js/MemoryMetrics.h\",\n\"external/spidermonkey/include/mac/js/PropertyKey.h\",\n\"external/spidermonkey/include/mac/js/RequiredDefines.h\",\n\"external/spidermonkey/include/mac/js/RootingAPI.h\",\n\"external/spidermonkey/include/mac/js/Utility.h\",\n\"external/spidermonkey/include/mac/js/Value.h\",\n\"external/spidermonkey/include/mac/js/Vector.h\",\n\"external/spidermonkey/include/mac/js-config.h\",\n\"external/spidermonkey/include/mac/js.msg\",\n\"external/spidermonkey/include/mac/jsalloc.h\",\n\"external/spidermonkey/include/mac/jsapi.h\",\n\"external/spidermonkey/include/mac/jsclass.h\",\n\"external/spidermonkey/include/mac/jsclist.h\",\n\"external/spidermonkey/include/mac/jscpucfg.h\",\n\"external/spidermonkey/include/mac/jsdbgapi.h\",\n\"external/spidermonkey/include/mac/jsfriendapi.h\",\n\"external/spidermonkey/include/mac/jslock.h\",\n\"external/spidermonkey/include/mac/jsperf.h\",\n\"external/spidermonkey/include/mac/jsprf.h\",\n\"external/spidermonkey/include/mac/jsprototypes.h\",\n\"external/spidermonkey/include/mac/jsproxy.h\",\n\"external/spidermonkey/include/mac/jsprvtd.h\",\n\"external/spidermonkey/include/mac/jspubtd.h\",\n\"external/spidermonkey/include/mac/jstypes.h\",\n\"external/spidermonkey/include/mac/jsutil.h\",\n\"external/spidermonkey/include/mac/jsversion.h\",\n\"external/spidermonkey/include/mac/jswrapper.h\",\n\"external/spidermonkey/include/mac/mozilla/AllocPolicy.h\",\n\"external/spidermonkey/include/mac/mozilla/Array.h\",\n\"external/spidermonkey/include/mac/mozilla/Assertions.h\",\n\"external/spidermonkey/include/mac/mozilla/Atomics.h\",\n\"external/spidermonkey/include/mac/mozilla/Attributes.h\",\n\"external/spidermonkey/include/mac/mozilla/BloomFilter.h\",\n\"external/spidermonkey/include/mac/mozilla/Casting.h\",\n\"external/spidermonkey/include/mac/mozilla/Char16.h\",\n\"external/spidermonkey/include/mac/mozilla/CheckedInt.h\",\n\"external/spidermonkey/include/mac/mozilla/Compiler.h\",\n\"external/spidermonkey/include/mac/mozilla/Constants.h\",\n\"external/spidermonkey/include/mac/mozilla/DebugOnly.h\",\n\"external/spidermonkey/include/mac/mozilla/Decimal.h\",\n\"external/spidermonkey/include/mac/mozilla/Endian.h\",\n\"external/spidermonkey/include/mac/mozilla/EnumSet.h\",\n\"external/spidermonkey/include/mac/mozilla/FloatingPoint.h\",\n\"external/spidermonkey/include/mac/mozilla/GuardObjects.h\",\n\"external/spidermonkey/include/mac/mozilla/HashFunctions.h\",\n\"external/spidermonkey/include/mac/mozilla/Likely.h\",\n\"external/spidermonkey/include/mac/mozilla/LinkedList.h\",\n\"external/spidermonkey/include/mac/mozilla/MathAlgorithms.h\",\n\"external/spidermonkey/include/mac/mozilla/MemoryChecking.h\",\n\"external/spidermonkey/include/mac/mozilla/MemoryReporting.h\",\n\"external/spidermonkey/include/mac/mozilla/Move.h\",\n\"external/spidermonkey/include/mac/mozilla/NullPtr.h\",\n\"external/spidermonkey/include/mac/mozilla/PodOperations.h\",\n\"external/spidermonkey/include/mac/mozilla/Poison.h\",\n\"external/spidermonkey/include/mac/mozilla/Range.h\",\n\"external/spidermonkey/include/mac/mozilla/RangedPtr.h\",\n\"external/spidermonkey/include/mac/mozilla/ReentrancyGuard.h\",\n\"external/spidermonkey/include/mac/mozilla/RefPtr.h\",\n\"external/spidermonkey/include/mac/mozilla/Scoped.h\",\n\"external/spidermonkey/include/mac/mozilla/SHA1.h\",\n\"external/spidermonkey/include/mac/mozilla/SplayTree.h\",\n\"external/spidermonkey/include/mac/mozilla/TemplateLib.h\",\n\"external/spidermonkey/include/mac/mozilla/ThreadLocal.h\",\n\"external/spidermonkey/include/mac/mozilla/TypedEnum.h\",\n\"external/spidermonkey/include/mac/mozilla/Types.h\",\n\"external/spidermonkey/include/mac/mozilla/TypeTraits.h\",\n\"external/spidermonkey/include/mac/mozilla/Util.h\",\n\"external/spidermonkey/include/mac/mozilla/Vector.h\",\n\"external/spidermonkey/include/mac/mozilla/WeakPtr.h\",\n\"external/spidermonkey/include/win32/js/Anchor.h\",\n\"external/spidermonkey/include/win32/js/CallArgs.h\",\n\"external/spidermonkey/include/win32/js/CharacterEncoding.h\",\n\"external/spidermonkey/include/win32/js/Date.h\",\n\"external/spidermonkey/include/win32/js/GCAPI.h\",\n\"external/spidermonkey/include/win32/js/HashTable.h\",\n\"external/spidermonkey/include/win32/js/HeapAPI.h\",\n\"external/spidermonkey/include/win32/js/LegacyIntTypes.h\",\n\"external/spidermonkey/include/win32/js/MemoryMetrics.h\",\n\"external/spidermonkey/include/win32/js/PropertyKey.h\",\n\"external/spidermonkey/include/win32/js/RequiredDefines.h\",\n\"external/spidermonkey/include/win32/js/RootingAPI.h\",\n\"external/spidermonkey/include/win32/js/Utility.h\",\n\"external/spidermonkey/include/win32/js/Value.h\",\n\"external/spidermonkey/include/win32/js/Vector.h\",\n\"external/spidermonkey/include/win32/js-config.h\",\n\"external/spidermonkey/include/win32/js.msg\",\n\"external/spidermonkey/include/win32/jsalloc.h\",\n\"external/spidermonkey/include/win32/jsapi.h\",\n\"external/spidermonkey/include/win32/jsclass.h\",\n\"external/spidermonkey/include/win32/jsclist.h\",\n\"external/spidermonkey/include/win32/jscpucfg.h\",\n\"external/spidermonkey/include/win32/jsdbgapi.h\",\n\"external/spidermonkey/include/win32/jsfriendapi.h\",\n\"external/spidermonkey/include/win32/jslock.h\",\n\"external/spidermonkey/include/win32/jsperf.h\",\n\"external/spidermonkey/include/win32/jsprf.h\",\n\"external/spidermonkey/include/win32/jsprototypes.h\",\n\"external/spidermonkey/include/win32/jsproxy.h\",\n\"external/spidermonkey/include/win32/jsprvtd.h\",\n\"external/spidermonkey/include/win32/jspubtd.h\",\n\"external/spidermonkey/include/win32/jstypes.h\",\n\"external/spidermonkey/include/win32/jsutil.h\",\n\"external/spidermonkey/include/win32/jsversion.h\",\n\"external/spidermonkey/include/win32/jswrapper.h\",\n\"external/spidermonkey/include/win32/mozilla/AllocPolicy.h\",\n\"external/spidermonkey/include/win32/mozilla/Array.h\",\n\"external/spidermonkey/include/win32/mozilla/Assertions.h\",\n\"external/spidermonkey/include/win32/mozilla/Atomics.h\",\n\"external/spidermonkey/include/win32/mozilla/Attributes.h\",\n\"external/spidermonkey/include/win32/mozilla/BloomFilter.h\",\n\"external/spidermonkey/include/win32/mozilla/Casting.h\",\n\"external/spidermonkey/include/win32/mozilla/Char16.h\",\n\"external/spidermonkey/include/win32/mozilla/CheckedInt.h\",\n\"external/spidermonkey/include/win32/mozilla/Compiler.h\",\n\"external/spidermonkey/include/win32/mozilla/Constants.h\",\n\"external/spidermonkey/include/win32/mozilla/DebugOnly.h\",\n\"external/spidermonkey/include/win32/mozilla/Decimal.h\",\n\"external/spidermonkey/include/win32/mozilla/Endian.h\",\n\"external/spidermonkey/include/win32/mozilla/EnumSet.h\",\n\"external/spidermonkey/include/win32/mozilla/FloatingPoint.h\",\n\"external/spidermonkey/include/win32/mozilla/GuardObjects.h\",\n\"external/spidermonkey/include/win32/mozilla/HashFunctions.h\",\n\"external/spidermonkey/include/win32/mozilla/Likely.h\",\n\"external/spidermonkey/include/win32/mozilla/LinkedList.h\",\n\"external/spidermonkey/include/win32/mozilla/MathAlgorithms.h\",\n\"external/spidermonkey/include/win32/mozilla/MemoryChecking.h\",\n\"external/spidermonkey/include/win32/mozilla/MemoryReporting.h\",\n\"external/spidermonkey/include/win32/mozilla/Move.h\",\n\"external/spidermonkey/include/win32/mozilla/NullPtr.h\",\n\"external/spidermonkey/include/win32/mozilla/PodOperations.h\",\n\"external/spidermonkey/include/win32/mozilla/Poison.h\",\n\"external/spidermonkey/include/win32/mozilla/Range.h\",\n\"external/spidermonkey/include/win32/mozilla/RangedPtr.h\",\n\"external/spidermonkey/include/win32/mozilla/ReentrancyGuard.h\",\n\"external/spidermonkey/include/win32/mozilla/RefPtr.h\",\n\"external/spidermonkey/include/win32/mozilla/Scoped.h\",\n\"external/spidermonkey/include/win32/mozilla/SHA1.h\",\n\"external/spidermonkey/include/win32/mozilla/SplayTree.h\",\n\"external/spidermonkey/include/win32/mozilla/TemplateLib.h\",\n\"external/spidermonkey/include/win32/mozilla/ThreadLocal.h\",\n\"external/spidermonkey/include/win32/mozilla/TypedEnum.h\",\n\"external/spidermonkey/include/win32/mozilla/Types.h\",\n\"external/spidermonkey/include/win32/mozilla/TypeTraits.h\",\n\"external/spidermonkey/include/win32/mozilla/Util.h\",\n\"external/spidermonkey/include/win32/mozilla/Vector.h\",\n\"external/spidermonkey/include/win32/mozilla/WeakPtr.h\",\n\"external/spidermonkey/prebuilt/android/Android.mk\",\n\"external/spidermonkey/prebuilt/android/armeabi/libjs_static.a\",\n\"external/spidermonkey/prebuilt/android/armeabi-v7a/libjs_static.a\",\n\"external/spidermonkey/prebuilt/android/x86/libjs_static.a\",\n\"external/spidermonkey/prebuilt/ios/libjs_static.a\",\n\"external/spidermonkey/prebuilt/mac/libjs_static.a\",\n\"external/spidermonkey/prebuilt/win32/mozjs-25.0.dll\",\n\"external/spidermonkey/prebuilt/win32/mozjs-25.0.lib\",\n\"external/sqlite3/Android.mk\",\n\"external/sqlite3/include/sqlite3.h\",\n\"external/sqlite3/include/sqlite3ext.h\",\n\"external/sqlite3/libraries/win32/sqlite3.dll\",\n\"external/sqlite3/libraries/win32/sqlite3.lib\",\n\"external/tiff/include/android/tiff.h\",\n\"external/tiff/include/android/tiffconf.h\",\n\"external/tiff/include/android/tiffio.h\",\n\"external/tiff/include/android/tiffvers.h\",\n\"external/tiff/include/ios/tiff.h\",\n\"external/tiff/include/ios/tiffconf.h\",\n\"external/tiff/include/ios/tiffio.h\",\n\"external/tiff/include/ios/tiffvers.h\",\n\"external/tiff/include/linux/tiff.h\",\n\"external/tiff/include/linux/tiffconf.h\",\n\"external/tiff/include/linux/tiffio.h\",\n\"external/tiff/include/linux/tiffvers.h\",\n\"external/tiff/include/mac/tiff.h\",\n\"external/tiff/include/mac/tiffconf.h\",\n\"external/tiff/include/mac/tiffio.h\",\n\"external/tiff/include/mac/tiffvers.h\",\n\"external/tiff/include/win32/tiff.h\",\n\"external/tiff/include/win32/tiffconf.h\",\n\"external/tiff/include/win32/tiffio.h\",\n\"external/tiff/include/win32/tiffvers.h\",\n\"external/tiff/prebuilt/android/Android.mk\",\n\"external/tiff/prebuilt/android/armeabi/libtiff.a\",\n\"external/tiff/prebuilt/android/armeabi-v7a/libtiff.a\",\n\"external/tiff/prebuilt/android/x86/libtiff.a\",\n\"external/tiff/prebuilt/ios/libtiff.a\",\n\"external/tiff/prebuilt/linux/32-bit/libtiff.a\",\n\"external/tiff/prebuilt/linux/64-bit/libtiff.a\",\n\"external/tiff/prebuilt/mac/libtiff.a\",\n\"external/tiff/prebuilt/win32/libtiff.dll\",\n\"external/tiff/prebuilt/win32/libtiff.lib\",\n\"external/tinyxml2/CMakeLists.txt\",\n\"external/tinyxml2/tinyxml2.cpp\",\n\"external/tinyxml2/tinyxml2.h\",\n\"external/unzip/CMakeLists.txt\",\n\"external/unzip/ioapi.cpp\",\n\"external/unzip/ioapi.h\",\n\"external/unzip/unzip.cpp\",\n\"external/unzip/unzip.h\",\n\"external/webp/include/android/decode.h\",\n\"external/webp/include/android/encode.h\",\n\"external/webp/include/android/types.h\",\n\"external/webp/include/ios/decode.h\",\n\"external/webp/include/ios/encode.h\",\n\"external/webp/include/ios/types.h\",\n\"external/webp/include/linux/decode.h\",\n\"external/webp/include/linux/encode.h\",\n\"external/webp/include/linux/types.h\",\n\"external/webp/include/mac/decode.h\",\n\"external/webp/include/mac/encode.h\",\n\"external/webp/include/mac/types.h\",\n\"external/webp/include/win32/decode.h\",\n\"external/webp/include/win32/encode.h\",\n\"external/webp/include/win32/types.h\",\n\"external/webp/prebuilt/android/Android.mk\",\n\"external/webp/prebuilt/android/armeabi/libwebp.a\",\n\"external/webp/prebuilt/android/armeabi-v7a/libwebp.a\",\n\"external/webp/prebuilt/android/x86/libwebp.a\",\n\"external/webp/prebuilt/ios/libwebp.a\",\n\"external/webp/prebuilt/linux/32-bit/libwebp.a\",\n\"external/webp/prebuilt/linux/64-bit/libwebp.a\",\n\"external/webp/prebuilt/mac/libwebp.a\",\n\"external/webp/prebuilt/win32/libwebp.lib\",\n\"external/websockets/include/android/libwebsockets.h\",\n\"external/websockets/include/ios/libwebsockets.h\",\n\"external/websockets/include/mac/libwebsockets.h\",\n\"external/websockets/include/win32/libwebsockets.h\",\n\"external/websockets/include/win32/win32helpers/gettimeofday.h\",\n\"external/websockets/include/win32/win32helpers/websock-w32.h\",\n\"external/websockets/prebuilt/android/Android.mk\",\n\"external/websockets/prebuilt/android/armeabi/libwebsockets.a\",\n\"external/websockets/prebuilt/android/armeabi-v7a/libwebsockets.a\",\n\"external/websockets/prebuilt/android/x86/libwebsockets.a\",\n\"external/websockets/prebuilt/ios/libwebsockets.a\",\n\"external/websockets/prebuilt/mac/libwebsockets.a\",\n\"external/websockets/prebuilt/win32/websockets.dll\",\n\"external/websockets/prebuilt/win32/websockets.lib\",\n\"external/win32-specific/gles/include/OGLES/GL/glew.h\",\n\"external/win32-specific/gles/include/OGLES/GL/glxew.h\",\n\"external/win32-specific/gles/include/OGLES/GL/wglew.h\",\n\"external/win32-specific/gles/prebuilt/glew32.dll\",\n\"external/win32-specific/gles/prebuilt/glew32.lib\",\n\"external/win32-specific/icon/include/iconv.h\",\n\"external/win32-specific/icon/prebuilt/iconv.dll\",\n\"external/win32-specific/icon/prebuilt/libiconv.lib\",\n\"external/win32-specific/zlib/include/zconf.h\",\n\"external/win32-specific/zlib/include/zlib.h\",\n\"external/win32-specific/zlib/prebuilt/libzlib.lib\",\n\"external/win32-specific/zlib/prebuilt/zlib1.dll\",\n\"licenses/LICENSE_artwork.txt\",\n\"licenses/LICENSE_box2d.txt\",\n\"licenses/LICENSE_CCBReader.txt\",\n\"licenses/LICENSE_CCControlExtension.txt\",\n\"licenses/LICENSE_chipmunk.txt\",\n\"licenses/LICENSE_cocos2d-iphone.txt\",\n\"licenses/LICENSE_cocos2d-x.txt\",\n\"licenses/LICENSE_cocosdenshion.txt\",\n\"licenses/LICENSE_curl.txt\",\n\"licenses/LICENSE_js.txt\",\n\"licenses/LICENSE_JSON4Lua.txt\",\n\"licenses/LICENSE_jsoncpp.txt\",\n\"licenses/LICENSE_Kazmath.txt\",\n\"licenses/LICENSE_libjpeg.txt\",\n\"licenses/LICENSE_libpng.txt\",\n\"licenses/LICENSE_libtiff.txt\",\n\"licenses/LICENSE_libwebsockets.txt\",\n\"licenses/LICENSE_libxml2.txt\",\n\"licenses/LICENSE_lua.txt\",\n\"licenses/LICENSE_ogg_vorbis.txt\",\n\"licenses/LICENSE_SpiderMonkey.txt\",\n\"licenses/LICENSE_tolua++.txt\",\n\"licenses/LICENSE_zlib.txt\",\n\"plugin/.gitignore\",\n\"plugin/jsbindings/auto/jsb_pluginx_protocols_auto.cpp\",\n\"plugin/jsbindings/auto/jsb_pluginx_protocols_auto.hpp\",\n\"plugin/jsbindings/auto/jsb_pluginx_protocols_auto_api.js\",\n\"plugin/jsbindings/js/jsb_pluginx.js\",\n\"plugin/jsbindings/manual/jsb_pluginx_basic_conversions.cpp\",\n\"plugin/jsbindings/manual/jsb_pluginx_basic_conversions.h\",\n\"plugin/jsbindings/manual/jsb_pluginx_extension_registration.cpp\",\n\"plugin/jsbindings/manual/jsb_pluginx_extension_registration.h\",\n\"plugin/jsbindings/manual/jsb_pluginx_manual_callback.cpp\",\n\"plugin/jsbindings/manual/jsb_pluginx_manual_callback.h\",\n\"plugin/jsbindings/manual/jsb_pluginx_manual_protocols.cpp\",\n\"plugin/jsbindings/manual/jsb_pluginx_manual_protocols.h\",\n\"plugin/jsbindings/manual/jsb_pluginx_spidermonkey_specifics.cpp\",\n\"plugin/jsbindings/manual/jsb_pluginx_spidermonkey_specifics.h\",\n\"plugin/jsbindings/manual/pluginxUTF8.cpp\",\n\"plugin/jsbindings/manual/pluginxUTF8.h\",\n\"plugin/jsbindings/manual/uthash.h\",\n\"plugin/plugins/admob/proj.android/.classpath\",\n\"plugin/plugins/admob/proj.android/.project\",\n\"plugin/plugins/admob/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/admob/proj.android/build.xml\",\n\"plugin/plugins/admob/proj.android/ForManifest.xml\",\n\"plugin/plugins/admob/proj.android/project.properties\",\n\"plugin/plugins/admob/proj.android/res/.gitignore\",\n\"plugin/plugins/admob/proj.android/sdk/GoogleAdMobAdsSdk.jar\",\n\"plugin/plugins/admob/proj.android/src/org/cocos2dx/plugin/AdsAdmob.java\",\n\"plugin/plugins/admob/proj.ios/Admob/GADAdMobExtras.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADAdNetworkExtras.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADAdSize.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADBannerView.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADBannerViewDelegate.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADInterstitial.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADInterstitialDelegate.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADRequest.h\",\n\"plugin/plugins/admob/proj.ios/Admob/GADRequestError.h\",\n\"plugin/plugins/admob/proj.ios/Admob/libGoogleAdMobAds.a\",\n\"plugin/plugins/admob/proj.ios/AdsAdmob.h\",\n\"plugin/plugins/admob/proj.ios/AdsAdmob.m\",\n\"plugin/plugins/admob/proj.ios/PluginAdmob-Prefix.pch\",\n\"plugin/plugins/admob/proj.ios/PluginAdmob.xcodeproj/project.pbxproj\",\n\"plugin/plugins/alipay/proj.android/.classpath\",\n\"plugin/plugins/alipay/proj.android/.project\",\n\"plugin/plugins/alipay/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/alipay/proj.android/build.xml\",\n\"plugin/plugins/alipay/proj.android/ForAssets/alipay_plugin.apk\",\n\"plugin/plugins/alipay/proj.android/ForManifest.xml\",\n\"plugin/plugins/alipay/proj.android/project.properties\",\n\"plugin/plugins/alipay/proj.android/res/.gitignore\",\n\"plugin/plugins/alipay/proj.android/sdk/alipay_plugin.jar\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/AlixId.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/Base64.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/BaseHelper.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/IAPAlipay.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/MobileSecurePayer.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/MobileSecurePayHelper.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/NetworkManager.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/PartnerConfig.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/ResultChecker.java\",\n\"plugin/plugins/alipay/proj.android/src/org/cocos2dx/plugin/Rsa.java\",\n\"plugin/plugins/flurry/proj.android/.classpath\",\n\"plugin/plugins/flurry/proj.android/.project\",\n\"plugin/plugins/flurry/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/flurry/proj.android/build.xml\",\n\"plugin/plugins/flurry/proj.android/ForManifest.xml\",\n\"plugin/plugins/flurry/proj.android/project.properties\",\n\"plugin/plugins/flurry/proj.android/res/.gitignore\",\n\"plugin/plugins/flurry/proj.android/sdk/FlurryAgent.jar\",\n\"plugin/plugins/flurry/proj.android/src/org/cocos2dx/plugin/AdsFlurry.java\",\n\"plugin/plugins/flurry/proj.android/src/org/cocos2dx/plugin/AnalyticsFlurry.java\",\n\"plugin/plugins/flurry/proj.ios/AdsFlurry.h\",\n\"plugin/plugins/flurry/proj.ios/AdsFlurry.m\",\n\"plugin/plugins/flurry/proj.ios/AnalyticsFlurry.h\",\n\"plugin/plugins/flurry/proj.ios/AnalyticsFlurry.m\",\n\"plugin/plugins/flurry/proj.ios/Flurry.h\",\n\"plugin/plugins/flurry/proj.ios/FlurryAds/FlurryAdDelegate.h\",\n\"plugin/plugins/flurry/proj.ios/FlurryAds/FlurryAds.h\",\n\"plugin/plugins/flurry/proj.ios/FlurryAds/libFlurryAds.a\",\n\"plugin/plugins/flurry/proj.ios/libFlurry.a\",\n\"plugin/plugins/flurry/proj.ios/PluginFlurry-Prefix.pch\",\n\"plugin/plugins/flurry/proj.ios/PluginFlurry.xcodeproj/project.pbxproj\",\n\"plugin/plugins/nd91/proj.android/.classpath\",\n\"plugin/plugins/nd91/proj.android/.project\",\n\"plugin/plugins/nd91/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/nd91/proj.android/build.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/.classpath\",\n\"plugin/plugins/nd91/proj.android/DependProject/.project\",\n\"plugin/plugins/nd91/proj.android/DependProject/AndroidManifest.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/project.properties\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipin.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipin_reverse.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipout.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/anim/nd_flipout_reverse.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_3rd_platform_icon.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_3rd_platform_icon_more.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_91.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_achieve.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_achievement_lock.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_activity_action_above_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_add.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_agreement_logo.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_app_icon_default.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_background.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_background_xml.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_banner.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_banner_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_banner_logo.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bbs_icon.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bizarre_image.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bk1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bm.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bnt_01.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bnt_zhuxiao.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_bottom_bar_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_02.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_130_01.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_130_03.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_278.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_action.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_bg_02.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_bg_02_press.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_bg_dis.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_bg_dis02.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_logout.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_long.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_long_press.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_old.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_radio.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_x.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_button_x1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_check_yes.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_checkbox_button.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_close.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_default_portrait.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_default_portrait_big.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_friend_del_button.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_friend_section_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_game_detail.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_game_error_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_game_face.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_game_head.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_head_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_headbar.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_horizontal_line.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon11.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon12.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_01.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_05.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_06.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_07.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_08.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_21.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_22.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_error.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_more01.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_more02.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_more03.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_more04.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_more05.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_more06.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_point.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_icon_selected.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_image81.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_image82.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_image_48_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_input_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_input_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_input_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_input_gray.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_inputbox_bg1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_invite_image.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_leaderboard_default.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_line.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_list_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_list_separator.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainfriend_1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainfriend_2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_maingame_1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_maingame_2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainmessage_1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainmessage_2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainmore_1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainmore_2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainpage_1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mainpage_2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_message_item_1_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_message_item_2_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_mood_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_msge_friend.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_msge_owen.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_new_message.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_new_message_flag.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_pay_checkbox_button.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_platform_logo.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_portrait_edit_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_progress_large.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_3.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_left_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_left_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_left_btn_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_middle_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_middle_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_middle_btn_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_right_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_right_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_choice_right_btn_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_rank_image.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_redbtn.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_redbtn_down.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_regist_checked.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_round_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_search_edit_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_search_edit_left.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_search_layout_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_showplayer.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_square_checkbox_button.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_switch_image.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_switch_image_white.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_action_btn.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_action_btn_pressed.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_action_btn_xml.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_return_btn.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_return_btn_pressed.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_title_bar_return_btn_xml.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_user_item_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_vertical_line.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd3_white_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_ad.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_blue.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_blue1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_blue2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_book.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_btn_add.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_btn_add_press.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_btn_buy.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_btn_buy_press.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_btn_reduce.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_btn_reduce_press.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_button_action_add.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_button_action_buy.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_button_action_reduce.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_c_blur.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_c_blur1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_c_blur2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_change_account.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_direct_login.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_direct_logo.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_download.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_gamecoin.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_gcsdk_bezel_border.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_gcsdk_bezel_mask.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_goods_count_input_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_goods_default.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_goods_detail_default.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_goods_limit_stock.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_goods_limit_time.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_goods_no_stock.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_goods_price_down.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_green.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_green1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_green2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_input.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_left_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_left_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_left_btn_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_right_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_right_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_leaderboard_right_btn_bg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_list_btn_delete_normal.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_list_btn_delete_pressed.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_list_btn_delete_selector.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_land_selector.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_normal_land.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_normal_portrait.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_portrait_selector.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_pressed_land.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_login_btn_pressed_portrait.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_logo48.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_ordinary.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_register_btn_normal_portrait.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_register_btn_portrait_selector.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_register_btn_pressed_portrait.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_satisfied.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_service.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_h.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_h_expand.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_v.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_slider_handle_v_expand.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_theme.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_true.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_unsatisfied.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_warn.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_white_btn.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_white_btn_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_white_btn_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_winning.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable/nd_xline.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_download_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_download_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_flip_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_content_h.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_content_v.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_h_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_h_1_expand.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_h_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_h_2_expand.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_v_1.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_v_1_expand.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_v_2.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_handle_v_2_expand.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_next_h.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_next_v.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_pre_h.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-hdpi/nd_slider_pre_v.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_bg_tips.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_box_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_box_btn_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_box_close.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_box_label_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_box_logo.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_box_tit_bg.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_box_title_line.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_exit_txt_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamecenter_default.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gamezone_default.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_gc_logo_default.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_image_default.jpg\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_label_bg.9.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_loading_bg.jpg\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_loading_logo.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_loading_pot_1.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/drawable-xhdpi/nd_gcsdk_loading_pot_2.png\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_bind_bind.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_bind_register.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_email_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_land.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_other_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_login_portrait.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_oauth_bind.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_landscape.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_official_portrait.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_other_login.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register_agreement.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register_phone.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_register_quick.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_secret_find.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_secret_set.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_account_sina.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_achieve_detail.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_action_template.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_1.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_2.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_2_ext.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_3.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_content_reg_template_4.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail_plus_image.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail_plus_list.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_detail_plus_list_ext.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_head_reg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_activity_no_action_template.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_app_feedback.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_app_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_app_property.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_banner_layout.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_blank_listview.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_bottom_bar.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_category_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_category_plus_image_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_control_center.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_dispatch_search_friend.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_empty_listview.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_frame.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_home.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_remark_setting.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_section.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_section_list_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_friend_section_panel.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_game_content.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_game_main.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home_land.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home_personal.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_home_portrait.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_invite_friend.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_invite_friend_choice.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_invite_friend_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_leaderboard_category.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_leaderboard_list_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_footer.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_footer_ext.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_template.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_listview_template_no_divider.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_mesg_main.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_friendmsge_list.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_main.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_receive_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_record_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_send.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_message_send_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_about.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_account.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_bean_recharge.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_consume_detail.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_consumes.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_info.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_info_edit_head_dialog.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_more.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_no_password.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_password.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_permission.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_recharge_detail.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_recharges.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_records.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_more_records_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_myfriend.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_network_error.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_normal_search.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_friend_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_pass.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_password_check.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_products_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_select_friend.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_pay_template.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_person_info_detail.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_personinfo.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_progressbar.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_recharge_record.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_searchfriend_condition.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_share_bind_account_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_share_sina.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_share_unbind_account_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_stranger_home.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_detail_action.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_detail_app.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_detail_no_action.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_sysmessage_head_reg.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_thirdplatform_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_title_bar.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_fangle.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_fangle_ext.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_item_divider.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_message.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_user_message_switcher.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_version_update.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd3_write_message.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_account_list_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_account_manage.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_lottery.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number_result.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number_tip.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_bind_phone_number_unactivity_tip.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_check_version.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_faq_list.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_fb.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_menu_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_my_fb_list.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_landscape.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_pj_portrait.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_bottom.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_left.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_feedback_reply_item_right.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_find_password.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_custom_toast.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_exitpage.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_pausepage.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_1.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_2.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_gcsdk_project_view_type_3.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_goods_detail.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_goods_list.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_goods_list_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard_list_header.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard_switcher_landscape_1.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_leaderboard_switcher_portrait_1.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_login_director.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_set_password.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_flipitem.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_listitem.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_slider_h.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_slider_item.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softpromotion_slider_v.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_softwarepromotion.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/layout/nd_unbind_phone_number.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/raw/nd_res.zip\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_misc.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_sdk_error_strings.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/values/nd3_strings.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_colors.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_misc.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_strings.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/res/values/nd_gcsdk_styles.xml\",\n\"plugin/plugins/nd91/proj.android/DependProject/src/.gitignore\",\n\"plugin/plugins/nd91/proj.android/ForManifest.xml\",\n\"plugin/plugins/nd91/proj.android/project.properties\",\n\"plugin/plugins/nd91/proj.android/res/.gitignore\",\n\"plugin/plugins/nd91/proj.android/sdk/NdComPlatform.jar\",\n\"plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPNd91.java\",\n\"plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/IAPOnlineNd91.java\",\n\"plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/Nd91Wrapper.java\",\n\"plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/SocialNd91.java\",\n\"plugin/plugins/nd91/proj.android/src/org/cocos2dx/plugin/UserNd91.java\",\n\"plugin/plugins/qh360/proj.android/.classpath\",\n\"plugin/plugins/qh360/proj.android/.project\",\n\"plugin/plugins/qh360/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/qh360/proj.android/build.xml\",\n\"plugin/plugins/qh360/proj.android/CLibs/armeabi/libpaypalm_app_plugin_jar_360game.so\",\n\"plugin/plugins/qh360/proj.android/CLibs/mips/libpaypalm_app_plugin_jar_360game.so\",\n\"plugin/plugins/qh360/proj.android/ForAssets/alipay_plugin.apk\",\n\"plugin/plugins/qh360/proj.android/ForAssets/bin_app_plugin.bin\",\n\"plugin/plugins/qh360/proj.android/ForAssets/pro.jar\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/bind_phone_button_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/bind_phone_button_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/bind_phone_other_indicator.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/bind_phone_popup_message_arrow.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/bind_phone_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/box_off.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/box_on.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/button_gray_disable.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/button_gray_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/button_gray_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/check_phone_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/checkphone_resetpwd_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/close_btn_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/close_btn_press.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/del.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dialog_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dot.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dr_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dr_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/drop_down.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dropdown_btn_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dropdown_btn_normal_.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dropdown_btn_press.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/dropdown_btn_press_.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/find_pwd_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/guardianship_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/guardianship_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/account_setting_name_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/arrow_down.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/arrow_up.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_abc.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_bob.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_boc.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_bos.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_ccb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_ceb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_cib.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_cmb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_cmbc.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_default.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_ecitic.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_gdb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_gzcb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_hxb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_icbc.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_pingan.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_psbc.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_sdb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_icon_spdb.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bank_name_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bg_pao_my.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bg_pao_my_h.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bg_pao_you.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bg_pao_you_h.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bind_phone.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/box_off.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/box_on.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/btn_back_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/btn_back_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/btn_post_try_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/btn_post_try_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/btn_post_view_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/btn_post_view_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bubble_bg_h.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/bubble_bg_s.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/can_not_open_page_3g_close.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/can_not_open_page_3g_open.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/can_not_open_page_anzai.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/can_not_open_page_line.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/can_not_open_page_refresh.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/can_not_open_page_wifi_close.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/can_not_open_page_wifi_open.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/close_btn_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/close_btn_press.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/credit_date.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/credit_verify.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/del.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/dialog_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/dr_btn_disable.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/dr_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/dr_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/drop_down.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/dropdown_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/dropdown_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/faq_list_item_bg_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/faq_list_item_bg_select.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/go_bbs_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/go_bbs_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/header_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/icon_info.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/input_bottom_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/input_box_.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/input_img_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/input_img_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/jian.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/known_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/known_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/left_s_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/line.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/list_bg_H.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/list_bg_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/money_line.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_credit_selected_tag.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_credit_unselected_tag.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_card_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_close_d.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_close_p.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_failure.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_input_clean.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_input_clean_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_ok.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_other_pay_d.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_other_pay_p.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_tiket_left.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_tiket_middle.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_tiket_right.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_float_translating.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_quick_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_record_tab_selected.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_user_guide_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_user_guide_btn.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_user_guide_guard.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_user_guide_money.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_user_guide_page.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/pay_user_guide_page_now.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/paybtn_default.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/paybtn_disable.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/paybtn_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/popup_menu_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/popup_menu_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_alert_fail.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_alert_ok.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_fail_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_image_opt_add.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_image_opt_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_image_opt_del.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_img_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_input_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_no_img_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/post_ok_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qib_balance_dot.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qib_refresh_btn_disabled.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qib_refresh_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qib_refresh_btn_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qib_refresh_land_btn_disabled.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qib_refresh_land_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qib_refresh_land_btn_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_btn_red_disabled.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_btn_red_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_btn_red_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_button_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_button_orange_disabled.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_button_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_credit_binder_selected.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_credit_bingder_unselected.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_gray_button_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_gray_button_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_inficon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_info.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_listitem_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_listitem_bg_pressed_v.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_listitem_bg_v.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_loadingmotion.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_pay_dialog_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_pay_success_bindphone_arrow.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_pay_success_bindphone_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_pay_success_bindphone_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_pay_sucess.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_popup_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_popup_title.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_pup_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_textbox.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_xianpei.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/qihoo_zhifu_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/quit_alert_close_btn.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/quit_game_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/quit_game_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/reg_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/reg_title_back.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/reg_title_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/reg_title_btn_back_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/reg_title_btn_back_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/right_s_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/right_s_line.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/right_selected_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/select_money_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/select_money_title.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/seperator_h.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/seperator_v.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_bbs_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_bbs_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_bg_left.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_bg_right.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_bind_phone_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_bind_phone_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_close_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_close_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_hide_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_hide_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_icon_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_icon_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_service_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/settings_service_pressed.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/single_choice_checked.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/single_choice_unchecked.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/suggest_name_list_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/t_new.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tab_bg_v.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tab_left_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tab_left_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tab_right_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tab_right_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tab_zhong_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tab_zhong_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/tip_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/title.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/title_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/toast_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon/vertical_title_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/box_off.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/box_on.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/dr_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/dr_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/input_box_.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/known_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/known_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/post_input_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/icon-mdpi/qihoo_inficon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/input_box_.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/known_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/known_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/line.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/load_success.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_onekey_bg_b.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_onekey_bg_t.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_onekey_button.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_onekey_cellphone.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_onekey_icon_right.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_onekey_separator.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/login_onekey_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/box_off.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/box_on.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/dr_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/dr_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/dropdown_btn_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/dropdown_btn_normal_.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/dropdown_btn_press.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/dropdown_btn_press_.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/guardianship_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/guardianship_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/input_box_.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/known_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/known_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/zc_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/Mdpi/zc_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/no_simcard_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/phone_num_get_failed_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/phone_used_dlg_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_head.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_head_pic1.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_head_pic2.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_head_pic3.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_head_pic4.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_head_pic_default.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_left_button_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_left_button_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_left_button_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_pics.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_right_button_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_right_button_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_right_button_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/profile_title_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/qihoo_loadingmotion.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/qihoo_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/qihoo_pay_dialog_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/qihoo_pup_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_360account_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_success_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_tab_bg_off.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_tab_bg_on_left.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_tab_bg_on_right.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_tip.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_title_back.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_title_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_title_btn_back_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_title_btn_back_normal.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_title_btn_back_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reg_title_btn_back_press.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/register_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/reset_pwd_title.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/select_o.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/switch_btn_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/switch_btn_left.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/switch_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/switch_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/tip_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/title_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/toast_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/wait_bg.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/zc_btn_normal.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/res/zc_btn_press.9.png\",\n\"plugin/plugins/qh360/proj.android/ForAssets/upomp_bypay_config.xml\",\n\"plugin/plugins/qh360/proj.android/ForManifest.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/anim/zsht_loading.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn1.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn2.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn3.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn4.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn5.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn6.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_card.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_enter1.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_enter2.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_esc1.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_esc2.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_letter.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_member1.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_member2.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_month.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_newweb.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_number.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_set.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_symbol.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_title_esc.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_btn_year.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_checkbox.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_input_btn2.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_input_btn4.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_keyboard_btn_clear.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_keyboard_btn_enter.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_keyboard_btn_l_clear.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_open_btn_enter.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_progress.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/upomp_bypay_progress_init.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_authcode_style.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_back.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_back_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_back_style.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_button.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_button_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_button_style.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_get_authcode_button.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_get_authcode_button_enable.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_get_authcode_button_pressed.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_input.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_input_focused.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_input_style.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_keyboard_background.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_keyboard_button.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_keyboard_title.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_line.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_01.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_02.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_03.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_04.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_05.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_06.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_07.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_loading_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_order_message.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_pp_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_success.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_title.9.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable/zsht_title_image.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bank_list_icon1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bank_list_icon2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bank_list_icon3.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bank_list_title1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bank_list_title2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bottom.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bottom_about.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_bottom_line.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_change.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_change_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_enter2_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_enter2_bg_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_enter_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_enter_bg_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_esc2_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_esc2_bg_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_esc_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_btn_esc_bg_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_btn1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_btn2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_btn3.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_icon1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_on_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_on_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_select.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_select1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_select2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_card_select_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_cvn2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_icon_card.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_icon_jiantou.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_icon_pw.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_index_bot_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_bot1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_bot2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_bot3.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_bot4.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn1_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn2_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn3.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn3_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn4.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn4_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn5.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn5_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn6.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_btn6_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_icon1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_icon2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_icon3.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_icon4.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_icon5.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_icon6.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_icon7.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_left.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_right.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_select_1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_select_2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_top1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_top2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_info_top3.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_bg_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_btn_2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_btn_2_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_btn_4.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_btn_4_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_btn_hq.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_btn_hq_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_input_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_btn1_default.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_btn1_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_btn_clear_default.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_btn_clear_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_btn_enter_default.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_btn_enter_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_fh_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_fh_bg_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_input_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_letter_a1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_letter_a2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_letter_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_letter_bg_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_letter_clear_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_letter_clear_bg_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_nav_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_number_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_number_bg_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_keyboard_pw_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_loading_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_loading_bg2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_loading_logo.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_loading_tag.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_login_open_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_main_line.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_member_btn1.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_member_btn1_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_member_btn2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_member_btn2_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_open_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_open_bg2.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_open_btn.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_open_btn_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_open_icon.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_psw_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_select_card_add.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_select_card_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_select_month.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_select_month_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_select_year.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_select_year_on.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_spinner.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_tips_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_title_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_title_btn.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_title_btn_click.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_toast_bg.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/drawable-hdpi/upomp_bypay_view_xy.png\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_about.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_about_btn.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_activity_dialog.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_auth_bind_card.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_credit.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_debit.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_pan.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_bindcard_result.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_cardlist_content.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_get_pass.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_image_cvn2.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_dialog.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_letter.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_num.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_keyboard_symbol.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_cardmanage.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_change_psw.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_change_tel.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_tel.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_onuser_usermanage.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_pay_main.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_pay_result.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_pay_result_lose.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_register.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_register2.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_register_result.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_splash.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_support_card.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_support_card_list.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_user_credit.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_user_debit.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/upomp_bypay_userprotocal.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/zsht_bankcard_agreement.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/zsht_bankcard_pay.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/zsht_griditems.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/zsht_loading_process_dialog_anim.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/zsht_success_page.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/layout/zsht_user_message.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/raw/upomp_bypay_click.ogg\",\n\"plugin/plugins/qh360/proj.android/ForRes/values/upomp_strings.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/values/upomp_styles.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/values/zsht_strings.xml\",\n\"plugin/plugins/qh360/proj.android/ForRes/values/zsht_styles.xml\",\n\"plugin/plugins/qh360/proj.android/project.properties\",\n\"plugin/plugins/qh360/proj.android/res/.gitignore\",\n\"plugin/plugins/qh360/proj.android/sdk/360SDK.jar\",\n\"plugin/plugins/qh360/proj.android/sdk/annotations.jar\",\n\"plugin/plugins/qh360/proj.android/sdk/upomp_bypay_lib.jar\",\n\"plugin/plugins/qh360/proj.android/sdk/zsht_app_360game.jar\",\n\"plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/IAPOnlineQH360.java\",\n\"plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java\",\n\"plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/UserQH360.java\",\n\"plugin/plugins/twitter/proj.android/.classpath\",\n\"plugin/plugins/twitter/proj.android/.project\",\n\"plugin/plugins/twitter/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/twitter/proj.android/build.xml\",\n\"plugin/plugins/twitter/proj.android/ForManifest.xml\",\n\"plugin/plugins/twitter/proj.android/project.properties\",\n\"plugin/plugins/twitter/proj.android/res/.gitignore\",\n\"plugin/plugins/twitter/proj.android/sdk/signpost-commonshttp4-1.2.1.1.jar\",\n\"plugin/plugins/twitter/proj.android/sdk/signpost-core-1.2.1.1.jar\",\n\"plugin/plugins/twitter/proj.android/sdk/signpost-jetty6-1.2.1.1.jar\",\n\"plugin/plugins/twitter/proj.android/sdk/twitter4j-core-android-3.0.1.jar\",\n\"plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/Consts.java\",\n\"plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/ShareTwitter.java\",\n\"plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/TwitterApp.java\",\n\"plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/TwitterDialog.java\",\n\"plugin/plugins/twitter/proj.android/src/org/cocos2dx/plugin/TwitterSession.java\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/FHSTwitterEngine.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/FHSTwitterEngine.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Categories/NSString+URLEncoding.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Categories/NSString+URLEncoding.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Crytpo/Base64TranscoderFHS.c\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/Crytpo/Base64TranscoderFHS.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAConsumer.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAConsumer.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAHMAC_SHA1SignatureProvider.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAHMAC_SHA1SignatureProvider.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAMutableURLRequest.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAMutableURLRequest.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OARequestParameter.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OARequestParameter.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAServiceTicket.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAServiceTicket.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAToken.h\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAToken.m\",\n\"plugin/plugins/twitter/proj.ios/FHSTwitterEngine/OAuthConsumer/OAuthConsumer.h\",\n\"plugin/plugins/twitter/proj.ios/PluginTwitter-Prefix.pch\",\n\"plugin/plugins/twitter/proj.ios/PluginTwitter.xcodeproj/project.pbxproj\",\n\"plugin/plugins/twitter/proj.ios/ShareTwitter.h\",\n\"plugin/plugins/twitter/proj.ios/ShareTwitter.m\",\n\"plugin/plugins/uc/proj.android/.classpath\",\n\"plugin/plugins/uc/proj.android/.project\",\n\"plugin/plugins/uc/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/uc/proj.android/build.xml\",\n\"plugin/plugins/uc/proj.android/ForManifest.xml\",\n\"plugin/plugins/uc/proj.android/project.properties\",\n\"plugin/plugins/uc/proj.android/res/.gitignore\",\n\"plugin/plugins/uc/proj.android/sdk/alipay_plugin.jar\",\n\"plugin/plugins/uc/proj.android/sdk/UCGameSDK.jar\",\n\"plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/IAPOnlineUC.java\",\n\"plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java\",\n\"plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UserUC.java\",\n\"plugin/plugins/umeng/proj.android/.classpath\",\n\"plugin/plugins/umeng/proj.android/.project\",\n\"plugin/plugins/umeng/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/umeng/proj.android/build.xml\",\n\"plugin/plugins/umeng/proj.android/ForManifest.xml\",\n\"plugin/plugins/umeng/proj.android/project.properties\",\n\"plugin/plugins/umeng/proj.android/res/.gitignore\",\n\"plugin/plugins/umeng/proj.android/sdk/umeng_sdk.jar\",\n\"plugin/plugins/umeng/proj.android/src/org/cocos2dx/plugin/AnalyticsUmeng.java\",\n\"plugin/plugins/umeng/proj.ios/AnalyticsUmeng.h\",\n\"plugin/plugins/umeng/proj.ios/AnalyticsUmeng.m\",\n\"plugin/plugins/umeng/proj.ios/libMobClickLibrary.a\",\n\"plugin/plugins/umeng/proj.ios/MobClick.h\",\n\"plugin/plugins/umeng/proj.ios/PluginUmeng-Prefix.pch\",\n\"plugin/plugins/umeng/proj.ios/PluginUmeng.xcodeproj/project.pbxproj\",\n\"plugin/plugins/weibo/proj.android/.classpath\",\n\"plugin/plugins/weibo/proj.android/.project\",\n\"plugin/plugins/weibo/proj.android/AndroidManifest.xml\",\n\"plugin/plugins/weibo/proj.android/build.xml\",\n\"plugin/plugins/weibo/proj.android/ForManifest.xml\",\n\"plugin/plugins/weibo/proj.android/project.properties\",\n\"plugin/plugins/weibo/proj.android/res/.gitignore\",\n\"plugin/plugins/weibo/proj.android/sdk/weibosdk.jar\",\n\"plugin/plugins/weibo/proj.android/src/org/cocos2dx/plugin/AccessTokenKeeper.java\",\n\"plugin/plugins/weibo/proj.android/src/org/cocos2dx/plugin/ShareWeibo.java\",\n\"plugin/plugins/weibo/proj.ios/JSONKit/JSONKit.h\",\n\"plugin/plugins/weibo/proj.ios/JSONKit/JSONKit.m\",\n\"plugin/plugins/weibo/proj.ios/PluginWeibo-Prefix.pch\",\n\"plugin/plugins/weibo/proj.ios/PluginWeibo.xcodeproj/project.pbxproj\",\n\"plugin/plugins/weibo/proj.ios/ShareWeibo.h\",\n\"plugin/plugins/weibo/proj.ios/ShareWeibo.m\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeibo.bundle/images/close.png\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeibo.bundle/images/close@2x.png\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeibo.h\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeibo.m\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboAuthorizeView.h\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboAuthorizeView.m\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboConstants.h\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboRequest.h\",\n\"plugin/plugins/weibo/proj.ios/SinaWeibo/SinaWeiboRequest.m\",\n\"plugin/protocols/include/PluginFactory.h\",\n\"plugin/protocols/include/PluginManager.h\",\n\"plugin/protocols/include/PluginParam.h\",\n\"plugin/protocols/include/PluginProtocol.h\",\n\"plugin/protocols/include/ProtocolAds.h\",\n\"plugin/protocols/include/ProtocolAnalytics.h\",\n\"plugin/protocols/include/ProtocolIAP.h\",\n\"plugin/protocols/include/ProtocolShare.h\",\n\"plugin/protocols/include/ProtocolSocial.h\",\n\"plugin/protocols/include/ProtocolUser.h\",\n\"plugin/protocols/jsb_protocols.ini\",\n\"plugin/protocols/platform/android/PluginFactory.cpp\",\n\"plugin/protocols/platform/android/PluginJavaData.h\",\n\"plugin/protocols/platform/android/PluginJniHelper.cpp\",\n\"plugin/protocols/platform/android/PluginJniHelper.h\",\n\"plugin/protocols/platform/android/PluginJniMacros.h\",\n\"plugin/protocols/platform/android/PluginProtocol.cpp\",\n\"plugin/protocols/platform/android/PluginUtils.cpp\",\n\"plugin/protocols/platform/android/PluginUtils.h\",\n\"plugin/protocols/platform/android/ProtocolAds.cpp\",\n\"plugin/protocols/platform/android/ProtocolAnalytics.cpp\",\n\"plugin/protocols/platform/android/ProtocolIAP.cpp\",\n\"plugin/protocols/platform/android/ProtocolShare.cpp\",\n\"plugin/protocols/platform/android/ProtocolSocial.cpp\",\n\"plugin/protocols/platform/android/ProtocolUser.cpp\",\n\"plugin/protocols/platform/ios/AdsWrapper.h\",\n\"plugin/protocols/platform/ios/AdsWrapper.mm\",\n\"plugin/protocols/platform/ios/InterfaceAds.h\",\n\"plugin/protocols/platform/ios/InterfaceAnalytics.h\",\n\"plugin/protocols/platform/ios/InterfaceIAP.h\",\n\"plugin/protocols/platform/ios/InterfaceShare.h\",\n\"plugin/protocols/platform/ios/InterfaceSocial.h\",\n\"plugin/protocols/platform/ios/InterfaceUser.h\",\n\"plugin/protocols/platform/ios/PluginFactory.mm\",\n\"plugin/protocols/platform/ios/PluginOCMacros.h\",\n\"plugin/protocols/platform/ios/PluginProtocol.mm\",\n\"plugin/protocols/platform/ios/PluginUtilsIOS.h\",\n\"plugin/protocols/platform/ios/PluginUtilsIOS.mm\",\n\"plugin/protocols/platform/ios/ProtocolAds.mm\",\n\"plugin/protocols/platform/ios/ProtocolAnalytics.mm\",\n\"plugin/protocols/platform/ios/ProtocolIAP.mm\",\n\"plugin/protocols/platform/ios/ProtocolShare.mm\",\n\"plugin/protocols/platform/ios/ProtocolSocial.mm\",\n\"plugin/protocols/platform/ios/ProtocolUser.mm\",\n\"plugin/protocols/platform/ios/ShareWrapper.h\",\n\"plugin/protocols/platform/ios/ShareWrapper.mm\",\n\"plugin/protocols/platform/ios/SocialWrapper.h\",\n\"plugin/protocols/platform/ios/SocialWrapper.mm\",\n\"plugin/protocols/platform/ios/UserWrapper.h\",\n\"plugin/protocols/platform/ios/UserWrapper.mm\",\n\"plugin/protocols/PluginManager.cpp\",\n\"plugin/protocols/PluginParam.cpp\",\n\"plugin/protocols/proj.android/.classpath\",\n\"plugin/protocols/proj.android/.project\",\n\"plugin/protocols/proj.android/AndroidManifest.xml\",\n\"plugin/protocols/proj.android/build.xml\",\n\"plugin/protocols/proj.android/build_native.sh\",\n\"plugin/protocols/proj.android/jni/Android.mk\",\n\"plugin/protocols/proj.android/jni/Application.mk\",\n\"plugin/protocols/proj.android/project.properties\",\n\"plugin/protocols/proj.android/res/.gitignore\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/AdsWrapper.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/IAPWrapper.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceAds.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceAnalytics.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceIAP.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceShare.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceSocial.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/InterfaceUser.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/PluginWrapper.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/ShareWrapper.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/SocialWrapper.java\",\n\"plugin/protocols/proj.android/src/org/cocos2dx/plugin/UserWrapper.java\",\n\"plugin/protocols/proj.ios/PluginProtocol-Prefix.pch\",\n\"plugin/protocols/proj.ios/PluginProtocol.xcodeproj/project.pbxproj\",\n\"plugin/README.md\",\n\"plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.cpp\",\n\"plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.h\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/.classpath\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/.project\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/AndroidManifest.xml\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/ant.properties\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/build.xml\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/jni/Android.mk\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/jni/Application.mk\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/jni/hellocpp/main.cpp\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/ndkgdb.sh\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/proguard-project.txt\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/project.properties\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/res/drawable-hdpi/icon.png\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/res/drawable-ldpi/icon.png\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/res/drawable-mdpi/icon.png\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/res/values/strings.xml\",\n\"plugin/samples/HelloAnalytics-JS/proj.android/src/nojava.txt\",\n\"plugin/samples/HelloAnalytics-JS/Resources/CloseNormal.png\",\n\"plugin/samples/HelloAnalytics-JS/Resources/CloseSelected.png\",\n\"plugin/samples/HelloAnalytics-JS/Resources/main.js\",\n\"plugin/samples/HelloAnalytics-JS/Resources/res/background.png\",\n\"plugin/samples/HelloAnalytics-JS/Resources/res/CloseNormal.png\",\n\"plugin/samples/HelloAnalytics-JS/Resources/res/CloseSelected.png\",\n\"plugin/samples/HelloAnalytics-JS/Resources/src/myApp.js\",\n\"plugin/samples/HelloAnalytics-JS/Resources/src/resource.js\",\n\"plugin/samples/HelloIAP-JS/Classes/AppDelegate.cpp\",\n\"plugin/samples/HelloIAP-JS/Classes/AppDelegate.h\",\n\"plugin/samples/HelloIAP-JS/proj.android/.classpath\",\n\"plugin/samples/HelloIAP-JS/proj.android/.project\",\n\"plugin/samples/HelloIAP-JS/proj.android/AndroidManifest.xml\",\n\"plugin/samples/HelloIAP-JS/proj.android/ant.properties\",\n\"plugin/samples/HelloIAP-JS/proj.android/build.xml\",\n\"plugin/samples/HelloIAP-JS/proj.android/jni/Android.mk\",\n\"plugin/samples/HelloIAP-JS/proj.android/jni/Application.mk\",\n\"plugin/samples/HelloIAP-JS/proj.android/jni/hellocpp/main.cpp\",\n\"plugin/samples/HelloIAP-JS/proj.android/proguard-project.txt\",\n\"plugin/samples/HelloIAP-JS/proj.android/project.properties\",\n\"plugin/samples/HelloIAP-JS/proj.android/res/drawable-hdpi/icon.png\",\n\"plugin/samples/HelloIAP-JS/proj.android/res/drawable-ldpi/icon.png\",\n\"plugin/samples/HelloIAP-JS/proj.android/res/drawable-mdpi/icon.png\",\n\"plugin/samples/HelloIAP-JS/proj.android/res/raw/opening_sound.mid\",\n\"plugin/samples/HelloIAP-JS/proj.android/res/values/g_strings.xml\",\n\"plugin/samples/HelloIAP-JS/proj.android/res/values/strings.xml\",\n\"plugin/samples/HelloIAP-JS/proj.android/src/nojava.txt\",\n\"plugin/samples/HelloIAP-JS/Resources/alipay_plugin.apk\",\n\"plugin/samples/HelloIAP-JS/Resources/BtnAlipay.png\",\n\"plugin/samples/HelloIAP-JS/Resources/BtnND91.png\",\n\"plugin/samples/HelloIAP-JS/Resources/main.js\",\n\"plugin/samples/HelloIAP-JS/Resources/res/background.png\",\n\"plugin/samples/HelloIAP-JS/Resources/res/CloseNormal.png\",\n\"plugin/samples/HelloIAP-JS/Resources/res/CloseSelected.png\",\n\"plugin/samples/HelloIAP-JS/Resources/src/myApp.js\",\n\"plugin/samples/HelloIAP-JS/Resources/src/resource.js\",\n\"plugin/samples/HelloPlugins/Classes/AppDelegate.cpp\",\n\"plugin/samples/HelloPlugins/Classes/AppDelegate.h\",\n\"plugin/samples/HelloPlugins/Classes/AppMacros.h\",\n\"plugin/samples/HelloPlugins/Classes/Configs.h\",\n\"plugin/samples/HelloPlugins/Classes/HelloWorldScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/HelloWorldScene.h\",\n\"plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestAds/TestAdsScene.h\",\n\"plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestAnalytics/TestAnalyticsScene.h\",\n\"plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestIAP/MyPurchase.h\",\n\"plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestIAP/TestIAPScene.h\",\n\"plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestIAPOnline/MyIAPOLManager.h\",\n\"plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestIAPOnline/TestIAPOnlineScene.h\",\n\"plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestShare/MyShareManager.h\",\n\"plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestShare/TestShareScene.h\",\n\"plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestSocial/MySocialManager.h\",\n\"plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestSocial/TestSocialScene.h\",\n\"plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestUser/MyUserManager.h\",\n\"plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.cpp\",\n\"plugin/samples/HelloPlugins/Classes/TestUser/TestUserScene.h\",\n\"plugin/samples/HelloPlugins/proj.android/.classpath\",\n\"plugin/samples/HelloPlugins/proj.android/.project\",\n\"plugin/samples/HelloPlugins/proj.android/AndroidManifest.xml\",\n\"plugin/samples/HelloPlugins/proj.android/ant.properties\",\n\"plugin/samples/HelloPlugins/proj.android/build.xml\",\n\"plugin/samples/HelloPlugins/proj.android/jni/Android.mk\",\n\"plugin/samples/HelloPlugins/proj.android/jni/Application.mk\",\n\"plugin/samples/HelloPlugins/proj.android/jni/hellocpp/main.cpp\",\n\"plugin/samples/HelloPlugins/proj.android/proguard-project.txt\",\n\"plugin/samples/HelloPlugins/proj.android/project.properties\",\n\"plugin/samples/HelloPlugins/proj.android/README.md\",\n\"plugin/samples/HelloPlugins/proj.android/res/drawable-hdpi/icon.png\",\n\"plugin/samples/HelloPlugins/proj.android/res/drawable-ldpi/icon.png\",\n\"plugin/samples/HelloPlugins/proj.android/res/drawable-mdpi/icon.png\",\n\"plugin/samples/HelloPlugins/proj.android/res/values/strings.xml\",\n\"plugin/samples/HelloPlugins/proj.android/src/nojava.txt\",\n\"plugin/samples/HelloPlugins/proj.ios/AppController.h\",\n\"plugin/samples/HelloPlugins/proj.ios/AppController.mm\",\n\"plugin/samples/HelloPlugins/proj.ios/Default-568h@2x.png\",\n\"plugin/samples/HelloPlugins/proj.ios/Default.png\",\n\"plugin/samples/HelloPlugins/proj.ios/Default@2x.png\",\n\"plugin/samples/HelloPlugins/proj.ios/HelloPlugins.xcodeproj/project.pbxproj\",\n\"plugin/samples/HelloPlugins/proj.ios/Icon-114.png\",\n\"plugin/samples/HelloPlugins/proj.ios/Icon-144.png\",\n\"plugin/samples/HelloPlugins/proj.ios/Icon-57.png\",\n\"plugin/samples/HelloPlugins/proj.ios/Icon-72.png\",\n\"plugin/samples/HelloPlugins/proj.ios/Info.plist\",\n\"plugin/samples/HelloPlugins/proj.ios/main.m\",\n\"plugin/samples/HelloPlugins/proj.ios/Prefix.pch\",\n\"plugin/samples/HelloPlugins/proj.ios/RootViewController.h\",\n\"plugin/samples/HelloPlugins/proj.ios/RootViewController.mm\",\n\"plugin/samples/HelloPlugins/Resources/BtnAlipay.png\",\n\"plugin/samples/HelloPlugins/Resources/BtnND91.png\",\n\"plugin/samples/HelloPlugins/Resources/BtnQH360.png\",\n\"plugin/samples/HelloPlugins/Resources/BtnUC.png\",\n\"plugin/samples/HelloPlugins/Resources/CloseNormal.png\",\n\"plugin/samples/HelloPlugins/Resources/CloseSelected.png\",\n\"plugin/samples/HelloPlugins/Resources/twitter.jpeg\",\n\"plugin/samples/HelloPlugins/Resources/weibo.png\",\n\"plugin/tools/android/build_common.xml\",\n\"plugin/tools/android-build.py\",\n\"plugin/tools/config.sh\",\n\"plugin/tools/gameDevGuide.sh\",\n\"plugin/tools/publish.sh\",\n\"plugin/tools/tojs/.gitignore\",\n\"plugin/tools/tojs/conversions.yaml\",\n\"plugin/tools/tojs/genbindings-all.sh\",\n\"plugin/tools/tojs/genbindings.sh\",\n\"plugin/tools/tojs/modify_include.sed\",\n\"plugin/tools/toolsForGame/addPluginForGame.sh\",\n\"plugin/tools/toolsForGame/main.py\",\n\"plugin/tools/toolsForGame/modifyAppMK.sh\",\n\"plugin/tools/toolsForGame/modifyClassPath.py\",\n\"plugin/tools/toolsForGame/modifyManifest.py\",\n\"plugin/tools/toolsForGame/modifyMK.sh\",\n\"plugin/tools/toolsForGame/modifyProject.py\",\n\"plugin/tools/toolsForGame/modifyRes.sh\",\n\"plugin/tools/toolsForGame/steps.py\",\n\"plugin/tools/toolsForPublish/checkEnvironment.sh\",\n\"plugin/tools/toolsForPublish/genPrebuildMK.sh\",\n\"plugin/tools/toolsForPublish/publishPlugin.sh\",\n\"README.md\",\n\"tools/__init__.py\",\n\"tools/android-emulator-README.md\",\n\"tools/android-mk-generator/android_mk_generator.py\",\n\"tools/android-mk-generator/config.py\",\n\"tools/bindings-generator/.gitignore\",\n\"tools/bindings-generator/backup/clang-llvm-3.3-pybinding/__init__.py\",\n\"tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py\",\n\"tools/bindings-generator/backup/clang-llvm-3.3-pybinding/enumerations.py\",\n\"tools/bindings-generator/clang/__init__.py\",\n\"tools/bindings-generator/clang/cindex.py\",\n\"tools/bindings-generator/clang/enumerations.py\",\n\"tools/bindings-generator/generator\",\n\"tools/bindings-generator/generator.py\",\n\"tools/bindings-generator/libclang/libclang.dll\",\n\"tools/bindings-generator/libclang/libclang.dylib\",\n\"tools/bindings-generator/libclang/libclang.so\",\n\"tools/bindings-generator/libclang/VERSION.txt\",\n\"tools/bindings-generator/README.md\",\n\"tools/bindings-generator/targets/lua/conversions.yaml\",\n\"tools/bindings-generator/targets/lua/templates/apidoc_classfoot.js\",\n\"tools/bindings-generator/targets/lua/templates/apidoc_classhead.js\",\n\"tools/bindings-generator/targets/lua/templates/apidoc_function.js\",\n\"tools/bindings-generator/targets/lua/templates/apidoc_ns.js\",\n\"tools/bindings-generator/targets/lua/templates/function.h\",\n\"tools/bindings-generator/targets/lua/templates/ifunction.c\",\n\"tools/bindings-generator/targets/lua/templates/ifunction_overloaded.c\",\n\"tools/bindings-generator/targets/lua/templates/lambda.c\",\n\"tools/bindings-generator/targets/lua/templates/layout_foot.c\",\n\"tools/bindings-generator/targets/lua/templates/layout_foot.h\",\n\"tools/bindings-generator/targets/lua/templates/layout_head.c\",\n\"tools/bindings-generator/targets/lua/templates/layout_head.h\",\n\"tools/bindings-generator/targets/lua/templates/prelude.c\",\n\"tools/bindings-generator/targets/lua/templates/prelude.h\",\n\"tools/bindings-generator/targets/lua/templates/register.c\",\n\"tools/bindings-generator/targets/lua/templates/sfunction.c\",\n\"tools/bindings-generator/targets/lua/templates/sfunction_overloaded.c\",\n\"tools/bindings-generator/targets/spidermonkey/common/Android.mk.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/debugger.js.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/Debugger.md\",\n\"tools/bindings-generator/targets/spidermonkey/common/debugger1.png\",\n\"tools/bindings-generator/targets/spidermonkey/common/debugger2.png\",\n\"tools/bindings-generator/targets/spidermonkey/common/helper.js.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/js_bindings_config.h.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/js_manual_conversions.cpp.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/js_manual_conversions.h.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/sample.js\",\n\"tools/bindings-generator/targets/spidermonkey/common/ScriptingCore.cpp.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/ScriptingCore.h.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/spidermonkey_specifics.h.example\",\n\"tools/bindings-generator/targets/spidermonkey/common/uthash.h\",\n\"tools/bindings-generator/targets/spidermonkey/conversions.yaml\",\n\"tools/bindings-generator/targets/spidermonkey/templates/apidoc_classfoot.js\",\n\"tools/bindings-generator/targets/spidermonkey/templates/apidoc_classhead.js\",\n\"tools/bindings-generator/targets/spidermonkey/templates/apidoc_function.js\",\n\"tools/bindings-generator/targets/spidermonkey/templates/apidoc_ns.js\",\n\"tools/bindings-generator/targets/spidermonkey/templates/function.h\",\n\"tools/bindings-generator/targets/spidermonkey/templates/ifunction.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/ifunction_overloaded.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/lambda.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/layout_foot.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/layout_foot.h\",\n\"tools/bindings-generator/targets/spidermonkey/templates/layout_head.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/layout_head.h\",\n\"tools/bindings-generator/targets/spidermonkey/templates/prelude.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/prelude.h\",\n\"tools/bindings-generator/targets/spidermonkey/templates/register.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/sfunction.c\",\n\"tools/bindings-generator/targets/spidermonkey/templates/sfunction_overloaded.c\",\n\"tools/bindings-generator/test/simple_test/simple_class.cpp\",\n\"tools/bindings-generator/test/simple_test/simple_class.h\",\n\"tools/bindings-generator/test/test.bat\",\n\"tools/bindings-generator/test/test.ini\",\n\"tools/bindings-generator/test/test.sh\",\n\"tools/bindings-generator/test/user.cfg.sample\",\n\"tools/bindings-generator/test/userconf.ini\",\n\"tools/bindings-generator/test/userconf.ini.sample\",\n\"tools/bindings-generator/tools/win32/cygiconv-2.dll\",\n\"tools/bindings-generator/tools/win32/cygintl-8.dll\",\n\"tools/bindings-generator/tools/win32/cygwin1.dll\",\n\"tools/closure-compiler/compiler.jar\",\n\"tools/closure-compiler/obfuscate.py\",\n\"tools/closure-compiler/template.xml\",\n\"tools/cocos2d-console/.gitignore\",\n\"tools/cocos2d-console/console/bin/\",\n\"tools/cocos2d-console/console/cocos2d.ini\",\n\"tools/cocos2d-console/console/cocos2d.py\",\n\"tools/cocos2d-console/console/cocos2d_jscompile.py\",\n\"tools/cocos2d-console/console/cocos2d_new.py\",\n\"tools/cocos2d-console/console/cocos2d_version.py\",\n\"tools/cocos2d-console/README.md\",\n\"tools/cocos2d-console/src/jsbcc_source/jsbcc-vc2012.sln\",\n\"tools/cocos2d-console/src/jsbcc_source/jsbcc-vc2012.vcxproj\",\n\"tools/cocos2d-console/src/jsbcc_source/jsbcc-vc2012.vcxproj.filters\",\n\"tools/cocos2d-console/src/jsbcc_source/jsbcc-vc2012.vcxproj.user\",\n\"tools/cocos2d-console/src/jsbcc_source/jsbcc.xcodeproj/project.pbxproj\",\n\"tools/cocos2d-console/src/jsbcc_source/README\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Anchor.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/CallArgs.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/CharacterEncoding.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Date.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/GCAPI.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/HashTable.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/HeapAPI.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/LegacyIntTypes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/MemoryMetrics.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/PropertyKey.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/RequiredDefines.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/RootingAPI.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Utility.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Value.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js/Vector.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js-config.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/js.msg\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsalloc.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsapi.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsclass.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsclist.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jscpucfg.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsdbgapi.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsfriendapi.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jslock.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsperf.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsprf.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsprototypes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsproxy.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsprvtd.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jspubtd.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jstypes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsutil.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jsversion.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/jswrapper.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/AllocPolicy.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Array.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Assertions.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Atomics.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Attributes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/BloomFilter.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Casting.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Char16.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/CheckedInt.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Compiler.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Constants.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/DebugOnly.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Decimal.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Endian.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/EnumSet.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/FloatingPoint.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/GuardObjects.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/HashFunctions.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Likely.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/LinkedList.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/MathAlgorithms.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/MemoryChecking.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/MemoryReporting.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Move.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/NullPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/PodOperations.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Poison.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Range.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/RangedPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/ReentrancyGuard.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/RefPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Scoped.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/SHA1.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/SplayTree.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/TemplateLib.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/ThreadLocal.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/TypedEnum.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Types.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/TypeTraits.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Util.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/Vector.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/include/mozilla/WeakPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-ios/lib/libjs_static.a\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Anchor.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/CallArgs.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/CharacterEncoding.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Date.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/GCAPI.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/HashTable.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/HeapAPI.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/LegacyIntTypes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/MemoryMetrics.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/PropertyKey.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/RequiredDefines.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/RootingAPI.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Utility.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Value.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js/Vector.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js-config.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/js.msg\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsalloc.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsapi.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsclass.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsclist.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jscpucfg.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsdbgapi.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsfriendapi.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jslock.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsperf.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsprf.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsprototypes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsproxy.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsprvtd.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jspubtd.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jstypes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsutil.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jsversion.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/jswrapper.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/AllocPolicy.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Array.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Assertions.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Atomics.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Attributes.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/BloomFilter.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Casting.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Char16.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/CheckedInt.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Compiler.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Constants.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/DebugOnly.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Decimal.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Endian.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/EnumSet.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/FloatingPoint.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/GuardObjects.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/HashFunctions.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Likely.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/LinkedList.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/MathAlgorithms.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/MemoryChecking.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/MemoryReporting.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Move.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/NullPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/PodOperations.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Poison.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Range.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/RangedPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/ReentrancyGuard.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/RefPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Scoped.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/SHA1.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/SplayTree.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/TemplateLib.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/ThreadLocal.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/TypedEnum.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Types.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/TypeTraits.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Util.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/Vector.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/include/mozilla/WeakPtr.h\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/lib/mozjs-25.0.dll\",\n\"tools/cocos2d-console/src/jsbcc_source/spidermonkey-win32/lib/mozjs-25.0.lib\",\n\"tools/cocos2d-console/src/jsbcc_source/src/main.cpp\",\n\"tools/cpp-best-practise-formatter/cpp-best-practise-formatter.py\",\n\"tools/cpp-best-practise-formatter/test/CCDirector.h\",\n\"tools/cpp-best-practise-formatter/test/dir_skip/test.h\",\n\"tools/jenkins-scripts/create-job.py\",\n\"tools/jenkins-scripts/gen_jsb.sh\",\n\"tools/jenkins-scripts/job-trigger.py\",\n\"tools/jenkins-scripts/pull-request-builder.py\",\n\"tools/localvartoauto/LocalVarToAuto.py\",\n\"tools/make-package/git-archive-all\",\n\"tools/make-package/Makefile\",\n\"tools/make-package/README.markdown\",\n\"tools/project-creator/config-create/config.gitingore\",\n\"tools/project-creator/config-create/create_config.py\",\n\"tools/project-creator/create_project.py\",\n\"tools/project-creator/module/__init__.py\",\n\"tools/project-creator/module/android.json\",\n\"tools/project-creator/module/cocos_files.json\",\n\"tools/project-creator/module/core.py\",\n\"tools/project-creator/module/ios_mac.json\",\n\"tools/project-creator/module/linux.json\",\n\"tools/project-creator/module/ui.py\",\n\"tools/project-creator/module/win32.json\",\n\"tools/project-creator/README.md\",\n\"tools/pylib/__init__.py\",\n\"tools/pylib/PathUtils.py\",\n\"tools/tojs/cocos2dx.ini\",\n\"tools/tojs/cocos2dx_builder.ini\",\n\"tools/tojs/cocos2dx_extension.ini\",\n\"tools/tojs/cocos2dx_gui.ini\",\n\"tools/tojs/cocos2dx_spine.ini\",\n\"tools/tojs/cocos2dx_studio.ini\",\n\"tools/tojs/genbindings-win32.bat\",\n\"tools/tojs/genbindings.sh\",\n\"tools/tojs/README.mdown\",\n\"tools/tolua/cocos2dx.ini\",\n\"tools/tolua/cocos2dx_extension.ini\",\n\"tools/tolua/cocos2dx_gui.ini\",\n\"tools/tolua/cocos2dx_physics.ini\",\n\"tools/tolua/cocos2dx_spine.ini\",\n\"tools/tolua/cocos2dx_studio.ini\",\n\"tools/tolua/genbindings-win32.bat\",\n\"tools/tolua/genbindings.sh\",\n\"tools/tolua/README.mdown\",\n\"tools/travis-scripts/before-install.sh\",\n\"tools/travis-scripts/generate-jsbindings.sh\",\n\"tools/travis-scripts/install_glfw.sh\",\n\"tools/travis-scripts/run-script.sh\",\n\"tools/travis-scripts/travis_mac.yml\"\n]"
  },
  {
    "path": "cocos2d/tools/project-creator/module/core.py",
    "content": "#!/usr/bin/python\n#coding=utf-8\n\"\"\"****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************\"\"\"\n\nimport sys\nimport os, os.path\nimport json\nimport shutil\n\ndef replaceString(filepath, src_string, dst_string):\n    \"\"\" From file's content replace specified string\n    Arg:\n        filepath: Specify a file contains the path\n        src_string: old string\n        dst_string: new string\n    \"\"\"\n    content = \"\"\n    f1 = open(filepath, \"rb\")\n    for line in f1:\n        strline = line.decode('utf8')\n        if src_string in strline:\n            content += strline.replace(src_string, dst_string)\n        else:\n            content += strline\n    f1.close()\n    f2 = open(filepath, \"wb\")\n    f2.write(content.encode('utf8'))\n    f2.close()\n#end of replaceString\n\nclass CocosProject:\n\n    def __init__(self):\n        \"\"\"\n        \"\"\"\n        self.platforms= {\n            \"cpp\" : [\"ios_mac\", \"android\", \"win32\", \"linux\"],\n            \"lua\" : [\"ios_mac\", \"android\", \"win32\", \"linux\"],\n            \"javascript\" : [\"ios_mac\", \"android\", \"win32\"]\n        }\n        self.context = {\n            \"language\": None,\n            \"src_project_name\": None,\n            \"src_package_name\": None,\n            \"dst_project_name\": None,\n            \"dst_package_name\": None,\n            \"src_project_path\": None,\n            \"dst_project_path\": None,\n            \"cocos_file_list\":None,\n            \"script_dir\": None\n        }\n        self.platforms_list = []\n        self.cocos_root =os.path.abspath(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"..\"))\n        self.callbackfun = None\n        self.totalStep =1\n        self.step=0\n\n    def checkParams(self):\n        \"\"\"Custom and check param list.\n        \"\"\"\n        from optparse import OptionParser\n        # set the parser to parse input params\n        # the correspond variable name of \"-x, --xxx\" is parser.xxx\n        parser = OptionParser(\n            usage=\"Usage: %prog -n <PROJECT_NAME> -k <PACKAGE_NAME> -l <cpp|lua|javascript> -p <PROJECT_PATH>\\n\\\n            Sample: %prog -n MyGame -k com.MyCompany.AwesomeGame -l javascript -p c:/mycompany\"\n        )\n        parser.add_option(\"-n\", \"--name\", metavar=\"PROJECT_NAME\",help=\"Set a project name\")\n        parser.add_option(\"-k\", \"--package\", metavar=\"PACKAGE_NAME\",help=\"Set a package name for project\")\n        parser.add_option(\"-l\", \"--language\",metavar=\"PROGRAMMING_NAME\",\n                            type=\"choice\",\n                            choices=[\"cpp\", \"lua\", \"javascript\"],\n                            help=\"Major programming language you want to use, should be [cpp | lua | javascript]\")\n        parser.add_option(\"-p\", \"--path\", metavar=\"PROJECT_PATH\",help=\"Set generate project path for project\")\n\n        # parse the params\n        (opts, args) = parser.parse_args()\n        if not opts.name:\n            parser.error(\"-n or --name is not specified\")\n\n        if not opts.package:\n            parser.error(\"-k or --package is not specified\")\n\n        if not opts.language:\n            parser.error(\"-l or --language is not specified\")\n\n        if not opts.path:\n            parser.error(\"-p or --path is not specified\")\n\n        return opts.name, opts.package, opts.language, opts.path\n\n    def createPlatformProjects(self, projectName, packageName, language, projectPath, callbackfun = None):\n        \"\"\" Create a plantform project.\n        Arg:\n            projectName: Project name, like this: \"helloworld\".\n            packageName: It's used for android platform,like this:\"com.cocos2dx.helloworld\".\n            language: There have three languages can be choice: [cpp | lua | javascript], like this:\"javascript\".\n            projectPath: The path of generate project.\n            callbackfun: It's new project callback function.There have four Params.\n                        As follow:\n                        def newProjectCallBack(step, totalStep, showMsg):\n                            #step:  processing step,at present\n                            #totalStep: all the steps\n                            #showMsg: message about the progress\n                            pass\n\n        \"\"\"\n        self.callbackfun = callbackfun\n\n        # init our internal params\n        self.context[\"dst_project_name\"] = projectName\n        self.context[\"dst_package_name\"] = packageName\n        self.context[\"language\"] = language\n        self.context[\"dst_project_path\"] = os.path.join(projectPath,projectName)\n        self.context[\"script_dir\"] = os.path.abspath(os.path.dirname(__file__))\n        self.context[\"cocos_file_list\"] = os.path.join(self.context[\"script_dir\"], \"cocos_files.json\")\n\n        # fill in src_project_name and src_package_name according to \"language\"\n        template_dir = os.path.abspath(os.path.join(self.cocos_root, \"template\"))\n        if (\"cpp\" == self.context[\"language\"]):\n            self.context[\"src_project_name\"] = \"HelloCpp\"\n            self.context[\"src_package_name\"] = \"org.cocos2dx.hellocpp\"\n            self.context[\"src_project_path\"] = os.path.join(template_dir, \"multi-platform-cpp\")\n        elif (\"lua\" == self.context[\"language\"]):\n            self.context[\"src_project_name\"] = \"HelloLua\"\n            self.context[\"src_package_name\"] = \"org.cocos2dx.hellolua\"\n            self.context[\"src_project_path\"] = os.path.join(template_dir, \"multi-platform-lua\")\n        elif (\"javascript\" == self.context[\"language\"]):\n            self.context[\"src_project_name\"] = \"HelloJavascript\"\n            self.context[\"src_package_name\"] = \"org.cocos2dx.hellojavascript\"\n            self.context[\"src_project_path\"] = os.path.join(template_dir, \"multi-platform-js\")\n        else:\n            print (\"Your language parameter doesn\\'t exist.\" \\\n                \"Check correct language option\\'s parameter\")\n            return False\n\n        # copy \"lauguage\"(cpp/lua/javascript) platform.proj into cocos2d-x/projects/<project_name>/folder\n        if os.path.exists(self.context[\"dst_project_path\"]):\n            print (\"Error:\" + self.context[\"dst_project_path\"] + \" folder is already existing\")\n            print (\"Please remove the old project or choose a new PROJECT_NAME in -project parameter\")\n            return False\n        else:\n            shutil.copytree(self.context[\"src_project_path\"], self.context[\"dst_project_path\"], True)\n\n        # check cocos engine exist\n\n        if not os.path.exists(self.context[\"cocos_file_list\"]):\n            print (\"cocos_file_list.json doesn\\'t exist.\" \\\n                \"generate it, please\")\n            return False\n\n        f = open(self.context[\"cocos_file_list\"])\n        fileList = json.load(f)\n        f.close()\n        self.platforms_list = self.platforms.get(self.context[\"language\"], [])\n        self.totalStep = len(self.platforms_list) + len(fileList)\n        self.step = 0\n\n        #begin copy engine\n        print(\"###begin copy engine\")\n        print(\"waitting copy cocos2d ...\")\n        dstPath = os.path.join(self.context[\"dst_project_path\"],\"cocos2d\")\n        for index in range(len(fileList)):\n            srcfile = os.path.join(self.cocos_root,fileList[index])\n            dstfile = os.path.join(dstPath,fileList[index])\n            if not os.path.exists(os.path.dirname(dstfile)):\n                os.makedirs(os.path.dirname(dstfile))\n\n            #copy file or folder\n            if os.path.exists(srcfile):\n                if os.path.isdir(srcfile):\n                    if os.path.exists(dstfile):\n                        shutil.rmtree(dstfile)\n                    shutil.copytree(srcfile, dstfile)\n                else:\n                    if os.path.exists(dstfile):\n                        os.remove(dstfile)\n                    shutil.copy(srcfile, dstfile)\n            self.step = self.step + 1\n            if self.callbackfun and self.step%int(self.totalStep/50) == 0:\n                self.callbackfun(self.step,self.totalStep,fileList[index])\n        print(\"cocos2d\\t\\t: Done!\")\n        # call process_proj from each platform's script folder\n        for platform in self.platforms_list:\n            self.__processPlatformProjects(platform)\n\n        print (\"###New project has been created in this path: \")\n        print (self.context[\"dst_project_path\"].replace(\"\\\\\", \"/\"))\n        print (\"Have Fun!\")\n        return True\n\n    def __processPlatformProjects(self, platform):\n        \"\"\" Process each platform project.\n        Arg:\n            platform: \"ios_mac\", \"android\", \"win32\", \"linux\"\n        \"\"\"\n\n        # determine proj_path\n        proj_path = os.path.join(self.context[\"dst_project_path\"], \"proj.\" + platform)\n        java_package_path = \"\"\n\n        # read json config file for the current platform\n        conf_path = os.path.join(self.context[\"script_dir\"], \"%s.json\" % platform)\n        f = open(conf_path)\n        data = json.load(f)\n\n        # rename package path, like \"org.cocos2dx.hello\" to \"com.company.game\". This is a special process for android\n        if platform == \"android\":\n            src_pkg = self.context[\"src_package_name\"].split('.')\n            dst_pkg = self.context[\"dst_package_name\"].split('.')\n\n            java_package_path = os.path.join(*dst_pkg)\n\n        # rename files and folders\n        for item in data[\"rename\"]:\n            tmp = item.replace(\"PACKAGE_PATH\", java_package_path)\n            src = tmp.replace(\"PROJECT_NAME\", self.context[\"src_project_name\"])\n            dst = tmp.replace(\"PROJECT_NAME\", self.context[\"dst_project_name\"])\n            if os.path.exists(os.path.join(proj_path, src)):\n                os.rename(os.path.join(proj_path, src), os.path.join(proj_path, dst))\n\n        # remove useless files and folders\n        for item in data[\"remove\"]:\n            dst = item.replace(\"PROJECT_NAME\", self.context[\"dst_project_name\"])\n            if os.path.exists(os.path.join(proj_path, dst)):\n                shutil.rmtree(os.path.join(proj_path, dst))\n\n        # rename package_name. This should be replaced at first. Don't change this sequence\n        for item in data[\"replace_package_name\"]:\n            tmp = item.replace(\"PACKAGE_PATH\", java_package_path)\n            dst = tmp.replace(\"PROJECT_NAME\", self.context[\"dst_project_name\"])\n            if os.path.exists(os.path.join(proj_path, dst)):\n                replaceString(os.path.join(proj_path, dst), self.context[\"src_package_name\"], self.context[\"dst_package_name\"])\n\n        # rename project_name\n        for item in data[\"replace_project_name\"]:\n            tmp = item.replace(\"PACKAGE_PATH\", java_package_path)\n            dst = tmp.replace(\"PROJECT_NAME\", self.context[\"dst_project_name\"])\n            if os.path.exists(os.path.join(proj_path, dst)):\n                replaceString(os.path.join(proj_path, dst), self.context[\"src_project_name\"], self.context[\"dst_project_name\"])\n\n        # done!\n        showMsg = \"proj.%s\\t\\t: Done!\" % platform\n        self.step += 1\n        if self.callbackfun:\n            self.callbackfun(self.step,self.totalStep,showMsg)\n        print (showMsg)\n    # end of processPlatformProjects\n\n# -------------- main --------------\n# dump argvs\n# print sys.argv\nif __name__ == '__main__':\n    project = CocosProject()\n    name, package, language, path = project.checkParams()\n    project.createPlatformProjects(name, package, language, path)\n\n"
  },
  {
    "path": "cocos2d/tools/project-creator/module/ios_mac.json",
    "content": "{\n    \"rename\":               [\"PROJECT_NAME.xcodeproj\"],\n    \"remove\":               [\"PROJECT_NAME.xcodeproj/project.xcworkspace\",\n                             \"PROJECT_NAME.xcodeproj/xcuserdata\",\n                             \"wsocket.c\",\n                             \"wsocket.h\"],\n    \"replace_package_name\": [\"Info.plist\"],\n    \"replace_project_name\": [\"Info.plist\",\n                             \"ios/main.m\",\n                             \"ios/Prefix.pch\",\n                             \"PROJECT_NAME.xcodeproj/project.pbxproj\"]\n}\n"
  },
  {
    "path": "cocos2d/tools/project-creator/module/linux.json",
    "content": "{\n    \"rename\":               [],\n    \"remove\":               [\"wsocket.c\",\n                             \"wsocket.h\"],\n    \"replace_package_name\": [],\n    \"replace_project_name\": [\"../CMakeLists.txt\"]\n}\n"
  },
  {
    "path": "cocos2d/tools/project-creator/module/ui.py",
    "content": "#!/usr/bin/python\n#coding=utf-8\n\"\"\"****************************************************************************\nCopyright (c) 2013 cocos2d-x.org\n\nhttp://www.cocos2d-x.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n****************************************************************************\"\"\"\n\nimport platform\nimport os, os.path\nimport shutil\nimport threading\nimport time\n\nfrom module.core import CocosProject\n\n#import head files by python version.\nif int(platform.python_version().split('.')[0])>=3:\n    from tkinter import *\n    from tkinter.filedialog import *\n    from tkinter.messagebox import *\n    from queue import *\nelse:\n    from Tkinter import *\n    from tkFileDialog import *\n    from tkMessageBox import *\n    from Queue import *\n\n\nclass ThreadedTask(threading.Thread):\n    \"\"\"Create cocos project thread.\n    \"\"\"\n    def __init__(self, queue, projectName, packageName, language, projectPath):\n        threading.Thread.__init__(self)\n        self.queue = queue\n        self.projectName = projectName\n        self.packageName = packageName\n        self.language = language\n        self.projectPath = projectPath\n\n    def run(self):\n        \"\"\"Create cocos project.\n        custom message rules to notify ui\n        As follow:\n            begin@%d@%d@%s  --- create before\n            doing@%d@%d@%s  --- creating\n            end@%d@%d@%s    --- create after\n        \"\"\"\n        #delete exist project.\n        if os.path.exists(os.path.join(self.projectPath, self.projectName)):\n            print (\"###begin remove:  \" + self.projectName)\n            try:\n                shutil.rmtree(os.path.join(self.projectPath, self.projectName))\n                print (\"###remove finish:  \" + self.projectName)\n            except:\n                print (\"###remove folder failure %s\" %self.projectName)\n                putMsg = \"end@%d@%d@%s\" %(100, 100, \"create failure\")\n                self.queue.put(putMsg)\n        putMsg = \"begin@%d@%d@%s\" %(0, 100, \"begin create\")\n        self.queue.put(putMsg)\n\n        project = CocosProject()\n        breturn = project.createPlatformProjects(\n            self.projectName,\n            self.packageName,\n            self.language,\n            self.projectPath,\n            self.newProjectCallBack\n        )\n        if breturn:\n            putMsg = \"end@%d@%d@%s\" %(100, 100, \"create successful\")\n        else:\n            putMsg = \"end@%d@%d@%s\" %(100, 100, \"create failure\")\n        self.queue.put(putMsg)\n\n    def newProjectCallBack(self, step, totalStep, showMsg):\n        \"\"\"Creating cocos project callback.\n        \"\"\"\n        putMsg = \"doing@%d@%d@%s\" %(step, totalStep, showMsg)\n        self.queue.put(putMsg)\n\nclass StdoutRedirector(object):\n    \"\"\"Redirect output.\n    \"\"\"\n    def __init__(self, text_area):\n        self.text_area = text_area\n\n    def write(self, str):\n        self.text_area.insert(END, str)\n        self.text_area.see(END)\n\nclass TkCocosDialog(Frame):\n    def __init__(self, parent):\n        Frame.__init__(self,parent)\n\n        self.projectName = \"\"\n        self.packageName = \"\"\n        self.language = \"\"\n\n        self.parent = parent\n        self.columnconfigure(3, weight=1)\n        self.rowconfigure(5, weight=1)\n\n        # project name frame\n        self.labName = Label(self, text=\"Project Name:\")\n        self.strName = StringVar()\n        self.strName.set(\"MyGame\")\n        self.editName = Entry(self, textvariable=self.strName)\n        self.labName.grid(sticky=W, pady=4, padx=5)\n        self.editName.grid(row=0, column=1, columnspan=4,padx=5, pady=2,sticky=E+W)\n\n        # package name frame\n        self.labPackage = Label(self, text=\"Package Name:\")\n        self.strPackage=StringVar()\n        self.strPackage.set(\"com.MyCompany.AwesomeGame\")\n        self.editPackage = Entry(self, textvariable=self.strPackage)\n        self.labPackage.grid(row=1, column=0,sticky=W, padx=5)\n        self.editPackage.grid(row=1, column=1, columnspan=4,padx=5, pady=2,sticky=E+W)\n\n        # project path frame\n        self.labPath = Label(self, text=\"Project Path:\")\n        self.editPath = Entry(self)\n        self.btnPath = Button(self, text=\"...\", width = 6, command = self.pathCallback)\n        self.labPath.grid(row=2, column=0,sticky=W, pady=4, padx=5)\n        self.editPath.grid(row=2, column=1, columnspan=3,padx=5, pady=2, sticky=E+W)\n        self.btnPath.grid(row=2, column=4,)\n\n        # language frame\n        self.labLanguage = Label(self, text=\"Language:\")\n        self.var=IntVar()\n        self.var.set(1)\n        self.checkcpp = Radiobutton(self, text=\"C++\", variable=self.var, value=1)\n        self.checklua = Radiobutton(self, text=\"Lua\", variable=self.var, value=2)\n        self.checkjs = Radiobutton(self, text=\"JavaScript\", variable=self.var, value=3)\n        self.labLanguage.grid(row=3, column=0,sticky=W, padx=5)\n        self.checkcpp.grid(row=3, column=1,sticky=N+W)\n        self.checklua.grid(row=3, column=2,padx=5,sticky=N+W)\n        self.checkjs.grid(row=3, column=3,padx=5,sticky=N+W)\n\n        # show progress\n        self.progress = Scale(self, state= DISABLED, from_=0, to=100, orient=HORIZONTAL)\n        self.progress.set(0)\n        self.progress.grid(row=4, column=0, columnspan=5,padx=5, pady=2,sticky=E+W+S+N)\n\n        # msg text frame\n        self.text=Text(self,background = '#d9efff')\n        self.text.bind(\"<KeyPress>\", lambda e : \"break\")\n        self.text.grid(row=5, column=0, columnspan=5, rowspan=1, padx=5, sticky=E+W+S+N)\n\n        # new project button\n        self.btnCreate = Button(self, text=\"create\", command = self.createBtnCallback)\n        self.btnCreate.grid(row=7, column=3, columnspan=1, rowspan=1,pady=2,ipadx=15,ipady =10, sticky=W)\n\n        #center window on desktop\n        curWidth = 500\n        curHeight = 450\n        scnWidth = self.parent.winfo_screenwidth()\n        scnHeight = self.parent.winfo_screenheight()\n        tmpcnf = '%dx%d+%d+%d'%(curWidth, curHeight, int((scnWidth-curWidth)/2), int((scnHeight-curHeight)/2))\n        self.parent.geometry(tmpcnf)\n        self.parent.title(\"Cocos Project Creator\")\n\n        #fix size\n        #self.parent.maxsize(curWidth, curHeight)\n        #self.parent.minsize(curWidth, curHeight)\n\n        #redirect out to text\n        self.pack(fill=BOTH, expand=1)\n        sys.stdout = StdoutRedirector(self.text)\n\n    def process_queue(self):\n        \"\"\"\n        \"\"\"\n        #message is empty\n        if self.queue.empty():\n            self.parent.after(100, self.process_queue)\n            return\n\n        #parse message\n        msg = self.queue.get(0)\n        msglist = msg.split(\"@\")\n        if len(msglist) < 4:\n            return\n\n        #begin\n        if msglist[0] == \"begin\":\n            self.progress['state'] = NORMAL\n        #doing\n        elif msglist[0] == \"doing\":\n            pass\n\n        self.progress.set(int(int(msglist[1])*100/int(msglist[2])))\n        #end\n        if msglist[0] == \"end\":\n            showwarning(\"create\", msglist[3])\n            self.progress.set(0)\n            self.text.insert(END,\"=================END==============\\n\")\n            self.progress['state'] = DISABLED\n            self.btnCreate['state'] = NORMAL\n            return\n        self.parent.after(100, self.process_queue)\n\n    def createBtnCallback(self):\n        \"\"\"Create button event.\n        \"\"\"\n        #Check project name\n        projectName = self.editName.get()\n        if projectName == \"\":\n            showwarning(\"warning\", \"projectName is empty\")\n            return\n\n        #Check the package name is effective\n        packageName = self.editPackage.get()\n        packageList = packageName.split(\".\")\n        if len(packageList) < 2:\n            showwarning(\"warning\", \"packageName format  error!\")\n            return\n        for index in range(len(packageList)):\n            if (packageList[index] == \"\") or (packageList[index][0].isdigit()):\n                showwarning(\"warning\", \"packageName format  error!\")\n                return\n\n        # get select language type\n        language = \"cpp\"\n        if self.var.get() == 1:\n            language = \"cpp\"\n        elif self.var.get() == 2:\n            language = \"lua\"\n        elif self.var.get() == 3:\n            language = \"javascript\"\n\n        projectPath = self.editPath.get()\n        if projectPath == \"\":\n            showwarning(\"warning\", \"projectPath is empty\")\n            return\n\n        # if project has already exist,....\n        if os.path.exists(os.path.join(projectPath, projectName)):\n            if not askyesno(\"warning\", \"%s had exist,do you want to recreate!\" %projectName ):\n                return\n\n        #create a new thread to deal with create new project.\n        self.btnCreate['state'] = DISABLED\n        self.queue = Queue()\n        ThreadedTask(self.queue, projectName, packageName, language, projectPath).start()\n        self.parent.after(100, self.process_queue)\n\n    def pathCallback(self):\n        \"\"\"Paht button event.\n        \"\"\"\n        filepath = askdirectory()\n        if filepath:\n            self.editPath.delete(0, END)\n            self.editPath.insert(0, filepath)\n\ndef createTkCocosDialog():\n\n    old_stdout = sys.stdout\n    root = Tk()\n    app = TkCocosDialog(root)\n    root.mainloop()\n    sys.stdout = old_stdout\n\nif __name__ =='__main__':\n    createTkCocosDialog()"
  },
  {
    "path": "cocos2d/tools/project-creator/module/win32.json",
    "content": "{\n    \"rename\":               [\"PROJECT_NAME.vcxproj\",\n                             \"PROJECT_NAME.vcxproj.filters\",\n                             \"PROJECT_NAME.vcxproj.user\",\n                             \"PROJECT_NAME.sln\"],\n    \"remove\":               [\"usocket.c\",\n                             \"usocket.h\",\n                             \"unix.c\",\n                             \"unix.h\",\n                             \"serial.c\"],\n    \"replace_package_name\": [],\n    \"replace_project_name\": [\"PROJECT_NAME.vcxproj\",\n                             \"PROJECT_NAME.vcxproj.filters\",\n                             \"PROJECT_NAME.vcxproj.user\",\n                             \"PROJECT_NAME.sln\",\n                             \"game.rc\",\n                             \"main.cpp\"]\n}\n"
  },
  {
    "path": "cocos2d/tools/pylib/PathUtils.py",
    "content": "#!/usr/bin.python\n''' some common path and file operation '''\nimport os.path\nimport re\nimport types\nimport fileinput\nimport cStringIO\n\n\nclass PathUtils:\n    \n    def __init__(self, root):\n        self.__root = root\n\n    def __check_file_matchs(self, filePath):\n    \n        #normalize the path\n        realFilePath = os.path.abspath(filePath)\n\n        if not os.path.isfile(realFilePath):\n            return False\n    \n        curDir, fileName = os.path.split(realFilePath)\n    \n        # check dir is exclude or not\n        for dir in self.__exclude:\n            dir = os.path.abspath(os.path.join(self.__root, dir))\n            if os.path.isdir(dir) and os.path.isdir(curDir[:len(dir)]):\n                if self.samefile(dir, curDir[:len(dir)]):\n                    return False\n    \n        if self.__rep.match(fileName):\n            # check file is exclude or not\n            for file in self.__exclude:\n                if os.path.isfile(os.path.join(self.__root, file)):\n                    if self.samefile(realFilePath, os.path.join(self.__root, file)):\n                        return False\n        \n            return True\n    \n        return False\n\n\n    def __walk_collect_files(self, lst, dirname, names):\n        for name in names:\n            if self.__check_file_matchs(os.path.join(dirname, name)):\n                if type(lst) is types.ListType:\n                    lst += [os.path.abspath(os.path.join(dirname, name))]\n                 \n    def samefile(self, path1, path2):\n        return os.stat(path1) == os.stat(path2)\n\n    def set_root(self, root):\n        \"set the root path\"\n        self._root = root\n\n    def find_files(self, pathes, suffixes = (), exclude = ()):\n        \"find files in pathes(a list) with suffixes. It will not collect files your specified in exclude. all of these pathes passed in must be relative to root\"\n        lst = []\n        \n        # rep generate with params to search the files\n        repStr = cStringIO.StringIO()\n        repStr.write(\".+\")\n        for i, suffix in enumerate(suffixes):\n            if i == 0:\n                repStr.write(\"\\.(?:(?:\")\n            else:\n                repStr.write(\"|(?:\")\n\n            repStr.write(suffix)\n\n            if i == len(suffixes) - 1:\n                repStr.write(\"))$\")\n            else:\n                repStr.write(\")\")\n\n        self.__rep = re.compile(repStr.getvalue())\n        repStr.close()\n        self.__exclude = exclude\n        \n        # find files\n        for path in pathes:\n            path = os.path.join(self.__root, path)\n            if os.path.isdir(path):\n                os.path.walk(path, self.__walk_collect_files, lst)\n            else:\n                lst += [os.path.abspath(path)]\n\n        return lst\n"
  },
  {
    "path": "cocos2d/tools/pylib/__init__.py",
    "content": ""
  },
  {
    "path": "cocos2d/tools/tojs/README.mdown",
    "content": "How to Use bindings-generator\n==================\n\nOn Windows:\n------------\n\n* Make sure that you have installed `android-ndk-r9b`.\n* Download python2.7.3 (32bit) from (http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi).\n* Add the installed path of python (e.g. C:\\Python27) to windows environment variable named 'PATH'.\n* Download pyyaml from http://pyyaml.org/download/pyyaml/PyYAML-3.10.win32-py2.7.exe and install it.\n* Download pyCheetah from https://raw.github.com/dumganhar/cocos2d-x/download/downloads/Cheetah.zip, unzip it to \"C:\\Python27\\Lib\\site-packages\"\n* Set environment variables (`PYTHON_ROOT` and `NDK_ROOT`) or just modify variables (`PYTHON_ROOT` and `NDK_ROOT`) in `genbindings-win32.bat`.\n* Go to \"cocos2d-x/tools/tojs\" folder, and run \"genbindings-win32.bat\". The generated codes will be under \"cocos\\scripting\\auto-generated\\js-bindings\".\n\nOn MAC:\n----------\n\n* Please refer to https://github.com/cocos2d/bindings-generator/blob/develop/README.md\n\n"
  },
  {
    "path": "cocos2d/tools/tojs/cocos2dx.ini",
    "content": "[cocos2d-x]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = cc\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h \n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak TextFieldTTF EGLViewProtocol EGLView Component __NodeRGBA __LayerRGBA SAXParser\n\nclasses_need_extend = Node Layer.* Sprite MenuItemFont Scene DrawNode\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = Node::[^setPosition$ setGLServerState description getUserObject .*UserData getGLServerState .*schedule setContentSize setAnchorPoint],\n        Sprite::[getQuad getBlendFunc ^setPosition$ setBlendFunc],\n        NodeGrid::[setGrid],\n        SpriteBatchNode::[getBlendFunc setBlendFunc getDescendants],\n        MotionStreak::[getBlendFunc setBlendFunc draw update],\n        AtlasNode::[getBlendFunc setBlendFunc],\n        ParticleBatchNode::[getBlendFunc setBlendFunc],\n        LayerColor::[getBlendFunc setBlendFunc],\n        ParticleSystem::[getBlendFunc setBlendFunc],\n        DrawNode::[getBlendFunc setBlendFunc drawPolygon listenBackToForeground],\n        Director::[getAccelerometer (g|s)et.*Dispatcher getOpenGLView getProjection getFrustum getRenderer],\n        Layer.*::[didAccelerate (g|s)etBlendFunc keyPressed keyReleased],\n        Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns],\n        MenuItem.*::[create setCallback initWithCallback],\n        Copying::[*],\n        LabelProtocol::[*],\n        LabelTextFormatProtocol::[*],\n        Label::[getLettersInfo createWithTTF setTTFConfig],\n        .*Delegate::[*],\n        PoolManager::[*],\n        Texture2D::[initWithPVRTCData addPVRTCImage releaseData setTexParameters initWithData keepData getPixelFormatInfoMap],\n        Set::[begin end acceptVisitor],\n        IMEDispatcher::[*],\n        Thread::[*],\n        Profiler::[*],\n        ProfilingTimer::[*],\n        CallFunc::[create initWithFunction],\n        SAXParser::[(?!(init))],\n        SAXDelegator::[*],\n        Color3bObject::[*],\n        TouchDispatcher::[*],\n        EGLTouchDelegate::[*],\n        ScriptEngineManager::[*],\n        KeypadHandler::[*],\n        Invocation::[*],\n        EGLView::[end swapBuffers],\n        EGLViewProtocol::[(?!setDesignResolutionSize|getVisibleSize|getVisibleOrigin)],\n        SchedulerScriptHandlerEntry::[*],\n        Size::[*],\n        Point::[*],\n        PointArray::[*],\n        Rect::[*],\n        String::[*],\n        Data::[*],\n        Dictionary::[*],\n        Array::[*],\n        Range::[*],\n        NotificationObserver::[*],\n        Image::[initWithString initWithImageData],\n        Sequence::[create],\n        Spawn::[create],\n        Animation::[create],\n        GLProgram::[getProgram setUniformLocationWith2f.* setUniformLocationWith1f.* setUniformLocationWith3f.* setUniformLocationWith4f.*],\n        Grid3DAction::[create actionWith.* vertex originalVertex (g|s)etVertex getOriginalVertex],\n        Grid3D::[vertex originalVertex (g|s)etVertex getOriginalVertex],\n        TiledGrid3DAction::[create actionWith.* tile originalTile getOriginalTile (g|s)etTile],\n        TiledGrid3D::[tile originalTile getOriginalTile (g|s)etTile],\n        TMXLayer::[getTiles],\n        TMXMapInfo::[startElement endElement textHandler],\n        ParticleSystemQuad::[postStep setBatchNode draw setTexture$ setTotalParticles updateQuadWithParticle setupIndices listenBackToForeground initWithTotalParticles particleWithFile node],\n        LayerMultiplex::[create layerWith.* initWithLayers],\n        CatmullRom.*::[create actionWithDuration],\n        Bezier.*::[create actionWithDuration],\n        CardinalSpline.*::[create actionWithDuration setPoints],\n        Scheduler::[pause resume unschedule schedule update isTargetPaused],\n        TextureCache::[addPVRTCImage addImageAsync],\n        Timer::[getSelector createWithScriptHandler],\n        *::[copyWith.* onEnter.* onExit.* ^description$ getObjectType onTouch.* onAcc.* onKey.* onRegisterTouchListener],\n        FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getFileData getDataFromFile getWritablePath setPopupNotify destroyInstance getFullPathCache],\n        Application::[^application.* ^run$],\n        Camera::[getEyeXYZ getCenterXYZ getUpXYZ],\n        ccFontDefinition::[*],\n        NewTextureAtlas::[*],\n        RenderTexture::[listenToBackground listenToForeground]\n\nrename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame],\n    MenuItemFont::[setFontNameObj=setFontName setFontSizeObj=setFontSize getFontSizeObj=getFontSize getFontNameObj=getFontName],\n    ProgressTimer::[setReverseProgress=setReverseDirection],\n    AnimationCache::[addAnimationsWithFile=addAnimations],\n    LayerGradient::[initWithColor=init],\n    LayerColor::[initWithColor=init],\n    GLProgram::[initWithVertexShaderByteArray=initWithString initWithVertexShaderFilename=init programLog=getProgramLog setUniformLocationWith1i=setUniformLocationI32],\n    Node::[removeFromParentAndCleanup=removeFromParent removeAllChildrenWithCleanup=removeAllChildren getLocalZOrder=getZOrder setLocalZOrder=setZOrder],\n    LabelAtlas::[create=_create],\n    Sprite::[initWithFile=init],\n    SpriteBatchNode::[initWithFile=init removeAllChildrenWithCleanup=removeAllChildren],\n    Touch::[getID=getId],\n    SimpleAudioEngine::[preloadBackgroundMusic=preloadMusic setBackgroundMusicVolume=setMusicVolume getBackgroundMusicVolume=getMusicVolume playBackgroundMusic=playMusic stopBackgroundMusic=stopMusic pauseBackgroundMusic=pauseMusic resumeBackgroundMusic=resumeMusic rewindBackgroundMusic=rewindMusic isBackgroundMusicPlaying=isMusicPlaying willPlayBackgroundMusic=willPlayMusic],\n    FileUtils::[loadFilenameLookupDictionaryFromFile=loadFilenameLookup]\n\nrename_classes = ParticleSystemQuad::ParticleSystem,\n           SimpleAudioEngine::AudioEngine,\n           __NodeRGBA::NodeRGBA,\n           __LayerRGBA::LayerRGBA\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = Node Director SimpleAudioEngine FileUtils TMXMapInfo Application EGLViewProtocol SAXParser\n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object Clonable\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label EGLViewProtocol EGLView Component SAXParser\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tojs/cocos2dx_builder.ini",
    "content": "[cocos2dx_builder]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_builder\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = cc\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/editor-support/cocosbuilder/CocosBuilder.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = CCBReader.* CCBAnimationManager.*\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = CCBReader::[^CCBReader$ addOwnerCallbackName isJSControlled readByte getCCBMemberVariableAssigner readFloat getCCBSelectorResolver toLowerCase lastPathComponent deletePathExtension endsWith concat getResolutionScale getAnimatedProperties readBool readInt addOwnerCallbackNode addDocumentCallbackName readCachedString readNodeGraphFromData addDocumentCallbackNode getLoadedSpriteSheet initWithData readFileWithCleanUp getOwner$ readNodeGraphFromFile createSceneWithNodeGraphFromFile getAnimationManagers$ setAnimationManagers],\n        CCBAnimationManager::[setAnimationCompletedCallback addNode],\n        .*Delegate::[*],\n        .*Loader.*::[*],\n        *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener]\n\nrename_functions = \n\nrename_classes = CCBReader::_Reader,\n           CCBAnimationManager::BuilderAnimationManager\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = \n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes =\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tojs/cocos2dx_extension.ini",
    "content": "[cocos2dx_extension]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_extension\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = cc\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/extensions/cocos-ext.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = AssetsManager.* Scale9Sprite Control.* ControlButton.* ScrollView$ TableView$ TableViewCell$ EditBox$\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = ScrollView::[(g|s)etDelegate$],\n        .*Delegate::[*],\n        .*Loader.*::[*],\n        *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener],\n        EditBox::[(g|s)etDelegate ^keyboard.* touchDownAction getScriptEditBoxHandler registerScriptEditBoxHandler unregisterScriptEditBoxHandler],\n        TableView::[create (g|s)etDataSource$ (g|s)etDelegate],\n        AssetsManager::[(g|s)etDelegate],\n        AssetsManagerDelegateProtocol::[*],\n        Control::[removeHandleOfControlEvent addHandleOfControlEvent],\n        ControlUtils::[*],\n        ControlSwitchSprite::[*],\n        ActionManagerEx::[initWithDictionary],\n        ActionNode::[initWithDictionary],\n        ActionObject::[initWithDictionary]\n\nrename_functions = \n\nrename_classes =\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = \n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes =\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\nclasses_need_extend = ScrollView TableView TableViewCell\n"
  },
  {
    "path": "cocos2d/tools/tojs/cocos2dx_gui.ini",
    "content": "[cocos2dx_gui]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_gui\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = ccui\n\n# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as \"cocos2d::Label\" <-> \"cocos2d::gui::Label\".\ncpp_namespace = cocos2d::gui\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/gui/CocosGUI.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = Helper Layout Widget Layer Button CheckBox ImageView Text TextAtlas TextBMFont LoadingBar Slider Switch TextField ScrollView PageView ListView LayoutParameter LinearLayoutParameter RelativeLayoutParameter\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener (s|g)etBlendFunc ccTouch.*],\n        Widget::[(s|g)etUserObject],\n        Layer::[getInputManager],\n        LayoutParameter::[(s|g)etMargin],\n        ImageView::[doubleClickEvent checkDoubleClick]\n\nrename_functions = \n\nrename_classes =\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = Helper\n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = Helper\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tojs/cocos2dx_spine.ini",
    "content": "[cocos2dx_spine]\nprefix = cocos2dx_spine\n\ntarget_namespace = sp\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\nheaders = %(cocosdir)s/cocos/editor-support/spine/spine-cocos2dx.h\n\nskip = Skeleton::[createWithData],\n\t\tSkeletonAnimation::[createWithData]\n\nclasses = Skeleton SkeletonAnimation\n\nremove_prefix = \n\nclasses_have_no_parents =\n\nbase_classes_to_skip =\n\nabstract_classes =\n\nscript_control_cpp =\n\nrename_functions =\n\nrename_classes ="
  },
  {
    "path": "cocos2d/tools/tojs/cocos2dx_studio.ini",
    "content": "[cocos2dx_studio]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_studio\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = ccs\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = Armature ArmatureAnimation Skin Bone ColliderDetector ColliderBody ArmatureDataManager InputDelegate ComController ComAudio ComAttribute ComRender ActionManagerEx SceneReader GUIReader BatchNode ActionObject BaseData Tween ColliderFilter DisplayManager\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener (s|g)etBlendFunc (s|g)etUserObject ccTouch.*],\n        InputDelegate::[didAccelerate on.*],\n        GUIReader::[storeFileDesignSize getFileDesignSize],\n        ComAttribute::[getDict],\n        BatchNode::[init draw],\n        Armature::[createBone updateBlendType getBody setBody getShapeList .*BlendFunc],\n        Skin::[getSkinData setSkinData],\n        ArmatureAnimation::[updateHandler updateFrameData frameEvent (s|g)etAnimationData setMovementEventCallFunc setFrameEventCallFunc],\n        ArmatureDataManager::[getTextureDatas],\n        ActionManagerEx::[initWithDictionary],\n        Bone::[getTweenData getBoneData],\n        BaseData::[copy subtract],\n        ColliderFilter::[updateShape],\n        Tween::[(s|g)etMovementBoneData],\n        DisplayManager::[initDisplayList (s|g)etCurrentDecorativeDisplay getDecorativeDisplayByIndex],\n        ActionNode::[initWithDictionary],\n        ActionObject::[initWithDictionary],\n        ColliderDetector::[addContourData.* removeContourData],\n        ColliderBody::[getContourData getCalculatedVertexList],\n        SceneReader::[setTarget]\n\nrename_functions = ActionManagerEx::[shareManager=getInstance purgeActionManager=purge],\n              SceneReader::[purgeSceneReader=purge],\n              GUIReader::[shareReader=getInstance purgeGUIReader=purge]\n\nrename_classes = ActionManagerEx::ActionManager\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = InputDelegate SceneReader\n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object ProcessBase\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = ColliderDetector ColliderBody ArmatureDataManager ComAttribute InputDelegate ComRender ComAudio InputDelegate ActionManagerEx SceneReader GUIReader BatchNode ColliderFilter\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\nclasses_need_extend = Armature ComController\n"
  },
  {
    "path": "cocos2d/tools/tojs/genbindings-win32.bat",
    "content": "@echo off\n\n:: This script is used to generate jsbinding glue codes.\n:: Android ndk version must be ndk-r9b.\n\nsetlocal\n:: You should modify PYTHON_ROOT and NDK_ROOT to work under your environment.\n:: or just uncomment the follow 2 lines and set them.\n\n:: set PYTHON_ROOT=C:/Python27\n:: set NDK_ROOT=G:/android/android-ndk-r9b\n\nsetlocal ENABLEEXTENSIONS\nif %errorlevel% neq 0 (\n    echo Unable to enable extensions\n    exit /b 1\n    )\n\nif defined PYTHON_ROOT (echo PYTHON_ROOT is defined.) else (\n    echo PYTHON_ROOT is NOT defined!\n    exit /b 1\n    )\n\nif defined NDK_ROOT (echo NDK_ROOT is defined.) else (\n    echo NDK_ROOT is NOT defined!\n    exit /b 1\n    )\n\n:: Check use 32-bit or 64-bit\n:: Assume 64-bit\nset TEMP=windows-x86_64\nif not exist \"%NDK_ROOT%/toolchains/llvm-3.3/prebuilt/%TEMP%\" set TEMP=\n:: Otherwise fall back to 32-bit make\nif \"%TEMP%\"==\"\" set TEMP=windows\n\nset NDK_LLVM_ROOT=%NDK_ROOT%/toolchains/llvm-3.3/prebuilt/%TEMP%\n\nset COCOS2DX_ROOT=%cd%/../..\nset \"COCOS2DX_ROOT=%COCOS2DX_ROOT:\\=/%\"\nset CXX_GENERATOR_ROOT=%COCOS2DX_ROOT%/tools/bindings-generator\nset TO_JS_ROOT=%COCOS2DX_ROOT%/tools/tojs\nset \"CXX_GENERATOR_ROOT=%CXX_GENERATOR_ROOT:\\=/%\"\nset OUTPUT_DIR=%COCOS2DX_ROOT%/cocos/scripting/auto-generated/js-bindings\nset \"OUTPUT_DIR=%OUTPUT_DIR:/=\\%\"\n\nset PATH=%PATH%;%CXX_GENERATOR_ROOT%/libclang;%CXX_GENERATOR_ROOT%/tools/win32;%PYTHON_ROOT%\n\n:: write userconf.ini\n\nset _CONF_INI_FILE=%cd%\\userconf.ini\nif exist %_CONF_INI_FILE% del /Q %_CONF_INI_FILE%\n\n\necho \necho generating userconf.ini...\necho ---\necho [DEFAULT] > %_CONF_INI_FILE%\necho androidndkdir=%NDK_ROOT% >> %_CONF_INI_FILE%\necho clangllvmdir=%NDK_LLVM_ROOT% >> %_CONF_INI_FILE%\necho cocosdir=%COCOS2DX_ROOT% >> %_CONF_INI_FILE%\necho cxxgeneratordir=%CXX_GENERATOR_ROOT% >> %_CONF_INI_FILE%\n:: fixme: to fix parse error, we must difine __WCHAR_MAX__ and undefine __MINGW32__ .\necho extra_flags=-D__WCHAR_MAX__=0x7fffffff -U__MINGW32__ >> %_CONF_INI_FILE%\necho ---\n\n\n\n:: Generate bindings for cocos2dx\necho Generating bindings for cocos2dx...\npython %CXX_GENERATOR_ROOT%/generator.py %TO_JS_ROOT%/cocos2dx.ini -s cocos2d-x -t spidermonkey -o %OUTPUT_DIR% -n js_cocos2dx_auto\nif %errorlevel% neq 0 goto ERROR\n\necho \"Generating bindings for cocos2dx_extension...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_JS_ROOT%/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o %OUTPUT_DIR% -n js_cocos2dx_extension_auto\nif %errorlevel% neq 0 goto ERROR\n\necho \"Generating bindings for cocos2dx_builder...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_JS_ROOT%/cocos2dx_builder.ini -s cocos2dx_builder -t spidermonkey -o %OUTPUT_DIR% -n jsb_cocos2dx_builder_auto\nif %errorlevel% neq 0 goto ERROR\n\necho \"Generating bindings for cocos2dx_gui...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_JS_ROOT%/cocos2dx_gui.ini -s cocos2dx_gui -t spidermonkey -o %OUTPUT_DIR% -n js_cocos2dx_gui_auto\nif %errorlevel% neq 0 goto ERROR\n\n\necho \"Generating bindings for cocos2dx_studio...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_JS_ROOT%/cocos2dx_studio.ini -s cocos2dx_studio -t spidermonkey -o %OUTPUT_DIR% -n js_cocos2dx_studio_auto\nif %errorlevel% neq 0 goto ERROR\n\n\necho \"Generating bindings for cocos2dx_spine...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_JS_ROOT%/cocos2dx_spine.ini -s cocos2dx_spine -t spidermonkey -o %OUTPUT_DIR% -n js_cocos2dx_spine_auto\nif %errorlevel% neq 0 goto ERROR\n\n\n:: Change the generated file format from DOS to UNIX.\npushd \"%OUTPUT_DIR%\"\ndos2unix *\npopd\n\ngoto PASS\n\n:PASS\necho ---------------------------------\necho Generating bindings succeeds.\necho ---------------------------------\nendlocal\nexit /b 0\n\n:ERROR\necho ---------------------------------\necho Generating bindings fails.\necho ---------------------------------\nendlocal\nexit /b 1\n\n"
  },
  {
    "path": "cocos2d/tools/tojs/genbindings.sh",
    "content": "#!/bin/bash\n#\n# Usage:\n#   export NDK_ROOT=/path/to/ndk-r9b\n#   ./genbindings.sh\n#\n\n# exit this script if any commmand fails\nset -e\n\n# read user.cfg if it exists and is readable\n\n_CFG_FILE=$(dirname \"$0\")\"/user.cfg\"\nif [ -f \"$_CFG_FILE\" ];\nthen\n    if [ ! -r \"$_CFG_FILE\" ]; then\n       echo \"Fatal Error: $_CFG_FILE exists but is unreadable\"\n       exit 1\n    fi\nfi\n\n# paths\n\nif [ -z \"${NDK_ROOT+aaa}\" ]; then\n# ... if NDK_ROOT is not set, use \"$HOME/bin/android-ndk\"\n    NDK_ROOT=\"$HOME/bin/android-ndk\"\nfi\n\nif [ -z \"${PYTHON_BIN+aaa}\" ]; then\n# ... if PYTHON_BIN is not set, use \"/usr/bin/python2.7\"\n    PYTHON_BIN=\"/usr/bin/python2.7\"\nfi\n\n# find current dir\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\n# paths with defaults hardcoded to relative paths\n\nif [ -z \"${COCOS2DX_ROOT+aaa}\" ]; then\n    COCOS2DX_ROOT=\"$DIR/../..\"\nfi\n\nif [ -z \"${CXX_GENERATOR_ROOT+aaa}\" ]; then\n    CXX_GENERATOR_ROOT=\"$COCOS2DX_ROOT/tools/bindings-generator\"\nfi\n\nif [ -z \"${TOJS_ROOT+aaa}\" ]; then\n    TOJS_ROOT=\"$COCOS2DX_ROOT/tools/tojs\"\nfi\n\n# set output dir\nOUTPUT_DIR=${COCOS2DX_ROOT}/cocos/scripting/auto-generated/js-bindings\n\necho \"Paths\"\necho \"    NDK_ROOT: $NDK_ROOT\"\necho \"    PYTHON_BIN: $PYTHON_BIN\"\necho \"    COCOS2DX_ROOT: $COCOS2DX_ROOT\"\necho \"    CXX_GENERATOR_ROOT: $CXX_GENERATOR_ROOT\"\necho \"    TOJS_ROOT: $TOJS_ROOT\"\n\n# check NDK version, must be r9b\nif ! grep -q r9b $NDK_ROOT/RELEASE.TXT\nthen\n    echo \" Fatal Error: NDK r9b must be required!\"\n    exit 1\nfi\n\n# check clang include path\nOS_NAME=$('uname')\nNDK_LLVM_ROOT=$NDK_ROOT/toolchains/llvm-3.3/prebuilt\ncase \"$OS_NAME\" in\n    Darwin | darwin)\n        echo \"in darwin\"\n        if [ -d \"$NDK_LLVM_ROOT/darwin-x86_64\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/darwin-x86_64\n        elif [ -d \"$NDK_LLVM_ROOT/darwin-x86\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/darwin-x86\n        else\n            echo $NDK_LLVM_ROOT\n            echo \" Fatal Error: $NDK_LLVM_ROOT doesn't contains prebuilt llvm 3.3\"\n            exit 1\n        fi\n        ;;\n    Linux | linux)\n        echo \"in linux\"\n        if [ -d \"$NDK_LLVM_ROOT/linux-x86_64\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/linux-x86_64\n        elif [ -d \"$NDK_LLVM_ROOT/linux-x86\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/linux-x86\n        else\n            echo \" Fatal Error: $NDK_LLVM_ROOT doesn't contains prebuilt llvm 3.3\"\n            exit 1\n        fi\n        ;;\n    *)\n        echo \" Fatal Error: Please run this script in linux or mac osx.\"\n        exit 1\n        ;;\nesac\n\n\n# write userconf.ini\n\n_CONF_INI_FILE=\"$PWD/userconf.ini\"\nif [ -f \"$_CONF_INI_FILE\" ]\nthen\n    rm \"$_CONF_INI_FILE\"\nfi\n\n_CONTENTS=\"\"\n_CONTENTS+=\"[DEFAULT]\"'\\n'\n_CONTENTS+=\"androidndkdir=$NDK_ROOT\"'\\n'\n_CONTENTS+=\"clangllvmdir=$NDK_LLVM_ROOT\"'\\n'\n_CONTENTS+=\"cocosdir=$COCOS2DX_ROOT\"'\\n'\n_CONTENTS+=\"cxxgeneratordir=$CXX_GENERATOR_ROOT\"'\\n'\n_CONTENTS+=\"extra_flags=\"'\\n'\n\necho \necho \"generating userconf.ini...\"\necho ---\necho -e \"$_CONTENTS\"\necho -e \"$_CONTENTS\" > \"$_CONF_INI_FILE\"\necho ---\n\n# Generate bindings for cocos2dx\necho \"Generating bindings for cocos2dx...\"\nset -x\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOJS_ROOT}/cocos2dx.ini -s cocos2d-x -t spidermonkey -o ${OUTPUT_DIR}  -n jsb_cocos2dx_auto\n\necho \"Generating bindings for cocos2dx_extension...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOJS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o ${OUTPUT_DIR} -n jsb_cocos2dx_extension_auto\n\necho \"Generating bindings for cocos2dx_builder...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOJS_ROOT}/cocos2dx_builder.ini -s cocos2dx_builder -t spidermonkey -o ${OUTPUT_DIR} -n jsb_cocos2dx_builder_auto\n\necho \"Generating bindings for cocos2dx_gui...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOJS_ROOT}/cocos2dx_gui.ini -s cocos2dx_gui -t spidermonkey -o ${OUTPUT_DIR} -n jsb_cocos2dx_gui_auto\n\necho \"Generating bindings for cocos2dx_studio...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOJS_ROOT}/cocos2dx_studio.ini -s cocos2dx_studio -t spidermonkey -o ${OUTPUT_DIR} -n jsb_cocos2dx_studio_auto\n\necho \"Generating bindings for cocos2dx_spine...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOJS_ROOT}/cocos2dx_spine.ini -s cocos2dx_spine -t spidermonkey -o ${OUTPUT_DIR} -n jsb_cocos2dx_spine_auto\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/README.mdown",
    "content": "How to Use bindings-generator\n==================\n\nOn Windows:\n------------\n\n* Make sure that you have installed `android-ndk-r9b`.\n* Download python2.7.3 (32bit) from (http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi).\n* Add the installed path of python (e.g. C:\\Python27) to windows environment variable named 'PATH'.\n* Download pyyaml from http://pyyaml.org/download/pyyaml/PyYAML-3.10.win32-py2.7.exe and install it.\n* Download pyCheetah from https://raw.github.com/dumganhar/cocos2d-x/download/downloads/Cheetah.zip, unzip it to \"C:\\Python27\\Lib\\site-packages\"\n* Set environment variables (`PYTHON_ROOT` and `NDK_ROOT`) or just modify variables (`PYTHON_ROOT` and `NDK_ROOT`) in `genbindings-win32.bat`.\n* Go to \"cocos2d-x/tools/tolua\" folder, and run \"genbindings-win32.bat\". The generated codes will be under \"cocos\\scripting\\auto-generated\\lua-bindings\".\n\nOn MAC:\n----------\n\n* Please refer to https://github.com/cocos2d/bindings-generator/blob/develop/README.md\n\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/cocos2dx.ini",
    "content": "[cocos2d-x]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = cc\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h \n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Object$ UserDefault EGLViewProtocol EGLView Image Event(?!.*(Physics).*).* Component\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = Node::[setGLServerState description getUserObject .*UserData getGLServerState .*schedule getPosition$ setContentSize setAnchorPoint],\n        Sprite::[getQuad getBlendFunc ^setPosition$ setBlendFunc],\n        SpriteBatchNode::[getBlendFunc setBlendFunc getDescendants],\n        MotionStreak::[getBlendFunc setBlendFunc draw update],\n        AtlasNode::[getBlendFunc setBlendFunc],\n        ParticleBatchNode::[getBlendFunc setBlendFunc],\n        LayerColor::[getBlendFunc setBlendFunc],\n        ParticleSystem::[getBlendFunc setBlendFunc],\n        DrawNode::[getBlendFunc setBlendFunc drawPolygon listenBackToForeground],\n        Director::[getAccelerometer (g|s)et.*Dispatcher getOpenGLView getProjection getFrustum getRenderer],\n        Layer.*::[didAccelerate (g|s)etBlendFunc keyPressed keyReleased],\n        Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns],\n        MenuItem.*::[create setCallback initWithCallback],\n        Label::[getLettersInfo createWithTTF setTTFConfig],\n        Copying::[*],\n        LabelProtocol::[*],\n        LabelTextFormatProtocol::[*],\n        .*Delegate::[*],\n        PoolManager::[*],\n        Texture2D::[initWithPVRTCData addPVRTCImage releaseData setTexParameters initWithData keepData getPixelFormatInfoMap],\n        Set::[begin end acceptVisitor],\n        IMEDispatcher::[*],\n        SAXParser::[*],\n        Thread::[*],\n        Profiler::[*],\n        ProfilingTimer::[*],\n        CallFunc::[create initWithFunction],\n        SAXDelegator::[*],\n        Color3bObject::[*],\n        TouchDispatcher::[*],\n        EGLTouchDelegate::[*],\n        ScriptEngineManager::[*],\n        KeypadHandler::[*],\n        Invocation::[*],\n        SchedulerScriptHandlerEntry::[*],\n        Size::[*],\n        Point::[*],\n        PointArray::[*],\n        Rect::[*],\n        String::[*],\n        Data::[*],\n        Dictionary::[*],\n        Array::[*],\n        Range::[*],\n        EventListenerVector::[*],\n        EventListener.*::[create],\n        EventTouch::[(s|g)etTouches],\n        NotificationObserver::[*],\n        Image::[initWithString initWithImageData initWithRawData],\n        Sequence::[create],\n        Spawn::[create],\n        GLProgram::[getProgram setUniformLocationWith2f.* setUniformLocationWith1f.* setUniformLocationWith3f.* setUniformLocationWith4f.*],\n        Grid3DAction::[create actionWith.* vertex originalVertex (g|s)etVertex getOriginalVertex],\n        Grid3D::[vertex originalVertex (g|s)etVertex getOriginalVertex],\n        TiledGrid3DAction::[create actionWith.* tile originalTile getOriginalTile (g|s)etTile],\n        TiledGrid3D::[tile originalTile getOriginalTile (g|s)etTile],\n        TMXLayer::[getTiles],\n        TMXMapInfo::[startElement endElement textHandler],\n        ParticleSystemQuad::[postStep setBatchNode draw setTexture$ setTotalParticles updateQuadWithParticle setupIndices listenBackToForeground initWithTotalParticles particleWithFile node],\n        LayerMultiplex::[create layerWith.* initWithLayers],\n        CatmullRom.*::[create actionWithDuration],\n        Bezier.*::[create actionWithDuration],\n        CardinalSpline.*::[create actionWithDuration setPoints],\n        Scheduler::[pause resume unschedule schedule update isTargetPaused],\n        TextureCache::[addPVRTCImage addImageAsync],\n        Timer::[getSelector createWithScriptHandler],\n        *::[copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate onTouch.* onAcc.* onKey.* onRegisterTouchListener],\n        FileUtils::[(g|s)etSearchResolutionsOrder$ (g|s)etSearchPaths$ getFileData getDataFromFile getFullPathCache],\n        Application::[^application.* ^run$],\n        Camera::[getEyeXYZ getCenterXYZ getUpXYZ],\n        ccFontDefinition::[*],\n        Object::[autorelease isEqual acceptVisitor update],\n        UserDefault::[getInstance (s|g)etDataForKey],\n        EGLViewProtocol::[setTouchDelegate],\n        EGLView::[end swapBuffers],\n        NewTextureAtlas::[*],\n        DisplayLinkDirector::[mainLoop setAnimationInterval startAnimation stopAnimation],\n        RenderTexture::[listenToBackground listenToForeground]\n\nrename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame],\n    ProgressTimer::[setReverseProgress=setReverseDirection],\n    AnimationCache::[addAnimationsWithFile=addAnimations],\n    LayerGradient::[initWithColor=init],\n    LayerColor::[initWithColor=init],\n    GLProgram::[initWithVertexShaderByteArray=initWithString initWithVertexShaderFilename=init setUniformLocationWith1i=setUniformLocationI32],\n    Node::[removeFromParentAndCleanup=removeFromParent removeAllChildrenWithCleanup=removeAllChildren],\n    LabelAtlas::[create=_create],\n    Sprite::[initWithFile=init],\n    SpriteBatchNode::[initWithFile=init],\n    Touch::[getID=getId],\n    SimpleAudioEngine::[preloadBackgroundMusic=preloadMusic setBackgroundMusicVolume=setMusicVolume getBackgroundMusicVolume=getMusicVolume playBackgroundMusic=playMusic stopBackgroundMusic=stopMusic pauseBackgroundMusic=pauseMusic resumeBackgroundMusic=resumeMusic rewindBackgroundMusic=rewindMusic isBackgroundMusicPlaying=isMusicPlaying willPlayBackgroundMusic=willPlayMusic],\n    FileUtils::[loadFilenameLookupDictionaryFromFile=loadFilenameLookup],\n    Director::[end=endToLua]\n\nrename_classes = ParticleSystemQuad::ParticleSystem,\n           SimpleAudioEngine::AudioEngine\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = Director SimpleAudioEngine FileUtils TMXMapInfo Application\n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Clonable\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label EGLViewProtocol EGLView EventAcceleration DisplayLinkDirector Component\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/cocos2dx_extension.ini",
    "content": "[cocos2dx_extension]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_extension\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = cc\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/extensions/cocos-ext.h %(cocosdir)s/cocos/editor-support/cocosbuilder/CocosBuilder.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = AssetsManager.* CCBReader.* CCBAnimationManager.* Scale9Sprite Control.* ControlButton.* EditBox$ ScrollView$ TableView$ TableViewCell$\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = CCBReader::[^CCBReader$ addOwnerCallbackName isJSControlled readByte getCCBMemberVariableAssigner readFloat getCCBSelectorResolver toLowerCase lastPathComponent deletePathExtension endsWith concat getResolutionScale getAnimatedProperties readBool readInt addOwnerCallbackNode addDocumentCallbackName readCachedString readNodeGraphFromData addDocumentCallbackNode getLoadedSpriteSheet initWithData readFileWithCleanUp getOwner$ readNodeGraphFromFile createSceneWithNodeGraphFromFile getAnimationManagers$ setAnimationManagers],\n        CCBAnimationManager::[setAnimationCompletedCallback setCallFunc addNode],\n        .*Delegate::[*],\n        .*Loader.*::[*],\n        *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate .*HSV],\n        EditBox::[(g|s)etDelegate ^keyboard.* touchDownAction getScriptEditBoxHandler registerScriptEditBoxHandler unregisterScriptEditBoxHandler],\n        AssetsManager::[(g|s)etDelegate],\n        AssetsManagerDelegateProtocol::[*],\n        Control::[removeHandleOfControlEvent addHandleOfControlEvent],\n        ControlUtils::[*],\n        ControlSwitchSprite::[*],\n        ScrollView::[(g|s)etDelegate$],\n        TableView::[create (g|s)etDataSource$ (g|s)etDelegate]\n\n\nrename_functions = CCBReader::[getAnimationManager=getActionManager setAnimationManager=setActionManager]\n\nrename_classes = CCBReader::_Reader,\n           CCBAnimationManager::AnimationManager\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = \n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object ProcessBase\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = ArmatureDataManager\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/cocos2dx_gui.ini",
    "content": "[cocos2dx_gui]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_gui\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = ccui\n\n# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as \"cocos2d::Label\" <-> \"cocos2d::gui::Label\".\ncpp_namespace = cocos2d::gui\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/gui/CocosGUI.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = Helper Widget Layer Layout RootWidget Button CheckBox ImageView Text TextAtlas TextBMFont LoadingBar Slider Switch TextField ScrollView ListView PageView LayoutParameter LinearLayoutParameter RelativeLayoutParameter \n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* onAcc.* onKey.* onRegisterTouchListener (s|g)etBlendFunc ccTouch.*],\n        Widget::[(s|g)etUserObject],\n        Layer::[getInputManager],\n        LayoutParameter::[(s|g)etMargin],\n        Helper::[init],\n        ImageView::[doubleClickEvent checkDoubleClick]\n\nrename_functions = \n\nrename_classes =\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = Helper\n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = Helper\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/cocos2dx_physics.ini",
    "content": "[cocos2dx_physics]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_physics\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = cc\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/cocos/physics\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT -DCC_USE_PHYSICS=1\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/2d/cocos2d.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = Event(.*(Physics).*) Physics.*\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = PhysicsBody::[getJoints createPolygon createEdgeChain createEdgePolygon],\n       PhysicsShape::[recenterPoints getPolyonCenter],\n       PhysicsShapeBox::[^getPoints$],\n       PhysicsShapeEdgeBox::[^getPoints$],\n       PhysicsShapePolygon::[^getPoints$],\n       PhysicsShapeEdgePolygon::[^getPoints$],\n       PhysicsShapeEdgeChain::[^getPoints$],\n       PhysicsWorld::[getScene queryPoint queryRect rayCast],\n       PhysicsContact::[getData setData]\n       \n\nrename_functions = \n\nrename_classes = \n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = PhysicsWorld PhysicsJoint PhysicsContactPreSolve PhysicsContactPostSolve\n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip =\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = \n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/cocos2dx_spine.ini",
    "content": "[cocos2dx_spine]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_spine\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = sp\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/editor-support/spine/spine-cocos2dx.h\n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = Skeleton SkeletonAnimation\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip = Skeleton::[findBone findSlot getAttachment setAttachment update draw createWith.*],\n        SkeletonAnimation::[addAnimationState setAnimationStateData update createWith.* (s|g)etBlendFunc]\n\nrename_functions = \n\nrename_classes = \n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = \n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object ProcessBase\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = Skeleton SkeletonAnimation\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/cocos2dx_studio.ini",
    "content": "[cocos2dx_studio]\n# the prefix to be added to the generated functions. You might or might not use this in your own\n# templates\nprefix = cocos2dx_studio\n\n# create a target namespace (in javascript, this would create some code like the equiv. to `ns = ns || {}`)\n# all classes will be embedded in that namespace\ntarget_namespace = ccs\n\n# the native namespace in which this module locates, this parameter is used for avoid conflict of the same class name in different modules, as \"cocos2d::Label\" <-> \"cocos2d::gui::Label\".\ncpp_namespace = cocostudio\n\nandroid_headers = -I%(androidndkdir)s/platforms/android-14/arch-arm/usr/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -I%(androidndkdir)s/sources/cxx-stl/gnu-libstdc++/4.7/include\nandroid_flags = -D_SIZE_T_DEFINED_ \n\nclang_headers = -I%(clangllvmdir)s/lib/clang/3.3/include \nclang_flags = -nostdinc -x c++ -std=c++11\n\ncocos_headers = -I%(cocosdir)s/cocos -I%(cocosdir)s/cocos/2d -I%(cocosdir)s/cocos/base -I%(cocosdir)s/cocos/gui -I%(cocosdir)s/cocos/physics -I%(cocosdir)s/cocos/2d/platform -I%(cocosdir)s/cocos/2d/platform/android -I%(cocosdir)s/cocos/math/kazmath/include -I%(cocosdir)s/extensions -I%(cocosdir)s/external -I%(cocosdir)s/cocos/editor-support -I%(cocosdir)s\n\ncocos_flags = -DANDROID -DCOCOS2D_JAVASCRIPT\n\ncxxgenerator_headers = \n\n# extra arguments for clang\nextra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s \n\n# what headers to parse\nheaders = %(cocosdir)s/cocos/editor-support/cocostudio/CocoStudio.h \n\n# what classes to produce code for. You can use regular expressions here. When testing the regular\n# expression, it will be enclosed in \"^$\", like this: \"^Menu*$\".\nclasses = Armature ArmatureAnimation Skin Bone ArmatureDataManager \\w+Data$ ActionManagerEx ComAudio ComController ComAttribute ComRender BatchNode SceneReader GUIReader ActionObject Tween DisplayManager\n\n# what should we skip? in the format ClassName::[function function]\n# ClassName is a regular expression, but will be used like this: \"^ClassName$\" functions are also\n# regular expressions, they will not be surrounded by \"^$\". If you want to skip a whole class, just\n# add a single \"*\" as functions. See bellow for several examples. A special class name is \"*\", which\n# will apply to all class names. This is a convenience wildcard to be able to skip similar named\n# functions from all classes.\n\nskip =  *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .*HSV onTouch.* (s|g)etBlendFunc (s|g)etUserObject add\\w*EventListener],\n        ArmatureDataManager::[CCArmatureDataManager ~CCArmatureDataManager],\n        Armature::[createBone updateBlendType setBody getShapeList ^getBody$],\n        Skin::[(s|g)etSkinData],\n        ArmatureAnimation::[updateHandler updateFrameData frameEvent setMovementEventCallFunc setFrameEventCallFunc],\n        Bone::[(s|g)etIgnoreMovementBoneData],\n        ActionManagerEx::[initWithDictionary],\n        ActionObject::[initWithDictionary],\n        DisplayManager::[initDisplayList (s|g)etCurrentDecorativeDisplay getDecorativeDisplayByIndex],\n        Tween::[(s|g)etMovementBoneData],\n        GUIReader::[storeFileDesignSize getFileDesignSize],\n        ActionNode::[initWithDictionary],\n        ActionObject::[initWithDictionary],\n        BaseData::[copy subtract]\n\nrename_functions =  GUIReader::[shareReader=getInstance purgeGUIReader=destroyInstance],\n                    ActionManagerEx::[shareManager=getInstance purgeActionManager=destroyInstance],\n                    SceneReader::[purgeSceneReader=destroyInstance]\n\n\nrename_classes =\n\n# for all class names, should we remove something when registering in the target VM?\nremove_prefix = \n\n# classes for which there will be no \"parent\" lookup\nclasses_have_no_parents = \n\n# base classes which will be skipped when their sub-classes found them.\nbase_classes_to_skip = Object ProcessBase\n\n# classes that create no constructor\n# Set is special and we will use a hand-written constructor\nabstract_classes = ArmatureDataManager ComAttribute ComRender ComAudio ActionManagerEx SceneReader GUIReader BatchNode\n\n# Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'.\nscript_control_cpp = no\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/genbindings-win32.bat",
    "content": "@echo off\n\n:: This script is used to generate jsbinding glue codes.\n:: Android ndk version must be ndk-r9b.\n\nsetlocal\n:: You should modify PYTHON_ROOT and NDK_ROOT to work under your environment.\n:: or just uncomment the follow 2 lines and set them.\n\n:: set PYTHON_ROOT=C:/Python27\n:: set NDK_ROOT=G:/android/android-ndk-r9b\n\nsetlocal ENABLEEXTENSIONS\nif %errorlevel% neq 0 (\n    echo Unable to enable extensions\n    exit /b 1\n    )\n\nif defined PYTHON_ROOT (echo PYTHON_ROOT is defined.) else (\n    echo PYTHON_ROOT is NOT defined!\n    exit /b 1\n    )\n\nif defined NDK_ROOT (echo NDK_ROOT is defined.) else (\n    echo NDK_ROOT is NOT defined!\n    exit /b 1\n    )\n\n:: Check use 32-bit or 64-bit\n:: Assume 64-bit\nset TEMP=windows-x86_64\nif not exist \"%NDK_ROOT%/toolchains/llvm-3.3/prebuilt/%TEMP%\" set TEMP=\n:: Otherwise fall back to 32-bit make\nif \"%TEMP%\"==\"\" set TEMP=windows\n\nset NDK_LLVM_ROOT=%NDK_ROOT%/toolchains/llvm-3.3/prebuilt/%TEMP%\n\nset COCOS2DX_ROOT=%cd%/../..\nset \"COCOS2DX_ROOT=%COCOS2DX_ROOT:\\=/%\"\nset CXX_GENERATOR_ROOT=%COCOS2DX_ROOT%/tools/bindings-generator\nset TO_LUA_ROOT=%COCOS2DX_ROOT%/tools/tolua\nset \"CXX_GENERATOR_ROOT=%CXX_GENERATOR_ROOT:\\=/%\"\nset OUTPUT_DIR=%COCOS2DX_ROOT%/cocos/scripting/auto-generated/lua-bindings\nset \"OUTPUT_DIR=%OUTPUT_DIR:/=\\%\"\n\nset PATH=%PATH%;%CXX_GENERATOR_ROOT%/libclang;%CXX_GENERATOR_ROOT%/tools/win32;%PYTHON_ROOT%\n\n:: write userconf.ini\n\nset _CONF_INI_FILE=%cd%\\userconf.ini\nif exist %_CONF_INI_FILE% del /Q %_CONF_INI_FILE%\n\n\necho \necho generating userconf.ini...\necho ---\necho [DEFAULT] > %_CONF_INI_FILE%\necho androidndkdir=%NDK_ROOT% >> %_CONF_INI_FILE%\necho clangllvmdir=%NDK_LLVM_ROOT% >> %_CONF_INI_FILE%\necho cocosdir=%COCOS2DX_ROOT% >> %_CONF_INI_FILE%\necho cxxgeneratordir=%CXX_GENERATOR_ROOT% >> %_CONF_INI_FILE%\n:: fixme: to fix parse error, we must difine __WCHAR_MAX__ and undefine __MINGW32__ .\necho extra_flags=-D__WCHAR_MAX__=0x7fffffff -U__MINGW32__ >> %_CONF_INI_FILE%\necho ---\n\n\n\n:: Generate bindings for cocos2dx\necho Generating bindings for cocos2dx...\npython %CXX_GENERATOR_ROOT%/generator.py %TO_LUA_ROOT%/cocos2dx.ini -s cocos2d-x -t lua -o %OUTPUT_DIR% -n lua_cocos2dx_auto\nif %errorlevel% neq 0 goto ERROR\n\necho \"Generating bindings for cocos2dx_extension...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_LUA_ROOT%/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o %OUTPUT_DIR% -n lua_cocos2dx_extension_auto\nif %errorlevel% neq 0 goto ERROR\n\necho \"Generating bindings for cocos2dx_gui...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_LUA_ROOT%/cocos2dx_gui.ini -s cocos2dx_gui -t lua -o %OUTPUT_DIR% -n lua_cocos2dx_gui_auto\nif %errorlevel% neq 0 goto ERROR\n\n\necho \"Generating bindings for cocos2dx_studio...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_LUA_ROOT%/cocos2dx_studio.ini -s cocos2dx_studio -t lua -o %OUTPUT_DIR% -n lua_cocos2dx_studio_auto\nif %errorlevel% neq 0 goto ERROR\n\n\necho \"Generating bindings for cocos2dx_spine...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_LUA_ROOT%/cocos2dx_spine.ini -s cocos2dx_spine -t lua -o %OUTPUT_DIR% -n lua_cocos2dx_spine_auto\nif %errorlevel% neq 0 goto ERROR\n\n\necho \"Generating bindings for cocos2dx_physics...\"\npython %CXX_GENERATOR_ROOT%/generator.py %TO_LUA_ROOT%/cocos2dx_physics.ini -s cocos2dx_physics -t lua -o %OUTPUT_DIR% -n lua_cocos2dx_physics_auto\nif %errorlevel% neq 0 goto ERROR\n\n\n:: Change the generated file format from DOS to UNIX.\npushd \"%OUTPUT_DIR%\"\ndos2unix *\npopd\n\ngoto PASS\n\n:PASS\necho ---------------------------------\necho Generating bindings succeeds.\necho ---------------------------------\nendlocal\nexit /b 0\n\n:ERROR\necho ---------------------------------\necho Generating bindings fails.\necho ---------------------------------\nendlocal\nexit /b 1\n\n"
  },
  {
    "path": "cocos2d/tools/tolua/genbindings.sh",
    "content": "#!/bin/bash\n#\n# Usage:\n#   export NDK_ROOT=/path/to/ndk-r9b\n#   ./genbindings.sh\n#\n\n# exit this script if any commmand fails\nset -e\n\n# read user.cfg if it exists and is readable\n\n_CFG_FILE=$(dirname \"$0\")\"/user.cfg\"\nif [ -f \"$_CFG_FILE\" ];\nthen\n    if [ ! -r \"$_CFG_FILE\" ]; then\n       echo \"Fatal Error: $_CFG_FILE exists but is unreadable\"\n       exit 1\n    fi\nfi\n\n# paths\n\nif [ -z \"${NDK_ROOT+aaa}\" ]; then\n# ... if NDK_ROOT is not set, use \"$HOME/bin/android-ndk\"\n    NDK_ROOT=\"$HOME/bin/android-ndk\"\nfi\n\nif [ -z \"${PYTHON_BIN+aaa}\" ]; then\n# ... if PYTHON_BIN is not set, use \"/usr/bin/python2.7\"\n    PYTHON_BIN=\"/usr/bin/python2.7\"\nfi\n\n# find current dir\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\n# paths with defaults hardcoded to relative paths\n\nif [ -z \"${COCOS2DX_ROOT+aaa}\" ]; then\n    COCOS2DX_ROOT=\"$DIR/../..\"\nfi\n\nif [ -z \"${CXX_GENERATOR_ROOT+aaa}\" ]; then\n    CXX_GENERATOR_ROOT=\"$COCOS2DX_ROOT/tools/bindings-generator\"\nfi\n\nif [ -z \"${TOLUA_ROOT+aaa}\" ]; then\n    TOLUA_ROOT=\"$COCOS2DX_ROOT/tools/tolua\"\nfi\n\n# set output dir\nOUTPUT_DIR=${COCOS2DX_ROOT}/cocos/scripting/auto-generated/lua-bindings\n\necho \"Paths\"\necho \"    NDK_ROOT: $NDK_ROOT\"\necho \"    PYTHON_BIN: $PYTHON_BIN\"\necho \"    COCOS2DX_ROOT: $COCOS2DX_ROOT\"\necho \"    CXX_GENERATOR_ROOT: $CXX_GENERATOR_ROOT\"\necho \"    TOLUA_ROOT: $TOLUA_ROOT\"\n\n# check NDK version, must be r9b\nif ! grep -q r9b $NDK_ROOT/RELEASE.TXT\nthen\n    echo \" Fatal Error: NDK r9b must be required!\"\n    exit 1\nfi\n\n# check clang include path\nOS_NAME=$('uname')\nNDK_LLVM_ROOT=$NDK_ROOT/toolchains/llvm-3.3/prebuilt\ncase \"$OS_NAME\" in\n    Darwin | darwin)\n        echo \"in darwin\"\n        if [ -d \"$NDK_LLVM_ROOT/darwin-x86_64\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/darwin-x86_64\n        elif [ -d \"$NDK_LLVM_ROOT/darwin-x86\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/darwin-x86\n        else\n            echo $NDK_LLVM_ROOT\n            echo \" Fatal Error: $NDK_LLVM_ROOT doesn't contains prebuilt llvm 3.3\"\n            exit 1\n        fi\n        ;;\n    Linux | linux)\n        echo \"in linux\"\n        if [ -d \"$NDK_LLVM_ROOT/linux-x86_64\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/linux-x86_64\n        elif [ -d \"$NDK_LLVM_ROOT/linux-x86\" ]; then\n            NDK_LLVM_ROOT=$NDK_LLVM_ROOT/linux-x86\n        else\n            echo \" Fatal Error: $NDK_LLVM_ROOT doesn't contains prebuilt llvm 3.3\"\n            exit 1\n        fi\n        ;;\n    *)\n        echo \" Fatal Error: Please run this script in linux or mac osx.\"\n        exit 1\n        ;;\nesac\n\n\n# write userconf.ini\n\n_CONF_INI_FILE=\"$PWD/userconf.ini\"\nif [ -f \"$_CONF_INI_FILE\" ]\nthen\n    rm \"$_CONF_INI_FILE\"\nfi\n\n_CONTENTS=\"\"\n_CONTENTS+=\"[DEFAULT]\"'\\n'\n_CONTENTS+=\"androidndkdir=$NDK_ROOT\"'\\n'\n_CONTENTS+=\"clangllvmdir=$NDK_LLVM_ROOT\"'\\n'\n_CONTENTS+=\"cocosdir=$COCOS2DX_ROOT\"'\\n'\n_CONTENTS+=\"cxxgeneratordir=$CXX_GENERATOR_ROOT\"'\\n'\n_CONTENTS+=\"extra_flags=\"'\\n'\n\necho \necho \"generating userconf.ini...\"\necho ---\necho -e \"$_CONTENTS\"\necho -e \"$_CONTENTS\" > \"$_CONF_INI_FILE\"\necho ---\n\n# Generate bindings for cocos2dx\necho \"Generating bindings for cocos2dx...\"\nset -x\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOLUA_ROOT}/cocos2dx.ini -s cocos2d-x -t lua -o ${OUTPUT_DIR} -n lua_cocos2dx_auto\n\necho \"Generating bindings for cocos2dx_extension...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOLUA_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${OUTPUT_DIR} -n lua_cocos2dx_extension_auto\n\necho \"Generating bindings for cocos2dx_gui...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOLUA_ROOT}/cocos2dx_gui.ini -s cocos2dx_gui -t lua -o ${OUTPUT_DIR} -n lua_cocos2dx_gui_auto\n\necho \"Generating bindings for cocos2dx_studio...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOLUA_ROOT}/cocos2dx_studio.ini -s cocos2dx_studio -t lua -o ${OUTPUT_DIR} -n lua_cocos2dx_studio_auto\n\necho \"Generating bindings for cocos2dx_spine...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOLUA_ROOT}/cocos2dx_spine.ini -s cocos2dx_spine -t lua -o ${OUTPUT_DIR} -n lua_cocos2dx_spine_auto\n\necho \"Generating bindings for cocos2dx_physics...\"\nLD_LIBRARY_PATH=${CXX_GENERATOR_ROOT}/libclang $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TOLUA_ROOT}/cocos2dx_physics.ini -s cocos2dx_physics -t lua -o ${OUTPUT_DIR} -n lua_cocos2dx_physics_auto\n\n"
  },
  {
    "path": "cocos2d/tools/travis-scripts/before-install.sh",
    "content": "#!/bin/bash\n\n# exit this script if any commmand fails\nset -e\n\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nCOCOS2DX_ROOT=\"$DIR\"/../..\nHOST_NAME=\"\"\n\nmkdir -p $HOME/bin\ncd $HOME/bin\n\ninstall_android_ndk()\n{\n    # Download android ndk\n    if [ \"$PLATFORM\"x = \"ios\"x ]; then\n        HOST_NAME=\"darwin\"\n    else\n        HOST_NAME=\"linux\"\n    fi\n    echo \"Download android-ndk-r9b-${HOST_NAME}-x86_64.tar.bz2 ...\"\n    curl -O http://dl.google.com/android/ndk/android-ndk-r9b-${HOST_NAME}-x86_64.tar.bz2\n    echo \"Decompress android-ndk-r9b-${HOST_NAME}-x86_64.tar.bz2 ...\"\n    tar xjf android-ndk-r9b-${HOST_NAME}-x86_64.tar.bz2\n    # Rename ndk\n    mv android-ndk-r9b android-ndk\n}\n\ninstall_nacl_sdk()\n{\n    # NaCl compilers are built for 32-bit linux so we need to install\n    # the runtime support for this.\n    if [ ! -e \"/lib/ld-linux.so.2\" ]; then\n        sudo apt-get update\n        sudo apt-get install libc6:i386 libstdc++6:i386\n    fi\n    if [ ! -d nacl_sdl ]; then\n        echo \"Download nacl_sdk ...\"\n        wget http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip\n        echo \"Decompress nacl_sdk.zip\"\n        unzip nacl_sdk.zip\n    fi\n    nacl_sdk/naclsdk update --force pepper_canary\n}\n\nif [ \"$GEN_JSB\"x = \"YES\"x ]; then\n    if [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ]; then\n        exit 0\n    fi\n    install_android_ndk\nelif [ \"$PLATFORM\"x = \"linux\"x ]; then\n    sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test\n    # OpenMW team provides SDL2 package.\n    sudo apt-add-repository -y ppa:openmw/build\n    sudo apt-get update\n    sudo apt-get install gcc-4.7 g++-4.7\n    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6\n    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 90 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7\n    g++ --version\n    bash $COCOS2DX_ROOT/build/install-deps-linux.sh\n    install_android_ndk\nelif [ \"$PLATFORM\"x = \"nacl\"x ]; then\n    install_nacl_sdk\nelif [ \"$PLATFORM\"x = \"android\"x ]; then\n    install_android_ndk\nelif [ \"$PLATFORM\"x = \"emscripten\"x ]; then\n    sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm\n    install_android_ndk\nelif [ \"$PLATFORM\"x = \"ios\"x ]; then\n    install_android_ndk\n\n    pushd $COCOS2DX_ROOT\n    git submodule add https://github.com/facebook/xctool.git ./xctool\n    git submodule init\n    git submodule update\n    popd\nelse\n    echo \"Unknown \\$PLATFORM: '$PLATFORM'\"\n    exit 1\nfi\n\n"
  },
  {
    "path": "cocos2d/tools/travis-scripts/generate-jsbindings.sh",
    "content": "#!/bin/bash\n\n# Generate JS and Lua bindings for Cocos2D-X\n# ... using Android NDK system headers\n# ... and automatically update submodule references\n# ... and push these changes to remote repos\n\n# Dependencies\n#\n# For bindings generator:\n# (see ../../../tojs/genbindings.sh and ../../../tolua/genbindings.sh\n# ... for the defaults used if the environment is not customized)\n#\n#  * $PYTHON_BIN\n#  * $CLANG_ROOT\n#  * $NDK_ROOT\n#\n\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nCOCOS2DX_ROOT=\"$DIR\"/../..\nTOJS_ROOT=$COCOS2DX_ROOT/tools/tojs\nTOLUA_ROOT=$COCOS2DX_ROOT/tools/tolua\nGENERATED_WORKTREE=\"$COCOS2DX_ROOT\"/cocos/scripting/auto-generated\nCOMMITTAG=\"[AUTO]\"\n\n# Exit on error\nset -e\n\nif [ \"$PLATFORM\"x = \"ios\"x ]; then\n    mkdir -p $HOME/bin\n    pushd $HOME/bin\n    curl -O http://pyyaml.org/download/pyyaml/PyYAML-3.10.zip\n    unzip PyYAML-3.10.zip 2> /dev/null > /dev/null\n    cd PyYAML-3.10\n    sudo python setup.py install 2> /dev/null > /dev/null\n    cd ..\n    curl -O https://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz\n    tar xzf Cheetah-2.4.4.tar.gz\n    cd Cheetah-2.4.4\n    sudo python setup.py install 2> /dev/null > /dev/null\n    popd\nelse\n    sudo apt-get --force-yes --yes install python-yaml python-cheetah\nfi\n\ngenerate_bindings_glue_codes()\n{\n    echo \"Create auto-generated jsbinding glue codes.\"\n    pushd \"$TOJS_ROOT\"\n    ./genbindings.sh\n    popd\n\n    echo \"Create auto-generated luabinding glue codes.\"\n    pushd \"$TOLUA_ROOT\"\n    ./genbindings.sh\n    popd\n}\n\nif [ \"$GEN_JSB\"x != \"YES\"x ]; then\n    generate_bindings_glue_codes\n    exit 0\nfi\n\npushd \"$COCOS2DX_ROOT\"\n#Set git user for cocos2d-x repo\ngit config user.email ${GH_EMAIL}\ngit config user.name ${GH_USER}\npopd\n\n# Update submodule of auto-gen Binding repo.\npushd \"$GENERATED_WORKTREE\"\n\ngit checkout -B master\necho \"Set git user for the submodule of ${GENERATED_WORKTREE}\"\ngit config user.email ${GH_EMAIL}\ngit config user.name ${GH_USER}\n#Set remotes\ngit remote add upstream https://${GH_USER}:${GH_PASSWORD}@github.com/cocos2d-x/bindings-auto-generated.git 2> /dev/null > /dev/null\n\necho \"Delete all directories and files except '.git' and 'README.md'.\"\nls -a | grep -E -v ^\\[.\\]\\{1,2\\}$ | grep -E -v ^\\.git$ | grep -E -v ^README\\.md$ | xargs -I{} rm -rf {}\necho \"Show files in ${GENERATED_WORKTREE} folder.\"\nls -a\npopd\n\n\n\n# 1. Generate JS bindings\ngenerate_bindings_glue_codes\n\necho\necho Bindings generated successfully\necho\n\n\nif [ -z \"${COMMITTAG+aaa}\" ]; then\n# ... if COMMITTAG is not set, use this machine's hostname\n    COMMITTAG=`hostname -s`\nfi\n\necho\necho Using \"'$COMMITTAG'\" in the commit messages\necho\n\nELAPSEDSECS=`date +%s`\necho Using \"$ELAPSEDSECS\" in the branch names for pseudo-uniqueness\n\nGENERATED_BRANCH=autogeneratedbindings_\"$ELAPSEDSECS\"\n\n\n# 2. In Bindings repo, Check if there are any files that are different from the index\n\npushd \"$GENERATED_WORKTREE\"\n\n# Run status to record the output in the log\ngit status\n\necho\necho Comparing with HEAD ...\necho\n\n# Don't exit on non-zero return value\nset +e\ngit diff --stat --exit-code\n\nDIFF_RETVAL=$?\nif [ $DIFF_RETVAL -eq 0 ]\nthen\n    echo\n    echo \"No differences in generated files\"\n    echo \"Exiting with success.\"\n    echo\n    exit 0\nelse\n    echo\n    echo \"Generated files differ from HEAD. Continuing.\"\n    echo\nfi\n\n# Exit on error\nset -e\n\n# 3. In Bindings repo, Check out a branch named \"autogeneratedbindings\" and commit the auto generated bindings to it\ngit checkout -b \"$GENERATED_BRANCH\"\ngit add --verbose .\ngit add --verbose -u .\ngit commit --verbose -m \"$COMMITTAG : autogenerated bindings\"\n\n# 4. In Bindings repo, Push the commit with generated bindings to \"master\" of the auto generated bindings repository\ngit push -fq upstream \"$GENERATED_BRANCH\":${TRAVIS_BRANCH}_${ELAPSEDSECS} 2> /dev/null\n\npopd\n\n\nCOCOS_BRANCH=updategeneratedsubmodule_\"$ELAPSEDSECS\"\n\npushd \"${DIR}\"\n\n# 5. In Cocos2D-X repo, Checkout a branch named \"updategeneratedsubmodule\" Update the submodule reference to point to the commit with generated bindings\ncd \"${COCOS2DX_ROOT}\"\ngit add ${GENERATED_WORKTREE}\ngit checkout -b \"$COCOS_BRANCH\"\ngit commit -m \"$COMMITTAG : updating submodule reference to latest autogenerated bindings\"\n#Set remotes\ngit remote add upstream https://${GH_USER}:${GH_PASSWORD}@github.com/${GH_USER}/cocos2d-x.git 2> /dev/null > /dev/null\n# 6. In Cocos2D-X repo, Push the commit with updated submodule to \"master\" of the cocos2d-x repository\necho \"Pushing to Robot's repo ...\"\ngit push -fq upstream \"$COCOS_BRANCH\" 2> /dev/null\n\n\n# 7. \necho \"Sending Pull Request to base repo ...\"\ncurl --user \"${GH_USER}:${GH_PASSWORD}\" --request POST --data \"{ \\\"title\\\": \\\"$COMMITTAG : updating submodule reference to latest autogenerated bindings\\\", \\\"body\\\": \\\"\\\", \\\"head\\\": \\\"${GH_USER}:${COCOS_BRANCH}\\\", \\\"base\\\": \\\"${TRAVIS_BRANCH}\\\"}\" https://api.github.com/repos/cocos2d/cocos2d-x/pulls 2> /dev/null > /dev/null\n\npopd\n"
  },
  {
    "path": "cocos2d/tools/travis-scripts/install_glfw.sh",
    "content": "#!/bin/bash\n\nGLFW_VERSION=\"3.0.4\"\nGLFW_SOURCE=\"https://codeload.github.com/glfw/glfw/tar.gz/${GLFW_VERSION}\"\nGLFW_ZIP=\"glfw${GLFW_VERSION}.tar.gz\"\nGLFW_INSTALL=\"glfw_install\"\nGLFW_SRCDIR=\"glfw-${GLFW_VERSION}\"\nGLFW_DESTDIR=\"glfw_dest\"\n\ninstall_glfw_dep()\n{\n  sudo apt-get install xorg-dev\n  sudo apt-get install libglu1-mesa-dev\n  sudo apt-get install cmake\n  sudo apt-get install curl\n}\n\nclean_tmp_file()\n{\n  rm -rf ${GLFW_INSTALL}\n}\n\nmake_and_install()\n{\n  mkdir $GLFW_DESTDIR\n  cd $GLFW_DESTDIR\n  cmake \"../${GLFW_SRCDIR}\" -G \"Unix Makefiles\" -DBUILD_SHARED_LIBS=ON\n  make\n  sudo make install\n  sudo ldconfig\n  cd ..\n}\n\ninstall_glfw()\n{\n  echo glw_version ${GLFW_VERSION}\n  echo glfw_download_size ${GLFW_SOURCE}\n  echo glfw_zip_file ${GLFW_ZIP}\n  install_glfw_dep\n  mkdir $GLFW_INSTALL\n  cd $GLFW_INSTALL\n  curl -o $GLFW_ZIP $GLFW_SOURCE\n  tar xzf ${GLFW_ZIP}\n  make_and_install\n  cd ..\n  clean_tmp_file\n}\n\n\ninstall_glfw\n\n"
  },
  {
    "path": "cocos2d/tools/travis-scripts/run-script.sh",
    "content": "#!/bin/bash\n# exit this script if any commmand fails\nset -e\n\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nCOCOS2DX_ROOT=\"$DIR\"/../..\n\nif [ \"$GEN_JSB\"x = \"YES\"x ]; then\n    # Re-generation of the javascript bindings can perform push of the new\n    # version back to github.  We don't do this for pull requests, or if\n    # GH_USER/GH_EMAIL/GH_PASSWORD environment variables are not set correctly\n    # by the encoded variables in the .travis.yml file.  (e.g. if cloned repo's\n    # want to use travis).\n    if [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ]; then\n        exit 0\n    fi\n    if [ -z \"${GH_EMAIL}\" ]; then\n        echo \"GH_EMAIL not set\"\n        exit 0\n    fi\n    if [ -z \"${GH_USER}\" ]; then\n        echo \"GH_USER not set\"\n        exit 0\n    fi\n    if [ -z \"${GH_PASSWORD}\" ]; then\n        echo \"GH_USER not set\"\n        exit 0\n    fi\n    export NDK_ROOT=$HOME/bin/android-ndk\n    cd $COCOS2DX_ROOT/tools/travis-scripts\n    ./generate-jsbindings.sh\nelif [ \"$PLATFORM\"x = \"android\"x ]; then\n    export NDK_ROOT=$HOME/bin/android-ndk\n\n    # Generate binding glue codes\n    echo \"Generating bindings glue codes ...\"\n    cd $COCOS2DX_ROOT/tools/travis-scripts\n    ./generate-jsbindings.sh\n\n    cd $COCOS2DX_ROOT\n\n    # Create a directory for temporary objects\n    mkdir android_build_objs\n\n    PROJECTS=(\"Cpp/HelloCpp\" \"Cpp/TestCpp\" \"Cpp/SimpleGame\" \"Cpp/AssetsManagerTest\" \"Javascript/TestJavascript\" \"Javascript/CocosDragonJS\" \"Javascript/CrystalCraze\" \"Javascript/MoonWarriors\" \"Javascript/WatermelonWithMe\" \"Lua/HelloLua\" \"Lua/TestLua\")\n    for i in ${PROJECTS[*]}; do\n        ln -s $COCOS2DX_ROOT/android_build_objs $COCOS2DX_ROOT/samples/$i/proj.android/obj\n    done\n\n    # Build all samples\n    echo \"Building all samples ...\"\n    cd $COCOS2DX_ROOT/build\n    ./android-build.py -n \"NDK_BUG=0 -j10\" all\n\n    # Build template\n    # echo \"Building template ...\"\n    # cd $COCOS2DX_ROOT/template\n    # build_android multi-platform-cpp\n    # build_android multi-platform-js\n    # build_android multi-platform-lua\n\nelif [ \"$PLATFORM\"x = \"nacl\"x ]; then\n    export NACL_SDK_ROOT=$HOME/bin/nacl_sdk/pepper_canary\n    export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_x86_newlib/bin\n    export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_arm_newlib/bin\n    cd $COCOS2DX_ROOT/build\n    make -j4\nelif [ \"$PLATFORM\"x = \"linux\"x ]; then\n    # Generate binding glue codes\n    echo \"Generating bindings glue codes ...\"\n    cd $COCOS2DX_ROOT/tools/travis-scripts\n    ./generate-jsbindings.sh\n\n    cd $COCOS2DX_ROOT/build\n    mkdir -p linux-build\n    cd linux-build\n    cmake ../..\n    make -j10\n    # build template\n    echo \"Building template projects for linux ...\"\n    cd $COCOS2DX_ROOT/tools/project-creator\n    ./create_project.py -n MyGameCpp -k com.MyCompany.AwesomeGameCpp -l cpp -p $HOME\n    ./create_project.py -n MyGameLua -k com.MyCompany.AwesomeGameLua -l lua -p $HOME\n    cd $HOME/MyGameCpp\n    mkdir build\n    cd build\n    cmake ..\n    make -j10\n\n    cd $HOME/MyGameLua\n    mkdir build\n    cd build\n    cmake ..\n    make -j10\n\nelif [ \"$PLATFORM\"x = \"emscripten\"x ]; then\n    # Generate binding glue codes\n    echo \"Generating bindings glue codes ...\"\n    cd $COCOS2DX_ROOT/tools/travis-scripts\n    ./generate-jsbindings.sh\n\n    cd $COCOS2DX_ROOT/build\n    export PYTHON=/usr/bin/python\n    export LLVM=$HOME/bin/clang+llvm-3.2/bin\n    export LLVM_ROOT=$LLVM\n    EMCC_DEBUG=1 make PLATFORM=emscripten -j 8\nelif [ \"$PLATFORM\"x = \"ios\"x ]; then\n    cd $COCOS2DX_ROOT/tools/travis-scripts\n    ./generate-jsbindings.sh\n\n    cd $COCOS2DX_ROOT\n    xctool/xctool.sh -project samples/Cpp/HelloCpp/proj.ios/HelloCpp.xcodeproj -scheme HelloCpp test\n    xctool/xctool.sh -project samples/Cpp/SimpleGame/proj.ios/SimpleGame.xcodeproj -scheme SimpleGame test\n    xctool/xctool.sh -project samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj -scheme TestCpp test\n    #xctool/xctool.sh -project samples/Cpp/AssetsManagerTest/proj.ios/AssetsManagerTest.xcodeproj -scheme AssetsManagerTest test\n    #xctool/xctool.sh -project samples/Javascript/CocosDragonJS/proj.ios/CocosDragonJS.xcodeproj -scheme CocosDragonJS test\n    #xctool/xctool.sh -project samples/Javascript/CrystalCraze/proj.ios/CrystalCraze.xcodeproj -scheme CrystalCraze test\n    xctool/xctool.sh -project samples/Javascript/MoonWarriors/proj.ios/MoonWarriors.xcodeproj -scheme MoonWarriors test\n    xctool/xctool.sh -project samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj -scheme TestJavascript test\n    #xctool/xctool.sh -project samples/Javascript/WatermelonWithMe/proj.ios/WatermelonWithMe.xcodeproj -scheme WatermelonWithMe test\n    xctool/xctool.sh -project samples/Lua/HelloLua/proj.ios/HelloLua.xcodeproj -scheme HelloLua test\n    xctool/xctool.sh -project samples/Lua/TestLua/proj.ios/TestLua.xcodeproj -scheme TestLua test\nelse\n    echo \"Unknown \\$PLATFORM: '$PLATFORM'\"\n    exit 1\nfi\n"
  },
  {
    "path": "cocos2d/tools/travis-scripts/travis_mac.yml",
    "content": "language: objective-c\nscript:\n - export PYTHON_BIN=/usr/bin/python\n - ./tools/travis-scripts/run-script.sh\nbefore_install:\n - ./tools/travis-scripts/before-install.sh\nenv:\n  - PLATFORM=ios\nbranches:\n  only:\n    - mac-travis\n"
  },
  {
    "path": "proj.android/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "proj.android/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>FlappyBird</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "proj.android/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      package=\"com.crosslife.FlappyBird\"\n      android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <uses-sdk android:minSdkVersion=\"9\"/>\n    <uses-feature android:glEsVersion=\"0x00020000\" />\n\n    <application android:label=\"@string/app_name\"\n                 android:icon=\"@drawable/icon\">\n        <activity android:name=\"org.cocos2dx.lua.Cocos2dxActivity\"\n                  android:label=\"@string/app_name\"\n                  android:screenOrientation=\"portrait\"\n                  android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"\n                  android:configChanges=\"orientation\">\n\n            <!-- Tell NativeActivity the name of our .so -->\n            <meta-data android:name=\"android.app.lib_name\"\n                       android:value=\"cocos2dlua\" />\n\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>       \n\n        \n        <meta-data android:name=\"com.google.android.gms.version\"\n               android:value=\"@integer/google_play_services_version\"/>\n\t\t<activity android:name=\"com.google.android.gms.ads.AdActivity\"\n         android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\"/>\n    </application>\n\n    <supports-screens android:anyDensity=\"true\"\n                      android:smallScreens=\"true\"\n                      android:normalScreens=\"true\"\n                      android:largeScreens=\"true\"\n                      android:xlargeScreens=\"true\"/>\n    <uses-permission android:name=\"android.permission.INTERNET\"/>\n  \t<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n</manifest> \n"
  },
  {
    "path": "proj.android/ant.properties",
    "content": "# This file is used to override default values used by the Ant build system.\n#\n# This file must be checked into Version Control Systems, as it is\n# integral to the build system of your project.\n\n# This file is only used by the Ant script.\n\n# You can use this to override default values such as\n#  'source.dir' for the location of your java source folder and\n#  'out.dir' for the location of your output folder.\n\n# You can also use it define how the release builds are signed by declaring\n# the following properties:\n#  'key.store' for the location of your keystore and\n#  'key.alias' for the name of the key to use.\n# The password will be asked during the build when you use the 'release' target.\n\n"
  },
  {
    "path": "proj.android/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"FlappyBird\" default=\"help\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${sdk.dir}/tools/ant/build.xml\" />\n\n</project>\n"
  },
  {
    "path": "proj.android/build_native.py",
    "content": "#!/usr/bin/python\n# build_native.py\n# Build native codes\n\n\nimport sys\nimport os, os.path\nimport shutil\nfrom optparse import OptionParser\n\ndef get_num_of_cpu():\n\t''' The build process can be accelerated by running multiple concurrent job processes using the -j-option.\n\t'''\n\ttry:\n\t\tplatform = sys.platform\n\t\tif platform == 'win32':\n\t\t\tif 'NUMBER_OF_PROCESSORS' in os.environ:\n\t\t\t\treturn int(os.environ['NUMBER_OF_PROCESSORS'])\n\t\t\telse:\n\t\t\t\treturn 1\n\t\telse:\n\t\t\tfrom numpy.distutils import cpuinfo\n\t\t\treturn cpuinfo.cpu._getNCPUs()\n\texcept Exception:\n\t\tprint \"Can't know cpuinfo, use default 1 cpu\"\n\t\treturn 1\n\t\t\ndef check_environment_variables_sdk():\n    ''' Checking the environment ANDROID_SDK_ROOT, which will be used for building\n    '''\n\n    try:\n        SDK_ROOT = os.environ['ANDROID_SDK_ROOT']\n    except Exception:\n        print \"ANDROID_SDK_ROOT not defined. Please define ANDROID_SDK_ROOT in your environment\"\n        sys.exit(1)\n\n    return SDK_ROOT\n\ndef check_environment_variables():\n    ''' Checking the environment NDK_ROOT, which will be used for building\n    '''\n\n    try:\n        NDK_ROOT = os.environ['NDK_ROOT']\n    except Exception:\n        print \"NDK_ROOT not defined. Please define NDK_ROOT in your environment\"\n        sys.exit(1)\n\n    return NDK_ROOT\n\ndef select_toolchain_version():\n    '''Because ndk-r8e uses gcc4.6 as default. gcc4.6 doesn't support c++11. So we should select gcc4.7 when\n    using ndk-r8e. But gcc4.7 is removed in ndk-r9, so we should determine whether gcc4.7 exist.\n    Conclution:\n    ndk-r8e  -> use gcc4.7\n    ndk-r9   -> use gcc4.8\n    '''\n\n    ndk_root = check_environment_variables()\n    if os.path.isdir(os.path.join(ndk_root,\"toolchains/arm-linux-androideabi-4.8\")):\n        os.environ['NDK_TOOLCHAIN_VERSION'] = '4.8'\n        print \"The Selected NDK toolchain version was 4.8 !\"\n    elif os.path.isdir(os.path.join(ndk_root,\"toolchains/arm-linux-androideabi-4.7\")):\n        os.environ['NDK_TOOLCHAIN_VERSION'] = '4.7'\n        print \"The Selected NDK toolchain version was 4.7 !\"\n    else:\n        print \"Couldn't find the gcc toolchain.\"\n        exit(1)\n\ndef do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode):\n\n    ndk_path = os.path.join(ndk_root, \"ndk-build\")\n\n    # windows should use \";\" to seperate module paths\n    platform = sys.platform\n    if platform == 'win32':\n        ndk_module_path = 'NDK_MODULE_PATH=%s;%s/external;%s/cocos' % (cocos_root, cocos_root, cocos_root)\n    else:\n        ndk_module_path = 'NDK_MODULE_PATH=%s:%s/external:%s/cocos' % (cocos_root, cocos_root, cocos_root)\n\n    num_of_cpu = get_num_of_cpu()\n\t\n    if ndk_build_param == None:\n        command = '%s -j%d -C %s %s' % (ndk_path, num_of_cpu, app_android_root, ndk_module_path)\n    else:\n        command = '%s -j%d -C %s %s %s' % (ndk_path, num_of_cpu, app_android_root, ''.join(str(e) for e in ndk_build_param), ndk_module_path)\n    if os.system(command) != 0:\n        raise Exception(\"Build dynamic library for project [ \" + app_android_root + \" ] fails!\")\n    elif android_platform is not None:\n    \t  sdk_tool_path = os.path.join(sdk_root, \"tools/android\")\n    \t  cocoslib_path = os.path.join(cocos_root, \"cocos/2d/platform/android/java\")\n    \t  command = '%s update lib-project -t %s -p %s' % (sdk_tool_path,android_platform,cocoslib_path) \n    \t  if os.system(command) != 0:\n    \t  \t  raise Exception(\"update cocos lib-project [ \" + cocoslib_path + \" ] fails!\")  \t  \n    \t  command = '%s update project -t %s -p %s -s' % (sdk_tool_path,android_platform,app_android_root)\n    \t  if os.system(command) != 0:\n    \t  \t  raise Exception(\"update project [ \" + app_android_root + \" ] fails!\")    \t  \t  \n    \t  buildfile_path = os.path.join(app_android_root, \"build.xml\")\n    \t  command = 'ant clean %s -f %s -Dsdk.dir=%s' % (build_mode,buildfile_path,sdk_root)\n    \t  os.system(command)\n\ndef copy_files(src, dst):\n\n    for item in os.listdir(src):\n        path = os.path.join(src, item)\n        # Android can not package the file that ends with \".gz\"\n        if not item.startswith('.') and not item.endswith('.gz') and os.path.isfile(path):\n            shutil.copy(path, dst)\n        if os.path.isdir(path):\n            new_dst = os.path.join(dst, item)\n            os.mkdir(new_dst)\n            copy_files(path, new_dst)\n\ndef copy_resources(app_android_root):\n\n    # remove app_android_root/assets if it exists\n    assets_dir = os.path.join(app_android_root, \"assets\")\n    if os.path.isdir(assets_dir):\n        shutil.rmtree(assets_dir)\n\n    # copy resources\n    os.mkdir(assets_dir)\n    resources_dir = os.path.join(app_android_root, \"../Resources\")\n    if os.path.isdir(resources_dir):\n        copy_files(resources_dir, assets_dir)\n\n    # lua project should copy lua script\n    resources_dir = os.path.join(app_android_root, \"../cocos2d/cocos/scripting/lua/script\")\n    copy_files(resources_dir, assets_dir)\n\ndef build(ndk_build_param,android_platform,build_mode):\n\n    ndk_root = check_environment_variables()\n    sdk_root = None\n    select_toolchain_version()\n\n    current_dir = os.path.dirname(os.path.realpath(__file__))\n    cocos_root = os.path.join(current_dir, \"../cocos2d\")\n\n    app_android_root = current_dir\n    copy_resources(app_android_root)\n    \n    if android_platform is not None:\n\t\t\t\tsdk_root = check_environment_variables_sdk()\n\t\t\t\tif android_platform.isdigit():\n\t\t\t\t\t\tandroid_platform = 'android-'+android_platform\n\t\t\t\telse:\n\t\t\t\t\t\tprint 'please use vaild android platform'\n\t\t\t\t\t\texit(1)\n\t\t\n    if build_mode is None:\n    \t  build_mode = 'debug'\n    elif build_mode != 'release':\n        build_mode = 'debug'\n    \n    do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)\n\n# -------------- main --------------\nif __name__ == '__main__':\n\n    parser = OptionParser()\n    parser.add_option(\"-n\", \"--ndk\", dest=\"ndk_build_param\", help='parameter for ndk-build')\n    parser.add_option(\"-p\", \"--platform\", dest=\"android_platform\", \n    help='parameter for android-update.Without the parameter,the script just build dynamic library for project. Valid android-platform are:[10|11|12|13|14|15|16|17|18|19]')\n    parser.add_option(\"-b\", \"--build\", dest=\"build_mode\", \n    help='the build mode for java project,debug[default] or release.Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html')\n    (opts, args) = parser.parse_args()\n    \n    build(opts.ndk_build_param,opts.android_platform,opts.build_mode)\n"
  },
  {
    "path": "proj.android/google-play-services_lib/.classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/.project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>google-play-services_lib</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/.settings/org.eclipse.jdt.core.prefs",
    "content": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.compliance=1.6\norg.eclipse.jdt.core.compiler.source=1.6\n"
  },
  {
    "path": "proj.android/google-play-services_lib/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.google.android.gms\"\n    android:versionCode=\"4242030\"\n    android:versionName=\"4.2.42 (1018832-030)\" >\n\n    <uses-sdk android:minSdkVersion=\"9\"/>\n\n</manifest>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/README.txt",
    "content": "Library Project including Google Play services client jar.\n\nThis can be used by an Android project to use the API's provided\nby Google Play services.\n\nThere is technically no source, but the src folder is necessary\nto ensure that the build system works. The content is actually\nlocated in the libs/ directory.\n\n\nUSAGE:\n\nMake sure you import this Android library project into your IDE\nand set this project as a dependency.\n\nNote that if you use proguard, you will want to include the\noptions from proguard.txt in your configuration."
  },
  {
    "path": "proj.android/google-play-services_lib/build.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"google-play-services_lib\" default=\"help\">\n\n    <!-- The local.properties file is created and updated by the 'android' tool.\n         It contains the path to the SDK. It should *NOT* be checked into\n         Version Control Systems. -->\n    <property file=\"local.properties\" />\n\n    <!-- The ant.properties file can be created by you. It is only edited by the\n         'android' tool to add properties to it.\n         This is the place to change some Ant specific build properties.\n         Here are some properties you may want to change/update:\n\n         source.dir\n             The name of the source directory. Default is 'src'.\n         out.dir\n             The name of the output directory. Default is 'bin'.\n\n         For other overridable properties, look at the beginning of the rules\n         files in the SDK, at tools/ant/build.xml\n\n         Properties related to the SDK location or the project target should\n         be updated using the 'android' tool with the 'update' action.\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems.\n\n         -->\n    <property file=\"ant.properties\" />\n\n    <!-- if sdk.dir was not set from one of the property file, then\n         get it from the ANDROID_HOME env var.\n         This must be done before we load project.properties since\n         the proguard config can use sdk.dir -->\n    <property environment=\"env\" />\n    <condition property=\"sdk.dir\" value=\"${env.ANDROID_HOME}\">\n        <isset property=\"env.ANDROID_HOME\" />\n    </condition>\n\n    <!-- The project.properties file is created and updated by the 'android'\n         tool, as well as ADT.\n\n         This contains project specific properties such as project target, and library\n         dependencies. Lower level build properties are stored in ant.properties\n         (or in .classpath for Eclipse projects).\n\n         This file is an integral part of the build system for your\n         application and should be checked into Version Control Systems. -->\n    <loadproperties srcFile=\"project.properties\" />\n\n    <!-- quick check on sdk.dir -->\n    <fail\n            message=\"sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable.\"\n            unless=\"sdk.dir\"\n    />\n\n    <!--\n        Import per project custom build rules if present at the root of the project.\n        This is the place to put custom intermediary targets such as:\n            -pre-build\n            -pre-compile\n            -post-compile (This is typically used for code obfuscation.\n                           Compiled code location: ${out.classes.absolute.dir}\n                           If this is not done in place, override ${out.dex.input.absolute.dir})\n            -post-package\n            -post-build\n            -pre-clean\n    -->\n    <import file=\"custom_rules.xml\" optional=\"true\" />\n\n    <!-- Import the actual build file.\n\n         To customize existing targets, there are two options:\n         - Customize only one target:\n             - copy/paste the target into this file, *before* the\n               <import> task.\n             - customize it to your needs.\n         - Customize the whole content of build.xml\n             - copy/paste the content of the rules files (minus the top node)\n               into this file, replacing the <import> task.\n             - customize to your needs.\n\n         ***********************\n         ****** IMPORTANT ******\n         ***********************\n         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,\n         in order to avoid having your file be overridden by tools such as \"android update project\"\n    -->\n    <!-- version-tag: 1 -->\n    <import file=\"${sdk.dir}/tools/ant/build.xml\" />\n\n</project>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/libs/google-play-services.jar.properties",
    "content": "doc=../../../docs/reference\n"
  },
  {
    "path": "proj.android/google-play-services_lib/local.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must *NOT* be checked into Version Control Systems,\n# as it contains information specific to your local configuration.\n\n# location of the SDK. This is only used by Ant\n# For customization when using a Version Control System, please read the\n# header note.\nsdk.dir=D:\\\\Code\\\\android\\\\android-sdk-windows\n"
  },
  {
    "path": "proj.android/google-play-services_lib/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "proj.android/google-play-services_lib/proguard.txt",
    "content": "-keep class * extends java.util.ListResourceBundle {\n    protected Object[][] getContents();\n}\n\n# Keep SafeParcelable value, needed for reflection. This is required to support backwards\n# compatibility of some classes.\n-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {\n    public static final *** NULL;\n}\n\n# Keep the names of classes/members we need for client functionality.\n-keepnames @com.google.android.gms.common.annotation.KeepName class *\n-keepclassmembernames class * {\n    @com.google.android.gms.common.annotation.KeepName *;\n}\n\n# Needed for Parcelable/SafeParcelable Creators to not get stripped\n-keepnames class * implements android.os.Parcelable {\n    public static final ** CREATOR;\n}"
  },
  {
    "path": "proj.android/google-play-services_lib/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-10\nandroid.library=true\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/color/common_signin_btn_text_dark.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n        android:state_pressed=\"true\"\n        android:color=\"@color/common_signin_btn_dark_text_pressed\" />\n    <item\n        android:state_enabled=\"false\"\n        android:state_focused=\"true\"\n        android:color=\"@color/common_signin_btn_dark_text_disabled\" />\n    <item\n        android:state_focused=\"true\"\n        android:color=\"@color/common_signin_btn_dark_text_focused\" />\n    <item\n        android:state_enabled=\"false\"\n        android:color=\"@color/common_signin_btn_dark_text_disabled\" />\n    <item\n        android:color=\"@color/common_signin_btn_dark_text_default\" />\n</selector>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/color/common_signin_btn_text_light.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n        android:state_pressed=\"true\"\n        android:color=\"@color/common_signin_btn_light_text_pressed\" />\n    <item\n        android:state_enabled=\"false\"\n        android:state_focused=\"true\"\n        android:color=\"@color/common_signin_btn_light_text_disabled\" />\n    <item\n        android:state_focused=\"true\"\n        android:color=\"@color/common_signin_btn_light_text_focused\" />\n    <item\n        android:state_enabled=\"false\"\n        android:color=\"@color/common_signin_btn_light_text_disabled\" />\n    <item\n        android:color=\"@color/common_signin_btn_light_text_default\" />\n</selector>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/drawable/common_signin_btn_icon_dark.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n        android:state_pressed=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_icon_pressed_dark\" />\n    <item\n        android:state_enabled=\"false\"\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_icon_disabled_focus_dark\" />\n    <item\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_icon_focus_dark\" />\n    <item\n        android:state_enabled=\"false\"\n        android:drawable=\"@drawable/common_signin_btn_icon_disabled_dark\" />\n    <item\n        android:drawable=\"@drawable/common_signin_btn_icon_normal_dark\" />\n</selector>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/drawable/common_signin_btn_icon_light.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n        android:state_pressed=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_icon_pressed_light\" />\n    <item\n        android:state_enabled=\"false\"\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_icon_disabled_focus_light\" />\n    <item\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_icon_focus_light\" />\n    <item\n        android:state_enabled=\"false\"\n        android:drawable=\"@drawable/common_signin_btn_icon_disabled_light\" />\n    <item\n        android:drawable=\"@drawable/common_signin_btn_icon_normal_light\" />\n</selector>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/drawable/common_signin_btn_text_dark.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n        android:state_pressed=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_text_pressed_dark\" />\n    <item\n        android:state_enabled=\"false\"\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_text_disabled_focus_dark\" />\n    <item\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_text_focus_dark\" />\n    <item\n        android:state_enabled=\"false\"\n        android:drawable=\"@drawable/common_signin_btn_text_disabled_dark\" />\n    <item\n        android:drawable=\"@drawable/common_signin_btn_text_normal_dark\" />\n</selector>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/drawable/common_signin_btn_text_light.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item\n        android:state_pressed=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_text_pressed_light\" />\n    <item\n        android:state_enabled=\"false\"\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_text_disabled_focus_light\" />\n    <item\n        android:state_focused=\"true\"\n        android:drawable=\"@drawable/common_signin_btn_text_focus_light\" />\n    <item\n        android:state_enabled=\"false\"\n        android:drawable=\"@drawable/common_signin_btn_text_disabled_light\" />\n    <item\n        android:drawable=\"@drawable/common_signin_btn_text_normal_light\" />\n</selector>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values/ads_attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright 2013 Google Inc. All Rights Reserved. -->\n<resources>\n  <declare-styleable name=\"AdsAttrs\">\n    <!--\n    The size of the ad. It must be one of BANNER, FULL_BANNER, LEADERBOARD,\n    MEDIUM_RECTANGLE, SMART_BANNER, WIDE_SKYSCRAPER, or\n    &lt;width&gt;x&lt;height&gt;.\n    -->\n    <attr name=\"adSize\" format=\"string\"/>\n\n    <!--\n    A comma-separated list of the supported ad sizes. The sizes must be one of\n    BANNER, FULL_BANNER, LEADERBOARD, MEDIUM_RECTANGLE, SMART_BANNER,\n    WIDE_SKYSCRAPER, or &lt;width&gt;x&lt;height&gt;.\n    -->\n    <attr name=\"adSizes\" format=\"string\"/>\n\n    <!-- The ad unit ID. -->\n    <attr name=\"adUnitId\" format=\"string\"/>\n  </declare-styleable>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources>\n    <!-- Sign-in Button Colors -->\n    <color name=\"common_signin_btn_dark_text_default\">@android:color/white</color>\n    <color name=\"common_signin_btn_dark_text_pressed\">@android:color/white</color>\n    <color name=\"common_signin_btn_dark_text_disabled\">#FFAAAAAA</color>\n    <color name=\"common_signin_btn_dark_text_focused\">@android:color/white</color>\n    <color name=\"common_signin_btn_light_text_default\">#FF737373</color>\n    <color name=\"common_signin_btn_light_text_pressed\">@android:color/white</color>\n    <color name=\"common_signin_btn_light_text_disabled\">#FFAAAAAA</color>\n    <color name=\"common_signin_btn_light_text_focused\">#FF737373</color>\n    <color name=\"common_signin_btn_default_background\">#FFDD4B39</color>\n    <color name=\"common_action_bar_splitter\">#d2d2d2</color>\n</resources>"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values/maps_attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright 2012 Google Inc. All Rights Reserved. -->\n<resources>\n  <declare-styleable name=\"MapAttrs\">\n    <attr name=\"mapType\" format=\"enum\">\n      <enum name=\"none\" value=\"0\"/>\n      <enum name=\"normal\" value=\"1\"/>\n      <enum name=\"satellite\" value=\"2\"/>\n      <enum name=\"terrain\" value=\"3\"/>\n      <enum name=\"hybrid\" value=\"4\"/>\n    </attr>\n    <attr name=\"cameraBearing\" format=\"float\"/>\n    <attr name=\"cameraTargetLat\" format=\"float\"/>\n    <attr name=\"cameraTargetLng\" format=\"float\"/>\n    <attr name=\"cameraTilt\" format=\"float\"/>\n    <attr name=\"cameraZoom\" format=\"float\"/>\n    <attr name=\"uiCompass\" format=\"boolean\"/>\n    <attr name=\"uiRotateGestures\" format=\"boolean\"/>\n    <attr name=\"uiScrollGestures\" format=\"boolean\"/>\n    <attr name=\"uiTiltGestures\" format=\"boolean\"/>\n    <attr name=\"uiZoomControls\" format=\"boolean\"/>\n    <attr name=\"uiZoomGestures\" format=\"boolean\"/>\n    <attr name=\"useViewLifecycle\" format=\"boolean\"/>\n    <attr name=\"zOrderOnTop\" format=\"boolean\"/>\n  </declare-styleable>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n\n    <!-- Title of confirmation dialog informing user that they need to install\n        Google Play services (from Play Store) [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_install_title\" msgid=\"7215213145546190223\">Get Google Play services</string>\n\n    <!-- (For phones) Message in confirmation dialog informing user that\n        they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"2122112764540849864\">This app won\\'t run without Google Play services, which are missing from your phone.</string>\n\n    <!-- (For tablets) Message in confirmation dialog informing user that\n        they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"7351599665250191022\">This app won\\'t run without Google Play services, which are missing from your tablet.</string>\n\n    <!-- Button in confirmation dialog for installing Google Play services [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_install_button\" msgid=\"7153882981874058840\">Get Google Play services</string>\n\n    <!-- Title of confirmation dialog informing user they need to enable\n        Google Play services in application settings [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_enable_title\" msgid=\"5122002158466380389\">Enable Google Play services</string>\n\n    <!-- Message in confirmation dialog informing user they need to enable\n        Google Play services in application settings [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_enable_text\" msgid=\"227660514972886228\">This app won\\'t work unless you enable Google Play services.</string>\n\n    <!-- Button in confirmation dialog to enable Google Play services.  Clicking it\n        will direct user to application settings of Google Play services where they\n        can enable it [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_enable_button\" msgid=\"2523291102206661146\">Enable Google Play services</string>\n\n    <!-- Title of confirmation dialog informing user that they need to update\n        Google Play services (from Play Store) [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_update_title\" msgid=\"1788179980625863495\">Update Google Play services</string>\n\n    <!-- Message in confirmation dialog informing user that they need to update\n        Google Play services (from Play Store) [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_update_text\" msgid=\"9053896323427875356\">This app won\\'t run unless you update Google Play services.</string>\n\n    <!-- Title of confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_network_error_title\">Network Error</string>\n\n    <!-- Message in confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_network_error_text\">A data connection is required to connect to Google Play services.</string>\n\n    <!-- Title of confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_invalid_account_title\">Invalid Account</string>\n\n    <!-- Message in confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_invalid_account_text\">The specified account does not exist on this device. Please choose a different account.</string>\n\n    <!-- Message in confirmation dialog informing user there is an unknown issue in Google Play\n        services [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_unknown_issue\">Unknown issue with Google Play services.</string>\n\n    <!-- Title of confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_unsupported_title\">Google Play services</string>\n\n    <!-- Message in confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_unsupported_text\">Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance.</string>\n\n    <!-- Message in confirmation dialog informing user that date on the device is not correct,\n    causing certificate checks to fail. [CHAR LIMIT=NONE] -->\n    <string name=\"common_google_play_services_unsupported_date_text\">The date on the device appears to be incorrect. Please check the date on the device.</string>\n\n    <!-- Button in confirmation dialog for updating Google Play services [CHAR LIMIT=40] -->\n    <string name=\"common_google_play_services_update_button\" msgid=\"6556509956452265614\">Update</string>\n\n    <!-- Sign-in button text [CHAR LIMIT=15] -->\n    <string name=\"common_signin_button_text\">Sign in</string>\n\n    <!-- Long form sign-in button text [CHAR LIMIT=30] -->\n    <string name=\"common_signin_button_text_long\">Sign in with Google</string>\n\n\n  <!-- Auth client code resources (prefix with auth_client --><skip />\n  <!--  Title for notification shown when a bad version of GooglePlayServices\n        has been installed and needs correction for an application to work.\n        [CHAR LIMIT=70] -->\n  <string name=\"auth_client_using_bad_version_title\">\n      An application attempted to use a bad version of Google Play Services.\n  </string>\n  <!--  Title for notification shown when GooglePlayServices needs to be\n        enabled for a application to work. [CHAR LIMIT=70] -->\n  <string name=\"auth_client_needs_enabling_title\">\n      An application requires Google Play Services to be enabled.\n  </string>\n  <!--  Title for notification shown when GooglePlayServices needs to be\n        installed for a application to work. [CHAR LIMIT=70] -->\n  <string name=\"auth_client_needs_installation_title\">\n      An application requires installation of Google Play Services.\n  </string>\n  <!--  Title for notification shown when GooglePlayServices needs to be\n        udpated for a application to work. [CHAR LIMIT=70] -->\n  <string name=\"auth_client_needs_update_title\">\n      An application requires an update for Google Play Services.\n  </string>\n\n  <!--  Title for notification shown when GooglePlayServices is unavailable [CHAR LIMIT=42] -->\n  <string name=\"auth_client_play_services_err_notification_msg\">Google Play services error</string>\n\n  <!--  Requested by string saying which app requested the notification. [CHAR LIMIT=42] -->\n  <string name=\"auth_client_requested_by_msg\">Requested by <xliff:g id=\"app_name\">%1$s</xliff:g></string>\n  <!-- End Auth client resources --><skip />\n\n    <!-- Location client code resources (prefix with location_client) -->\n\n    <!-- Lots of packages seem to assume this file will exist, easier to just leave it for now. -->\n\n    <!-- End location client resources -->\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values/version.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <integer name=\"google_play_services_version\">4242000</integer>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-af/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Kry Google Play-dienste\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou foon is nie.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Hierdie program sal nie loop sonder Google Play-dienste nie, wat nie op jou tablet is nie.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Kry Google Play-dienste\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Aktiveer Google Play-dienste\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Hierdie program sal nie werk tensy jy Google Play-dienste aktiveer nie.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Aktiveer Google Play-dienste\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Dateer Google Play-dienste op\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Hierdie program sal nie loop nie, tensy jy Google Play-dienste opdateer.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Netwerkfout\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"\\'n Dataverbinding is nodig om aan Google Play-dienste te koppel.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Ongeldige rekening\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Die gespesifiseerde rekening bestaan nie op hierdie toestel nie. Kies asseblief \\'n ander rekening.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Onbekende probleem met Google Play-dienste.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play-dienste\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play-dienste, waarop sommige van jou programme staatmaak, werk nie met jou toestel nie. Kontak asseblief die vervaardiger vir bystand.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Dit lyk of die datum op die toestel verkeerd is. Gaan asseblief die datum op die toestel na.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Dateer op\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Meld aan\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Meld aan met Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"\\'n Program het probeer om \\'n slegte weergawe van Google Play-dienste te gebruik.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"\\'n Program vereis dat Google Play-dienste geaktiveer word.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"\\'n Program vereis dat Google Play-dienste geïnstalleer word.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"\\'n Program vereis \\'n opdatering vir Google Play-dienste.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play-dienstefout\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Versoek deur <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-am/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play አገልግሎቶችን አግኝ\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ስልክዎ ላይ የሉም።\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"ይህ መተግበሪያ ያለ Google Play አገልግሎቶች አይሰራም፣ እነሱ ደግሞ ጡባዊዎ ላይ የሉም።\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play አገልግሎቶችን አግኝ\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play አገልግሎቶችን አንቃ\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Google Play አገልግሎቶችን እስካላነቁ ድረስ ይህ መተግበሪያ አይሰራም።\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play አገልግሎቶችን አንቃ\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play አገልግሎቶችን ያዘምኑ\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Google Play አገልግሎቶችን እስኪያዘምኑ ድረስ ይህ መተግበሪያ አይሰራም።\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"የአውታረ መረብ ስህተት\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"ከGoogle Play አገልግሎቶች ጋር ለመገናኘት የውሂብ ግንኙነት ያስፈልጋል።\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"ልክ ያልሆነ መለያ\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"የተገለጸው መለያ በዚህ መሣሪያ ላይ የለም። እባክው የተለየ መለያ ይምረጡ።\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"በGoogle Play አገልግሎቶች ላይ ያልታወቀ ችግር።\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play አገልግሎቶች\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"የGoogle Play አገልግሎቶች፣ አንዳንድ መተግበሪያዎችዎ በእሱ ላይ ጥገኛ የሆኑት፣ በመሣሪያዎ አይደገፍም። እባክዎ ለእርዳታ አምራቹን ያግኙ።\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"በመሣሪያው ላይ ያለው ቀን ትክክል አይመስልም። እባክዎ በመሣሪያው ላይ ያለውን ቀን ያረጋግጡ።\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"ያዘምኑ\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"ግባ\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"በGoogle ይግቡ\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"መተግበሪያው የGoogle Play አገልግሎቶችን መጥፎ ስሪት ለመጠቀም ሞክሯል።\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"መተግበሪያው Google Play አገልግሎቶች እንዲነቁ ይፈልጋል።\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"መተግበሪያው Google Play አገልግሎቶች እንዲጫኑ ይፈልጋል።\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"መተግበሪያው Google Play አገልግሎቶች እንዲዘምን ይፈልጋል።\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"የGoogle Play አገልግሎቶች ስህተት\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"በ<xliff:g id=\"APP_NAME\">%1$s</xliff:g> የተጠየቀ\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ar/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"‏الحصول على خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"‏لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في هاتفك.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"‏لن يتم تشغيل هذا التطبيق بدون خدمات Google Play، والتي لا تتوفر في جهازك اللوحي.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"‏الحصول على خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"‏تمكين خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"‏لن يعمل هذا التطبيق ما لم يتم تمكين خدمات Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"‏تمكين خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"‏تحديث خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"‏لن يتم تشغيل هذا التطبيق ما لم تحدِّث خدمات Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"خطأ في الشبكة\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"‏يتطلب الاتصال بخدمات Google Play وجود اتصال بيانات.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"حساب غير صالح\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"الحساب الذي تمّ تحديده غير موجود على الجهاز. يُرجى اختيار حساب آخر.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"‏حدثت مشكلة غير معروفة في خدمات Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"‏خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"‏خدمات Google Play التي تستجيب لها بعض تطبيقاتك لا تعمل على جهازك. يُرجى الاتصال بجهة التصنيع للحصول على المساعدة.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"يبدو أن التاريخ على الجهاز غير صحيح. الرجاء التحقق من التاريخ على الجهاز.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"تحديث\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"تسجيل الدخول\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"‏تسجيل الدخول باستخدام Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"‏يحاول أحد التطبيقات استخدام إصدار غير صالح من خدمات Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"‏يتطلب أحد التطبيقات تمكين خدمات Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"‏يتطلب أحد التطبيقات تثبيت خدمات Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"‏يتطلب أحد التطبيقات تحديث خدمات Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"‏خطأ في خدمات Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"تم الطلب عن طريق <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-bg/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Изтегляне на услугите за Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Това приложение няма да се изпълнява без услугите за Google Play, които липсват в телефона ви.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Това приложение няма да се изпълнява без услугите за Google Play, които липсват в таблета ви.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Услуги за Google Play: Изтегл.\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Активиране на услугите за Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Това приложение няма да работи, освен ако не активирате услугите за Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Услуги за Google Play: Актив.\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Актуализиране на услугите за Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Това приложение няма да се изпълнява, освен ако не актуализирате услугите за Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Грешка в мрежата\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"За свързване с услугите за Google Play се изисква връзка за данни.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Невалиден профил\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Посоченият профил не съществува на това устройство. Моля, изберете друг.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Неизвестен проблем с услугите за Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Услуги за Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Услугите за Google Play, на които разчитат някои от приложенията ви, не се поддържат от устройството ви. Моля, свържете се с производителя за помощ.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Изглежда, че датата на устройството е неправилна. Моля, проверете я.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Актуализиране\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Вход\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Вход с Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Приложение опита да ползва неправилна версия на услуг. за Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Приложение изисква активирането на услугите за Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Приложение изисква инсталирането на услугите за Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Приложение изисква актуализирането на услугите за Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Грешка в услугите за Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Заявено от <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ca/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Baixa els serveis de Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Aquesta aplicació no s\\'executarà si el telèfon no té instal·lats els serveis de  Google Play.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Aquesta aplicació no funcionarà si la tauleta no té instal·lats els serveis de Google Play.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Baixa els serveis de Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Activa els serveis de Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Aquesta aplicació no funcionarà si no actives els serveis de Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Activa els serveis de Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Actualitza els serveis de Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Aquesta aplicació no s\\'executarà si no actualitzes els serveis de Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Error de xarxa\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Es requereix una connexió de dades per connectar amb els serveis de Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Compte no vàlid\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"El compte especificat no existeix en aquest dispositiu. Tria un compte diferent.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Error desconegut relacionat amb els serveis de Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Serveis de Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"El teu dispositiu no és compatible amb els serveis de Google Play, en què es basen les teves aplicacions. Per obtenir assistència, contacta amb el fabricant.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Sembla que la data del dispositiu no és correcta. Comprova-la.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Actualitza\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Inicia sessió\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Inicia sessió amb Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Una aplic. ha intentat utilitzar una versió errònia de serveis de Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Una aplicació requereix que s\\'activin els serveis de Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Una aplicació requereix que s\\'instal·lin els serveis de Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Una aplicació requereix que s\\'actualitzin els serveis de Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Error dels serveis de Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Sol·licitada per <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-cs/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Instalovat služby Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ke spuštění této aplikace jsou potřeba služby Google Play, které v telefonu nemáte.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ke spuštění této aplikace jsou potřeba služby Google Play, které v tabletu nemáte.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Instalovat služby Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Aktivovat služby Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Ke spuštění této aplikace je třeba aktivovat služby Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Aktivovat služby Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Aktualizace služeb Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ke spuštění této aplikace je třeba aktualizovat služby Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Chyba sítě\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Připojení ke službám Google Play vyžaduje datové připojení.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Neplatný účet\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Zadaný účet v tomto zařízení neexistuje. Zvolte prosím jiný účet.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Nastal neznámý problém se službami Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Služby Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Některé vaše aplikace vyžadují služby Google Play, které ve vašem zařízení nejsou podporovány. S žádostí o pomoc se prosím obraťte na výrobce.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Datum v zařízení není správně nastaveno. Zkontrolujte prosím datum.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Aktualizovat\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Přihlásit se\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Přihlásit se účtem Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplikace se pokusila použít nesprávnou verzi Služeb Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Aplikace vyžaduje aktivované Služby Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Aplikace vyžaduje instalaci Služeb Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Aplikace vyžaduje aktualizaci Služeb Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Chyba služeb Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Požadováno aplikací <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-da/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Hent Google Play-tjenester\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Denne app kan ikke køre uden Google Play-tjenester, som mangler på din telefon.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Denne app kan ikke køre uden Google Play-tjenester, som mangler på din tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Hent Google Play-tjenester\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Aktivér Google Play-tjenester\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Denne app virker ikke, medmindre du aktiverer Google Play-tjenester.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Aktivér Google Play-tjenester\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Opdater Google Play-tjenester\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Denne app kan ikke køre, medmindre du opdaterer Google Play-tjenester.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Netværksfejl\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Der kræves en dataforbindelse for at oprette forbindelse til Google Play-tjenester.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Ugyldig konto\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Den angivne konto findes ikke på denne enhed. Vælg en anden konto.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Ukendt problem med Google Play-tjenester.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play-tjenester\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play-tjenester, som nogle af dine applikationer er afhængige af, understøttes ikke af din enhed. Kontakt producenten for at få hjælp.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Datoen på enheden ser ud til at være forkert. Husk at kontrollere datoen på enheden.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Opdater\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Log ind\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Log ind med Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"En applikation forsøgte at bruge en defekt version af Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"En applikation kræver, at Google Play er aktiveret.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"En applikation kræver, at Google Play er installeret.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"En applikation kræver en opdatering af Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Fejl i Google Play-tjenester\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Anmodning fra <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-de/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play-Dienste installieren\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Telefon nicht installiert sind.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Zur Nutzung dieser App sind Google Play-Dienste erforderlich, die auf Ihrem Tablet nicht installiert sind.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play-Dienste installieren\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play-Dienste aktivieren\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Diese App funktioniert nur, wenn Sie die Google Play-Dienste aktivieren.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play-Dienste aktivieren\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play-Dienste aktualisieren\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Diese App wird nur ausgeführt, wenn Sie die Google Play-Dienste aktualisieren.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Netzwerkfehler\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Um eine Verbindung zu den Google Play-Diensten herzustellen, ist eine Datenverbindung erforderlich.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Ungültiges Konto\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Das angegebene Konto ist auf diesem Gerät nicht vorhanden. Bitte wählen Sie ein anderes Konto aus.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Unbekanntes Problem mit Google Play-Diensten\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play-Dienste\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play-Dienste, auf denen einige Ihrer Apps basieren, werden von diesem Gerät nicht unterstützt. Wenden Sie sich für weitere Informationen an den Hersteller.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Das Datum auf dem Gerät scheint falsch zu sein. Bitte überprüfen Sie das Datum auf dem Gerät.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Aktualisieren\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Anmelden\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Über Google anmelden\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"App versuchte, defekte Google Play-Dienste-Version zu verwenden\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"App erfordert aktivierte Google Play-Dienste\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"App erfordert die Installation von Google Play-Diensten\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"App erfordert ein Update für Google Play-Dienste\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Fehler bei Google Play-Diensten\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Angefordert von <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-el/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Λήψη υπηρεσιών Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το τηλέφωνό σας.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Αυτή η εφαρμογή δεν θα εκτελεστεί χωρίς τις υπηρεσίες Google Play, οι οποίες λείπουν από το tablet σας.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Λήψη υπηρεσιών Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Ενεργοποίηση υπηρεσιών Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Αυτή η εφαρμογή δεν θα λειτουργήσει εάν δεν έχετε ενεργοποιήσει τις υπηρεσίες Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Ενεργοπ. υπηρεσιών Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Ενημέρωση υπηρεσιών Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Αυτή η εφαρμογή θα εκτελεστεί αφού ενημερώσετε τις υπηρεσίες Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Σφάλμα δικτύου\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Απαιτείται σύνδεση δεδομένων για να συνδεθείτε με τις Υπηρεσίες Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Μη έγκυρος λογαριασμός\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Ο συγκεκριμένος λογαριασμός δεν υπάρχει σε αυτήν τη συσκευή. Επιλέξτε έναν διαφορετικό λογαριασμό.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Άγνωστο πρόβλημα με τις υπηρεσίες Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Υπηρεσίες Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Οι υπηρεσίες Google Play, στις οποίες βασίζονται ορισμένες από τις εφαρμογές σας, δεν υποστηρίζονται στη συσκευή σας. Επικοινωνήστε με τον κατασκευαστή για υποστήριξη.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Η ημερομηνία στη συσκευή φαίνεται λανθασμένη. Ελέγξτε την ημερομηνία στη συσκευή.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Ενημέρωση\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Σύνδεση\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Συνδεθείτε στο Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Απόπειρα χρήσης ακατάλληλης έκδοσης Υπηρεσιών Google Play από εφαρμογή\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Μια εφαρμογή απαιτεί τις Υπηρεσίες Google Play για ενεργοποίηση.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Μια εφαρμογή απαιτεί την εγκατάσταση των Υπηρεσιών Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Μια εφαρμογή απαιτεί μια ενημέρωση για τις Υπηρεσίες Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Σφάλμα υπηρεσιών Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Υποβλήθηκε αίτημα από την εφαρμογή <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-en-rGB/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Get Google Play services\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"This app won\\'t run without Google Play services, which are missing from your phone.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"This app won\\'t run without Google Play services, which are missing from your tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Get Google Play services\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Enable Google Play services\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"This app won\\'t work unless you enable Google Play services.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Enable Google Play services\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Update Google Play services\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"This app won\\'t run unless you update Google Play services.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Network Error\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"A data connection is required to connect to Google Play services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Invalid Account\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"The specified account does not exist on this device. Please choose a different account.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Unknown issue with Google Play services.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play services\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"The date on the device appears to be incorrect. Please check the date on the device.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Update\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Sign in\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Sign in with Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"An application attempted to use a bad version of Google Play Services.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"An application requires Google Play Services to be enabled.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"An application requires installation of Google Play Services.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"An application requires an update for Google Play Services.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play services error\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Requested by <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-en-rIN/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Get Google Play services\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"This app won\\'t run without Google Play services, which are missing from your phone.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"This app won\\'t run without Google Play services, which are missing from your tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Get Google Play services\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Enable Google Play services\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"This app won\\'t work unless you enable Google Play services.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Enable Google Play services\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Update Google Play services\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"This app won\\'t run unless you update Google Play services.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Network Error\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"A data connection is required to connect to Google Play services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Invalid Account\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"The specified account does not exist on this device. Please choose a different account.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Unknown issue with Google Play services.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play services\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"The date on the device appears to be incorrect. Please check the date on the device.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Update\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Sign in\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Sign in with Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"An application attempted to use a bad version of Google Play Services.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"An application requires Google Play Services to be enabled.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"An application requires installation of Google Play Services.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"An application requires an update for Google Play Services.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play services error\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Requested by <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-es/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Descargar servicios de Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Esta aplicación no se ejecutará si tu teléfono no tiene instalados los servicios de Google Play.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Esta aplicación no se ejecutará si tu tablet no tiene instalados los servicios de Google Play.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Descargar servicios de Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Habilitar servicios de Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Esta aplicación no funcionará si no habilitas los servicios de Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Habilitar servicios de Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Actualizar servicios de Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Esta aplicación no se ejecutará si no actualizas los servicios de Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Error de red\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Se necesita una conexión de datos para establecer conexión con los servicios de Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Cuenta no válida\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"La cuenta especificada no existe en este dispositivo. Selecciona otra cuenta.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Error desconocido relacionado con los servicios de Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Servicios de Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Tu dispositivo no es compatible con los servicios de Google Play, de los cuales dependen tus aplicaciones. Para obtener asistencia, ponte en contacto el fabricante.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Parece que la fecha del dispositivo es incorrecta. Compruébala.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Actualizar\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Iniciar sesión\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Iniciar sesión con Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Una aplicación intentó usar versión incorrecta de servicios de Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Una aplicación requiere que se habiliten los servicios de Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Una aplicación requiere que se instalen los servicios de Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Una aplicación requiere que se actualicen los servicios de Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Error de los servicios de Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Solicitada por <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-es-rUS/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Obtener Google Play Services\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Esta aplicación no se ejecutará si no instalasGoogle Play Services en tu dispositivo.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Esta aplicación no se ejecutará si no instalas Google Play Services en tu tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Descargar Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Activar Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Esta aplicación no funcionará si no activas Google Play Services.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Activar Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Actualizar Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Esta aplicación no se ejecutará si no actualizas Google Play Services.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Error de red\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Se necesita una conexión de datos para establecer conexión con Google Play Services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Cuenta no válida\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"La cuenta especificada no existe en este dispositivo. Elige otra cuenta.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Error desconocido relacionado con Google Play Services\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play Services\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play Services, del cual dependen algunas de tus aplicaciones, no es compatible con tu dispositivo. Comunícate con el fabricante para obtener ayuda.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Parece que la fecha del dispositivo es incorrecta. ¿Puedes revisarla?\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Actualizar\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Acceder\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Acceder con Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Una aplic. intentó usar una versión no válida de Google Play Services\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Una aplicación requiere que se active Google Play Services\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Una aplicación requiere que se instale Google Play Services\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Una aplicación requiere que se actualice Google Play Services\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Error de Google Play Services\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Solicitada por <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-et-rEE/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Hankige Google Play teenused\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie telefonis pole.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Selle rakenduse käitamiseks on vaja Google Play teenuseid, mida teie tahvelarvutis pole.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Hankige Google Play teenused\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Lubage Google Play teenused\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"See rakendus ei tööta, kui te ei luba Google Play teenuseid.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Lubage Google Play teenused\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Värskendage Google Play teenuseid\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Seda rakendust ei saa käitada, kui te ei värskenda Google Play teenuseid.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Võrgu viga\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play teenustega ühenduse loomiseks on vajalik andmesideühendus.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Vale konto\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Määratud kontot pole selles seadmes olemas. Valige muu konto.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play teenuste tundmatu probleem.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play teenused\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Teie seade ei toeta Google Play teenuseid, millele mõni teie rakendustest toetub. Abi saamiseks võtke ühendust tootjaga.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Seadme kuupäev paistab olevat vale. Kontrollige seadme kuupäeva.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Värskenda\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Logi sisse\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Logi sisse Google\\'iga\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Rakendus püüdis kasutada Google Play teenuste sobimatut versiooni.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Rakenduse kasutamiseks peavad olema lubatud Google Play teenused.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Rakenduse kasutamiseks peavad olema installitud Google Play teenused.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Rakenduse kasutamiseks tuleb värskendada Google Play teenuseid.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Viga Google Play teenustes\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Päringu esitas: <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-fa/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"‏دریافت خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"‏این برنامه بدون خدمات Google Play اجرا نمی‌شود، این خدمات در تلفن شما وجود ندارد.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"‏این برنامه بدون خدمات Google Play اجرا نمی‌شود، این خدمات در رایانهٔ لوحی شما وجود ندارد.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"‏دریافت خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"‏فعال کردن خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"‏تا زمانی‌که خدمات Google Play را فعال نکنید این برنامه کار نمی‌کند.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"‏فعال کردن خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"‏به‌روزرسانی خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"‏تا زمانی‌که خدمات Google Play را به‌روز نکنید این برنامه کار نمی‌کند.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"خطای شبکه\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"‏برای اتصال به خدمات Google Play اتصال داده لازم است.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"حساب نامعتبر\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"حسابی که تعیین کردید در این دستگاه وجود ندارد. لطفاً حساب دیگری را انتخاب کنید.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"‏مشکل نامشخص در خدمات Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"‏خدمات Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"‏خدمات Google Play، که برخی از برنامه‌های شما به آن وابسته است، توسط دستگاه شما پشتیبانی نمی‌شود. لطفاً برای دریافت کمک با سازنده تماس بگیرید.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"تاریخ روی دستگاه ظاهراً اشتباه است. لطفاً تاریخ روی دستگاه را بررسی کنید.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"به‌روزرسانی\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"ورود به سیستم\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"‏ورود به سیستم با Google‎\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"‏برنامه‌ای تلاش کرد از نسخه نادرستی از خدمات Google Play استفاده کند.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"‏برنامه‌ای به فعال کردن خدمات Google Play نیاز دارد.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"‏برنامه‌ای به نصب خدمات Google Play نیاز دارد.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"‏برنامه‌ای به به‌روزرسانی خدمات Google Play نیاز دارد.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"‏خطا در خدمات Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"درخواست توسط <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-fi/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Asenna Google Play -palvelut\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat puhelimesta.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Tämä sovellus ei toimi ilman Google Play -palveluita, jotka puuttuvat tablet-laitteesta.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Asenna Google Play -palvelut\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Ota Google Play -palvelut käyttöön\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Tämä sovellus ei toimi, ellet ota Google Play -palveluita käyttöön.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Ota Google Play -palv. käyttöön\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Päivitä Google Play -palvelut\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Tämä sovellus ei toimi, ellet päivitä Google Play -palveluita.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Verkkovirhe\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play -palveluiden käyttöön tarvitaan tietoliikenneyhteys.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Tili ei kelpaa\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Kyseistä tiliä ei ole tällä laitteella. Valitse toinen tili.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Tuntematon ongelma käytettäessä Google Play -palveluita.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play -palvelut\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play -palveluita, joita osa sovelluksistasi käyttää, ei tueta laitteellasi. Pyydä ohjeita laitteen valmistajalta.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Laitteen päivämäärä vaikuttaa virheelliseltä. Tarkista laitteen päivämäärä.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Päivitä\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Kirjaudu\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Kirjaudu Google-tiliin\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Sovellus yritti käyttää virheellistä Google Play -palveluiden versiota\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Ota käyttöön Google Play -palvelut, jotta sovellus toimii.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Asenna Google Play -palvelut, jotta sovellus toimii.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Päivitä Google Play -palvelut, jotta sovellus toimii.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Virhe Google Play -palveluissa\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Pyynnön teki <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-fr/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Installer les services Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre téléphone.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre tablette.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Installer services Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Activer les services Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Cette application ne fonctionnera pas tant que vous n\\'aurez pas activé les services Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Activer services Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Mettre à jour les services Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Cette application ne fonctionnera pas tant que vous n\\'aurez pas mis à jour les services Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Erreur réseau\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Vous devez disposer d\\'une connexion de données pour utiliser les services Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Compte erroné\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Le compte indiqué n\\'existe pas sur cet appareil. Veuillez sélectionner un autre compte.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Problème inconnu avec les services Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Services Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Les services Google Play, dont dépendent certaines de vos applications, ne sont pas compatibles avec votre appareil. Veuillez contacter le fabricant pour obtenir de l\\'aide.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"La date sur l\\'appareil semble incorrecte. Veuillez la vérifier.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Mettre à jour\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Connexion\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Se connecter avec Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Une application requiert une version valide des services Google Play\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Une application requiert l\\'activation des services Google Play\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Une application requiert l\\'installation des services Google Play\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Une application requiert la mise à jour des services Google Play\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Erreur liée aux services Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Demandée par <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-fr-rCA/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Installer les services Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre téléphone.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Cette application ne fonctionnera pas sans les services Google Play, qui ne sont pas installés sur votre tablette.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Installer les services Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Activer les services Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Cette application ne fonctionnera pas tant que vous n\\'aurez pas activé les services Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Activer les services Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Mettre à jour les services Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Cette application ne fonctionnera pas tant que vous n\\'aurez pas mis à jour les services Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Erreur réseau\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Vous devez disposer d\\'une connexion de données pour utiliser les services Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Compte erroné\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Le compte indiqué n\\'existe pas sur cet appareil. Veuillez sélectionner un autre compte.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Problème inconnu avec les services Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Services Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Les services Google Play, dont dépendent certaines de vos applications, ne sont pas compatibles avec votre appareil. Veuillez contacter le fabricant pour obtenir de l\\'aide.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"La date sur l\\'appareil semble incorrecte. Veuillez la vérifier.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Mettre à jour\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Connexion\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Se connecter via Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Une application requiert une version valide des services Google Play\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Une application requiert l\\'activation des services Google Play\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Une application requiert l\\'installation des services Google Play\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Une application requiert la mise à jour des services Google Play\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Erreur liée aux services Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Demandée par <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-hi/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play सेवाएं पाएं\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"यह ऐप्स  Google Play सेवाओं के बिना नहीं चलेगा, जो आपके फ़ोन में नहीं हैं.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"यह ऐप्स  Google Play सेवाओं के बिना नहीं चलेगा, जो आपके टेबलेट में नहीं हैं.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play सेवाएं पाएं\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play सेवाएं सक्षम करें\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"जब तक आप Google Play सेवाएं सक्षम नहीं करते, तब तक यह ऐप्स  कार्य नहीं करेगा.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play सेवाएं सक्षम करें\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play सेवाएं से नई जानकारी\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"जब तक आप Google Play सेवाओं से नई जानकारी नहीं लेते हैं, तब तक यह ऐप्स  नहीं चलेगा.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"नेटवर्क त्रुटि\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play सेवाओं से कनेक्ट करने के लिए डेटा कनेक्शन की आवश्यकता है.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"अमान्य खाता\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"निर्दिष्ट खाता इस उपकरण पर मौजूद नहीं है. कृपया कोई भिन्न खाता चुनें.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play सेवाओं के साथ अज्ञात समस्या.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play सेवाएं\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play सेवाएं, जिन पर आपके कुछ ऐप्स  निर्भर करते हैं, आपके उपकरण द्वारा समर्थित नहीं हैं. कृपया सहायता के लिए निर्माता से संपर्क करें.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"उपकरण का दिनांक गलत प्रतीत हो रहा है. कृपया उपकरण का दिनांक जांचें.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"नई जानकारी पाएं\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"प्रवेश करें\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Google से प्रवेश करें\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"ऐप्स ने Google Play सेवाओं के खराब संस्करण के उपयोग का प्रयास किया.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"ऐप्स  के लिए Google Play सेवाओं को सक्षम किए जाने की आवश्यकता है.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"ऐप्स  के लिए Google Play सेवाओं के इंस्टॉलेशन की आवश्यकता है.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"ऐप्स  के लिए Google Play सेवाओं में Google Play से नई जानकारी की आवश्यकता है.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play सेवाएं त्रुटि\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"<xliff:g id=\"APP_NAME\">%1$s</xliff:g> द्वारा अनुरोधित\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-hr/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Preuzmi usluge za Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem telefonu.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ova aplikacija neće funkcionirati bez usluga za Google Play, koje nisu instalirane na vašem tabletnom računalu.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Preuzmi usluge za Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Omogući usluge za Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Ova aplikacija neće raditi ako ne omogućite usluge za Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Omogući usluge za Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Ažuriraj usluge za Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ova se aplikacija neće pokrenuti ako ne ažurirate usluge za Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Mrežna pogreška\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Potrebna je podatkovna veza za povezivanje s uslugama Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Nevažeći račun\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Navedeni račun ne postoji na ovom uređaju. Odaberite neki drugi račun.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Nepoznata poteškoća s uslugama za Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Usluge za Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Usluge za Google Play, koje su potrebne za funkcioniranje nekih vaših aplikacija, nisu podržane na vašem uređaju. Pomoć potražite od proizvođača.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Čini se da datum na uređaju nije točan. Provjerite datum na uređaju.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Ažuriranje\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Prijava\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Prijava uslugom Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplikacija je pokušala upotrijebiti lošu verziju Usluga za Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Aplikacija zahtijeva omogućavanje Usluga za Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Aplikacija zahtijeva instaliranje Usluga za Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Aplikacija zahtijeva ažuriranje Usluga za Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Pogreška usluga za Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Zahtijeva aplikacija <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-hu/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Play Szolgáltatások telepítése\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a telefonon.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Az alkalmazás működéséhez a Google Play Szolgáltatások szükségesek, ezek nincsenek telepítve a táblagépen.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Play Szolgáltatások telepítése\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play Szolgáltatások aktiválása\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Az alkalmazás csak akkor fog működni, ha engedélyezi a Google Play Szolgáltatásokat.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Play Szolgáltatások aktiválása\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Play Szolgáltatások frissítése\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Az alkalmazás csak akkor fog működni, ha frissíti a Google Play Szolgáltatásokat.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Hálózati hiba\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"A Google Play Szolgáltatásokhoz történő kapcsolódáshoz adatkapcsolat szükséges.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Érvénytelen fiók\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"A megadott fiók nem létezik ezen az eszközön. Kérjük, válasszon másik fiókot.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Ismeretlen hiba a Google Play Szolgáltatásokban.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play Szolgáltatások\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"A Google Play Szolgáltatásokat, amelyre egyes alkalmazások támaszkodnak, nem támogatja az eszköz. Segítségért forduljon az eszköz gyártójához.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Az eszközön beállított dátum helytelen. Kérjük, ellenőrizze azt.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Frissítés\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Belépés\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Google-bejelentkezés\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Egy alkalmazás a Play Szolgáltatások rossz verzióját akarta használni.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Egy alkalmazás kéri a Google Play Szolgáltatások engedélyezését.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Egy alkalmazás kéri a Google Play Szolgáltatások telepítését.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Egy alkalmazás kéri a Google Play Szolgáltatások frissítését.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play szolgáltatási hiba\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Igénylő: <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-hy-rAM/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Տեղադրեք Google Play ծառայությունները\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Այս հավելվածը չի գործարկվի առանց Google Play ծառայությունների, որոնք բացակայում են ձեր հեռախոսում:\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Այս հավելվածը չի գործարկվի առանց Google Play ծառայությունների, որոնք բացակայում են ձեր գրասալիկում:\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Տեղադրել Google Play ծառայությունները\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Միացնել Google Play ծառայությունները\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Այս ծրագիրը չի աշխատի, եթե դուք չմիացնեք Google Play ծառայությունները:\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Միացնել Google Play ծառայությունները\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Նորացրեք Google Play ծառայությունները\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Այս ծրագիրը չի գործարկվի, եթե դուք չնորացնեք Google Play ծառայությունները:\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Ցանցի սխալ կա\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Պահանջվում է տվյալների կապ` Google Play ծառայություններին միանալու համար:\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Հաշիվն անվավեր է\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Նշված հաշիվը գոյություն չունի այս սարքում: Ընտրեք այլ հաշիվ:\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Անհայտ խնդիր՝ Google Play ծառայություններում:\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play ծառայություններ\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play ծառայությունները, որոնց ապավինում են ձեր ծրագրերից որոշները, չեն աջակցվում ձեր սարքի կողմից: Խնդրում ենք կապվել արտադրողի հետ օգնության համար:\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Սարքի ամսաթիվը կարծես սխալ է: Ստուգեք սարքի ամսաթիվը:\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Նորացնել\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Մուտք գործել\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Մուտք գործեք Google-ով\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Հավելվածը փորձել է կիրառել Google Play ծառայությունների վատ տարբերակը:\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Հավելվածը պահանջում է միացնել Google Play ծառայությունները:\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Հավելվածը պահանջում է տեղադրել Google Play ծառայությունները:\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Հավելվածը պահանջում է թարմացնել Google Play ծառայությունները:\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play ծառայությունների սխալ\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"<xliff:g id=\"APP_NAME\">%1$s</xliff:g>-ի հարցմամբ\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-in/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Dapatkan layanan Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di ponsel Anda.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Aplikasi ini tidak akan berjalan tanpa layanan Google Play, yang tidak ada di tablet Anda.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Dapatkan layanan Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Aktifkan layanan Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Aplikasi ini tidak akan bekerja sampai Anda mengaktifkan layanan Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Aktifkan layanan Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Perbarui layanan Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Aplikasi ini tidak akan berjalan sampai Anda memperbarui layanan Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Kesalahan Jaringan\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Sambungan data diperlukan untuk tersambung ke layanan Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Akun Tidak Valid\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Akun yang ditentukan tidak ada di perangkat ini. Pilih akun lain.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Masalah tidak diketahui pada layanan Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Layanan Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Layanan Google Play, yang diandalkan oleh beberapa aplikasi Anda, tidak didukung oleh perangkat Anda. Hubungi pabrikan untuk mendapatkan bantuan.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Tampaknya tanggal di perangkat salah. Periksa tanggal di perangkat.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Perbarui\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Masuk\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Masuk dengan Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplikasi mencoba menggunakan versi Layanan Google Play yang rusak.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Aplikasi membutuhkan Layanan Google Play untuk dapat diaktifkan.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Aplikasi membutuhkan pemasangan Layanan Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Aplikasi membutuhkan pembaruan untuk Layanan Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Kesalahan layanan Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Diminta oleh <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-it/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Installa Google Play Services\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"L\\'app non funzionerà senza Google Play Services, non presente sul tuo telefono.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"L\\'app non funzionerà senza Google Play Services, non presente sul tuo tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Installa Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Attiva Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"L\\'app non funzionerà se non attivi Google Play Services.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Attiva Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Aggiorna Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"L\\'app non funzionerà se non aggiorni Google Play Services.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Errore di rete\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"È necessaria una connessione dati per connettersi a Google Play Services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Account non valido\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"L\\'account specificato non esiste su questo dispositivo. Scegli un altro account.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Problema sconosciuto con Google Play Services.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play Services\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"La piattaforma Google Play Services, su cui sono basate alcune delle tue applicazioni, non è supportata dal dispositivo in uso. Per assistenza, contatta il produttore.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"La data sul dispositivo sembra sbagliata. Controllala.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Aggiorna\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Accedi\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Accedi con Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Un\\'app ha tentato di usare una versione non valida di Play Services.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Un\\'applicazione richiede l\\'attivazione di Google Play Services.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Un\\'applicazione richiede l\\'installazione di Google Play Services.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Un\\'applicazione richiede un aggiornamento di Google Play Services.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Errore Google Play Services\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Richiesta da <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-iw/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"‏קבל את שירותי Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"‏אפליקציה זו לא תפעל ללא שירותי Google Play, החסרים בטלפון שלך.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"‏אפליקציה זו לא תפעל ללא שירותי Google Play, החסרים בטאבלט שלך.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"‏קבל את שירותי Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"‏הפעלת שירותי Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"‏אפליקציה זו לא תעבוד אם לא תפעיל את שירותי Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"‏הפעל את שירותי Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"‏עדכון שירותי Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"‏אפליקציה זו לא תפעל אם לא תעדכן את שירותי Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"שגיאת רשת.\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"‏דרוש חיבור נתונים כדי להתחבר לשירותי Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"חשבון לא חוקי\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"החשבון שצוין לא קיים במכשיר זה. בחר חשבון אחר.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"‏בעיה לא ידועה בשירותי Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"‏שירותי Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"‏שירותי Google Play, שחלק מהאפליקציות שלך מתבססות עליהם, אינם נתמכים על ידי המכשיר שברשותך. צור קשר עם היצרן לקבלת סיוע.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"נראה שהתאריך במכשיר שגוי. בדוק את התאריך במכשיר.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"עדכן\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"היכנס\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"‏היכנס באמצעות Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"‏יש אפליקציה שניסתה להשתמש בגרסה שגויה של שירותי Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"‏יש אפליקציה המחייבת הפעלה של שירותי Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"‏יש אפליקציה המחייבת התקנה של שירותי Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"‏יש אפליקציה המחייבת עדכון של שירותי Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"‏שגיאה בשירותי Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"התבקשה על ידי <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ja/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Play開発者サービスの入手\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いの携帯端末にはインストールされていません。\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"このアプリの実行にはGoogle Play開発者サービスが必要ですが、お使いのタブレットにはインストールされていません。\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Play開発者サービスの入手\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Play開発者サービスの有効化\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"このアプリの実行には、Google Play開発者サービスの有効化が必要です。\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Play開発者サービスの有効化\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Play開発者サービスの更新\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"このアプリの実行には、Google Play開発者サービスの更新が必要です。\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"ネットワークエラー\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play開発者サービスに接続するには、データ接続が必要です。\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"無効なアカウント\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"指定したアカウントはこの端末上に存在しません。別のアカウントを選択してください。\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play開発者サービスで原因不明の問題が発生しました。\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play開発者サービス\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"一部のアプリが使用しているGoogle Play開発者サービスは、お使いの端末ではサポートされていません。詳しくは、端末メーカーまでお問い合わせください。\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"端末上の日付が正しくないようです。端末上の日付をご確認ください。\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"更新\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"ログイン\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Googleでログイン\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"アプリはGoogle Play開発者サービスの不適切なバージョンを使用しようとしました。\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"アプリではGoogle Play開発者サービスを有効にする必要があります。\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"アプリではGoogle Play開発者サービスをインストールする必要があります。\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"アプリではGoogle Play開発者サービスをアップデートする必要があります。\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play開発者サービスのエラー\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"<xliff:g id=\"APP_NAME\">%1$s</xliff:g>によるリクエスト\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ka-rGE/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play სერვისების მიღება\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"ეს აპი ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტელეფონზე ვერ იძებნება.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"ეს აპი ვერ გაეშვება Google Play სერვისების გარეშე, რაც თქვენს ტელეფონზე ვერ იძებნება.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play სერვისების მიღება\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play სერვისების გააქტიურება\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"ეს აპი არ იმუშავებს, თუ არ გაააქტიურებთ Google Play სერვისებს.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play სერვისების გააქტიურება\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play სერვისების განახლება\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"ეს აპი ვერ გაეშვება, თუ Google Play სერვისებს არ განაახლებთ.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"ქსელის შეცდომა\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play Services-თან დასაკავშირებლად მონაცემთა გადაცემა აუცილებელია.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"ანგარიში არასწორია\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"მითითებული ანგარიში ამ მოწყობილობაზე არ არსებობს. გთხოვთ, აირჩიოთ სხვა ანგარიში.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play სერვისებთან დაკავშირებით უცნობი შეფერხება წარმოიშვა.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play სერვისები\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play სერვისები, რაც თქვენს ზოგიერთ აპს ჭირდება, თქვენს მოწყობილობაზე მხარდაჭერილი არ არის. გთხოვთ, დაუკავშირდეთ მწარმოებელს დახმარებისათვის.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"როგორც ჩანს, მოწყობილობის თარიღი არასწორია. გთხოვთ, შეამოწმოთ მოწყობილობის თარიღი.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"განახლება\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"შესვლა\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Google-ით შესვლა\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"აპლიკაცია შეეცადა გამოეყენებინა Google Play სერვისების არასწორი ვერსია.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"აპლიკაცია საჭიროებს გააქტიურებულ Google Play Services.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"აპლიკაცია საჭიროებს Google Play Services-ის ინსტალაციას.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"აპლიკაცია საჭიროებს Google Play Services-ის განახლებას.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play სერვისების შეცდომა\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"მომთხოვნი: <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-km-rKH/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"ទទួល​សេវាកម្ម​កម្សាន្ត Google\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"កម្មវិធី​នេះ​នឹង​មិន​ដំណើរការ​​ទេ​បើ​គ្មាន​​សេវាកម្ម​កម្សាន្ត​ Google ដែល​ទូរស័ព្ទ​របស់​​អ្នក​មិន​មាន។\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"​​កម្មវិធី​នេះ​នឹង​មិន​ដំណើរការ​​ទេ​បើ​គ្មាន​​សេវាកម្ម​កម្សាន្ត​ Google ដែល​​កុំព្យូទ័រ​បន្ទះ​របស់​អ្នក​មិន​មាន។\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"ទទួល​សេវាកម្ម​កម្សាន្ត Google\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"បើក​សេវាកម្ម​កម្សាន្ត Google\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"កម្ម​វិធី​នេះ​នឹង​មិន​ដំណើរការ​ទេ​ លុះត្រាតែ​អ្នក​បើក​សេវាកម្ម​​កម្សាន្ត​ Google ។\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"បើក​សេវាកម្ម​កម្សាន្ត Google\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"ធ្វើ​បច្ចុប្បន្នភាព​សេវាកម្ម​កម្សាន្ត Google\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"កម្មវិធី​នេះ​នឹង​មិន​ដំណើរការ​ទេ​ លុះត្រាតែ​អ្នក​ធ្វើ​បច្ចុប្បន្នភាព​សេវាកម្ម​កម្សាន្ត Google ។\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"កំហុស​​បណ្ដាញ\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"បាន​ទាមទារ​ការ​តភ្ជាប់​ទិន្នន័យ ដើម្បី​ភ្ជាប់​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"គណនី​មិន​ត្រឹមត្រូវ\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"គណនី​ដែល​បាន​បញ្ជាក់​មិន​មាន​នៅ​លើ​ឧបករណ៍​នេះ​ទេ។ សូម​ជ្រើស​គណនី​ផ្សេង​។\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"មិន​ស្គាល់​បញ្ហា​ជាមួយ​សេវាកម្ម​កម្សាន្ត Google ។\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"សេវាកម្ម​កម្សាន្ត​ Google\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"សេវាកម្ម​កម្សាន្ត Google អាស្រ័យ​លើ​កម្មវិធី​របស់​អ្នក មិន​ត្រូវ​បាន​គាំទ្រ​ដោយ​ឧបករណ៍​របស់​អ្នក។ សូម​ទាក់ទង​ក្រុមហ៊ុន​ផលិត​សម្រាប់​ជំនួយ។\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"កាលបរិច្ឆេទ​លើ​ឧបករណ៍​បង្ហាញ​ថា​មិន​ត្រឹមត្រូវ។ សូម​ពិនិត្យ​កាលបរិច្ឆេទ​លើ​ឧបករណ៍។\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"ធ្វើ​បច្ចុប្បន្នភាព\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"ចូល\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"ចូល​ដោយ​ប្រើ​ Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"កម្មវិធី​​​ព្យាយាម​ប្រើ​កំណែ​មិនល្អ​របស់​សេវា​កម្ម​ឃ្លាំ​កម្មវិធី។\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"កម្មវិធី​ទាមទារ​​បើក​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"កម្មវិធី​ទាមទារ​ការ​ដំឡើង​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"កម្មវិធី​ទាមទារ​​ធ្វើ​បច្ចុប្បន្នភាព​សេវាកម្ម​ឃ្លាំង​កម្មវិធី។\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"កំហុស​សេវា​កម្ម​កម្សាន្ត Google\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"បាន​ស្នើ​ដោយ <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ko/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play 서비스 설치\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"휴대전화에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"태블릿에 Google Play 서비스가 설치되어 있어야 이 앱이 실행됩니다.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play 서비스 설치\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play 서비스 사용\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Google Play 서비스를 사용하도록 설정해야 이 앱이 작동합니다.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play 서비스 사용\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play 서비스 업데이트\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Google Play 서비스를 업데이트해야만 이 앱이 실행됩니다.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"네트워크 오류\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play 서비스에 연결하려면 데이터 연결이 필요합니다.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"올바르지 않은 계정\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"지정한 계정이 이 기기에 존재하지 않습니다. 다른 계정을 선택하세요.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play 서비스에 알 수 없는 문제가 발생했습니다.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play 서비스\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"일부 사용자 애플리케이션에 필요한 Google Play 서비스가 사용자 기기에서 지원되지 않습니다. 기기 제조업체에 문의하시기 바랍니다.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"기기의 날짜가 잘못된 것 같습니다. 기기의 날짜를 확인해 주세요.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"업데이트\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"로그인\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Google 계정으로 로그인\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"애플리케이션에서 잘못된 버전의 Google Play 서비스를 사용하려고 했습니다.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Google Play 서비스를 사용하도록 설정해야 하는 애플리케이션입니다.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Google Play 서비스를 설치해야 하는 애플리케이션입니다.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Google Play 서비스를 업데이트해야 하는 애플리케이션입니다.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play 서비스 오류\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"<xliff:g id=\"APP_NAME\">%1$s</xliff:g>에서 요청\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-lo-rLA/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"ຕິດຕັ້ງບໍລິການ Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ໂດຍທີ່ບໍ່ມີບໍລິການ Google Play ເຊິ່ງຂາດຫາຍໄປໃນໂທລະສັບຂອງທ່ານ.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ໂດຍທີ່ບໍ່ມີບໍລິການ Google Play ເຊິ່ງຂາດຫາຍໄປໃນແທັບເລັດຂອງທ່ານ.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"ຕິດຕັ້ງບໍລິການ Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"ເປີດໃຊ້ບໍລິການ Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ຈົນກວ່າທ່ານຈະເປີດໃຊ້ບໍລິການ Google Play\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"ເປີດໃຊ້ບໍລິການ Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"ອັບເດດບໍລິການ Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"ແອັບຯນີ້ຈະບໍ່ສາມາດເຮັດວຽກໄດ້ຈົນກວ່າທ່ານຈະອັບເດດບໍລິການ Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"ເຄືອຂ່າຍຜິດພາດ\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"ຕ້ອງໃຊ້ການເຊື່ອມຕໍ່ອິນເຕີເນັດເພື່ອໃຊ້ Google Play Services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"ບັນຊີບໍ່ຖືກຕ້ອງ\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"ບັນຊີທີ່ເລືອກບໍ່ມີໃນອຸປະກອນນີ້. ກະລຸນາເລືອກບັນຊີອື່ນ.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"ມີປັນຫາທີ່ບໍ່ຄາດຄິດໃນບໍລິການ Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"ບໍລິການ Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"ບໍລິການ Google Play ທີ່ບາງແອັບພລິເຄຊັນຂອງທ່ານຕ້ອງອາໄສນັ້ນ ບໍ່ຖືກຮອງຮັບໃນອຸປະກອນຂອງທ່ານ. ກະລຸນາຕິດຕໍ່ຜູ້ຜະລິດສຳລັບການແນະນຳ.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"ວັນທີຂອງອຸປະກອນບໍ່ຖືກຕ້ອງ. ກະລຸນາກວດສອບວັນທີຂອງອຸປະກອນຂອງທ່ານ.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"ອັບເດດ\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"ເຂົ້າສູ່ລະບົບ\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"ເຂົ້າສູ່ລະບົບດ້ວຍ Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"ແອັບພລິເຄຊັນໄດ້ພະຍາຍາມໃຊ້ Google Play Services ເວີຊັນທີ່ບໍ່ສາມາດໃຊ້ໄດ້.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"ແອັບພລິເຄຊັນຕ້ອງການເປີດນຳໃຊ້ Google Play Services.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"ແອັບພລິເຄຊັນຕ້ອງການໃຫ້ຕິດຕັ້ງ Google Play Services.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"ແອັບພລິເຄຊັນຕ້ອງການອັບເດດ Google Play Services.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"ບໍລິການ Google Play ຜິດພາດ\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"ຮ້ອງຂໍໂດຍ <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-lt/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Gauti „Google Play“ paslaugų\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos telefone.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ši programa neveiks be „Google Play“ paslaugų, kurios neįdiegtos planšetiniame kompiuteryje.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Gauti „Google Play“ paslaugų\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Įgalinti „Google Play“ paslaugas\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Ši programa neveiks, jei neįgalinsite „Google Play“ paslaugų.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Įgal. „Google Play“ paslaugas\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Atnaujinti „Google Play“ paslaugas\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ši programa neveiks, jei neatnaujinsite „Google Play“ paslaugų.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Tinklo klaida\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Norint prisijungti prie „Google Play“ paslaugų reikia duomenų ryšio.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Netinkama paskyra\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Nurodytos paskyros šiame įrenginyje nėra. Pasirinkite kitą paskyrą.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Nežinoma „Google Play“ paslaugų problema.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"„Google Play“ paslaugos\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Jūsų įrenginys nepalaiko „Google Play“ paslaugų, kuriomis remiasi kai kurios programos. Jei reikia pagalbos, susisiekite su gamintoju.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Įrenginyje nurodyta data neteisinga. Patikrinkite įrenginyje nurodytą datą.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Atnaujinti\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Prisij.\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Prisij. naud. „Google“\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Programa bandė naudotis netinkama „Google Play“ paslaugų versija.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Norint naudoti programą būtina įgalinti „Google Play“ paslaugas.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Norint naudoti programą būtina įdiegti „Google Play“ paslaugas.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Norint naudoti programą būtina atnaujinti „Google Play“ paslaugas.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"„Google Play“ paslaugų klaida\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Užklausą pateikė „<xliff:g id=\"APP_NAME\">%1$s</xliff:g>“\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-lv/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play pakalpojumu iegūšana\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Lai šī lietotne darbotos, tālrunī ir jāinstalē Google Play pakalpojumi.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Lai šī lietotne darbotos, planšetdatorā ir jāinstalē Google Play pakalpojumi.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Iegūt Google Play pakalpojumus\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play pakalpojumu iespējošana\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Lai šī lietotne darbotos, iespējojiet Google Play pakalpojumus.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Iespējot Google Play pakalpojumus\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play pakalpojumu atjaunināšana\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Lai šī lietotne darbotos, atjauniniet Google Play pakalpojumus.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Tīkla kļūda\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Lai izveidotu savienojumu ar Google Play pakalpojumiem, ir nepieciešams datu savienojums.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Nederīgs konts\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Norādītais konts šajā ierīcē nepastāv. Lūdzu, izvēlieties citu kontu.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Nezināma problēma ar Google Play pakalpojumiem.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play pakalpojumi\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Jūsu ierīce neatbalsta Google Play pakalpojumus, kuri nepieciešami dažu jūsu lietojumprogrammu darbībai. Lūdzu, sazinieties ar ražotāju, lai saņemtu palīdzību.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Šķiet, ka ierīcē ir iestatīts nepareizs datums. Lūdzu, pārbaudiet ierīces datumu.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Atjaunināt\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Pierakst.\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Pierakstīties Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Lietojumpr. mēģināja izmantot nederīgu Google Play pakalp. versiju.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Lai lietojumprogramma darbotos, ir jāiespējo Google Play pakalpojumi.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Lai lietojumprogramma darbotos, ir jāinstalē Google Play pakalpojumi.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Lai lietojumprogramma darbotos, jāatjaunina Google Play pakalpojumi.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play pakalpojumu kļūda\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Pieprasījums no lietotnes <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-mn-rMN/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play үйлчилгээ авах\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Таны утсанд байхгүй байгаа Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Таны таблетэд байхгүй Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play үйлчилгээ авах\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play үйлчилгээг идэвхжүүлэх\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Та Google Play үйлчилгээг идэвхжүүлж байж энэ апп-г ажиллуулах боломжтой.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play үйлчилгээг идэвхжүүлэх\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play үйлчилгээг шинэчлэх\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Та Google Play үйлчилгээг шинэчлэхгүй бол энэ апп ажиллах боломжгүй.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Сүлжээний алдаа\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play үйлчилгээнд холбогдохын тулд дата холболт шаардлагатай.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Буруу акаунт\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Заасан акаунт энэ төхөөрөмж дээр байхгүй байна. Өөр акаунт сонгоно уу.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play үйлчилгээтэй холбоотой тодорхойгүй алдаа.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play үйлчилгээ\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Таны зарим аппликешнүүдийн хамаардаг Google Play үйлчилгээ таны төхөөрөмжид дэмжигдэхгүй байна. Тусламж авахын тулд үйлдвэрлэгчтэй холбоо барина уу.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Төхөөрөмжийн огноо буруу байгаа бололтой. Төхөөрөмжийн огноог шалгана уу.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Шинэчлэх\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Нэвтрэх\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Google-р нэвтрэх:\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Аппликешн Google Play Үйлчилгээний муу хувилбарыг ашиглахыг оролдлоо.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Аппликешн Google Play Үйлчилгээг идэвхжүүлсэн байхыг шаардана.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Аппликешн Google Play Үйлчилгээг суулгахыг шаардана.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Аппликешн Google Play Үйлчилгээг шинэчлэхийг шаардана.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play үйлчилгээний алдаа\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Хүсэлт гаргасан <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ms-rMY/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Dapatkan perkhidmatan Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada telefon anda.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Apl ini tidak akan berfungsi tanpa perkhidmatan Google Play dan apl ini tiada pada tablet anda.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Dapatkan perkhidmatan Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Dayakan perkhidmatan Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Apl ini tidak akan berfungsi kecuali anda mendayakan perkhidmatan Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Dayakan perkhidmatan Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Kemas kini perkhidmatan Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Apl ini tidak akan berfungsi kecuali anda mengemas kini perkhidmatan Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Ralat Rangkaian\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Sambungan data diperlukan untuk menyambung ke perkhidmatan Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Akaun Tidak Sah\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Akaun yang dinyatakan tidak wujud pada peranti ini. Sila pilih akaun yang lain.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Isu tidak diketahui dengan perkhidmatan Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Perkhidmatan Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Peranti anda tidak menyokong perkhidmatan Google Play, sedangkan sesetengah aplikasi anda memerlukannya. Sila hubungi pengilang untuk bantuan.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Tarikh pada peranti kelihatan tidak betul. Sila semak tarikh pada peranti.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Kemas kini\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Log masuk\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Log masuk dengan Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplikasi cuba menggunakan versi Perkhidmatan Google Play yang rosak.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Perkhidmatan Google Play perlu didayakan untuk menggunakan aplikasi.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Perkhidmatan Google Play perlu dipasang untuk mengguankan aplikasi.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Perkhidmatan Google Play perlu dikemas kini untuk menggunakan aplikasi.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Ralat perkhidmatan Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Diminta oleh <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-nb/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Installer Google Play Tjenester\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på telefonen din.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Denne appen kan ikke kjøres uten Google Play Tjenester, som ikke er installert på nettbrettet ditt.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Installer Google Play Tjenester\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Aktiver Google Play Tjenester\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Denne appen fungerer ikke med mindre du aktiverer Google Play Tjenester.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Aktiver Google Play Tjenester\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Oppdater Google Play Tjenester\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Denne appen kan ikke kjøres før du oppdaterer Google Play Tjenester.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Nettverksfeil\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Du må ha datatilkobling for å koble deg til Google Play-tjenester.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Ugyldig konto\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Den angitte kontoen finnes ikke på enheten. Velg en annen konto.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Det oppsto et ukjent problem med Google Play Tjenester.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play-tjenester\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play Tjenester, som noen av appene er avhengige av, støttes ikke av enheten. Ta kontakt med produsenten for å få hjelp.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Datoen på enheten ser ut til å være feil. Sjekk datoen på enheten.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Oppdater\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Logg på\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Logg inn med Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"En app prøvde å bruke en skadet versjon av Google Play Tjenester.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"En app krever Google Play Tjenester for å aktiveres.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"En app krever at Google Play Tjenester installeres.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"En app krever at Google Play Tjenester oppdateres.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play Tjenester-feil\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Forespurt av <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-nl/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play-services ophalen\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw telefoon.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Deze app kan niet worden uitgevoerd zonder Google Play-services die ontbreken op uw tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play-services ophalen\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play-services inschakelen\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Deze app werkt niet, tenzij u Google Play-services inschakelt.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play-services inschak.\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play-services bijwerken\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Deze app kan niet worden uitgevoerd, tenzij u Google Play-services bijwerkt.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Netwerkfout\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Er is een gegevensverbinding nodig om verbinding te kunnen maken met Google Play-services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Ongeldig account\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Het gespecificeerde account bestaat niet op dit apparaat. Kies een ander account.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Onbekend probleem met Google Play-services.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play-services\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play-services, dat vereist is voor een aantal van uw applicaties, wordt niet ondersteund door uw apparaat. Neem contact op met de fabrikant voor ondersteuning.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"De datum op het apparaat lijkt onjuist. Controleer de datum op het apparaat.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Bijwerken\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Inloggen\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Inloggen met Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Onjuiste versie van Google Play-services wordt gebruikt.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Google Play-services moet zijn ingeschakeld voor een applicatie.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Google Play-services moet zijn geïnstalleerd voor een applicatie.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Google Play-services moet worden geüpdatet voor een applicatie.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Fout met Google Play-services\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Aangevraagd door <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-pl/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Pobierz Usługi Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na telefonie.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ta aplikacja nie będzie działać bez Usług Google Play, których nie masz na tablecie.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Pobierz Usługi Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Włącz Usługi Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Ta aplikacja nie będzie działać, jeśli nie włączysz Usług Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Włącz Usługi Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Aktualizuj Usługi Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ta aplikacja nie będzie działać, jeśli nie zaktualizujesz Usług Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Błąd sieci\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Korzystanie z usług Google Play wymaga połączenia z internetem.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Nieprawidłowe konto\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Podanego konta nie ma na tym urządzeniu. Wybierz inne konto.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Nieznany problem z Usługami Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Usługi Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Usługi Google Play, od których zależy działanie niektórych aplikacji, nie są obsługiwane na Twoim urządzeniu. Skontaktuj się z producentem, by uzyskać pomoc.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Data ustawiona na urządzeniu wydaje się nieprawidłowa. Sprawdź datę ustawioną na urządzeniu.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Aktualizuj\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Zaloguj się\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Zaloguj się przez Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplikacja próbowała skorzystać z nieprawidłowej wersji Usług Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Aplikacja wymaga włączenia Usług Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Aplikacja wymaga zainstalowania Usług Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Aplikacja wymaga aktualizacji Usług Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Błąd usług Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Żądanie z aplikacji <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-pt/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Instale o Google Play Services\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Instalar o Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Ative o Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Este aplicativo só funciona com o Google Play Services ativado.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Ativar o Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Atualize o Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Este aplicativo só funciona com uma versão atualizada do Google Play Services.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Erro na rede\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"É necessária uma conexão de dados para conectar ao Google Play Services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Conta inválida\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"A conta especificada não existe no dispositivo. Escolha outra conta.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Problema desconhecido com o Google Play Services.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Play Services\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"A data no dispositivo parece incorreta. Verifique a data no dispositivo.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Atualizar\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Login\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Fazer login com o Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Um aplicativo tentou usar uma versão errada do Google Play Services.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Um aplicativo requer a ativação do Google Play Services.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Um aplicativo requer a instalação do Google Play Services.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Um aplicativo requer a atualização do Google Play Services.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Ocorreu um erro no Google Play Services\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Solicitado por <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-pt-rBR/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Instale o Google Play Services\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu telefone.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Este aplicativo não funciona sem o Google Play Services, que não está instalado em seu tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Instalar o Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Ative o Google Play Services\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Este aplicativo só funciona com o Google Play Services ativado.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Ativar o Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Atualize o Google Play Services\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Este aplicativo só funciona com uma versão atualizada do Google Play Services.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Erro na rede\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"É necessária uma conexão de dados para conectar ao Google Play Services.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Conta inválida\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"A conta especificada não existe no dispositivo. Escolha outra conta.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Problema desconhecido com o Google Play Services.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Play Services\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"O Google Play Services, necessário para alguns dos aplicativos, não é compatível com seu dispositivo. Entre em contato com o fabricante para obter assistência.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"A data no dispositivo parece incorreta. Verifique a data no dispositivo.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Atualizar\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Login\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Fazer login com o Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Um aplicativo tentou usar uma versão errada do Google Play Services.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Um aplicativo requer a ativação do Google Play Services.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Um aplicativo requer a instalação do Google Play Services.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Um aplicativo requer a atualização do Google Play Services.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Ocorreu um erro no Google Play Services\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Solicitado por <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-pt-rPT/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Obter serviços do Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu telemóvel.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Esta aplicação não será executada sem os serviços do Google Play, que estão em falta no seu tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Obter serviços do Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Ativar serviços do Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Esta aplicação não funcionará enquanto não ativar os serviços do Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Ativar serviços do Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Atualizar serviços do Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Esta aplicação não será executada enquanto não atualizar os serviços do Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Erro de Rede\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"É necessária uma ligação de dados para se ligar aos Serviços do Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Conta Inválida\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"A conta especificada não existe neste dispositivo. Escolha uma conta diferente.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Problema desconhecido nos serviços do Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Serviços do Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Os serviços do Google Play, dos quais dependem algumas das suas aplicações, não são suportados pelo seu dispositivo. Contacte o fabricante para obter assistência.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"A data no dispositivo parece estar incorreta. Verifique a data no dispositivo.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Atualizar\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Inic. ses.\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Inic. sessão com o Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplicação tentou utiliz. versão incorreta dos Serviços do Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Uma aplicação necessita da ativação dos Serviços do Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Uma aplicação necessita da instalação dos Serviços do Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Uma aplicação necessita da atualização dos Serviços do Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Erro dos serviços do Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Solicitado por <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ro/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Descărcaţi Servicii Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe telefon.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Această aplicaţie nu poate rula fără Servicii Google Play, care lipsesc de pe tabletă.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Obţineţi Servicii Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Activaţi Servicii Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Această aplicaţie nu va funcţiona decât dacă activaţi Servicii Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Activaţi Servicii Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Actualizaţi Servicii Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Această aplicaţie nu poate rula decât dacă actualizaţi Servicii Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Eroare de reţea\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Este necesară o conexiune de date pentru a vă conecta la serviciile Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Cont nevalid\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Contul menționat nu există pe acest dispozitiv. Alegeți alt cont.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Problemă necunoscută privind Servicii Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Servicii Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Gadgetul nu acceptă serviciile Google Play, pe care se bazează unele dintre aplicații. Pentru asistență, contactați producătorul gadgetului.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Data de pe dispozitiv pare să fie incorectă. Verificați data de pe dispozitiv.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Actualizaţi\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Conectați\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Conectați-vă cu Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplicația a încercat să utilizeze o vers. Servicii Google Play greșită\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"O aplicație necesită activarea Serviciilor Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"O aplicație necesită instalarea Serviciilor Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"O aplicație necesită o actualizare pentru Servicii Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Eroare Servicii Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Solicitată de <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-ru/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Установите Сервисы Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Для работы этого приложения требуется установить Сервисы Google Play.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Для работы этого приложения требуется установить Сервисы Google Play.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Установить\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Включите Сервисы Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Для работы этого приложения требуется включить Сервисы Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Включить\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Обновите Сервисы Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Для работы этого приложения требуется обновить Сервисы Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Ошибка сети\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Для работы с Google Play требуется подключение к сети.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Недействительный аккаунт\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Этого аккаунта нет на устройстве. Выберите другой.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Неизвестная ошибка с Сервисами Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Сервисы Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Сервисы Google Play, необходимые для работы некоторых приложений, не поддерживаются на вашем устройстве. Обратитесь к производителю.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Проверьте правильность даты, указанной на устройстве.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Обновить\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Войти\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Войти в аккаунт Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Версия сервисов Google Play неисправна\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Для работы приложения требуется включить сервисы Google Play\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Для работы приложения требуется установить сервисы Google Play\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Для работы приложения требуется обновить сервисы Google Play\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Ошибка сервисов Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Запрос от приложения \\\"<xliff:g id=\"APP_NAME\">%1$s</xliff:g>\\\"\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-sk/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Inštalovať služby Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v telefóne nemáte.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Na spustenie tejto aplikácie sa vyžadujú služby Google Play, ktoré v tablete nemáte.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Inštalovať služby Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Povoliť služby Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Táto aplikácia bude fungovať až po povolení služieb Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Povoliť služby Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Aktualizovať služby Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Túto aplikáciu bude možné spustiť až po aktualizácii služieb Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Chyba siete\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Pripojenie k službám Google Play si vyžaduje dátové pripojenie.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Neplatný účet\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Zadaný účet v tomto zariadení neexistuje. Vyberte iný účet.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Neznámy problém so službami Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Služby Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Niektoré vaše aplikácie vyžadujú služby Google Play, ktoré vo vašom zariadení nie sú podporované. Ak potrebujete pomoc, kontaktujte výrobcu.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Dátum nastavený v zariadení sa zdá byť nesprávny. Skontrolujte ho.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Aktualizovať\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Prihlásiť sa\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Prihlásiť sa do účtu Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplikácia sa pokúsila použiť nesprávnu verziu služieb Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Aplikácia vyžaduje povolenie služieb Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Aplikácia vyžaduje inštaláciu služieb Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Aplikácia vyžaduje aktualizáciu služieb Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Chyba služieb Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Vyžiadané aplikáciou <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-sl/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Namestite storitve Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v telefonu.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ta aplikacija ne deluje brez storitev Google Play, ki jih ni v tabličnem računalniku.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Namestite storitve Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Omogočite storitve Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Aplikacija ne bo delovala, če ne omogočite storitev Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Omogočite storitve Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Posodobite storitve Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ta aplikacija ne deluje, če ne posodobite storitev Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Omrežna napaka\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Za povezavo s storitvami Google Play potrebujete internetno povezavo.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Neveljaven račun\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"V tej napravi ne obstaja navedeni račun. Izberite drugega.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Neznana težava s storitvami Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Storitve Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Vaša naprava na podpira storitev Google Play, ki jih potrebujejo nekatere od vaših aplikacij. Za pomoč se obrnite na izdelovalca.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Videti je, da je datum v napravi napačen. Preverite ga.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Posodobi\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Prijava\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Prijavite se v Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Aplikacija je poskusila uporabiti napačno različico Storitev Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Za delovanje aplikacije morate omogočiti Storitve Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Za delovanje aplikacije morate namestiti Storitve Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Za delovanje aplikacije morate posodobiti Storitve Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Napaka storitev Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Zahtevala aplikacija <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-sr/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Преузимање Google Play услуга\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ова апликација не може да се покрене без Google Play услуга, које недостају на телефону.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ова апликација не може да се покрене без Google Play услуга, које недостају на таблету.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Преузми Google Play услуге\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Омогућавање Google Play услуга\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Ова апликација неће функционисати ако не омогућите Google Play услуге.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Омогући Google Play услуге\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Ажурирање Google Play услуга\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ова апликација не може да се покрене ако не ажурирате Google Play услуге.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Грешка на мрежи\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"За повезивање са Google Play услугама потребна је веза за пренос података.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Неважећи налог\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Наведени налог не постоји на овом уређају. Одаберите други налог.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Непознат проблем са Google Play услугама.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play услуге\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Google Play услуге, које су потребне за функционисање неких од апликација, нису подржане на уређају. Контактирајте произвођача да бисте добили помоћ.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Изгледа да су подаци на уређају нетачни. Проверите датум на уређају.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Ажурирај\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Пријави ме\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Пријави ме преко Google-а\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Апликација је покушала да користи лошу верзију Google Play услуга.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Апликација захтева да Google Play услуге буду омогућене.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Апликација захтева инсталирање Google Play услуга.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Апликација захтева ажурирање Google Play услуга.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Грешка Google Play услуга\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Захтева <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-sv/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Hämta Google Play Tjänster\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Den här appen kan inte köras utan Google Play Tjänster, som saknas på mobilen.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Den här appen kan inte köras utan Google Play Tjänster, som saknas på surfplattan.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Hämta Google Play Tjänster\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Aktivera Google Play Tjänster\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Du måste aktivera Google Play Tjänster för att den här appen ska fungera.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Aktivera Google Play Tjänster\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Uppdatera Google Play Tjänster\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Du måste uppdatera Google Play Tjänster innan du kan köra den här appen.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Nätverksfel\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"En dataanslutning krävs för att ansluta till Google Plays tjänster.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Ogiltigt konto\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Det angivna kontot finns inte på den här enheten. Välj ett annat konto.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Okänt problem med Google Play Tjänster\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play-tjänster\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Några av dina appar använder Google Play-tjänster som inte stöds av din enhet. Kontakta tillverkaren om du vill ha hjälp.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Datumet på enheten verkar inte vara rätt. Kontrollera datumet på enheten.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Uppdatera\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Logga in\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Logga in med Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"En olämplig version av Google Play Tjänster anropades av en app.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Google Play Tjänster måste aktiveras för en att app ska fungera.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Google Play Tjänster måste installeras för att en app ska fungera.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Google Play Tjänster måste uppdateras för en app ska fungera.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Fel på Google Play Tjänster\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Begärdes av <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-sw/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Pata huduma za Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Programu hii haiwezi kuendeshwa bila huduma za Google Play, ambazo hazipo kwenye simu yako.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Programu hii haiwezi kufanya kazi bila huduma za Google Play, ambazo hazipatikani kwenye kompyuta kibao yako.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Pata huduma za Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Wezesha huduma za Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Programu hii haitafanya kazi mpaka utakapowezesha huduma za Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Wezesha huduma za Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Sasisha huduma za Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Programu hii haiwezi kuendeshwa mpaka utakaposasisha huduma za Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Hitilafu ya Mtandao\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Muunganisho wa data unahitajika ili kuunganisha kwenye huduma za Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Akaunti Batili\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Akaunti iliyobainishwa haipo kwenye kifaa hiki. Tafadhali chagua akaunti tofauti.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Suala lisilojulikana na huduma za Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Huduma za Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Huduma za Google Play, ambazo baadhi ya programu zako zinategemea, si linganifu na kifaa chako. Tafadhali wasiliana na mtengenezaji kwa usaidizi.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Inaeonekana tarehe ya kifaa sio sahihi. Tafadhali angalia tarehe ya kifaa.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Sasisha\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Ingia\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Ingia ukitumia Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Programu ilijaribu kutumia toleo baya la Huduma za Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Programu inahitaji Huduma za Google Play ili kuwashwa.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Programu inahitaji usakinishaji wa Huduma za Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Programu inahitaji sasisho la Huduma za Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Hitilafu kwenye Huduma za Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Imeombwa na <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-th/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"รับบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในโทรศัพท์ของคุณ\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"แอปพลิเคชันนี้จะไม่ทำงานหากไม่มีบริการ Google Play ซึ่งไม่มีในแท็บเล็ตของคุณ\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"รับบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"เปิดใช้งานบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะเปิดใช้งานบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"เปิดใช้งานบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"อัปเดตบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"แอปพลิเคชันนี้จะไม่ทำงานจนกว่าคุณจะอัปเดตบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"ข้อผิดพลาดของเครือข่าย\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"ต้องมีการเขื่อมต่อข้อมูลเพื่อเชื่อมต่อกับบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"บัญชีไม่ถูกต้อง\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"บัญชีที่ระบุไม่มีอยู่บนอุปกรณ์นี้ โปรดเลือกบัญชีอื่น\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"ปัญหาที่ไม่รู้จักของบริการ Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"บริการ Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"บริการ Google Play ซึ่งใช้งานในบางแอปพลิเคชัน ไม่ได้รับการสนับสนุนโดยอุปกรณ์ของคุณ โปรดติดต่อผู้ผลิตเพื่อขอรับความช่วยเหลือ\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"วันที่บนอุปกรณ์ไม่ถูกต้อง โปรดตรวจสอบวันที่บนอุปกรณ์\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"อัปเดต\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"ลงชื่อใช้\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"ลงชื่อเข้าใช้ด้วย Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"แอปพลิเคชันหนึ่งพยายามใช้เวอร์ชันที่ไม่เหมาะสมของบริการ Google Play\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"แอปพลิเคชันหนึ่งจำเป็นต้องมีบริการ Google Play เพื่อเปิดใช้งาน\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"แอปพลิเคชันหนึ่งจำเป็นต้องมีการติดตั้งบริการ Google Play\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"แอปพลิเคชันหนึ่งจำเป็นต้องมีการอัปเดตสำหรับบริการ Google Play\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"ข้อผิดพลาดของบริการ Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"ขอโดย <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-tl/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Kumuha ng mga serbisyo ng Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Hindi tatakbo ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong telepono.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Hindi gagana ang app na ito nang wala ang mga serbisyo ng Google Play, na wala sa iyong tablet.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Kumuha ng Google Play services\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Paganahin ang Google Play services\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Hindi gagana ang app na ito maliban kung papaganahin mo ang mga serbisyo ng Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Enable Google Play services\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"I-update ang mga serbisyo ng Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Hindi gagana ang app na ito maliban kung i-a-update mo ang mga serbisyo ng Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"May Error sa Network\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Kailangan ng koneksyon ng data upang makakonekta sa mga serbisyo ng Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Di-wasto ang Account\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Hindi umiiral ang tinukoy na account sa device na ito. Mangyaring pumili ng ibang account.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"May hindi alam na isyu sa mga serbisyo ng Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Mga serbisyo ng Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Ang mga serbisyo ng Google Play, kung saan nakadepende ang ilan sa iyong mga application, ay hindi sinusuportahan ng iyong device. Mangyaring makipag-ugnay sa manufacturer para sa tulong.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Mukhang hindi tama ang petsa sa device. Pakisuri ang petsa sa device.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"I-update\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Sign in\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Mag-sign in sa Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"May app na sumubok ng maling bersyon ng Mga Serbisyo ng Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Kailangan ng application na na-enable ang Mga Serbisyo ng Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Kailangan ng application na ma-install ang Serbisyo ng Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Kailangan ng application na i-update ang Mga Serbisyo ng Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Error sa mga serbisyo ng Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Hiniling ng <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-tr/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Google Play hizmetlerini edinin\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Google Play Hizmetleri telefonunuzda yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Google Play Hizmetleri tabletinizde yok ve bu uygulama Google Play Hizmetleri olmadan çalışmaz.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Google Play hizmetlerini edin\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Google Play hizmetlerini etkinleştir\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Bu uygulama, Google Play Hizmetleri etkinleştirilmeden çalışmaz\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Google Play hizmetlerini etkinleştir\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Google Play hizmetlerini güncelle\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Bu uygulama Google Play Hizmetleri güncellenmeden çalışmaz.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Ağ Hatası\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Google Play hizmetlerine bağlanmak için bir veri bağlantısı gerekiyor.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Geçersiz Hesap\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Belirtilen hesap bu cihazda mevcut değil. Lütfen farklı bir hesap seçin.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play hizmetleriyle ilgili bilinmeyen sorun.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play hizmetleri\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Cihazınız, uygulamalarınızdan bazıları için gerekli olan Google Play hizmetlerini desteklemiyor. Lütfen yardım için üreticiyle iletişim kurun.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Cihazdaki tarih doğru görünmüyor. Lütfen cihazda ayarlı tarihi kontrol edin.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Güncelle\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Oturum aç\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Google\\'da oturum aç\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Bir uygulama, Google Play Hizmetleri\\'nin bozuk bir sürümünü kullanmayı denedi.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Bir uygulama, Google Play Hizmetleri\\'nin etkin olmasını gerektiriyor.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Bir uygulama, Google Play Hizmetleri\\'nin yüklenmesini gerektiriyor.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Bir uygulama, Google Play Hizmetleri için bir güncelleme gerektiriyor.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play hizmetleri hatası\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"İstekte bulunan: <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-uk/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Установити Google Play Послуги\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ця програма не запуститься без Google Play Послуг, яких немає у вашому телефоні.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ця програма не запуститься без Google Play Послуг, яких немає на вашому планшетному ПК.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Установити Google Play Послуги\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Увімкнути Google Play Послуги\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Ця програма не працюватиме, поки ви не ввімкнете Google Play Послуги.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Увімкнути Google Play Послуги\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Оновити Google Play Послуги\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ця програма не запуститься, поки ви не оновите Google Play Послуги.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Помилка мережі\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Для під’єднання до сервісів Google Play потрібне з’єднання з мережею.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Недійсний обліковий запис\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Указаний обліковий запис не існує на цьому пристрої. Виберіть інший обліковий запис.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play Послуги – невідома проблема.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Сервіси Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Ваш пристрій не підтримує Сервіси Google Play, від яких залежить робота деяких програм. Зверніться по допомогу до виробника.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Схоже, на пристрої вказано неправильну дату. Перевірте її.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Оновити\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Увійти\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Увійти в обл.запис Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Програма спробувала застосувати хибну версію Сервісів Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Щоб програма працювала, потрібно ввімкнути Сервіси Google Play.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Щоб програма працювала, потрібно встановити Сервіси Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Щоб програма працювала, потрібно оновити Сервіси Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Помилка Сервісів Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Запит від програми <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-vi/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Cài đặt dịch vụ của Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Điện thoại của bạn bị thiếu dịch vụ này.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Ứng dụng này sẽ không chạy nếu không có dịch vụ của Google Play. Máy tính bảng của bạn bị thiếu dịch vụ này.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Cài đặt dịch vụ của Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Bật dịch vụ của Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Ứng dụng này sẽ không hoạt động trừ khi bạn bật dịch vụ của Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Bật dịch vụ của Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Cập nhật dịch vụ của Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Ứng dụng này sẽ không chạy trừ khi bạn cập nhật dịch vụ của Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Lỗi mạng\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Cần có kết nối dữ liệu để kết nối với các dịch vụ của Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"Tài khoản không hợp lệ\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"Tài khoản đã chỉ định không tồn tại trên thiết bị này. Vui lòng chọn một tài khoản khác.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Sự cố không xác định với dịch vụ của Google Play.\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Dịch vụ của Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Các dịch vụ của Google Play mà một số ứng dụng của bạn dựa vào không được thiết bị của bạn hỗ trợ. Vui lòng liên hệ với nhà sản xuất để được hỗ trợ.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Ngày trên thiết bị có vẻ không chính xác. Vui lòng kiểm tra ngày trên thiết bị.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Cập nhật\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Đăng nhập\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Đăng nhập bằng Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Ứng dụng đã cố sử dụng phiên bản không đúng của Dịch vụ của Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Ứng dụng yêu cầu Dịch vụ của Google Play phải được bật.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Ứng dụng yêu cầu cài đặt Dịch vụ của Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Ứng dụng yêu cầu cập nhật dành cho Dịch vụ Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Lỗi dịch vụ của Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Được yêu cầu bởi <xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-zh-rCN/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"获取 Google Play 服务\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"您的手机中没有 Google Play 服务，您必须先安装该服务才能运行此应用。\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"您的平板电脑中没有 Google Play 服务，您必须先安装该服务才能运行此应用。\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"获取 Google Play 服务\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"启用 Google Play 服务\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"您必须先启用 Google Play 服务才能运行此应用。\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"启用 Google Play 服务\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"更新 Google Play 服务\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"您必须先更新 Google Play 服务才能运行此应用。\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"网络错误\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"您必须有数据网络连接才能接入 Google Play 服务。\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"无效帐户\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"此设备上不存在指定的帐户，请选择其他帐户。\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play 服务出现未知问题。\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play 服务\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"您的设备不支持部分应用所依赖的 Google Play 服务。请与设备制造商联系，以寻求帮助。\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"设备上的日期似乎不正确，请在设备上检查日期。\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"更新\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"登录\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"使用 Google 帐户登录\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"某个应用尝试使用的 Google Play 服务版本有误。\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"某个应用要求启用 Google Play 服务。\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"某个应用要求安装 Google Play 服务。\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"某个应用要求更新 Google Play 服务。\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play 服务出错\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"由“<xliff:g id=\"APP_NAME\">%1$s</xliff:g>”发出\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-zh-rHK/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"取得 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"您的手機未安裝 Google Play 服務，安裝後才能執行這個應用程式。\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"您的平板電腦未安裝 Google Play 服務，安裝後才能執行這個應用程式。\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"取得 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"啟用 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"您必須啟用 Google Play 服務，才能執行這個應用程式。\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"啟用 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"更新 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"您必須更新 Google Play 服務，才能執行這個應用程式。\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"網絡錯誤\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"要連接 Google Play 服務，必需數據連線。\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"無效的帳戶\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"這個裝置上沒有您指定的帳戶，請選擇其他帳戶。\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play 服務出現不明問題。\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play 服務\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"您的裝置不支援部分應用程式所需的 Google Play 服務。如需協助，請與您的裝置製造商聯絡。\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"裝置上的日期看來不正確，請檢查裝置上的日期。\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"更新\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"登入\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"登入 Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"應用程式嘗試使用錯誤版本的「Google Play 服務」。\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"必須啟用「Google Play 服務」，才能使用應用程式。\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"必須安裝「Google Play 服務」，才能使用應用程式。\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"必須更新「Google Play 服務」，才能使用應用程式。\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play 服務錯誤\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"「<xliff:g id=\"APP_NAME\">%1$s</xliff:g>」提出要求\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-zh-rTW/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"取得 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"您的手機並未安裝 Google Play 服務，所以無法執行這個應用程式。\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"您的平板電腦並未安裝 Google Play 服務，所以無法執行這個應用程式。\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"取得 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"啟用 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"您必須啟用 Google Play 服務，這個應用程式才能運作。\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"啟用 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"更新 Google Play 服務\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"您必須更新 Google Play 服務，才能執行這個應用程式。\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"網路錯誤\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"需要數據連線才能連上 Google Play 服務。\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"無效的帳戶\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"這個裝置上沒有您所指定的帳戶，請選擇其他帳戶。\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Google Play 服務發生不明問題。\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Google Play 服務\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"您的裝置不支援部分應用程式所需的 Google Play 服務。如需協助，請與您的裝置製造商聯絡。\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"裝置上的日期似乎不正確，請檢查裝置上的日期。\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"更新\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"登入\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"使用 Google 帳戶登入\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"應用程式嘗試使用的 Google Play 服務版本有誤。\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"應用程式需要啟用 Google Play 服務。\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"應用程式需要安裝 Google Play 服務。\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"應用程式需要更新 Google Play 服務。\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Google Play 服務錯誤\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"提出要求的應用程式：<xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/res/values-zu/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<resources xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n    <string name=\"common_google_play_services_install_title\" msgid=\"26645092511305524\">\"Thola amasevisi e-Google Play\"</string>\n    <string name=\"common_google_play_services_install_text_phone\" msgid=\"8685301130651051380\">\"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho efonini yakho.\"</string>\n    <string name=\"common_google_play_services_install_text_tablet\" msgid=\"1589957570365247855\">\"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle kwamasevisi e-Google Play, angekho kuthebulethi yakho.\"</string>\n    <string name=\"common_google_play_services_install_button\" msgid=\"8515591849428043265\">\"Thola amasevisi e-Google Play\"</string>\n    <string name=\"common_google_play_services_enable_title\" msgid=\"529078775174559253\">\"Nika amandla amasevisi e-Google Play\"</string>\n    <string name=\"common_google_play_services_enable_text\" msgid=\"7627896071867667758\">\"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi unike amandla amasevisi e-Google Play.\"</string>\n    <string name=\"common_google_play_services_enable_button\" msgid=\"4181637455539816337\">\"Nika amandla amasevisi e-Google Play\"</string>\n    <string name=\"common_google_play_services_update_title\" msgid=\"6006316683626838685\">\"Buyekeza amasevisi e-Google Play\"</string>\n    <string name=\"common_google_play_services_update_text\" msgid=\"448354684997260580\">\"Lolu hlelo lokusebenza ngeke lusebenze ngaphandle nje kokuthi ubuyekeze amasevisi e-Google Play.\"</string>\n    <string name=\"common_google_play_services_network_error_title\" msgid=\"3827284619958211114\">\"Iphutha lenethiwekhi\"</string>\n    <string name=\"common_google_play_services_network_error_text\" msgid=\"9038847255613537209\">\"Kudingeka ukuxhumeka kwedatha ukuze kuxhunyekwe kumasevisi we-Google Play.\"</string>\n    <string name=\"common_google_play_services_invalid_account_title\" msgid=\"1066672360770936753\">\"I-Akhawunti engavumelekile\"</string>\n    <string name=\"common_google_play_services_invalid_account_text\" msgid=\"4983316348021735578\">\"I-Akhawunti ecacisiwe ayikho kule divayisi. Sicela ukhethe i-akhawunti ehlukile.\"</string>\n    <string name=\"common_google_play_services_unknown_issue\" msgid=\"4762332809710093730\">\"Indaba engaziwa yamasevisi we-Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_title\" msgid=\"6334768798839376943\">\"Amasevisi we-Google Play\"</string>\n    <string name=\"common_google_play_services_unsupported_text\" msgid=\"3542578567569488671\">\"Amasevisi we-Google Play, okungukuthi ezinye izinhlelo zakho zithembele kuwo, awasekelwe yidivayisi yakho. Sicela uxhumane nomkhiqizi ukuze uthole usizo.\"</string>\n    <string name=\"common_google_play_services_unsupported_date_text\" msgid=\"4725396522367789365\">\"Idethi kudivayisi ibonakala ingalungile. Sicela uhlole idethi kudivayisi.\"</string>\n    <string name=\"common_google_play_services_update_button\" msgid=\"8932944190611227642\">\"Isibuyekezo\"</string>\n    <string name=\"common_signin_button_text\" msgid=\"9071884888741449141\">\"Ngena ngemvume\"</string>\n    <string name=\"common_signin_button_text_long\" msgid=\"2429381841831957106\">\"Ngena ngemvume nge-Google\"</string>\n\n    <string name=\"auth_client_using_bad_version_title\" msgid=\"2534454398764507874\">\"Uhlelo lokusebenza luzame ukusebenzisa inguqulo embi yamasevisi we-Google Play.\"</string>\n    <string name=\"auth_client_needs_enabling_title\" msgid=\"3983201110833868073\">\"Uhlelo lokusebenza ludinga amasevisi we-Google Play ukuze anikwe amandla.\"</string>\n    <string name=\"auth_client_needs_installation_title\" msgid=\"7999585836145154206\">\"Uhlelo lokusebenza ludinga ukufakwa kwamasevisi we-Google Play.\"</string>\n    <string name=\"auth_client_needs_update_title\" msgid=\"6488605506794595966\">\"Uhlelo lokusebenza ludinga isibuyekezo samasevisi we-Google Play.\"</string>\n    <string name=\"auth_client_play_services_err_notification_msg\" msgid=\"3635065018897986478\">\"Iphutha lamasevisi we-Google Play\"</string>\n    <string name=\"auth_client_requested_by_msg\" msgid=\"6304135633531965756\">\"Kucelwe yi-<xliff:g id=\"APP_NAME\">%1$s</xliff:g>\"</string>\n</resources>\n"
  },
  {
    "path": "proj.android/google-play-services_lib/src/android/UnusedStub.java",
    "content": "/*\n * Copyright (C) 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage android;\n\n// Stub java file to make inclusion into some IDE's work.\npublic final class UnusedStub {\n    private UnusedStub() { }\n}\n"
  },
  {
    "path": "proj.android/jni/Android.mk",
    "content": "LOCAL_PATH := $(call my-dir)\n\ninclude $(CLEAR_VARS)\n\nLOCAL_MODULE := cocos2dlua_shared\n\nLOCAL_MODULE_FILENAME := libcocos2dlua\n\nLOCAL_SRC_FILES := hellolua/main.cpp \\\n                   ../../Classes/AppDelegate.cpp \\\n\t\t\t\t   ../../Classes/AdmobHelper.cpp \\\n\t\t\t\t   ../../Classes/LuaInterface/lua_tinker.cpp \\\n\nLOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \\\n\t\t\t\t\t$(LOCAL_PATH)/../../Classes/LuaInterface \\\n                    $(LOCAL_PATH)/../../cocos2d/external/lua/tolua\n\nLOCAL_WHOLE_STATIC_LIBRARIES := cocos_lua_static\n\ninclude $(BUILD_SHARED_LIBRARY)\n\n$(call import-module,scripting/lua/bindings)"
  },
  {
    "path": "proj.android/jni/Application.mk",
    "content": "APP_STL := gnustl_static\nAPP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char\nAPP_CPPFLAGS += -fexceptions\n\n"
  },
  {
    "path": "proj.android/jni/hellolua/main.cpp",
    "content": "#include \"AppDelegate.h\"\n#include \"cocos2d.h\"\n#include \"CCEventType.h\"\n#include \"platform/android/jni/JniHelper.h\"\n#include <jni.h>\n#include <android/log.h>\n\n#define  LOG_TAG    \"main\"\n#define  LOGD(...)  __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)\n\nusing namespace cocos2d;\n\nvoid cocos_android_app_init (struct android_app* app) {\n    LOGD(\"cocos_android_app_init\");\n    AppDelegate *pAppDelegate = new AppDelegate();\n}\n"
  },
  {
    "path": "proj.android/local.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must *NOT* be checked into Version Control Systems,\n# as it contains information specific to your local configuration.\n\n# location of the SDK. This is only used by Ant\n# For customization when using a Version Control System, please read the\n# header note.\nsdk.dir=D:\\\\Code\\\\android\\\\android-sdk-windows\n"
  },
  {
    "path": "proj.android/proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "proj.android/project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system use,\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n\n# Project target.\ntarget=android-17\n\nandroid.library.reference.1=..\\\\cocos2d\\\\cocos\\\\2d\\\\platform\\\\android\\\\java\nandroid.library.reference.2=google-play-services_lib\n"
  },
  {
    "path": "proj.android/res/layout/main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n     Copyright (C) 2013 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/mainLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n</RelativeLayout>\n"
  },
  {
    "path": "proj.android/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>  \n<resources>  \n\t\t<declare-styleable name=\"com.admob.android.ads.AdView\">  \n\t\t\t\t<attr name=\"testing\" format=\"boolean\" />  \n\t\t\t\t<attr name=\"backgroundColor\" format=\"color\" />  \n\t\t\t\t<attr name=\"textColor\" format=\"color\" />  \n\t\t\t\t<attr name=\"keywords\" format=\"string\" />  \n\t\t\t\t<attr name=\"refreshInterval\" format=\"integer\" />  \n\t\t\t\t<attr name=\"isGoneWithoutAd\" format=\"boolean\" />  \n\t\t</declare-styleable>  \n</resources>  "
  },
  {
    "path": "proj.android/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">Open Bird</string>\n</resources>\n"
  },
  {
    "path": "proj.android/src/org/cocos2dx/lua/Cocos2dxActivity.java",
    "content": "package org.cocos2dx.lua;\n\nimport android.app.NativeActivity;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.view.Gravity;\nimport android.view.ViewGroup.LayoutParams;\nimport android.view.ViewGroup.MarginLayoutParams;\nimport android.view.WindowManager;\nimport android.widget.LinearLayout;\nimport android.widget.PopupWindow;\n\nimport com.google.android.gms.ads.AdListener;\nimport com.google.android.gms.ads.AdRequest;\nimport com.google.android.gms.ads.AdSize;\nimport com.google.android.gms.ads.AdView;\n\npublic class Cocos2dxActivity extends NativeActivity{\n\tprivate AdView adView;\n    private PopupWindow popUp;\n    private static Cocos2dxActivity _activity;\n    private LinearLayout layout;\n    private LinearLayout mainLayout;\n    boolean adsinited = false;\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\tgetWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n        _activity = this;\n        // Create our ad view here\n        adView = new AdView(this);\n                // you can get the ID from Admob\n        adView.setAdUnitId(\"a15289ac58b83d3\");\n        adView.setAdSize(AdSize.BANNER);\n        adView.setAdListener(new AdmobListener());\t\n\t}\n\t\n\tpublic static void showAdPopup(){\n        _activity._showAdPopup();\n    }\n\t\n\tpublic void _showAdPopup() {\n        if (adsinited) {\n            return;\n        }\n        if (adView != null) {\n            _activity.runOnUiThread(new Runnable() {\n                @Override\n                public void run() {\n                    adsinited = true;\n                    // Out popup window\n                    popUp = new PopupWindow(_activity);\n\n                    // This is the minimum size for AdMob, we need to set this\n                    // in case our target device run at 320x480 resolution\n                    // (Otherwise no ad will be shown, see the padding kill\n                    // below)\n\n                    popUp.setWidth(320);\n                    popUp.setHeight(50);\n                    popUp.setWindowLayoutMode(LayoutParams.WRAP_CONTENT,\n                            LayoutParams.WRAP_CONTENT);\n                    popUp.setClippingEnabled(false);\n\n                    layout = new LinearLayout(_activity);\n                    mainLayout = new LinearLayout(_activity);\n\n                    // The layout system for the PopupWindow will kill some\n                    // pixels due to margins/paddings etc (No way to remove\n                    // it), so padd it to adjust\n                    layout.setPadding(-5, -5, -5, -5);\n\n                    MarginLayoutParams params = new MarginLayoutParams(\n                            LayoutParams.WRAP_CONTENT,\n                            LayoutParams.WRAP_CONTENT);\n\n                    params.setMargins(0, 0, 0, 0);\n                    layout.setOrientation(LinearLayout.VERTICAL);\n                    layout.addView(adView, params);\n                    popUp.setContentView(layout);\n                    _activity.setContentView(mainLayout, params);\n                                        // you can get the TestDevice ID from the output of logcat .\n                    AdRequest adRequest = new AdRequest.Builder()\n                            .addTestDevice(\"03AD7BF0E367194965CC114581CFCEB1\")\n                            .build();\n                    // Enable this if your are testing AdMob, otherwise you'll\n                    // risk to be banned!\n                    _activity.adView.loadAd(adRequest);\n                    // Show our popup window\n                    \n                    popUp.update();\n\n                }\n            });\n        }\n\t}\n\t\n\tprivate class AdmobListener extends AdListener {\n        @Override\n        public void onAdClosed() {\n            super.onAdClosed();\n        }\n\n        @Override\n        public void onAdFailedToLoad(int errorCode) {\n            super.onAdFailedToLoad(errorCode);\n        }\n\n        @Override\n        public void onAdLeftApplication() {\n            super.onAdLeftApplication();\n        }\n\n        @Override\n        public void onAdLoaded() {\n            super.onAdLoaded();\n            popUp.showAtLocation(mainLayout, Gravity.BOTTOM, 0, 0);\n        }\n\n        @Override\n        public void onAdOpened() {\n            super.onAdOpened();\n        }\n    }\n\n    @Override\n    public void onDestroy() {\n        if (adView != null) {\n            adView.destroy();\n        }\n        super.onDestroy();\n    }\n \n}\n"
  },
  {
    "path": "proj.ios_mac/FlappyBird.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t01A8D331187A504A001CC002 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32E187A5049001CC002 /* CocoStudio.lua */; };\n\t\t01A8D332187A504A001CC002 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32E187A5049001CC002 /* CocoStudio.lua */; };\n\t\t01A8D333187A504A001CC002 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32F187A504A001CC002 /* extern.lua */; };\n\t\t01A8D334187A504A001CC002 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32F187A504A001CC002 /* extern.lua */; };\n\t\t01A8D335187A504A001CC002 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D330187A504A001CC002 /* GuiConstants.lua */; };\n\t\t01A8D336187A504A001CC002 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D330187A504A001CC002 /* GuiConstants.lua */; };\n\t\t15A8A4441834C43700142BE0 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */; settings = {ATTRIBUTES = (Weak, ); }; };\n\t\t15A8A4451834C43700142BE0 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */; };\n\t\t15A8A4461834C43700142BE0 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */; };\n\t\t15A8A4471834C43700142BE0 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A42D1834BDA200142BE0 /* libCocosDenshion iOS.a */; };\n\t\t15A8A4481834C43700142BE0 /* libluabindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4311834BDA200142BE0 /* libluabindings iOS.a */; };\n\t\t15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810C17EBBCAC00990C9B /* Icon-114.png */; };\n\t\t15A8A4641834C6AD00142BE0 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */; };\n\t\t15A8A4651834C6AD00142BE0 /* AudioEngine.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4551834C6AD00142BE0 /* AudioEngine.lua */; };\n\t\t15A8A4661834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */; };\n\t\t15A8A4671834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */; };\n\t\t15A8A4681834C6AD00142BE0 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */; };\n\t\t15A8A4691834C6AD00142BE0 /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4571834C6AD00142BE0 /* Cocos2d.lua */; };\n\t\t15A8A46A1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */; };\n\t\t15A8A46B1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */; };\n\t\t15A8A46C1834C6AD00142BE0 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4591834C6AD00142BE0 /* Deprecated.lua */; };\n\t\t15A8A46D1834C6AD00142BE0 /* Deprecated.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4591834C6AD00142BE0 /* Deprecated.lua */; };\n\t\t15A8A46E1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */; };\n\t\t15A8A46F1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */; };\n\t\t15A8A4701834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */; };\n\t\t15A8A4711834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */; };\n\t\t15A8A4721834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */; };\n\t\t15A8A4731834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */; };\n\t\t15A8A4741834C6AD00142BE0 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */; };\n\t\t15A8A4751834C6AD00142BE0 /* DrawPrimitives.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */; };\n\t\t15A8A4761834C6AD00142BE0 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45E1834C6AD00142BE0 /* json.lua */; };\n\t\t15A8A4771834C6AD00142BE0 /* json.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45E1834C6AD00142BE0 /* json.lua */; };\n\t\t15A8A4781834C6AD00142BE0 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45F1834C6AD00142BE0 /* luaj.lua */; };\n\t\t15A8A4791834C6AD00142BE0 /* luaj.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A45F1834C6AD00142BE0 /* luaj.lua */; };\n\t\t15A8A47A1834C6AD00142BE0 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4601834C6AD00142BE0 /* luaoc.lua */; };\n\t\t15A8A47B1834C6AD00142BE0 /* luaoc.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4601834C6AD00142BE0 /* luaoc.lua */; };\n\t\t15A8A47C1834C6AD00142BE0 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4611834C6AD00142BE0 /* Opengl.lua */; };\n\t\t15A8A47D1834C6AD00142BE0 /* Opengl.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4611834C6AD00142BE0 /* Opengl.lua */; };\n\t\t15A8A47E1834C6AD00142BE0 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */; };\n\t\t15A8A47F1834C6AD00142BE0 /* OpenglConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */; };\n\t\t15A8A4801834C6AD00142BE0 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */; };\n\t\t15A8A4811834C6AD00142BE0 /* StudioConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15A8A4631834C6AD00142BE0 /* StudioConstants.lua */; };\n\t\t15A8A4821834C73500142BE0 /* libchipmunk Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */; };\n\t\t15A8A4831834C73500142BE0 /* libcocos2dx Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4171834BDA200142BE0 /* libcocos2dx Mac.a */; };\n\t\t15A8A4841834C73500142BE0 /* libcocos2dx-extensions Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4191834BDA200142BE0 /* libcocos2dx-extensions Mac.a */; };\n\t\t15A8A4851834C73500142BE0 /* libCocosDenshion Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A41F1834BDA200142BE0 /* libCocosDenshion Mac.a */; };\n\t\t15A8A4861834C73500142BE0 /* libluabindings Mac.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4231834BDA200142BE0 /* libluabindings Mac.a */; };\n\t\t15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4871834C90E00142BE0 /* libcurl.dylib */; };\n\t\t15FFA0FD1894DDEF00C96D45 /* mobdebug.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15FFA0FC1894DDEF00C96D45 /* mobdebug.lua */; };\n\t\t15FFA0FE1894DDEF00C96D45 /* mobdebug.lua in Resources */ = {isa = PBXBuildFile; fileRef = 15FFA0FC1894DDEF00C96D45 /* mobdebug.lua */; };\n\t\t1AC3623516D47C5C000847F2 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622916D47C5C000847F2 /* fonts */; };\n\t\t1AF4C403178663F200122817 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; };\n\t\t5023811817EBBCAC00990C9B /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023810817EBBCAC00990C9B /* AppController.mm */; };\n\t\t5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810917EBBCAC00990C9B /* Default-568h@2x.png */; };\n\t\t5023811A17EBBCAC00990C9B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810A17EBBCAC00990C9B /* Default.png */; };\n\t\t5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810B17EBBCAC00990C9B /* Default@2x.png */; };\n\t\t5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810D17EBBCAC00990C9B /* Icon-120.png */; };\n\t\t5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810E17EBBCAC00990C9B /* Icon-144.png */; };\n\t\t5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023810F17EBBCAC00990C9B /* Icon-152.png */; };\n\t\t5023812017EBBCAC00990C9B /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023811017EBBCAC00990C9B /* Icon-57.png */; };\n\t\t5023812117EBBCAC00990C9B /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023811117EBBCAC00990C9B /* Icon-72.png */; };\n\t\t5023812217EBBCAC00990C9B /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = 5023811217EBBCAC00990C9B /* Icon-76.png */; };\n\t\t5023812417EBBCAC00990C9B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5023811417EBBCAC00990C9B /* main.m */; };\n\t\t5023812517EBBCAC00990C9B /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5023811717EBBCAC00990C9B /* RootViewController.mm */; };\n\t\t5023813317EBBCE400990C9B /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F293BB7E15EB831F00256477 /* AppDelegate.cpp */; };\n\t\t5023813717EBBCE400990C9B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C402178663F200122817 /* libz.dylib */; };\n\t\t5023813E17EBBCE400990C9B /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; };\n\t\t5023814017EBBCE400990C9B /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; };\n\t\t5023814117EBBCE400990C9B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D215EB7BE500256477 /* AudioToolbox.framework */; };\n\t\t5023814217EBBCE400990C9B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D415EB7BE500256477 /* AVFoundation.framework */; };\n\t\t5023814417EBBCE400990C9B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D815EB7BE500256477 /* Foundation.framework */; };\n\t\t5023814517EBBCE400990C9B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3DA15EB7BE500256477 /* CoreGraphics.framework */; };\n\t\t5023815017EBBCE400990C9B /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622916D47C5C000847F2 /* fonts */; };\n\t\t5023817617EBBE3400990C9B /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5023817217EBBE3400990C9B /* Icon.icns */; };\n\t\t5023817817EBBE3400990C9B /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5023817417EBBE3400990C9B /* main.cpp */; };\n\t\t5023817A17EBBE8300990C9B /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5023817917EBBE8300990C9B /* OpenGLES.framework */; };\n\t\t50805AAF17EBBEAA004CFAD3 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50805AAE17EBBEAA004CFAD3 /* UIKit.framework */; };\n\t\t5091733617ECE17A00D62437 /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733017ECE17A00D62437 /* Icon-29.png */; };\n\t\t5091733717ECE17A00D62437 /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733117ECE17A00D62437 /* Icon-40.png */; };\n\t\t5091733817ECE17A00D62437 /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733217ECE17A00D62437 /* Icon-50.png */; };\n\t\t5091733917ECE17A00D62437 /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733317ECE17A00D62437 /* Icon-58.png */; };\n\t\t5091733A17ECE17A00D62437 /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733417ECE17A00D62437 /* Icon-80.png */; };\n\t\t5091733B17ECE17A00D62437 /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = 5091733517ECE17A00D62437 /* Icon-100.png */; };\n\t\t50D7C96C17EBBEDF005D0B91 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */; };\n\t\t50D7C96E17EBBEE6005D0B91 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96D17EBBEE6005D0B91 /* AppKit.framework */; };\n\t\t50D7C97017EBBEEC005D0B91 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D7C96F17EBBEEC005D0B91 /* IOKit.framework */; };\n\t\tA55DD5DC18AB752800D0F4D3 /* main.lua in Resources */ = {isa = PBXBuildFile; fileRef = A55DD5D918AB752800D0F4D3 /* main.lua */; };\n\t\tA55DD5DD18AB752800D0F4D3 /* main.lua in Resources */ = {isa = PBXBuildFile; fileRef = A55DD5D918AB752800D0F4D3 /* main.lua */; };\n\t\tA55DD5DE18AB752800D0F4D3 /* res in Resources */ = {isa = PBXBuildFile; fileRef = A55DD5DA18AB752800D0F4D3 /* res */; };\n\t\tA55DD5DF18AB752800D0F4D3 /* res in Resources */ = {isa = PBXBuildFile; fileRef = A55DD5DA18AB752800D0F4D3 /* res */; };\n\t\tA55DD5E018AB752800D0F4D3 /* scripts in Resources */ = {isa = PBXBuildFile; fileRef = A55DD5DB18AB752800D0F4D3 /* scripts */; };\n\t\tA55DD5E118AB752800D0F4D3 /* scripts in Resources */ = {isa = PBXBuildFile; fileRef = A55DD5DB18AB752800D0F4D3 /* scripts */; };\n\t\tD6B061351803AC000077942B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6B061341803AC000077942B /* CoreMotion.framework */; };\n\t\tF293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3CC15EB7BE500256477 /* QuartzCore.framework */; };\n\t\tF293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D015EB7BE500256477 /* OpenAL.framework */; };\n\t\tF293B3D315EB7BE500256477 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D215EB7BE500256477 /* AudioToolbox.framework */; };\n\t\tF293B3D515EB7BE500256477 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D415EB7BE500256477 /* AVFoundation.framework */; };\n\t\tF293B3D915EB7BE500256477 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3D815EB7BE500256477 /* Foundation.framework */; };\n\t\tF293B3DB15EB7BE500256477 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F293B3DA15EB7BE500256477 /* CoreGraphics.framework */; };\n\t\tF293BB9C15EB831F00256477 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F293BB7E15EB831F00256477 /* AppDelegate.cpp */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1551A33F158F2AB200E66CFE;\n\t\t\tremoteInfo = \"cocos2dx Mac\";\n\t\t};\n\t\t15A8A4181834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2FD617814595006731B9;\n\t\t\tremoteInfo = \"cocos2dx-extensions Mac\";\n\t\t};\n\t\t15A8A41A1834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2CB81780BD04006731B9;\n\t\t\tremoteInfo = \"chipmunk Mac\";\n\t\t};\n\t\t15A8A41C1834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2D9B1780BDF7006731B9;\n\t\t\tremoteInfo = \"box2d Mac\";\n\t\t};\n\t\t15A8A41E1834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F2ED617814268006731B9;\n\t\t\tremoteInfo = \"CocosDenshion Mac\";\n\t\t};\n\t\t15A8A4201834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A03F31FD1781479B006731B9;\n\t\t\tremoteInfo = \"jsbindings Mac\";\n\t\t};\n\t\t15A8A4221834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1A6FB53017854BC300CDF010;\n\t\t\tremoteInfo = \"luabindings Mac\";\n\t\t};\n\t\t15A8A4241834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4D641783777C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx iOS\";\n\t\t};\n\t\t15A8A4261834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4EFC1783867C0073F6A7;\n\t\t\tremoteInfo = \"cocos2dx-extensions iOS\";\n\t\t};\n\t\t15A8A4281834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4F3B178387670073F6A7;\n\t\t\tremoteInfo = \"chipmunk iOS\";\n\t\t};\n\t\t15A8A42A1834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4F9E1783876B0073F6A7;\n\t\t\tremoteInfo = \"box2d iOS\";\n\t\t};\n\t\t15A8A42C1834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A4FB4178387730073F6A7;\n\t\t\tremoteInfo = \"CocosDenshion iOS\";\n\t\t};\n\t\t15A8A42E1834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = A07A5030178387750073F6A7;\n\t\t\tremoteInfo = \"jsbindings iOS\";\n\t\t};\n\t\t15A8A4301834BDA200142BE0 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\tproxyType = 2;\n\t\t\tremoteGlobalIDString = 1A119791178526AA00D62A44;\n\t\t\tremoteInfo = \"luabindings iOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t01A8D32E187A5049001CC002 /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = ../cocos2d/cocos/scripting/lua/script/CocoStudio.lua; sourceTree = \"<group>\"; };\n\t\t01A8D32F187A504A001CC002 /* extern.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = extern.lua; path = ../cocos2d/cocos/scripting/lua/script/extern.lua; sourceTree = \"<group>\"; };\n\t\t01A8D330187A504A001CC002 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/GuiConstants.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = \"wrapper.pb-project\"; name = cocos2d_libs.xcodeproj; path = ../cocos2d/build/cocos2d_libs.xcodeproj; sourceTree = \"<group>\"; };\n\t\t15A8A4551834C6AD00142BE0 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../cocos2d/cocos/scripting/lua/script/AudioEngine.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../cocos2d/cocos/scripting/lua/script/CCBReaderLoad.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4571834C6AD00142BE0 /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = ../cocos2d/cocos/scripting/lua/script/Cocos2d.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2dConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/Cocos2dConstants.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4591834C6AD00142BE0 /* Deprecated.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Deprecated.lua; path = ../cocos2d/cocos/scripting/lua/script/Deprecated.lua; sourceTree = \"<group>\"; };\n\t\t15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedClass.lua; path = ../cocos2d/cocos/scripting/lua/script/DeprecatedClass.lua; sourceTree = \"<group>\"; };\n\t\t15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedEnum.lua; path = ../cocos2d/cocos/scripting/lua/script/DeprecatedEnum.lua; sourceTree = \"<group>\"; };\n\t\t15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DeprecatedOpenglEnum.lua; path = ../cocos2d/cocos/scripting/lua/script/DeprecatedOpenglEnum.lua; sourceTree = \"<group>\"; };\n\t\t15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DrawPrimitives.lua; path = ../cocos2d/cocos/scripting/lua/script/DrawPrimitives.lua; sourceTree = \"<group>\"; };\n\t\t15A8A45E1834C6AD00142BE0 /* json.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = json.lua; path = ../cocos2d/cocos/scripting/lua/script/json.lua; sourceTree = \"<group>\"; };\n\t\t15A8A45F1834C6AD00142BE0 /* luaj.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaj.lua; path = ../cocos2d/cocos/scripting/lua/script/luaj.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4601834C6AD00142BE0 /* luaoc.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = luaoc.lua; path = ../cocos2d/cocos/scripting/lua/script/luaoc.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4611834C6AD00142BE0 /* Opengl.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Opengl.lua; path = ../cocos2d/cocos/scripting/lua/script/Opengl.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OpenglConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/OpenglConstants.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4631834C6AD00142BE0 /* StudioConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = StudioConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/StudioConstants.lua; sourceTree = \"<group>\"; };\n\t\t15A8A4871834C90E00142BE0 /* libcurl.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libcurl.dylib; path = usr/lib/libcurl.dylib; sourceTree = SDKROOT; };\n\t\t15C1568D1683131500D239F2 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = ../cocos2d/cocos2dx/platform/third_party/ios/libraries/libcurl.a; sourceTree = \"<group>\"; };\n\t\t15FFA0FC1894DDEF00C96D45 /* mobdebug.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mobdebug.lua; sourceTree = \"<group>\"; };\n\t\t1AC3622916D47C5C000847F2 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fonts; path = ../Resources/fonts; sourceTree = \"<group>\"; };\n\t\t1AF4C402178663F200122817 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = \"compiled.mach-o.dylib\"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };\n\t\t5023810717EBBCAC00990C9B /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = \"<group>\"; };\n\t\t5023810817EBBCAC00990C9B /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = \"<group>\"; };\n\t\t5023810917EBBCAC00990C9B /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default-568h@2x.png\"; sourceTree = \"<group>\"; };\n\t\t5023810A17EBBCAC00990C9B /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = \"<group>\"; };\n\t\t5023810B17EBBCAC00990C9B /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Default@2x.png\"; sourceTree = \"<group>\"; };\n\t\t5023810C17EBBCAC00990C9B /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-114.png\"; sourceTree = \"<group>\"; };\n\t\t5023810D17EBBCAC00990C9B /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-120.png\"; sourceTree = \"<group>\"; };\n\t\t5023810E17EBBCAC00990C9B /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-144.png\"; sourceTree = \"<group>\"; };\n\t\t5023810F17EBBCAC00990C9B /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-152.png\"; sourceTree = \"<group>\"; };\n\t\t5023811017EBBCAC00990C9B /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-57.png\"; sourceTree = \"<group>\"; };\n\t\t5023811117EBBCAC00990C9B /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-72.png\"; sourceTree = \"<group>\"; };\n\t\t5023811217EBBCAC00990C9B /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-76.png\"; sourceTree = \"<group>\"; };\n\t\t5023811317EBBCAC00990C9B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t5023811417EBBCAC00990C9B /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t5023811517EBBCAC00990C9B /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = \"<group>\"; };\n\t\t5023811617EBBCAC00990C9B /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = \"<group>\"; };\n\t\t5023811717EBBCAC00990C9B /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = \"<group>\"; };\n\t\t5023816B17EBBCE400990C9B /* FlappyBird Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"FlappyBird Mac.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t5023817217EBBE3400990C9B /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = \"<group>\"; };\n\t\t5023817317EBBE3400990C9B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t5023817417EBBE3400990C9B /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = \"<group>\"; };\n\t\t5023817517EBBE3400990C9B /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = \"<group>\"; };\n\t\t5023817917EBBE8300990C9B /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };\n\t\t50805AAE17EBBEAA004CFAD3 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };\n\t\t5091733017ECE17A00D62437 /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-29.png\"; sourceTree = \"<group>\"; };\n\t\t5091733117ECE17A00D62437 /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-40.png\"; sourceTree = \"<group>\"; };\n\t\t5091733217ECE17A00D62437 /* Icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-50.png\"; sourceTree = \"<group>\"; };\n\t\t5091733317ECE17A00D62437 /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-58.png\"; sourceTree = \"<group>\"; };\n\t\t5091733417ECE17A00D62437 /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-80.png\"; sourceTree = \"<group>\"; };\n\t\t5091733517ECE17A00D62437 /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = \"Icon-100.png\"; sourceTree = \"<group>\"; };\n\t\t50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };\n\t\t50D7C96D17EBBEE6005D0B91 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };\n\t\t50D7C96F17EBBEEC005D0B91 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };\n\t\tA55DD5D918AB752800D0F4D3 /* main.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.lua; sourceTree = \"<group>\"; };\n\t\tA55DD5DA18AB752800D0F4D3 /* res */ = {isa = PBXFileReference; lastKnownFileType = folder; path = res; sourceTree = \"<group>\"; };\n\t\tA55DD5DB18AB752800D0F4D3 /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = \"<group>\"; };\n\t\tD6B061341803AC000077942B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };\n\t\tF293B3C815EB7BE500256477 /* FlappyBird iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = \"FlappyBird iOS.app\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\tF293B3CC15EB7BE500256477 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };\n\t\tF293B3CE15EB7BE500256477 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };\n\t\tF293B3D015EB7BE500256477 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };\n\t\tF293B3D215EB7BE500256477 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };\n\t\tF293B3D415EB7BE500256477 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };\n\t\tF293B3D615EB7BE500256477 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };\n\t\tF293B3D815EB7BE500256477 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };\n\t\tF293B3DA15EB7BE500256477 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };\n\t\tF293BB7E15EB831F00256477 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = \"<group>\"; };\n\t\tF293BB7F15EB831F00256477 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t5023813617EBBCE400990C9B /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t15A8A4881834C90F00142BE0 /* libcurl.dylib in Frameworks */,\n\t\t\t\t15A8A4821834C73500142BE0 /* libchipmunk Mac.a in Frameworks */,\n\t\t\t\t15A8A4831834C73500142BE0 /* libcocos2dx Mac.a in Frameworks */,\n\t\t\t\t15A8A4841834C73500142BE0 /* libcocos2dx-extensions Mac.a in Frameworks */,\n\t\t\t\t15A8A4851834C73500142BE0 /* libCocosDenshion Mac.a in Frameworks */,\n\t\t\t\t15A8A4861834C73500142BE0 /* libluabindings Mac.a in Frameworks */,\n\t\t\t\t50D7C97017EBBEEC005D0B91 /* IOKit.framework in Frameworks */,\n\t\t\t\t50D7C96E17EBBEE6005D0B91 /* AppKit.framework in Frameworks */,\n\t\t\t\t50D7C96C17EBBEDF005D0B91 /* OpenGL.framework in Frameworks */,\n\t\t\t\t5023813717EBBCE400990C9B /* libz.dylib in Frameworks */,\n\t\t\t\t5023813E17EBBCE400990C9B /* QuartzCore.framework in Frameworks */,\n\t\t\t\t5023814017EBBCE400990C9B /* OpenAL.framework in Frameworks */,\n\t\t\t\t5023814117EBBCE400990C9B /* AudioToolbox.framework in Frameworks */,\n\t\t\t\t5023814217EBBCE400990C9B /* AVFoundation.framework in Frameworks */,\n\t\t\t\t5023814417EBBCE400990C9B /* Foundation.framework in Frameworks */,\n\t\t\t\t5023814517EBBCE400990C9B /* CoreGraphics.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tF293B3C515EB7BE500256477 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t15A8A4441834C43700142BE0 /* libchipmunk iOS.a in Frameworks */,\n\t\t\t\t15A8A4451834C43700142BE0 /* libcocos2dx iOS.a in Frameworks */,\n\t\t\t\t15A8A4461834C43700142BE0 /* libcocos2dx-extensions iOS.a in Frameworks */,\n\t\t\t\t15A8A4471834C43700142BE0 /* libCocosDenshion iOS.a in Frameworks */,\n\t\t\t\t15A8A4481834C43700142BE0 /* libluabindings iOS.a in Frameworks */,\n\t\t\t\tD6B061351803AC000077942B /* CoreMotion.framework in Frameworks */,\n\t\t\t\t1AF4C403178663F200122817 /* libz.dylib in Frameworks */,\n\t\t\t\t50805AAF17EBBEAA004CFAD3 /* UIKit.framework in Frameworks */,\n\t\t\t\t5023817A17EBBE8300990C9B /* OpenGLES.framework in Frameworks */,\n\t\t\t\tF293B3CD15EB7BE500256477 /* QuartzCore.framework in Frameworks */,\n\t\t\t\tF293B3D115EB7BE500256477 /* OpenAL.framework in Frameworks */,\n\t\t\t\tF293B3D315EB7BE500256477 /* AudioToolbox.framework in Frameworks */,\n\t\t\t\tF293B3D515EB7BE500256477 /* AVFoundation.framework in Frameworks */,\n\t\t\t\tF293B3D915EB7BE500256477 /* Foundation.framework in Frameworks */,\n\t\t\t\tF293B3DB15EB7BE500256477 /* CoreGraphics.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t15A8A4041834BDA200142BE0 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t15A8A4171834BDA200142BE0 /* libcocos2dx Mac.a */,\n\t\t\t\t15A8A4191834BDA200142BE0 /* libcocos2dx-extensions Mac.a */,\n\t\t\t\t15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */,\n\t\t\t\t15A8A41D1834BDA200142BE0 /* libbox2d Mac.a */,\n\t\t\t\t15A8A41F1834BDA200142BE0 /* libCocosDenshion Mac.a */,\n\t\t\t\t15A8A4211834BDA200142BE0 /* libjsbindings Mac.a */,\n\t\t\t\t15A8A4231834BDA200142BE0 /* libluabindings Mac.a */,\n\t\t\t\t15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */,\n\t\t\t\t15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */,\n\t\t\t\t15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */,\n\t\t\t\t15A8A42B1834BDA200142BE0 /* libbox2d iOS.a */,\n\t\t\t\t15A8A42D1834BDA200142BE0 /* libCocosDenshion iOS.a */,\n\t\t\t\t15A8A42F1834BDA200142BE0 /* libjsbindings iOS.a */,\n\t\t\t\t15A8A4311834BDA200142BE0 /* libluabindings iOS.a */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1A0227A417A3AA1A00B867AD /* Lua Common */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t01A8D32E187A5049001CC002 /* CocoStudio.lua */,\n\t\t\t\t01A8D32F187A504A001CC002 /* extern.lua */,\n\t\t\t\t01A8D330187A504A001CC002 /* GuiConstants.lua */,\n\t\t\t\t15A8A4551834C6AD00142BE0 /* AudioEngine.lua */,\n\t\t\t\t15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */,\n\t\t\t\t15A8A4571834C6AD00142BE0 /* Cocos2d.lua */,\n\t\t\t\t15A8A4581834C6AD00142BE0 /* Cocos2dConstants.lua */,\n\t\t\t\t15A8A4591834C6AD00142BE0 /* Deprecated.lua */,\n\t\t\t\t15A8A45A1834C6AD00142BE0 /* DeprecatedClass.lua */,\n\t\t\t\t15A8A45B1834C6AD00142BE0 /* DeprecatedEnum.lua */,\n\t\t\t\t15A8A45C1834C6AD00142BE0 /* DeprecatedOpenglEnum.lua */,\n\t\t\t\t15A8A45D1834C6AD00142BE0 /* DrawPrimitives.lua */,\n\t\t\t\t15A8A45E1834C6AD00142BE0 /* json.lua */,\n\t\t\t\t15A8A45F1834C6AD00142BE0 /* luaj.lua */,\n\t\t\t\t15A8A4601834C6AD00142BE0 /* luaoc.lua */,\n\t\t\t\t15A8A4611834C6AD00142BE0 /* Opengl.lua */,\n\t\t\t\t15A8A4621834C6AD00142BE0 /* OpenglConstants.lua */,\n\t\t\t\t15A8A4631834C6AD00142BE0 /* StudioConstants.lua */,\n\t\t\t);\n\t\t\tname = \"Lua Common\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5023810617EBBCAC00990C9B /* ios */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5023810717EBBCAC00990C9B /* AppController.h */,\n\t\t\t\t5023810817EBBCAC00990C9B /* AppController.mm */,\n\t\t\t\t5023810917EBBCAC00990C9B /* Default-568h@2x.png */,\n\t\t\t\t5023810A17EBBCAC00990C9B /* Default.png */,\n\t\t\t\t5023810B17EBBCAC00990C9B /* Default@2x.png */,\n\t\t\t\t5091734A17ECE18300D62437 /* Icons */,\n\t\t\t\t5023811317EBBCAC00990C9B /* Info.plist */,\n\t\t\t\t5023811417EBBCAC00990C9B /* main.m */,\n\t\t\t\t5023811517EBBCAC00990C9B /* Prefix.pch */,\n\t\t\t\t5023811617EBBCAC00990C9B /* RootViewController.h */,\n\t\t\t\t5023811717EBBCAC00990C9B /* RootViewController.mm */,\n\t\t\t);\n\t\t\tpath = ios;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5023817117EBBE3400990C9B /* mac */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5023817217EBBE3400990C9B /* Icon.icns */,\n\t\t\t\t5023817317EBBE3400990C9B /* Info.plist */,\n\t\t\t\t5023817417EBBE3400990C9B /* main.cpp */,\n\t\t\t\t5023817517EBBE3400990C9B /* Prefix.pch */,\n\t\t\t);\n\t\t\tpath = mac;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5091734A17ECE18300D62437 /* Icons */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5091733017ECE17A00D62437 /* Icon-29.png */,\n\t\t\t\t5091733117ECE17A00D62437 /* Icon-40.png */,\n\t\t\t\t5091733217ECE17A00D62437 /* Icon-50.png */,\n\t\t\t\t5091733317ECE17A00D62437 /* Icon-58.png */,\n\t\t\t\t5091733417ECE17A00D62437 /* Icon-80.png */,\n\t\t\t\t5091733517ECE17A00D62437 /* Icon-100.png */,\n\t\t\t\t5023810C17EBBCAC00990C9B /* Icon-114.png */,\n\t\t\t\t5023810D17EBBCAC00990C9B /* Icon-120.png */,\n\t\t\t\t5023810E17EBBCAC00990C9B /* Icon-144.png */,\n\t\t\t\t5023810F17EBBCAC00990C9B /* Icon-152.png */,\n\t\t\t\t5023811017EBBCAC00990C9B /* Icon-57.png */,\n\t\t\t\t5023811117EBBCAC00990C9B /* Icon-72.png */,\n\t\t\t\t5023811217EBBCAC00990C9B /* Icon-76.png */,\n\t\t\t);\n\t\t\tname = Icons;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF293B3BD15EB7BE500256477 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */,\n\t\t\t\t5023810617EBBCAC00990C9B /* ios */,\n\t\t\t\t5023817117EBBE3400990C9B /* mac */,\n\t\t\t\tF293BB7C15EB830F00256477 /* Classes */,\n\t\t\t\tF293B3CB15EB7BE500256477 /* Frameworks */,\n\t\t\t\t1A0227A417A3AA1A00B867AD /* Lua Common */,\n\t\t\t\tF293B3C915EB7BE500256477 /* Products */,\n\t\t\t\tF293BC4615EB859D00256477 /* Resources */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF293B3C915EB7BE500256477 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF293B3C815EB7BE500256477 /* FlappyBird iOS.app */,\n\t\t\t\t5023816B17EBBCE400990C9B /* FlappyBird Mac.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF293B3CB15EB7BE500256477 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t15A8A4871834C90E00142BE0 /* libcurl.dylib */,\n\t\t\t\tD6B061341803AC000077942B /* CoreMotion.framework */,\n\t\t\t\t50D7C96F17EBBEEC005D0B91 /* IOKit.framework */,\n\t\t\t\t50D7C96D17EBBEE6005D0B91 /* AppKit.framework */,\n\t\t\t\t50D7C96B17EBBEDF005D0B91 /* OpenGL.framework */,\n\t\t\t\t50805AAE17EBBEAA004CFAD3 /* UIKit.framework */,\n\t\t\t\t5023817917EBBE8300990C9B /* OpenGLES.framework */,\n\t\t\t\t1AF4C402178663F200122817 /* libz.dylib */,\n\t\t\t\t15C1568D1683131500D239F2 /* libcurl.a */,\n\t\t\t\tF293B3CC15EB7BE500256477 /* QuartzCore.framework */,\n\t\t\t\tF293B3CE15EB7BE500256477 /* OpenGLES.framework */,\n\t\t\t\tF293B3D015EB7BE500256477 /* OpenAL.framework */,\n\t\t\t\tF293B3D215EB7BE500256477 /* AudioToolbox.framework */,\n\t\t\t\tF293B3D415EB7BE500256477 /* AVFoundation.framework */,\n\t\t\t\tF293B3D615EB7BE500256477 /* UIKit.framework */,\n\t\t\t\tF293B3D815EB7BE500256477 /* Foundation.framework */,\n\t\t\t\tF293B3DA15EB7BE500256477 /* CoreGraphics.framework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF293BB7C15EB830F00256477 /* Classes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF293BB7E15EB831F00256477 /* AppDelegate.cpp */,\n\t\t\t\tF293BB7F15EB831F00256477 /* AppDelegate.h */,\n\t\t\t);\n\t\t\tname = Classes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF293BC4615EB859D00256477 /* Resources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tA55DD5D918AB752800D0F4D3 /* main.lua */,\n\t\t\t\tA55DD5DA18AB752800D0F4D3 /* res */,\n\t\t\t\tA55DD5DB18AB752800D0F4D3 /* scripts */,\n\t\t\t\t15FFA0FC1894DDEF00C96D45 /* mobdebug.lua */,\n\t\t\t\t1AC3622916D47C5C000847F2 /* fonts */,\n\t\t\t);\n\t\t\tname = Resources;\n\t\t\tpath = ../Resources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t5023812617EBBCE400990C9B /* FlappyBird Mac */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 5023816817EBBCE400990C9B /* Build configuration list for PBXNativeTarget \"FlappyBird Mac\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t5023813117EBBCE400990C9B /* Sources */,\n\t\t\t\t5023813617EBBCE400990C9B /* Frameworks */,\n\t\t\t\t5023814617EBBCE400990C9B /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"FlappyBird Mac\";\n\t\t\tproductName = FlappyBird;\n\t\t\tproductReference = 5023816B17EBBCE400990C9B /* FlappyBird Mac.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\tF293B3C715EB7BE500256477 /* FlappyBird iOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = F293B6C415EB7BEA00256477 /* Build configuration list for PBXNativeTarget \"FlappyBird iOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tF293B3C415EB7BE500256477 /* Sources */,\n\t\t\t\tF293B3C515EB7BE500256477 /* Frameworks */,\n\t\t\t\tF293B3C615EB7BE500256477 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"FlappyBird iOS\";\n\t\t\tproductName = FlappyBird;\n\t\t\tproductReference = F293B3C815EB7BE500256477 /* FlappyBird iOS.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\tF293B3BF15EB7BE500256477 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0500;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\tF293B3C715EB7BE500256477 = {\n\t\t\t\t\t\tDevelopmentTeam = MDDB52YB8L;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = F293B3C215EB7BE500256477 /* Build configuration list for PBXProject \"FlappyBird\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = F293B3BD15EB7BE500256477;\n\t\t\tproductRefGroup = F293B3C915EB7BE500256477 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectReferences = (\n\t\t\t\t{\n\t\t\t\t\tProductGroup = 15A8A4041834BDA200142BE0 /* Products */;\n\t\t\t\t\tProjectRef = 15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */;\n\t\t\t\t},\n\t\t\t);\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\tF293B3C715EB7BE500256477 /* FlappyBird iOS */,\n\t\t\t\t5023812617EBBCE400990C9B /* FlappyBird Mac */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXReferenceProxy section */\n\t\t15A8A4171834BDA200142BE0 /* libcocos2dx Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx Mac.a\";\n\t\t\tremoteRef = 15A8A4161834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A4191834BDA200142BE0 /* libcocos2dx-extensions Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx-extensions Mac.a\";\n\t\t\tremoteRef = 15A8A4181834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A41B1834BDA200142BE0 /* libchipmunk Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libchipmunk Mac.a\";\n\t\t\tremoteRef = 15A8A41A1834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A41D1834BDA200142BE0 /* libbox2d Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libbox2d Mac.a\";\n\t\t\tremoteRef = 15A8A41C1834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A41F1834BDA200142BE0 /* libCocosDenshion Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libCocosDenshion Mac.a\";\n\t\t\tremoteRef = 15A8A41E1834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A4211834BDA200142BE0 /* libjsbindings Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsbindings Mac.a\";\n\t\t\tremoteRef = 15A8A4201834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A4231834BDA200142BE0 /* libluabindings Mac.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libluabindings Mac.a\";\n\t\t\tremoteRef = 15A8A4221834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx iOS.a\";\n\t\t\tremoteRef = 15A8A4241834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libcocos2dx-extensions iOS.a\";\n\t\t\tremoteRef = 15A8A4261834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libchipmunk iOS.a\";\n\t\t\tremoteRef = 15A8A4281834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A42B1834BDA200142BE0 /* libbox2d iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libbox2d iOS.a\";\n\t\t\tremoteRef = 15A8A42A1834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A42D1834BDA200142BE0 /* libCocosDenshion iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libCocosDenshion iOS.a\";\n\t\t\tremoteRef = 15A8A42C1834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A42F1834BDA200142BE0 /* libjsbindings iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libjsbindings iOS.a\";\n\t\t\tremoteRef = 15A8A42E1834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n\t\t15A8A4311834BDA200142BE0 /* libluabindings iOS.a */ = {\n\t\t\tisa = PBXReferenceProxy;\n\t\t\tfileType = archive.ar;\n\t\t\tpath = \"libluabindings iOS.a\";\n\t\t\tremoteRef = 15A8A4301834BDA200142BE0 /* PBXContainerItemProxy */;\n\t\t\tsourceTree = BUILT_PRODUCTS_DIR;\n\t\t};\n/* End PBXReferenceProxy section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t5023814617EBBCE400990C9B /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t15A8A4711834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */,\n\t\t\t\t15FFA0FE1894DDEF00C96D45 /* mobdebug.lua in Resources */,\n\t\t\t\t15A8A4811834C6AD00142BE0 /* StudioConstants.lua in Resources */,\n\t\t\t\t15A8A4791834C6AD00142BE0 /* luaj.lua in Resources */,\n\t\t\t\t15A8A4671834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */,\n\t\t\t\t15A8A46B1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */,\n\t\t\t\t15A8A4771834C6AD00142BE0 /* json.lua in Resources */,\n\t\t\t\t15A8A46F1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */,\n\t\t\t\t15A8A47F1834C6AD00142BE0 /* OpenglConstants.lua in Resources */,\n\t\t\t\t5023815017EBBCE400990C9B /* fonts in Resources */,\n\t\t\t\t15A8A47D1834C6AD00142BE0 /* Opengl.lua in Resources */,\n\t\t\t\t15A8A4691834C6AD00142BE0 /* Cocos2d.lua in Resources */,\n\t\t\t\t15A8A4731834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */,\n\t\t\t\t15A8A46D1834C6AD00142BE0 /* Deprecated.lua in Resources */,\n\t\t\t\t15A8A4751834C6AD00142BE0 /* DrawPrimitives.lua in Resources */,\n\t\t\t\tA55DD5E118AB752800D0F4D3 /* scripts in Resources */,\n\t\t\t\t15A8A47B1834C6AD00142BE0 /* luaoc.lua in Resources */,\n\t\t\t\t5023817617EBBE3400990C9B /* Icon.icns in Resources */,\n\t\t\t\tA55DD5DD18AB752800D0F4D3 /* main.lua in Resources */,\n\t\t\t\t15A8A4651834C6AD00142BE0 /* AudioEngine.lua in Resources */,\n\t\t\t\t01A8D332187A504A001CC002 /* CocoStudio.lua in Resources */,\n\t\t\t\t01A8D334187A504A001CC002 /* extern.lua in Resources */,\n\t\t\t\t01A8D336187A504A001CC002 /* GuiConstants.lua in Resources */,\n\t\t\t\tA55DD5DF18AB752800D0F4D3 /* res in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tF293B3C615EB7BE500256477 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t15A8A46E1834C6AD00142BE0 /* DeprecatedClass.lua in Resources */,\n\t\t\t\t15A8A4491834C64F00142BE0 /* Icon-114.png in Resources */,\n\t\t\t\t5023811D17EBBCAC00990C9B /* Icon-120.png in Resources */,\n\t\t\t\t15A8A47E1834C6AD00142BE0 /* OpenglConstants.lua in Resources */,\n\t\t\t\t5091733B17ECE17A00D62437 /* Icon-100.png in Resources */,\n\t\t\t\t15A8A4781834C6AD00142BE0 /* luaj.lua in Resources */,\n\t\t\t\t15A8A47C1834C6AD00142BE0 /* Opengl.lua in Resources */,\n\t\t\t\t15A8A4741834C6AD00142BE0 /* DrawPrimitives.lua in Resources */,\n\t\t\t\t5023811B17EBBCAC00990C9B /* Default@2x.png in Resources */,\n\t\t\t\t15A8A4681834C6AD00142BE0 /* Cocos2d.lua in Resources */,\n\t\t\t\t5091733617ECE17A00D62437 /* Icon-29.png in Resources */,\n\t\t\t\t15A8A4801834C6AD00142BE0 /* StudioConstants.lua in Resources */,\n\t\t\t\t5023811917EBBCAC00990C9B /* Default-568h@2x.png in Resources */,\n\t\t\t\t1AC3623516D47C5C000847F2 /* fonts in Resources */,\n\t\t\t\tA55DD5DC18AB752800D0F4D3 /* main.lua in Resources */,\n\t\t\t\t15A8A4721834C6AD00142BE0 /* DeprecatedOpenglEnum.lua in Resources */,\n\t\t\t\t15A8A4701834C6AD00142BE0 /* DeprecatedEnum.lua in Resources */,\n\t\t\t\t15A8A46A1834C6AD00142BE0 /* Cocos2dConstants.lua in Resources */,\n\t\t\t\t5091733917ECE17A00D62437 /* Icon-58.png in Resources */,\n\t\t\t\t15FFA0FD1894DDEF00C96D45 /* mobdebug.lua in Resources */,\n\t\t\t\t15A8A4641834C6AD00142BE0 /* AudioEngine.lua in Resources */,\n\t\t\t\tA55DD5E018AB752800D0F4D3 /* scripts in Resources */,\n\t\t\t\t15A8A4661834C6AD00142BE0 /* CCBReaderLoad.lua in Resources */,\n\t\t\t\t5023811F17EBBCAC00990C9B /* Icon-152.png in Resources */,\n\t\t\t\t5023812017EBBCAC00990C9B /* Icon-57.png in Resources */,\n\t\t\t\t15A8A47A1834C6AD00142BE0 /* luaoc.lua in Resources */,\n\t\t\t\t5023812217EBBCAC00990C9B /* Icon-76.png in Resources */,\n\t\t\t\t15A8A46C1834C6AD00142BE0 /* Deprecated.lua in Resources */,\n\t\t\t\t5091733A17ECE17A00D62437 /* Icon-80.png in Resources */,\n\t\t\t\t5091733717ECE17A00D62437 /* Icon-40.png in Resources */,\n\t\t\t\t5023811E17EBBCAC00990C9B /* Icon-144.png in Resources */,\n\t\t\t\t15A8A4761834C6AD00142BE0 /* json.lua in Resources */,\n\t\t\t\t5023811A17EBBCAC00990C9B /* Default.png in Resources */,\n\t\t\t\t5091733817ECE17A00D62437 /* Icon-50.png in Resources */,\n\t\t\t\t5023812117EBBCAC00990C9B /* Icon-72.png in Resources */,\n\t\t\t\t01A8D331187A504A001CC002 /* CocoStudio.lua in Resources */,\n\t\t\t\t01A8D333187A504A001CC002 /* extern.lua in Resources */,\n\t\t\t\t01A8D335187A504A001CC002 /* GuiConstants.lua in Resources */,\n\t\t\t\tA55DD5DE18AB752800D0F4D3 /* res in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t5023813117EBBCE400990C9B /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5023813317EBBCE400990C9B /* AppDelegate.cpp in Sources */,\n\t\t\t\t5023817817EBBE3400990C9B /* main.cpp in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\tF293B3C415EB7BE500256477 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5023812517EBBCAC00990C9B /* RootViewController.mm in Sources */,\n\t\t\t\tF293BB9C15EB831F00256477 /* AppDelegate.cpp in Sources */,\n\t\t\t\t5023812417EBBCAC00990C9B /* main.m in Sources */,\n\t\t\t\t5023811817EBBCAC00990C9B /* AppController.mm in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t5023816917EBBCE400990C9B /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = mac/Prefix.pch;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = mac/Info.plist;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-image_base\",\n\t\t\t\t\t100000000,\n\t\t\t\t\t\"-pagezero_size\",\n\t\t\t\t\t10000,\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/mac $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/external/glfw3/include/mac $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t5023816A17EBBCE400990C9B /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tARCHS = \"$(ARCHS_STANDARD_64_BIT)\";\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = mac/Prefix.pch;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tCC_TARGET_OS_MAC,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = mac/Info.plist;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"-image_base\",\n\t\t\t\t\t100000000,\n\t\t\t\t\t\"-pagezero_size\",\n\t\t\t\t\t10000,\n\t\t\t\t);\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/mac $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/external/glfw3/include/mac $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tF293B6C215EB7BEA00256477 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tDEBUG,\n\t\t\t\t\t\"COCOS2D_DEBUG=1\",\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\t\"CC_LUA_ENGINE_ENABLED=1\",\n\t\t\t\t\t\"CC_ENABLE_CHIPMUNK_INTEGRATION=1\",\n\t\t\t\t);\n\t\t\t\tGCC_SYMBOLS_PRIVATE_EXTERN = NO;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(PROJECT_NAME)/libs/cocos2dx/kazmath/include\\\"\",\n\t\t\t\t\t\"\\\"$(PROJECT_NAME)/libs/cocos2dx\\\"\",\n\t\t\t\t\t\"\\\"$(PROJECT_NAME)/libs/CocosDenshion/include\\\"\",\n\t\t\t\t\t\"\\\"$(SDKROOT)/usr/include/libxml2\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../cocos2dx/\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../cocos2dx/kazmath/include\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../external/lua/tolua\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../external/lua/src\\\"\",\n\t\t\t\t\t\"$(SRCROOT)/../../external/lua/cocos2dx_support\",\n\t\t\t\t\t\"$(SRCROOT)/../../cocos2dx/platform/ios\",\n\t\t\t\t\t\"$(SRCROOT)/../../cocos2dx/include\",\n\t\t\t\t);\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tF293B6C315EB7BEA00256477 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = c99;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tNDEBUG,\n\t\t\t\t\tUSE_FILE32API,\n\t\t\t\t\t\"CC_LUA_ENGINE_ENABLED=1\",\n\t\t\t\t\t\"CC_ENABLE_CHIPMUNK_INTEGRATION=1\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tHEADER_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(PROJECT_NAME)/libs/cocos2dx/kazmath/include\\\"\",\n\t\t\t\t\t\"\\\"$(PROJECT_NAME)/libs/cocos2dx\\\"\",\n\t\t\t\t\t\"\\\"$(PROJECT_NAME)/libs/CocosDenshion/include\\\"\",\n\t\t\t\t\t\"\\\"$(SDKROOT)/usr/include/libxml2\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../cocos2dx/\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../cocos2dx/kazmath/include\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../external/lua/tolua\\\"\",\n\t\t\t\t\t\"\\\"$(SRCROOT)/../../external/lua/src\\\"\",\n\t\t\t\t\t\"$(SRCROOT)/../../external/lua/cocos2dx_support\",\n\t\t\t\t\t\"$(SRCROOT)/../../cocos2dx/platform/ios\",\n\t\t\t\t\t\"$(SRCROOT)/../../cocos2dx/include\",\n\t\t\t\t);\n\t\t\t\tOTHER_CFLAGS = \"-DNS_BLOCK_ASSERTIONS=1\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\tF293B6C515EB7BEA00256477 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/ios $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\tF293B6C615EB7BEA00256477 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOMPRESS_PNG_FILES = NO;\n\t\t\t\tGCC_PRECOMPILE_PREFIX_HEADER = YES;\n\t\t\t\tGCC_PREFIX_HEADER = \"\";\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\tCC_TARGET_OS_IPHONE,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tHEADER_SEARCH_PATHS = \"\";\n\t\t\t\tINFOPLIST_FILE = ios/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 5.0;\n\t\t\t\tLIBRARY_SEARCH_PATHS = \"\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tUSER_HEADER_SEARCH_PATHS = \"$(inherited) $(SRCROOT)/../cocos2d/cocos $(SRCROOT)/../cocos2d/cocos/base $(SRCROOT)/../cocos2d/cocos/2d $(SRCROOT)/../cocos2d/cocos/physics $(SRCROOT)/../cocos2d/cocos/math/kazmath/include $(SRCROOT)/../cocos2d/cocos/2d/platform/ios $(SRCROOT)/../cocos2d/cocos/audio/include $(SRCROOT)/../cocos2d/cocos/editor-support $(SRCROOT)/../cocos2d/cocos/gui $(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk $(SRCROOT)/../cocos2d/external $(SRCROOT)/../cocos2d/cocos/scripting/lua/bindings $(SRCROOT)/../cocos2d/external/lua/luajit/include $(SRCROOT)/../cocos2d/external/lua/tolua\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t5023816817EBBCE400990C9B /* Build configuration list for PBXNativeTarget \"FlappyBird Mac\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t5023816917EBBCE400990C9B /* Debug */,\n\t\t\t\t5023816A17EBBCE400990C9B /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tF293B3C215EB7BE500256477 /* Build configuration list for PBXProject \"FlappyBird\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tF293B6C215EB7BEA00256477 /* Debug */,\n\t\t\t\tF293B6C315EB7BEA00256477 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\tF293B6C415EB7BEA00256477 /* Build configuration list for PBXNativeTarget \"FlappyBird iOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\tF293B6C515EB7BEA00256477 /* Debug */,\n\t\t\t\tF293B6C615EB7BEA00256477 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = F293B3BF15EB7BE500256477 /* Project object */;\n}\n"
  },
  {
    "path": "proj.ios_mac/ios/AppController.h",
    "content": "/****************************************************************************\n Copyright (c) 2010 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n@class RootViewController;\n\n@interface AppController : NSObject <UIAccelerometerDelegate, UIAlertViewDelegate, UITextFieldDelegate,UIApplicationDelegate> {\n    UIWindow *window;\n    RootViewController    *viewController;\n}\n\n@end\n\n"
  },
  {
    "path": "proj.ios_mac/ios/AppController.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010 cocos2d-x.org\n\n http://www.cocos2d-x.org\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n#import <UIKit/UIKit.h>\n#import \"AppController.h\"\n#import \"cocos2d.h\"\n#import \"EAGLView.h\"\n#import \"AppDelegate.h\"\n\n#import \"RootViewController.h\"\n\n@implementation AppController\n\n#pragma mark -\n#pragma mark Application lifecycle\n\n// cocos2d application instance\nstatic AppDelegate s_sharedApplication;\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n\n    // Override point for customization after application launch.\n\n    // Add the view controller's view to the window and display.\n    window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];\n    CCEAGLView *__glView = [CCEAGLView viewWithFrame: [window bounds]\n                                     pixelFormat: kEAGLColorFormatRGBA8\n                                     depthFormat: GL_DEPTH_COMPONENT16\n                              preserveBackbuffer: NO\n                                      sharegroup: nil\n                                   multiSampling: NO\n                                 numberOfSamples: 0 ];\n\n    [__glView setMultipleTouchEnabled:YES];\n    // Use RootViewController manage CCEAGLView\n    viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];\n    viewController.wantsFullScreenLayout = YES;\n    viewController.view = __glView;\n\n    // Set RootViewController to window\n    if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)\n    {\n        // warning: addSubView doesn't work on iOS6\n        [window addSubview: viewController.view];\n    }\n    else\n    {\n        // use this method on ios6\n        [window setRootViewController:viewController];\n    }\n    \n    [window makeKeyAndVisible];\n\n    [[UIApplication sharedApplication] setStatusBarHidden: YES];\n\n    cocos2d::Application::getInstance()->run();\n    return YES;\n}\n\n\n- (void)applicationWillResignActive:(UIApplication *)application {\n    /*\n     Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.\n     Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.\n     */\n    cocos2d::Director::getInstance()->pause();\n}\n\n- (void)applicationDidBecomeActive:(UIApplication *)application {\n    /*\n     Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.\n     */\n    cocos2d::Director::getInstance()->resume();\n}\n\n- (void)applicationDidEnterBackground:(UIApplication *)application {\n    /*\n     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.\n     If your application supports background execution, called instead of applicationWillTerminate: when the user quits.\n     */\n    cocos2d::Application::getInstance()->applicationDidEnterBackground();\n}\n\n- (void)applicationWillEnterForeground:(UIApplication *)application {\n    /*\n     Called as part of  transition from the background to the inactive state: here you can undo many of the changes made on entering the background.\n     */\n    cocos2d::Application::getInstance()->applicationWillEnterForeground();\n}\n\n- (void)applicationWillTerminate:(UIApplication *)application {\n    /*\n     Called when the application is about to terminate.\n     See also applicationDidEnterBackground:.\n     */\n}\n\n\n#pragma mark -\n#pragma mark Memory management\n\n- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {\n    /*\n     Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.\n     */\n     cocos2d::Director::getInstance()->purgeCachedData();\n}\n\n\n- (void)dealloc {\n    [super dealloc];\n}\n\n\n@end\n\n"
  },
  {
    "path": "proj.ios_mac/ios/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>English</string>\n\t<key>CFBundleDisplayName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleIconFile</key>\n\t<string></string>\n\t<key>CFBundleIconFiles</key>\n\t<array>\n\t\t<string>Icon-80</string>\n\t\t<string>Icon-58</string>\n\t\t<string>Icon-29</string>\n\t\t<string>Icon-120</string>\n\t\t<string>Icon-57.png</string>\n\t\t<string>Icon-114.png</string>\n\t\t<string>Icon-72.png</string>\n\t\t<string>Icon-144.png</string>\n\t</array>\n\t<key>CFBundleIconFiles~ipad</key>\n\t<array>\n\t\t<string>Icon-58</string>\n\t\t<string>Icon-29</string>\n\t\t<string>Icon-80</string>\n\t\t<string>Icon-40</string>\n\t\t<string>Icon-100</string>\n\t\t<string>Icon-50</string>\n\t\t<string>Icon-152</string>\n\t\t<string>Icon-76</string>\n\t\t<string>Icon-120</string>\n\t\t<string>Icon-57.png</string>\n\t\t<string>Icon-114.png</string>\n\t\t<string>Icon-72.png</string>\n\t\t<string>Icon-144.png</string>\n\t</array>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier}</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1.0</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UIPrerenderedIcon</key>\n\t<true/>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<dict>\n\t\t<key>accelerometer</key>\n\t\t<true/>\n\t\t<key>opengles-1</key>\n\t\t<true/>\n\t</dict>\n\t<key>UIStatusBarHidden</key>\n\t<true/>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "proj.ios_mac/ios/RootViewController.h",
    "content": "/****************************************************************************\n Copyright (c) 2010-2011 cocos2d-x.org\n Copyright (c) 2010      Ricardo Quesada\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import <UIKit/UIKit.h>\n\n\n@interface RootViewController : UIViewController {\n\n}\n- (BOOL)prefersStatusBarHidden;\n@end\n"
  },
  {
    "path": "proj.ios_mac/ios/RootViewController.mm",
    "content": "/****************************************************************************\n Copyright (c) 2010-2011 cocos2d-x.org\n Copyright (c) 2010      Ricardo Quesada\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#import \"RootViewController.h\"\n#import \"cocos2d.h\"\n#import \"EAGLView.h\"\n\n@implementation RootViewController\n\n/*\n // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.\n- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {\n    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {\n        // Custom initialization\n    }\n    return self;\n}\n*/\n\n/*\n// Implement loadView to create a view hierarchy programmatically, without using a nib.\n- (void)loadView {\n}\n*/\n\n/*\n// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.\n- (void)viewDidLoad {\n    [super viewDidLoad];\n}\n \n*/\n// Override to allow orientations other than the default portrait orientation.\n// This method is deprecated on ios6\n- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {\n    return UIInterfaceOrientationIsLandscape( interfaceOrientation );\n}\n\n// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead\n- (NSUInteger) supportedInterfaceOrientations{\n#ifdef __IPHONE_6_0\n    return UIInterfaceOrientationMaskAllButUpsideDown;\n#endif\n}\n\n- (BOOL) shouldAutorotate {\n    return YES;\n}\n\n- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {\n\t[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];\n\n\tCGSize s = CGSizeMake([[CCEAGLView sharedEGLView] getWidth], [[CCEAGLView sharedEGLView] getHeight]);\n\n\tcocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height);\n}\n\n//fix not hide status on ios7\n- (BOOL)prefersStatusBarHidden\n{\n    return YES;\n}\n\n- (void)didReceiveMemoryWarning {\n    // Releases the view if it doesn't have a superview.\n    [super didReceiveMemoryWarning];\n    \n    // Release any cached data, images, etc that aren't in use.\n}\n\n- (void)viewDidUnload {\n    [super viewDidUnload];\n    // Release any retained subviews of the main view.\n    // e.g. self.myOutlet = nil;\n}\n\n\n- (void)dealloc {\n    [super dealloc];\n}\n\n\n@end\n"
  },
  {
    "path": "proj.ios_mac/ios/main.m",
    "content": "//\n//  main.m\n//  FlappyBird\n//\n//  Copyright __MyCompanyName__ 2011. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\nint main(int argc, char *argv[]) {\n    NSAutoreleasePool *pool = [NSAutoreleasePool new];\n    int retVal = UIApplicationMain(argc, argv, nil, @\"AppController\");\n    [pool release];\n    return retVal;\n}\n"
  },
  {
    "path": "proj.ios_mac/mac/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>${EXECUTABLE_NAME}</string>\n\t<key>CFBundleIconFile</key>\n\t<string>Icon</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>org.cocos2d-x.${PRODUCT_NAME:rfc1034identifier}</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>${PRODUCT_NAME}</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSApplicationCategoryType</key>\n\t<string>public.app-category.games</string>\n\t<key>LSMinimumSystemVersion</key>\n\t<string>${MACOSX_DEPLOYMENT_TARGET}</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2013. All rights reserved.</string>\n\t<key>NSMainNibFile</key>\n\t<string>MainMenu</string>\n\t<key>NSPrincipalClass</key>\n\t<string>NSApplication</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "proj.ios_mac/mac/main.cpp",
    "content": "/****************************************************************************\n Copyright (c) 2010 cocos2d-x.org\n \n http://www.cocos2d-x.org\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ****************************************************************************/\n\n#include \"AppDelegate.h\"\n\nUSING_NS_CC;\n\nint main(int argc, char *argv[])\n{\n    AppDelegate app;\n    EGLView eglView;\n    eglView.init(\"Hello World\",900,640);\n    return Application::getInstance()->run();\n}\n"
  },
  {
    "path": "proj.linux/main.cpp",
    "content": "#include \"../Classes/AppDelegate.h\"\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <unistd.h>\n#include <string>\n\nUSING_NS_CC;\n\nint main(int argc, char **argv)\n{\n    // create the application instance\n    AppDelegate app;\n    EGLView eglView;\n    eglView.init(\"Cocos2d-x Game Using LUA\",900,640);\n    return Application::getInstance()->run();\n}\n"
  },
  {
    "path": "proj.win32/FlappyBird.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"FlappyBird\", \"FlappyBird.vcxproj\", \"{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE} = {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159}\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libExtensions\", \"..\\cocos2d\\extensions\\proj.win32\\libExtensions.vcxproj\", \"{21B2C324-891F-48EA-AD1A-5AE13DE12E28}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libchipmunk\", \"..\\cocos2d\\external\\chipmunk\\proj.win32\\chipmunk.vcxproj\", \"{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libcocos2d\", \"..\\cocos2d\\cocos\\2d\\cocos2d.vcxproj\", \"{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libAudio\", \"..\\cocos2d\\cocos\\audio\\proj.win32\\CocosDenshion.vcxproj\", \"{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"liblua\", \"..\\cocos2d\\cocos\\scripting\\lua\\bindings\\liblua.vcxproj\", \"{DDC3E27F-004D-4DD4-9DD3-931A013D2159}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libNetwork\", \"..\\cocos2d\\cocos\\network\\proj.win32\\libNetwork.vcxproj\", \"{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libCocosBuilder\", \"..\\cocos2d\\cocos\\editor-support\\cocosbuilder\\proj.win32\\libCocosBuilder.vcxproj\", \"{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libCocosStudio\", \"..\\cocos2d\\cocos\\editor-support\\cocostudio\\proj.win32\\libCocosStudio.vcxproj\", \"{B57CF53F-2E49-4031-9822-047CC0E6BDE2}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libGUI\", \"..\\cocos2d\\cocos\\gui\\proj.win32\\libGUI.vcxproj\", \"{7E06E92C-537A-442B-9E4A-4761C84F8A1A}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libSpine\", \"..\\cocos2d\\cocos\\editor-support\\spine\\proj.win32\\libSpine.vcxproj\", \"{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}.Release|Win32.Build.0 = Release|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{21B2C324-891F-48EA-AD1A-5AE13DE12E28}.Release|Win32.Build.0 = Release|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{207BC7A9-CCF1-4F2F-A04D-45F72242AE25}.Release|Win32.Build.0 = Release|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}.Release|Win32.Build.0 = Release|Win32\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}.Release|Win32.Build.0 = Release|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{DDC3E27F-004D-4DD4-9DD3-931A013D2159}.Release|Win32.Build.0 = Release|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{DF2638C0-8128-4847-867C-6EAFE3DEE7B5}.Release|Win32.Build.0 = Release|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{811C0DAB-7B96-4BD3-A154-B7572B58E4AB}.Release|Win32.Build.0 = Release|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{B57CF53F-2E49-4031-9822-047CC0E6BDE2}.Release|Win32.Build.0 = Release|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "proj.win32/FlappyBird.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <ProjectGuid>{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}</ProjectGuid>\n    <ProjectName>FlappyBird</ProjectName>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>Application</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <CharacterSet>Unicode</CharacterSet>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '10.0'\">v100</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0'\">v110</PlatformToolset>\n    <PlatformToolset Condition=\"'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A')\">v110_xp</PlatformToolset>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\cocos2d\\cocos\\2d\\cocos2dx.props\" />\n    <Import Project=\"..\\cocos2d\\cocos\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n    <Import Project=\"..\\cocos2d\\cocos\\2d\\cocos2dx.props\" />\n    <Import Project=\"..\\cocos2d\\cocos\\2d\\cocos2d_headers.props\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n    <LinkIncremental>true</LinkIncremental>\n    <IncludePath>$(IncludePath)</IncludePath>\n    <SourcePath>$(SourcePath);</SourcePath>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <OutDir>$(SolutionDir)$(Configuration).win32\\</OutDir>\n    <IntDir>$(Configuration).win32\\</IntDir>\n    <LinkIncremental>false</LinkIncremental>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <LibraryPath>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\lib;$(LibraryPath)</LibraryPath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(ProjectDir)..\\Classes\\LuaInterface;$(ProjectDir)..\\Classes;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\lua-bindings;$(EngineRoot)cocos\\scripting\\lua\\bindings;$(EngineRoot)external;$(EngineRoot)external\\lua\\tolua;$(EngineRoot)external\\lua\\lua;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\n      <MinimalRebuild>false</MinimalRebuild>\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\n      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\n      <Optimization>Disabled</Optimization>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>libcurl_imp.lib;lua51.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Midl>\n      <MkTypLibCompatible>false</MkTypLibCompatible>\n      <TargetEnvironment>Win32</TargetEnvironment>\n      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <HeaderFileName>FlappyBird.h</HeaderFileName>\n      <InterfaceIdentifierFileName>FlappyBird_i.c</InterfaceIdentifierFileName>\n      <ProxyFileName>FlappyBird_p.c</ProxyFileName>\n      <GenerateStublessProxies>true</GenerateStublessProxies>\n      <TypeLibraryName>$(IntDir)/FlappyBird.tlb</TypeLibraryName>\n      <DllDataFileName>\n      </DllDataFileName>\n    </Midl>\n    <PreBuildEvent>\n      <Command>xcopy \"$(ProjectDir)..\\cocos2d\\cocos\\scripting\\lua\\script\" \"$(ProjectDir)..\\Resources\" /e /Y</Command>\n      <Message>\n      </Message>\n    </PreBuildEvent>\n    <PreLinkEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\cocos2d\\external\\websockets\\prebuilt\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreLinkEvent>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <AdditionalIncludeDirectories>$(ProjectDir)..\\Classes;$(EngineRoot)cocos\\audio\\include;$(EngineRoot)cocos\\scripting\\auto-generated\\lua-bindings;$(EngineRoot)cocos\\scripting\\lua\\bindings;$(EngineRoot)external;$(EngineRoot)external\\lua\\tolua;$(EngineRoot)external\\lua\\lua;$(EngineRoot)external\\chipmunk\\include\\chipmunk;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PrecompiledHeader>\n      </PrecompiledHeader>\n      <WarningLevel>Level3</WarningLevel>\n      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\n      <ExceptionHandling>\n      </ExceptionHandling>\n      <DebugInformationFormat>\n      </DebugInformationFormat>\n      <PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGSNDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <TargetMachine>MachineX86</TargetMachine>\n      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>lua51.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n    </Link>\n    <ResourceCompile>\n      <Culture>0x0409</Culture>\n      <AdditionalIncludeDirectories>$(MSBuildProgramFiles32)\\Microsoft SDKs\\Windows\\v7.1A\\include;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n    </ResourceCompile>\n    <Midl>\n      <MkTypLibCompatible>false</MkTypLibCompatible>\n      <TargetEnvironment>Win32</TargetEnvironment>\n      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <HeaderFileName>FlappyBird.h</HeaderFileName>\n      <InterfaceIdentifierFileName>FlappyBird_i.c</InterfaceIdentifierFileName>\n      <ProxyFileName>FlappyBird_p.c</ProxyFileName>\n      <GenerateStublessProxies>true</GenerateStublessProxies>\n      <TypeLibraryName>$(IntDir)/FlappyBird.tlb</TypeLibraryName>\n      <DllDataFileName>\n      </DllDataFileName>\n    </Midl>\n    <PreBuildEvent>\n      <Command>\n      </Command>\n      <Message>\n      </Message>\n    </PreBuildEvent>\n    <PreLinkEvent>\n      <Command>if not exist \"$(OutDir)\" mkdir \"$(OutDir)\"\nxcopy /Y /Q \"$(ProjectDir)..\\cocos2d\\external\\websockets\\prebuilt\\win32\\*.*\" \"$(OutDir)\"</Command>\n    </PreLinkEvent>\n  </ItemDefinitionGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\Classes\\AdmobHelper.h\" />\n    <ClInclude Include=\"..\\Classes\\AppDelegate.h\" />\n    <ClInclude Include=\"..\\Classes\\LuaInterface\\luaconf.h\" />\n    <ClInclude Include=\"..\\Classes\\LuaInterface\\lua_tinker.h\" />\n    <ClInclude Include=\"main.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\Classes\\AdmobHelper.cpp\" />\n    <ClCompile Include=\"..\\Classes\\AppDelegate.cpp\" />\n    <ClCompile Include=\"..\\Classes\\LuaInterface\\lua_tinker.cpp\" />\n    <ClCompile Include=\"main.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"game.rc\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\2d\\cocos2d.vcxproj\">\n      <Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\audio\\proj.win32\\CocosDenshion.vcxproj\">\n      <Project>{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\editor-support\\cocosbuilder\\proj.win32\\libCocosBuilder.vcxproj\">\n      <Project>{811c0dab-7b96-4bd3-a154-b7572b58e4ab}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\editor-support\\cocostudio\\proj.win32\\libCocosStudio.vcxproj\">\n      <Project>{b57cf53f-2e49-4031-9822-047cc0e6bde2}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\editor-support\\spine\\proj.win32\\libSpine.vcxproj\">\n      <Project>{b7c2a162-dec9-4418-972e-240ab3cbfcae}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\gui\\proj.win32\\libGUI.vcxproj\">\n      <Project>{7e06e92c-537a-442b-9e4a-4761c84f8a1a}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\network\\proj.win32\\libNetwork.vcxproj\">\n      <Project>{df2638c0-8128-4847-867c-6eafe3dee7b5}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\cocos\\scripting\\lua\\bindings\\liblua.vcxproj\">\n      <Project>{ddc3e27f-004d-4dd4-9dd3-931a013d2159}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\extensions\\proj.win32\\libExtensions.vcxproj\">\n      <Project>{21b2c324-891f-48ea-ad1a-5ae13de12e28}</Project>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\cocos2d\\external\\chipmunk\\proj.win32\\chipmunk.vcxproj\">\n      <Project>{207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "proj.win32/FlappyBird.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Classes\">\n      <UniqueIdentifier>{fc5cb953-2953-4968-83b3-39e3ff951754}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"win32\">\n      <UniqueIdentifier>{037a9a02-b906-4cc5-ad98-304acd4e25ee}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"resource\">\n      <UniqueIdentifier>{2d1d0979-58cd-4ab6-b91c-13650158f1fa}</UniqueIdentifier>\n    </Filter>\n    <Filter Include=\"Classes\\LuaInterface\">\n      <UniqueIdentifier>{774dfd76-552f-4345-8f45-738b4b5463e6}</UniqueIdentifier>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"..\\Classes\\AppDelegate.h\">\n      <Filter>Classes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"main.h\">\n      <Filter>win32</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Classes\\AdmobHelper.h\">\n      <Filter>Classes</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Classes\\LuaInterface\\lua_tinker.h\">\n      <Filter>Classes\\LuaInterface</Filter>\n    </ClInclude>\n    <ClInclude Include=\"..\\Classes\\LuaInterface\\luaconf.h\">\n      <Filter>Classes\\LuaInterface</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"..\\Classes\\AppDelegate.cpp\">\n      <Filter>Classes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"main.cpp\">\n      <Filter>win32</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Classes\\AdmobHelper.cpp\">\n      <Filter>Classes</Filter>\n    </ClCompile>\n    <ClCompile Include=\"..\\Classes\\LuaInterface\\lua_tinker.cpp\">\n      <Filter>Classes\\LuaInterface</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ResourceCompile Include=\"game.rc\">\n      <Filter>resource</Filter>\n    </ResourceCompile>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "proj.win32/game.rc",
    "content": "// Microsoft Visual C++ generated resource script.\n//\n#include \"resource.h\"\n\n#define APSTUDIO_READONLY_SYMBOLS\n/////////////////////////////////////////////////////////////////////////////\n//\n// Generated from the TEXTINCLUDE 2 resource.\n//\n#define APSTUDIO_HIDDEN_SYMBOLS\n#include \"windows.h\"\n#undef APSTUDIO_HIDDEN_SYMBOLS\n/////////////////////////////////////////////////////////////////////////////\n#undef APSTUDIO_READONLY_SYMBOLS\n\n/////////////////////////////////////////////////////////////////////////////\n// English (U.S.) resources\n\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\n#ifdef _WIN32\nLANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\n#pragma code_page(1252)\n#endif //_WIN32\n\n#ifdef APSTUDIO_INVOKED\n/////////////////////////////////////////////////////////////////////////////\n//\n// TEXTINCLUDE\n//\n\n1 TEXTINCLUDE \nBEGIN\n    \"resource.h\\0\"\nEND\n\n#endif    // APSTUDIO_INVOKED\n\n/////////////////////////////////////////////////////////////////////////////\n//\n// Icon\n//\n\n// Icon with lowest ID value placed first to ensure application icon\n// remains consistent on all systems.\nGLFW_ICON           ICON                    \"res\\\\game.ico\"\n\n/////////////////////////////////////////////////////////////////////////////\n//\n// Version\n//\n\nVS_VERSION_INFO VERSIONINFO\n FILEVERSION 1,0,0,1\n PRODUCTVERSION 1,0,0,1\n FILEFLAGSMASK 0x3fL\n#ifdef _DEBUG\n FILEFLAGS 0x1L\n#else\n FILEFLAGS 0x0L\n#endif\n FILEOS 0x4L\n FILETYPE 0x2L\n FILESUBTYPE 0x0L\nBEGIN\n    BLOCK \"StringFileInfo\"\n    BEGIN\n        BLOCK \"040904B0\"\n        BEGIN\n            VALUE \"CompanyName\", \"\\0\"\n            VALUE \"FileDescription\", \"FlappyBird Module\\0\"\n            VALUE \"FileVersion\", \"1, 0, 0, 1\\0\"\n            VALUE \"InternalName\", \"FlappyBird\\0\"\n            VALUE \"LegalCopyright\", \"Copyright \\0\"\n            VALUE \"OriginalFilename\", \"FlappyBird.exe\\0\"\n            VALUE \"ProductName\", \"FlappyBird Module\\0\"\n            VALUE \"ProductVersion\", \"1, 0, 0, 1\\0\"\n        END\n    END\n    BLOCK \"VarFileInfo\"\n    BEGIN\n        VALUE \"Translation\", 0x0409, 0x04B0\n    END\nEND\n\n/////////////////////////////////////////////////////////////////////////////\n#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\n"
  },
  {
    "path": "proj.win32/main.cpp",
    "content": "#include \"main.h\"\n#include \"AppDelegate.h\"\n#include \"cocos2d.h\"\n\nUSING_NS_CC;\n\n// uncomment below line, open debug console\n#define USE_WIN32_CONSOLE\n\nint APIENTRY _tWinMain(HINSTANCE hInstance,\n                       HINSTANCE hPrevInstance,\n                       LPTSTR    lpCmdLine,\n                       int       nCmdShow)\n{\n    UNREFERENCED_PARAMETER(hPrevInstance);\n    UNREFERENCED_PARAMETER(lpCmdLine);\n\n#ifdef USE_WIN32_CONSOLE\n    AllocConsole();\n    freopen(\"CONIN$\", \"r\", stdin);\n    freopen(\"CONOUT$\", \"w\", stdout);\n    freopen(\"CONOUT$\", \"w\", stderr);\n#endif\n\n    // create the application instance\n    AppDelegate app;\n    EGLView eglView;\n    eglView.init(\"OpenBird - Ge Ziyang\", 450, 800);\n\n    int ret = Application::getInstance()->run();\n\n#ifdef USE_WIN32_CONSOLE\n    FreeConsole();\n#endif\n\n    return ret;\n}\n"
  },
  {
    "path": "proj.win32/main.h",
    "content": "#ifndef __MAIN_H__\n#define __MAIN_H__\n\n#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers\n\n// Windows Header Files:\n#include <windows.h>\n#include <tchar.h>\n\n#endif    // __WINMAIN_H__\n"
  },
  {
    "path": "proj.win32/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by game.RC\n//\n\n#define IDS_PROJNAME                100\n#define IDR_TESTLUA    100\n\n#define ID_FILE_NEW_WINDOW            32771\n\n// Next default values for new objects\n// \n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NEXT_RESOURCE_VALUE    201\n#define _APS_NEXT_CONTROL_VALUE        1000\n#define _APS_NEXT_SYMED_VALUE        101\n#define _APS_NEXT_COMMAND_VALUE        32775\n#endif\n#endif\n"
  }
]